@harbour-enterprises/superdoc 0.12.30 → 0.12.31-next.1

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 (54) hide show
  1. package/dist/chunks/{super-editor.es-J7K_8fA3.es.js → super-editor.es-Bt5pMkY-.es.js} +500 -236
  2. package/dist/chunks/{super-editor.es-0mAzj58N.cjs → super-editor.es-CzfjXQ8V.cjs} +499 -235
  3. package/dist/composables/use-high-contrast-mode.d.ts +5 -0
  4. package/dist/composables/use-high-contrast-mode.d.ts.map +1 -0
  5. package/dist/core/SuperDoc.d.ts +7 -0
  6. package/dist/core/SuperDoc.d.ts.map +1 -1
  7. package/dist/core/create-app.d.ts.map +1 -1
  8. package/dist/style.css +299 -245
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-BSr2Ue72.js → converter-LyqpytFD.js} +2 -2
  11. package/dist/super-editor/chunks/{docx-zipper-BCUCSdEs.js → docx-zipper-CSx2w--M.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-DOwVVn_i.js → editor-czvDp00c.js} +96 -35
  13. package/dist/super-editor/chunks/{toolbar-hUPYR8un.js → toolbar-BnvzLMKn.js} +80 -36
  14. package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
  15. package/dist/super-editor/composables/use-high-contrast-mode.d.ts +5 -0
  16. package/dist/super-editor/composables/use-high-contrast-mode.d.ts.map +1 -0
  17. package/dist/super-editor/converter.es.js +1 -1
  18. package/dist/super-editor/core/Editor.d.ts +1 -0
  19. package/dist/super-editor/core/Editor.d.ts.map +1 -1
  20. package/dist/super-editor/docx-zipper.es.js +2 -2
  21. package/dist/super-editor/editor.es.js +3 -3
  22. package/dist/super-editor/extensions/ai/ai-nodes.d.ts.map +1 -1
  23. package/dist/super-editor/extensions/bookmarks/bookmarks.d.ts.map +1 -1
  24. package/dist/super-editor/extensions/bullet-list/bullet-list.d.ts.map +1 -1
  25. package/dist/super-editor/extensions/comment/comment.d.ts.map +1 -1
  26. package/dist/super-editor/extensions/document/document.d.ts.map +1 -1
  27. package/dist/super-editor/extensions/field-annotation/field-annotation.d.ts.map +1 -1
  28. package/dist/super-editor/extensions/heading/heading.d.ts.map +1 -1
  29. package/dist/super-editor/extensions/image/image.d.ts.map +1 -1
  30. package/dist/super-editor/extensions/line-break/line-break.d.ts.map +1 -1
  31. package/dist/super-editor/extensions/list-item/list-item.d.ts.map +1 -1
  32. package/dist/super-editor/extensions/mention/mention.d.ts.map +1 -1
  33. package/dist/super-editor/extensions/ordered-list/ordered-list.d.ts.map +1 -1
  34. package/dist/super-editor/extensions/page-number/page-number.d.ts.map +1 -1
  35. package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts.map +1 -1
  36. package/dist/super-editor/extensions/run-item/run-item.d.ts.map +1 -1
  37. package/dist/super-editor/extensions/shape-container/shape-container.d.ts.map +1 -1
  38. package/dist/super-editor/extensions/shape-textbox/shape-textbox.d.ts.map +1 -1
  39. package/dist/super-editor/extensions/structured-content/structured-content.d.ts.map +1 -1
  40. package/dist/super-editor/extensions/table/table.d.ts.map +1 -1
  41. package/dist/super-editor/extensions/table-cell/table-cell.d.ts.map +1 -1
  42. package/dist/super-editor/extensions/table-header/table-header.d.ts.map +1 -1
  43. package/dist/super-editor/extensions/table-row/table-row.d.ts.map +1 -1
  44. package/dist/super-editor/file-zipper.es.js +1 -1
  45. package/dist/super-editor/style.css +243 -196
  46. package/dist/super-editor/super-editor.es.js +334 -174
  47. package/dist/super-editor/toolbar.es.js +2 -2
  48. package/dist/super-editor.cjs +1 -1
  49. package/dist/super-editor.es.js +1 -1
  50. package/dist/superdoc.cjs +34 -9
  51. package/dist/superdoc.es.js +35 -10
  52. package/dist/superdoc.umd.js +536 -247
  53. package/dist/superdoc.umd.js.map +1 -1
  54. package/package.json +2 -1
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-hUPYR8un.js";
3
- import "./chunks/editor-DOwVVn_i.js";
2
+ import { T } from "./chunks/toolbar-BnvzLMKn.js";
3
+ import "./chunks/editor-czvDp00c.js";
4
4
  export {
5
5
  T as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-0mAzj58N.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CzfjXQ8V.cjs");
4
4
  require("./chunks/vue-DPZkajuO.cjs");
5
5
  exports.AIWriter = superEditor_es.AIWriter;
6
6
  exports.BasicUpload = superEditor_es._sfc_main$1;
@@ -1,4 +1,4 @@
1
- import { A, _, C, D, E, a, S, b, c, d, T, e, f, i, g, h, j, k, l, m, n } from "./chunks/super-editor.es-J7K_8fA3.es.js";
1
+ import { A, _, C, D, E, a, S, b, c, d, T, e, f, i, g, h, j, k, l, m, n } from "./chunks/super-editor.es-Bt5pMkY-.es.js";
2
2
  import "./chunks/vue-IIIZMHTg.es.js";
3
3
  export {
4
4
  A as AIWriter,
package/dist/superdoc.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-0mAzj58N.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CzfjXQ8V.cjs");
4
4
  const vue = require("./chunks/vue-DPZkajuO.cjs");
5
5
  const jszip = require("./chunks/jszip-Bwu_om3F.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
@@ -14071,7 +14071,8 @@ const _sfc_main$d = {
14071
14071
  onClick: vue.withModifiers(setFocus, ["stop", "prevent"]),
14072
14072
  style: vue.normalizeStyle(getSidebarCommentStyle.value),
14073
14073
  ref_key: "commentDialogElement",
14074
- ref: commentDialogElement
14074
+ ref: commentDialogElement,
14075
+ role: "dialog"
14075
14076
  }, [
14076
14077
  shouldShowInternalExternal.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
14077
14078
  vue.createVNode(InternalDropdown, {
@@ -14167,7 +14168,7 @@ const _sfc_main$d = {
14167
14168
  };
14168
14169
  }
14169
14170
  };
14170
- const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-92061859"]]);
14171
+ const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-ff48cd67"]]);
14171
14172
  const _hoisted_1$b = { class: "comments-list" };
14172
14173
  const _hoisted_2$6 = { key: 0 };
14173
14174
  const _hoisted_3$3 = { class: "comment-item" };
@@ -45926,6 +45927,16 @@ function useAi({ emitAiHighlight, activeEditorRef }) {
45926
45927
  handleAiToolClick
45927
45928
  };
45928
45929
  }
45930
+ const isHighContrastMode = vue.ref(false);
45931
+ function useHighContrastMode() {
45932
+ const setHighContrastMode = (value) => {
45933
+ isHighContrastMode.value = value;
45934
+ };
45935
+ return {
45936
+ isHighContrastMode,
45937
+ setHighContrastMode
45938
+ };
45939
+ }
45929
45940
  const _hoisted_1 = ["innerHTML"];
45930
45941
  const _hoisted_2 = { class: "superdoc__document document" };
45931
45942
  const _hoisted_3 = {
@@ -45967,6 +45978,7 @@ const _sfc_main = {
45967
45978
  const { showAddComment, handleEditorLocationsUpdate, handleTrackedChangeUpdate } = commentsStore;
45968
45979
  const { proxy } = vue.getCurrentInstance();
45969
45980
  commentsStore.proxy = proxy;
45981
+ const { isHighContrastMode: isHighContrastMode2 } = useHighContrastMode();
45970
45982
  const layers = vue.ref(null);
45971
45983
  const commentsLayer = vue.ref(null);
45972
45984
  const toolsMenuPosition = vue.reactive({ top: null, right: "-25px", zIndex: 101 });
@@ -46322,12 +46334,13 @@ const _sfc_main = {
46322
46334
  return (_ctx, _cache) => {
46323
46335
  const _directive_click_outside = vue.resolveDirective("click-outside");
46324
46336
  return vue.openBlock(), vue.createElementBlock("div", {
46325
- class: vue.normalizeClass(["superdoc", { "superdoc--with-sidebar": showCommentsSidebar.value }])
46337
+ class: vue.normalizeClass(["superdoc", { "superdoc--with-sidebar": showCommentsSidebar.value, "high-contrast": vue.unref(isHighContrastMode2) }])
46326
46338
  }, [
46327
46339
  vue.createBaseVNode("div", {
46328
46340
  class: "superdoc__layers layers",
46329
46341
  ref_key: "layers",
46330
- ref: layers
46342
+ ref: layers,
46343
+ role: "group"
46331
46344
  }, [
46332
46345
  showToolsFloatingMenu.value ? (vue.openBlock(), vue.createElementBlock("div", {
46333
46346
  key: 0,
@@ -46462,7 +46475,7 @@ const _sfc_main = {
46462
46475
  };
46463
46476
  }
46464
46477
  };
46465
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e620aa2b"]]);
46478
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fc218ba5"]]);
46466
46479
  const createSuperdocVueApp = () => {
46467
46480
  const app = vue.createApp(App);
46468
46481
  const pinia = createPinia();
@@ -46470,7 +46483,8 @@ const createSuperdocVueApp = () => {
46470
46483
  app.directive("click-outside", vClickOutside);
46471
46484
  const superdocStore = useSuperdocStore();
46472
46485
  const commentsStore = useCommentsStore();
46473
- return { app, pinia, superdocStore, commentsStore };
46486
+ const highContrastModeStore = useHighContrastMode();
46487
+ return { app, pinia, superdocStore, commentsStore, highContrastModeStore };
46474
46488
  };
46475
46489
  const createDownload = (blob, name, extension) => {
46476
46490
  const url = URL.createObjectURL(blob);
@@ -46560,7 +46574,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
46560
46574
  this.config.colors = shuffleArray(this.config.colors);
46561
46575
  this.userColorMap = /* @__PURE__ */ new Map();
46562
46576
  this.colorIndex = 0;
46563
- this.version = "0.12.30";
46577
+ this.version = "0.12.31-next.1";
46564
46578
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
46565
46579
  this.superdocId = config.superdocId || uuid.v4();
46566
46580
  this.colors = this.config.colors;
@@ -46637,7 +46651,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
46637
46651
  }
46638
46652
  }
46639
46653
  #initVueApp() {
46640
- const { app, pinia, superdocStore, commentsStore } = createSuperdocVueApp();
46654
+ const { app, pinia, superdocStore, commentsStore, highContrastModeStore } = createSuperdocVueApp();
46641
46655
  this.app = app;
46642
46656
  this.pinia = pinia;
46643
46657
  this.app.config.globalProperties.$config = this.config;
@@ -46645,6 +46659,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
46645
46659
  this.app.config.globalProperties.$superdoc = this;
46646
46660
  this.superdocStore = superdocStore;
46647
46661
  this.commentsStore = commentsStore;
46662
+ this.highContrastModeStore = highContrastModeStore;
46648
46663
  this.superdocStore.init(this.config);
46649
46664
  this.commentsStore.init(this.config.modules.comments);
46650
46665
  }
@@ -47116,6 +47131,16 @@ class SuperDoc extends eventemitter3.EventEmitter {
47116
47131
  });
47117
47132
  }
47118
47133
  }
47134
+ /**
47135
+ * Set the high contrast mode
47136
+ * @param {boolean} isHighContrast
47137
+ * @returns {void}
47138
+ */
47139
+ setHighContrastMode(isHighContrast) {
47140
+ if (!this.activeEditor) return;
47141
+ this.activeEditor.setHighContrastMode(isHighContrast);
47142
+ this.highContrastModeStore.setHighContrastMode(isHighContrast);
47143
+ }
47119
47144
  }
47120
47145
  exports.Editor = superEditor_es.Editor;
47121
47146
  exports.SuperConverter = superEditor_es.SuperConverter;
@@ -1,5 +1,5 @@
1
- import { n as index$1, C as CommentsPluginKey, e as TrackChangesBasePluginKey, E as Editor, k as getRichTextExtensions, c as SuperInput, A as AIWriter, b as SuperEditor, d as SuperToolbar, f as createZip } from "./chunks/super-editor.es-J7K_8fA3.es.js";
2
- import { S, i, m } from "./chunks/super-editor.es-J7K_8fA3.es.js";
1
+ import { n as index$1, C as CommentsPluginKey, e as TrackChangesBasePluginKey, E as Editor, k as getRichTextExtensions, c as SuperInput, A as AIWriter, b as SuperEditor, d as SuperToolbar, f as createZip } from "./chunks/super-editor.es-Bt5pMkY-.es.js";
2
+ import { S, i, m } from "./chunks/super-editor.es-Bt5pMkY-.es.js";
3
3
  import { Y as effectScope, r as ref, Z as markRaw, p as process$1, _ as toRaw, a as computed, $ as isRef, a0 as isReactive, D as toRef, i as inject, q as getCurrentInstance, l as watch, y as unref, a1 as hasInjectionContext, N as reactive, u as nextTick, a2 as getCurrentScope, a3 as onScopeDispose, a4 as toRefs, g as global$1, K as shallowRef, O as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, s as onDeactivated, A as createTextVNode, F as Fragment, R as Comment, m as defineComponent, E as provide, I as withDirectives, C as h, V as Teleport, S as renderSlot, W as isVNode, J as watchEffect, P as Transition, G as mergeProps, Q as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, x as createVNode, z as withCtx, f as createBaseVNode, B as normalizeStyle, e as createCommentVNode, v as createBlock, w as withModifiers, n as normalizeClass, a5 as resolveDirective, d as renderList, c as createApp, X as onUnmounted, a6 as resolveDynamicComponent } from "./chunks/vue-IIIZMHTg.es.js";
4
4
  import { B as Buffer$2 } from "./chunks/jszip-BmWWPxfF.es.js";
5
5
  import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.es.js";
@@ -14070,7 +14070,8 @@ const _sfc_main$d = {
14070
14070
  onClick: withModifiers(setFocus, ["stop", "prevent"]),
14071
14071
  style: normalizeStyle(getSidebarCommentStyle.value),
14072
14072
  ref_key: "commentDialogElement",
14073
- ref: commentDialogElement
14073
+ ref: commentDialogElement,
14074
+ role: "dialog"
14074
14075
  }, [
14075
14076
  shouldShowInternalExternal.value ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
14076
14077
  createVNode(InternalDropdown, {
@@ -14166,7 +14167,7 @@ const _sfc_main$d = {
14166
14167
  };
14167
14168
  }
14168
14169
  };
14169
- const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-92061859"]]);
14170
+ const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-ff48cd67"]]);
14170
14171
  const _hoisted_1$b = { class: "comments-list" };
14171
14172
  const _hoisted_2$6 = { key: 0 };
14172
14173
  const _hoisted_3$3 = { class: "comment-item" };
@@ -45925,6 +45926,16 @@ function useAi({ emitAiHighlight, activeEditorRef }) {
45925
45926
  handleAiToolClick
45926
45927
  };
45927
45928
  }
45929
+ const isHighContrastMode = ref(false);
45930
+ function useHighContrastMode() {
45931
+ const setHighContrastMode = (value) => {
45932
+ isHighContrastMode.value = value;
45933
+ };
45934
+ return {
45935
+ isHighContrastMode,
45936
+ setHighContrastMode
45937
+ };
45938
+ }
45928
45939
  const _hoisted_1 = ["innerHTML"];
45929
45940
  const _hoisted_2 = { class: "superdoc__document document" };
45930
45941
  const _hoisted_3 = {
@@ -45966,6 +45977,7 @@ const _sfc_main = {
45966
45977
  const { showAddComment, handleEditorLocationsUpdate, handleTrackedChangeUpdate } = commentsStore;
45967
45978
  const { proxy } = getCurrentInstance();
45968
45979
  commentsStore.proxy = proxy;
45980
+ const { isHighContrastMode: isHighContrastMode2 } = useHighContrastMode();
45969
45981
  const layers = ref(null);
45970
45982
  const commentsLayer = ref(null);
45971
45983
  const toolsMenuPosition = reactive({ top: null, right: "-25px", zIndex: 101 });
@@ -46321,12 +46333,13 @@ const _sfc_main = {
46321
46333
  return (_ctx, _cache) => {
46322
46334
  const _directive_click_outside = resolveDirective("click-outside");
46323
46335
  return openBlock(), createElementBlock("div", {
46324
- class: normalizeClass(["superdoc", { "superdoc--with-sidebar": showCommentsSidebar.value }])
46336
+ class: normalizeClass(["superdoc", { "superdoc--with-sidebar": showCommentsSidebar.value, "high-contrast": unref(isHighContrastMode2) }])
46325
46337
  }, [
46326
46338
  createBaseVNode("div", {
46327
46339
  class: "superdoc__layers layers",
46328
46340
  ref_key: "layers",
46329
- ref: layers
46341
+ ref: layers,
46342
+ role: "group"
46330
46343
  }, [
46331
46344
  showToolsFloatingMenu.value ? (openBlock(), createElementBlock("div", {
46332
46345
  key: 0,
@@ -46461,7 +46474,7 @@ const _sfc_main = {
46461
46474
  };
46462
46475
  }
46463
46476
  };
46464
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e620aa2b"]]);
46477
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fc218ba5"]]);
46465
46478
  const createSuperdocVueApp = () => {
46466
46479
  const app = createApp(App);
46467
46480
  const pinia = createPinia();
@@ -46469,7 +46482,8 @@ const createSuperdocVueApp = () => {
46469
46482
  app.directive("click-outside", vClickOutside);
46470
46483
  const superdocStore = useSuperdocStore();
46471
46484
  const commentsStore = useCommentsStore();
46472
- return { app, pinia, superdocStore, commentsStore };
46485
+ const highContrastModeStore = useHighContrastMode();
46486
+ return { app, pinia, superdocStore, commentsStore, highContrastModeStore };
46473
46487
  };
46474
46488
  const createDownload = (blob, name, extension) => {
46475
46489
  const url = URL.createObjectURL(blob);
@@ -46559,7 +46573,7 @@ class SuperDoc extends EventEmitter {
46559
46573
  this.config.colors = shuffleArray(this.config.colors);
46560
46574
  this.userColorMap = /* @__PURE__ */ new Map();
46561
46575
  this.colorIndex = 0;
46562
- this.version = "0.12.30";
46576
+ this.version = "0.12.31-next.1";
46563
46577
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
46564
46578
  this.superdocId = config.superdocId || v4();
46565
46579
  this.colors = this.config.colors;
@@ -46636,7 +46650,7 @@ class SuperDoc extends EventEmitter {
46636
46650
  }
46637
46651
  }
46638
46652
  #initVueApp() {
46639
- const { app, pinia, superdocStore, commentsStore } = createSuperdocVueApp();
46653
+ const { app, pinia, superdocStore, commentsStore, highContrastModeStore } = createSuperdocVueApp();
46640
46654
  this.app = app;
46641
46655
  this.pinia = pinia;
46642
46656
  this.app.config.globalProperties.$config = this.config;
@@ -46644,6 +46658,7 @@ class SuperDoc extends EventEmitter {
46644
46658
  this.app.config.globalProperties.$superdoc = this;
46645
46659
  this.superdocStore = superdocStore;
46646
46660
  this.commentsStore = commentsStore;
46661
+ this.highContrastModeStore = highContrastModeStore;
46647
46662
  this.superdocStore.init(this.config);
46648
46663
  this.commentsStore.init(this.config.modules.comments);
46649
46664
  }
@@ -47115,6 +47130,16 @@ class SuperDoc extends EventEmitter {
47115
47130
  });
47116
47131
  }
47117
47132
  }
47133
+ /**
47134
+ * Set the high contrast mode
47135
+ * @param {boolean} isHighContrast
47136
+ * @returns {void}
47137
+ */
47138
+ setHighContrastMode(isHighContrast) {
47139
+ if (!this.activeEditor) return;
47140
+ this.activeEditor.setHighContrastMode(isHighContrast);
47141
+ this.highContrastModeStore.setHighContrastMode(isHighContrast);
47142
+ }
47118
47143
  }
47119
47144
  export {
47120
47145
  BlankDOCX,