oasis-editor 0.0.12 → 0.0.13

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.
@@ -2214,14 +2214,14 @@ function t(key, params = []) {
2214
2214
  return template2;
2215
2215
  }
2216
2216
  const oasisMarkBase64 = "UklGRmQXAABXRUJQVlA4IFgXAACwWwCdASrAAAABPjEWiUMiISESyL50IAMEswHYDxjW/947Oi5/a/7H+1P90/ar5n65/UvwH+Q/QZm27Sf5n9r/I/5m/2n/p+wv9E/9j3AP07/0X92/HLuKeYL+mf4r/zf3f3tf9x+rnvH/z/qAfzf/J/9/sM/QX/bv02P28+Fb9s/2s+B39h//51gH//6yfrV/QO1z/CdMx6vl0OAGqD8Z+4X6H+9/up8b/6vvP+IeoL+Lfyr/CflxwuoAPz7+0/7T1iPk/9p6R/zXqAflpxyVAX8y+hD/5/6f0W/UX7UfAl/Ov75/zOxr6SR2HAT+kJLsdULBbdVn3b+sl8uZdjuThjIe3NwBwjfGz5SniiBN2m7i7b0hA/wxE1PuC+4EcbOyjUkU3CDDghPY1Va4tpUped9TFa05Qb1z7O+Ye73ccvEl10Sgdj6Hhy71hb/XpA23GjXBN/obAlaswz9gKwvW9d9npbC69rQeTm6DEr/cjrNngjQaHgFGjh4uVY1bY9Q+/iG037f80w0bLlYIe7smzz4tG1kC8r/KyWvzd3IXXrR2bKmhoB3Md69ltbERYFBI/2f+w7Jcsw+aUOGSwP6v6jv3tvwprg/7n5tto40/iRIKwEHQ5H/G5c0tpJ2pwREanIK3qHinjvovnkmuTw0mV2bumYqdc7he7hG0hpvBna8vIRpKYe6K1v3F8trOEtYUwr7w8e6j3nviknKtsFMtPtxZzn0YnhgtOn9inBlwqyEGR+wk7X1KHxOekXCA1UVbmLwGx1NqbI6r2WBOwQdpmpTg85DMOjwzW/JHUmfxKTDfhoXLi9gBMP/+Et6inspdrW1CHkZVLkDll2JyiPvClnvGv9m00oYce3evtpMlDhY3kVYGwfkoCHHyEv9i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Bq3qYQJQyOHbj/jl4eLRUxXLQgLorpnB4HNs4v40tGGosw2Ka6eDt5K6P8DQK5ozy56BizczJenDjZ5DYx1Xu3YLmI/quRSR8ORIJqwhWFwM+Q8/gNfUL/YgQHlHmfhYi5vjU0TzsgnLyhP/kOFSnR9zjJkIMcYAFB/Ft1tfks1aQiBMtgP4sabdMsauWXINaIyR9ClOZLdIZQVGHUgLjxKW6YiFUs72zTJmKtf/RovsidqZlmEXrWGZ3UuGplChFUtjEkvwi2XxICgc0grD+9/tRt47usAAADGbVjPUInsKZHILQ8Tdvbj09q/9k2Mg7uynD2e+HudOmr+jOK+SyWmKsSZ4pH89FUSffyxPKUMVNp8o1m1apG/WDvwhmHllHVfELy0BgfyAIevaAuIOzl4NX3ayQnv+tsCnIGxjvF1IwPLyoflKFrL2OBFh3pJ57ChDdzSC9IDKqpaycKVMm2mWUPGBLK2cpD+b4VPleMoNCtKZz4AileaHHtk77gduJB8sihmMPR1lV1Vba4pOywdJgGueqt4IcTd2RJFxeSRNjuzHcR4tYGdli66ijJZC20ODhr8miT+cauMIflgiAAAAA=";
2217
- var _tmpl$$Q = /* @__PURE__ */ template(`<img alt aria-hidden=true>`);
2217
+ var _tmpl$$R = /* @__PURE__ */ template(`<img alt aria-hidden=true>`);
2218
2218
  const OASIS_MARK_DATA_URI = `data:image/webp;base64,${oasisMarkBase64}`;
2219
2219
  const MARK_ASPECT = 3 / 4;
2220
2220
  function OasisBrandMark(props) {
2221
2221
  const height = () => props.height ?? 64;
2222
2222
  const width = () => Math.round(height() * MARK_ASPECT);
2223
2223
  return (() => {
2224
- var _el$ = _tmpl$$Q();
2224
+ var _el$ = _tmpl$$R();
2225
2225
  setAttribute(_el$, "src", OASIS_MARK_DATA_URI);
2226
2226
  setAttribute(_el$, "draggable", false);
2227
2227
  createRenderEffect((_p$) => {
@@ -2238,7 +2238,7 @@ function OasisBrandMark(props) {
2238
2238
  return _el$;
2239
2239
  })();
2240
2240
  }
2241
- var _tmpl$$P = /* @__PURE__ */ template(`<div class=oasis-editor-import-progress-label>`), _tmpl$2$w = /* @__PURE__ */ template(`<div role=status aria-live=polite><div class=oasis-editor-import-card><div class=oasis-editor-import-title></div><div class=oasis-editor-import-progress-track><div>`), _tmpl$3$k = /* @__PURE__ */ template(`<span class=oasis-editor-import-done-icon>Done`);
2241
+ var _tmpl$$Q = /* @__PURE__ */ template(`<div class=oasis-editor-import-progress-label>`), _tmpl$2$x = /* @__PURE__ */ template(`<div role=status aria-live=polite><div class=oasis-editor-import-card><div class=oasis-editor-import-title></div><div class=oasis-editor-import-progress-track><div>`), _tmpl$3$l = /* @__PURE__ */ template(`<span class=oasis-editor-import-done-icon>Done`);
2242
2242
  function OasisEditorLoading(props) {
2243
2243
  const variant = () => props.variant ?? "overlay";
2244
2244
  const pct = () => {
@@ -2247,7 +2247,7 @@ function OasisEditorLoading(props) {
2247
2247
  };
2248
2248
  const isDone = () => (pct() ?? 0) >= 100;
2249
2249
  return (() => {
2250
- var _el$ = _tmpl$2$w(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild;
2250
+ var _el$ = _tmpl$2$x(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild;
2251
2251
  insert(_el$2, createComponent(OasisBrandMark, {
2252
2252
  height: 40,
2253
2253
  "class": "oasis-editor-loading-mark"
@@ -2258,10 +2258,10 @@ function OasisEditorLoading(props) {
2258
2258
  return pct() != null;
2259
2259
  },
2260
2260
  get children() {
2261
- var _el$6 = _tmpl$$P();
2261
+ var _el$6 = _tmpl$$Q();
2262
2262
  insert(_el$6, (() => {
2263
2263
  var _c$ = memo(() => !!isDone());
2264
- return () => _c$() ? _tmpl$3$k() : `${pct()}%`;
2264
+ return () => _c$() ? _tmpl$3$l() : `${pct()}%`;
2265
2265
  })());
2266
2266
  return _el$6;
2267
2267
  }
@@ -2310,7 +2310,7 @@ function OasisEditorAppLazy(props = {}) {
2310
2310
  onCleanup(() => {
2311
2311
  cancelled = true;
2312
2312
  });
2313
- import("./OasisEditorApp-DsSNl4Fj.js").then((m) => {
2313
+ import("./OasisEditorApp-DYcAe_1n.js").then((m) => {
2314
2314
  cancelled = true;
2315
2315
  setProgress(1);
2316
2316
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -3423,11 +3423,17 @@ let nextTableRowId = 1;
3423
3423
  let nextTableCellId = 1;
3424
3424
  let nextFootnoteId = 1;
3425
3425
  let nextBookmarkId = 1;
3426
+ let nextCommentId = 1;
3426
3427
  function createEditorBookmarkId() {
3427
3428
  const id = `bookmark:${nextBookmarkId}`;
3428
3429
  nextBookmarkId += 1;
3429
3430
  return id;
3430
3431
  }
3432
+ function createEditorCommentId() {
3433
+ const id = `comment:${nextCommentId}`;
3434
+ nextCommentId += 1;
3435
+ return id;
3436
+ }
3431
3437
  function createEditorRun(text = "") {
3432
3438
  const run = {
3433
3439
  id: `run:${nextRunId}`,
@@ -4341,8 +4347,8 @@ class MenuRegistry {
4341
4347
  }
4342
4348
  }
4343
4349
  const defaultMenuRegistry = new MenuRegistry();
4344
- var _tmpl$$O = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none aria-hidden=true><text x=2 y=18 font-family="'Segoe UI', Arial, sans-serif"font-size=14 font-weight=700 fill=currentColor>ab</text><text x=15.5 y=11 font-family="'Segoe UI', Arial, sans-serif"font-size=10 font-weight=700 fill=#c00000>1`), _tmpl$2$v = /* @__PURE__ */ template(`<i>`);
4345
- const FootnoteIcon = () => _tmpl$$O();
4350
+ var _tmpl$$P = /* @__PURE__ */ template(`<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none aria-hidden=true><text x=2 y=18 font-family="'Segoe UI', Arial, sans-serif"font-size=14 font-weight=700 fill=currentColor>ab</text><text x=15.5 y=11 font-family="'Segoe UI', Arial, sans-serif"font-size=10 font-weight=700 fill=#c00000>1`), _tmpl$2$w = /* @__PURE__ */ template(`<i>`);
4351
+ const FootnoteIcon = () => _tmpl$$P();
4346
4352
  const CUSTOM_ICONS = {
4347
4353
  footnote: FootnoteIcon
4348
4354
  };
@@ -4356,7 +4362,7 @@ function ToolIcon(props) {
4356
4362
  },
4357
4363
  get fallback() {
4358
4364
  return (() => {
4359
- var _el$2 = _tmpl$2$v();
4365
+ var _el$2 = _tmpl$2$w();
4360
4366
  createRenderEffect(() => setAttribute(_el$2, "data-lucide", props.name));
4361
4367
  return _el$2;
4362
4368
  })();
@@ -4685,7 +4691,7 @@ const defaultMenuItems = [
4685
4691
  }
4686
4692
  ];
4687
4693
  defaultMenuItems.forEach((item) => defaultMenuRegistry.register(item));
4688
- var _tmpl$$N = /* @__PURE__ */ template(`<div class=oasis-menubar role=menubar>`), _tmpl$2$u = /* @__PURE__ */ template(`<div class=oasis-menubar-dropdown role=menu>`), _tmpl$3$j = /* @__PURE__ */ template(`<div class=oasis-menubar-menu><div class=oasis-menubar-button role=menuitem aria-haspopup=true>`), _tmpl$4$d = /* @__PURE__ */ template(`<div class=oasis-menubar-separator role=separator>`), _tmpl$5$c = /* @__PURE__ */ template(`<span class=oasis-menubar-item-icon aria-hidden=true>`), _tmpl$6$6 = /* @__PURE__ */ template(`<span class=oasis-menubar-shortcut>`), _tmpl$7$3 = /* @__PURE__ */ template(`<i class=oasis-menubar-submenu-icon data-lucide=chevron-right>`), _tmpl$8$2 = /* @__PURE__ */ template(`<div class=oasis-menubar-submenu role=menu>`), _tmpl$9$1 = /* @__PURE__ */ template(`<div class=oasis-menubar-item role=menuitem><span class=oasis-menubar-item-main><span>`);
4694
+ var _tmpl$$O = /* @__PURE__ */ template(`<div class=oasis-menubar role=menubar>`), _tmpl$2$v = /* @__PURE__ */ template(`<div class=oasis-menubar-dropdown role=menu>`), _tmpl$3$k = /* @__PURE__ */ template(`<div class=oasis-menubar-menu><div class=oasis-menubar-button role=menuitem aria-haspopup=true>`), _tmpl$4$e = /* @__PURE__ */ template(`<div class=oasis-menubar-separator role=separator>`), _tmpl$5$d = /* @__PURE__ */ template(`<span class=oasis-menubar-item-icon aria-hidden=true>`), _tmpl$6$6 = /* @__PURE__ */ template(`<span class=oasis-menubar-shortcut>`), _tmpl$7$3 = /* @__PURE__ */ template(`<i class=oasis-menubar-submenu-icon data-lucide=chevron-right>`), _tmpl$8$2 = /* @__PURE__ */ template(`<div class=oasis-menubar-submenu role=menu>`), _tmpl$9$1 = /* @__PURE__ */ template(`<div class=oasis-menubar-item role=menuitem><span class=oasis-menubar-item-main><span>`);
4689
4695
  function Menubar(props) {
4690
4696
  const [activeMenu, setActiveMenu] = createSignal(null);
4691
4697
  const menuItems = () => (props.registry ?? defaultMenuRegistry).getItems();
@@ -4752,13 +4758,13 @@ function Menubar(props) {
4752
4758
  });
4753
4759
  const topLevelItems = () => pruneTree(menuTree());
4754
4760
  return (() => {
4755
- var _el$ = _tmpl$$N();
4761
+ var _el$ = _tmpl$$O();
4756
4762
  insert(_el$, createComponent(For, {
4757
4763
  get each() {
4758
4764
  return topLevelItems();
4759
4765
  },
4760
4766
  children: (topLevel) => (() => {
4761
- var _el$2 = _tmpl$3$j(), _el$3 = _el$2.firstChild;
4767
+ var _el$2 = _tmpl$3$k(), _el$3 = _el$2.firstChild;
4762
4768
  _el$2.addEventListener("mouseenter", () => {
4763
4769
  if (activeMenu() && activeMenu() !== topLevel.id) {
4764
4770
  setActiveMenu(topLevel.id);
@@ -4778,7 +4784,7 @@ function Menubar(props) {
4778
4784
  return activeMenu() === topLevel.id;
4779
4785
  },
4780
4786
  get children() {
4781
- var _el$4 = _tmpl$2$u();
4787
+ var _el$4 = _tmpl$2$v();
4782
4788
  insert(_el$4, createComponent(For, {
4783
4789
  get each() {
4784
4790
  return topLevel.children;
@@ -4817,7 +4823,7 @@ function MenuNode(props) {
4817
4823
  } = props;
4818
4824
  const isSeparator = (_a = node.item) == null ? void 0 : _a.separator;
4819
4825
  if (isSeparator) {
4820
- return _tmpl$4$d();
4826
+ return _tmpl$4$e();
4821
4827
  }
4822
4828
  const hasChildren = node.children.length > 0;
4823
4829
  const [showSub, setShowSub] = createSignal(false);
@@ -4852,7 +4858,7 @@ function MenuNode(props) {
4852
4858
  return icon();
4853
4859
  },
4854
4860
  get children() {
4855
- var _el$8 = _tmpl$5$c();
4861
+ var _el$8 = _tmpl$5$d();
4856
4862
  insert(_el$8, createComponent(ToolIcon, {
4857
4863
  get name() {
4858
4864
  return icon();
@@ -4905,10 +4911,10 @@ function MenuNode(props) {
4905
4911
  })();
4906
4912
  }
4907
4913
  delegateEvents(["click"]);
4908
- var _tmpl$$M = /* @__PURE__ */ template(`<div class=oasis-titlebar><div class=oasis-titlebar-left><div class=oasis-titlebar-menubar-slot>`);
4914
+ var _tmpl$$N = /* @__PURE__ */ template(`<div class=oasis-titlebar><div class=oasis-titlebar-left><div class=oasis-titlebar-menubar-slot>`);
4909
4915
  function TitleBar(props) {
4910
4916
  return (() => {
4911
- var _el$ = _tmpl$$M(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
4917
+ var _el$ = _tmpl$$N(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
4912
4918
  insert(_el$3, () => props.children);
4913
4919
  return _el$;
4914
4920
  })();
@@ -16874,7 +16880,7 @@ function getCaretRectFromSnapshot(snapshot, position2, paragraphOffset) {
16874
16880
  );
16875
16881
  return rectFromBox(slot.left, slot.top, 1, slot.height || line.height);
16876
16882
  }
16877
- var _tmpl$$L = /* @__PURE__ */ template(`<span class=oasis-outline-title>`), _tmpl$2$t = /* @__PURE__ */ template(`<div class=oasis-outline-list>`), _tmpl$3$i = /* @__PURE__ */ template(`<div class=oasis-outline-panel><div class=oasis-outline-header><button class=oasis-outline-toggle><i>`), _tmpl$4$c = /* @__PURE__ */ template(`<div class=oasis-outline-empty>`), _tmpl$5$b = /* @__PURE__ */ template(`<div class=oasis-outline-item>`);
16883
+ var _tmpl$$M = /* @__PURE__ */ template(`<span class=oasis-outline-title>`), _tmpl$2$u = /* @__PURE__ */ template(`<div class=oasis-outline-list>`), _tmpl$3$j = /* @__PURE__ */ template(`<div class=oasis-outline-panel><div class=oasis-outline-header><button class=oasis-outline-toggle><i>`), _tmpl$4$d = /* @__PURE__ */ template(`<div class=oasis-outline-empty>`), _tmpl$5$c = /* @__PURE__ */ template(`<div class=oasis-outline-item>`);
16878
16884
  function OutlinePanel(props) {
16879
16885
  const [collapsed, setCollapsed] = createSignal(props.defaultCollapsed ?? false);
16880
16886
  const [items, setItems] = createSignal([]);
@@ -16942,13 +16948,13 @@ function OutlinePanel(props) {
16942
16948
  }
16943
16949
  });
16944
16950
  return (() => {
16945
- var _el$ = _tmpl$3$i(), _el$2 = _el$.firstChild, _el$4 = _el$2.firstChild, _el$5 = _el$4.firstChild;
16951
+ var _el$ = _tmpl$3$j(), _el$2 = _el$.firstChild, _el$4 = _el$2.firstChild, _el$5 = _el$4.firstChild;
16946
16952
  insert(_el$2, createComponent(Show, {
16947
16953
  get when() {
16948
16954
  return !collapsed();
16949
16955
  },
16950
16956
  get children() {
16951
- var _el$3 = _tmpl$$L();
16957
+ var _el$3 = _tmpl$$M();
16952
16958
  insert(_el$3, () => t("menu.view.outline") || "Outline");
16953
16959
  return _el$3;
16954
16960
  }
@@ -16959,14 +16965,14 @@ function OutlinePanel(props) {
16959
16965
  return !collapsed();
16960
16966
  },
16961
16967
  get children() {
16962
- var _el$6 = _tmpl$2$t();
16968
+ var _el$6 = _tmpl$2$u();
16963
16969
  insert(_el$6, createComponent(Show, {
16964
16970
  get when() {
16965
16971
  return items().length > 0;
16966
16972
  },
16967
16973
  get fallback() {
16968
16974
  return (() => {
16969
- var _el$7 = _tmpl$4$c();
16975
+ var _el$7 = _tmpl$4$d();
16970
16976
  insert(_el$7, () => t("outline.empty"));
16971
16977
  return _el$7;
16972
16978
  })();
@@ -16977,7 +16983,7 @@ function OutlinePanel(props) {
16977
16983
  return items();
16978
16984
  },
16979
16985
  children: (item) => (() => {
16980
- var _el$8 = _tmpl$5$b();
16986
+ var _el$8 = _tmpl$5$c();
16981
16987
  _el$8.$$click = () => props.onNavigate(item.anchor);
16982
16988
  insert(_el$8, () => item.text);
16983
16989
  createRenderEffect((_p$) => {
@@ -17016,7 +17022,7 @@ function OutlinePanel(props) {
17016
17022
  })();
17017
17023
  }
17018
17024
  delegateEvents(["click"]);
17019
- var _tmpl$$K = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-overflow-manager style="display:flex;align-items:center;flex:1 1 0%;min-width:0;position:relative;margin-right:8px"><button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown oasis-editor-toolbar-more-measure"aria-hidden=true tabindex=-1 style=position:absolute;visibility:hidden;pointer-events:none;right:0><i data-lucide=ellipsis></i></button><div style="display:flex;align-items:center;gap:8px;flex:1 1 0;min-width:0;overflow:hidden"></div><div style=flex-shrink:0;padding-left:8px;padding-right:16px;align-items:center><button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown"data-testid=editor-toolbar-overflow-dropdown><i data-lucide=ellipsis></i></button></div><div class="oasis-editor-toolbar-overflow-dropdown-menu oasis-editor-toolbar-overflow-menu"style="flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px;padding:8px;background:var(--oasis-paper);border:1px solid var(--oasis-toolbar-border);border-radius:var(--oasis-radius);box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);max-width:calc(100vw - 16px);overflow-x:hidden;overflow-y:auto">`), _tmpl$2$s = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-item-wrapper style=display:flex;align-items:center;flex-shrink:0>`);
17025
+ var _tmpl$$L = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-overflow-manager style="display:flex;align-items:center;flex:1 1 0%;min-width:0;position:relative;margin-right:8px"><button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown oasis-editor-toolbar-more-measure"aria-hidden=true tabindex=-1 style=position:absolute;visibility:hidden;pointer-events:none;right:0><i data-lucide=ellipsis></i></button><div style="display:flex;align-items:center;gap:8px;flex:1 1 0;min-width:0;overflow:hidden"></div><div style=flex-shrink:0;padding-left:8px;padding-right:16px;align-items:center><button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown"data-testid=editor-toolbar-overflow-dropdown><i data-lucide=ellipsis></i></button></div><div class="oasis-editor-toolbar-overflow-dropdown-menu oasis-editor-toolbar-overflow-menu"style="flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px;padding:8px;background:var(--oasis-paper);border:1px solid var(--oasis-toolbar-border);border-radius:var(--oasis-radius);box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);max-width:calc(100vw - 16px);overflow-x:hidden;overflow-y:auto">`), _tmpl$2$t = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-item-wrapper style=display:flex;align-items:center;flex-shrink:0>`);
17020
17026
  function ToolbarOverflowManager(props) {
17021
17027
  const [overflowCount, setOverflowCount] = createSignal(0);
17022
17028
  const [menuOpen, setMenuOpen] = createSignal(false);
@@ -17159,7 +17165,7 @@ function ToolbarOverflowManager(props) {
17159
17165
  };
17160
17166
  };
17161
17167
  return (() => {
17162
- var _el$ = _tmpl$$K(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$4.nextSibling;
17168
+ var _el$ = _tmpl$$L(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$5 = _el$4.firstChild, _el$6 = _el$4.nextSibling;
17163
17169
  var _ref$ = containerRef;
17164
17170
  typeof _ref$ === "function" ? use(_ref$, _el$) : containerRef = _el$;
17165
17171
  var _ref$2 = moreMeasureRef;
@@ -17171,7 +17177,7 @@ function ToolbarOverflowManager(props) {
17171
17177
  return items();
17172
17178
  },
17173
17179
  children: (item) => (() => {
17174
- var _el$7 = _tmpl$2$s();
17180
+ var _el$7 = _tmpl$2$t();
17175
17181
  insert(_el$7, item);
17176
17182
  return _el$7;
17177
17183
  })()
@@ -17247,12 +17253,12 @@ function resolveLabel(item, api) {
17247
17253
  if (item.labelKey) return api.t(item.labelKey);
17248
17254
  return void 0;
17249
17255
  }
17250
- var _tmpl$$J = /* @__PURE__ */ template(`<span>`), _tmpl$2$r = /* @__PURE__ */ template(`<button type=button>`);
17256
+ var _tmpl$$K = /* @__PURE__ */ template(`<span>`), _tmpl$2$s = /* @__PURE__ */ template(`<button type=button>`);
17251
17257
  function Button$1(props) {
17252
17258
  const [local, others] = splitProps(props, ["icon", "label", "active", "tooltip", "wide", "aria-label", "class", "classList"]);
17253
17259
  const ariaLabel = () => local["aria-label"] || local.tooltip || local.label || "";
17254
17260
  return (() => {
17255
- var _el$ = _tmpl$2$r();
17261
+ var _el$ = _tmpl$2$s();
17256
17262
  spread(_el$, mergeProps({
17257
17263
  get ["class"]() {
17258
17264
  return `oasis-editor-tool-button ${local.class || ""}`;
@@ -17288,7 +17294,7 @@ function Button$1(props) {
17288
17294
  return local.label;
17289
17295
  },
17290
17296
  get children() {
17291
- var _el$2 = _tmpl$$J();
17297
+ var _el$2 = _tmpl$$K();
17292
17298
  insert(_el$2, () => local.label);
17293
17299
  return _el$2;
17294
17300
  }
@@ -17370,7 +17376,7 @@ function useDismiss(options) {
17370
17376
  });
17371
17377
  });
17372
17378
  }
17373
- var _tmpl$$I = /* @__PURE__ */ template(`<div>`);
17379
+ var _tmpl$$J = /* @__PURE__ */ template(`<div>`);
17374
17380
  function Popover(props) {
17375
17381
  let anchorRef;
17376
17382
  let panelRef;
@@ -17387,7 +17393,7 @@ function Popover(props) {
17387
17393
  closeOnEscape: props.closeOnEscape
17388
17394
  });
17389
17395
  const panel = (portalled) => (() => {
17390
- var _el$ = _tmpl$$I();
17396
+ var _el$ = _tmpl$$J();
17391
17397
  addEventListener(_el$, "mouseleave", props.onPanelMouseLeave);
17392
17398
  var _ref$ = panelRef;
17393
17399
  typeof _ref$ === "function" ? use(_ref$, _el$) : panelRef = _el$;
@@ -17439,12 +17445,12 @@ function Popover(props) {
17439
17445
  }
17440
17446
  })];
17441
17447
  }
17442
- var _tmpl$$H = /* @__PURE__ */ template(`<div>`), _tmpl$2$q = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$3$h = /* @__PURE__ */ template(`<i>`), _tmpl$4$b = /* @__PURE__ */ template(`<span class=oasis-editor-tool-button-label>`), _tmpl$5$a = /* @__PURE__ */ template(`<i data-lucide=chevron-down class=oasis-editor-dropdown-chevron>`), _tmpl$6$5 = /* @__PURE__ */ template(`<button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown"aria-haspopup=menu>`);
17448
+ var _tmpl$$I = /* @__PURE__ */ template(`<div>`), _tmpl$2$r = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$3$i = /* @__PURE__ */ template(`<i>`), _tmpl$4$c = /* @__PURE__ */ template(`<span class=oasis-editor-tool-button-label>`), _tmpl$5$b = /* @__PURE__ */ template(`<i data-lucide=chevron-down class=oasis-editor-dropdown-chevron>`), _tmpl$6$5 = /* @__PURE__ */ template(`<button type=button class="oasis-editor-tool-button oasis-editor-tool-button-dropdown"aria-haspopup=menu>`);
17443
17449
  function Menu(props) {
17444
17450
  const [open, setOpen] = createSignal(false);
17445
17451
  const ariaLabel = () => props.tooltip || props.label || "";
17446
17452
  return (() => {
17447
- var _el$ = _tmpl$2$q();
17453
+ var _el$ = _tmpl$2$r();
17448
17454
  insert(_el$, createComponent(Popover, {
17449
17455
  get open() {
17450
17456
  return open();
@@ -17467,7 +17473,7 @@ function Menu(props) {
17467
17473
  return props.icon;
17468
17474
  },
17469
17475
  get children() {
17470
- var _el$4 = _tmpl$3$h();
17476
+ var _el$4 = _tmpl$3$i();
17471
17477
  createRenderEffect(() => setAttribute(_el$4, "data-lucide", props.icon));
17472
17478
  return _el$4;
17473
17479
  }
@@ -17477,7 +17483,7 @@ function Menu(props) {
17477
17483
  return props.label;
17478
17484
  },
17479
17485
  get children() {
17480
- var _el$5 = _tmpl$4$b();
17486
+ var _el$5 = _tmpl$4$c();
17481
17487
  insert(_el$5, () => props.label);
17482
17488
  return _el$5;
17483
17489
  }
@@ -17487,7 +17493,7 @@ function Menu(props) {
17487
17493
  return !props.hideChevron;
17488
17494
  },
17489
17495
  get children() {
17490
- return _tmpl$5$a();
17496
+ return _tmpl$5$b();
17491
17497
  }
17492
17498
  }), null);
17493
17499
  createRenderEffect((_p$) => {
@@ -17510,7 +17516,7 @@ function Menu(props) {
17510
17516
  return _el$3;
17511
17517
  })(),
17512
17518
  get children() {
17513
- var _el$2 = _tmpl$$H();
17519
+ var _el$2 = _tmpl$$I();
17514
17520
  _el$2.$$click = (event) => {
17515
17521
  const el = event.target;
17516
17522
  if (el.closest("button") && !el.closest(".oasis-editor-tool-button-dropdown") && !el.closest(".oasis-editor-toolbar-list-options")) {
@@ -17525,7 +17531,7 @@ function Menu(props) {
17525
17531
  })();
17526
17532
  }
17527
17533
  delegateEvents(["click"]);
17528
- var _tmpl$$G = /* @__PURE__ */ template(`<select>`);
17534
+ var _tmpl$$H = /* @__PURE__ */ template(`<select>`);
17529
17535
  function Select(props) {
17530
17536
  let selectRef;
17531
17537
  const [local, others] = splitProps(props, ["wide", "small", "class", "tooltip", "aria-label", "value"]);
@@ -17541,7 +17547,7 @@ function Select(props) {
17541
17547
  }
17542
17548
  });
17543
17549
  return (() => {
17544
- var _el$ = _tmpl$$G();
17550
+ var _el$ = _tmpl$$H();
17545
17551
  var _ref$ = selectRef;
17546
17552
  typeof _ref$ === "function" ? use(_ref$, _el$) : selectRef = _el$;
17547
17553
  spread(_el$, mergeProps({
@@ -17568,15 +17574,15 @@ function Select(props) {
17568
17574
  return _el$;
17569
17575
  })();
17570
17576
  }
17571
- var _tmpl$$F = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-separator>`);
17577
+ var _tmpl$$G = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-separator>`);
17572
17578
  function Separator(props) {
17573
17579
  return (() => {
17574
- var _el$ = _tmpl$$F();
17580
+ var _el$ = _tmpl$$G();
17575
17581
  createRenderEffect((_$p) => setStyleProperty(_el$, "display", props.hidden ? "none" : void 0));
17576
17582
  return _el$;
17577
17583
  })();
17578
17584
  }
17579
- var _tmpl$$E = /* @__PURE__ */ template(`<div><button type=button class=oasis-editor-color-split-main></button><button type=button class=oasis-editor-color-split-menu-button aria-haspopup=menu><i data-lucide=chevron-down>`);
17585
+ var _tmpl$$F = /* @__PURE__ */ template(`<div><button type=button class=oasis-editor-color-split-main></button><button type=button class=oasis-editor-color-split-menu-button aria-haspopup=menu><i data-lucide=chevron-down>`);
17580
17586
  function SplitButton(props) {
17581
17587
  return createComponent(Popover, {
17582
17588
  get open() {
@@ -17595,7 +17601,7 @@ function SplitButton(props) {
17595
17601
  return props.onPanelMouseLeave;
17596
17602
  },
17597
17603
  trigger: (api) => (() => {
17598
- var _el$ = _tmpl$$E(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
17604
+ var _el$ = _tmpl$$F(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
17599
17605
  use((el) => api.ref(el), _el$);
17600
17606
  _el$2.$$click = () => props.onMain();
17601
17607
  insert(_el$2, () => props.mainContent);
@@ -17633,7 +17639,7 @@ function SplitButton(props) {
17633
17639
  });
17634
17640
  }
17635
17641
  delegateEvents(["click"]);
17636
- var _tmpl$$D = /* @__PURE__ */ template(`<i data-lucide=type>`), _tmpl$2$p = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class=oasis-editor-color-menu-action-swatch></span><span>`), _tmpl$3$g = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-theme-grid>`), _tmpl$4$a = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-standard-grid>`), _tmpl$5$9 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class="oasis-editor-color-menu-action-swatch oasis-editor-color-menu-more-swatch"></span><span>`), _tmpl$6$4 = /* @__PURE__ */ template(`<input type=color class=oasis-editor-color-custom-input>`), _tmpl$7$2 = /* @__PURE__ */ template(`<span class=oasis-editor-color-split-icon><i></i><span class=oasis-editor-color-split-indicator>`), _tmpl$8$1 = /* @__PURE__ */ template(`<i data-lucide=slash>`), _tmpl$9 = /* @__PURE__ */ template(`<div class=oasis-editor-color-theme-column>`), _tmpl$0 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-swatch>`);
17642
+ var _tmpl$$E = /* @__PURE__ */ template(`<i data-lucide=type>`), _tmpl$2$q = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class=oasis-editor-color-menu-action-swatch></span><span>`), _tmpl$3$h = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-theme-grid>`), _tmpl$4$b = /* @__PURE__ */ template(`<div class=oasis-editor-color-menu-section><div class=oasis-editor-color-menu-heading></div><div class=oasis-editor-color-standard-grid>`), _tmpl$5$a = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-menu-action role=menuitem><span class="oasis-editor-color-menu-action-swatch oasis-editor-color-menu-more-swatch"></span><span>`), _tmpl$6$4 = /* @__PURE__ */ template(`<input type=color class=oasis-editor-color-custom-input>`), _tmpl$7$2 = /* @__PURE__ */ template(`<span class=oasis-editor-color-split-icon><i></i><span class=oasis-editor-color-split-indicator>`), _tmpl$8$1 = /* @__PURE__ */ template(`<i data-lucide=slash>`), _tmpl$9 = /* @__PURE__ */ template(`<div class=oasis-editor-color-theme-column>`), _tmpl$0 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-color-swatch>`);
17637
17643
  const normalizeColor = (value) => (value == null ? void 0 : value.trim().toLowerCase()) ?? "";
17638
17644
  function ColorPicker(props) {
17639
17645
  const [isOpen, setIsOpen] = createSignal(false);
@@ -17698,7 +17704,7 @@ function ColorPicker(props) {
17698
17704
  return clearLabel();
17699
17705
  },
17700
17706
  get children() {
17701
- var _el$ = _tmpl$2$p(), _el$2 = _el$.firstChild, _el$4 = _el$2.nextSibling;
17707
+ var _el$ = _tmpl$2$q(), _el$2 = _el$.firstChild, _el$4 = _el$2.nextSibling;
17702
17708
  _el$.$$click = () => applyColor(null);
17703
17709
  insert(_el$2, createComponent(Show, {
17704
17710
  get when() {
@@ -17708,7 +17714,7 @@ function ColorPicker(props) {
17708
17714
  return _tmpl$8$1();
17709
17715
  },
17710
17716
  get children() {
17711
- return _tmpl$$D();
17717
+ return _tmpl$$E();
17712
17718
  }
17713
17719
  }));
17714
17720
  insert(_el$4, clearLabel);
@@ -17716,7 +17722,7 @@ function ColorPicker(props) {
17716
17722
  return _el$;
17717
17723
  }
17718
17724
  }), (() => {
17719
- var _el$5 = _tmpl$3$g(), _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
17725
+ var _el$5 = _tmpl$3$h(), _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
17720
17726
  insert(_el$6, () => props.themeColorsLabel);
17721
17727
  insert(_el$7, createComponent(For, {
17722
17728
  get each() {
@@ -17756,7 +17762,7 @@ function ColorPicker(props) {
17756
17762
  }));
17757
17763
  return _el$5;
17758
17764
  })(), (() => {
17759
- var _el$8 = _tmpl$4$a(), _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
17765
+ var _el$8 = _tmpl$4$b(), _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling;
17760
17766
  insert(_el$9, () => props.standardColorsLabel);
17761
17767
  insert(_el$0, createComponent(For, {
17762
17768
  get each() {
@@ -17793,7 +17799,7 @@ function ColorPicker(props) {
17793
17799
  },
17794
17800
  get children() {
17795
17801
  return [(() => {
17796
- var _el$1 = _tmpl$5$9(), _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
17802
+ var _el$1 = _tmpl$5$a(), _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
17797
17803
  _el$1.$$click = () => customColorInputRef == null ? void 0 : customColorInputRef.click();
17798
17804
  insert(_el$11, () => props.moreColorsLabel);
17799
17805
  createRenderEffect(() => setAttribute(_el$1, "data-testid", `${props.testId}-more-colors`));
@@ -17821,7 +17827,7 @@ function ColorPicker(props) {
17821
17827
  });
17822
17828
  }
17823
17829
  delegateEvents(["click", "input"]);
17824
- var _tmpl$$C = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-status>`), _tmpl$2$o = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-grid>`), _tmpl$3$f = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$4$9 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-tool-button><i>`), _tmpl$5$8 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-table-grid-picker-cell>`);
17830
+ var _tmpl$$D = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-status>`), _tmpl$2$p = /* @__PURE__ */ template(`<div class=oasis-editor-table-grid-picker-grid>`), _tmpl$3$g = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-dropdown>`), _tmpl$4$a = /* @__PURE__ */ template(`<button type=button class=oasis-editor-tool-button><i>`), _tmpl$5$9 = /* @__PURE__ */ template(`<button type=button class=oasis-editor-table-grid-picker-cell>`);
17825
17831
  function GridPicker(props) {
17826
17832
  const [isOpen, setIsOpen] = createSignal(false);
17827
17833
  const [hover, setHover] = createSignal({
@@ -17895,7 +17901,7 @@ function GridPicker(props) {
17895
17901
  return h.row === 0 || h.col === 0 ? t("toolbar.table") : `${h.row} × ${h.col}`;
17896
17902
  };
17897
17903
  return (() => {
17898
- var _el$ = _tmpl$3$f();
17904
+ var _el$ = _tmpl$3$g();
17899
17905
  insert(_el$, createComponent(Popover, {
17900
17906
  get open() {
17901
17907
  return isOpen();
@@ -17907,7 +17913,7 @@ function GridPicker(props) {
17907
17913
  col: 0
17908
17914
  }),
17909
17915
  trigger: (api) => (() => {
17910
- var _el$4 = _tmpl$4$9(), _el$5 = _el$4.firstChild;
17916
+ var _el$4 = _tmpl$4$a(), _el$5 = _el$4.firstChild;
17911
17917
  _el$4.$$click = () => api.toggle();
17912
17918
  use((el) => api.ref(el), _el$4);
17913
17919
  createRenderEffect((_p$) => {
@@ -17929,11 +17935,11 @@ function GridPicker(props) {
17929
17935
  })(),
17930
17936
  get children() {
17931
17937
  return [(() => {
17932
- var _el$2 = _tmpl$$C();
17938
+ var _el$2 = _tmpl$$D();
17933
17939
  insert(_el$2, statusLabel);
17934
17940
  return _el$2;
17935
17941
  })(), (() => {
17936
- var _el$3 = _tmpl$2$o();
17942
+ var _el$3 = _tmpl$2$p();
17937
17943
  insert(_el$3, createComponent(For, {
17938
17944
  get each() {
17939
17945
  return rows();
@@ -17943,7 +17949,7 @@ function GridPicker(props) {
17943
17949
  return cols();
17944
17950
  },
17945
17951
  children: (c) => (() => {
17946
- var _el$6 = _tmpl$5$8();
17952
+ var _el$6 = _tmpl$5$9();
17947
17953
  _el$6.$$click = () => selectGridSize(r, c);
17948
17954
  _el$6.$$mousedown = (event) => event.preventDefault();
17949
17955
  _el$6.addEventListener("mouseenter", () => setHover({
@@ -18033,7 +18039,7 @@ const DEFAULT_PALETTE = {
18033
18039
  standardColors: STANDARD_COLORS,
18034
18040
  allowCustom: true
18035
18041
  };
18036
- var _tmpl$$B = /* @__PURE__ */ template(`<i>`), _tmpl$2$n = /* @__PURE__ */ template(`<option value>`), _tmpl$3$e = /* @__PURE__ */ template(`<option>`);
18042
+ var _tmpl$$C = /* @__PURE__ */ template(`<i>`), _tmpl$2$o = /* @__PURE__ */ template(`<option value>`), _tmpl$3$f = /* @__PURE__ */ template(`<option>`);
18037
18043
  function renderMenuContent(content, api) {
18038
18044
  if (content.kind === "custom") {
18039
18045
  return content.render(api);
@@ -18165,7 +18171,7 @@ function RenderSplit(props) {
18165
18171
  panelRole: "menu",
18166
18172
  get mainContent() {
18167
18173
  return (() => {
18168
- var _el$ = _tmpl$$B();
18174
+ var _el$ = _tmpl$$C();
18169
18175
  createRenderEffect(() => setAttribute(_el$, "data-lucide", props.item.iconName));
18170
18176
  return _el$;
18171
18177
  })();
@@ -18204,7 +18210,7 @@ function RenderSelect(props) {
18204
18210
  return props.item.placeholder !== void 0;
18205
18211
  },
18206
18212
  get children() {
18207
- var _el$2 = _tmpl$2$n();
18213
+ var _el$2 = _tmpl$2$o();
18208
18214
  insert(_el$2, () => props.item.placeholder);
18209
18215
  return _el$2;
18210
18216
  }
@@ -18213,7 +18219,7 @@ function RenderSelect(props) {
18213
18219
  return props.item.options(props.api);
18214
18220
  },
18215
18221
  children: (option) => (() => {
18216
- var _el$3 = _tmpl$3$e();
18222
+ var _el$3 = _tmpl$3$f();
18217
18223
  insert(_el$3, () => option.label);
18218
18224
  createRenderEffect(() => _el$3.value = option.value);
18219
18225
  return _el$3;
@@ -18336,12 +18342,12 @@ function registerToolbarRenderer(type, component) {
18336
18342
  function resolveRenderer(type) {
18337
18343
  return TOOLBAR_RENDERERS[type] ?? customRenderers.get(type);
18338
18344
  }
18339
- var _tmpl$$A = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-item style=align-items:center>`);
18345
+ var _tmpl$$B = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-item style=align-items:center>`);
18340
18346
  function ToolbarItemRenderer(props) {
18341
18347
  const binding = bindItem(props.item, props.api);
18342
18348
  const component = () => resolveRenderer(props.item.type);
18343
18349
  return (() => {
18344
- var _el$ = _tmpl$$A();
18350
+ var _el$ = _tmpl$$B();
18345
18351
  insert(_el$, createComponent(Show, {
18346
18352
  get when() {
18347
18353
  return component();
@@ -18467,7 +18473,7 @@ function buildRibbonGroups(items, tab) {
18467
18473
  });
18468
18474
  return Array.from(groups.values()).sort((a, b) => a.order - b.order);
18469
18475
  }
18470
- var _tmpl$$z = /* @__PURE__ */ template(`<div class=oasis-editor-ribbon-tabs role=tablist>`), _tmpl$2$m = /* @__PURE__ */ template(`<button type=button class=oasis-editor-ribbon-tab role=tab>`);
18476
+ var _tmpl$$A = /* @__PURE__ */ template(`<div class=oasis-editor-ribbon-tabs role=tablist>`), _tmpl$2$n = /* @__PURE__ */ template(`<button type=button class=oasis-editor-ribbon-tab role=tab>`);
18471
18477
  function RibbonTabs(props) {
18472
18478
  const tabs = RIBBON_TAB_DEFINITIONS;
18473
18479
  const moveTab = (current, delta) => {
@@ -18476,11 +18482,11 @@ function RibbonTabs(props) {
18476
18482
  if (next) props.setActiveTab(next.id);
18477
18483
  };
18478
18484
  return (() => {
18479
- var _el$ = _tmpl$$z();
18485
+ var _el$ = _tmpl$$A();
18480
18486
  insert(_el$, createComponent(For, {
18481
18487
  each: tabs,
18482
18488
  children: (tab) => (() => {
18483
- var _el$2 = _tmpl$2$m();
18489
+ var _el$2 = _tmpl$2$n();
18484
18490
  _el$2.$$keydown = (event) => {
18485
18491
  if (event.key === "ArrowRight") {
18486
18492
  event.preventDefault();
@@ -18522,10 +18528,10 @@ function RibbonTabs(props) {
18522
18528
  })();
18523
18529
  }
18524
18530
  delegateEvents(["click", "keydown"]);
18525
- var _tmpl$$y = /* @__PURE__ */ template(`<div class=oasis-editor-ribbon-row>`);
18531
+ var _tmpl$$z = /* @__PURE__ */ template(`<div class=oasis-editor-ribbon-row>`);
18526
18532
  function RibbonRow(props) {
18527
18533
  return (() => {
18528
- var _el$ = _tmpl$$y();
18534
+ var _el$ = _tmpl$$z();
18529
18535
  insert(_el$, createComponent(For, {
18530
18536
  get each() {
18531
18537
  return props.items;
@@ -18540,10 +18546,10 @@ function RibbonRow(props) {
18540
18546
  return _el$;
18541
18547
  })();
18542
18548
  }
18543
- var _tmpl$$x = /* @__PURE__ */ template(`<section class=oasis-editor-ribbon-group><div class=oasis-editor-ribbon-group-rows></div><div class=oasis-editor-ribbon-group-label>`);
18549
+ var _tmpl$$y = /* @__PURE__ */ template(`<section class=oasis-editor-ribbon-group><div class=oasis-editor-ribbon-group-rows></div><div class=oasis-editor-ribbon-group-label>`);
18544
18550
  function RibbonGroup(props) {
18545
18551
  return (() => {
18546
- var _el$ = _tmpl$$x(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
18552
+ var _el$ = _tmpl$$y(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
18547
18553
  insert(_el$2, createComponent(RibbonRow, {
18548
18554
  get items() {
18549
18555
  return props.group.rows[1];
@@ -18573,11 +18579,11 @@ function RibbonGroup(props) {
18573
18579
  return _el$;
18574
18580
  })();
18575
18581
  }
18576
- var _tmpl$$w = /* @__PURE__ */ template(`<div class=oasis-editor-ribbon-panel role=tabpanel data-testid=editor-ribbon-panel>`);
18582
+ var _tmpl$$x = /* @__PURE__ */ template(`<div class=oasis-editor-ribbon-panel role=tabpanel data-testid=editor-ribbon-panel>`);
18577
18583
  function RibbonPanel(props) {
18578
18584
  const groups = () => buildRibbonGroups(props.items(), props.activeTab());
18579
18585
  return (() => {
18580
- var _el$ = _tmpl$$w();
18586
+ var _el$ = _tmpl$$x();
18581
18587
  insert(_el$, createComponent(For, {
18582
18588
  get each() {
18583
18589
  return groups();
@@ -18601,7 +18607,7 @@ function RibbonPanel(props) {
18601
18607
  return _el$;
18602
18608
  })();
18603
18609
  }
18604
- var _tmpl$$v = /* @__PURE__ */ template(`<section class=oasis-editor-toolbar>`), _tmpl$2$l = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-wrap-strip>`);
18610
+ var _tmpl$$w = /* @__PURE__ */ template(`<section class=oasis-editor-toolbar>`), _tmpl$2$m = /* @__PURE__ */ template(`<div class=oasis-editor-toolbar-wrap-strip>`);
18605
18611
  const shouldAllowNativeMouseDown = (target) => target instanceof Element && target.closest("select, input, textarea, label") !== null;
18606
18612
  function Toolbar(props) {
18607
18613
  const api = createToolbarApi(props.host);
@@ -18631,7 +18637,7 @@ function Toolbar(props) {
18631
18637
  })
18632
18638
  });
18633
18639
  return (() => {
18634
- var _el$ = _tmpl$$v();
18640
+ var _el$ = _tmpl$$w();
18635
18641
  _el$.$$mousedown = (event) => {
18636
18642
  if (shouldAllowNativeMouseDown(event.target)) {
18637
18643
  return;
@@ -18652,7 +18658,7 @@ function Toolbar(props) {
18652
18658
  return renderItems();
18653
18659
  }
18654
18660
  }) : (() => {
18655
- var _el$2 = _tmpl$2$l();
18661
+ var _el$2 = _tmpl$2$m();
18656
18662
  insert(_el$2, renderItems);
18657
18663
  return _el$2;
18658
18664
  })();
@@ -18981,10 +18987,10 @@ function createLayoutIdentityStabilizer() {
18981
18987
  return { pages };
18982
18988
  };
18983
18989
  }
18984
- var _tmpl$$u = /* @__PURE__ */ template(`<div class=oasis-editor-page-break style="display:flex;align-items:center;justify-content:center;margin:16px 0;position:relative;user-select:none"><div style="position:absolute;left:0;right:0;top:50%;border-top:1px dashed var(--oasis-toolbar-border, #e0e3e7)"></div><div style="background:var(--oasis-bg, #f6f8fb);padding:0 12px;color:var(--oasis-text-muted, #5f6368);font-size:12px;font-family:var(--oasis-font-ui, sans-serif);z-index:1">`);
18990
+ var _tmpl$$v = /* @__PURE__ */ template(`<div class=oasis-editor-page-break style="display:flex;align-items:center;justify-content:center;margin:16px 0;position:relative;user-select:none"><div style="position:absolute;left:0;right:0;top:50%;border-top:1px dashed var(--oasis-toolbar-border, #e0e3e7)"></div><div style="background:var(--oasis-bg, #f6f8fb);padding:0 12px;color:var(--oasis-text-muted, #5f6368);font-size:12px;font-family:var(--oasis-font-ui, sans-serif);z-index:1">`);
18985
18991
  function PageBreak(props) {
18986
18992
  return (() => {
18987
- var _el$ = _tmpl$$u(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
18993
+ var _el$ = _tmpl$$v(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
18988
18994
  insert(_el$3, () => t("metric.pageBreak") || "Page Break");
18989
18995
  return _el$;
18990
18996
  })();
@@ -19453,7 +19459,7 @@ function createCanvasPageRenderer(options) {
19453
19459
  }
19454
19460
  };
19455
19461
  }
19456
- var _tmpl$$t = /* @__PURE__ */ template(`<div class="oasis-editor-paper-stack oasis-editor-canvas-stack"style=position:relative>`), _tmpl$2$k = /* @__PURE__ */ template(`<div class=oasis-editor-canvas-page-slot style=position:relative>`), _tmpl$3$d = /* @__PURE__ */ template(`<div class=oasis-editor-paper data-renderer=canvas data-testid=editor-page style=position:relative;z-index:1><canvas>`);
19462
+ var _tmpl$$u = /* @__PURE__ */ template(`<div class="oasis-editor-paper-stack oasis-editor-canvas-stack"style=position:relative>`), _tmpl$2$l = /* @__PURE__ */ template(`<div class=oasis-editor-canvas-page-slot style=position:relative>`), _tmpl$3$e = /* @__PURE__ */ template(`<div class=oasis-editor-paper data-renderer=canvas data-testid=editor-page style=position:relative;z-index:1><canvas>`);
19457
19463
  const canvasTextMeasurer = {
19458
19464
  composeMeasuredParagraphLines: (options) => domTextMeasurer.composeMeasuredParagraphLines(options),
19459
19465
  resolveRenderedLineHeightPx: (styles, lineHeightMultiple) => domTextMeasurer.resolveRenderedLineHeightPx(styles, lineHeightMultiple)
@@ -19522,7 +19528,7 @@ function CanvasEditorSurface(props) {
19522
19528
  return layout;
19523
19529
  });
19524
19530
  return (() => {
19525
- var _el$ = _tmpl$$t();
19531
+ var _el$ = _tmpl$$u();
19526
19532
  insert(_el$, createComponent(Index, {
19527
19533
  get each() {
19528
19534
  return documentLayout().pages;
@@ -19534,7 +19540,7 @@ function CanvasEditorSurface(props) {
19534
19540
  // inserting an image that triggers re-pagination in a narrow viewport),
19535
19541
  // causing "Failed to execute 'insertBefore'" errors.
19536
19542
  (() => {
19537
- var _el$2 = _tmpl$2$k();
19543
+ var _el$2 = _tmpl$2$l();
19538
19544
  insert(_el$2, createComponent(Show, {
19539
19545
  when: index > 0,
19540
19546
  get children() {
@@ -19607,7 +19613,7 @@ function CanvasPage(props) {
19607
19613
  });
19608
19614
  onCleanup(() => renderer.dispose());
19609
19615
  return (() => {
19610
- var _el$3 = _tmpl$3$d(), _el$4 = _el$3.firstChild;
19616
+ var _el$3 = _tmpl$3$e(), _el$4 = _el$3.firstChild;
19611
19617
  addEventListener(_el$3, "dblclick", props.onSurfaceDblClick, true);
19612
19618
  addEventListener(_el$3, "mousemove", props.onSurfaceMouseMove, true);
19613
19619
  addEventListener(_el$3, "click", props.onSurfaceClick, true);
@@ -19944,7 +19950,7 @@ function computeRulerTicks(pageWidth, contentLeft, unit) {
19944
19950
  pushSide(-1);
19945
19951
  return ticks;
19946
19952
  }
19947
- var _tmpl$$s = /* @__PURE__ */ template(`<div class=oasis-editor-horizontal-ruler data-testid=editor-horizontal-ruler role=presentation><div class=oasis-editor-horizontal-ruler-track><div class=oasis-editor-horizontal-ruler-page><div class=oasis-editor-horizontal-ruler-margin style=left:0px></div><div class=oasis-editor-horizontal-ruler-margin></div><div class=oasis-editor-horizontal-ruler-content></div><button type=button class=oasis-editor-horizontal-ruler-margin-handle></button><button type=button class=oasis-editor-horizontal-ruler-margin-handle></button><button type=button class="oasis-editor-ruler-marker oasis-editor-ruler-marker-first-line"></button><button type=button class="oasis-editor-ruler-marker oasis-editor-ruler-marker-hanging"></button><button type=button class="oasis-editor-ruler-marker oasis-editor-ruler-marker-left-box"></button><button type=button class="oasis-editor-ruler-marker oasis-editor-ruler-marker-right-indent">`), _tmpl$2$j = /* @__PURE__ */ template(`<div>`), _tmpl$3$c = /* @__PURE__ */ template(`<div class=oasis-editor-horizontal-ruler-label>`);
19953
+ var _tmpl$$t = /* @__PURE__ */ template(`<div class=oasis-editor-horizontal-ruler data-testid=editor-horizontal-ruler role=presentation><div class=oasis-editor-horizontal-ruler-track><div class=oasis-editor-horizontal-ruler-page><div class=oasis-editor-horizontal-ruler-margin style=left:0px></div><div class=oasis-editor-horizontal-ruler-margin></div><div class=oasis-editor-horizontal-ruler-content></div><button type=button class=oasis-editor-horizontal-ruler-margin-handle></button><button type=button class=oasis-editor-horizontal-ruler-margin-handle></button><button type=button class="oasis-editor-ruler-marker oasis-editor-ruler-marker-first-line"></button><button type=button class="oasis-editor-ruler-marker oasis-editor-ruler-marker-hanging"></button><button type=button class="oasis-editor-ruler-marker oasis-editor-ruler-marker-left-box"></button><button type=button class="oasis-editor-ruler-marker oasis-editor-ruler-marker-right-indent">`), _tmpl$2$k = /* @__PURE__ */ template(`<div>`), _tmpl$3$d = /* @__PURE__ */ template(`<div class=oasis-editor-horizontal-ruler-label>`);
19948
19954
  function getActivePageSettings(state) {
19949
19955
  var _a;
19950
19956
  const idx = getActiveSectionIndex(state);
@@ -20147,7 +20153,7 @@ function HorizontalRuler(props) {
20147
20153
  }
20148
20154
  };
20149
20155
  return (() => {
20150
- var _el$ = _tmpl$$s(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$1.nextSibling;
20156
+ var _el$ = _tmpl$$t(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling, _el$10 = _el$1.nextSibling;
20151
20157
  var _ref$ = pageRef;
20152
20158
  typeof _ref$ === "function" ? use(_ref$, _el$3) : pageRef = _el$3;
20153
20159
  insert(_el$3, createComponent(For, {
@@ -20155,7 +20161,7 @@ function HorizontalRuler(props) {
20155
20161
  return ticks();
20156
20162
  },
20157
20163
  children: (tick) => [(() => {
20158
- var _el$11 = _tmpl$2$j();
20164
+ var _el$11 = _tmpl$2$k();
20159
20165
  createRenderEffect((_p$) => {
20160
20166
  var _v$27 = `oasis-editor-horizontal-ruler-tick oasis-editor-horizontal-ruler-tick-${tick.kind}`, _v$28 = `${tick.x}px`;
20161
20167
  _v$27 !== _p$.e && className(_el$11, _p$.e = _v$27);
@@ -20167,7 +20173,7 @@ function HorizontalRuler(props) {
20167
20173
  });
20168
20174
  return _el$11;
20169
20175
  })(), memo(() => memo(() => !!tick.label)() && (() => {
20170
- var _el$12 = _tmpl$3$c();
20176
+ var _el$12 = _tmpl$3$d();
20171
20177
  insert(_el$12, () => tick.label);
20172
20178
  createRenderEffect((_$p) => setStyleProperty(_el$12, "left", `${tick.x}px`));
20173
20179
  return _el$12;
@@ -20244,10 +20250,10 @@ function HorizontalRuler(props) {
20244
20250
  })();
20245
20251
  }
20246
20252
  delegateEvents(["pointerdown"]);
20247
- var _tmpl$$r = /* @__PURE__ */ template(`<span aria-hidden=true class=oasis-editor-caret>`);
20253
+ var _tmpl$$s = /* @__PURE__ */ template(`<span aria-hidden=true class=oasis-editor-caret>`);
20248
20254
  function CaretOverlay(props) {
20249
20255
  return (() => {
20250
- var _el$ = _tmpl$$r();
20256
+ var _el$ = _tmpl$$s();
20251
20257
  createRenderEffect((_p$) => {
20252
20258
  var _v$ = !!props.active, _v$2 = {
20253
20259
  left: `${props.left}px`,
@@ -20268,16 +20274,16 @@ function CaretOverlay(props) {
20268
20274
  return _el$;
20269
20275
  })();
20270
20276
  }
20271
- var _tmpl$$q = /* @__PURE__ */ template(`<div aria-hidden=true class=oasis-editor-selection-overlay-root>`), _tmpl$2$i = /* @__PURE__ */ template(`<span aria-hidden=true class=oasis-editor-selection-box data-testid=editor-selection-box>`);
20277
+ var _tmpl$$r = /* @__PURE__ */ template(`<div aria-hidden=true class=oasis-editor-selection-overlay-root>`), _tmpl$2$j = /* @__PURE__ */ template(`<span aria-hidden=true class=oasis-editor-selection-box data-testid=editor-selection-box>`);
20272
20278
  function SelectionOverlay(props) {
20273
20279
  return (() => {
20274
- var _el$ = _tmpl$$q();
20280
+ var _el$ = _tmpl$$r();
20275
20281
  insert(_el$, createComponent(Index, {
20276
20282
  get each() {
20277
20283
  return props.boxes;
20278
20284
  },
20279
20285
  children: (box) => (() => {
20280
- var _el$2 = _tmpl$2$i();
20286
+ var _el$2 = _tmpl$2$j();
20281
20287
  createRenderEffect((_p$) => {
20282
20288
  var _v$ = `${box().left}px`, _v$2 = `${box().top}px`, _v$3 = `${box().width}px`, _v$4 = `${box().height}px`;
20283
20289
  _v$ !== _p$.e && setStyleProperty(_el$2, "left", _p$.e = _v$);
@@ -20297,7 +20303,7 @@ function SelectionOverlay(props) {
20297
20303
  return _el$;
20298
20304
  })();
20299
20305
  }
20300
- var _tmpl$$p = /* @__PURE__ */ template(`<div class=oasis-editor-revision-overlay data-testid=editor-revision-overlay><div class=oasis-editor-revision-overlay-content><span class=oasis-editor-revision-overlay-author><strong>:</strong> </span><span class=oasis-editor-revision-overlay-date></span></div><div class=oasis-editor-revision-overlay-arrow>`);
20306
+ var _tmpl$$q = /* @__PURE__ */ template(`<div class=oasis-editor-revision-overlay data-testid=editor-revision-overlay><div class=oasis-editor-revision-overlay-content><span class=oasis-editor-revision-overlay-author><strong>:</strong> </span><span class=oasis-editor-revision-overlay-date></span></div><div class=oasis-editor-revision-overlay-arrow>`);
20301
20307
  function RevisionOverlay(props) {
20302
20308
  const formattedDate = () => {
20303
20309
  try {
@@ -20308,7 +20314,7 @@ function RevisionOverlay(props) {
20308
20314
  };
20309
20315
  const label = () => props.box.type === "insert" ? "Inserido por" : "Excluído por";
20310
20316
  return (() => {
20311
- var _el$ = _tmpl$$p(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild;
20317
+ var _el$ = _tmpl$$q(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild;
20312
20318
  _el$4.nextSibling;
20313
20319
  var _el$7 = _el$3.nextSibling;
20314
20320
  insert(_el$4, label, _el$5);
@@ -20326,6 +20332,111 @@ function RevisionOverlay(props) {
20326
20332
  return _el$;
20327
20333
  })();
20328
20334
  }
20335
+ var _tmpl$$p = /* @__PURE__ */ template(`<div aria-hidden=true class=oasis-editor-comment-overlay-root>`), _tmpl$2$i = /* @__PURE__ */ template(`<span class=oasis-editor-comment-highlight data-testid=editor-comment-highlight>`), _tmpl$3$c = /* @__PURE__ */ template(`<span class=oasis-editor-comment-popup-date>`), _tmpl$4$9 = /* @__PURE__ */ template(`<span class=oasis-editor-comment-popup-resolved>✓`), _tmpl$5$8 = /* @__PURE__ */ template(`<div class=oasis-editor-comment-popup data-testid=editor-comment-popup><div class=oasis-editor-comment-popup-header><span class=oasis-editor-comment-popup-author></span></div><div class=oasis-editor-comment-popup-body>`);
20336
+ function CommentHighlightOverlay(props) {
20337
+ const [activeCommentId, setActiveCommentId] = createSignal(null);
20338
+ const activeComment = createMemo(() => {
20339
+ const id = activeCommentId();
20340
+ if (!id) return null;
20341
+ return props.commentsById()[id] ?? null;
20342
+ });
20343
+ const popupAnchor = createMemo(() => {
20344
+ const id = activeCommentId();
20345
+ if (!id) return null;
20346
+ let best = null;
20347
+ for (const box of props.boxes()) {
20348
+ if (box.commentId !== id) continue;
20349
+ if (!best || box.top < best.top) best = box;
20350
+ }
20351
+ return best;
20352
+ });
20353
+ const formattedDate = (date) => {
20354
+ if (date === void 0) return "";
20355
+ try {
20356
+ return new Date(date).toLocaleString();
20357
+ } catch {
20358
+ return "";
20359
+ }
20360
+ };
20361
+ return (() => {
20362
+ var _el$ = _tmpl$$p();
20363
+ insert(_el$, createComponent(For, {
20364
+ get each() {
20365
+ return props.boxes();
20366
+ },
20367
+ children: (box) => (() => {
20368
+ var _el$2 = _tmpl$2$i();
20369
+ _el$2.$$click = () => setActiveCommentId(box.commentId);
20370
+ _el$2.addEventListener("mouseenter", () => setActiveCommentId(box.commentId));
20371
+ createRenderEffect((_p$) => {
20372
+ var _v$ = !!(activeCommentId() === box.commentId), _v$2 = box.commentId, _v$3 = `${box.left}px`, _v$4 = `${box.top}px`, _v$5 = `${box.width}px`, _v$6 = `${box.height}px`;
20373
+ _v$ !== _p$.e && _el$2.classList.toggle("oasis-editor-comment-highlight-active", _p$.e = _v$);
20374
+ _v$2 !== _p$.t && setAttribute(_el$2, "data-comment-id", _p$.t = _v$2);
20375
+ _v$3 !== _p$.a && setStyleProperty(_el$2, "left", _p$.a = _v$3);
20376
+ _v$4 !== _p$.o && setStyleProperty(_el$2, "top", _p$.o = _v$4);
20377
+ _v$5 !== _p$.i && setStyleProperty(_el$2, "width", _p$.i = _v$5);
20378
+ _v$6 !== _p$.n && setStyleProperty(_el$2, "height", _p$.n = _v$6);
20379
+ return _p$;
20380
+ }, {
20381
+ e: void 0,
20382
+ t: void 0,
20383
+ a: void 0,
20384
+ o: void 0,
20385
+ i: void 0,
20386
+ n: void 0
20387
+ });
20388
+ return _el$2;
20389
+ })()
20390
+ }), null);
20391
+ insert(_el$, createComponent(Show, {
20392
+ get when() {
20393
+ return memo(() => !!activeComment())() && popupAnchor();
20394
+ },
20395
+ get children() {
20396
+ return (() => {
20397
+ const comment = activeComment();
20398
+ const anchor = popupAnchor();
20399
+ return (() => {
20400
+ var _el$3 = _tmpl$5$8(), _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$8 = _el$4.nextSibling;
20401
+ _el$3.addEventListener("mouseleave", () => setActiveCommentId(null));
20402
+ insert(_el$5, () => comment.author || "—");
20403
+ insert(_el$4, createComponent(Show, {
20404
+ get when() {
20405
+ return comment.date !== void 0;
20406
+ },
20407
+ get children() {
20408
+ var _el$6 = _tmpl$3$c();
20409
+ insert(_el$6, () => formattedDate(comment.date));
20410
+ return _el$6;
20411
+ }
20412
+ }), null);
20413
+ insert(_el$4, createComponent(Show, {
20414
+ get when() {
20415
+ return comment.resolved;
20416
+ },
20417
+ get children() {
20418
+ return _tmpl$4$9();
20419
+ }
20420
+ }), null);
20421
+ insert(_el$8, () => comment.text);
20422
+ createRenderEffect((_p$) => {
20423
+ var _v$7 = `${anchor.left}px`, _v$8 = `${anchor.top + anchor.height + 6}px`;
20424
+ _v$7 !== _p$.e && setStyleProperty(_el$3, "left", _p$.e = _v$7);
20425
+ _v$8 !== _p$.t && setStyleProperty(_el$3, "top", _p$.t = _v$8);
20426
+ return _p$;
20427
+ }, {
20428
+ e: void 0,
20429
+ t: void 0
20430
+ });
20431
+ return _el$3;
20432
+ })();
20433
+ })();
20434
+ }
20435
+ }), null);
20436
+ return _el$;
20437
+ })();
20438
+ }
20439
+ delegateEvents(["click"]);
20329
20440
  var _tmpl$$o = /* @__PURE__ */ template(`<div class=oasis-editor-floating-toolbar data-testid=editor-floating-table-toolbar><div class=oasis-editor-toolbar-group></div><div class=oasis-editor-toolbar-group></div><div class=oasis-editor-toolbar-group></div><div class=oasis-editor-toolbar-group></div><div class=oasis-editor-toolbar-group>`);
20330
20441
  function FloatingTableToolbar(props) {
20331
20442
  const host = () => props.host();
@@ -31596,6 +31707,16 @@ function parseBookmarkMarker(element) {
31596
31707
  ...colLast !== void 0 && !Number.isNaN(colLast) ? { colLast } : {}
31597
31708
  };
31598
31709
  }
31710
+ function parseCommentMarker(element) {
31711
+ const docxId = getAttributeValue(element, "id");
31712
+ if (!docxId) {
31713
+ return void 0;
31714
+ }
31715
+ return {
31716
+ kind: element.localName === "commentRangeEnd" ? "end" : "start",
31717
+ docxId
31718
+ };
31719
+ }
31599
31720
  async function parseRunElement(runElement, zip, relsMap, assets, parseNestedBlocks) {
31600
31721
  const textParts = [];
31601
31722
  let image;
@@ -31603,6 +31724,7 @@ async function parseRunElement(runElement, zip, relsMap, assets, parseNestedBloc
31603
31724
  let sym;
31604
31725
  let textLength = 0;
31605
31726
  const innerBookmarks = [];
31727
+ const innerComments = [];
31606
31728
  const pushText = (value) => {
31607
31729
  textParts.push(value);
31608
31730
  textLength += value.length;
@@ -31635,7 +31757,13 @@ async function parseRunElement(runElement, zip, relsMap, assets, parseNestedBloc
31635
31757
  innerBookmarks.push({ offset: textLength, marker });
31636
31758
  }
31637
31759
  continue;
31638
- } else if (element.localName === "proofErr" || element.localName === "commentRangeStart" || element.localName === "commentRangeEnd" || element.localName === "commentReference" || element.localName === "permStart" || element.localName === "permEnd") {
31760
+ } else if (element.localName === "commentRangeStart" || element.localName === "commentRangeEnd") {
31761
+ const marker = parseCommentMarker(element);
31762
+ if (marker) {
31763
+ innerComments.push({ offset: textLength, marker });
31764
+ }
31765
+ continue;
31766
+ } else if (element.localName === "proofErr" || element.localName === "commentReference" || element.localName === "permStart" || element.localName === "permEnd") {
31639
31767
  continue;
31640
31768
  } else if (element.localName === "cr") {
31641
31769
  pushText("\n");
@@ -31686,6 +31814,7 @@ async function parseRunElement(runElement, zip, relsMap, assets, parseNestedBloc
31686
31814
  image,
31687
31815
  ...textBox ? { textBox } : {},
31688
31816
  ...innerBookmarks.length > 0 ? { innerBookmarks } : {},
31817
+ ...innerComments.length > 0 ? { innerComments } : {},
31689
31818
  ...sym ? { sym } : {}
31690
31819
  };
31691
31820
  }
@@ -31783,6 +31912,14 @@ async function parseRunsContainer(container, numberingMaps, zip, relsMap, assets
31783
31912
  runs.push({ text: "", bookmark: marker });
31784
31913
  continue;
31785
31914
  }
31915
+ if (element.localName === "commentRangeStart" || element.localName === "commentRangeEnd") {
31916
+ const marker = parseCommentMarker(element);
31917
+ if (!marker) {
31918
+ continue;
31919
+ }
31920
+ runs.push({ text: "", comment: marker });
31921
+ continue;
31922
+ }
31786
31923
  if (element.localName === "r") {
31787
31924
  const runStyles = parseRunStyle(
31788
31925
  getFirstChildByTagNameNS(element, WORD_NS, "rPr"),
@@ -31858,13 +31995,7 @@ async function parseRunsContainer(container, numberingMaps, zip, relsMap, assets
31858
31995
  });
31859
31996
  continue;
31860
31997
  }
31861
- const { text, image, textBox, innerBookmarks, sym } = await parseRunElement(
31862
- element,
31863
- zip,
31864
- relsMap,
31865
- assets,
31866
- parseNestedBlocks
31867
- );
31998
+ const { text, image, textBox, innerBookmarks, innerComments, sym } = await parseRunElement(element, zip, relsMap, assets, parseNestedBlocks);
31868
31999
  let styles = runStyles;
31869
32000
  if (sym && !(styles == null ? void 0 : styles.fontFamily)) {
31870
32001
  (styles ?? (styles = {})).fontFamily = sym.font;
@@ -31872,14 +32003,25 @@ async function parseRunsContainer(container, numberingMaps, zip, relsMap, assets
31872
32003
  if (inheritedLink) {
31873
32004
  (styles ?? (styles = {})).link = inheritedLink;
31874
32005
  }
31875
- if (innerBookmarks && innerBookmarks.length > 0 && !image && !textBox) {
32006
+ const innerMarkers = [
32007
+ ...(innerBookmarks ?? []).map((m) => ({
32008
+ offset: m.offset,
32009
+ run: { text: "", bookmark: m.marker }
32010
+ })),
32011
+ ...(innerComments ?? []).map((m) => ({
32012
+ offset: m.offset,
32013
+ run: { text: "", comment: m.marker }
32014
+ }))
32015
+ ];
32016
+ if (innerMarkers.length > 0 && !image && !textBox) {
32017
+ innerMarkers.sort((a, b) => a.offset - b.offset);
31876
32018
  let cursor = 0;
31877
- for (const inner of innerBookmarks) {
32019
+ for (const inner of innerMarkers) {
31878
32020
  const segment = text.slice(cursor, inner.offset);
31879
32021
  if (segment.length > 0) {
31880
32022
  runs.push({ text: segment, ...styles ? { styles } : {} });
31881
32023
  }
31882
- runs.push({ text: "", bookmark: inner.marker });
32024
+ runs.push(inner.run);
31883
32025
  cursor = inner.offset;
31884
32026
  }
31885
32027
  const tail = text.slice(cursor);
@@ -32796,6 +32938,9 @@ function createImportedParagraph(runs, paragraphStyle, list, markRunStyle) {
32796
32938
  if (run.bookmark) {
32797
32939
  paragraph.runs[index].__importedBookmark = { ...run.bookmark };
32798
32940
  }
32941
+ if (run.comment) {
32942
+ paragraph.runs[index].__importedComment = { ...run.comment };
32943
+ }
32799
32944
  if (run.sym) {
32800
32945
  paragraph.runs[index].sym = { ...run.sym };
32801
32946
  }
@@ -32814,7 +32959,7 @@ function splitRunsAtPageBreaks(runs) {
32814
32959
  const segments = [[]];
32815
32960
  let hasPageBreak = false;
32816
32961
  const appendRun = (run, text) => {
32817
- if (text.length === 0 && !run.image && !run.textBox && !run.field && !run.fieldChar && run.fieldInstruction === void 0 && !run.bookmark) {
32962
+ if (text.length === 0 && !run.image && !run.textBox && !run.field && !run.fieldChar && run.fieldInstruction === void 0 && !run.bookmark && !run.comment) {
32818
32963
  return;
32819
32964
  }
32820
32965
  segments[segments.length - 1].push({
@@ -32840,7 +32985,7 @@ function splitRunsAtPageBreaks(runs) {
32840
32985
  }
32841
32986
  function paragraphHasVisibleContent(runs) {
32842
32987
  return runs.some(
32843
- (run) => run.image || run.textBox || run.field || run.fieldChar || run.fieldInstruction !== void 0 || run.bookmark || run.text.replace(/\s/g, "").length > 0
32988
+ (run) => run.image || run.textBox || run.field || run.fieldChar || run.fieldInstruction !== void 0 || run.bookmark || run.comment || run.text.replace(/\s/g, "").length > 0
32844
32989
  );
32845
32990
  }
32846
32991
  async function parseParagraphNodes(paragraphNode, numberingMaps, zip, relsMap, assets, theme, inheritedStyle) {
@@ -33158,7 +33303,7 @@ async function parseEndnotesXml(xmlContent, numberingMaps, zip, relsMap, assets,
33158
33303
  };
33159
33304
  }
33160
33305
  const RESERVED_BOOKMARK_NAMES = /* @__PURE__ */ new Set(["_GoBack"]);
33161
- function collectFromBlock(block, out, seqRef) {
33306
+ function collectFromBlock$1(block, out, seqRef) {
33162
33307
  if (block.type === "paragraph") {
33163
33308
  let offset = 0;
33164
33309
  const kept = [];
@@ -33187,7 +33332,7 @@ function collectFromBlock(block, out, seqRef) {
33187
33332
  for (const row of block.rows) {
33188
33333
  for (const cell of row.cells) {
33189
33334
  for (const child of cell.blocks) {
33190
- collectFromBlock(child, out, seqRef);
33335
+ collectFromBlock$1(child, out, seqRef);
33191
33336
  }
33192
33337
  }
33193
33338
  }
@@ -33197,7 +33342,7 @@ function extractBookmarksFromSections(sections) {
33197
33342
  const boundaries = [];
33198
33343
  const seqRef = { value: 0 };
33199
33344
  const visit = (blocks) => {
33200
- blocks == null ? void 0 : blocks.forEach((block) => collectFromBlock(block, boundaries, seqRef));
33345
+ blocks == null ? void 0 : blocks.forEach((block) => collectFromBlock$1(block, boundaries, seqRef));
33201
33346
  };
33202
33347
  for (const section of sections) {
33203
33348
  visit(section.blocks);
@@ -33262,8 +33407,157 @@ function extractBookmarksFromSections(sections) {
33262
33407
  }
33263
33408
  return { items, order };
33264
33409
  }
33410
+ function collectFromBlock(block, out, seqRef) {
33411
+ if (block.type === "paragraph") {
33412
+ let offset = 0;
33413
+ const kept = [];
33414
+ for (const run of block.runs) {
33415
+ const marker = run.__importedComment;
33416
+ if (marker) {
33417
+ out.push({
33418
+ marker,
33419
+ anchor: {
33420
+ paragraphId: block.id,
33421
+ offset,
33422
+ seq: seqRef.value
33423
+ }
33424
+ });
33425
+ seqRef.value += 1;
33426
+ continue;
33427
+ }
33428
+ offset += run.text.length;
33429
+ kept.push(run);
33430
+ }
33431
+ if (kept.length !== block.runs.length) {
33432
+ block.runs = kept.length > 0 ? kept : [createEditorRun("")];
33433
+ }
33434
+ return;
33435
+ }
33436
+ for (const row of block.rows) {
33437
+ for (const cell of row.cells) {
33438
+ for (const child of cell.blocks) {
33439
+ collectFromBlock(child, out, seqRef);
33440
+ }
33441
+ }
33442
+ }
33443
+ }
33444
+ function extractCommentRangesFromSections(sections) {
33445
+ const boundaries = [];
33446
+ const seqRef = { value: 0 };
33447
+ const visit = (blocks) => {
33448
+ blocks == null ? void 0 : blocks.forEach((block) => collectFromBlock(block, boundaries, seqRef));
33449
+ };
33450
+ for (const section of sections) {
33451
+ visit(section.blocks);
33452
+ visit(section.header);
33453
+ visit(section.firstPageHeader);
33454
+ visit(section.evenPageHeader);
33455
+ visit(section.footer);
33456
+ visit(section.firstPageFooter);
33457
+ visit(section.evenPageFooter);
33458
+ }
33459
+ const ranges = /* @__PURE__ */ new Map();
33460
+ for (const { marker, anchor } of boundaries) {
33461
+ const range = ranges.get(marker.docxId) ?? {};
33462
+ if (marker.kind === "start") {
33463
+ range.start = anchor;
33464
+ } else {
33465
+ range.end = anchor;
33466
+ }
33467
+ ranges.set(marker.docxId, range);
33468
+ }
33469
+ return ranges;
33470
+ }
33471
+ const WORD15_NS = "http://schemas.microsoft.com/office/word/2012/wordml";
33472
+ function flattenCommentText(element) {
33473
+ let out = "";
33474
+ for (let index = 0; index < element.childNodes.length; index += 1) {
33475
+ const node = element.childNodes[index];
33476
+ if ((node == null ? void 0 : node.nodeType) !== node.ELEMENT_NODE) {
33477
+ continue;
33478
+ }
33479
+ const child = node;
33480
+ if (child.namespaceURI === WORD_NS) {
33481
+ if (child.localName === "t") {
33482
+ out += child.textContent ?? "";
33483
+ continue;
33484
+ }
33485
+ if (child.localName === "tab") {
33486
+ out += " ";
33487
+ continue;
33488
+ }
33489
+ if (child.localName === "br" || child.localName === "cr") {
33490
+ out += "\n";
33491
+ continue;
33492
+ }
33493
+ }
33494
+ out += flattenCommentText(child);
33495
+ }
33496
+ return out;
33497
+ }
33498
+ function parseDate(value) {
33499
+ if (!value) {
33500
+ return void 0;
33501
+ }
33502
+ const ms = Date.parse(value);
33503
+ return Number.isNaN(ms) ? void 0 : ms;
33504
+ }
33505
+ function parseCommentsExtended(xml) {
33506
+ const done = /* @__PURE__ */ new Map();
33507
+ if (!xml) {
33508
+ return done;
33509
+ }
33510
+ const doc = new DOMParser$1().parseFromString(xml, "application/xml");
33511
+ const root = doc.documentElement;
33512
+ if (!root) {
33513
+ return done;
33514
+ }
33515
+ for (const ex of getChildrenByTagNameNS(root, WORD15_NS, "commentEx")) {
33516
+ const paraId = ex.getAttributeNS(WORD15_NS, "paraId");
33517
+ if (!paraId) {
33518
+ continue;
33519
+ }
33520
+ const isDone = ex.getAttributeNS(WORD15_NS, "done");
33521
+ done.set(paraId, isDone === "1" || isDone === "true");
33522
+ }
33523
+ return done;
33524
+ }
33525
+ function parseCommentsXml(commentsXml, commentsExtendedXml) {
33526
+ const byDocxId = /* @__PURE__ */ new Map();
33527
+ if (!commentsXml) {
33528
+ return byDocxId;
33529
+ }
33530
+ const doc = new DOMParser$1().parseFromString(commentsXml, "application/xml");
33531
+ const root = doc.documentElement;
33532
+ if (!root) {
33533
+ return byDocxId;
33534
+ }
33535
+ const doneByParaId = parseCommentsExtended(commentsExtendedXml);
33536
+ for (const comment of getChildrenByTagNameNS(root, WORD_NS, "comment")) {
33537
+ const docxId = getAttributeValue(comment, "id");
33538
+ if (docxId === null) {
33539
+ continue;
33540
+ }
33541
+ const author = getAttributeValue(comment, "author") ?? "";
33542
+ const initials = getAttributeValue(comment, "initials") ?? void 0;
33543
+ const date = parseDate(getAttributeValue(comment, "date"));
33544
+ const paragraphs = getChildrenByTagNameNS(comment, WORD_NS, "p");
33545
+ const text = paragraphs.map((p) => flattenCommentText(p)).join("\n").trim();
33546
+ const paraId = paragraphs.length > 0 ? getAttributeValue(paragraphs[0], "paraId") ?? void 0 : void 0;
33547
+ const resolved = paraId !== void 0 ? doneByParaId.get(paraId) : void 0;
33548
+ byDocxId.set(docxId, {
33549
+ author,
33550
+ ...initials ? { initials } : {},
33551
+ ...date !== void 0 ? { date } : {},
33552
+ text,
33553
+ ...resolved ? { resolved } : {},
33554
+ ...paraId ? { paraId } : {}
33555
+ });
33556
+ }
33557
+ return byDocxId;
33558
+ }
33265
33559
  async function importDocxToEditorDocument(buffer, options = {}) {
33266
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
33560
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
33267
33561
  (_a = options.onProgress) == null ? void 0 : _a.call(options, "opening-docx");
33268
33562
  const zip = await JSZip.loadAsync(buffer);
33269
33563
  const documentXml = await ((_b = zip.file("word/document.xml")) == null ? void 0 : _b.async("string"));
@@ -33524,6 +33818,11 @@ async function importDocxToEditorDocument(buffer, options = {}) {
33524
33818
  const editorEndnotes = Object.keys(parsedEndnotes.endnotes.items).length > 0 || parsedEndnotes.endnotes.separator || parsedEndnotes.endnotes.continuationSeparator || parsedEndnotes.endnotes.settings ? parsedEndnotes.endnotes : void 0;
33525
33819
  remapImportedEndnoteRefsInSections(sections, parsedEndnotes.byDocxId);
33526
33820
  const editorBookmarks = extractBookmarksFromSections(sections);
33821
+ const commentRanges = extractCommentRangesFromSections(sections);
33822
+ const commentsXml = await ((_l = zip.file("word/comments.xml")) == null ? void 0 : _l.async("string")) ?? null;
33823
+ const commentsExtendedXml = await ((_m = zip.file("word/commentsExtended.xml")) == null ? void 0 : _m.async("string")) ?? null;
33824
+ const commentBodies = parseCommentsXml(commentsXml, commentsExtendedXml);
33825
+ const editorComments = buildEditorComments(commentRanges, commentBodies);
33527
33826
  const shouldPreserveSections = sections.length > 1 || sections.some(
33528
33827
  (section) => {
33529
33828
  var _a2, _b2, _c2, _d2, _e2, _f2;
@@ -33550,6 +33849,9 @@ async function importDocxToEditorDocument(buffer, options = {}) {
33550
33849
  if (editorBookmarks) {
33551
33850
  result.bookmarks = editorBookmarks;
33552
33851
  }
33852
+ if (editorComments) {
33853
+ result.comments = editorComments;
33854
+ }
33553
33855
  return result;
33554
33856
  };
33555
33857
  if (shouldPreserveSections) {
@@ -33579,6 +33881,44 @@ async function importDocxToEditorDocument(buffer, options = {}) {
33579
33881
  }
33580
33882
  return finalize(doc);
33581
33883
  }
33884
+ function buildEditorComments(ranges, bodies) {
33885
+ const docxIds = /* @__PURE__ */ new Set([...ranges.keys(), ...bodies.keys()]);
33886
+ if (docxIds.size === 0) {
33887
+ return void 0;
33888
+ }
33889
+ const sorted = [...docxIds].sort((a, b) => {
33890
+ const na = Number.parseInt(a, 10);
33891
+ const nb = Number.parseInt(b, 10);
33892
+ if (Number.isNaN(na) || Number.isNaN(nb)) {
33893
+ return a.localeCompare(b);
33894
+ }
33895
+ return na - nb;
33896
+ });
33897
+ const items = {};
33898
+ const order = [];
33899
+ for (const docxId of sorted) {
33900
+ const range = ranges.get(docxId);
33901
+ const body = bodies.get(docxId);
33902
+ if (!range && !body) {
33903
+ continue;
33904
+ }
33905
+ const id = createEditorCommentId();
33906
+ const docxIdNum = Number.parseInt(docxId, 10);
33907
+ items[id] = {
33908
+ id,
33909
+ author: (body == null ? void 0 : body.author) ?? "",
33910
+ ...(body == null ? void 0 : body.initials) ? { initials: body.initials } : {},
33911
+ ...(body == null ? void 0 : body.date) !== void 0 ? { date: body.date } : {},
33912
+ ...(body == null ? void 0 : body.resolved) ? { resolved: body.resolved } : {},
33913
+ text: (body == null ? void 0 : body.text) ?? "",
33914
+ ...(range == null ? void 0 : range.start) ? { start: range.start } : {},
33915
+ ...(range == null ? void 0 : range.end) ? { end: range.end } : {},
33916
+ ...Number.isNaN(docxIdNum) ? {} : { docxIdHint: docxIdNum }
33917
+ };
33918
+ order.push(id);
33919
+ }
33920
+ return order.length > 0 ? { items, order } : void 0;
33921
+ }
33582
33922
  function remapImportedFootnoteRefsInSections(sections, byDocxId) {
33583
33923
  var _a, _b, _c, _d, _e, _f;
33584
33924
  const remapBlock = (block) => {
@@ -33669,7 +34009,7 @@ function importDocxInWorker(buffer, options = {}) {
33669
34009
  const worker = new Worker(
33670
34010
  new URL(
33671
34011
  /* @vite-ignore */
33672
- "" + new URL("assets/importDocxWorker-CtcRQ7NG.js", import.meta.url).href,
34012
+ "" + new URL("assets/importDocxWorker-cjz15bhS.js", import.meta.url).href,
33673
34013
  import.meta.url
33674
34014
  ),
33675
34015
  {
@@ -34448,6 +34788,10 @@ function OasisEditorEditor(props) {
34448
34788
  };
34449
34789
  const selectedImage = createMemo(() => overlays().selectedImageBox());
34450
34790
  const selectedTextBox = createMemo(() => overlays().selectedTextBoxBox());
34791
+ const commentsById = createMemo(() => {
34792
+ var _a;
34793
+ return ((_a = props.state().document.comments) == null ? void 0 : _a.items) ?? {};
34794
+ });
34451
34795
  createEffect(() => {
34452
34796
  statusDocumentLayout();
34453
34797
  queueMicrotask(recomputeViewportPageIndex);
@@ -34563,6 +34907,19 @@ function OasisEditorEditor(props) {
34563
34907
  });
34564
34908
  }
34565
34909
  }), _el$4);
34910
+ insert(_el$3, createComponent(Show, {
34911
+ get when() {
34912
+ return overlays().commentHighlights().length > 0;
34913
+ },
34914
+ get children() {
34915
+ return createComponent(CommentHighlightOverlay, {
34916
+ get boxes() {
34917
+ return overlays().commentHighlights;
34918
+ },
34919
+ commentsById
34920
+ });
34921
+ }
34922
+ }), _el$4);
34566
34923
  insert(_el$3, createComponent(ResizeHandlesOverlay, {
34567
34924
  box: selectedImage,
34568
34925
  get readOnly() {