kritzel-stencil 0.4.20 → 0.4.22
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-Dn19mGl-.js → index-Xav9JFHg.js} +11 -47
- package/dist/cjs/index.cjs.js +51 -2
- package/dist/cjs/kritzel-active-users_47.cjs.entry.js +268 -139
- package/dist/cjs/kritzel-brush-style.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{schema.constants-CY0WWJYd.js → schema.constants-CjN-B633.js} +20 -44
- package/dist/cjs/stencil.cjs.js +2 -2
- package/dist/collection/classes/providers/sync/hocuspocus-sync-provider.class.js +21 -0
- package/dist/collection/classes/providers/sync/websocket-sync-provider.class.js +29 -1
- package/dist/collection/classes/structures/app-state-map.structure.js +19 -6
- package/dist/collection/classes/structures/object-map.structure.js +66 -4
- 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 +51 -18
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.css +80 -80
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +87 -38
- 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 +53 -4
- 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 +61 -56
- 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-CLAz6RJc.js → p-2WiGyky4.js} +3 -3
- package/dist/components/{p-zG-WUBGF.js → p-4SPnZZkH.js} +4 -4
- package/dist/components/{p-MhQxGUvY.js → p-B-585egz.js} +3 -3
- package/dist/components/{p-C9_yBEoX.js → p-B43upypT.js} +10 -30
- package/dist/components/{p-CSKToqUl.js → p-B5SWPDuq.js} +4 -4
- package/dist/components/{p-Covorf4C.js → p-BFYtCsZu.js} +3 -3
- package/dist/components/{p-Csxx9TbU.js → p-BNeE3SiZ.js} +216 -116
- package/dist/components/{p-DYPA7jpg.js → p-BPsKYMH6.js} +2 -2
- package/dist/components/{p-Cx-L_28S.js → p-BoN700-O.js} +3 -3
- package/dist/components/{p-ME1sDz3f.js → p-BozrueXV.js} +2 -2
- package/dist/components/{p-D2VcPEtL.js → p-BrNsOp2v.js} +6 -6
- package/dist/components/{p-BXUx_C0N.js → p-BsLI_BWq.js} +2 -2
- package/dist/components/{p-dAXnRkjA.js → p-C98Eb3_R.js} +5 -5
- package/dist/components/{p-Bxi-Bm49.js → p-CAoN_STZ.js} +2 -2
- package/dist/components/{p-CSWCmyzb.js → p-CF8pLc07.js} +5 -5
- package/dist/components/{p-D3BzgkIE.js → p-CSPYkLLH.js} +2 -2
- package/dist/components/{p-Ck-87E2G.js → p-CSuU8frA.js} +1 -1
- package/dist/components/{p-Di--2boB.js → p-CXpv9Rxe.js} +3 -3
- package/dist/components/{p-o3NYKrVL.js → p-CaBbajU2.js} +3 -3
- package/dist/components/{p-3tBE7SyG.js → p-Cm33td2O.js} +2 -2
- package/dist/components/{p-vDCa_ZDm.js → p-CrHvaLRV.js} +3 -3
- package/dist/components/{p-DT_WBwsw.js → p-CwZ3KKFq.js} +6 -6
- package/dist/components/{p-BZZ3KRPk.js → p-CzW58DHM.js} +3 -3
- package/dist/components/{p-BrqSjRJN.js → p-Czhdc844.js} +3 -3
- package/dist/components/{p-BkXQL5Dl.js → p-D1rjfWgJ.js} +5 -5
- package/dist/components/{p-DPsbNStn.js → p-DB58Oa5V.js} +2 -2
- package/dist/components/{p-DafP9PAA.js → p-DBqoPgev.js} +2 -2
- package/dist/components/{p-BrA9NBEE.js → p-DDTMGbtA.js} +21 -21
- package/dist/components/{p-Dznwo6oc.js → p-DKGg-76-.js} +2 -2
- package/dist/components/{p-Dp1CD4gK.js → p-DVXTPI71.js} +2 -2
- package/dist/components/{p-QSyeAy8R.js → p-DX2nriaq.js} +2 -2
- package/dist/components/{p-CHoOe3FD.js → p-Df3BwVGy.js} +3 -3
- package/dist/components/{p-DcUIO14-.js → p-Dt7-I2Xz.js} +4 -4
- package/dist/components/{p-BShrnlam.js → p-DtnMdWWB.js} +2 -2
- package/dist/components/{p-Ch-KG9To.js → p-DwMqCX2P.js} +3 -3
- package/dist/components/{p-25ExYYPf.js → p-Dx5NfJ0U.js} +9 -9
- package/dist/components/{p-fSV6KVTC.js → p-GKmqCI8r.js} +3 -3
- package/dist/components/{p-CWAChRD5.js → p-HoO86l1o.js} +12 -12
- package/dist/components/{p-Qdo3E8dr.js → p-PjPPCHVL.js} +2 -2
- package/dist/components/{p-D6JycG-I.js → p-bAacqNHq.js} +3 -3
- package/dist/components/{p-DjXQxw9R.js → p-djJSnjAX.js} +3 -3
- package/dist/components/{p-b0J2ktAm.js → p-dsxHDlQ3.js} +7 -7
- package/dist/components/{p-BppcoKoo.js → p-eZXIu4yK.js} +5 -5
- package/dist/components/{p-BFYT03fw.js → p-fL9rl200.js} +3 -3
- package/dist/components/{p-1Q4VnThv.js → p-jIKskj3S.js} +3 -3
- package/dist/components/{p-D0Trc3IQ.js → p-vqEUQ-4Q.js} +5 -5
- package/dist/esm/{index-2va1Pk9z.js → index-Dhio9uis.js} +11 -47
- package/dist/esm/index.js +52 -3
- package/dist/esm/kritzel-active-users_47.entry.js +268 -139
- package/dist/esm/kritzel-brush-style.entry.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{schema.constants-DBvUmuDH.js → schema.constants-DfvqHmxc.js} +20 -44
- package/dist/esm/stencil.js +3 -3
- package/dist/stencil/index.esm.js +52 -3
- package/dist/stencil/{p-DBvUmuDH.js → p-DfvqHmxc.js} +20 -44
- package/dist/stencil/{p-2va1Pk9z.js → p-Dhio9uis.js} +11 -47
- package/dist/stencil/{p-d19d1b82.entry.js → p-ab5c4292.entry.js} +268 -139
- package/dist/stencil/{p-df06ca3a.entry.js → p-fb32cd8f.entry.js} +2 -2
- package/dist/stencil/stencil.esm.js +4 -4
- package/dist/types/classes/providers/sync/hocuspocus-sync-provider.class.d.ts +5 -0
- package/dist/types/classes/providers/sync/websocket-sync-provider.class.d.ts +6 -0
- package/dist/types/classes/structures/app-state-map.structure.d.ts +6 -0
- package/dist/types/classes/structures/object-map.structure.d.ts +26 -2
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +3 -0
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +14 -1
- package/dist/types/components.d.ts +8 -1
- package/dist/types/constants/version.d.ts +1 -1
- package/dist/types/interfaces/sync-provider.interface.d.ts +13 -0
- package/dist/types/stencil-public-runtime.d.ts +0 -12
- package/loader/index.d.ts +1 -1
- package/package.json +1 -1
- package/readme.md +10 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Xav9JFHg.js');
|
|
4
4
|
|
|
5
5
|
const kritzelBrushStyleCss = () => `:host{display:flex;align-items:flex-start;gap:8px;padding:8px;box-sizing:border-box;width:100%}.brush-style-button{display:flex;justify-content:center;align-items:center;width:42px;height:32px;padding:0;border:none;outline:none;background:none;border-radius:0;color:var(--control-text-color);font-weight:bold;-webkit-tap-highlight-color:transparent}.font-style-button:not(:last-child){border-right:1px solid #333333}.font-style-button:hover{background-color:var(--control-hover-bg)}.font-style-button:active{background-color:var(--control-active-bg)}.font-style-button.selected,.font-style-button.selected:hover,.font-style-button.selected:active{background-color:var(--control-selected-bg);color:var(--control-selected-color)}`;
|
|
6
6
|
|
|
@@ -23,7 +23,7 @@ const KritzelBrushStyle = class {
|
|
|
23
23
|
value: option.value,
|
|
24
24
|
label: option.label,
|
|
25
25
|
}));
|
|
26
|
-
return (index.h(index.Host, { key: '
|
|
26
|
+
return (index.h(index.Host, { key: '7b05e93ce8d28c23503e4ca358a487165169f1ad' }, index.h("kritzel-dropdown", { key: 'a8f2f30762b339411cd3995482c3bc658855f749', options: dropdownOptions, value: this.type, onValueChanged: event => this.handleDropdownValueChange(event) }, index.h("button", { key: 'ac06462897a0fbd5011533095fafb7491a75508a', class: "brush-style-button", slot: "prefix" }, index.h("kritzel-icon", { key: 'caee4c657c7fee478b1038ebd2ef3b502cf73e5e', name: this.type, size: 16 })))));
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
KritzelBrushStyle.style = kritzelBrushStyleCss();
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -5754,11 +5754,10 @@ class Fitter {
|
|
|
5754
5754
|
}
|
|
5755
5755
|
openMore() {
|
|
5756
5756
|
let { content, openStart, openEnd } = this.unplaced;
|
|
5757
|
-
|
|
5757
|
+
let inner = contentAt(content, openStart);
|
|
5758
|
+
if (!inner.childCount || inner.firstChild.isLeaf)
|
|
5758
5759
|
return false;
|
|
5759
|
-
|
|
5760
|
-
openEnd++;
|
|
5761
|
-
this.unplaced = new Slice(content, openStart + 1, openEnd);
|
|
5760
|
+
this.unplaced = new Slice(content, openStart + 1, Math.max(openEnd, inner.size + openStart >= content.size - openEnd ? openStart + 1 : 0));
|
|
5762
5761
|
return true;
|
|
5763
5762
|
}
|
|
5764
5763
|
dropNode() {
|
|
@@ -5928,14 +5927,6 @@ function invalidMarks(type, fragment, start) {
|
|
|
5928
5927
|
function definesContent(type) {
|
|
5929
5928
|
return type.spec.defining || type.spec.definingForContent;
|
|
5930
5929
|
}
|
|
5931
|
-
function maxOpen(frag, side) {
|
|
5932
|
-
for (let count = 0;; count++) {
|
|
5933
|
-
let ch = side < 0 ? frag.firstChild : frag.lastChild;
|
|
5934
|
-
if (!ch || ch.isAtom)
|
|
5935
|
-
return count;
|
|
5936
|
-
frag = ch.content;
|
|
5937
|
-
}
|
|
5938
|
-
}
|
|
5939
5930
|
function replaceRange(tr, from, to, slice) {
|
|
5940
5931
|
if (!slice.size)
|
|
5941
5932
|
return tr.deleteRange(from, to);
|
|
@@ -8640,8 +8631,7 @@ class WidgetViewDesc extends ViewDesc {
|
|
|
8640
8631
|
wrap.appendChild(dom);
|
|
8641
8632
|
dom = wrap;
|
|
8642
8633
|
}
|
|
8643
|
-
|
|
8644
|
-
dom.contentEditable = "false";
|
|
8634
|
+
dom.contentEditable = "false";
|
|
8645
8635
|
dom.classList.add("ProseMirror-widget");
|
|
8646
8636
|
}
|
|
8647
8637
|
super(parent, [], dom, null);
|
|
@@ -10489,14 +10479,8 @@ function maybeWrapTrusted(html) {
|
|
|
10489
10479
|
// With the require-trusted-types-for CSP, Chrome will block
|
|
10490
10480
|
// innerHTML, even on a detached document. This wraps the string in
|
|
10491
10481
|
// a way that makes the browser allow us to use its parser again.
|
|
10492
|
-
if (!_policy)
|
|
10493
|
-
|
|
10494
|
-
try {
|
|
10495
|
-
return _policy.createHTML(html);
|
|
10496
|
-
}
|
|
10497
|
-
catch (_a) { }
|
|
10498
|
-
_policy = trustedTypes.createPolicy("ProseMirrorClipboard", { createHTML: (s) => s });
|
|
10499
|
-
}
|
|
10482
|
+
if (!_policy)
|
|
10483
|
+
_policy = trustedTypes.defaultPolicy || trustedTypes.createPolicy("ProseMirrorClipboard", { createHTML: (s) => s });
|
|
10500
10484
|
return _policy.createHTML(html);
|
|
10501
10485
|
}
|
|
10502
10486
|
function readHTML(html) {
|
|
@@ -10553,12 +10537,6 @@ function addContext(slice, context) {
|
|
|
10553
10537
|
let type = schema.nodes[array[i]];
|
|
10554
10538
|
if (!type || type.hasRequiredAttrs())
|
|
10555
10539
|
break;
|
|
10556
|
-
try {
|
|
10557
|
-
type.checkAttrs(array[i + 1]);
|
|
10558
|
-
}
|
|
10559
|
-
catch (e) {
|
|
10560
|
-
break;
|
|
10561
|
-
}
|
|
10562
10540
|
content = Fragment.from(type.create(array[i + 1], content));
|
|
10563
10541
|
openStart++;
|
|
10564
10542
|
openEnd++;
|
|
@@ -14217,20 +14195,16 @@ a custom function to determine the type of the newly split off block.
|
|
|
14217
14195
|
*/
|
|
14218
14196
|
function splitBlockAs(splitNode) {
|
|
14219
14197
|
return (state, dispatch) => {
|
|
14198
|
+
let { $from} = state.selection;
|
|
14220
14199
|
if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {
|
|
14221
|
-
let { $from } = state.selection;
|
|
14222
14200
|
if (!$from.parentOffset || !canSplit(state.doc, $from.pos))
|
|
14223
14201
|
return false;
|
|
14224
14202
|
if (dispatch)
|
|
14225
14203
|
dispatch(state.tr.split($from.pos).scrollIntoView());
|
|
14226
14204
|
return true;
|
|
14227
14205
|
}
|
|
14228
|
-
if (
|
|
14206
|
+
if (!$from.depth)
|
|
14229
14207
|
return false;
|
|
14230
|
-
let tr = state.tr;
|
|
14231
|
-
if (!state.selection.empty && (state.selection instanceof TextSelection || state.selection instanceof AllSelection))
|
|
14232
|
-
tr.deleteSelection();
|
|
14233
|
-
let { $from } = tr.selection, mapFrom = tr.steps.length;
|
|
14234
14208
|
let types = [];
|
|
14235
14209
|
let splitDepth, deflt, atEnd = false, atStart = false;
|
|
14236
14210
|
for (let d = $from.depth;; d--) {
|
|
@@ -14249,7 +14223,10 @@ function splitBlockAs(splitNode) {
|
|
|
14249
14223
|
types.unshift(null);
|
|
14250
14224
|
}
|
|
14251
14225
|
}
|
|
14252
|
-
let
|
|
14226
|
+
let tr = state.tr;
|
|
14227
|
+
if (state.selection instanceof TextSelection || state.selection instanceof AllSelection)
|
|
14228
|
+
tr.deleteSelection();
|
|
14229
|
+
let splitPos = tr.mapping.map($from.pos);
|
|
14253
14230
|
let can = canSplit(tr.doc, splitPos, types.length, types);
|
|
14254
14231
|
if (!can) {
|
|
14255
14232
|
types[0] = deflt ? { type: deflt } : null;
|
|
@@ -14259,10 +14236,9 @@ function splitBlockAs(splitNode) {
|
|
|
14259
14236
|
return false;
|
|
14260
14237
|
tr.split(splitPos, types.length, types);
|
|
14261
14238
|
if (!atEnd && atStart && $from.node(splitDepth).type != deflt) {
|
|
14262
|
-
let
|
|
14263
|
-
let first = mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);
|
|
14239
|
+
let first = tr.mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);
|
|
14264
14240
|
if (deflt && $from.node(splitDepth - 1).canReplaceWith($first.index(), $first.index() + 1, deflt))
|
|
14265
|
-
tr.setNodeMarkup(mapping.map($from.before(splitDepth)), deflt);
|
|
14241
|
+
tr.setNodeMarkup(tr.mapping.map($from.before(splitDepth)), deflt);
|
|
14266
14242
|
}
|
|
14267
14243
|
if (dispatch)
|
|
14268
14244
|
dispatch(tr.scrollIntoView());
|
|
@@ -22903,12 +22879,12 @@ class KritzelCursorHelper {
|
|
|
22903
22879
|
// We rotate around the center of the SVG canvas
|
|
22904
22880
|
const center = size / 2;
|
|
22905
22881
|
// We use a group to apply the rotation
|
|
22906
|
-
const svg = `
|
|
22907
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 ${size} ${size}">
|
|
22908
|
-
<g transform="rotate(${rotation} ${center} ${center})">
|
|
22909
|
-
${content}
|
|
22910
|
-
</g>
|
|
22911
|
-
</svg>
|
|
22882
|
+
const svg = `
|
|
22883
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 ${size} ${size}">
|
|
22884
|
+
<g transform="rotate(${rotation} ${center} ${center})">
|
|
22885
|
+
${content}
|
|
22886
|
+
</g>
|
|
22887
|
+
</svg>
|
|
22912
22888
|
`;
|
|
22913
22889
|
// Encode the SVG for use in a data URI
|
|
22914
22890
|
// We need to be careful with encoding to ensure it works across browsers
|
package/dist/cjs/stencil.cjs.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-Xav9JFHg.js');
|
|
4
4
|
var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
5
5
|
|
|
6
6
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
7
|
/*
|
|
8
|
-
Stencil Client Patch Browser v4.
|
|
8
|
+
Stencil Client Patch Browser v4.43.5 | MIT Licensed | https://stenciljs.com
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
var patchBrowser = () => {
|
|
@@ -17,9 +17,14 @@ export class HocuspocusSyncProvider {
|
|
|
17
17
|
_connectionStatus = 'disconnected';
|
|
18
18
|
visibilityHandler = null;
|
|
19
19
|
onlineHandler = null;
|
|
20
|
+
syncedResolvers = [];
|
|
20
21
|
get awareness() {
|
|
21
22
|
return this.provider.awareness;
|
|
22
23
|
}
|
|
24
|
+
/** HocuspocusProvider applies remote updates with itself as the Yjs transaction origin. */
|
|
25
|
+
get updateOrigin() {
|
|
26
|
+
return this.provider;
|
|
27
|
+
}
|
|
23
28
|
get connectionStatus() {
|
|
24
29
|
return this._connectionStatus;
|
|
25
30
|
}
|
|
@@ -76,6 +81,7 @@ export class HocuspocusSyncProvider {
|
|
|
76
81
|
}
|
|
77
82
|
this.isSynced = true;
|
|
78
83
|
this._connectionStatus = 'synced';
|
|
84
|
+
this.releaseSyncedWaiters();
|
|
79
85
|
if (!options?.quiet) {
|
|
80
86
|
console.info(`Hocuspocus synced: ${name}`);
|
|
81
87
|
}
|
|
@@ -286,6 +292,19 @@ export class HocuspocusSyncProvider {
|
|
|
286
292
|
this.disconnect();
|
|
287
293
|
return this.connect();
|
|
288
294
|
}
|
|
295
|
+
releaseSyncedWaiters() {
|
|
296
|
+
const resolvers = this.syncedResolvers;
|
|
297
|
+
this.syncedResolvers = [];
|
|
298
|
+
resolvers.forEach(resolve => resolve());
|
|
299
|
+
}
|
|
300
|
+
async whenSynced() {
|
|
301
|
+
if (this.isSynced || this.isDestroyed || this.provider.isSynced) {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
return new Promise(resolve => {
|
|
305
|
+
this.syncedResolvers.push(resolve);
|
|
306
|
+
});
|
|
307
|
+
}
|
|
289
308
|
disconnect() {
|
|
290
309
|
// Cancel any pending connection attempt
|
|
291
310
|
if (this.connectTimeout) {
|
|
@@ -307,6 +326,7 @@ export class HocuspocusSyncProvider {
|
|
|
307
326
|
this.isConnected = false;
|
|
308
327
|
this.isSynced = false;
|
|
309
328
|
this._connectionStatus = 'disconnected';
|
|
329
|
+
this.releaseSyncedWaiters();
|
|
310
330
|
}
|
|
311
331
|
destroy() {
|
|
312
332
|
// Mark as destroyed first to prevent any callbacks from doing work
|
|
@@ -326,5 +346,6 @@ export class HocuspocusSyncProvider {
|
|
|
326
346
|
this.isConnected = false;
|
|
327
347
|
this.isSynced = false;
|
|
328
348
|
this._connectionStatus = 'disconnected';
|
|
349
|
+
this.releaseSyncedWaiters();
|
|
329
350
|
}
|
|
330
351
|
}
|
|
@@ -8,9 +8,15 @@ export class WebSocketSyncProvider {
|
|
|
8
8
|
provider;
|
|
9
9
|
isConnected = false;
|
|
10
10
|
_quiet = false;
|
|
11
|
+
_isSynced = false;
|
|
12
|
+
_syncedResolvers = [];
|
|
11
13
|
get awareness() {
|
|
12
14
|
return this.provider.awareness;
|
|
13
15
|
}
|
|
16
|
+
/** y-websocket applies remote updates with the underlying provider as the Yjs transaction origin. */
|
|
17
|
+
get updateOrigin() {
|
|
18
|
+
return this.provider;
|
|
19
|
+
}
|
|
14
20
|
constructor(docName, doc, options) {
|
|
15
21
|
const url = options?.url || 'ws://localhost:1234';
|
|
16
22
|
const roomName = options?.roomName || docName;
|
|
@@ -57,11 +63,29 @@ export class WebSocketSyncProvider {
|
|
|
57
63
|
}
|
|
58
64
|
});
|
|
59
65
|
this.provider.on('sync', (synced) => {
|
|
60
|
-
if (synced
|
|
66
|
+
if (!synced) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this._isSynced = true;
|
|
70
|
+
this.releaseSyncedWaiters();
|
|
71
|
+
if (!this._quiet) {
|
|
61
72
|
console.info('WebSocket synced');
|
|
62
73
|
}
|
|
63
74
|
});
|
|
64
75
|
}
|
|
76
|
+
releaseSyncedWaiters() {
|
|
77
|
+
const resolvers = this._syncedResolvers;
|
|
78
|
+
this._syncedResolvers = [];
|
|
79
|
+
resolvers.forEach(resolve => resolve());
|
|
80
|
+
}
|
|
81
|
+
async whenSynced() {
|
|
82
|
+
if (this._isSynced || this.provider.synced) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
return new Promise(resolve => {
|
|
86
|
+
this._syncedResolvers.push(resolve);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
65
89
|
async connect() {
|
|
66
90
|
if (this.isConnected) {
|
|
67
91
|
return;
|
|
@@ -93,6 +117,8 @@ export class WebSocketSyncProvider {
|
|
|
93
117
|
this.provider.disconnect();
|
|
94
118
|
}
|
|
95
119
|
this.isConnected = false;
|
|
120
|
+
this._isSynced = false;
|
|
121
|
+
this.releaseSyncedWaiters();
|
|
96
122
|
}
|
|
97
123
|
async reconnect() {
|
|
98
124
|
this.disconnect();
|
|
@@ -103,5 +129,7 @@ export class WebSocketSyncProvider {
|
|
|
103
129
|
this.provider.destroy();
|
|
104
130
|
}
|
|
105
131
|
this.isConnected = false;
|
|
132
|
+
this._isSynced = false;
|
|
133
|
+
this.releaseSyncedWaiters();
|
|
106
134
|
}
|
|
107
135
|
}
|
|
@@ -21,6 +21,7 @@ export class KritzelAppStateMap {
|
|
|
21
21
|
_isReady = false;
|
|
22
22
|
_onRemoteChangeCallback = null;
|
|
23
23
|
_workspacesObserver = null;
|
|
24
|
+
_networkSyncPromise = null;
|
|
24
25
|
/**
|
|
25
26
|
* Indicates whether the app state map has been initialized and is ready for use.
|
|
26
27
|
* @returns True if initialized and all providers are connected, false otherwise.
|
|
@@ -28,6 +29,13 @@ export class KritzelAppStateMap {
|
|
|
28
29
|
get isReady() {
|
|
29
30
|
return this._isReady;
|
|
30
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Settles when network providers finish their initial sync (or fail/time out).
|
|
34
|
+
* Resolves immediately when no network providers are configured.
|
|
35
|
+
*/
|
|
36
|
+
whenNetworkSynced() {
|
|
37
|
+
return this._networkSyncPromise ?? Promise.resolve();
|
|
38
|
+
}
|
|
31
39
|
/**
|
|
32
40
|
* Indicates whether any configured sync provider replicates over the network.
|
|
33
41
|
* Used by the engine to warn when a matching remote asset storage
|
|
@@ -112,12 +120,16 @@ export class KritzelAppStateMap {
|
|
|
112
120
|
if (showSyncProviderInfo && networkProviders.length > 0) {
|
|
113
121
|
console.info(`[Kritzel] App-state network providers connecting in background: ${networkProviders.length}`);
|
|
114
122
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
123
|
+
const networkConnectPromises = networkProviders.map(provider => provider
|
|
124
|
+
.connect()
|
|
125
|
+
.then(() => provider.whenSynced?.())
|
|
126
|
+
.catch(err => {
|
|
127
|
+
if (showSyncProviderInfo) {
|
|
128
|
+
console.error(`[Kritzel] Network sync provider "${provider.constructor.name}" failed to connect:`, err);
|
|
129
|
+
}
|
|
130
|
+
}));
|
|
131
|
+
if (networkConnectPromises.length > 0) {
|
|
132
|
+
this._networkSyncPromise = Promise.allSettled(networkConnectPromises).then(() => undefined);
|
|
121
133
|
}
|
|
122
134
|
this._isReady = true;
|
|
123
135
|
// Run any pending schema migrations before loading data
|
|
@@ -442,6 +454,7 @@ export class KritzelAppStateMap {
|
|
|
442
454
|
// Clear remaining references
|
|
443
455
|
this._core = null;
|
|
444
456
|
this._onRemoteChangeCallback = null;
|
|
457
|
+
this._networkSyncPromise = null;
|
|
445
458
|
this._isReady = false;
|
|
446
459
|
}
|
|
447
460
|
}
|
|
@@ -37,6 +37,10 @@ export class KritzelObjectMap {
|
|
|
37
37
|
_awarenessChangeHandler = null;
|
|
38
38
|
_awarenessChangeCallbacks = [];
|
|
39
39
|
_objectsChangeCallbacks = [];
|
|
40
|
+
_remoteChangesCallbacks = [];
|
|
41
|
+
_docUpdateHandler = null;
|
|
42
|
+
_remoteOrigins = new Set();
|
|
43
|
+
_appliedRemoteChanges = false;
|
|
40
44
|
_lastAwarenessEmitTime = 0;
|
|
41
45
|
_awarenessEmitTimeout = null;
|
|
42
46
|
AWARENESS_THROTTLE_INTERVAL = 100; // milliseconds
|
|
@@ -60,12 +64,44 @@ export class KritzelObjectMap {
|
|
|
60
64
|
return this._isReady;
|
|
61
65
|
}
|
|
62
66
|
/**
|
|
63
|
-
* Promise that settles when network providers finish connecting
|
|
64
|
-
* Resolves immediately if no network providers.
|
|
67
|
+
* Promise that settles when network providers finish connecting and complete
|
|
68
|
+
* their Yjs sync handshake. Resolves immediately if no network providers.
|
|
65
69
|
*/
|
|
66
70
|
whenNetworkSynced() {
|
|
67
71
|
return this._networkSyncPromise ?? Promise.resolve();
|
|
68
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Whether any configured provider synchronizes over the network.
|
|
75
|
+
*/
|
|
76
|
+
get hasNetworkSyncProvider() {
|
|
77
|
+
return this._providers.some(provider => provider.type === 'network');
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Whether remote-originated changes can be told apart from local writes.
|
|
81
|
+
* Requires every network provider to expose its Yjs update origin.
|
|
82
|
+
*/
|
|
83
|
+
get supportsRemoteChangeDetection() {
|
|
84
|
+
const networkProviders = this._providers.filter(provider => provider.type === 'network');
|
|
85
|
+
return networkProviders.length > 0 && networkProviders.every(provider => provider.updateOrigin !== undefined);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Whether at least one update originating from a network provider has been
|
|
89
|
+
* applied to this document. Stays `false` when the remote held no data the
|
|
90
|
+
* local document was missing, because Yjs suppresses empty updates.
|
|
91
|
+
*/
|
|
92
|
+
get hasAppliedRemoteChanges() {
|
|
93
|
+
return this._appliedRemoteChanges;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Registers a callback invoked whenever a network provider applies changes to this document.
|
|
97
|
+
* @returns A function that unregisters the callback.
|
|
98
|
+
*/
|
|
99
|
+
onRemoteChangesApplied(callback) {
|
|
100
|
+
this._remoteChangesCallbacks.push(callback);
|
|
101
|
+
return () => {
|
|
102
|
+
this._remoteChangesCallbacks = this._remoteChangesCallbacks.filter(registered => registered !== callback);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
69
105
|
/**
|
|
70
106
|
* Returns the Yjs Awareness instance, if a network provider is available.
|
|
71
107
|
*/
|
|
@@ -308,6 +344,22 @@ export class KritzelObjectMap {
|
|
|
308
344
|
const providerList = this._providers.map(p => `${p.constructor.name} (${p.type})`).join(', ');
|
|
309
345
|
console.info(`[Kritzel] Workspace sync providers initialized for ${docName}: ${providerList || 'none'}`);
|
|
310
346
|
}
|
|
347
|
+
// Registered before any provider connects so no remote update can be missed.
|
|
348
|
+
for (const provider of this._providers) {
|
|
349
|
+
if (provider.type === 'network' && provider.updateOrigin !== undefined) {
|
|
350
|
+
this._remoteOrigins.add(provider.updateOrigin);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
this._docUpdateHandler = (_update, origin) => {
|
|
354
|
+
if (!this._remoteOrigins.has(origin)) {
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
this._appliedRemoteChanges = true;
|
|
358
|
+
for (const callback of [...this._remoteChangesCallbacks]) {
|
|
359
|
+
callback();
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
this._ydoc.on('update', this._docUpdateHandler);
|
|
311
363
|
// captureTimeout is effectively infinite — undo-step boundaries are
|
|
312
364
|
// marked explicitly via markUndoBoundary() in insert/remove/reset and
|
|
313
365
|
// at stroke/gesture boundaries in the tools. This prevents a single
|
|
@@ -361,12 +413,15 @@ export class KritzelObjectMap {
|
|
|
361
413
|
if (showSyncProviderInfo && networkProviders.length > 0) {
|
|
362
414
|
console.info(`[Kritzel] Workspace network providers connecting in background: ${networkProviders.length}`);
|
|
363
415
|
}
|
|
364
|
-
const networkConnectPromises = networkProviders.map(provider => provider
|
|
416
|
+
const networkConnectPromises = networkProviders.map(provider => provider
|
|
417
|
+
.connect()
|
|
418
|
+
.then(() => provider.whenSynced?.())
|
|
419
|
+
.catch(err => {
|
|
365
420
|
if (showSyncProviderInfo) {
|
|
366
421
|
console.error(`[Kritzel] Network sync provider "${provider.constructor.name}" failed to connect:`, err);
|
|
367
422
|
}
|
|
368
423
|
}));
|
|
369
|
-
//
|
|
424
|
+
// Settles once remote data has been reconciled, not merely once the transport connected
|
|
370
425
|
this._networkSyncPromise = networkConnectPromises.length > 0 ? Promise.allSettled(networkConnectPromises).then(() => undefined) : null;
|
|
371
426
|
this._isReady = true;
|
|
372
427
|
// Find the first provider that exposes awareness (network providers)
|
|
@@ -1031,6 +1086,13 @@ export class KritzelObjectMap {
|
|
|
1031
1086
|
this._objectsMap.unobserve(this._objectsObserver);
|
|
1032
1087
|
this._objectsObserver = null;
|
|
1033
1088
|
}
|
|
1089
|
+
if (this._ydoc && this._docUpdateHandler) {
|
|
1090
|
+
this._ydoc.off('update', this._docUpdateHandler);
|
|
1091
|
+
}
|
|
1092
|
+
this._docUpdateHandler = null;
|
|
1093
|
+
this._remoteOrigins.clear();
|
|
1094
|
+
this._remoteChangesCallbacks = [];
|
|
1095
|
+
this._appliedRemoteChanges = false;
|
|
1034
1096
|
// Remove undo manager event listeners
|
|
1035
1097
|
if (this._undoManager) {
|
|
1036
1098
|
if (this._stackItemAddedHandler) {
|