@harbour-enterprises/superdoc 0.25.0-next.1 → 0.25.0-next.3

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.
@@ -1,4 +1,4 @@
1
- import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es--RpCOiR4.es.js";
1
+ import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-CYtLh0Ob.es.js";
2
2
  import "./chunks/vue-ZWZLQtoU.es.js";
3
3
  export {
4
4
  A as AIWriter,
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-Bh07I_ue.cjs");
4
- const superdoc = require("./chunks/index-Bf3lSVG2.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-Ct2sXbNV.cjs");
4
+ const superdoc = require("./chunks/index-Bo5YCvD5.cjs");
5
5
  require("./chunks/vue-DKMj1I9B.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
7
7
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es--RpCOiR4.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-B9Ad3j3k.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-CYtLh0Ob.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-DKNVSdr6.es.js";
3
3
  import "./chunks/vue-ZWZLQtoU.es.js";
4
4
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
5
5
  export {
@@ -57052,7 +57052,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
57052
57052
  });
57053
57053
  return insertionMark;
57054
57054
  };
57055
- const markDeletion = ({ tr, from: from2, to, user, date }) => {
57055
+ const markDeletion = ({ tr, from: from2, to, user, date, id: providedId }) => {
57056
57056
  let trackedMark = findTrackedMarkBetween({
57057
57057
  tr,
57058
57058
  from: from2,
@@ -57061,7 +57061,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
57061
57061
  attrs: { authorEmail: user.email }
57062
57062
  });
57063
57063
  let id;
57064
- if (trackedMark) {
57064
+ if (providedId) {
57065
+ id = providedId;
57066
+ } else if (trackedMark) {
57065
57067
  id = trackedMark.mark.attrs.id;
57066
57068
  } else {
57067
57069
  id = v4$1();
@@ -58333,7 +58335,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
58333
58335
  from: step.from,
58334
58336
  to: step.to,
58335
58337
  user,
58336
- date
58338
+ date,
58339
+ id: meta.insertedMark?.attrs?.id
58337
58340
  });
58338
58341
  meta.deletionNodes = deletionNodes;
58339
58342
  meta.deletionMark = deletionMark2;
@@ -61249,6 +61252,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61249
61252
  this.on("paginationUpdate", this.options.onPaginationUpdate);
61250
61253
  this.on("comment-positions", this.options.onCommentLocationsUpdate);
61251
61254
  this.on("list-definitions-change", this.options.onListDefinitionsChange);
61255
+ this.on("fonts-resolved", this.options.onFontsResolved);
61252
61256
  this.on("exception", this.options.onException);
61253
61257
  if (!this.options.isHeadless) {
61254
61258
  this.initializeCollaborationData();
@@ -61399,7 +61403,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61399
61403
  if (!("queryLocalFonts" in window)) {
61400
61404
  console.warn("[SuperDoc] Could not get access to local fonts. Using fallback solution.");
61401
61405
  const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithCanvas_fn).call(this, fontsUsedInDocument);
61402
- this.options.onFontsResolved({
61406
+ this.emit("fonts-resolved", {
61403
61407
  documentFonts: fontsUsedInDocument,
61404
61408
  unsupportedFonts
61405
61409
  });
@@ -61409,7 +61413,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61409
61413
  if (localFontAccess.state === "denied") {
61410
61414
  console.warn("[SuperDoc] Could not get access to local fonts. Using fallback solution.");
61411
61415
  const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithCanvas_fn).call(this, fontsUsedInDocument);
61412
- this.options.onFontsResolved({
61416
+ this.emit("fonts-resolved", {
61413
61417
  documentFonts: fontsUsedInDocument,
61414
61418
  unsupportedFonts
61415
61419
  });
@@ -61419,14 +61423,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61419
61423
  const localFonts = await window.queryLocalFonts();
61420
61424
  const uniqueLocalFonts = [...new Set(localFonts.map((font) => font.family))];
61421
61425
  const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithLocalFonts_fn).call(this, fontsUsedInDocument, uniqueLocalFonts);
61422
- this.options.onFontsResolved({
61426
+ this.emit("fonts-resolved", {
61423
61427
  documentFonts: fontsUsedInDocument,
61424
61428
  unsupportedFonts
61425
61429
  });
61426
61430
  } catch {
61427
61431
  console.warn("[SuperDoc] Could not get access to local fonts. Using fallback solution.");
61428
61432
  const unsupportedFonts = __privateMethod$1(this, _Editor_instances, determineUnsupportedFontsWithCanvas_fn).call(this, fontsUsedInDocument);
61429
- this.options.onFontsResolved({
61433
+ this.emit("fonts-resolved", {
61430
61434
  documentFonts: fontsUsedInDocument,
61431
61435
  unsupportedFonts
61432
61436
  });
@@ -81215,7 +81219,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
81215
81219
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inlineTextInput.value = $event),
81216
81220
  onKeydown: withKeys(withModifiers(handleInputSubmit, ["prevent"]), ["enter"]),
81217
81221
  type: "text",
81218
- class: normalizeClass(["button-text-input", { "high-contrast": unref(isHighContrastMode2) }]),
81222
+ class: normalizeClass(["button-text-input button-text-input--font-size", { "high-contrast": unref(isHighContrastMode2) }]),
81219
81223
  id: "inlineTextInput-" + unref(name),
81220
81224
  autocomplete: "off",
81221
81225
  ref_key: "inlineInput",
@@ -81249,7 +81253,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
81249
81253
  };
81250
81254
  }
81251
81255
  };
81252
- const ToolbarButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$4$2, [["__scopeId", "data-v-cea02a58"]]);
81256
+ const ToolbarButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$4$2, [["__scopeId", "data-v-ea93b080"]]);
81253
81257
  const _hoisted_1$2$2 = {
81254
81258
  class: "toolbar-separator",
81255
81259
  role: "separator",
@@ -91800,8 +91804,8 @@ ${style2}
91800
91804
  if (!Array.isArray(options.options)) throw new Error("Invalid toolbar item options - " + options.options);
91801
91805
  nestedOptions.value?.push(...options.options);
91802
91806
  }
91803
- const activate = (attrs) => {
91804
- onActivate(attrs);
91807
+ const activate = (attrs, ...args) => {
91808
+ onActivate(attrs, ...args);
91805
91809
  if (suppressActiveHighlight.value) return;
91806
91810
  active.value = true;
91807
91811
  };
@@ -93102,7 +93106,12 @@ ${style2}
93102
93106
  ariaLabel: "Font size"
93103
93107
  },
93104
93108
  options: fontSizeOptions,
93105
- onActivate: ({ fontSize: size2 }) => {
93109
+ onActivate: ({ fontSize: size2 }, isMultiple = false) => {
93110
+ if (isMultiple) {
93111
+ fontSize2.label.value = "";
93112
+ fontSize2.selectedValue.value = "";
93113
+ return;
93114
+ }
93106
93115
  const defaultSize = fontSizeOptions.find((i2) => i2.label === String(fontSize2.defaultLabel.value));
93107
93116
  if (!size2) {
93108
93117
  fontSize2.label.value = fontSize2.defaultLabel.value;
@@ -93119,8 +93128,6 @@ ${style2}
93119
93128
  });
93120
93129
  if (foundSize) {
93121
93130
  fontSize2.selectedValue.value = foundSize.key;
93122
- } else if (defaultSize) {
93123
- fontSize2.selectedValue.value = defaultSize.key;
93124
93131
  } else {
93125
93132
  fontSize2.selectedValue.value = "";
93126
93133
  }
@@ -94571,7 +94578,13 @@ ${style2}
94571
94578
  const markNegated = rawActiveMark ? isNegatedMark(rawActiveMark.name, rawActiveMark.attrs) : false;
94572
94579
  const activeMark = markNegated ? null : rawActiveMark;
94573
94580
  if (activeMark) {
94574
- item.activate(activeMark.attrs);
94581
+ if (activeMark.name === "fontSize") {
94582
+ const fontSizes = marks.filter((i2) => i2.name === "fontSize").map((i2) => i2.attrs.fontSize);
94583
+ const isMultiple = [...new Set(fontSizes)].length > 1;
94584
+ item.activate(activeMark.attrs, isMultiple);
94585
+ } else {
94586
+ item.activate(activeMark.attrs);
94587
+ }
94575
94588
  } else {
94576
94589
  item.deactivate();
94577
94590
  }
@@ -113260,10 +113273,8 @@ ${style2}
113260
113273
  const onEditorListdefinitionsChange = (params2) => {
113261
113274
  proxy.$superdoc.emit("list-definitions-change", params2);
113262
113275
  };
113263
- const onFontsResolved = (params2) => {
113264
- proxy.$superdoc.emit("fonts-resolved", params2);
113265
- };
113266
113276
  const editorOptions = (doc2) => {
113277
+ const onFontsResolvedFn = proxy.$superdoc.listeners?.("fonts-resolved")?.length > 0 ? proxy.$superdoc.listeners("fonts-resolved")[0] : null;
113267
113278
  const options = {
113268
113279
  isDebug: proxy.$superdoc.config.isDebug || false,
113269
113280
  pagination: proxy.$superdoc.config.pagination,
@@ -113295,7 +113306,7 @@ ${style2}
113295
113306
  onCommentsUpdate: onEditorCommentsUpdate,
113296
113307
  onCommentLocationsUpdate: onEditorCommentLocationsUpdate,
113297
113308
  onListDefinitionsChange: onEditorListdefinitionsChange,
113298
- onFontsResolved: proxy?.$superdoc?.config?.onFontsResolved ? onFontsResolved : null,
113309
+ onFontsResolved: onFontsResolvedFn,
113299
113310
  onTransaction: onEditorTransaction,
113300
113311
  ydoc: doc2.ydoc,
113301
113312
  collaborationProvider: doc2.provider || null,
@@ -113679,7 +113690,7 @@ ${style2}
113679
113690
  };
113680
113691
  }
113681
113692
  };
113682
- const App = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ac4ea6eb"]]);
113693
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-715d68b1"]]);
113683
113694
  const createSuperdocVueApp = () => {
113684
113695
  const app = createApp(App);
113685
113696
  const pinia = createPinia();