kritzel-angular 0.0.122 → 0.0.125
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,7 +1,8 @@
|
|
|
1
1
|
import { __decorate } from 'tslib';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { ChangeDetectionStrategy, Component, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';
|
|
3
|
+
import { EventEmitter, Output, ChangeDetectionStrategy, Component, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';
|
|
4
4
|
import { fromEvent } from 'rxjs';
|
|
5
|
+
import { defineCustomElement as defineCustomElement$1 } from 'kritzel-stencil/dist/components/kritzel-editor.js';
|
|
5
6
|
import { defineCustomElements } from 'kritzel-stencil/loader';
|
|
6
7
|
export { DEFAULT_BRUSH_CONFIG, DEFAULT_TEXT_CONFIG, KritzelBrushTool, KritzelEraserTool, KritzelImage, KritzelImageTool, KritzelPath, KritzelSelectionTool, KritzelText, KritzelTextTool } from 'kritzel-stencil';
|
|
7
8
|
|
|
@@ -66,15 +67,16 @@ function ProxyCmp(opts) {
|
|
|
66
67
|
let KritzelEditor = class KritzelEditor {
|
|
67
68
|
constructor(c, r, z) {
|
|
68
69
|
this.z = z;
|
|
70
|
+
this.isReady = new EventEmitter();
|
|
69
71
|
c.detach();
|
|
70
72
|
this.el = r.nativeElement;
|
|
71
|
-
proxyOutputs(this, this.el, ['isReady']);
|
|
72
73
|
}
|
|
73
74
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: KritzelEditor, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
74
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: KritzelEditor, isStandalone: true, selector: "kritzel-editor", inputs: { controls: "controls", customSvgIcons: "customSvgIcons", globalContextMenuItems: "globalContextMenuItems", isControlsVisible: "isControlsVisible", isUtilityPanelVisible: "isUtilityPanelVisible", objectContextMenuItems: "objectContextMenuItems", scaleMax: "scaleMax", scaleMin: "scaleMin" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
75
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: KritzelEditor, isStandalone: true, selector: "kritzel-editor", inputs: { controls: "controls", customSvgIcons: "customSvgIcons", globalContextMenuItems: "globalContextMenuItems", isControlsVisible: "isControlsVisible", isUtilityPanelVisible: "isUtilityPanelVisible", objectContextMenuItems: "objectContextMenuItems", scaleMax: "scaleMax", scaleMin: "scaleMin" }, outputs: { isReady: "isReady" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
75
76
|
};
|
|
76
77
|
KritzelEditor = __decorate([
|
|
77
78
|
ProxyCmp({
|
|
79
|
+
defineCustomElementFn: defineCustomElement$1,
|
|
78
80
|
inputs: ['controls', 'customSvgIcons', 'globalContextMenuItems', 'isControlsVisible', 'isUtilityPanelVisible', 'objectContextMenuItems', 'scaleMax', 'scaleMin'],
|
|
79
81
|
methods: ['getObjectById', 'addObject', 'updateObject', 'removeObject', 'getSelectedObjects', 'selectObjects', 'selectAllObjectsInViewport', 'clearSelection', 'centerObjectInViewport']
|
|
80
82
|
})
|
|
@@ -87,8 +89,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
87
89
|
template: '<ng-content></ng-content>',
|
|
88
90
|
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
|
|
89
91
|
inputs: ['controls', 'customSvgIcons', 'globalContextMenuItems', 'isControlsVisible', 'isUtilityPanelVisible', 'objectContextMenuItems', 'scaleMax', 'scaleMin'],
|
|
92
|
+
outputs: ['isReady'],
|
|
90
93
|
}]
|
|
91
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]
|
|
94
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { isReady: [{
|
|
95
|
+
type: Output
|
|
96
|
+
}] } });
|
|
92
97
|
|
|
93
98
|
const DIRECTIVES = [
|
|
94
99
|
KritzelEditor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kritzel-angular.mjs","sources":["../../../projects/lib/src/lib/angular-component-lib/utils.ts","../../../projects/lib/src/lib/proxy.ts","../../../projects/lib/src/lib/index.ts","../../../projects/lib/src/lib/provide.function.ts","../../../projects/lib/src/kritzel-angular.ts"],"sourcesContent":["/* eslint-disable */\n/* tslint:disable */\nimport { fromEvent } from 'rxjs';\n\nexport const proxyInputs = (Cmp: any, inputs: string[]) => {\n const Prototype = Cmp.prototype;\n inputs.forEach((item) => {\n Object.defineProperty(Prototype, item, {\n get() {\n return this.el[item];\n },\n set(val: any) {\n this.z.runOutsideAngular(() => (this.el[item] = val));\n },\n /**\n * In the event that proxyInputs is called\n * multiple times re-defining these inputs\n * will cause an error to be thrown. As a result\n * we set configurable: true to indicate these\n * properties can be changed.\n */\n configurable: true,\n });\n });\n};\n\nexport const proxyMethods = (Cmp: any, methods: string[]) => {\n const Prototype = Cmp.prototype;\n methods.forEach((methodName) => {\n Prototype[methodName] = function () {\n const args = arguments;\n return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));\n };\n });\n};\n\nexport const proxyOutputs = (instance: any, el: any, events: string[]) => {\n events.forEach((eventName) => (instance[eventName] = fromEvent(el, eventName)));\n};\n\nexport const defineCustomElement = (tagName: string, customElement: any) => {\n if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {\n customElements.define(tagName, customElement);\n }\n};\n\n// tslint:disable-next-line: only-arrow-functions\nexport function ProxyCmp(opts: { defineCustomElementFn?: () => void; inputs?: any; methods?: any }) {\n const decorator = function (cls: any) {\n const { defineCustomElementFn, inputs, methods } = opts;\n\n if (defineCustomElementFn !== undefined) {\n defineCustomElementFn();\n }\n\n if (inputs) {\n proxyInputs(cls, inputs);\n }\n if (methods) {\n proxyMethods(cls, methods);\n }\n return cls;\n };\n return decorator;\n}\n","/* tslint:disable */\n/* auto-generated angular directive proxies */\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, NgZone } from '@angular/core';\n\nimport { ProxyCmp
|
|
1
|
+
{"version":3,"file":"kritzel-angular.mjs","sources":["../../../projects/lib/src/lib/angular-component-lib/utils.ts","../../../projects/lib/src/lib/proxy.ts","../../../projects/lib/src/lib/index.ts","../../../projects/lib/src/lib/provide.function.ts","../../../projects/lib/src/kritzel-angular.ts"],"sourcesContent":["/* eslint-disable */\n/* tslint:disable */\nimport { fromEvent } from 'rxjs';\n\nexport const proxyInputs = (Cmp: any, inputs: string[]) => {\n const Prototype = Cmp.prototype;\n inputs.forEach((item) => {\n Object.defineProperty(Prototype, item, {\n get() {\n return this.el[item];\n },\n set(val: any) {\n this.z.runOutsideAngular(() => (this.el[item] = val));\n },\n /**\n * In the event that proxyInputs is called\n * multiple times re-defining these inputs\n * will cause an error to be thrown. As a result\n * we set configurable: true to indicate these\n * properties can be changed.\n */\n configurable: true,\n });\n });\n};\n\nexport const proxyMethods = (Cmp: any, methods: string[]) => {\n const Prototype = Cmp.prototype;\n methods.forEach((methodName) => {\n Prototype[methodName] = function () {\n const args = arguments;\n return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));\n };\n });\n};\n\nexport const proxyOutputs = (instance: any, el: any, events: string[]) => {\n events.forEach((eventName) => (instance[eventName] = fromEvent(el, eventName)));\n};\n\nexport const defineCustomElement = (tagName: string, customElement: any) => {\n if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {\n customElements.define(tagName, customElement);\n }\n};\n\n// tslint:disable-next-line: only-arrow-functions\nexport function ProxyCmp(opts: { defineCustomElementFn?: () => void; inputs?: any; methods?: any }) {\n const decorator = function (cls: any) {\n const { defineCustomElementFn, inputs, methods } = opts;\n\n if (defineCustomElementFn !== undefined) {\n defineCustomElementFn();\n }\n\n if (inputs) {\n proxyInputs(cls, inputs);\n }\n if (methods) {\n proxyMethods(cls, methods);\n }\n return cls;\n };\n return decorator;\n}\n","/* tslint:disable */\n/* auto-generated angular directive proxies */\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Output, NgZone } from '@angular/core';\n\nimport { ProxyCmp } from './angular-component-lib/utils';\n\nimport type { Components } from 'kritzel-stencil/dist/components';\n\nimport { defineCustomElement as defineKritzelEditor } from 'kritzel-stencil/dist/components/kritzel-editor.js';\n@ProxyCmp({\n defineCustomElementFn: defineKritzelEditor,\n inputs: ['controls', 'customSvgIcons', 'globalContextMenuItems', 'isControlsVisible', 'isUtilityPanelVisible', 'objectContextMenuItems', 'scaleMax', 'scaleMin'],\n methods: ['getObjectById', 'addObject', 'updateObject', 'removeObject', 'getSelectedObjects', 'selectObjects', 'selectAllObjectsInViewport', 'clearSelection', 'centerObjectInViewport']\n})\n@Component({\n selector: 'kritzel-editor',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: '<ng-content></ng-content>',\n // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property\n inputs: ['controls', 'customSvgIcons', 'globalContextMenuItems', 'isControlsVisible', 'isUtilityPanelVisible', 'objectContextMenuItems', 'scaleMax', 'scaleMin'],\n outputs: ['isReady'],\n})\nexport class KritzelEditor {\n protected el: HTMLKritzelEditorElement;\n @Output() isReady = new EventEmitter<CustomEvent<HTMLElement>>();\n constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {\n c.detach();\n this.el = r.nativeElement;\n }\n}\n\n\nexport declare interface KritzelEditor extends Components.KritzelEditor {\n\n isReady: EventEmitter<CustomEvent<HTMLElement>>;\n}\n\n\n","\nimport * as d from './proxy';\n\nexport const DIRECTIVES = [\n d.KritzelEditor\n];\n","import {\r\n provideAppInitializer,\r\n EnvironmentProviders,\r\n makeEnvironmentProviders,\r\n} from '@angular/core';\r\nimport { defineCustomElements } from 'kritzel-stencil/loader';\r\n\r\nexport function provideKritzel(): EnvironmentProviders {\r\n return makeEnvironmentProviders([\r\n provideAppInitializer(() => {\r\n console.info('Initializing Kritzel custom elements');\r\n return defineCustomElements(window);\r\n }),\r\n ]);\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["defineKritzelEditor","d.KritzelEditor"],"mappings":";;;;;;;;AAAA;AACA;AAGO,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAE,MAAgB,KAAI;AACxD,IAAA,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS;AAC/B,IAAA,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AACtB,QAAA,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE;YACrC,GAAG,GAAA;AACD,gBAAA,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;YACtB,CAAC;AACD,YAAA,GAAG,CAAC,GAAQ,EAAA;AACV,gBAAA,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;YACvD,CAAC;AACD;;;;;;AAMG;AACH,YAAA,YAAY,EAAE,IAAI;AACnB,SAAA,CAAC;AACJ,IAAA,CAAC,CAAC;AACJ,CAAC;AAEM,MAAM,YAAY,GAAG,CAAC,GAAQ,EAAE,OAAiB,KAAI;AAC1D,IAAA,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS;AAC/B,IAAA,OAAO,CAAC,OAAO,CAAC,CAAC,UAAU,KAAI;QAC7B,SAAS,CAAC,UAAU,CAAC,GAAG,YAAA;YACtB,MAAM,IAAI,GAAG,SAAS;YACtB,OAAO,IAAI,C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,oBAAA,QAAQ,EAAE,2BAA2B;;AAErC,oBAAA,MAAM,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,UAAU,EAAE,UAAU,CAAC;oBAChK,OAAO,EAAE,CAAC,SAAS,CAAC;AACrB,iBAAA;oIAGW,OAAO,EAAA,CAAA;sBAAhB;;;ACrBI,MAAM,UAAU,GAAG;AACxB,IAAAC;;;SCGc,cAAc,GAAA;AAC5B,IAAA,OAAO,wBAAwB,CAAC;QAC9B,qBAAqB,CAAC,MAAK;AACzB,YAAA,OAAO,CAAC,IAAI,CAAC,sCAAsC,CAAC;AACpD,YAAA,OAAO,oBAAoB,CAAC,MAAM,CAAC;AACrC,QAAA,CAAC,CAAC;AACH,KAAA,CAAC;AACJ;;ACdA;;AAEG;;;;"}
|
package/lib/proxy.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ChangeDetectorRef, ElementRef, EventEmitter, NgZone } from '@angular/core';
|
|
2
|
-
import { Components } from 'kritzel-stencil';
|
|
2
|
+
import type { Components } from 'kritzel-stencil/dist/components';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class KritzelEditor {
|
|
5
5
|
protected z: NgZone;
|
|
6
6
|
protected el: HTMLKritzelEditorElement;
|
|
7
|
+
isReady: EventEmitter<CustomEvent<HTMLElement>>;
|
|
7
8
|
constructor(c: ChangeDetectorRef, r: ElementRef, z: NgZone);
|
|
8
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<KritzelEditor, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<KritzelEditor, "kritzel-editor", never, { "controls": { "alias": "controls"; "required": false; }; "customSvgIcons": { "alias": "customSvgIcons"; "required": false; }; "globalContextMenuItems": { "alias": "globalContextMenuItems"; "required": false; }; "isControlsVisible": { "alias": "isControlsVisible"; "required": false; }; "isUtilityPanelVisible": { "alias": "isUtilityPanelVisible"; "required": false; }; "objectContextMenuItems": { "alias": "objectContextMenuItems"; "required": false; }; "scaleMax": { "alias": "scaleMax"; "required": false; }; "scaleMin": { "alias": "scaleMin"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KritzelEditor, "kritzel-editor", never, { "controls": { "alias": "controls"; "required": false; }; "customSvgIcons": { "alias": "customSvgIcons"; "required": false; }; "globalContextMenuItems": { "alias": "globalContextMenuItems"; "required": false; }; "isControlsVisible": { "alias": "isControlsVisible"; "required": false; }; "isUtilityPanelVisible": { "alias": "isUtilityPanelVisible"; "required": false; }; "objectContextMenuItems": { "alias": "objectContextMenuItems"; "required": false; }; "scaleMax": { "alias": "scaleMax"; "required": false; }; "scaleMin": { "alias": "scaleMin"; "required": false; }; }, { "isReady": "isReady"; }, never, ["*"], true, never>;
|
|
10
11
|
}
|
|
11
12
|
export declare interface KritzelEditor extends Components.KritzelEditor {
|
|
12
13
|
isReady: EventEmitter<CustomEvent<HTMLElement>>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kritzel-angular",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.125",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^19.0.0 || ^20.0.0",
|
|
6
6
|
"@angular/core": "^19.0.0 || ^20.0.0",
|
|
7
|
-
"kritzel-stencil": "^0.0.
|
|
7
|
+
"kritzel-stencil": "^0.0.125"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"tslib": "^2.3.0"
|