# ✨@yuuvis/media-viewer schematics✨

This package provides schematics for adding the Yuuvis Media Viewer to your Angular project.

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Schematics](#schematics)
  - [ng-add](#ng-add)
  - [update](#update)
  - [vite-compatibility](#vite-compatibility)
- [Schema](#schema)

## Installation

To install the schematics, run:

```sh
npm install @yuuvis/media-viewer --save
```

## Usage

To use the schematics, run:

```sh
ng add @yuuvis/media-viewer
```

## Schematics

### ng-add

This schematic adds the Yuuvis Media Viewer to your project.

## Schema

| Property       | Type    | Description                               | Default               |
| -------------- | ------- | ----------------------------------------- | --------------------- |
| project        | string  | The name of the project.                  |                       |
| officeEndpoint | string  | The URL of the office server.             | http://localhost:8080 |
| skipEinvoice   | boolean | Disable eInvoice support.                 | false                 |
| skipInstall    | boolean | Skip installing the package dependencies. | false                 |

### update

Update to latest version!

### vite-compatibility

Newer angular versions use vite to bundle the application.
And PDFJS used webpack there for there are some warnings in the consel.
This patch removes this warning by replacing the webpack warning suppression webpackIgnore:true with @vite-ignore.

```sh
npx ng generate @yuuvis/media-viewer:vite-compatibility --package=pdfjs-dist --patchPackage
```

## Schema

| Property     | Type    | Description                         | Default |
| ------------ | ------- | ----------------------------------- | ------- |
| package      | string  | Limit fix to a specific package.    |         |
| verbose      | boolean | Enable verbose logging              | false   |
| patchPackage | boolean | Generate patch using patch-package. | false   |

## License

MIT
