superdoc 2.23.1-next.9 → 2.24.0-next.2
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/{create-super-doc-ui-DFNXiKvQ.es.js → create-super-doc-ui-BOrgnNVV.es.js} +72 -16
- package/dist/chunks/{create-super-doc-ui-D_FbXpOQ.cjs → create-super-doc-ui-tJenv7pA.cjs} +72 -16
- package/dist/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/document-api/src/selection/selection.types.d.ts +29 -8
- 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 +59 -55
- package/dist/style.layered.css +59 -55
- package/dist/superdoc/src/composables/use-link-popover.d.ts +14 -0
- package/dist/superdoc/src/public/ui/types.d.ts +16 -0
- package/dist/superdoc/src/public/ui.d.cts +4 -0
- package/dist/superdoc/src/public/ui.d.ts +1 -1
- package/dist/superdoc.cjs +124 -83
- package/dist/superdoc.es.js +126 -85
- 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.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __toESM$2 } from "./chunks/rolldown-runtime-0pSA04fp.es.js";
|
|
2
2
|
import { t as blank_default } from "./chunks/blank-docx-DzQccOlW.es.js";
|
|
3
|
-
import { c as createImageFilePicker, d as DOM_CLASS_NAMES, f as closeInteractionHistory, g as recordInteraction, h as isWorkflowRecordingEnabled, i as registerFirstPartyCommandMutation, l as resolveImageSrc, m as getWorkflowRecording, n as executeFirstPartyCommandAsync, o as applyV2CommentInvalidationFromMutation, p as createInteractionHistory, r as readFirstPartyPageNumbers, s as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-
|
|
3
|
+
import { c as createImageFilePicker, d as DOM_CLASS_NAMES, f as closeInteractionHistory, g as recordInteraction, h as isWorkflowRecordingEnabled, i as registerFirstPartyCommandMutation, l as resolveImageSrc, m as getWorkflowRecording, n as executeFirstPartyCommandAsync, o as applyV2CommentInvalidationFromMutation, p as createInteractionHistory, r as readFirstPartyPageNumbers, s as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-BOrgnNVV.es.js";
|
|
4
4
|
import { t as import_eventemitter3 } from "./chunks/eventemitter3-DEIiXiH2.es.js";
|
|
5
5
|
import { t as v4 } from "./chunks/uuid-H0Xcmmhy.es.js";
|
|
6
6
|
import { $ as watch$1, A as onActivated, B as resolveDirective, C as isRef$1, D as normalizeClass, E as nextTick, F as openBlock, G as toRef, H as shallowRef$1, I as reactive, J as useAttrs, K as toRefs, L as ref, M as onDeactivated, N as onMounted, O as normalizeProps, P as onScopeDispose$1, Q as vModelText, R as renderList, S as isReactive$1, T as mergeProps, U as toDisplayString, V as resolveDynamicComponent, W as toRaw$2, X as vModelCheckbox, Y as useSlots, Z as vModelSelect, _ as getCurrentInstance, a as computed$1, b as hasInjectionContext, c as createCommentVNode, d as createStaticVNode, et as withCtx, f as createTextVNode, g as effectScope, h as defineComponent, i as Transition, j as onBeforeUnmount, k as normalizeStyle, l as createElementBlock, m as defineAsyncComponent, n as Fragment, nt as withKeys, o as createApp, p as createVNode, q as unref, r as Teleport, rt as withModifiers, s as createBlock, t as _plugin_vue_export_helper_default, tt as withDirectives, u as createElementVNode, v as getCurrentScope, w as markRaw, x as inject$1, y as h, z as renderSlot } from "./chunks/_plugin-vue_export-helper-DHiJKCsy.es.js";
|
|
@@ -302,7 +302,7 @@ var awarenessStatesToArray = (context, states) => {
|
|
|
302
302
|
var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
|
|
303
303
|
function getSuperdocVersion() {
|
|
304
304
|
try {
|
|
305
|
-
return "2.
|
|
305
|
+
return "2.24.0-next.2";
|
|
306
306
|
} catch {
|
|
307
307
|
return "unknown";
|
|
308
308
|
}
|
|
@@ -13312,7 +13312,7 @@ var _hoisted_15$2 = {
|
|
|
13312
13312
|
};
|
|
13313
13313
|
var _hoisted_16$2 = { class: "change-type" };
|
|
13314
13314
|
var _hoisted_17$2 = { key: 1 };
|
|
13315
|
-
var _hoisted_18$
|
|
13315
|
+
var _hoisted_18$2 = { class: "tracked-change-text is-inserted" };
|
|
13316
13316
|
var _hoisted_19$1 = { key: 2 };
|
|
13317
13317
|
var _hoisted_20$1 = { class: "tracked-change-text is-inserted" };
|
|
13318
13318
|
var _hoisted_21$1 = { key: 3 };
|
|
@@ -14385,7 +14385,7 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
14385
14385
|
line.excerpt ? (openBlock(), createElementBlock("span", _hoisted_15$2, " — ")) : createCommentVNode("", true),
|
|
14386
14386
|
createElementVNode("span", _hoisted_16$2, toDisplayString(line.label), 1)
|
|
14387
14387
|
]);
|
|
14388
|
-
}), 128))])) : createCommentVNode("", true)])) : comment.trackedChangeDisplayType === "hyperlinkAdded" ? (openBlock(), createElementBlock("div", _hoisted_17$2, [_cache[2] || (_cache[2] = createElementVNode("span", { class: "change-type" }, "Added hyperlink ", -1)), createElementVNode("span", _hoisted_18$
|
|
14388
|
+
}), 128))])) : createCommentVNode("", true)])) : comment.trackedChangeDisplayType === "hyperlinkAdded" ? (openBlock(), createElementBlock("div", _hoisted_17$2, [_cache[2] || (_cache[2] = createElementVNode("span", { class: "change-type" }, "Added hyperlink ", -1)), createElementVNode("span", _hoisted_18$2, "\"" + toDisplayString(comment.trackedChangeText) + "\"", 1)])) : comment.trackedChangeDisplayType === "hyperlinkModified" ? (openBlock(), createElementBlock("div", _hoisted_19$1, [_cache[3] || (_cache[3] = createElementVNode("span", { class: "change-type" }, "Changed hyperlink to ", -1)), createElementVNode("span", _hoisted_20$1, "\"" + toDisplayString(comment.trackedChangeText) + "\"", 1)])) : comment.trackedChangeDisplayType === "paragraphSplit" ? (openBlock(), createElementBlock("div", _hoisted_21$1, [..._cache[4] || (_cache[4] = [createElementVNode("span", { class: "change-type" }, "Added new line", -1)])])) : comment.trackedChangeDisplayType === "tableInsert" ? (openBlock(), createElementBlock("div", _hoisted_22$1, [..._cache[5] || (_cache[5] = [createElementVNode("span", { class: "change-type" }, "Added table", -1)])])) : comment.trackedChangeDisplayType === "tableDelete" ? (openBlock(), createElementBlock("div", _hoisted_23$1, [..._cache[6] || (_cache[6] = [createElementVNode("span", { class: "change-type" }, "Deleted table", -1)])])) : comment.trackedChangeType === "trackFormat" ? (openBlock(), createElementBlock("div", _hoisted_24, [_cache[7] || (_cache[7] = createElementVNode("span", { class: "change-type" }, "Format: ", -1)), createElementVNode("span", _hoisted_25, toDisplayString(comment.trackedChangeText), 1)])) : comment.trackedChangeType === "both" ? (openBlock(), createElementBlock("div", _hoisted_26, [
|
|
14389
14389
|
_cache[8] || (_cache[8] = createElementVNode("span", { class: "change-type" }, "Replaced ", -1)),
|
|
14390
14390
|
createElementVNode("span", _hoisted_27, "\"" + toDisplayString(comment.deletedText) + "\"", 1),
|
|
14391
14391
|
_cache[9] || (_cache[9] = createElementVNode("span", { class: "change-type" }, " with ", -1)),
|
|
@@ -18985,6 +18985,11 @@ var _hoisted_17$1 = {
|
|
|
18985
18985
|
key: 5,
|
|
18986
18986
|
class: "input-row go-to-anchor clickable"
|
|
18987
18987
|
};
|
|
18988
|
+
var _hoisted_18$1 = {
|
|
18989
|
+
key: 6,
|
|
18990
|
+
role: "status",
|
|
18991
|
+
class: "sd-error"
|
|
18992
|
+
};
|
|
18988
18993
|
var LinkInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
18989
18994
|
__name: "LinkInput",
|
|
18990
18995
|
props: {
|
|
@@ -19182,61 +19187,71 @@ var LinkInput_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
19182
19187
|
hyperlinkTarget: props.hyperlinkTarget
|
|
19183
19188
|
});
|
|
19184
19189
|
};
|
|
19185
|
-
const
|
|
19186
|
-
|
|
19190
|
+
const navigationError = ref("");
|
|
19191
|
+
const navigateToAnchor = async (anchorUrl) => {
|
|
19192
|
+
navigationError.value = "";
|
|
19193
|
+
try {
|
|
19194
|
+
if (await props.goToAnchor?.(anchorUrl) === false) navigationError.value = "Reference target is unavailable";
|
|
19195
|
+
} catch {
|
|
19196
|
+
navigationError.value = "Reference target is unavailable";
|
|
19197
|
+
}
|
|
19187
19198
|
};
|
|
19188
19199
|
return (_ctx, _cache) => {
|
|
19189
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(["link-input-ctn", { "high-contrast": unref(isHighContrastMode) }]) }, [
|
|
19190
|
-
|
|
19191
|
-
|
|
19192
|
-
|
|
19193
|
-
placeholder: "Text",
|
|
19194
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => text.value = $event),
|
|
19195
|
-
readonly: isViewingMode.value,
|
|
19196
|
-
onKeydown: withKeys(withModifiers(handleSubmit, ["stop", "prevent"]), ["enter"])
|
|
19197
|
-
}, null, 40, _hoisted_7$3), [[vModelText, text.value]])]),
|
|
19198
|
-
createElementVNode("div", _hoisted_8$3, [
|
|
19199
|
-
createElementVNode("div", {
|
|
19200
|
-
class: "input-icon",
|
|
19201
|
-
innerHTML: unref(toolbarIcons).linkInput
|
|
19202
|
-
}, null, 8, _hoisted_9$2),
|
|
19203
|
-
withDirectives(createElementVNode("input", {
|
|
19200
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(["link-input-ctn", { "high-contrast": unref(isHighContrastMode) }]) }, [
|
|
19201
|
+
isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_1$19, "Page anchor")) : isViewingMode.value ? (openBlock(), createElementBlock("div", _hoisted_2$16, "Link details")) : isEditing.value ? (openBlock(), createElementBlock("div", _hoisted_3$13, "Edit link")) : (openBlock(), createElementBlock("div", _hoisted_4$8, "Add link")),
|
|
19202
|
+
__props.showInput && !isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_5$6, [
|
|
19203
|
+
createElementVNode("div", _hoisted_6$5, [_cache[5] || (_cache[5] = createElementVNode("div", { class: "input-icon text-input-icon" }, "T", -1)), withDirectives(createElementVNode("input", {
|
|
19204
19204
|
type: "text",
|
|
19205
|
-
name: "
|
|
19206
|
-
placeholder: "
|
|
19207
|
-
|
|
19208
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => rawUrl.value = $event),
|
|
19205
|
+
name: "text",
|
|
19206
|
+
placeholder: "Text",
|
|
19207
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => text.value = $event),
|
|
19209
19208
|
readonly: isViewingMode.value,
|
|
19210
|
-
|
|
19211
|
-
|
|
19212
|
-
|
|
19213
|
-
|
|
19214
|
-
|
|
19215
|
-
|
|
19216
|
-
|
|
19217
|
-
"
|
|
19218
|
-
|
|
19219
|
-
|
|
19220
|
-
|
|
19221
|
-
|
|
19222
|
-
|
|
19223
|
-
|
|
19224
|
-
|
|
19225
|
-
|
|
19226
|
-
|
|
19227
|
-
|
|
19228
|
-
|
|
19229
|
-
|
|
19230
|
-
|
|
19231
|
-
|
|
19232
|
-
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
|
|
19239
|
-
|
|
19209
|
+
onKeydown: withKeys(withModifiers(handleSubmit, ["stop", "prevent"]), ["enter"])
|
|
19210
|
+
}, null, 40, _hoisted_7$3), [[vModelText, text.value]])]),
|
|
19211
|
+
createElementVNode("div", _hoisted_8$3, [
|
|
19212
|
+
createElementVNode("div", {
|
|
19213
|
+
class: "input-icon",
|
|
19214
|
+
innerHTML: unref(toolbarIcons).linkInput
|
|
19215
|
+
}, null, 8, _hoisted_9$2),
|
|
19216
|
+
withDirectives(createElementVNode("input", {
|
|
19217
|
+
type: "text",
|
|
19218
|
+
name: "link",
|
|
19219
|
+
placeholder: "Type or paste a link",
|
|
19220
|
+
class: normalizeClass({ "sd-error": urlError.value }),
|
|
19221
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => rawUrl.value = $event),
|
|
19222
|
+
readonly: isViewingMode.value,
|
|
19223
|
+
onInput: _cache[2] || (_cache[2] = ($event) => commandError.value = ""),
|
|
19224
|
+
onKeydown: [withKeys(withModifiers(handleSubmit, ["stop", "prevent"]), ["enter"]), _cache[3] || (_cache[3] = ($event) => urlError.value = false)]
|
|
19225
|
+
}, null, 42, _hoisted_10$2), [[vModelText, rawUrl.value]]),
|
|
19226
|
+
createElementVNode("div", {
|
|
19227
|
+
class: normalizeClass(["open-link-icon", { "sd-disabled": !validUrl.value }]),
|
|
19228
|
+
innerHTML: unref(toolbarIcons).openLink,
|
|
19229
|
+
onClick: openLink,
|
|
19230
|
+
"data-item": "btn-link-open"
|
|
19231
|
+
}, null, 10, _hoisted_11$2)
|
|
19232
|
+
]),
|
|
19233
|
+
!isViewingMode.value ? (openBlock(), createElementBlock("div", _hoisted_12$1, [isEditing.value ? (openBlock(), createElementBlock("button", {
|
|
19234
|
+
key: 0,
|
|
19235
|
+
class: "remove-btn",
|
|
19236
|
+
onClick: handleRemove,
|
|
19237
|
+
disabled: isSubmitting.value,
|
|
19238
|
+
"data-item": "btn-link-remove"
|
|
19239
|
+
}, [createElementVNode("div", {
|
|
19240
|
+
class: "remove-btn__icon",
|
|
19241
|
+
innerHTML: unref(toolbarIcons).removeLink
|
|
19242
|
+
}, null, 8, _hoisted_14$1), _cache[6] || (_cache[6] = createTextVNode(" Remove ", -1))], 8, _hoisted_13$1)) : createCommentVNode("", true), createElementVNode("button", {
|
|
19243
|
+
class: normalizeClass(["sd-submit-btn", { "disable-btn": isDisabled.value }]),
|
|
19244
|
+
onClick: handleSubmit,
|
|
19245
|
+
disabled: isSubmitting.value,
|
|
19246
|
+
"data-item": "btn-link-apply"
|
|
19247
|
+
}, " Apply ", 10, _hoisted_15$1)])) : createCommentVNode("", true),
|
|
19248
|
+
commandError.value ? (openBlock(), createElementBlock("div", _hoisted_16$1, toDisplayString(commandError.value), 1)) : createCommentVNode("", true)
|
|
19249
|
+
])) : isAnchor.value ? (openBlock(), createElementBlock("div", _hoisted_17$1, [createElementVNode("a", { onClick: _cache[4] || (_cache[4] = withModifiers(($event) => navigateToAnchor(rawUrl.value), ["stop", "prevent"])) }, "Go to " + toDisplayString(rawUrl.value.startsWith("#_") ? rawUrl.value.substring(2) : rawUrl.value), 1)])) : createCommentVNode("", true),
|
|
19250
|
+
navigationError.value ? (openBlock(), createElementBlock("div", _hoisted_18$1, toDisplayString(navigationError.value), 1)) : createCommentVNode("", true)
|
|
19251
|
+
], 2);
|
|
19252
|
+
};
|
|
19253
|
+
}
|
|
19254
|
+
}, [["__scopeId", "data-v-360db842"]]);
|
|
19240
19255
|
//#endregion
|
|
19241
19256
|
//#region src/internal/toolbar/built-in/scroll-helpers.js
|
|
19242
19257
|
function getScrollableParent(element) {
|
|
@@ -19356,7 +19371,8 @@ function scrollToElement(targetElement, options = {
|
|
|
19356
19371
|
* which keeps anchor navigation scoped to body targets.
|
|
19357
19372
|
* @typedef {Object} BookmarkGetResult
|
|
19358
19373
|
* @property {{ story?: { kind?: string, storyType?: string } }} [address]
|
|
19359
|
-
* @property {{ from?: { blockId?: string } }} [range]
|
|
19374
|
+
* @property {{ from?: { blockId?: string, offset?: number } }} [range]
|
|
19375
|
+
* @property {{ colFirst: number, colLast: number }} [tableColumn]
|
|
19360
19376
|
*/
|
|
19361
19377
|
/**
|
|
19362
19378
|
* The narrow Document API subset this composable reads. The host facade
|
|
@@ -19369,7 +19385,7 @@ function scrollToElement(targetElement, options = {
|
|
|
19369
19385
|
* @property {{ list?: () => BlocksListResult | null | undefined } | null} [blocks]
|
|
19370
19386
|
* @property {{ match?: (query: { select: { type: 'text', pattern: string, caseSensitive: boolean }, require: 'any' }) => QueryMatchResult | null | undefined } | null} [query]
|
|
19371
19387
|
* @property {{ list?: () => HyperlinksListResult | Promise<HyperlinksListResult | null | undefined> | null | undefined, get?: (input: { storyId: string, hyperlinkNodeId: string }) => HyperlinkGetResult | Promise<HyperlinkGetResult | null | undefined> | null | undefined } | null} [hyperlinks]
|
|
19372
|
-
* @property {{ get?: (input: { target: { kind: 'entity', entityType: 'bookmark', name: string } }) => BookmarkGetResult | Promise<BookmarkGetResult | null | undefined> | null | undefined } | null} [bookmarks]
|
|
19388
|
+
* @property {{ list?: () => Promise<{ items: Array<{ name: string }> }> | { items: Array<{ name: string }> }, get?: (input: { target: { kind: 'entity', entityType: 'bookmark', name: string } }) => BookmarkGetResult | Promise<BookmarkGetResult | null | undefined> | null | undefined } | null} [bookmarks]
|
|
19373
19389
|
*/
|
|
19374
19390
|
/**
|
|
19375
19391
|
* The `v2-link-click` payload the shell relays from the v2 host's
|
|
@@ -19798,7 +19814,7 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
|
|
|
19798
19814
|
* editing/suggesting via `placeCaret`.
|
|
19799
19815
|
* @param {string} blockId
|
|
19800
19816
|
*/
|
|
19801
|
-
async function
|
|
19817
|
+
async function placeCaretAtBookmark(blockId, offset) {
|
|
19802
19818
|
const setSelectionTarget = getActiveEditor()?.authoring?.setSelectionTarget;
|
|
19803
19819
|
if (typeof setSelectionTarget !== "function") return;
|
|
19804
19820
|
const story = {
|
|
@@ -19808,7 +19824,7 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
|
|
|
19808
19824
|
const anchor = {
|
|
19809
19825
|
kind: "text",
|
|
19810
19826
|
blockId,
|
|
19811
|
-
offset
|
|
19827
|
+
offset,
|
|
19812
19828
|
story
|
|
19813
19829
|
};
|
|
19814
19830
|
const target = {
|
|
@@ -19832,22 +19848,29 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
|
|
|
19832
19848
|
* @param {{ placeCaret?: boolean }} [options]
|
|
19833
19849
|
*/
|
|
19834
19850
|
async function navigateToAnchor(anchorUrl, { placeCaret = false } = {}) {
|
|
19835
|
-
if (typeof anchorUrl !== "string" || !anchorUrl.startsWith("#")) return;
|
|
19851
|
+
if (typeof anchorUrl !== "string" || !anchorUrl.startsWith("#")) return false;
|
|
19836
19852
|
const anchorName = decodeAnchorFragment(anchorUrl.slice(1));
|
|
19853
|
+
const editor = getActiveEditor();
|
|
19854
|
+
const generation = openGeneration;
|
|
19837
19855
|
/** @type {LinkPopoverDocumentApi | null | undefined} */
|
|
19838
|
-
const doc =
|
|
19856
|
+
const doc = editor?.doc;
|
|
19839
19857
|
const bookmarkGet = doc?.bookmarks?.get;
|
|
19840
19858
|
if (typeof bookmarkGet !== "function") {
|
|
19841
19859
|
const mountedAnchor = findMountedAnchor(getUi()?.viewport?.getHost?.() ?? null, cssEscape(anchorName));
|
|
19842
|
-
if (mountedAnchor)
|
|
19860
|
+
if (!mountedAnchor) return false;
|
|
19861
|
+
scrollToElement(mountedAnchor, {
|
|
19843
19862
|
block: "start",
|
|
19844
19863
|
behavior: "instant"
|
|
19845
19864
|
});
|
|
19846
|
-
return;
|
|
19865
|
+
return true;
|
|
19847
19866
|
}
|
|
19848
19867
|
/** @type {BookmarkGetResult | null} */
|
|
19849
19868
|
let bookmark = null;
|
|
19850
19869
|
try {
|
|
19870
|
+
const list = doc?.bookmarks?.list;
|
|
19871
|
+
if (typeof list === "function") {
|
|
19872
|
+
if ((await Promise.resolve(list.call(doc.bookmarks)))?.items?.filter((item) => item.name === anchorName).length !== 1) return false;
|
|
19873
|
+
}
|
|
19851
19874
|
bookmark = await Promise.resolve(bookmarkGet.call(doc.bookmarks, { target: {
|
|
19852
19875
|
kind: "entity",
|
|
19853
19876
|
entityType: "bookmark",
|
|
@@ -19855,33 +19878,38 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
|
|
|
19855
19878
|
} }));
|
|
19856
19879
|
bookmark ??= null;
|
|
19857
19880
|
} catch {
|
|
19858
|
-
return;
|
|
19881
|
+
return false;
|
|
19859
19882
|
}
|
|
19883
|
+
if (editor !== getActiveEditor() || generation !== openGeneration) return false;
|
|
19860
19884
|
const story = bookmark?.address?.story;
|
|
19861
|
-
if (story && story.storyType !== "body") return;
|
|
19885
|
+
if (story && story.storyType !== "body" || bookmark?.tableColumn) return false;
|
|
19862
19886
|
const blockId = bookmark?.range?.from?.blockId;
|
|
19863
|
-
|
|
19864
|
-
if (
|
|
19887
|
+
const offset = bookmark?.range?.from?.offset ?? 0;
|
|
19888
|
+
if (typeof blockId !== "string" || !Number.isInteger(offset) || offset < 0) return false;
|
|
19889
|
+
if (placeCaret) await placeCaretAtBookmark(blockId, offset);
|
|
19865
19890
|
const viewport = getUi()?.viewport;
|
|
19866
19891
|
const scrollIntoView = viewport?.scrollIntoView;
|
|
19867
|
-
if (typeof scrollIntoView !== "function") return;
|
|
19892
|
+
if (typeof scrollIntoView !== "function") return false;
|
|
19868
19893
|
const target = {
|
|
19869
19894
|
kind: "text",
|
|
19870
19895
|
blockId,
|
|
19871
19896
|
range: {
|
|
19872
|
-
start:
|
|
19873
|
-
end:
|
|
19897
|
+
start: offset,
|
|
19898
|
+
end: offset
|
|
19874
19899
|
}
|
|
19875
19900
|
};
|
|
19876
19901
|
for (let step = 0; step < MAX_ANCHOR_NAVIGATION_STEPS; step += 1) try {
|
|
19877
|
-
|
|
19902
|
+
const result = await Promise.resolve(scrollIntoView.call(viewport, {
|
|
19878
19903
|
target,
|
|
19879
19904
|
block: "start",
|
|
19880
19905
|
behavior: "instant"
|
|
19881
|
-
}))
|
|
19906
|
+
}));
|
|
19907
|
+
if (editor !== getActiveEditor() || generation !== openGeneration) return false;
|
|
19908
|
+
if (result?.success !== false) return true;
|
|
19882
19909
|
} catch {
|
|
19883
|
-
return;
|
|
19910
|
+
return false;
|
|
19884
19911
|
}
|
|
19912
|
+
return false;
|
|
19885
19913
|
}
|
|
19886
19914
|
/**
|
|
19887
19915
|
* @param {HyperlinkActivationContext} ctx
|
|
@@ -20015,9 +20043,10 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
|
|
|
20015
20043
|
if (getBuiltInEditorDisabled()) return;
|
|
20016
20044
|
const closePopover = () => closeCurrentPopover("closed");
|
|
20017
20045
|
/** @param {string | null | undefined} anchorUrl */
|
|
20018
|
-
const goToAnchor = (anchorUrl) => {
|
|
20019
|
-
|
|
20020
|
-
|
|
20046
|
+
const goToAnchor = async (anchorUrl) => {
|
|
20047
|
+
const success = await navigateToAnchor(anchorUrl, { placeCaret: ctx.documentMode !== "viewing" });
|
|
20048
|
+
if (success) closePopover();
|
|
20049
|
+
return success;
|
|
20021
20050
|
};
|
|
20022
20051
|
const generation = openGeneration;
|
|
20023
20052
|
/** @param {ResolvedHyperlinkTarget | null} hyperlinkTarget */
|
|
@@ -21599,7 +21628,7 @@ var SurfaceDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
21599
21628
|
}
|
|
21600
21629
|
function setInitialFocus() {
|
|
21601
21630
|
if (!dialogRef.value) return;
|
|
21602
|
-
const firstFocusable = dialogRef.value.querySelector(FOCUSABLE_SELECTOR);
|
|
21631
|
+
const firstFocusable = dialogRef.value.querySelector("[data-sd-autofocus]") ?? dialogRef.value.querySelector(FOCUSABLE_SELECTOR);
|
|
21603
21632
|
if (firstFocusable) firstFocusable.focus();
|
|
21604
21633
|
else dialogRef.value.focus();
|
|
21605
21634
|
}
|
|
@@ -21710,7 +21739,7 @@ var SurfaceDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
|
|
|
21710
21739
|
])) : __props.surface.component ? (openBlock(), createBlock(resolveDynamicComponent(__props.surface.component), normalizeProps(mergeProps({ key: 1 }, mergedComponentProps.value)), null, 16)) : createCommentVNode("", true)])], 12, _hoisted_1$18)], 32);
|
|
21711
21740
|
};
|
|
21712
21741
|
}
|
|
21713
|
-
}, [["__scopeId", "data-v-
|
|
21742
|
+
}, [["__scopeId", "data-v-5cee3b11"]]);
|
|
21714
21743
|
//#endregion
|
|
21715
21744
|
//#region src/components/surfaces/SurfaceFloating.vue
|
|
21716
21745
|
var _hoisted_1$17 = ["aria-labelledby", "aria-label"];
|
|
@@ -40852,19 +40881,25 @@ var SdTooltip_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
40852
40881
|
const contentRef = ref(null);
|
|
40853
40882
|
const position = ref({
|
|
40854
40883
|
top: "0px",
|
|
40855
|
-
left: "0px"
|
|
40884
|
+
left: "0px",
|
|
40885
|
+
below: false
|
|
40856
40886
|
});
|
|
40857
40887
|
let closeTimeout = null;
|
|
40858
40888
|
let openTimeout = null;
|
|
40859
40889
|
let autoHideTimeout = null;
|
|
40860
|
-
const mergedContentClass = computed$1(() => [
|
|
40890
|
+
const mergedContentClass = computed$1(() => [
|
|
40891
|
+
"sd-tooltip-content",
|
|
40892
|
+
position.value.below && "sd-tooltip-below",
|
|
40893
|
+
attrs.class
|
|
40894
|
+
]);
|
|
40861
40895
|
const contentStyle = computed$1(() => ({
|
|
40862
40896
|
...props.contentStyle,
|
|
40863
40897
|
...attrs.style || {},
|
|
40864
40898
|
position: "fixed",
|
|
40865
40899
|
top: position.value.top,
|
|
40866
40900
|
left: position.value.left,
|
|
40867
|
-
zIndex: 2100
|
|
40901
|
+
zIndex: 2100,
|
|
40902
|
+
transformOrigin: position.value.below ? "top center" : "bottom center"
|
|
40868
40903
|
}));
|
|
40869
40904
|
const clearCloseTimeout = () => {
|
|
40870
40905
|
if (closeTimeout) {
|
|
@@ -40897,12 +40932,18 @@ var SdTooltip_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
40897
40932
|
const contentWidth = contentRef.value.offsetWidth;
|
|
40898
40933
|
const contentHeight = contentRef.value.offsetHeight;
|
|
40899
40934
|
const viewportWidth = window.innerWidth || document.documentElement.clientWidth || 0;
|
|
40935
|
+
const viewportHeight = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
40900
40936
|
const gutter = 8;
|
|
40901
40937
|
let left = triggerRect.left + triggerRect.width / 2 - contentWidth / 2;
|
|
40902
40938
|
left = Math.max(gutter, Math.min(left, viewportWidth - contentWidth - gutter));
|
|
40939
|
+
const aboveTop = triggerRect.top - contentHeight - 10;
|
|
40940
|
+
const below = aboveTop < gutter;
|
|
40941
|
+
const preferredTop = below ? triggerRect.bottom + 10 : aboveTop;
|
|
40942
|
+
const top = Math.max(gutter, Math.min(preferredTop, viewportHeight - contentHeight - gutter));
|
|
40903
40943
|
position.value = {
|
|
40904
|
-
top: `${
|
|
40905
|
-
left: `${left}px
|
|
40944
|
+
top: `${top}px`,
|
|
40945
|
+
left: `${left}px`,
|
|
40946
|
+
below
|
|
40906
40947
|
};
|
|
40907
40948
|
};
|
|
40908
40949
|
const open = async () => {
|
|
@@ -41022,7 +41063,7 @@ var SdTooltip_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PU
|
|
|
41022
41063
|
}, 8, ["css"])]))], 64);
|
|
41023
41064
|
};
|
|
41024
41065
|
}
|
|
41025
|
-
}), [["__scopeId", "data-v-
|
|
41066
|
+
}), [["__scopeId", "data-v-71c6de4c"]]);
|
|
41026
41067
|
//#endregion
|
|
41027
41068
|
//#region src/internal/toolbar/built-in/ButtonGroup.vue
|
|
41028
41069
|
var _hoisted_1$10 = [
|
|
@@ -46452,7 +46493,7 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
46452
46493
|
}
|
|
46453
46494
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
46454
46495
|
this.colorIndex = 0;
|
|
46455
|
-
this.version = "2.
|
|
46496
|
+
this.version = "2.24.0-next.2";
|
|
46456
46497
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
46457
46498
|
this.superdocId = config.superdocId || v4();
|
|
46458
46499
|
this.colors = this.config.colors ?? [];
|