superdoc 2.20.0 → 2.20.1-next.10

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,6 +1,6 @@
1
1
  import { i as __toESM$2 } from "./chunks/rolldown-runtime-0pSA04fp.es.js";
2
2
  import { t as blank_default } from "./chunks/blank-docx-DzQccOlW.es.js";
3
- import { c as createImageFilePicker, d as DOM_CLASS_NAMES, f as closeInteractionHistory, i as registerFirstPartyCommandMutation, l as resolveImageSrc, m as recordInteraction, n as executeFirstPartyCommandAsync, o as applyV2CommentInvalidationFromMutation, p as createInteractionHistory, r as readFirstPartyPageNumbers, s as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-D5VrP4Dx.es.js";
3
+ import { c as createImageFilePicker, d as DOM_CLASS_NAMES, f as closeInteractionHistory, i as registerFirstPartyCommandMutation, l as resolveImageSrc, m as recordInteraction, n as executeFirstPartyCommandAsync, o as applyV2CommentInvalidationFromMutation, p as createInteractionHistory, r as readFirstPartyPageNumbers, s as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-Cfwszc3b.es.js";
4
4
  import { t as import_eventemitter3 } from "./chunks/eventemitter3-DEIiXiH2.es.js";
5
5
  import { t as v4 } from "./chunks/uuid-H0Xcmmhy.es.js";
6
6
  import { $ as watch$1, A as onActivated, B as resolveDirective, C as isRef$1, D as normalizeClass, E as nextTick, F as openBlock, G as toRef, H as shallowRef$1, I as reactive, J as useAttrs, K as toRefs, L as ref, M as onDeactivated, N as onMounted, O as normalizeProps, P as onScopeDispose$1, Q as vModelText, R as renderList, S as isReactive$1, T as mergeProps, U as toDisplayString, V as resolveDynamicComponent, W as toRaw$2, X as vModelCheckbox, Y as useSlots, Z as vModelSelect, _ as getCurrentInstance, a as computed$1, b as hasInjectionContext, c as createCommentVNode, d as createStaticVNode, et as withCtx, f as createTextVNode, g as effectScope, h as defineComponent, i as Transition, j as onBeforeUnmount, k as normalizeStyle, l as createElementBlock, m as defineAsyncComponent, n as Fragment, nt as withKeys, o as createApp, p as createVNode, q as unref, r as Teleport, rt as withModifiers, s as createBlock, t as _plugin_vue_export_helper_default, tt as withDirectives, u as createElementVNode, v as getCurrentScope, w as markRaw, x as inject$1, y as h, z as renderSlot } from "./chunks/_plugin-vue_export-helper-DHiJKCsy.es.js";
@@ -314,7 +314,7 @@ var shuffleArray = (array) => {
314
314
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
315
315
  function getSuperdocVersion() {
316
316
  try {
317
- return "2.20.0";
317
+ return "2.20.1-next.10";
318
318
  } catch {
319
319
  return "unknown";
320
320
  }
@@ -8921,6 +8921,11 @@ var useCommentsStore = defineStore("comments", () => {
8921
8921
  }
8922
8922
  superdoc?.activeEditor?.commands?.removeComment({ commentId: "pending" });
8923
8923
  };
8924
+ const getV2CreatedComment = ({ outcome, reconciled, documentId }) => {
8925
+ const createdId = normalizeCommentId(outcome?.createdCommentId);
8926
+ if (!createdId) return reconciled?.added ?? null;
8927
+ return commentsList.value.find((row) => String(row.commentId) === createdId && (documentId == null || String(row.fileId) === String(documentId))) ?? null;
8928
+ };
8924
8929
  /**
8925
8930
  * Add a new comment to the document
8926
8931
  *
@@ -8974,20 +8979,25 @@ var useCommentsStore = defineStore("comments", () => {
8974
8979
  documentId: v2Adapter.documentId,
8975
8980
  items: outcome.items
8976
8981
  });
8982
+ const created = getV2CreatedComment({
8983
+ outcome,
8984
+ reconciled,
8985
+ documentId: v2Adapter.documentId
8986
+ });
8977
8987
  const hadPendingComment = !!pendingComment.value;
8978
8988
  if (hadPendingComment) removePendingComment(superdoc);
8979
- const createdId = reconciled?.added?.commentId ?? null;
8989
+ const createdId = created?.commentId ?? null;
8980
8990
  if (hadPendingComment && createdId) {
8981
8991
  setActiveComment(superdoc, createdId);
8982
8992
  setActiveFloatingCommentInstance(createdId);
8983
8993
  }
8984
8994
  if (broadcastChanges) superdoc.emit("comments-update", {
8985
8995
  type: COMMENT_EVENTS.ADD,
8986
- comment: reconciled?.added?.getValues?.() ?? null
8996
+ comment: created?.getValues?.() ?? null
8987
8997
  });
8988
8998
  return {
8989
8999
  ok: true,
8990
- comment: reconciled?.added ?? null
9000
+ comment: created
8991
9001
  };
8992
9002
  });
8993
9003
  }
@@ -9546,9 +9556,13 @@ var useCommentsStore = defineStore("comments", () => {
9546
9556
  eventType: COMMENT_EVENTS.ADD,
9547
9557
  rejectionFallbackReason: "v2-reply-failed",
9548
9558
  rejectionEventExtras: parent ? { comment: getCommentEventPayload(parent) } : {},
9549
- successEventBuilder: ({ reconciled }) => ({
9559
+ successEventBuilder: ({ outcome, reconciled }) => ({
9550
9560
  type: COMMENT_EVENTS.ADD,
9551
- comment: reconciled?.added?.getValues?.() ?? null
9561
+ comment: getV2CreatedComment({
9562
+ outcome,
9563
+ reconciled,
9564
+ documentId: v2Adapter.documentId
9565
+ })?.getValues?.() ?? null
9552
9566
  })
9553
9567
  });
9554
9568
  };
@@ -13160,51 +13174,53 @@ var _hoisted_26 = { key: 7 };
13160
13174
  var _hoisted_27 = { class: "tracked-change-text is-deleted" };
13161
13175
  var _hoisted_28 = { class: "tracked-change-text is-inserted" };
13162
13176
  var _hoisted_29 = { key: 8 };
13163
- var _hoisted_30 = { class: "tracked-change-text is-deleted" };
13164
- var _hoisted_31 = { key: 9 };
13165
- var _hoisted_32 = { class: "tracked-change-text is-inserted" };
13166
- var _hoisted_33 = ["data-track-change-image-preview-role"];
13167
- var _hoisted_34 = ["src", "alt"];
13168
- var _hoisted_35 = {
13177
+ var _hoisted_30 = { key: 9 };
13178
+ var _hoisted_31 = { key: 10 };
13179
+ var _hoisted_32 = { class: "tracked-change-text is-deleted" };
13180
+ var _hoisted_33 = { key: 11 };
13181
+ var _hoisted_34 = { class: "tracked-change-text is-inserted" };
13182
+ var _hoisted_35 = ["data-track-change-image-preview-role"];
13183
+ var _hoisted_36 = ["src", "alt"];
13184
+ var _hoisted_37 = {
13169
13185
  key: 1,
13170
13186
  class: "card-section comment-body"
13171
13187
  };
13172
- var _hoisted_36 = ["innerHTML"];
13173
- var _hoisted_37 = {
13188
+ var _hoisted_38 = ["innerHTML"];
13189
+ var _hoisted_39 = {
13174
13190
  key: 1,
13175
13191
  class: "comment"
13176
13192
  };
13177
- var _hoisted_38 = {
13193
+ var _hoisted_40 = {
13178
13194
  key: 2,
13179
13195
  class: "reply-expanded"
13180
13196
  };
13181
- var _hoisted_39 = { class: "reply-input-wrapper" };
13182
- var _hoisted_40 = { class: "reply-actions" };
13183
- var _hoisted_41 = ["onClick"];
13184
- var _hoisted_42 = [
13197
+ var _hoisted_41 = { class: "reply-input-wrapper" };
13198
+ var _hoisted_42 = { class: "reply-actions" };
13199
+ var _hoisted_43 = ["onClick"];
13200
+ var _hoisted_44 = [
13185
13201
  "onClick",
13186
13202
  "disabled",
13187
13203
  "data-disabled-reason"
13188
13204
  ];
13189
- var _hoisted_43 = { class: "collapsed-avatars" };
13190
- var _hoisted_44 = {
13205
+ var _hoisted_45 = { class: "collapsed-avatars" };
13206
+ var _hoisted_46 = {
13191
13207
  key: 3,
13192
13208
  class: "comment-separator"
13193
13209
  };
13194
- var _hoisted_45 = {
13210
+ var _hoisted_47 = {
13195
13211
  key: 2,
13196
13212
  class: "tracked-change-decision-alert",
13197
13213
  role: "alert"
13198
13214
  };
13199
- var _hoisted_46 = { class: "tracked-change-decision-alert__message" };
13200
- var _hoisted_47 = ["disabled", "data-disabled-reason"];
13201
- var _hoisted_48 = {
13215
+ var _hoisted_48 = { class: "tracked-change-decision-alert__message" };
13216
+ var _hoisted_49 = ["disabled", "data-disabled-reason"];
13217
+ var _hoisted_50 = {
13202
13218
  key: 1,
13203
13219
  class: "reply-expanded"
13204
13220
  };
13205
- var _hoisted_49 = { class: "reply-input-wrapper" };
13206
- var _hoisted_50 = { class: "reply-actions" };
13207
- var _hoisted_51 = ["disabled", "data-disabled-reason"];
13221
+ var _hoisted_51 = { class: "reply-input-wrapper" };
13222
+ var _hoisted_52 = { class: "reply-actions" };
13223
+ var _hoisted_53 = ["disabled", "data-disabled-reason"];
13208
13224
  var CLICK_OUTSIDE_HIT_TOLERANCE_PX = 3;
13209
13225
  var TRACKED_CHANGE_PREVIEW_MAX_PX = 90;
13210
13226
  var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
@@ -14214,8 +14230,8 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
14214
14230
  createElementVNode("span", _hoisted_27, "\"" + toDisplayString(comment.deletedText) + "\"", 1),
14215
14231
  _cache[9] || (_cache[9] = createElementVNode("span", { class: "change-type" }, " with ", -1)),
14216
14232
  createElementVNode("span", _hoisted_28, "\"" + toDisplayString(comment.trackedChangeText) + "\"", 1)
14217
- ])) : comment.deletedText ? (openBlock(), createElementBlock("div", _hoisted_29, [_cache[10] || (_cache[10] = createElementVNode("span", { class: "change-type" }, "Deleted ", -1)), createElementVNode("span", _hoisted_30, "\"" + toDisplayString(comment.deletedText) + "\"", 1)])) : comment.trackedChangeText ? (openBlock(), createElementBlock("div", _hoisted_31, [_cache[11] || (_cache[11] = createElementVNode("span", { class: "change-type" }, "Added ", -1)), createElementVNode("span", _hoisted_32, "\"" + toDisplayString(comment.trackedChangeText) + "\"", 1)])) : createCommentVNode("", true), comment.trackedChangeImagePreview?.src ? (openBlock(), createElementBlock("div", {
14218
- key: 10,
14233
+ ])) : comment.deletedText && comment.deletedText === "\n" ? (openBlock(), createElementBlock("div", _hoisted_29, [..._cache[10] || (_cache[10] = [createElementVNode("span", { class: "change-type" }, "Deleted line break", -1)])])) : comment.trackedChangeText && comment.trackedChangeText === "\n" ? (openBlock(), createElementBlock("div", _hoisted_30, [..._cache[11] || (_cache[11] = [createElementVNode("span", { class: "change-type" }, "Added line break", -1)])])) : comment.deletedText ? (openBlock(), createElementBlock("div", _hoisted_31, [_cache[12] || (_cache[12] = createElementVNode("span", { class: "change-type" }, "Deleted ", -1)), createElementVNode("span", _hoisted_32, "\"" + toDisplayString(comment.deletedText) + "\"", 1)])) : comment.trackedChangeText ? (openBlock(), createElementBlock("div", _hoisted_33, [_cache[13] || (_cache[13] = createElementVNode("span", { class: "change-type" }, "Added ", -1)), createElementVNode("span", _hoisted_34, "\"" + toDisplayString(comment.trackedChangeText) + "\"", 1)])) : createCommentVNode("", true), comment.trackedChangeImagePreview?.src ? (openBlock(), createElementBlock("div", {
14234
+ key: 12,
14219
14235
  class: "tracked-change-image-preview",
14220
14236
  "data-track-change-image-preview-role": comment.trackedChangeImagePreview.role ?? void 0
14221
14237
  }, [createElementVNode("img", {
@@ -14225,7 +14241,7 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
14225
14241
  style: normalizeStyle(trackedChangeImagePreviewStyle(comment.trackedChangeImagePreview)),
14226
14242
  loading: "lazy",
14227
14243
  decoding: "async"
14228
- }, null, 12, _hoisted_34)], 8, _hoisted_33)) : createCommentVNode("", true)], 10, _hoisted_10$3),
14244
+ }, null, 12, _hoisted_36)], 8, _hoisted_35)) : createCommentVNode("", true)], 10, _hoisted_10$3),
14229
14245
  shouldTruncate.value && isTextOverflowing.value && index === 0 ? (openBlock(), createElementBlock("div", {
14230
14246
  key: 0,
14231
14247
  class: "show-more-toggle",
@@ -14237,29 +14253,29 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
14237
14253
  onClick: withModifiers(toggleTruncation, ["stop", "prevent"])
14238
14254
  }, " Show less ")) : createCommentVNode("", true)
14239
14255
  ])) : createCommentVNode("", true),
14240
- !comment.trackedChange ? (openBlock(), createElementBlock("div", _hoisted_35, [
14256
+ !comment.trackedChange ? (openBlock(), createElementBlock("div", _hoisted_37, [
14241
14257
  !unref(isDebugging) && !isEditingThisComment.value(comment) ? (openBlock(), createElementBlock("div", {
14242
14258
  key: 0,
14243
14259
  class: normalizeClass(["comment", index === 0 ? bodyOverflowClass.value : void 0]),
14244
14260
  ref_for: true,
14245
14261
  ref: index === 0 ? setParentBodyRef : void 0,
14246
14262
  innerHTML: comment.commentText
14247
- }, null, 10, _hoisted_36)) : unref(isDebugging) && !isEditingThisComment.value(comment) ? (openBlock(), createElementBlock("div", _hoisted_37, toDisplayString(unref(editorCommentPositions)[comment.importedId !== void 0 ? comment.importedId : comment.commentId]?.bounds), 1)) : (openBlock(), createElementBlock("div", _hoisted_38, [createElementVNode("div", _hoisted_39, [createVNode(CommentInput_default, {
14263
+ }, null, 10, _hoisted_38)) : unref(isDebugging) && !isEditingThisComment.value(comment) ? (openBlock(), createElementBlock("div", _hoisted_39, toDisplayString(unref(editorCommentPositions)[comment.importedId !== void 0 ? comment.importedId : comment.commentId]?.bounds), 1)) : (openBlock(), createElementBlock("div", _hoisted_40, [createElementVNode("div", _hoisted_41, [createVNode(CommentInput_default, {
14248
14264
  ref_for: true,
14249
14265
  ref: setEditCommentInputRef(comment.commentId),
14250
14266
  users: [],
14251
14267
  config: unref(getConfig),
14252
14268
  "include-header": false,
14253
14269
  comment
14254
- }, null, 8, ["config", "comment"])]), createElementVNode("div", _hoisted_40, [createElementVNode("button", {
14270
+ }, null, 8, ["config", "comment"])]), createElementVNode("div", _hoisted_42, [createElementVNode("button", {
14255
14271
  class: "sd-button reply-btn-cancel",
14256
14272
  onClick: withModifiers(($event) => handleCancel(comment), ["stop", "prevent"])
14257
- }, "Cancel", 8, _hoisted_41), createElementVNode("button", {
14273
+ }, "Cancel", 8, _hoisted_43), createElementVNode("button", {
14258
14274
  class: normalizeClass(["sd-button primary reply-btn-primary", { "sd-is-disabled": !hasTextContent.value || isV2WriteDisabled.value }]),
14259
14275
  onClick: withModifiers(($event) => handleCommentUpdate(comment), ["stop", "prevent"]),
14260
14276
  disabled: !hasTextContent.value || isV2WriteDisabled.value,
14261
14277
  "data-disabled-reason": isV2WriteDisabled.value ? v2WriteCapability.value?.reason ?? null : null
14262
- }, " Update ", 10, _hoisted_42)])])),
14278
+ }, " Update ", 10, _hoisted_44)])])),
14263
14279
  shouldTruncate.value && isTextOverflowing.value && index === 0 && !isEditingThisComment.value(comment) ? (openBlock(), createElementBlock("div", {
14264
14280
  key: 3,
14265
14281
  class: "show-more-toggle",
@@ -14271,20 +14287,20 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
14271
14287
  onClick: withModifiers(toggleTruncation, ["stop", "prevent"])
14272
14288
  }, " Show less ")) : createCommentVNode("", true)
14273
14289
  ])) : createCommentVNode("", true),
14274
- shouldCollapseThread.value && index === 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [_cache[12] || (_cache[12] = createElementVNode("div", { class: "comment-separator" }, null, -1)), createElementVNode("div", {
14290
+ shouldCollapseThread.value && index === 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [_cache[14] || (_cache[14] = createElementVNode("div", { class: "comment-separator" }, null, -1)), createElementVNode("div", {
14275
14291
  class: "collapsed-replies",
14276
14292
  onClick: withModifiers(expandThread, ["stop", "prevent"])
14277
- }, [createElementVNode("div", _hoisted_43, [(openBlock(true), createElementBlock(Fragment, null, renderList(collapsedReplyAuthors.value, (author) => {
14293
+ }, [createElementVNode("div", _hoisted_45, [(openBlock(true), createElementBlock(Fragment, null, renderList(collapsedReplyAuthors.value, (author) => {
14278
14294
  return openBlock(), createBlock(Avatar_default, {
14279
14295
  key: author.email || author.name,
14280
14296
  user: author,
14281
14297
  class: "mini-avatar"
14282
14298
  }, null, 8, ["user"]);
14283
14299
  }), 128))]), createElementVNode("span", null, toDisplayString(collapsedReplyCount.value) + " more " + toDisplayString(collapsedReplyCount.value === 1 ? "reply" : "replies"), 1)])], 64)) : createCommentVNode("", true),
14284
- showSeparator.value(index) ? (openBlock(), createElementBlock("div", _hoisted_44)) : createCommentVNode("", true)
14300
+ showSeparator.value(index) ? (openBlock(), createElementBlock("div", _hoisted_46)) : createCommentVNode("", true)
14285
14301
  ]);
14286
14302
  }), 128)),
14287
- trackedChangeDecisionFailure.value ? (openBlock(), createElementBlock("div", _hoisted_45, [createElementVNode("span", _hoisted_46, toDisplayString(trackedChangeDecisionFailureMessage.value), 1), createElementVNode("button", {
14303
+ trackedChangeDecisionFailure.value ? (openBlock(), createElementBlock("div", _hoisted_47, [createElementVNode("span", _hoisted_48, toDisplayString(trackedChangeDecisionFailureMessage.value), 1), createElementVNode("button", {
14288
14304
  type: "button",
14289
14305
  class: "sd-button tracked-change-decision-alert__retry",
14290
14306
  onClick: withModifiers(retryTrackedChangeDecision, ["stop", "prevent"])
@@ -14296,7 +14312,7 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
14296
14312
  onClick: withModifiers(startReply, ["stop", "prevent"]),
14297
14313
  disabled: isV2WriteDisabled.value,
14298
14314
  "data-disabled-reason": isV2WriteDisabled.value ? v2WriteCapability.value?.reason ?? null : null
14299
- }, " Reply or add others with @ ", 10, _hoisted_47)) : (openBlock(), createElementBlock("div", _hoisted_48, [createElementVNode("div", _hoisted_49, [createVNode(CommentInput_default, {
14315
+ }, " Reply or add others with @ ", 10, _hoisted_49)) : (openBlock(), createElementBlock("div", _hoisted_50, [createElementVNode("div", _hoisted_51, [createVNode(CommentInput_default, {
14300
14316
  ref_key: "commentInput",
14301
14317
  ref: commentInput,
14302
14318
  users: usersFiltered.value,
@@ -14307,7 +14323,7 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
14307
14323
  "users",
14308
14324
  "config",
14309
14325
  "comment"
14310
- ])]), createElementVNode("div", _hoisted_50, [createElementVNode("button", {
14326
+ ])]), createElementVNode("div", _hoisted_52, [createElementVNode("button", {
14311
14327
  class: "sd-button reply-btn-cancel",
14312
14328
  onClick: withModifiers(handleCancel, ["stop", "prevent"])
14313
14329
  }, "Cancel"), createElementVNode("button", {
@@ -14315,11 +14331,11 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
14315
14331
  onClick: withModifiers(handleAddComment, ["stop", "prevent"]),
14316
14332
  disabled: !hasTextContent.value || isV2WriteDisabled.value || isSubmittingReply.value,
14317
14333
  "data-disabled-reason": v2ReplyDisabledReason.value
14318
- }, " Reply ", 10, _hoisted_51)])]))], 64)) : createCommentVNode("", true)
14334
+ }, " Reply ", 10, _hoisted_53)])]))], 64)) : createCommentVNode("", true)
14319
14335
  ], 64))], 14, _hoisted_1$27)), [[_directive_click_outside, handleClickOutside]]);
14320
14336
  };
14321
14337
  }
14322
- }, [["__scopeId", "data-v-bc46ac97"]]);
14338
+ }, [["__scopeId", "data-v-eefd4750"]]);
14323
14339
  //#endregion
14324
14340
  //#region src/components/CommentsLayer/commentsList/ReviewDirectoryListItem.vue
14325
14341
  var _hoisted_1$26 = [
@@ -22135,6 +22151,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
22135
22151
  if (!documentId) return;
22136
22152
  clearV2CommandShortcutBinding(documentId);
22137
22153
  if (typeof bindEditShortcuts !== "function") return;
22154
+ getSuperDocUI();
22138
22155
  const openLinkWorkflow = resolveV2LinkWorkflowOpener();
22139
22156
  const unbind = bindEditShortcuts({
22140
22157
  commandRoute: {
@@ -24479,7 +24496,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
24479
24496
  ], 38);
24480
24497
  };
24481
24498
  }
24482
- }, [["__scopeId", "data-v-7bbf01da"]]);
24499
+ }, [["__scopeId", "data-v-e476c448"]]);
24483
24500
  //#endregion
24484
24501
  //#region src/core/create-app.js
24485
24502
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -40494,6 +40511,7 @@ var ToolbarComboBox_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
40494
40511
  ref_key: "popupRef",
40495
40512
  ref: popupRef,
40496
40513
  role: "listbox",
40514
+ "data-sd-part": "dropdown-menu",
40497
40515
  id: listboxId.value,
40498
40516
  "aria-label": ariaLabel.value,
40499
40517
  class: normalizeClass(["sd-font-combobox__listbox", { "high-contrast": unref(isHighContrastMode) }]),
@@ -40522,7 +40540,7 @@ var ToolbarComboBox_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
40522
40540
  ], 14, _hoisted_1$12);
40523
40541
  };
40524
40542
  }
40525
- }, [["__scopeId", "data-v-53e0af20"]]);
40543
+ }, [["__scopeId", "data-v-e288ef9f"]]);
40526
40544
  //#endregion
40527
40545
  //#region src/internal/toolbar/built-in/FontFamilyCombobox.vue
40528
40546
  var _sfc_main$14 = {
@@ -41558,10 +41576,9 @@ var Toolbar_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
41558
41576
  });
41559
41577
  const showLeftSide = proxy.$toolbar.config?.toolbarGroups?.includes("left");
41560
41578
  const showRightSide = proxy.$toolbar.config?.toolbarGroups?.includes("right");
41561
- const excludeButtonsList = proxy.$toolbar.config?.toolbarButtonsExclude || [];
41562
41579
  const getFilteredItems = (position) => {
41563
41580
  toolbarStateVersion.value;
41564
- return proxy.$toolbar.getToolbarItemByGroup(position).filter((item) => !excludeButtonsList.includes(item.name.value));
41581
+ return proxy.$toolbar.getToolbarItemByGroup(position);
41565
41582
  };
41566
41583
  const updateCompactSideGroups = () => {
41567
41584
  compactSideGroups.value = proxy.$toolbar.getAvailableWidth() <= RESPONSIVE_BREAKPOINTS.lg;
@@ -41735,7 +41752,7 @@ var Toolbar_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
41735
41752
  ], 32);
41736
41753
  };
41737
41754
  }
41738
- }, [["__scopeId", "data-v-9418cc7d"]]);
41755
+ }, [["__scopeId", "data-v-0d00bc5b"]]);
41739
41756
  //#endregion
41740
41757
  //#region src/internal/toolbar/built-in/font-options.js
41741
41758
  /**
@@ -43477,6 +43494,35 @@ var getToolbarItemWidth = (item, controlSizes) => {
43477
43494
  if (item.type === "separator") return controlSizes.get("separator");
43478
43495
  return controlSizes.get(item.name.value) || controlSizes.get("default");
43479
43496
  };
43497
+ var collapseSeparatorRun = (items) => {
43498
+ const result = [];
43499
+ for (const item of items) {
43500
+ if (item.type === "separator") {
43501
+ const previous = result[result.length - 1];
43502
+ if (!previous || previous.type === "separator") continue;
43503
+ }
43504
+ result.push(item);
43505
+ }
43506
+ while (result.length && result[result.length - 1].type === "separator") result.pop();
43507
+ return result;
43508
+ };
43509
+ var normalizeSeparators = (items) => {
43510
+ const byGroup = /* @__PURE__ */ new Map();
43511
+ for (const item of items) {
43512
+ const group = item.group?.value || "center";
43513
+ if (!byGroup.has(group)) byGroup.set(group, []);
43514
+ byGroup.get(group).push(item);
43515
+ }
43516
+ const kept = /* @__PURE__ */ new Set();
43517
+ for (const groupItems of byGroup.values()) for (const item of collapseSeparatorRun(groupItems)) kept.add(item);
43518
+ return items.filter((item) => kept.has(item));
43519
+ };
43520
+ var normalizeSeparatorsIgnoringOverflow = (items) => {
43521
+ const overflowTrigger = items.find((item) => item.type === "overflow");
43522
+ const withoutOverflow = items.filter((item) => item !== overflowTrigger);
43523
+ const kept = new Set(normalizeSeparators(withoutOverflow));
43524
+ return items.filter((item) => item === overflowTrigger || kept.has(item));
43525
+ };
43480
43526
  /**
43481
43527
  * Set or clear the link item's `href` without disturbing the rest of its
43482
43528
  * attributes. The static configuration (`ariaLabel`, and anything added later)
@@ -43531,7 +43577,7 @@ function hasAiModule(superToolbar) {
43531
43577
  function aiModuleConfig(superToolbar) {
43532
43578
  return superToolbar.config?.superdoc?.config?.modules?.ai ?? superToolbar.superdoc?.config?.modules?.ai ?? {};
43533
43579
  }
43534
- var makeDefaultItems = ({ superToolbar, toolbarIcons, toolbarTexts, toolbarFonts, hideButtons, availableWidth, role, isDev = false, configuredItemNames, excludedItemNames, additionalItems = [] } = {}) => {
43580
+ var makeDefaultItems = ({ superToolbar, toolbarIcons, toolbarTexts, toolbarFonts, hideButtons, availableWidth, role, isDev = false, configuredItemNames, configuredItemOrder, excludedItemNames, additionalItems = [] } = {}) => {
43535
43581
  const bold = useToolbarItem({
43536
43582
  type: "button",
43537
43583
  name: "bold",
@@ -44641,9 +44687,15 @@ var makeDefaultItems = ({ superToolbar, toolbarIcons, toolbarTexts, toolbarFonts
44641
44687
  }
44642
44688
  if (configuredItemNames) toolbarItems = toolbarItems.filter((item) => item.name.value === "overflow" || item.isCustomToolbarItem || configuredItemNames.has(item.name.value));
44643
44689
  if (excludedItemNames?.size) toolbarItems = toolbarItems.filter((item) => !excludedItemNames.has(item.name.value));
44690
+ toolbarItems = normalizeSeparatorsIgnoringOverflow(toolbarItems);
44644
44691
  const isStickyItem = (item) => stickyItemNames.includes(item.name.value);
44645
44692
  const overflowTrigger = toolbarItems.find((item) => item.name.value === "overflow");
44646
44693
  const layoutItems = toolbarItems.filter((item) => item !== overflowTrigger);
44694
+ if (configuredItemOrder) {
44695
+ const orderIndex = new Map(configuredItemOrder.map((name, index) => [name, index]));
44696
+ const rank = (item) => orderIndex.get(item.name.value) ?? Number.MAX_SAFE_INTEGER;
44697
+ layoutItems.sort((a, b) => rank(a) - rank(b));
44698
+ }
44647
44699
  const partitionItems = (reserveOverflowTrigger) => {
44648
44700
  const overflowItems = [];
44649
44701
  const visibleItems = [];
@@ -44685,6 +44737,7 @@ var makeDefaultItems = ({ superToolbar, toolbarIcons, toolbarTexts, toolbarFonts
44685
44737
  if (insertAt === -1) visibleItems.push(overflowTrigger);
44686
44738
  else visibleItems.splice(insertAt, 0, overflowTrigger);
44687
44739
  }
44740
+ visibleItems = normalizeSeparators(visibleItems);
44688
44741
  return {
44689
44742
  defaultItems: visibleItems,
44690
44743
  overflowItems: overflowItems.filter((item) => item.type !== "separator")
@@ -44905,6 +44958,7 @@ var BuiltInToolbar = class extends import_eventemitter3.default {
44905
44958
  responsiveToContainer: false,
44906
44959
  mode: "docx",
44907
44960
  excludeItems: [],
44961
+ toolbarButtonsExclude: [],
44908
44962
  groups: null,
44909
44963
  customButtons: [],
44910
44964
  showFormattingMarksButton: false,
@@ -45070,7 +45124,7 @@ var BuiltInToolbar = class extends import_eventemitter3.default {
45070
45124
  const selectedCustomOptions = new Map(this.#getAllToolbarItems().filter((item) => item.isCustomToolbarItem && item.type === "dropdown").map((item) => [item.name.value, item.selectedValue.value]));
45071
45125
  const hasExplicitGroupComposition = this.config.groups && !Array.isArray(this.config.groups) && Object.keys(this.config.groups).length > 0;
45072
45126
  const configuredItemNames = hasExplicitGroupComposition ? new Set(Object.values(this.config.groups).flatMap((items) => items)) : null;
45073
- const excludedItemNames = new Set(this.config.excludeItems);
45127
+ const excludedItemNames = /* @__PURE__ */ new Set([...this.config.excludeItems ?? [], ...this.config.toolbarButtonsExclude ?? []]);
45074
45128
  const customItems = this.config.customButtons || [];
45075
45129
  const takenNames = new Set(RESERVED_TOOLBAR_ITEM_NAMES);
45076
45130
  const customToolbarItems = customItems.map((item, index) => {
@@ -45091,6 +45145,12 @@ var BuiltInToolbar = class extends import_eventemitter3.default {
45091
45145
  }).filter(Boolean);
45092
45146
  const configuredGroups = hasExplicitGroupComposition ? new Set(Object.keys(this.config.groups)) : null;
45093
45147
  const layoutCustomItems = configuredGroups ? customToolbarItems.filter((item) => configuredGroups.has(item.group?.value || "center")) : customToolbarItems;
45148
+ let allConfigItems = null;
45149
+ if (hasExplicitGroupComposition) {
45150
+ const groupedItems = Object.values(this.config.groups).flatMap((item) => item);
45151
+ const groupedCustomItems = customToolbarItems.filter((item) => configuredGroups.has(item.group?.value || "center")).map((item) => item.name.value);
45152
+ allConfigItems = [.../* @__PURE__ */ new Set([...groupedItems, ...groupedCustomItems])];
45153
+ }
45094
45154
  const { defaultItems, overflowItems } = makeDefaultItems({
45095
45155
  superToolbar: this,
45096
45156
  toolbarIcons: this.config.icons,
@@ -45101,18 +45161,29 @@ var BuiltInToolbar = class extends import_eventemitter3.default {
45101
45161
  role: this.role,
45102
45162
  isDev: this.isDev,
45103
45163
  configuredItemNames,
45164
+ configuredItemOrder: allConfigItems,
45104
45165
  excludedItemNames,
45105
45166
  additionalItems: layoutCustomItems
45106
45167
  });
45107
- let allConfigItems = [...defaultItems.map((item) => item.name.value), ...overflowItems.map((item) => item.name.value)];
45108
- if (hasExplicitGroupComposition) {
45109
- const groupedItems = Object.values(this.config.groups).flatMap((item) => item);
45110
- const groupedCustomItems = customToolbarItems.filter((item) => configuredGroups.has(item.group?.value || "center")).map((item) => item.name.value);
45111
- allConfigItems = [.../* @__PURE__ */ new Set([...groupedItems, ...groupedCustomItems])];
45112
- }
45168
+ if (!hasExplicitGroupComposition) allConfigItems = [...defaultItems.map((item) => item.name.value), ...overflowItems.map((item) => item.name.value)];
45113
45169
  const configuredOverflowItems = overflowItems.filter((item) => allConfigItems.includes(item.name.value) && !excludedItemNames.has(item.name.value));
45114
45170
  const visibleItemNames = configuredOverflowItems.length ? [...allConfigItems, "overflow"] : allConfigItems;
45115
45171
  const filteredItems = defaultItems.filter((item) => visibleItemNames.includes(item.name.value)).filter((item) => !excludedItemNames.has(item.name.value));
45172
+ if (hasExplicitGroupComposition) {
45173
+ const orderIndex = new Map(allConfigItems.map((name, index) => [name, index]));
45174
+ const rank = (item) => orderIndex.get(item.name.value) ?? Number.MAX_SAFE_INTEGER;
45175
+ const overflowTrigger = filteredItems.find((item) => item.name.value === "overflow");
45176
+ const originalIndex = new Map(filteredItems.map((item, index) => [item, index]));
45177
+ const reordered = filteredItems.filter((item) => item !== overflowTrigger);
45178
+ reordered.sort((a, b) => rank(a) - rank(b));
45179
+ if (overflowTrigger) {
45180
+ const triggerOriginalIndex = originalIndex.get(overflowTrigger);
45181
+ const insertAt = reordered.findIndex((item) => originalIndex.get(item) > triggerOriginalIndex);
45182
+ insertAt === -1 ? reordered.push(overflowTrigger) : reordered.splice(insertAt, 0, overflowTrigger);
45183
+ }
45184
+ filteredItems.splice(0, filteredItems.length, ...reordered);
45185
+ configuredOverflowItems.sort((a, b) => rank(a) - rank(b));
45186
+ }
45116
45187
  if (hasExplicitGroupComposition) {
45117
45188
  for (const [group, names] of Object.entries(this.config.groups)) for (const item of filteredItems) if (names.includes(item.name.value)) item.group.value = group;
45118
45189
  }
@@ -46212,7 +46283,7 @@ var SuperDoc = class extends import_eventemitter3.default {
46212
46283
  this.config.colors = shuffleArray(this.config.colors);
46213
46284
  this.userColorMap = /* @__PURE__ */ new Map();
46214
46285
  this.colorIndex = 0;
46215
- this.version = "2.20.0";
46286
+ this.version = "2.20.1-next.10";
46216
46287
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
46217
46288
  this.superdocId = config.superdocId || v4();
46218
46289
  this.colors = this.config.colors ?? [];