@harbour-enterprises/superdoc 1.3.1-next.3 → 1.4.0-next.1

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 (58) hide show
  1. package/dist/chunks/{PdfViewer-CPnVLLJm.es.js → PdfViewer-DRTk3dY6.es.js} +2 -2
  2. package/dist/chunks/{PdfViewer-BXbmY3Fc.cjs → PdfViewer-H9_8IbtN.cjs} +2 -2
  3. package/dist/chunks/{SuperConverter-BQ6PNaJ8.es.js → SuperConverter-CFRB4XNw.es.js} +1 -1
  4. package/dist/chunks/{SuperConverter-p1tQGIew.cjs → SuperConverter-CgY28MJz.cjs} +1 -1
  5. package/dist/chunks/{index-DXSUcHli.es.js → index-BP9aFfwI.es.js} +109 -17
  6. package/dist/chunks/{index-BQYtE-5U.cjs → index-BdaseaBw.cjs} +109 -17
  7. package/dist/chunks/{index-DLX_v-vr.cjs → index-C3KRKogJ.cjs} +52 -10
  8. package/dist/chunks/{index-CJec1cbb.es.js → index-CEcYlysg.es.js} +52 -10
  9. package/dist/style.css +32 -32
  10. package/dist/super-editor/converter.cjs +1 -1
  11. package/dist/super-editor/converter.es.js +1 -1
  12. package/dist/super-editor.cjs +2 -2
  13. package/dist/super-editor.es.js +3 -3
  14. package/dist/superdoc/src/components/CommentsLayer/types.d.ts +3 -157
  15. package/dist/superdoc/src/components/CommentsLayer/types.d.ts.map +1 -1
  16. package/dist/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  17. package/dist/superdoc/src/core/types/index.d.ts +12 -0
  18. package/dist/superdoc/src/core/types/index.d.ts.map +1 -1
  19. package/dist/superdoc/src/stores/comments-store.d.ts +4 -1
  20. package/dist/superdoc/src/stores/comments-store.d.ts.map +1 -1
  21. package/dist/superdoc/src/stores/superdoc-store.d.ts +12 -3
  22. package/dist/superdoc/src/stores/superdoc-store.d.ts.map +1 -1
  23. package/dist/superdoc.cjs +3 -3
  24. package/dist/superdoc.es.js +3 -3
  25. package/dist/superdoc.umd.js +158 -24
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +3 -3
  28. package/dist/super-editor/src/core/Extension.d.ts +0 -33
  29. package/dist/super-editor/src/core/Extension.d.ts.map +0 -1
  30. package/dist/super-editor/src/core/helpers/getExtensionConfigField.d.ts +0 -35
  31. package/dist/super-editor/src/core/helpers/getExtensionConfigField.d.ts.map +0 -1
  32. package/dist/super-editor/src/core/utilities/callOrGet.d.ts +0 -13
  33. package/dist/super-editor/src/core/utilities/callOrGet.d.ts.map +0 -1
  34. package/dist/super-editor/src/extensions/comment/comments-constants.d.ts +0 -2
  35. package/dist/super-editor/src/extensions/comment/comments-constants.d.ts.map +0 -1
  36. package/dist/super-editor/src/extensions/comment/comments-plugin.d.ts +0 -1
  37. package/dist/superdoc/src/SuperDoc.test.d.ts +0 -2
  38. package/dist/superdoc/src/SuperDoc.test.d.ts.map +0 -1
  39. package/dist/superdoc/src/components/CommentsLayer/CommentDialog.test.d.ts +0 -2
  40. package/dist/superdoc/src/components/CommentsLayer/CommentDialog.test.d.ts.map +0 -1
  41. package/dist/superdoc/src/components/CommentsLayer/use-comment.test.d.ts +0 -2
  42. package/dist/superdoc/src/components/CommentsLayer/use-comment.test.d.ts.map +0 -1
  43. package/dist/superdoc/src/core/SuperDoc.test.d.ts +0 -2
  44. package/dist/superdoc/src/core/SuperDoc.test.d.ts.map +0 -1
  45. package/dist/superdoc/src/core/collaboration/collaboration.test.d.ts +0 -2
  46. package/dist/superdoc/src/core/collaboration/collaboration.test.d.ts.map +0 -1
  47. package/dist/superdoc/src/core/helpers/export.test.d.ts +0 -2
  48. package/dist/superdoc/src/core/helpers/export.test.d.ts.map +0 -1
  49. package/dist/superdoc/src/core/helpers/file.test.d.ts +0 -2
  50. package/dist/superdoc/src/core/helpers/file.test.d.ts.map +0 -1
  51. package/dist/superdoc/src/stores/comments-store.test.d.ts +0 -2
  52. package/dist/superdoc/src/stores/comments-store.test.d.ts.map +0 -1
  53. package/dist/superdoc/src/stores/hrbr-fields-store.test.d.ts +0 -2
  54. package/dist/superdoc/src/stores/hrbr-fields-store.test.d.ts.map +0 -1
  55. package/dist/superdoc/src/stores/superdoc-store.test.d.ts +0 -2
  56. package/dist/superdoc/src/stores/superdoc-store.test.d.ts.map +0 -1
  57. package/dist/superdoc/src/tests/helpers/group-changes.test.d.ts +0 -2
  58. package/dist/superdoc/src/tests/helpers/group-changes.test.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const jszip = require("./jszip-C8_CqJxM.cjs");
3
3
  const helpers$1 = require("./helpers-nOdwpmwb.cjs");
4
- const superEditor_converter = require("./SuperConverter-p1tQGIew.cjs");
4
+ const superEditor_converter = require("./SuperConverter-CgY28MJz.cjs");
5
5
  const vue = require("./vue-De9wkgLl.cjs");
6
6
  require("./jszip.min-BPh2MMAa.cjs");
7
7
  const eventemitter3 = require("./eventemitter3-BQuRcMPI.cjs");
@@ -15457,7 +15457,7 @@ const canUseDOM = () => {
15457
15457
  return false;
15458
15458
  }
15459
15459
  };
15460
- const summaryVersion = "1.3.1-next.3";
15460
+ const summaryVersion = "1.4.0-next.1";
15461
15461
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
15462
15462
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
15463
15463
  function mapAttributes(attrs) {
@@ -18089,7 +18089,7 @@ class Editor extends EventEmitter {
18089
18089
  * Process collaboration migrations
18090
18090
  */
18091
18091
  processCollaborationMigrations() {
18092
- console.debug("[checkVersionMigrations] Current editor version", "1.3.1-next.3");
18092
+ console.debug("[checkVersionMigrations] Current editor version", "1.4.0-next.1");
18093
18093
  if (!this.options.ydoc) return;
18094
18094
  const metaMap = this.options.ydoc.getMap("meta");
18095
18095
  let docVersion = metaMap.get("version");
@@ -41868,7 +41868,13 @@ const spacingPxToPt = (spacing) => {
41868
41868
  const result = {};
41869
41869
  if (spacing.before != null) result.before = pxToPt(spacing.before);
41870
41870
  if (spacing.after != null) result.after = pxToPt(spacing.after);
41871
- if (spacing.line != null) result.line = pxToPt(spacing.line);
41871
+ if (spacing.line != null) {
41872
+ if (spacing.lineRule === "auto" && spacing.line > 0 && spacing.line <= MAX_AUTO_LINE_MULTIPLIER) {
41873
+ result.line = spacing.line;
41874
+ } else {
41875
+ result.line = pxToPt(spacing.line);
41876
+ }
41877
+ }
41872
41878
  if (spacing.lineRule) result.lineRule = spacing.lineRule;
41873
41879
  return result;
41874
41880
  };
@@ -41892,8 +41898,13 @@ const spacingPtToPx = (spacing, rawSpacing) => {
41892
41898
  if (after != null) result.after = after;
41893
41899
  }
41894
41900
  if (rawSpacing.line != null) {
41895
- const line = ptToPx(spacing.line);
41896
- if (line != null) result.line = line;
41901
+ const isAutoMultiplier = spacing.lineRule === "auto" && spacing.line != null && spacing.line > 0 && spacing.line <= MAX_AUTO_LINE_MULTIPLIER;
41902
+ if (isAutoMultiplier) {
41903
+ result.line = spacing.line;
41904
+ } else {
41905
+ const line = ptToPx(spacing.line);
41906
+ if (line != null) result.line = line;
41907
+ }
41897
41908
  if (spacing.lineRule) result.lineRule = spacing.lineRule;
41898
41909
  }
41899
41910
  }
@@ -41973,7 +41984,7 @@ const normalizeLineValue = (value, lineRule) => {
41973
41984
  if (value > 0 && value <= MAX_AUTO_LINE_MULTIPLIER) {
41974
41985
  return value;
41975
41986
  }
41976
- return twipsToPx$1(value);
41987
+ return value / 240;
41977
41988
  }
41978
41989
  return twipsToPx$1(value);
41979
41990
  };
@@ -50114,7 +50125,8 @@ const resolveLineHeight = (spacing, baseLineHeight) => {
50114
50125
  return baseLineHeight;
50115
50126
  }
50116
50127
  const raw = spacing.line;
50117
- const treatAsMultiplier = (spacing.lineRule === "auto" || spacing.lineRule == null) && raw > 0 && raw <= 10;
50128
+ const isAuto = spacing.lineRule === "auto";
50129
+ const treatAsMultiplier = (isAuto || spacing.lineRule == null) && raw > 0 && (isAuto || raw <= 10);
50118
50130
  if (treatAsMultiplier) {
50119
50131
  return raw * baseLineHeight;
50120
50132
  }
@@ -50461,6 +50473,8 @@ class PresentationEditor extends EventEmitter {
50461
50473
  debugLabel: options.layoutEngineOptions?.debugLabel,
50462
50474
  layoutMode: options.layoutEngineOptions?.layoutMode ?? "vertical",
50463
50475
  trackedChanges: options.layoutEngineOptions?.trackedChanges,
50476
+ emitCommentPositionsInViewing: options.layoutEngineOptions?.emitCommentPositionsInViewing,
50477
+ enableCommentsInViewing: options.layoutEngineOptions?.enableCommentsInViewing,
50464
50478
  presence: validatedPresence
50465
50479
  };
50466
50480
  this.#trackedChangesOverrides = options.layoutEngineOptions?.trackedChanges;
@@ -51049,6 +51063,33 @@ class PresentationEditor extends EventEmitter {
51049
51063
  this.#scheduleRerender();
51050
51064
  }
51051
51065
  }
51066
+ /**
51067
+ * Update viewing-mode comment rendering behavior and re-render if needed.
51068
+ *
51069
+ * @param options - Viewing mode comment options.
51070
+ */
51071
+ setViewingCommentOptions(options = {}) {
51072
+ if (options !== void 0 && (typeof options !== "object" || options === null || Array.isArray(options))) {
51073
+ throw new TypeError("[PresentationEditor] setViewingCommentOptions expects an object or undefined");
51074
+ }
51075
+ let hasChanges = false;
51076
+ if (typeof options.emitCommentPositionsInViewing === "boolean") {
51077
+ if (this.#layoutOptions.emitCommentPositionsInViewing !== options.emitCommentPositionsInViewing) {
51078
+ this.#layoutOptions.emitCommentPositionsInViewing = options.emitCommentPositionsInViewing;
51079
+ hasChanges = true;
51080
+ }
51081
+ }
51082
+ if (typeof options.enableCommentsInViewing === "boolean") {
51083
+ if (this.#layoutOptions.enableCommentsInViewing !== options.enableCommentsInViewing) {
51084
+ this.#layoutOptions.enableCommentsInViewing = options.enableCommentsInViewing;
51085
+ hasChanges = true;
51086
+ }
51087
+ }
51088
+ if (hasChanges) {
51089
+ this.#pendingDocChange = true;
51090
+ this.#scheduleRerender();
51091
+ }
51092
+ }
51052
51093
  /**
51053
51094
  * Toggle the custom context menu at runtime to respect host-level guardrails.
51054
51095
  */
@@ -53430,7 +53471,7 @@ class PresentationEditor extends EventEmitter {
53430
53471
  } : void 0;
53431
53472
  const atomNodeTypes = getAtomNodeTypes(this.#editor?.schema ?? null);
53432
53473
  const positionMap = this.#editor?.state?.doc && docJson ? buildPositionMapFromPmDoc(this.#editor.state.doc, docJson) : null;
53433
- const commentsEnabled = this.#documentMode !== "viewing";
53474
+ const commentsEnabled = this.#documentMode !== "viewing" || this.#layoutOptions.enableCommentsInViewing === true;
53434
53475
  const result = toFlowBlocks(docJson, {
53435
53476
  mediaFiles: this.#editor?.storage?.image?.media,
53436
53477
  emitSectionBreaks: true,
@@ -53570,7 +53611,8 @@ class PresentationEditor extends EventEmitter {
53570
53611
  const payload = { layout, blocks, measures, metrics };
53571
53612
  this.emit("layoutUpdated", payload);
53572
53613
  this.emit("paginationUpdate", payload);
53573
- if (this.#documentMode !== "viewing") {
53614
+ const allowViewingCommentPositions = this.#layoutOptions.emitCommentPositionsInViewing === true;
53615
+ if (this.#documentMode !== "viewing" || allowViewingCommentPositions) {
53574
53616
  const commentPositions = this.#collectCommentPositions();
53575
53617
  const positionKeys = Object.keys(commentPositions);
53576
53618
  if (positionKeys.length > 0) {
@@ -1,6 +1,6 @@
1
1
  import { B as Buffer$2 } from "./jszip-B1fkPkPJ.es.js";
2
2
  import { t as twipsToInches, i as inchesToTwips, p as ptToTwips, l as linesToTwips, a as twipsToLines, b as pixelsToTwips, h as halfPointToPoints, c as twipsToPixels$2, d as convertSizeToCSS, e as inchesToPixels } from "./helpers-C8e9wR5l.es.js";
3
- import { g as generateDocxRandomId, T as TextSelection$1, o as objectIncludes, w as wrapTextsInRuns, D as DOMParser$1, c as createDocFromMarkdown, a as createDocFromHTML, b as chainableEditorState, d as convertMarkdownToHTML, f as findParentNode, e as findParentNodeClosestToPos, h as generateRandom32BitHex, i as generateRandomSigned32BitIntStrId, P as PluginKey, j as Plugin, M as Mapping, N as NodeSelection, k as Selection, l as Slice, m as DOMSerializer, F as Fragment, n as Mark$1, p as dropPoint, A as AllSelection, q as Schema$1, s as canSplit, t as resolveRunProperties, u as encodeMarksFromRPr, v as liftTarget, x as canJoin, y as joinPoint, z as replaceStep$1, R as ReplaceAroundStep$1, B as htmlHandler, C as ReplaceStep, E as getResolvedParagraphProperties, G as changeListLevel, H as isList$1, I as updateNumberingProperties, L as ListHelpers, J as inputRulesPlugin, K as TrackDeleteMarkName$1, O as TrackInsertMarkName$1, Q as TrackFormatMarkName$1, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as createOoxmlResolver, a0 as translator, a1 as translator$1, a2 as resolveDocxFontFamily, a3 as combineIndentProperties, a4 as _getReferencedTableStyles, a5 as decodeRPrFromMarks, a6 as calculateResolvedParagraphProperties, a7 as encodeCSSFromPPr, a8 as encodeCSSFromRPr, a9 as generateOrderedListIndex, aa as docxNumberingHelpers, ab as InputRule, ac as insertNewRelationship, ad as kebabCase$1, ae as getUnderlineCssString } from "./SuperConverter-BQ6PNaJ8.es.js";
3
+ import { g as generateDocxRandomId, T as TextSelection$1, o as objectIncludes, w as wrapTextsInRuns, D as DOMParser$1, c as createDocFromMarkdown, a as createDocFromHTML, b as chainableEditorState, d as convertMarkdownToHTML, f as findParentNode, e as findParentNodeClosestToPos, h as generateRandom32BitHex, i as generateRandomSigned32BitIntStrId, P as PluginKey, j as Plugin, M as Mapping, N as NodeSelection, k as Selection, l as Slice, m as DOMSerializer, F as Fragment, n as Mark$1, p as dropPoint, A as AllSelection, q as Schema$1, s as canSplit, t as resolveRunProperties, u as encodeMarksFromRPr, v as liftTarget, x as canJoin, y as joinPoint, z as replaceStep$1, R as ReplaceAroundStep$1, B as htmlHandler, C as ReplaceStep, E as getResolvedParagraphProperties, G as changeListLevel, H as isList$1, I as updateNumberingProperties, L as ListHelpers, J as inputRulesPlugin, K as TrackDeleteMarkName$1, O as TrackInsertMarkName$1, Q as TrackFormatMarkName$1, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as createOoxmlResolver, a0 as translator, a1 as translator$1, a2 as resolveDocxFontFamily, a3 as combineIndentProperties, a4 as _getReferencedTableStyles, a5 as decodeRPrFromMarks, a6 as calculateResolvedParagraphProperties, a7 as encodeCSSFromPPr, a8 as encodeCSSFromRPr, a9 as generateOrderedListIndex, aa as docxNumberingHelpers, ab as InputRule, ac as insertNewRelationship, ad as kebabCase$1, ae as getUnderlineCssString } from "./SuperConverter-CFRB4XNw.es.js";
4
4
  import { p as process$1, r as ref, C as global$1, c as computed, E as createElementBlock, F as Fragment$1, S as renderList, O as withModifiers, G as openBlock, P as normalizeClass, M as createCommentVNode, H as toDisplayString, K as createBaseVNode, U as createApp, f as onMounted, X as onUnmounted, R as withDirectives, v as unref, Y as vModelText, y as nextTick, L as normalizeStyle, u as watch, Z as withKeys, _ as createTextVNode, I as createVNode, h, $ as readonly, s as getCurrentInstance, o as onBeforeUnmount, j as reactive, b as onBeforeMount, i as inject, a0 as onActivated, a1 as onDeactivated, a2 as Comment, d as defineComponent, a as provide, g as Teleport, t as toRef, a3 as renderSlot, a4 as isVNode, D as shallowRef, w as watchEffect, T as Transition, a5 as mergeProps, a6 as vShow, a7 as cloneVNode, a8 as Text$2, m as markRaw, N as createBlock, J as withCtx, a9 as useCssVars, V as resolveDynamicComponent, aa as normalizeProps, ab as guardReactiveProps } from "./vue-BnBKJwCW.es.js";
5
5
  import "./jszip.min-DCl8qkFO.es.js";
6
6
  import { E as EventEmitter$1 } from "./eventemitter3-CwrdEv8r.es.js";
@@ -15440,7 +15440,7 @@ const canUseDOM = () => {
15440
15440
  return false;
15441
15441
  }
15442
15442
  };
15443
- const summaryVersion = "1.3.1-next.3";
15443
+ const summaryVersion = "1.4.0-next.1";
15444
15444
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
15445
15445
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
15446
15446
  function mapAttributes(attrs) {
@@ -18072,7 +18072,7 @@ class Editor extends EventEmitter {
18072
18072
  * Process collaboration migrations
18073
18073
  */
18074
18074
  processCollaborationMigrations() {
18075
- console.debug("[checkVersionMigrations] Current editor version", "1.3.1-next.3");
18075
+ console.debug("[checkVersionMigrations] Current editor version", "1.4.0-next.1");
18076
18076
  if (!this.options.ydoc) return;
18077
18077
  const metaMap = this.options.ydoc.getMap("meta");
18078
18078
  let docVersion = metaMap.get("version");
@@ -41851,7 +41851,13 @@ const spacingPxToPt = (spacing) => {
41851
41851
  const result = {};
41852
41852
  if (spacing.before != null) result.before = pxToPt(spacing.before);
41853
41853
  if (spacing.after != null) result.after = pxToPt(spacing.after);
41854
- if (spacing.line != null) result.line = pxToPt(spacing.line);
41854
+ if (spacing.line != null) {
41855
+ if (spacing.lineRule === "auto" && spacing.line > 0 && spacing.line <= MAX_AUTO_LINE_MULTIPLIER) {
41856
+ result.line = spacing.line;
41857
+ } else {
41858
+ result.line = pxToPt(spacing.line);
41859
+ }
41860
+ }
41855
41861
  if (spacing.lineRule) result.lineRule = spacing.lineRule;
41856
41862
  return result;
41857
41863
  };
@@ -41875,8 +41881,13 @@ const spacingPtToPx = (spacing, rawSpacing) => {
41875
41881
  if (after != null) result.after = after;
41876
41882
  }
41877
41883
  if (rawSpacing.line != null) {
41878
- const line = ptToPx(spacing.line);
41879
- if (line != null) result.line = line;
41884
+ const isAutoMultiplier = spacing.lineRule === "auto" && spacing.line != null && spacing.line > 0 && spacing.line <= MAX_AUTO_LINE_MULTIPLIER;
41885
+ if (isAutoMultiplier) {
41886
+ result.line = spacing.line;
41887
+ } else {
41888
+ const line = ptToPx(spacing.line);
41889
+ if (line != null) result.line = line;
41890
+ }
41880
41891
  if (spacing.lineRule) result.lineRule = spacing.lineRule;
41881
41892
  }
41882
41893
  }
@@ -41956,7 +41967,7 @@ const normalizeLineValue = (value, lineRule) => {
41956
41967
  if (value > 0 && value <= MAX_AUTO_LINE_MULTIPLIER) {
41957
41968
  return value;
41958
41969
  }
41959
- return twipsToPx$1(value);
41970
+ return value / 240;
41960
41971
  }
41961
41972
  return twipsToPx$1(value);
41962
41973
  };
@@ -50097,7 +50108,8 @@ const resolveLineHeight = (spacing, baseLineHeight) => {
50097
50108
  return baseLineHeight;
50098
50109
  }
50099
50110
  const raw = spacing.line;
50100
- const treatAsMultiplier = (spacing.lineRule === "auto" || spacing.lineRule == null) && raw > 0 && raw <= 10;
50111
+ const isAuto = spacing.lineRule === "auto";
50112
+ const treatAsMultiplier = (isAuto || spacing.lineRule == null) && raw > 0 && (isAuto || raw <= 10);
50101
50113
  if (treatAsMultiplier) {
50102
50114
  return raw * baseLineHeight;
50103
50115
  }
@@ -50444,6 +50456,8 @@ class PresentationEditor extends EventEmitter {
50444
50456
  debugLabel: options.layoutEngineOptions?.debugLabel,
50445
50457
  layoutMode: options.layoutEngineOptions?.layoutMode ?? "vertical",
50446
50458
  trackedChanges: options.layoutEngineOptions?.trackedChanges,
50459
+ emitCommentPositionsInViewing: options.layoutEngineOptions?.emitCommentPositionsInViewing,
50460
+ enableCommentsInViewing: options.layoutEngineOptions?.enableCommentsInViewing,
50447
50461
  presence: validatedPresence
50448
50462
  };
50449
50463
  this.#trackedChangesOverrides = options.layoutEngineOptions?.trackedChanges;
@@ -51032,6 +51046,33 @@ class PresentationEditor extends EventEmitter {
51032
51046
  this.#scheduleRerender();
51033
51047
  }
51034
51048
  }
51049
+ /**
51050
+ * Update viewing-mode comment rendering behavior and re-render if needed.
51051
+ *
51052
+ * @param options - Viewing mode comment options.
51053
+ */
51054
+ setViewingCommentOptions(options = {}) {
51055
+ if (options !== void 0 && (typeof options !== "object" || options === null || Array.isArray(options))) {
51056
+ throw new TypeError("[PresentationEditor] setViewingCommentOptions expects an object or undefined");
51057
+ }
51058
+ let hasChanges = false;
51059
+ if (typeof options.emitCommentPositionsInViewing === "boolean") {
51060
+ if (this.#layoutOptions.emitCommentPositionsInViewing !== options.emitCommentPositionsInViewing) {
51061
+ this.#layoutOptions.emitCommentPositionsInViewing = options.emitCommentPositionsInViewing;
51062
+ hasChanges = true;
51063
+ }
51064
+ }
51065
+ if (typeof options.enableCommentsInViewing === "boolean") {
51066
+ if (this.#layoutOptions.enableCommentsInViewing !== options.enableCommentsInViewing) {
51067
+ this.#layoutOptions.enableCommentsInViewing = options.enableCommentsInViewing;
51068
+ hasChanges = true;
51069
+ }
51070
+ }
51071
+ if (hasChanges) {
51072
+ this.#pendingDocChange = true;
51073
+ this.#scheduleRerender();
51074
+ }
51075
+ }
51035
51076
  /**
51036
51077
  * Toggle the custom context menu at runtime to respect host-level guardrails.
51037
51078
  */
@@ -53413,7 +53454,7 @@ class PresentationEditor extends EventEmitter {
53413
53454
  } : void 0;
53414
53455
  const atomNodeTypes = getAtomNodeTypes(this.#editor?.schema ?? null);
53415
53456
  const positionMap = this.#editor?.state?.doc && docJson ? buildPositionMapFromPmDoc(this.#editor.state.doc, docJson) : null;
53416
- const commentsEnabled = this.#documentMode !== "viewing";
53457
+ const commentsEnabled = this.#documentMode !== "viewing" || this.#layoutOptions.enableCommentsInViewing === true;
53417
53458
  const result = toFlowBlocks(docJson, {
53418
53459
  mediaFiles: this.#editor?.storage?.image?.media,
53419
53460
  emitSectionBreaks: true,
@@ -53553,7 +53594,8 @@ class PresentationEditor extends EventEmitter {
53553
53594
  const payload = { layout, blocks, measures, metrics };
53554
53595
  this.emit("layoutUpdated", payload);
53555
53596
  this.emit("paginationUpdate", payload);
53556
- if (this.#documentMode !== "viewing") {
53597
+ const allowViewingCommentPositions = this.#layoutOptions.emitCommentPositionsInViewing === true;
53598
+ if (this.#documentMode !== "viewing" || allowViewingCommentPositions) {
53557
53599
  const commentPositions = this.#collectCommentPositions();
53558
53600
  const positionKeys = Object.keys(commentPositions);
53559
53601
  if (positionKeys.length > 0) {
package/dist/style.css CHANGED
@@ -2420,23 +2420,23 @@ span[data-v-53e13009] {
2420
2420
  background-color: #1355ff7f;
2421
2421
  }
2422
2422
 
2423
- .comment-doc[data-v-d019784c] {
2423
+ .comment-doc[data-v-7d21d613] {
2424
2424
  position: relative;
2425
2425
  }
2426
- .comments-layer[data-v-d019784c] {
2426
+ .comments-layer[data-v-7d21d613] {
2427
2427
  position: relative;
2428
2428
  }
2429
- .sd-comment-anchor[data-v-d019784c] {
2429
+ .sd-comment-anchor[data-v-7d21d613] {
2430
2430
  position: absolute;
2431
2431
  cursor: pointer;
2432
2432
  z-index: 3;
2433
2433
  border-radius: 4px;
2434
2434
  transition: background-color 250ms ease;
2435
2435
  }
2436
- .bypass[data-v-d019784c] {
2436
+ .bypass[data-v-7d21d613] {
2437
2437
  display: none;
2438
2438
  }
2439
- .comments-container[data-v-d019784c] {
2439
+ .comments-container[data-v-7d21d613] {
2440
2440
  /* pointer-events: none; */
2441
2441
  }
2442
2442
 
@@ -2559,46 +2559,46 @@ img[data-v-7dd69850] {
2559
2559
  display: none;
2560
2560
  }
2561
2561
 
2562
- .superdoc[data-v-5196811d] {
2562
+ .superdoc[data-v-78737564] {
2563
2563
  display: flex;
2564
2564
  }
2565
- .right-sidebar[data-v-5196811d] {
2565
+ .right-sidebar[data-v-78737564] {
2566
2566
  min-width: 320px;
2567
2567
  }
2568
- .floating-comments[data-v-5196811d] {
2568
+ .floating-comments[data-v-78737564] {
2569
2569
  min-width: 300px;
2570
2570
  width: 300px;
2571
2571
  }
2572
- .superdoc__layers[data-v-5196811d] {
2572
+ .superdoc__layers[data-v-78737564] {
2573
2573
  height: 100%;
2574
2574
  position: relative;
2575
2575
  box-sizing: border-box;
2576
2576
  }
2577
- .superdoc__document[data-v-5196811d] {
2577
+ .superdoc__document[data-v-78737564] {
2578
2578
  width: 100%;
2579
2579
  position: relative;
2580
2580
  }
2581
- .superdoc__sub-document[data-v-5196811d] {
2581
+ .superdoc__sub-document[data-v-78737564] {
2582
2582
  width: 100%;
2583
2583
  position: relative;
2584
2584
  }
2585
- .superdoc__selection-layer[data-v-5196811d] {
2585
+ .superdoc__selection-layer[data-v-78737564] {
2586
2586
  position: absolute;
2587
2587
  min-width: 100%;
2588
2588
  min-height: 100%;
2589
2589
  z-index: 10;
2590
2590
  pointer-events: none;
2591
2591
  }
2592
- .superdoc__temp-selection[data-v-5196811d] {
2592
+ .superdoc__temp-selection[data-v-78737564] {
2593
2593
  position: absolute;
2594
2594
  }
2595
- .superdoc__comments-layer[data-v-5196811d] {
2595
+ .superdoc__comments-layer[data-v-78737564] {
2596
2596
  /* position: absolute; */
2597
2597
  top: 0;
2598
2598
  height: 100%;
2599
2599
  position: relative;
2600
2600
  }
2601
- .superdoc__right-sidebar[data-v-5196811d] {
2601
+ .superdoc__right-sidebar[data-v-78737564] {
2602
2602
  width: 320px;
2603
2603
  min-width: 320px;
2604
2604
  padding: 0 10px;
@@ -2608,14 +2608,14 @@ img[data-v-7dd69850] {
2608
2608
  }
2609
2609
 
2610
2610
  /* Tools styles */
2611
- .tools[data-v-5196811d] {
2611
+ .tools[data-v-78737564] {
2612
2612
  position: absolute;
2613
2613
  z-index: 3;
2614
2614
  display: flex;
2615
2615
  flex-direction: column;
2616
2616
  gap: 6px;
2617
2617
  }
2618
- .tools .tool-icon[data-v-5196811d] {
2618
+ .tools .tool-icon[data-v-78737564] {
2619
2619
  font-size: 20px;
2620
2620
  border-radius: 12px;
2621
2621
  border: none;
@@ -2623,7 +2623,7 @@ img[data-v-7dd69850] {
2623
2623
  background-color: #dbdbdb;
2624
2624
  cursor: pointer;
2625
2625
  }
2626
- .tools-item[data-v-5196811d] {
2626
+ .tools-item[data-v-78737564] {
2627
2627
  display: flex;
2628
2628
  align-items: center;
2629
2629
  justify-content: center;
@@ -2633,10 +2633,10 @@ img[data-v-7dd69850] {
2633
2633
  border-radius: 12px;
2634
2634
  cursor: pointer;
2635
2635
  }
2636
- .tools-item i[data-v-5196811d] {
2636
+ .tools-item i[data-v-78737564] {
2637
2637
  cursor: pointer;
2638
2638
  }
2639
- .superdoc__tools-icon[data-v-5196811d] {
2639
+ .superdoc__tools-icon[data-v-78737564] {
2640
2640
  width: 20px;
2641
2641
  height: 20px;
2642
2642
  flex-shrink: 0;
@@ -2651,15 +2651,15 @@ img[data-v-7dd69850] {
2651
2651
 
2652
2652
  /* 834px is iPad screen size in portrait orientation */
2653
2653
  @media (max-width: 834px) {
2654
- .superdoc .superdoc__layers[data-v-5196811d] {
2654
+ .superdoc .superdoc__layers[data-v-78737564] {
2655
2655
  margin: 0;
2656
2656
  border: 0 !important;
2657
2657
  box-shadow: none;
2658
2658
  }
2659
- .superdoc__sub-document[data-v-5196811d] {
2659
+ .superdoc__sub-document[data-v-78737564] {
2660
2660
  max-width: 100%;
2661
2661
  }
2662
- .superdoc__right-sidebar[data-v-5196811d] {
2662
+ .superdoc__right-sidebar[data-v-78737564] {
2663
2663
  padding: 10px;
2664
2664
  width: 55px;
2665
2665
  position: relative;
@@ -2667,7 +2667,7 @@ img[data-v-7dd69850] {
2667
2667
  }
2668
2668
 
2669
2669
  /* AI Writer styles */
2670
- .ai-writer-container[data-v-5196811d] {
2670
+ .ai-writer-container[data-v-78737564] {
2671
2671
  position: fixed;
2672
2672
  z-index: 1000;
2673
2673
  background: white;
@@ -2685,13 +2685,13 @@ img[data-v-7dd69850] {
2685
2685
  } */
2686
2686
 
2687
2687
  /* Tools styles */
2688
- .tools[data-v-5196811d] {
2688
+ .tools[data-v-78737564] {
2689
2689
  position: absolute;
2690
2690
  z-index: 3;
2691
2691
  display: flex;
2692
2692
  gap: 6px;
2693
2693
  }
2694
- .tools .tool-icon[data-v-5196811d] {
2694
+ .tools .tool-icon[data-v-78737564] {
2695
2695
  font-size: 20px;
2696
2696
  border-radius: 12px;
2697
2697
  border: none;
@@ -2699,7 +2699,7 @@ img[data-v-7dd69850] {
2699
2699
  background-color: #dbdbdb;
2700
2700
  cursor: pointer;
2701
2701
  }
2702
- .tools-item[data-v-5196811d] {
2702
+ .tools-item[data-v-78737564] {
2703
2703
  display: flex;
2704
2704
  align-items: center;
2705
2705
  justify-content: center;
@@ -2710,18 +2710,18 @@ img[data-v-7dd69850] {
2710
2710
  border-radius: 12px;
2711
2711
  cursor: pointer;
2712
2712
  }
2713
- .tools-item i[data-v-5196811d] {
2713
+ .tools-item i[data-v-78737564] {
2714
2714
  cursor: pointer;
2715
2715
  }
2716
- .superdoc__tools-icon[data-v-5196811d] {
2716
+ .superdoc__tools-icon[data-v-78737564] {
2717
2717
  width: 20px;
2718
2718
  height: 20px;
2719
2719
  flex-shrink: 0;
2720
2720
  }
2721
- .ai-tool > svg[data-v-5196811d] {
2721
+ .ai-tool > svg[data-v-78737564] {
2722
2722
  fill: transparent;
2723
2723
  }
2724
- .ai-tool[data-v-5196811d]::before {
2724
+ .ai-tool[data-v-78737564]::before {
2725
2725
  content: '';
2726
2726
  position: absolute;
2727
2727
  width: 20px;
@@ -2742,7 +2742,7 @@ img[data-v-7dd69850] {
2742
2742
  filter: brightness(1.2);
2743
2743
  transition: filter 0.2s ease;
2744
2744
  }
2745
- .ai-tool[data-v-5196811d]:hover::before {
2745
+ .ai-tool[data-v-78737564]:hover::before {
2746
2746
  filter: brightness(1.3);
2747
2747
  }
2748
2748
 
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../chunks/jszip-C8_CqJxM.cjs");
4
4
  require("../chunks/helpers-nOdwpmwb.cjs");
5
- const superEditor_converter = require("../chunks/SuperConverter-p1tQGIew.cjs");
5
+ const superEditor_converter = require("../chunks/SuperConverter-CgY28MJz.cjs");
6
6
  require("../chunks/uuid-R7L08bOx.cjs");
7
7
  exports.SuperConverter = superEditor_converter.SuperConverter;
@@ -1,6 +1,6 @@
1
1
  import "../chunks/jszip-B1fkPkPJ.es.js";
2
2
  import "../chunks/helpers-C8e9wR5l.es.js";
3
- import { S } from "../chunks/SuperConverter-BQ6PNaJ8.es.js";
3
+ import { S } from "../chunks/SuperConverter-CFRB4XNw.es.js";
4
4
  import "../chunks/uuid-CjlX8hrF.es.js";
5
5
  export {
6
6
  S as SuperConverter
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./chunks/index-DLX_v-vr.cjs");
3
+ const index = require("./chunks/index-C3KRKogJ.cjs");
4
4
  const superEditor_docxZipper = require("./super-editor/docx-zipper.cjs");
5
5
  const superEditor_fileZipper = require("./super-editor/file-zipper.cjs");
6
6
  const vue = require("./chunks/vue-De9wkgLl.cjs");
7
- const superEditor_converter = require("./chunks/SuperConverter-p1tQGIew.cjs");
7
+ const superEditor_converter = require("./chunks/SuperConverter-CgY28MJz.cjs");
8
8
  function isNodeType(node, name) {
9
9
  return node.type.name === name;
10
10
  }
@@ -1,9 +1,9 @@
1
- import { ax as Node, ay as Mark } from "./chunks/index-CJec1cbb.es.js";
2
- import { ao, au, a9, ab, aw, am, av, aA, an, ak, aq, az, aa, as, aC, aE, aB, ac, aD, ar, at } from "./chunks/index-CJec1cbb.es.js";
1
+ import { ax as Node, ay as Mark } from "./chunks/index-CEcYlysg.es.js";
2
+ import { ao, au, a9, ab, aw, am, av, aA, an, ak, aq, az, aa, as, aC, aE, aB, ac, aD, ar, at } from "./chunks/index-CEcYlysg.es.js";
3
3
  import { default as default2 } from "./super-editor/docx-zipper.es.js";
4
4
  import { createZip } from "./super-editor/file-zipper.es.js";
5
5
  import { d as defineComponent, E as createElementBlock, G as openBlock, K as createBaseVNode } from "./chunks/vue-BnBKJwCW.es.js";
6
- import { S, r } from "./chunks/SuperConverter-BQ6PNaJ8.es.js";
6
+ import { S, r } from "./chunks/SuperConverter-CFRB4XNw.es.js";
7
7
  function isNodeType(node, name) {
8
8
  return node.type.name === name;
9
9
  }