@kritzel/angular-engine 0.4.31

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/LICENSE.md ADDED
@@ -0,0 +1,50 @@
1
+ # Software License Agreement
2
+
3
+ **IMPORTANT NOTICE:** This is a source-available, non-commercial license.
4
+ * **Hobbyists & Personal Use:** 100% Free. You are welcome to use, modify, and experiment with this software for personal, hobby, or educational projects.
5
+ * **Commercial & Professional Use:** Strictly Prohibited. If you want to use this software in a corporate environment, for professional client work, or as part of a revenue-generating product, you must obtain a commercial license.
6
+
7
+ To purchase a commercial license, please visit: https://kritzel.io
8
+
9
+ ---
10
+
11
+ ## PolyForm Noncommercial License 1.0.0
12
+
13
+ ### Acceptance
14
+ By using or distributing this software, you accept this license.
15
+
16
+ ### User
17
+ You is the person or organization who accepts this license. You can accept this license for only yourself or for an organization.
18
+
19
+ ### Software
20
+ Software is the software that includes this license text.
21
+
22
+ ### Practice
23
+ Practice is to use, copy, modify, distribute, or make derivative works of the Software.
24
+
25
+ ### Grant
26
+ You may Practice the Software for noncommercial purposes.
27
+
28
+ ### Noncommercial Purposes
29
+ Noncommercial purposes are purposes that are not commercial purposes.
30
+
31
+ ### Commercial Purposes
32
+ Commercial purposes are purposes intended for or directed toward commercial advantage or monetary compensation. Commercial purposes include, but are not limited to, using the Software to provide services to others for a fee, using the Software as part of a product sold or licensed to others, or using the Software inside a business or for professional work.
33
+
34
+ ### Redistribution
35
+ You may redistribute copies of the Software, with or without modification, provided that you include this license text with every copy.
36
+
37
+ ### Notices
38
+ You must ensure that any copy of the Software you distribute includes all copyright notices, trademark notices, and other legal notices included in the Software.
39
+
40
+ ### No Other Rights
41
+ This license does not grant any patent rights or trademark rights.
42
+
43
+ ### Termination
44
+ If you violate any term of this license, your rights under this license terminate immediately.
45
+
46
+ ### Defensive Patent Claims
47
+ If you make a patent claim against anyone alleging that the Software infringes a patent, your rights under this license terminate immediately.
48
+
49
+ ### No Warranty
50
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,116 @@
1
+ # Kritzel Engine for Angular
2
+
3
+ Build infinite canvas and collaborative whiteboard experiences in Angular with Kritzel's native wrapper and TypeScript-first API.
4
+
5
+ Kritzel is a framework-agnostic infinite canvas and collaborative whiteboard engine. It provides web components that work natively in any framework, with a first-class Angular wrapper for idiomatic template integration.
6
+
7
+ Kritzel handles the hard parts of canvas-based applications — infinite pan/zoom, hit-testing, CRDT-based collaboration, undo/redo, and cross-browser rendering — so you can focus on your product's domain logic.
8
+
9
+ **Full documentation:** [kritzel.io/docs/angular/getting-started/quick-start](https://kritzel.io/docs/angular/getting-started/quick-start)
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ npm install @kritzel/angular-engine
15
+ ```
16
+
17
+ ## Setup
18
+
19
+ Register Kritzel in your application config:
20
+
21
+ ```ts
22
+ import { ApplicationConfig } from '@angular/core';
23
+ import { provideKritzel } from '@kritzel/angular-engine';
24
+
25
+ export const appConfig: ApplicationConfig = {
26
+ providers: [
27
+ // ... other providers
28
+ provideKritzel(),
29
+ ],
30
+ };
31
+ ```
32
+
33
+ Then use the component in your template:
34
+
35
+ ```ts
36
+ import { Component } from '@angular/core';
37
+ import { KritzelEngine } from '@kritzel/angular-engine';
38
+
39
+ @Component({
40
+ selector: 'app-editor',
41
+ imports: [KritzelEngine],
42
+ template: `<kritzel-engine></kritzel-engine>`,
43
+ styles: [`kritzel-engine { display: block; width: 100%; height: 100vh; }`],
44
+ })
45
+ export class EditorComponent {}
46
+ ```
47
+
48
+ This renders the lower-level engine canvas without the editor toolbar shell.
49
+
50
+ ## Optional Enhancements
51
+
52
+ ### Persist Canvas State
53
+
54
+ By default, the engine uses an empty sync provider list, so canvas state is reset on reload. To persist objects locally across page reloads, configure `syncConfig` explicitly with `IndexedDBSyncProvider`.
55
+
56
+ ```ts
57
+ import { Component } from '@angular/core';
58
+ import { IndexedDBSyncProvider, KritzelEngine, KritzelSyncConfig } from '@kritzel/angular-engine';
59
+
60
+ @Component({
61
+ selector: 'app-editor',
62
+ imports: [KritzelEngine],
63
+ template: `<kritzel-engine [syncConfig]="syncConfig"></kritzel-engine>`,
64
+ styles: [`kritzel-engine { display: block; width: 100%; height: 100vh; }`],
65
+ })
66
+ export class EditorComponent {
67
+ readonly syncConfig: KritzelSyncConfig = {
68
+ providers: [IndexedDBSyncProvider],
69
+ };
70
+ }
71
+ ```
72
+
73
+ ### Apply Full Viewport Styling
74
+
75
+ To ensure the Kritzel engine occupies the entire viewport and prevents unwanted scrolling, add the following CSS to your global stylesheet (e.g. `styles.css`):
76
+
77
+ ```css
78
+ html,
79
+ body,
80
+ app-root {
81
+ width: 100dvw;
82
+ height: 100dvh;
83
+ margin: 0;
84
+ padding: 0;
85
+ overflow: hidden;
86
+ display: block;
87
+ }
88
+ ```
89
+
90
+ ### Include Mobile Viewport Meta Tag
91
+
92
+ For optimal rendering and responsiveness on mobile devices, add this meta tag within the `<head>` section of your `index.html`:
93
+
94
+ ```html
95
+ <meta
96
+ name="viewport"
97
+ content="viewport-fit=cover, width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0, interactive-widget=resizes-content"
98
+ />
99
+ ```
100
+
101
+ ## Fundamentals
102
+
103
+ Kritzel is composed of a small set of core concepts that work together to power your canvas experience:
104
+
105
+ - **Components** — Two entry points, a batteries-included editor and a headless engine, to match any integration style.
106
+ - **Tools** — State-machine interaction handlers that define how users draw, select, and manipulate the canvas.
107
+ - **Objects** — The visual building blocks on the canvas — paths, shapes, text, and images with shared spatial properties.
108
+ - **Workspaces** — Containers that manage an entire canvas collection, view state, and editor configuration.
109
+ - **Theming** — Built-in light and dark themes with full CSS variable customization to match your brand.
110
+ - **Collaboration** — Real-time multi-user sync powered by Yjs CRDTs with pluggable transport providers.
111
+
112
+ Learn more in the [full documentation](https://kritzel.io/docs/angular/getting-started/basic-usage).
113
+
114
+ ## License
115
+
116
+ See the [Kritzel License](https://kritzel.io/license). Kritzel is free for personal, hobby, and educational use. Commercial use requires a license — visit [kritzel.io](https://kritzel.io) for details.
@@ -0,0 +1,164 @@
1
+ import { __decorate } from 'tslib';
2
+ import * as i0 from '@angular/core';
3
+ import { EventEmitter, Output, ChangeDetectionStrategy, Component, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';
4
+ import { fromEvent } from 'rxjs';
5
+ import { defineCustomElement as defineCustomElement$1 } from '@kritzel/engine/dist/components/kritzel-engine.js';
6
+ import { defineCustomElements } from '@kritzel/engine/loader';
7
+ export { BroadcastSyncProvider, DEFAULT_BRUSH_CONFIG, DEFAULT_TEXT_CONFIG, DE_LOCALE, EN_LOCALE, FR_LOCALE, HocuspocusSyncProvider, InMemorySyncProvider, IndexedDBSyncProvider, KritzelAlignment, KritzelBaseObject, KritzelBaseTool, KritzelBrushTool, KritzelDynamicObject, KritzelDynamicObjectRendererRegistry, KritzelEraserTool, KritzelFontRegistry, KritzelGroup, KritzelImage, KritzelImageTool, KritzelLicenseManager, KritzelLine, KritzelLineTool, KritzelLocalizationManager, KritzelPath, KritzelSelectionTool, KritzelShape, KritzelShapeTool, KritzelText, KritzelTextTool, KritzelThemeManager, KritzelWorkspace, ShapeType, WebSocketSyncProvider, darkTheme, hasRemoteSyncProvider, lightTheme } from '@kritzel/engine';
8
+
9
+ /* eslint-disable */
10
+ /* tslint:disable */
11
+ const proxyInputs = (Cmp, inputs) => {
12
+ const Prototype = Cmp.prototype;
13
+ inputs.forEach((item) => {
14
+ Object.defineProperty(Prototype, item, {
15
+ get() {
16
+ return this.el[item];
17
+ },
18
+ set(val) {
19
+ this.z.runOutsideAngular(() => (this.el[item] = val));
20
+ },
21
+ /**
22
+ * In the event that proxyInputs is called
23
+ * multiple times re-defining these inputs
24
+ * will cause an error to be thrown. As a result
25
+ * we set configurable: true to indicate these
26
+ * properties can be changed.
27
+ */
28
+ configurable: true,
29
+ });
30
+ });
31
+ };
32
+ const proxyMethods = (Cmp, methods) => {
33
+ const Prototype = Cmp.prototype;
34
+ methods.forEach((methodName) => {
35
+ Prototype[methodName] = function () {
36
+ const args = arguments;
37
+ return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));
38
+ };
39
+ });
40
+ };
41
+ const proxyOutputs = (instance, el, events) => {
42
+ events.forEach((eventName) => (instance[eventName] = fromEvent(el, eventName)));
43
+ };
44
+ const defineCustomElement = (tagName, customElement) => {
45
+ if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
46
+ customElements.define(tagName, customElement);
47
+ }
48
+ };
49
+ // tslint:disable-next-line: only-arrow-functions
50
+ function ProxyCmp(opts) {
51
+ const decorator = function (cls) {
52
+ const { defineCustomElementFn, inputs, methods } = opts;
53
+ if (defineCustomElementFn !== undefined) {
54
+ defineCustomElementFn();
55
+ }
56
+ if (inputs) {
57
+ proxyInputs(cls, inputs);
58
+ }
59
+ if (methods) {
60
+ proxyMethods(cls, methods);
61
+ }
62
+ return cls;
63
+ };
64
+ return decorator;
65
+ }
66
+
67
+ let KritzelEngine = class KritzelEngine {
68
+ constructor(c, r, z) {
69
+ this.z = z;
70
+ this.isEngineReady = new EventEmitter();
71
+ this.activeToolChange = new EventEmitter();
72
+ this.workspacesChange = new EventEmitter();
73
+ this.activeWorkspaceChange = new EventEmitter();
74
+ this.longpress = new EventEmitter();
75
+ this.objectsChange = new EventEmitter();
76
+ this.objectsAdded = new EventEmitter();
77
+ this.objectsRemoved = new EventEmitter();
78
+ this.objectsUpdated = new EventEmitter();
79
+ this.objectsSelectionChange = new EventEmitter();
80
+ this.undoStateChange = new EventEmitter();
81
+ this.objectsInViewportChange = new EventEmitter();
82
+ this.viewportChange = new EventEmitter();
83
+ this.awarenessChange = new EventEmitter();
84
+ this.notificationsChange = new EventEmitter();
85
+ this.contextMenuStateChange = new EventEmitter();
86
+ this.isLoadingChange = new EventEmitter();
87
+ c.detach();
88
+ this.el = r.nativeElement;
89
+ }
90
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: KritzelEngine, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
91
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.6", type: KritzelEngine, isStandalone: true, selector: "kritzel-engine", inputs: { activeWorkspaceId: "activeWorkspaceId", assetStorageConfig: "assetStorageConfig", cursorTarget: "cursorTarget", debugInfo: "debugInfo", editorId: "editorId", fallbackLocale: "fallbackLocale", globalContextMenuItems: "globalContextMenuItems", isPanningEnabled: "isPanningEnabled", isZoomingEnabled: "isZoomingEnabled", licenseKey: "licenseKey", locale: "locale", locales: "locales", lockDrawingScale: "lockDrawingScale", objectContextMenuItems: "objectContextMenuItems", scaleMax: "scaleMax", scaleMin: "scaleMin", syncConfig: "syncConfig", theme: "theme", themes: "themes", user: "user", viewportBoundaryBottom: "viewportBoundaryBottom", viewportBoundaryLeft: "viewportBoundaryLeft", viewportBoundaryRight: "viewportBoundaryRight", viewportBoundaryTop: "viewportBoundaryTop", workspaces: "workspaces" }, outputs: { isEngineReady: "isEngineReady", activeToolChange: "activeToolChange", workspacesChange: "workspacesChange", activeWorkspaceChange: "activeWorkspaceChange", longpress: "longpress", objectsChange: "objectsChange", objectsAdded: "objectsAdded", objectsRemoved: "objectsRemoved", objectsUpdated: "objectsUpdated", objectsSelectionChange: "objectsSelectionChange", undoStateChange: "undoStateChange", objectsInViewportChange: "objectsInViewportChange", viewportChange: "viewportChange", awarenessChange: "awarenessChange", notificationsChange: "notificationsChange", contextMenuStateChange: "contextMenuStateChange", isLoadingChange: "isLoadingChange" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
92
+ };
93
+ KritzelEngine = __decorate([
94
+ ProxyCmp({
95
+ defineCustomElementFn: defineCustomElement$1,
96
+ inputs: ['activeWorkspaceId', 'assetStorageConfig', 'cursorTarget', 'debugInfo', 'editorId', 'fallbackLocale', 'globalContextMenuItems', 'isPanningEnabled', 'isZoomingEnabled', 'licenseKey', 'locale', 'locales', 'lockDrawingScale', 'objectContextMenuItems', 'scaleMax', 'scaleMin', 'syncConfig', 'theme', 'themes', 'user', 'viewportBoundaryBottom', 'viewportBoundaryLeft', 'viewportBoundaryRight', 'viewportBoundaryTop', 'workspaces'],
97
+ methods: ['triggerSelectionChange', 'beginSceneBootstrap', 'endSceneBootstrap', 'registerTool', 'changeActiveTool', 'disable', 'enable', 'delete', 'copy', 'cut', 'paste', 'bringForward', 'sendBackward', 'bringToFront', 'sendToBack', 'alignObjects', 'group', 'ungroup', 'undo', 'redo', 'hideContextMenu', 'openContextMenu', 'getObjectById', 'getAllObjects', 'findObjects', 'getObjectsTotalCount', 'addObject', 'addObjects', 'updateObject', 'removeObject', 'removeObjects', 'getSelectedObjects', 'getDisplayableShortcuts', 'selectObjects', 'selectAllObjectsInViewport', 'clearSelection', 'centerObjectInViewport', 'panToObject', 'backToContent', 'centerAllObjects', 'centerObjects', 'setViewport', 'panTo', 'zoomTo', 'zoomIn', 'zoomOut', 'getViewport', 'screenToWorld', 'worldToScreen', 'getObjectsInViewport', 'getScreenshot', 'exportViewportAsPng', 'exportViewportAsSvg', 'getSelectedObjectSupportedExportFormats', 'canExportSelectedObjectAs', 'exportSelectedObject', 'exportAsJson', 'importFromJson', 'loadObjectsFromJson', 'downloadAsJson', 'importFromFile', 'cancelImportFromFile', 'setActiveWorkspace', 'createWorkspace', 'updateWorkspace', 'deleteWorkspace', 'getWorkspaces', 'getActiveWorkspace', 'getIsPublic', 'loadSharedWorkspace', 'reinitSync', 'saveSettings', 'loadSettings', 'registerLocales', 'configureLocales', 'setLocale', 'getLocale', 'getAvailableLocales', 'getAvailableLocaleOptions', 't', 'getResolvedTerms']
98
+ })
99
+ ], KritzelEngine);
100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: KritzelEngine, decorators: [{
101
+ type: Component,
102
+ args: [{
103
+ selector: 'kritzel-engine',
104
+ changeDetection: ChangeDetectionStrategy.OnPush,
105
+ template: '<ng-content></ng-content>',
106
+ // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
107
+ inputs: ['activeWorkspaceId', 'assetStorageConfig', 'cursorTarget', 'debugInfo', 'editorId', 'fallbackLocale', 'globalContextMenuItems', 'isPanningEnabled', 'isZoomingEnabled', 'licenseKey', 'locale', 'locales', 'lockDrawingScale', 'objectContextMenuItems', 'scaleMax', 'scaleMin', 'syncConfig', 'theme', 'themes', 'user', 'viewportBoundaryBottom', 'viewportBoundaryLeft', 'viewportBoundaryRight', 'viewportBoundaryTop', 'workspaces'],
108
+ outputs: ['isEngineReady', 'activeToolChange', 'workspacesChange', 'activeWorkspaceChange', 'longpress', 'objectsChange', 'objectsAdded', 'objectsRemoved', 'objectsUpdated', 'objectsSelectionChange', 'undoStateChange', 'objectsInViewportChange', 'viewportChange', 'awarenessChange', 'notificationsChange', 'contextMenuStateChange', 'isLoadingChange'],
109
+ }]
110
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { isEngineReady: [{
111
+ type: Output
112
+ }], activeToolChange: [{
113
+ type: Output
114
+ }], workspacesChange: [{
115
+ type: Output
116
+ }], activeWorkspaceChange: [{
117
+ type: Output
118
+ }], longpress: [{
119
+ type: Output
120
+ }], objectsChange: [{
121
+ type: Output
122
+ }], objectsAdded: [{
123
+ type: Output
124
+ }], objectsRemoved: [{
125
+ type: Output
126
+ }], objectsUpdated: [{
127
+ type: Output
128
+ }], objectsSelectionChange: [{
129
+ type: Output
130
+ }], undoStateChange: [{
131
+ type: Output
132
+ }], objectsInViewportChange: [{
133
+ type: Output
134
+ }], viewportChange: [{
135
+ type: Output
136
+ }], awarenessChange: [{
137
+ type: Output
138
+ }], notificationsChange: [{
139
+ type: Output
140
+ }], contextMenuStateChange: [{
141
+ type: Output
142
+ }], isLoadingChange: [{
143
+ type: Output
144
+ }] } });
145
+
146
+ const DIRECTIVES = [
147
+ KritzelEngine
148
+ ];
149
+
150
+ function provideKritzel() {
151
+ return makeEnvironmentProviders([
152
+ provideAppInitializer(() => {
153
+ console.info('Initializing Kritzel custom elements');
154
+ return defineCustomElements(window);
155
+ }),
156
+ ]);
157
+ }
158
+
159
+ /**
160
+ * Generated bundle index. Do not edit.
161
+ */
162
+
163
+ export { DIRECTIVES, KritzelEngine, provideKritzel };
164
+ //# sourceMappingURL=kritzel-angular-engine.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kritzel-angular-engine.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-engine.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/engine/dist/components';\n\nimport { defineCustomElement as defineKritzelEngine } from '@kritzel/engine/dist/components/kritzel-engine.js';\n@ProxyCmp({\n defineCustomElementFn: defineKritzelEngine,\n inputs: ['activeWorkspaceId', 'assetStorageConfig', 'cursorTarget', 'debugInfo', 'editorId', 'fallbackLocale', 'globalContextMenuItems', 'isPanningEnabled', 'isZoomingEnabled', 'licenseKey', 'locale', 'locales', 'lockDrawingScale', 'objectContextMenuItems', 'scaleMax', 'scaleMin', 'syncConfig', 'theme', 'themes', 'user', 'viewportBoundaryBottom', 'viewportBoundaryLeft', 'viewportBoundaryRight', 'viewportBoundaryTop', 'workspaces'],\n methods: ['triggerSelectionChange', 'beginSceneBootstrap', 'endSceneBootstrap', 'registerTool', 'changeActiveTool', 'disable', 'enable', 'delete', 'copy', 'cut', 'paste', 'bringForward', 'sendBackward', 'bringToFront', 'sendToBack', 'alignObjects', 'group', 'ungroup', 'undo', 'redo', 'hideContextMenu', 'openContextMenu', 'getObjectById', 'getAllObjects', 'findObjects', 'getObjectsTotalCount', 'addObject', 'addObjects', 'updateObject', 'removeObject', 'removeObjects', 'getSelectedObjects', 'getDisplayableShortcuts', 'selectObjects', 'selectAllObjectsInViewport', 'clearSelection', 'centerObjectInViewport', 'panToObject', 'backToContent', 'centerAllObjects', 'centerObjects', 'setViewport', 'panTo', 'zoomTo', 'zoomIn', 'zoomOut', 'getViewport', 'screenToWorld', 'worldToScreen', 'getObjectsInViewport', 'getScreenshot', 'exportViewportAsPng', 'exportViewportAsSvg', 'getSelectedObjectSupportedExportFormats', 'canExportSelectedObjectAs', 'exportSelectedObject', 'exportAsJson', 'importFromJson', 'loadObjectsFromJson', 'downloadAsJson', 'importFromFile', 'cancelImportFromFile', 'setActiveWorkspace', 'createWorkspace', 'updateWorkspace', 'deleteWorkspace', 'getWorkspaces', 'getActiveWorkspace', 'getIsPublic', 'loadSharedWorkspace', 'reinitSync', 'saveSettings', 'loadSettings', 'registerLocales', 'configureLocales', 'setLocale', 'getLocale', 'getAvailableLocales', 'getAvailableLocaleOptions', 't', 'getResolvedTerms']\n})\n@Component({\n selector: 'kritzel-engine',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: '<ng-content></ng-content>',\n // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property\n inputs: ['activeWorkspaceId', 'assetStorageConfig', 'cursorTarget', 'debugInfo', 'editorId', 'fallbackLocale', 'globalContextMenuItems', 'isPanningEnabled', 'isZoomingEnabled', 'licenseKey', 'locale', 'locales', 'lockDrawingScale', 'objectContextMenuItems', 'scaleMax', 'scaleMin', 'syncConfig', 'theme', 'themes', 'user', 'viewportBoundaryBottom', 'viewportBoundaryLeft', 'viewportBoundaryRight', 'viewportBoundaryTop', 'workspaces'],\n outputs: ['isEngineReady', 'activeToolChange', 'workspacesChange', 'activeWorkspaceChange', 'longpress', 'objectsChange', 'objectsAdded', 'objectsRemoved', 'objectsUpdated', 'objectsSelectionChange', 'undoStateChange', 'objectsInViewportChange', 'viewportChange', 'awarenessChange', 'notificationsChange', 'contextMenuStateChange', 'isLoadingChange'],\n})\nexport class KritzelEngine {\n protected el: HTMLKritzelEngineElement;\n @Output() isEngineReady = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelEngineState>>();\n @Output() activeToolChange = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelBaseTool>>();\n @Output() workspacesChange = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelWorkspace[]>>();\n @Output() activeWorkspaceChange = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelWorkspace>>();\n @Output() longpress = new EventEmitter<KritzelEngineCustomEvent<PointerEvent>>();\n @Output() objectsChange = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelBaseObject[]>>();\n @Output() objectsAdded = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineObjectsAddedEvent>>();\n @Output() objectsRemoved = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineObjectsRemovedEvent>>();\n @Output() objectsUpdated = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineObjectsUpdatedEvent>>();\n @Output() objectsSelectionChange = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelBaseObject[]>>();\n @Output() undoStateChange = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelUndoState>>();\n @Output() objectsInViewportChange = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineObjectsInViewportChangeEvent>>();\n @Output() viewportChange = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelViewportState>>();\n @Output() awarenessChange = new EventEmitter<KritzelEngineCustomEvent<Map<number, Record<string, any>>>>();\n @Output() notificationsChange = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelNotification>>();\n @Output() contextMenuStateChange = new EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelContextMenuState>>();\n @Output() isLoadingChange = new EventEmitter<KritzelEngineCustomEvent<boolean>>();\n constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {\n c.detach();\n this.el = r.nativeElement;\n }\n}\n\n\nimport type { KritzelEngineCustomEvent } from '@kritzel/engine/dist/components';\nimport type { KritzelEngineState as IKritzelEngineKritzelEngineState } from '@kritzel/engine/dist/components';\nimport type { KritzelBaseTool as IKritzelEngineKritzelBaseTool } from '@kritzel/engine/dist/components';\nimport type { KritzelWorkspace as IKritzelEngineKritzelWorkspace } from '@kritzel/engine/dist/components';\nimport type { KritzelBaseObject as IKritzelEngineKritzelBaseObject } from '@kritzel/engine/dist/components';\nimport type { ObjectsAddedEvent as IKritzelEngineObjectsAddedEvent } from '@kritzel/engine/dist/components';\nimport type { ObjectsRemovedEvent as IKritzelEngineObjectsRemovedEvent } from '@kritzel/engine/dist/components';\nimport type { ObjectsUpdatedEvent as IKritzelEngineObjectsUpdatedEvent } from '@kritzel/engine/dist/components';\nimport type { KritzelUndoState as IKritzelEngineKritzelUndoState } from '@kritzel/engine/dist/components';\nimport type { ObjectsInViewportChangeEvent as IKritzelEngineObjectsInViewportChangeEvent } from '@kritzel/engine/dist/components';\nimport type { KritzelViewportState as IKritzelEngineKritzelViewportState } from '@kritzel/engine/dist/components';\nimport type { KritzelNotification as IKritzelEngineKritzelNotification } from '@kritzel/engine/dist/components';\nimport type { KritzelContextMenuState as IKritzelEngineKritzelContextMenuState } from '@kritzel/engine/dist/components';\n\nexport declare interface KritzelEngine extends Components.KritzelEngine {\n /**\n * Emitted when the engine has fully initialized and is ready for interaction.\n */\n isEngineReady: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelEngineState>>;\n /**\n * Emitted when the active drawing tool changes.\n */\n activeToolChange: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelBaseTool>>;\n /**\n * Emitted when workspaces are created, updated, or deleted.\n */\n workspacesChange: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelWorkspace[]>>;\n /**\n * Emitted when the active workspace changes (e.g., after import).\n */\n activeWorkspaceChange: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelWorkspace>>;\n /**\n * Emitted on long-press (touch/pen). Useful for showing custom context menus on mobile.\n */\n longpress: EventEmitter<KritzelEngineCustomEvent<PointerEvent>>;\n /**\n * Emitted when objects on the canvas are added, removed, or modified.\n */\n objectsChange: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelBaseObject[]>>;\n /**\n * Emitted when one or more objects are added to the canvas.\n */\n objectsAdded: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineObjectsAddedEvent>>;\n /**\n * Emitted when one or more objects are removed from the canvas.\n */\n objectsRemoved: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineObjectsRemovedEvent>>;\n /**\n * Emitted when one or more objects are updated on the canvas.\n */\n objectsUpdated: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineObjectsUpdatedEvent>>;\n /**\n * Emitted when the set of selected objects changes.\n */\n objectsSelectionChange: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelBaseObject[]>>;\n /**\n * Emitted when the undo/redo state changes, providing current undo availability.\n */\n undoStateChange: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelUndoState>>;\n /**\n * Emitted when the set of objects visible in the current viewport changes (e.g., after pan or zoom).\n */\n objectsInViewportChange: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineObjectsInViewportChangeEvent>>;\n /**\n * Emitted when the viewport position, scale, or dimensions change (e.g., after pan, zoom, or resize).\n */\n viewportChange: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelViewportState>>;\n /**\n * Emitted when the awareness state changes (remote user cursors, presence).\n */\n awarenessChange: EventEmitter<KritzelEngineCustomEvent<Map<number, Record<string, any>>>>;\n /**\n * Emitted when notifications change.\n */\n notificationsChange: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelNotification>>;\n /**\n * Emitted when context-menu visibility, items, or position changes.\n */\n contextMenuStateChange: EventEmitter<KritzelEngineCustomEvent<IKritzelEngineKritzelContextMenuState>>;\n /**\n * Emitted while the selected workspace's objects are being initialized and synchronized.\n */\n isLoadingChange: EventEmitter<KritzelEngineCustomEvent<boolean>>;\n}\n\n\n","\nimport * as d from './proxy';\n\nexport const DIRECTIVES = [\n d.KritzelEngine\n];\n","import {\r\n provideAppInitializer,\r\n EnvironmentProviders,\r\n makeEnvironmentProviders,\r\n} from '@angular/core';\r\nimport { defineCustomElements } from '@kritzel/engine/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":["defineKritzelEngine","d.KritzelEngine"],"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,CAA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AU,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,YAAY,CAAC;AAClb,oBAAA,OAAO,EAAE,CAAC,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,iBAAiB,CAAC;AAC/V,iBAAA;;sBAGE;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;;ACrCI,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/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@kritzel/angular-engine",
3
+ "version": "0.4.31",
4
+ "homepage": "https://kritzel.io/",
5
+ "description": "Kritzel engine wrapper for Angular.",
6
+ "keywords": [
7
+ "infinite canvas",
8
+ "collaboration",
9
+ "whiteboard",
10
+ "drawing",
11
+ "angular"
12
+ ],
13
+ "license": "PolyForm-Noncommercial-1.0.0",
14
+ "peerDependencies": {
15
+ "@angular/common": "^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
16
+ "@angular/core": "^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
17
+ "@kritzel/engine": "^0.4.31"
18
+ },
19
+ "dependencies": {
20
+ "tslib": "^2.3.0"
21
+ },
22
+ "sideEffects": false,
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/kasual1/kritzel.git"
29
+ },
30
+ "module": "fesm2022/kritzel-angular-engine.mjs",
31
+ "typings": "types/kritzel-angular-engine.d.ts",
32
+ "exports": {
33
+ "./package.json": {
34
+ "default": "./package.json"
35
+ },
36
+ ".": {
37
+ "types": "./types/kritzel-angular-engine.d.ts",
38
+ "default": "./fesm2022/kritzel-angular-engine.mjs"
39
+ }
40
+ },
41
+ "type": "module"
42
+ }
@@ -0,0 +1,105 @@
1
+ import * as i0 from '@angular/core';
2
+ import { NgZone, EventEmitter, ChangeDetectorRef, ElementRef, EnvironmentProviders } from '@angular/core';
3
+ import { KritzelEngineCustomEvent, KritzelEngineState, KritzelBaseTool, KritzelWorkspace, KritzelBaseObject, ObjectsAddedEvent, ObjectsRemovedEvent, ObjectsUpdatedEvent, KritzelUndoState, ObjectsInViewportChangeEvent, KritzelViewportState, KritzelNotification, KritzelContextMenuState, Components } from '@kritzel/engine/dist/components';
4
+ export { ActiveWorkspaceChangeEvent, BroadcastSyncProvider, ContextMenuItem, DEFAULT_BRUSH_CONFIG, DEFAULT_TEXT_CONFIG, DE_LOCALE, EN_LOCALE, EditorIsReadyEvent, FR_LOCALE, HTMLKritzelEngineElement, HocuspocusSyncProvider, IKritzelIsPublicChangeEvent, IKritzelUser, InMemorySyncProvider, IndexedDBSyncProvider, KritzelAlignment, KritzelBaseObject, KritzelBaseTool, KritzelBrushTool, KritzelBrushToolConfig, KritzelDebugInfo, KritzelDynamicObject, KritzelDynamicObjectConfig, KritzelDynamicObjectRenderContext, KritzelDynamicObjectRenderer, KritzelDynamicObjectRendererRegistry, KritzelEngineState, KritzelEraserTool, KritzelExportable, KritzelFontDefinition, KritzelFontMap, KritzelFontRegistration, KritzelFontRegistry, KritzelGroup, KritzelGroupConfig, KritzelImage, KritzelImageConfig, KritzelImageTool, KritzelLicenseManager, KritzelLine, KritzelLineConfig, KritzelLineTool, KritzelLineToolConfig, KritzelLocale, KritzelLocalizationManager, KritzelLoginConfig, KritzelLoginProvider, KritzelObjectExportContext, KritzelObjectExportFormat, KritzelPath, KritzelPathConfig, KritzelRegisteredFont, KritzelSelectionTool, KritzelShape, KritzelShapeConfig, KritzelShapeTool, KritzelShapeToolConfig, KritzelSyncConfig, KritzelTermKey, KritzelTermVars, KritzelTerms, KritzelText, KritzelTextConfig, KritzelTextTool, KritzelTextToolConfig, KritzelTheme, KritzelThemeManager, KritzelToolbarItem, KritzelUndoState, KritzelViewportState, KritzelWorkspace, KritzelWorkspaceConfig, LocaleCode, LoginEvent, ObjectsAddedEvent, ObjectsInViewportChangeEvent, ObjectsRemovedEvent, ObjectsUpdatedEvent, ShapeType, ThemeAwareColor, ThemeName, WebSocketSyncProvider, darkTheme, hasRemoteSyncProvider, lightTheme } from '@kritzel/engine';
5
+
6
+ declare class KritzelEngine {
7
+ protected z: NgZone;
8
+ protected el: HTMLKritzelEngineElement;
9
+ isEngineReady: EventEmitter<KritzelEngineCustomEvent<KritzelEngineState>>;
10
+ activeToolChange: EventEmitter<KritzelEngineCustomEvent<KritzelBaseTool>>;
11
+ workspacesChange: EventEmitter<KritzelEngineCustomEvent<KritzelWorkspace[]>>;
12
+ activeWorkspaceChange: EventEmitter<KritzelEngineCustomEvent<KritzelWorkspace>>;
13
+ longpress: EventEmitter<KritzelEngineCustomEvent<PointerEvent>>;
14
+ objectsChange: EventEmitter<KritzelEngineCustomEvent<KritzelBaseObject<HTMLElement | SVGElement>[]>>;
15
+ objectsAdded: EventEmitter<KritzelEngineCustomEvent<ObjectsAddedEvent>>;
16
+ objectsRemoved: EventEmitter<KritzelEngineCustomEvent<ObjectsRemovedEvent>>;
17
+ objectsUpdated: EventEmitter<KritzelEngineCustomEvent<ObjectsUpdatedEvent>>;
18
+ objectsSelectionChange: EventEmitter<KritzelEngineCustomEvent<KritzelBaseObject<HTMLElement | SVGElement>[]>>;
19
+ undoStateChange: EventEmitter<KritzelEngineCustomEvent<KritzelUndoState>>;
20
+ objectsInViewportChange: EventEmitter<KritzelEngineCustomEvent<ObjectsInViewportChangeEvent>>;
21
+ viewportChange: EventEmitter<KritzelEngineCustomEvent<KritzelViewportState>>;
22
+ awarenessChange: EventEmitter<KritzelEngineCustomEvent<Map<number, Record<string, any>>>>;
23
+ notificationsChange: EventEmitter<KritzelEngineCustomEvent<KritzelNotification>>;
24
+ contextMenuStateChange: EventEmitter<KritzelEngineCustomEvent<KritzelContextMenuState>>;
25
+ isLoadingChange: EventEmitter<KritzelEngineCustomEvent<boolean>>;
26
+ constructor(c: ChangeDetectorRef, r: ElementRef, z: NgZone);
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<KritzelEngine, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<KritzelEngine, "kritzel-engine", never, { "activeWorkspaceId": { "alias": "activeWorkspaceId"; "required": false; }; "assetStorageConfig": { "alias": "assetStorageConfig"; "required": false; }; "cursorTarget": { "alias": "cursorTarget"; "required": false; }; "debugInfo": { "alias": "debugInfo"; "required": false; }; "editorId": { "alias": "editorId"; "required": false; }; "fallbackLocale": { "alias": "fallbackLocale"; "required": false; }; "globalContextMenuItems": { "alias": "globalContextMenuItems"; "required": false; }; "isPanningEnabled": { "alias": "isPanningEnabled"; "required": false; }; "isZoomingEnabled": { "alias": "isZoomingEnabled"; "required": false; }; "licenseKey": { "alias": "licenseKey"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "locales": { "alias": "locales"; "required": false; }; "lockDrawingScale": { "alias": "lockDrawingScale"; "required": false; }; "objectContextMenuItems": { "alias": "objectContextMenuItems"; "required": false; }; "scaleMax": { "alias": "scaleMax"; "required": false; }; "scaleMin": { "alias": "scaleMin"; "required": false; }; "syncConfig": { "alias": "syncConfig"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "themes": { "alias": "themes"; "required": false; }; "user": { "alias": "user"; "required": false; }; "viewportBoundaryBottom": { "alias": "viewportBoundaryBottom"; "required": false; }; "viewportBoundaryLeft": { "alias": "viewportBoundaryLeft"; "required": false; }; "viewportBoundaryRight": { "alias": "viewportBoundaryRight"; "required": false; }; "viewportBoundaryTop": { "alias": "viewportBoundaryTop"; "required": false; }; "workspaces": { "alias": "workspaces"; "required": false; }; }, { "isEngineReady": "isEngineReady"; "activeToolChange": "activeToolChange"; "workspacesChange": "workspacesChange"; "activeWorkspaceChange": "activeWorkspaceChange"; "longpress": "longpress"; "objectsChange": "objectsChange"; "objectsAdded": "objectsAdded"; "objectsRemoved": "objectsRemoved"; "objectsUpdated": "objectsUpdated"; "objectsSelectionChange": "objectsSelectionChange"; "undoStateChange": "undoStateChange"; "objectsInViewportChange": "objectsInViewportChange"; "viewportChange": "viewportChange"; "awarenessChange": "awarenessChange"; "notificationsChange": "notificationsChange"; "contextMenuStateChange": "contextMenuStateChange"; "isLoadingChange": "isLoadingChange"; }, never, ["*"], true, never>;
29
+ }
30
+ declare interface KritzelEngine extends Components.KritzelEngine {
31
+ /**
32
+ * Emitted when the engine has fully initialized and is ready for interaction.
33
+ */
34
+ isEngineReady: EventEmitter<KritzelEngineCustomEvent<KritzelEngineState>>;
35
+ /**
36
+ * Emitted when the active drawing tool changes.
37
+ */
38
+ activeToolChange: EventEmitter<KritzelEngineCustomEvent<KritzelBaseTool>>;
39
+ /**
40
+ * Emitted when workspaces are created, updated, or deleted.
41
+ */
42
+ workspacesChange: EventEmitter<KritzelEngineCustomEvent<KritzelWorkspace[]>>;
43
+ /**
44
+ * Emitted when the active workspace changes (e.g., after import).
45
+ */
46
+ activeWorkspaceChange: EventEmitter<KritzelEngineCustomEvent<KritzelWorkspace>>;
47
+ /**
48
+ * Emitted on long-press (touch/pen). Useful for showing custom context menus on mobile.
49
+ */
50
+ longpress: EventEmitter<KritzelEngineCustomEvent<PointerEvent>>;
51
+ /**
52
+ * Emitted when objects on the canvas are added, removed, or modified.
53
+ */
54
+ objectsChange: EventEmitter<KritzelEngineCustomEvent<KritzelBaseObject[]>>;
55
+ /**
56
+ * Emitted when one or more objects are added to the canvas.
57
+ */
58
+ objectsAdded: EventEmitter<KritzelEngineCustomEvent<ObjectsAddedEvent>>;
59
+ /**
60
+ * Emitted when one or more objects are removed from the canvas.
61
+ */
62
+ objectsRemoved: EventEmitter<KritzelEngineCustomEvent<ObjectsRemovedEvent>>;
63
+ /**
64
+ * Emitted when one or more objects are updated on the canvas.
65
+ */
66
+ objectsUpdated: EventEmitter<KritzelEngineCustomEvent<ObjectsUpdatedEvent>>;
67
+ /**
68
+ * Emitted when the set of selected objects changes.
69
+ */
70
+ objectsSelectionChange: EventEmitter<KritzelEngineCustomEvent<KritzelBaseObject[]>>;
71
+ /**
72
+ * Emitted when the undo/redo state changes, providing current undo availability.
73
+ */
74
+ undoStateChange: EventEmitter<KritzelEngineCustomEvent<KritzelUndoState>>;
75
+ /**
76
+ * Emitted when the set of objects visible in the current viewport changes (e.g., after pan or zoom).
77
+ */
78
+ objectsInViewportChange: EventEmitter<KritzelEngineCustomEvent<ObjectsInViewportChangeEvent>>;
79
+ /**
80
+ * Emitted when the viewport position, scale, or dimensions change (e.g., after pan, zoom, or resize).
81
+ */
82
+ viewportChange: EventEmitter<KritzelEngineCustomEvent<KritzelViewportState>>;
83
+ /**
84
+ * Emitted when the awareness state changes (remote user cursors, presence).
85
+ */
86
+ awarenessChange: EventEmitter<KritzelEngineCustomEvent<Map<number, Record<string, any>>>>;
87
+ /**
88
+ * Emitted when notifications change.
89
+ */
90
+ notificationsChange: EventEmitter<KritzelEngineCustomEvent<KritzelNotification>>;
91
+ /**
92
+ * Emitted when context-menu visibility, items, or position changes.
93
+ */
94
+ contextMenuStateChange: EventEmitter<KritzelEngineCustomEvent<KritzelContextMenuState>>;
95
+ /**
96
+ * Emitted while the selected workspace's objects are being initialized and synchronized.
97
+ */
98
+ isLoadingChange: EventEmitter<KritzelEngineCustomEvent<boolean>>;
99
+ }
100
+
101
+ declare const DIRECTIVES: (typeof KritzelEngine)[];
102
+
103
+ declare function provideKritzel(): EnvironmentProviders;
104
+
105
+ export { DIRECTIVES, KritzelEngine, provideKritzel };