superdoc 2.28.0 → 2.29.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 (56) hide show
  1. package/dist/chunks/{PdfViewer-JHXZQZ9x.es.js → PdfViewer-D4lVeOJu.es.js} +3 -2
  2. package/dist/chunks/{PdfViewer-Cg072l5d.cjs → PdfViewer-boENOZdF.cjs} +3 -2
  3. package/dist/chunks/{create-super-doc-ui-BfgYblyI.cjs → create-super-doc-ui-0OA8hCNb.cjs} +201 -23
  4. package/dist/chunks/{create-super-doc-ui-BbjHD1ul.es.js → create-super-doc-ui-Duf65d0b.es.js} +180 -20
  5. package/dist/chunks/is-finite-number-BEXgTRgc.cjs +11 -0
  6. package/dist/chunks/is-finite-number-BpL4F38c.es.js +6 -0
  7. package/dist/collaboration-upgrade-engine.cjs +1 -1
  8. package/dist/collaboration-upgrade-engine.es.js +1 -1
  9. package/dist/document-api/src/capabilities/html-markdown-support.d.ts +3 -3
  10. package/dist/document-api/src/index.d.ts +1 -1
  11. package/dist/document-api/src/lists/lists.d.ts +79 -79
  12. package/dist/document-api/src/write/write.d.ts +10 -9
  13. package/dist/layout-engine/painters/dom/src/page-content.d.ts +1 -1
  14. package/dist/layout-engine/painters/dom/src/persistent-page-surface.d.ts +2 -0
  15. package/dist/public/ui-react.cjs +1 -1
  16. package/dist/public/ui-react.es.js +1 -1
  17. package/dist/public/ui-vue.cjs +1 -1
  18. package/dist/public/ui-vue.es.js +1 -1
  19. package/dist/public/ui.cjs +1 -1
  20. package/dist/public/ui.es.js +1 -1
  21. package/dist/style.css +1 -1
  22. package/dist/style.layered.css +1 -1
  23. package/dist/superdoc/src/SuperDoc.vue.d.ts +5 -3
  24. package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +1670 -24
  25. package/dist/superdoc/src/components/CommentsLayer/CommentHeader.vue.d.ts +2 -2
  26. package/dist/superdoc/src/components/CommentsLayer/CommentInput.vue.d.ts +2 -2
  27. package/dist/superdoc/src/components/CommentsLayer/FloatingComments.vue.d.ts +21 -8
  28. package/dist/superdoc/src/components/general/Avatar.vue.d.ts +7 -0
  29. package/dist/superdoc/src/components/surfaces/SurfaceDialog.vue.d.ts +27 -9
  30. package/dist/superdoc/src/components/surfaces/SurfaceExternalMount.vue.d.ts +53 -16
  31. package/dist/superdoc/src/composables/use-link-popover.d.ts +3 -3
  32. package/dist/superdoc/src/composables/use-superdoc-instance.d.ts +4 -1
  33. package/dist/superdoc/src/core/SuperDoc.d.ts +1 -1
  34. package/dist/superdoc/src/core/collaboration/permissions.d.ts +1 -0
  35. package/dist/superdoc/src/core/types/index.d.ts +9 -4
  36. package/dist/superdoc/src/helpers/is-finite-number.d.ts +1 -0
  37. package/dist/superdoc/src/internal/diagnostics/diagnostic-dedupe.d.ts +2 -2
  38. package/dist/superdoc/src/internal/toolbar/built-in/AIWriter.vue.d.ts +2 -2
  39. package/dist/superdoc/src/internal/toolbar/built-in/LinkInput.vue.d.ts +181 -36
  40. package/dist/superdoc/src/internal/toolbar/built-in/LinkedStyle.vue.d.ts +39 -10
  41. package/dist/superdoc/src/internal/toolbar/built-in/PageNumberMenu.vue.d.ts +133 -22
  42. package/dist/superdoc/src/internal/toolbar/built-in/SdTooltip.vue.d.ts +62 -23
  43. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButton.vue.d.ts +101 -16
  44. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButtonIcon.vue.d.ts +31 -10
  45. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarComboBox.vue.d.ts +82 -11
  46. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarDropdown.vue.d.ts +122 -33
  47. package/dist/superdoc/src/internal/toolbar/built-in/use-toolbar-item.d.ts +0 -1
  48. package/dist/superdoc/src/stores/comments-store.d.ts +151 -28
  49. package/dist/superdoc/src/stores/superdoc-store.d.ts +454 -85
  50. package/dist/superdoc.cjs +319 -401
  51. package/dist/superdoc.es.js +247 -330
  52. package/dist-cdn/style.layered.css +1 -1
  53. package/dist-cdn/superdoc.min.css +1 -1
  54. package/dist-cdn/superdoc.min.js +42 -42
  55. package/package.json +2 -2
  56. package/dist/superdoc/src/internal/toolbar/built-in/OverflowMenu.vue.d.ts +0 -104
@@ -1,4 +1,5 @@
1
1
  import { B as renderList, F as openBlock, N as onMounted, T as mergeProps, W as shallowRef, a as computed, c as createCommentVNode, j as onBeforeUnmount, k as normalizeStyle, l as createElementBlock, n as Fragment, p as createVNode, s as createBlock, t as _plugin_vue_export_helper_default, tt as watch, u as createElementVNode, w as markRaw, z as ref } from "./_plugin-vue_export-helper-CsJQtMvr.es.js";
2
+ import { t as isFiniteNumber } from "./is-finite-number-BpL4F38c.es.js";
2
3
  import { t as PDF_TO_CSS_UNITS } from "./constants-B6VBlmKp.es.js";
3
4
  //#region src/core/pdf/helpers/floor.js
4
5
  var floor = (val, precision) => {
@@ -495,7 +496,7 @@ var PdfViewer_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
495
496
  const documentRef = ref(null);
496
497
  const pdf = ref(null);
497
498
  const pages = ref([]);
498
- const scale = ref(typeof props.initialScale === "number" && Number.isFinite(props.initialScale) && props.initialScale > 0 ? floor(props.initialScale, 2) : 1);
499
+ const scale = ref(isFiniteNumber(props.initialScale) && props.initialScale > 0 ? floor(props.initialScale, 2) : 1);
499
500
  const totalPages = ref(0);
500
501
  const renderedPages = ref(0);
501
502
  const hasTextLayer = computed(() => props.config?.textLayer === true);
@@ -609,6 +610,6 @@ var PdfViewer_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
609
610
  }), null, 16)])], 512);
610
611
  };
611
612
  }
612
- }, [["__scopeId", "data-v-05c9d9b5"]]);
613
+ }, [["__scopeId", "data-v-8708fac2"]]);
613
614
  //#endregion
614
615
  export { PdfViewer_default as default };
@@ -1,4 +1,5 @@
1
1
  const require__plugin_vue_export_helper = require("./_plugin-vue_export-helper-6MBoygIY.cjs");
2
+ const require_is_finite_number = require("./is-finite-number-BEXgTRgc.cjs");
2
3
  const require_constants = require("./constants-DpXuDx_g.cjs");
3
4
  //#region src/core/pdf/helpers/floor.js
4
5
  var floor = (val, precision) => {
@@ -499,7 +500,7 @@ var _sfc_main = {
499
500
  const documentRef = require__plugin_vue_export_helper.ref(null);
500
501
  const pdf = require__plugin_vue_export_helper.ref(null);
501
502
  const pages = require__plugin_vue_export_helper.ref([]);
502
- const scale = require__plugin_vue_export_helper.ref(typeof props.initialScale === "number" && Number.isFinite(props.initialScale) && props.initialScale > 0 ? floor(props.initialScale, 2) : 1);
503
+ const scale = require__plugin_vue_export_helper.ref(require_is_finite_number.isFiniteNumber(props.initialScale) && props.initialScale > 0 ? floor(props.initialScale, 2) : 1);
503
504
  const totalPages = require__plugin_vue_export_helper.ref(0);
504
505
  const renderedPages = require__plugin_vue_export_helper.ref(0);
505
506
  const hasTextLayer = require__plugin_vue_export_helper.computed(() => props.config?.textLayer === true);
@@ -614,6 +615,6 @@ var _sfc_main = {
614
615
  };
615
616
  }
616
617
  };
617
- var PdfViewer_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main, [["__scopeId", "data-v-05c9d9b5"]]);
618
+ var PdfViewer_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main, [["__scopeId", "data-v-8708fac2"]]);
618
619
  //#endregion
619
620
  exports.default = PdfViewer_default;
@@ -1,4 +1,5 @@
1
1
  const require__plugin_vue_export_helper = require("./_plugin-vue_export-helper-6MBoygIY.cjs");
2
+ const require_is_finite_number = require("./is-finite-number-BEXgTRgc.cjs");
2
3
  //#region src/internal/diagnostics/workflow-recording.ts
3
4
  var fields$1 = /* @__PURE__ */ new Set([
4
5
  "documentId",
@@ -1096,6 +1097,163 @@ function isPlainObject(value) {
1096
1097
  return typeof value === "object" && value !== null && !Array.isArray(value);
1097
1098
  }
1098
1099
  //#endregion
1100
+ //#region src/core/collaboration/permissions.js
1101
+ var PERMISSIONS = Object.freeze({
1102
+ RESOLVE_OWN: "RESOLVE_OWN",
1103
+ RESOLVE_OTHER: "RESOLVE_OTHER",
1104
+ REJECT_OWN: "REJECT_OWN",
1105
+ REJECT_OTHER: "REJECT_OTHER",
1106
+ COMMENTS_OVERFLOW_OWN: "COMMENTS_OVERFLOW",
1107
+ COMMENTS_OVERFLOW_OTHER: "COMMENTS_OVERFLOW_OTHER",
1108
+ COMMENTS_DELETE_OWN: "COMMENTS_DELETE_OWN",
1109
+ COMMENTS_DELETE_OTHER: "COMMENTS_DELETE_OTHER",
1110
+ UPLOAD_VERSION: "UPLOAD_VERSION",
1111
+ VERSION_HISTORY: "VERSION_HISTORY"
1112
+ });
1113
+ var ROLES = Object.freeze({
1114
+ EDITOR: "editor",
1115
+ SUGGESTER: "suggester",
1116
+ VIEWER: "viewer"
1117
+ });
1118
+ var PERMISSION_MATRIX = Object.freeze({
1119
+ [PERMISSIONS.RESOLVE_OWN]: {
1120
+ internal: [ROLES.EDITOR],
1121
+ external: [ROLES.EDITOR]
1122
+ },
1123
+ [PERMISSIONS.RESOLVE_OTHER]: {
1124
+ internal: [ROLES.EDITOR],
1125
+ external: [ROLES.EDITOR]
1126
+ },
1127
+ [PERMISSIONS.REJECT_OWN]: {
1128
+ internal: [ROLES.EDITOR, ROLES.SUGGESTER],
1129
+ external: [ROLES.EDITOR, ROLES.SUGGESTER]
1130
+ },
1131
+ [PERMISSIONS.REJECT_OTHER]: {
1132
+ internal: [ROLES.EDITOR],
1133
+ external: [ROLES.EDITOR]
1134
+ },
1135
+ [PERMISSIONS.COMMENTS_OVERFLOW_OWN]: {
1136
+ internal: [ROLES.EDITOR, ROLES.SUGGESTER],
1137
+ external: [ROLES.EDITOR, ROLES.SUGGESTER]
1138
+ },
1139
+ [PERMISSIONS.COMMENTS_OVERFLOW_OTHER]: {
1140
+ internal: [ROLES.EDITOR],
1141
+ external: [ROLES.EDITOR]
1142
+ },
1143
+ [PERMISSIONS.COMMENTS_DELETE_OWN]: {
1144
+ internal: [ROLES.EDITOR, ROLES.SUGGESTER],
1145
+ external: [ROLES.EDITOR, ROLES.SUGGESTER]
1146
+ },
1147
+ [PERMISSIONS.COMMENTS_DELETE_OTHER]: {
1148
+ internal: [ROLES.EDITOR],
1149
+ external: [ROLES.EDITOR]
1150
+ },
1151
+ [PERMISSIONS.UPLOAD_VERSION]: {
1152
+ internal: [ROLES.EDITOR],
1153
+ external: []
1154
+ },
1155
+ [PERMISSIONS.VERSION_HISTORY]: {
1156
+ internal: [ROLES.EDITOR],
1157
+ external: []
1158
+ }
1159
+ });
1160
+ var pickResolver = (context = {}) => {
1161
+ if (typeof context.permissionResolver === "function") return context.permissionResolver;
1162
+ if (typeof context.superdoc?.config?.permissionResolver === "function") return context.superdoc.config.permissionResolver;
1163
+ const deprecatedResolver = context.superdoc?.config?.modules?.comments?.permissionResolver;
1164
+ if (typeof deprecatedResolver === "function") return deprecatedResolver;
1165
+ return null;
1166
+ };
1167
+ var BUILT_IN_PERMISSION_METHOD = Symbol.for("superdoc.internal.permission-method.builtin");
1168
+ var BUILT_IN_PERMISSION_RESOLVER = Symbol.for("superdoc.internal.permission-resolver.builtin");
1169
+ /** Create the shell's internal, live tracked-change permission shim. */
1170
+ var createTrackedChangePermissionResolver = (superdoc) => {
1171
+ const isBuiltInPolicy = () => superdoc.canPerformPermission?.[BUILT_IN_PERMISSION_METHOD] === true && pickResolver({ superdoc }) === null;
1172
+ const resolver = (payload = {}) => isBuiltInPolicy() ? defaultDecisionFor(payload.permission, superdoc.config.role, superdoc.config.isInternal) : superdoc.canPerformPermission({
1173
+ ...payload,
1174
+ role: superdoc.config.role,
1175
+ isInternal: superdoc.config.isInternal
1176
+ });
1177
+ Object.defineProperty(resolver, BUILT_IN_PERMISSION_RESOLVER, { value: isBuiltInPolicy });
1178
+ return resolver;
1179
+ };
1180
+ var defaultDecisionFor = (permission, role, isInternal) => {
1181
+ const internalExternal = isInternal ? "internal" : "external";
1182
+ return PERMISSION_MATRIX[permission]?.[internalExternal]?.includes(role) ?? false;
1183
+ };
1184
+ var NON_DATA_PERMISSION_PROPERTY = Symbol();
1185
+ var readPermissionDataProperty = (source, key) => {
1186
+ if (source == null) return void 0;
1187
+ if (typeof source !== "object" && typeof source !== "function") return NON_DATA_PERMISSION_PROPERTY;
1188
+ for (let owner = source; owner !== null; owner = Object.getPrototypeOf(owner)) {
1189
+ const descriptor = Object.getOwnPropertyDescriptor(owner, key);
1190
+ if (descriptor) return "value" in descriptor ? descriptor.value : NON_DATA_PERMISSION_PROPERTY;
1191
+ }
1192
+ };
1193
+ var readBuiltInTrackedChangePermissionDecision = (superdoc, canPerform, permission, trackedChange) => {
1194
+ try {
1195
+ if (readPermissionDataProperty(superdoc, "canPerformPermission") !== canPerform || readPermissionDataProperty(canPerform, BUILT_IN_PERMISSION_METHOD) !== true) return null;
1196
+ const config = readPermissionDataProperty(superdoc, "config");
1197
+ if (!config || typeof config !== "object") return null;
1198
+ const role = readPermissionDataProperty(config, "role");
1199
+ const isInternal = readPermissionDataProperty(config, "isInternal");
1200
+ const user = readPermissionDataProperty(config, "user");
1201
+ const resolver = readPermissionDataProperty(config, "permissionResolver");
1202
+ const modules = readPermissionDataProperty(config, "modules");
1203
+ const comments = readPermissionDataProperty(modules, "comments");
1204
+ const deprecatedResolver = readPermissionDataProperty(comments, "permissionResolver");
1205
+ const commentsStore = readPermissionDataProperty(superdoc, "commentsStore");
1206
+ if ([
1207
+ role,
1208
+ isInternal,
1209
+ user,
1210
+ resolver,
1211
+ modules,
1212
+ comments,
1213
+ deprecatedResolver,
1214
+ commentsStore,
1215
+ readPermissionDataProperty(commentsStore, "getComment"),
1216
+ readPermissionDataProperty(trackedChange, "comment"),
1217
+ readPermissionDataProperty(trackedChange, "commentId"),
1218
+ readPermissionDataProperty(trackedChange, "id")
1219
+ ].includes(NON_DATA_PERMISSION_PROPERTY) || typeof resolver === "function" || typeof deprecatedResolver === "function") return null;
1220
+ return defaultDecisionFor(permission, role, isInternal);
1221
+ } catch {
1222
+ return null;
1223
+ }
1224
+ };
1225
+ /**
1226
+ * Resolve a client-side permission through the built-in matrix and optional
1227
+ * resolver.
1228
+ *
1229
+ * @param {string} permission The permission to check
1230
+ * @param {string} role The role to check
1231
+ * @param {boolean} isInternal The internal/external flag
1232
+ * @param {object} [context] Context passed to the permission resolver
1233
+ * @param {object | null} [context.comment] The comment/tracked change being evaluated
1234
+ * @param {object | null} [context.superdoc] The SuperDoc instance
1235
+ * @param {object | null} [context.currentUser] The active user object performing the action
1236
+ * @param {Function} [context.permissionResolver] Explicit resolver override
1237
+ * @param {object | null} [context.trackedChange] Tracked change metadata (for tracked-change permissions)
1238
+ * @returns {boolean} Whether the permission is allowed
1239
+ */
1240
+ var isAllowed = (permission, role, isInternal, context = {}) => {
1241
+ const defaultDecision = defaultDecisionFor(permission, role, isInternal);
1242
+ const resolver = pickResolver(context);
1243
+ if (typeof resolver !== "function") return defaultDecision;
1244
+ const decision = resolver({
1245
+ permission,
1246
+ role,
1247
+ isInternal,
1248
+ defaultDecision,
1249
+ comment: context.comment ?? null,
1250
+ currentUser: context.currentUser ?? context.superdoc?.config?.user ?? null,
1251
+ superdoc: context.superdoc ?? null,
1252
+ trackedChange: context.trackedChange ?? null
1253
+ });
1254
+ return typeof decision === "boolean" ? decision : defaultDecision;
1255
+ };
1256
+ //#endregion
1099
1257
  //#region src/public/ui/viewport-batch.ts
1100
1258
  /** No rendering or scrolling: read only geometry already acknowledged by the host. */
1101
1259
  async function readViewportBatch(input, read, generation, disposed) {
@@ -2496,7 +2654,7 @@ function toStyleValue(key, value) {
2496
2654
  case "italic": return value === true;
2497
2655
  case "underline": return underlineValue(value);
2498
2656
  case "color": return typeof value === "string" && value.length > 0 ? { val: value.replace(/^#/, "") } : null;
2499
- case "fontSize": return typeof value === "number" && Number.isFinite(value) ? Math.round(value * 2) : null;
2657
+ case "fontSize": return require_is_finite_number.isFiniteNumber(value) ? Math.round(value * 2) : null;
2500
2658
  case "rFonts": return fontsValue(value);
2501
2659
  default: return null;
2502
2660
  }
@@ -2988,7 +3146,7 @@ function normalizeZoomPayload(payload) {
2988
3146
  if (!Number.isFinite(parsed)) return payload;
2989
3147
  return normalizeNumber(parsed, isPercent);
2990
3148
  }
2991
- if (typeof payload === "number" && Number.isFinite(payload)) return normalizeNumber(payload, false);
3149
+ if (require_is_finite_number.isFiniteNumber(payload)) return normalizeNumber(payload, false);
2992
3150
  return payload;
2993
3151
  }
2994
3152
  /**
@@ -5358,9 +5516,6 @@ var PARAGRAPH_INDENT_STEP_TWIPS = 720;
5358
5516
  function pointsToTwips(value) {
5359
5517
  return Math.round(value * 20);
5360
5518
  }
5361
- function isFiniteNumber(value) {
5362
- return typeof value === "number" && Number.isFinite(value);
5363
- }
5364
5519
  function readParagraphIndentationFromResult(result) {
5365
5520
  if (!result || typeof result !== "object") return null;
5366
5521
  const node = result.node;
@@ -5371,10 +5526,10 @@ function readParagraphIndentationFromResult(result) {
5371
5526
  const props = paragraphPayload.props;
5372
5527
  const indent = resolved?.indent ?? props?.indent;
5373
5528
  if (!indent || typeof indent !== "object") return null;
5374
- const left = isFiniteNumber(indent.left) ? pointsToTwips(indent.left) : isFiniteNumber(indent.start) ? pointsToTwips(indent.start) : void 0;
5375
- const right = isFiniteNumber(indent.right) ? pointsToTwips(indent.right) : isFiniteNumber(indent.end) ? pointsToTwips(indent.end) : void 0;
5376
- const firstLine = isFiniteNumber(indent.firstLine) ? pointsToTwips(indent.firstLine) : void 0;
5377
- const hanging = isFiniteNumber(indent.hanging) ? pointsToTwips(indent.hanging) : void 0;
5529
+ const left = require_is_finite_number.isFiniteNumber(indent.left) ? pointsToTwips(indent.left) : require_is_finite_number.isFiniteNumber(indent.start) ? pointsToTwips(indent.start) : void 0;
5530
+ const right = require_is_finite_number.isFiniteNumber(indent.right) ? pointsToTwips(indent.right) : require_is_finite_number.isFiniteNumber(indent.end) ? pointsToTwips(indent.end) : void 0;
5531
+ const firstLine = require_is_finite_number.isFiniteNumber(indent.firstLine) ? pointsToTwips(indent.firstLine) : void 0;
5532
+ const hanging = require_is_finite_number.isFiniteNumber(indent.hanging) ? pointsToTwips(indent.hanging) : void 0;
5378
5533
  if (left == null && right == null && firstLine == null && hanging == null) return null;
5379
5534
  return {
5380
5535
  ...left != null ? { left } : {},
@@ -5664,7 +5819,7 @@ function normalizeLayoutFontFamily(value) {
5664
5819
  }
5665
5820
  /** Convert a resolved run font size in CSS px to the toolbar's point value (SD-3652). */
5666
5821
  function normalizeLayoutFontSizePt(value) {
5667
- if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return void 0;
5822
+ if (!require_is_finite_number.isFiniteNumber(value) || value <= 0) return void 0;
5668
5823
  const pt = Math.round(value * .75 * 2) / 2;
5669
5824
  if (pt <= 0) return void 0;
5670
5825
  return String(pt);
@@ -6402,7 +6557,7 @@ function createSuperDocUI(options) {
6402
6557
  if (!pending || !(method in pending)) return void 0;
6403
6558
  const value = pending[method];
6404
6559
  if (typeof value === "string" && value !== "") return value;
6405
- if (typeof value === "number" && Number.isFinite(value)) return String(value);
6560
+ if (require_is_finite_number.isFiniteNumber(value)) return String(value);
6406
6561
  };
6407
6562
  /** Record / clear the stored inline mark for a collapsed-caret pick (SD-3654/SD-3652). */
6408
6563
  const setPendingInlineFormatOnHost = (method, value) => {
@@ -8800,9 +8955,10 @@ function createSuperDocUI(options) {
8800
8955
  for (const candidate of permissions) {
8801
8956
  let allowed;
8802
8957
  try {
8803
- allowed = canPerform.call(superdoc, {
8958
+ const permissionChange = trackedChange ?? { id };
8959
+ allowed = readBuiltInTrackedChangePermissionDecision(superdoc, canPerform, candidate, permissionChange) ?? canPerform.call(superdoc, {
8804
8960
  permission: candidate,
8805
- trackedChange: trackedChange ?? { id },
8961
+ trackedChange: permissionChange,
8806
8962
  comment: null
8807
8963
  });
8808
8964
  } catch {
@@ -9695,7 +9851,7 @@ function createSuperDocUI(options) {
9695
9851
  };
9696
9852
  /** Validate normalized payloads before invoking public SuperDoc-instance methods. */
9697
9853
  const instanceCommandPayloadIsValid = (descriptor, payload) => {
9698
- if (descriptor.id === "zoom") return typeof payload === "number" && Number.isFinite(payload) && payload > 0;
9854
+ if (descriptor.id === "zoom") return require_is_finite_number.isFiniteNumber(payload) && payload > 0;
9699
9855
  if (descriptor.id === "document-mode") return payload === "editing" || payload === "suggesting" || payload === "viewing";
9700
9856
  if (descriptor.id === "measurement-unit") return payload === "in" || payload === "cm";
9701
9857
  return true;
@@ -10083,7 +10239,7 @@ function createSuperDocUI(options) {
10083
10239
  const familyValue = state.toolbar.commands["font-family"]?.value;
10084
10240
  const sizeValue = state.toolbar.commands["font-size"]?.value;
10085
10241
  const hadFamily = typeof familyValue === "string" && familyValue.length > 0;
10086
- const hadSize = typeof sizeValue === "string" && sizeValue.length > 0 || typeof sizeValue === "number" && Number.isFinite(sizeValue);
10242
+ const hadSize = typeof sizeValue === "string" && sizeValue.length > 0 || require_is_finite_number.isFiniteNumber(sizeValue);
10087
10243
  return hadFamily && projected.fontFamily === void 0 || hadSize && projected.fontSize === void 0;
10088
10244
  };
10089
10245
  const syncHostSelectionSubscription = () => {
@@ -12277,12 +12433,6 @@ function createSuperDocUI(options) {
12277
12433
  keys: [...EFFECTIVE_INLINE_UNIFORMITY_KEYS, "highlight"],
12278
12434
  includeCaret: true
12279
12435
  } : null);
12280
- if (effective?.fontFamily?.state === "mixed") {
12281
- delete inlinePatch.fontFamily;
12282
- delete inlinePatch.rFonts;
12283
- mixedInlineKeys.add("fontFamily");
12284
- mixedInlineKeys.add("rFonts");
12285
- }
12286
12436
  for (const [markName, patchKey] of Object.entries(MARK_TO_PATCH)) {
12287
12437
  const entry = effective?.[markName];
12288
12438
  if (!entry) continue;
@@ -12294,6 +12444,16 @@ function createSuperDocUI(options) {
12294
12444
  mixedInlineKeys.add(patchKey);
12295
12445
  }
12296
12446
  }
12447
+ const fontFamily = effective?.fontFamily;
12448
+ if (fontFamily?.state === "uniform" && typeof fontFamily.value === "string") {
12449
+ inlinePatch.fontFamily = fontFamily.value;
12450
+ mixedInlineKeys.delete("fontFamily");
12451
+ } else if (fontFamily) {
12452
+ delete inlinePatch.fontFamily;
12453
+ delete inlinePatch.rFonts;
12454
+ mixedInlineKeys.add("fontFamily");
12455
+ mixedInlineKeys.add("rFonts");
12456
+ }
12297
12457
  const highlight = effective?.highlight;
12298
12458
  if (highlight?.state === "uniform") {
12299
12459
  inlinePatch.highlight = highlight.value;
@@ -13915,7 +14075,7 @@ function createSuperDocUI(options) {
13915
14075
  return null;
13916
14076
  };
13917
14077
  const pointHitElements = (x, y) => {
13918
- if (typeof x !== "number" || typeof y !== "number" || !Number.isFinite(x) || !Number.isFinite(y)) return null;
14078
+ if (!require_is_finite_number.isFiniteNumber(x) || !require_is_finite_number.isFiniteNumber(y)) return null;
13919
14079
  const dom = globalThis.document;
13920
14080
  if (!dom || typeof dom.elementFromPoint !== "function") return null;
13921
14081
  const container = resolveVisibleHost();
@@ -14693,7 +14853,7 @@ function createSuperDocUI(options) {
14693
14853
  const record = result && typeof result === "object" ? result : null;
14694
14854
  if (!record) return null;
14695
14855
  const matches = Array.isArray(record.matches) ? record.matches : [];
14696
- const total = typeof record.total === "number" && Number.isFinite(record.total) ? record.total : matches.length;
14856
+ const total = require_is_finite_number.isFiniteNumber(record.total) ? record.total : matches.length;
14697
14857
  const activeIndex = typeof record.activeMatchIndex === "number" ? record.activeMatchIndex : typeof record.activeIndex === "number" ? record.activeIndex : -1;
14698
14858
  const canReplace = record.canReplace === true || fallbackCanReplace;
14699
14859
  return {
@@ -15729,6 +15889,12 @@ Object.defineProperty(exports, "DOM_CLASS_NAMES", {
15729
15889
  return DOM_CLASS_NAMES;
15730
15890
  }
15731
15891
  });
15892
+ Object.defineProperty(exports, "PERMISSIONS", {
15893
+ enumerable: true,
15894
+ get: function() {
15895
+ return PERMISSIONS;
15896
+ }
15897
+ });
15732
15898
  Object.defineProperty(exports, "applyV2CommentInvalidationFromMutation", {
15733
15899
  enumerable: true,
15734
15900
  get: function() {
@@ -15759,6 +15925,12 @@ Object.defineProperty(exports, "createSuperDocUI", {
15759
15925
  return createSuperDocUI;
15760
15926
  }
15761
15927
  });
15928
+ Object.defineProperty(exports, "createTrackedChangePermissionResolver", {
15929
+ enumerable: true,
15930
+ get: function() {
15931
+ return createTrackedChangePermissionResolver;
15932
+ }
15933
+ });
15762
15934
  Object.defineProperty(exports, "executeFirstPartyCommandAsync", {
15763
15935
  enumerable: true,
15764
15936
  get: function() {
@@ -15789,6 +15961,12 @@ Object.defineProperty(exports, "getWorkflowRecording", {
15789
15961
  return getWorkflowRecording;
15790
15962
  }
15791
15963
  });
15964
+ Object.defineProperty(exports, "isAllowed", {
15965
+ enumerable: true,
15966
+ get: function() {
15967
+ return isAllowed;
15968
+ }
15969
+ });
15792
15970
  Object.defineProperty(exports, "isPlainObject", {
15793
15971
  enumerable: true,
15794
15972
  get: function() {