superdoc 2.29.0-next.3 → 2.29.0
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.
- package/dist/chunks/{FindReplaceSurface-BKVHzhQ4.es.js → FindReplaceSurface-B_5ggdWg.es.js} +1 -1
- package/dist/chunks/{FindReplaceSurface-BNDrJ6VS.cjs → FindReplaceSurface-fVHxPXtn.cjs} +1 -1
- package/dist/chunks/{PasswordPromptSurface-6mF6Azda.es.js → PasswordPromptSurface-CZqhDQQ1.es.js} +1 -1
- package/dist/chunks/{PasswordPromptSurface-BNkaztaP.cjs → PasswordPromptSurface-x8GNmMJT.cjs} +1 -1
- package/dist/chunks/{PdfViewer-D4lVeOJu.es.js → PdfViewer-CW09MNrB.es.js} +70 -105
- package/dist/chunks/{PdfViewer-boENOZdF.cjs → PdfViewer-CkrAHpC-.cjs} +74 -109
- package/dist/chunks/{_plugin-vue_export-helper-6MBoygIY.cjs → _plugin-vue_export-helper-BkbCxNeT.cjs} +31 -7
- package/dist/chunks/{_plugin-vue_export-helper-CsJQtMvr.es.js → _plugin-vue_export-helper-DRPRMkeA.es.js} +20 -8
- package/dist/chunks/{constants-DpXuDx_g.cjs → constants-BeeNZoQp.cjs} +1 -1
- package/dist/chunks/{constants-B6VBlmKp.es.js → constants-BvNs_ybI.es.js} +1 -1
- package/dist/chunks/{create-super-doc-ui-BFt8agAI.es.js → create-super-doc-ui-Dc8dQAMc.es.js} +89 -137
- package/dist/chunks/{create-super-doc-ui-BAGOnYGM.cjs → create-super-doc-ui-L60GhVAX.cjs} +211 -259
- package/dist/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/document-api/src/capabilities/html-markdown-support.d.ts +4 -6
- package/dist/document-api/src/comments/comments.d.ts +2 -0
- package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
- package/dist/document-api/src/contract/operation-definitions.d.ts +2 -2
- package/dist/document-api/src/contract/operation-registry.d.ts +10 -9
- package/dist/document-api/src/index.d.ts +8 -7
- package/dist/document-api/src/insert/insert.d.ts +2 -2
- package/dist/document-api/src/replace/replace.d.ts +3 -2
- package/dist/document-api/src/types/address.d.ts +3 -0
- package/dist/document-api/src/types/temporary-mutation.d.ts +5 -1
- package/dist/document-api/src/write/write.d.ts +12 -6
- package/dist/public/ui-react.cjs +1 -1
- package/dist/public/ui-react.es.js +1 -1
- package/dist/public/ui-vue.cjs +1 -1
- package/dist/public/ui-vue.es.js +1 -1
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/style.layered.css +1 -1
- package/dist/superdoc/src/SuperDoc.vue.d.ts +132 -58
- package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +28 -13
- package/dist/superdoc/src/components/CommentsLayer/collect-removed-comment-ids.d.ts +11 -1
- package/dist/superdoc/src/components/CommentsLayer/collect-tracked-change-thread.d.ts +19 -2
- package/dist/superdoc/src/components/CommentsLayer/comment-urls.d.ts +1 -1
- package/dist/superdoc/src/components/CommentsLayer/commentsList/super-comments-list.d.ts +23 -20
- package/dist/superdoc/src/components/CommentsLayer/floating-comment-positioning.d.ts +24 -23
- package/dist/superdoc/src/components/CommentsLayer/helpers.d.ts +1 -4
- package/dist/superdoc/src/components/CommentsLayer/tracked-change-threading.d.ts +16 -2
- package/dist/superdoc/src/components/CommentsLayer/use-comment.d.ts +28 -13
- package/dist/superdoc/src/components/PdfViewer/PdfViewer.vue.d.ts +132 -45
- package/dist/superdoc/src/components/PdfViewer/PdfViewerDocument.vue.d.ts +62 -16
- package/dist/superdoc/src/components/PdfViewer/PdfViewerPage.vue.d.ts +77 -17
- package/dist/superdoc/src/components/PdfViewer/pdf-viewer-types.d.ts +45 -0
- package/dist/superdoc/src/components/Whiteboard/WhiteboardLayer.vue.d.ts +80 -16
- package/dist/superdoc/src/components/Whiteboard/WhiteboardPage.vue.d.ts +48 -13
- package/dist/superdoc/src/components/Whiteboard/use-whiteboard.d.ts +30 -15
- package/dist/superdoc/src/components/Whiteboard/whiteboard-types.d.ts +13 -0
- package/dist/superdoc/src/components/surfaces/focusable-selector.d.ts +1 -5
- package/dist/superdoc/src/components/surfaces/watermark-surface-runtime.d.ts +7 -7
- package/dist/superdoc/src/composables/find-shortcut-owner.d.ts +16 -9
- package/dist/superdoc/src/composables/replace-continuation.d.ts +11 -15
- package/dist/superdoc/src/composables/use-comment-small-screen.d.ts +11 -7
- package/dist/superdoc/src/composables/use-compact-comment-popover.d.ts +44 -18
- package/dist/superdoc/src/composables/use-document.d.ts +1210 -30
- package/dist/superdoc/src/composables/use-field.d.ts +88 -25
- package/dist/superdoc/src/composables/use-find-replace.d.ts +13 -3
- package/dist/superdoc/src/composables/use-password-prompt.d.ts +23 -24
- package/dist/superdoc/src/composables/use-viewport-fit.d.ts +62 -26
- package/dist/superdoc/src/composables/useUiFontFamily.d.ts +3 -11
- package/dist/superdoc/src/core/SuperDoc.d.ts +4 -4
- package/dist/superdoc/src/core/collaboration/collaboration-comments.d.ts +9 -4
- package/dist/superdoc/src/core/collaboration/helpers.d.ts +20 -3
- package/dist/superdoc/src/core/collaboration/permissions.d.ts +15 -10
- package/dist/superdoc/src/core/collaboration/resolve-v2-collaboration-target.d.ts +4 -3
- package/dist/superdoc/src/core/collaboration/v2-awareness-bridge.d.ts +2 -1
- package/dist/superdoc/src/core/config/merge-comments-config.d.ts +1 -5
- package/dist/superdoc/src/core/config/merge-defined.d.ts +3 -8
- package/dist/superdoc/src/core/config/normalize-hyperlinks-config.d.ts +7 -12
- package/dist/superdoc/src/core/config/normalize-surfaces-config.d.ts +9 -12
- package/dist/superdoc/src/core/config/normalize-ui-config.d.ts +1 -12
- package/dist/superdoc/src/core/create-app.d.ts +13 -24
- package/dist/superdoc/src/core/editor-runtime/conformance/fake-v2-runtime.d.ts +2 -1
- package/dist/superdoc/src/core/editor-runtime/editor-runtime-registry.d.ts +2 -1
- package/dist/superdoc/src/core/editor-runtime/index.d.ts +1 -1
- package/dist/superdoc/src/core/editor-runtime/types.d.ts +2 -1
- package/dist/superdoc/src/core/editor-runtime/v2/v2-session-shortcut-routes.d.ts +1 -1
- package/dist/superdoc/src/core/helpers/export.d.ts +3 -2
- package/dist/superdoc/src/core/helpers/file.d.ts +8 -45
- package/dist/superdoc/src/core/helpers/normalize-track-changes-config.d.ts +6 -60
- package/dist/superdoc/src/core/pdf/helpers/constants.d.ts +2 -2
- package/dist/superdoc/src/core/pdf/helpers/floor.d.ts +1 -1
- package/dist/superdoc/src/core/pdf/helpers/range.d.ts +1 -1
- package/dist/superdoc/src/core/pdf/helpers/read-file.d.ts +1 -1
- package/dist/superdoc/src/core/pdf/pdf-adapter.d.ts +28 -61
- package/dist/superdoc/src/core/superdoc-ui-owner.d.ts +1 -1
- package/dist/superdoc/src/core/surface-manager.d.ts +21 -83
- package/dist/superdoc/src/core/types/index.d.ts +41 -23
- package/dist/superdoc/src/core/v2-integration/browser-peer-runtime.d.ts +5 -3
- package/dist/superdoc/src/core/v2-integration/cdn-engine-loader.d.ts +3 -13
- package/dist/superdoc/src/core/v2-integration/internal-vue-runtime.d.ts +64 -59
- package/dist/superdoc/src/core/v2-integration/v2-integration.d.ts +10 -10
- package/dist/superdoc/src/core/whiteboard/Whiteboard.d.ts +22 -208
- package/dist/superdoc/src/core/whiteboard/WhiteboardPage.d.ts +163 -189
- package/dist/superdoc/src/core/whiteboard/helpers/createTextarea.d.ts +14 -1
- package/dist/superdoc/src/core/whiteboard/helpers/flattenPoints.d.ts +1 -1
- package/dist/superdoc/src/core/whiteboard/helpers/getRandomId.d.ts +1 -1
- package/dist/superdoc/src/helpers/comment-focus.d.ts +21 -4
- package/dist/superdoc/src/helpers/deprecation.d.ts +5 -11
- package/dist/superdoc/src/helpers/interaction-trace.d.ts +7 -24
- package/dist/superdoc/src/helpers/mark-raw-component.d.ts +1 -0
- package/dist/superdoc/src/helpers/object-guards.d.ts +2 -5
- package/dist/superdoc/src/helpers/selection-source.d.ts +1 -1
- package/dist/superdoc/src/helpers/use-selection.d.ts +35 -15
- package/dist/superdoc/src/helpers/v2-author-required-rejection.d.ts +8 -11
- package/dist/superdoc/src/helpers/v2-bulk-decision-event.d.ts +9 -7
- package/dist/superdoc/src/helpers/v2-keyboard-edit-rejection.d.ts +8 -7
- package/dist/superdoc/src/helpers/v2-mutation-exception.d.ts +12 -8
- package/dist/superdoc/src/helpers/v2-review-target.d.ts +11 -1
- package/dist/superdoc/src/helpers/v2-selection-sync.d.ts +40 -14
- package/dist/superdoc/src/helpers/v2-typing-mutation-event.d.ts +14 -5
- package/dist/superdoc/src/icons.d.ts +11 -19
- package/dist/superdoc/src/internal/diagnostics/diagnostic-dedupe.d.ts +6 -15
- package/dist/superdoc/src/internal/diagnostics/translate-diagnostic.d.ts +6 -4
- package/dist/superdoc/src/internal/toolbar/built-in/AIWriter.vue.d.ts +2 -2
- package/dist/superdoc/src/internal/toolbar/built-in/ButtonGroup.vue.d.ts +4 -24
- package/dist/superdoc/src/internal/toolbar/built-in/FontFamilyCombobox.vue.d.ts +34 -0
- package/dist/superdoc/src/internal/toolbar/built-in/FontSizeCombobox.vue.d.ts +34 -0
- package/dist/superdoc/src/internal/toolbar/built-in/LinkInput.vue.d.ts +1 -1
- package/dist/superdoc/src/internal/toolbar/built-in/PageNumberMenu.vue.d.ts +25 -15
- package/dist/superdoc/src/internal/toolbar/built-in/Toolbar.vue.d.ts +9 -3
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarComboBox.vue.d.ts +12 -14
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarDropdown.vue.d.ts +1 -11
- package/dist/superdoc/src/internal/toolbar/built-in/color-dropdown-helpers.d.ts +9 -19
- package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +14 -45
- package/dist/superdoc/src/internal/toolbar/built-in/default-items.d.ts +34 -17
- package/dist/superdoc/src/internal/toolbar/built-in/font-options.d.ts +15 -1
- package/dist/superdoc/src/internal/toolbar/built-in/font-typeahead.d.ts +37 -7
- package/dist/superdoc/src/internal/toolbar/built-in/format-negation.d.ts +10 -4
- package/dist/superdoc/src/internal/toolbar/built-in/general.d.ts +12 -1
- package/dist/superdoc/src/internal/toolbar/built-in/helpers.d.ts +9 -4
- package/dist/superdoc/src/internal/toolbar/built-in/list-style-buttons.d.ts +2 -2
- package/dist/superdoc/src/internal/toolbar/built-in/page-number-feedback.d.ts +4 -5
- package/dist/superdoc/src/internal/toolbar/built-in/scroll-helpers.d.ts +3 -4
- package/dist/superdoc/src/internal/toolbar/built-in/toolbar-focus-helpers.d.ts +10 -2
- package/dist/superdoc/src/internal/toolbar/built-in/toolbarIcons.d.ts +78 -145
- package/dist/superdoc/src/internal/toolbar/built-in/toolbarTexts.d.ts +61 -61
- package/dist/superdoc/src/internal/toolbar/built-in/url-safety.d.ts +11 -3
- package/dist/superdoc/src/internal/toolbar/built-in/use-toolbar-item.d.ts +110 -48
- package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +11 -30
- package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +4 -3
- package/dist/superdoc/src/internal/toolbar/image-upload.d.ts +29 -39
- package/dist/superdoc/src/internal/toolbar/toolbar-item-aliases.d.ts +1 -1
- package/dist/superdoc/src/public/browser-document-api.d.ts +5 -4
- package/dist/superdoc/src/public/index.d.cts +26 -0
- package/dist/superdoc/src/public/index.d.ts +13 -0
- package/dist/superdoc/src/public/ui/commands.d.ts +14 -13
- package/dist/superdoc/src/public/ui/create-super-doc-ui.d.ts +1 -1
- package/dist/superdoc/src/public/ui/entity-at.d.ts +2 -1
- package/dist/superdoc/src/public/ui/format-painter-helpers.d.ts +2 -8
- package/dist/superdoc/src/public/ui/style-match-patch.d.ts +2 -2
- package/dist/superdoc/src/public/ui/types.d.ts +1 -1
- package/dist/superdoc/src/stores/comments-store.d.ts +231 -105
- package/dist/superdoc/src/stores/helpers/comment-document-scope.d.ts +22 -0
- package/dist/superdoc/src/stores/helpers/comment-grouping.d.ts +30 -0
- package/dist/superdoc/src/stores/helpers/comment-identity.d.ts +40 -0
- package/dist/superdoc/src/stores/helpers/floating-comment-instances.d.ts +48 -13
- package/dist/superdoc/src/stores/helpers/pending-selection-snapshot.d.ts +17 -0
- package/dist/superdoc/src/stores/helpers/tracked-change-compaction.d.ts +16 -0
- package/dist/superdoc/src/stores/helpers/tracked-change-decision.d.ts +45 -0
- package/dist/superdoc/src/stores/helpers/tracked-change-identity.d.ts +19 -0
- package/dist/superdoc/src/stores/helpers/tracked-change-row-values.d.ts +0 -4
- package/dist/superdoc/src/stores/helpers/tracked-change-thread-index.d.ts +21 -24
- package/dist/superdoc/src/stores/superdoc-store.d.ts +694 -316
- package/dist/superdoc.cjs +1804 -2782
- package/dist/superdoc.es.js +1720 -2699
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +42 -42
- package/package.json +3 -2
- package/dist/superdoc/src/internal/toolbar/index.d.ts +0 -10
- package/dist/superdoc/src/main.d.ts +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require__plugin_vue_export_helper = require("./_plugin-vue_export-helper-
|
|
1
|
+
const require__plugin_vue_export_helper = require("./_plugin-vue_export-helper-BkbCxNeT.cjs");
|
|
2
2
|
const require_is_finite_number = require("./is-finite-number-BEXgTRgc.cjs");
|
|
3
3
|
//#region src/internal/diagnostics/workflow-recording.ts
|
|
4
4
|
var fields$1 = /* @__PURE__ */ new Set([
|
|
@@ -1088,16 +1088,7 @@ function isSyntheticTrackedChangeCommentLaneItem(item) {
|
|
|
1088
1088
|
return typeof itemId === "string" && itemId.startsWith(TRACKED_CHANGE_COMMENT_LANE_ID_PREFIX);
|
|
1089
1089
|
}
|
|
1090
1090
|
//#endregion
|
|
1091
|
-
//#region src/
|
|
1092
|
-
/**
|
|
1093
|
-
* @param {unknown} value
|
|
1094
|
-
* @returns {value is Record<string, unknown>}
|
|
1095
|
-
*/
|
|
1096
|
-
function isPlainObject(value) {
|
|
1097
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1098
|
-
}
|
|
1099
|
-
//#endregion
|
|
1100
|
-
//#region src/core/collaboration/permissions.js
|
|
1091
|
+
//#region src/core/collaboration/permissions.ts
|
|
1101
1092
|
var PERMISSIONS = Object.freeze({
|
|
1102
1093
|
RESOLVE_OWN: "RESOLVE_OWN",
|
|
1103
1094
|
RESOLVE_OTHER: "RESOLVE_OTHER",
|
|
@@ -1160,15 +1151,16 @@ var PERMISSION_MATRIX = Object.freeze({
|
|
|
1160
1151
|
var pickResolver = (context = {}) => {
|
|
1161
1152
|
if (typeof context.permissionResolver === "function") return context.permissionResolver;
|
|
1162
1153
|
if (typeof context.superdoc?.config?.permissionResolver === "function") return context.superdoc.config.permissionResolver;
|
|
1163
|
-
const
|
|
1154
|
+
const comments = context.superdoc?.config?.modules?.comments;
|
|
1155
|
+
const deprecatedResolver = comments ? comments.permissionResolver : void 0;
|
|
1164
1156
|
if (typeof deprecatedResolver === "function") return deprecatedResolver;
|
|
1165
1157
|
return null;
|
|
1166
1158
|
};
|
|
1167
1159
|
var BUILT_IN_PERMISSION_METHOD = Symbol.for("superdoc.internal.permission-method.builtin");
|
|
1168
1160
|
var BUILT_IN_PERMISSION_RESOLVER = Symbol.for("superdoc.internal.permission-resolver.builtin");
|
|
1169
|
-
|
|
1161
|
+
var hasBuiltInPermissionMethodBrand = (method) => (typeof method === "object" && method !== null || typeof method === "function") && Reflect.get(method, BUILT_IN_PERMISSION_METHOD) === true;
|
|
1170
1162
|
var createTrackedChangePermissionResolver = (superdoc) => {
|
|
1171
|
-
const isBuiltInPolicy = () => superdoc.canPerformPermission
|
|
1163
|
+
const isBuiltInPolicy = () => hasBuiltInPermissionMethodBrand(superdoc.canPerformPermission) && pickResolver({ superdoc }) === null;
|
|
1172
1164
|
const resolver = (payload = {}) => isBuiltInPolicy() ? defaultDecisionFor(payload.permission, superdoc.config.role, superdoc.config.isInternal) : superdoc.canPerformPermission({
|
|
1173
1165
|
...payload,
|
|
1174
1166
|
role: superdoc.config.role,
|
|
@@ -1178,6 +1170,7 @@ var createTrackedChangePermissionResolver = (superdoc) => {
|
|
|
1178
1170
|
return resolver;
|
|
1179
1171
|
};
|
|
1180
1172
|
var defaultDecisionFor = (permission, role, isInternal) => {
|
|
1173
|
+
if (permission === void 0 || typeof role !== "string") return false;
|
|
1181
1174
|
const internalExternal = isInternal ? "internal" : "external";
|
|
1182
1175
|
return PERMISSION_MATRIX[permission]?.[internalExternal]?.includes(role) ?? false;
|
|
1183
1176
|
};
|
|
@@ -1222,21 +1215,6 @@ var readBuiltInTrackedChangePermissionDecision = (superdoc, canPerform, permissi
|
|
|
1222
1215
|
return null;
|
|
1223
1216
|
}
|
|
1224
1217
|
};
|
|
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 | undefined} role The role to check
|
|
1231
|
-
* @param {boolean | undefined} 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
1218
|
var isAllowed = (permission, role, isInternal, context = {}) => {
|
|
1241
1219
|
const defaultDecision = defaultDecisionFor(permission, role, isInternal);
|
|
1242
1220
|
const resolver = pickResolver(context);
|
|
@@ -1321,7 +1299,7 @@ function shallowEqual(a, b) {
|
|
|
1321
1299
|
return true;
|
|
1322
1300
|
}
|
|
1323
1301
|
//#endregion
|
|
1324
|
-
//#region src/internal/toolbar/image-upload.
|
|
1302
|
+
//#region src/internal/toolbar/image-upload.ts
|
|
1325
1303
|
/**
|
|
1326
1304
|
* Interactive image acquisition for the built-in toolbar (SD-3567).
|
|
1327
1305
|
*
|
|
@@ -1342,8 +1320,6 @@ var SUPPORTED_IMAGE_EXTENSIONS = /\.(png|jpe?g)$/i;
|
|
|
1342
1320
|
/**
|
|
1343
1321
|
* Whether a picked/dropped file is an insertable image (PNG/JPEG). Falls back
|
|
1344
1322
|
* to the file extension when the browser reports no MIME type.
|
|
1345
|
-
* @param {File | null | undefined} file
|
|
1346
|
-
* @returns {boolean}
|
|
1347
1323
|
*/
|
|
1348
1324
|
function isSupportedImageFile(file) {
|
|
1349
1325
|
if (!file) return false;
|
|
@@ -1358,8 +1334,6 @@ function isSupportedImageFile(file) {
|
|
|
1358
1334
|
* accepts those by extension, but `readAsDataURL` would then produce an
|
|
1359
1335
|
* `application/octet-stream` data URI that `create.image` rejects. Rewrite
|
|
1360
1336
|
* the media type from the filename so extension-accepted files still insert.
|
|
1361
|
-
* @param {Blob & { name?: string }} file
|
|
1362
|
-
* @returns {Promise<string>}
|
|
1363
1337
|
*/
|
|
1364
1338
|
function fileToDataUri(file) {
|
|
1365
1339
|
return new Promise((resolve, reject) => {
|
|
@@ -1372,9 +1346,6 @@ function fileToDataUri(file) {
|
|
|
1372
1346
|
/**
|
|
1373
1347
|
* Ensure a data URI read from a supported file carries a PNG/JPEG media type.
|
|
1374
1348
|
* Leaves URIs already typed as a supported image (or uninferable ones) alone.
|
|
1375
|
-
* @param {string} dataUri
|
|
1376
|
-
* @param {(Blob & { name?: string }) | null | undefined} file
|
|
1377
|
-
* @returns {string}
|
|
1378
1349
|
*/
|
|
1379
1350
|
function normalizeImageDataUri(dataUri, file) {
|
|
1380
1351
|
const match = /^data:([^;,]*);base64,/.exec(dataUri);
|
|
@@ -1391,9 +1362,6 @@ function normalizeImageDataUri(dataUri, file) {
|
|
|
1391
1362
|
* `handleImageUpload` callback when configured (V1 contract:
|
|
1392
1363
|
* `(file: File) => Promise<string>`). A returned non-data URL is fetched and
|
|
1393
1364
|
* embedded, because `create.image` requires an embedded base64 data URI.
|
|
1394
|
-
* @param {File} file
|
|
1395
|
-
* @param {((file: File) => Promise<string>) | null | undefined} handleImageUpload
|
|
1396
|
-
* @returns {Promise<string>}
|
|
1397
1365
|
*/
|
|
1398
1366
|
async function resolveImageSrc(file, handleImageUpload) {
|
|
1399
1367
|
if (typeof handleImageUpload === "function") {
|
|
@@ -1409,9 +1377,6 @@ async function resolveImageSrc(file, handleImageUpload) {
|
|
|
1409
1377
|
* presigned URLs often respond `application/octet-stream`, so keep a filename
|
|
1410
1378
|
* hint (URL path, falling back to the originally picked file) for the media
|
|
1411
1379
|
* type normalization in `fileToDataUri`.
|
|
1412
|
-
* @param {string} url
|
|
1413
|
-
* @param {File | null | undefined} pickedFile
|
|
1414
|
-
* @returns {Promise<string>}
|
|
1415
1380
|
*/
|
|
1416
1381
|
async function embedRemoteImage(url, pickedFile) {
|
|
1417
1382
|
const response = await fetch(url);
|
|
@@ -1425,13 +1390,6 @@ async function embedRemoteImage(url, pickedFile) {
|
|
|
1425
1390
|
* stays attached (hidden) so automation and tests can drive it; `destroy()`
|
|
1426
1391
|
* removes it. Picking a file calls `onPick(file)`; an unsupported type or a
|
|
1427
1392
|
* failed pick routes through `onError(error)`.
|
|
1428
|
-
*
|
|
1429
|
-
* @param {{
|
|
1430
|
-
* ownerDocument?: Document,
|
|
1431
|
-
* onPick?: (file: File) => unknown,
|
|
1432
|
-
* onError?: (error: Error) => void,
|
|
1433
|
-
* }} options
|
|
1434
|
-
* @returns {{ input: HTMLInputElement, open: () => void, destroy: () => void }}
|
|
1435
1393
|
*/
|
|
1436
1394
|
function createImageFilePicker({ ownerDocument = document, onPick, onError } = {}) {
|
|
1437
1395
|
const input = ownerDocument.createElement("input");
|
|
@@ -2024,13 +1982,9 @@ var WatermarkSurface_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
2024
1982
|
//#region src/components/surfaces/WatermarkSurface.vue
|
|
2025
1983
|
var WatermarkSurface_default = /* @__PURE__ */ require__plugin_vue_export_helper._plugin_vue_export_helper_default(WatermarkSurface_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-df56c82c"]]);
|
|
2026
1984
|
//#endregion
|
|
2027
|
-
//#region src/components/surfaces/watermark-surface-runtime.
|
|
2028
|
-
/**
|
|
2029
|
-
* Keeps Vue rendering and post-dismissal announcements outside the public type graph.
|
|
2030
|
-
* @param {(() => HTMLElement | null) | undefined} getContainer
|
|
2031
|
-
*/
|
|
1985
|
+
//#region src/components/surfaces/watermark-surface-runtime.ts
|
|
1986
|
+
/** Keeps Vue rendering and post-dismissal announcements outside the public type graph. */
|
|
2032
1987
|
function createWatermarkSurfaceRuntime(getContainer) {
|
|
2033
|
-
/** @type {HTMLDivElement | null} */
|
|
2034
1988
|
let status = null;
|
|
2035
1989
|
let disposed = false;
|
|
2036
1990
|
return {
|
|
@@ -2041,7 +1995,6 @@ function createWatermarkSurfaceRuntime(getContainer) {
|
|
|
2041
1995
|
const item = opener?.closest("[data-sd-part=\"toolbar-item\"]") ?? opener?.querySelector("[data-sd-part=\"toolbar-item\"]");
|
|
2042
1996
|
const container = (item?.closest("[data-sd-part=\"toolbar\"]"))?.parentElement;
|
|
2043
1997
|
const isWatermarkEntry = item?.querySelector("[data-item=\"btn-watermark\"], [data-item=\"btn-overflow\"]");
|
|
2044
|
-
/** @param {() => boolean} isCurrent */
|
|
2045
1998
|
return async (isCurrent) => {
|
|
2046
1999
|
await require__plugin_vue_export_helper.nextTick();
|
|
2047
2000
|
if (disposed || !isCurrent() || !isWatermarkEntry || opener?.isConnected || !container?.isConnected) return;
|
|
@@ -2073,7 +2026,6 @@ function createWatermarkSurfaceRuntime(getContainer) {
|
|
|
2073
2026
|
});
|
|
2074
2027
|
container.appendChild(status);
|
|
2075
2028
|
},
|
|
2076
|
-
/** @param {string} message */
|
|
2077
2029
|
announce(message) {
|
|
2078
2030
|
if (!disposed && status) status.textContent = message;
|
|
2079
2031
|
},
|
|
@@ -2689,34 +2641,33 @@ function fontsValue(value) {
|
|
|
2689
2641
|
return Object.keys(result).length > 0 ? result : null;
|
|
2690
2642
|
}
|
|
2691
2643
|
//#endregion
|
|
2692
|
-
//#region src/public/ui/format-painter-helpers.
|
|
2644
|
+
//#region src/public/ui/format-painter-helpers.ts
|
|
2693
2645
|
/**
|
|
2694
2646
|
* Maps SDRunProps field names to InlineRunPatch field names.
|
|
2695
2647
|
* SDRunProps (read-side) and InlineRunPatch (write-side) use different keys
|
|
2696
2648
|
* for the same properties; direct assignment between them is forbidden.
|
|
2697
|
-
*
|
|
2698
|
-
* @param {Record<string, unknown>} props - SDRunProps object from doc.getNodeById
|
|
2699
|
-
* @returns {Record<string, unknown>} InlineRunPatch ready for doc.format.apply
|
|
2700
2649
|
*/
|
|
2701
2650
|
function sdRunPropsToInlineRunPatch(props) {
|
|
2702
2651
|
if (!props || typeof props !== "object") return {};
|
|
2703
2652
|
const patch = {};
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2653
|
+
const fonts = props.fonts;
|
|
2654
|
+
if (require__plugin_vue_export_helper.isPlainObject(fonts)) patch.rFonts = {
|
|
2655
|
+
ascii: fonts.ascii,
|
|
2656
|
+
hAnsi: fonts.hAnsi,
|
|
2657
|
+
eastAsia: fonts.eastAsia,
|
|
2658
|
+
cs: fonts.cs,
|
|
2659
|
+
asciiTheme: fonts.asciiTheme,
|
|
2660
|
+
hAnsiTheme: fonts.hAnsiTheme,
|
|
2661
|
+
eastAsiaTheme: fonts.eastAsiaTheme,
|
|
2662
|
+
csTheme: fonts.csTheme,
|
|
2663
|
+
hint: fonts.hint
|
|
2714
2664
|
};
|
|
2715
2665
|
if (props.fontFamily != null) patch.fontFamily = props.fontFamily;
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2666
|
+
const lang = props.lang;
|
|
2667
|
+
if (require__plugin_vue_export_helper.isPlainObject(lang)) patch.lang = {
|
|
2668
|
+
val: lang.val,
|
|
2669
|
+
eastAsia: lang.eastAsia,
|
|
2670
|
+
bidi: lang.bidi
|
|
2720
2671
|
};
|
|
2721
2672
|
if (props.fontSize != null) patch.fontSize = props.fontSize;
|
|
2722
2673
|
if (props.fontSizeCs != null) patch.fontSizeCs = props.fontSizeCs;
|
|
@@ -2757,19 +2708,24 @@ function sdRunPropsToInlineRunPatch(props) {
|
|
|
2757
2708
|
function projectColorRefToInlineColor(color) {
|
|
2758
2709
|
if (!color) return void 0;
|
|
2759
2710
|
if (typeof color === "string") return color;
|
|
2711
|
+
if (!require__plugin_vue_export_helper.isPlainObject(color)) return void 0;
|
|
2760
2712
|
if (color.model === "rgb") return color.value;
|
|
2761
2713
|
if (color.model === "auto") return "auto";
|
|
2762
2714
|
}
|
|
2763
2715
|
function projectUnderlineToInlinePatch(underline) {
|
|
2764
2716
|
if (underline == null) return void 0;
|
|
2717
|
+
if (!require__plugin_vue_export_helper.isPlainObject(underline)) return true;
|
|
2765
2718
|
const patch = {};
|
|
2766
2719
|
if (underline.style != null) patch.style = underline.style;
|
|
2767
|
-
|
|
2768
|
-
if (
|
|
2720
|
+
const color = underline.color;
|
|
2721
|
+
if (require__plugin_vue_export_helper.isPlainObject(color)) {
|
|
2722
|
+
if (color.model === "rgb") patch.color = color.value;
|
|
2723
|
+
else if (color.model === "theme") patch.themeColor = color.theme;
|
|
2724
|
+
}
|
|
2769
2725
|
return Object.keys(patch).length > 0 ? patch : true;
|
|
2770
2726
|
}
|
|
2771
2727
|
function projectShadingToInlinePatch(shading) {
|
|
2772
|
-
if (!shading) return void 0;
|
|
2728
|
+
if (!require__plugin_vue_export_helper.isPlainObject(shading)) return void 0;
|
|
2773
2729
|
const patch = {};
|
|
2774
2730
|
const fill = projectColorRefToInlineColor(shading.fill);
|
|
2775
2731
|
if (fill != null) patch.fill = fill;
|
|
@@ -2779,7 +2735,7 @@ function projectShadingToInlinePatch(shading) {
|
|
|
2779
2735
|
return Object.keys(patch).length > 0 ? patch : void 0;
|
|
2780
2736
|
}
|
|
2781
2737
|
function projectBorderToInlinePatch(border) {
|
|
2782
|
-
if (!border) return void 0;
|
|
2738
|
+
if (!require__plugin_vue_export_helper.isPlainObject(border)) return void 0;
|
|
2783
2739
|
const patch = {};
|
|
2784
2740
|
if (border.style != null) patch.val = border.style;
|
|
2785
2741
|
if (border.width != null) patch.sz = border.width;
|
|
@@ -2794,9 +2750,6 @@ function projectBorderToInlinePatch(border) {
|
|
|
2794
2750
|
*
|
|
2795
2751
|
* Falls back to the plain text target when the host has not populated an
|
|
2796
2752
|
* explicit `selectionTarget` yet.
|
|
2797
|
-
*
|
|
2798
|
-
* @param {{ selectionTarget?: unknown; target?: unknown } | null | undefined} selection
|
|
2799
|
-
* @returns {string}
|
|
2800
2753
|
*/
|
|
2801
2754
|
function selectionKey(selection) {
|
|
2802
2755
|
const target = selection?.selectionTarget ?? selection?.target;
|
|
@@ -2811,8 +2764,8 @@ function selectionKey(selection) {
|
|
|
2811
2764
|
//#region src/helpers/v2-review-mutation-impact.ts
|
|
2812
2765
|
function mutationCommittedEventChangedVisibleContent(event) {
|
|
2813
2766
|
if (event.dryRun === true) return false;
|
|
2814
|
-
if (isPlainObject(event.result) && event.result.noop === true) return false;
|
|
2815
|
-
const receipt = isPlainObject(event.receipt) ? event.receipt : null;
|
|
2767
|
+
if (require__plugin_vue_export_helper.isPlainObject(event.result) && event.result.noop === true) return false;
|
|
2768
|
+
const receipt = require__plugin_vue_export_helper.isPlainObject(event.receipt) ? event.receipt : null;
|
|
2816
2769
|
if (receipt?.changed === false || receipt?.noop === true || receipt?.status === "NO_OP") return false;
|
|
2817
2770
|
return true;
|
|
2818
2771
|
}
|
|
@@ -2827,18 +2780,18 @@ function mutationCommittedEventChangedDocument(event) {
|
|
|
2827
2780
|
* plans carry the same identities through `trackedChanges` and per-step ids.
|
|
2828
2781
|
*/
|
|
2829
2782
|
function getV2TrackedChangeMutationImpact(event) {
|
|
2830
|
-
if (!isPlainObject(event) || event.type !== "mutation:committed") return null;
|
|
2783
|
+
if (!require__plugin_vue_export_helper.isPlainObject(event) || event.type !== "mutation:committed") return null;
|
|
2831
2784
|
const payload = event.origin === "history" ? event.result : event.receipt;
|
|
2832
|
-
if (!isPlainObject(payload)) return null;
|
|
2785
|
+
if (!require__plugin_vue_export_helper.isPlainObject(payload)) return null;
|
|
2833
2786
|
const upsertIds = /* @__PURE__ */ new Set();
|
|
2834
2787
|
const removedIds = /* @__PURE__ */ new Set();
|
|
2835
2788
|
const remappedPairs = [];
|
|
2836
2789
|
const collectEntity = (entry, into) => {
|
|
2837
|
-
if (!isPlainObject(entry) || entry.kind !== "entity" || entry.entityType !== "trackedChange") return;
|
|
2790
|
+
if (!require__plugin_vue_export_helper.isPlainObject(entry) || entry.kind !== "entity" || entry.entityType !== "trackedChange") return;
|
|
2838
2791
|
if (typeof entry.entityId === "string" && entry.entityId.length > 0) into.add(entry.entityId);
|
|
2839
2792
|
};
|
|
2840
2793
|
const readEntityId = (entry) => {
|
|
2841
|
-
if (!isPlainObject(entry) || entry.kind !== "entity" || entry.entityType !== "trackedChange") return null;
|
|
2794
|
+
if (!require__plugin_vue_export_helper.isPlainObject(entry) || entry.kind !== "entity" || entry.entityType !== "trackedChange") return null;
|
|
2842
2795
|
return typeof entry.entityId === "string" && entry.entityId.length > 0 ? entry.entityId : null;
|
|
2843
2796
|
};
|
|
2844
2797
|
if (Array.isArray(payload.inserted)) payload.inserted.forEach((entry) => collectEntity(entry, upsertIds));
|
|
@@ -2846,13 +2799,13 @@ function getV2TrackedChangeMutationImpact(event) {
|
|
|
2846
2799
|
if (Array.isArray(payload.trackedChangeRefs)) payload.trackedChangeRefs.forEach((entry) => collectEntity(entry, upsertIds));
|
|
2847
2800
|
if (Array.isArray(payload.trackedChanges)) payload.trackedChanges.forEach((entry) => collectEntity(entry, upsertIds));
|
|
2848
2801
|
if (Array.isArray(payload.steps)) for (const step of payload.steps) {
|
|
2849
|
-
if (!isPlainObject(step) || !Array.isArray(step.trackedChangeIds)) continue;
|
|
2802
|
+
if (!require__plugin_vue_export_helper.isPlainObject(step) || !Array.isArray(step.trackedChangeIds)) continue;
|
|
2850
2803
|
for (const id of step.trackedChangeIds) if (typeof id === "string" && id.length > 0) upsertIds.add(id);
|
|
2851
2804
|
}
|
|
2852
2805
|
if (Array.isArray(payload.removed)) payload.removed.forEach((entry) => collectEntity(entry, removedIds));
|
|
2853
2806
|
if (Array.isArray(payload.invalidatedRefs)) payload.invalidatedRefs.forEach((entry) => collectEntity(entry, removedIds));
|
|
2854
2807
|
if (Array.isArray(payload.remappedRefs)) for (const mapping of payload.remappedRefs) {
|
|
2855
|
-
if (!isPlainObject(mapping)) continue;
|
|
2808
|
+
if (!require__plugin_vue_export_helper.isPlainObject(mapping)) continue;
|
|
2856
2809
|
const fromId = readEntityId(mapping.from);
|
|
2857
2810
|
const toId = readEntityId(mapping.to);
|
|
2858
2811
|
if (fromId) removedIds.add(fromId);
|
|
@@ -2878,10 +2831,10 @@ function getV2TrackedChangeMutationImpact(event) {
|
|
|
2878
2831
|
*/
|
|
2879
2832
|
function collectV2InvalidatedCommentIds(event) {
|
|
2880
2833
|
const removedIds = /* @__PURE__ */ new Set();
|
|
2881
|
-
if (!isPlainObject(event) || event.type !== "mutation:committed") return removedIds;
|
|
2834
|
+
if (!require__plugin_vue_export_helper.isPlainObject(event) || event.type !== "mutation:committed") return removedIds;
|
|
2882
2835
|
const payload = event.origin === "history" ? event.result : event.receipt;
|
|
2883
|
-
if (!isPlainObject(payload) || !Array.isArray(payload.invalidatedRefs)) return removedIds;
|
|
2884
|
-
for (const ref of payload.invalidatedRefs) if (isPlainObject(ref) && ref.kind === "entity" && ref.entityType === "comment" && typeof ref.entityId === "string" && ref.entityId) removedIds.add(ref.entityId);
|
|
2836
|
+
if (!require__plugin_vue_export_helper.isPlainObject(payload) || !Array.isArray(payload.invalidatedRefs)) return removedIds;
|
|
2837
|
+
for (const ref of payload.invalidatedRefs) if (require__plugin_vue_export_helper.isPlainObject(ref) && ref.kind === "entity" && ref.entityType === "comment" && typeof ref.entityId === "string" && ref.entityId) removedIds.add(ref.entityId);
|
|
2885
2838
|
return removedIds;
|
|
2886
2839
|
}
|
|
2887
2840
|
function applyV2CommentInvalidationFromMutation({ event, commentsStore, superdoc, documentId } = {}) {
|
|
@@ -2901,11 +2854,11 @@ function applyV2CommentInvalidationFromMutation({ event, commentsStore, superdoc
|
|
|
2901
2854
|
}
|
|
2902
2855
|
function readAllResolvedFact(event, receipt) {
|
|
2903
2856
|
const fact = event.trackedChangeAllResolved;
|
|
2904
|
-
if (event.origin === "history" || !isPlainObject(fact) || fact.schemaVersion !== 1 || fact.targetKind !== "all" || fact.decision !== "accept" && fact.decision !== "reject" || fact.remainingLogicalCount !== 0 || typeof fact.catalogRevision !== "string" || !fact.catalogRevision || typeof fact.sourceCoverageRevision !== "string" || !fact.sourceCoverageRevision || typeof fact.logicalTargetCount !== "number" || !Number.isSafeInteger(fact.logicalTargetCount) || fact.logicalTargetCount <= 0 || typeof fact.physicalCarrierCount !== "number" || !Number.isSafeInteger(fact.physicalCarrierCount) || fact.physicalCarrierCount < fact.logicalTargetCount || typeof fact.txId !== "string" || fact.txId !== receipt.txId || typeof fact.documentEpoch !== "string" || !Number.isSafeInteger(fact.commitSequence) || typeof fact.packagePreviousRevision !== "string" || typeof fact.packageNextRevision !== "string" || fact.packagePreviousRevision === fact.packageNextRevision) return null;
|
|
2857
|
+
if (event.origin === "history" || !require__plugin_vue_export_helper.isPlainObject(fact) || fact.schemaVersion !== 1 || fact.targetKind !== "all" || fact.decision !== "accept" && fact.decision !== "reject" || fact.remainingLogicalCount !== 0 || typeof fact.catalogRevision !== "string" || !fact.catalogRevision || typeof fact.sourceCoverageRevision !== "string" || !fact.sourceCoverageRevision || typeof fact.logicalTargetCount !== "number" || !Number.isSafeInteger(fact.logicalTargetCount) || fact.logicalTargetCount <= 0 || typeof fact.physicalCarrierCount !== "number" || !Number.isSafeInteger(fact.physicalCarrierCount) || fact.physicalCarrierCount < fact.logicalTargetCount || typeof fact.txId !== "string" || fact.txId !== receipt.txId || typeof fact.documentEpoch !== "string" || !Number.isSafeInteger(fact.commitSequence) || typeof fact.packagePreviousRevision !== "string" || typeof fact.packageNextRevision !== "string" || fact.packagePreviousRevision === fact.packageNextRevision) return null;
|
|
2905
2858
|
return fact;
|
|
2906
2859
|
}
|
|
2907
2860
|
//#endregion
|
|
2908
|
-
//#region src/helpers/v2-typing-mutation-event.
|
|
2861
|
+
//#region src/helpers/v2-typing-mutation-event.ts
|
|
2909
2862
|
/**
|
|
2910
2863
|
* Command kinds whose committed mutations belong to the sustained typing
|
|
2911
2864
|
* cadence class (insert / replace / plain paste / Backspace / Delete).
|
|
@@ -2946,9 +2899,6 @@ var V2_TYPING_COMMAND_KINDS = /* @__PURE__ */ new Set([
|
|
|
2946
2899
|
* Events without a forwarded `editableCommandKind` (programmatic Document API
|
|
2947
2900
|
* mutations, history commits, unclassified structural commands) return false
|
|
2948
2901
|
* so they keep hydrating immediately.
|
|
2949
|
-
*
|
|
2950
|
-
* @param {{ type?: string, origin?: string, editableCommandKind?: string } | null | undefined} event
|
|
2951
|
-
* @returns {boolean}
|
|
2952
2902
|
*/
|
|
2953
2903
|
var isV2EditableTextMutationEvent = (event) => {
|
|
2954
2904
|
if (event?.type !== "mutation:committed" || event.origin !== "command") return false;
|
|
@@ -4890,20 +4840,20 @@ function hostMethod(target, name) {
|
|
|
4890
4840
|
return typeof member === "function" ? (...args) => Reflect.apply(member, target, args) : null;
|
|
4891
4841
|
}
|
|
4892
4842
|
function readEffectiveInlineUniformityStates(raw) {
|
|
4893
|
-
if (!isPlainObject(raw) || raw.success !== true) return null;
|
|
4843
|
+
if (!require__plugin_vue_export_helper.isPlainObject(raw) || raw.success !== true) return null;
|
|
4894
4844
|
const states = {};
|
|
4895
|
-
if (!isPlainObject(raw.values)) return states;
|
|
4845
|
+
if (!require__plugin_vue_export_helper.isPlainObject(raw.values)) return states;
|
|
4896
4846
|
for (const [key, entry] of Object.entries(raw.values)) {
|
|
4897
4847
|
if (!entry) continue;
|
|
4898
|
-
states[key] = isPlainObject(entry) && entry.state === "uniform" && typeof entry.value === "string" ? {
|
|
4848
|
+
states[key] = require__plugin_vue_export_helper.isPlainObject(entry) && entry.state === "uniform" && typeof entry.value === "string" ? {
|
|
4899
4849
|
state: "uniform",
|
|
4900
4850
|
value: entry.value
|
|
4901
|
-
} : { state: isPlainObject(entry) && entry.state === "mixed" ? "mixed" : "unresolvable" };
|
|
4851
|
+
} : { state: require__plugin_vue_export_helper.isPlainObject(entry) && entry.state === "mixed" ? "mixed" : "unresolvable" };
|
|
4902
4852
|
}
|
|
4903
4853
|
return states;
|
|
4904
4854
|
}
|
|
4905
4855
|
function hasAbortedFlag(value) {
|
|
4906
|
-
return isPlainObject(value) && typeof value.aborted === "boolean";
|
|
4856
|
+
return require__plugin_vue_export_helper.isPlainObject(value) && typeof value.aborted === "boolean";
|
|
4907
4857
|
}
|
|
4908
4858
|
function isPromiseLike(value) {
|
|
4909
4859
|
return Boolean(value) && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
@@ -5904,8 +5854,8 @@ function normalizeCommandState(state, source) {
|
|
|
5904
5854
|
};
|
|
5905
5855
|
}
|
|
5906
5856
|
function projectTrackChangesItem(item) {
|
|
5907
|
-
if (!isPlainObject(item)) return null;
|
|
5908
|
-
const change = isPlainObject(item.change) ? item.change : item;
|
|
5857
|
+
if (!require__plugin_vue_export_helper.isPlainObject(item)) return null;
|
|
5858
|
+
const change = require__plugin_vue_export_helper.isPlainObject(item.change) ? item.change : item;
|
|
5909
5859
|
return {
|
|
5910
5860
|
...item,
|
|
5911
5861
|
id: item.id ?? change.id,
|
|
@@ -5946,9 +5896,9 @@ function documentChangeFromHostEvent(event) {
|
|
|
5946
5896
|
};
|
|
5947
5897
|
if (event.type !== "mutation:committed") return null;
|
|
5948
5898
|
if (event.origin === "history") {
|
|
5949
|
-
const result = isPlainObject(event.result) ? event.result : null;
|
|
5899
|
+
const result = require__plugin_vue_export_helper.isPlainObject(event.result) ? event.result : null;
|
|
5950
5900
|
if (!result || result.noop === true) return null;
|
|
5951
|
-
const history = isPlainObject(result.history) ? result.history : null;
|
|
5901
|
+
const history = require__plugin_vue_export_helper.isPlainObject(result.history) ? result.history : null;
|
|
5952
5902
|
return {
|
|
5953
5903
|
cause: event.direction === "redo" ? "redo" : "undo",
|
|
5954
5904
|
changeTag: null,
|
|
@@ -5957,7 +5907,7 @@ function documentChangeFromHostEvent(event) {
|
|
|
5957
5907
|
};
|
|
5958
5908
|
}
|
|
5959
5909
|
if (!mutationCommittedEventChangedDocument(event)) return null;
|
|
5960
|
-
const receipt = isPlainObject(event.receipt) ? event.receipt : {};
|
|
5910
|
+
const receipt = require__plugin_vue_export_helper.isPlainObject(event.receipt) ? event.receipt : {};
|
|
5961
5911
|
return {
|
|
5962
5912
|
cause: event.cause === "user" ? "user" : "api",
|
|
5963
5913
|
changeTag: typeof receipt.changeTag === "string" ? receipt.changeTag : null,
|
|
@@ -6145,9 +6095,9 @@ function selectionTargetFromTextTarget(target) {
|
|
|
6145
6095
|
};
|
|
6146
6096
|
}
|
|
6147
6097
|
function capturedTableCellTarget(value) {
|
|
6148
|
-
if (!isPlainObject(value)) return null;
|
|
6098
|
+
if (!require__plugin_vue_export_helper.isPlainObject(value)) return null;
|
|
6149
6099
|
if (value.kind !== "selection" || value.coordinateSpace !== void 0 && value.coordinateSpace !== "visible" && value.coordinateSpace !== "tracked" || value.story !== void 0 && !isStoryLocator(value.story)) return null;
|
|
6150
|
-
for (const point of [value.start, value.end]) if (!isPlainObject(point) || point.kind !== "text" || typeof point.blockId !== "string" || point.blockId.length === 0 || typeof point.offset !== "number" || !Number.isInteger(point.offset) || point.offset < 0 || point.story !== void 0 && !isStoryLocator(point.story)) return null;
|
|
6100
|
+
for (const point of [value.start, value.end]) if (!require__plugin_vue_export_helper.isPlainObject(point) || point.kind !== "text" || typeof point.blockId !== "string" || point.blockId.length === 0 || typeof point.offset !== "number" || !Number.isInteger(point.offset) || point.offset < 0 || point.story !== void 0 && !isStoryLocator(point.story)) return null;
|
|
6151
6101
|
return value;
|
|
6152
6102
|
}
|
|
6153
6103
|
function selectionTargetForRestore(capture) {
|
|
@@ -6402,7 +6352,7 @@ function createSuperDocUI(options) {
|
|
|
6402
6352
|
};
|
|
6403
6353
|
try {
|
|
6404
6354
|
const result = open();
|
|
6405
|
-
if (isPlainObject(result) && result.ok === false) return {
|
|
6355
|
+
if (require__plugin_vue_export_helper.isPlainObject(result) && result.ok === false) return {
|
|
6406
6356
|
ok: false,
|
|
6407
6357
|
reason: coerceSuperDocUIReason(result.reason, SUPERDOC_UI_REASONS.operationUnavailable)
|
|
6408
6358
|
};
|
|
@@ -6447,7 +6397,7 @@ function createSuperDocUI(options) {
|
|
|
6447
6397
|
const getSnapshot = hostMethod(getV2ReviewWindowSource(), "getSnapshot");
|
|
6448
6398
|
if (!getSnapshot) return null;
|
|
6449
6399
|
const snapshot = safeCall(() => getSnapshot(), null);
|
|
6450
|
-
return isPlainObject(snapshot) ? snapshot : null;
|
|
6400
|
+
return require__plugin_vue_export_helper.isPlainObject(snapshot) ? snapshot : null;
|
|
6451
6401
|
};
|
|
6452
6402
|
const hasV2ReviewWindowFeed = () => typeof getV2ReviewWindowSource()?.getSnapshot === "function";
|
|
6453
6403
|
const reviewWindowSliceStatus = (snapshot) => {
|
|
@@ -6468,8 +6418,8 @@ function createSuperDocUI(options) {
|
|
|
6468
6418
|
let wholeTableParagraphSeed = null;
|
|
6469
6419
|
const readHostSelectionSnapshot = () => {
|
|
6470
6420
|
const handles = safeCall(() => hostMethod(getHost(), "getHandles")?.() ?? null, null);
|
|
6471
|
-
const editing = isPlainObject(handles) ? handles.editing : void 0;
|
|
6472
|
-
const getSnapshot = hostMethod(isPlainObject(editing) ? editing.selection : void 0, "getSnapshot") ?? hostMethod(isPlainObject(handles) ? handles.selection : void 0, "getSnapshot");
|
|
6421
|
+
const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
|
|
6422
|
+
const getSnapshot = hostMethod(require__plugin_vue_export_helper.isPlainObject(editing) ? editing.selection : void 0, "getSnapshot") ?? hostMethod(require__plugin_vue_export_helper.isPlainObject(handles) ? handles.selection : void 0, "getSnapshot");
|
|
6473
6423
|
if (!getSnapshot) return null;
|
|
6474
6424
|
const snapshot = safeCall(() => getSnapshot(), null);
|
|
6475
6425
|
return snapshot && typeof snapshot === "object" ? snapshot : null;
|
|
@@ -6612,9 +6562,9 @@ function createSuperDocUI(options) {
|
|
|
6612
6562
|
const getSnapshot = hostMethod(getEditCommands(), "getSnapshot");
|
|
6613
6563
|
if (!getSnapshot) return null;
|
|
6614
6564
|
const snap = safeCall(() => getSnapshot(), null);
|
|
6615
|
-
const commands = isPlainObject(snap) ? snap.commands : void 0;
|
|
6616
|
-
const entry = isPlainObject(commands) ? commands[commandId] : void 0;
|
|
6617
|
-
return isPlainObject(entry) ? entry : null;
|
|
6565
|
+
const commands = require__plugin_vue_export_helper.isPlainObject(snap) ? snap.commands : void 0;
|
|
6566
|
+
const entry = require__plugin_vue_export_helper.isPlainObject(commands) ? commands[commandId] : void 0;
|
|
6567
|
+
return require__plugin_vue_export_helper.isPlainObject(entry) ? entry : null;
|
|
6618
6568
|
};
|
|
6619
6569
|
/** Read the `lists.apply` command state surfaced by the v2 edit-command snapshot. */
|
|
6620
6570
|
const readListApplyStateEntry = () => {
|
|
@@ -6643,7 +6593,7 @@ function createSuperDocUI(options) {
|
|
|
6643
6593
|
const getTableContext = hostMethod(getHost(), "getTableContext");
|
|
6644
6594
|
if (!getTableContext) return null;
|
|
6645
6595
|
const snapshot = safeCall(() => getTableContext(), null);
|
|
6646
|
-
return isPlainObject(snapshot) ? snapshot : null;
|
|
6596
|
+
return require__plugin_vue_export_helper.isPlainObject(snapshot) ? snapshot : null;
|
|
6647
6597
|
};
|
|
6648
6598
|
const resolveTableContext = () => {
|
|
6649
6599
|
const snapshot = readHostTableContext();
|
|
@@ -6687,12 +6637,12 @@ function createSuperDocUI(options) {
|
|
|
6687
6637
|
const readHandles = hostMethod(getHost(), "getHandles");
|
|
6688
6638
|
if (!readHandles) return;
|
|
6689
6639
|
const handles = safeCall(() => readHandles(), null);
|
|
6690
|
-
if (!isPlainObject(handles)) return;
|
|
6640
|
+
if (!require__plugin_vue_export_helper.isPlainObject(handles)) return;
|
|
6691
6641
|
const review = handles.review;
|
|
6692
6642
|
if (next) {
|
|
6693
6643
|
const setActiveReviewTarget = hostMethod(review, "setActiveReviewTarget");
|
|
6694
6644
|
if (!setActiveReviewTarget) return;
|
|
6695
|
-
const layout = isPlainObject(handles.layout) ? handles.layout : void 0;
|
|
6645
|
+
const layout = require__plugin_vue_export_helper.isPlainObject(handles.layout) ? handles.layout : void 0;
|
|
6696
6646
|
safeCall(() => setActiveReviewTarget({
|
|
6697
6647
|
entityType,
|
|
6698
6648
|
entityId: next.id,
|
|
@@ -6710,7 +6660,7 @@ function createSuperDocUI(options) {
|
|
|
6710
6660
|
const clearActiveReviewTarget = hostMethod(review, "clearActiveReviewTarget");
|
|
6711
6661
|
if (!getActiveReviewTarget || !clearActiveReviewTarget) return;
|
|
6712
6662
|
const activeTarget = safeCall(() => getActiveReviewTarget(), null);
|
|
6713
|
-
if (isPlainObject(activeTarget) && activeTarget.entityType === entityType) safeCall(() => clearActiveReviewTarget(), void 0);
|
|
6663
|
+
if (require__plugin_vue_export_helper.isPlainObject(activeTarget) && activeTarget.entityType === entityType) safeCall(() => clearActiveReviewTarget(), void 0);
|
|
6714
6664
|
};
|
|
6715
6665
|
const mirrorTrackedChangeFocusToHost = (next) => mirrorReviewFocusToHost("trackedChange", next);
|
|
6716
6666
|
const readReviewFocus = () => ({
|
|
@@ -6817,7 +6767,7 @@ function createSuperDocUI(options) {
|
|
|
6817
6767
|
if (existing?.generation === generation) return existing.promise;
|
|
6818
6768
|
const signal = uiTrackedChangesCatalogState.abortController.signal;
|
|
6819
6769
|
const validateResult = (result) => {
|
|
6820
|
-
const record = isPlainObject(result) ? result : void 0;
|
|
6770
|
+
const record = require__plugin_vue_export_helper.isPlainObject(result) ? result : void 0;
|
|
6821
6771
|
if (signal.aborted || generation !== uiTrackedChangesCatalogState.generation || record?.reason === "review-hydration-superseded") throw new Error("ui-review-catalog-superseded");
|
|
6822
6772
|
if (record?.ok === false) throw new Error(typeof record.reason === "string" ? record.reason : "ui-review-catalog-read-failed");
|
|
6823
6773
|
return result;
|
|
@@ -6914,7 +6864,7 @@ function createSuperDocUI(options) {
|
|
|
6914
6864
|
if (disposed) return;
|
|
6915
6865
|
for (const listener of [...listeners]) listener(state);
|
|
6916
6866
|
};
|
|
6917
|
-
const record = isPlainObject(receipt) ? receipt : null;
|
|
6867
|
+
const record = require__plugin_vue_export_helper.isPlainObject(receipt) ? receipt : null;
|
|
6918
6868
|
const readiness = getEditor()?.documentMutationReadiness;
|
|
6919
6869
|
const waitForPostPaintTask = () => {
|
|
6920
6870
|
const requestFrame = globalThis.requestAnimationFrame;
|
|
@@ -7562,6 +7512,23 @@ function createSuperDocUI(options) {
|
|
|
7562
7512
|
const clearAsyncReadKeys = (predicate) => {
|
|
7563
7513
|
for (const key of asyncReads.keys()) if (predicate(key)) asyncReads.delete(key);
|
|
7564
7514
|
};
|
|
7515
|
+
const seedAsyncRead = (key, token, value, inflightToken = null) => {
|
|
7516
|
+
asyncReads.set(key, {
|
|
7517
|
+
token,
|
|
7518
|
+
value,
|
|
7519
|
+
hasSettled: true,
|
|
7520
|
+
inflightToken
|
|
7521
|
+
});
|
|
7522
|
+
};
|
|
7523
|
+
const selectionValidationSnapshot = () => ({
|
|
7524
|
+
held: typedCaretValidationHeld,
|
|
7525
|
+
pendingToken: pendingSelectionSeedValidationToken
|
|
7526
|
+
});
|
|
7527
|
+
const setSelectionValidation = (next) => {
|
|
7528
|
+
typedCaretValidationHeld = next.held;
|
|
7529
|
+
pendingSelectionSeedValidationToken = next.pendingToken;
|
|
7530
|
+
};
|
|
7531
|
+
const typingIsRecent = () => Date.now() - lastTypingMutationAtMs < HEAVY_READ_IDLE_MS;
|
|
7565
7532
|
const selectionScopedAsyncReadKeys = (selection) => {
|
|
7566
7533
|
const signature = selectionSignature(selection);
|
|
7567
7534
|
const effectiveUniformityKey = effectiveInlineUniformityCacheKey(selection);
|
|
@@ -7691,7 +7658,7 @@ function createSuperDocUI(options) {
|
|
|
7691
7658
|
if (fromConfig) return fromConfig;
|
|
7692
7659
|
const getActiveRuntime = hostMethod(superdocRecord, "getActiveRuntime");
|
|
7693
7660
|
const runtimeSnapshot = safeCall(getActiveRuntime ? () => hostMethod(getActiveRuntime(), "getSnapshot")?.() ?? null : void 0, null);
|
|
7694
|
-
const fromRuntime = normalizeDocumentMode(isPlainObject(runtimeSnapshot) ? runtimeSnapshot.documentMode : void 0);
|
|
7661
|
+
const fromRuntime = normalizeDocumentMode(require__plugin_vue_export_helper.isPlainObject(runtimeSnapshot) ? runtimeSnapshot.documentMode : void 0);
|
|
7695
7662
|
const fromOptions = normalizeDocumentMode((editor?.options)?.documentMode);
|
|
7696
7663
|
return fromRuntime ?? fromOptions;
|
|
7697
7664
|
};
|
|
@@ -7804,11 +7771,11 @@ function createSuperDocUI(options) {
|
|
|
7804
7771
|
if (!host || !editor || !mount || !lifetime || lifetime.aborted || mode === null || seed.empty || seed.tableSelection?.kind !== "tableCells" || seed.tableSelection.type !== "table" || seed.target?.kind !== "text" || !seed.target.segments.length) return false;
|
|
7805
7772
|
if (nativeSelection) {
|
|
7806
7773
|
const presentation = safeCall(() => hostMethod(host, "readAppliedSelectionPresentation")?.(), null);
|
|
7807
|
-
const applied = normalizeSelectionInfo(isPlainObject(presentation) ? presentation.selection : null);
|
|
7774
|
+
const applied = normalizeSelectionInfo(require__plugin_vue_export_helper.isPlainObject(presentation) ? presentation.selection : null);
|
|
7808
7775
|
if (readHostSelectionSnapshot() !== nativeSelection || !isNonCollapsedHostSelection(nativeSelection) || !applied || selectionSignature(selectionSliceFromInfo(applied, "ready")) !== selectionSignature(selectionSliceFromInfo(seed, "ready")) || JSON.stringify(applied.tableSelection) !== JSON.stringify(seed.tableSelection)) return false;
|
|
7809
7776
|
const snapshot = nativeSelection;
|
|
7810
7777
|
const first = seed.target.segments[0]?.blockId, last = seed.target.segments.at(-1)?.blockId;
|
|
7811
|
-
const matches = (point, blockId) => !!blockId && isPlainObject(point) && point.blockId === blockId && storyLocatorSignature(point.story ?? snapshot.story) === storyLocatorSignature(seed.target?.story);
|
|
7778
|
+
const matches = (point, blockId) => !!blockId && require__plugin_vue_export_helper.isPlainObject(point) && point.blockId === blockId && storyLocatorSignature(point.story ?? snapshot.story) === storyLocatorSignature(seed.target?.story);
|
|
7812
7779
|
if (!(matches(snapshot.anchor, first) && matches(snapshot.focus, last) || matches(snapshot.focus, first) && matches(snapshot.anchor, last))) return false;
|
|
7813
7780
|
}
|
|
7814
7781
|
wholeTableParagraphSeed = {
|
|
@@ -7829,16 +7796,13 @@ function createSuperDocUI(options) {
|
|
|
7829
7796
|
const foreground = foregroundMutationState();
|
|
7830
7797
|
if (isNonCollapsedHostSelection(hostSelectionSnapshot) && readHostSelectionSnapshot() === hostSelectionSnapshot) {
|
|
7831
7798
|
const seed = normalizeSelectionInfo(safeCall(() => hostMethod(host, "readLiveSelectionSyncSnapshot")?.(), null));
|
|
7832
|
-
if (seed && !seed.selectionTarget && captureWholeTableParagraphSeed(host, seed, hostSelectionSnapshot)) asyncReads.
|
|
7833
|
-
token: asyncReads.get("selection")?.token ?? null,
|
|
7834
|
-
value: seed,
|
|
7835
|
-
hasSettled: true,
|
|
7836
|
-
inflightToken: null
|
|
7837
|
-
});
|
|
7799
|
+
if (seed && !seed.selectionTarget && captureWholeTableParagraphSeed(host, seed, hostSelectionSnapshot)) seedAsyncRead("selection", asyncReads.get("selection")?.token ?? null, seed);
|
|
7838
7800
|
}
|
|
7839
7801
|
if (isNonCollapsedHostSelection(hostSelectionSnapshot) && !(foreground && foreground.active > 0)) {
|
|
7840
|
-
|
|
7841
|
-
|
|
7802
|
+
setSelectionValidation({
|
|
7803
|
+
held: false,
|
|
7804
|
+
pendingToken: null
|
|
7805
|
+
});
|
|
7842
7806
|
issueAsyncRead("selection", selectionReadToken(), selectionCurrentRun, normalizeSelectionInfo);
|
|
7843
7807
|
return;
|
|
7844
7808
|
}
|
|
@@ -7847,17 +7811,14 @@ function createSuperDocUI(options) {
|
|
|
7847
7811
|
const seed = normalizeSelectionInfo(safeCall(() => read.call(host), null));
|
|
7848
7812
|
if (!seed) return;
|
|
7849
7813
|
if (wholeTableSelectionChanged) {
|
|
7850
|
-
|
|
7851
|
-
|
|
7814
|
+
setSelectionValidation({
|
|
7815
|
+
held: false,
|
|
7816
|
+
pendingToken: null
|
|
7817
|
+
});
|
|
7852
7818
|
wholeTableParagraphSeed = null;
|
|
7853
7819
|
captureWholeTableParagraphSeed(host, seed, initialTableSelection);
|
|
7854
7820
|
const token = selectionReadToken();
|
|
7855
|
-
|
|
7856
|
-
token,
|
|
7857
|
-
value: seed,
|
|
7858
|
-
hasSettled: true,
|
|
7859
|
-
inflightToken: null
|
|
7860
|
-
});
|
|
7821
|
+
seedAsyncRead("selection", token, seed);
|
|
7861
7822
|
issueAsyncRead("selection", token, selectionCurrentRun, normalizeSelectionInfo);
|
|
7862
7823
|
return;
|
|
7863
7824
|
}
|
|
@@ -7867,14 +7828,25 @@ function createSuperDocUI(options) {
|
|
|
7867
7828
|
const previousRange = previousCaret?.range;
|
|
7868
7829
|
const nextRange = nextCaret?.range;
|
|
7869
7830
|
const sameSeedCaret = Boolean(previousCaret && nextCaret && previousCaret.blockId === nextCaret.blockId && storyLocatorSignature(previousCaret.story) === storyLocatorSignature(nextCaret.story) && previousRange?.start === nextRange?.start);
|
|
7870
|
-
|
|
7831
|
+
const validation = selectionValidationSnapshot();
|
|
7832
|
+
const held = Boolean(foreground && foreground.active > 0) || validation.held && (afterTypingPaint || sameSeedCaret);
|
|
7833
|
+
setSelectionValidation({
|
|
7834
|
+
held,
|
|
7835
|
+
pendingToken: validation.pendingToken
|
|
7836
|
+
});
|
|
7871
7837
|
const token = selectionReadToken();
|
|
7872
|
-
const deferAuthoritativeRead = Boolean(foreground && (foreground.active > 0 || foreground.pending > 0)) ||
|
|
7838
|
+
const deferAuthoritativeRead = Boolean(foreground && (foreground.active > 0 || foreground.pending > 0)) || held && typingIsRecent();
|
|
7873
7839
|
if (!deferAuthoritativeRead) {
|
|
7874
|
-
|
|
7840
|
+
setSelectionValidation({
|
|
7841
|
+
held,
|
|
7842
|
+
pendingToken: null
|
|
7843
|
+
});
|
|
7875
7844
|
if (issueAsyncRead("selection", token, selectionCurrentRun, normalizeSelectionInfo)) return;
|
|
7876
7845
|
} else {
|
|
7877
|
-
|
|
7846
|
+
setSelectionValidation({
|
|
7847
|
+
held,
|
|
7848
|
+
pendingToken: token
|
|
7849
|
+
});
|
|
7878
7850
|
scheduleForegroundAsyncRetry();
|
|
7879
7851
|
}
|
|
7880
7852
|
const prev = asyncReads.get("selection");
|
|
@@ -7884,25 +7856,20 @@ function createSuperDocUI(options) {
|
|
|
7884
7856
|
const sameActiveTypingCaret = Boolean(foreground && foreground.active > 0 && previousCaret && nextCaret && previousCaret.blockId === nextCaret.blockId && storyLocatorSignature(previousCaret.story) === storyLocatorSignature(nextCaret.story) && typeof previousRange?.start === "number" && typeof nextRange?.start === "number" && Math.abs(nextRange.start - previousRange.start) <= 2);
|
|
7885
7857
|
const carriedChangeIds = paintedTrackChangeId != null || sameActiveTypingCaret ? state.selection.activeChangeIds.filter((id) => paintedTrackChangeId == null || buildTrackedChangeIdContext(state.trackChanges.items).aliasesFor(id).includes(paintedTrackChangeId)) : [];
|
|
7886
7858
|
const seedChangeIds = Array.isArray(seed.activeChangeIds) && seed.activeChangeIds.length > 0 ? seed.activeChangeIds : carriedChangeIds;
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
activeChangeIds: seedChangeIds
|
|
7894
|
-
},
|
|
7895
|
-
hasSettled: true,
|
|
7896
|
-
inflightToken: deferAuthoritativeRead ? null : prev?.inflightToken ?? null
|
|
7897
|
-
});
|
|
7859
|
+
seedAsyncRead("selection", token, {
|
|
7860
|
+
...seed,
|
|
7861
|
+
activeMarks: seedMarks,
|
|
7862
|
+
activeCommentIds: seedCommentIds,
|
|
7863
|
+
activeChangeIds: seedChangeIds
|
|
7864
|
+
}, deferAuthoritativeRead ? null : prev?.inflightToken ?? null);
|
|
7898
7865
|
};
|
|
7899
7866
|
const selectionInfoMatchesHost = (info) => {
|
|
7900
7867
|
const snapshot = readHostSelectionSnapshot();
|
|
7901
7868
|
const target = info?.selectionTarget;
|
|
7902
7869
|
if (!snapshot || target?.kind !== "selection") return false;
|
|
7903
7870
|
const matches = (rawPoint, rawEndpoint) => {
|
|
7904
|
-
const point = isPlainObject(rawPoint) ? rawPoint : void 0;
|
|
7905
|
-
const endpoint = isPlainObject(rawEndpoint) ? rawEndpoint : void 0;
|
|
7871
|
+
const point = require__plugin_vue_export_helper.isPlainObject(rawPoint) ? rawPoint : void 0;
|
|
7872
|
+
const endpoint = require__plugin_vue_export_helper.isPlainObject(rawEndpoint) ? rawEndpoint : void 0;
|
|
7906
7873
|
const offset = target.coordinateSpace === "tracked" ? endpoint?.trackedBlockOffset : endpoint?.blockOffset;
|
|
7907
7874
|
return point?.kind === "text" && typeof point.blockId === "string" && point.blockId === endpoint?.blockId && typeof point.offset === "number" && point.offset === offset && storyLocatorSignature(point.story ?? target.story) === storyLocatorSignature(endpoint?.story ?? snapshot.story);
|
|
7908
7875
|
};
|
|
@@ -7916,12 +7883,7 @@ function createSuperDocUI(options) {
|
|
|
7916
7883
|
const sourceToken = contentToken();
|
|
7917
7884
|
const mode = readDocumentMode();
|
|
7918
7885
|
if (typeof current !== "function") {
|
|
7919
|
-
|
|
7920
|
-
token,
|
|
7921
|
-
value: null,
|
|
7922
|
-
hasSettled: true,
|
|
7923
|
-
inflightToken: null
|
|
7924
|
-
});
|
|
7886
|
+
seedAsyncRead("selection", token, null);
|
|
7925
7887
|
recompute();
|
|
7926
7888
|
return selectionSliceFromInfo(null, "pending");
|
|
7927
7889
|
}
|
|
@@ -7938,12 +7900,7 @@ function createSuperDocUI(options) {
|
|
|
7938
7900
|
if (disposed) return selectionSliceFromInfo(null, "pending");
|
|
7939
7901
|
const info = normalizeSelectionInfo(raw);
|
|
7940
7902
|
if (selectionReadToken() !== token && !(getDoc() === doc && contentToken() === sourceToken && readDocumentMode() === mode && selectionInfoMatchesHost(info))) return attempt < 1 ? readSelectionInfoFresh(attempt + 1) : selectionSliceFromInfo(null, "pending");
|
|
7941
|
-
|
|
7942
|
-
token: selectionReadToken(),
|
|
7943
|
-
value: info,
|
|
7944
|
-
hasSettled: true,
|
|
7945
|
-
inflightToken: null
|
|
7946
|
-
});
|
|
7903
|
+
seedAsyncRead("selection", selectionReadToken(), info);
|
|
7947
7904
|
const selection = selectionSliceFromInfo(info, info ? "ready" : "pending");
|
|
7948
7905
|
recompute();
|
|
7949
7906
|
return selection;
|
|
@@ -7965,7 +7922,7 @@ function createSuperDocUI(options) {
|
|
|
7965
7922
|
const readCommentsDirectory = () => {
|
|
7966
7923
|
const listComments = hostMethod(getDoc()?.comments, "list");
|
|
7967
7924
|
return readAsync("comments", contentToken(), () => listComments ? listComments() : void 0, (raw) => {
|
|
7968
|
-
const items = isPlainObject(raw) ? raw.items : void 0;
|
|
7925
|
+
const items = require__plugin_vue_export_helper.isPlainObject(raw) ? raw.items : void 0;
|
|
7969
7926
|
return Array.isArray(items) ? realComments(items) : [];
|
|
7970
7927
|
});
|
|
7971
7928
|
};
|
|
@@ -8215,7 +8172,7 @@ function createSuperDocUI(options) {
|
|
|
8215
8172
|
const selectionTarget = selection.target;
|
|
8216
8173
|
let selectionAnchor;
|
|
8217
8174
|
if (explicitTarget) {
|
|
8218
|
-
const explicitStart = isPlainObject(explicitTarget.start) ? explicitTarget.start : void 0;
|
|
8175
|
+
const explicitStart = require__plugin_vue_export_helper.isPlainObject(explicitTarget.start) ? explicitTarget.start : void 0;
|
|
8219
8176
|
if (explicitTarget.kind !== "selection" || explicitStart?.kind !== "text" || typeof explicitStart.blockId !== "string" || typeof explicitStart.offset !== "number") return retainSettledActiveContentControls([], status);
|
|
8220
8177
|
selectionAnchor = {
|
|
8221
8178
|
blockId: explicitStart.blockId,
|
|
@@ -8311,7 +8268,7 @@ function createSuperDocUI(options) {
|
|
|
8311
8268
|
}
|
|
8312
8269
|
const getSnapshot = hostMethod(source, "getSnapshot");
|
|
8313
8270
|
const snapshot = getSnapshot ? safeCall(() => getSnapshot(), null) : null;
|
|
8314
|
-
const { undoDepth, redoDepth } = (isPlainObject(snapshot) && isPlainObject(snapshot.history) ? snapshot.history : null) ?? {};
|
|
8271
|
+
const { undoDepth, redoDepth } = (require__plugin_vue_export_helper.isPlainObject(snapshot) && require__plugin_vue_export_helper.isPlainObject(snapshot.history) ? snapshot.history : null) ?? {};
|
|
8315
8272
|
if (typeof undoDepth !== "number" || typeof redoDepth !== "number") return historySlice;
|
|
8316
8273
|
const next = {
|
|
8317
8274
|
canUndo: undoDepth > 0,
|
|
@@ -8326,11 +8283,11 @@ function createSuperDocUI(options) {
|
|
|
8326
8283
|
const computeZoom = () => {
|
|
8327
8284
|
const getZoomState = hostMethod(superdoc, "getZoomState");
|
|
8328
8285
|
const rawState = safeCall(getZoomState ? () => getZoomState() : void 0, null);
|
|
8329
|
-
const state = isPlainObject(rawState) ? rawState : null;
|
|
8286
|
+
const state = require__plugin_vue_export_helper.isPlainObject(rawState) ? rawState : null;
|
|
8330
8287
|
const value = typeof state?.value === "number" ? state.value : 100;
|
|
8331
8288
|
const rawMode = state?.mode;
|
|
8332
8289
|
const mode = rawMode === "manual" || rawMode === "fit-width" ? rawMode : rawMode === "fixed" ? "manual" : null;
|
|
8333
|
-
const fit = isPlainObject(state?.fitWidth) ? state.fitWidth : void 0;
|
|
8290
|
+
const fit = require__plugin_vue_export_helper.isPlainObject(state?.fitWidth) ? state.fitWidth : void 0;
|
|
8334
8291
|
const min = typeof fit?.min === "number" ? fit.min : typeof state?.min === "number" ? state.min : 10;
|
|
8335
8292
|
const max = typeof fit?.max === "number" ? fit.max : typeof state?.max === "number" ? state.max : 100;
|
|
8336
8293
|
if (!zoomFitWidth || zoomFitWidth.min !== min || zoomFitWidth.max !== max) zoomFitWidth = {
|
|
@@ -8830,7 +8787,7 @@ function createSuperDocUI(options) {
|
|
|
8830
8787
|
storyType: "body"
|
|
8831
8788
|
}
|
|
8832
8789
|
}));
|
|
8833
|
-
return isPlainObject(raw) ? raw : void 0;
|
|
8790
|
+
return require__plugin_vue_export_helper.isPlainObject(raw) ? raw : void 0;
|
|
8834
8791
|
};
|
|
8835
8792
|
/**
|
|
8836
8793
|
* Returns the settled status of the query.match read backing the current
|
|
@@ -8970,8 +8927,8 @@ function createSuperDocUI(options) {
|
|
|
8970
8927
|
};
|
|
8971
8928
|
const hostCommandSupport = (command) => {
|
|
8972
8929
|
const capabilities = safeCall(hostMethod(getHost(), "getCapabilities") ?? void 0, null);
|
|
8973
|
-
const editableSubset = isPlainObject(capabilities) ? capabilities.editableSubset : void 0;
|
|
8974
|
-
const commands = isPlainObject(editableSubset) ? editableSubset.commands : void 0;
|
|
8930
|
+
const editableSubset = require__plugin_vue_export_helper.isPlainObject(capabilities) ? capabilities.editableSubset : void 0;
|
|
8931
|
+
const commands = require__plugin_vue_export_helper.isPlainObject(editableSubset) ? editableSubset.commands : void 0;
|
|
8975
8932
|
if (Array.isArray(commands)) return commands.find((entry) => entry?.command === command || entry?.id === command) ?? null;
|
|
8976
8933
|
if (commands && typeof commands === "object") {
|
|
8977
8934
|
const record = commands[command];
|
|
@@ -9292,8 +9249,8 @@ function createSuperDocUI(options) {
|
|
|
9292
9249
|
/** Read one block's list state and cache status through the selected story's list-state seam. */
|
|
9293
9250
|
const readListStateSnapshotForBlock = (doc, blockId, story, selection) => {
|
|
9294
9251
|
const applied = doc === getDoc() ? appliedSelectionPresentation(selection)?.listState : null;
|
|
9295
|
-
const appliedValue = isPlainObject(applied) ? applied.value : void 0;
|
|
9296
|
-
if (isPlainObject(applied) && applied.blockId === blockId && isPlainObject(applied.story) && storyLocatorSignature(applied.story) === storyLocatorSignature(story) && isPlainObject(appliedValue) && appliedValue.success === true) return {
|
|
9252
|
+
const appliedValue = require__plugin_vue_export_helper.isPlainObject(applied) ? applied.value : void 0;
|
|
9253
|
+
if (require__plugin_vue_export_helper.isPlainObject(applied) && applied.blockId === blockId && require__plugin_vue_export_helper.isPlainObject(applied.story) && storyLocatorSignature(applied.story) === storyLocatorSignature(story) && require__plugin_vue_export_helper.isPlainObject(appliedValue) && appliedValue.success === true) return {
|
|
9297
9254
|
value: appliedValue,
|
|
9298
9255
|
status: "ready"
|
|
9299
9256
|
};
|
|
@@ -9395,7 +9352,7 @@ function createSuperDocUI(options) {
|
|
|
9395
9352
|
const applied = appliedSelectionPresentation(selection);
|
|
9396
9353
|
if (applied) return new Map(blockIds.flatMap((id) => {
|
|
9397
9354
|
const alignments = applied.paragraphAlignments;
|
|
9398
|
-
const alignment = normalizeParagraphAlignment(isPlainObject(alignments) ? alignments[id] : void 0);
|
|
9355
|
+
const alignment = normalizeParagraphAlignment(require__plugin_vue_export_helper.isPlainObject(alignments) ? alignments[id] : void 0);
|
|
9399
9356
|
return alignment ? [[id, alignment]] : [];
|
|
9400
9357
|
}));
|
|
9401
9358
|
const host = getHost();
|
|
@@ -10221,9 +10178,9 @@ function createSuperDocUI(options) {
|
|
|
10221
10178
|
let detachDocumentSelection = null;
|
|
10222
10179
|
const readHostSelectionSource = () => {
|
|
10223
10180
|
const handles = safeCall(hostMethod(getEditor()?.host, "getHandles") ?? void 0, null);
|
|
10224
|
-
const editing = isPlainObject(handles) ? handles.editing : void 0;
|
|
10225
|
-
const selection = isPlainObject(editing) ? editing.selection : void 0;
|
|
10226
|
-
return isPlainObject(selection) && typeof selection.subscribe === "function" ? selection : null;
|
|
10181
|
+
const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
|
|
10182
|
+
const selection = require__plugin_vue_export_helper.isPlainObject(editing) ? editing.selection : void 0;
|
|
10183
|
+
return require__plugin_vue_export_helper.isPlainObject(selection) && typeof selection.subscribe === "function" ? selection : null;
|
|
10227
10184
|
};
|
|
10228
10185
|
const caretSelectionNeedsProjectionPaint = () => {
|
|
10229
10186
|
const host = getHost();
|
|
@@ -10264,7 +10221,7 @@ function createSuperDocUI(options) {
|
|
|
10264
10221
|
});
|
|
10265
10222
|
if (typeof unsubscribe === "function") unsubscribeCallbacks.push(() => unsubscribe());
|
|
10266
10223
|
const handles = safeCall(hostMethod(getHost(), "getHandles") ?? void 0, null);
|
|
10267
|
-
const tableSelection = isPlainObject(handles) ? handles.selection : void 0;
|
|
10224
|
+
const tableSelection = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.selection : void 0;
|
|
10268
10225
|
const subscribeWholeTable = hostMethod(tableSelection, "subscribeWholeTable");
|
|
10269
10226
|
if (subscribeWholeTable) {
|
|
10270
10227
|
const refreshWholeTable = (initial = false) => {
|
|
@@ -10283,8 +10240,8 @@ function createSuperDocUI(options) {
|
|
|
10283
10240
|
};
|
|
10284
10241
|
const readHostReviewSource = () => {
|
|
10285
10242
|
const handles = safeCall(hostMethod(getEditor()?.host, "getHandles") ?? void 0, null);
|
|
10286
|
-
const review = isPlainObject(handles) ? handles.review : void 0;
|
|
10287
|
-
return isPlainObject(review) && typeof review.subscribe === "function" ? review : null;
|
|
10243
|
+
const review = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.review : void 0;
|
|
10244
|
+
return require__plugin_vue_export_helper.isPlainObject(review) && typeof review.subscribe === "function" ? review : null;
|
|
10288
10245
|
};
|
|
10289
10246
|
const readHostActiveReviewTarget = (review) => {
|
|
10290
10247
|
const getActiveReviewTarget = hostMethod(review, "getActiveReviewTarget");
|
|
@@ -10292,11 +10249,11 @@ function createSuperDocUI(options) {
|
|
|
10292
10249
|
const getSnapshot = hostMethod(review, "getSnapshot");
|
|
10293
10250
|
if (!getSnapshot) return null;
|
|
10294
10251
|
const snapshot = safeCall(() => getSnapshot(), null);
|
|
10295
|
-
return isPlainObject(snapshot) ? snapshot.activeReviewTarget ?? null : null;
|
|
10252
|
+
return require__plugin_vue_export_helper.isPlainObject(snapshot) ? snapshot.activeReviewTarget ?? null : null;
|
|
10296
10253
|
};
|
|
10297
10254
|
let trackedChangeNavigationInFlight = 0;
|
|
10298
10255
|
let lastPublishedHostReviewTarget;
|
|
10299
|
-
const isRepublishedHostReviewTarget = (left, right) => left === right || isPlainObject(left) && isPlainObject(right) && left.layoutEpoch !== right.layoutEpoch && left.origin === right.origin && left.entityType === right.entityType && left.entityId === right.entityId && left.paintedEntityId === right.paintedEntityId && storyLocatorSignature(left.story) === storyLocatorSignature(right.story);
|
|
10256
|
+
const isRepublishedHostReviewTarget = (left, right) => left === right || require__plugin_vue_export_helper.isPlainObject(left) && require__plugin_vue_export_helper.isPlainObject(right) && left.layoutEpoch !== right.layoutEpoch && left.origin === right.origin && left.entityType === right.entityType && left.entityId === right.entityId && left.paintedEntityId === right.paintedEntityId && storyLocatorSignature(left.story) === storyLocatorSignature(right.story);
|
|
10300
10257
|
const syncTrackedChangeFocusFromHostReviewTarget = (rawTarget, rawSnapshot) => {
|
|
10301
10258
|
const rejection = (rawSnapshot && typeof rawSnapshot === "object" ? rawSnapshot : null)?.lastInteractionRejection;
|
|
10302
10259
|
if (rawTarget == null && rejection && typeof rejection === "object" && rejection.code === "review-target-invalidated" && rejection.detail === "not-painted" && (explicitActiveChange || explicitActiveCommentId)) return false;
|
|
@@ -10315,7 +10272,7 @@ function createSuperDocUI(options) {
|
|
|
10315
10272
|
return true;
|
|
10316
10273
|
}
|
|
10317
10274
|
const previousTarget = lastPublishedHostReviewTarget?.raw;
|
|
10318
|
-
if (!target && isPlainObject(previousTarget) && previousTarget.entityType === "comment") {
|
|
10275
|
+
if (!target && require__plugin_vue_export_helper.isPlainObject(previousTarget) && previousTarget.entityType === "comment") {
|
|
10319
10276
|
lastPublishedHostReviewTarget = {
|
|
10320
10277
|
raw: rawTarget,
|
|
10321
10278
|
focus: null,
|
|
@@ -10463,7 +10420,7 @@ function createSuperDocUI(options) {
|
|
|
10463
10420
|
const syncHostEventsSubscription = () => {
|
|
10464
10421
|
const host = getEditor()?.host;
|
|
10465
10422
|
const events = host?.events;
|
|
10466
|
-
const next = isPlainObject(events) && typeof events.subscribe === "function" ? events : null;
|
|
10423
|
+
const next = require__plugin_vue_export_helper.isPlainObject(events) && typeof events.subscribe === "function" ? events : null;
|
|
10467
10424
|
if (next === currentHostEventsSource) return;
|
|
10468
10425
|
if (detachHostEvents) {
|
|
10469
10426
|
detachHostEvents();
|
|
@@ -11278,11 +11235,11 @@ function createSuperDocUI(options) {
|
|
|
11278
11235
|
}
|
|
11279
11236
|
function captureInputSelectionTarget(requireTableCells = false) {
|
|
11280
11237
|
const handles = safeCall(() => hostMethod(getHost(), "getHandles")?.(), null);
|
|
11281
|
-
const selection = isPlainObject(handles) ? handles.selection : void 0;
|
|
11238
|
+
const selection = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.selection : void 0;
|
|
11282
11239
|
const held = hostMethod(selection, "getSnapshot")?.();
|
|
11283
|
-
if (requireTableCells && (!isPlainObject(held) || !held.tableCells)) return null;
|
|
11240
|
+
if (requireTableCells && (!require__plugin_vue_export_helper.isPlainObject(held) || !held.tableCells)) return null;
|
|
11284
11241
|
const resolved = hostMethod(selection, "toSelectionTarget")?.();
|
|
11285
|
-
return isPlainObject(resolved) && resolved.kind === "ok" && resolved.mode === "range" ? capturedTableCellTarget(resolved.target) : null;
|
|
11242
|
+
return require__plugin_vue_export_helper.isPlainObject(resolved) && resolved.kind === "ok" && resolved.mode === "range" ? capturedTableCellTarget(resolved.target) : null;
|
|
11286
11243
|
}
|
|
11287
11244
|
function currentUnrepresentableSelectionTarget(selection) {
|
|
11288
11245
|
if (selection.empty || selection.selectionTarget || selection.target?.kind !== "text") return null;
|
|
@@ -11305,8 +11262,8 @@ function createSuperDocUI(options) {
|
|
|
11305
11262
|
}
|
|
11306
11263
|
function tableCellSelectionForTarget(target) {
|
|
11307
11264
|
const cellTarget = currentCellSelectionTarget();
|
|
11308
|
-
const start = isPlainObject(target) && isPlainObject(target.start) ? target.start : void 0;
|
|
11309
|
-
const end = isPlainObject(target) && isPlainObject(target.end) ? target.end : void 0;
|
|
11265
|
+
const start = require__plugin_vue_export_helper.isPlainObject(target) && require__plugin_vue_export_helper.isPlainObject(target.start) ? target.start : void 0;
|
|
11266
|
+
const end = require__plugin_vue_export_helper.isPlainObject(target) && require__plugin_vue_export_helper.isPlainObject(target.end) ? target.end : void 0;
|
|
11310
11267
|
if (!cellTarget || start?.blockId !== cellTarget.start.blockId || end?.blockId !== cellTarget.end.blockId || start?.offset !== cellTarget.start.offset || end?.offset !== cellTarget.end.offset) return null;
|
|
11311
11268
|
return {
|
|
11312
11269
|
anchorBlockId: cellTarget.start.blockId,
|
|
@@ -11679,16 +11636,16 @@ function createSuperDocUI(options) {
|
|
|
11679
11636
|
const linksApi = doc?.hyperlinks;
|
|
11680
11637
|
if (!linksApi) return false;
|
|
11681
11638
|
const hyperlinkHandles = hostMethod(getHost(), "getHandles")?.();
|
|
11682
|
-
const hyperlinkEditing = isPlainObject(hyperlinkHandles) ? hyperlinkHandles.editing : void 0;
|
|
11683
|
-
const trustedHyperlinks = isPlainObject(hyperlinkEditing) ? hyperlinkEditing.hyperlinks : void 0;
|
|
11684
|
-
const trustedLinksApi = firstPartyCommandDoc ? isPlainObject(trustedHyperlinks) ? trustedHyperlinks : void 0 : linksApi;
|
|
11639
|
+
const hyperlinkEditing = require__plugin_vue_export_helper.isPlainObject(hyperlinkHandles) ? hyperlinkHandles.editing : void 0;
|
|
11640
|
+
const trustedHyperlinks = require__plugin_vue_export_helper.isPlainObject(hyperlinkEditing) ? hyperlinkEditing.hyperlinks : void 0;
|
|
11641
|
+
const trustedLinksApi = firstPartyCommandDoc ? require__plugin_vue_export_helper.isPlainObject(trustedHyperlinks) ? trustedHyperlinks : void 0 : linksApi;
|
|
11685
11642
|
const record = readLinkPayloadRecord(payload);
|
|
11686
11643
|
const href = readLinkPayloadHref(payload);
|
|
11687
11644
|
const payloadTarget = readLinkPayloadTarget(payload);
|
|
11688
11645
|
const text = typeof record.text === "string" ? record.text : void 0;
|
|
11689
11646
|
const currentText = typeof record.currentText === "string" ? record.currentText : void 0;
|
|
11690
|
-
const requestedHyperlinkTarget = isPlainObject(record.hyperlinkTarget) ? record.hyperlinkTarget : null;
|
|
11691
|
-
const requestedTextTarget = isPlainObject(record.textTarget) ? record.textTarget : null;
|
|
11647
|
+
const requestedHyperlinkTarget = require__plugin_vue_export_helper.isPlainObject(record.hyperlinkTarget) ? record.hyperlinkTarget : null;
|
|
11648
|
+
const requestedTextTarget = require__plugin_vue_export_helper.isPlainObject(record.textTarget) ? record.textTarget : null;
|
|
11692
11649
|
const hasRequestedHyperlinkTarget = typeof requestedHyperlinkTarget?.storyId === "string" && typeof requestedHyperlinkTarget?.hyperlinkNodeId === "string";
|
|
11693
11650
|
const textTargets = textAddressesFromTarget(payloadTarget);
|
|
11694
11651
|
const caretTarget = collapsedTextAddressFromTarget(payloadTarget);
|
|
@@ -11881,10 +11838,10 @@ function createSuperDocUI(options) {
|
|
|
11881
11838
|
const story = selectionStoryLocator(linkSelection);
|
|
11882
11839
|
try {
|
|
11883
11840
|
const reads = blockIds.map((blockId) => listLinks({ within: paragraphTarget(blockId, story) }));
|
|
11884
|
-
const validReports = (reports) => reports.every((report) => isPlainObject(report) && Array.isArray(report.items));
|
|
11841
|
+
const validReports = (reports) => reports.every((report) => require__plugin_vue_export_helper.isPlainObject(report) && Array.isArray(report.items));
|
|
11885
11842
|
const existingFrom = (reports) => {
|
|
11886
11843
|
for (const report of reports) {
|
|
11887
|
-
const hit = (isPlainObject(report) && Array.isArray(report.items) ? report.items : []).find((item) => hyperlinkOverlapsSelection(item, linkSelection));
|
|
11844
|
+
const hit = (require__plugin_vue_export_helper.isPlainObject(report) && Array.isArray(report.items) ? report.items : []).find((item) => hyperlinkOverlapsSelection(item, linkSelection));
|
|
11888
11845
|
if (hit) return hit;
|
|
11889
11846
|
}
|
|
11890
11847
|
return null;
|
|
@@ -11940,7 +11897,7 @@ function createSuperDocUI(options) {
|
|
|
11940
11897
|
if (nonBodyStory && at.kind === "after") at = {
|
|
11941
11898
|
...at,
|
|
11942
11899
|
target: {
|
|
11943
|
-
...isPlainObject(at.target) ? at.target : {},
|
|
11900
|
+
...require__plugin_vue_export_helper.isPlainObject(at.target) ? at.target : {},
|
|
11944
11901
|
story: nonBodyStory
|
|
11945
11902
|
}
|
|
11946
11903
|
};
|
|
@@ -11984,12 +11941,12 @@ function createSuperDocUI(options) {
|
|
|
11984
11941
|
if (!host) return null;
|
|
11985
11942
|
if (firstPartyCommandDoc !== void 0) {
|
|
11986
11943
|
const handles = hostMethod(host, "getHandles")?.();
|
|
11987
|
-
const editing = isPlainObject(handles) ? handles.editing : void 0;
|
|
11988
|
-
const commands = isPlainObject(editing) ? editing.fields : void 0;
|
|
11989
|
-
return isPlainObject(commands) ? commands : null;
|
|
11944
|
+
const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
|
|
11945
|
+
const commands = require__plugin_vue_export_helper.isPlainObject(editing) ? editing.fields : void 0;
|
|
11946
|
+
return require__plugin_vue_export_helper.isPlainObject(commands) ? commands : null;
|
|
11990
11947
|
}
|
|
11991
11948
|
const commands = hostMethod(host, "getCodeFieldEditingCommands")?.();
|
|
11992
|
-
return isPlainObject(commands) ? commands : null;
|
|
11949
|
+
return require__plugin_vue_export_helper.isPlainObject(commands) ? commands : null;
|
|
11993
11950
|
};
|
|
11994
11951
|
/**
|
|
11995
11952
|
* Route a header/footer field command (`fields.insert` at the active caret).
|
|
@@ -12020,12 +11977,12 @@ function createSuperDocUI(options) {
|
|
|
12020
11977
|
if (!host) return null;
|
|
12021
11978
|
if (firstPartyCommandDoc !== void 0) {
|
|
12022
11979
|
const handles = hostMethod(host, "getHandles")?.();
|
|
12023
|
-
const editing = isPlainObject(handles) ? handles.editing : void 0;
|
|
12024
|
-
const commands = isPlainObject(editing) ? editing.pageNumbers : void 0;
|
|
12025
|
-
return isPlainObject(commands) ? commands : null;
|
|
11980
|
+
const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
|
|
11981
|
+
const commands = require__plugin_vue_export_helper.isPlainObject(editing) ? editing.pageNumbers : void 0;
|
|
11982
|
+
return require__plugin_vue_export_helper.isPlainObject(commands) ? commands : null;
|
|
12026
11983
|
}
|
|
12027
11984
|
const commands = hostMethod(host, "getCodePageNumberEditingCommands")?.();
|
|
12028
|
-
return isPlainObject(commands) ? commands : null;
|
|
11985
|
+
return require__plugin_vue_export_helper.isPlainObject(commands) ? commands : null;
|
|
12029
11986
|
};
|
|
12030
11987
|
/** Route a page-numbers command (`headerFooters.pageNumbers.set` or `.remove` for the caret's section). */
|
|
12031
11988
|
const executePageNumbersCommand = (descriptor, input) => {
|
|
@@ -12058,12 +12015,12 @@ function createSuperDocUI(options) {
|
|
|
12058
12015
|
if (!host) return null;
|
|
12059
12016
|
if (firstPartyCommandDoc !== void 0) {
|
|
12060
12017
|
const handles = hostMethod(host, "getHandles")?.();
|
|
12061
|
-
const editing = isPlainObject(handles) ? handles.editing : void 0;
|
|
12062
|
-
const commands = isPlainObject(editing) ? editing.tables : void 0;
|
|
12063
|
-
return isPlainObject(commands) ? commands : null;
|
|
12018
|
+
const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
|
|
12019
|
+
const commands = require__plugin_vue_export_helper.isPlainObject(editing) ? editing.tables : void 0;
|
|
12020
|
+
return require__plugin_vue_export_helper.isPlainObject(commands) ? commands : null;
|
|
12064
12021
|
}
|
|
12065
12022
|
const commands = hostMethod(host, "getCodeTableEditingCommands")?.();
|
|
12066
|
-
return isPlainObject(commands) ? commands : null;
|
|
12023
|
+
return require__plugin_vue_export_helper.isPlainObject(commands) ? commands : null;
|
|
12067
12024
|
};
|
|
12068
12025
|
/**
|
|
12069
12026
|
* Route a table cell-context command (`tables.*`) against the live table
|
|
@@ -12105,7 +12062,7 @@ function createSuperDocUI(options) {
|
|
|
12105
12062
|
};
|
|
12106
12063
|
const linkPayloadHasExplicitTarget = (payload) => {
|
|
12107
12064
|
const record = readLinkPayloadRecord(payload);
|
|
12108
|
-
return Boolean(readLinkPayloadTarget(payload) || isPlainObject(record.hyperlinkTarget) || isPlainObject(record.textTarget));
|
|
12065
|
+
return Boolean(readLinkPayloadTarget(payload) || require__plugin_vue_export_helper.isPlainObject(record.hyperlinkTarget) || require__plugin_vue_export_helper.isPlainObject(record.textTarget));
|
|
12109
12066
|
};
|
|
12110
12067
|
const currentWholeTableParagraphOwner = () => {
|
|
12111
12068
|
const owner = wholeTableParagraphSeed, host = getHost();
|
|
@@ -12113,7 +12070,7 @@ function createSuperDocUI(options) {
|
|
|
12113
12070
|
const tableId = owner.info.tableSelection?.tableId;
|
|
12114
12071
|
const activeTable = safeCall(() => {
|
|
12115
12072
|
const handles = hostMethod(host, "getHandles")?.();
|
|
12116
|
-
return hostMethod(isPlainObject(handles) ? handles.selection : void 0, "getWholeTableNodeId")?.();
|
|
12073
|
+
return hostMethod(require__plugin_vue_export_helper.isPlainObject(handles) ? handles.selection : void 0, "getWholeTableNodeId")?.();
|
|
12117
12074
|
}, null);
|
|
12118
12075
|
if (!tableId || activeTable !== tableId || state.selection.tableSelection?.type !== "table" || state.selection.tableSelection.tableId !== tableId || selectionSignature(state.selection) !== selectionSignature(selectionSliceFromInfo(owner.info, "ready"))) return null;
|
|
12119
12076
|
const applied = appliedSelectionPresentation(state.selection);
|
|
@@ -12828,11 +12785,11 @@ function createSuperDocUI(options) {
|
|
|
12828
12785
|
const lifecycle = error?.reason;
|
|
12829
12786
|
return { reason: lifecycle === "host-not-ready" || lifecycle === "host-disposed" || lifecycle === "editing-mount-required" ? SUPERDOC_UI_REASONS.notReady : SUPERDOC_UI_REASONS.hostCapabilityUnavailable };
|
|
12830
12787
|
}
|
|
12831
|
-
const editing = isPlainObject(handles) ? handles.editing : void 0;
|
|
12832
|
-
const editingHelper = isPlainObject(editing) ? editing.selectionTargets : void 0;
|
|
12833
|
-
if (isPlainObject(editingHelper) && typeof editingHelper.apply === "function") return { helper: editingHelper };
|
|
12834
|
-
const reviewHelper = isPlainObject(handles) ? handles.selection : void 0;
|
|
12835
|
-
if (isPlainObject(reviewHelper) && typeof reviewHelper.apply === "function") return { helper: reviewHelper };
|
|
12788
|
+
const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
|
|
12789
|
+
const editingHelper = require__plugin_vue_export_helper.isPlainObject(editing) ? editing.selectionTargets : void 0;
|
|
12790
|
+
if (require__plugin_vue_export_helper.isPlainObject(editingHelper) && typeof editingHelper.apply === "function") return { helper: editingHelper };
|
|
12791
|
+
const reviewHelper = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.selection : void 0;
|
|
12792
|
+
if (require__plugin_vue_export_helper.isPlainObject(reviewHelper) && typeof reviewHelper.apply === "function") return { helper: reviewHelper };
|
|
12836
12793
|
return { reason: SUPERDOC_UI_REASONS.hostCapabilityUnavailable };
|
|
12837
12794
|
};
|
|
12838
12795
|
/** Live host SelectionTarget from editable or review-safe selection handles. */
|
|
@@ -12845,10 +12802,10 @@ function createSuperDocUI(options) {
|
|
|
12845
12802
|
} catch {
|
|
12846
12803
|
return null;
|
|
12847
12804
|
}
|
|
12848
|
-
const editing = isPlainObject(handles) ? handles.editing : void 0;
|
|
12849
|
-
const rendered = hostMethod(isPlainObject(editing) ? editing.selection : void 0, "toSelectionTarget")?.() ?? hostMethod(isPlainObject(handles) ? handles.selection : void 0, "toSelectionTarget")?.();
|
|
12850
|
-
if (!isPlainObject(rendered) || rendered.kind !== "ok") return null;
|
|
12851
|
-
return isPlainObject(rendered.target) ? rendered.target : null;
|
|
12805
|
+
const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
|
|
12806
|
+
const rendered = hostMethod(require__plugin_vue_export_helper.isPlainObject(editing) ? editing.selection : void 0, "toSelectionTarget")?.() ?? hostMethod(require__plugin_vue_export_helper.isPlainObject(handles) ? handles.selection : void 0, "toSelectionTarget")?.();
|
|
12807
|
+
if (!require__plugin_vue_export_helper.isPlainObject(rendered) || rendered.kind !== "ok") return null;
|
|
12808
|
+
return require__plugin_vue_export_helper.isPlainObject(rendered.target) ? rendered.target : null;
|
|
12852
12809
|
};
|
|
12853
12810
|
const activateContentControlChrome = (id) => {
|
|
12854
12811
|
const host = getHost();
|
|
@@ -12981,7 +12938,7 @@ function createSuperDocUI(options) {
|
|
|
12981
12938
|
const getSelectionAnchorRect = hostMethod(getHost(), "getSelectionAnchorRect");
|
|
12982
12939
|
if (getSelectionAnchorRect) {
|
|
12983
12940
|
const fromHost = safeCall(() => getSelectionAnchorRect(input), null);
|
|
12984
|
-
if (isPlainObject(fromHost) && (Number(fromHost.width) > 0 || Number(fromHost.height) > 0)) return fromHost;
|
|
12941
|
+
if (require__plugin_vue_export_helper.isPlainObject(fromHost) && (Number(fromHost.width) > 0 || Number(fromHost.height) > 0)) return fromHost;
|
|
12985
12942
|
return null;
|
|
12986
12943
|
}
|
|
12987
12944
|
return null;
|
|
@@ -13134,13 +13091,13 @@ function createSuperDocUI(options) {
|
|
|
13134
13091
|
try {
|
|
13135
13092
|
const directory = await listBookmarks(address.story ? { in: address.story } : {});
|
|
13136
13093
|
if (!current()) return unresolved();
|
|
13137
|
-
if ((isPlainObject(directory) && Array.isArray(directory.items) ? directory.items : []).filter((item) => isPlainObject(item) && item.name === address.name).length !== 1) return unresolved();
|
|
13094
|
+
if ((require__plugin_vue_export_helper.isPlainObject(directory) && Array.isArray(directory.items) ? directory.items : []).filter((item) => require__plugin_vue_export_helper.isPlainObject(item) && item.name === address.name).length !== 1) return unresolved();
|
|
13138
13095
|
const info = await getBookmark({ target: address });
|
|
13139
|
-
if (!current() || !isPlainObject(info)) return unresolved();
|
|
13140
|
-
const range = isPlainObject(info.range) ? info.range : void 0;
|
|
13141
|
-
const infoStory = (isPlainObject(info.address) ? info.address : void 0)?.story;
|
|
13142
|
-
const storyOutsideBody = Boolean(infoStory) && !(isPlainObject(infoStory) && infoStory.storyType === "body");
|
|
13143
|
-
const textPoint = (point) => isPlainObject(point) && typeof point.blockId === "string" && point.blockId.length > 0 && typeof point.offset === "number" && Number.isInteger(point.offset) && point.offset >= 0 ? {
|
|
13096
|
+
if (!current() || !require__plugin_vue_export_helper.isPlainObject(info)) return unresolved();
|
|
13097
|
+
const range = require__plugin_vue_export_helper.isPlainObject(info.range) ? info.range : void 0;
|
|
13098
|
+
const infoStory = (require__plugin_vue_export_helper.isPlainObject(info.address) ? info.address : void 0)?.story;
|
|
13099
|
+
const storyOutsideBody = Boolean(infoStory) && !(require__plugin_vue_export_helper.isPlainObject(infoStory) && infoStory.storyType === "body");
|
|
13100
|
+
const textPoint = (point) => require__plugin_vue_export_helper.isPlainObject(point) && typeof point.blockId === "string" && point.blockId.length > 0 && typeof point.offset === "number" && Number.isInteger(point.offset) && point.offset >= 0 ? {
|
|
13144
13101
|
blockId: point.blockId,
|
|
13145
13102
|
offset: point.offset
|
|
13146
13103
|
} : null;
|
|
@@ -13330,7 +13287,7 @@ function createSuperDocUI(options) {
|
|
|
13330
13287
|
*/
|
|
13331
13288
|
const commentWriteRefusal = () => commentMutationsAreReadOnly() ? failedReceipt("Comments are read-only.", "DOCUMENT_READONLY") : null;
|
|
13332
13289
|
const filterCommentsSnapshot = (items, query) => {
|
|
13333
|
-
const record = isPlainObject(query) ? query : null;
|
|
13290
|
+
const record = require__plugin_vue_export_helper.isPlainObject(query) ? query : null;
|
|
13334
13291
|
let filtered = Array.from(items);
|
|
13335
13292
|
if (record?.includeResolved === false) filtered = filtered.filter((item) => item.status !== "resolved");
|
|
13336
13293
|
const rawOffset = Number(record?.offset);
|
|
@@ -13784,7 +13741,7 @@ function createSuperDocUI(options) {
|
|
|
13784
13741
|
}, tcApi)) return false;
|
|
13785
13742
|
if (firstPartyCommandDoc) {
|
|
13786
13743
|
const handles = safeCall(hostMethod(getHost(), "getHandles") ?? void 0, null);
|
|
13787
|
-
const decide = hostMethod(isPlainObject(handles) ? handles.trackChanges : void 0, "decide");
|
|
13744
|
+
const decide = hostMethod(require__plugin_vue_export_helper.isPlainObject(handles) ? handles.trackChanges : void 0, "decide");
|
|
13788
13745
|
return decide ? decide({
|
|
13789
13746
|
decision: kind,
|
|
13790
13747
|
target
|
|
@@ -13847,7 +13804,7 @@ function createSuperDocUI(options) {
|
|
|
13847
13804
|
success: false,
|
|
13848
13805
|
reason: "cancelled"
|
|
13849
13806
|
};
|
|
13850
|
-
const control = (isPlainObject(catalog) ? catalog.items : void 0)?.find((item) => item.id === id);
|
|
13807
|
+
const control = (require__plugin_vue_export_helper.isPlainObject(catalog) ? catalog.items : void 0)?.find((item) => item.id === id);
|
|
13851
13808
|
if (!control) return {
|
|
13852
13809
|
success: false,
|
|
13853
13810
|
reason: "not-found"
|
|
@@ -13967,7 +13924,7 @@ function createSuperDocUI(options) {
|
|
|
13967
13924
|
};
|
|
13968
13925
|
}
|
|
13969
13926
|
const mounted = hostMethod(host, "getMountedHandle")?.();
|
|
13970
|
-
hostMethod(isPlainObject(mounted) ? mounted.focus : void 0, "focus")?.({ preventScroll: true });
|
|
13927
|
+
hostMethod(require__plugin_vue_export_helper.isPlainObject(mounted) ? mounted.focus : void 0, "focus")?.({ preventScroll: true });
|
|
13971
13928
|
activateContentControlChrome(id);
|
|
13972
13929
|
return { success: true };
|
|
13973
13930
|
}
|
|
@@ -14024,7 +13981,7 @@ function createSuperDocUI(options) {
|
|
|
14024
13981
|
const getText = hostMethod(getDoc(), "getText");
|
|
14025
13982
|
const result = safeCall(getText ? () => getText({}) : void 0, null);
|
|
14026
13983
|
if (typeof result === "string") return result;
|
|
14027
|
-
if (isPlainObject(result) && typeof result.text === "string") return result.text;
|
|
13984
|
+
if (require__plugin_vue_export_helper.isPlainObject(result) && typeof result.text === "string") return result.text;
|
|
14028
13985
|
return null;
|
|
14029
13986
|
},
|
|
14030
13987
|
replaceDocument: async (file) => {
|
|
@@ -14060,9 +14017,9 @@ function createSuperDocUI(options) {
|
|
|
14060
14017
|
reason: "unavailable"
|
|
14061
14018
|
};
|
|
14062
14019
|
const result = safeCall(() => markSaved(version), null);
|
|
14063
|
-
return isPlainObject(result) && result.ok === true ? { ok: true } : {
|
|
14020
|
+
return require__plugin_vue_export_helper.isPlainObject(result) && result.ok === true ? { ok: true } : {
|
|
14064
14021
|
ok: false,
|
|
14065
|
-
reason: isPlainObject(result) && result.reason === "document-changed" ? "document-changed" : "unavailable"
|
|
14022
|
+
reason: require__plugin_vue_export_helper.isPlainObject(result) && result.reason === "document-changed" ? "document-changed" : "unavailable"
|
|
14066
14023
|
};
|
|
14067
14024
|
}
|
|
14068
14025
|
};
|
|
@@ -14314,7 +14271,7 @@ function createSuperDocUI(options) {
|
|
|
14314
14271
|
const liveDecorations = /* @__PURE__ */ new Map();
|
|
14315
14272
|
const decorationOwnerForProvider = (providerId) => {
|
|
14316
14273
|
const owner = currentHostVisuals()?.providerOwner?.(providerId);
|
|
14317
|
-
return isPlainObject(owner) && typeof owner.id === "string" ? owner : null;
|
|
14274
|
+
return require__plugin_vue_export_helper.isPlainObject(owner) && typeof owner.id === "string" ? owner : null;
|
|
14318
14275
|
};
|
|
14319
14276
|
const currentHostVisuals = () => getEditor()?.visuals ?? null;
|
|
14320
14277
|
const decorationListeners = /* @__PURE__ */ new Set();
|
|
@@ -14336,7 +14293,7 @@ function createSuperDocUI(options) {
|
|
|
14336
14293
|
};
|
|
14337
14294
|
const decorationData = (id) => {
|
|
14338
14295
|
const owner = currentHostVisuals()?.ownerById?.(id);
|
|
14339
|
-
return isPlainObject(owner?.data) ? owner.data : void 0;
|
|
14296
|
+
return require__plugin_vue_export_helper.isPlainObject(owner?.data) ? owner.data : void 0;
|
|
14340
14297
|
};
|
|
14341
14298
|
const emitDecorationEvent = (type, decoration, point) => {
|
|
14342
14299
|
const payload = {
|
|
@@ -14616,12 +14573,7 @@ function createSuperDocUI(options) {
|
|
|
14616
14573
|
const resolved = await Promise.resolve(resolveMetadata({ id }));
|
|
14617
14574
|
if (token !== localContentToken()) return null;
|
|
14618
14575
|
const target = readMetadataResolvedTarget(resolved);
|
|
14619
|
-
|
|
14620
|
-
token,
|
|
14621
|
-
value: target,
|
|
14622
|
-
hasSettled: true,
|
|
14623
|
-
inflightToken: null
|
|
14624
|
-
});
|
|
14576
|
+
seedAsyncRead(metadataResolveKey(id), token, target);
|
|
14625
14577
|
return target;
|
|
14626
14578
|
} catch {
|
|
14627
14579
|
return null;
|
|
@@ -14740,11 +14692,11 @@ function createSuperDocUI(options) {
|
|
|
14740
14692
|
const searchListeners = /* @__PURE__ */ new Set();
|
|
14741
14693
|
const getHostSearch = () => {
|
|
14742
14694
|
const search = getHost()?.search;
|
|
14743
|
-
return isPlainObject(search) ? search : null;
|
|
14695
|
+
return require__plugin_vue_export_helper.isPlainObject(search) ? search : null;
|
|
14744
14696
|
};
|
|
14745
14697
|
const getEditCommandSearch = () => {
|
|
14746
14698
|
const search = getEditCommands()?.search;
|
|
14747
|
-
return isPlainObject(search) ? search : null;
|
|
14699
|
+
return require__plugin_vue_export_helper.isPlainObject(search) ? search : null;
|
|
14748
14700
|
};
|
|
14749
14701
|
const searchIsAvailable = () => {
|
|
14750
14702
|
const search = getHostSearch();
|
|
@@ -15883,6 +15835,12 @@ Object.defineProperty(exports, "BUILT_IN_COMMAND_IDS", {
|
|
|
15883
15835
|
return BUILT_IN_COMMAND_IDS;
|
|
15884
15836
|
}
|
|
15885
15837
|
});
|
|
15838
|
+
Object.defineProperty(exports, "BUILT_IN_PERMISSION_METHOD", {
|
|
15839
|
+
enumerable: true,
|
|
15840
|
+
get: function() {
|
|
15841
|
+
return BUILT_IN_PERMISSION_METHOD;
|
|
15842
|
+
}
|
|
15843
|
+
});
|
|
15886
15844
|
Object.defineProperty(exports, "DOM_CLASS_NAMES", {
|
|
15887
15845
|
enumerable: true,
|
|
15888
15846
|
get: function() {
|
|
@@ -15967,12 +15925,6 @@ Object.defineProperty(exports, "isAllowed", {
|
|
|
15967
15925
|
return isAllowed;
|
|
15968
15926
|
}
|
|
15969
15927
|
});
|
|
15970
|
-
Object.defineProperty(exports, "isPlainObject", {
|
|
15971
|
-
enumerable: true,
|
|
15972
|
-
get: function() {
|
|
15973
|
-
return isPlainObject;
|
|
15974
|
-
}
|
|
15975
|
-
});
|
|
15976
15928
|
Object.defineProperty(exports, "isRecord", {
|
|
15977
15929
|
enumerable: true,
|
|
15978
15930
|
get: function() {
|