@harbour-enterprises/superdoc 0.5.12 → 0.5.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.
Files changed (26) hide show
  1. package/dist/chunks/{super-editor.es-DImmA9mQ.js → super-editor.es-D8gDx0Xk.js} +22 -10
  2. package/dist/chunks/{super-editor.es-DImmA9mQ.js.map → super-editor.es-D8gDx0Xk.js.map} +1 -1
  3. package/dist/style.css +6 -6
  4. package/dist/super-editor/chunks/{converter-CFLxtL2x.js → converter-NKfCyisU.js} +3 -3
  5. package/dist/super-editor/chunks/{converter-CFLxtL2x.js.map → converter-NKfCyisU.js.map} +1 -1
  6. package/dist/super-editor/chunks/{docx-zipper-BaNAQU0O.js → docx-zipper-DJ7daFzb.js} +2 -2
  7. package/dist/super-editor/chunks/{docx-zipper-BaNAQU0O.js.map → docx-zipper-DJ7daFzb.js.map} +1 -1
  8. package/dist/super-editor/chunks/{editor-BmHE-S8u.js → editor-B9mWpy4t.js} +7 -5
  9. package/dist/super-editor/chunks/{editor-BmHE-S8u.js.map → editor-B9mWpy4t.js.map} +1 -1
  10. package/dist/super-editor/chunks/{toolbar-p9qCNyMX.js → toolbar-C1eFWogE.js} +3 -3
  11. package/dist/super-editor/chunks/{toolbar-p9qCNyMX.js.map → toolbar-C1eFWogE.js.map} +1 -1
  12. package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
  13. package/dist/super-editor/components/toolbar/super-toolbar.d.ts +1 -0
  14. package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/extensions/linked-styles/linked-styles.d.ts.map +1 -1
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/style.css +6 -6
  21. package/dist/super-editor/super-editor.es.js +21 -11
  22. package/dist/super-editor/super-editor.es.js.map +1 -1
  23. package/dist/super-editor/toolbar.es.js +2 -2
  24. package/dist/super-editor.es.js +1 -1
  25. package/dist/superdoc.es.js +3 -3
  26. package/package.json +1 -1
@@ -52813,7 +52813,7 @@ const _SuperConverter = class _SuperConverter2 {
52813
52813
  return;
52814
52814
  }
52815
52815
  }
52816
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.5.12") {
52816
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.5.13") {
52817
52817
  const customLocation = "docProps/custom.xml";
52818
52818
  if (!docx[customLocation]) {
52819
52819
  docx[customLocation] = generateCustomXml();
@@ -53053,7 +53053,7 @@ function storeSuperdocVersion(docx) {
53053
53053
  function generateCustomXml() {
53054
53054
  return DEFAULT_CUSTOM_XML;
53055
53055
  }
53056
- function generateSuperdocVersion(version2 = "0.5.12") {
53056
+ function generateSuperdocVersion(version2 = "0.5.13") {
53057
53057
  return {
53058
53058
  type: "element",
53059
53059
  name: "property",
@@ -66870,7 +66870,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
66870
66870
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
66871
66871
  */
66872
66872
  processCollaborationMigrations() {
66873
- console.debug("[checkVersionMigrations] Current editor version", "0.5.12");
66873
+ console.debug("[checkVersionMigrations] Current editor version", "0.5.13");
66874
66874
  if (!this.options.ydoc) return;
66875
66875
  const metaMap = this.options.ydoc.getMap("meta");
66876
66876
  let docVersion = metaMap.get("version");
@@ -68691,7 +68691,7 @@ const createLinkedStylesPlugin = (editor) => {
68691
68691
  key: LinkedStylesPluginKey,
68692
68692
  state: {
68693
68693
  init(_, { doc: doc2, selection }) {
68694
- if (!editor.converter) return;
68694
+ if (!editor.converter || editor.options.mode !== "docx") return {};
68695
68695
  const styles = editor.converter?.linkedStyles || [];
68696
68696
  return {
68697
68697
  styles,
@@ -68699,6 +68699,7 @@ const createLinkedStylesPlugin = (editor) => {
68699
68699
  };
68700
68700
  },
68701
68701
  apply(tr, prev, oldEditorState, newEditorState) {
68702
+ if (!editor.converter || editor.options.mode !== "docx") return { ...prev };
68702
68703
  let decorations = prev.decorations || DecorationSet.empty;
68703
68704
  if (tr.docChanged) {
68704
68705
  const styles = LinkedStylesPluginKey.getState(editor.state).styles;
@@ -68789,6 +68790,7 @@ const getSpacingStyleString = (spacing) => {
68789
68790
  `.trim();
68790
68791
  };
68791
68792
  const getQuickFormatList = (editor) => {
68793
+ if (!editor?.converter) return [];
68792
68794
  const styles = editor.converter.linkedStyles || [];
68793
68795
  return styles.filter((style2) => {
68794
68796
  return style2.type === "paragraph" && style2.definition.attrs;
@@ -85365,7 +85367,10 @@ const _sfc_main$5 = {
85365
85367
  }
85366
85368
  };
85367
85369
  const DocumentMode = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-f86e1477"]]);
85368
- const _hoisted_1$3 = { class: "linked-style-buttons" };
85370
+ const _hoisted_1$3 = {
85371
+ key: 0,
85372
+ class: "linked-style-buttons"
85373
+ };
85369
85374
  const _hoisted_2$1 = ["onClick"];
85370
85375
  const _sfc_main$4 = {
85371
85376
  __name: "LinkedStyle",
@@ -85378,11 +85383,12 @@ const _sfc_main$4 = {
85378
85383
  emits: ["select"],
85379
85384
  setup(__props, { emit: __emit }) {
85380
85385
  const emit = __emit;
85386
+ const props = __props;
85381
85387
  const select = (style2) => {
85382
85388
  emit("select", style2);
85383
85389
  };
85384
85390
  return (_ctx, _cache) => {
85385
- return openBlock(), createElementBlock("div", _hoisted_1$3, [
85391
+ return props.editor ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
85386
85392
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(getQuickFormatList)(__props.editor), (style2) => {
85387
85393
  return openBlock(), createElementBlock("div", {
85388
85394
  class: "style-item",
@@ -85394,11 +85400,11 @@ const _sfc_main$4 = {
85394
85400
  }, toDisplayString(style2.definition.attrs.name), 5)
85395
85401
  ], 8, _hoisted_2$1);
85396
85402
  }), 256))
85397
- ]);
85403
+ ])) : createCommentVNode("", true);
85398
85404
  };
85399
85405
  }
85400
85406
  };
85401
- const LinkedStyle = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-d24f2d54"]]);
85407
+ const LinkedStyle = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-97e3296a"]]);
85402
85408
  const closeDropdown = (dropdown) => {
85403
85409
  dropdown.expand.value = false;
85404
85410
  };
@@ -86084,6 +86090,11 @@ const makeDefaultItems = (superToolbar, isDev = false, windowWidth, role, toolba
86084
86090
  if (!superToolbar.config.pagination) {
86085
86091
  toolbarItems = toolbarItems.filter((item) => item.name.value !== "pageBreakTool");
86086
86092
  }
86093
+ if (superToolbar.config.mode !== "docx") {
86094
+ const getLinkedStylesIndex = toolbarItems.findIndex((item) => item.name.value === "linkedStyles");
86095
+ toolbarItems.splice(getLinkedStylesIndex - 1, 2);
86096
+ toolbarItems = toolbarItems.filter((item) => item.name.value !== "ruler");
86097
+ }
86087
86098
  const devItems = [toggleTrackChanges, toggleTrackChangesOriginal, toggleTrackChangesFinal];
86088
86099
  if (!isDev) {
86089
86100
  if (role === "viewer") {
@@ -86262,7 +86273,8 @@ class SuperToolbar extends EventEmitter {
86262
86273
  toolbarGroups: ["left", "center", "right"],
86263
86274
  role: "editor",
86264
86275
  pagination: false,
86265
- icons: { ...toolbarIcons }
86276
+ icons: { ...toolbarIcons },
86277
+ mode: "docx"
86266
86278
  });
86267
86279
  __privateAdd(this, _interceptedCommands, {
86268
86280
  setZoom: ({ item, argument }) => {
@@ -87119,4 +87131,4 @@ export {
87119
87131
  helpers as k,
87120
87132
  index as l
87121
87133
  };
87122
- //# sourceMappingURL=super-editor.es-DImmA9mQ.js.map
87134
+ //# sourceMappingURL=super-editor.es-D8gDx0Xk.js.map