superdoc 2.28.0 → 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-Cg072l5d.cjs → PdfViewer-DmSkZehl.cjs} +72 -100
- package/dist/chunks/{PdfViewer-JHXZQZ9x.es.js → PdfViewer-aOWhUVI7.es.js} +69 -97
- 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-BbjHD1ul.es.js → create-super-doc-ui-DdT4b29f.es.js} +200 -65
- package/dist/chunks/{create-super-doc-ui-BfgYblyI.cjs → create-super-doc-ui-_SbygYQ4.cjs} +227 -68
- package/dist/chunks/is-finite-number-BEXgTRgc.cjs +11 -0
- package/dist/chunks/is-finite-number-BpL4F38c.es.js +6 -0
- 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/lists/lists.d.ts +79 -79
- 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 +18 -11
- 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/layout-engine/painters/dom/src/page-content.d.ts +1 -1
- package/dist/layout-engine/painters/dom/src/persistent-page-surface.d.ts +2 -0
- 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 +137 -61
- package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +533 -48
- package/dist/superdoc/src/components/CommentsLayer/CommentHeader.vue.d.ts +107 -23
- 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/FloatingComments.vue.d.ts +21 -8
- 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 +14 -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/SurfaceDialog.vue.d.ts +27 -9
- package/dist/superdoc/src/components/surfaces/SurfaceExternalMount.vue.d.ts +53 -16
- 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-link-popover.d.ts +3 -3
- package/dist/superdoc/src/composables/use-password-prompt.d.ts +23 -24
- package/dist/superdoc/src/composables/use-superdoc-instance.d.ts +4 -1
- 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 +3 -8
- 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 -9
- 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 +14 -23
- 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/is-finite-number.d.ts +1 -0
- 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 +7 -16
- 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 +181 -36
- package/dist/superdoc/src/internal/toolbar/built-in/LinkedStyle.vue.d.ts +39 -10
- package/dist/superdoc/src/internal/toolbar/built-in/PageNumberMenu.vue.d.ts +133 -22
- package/dist/superdoc/src/internal/toolbar/built-in/SdTooltip.vue.d.ts +62 -23
- 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/ToolbarButton.vue.d.ts +101 -16
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButtonIcon.vue.d.ts +31 -10
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarComboBox.vue.d.ts +80 -11
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarDropdown.vue.d.ts +113 -33
- 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 -49
- 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 +372 -123
- 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 +1117 -370
- package/dist/superdoc.cjs +1923 -2838
- package/dist/superdoc.es.js +1863 -2783
- 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/built-in/OverflowMenu.vue.d.ts +0 -104
- package/dist/superdoc/src/internal/toolbar/index.d.ts +0 -10
- package/dist/superdoc/src/main.d.ts +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require__plugin_vue_export_helper = require("./_plugin-vue_export-helper-6MBoygIY.cjs");
|
|
2
|
+
const require_is_finite_number = require("./is-finite-number-BEXgTRgc.cjs");
|
|
2
3
|
//#region src/internal/diagnostics/workflow-recording.ts
|
|
3
4
|
var fields$1 = /* @__PURE__ */ new Set([
|
|
4
5
|
"documentId",
|
|
@@ -1078,6 +1079,11 @@ var decodeLayoutStoryDataset = (raw) => {
|
|
|
1078
1079
|
`${DOM_CLASS_NAMES.BLOCK_SDT}${DATA_ATTRS.SDT_ID}`;
|
|
1079
1080
|
`${DATA_ATTRS.DRAGGABLE}`;
|
|
1080
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
|
|
1081
1087
|
//#region src/helpers/tracked-change-comment-lane.ts
|
|
1082
1088
|
var TRACKED_CHANGE_COMMENT_LANE_ID_PREFIX = "tc-comment:";
|
|
1083
1089
|
function isSyntheticTrackedChangeCommentLaneItem(item) {
|
|
@@ -1087,14 +1093,149 @@ function isSyntheticTrackedChangeCommentLaneItem(item) {
|
|
|
1087
1093
|
return typeof itemId === "string" && itemId.startsWith(TRACKED_CHANGE_COMMENT_LANE_ID_PREFIX);
|
|
1088
1094
|
}
|
|
1089
1095
|
//#endregion
|
|
1090
|
-
//#region src/
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1096
|
+
//#region src/core/collaboration/permissions.ts
|
|
1097
|
+
var PERMISSIONS = Object.freeze({
|
|
1098
|
+
RESOLVE_OWN: "RESOLVE_OWN",
|
|
1099
|
+
RESOLVE_OTHER: "RESOLVE_OTHER",
|
|
1100
|
+
REJECT_OWN: "REJECT_OWN",
|
|
1101
|
+
REJECT_OTHER: "REJECT_OTHER",
|
|
1102
|
+
COMMENTS_OVERFLOW_OWN: "COMMENTS_OVERFLOW",
|
|
1103
|
+
COMMENTS_OVERFLOW_OTHER: "COMMENTS_OVERFLOW_OTHER",
|
|
1104
|
+
COMMENTS_DELETE_OWN: "COMMENTS_DELETE_OWN",
|
|
1105
|
+
COMMENTS_DELETE_OTHER: "COMMENTS_DELETE_OTHER",
|
|
1106
|
+
UPLOAD_VERSION: "UPLOAD_VERSION",
|
|
1107
|
+
VERSION_HISTORY: "VERSION_HISTORY"
|
|
1108
|
+
});
|
|
1109
|
+
var ROLES = Object.freeze({
|
|
1110
|
+
EDITOR: "editor",
|
|
1111
|
+
SUGGESTER: "suggester",
|
|
1112
|
+
VIEWER: "viewer"
|
|
1113
|
+
});
|
|
1114
|
+
var PERMISSION_MATRIX = Object.freeze({
|
|
1115
|
+
[PERMISSIONS.RESOLVE_OWN]: {
|
|
1116
|
+
internal: [ROLES.EDITOR],
|
|
1117
|
+
external: [ROLES.EDITOR]
|
|
1118
|
+
},
|
|
1119
|
+
[PERMISSIONS.RESOLVE_OTHER]: {
|
|
1120
|
+
internal: [ROLES.EDITOR],
|
|
1121
|
+
external: [ROLES.EDITOR]
|
|
1122
|
+
},
|
|
1123
|
+
[PERMISSIONS.REJECT_OWN]: {
|
|
1124
|
+
internal: [ROLES.EDITOR, ROLES.SUGGESTER],
|
|
1125
|
+
external: [ROLES.EDITOR, ROLES.SUGGESTER]
|
|
1126
|
+
},
|
|
1127
|
+
[PERMISSIONS.REJECT_OTHER]: {
|
|
1128
|
+
internal: [ROLES.EDITOR],
|
|
1129
|
+
external: [ROLES.EDITOR]
|
|
1130
|
+
},
|
|
1131
|
+
[PERMISSIONS.COMMENTS_OVERFLOW_OWN]: {
|
|
1132
|
+
internal: [ROLES.EDITOR, ROLES.SUGGESTER],
|
|
1133
|
+
external: [ROLES.EDITOR, ROLES.SUGGESTER]
|
|
1134
|
+
},
|
|
1135
|
+
[PERMISSIONS.COMMENTS_OVERFLOW_OTHER]: {
|
|
1136
|
+
internal: [ROLES.EDITOR],
|
|
1137
|
+
external: [ROLES.EDITOR]
|
|
1138
|
+
},
|
|
1139
|
+
[PERMISSIONS.COMMENTS_DELETE_OWN]: {
|
|
1140
|
+
internal: [ROLES.EDITOR, ROLES.SUGGESTER],
|
|
1141
|
+
external: [ROLES.EDITOR, ROLES.SUGGESTER]
|
|
1142
|
+
},
|
|
1143
|
+
[PERMISSIONS.COMMENTS_DELETE_OTHER]: {
|
|
1144
|
+
internal: [ROLES.EDITOR],
|
|
1145
|
+
external: [ROLES.EDITOR]
|
|
1146
|
+
},
|
|
1147
|
+
[PERMISSIONS.UPLOAD_VERSION]: {
|
|
1148
|
+
internal: [ROLES.EDITOR],
|
|
1149
|
+
external: []
|
|
1150
|
+
},
|
|
1151
|
+
[PERMISSIONS.VERSION_HISTORY]: {
|
|
1152
|
+
internal: [ROLES.EDITOR],
|
|
1153
|
+
external: []
|
|
1154
|
+
}
|
|
1155
|
+
});
|
|
1156
|
+
var pickResolver = (context = {}) => {
|
|
1157
|
+
if (typeof context.permissionResolver === "function") return context.permissionResolver;
|
|
1158
|
+
if (typeof context.superdoc?.config?.permissionResolver === "function") return context.superdoc.config.permissionResolver;
|
|
1159
|
+
const comments = context.superdoc?.config?.modules?.comments;
|
|
1160
|
+
const deprecatedResolver = comments ? comments.permissionResolver : void 0;
|
|
1161
|
+
if (typeof deprecatedResolver === "function") return deprecatedResolver;
|
|
1162
|
+
return null;
|
|
1163
|
+
};
|
|
1164
|
+
var BUILT_IN_PERMISSION_METHOD = Symbol.for("superdoc.internal.permission-method.builtin");
|
|
1165
|
+
var BUILT_IN_PERMISSION_RESOLVER = Symbol.for("superdoc.internal.permission-resolver.builtin");
|
|
1166
|
+
var hasBuiltInPermissionMethodBrand = (method) => (typeof method === "object" && method !== null || typeof method === "function") && Reflect.get(method, BUILT_IN_PERMISSION_METHOD) === true;
|
|
1167
|
+
var createTrackedChangePermissionResolver = (superdoc) => {
|
|
1168
|
+
const isBuiltInPolicy = () => hasBuiltInPermissionMethodBrand(superdoc.canPerformPermission) && pickResolver({ superdoc }) === null;
|
|
1169
|
+
const resolver = (payload = {}) => isBuiltInPolicy() ? defaultDecisionFor(payload.permission, superdoc.config.role, superdoc.config.isInternal) : superdoc.canPerformPermission({
|
|
1170
|
+
...payload,
|
|
1171
|
+
role: superdoc.config.role,
|
|
1172
|
+
isInternal: superdoc.config.isInternal
|
|
1173
|
+
});
|
|
1174
|
+
Object.defineProperty(resolver, BUILT_IN_PERMISSION_RESOLVER, { value: isBuiltInPolicy });
|
|
1175
|
+
return resolver;
|
|
1176
|
+
};
|
|
1177
|
+
var defaultDecisionFor = (permission, role, isInternal) => {
|
|
1178
|
+
if (permission === void 0 || typeof role !== "string") return false;
|
|
1179
|
+
const internalExternal = isInternal ? "internal" : "external";
|
|
1180
|
+
return PERMISSION_MATRIX[permission]?.[internalExternal]?.includes(role) ?? false;
|
|
1181
|
+
};
|
|
1182
|
+
var NON_DATA_PERMISSION_PROPERTY = Symbol();
|
|
1183
|
+
var readPermissionDataProperty = (source, key) => {
|
|
1184
|
+
if (source == null) return void 0;
|
|
1185
|
+
if (typeof source !== "object" && typeof source !== "function") return NON_DATA_PERMISSION_PROPERTY;
|
|
1186
|
+
for (let owner = source; owner !== null; owner = Object.getPrototypeOf(owner)) {
|
|
1187
|
+
const descriptor = Object.getOwnPropertyDescriptor(owner, key);
|
|
1188
|
+
if (descriptor) return "value" in descriptor ? descriptor.value : NON_DATA_PERMISSION_PROPERTY;
|
|
1189
|
+
}
|
|
1190
|
+
};
|
|
1191
|
+
var readBuiltInTrackedChangePermissionDecision = (superdoc, canPerform, permission, trackedChange) => {
|
|
1192
|
+
try {
|
|
1193
|
+
if (readPermissionDataProperty(superdoc, "canPerformPermission") !== canPerform || readPermissionDataProperty(canPerform, BUILT_IN_PERMISSION_METHOD) !== true) return null;
|
|
1194
|
+
const config = readPermissionDataProperty(superdoc, "config");
|
|
1195
|
+
if (!config || typeof config !== "object") return null;
|
|
1196
|
+
const role = readPermissionDataProperty(config, "role");
|
|
1197
|
+
const isInternal = readPermissionDataProperty(config, "isInternal");
|
|
1198
|
+
const user = readPermissionDataProperty(config, "user");
|
|
1199
|
+
const resolver = readPermissionDataProperty(config, "permissionResolver");
|
|
1200
|
+
const modules = readPermissionDataProperty(config, "modules");
|
|
1201
|
+
const comments = readPermissionDataProperty(modules, "comments");
|
|
1202
|
+
const deprecatedResolver = readPermissionDataProperty(comments, "permissionResolver");
|
|
1203
|
+
const commentsStore = readPermissionDataProperty(superdoc, "commentsStore");
|
|
1204
|
+
if ([
|
|
1205
|
+
role,
|
|
1206
|
+
isInternal,
|
|
1207
|
+
user,
|
|
1208
|
+
resolver,
|
|
1209
|
+
modules,
|
|
1210
|
+
comments,
|
|
1211
|
+
deprecatedResolver,
|
|
1212
|
+
commentsStore,
|
|
1213
|
+
readPermissionDataProperty(commentsStore, "getComment"),
|
|
1214
|
+
readPermissionDataProperty(trackedChange, "comment"),
|
|
1215
|
+
readPermissionDataProperty(trackedChange, "commentId"),
|
|
1216
|
+
readPermissionDataProperty(trackedChange, "id")
|
|
1217
|
+
].includes(NON_DATA_PERMISSION_PROPERTY) || typeof resolver === "function" || typeof deprecatedResolver === "function") return null;
|
|
1218
|
+
return defaultDecisionFor(permission, role, isInternal);
|
|
1219
|
+
} catch {
|
|
1220
|
+
return null;
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1223
|
+
var isAllowed = (permission, role, isInternal, context = {}) => {
|
|
1224
|
+
const defaultDecision = defaultDecisionFor(permission, role, isInternal);
|
|
1225
|
+
const resolver = pickResolver(context);
|
|
1226
|
+
if (typeof resolver !== "function") return defaultDecision;
|
|
1227
|
+
const decision = resolver({
|
|
1228
|
+
permission,
|
|
1229
|
+
role,
|
|
1230
|
+
isInternal,
|
|
1231
|
+
defaultDecision,
|
|
1232
|
+
comment: context.comment ?? null,
|
|
1233
|
+
currentUser: context.currentUser ?? context.superdoc?.config?.user ?? null,
|
|
1234
|
+
superdoc: context.superdoc ?? null,
|
|
1235
|
+
trackedChange: context.trackedChange ?? null
|
|
1236
|
+
});
|
|
1237
|
+
return typeof decision === "boolean" ? decision : defaultDecision;
|
|
1238
|
+
};
|
|
1098
1239
|
//#endregion
|
|
1099
1240
|
//#region src/public/ui/viewport-batch.ts
|
|
1100
1241
|
/** No rendering or scrolling: read only geometry already acknowledged by the host. */
|
|
@@ -1866,13 +2007,9 @@ var WatermarkSurface_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
1866
2007
|
//#region src/components/surfaces/WatermarkSurface.vue
|
|
1867
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"]]);
|
|
1868
2009
|
//#endregion
|
|
1869
|
-
//#region src/components/surfaces/watermark-surface-runtime.
|
|
1870
|
-
/**
|
|
1871
|
-
* Keeps Vue rendering and post-dismissal announcements outside the public type graph.
|
|
1872
|
-
* @param {(() => HTMLElement | null) | undefined} getContainer
|
|
1873
|
-
*/
|
|
2010
|
+
//#region src/components/surfaces/watermark-surface-runtime.ts
|
|
2011
|
+
/** Keeps Vue rendering and post-dismissal announcements outside the public type graph. */
|
|
1874
2012
|
function createWatermarkSurfaceRuntime(getContainer) {
|
|
1875
|
-
/** @type {HTMLDivElement | null} */
|
|
1876
2013
|
let status = null;
|
|
1877
2014
|
let disposed = false;
|
|
1878
2015
|
return {
|
|
@@ -1883,7 +2020,6 @@ function createWatermarkSurfaceRuntime(getContainer) {
|
|
|
1883
2020
|
const item = opener?.closest("[data-sd-part=\"toolbar-item\"]") ?? opener?.querySelector("[data-sd-part=\"toolbar-item\"]");
|
|
1884
2021
|
const container = (item?.closest("[data-sd-part=\"toolbar\"]"))?.parentElement;
|
|
1885
2022
|
const isWatermarkEntry = item?.querySelector("[data-item=\"btn-watermark\"], [data-item=\"btn-overflow\"]");
|
|
1886
|
-
/** @param {() => boolean} isCurrent */
|
|
1887
2023
|
return async (isCurrent) => {
|
|
1888
2024
|
await require__plugin_vue_export_helper.nextTick();
|
|
1889
2025
|
if (disposed || !isCurrent() || !isWatermarkEntry || opener?.isConnected || !container?.isConnected) return;
|
|
@@ -1915,7 +2051,6 @@ function createWatermarkSurfaceRuntime(getContainer) {
|
|
|
1915
2051
|
});
|
|
1916
2052
|
container.appendChild(status);
|
|
1917
2053
|
},
|
|
1918
|
-
/** @param {string} message */
|
|
1919
2054
|
announce(message) {
|
|
1920
2055
|
if (!disposed && status) status.textContent = message;
|
|
1921
2056
|
},
|
|
@@ -2496,7 +2631,7 @@ function toStyleValue(key, value) {
|
|
|
2496
2631
|
case "italic": return value === true;
|
|
2497
2632
|
case "underline": return underlineValue(value);
|
|
2498
2633
|
case "color": return typeof value === "string" && value.length > 0 ? { val: value.replace(/^#/, "") } : null;
|
|
2499
|
-
case "fontSize": return
|
|
2634
|
+
case "fontSize": return require_is_finite_number.isFiniteNumber(value) ? Math.round(value * 2) : null;
|
|
2500
2635
|
case "rFonts": return fontsValue(value);
|
|
2501
2636
|
default: return null;
|
|
2502
2637
|
}
|
|
@@ -2531,34 +2666,33 @@ function fontsValue(value) {
|
|
|
2531
2666
|
return Object.keys(result).length > 0 ? result : null;
|
|
2532
2667
|
}
|
|
2533
2668
|
//#endregion
|
|
2534
|
-
//#region src/public/ui/format-painter-helpers.
|
|
2669
|
+
//#region src/public/ui/format-painter-helpers.ts
|
|
2535
2670
|
/**
|
|
2536
2671
|
* Maps SDRunProps field names to InlineRunPatch field names.
|
|
2537
2672
|
* SDRunProps (read-side) and InlineRunPatch (write-side) use different keys
|
|
2538
2673
|
* for the same properties; direct assignment between them is forbidden.
|
|
2539
|
-
*
|
|
2540
|
-
* @param {Record<string, unknown>} props - SDRunProps object from doc.getNodeById
|
|
2541
|
-
* @returns {Record<string, unknown>} InlineRunPatch ready for doc.format.apply
|
|
2542
2674
|
*/
|
|
2543
2675
|
function sdRunPropsToInlineRunPatch(props) {
|
|
2544
2676
|
if (!props || typeof props !== "object") return {};
|
|
2545
2677
|
const patch = {};
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
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
|
|
2556
2689
|
};
|
|
2557
2690
|
if (props.fontFamily != null) patch.fontFamily = props.fontFamily;
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2691
|
+
const lang = props.lang;
|
|
2692
|
+
if (isPlainObject(lang)) patch.lang = {
|
|
2693
|
+
val: lang.val,
|
|
2694
|
+
eastAsia: lang.eastAsia,
|
|
2695
|
+
bidi: lang.bidi
|
|
2562
2696
|
};
|
|
2563
2697
|
if (props.fontSize != null) patch.fontSize = props.fontSize;
|
|
2564
2698
|
if (props.fontSizeCs != null) patch.fontSizeCs = props.fontSizeCs;
|
|
@@ -2599,19 +2733,24 @@ function sdRunPropsToInlineRunPatch(props) {
|
|
|
2599
2733
|
function projectColorRefToInlineColor(color) {
|
|
2600
2734
|
if (!color) return void 0;
|
|
2601
2735
|
if (typeof color === "string") return color;
|
|
2736
|
+
if (!isPlainObject(color)) return void 0;
|
|
2602
2737
|
if (color.model === "rgb") return color.value;
|
|
2603
2738
|
if (color.model === "auto") return "auto";
|
|
2604
2739
|
}
|
|
2605
2740
|
function projectUnderlineToInlinePatch(underline) {
|
|
2606
2741
|
if (underline == null) return void 0;
|
|
2742
|
+
if (!isPlainObject(underline)) return true;
|
|
2607
2743
|
const patch = {};
|
|
2608
2744
|
if (underline.style != null) patch.style = underline.style;
|
|
2609
|
-
|
|
2610
|
-
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
|
+
}
|
|
2611
2750
|
return Object.keys(patch).length > 0 ? patch : true;
|
|
2612
2751
|
}
|
|
2613
2752
|
function projectShadingToInlinePatch(shading) {
|
|
2614
|
-
if (!shading) return void 0;
|
|
2753
|
+
if (!isPlainObject(shading)) return void 0;
|
|
2615
2754
|
const patch = {};
|
|
2616
2755
|
const fill = projectColorRefToInlineColor(shading.fill);
|
|
2617
2756
|
if (fill != null) patch.fill = fill;
|
|
@@ -2621,7 +2760,7 @@ function projectShadingToInlinePatch(shading) {
|
|
|
2621
2760
|
return Object.keys(patch).length > 0 ? patch : void 0;
|
|
2622
2761
|
}
|
|
2623
2762
|
function projectBorderToInlinePatch(border) {
|
|
2624
|
-
if (!border) return void 0;
|
|
2763
|
+
if (!isPlainObject(border)) return void 0;
|
|
2625
2764
|
const patch = {};
|
|
2626
2765
|
if (border.style != null) patch.val = border.style;
|
|
2627
2766
|
if (border.width != null) patch.sz = border.width;
|
|
@@ -2636,9 +2775,6 @@ function projectBorderToInlinePatch(border) {
|
|
|
2636
2775
|
*
|
|
2637
2776
|
* Falls back to the plain text target when the host has not populated an
|
|
2638
2777
|
* explicit `selectionTarget` yet.
|
|
2639
|
-
*
|
|
2640
|
-
* @param {{ selectionTarget?: unknown; target?: unknown } | null | undefined} selection
|
|
2641
|
-
* @returns {string}
|
|
2642
2778
|
*/
|
|
2643
2779
|
function selectionKey(selection) {
|
|
2644
2780
|
const target = selection?.selectionTarget ?? selection?.target;
|
|
@@ -2747,7 +2883,7 @@ function readAllResolvedFact(event, receipt) {
|
|
|
2747
2883
|
return fact;
|
|
2748
2884
|
}
|
|
2749
2885
|
//#endregion
|
|
2750
|
-
//#region src/helpers/v2-typing-mutation-event.
|
|
2886
|
+
//#region src/helpers/v2-typing-mutation-event.ts
|
|
2751
2887
|
/**
|
|
2752
2888
|
* Command kinds whose committed mutations belong to the sustained typing
|
|
2753
2889
|
* cadence class (insert / replace / plain paste / Backspace / Delete).
|
|
@@ -2788,9 +2924,6 @@ var V2_TYPING_COMMAND_KINDS = /* @__PURE__ */ new Set([
|
|
|
2788
2924
|
* Events without a forwarded `editableCommandKind` (programmatic Document API
|
|
2789
2925
|
* mutations, history commits, unclassified structural commands) return false
|
|
2790
2926
|
* so they keep hydrating immediately.
|
|
2791
|
-
*
|
|
2792
|
-
* @param {{ type?: string, origin?: string, editableCommandKind?: string } | null | undefined} event
|
|
2793
|
-
* @returns {boolean}
|
|
2794
2927
|
*/
|
|
2795
2928
|
var isV2EditableTextMutationEvent = (event) => {
|
|
2796
2929
|
if (event?.type !== "mutation:committed" || event.origin !== "command") return false;
|
|
@@ -2988,7 +3121,7 @@ function normalizeZoomPayload(payload) {
|
|
|
2988
3121
|
if (!Number.isFinite(parsed)) return payload;
|
|
2989
3122
|
return normalizeNumber(parsed, isPercent);
|
|
2990
3123
|
}
|
|
2991
|
-
if (
|
|
3124
|
+
if (require_is_finite_number.isFiniteNumber(payload)) return normalizeNumber(payload, false);
|
|
2992
3125
|
return payload;
|
|
2993
3126
|
}
|
|
2994
3127
|
/**
|
|
@@ -5358,9 +5491,6 @@ var PARAGRAPH_INDENT_STEP_TWIPS = 720;
|
|
|
5358
5491
|
function pointsToTwips(value) {
|
|
5359
5492
|
return Math.round(value * 20);
|
|
5360
5493
|
}
|
|
5361
|
-
function isFiniteNumber(value) {
|
|
5362
|
-
return typeof value === "number" && Number.isFinite(value);
|
|
5363
|
-
}
|
|
5364
5494
|
function readParagraphIndentationFromResult(result) {
|
|
5365
5495
|
if (!result || typeof result !== "object") return null;
|
|
5366
5496
|
const node = result.node;
|
|
@@ -5371,10 +5501,10 @@ function readParagraphIndentationFromResult(result) {
|
|
|
5371
5501
|
const props = paragraphPayload.props;
|
|
5372
5502
|
const indent = resolved?.indent ?? props?.indent;
|
|
5373
5503
|
if (!indent || typeof indent !== "object") return null;
|
|
5374
|
-
const left = isFiniteNumber(indent.left) ? pointsToTwips(indent.left) : isFiniteNumber(indent.start) ? pointsToTwips(indent.start) : void 0;
|
|
5375
|
-
const right = isFiniteNumber(indent.right) ? pointsToTwips(indent.right) : isFiniteNumber(indent.end) ? pointsToTwips(indent.end) : void 0;
|
|
5376
|
-
const firstLine = isFiniteNumber(indent.firstLine) ? pointsToTwips(indent.firstLine) : void 0;
|
|
5377
|
-
const hanging = isFiniteNumber(indent.hanging) ? pointsToTwips(indent.hanging) : void 0;
|
|
5504
|
+
const left = require_is_finite_number.isFiniteNumber(indent.left) ? pointsToTwips(indent.left) : require_is_finite_number.isFiniteNumber(indent.start) ? pointsToTwips(indent.start) : void 0;
|
|
5505
|
+
const right = require_is_finite_number.isFiniteNumber(indent.right) ? pointsToTwips(indent.right) : require_is_finite_number.isFiniteNumber(indent.end) ? pointsToTwips(indent.end) : void 0;
|
|
5506
|
+
const firstLine = require_is_finite_number.isFiniteNumber(indent.firstLine) ? pointsToTwips(indent.firstLine) : void 0;
|
|
5507
|
+
const hanging = require_is_finite_number.isFiniteNumber(indent.hanging) ? pointsToTwips(indent.hanging) : void 0;
|
|
5378
5508
|
if (left == null && right == null && firstLine == null && hanging == null) return null;
|
|
5379
5509
|
return {
|
|
5380
5510
|
...left != null ? { left } : {},
|
|
@@ -5664,7 +5794,7 @@ function normalizeLayoutFontFamily(value) {
|
|
|
5664
5794
|
}
|
|
5665
5795
|
/** Convert a resolved run font size in CSS px to the toolbar's point value (SD-3652). */
|
|
5666
5796
|
function normalizeLayoutFontSizePt(value) {
|
|
5667
|
-
if (
|
|
5797
|
+
if (!require_is_finite_number.isFiniteNumber(value) || value <= 0) return void 0;
|
|
5668
5798
|
const pt = Math.round(value * .75 * 2) / 2;
|
|
5669
5799
|
if (pt <= 0) return void 0;
|
|
5670
5800
|
return String(pt);
|
|
@@ -6402,7 +6532,7 @@ function createSuperDocUI(options) {
|
|
|
6402
6532
|
if (!pending || !(method in pending)) return void 0;
|
|
6403
6533
|
const value = pending[method];
|
|
6404
6534
|
if (typeof value === "string" && value !== "") return value;
|
|
6405
|
-
if (
|
|
6535
|
+
if (require_is_finite_number.isFiniteNumber(value)) return String(value);
|
|
6406
6536
|
};
|
|
6407
6537
|
/** Record / clear the stored inline mark for a collapsed-caret pick (SD-3654/SD-3652). */
|
|
6408
6538
|
const setPendingInlineFormatOnHost = (method, value) => {
|
|
@@ -8800,9 +8930,10 @@ function createSuperDocUI(options) {
|
|
|
8800
8930
|
for (const candidate of permissions) {
|
|
8801
8931
|
let allowed;
|
|
8802
8932
|
try {
|
|
8803
|
-
|
|
8933
|
+
const permissionChange = trackedChange ?? { id };
|
|
8934
|
+
allowed = readBuiltInTrackedChangePermissionDecision(superdoc, canPerform, candidate, permissionChange) ?? canPerform.call(superdoc, {
|
|
8804
8935
|
permission: candidate,
|
|
8805
|
-
trackedChange:
|
|
8936
|
+
trackedChange: permissionChange,
|
|
8806
8937
|
comment: null
|
|
8807
8938
|
});
|
|
8808
8939
|
} catch {
|
|
@@ -9695,7 +9826,7 @@ function createSuperDocUI(options) {
|
|
|
9695
9826
|
};
|
|
9696
9827
|
/** Validate normalized payloads before invoking public SuperDoc-instance methods. */
|
|
9697
9828
|
const instanceCommandPayloadIsValid = (descriptor, payload) => {
|
|
9698
|
-
if (descriptor.id === "zoom") return
|
|
9829
|
+
if (descriptor.id === "zoom") return require_is_finite_number.isFiniteNumber(payload) && payload > 0;
|
|
9699
9830
|
if (descriptor.id === "document-mode") return payload === "editing" || payload === "suggesting" || payload === "viewing";
|
|
9700
9831
|
if (descriptor.id === "measurement-unit") return payload === "in" || payload === "cm";
|
|
9701
9832
|
return true;
|
|
@@ -10083,7 +10214,7 @@ function createSuperDocUI(options) {
|
|
|
10083
10214
|
const familyValue = state.toolbar.commands["font-family"]?.value;
|
|
10084
10215
|
const sizeValue = state.toolbar.commands["font-size"]?.value;
|
|
10085
10216
|
const hadFamily = typeof familyValue === "string" && familyValue.length > 0;
|
|
10086
|
-
const hadSize = typeof sizeValue === "string" && sizeValue.length > 0 ||
|
|
10217
|
+
const hadSize = typeof sizeValue === "string" && sizeValue.length > 0 || require_is_finite_number.isFiniteNumber(sizeValue);
|
|
10087
10218
|
return hadFamily && projected.fontFamily === void 0 || hadSize && projected.fontSize === void 0;
|
|
10088
10219
|
};
|
|
10089
10220
|
const syncHostSelectionSubscription = () => {
|
|
@@ -12277,12 +12408,6 @@ function createSuperDocUI(options) {
|
|
|
12277
12408
|
keys: [...EFFECTIVE_INLINE_UNIFORMITY_KEYS, "highlight"],
|
|
12278
12409
|
includeCaret: true
|
|
12279
12410
|
} : null);
|
|
12280
|
-
if (effective?.fontFamily?.state === "mixed") {
|
|
12281
|
-
delete inlinePatch.fontFamily;
|
|
12282
|
-
delete inlinePatch.rFonts;
|
|
12283
|
-
mixedInlineKeys.add("fontFamily");
|
|
12284
|
-
mixedInlineKeys.add("rFonts");
|
|
12285
|
-
}
|
|
12286
12411
|
for (const [markName, patchKey] of Object.entries(MARK_TO_PATCH)) {
|
|
12287
12412
|
const entry = effective?.[markName];
|
|
12288
12413
|
if (!entry) continue;
|
|
@@ -12294,6 +12419,16 @@ function createSuperDocUI(options) {
|
|
|
12294
12419
|
mixedInlineKeys.add(patchKey);
|
|
12295
12420
|
}
|
|
12296
12421
|
}
|
|
12422
|
+
const fontFamily = effective?.fontFamily;
|
|
12423
|
+
if (fontFamily?.state === "uniform" && typeof fontFamily.value === "string") {
|
|
12424
|
+
inlinePatch.fontFamily = fontFamily.value;
|
|
12425
|
+
mixedInlineKeys.delete("fontFamily");
|
|
12426
|
+
} else if (fontFamily) {
|
|
12427
|
+
delete inlinePatch.fontFamily;
|
|
12428
|
+
delete inlinePatch.rFonts;
|
|
12429
|
+
mixedInlineKeys.add("fontFamily");
|
|
12430
|
+
mixedInlineKeys.add("rFonts");
|
|
12431
|
+
}
|
|
12297
12432
|
const highlight = effective?.highlight;
|
|
12298
12433
|
if (highlight?.state === "uniform") {
|
|
12299
12434
|
inlinePatch.highlight = highlight.value;
|
|
@@ -13915,7 +14050,7 @@ function createSuperDocUI(options) {
|
|
|
13915
14050
|
return null;
|
|
13916
14051
|
};
|
|
13917
14052
|
const pointHitElements = (x, y) => {
|
|
13918
|
-
if (
|
|
14053
|
+
if (!require_is_finite_number.isFiniteNumber(x) || !require_is_finite_number.isFiniteNumber(y)) return null;
|
|
13919
14054
|
const dom = globalThis.document;
|
|
13920
14055
|
if (!dom || typeof dom.elementFromPoint !== "function") return null;
|
|
13921
14056
|
const container = resolveVisibleHost();
|
|
@@ -14693,7 +14828,7 @@ function createSuperDocUI(options) {
|
|
|
14693
14828
|
const record = result && typeof result === "object" ? result : null;
|
|
14694
14829
|
if (!record) return null;
|
|
14695
14830
|
const matches = Array.isArray(record.matches) ? record.matches : [];
|
|
14696
|
-
const total =
|
|
14831
|
+
const total = require_is_finite_number.isFiniteNumber(record.total) ? record.total : matches.length;
|
|
14697
14832
|
const activeIndex = typeof record.activeMatchIndex === "number" ? record.activeMatchIndex : typeof record.activeIndex === "number" ? record.activeIndex : -1;
|
|
14698
14833
|
const canReplace = record.canReplace === true || fallbackCanReplace;
|
|
14699
14834
|
return {
|
|
@@ -15723,12 +15858,24 @@ Object.defineProperty(exports, "BUILT_IN_COMMAND_IDS", {
|
|
|
15723
15858
|
return BUILT_IN_COMMAND_IDS;
|
|
15724
15859
|
}
|
|
15725
15860
|
});
|
|
15861
|
+
Object.defineProperty(exports, "BUILT_IN_PERMISSION_METHOD", {
|
|
15862
|
+
enumerable: true,
|
|
15863
|
+
get: function() {
|
|
15864
|
+
return BUILT_IN_PERMISSION_METHOD;
|
|
15865
|
+
}
|
|
15866
|
+
});
|
|
15726
15867
|
Object.defineProperty(exports, "DOM_CLASS_NAMES", {
|
|
15727
15868
|
enumerable: true,
|
|
15728
15869
|
get: function() {
|
|
15729
15870
|
return DOM_CLASS_NAMES;
|
|
15730
15871
|
}
|
|
15731
15872
|
});
|
|
15873
|
+
Object.defineProperty(exports, "PERMISSIONS", {
|
|
15874
|
+
enumerable: true,
|
|
15875
|
+
get: function() {
|
|
15876
|
+
return PERMISSIONS;
|
|
15877
|
+
}
|
|
15878
|
+
});
|
|
15732
15879
|
Object.defineProperty(exports, "applyV2CommentInvalidationFromMutation", {
|
|
15733
15880
|
enumerable: true,
|
|
15734
15881
|
get: function() {
|
|
@@ -15759,6 +15906,12 @@ Object.defineProperty(exports, "createSuperDocUI", {
|
|
|
15759
15906
|
return createSuperDocUI;
|
|
15760
15907
|
}
|
|
15761
15908
|
});
|
|
15909
|
+
Object.defineProperty(exports, "createTrackedChangePermissionResolver", {
|
|
15910
|
+
enumerable: true,
|
|
15911
|
+
get: function() {
|
|
15912
|
+
return createTrackedChangePermissionResolver;
|
|
15913
|
+
}
|
|
15914
|
+
});
|
|
15762
15915
|
Object.defineProperty(exports, "executeFirstPartyCommandAsync", {
|
|
15763
15916
|
enumerable: true,
|
|
15764
15917
|
get: function() {
|
|
@@ -15789,6 +15942,12 @@ Object.defineProperty(exports, "getWorkflowRecording", {
|
|
|
15789
15942
|
return getWorkflowRecording;
|
|
15790
15943
|
}
|
|
15791
15944
|
});
|
|
15945
|
+
Object.defineProperty(exports, "isAllowed", {
|
|
15946
|
+
enumerable: true,
|
|
15947
|
+
get: function() {
|
|
15948
|
+
return isAllowed;
|
|
15949
|
+
}
|
|
15950
|
+
});
|
|
15792
15951
|
Object.defineProperty(exports, "isPlainObject", {
|
|
15793
15952
|
enumerable: true,
|
|
15794
15953
|
get: function() {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/helpers/is-finite-number.ts
|
|
2
|
+
function isFiniteNumber(value) {
|
|
3
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
4
|
+
}
|
|
5
|
+
//#endregion
|
|
6
|
+
Object.defineProperty(exports, "isFiniteNumber", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return isFiniteNumber;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
@@ -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.
|
|
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.
|
|
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 } from '../write/write.js';
|
|
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
|
-
};
|
|
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;
|