@harbour-enterprises/superdoc 0.29.0-next.15 → 0.29.0-next.17

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 (42) hide show
  1. package/dist/chunks/{PdfViewer-B7X4xur3.cjs → PdfViewer-DYxoL3aX.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-BL9hLN-A.es.js → PdfViewer-cB0Wc125.es.js} +1 -1
  3. package/dist/chunks/{index-CCTDIDk7.es.js → index-BkH3Ewpn.es.js} +3 -3
  4. package/dist/chunks/{index-x0B8ORNX--SLHZ7wS.es.js → index-CdXg92JS-CoYVY9yT.es.js} +1 -1
  5. package/dist/chunks/{index-x0B8ORNX-D9kjqjf9.cjs → index-CdXg92JS-rI1se8w8.cjs} +1 -1
  6. package/dist/chunks/{index-CCVmXx2r.cjs → index-Cp4ihfTg.cjs} +3 -3
  7. package/dist/chunks/{super-editor.es-LUVoGFZl.es.js → super-editor.es-DbVz9iFq.es.js} +68 -36
  8. package/dist/chunks/{super-editor.es-BkV-6f5K.cjs → super-editor.es-GK0HIFwy.cjs} +68 -36
  9. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  10. package/dist/packages/superdoc/src/core/types/index.d.ts.map +1 -1
  11. package/dist/style.css +12 -12
  12. package/dist/super-editor/ai-writer.es.js +2 -2
  13. package/dist/super-editor/chunks/{converter-Bt0gPwYj.js → converter-BxHd90vg.js} +1 -1
  14. package/dist/super-editor/chunks/{docx-zipper-JVCnlDBn.js → docx-zipper-DRDqDf4t.js} +1 -1
  15. package/dist/super-editor/chunks/{editor-BF7w_sd7.js → editor-BN_AUZwq.js} +65 -38
  16. package/dist/super-editor/chunks/{index-x0B8ORNX.js → index-CdXg92JS.js} +1 -1
  17. package/dist/super-editor/chunks/{toolbar-CI9lB3KI.js → toolbar-CeJfRy_U.js} +2 -2
  18. package/dist/super-editor/converter.es.js +1 -1
  19. package/dist/super-editor/docx-zipper.es.js +2 -2
  20. package/dist/super-editor/editor.es.js +3 -3
  21. package/dist/super-editor/file-zipper.es.js +1 -1
  22. package/dist/super-editor/style.css +12 -12
  23. package/dist/super-editor/super-editor/src/components/pagination-helpers.d.ts.map +1 -1
  24. package/dist/super-editor/super-editor/src/components/toolbar/defaultItems.d.ts.map +1 -1
  25. package/dist/super-editor/super-editor/src/components/toolbar/super-toolbar.d.ts.map +1 -1
  26. package/dist/super-editor/super-editor/src/core/Editor.d.ts.map +1 -1
  27. package/dist/super-editor/super-editor/src/extensions/field-annotation/field-annotation.d.ts.map +1 -1
  28. package/dist/super-editor/super-editor/src/extensions/page-number/page-number.d.ts.map +1 -1
  29. package/dist/super-editor/super-editor/src/extensions/pagination/pagination-helpers.d.ts.map +1 -1
  30. package/dist/super-editor/super-editor/src/extensions/pagination/pagination.d.ts.map +1 -1
  31. package/dist/super-editor/super-editor/src/extensions/track-changes/permission-helpers.d.ts.map +1 -1
  32. package/dist/super-editor/super-editor/src/utils/headless-helpers.d.ts +1 -0
  33. package/dist/super-editor/super-editor/src/utils/headless-helpers.d.ts.map +1 -1
  34. package/dist/super-editor/super-editor.es.js +24 -18
  35. package/dist/super-editor/toolbar.es.js +2 -2
  36. package/dist/super-editor.cjs +1 -1
  37. package/dist/super-editor.es.js +1 -1
  38. package/dist/superdoc.cjs +2 -2
  39. package/dist/superdoc.es.js +2 -2
  40. package/dist/superdoc.umd.js +70 -38
  41. package/dist/superdoc.umd.js.map +1 -1
  42. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-BQxRC6G7.cjs");
4
- const superdoc = require("./index-CCVmXx2r.cjs");
4
+ const superdoc = require("./index-Cp4ihfTg.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  import { m as defineComponent, y as h, O as Transition, $ as process$1, J as watchEffect, a as computed, r as ref, j as onMounted, W as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, v as createVNode, x as unref } from "./vue-D1vcEBAQ.es.js";
2
- import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-CCTDIDk7.es.js";
2
+ import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-BkH3Ewpn.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,4 +1,4 @@
1
- import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-LUVoGFZl.es.js";
1
+ import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-DbVz9iFq.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
3
  import { E as EventEmitter } from "./eventemitter3-D4gv5QOO.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
@@ -17201,7 +17201,7 @@ const _sfc_main = {
17201
17201
  __name: "SuperDoc",
17202
17202
  emits: ["selection-update"],
17203
17203
  setup(__props, { emit: __emit }) {
17204
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-BL9hLN-A.es.js"));
17204
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-cB0Wc125.es.js"));
17205
17205
  const superdocStore = useSuperdocStore();
17206
17206
  const commentsStore = useCommentsStore();
17207
17207
  const {
@@ -17965,7 +17965,7 @@ class SuperDoc extends EventEmitter {
17965
17965
  this.config.colors = shuffleArray(this.config.colors);
17966
17966
  this.userColorMap = /* @__PURE__ */ new Map();
17967
17967
  this.colorIndex = 0;
17968
- this.version = "0.29.0-next.15";
17968
+ this.version = "0.29.0-next.17";
17969
17969
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
17970
17970
  this.superdocId = config.superdocId || v4();
17971
17971
  this.colors = this.config.colors;
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-LUVoGFZl.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-DbVz9iFq.es.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG-CvBqQJbG.es.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./super-editor.es-BkV-6f5K.cjs");
3
+ const superEditor_es = require("./super-editor.es-GK0HIFwy.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-BkV-6f5K.cjs");
2
+ const superEditor_es = require("./super-editor.es-GK0HIFwy.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
4
  const eventemitter3 = require("./eventemitter3-BvTILlBo.cjs");
5
5
  const provider = require("@hocuspocus/provider");
@@ -17218,7 +17218,7 @@ const _sfc_main = {
17218
17218
  __name: "SuperDoc",
17219
17219
  emits: ["selection-update"],
17220
17220
  setup(__props, { emit: __emit }) {
17221
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-B7X4xur3.cjs")));
17221
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DYxoL3aX.cjs")));
17222
17222
  const superdocStore = useSuperdocStore();
17223
17223
  const commentsStore = useCommentsStore();
17224
17224
  const {
@@ -17982,7 +17982,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
17982
17982
  this.config.colors = shuffleArray(this.config.colors);
17983
17983
  this.userColorMap = /* @__PURE__ */ new Map();
17984
17984
  this.colorIndex = 0;
17985
- this.version = "0.29.0-next.15";
17985
+ this.version = "0.29.0-next.17";
17986
17986
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
17987
17987
  this.superdocId = config.superdocId || uuid.v4();
17988
17988
  this.colors = this.config.colors;
@@ -35764,7 +35764,7 @@ const _SuperConverter = class _SuperConverter2 {
35764
35764
  static getStoredSuperdocVersion(docx) {
35765
35765
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
35766
35766
  }
35767
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.29.0-next.15") {
35767
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.29.0-next.17") {
35768
35768
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
35769
35769
  }
35770
35770
  /**
@@ -38886,14 +38886,14 @@ class DocxZipper {
38886
38886
  const zip = await this.zip.loadAsync(file);
38887
38887
  return zip;
38888
38888
  }
38889
- async updateZip({ docx, updatedDocs, originalDocxFile, media, fonts, isHeadless }) {
38889
+ async updateZip({ docx, updatedDocs, originalDocxFile, media, fonts, isHeadless: isHeadless2 }) {
38890
38890
  let zip;
38891
38891
  if (originalDocxFile) {
38892
38892
  zip = await this.exportFromOriginalFile(originalDocxFile, updatedDocs, media);
38893
38893
  } else {
38894
38894
  zip = await this.exportFromCollaborativeDocx(docx, updatedDocs, media, fonts);
38895
38895
  }
38896
- const exportType = isHeadless ? "nodebuffer" : "blob";
38896
+ const exportType = isHeadless2 ? "nodebuffer" : "blob";
38897
38897
  return await zip.generateAsync({ type: exportType });
38898
38898
  }
38899
38899
  /**
@@ -50629,9 +50629,15 @@ const applyStyleIsolationClass = (target) => {
50629
50629
  if (!target || !target.classList) return;
50630
50630
  target.classList.add(STYLE_ISOLATION_CLASS);
50631
50631
  };
50632
+ const isHeadless = (editor) => {
50633
+ return editor?.options?.isHeadless ?? false;
50634
+ };
50635
+ const shouldSkipNodeView = (editor) => {
50636
+ return isHeadless(editor);
50637
+ };
50632
50638
  const PaginationPluginKey = new PluginKey("paginationPlugin");
50633
50639
  const initPaginationData = async (editor) => {
50634
- if (!editor.converter) return;
50640
+ if (isHeadless(editor) || !editor.converter) return;
50635
50641
  const sectionData = { headers: {}, footers: {} };
50636
50642
  const headerIds = editor.converter.headerIds.ids;
50637
50643
  const footerIds = editor.converter.footerIds.ids;
@@ -50767,6 +50773,7 @@ const broadcastEditorEvents = (editor, sectionEditor) => {
50767
50773
  });
50768
50774
  };
50769
50775
  const toggleHeaderFooterEditMode = ({ editor, focusedSectionEditor, isEditMode, documentMode }) => {
50776
+ if (isHeadless(editor)) return;
50770
50777
  editor.converter.headerEditors.forEach((item) => {
50771
50778
  item.editor.setEditable(isEditMode, false);
50772
50779
  item.editor.view.dom.setAttribute("aria-readonly", !isEditMode);
@@ -53836,10 +53843,12 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
53836
53843
  };
53837
53844
  if ("orientation" in screen && "addEventListener" in screen.orientation) {
53838
53845
  screen.orientation.addEventListener("change", handleResize);
53839
- } else {
53846
+ } else if (typeof window !== "undefined" && typeof window.matchMedia === "function") {
53840
53847
  window.matchMedia("(orientation: portrait)").addEventListener("change", handleResize);
53841
53848
  }
53842
- window.addEventListener("resize", () => handleResize);
53849
+ if (typeof window !== "undefined" && typeof window.addEventListener === "function") {
53850
+ window.addEventListener("resize", () => handleResize);
53851
+ }
53843
53852
  }
53844
53853
  /**
53845
53854
  * Get document identifier for telemetry (async - may generate hash)
@@ -53953,7 +53962,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
53953
53962
  { default: remarkStringify },
53954
53963
  { default: remarkGfm }
53955
53964
  ] = await Promise.all([
53956
- import("./index-x0B8ORNX--SLHZ7wS.es.js"),
53965
+ import("./index-CdXg92JS-CoYVY9yT.es.js"),
53957
53966
  import("./index-DRCvimau-Cw339678.es.js"),
53958
53967
  import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
53959
53968
  import("./index-D_sWOSiG-DE96TaT5.es.js"),
@@ -54005,7 +54014,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
54005
54014
  this.initDefaultStyles();
54006
54015
  hasMadeUpdate = true;
54007
54016
  }
54008
- if (hasMadeUpdate) {
54017
+ if (hasMadeUpdate && !isHeadless(this)) {
54009
54018
  const newTr = this.view.state.tr;
54010
54019
  newTr.setMeta("forceUpdatePagination", true);
54011
54020
  this.view.dispatch(newTr);
@@ -54171,7 +54180,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
54171
54180
  * @returns {Object | void} Migration results
54172
54181
  */
54173
54182
  processCollaborationMigrations() {
54174
- console.debug("[checkVersionMigrations] Current editor version", "0.29.0-next.15");
54183
+ console.debug("[checkVersionMigrations] Current editor version", "0.29.0-next.17");
54175
54184
  if (!this.options.ydoc) return;
54176
54185
  const metaMap = this.options.ydoc.getMap("meta");
54177
54186
  let docVersion = metaMap.get("version");
@@ -54605,16 +54614,18 @@ createView_fn = function(element) {
54605
54614
  handleClick: __privateMethod$1(this, _Editor_instances, handleNodeSelection_fn).bind(this),
54606
54615
  handleDoubleClick: async (view, pos, event) => {
54607
54616
  if (this.options.documentMode !== "editing") return;
54608
- const isHeader = hasSomeParentWithClass(event.target, "pagination-section-header");
54609
- const isFooter = hasSomeParentWithClass(event.target, "pagination-section-footer");
54610
- if (isHeader || isFooter) {
54611
- const eventClone = new event.constructor(event.type);
54612
- event.target.dispatchEvent(eventClone);
54613
- if (this.options.isHeaderOrFooter && this.options.editable) setWordSelection(view, pos);
54614
- return;
54617
+ if (!isHeadless(this)) {
54618
+ const isHeader = hasSomeParentWithClass(event.target, "pagination-section-header");
54619
+ const isFooter = hasSomeParentWithClass(event.target, "pagination-section-footer");
54620
+ if (isHeader || isFooter) {
54621
+ const eventClone = new event.constructor(event.type);
54622
+ event.target.dispatchEvent(eventClone);
54623
+ if (this.options.isHeaderOrFooter && this.options.editable) setWordSelection(view, pos);
54624
+ return;
54625
+ }
54615
54626
  }
54616
54627
  event.stopPropagation();
54617
- if (!this.options.editable) {
54628
+ if (!this.options.editable && !isHeadless(this)) {
54618
54629
  this.setEditable(true, false);
54619
54630
  toggleHeaderFooterEditMode({
54620
54631
  editor: this,
@@ -59250,9 +59261,6 @@ function orderedListSync(editor) {
59250
59261
  }
59251
59262
  });
59252
59263
  }
59253
- const shouldSkipNodeView = (editor) => {
59254
- return editor.options.isHeadless;
59255
- };
59256
59264
  const ListItem = Node$1.create({
59257
59265
  name: "listItem",
59258
59266
  content: "paragraph* block*",
@@ -65224,7 +65232,7 @@ const FieldAnnotation = Node$1.create({
65224
65232
  }
65225
65233
  if (dispatch) {
65226
65234
  commands2.updateFieldAnnotationsAttributes([annotation], attrs);
65227
- if (this.editor.options.pagination) {
65235
+ if (this.editor.options.pagination && !isHeadless(this.editor)) {
65228
65236
  setTimeout(() => {
65229
65237
  const newTr = this.editor.view.state.tr;
65230
65238
  newTr.setMeta("forceUpdatePagination", true);
@@ -67161,7 +67169,9 @@ const PageNumber = Node$1.create({
67161
67169
  const pageNumberNode = schema.nodeFromJSON(pageNumberNodeJSON);
67162
67170
  if (dispatch) {
67163
67171
  tr.replaceSelectionWith(pageNumberNode, false);
67164
- tr.setMeta("forceUpdatePagination", true);
67172
+ if (!isHeadless(editor)) {
67173
+ tr.setMeta("forceUpdatePagination", true);
67174
+ }
67165
67175
  }
67166
67176
  return true;
67167
67177
  }
@@ -75828,6 +75838,10 @@ const Pagination = Extension.create({
75828
75838
  };
75829
75839
  },
75830
75840
  addCommands() {
75841
+ const editor = this.editor;
75842
+ if (isHeadless(editor)) {
75843
+ return {};
75844
+ }
75831
75845
  return {
75832
75846
  insertPageBreak: () => ({ commands: commands2 }) => {
75833
75847
  return commands2.insertContent({
@@ -75838,20 +75852,26 @@ const Pagination = Extension.create({
75838
75852
  * Toggle pagination on/off
75839
75853
  * @returns {void}
75840
75854
  */
75841
- togglePagination: () => ({ tr, state: state2, dispatch, editor }) => {
75855
+ togglePagination: () => ({ tr, state: state2, dispatch, editor: editor2 }) => {
75842
75856
  const isEnabled = PaginationPluginKey.getState(state2)?.isEnabled;
75843
75857
  tr.setMeta(PaginationPluginKey, { isEnabled: !isEnabled });
75844
75858
  if (dispatch) {
75845
75859
  dispatch(tr);
75846
- editor.initDefaultStyles(editor.element, !isEnabled);
75860
+ editor2.initDefaultStyles(editor2.element, !isEnabled);
75847
75861
  return true;
75848
75862
  }
75849
75863
  }
75850
75864
  };
75851
75865
  },
75852
75866
  addShortcuts() {
75867
+ const editor = this.editor;
75868
+ if (isHeadless(editor)) {
75869
+ return {};
75870
+ }
75853
75871
  return {
75854
- "Mod-Enter": () => this.editor.commands.insertPageBreak()
75872
+ "Mod-Enter": () => {
75873
+ return editor.commands.insertPageBreak();
75874
+ }
75855
75875
  };
75856
75876
  },
75857
75877
  /**
@@ -75859,6 +75879,9 @@ const Pagination = Extension.create({
75859
75879
  */
75860
75880
  addPmPlugins() {
75861
75881
  const editor = this.editor;
75882
+ if (isHeadless(editor)) {
75883
+ return [];
75884
+ }
75862
75885
  let isUpdating = false;
75863
75886
  let shouldUpdate = false;
75864
75887
  let hasInitialized = false;
@@ -75874,7 +75897,7 @@ const Pagination = Extension.create({
75874
75897
  isReadyToInit: false,
75875
75898
  decorations: DecorationSet.empty,
75876
75899
  isDebugging,
75877
- isEnabled: editor.options.pagination
75900
+ isEnabled: editor.options.pagination && !isHeadless(editor)
75878
75901
  };
75879
75902
  },
75880
75903
  apply(tr, oldState, prevEditorState, newEditorState) {
@@ -75952,6 +75975,7 @@ const Pagination = Extension.create({
75952
75975
  let previousDecorations = DecorationSet.empty;
75953
75976
  return {
75954
75977
  update: (view) => {
75978
+ if (isHeadless(editor)) return;
75955
75979
  if (!PaginationPluginKey.getState(view.state)?.isEnabled) return;
75956
75980
  if (!shouldUpdate || isUpdating) return;
75957
75981
  const performPaginationUpdate = () => {
@@ -75975,6 +75999,7 @@ const Pagination = Extension.create({
75975
75999
  },
75976
76000
  props: {
75977
76001
  decorations(state2) {
76002
+ if (isHeadless(editor)) return DecorationSet.empty;
75978
76003
  const pluginState = PaginationPluginKey.getState(state2);
75979
76004
  return pluginState.isEnabled ? pluginState.decorations : DecorationSet.empty;
75980
76005
  }
@@ -76343,7 +76368,7 @@ const getHeaderFooterEditorKey = ({ pageNumber, isHeader, isFooter, isFirstHeade
76343
76368
  return void 0;
76344
76369
  };
76345
76370
  const onHeaderFooterDblClick = (editor, currentFocusedSectionEditor) => {
76346
- if (editor.options.documentMode !== "editing") return;
76371
+ if (isHeadless(editor) || editor.options.documentMode !== "editing") return;
76347
76372
  editor.setEditable(false, false);
76348
76373
  toggleHeaderFooterEditMode({
76349
76374
  editor,
@@ -76415,6 +76440,7 @@ function getActualBreakCoords(view, pos, calculatedThreshold) {
76415
76440
  return actualBreak;
76416
76441
  }
76417
76442
  const onImageLoad = (editor) => {
76443
+ if (isHeadless(editor)) return;
76418
76444
  if (typeof requestAnimationFrame !== "function") return;
76419
76445
  requestAnimationFrame(() => {
76420
76446
  const newTr = editor.view.state.tr;
@@ -77254,9 +77280,9 @@ const NodeResizer = Extension.create({
77254
77280
  return {};
77255
77281
  },
77256
77282
  addPmPlugins() {
77257
- const isHeadless = this.editor.options.isHeadless;
77283
+ const isHeadless2 = this.editor.options.isHeadless;
77258
77284
  const hasDocument = typeof document !== "undefined";
77259
- if (isHeadless || !hasDocument) return [];
77285
+ if (isHeadless2 || !hasDocument) return [];
77260
77286
  return [nodeResizer(["image"], this.editor)];
77261
77287
  }
77262
77288
  });
@@ -88549,7 +88575,7 @@ const _hoisted_1$b = {
88549
88575
  key: 0,
88550
88576
  class: "linked-style-buttons"
88551
88577
  };
88552
- const _hoisted_2$8 = ["onClick", "onKeydown"];
88578
+ const _hoisted_2$8 = ["onClick", "onKeydown", "aria-label"];
88553
88579
  const _sfc_main$c = {
88554
88580
  __name: "LinkedStyle",
88555
88581
  props: {
@@ -88594,7 +88620,6 @@ const _sfc_main$c = {
88594
88620
  moveToPreviousStyle(index2);
88595
88621
  break;
88596
88622
  case "Enter":
88597
- console.log("style", style2);
88598
88623
  select(style2);
88599
88624
  break;
88600
88625
  }
@@ -88610,6 +88635,7 @@ const _sfc_main$c = {
88610
88635
  class: normalizeClass(["style-item", { selected: __props.selectedOption === style2.id }]),
88611
88636
  onClick: ($event) => select(style2),
88612
88637
  onKeydown: (event) => handleKeyDown2(event, index2, style2),
88638
+ "aria-label": `Linked style - ${style2.id}`,
88613
88639
  ref_for: true,
88614
88640
  ref_key: "styleRefs",
88615
88641
  ref: styleRefs
@@ -88625,7 +88651,7 @@ const _sfc_main$c = {
88625
88651
  };
88626
88652
  }
88627
88653
  };
88628
- const LinkedStyle = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-698bdb8e"]]);
88654
+ const LinkedStyle = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-9c96d4a1"]]);
88629
88655
  const _hoisted_1$a = {
88630
88656
  key: 0,
88631
88657
  class: "link-title"
@@ -90345,11 +90371,15 @@ const makeDefaultItems = ({
90345
90371
  }
90346
90372
  }
90347
90373
  ],
90348
- onActivate: () => {
90374
+ onActivate: ({ linkedStyleMark }) => {
90375
+ const styles = getQuickFormatList(superToolbar.activeEditor);
90376
+ const selectedStyle = styles?.find((style2) => style2.id === linkedStyleMark?.attrs?.styleId);
90377
+ linkedStyles.label.value = selectedStyle ? selectedStyle.definition.attrs.name : toolbarTexts2.formatText;
90349
90378
  linkedStyles.disabled.value = false;
90350
90379
  },
90351
90380
  onDeactivate: () => {
90352
90381
  linkedStyles.disabled.value = true;
90382
+ linkedStyles.label.value = toolbarTexts2.formatText;
90353
90383
  }
90354
90384
  });
90355
90385
  const renderIcon = (value, selectedValue) => {
@@ -91054,10 +91084,11 @@ class SuperToolbar extends EventEmitter2 {
91054
91084
  item.setDisabled(!canRejectTrackedChanges);
91055
91085
  }
91056
91086
  if (item.name.value === "linkedStyles") {
91087
+ const linkedStyleMark = marks.find((mark) => mark.name === "styleId");
91057
91088
  if (this.activeEditor && !getQuickFormatList(this.activeEditor).length) {
91058
91089
  return item.deactivate();
91059
91090
  } else {
91060
- return item.activate();
91091
+ return item.activate({ linkedStyleMark });
91061
91092
  }
91062
91093
  }
91063
91094
  const rawActiveMark = marks.find((mark) => mark.name === item.name.value);
@@ -92423,7 +92454,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
92423
92454
  }
92424
92455
  });
92425
92456
  function adjustPaginationBreaks(editorElem, editor) {
92426
- if (!editorElem.value || !editor?.value?.options?.scale) return;
92457
+ if (!editorElem.value || !editor?.value?.options?.scale || isHeadless(editor)) return;
92427
92458
  const zoom = editor.value.options.scale;
92428
92459
  const bounds = editorElem.value.getBoundingClientRect();
92429
92460
  const breakNodes = editorElem.value.querySelectorAll(".pagination-break-wrapper");
@@ -92857,6 +92888,7 @@ const _sfc_main$1 = {
92857
92888
  ...props.options
92858
92889
  });
92859
92890
  editor.value.on("paginationUpdate", () => {
92891
+ if (isHeadless(editor.value)) return;
92860
92892
  adjustPaginationBreaks(editorElem, editor);
92861
92893
  });
92862
92894
  editor.value.on("collaborationReady", () => {
@@ -93015,7 +93047,7 @@ const _sfc_main$1 = {
93015
93047
  };
93016
93048
  }
93017
93049
  };
93018
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-9d25f5b3"]]);
93050
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-cd3558fe"]]);
93019
93051
  const _hoisted_1 = ["innerHTML"];
93020
93052
  const _sfc_main = {
93021
93053
  __name: "SuperInput",