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.
Files changed (226) hide show
  1. package/LICENSE +21 -21
  2. package/LICENSE.md +49 -49
  3. package/dist/cjs/{index-Dn19mGl-.js → index-Xav9JFHg.js} +11 -47
  4. package/dist/cjs/index.cjs.js +51 -2
  5. package/dist/cjs/kritzel-active-users_47.cjs.entry.js +268 -139
  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-CY0WWJYd.js → schema.constants-CjN-B633.js} +20 -44
  9. package/dist/cjs/stencil.cjs.js +2 -2
  10. package/dist/collection/classes/providers/sync/hocuspocus-sync-provider.class.js +21 -0
  11. package/dist/collection/classes/providers/sync/websocket-sync-provider.class.js +29 -1
  12. package/dist/collection/classes/structures/app-state-map.structure.js +19 -6
  13. package/dist/collection/classes/structures/object-map.structure.js +66 -4
  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 +51 -18
  21. package/dist/collection/components/core/kritzel-engine/kritzel-engine.css +80 -80
  22. package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +87 -38
  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 +53 -4
  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 +61 -56
  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-CLAz6RJc.js → p-2WiGyky4.js} +3 -3
  156. package/dist/components/{p-zG-WUBGF.js → p-4SPnZZkH.js} +4 -4
  157. package/dist/components/{p-MhQxGUvY.js → p-B-585egz.js} +3 -3
  158. package/dist/components/{p-C9_yBEoX.js → p-B43upypT.js} +10 -30
  159. package/dist/components/{p-CSKToqUl.js → p-B5SWPDuq.js} +4 -4
  160. package/dist/components/{p-Covorf4C.js → p-BFYtCsZu.js} +3 -3
  161. package/dist/components/{p-Csxx9TbU.js → p-BNeE3SiZ.js} +216 -116
  162. package/dist/components/{p-DYPA7jpg.js → p-BPsKYMH6.js} +2 -2
  163. package/dist/components/{p-Cx-L_28S.js → p-BoN700-O.js} +3 -3
  164. package/dist/components/{p-ME1sDz3f.js → p-BozrueXV.js} +2 -2
  165. package/dist/components/{p-D2VcPEtL.js → p-BrNsOp2v.js} +6 -6
  166. package/dist/components/{p-BXUx_C0N.js → p-BsLI_BWq.js} +2 -2
  167. package/dist/components/{p-dAXnRkjA.js → p-C98Eb3_R.js} +5 -5
  168. package/dist/components/{p-Bxi-Bm49.js → p-CAoN_STZ.js} +2 -2
  169. package/dist/components/{p-CSWCmyzb.js → p-CF8pLc07.js} +5 -5
  170. package/dist/components/{p-D3BzgkIE.js → p-CSPYkLLH.js} +2 -2
  171. package/dist/components/{p-Ck-87E2G.js → p-CSuU8frA.js} +1 -1
  172. package/dist/components/{p-Di--2boB.js → p-CXpv9Rxe.js} +3 -3
  173. package/dist/components/{p-o3NYKrVL.js → p-CaBbajU2.js} +3 -3
  174. package/dist/components/{p-3tBE7SyG.js → p-Cm33td2O.js} +2 -2
  175. package/dist/components/{p-vDCa_ZDm.js → p-CrHvaLRV.js} +3 -3
  176. package/dist/components/{p-DT_WBwsw.js → p-CwZ3KKFq.js} +6 -6
  177. package/dist/components/{p-BZZ3KRPk.js → p-CzW58DHM.js} +3 -3
  178. package/dist/components/{p-BrqSjRJN.js → p-Czhdc844.js} +3 -3
  179. package/dist/components/{p-BkXQL5Dl.js → p-D1rjfWgJ.js} +5 -5
  180. package/dist/components/{p-DPsbNStn.js → p-DB58Oa5V.js} +2 -2
  181. package/dist/components/{p-DafP9PAA.js → p-DBqoPgev.js} +2 -2
  182. package/dist/components/{p-BrA9NBEE.js → p-DDTMGbtA.js} +21 -21
  183. package/dist/components/{p-Dznwo6oc.js → p-DKGg-76-.js} +2 -2
  184. package/dist/components/{p-Dp1CD4gK.js → p-DVXTPI71.js} +2 -2
  185. package/dist/components/{p-QSyeAy8R.js → p-DX2nriaq.js} +2 -2
  186. package/dist/components/{p-CHoOe3FD.js → p-Df3BwVGy.js} +3 -3
  187. package/dist/components/{p-DcUIO14-.js → p-Dt7-I2Xz.js} +4 -4
  188. package/dist/components/{p-BShrnlam.js → p-DtnMdWWB.js} +2 -2
  189. package/dist/components/{p-Ch-KG9To.js → p-DwMqCX2P.js} +3 -3
  190. package/dist/components/{p-25ExYYPf.js → p-Dx5NfJ0U.js} +9 -9
  191. package/dist/components/{p-fSV6KVTC.js → p-GKmqCI8r.js} +3 -3
  192. package/dist/components/{p-CWAChRD5.js → p-HoO86l1o.js} +12 -12
  193. package/dist/components/{p-Qdo3E8dr.js → p-PjPPCHVL.js} +2 -2
  194. package/dist/components/{p-D6JycG-I.js → p-bAacqNHq.js} +3 -3
  195. package/dist/components/{p-DjXQxw9R.js → p-djJSnjAX.js} +3 -3
  196. package/dist/components/{p-b0J2ktAm.js → p-dsxHDlQ3.js} +7 -7
  197. package/dist/components/{p-BppcoKoo.js → p-eZXIu4yK.js} +5 -5
  198. package/dist/components/{p-BFYT03fw.js → p-fL9rl200.js} +3 -3
  199. package/dist/components/{p-1Q4VnThv.js → p-jIKskj3S.js} +3 -3
  200. package/dist/components/{p-D0Trc3IQ.js → p-vqEUQ-4Q.js} +5 -5
  201. package/dist/esm/{index-2va1Pk9z.js → index-Dhio9uis.js} +11 -47
  202. package/dist/esm/index.js +52 -3
  203. package/dist/esm/kritzel-active-users_47.entry.js +268 -139
  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-DBvUmuDH.js → schema.constants-DfvqHmxc.js} +20 -44
  207. package/dist/esm/stencil.js +3 -3
  208. package/dist/stencil/index.esm.js +52 -3
  209. package/dist/stencil/{p-DBvUmuDH.js → p-DfvqHmxc.js} +20 -44
  210. package/dist/stencil/{p-2va1Pk9z.js → p-Dhio9uis.js} +11 -47
  211. package/dist/stencil/{p-d19d1b82.entry.js → p-ab5c4292.entry.js} +268 -139
  212. package/dist/stencil/{p-df06ca3a.entry.js → p-fb32cd8f.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 +5 -0
  215. package/dist/types/classes/providers/sync/websocket-sync-provider.class.d.ts +6 -0
  216. package/dist/types/classes/structures/app-state-map.structure.d.ts +6 -0
  217. package/dist/types/classes/structures/object-map.structure.d.ts +26 -2
  218. package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +3 -0
  219. package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +14 -1
  220. package/dist/types/components.d.ts +8 -1
  221. package/dist/types/constants/version.d.ts +1 -1
  222. package/dist/types/interfaces/sync-provider.interface.d.ts +13 -0
  223. package/dist/types/stencil-public-runtime.d.ts +0 -12
  224. package/loader/index.d.ts +1 -1
  225. package/package.json +1 -1
  226. package/readme.md +10 -10
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-2va1Pk9z.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-Dhio9uis.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: '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 })))));
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 })))));
25
25
  }
26
26
  };
27
27
  KritzelBrushStyle.style = kritzelBrushStyleCss();
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-2va1Pk9z.js';
2
- export { s as setNonce } from './index-2va1Pk9z.js';
1
+ import { b as bootstrapLazy } from './index-Dhio9uis.js';
2
+ export { s as setNonce } from './index-Dhio9uis.js';
3
3
  import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
@@ -5732,11 +5732,10 @@ class Fitter {
5732
5732
  }
5733
5733
  openMore() {
5734
5734
  let { content, openStart, openEnd } = this.unplaced;
5735
- if (maxOpen(content, -1) <= openStart)
5735
+ let inner = contentAt(content, openStart);
5736
+ if (!inner.childCount || inner.firstChild.isLeaf)
5736
5737
  return false;
5737
- if (this.unplaced.size > 1 && maxOpen(content, 1) > openEnd)
5738
- openEnd++;
5739
- this.unplaced = new Slice(content, openStart + 1, openEnd);
5738
+ this.unplaced = new Slice(content, openStart + 1, Math.max(openEnd, inner.size + openStart >= content.size - openEnd ? openStart + 1 : 0));
5740
5739
  return true;
5741
5740
  }
5742
5741
  dropNode() {
@@ -5906,14 +5905,6 @@ function invalidMarks(type, fragment, start) {
5906
5905
  function definesContent(type) {
5907
5906
  return type.spec.defining || type.spec.definingForContent;
5908
5907
  }
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
- }
5917
5908
  function replaceRange(tr, from, to, slice) {
5918
5909
  if (!slice.size)
5919
5910
  return tr.deleteRange(from, to);
@@ -8618,8 +8609,7 @@ class WidgetViewDesc extends ViewDesc {
8618
8609
  wrap.appendChild(dom);
8619
8610
  dom = wrap;
8620
8611
  }
8621
- if (!dom.hasAttribute("contenteditable"))
8622
- dom.contentEditable = "false";
8612
+ dom.contentEditable = "false";
8623
8613
  dom.classList.add("ProseMirror-widget");
8624
8614
  }
8625
8615
  super(parent, [], dom, null);
@@ -10467,14 +10457,8 @@ function maybeWrapTrusted(html) {
10467
10457
  // With the require-trusted-types-for CSP, Chrome will block
10468
10458
  // innerHTML, even on a detached document. This wraps the string in
10469
10459
  // a way that makes the browser allow us to use its parser again.
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
- }
10460
+ if (!_policy)
10461
+ _policy = trustedTypes.defaultPolicy || trustedTypes.createPolicy("ProseMirrorClipboard", { createHTML: (s) => s });
10478
10462
  return _policy.createHTML(html);
10479
10463
  }
10480
10464
  function readHTML(html) {
@@ -10531,12 +10515,6 @@ function addContext(slice, context) {
10531
10515
  let type = schema.nodes[array[i]];
10532
10516
  if (!type || type.hasRequiredAttrs())
10533
10517
  break;
10534
- try {
10535
- type.checkAttrs(array[i + 1]);
10536
- }
10537
- catch (e) {
10538
- break;
10539
- }
10540
10518
  content = Fragment.from(type.create(array[i + 1], content));
10541
10519
  openStart++;
10542
10520
  openEnd++;
@@ -14195,20 +14173,16 @@ a custom function to determine the type of the newly split off block.
14195
14173
  */
14196
14174
  function splitBlockAs(splitNode) {
14197
14175
  return (state, dispatch) => {
14176
+ let { $from} = state.selection;
14198
14177
  if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {
14199
- let { $from } = state.selection;
14200
14178
  if (!$from.parentOffset || !canSplit(state.doc, $from.pos))
14201
14179
  return false;
14202
14180
  if (dispatch)
14203
14181
  dispatch(state.tr.split($from.pos).scrollIntoView());
14204
14182
  return true;
14205
14183
  }
14206
- if (!state.selection.$from.depth)
14184
+ if (!$from.depth)
14207
14185
  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;
14212
14186
  let types = [];
14213
14187
  let splitDepth, deflt, atEnd = false, atStart = false;
14214
14188
  for (let d = $from.depth;; d--) {
@@ -14227,7 +14201,10 @@ function splitBlockAs(splitNode) {
14227
14201
  types.unshift(null);
14228
14202
  }
14229
14203
  }
14230
- let splitPos = $from.pos;
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);
14231
14208
  let can = canSplit(tr.doc, splitPos, types.length, types);
14232
14209
  if (!can) {
14233
14210
  types[0] = deflt ? { type: deflt } : null;
@@ -14237,10 +14214,9 @@ function splitBlockAs(splitNode) {
14237
14214
  return false;
14238
14215
  tr.split(splitPos, types.length, types);
14239
14216
  if (!atEnd && atStart && $from.node(splitDepth).type != deflt) {
14240
- let mapping = tr.mapping.slice(mapFrom);
14241
- let first = mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);
14217
+ let first = tr.mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);
14242
14218
  if (deflt && $from.node(splitDepth - 1).canReplaceWith($first.index(), $first.index() + 1, deflt))
14243
- tr.setNodeMarkup(mapping.map($from.before(splitDepth)), deflt);
14219
+ tr.setNodeMarkup(tr.mapping.map($from.before(splitDepth)), deflt);
14244
14220
  }
14245
14221
  if (dispatch)
14246
14222
  dispatch(tr.scrollIntoView());
@@ -22881,12 +22857,12 @@ class KritzelCursorHelper {
22881
22857
  // We rotate around the center of the SVG canvas
22882
22858
  const center = size / 2;
22883
22859
  // We use a group to apply the rotation
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>
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>
22890
22866
  `;
22891
22867
  // Encode the SVG for use in a data URI
22892
22868
  // 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-2va1Pk9z.js';
2
- export { s as setNonce } from './index-2va1Pk9z.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-Dhio9uis.js';
2
+ export { s as setNonce } from './index-Dhio9uis.js';
3
3
  import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v4.44.2 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.43.5 | 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-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';
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';
3
3
  import * as Y from 'yjs';
4
4
  import { IndexeddbPersistence } from 'y-indexeddb';
5
5
  import { WebsocketProvider } from 'y-websocket';
@@ -549,9 +549,15 @@ class WebSocketSyncProvider {
549
549
  provider;
550
550
  isConnected = false;
551
551
  _quiet = false;
552
+ _isSynced = false;
553
+ _syncedResolvers = [];
552
554
  get awareness() {
553
555
  return this.provider.awareness;
554
556
  }
557
+ /** y-websocket applies remote updates with the underlying provider as the Yjs transaction origin. */
558
+ get updateOrigin() {
559
+ return this.provider;
560
+ }
555
561
  constructor(docName, doc, options) {
556
562
  const url = options?.url || 'ws://localhost:1234';
557
563
  const roomName = options?.roomName || docName;
@@ -598,11 +604,29 @@ class WebSocketSyncProvider {
598
604
  }
599
605
  });
600
606
  this.provider.on('sync', (synced) => {
601
- if (synced && !this._quiet) {
607
+ if (!synced) {
608
+ return;
609
+ }
610
+ this._isSynced = true;
611
+ this.releaseSyncedWaiters();
612
+ if (!this._quiet) {
602
613
  console.info('WebSocket synced');
603
614
  }
604
615
  });
605
616
  }
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
+ }
606
630
  async connect() {
607
631
  if (this.isConnected) {
608
632
  return;
@@ -634,6 +658,8 @@ class WebSocketSyncProvider {
634
658
  this.provider.disconnect();
635
659
  }
636
660
  this.isConnected = false;
661
+ this._isSynced = false;
662
+ this.releaseSyncedWaiters();
637
663
  }
638
664
  async reconnect() {
639
665
  this.disconnect();
@@ -644,6 +670,8 @@ class WebSocketSyncProvider {
644
670
  this.provider.destroy();
645
671
  }
646
672
  this.isConnected = false;
673
+ this._isSynced = false;
674
+ this.releaseSyncedWaiters();
647
675
  }
648
676
  }
649
677
 
@@ -665,9 +693,14 @@ class HocuspocusSyncProvider {
665
693
  _connectionStatus = 'disconnected';
666
694
  visibilityHandler = null;
667
695
  onlineHandler = null;
696
+ syncedResolvers = [];
668
697
  get awareness() {
669
698
  return this.provider.awareness;
670
699
  }
700
+ /** HocuspocusProvider applies remote updates with itself as the Yjs transaction origin. */
701
+ get updateOrigin() {
702
+ return this.provider;
703
+ }
671
704
  get connectionStatus() {
672
705
  return this._connectionStatus;
673
706
  }
@@ -724,6 +757,7 @@ class HocuspocusSyncProvider {
724
757
  }
725
758
  this.isSynced = true;
726
759
  this._connectionStatus = 'synced';
760
+ this.releaseSyncedWaiters();
727
761
  if (!options?.quiet) {
728
762
  console.info(`Hocuspocus synced: ${name}`);
729
763
  }
@@ -934,6 +968,19 @@ class HocuspocusSyncProvider {
934
968
  this.disconnect();
935
969
  return this.connect();
936
970
  }
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
+ }
937
984
  disconnect() {
938
985
  // Cancel any pending connection attempt
939
986
  if (this.connectTimeout) {
@@ -955,6 +1002,7 @@ class HocuspocusSyncProvider {
955
1002
  this.isConnected = false;
956
1003
  this.isSynced = false;
957
1004
  this._connectionStatus = 'disconnected';
1005
+ this.releaseSyncedWaiters();
958
1006
  }
959
1007
  destroy() {
960
1008
  // Mark as destroyed first to prevent any callbacks from doing work
@@ -974,6 +1022,7 @@ class HocuspocusSyncProvider {
974
1022
  this.isConnected = false;
975
1023
  this.isSynced = false;
976
1024
  this._connectionStatus = 'disconnected';
1025
+ this.releaseSyncedWaiters();
977
1026
  }
978
1027
  }
979
1028
 
@@ -5732,11 +5732,10 @@ class Fitter {
5732
5732
  }
5733
5733
  openMore() {
5734
5734
  let { content, openStart, openEnd } = this.unplaced;
5735
- if (maxOpen(content, -1) <= openStart)
5735
+ let inner = contentAt(content, openStart);
5736
+ if (!inner.childCount || inner.firstChild.isLeaf)
5736
5737
  return false;
5737
- if (this.unplaced.size > 1 && maxOpen(content, 1) > openEnd)
5738
- openEnd++;
5739
- this.unplaced = new Slice(content, openStart + 1, openEnd);
5738
+ this.unplaced = new Slice(content, openStart + 1, Math.max(openEnd, inner.size + openStart >= content.size - openEnd ? openStart + 1 : 0));
5740
5739
  return true;
5741
5740
  }
5742
5741
  dropNode() {
@@ -5906,14 +5905,6 @@ function invalidMarks(type, fragment, start) {
5906
5905
  function definesContent(type) {
5907
5906
  return type.spec.defining || type.spec.definingForContent;
5908
5907
  }
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
- }
5917
5908
  function replaceRange(tr, from, to, slice) {
5918
5909
  if (!slice.size)
5919
5910
  return tr.deleteRange(from, to);
@@ -8618,8 +8609,7 @@ class WidgetViewDesc extends ViewDesc {
8618
8609
  wrap.appendChild(dom);
8619
8610
  dom = wrap;
8620
8611
  }
8621
- if (!dom.hasAttribute("contenteditable"))
8622
- dom.contentEditable = "false";
8612
+ dom.contentEditable = "false";
8623
8613
  dom.classList.add("ProseMirror-widget");
8624
8614
  }
8625
8615
  super(parent, [], dom, null);
@@ -10467,14 +10457,8 @@ function maybeWrapTrusted(html) {
10467
10457
  // With the require-trusted-types-for CSP, Chrome will block
10468
10458
  // innerHTML, even on a detached document. This wraps the string in
10469
10459
  // a way that makes the browser allow us to use its parser again.
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
- }
10460
+ if (!_policy)
10461
+ _policy = trustedTypes.defaultPolicy || trustedTypes.createPolicy("ProseMirrorClipboard", { createHTML: (s) => s });
10478
10462
  return _policy.createHTML(html);
10479
10463
  }
10480
10464
  function readHTML(html) {
@@ -10531,12 +10515,6 @@ function addContext(slice, context) {
10531
10515
  let type = schema.nodes[array[i]];
10532
10516
  if (!type || type.hasRequiredAttrs())
10533
10517
  break;
10534
- try {
10535
- type.checkAttrs(array[i + 1]);
10536
- }
10537
- catch (e) {
10538
- break;
10539
- }
10540
10518
  content = Fragment.from(type.create(array[i + 1], content));
10541
10519
  openStart++;
10542
10520
  openEnd++;
@@ -14195,20 +14173,16 @@ a custom function to determine the type of the newly split off block.
14195
14173
  */
14196
14174
  function splitBlockAs(splitNode) {
14197
14175
  return (state, dispatch) => {
14176
+ let { $from} = state.selection;
14198
14177
  if (state.selection instanceof NodeSelection && state.selection.node.isBlock) {
14199
- let { $from } = state.selection;
14200
14178
  if (!$from.parentOffset || !canSplit(state.doc, $from.pos))
14201
14179
  return false;
14202
14180
  if (dispatch)
14203
14181
  dispatch(state.tr.split($from.pos).scrollIntoView());
14204
14182
  return true;
14205
14183
  }
14206
- if (!state.selection.$from.depth)
14184
+ if (!$from.depth)
14207
14185
  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;
14212
14186
  let types = [];
14213
14187
  let splitDepth, deflt, atEnd = false, atStart = false;
14214
14188
  for (let d = $from.depth;; d--) {
@@ -14227,7 +14201,10 @@ function splitBlockAs(splitNode) {
14227
14201
  types.unshift(null);
14228
14202
  }
14229
14203
  }
14230
- let splitPos = $from.pos;
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);
14231
14208
  let can = canSplit(tr.doc, splitPos, types.length, types);
14232
14209
  if (!can) {
14233
14210
  types[0] = deflt ? { type: deflt } : null;
@@ -14237,10 +14214,9 @@ function splitBlockAs(splitNode) {
14237
14214
  return false;
14238
14215
  tr.split(splitPos, types.length, types);
14239
14216
  if (!atEnd && atStart && $from.node(splitDepth).type != deflt) {
14240
- let mapping = tr.mapping.slice(mapFrom);
14241
- let first = mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);
14217
+ let first = tr.mapping.map($from.before(splitDepth)), $first = tr.doc.resolve(first);
14242
14218
  if (deflt && $from.node(splitDepth - 1).canReplaceWith($first.index(), $first.index() + 1, deflt))
14243
- tr.setNodeMarkup(mapping.map($from.before(splitDepth)), deflt);
14219
+ tr.setNodeMarkup(tr.mapping.map($from.before(splitDepth)), deflt);
14244
14220
  }
14245
14221
  if (dispatch)
14246
14222
  dispatch(tr.scrollIntoView());
@@ -22881,12 +22857,12 @@ class KritzelCursorHelper {
22881
22857
  // We rotate around the center of the SVG canvas
22882
22858
  const center = size / 2;
22883
22859
  // We use a group to apply the rotation
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>
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>
22890
22866
  `;
22891
22867
  // Encode the SVG for use in a data URI
22892
22868
  // We need to be careful with encoding to ensure it works across browsers
@@ -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.44.2 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
 
8
8
 
@@ -94,9 +94,7 @@ 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();
98
97
  var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
99
- var _a;
100
98
  const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
101
99
  const bundleId = cmpMeta.$lazyBundleId$;
102
100
  if (!bundleId) {
@@ -106,28 +104,21 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
106
104
  if (module) {
107
105
  return module[exportName];
108
106
  }
109
- const retryCount = (_a = failedLoadAttempts.get(bundleId)) != null ? _a : 0;
110
- const cacheBustParams = [
111
- retryCount > 0 ? `s-retry=${retryCount}` : "",
112
- ""
113
- ].filter(Boolean).join("&");
114
107
  /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
115
108
  return import(
116
109
  /* @vite-ignore */
117
110
  /* webpackInclude: /\.entry\.js$/ */
118
111
  /* webpackExclude: /\.system\.entry\.js$/ */
119
112
  /* webpackMode: "lazy" */
120
- `./${bundleId}.entry.js${cacheBustParams ? "?" + cacheBustParams : ""}`
113
+ `./${bundleId}.entry.js${""}`
121
114
  ).then(
122
115
  (importedModule) => {
123
116
  {
124
- failedLoadAttempts.delete(bundleId);
125
117
  cmpModules.set(bundleId, importedModule);
126
118
  }
127
119
  return importedModule[exportName];
128
120
  },
129
121
  (e) => {
130
- failedLoadAttempts.set(bundleId, retryCount + 1);
131
122
  consoleError(e, hostRef.$hostElement$);
132
123
  }
133
124
  );
@@ -137,8 +128,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
137
128
  var styles = /* @__PURE__ */ new Map();
138
129
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
139
130
  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;
142
131
  var win = typeof window !== "undefined" ? window : {};
143
132
  var plt = {
144
133
  $flags$: 0,
@@ -182,10 +171,6 @@ var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @_
182
171
  var queuePending = false;
183
172
  var queueDomReads = [];
184
173
  var queueDomWrites = [];
185
- var scheduleFlush = () => {
186
- var _a;
187
- return ((_a = win.document) == null ? void 0 : _a.hidden) ? nextTick(flush) : plt.raf(flush);
188
- };
189
174
  var queueTask = (queue, write) => (cb) => {
190
175
  queue.push(cb);
191
176
  if (!queuePending) {
@@ -193,7 +178,7 @@ var queueTask = (queue, write) => (cb) => {
193
178
  if (write && plt.$flags$ & 4 /* queueSync */) {
194
179
  nextTick(flush);
195
180
  } else {
196
- scheduleFlush();
181
+ plt.raf(flush);
197
182
  }
198
183
  }
199
184
  };
@@ -212,7 +197,7 @@ var flush = () => {
212
197
  {
213
198
  consume(queueDomWrites);
214
199
  if (queuePending = queueDomReads.length > 0) {
215
- scheduleFlush();
200
+ plt.raf(flush);
216
201
  }
217
202
  }
218
203
  };
@@ -404,11 +389,6 @@ var h = (nodeName, vnodeData, ...children) => {
404
389
  } else if (child != null && typeof child !== "boolean") {
405
390
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
406
391
  child = String(child);
407
- } else if (typeof nodeName !== "function" && child.$flags$ === void 0) {
408
- {
409
- consoleError("Invalid vNode child");
410
- }
411
- continue;
412
392
  }
413
393
  if (simple && lastSimple) {
414
394
  vNodeChildren[vNodeChildren.length - 1].$text$ += child;
@@ -637,7 +617,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
637
617
  }
638
618
  }
639
619
  if (newValue == null || newValue === false) {
640
- if (newValue !== false || elm.getAttribute(memberName) === "" || flags & 4 /* isHost */ && !isEnumeratedAttribute(memberName)) {
620
+ if (newValue !== false || elm.getAttribute(memberName) === "") {
641
621
  {
642
622
  elm.removeAttribute(memberName);
643
623
  }
@@ -650,8 +630,6 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
650
630
  }
651
631
  }
652
632
  };
653
- var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set(["draggable", "contenteditable", "spellcheck"]);
654
- var isEnumeratedAttribute = (attrName) => ENUMERATED_ATTRIBUTES.has(attrName) || attrName.startsWith("aria-");
655
633
  var parseClassListRegex = /\s/;
656
634
  var parseClassList = (value) => {
657
635
  if (typeof value === "object" && value && "baseVal" in value) {
@@ -959,7 +937,9 @@ var flushQueuedRefCallbacks = () => {
959
937
  }
960
938
  };
961
939
  var insertBefore = (parent, newNode, reference, isInitialLoad) => {
962
- {
940
+ if (parent.__insertBefore) {
941
+ return parent.__insertBefore(newNode, reference);
942
+ } else {
963
943
  return parent == null ? void 0 : parent.insertBefore(newNode, reference);
964
944
  }
965
945
  };
@@ -1227,7 +1207,6 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1227
1207
  };
1228
1208
 
1229
1209
  // src/runtime/proxy-component.ts
1230
- var reflectedAttrValue = (propValue) => propValue == null || propValue === false ? null : propValue === true ? "" : String(propValue);
1231
1210
  var proxyComponent = (Cstr, cmpMeta, flags) => {
1232
1211
  var _a, _b;
1233
1212
  const prototype = Cstr.prototype;
@@ -1360,13 +1339,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1360
1339
  return;
1361
1340
  }
1362
1341
  const propFlags = members.find(([m]) => m === propName);
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
- }
1342
+ const isBooleanTarget = propFlags && propFlags[1][0] & 4 /* Boolean */;
1370
1343
  const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
1371
1344
  if (isBooleanTarget) {
1372
1345
  newValue = newValue === null || newValue === "false" ? false : true;
@@ -1398,12 +1371,10 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1398
1371
 
1399
1372
  // src/runtime/initialize-component.ts
1400
1373
  var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1401
- var _a;
1402
1374
  let Cstr;
1403
1375
  try {
1404
1376
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1405
1377
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1406
- hostRef.$flags$ &= -1025 /* hasFailedLoad */;
1407
1378
  const bundleId = cmpMeta.$lazyBundleId$;
1408
1379
  if (bundleId) {
1409
1380
  const CstrImport = loadModule(cmpMeta, hostRef);
@@ -1415,11 +1386,6 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1415
1386
  Cstr = CstrImport;
1416
1387
  }
1417
1388
  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
- }
1423
1389
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1424
1390
  }
1425
1391
  if (!Cstr.isProxied) {
@@ -1481,7 +1447,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1481
1447
  hostRef.$onRenderResolve$();
1482
1448
  hostRef.$onRenderResolve$ = void 0;
1483
1449
  }
1484
- if (hostRef.$onReadyResolve$ && !(hostRef.$flags$ & 1024 /* hasFailedLoad */)) {
1450
+ if (hostRef.$onReadyResolve$) {
1485
1451
  hostRef.$onReadyResolve$(elm);
1486
1452
  }
1487
1453
  }
@@ -1528,8 +1494,6 @@ var connectedCallback = (elm) => {
1528
1494
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1529
1495
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1530
1496
  fireConnectedCallback(hostRef.$lazyInstance$, elm);
1531
- } else if (hostRef.$flags$ & 1024 /* hasFailedLoad */) {
1532
- setTimeout(() => initializeComponent(elm, hostRef, cmpMeta), LAZY_LOAD_RETRY_INTERVAL_MS);
1533
1497
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1534
1498
  hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
1535
1499
  }
@@ -1652,7 +1616,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1652
1616
  }
1653
1617
  disconnectedCallback() {
1654
1618
  plt.jmp(() => disconnectedCallback(this));
1655
- nextTick(() => {
1619
+ plt.raf(() => {
1656
1620
  var _a3;
1657
1621
  const hostRef = getHostRef(this);
1658
1622
  if (!hostRef) {