@myrmidon/cadmus-layer-demo 10.2.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,24 +1,63 @@
1
- # CadmusLayerDemo
2
-
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.0.0.
4
-
5
- ## Code scaffolding
6
-
7
- Run `ng generate component component-name --project cadmus-layer-demo` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project cadmus-layer-demo`.
8
- > Note: Don't forget to add `--project cadmus-layer-demo` or else it will be added to the default project in your `angular.json` file.
9
-
10
- ## Build
11
-
12
- Run `ng build cadmus-layer-demo` to build the project. The build artifacts will be stored in the `dist/` directory.
13
-
14
- ## Publishing
15
-
16
- After building your library with `ng build cadmus-layer-demo`, go to the dist folder `cd dist/cadmus-layer-demo` and run `npm publish`.
17
-
18
- ## Running unit tests
19
-
20
- Run `ng test cadmus-layer-demo` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
-
22
- ## Further help
23
-
24
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
1
+ # CadmusLayerDemo
2
+
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
8
+
9
+ ```bash
10
+ ng generate component component-name
11
+ ```
12
+
13
+ For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
14
+
15
+ ```bash
16
+ ng generate --help
17
+ ```
18
+
19
+ ## Building
20
+
21
+ To build the library, run:
22
+
23
+ ```bash
24
+ ng build cadmus-layer-demo
25
+ ```
26
+
27
+ This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
28
+
29
+ ### Publishing the Library
30
+
31
+ Once the project is built, you can publish your library by following these steps:
32
+
33
+ 1. Navigate to the `dist` directory:
34
+ ```bash
35
+ cd dist/cadmus-layer-demo
36
+ ```
37
+
38
+ 2. Run the `npm publish` command to publish your library to the npm registry:
39
+ ```bash
40
+ npm publish
41
+ ```
42
+
43
+ ## Running unit tests
44
+
45
+ To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
46
+
47
+ ```bash
48
+ ng test
49
+ ```
50
+
51
+ ## Running end-to-end tests
52
+
53
+ For end-to-end (e2e) testing, run:
54
+
55
+ ```bash
56
+ ng e2e
57
+ ```
58
+
59
+ Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
60
+
61
+ ## Additional Resources
62
+
63
+ For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
@@ -1,31 +1,29 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ViewChild, NgModule } from '@angular/core';
3
- import * as i2 from '@myrmidon/cadmus-core';
4
- import { TokenLocation, CadmusCoreModule } from '@myrmidon/cadmus-core';
2
+ import { Component, ViewChild } from '@angular/core';
5
3
  import * as i1 from '@angular/forms';
6
4
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
7
- import * as i3 from '@angular/material/button';
8
- import { MatButtonModule } from '@angular/material/button';
9
- import * as i4 from '@angular/material/card';
10
- import { MatCardModule } from '@angular/material/card';
11
- import * as i5 from '@angular/material/form-field';
12
- import { MatFormFieldModule } from '@angular/material/form-field';
13
- import * as i6 from '@angular/material/icon';
14
- import { MatIconModule } from '@angular/material/icon';
15
- import * as i7 from '@angular/material/input';
16
- import { MatInputModule } from '@angular/material/input';
17
- import * as i8 from '@angular/material/toolbar';
18
- import { MatToolbarModule } from '@angular/material/toolbar';
19
- import * as i9 from '@angular/material/tooltip';
20
- import { MatTooltipModule } from '@angular/material/tooltip';
21
- import * as i10 from '@myrmidon/ngx-tools';
5
+ import { MatCard, MatCardHeader, MatCardContent } from '@angular/material/card';
6
+ import { MatFormField, MatLabel, MatHint } from '@angular/material/form-field';
7
+ import { MatInput } from '@angular/material/input';
8
+ import { MatToolbar } from '@angular/material/toolbar';
9
+ import { MatIconButton } from '@angular/material/button';
10
+ import { MatTooltip } from '@angular/material/tooltip';
11
+ import { MatIcon } from '@angular/material/icon';
22
12
  import { SafeHtmlPipe } from '@myrmidon/ngx-tools';
23
- import { CommonModule } from '@angular/common';
24
- import * as i1$1 from '@angular/router';
25
- import { RouterModule } from '@angular/router';
26
- import { CadmusUiModule } from '@myrmidon/cadmus-ui';
13
+ import * as i2 from '@myrmidon/cadmus-core';
14
+ import { TokenLocation } from '@myrmidon/cadmus-core';
27
15
 
28
16
  class LayerDemoComponent {
17
+ _textLayerService;
18
+ _resultElement;
19
+ locations;
20
+ result;
21
+ userLocation;
22
+ // form
23
+ rendition;
24
+ text;
25
+ location;
26
+ textSize;
29
27
  constructor(formBuilder, _textLayerService) {
30
28
  this._textLayerService = _textLayerService;
31
29
  this.textSize = 14;
@@ -116,82 +114,32 @@ class LayerDemoComponent {
116
114
  this.userLocation =
117
115
  this._textLayerService.getSelectedLocationForEdit(this._textLayerService.getSelectedRange()) || undefined;
118
116
  }
119
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LayerDemoComponent, deps: [{ token: i1.FormBuilder }, { token: i2.TextLayerService }], target: i0.ɵɵFactoryTarget.Component }); }
120
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: LayerDemoComponent, isStandalone: false, selector: "cadmus-layer-demo", viewQueries: [{ propertyName: "_resultElement", first: true, predicate: ["resultElem"], descendants: true }], ngImport: i0, template: "<mat-card appearance=\"outlined\">\n <mat-card-header>\n <h3>Layered Text Demo</h3>\n </mat-card-header>\n <mat-card-content>\n <article>\n <p>\n Enter some base text and zero or more layer fragments locations, then\n click the render button. This renders the base text with all its ranges.\n </p>\n <p>\n Once the text has been decorated, select any portion of it, either\n including a decorated part, or not. Then, if you selected a part\n including decorations, click the location button with the checkmark\n (=get the location of the fragment to edit); else, click the location\n button with the plus (=get the location of a new fragment).\n </p>\n <p>\n This will show you the token-based coordinates corresponding to your\n selection, provided that if you include any portion of a decorated text\n you will get the full coordinates of the decoration; otherwise, you will\n just get the coordinates of the selected character(s).\n </p>\n <p>\n This behavior is used to allow users edit existing part fragments by\n just selecting any part of it, even partially; while they must be\n precise when they are creating a new fragment.\n </p>\n </article>\n <hr />\n\n <form [formGroup]=\"rendition\" (ngSubmit)=\"render()\">\n <div>\n <mat-form-field>\n <mat-label>base text</mat-label>\n <textarea\n matInput\n type=\"text\"\n id=\"text\"\n maxlength=\"1000\"\n spellcheck=\"false\"\n formControlName=\"text\"\n ></textarea>\n </mat-form-field>\n </div>\n\n <div>\n <mat-form-field>\n <mat-label>location</mat-label>\n <input\n matInput\n type=\"text\"\n id=\"location\"\n required\n spellcheck=\"false\"\n formControlName=\"location\"\n />\n <mat-hint>Y.X&#64;AxR</mat-hint>\n </mat-form-field>\n </div>\n\n <div>\n <mat-toolbar>\n <span>\n <button\n mat-icon-button\n (click)=\"addLocation()\"\n type=\"button\"\n matTooltip=\"Add the specified location\"\n >\n <mat-icon style=\"color: #66cc75\">add_circle</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"clearLocations()\"\n type=\"button\"\n matTooltip=\"Remove all the locations\"\n >\n <mat-icon class=\"mat-warn\">delete_sweep</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"submit\"\n matTooltip=\"Render the decorated base text\"\n >\n <mat-icon class=\"mat-primary\">play_circle_outline</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"getLocationForNew()\"\n type=\"button\"\n matTooltip=\"Get location for new item\"\n >\n <mat-icon>playlist_add</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"getLocationForEdit()\"\n type=\"button\"\n matTooltip=\"Get location for selected item\"\n >\n <mat-icon>playlist_add_check</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Larger text\"\n (click)=\"makeLarger()\"\n [disabled]=\"textSize >= 24\"\n >\n <mat-icon>format_size</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Smaller text\"\n (click)=\"makeSmaller()\"\n [disabled]=\"textSize <= 12\"\n >\n <mat-icon>text_fields</mat-icon>\n </button>\n </span>\n <span class=\"tb-fill-remaining-space\"></span>\n <span>{{ userLocation }}</span>\n </mat-toolbar>\n </div>\n\n <table>\n <tbody>\n @for (loc of locations; track loc) {\n <tr>\n <td>\n <button mat-icon-button (click)=\"removeLocation(loc)\">\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\n </button>\n </td>\n <td>{{ loc.toString() }}</td>\n </tr>\n }\n </tbody>\n </table>\n </form>\n </mat-card-content>\n</mat-card>\n\n<mat-card appearance=\"outlined\">\n <mat-card-header>\n <h3>Rendition</h3>\n </mat-card-header>\n <mat-card-content>\n <div\n [style.font-size]=\"textSize + 'px'\"\n [innerHtml]=\"result | safeHtml : 'html'\"\n id=\"result\"\n #resultElem\n ></div>\n <hr />\n <div>\n <code>{{ result }}</code>\n </div>\n </mat-card-content>\n</mat-card>\n", styles: ["textarea#text{min-width:300px;min-height:100px}:host ::ng-deep div#result{counter-reset:text-y-counter}:host ::ng-deep div#result p:before{content:counter(text-y-counter);counter-increment:text-y-counter;margin-right:6px;color:#a0a0a0}:host ::ng-deep span.fr{background-color:#ff0;border:1px solid silver;border-radius:6px}article{column-width:20em}\n"], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i4.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i4.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i4.MatCardHeader, selector: "mat-card-header" }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i8.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i9.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i10.SafeHtmlPipe, name: "safeHtml" }] }); }
117
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LayerDemoComponent, deps: [{ token: i1.FormBuilder }, { token: i2.TextLayerService }], target: i0.ɵɵFactoryTarget.Component });
118
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: LayerDemoComponent, isStandalone: true, selector: "cadmus-layer-demo", viewQueries: [{ propertyName: "_resultElement", first: true, predicate: ["resultElem"], descendants: true }], ngImport: i0, template: "<mat-card appearance=\"outlined\">\n <mat-card-header>\n <h3>Layered Text Demo</h3>\n </mat-card-header>\n <mat-card-content>\n <article>\n <p>\n Enter some base text and zero or more layer fragments locations, then\n click the render button. This renders the base text with all its ranges.\n </p>\n <p>\n Once the text has been decorated, select any portion of it, either\n including a decorated part, or not. Then, if you selected a part\n including decorations, click the location button with the checkmark\n (=get the location of the fragment to edit); else, click the location\n button with the plus (=get the location of a new fragment).\n </p>\n <p>\n This will show you the token-based coordinates corresponding to your\n selection, provided that if you include any portion of a decorated text\n you will get the full coordinates of the decoration; otherwise, you will\n just get the coordinates of the selected character(s).\n </p>\n <p>\n This behavior is used to allow users edit existing part fragments by\n just selecting any part of it, even partially; while they must be\n precise when they are creating a new fragment.\n </p>\n </article>\n <hr />\n\n <form [formGroup]=\"rendition\" (ngSubmit)=\"render()\">\n <div>\n <mat-form-field>\n <mat-label>base text</mat-label>\n <textarea\n matInput\n type=\"text\"\n id=\"text\"\n maxlength=\"1000\"\n spellcheck=\"false\"\n formControlName=\"text\"\n ></textarea>\n </mat-form-field>\n </div>\n\n <div>\n <mat-form-field>\n <mat-label>location</mat-label>\n <input\n matInput\n type=\"text\"\n id=\"location\"\n required\n spellcheck=\"false\"\n formControlName=\"location\"\n />\n <mat-hint>Y.X&#64;AxR</mat-hint>\n </mat-form-field>\n </div>\n\n <div>\n <mat-toolbar>\n <span>\n <button\n mat-icon-button\n (click)=\"addLocation()\"\n type=\"button\"\n matTooltip=\"Add the specified location\"\n >\n <mat-icon style=\"color: #66cc75\">add_circle</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"clearLocations()\"\n type=\"button\"\n matTooltip=\"Remove all the locations\"\n >\n <mat-icon class=\"mat-warn\">delete_sweep</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"submit\"\n matTooltip=\"Render the decorated base text\"\n >\n <mat-icon class=\"mat-primary\">play_circle_outline</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"getLocationForNew()\"\n type=\"button\"\n matTooltip=\"Get location for new item\"\n >\n <mat-icon>playlist_add</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"getLocationForEdit()\"\n type=\"button\"\n matTooltip=\"Get location for selected item\"\n >\n <mat-icon>playlist_add_check</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Larger text\"\n (click)=\"makeLarger()\"\n [disabled]=\"textSize >= 24\"\n >\n <mat-icon>format_size</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Smaller text\"\n (click)=\"makeSmaller()\"\n [disabled]=\"textSize <= 12\"\n >\n <mat-icon>text_fields</mat-icon>\n </button>\n </span>\n <span class=\"tb-fill-remaining-space\"></span>\n <span>{{ userLocation }}</span>\n </mat-toolbar>\n </div>\n\n <table>\n <tbody>\n @for (loc of locations; track loc) {\n <tr>\n <td>\n <button mat-icon-button (click)=\"removeLocation(loc)\">\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\n </button>\n </td>\n <td>{{ loc.toString() }}</td>\n </tr>\n }\n </tbody>\n </table>\n </form>\n </mat-card-content>\n</mat-card>\n\n<mat-card appearance=\"outlined\">\n <mat-card-header>\n <h3>Rendition</h3>\n </mat-card-header>\n <mat-card-content>\n <div\n [style.font-size]=\"textSize + 'px'\"\n [innerHtml]=\"result | safeHtml : 'html'\"\n id=\"result\"\n #resultElem\n ></div>\n <hr />\n <div>\n <code>{{ result }}</code>\n </div>\n </mat-card-content>\n</mat-card>\n", styles: ["textarea#text{min-width:300px;min-height:100px}:host ::ng-deep div#result{counter-reset:text-y-counter}:host ::ng-deep div#result p:before{content:counter(text-y-counter);counter-increment:text-y-counter;margin-right:6px;color:#a0a0a0}:host ::ng-deep span.fr{background-color:#ff0;border:1px solid silver;border-radius:6px}article{column-width:20em}\n"], dependencies: [{ kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: SafeHtmlPipe, name: "safeHtml" }] });
121
119
  }
122
120
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: LayerDemoComponent, decorators: [{
123
121
  type: Component,
124
- args: [{ selector: 'cadmus-layer-demo', standalone: false, template: "<mat-card appearance=\"outlined\">\n <mat-card-header>\n <h3>Layered Text Demo</h3>\n </mat-card-header>\n <mat-card-content>\n <article>\n <p>\n Enter some base text and zero or more layer fragments locations, then\n click the render button. This renders the base text with all its ranges.\n </p>\n <p>\n Once the text has been decorated, select any portion of it, either\n including a decorated part, or not. Then, if you selected a part\n including decorations, click the location button with the checkmark\n (=get the location of the fragment to edit); else, click the location\n button with the plus (=get the location of a new fragment).\n </p>\n <p>\n This will show you the token-based coordinates corresponding to your\n selection, provided that if you include any portion of a decorated text\n you will get the full coordinates of the decoration; otherwise, you will\n just get the coordinates of the selected character(s).\n </p>\n <p>\n This behavior is used to allow users edit existing part fragments by\n just selecting any part of it, even partially; while they must be\n precise when they are creating a new fragment.\n </p>\n </article>\n <hr />\n\n <form [formGroup]=\"rendition\" (ngSubmit)=\"render()\">\n <div>\n <mat-form-field>\n <mat-label>base text</mat-label>\n <textarea\n matInput\n type=\"text\"\n id=\"text\"\n maxlength=\"1000\"\n spellcheck=\"false\"\n formControlName=\"text\"\n ></textarea>\n </mat-form-field>\n </div>\n\n <div>\n <mat-form-field>\n <mat-label>location</mat-label>\n <input\n matInput\n type=\"text\"\n id=\"location\"\n required\n spellcheck=\"false\"\n formControlName=\"location\"\n />\n <mat-hint>Y.X&#64;AxR</mat-hint>\n </mat-form-field>\n </div>\n\n <div>\n <mat-toolbar>\n <span>\n <button\n mat-icon-button\n (click)=\"addLocation()\"\n type=\"button\"\n matTooltip=\"Add the specified location\"\n >\n <mat-icon style=\"color: #66cc75\">add_circle</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"clearLocations()\"\n type=\"button\"\n matTooltip=\"Remove all the locations\"\n >\n <mat-icon class=\"mat-warn\">delete_sweep</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"submit\"\n matTooltip=\"Render the decorated base text\"\n >\n <mat-icon class=\"mat-primary\">play_circle_outline</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"getLocationForNew()\"\n type=\"button\"\n matTooltip=\"Get location for new item\"\n >\n <mat-icon>playlist_add</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"getLocationForEdit()\"\n type=\"button\"\n matTooltip=\"Get location for selected item\"\n >\n <mat-icon>playlist_add_check</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Larger text\"\n (click)=\"makeLarger()\"\n [disabled]=\"textSize >= 24\"\n >\n <mat-icon>format_size</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Smaller text\"\n (click)=\"makeSmaller()\"\n [disabled]=\"textSize <= 12\"\n >\n <mat-icon>text_fields</mat-icon>\n </button>\n </span>\n <span class=\"tb-fill-remaining-space\"></span>\n <span>{{ userLocation }}</span>\n </mat-toolbar>\n </div>\n\n <table>\n <tbody>\n @for (loc of locations; track loc) {\n <tr>\n <td>\n <button mat-icon-button (click)=\"removeLocation(loc)\">\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\n </button>\n </td>\n <td>{{ loc.toString() }}</td>\n </tr>\n }\n </tbody>\n </table>\n </form>\n </mat-card-content>\n</mat-card>\n\n<mat-card appearance=\"outlined\">\n <mat-card-header>\n <h3>Rendition</h3>\n </mat-card-header>\n <mat-card-content>\n <div\n [style.font-size]=\"textSize + 'px'\"\n [innerHtml]=\"result | safeHtml : 'html'\"\n id=\"result\"\n #resultElem\n ></div>\n <hr />\n <div>\n <code>{{ result }}</code>\n </div>\n </mat-card-content>\n</mat-card>\n", styles: ["textarea#text{min-width:300px;min-height:100px}:host ::ng-deep div#result{counter-reset:text-y-counter}:host ::ng-deep div#result p:before{content:counter(text-y-counter);counter-increment:text-y-counter;margin-right:6px;color:#a0a0a0}:host ::ng-deep span.fr{background-color:#ff0;border:1px solid silver;border-radius:6px}article{column-width:20em}\n"] }]
122
+ args: [{ selector: 'cadmus-layer-demo', imports: [
123
+ MatCard,
124
+ MatCardHeader,
125
+ MatCardContent,
126
+ FormsModule,
127
+ ReactiveFormsModule,
128
+ MatFormField,
129
+ MatLabel,
130
+ MatInput,
131
+ MatHint,
132
+ MatToolbar,
133
+ MatIconButton,
134
+ MatTooltip,
135
+ MatIcon,
136
+ SafeHtmlPipe,
137
+ ], template: "<mat-card appearance=\"outlined\">\n <mat-card-header>\n <h3>Layered Text Demo</h3>\n </mat-card-header>\n <mat-card-content>\n <article>\n <p>\n Enter some base text and zero or more layer fragments locations, then\n click the render button. This renders the base text with all its ranges.\n </p>\n <p>\n Once the text has been decorated, select any portion of it, either\n including a decorated part, or not. Then, if you selected a part\n including decorations, click the location button with the checkmark\n (=get the location of the fragment to edit); else, click the location\n button with the plus (=get the location of a new fragment).\n </p>\n <p>\n This will show you the token-based coordinates corresponding to your\n selection, provided that if you include any portion of a decorated text\n you will get the full coordinates of the decoration; otherwise, you will\n just get the coordinates of the selected character(s).\n </p>\n <p>\n This behavior is used to allow users edit existing part fragments by\n just selecting any part of it, even partially; while they must be\n precise when they are creating a new fragment.\n </p>\n </article>\n <hr />\n\n <form [formGroup]=\"rendition\" (ngSubmit)=\"render()\">\n <div>\n <mat-form-field>\n <mat-label>base text</mat-label>\n <textarea\n matInput\n type=\"text\"\n id=\"text\"\n maxlength=\"1000\"\n spellcheck=\"false\"\n formControlName=\"text\"\n ></textarea>\n </mat-form-field>\n </div>\n\n <div>\n <mat-form-field>\n <mat-label>location</mat-label>\n <input\n matInput\n type=\"text\"\n id=\"location\"\n required\n spellcheck=\"false\"\n formControlName=\"location\"\n />\n <mat-hint>Y.X&#64;AxR</mat-hint>\n </mat-form-field>\n </div>\n\n <div>\n <mat-toolbar>\n <span>\n <button\n mat-icon-button\n (click)=\"addLocation()\"\n type=\"button\"\n matTooltip=\"Add the specified location\"\n >\n <mat-icon style=\"color: #66cc75\">add_circle</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"clearLocations()\"\n type=\"button\"\n matTooltip=\"Remove all the locations\"\n >\n <mat-icon class=\"mat-warn\">delete_sweep</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"submit\"\n matTooltip=\"Render the decorated base text\"\n >\n <mat-icon class=\"mat-primary\">play_circle_outline</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"getLocationForNew()\"\n type=\"button\"\n matTooltip=\"Get location for new item\"\n >\n <mat-icon>playlist_add</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"getLocationForEdit()\"\n type=\"button\"\n matTooltip=\"Get location for selected item\"\n >\n <mat-icon>playlist_add_check</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Larger text\"\n (click)=\"makeLarger()\"\n [disabled]=\"textSize >= 24\"\n >\n <mat-icon>format_size</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Smaller text\"\n (click)=\"makeSmaller()\"\n [disabled]=\"textSize <= 12\"\n >\n <mat-icon>text_fields</mat-icon>\n </button>\n </span>\n <span class=\"tb-fill-remaining-space\"></span>\n <span>{{ userLocation }}</span>\n </mat-toolbar>\n </div>\n\n <table>\n <tbody>\n @for (loc of locations; track loc) {\n <tr>\n <td>\n <button mat-icon-button (click)=\"removeLocation(loc)\">\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\n </button>\n </td>\n <td>{{ loc.toString() }}</td>\n </tr>\n }\n </tbody>\n </table>\n </form>\n </mat-card-content>\n</mat-card>\n\n<mat-card appearance=\"outlined\">\n <mat-card-header>\n <h3>Rendition</h3>\n </mat-card-header>\n <mat-card-content>\n <div\n [style.font-size]=\"textSize + 'px'\"\n [innerHtml]=\"result | safeHtml : 'html'\"\n id=\"result\"\n #resultElem\n ></div>\n <hr />\n <div>\n <code>{{ result }}</code>\n </div>\n </mat-card-content>\n</mat-card>\n", styles: ["textarea#text{min-width:300px;min-height:100px}:host ::ng-deep div#result{counter-reset:text-y-counter}:host ::ng-deep div#result p:before{content:counter(text-y-counter);counter-increment:text-y-counter;margin-right:6px;color:#a0a0a0}:host ::ng-deep span.fr{background-color:#ff0;border:1px solid silver;border-radius:6px}article{column-width:20em}\n"] }]
125
138
  }], ctorParameters: () => [{ type: i1.FormBuilder }, { type: i2.TextLayerService }], propDecorators: { _resultElement: [{
126
139
  type: ViewChild,
127
140
  args: ['resultElem']
128
141
  }] } });
129
142
 
130
- // https://github.com/ng-packagr/ng-packagr/issues/778
131
- const RouterModuleForChild = RouterModule.forChild([
132
- { path: '', pathMatch: 'full', component: LayerDemoComponent },
133
- ]);
134
- class CadmusLayerDemoModule {
135
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CadmusLayerDemoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
136
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.5", ngImport: i0, type: CadmusLayerDemoModule, declarations: [LayerDemoComponent], imports: [CommonModule,
137
- FormsModule,
138
- ReactiveFormsModule, i1$1.RouterModule,
139
- // material
140
- MatButtonModule,
141
- MatCardModule,
142
- MatFormFieldModule,
143
- MatIconModule,
144
- MatInputModule,
145
- MatToolbarModule,
146
- MatTooltipModule,
147
- // myrmidon
148
- SafeHtmlPipe,
149
- // cadmus
150
- CadmusCoreModule,
151
- CadmusUiModule], exports: [LayerDemoComponent] }); }
152
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CadmusLayerDemoModule, imports: [CommonModule,
153
- FormsModule,
154
- ReactiveFormsModule,
155
- RouterModuleForChild,
156
- // material
157
- MatButtonModule,
158
- MatCardModule,
159
- MatFormFieldModule,
160
- MatIconModule,
161
- MatInputModule,
162
- MatToolbarModule,
163
- MatTooltipModule,
164
- // cadmus
165
- CadmusCoreModule,
166
- CadmusUiModule] }); }
167
- }
168
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: CadmusLayerDemoModule, decorators: [{
169
- type: NgModule,
170
- args: [{
171
- imports: [
172
- CommonModule,
173
- FormsModule,
174
- ReactiveFormsModule,
175
- RouterModuleForChild,
176
- // material
177
- MatButtonModule,
178
- MatCardModule,
179
- MatFormFieldModule,
180
- MatIconModule,
181
- MatInputModule,
182
- MatToolbarModule,
183
- MatTooltipModule,
184
- // myrmidon
185
- SafeHtmlPipe,
186
- // cadmus
187
- CadmusCoreModule,
188
- CadmusUiModule,
189
- ],
190
- declarations: [LayerDemoComponent],
191
- exports: [LayerDemoComponent],
192
- }]
193
- }] });
194
-
195
143
  /*
196
144
  * Public API Surface of cadmus-layer-demo
197
145
  */
@@ -200,5 +148,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
200
148
  * Generated bundle index. Do not edit.
201
149
  */
202
150
 
203
- export { CadmusLayerDemoModule, LayerDemoComponent, RouterModuleForChild };
151
+ export { LayerDemoComponent };
204
152
  //# sourceMappingURL=myrmidon-cadmus-layer-demo.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"myrmidon-cadmus-layer-demo.mjs","sources":["../../../../projects/myrmidon/cadmus-layer-demo/src/lib/layer-demo/layer-demo.component.ts","../../../../projects/myrmidon/cadmus-layer-demo/src/lib/layer-demo/layer-demo.component.html","../../../../projects/myrmidon/cadmus-layer-demo/src/lib/cadmus-layer-demo.module.ts","../../../../projects/myrmidon/cadmus-layer-demo/src/public-api.ts","../../../../projects/myrmidon/cadmus-layer-demo/src/myrmidon-cadmus-layer-demo.ts"],"sourcesContent":["import { Component, ViewChild, ElementRef } from '@angular/core';\r\nimport { FormGroup, FormControl, FormBuilder } from '@angular/forms';\r\nimport { TextLayerService, TokenLocation } from '@myrmidon/cadmus-core';\r\n\r\n@Component({\r\n selector: 'cadmus-layer-demo',\r\n templateUrl: './layer-demo.component.html',\r\n styleUrls: ['./layer-demo.component.css'],\r\n standalone: false,\r\n})\r\nexport class LayerDemoComponent {\r\n @ViewChild('resultElem') _resultElement?: ElementRef;\r\n\r\n public locations: TokenLocation[];\r\n public result: string;\r\n public userLocation?: TokenLocation;\r\n // form\r\n public rendition: FormGroup;\r\n public text: FormControl<string | null>;\r\n public location: FormControl<string | null>;\r\n\r\n public textSize: number;\r\n\r\n constructor(\r\n formBuilder: FormBuilder,\r\n private _textLayerService: TextLayerService\r\n ) {\r\n this.textSize = 14;\r\n this.locations = [];\r\n this.text = formBuilder.control(\r\n 'alpha beta\\ngamma\\ndelta epsilon waw\\nzeta'\r\n );\r\n this.location = formBuilder.control('1.2@2x2');\r\n this.rendition = formBuilder.group({\r\n text: this.text,\r\n location: this.location,\r\n });\r\n this.result = '';\r\n }\r\n\r\n public makeLarger(): void {\r\n const size = this.textSize + 2;\r\n if (size > 24) {\r\n return;\r\n }\r\n this.textSize = size;\r\n }\r\n\r\n public makeSmaller(): void {\r\n const size = this.textSize - 2;\r\n if (size < 12) {\r\n return;\r\n }\r\n this.textSize = size;\r\n }\r\n\r\n private removeOverlaps(loc: TokenLocation): void {\r\n for (let i = this.locations.length - 1; i > -1; i--) {\r\n if (loc === this.locations[i]) {\r\n continue;\r\n }\r\n if (loc.overlaps(this.locations[i])) {\r\n this.locations.splice(i, 1);\r\n }\r\n }\r\n }\r\n\r\n public addLocation(): void {\r\n if (!this.location.value) {\r\n return;\r\n }\r\n const loc = TokenLocation.parse(this.location.value);\r\n if (!loc) {\r\n return;\r\n }\r\n\r\n let done = false;\r\n for (let i = 0; i < this.locations.length && !done; i++) {\r\n const n = loc.compareTo(this.locations[i]);\r\n // nothing to do if equal\r\n if (n === 0) {\r\n return;\r\n }\r\n // insert before nearest bigger sort value\r\n if (n < 0) {\r\n this.locations.splice(i, 0, loc);\r\n done = true;\r\n }\r\n }\r\n // append if not yet inserted\r\n if (!done) {\r\n this.locations.push(loc);\r\n }\r\n\r\n // remove all the overlapping locations\r\n this.removeOverlaps(loc);\r\n }\r\n\r\n public removeLocation(loc: TokenLocation): void {\r\n const i = this.locations.indexOf(loc);\r\n if (i > -1) {\r\n this.locations.splice(i, 1);\r\n }\r\n }\r\n\r\n public clearLocations(): void {\r\n this.locations.length = 0;\r\n }\r\n\r\n public render(): void {\r\n if (!this.text.value) {\r\n return;\r\n }\r\n this.result = this._textLayerService.render(\r\n this.text.value,\r\n this.locations\r\n );\r\n }\r\n\r\n public getLocationForNew(): void {\r\n if (!this.text.value) {\r\n return;\r\n }\r\n this.userLocation =\r\n this._textLayerService.getSelectedLocationForNew(\r\n this._textLayerService.getSelectedRange()!,\r\n this.text.value\r\n ) || undefined;\r\n }\r\n\r\n public getLocationForEdit(): void {\r\n this.userLocation =\r\n this._textLayerService.getSelectedLocationForEdit(\r\n this._textLayerService.getSelectedRange()!\r\n ) || undefined;\r\n }\r\n}\r\n","<mat-card appearance=\"outlined\">\n <mat-card-header>\n <h3>Layered Text Demo</h3>\n </mat-card-header>\n <mat-card-content>\n <article>\n <p>\n Enter some base text and zero or more layer fragments locations, then\n click the render button. This renders the base text with all its ranges.\n </p>\n <p>\n Once the text has been decorated, select any portion of it, either\n including a decorated part, or not. Then, if you selected a part\n including decorations, click the location button with the checkmark\n (=get the location of the fragment to edit); else, click the location\n button with the plus (=get the location of a new fragment).\n </p>\n <p>\n This will show you the token-based coordinates corresponding to your\n selection, provided that if you include any portion of a decorated text\n you will get the full coordinates of the decoration; otherwise, you will\n just get the coordinates of the selected character(s).\n </p>\n <p>\n This behavior is used to allow users edit existing part fragments by\n just selecting any part of it, even partially; while they must be\n precise when they are creating a new fragment.\n </p>\n </article>\n <hr />\n\n <form [formGroup]=\"rendition\" (ngSubmit)=\"render()\">\n <div>\n <mat-form-field>\n <mat-label>base text</mat-label>\n <textarea\n matInput\n type=\"text\"\n id=\"text\"\n maxlength=\"1000\"\n spellcheck=\"false\"\n formControlName=\"text\"\n ></textarea>\n </mat-form-field>\n </div>\n\n <div>\n <mat-form-field>\n <mat-label>location</mat-label>\n <input\n matInput\n type=\"text\"\n id=\"location\"\n required\n spellcheck=\"false\"\n formControlName=\"location\"\n />\n <mat-hint>Y.X&#64;AxR</mat-hint>\n </mat-form-field>\n </div>\n\n <div>\n <mat-toolbar>\n <span>\n <button\n mat-icon-button\n (click)=\"addLocation()\"\n type=\"button\"\n matTooltip=\"Add the specified location\"\n >\n <mat-icon style=\"color: #66cc75\">add_circle</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"clearLocations()\"\n type=\"button\"\n matTooltip=\"Remove all the locations\"\n >\n <mat-icon class=\"mat-warn\">delete_sweep</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"submit\"\n matTooltip=\"Render the decorated base text\"\n >\n <mat-icon class=\"mat-primary\">play_circle_outline</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"getLocationForNew()\"\n type=\"button\"\n matTooltip=\"Get location for new item\"\n >\n <mat-icon>playlist_add</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"getLocationForEdit()\"\n type=\"button\"\n matTooltip=\"Get location for selected item\"\n >\n <mat-icon>playlist_add_check</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Larger text\"\n (click)=\"makeLarger()\"\n [disabled]=\"textSize >= 24\"\n >\n <mat-icon>format_size</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Smaller text\"\n (click)=\"makeSmaller()\"\n [disabled]=\"textSize <= 12\"\n >\n <mat-icon>text_fields</mat-icon>\n </button>\n </span>\n <span class=\"tb-fill-remaining-space\"></span>\n <span>{{ userLocation }}</span>\n </mat-toolbar>\n </div>\n\n <table>\n <tbody>\n @for (loc of locations; track loc) {\n <tr>\n <td>\n <button mat-icon-button (click)=\"removeLocation(loc)\">\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\n </button>\n </td>\n <td>{{ loc.toString() }}</td>\n </tr>\n }\n </tbody>\n </table>\n </form>\n </mat-card-content>\n</mat-card>\n\n<mat-card appearance=\"outlined\">\n <mat-card-header>\n <h3>Rendition</h3>\n </mat-card-header>\n <mat-card-content>\n <div\n [style.font-size]=\"textSize + 'px'\"\n [innerHtml]=\"result | safeHtml : 'html'\"\n id=\"result\"\n #resultElem\n ></div>\n <hr />\n <div>\n <code>{{ result }}</code>\n </div>\n </mat-card-content>\n</mat-card>\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { RouterModule, Route } from '@angular/router';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatCardModule } from '@angular/material/card';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatToolbarModule } from '@angular/material/toolbar';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\n\r\nimport { SafeHtmlPipe } from '@myrmidon/ngx-tools';\r\nimport { CadmusCoreModule } from '@myrmidon/cadmus-core';\r\nimport { CadmusUiModule } from '@myrmidon/cadmus-ui';\r\n\r\nimport { LayerDemoComponent } from './layer-demo/layer-demo.component';\r\n\r\n// https://github.com/ng-packagr/ng-packagr/issues/778\r\nexport const RouterModuleForChild = RouterModule.forChild([\r\n { path: '', pathMatch: 'full', component: LayerDemoComponent },\r\n]);\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n RouterModuleForChild,\r\n // material\r\n MatButtonModule,\r\n MatCardModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatToolbarModule,\r\n MatTooltipModule,\r\n // myrmidon\r\n SafeHtmlPipe,\r\n // cadmus\r\n CadmusCoreModule,\r\n CadmusUiModule,\r\n ],\r\n declarations: [LayerDemoComponent],\r\n exports: [LayerDemoComponent],\r\n})\r\nexport class CadmusLayerDemoModule {}\r\n","/*\r\n * Public API Surface of cadmus-layer-demo\r\n */\r\n\r\nexport * from './lib/layer-demo/layer-demo.component';\r\nexport * from './lib/cadmus-layer-demo.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;MAUa,kBAAkB,CAAA;IAa7B,WACE,CAAA,WAAwB,EAChB,iBAAmC,EAAA;QAAnC,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB;AAEzB,QAAA,IAAI,CAAC,QAAQ,GAAG,EAAE;AAClB,QAAA,IAAI,CAAC,SAAS,GAAG,EAAE;QACnB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,OAAO,CAC7B,4CAA4C,CAC7C;QAC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kBAAkB;YAClB,aAAa;YACb,cAAc;YACd,gBAAgB;YAChB,gBAAgB;;YAIhB,gBAAgB;YAChB,cAAc,CAAA,EAAA,CAAA,CAAA;;2FAKL,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAvBjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,oBAAoB;;wBAEpB,eAAe;wBACf,aAAa;wBACb,kBAAkB;wBAClB,aAAa;wBACb,cAAc;wBACd,gBAAgB;wBAChB,gBAAgB;;wBAEhB,YAAY;;wBAEZ,gBAAgB;wBAChB,cAAc;AACf,qBAAA;oBACD,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;AAC9B,iBAAA;;;AC9CD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"myrmidon-cadmus-layer-demo.mjs","sources":["../../../../projects/myrmidon/cadmus-layer-demo/src/lib/layer-demo/layer-demo.component.ts","../../../../projects/myrmidon/cadmus-layer-demo/src/lib/layer-demo/layer-demo.component.html","../../../../projects/myrmidon/cadmus-layer-demo/src/public-api.ts","../../../../projects/myrmidon/cadmus-layer-demo/src/myrmidon-cadmus-layer-demo.ts"],"sourcesContent":["import { Component, ViewChild, ElementRef } from '@angular/core';\r\nimport {\r\n FormGroup,\r\n FormControl,\r\n FormBuilder,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n} from '@angular/forms';\r\n\r\nimport { MatCard, MatCardHeader, MatCardContent } from '@angular/material/card';\r\nimport { MatFormField, MatLabel, MatHint } from '@angular/material/form-field';\r\nimport { MatInput } from '@angular/material/input';\r\nimport { MatToolbar } from '@angular/material/toolbar';\r\nimport { MatIconButton } from '@angular/material/button';\r\nimport { MatTooltip } from '@angular/material/tooltip';\r\nimport { MatIcon } from '@angular/material/icon';\r\n\r\nimport { SafeHtmlPipe } from '@myrmidon/ngx-tools';\r\n\r\nimport { TextLayerService, TokenLocation } from '@myrmidon/cadmus-core';\r\n\r\n@Component({\r\n selector: 'cadmus-layer-demo',\r\n templateUrl: './layer-demo.component.html',\r\n styleUrls: ['./layer-demo.component.css'],\r\n imports: [\r\n MatCard,\r\n MatCardHeader,\r\n MatCardContent,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n MatFormField,\r\n MatLabel,\r\n MatInput,\r\n MatHint,\r\n MatToolbar,\r\n MatIconButton,\r\n MatTooltip,\r\n MatIcon,\r\n SafeHtmlPipe,\r\n ],\r\n})\r\nexport class LayerDemoComponent {\r\n @ViewChild('resultElem') _resultElement?: ElementRef;\r\n\r\n public locations: TokenLocation[];\r\n public result: string;\r\n public userLocation?: TokenLocation;\r\n // form\r\n public rendition: FormGroup;\r\n public text: FormControl<string | null>;\r\n public location: FormControl<string | null>;\r\n\r\n public textSize: number;\r\n\r\n constructor(\r\n formBuilder: FormBuilder,\r\n private _textLayerService: TextLayerService\r\n ) {\r\n this.textSize = 14;\r\n this.locations = [];\r\n this.text = formBuilder.control(\r\n 'alpha beta\\ngamma\\ndelta epsilon waw\\nzeta'\r\n );\r\n this.location = formBuilder.control('1.2@2x2');\r\n this.rendition = formBuilder.group({\r\n text: this.text,\r\n location: this.location,\r\n });\r\n this.result = '';\r\n }\r\n\r\n public makeLarger(): void {\r\n const size = this.textSize + 2;\r\n if (size > 24) {\r\n return;\r\n }\r\n this.textSize = size;\r\n }\r\n\r\n public makeSmaller(): void {\r\n const size = this.textSize - 2;\r\n if (size < 12) {\r\n return;\r\n }\r\n this.textSize = size;\r\n }\r\n\r\n private removeOverlaps(loc: TokenLocation): void {\r\n for (let i = this.locations.length - 1; i > -1; i--) {\r\n if (loc === this.locations[i]) {\r\n continue;\r\n }\r\n if (loc.overlaps(this.locations[i])) {\r\n this.locations.splice(i, 1);\r\n }\r\n }\r\n }\r\n\r\n public addLocation(): void {\r\n if (!this.location.value) {\r\n return;\r\n }\r\n const loc = TokenLocation.parse(this.location.value);\r\n if (!loc) {\r\n return;\r\n }\r\n\r\n let done = false;\r\n for (let i = 0; i < this.locations.length && !done; i++) {\r\n const n = loc.compareTo(this.locations[i]);\r\n // nothing to do if equal\r\n if (n === 0) {\r\n return;\r\n }\r\n // insert before nearest bigger sort value\r\n if (n < 0) {\r\n this.locations.splice(i, 0, loc);\r\n done = true;\r\n }\r\n }\r\n // append if not yet inserted\r\n if (!done) {\r\n this.locations.push(loc);\r\n }\r\n\r\n // remove all the overlapping locations\r\n this.removeOverlaps(loc);\r\n }\r\n\r\n public removeLocation(loc: TokenLocation): void {\r\n const i = this.locations.indexOf(loc);\r\n if (i > -1) {\r\n this.locations.splice(i, 1);\r\n }\r\n }\r\n\r\n public clearLocations(): void {\r\n this.locations.length = 0;\r\n }\r\n\r\n public render(): void {\r\n if (!this.text.value) {\r\n return;\r\n }\r\n this.result = this._textLayerService.render(\r\n this.text.value,\r\n this.locations\r\n );\r\n }\r\n\r\n public getLocationForNew(): void {\r\n if (!this.text.value) {\r\n return;\r\n }\r\n this.userLocation =\r\n this._textLayerService.getSelectedLocationForNew(\r\n this._textLayerService.getSelectedRange()!,\r\n this.text.value\r\n ) || undefined;\r\n }\r\n\r\n public getLocationForEdit(): void {\r\n this.userLocation =\r\n this._textLayerService.getSelectedLocationForEdit(\r\n this._textLayerService.getSelectedRange()!\r\n ) || undefined;\r\n }\r\n}\r\n","<mat-card appearance=\"outlined\">\n <mat-card-header>\n <h3>Layered Text Demo</h3>\n </mat-card-header>\n <mat-card-content>\n <article>\n <p>\n Enter some base text and zero or more layer fragments locations, then\n click the render button. This renders the base text with all its ranges.\n </p>\n <p>\n Once the text has been decorated, select any portion of it, either\n including a decorated part, or not. Then, if you selected a part\n including decorations, click the location button with the checkmark\n (=get the location of the fragment to edit); else, click the location\n button with the plus (=get the location of a new fragment).\n </p>\n <p>\n This will show you the token-based coordinates corresponding to your\n selection, provided that if you include any portion of a decorated text\n you will get the full coordinates of the decoration; otherwise, you will\n just get the coordinates of the selected character(s).\n </p>\n <p>\n This behavior is used to allow users edit existing part fragments by\n just selecting any part of it, even partially; while they must be\n precise when they are creating a new fragment.\n </p>\n </article>\n <hr />\n\n <form [formGroup]=\"rendition\" (ngSubmit)=\"render()\">\n <div>\n <mat-form-field>\n <mat-label>base text</mat-label>\n <textarea\n matInput\n type=\"text\"\n id=\"text\"\n maxlength=\"1000\"\n spellcheck=\"false\"\n formControlName=\"text\"\n ></textarea>\n </mat-form-field>\n </div>\n\n <div>\n <mat-form-field>\n <mat-label>location</mat-label>\n <input\n matInput\n type=\"text\"\n id=\"location\"\n required\n spellcheck=\"false\"\n formControlName=\"location\"\n />\n <mat-hint>Y.X&#64;AxR</mat-hint>\n </mat-form-field>\n </div>\n\n <div>\n <mat-toolbar>\n <span>\n <button\n mat-icon-button\n (click)=\"addLocation()\"\n type=\"button\"\n matTooltip=\"Add the specified location\"\n >\n <mat-icon style=\"color: #66cc75\">add_circle</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"clearLocations()\"\n type=\"button\"\n matTooltip=\"Remove all the locations\"\n >\n <mat-icon class=\"mat-warn\">delete_sweep</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"submit\"\n matTooltip=\"Render the decorated base text\"\n >\n <mat-icon class=\"mat-primary\">play_circle_outline</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"getLocationForNew()\"\n type=\"button\"\n matTooltip=\"Get location for new item\"\n >\n <mat-icon>playlist_add</mat-icon>\n </button>\n <button\n mat-icon-button\n (click)=\"getLocationForEdit()\"\n type=\"button\"\n matTooltip=\"Get location for selected item\"\n >\n <mat-icon>playlist_add_check</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Larger text\"\n (click)=\"makeLarger()\"\n [disabled]=\"textSize >= 24\"\n >\n <mat-icon>format_size</mat-icon>\n </button>\n <button\n mat-icon-button\n type=\"button\"\n matTooltip=\"Smaller text\"\n (click)=\"makeSmaller()\"\n [disabled]=\"textSize <= 12\"\n >\n <mat-icon>text_fields</mat-icon>\n </button>\n </span>\n <span class=\"tb-fill-remaining-space\"></span>\n <span>{{ userLocation }}</span>\n </mat-toolbar>\n </div>\n\n <table>\n <tbody>\n @for (loc of locations; track loc) {\n <tr>\n <td>\n <button mat-icon-button (click)=\"removeLocation(loc)\">\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\n </button>\n </td>\n <td>{{ loc.toString() }}</td>\n </tr>\n }\n </tbody>\n </table>\n </form>\n </mat-card-content>\n</mat-card>\n\n<mat-card appearance=\"outlined\">\n <mat-card-header>\n <h3>Rendition</h3>\n </mat-card-header>\n <mat-card-content>\n <div\n [style.font-size]=\"textSize + 'px'\"\n [innerHtml]=\"result | safeHtml : 'html'\"\n id=\"result\"\n #resultElem\n ></div>\n <hr />\n <div>\n <code>{{ result }}</code>\n </div>\n </mat-card-content>\n</mat-card>\n","/*\r\n * Public API Surface of cadmus-layer-demo\r\n */\r\n\r\nexport * from './lib/layer-demo/layer-demo.component';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MA0Ca,kBAAkB,CAAA;AAenB,IAAA,iBAAA;AAde,IAAA,cAAc;AAEhC,IAAA,SAAS;AACT,IAAA,MAAM;AACN,IAAA,YAAY;;AAEZ,IAAA,SAAS;AACT,IAAA,IAAI;AACJ,IAAA,QAAQ;AAER,IAAA,QAAQ;IAEf,WACE,CAAA,WAAwB,EAChB,iBAAmC,EAAA;QAAnC,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB;AAEzB,QAAA,IAAI,CAAC,QAAQ,GAAG,EAAE;AAClB,QAAA,IAAI,CAAC,SAAS,GAAG,EAAE;QACnB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,OAAO,CAC7B,4CAA4C,CAC7C;QACD,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC;AAC9C,QAAA,IAAI,CAAC,S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AAA,CAAA,EAAA,CAAA;;2FAGH,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBArB9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAGpB,OAAA,EAAA;wBACP,OAAO;wBACP,aAAa;wBACb,cAAc;wBACd,WAAW;wBACX,mBAAmB;wBACnB,YAAY;wBACZ,QAAQ;wBACR,QAAQ;wBACR,OAAO;wBACP,UAAU;wBACV,aAAa;wBACb,UAAU;wBACV,OAAO;wBACP,YAAY;AACb,qBAAA,EAAA,QAAA,EAAA,0iKAAA,EAAA,MAAA,EAAA,CAAA,iWAAA,CAAA,EAAA;+GAGwB,cAAc,EAAA,CAAA;sBAAtC,SAAS;uBAAC,YAAY;;;AE3CzB;;AAEG;;ACFH;;AAEG;;;;"}
@@ -23,5 +23,5 @@ export declare class LayerDemoComponent {
23
23
  getLocationForNew(): void;
24
24
  getLocationForEdit(): void;
25
25
  static ɵfac: i0.ɵɵFactoryDeclaration<LayerDemoComponent, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<LayerDemoComponent, "cadmus-layer-demo", never, {}, {}, never, never, false, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<LayerDemoComponent, "cadmus-layer-demo", never, {}, {}, never, never, true, never>;
27
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrmidon/cadmus-layer-demo",
3
- "version": "10.2.0",
3
+ "version": "11.0.0",
4
4
  "description": "Cadmus - text layer demo page.",
5
5
  "keywords": [
6
6
  "Cadmus"
@@ -17,8 +17,8 @@
17
17
  "@angular/common": "^19.0.0",
18
18
  "@angular/core": "^19.0.0",
19
19
  "@myrmidon/ngx-tools": "^1.0.0",
20
- "@myrmidon/cadmus-core": "^10.1.0",
21
- "@myrmidon/cadmus-ui": "^10.2.0"
20
+ "@myrmidon/cadmus-core": "^11.0.0",
21
+ "@myrmidon/cadmus-ui": "^11.0.0"
22
22
  },
23
23
  "dependencies": {
24
24
  "tslib": "^2.3.0"
package/public-api.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  export * from './lib/layer-demo/layer-demo.component';
2
- export * from './lib/cadmus-layer-demo.module';
@@ -1,22 +0,0 @@
1
- import { RouterModule } from '@angular/router';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "./layer-demo/layer-demo.component";
4
- import * as i2 from "@angular/common";
5
- import * as i3 from "@angular/forms";
6
- import * as i4 from "@angular/router";
7
- import * as i5 from "@angular/material/button";
8
- import * as i6 from "@angular/material/card";
9
- import * as i7 from "@angular/material/form-field";
10
- import * as i8 from "@angular/material/icon";
11
- import * as i9 from "@angular/material/input";
12
- import * as i10 from "@angular/material/toolbar";
13
- import * as i11 from "@angular/material/tooltip";
14
- import * as i12 from "@myrmidon/ngx-tools";
15
- import * as i13 from "@myrmidon/cadmus-core";
16
- import * as i14 from "@myrmidon/cadmus-ui";
17
- export declare const RouterModuleForChild: import("@angular/core").ModuleWithProviders<RouterModule>;
18
- export declare class CadmusLayerDemoModule {
19
- static ɵfac: i0.ɵɵFactoryDeclaration<CadmusLayerDemoModule, never>;
20
- static ɵmod: i0.ɵɵNgModuleDeclaration<CadmusLayerDemoModule, [typeof i1.LayerDemoComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i4.RouterModule, typeof i5.MatButtonModule, typeof i6.MatCardModule, typeof i7.MatFormFieldModule, typeof i8.MatIconModule, typeof i9.MatInputModule, typeof i10.MatToolbarModule, typeof i11.MatTooltipModule, typeof i12.SafeHtmlPipe, typeof i13.CadmusCoreModule, typeof i14.CadmusUiModule], [typeof i1.LayerDemoComponent]>;
21
- static ɵinj: i0.ɵɵInjectorDeclaration<CadmusLayerDemoModule>;
22
- }