kritzel-vue 0.3.16 → 0.3.17

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 CHANGED
@@ -1,31 +1,95 @@
1
- # Setup
1
+ # Kritzel for Vue
2
2
 
3
- Install the kritzel-vue package.
4
- ```
5
- npm i kritzel-vue
3
+ Build infinite canvas and collaborative whiteboard experiences in Vue 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 Vue wrapper for idiomatic template integration.
6
+
7
+ Kritzel handles the hard parts of canvas-based applications — infinite pan and zoom, hit-testing, CRDT-based collaboration, undo and redo, and cross-browser rendering — so you can focus on your product's domain logic.
8
+
9
+ 📖 **Full documentation:** [kritzel.io/docs/vue/overview](https://kritzel.io/docs/vue/overview)
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ npm install kritzel-vue
6
15
  ```
7
16
 
8
- Import the ComponentLibrary and register it as a plugin.
9
- ```typescript
10
- import { createApp } from 'vue'
11
- import App from './App.vue'
12
- import { ComponentLibrary } from 'kritzel-vue'
17
+ ## Setup
13
18
 
14
- createApp(App).use(ComponentLibrary).mount('#app')
19
+ Render Kritzel in your component:
20
+
21
+ ```html
22
+ <script setup lang="ts">
23
+ import { KritzelEditor } from 'kritzel-vue'
24
+ </script>
15
25
 
26
+ <template>
27
+ <KritzelEditor style="display: block; width: 100%; height: 100vh" />
28
+ </template>
16
29
  ```
17
30
 
18
- Import Kritzel components to use them in your template.
31
+ This renders the editor with the **full default toolbar**: selection, brush, eraser, line, shape, text, and image tools.
32
+
33
+ ## Optional Enhancements
34
+
35
+ ### Persist Canvas State
36
+
37
+ By default, the editor 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`.
38
+
19
39
  ```html
20
40
  <script setup lang="ts">
21
- import { KritzelEngine, KritzelControls } from 'kritzel-vue';
41
+ import { KritzelEditor, IndexedDBSyncProvider } from 'kritzel-vue'
42
+
43
+ const syncConfig = {
44
+ providers: [IndexedDBSyncProvider],
45
+ }
22
46
  </script>
23
47
 
24
48
  <template>
25
- <KritzelEngine></KritzelEngine>
26
- <KritzelControls></KritzelControls>
49
+ <KritzelEditor :syncConfig="syncConfig" style="display: block; width: 100%; height: 100vh" />
27
50
  </template>
51
+ ```
52
+
53
+ ### Apply Full Viewport Styling
54
+
55
+ To ensure the Kritzel editor occupies the entire viewport and prevents unwanted scrolling, add the following CSS to your global stylesheet (e.g. `styles.css`):
28
56
 
29
- <style scoped>
30
- </style>
57
+ ```css
58
+ html,
59
+ body,
60
+ #app {
61
+ width: 100dvw;
62
+ height: 100dvh;
63
+ margin: 0;
64
+ padding: 0;
65
+ overflow: hidden;
66
+ }
31
67
  ```
68
+
69
+ ### Include Mobile Viewport Meta Tag
70
+
71
+ For optimal rendering and responsiveness on mobile devices, add this meta tag within the `<head>` section of your `index.html`:
72
+
73
+ ```html
74
+ <meta
75
+ name="viewport"
76
+ 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"
77
+ />
78
+ ```
79
+
80
+ ## Core Concepts
81
+
82
+ Kritzel is composed of a small set of core concepts that work together to power your canvas experience:
83
+
84
+ - **Components** — Two entry points, a batteries-included editor and a headless engine, to match any integration style.
85
+ - **Tools** — State-machine interaction handlers that define how users draw, select, and manipulate the canvas.
86
+ - **Objects** — The visual building blocks on the canvas, such as paths, shapes, text, and images with shared spatial properties.
87
+ - **Workspaces** — Containers that manage an entire canvas collection, view state, and editor configuration.
88
+ - **Theming** — Built-in light and dark themes with full CSS variable customization to match your brand.
89
+ - **Collaboration** — Real-time multi-user sync powered by Yjs CRDTs with pluggable transport providers.
90
+
91
+ Learn more in the [full documentation](https://kritzel.io/docs/vue/overview).
92
+
93
+ ## License
94
+
95
+ See [LICENSE.md](./LICENSE.md). Kritzel is free for personal, hobby, and educational use. Commercial use requires a license — visit [kritzel.io](https://kritzel.io) for details.
@@ -16,3 +16,5 @@ export declare const KritzelNumericInput: StencilVueComponent<JSX.KritzelNumeric
16
16
  export declare const KritzelOpacitySlider: StencilVueComponent<JSX.KritzelOpacitySlider>;
17
17
  export declare const KritzelPillTabs: StencilVueComponent<JSX.KritzelPillTabs>;
18
18
  export declare const KritzelSettings: StencilVueComponent<JSX.KritzelSettings>;
19
+ export declare const KritzelWatermark: StencilVueComponent<JSX.KritzelWatermark>;
20
+ export declare const KritzelZoomPanel: StencilVueComponent<JSX.KritzelZoomPanel>;
@@ -18,6 +18,8 @@ import { defineCustomElement as defineKritzelNumericInput } from '../../kritzel-
18
18
  import { defineCustomElement as defineKritzelOpacitySlider } from '../../kritzel-stencil/dist/components/kritzel-opacity-slider.js';
19
19
  import { defineCustomElement as defineKritzelPillTabs } from '../../kritzel-stencil/dist/components/kritzel-pill-tabs.js';
20
20
  import { defineCustomElement as defineKritzelSettings } from '../../kritzel-stencil/dist/components/kritzel-settings.js';
21
+ import { defineCustomElement as defineKritzelWatermark } from '../../kritzel-stencil/dist/components/kritzel-watermark.js';
22
+ import { defineCustomElement as defineKritzelZoomPanel } from '../../kritzel-stencil/dist/components/kritzel-zoom-panel.js';
21
23
  export const KritzelAwarenessCursors = /*@__PURE__*/ defineContainer('kritzel-awareness-cursors', defineKritzelAwarenessCursors, [
22
24
  'core',
23
25
  'showEdgeIndicators',
@@ -39,7 +41,8 @@ export const KritzelButton = /*@__PURE__*/ defineContainer('kritzel-button', def
39
41
  'buttonClick'
40
42
  ]);
41
43
  export const KritzelCurrentUserDialog = /*@__PURE__*/ defineContainer('kritzel-current-user-dialog', defineKritzelCurrentUserDialog, [
42
- 'user'
44
+ 'user',
45
+ 'terms'
43
46
  ]);
44
47
  export const KritzelDialog = /*@__PURE__*/ defineContainer('kritzel-dialog', defineKritzelDialog, [
45
48
  'isOpen',
@@ -66,7 +69,6 @@ export const KritzelEditor = /*@__PURE__*/ defineContainer('kritzel-editor', def
66
69
  'viewportBoundaryRight',
67
70
  'viewportBoundaryTop',
68
71
  'viewportBoundaryBottom',
69
- 'wheelEnabled',
70
72
  'debugInfo',
71
73
  'user',
72
74
  'activeUsers',
@@ -75,11 +77,18 @@ export const KritzelEditor = /*@__PURE__*/ defineContainer('kritzel-editor', def
75
77
  'objectContextMenuItems',
76
78
  'themes',
77
79
  'theme',
80
+ 'licenseKey',
81
+ 'locale',
82
+ 'locales',
83
+ 'fallbackLocale',
78
84
  'customSvgIcons',
85
+ 'isPanningEnabled',
86
+ 'isZoomingEnabled',
79
87
  'isControlsVisible',
80
88
  'isUtilityPanelVisible',
81
89
  'isWorkspaceManagerVisible',
82
90
  'isMoreMenuVisible',
91
+ 'isZoomPanelVisible',
83
92
  'isObjectDistanceFadingActive',
84
93
  'syncConfig',
85
94
  'assetStorageConfig',
@@ -96,6 +105,7 @@ export const KritzelEditor = /*@__PURE__*/ defineContainer('kritzel-editor', def
96
105
  'objectsUpdated',
97
106
  'undoStateChange',
98
107
  'themeChange',
108
+ 'localeChange',
99
109
  'viewportChange',
100
110
  'logout',
101
111
  'login',
@@ -110,6 +120,7 @@ export const KritzelEditor = /*@__PURE__*/ defineContainer('kritzel-editor', def
110
120
  'objectsUpdated',
111
121
  'undoStateChange',
112
122
  'themeChange',
123
+ 'localeChange',
113
124
  'viewportChange',
114
125
  'logout',
115
126
  'login',
@@ -131,13 +142,18 @@ export const KritzelEngine = /*@__PURE__*/ defineContainer('kritzel-engine', def
131
142
  'lockDrawingScale',
132
143
  'isObjectDistanceFadingActive',
133
144
  'theme',
145
+ 'licenseKey',
134
146
  'themes',
147
+ 'locale',
148
+ 'locales',
149
+ 'fallbackLocale',
135
150
  'viewportBoundaryLeft',
136
151
  'viewportBoundaryRight',
137
152
  'viewportBoundaryTop',
138
153
  'viewportBoundaryBottom',
139
154
  'debugInfo',
140
- 'wheelEnabled',
155
+ 'isPanningEnabled',
156
+ 'isZoomingEnabled',
141
157
  'isLoading',
142
158
  'isEngineReady',
143
159
  'activeToolChange',
@@ -171,6 +187,7 @@ export const KritzelEngine = /*@__PURE__*/ defineContainer('kritzel-engine', def
171
187
  ]);
172
188
  export const KritzelExport = /*@__PURE__*/ defineContainer('kritzel-export', defineKritzelExport, [
173
189
  'workspaceName',
190
+ 'terms',
174
191
  'exportPng',
175
192
  'exportSvg',
176
193
  'exportJson'
@@ -244,9 +261,26 @@ export const KritzelPillTabs = /*@__PURE__*/ defineContainer('kritzel-pill-tabs'
244
261
  ]);
245
262
  export const KritzelSettings = /*@__PURE__*/ defineContainer('kritzel-settings', defineKritzelSettings, [
246
263
  'availableThemes',
264
+ 'availableLocales',
247
265
  'shortcuts',
266
+ 'terms',
248
267
  'settings',
249
268
  'settingsChange'
250
269
  ], [
251
270
  'settingsChange'
252
271
  ]);
272
+ export const KritzelWatermark = /*@__PURE__*/ defineContainer('kritzel-watermark', defineKritzelWatermark, [
273
+ 'core',
274
+ 'label'
275
+ ]);
276
+ export const KritzelZoomPanel = /*@__PURE__*/ defineContainer('kritzel-zoom-panel', defineKritzelZoomPanel, [
277
+ 'visible',
278
+ 'disabled',
279
+ 'zoomPercent',
280
+ 'terms',
281
+ 'zoomIn',
282
+ 'zoomOut'
283
+ ], [
284
+ 'zoomIn',
285
+ 'zoomOut'
286
+ ]);
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './components';
2
2
  export * from './composables';
3
3
  export * from './plugin';
4
- export { KritzelBaseObject, KritzelText, KritzelPath, KritzelImage, KritzelLine, KritzelShape, KritzelGroup, KritzelBrushTool, KritzelTextTool, KritzelLineTool, KritzelShapeTool, KritzelEraserTool, KritzelSelectionTool, KritzelImageTool, KritzelWorkspace, InMemorySyncProvider, IndexedDBSyncProvider, BroadcastSyncProvider, WebSocketSyncProvider, HocuspocusSyncProvider, KritzelThemeManager, ShapeType, KritzelAlignment, lightTheme, darkTheme, DEFAULT_BRUSH_CONFIG, DEFAULT_TEXT_CONFIG, } from 'kritzel-stencil';
5
- export type { HTMLKritzelEditorElement, HTMLKritzelEngineElement, KritzelToolbarControl, KritzelBrushToolConfig, KritzelLineToolConfig, KritzelShapeToolConfig, KritzelTextToolConfig, KritzelSyncConfig, KritzelTheme, KritzelViewportState, ContextMenuItem, ThemeAwareColor, ThemeName, LoginEvent, EditorIsReadyEvent, ActiveWorkspaceChangeEvent, ObjectsAddedEvent, ObjectsRemovedEvent, ObjectsUpdatedEvent, ObjectsInViewportChangeEvent, } from 'kritzel-stencil';
4
+ export { KritzelBaseObject, KritzelText, KritzelPath, KritzelImage, KritzelLine, KritzelShape, KritzelGroup, KritzelBaseTool, KritzelBrushTool, KritzelTextTool, KritzelLineTool, KritzelShapeTool, KritzelEraserTool, KritzelSelectionTool, KritzelImageTool, KritzelWorkspace, InMemorySyncProvider, IndexedDBSyncProvider, BroadcastSyncProvider, WebSocketSyncProvider, HocuspocusSyncProvider, KritzelThemeManager, KritzelLocalizationManager, KritzelLicenseManager, ShapeType, KritzelAlignment, lightTheme, darkTheme, EN_LOCALE, DE_LOCALE, FR_LOCALE, DEFAULT_BRUSH_CONFIG, DEFAULT_TEXT_CONFIG, } from 'kritzel-stencil';
5
+ export type { HTMLKritzelEditorElement, HTMLKritzelEngineElement, KritzelToolbarControl, KritzelBrushToolConfig, KritzelLineToolConfig, KritzelShapeToolConfig, KritzelTextToolConfig, KritzelSyncConfig, KritzelTheme, KritzelViewportState, ContextMenuItem, ThemeAwareColor, ThemeName, KritzelLocale, LocaleCode, KritzelTerms, KritzelTermKey, KritzelTermVars, LoginEvent, EditorIsReadyEvent, ActiveWorkspaceChangeEvent, ObjectsAddedEvent, ObjectsRemovedEvent, ObjectsUpdatedEvent, ObjectsInViewportChangeEvent, KritzelUndoState, IKritzelIsPublicChangedEvent, KritzelEngineState, KritzelDebugInfo, IKritzelUser, } from 'kritzel-stencil';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from './components';
2
2
  export * from './composables';
3
3
  export * from './plugin';
4
- export { KritzelBaseObject, KritzelText, KritzelPath, KritzelImage, KritzelLine, KritzelShape, KritzelGroup, KritzelBrushTool, KritzelTextTool, KritzelLineTool, KritzelShapeTool, KritzelEraserTool, KritzelSelectionTool, KritzelImageTool, KritzelWorkspace, InMemorySyncProvider, IndexedDBSyncProvider, BroadcastSyncProvider, WebSocketSyncProvider, HocuspocusSyncProvider, KritzelThemeManager, ShapeType, KritzelAlignment, lightTheme, darkTheme, DEFAULT_BRUSH_CONFIG, DEFAULT_TEXT_CONFIG, } from 'kritzel-stencil';
4
+ export { KritzelBaseObject, KritzelText, KritzelPath, KritzelImage, KritzelLine, KritzelShape, KritzelGroup, KritzelBaseTool, KritzelBrushTool, KritzelTextTool, KritzelLineTool, KritzelShapeTool, KritzelEraserTool, KritzelSelectionTool, KritzelImageTool, KritzelWorkspace, InMemorySyncProvider, IndexedDBSyncProvider, BroadcastSyncProvider, WebSocketSyncProvider, HocuspocusSyncProvider, KritzelThemeManager, KritzelLocalizationManager, KritzelLicenseManager, ShapeType, KritzelAlignment, lightTheme, darkTheme, EN_LOCALE, DE_LOCALE, FR_LOCALE, DEFAULT_BRUSH_CONFIG, DEFAULT_TEXT_CONFIG, } from 'kritzel-stencil';
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "kritzel-vue",
3
- "version": "0.3.16",
4
- "homepage": "https://github.com/kasual1/kritzel#readme",
5
- "license": "ISC",
3
+ "version": "0.3.17",
4
+ "homepage": "https://kritzel.io/",
5
+ "description": "Build infinite canvas experiences in minutes.",
6
+ "license": "SEE LICENSE IN LICENSE.md",
6
7
  "main": "dist/index.js",
7
8
  "types": "dist/index.d.ts",
8
9
  "directories": {
@@ -12,10 +13,6 @@
12
13
  "files": [
13
14
  "dist"
14
15
  ],
15
- "repository": {
16
- "type": "git",
17
- "url": "https://github.com/kasual1/kritzel.git"
18
- },
19
16
  "scripts": {
20
17
  "test": "echo \"Error: run tests from root\" && exit 1",
21
18
  "build": "npm run tsc",
@@ -34,6 +31,6 @@
34
31
  "@stencil/vue-output-target": "0.11.8"
35
32
  },
36
33
  "peerDependencies": {
37
- "kritzel-stencil": "^0.3.16"
34
+ "kritzel-stencil": "^0.3.17"
38
35
  }
39
36
  }