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.
Files changed (225) hide show
  1. package/LICENSE +21 -21
  2. package/LICENSE.md +49 -49
  3. package/dist/cjs/{index-Xav9JFHg.js → index-Dn19mGl-.js} +47 -11
  4. package/dist/cjs/index.cjs.js +2 -51
  5. package/dist/cjs/kritzel-active-users_47.cjs.entry.js +198 -231
  6. package/dist/cjs/kritzel-brush-style.cjs.entry.js +2 -2
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{schema.constants-CjN-B633.js → schema.constants-CY0WWJYd.js} +44 -20
  9. package/dist/cjs/stencil.cjs.js +2 -2
  10. package/dist/collection/classes/providers/sync/hocuspocus-sync-provider.class.js +0 -21
  11. package/dist/collection/classes/providers/sync/websocket-sync-provider.class.js +1 -29
  12. package/dist/collection/classes/structures/app-state-map.structure.js +1 -4
  13. package/dist/collection/classes/structures/object-map.structure.js +4 -66
  14. package/dist/collection/collection-manifest.json +1 -1
  15. package/dist/collection/components/core/kritzel-awareness-cursors/kritzel-awareness-cursors.css +115 -115
  16. package/dist/collection/components/core/kritzel-awareness-cursors/kritzel-awareness-cursors.js +1 -1
  17. package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.css +10 -10
  18. package/dist/collection/components/core/kritzel-cursor-trail/kritzel-cursor-trail.js +1 -1
  19. package/dist/collection/components/core/kritzel-editor/kritzel-editor.css +160 -160
  20. package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +18 -51
  21. package/dist/collection/components/core/kritzel-engine/kritzel-engine.css +80 -80
  22. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +102 -65
  23. package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.css +29 -29
  24. package/dist/collection/components/core/kritzel-watermark/kritzel-watermark.js +2 -2
  25. package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.css +58 -58
  26. package/dist/collection/components/shared/kritzel-avatar/kritzel-avatar.js +3 -3
  27. package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.css +42 -42
  28. package/dist/collection/components/shared/kritzel-brush-style/kritzel-brush-style.js +3 -3
  29. package/dist/collection/components/shared/kritzel-button/kritzel-button.css +73 -73
  30. package/dist/collection/components/shared/kritzel-button/kritzel-button.js +2 -2
  31. package/dist/collection/components/shared/kritzel-color/kritzel-color.css +24 -24
  32. package/dist/collection/components/shared/kritzel-color/kritzel-color.js +2 -2
  33. package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.css +46 -46
  34. package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.js +1 -1
  35. package/dist/collection/components/shared/kritzel-dialog/kritzel-dialog.css +209 -209
  36. package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.css +190 -190
  37. package/dist/collection/components/shared/kritzel-dropdown/kritzel-dropdown.js +2 -2
  38. package/dist/collection/components/shared/kritzel-font/kritzel-font.css +10 -10
  39. package/dist/collection/components/shared/kritzel-font/kritzel-font.js +1 -1
  40. package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.css +48 -48
  41. package/dist/collection/components/shared/kritzel-font-family/kritzel-font-family.js +2 -2
  42. package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.css +30 -30
  43. package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.js +1 -1
  44. package/dist/collection/components/shared/kritzel-icon/kritzel-icon.css +18 -18
  45. package/dist/collection/components/shared/kritzel-input/kritzel-input.css +69 -69
  46. package/dist/collection/components/shared/kritzel-input/kritzel-input.js +1 -1
  47. package/dist/collection/components/shared/kritzel-line-endings/kritzel-line-endings.css +60 -60
  48. package/dist/collection/components/shared/kritzel-line-endings/kritzel-line-endings.js +3 -3
  49. package/dist/collection/components/shared/kritzel-master-detail/kritzel-master-detail.css +190 -190
  50. package/dist/collection/components/shared/kritzel-master-detail/kritzel-master-detail.js +3 -3
  51. package/dist/collection/components/shared/kritzel-menu/kritzel-menu.css +34 -34
  52. package/dist/collection/components/shared/kritzel-menu/kritzel-menu.js +1 -1
  53. package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.css +166 -166
  54. package/dist/collection/components/shared/kritzel-menu-item/kritzel-menu-item.js +2 -2
  55. package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.css +102 -102
  56. package/dist/collection/components/shared/kritzel-numeric-input/kritzel-numeric-input.js +1 -1
  57. package/dist/collection/components/shared/kritzel-opacity-slider/kritzel-opacity-slider.css +85 -85
  58. package/dist/collection/components/shared/kritzel-opacity-slider/kritzel-opacity-slider.js +1 -1
  59. package/dist/collection/components/shared/kritzel-pill-tabs/kritzel-pill-tabs.css +68 -68
  60. package/dist/collection/components/shared/kritzel-pill-tabs/kritzel-pill-tabs.js +2 -2
  61. package/dist/collection/components/shared/kritzel-portal/kritzel-portal.js +1 -1
  62. package/dist/collection/components/shared/kritzel-shape-fill/kritzel-shape-fill.css +47 -47
  63. package/dist/collection/components/shared/kritzel-shape-fill/kritzel-shape-fill.js +4 -4
  64. package/dist/collection/components/shared/kritzel-slide-toggle/kritzel-slide-toggle.css +48 -48
  65. package/dist/collection/components/shared/kritzel-slide-toggle/kritzel-slide-toggle.js +1 -1
  66. package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.css +78 -78
  67. package/dist/collection/components/shared/kritzel-split-button/kritzel-split-button.js +1 -1
  68. package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.css +37 -37
  69. package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.js +1 -1
  70. package/dist/collection/components/shared/kritzel-sync-indicator/kritzel-sync-indicator.css +50 -50
  71. package/dist/collection/components/shared/kritzel-sync-indicator/kritzel-sync-indicator.js +1 -1
  72. package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.css +18 -18
  73. package/dist/collection/components/shared/kritzel-tooltip/kritzel-tooltip.js +2 -2
  74. package/dist/collection/components/ui/kritzel-active-users/kritzel-active-users.css +65 -65
  75. package/dist/collection/components/ui/kritzel-back-to-content/kritzel-back-to-content.css +42 -42
  76. package/dist/collection/components/ui/kritzel-back-to-content/kritzel-back-to-content.js +1 -1
  77. package/dist/collection/components/ui/kritzel-context-menu/kritzel-context-menu.css +112 -112
  78. package/dist/collection/components/ui/kritzel-controls/kritzel-controls.css +331 -331
  79. package/dist/collection/components/ui/kritzel-controls/kritzel-controls.js +6 -6
  80. package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.css +11 -11
  81. package/dist/collection/components/ui/kritzel-current-user/kritzel-current-user.js +1 -1
  82. package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.css +39 -39
  83. package/dist/collection/components/ui/kritzel-current-user-dialog/kritzel-current-user-dialog.js +1 -1
  84. package/dist/collection/components/ui/kritzel-export/kritzel-export.css +89 -89
  85. package/dist/collection/components/ui/kritzel-export/kritzel-export.js +1 -1
  86. package/dist/collection/components/ui/kritzel-loading-overlay/kritzel-loading-overlay.css +50 -50
  87. package/dist/collection/components/ui/kritzel-loading-overlay/kritzel-loading-overlay.js +1 -1
  88. package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.css +98 -98
  89. package/dist/collection/components/ui/kritzel-login-dialog/kritzel-login-dialog.js +1 -1
  90. package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.css +58 -58
  91. package/dist/collection/components/ui/kritzel-more-menu/kritzel-more-menu.js +2 -2
  92. package/dist/collection/components/ui/kritzel-notification-card/kritzel-notification-card.css +101 -101
  93. package/dist/collection/components/ui/kritzel-settings/kritzel-settings.css +137 -137
  94. package/dist/collection/components/ui/kritzel-settings/kritzel-settings.js +1 -1
  95. package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.css +150 -150
  96. package/dist/collection/components/ui/kritzel-share-dialog/kritzel-share-dialog.js +2 -2
  97. package/dist/collection/components/ui/kritzel-tool-config/kritzel-tool-config.css +38 -38
  98. package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.css +45 -45
  99. package/dist/collection/components/ui/kritzel-utility-panel/kritzel-utility-panel.js +1 -1
  100. package/dist/collection/components/ui/kritzel-workspace-manager/kritzel-workspace-manager.css +16 -16
  101. package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.css +72 -72
  102. package/dist/collection/components/ui/kritzel-zoom-panel/kritzel-zoom-panel.js +1 -1
  103. package/dist/collection/constants/version.js +1 -1
  104. package/dist/collection/helpers/cursor.helper.js +6 -6
  105. package/dist/collection/helpers/svg-export.helper.js +41 -41
  106. package/dist/components/index.js +4 -53
  107. package/dist/components/kritzel-active-users.js +1 -1
  108. package/dist/components/kritzel-avatar.js +1 -1
  109. package/dist/components/kritzel-awareness-cursors.js +1 -1
  110. package/dist/components/kritzel-back-to-content.js +1 -1
  111. package/dist/components/kritzel-brush-style.js +4 -4
  112. package/dist/components/kritzel-button.js +1 -1
  113. package/dist/components/kritzel-color-palette.js +1 -1
  114. package/dist/components/kritzel-color.js +1 -1
  115. package/dist/components/kritzel-context-menu.js +1 -1
  116. package/dist/components/kritzel-controls.js +1 -1
  117. package/dist/components/kritzel-current-user-dialog.js +1 -1
  118. package/dist/components/kritzel-current-user.js +1 -1
  119. package/dist/components/kritzel-cursor-trail.js +1 -1
  120. package/dist/components/kritzel-dialog.js +1 -1
  121. package/dist/components/kritzel-dropdown.js +1 -1
  122. package/dist/components/kritzel-editor.js +56 -61
  123. package/dist/components/kritzel-engine.js +1 -1
  124. package/dist/components/kritzel-export.js +1 -1
  125. package/dist/components/kritzel-font-family.js +1 -1
  126. package/dist/components/kritzel-font-size.js +1 -1
  127. package/dist/components/kritzel-font.js +1 -1
  128. package/dist/components/kritzel-icon.js +1 -1
  129. package/dist/components/kritzel-input.js +1 -1
  130. package/dist/components/kritzel-line-endings.js +1 -1
  131. package/dist/components/kritzel-loading-overlay.js +1 -1
  132. package/dist/components/kritzel-login-dialog.js +1 -1
  133. package/dist/components/kritzel-master-detail.js +1 -1
  134. package/dist/components/kritzel-menu-item.js +1 -1
  135. package/dist/components/kritzel-menu.js +1 -1
  136. package/dist/components/kritzel-more-menu.js +1 -1
  137. package/dist/components/kritzel-notification-card.js +1 -1
  138. package/dist/components/kritzel-numeric-input.js +1 -1
  139. package/dist/components/kritzel-opacity-slider.js +1 -1
  140. package/dist/components/kritzel-pill-tabs.js +1 -1
  141. package/dist/components/kritzel-portal.js +1 -1
  142. package/dist/components/kritzel-settings.js +1 -1
  143. package/dist/components/kritzel-shape-fill.js +1 -1
  144. package/dist/components/kritzel-share-dialog.js +1 -1
  145. package/dist/components/kritzel-slide-toggle.js +1 -1
  146. package/dist/components/kritzel-split-button.js +1 -1
  147. package/dist/components/kritzel-stroke-size.js +1 -1
  148. package/dist/components/kritzel-sync-indicator.js +1 -1
  149. package/dist/components/kritzel-tool-config.js +1 -1
  150. package/dist/components/kritzel-tooltip.js +1 -1
  151. package/dist/components/kritzel-utility-panel.js +1 -1
  152. package/dist/components/kritzel-watermark.js +1 -1
  153. package/dist/components/kritzel-workspace-manager.js +1 -1
  154. package/dist/components/kritzel-zoom-panel.js +1 -1
  155. package/dist/components/{p-jIKskj3S.js → p-1Q4VnThv.js} +3 -3
  156. package/dist/components/{p-Cm33td2O.js → p-3tBE7SyG.js} +2 -2
  157. package/dist/components/{p-fL9rl200.js → p-BFYT03fw.js} +3 -3
  158. package/dist/components/{p-DtnMdWWB.js → p-BShrnlam.js} +2 -2
  159. package/dist/components/{p-BsLI_BWq.js → p-BXUx_C0N.js} +2 -2
  160. package/dist/components/{p-CzW58DHM.js → p-BZZ3KRPk.js} +3 -3
  161. package/dist/components/{p-D1rjfWgJ.js → p-BkXQL5Dl.js} +5 -5
  162. package/dist/components/{p-eZXIu4yK.js → p-BppcoKoo.js} +5 -5
  163. package/dist/components/{p-DDTMGbtA.js → p-BrA9NBEE.js} +21 -21
  164. package/dist/components/{p-Czhdc844.js → p-BrqSjRJN.js} +3 -3
  165. package/dist/components/{p-CAoN_STZ.js → p-Bxi-Bm49.js} +2 -2
  166. package/dist/components/{p-B43upypT.js → p-C9_yBEoX.js} +30 -10
  167. package/dist/components/{p-Df3BwVGy.js → p-CHoOe3FD.js} +3 -3
  168. package/dist/components/{p-2WiGyky4.js → p-CLAz6RJc.js} +3 -3
  169. package/dist/components/{p-B5SWPDuq.js → p-CSKToqUl.js} +4 -4
  170. package/dist/components/{p-CF8pLc07.js → p-CSWCmyzb.js} +5 -5
  171. package/dist/components/{p-HoO86l1o.js → p-CWAChRD5.js} +12 -12
  172. package/dist/components/{p-DwMqCX2P.js → p-Ch-KG9To.js} +3 -3
  173. package/dist/components/{p-CSuU8frA.js → p-Ck-87E2G.js} +1 -1
  174. package/dist/components/{p-BFYtCsZu.js → p-Covorf4C.js} +3 -3
  175. package/dist/components/{p-BoN700-O.js → p-Cx-L_28S.js} +3 -3
  176. package/dist/components/{p-vqEUQ-4Q.js → p-D0Trc3IQ.js} +5 -5
  177. package/dist/components/{p-BrNsOp2v.js → p-D2VcPEtL.js} +6 -6
  178. package/dist/components/{p-CSPYkLLH.js → p-D3BzgkIE.js} +2 -2
  179. package/dist/components/{p-bAacqNHq.js → p-D6JycG-I.js} +3 -3
  180. package/dist/components/{p-DB58Oa5V.js → p-DPsbNStn.js} +2 -2
  181. package/dist/components/{p-CwZ3KKFq.js → p-DT_WBwsw.js} +6 -6
  182. package/dist/components/{p-Dx5NfJ0U.js → p-DW1B118Q.js} +9 -9
  183. package/dist/components/{p-BPsKYMH6.js → p-DYPA7jpg.js} +2 -2
  184. package/dist/components/{p-DBqoPgev.js → p-DafP9PAA.js} +2 -2
  185. package/dist/components/{p-Dt7-I2Xz.js → p-DcUIO14-.js} +4 -4
  186. package/dist/components/{p-CXpv9Rxe.js → p-Di--2boB.js} +3 -3
  187. package/dist/components/{p-djJSnjAX.js → p-DjXQxw9R.js} +3 -3
  188. package/dist/components/{p-DVXTPI71.js → p-Dp1CD4gK.js} +2 -2
  189. package/dist/components/{p-BNeE3SiZ.js → p-DwEYMvIn.js} +175 -179
  190. package/dist/components/{p-DKGg-76-.js → p-Dznwo6oc.js} +2 -2
  191. package/dist/components/{p-BozrueXV.js → p-ME1sDz3f.js} +2 -2
  192. package/dist/components/{p-B-585egz.js → p-MhQxGUvY.js} +3 -3
  193. package/dist/components/{p-DX2nriaq.js → p-QSyeAy8R.js} +2 -2
  194. package/dist/components/{p-PjPPCHVL.js → p-Qdo3E8dr.js} +2 -2
  195. package/dist/components/{p-dsxHDlQ3.js → p-b0J2ktAm.js} +7 -7
  196. package/dist/components/{p-C98Eb3_R.js → p-dAXnRkjA.js} +5 -5
  197. package/dist/components/{p-GKmqCI8r.js → p-fSV6KVTC.js} +3 -3
  198. package/dist/components/{p-CaBbajU2.js → p-o3NYKrVL.js} +3 -3
  199. package/dist/components/{p-CrHvaLRV.js → p-vDCa_ZDm.js} +3 -3
  200. package/dist/components/{p-4SPnZZkH.js → p-zG-WUBGF.js} +4 -4
  201. package/dist/esm/{index-Dhio9uis.js → index-2va1Pk9z.js} +47 -11
  202. package/dist/esm/index.js +3 -52
  203. package/dist/esm/kritzel-active-users_47.entry.js +198 -231
  204. package/dist/esm/kritzel-brush-style.entry.js +2 -2
  205. package/dist/esm/loader.js +2 -2
  206. package/dist/esm/{schema.constants-DfvqHmxc.js → schema.constants-DBvUmuDH.js} +44 -20
  207. package/dist/esm/stencil.js +3 -3
  208. package/dist/stencil/index.esm.js +3 -52
  209. package/dist/stencil/{p-Dhio9uis.js → p-2va1Pk9z.js} +47 -11
  210. package/dist/stencil/{p-DfvqHmxc.js → p-DBvUmuDH.js} +44 -20
  211. package/dist/stencil/{p-ab5c4292.entry.js → p-ce6d432e.entry.js} +198 -231
  212. package/dist/stencil/{p-fb32cd8f.entry.js → p-df06ca3a.entry.js} +2 -2
  213. package/dist/stencil/stencil.esm.js +4 -4
  214. package/dist/types/classes/providers/sync/hocuspocus-sync-provider.class.d.ts +0 -5
  215. package/dist/types/classes/providers/sync/websocket-sync-provider.class.d.ts +0 -6
  216. package/dist/types/classes/structures/object-map.structure.d.ts +2 -26
  217. package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +0 -3
  218. package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +11 -9
  219. package/dist/types/components.d.ts +1 -8
  220. package/dist/types/constants/version.d.ts +1 -1
  221. package/dist/types/interfaces/sync-provider.interface.d.ts +0 -13
  222. package/dist/types/stencil-public-runtime.d.ts +12 -0
  223. package/loader/index.d.ts +1 -1
  224. package/package.json +1 -1
  225. package/readme.md +10 -10
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-Dhio9uis.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-2va1Pk9z.js';
2
2
 
3
3
  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)}`;
4
4
 
@@ -21,7 +21,7 @@ const KritzelBrushStyle = class {
21
21
  value: option.value,
22
22
  label: option.label,
23
23
  }));
24
- return (h(Host, { key: '7b05e93ce8d28c23503e4ca358a487165169f1ad' }, h("kritzel-dropdown", { key: 'a8f2f30762b339411cd3995482c3bc658855f749', options: dropdownOptions, value: this.type, onValueChanged: event => this.handleDropdownValueChange(event) }, h("button", { key: 'ac06462897a0fbd5011533095fafb7491a75508a', class: "brush-style-button", slot: "prefix" }, h("kritzel-icon", { key: 'caee4c657c7fee478b1038ebd2ef3b502cf73e5e', name: this.type, size: 16 })))));
24
+ return (h(Host, { key: '51a7f84685032fd8fc967b22bee7c0711e811a54' }, h("kritzel-dropdown", { key: 'e49d7062c695458d345738d88a0adfc96b575e61', options: dropdownOptions, value: this.type, onValueChanged: event => this.handleDropdownValueChange(event) }, h("button", { key: 'ebbbf1a55b89e91012ca44c5cf30acfb77332b50', class: "brush-style-button", slot: "prefix" }, h("kritzel-icon", { key: 'dae002c9ab5e3486c726202426eb076a8f33b109', name: this.type, size: 16 })))));
25
25
  }
26
26
  };
27
27
  KritzelBrushStyle.style = kritzelBrushStyleCss();
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-Dhio9uis.js';
2
- export { s as setNonce } from './index-Dhio9uis.js';
1
+ import { b as bootstrapLazy } from './index-2va1Pk9z.js';
2
+ export { s as setNonce } from './index-2va1Pk9z.js';
3
3
  import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
@@ -5732,10 +5732,11 @@ class Fitter {
5732
5732
  }
5733
5733
  openMore() {
5734
5734
  let { content, openStart, openEnd } = this.unplaced;
5735
- let inner = contentAt(content, openStart);
5736
- if (!inner.childCount || inner.firstChild.isLeaf)
5735
+ if (maxOpen(content, -1) <= openStart)
5737
5736
  return false;
5738
- this.unplaced = new Slice(content, openStart + 1, Math.max(openEnd, inner.size + openStart >= content.size - openEnd ? openStart + 1 : 0));
5737
+ if (this.unplaced.size > 1 && maxOpen(content, 1) > openEnd)
5738
+ openEnd++;
5739
+ this.unplaced = new Slice(content, openStart + 1, openEnd);
5739
5740
  return true;
5740
5741
  }
5741
5742
  dropNode() {
@@ -5905,6 +5906,14 @@ function invalidMarks(type, fragment, start) {
5905
5906
  function definesContent(type) {
5906
5907
  return type.spec.defining || type.spec.definingForContent;
5907
5908
  }
5909
+ function maxOpen(frag, side) {
5910
+ for (let count = 0;; count++) {
5911
+ let ch = side < 0 ? frag.firstChild : frag.lastChild;
5912
+ if (!ch || ch.isAtom)
5913
+ return count;
5914
+ frag = ch.content;
5915
+ }
5916
+ }
5908
5917
  function replaceRange(tr, from, to, slice) {
5909
5918
  if (!slice.size)
5910
5919
  return tr.deleteRange(from, to);
@@ -8609,7 +8618,8 @@ class WidgetViewDesc extends ViewDesc {
8609
8618
  wrap.appendChild(dom);
8610
8619
  dom = wrap;
8611
8620
  }
8612
- dom.contentEditable = "false";
8621
+ if (!dom.hasAttribute("contenteditable"))
8622
+ dom.contentEditable = "false";
8613
8623
  dom.classList.add("ProseMirror-widget");
8614
8624
  }
8615
8625
  super(parent, [], dom, null);
@@ -10457,8 +10467,14 @@ function maybeWrapTrusted(html) {
10457
10467
  // With the require-trusted-types-for CSP, Chrome will block
10458
10468
  // innerHTML, even on a detached document. This wraps the string in
10459
10469
  // a way that makes the browser allow us to use its parser again.
10460
- if (!_policy)
10461
- _policy = trustedTypes.defaultPolicy || trustedTypes.createPolicy("ProseMirrorClipboard", { createHTML: (s) => s });
10470
+ if (!_policy) {
10471
+ if (_policy = trustedTypes.defaultPolicy)
10472
+ try {
10473
+ return _policy.createHTML(html);
10474
+ }
10475
+ catch (_a) { }
10476
+ _policy = trustedTypes.createPolicy("ProseMirrorClipboard", { createHTML: (s) => s });
10477
+ }
10462
10478
  return _policy.createHTML(html);
10463
10479
  }
10464
10480
  function readHTML(html) {
@@ -10515,6 +10531,12 @@ function addContext(slice, context) {
10515
10531
  let type = schema.nodes[array[i]];
10516
10532
  if (!type || type.hasRequiredAttrs())
10517
10533
  break;
10534
+ try {
10535
+ type.checkAttrs(array[i + 1]);
10536
+ }
10537
+ catch (e) {
10538
+ break;
10539
+ }
10518
10540
  content = Fragment.from(type.create(array[i + 1], content));
10519
10541
  openStart++;
10520
10542
  openEnd++;
@@ -14173,16 +14195,20 @@ a custom function to determine the type of the newly split off block.
14173
14195
  */
14174
14196
  function splitBlockAs(splitNode) {
14175
14197
  return (state, dispatch) => {
14176
- let { $from} = state.selection;
14177
14198
  if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {
14199
+ let { $from } = state.selection;
14178
14200
  if (!$from.parentOffset || !canSplit(state.doc, $from.pos))
14179
14201
  return false;
14180
14202
  if (dispatch)
14181
14203
  dispatch(state.tr.split($from.pos).scrollIntoView());
14182
14204
  return true;
14183
14205
  }
14184
- if (!$from.depth)
14206
+ if (!state.selection.$from.depth)
14185
14207
  return false;
14208
+ let tr = state.tr;
14209
+ if (!state.selection.empty && (state.selection instanceof TextSelection || state.selection instanceof AllSelection))
14210
+ tr.deleteSelection();
14211
+ let { $from } = tr.selection, mapFrom = tr.steps.length;
14186
14212
  let types = [];
14187
14213
  let splitDepth, deflt, atEnd = false, atStart = false;
14188
14214
  for (let d = $from.depth;; d--) {
@@ -14201,10 +14227,7 @@ function splitBlockAs(splitNode) {
14201
14227
  types.unshift(null);
14202
14228
  }
14203
14229
  }
14204
- let tr = state.tr;
14205
- if (state.selection instanceof TextSelection || state.selection instanceof AllSelection)
14206
- tr.deleteSelection();
14207
- let splitPos = tr.mapping.map($from.pos);
14230
+ let splitPos = $from.pos;
14208
14231
  let can = canSplit(tr.doc, splitPos, types.length, types);
14209
14232
  if (!can) {
14210
14233
  types[0] = deflt ? { type: deflt } : null;
@@ -14214,9 +14237,10 @@ function splitBlockAs(splitNode) {
14214
14237
  return false;
14215
14238
  tr.split(splitPos, types.length, types);
14216
14239
  if (!atEnd && atStart && $from.node(splitDepth).type != deflt) {
14217
- let first = tr.mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);
14240
+ let mapping = tr.mapping.slice(mapFrom);
14241
+ let first = mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);
14218
14242
  if (deflt && $from.node(splitDepth - 1).canReplaceWith($first.index(), $first.index() + 1, deflt))
14219
- tr.setNodeMarkup(tr.mapping.map($from.before(splitDepth)), deflt);
14243
+ tr.setNodeMarkup(mapping.map($from.before(splitDepth)), deflt);
14220
14244
  }
14221
14245
  if (dispatch)
14222
14246
  dispatch(tr.scrollIntoView());
@@ -22857,12 +22881,12 @@ class KritzelCursorHelper {
22857
22881
  // We rotate around the center of the SVG canvas
22858
22882
  const center = size / 2;
22859
22883
  // We use a group to apply the rotation
22860
- const svg = `
22861
- <svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 ${size} ${size}">
22862
- <g transform="rotate(${rotation} ${center} ${center})">
22863
- ${content}
22864
- </g>
22865
- </svg>
22884
+ const svg = `
22885
+ <svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 ${size} ${size}">
22886
+ <g transform="rotate(${rotation} ${center} ${center})">
22887
+ ${content}
22888
+ </g>
22889
+ </svg>
22866
22890
  `;
22867
22891
  // Encode the SVG for use in a data URI
22868
22892
  // We need to be careful with encoding to ensure it works across browsers
@@ -1,9 +1,9 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-Dhio9uis.js';
2
- export { s as setNonce } from './index-Dhio9uis.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-2va1Pk9z.js';
2
+ export { s as setNonce } from './index-2va1Pk9z.js';
3
3
  import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v4.43.5 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.44.2 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
 
9
9
  var patchBrowser = () => {
@@ -1,5 +1,5 @@
1
- import { H as HocuspocusProvider, a as HocuspocusProviderWebsocket } from './p-DfvqHmxc.js';
2
- export { P as APP_STATE_MIGRATIONS, A as AssetNotFoundError, R as CURRENT_APP_STATE_SCHEMA_VERSION, T as CURRENT_WORKSPACE_SCHEMA_VERSION, E as DEFAULT_ASSET_STORAGE_CONFIG, D as DEFAULT_BRUSH_CONFIG, C as DEFAULT_LINE_TOOL_CONFIG, B as DEFAULT_TEXT_CONFIG, L as DE_LOCALE, J as EN_LOCALE, M as FR_LOCALE, I as IndexedDBAssetProvider, N as KritzelAlignment, t as KritzelAnchorManager, r as KritzelAssetResolver, K as KritzelBaseObject, i as KritzelBaseTool, j as KritzelBrushTool, p as KritzelCursorHelper, h as KritzelCustomElement, x as KritzelCustomElementRendererRegistry, l as KritzelEraserTool, y as KritzelFontRegistry, f as KritzelGroup, d as KritzelImage, m as KritzelImageTool, w as KritzelLicenseManager, e as KritzelLine, k as KritzelLineTool, v as KritzelLocalizationManager, c as KritzelPath, q as KritzelSelectionTool, g as KritzelShape, o as KritzelShapeTool, b as KritzelText, n as KritzelTextTool, u as KritzelThemeManager, s as KritzelWorkspace, S as ShapeType, W as WORKSPACE_EXPORT_VERSION, Q as WORKSPACE_MIGRATIONS, G as darkTheme, z as hasRemoteSyncProvider, F as lightTheme, O as runMigrations } from './p-DfvqHmxc.js';
1
+ import { H as HocuspocusProvider, a as HocuspocusProviderWebsocket } from './p-DBvUmuDH.js';
2
+ export { P as APP_STATE_MIGRATIONS, A as AssetNotFoundError, R as CURRENT_APP_STATE_SCHEMA_VERSION, T as CURRENT_WORKSPACE_SCHEMA_VERSION, E as DEFAULT_ASSET_STORAGE_CONFIG, D as DEFAULT_BRUSH_CONFIG, C as DEFAULT_LINE_TOOL_CONFIG, B as DEFAULT_TEXT_CONFIG, L as DE_LOCALE, J as EN_LOCALE, M as FR_LOCALE, I as IndexedDBAssetProvider, N as KritzelAlignment, t as KritzelAnchorManager, r as KritzelAssetResolver, K as KritzelBaseObject, i as KritzelBaseTool, j as KritzelBrushTool, p as KritzelCursorHelper, h as KritzelCustomElement, x as KritzelCustomElementRendererRegistry, l as KritzelEraserTool, y as KritzelFontRegistry, f as KritzelGroup, d as KritzelImage, m as KritzelImageTool, w as KritzelLicenseManager, e as KritzelLine, k as KritzelLineTool, v as KritzelLocalizationManager, c as KritzelPath, q as KritzelSelectionTool, g as KritzelShape, o as KritzelShapeTool, b as KritzelText, n as KritzelTextTool, u as KritzelThemeManager, s as KritzelWorkspace, S as ShapeType, W as WORKSPACE_EXPORT_VERSION, Q as WORKSPACE_MIGRATIONS, G as darkTheme, z as hasRemoteSyncProvider, F as lightTheme, O as runMigrations } from './p-DBvUmuDH.js';
3
3
  import * as Y from 'yjs';
4
4
  import { IndexeddbPersistence } from 'y-indexeddb';
5
5
  import { WebsocketProvider } from 'y-websocket';
@@ -549,15 +549,9 @@ class WebSocketSyncProvider {
549
549
  provider;
550
550
  isConnected = false;
551
551
  _quiet = false;
552
- _isSynced = false;
553
- _syncedResolvers = [];
554
552
  get awareness() {
555
553
  return this.provider.awareness;
556
554
  }
557
- /** y-websocket applies remote updates with the underlying provider as the Yjs transaction origin. */
558
- get updateOrigin() {
559
- return this.provider;
560
- }
561
555
  constructor(docName, doc, options) {
562
556
  const url = options?.url || 'ws://localhost:1234';
563
557
  const roomName = options?.roomName || docName;
@@ -604,29 +598,11 @@ class WebSocketSyncProvider {
604
598
  }
605
599
  });
606
600
  this.provider.on('sync', (synced) => {
607
- if (!synced) {
608
- return;
609
- }
610
- this._isSynced = true;
611
- this.releaseSyncedWaiters();
612
- if (!this._quiet) {
601
+ if (synced && !this._quiet) {
613
602
  console.info('WebSocket synced');
614
603
  }
615
604
  });
616
605
  }
617
- releaseSyncedWaiters() {
618
- const resolvers = this._syncedResolvers;
619
- this._syncedResolvers = [];
620
- resolvers.forEach(resolve => resolve());
621
- }
622
- async whenSynced() {
623
- if (this._isSynced || this.provider.synced) {
624
- return;
625
- }
626
- return new Promise(resolve => {
627
- this._syncedResolvers.push(resolve);
628
- });
629
- }
630
606
  async connect() {
631
607
  if (this.isConnected) {
632
608
  return;
@@ -658,8 +634,6 @@ class WebSocketSyncProvider {
658
634
  this.provider.disconnect();
659
635
  }
660
636
  this.isConnected = false;
661
- this._isSynced = false;
662
- this.releaseSyncedWaiters();
663
637
  }
664
638
  async reconnect() {
665
639
  this.disconnect();
@@ -670,8 +644,6 @@ class WebSocketSyncProvider {
670
644
  this.provider.destroy();
671
645
  }
672
646
  this.isConnected = false;
673
- this._isSynced = false;
674
- this.releaseSyncedWaiters();
675
647
  }
676
648
  }
677
649
 
@@ -693,14 +665,9 @@ class HocuspocusSyncProvider {
693
665
  _connectionStatus = 'disconnected';
694
666
  visibilityHandler = null;
695
667
  onlineHandler = null;
696
- syncedResolvers = [];
697
668
  get awareness() {
698
669
  return this.provider.awareness;
699
670
  }
700
- /** HocuspocusProvider applies remote updates with itself as the Yjs transaction origin. */
701
- get updateOrigin() {
702
- return this.provider;
703
- }
704
671
  get connectionStatus() {
705
672
  return this._connectionStatus;
706
673
  }
@@ -757,7 +724,6 @@ class HocuspocusSyncProvider {
757
724
  }
758
725
  this.isSynced = true;
759
726
  this._connectionStatus = 'synced';
760
- this.releaseSyncedWaiters();
761
727
  if (!options?.quiet) {
762
728
  console.info(`Hocuspocus synced: ${name}`);
763
729
  }
@@ -968,19 +934,6 @@ class HocuspocusSyncProvider {
968
934
  this.disconnect();
969
935
  return this.connect();
970
936
  }
971
- releaseSyncedWaiters() {
972
- const resolvers = this.syncedResolvers;
973
- this.syncedResolvers = [];
974
- resolvers.forEach(resolve => resolve());
975
- }
976
- async whenSynced() {
977
- if (this.isSynced || this.isDestroyed || this.provider.isSynced) {
978
- return;
979
- }
980
- return new Promise(resolve => {
981
- this.syncedResolvers.push(resolve);
982
- });
983
- }
984
937
  disconnect() {
985
938
  // Cancel any pending connection attempt
986
939
  if (this.connectTimeout) {
@@ -1002,7 +955,6 @@ class HocuspocusSyncProvider {
1002
955
  this.isConnected = false;
1003
956
  this.isSynced = false;
1004
957
  this._connectionStatus = 'disconnected';
1005
- this.releaseSyncedWaiters();
1006
958
  }
1007
959
  destroy() {
1008
960
  // Mark as destroyed first to prevent any callbacks from doing work
@@ -1022,7 +974,6 @@ class HocuspocusSyncProvider {
1022
974
  this.isConnected = false;
1023
975
  this.isSynced = false;
1024
976
  this._connectionStatus = 'disconnected';
1025
- this.releaseSyncedWaiters();
1026
977
  }
1027
978
  }
1028
979
 
@@ -2,7 +2,7 @@ const NAMESPACE = 'stencil';
2
2
  const BUILD = /* stencil */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.44.2 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
 
8
8
 
@@ -94,7 +94,9 @@ var consoleError = (e, el) => (0, console.error)(e, el);
94
94
 
95
95
  // src/client/client-load-module.ts
96
96
  var cmpModules = /* @__PURE__ */ new Map();
97
+ var failedLoadAttempts = /* @__PURE__ */ new Map();
97
98
  var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
99
+ var _a;
98
100
  const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
99
101
  const bundleId = cmpMeta.$lazyBundleId$;
100
102
  if (!bundleId) {
@@ -104,21 +106,28 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
104
106
  if (module) {
105
107
  return module[exportName];
106
108
  }
109
+ const retryCount = (_a = failedLoadAttempts.get(bundleId)) != null ? _a : 0;
110
+ const cacheBustParams = [
111
+ retryCount > 0 ? `s-retry=${retryCount}` : "",
112
+ ""
113
+ ].filter(Boolean).join("&");
107
114
  /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
108
115
  return import(
109
116
  /* @vite-ignore */
110
117
  /* webpackInclude: /\.entry\.js$/ */
111
118
  /* webpackExclude: /\.system\.entry\.js$/ */
112
119
  /* webpackMode: "lazy" */
113
- `./${bundleId}.entry.js${""}`
120
+ `./${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`
114
121
  ).then(
115
122
  (importedModule) => {
116
123
  {
124
+ failedLoadAttempts.delete(bundleId);
117
125
  cmpModules.set(bundleId, importedModule);
118
126
  }
119
127
  return importedModule[exportName];
120
128
  },
121
129
  (e) => {
130
+ failedLoadAttempts.set(bundleId, retryCount + 1);
122
131
  consoleError(e, hostRef.$hostElement$);
123
132
  }
124
133
  );
@@ -128,6 +137,8 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
128
137
  var styles = /* @__PURE__ */ new Map();
129
138
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
130
139
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
140
+ var MAX_LAZY_LOAD_RETRIES = 3;
141
+ var LAZY_LOAD_RETRY_INTERVAL_MS = 1e3;
131
142
  var win = typeof window !== "undefined" ? window : {};
132
143
  var plt = {
133
144
  $flags$: 0,
@@ -171,6 +182,10 @@ var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @_
171
182
  var queuePending = false;
172
183
  var queueDomReads = [];
173
184
  var queueDomWrites = [];
185
+ var scheduleFlush = () => {
186
+ var _a;
187
+ return ((_a = win.document) == null ? void 0 : _a.hidden) ? nextTick(flush) : plt.raf(flush);
188
+ };
174
189
  var queueTask = (queue, write) => (cb) => {
175
190
  queue.push(cb);
176
191
  if (!queuePending) {
@@ -178,7 +193,7 @@ var queueTask = (queue, write) => (cb) => {
178
193
  if (write && plt.$flags$ & 4 /* queueSync */) {
179
194
  nextTick(flush);
180
195
  } else {
181
- plt.raf(flush);
196
+ scheduleFlush();
182
197
  }
183
198
  }
184
199
  };
@@ -197,7 +212,7 @@ var flush = () => {
197
212
  {
198
213
  consume(queueDomWrites);
199
214
  if (queuePending = queueDomReads.length > 0) {
200
- plt.raf(flush);
215
+ scheduleFlush();
201
216
  }
202
217
  }
203
218
  };
@@ -389,6 +404,11 @@ var h = (nodeName, vnodeData, ...children) => {
389
404
  } else if (child != null && typeof child !== "boolean") {
390
405
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
391
406
  child = String(child);
407
+ } else if (typeof nodeName !== "function" && child.$flags$ === void 0) {
408
+ {
409
+ consoleError("Invalid vNode child");
410
+ }
411
+ continue;
392
412
  }
393
413
  if (simple && lastSimple) {
394
414
  vNodeChildren[vNodeChildren.length - 1].$text$ += child;
@@ -617,7 +637,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
617
637
  }
618
638
  }
619
639
  if (newValue == null || newValue === false) {
620
- if (newValue !== false || elm.getAttribute(memberName) === "") {
640
+ if (newValue !== false || elm.getAttribute(memberName) === "" || flags & 4 /* isHost */ && !isEnumeratedAttribute(memberName)) {
621
641
  {
622
642
  elm.removeAttribute(memberName);
623
643
  }
@@ -630,6 +650,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
630
650
  }
631
651
  }
632
652
  };
653
+ var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set(["draggable", "contenteditable", "spellcheck"]);
654
+ var isEnumeratedAttribute = (attrName) => ENUMERATED_ATTRIBUTES.has(attrName) || attrName.startsWith("aria-");
633
655
  var parseClassListRegex = /\s/;
634
656
  var parseClassList = (value) => {
635
657
  if (typeof value === "object" && value && "baseVal" in value) {
@@ -937,9 +959,7 @@ var flushQueuedRefCallbacks = () => {
937
959
  }
938
960
  };
939
961
  var insertBefore = (parent, newNode, reference, isInitialLoad) => {
940
- if (parent.__insertBefore) {
941
- return parent.__insertBefore(newNode, reference);
942
- } else {
962
+ {
943
963
  return parent == null ? void 0 : parent.insertBefore(newNode, reference);
944
964
  }
945
965
  };
@@ -1207,6 +1227,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1207
1227
  };
1208
1228
 
1209
1229
  // src/runtime/proxy-component.ts
1230
+ var reflectedAttrValue = (propValue) => propValue == null || propValue === false ? null : propValue === true ? "" : String(propValue);
1210
1231
  var proxyComponent = (Cstr, cmpMeta, flags) => {
1211
1232
  var _a, _b;
1212
1233
  const prototype = Cstr.prototype;
@@ -1339,7 +1360,13 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1339
1360
  return;
1340
1361
  }
1341
1362
  const propFlags = members.find(([m]) => m === propName);
1342
- const isBooleanTarget = propFlags && propFlags[1][0] & 4 /* Boolean */;
1363
+ const propMemberFlags = propFlags ? propFlags[1][0] : 0;
1364
+ const isBooleanTarget = propMemberFlags & 4 /* Boolean */;
1365
+ if (propMemberFlags & 512 /* ReflectAttr */ && propMemberFlags & 8 /* Any */ && // a complex value is never written to an attribute, so a change while the prop holds
1366
+ // one is always external
1367
+ !isComplexType(this[propName]) && reflectedAttrValue(this[propName]) === newValue) {
1368
+ return;
1369
+ }
1343
1370
  const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
1344
1371
  if (isBooleanTarget) {
1345
1372
  newValue = newValue === null || newValue === "false" ? false : true;
@@ -1371,10 +1398,12 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1371
1398
 
1372
1399
  // src/runtime/initialize-component.ts
1373
1400
  var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1401
+ var _a;
1374
1402
  let Cstr;
1375
1403
  try {
1376
1404
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1377
1405
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1406
+ hostRef.$flags$ &= -1025 /* hasFailedLoad */;
1378
1407
  const bundleId = cmpMeta.$lazyBundleId$;
1379
1408
  if (bundleId) {
1380
1409
  const CstrImport = loadModule(cmpMeta, hostRef);
@@ -1386,6 +1415,11 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1386
1415
  Cstr = CstrImport;
1387
1416
  }
1388
1417
  if (!Cstr) {
1418
+ hostRef.$flags$ &= -33 /* hasInitializedComponent */;
1419
+ hostRef.$loadRetryCount$ = ((_a = hostRef.$loadRetryCount$) != null ? _a : 0) + 1;
1420
+ if (hostRef.$loadRetryCount$ < MAX_LAZY_LOAD_RETRIES) {
1421
+ hostRef.$flags$ |= 1024 /* hasFailedLoad */;
1422
+ }
1389
1423
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1390
1424
  }
1391
1425
  if (!Cstr.isProxied) {
@@ -1447,7 +1481,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1447
1481
  hostRef.$onRenderResolve$();
1448
1482
  hostRef.$onRenderResolve$ = void 0;
1449
1483
  }
1450
- if (hostRef.$onReadyResolve$) {
1484
+ if (hostRef.$onReadyResolve$ && !(hostRef.$flags$ & 1024 /* hasFailedLoad */)) {
1451
1485
  hostRef.$onReadyResolve$(elm);
1452
1486
  }
1453
1487
  }
@@ -1494,6 +1528,8 @@ var connectedCallback = (elm) => {
1494
1528
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1495
1529
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1496
1530
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
1531
+ } else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
1532
+ setTimeout(() => initializeComponent(elm, hostRef, cmpMeta), LAZY_LOAD_RETRY_INTERVAL_MS);
1497
1533
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1498
1534
  hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
1499
1535
  }
@@ -1616,7 +1652,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1616
1652
  }
1617
1653
  disconnectedCallback() {
1618
1654
  plt.jmp(() => disconnectedCallback(this));
1619
- plt.raf(() => {
1655
+ nextTick(() => {
1620
1656
  var _a3;
1621
1657
  const hostRef = getHostRef(this);
1622
1658
  if (!hostRef) {
@@ -5732,10 +5732,11 @@ class Fitter {
5732
5732
  }
5733
5733
  openMore() {
5734
5734
  let { content, openStart, openEnd } = this.unplaced;
5735
- let inner = contentAt(content, openStart);
5736
- if (!inner.childCount || inner.firstChild.isLeaf)
5735
+ if (maxOpen(content, -1) <= openStart)
5737
5736
  return false;
5738
- this.unplaced = new Slice(content, openStart + 1, Math.max(openEnd, inner.size + openStart >= content.size - openEnd ? openStart + 1 : 0));
5737
+ if (this.unplaced.size > 1 && maxOpen(content, 1) > openEnd)
5738
+ openEnd++;
5739
+ this.unplaced = new Slice(content, openStart + 1, openEnd);
5739
5740
  return true;
5740
5741
  }
5741
5742
  dropNode() {
@@ -5905,6 +5906,14 @@ function invalidMarks(type, fragment, start) {
5905
5906
  function definesContent(type) {
5906
5907
  return type.spec.defining || type.spec.definingForContent;
5907
5908
  }
5909
+ function maxOpen(frag, side) {
5910
+ for (let count = 0;; count++) {
5911
+ let ch = side < 0 ? frag.firstChild : frag.lastChild;
5912
+ if (!ch || ch.isAtom)
5913
+ return count;
5914
+ frag = ch.content;
5915
+ }
5916
+ }
5908
5917
  function replaceRange(tr, from, to, slice) {
5909
5918
  if (!slice.size)
5910
5919
  return tr.deleteRange(from, to);
@@ -8609,7 +8618,8 @@ class WidgetViewDesc extends ViewDesc {
8609
8618
  wrap.appendChild(dom);
8610
8619
  dom = wrap;
8611
8620
  }
8612
- dom.contentEditable = "false";
8621
+ if (!dom.hasAttribute("contenteditable"))
8622
+ dom.contentEditable = "false";
8613
8623
  dom.classList.add("ProseMirror-widget");
8614
8624
  }
8615
8625
  super(parent, [], dom, null);
@@ -10457,8 +10467,14 @@ function maybeWrapTrusted(html) {
10457
10467
  // With the require-trusted-types-for CSP, Chrome will block
10458
10468
  // innerHTML, even on a detached document. This wraps the string in
10459
10469
  // a way that makes the browser allow us to use its parser again.
10460
- if (!_policy)
10461
- _policy = trustedTypes.defaultPolicy || trustedTypes.createPolicy("ProseMirrorClipboard", { createHTML: (s) => s });
10470
+ if (!_policy) {
10471
+ if (_policy = trustedTypes.defaultPolicy)
10472
+ try {
10473
+ return _policy.createHTML(html);
10474
+ }
10475
+ catch (_a) { }
10476
+ _policy = trustedTypes.createPolicy("ProseMirrorClipboard", { createHTML: (s) => s });
10477
+ }
10462
10478
  return _policy.createHTML(html);
10463
10479
  }
10464
10480
  function readHTML(html) {
@@ -10515,6 +10531,12 @@ function addContext(slice, context) {
10515
10531
  let type = schema.nodes[array[i]];
10516
10532
  if (!type || type.hasRequiredAttrs())
10517
10533
  break;
10534
+ try {
10535
+ type.checkAttrs(array[i + 1]);
10536
+ }
10537
+ catch (e) {
10538
+ break;
10539
+ }
10518
10540
  content = Fragment.from(type.create(array[i + 1], content));
10519
10541
  openStart++;
10520
10542
  openEnd++;
@@ -14173,16 +14195,20 @@ a custom function to determine the type of the newly split off block.
14173
14195
  */
14174
14196
  function splitBlockAs(splitNode) {
14175
14197
  return (state, dispatch) => {
14176
- let { $from} = state.selection;
14177
14198
  if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {
14199
+ let { $from } = state.selection;
14178
14200
  if (!$from.parentOffset || !canSplit(state.doc, $from.pos))
14179
14201
  return false;
14180
14202
  if (dispatch)
14181
14203
  dispatch(state.tr.split($from.pos).scrollIntoView());
14182
14204
  return true;
14183
14205
  }
14184
- if (!$from.depth)
14206
+ if (!state.selection.$from.depth)
14185
14207
  return false;
14208
+ let tr = state.tr;
14209
+ if (!state.selection.empty && (state.selection instanceof TextSelection || state.selection instanceof AllSelection))
14210
+ tr.deleteSelection();
14211
+ let { $from } = tr.selection, mapFrom = tr.steps.length;
14186
14212
  let types = [];
14187
14213
  let splitDepth, deflt, atEnd = false, atStart = false;
14188
14214
  for (let d = $from.depth;; d--) {
@@ -14201,10 +14227,7 @@ function splitBlockAs(splitNode) {
14201
14227
  types.unshift(null);
14202
14228
  }
14203
14229
  }
14204
- let tr = state.tr;
14205
- if (state.selection instanceof TextSelection || state.selection instanceof AllSelection)
14206
- tr.deleteSelection();
14207
- let splitPos = tr.mapping.map($from.pos);
14230
+ let splitPos = $from.pos;
14208
14231
  let can = canSplit(tr.doc, splitPos, types.length, types);
14209
14232
  if (!can) {
14210
14233
  types[0] = deflt ? { type: deflt } : null;
@@ -14214,9 +14237,10 @@ function splitBlockAs(splitNode) {
14214
14237
  return false;
14215
14238
  tr.split(splitPos, types.length, types);
14216
14239
  if (!atEnd && atStart && $from.node(splitDepth).type != deflt) {
14217
- let first = tr.mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);
14240
+ let mapping = tr.mapping.slice(mapFrom);
14241
+ let first = mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);
14218
14242
  if (deflt && $from.node(splitDepth - 1).canReplaceWith($first.index(), $first.index() + 1, deflt))
14219
- tr.setNodeMarkup(tr.mapping.map($from.before(splitDepth)), deflt);
14243
+ tr.setNodeMarkup(mapping.map($from.before(splitDepth)), deflt);
14220
14244
  }
14221
14245
  if (dispatch)
14222
14246
  dispatch(tr.scrollIntoView());
@@ -22857,12 +22881,12 @@ class KritzelCursorHelper {
22857
22881
  // We rotate around the center of the SVG canvas
22858
22882
  const center = size / 2;
22859
22883
  // We use a group to apply the rotation
22860
- const svg = `
22861
- <svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 ${size} ${size}">
22862
- <g transform="rotate(${rotation} ${center} ${center})">
22863
- ${content}
22864
- </g>
22865
- </svg>
22884
+ const svg = `
22885
+ <svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 ${size} ${size}">
22886
+ <g transform="rotate(${rotation} ${center} ${center})">
22887
+ ${content}
22888
+ </g>
22889
+ </svg>
22866
22890
  `;
22867
22891
  // Encode the SVG for use in a data URI
22868
22892
  // We need to be careful with encoding to ensure it works across browsers