@harbour-enterprises/superdoc 0.6.32 → 0.6.34

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 (25) hide show
  1. package/dist/chunks/{super-editor.es-5kNB1-AX.js → super-editor.es-Clae0piR.js} +47 -28
  2. package/dist/chunks/{super-editor.es-5kNB1-AX.js.map → super-editor.es-Clae0piR.js.map} +1 -1
  3. package/dist/style.css +40 -34
  4. package/dist/super-editor/chunks/{converter-D9ZxuNBg.js → converter-D8ypyLVy.js} +3 -3
  5. package/dist/super-editor/chunks/{converter-D9ZxuNBg.js.map → converter-D8ypyLVy.js.map} +1 -1
  6. package/dist/super-editor/chunks/{docx-zipper-DRzc1s1g.js → docx-zipper-JxK5j_VH.js} +2 -2
  7. package/dist/super-editor/chunks/{docx-zipper-DRzc1s1g.js.map → docx-zipper-JxK5j_VH.js.map} +1 -1
  8. package/dist/super-editor/chunks/{editor-CCoN68Le.js → editor-FYK4p1Sx.js} +4 -4
  9. package/dist/super-editor/chunks/{editor-CCoN68Le.js.map → editor-FYK4p1Sx.js.map} +1 -1
  10. package/dist/super-editor/chunks/{toolbar-y26xCCwj.js → toolbar-CjTZ7qxx.js} +8 -8
  11. package/dist/super-editor/chunks/toolbar-CjTZ7qxx.js.map +1 -0
  12. package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
  13. package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
  14. package/dist/super-editor/converter.es.js +1 -1
  15. package/dist/super-editor/docx-zipper.es.js +2 -2
  16. package/dist/super-editor/editor.es.js +3 -3
  17. package/dist/super-editor/file-zipper.es.js +1 -1
  18. package/dist/super-editor/style.css +40 -34
  19. package/dist/super-editor/super-editor.es.js +44 -25
  20. package/dist/super-editor/super-editor.es.js.map +1 -1
  21. package/dist/super-editor/toolbar.es.js +2 -2
  22. package/dist/super-editor.es.js +1 -1
  23. package/dist/superdoc.es.js +3 -3
  24. package/package.json +1 -1
  25. package/dist/super-editor/chunks/toolbar-y26xCCwj.js.map +0 -1
@@ -53710,7 +53710,7 @@ const _SuperConverter = class _SuperConverter2 {
53710
53710
  return;
53711
53711
  }
53712
53712
  }
53713
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.6.32") {
53713
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.6.34") {
53714
53714
  const customLocation = "docProps/custom.xml";
53715
53715
  if (!docx[customLocation]) {
53716
53716
  docx[customLocation] = generateCustomXml();
@@ -53955,7 +53955,7 @@ function storeSuperdocVersion(docx) {
53955
53955
  function generateCustomXml() {
53956
53956
  return DEFAULT_CUSTOM_XML;
53957
53957
  }
53958
- function generateSuperdocVersion(version2 = "0.6.32") {
53958
+ function generateSuperdocVersion(version2 = "0.6.34") {
53959
53959
  return {
53960
53960
  type: "element",
53961
53961
  name: "property",
@@ -67926,7 +67926,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
67926
67926
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
67927
67927
  */
67928
67928
  processCollaborationMigrations() {
67929
- console.debug("[checkVersionMigrations] Current editor version", "0.6.32");
67929
+ console.debug("[checkVersionMigrations] Current editor version", "0.6.34");
67930
67930
  if (!this.options.ydoc) return;
67931
67931
  const metaMap = this.options.ydoc.getMap("meta");
67932
67932
  let docVersion = metaMap.get("version");
@@ -79041,7 +79041,7 @@ const _sfc_main$4$1 = {
79041
79041
  };
79042
79042
  }
79043
79043
  };
79044
- const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-41fff057"]]);
79044
+ const ToolbarButton = /* @__PURE__ */ _export_sfc(_sfc_main$4$1, [["__scopeId", "data-v-33900b15"]]);
79045
79045
  const _hoisted_1$2$1 = { class: "toolbar-separator" };
79046
79046
  const _sfc_main$3$1 = {
79047
79047
  __name: "ToolbarSeparator",
@@ -88464,11 +88464,11 @@ const _sfc_main$1$1 = {
88464
88464
  const isMobile = window.matchMedia("(max-width: 768px)").matches;
88465
88465
  const styleMap = {
88466
88466
  left: {
88467
- minWidth: "150px",
88467
+ minWidth: "140px",
88468
88468
  justifyContent: "flex-start"
88469
88469
  },
88470
88470
  right: {
88471
- minWidth: "150px",
88471
+ minWidth: "140px",
88472
88472
  justifyContent: "flex-end"
88473
88473
  },
88474
88474
  default: {
@@ -88573,7 +88573,7 @@ const _sfc_main$1$1 = {
88573
88573
  };
88574
88574
  }
88575
88575
  };
88576
- const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1$1, [["__scopeId", "data-v-2fd1a367"]]);
88576
+ const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1$1, [["__scopeId", "data-v-4b88ec39"]]);
88577
88577
  const _sfc_main$c = {
88578
88578
  __name: "Toolbar",
88579
88579
  emits: ["command", "toggle", "select"],
@@ -88629,7 +88629,7 @@ const _sfc_main$c = {
88629
88629
  };
88630
88630
  }
88631
88631
  };
88632
- const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-5c1cafc5"]]);
88632
+ const Toolbar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-4b88e275"]]);
88633
88633
  async function createZip(blobs, fileNames) {
88634
88634
  const zip = new JSZip();
88635
88635
  blobs.forEach((blob, index2) => {
@@ -89568,7 +89568,7 @@ const makeDefaultItems = (superToolbar, isDev = false, windowWidth, role, toolba
89568
89568
  labelAttr: "fontFamily",
89569
89569
  hasCaret: true,
89570
89570
  isWide: true,
89571
- style: { width: "150px" },
89571
+ style: { width: "116px" },
89572
89572
  suppressActiveHighlight: true,
89573
89573
  options: [
89574
89574
  {
@@ -90112,7 +90112,7 @@ const makeDefaultItems = (superToolbar, isDev = false, windowWidth, role, toolba
90112
90112
  group: "right",
90113
90113
  attributes: {
90114
90114
  dropdownPosition: "right",
90115
- className: "doc-mode"
90115
+ className: "toolbar-item--doc-mode"
90116
90116
  },
90117
90117
  options: [
90118
90118
  {
@@ -90163,11 +90163,12 @@ const makeDefaultItems = (superToolbar, isDev = false, windowWidth, role, toolba
90163
90163
  });
90164
90164
  const controlSizes = /* @__PURE__ */ new Map([
90165
90165
  ["separator", 20],
90166
- ["textAlign", 37],
90167
- ["documentMode", 45],
90168
- ["zoom", 70],
90169
- ["fontSize", 56],
90170
- ["fontFamily", 72],
90166
+ ["zoom", 71],
90167
+ ["fontFamily", 118],
90168
+ ["fontSize", 57],
90169
+ ["textAlign", 40],
90170
+ ["linkedStyles", 142],
90171
+ ["documentMode", 47],
90171
90172
  ["default", 32]
90172
90173
  ]);
90173
90174
  const ruler = useToolbarItem({
@@ -90186,9 +90187,12 @@ const makeDefaultItems = (superToolbar, isDev = false, windowWidth, role, toolba
90186
90187
  label: "Format text",
90187
90188
  hasCaret: true,
90188
90189
  isWide: true,
90189
- style: { width: "150px" },
90190
+ style: { width: "140px" },
90190
90191
  suppressActiveHighlight: true,
90191
90192
  disabled: false,
90193
+ attributes: {
90194
+ className: "toolbar-item--linked-styles"
90195
+ },
90192
90196
  options: [
90193
90197
  {
90194
90198
  type: "render",
@@ -90215,10 +90219,15 @@ const makeDefaultItems = (superToolbar, isDev = false, windowWidth, role, toolba
90215
90219
  linkedStyles.disabled.value = true;
90216
90220
  }
90217
90221
  });
90218
- const itemsToHide = ["zoom", "fontFamily", "fontSize", "redo"];
90219
- const hideWideItemsEndpoint = 600;
90220
- const toolbarPadding = 32;
90222
+ const breakpoints = {
90223
+ sm: 768,
90224
+ md: 1024,
90225
+ xl: 1410
90226
+ };
90221
90227
  const stickyItemsWidth = 120;
90228
+ const toolbarPadding = 32;
90229
+ const itemsToHideXL = ["linkedStyles", "clearFormatting", "copyFormat", "ruler"];
90230
+ const itemsToHideSM = ["zoom", "fontFamily", "fontSize", "redo"];
90222
90231
  let toolbarItems = [
90223
90232
  undo2,
90224
90233
  redo2,
@@ -90261,7 +90270,7 @@ const makeDefaultItems = (superToolbar, isDev = false, windowWidth, role, toolba
90261
90270
  documentMode
90262
90271
  // search,
90263
90272
  ];
90264
- if (windowWidth <= hideWideItemsEndpoint) {
90273
+ if (windowWidth <= breakpoints.md) {
90265
90274
  toolbarItems = toolbarItems.filter((item) => item.type !== "separator");
90266
90275
  }
90267
90276
  if (!superToolbar.config.pagination) {
@@ -90286,7 +90295,15 @@ const makeDefaultItems = (superToolbar, isDev = false, windowWidth, role, toolba
90286
90295
  let totalWidth = toolbarPadding + stickyItemsWidth;
90287
90296
  toolbarItems.forEach((item) => {
90288
90297
  const itemWidth = controlSizes.get(item.name.value) || controlSizes.get("default");
90289
- if (windowWidth < hideWideItemsEndpoint && itemsToHide.includes(item.name.value)) {
90298
+ if (windowWidth < breakpoints.xl && itemsToHideXL.includes(item.name.value)) {
90299
+ overflowItems.push(item);
90300
+ if (item.name.value === "linkedStyles") {
90301
+ const linkedStylesIdx = toolbarItems.findIndex((item2) => item2.name.value === "linkedStyles");
90302
+ toolbarItems.splice(linkedStylesIdx + 1, 1);
90303
+ }
90304
+ return;
90305
+ }
90306
+ if (windowWidth < breakpoints.sm && itemsToHideSM.includes(item.name.value)) {
90290
90307
  overflowItems.push(item);
90291
90308
  return;
90292
90309
  }
@@ -90488,7 +90505,7 @@ class SuperToolbar extends EventEmitter {
90488
90505
  __privateMethod(this, _SuperToolbar_instances, runCommandWithArgumentOnly_fn).call(this, { item, argument });
90489
90506
  },
90490
90507
  setHighlight: ({ item, argument }) => {
90491
- __privateMethod(this, _SuperToolbar_instances, runCommandWithArgumentOnly_fn).call(this, { item, argument: argument || "#D6D6D6" });
90508
+ __privateMethod(this, _SuperToolbar_instances, runCommandWithArgumentOnly_fn).call(this, { item, argument });
90492
90509
  },
90493
90510
  toggleRuler: ({ item, argument }) => {
90494
90511
  this.superdoc.toggleRuler();
@@ -90696,7 +90713,8 @@ class SuperToolbar extends EventEmitter {
90696
90713
  _interceptedCommands = /* @__PURE__ */ new WeakMap();
90697
90714
  _SuperToolbar_instances = /* @__PURE__ */ new WeakSet();
90698
90715
  makeToolbarItems_fn = function(superToolbar, icons2, isDev = false) {
90699
- const { defaultItems, overflowItems } = makeDefaultItems(superToolbar, isDev, window.innerWidth, this.role, icons2);
90716
+ const documentWidth = document.documentElement.clientWidth;
90717
+ const { defaultItems, overflowItems } = makeDefaultItems(superToolbar, isDev, documentWidth, this.role, icons2);
90700
90718
  this.toolbarItems = defaultItems;
90701
90719
  this.overflowItems = overflowItems;
90702
90720
  };
@@ -91088,10 +91106,11 @@ const _sfc_main$2 = {
91088
91106
  delete props.options.content;
91089
91107
  const ydoc = props.options.ydoc;
91090
91108
  const provider = props.options.collaborationProvider;
91091
- provider.on("synced", () => {
91109
+ const handleSynced = () => {
91092
91110
  pollForMetaMapData(ydoc);
91093
- provider.off("synced");
91094
- });
91111
+ provider.off("synced", handleSynced);
91112
+ };
91113
+ provider.on("synced", handleSynced);
91095
91114
  }
91096
91115
  };
91097
91116
  const getExtensions = () => {
@@ -91228,7 +91247,7 @@ const _sfc_main$2 = {
91228
91247
  };
91229
91248
  }
91230
91249
  };
91231
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-763b7d81"]]);
91250
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-afb40ff1"]]);
91232
91251
  const _sfc_main$1 = {
91233
91252
  __name: "BasicUpload",
91234
91253
  emits: ["file-change"],
@@ -91350,4 +91369,4 @@ export {
91350
91369
  helpers as k,
91351
91370
  index as l
91352
91371
  };
91353
- //# sourceMappingURL=super-editor.es-5kNB1-AX.js.map
91372
+ //# sourceMappingURL=super-editor.es-Clae0piR.js.map