@myrmidon/cadmus-layer-demo 12.0.0 → 14.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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ViewChild } from '@angular/core';
2
+ import { ViewChild, Component } from '@angular/core';
3
3
  import * as i1 from '@angular/forms';
4
4
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
5
5
  import { MatCard, MatCardHeader, MatCardContent } from '@angular/material/card';
@@ -114,10 +114,10 @@ class LayerDemoComponent {
114
114
  this.userLocation =
115
115
  this._textLayerService.getSelectedLocationForEdit(this._textLayerService.getSelectedRange()) || undefined;
116
116
  }
117
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", 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.1.3", 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" }] });
117
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.0", 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: "20.1.0", type: LayerDemoComponent, isStandalone: true, selector: "cadmus-layer-demo", viewQueries: [{ propertyName: "_resultElement", first: true, predicate: ["resultElem"], descendants: true }], ngImport: i0, template: "<mat-card appearance=\"outlined\">\r\n <mat-card-header>\r\n <h3>Layered Text Demo</h3>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <article>\r\n <p>\r\n Enter some base text and zero or more layer fragments locations, then\r\n click the render button. This renders the base text with all its ranges.\r\n </p>\r\n <p>\r\n Once the text has been decorated, select any portion of it, either\r\n including a decorated part, or not. Then, if you selected a part\r\n including decorations, click the location button with the checkmark\r\n (=get the location of the fragment to edit); else, click the location\r\n button with the plus (=get the location of a new fragment).\r\n </p>\r\n <p>\r\n This will show you the token-based coordinates corresponding to your\r\n selection, provided that if you include any portion of a decorated text\r\n you will get the full coordinates of the decoration; otherwise, you will\r\n just get the coordinates of the selected character(s).\r\n </p>\r\n <p>\r\n This behavior is used to allow users edit existing part fragments by\r\n just selecting any part of it, even partially; while they must be\r\n precise when they are creating a new fragment.\r\n </p>\r\n </article>\r\n <hr />\r\n\r\n <form [formGroup]=\"rendition\" (ngSubmit)=\"render()\">\r\n <div>\r\n <mat-form-field>\r\n <mat-label>base text</mat-label>\r\n <textarea\r\n matInput\r\n type=\"text\"\r\n id=\"text\"\r\n maxlength=\"1000\"\r\n spellcheck=\"false\"\r\n formControlName=\"text\"\r\n ></textarea>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>location</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"location\"\r\n required\r\n spellcheck=\"false\"\r\n formControlName=\"location\"\r\n />\r\n <mat-hint>Y.X&#64;AxR</mat-hint>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-toolbar>\r\n <span>\r\n <button\r\n mat-icon-button\r\n (click)=\"addLocation()\"\r\n type=\"button\"\r\n matTooltip=\"Add the specified location\"\r\n >\r\n <mat-icon style=\"color: #66cc75\">add_circle</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n (click)=\"clearLocations()\"\r\n type=\"button\"\r\n matTooltip=\"Remove all the locations\"\r\n >\r\n <mat-icon class=\"mat-warn\">delete_sweep</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n type=\"submit\"\r\n matTooltip=\"Render the decorated base text\"\r\n >\r\n <mat-icon class=\"mat-primary\">play_circle_outline</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n (click)=\"getLocationForNew()\"\r\n type=\"button\"\r\n matTooltip=\"Get location for new item\"\r\n >\r\n <mat-icon>playlist_add</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n (click)=\"getLocationForEdit()\"\r\n type=\"button\"\r\n matTooltip=\"Get location for selected item\"\r\n >\r\n <mat-icon>playlist_add_check</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Larger text\"\r\n (click)=\"makeLarger()\"\r\n [disabled]=\"textSize >= 24\"\r\n >\r\n <mat-icon>format_size</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Smaller text\"\r\n (click)=\"makeSmaller()\"\r\n [disabled]=\"textSize <= 12\"\r\n >\r\n <mat-icon>text_fields</mat-icon>\r\n </button>\r\n </span>\r\n <span class=\"tb-fill-remaining-space\"></span>\r\n <span>{{ userLocation }}</span>\r\n </mat-toolbar>\r\n </div>\r\n\r\n <table>\r\n <tbody>\r\n @for (loc of locations; track loc) {\r\n <tr>\r\n <td>\r\n <button mat-icon-button (click)=\"removeLocation(loc)\">\r\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ loc.toString() }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </form>\r\n </mat-card-content>\r\n</mat-card>\r\n\r\n<mat-card appearance=\"outlined\">\r\n <mat-card-header>\r\n <h3>Rendition</h3>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div\r\n [style.font-size]=\"textSize + 'px'\"\r\n [innerHtml]=\"result | safeHtml : 'html'\"\r\n id=\"result\"\r\n #resultElem\r\n ></div>\r\n <hr />\r\n <div>\r\n <code>{{ result }}</code>\r\n </div>\r\n </mat-card-content>\r\n</mat-card>\r\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], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { 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" }] });
119
119
  }
120
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: LayerDemoComponent, decorators: [{
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImport: i0, type: LayerDemoComponent, decorators: [{
121
121
  type: Component,
122
122
  args: [{ selector: 'cadmus-layer-demo', imports: [
123
123
  MatCard,
@@ -134,7 +134,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
134
134
  MatTooltip,
135
135
  MatIcon,
136
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"] }]
137
+ ], template: "<mat-card appearance=\"outlined\">\r\n <mat-card-header>\r\n <h3>Layered Text Demo</h3>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <article>\r\n <p>\r\n Enter some base text and zero or more layer fragments locations, then\r\n click the render button. This renders the base text with all its ranges.\r\n </p>\r\n <p>\r\n Once the text has been decorated, select any portion of it, either\r\n including a decorated part, or not. Then, if you selected a part\r\n including decorations, click the location button with the checkmark\r\n (=get the location of the fragment to edit); else, click the location\r\n button with the plus (=get the location of a new fragment).\r\n </p>\r\n <p>\r\n This will show you the token-based coordinates corresponding to your\r\n selection, provided that if you include any portion of a decorated text\r\n you will get the full coordinates of the decoration; otherwise, you will\r\n just get the coordinates of the selected character(s).\r\n </p>\r\n <p>\r\n This behavior is used to allow users edit existing part fragments by\r\n just selecting any part of it, even partially; while they must be\r\n precise when they are creating a new fragment.\r\n </p>\r\n </article>\r\n <hr />\r\n\r\n <form [formGroup]=\"rendition\" (ngSubmit)=\"render()\">\r\n <div>\r\n <mat-form-field>\r\n <mat-label>base text</mat-label>\r\n <textarea\r\n matInput\r\n type=\"text\"\r\n id=\"text\"\r\n maxlength=\"1000\"\r\n spellcheck=\"false\"\r\n formControlName=\"text\"\r\n ></textarea>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>location</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"location\"\r\n required\r\n spellcheck=\"false\"\r\n formControlName=\"location\"\r\n />\r\n <mat-hint>Y.X&#64;AxR</mat-hint>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-toolbar>\r\n <span>\r\n <button\r\n mat-icon-button\r\n (click)=\"addLocation()\"\r\n type=\"button\"\r\n matTooltip=\"Add the specified location\"\r\n >\r\n <mat-icon style=\"color: #66cc75\">add_circle</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n (click)=\"clearLocations()\"\r\n type=\"button\"\r\n matTooltip=\"Remove all the locations\"\r\n >\r\n <mat-icon class=\"mat-warn\">delete_sweep</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n type=\"submit\"\r\n matTooltip=\"Render the decorated base text\"\r\n >\r\n <mat-icon class=\"mat-primary\">play_circle_outline</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n (click)=\"getLocationForNew()\"\r\n type=\"button\"\r\n matTooltip=\"Get location for new item\"\r\n >\r\n <mat-icon>playlist_add</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n (click)=\"getLocationForEdit()\"\r\n type=\"button\"\r\n matTooltip=\"Get location for selected item\"\r\n >\r\n <mat-icon>playlist_add_check</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Larger text\"\r\n (click)=\"makeLarger()\"\r\n [disabled]=\"textSize >= 24\"\r\n >\r\n <mat-icon>format_size</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Smaller text\"\r\n (click)=\"makeSmaller()\"\r\n [disabled]=\"textSize <= 12\"\r\n >\r\n <mat-icon>text_fields</mat-icon>\r\n </button>\r\n </span>\r\n <span class=\"tb-fill-remaining-space\"></span>\r\n <span>{{ userLocation }}</span>\r\n </mat-toolbar>\r\n </div>\r\n\r\n <table>\r\n <tbody>\r\n @for (loc of locations; track loc) {\r\n <tr>\r\n <td>\r\n <button mat-icon-button (click)=\"removeLocation(loc)\">\r\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ loc.toString() }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </form>\r\n </mat-card-content>\r\n</mat-card>\r\n\r\n<mat-card appearance=\"outlined\">\r\n <mat-card-header>\r\n <h3>Rendition</h3>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div\r\n [style.font-size]=\"textSize + 'px'\"\r\n [innerHtml]=\"result | safeHtml : 'html'\"\r\n id=\"result\"\r\n #resultElem\r\n ></div>\r\n <hr />\r\n <div>\r\n <code>{{ result }}</code>\r\n </div>\r\n </mat-card-content>\r\n</mat-card>\r\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"] }]
138
138
  }], ctorParameters: () => [{ type: i1.FormBuilder }, { type: i2.TextLayerService }], propDecorators: { _resultElement: [{
139
139
  type: ViewChild,
140
140
  args: ['resultElem']
@@ -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/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,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;YACjC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;AACxB,SAAA,CAAC;AACF,QAAA,IAAI,CAAC,MA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;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;;;;"}
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\">\r\n <mat-card-header>\r\n <h3>Layered Text Demo</h3>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <article>\r\n <p>\r\n Enter some base text and zero or more layer fragments locations, then\r\n click the render button. This renders the base text with all its ranges.\r\n </p>\r\n <p>\r\n Once the text has been decorated, select any portion of it, either\r\n including a decorated part, or not. Then, if you selected a part\r\n including decorations, click the location button with the checkmark\r\n (=get the location of the fragment to edit); else, click the location\r\n button with the plus (=get the location of a new fragment).\r\n </p>\r\n <p>\r\n This will show you the token-based coordinates corresponding to your\r\n selection, provided that if you include any portion of a decorated text\r\n you will get the full coordinates of the decoration; otherwise, you will\r\n just get the coordinates of the selected character(s).\r\n </p>\r\n <p>\r\n This behavior is used to allow users edit existing part fragments by\r\n just selecting any part of it, even partially; while they must be\r\n precise when they are creating a new fragment.\r\n </p>\r\n </article>\r\n <hr />\r\n\r\n <form [formGroup]=\"rendition\" (ngSubmit)=\"render()\">\r\n <div>\r\n <mat-form-field>\r\n <mat-label>base text</mat-label>\r\n <textarea\r\n matInput\r\n type=\"text\"\r\n id=\"text\"\r\n maxlength=\"1000\"\r\n spellcheck=\"false\"\r\n formControlName=\"text\"\r\n ></textarea>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>location</mat-label>\r\n <input\r\n matInput\r\n type=\"text\"\r\n id=\"location\"\r\n required\r\n spellcheck=\"false\"\r\n formControlName=\"location\"\r\n />\r\n <mat-hint>Y.X&#64;AxR</mat-hint>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-toolbar>\r\n <span>\r\n <button\r\n mat-icon-button\r\n (click)=\"addLocation()\"\r\n type=\"button\"\r\n matTooltip=\"Add the specified location\"\r\n >\r\n <mat-icon style=\"color: #66cc75\">add_circle</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n (click)=\"clearLocations()\"\r\n type=\"button\"\r\n matTooltip=\"Remove all the locations\"\r\n >\r\n <mat-icon class=\"mat-warn\">delete_sweep</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n type=\"submit\"\r\n matTooltip=\"Render the decorated base text\"\r\n >\r\n <mat-icon class=\"mat-primary\">play_circle_outline</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n (click)=\"getLocationForNew()\"\r\n type=\"button\"\r\n matTooltip=\"Get location for new item\"\r\n >\r\n <mat-icon>playlist_add</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n (click)=\"getLocationForEdit()\"\r\n type=\"button\"\r\n matTooltip=\"Get location for selected item\"\r\n >\r\n <mat-icon>playlist_add_check</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Larger text\"\r\n (click)=\"makeLarger()\"\r\n [disabled]=\"textSize >= 24\"\r\n >\r\n <mat-icon>format_size</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"Smaller text\"\r\n (click)=\"makeSmaller()\"\r\n [disabled]=\"textSize <= 12\"\r\n >\r\n <mat-icon>text_fields</mat-icon>\r\n </button>\r\n </span>\r\n <span class=\"tb-fill-remaining-space\"></span>\r\n <span>{{ userLocation }}</span>\r\n </mat-toolbar>\r\n </div>\r\n\r\n <table>\r\n <tbody>\r\n @for (loc of locations; track loc) {\r\n <tr>\r\n <td>\r\n <button mat-icon-button (click)=\"removeLocation(loc)\">\r\n <mat-icon class=\"mat-warn\">remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ loc.toString() }}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </form>\r\n </mat-card-content>\r\n</mat-card>\r\n\r\n<mat-card appearance=\"outlined\">\r\n <mat-card-header>\r\n <h3>Rendition</h3>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div\r\n [style.font-size]=\"textSize + 'px'\"\r\n [innerHtml]=\"result | safeHtml : 'html'\"\r\n id=\"result\"\r\n #resultElem\r\n ></div>\r\n <hr />\r\n <div>\r\n <code>{{ result }}</code>\r\n </div>\r\n </mat-card-content>\r\n</mat-card>\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\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,WAAA,CACE,WAAwB,EAChB,iBAAmC,EAAA;QAAnC,IAAA,CAAA,iBAAiB,GAAjB,iBAAiB;AAEzB,QAAA,IAAI,CAAC,QAAQ,GAAG,EAAE;AAClB,QAAA,IAAI,CAAC,SAAS,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A,qBAAA,EAAA,yBAAA,EAAA,YAAA,EAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACV,OAAO,sIACP,YAAY,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,EAAA,CAAA;;2FAGH,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBArB9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAAA,OAAA,EAGpB;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,82KAAA,EAAA,MAAA,EAAA,CAAA,iWAAA,CAAA,EAAA;+GAGwB,cAAc,EAAA,CAAA;sBAAtC,SAAS;uBAAC,YAAY;;;AE3CzB;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,5 +1,30 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@myrmidon/cadmus-layer-demo" />
5
- export * from './public-api';
1
+ import * as i0 from '@angular/core';
2
+ import { ElementRef } from '@angular/core';
3
+ import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
4
+ import { TokenLocation, TextLayerService } from '@myrmidon/cadmus-core';
5
+
6
+ declare class LayerDemoComponent {
7
+ private _textLayerService;
8
+ _resultElement?: ElementRef;
9
+ locations: TokenLocation[];
10
+ result: string;
11
+ userLocation?: TokenLocation;
12
+ rendition: FormGroup;
13
+ text: FormControl<string | null>;
14
+ location: FormControl<string | null>;
15
+ textSize: number;
16
+ constructor(formBuilder: FormBuilder, _textLayerService: TextLayerService);
17
+ makeLarger(): void;
18
+ makeSmaller(): void;
19
+ private removeOverlaps;
20
+ addLocation(): void;
21
+ removeLocation(loc: TokenLocation): void;
22
+ clearLocations(): void;
23
+ render(): void;
24
+ getLocationForNew(): void;
25
+ getLocationForEdit(): void;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<LayerDemoComponent, never>;
27
+ static ɵcmp: i0.ɵɵComponentDeclaration<LayerDemoComponent, "cadmus-layer-demo", never, {}, {}, never, never, true, never>;
28
+ }
29
+
30
+ export { LayerDemoComponent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrmidon/cadmus-layer-demo",
3
- "version": "12.0.0",
3
+ "version": "14.0.0",
4
4
  "description": "Cadmus - text layer demo page.",
5
5
  "keywords": [
6
6
  "Cadmus"
@@ -14,11 +14,11 @@
14
14
  "name": "Daniele Fusi"
15
15
  },
16
16
  "peerDependencies": {
17
- "@angular/common": "^19.0.0",
18
- "@angular/core": "^19.0.0",
19
- "@myrmidon/ngx-tools": "^1.0.0",
20
- "@myrmidon/cadmus-core": "^11.0.0",
21
- "@myrmidon/cadmus-ui": "^12.0.0"
17
+ "@angular/common": "^20.0.0",
18
+ "@angular/core": "^20.0.0",
19
+ "@myrmidon/ngx-tools": "^2.0.0",
20
+ "@myrmidon/cadmus-core": "^12.0.1",
21
+ "@myrmidon/cadmus-ui": "^14.0.0"
22
22
  },
23
23
  "dependencies": {
24
24
  "tslib": "^2.3.0"
@@ -1,27 +0,0 @@
1
- import { ElementRef } from '@angular/core';
2
- import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
3
- import { TextLayerService, TokenLocation } from '@myrmidon/cadmus-core';
4
- import * as i0 from "@angular/core";
5
- export declare class LayerDemoComponent {
6
- private _textLayerService;
7
- _resultElement?: ElementRef;
8
- locations: TokenLocation[];
9
- result: string;
10
- userLocation?: TokenLocation;
11
- rendition: FormGroup;
12
- text: FormControl<string | null>;
13
- location: FormControl<string | null>;
14
- textSize: number;
15
- constructor(formBuilder: FormBuilder, _textLayerService: TextLayerService);
16
- makeLarger(): void;
17
- makeSmaller(): void;
18
- private removeOverlaps;
19
- addLocation(): void;
20
- removeLocation(loc: TokenLocation): void;
21
- clearLocations(): void;
22
- render(): void;
23
- getLocationForNew(): void;
24
- getLocationForEdit(): void;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<LayerDemoComponent, never>;
26
- static ɵcmp: i0.ɵɵComponentDeclaration<LayerDemoComponent, "cadmus-layer-demo", never, {}, {}, never, never, true, never>;
27
- }
package/public-api.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './lib/layer-demo/layer-demo.component';