superdoc 2.29.0-next.2 → 2.29.0-next.9
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-BFt8agAI.es.js → create-super-doc-ui-Bm5kmx0W.es.js} +12 -29
- package/dist/chunks/{create-super-doc-ui-BAGOnYGM.cjs → create-super-doc-ui-DN70aatf.cjs} +17 -28
- 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/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 +35 -1867
- package/dist/superdoc/src/components/CommentsLayer/CommentHeader.vue.d.ts +3 -4
- package/dist/superdoc/src/components/CommentsLayer/CommentInput.vue.d.ts +3 -618
- 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 +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 +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/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/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-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/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 +4 -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/icons.d.ts +8 -0
- 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/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 +1623 -2477
- package/dist/superdoc.es.js +1604 -2461
- 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/chunks/{create-super-doc-ui-BFt8agAI.es.js → create-super-doc-ui-Bm5kmx0W.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 | 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
1223
|
var isAllowed = (permission, role, isInternal, context = {}) => {
|
|
1241
1224
|
const defaultDecision = defaultDecisionFor(permission, role, isInternal);
|
|
1242
1225
|
const resolver = pickResolver(context);
|
|
@@ -15876,4 +15859,4 @@ function commandIsActive(descriptor, selection) {
|
|
|
15876
15859
|
return descriptor.activeMark ? selection.activeMarks.includes(descriptor.activeMark) : false;
|
|
15877
15860
|
}
|
|
15878
15861
|
//#endregion
|
|
15879
|
-
export {
|
|
15862
|
+
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 | 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
1223
|
var isAllowed = (permission, role, isInternal, context = {}) => {
|
|
1241
1224
|
const defaultDecision = defaultDecisionFor(permission, role, isInternal);
|
|
1242
1225
|
const resolver = pickResolver(context);
|
|
@@ -15883,6 +15866,12 @@ Object.defineProperty(exports, "BUILT_IN_COMMAND_IDS", {
|
|
|
15883
15866
|
return BUILT_IN_COMMAND_IDS;
|
|
15884
15867
|
}
|
|
15885
15868
|
});
|
|
15869
|
+
Object.defineProperty(exports, "BUILT_IN_PERMISSION_METHOD", {
|
|
15870
|
+
enumerable: true,
|
|
15871
|
+
get: function() {
|
|
15872
|
+
return BUILT_IN_PERMISSION_METHOD;
|
|
15873
|
+
}
|
|
15874
|
+
});
|
|
15886
15875
|
Object.defineProperty(exports, "DOM_CLASS_NAMES", {
|
|
15887
15876
|
enumerable: true,
|
|
15888
15877
|
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.9",
|
|
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.9",
|
|
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.
|
|
@@ -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";
|
|
@@ -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;
|
|
@@ -26,12 +26,12 @@ import { InsertInput } from './insert/insert.js';
|
|
|
26
26
|
import { ResolveRangeInput, ResolveRangeOutput } from './ranges/ranges.types.js';
|
|
27
27
|
import { SelectionApi, SelectionAdapter } from './selection/selection.js';
|
|
28
28
|
import { ListsAdapter, ListsApi } from './lists/lists.js';
|
|
29
|
-
import { ReplaceInput, ReplaceMutationOptions } from './replace/replace.js';
|
|
29
|
+
import { ReplaceInput, ReplaceMutationOptions, TrackedReplaceMutationOptions } from './replace/replace.js';
|
|
30
30
|
import { CreateAdapter, CreateApi } from './create/create.js';
|
|
31
31
|
import { BlocksAdapter, BlocksApi } from './blocks/blocks.js';
|
|
32
32
|
import { TableLocator, TableMutationResult, TablesConvertFromTextInput, TablesMoveInput, TablesSplitInput, TablesConvertToTextInput, TablesSetLayoutInput, TablesInsertRowInput, TablesDeleteRowInput, TablesMoveRowInput, TablesSetRowHeightInput, TablesDistributeRowsInput, TablesSetRowOptionsInput, TablesInsertColumnInput, TablesDeleteColumnInput, TablesMoveColumnInput, TablesSetColumnWidthInput, TablesDistributeColumnsInput, TablesInsertCellInput, TablesDeleteCellInput, TablesMergeCellsInput, TablesUnmergeCellsInput, TablesSplitCellInput, TablesSetCellPropertiesInput, TablesSetCellTextInput, TablesSortInput, TablesSetAltTextInput, TablesSetStyleInput, TablesClearStyleInput, TablesSetStyleOptionInput, TablesSetBorderInput, TablesClearBorderInput, TablesApplyBorderPresetInput, TablesSetShadingInput, TablesClearShadingInput, TablesSetTablePaddingInput, TablesSetCellPaddingInput, TablesSetCellSpacingInput, TablesClearCellSpacingInput, TablesApplyStyleInput, TablesSetBordersInput, TablesSetTableOptionsInput, TablesApplyPresetInput, TablesGetInput, TablesGetOutput, TablesGetCellsInput, TablesGetCellsOutput, TablesGetPropertiesInput, TablesGetPropertiesOutput, TablesGetStylesInput, TablesGetStylesOutput, TablesSetDefaultStyleInput, TablesClearDefaultStyleInput } from './types/table-operations.types.js';
|
|
33
33
|
import { TrackChangesAdapter, TrackChangesApi } from './track-changes/track-changes.js';
|
|
34
|
-
import { MutationOptions, RichContentMutationOptions,
|
|
34
|
+
import { MutationOptions, RichContentMutationOptions, TrackedRichContentMutationOptions, TextMutationOptions, WriteAdapter } from './write/write.js';
|
|
35
35
|
import { OperationCancellation } from './write/operation-cancellation.js';
|
|
36
36
|
import { SelectionMutationAdapter } from './selection-mutation.js';
|
|
37
37
|
import { CapabilitiesAdapter, DocumentApiCapabilities, OperationCapabilityResolveInput, OperationCapabilityResolveResult } from './capabilities/capabilities.js';
|
|
@@ -109,7 +109,7 @@ export type { GetMarkdownAdapter, GetMarkdownInput } from './get-markdown/get-ma
|
|
|
109
109
|
export type { GetHtmlAdapter, GetHtmlInput } from './get-html/get-html.js';
|
|
110
110
|
export type { InfoAdapter, InfoInput } from './info/info.js';
|
|
111
111
|
export type { ExtractAdapter, ExtractInput } from './extract/extract.js';
|
|
112
|
-
export type { WriteAdapter, WriteRequest, RichContentMutationOptions, TrackedAttribution, TrackedTextMutationOptions, TextMutationOptions, } from './write/write.js';
|
|
112
|
+
export type { WriteAdapter, WriteRequest, RichContentMutationOptions, TrackedAttribution, TrackedRichContentMutationOptions, TrackedTextMutationOptions, TextMutationOptions, } from './write/write.js';
|
|
113
113
|
export type { OperationCancellation, OperationCancellationCode } from './write/operation-cancellation.js';
|
|
114
114
|
export { OperationCancellationError, assertOperationCanStart, indeterminateOperation, splitOperationCancellation, } from './write/operation-cancellation.js';
|
|
115
115
|
export type { FormatInlineAliasApi, FormatInlineAliasInput, FormatBoldInput, FormatItalicInput, FormatRangeInput, FormatUnderlineInput, FormatStrikethroughInput, StyleApplyInput, StyleApplyOptions, } from './format/format.js';
|
|
@@ -185,7 +185,7 @@ export type { MutationReceiptBridgeContext, StructuralReceiptParams } from './re
|
|
|
185
185
|
export { isBlockNodeAddress } from './validation-primitives.js';
|
|
186
186
|
export type { InsertInput, InsertContentType, TextInsertInput, PlainTextInsertInput, RichContentInsertInput, NativeOoxmlInsertInput, LegacyInsertInput, } from './insert/insert.js';
|
|
187
187
|
export { isStructuralInsertInput } from './insert/insert.js';
|
|
188
|
-
export type { ReplaceInput, TextReplaceInput, TextReplacementGranularity, RichContentReplaceInput, ReplaceMutationOptions, NativeOoxmlReplaceInput, SnapshotReplaceInput, ParagraphTextReplaceInput, } from './replace/replace.js';
|
|
188
|
+
export type { ReplaceInput, TextReplaceInput, TextReplacementGranularity, RichContentReplaceInput, ReplaceMutationOptions, TrackedReplaceMutationOptions, NativeOoxmlReplaceInput, SnapshotReplaceInput, ParagraphTextReplaceInput, } from './replace/replace.js';
|
|
189
189
|
export { executeReplace, isStructuralReplaceInput, isRichContentReplaceInput, TEXT_REPLACEMENT_GRANULARITIES, isTextReplacementGranularity, isSingleParagraphVisibleTextSelection, } from './replace/replace.js';
|
|
190
190
|
export { executeFind } from './find/find.js';
|
|
191
191
|
export { validateDocumentFragment, validateSDFragment } from './validation/fragment-validator.js';
|
|
@@ -362,14 +362,15 @@ export interface DocumentApiSurface {
|
|
|
362
362
|
* Insert content at a target location.
|
|
363
363
|
* If target is omitted, inserts at the end of the document.
|
|
364
364
|
*/
|
|
365
|
-
insert(input:
|
|
365
|
+
insert(input: InsertInput, options: TrackedRichContentMutationOptions & OperationCancellation): SDMutationReceipt;
|
|
366
366
|
insert(input: InsertInput, options?: RichContentMutationOptions & OperationCancellation): SDMutationReceipt;
|
|
367
367
|
/**
|
|
368
368
|
* Replace text at a target range.
|
|
369
369
|
*/
|
|
370
|
-
replace(input: Exclude<
|
|
370
|
+
replace(input: Exclude<ReplaceInput, {
|
|
371
371
|
target: import('./types/story.types.js').BodyStoryLocator;
|
|
372
|
-
|
|
372
|
+
text: string;
|
|
373
|
+
}>, options: TrackedReplaceMutationOptions): SDMutationReceipt;
|
|
373
374
|
replace(input: ReplaceInput, options?: ReplaceMutationOptions): SDMutationReceipt;
|
|
374
375
|
/**
|
|
375
376
|
* Delete text at a target range.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OoxmlContentSource } from '../selection/selection.types.js';
|
|
2
|
-
import { RichContentMutationOptions, TextMutationOptions, WriteAdapter } from '../write/write.js';
|
|
2
|
+
import { RichContentMutationOptions, TextMutationOptions, TrackedRichContentMutationOptions, WriteAdapter } from '../write/write.js';
|
|
3
3
|
import { SelectionTarget, TargetLocator, SDMutationReceipt } from '../types/index.js';
|
|
4
4
|
import { SDInsertInput } from '../types/structural-input.js';
|
|
5
5
|
import { StoryLocator } from '../types/story.types.js';
|
|
@@ -80,5 +80,5 @@ export declare function validateInsertInput(input: unknown): asserts input is In
|
|
|
80
80
|
* @param options - Optional mutation options (changeMode, dryRun, expectedRevision).
|
|
81
81
|
* @returns Receipt indicating success/failure and mutation metadata.
|
|
82
82
|
*/
|
|
83
|
-
export declare function executeInsert(selectionAdapter: SelectionMutationAdapter, writeAdapter: WriteAdapter, input: InsertInput, options?: (RichContentMutationOptions | TextMutationOptions) & OperationCancellation): SDMutationReceipt;
|
|
83
|
+
export declare function executeInsert(selectionAdapter: SelectionMutationAdapter, writeAdapter: WriteAdapter, input: InsertInput, options?: (RichContentMutationOptions | TrackedRichContentMutationOptions | TextMutationOptions) & OperationCancellation): SDMutationReceipt;
|
|
84
84
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OoxmlContentSource } from '../selection/selection.types.js';
|
|
2
|
-
import { RichContentMutationOptions, TextMutationOptions, WriteAdapter } from '../write/write.js';
|
|
2
|
+
import { RichContentMutationOptions, TextMutationOptions, TrackedRichContentMutationOptions, WriteAdapter } from '../write/write.js';
|
|
3
3
|
import { SelectionTarget } from '../types/address.js';
|
|
4
4
|
import { SDMutationReceipt } from '../types/sd-contract.js';
|
|
5
5
|
import { SDReplaceInput } from '../types/structural-input.js';
|
|
@@ -81,7 +81,8 @@ export interface ReplaceMutationOptions extends RichContentMutationOptions {
|
|
|
81
81
|
/** Compare the addressed paragraph with an unchanged retained snapshot before committing. */
|
|
82
82
|
expectedSnapshotId?: string;
|
|
83
83
|
}
|
|
84
|
-
type
|
|
84
|
+
export type TrackedReplaceMutationOptions = TrackedRichContentMutationOptions & Pick<ReplaceMutationOptions, 'replaceMode' | 'expectedSnapshotId'>;
|
|
85
|
+
type ReplaceExecutionOptions = ReplaceMutationOptions | TrackedReplaceMutationOptions | (TextMutationOptions & {
|
|
85
86
|
replaceMode?: never;
|
|
86
87
|
expectedSnapshotId?: never;
|
|
87
88
|
});
|
|
@@ -17,6 +17,7 @@ export type Range = {
|
|
|
17
17
|
export type TextCoordinateSpace = 'visible' | 'tracked';
|
|
18
18
|
export type TextAddress = {
|
|
19
19
|
kind: 'text';
|
|
20
|
+
captureState?: string;
|
|
20
21
|
blockId: string;
|
|
21
22
|
range: Range;
|
|
22
23
|
/** Story containing this text. Omit for body (backward compatible). */
|
|
@@ -47,6 +48,7 @@ export type TextSegment = {
|
|
|
47
48
|
*/
|
|
48
49
|
export type TextTarget = {
|
|
49
50
|
kind: 'text';
|
|
51
|
+
captureState?: string;
|
|
50
52
|
segments: [TextSegment, ...TextSegment[]];
|
|
51
53
|
/** Story containing this text target. Omit for body (backward compatible). */
|
|
52
54
|
story?: StoryLocator;
|
|
@@ -93,6 +95,7 @@ export type SelectionPoint = {
|
|
|
93
95
|
*/
|
|
94
96
|
export type SelectionTarget = {
|
|
95
97
|
kind: 'selection';
|
|
98
|
+
captureState?: string;
|
|
96
99
|
start: SelectionPoint;
|
|
97
100
|
end: SelectionPoint;
|
|
98
101
|
/** Story containing this selection. Omit for body (backward compatible). */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DocumentApiSurface } from '../index.js';
|
|
2
2
|
import { ReceiptEntity, ReceiptFailureResult, ReceiptSuccess } from './receipt.js';
|
|
3
3
|
import { PlainTextInsertInput } from '../insert/insert.js';
|
|
4
|
-
import { ParagraphTextReplaceInput, ReplaceMutationOptions, TextReplaceInput } from '../replace/replace.js';
|
|
4
|
+
import { ParagraphTextReplaceInput, ReplaceMutationOptions, TextReplaceInput, TrackedReplaceMutationOptions } from '../replace/replace.js';
|
|
5
5
|
import { MutationOptions, TrackedTextMutationOptions } from '../write/write.js';
|
|
6
6
|
import { BodyStoryLocator } from './story.types.js';
|
|
7
7
|
type TemporaryCall<Name extends string, Method extends (...args: never[]) => unknown> = {
|
|
@@ -37,6 +37,10 @@ export type TemporaryMutationOperation = {
|
|
|
37
37
|
operation: 'replace';
|
|
38
38
|
input: ParagraphTextReplaceInput;
|
|
39
39
|
options?: ReplaceMutationOptions;
|
|
40
|
+
} | {
|
|
41
|
+
operation: 'replace';
|
|
42
|
+
input: ParagraphTextReplaceInput;
|
|
43
|
+
options: TrackedReplaceMutationOptions;
|
|
40
44
|
} | TemporaryCall<'delete', DocumentApiSurface['delete']> | TemporaryCall<'blocks.delete', DocumentApiSurface['blocks']['delete']> | TemporaryCall<'trackChanges.decide', DocumentApiSurface['trackChanges']['decide']> | {
|
|
41
45
|
operation: 'comments.create';
|
|
42
46
|
input: TemporaryCommentInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextMutationReceipt, SDMutationReceipt } from '../types/index.js';
|
|
2
2
|
import { InsertInput } from '../insert/insert.js';
|
|
3
|
-
import { ReplaceMutationOptions, ReplaceInput } from '../replace/replace.js';
|
|
3
|
+
import { ReplaceMutationOptions, ReplaceInput, TrackedReplaceMutationOptions } from '../replace/replace.js';
|
|
4
4
|
import { StoryLocator } from '../types/story.types.js';
|
|
5
5
|
import { SDHtmlMarkdownCheckGuard } from '../capabilities/html-markdown-support.js';
|
|
6
6
|
export type ChangeMode = 'direct' | 'tracked';
|
|
@@ -50,16 +50,22 @@ export interface TrackedAttribution {
|
|
|
50
50
|
/** ISO 8601 UTC revision timestamp. Omitted values use the transaction time. */
|
|
51
51
|
date?: string;
|
|
52
52
|
}
|
|
53
|
-
export interface RichContentMutationOptions extends MutationOptions
|
|
53
|
+
export interface RichContentMutationOptions extends MutationOptions {
|
|
54
|
+
author?: never;
|
|
55
|
+
date?: never;
|
|
54
56
|
/** Guard returned by `doc.capabilities.check` for an exact rich write. */
|
|
55
57
|
supportCheck?: SDHtmlMarkdownCheckGuard;
|
|
56
58
|
}
|
|
57
59
|
export interface TrackedTextMutationOptions extends MutationOptions, TrackedAttribution {
|
|
58
60
|
changeMode: 'tracked';
|
|
59
61
|
}
|
|
60
|
-
export type
|
|
62
|
+
export type TrackedRichContentMutationOptions = TrackedTextMutationOptions & Pick<RichContentMutationOptions, 'supportCheck'>;
|
|
63
|
+
export type TextMutationOptions = (MutationOptions & {
|
|
64
|
+
author?: never;
|
|
65
|
+
date?: never;
|
|
66
|
+
}) | TrackedTextMutationOptions;
|
|
61
67
|
export declare function normalizeTextMutationOptions(options?: RichContentMutationOptions | TextMutationOptions): RichContentMutationOptions | TrackedTextMutationOptions;
|
|
62
|
-
export declare function normalizeRichMutationOptions(options: (MutationOptions & TrackedAttribution &
|
|
68
|
+
export declare function normalizeRichMutationOptions(options: (MutationOptions & TrackedAttribution & Pick<RichContentMutationOptions, 'supportCheck'>) | undefined, supportCheckOperation?: 'insert' | 'replace'): RichContentMutationOptions | TrackedRichContentMutationOptions;
|
|
63
69
|
/**
|
|
64
70
|
* Text insertion request: target-less insert at document end.
|
|
65
71
|
*
|
|
@@ -87,9 +93,9 @@ export interface WriteAdapter {
|
|
|
87
93
|
readonly supportsNativeOoxml?: boolean;
|
|
88
94
|
write(request: InsertWriteRequest, options?: TextMutationOptions): TextMutationReceipt;
|
|
89
95
|
/** Structured insert for SDFragment or markdown/html content. Returns SDMutationReceipt. */
|
|
90
|
-
insertStructured(input: InsertInput, options?: RichContentMutationOptions): SDMutationReceipt;
|
|
96
|
+
insertStructured(input: InsertInput, options?: RichContentMutationOptions | TrackedRichContentMutationOptions): SDMutationReceipt;
|
|
91
97
|
/** Structured replace for SDFragment or markdown/html content. Returns SDMutationReceipt. */
|
|
92
|
-
replaceStructured(input: ReplaceInput, options?: ReplaceMutationOptions): SDMutationReceipt;
|
|
98
|
+
replaceStructured(input: ReplaceInput, options?: ReplaceMutationOptions | TrackedReplaceMutationOptions): SDMutationReceipt;
|
|
93
99
|
}
|
|
94
100
|
export declare function normalizeMutationOptions(options?: MutationOptions | RichContentMutationOptions, supportCheckOperation?: 'insert' | 'replace'): RichContentMutationOptions;
|
|
95
101
|
export declare function executeWrite(adapter: WriteAdapter, request: InsertWriteRequest, options?: TextMutationOptions): TextMutationReceipt;
|
package/dist/public/ui-react.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-
|
|
2
|
+
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DN70aatf.cjs");
|
|
3
3
|
const require_slice_source = require("../chunks/slice-source-CFaqq0Vo.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
let use_sync_external_store_shim = require("use-sync-external-store/shim");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-
|
|
1
|
+
import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-Bm5kmx0W.es.js";
|
|
2
2
|
import { t as toSliceSource } from "../chunks/slice-source-gfOhG2MW.es.js";
|
|
3
3
|
import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { useSyncExternalStore } from "use-sync-external-store/shim";
|
package/dist/public/ui-vue.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-
|
|
2
|
+
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DN70aatf.cjs");
|
|
3
3
|
const require_slice_source = require("../chunks/slice-source-CFaqq0Vo.cjs");
|
|
4
4
|
let superdoc_entry_vue = require("vue");
|
|
5
5
|
//#region src/public/ui/vue.ts
|
package/dist/public/ui-vue.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-
|
|
1
|
+
import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-Bm5kmx0W.es.js";
|
|
2
2
|
import { t as toSliceSource } from "../chunks/slice-source-gfOhG2MW.es.js";
|
|
3
3
|
import { computed, inject, onScopeDispose, provide, shallowRef, toRaw, toValue, watch } from "vue";
|
|
4
4
|
//#region src/public/ui/vue.ts
|
package/dist/public/ui.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-
|
|
2
|
+
const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DN70aatf.cjs");
|
|
3
3
|
//#region ../document-api/src/types/receipt.ts
|
|
4
4
|
/** Read a known failure.details.reason without assuming every failure has one. */
|
|
5
5
|
function getDocumentApiRejectionReason(details) {
|
package/dist/public/ui.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as shallowEqual, s as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-
|
|
1
|
+
import { m as shallowEqual, s as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-Bm5kmx0W.es.js";
|
|
2
2
|
//#region ../document-api/src/types/receipt.ts
|
|
3
3
|
/** Read a known failure.details.reason without assuming every failure has one. */
|
|
4
4
|
function getDocumentApiRejectionReason(details) {
|