superdoc 2.29.0-next.1 → 2.29.0-next.13
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-Dm043CZP.es.js → FindReplaceSurface-BKVHzhQ4.es.js} +34 -26
- package/dist/chunks/{FindReplaceSurface-BRs3JrCq.cjs → FindReplaceSurface-BNDrJ6VS.cjs} +34 -26
- package/dist/chunks/{PasswordPromptSurface-DGjmN7A-.es.js → PasswordPromptSurface-6mF6Azda.es.js} +6 -4
- package/dist/chunks/{PasswordPromptSurface-BpqP4pUa.cjs → PasswordPromptSurface-BNkaztaP.cjs} +6 -4
- package/dist/chunks/{PdfViewer-boENOZdF.cjs → PdfViewer-DmSkZehl.cjs} +70 -99
- package/dist/chunks/{PdfViewer-D4lVeOJu.es.js → PdfViewer-aOWhUVI7.es.js} +67 -96
- 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-Duf65d0b.es.js → create-super-doc-ui-DdT4b29f.es.js} +41 -66
- package/dist/chunks/{create-super-doc-ui-0OA8hCNb.cjs → create-super-doc-ui-_SbygYQ4.cjs} +46 -65
- 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/metadata-types.d.ts +1 -1
- package/dist/document-api/src/contract/operation-definitions.d.ts +3 -3
- 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/tables/tables.d.ts +2 -1
- package/dist/document-api/src/types/address.d.ts +3 -0
- package/dist/document-api/src/types/table-operations.types.d.ts +1 -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/layout-engine/contracts/src/index.d.ts +1 -1
- package/dist/layout-engine/contracts/src/paragraph-visible-text.d.ts +3 -1
- 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 +116 -1277
- package/dist/superdoc/src/components/CommentsLayer/CommentHeader.vue.d.ts +106 -22
- package/dist/superdoc/src/components/CommentsLayer/CommentInput.vue.d.ts +74 -14
- package/dist/superdoc/src/components/CommentsLayer/CommentsDropdown.vue.d.ts +55 -20
- package/dist/superdoc/src/components/CommentsLayer/InternalDropdown.vue.d.ts +24 -8
- package/dist/superdoc/src/components/CommentsLayer/PdfCommentsLayer.vue.d.ts +5 -3
- package/dist/superdoc/src/components/CommentsLayer/commentsList/ReviewDirectoryListItem.vue.d.ts +60 -12
- package/dist/superdoc/src/components/CommentsLayer/commentsList/commentsList.vue.d.ts +20 -6
- package/dist/superdoc/src/components/CommentsLayer/floating-comment-positioning.d.ts +24 -23
- package/dist/superdoc/src/components/CommentsLayer/tracked-change-threading.d.ts +0 -1
- package/dist/superdoc/src/components/CommentsLayer/use-comment.d.ts +29 -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 +81 -16
- package/dist/superdoc/src/components/Whiteboard/WhiteboardPage.vue.d.ts +49 -13
- package/dist/superdoc/src/components/Whiteboard/use-whiteboard.d.ts +30 -15
- package/dist/superdoc/src/components/Whiteboard/whiteboard-types.d.ts +11 -0
- package/dist/superdoc/src/components/general/Avatar.vue.d.ts +12 -5
- package/dist/superdoc/src/components/surfaces/FindReplaceSurface.vue.d.ts +58 -15
- package/dist/superdoc/src/components/surfaces/PasswordPromptSurface.vue.d.ts +58 -15
- package/dist/superdoc/src/components/surfaces/SurfaceFloating.vue.d.ts +14 -6
- package/dist/superdoc/src/components/surfaces/SurfaceHost.vue.d.ts +25 -15
- 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-password-prompt.d.ts +23 -24
- package/dist/superdoc/src/composables/use-viewport-fit.d.ts +40 -26
- package/dist/superdoc/src/composables/useUiFontFamily.d.ts +3 -11
- package/dist/superdoc/src/core/SuperDoc.d.ts +2 -7
- 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 +9 -1
- package/dist/superdoc/src/core/editor-runtime/v2/v2-editor-runtime-adapter.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 +24 -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 +5 -19
- 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 +1 -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 -11
- package/dist/superdoc/src/internal/diagnostics/diagnostic-dedupe.d.ts +6 -15
- package/dist/superdoc/src/internal/toolbar/built-in/AIWriter.vue.d.ts +77 -16
- package/dist/superdoc/src/internal/toolbar/built-in/AlignmentButtons.vue.d.ts +5 -3
- package/dist/superdoc/src/internal/toolbar/built-in/ButtonGroup.vue.d.ts +85 -5
- package/dist/superdoc/src/internal/toolbar/built-in/DocumentMode.vue.d.ts +20 -6
- package/dist/superdoc/src/internal/toolbar/built-in/FontFamilyCombobox.vue.d.ts +32 -8
- package/dist/superdoc/src/internal/toolbar/built-in/FontSizeCombobox.vue.d.ts +32 -8
- package/dist/superdoc/src/internal/toolbar/built-in/IconGrid.vue.d.ts +44 -12
- package/dist/superdoc/src/internal/toolbar/built-in/IconGridRow.vue.d.ts +32 -9
- package/dist/superdoc/src/internal/toolbar/built-in/LinkInput.vue.d.ts +1 -1
- package/dist/superdoc/src/internal/toolbar/built-in/StyleButtonsList.vue.d.ts +39 -10
- package/dist/superdoc/src/internal/toolbar/built-in/TableActions.vue.d.ts +24 -6
- package/dist/superdoc/src/internal/toolbar/built-in/TableGrid.vue.d.ts +7 -3
- 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 +13 -15
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarDropdown.vue.d.ts +1 -10
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarSeparator.vue.d.ts +16 -6
- package/dist/superdoc/src/internal/toolbar/built-in/color-dropdown-helpers.d.ts +10 -20
- package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +12 -45
- package/dist/superdoc/src/internal/toolbar/built-in/default-items.d.ts +34 -17
- package/dist/superdoc/src/internal/toolbar/built-in/list-style-buttons.d.ts +2 -2
- 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 +67 -0
- package/dist/superdoc/src/internal/toolbar/built-in/toolbarTexts.d.ts +61 -61
- 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 +7 -27
- package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +4 -3
- 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 +225 -99
- package/dist/superdoc/src/stores/helpers/comment-draft-text.d.ts +1 -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/tracked-change-identity.d.ts +19 -0
- package/dist/superdoc/src/stores/helpers/tracked-change-row-values.d.ts +21 -0
- package/dist/superdoc/src/stores/helpers/tracked-change-thread-index.d.ts +21 -24
- package/dist/superdoc/src/stores/superdoc-store.d.ts +676 -298
- package/dist/superdoc.cjs +1682 -2515
- package/dist/superdoc.es.js +1716 -2553
- 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 +2 -2
- package/dist/superdoc/src/internal/toolbar/index.d.ts +0 -10
- package/dist/superdoc/src/main.d.ts +0 -1
package/dist/chunks/{create-super-doc-ui-Duf65d0b.es.js → create-super-doc-ui-DdT4b29f.es.js}
RENAMED
|
@@ -1079,6 +1079,11 @@ var decodeLayoutStoryDataset = (raw) => {
|
|
|
1079
1079
|
`${DOM_CLASS_NAMES.BLOCK_SDT}${DATA_ATTRS.SDT_ID}`;
|
|
1080
1080
|
`${DATA_ATTRS.DRAGGABLE}`;
|
|
1081
1081
|
//#endregion
|
|
1082
|
+
//#region src/helpers/object-guards.ts
|
|
1083
|
+
function isPlainObject(value) {
|
|
1084
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1085
|
+
}
|
|
1086
|
+
//#endregion
|
|
1082
1087
|
//#region src/helpers/tracked-change-comment-lane.ts
|
|
1083
1088
|
var TRACKED_CHANGE_COMMENT_LANE_ID_PREFIX = "tc-comment:";
|
|
1084
1089
|
function isSyntheticTrackedChangeCommentLaneItem(item) {
|
|
@@ -1088,16 +1093,7 @@ function isSyntheticTrackedChangeCommentLaneItem(item) {
|
|
|
1088
1093
|
return typeof itemId === "string" && itemId.startsWith(TRACKED_CHANGE_COMMENT_LANE_ID_PREFIX);
|
|
1089
1094
|
}
|
|
1090
1095
|
//#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
|
|
1096
|
+
//#region src/core/collaboration/permissions.ts
|
|
1101
1097
|
var PERMISSIONS = Object.freeze({
|
|
1102
1098
|
RESOLVE_OWN: "RESOLVE_OWN",
|
|
1103
1099
|
RESOLVE_OTHER: "RESOLVE_OTHER",
|
|
@@ -1160,15 +1156,16 @@ var PERMISSION_MATRIX = Object.freeze({
|
|
|
1160
1156
|
var pickResolver = (context = {}) => {
|
|
1161
1157
|
if (typeof context.permissionResolver === "function") return context.permissionResolver;
|
|
1162
1158
|
if (typeof context.superdoc?.config?.permissionResolver === "function") return context.superdoc.config.permissionResolver;
|
|
1163
|
-
const
|
|
1159
|
+
const comments = context.superdoc?.config?.modules?.comments;
|
|
1160
|
+
const deprecatedResolver = comments ? comments.permissionResolver : void 0;
|
|
1164
1161
|
if (typeof deprecatedResolver === "function") return deprecatedResolver;
|
|
1165
1162
|
return null;
|
|
1166
1163
|
};
|
|
1167
1164
|
var BUILT_IN_PERMISSION_METHOD = Symbol.for("superdoc.internal.permission-method.builtin");
|
|
1168
1165
|
var BUILT_IN_PERMISSION_RESOLVER = Symbol.for("superdoc.internal.permission-resolver.builtin");
|
|
1169
|
-
|
|
1166
|
+
var hasBuiltInPermissionMethodBrand = (method) => (typeof method === "object" && method !== null || typeof method === "function") && Reflect.get(method, BUILT_IN_PERMISSION_METHOD) === true;
|
|
1170
1167
|
var createTrackedChangePermissionResolver = (superdoc) => {
|
|
1171
|
-
const isBuiltInPolicy = () => superdoc.canPerformPermission
|
|
1168
|
+
const isBuiltInPolicy = () => hasBuiltInPermissionMethodBrand(superdoc.canPerformPermission) && pickResolver({ superdoc }) === null;
|
|
1172
1169
|
const resolver = (payload = {}) => isBuiltInPolicy() ? defaultDecisionFor(payload.permission, superdoc.config.role, superdoc.config.isInternal) : superdoc.canPerformPermission({
|
|
1173
1170
|
...payload,
|
|
1174
1171
|
role: superdoc.config.role,
|
|
@@ -1178,6 +1175,7 @@ var createTrackedChangePermissionResolver = (superdoc) => {
|
|
|
1178
1175
|
return resolver;
|
|
1179
1176
|
};
|
|
1180
1177
|
var defaultDecisionFor = (permission, role, isInternal) => {
|
|
1178
|
+
if (permission === void 0 || typeof role !== "string") return false;
|
|
1181
1179
|
const internalExternal = isInternal ? "internal" : "external";
|
|
1182
1180
|
return PERMISSION_MATRIX[permission]?.[internalExternal]?.includes(role) ?? false;
|
|
1183
1181
|
};
|
|
@@ -1222,21 +1220,6 @@ var readBuiltInTrackedChangePermissionDecision = (superdoc, canPerform, permissi
|
|
|
1222
1220
|
return null;
|
|
1223
1221
|
}
|
|
1224
1222
|
};
|
|
1225
|
-
/**
|
|
1226
|
-
* Resolve a client-side permission through the built-in matrix and optional
|
|
1227
|
-
* resolver.
|
|
1228
|
-
*
|
|
1229
|
-
* @param {string} permission The permission to check
|
|
1230
|
-
* @param {string} role The role to check
|
|
1231
|
-
* @param {boolean} isInternal The internal/external flag
|
|
1232
|
-
* @param {object} [context] Context passed to the permission resolver
|
|
1233
|
-
* @param {object | null} [context.comment] The comment/tracked change being evaluated
|
|
1234
|
-
* @param {object | null} [context.superdoc] The SuperDoc instance
|
|
1235
|
-
* @param {object | null} [context.currentUser] The active user object performing the action
|
|
1236
|
-
* @param {Function} [context.permissionResolver] Explicit resolver override
|
|
1237
|
-
* @param {object | null} [context.trackedChange] Tracked change metadata (for tracked-change permissions)
|
|
1238
|
-
* @returns {boolean} Whether the permission is allowed
|
|
1239
|
-
*/
|
|
1240
1223
|
var isAllowed = (permission, role, isInternal, context = {}) => {
|
|
1241
1224
|
const defaultDecision = defaultDecisionFor(permission, role, isInternal);
|
|
1242
1225
|
const resolver = pickResolver(context);
|
|
@@ -2023,13 +2006,9 @@ var WatermarkSurface_default = /* @__PURE__ */ _plugin_vue_export_helper_default
|
|
|
2023
2006
|
}
|
|
2024
2007
|
}), [["__scopeId", "data-v-df56c82c"]]);
|
|
2025
2008
|
//#endregion
|
|
2026
|
-
//#region src/components/surfaces/watermark-surface-runtime.
|
|
2027
|
-
/**
|
|
2028
|
-
* Keeps Vue rendering and post-dismissal announcements outside the public type graph.
|
|
2029
|
-
* @param {(() => HTMLElement | null) | undefined} getContainer
|
|
2030
|
-
*/
|
|
2009
|
+
//#region src/components/surfaces/watermark-surface-runtime.ts
|
|
2010
|
+
/** Keeps Vue rendering and post-dismissal announcements outside the public type graph. */
|
|
2031
2011
|
function createWatermarkSurfaceRuntime(getContainer) {
|
|
2032
|
-
/** @type {HTMLDivElement | null} */
|
|
2033
2012
|
let status = null;
|
|
2034
2013
|
let disposed = false;
|
|
2035
2014
|
return {
|
|
@@ -2040,7 +2019,6 @@ function createWatermarkSurfaceRuntime(getContainer) {
|
|
|
2040
2019
|
const item = opener?.closest("[data-sd-part=\"toolbar-item\"]") ?? opener?.querySelector("[data-sd-part=\"toolbar-item\"]");
|
|
2041
2020
|
const container = (item?.closest("[data-sd-part=\"toolbar\"]"))?.parentElement;
|
|
2042
2021
|
const isWatermarkEntry = item?.querySelector("[data-item=\"btn-watermark\"], [data-item=\"btn-overflow\"]");
|
|
2043
|
-
/** @param {() => boolean} isCurrent */
|
|
2044
2022
|
return async (isCurrent) => {
|
|
2045
2023
|
await nextTick();
|
|
2046
2024
|
if (disposed || !isCurrent() || !isWatermarkEntry || opener?.isConnected || !container?.isConnected) return;
|
|
@@ -2072,7 +2050,6 @@ function createWatermarkSurfaceRuntime(getContainer) {
|
|
|
2072
2050
|
});
|
|
2073
2051
|
container.appendChild(status);
|
|
2074
2052
|
},
|
|
2075
|
-
/** @param {string} message */
|
|
2076
2053
|
announce(message) {
|
|
2077
2054
|
if (!disposed && status) status.textContent = message;
|
|
2078
2055
|
},
|
|
@@ -2688,34 +2665,33 @@ function fontsValue(value) {
|
|
|
2688
2665
|
return Object.keys(result).length > 0 ? result : null;
|
|
2689
2666
|
}
|
|
2690
2667
|
//#endregion
|
|
2691
|
-
//#region src/public/ui/format-painter-helpers.
|
|
2668
|
+
//#region src/public/ui/format-painter-helpers.ts
|
|
2692
2669
|
/**
|
|
2693
2670
|
* Maps SDRunProps field names to InlineRunPatch field names.
|
|
2694
2671
|
* SDRunProps (read-side) and InlineRunPatch (write-side) use different keys
|
|
2695
2672
|
* for the same properties; direct assignment between them is forbidden.
|
|
2696
|
-
*
|
|
2697
|
-
* @param {Record<string, unknown>} props - SDRunProps object from doc.getNodeById
|
|
2698
|
-
* @returns {Record<string, unknown>} InlineRunPatch ready for doc.format.apply
|
|
2699
2673
|
*/
|
|
2700
2674
|
function sdRunPropsToInlineRunPatch(props) {
|
|
2701
2675
|
if (!props || typeof props !== "object") return {};
|
|
2702
2676
|
const patch = {};
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2677
|
+
const fonts = props.fonts;
|
|
2678
|
+
if (isPlainObject(fonts)) patch.rFonts = {
|
|
2679
|
+
ascii: fonts.ascii,
|
|
2680
|
+
hAnsi: fonts.hAnsi,
|
|
2681
|
+
eastAsia: fonts.eastAsia,
|
|
2682
|
+
cs: fonts.cs,
|
|
2683
|
+
asciiTheme: fonts.asciiTheme,
|
|
2684
|
+
hAnsiTheme: fonts.hAnsiTheme,
|
|
2685
|
+
eastAsiaTheme: fonts.eastAsiaTheme,
|
|
2686
|
+
csTheme: fonts.csTheme,
|
|
2687
|
+
hint: fonts.hint
|
|
2713
2688
|
};
|
|
2714
2689
|
if (props.fontFamily != null) patch.fontFamily = props.fontFamily;
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2690
|
+
const lang = props.lang;
|
|
2691
|
+
if (isPlainObject(lang)) patch.lang = {
|
|
2692
|
+
val: lang.val,
|
|
2693
|
+
eastAsia: lang.eastAsia,
|
|
2694
|
+
bidi: lang.bidi
|
|
2719
2695
|
};
|
|
2720
2696
|
if (props.fontSize != null) patch.fontSize = props.fontSize;
|
|
2721
2697
|
if (props.fontSizeCs != null) patch.fontSizeCs = props.fontSizeCs;
|
|
@@ -2756,19 +2732,24 @@ function sdRunPropsToInlineRunPatch(props) {
|
|
|
2756
2732
|
function projectColorRefToInlineColor(color) {
|
|
2757
2733
|
if (!color) return void 0;
|
|
2758
2734
|
if (typeof color === "string") return color;
|
|
2735
|
+
if (!isPlainObject(color)) return void 0;
|
|
2759
2736
|
if (color.model === "rgb") return color.value;
|
|
2760
2737
|
if (color.model === "auto") return "auto";
|
|
2761
2738
|
}
|
|
2762
2739
|
function projectUnderlineToInlinePatch(underline) {
|
|
2763
2740
|
if (underline == null) return void 0;
|
|
2741
|
+
if (!isPlainObject(underline)) return true;
|
|
2764
2742
|
const patch = {};
|
|
2765
2743
|
if (underline.style != null) patch.style = underline.style;
|
|
2766
|
-
|
|
2767
|
-
if (
|
|
2744
|
+
const color = underline.color;
|
|
2745
|
+
if (isPlainObject(color)) {
|
|
2746
|
+
if (color.model === "rgb") patch.color = color.value;
|
|
2747
|
+
else if (color.model === "theme") patch.themeColor = color.theme;
|
|
2748
|
+
}
|
|
2768
2749
|
return Object.keys(patch).length > 0 ? patch : true;
|
|
2769
2750
|
}
|
|
2770
2751
|
function projectShadingToInlinePatch(shading) {
|
|
2771
|
-
if (!shading) return void 0;
|
|
2752
|
+
if (!isPlainObject(shading)) return void 0;
|
|
2772
2753
|
const patch = {};
|
|
2773
2754
|
const fill = projectColorRefToInlineColor(shading.fill);
|
|
2774
2755
|
if (fill != null) patch.fill = fill;
|
|
@@ -2778,7 +2759,7 @@ function projectShadingToInlinePatch(shading) {
|
|
|
2778
2759
|
return Object.keys(patch).length > 0 ? patch : void 0;
|
|
2779
2760
|
}
|
|
2780
2761
|
function projectBorderToInlinePatch(border) {
|
|
2781
|
-
if (!border) return void 0;
|
|
2762
|
+
if (!isPlainObject(border)) return void 0;
|
|
2782
2763
|
const patch = {};
|
|
2783
2764
|
if (border.style != null) patch.val = border.style;
|
|
2784
2765
|
if (border.width != null) patch.sz = border.width;
|
|
@@ -2793,9 +2774,6 @@ function projectBorderToInlinePatch(border) {
|
|
|
2793
2774
|
*
|
|
2794
2775
|
* Falls back to the plain text target when the host has not populated an
|
|
2795
2776
|
* explicit `selectionTarget` yet.
|
|
2796
|
-
*
|
|
2797
|
-
* @param {{ selectionTarget?: unknown; target?: unknown } | null | undefined} selection
|
|
2798
|
-
* @returns {string}
|
|
2799
2777
|
*/
|
|
2800
2778
|
function selectionKey(selection) {
|
|
2801
2779
|
const target = selection?.selectionTarget ?? selection?.target;
|
|
@@ -2904,7 +2882,7 @@ function readAllResolvedFact(event, receipt) {
|
|
|
2904
2882
|
return fact;
|
|
2905
2883
|
}
|
|
2906
2884
|
//#endregion
|
|
2907
|
-
//#region src/helpers/v2-typing-mutation-event.
|
|
2885
|
+
//#region src/helpers/v2-typing-mutation-event.ts
|
|
2908
2886
|
/**
|
|
2909
2887
|
* Command kinds whose committed mutations belong to the sustained typing
|
|
2910
2888
|
* cadence class (insert / replace / plain paste / Backspace / Delete).
|
|
@@ -2945,9 +2923,6 @@ var V2_TYPING_COMMAND_KINDS = /* @__PURE__ */ new Set([
|
|
|
2945
2923
|
* Events without a forwarded `editableCommandKind` (programmatic Document API
|
|
2946
2924
|
* mutations, history commits, unclassified structural commands) return false
|
|
2947
2925
|
* so they keep hydrating immediately.
|
|
2948
|
-
*
|
|
2949
|
-
* @param {{ type?: string, origin?: string, editableCommandKind?: string } | null | undefined} event
|
|
2950
|
-
* @returns {boolean}
|
|
2951
2926
|
*/
|
|
2952
2927
|
var isV2EditableTextMutationEvent = (event) => {
|
|
2953
2928
|
if (event?.type !== "mutation:committed" || event.origin !== "command") return false;
|
|
@@ -15876,4 +15851,4 @@ function commandIsActive(descriptor, selection) {
|
|
|
15876
15851
|
return descriptor.activeMark ? selection.activeMarks.includes(descriptor.activeMark) : false;
|
|
15877
15852
|
}
|
|
15878
15853
|
//#endregion
|
|
15879
|
-
export {
|
|
15854
|
+
export { createInteractionHistory as C, recordInteraction as E, closeInteractionHistory as S, isWorkflowRecordingEnabled as T, createTrackedChangePermissionResolver as _, registerFirstPartyCommandMutation as a, isPlainObject as b, getCommandDescriptor as c, mutationCommittedEventChangedDocument as d, createImageFilePicker as f, PERMISSIONS as g, BUILT_IN_PERMISSION_METHOD as h, readFirstPartyPageNumbers as i, applyV2CommentInvalidationFromMutation as l, shallowEqual as m, executeFirstPartyCommandAsync as n, isRecord as o, resolveImageSrc as p, executeFirstPartyShortcutAsync as r, BUILT_IN_COMMAND_IDS as s, createSuperDocUI as t, getV2TrackedChangeMutationImpact as u, isAllowed as v, getWorkflowRecording as w, DOM_CLASS_NAMES as x, isSyntheticTrackedChangeCommentLaneItem as y };
|
|
@@ -1079,6 +1079,11 @@ var decodeLayoutStoryDataset = (raw) => {
|
|
|
1079
1079
|
`${DOM_CLASS_NAMES.BLOCK_SDT}${DATA_ATTRS.SDT_ID}`;
|
|
1080
1080
|
`${DATA_ATTRS.DRAGGABLE}`;
|
|
1081
1081
|
//#endregion
|
|
1082
|
+
//#region src/helpers/object-guards.ts
|
|
1083
|
+
function isPlainObject(value) {
|
|
1084
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1085
|
+
}
|
|
1086
|
+
//#endregion
|
|
1082
1087
|
//#region src/helpers/tracked-change-comment-lane.ts
|
|
1083
1088
|
var TRACKED_CHANGE_COMMENT_LANE_ID_PREFIX = "tc-comment:";
|
|
1084
1089
|
function isSyntheticTrackedChangeCommentLaneItem(item) {
|
|
@@ -1088,16 +1093,7 @@ function isSyntheticTrackedChangeCommentLaneItem(item) {
|
|
|
1088
1093
|
return typeof itemId === "string" && itemId.startsWith(TRACKED_CHANGE_COMMENT_LANE_ID_PREFIX);
|
|
1089
1094
|
}
|
|
1090
1095
|
//#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
|
|
1096
|
+
//#region src/core/collaboration/permissions.ts
|
|
1101
1097
|
var PERMISSIONS = Object.freeze({
|
|
1102
1098
|
RESOLVE_OWN: "RESOLVE_OWN",
|
|
1103
1099
|
RESOLVE_OTHER: "RESOLVE_OTHER",
|
|
@@ -1160,15 +1156,16 @@ var PERMISSION_MATRIX = Object.freeze({
|
|
|
1160
1156
|
var pickResolver = (context = {}) => {
|
|
1161
1157
|
if (typeof context.permissionResolver === "function") return context.permissionResolver;
|
|
1162
1158
|
if (typeof context.superdoc?.config?.permissionResolver === "function") return context.superdoc.config.permissionResolver;
|
|
1163
|
-
const
|
|
1159
|
+
const comments = context.superdoc?.config?.modules?.comments;
|
|
1160
|
+
const deprecatedResolver = comments ? comments.permissionResolver : void 0;
|
|
1164
1161
|
if (typeof deprecatedResolver === "function") return deprecatedResolver;
|
|
1165
1162
|
return null;
|
|
1166
1163
|
};
|
|
1167
1164
|
var BUILT_IN_PERMISSION_METHOD = Symbol.for("superdoc.internal.permission-method.builtin");
|
|
1168
1165
|
var BUILT_IN_PERMISSION_RESOLVER = Symbol.for("superdoc.internal.permission-resolver.builtin");
|
|
1169
|
-
|
|
1166
|
+
var hasBuiltInPermissionMethodBrand = (method) => (typeof method === "object" && method !== null || typeof method === "function") && Reflect.get(method, BUILT_IN_PERMISSION_METHOD) === true;
|
|
1170
1167
|
var createTrackedChangePermissionResolver = (superdoc) => {
|
|
1171
|
-
const isBuiltInPolicy = () => superdoc.canPerformPermission
|
|
1168
|
+
const isBuiltInPolicy = () => hasBuiltInPermissionMethodBrand(superdoc.canPerformPermission) && pickResolver({ superdoc }) === null;
|
|
1172
1169
|
const resolver = (payload = {}) => isBuiltInPolicy() ? defaultDecisionFor(payload.permission, superdoc.config.role, superdoc.config.isInternal) : superdoc.canPerformPermission({
|
|
1173
1170
|
...payload,
|
|
1174
1171
|
role: superdoc.config.role,
|
|
@@ -1178,6 +1175,7 @@ var createTrackedChangePermissionResolver = (superdoc) => {
|
|
|
1178
1175
|
return resolver;
|
|
1179
1176
|
};
|
|
1180
1177
|
var defaultDecisionFor = (permission, role, isInternal) => {
|
|
1178
|
+
if (permission === void 0 || typeof role !== "string") return false;
|
|
1181
1179
|
const internalExternal = isInternal ? "internal" : "external";
|
|
1182
1180
|
return PERMISSION_MATRIX[permission]?.[internalExternal]?.includes(role) ?? false;
|
|
1183
1181
|
};
|
|
@@ -1222,21 +1220,6 @@ var readBuiltInTrackedChangePermissionDecision = (superdoc, canPerform, permissi
|
|
|
1222
1220
|
return null;
|
|
1223
1221
|
}
|
|
1224
1222
|
};
|
|
1225
|
-
/**
|
|
1226
|
-
* Resolve a client-side permission through the built-in matrix and optional
|
|
1227
|
-
* resolver.
|
|
1228
|
-
*
|
|
1229
|
-
* @param {string} permission The permission to check
|
|
1230
|
-
* @param {string} role The role to check
|
|
1231
|
-
* @param {boolean} isInternal The internal/external flag
|
|
1232
|
-
* @param {object} [context] Context passed to the permission resolver
|
|
1233
|
-
* @param {object | null} [context.comment] The comment/tracked change being evaluated
|
|
1234
|
-
* @param {object | null} [context.superdoc] The SuperDoc instance
|
|
1235
|
-
* @param {object | null} [context.currentUser] The active user object performing the action
|
|
1236
|
-
* @param {Function} [context.permissionResolver] Explicit resolver override
|
|
1237
|
-
* @param {object | null} [context.trackedChange] Tracked change metadata (for tracked-change permissions)
|
|
1238
|
-
* @returns {boolean} Whether the permission is allowed
|
|
1239
|
-
*/
|
|
1240
1223
|
var isAllowed = (permission, role, isInternal, context = {}) => {
|
|
1241
1224
|
const defaultDecision = defaultDecisionFor(permission, role, isInternal);
|
|
1242
1225
|
const resolver = pickResolver(context);
|
|
@@ -2024,13 +2007,9 @@ var WatermarkSurface_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
2024
2007
|
//#region src/components/surfaces/WatermarkSurface.vue
|
|
2025
2008
|
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
2009
|
//#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
|
-
*/
|
|
2010
|
+
//#region src/components/surfaces/watermark-surface-runtime.ts
|
|
2011
|
+
/** Keeps Vue rendering and post-dismissal announcements outside the public type graph. */
|
|
2032
2012
|
function createWatermarkSurfaceRuntime(getContainer) {
|
|
2033
|
-
/** @type {HTMLDivElement | null} */
|
|
2034
2013
|
let status = null;
|
|
2035
2014
|
let disposed = false;
|
|
2036
2015
|
return {
|
|
@@ -2041,7 +2020,6 @@ function createWatermarkSurfaceRuntime(getContainer) {
|
|
|
2041
2020
|
const item = opener?.closest("[data-sd-part=\"toolbar-item\"]") ?? opener?.querySelector("[data-sd-part=\"toolbar-item\"]");
|
|
2042
2021
|
const container = (item?.closest("[data-sd-part=\"toolbar\"]"))?.parentElement;
|
|
2043
2022
|
const isWatermarkEntry = item?.querySelector("[data-item=\"btn-watermark\"], [data-item=\"btn-overflow\"]");
|
|
2044
|
-
/** @param {() => boolean} isCurrent */
|
|
2045
2023
|
return async (isCurrent) => {
|
|
2046
2024
|
await require__plugin_vue_export_helper.nextTick();
|
|
2047
2025
|
if (disposed || !isCurrent() || !isWatermarkEntry || opener?.isConnected || !container?.isConnected) return;
|
|
@@ -2073,7 +2051,6 @@ function createWatermarkSurfaceRuntime(getContainer) {
|
|
|
2073
2051
|
});
|
|
2074
2052
|
container.appendChild(status);
|
|
2075
2053
|
},
|
|
2076
|
-
/** @param {string} message */
|
|
2077
2054
|
announce(message) {
|
|
2078
2055
|
if (!disposed && status) status.textContent = message;
|
|
2079
2056
|
},
|
|
@@ -2689,34 +2666,33 @@ function fontsValue(value) {
|
|
|
2689
2666
|
return Object.keys(result).length > 0 ? result : null;
|
|
2690
2667
|
}
|
|
2691
2668
|
//#endregion
|
|
2692
|
-
//#region src/public/ui/format-painter-helpers.
|
|
2669
|
+
//#region src/public/ui/format-painter-helpers.ts
|
|
2693
2670
|
/**
|
|
2694
2671
|
* Maps SDRunProps field names to InlineRunPatch field names.
|
|
2695
2672
|
* SDRunProps (read-side) and InlineRunPatch (write-side) use different keys
|
|
2696
2673
|
* 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
2674
|
*/
|
|
2701
2675
|
function sdRunPropsToInlineRunPatch(props) {
|
|
2702
2676
|
if (!props || typeof props !== "object") return {};
|
|
2703
2677
|
const patch = {};
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2678
|
+
const fonts = props.fonts;
|
|
2679
|
+
if (isPlainObject(fonts)) patch.rFonts = {
|
|
2680
|
+
ascii: fonts.ascii,
|
|
2681
|
+
hAnsi: fonts.hAnsi,
|
|
2682
|
+
eastAsia: fonts.eastAsia,
|
|
2683
|
+
cs: fonts.cs,
|
|
2684
|
+
asciiTheme: fonts.asciiTheme,
|
|
2685
|
+
hAnsiTheme: fonts.hAnsiTheme,
|
|
2686
|
+
eastAsiaTheme: fonts.eastAsiaTheme,
|
|
2687
|
+
csTheme: fonts.csTheme,
|
|
2688
|
+
hint: fonts.hint
|
|
2714
2689
|
};
|
|
2715
2690
|
if (props.fontFamily != null) patch.fontFamily = props.fontFamily;
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2691
|
+
const lang = props.lang;
|
|
2692
|
+
if (isPlainObject(lang)) patch.lang = {
|
|
2693
|
+
val: lang.val,
|
|
2694
|
+
eastAsia: lang.eastAsia,
|
|
2695
|
+
bidi: lang.bidi
|
|
2720
2696
|
};
|
|
2721
2697
|
if (props.fontSize != null) patch.fontSize = props.fontSize;
|
|
2722
2698
|
if (props.fontSizeCs != null) patch.fontSizeCs = props.fontSizeCs;
|
|
@@ -2757,19 +2733,24 @@ function sdRunPropsToInlineRunPatch(props) {
|
|
|
2757
2733
|
function projectColorRefToInlineColor(color) {
|
|
2758
2734
|
if (!color) return void 0;
|
|
2759
2735
|
if (typeof color === "string") return color;
|
|
2736
|
+
if (!isPlainObject(color)) return void 0;
|
|
2760
2737
|
if (color.model === "rgb") return color.value;
|
|
2761
2738
|
if (color.model === "auto") return "auto";
|
|
2762
2739
|
}
|
|
2763
2740
|
function projectUnderlineToInlinePatch(underline) {
|
|
2764
2741
|
if (underline == null) return void 0;
|
|
2742
|
+
if (!isPlainObject(underline)) return true;
|
|
2765
2743
|
const patch = {};
|
|
2766
2744
|
if (underline.style != null) patch.style = underline.style;
|
|
2767
|
-
|
|
2768
|
-
if (
|
|
2745
|
+
const color = underline.color;
|
|
2746
|
+
if (isPlainObject(color)) {
|
|
2747
|
+
if (color.model === "rgb") patch.color = color.value;
|
|
2748
|
+
else if (color.model === "theme") patch.themeColor = color.theme;
|
|
2749
|
+
}
|
|
2769
2750
|
return Object.keys(patch).length > 0 ? patch : true;
|
|
2770
2751
|
}
|
|
2771
2752
|
function projectShadingToInlinePatch(shading) {
|
|
2772
|
-
if (!shading) return void 0;
|
|
2753
|
+
if (!isPlainObject(shading)) return void 0;
|
|
2773
2754
|
const patch = {};
|
|
2774
2755
|
const fill = projectColorRefToInlineColor(shading.fill);
|
|
2775
2756
|
if (fill != null) patch.fill = fill;
|
|
@@ -2779,7 +2760,7 @@ function projectShadingToInlinePatch(shading) {
|
|
|
2779
2760
|
return Object.keys(patch).length > 0 ? patch : void 0;
|
|
2780
2761
|
}
|
|
2781
2762
|
function projectBorderToInlinePatch(border) {
|
|
2782
|
-
if (!border) return void 0;
|
|
2763
|
+
if (!isPlainObject(border)) return void 0;
|
|
2783
2764
|
const patch = {};
|
|
2784
2765
|
if (border.style != null) patch.val = border.style;
|
|
2785
2766
|
if (border.width != null) patch.sz = border.width;
|
|
@@ -2794,9 +2775,6 @@ function projectBorderToInlinePatch(border) {
|
|
|
2794
2775
|
*
|
|
2795
2776
|
* Falls back to the plain text target when the host has not populated an
|
|
2796
2777
|
* explicit `selectionTarget` yet.
|
|
2797
|
-
*
|
|
2798
|
-
* @param {{ selectionTarget?: unknown; target?: unknown } | null | undefined} selection
|
|
2799
|
-
* @returns {string}
|
|
2800
2778
|
*/
|
|
2801
2779
|
function selectionKey(selection) {
|
|
2802
2780
|
const target = selection?.selectionTarget ?? selection?.target;
|
|
@@ -2905,7 +2883,7 @@ function readAllResolvedFact(event, receipt) {
|
|
|
2905
2883
|
return fact;
|
|
2906
2884
|
}
|
|
2907
2885
|
//#endregion
|
|
2908
|
-
//#region src/helpers/v2-typing-mutation-event.
|
|
2886
|
+
//#region src/helpers/v2-typing-mutation-event.ts
|
|
2909
2887
|
/**
|
|
2910
2888
|
* Command kinds whose committed mutations belong to the sustained typing
|
|
2911
2889
|
* cadence class (insert / replace / plain paste / Backspace / Delete).
|
|
@@ -2946,9 +2924,6 @@ var V2_TYPING_COMMAND_KINDS = /* @__PURE__ */ new Set([
|
|
|
2946
2924
|
* Events without a forwarded `editableCommandKind` (programmatic Document API
|
|
2947
2925
|
* mutations, history commits, unclassified structural commands) return false
|
|
2948
2926
|
* so they keep hydrating immediately.
|
|
2949
|
-
*
|
|
2950
|
-
* @param {{ type?: string, origin?: string, editableCommandKind?: string } | null | undefined} event
|
|
2951
|
-
* @returns {boolean}
|
|
2952
2927
|
*/
|
|
2953
2928
|
var isV2EditableTextMutationEvent = (event) => {
|
|
2954
2929
|
if (event?.type !== "mutation:committed" || event.origin !== "command") return false;
|
|
@@ -15883,6 +15858,12 @@ Object.defineProperty(exports, "BUILT_IN_COMMAND_IDS", {
|
|
|
15883
15858
|
return BUILT_IN_COMMAND_IDS;
|
|
15884
15859
|
}
|
|
15885
15860
|
});
|
|
15861
|
+
Object.defineProperty(exports, "BUILT_IN_PERMISSION_METHOD", {
|
|
15862
|
+
enumerable: true,
|
|
15863
|
+
get: function() {
|
|
15864
|
+
return BUILT_IN_PERMISSION_METHOD;
|
|
15865
|
+
}
|
|
15866
|
+
});
|
|
15886
15867
|
Object.defineProperty(exports, "DOM_CLASS_NAMES", {
|
|
15887
15868
|
enumerable: true,
|
|
15888
15869
|
get: function() {
|
|
@@ -19,7 +19,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
|
19
19
|
var PRIVATE_ENGINE_INFO = (0, _superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
|
|
20
20
|
var ENGINE_INFO = Object.freeze({
|
|
21
21
|
...PRIVATE_ENGINE_INFO,
|
|
22
|
-
superdocVersion: "2.29.0-next.
|
|
22
|
+
superdocVersion: "2.29.0-next.13",
|
|
23
23
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
24
24
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
25
25
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
@@ -18,7 +18,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
|
|
|
18
18
|
var PRIVATE_ENGINE_INFO = getCollaborationUpgradeEngineInfo$1();
|
|
19
19
|
var ENGINE_INFO = Object.freeze({
|
|
20
20
|
...PRIVATE_ENGINE_INFO,
|
|
21
|
-
superdocVersion: "2.29.0-next.
|
|
21
|
+
superdocVersion: "2.29.0-next.13",
|
|
22
22
|
roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
|
|
23
23
|
supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
|
|
24
24
|
supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RichContentInsertInput } from '../insert/insert.js';
|
|
2
|
-
import { RichContentReplaceInput, ReplaceMutationOptions } from '../replace/replace.js';
|
|
3
|
-
import { ChangeMode,
|
|
2
|
+
import { RichContentReplaceInput, ReplaceMutationOptions, TrackedReplaceMutationOptions } from '../replace/replace.js';
|
|
3
|
+
import { ChangeMode, RichContentMutationOptions, TrackedRichContentMutationOptions } from '../write/write.js';
|
|
4
4
|
import { ProjectHtmlInput, ProjectMarkdownInput, SDContentProjectionResult, SDProjectionReviewMode, SDResolvedProjectionScope } from '../types/content-projection.js';
|
|
5
5
|
import { SDFragment } from '../types/fragment.js';
|
|
6
6
|
import { SDError, SDHtmlMarkdownOutcome, SDMutationConversionReport, SDMutationReceipt } from '../types/sd-contract.js';
|
|
@@ -15,13 +15,11 @@ export interface SDHtmlMarkdownCheckGuard {
|
|
|
15
15
|
export type SDHtmlMarkdownSupportCheckInput = {
|
|
16
16
|
operation: 'insert';
|
|
17
17
|
input: RichContentInsertInput;
|
|
18
|
-
options?:
|
|
19
|
-
changeMode?: ChangeMode;
|
|
20
|
-
} & TrackedAttribution;
|
|
18
|
+
options?: Pick<RichContentMutationOptions, 'changeMode' | 'author' | 'date'> | Pick<TrackedRichContentMutationOptions, 'changeMode' | 'author' | 'date'>;
|
|
21
19
|
} | {
|
|
22
20
|
operation: 'replace';
|
|
23
21
|
input: RichContentReplaceInput;
|
|
24
|
-
options?: Pick<ReplaceMutationOptions, 'changeMode' | 'replaceMode' | 'expectedSnapshotId'>
|
|
22
|
+
options?: Pick<ReplaceMutationOptions, 'changeMode' | 'replaceMode' | 'expectedSnapshotId' | 'author' | 'date'> | Pick<TrackedReplaceMutationOptions, 'changeMode' | 'replaceMode' | 'expectedSnapshotId' | 'author' | 'date'>;
|
|
25
23
|
} | {
|
|
26
24
|
operation: 'projectHtml';
|
|
27
25
|
input?: ProjectHtmlInput;
|
|
@@ -25,6 +25,7 @@ export interface AddCommentInput extends CommentCreateAttributionInput {
|
|
|
25
25
|
target?: CommentTarget;
|
|
26
26
|
/** The comment body text. */
|
|
27
27
|
text: string;
|
|
28
|
+
expectedText?: string;
|
|
28
29
|
}
|
|
29
30
|
export interface EditCommentInput {
|
|
30
31
|
commentId: string;
|
|
@@ -114,6 +115,7 @@ export interface CommentsCreateInput extends CommentCreateAttributionInput {
|
|
|
114
115
|
* both when they contain the same value.
|
|
115
116
|
*/
|
|
116
117
|
parentId?: string;
|
|
118
|
+
expectedText?: string;
|
|
117
119
|
}
|
|
118
120
|
/**
|
|
119
121
|
* Input for `comments.patch`: field-level patch on an existing comment.
|
|
@@ -3,7 +3,7 @@ export declare const OPERATION_IDEMPOTENCY_VALUES: readonly ["idempotent", "cond
|
|
|
3
3
|
export type OperationIdempotency = (typeof OPERATION_IDEMPOTENCY_VALUES)[number];
|
|
4
4
|
export declare const OPERATION_TRACKED_SUPPORT_VALUES: readonly ["always", "conditional", "never"];
|
|
5
5
|
export type OperationTrackedSupport = (typeof OPERATION_TRACKED_SUPPORT_VALUES)[number];
|
|
6
|
-
export declare const PRE_APPLY_THROW_CODES: readonly ["TARGET_NOT_FOUND", "CAPABILITY_UNAVAILABLE", "INVALID_TARGET", "AMBIGUOUS_TARGET", "REVISION_MISMATCH", "MATCH_NOT_FOUND", "AMBIGUOUS_MATCH", "STYLE_CONFLICT", "PRECONDITION_FAILED", "INVALID_INPUT", "CROSS_BLOCK_MATCH", "SPAN_FRAGMENTED", "TARGET_MOVED", "PLAN_CONFLICT_OVERLAP", "INVALID_STEP_COMBINATION", "REVISION_CHANGED_SINCE_COMPILE", "INVALID_INSERTION_CONTEXT", "DOCUMENT_IDENTITY_CONFLICT", "INTERNAL_ERROR", "ADDRESS_STALE", "DUPLICATE_ID", "INVALID_CONTEXT", "RAW_MODE_REQUIRED", "PRESERVE_ONLY_VIOLATION", "CAPABILITY_UNSUPPORTED", "LOCK_VIOLATION", "TYPE_MISMATCH", "STORY_NOT_FOUND", "STORY_MISMATCH", "STORY_NOT_SUPPORTED", "CROSS_STORY_PLAN", "MATERIALIZATION_FAILED", "RESOURCE_LIMIT"];
|
|
6
|
+
export declare const PRE_APPLY_THROW_CODES: readonly ["TARGET_NOT_FOUND", "CAPABILITY_UNAVAILABLE", "INVALID_TARGET", "AMBIGUOUS_TARGET", "REVISION_MISMATCH", "MATCH_NOT_FOUND", "AMBIGUOUS_MATCH", "STYLE_CONFLICT", "PRECONDITION_FAILED", "INVALID_INPUT", "INVALID_ARGUMENT", "CROSS_BLOCK_MATCH", "SPAN_FRAGMENTED", "TARGET_MOVED", "PLAN_CONFLICT_OVERLAP", "INVALID_STEP_COMBINATION", "REVISION_CHANGED_SINCE_COMPILE", "INVALID_INSERTION_CONTEXT", "DOCUMENT_IDENTITY_CONFLICT", "INTERNAL_ERROR", "ADDRESS_STALE", "DUPLICATE_ID", "INVALID_CONTEXT", "RAW_MODE_REQUIRED", "PRESERVE_ONLY_VIOLATION", "CAPABILITY_UNSUPPORTED", "LOCK_VIOLATION", "TYPE_MISMATCH", "STORY_NOT_FOUND", "STORY_MISMATCH", "STORY_NOT_SUPPORTED", "CROSS_STORY_PLAN", "MATERIALIZATION_FAILED", "RESOURCE_LIMIT"];
|
|
7
7
|
export type PreApplyThrowCode = (typeof PRE_APPLY_THROW_CODES)[number];
|
|
8
8
|
export interface CommandThrowPolicy {
|
|
9
9
|
preApply: readonly PreApplyThrowCode[];
|
|
@@ -933,8 +933,8 @@ export declare const OPERATION_DEFINITIONS: {
|
|
|
933
933
|
};
|
|
934
934
|
readonly 'comments.create': {
|
|
935
935
|
readonly memberPath: "comments.create";
|
|
936
|
-
readonly description: "Create a new comment thread (or reply when parentCommentId is given). Accepts TextAddress / TextTarget anchors, or a TrackedChangeCommentTarget that names a logical tracked-change id. The tracked-change target accepts both the explicit kind form and the Labs-compatible trackedChangeId-only form; the adapter normalizes it to a Word-compatible content anchor on the requested revision side. Callers may supply a durable externalId, or use the v1-compatible caller-supplied commentId alias, plus author fields and arbitrary JSON metadata for integration correlation. The caller-owned id remains distinct from the generated Word-compatible commentId.";
|
|
937
|
-
readonly expectedResult: "Returns a Receipt with the new commentId in `id` and `inserted` on success; rejects whitespace-only bodies, unsupported anchor contexts, and cross-story targets. Tracked-change comment targets support insertion, deletion, replacement, and paired-move revisions; they fail with `TARGET_NOT_FOUND` for stale ids, `CAPABILITY_UNAVAILABLE` for formatting / structural revisions and unpaired move sides, and `INVALID_TARGET` for incompatible side requests or ambiguous replacement targets that omit a required `side`.";
|
|
936
|
+
readonly description: "Create a new comment thread (or reply when parentCommentId is given). Accepts TextAddress / TextTarget anchors, or a TrackedChangeCommentTarget that names a logical tracked-change id. The tracked-change target accepts both the explicit kind form and the Labs-compatible trackedChangeId-only form; the adapter normalizes it to a Word-compatible content anchor on the requested revision side. Callers may supply a durable externalId, or use the v1-compatible caller-supplied commentId alias, plus author fields and arbitrary JSON metadata for integration correlation. The caller-owned id remains distinct from the generated Word-compatible commentId. Pass expectedText with a single-paragraph text target to refuse the comment when the text at that target has changed since it was selected.";
|
|
937
|
+
readonly expectedResult: "Returns a Receipt with the new commentId in `id` and `inserted` on success; rejects whitespace-only bodies, unsupported anchor contexts, and cross-story targets. When expectedText is given and the target text differs, fails with `PRECONDITION_FAILED` before any change. Tracked-change comment targets support insertion, deletion, replacement, and paired-move revisions; they fail with `TARGET_NOT_FOUND` for stale ids, `CAPABILITY_UNAVAILABLE` for formatting / structural revisions and unpaired move sides, and `INVALID_TARGET` for incompatible side requests or ambiguous replacement targets that omit a required `side`.";
|
|
938
938
|
readonly requiresDocumentContext: true;
|
|
939
939
|
readonly metadata: CommandStaticMetadata;
|
|
940
940
|
readonly referenceDocPath: "comments/create.mdx";
|
|
@@ -1448,7 +1448,7 @@ export declare const OPERATION_DEFINITIONS: {
|
|
|
1448
1448
|
};
|
|
1449
1449
|
readonly 'tables.sort': {
|
|
1450
1450
|
readonly memberPath: "tables.sort";
|
|
1451
|
-
readonly description: "Sort table rows by
|
|
1451
|
+
readonly description: "Sort table rows by column values, preserving the leading repeating-header prefix unless skipHeaderRows specifies an exact override. Repetition flags and styling remain attached to their rows. Collaborative sessions reject structural table rewrites without mutation.";
|
|
1452
1452
|
readonly expectedResult: "Returns a TableMutationResult receipt confirming rows were reordered.";
|
|
1453
1453
|
readonly requiresDocumentContext: true;
|
|
1454
1454
|
readonly metadata: CommandStaticMetadata;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DocumentApiSurface } from '../index.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { InsertInput } from '../insert/insert.js';
|
|
3
|
+
import { ReplaceInput, TrackedReplaceMutationOptions } from '../replace/replace.js';
|
|
4
4
|
import { BodyStoryLocator } from '../types/story.types.js';
|
|
5
5
|
import { OperationCancellation } from '../write/operation-cancellation.js';
|
|
6
|
-
import {
|
|
6
|
+
import { TrackedRichContentMutationOptions } from '../write/write.js';
|
|
7
7
|
import { OPERATION_DEFINITIONS } from './operation-definitions.js';
|
|
8
8
|
import { OperationId } from './types.js';
|
|
9
9
|
type ResolveMemberPath<T, Path extends string> = Path extends `${infer Head}.${infer Tail}` ? Head extends keyof T ? ResolveMemberPath<T[Head], Tail> : never : Path extends keyof T ? T[Path] : never;
|
|
@@ -32,19 +32,20 @@ type MethodInvokeRequest<T extends OperationId> = OperationRegistry[T]['options'
|
|
|
32
32
|
input: OperationRegistry[T]['input'];
|
|
33
33
|
options?: OperationRegistry[T]['options'];
|
|
34
34
|
};
|
|
35
|
-
type
|
|
35
|
+
type AttributedInvokeRequest<T extends OperationId> = T extends 'insert' ? {
|
|
36
36
|
operationId: T;
|
|
37
|
-
input:
|
|
38
|
-
options:
|
|
37
|
+
input: InsertInput;
|
|
38
|
+
options: TrackedRichContentMutationOptions & OperationCancellation;
|
|
39
39
|
} : T extends 'replace' ? {
|
|
40
40
|
operationId: T;
|
|
41
|
-
input: Exclude<
|
|
41
|
+
input: Exclude<ReplaceInput, {
|
|
42
42
|
target: BodyStoryLocator;
|
|
43
|
+
text: string;
|
|
43
44
|
}>;
|
|
44
|
-
options:
|
|
45
|
+
options: TrackedReplaceMutationOptions;
|
|
45
46
|
} : never;
|
|
46
47
|
/** Typed invoke request narrowed by `operationId` and supported content shape. */
|
|
47
|
-
export type InvokeRequest<T extends OperationId> = MethodInvokeRequest<T> |
|
|
48
|
+
export type InvokeRequest<T extends OperationId> = MethodInvokeRequest<T> | AttributedInvokeRequest<T>;
|
|
48
49
|
/** Typed invoke result narrowed by `operationId`. */
|
|
49
50
|
export type InvokeResult<T extends OperationId> = T extends 'mutations.preview' | 'mutations.apply' ? Promise<OperationRegistry[T]['output']> : T extends 'plan.execute' ? OperationRegistry[T]['output'] | Promise<OperationRegistry[T]['output']> : OperationRegistry[T]['output'];
|
|
50
51
|
export type OperationCall<T extends OperationId> = InvokeRequest<T> extends infer Request ? (Request extends unknown ? Omit<Request, 'operationId'> : never) : never;
|