@myrmidon/cadmus-layer-demo 0.0.4 → 0.3.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 +24 -24
- package/esm2020/lib/cadmus-layer-demo.module.mjs +52 -0
- package/esm2020/lib/layer-demo/layer-demo.component.mjs +108 -0
- package/esm2020/myrmidon-cadmus-layer-demo.mjs +5 -0
- package/esm2020/public-api.mjs +6 -0
- package/fesm2015/myrmidon-cadmus-layer-demo.mjs +166 -0
- package/fesm2015/myrmidon-cadmus-layer-demo.mjs.map +1 -0
- package/fesm2020/myrmidon-cadmus-layer-demo.mjs +166 -0
- package/fesm2020/myrmidon-cadmus-layer-demo.mjs.map +1 -0
- package/lib/cadmus-layer-demo.module.d.ts +11 -0
- package/lib/layer-demo/layer-demo.component.d.ts +8 -2
- package/myrmidon-cadmus-layer-demo.d.ts +1 -0
- package/package.json +22 -10
- package/bundles/myrmidon-cadmus-layer-demo.umd.js +0 -133
- package/bundles/myrmidon-cadmus-layer-demo.umd.js.map +0 -1
- package/bundles/myrmidon-cadmus-layer-demo.umd.min.js +0 -2
- package/bundles/myrmidon-cadmus-layer-demo.umd.min.js.map +0 -1
- package/esm2015/lib/cadmus-layer-demo.module.js +0 -31
- package/esm2015/lib/layer-demo/layer-demo.component.js +0 -87
- package/esm2015/myrmidon-cadmus-layer-demo.js +0 -5
- package/esm2015/public-api.js +0 -6
- package/fesm2015/myrmidon-cadmus-layer-demo.js +0 -125
- package/fesm2015/myrmidon-cadmus-layer-demo.js.map +0 -1
- package/myrmidon-cadmus-layer-demo.metadata.json +0 -1
|
@@ -0,0 +1,166 @@
|
|
|
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';
|
|
5
|
+
import * as i1 from '@angular/forms';
|
|
6
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import * as i3 from '@angular/material/card';
|
|
8
|
+
import * as i4 from '@angular/material/form-field';
|
|
9
|
+
import * as i5 from '@angular/material/toolbar';
|
|
10
|
+
import * as i6 from '@angular/material/button';
|
|
11
|
+
import * as i7 from '@angular/material/icon';
|
|
12
|
+
import * as i8 from '@angular/material/input';
|
|
13
|
+
import * as i9 from '@angular/material/tooltip';
|
|
14
|
+
import * as i10 from '@angular/common';
|
|
15
|
+
import { CommonModule } from '@angular/common';
|
|
16
|
+
import * as i11 from '@myrmidon/cadmus-ui';
|
|
17
|
+
import { CadmusUiModule } from '@myrmidon/cadmus-ui';
|
|
18
|
+
import * as i1$1 from '@angular/router';
|
|
19
|
+
import { RouterModule } from '@angular/router';
|
|
20
|
+
import { CadmusMaterialModule } from '@myrmidon/cadmus-material';
|
|
21
|
+
|
|
22
|
+
class LayerDemoComponent {
|
|
23
|
+
constructor(formBuilder, _textLayerService) {
|
|
24
|
+
this._textLayerService = _textLayerService;
|
|
25
|
+
this.textSize = 14;
|
|
26
|
+
this.locations = [];
|
|
27
|
+
this.text = formBuilder.control('alpha beta\ngamma\ndelta epsilon waw\nzeta');
|
|
28
|
+
this.location = formBuilder.control('1.2@2x2');
|
|
29
|
+
this.rendition = formBuilder.group({
|
|
30
|
+
text: this.text,
|
|
31
|
+
location: this.location,
|
|
32
|
+
});
|
|
33
|
+
this.result = '';
|
|
34
|
+
}
|
|
35
|
+
makeLarger() {
|
|
36
|
+
const size = this.textSize + 2;
|
|
37
|
+
if (size > 24) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.textSize = size;
|
|
41
|
+
}
|
|
42
|
+
makeSmaller() {
|
|
43
|
+
const size = this.textSize - 2;
|
|
44
|
+
if (size < 12) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.textSize = size;
|
|
48
|
+
}
|
|
49
|
+
removeOverlaps(loc) {
|
|
50
|
+
for (let i = this.locations.length - 1; i > -1; i--) {
|
|
51
|
+
if (loc === this.locations[i]) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (loc.overlaps(this.locations[i])) {
|
|
55
|
+
this.locations.splice(i, 1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
addLocation() {
|
|
60
|
+
if (!this.location.value) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const loc = TokenLocation.parse(this.location.value);
|
|
64
|
+
if (!loc) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
let done = false;
|
|
68
|
+
for (let i = 0; i < this.locations.length && !done; i++) {
|
|
69
|
+
const n = loc.compareTo(this.locations[i]);
|
|
70
|
+
// nothing to do if equal
|
|
71
|
+
if (n === 0) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
// insert before nearest bigger sort value
|
|
75
|
+
if (n < 0) {
|
|
76
|
+
this.locations.splice(i, 0, loc);
|
|
77
|
+
done = true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// append if not yet inserted
|
|
81
|
+
if (!done) {
|
|
82
|
+
this.locations.push(loc);
|
|
83
|
+
}
|
|
84
|
+
// remove all the overlapping locations
|
|
85
|
+
this.removeOverlaps(loc);
|
|
86
|
+
}
|
|
87
|
+
removeLocation(loc) {
|
|
88
|
+
const i = this.locations.indexOf(loc);
|
|
89
|
+
if (i > -1) {
|
|
90
|
+
this.locations.splice(i, 1);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
clearLocations() {
|
|
94
|
+
this.locations.length = 0;
|
|
95
|
+
}
|
|
96
|
+
render() {
|
|
97
|
+
this.result = this._textLayerService.render(this.text.value, this.locations);
|
|
98
|
+
}
|
|
99
|
+
getLocationForNew() {
|
|
100
|
+
this.userLocation = this._textLayerService.getSelectedLocationForNew(this._textLayerService.getSelectedRange(), this.text.value) || undefined;
|
|
101
|
+
}
|
|
102
|
+
getLocationForEdit() {
|
|
103
|
+
this.userLocation = this._textLayerService.getSelectedLocationForEdit(this._textLayerService.getSelectedRange()) || undefined;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
LayerDemoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayerDemoComponent, deps: [{ token: i1.FormBuilder }, { token: i2.TextLayerService }], target: i0.ɵɵFactoryTarget.Component });
|
|
107
|
+
LayerDemoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: LayerDemoComponent, selector: "cadmus-layer-demo", viewQueries: [{ propertyName: "_resultElement", first: true, predicate: ["resultElem"], descendants: true }], ngImport: i0, template: "<mat-card>\r\n <mat-card-header>\r\n <h2>Layered Text Demo</h2>\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 <textarea\r\n matInput\r\n type=\"text\"\r\n id=\"text\"\r\n maxlength=\"1000\"\r\n spellcheck=\"false\"\r\n placeholder=\"enter the base text\"\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 <input\r\n matInput\r\n type=\"text\"\r\n id=\"location\"\r\n required\r\n spellcheck=\"false\"\r\n placeholder=\"location: Y.X@AxR\"\r\n formControlName=\"location\"\r\n />\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 color=\"warn\"\r\n (click)=\"clearLocations()\"\r\n type=\"button\"\r\n matTooltip=\"Remove all the locations\"\r\n >\r\n <mat-icon>delete_sweep</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n color=\"primary\"\r\n type=\"submit\"\r\n matTooltip=\"Render the decorated base text\"\r\n >\r\n <mat-icon>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 <tr *ngFor=\"let loc of locations\">\r\n <td>\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeLocation(loc)\"\r\n >\r\n <mat-icon>remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ loc.toString() }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </form>\r\n </mat-card-content>\r\n</mat-card>\r\n\r\n<mat-card>\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"], components: [{ type: i3.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i3.MatCardHeader, selector: "mat-card-header" }, { type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i3.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i8.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { 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]" }, { type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i9.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i10.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "safeHtml": i11.SafeHtmlPipe } });
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LayerDemoComponent, decorators: [{
|
|
109
|
+
type: Component,
|
|
110
|
+
args: [{ selector: 'cadmus-layer-demo', template: "<mat-card>\r\n <mat-card-header>\r\n <h2>Layered Text Demo</h2>\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 <textarea\r\n matInput\r\n type=\"text\"\r\n id=\"text\"\r\n maxlength=\"1000\"\r\n spellcheck=\"false\"\r\n placeholder=\"enter the base text\"\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 <input\r\n matInput\r\n type=\"text\"\r\n id=\"location\"\r\n required\r\n spellcheck=\"false\"\r\n placeholder=\"location: Y.X@AxR\"\r\n formControlName=\"location\"\r\n />\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 color=\"warn\"\r\n (click)=\"clearLocations()\"\r\n type=\"button\"\r\n matTooltip=\"Remove all the locations\"\r\n >\r\n <mat-icon>delete_sweep</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n color=\"primary\"\r\n type=\"submit\"\r\n matTooltip=\"Render the decorated base text\"\r\n >\r\n <mat-icon>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 <tr *ngFor=\"let loc of locations\">\r\n <td>\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeLocation(loc)\"\r\n >\r\n <mat-icon>remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ loc.toString() }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </form>\r\n </mat-card-content>\r\n</mat-card>\r\n\r\n<mat-card>\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"] }]
|
|
111
|
+
}], ctorParameters: function () { return [{ type: i1.FormBuilder }, { type: i2.TextLayerService }]; }, propDecorators: { _resultElement: [{
|
|
112
|
+
type: ViewChild,
|
|
113
|
+
args: ['resultElem']
|
|
114
|
+
}] } });
|
|
115
|
+
|
|
116
|
+
// https://github.com/ng-packagr/ng-packagr/issues/778
|
|
117
|
+
const RouterModuleForChild = RouterModule.forChild([
|
|
118
|
+
{ path: '', pathMatch: 'full', component: LayerDemoComponent },
|
|
119
|
+
]);
|
|
120
|
+
class CadmusLayerDemoModule {
|
|
121
|
+
}
|
|
122
|
+
CadmusLayerDemoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: CadmusLayerDemoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
123
|
+
CadmusLayerDemoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: CadmusLayerDemoModule, declarations: [LayerDemoComponent], imports: [CommonModule,
|
|
124
|
+
FormsModule,
|
|
125
|
+
ReactiveFormsModule, i1$1.RouterModule,
|
|
126
|
+
// cadmus
|
|
127
|
+
CadmusCoreModule,
|
|
128
|
+
CadmusMaterialModule,
|
|
129
|
+
CadmusUiModule], exports: [LayerDemoComponent] });
|
|
130
|
+
CadmusLayerDemoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: CadmusLayerDemoModule, imports: [[
|
|
131
|
+
CommonModule,
|
|
132
|
+
FormsModule,
|
|
133
|
+
ReactiveFormsModule,
|
|
134
|
+
RouterModuleForChild,
|
|
135
|
+
// cadmus
|
|
136
|
+
CadmusCoreModule,
|
|
137
|
+
CadmusMaterialModule,
|
|
138
|
+
CadmusUiModule,
|
|
139
|
+
]] });
|
|
140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: CadmusLayerDemoModule, decorators: [{
|
|
141
|
+
type: NgModule,
|
|
142
|
+
args: [{
|
|
143
|
+
imports: [
|
|
144
|
+
CommonModule,
|
|
145
|
+
FormsModule,
|
|
146
|
+
ReactiveFormsModule,
|
|
147
|
+
RouterModuleForChild,
|
|
148
|
+
// cadmus
|
|
149
|
+
CadmusCoreModule,
|
|
150
|
+
CadmusMaterialModule,
|
|
151
|
+
CadmusUiModule,
|
|
152
|
+
],
|
|
153
|
+
declarations: [LayerDemoComponent],
|
|
154
|
+
exports: [LayerDemoComponent],
|
|
155
|
+
}]
|
|
156
|
+
}] });
|
|
157
|
+
|
|
158
|
+
/*
|
|
159
|
+
* Public API Surface of cadmus-layer-demo
|
|
160
|
+
*/
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Generated bundle index. Do not edit.
|
|
164
|
+
*/
|
|
165
|
+
|
|
166
|
+
export { CadmusLayerDemoModule, LayerDemoComponent, RouterModuleForChild };
|
|
@@ -0,0 +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})\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;\r\n public location: FormControl;\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 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 this.userLocation = 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 = this._textLayerService.getSelectedLocationForEdit(\r\n this._textLayerService.getSelectedRange()!\r\n ) || undefined;\r\n }\r\n}\r\n","<mat-card>\r\n <mat-card-header>\r\n <h2>Layered Text Demo</h2>\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 <textarea\r\n matInput\r\n type=\"text\"\r\n id=\"text\"\r\n maxlength=\"1000\"\r\n spellcheck=\"false\"\r\n placeholder=\"enter the base text\"\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 <input\r\n matInput\r\n type=\"text\"\r\n id=\"location\"\r\n required\r\n spellcheck=\"false\"\r\n placeholder=\"location: Y.X@AxR\"\r\n formControlName=\"location\"\r\n />\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 color=\"warn\"\r\n (click)=\"clearLocations()\"\r\n type=\"button\"\r\n matTooltip=\"Remove all the locations\"\r\n >\r\n <mat-icon>delete_sweep</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n color=\"primary\"\r\n type=\"submit\"\r\n matTooltip=\"Render the decorated base text\"\r\n >\r\n <mat-icon>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 <tr *ngFor=\"let loc of locations\">\r\n <td>\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeLocation(loc)\"\r\n >\r\n <mat-icon>remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ loc.toString() }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </form>\r\n </mat-card-content>\r\n</mat-card>\r\n\r\n<mat-card>\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","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { RouterModule } from '@angular/router';\r\n\r\nimport { CadmusCoreModule } from '@myrmidon/cadmus-core';\r\nimport { CadmusMaterialModule } from '@myrmidon/cadmus-material';\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 // cadmus\r\n CadmusCoreModule,\r\n CadmusMaterialModule,\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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BAChB,oBAAoB;wBACpB,cAAc;qBACf;oBACD,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;iBAC9B;;;AC7BD;;;;ACAA;;;;;;"}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
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 "@myrmidon/cadmus-core";
|
|
8
|
+
import * as i6 from "@myrmidon/cadmus-material";
|
|
9
|
+
import * as i7 from "@myrmidon/cadmus-ui";
|
|
2
10
|
export declare const RouterModuleForChild: import("@angular/core").ModuleWithProviders<RouterModule>;
|
|
3
11
|
export declare class CadmusLayerDemoModule {
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CadmusLayerDemoModule, never>;
|
|
13
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CadmusLayerDemoModule, [typeof i1.LayerDemoComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i4.RouterModule, typeof i5.CadmusCoreModule, typeof i6.CadmusMaterialModule, typeof i7.CadmusUiModule], [typeof i1.LayerDemoComponent]>;
|
|
14
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<CadmusLayerDemoModule>;
|
|
4
15
|
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
2
|
import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
|
|
3
3
|
import { TextLayerService, TokenLocation } from '@myrmidon/cadmus-core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class LayerDemoComponent {
|
|
5
6
|
private _textLayerService;
|
|
6
|
-
_resultElement
|
|
7
|
+
_resultElement?: ElementRef;
|
|
7
8
|
locations: TokenLocation[];
|
|
8
9
|
result: string;
|
|
9
|
-
userLocation
|
|
10
|
+
userLocation?: TokenLocation;
|
|
10
11
|
rendition: FormGroup;
|
|
11
12
|
text: FormControl;
|
|
12
13
|
location: FormControl;
|
|
14
|
+
textSize: number;
|
|
13
15
|
constructor(formBuilder: FormBuilder, _textLayerService: TextLayerService);
|
|
16
|
+
makeLarger(): void;
|
|
17
|
+
makeSmaller(): void;
|
|
14
18
|
private removeOverlaps;
|
|
15
19
|
addLocation(): void;
|
|
16
20
|
removeLocation(loc: TokenLocation): void;
|
|
@@ -18,4 +22,6 @@ export declare class LayerDemoComponent {
|
|
|
18
22
|
render(): void;
|
|
19
23
|
getLocationForNew(): void;
|
|
20
24
|
getLocationForEdit(): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LayerDemoComponent, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LayerDemoComponent, "cadmus-layer-demo", never, {}, {}, never, never>;
|
|
21
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myrmidon/cadmus-layer-demo",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Cadmus - layer demo page.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Cadmus"
|
|
@@ -14,18 +14,30 @@
|
|
|
14
14
|
"name": "Daniele Fusi"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@angular/common": "^
|
|
18
|
-
"@angular/core": "^
|
|
17
|
+
"@angular/common": "^13.0.0",
|
|
18
|
+
"@angular/core": "^13.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"tslib": "^2.0.0"
|
|
22
22
|
},
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"fesm2015": "fesm2015/myrmidon-cadmus-layer-demo.
|
|
23
|
+
"module": "fesm2015/myrmidon-cadmus-layer-demo.mjs",
|
|
24
|
+
"es2020": "fesm2020/myrmidon-cadmus-layer-demo.mjs",
|
|
25
|
+
"esm2020": "esm2020/myrmidon-cadmus-layer-demo.mjs",
|
|
26
|
+
"fesm2020": "fesm2020/myrmidon-cadmus-layer-demo.mjs",
|
|
27
|
+
"fesm2015": "fesm2015/myrmidon-cadmus-layer-demo.mjs",
|
|
28
28
|
"typings": "myrmidon-cadmus-layer-demo.d.ts",
|
|
29
|
-
"
|
|
29
|
+
"exports": {
|
|
30
|
+
"./package.json": {
|
|
31
|
+
"default": "./package.json"
|
|
32
|
+
},
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./myrmidon-cadmus-layer-demo.d.ts",
|
|
35
|
+
"esm2020": "./esm2020/myrmidon-cadmus-layer-demo.mjs",
|
|
36
|
+
"es2020": "./fesm2020/myrmidon-cadmus-layer-demo.mjs",
|
|
37
|
+
"es2015": "./fesm2015/myrmidon-cadmus-layer-demo.mjs",
|
|
38
|
+
"node": "./fesm2015/myrmidon-cadmus-layer-demo.mjs",
|
|
39
|
+
"default": "./fesm2020/myrmidon-cadmus-layer-demo.mjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
30
42
|
"sideEffects": false
|
|
31
|
-
}
|
|
43
|
+
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@myrmidon/cadmus-core'), require('@angular/common'), require('@angular/router'), require('@myrmidon/cadmus-material'), require('@myrmidon/cadmus-ui')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@myrmidon/cadmus-layer-demo', ['exports', '@angular/core', '@angular/forms', '@myrmidon/cadmus-core', '@angular/common', '@angular/router', '@myrmidon/cadmus-material', '@myrmidon/cadmus-ui'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.myrmidon = global.myrmidon || {}, global.myrmidon['cadmus-layer-demo'] = {}), global.ng.core, global.ng.forms, global['@myrmidon/cadmus-core'], global.ng.common, global.ng.router, global['@myrmidon/cadmus-material'], global['@myrmidon/cadmus-ui']));
|
|
5
|
-
}(this, (function (exports, core, forms, cadmusCore, common, router, cadmusMaterial, cadmusUi) { 'use strict';
|
|
6
|
-
|
|
7
|
-
var LayerDemoComponent = /** @class */ (function () {
|
|
8
|
-
function LayerDemoComponent(formBuilder, _textLayerService) {
|
|
9
|
-
this._textLayerService = _textLayerService;
|
|
10
|
-
this.locations = [];
|
|
11
|
-
this.text = formBuilder.control('alpha beta\ngamma\ndelta epsilon waw\nzeta');
|
|
12
|
-
this.location = formBuilder.control('1.2@2x2');
|
|
13
|
-
this.rendition = formBuilder.group({
|
|
14
|
-
'text': this.text,
|
|
15
|
-
'location': this.location
|
|
16
|
-
});
|
|
17
|
-
this.result = '';
|
|
18
|
-
}
|
|
19
|
-
LayerDemoComponent.prototype.removeOverlaps = function (loc) {
|
|
20
|
-
for (var i = this.locations.length - 1; i > -1; i--) {
|
|
21
|
-
if (loc === this.locations[i]) {
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
if (loc.overlaps(this.locations[i])) {
|
|
25
|
-
this.locations.splice(i, 1);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
LayerDemoComponent.prototype.addLocation = function () {
|
|
30
|
-
if (!this.location.value) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
var loc = cadmusCore.TokenLocation.parse(this.location.value);
|
|
34
|
-
if (!loc) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
var done = false;
|
|
38
|
-
for (var i = 0; i < this.locations.length && !done; i++) {
|
|
39
|
-
var n = loc.compareTo(this.locations[i]);
|
|
40
|
-
// nothing to do if equal
|
|
41
|
-
if (n === 0) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
// insert before nearest bigger sort value
|
|
45
|
-
if (n < 0) {
|
|
46
|
-
this.locations.splice(i, 0, loc);
|
|
47
|
-
done = true;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// append if not yet inserted
|
|
51
|
-
if (!done) {
|
|
52
|
-
this.locations.push(loc);
|
|
53
|
-
}
|
|
54
|
-
// remove all the overlapping locations
|
|
55
|
-
this.removeOverlaps(loc);
|
|
56
|
-
};
|
|
57
|
-
LayerDemoComponent.prototype.removeLocation = function (loc) {
|
|
58
|
-
var i = this.locations.indexOf(loc);
|
|
59
|
-
if (i > -1) {
|
|
60
|
-
this.locations.splice(i, 1);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
LayerDemoComponent.prototype.clearLocations = function () {
|
|
64
|
-
this.locations.length = 0;
|
|
65
|
-
};
|
|
66
|
-
LayerDemoComponent.prototype.render = function () {
|
|
67
|
-
this.result = this._textLayerService.render(this.text.value, this.locations);
|
|
68
|
-
};
|
|
69
|
-
LayerDemoComponent.prototype.getLocationForNew = function () {
|
|
70
|
-
this.userLocation = this._textLayerService.getSelectedLocationForNew(this._textLayerService.getSelectedRange(), this.text.value);
|
|
71
|
-
};
|
|
72
|
-
LayerDemoComponent.prototype.getLocationForEdit = function () {
|
|
73
|
-
this.userLocation = this._textLayerService.getSelectedLocationForEdit(this._textLayerService.getSelectedRange());
|
|
74
|
-
};
|
|
75
|
-
return LayerDemoComponent;
|
|
76
|
-
}());
|
|
77
|
-
LayerDemoComponent.decorators = [
|
|
78
|
-
{ type: core.Component, args: [{
|
|
79
|
-
selector: 'cadmus-layer-demo',
|
|
80
|
-
template: "<mat-card>\r\n <mat-card-header>\r\n <h2>Layered Text Demo</h2>\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 <textarea\r\n matInput\r\n type=\"text\"\r\n id=\"text\"\r\n maxlength=\"1000\"\r\n spellcheck=\"false\"\r\n placeholder=\"enter the base text\"\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 <input\r\n matInput\r\n type=\"text\"\r\n id=\"location\"\r\n required\r\n spellcheck=\"false\"\r\n placeholder=\"location: Y.X@AxR\"\r\n formControlName=\"location\"\r\n />\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 color=\"warn\"\r\n (click)=\"clearLocations()\"\r\n type=\"button\"\r\n matTooltip=\"Remove all the locations\"\r\n >\r\n <mat-icon>delete_sweep</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n color=\"primary\"\r\n type=\"submit\"\r\n matTooltip=\"Render the decorated base text\"\r\n >\r\n <mat-icon>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 </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 <tr *ngFor=\"let loc of locations\">\r\n <td>\r\n <button\r\n mat-icon-button\r\n color=\"warn\"\r\n (click)=\"removeLocation(loc)\"\r\n >\r\n <mat-icon>remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ loc.toString() }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </form>\r\n </mat-card-content>\r\n</mat-card>\r\n\r\n<mat-card>\r\n <mat-card-header>\r\n <h3>Rendition</h3>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div [innerHtml]=\"result | safeHtml: 'html'\" id=\"result\" #resultElem></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",
|
|
81
|
-
styles: ["textarea#text{min-height:100px;min-width:300px}:host>>>div#result{counter-reset:text-y-counter}:host>>>div#result p:before{color:#a0a0a0;content:counter(text-y-counter);counter-increment:text-y-counter;margin-right:6px}:host>>>span.fr{background-color:#ff0;border:1px solid #404040;font-weight:700}article{column-width:20em}"]
|
|
82
|
-
},] }
|
|
83
|
-
];
|
|
84
|
-
LayerDemoComponent.ctorParameters = function () { return [
|
|
85
|
-
{ type: forms.FormBuilder },
|
|
86
|
-
{ type: cadmusCore.TextLayerService }
|
|
87
|
-
]; };
|
|
88
|
-
LayerDemoComponent.propDecorators = {
|
|
89
|
-
_resultElement: [{ type: core.ViewChild, args: ['resultElem',] }]
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
// https://github.com/ng-packagr/ng-packagr/issues/778
|
|
93
|
-
var RouterModuleForChild = router.RouterModule.forChild([
|
|
94
|
-
{ path: '', pathMatch: 'full', component: LayerDemoComponent },
|
|
95
|
-
]);
|
|
96
|
-
var CadmusLayerDemoModule = /** @class */ (function () {
|
|
97
|
-
function CadmusLayerDemoModule() {
|
|
98
|
-
}
|
|
99
|
-
return CadmusLayerDemoModule;
|
|
100
|
-
}());
|
|
101
|
-
CadmusLayerDemoModule.decorators = [
|
|
102
|
-
{ type: core.NgModule, args: [{
|
|
103
|
-
imports: [
|
|
104
|
-
common.CommonModule,
|
|
105
|
-
forms.FormsModule,
|
|
106
|
-
forms.ReactiveFormsModule,
|
|
107
|
-
RouterModuleForChild,
|
|
108
|
-
// cadmus
|
|
109
|
-
cadmusCore.CadmusCoreModule,
|
|
110
|
-
cadmusMaterial.CadmusMaterialModule,
|
|
111
|
-
cadmusUi.CadmusUiModule,
|
|
112
|
-
],
|
|
113
|
-
declarations: [LayerDemoComponent],
|
|
114
|
-
exports: [LayerDemoComponent],
|
|
115
|
-
},] }
|
|
116
|
-
];
|
|
117
|
-
|
|
118
|
-
/*
|
|
119
|
-
* Public API Surface of cadmus-layer-demo
|
|
120
|
-
*/
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Generated bundle index. Do not edit.
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
exports.CadmusLayerDemoModule = CadmusLayerDemoModule;
|
|
127
|
-
exports.LayerDemoComponent = LayerDemoComponent;
|
|
128
|
-
exports.RouterModuleForChild = RouterModuleForChild;
|
|
129
|
-
|
|
130
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
131
|
-
|
|
132
|
-
})));
|
|
133
|
-
//# sourceMappingURL=myrmidon-cadmus-layer-demo.umd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"myrmidon-cadmus-layer-demo.umd.js","sources":["../../../../projects/myrmidon/cadmus-layer-demo/src/lib/layer-demo/layer-demo.component.ts","../../../../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, OnInit, 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})\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;\r\n public location: FormControl;\r\n\r\n constructor(formBuilder: FormBuilder,\r\n private _textLayerService: TextLayerService) {\r\n this.locations = [];\r\n this.text = formBuilder.control('alpha beta\\ngamma\\ndelta epsilon waw\\nzeta');\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 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 this.result = this._textLayerService.render(this.text.value, this.locations);\r\n }\r\n\r\n public getLocationForNew(): void {\r\n this.userLocation = this._textLayerService.getSelectedLocationForNew(\r\n this._textLayerService.getSelectedRange(), this.text.value);\r\n }\r\n\r\n public getLocationForEdit(): void {\r\n this.userLocation = this._textLayerService.getSelectedLocationForEdit(\r\n this._textLayerService.getSelectedRange());\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { RouterModule } from '@angular/router';\nimport { LayerDemoComponent } from './layer-demo/layer-demo.component';\n\nimport { CadmusCoreModule } from '@myrmidon/cadmus-core';\nimport { CadmusMaterialModule } from '@myrmidon/cadmus-material';\nimport { CadmusUiModule } from '@myrmidon/cadmus-ui';\n\n// https://github.com/ng-packagr/ng-packagr/issues/778\nexport const RouterModuleForChild = RouterModule.forChild([\n { path: '', pathMatch: 'full', component: LayerDemoComponent },\n]);\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n RouterModuleForChild,\n // cadmus\n CadmusCoreModule,\n CadmusMaterialModule,\n CadmusUiModule,\n ],\n declarations: [LayerDemoComponent],\n exports: [LayerDemoComponent],\n})\nexport class CadmusLayerDemoModule {}\n","/*\n * Public API Surface of cadmus-layer-demo\n */\n\nexport * from './lib/layer-demo/layer-demo.component';\nexport * from './lib/cadmus-layer-demo.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["TokenLocation","Component","FormBuilder","TextLayerService","ViewChild","RouterModule","NgModule","CommonModule","FormsModule","ReactiveFormsModule","CadmusCoreModule","CadmusMaterialModule","CadmusUiModule"],"mappings":";;;;;;;QAoBE,4BAAY,WAAwB,EAC1B,iBAAmC;YAAnC,sBAAiB,GAAjB,iBAAiB,CAAkB;YAC3C,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,4CAA4C,CAAC,CAAC;YAC9E,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAC/C,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;gBACjC,MAAM,EAAE,IAAI,CAAC,IAAI;gBACjB,UAAU,EAAE,IAAI,CAAC,QAAQ;aAC1B,CAAC,CAAC;YACH,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;SAClB;QAEO,2CAAc,GAAd,UAAe,GAAkB;YACvC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBACnD,IAAI,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;oBAC7B,SAAS;iBACV;gBACD,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE;oBACnC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;iBAC7B;aACF;SACF;QAEM,wCAAW,GAAX;YACL,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE;gBACxB,OAAO;aACR;YACD,IAAM,GAAG,GAAGA,wBAAa,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACrD,IAAI,CAAC,GAAG,EAAE;gBACR,OAAO;aACR;YAED,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EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC/D;QAEM,+CAAkB,GAAlB;YACL,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,0BAA0B,CACnE,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,CAAC;SAC9C;;;;gBA7FFC,cAAS,SAAC;oBACT,QAAQ,EAAE,mBAAmB;oBAC7B,ypJAA0C;;iBAE3C;;;gBAPgCC,iBAAW;gBACnCC,2BAAgB;;;iCAQtBC,cAAS,SAAC,YAAY;;;ICAzB;QACa,oBAAoB,GAAGC,mBAAY,CAAC,QAAQ,CAAC;QACxD,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE;KAC/D,EAAE;;QAgBH;;;;;gBAdCC,aAAQ,SAAC;oBACR,OAAO,EAAE;wBACPC,mBAAY;wBACZC,iBAAW;wBACXC,yBAAmB;wBACnB,oBAAoB;;wBAEpBC,2BAAgB;wBAChBC,mCAAoB;wBACpBC,uBAAc;qBACf;oBACD,YAAY,EAAE,CAAC,kBAAkB,CAAC;oBAClC,OAAO,EAAE,CAAC,kBAAkB,CAAC;iBAC9B;;;IC5BD;;;;ICAA;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/forms"),require("@myrmidon/cadmus-core"),require("@angular/common"),require("@angular/router"),require("@myrmidon/cadmus-material"),require("@myrmidon/cadmus-ui")):"function"==typeof define&&define.amd?define("@myrmidon/cadmus-layer-demo",["exports","@angular/core","@angular/forms","@myrmidon/cadmus-core","@angular/common","@angular/router","@myrmidon/cadmus-material","@myrmidon/cadmus-ui"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).myrmidon=t.myrmidon||{},t.myrmidon["cadmus-layer-demo"]={}),t.ng.core,t.ng.forms,t["@myrmidon/cadmus-core"],t.ng.common,t.ng.router,t["@myrmidon/cadmus-material"],t["@myrmidon/cadmus-ui"])}(this,(function(t,e,r,n,o,a,i,c){"use strict";var l=function(){function t(t,e){this._textLayerService=e,this.locations=[],this.text=t.control("alpha beta\ngamma\ndelta epsilon waw\nzeta"),this.location=t.control("1.2@2x2"),this.rendition=t.group({text:this.text,location:this.location}),this.result=""}return t.prototype.removeOverlaps=function(t){for(var e=this.locations.length-1;e>-1;e--)t!==this.locations[e]&&t.overlaps(this.locations[e])&&this.locations.splice(e,1)},t.prototype.addLocation=function(){if(this.location.value){var t=n.TokenLocation.parse(this.location.value);if(t){for(var e=!1,r=0;r<this.locations.length&&!e;r++){var o=t.compareTo(this.locations[r]);if(0===o)return;o<0&&(this.locations.splice(r,0,t),e=!0)}e||this.locations.push(t),this.removeOverlaps(t)}}},t.prototype.removeLocation=function(t){var e=this.locations.indexOf(t);e>-1&&this.locations.splice(e,1)},t.prototype.clearLocations=function(){this.locations.length=0},t.prototype.render=function(){this.result=this._textLayerService.render(this.text.value,this.locations)},t.prototype.getLocationForNew=function(){this.userLocation=this._textLayerService.getSelectedLocationForNew(this._textLayerService.getSelectedRange(),this.text.value)},t.prototype.getLocationForEdit=function(){this.userLocation=this._textLayerService.getSelectedLocationForEdit(this._textLayerService.getSelectedRange())},t}();l.decorators=[{type:e.Component,args:[{selector:"cadmus-layer-demo",template:'<mat-card>\r\n <mat-card-header>\r\n <h2>Layered Text Demo</h2>\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 <textarea\r\n matInput\r\n type="text"\r\n id="text"\r\n maxlength="1000"\r\n spellcheck="false"\r\n placeholder="enter the base text"\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 <input\r\n matInput\r\n type="text"\r\n id="location"\r\n required\r\n spellcheck="false"\r\n placeholder="location: Y.X@AxR"\r\n formControlName="location"\r\n />\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 color="warn"\r\n (click)="clearLocations()"\r\n type="button"\r\n matTooltip="Remove all the locations"\r\n >\r\n <mat-icon>delete_sweep</mat-icon>\r\n </button>\r\n <button\r\n mat-icon-button\r\n color="primary"\r\n type="submit"\r\n matTooltip="Render the decorated base text"\r\n >\r\n <mat-icon>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 </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 <tr *ngFor="let loc of locations">\r\n <td>\r\n <button\r\n mat-icon-button\r\n color="warn"\r\n (click)="removeLocation(loc)"\r\n >\r\n <mat-icon>remove_circle</mat-icon>\r\n </button>\r\n </td>\r\n <td>{{ loc.toString() }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </form>\r\n </mat-card-content>\r\n</mat-card>\r\n\r\n<mat-card>\r\n <mat-card-header>\r\n <h3>Rendition</h3>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <div [innerHtml]="result | safeHtml: \'html\'" id="result" #resultElem></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-height:100px;min-width:300px}:host>>>div#result{counter-reset:text-y-counter}:host>>>div#result p:before{color:#a0a0a0;content:counter(text-y-counter);counter-increment:text-y-counter;margin-right:6px}:host>>>span.fr{background-color:#ff0;border:1px solid #404040;font-weight:700}article{column-width:20em}"]}]}],l.ctorParameters=function(){return[{type:r.FormBuilder},{type:n.TextLayerService}]},l.propDecorators={_resultElement:[{type:e.ViewChild,args:["resultElem"]}]};var s=a.RouterModule.forChild([{path:"",pathMatch:"full",component:l}]),d=function(){};d.decorators=[{type:e.NgModule,args:[{imports:[o.CommonModule,r.FormsModule,r.ReactiveFormsModule,s,n.CadmusCoreModule,i.CadmusMaterialModule,c.CadmusUiModule],declarations:[l],exports:[l]}]}],t.CadmusLayerDemoModule=d,t.LayerDemoComponent=l,t.RouterModuleForChild=s,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
2
|
-
//# sourceMappingURL=myrmidon-cadmus-layer-demo.umd.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../projects/myrmidon/cadmus-layer-demo/src/lib/layer-demo/layer-demo.component.ts","../../../../projects/myrmidon/cadmus-layer-demo/src/lib/cadmus-layer-demo.module.ts"],"names":["LayerDemoComponent","formBuilder","_textLayerService","this","locations","text","control","location","rendition","group","result","prototype","removeOverlaps","loc","i","length","overlaps","splice","addLocation","value","TokenLocation","parse","done","n","compareTo","push","removeLocation","indexOf","clearLocations","render","getLocationForNew","userLocation","getSelectedLocationForNew","getSelectedRange","getLocationForEdit","getSelectedLocationForEdit","Component","args","selector","template","FormBuilder","TextLayerService","ViewChild","RouterModuleForChild","RouterModule","forChild","path","pathMatch","component","NgModule","imports","CommonModule","FormsModule","ReactiveFormsModule","CadmusCoreModule","CadmusMaterialModule","CadmusUiModule","declarations","exports"],"mappings":"2zBAoBE,SAAAA,EAAYC,EACFC,GAAAC,KAAAD,kBAAAA,EACRC,KAAKC,UAAY,GACjBD,KAAKE,KAAOJ,EAAYK,QAAQ,8CAChCH,KAAKI,SAAWN,EAAYK,QAAQ,WACpCH,KAAKK,UAAYP,EAAYQ,MAAM,CACjCJ,KAAQF,KAAKE,KACbE,SAAYJ,KAAKI,WAEnBJ,KAAKO,OAAS,UAGRV,EAAAW,UAAAC,eAAA,SAAeC,GACrB,IAAK,IAAIC,EAAIX,KAAKC,UAAUW,OAAS,EAAGD,GAAK,EAAGA,IAC1CD,IAAQV,KAAKC,UAAUU,IAGvBD,EAAIG,SAASb,KAAKC,UAAUU,KAC9BX,KAAKC,UAAUa,OAAOH,EAAG,IAKxBd,EAAAW,UAAAO,YAAA,WACL,GAAKf,KAAKI,SAASY,MAAnB,CAGA,IAAMN,EAAMO,EAAAA,cAAcC,MAAMlB,KAAKI,SAASY,OAC9C,GAAKN,EAAL,CAKA,IADA,IAAIS,GAAO,EACFR,EAAI,EAAGA,EAAIX,KAAKC,UAAUW,SAAWO,EAAMR,IAAK,CACvD,IAAMS,EAAIV,EAAIW,UAAUrB,KAAKC,UAAUU,IAEvC,GAAU,IAANS,EACF,OAGEA,EAAI,IACNpB,KAAKC,UAAUa,OAAOH,EAAG,EAAGD,GAC5BS,GAAO,GAINA,GACHnB,KAAKC,UAAUqB,KAAKZ,GAItBV,KAAKS,eAAeC,MAGfb,EAAAW,UAAAe,eAAA,SAAeb,GACpB,IAAMC,EAAIX,KAAKC,UAAUuB,QAAQd,GAC7BC,GAAK,GACPX,KAAKC,UAAUa,OAAOH,EAAG,IAItBd,EAAAW,UAAAiB,eAAA,WACLzB,KAAKC,UAAUW,OAAS,GAGnBf,EAAAW,UAAAkB,OAAA,WACL1B,KAAKO,OAASP,KAAKD,kBAAkB2B,OAAO1B,KAAKE,KAAKc,MAAOhB,KAAKC,YAG7DJ,EAAAW,UAAAmB,kBAAA,WACL3B,KAAK4B,aAAe5B,KAAKD,kBAAkB8B,0BACzC7B,KAAKD,kBAAkB+B,mBAAoB9B,KAAKE,KAAKc,QAGlDnB,EAAAW,UAAAuB,mBAAA,WACL/B,KAAK4B,aAAe5B,KAAKD,kBAAkBiC,2BACzChC,KAAKD,kBAAkB+B,8CA5F5BG,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,oBACVC,SAAA,u8JAL+BC,EAAAA,mBACxBC,EAAAA,4DAQNC,EAAAA,UAASL,KAAA,CAAC,qBCCAM,EAAuBC,EAAAA,aAAaC,SAAS,CACxD,CAAEC,KAAM,GAAIC,UAAW,OAAQC,UAAWhD,OAiB5C,iCAdCiD,EAAAA,SAAQZ,KAAA,CAAC,CACRa,QAAS,CACPC,EAAAA,aACAC,EAAAA,YACAC,EAAAA,oBACAV,EAEAW,EAAAA,iBACAC,EAAAA,qBACAC,EAAAA,gBAEFC,aAAc,CAACzD,GACf0D,QAAS,CAAC1D","sourcesContent":["import { Component, OnInit, 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})\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;\r\n public location: FormControl;\r\n\r\n constructor(formBuilder: FormBuilder,\r\n private _textLayerService: TextLayerService) {\r\n this.locations = [];\r\n this.text = formBuilder.control('alpha beta\\ngamma\\ndelta epsilon waw\\nzeta');\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 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 this.result = this._textLayerService.render(this.text.value, this.locations);\r\n }\r\n\r\n public getLocationForNew(): void {\r\n this.userLocation = this._textLayerService.getSelectedLocationForNew(\r\n this._textLayerService.getSelectedRange(), this.text.value);\r\n }\r\n\r\n public getLocationForEdit(): void {\r\n this.userLocation = this._textLayerService.getSelectedLocationForEdit(\r\n this._textLayerService.getSelectedRange());\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { RouterModule } from '@angular/router';\nimport { LayerDemoComponent } from './layer-demo/layer-demo.component';\n\nimport { CadmusCoreModule } from '@myrmidon/cadmus-core';\nimport { CadmusMaterialModule } from '@myrmidon/cadmus-material';\nimport { CadmusUiModule } from '@myrmidon/cadmus-ui';\n\n// https://github.com/ng-packagr/ng-packagr/issues/778\nexport const RouterModuleForChild = RouterModule.forChild([\n { path: '', pathMatch: 'full', component: LayerDemoComponent },\n]);\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n RouterModuleForChild,\n // cadmus\n CadmusCoreModule,\n CadmusMaterialModule,\n CadmusUiModule,\n ],\n declarations: [LayerDemoComponent],\n exports: [LayerDemoComponent],\n})\nexport class CadmusLayerDemoModule {}\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import { RouterModule } from '@angular/router';
|
|
5
|
-
import { LayerDemoComponent } from './layer-demo/layer-demo.component';
|
|
6
|
-
import { CadmusCoreModule } from '@myrmidon/cadmus-core';
|
|
7
|
-
import { CadmusMaterialModule } from '@myrmidon/cadmus-material';
|
|
8
|
-
import { CadmusUiModule } from '@myrmidon/cadmus-ui';
|
|
9
|
-
// https://github.com/ng-packagr/ng-packagr/issues/778
|
|
10
|
-
export const RouterModuleForChild = RouterModule.forChild([
|
|
11
|
-
{ path: '', pathMatch: 'full', component: LayerDemoComponent },
|
|
12
|
-
]);
|
|
13
|
-
export class CadmusLayerDemoModule {
|
|
14
|
-
}
|
|
15
|
-
CadmusLayerDemoModule.decorators = [
|
|
16
|
-
{ type: NgModule, args: [{
|
|
17
|
-
imports: [
|
|
18
|
-
CommonModule,
|
|
19
|
-
FormsModule,
|
|
20
|
-
ReactiveFormsModule,
|
|
21
|
-
RouterModuleForChild,
|
|
22
|
-
// cadmus
|
|
23
|
-
CadmusCoreModule,
|
|
24
|
-
CadmusMaterialModule,
|
|
25
|
-
CadmusUiModule,
|
|
26
|
-
],
|
|
27
|
-
declarations: [LayerDemoComponent],
|
|
28
|
-
exports: [LayerDemoComponent],
|
|
29
|
-
},] }
|
|
30
|
-
];
|
|
31
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FkbXVzLWxheWVyLWRlbW8ubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IkQ6L1Byb2plY3RzL0NvcmUyMC9TcGEvY2FkbXVzLXNoZWxsL3Byb2plY3RzL215cm1pZG9uL2NhZG11cy1sYXllci1kZW1vL3NyYy8iLCJzb3VyY2VzIjpbImxpYi9jYWRtdXMtbGF5ZXItZGVtby5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLFdBQVcsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ2xFLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSxtQ0FBbUMsQ0FBQztBQUV2RSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUN6RCxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUNqRSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0scUJBQX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