@harbour-enterprises/superdoc 0.25.0-next.2 → 0.25.0-next.4

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 (30) hide show
  1. package/dist/chunks/{PdfViewer-CEc5ST9t.cjs → PdfViewer-BETK3Bs4.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-CoEXViCu.es.js → PdfViewer-D4F3H-Ay.es.js} +1 -1
  3. package/dist/chunks/{index-ChgYIPZ8.cjs → index-BHS2aLqo.cjs} +5 -7
  4. package/dist/chunks/{index-DtXgSPMT.es.js → index-D9KYAvvg.es.js} +5 -7
  5. package/dist/chunks/{super-editor.es-B-E_YaLO.cjs → super-editor.es-BJzqCihw.cjs} +126 -125
  6. package/dist/chunks/{super-editor.es-BePxEtE8.es.js → super-editor.es-Beeng5kU.es.js} +126 -125
  7. package/dist/core/types/index.d.ts.map +1 -1
  8. package/dist/style.css +57 -54
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-gSy6s2VK.js → converter-DOkexB95.js} +89 -72
  11. package/dist/super-editor/chunks/{docx-zipper-CceGxV02.js → docx-zipper-Ci5JbfjE.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-yaef8OIs.js → editor-DC9ZOqdt.js} +25 -59
  13. package/dist/super-editor/chunks/{toolbar-Dc5uyyIp.js → toolbar-SPGEoEi0.js} +4 -4
  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 +30 -27
  19. package/dist/super-editor/super-editor/src/components/toolbar/use-toolbar-item.d.ts +1 -1
  20. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/alternate-content-translator.d.ts +11 -0
  21. package/dist/super-editor/super-editor/src/index.d.ts +8 -2
  22. package/dist/super-editor/super-editor.es.js +31 -18
  23. package/dist/super-editor/toolbar.es.js +2 -2
  24. package/dist/super-editor.cjs +1 -1
  25. package/dist/super-editor.es.js +1 -1
  26. package/dist/superdoc.cjs +2 -2
  27. package/dist/superdoc.es.js +2 -2
  28. package/dist/superdoc.umd.js +129 -130
  29. package/dist/superdoc.umd.js.map +1 -1
  30. package/package.json +1 -1
@@ -40057,8 +40057,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40057
40057
  handlerName: "w:bookmarkEndTranslator",
40058
40058
  handler: handleBookmarkEndNode
40059
40059
  };
40060
- const ALTERNATE_CONTENT_NODE = "mc:AlternateContent";
40061
- const SUPPORTED_REQUIRES = /* @__PURE__ */ new Set([
40060
+ const SUPPORTED_ALTERNATE_CONTENT_REQUIRES = /* @__PURE__ */ new Set([
40062
40061
  "wps",
40063
40062
  "wp14",
40064
40063
  "w14",
@@ -40071,22 +40070,85 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40071
40070
  "w16sdtfl",
40072
40071
  "w16se"
40073
40072
  ]);
40073
+ const XML_NODE_NAME$1 = "mc:AlternateContent";
40074
+ const SD_NODE_NAME$1 = [];
40075
+ const validXmlAttributes$1 = [];
40076
+ function encode$1(params2) {
40077
+ const { nodeListHandler } = params2;
40078
+ const { node } = params2.extraParams;
40079
+ if (!node || !node.type) {
40080
+ return null;
40081
+ }
40082
+ const { branch, elements } = selectAlternateContentElements(node);
40083
+ if (!elements) {
40084
+ return null;
40085
+ }
40086
+ return nodeListHandler.handler({
40087
+ ...params2,
40088
+ nodes: elements,
40089
+ path: buildPath(params2.path, node, branch)
40090
+ });
40091
+ }
40092
+ function decode$1(params2) {
40093
+ const { node } = params2;
40094
+ const { drawingContent } = node.attrs;
40095
+ const drawing = {
40096
+ name: "w:drawing",
40097
+ elements: [...drawingContent ? [...drawingContent.elements || []] : []]
40098
+ };
40099
+ const choice = {
40100
+ name: "mc:Choice",
40101
+ attributes: { Requires: "wps" },
40102
+ elements: [drawing]
40103
+ };
40104
+ return {
40105
+ name: "mc:AlternateContent",
40106
+ elements: [choice]
40107
+ };
40108
+ }
40109
+ const config$1 = {
40110
+ xmlName: XML_NODE_NAME$1,
40111
+ sdNodeOrKeyName: SD_NODE_NAME$1,
40112
+ type: NodeTranslator.translatorTypes.NODE,
40113
+ encode: encode$1,
40114
+ decode: decode$1,
40115
+ attributes: validXmlAttributes$1
40116
+ };
40117
+ function selectAlternateContentElements(node) {
40118
+ if (!node?.elements?.length) {
40119
+ return { branch: null, elements: null };
40120
+ }
40121
+ const choices = node.elements.filter((el) => el?.name === "mc:Choice");
40122
+ const fallback = node.elements.find((el) => el?.name === "mc:Fallback");
40123
+ const supportedChoice = choices.find((choice) => {
40124
+ const requiresAttr = choice?.attributes?.Requires || choice?.attributes?.requires;
40125
+ if (!requiresAttr) return false;
40126
+ return requiresAttr.split(/\s+/).filter(Boolean).some((namespace2) => SUPPORTED_ALTERNATE_CONTENT_REQUIRES.has(namespace2));
40127
+ });
40128
+ const branch = supportedChoice || fallback || choices[0] || null;
40129
+ const selectedElements = branch?.elements;
40130
+ if (!selectedElements) {
40131
+ return { branch, elements: null };
40132
+ }
40133
+ return {
40134
+ branch,
40135
+ elements: carbonCopy(selectedElements)
40136
+ };
40137
+ }
40138
+ const translator$1 = NodeTranslator.from(config$1);
40139
+ function buildPath(existingPath = [], node, branch) {
40140
+ const path = [...existingPath];
40141
+ if (node) path.push(node);
40142
+ if (branch) path.push(branch);
40143
+ return path;
40144
+ }
40145
+ const ALTERNATE_CONTENT_NODE = "mc:AlternateContent";
40074
40146
  const skipHandlerResponse = { nodes: [], consumed: 0 };
40075
40147
  const isAlternateContentNode = (node) => node?.name === ALTERNATE_CONTENT_NODE;
40076
- const isSupportedChoice = (choice) => {
40077
- if (!choice?.attributes) return false;
40078
- const requires = choice.attributes.Requires || choice.attributes.requires;
40079
- if (!requires) return false;
40080
- return requires.split(/\s+/).filter(Boolean).some((namespace2) => SUPPORTED_REQUIRES.has(namespace2));
40081
- };
40082
40148
  const resolveAlternateContentElements = (alternateContent) => {
40083
- if (!alternateContent?.elements?.length) return null;
40084
- const choices = alternateContent.elements.filter((el) => el.name === "mc:Choice");
40085
- const fallback = alternateContent.elements.find((el) => el.name === "mc:Fallback");
40086
- const supportedChoice = choices.find(isSupportedChoice);
40087
- const selectedElements = supportedChoice?.elements || fallback?.elements || choices[0]?.elements;
40088
- if (!selectedElements) return null;
40089
- return carbonCopy(selectedElements);
40149
+ const { elements } = selectAlternateContentElements(alternateContent);
40150
+ if (!elements) return null;
40151
+ return elements;
40090
40152
  };
40091
40153
  const buildNodeWithoutAlternateContent = (node) => {
40092
40154
  const { elements } = node || {};
@@ -40118,16 +40180,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40118
40180
  }
40119
40181
  const [currentNode] = nodes;
40120
40182
  if (isAlternateContentNode(currentNode)) {
40121
- const resolvedElements = resolveAlternateContentElements(currentNode);
40122
- if (!resolvedElements) {
40123
- return skipHandlerResponse;
40124
- }
40125
- const result2 = nodeListHandler.handler({
40183
+ const nodeForTranslator = currentNode?.type ? currentNode : {
40184
+ ...currentNode,
40185
+ type: "element"
40186
+ };
40187
+ const translated = translator$1.encode({
40126
40188
  ...params2,
40127
- nodes: resolvedElements,
40128
- path: [...params2.path || [], currentNode]
40189
+ nodes: [nodeForTranslator],
40190
+ extraParams: { ...params2.extraParams || {}, node: nodeForTranslator }
40129
40191
  });
40130
- return { nodes: result2, consumed: 1 };
40192
+ if (!translated) {
40193
+ return skipHandlerResponse;
40194
+ }
40195
+ const nodesArray = Array.isArray(translated) ? translated : [translated];
40196
+ return { nodes: nodesArray, consumed: 1 };
40131
40197
  }
40132
40198
  const sanitizedNode = buildNodeWithoutAlternateContent(currentNode);
40133
40199
  if (!sanitizedNode) {
@@ -41398,55 +41464,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41398
41464
  };
41399
41465
  return textbox;
41400
41466
  }
41401
- const XML_NODE_NAME$1 = "mc:AlternateContent";
41402
- const SD_NODE_NAME$1 = [];
41403
- const validXmlAttributes$1 = [];
41404
- function encode$1(params2) {
41405
- const { nodeListHandler } = params2;
41406
- const { node } = params2.extraParams;
41407
- if (!node || !node.type) {
41408
- return null;
41409
- }
41410
- const allowedNamespaces = ["wps", "wp14", "w14", "w15"];
41411
- const wpsNode = node.elements.find(
41412
- (el) => el.name === "mc:Choice" && allowedNamespaces.includes(el.attributes["Requires"])
41413
- );
41414
- if (!wpsNode) {
41415
- return null;
41416
- }
41417
- const contents = wpsNode.elements;
41418
- return nodeListHandler.handler({
41419
- ...params2,
41420
- nodes: contents,
41421
- path: [...params2.path || [], wpsNode]
41422
- });
41423
- }
41424
- function decode$1(params2) {
41425
- const { node } = params2;
41426
- const { drawingContent } = node.attrs;
41427
- const drawing = {
41428
- name: "w:drawing",
41429
- elements: [...drawingContent ? [...drawingContent.elements || []] : []]
41430
- };
41431
- const choice = {
41432
- name: "mc:Choice",
41433
- attributes: { Requires: "wps" },
41434
- elements: [drawing]
41435
- };
41436
- return {
41437
- name: "mc:AlternateContent",
41438
- elements: [choice]
41439
- };
41440
- }
41441
- const config$1 = {
41442
- xmlName: XML_NODE_NAME$1,
41443
- sdNodeOrKeyName: SD_NODE_NAME$1,
41444
- type: NodeTranslator.translatorTypes.NODE,
41445
- encode: encode$1,
41446
- decode: decode$1,
41447
- attributes: validXmlAttributes$1
41448
- };
41449
- const translator$1 = NodeTranslator.from(config$1);
41450
41467
  function translateContentBlock(params2) {
41451
41468
  const { node } = params2;
41452
41469
  const { vmlAttributes, horizontalRule } = node.attrs;
@@ -46050,7 +46067,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
46050
46067
  var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
46051
46068
  var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
46052
46069
  var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
46053
- var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFontsWithLocalFonts_fn, determineUnsupportedFontsWithCanvas_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ListItemNodeView_instances, init_fn3, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
46070
+ var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ListItemNodeView_instances, init_fn3, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
46054
46071
  var GOOD_LEAF_SIZE = 200;
46055
46072
  var RopeSequence = function RopeSequence2() {
46056
46073
  };
@@ -61233,9 +61250,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61233
61250
  this.emit("beforeCreate", { editor: this });
61234
61251
  this.on("contentError", this.options.onContentError);
61235
61252
  this.mount(this.options.element);
61236
- if (!this.options.isHeadless) {
61237
- __privateMethod$1(this, _Editor_instances, checkFonts_fn).call(this);
61238
- }
61239
61253
  this.on("create", this.options.onCreate);
61240
61254
  this.on("update", this.options.onUpdate);
61241
61255
  this.on("selectionUpdate", this.options.onSelectionUpdate);
@@ -61252,12 +61266,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61252
61266
  this.on("paginationUpdate", this.options.onPaginationUpdate);
61253
61267
  this.on("comment-positions", this.options.onCommentLocationsUpdate);
61254
61268
  this.on("list-definitions-change", this.options.onListDefinitionsChange);
61269
+ this.on("fonts-resolved", this.options.onFontsResolved);
61255
61270
  this.on("exception", this.options.onException);
61256
61271
  if (!this.options.isHeadless) {
61257
61272
  this.initializeCollaborationData();
61258
61273
  this.initDefaultStyles();
61274
+ __privateMethod$1(this, _Editor_instances, checkFonts_fn).call(this);
61259
61275
  }
61260
- if (!this.options.ydoc || this.options.markdown || this.options.html) {
61276
+ const shouldMigrateListsOnInit = Boolean(
61277
+ this.options.markdown || this.options.html || this.options.loadFromSchema || this.options.jsonOverride || this.options.mode === "html" || this.options.mode === "text"
61278
+ );
61279
+ if (shouldMigrateListsOnInit) {
61261
61280
  this.migrateListsToV2();
61262
61281
  }
61263
61282
  this.setDocumentMode(this.options.documentMode);
@@ -61398,52 +61417,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61398
61417
  if (this.options.isHeadless) {
61399
61418
  return;
61400
61419
  }
61401
- const fontsUsedInDocument = this.converter.getDocumentFonts();
61402
- if (!("queryLocalFonts" in window)) {
61403
- console.warn("[SuperDoc] Could not get access to local fonts. Using fallback solution.");
61404
- const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithCanvas_fn).call(this, fontsUsedInDocument);
61405
- this.options.onFontsResolved({
61406
- documentFonts: fontsUsedInDocument,
61407
- unsupportedFonts
61408
- });
61409
- return;
61410
- }
61411
- const localFontAccess = await navigator.permissions.query({ name: "local-fonts" });
61412
- if (localFontAccess.state === "denied") {
61413
- console.warn("[SuperDoc] Could not get access to local fonts. Using fallback solution.");
61414
- const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithCanvas_fn).call(this, fontsUsedInDocument);
61415
- this.options.onFontsResolved({
61416
- documentFonts: fontsUsedInDocument,
61417
- unsupportedFonts
61418
- });
61419
- return;
61420
- }
61421
61420
  try {
61422
- const localFonts = await window.queryLocalFonts();
61423
- const uniqueLocalFonts = [...new Set(localFonts.map((font) => font.family))];
61424
- const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithLocalFonts_fn).call(this, fontsUsedInDocument, uniqueLocalFonts);
61425
- this.options.onFontsResolved({
61421
+ const fontsUsedInDocument = this.converter.getDocumentFonts();
61422
+ const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFonts_fn).call(this, fontsUsedInDocument);
61423
+ this.emit("fonts-resolved", {
61426
61424
  documentFonts: fontsUsedInDocument,
61427
61425
  unsupportedFonts
61428
61426
  });
61429
61427
  } catch {
61430
- console.warn("[SuperDoc] Could not get access to local fonts. Using fallback solution.");
61431
- const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithCanvas_fn).call(this, fontsUsedInDocument);
61432
- this.options.onFontsResolved({
61433
- documentFonts: fontsUsedInDocument,
61434
- unsupportedFonts
61435
- });
61428
+ console.warn("[SuperDoc] Could not determine document fonts and unsupported fonts");
61436
61429
  }
61437
61430
  };
61438
- determineUnsupportedFontsWithLocalFonts_fn = function(fonts, localFonts) {
61439
- const unsupportedFonts = fonts.filter((font) => {
61440
- const isLocalFont = localFonts.includes(font);
61441
- const isFontImported = this.fontsImported.includes(font);
61442
- return !isLocalFont && !isFontImported;
61443
- });
61444
- return unsupportedFonts;
61445
- };
61446
- determineUnsupportedFontsWithCanvas_fn = function(fonts) {
61431
+ determineUnsupportedFonts_fn = function(fonts) {
61447
61432
  const unsupportedFonts = fonts.filter((font) => {
61448
61433
  const canRender = canRenderFont(font);
61449
61434
  const isFontImported = this.fontsImported.includes(font);
@@ -61531,6 +61516,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61531
61516
  if (this.options.collaborationIsReady) return;
61532
61517
  console.debug("🔗 [super-editor] Collaboration ready");
61533
61518
  __privateMethod$1(this, _Editor_instances, validateDocumentInit_fn).call(this);
61519
+ if (this.options.ydoc) {
61520
+ this.migrateListsToV2();
61521
+ }
61534
61522
  this.options.onCollaborationReady({ editor, ydoc });
61535
61523
  this.options.collaborationIsReady = true;
61536
61524
  this.options.initialState = this.state;
@@ -81218,7 +81206,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
81218
81206
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inlineTextInput.value = $event),
81219
81207
  onKeydown: withKeys(withModifiers(handleInputSubmit, ["prevent"]), ["enter"]),
81220
81208
  type: "text",
81221
- class: normalizeClass(["button-text-input", { "high-contrast": unref(isHighContrastMode2) }]),
81209
+ class: normalizeClass(["button-text-input button-text-input--font-size", { "high-contrast": unref(isHighContrastMode2) }]),
81222
81210
  id: "inlineTextInput-" + unref(name),
81223
81211
  autocomplete: "off",
81224
81212
  ref_key: "inlineInput",
@@ -81252,7 +81240,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
81252
81240
  };
81253
81241
  }
81254
81242
  };
81255
- const ToolbarButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$4$2, [["__scopeId", "data-v-cea02a58"]]);
81243
+ const ToolbarButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$4$2, [["__scopeId", "data-v-ea93b080"]]);
81256
81244
  const _hoisted_1$2$2 = {
81257
81245
  class: "toolbar-separator",
81258
81246
  role: "separator",
@@ -91803,8 +91791,8 @@ ${style2}
91803
91791
  if (!Array.isArray(options.options)) throw new Error("Invalid toolbar item options - " + options.options);
91804
91792
  nestedOptions.value?.push(...options.options);
91805
91793
  }
91806
- const activate = (attrs) => {
91807
- onActivate(attrs);
91794
+ const activate = (attrs, ...args) => {
91795
+ onActivate(attrs, ...args);
91808
91796
  if (suppressActiveHighlight.value) return;
91809
91797
  active.value = true;
91810
91798
  };
@@ -93105,7 +93093,12 @@ ${style2}
93105
93093
  ariaLabel: "Font size"
93106
93094
  },
93107
93095
  options: fontSizeOptions,
93108
- onActivate: ({ fontSize: size2 }) => {
93096
+ onActivate: ({ fontSize: size2 }, isMultiple = false) => {
93097
+ if (isMultiple) {
93098
+ fontSize2.label.value = "";
93099
+ fontSize2.selectedValue.value = "";
93100
+ return;
93101
+ }
93109
93102
  const defaultSize = fontSizeOptions.find((i2) => i2.label === String(fontSize2.defaultLabel.value));
93110
93103
  if (!size2) {
93111
93104
  fontSize2.label.value = fontSize2.defaultLabel.value;
@@ -93122,8 +93115,6 @@ ${style2}
93122
93115
  });
93123
93116
  if (foundSize) {
93124
93117
  fontSize2.selectedValue.value = foundSize.key;
93125
- } else if (defaultSize) {
93126
- fontSize2.selectedValue.value = defaultSize.key;
93127
93118
  } else {
93128
93119
  fontSize2.selectedValue.value = "";
93129
93120
  }
@@ -94574,7 +94565,13 @@ ${style2}
94574
94565
  const markNegated = rawActiveMark ? isNegatedMark(rawActiveMark.name, rawActiveMark.attrs) : false;
94575
94566
  const activeMark = markNegated ? null : rawActiveMark;
94576
94567
  if (activeMark) {
94577
- item.activate(activeMark.attrs);
94568
+ if (activeMark.name === "fontSize") {
94569
+ const fontSizes = marks.filter((i2) => i2.name === "fontSize").map((i2) => i2.attrs.fontSize);
94570
+ const isMultiple = [...new Set(fontSizes)].length > 1;
94571
+ item.activate(activeMark.attrs, isMultiple);
94572
+ } else {
94573
+ item.activate(activeMark.attrs);
94574
+ }
94578
94575
  } else {
94579
94576
  item.deactivate();
94580
94577
  }
@@ -96679,8 +96676,12 @@ ${style2}
96679
96676
  Node: Node$1,
96680
96677
  Attribute,
96681
96678
  Extension,
96679
+ Mark,
96680
+ //
96682
96681
  Plugin,
96683
- Mark
96682
+ PluginKey,
96683
+ Decoration,
96684
+ DecorationSet
96684
96685
  };
96685
96686
  const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
96686
96687
  const PDF = "application/pdf";
@@ -113263,10 +113264,8 @@ ${style2}
113263
113264
  const onEditorListdefinitionsChange = (params2) => {
113264
113265
  proxy.$superdoc.emit("list-definitions-change", params2);
113265
113266
  };
113266
- const onFontsResolved = (params2) => {
113267
- proxy.$superdoc.emit("fonts-resolved", params2);
113268
- };
113269
113267
  const editorOptions = (doc2) => {
113268
+ const onFontsResolvedFn = proxy.$superdoc.listeners?.("fonts-resolved")?.length > 0 ? proxy.$superdoc.listeners("fonts-resolved")[0] : null;
113270
113269
  const options = {
113271
113270
  isDebug: proxy.$superdoc.config.isDebug || false,
113272
113271
  pagination: proxy.$superdoc.config.pagination,
@@ -113298,7 +113297,7 @@ ${style2}
113298
113297
  onCommentsUpdate: onEditorCommentsUpdate,
113299
113298
  onCommentLocationsUpdate: onEditorCommentLocationsUpdate,
113300
113299
  onListDefinitionsChange: onEditorListdefinitionsChange,
113301
- onFontsResolved: proxy?.$superdoc?.config?.onFontsResolved ? onFontsResolved : null,
113300
+ onFontsResolved: onFontsResolvedFn,
113302
113301
  onTransaction: onEditorTransaction,
113303
113302
  ydoc: doc2.ydoc,
113304
113303
  collaborationProvider: doc2.provider || null,
@@ -113682,7 +113681,7 @@ ${style2}
113682
113681
  };
113683
113682
  }
113684
113683
  };
113685
- const App = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ac4ea6eb"]]);
113684
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-715d68b1"]]);
113686
113685
  const createSuperdocVueApp = () => {
113687
113686
  const app = createApp(App);
113688
113687
  const pinia = createPinia();