@kritzel/editor 0.4.31 → 0.4.32
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 +50 -50
- package/README.md +5 -5
- package/dist/cjs/{index-B92VHWr4.js → index-q_Tg9KUw.js} +12 -0
- package/dist/cjs/kritzel-active-users_46.cjs.entry.js +981 -322
- package/dist/cjs/kritzel-brush-style.cjs.entry.js +2 -2
- package/dist/cjs/kritzel-editor.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/kritzel-active-users/kritzel-active-users.css +65 -65
- package/dist/collection/components/kritzel-avatar/kritzel-avatar.css +58 -58
- package/dist/collection/components/kritzel-avatar/kritzel-avatar.js +3 -3
- package/dist/collection/components/kritzel-back-to-content/kritzel-back-to-content.css +42 -42
- package/dist/collection/components/kritzel-back-to-content/kritzel-back-to-content.js +1 -1
- package/dist/collection/components/kritzel-brush-style/kritzel-brush-style.css +42 -42
- package/dist/collection/components/kritzel-brush-style/kritzel-brush-style.js +3 -3
- package/dist/collection/components/kritzel-button/kritzel-button.css +73 -73
- package/dist/collection/components/kritzel-button/kritzel-button.js +2 -2
- package/dist/collection/components/kritzel-color/kritzel-color.css +24 -24
- package/dist/collection/components/kritzel-color/kritzel-color.js +2 -2
- package/dist/collection/components/kritzel-color-palette/kritzel-color-palette.css +46 -46
- package/dist/collection/components/kritzel-color-palette/kritzel-color-palette.js +1 -1
- package/dist/collection/components/kritzel-context-menu/kritzel-context-menu.css +113 -112
- package/dist/collection/components/kritzel-context-menu/kritzel-context-menu.js +1 -1
- package/dist/collection/components/kritzel-current-user/kritzel-current-user.css +11 -11
- package/dist/collection/components/kritzel-current-user/kritzel-current-user.js +1 -1
- package/dist/collection/components/kritzel-current-user-dialog/kritzel-current-user-dialog.css +39 -39
- package/dist/collection/components/kritzel-current-user-dialog/kritzel-current-user-dialog.js +1 -1
- package/dist/collection/components/kritzel-dialog/kritzel-dialog.css +209 -209
- package/dist/collection/components/kritzel-dropdown/kritzel-dropdown.css +190 -190
- package/dist/collection/components/kritzel-dropdown/kritzel-dropdown.js +2 -2
- package/dist/collection/components/kritzel-editor/kritzel-editor.css +160 -160
- package/dist/collection/components/kritzel-editor/kritzel-editor.js +72 -46
- package/dist/collection/components/kritzel-export/kritzel-export.css +89 -89
- package/dist/collection/components/kritzel-export/kritzel-export.js +1 -1
- package/dist/collection/components/kritzel-font/kritzel-font.css +10 -10
- package/dist/collection/components/kritzel-font/kritzel-font.js +1 -1
- package/dist/collection/components/kritzel-font-family/kritzel-font-family.css +48 -48
- package/dist/collection/components/kritzel-font-family/kritzel-font-family.js +2 -2
- package/dist/collection/components/kritzel-font-size/kritzel-font-size.css +30 -30
- package/dist/collection/components/kritzel-font-size/kritzel-font-size.js +1 -1
- package/dist/collection/components/kritzel-input/kritzel-input.css +69 -69
- package/dist/collection/components/kritzel-input/kritzel-input.js +1 -1
- package/dist/collection/components/kritzel-line-endings/kritzel-line-endings.css +60 -60
- package/dist/collection/components/kritzel-line-endings/kritzel-line-endings.js +3 -3
- package/dist/collection/components/kritzel-loading-overlay/kritzel-loading-overlay.css +54 -54
- package/dist/collection/components/kritzel-loading-overlay/kritzel-loading-overlay.js +1 -1
- package/dist/collection/components/kritzel-login-dialog/kritzel-login-dialog.css +98 -98
- package/dist/collection/components/kritzel-login-dialog/kritzel-login-dialog.js +1 -1
- package/dist/collection/components/kritzel-master-detail/kritzel-master-detail.css +190 -190
- package/dist/collection/components/kritzel-master-detail/kritzel-master-detail.js +3 -3
- package/dist/collection/components/kritzel-menu/kritzel-menu.css +35 -34
- package/dist/collection/components/kritzel-menu/kritzel-menu.js +1 -1
- package/dist/collection/components/kritzel-menu-item/kritzel-menu-item.css +166 -166
- package/dist/collection/components/kritzel-menu-item/kritzel-menu-item.js +3 -3
- package/dist/collection/components/kritzel-more-menu/kritzel-more-menu.css +58 -58
- package/dist/collection/components/kritzel-more-menu/kritzel-more-menu.js +4 -4
- package/dist/collection/components/kritzel-notification-card/kritzel-notification-card.css +101 -101
- package/dist/collection/components/kritzel-numeric-input/kritzel-numeric-input.css +102 -102
- package/dist/collection/components/kritzel-numeric-input/kritzel-numeric-input.js +1 -1
- package/dist/collection/components/kritzel-opacity-slider/kritzel-opacity-slider.css +85 -85
- package/dist/collection/components/kritzel-opacity-slider/kritzel-opacity-slider.js +1 -1
- package/dist/collection/components/kritzel-pill-tabs/kritzel-pill-tabs.css +68 -68
- package/dist/collection/components/kritzel-pill-tabs/kritzel-pill-tabs.js +2 -2
- package/dist/collection/components/kritzel-portal/kritzel-portal.js +1 -1
- package/dist/collection/components/kritzel-settings/kritzel-settings.css +137 -137
- package/dist/collection/components/kritzel-settings/kritzel-settings.js +1 -1
- package/dist/collection/components/kritzel-shape-fill/kritzel-shape-fill.css +47 -47
- package/dist/collection/components/kritzel-shape-fill/kritzel-shape-fill.js +4 -4
- package/dist/collection/components/kritzel-share-dialog/kritzel-share-dialog.css +150 -150
- package/dist/collection/components/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
- package/dist/collection/components/kritzel-slide-toggle/kritzel-slide-toggle.css +48 -48
- package/dist/collection/components/kritzel-slide-toggle/kritzel-slide-toggle.js +1 -1
- package/dist/collection/components/kritzel-split-button/kritzel-split-button.css +78 -78
- package/dist/collection/components/kritzel-split-button/kritzel-split-button.js +3 -3
- package/dist/collection/components/kritzel-stroke-size/kritzel-stroke-size.css +37 -37
- package/dist/collection/components/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
- package/dist/collection/components/kritzel-tool-config/kritzel-tool-config.css +38 -38
- package/dist/collection/components/kritzel-tool-config/kritzel-tool-config.js +1 -1
- package/dist/collection/components/kritzel-toolbar/kritzel-toolbar.css +347 -347
- package/dist/collection/components/kritzel-toolbar/kritzel-toolbar.js +12 -16
- package/dist/collection/components/kritzel-tooltip/kritzel-tooltip.css +18 -18
- package/dist/collection/components/kritzel-tooltip/kritzel-tooltip.js +2 -2
- package/dist/collection/components/kritzel-utility-panel/kritzel-utility-panel.css +45 -45
- package/dist/collection/components/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
- package/dist/collection/components/kritzel-workspace-manager/kritzel-workspace-manager.css +16 -16
- package/dist/collection/components/kritzel-workspace-manager/kritzel-workspace-manager.js +1 -1
- package/dist/collection/components/kritzel-zoom-panel/kritzel-zoom-panel.css +72 -72
- package/dist/collection/components/kritzel-zoom-panel/kritzel-zoom-panel.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/kritzel-active-users.js +1 -1
- package/dist/components/kritzel-avatar.js +1 -1
- package/dist/components/kritzel-awareness-cursors.js +1 -1
- package/dist/components/kritzel-back-to-content.js +1 -1
- package/dist/components/kritzel-brush-style.js +4 -4
- package/dist/components/kritzel-button.js +1 -1
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-color.js +1 -1
- package/dist/components/kritzel-context-menu.js +1 -1
- package/dist/components/kritzel-current-user-dialog.js +1 -1
- package/dist/components/kritzel-current-user.js +1 -1
- package/dist/components/kritzel-cursor-trail.js +1 -1
- package/dist/components/kritzel-dialog.js +1 -1
- package/dist/components/kritzel-dropdown.js +1 -1
- package/dist/components/kritzel-editor.js +108 -81
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-export.js +1 -1
- package/dist/components/kritzel-font-family.js +1 -1
- package/dist/components/kritzel-font-size.js +1 -1
- package/dist/components/kritzel-font.js +1 -1
- package/dist/components/kritzel-icon.js +1 -1
- package/dist/components/kritzel-input.js +1 -1
- package/dist/components/kritzel-line-endings.js +1 -1
- package/dist/components/kritzel-loading-overlay.js +1 -1
- package/dist/components/kritzel-login-dialog.js +1 -1
- package/dist/components/kritzel-master-detail.js +1 -1
- package/dist/components/kritzel-menu-item.js +1 -1
- package/dist/components/kritzel-menu.js +1 -1
- package/dist/components/kritzel-more-menu.js +1 -1
- package/dist/components/kritzel-notification-card.js +1 -1
- package/dist/components/kritzel-numeric-input.js +1 -1
- package/dist/components/kritzel-opacity-slider.js +1 -1
- package/dist/components/kritzel-pill-tabs.js +1 -1
- package/dist/components/kritzel-portal.js +1 -1
- package/dist/components/kritzel-settings.js +1 -1
- package/dist/components/kritzel-shape-fill.js +1 -1
- package/dist/components/kritzel-share-dialog.js +1 -1
- package/dist/components/kritzel-slide-toggle.js +1 -1
- package/dist/components/kritzel-split-button.js +1 -1
- package/dist/components/kritzel-stroke-size.js +1 -1
- package/dist/components/kritzel-tool-config.js +1 -1
- package/dist/components/kritzel-toolbar.js +1 -1
- package/dist/components/kritzel-tooltip.js +1 -1
- package/dist/components/kritzel-utility-panel.js +1 -1
- package/dist/components/kritzel-watermark.js +1 -1
- package/dist/components/kritzel-workspace-manager.js +1 -1
- package/dist/components/kritzel-zoom-panel.js +1 -1
- package/dist/components/{p-B_gT0lCn.js → p-5tEZmBli.js} +3 -3
- package/dist/components/{p-B6UJztrf.js → p-B6U2JNDq.js} +4 -4
- package/dist/components/{p-DXuf225S.js → p-BK5rE1rd.js} +3 -3
- package/dist/components/{p-BZ_KnHdR.js → p-BbXTqI4t.js} +7 -7
- package/dist/components/{p-McY5wZ0h.js → p-BhVCoiyK.js} +2 -2
- package/dist/components/{p-SLnqczCS.js → p-BowLPDbq.js} +3 -3
- package/dist/components/{p-hQwVRh0t.js → p-BuwiCK1I.js} +7 -7
- package/dist/components/{p-CoNexfpB.js → p-C01XOYLF.js} +3 -3
- package/dist/components/{p-ClfOtiNp.js → p-C5Hw8Wv3.js} +3 -3
- package/dist/components/{p-CmjXRLdr.js → p-C5fgp5y4.js} +7 -7
- package/dist/components/{p-BfMlwIcG.js → p-CHelQjUo.js} +3 -3
- package/dist/components/{p-B5xYV1o3.js → p-CIm1iROq.js} +2 -2
- package/dist/components/{p-BjFrt1q0.js → p-COGlcEiV.js} +3 -3
- package/dist/components/{p-4-qLegHb.js → p-COaLQ4Z-.js} +4 -4
- package/dist/components/{p-CVxGF4bJ.js → p-CPfTzGnn.js} +5 -5
- package/dist/components/p-CViWMGoM.js +55 -0
- package/dist/components/{p-Blq9a1ni.js → p-CY3fGZlt.js} +6 -6
- package/dist/components/{p-Cy_cLtOP.js → p-CdwD9F0m.js} +18 -14
- package/dist/components/{p-GbCxpbQ6.js → p-CgCVe3_P.js} +3 -3
- package/dist/components/{p-DZsSiMnA.js → p-CiSc7ASZ.js} +722 -129
- package/dist/components/{p-DVv8ChhE.js → p-D0lYLWkj.js} +4 -4
- package/dist/components/{p-QEue33R5.js → p-D1sxfQVN.js} +3 -3
- package/dist/components/{p-BvG3JO85.js → p-D53Q7EDf.js} +3 -3
- package/dist/components/{p-CzUeIini.js → p-D5OzFEtr.js} +13 -13
- package/dist/components/{p-B3Tqoyl9.js → p-DAr69onU.js} +3 -3
- package/dist/components/{p-h_uh_Njf.js → p-DE6S-FN0.js} +3 -3
- package/dist/components/p-DSi2HiZW.js +214 -0
- package/dist/components/{p-Ckqh1tqY.js → p-DX4FbgMi.js} +27 -31
- package/dist/components/{p-CwBxnzYu.js → p-DYNFqwX4.js} +3 -3
- package/dist/components/{p-Cp4e4oTE.js → p-DZ0S2l6Z.js} +2 -2
- package/dist/components/{p-BrGJIoGK.js → p-DZ4rAt6k.js} +3 -3
- package/dist/components/{p-BDjRSoAc.js → p-Ddk64LEI.js} +2 -2
- package/dist/components/{p-DJxgPPfs.js → p-DoNH4OhF.js} +3 -3
- package/dist/components/{p-D0tPTPkR.js → p-Dtm4CEHf.js} +3 -3
- package/dist/components/{p-BN8VWPlq.js → p-Dwg30A00.js} +7 -7
- package/dist/components/{p-DXZBWJBt.js → p-DxHrSwYy.js} +4 -4
- package/dist/components/{p-CvaxFYS0.js → p-EpqroVCx.js} +8 -8
- package/dist/components/{p-R1D8Sr0l.js → p-Fzi_dVqn.js} +3 -3
- package/dist/components/{p-CS3YZVYE.js → p-Qk844WR4.js} +2 -2
- package/dist/components/{p-peZjvnkK.js → p-g6VqjbL_.js} +2 -2
- package/dist/components/{p-DyRJFg4w.js → p-hKGrOeEa.js} +2 -2
- package/dist/components/{p-5qkOM1RJ.js → p-l1BZ4pYI.js} +12 -1
- package/dist/components/{p-CrIEmItB.js → p-p2H4pOpF.js} +5 -5
- package/dist/components/{p-DqOC_Yck.js → p-pWWRmEe8.js} +6 -6
- package/dist/components/{p-Ds0uNtwQ.js → p-piYX2tVg.js} +4 -4
- package/dist/components/{p-kOINnzaR.js → p-xPpMDzPX.js} +7 -7
- package/dist/esm/{index-OjbYJz-P.js → index-2x7dfLlM.js} +12 -1
- package/dist/esm/kritzel-active-users_46.entry.js +981 -322
- package/dist/esm/kritzel-brush-style.entry.js +2 -2
- package/dist/esm/kritzel-editor.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/kritzel-editor/kritzel-editor.esm.js +3 -3
- package/dist/kritzel-editor/{p-501047d8.entry.js → p-285cdc18.entry.js} +2 -2
- package/dist/kritzel-editor/{p-OjbYJz-P.js → p-2x7dfLlM.js} +12 -1
- package/dist/kritzel-editor/{p-60319edb.entry.js → p-d5439a4f.entry.js} +981 -322
- package/dist/types/components/kritzel-editor/kritzel-editor.d.ts +9 -2
- package/dist/types/components.d.ts +15 -15
- package/package.json +3 -3
- package/dist/components/p-BGmTmdLe.js +0 -167
- package/dist/components/p-DOJCDPVD.js +0 -55
|
@@ -77,12 +77,12 @@ export class KritzelEditor {
|
|
|
77
77
|
name: 'shape',
|
|
78
78
|
type: 'tool',
|
|
79
79
|
tool: KritzelShapeTool,
|
|
80
|
-
icon: '
|
|
80
|
+
icon: 'shapeRectangle',
|
|
81
81
|
config: DEFAULT_SHAPE_CONFIG,
|
|
82
82
|
subOptions: [
|
|
83
|
-
{ id: 'rectangle', icon: '
|
|
84
|
-
{ id: 'ellipse', icon: '
|
|
85
|
-
{ id: 'triangle', icon: '
|
|
83
|
+
{ id: 'rectangle', icon: 'shapeRectangle', label: 'Rectangle', value: ShapeType.Rectangle, toolProperty: 'shapeType' },
|
|
84
|
+
{ id: 'ellipse', icon: 'shapeEllipse', label: 'Ellipse', value: ShapeType.Ellipse, toolProperty: 'shapeType' },
|
|
85
|
+
{ id: 'triangle', icon: 'shapeTriangle', label: 'Triangle', value: ShapeType.Triangle, toolProperty: 'shapeType' },
|
|
86
86
|
],
|
|
87
87
|
},
|
|
88
88
|
{
|
|
@@ -111,7 +111,7 @@ export class KritzelEditor {
|
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
label: 'menu.selectAll',
|
|
114
|
-
icon: '
|
|
114
|
+
icon: 'selectAll',
|
|
115
115
|
action: () => this.selectAllObjectsInViewport(),
|
|
116
116
|
},
|
|
117
117
|
];
|
|
@@ -142,10 +142,10 @@ export class KritzelEditor {
|
|
|
142
142
|
icon: 'ordering',
|
|
143
143
|
group: 'other',
|
|
144
144
|
children: [
|
|
145
|
-
{ label: 'menu.bringToFront', icon: '
|
|
146
|
-
{ label: 'menu.sendToBack', icon: '
|
|
147
|
-
{ label: 'menu.moveUp', icon: '
|
|
148
|
-
{ label: 'menu.moveDown', icon: '
|
|
145
|
+
{ label: 'menu.bringToFront', icon: 'bringToFront', action: () => this.engineRef.bringToFront() },
|
|
146
|
+
{ label: 'menu.sendToBack', icon: 'sendToBack', action: () => this.engineRef.sendToBack() },
|
|
147
|
+
{ label: 'menu.moveUp', icon: 'arrowUpFromDot', action: () => this.engineRef.bringForward() },
|
|
148
|
+
{ label: 'menu.moveDown', icon: 'arrowDownFromDot', action: () => this.engineRef.sendBackward() },
|
|
149
149
|
],
|
|
150
150
|
},
|
|
151
151
|
{
|
|
@@ -153,12 +153,12 @@ export class KritzelEditor {
|
|
|
153
153
|
icon: 'align',
|
|
154
154
|
group: 'other',
|
|
155
155
|
children: [
|
|
156
|
-
{ label: 'menu.alignLeft', icon: '
|
|
157
|
-
{ label: 'menu.alignCenterHorizontal', icon: '
|
|
158
|
-
{ label: 'menu.alignRight', icon: '
|
|
159
|
-
{ label: 'menu.alignTop', icon: '
|
|
160
|
-
{ label: 'menu.alignCenterVertical', icon: '
|
|
161
|
-
{ label: 'menu.alignBottom', icon: '
|
|
156
|
+
{ label: 'menu.alignLeft', icon: 'alignStartVertical', action: () => this.engineRef.alignObjects(KritzelAlignment.StartHorizontal) },
|
|
157
|
+
{ label: 'menu.alignCenterHorizontal', icon: 'alignCenterHorizontal', action: () => this.engineRef.alignObjects(KritzelAlignment.CenterHorizontal) },
|
|
158
|
+
{ label: 'menu.alignRight', icon: 'alignEndVertical', action: () => this.engineRef.alignObjects(KritzelAlignment.EndHorizontal) },
|
|
159
|
+
{ label: 'menu.alignTop', icon: 'alignStartHorizontal', action: () => this.engineRef.alignObjects(KritzelAlignment.StartVertical) },
|
|
160
|
+
{ label: 'menu.alignCenterVertical', icon: 'alignCenterVertical', action: () => this.engineRef.alignObjects(KritzelAlignment.CenterVertical) },
|
|
161
|
+
{ label: 'menu.alignBottom', icon: 'alignEndHorizontal', action: () => this.engineRef.alignObjects(KritzelAlignment.EndVertical) },
|
|
162
162
|
],
|
|
163
163
|
},
|
|
164
164
|
{
|
|
@@ -331,6 +331,9 @@ export class KritzelEditor {
|
|
|
331
331
|
onCustomFontsChange(newValue) {
|
|
332
332
|
void this.registerCustomFonts(newValue);
|
|
333
333
|
}
|
|
334
|
+
onCustomSvgIconsChange(newValue) {
|
|
335
|
+
this.registerCustomSvgIcons(newValue);
|
|
336
|
+
}
|
|
334
337
|
onMoreMenuItemsChange() {
|
|
335
338
|
this.recomputeMoreMenuItems();
|
|
336
339
|
}
|
|
@@ -503,12 +506,11 @@ export class KritzelEditor {
|
|
|
503
506
|
async reinitSync() {
|
|
504
507
|
return this.engineRef.reinitSync();
|
|
505
508
|
}
|
|
506
|
-
// ── Tool management ─────────────────────────────────────────────────
|
|
507
509
|
async registerTool(toolName, toolClass, toolConfig) {
|
|
508
510
|
return this.engineRef.registerTool(toolName, toolClass, toolConfig);
|
|
509
511
|
}
|
|
510
|
-
async
|
|
511
|
-
return this.engineRef.
|
|
512
|
+
async setActiveTool(toolName) {
|
|
513
|
+
return this.engineRef.setActiveTool(toolName);
|
|
512
514
|
}
|
|
513
515
|
async disable() {
|
|
514
516
|
return this.engineRef.disable();
|
|
@@ -747,15 +749,21 @@ export class KritzelEditor {
|
|
|
747
749
|
loginDialogRef;
|
|
748
750
|
currentUserDialogRef;
|
|
749
751
|
componentWillLoad() {
|
|
752
|
+
this.registerCustomSvgIcons(this.customSvgIcons);
|
|
750
753
|
this.recomputeMoreMenuItems();
|
|
751
754
|
this.loadSettingsFromStorage();
|
|
752
755
|
this.applyTheme();
|
|
753
756
|
}
|
|
757
|
+
componentWillRender() {
|
|
758
|
+
this.registerCustomSvgIcons(this.customSvgIcons);
|
|
759
|
+
}
|
|
754
760
|
isTextToolConfig(config) {
|
|
755
761
|
return !!config && 'fontFamily' in config && 'size' in config && 'color' in config;
|
|
756
762
|
}
|
|
757
763
|
lastToolbarItemsRef = null;
|
|
758
764
|
lastNormalizedToolbarItems = [];
|
|
765
|
+
lastToolsSource = null;
|
|
766
|
+
lastTools = [];
|
|
759
767
|
getNormalizedToolbarItems() {
|
|
760
768
|
if (this.toolbarItems !== this.lastToolbarItemsRef) {
|
|
761
769
|
this.lastToolbarItemsRef = this.toolbarItems;
|
|
@@ -763,6 +771,16 @@ export class KritzelEditor {
|
|
|
763
771
|
}
|
|
764
772
|
return this.lastNormalizedToolbarItems;
|
|
765
773
|
}
|
|
774
|
+
getTools() {
|
|
775
|
+
const normalizedToolbarItems = this.getNormalizedToolbarItems();
|
|
776
|
+
if (normalizedToolbarItems !== this.lastToolsSource) {
|
|
777
|
+
this.lastToolsSource = normalizedToolbarItems;
|
|
778
|
+
this.lastTools = normalizedToolbarItems
|
|
779
|
+
.filter(item => item.type === 'tool' && !!item.tool)
|
|
780
|
+
.map(item => ({ name: item.name, tool: item.tool, config: item.config }));
|
|
781
|
+
}
|
|
782
|
+
return this.lastTools;
|
|
783
|
+
}
|
|
766
784
|
normalizeToolbar(toolbarItems) {
|
|
767
785
|
return toolbarItems.map(control => {
|
|
768
786
|
if (!this.isTextToolConfig(control.config)) {
|
|
@@ -791,7 +809,6 @@ export class KritzelEditor {
|
|
|
791
809
|
return this.themes?.find(t => t.name === this.theme) ?? (this.theme === 'dark' ? darkTheme : lightTheme);
|
|
792
810
|
}
|
|
793
811
|
componentDidLoad() {
|
|
794
|
-
this.registerCustomSvgIcons();
|
|
795
812
|
this.registerCustomFonts();
|
|
796
813
|
this.listenForMobileKeyboard();
|
|
797
814
|
this.setOsSpecificCssVariables();
|
|
@@ -1157,10 +1174,13 @@ export class KritzelEditor {
|
|
|
1157
1174
|
getContentObjects(objects) {
|
|
1158
1175
|
return objects.filter(obj => !(obj instanceof KritzelSelectionGroup) && !(obj instanceof KritzelSelectionBox));
|
|
1159
1176
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1177
|
+
lastCustomSvgIcons;
|
|
1178
|
+
registerCustomSvgIcons(icons) {
|
|
1179
|
+
if (icons === this.lastCustomSvgIcons) {
|
|
1180
|
+
return;
|
|
1163
1181
|
}
|
|
1182
|
+
this.lastCustomSvgIcons = icons;
|
|
1183
|
+
KritzelIconRegistry.registerIcons(icons ?? {});
|
|
1164
1184
|
}
|
|
1165
1185
|
async registerCustomFonts(fonts = this.customFonts) {
|
|
1166
1186
|
KritzelFontRegistry.registerFonts(fonts);
|
|
@@ -1220,48 +1240,49 @@ export class KritzelEditor {
|
|
|
1220
1240
|
const shouldShowCurrentUser = isLoggedIn;
|
|
1221
1241
|
const shouldShowLoginButton = this.isReady && !!this.loginConfig && !isLoggedIn;
|
|
1222
1242
|
const normalizedToolbarItems = this.getNormalizedToolbarItems();
|
|
1223
|
-
|
|
1243
|
+
const tools = this.getTools();
|
|
1244
|
+
return (h(Host, { key: '939e4336009f65e1d1a3ec9b756de38a5fa942d6' }, h("div", { key: 'c216ac3097a8472ba74532b2c6c300efd90134cf', class: "editor-content", style: {
|
|
1224
1245
|
opacity: this.isEditorVisible ? '1' : '0',
|
|
1225
1246
|
visibility: this.isEditorVisible ? 'visible' : 'hidden',
|
|
1226
1247
|
transition: 'opacity 0.2s ease-in-out, visibility 0.2s ease-in-out',
|
|
1227
|
-
} }, h("div", { key: '
|
|
1248
|
+
} }, h("div", { key: '6796a763912435553cde891847302746491f493b', class: "top-left-buttons" }, h("kritzel-workspace-manager", { key: 'e13510ec3f76f8aab2c3b0771c3363d92d93cc6a', ref: el => {
|
|
1228
1249
|
if (el) {
|
|
1229
1250
|
this.workspaceManagerRef = el;
|
|
1230
1251
|
}
|
|
1231
|
-
}, visible: this.isWorkspaceManagerVisible, workspaces: this.availableWorkspaces, activeWorkspace: this.activeWorkspace, terms: this.resolvedTerms, onWorkspaceChange: event => this.handleWorkspaceManagerChange(event), onIsWorkspaceManagerReady: () => (this.isWorkspaceManagerReady = true) }), h("kritzel-back-to-content", { key: '
|
|
1252
|
+
}, visible: this.isWorkspaceManagerVisible, workspaces: this.availableWorkspaces, activeWorkspace: this.activeWorkspace, terms: this.resolvedTerms, onWorkspaceChange: event => this.handleWorkspaceManagerChange(event), onIsWorkspaceManagerReady: () => (this.isWorkspaceManagerReady = true) }), h("kritzel-back-to-content", { key: '9115ee23e578a66f46b202623c241277ef092544', visible: this.isBackToContentButtonVisible, text: this.resolvedTerms['backToContent.label'] ?? 'Back to content', onBackToContent: () => this.backToContent() })), this.activeNotification && (h("div", { key: 'd4379f4d0e4f8b3cf2693f34304b03b1e5a75255', class: "top-center-notification-layer", role: "presentation" }, h("div", { key: '01151742b1338423e669d2382ebe9ad55322c43b', class: { 'top-center-notification-container': true, 'is-dismissing': this.isNotificationDismissing }, role: "presentation" }, h("kritzel-notification-card", { key: 'e802c494bab6b2eae72d8fd4997d362006e63142', notification: this.activeNotification, locale: this.locale, onDismiss: this.dismissNotification, onHoverChange: event => this.handleNotificationHoverChange(event) })))), this.contextMenuState && this.contextMenuState.items.length > 0 && (h("kritzel-context-menu", { key: '8141865c0beb036f28c135bc41054a68a7b05d01', class: "context-menu", items: this.contextMenuState.items, objects: this.contextMenuState.objects, style: {
|
|
1232
1253
|
position: 'absolute',
|
|
1233
1254
|
left: `${this.contextMenuState.position.x}px`,
|
|
1234
1255
|
top: `${this.contextMenuState.position.y}px`,
|
|
1235
1256
|
zIndex: '10002',
|
|
1236
|
-
}, onActionSelected: event => this.handleContextMenuActionSelected(event), onClose: () => this.hideContextMenu() })), h("kritzel-loading-overlay", { key: '
|
|
1257
|
+
}, onActionSelected: event => this.handleContextMenuActionSelected(event), onClose: () => this.hideContextMenu() })), h("kritzel-loading-overlay", { key: 'a4b6a7389387641c0fe0fe44b7c0948c66d8cdfc', visible: this.isLoadingOverlayVisible, text: this.resolvedTerms['editor.loading'] ?? 'Loading...' }), h("kritzel-engine", { key: '0b3e551a97e2c40548d7dc479fca5f408035a8f4', ref: el => {
|
|
1237
1258
|
if (el) {
|
|
1238
1259
|
this.engineRef = el;
|
|
1239
1260
|
}
|
|
1240
|
-
}, workspaces: this.workspaces, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, assetStorageConfig: this.assetStorageConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, scaleMin: this.scaleMin, cursorTarget: this.cursorTarget, viewportBoundaryLeft: this.viewportBoundaryLeft, viewportBoundaryRight: this.viewportBoundaryRight, viewportBoundaryTop: this.viewportBoundaryTop, viewportBoundaryBottom: this.viewportBoundaryBottom, isPanningEnabled: this.isPanningEnabled, isZoomingEnabled: this.isZoomingEnabled, theme: this.theme, themes: this.themes, licenseKey: this.licenseKey, locale: this.locale, locales: this.locales, fallbackLocale: this.fallbackLocale, debugInfo: this.debugInfo, globalContextMenuItems: this.globalContextMenuItems, objectContextMenuItems: this.objectContextMenuItems, onIsEngineReady: event => this.onEngineReady(event), onWorkspacesChange: event => this.handleWorkspacesChange(event), onActiveWorkspaceChange: event => this.handleActiveWorkspaceChange(event), onObjectsChange: event => this.handleObjectsChange(event), onObjectsAdded: event => this.handleObjectsAdded(event), onObjectsRemoved: event => this.handleObjectsRemoved(event), onObjectsUpdated: event => this.handleObjectsUpdated(event), onObjectsSelectionChange: event => this.handleObjectsSelectionChange(event), onUndoStateChange: event => this.handleUndoStateChange(event), onObjectsInViewportChange: event => this.handleObjectsInViewportChange(event), onViewportChange: event => this.handleViewportChange(event), onAwarenessChange: event => this.handleAwarenessChange(event), onNotificationsChange: event => this.handleNotificationsChange(event), onContextMenuStateChange: event => this.handleContextMenuStateChange(event), onIsLoadingChange: event => this.handleIsLoadingChange(event) }), h("kritzel-toolbar", { key: '
|
|
1261
|
+
}, workspaces: this.workspaces, activeWorkspaceId: this.activeWorkspaceId, editorId: this.editorId, syncConfig: this.syncConfig, assetStorageConfig: this.assetStorageConfig, user: this.user, scaleMax: this.scaleMax, lockDrawingScale: this.lockDrawingScale, scaleMin: this.scaleMin, cursorTarget: this.cursorTarget, viewportBoundaryLeft: this.viewportBoundaryLeft, viewportBoundaryRight: this.viewportBoundaryRight, viewportBoundaryTop: this.viewportBoundaryTop, viewportBoundaryBottom: this.viewportBoundaryBottom, isPanningEnabled: this.isPanningEnabled, isZoomingEnabled: this.isZoomingEnabled, theme: this.theme, themes: this.themes, licenseKey: this.licenseKey, locale: this.locale, locales: this.locales, fallbackLocale: this.fallbackLocale, debugInfo: this.debugInfo, globalContextMenuItems: this.globalContextMenuItems, objectContextMenuItems: this.objectContextMenuItems, tools: tools, onIsEngineReady: event => this.onEngineReady(event), onWorkspacesChange: event => this.handleWorkspacesChange(event), onActiveWorkspaceChange: event => this.handleActiveWorkspaceChange(event), onObjectsChange: event => this.handleObjectsChange(event), onObjectsAdded: event => this.handleObjectsAdded(event), onObjectsRemoved: event => this.handleObjectsRemoved(event), onObjectsUpdated: event => this.handleObjectsUpdated(event), onObjectsSelectionChange: event => this.handleObjectsSelectionChange(event), onUndoStateChange: event => this.handleUndoStateChange(event), onObjectsInViewportChange: event => this.handleObjectsInViewportChange(event), onViewportChange: event => this.handleViewportChange(event), onAwarenessChange: event => this.handleAwarenessChange(event), onNotificationsChange: event => this.handleNotificationsChange(event), onContextMenuStateChange: event => this.handleContextMenuStateChange(event), onIsLoadingChange: event => this.handleIsLoadingChange(event) }), h("kritzel-toolbar", { key: '3240c2481021aa017a26e1e3e3618d346a3bf1b9', visible: this.isToolbarVisible, class: { 'keyboard-open': this.isVirtualKeyboardOpen }, ref: el => {
|
|
1241
1262
|
if (el) {
|
|
1242
1263
|
this.toolbarRef = el;
|
|
1243
1264
|
}
|
|
1244
|
-
}, toolbarItems: normalizedToolbarItems, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, terms: this.resolvedTerms, onIsToolbarReady: () => (this.isToolbarReady = true) }), h("div", { key: '
|
|
1265
|
+
}, toolbarItems: normalizedToolbarItems, isUtilityPanelVisible: this.isUtilityPanelVisible, undoState: this.undoState ?? undefined, theme: this.theme, terms: this.resolvedTerms, onIsToolbarReady: () => (this.isToolbarReady = true) }), h("div", { key: 'ba83e4189b6ee8a6e060f3d26b4863ff1d5768d2', class: "bottom-left-buttons" }, h("kritzel-zoom-panel", { key: '7725ee71671d68411c5f6bb5da6e2737338880f0', visible: this.isZoomPanelVisible, zoomPercent: this.currentZoomPercent, terms: this.resolvedTerms, onZoomIn: () => this.zoomIn(), onZoomOut: () => this.zoomOut() })), h("div", { key: '1a4f0c9f1c8acf2703e0d101d6e6288f976af7f7', class: "top-right-buttons" }, h("kritzel-settings", { key: 'd14c088c5ed85d4e63b7b478a742e4b01921dec9', ref: el => {
|
|
1245
1266
|
if (el) {
|
|
1246
1267
|
this.settingsRef = el;
|
|
1247
1268
|
}
|
|
1248
|
-
}, shortcuts: this.shortcuts, availableThemes: this.themes && this.themes.length > 0 ? this.themes.map(t => t.name) : ['light', 'dark'], availableLocales: this.availableLocaleOptions, settings: this.currentSettingsConfig, terms: this.resolvedTerms, onSettingsChange: event => this.handleSettingsChange(event) }), h("kritzel-export", { key: '
|
|
1269
|
+
}, shortcuts: this.shortcuts, availableThemes: this.themes && this.themes.length > 0 ? this.themes.map(t => t.name) : ['light', 'dark'], availableLocales: this.availableLocaleOptions, settings: this.currentSettingsConfig, terms: this.resolvedTerms, onSettingsChange: event => this.handleSettingsChange(event) }), h("kritzel-export", { key: '22b5848fd3c395c9c06f67f13b2de5ebe7f20ffe', ref: el => {
|
|
1249
1270
|
if (el) {
|
|
1250
1271
|
this.exportRef = el;
|
|
1251
1272
|
}
|
|
1252
|
-
}, workspaceName: this.activeWorkspace?.name || 'workspace', terms: this.resolvedTerms, onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), h("kritzel-active-users", { key: '
|
|
1273
|
+
}, workspaceName: this.activeWorkspace?.name || 'workspace', terms: this.resolvedTerms, onExportPng: () => this.engineRef.exportViewportAsPng(), onExportSvg: () => this.engineRef.exportViewportAsSvg(), onExportJson: event => this.engineRef.downloadAsJson(event.detail) }), h("kritzel-active-users", { key: '7c60a610eb996640663331666691acec691128f0', users: this.activeUsers }), shouldShowCurrentUser && h("kritzel-current-user", { key: 'aa53b3739c92cb01580a61e355ff22d4777ba11e', user: this.user, terms: this.resolvedTerms, onClick: () => this.currentUserDialogRef?.open() }), shouldShowCurrentUser && (h("kritzel-current-user-dialog", { key: 'c709f948752f62122150ecef70788a527edd610e', ref: el => {
|
|
1253
1274
|
if (el) {
|
|
1254
1275
|
this.currentUserDialogRef = el;
|
|
1255
1276
|
}
|
|
1256
|
-
}, user: this.user, terms: this.resolvedTerms, onLogoutRequest: this.handleCurrentUserLogout })), shouldShowLoginButton && h("kritzel-button", { key: '
|
|
1277
|
+
}, user: this.user, terms: this.resolvedTerms, onLogoutRequest: this.handleCurrentUserLogout })), shouldShowLoginButton && h("kritzel-button", { key: 'ed095c276f2a48e74c7c899d216891d2b1130759', onButtonClick: () => this.loginDialogRef?.open() }, this.resolvedTerms['login.dialogTitle'] ?? 'Sign in'), h("kritzel-more-menu", { key: 'cdd22f54afc7acdfd783afbcfa16813ac39f4352', ref: el => {
|
|
1257
1278
|
if (el) {
|
|
1258
1279
|
this.moreMenuRef = el;
|
|
1259
1280
|
}
|
|
1260
|
-
}, items: this.resolvedMoreMenuItems, visible: this.isMoreMenuVisible, terms: this.resolvedTerms }), h("kritzel-share-dialog", { key: '
|
|
1281
|
+
}, items: this.resolvedMoreMenuItems, visible: this.isMoreMenuVisible, terms: this.resolvedTerms }), h("kritzel-share-dialog", { key: '00d09340a36334aa29dde0e306598bb48b8360fc', ref: el => {
|
|
1261
1282
|
if (el) {
|
|
1262
1283
|
this.shareDialogRef = el;
|
|
1263
1284
|
}
|
|
1264
|
-
}, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, terms: this.resolvedTerms, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: '
|
|
1285
|
+
}, isPublic: this.currentIsPublic, workspaceId: this.activeWorkspace?.id, terms: this.resolvedTerms, onToggleIsPublic: this.handleToggleIsPublic }), this.loginConfig && (h("kritzel-login-dialog", { key: '1e4c79482b155a0da9dc664ae1f421773c6a452c', ref: el => {
|
|
1265
1286
|
if (el) {
|
|
1266
1287
|
this.loginDialogRef = el;
|
|
1267
1288
|
}
|
|
@@ -1443,7 +1464,7 @@ export class KritzelEditor {
|
|
|
1443
1464
|
},
|
|
1444
1465
|
"getter": false,
|
|
1445
1466
|
"setter": false,
|
|
1446
|
-
"defaultValue": "{\
|
|
1467
|
+
"defaultValue": "{\n showViewportInfo: false,\n showObjectInfo: false,\n showSyncProviderInfo: true,\n showMigrationInfo: true,\n showAssetResolverInfo: false,\n }"
|
|
1447
1468
|
},
|
|
1448
1469
|
"user": {
|
|
1449
1470
|
"type": "unknown",
|
|
@@ -1516,7 +1537,7 @@ export class KritzelEditor {
|
|
|
1516
1537
|
},
|
|
1517
1538
|
"getter": false,
|
|
1518
1539
|
"setter": false,
|
|
1519
|
-
"defaultValue": "[\
|
|
1540
|
+
"defaultValue": "[\n {\n name: 'selection',\n type: 'tool',\n isDefault: true,\n tool: KritzelSelectionTool,\n icon: 'cursor',\n },\n {\n name: 'brush',\n type: 'tool',\n tool: KritzelBrushTool,\n icon: 'pen',\n config: DEFAULT_BRUSH_CONFIG,\n },\n {\n name: 'eraser',\n type: 'tool',\n tool: KritzelEraserTool,\n icon: 'eraser',\n },\n {\n name: 'line',\n type: 'tool',\n tool: KritzelLineTool,\n icon: 'arrow',\n config: DEFAULT_LINE_TOOL_CONFIG,\n },\n {\n name: 'shape',\n type: 'tool',\n tool: KritzelShapeTool,\n icon: 'shapeRectangle',\n config: DEFAULT_SHAPE_CONFIG,\n subOptions: [\n { id: 'rectangle', icon: 'shapeRectangle', label: 'Rectangle', value: ShapeType.Rectangle, toolProperty: 'shapeType' },\n { id: 'ellipse', icon: 'shapeEllipse', label: 'Ellipse', value: ShapeType.Ellipse, toolProperty: 'shapeType' },\n { id: 'triangle', icon: 'shapeTriangle', label: 'Triangle', value: ShapeType.Triangle, toolProperty: 'shapeType' },\n ],\n },\n {\n name: 'text',\n type: 'tool',\n tool: KritzelTextTool,\n icon: 'type',\n config: DEFAULT_TEXT_CONFIG,\n },\n {\n name: 'image',\n type: 'tool',\n tool: KritzelImageTool,\n icon: 'image',\n },\n {\n name: 'config',\n type: 'config',\n },\n ]"
|
|
1520
1541
|
},
|
|
1521
1542
|
"globalContextMenuItems": {
|
|
1522
1543
|
"type": "unknown",
|
|
@@ -1541,7 +1562,7 @@ export class KritzelEditor {
|
|
|
1541
1562
|
},
|
|
1542
1563
|
"getter": false,
|
|
1543
1564
|
"setter": false,
|
|
1544
|
-
"defaultValue": "[\
|
|
1565
|
+
"defaultValue": "[\n {\n label: 'menu.paste',\n icon: 'paste',\n action: menu => this.engineRef.paste(menu.x, menu.y),\n },\n {\n label: 'menu.selectAll',\n icon: 'selectAll',\n action: () => this.selectAllObjectsInViewport(),\n },\n ]"
|
|
1545
1566
|
},
|
|
1546
1567
|
"objectContextMenuItems": {
|
|
1547
1568
|
"type": "unknown",
|
|
@@ -1566,7 +1587,7 @@ export class KritzelEditor {
|
|
|
1566
1587
|
},
|
|
1567
1588
|
"getter": false,
|
|
1568
1589
|
"setter": false,
|
|
1569
|
-
"defaultValue": "[\
|
|
1590
|
+
"defaultValue": "[\n { label: 'menu.copy', icon: 'copy', group: 'clipboard', action: () => this.engineRef.copy() },\n { label: 'menu.cut', icon: 'cut', group: 'clipboard', action: () => this.engineRef.cut() },\n {\n label: 'menu.paste',\n icon: 'paste',\n group: 'clipboard',\n action: (menu, _) => this.engineRef.paste(menu.x, menu.y),\n },\n {\n label: 'menu.export',\n icon: 'upload',\n group: 'clipboard',\n isVisible: (_, objects) => this.canExportObjects(objects),\n action: (_, objects) => {\n const format = this.getPreferredExportFormat(objects);\n if (!format) {\n return;\n }\n\n void this.engineRef.exportSelectedObject(format);\n },\n },\n {\n label: 'menu.order',\n icon: 'ordering',\n group: 'other',\n children: [\n { label: 'menu.bringToFront', icon: 'bringToFront', action: () => this.engineRef.bringToFront() },\n { label: 'menu.sendToBack', icon: 'sendToBack', action: () => this.engineRef.sendToBack() },\n { label: 'menu.moveUp', icon: 'arrowUpFromDot', action: () => this.engineRef.bringForward() },\n { label: 'menu.moveDown', icon: 'arrowDownFromDot', action: () => this.engineRef.sendBackward() },\n ],\n },\n {\n label: 'menu.align',\n icon: 'align',\n group: 'other',\n children: [\n { label: 'menu.alignLeft', icon: 'alignStartVertical', action: () => this.engineRef.alignObjects(KritzelAlignment.StartHorizontal) },\n { label: 'menu.alignCenterHorizontal', icon: 'alignCenterHorizontal', action: () => this.engineRef.alignObjects(KritzelAlignment.CenterHorizontal) },\n { label: 'menu.alignRight', icon: 'alignEndVertical', action: () => this.engineRef.alignObjects(KritzelAlignment.EndHorizontal) },\n { label: 'menu.alignTop', icon: 'alignStartHorizontal', action: () => this.engineRef.alignObjects(KritzelAlignment.StartVertical) },\n { label: 'menu.alignCenterVertical', icon: 'alignCenterVertical', action: () => this.engineRef.alignObjects(KritzelAlignment.CenterVertical) },\n { label: 'menu.alignBottom', icon: 'alignEndHorizontal', action: () => this.engineRef.alignObjects(KritzelAlignment.EndVertical) },\n ],\n },\n {\n label: 'menu.group',\n icon: 'group',\n group: 'other',\n children: [\n {\n label: 'menu.group',\n icon: 'group',\n action: () => this.engineRef.group(),\n },\n {\n label: 'menu.ungroup',\n icon: 'ungroup',\n action: () => this.engineRef.ungroup(),\n },\n ],\n },\n { label: 'menu.delete', icon: 'delete', group: 'edit', action: () => this.engineRef.delete() },\n ]"
|
|
1570
1591
|
},
|
|
1571
1592
|
"moreMenuItems": {
|
|
1572
1593
|
"type": "unknown",
|
|
@@ -1591,7 +1612,7 @@ export class KritzelEditor {
|
|
|
1591
1612
|
},
|
|
1592
1613
|
"getter": false,
|
|
1593
1614
|
"setter": false,
|
|
1594
|
-
"defaultValue": "[\
|
|
1615
|
+
"defaultValue": "[\n {\n id: 'share',\n label: 'menu.share',\n icon: 'share',\n isVisible: async () => hasRemoteSyncProvider(this.syncConfig),\n action: () => {\n if (!this.isLoggedIn && this.loginConfig) {\n this.openLoginDialog();\n return;\n }\n this.shareDialogRef.open();\n },\n },\n {\n id: 'export',\n label: 'menu.export',\n icon: 'upload',\n action: async () => {\n const preview = await this.engineRef.getScreenshot('png');\n this.exportRef.open(preview ?? undefined);\n },\n },\n {\n id: 'import',\n label: 'menu.import',\n icon: 'download',\n action: () => this.engineRef.importFromFile(),\n },\n {\n id: 'settings',\n label: 'menu.settings',\n icon: 'settings',\n action: () => this.settingsRef.open(),\n },\n ]"
|
|
1595
1616
|
},
|
|
1596
1617
|
"themes": {
|
|
1597
1618
|
"type": "unknown",
|
|
@@ -1745,12 +1766,14 @@ export class KritzelEditor {
|
|
|
1745
1766
|
"type": "unknown",
|
|
1746
1767
|
"mutable": false,
|
|
1747
1768
|
"complexType": {
|
|
1748
|
-
"original": "
|
|
1749
|
-
"resolved": "string",
|
|
1769
|
+
"original": "KritzelSvgIconMap",
|
|
1770
|
+
"resolved": "Partial<Record<\"info\" | \"type\" | \"image\" | \"download\" | \"command\" | \"cursor\" | \"x\" | \"copy\" | \"eraser\" | \"pen\" | \"arrow\" | \"arrowUpFromDot\" | \"arrowDownFromDot\" | \"highlighter\" | \"shapes\" | \"shapeRectangle\" | \"shapeEllipse\" | \"shapeTriangle\" | \"imageOff\" | \"chevronDown\" | \"chevronUp\" | \"chevronLeft\" | \"chevronRight\" | \"chevronsLeft\" | \"paste\" | \"cut\" | \"delete\" | \"bringToFront\" | \"sendToBack\" | \"selectAll\" | \"upload\" | \"undo\" | \"redo\" | \"plus\" | \"minus\" | \"ellipsisVertical\" | \"check\" | \"group\" | \"ungroup\" | \"moveVertical\" | \"hand\" | \"handGrab\" | \"mousePointer\" | \"pointer\" | \"settings\" | \"share\" | \"palette\" | \"ordering\" | \"layoutTemplate\" | \"align\" | \"alignStartHorizontal\" | \"alignCenterHorizontal\" | \"alignEndHorizontal\" | \"alignStartVertical\" | \"alignCenterVertical\" | \"alignEndVertical\" | \"viewport\" | \"logOut\" | \"usersRound\" | \"google\" | \"facebook\" | \"github\" | \"braces\" | \"heart\", string>> & Record<string, string>",
|
|
1750
1771
|
"references": {
|
|
1751
|
-
"
|
|
1752
|
-
"location": "
|
|
1753
|
-
"
|
|
1772
|
+
"KritzelSvgIconMap": {
|
|
1773
|
+
"location": "import",
|
|
1774
|
+
"path": "@kritzel/engine",
|
|
1775
|
+
"id": "../../engine/core/dist/types/index.d.ts::KritzelSvgIconMap",
|
|
1776
|
+
"referenceLocation": "KritzelSvgIconMap"
|
|
1754
1777
|
}
|
|
1755
1778
|
}
|
|
1756
1779
|
},
|
|
@@ -1783,7 +1806,7 @@ export class KritzelEditor {
|
|
|
1783
1806
|
"optional": false,
|
|
1784
1807
|
"docs": {
|
|
1785
1808
|
"tags": [],
|
|
1786
|
-
"text": "Registers fonts for runtime usage (for example custom object rendering).\
|
|
1809
|
+
"text": "Registers fonts for runtime usage (for example custom object rendering).\nText-tool config tooltip options are controlled via toolbarItems[].config.availableFonts."
|
|
1787
1810
|
},
|
|
1788
1811
|
"getter": false,
|
|
1789
1812
|
"setter": false,
|
|
@@ -3310,7 +3333,7 @@ export class KritzelEditor {
|
|
|
3310
3333
|
"tags": []
|
|
3311
3334
|
}
|
|
3312
3335
|
},
|
|
3313
|
-
"
|
|
3336
|
+
"setActiveTool": {
|
|
3314
3337
|
"complexType": {
|
|
3315
3338
|
"signature": "(toolName: string) => Promise<void>",
|
|
3316
3339
|
"parameters": [{
|
|
@@ -4529,7 +4552,7 @@ export class KritzelEditor {
|
|
|
4529
4552
|
"text": "fonts - Mapping from font keys to family names or font definitions."
|
|
4530
4553
|
}, {
|
|
4531
4554
|
"name": "remarks",
|
|
4532
|
-
"text": "This no longer controls the text-tool config tooltip font options.\
|
|
4555
|
+
"text": "This no longer controls the text-tool config tooltip font options.\nConfigure tooltip fonts via toolbarItems[].config.availableFonts."
|
|
4533
4556
|
}]
|
|
4534
4557
|
}
|
|
4535
4558
|
},
|
|
@@ -4637,6 +4660,9 @@ export class KritzelEditor {
|
|
|
4637
4660
|
}, {
|
|
4638
4661
|
"propName": "customFonts",
|
|
4639
4662
|
"methodName": "onCustomFontsChange"
|
|
4663
|
+
}, {
|
|
4664
|
+
"propName": "customSvgIcons",
|
|
4665
|
+
"methodName": "onCustomSvgIconsChange"
|
|
4640
4666
|
}, {
|
|
4641
4667
|
"propName": "moreMenuItems",
|
|
4642
4668
|
"methodName": "onMoreMenuItemsChange"
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
min-height: 0;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.export-content {
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
gap: 16px;
|
|
11
|
-
padding:0;
|
|
12
|
-
flex: 1;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.export-content kritzel-pill-tabs {
|
|
16
|
-
align-self: center;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.export-tab-content {
|
|
20
|
-
display: flex;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
gap: 16px;
|
|
23
|
-
min-height: 330px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.format-selection {
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
gap: 6px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.format-selection label {
|
|
33
|
-
font-size: 14px;
|
|
34
|
-
font-weight: 500;
|
|
35
|
-
color: var(--kritzel-global-text-primary, #333);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.export-primary-button {
|
|
39
|
-
width: 100%;
|
|
40
|
-
padding: 12px 24px;
|
|
41
|
-
background-color: var(--kritzel-global-primary-color, #007AFF);
|
|
42
|
-
color: var(--kritzel-global-primary-text-color, #fff);
|
|
43
|
-
border: none;
|
|
44
|
-
border-radius: var(--kritzel-button-border-radius, 8px);
|
|
45
|
-
font-size: 14px;
|
|
46
|
-
font-weight: 600;
|
|
47
|
-
cursor: pointer;
|
|
48
|
-
transition: background-color 0.2s ease;
|
|
49
|
-
-webkit-tap-highlight-color: transparent;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.export-primary-button:hover {
|
|
53
|
-
background-color: var(--kritzel-global-primary-hover-color, #0066d6);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.export-primary-button:focus-visible {
|
|
57
|
-
outline: revert;
|
|
58
|
-
outline-offset: revert;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.preview-container {
|
|
62
|
-
width: 100%;
|
|
63
|
-
display: flex;
|
|
64
|
-
justify-content: center;
|
|
65
|
-
align-items: center;
|
|
66
|
-
box-sizing: border-box;
|
|
67
|
-
margin-bottom: 8px;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.preview-container img {
|
|
71
|
-
max-width: 100%;
|
|
72
|
-
max-height: 250px;
|
|
73
|
-
object-fit: contain;
|
|
74
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
|
75
|
-
border-radius: 4px;
|
|
76
|
-
border: 1px solid var(--kritzel-global-border-color, #dbdbdb);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.export-content p {
|
|
80
|
-
margin: 0;
|
|
81
|
-
color: var(--kritzel-global-text-secondary, #666);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@media (max-width: 576px) {
|
|
85
|
-
.export-tab-content {
|
|
86
|
-
flex: 1;
|
|
87
|
-
min-height: 0;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
1
|
+
:host {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
min-height: 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.export-content {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 16px;
|
|
11
|
+
padding:0;
|
|
12
|
+
flex: 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.export-content kritzel-pill-tabs {
|
|
16
|
+
align-self: center;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.export-tab-content {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: 16px;
|
|
23
|
+
min-height: 330px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.format-selection {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
gap: 6px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.format-selection label {
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
font-weight: 500;
|
|
35
|
+
color: var(--kritzel-global-text-primary, #333);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.export-primary-button {
|
|
39
|
+
width: 100%;
|
|
40
|
+
padding: 12px 24px;
|
|
41
|
+
background-color: var(--kritzel-global-primary-color, #007AFF);
|
|
42
|
+
color: var(--kritzel-global-primary-text-color, #fff);
|
|
43
|
+
border: none;
|
|
44
|
+
border-radius: var(--kritzel-button-border-radius, 8px);
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
transition: background-color 0.2s ease;
|
|
49
|
+
-webkit-tap-highlight-color: transparent;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.export-primary-button:hover {
|
|
53
|
+
background-color: var(--kritzel-global-primary-hover-color, #0066d6);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.export-primary-button:focus-visible {
|
|
57
|
+
outline: revert;
|
|
58
|
+
outline-offset: revert;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.preview-container {
|
|
62
|
+
width: 100%;
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
align-items: center;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
margin-bottom: 8px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.preview-container img {
|
|
71
|
+
max-width: 100%;
|
|
72
|
+
max-height: 250px;
|
|
73
|
+
object-fit: contain;
|
|
74
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
|
75
|
+
border-radius: 4px;
|
|
76
|
+
border: 1px solid var(--kritzel-global-border-color, #dbdbdb);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.export-content p {
|
|
80
|
+
margin: 0;
|
|
81
|
+
color: var(--kritzel-global-text-secondary, #666);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@media (max-width: 576px) {
|
|
85
|
+
.export-tab-content {
|
|
86
|
+
flex: 1;
|
|
87
|
+
min-height: 0;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -72,7 +72,7 @@ export class KritzelExport {
|
|
|
72
72
|
return (h("div", { class: "export-tab-content" }, h("kritzel-input", { label: this.terms['export.filename.label'] ?? 'Filename', value: this.exportFilename, placeholder: this.terms['export.filename.placeholder'] ?? 'Enter filename', suffix: ".json", onValueChange: this.handleFilenameChange })));
|
|
73
73
|
}
|
|
74
74
|
render() {
|
|
75
|
-
return (h(Host, { key: '
|
|
75
|
+
return (h(Host, { key: '94d55a7c75cdad6c8772180656016ef7a84ea937' }, h("kritzel-dialog", { key: '7564885a16e21f036e4943f9be923ef3db07ab77', isOpen: this.isDialogOpen, dialogTitle: this.terms['export.dialogTitle'] ?? 'Export', closable: true, contained: true, onDialogClose: this.closeDialog }, h("div", { key: '40fceeacffc79d70ecea2c397f19852e85756d50', class: "export-content" }, h("kritzel-pill-tabs", { key: 'a2bb5be3df21f940d8e3f7d27fa9fbc956f16a55', tabs: this.tabs, value: this.activeTab, onValueChange: this.handleTabChange }), this.activeTab === 'viewport' && this.renderViewportExport(), this.activeTab === 'workspace' && this.renderWorkspaceExport()), h("div", { key: '29a0fcb85755577655401c96643a1956aedfa27d', slot: "footer" }, h("button", { key: 'f003963d407005c67740b6620b8983dcf3c8977a', class: "export-primary-button", onClick: this.handleExport }, this.terms['export.exportButton'] ?? 'Export')))));
|
|
76
76
|
}
|
|
77
77
|
static get is() { return "kritzel-export"; }
|
|
78
78
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: block;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.font-preview {
|
|
6
|
-
color: var(--kritzel-font-size-text-color, #333333);
|
|
7
|
-
line-height: 1;
|
|
8
|
-
text-align: center;
|
|
9
|
-
font-weight: bold;
|
|
10
|
-
}
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.font-preview {
|
|
6
|
+
color: var(--kritzel-font-size-text-color, #333333);
|
|
7
|
+
line-height: 1;
|
|
8
|
+
text-align: center;
|
|
9
|
+
font-weight: bold;
|
|
10
|
+
}
|
|
@@ -4,7 +4,7 @@ export class KritzelFont {
|
|
|
4
4
|
size = 24;
|
|
5
5
|
color = '#000000';
|
|
6
6
|
render() {
|
|
7
|
-
return (h(Host, { key: '
|
|
7
|
+
return (h(Host, { key: '7ee5e56528fd93c5b00c930e0404b55aa6ba29f7' }, h("div", { key: '54111872192f8f6aa4a523c81fdcbacacde5facf', class: "font-preview", style: {
|
|
8
8
|
fontFamily: this.fontFamily,
|
|
9
9
|
fontSize: `${this.size}px`,
|
|
10
10
|
color: this.color
|