kritzel-stencil 0.4.22 → 0.4.24
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 +21 -21
- package/LICENSE.md +49 -49
- package/dist/cjs/{index-Xav9JFHg.js → index-Dn19mGl-.js} +47 -11
- package/dist/cjs/index.cjs.js +2 -51
- package/dist/cjs/kritzel-active-users_47.cjs.entry.js +198 -231
- package/dist/cjs/kritzel-brush-style.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{schema.constants-CjN-B633.js → schema.constants-CY0WWJYd.js} +44 -20
- package/dist/cjs/stencil.cjs.js +2 -2
- package/dist/collection/classes/providers/sync/hocuspocus-sync-provider.class.js +0 -21
- package/dist/collection/classes/providers/sync/websocket-sync-provider.class.js +1 -29
- package/dist/collection/classes/structures/app-state-map.structure.js +1 -4
- package/dist/collection/classes/structures/object-map.structure.js +4 -66
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/core/kritzel-awareness-cursors/kritzel-awareness-cursors.css +115 -115
- package/dist/collection/components/core/kritzel-awareness-cursors/kritzel-awareness-cursors.js +1 -1
- package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.css +10 -10
- package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.js +1 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.css +160 -160
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +18 -51
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.css +80 -80
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +102 -65
- package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.css +29 -29
- package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.js +2 -2
- package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.css +58 -58
- package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.js +3 -3
- package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.css +42 -42
- package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js +3 -3
- package/dist/collection/components/shared/kritzel-button/kritzel-button.css +73 -73
- package/dist/collection/components/shared/kritzel-button/kritzel-button.js +2 -2
- package/dist/collection/components/shared/kritzel-color/kritzel-color.css +24 -24
- package/dist/collection/components/shared/kritzel-color/kritzel-color.js +2 -2
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.css +46 -46
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +1 -1
- package/dist/collection/components/shared/kritzel-dialog/kritzel-dialog.css +209 -209
- package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.css +190 -190
- package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js +2 -2
- package/dist/collection/components/shared/kritzel-font/kritzel-font.css +10 -10
- package/dist/collection/components/shared/kritzel-font/kritzel-font.js +1 -1
- package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.css +48 -48
- package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js +2 -2
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.css +30 -30
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js +1 -1
- package/dist/collection/components/shared/kritzel-icon/kritzel-icon.css +18 -18
- package/dist/collection/components/shared/kritzel-input/kritzel-input.css +69 -69
- package/dist/collection/components/shared/kritzel-input/kritzel-input.js +1 -1
- package/dist/collection/components/shared/kritzel-line-endings/kritzel-line-endings.css +60 -60
- package/dist/collection/components/shared/kritzel-line-endings/kritzel-line-endings.js +3 -3
- package/dist/collection/components/shared/kritzel-master-detail/kritzel-master-detail.css +190 -190
- package/dist/collection/components/shared/kritzel-master-detail/kritzel-master-detail.js +3 -3
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.css +34 -34
- package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js +1 -1
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.css +166 -166
- package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js +2 -2
- package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.css +102 -102
- package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.js +1 -1
- package/dist/collection/components/shared/kritzel-opacity-slider/kritzel-opacity-slider.css +85 -85
- package/dist/collection/components/shared/kritzel-opacity-slider/kritzel-opacity-slider.js +1 -1
- package/dist/collection/components/shared/kritzel-pill-tabs/kritzel-pill-tabs.css +68 -68
- package/dist/collection/components/shared/kritzel-pill-tabs/kritzel-pill-tabs.js +2 -2
- package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +1 -1
- package/dist/collection/components/shared/kritzel-shape-fill/kritzel-shape-fill.css +47 -47
- package/dist/collection/components/shared/kritzel-shape-fill/kritzel-shape-fill.js +4 -4
- package/dist/collection/components/shared/kritzel-slide-toggle/kritzel-slide-toggle.css +48 -48
- package/dist/collection/components/shared/kritzel-slide-toggle/kritzel-slide-toggle.js +1 -1
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.css +78 -78
- package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js +1 -1
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.css +37 -37
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
- package/dist/collection/components/shared/kritzel-sync-indicator/kritzel-sync-indicator.css +50 -50
- package/dist/collection/components/shared/kritzel-sync-indicator/kritzel-sync-indicator.js +1 -1
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.css +18 -18
- package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +2 -2
- package/dist/collection/components/ui/kritzel-active-users/kritzel-active-users.css +65 -65
- package/dist/collection/components/ui/kritzel-back-to-content/kritzel-back-to-content.css +42 -42
- package/dist/collection/components/ui/kritzel-back-to-content/kritzel-back-to-content.js +1 -1
- package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.css +112 -112
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.css +331 -331
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +6 -6
- package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.css +11 -11
- package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.js +1 -1
- package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.css +39 -39
- package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.js +1 -1
- package/dist/collection/components/ui/kritzel-export/kritzel-export.css +89 -89
- package/dist/collection/components/ui/kritzel-export/kritzel-export.js +1 -1
- package/dist/collection/components/ui/kritzel-loading-overlay/kritzel-loading-overlay.css +50 -50
- package/dist/collection/components/ui/kritzel-loading-overlay/kritzel-loading-overlay.js +1 -1
- package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.css +98 -98
- package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.js +1 -1
- package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.css +58 -58
- package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.js +2 -2
- package/dist/collection/components/ui/kritzel-notification-card/kritzel-notification-card.css +101 -101
- package/dist/collection/components/ui/kritzel-settings/kritzel-settings.css +137 -137
- package/dist/collection/components/ui/kritzel-settings/kritzel-settings.js +1 -1
- package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.css +150 -150
- package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
- package/dist/collection/components/ui/kritzel-tool-config/kritzel-tool-config.css +38 -38
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.css +45 -45
- package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
- package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.css +16 -16
- package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.css +72 -72
- package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.js +1 -1
- package/dist/collection/constants/version.js +1 -1
- package/dist/collection/helpers/cursor.helper.js +6 -6
- package/dist/collection/helpers/svg-export.helper.js +41 -41
- package/dist/components/index.js +4 -53
- 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-controls.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 +56 -61
- 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-sync-indicator.js +1 -1
- package/dist/components/kritzel-tool-config.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-jIKskj3S.js → p-1Q4VnThv.js} +3 -3
- package/dist/components/{p-Cm33td2O.js → p-3tBE7SyG.js} +2 -2
- package/dist/components/{p-fL9rl200.js → p-BFYT03fw.js} +3 -3
- package/dist/components/{p-DtnMdWWB.js → p-BShrnlam.js} +2 -2
- package/dist/components/{p-BsLI_BWq.js → p-BXUx_C0N.js} +2 -2
- package/dist/components/{p-CzW58DHM.js → p-BZZ3KRPk.js} +3 -3
- package/dist/components/{p-D1rjfWgJ.js → p-BkXQL5Dl.js} +5 -5
- package/dist/components/{p-eZXIu4yK.js → p-BppcoKoo.js} +5 -5
- package/dist/components/{p-DDTMGbtA.js → p-BrA9NBEE.js} +21 -21
- package/dist/components/{p-Czhdc844.js → p-BrqSjRJN.js} +3 -3
- package/dist/components/{p-CAoN_STZ.js → p-Bxi-Bm49.js} +2 -2
- package/dist/components/{p-B43upypT.js → p-C9_yBEoX.js} +30 -10
- package/dist/components/{p-Df3BwVGy.js → p-CHoOe3FD.js} +3 -3
- package/dist/components/{p-2WiGyky4.js → p-CLAz6RJc.js} +3 -3
- package/dist/components/{p-B5SWPDuq.js → p-CSKToqUl.js} +4 -4
- package/dist/components/{p-CF8pLc07.js → p-CSWCmyzb.js} +5 -5
- package/dist/components/{p-HoO86l1o.js → p-CWAChRD5.js} +12 -12
- package/dist/components/{p-DwMqCX2P.js → p-Ch-KG9To.js} +3 -3
- package/dist/components/{p-CSuU8frA.js → p-Ck-87E2G.js} +1 -1
- package/dist/components/{p-BFYtCsZu.js → p-Covorf4C.js} +3 -3
- package/dist/components/{p-BoN700-O.js → p-Cx-L_28S.js} +3 -3
- package/dist/components/{p-vqEUQ-4Q.js → p-D0Trc3IQ.js} +5 -5
- package/dist/components/{p-BrNsOp2v.js → p-D2VcPEtL.js} +6 -6
- package/dist/components/{p-CSPYkLLH.js → p-D3BzgkIE.js} +2 -2
- package/dist/components/{p-bAacqNHq.js → p-D6JycG-I.js} +3 -3
- package/dist/components/{p-DB58Oa5V.js → p-DPsbNStn.js} +2 -2
- package/dist/components/{p-CwZ3KKFq.js → p-DT_WBwsw.js} +6 -6
- package/dist/components/{p-Dx5NfJ0U.js → p-DW1B118Q.js} +9 -9
- package/dist/components/{p-BPsKYMH6.js → p-DYPA7jpg.js} +2 -2
- package/dist/components/{p-DBqoPgev.js → p-DafP9PAA.js} +2 -2
- package/dist/components/{p-Dt7-I2Xz.js → p-DcUIO14-.js} +4 -4
- package/dist/components/{p-CXpv9Rxe.js → p-Di--2boB.js} +3 -3
- package/dist/components/{p-djJSnjAX.js → p-DjXQxw9R.js} +3 -3
- package/dist/components/{p-DVXTPI71.js → p-Dp1CD4gK.js} +2 -2
- package/dist/components/{p-BNeE3SiZ.js → p-DwEYMvIn.js} +175 -179
- package/dist/components/{p-DKGg-76-.js → p-Dznwo6oc.js} +2 -2
- package/dist/components/{p-BozrueXV.js → p-ME1sDz3f.js} +2 -2
- package/dist/components/{p-B-585egz.js → p-MhQxGUvY.js} +3 -3
- package/dist/components/{p-DX2nriaq.js → p-QSyeAy8R.js} +2 -2
- package/dist/components/{p-PjPPCHVL.js → p-Qdo3E8dr.js} +2 -2
- package/dist/components/{p-dsxHDlQ3.js → p-b0J2ktAm.js} +7 -7
- package/dist/components/{p-C98Eb3_R.js → p-dAXnRkjA.js} +5 -5
- package/dist/components/{p-GKmqCI8r.js → p-fSV6KVTC.js} +3 -3
- package/dist/components/{p-CaBbajU2.js → p-o3NYKrVL.js} +3 -3
- package/dist/components/{p-CrHvaLRV.js → p-vDCa_ZDm.js} +3 -3
- package/dist/components/{p-4SPnZZkH.js → p-zG-WUBGF.js} +4 -4
- package/dist/esm/{index-Dhio9uis.js → index-2va1Pk9z.js} +47 -11
- package/dist/esm/index.js +3 -52
- package/dist/esm/kritzel-active-users_47.entry.js +198 -231
- package/dist/esm/kritzel-brush-style.entry.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{schema.constants-DfvqHmxc.js → schema.constants-DBvUmuDH.js} +44 -20
- package/dist/esm/stencil.js +3 -3
- package/dist/stencil/index.esm.js +3 -52
- package/dist/stencil/{p-Dhio9uis.js → p-2va1Pk9z.js} +47 -11
- package/dist/stencil/{p-DfvqHmxc.js → p-DBvUmuDH.js} +44 -20
- package/dist/stencil/{p-ab5c4292.entry.js → p-ce6d432e.entry.js} +198 -231
- package/dist/stencil/{p-fb32cd8f.entry.js → p-df06ca3a.entry.js} +2 -2
- package/dist/stencil/stencil.esm.js +4 -4
- package/dist/types/classes/providers/sync/hocuspocus-sync-provider.class.d.ts +0 -5
- package/dist/types/classes/providers/sync/websocket-sync-provider.class.d.ts +0 -6
- package/dist/types/classes/structures/object-map.structure.d.ts +2 -26
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +0 -3
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +11 -9
- package/dist/types/components.d.ts +1 -8
- package/dist/types/constants/version.d.ts +1 -1
- package/dist/types/interfaces/sync-provider.interface.d.ts +0 -13
- package/dist/types/stencil-public-runtime.d.ts +12 -0
- package/loader/index.d.ts +1 -1
- package/package.json +1 -1
- package/readme.md +10 -10
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
.expand-toggle {
|
|
2
|
-
background: none;
|
|
3
|
-
border: none;
|
|
4
|
-
cursor: var(--kritzel-global-pointer-cursor, pointer);
|
|
5
|
-
padding: 0;
|
|
6
|
-
margin: 0;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
width: 32px;
|
|
11
|
-
height: 32px;
|
|
12
|
-
color: var(--kritzel-icon-color, currentColor);
|
|
13
|
-
transition: transform 0.2s ease;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.expand-toggle:hover {
|
|
17
|
-
opacity: 0.7;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.expand-toggle:focus {
|
|
21
|
-
outline: none;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.expand-toggle:focus-visible {
|
|
25
|
-
outline: 2px solid var(--kritzel-focus-color, #007acc);
|
|
26
|
-
outline-offset: 2px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.expand-toggle:active {
|
|
30
|
-
transform: scale(0.95);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.divider {
|
|
34
|
-
height: 1px;
|
|
35
|
-
background-color: var(--kritzel-divider-color, #e0e0e0);
|
|
36
|
-
margin: 4px 0;
|
|
37
|
-
width: 100%;
|
|
38
|
-
}
|
|
1
|
+
.expand-toggle {
|
|
2
|
+
background: none;
|
|
3
|
+
border: none;
|
|
4
|
+
cursor: var(--kritzel-global-pointer-cursor, pointer);
|
|
5
|
+
padding: 0;
|
|
6
|
+
margin: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
width: 32px;
|
|
11
|
+
height: 32px;
|
|
12
|
+
color: var(--kritzel-icon-color, currentColor);
|
|
13
|
+
transition: transform 0.2s ease;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.expand-toggle:hover {
|
|
17
|
+
opacity: 0.7;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.expand-toggle:focus {
|
|
21
|
+
outline: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.expand-toggle:focus-visible {
|
|
25
|
+
outline: 2px solid var(--kritzel-focus-color, #007acc);
|
|
26
|
+
outline-offset: 2px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.expand-toggle:active {
|
|
30
|
+
transform: scale(0.95);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.divider {
|
|
34
|
+
height: 1px;
|
|
35
|
+
background-color: var(--kritzel-divider-color, #e0e0e0);
|
|
36
|
+
margin: 4px 0;
|
|
37
|
+
width: 100%;
|
|
38
|
+
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: row;
|
|
4
|
-
align-items: center;
|
|
5
|
-
padding: 4px;
|
|
6
|
-
gap: 8px;
|
|
7
|
-
border-top-left-radius: 12px;
|
|
8
|
-
border-top-right-radius: 12px;
|
|
9
|
-
background-color: var(--kritzel-utility-panel-background-color, #e2e2e2);
|
|
10
|
-
width: fit-content;
|
|
11
|
-
user-select: none;
|
|
12
|
-
z-index: 1;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.utility-button {
|
|
16
|
-
display: flex;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
align-items: center;
|
|
19
|
-
width: 28px;
|
|
20
|
-
height: 28px;
|
|
21
|
-
padding: 8px 4px;
|
|
22
|
-
border: none;
|
|
23
|
-
background: none;
|
|
24
|
-
cursor: var(--kritzel-global-pointer-cursor, pointer);
|
|
25
|
-
color: var(--kritzel-utility-panel-button-color, #333333);
|
|
26
|
-
--kritzel-icon-color: var(--kritzel-utility-panel-button-color, #333333);
|
|
27
|
-
-webkit-tap-highlight-color: transparent;
|
|
28
|
-
border-radius: var(--kritzel-utility-panel-button-border-radius, 8px);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.utility-button:hover,
|
|
32
|
-
.utility-button:focus-visible {
|
|
33
|
-
background-color: var(--kritzel-utility-panel-button-hover-background-color, hsl(0, 0%, 0%, 4.3%));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.utility-button:disabled {
|
|
37
|
-
opacity: 0.4;
|
|
38
|
-
cursor: not-allowed;
|
|
39
|
-
pointer-events: none;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.utility-separator {
|
|
43
|
-
width: 1px;
|
|
44
|
-
height: 16px;
|
|
45
|
-
background-color: var(--kritzel-utility-panel-separator-color, hsl(0, 0%, 0%, 8%));
|
|
1
|
+
:host {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
align-items: center;
|
|
5
|
+
padding: 4px;
|
|
6
|
+
gap: 8px;
|
|
7
|
+
border-top-left-radius: 12px;
|
|
8
|
+
border-top-right-radius: 12px;
|
|
9
|
+
background-color: var(--kritzel-utility-panel-background-color, #e2e2e2);
|
|
10
|
+
width: fit-content;
|
|
11
|
+
user-select: none;
|
|
12
|
+
z-index: 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.utility-button {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
align-items: center;
|
|
19
|
+
width: 28px;
|
|
20
|
+
height: 28px;
|
|
21
|
+
padding: 8px 4px;
|
|
22
|
+
border: none;
|
|
23
|
+
background: none;
|
|
24
|
+
cursor: var(--kritzel-global-pointer-cursor, pointer);
|
|
25
|
+
color: var(--kritzel-utility-panel-button-color, #333333);
|
|
26
|
+
--kritzel-icon-color: var(--kritzel-utility-panel-button-color, #333333);
|
|
27
|
+
-webkit-tap-highlight-color: transparent;
|
|
28
|
+
border-radius: var(--kritzel-utility-panel-button-border-radius, 8px);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.utility-button:hover,
|
|
32
|
+
.utility-button:focus-visible {
|
|
33
|
+
background-color: var(--kritzel-utility-panel-button-hover-background-color, hsl(0, 0%, 0%, 4.3%));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.utility-button:disabled {
|
|
37
|
+
opacity: 0.4;
|
|
38
|
+
cursor: not-allowed;
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.utility-separator {
|
|
43
|
+
width: 1px;
|
|
44
|
+
height: 16px;
|
|
45
|
+
background-color: var(--kritzel-utility-panel-separator-color, hsl(0, 0%, 0%, 8%));
|
|
46
46
|
}
|
|
@@ -19,7 +19,7 @@ export class KritzelUtilityPanel {
|
|
|
19
19
|
this.redo.emit();
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: 'bc0322b40c4ff4fba997f1dc1901edbb934e4a0a' }, h("button", { key: 'ff48698d2757b0d99cacfd4fbaa5a7b0ae8f1604', class: "utility-button", "data-testid": "utility-undo", disabled: !this.undoState?.canUndo, onClick: event => this.handleUndo(event), "aria-label": this.terms['utility.undo'] ?? 'Undo' }, h("kritzel-icon", { key: 'bc6756df10c7979e06cd9ebdb172b5ef54c7bb67', name: "undo" })), h("button", { key: '07afd176ae1b5cb5a65cd097ce4a99a131aee7aa', class: "utility-button", "data-testid": "utility-redo", disabled: !this.undoState?.canRedo, onClick: event => this.handleRedo(event), "aria-label": this.terms['utility.redo'] ?? 'Redo' }, h("kritzel-icon", { key: '4573d7ab91f0cbfa0aafb607050f0b09048d60e1', name: "redo" })), h("div", { key: 'b663c43ef9181f61b12614245a65d063f6d94eaf', class: "utility-separator" }), h("button", { key: '248f7ae7cabbd83585674dcb16124a3f9fa2449b', class: "utility-button", "data-testid": "utility-delete", onClick: () => this.delete.emit(), "aria-label": this.terms['utility.delete'] ?? 'Delete selected items' }, h("kritzel-icon", { key: '6cbc48e118c96770333ed3e5947e54e497e93716', name: "delete" }))));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "kritzel-utility-panel"; }
|
|
25
25
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.css
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
z-index: 1;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.manager {
|
|
8
|
-
opacity: 0;
|
|
9
|
-
pointer-events: none;
|
|
10
|
-
transition: opacity 0.2s ease-out;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.manager.visible {
|
|
14
|
-
opacity: 1;
|
|
15
|
-
pointer-events: auto;
|
|
16
|
-
}
|
|
1
|
+
:host {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
z-index: 1;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.manager {
|
|
8
|
+
opacity: 0;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
transition: opacity 0.2s ease-out;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.manager.visible {
|
|
14
|
+
opacity: 1;
|
|
15
|
+
pointer-events: auto;
|
|
16
|
+
}
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: block;
|
|
3
|
-
z-index: 1;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.panel {
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: row;
|
|
9
|
-
align-items: center;
|
|
10
|
-
gap: var(--kritzel-zoom-panel-gap, 4px);
|
|
11
|
-
padding: var(--kritzel-zoom-panel-padding, 4px);
|
|
12
|
-
border: var(--kritzel-zoom-panel-border, 1px solid #ebebeb);
|
|
13
|
-
border-radius: var(--kritzel-zoom-panel-border-radius, 12px);
|
|
14
|
-
background-color: var(--kritzel-zoom-panel-background-color, #ffffff);
|
|
15
|
-
box-shadow: var(--kritzel-zoom-panel-box-shadow, 0 0 3px rgba(0, 0, 0, 0.08));
|
|
16
|
-
opacity: 0;
|
|
17
|
-
pointer-events: none;
|
|
18
|
-
transition: opacity 0.2s ease-out;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.panel.visible {
|
|
22
|
-
opacity: 1;
|
|
23
|
-
pointer-events: auto;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.zoom-level {
|
|
27
|
-
display: inline-flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
justify-content: center;
|
|
30
|
-
min-width: 46px;
|
|
31
|
-
color: var(--kritzel-zoom-panel-icon-color, #000000);
|
|
32
|
-
font-family: var(--kritzel-font-family, sans-serif);
|
|
33
|
-
font-size: 12px;
|
|
34
|
-
font-weight: 500;
|
|
35
|
-
line-height: 1;
|
|
36
|
-
padding: 0 4px;
|
|
37
|
-
user-select: none;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.zoom-button {
|
|
41
|
-
display: flex;
|
|
42
|
-
align-items: center;
|
|
43
|
-
justify-content: center;
|
|
44
|
-
width: var(--kritzel-zoom-panel-button-size, 32px);
|
|
45
|
-
height: var(--kritzel-zoom-panel-button-size, 32px);
|
|
46
|
-
padding: 0;
|
|
47
|
-
border: 0;
|
|
48
|
-
border-radius: var(--kritzel-zoom-panel-button-border-radius, 8px);
|
|
49
|
-
background: transparent;
|
|
50
|
-
background-color: transparent;
|
|
51
|
-
color: var(--kritzel-zoom-panel-icon-color, #000000);
|
|
52
|
-
--kritzel-icon-color: var(--kritzel-zoom-panel-icon-color, #000000);
|
|
53
|
-
box-shadow: none;
|
|
54
|
-
appearance: none;
|
|
55
|
-
cursor: var(--kritzel-global-pointer-cursor, pointer);
|
|
56
|
-
-webkit-tap-highlight-color: transparent;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.zoom-button:hover,
|
|
60
|
-
.zoom-button:focus-visible {
|
|
61
|
-
background-color: var(--kritzel-zoom-panel-button-hover-background-color, hsl(0, 0%, 0%, 4.3%));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.zoom-button:active {
|
|
65
|
-
background-color: var(--kritzel-zoom-panel-button-active-background-color, hsl(0, 0%, 0%, 8.6%));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.zoom-button:disabled {
|
|
69
|
-
opacity: 0.5;
|
|
70
|
-
cursor: not-allowed;
|
|
71
|
-
pointer-events: none;
|
|
72
|
-
}
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
z-index: 1;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.panel {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: row;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: var(--kritzel-zoom-panel-gap, 4px);
|
|
11
|
+
padding: var(--kritzel-zoom-panel-padding, 4px);
|
|
12
|
+
border: var(--kritzel-zoom-panel-border, 1px solid #ebebeb);
|
|
13
|
+
border-radius: var(--kritzel-zoom-panel-border-radius, 12px);
|
|
14
|
+
background-color: var(--kritzel-zoom-panel-background-color, #ffffff);
|
|
15
|
+
box-shadow: var(--kritzel-zoom-panel-box-shadow, 0 0 3px rgba(0, 0, 0, 0.08));
|
|
16
|
+
opacity: 0;
|
|
17
|
+
pointer-events: none;
|
|
18
|
+
transition: opacity 0.2s ease-out;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.panel.visible {
|
|
22
|
+
opacity: 1;
|
|
23
|
+
pointer-events: auto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.zoom-level {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
min-width: 46px;
|
|
31
|
+
color: var(--kritzel-zoom-panel-icon-color, #000000);
|
|
32
|
+
font-family: var(--kritzel-font-family, sans-serif);
|
|
33
|
+
font-size: 12px;
|
|
34
|
+
font-weight: 500;
|
|
35
|
+
line-height: 1;
|
|
36
|
+
padding: 0 4px;
|
|
37
|
+
user-select: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.zoom-button {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
width: var(--kritzel-zoom-panel-button-size, 32px);
|
|
45
|
+
height: var(--kritzel-zoom-panel-button-size, 32px);
|
|
46
|
+
padding: 0;
|
|
47
|
+
border: 0;
|
|
48
|
+
border-radius: var(--kritzel-zoom-panel-button-border-radius, 8px);
|
|
49
|
+
background: transparent;
|
|
50
|
+
background-color: transparent;
|
|
51
|
+
color: var(--kritzel-zoom-panel-icon-color, #000000);
|
|
52
|
+
--kritzel-icon-color: var(--kritzel-zoom-panel-icon-color, #000000);
|
|
53
|
+
box-shadow: none;
|
|
54
|
+
appearance: none;
|
|
55
|
+
cursor: var(--kritzel-global-pointer-cursor, pointer);
|
|
56
|
+
-webkit-tap-highlight-color: transparent;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.zoom-button:hover,
|
|
60
|
+
.zoom-button:focus-visible {
|
|
61
|
+
background-color: var(--kritzel-zoom-panel-button-hover-background-color, hsl(0, 0%, 0%, 4.3%));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.zoom-button:active {
|
|
65
|
+
background-color: var(--kritzel-zoom-panel-button-active-background-color, hsl(0, 0%, 0%, 8.6%));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.zoom-button:disabled {
|
|
69
|
+
opacity: 0.5;
|
|
70
|
+
cursor: not-allowed;
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
}
|
|
@@ -26,7 +26,7 @@ export class KritzelZoomPanel {
|
|
|
26
26
|
return Number.isFinite(this.zoomPercent) ? Math.max(1, Math.round(this.zoomPercent)) : 100;
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
return (h(Host, { key: '
|
|
29
|
+
return (h(Host, { key: '02de6ea9f2f7b6e057555e3b7e1ee3340cab5fa1' }, h("div", { key: '7531e03a4cfa05165057410e4dde3b4cc695f4de', class: { panel: true, visible: this.visible } }, h("button", { key: '57d324c7ad1c21ee8e107ad41cf1a4b708b0fccc', class: "zoom-button", type: "button", "aria-label": this.terms['zoom.zoomOut'] ?? 'Zoom out', disabled: this.disabled, onClick: this.handleZoomOut }, h("kritzel-icon", { key: '656128018addf58a59f223fab400605aeef4f5a8', name: "minus" })), h("span", { key: '32562a4709f8dea98fe3a80bf8a63722b176a3f4', class: "zoom-level", "aria-live": "polite" }, this.normalizedZoomPercent, "%"), h("button", { key: '4c0c5141597f0265ff4bf9d7bd1105666b6b7a76', class: "zoom-button", type: "button", "aria-label": this.terms['zoom.zoomIn'] ?? 'Zoom in', disabled: this.disabled, onClick: this.handleZoomIn }, h("kritzel-icon", { key: 'f85f69f5b0e214a557dfecb6164f5577af66ca7f', name: "plus" })))));
|
|
30
30
|
}
|
|
31
31
|
static get is() { return "kritzel-zoom-panel"; }
|
|
32
32
|
static get encapsulation() { return "shadow"; }
|
|
@@ -38,12 +38,12 @@ export class KritzelCursorHelper {
|
|
|
38
38
|
// We rotate around the center of the SVG canvas
|
|
39
39
|
const center = size / 2;
|
|
40
40
|
// We use a group to apply the rotation
|
|
41
|
-
const svg = `
|
|
42
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 ${size} ${size}">
|
|
43
|
-
<g transform="rotate(${rotation} ${center} ${center})">
|
|
44
|
-
${content}
|
|
45
|
-
</g>
|
|
46
|
-
</svg>
|
|
41
|
+
const svg = `
|
|
42
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 ${size} ${size}">
|
|
43
|
+
<g transform="rotate(${rotation} ${center} ${center})">
|
|
44
|
+
${content}
|
|
45
|
+
</g>
|
|
46
|
+
</svg>
|
|
47
47
|
`;
|
|
48
48
|
// Encode the SVG for use in a data URI
|
|
49
49
|
// We need to be careful with encoding to ensure it works across browsers
|
|
@@ -66,8 +66,8 @@ export class KritzelSvgExportHelper {
|
|
|
66
66
|
.join('\n ');
|
|
67
67
|
const xmlDecl = includeXmlDeclaration ? '<?xml version="1.0" encoding="UTF-8"?>\n' : '';
|
|
68
68
|
const defsContent = defs.length > 0 ? `\n <defs>\n ${defs.join('\n ')}\n </defs>` : '';
|
|
69
|
-
return `${xmlDecl}<svg xmlns="http://www.w3.org/2000/svg" viewBox="${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}" width="${viewBoxWidth}" height="${viewBoxHeight}">${defsContent}
|
|
70
|
-
${elements}
|
|
69
|
+
return `${xmlDecl}<svg xmlns="http://www.w3.org/2000/svg" viewBox="${viewBoxX} ${viewBoxY} ${viewBoxWidth} ${viewBoxHeight}" width="${viewBoxWidth}" height="${viewBoxHeight}">${defsContent}
|
|
70
|
+
${elements}
|
|
71
71
|
</svg>`;
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
@@ -219,8 +219,8 @@ export class KritzelSvgExportHelper {
|
|
|
219
219
|
const orient = end === 'start' ? 'auto-start-reverse' : 'auto';
|
|
220
220
|
const refX = 0;
|
|
221
221
|
const refY = size / 2;
|
|
222
|
-
return `<marker id="${markerId}" markerWidth="${size}" markerHeight="${size}" refX="${refX}" refY="${refY}" orient="${orient}" markerUnits="userSpaceOnUse">
|
|
223
|
-
<path d="${path}" fill="${fill}" transform="scale(${size / 10})"/>
|
|
222
|
+
return `<marker id="${markerId}" markerWidth="${size}" markerHeight="${size}" refX="${refX}" refY="${refY}" orient="${orient}" markerUnits="userSpaceOnUse">
|
|
223
|
+
<path d="${path}" fill="${fill}" transform="scale(${size / 10})"/>
|
|
224
224
|
</marker>`;
|
|
225
225
|
}
|
|
226
226
|
/**
|
|
@@ -267,10 +267,10 @@ export class KritzelSvgExportHelper {
|
|
|
267
267
|
const opacity = path.opacity !== 1 ? ` opacity="${path.opacity}"` : '';
|
|
268
268
|
const scale = this.getObjectScale(path);
|
|
269
269
|
// Path needs to be wrapped in a g with translation since path.d uses local coordinates
|
|
270
|
-
return `<g transform="${transform}"${opacity}>
|
|
271
|
-
<svg viewBox="${path.viewBox}" width="${path.totalWidth / scale}" height="${path.totalHeight / scale}" overflow="visible">
|
|
272
|
-
<path d="${path.d}" fill="${fill || 'none'}" stroke="${stroke || 'none'}"${path.strokeWidth ? ` stroke-width="${path.strokeWidth}"` : ''}/>
|
|
273
|
-
</svg>
|
|
270
|
+
return `<g transform="${transform}"${opacity}>
|
|
271
|
+
<svg viewBox="${path.viewBox}" width="${path.totalWidth / scale}" height="${path.totalHeight / scale}" overflow="visible">
|
|
272
|
+
<path d="${path.d}" fill="${fill || 'none'}" stroke="${stroke || 'none'}"${path.strokeWidth ? ` stroke-width="${path.strokeWidth}"` : ''}/>
|
|
273
|
+
</svg>
|
|
274
274
|
</g>`;
|
|
275
275
|
}
|
|
276
276
|
/**
|
|
@@ -286,10 +286,10 @@ export class KritzelSvgExportHelper {
|
|
|
286
286
|
const scale = this.getObjectScale(line);
|
|
287
287
|
const markerStart = line.hasStartArrow ? ` marker-start="url(#${line.startMarkerId})"` : '';
|
|
288
288
|
const markerEnd = line.hasEndArrow ? ` marker-end="url(#${line.endMarkerId})"` : '';
|
|
289
|
-
return `<g transform="${transform}"${opacity}>
|
|
290
|
-
<svg viewBox="${line.viewBox}" width="${line.totalWidth / scale}" height="${line.totalHeight / scale}" overflow="visible">
|
|
291
|
-
<path d="${line.d}" fill="none" stroke="${stroke}" stroke-width="${line.strokeWidth}" stroke-linecap="round"${markerStart}${markerEnd}/>
|
|
292
|
-
</svg>
|
|
289
|
+
return `<g transform="${transform}"${opacity}>
|
|
290
|
+
<svg viewBox="${line.viewBox}" width="${line.totalWidth / scale}" height="${line.totalHeight / scale}" overflow="visible">
|
|
291
|
+
<path d="${line.d}" fill="none" stroke="${stroke}" stroke-width="${line.strokeWidth}" stroke-linecap="round"${markerStart}${markerEnd}/>
|
|
292
|
+
</svg>
|
|
293
293
|
</g>`;
|
|
294
294
|
}
|
|
295
295
|
/**
|
|
@@ -315,18 +315,18 @@ export class KritzelSvgExportHelper {
|
|
|
315
315
|
const textHtml = this.prosemirrorToHtml(shape.content, shape, theme);
|
|
316
316
|
if (textHtml) {
|
|
317
317
|
const fontColor = KritzelColorHelper.resolveThemeColor(shape.fontColor, theme);
|
|
318
|
-
textContent = `
|
|
319
|
-
<foreignObject x="${shape.x}" y="${shape.y}" width="${shape.width}" height="${shape.height}">
|
|
320
|
-
<div xmlns="http://www.w3.org/1999/xhtml" style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; font-family: ${shape.fontFamily}; font-size: ${shape.fontSize}px; color: ${fontColor}; overflow: hidden;">
|
|
321
|
-
${textHtml}
|
|
322
|
-
</div>
|
|
318
|
+
textContent = `
|
|
319
|
+
<foreignObject x="${shape.x}" y="${shape.y}" width="${shape.width}" height="${shape.height}">
|
|
320
|
+
<div xmlns="http://www.w3.org/1999/xhtml" style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; font-family: ${shape.fontFamily}; font-size: ${shape.fontSize}px; color: ${fontColor}; overflow: hidden;">
|
|
321
|
+
${textHtml}
|
|
322
|
+
</div>
|
|
323
323
|
</foreignObject>`;
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
return `<g transform="${transform}"${opacity}>
|
|
327
|
-
<svg viewBox="${shape.viewBox}" width="${shape.totalWidth / scale}" height="${shape.totalHeight / scale}" overflow="visible" preserveAspectRatio="none">
|
|
328
|
-
<path d="${pathD}" fill="${fill || 'transparent'}" stroke="${stroke}" stroke-width="${shape.strokeWidth}"/>${textContent}
|
|
329
|
-
</svg>
|
|
326
|
+
return `<g transform="${transform}"${opacity}>
|
|
327
|
+
<svg viewBox="${shape.viewBox}" width="${shape.totalWidth / scale}" height="${shape.totalHeight / scale}" overflow="visible" preserveAspectRatio="none">
|
|
328
|
+
<path d="${pathD}" fill="${fill || 'transparent'}" stroke="${stroke}" stroke-width="${shape.strokeWidth}"/>${textContent}
|
|
329
|
+
</svg>
|
|
330
330
|
</g>`;
|
|
331
331
|
}
|
|
332
332
|
/**
|
|
@@ -357,10 +357,10 @@ export class KritzelSvgExportHelper {
|
|
|
357
357
|
// adjusted font-size already accounts for it – keeping both would double-scale
|
|
358
358
|
// the content and overflow the foreignObject.
|
|
359
359
|
const svgFontSizePx = (text.fontSize * (4 / 3) * (text.scaleFactor || 1) / scale).toFixed(4);
|
|
360
|
-
return `<g transform="${transform}"${opacity}>
|
|
361
|
-
<foreignObject x="0" y="0" width="${width}" height="${height}" overflow="visible">
|
|
362
|
-
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: ${text.fontFamily}; font-size: ${svgFontSizePx}px; color: ${fontColor}; background-color: ${bgColor || 'transparent'}; white-space: pre-wrap; word-wrap: break-word; width: 100%; margin: 0; padding: 0; box-sizing: border-box;">${htmlContent.trim()}</div>
|
|
363
|
-
</foreignObject>
|
|
360
|
+
return `<g transform="${transform}"${opacity}>
|
|
361
|
+
<foreignObject x="0" y="0" width="${width}" height="${height}" overflow="visible">
|
|
362
|
+
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: ${text.fontFamily}; font-size: ${svgFontSizePx}px; color: ${fontColor}; background-color: ${bgColor || 'transparent'}; white-space: pre-wrap; word-wrap: break-word; width: 100%; margin: 0; padding: 0; box-sizing: border-box;">${htmlContent.trim()}</div>
|
|
363
|
+
</foreignObject>
|
|
364
364
|
</g>`;
|
|
365
365
|
}
|
|
366
366
|
/**
|
|
@@ -394,9 +394,9 @@ export class KritzelSvgExportHelper {
|
|
|
394
394
|
return `<tspan x="0" y="${y}" xml:space="preserve">${this.escapeHtml(line)}</tspan>`;
|
|
395
395
|
})
|
|
396
396
|
.join('');
|
|
397
|
-
return `<g transform="${transform}"${opacity}>
|
|
398
|
-
${bgRect}
|
|
399
|
-
<text font-family="${this.escapeHtml(text.fontFamily)}" font-size="${resolvedFontSizePx}" fill="${fontColor}">${tspans}</text>
|
|
397
|
+
return `<g transform="${transform}"${opacity}>
|
|
398
|
+
${bgRect}
|
|
399
|
+
<text font-family="${this.escapeHtml(text.fontFamily)}" font-size="${resolvedFontSizePx}" fill="${fontColor}">${tspans}</text>
|
|
400
400
|
</g>`;
|
|
401
401
|
}
|
|
402
402
|
/**
|
|
@@ -424,8 +424,8 @@ export class KritzelSvgExportHelper {
|
|
|
424
424
|
const width = image.totalWidth / scale;
|
|
425
425
|
const height = image.totalHeight / scale;
|
|
426
426
|
const href = imageDataUrls?.get(image.id) || image.resolvedSrc || image.src || '';
|
|
427
|
-
return `<g transform="${transform}"${opacity}>
|
|
428
|
-
<image href="${href}" x="0" y="0" width="${width}" height="${height}" preserveAspectRatio="xMidYMid meet"/>
|
|
427
|
+
return `<g transform="${transform}"${opacity}>
|
|
428
|
+
<image href="${href}" x="0" y="0" width="${width}" height="${height}" preserveAspectRatio="xMidYMid meet"/>
|
|
429
429
|
</g>`;
|
|
430
430
|
}
|
|
431
431
|
/**
|
|
@@ -445,19 +445,19 @@ export class KritzelSvgExportHelper {
|
|
|
445
445
|
if (rasterSafeForCanvas) {
|
|
446
446
|
// PNG export: render placeholder rect (foreignObject doesn't rasterize to PNG well)
|
|
447
447
|
console.warn('[KritzelCustomElement SVG Export] Custom elements do not serialize well to PNG. Use SVG export or screenshot instead.');
|
|
448
|
-
return `<g transform="${transform}"${opacity}>
|
|
449
|
-
<rect x="0" y="0" width="${width}" height="${height}" fill="#f0f0f0" stroke="#999" stroke-width="1" />
|
|
450
|
-
<text x="${width / 2}" y="${height / 2}" text-anchor="middle" dominant-baseline="middle" font-size="12" fill="#999">[Custom Element]</text>
|
|
448
|
+
return `<g transform="${transform}"${opacity}>
|
|
449
|
+
<rect x="0" y="0" width="${width}" height="${height}" fill="#f0f0f0" stroke="#999" stroke-width="1" />
|
|
450
|
+
<text x="${width / 2}" y="${height / 2}" text-anchor="middle" dominant-baseline="middle" font-size="12" fill="#999">[Custom Element]</text>
|
|
451
451
|
</g>`;
|
|
452
452
|
}
|
|
453
453
|
// SVG export: use foreignObject to embed HTML
|
|
454
454
|
const html = obj.element?.outerHTML || '<div style="border:1px dashed #ccc">Empty</div>';
|
|
455
|
-
return `<g transform="${transform}"${opacity}>
|
|
456
|
-
<foreignObject x="0" y="0" width="${width}" height="${height}">
|
|
457
|
-
<div xmlns="http://www.w3.org/1999/xhtml" style="width:100%;height:100%;overflow:hidden;">
|
|
458
|
-
${html}
|
|
459
|
-
</div>
|
|
460
|
-
</foreignObject>
|
|
455
|
+
return `<g transform="${transform}"${opacity}>
|
|
456
|
+
<foreignObject x="0" y="0" width="${width}" height="${height}">
|
|
457
|
+
<div xmlns="http://www.w3.org/1999/xhtml" style="width:100%;height:100%;overflow:hidden;">
|
|
458
|
+
${html}
|
|
459
|
+
</div>
|
|
460
|
+
</foreignObject>
|
|
461
461
|
</g>`;
|
|
462
462
|
}
|
|
463
463
|
/**
|
|
@@ -477,8 +477,8 @@ export class KritzelSvgExportHelper {
|
|
|
477
477
|
return '';
|
|
478
478
|
}
|
|
479
479
|
const opacity = group.opacity !== 1 ? ` opacity="${group.opacity}"` : '';
|
|
480
|
-
return `<g${opacity}>
|
|
481
|
-
${children}
|
|
480
|
+
return `<g${opacity}>
|
|
481
|
+
${children}
|
|
482
482
|
</g>`;
|
|
483
483
|
}
|
|
484
484
|
/**
|