@harbour-enterprises/superdoc 1.0.0-beta.8 → 1.0.0

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 (48) hide show
  1. package/dist/chunks/{PdfViewer-DJ7BWUbW.cjs → PdfViewer-C3_5zd7y.cjs} +2 -2
  2. package/dist/chunks/{PdfViewer-BfEwF25T.es.js → PdfViewer-OoqzzuS4.es.js} +2 -2
  3. package/dist/chunks/{eventemitter3-ByBH0NYV.es.js → eventemitter3-CcXAdeql.es.js} +1 -1
  4. package/dist/chunks/{eventemitter3-CFCpOk3d.cjs → eventemitter3-DQmQUge-.cjs} +1 -1
  5. package/dist/chunks/{index-BCZ82zY5.es.js → index-BwFit1xu.es.js} +112 -41
  6. package/dist/chunks/{index-DJrRlj1_-HA-nVwDO.es.js → index-CDIpuWy0-DcqcEnVR.es.js} +1 -1
  7. package/dist/chunks/{index-DJrRlj1_-E5dmStMF.cjs → index-CDIpuWy0-v1ZRfNmH.cjs} +1 -1
  8. package/dist/chunks/{index-DMwWcmrk.cjs → index-CVDEHD5c.cjs} +112 -41
  9. package/dist/chunks/{jszip-BwsONqK5.es.js → jszip-5vvIqAEE.es.js} +1 -1
  10. package/dist/chunks/{jszip-B99MTu59.cjs → jszip-BdEez1WM.cjs} +1 -1
  11. package/dist/chunks/{super-editor.es-Bo_fWMy6.cjs → super-editor.es-CWr0w1Tk.cjs} +37747 -20889
  12. package/dist/chunks/{super-editor.es-MRWI4sfo.es.js → super-editor.es-Ddl20DOa.es.js} +37747 -20889
  13. package/dist/chunks/{vue-CztqUvm1.es.js → vue-Dysv_7z5.es.js} +101 -12
  14. package/dist/chunks/{vue-ARQSyfaw.cjs → vue-jWLMl8Ts.cjs} +89 -0
  15. package/dist/chunks/xml-js-ClO_jHnq.es.js +2 -0
  16. package/dist/chunks/xml-js-Dz51sEbr.cjs +3 -0
  17. package/dist/packages/superdoc/src/components/CommentsLayer/use-comment.d.ts.map +1 -1
  18. package/dist/packages/superdoc/src/composables/use-document.d.ts.map +1 -1
  19. package/dist/packages/superdoc/src/core/SuperDoc.d.ts +2 -2
  20. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  21. package/dist/packages/superdoc/src/core/collaboration/collaboration.d.ts +11 -0
  22. package/dist/packages/superdoc/src/core/collaboration/collaboration.d.ts.map +1 -1
  23. package/dist/packages/superdoc/src/core/types/index.d.ts +66 -3
  24. package/dist/packages/superdoc/src/core/types/index.d.ts.map +1 -1
  25. package/dist/packages/superdoc/src/stores/comments-store.d.ts.map +1 -1
  26. package/dist/style.css +90 -51
  27. package/dist/super-editor/ai-writer.es.js +2 -2
  28. package/dist/super-editor/chunks/{converter-CflxlFnM.js → converter-CuIVo-Y-.js} +7295 -811
  29. package/dist/super-editor/chunks/{docx-zipper-DKWL4mo2.js → docx-zipper-D24ieyrf.js} +15 -11
  30. package/dist/super-editor/chunks/{editor-B9V7oJbW.js → editor-DyocbwIp.js} +18722 -8867
  31. package/dist/super-editor/chunks/{index-DJrRlj1_.js → index-CDIpuWy0.js} +1 -1
  32. package/dist/super-editor/chunks/{toolbar-B5WlPN4s.js → toolbar-WQTQjgeN.js} +36 -22
  33. package/dist/super-editor/converter.es.js +1 -1
  34. package/dist/super-editor/docx-zipper.es.js +2 -2
  35. package/dist/super-editor/editor.es.js +3 -3
  36. package/dist/super-editor/file-zipper.es.js +2 -2
  37. package/dist/super-editor/style.css +57 -18
  38. package/dist/super-editor/super-editor.es.js +1025 -226
  39. package/dist/super-editor/toolbar.es.js +2 -2
  40. package/dist/super-editor.cjs +4 -4
  41. package/dist/super-editor.es.js +2 -2
  42. package/dist/superdoc.cjs +2 -2
  43. package/dist/superdoc.es.js +2 -2
  44. package/dist/superdoc.umd.js +37527 -20522
  45. package/dist/superdoc.umd.js.map +1 -1
  46. package/package.json +1 -1
  47. package/dist/chunks/xml-js-BZPSMmVo.es.js +0 -2
  48. package/dist/chunks/xml-js-DQa4Ye5C.cjs +0 -3
@@ -1,4 +1,4 @@
1
- import { aJ as getDefaultExportFromCjs } from "./converter-CflxlFnM.js";
1
+ import { aK as getDefaultExportFromCjs } from "./converter-CuIVo-Y-.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -1,6 +1,6 @@
1
- import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
2
- import { p as process$1 } from "./converter-CflxlFnM.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-B9V7oJbW.js";
1
+ import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, onMounted, onBeforeUnmount, createVNode, readonly, watch, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
2
+ import { p as process$1 } from "./converter-CuIVo-Y-.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DyocbwIp.js";
4
4
  const sanitizeNumber = (value, defaultNumber) => {
5
5
  let sanitized = value.replace(/[^0-9.]/g, "");
6
6
  sanitized = parseFloat(sanitized);
@@ -412,15 +412,16 @@ const _sfc_main$2 = {
412
412
  required: true
413
413
  }
414
414
  },
415
- emits: ["buttonClick"],
415
+ emits: ["buttonClick", "close"],
416
416
  setup(__props, { emit: __emit }) {
417
417
  const { proxy } = getCurrentInstance();
418
418
  const emit = __emit;
419
419
  const props = __props;
420
- const isDropdownOpened = computed(() => props.toolbarItem.expand.value);
420
+ const isOverflowMenuOpened = computed(() => props.toolbarItem.expand.value);
421
+ const hasOpenDropdown = ref(false);
421
422
  const overflowToolbarItem = computed(() => ({
422
423
  ...props.toolbarItem,
423
- active: isDropdownOpened.value
424
+ active: isOverflowMenuOpened.value
424
425
  }));
425
426
  const toggleOverflowMenu = () => {
426
427
  emit("buttonClick", props.toolbarItem);
@@ -428,6 +429,20 @@ const _sfc_main$2 = {
428
429
  const handleCommand = ({ item, argument }) => {
429
430
  proxy.$toolbar.emitCommand({ item, argument });
430
431
  };
432
+ const handleKeyDown = (e) => {
433
+ if (e.key === "Escape") {
434
+ if (isOverflowMenuOpened.value && !hasOpenDropdown.value) {
435
+ e.preventDefault();
436
+ emit("close");
437
+ }
438
+ }
439
+ };
440
+ onMounted(() => {
441
+ document.addEventListener("keydown", handleKeyDown, true);
442
+ });
443
+ onBeforeUnmount(() => {
444
+ document.removeEventListener("keydown", handleKeyDown, true);
445
+ });
431
446
  return (_ctx, _cache) => {
432
447
  return openBlock(), createElementBlock("div", _hoisted_1$1, [
433
448
  createElementVNode("div", _hoisted_2$1, [
@@ -436,19 +451,20 @@ const _sfc_main$2 = {
436
451
  onButtonClick: toggleOverflowMenu
437
452
  }, null, 8, ["toolbar-item"])
438
453
  ]),
439
- isDropdownOpened.value ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
454
+ isOverflowMenuOpened.value ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
440
455
  createVNode(ButtonGroup, {
441
456
  class: "superdoc-toolbar-overflow",
442
457
  "toolbar-items": __props.overflowItems,
443
458
  "from-overflow": "",
444
- onCommand: handleCommand
459
+ onCommand: handleCommand,
460
+ onDropdownUpdateShow: _cache[0] || (_cache[0] = ($event) => hasOpenDropdown.value = $event)
445
461
  }, null, 8, ["toolbar-items"])
446
462
  ])) : createCommentVNode("", true)
447
463
  ]);
448
464
  };
449
465
  }
450
466
  };
451
- const OverflowMenu = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-8bf2f427"]]);
467
+ const OverflowMenu = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-ef28da92"]]);
452
468
  function plugin$1(options) {
453
469
  let _bPrefix = ".";
454
470
  let _ePrefix = "__";
@@ -9820,7 +9836,7 @@ const _sfc_main$1 = {
9820
9836
  default: false
9821
9837
  }
9822
9838
  },
9823
- emits: ["command", "item-clicked"],
9839
+ emits: ["command", "item-clicked", "dropdown-update-show"],
9824
9840
  setup(__props, { emit: __emit }) {
9825
9841
  const emit = __emit;
9826
9842
  const toolbarItemRefs = ref([]);
@@ -9891,15 +9907,6 @@ const _sfc_main$1 = {
9891
9907
  ariaLabel: `${item.attributes.value.ariaLabel} - ${option.label}`
9892
9908
  };
9893
9909
  };
9894
- const handleClickOutside = (e) => {
9895
- const target = e.target;
9896
- const itemCtn = target.closest(".toolbar-item-ctn");
9897
- const targetItemId = itemCtn?.dataset.itemId;
9898
- if (targetItemId === currentItem.value.id) {
9899
- return;
9900
- }
9901
- closeDropdowns();
9902
- };
9903
9910
  const moveToNextButton = (e) => {
9904
9911
  const currentButton = e.target;
9905
9912
  const nextButton = e.target.closest(".toolbar-item-ctn").nextElementSibling;
@@ -9975,6 +9982,12 @@ const _sfc_main$1 = {
9975
9982
  firstButton.focus();
9976
9983
  }
9977
9984
  };
9985
+ const handleDropdownUpdateShow = (open) => {
9986
+ if (!open) {
9987
+ closeDropdowns();
9988
+ }
9989
+ emit("dropdown-update-show", open);
9990
+ };
9978
9991
  return (_ctx, _cache) => {
9979
9992
  return openBlock(), createElementBlock("div", {
9980
9993
  style: normalizeStyle(getPositionStyle.value),
@@ -10010,7 +10023,7 @@ const _sfc_main$1 = {
10010
10023
  placement: "bottom-start",
10011
10024
  class: normalizeClass(["toolbar-button toolbar-dropdown sd-editor-toolbar-dropdown", { "high-contrast": unref(isHighContrastMode) }]),
10012
10025
  onSelect: (key, option) => handleSelect(item, option),
10013
- onClickoutside: handleClickOutside,
10026
+ onUpdateShow: handleDropdownUpdateShow,
10014
10027
  style: normalizeStyle(item.dropdownStyles.value),
10015
10028
  "menu-props": () => ({
10016
10029
  role: "menu"
@@ -10065,7 +10078,8 @@ const _sfc_main$1 = {
10065
10078
  key: 3,
10066
10079
  "toolbar-item": item,
10067
10080
  onButtonClick: ($event) => handleToolbarButtonClick(item),
10068
- "overflow-items": __props.overflowItems
10081
+ "overflow-items": __props.overflowItems,
10082
+ onClose: closeDropdowns
10069
10083
  }, null, 8, ["toolbar-item", "onButtonClick", "overflow-items"])) : createCommentVNode("", true)
10070
10084
  ], 42, _hoisted_1);
10071
10085
  }), 128))
@@ -10073,7 +10087,7 @@ const _sfc_main$1 = {
10073
10087
  };
10074
10088
  }
10075
10089
  };
10076
- const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-f42ec7e6"]]);
10090
+ const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-c80a1e51"]]);
10077
10091
  const _sfc_main = {
10078
10092
  __name: "Toolbar",
10079
10093
  emits: ["command", "toggle", "select"],
@@ -1,4 +1,4 @@
1
- import { ac } from "./chunks/converter-CflxlFnM.js";
1
+ import { ac } from "./chunks/converter-CuIVo-Y-.js";
2
2
  export {
3
3
  ac as SuperConverter
4
4
  };
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-CflxlFnM.js";
2
- import { D } from "./chunks/docx-zipper-DKWL4mo2.js";
1
+ import "./chunks/converter-CuIVo-Y-.js";
2
+ import { D } from "./chunks/docx-zipper-D24ieyrf.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-B9V7oJbW.js";
2
- import "./chunks/converter-CflxlFnM.js";
3
- import "./chunks/docx-zipper-DKWL4mo2.js";
1
+ import { E } from "./chunks/editor-DyocbwIp.js";
2
+ import "./chunks/converter-CuIVo-Y-.js";
3
+ import "./chunks/docx-zipper-D24ieyrf.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,10 +1,10 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-DKWL4mo2.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-D24ieyrf.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
5
5
  zip.file(fileNames[index], blob);
6
6
  });
7
- const zipBlob = await zip.generateAsync({ type: "blob" });
7
+ const zipBlob = await zip.generateAsync({ type: "blob", compression: "DEFLATE" });
8
8
  return zipBlob;
9
9
  }
10
10
  export {
@@ -219,10 +219,10 @@
219
219
  background-color: #c8d0d8;
220
220
  }
221
221
 
222
- .overflow-menu[data-v-8bf2f427] {
222
+ .overflow-menu[data-v-ef28da92] {
223
223
  position: relative;
224
224
  }
225
- .overflow-menu_items[data-v-8bf2f427] {
225
+ .overflow-menu_items[data-v-ef28da92] {
226
226
  position: absolute;
227
227
  width: 200px;
228
228
  top: calc(100% + 3px);
@@ -234,13 +234,13 @@
234
234
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
235
235
  box-sizing: border-box;
236
236
  }
237
- .superdoc-toolbar-overflow[data-v-8bf2f427] {
237
+ .superdoc-toolbar-overflow[data-v-ef28da92] {
238
238
  min-width: auto !important;
239
239
  max-width: 200px;
240
240
  flex-wrap: wrap;
241
241
  }
242
242
  @media (max-width: 300px) {
243
- .overflow-menu_items[data-v-8bf2f427] {
243
+ .overflow-menu_items[data-v-ef28da92] {
244
244
  right: auto;
245
245
  left: 0;
246
246
  transform: translateX(-50%);
@@ -282,7 +282,7 @@
282
282
  border-radius: 8px !important;
283
283
  }
284
284
 
285
- .button-group[data-v-f42ec7e6] {
285
+ .button-group[data-v-c80a1e51] {
286
286
  display: flex;
287
287
  }
288
288
 
@@ -1876,7 +1876,7 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1876
1876
  }
1877
1877
 
1878
1878
  /* @remarks - popover adds a slight shadow, this can be removed if needed */
1879
- .generic-popover[data-v-cbddcc0f] {
1879
+ .generic-popover[data-v-157855b5] {
1880
1880
  /* @remarks - this should ideally be handled by the content or component - but some are missing */
1881
1881
  background-color: white;
1882
1882
  position: absolute;
@@ -1889,18 +1889,18 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1889
1889
  min-height: 40px;
1890
1890
  }
1891
1891
 
1892
- .superdoc-table-resize-overlay[data-v-acc51d8d] {
1892
+ .superdoc-table-resize-overlay[data-v-814384b6] {
1893
1893
  position: absolute;
1894
1894
  pointer-events: none;
1895
1895
  user-select: none;
1896
1896
  }
1897
- .resize-handle[data-v-acc51d8d] {
1897
+ .resize-handle[data-v-814384b6] {
1898
1898
  position: absolute;
1899
1899
  cursor: col-resize;
1900
1900
  user-select: none;
1901
1901
  z-index: 15;
1902
1902
  }
1903
- .resize-handle[data-v-acc51d8d]::before {
1903
+ .resize-handle[data-v-814384b6]::before {
1904
1904
  content: '';
1905
1905
  position: absolute;
1906
1906
  left: 50%;
@@ -1913,27 +1913,66 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1913
1913
  background-color 0.2s ease,
1914
1914
  width 0.2s ease;
1915
1915
  }
1916
- .resize-handle[data-v-acc51d8d]:hover::before {
1916
+ .resize-handle[data-v-814384b6]:hover::before {
1917
1917
  background-color: #4a90e2;
1918
1918
  width: 3px;
1919
1919
  transform: translateX(-1.5px);
1920
1920
  }
1921
- .resize-handle--active[data-v-acc51d8d]::before {
1921
+ .resize-handle--active[data-v-814384b6]::before {
1922
1922
  background-color: #4a90e2;
1923
1923
  width: 2px;
1924
1924
  transform: translateX(-1px);
1925
1925
  }
1926
- .resize-guideline[data-v-acc51d8d] {
1926
+ .resize-guideline[data-v-814384b6] {
1927
1927
  position: absolute;
1928
1928
  background-color: #4a90e2;
1929
1929
  pointer-events: none;
1930
1930
  box-shadow: 0 0 4px rgba(74, 144, 226, 0.5);
1931
1931
  }
1932
1932
 
1933
- .editor-element[data-v-f1e98438] {
1933
+ .superdoc-image-resize-overlay[data-v-e66ec7bb] {
1934
+ position: absolute;
1935
+ pointer-events: none;
1936
+ user-select: none;
1937
+ overflow: visible;
1938
+ }
1939
+ .resize-handle[data-v-e66ec7bb] {
1940
+ position: absolute;
1941
+ width: var(--v1e81f81d);
1942
+ height: var(--v1e81f81d);
1943
+ background-color: #ffffff;
1944
+ border: 2px solid #4a90e2;
1945
+ border-radius: 50%;
1946
+ user-select: none;
1947
+ z-index: var(--v12763124);
1948
+ pointer-events: auto;
1949
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
1950
+ transition:
1951
+ transform 0.2s ease,
1952
+ box-shadow 0.2s ease;
1953
+ }
1954
+ .resize-handle[data-v-e66ec7bb]:hover {
1955
+ transform: scale(1.2);
1956
+ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
1957
+ background-color: #4a90e2;
1958
+ border-color: #ffffff;
1959
+ }
1960
+ .resize-handle--active[data-v-e66ec7bb] {
1961
+ transform: scale(1.2);
1962
+ background-color: #4a90e2;
1963
+ border-color: #ffffff;
1964
+ }
1965
+ .resize-guideline[data-v-e66ec7bb] {
1966
+ position: absolute;
1967
+ background-color: rgba(74, 144, 226, 0.1);
1968
+ pointer-events: none;
1969
+ box-shadow: 0 0 4px rgba(74, 144, 226, 0.5);
1970
+ }
1971
+
1972
+ .editor-element[data-v-a935d3e2] {
1934
1973
  position: relative;
1935
1974
  }
1936
- .super-editor-container[data-v-f1e98438] {
1975
+ .super-editor-container[data-v-a935d3e2] {
1937
1976
  width: auto;
1938
1977
  height: auto;
1939
1978
  min-width: 8in;
@@ -1942,14 +1981,14 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1942
1981
  display: flex;
1943
1982
  flex-direction: column;
1944
1983
  }
1945
- .ruler[data-v-f1e98438] {
1984
+ .ruler[data-v-a935d3e2] {
1946
1985
  margin-bottom: 2px;
1947
1986
  }
1948
- .super-editor[data-v-f1e98438] {
1987
+ .super-editor[data-v-a935d3e2] {
1949
1988
  color: initial;
1950
1989
  overflow: hidden;
1951
1990
  }
1952
- .placeholder-editor[data-v-f1e98438] {
1991
+ .placeholder-editor[data-v-a935d3e2] {
1953
1992
  position: absolute;
1954
1993
  top: 0;
1955
1994
  left: 0;
@@ -1961,7 +2000,7 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1961
2000
  background-color: white;
1962
2001
  box-sizing: border-box;
1963
2002
  }
1964
- .placeholder-title[data-v-f1e98438] {
2003
+ .placeholder-title[data-v-a935d3e2] {
1965
2004
  display: flex;
1966
2005
  justify-content: center;
1967
2006
  margin-bottom: 40px;