@myrmidon/gve-core 0.0.1
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 +83 -0
- package/esm2022/lib/components/animation-timeline/animation-timeline.component.mjs +176 -0
- package/esm2022/lib/components/animation-tween/animation-tween.component.mjs +161 -0
- package/esm2022/lib/components/animation-vars/animation-vars.component.mjs +141 -0
- package/esm2022/lib/components/base-text-char/base-text-char.component.mjs +37 -0
- package/esm2022/lib/components/base-text-editor/base-text-editor.component.mjs +111 -0
- package/esm2022/lib/components/base-text-view/base-text-view.component.mjs +125 -0
- package/esm2022/lib/components/chain-operation-editor/chain-operation-editor.component.mjs +512 -0
- package/esm2022/lib/components/chain-result-view/chain-result-view.component.mjs +190 -0
- package/esm2022/lib/components/feature-editor/feature-editor.component.mjs +185 -0
- package/esm2022/lib/components/feature-set-editor/feature-set-editor.component.mjs +152 -0
- package/esm2022/lib/components/feature-set-view/feature-set-view.component.mjs +80 -0
- package/esm2022/lib/components/ln-heights-editor/ln-heights-editor.component.mjs +95 -0
- package/esm2022/lib/components/operation-source-editor/operation-source-editor.component.mjs +106 -0
- package/esm2022/lib/components/simple-tree/simple-tree.component.mjs +56 -0
- package/esm2022/lib/components/snapshot-editor/snapshot-editor.component.mjs +510 -0
- package/esm2022/lib/components/steps-map/steps-map.component.mjs +55 -0
- package/esm2022/lib/models.mjs +2 -0
- package/esm2022/lib/services/gve-api.service.mjs +52 -0
- package/esm2022/lib/services/settings.service.mjs +86 -0
- package/esm2022/lib/validators/svg-validators.mjs +28 -0
- package/esm2022/myrmidon-gve-core.mjs +5 -0
- package/esm2022/public-api.mjs +23 -0
- package/fesm2022/myrmidon-gve-core.mjs +2592 -0
- package/fesm2022/myrmidon-gve-core.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/animation-timeline/animation-timeline.component.d.ts +42 -0
- package/lib/components/animation-tween/animation-tween.component.d.ts +47 -0
- package/lib/components/animation-vars/animation-vars.component.d.ts +30 -0
- package/lib/components/base-text-char/base-text-char.component.d.ts +29 -0
- package/lib/components/base-text-editor/base-text-editor.component.d.ts +40 -0
- package/lib/components/base-text-view/base-text-view.component.d.ts +29 -0
- package/lib/components/chain-operation-editor/chain-operation-editor.component.d.ts +102 -0
- package/lib/components/chain-result-view/chain-result-view.component.d.ts +44 -0
- package/lib/components/feature-editor/feature-editor.component.d.ts +72 -0
- package/lib/components/feature-set-editor/feature-set-editor.component.d.ts +55 -0
- package/lib/components/feature-set-view/feature-set-view.component.d.ts +36 -0
- package/lib/components/ln-heights-editor/ln-heights-editor.component.d.ts +22 -0
- package/lib/components/operation-source-editor/operation-source-editor.component.d.ts +24 -0
- package/lib/components/simple-tree/simple-tree.component.d.ts +16 -0
- package/lib/components/snapshot-editor/snapshot-editor.component.d.ts +105 -0
- package/lib/components/steps-map/steps-map.component.d.ts +29 -0
- package/lib/models.d.ts +7 -0
- package/lib/services/gve-api.service.d.ts +57 -0
- package/lib/services/settings.service.d.ts +53 -0
- package/lib/validators/svg-validators.d.ts +4 -0
- package/package.json +45 -0
- package/public-api.d.ts +19 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
4
|
+
import { DialogService } from '@myrmidon/ng-mat-tools';
|
|
5
|
+
import { CharChainOperation, CharNode, GveVisualEvent, Snapshot, SnapshotViewData, SnapshotViewRenderEvent } from '@myrmidon/gve-snapshot-view';
|
|
6
|
+
import { VarBaseTextRange } from '../base-text-view/base-text-view.component';
|
|
7
|
+
import { ChainOperationContextStep, CharChainResult, GveApiService } from '../../services/gve-api.service';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
/**
|
|
10
|
+
* A component to edit a text snapshot.
|
|
11
|
+
*/
|
|
12
|
+
export declare class SnapshotEditorComponent implements OnInit {
|
|
13
|
+
private _api;
|
|
14
|
+
private _dialogService;
|
|
15
|
+
private _snackbar;
|
|
16
|
+
private _snapshot?;
|
|
17
|
+
private _renderer?;
|
|
18
|
+
/**
|
|
19
|
+
* The snapshot to edit.
|
|
20
|
+
*/
|
|
21
|
+
get snapshot(): Snapshot | undefined;
|
|
22
|
+
set snapshot(value: Snapshot | undefined | null);
|
|
23
|
+
/**
|
|
24
|
+
* The batch operations text to set for the editor.
|
|
25
|
+
*/
|
|
26
|
+
batchOps?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Emitted when the user saves the edited snapshot.
|
|
29
|
+
*/
|
|
30
|
+
readonly snapshotChange: EventEmitter<Snapshot>;
|
|
31
|
+
/**
|
|
32
|
+
* Emitted when the user cancels the snapshot editing.
|
|
33
|
+
*/
|
|
34
|
+
readonly snapshotCancel: EventEmitter<void>;
|
|
35
|
+
width: FormControl<number>;
|
|
36
|
+
height: FormControl<number>;
|
|
37
|
+
style: FormControl<string | null>;
|
|
38
|
+
baseText: FormControl<CharNode[] | string>;
|
|
39
|
+
offsetX: FormControl<number>;
|
|
40
|
+
offsetY: FormControl<number>;
|
|
41
|
+
lineHeightOffset: FormControl<number>;
|
|
42
|
+
lnHeights: FormControl<Record<number, number> | null>;
|
|
43
|
+
charSpacingOffset: FormControl<number>;
|
|
44
|
+
spcWidthOffset: FormControl<number>;
|
|
45
|
+
textStyle: FormControl<string | null>;
|
|
46
|
+
operations: FormControl<CharChainOperation[]>;
|
|
47
|
+
inputOps: FormControl<string | null>;
|
|
48
|
+
opStyle: FormControl<string | null>;
|
|
49
|
+
form: FormGroup;
|
|
50
|
+
imageUrl: FormControl<string | null>;
|
|
51
|
+
imageOpacity: FormControl<number>;
|
|
52
|
+
imageX: FormControl<number>;
|
|
53
|
+
imageY: FormControl<number>;
|
|
54
|
+
imageWidth: FormControl<number>;
|
|
55
|
+
imageHeight: FormControl<number>;
|
|
56
|
+
defs: FormControl<string | null>;
|
|
57
|
+
textRange?: VarBaseTextRange;
|
|
58
|
+
editedOp?: CharChainOperation;
|
|
59
|
+
editedOpIndex: number;
|
|
60
|
+
busy?: boolean;
|
|
61
|
+
parseError?: string;
|
|
62
|
+
opTypeMap: {
|
|
63
|
+
0: string;
|
|
64
|
+
1: string;
|
|
65
|
+
2: string;
|
|
66
|
+
3: string;
|
|
67
|
+
4: string;
|
|
68
|
+
5: string;
|
|
69
|
+
6: string;
|
|
70
|
+
7: string;
|
|
71
|
+
};
|
|
72
|
+
lineCount: number;
|
|
73
|
+
viewTitle: string;
|
|
74
|
+
viewData?: SnapshotViewData;
|
|
75
|
+
visualInfo?: string;
|
|
76
|
+
rulers: boolean;
|
|
77
|
+
result?: CharChainResult;
|
|
78
|
+
resultOperationId?: string;
|
|
79
|
+
constructor(formBuilder: FormBuilder, _api: GveApiService, _dialogService: DialogService, _snackbar: MatSnackBar);
|
|
80
|
+
ngOnInit(): void;
|
|
81
|
+
updateViewData(newOperation?: CharChainOperation, snapshot?: Snapshot, title?: string): void;
|
|
82
|
+
private updateForm;
|
|
83
|
+
editNewOperation(): void;
|
|
84
|
+
editOperation(index: number): void;
|
|
85
|
+
private closeEditedOp;
|
|
86
|
+
onOperationCancel(): void;
|
|
87
|
+
onOperationChange(op: CharChainOperation): void;
|
|
88
|
+
deleteOperation(index: number): void;
|
|
89
|
+
onTextChange(text: CharNode[]): void;
|
|
90
|
+
onRangePick(range: VarBaseTextRange): void;
|
|
91
|
+
parseOperations(): void;
|
|
92
|
+
clearOperations(): void;
|
|
93
|
+
onOperationPreview(operation: CharChainOperation): void;
|
|
94
|
+
runTo(index: number): void;
|
|
95
|
+
onStepPick(step: ChainOperationContextStep): void;
|
|
96
|
+
onVisualEvent(event: CustomEvent<GveVisualEvent>): void;
|
|
97
|
+
onHeightsChange(heights: Record<number, number> | undefined): void;
|
|
98
|
+
close(): void;
|
|
99
|
+
onSnapshotRender(event: CustomEvent<SnapshotViewRenderEvent>): void;
|
|
100
|
+
toggleRulers(): void;
|
|
101
|
+
private getSnapshot;
|
|
102
|
+
save(): void;
|
|
103
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SnapshotEditorComponent, never>;
|
|
104
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SnapshotEditorComponent, "gve-snapshot-editor", never, { "snapshot": { "alias": "snapshot"; "required": false; }; "batchOps": { "alias": "batchOps"; "required": false; }; }, { "snapshotChange": "snapshotChange"; "snapshotCancel": "snapshotCancel"; }, never, never, true, never>;
|
|
105
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { ChainOperationContextStep } from '../../services/gve-api.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* A map of steps in a chain operation context.
|
|
6
|
+
*/
|
|
7
|
+
export declare class StepsMapComponent {
|
|
8
|
+
private _steps?;
|
|
9
|
+
/**
|
|
10
|
+
* The steps to display.
|
|
11
|
+
*/
|
|
12
|
+
get steps(): ChainOperationContextStep[] | undefined;
|
|
13
|
+
set steps(value: ChainOperationContextStep[] | undefined | null);
|
|
14
|
+
/**
|
|
15
|
+
* The step that is currently selected.
|
|
16
|
+
*/
|
|
17
|
+
selectedStep: ChainOperationContextStep | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The font size of the steps text.
|
|
20
|
+
*/
|
|
21
|
+
textFontSize: string;
|
|
22
|
+
/**
|
|
23
|
+
* Emitted when the selectd step has changed.
|
|
24
|
+
*/
|
|
25
|
+
selectedStepChange: EventEmitter<ChainOperationContextStep>;
|
|
26
|
+
onSelectStep(step: ChainOperationContextStep): void;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StepsMapComponent, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StepsMapComponent, "gve-steps-map", never, { "steps": { "alias": "steps"; "required": false; }; "selectedStep": { "alias": "selectedStep"; "required": false; }; "textFontSize": { "alias": "textFontSize"; "required": false; }; }, { "selectedStepChange": "selectedStepChange"; }, never, never, true, never>;
|
|
29
|
+
}
|
package/lib/models.d.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ErrorService, EnvService } from '@myrmidon/ng-tools';
|
|
4
|
+
import { CharChainOperation, CharNode, OperationFeature } from '@myrmidon/gve-snapshot-view';
|
|
5
|
+
import { ResultWrapper } from '../models';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Execution step of a char-based chain operation.
|
|
9
|
+
*/
|
|
10
|
+
export interface ChainOperationContextStep {
|
|
11
|
+
operation: CharChainOperation;
|
|
12
|
+
inputTag: string;
|
|
13
|
+
outputTag: string;
|
|
14
|
+
result?: string;
|
|
15
|
+
featureSet: {
|
|
16
|
+
features: OperationFeature[];
|
|
17
|
+
nodeFeatures: Record<string, OperationFeature[]>;
|
|
18
|
+
};
|
|
19
|
+
refNodeIds: number[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Result of execution of a char-based chain.
|
|
23
|
+
*/
|
|
24
|
+
export interface CharChainResult {
|
|
25
|
+
steps: ChainOperationContextStep[];
|
|
26
|
+
chainDump: string;
|
|
27
|
+
chainTags: string[];
|
|
28
|
+
taggedNodes: {
|
|
29
|
+
[key: string]: CharNode[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Service to interact with the GVE API.
|
|
34
|
+
*/
|
|
35
|
+
export declare class GveApiService {
|
|
36
|
+
private _http;
|
|
37
|
+
private _error;
|
|
38
|
+
private _env;
|
|
39
|
+
constructor(_http: HttpClient, _error: ErrorService, _env: EnvService);
|
|
40
|
+
/**
|
|
41
|
+
* Parse the specified text into operations. Each operation is a line
|
|
42
|
+
* of the text.
|
|
43
|
+
* @param text The text to parse.
|
|
44
|
+
* @returns The operations.
|
|
45
|
+
*/
|
|
46
|
+
parseOperations(text: string): Observable<ResultWrapper<CharChainOperation[]>>;
|
|
47
|
+
/**
|
|
48
|
+
* Run operations on the specified text.
|
|
49
|
+
*
|
|
50
|
+
* @param text The base text.
|
|
51
|
+
* @param operations The operations to run.
|
|
52
|
+
* @returns Result wrapper.
|
|
53
|
+
*/
|
|
54
|
+
runOperations(text: CharNode[], operations: CharChainOperation[]): Observable<ResultWrapper<CharChainResult>>;
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GveApiService, never>;
|
|
56
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<GveApiService>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Service to store and retrieve dynamic settings.
|
|
4
|
+
*/
|
|
5
|
+
export declare class SettingsService {
|
|
6
|
+
private readonly _cache;
|
|
7
|
+
/**
|
|
8
|
+
* Prefix to scope the keys. This prefix is used internally to scope the keys
|
|
9
|
+
* so that they cannot conflict with other keys in the local storage.
|
|
10
|
+
* The prefix is totally transparent to the user of the service, who should
|
|
11
|
+
* use the keys without the prefix.
|
|
12
|
+
*/
|
|
13
|
+
keyPrefix?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Scopes the key by prefixing it with the keyPrefix if any.
|
|
16
|
+
*
|
|
17
|
+
* @param key The key to scope.
|
|
18
|
+
* @returns The scoped key.
|
|
19
|
+
*/
|
|
20
|
+
private getScopedKey;
|
|
21
|
+
/**
|
|
22
|
+
* Sets a setting's value.
|
|
23
|
+
*
|
|
24
|
+
* @param key The key.
|
|
25
|
+
* @param value The value.
|
|
26
|
+
* @param persist True to persist this setting in local storage.
|
|
27
|
+
*/
|
|
28
|
+
set(key: string, value: any, persist?: boolean): void;
|
|
29
|
+
/**
|
|
30
|
+
* Get a setting's value of type T.
|
|
31
|
+
*
|
|
32
|
+
* @param key The key.
|
|
33
|
+
* @param defaultValue The default value to get when the setting
|
|
34
|
+
* is not found in the store.
|
|
35
|
+
* @returns The value.
|
|
36
|
+
*/
|
|
37
|
+
get<T>(key: string, defaultValue?: any): T;
|
|
38
|
+
/**
|
|
39
|
+
* Check if a key exists in the store.
|
|
40
|
+
*
|
|
41
|
+
* @param key The key.
|
|
42
|
+
* @returns True if the key exists in the store.
|
|
43
|
+
*/
|
|
44
|
+
contains(key: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Remove a setting if present.
|
|
47
|
+
*
|
|
48
|
+
* @param key The key.
|
|
49
|
+
*/
|
|
50
|
+
remove(key: string): void;
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SettingsService, never>;
|
|
52
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SettingsService>;
|
|
53
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@myrmidon/gve-core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Cadmus - GVE frontend core components.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"GVE"
|
|
7
|
+
],
|
|
8
|
+
"homepage": "https://github.com/vedph/gve-shell",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/vedph/gve-shell"
|
|
12
|
+
},
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "Daniele Fusi"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@angular/common": "^18.0.0",
|
|
18
|
+
"@angular/core": "^18.0.0",
|
|
19
|
+
"@cisstech/nge": "^17.7.1",
|
|
20
|
+
"@myrmidon/ng-mat-tools": "^3.1.0",
|
|
21
|
+
"@myrmidon/ng-tools": "^3.1.1",
|
|
22
|
+
"@myrmidon/gve-snapshot-view": "^0.0.19",
|
|
23
|
+
"@svgdotjs/svg.js": "^3.2.3",
|
|
24
|
+
"gsap": "^3.12.5",
|
|
25
|
+
"monaco-editor": "^0.50.0",
|
|
26
|
+
"nanoid": "^5.0.7"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"tslib": "^2.3.0"
|
|
30
|
+
},
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"module": "fesm2022/myrmidon-gve-core.mjs",
|
|
33
|
+
"typings": "index.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
"./package.json": {
|
|
36
|
+
"default": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
".": {
|
|
39
|
+
"types": "./index.d.ts",
|
|
40
|
+
"esm2022": "./esm2022/myrmidon-gve-core.mjs",
|
|
41
|
+
"esm": "./esm2022/myrmidon-gve-core.mjs",
|
|
42
|
+
"default": "./fesm2022/myrmidon-gve-core.mjs"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from './lib/models';
|
|
2
|
+
export * from './lib/components/animation-timeline/animation-timeline.component';
|
|
3
|
+
export * from './lib/components/animation-tween/animation-tween.component';
|
|
4
|
+
export * from './lib/components/animation-vars/animation-vars.component';
|
|
5
|
+
export * from './lib/components/base-text-char/base-text-char.component';
|
|
6
|
+
export * from './lib/components/base-text-editor/base-text-editor.component';
|
|
7
|
+
export * from './lib/components/base-text-view/base-text-view.component';
|
|
8
|
+
export * from './lib/components/chain-operation-editor/chain-operation-editor.component';
|
|
9
|
+
export * from './lib/components/chain-result-view/chain-result-view.component';
|
|
10
|
+
export * from './lib/components/feature-editor/feature-editor.component';
|
|
11
|
+
export * from './lib/components/feature-set-editor/feature-set-editor.component';
|
|
12
|
+
export * from './lib/components/feature-set-view/feature-set-view.component';
|
|
13
|
+
export * from './lib/components/ln-heights-editor/ln-heights-editor.component';
|
|
14
|
+
export * from './lib/components/operation-source-editor/operation-source-editor.component';
|
|
15
|
+
export * from './lib/components/simple-tree/simple-tree.component';
|
|
16
|
+
export * from './lib/components/snapshot-editor/snapshot-editor.component';
|
|
17
|
+
export * from './lib/components/steps-map/steps-map.component';
|
|
18
|
+
export * from './lib/services/gve-api.service';
|
|
19
|
+
export * from './lib/services/settings.service';
|