superdoc 1.0.0-beta.101 → 1.0.0-beta.102

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 (28) hide show
  1. package/dist/chunks/{PdfViewer-Cd9VR_tI.es.js → PdfViewer-BFqkSyYx.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-DZWkMtTG.cjs → PdfViewer-X1sOA7hm.cjs} +1 -1
  3. package/dist/chunks/{index-BzQ_CQ_p.es.js → index-BP1yyX4N.es.js} +3 -3
  4. package/dist/chunks/{index-BavMv0sW.cjs → index-f4ON3m7j.cjs} +3 -3
  5. package/dist/chunks/{index-N8gZUeSO-BneVBXkH.cjs → index-nVrA3URL-BssoM7VE.cjs} +1 -1
  6. package/dist/chunks/{index-N8gZUeSO-Dxit0pPr.es.js → index-nVrA3URL-vs_NmI3L.es.js} +1 -1
  7. package/dist/chunks/{super-editor.es-BGncr3MA.cjs → super-editor.es-B7Xuihea.cjs} +66 -33
  8. package/dist/chunks/{super-editor.es-0IwuILla.es.js → super-editor.es-BM69n_BR.es.js} +66 -33
  9. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter---tUwTA4.js → converter-NrpPx2Xr.js} +12 -6
  12. package/dist/super-editor/chunks/{docx-zipper-B8zS8jbu.js → docx-zipper-oyKPvmaC.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-3H6s48L7.js → editor-Dnw031hl.js} +52 -25
  14. package/dist/super-editor/chunks/{index-N8gZUeSO.js → index-nVrA3URL.js} +1 -1
  15. package/dist/super-editor/chunks/{toolbar-FxiK-_cI.js → toolbar-OrlYExrD.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/super-editor.es.js +10 -10
  21. package/dist/super-editor/toolbar.es.js +2 -2
  22. package/dist/super-editor.cjs +1 -1
  23. package/dist/super-editor.es.js +1 -1
  24. package/dist/superdoc.cjs +2 -2
  25. package/dist/superdoc.es.js +2 -2
  26. package/dist/superdoc.umd.js +68 -35
  27. package/dist/superdoc.umd.js.map +1 -1
  28. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { y as defineComponent, z as h, O as Transition, a0 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, u as createVNode, v as unref } from "./vue-Dysv_7z5.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-BzQ_CQ_p.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-BP1yyX4N.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-jWLMl8Ts.cjs");
4
- const superdoc = require("./index-BavMv0sW.cjs");
4
+ const superdoc = require("./index-f4ON3m7j.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  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, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-0IwuILla.es.js";
1
+ import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-BM69n_BR.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
3
  import { E as EventEmitter } from "./eventemitter3-CcXAdeql.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
@@ -17242,7 +17242,7 @@ const _sfc_main = {
17242
17242
  __name: "SuperDoc",
17243
17243
  emits: ["selection-update"],
17244
17244
  setup(__props, { emit: __emit }) {
17245
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-Cd9VR_tI.es.js"));
17245
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-BFqkSyYx.es.js"));
17246
17246
  const superdocStore = useSuperdocStore();
17247
17247
  const commentsStore = useCommentsStore();
17248
17248
  const {
@@ -18131,7 +18131,7 @@ class SuperDoc extends EventEmitter {
18131
18131
  this.config.colors = shuffleArray(this.config.colors);
18132
18132
  this.userColorMap = /* @__PURE__ */ new Map();
18133
18133
  this.colorIndex = 0;
18134
- this.version = "1.0.0-beta.101";
18134
+ this.version = "1.0.0-beta.102";
18135
18135
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18136
18136
  this.superdocId = config.superdocId || v4();
18137
18137
  this.colors = this.config.colors;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-BGncr3MA.cjs");
2
+ const superEditor_es = require("./super-editor.es-B7Xuihea.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
4
  const eventemitter3 = require("./eventemitter3-DQmQUge-.cjs");
5
5
  const provider = require("@hocuspocus/provider");
@@ -17259,7 +17259,7 @@ const _sfc_main = {
17259
17259
  __name: "SuperDoc",
17260
17260
  emits: ["selection-update"],
17261
17261
  setup(__props, { emit: __emit }) {
17262
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DZWkMtTG.cjs")));
17262
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-X1sOA7hm.cjs")));
17263
17263
  const superdocStore = useSuperdocStore();
17264
17264
  const commentsStore = useCommentsStore();
17265
17265
  const {
@@ -18148,7 +18148,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18148
18148
  this.config.colors = shuffleArray(this.config.colors);
18149
18149
  this.userColorMap = /* @__PURE__ */ new Map();
18150
18150
  this.colorIndex = 0;
18151
- this.version = "1.0.0-beta.101";
18151
+ this.version = "1.0.0-beta.102";
18152
18152
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18153
18153
  this.superdocId = config.superdocId || uuid.v4();
18154
18154
  this.colors = this.config.colors;
@@ -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-BGncr3MA.cjs");
3
+ const superEditor_es = require("./super-editor.es-B7Xuihea.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-0IwuILla.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-BM69n_BR.es.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG-CvBqQJbG.es.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -39792,7 +39792,7 @@ function importCommentData({ docx, editor, converter }) {
39792
39792
  const trackedDeletedText = attributes["custom:trackedDeletedText"] !== "null" ? attributes["custom:trackedDeletedText"] : null;
39793
39793
  const date = new Date(createdDate);
39794
39794
  const unixTimestampMs = date.getTime();
39795
- const parsedComment = nodeListHandler.handler({
39795
+ const parsedElements = nodeListHandler.handler({
39796
39796
  nodes: el.elements,
39797
39797
  nodeListHandler,
39798
39798
  docx,
@@ -39800,7 +39800,7 @@ function importCommentData({ docx, editor, converter }) {
39800
39800
  converter,
39801
39801
  path: [el]
39802
39802
  });
39803
- const { attrs } = parsedComment[0];
39803
+ const { attrs } = parsedElements[0];
39804
39804
  const paraId = attrs["w14:paraId"];
39805
39805
  return {
39806
39806
  commentId: internalId || v4(),
@@ -39808,7 +39808,8 @@ function importCommentData({ docx, editor, converter }) {
39808
39808
  creatorName: authorName,
39809
39809
  creatorEmail: authorEmail,
39810
39810
  createdTime: unixTimestampMs,
39811
- textJson: parsedComment[0],
39811
+ textJson: parsedElements[0],
39812
+ elements: parsedElements,
39812
39813
  initials,
39813
39814
  paraId,
39814
39815
  trackedChange,
@@ -39834,7 +39835,12 @@ const generateCommentsWithExtendedData = ({ docx, comments }) => {
39834
39835
  const { elements = [] } = initialElements[0] ?? {};
39835
39836
  const commentEx = elements.filter((el) => el.name === "w15:commentEx");
39836
39837
  return comments.map((comment) => {
39837
- const extendedDef = commentEx.find((ce2) => ce2.attributes["w15:paraId"] === comment.paraId);
39838
+ const extendedDef = commentEx.find((ce2) => {
39839
+ const isIncludedInCommentElements = comment.elements?.some(
39840
+ (el) => el.attrs?.["w14:paraId"] === ce2.attributes["w15:paraId"]
39841
+ );
39842
+ return isIncludedInCommentElements;
39843
+ });
39838
39844
  if (!extendedDef) return { ...comment, isDone: comment.isDone ?? false };
39839
39845
  const { isDone, paraIdParent } = getExtendedDetails(extendedDef);
39840
39846
  let parentComment;
@@ -41955,7 +41961,7 @@ const updateCommentsIdsAndExtensible = (comments = [], commentsIds, extensible)
41955
41961
  name: "w16cex:commentExtensible",
41956
41962
  attributes: {
41957
41963
  "w16cex:durableId": newDurableId,
41958
- "w16cex:dateUtc": toIsoNoFractional()
41964
+ "w16cex:dateUtc": toIsoNoFractional(comment.createdTime)
41959
41965
  }
41960
41966
  };
41961
41967
  extensibleUpdated.elements[0].elements.push(newExtensible);
@@ -42421,7 +42427,7 @@ const _SuperConverter = class _SuperConverter2 {
42421
42427
  static getStoredSuperdocVersion(docx) {
42422
42428
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42423
42429
  }
42424
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.101") {
42430
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.102") {
42425
42431
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42426
42432
  }
42427
42433
  /**
@@ -54817,6 +54823,14 @@ const toggleNode = (typeOrName, toggleTypeOrName, attrs = {}) => ({ state: state
54817
54823
  const selectAll = () => ({ state: state2, dispatch }) => selectAll$1(state2, dispatch);
54818
54824
  const deleteSelection = () => ({ state: state2, tr, dispatch }) => {
54819
54825
  const { from: from2, to, empty: empty2 } = state2.selection;
54826
+ if (typeof document !== "undefined" && document.getSelection) {
54827
+ const currentDomSelection = document.getSelection();
54828
+ const selectedLength = currentDomSelection?.toString?.().length;
54829
+ const isCollapsed = currentDomSelection?.isCollapsed;
54830
+ if (!isCollapsed && selectedLength === 1) {
54831
+ return false;
54832
+ }
54833
+ }
54820
54834
  if (empty2) {
54821
54835
  return deleteSelection$1(state2, dispatch);
54822
54836
  }
@@ -57116,12 +57130,14 @@ const prepareCommentsForImport = (doc2, tr, schema, converter) => {
57116
57130
  importedId: node.attrs["w:id"]
57117
57131
  });
57118
57132
  if (type2.name === "commentRangeStart") {
57119
- toMark.push({
57120
- commentId: resolvedCommentId,
57121
- importedId,
57122
- internal,
57123
- start: pos
57124
- });
57133
+ if (!matchingImportedComment?.isDone) {
57134
+ toMark.push({
57135
+ commentId: resolvedCommentId,
57136
+ importedId,
57137
+ internal,
57138
+ start: pos
57139
+ });
57140
+ }
57125
57141
  ensureFallbackComment({
57126
57142
  converter,
57127
57143
  matchingImportedComment,
@@ -59639,7 +59655,7 @@ const isHeadless = (editor) => {
59639
59655
  const shouldSkipNodeView = (editor) => {
59640
59656
  return isHeadless(editor);
59641
59657
  };
59642
- const summaryVersion = "1.0.0-beta.101";
59658
+ const summaryVersion = "1.0.0-beta.102";
59643
59659
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
59644
59660
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
59645
59661
  function mapAttributes(attrs) {
@@ -60428,7 +60444,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60428
60444
  { default: remarkStringify },
60429
60445
  { default: remarkGfm }
60430
60446
  ] = await Promise.all([
60431
- Promise.resolve().then(() => require("./index-N8gZUeSO-BneVBXkH.cjs")),
60447
+ Promise.resolve().then(() => require("./index-nVrA3URL-BssoM7VE.cjs")),
60432
60448
  Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
60433
60449
  Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
60434
60450
  Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
@@ -60633,7 +60649,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60633
60649
  * Process collaboration migrations
60634
60650
  */
60635
60651
  processCollaborationMigrations() {
60636
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.101");
60652
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.102");
60637
60653
  if (!this.options.ydoc) return;
60638
60654
  const metaMap = this.options.ydoc.getMap("meta");
60639
60655
  let docVersion = metaMap.get("version");
@@ -98145,14 +98161,19 @@ const createCell = (cellType, cellContent = null) => {
98145
98161
  }
98146
98162
  return cellType.createAndFill();
98147
98163
  };
98148
- const createTableBorders = ({ size: size2 = 0.66665, color = "#000000" } = {}) => {
98164
+ const createTableBorders = (borderSpec = {}) => {
98165
+ borderSpec = {
98166
+ size: 0.66665,
98167
+ color: "#000000",
98168
+ ...borderSpec
98169
+ };
98149
98170
  return {
98150
- top: { size: size2, color },
98151
- left: { size: size2, color },
98152
- bottom: { size: size2, color },
98153
- right: { size: size2, color },
98154
- insideH: { size: size2, color },
98155
- insideV: { size: size2, color }
98171
+ top: borderSpec,
98172
+ left: borderSpec,
98173
+ bottom: borderSpec,
98174
+ right: borderSpec,
98175
+ insideH: borderSpec,
98176
+ insideV: borderSpec
98156
98177
  };
98157
98178
  };
98158
98179
  const createTable = (schema, rowsCount, colsCount, withHeaderRow, cellContent = null) => {
@@ -98280,12 +98301,17 @@ const deleteTableWhenSelected = ({ editor }) => {
98280
98301
  editor.commands.deleteTable();
98281
98302
  return true;
98282
98303
  };
98283
- const createCellBorders = ({ size: size2 = 0.66665, color = "#000000" } = {}) => {
98304
+ const createCellBorders = (borderSpec = {}) => {
98305
+ borderSpec = {
98306
+ size: 0.66665,
98307
+ color: "#000000",
98308
+ ...borderSpec
98309
+ };
98284
98310
  return {
98285
- top: { size: size2, color },
98286
- left: { size: size2, color },
98287
- bottom: { size: size2, color },
98288
- right: { size: size2, color }
98311
+ top: borderSpec,
98312
+ left: borderSpec,
98313
+ bottom: borderSpec,
98314
+ right: borderSpec
98289
98315
  };
98290
98316
  };
98291
98317
  function cellAround($pos) {
@@ -99052,13 +99078,20 @@ const Table = Node$1.create({
99052
99078
  if (["tableCell", "tableHeader"].includes(node.type.name)) {
99053
99079
  tr.setNodeMarkup(pos, void 0, {
99054
99080
  ...node.attrs,
99055
- borders: createCellBorders({ size: 0 })
99081
+ borders: createCellBorders({ size: 0, space: 0, val: "none", color: "auto" })
99056
99082
  });
99057
99083
  }
99058
99084
  });
99059
99085
  tr.setNodeMarkup(table.pos, void 0, {
99060
99086
  ...table.node.attrs,
99061
- borders: createTableBorders({ size: 0 })
99087
+ borders: createTableBorders({ size: 0 }),
99088
+ // TODO: This works around the issue that table borders are duplicated between
99089
+ // the attributes of the table and the tableProperties attribute.
99090
+ // This can be removed when the redundancy is eliminated.
99091
+ tableProperties: {
99092
+ ...table.node.attrs.tableProperties,
99093
+ borders: createTableBorders({ size: 0, space: 0, val: "none", color: "auto" })
99094
+ }
99062
99095
  });
99063
99096
  return true;
99064
99097
  }
@@ -123060,7 +123093,7 @@ const makeDefaultItems = ({
123060
123093
  }
123061
123094
  },
123062
123095
  {
123063
- label: toolbarTexts2.transparentBorders,
123096
+ label: toolbarTexts2.removeBorders,
123064
123097
  command: "deleteCellAndTableBorders",
123065
123098
  icon: toolbarIcons2.deleteBorders,
123066
123099
  bottomBorder: true,
@@ -123641,7 +123674,7 @@ const toolbarTexts = {
123641
123674
  deleteRow: "Delete row",
123642
123675
  deleteColumn: "Delete column",
123643
123676
  deleteTable: "Delete table",
123644
- transparentBorders: "Transparent borders",
123677
+ removeBorders: "Remove borders",
123645
123678
  mergeCells: "Merge cells",
123646
123679
  splitCell: "Split cell",
123647
123680
  fixTables: "Fix tables",
@@ -124679,7 +124712,7 @@ const TEXTS = {
124679
124712
  deleteRow: "Delete row",
124680
124713
  deleteColumn: "Delete column",
124681
124714
  deleteTable: "Delete table",
124682
- transparentBorders: "Transparent borders",
124715
+ removeBorders: "Remove borders",
124683
124716
  mergeCells: "Merge cells",
124684
124717
  splitCell: "Split cell",
124685
124718
  fixTables: "Fix tables",
@@ -124762,7 +124795,7 @@ const tableActionsOptions = [
124762
124795
  }
124763
124796
  },
124764
124797
  {
124765
- label: TEXTS.transparentBorders,
124798
+ label: TEXTS.removeBorders,
124766
124799
  command: "deleteCellAndTableBorders",
124767
124800
  icon: ICONS.deleteBorders,
124768
124801
  bottomBorder: true,
@@ -39775,7 +39775,7 @@ function importCommentData({ docx, editor, converter }) {
39775
39775
  const trackedDeletedText = attributes["custom:trackedDeletedText"] !== "null" ? attributes["custom:trackedDeletedText"] : null;
39776
39776
  const date = new Date(createdDate);
39777
39777
  const unixTimestampMs = date.getTime();
39778
- const parsedComment = nodeListHandler.handler({
39778
+ const parsedElements = nodeListHandler.handler({
39779
39779
  nodes: el.elements,
39780
39780
  nodeListHandler,
39781
39781
  docx,
@@ -39783,7 +39783,7 @@ function importCommentData({ docx, editor, converter }) {
39783
39783
  converter,
39784
39784
  path: [el]
39785
39785
  });
39786
- const { attrs } = parsedComment[0];
39786
+ const { attrs } = parsedElements[0];
39787
39787
  const paraId = attrs["w14:paraId"];
39788
39788
  return {
39789
39789
  commentId: internalId || v4(),
@@ -39791,7 +39791,8 @@ function importCommentData({ docx, editor, converter }) {
39791
39791
  creatorName: authorName,
39792
39792
  creatorEmail: authorEmail,
39793
39793
  createdTime: unixTimestampMs,
39794
- textJson: parsedComment[0],
39794
+ textJson: parsedElements[0],
39795
+ elements: parsedElements,
39795
39796
  initials,
39796
39797
  paraId,
39797
39798
  trackedChange,
@@ -39817,7 +39818,12 @@ const generateCommentsWithExtendedData = ({ docx, comments }) => {
39817
39818
  const { elements = [] } = initialElements[0] ?? {};
39818
39819
  const commentEx = elements.filter((el) => el.name === "w15:commentEx");
39819
39820
  return comments.map((comment) => {
39820
- const extendedDef = commentEx.find((ce2) => ce2.attributes["w15:paraId"] === comment.paraId);
39821
+ const extendedDef = commentEx.find((ce2) => {
39822
+ const isIncludedInCommentElements = comment.elements?.some(
39823
+ (el) => el.attrs?.["w14:paraId"] === ce2.attributes["w15:paraId"]
39824
+ );
39825
+ return isIncludedInCommentElements;
39826
+ });
39821
39827
  if (!extendedDef) return { ...comment, isDone: comment.isDone ?? false };
39822
39828
  const { isDone, paraIdParent } = getExtendedDetails(extendedDef);
39823
39829
  let parentComment;
@@ -41938,7 +41944,7 @@ const updateCommentsIdsAndExtensible = (comments = [], commentsIds, extensible)
41938
41944
  name: "w16cex:commentExtensible",
41939
41945
  attributes: {
41940
41946
  "w16cex:durableId": newDurableId,
41941
- "w16cex:dateUtc": toIsoNoFractional()
41947
+ "w16cex:dateUtc": toIsoNoFractional(comment.createdTime)
41942
41948
  }
41943
41949
  };
41944
41950
  extensibleUpdated.elements[0].elements.push(newExtensible);
@@ -42404,7 +42410,7 @@ const _SuperConverter = class _SuperConverter2 {
42404
42410
  static getStoredSuperdocVersion(docx) {
42405
42411
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42406
42412
  }
42407
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.101") {
42413
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.102") {
42408
42414
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42409
42415
  }
42410
42416
  /**
@@ -54800,6 +54806,14 @@ const toggleNode = (typeOrName, toggleTypeOrName, attrs = {}) => ({ state: state
54800
54806
  const selectAll = () => ({ state: state2, dispatch }) => selectAll$1(state2, dispatch);
54801
54807
  const deleteSelection = () => ({ state: state2, tr, dispatch }) => {
54802
54808
  const { from: from2, to, empty: empty2 } = state2.selection;
54809
+ if (typeof document !== "undefined" && document.getSelection) {
54810
+ const currentDomSelection = document.getSelection();
54811
+ const selectedLength = currentDomSelection?.toString?.().length;
54812
+ const isCollapsed = currentDomSelection?.isCollapsed;
54813
+ if (!isCollapsed && selectedLength === 1) {
54814
+ return false;
54815
+ }
54816
+ }
54803
54817
  if (empty2) {
54804
54818
  return deleteSelection$1(state2, dispatch);
54805
54819
  }
@@ -57099,12 +57113,14 @@ const prepareCommentsForImport = (doc2, tr, schema, converter) => {
57099
57113
  importedId: node.attrs["w:id"]
57100
57114
  });
57101
57115
  if (type2.name === "commentRangeStart") {
57102
- toMark.push({
57103
- commentId: resolvedCommentId,
57104
- importedId,
57105
- internal,
57106
- start: pos
57107
- });
57116
+ if (!matchingImportedComment?.isDone) {
57117
+ toMark.push({
57118
+ commentId: resolvedCommentId,
57119
+ importedId,
57120
+ internal,
57121
+ start: pos
57122
+ });
57123
+ }
57108
57124
  ensureFallbackComment({
57109
57125
  converter,
57110
57126
  matchingImportedComment,
@@ -59622,7 +59638,7 @@ const isHeadless = (editor) => {
59622
59638
  const shouldSkipNodeView = (editor) => {
59623
59639
  return isHeadless(editor);
59624
59640
  };
59625
- const summaryVersion = "1.0.0-beta.101";
59641
+ const summaryVersion = "1.0.0-beta.102";
59626
59642
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
59627
59643
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
59628
59644
  function mapAttributes(attrs) {
@@ -60411,7 +60427,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60411
60427
  { default: remarkStringify },
60412
60428
  { default: remarkGfm }
60413
60429
  ] = await Promise.all([
60414
- import("./index-N8gZUeSO-Dxit0pPr.es.js"),
60430
+ import("./index-nVrA3URL-vs_NmI3L.es.js"),
60415
60431
  import("./index-DRCvimau-Cw339678.es.js"),
60416
60432
  import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
60417
60433
  import("./index-D_sWOSiG-DE96TaT5.es.js"),
@@ -60616,7 +60632,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
60616
60632
  * Process collaboration migrations
60617
60633
  */
60618
60634
  processCollaborationMigrations() {
60619
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.101");
60635
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.102");
60620
60636
  if (!this.options.ydoc) return;
60621
60637
  const metaMap = this.options.ydoc.getMap("meta");
60622
60638
  let docVersion = metaMap.get("version");
@@ -98128,14 +98144,19 @@ const createCell = (cellType, cellContent = null) => {
98128
98144
  }
98129
98145
  return cellType.createAndFill();
98130
98146
  };
98131
- const createTableBorders = ({ size: size2 = 0.66665, color = "#000000" } = {}) => {
98147
+ const createTableBorders = (borderSpec = {}) => {
98148
+ borderSpec = {
98149
+ size: 0.66665,
98150
+ color: "#000000",
98151
+ ...borderSpec
98152
+ };
98132
98153
  return {
98133
- top: { size: size2, color },
98134
- left: { size: size2, color },
98135
- bottom: { size: size2, color },
98136
- right: { size: size2, color },
98137
- insideH: { size: size2, color },
98138
- insideV: { size: size2, color }
98154
+ top: borderSpec,
98155
+ left: borderSpec,
98156
+ bottom: borderSpec,
98157
+ right: borderSpec,
98158
+ insideH: borderSpec,
98159
+ insideV: borderSpec
98139
98160
  };
98140
98161
  };
98141
98162
  const createTable = (schema, rowsCount, colsCount, withHeaderRow, cellContent = null) => {
@@ -98263,12 +98284,17 @@ const deleteTableWhenSelected = ({ editor }) => {
98263
98284
  editor.commands.deleteTable();
98264
98285
  return true;
98265
98286
  };
98266
- const createCellBorders = ({ size: size2 = 0.66665, color = "#000000" } = {}) => {
98287
+ const createCellBorders = (borderSpec = {}) => {
98288
+ borderSpec = {
98289
+ size: 0.66665,
98290
+ color: "#000000",
98291
+ ...borderSpec
98292
+ };
98267
98293
  return {
98268
- top: { size: size2, color },
98269
- left: { size: size2, color },
98270
- bottom: { size: size2, color },
98271
- right: { size: size2, color }
98294
+ top: borderSpec,
98295
+ left: borderSpec,
98296
+ bottom: borderSpec,
98297
+ right: borderSpec
98272
98298
  };
98273
98299
  };
98274
98300
  function cellAround($pos) {
@@ -99035,13 +99061,20 @@ const Table = Node$1.create({
99035
99061
  if (["tableCell", "tableHeader"].includes(node.type.name)) {
99036
99062
  tr.setNodeMarkup(pos, void 0, {
99037
99063
  ...node.attrs,
99038
- borders: createCellBorders({ size: 0 })
99064
+ borders: createCellBorders({ size: 0, space: 0, val: "none", color: "auto" })
99039
99065
  });
99040
99066
  }
99041
99067
  });
99042
99068
  tr.setNodeMarkup(table.pos, void 0, {
99043
99069
  ...table.node.attrs,
99044
- borders: createTableBorders({ size: 0 })
99070
+ borders: createTableBorders({ size: 0 }),
99071
+ // TODO: This works around the issue that table borders are duplicated between
99072
+ // the attributes of the table and the tableProperties attribute.
99073
+ // This can be removed when the redundancy is eliminated.
99074
+ tableProperties: {
99075
+ ...table.node.attrs.tableProperties,
99076
+ borders: createTableBorders({ size: 0, space: 0, val: "none", color: "auto" })
99077
+ }
99045
99078
  });
99046
99079
  return true;
99047
99080
  }
@@ -123043,7 +123076,7 @@ const makeDefaultItems = ({
123043
123076
  }
123044
123077
  },
123045
123078
  {
123046
- label: toolbarTexts2.transparentBorders,
123079
+ label: toolbarTexts2.removeBorders,
123047
123080
  command: "deleteCellAndTableBorders",
123048
123081
  icon: toolbarIcons2.deleteBorders,
123049
123082
  bottomBorder: true,
@@ -123624,7 +123657,7 @@ const toolbarTexts = {
123624
123657
  deleteRow: "Delete row",
123625
123658
  deleteColumn: "Delete column",
123626
123659
  deleteTable: "Delete table",
123627
- transparentBorders: "Transparent borders",
123660
+ removeBorders: "Remove borders",
123628
123661
  mergeCells: "Merge cells",
123629
123662
  splitCell: "Split cell",
123630
123663
  fixTables: "Fix tables",
@@ -124662,7 +124695,7 @@ const TEXTS = {
124662
124695
  deleteRow: "Delete row",
124663
124696
  deleteColumn: "Delete column",
124664
124697
  deleteTable: "Delete table",
124665
- transparentBorders: "Transparent borders",
124698
+ removeBorders: "Remove borders",
124666
124699
  mergeCells: "Merge cells",
124667
124700
  splitCell: "Split cell",
124668
124701
  fixTables: "Fix tables",
@@ -124745,7 +124778,7 @@ const tableActionsOptions = [
124745
124778
  }
124746
124779
  },
124747
124780
  {
124748
- label: TEXTS.transparentBorders,
124781
+ label: TEXTS.removeBorders,
124749
124782
  command: "deleteCellAndTableBorders",
124750
124783
  icon: ICONS.deleteBorders,
124751
124784
  bottomBorder: true,
@@ -1 +1 @@
1
- {"version":3,"file":"SuperDoc.d.ts","sourceRoot":"","sources":["../../../../../src/core/SuperDoc.js"],"names":[],"mappings":"AAsBA,6CAA6C;AAC7C,mEAAmE;AACnE,qDAAqD;AACrD,mDAAmD;AACnD,iDAAiD;AACjD,6DAA6D;AAC7D,iDAAiD;AACjD,6DAA6D;AAE7D;;;;;;GAMG;AACH;IACE,4BAA4B;IAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CACgB;IA4ExC;;OAEG;IACH,oBAFW,MAAM,EAKhB;IAhFD,qBAAqB;IACrB,SADW,MAAM,CACT;IAER,qBAAqB;IACrB,OADW,IAAI,EAAE,CACX;IAEN,4CAA4C;IAC5C,MADW,OAAO,KAAK,EAAE,GAAG,GAAG,SAAS,CACnC;IAEL,4EAA4E;IAC5E,UADW,OAAO,sBAAsB,EAAE,kBAAkB,GAAG,SAAS,CAC/D;IAET,qBAAqB;IACrB,QADW,MAAM,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;CACF;mBA7hCa,OAAO,SAAS,EAAE,IAAI;8BACtB,OAAO,SAAS,EAAE,eAAe;uBACjC,OAAO,SAAS,EAAE,QAAQ;sBAC1B,OAAO,SAAS,EAAE,OAAO;qBACzB,OAAO,SAAS,EAAE,MAAM;2BACxB,OAAO,SAAS,EAAE,YAAY;qBAC9B,OAAO,SAAS,EAAE,MAAM;2BACxB,OAAO,SAAS,EAAE,YAAY;6BA3Bf,eAAe;8BAMd,iEAAiE"}
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
2
- import { T as TextSelection } from "./chunks/converter---tUwTA4.js";
3
- import { _ as _export_sfc } from "./chunks/editor-3H6s48L7.js";
2
+ import { T as TextSelection } from "./chunks/converter-NrpPx2Xr.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-Dnw031hl.js";
4
4
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
5
5
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
6
6
  async function baseInsightsFetch(payload, options = {}) {
@@ -39781,7 +39781,7 @@ function importCommentData({ docx, editor, converter }) {
39781
39781
  const trackedDeletedText = attributes["custom:trackedDeletedText"] !== "null" ? attributes["custom:trackedDeletedText"] : null;
39782
39782
  const date = new Date(createdDate);
39783
39783
  const unixTimestampMs = date.getTime();
39784
- const parsedComment = nodeListHandler.handler({
39784
+ const parsedElements = nodeListHandler.handler({
39785
39785
  nodes: el.elements,
39786
39786
  nodeListHandler,
39787
39787
  docx,
@@ -39789,7 +39789,7 @@ function importCommentData({ docx, editor, converter }) {
39789
39789
  converter,
39790
39790
  path: [el]
39791
39791
  });
39792
- const { attrs } = parsedComment[0];
39792
+ const { attrs } = parsedElements[0];
39793
39793
  const paraId = attrs["w14:paraId"];
39794
39794
  return {
39795
39795
  commentId: internalId || v4(),
@@ -39797,7 +39797,8 @@ function importCommentData({ docx, editor, converter }) {
39797
39797
  creatorName: authorName,
39798
39798
  creatorEmail: authorEmail,
39799
39799
  createdTime: unixTimestampMs,
39800
- textJson: parsedComment[0],
39800
+ textJson: parsedElements[0],
39801
+ elements: parsedElements,
39801
39802
  initials,
39802
39803
  paraId,
39803
39804
  trackedChange,
@@ -39823,7 +39824,12 @@ const generateCommentsWithExtendedData = ({ docx, comments }) => {
39823
39824
  const { elements = [] } = initialElements[0] ?? {};
39824
39825
  const commentEx = elements.filter((el) => el.name === "w15:commentEx");
39825
39826
  return comments.map((comment) => {
39826
- const extendedDef = commentEx.find((ce2) => ce2.attributes["w15:paraId"] === comment.paraId);
39827
+ const extendedDef = commentEx.find((ce2) => {
39828
+ const isIncludedInCommentElements = comment.elements?.some(
39829
+ (el) => el.attrs?.["w14:paraId"] === ce2.attributes["w15:paraId"]
39830
+ );
39831
+ return isIncludedInCommentElements;
39832
+ });
39827
39833
  if (!extendedDef) return { ...comment, isDone: comment.isDone ?? false };
39828
39834
  const { isDone, paraIdParent } = getExtendedDetails(extendedDef);
39829
39835
  let parentComment;
@@ -42255,7 +42261,7 @@ const updateCommentsIdsAndExtensible = (comments = [], commentsIds, extensible)
42255
42261
  name: "w16cex:commentExtensible",
42256
42262
  attributes: {
42257
42263
  "w16cex:durableId": newDurableId,
42258
- "w16cex:dateUtc": toIsoNoFractional()
42264
+ "w16cex:dateUtc": toIsoNoFractional(comment.createdTime)
42259
42265
  }
42260
42266
  };
42261
42267
  extensibleUpdated.elements[0].elements.push(newExtensible);
@@ -42721,7 +42727,7 @@ const _SuperConverter = class _SuperConverter {
42721
42727
  static getStoredSuperdocVersion(docx) {
42722
42728
  return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
42723
42729
  }
42724
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.101") {
42730
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.102") {
42725
42731
  return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
42726
42732
  }
42727
42733
  /**
@@ -1,4 +1,4 @@
1
- import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter---tUwTA4.js";
1
+ import { p as process$1, aJ as commonjsGlobal, B as Buffer, aK as getDefaultExportFromCjs, aL as getContentTypesFromXml, aM as xmljs } from "./converter-NrpPx2Xr.js";
2
2
  function commonjsRequire(path) {
3
3
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }