superdoc 2.23.1-next.9 → 2.24.0-next.1
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/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.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.cjs +123 -82
- package/dist/superdoc.es.js +125 -84
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +20 -20
- package/package.json +2 -2
package/dist/superdoc.cjs
CHANGED
|
@@ -304,7 +304,7 @@ var awarenessStatesToArray = (context, states) => {
|
|
|
304
304
|
var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
|
|
305
305
|
function getSuperdocVersion() {
|
|
306
306
|
try {
|
|
307
|
-
return "2.
|
|
307
|
+
return "2.24.0-next.1";
|
|
308
308
|
} catch {
|
|
309
309
|
return "unknown";
|
|
310
310
|
}
|
|
@@ -13319,7 +13319,7 @@ var _hoisted_15$2 = {
|
|
|
13319
13319
|
};
|
|
13320
13320
|
var _hoisted_16$2 = { class: "change-type" };
|
|
13321
13321
|
var _hoisted_17$2 = { key: 1 };
|
|
13322
|
-
var _hoisted_18$
|
|
13322
|
+
var _hoisted_18$2 = { class: "tracked-change-text is-inserted" };
|
|
13323
13323
|
var _hoisted_19$1 = { key: 2 };
|
|
13324
13324
|
var _hoisted_20$1 = { class: "tracked-change-text is-inserted" };
|
|
13325
13325
|
var _hoisted_21$1 = { key: 3 };
|
|
@@ -14392,7 +14392,7 @@ var _sfc_main$34 = {
|
|
|
14392
14392
|
line.excerpt ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("span", _hoisted_15$2, " — ")) : require__plugin_vue_export_helper.createCommentVNode("", true),
|
|
14393
14393
|
require__plugin_vue_export_helper.createElementVNode("span", _hoisted_16$2, require__plugin_vue_export_helper.toDisplayString(line.label), 1)
|
|
14394
14394
|
]);
|
|
14395
|
-
}), 128))])) : require__plugin_vue_export_helper.createCommentVNode("", true)])) : comment.trackedChangeDisplayType === "hyperlinkAdded" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_17$2, [_cache[2] || (_cache[2] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Added hyperlink ", -1)), require__plugin_vue_export_helper.createElementVNode("span", _hoisted_18$
|
|
14395
|
+
}), 128))])) : require__plugin_vue_export_helper.createCommentVNode("", true)])) : comment.trackedChangeDisplayType === "hyperlinkAdded" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_17$2, [_cache[2] || (_cache[2] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Added hyperlink ", -1)), require__plugin_vue_export_helper.createElementVNode("span", _hoisted_18$2, "\"" + require__plugin_vue_export_helper.toDisplayString(comment.trackedChangeText) + "\"", 1)])) : comment.trackedChangeDisplayType === "hyperlinkModified" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_19$1, [_cache[3] || (_cache[3] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Changed hyperlink to ", -1)), require__plugin_vue_export_helper.createElementVNode("span", _hoisted_20$1, "\"" + require__plugin_vue_export_helper.toDisplayString(comment.trackedChangeText) + "\"", 1)])) : comment.trackedChangeDisplayType === "paragraphSplit" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_21$1, [..._cache[4] || (_cache[4] = [require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Added new line", -1)])])) : comment.trackedChangeDisplayType === "tableInsert" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_22$1, [..._cache[5] || (_cache[5] = [require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Added table", -1)])])) : comment.trackedChangeDisplayType === "tableDelete" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_23$1, [..._cache[6] || (_cache[6] = [require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Deleted table", -1)])])) : comment.trackedChangeType === "trackFormat" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_24, [_cache[7] || (_cache[7] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Format: ", -1)), require__plugin_vue_export_helper.createElementVNode("span", _hoisted_25, require__plugin_vue_export_helper.toDisplayString(comment.trackedChangeText), 1)])) : comment.trackedChangeType === "both" ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_26, [
|
|
14396
14396
|
_cache[8] || (_cache[8] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, "Replaced ", -1)),
|
|
14397
14397
|
require__plugin_vue_export_helper.createElementVNode("span", _hoisted_27, "\"" + require__plugin_vue_export_helper.toDisplayString(comment.deletedText) + "\"", 1),
|
|
14398
14398
|
_cache[9] || (_cache[9] = require__plugin_vue_export_helper.createElementVNode("span", { class: "change-type" }, " with ", -1)),
|
|
@@ -19001,6 +19001,11 @@ var _hoisted_17$1 = {
|
|
|
19001
19001
|
key: 5,
|
|
19002
19002
|
class: "input-row go-to-anchor clickable"
|
|
19003
19003
|
};
|
|
19004
|
+
var _hoisted_18$1 = {
|
|
19005
|
+
key: 6,
|
|
19006
|
+
role: "status",
|
|
19007
|
+
class: "sd-error"
|
|
19008
|
+
};
|
|
19004
19009
|
/**
|
|
19005
19010
|
* Built-in link editing popover.
|
|
19006
19011
|
*
|
|
@@ -19214,62 +19219,72 @@ var _sfc_main$26 = {
|
|
|
19214
19219
|
hyperlinkTarget: props.hyperlinkTarget
|
|
19215
19220
|
});
|
|
19216
19221
|
};
|
|
19217
|
-
const
|
|
19218
|
-
|
|
19222
|
+
const navigationError = require__plugin_vue_export_helper.ref("");
|
|
19223
|
+
const navigateToAnchor = async (anchorUrl) => {
|
|
19224
|
+
navigationError.value = "";
|
|
19225
|
+
try {
|
|
19226
|
+
if (await props.goToAnchor?.(anchorUrl) === false) navigationError.value = "Reference target is unavailable";
|
|
19227
|
+
} catch {
|
|
19228
|
+
navigationError.value = "Reference target is unavailable";
|
|
19229
|
+
}
|
|
19219
19230
|
};
|
|
19220
19231
|
return (_ctx, _cache) => {
|
|
19221
|
-
return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", { class: require__plugin_vue_export_helper.normalizeClass(["link-input-ctn", { "high-contrast": require__plugin_vue_export_helper.unref(isHighContrastMode) }]) }, [
|
|
19222
|
-
require__plugin_vue_export_helper.
|
|
19223
|
-
|
|
19224
|
-
|
|
19225
|
-
placeholder: "Text",
|
|
19226
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => text.value = $event),
|
|
19227
|
-
readonly: isViewingMode.value,
|
|
19228
|
-
onKeydown: require__plugin_vue_export_helper.withKeys(require__plugin_vue_export_helper.withModifiers(handleSubmit, ["stop", "prevent"]), ["enter"])
|
|
19229
|
-
}, null, 40, _hoisted_7$3), [[require__plugin_vue_export_helper.vModelText, text.value]])]),
|
|
19230
|
-
require__plugin_vue_export_helper.createElementVNode("div", _hoisted_8$3, [
|
|
19231
|
-
require__plugin_vue_export_helper.createElementVNode("div", {
|
|
19232
|
-
class: "input-icon",
|
|
19233
|
-
innerHTML: require__plugin_vue_export_helper.unref(toolbarIcons).linkInput
|
|
19234
|
-
}, null, 8, _hoisted_9$2),
|
|
19235
|
-
require__plugin_vue_export_helper.withDirectives(require__plugin_vue_export_helper.createElementVNode("input", {
|
|
19232
|
+
return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", { class: require__plugin_vue_export_helper.normalizeClass(["link-input-ctn", { "high-contrast": require__plugin_vue_export_helper.unref(isHighContrastMode) }]) }, [
|
|
19233
|
+
isAnchor.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$19, "Page anchor")) : isViewingMode.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_2$16, "Link details")) : isEditing.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_3$13, "Edit link")) : (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_4$8, "Add link")),
|
|
19234
|
+
__props.showInput && !isAnchor.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_5$6, [
|
|
19235
|
+
require__plugin_vue_export_helper.createElementVNode("div", _hoisted_6$5, [_cache[5] || (_cache[5] = require__plugin_vue_export_helper.createElementVNode("div", { class: "input-icon text-input-icon" }, "T", -1)), require__plugin_vue_export_helper.withDirectives(require__plugin_vue_export_helper.createElementVNode("input", {
|
|
19236
19236
|
type: "text",
|
|
19237
|
-
name: "
|
|
19238
|
-
placeholder: "
|
|
19239
|
-
|
|
19240
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => rawUrl.value = $event),
|
|
19237
|
+
name: "text",
|
|
19238
|
+
placeholder: "Text",
|
|
19239
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => text.value = $event),
|
|
19241
19240
|
readonly: isViewingMode.value,
|
|
19242
|
-
|
|
19243
|
-
|
|
19244
|
-
|
|
19245
|
-
|
|
19246
|
-
|
|
19247
|
-
|
|
19248
|
-
|
|
19249
|
-
"
|
|
19250
|
-
|
|
19251
|
-
|
|
19252
|
-
|
|
19253
|
-
|
|
19254
|
-
|
|
19255
|
-
|
|
19256
|
-
|
|
19257
|
-
|
|
19258
|
-
|
|
19259
|
-
|
|
19260
|
-
|
|
19261
|
-
|
|
19262
|
-
|
|
19263
|
-
|
|
19264
|
-
|
|
19265
|
-
|
|
19266
|
-
|
|
19267
|
-
|
|
19268
|
-
|
|
19241
|
+
onKeydown: require__plugin_vue_export_helper.withKeys(require__plugin_vue_export_helper.withModifiers(handleSubmit, ["stop", "prevent"]), ["enter"])
|
|
19242
|
+
}, null, 40, _hoisted_7$3), [[require__plugin_vue_export_helper.vModelText, text.value]])]),
|
|
19243
|
+
require__plugin_vue_export_helper.createElementVNode("div", _hoisted_8$3, [
|
|
19244
|
+
require__plugin_vue_export_helper.createElementVNode("div", {
|
|
19245
|
+
class: "input-icon",
|
|
19246
|
+
innerHTML: require__plugin_vue_export_helper.unref(toolbarIcons).linkInput
|
|
19247
|
+
}, null, 8, _hoisted_9$2),
|
|
19248
|
+
require__plugin_vue_export_helper.withDirectives(require__plugin_vue_export_helper.createElementVNode("input", {
|
|
19249
|
+
type: "text",
|
|
19250
|
+
name: "link",
|
|
19251
|
+
placeholder: "Type or paste a link",
|
|
19252
|
+
class: require__plugin_vue_export_helper.normalizeClass({ "sd-error": urlError.value }),
|
|
19253
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => rawUrl.value = $event),
|
|
19254
|
+
readonly: isViewingMode.value,
|
|
19255
|
+
onInput: _cache[2] || (_cache[2] = ($event) => commandError.value = ""),
|
|
19256
|
+
onKeydown: [require__plugin_vue_export_helper.withKeys(require__plugin_vue_export_helper.withModifiers(handleSubmit, ["stop", "prevent"]), ["enter"]), _cache[3] || (_cache[3] = ($event) => urlError.value = false)]
|
|
19257
|
+
}, null, 42, _hoisted_10$2), [[require__plugin_vue_export_helper.vModelText, rawUrl.value]]),
|
|
19258
|
+
require__plugin_vue_export_helper.createElementVNode("div", {
|
|
19259
|
+
class: require__plugin_vue_export_helper.normalizeClass(["open-link-icon", { "sd-disabled": !validUrl.value }]),
|
|
19260
|
+
innerHTML: require__plugin_vue_export_helper.unref(toolbarIcons).openLink,
|
|
19261
|
+
onClick: openLink,
|
|
19262
|
+
"data-item": "btn-link-open"
|
|
19263
|
+
}, null, 10, _hoisted_11$2)
|
|
19264
|
+
]),
|
|
19265
|
+
!isViewingMode.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_12$1, [isEditing.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("button", {
|
|
19266
|
+
key: 0,
|
|
19267
|
+
class: "remove-btn",
|
|
19268
|
+
onClick: handleRemove,
|
|
19269
|
+
disabled: isSubmitting.value,
|
|
19270
|
+
"data-item": "btn-link-remove"
|
|
19271
|
+
}, [require__plugin_vue_export_helper.createElementVNode("div", {
|
|
19272
|
+
class: "remove-btn__icon",
|
|
19273
|
+
innerHTML: require__plugin_vue_export_helper.unref(toolbarIcons).removeLink
|
|
19274
|
+
}, null, 8, _hoisted_14$1), _cache[6] || (_cache[6] = require__plugin_vue_export_helper.createTextVNode(" Remove ", -1))], 8, _hoisted_13$1)) : require__plugin_vue_export_helper.createCommentVNode("", true), require__plugin_vue_export_helper.createElementVNode("button", {
|
|
19275
|
+
class: require__plugin_vue_export_helper.normalizeClass(["sd-submit-btn", { "disable-btn": isDisabled.value }]),
|
|
19276
|
+
onClick: handleSubmit,
|
|
19277
|
+
disabled: isSubmitting.value,
|
|
19278
|
+
"data-item": "btn-link-apply"
|
|
19279
|
+
}, " Apply ", 10, _hoisted_15$1)])) : require__plugin_vue_export_helper.createCommentVNode("", true),
|
|
19280
|
+
commandError.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_16$1, require__plugin_vue_export_helper.toDisplayString(commandError.value), 1)) : require__plugin_vue_export_helper.createCommentVNode("", true)
|
|
19281
|
+
])) : isAnchor.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_17$1, [require__plugin_vue_export_helper.createElementVNode("a", { onClick: _cache[4] || (_cache[4] = require__plugin_vue_export_helper.withModifiers(($event) => navigateToAnchor(rawUrl.value), ["stop", "prevent"])) }, "Go to " + require__plugin_vue_export_helper.toDisplayString(rawUrl.value.startsWith("#_") ? rawUrl.value.substring(2) : rawUrl.value), 1)])) : require__plugin_vue_export_helper.createCommentVNode("", true),
|
|
19282
|
+
navigationError.value ? (require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_18$1, require__plugin_vue_export_helper.toDisplayString(navigationError.value), 1)) : require__plugin_vue_export_helper.createCommentVNode("", true)
|
|
19283
|
+
], 2);
|
|
19269
19284
|
};
|
|
19270
19285
|
}
|
|
19271
19286
|
};
|
|
19272
|
-
var LinkInput_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$26, [["__scopeId", "data-v-
|
|
19287
|
+
var LinkInput_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$26, [["__scopeId", "data-v-360db842"]]);
|
|
19273
19288
|
//#endregion
|
|
19274
19289
|
//#region src/internal/toolbar/built-in/scroll-helpers.js
|
|
19275
19290
|
function getScrollableParent(element) {
|
|
@@ -19389,7 +19404,8 @@ function scrollToElement(targetElement, options = {
|
|
|
19389
19404
|
* which keeps anchor navigation scoped to body targets.
|
|
19390
19405
|
* @typedef {Object} BookmarkGetResult
|
|
19391
19406
|
* @property {{ story?: { kind?: string, storyType?: string } }} [address]
|
|
19392
|
-
* @property {{ from?: { blockId?: string } }} [range]
|
|
19407
|
+
* @property {{ from?: { blockId?: string, offset?: number } }} [range]
|
|
19408
|
+
* @property {{ colFirst: number, colLast: number }} [tableColumn]
|
|
19393
19409
|
*/
|
|
19394
19410
|
/**
|
|
19395
19411
|
* The narrow Document API subset this composable reads. The host facade
|
|
@@ -19402,7 +19418,7 @@ function scrollToElement(targetElement, options = {
|
|
|
19402
19418
|
* @property {{ list?: () => BlocksListResult | null | undefined } | null} [blocks]
|
|
19403
19419
|
* @property {{ match?: (query: { select: { type: 'text', pattern: string, caseSensitive: boolean }, require: 'any' }) => QueryMatchResult | null | undefined } | null} [query]
|
|
19404
19420
|
* @property {{ list?: () => HyperlinksListResult | Promise<HyperlinksListResult | null | undefined> | null | undefined, get?: (input: { storyId: string, hyperlinkNodeId: string }) => HyperlinkGetResult | Promise<HyperlinkGetResult | null | undefined> | null | undefined } | null} [hyperlinks]
|
|
19405
|
-
* @property {{ get?: (input: { target: { kind: 'entity', entityType: 'bookmark', name: string } }) => BookmarkGetResult | Promise<BookmarkGetResult | null | undefined> | null | undefined } | null} [bookmarks]
|
|
19421
|
+
* @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]
|
|
19406
19422
|
*/
|
|
19407
19423
|
/**
|
|
19408
19424
|
* The `v2-link-click` payload the shell relays from the v2 host's
|
|
@@ -19831,7 +19847,7 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
|
|
|
19831
19847
|
* editing/suggesting via `placeCaret`.
|
|
19832
19848
|
* @param {string} blockId
|
|
19833
19849
|
*/
|
|
19834
|
-
async function
|
|
19850
|
+
async function placeCaretAtBookmark(blockId, offset) {
|
|
19835
19851
|
const setSelectionTarget = getActiveEditor()?.authoring?.setSelectionTarget;
|
|
19836
19852
|
if (typeof setSelectionTarget !== "function") return;
|
|
19837
19853
|
const story = {
|
|
@@ -19841,7 +19857,7 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
|
|
|
19841
19857
|
const anchor = {
|
|
19842
19858
|
kind: "text",
|
|
19843
19859
|
blockId,
|
|
19844
|
-
offset
|
|
19860
|
+
offset,
|
|
19845
19861
|
story
|
|
19846
19862
|
};
|
|
19847
19863
|
const target = {
|
|
@@ -19865,22 +19881,29 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
|
|
|
19865
19881
|
* @param {{ placeCaret?: boolean }} [options]
|
|
19866
19882
|
*/
|
|
19867
19883
|
async function navigateToAnchor(anchorUrl, { placeCaret = false } = {}) {
|
|
19868
|
-
if (typeof anchorUrl !== "string" || !anchorUrl.startsWith("#")) return;
|
|
19884
|
+
if (typeof anchorUrl !== "string" || !anchorUrl.startsWith("#")) return false;
|
|
19869
19885
|
const anchorName = decodeAnchorFragment(anchorUrl.slice(1));
|
|
19886
|
+
const editor = getActiveEditor();
|
|
19887
|
+
const generation = openGeneration;
|
|
19870
19888
|
/** @type {LinkPopoverDocumentApi | null | undefined} */
|
|
19871
|
-
const doc =
|
|
19889
|
+
const doc = editor?.doc;
|
|
19872
19890
|
const bookmarkGet = doc?.bookmarks?.get;
|
|
19873
19891
|
if (typeof bookmarkGet !== "function") {
|
|
19874
19892
|
const mountedAnchor = findMountedAnchor(getUi()?.viewport?.getHost?.() ?? null, cssEscape(anchorName));
|
|
19875
|
-
if (mountedAnchor)
|
|
19893
|
+
if (!mountedAnchor) return false;
|
|
19894
|
+
scrollToElement(mountedAnchor, {
|
|
19876
19895
|
block: "start",
|
|
19877
19896
|
behavior: "instant"
|
|
19878
19897
|
});
|
|
19879
|
-
return;
|
|
19898
|
+
return true;
|
|
19880
19899
|
}
|
|
19881
19900
|
/** @type {BookmarkGetResult | null} */
|
|
19882
19901
|
let bookmark = null;
|
|
19883
19902
|
try {
|
|
19903
|
+
const list = doc?.bookmarks?.list;
|
|
19904
|
+
if (typeof list === "function") {
|
|
19905
|
+
if ((await Promise.resolve(list.call(doc.bookmarks)))?.items?.filter((item) => item.name === anchorName).length !== 1) return false;
|
|
19906
|
+
}
|
|
19884
19907
|
bookmark = await Promise.resolve(bookmarkGet.call(doc.bookmarks, { target: {
|
|
19885
19908
|
kind: "entity",
|
|
19886
19909
|
entityType: "bookmark",
|
|
@@ -19888,33 +19911,38 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
|
|
|
19888
19911
|
} }));
|
|
19889
19912
|
bookmark ??= null;
|
|
19890
19913
|
} catch {
|
|
19891
|
-
return;
|
|
19914
|
+
return false;
|
|
19892
19915
|
}
|
|
19916
|
+
if (editor !== getActiveEditor() || generation !== openGeneration) return false;
|
|
19893
19917
|
const story = bookmark?.address?.story;
|
|
19894
|
-
if (story && story.storyType !== "body") return;
|
|
19918
|
+
if (story && story.storyType !== "body" || bookmark?.tableColumn) return false;
|
|
19895
19919
|
const blockId = bookmark?.range?.from?.blockId;
|
|
19896
|
-
|
|
19897
|
-
if (
|
|
19920
|
+
const offset = bookmark?.range?.from?.offset ?? 0;
|
|
19921
|
+
if (typeof blockId !== "string" || !Number.isInteger(offset) || offset < 0) return false;
|
|
19922
|
+
if (placeCaret) await placeCaretAtBookmark(blockId, offset);
|
|
19898
19923
|
const viewport = getUi()?.viewport;
|
|
19899
19924
|
const scrollIntoView = viewport?.scrollIntoView;
|
|
19900
|
-
if (typeof scrollIntoView !== "function") return;
|
|
19925
|
+
if (typeof scrollIntoView !== "function") return false;
|
|
19901
19926
|
const target = {
|
|
19902
19927
|
kind: "text",
|
|
19903
19928
|
blockId,
|
|
19904
19929
|
range: {
|
|
19905
|
-
start:
|
|
19906
|
-
end:
|
|
19930
|
+
start: offset,
|
|
19931
|
+
end: offset
|
|
19907
19932
|
}
|
|
19908
19933
|
};
|
|
19909
19934
|
for (let step = 0; step < MAX_ANCHOR_NAVIGATION_STEPS; step += 1) try {
|
|
19910
|
-
|
|
19935
|
+
const result = await Promise.resolve(scrollIntoView.call(viewport, {
|
|
19911
19936
|
target,
|
|
19912
19937
|
block: "start",
|
|
19913
19938
|
behavior: "instant"
|
|
19914
|
-
}))
|
|
19939
|
+
}));
|
|
19940
|
+
if (editor !== getActiveEditor() || generation !== openGeneration) return false;
|
|
19941
|
+
if (result?.success !== false) return true;
|
|
19915
19942
|
} catch {
|
|
19916
|
-
return;
|
|
19943
|
+
return false;
|
|
19917
19944
|
}
|
|
19945
|
+
return false;
|
|
19918
19946
|
}
|
|
19919
19947
|
/**
|
|
19920
19948
|
* @param {HyperlinkActivationContext} ctx
|
|
@@ -20048,9 +20076,10 @@ function useLinkPopover({ getSurfaceManager, getActiveEditor, getUi, getActivati
|
|
|
20048
20076
|
if (getBuiltInEditorDisabled()) return;
|
|
20049
20077
|
const closePopover = () => closeCurrentPopover("closed");
|
|
20050
20078
|
/** @param {string | null | undefined} anchorUrl */
|
|
20051
|
-
const goToAnchor = (anchorUrl) => {
|
|
20052
|
-
|
|
20053
|
-
|
|
20079
|
+
const goToAnchor = async (anchorUrl) => {
|
|
20080
|
+
const success = await navigateToAnchor(anchorUrl, { placeCaret: ctx.documentMode !== "viewing" });
|
|
20081
|
+
if (success) closePopover();
|
|
20082
|
+
return success;
|
|
20054
20083
|
};
|
|
20055
20084
|
const generation = openGeneration;
|
|
20056
20085
|
/** @param {ResolvedHyperlinkTarget | null} hyperlinkTarget */
|
|
@@ -21635,7 +21664,7 @@ var _sfc_main$24 = {
|
|
|
21635
21664
|
}
|
|
21636
21665
|
function setInitialFocus() {
|
|
21637
21666
|
if (!dialogRef.value) return;
|
|
21638
|
-
const firstFocusable = dialogRef.value.querySelector(FOCUSABLE_SELECTOR);
|
|
21667
|
+
const firstFocusable = dialogRef.value.querySelector("[data-sd-autofocus]") ?? dialogRef.value.querySelector(FOCUSABLE_SELECTOR);
|
|
21639
21668
|
if (firstFocusable) firstFocusable.focus();
|
|
21640
21669
|
else dialogRef.value.focus();
|
|
21641
21670
|
}
|
|
@@ -21747,7 +21776,7 @@ var _sfc_main$24 = {
|
|
|
21747
21776
|
};
|
|
21748
21777
|
}
|
|
21749
21778
|
};
|
|
21750
|
-
var SurfaceDialog_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$24, [["__scopeId", "data-v-
|
|
21779
|
+
var SurfaceDialog_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$24, [["__scopeId", "data-v-5cee3b11"]]);
|
|
21751
21780
|
//#endregion
|
|
21752
21781
|
//#region src/components/surfaces/SurfaceFloating.vue
|
|
21753
21782
|
var _hoisted_1$17 = ["aria-labelledby", "aria-label"];
|
|
@@ -40901,19 +40930,25 @@ var _sfc_main$12 = /*@__PURE__*/ Object.assign({ inheritAttrs: false }, {
|
|
|
40901
40930
|
const contentRef = require__plugin_vue_export_helper.ref(null);
|
|
40902
40931
|
const position = require__plugin_vue_export_helper.ref({
|
|
40903
40932
|
top: "0px",
|
|
40904
|
-
left: "0px"
|
|
40933
|
+
left: "0px",
|
|
40934
|
+
below: false
|
|
40905
40935
|
});
|
|
40906
40936
|
let closeTimeout = null;
|
|
40907
40937
|
let openTimeout = null;
|
|
40908
40938
|
let autoHideTimeout = null;
|
|
40909
|
-
const mergedContentClass = require__plugin_vue_export_helper.computed(() => [
|
|
40939
|
+
const mergedContentClass = require__plugin_vue_export_helper.computed(() => [
|
|
40940
|
+
"sd-tooltip-content",
|
|
40941
|
+
position.value.below && "sd-tooltip-below",
|
|
40942
|
+
attrs.class
|
|
40943
|
+
]);
|
|
40910
40944
|
const contentStyle = require__plugin_vue_export_helper.computed(() => ({
|
|
40911
40945
|
...props.contentStyle,
|
|
40912
40946
|
...attrs.style || {},
|
|
40913
40947
|
position: "fixed",
|
|
40914
40948
|
top: position.value.top,
|
|
40915
40949
|
left: position.value.left,
|
|
40916
|
-
zIndex: 2100
|
|
40950
|
+
zIndex: 2100,
|
|
40951
|
+
transformOrigin: position.value.below ? "top center" : "bottom center"
|
|
40917
40952
|
}));
|
|
40918
40953
|
const clearCloseTimeout = () => {
|
|
40919
40954
|
if (closeTimeout) {
|
|
@@ -40946,12 +40981,18 @@ var _sfc_main$12 = /*@__PURE__*/ Object.assign({ inheritAttrs: false }, {
|
|
|
40946
40981
|
const contentWidth = contentRef.value.offsetWidth;
|
|
40947
40982
|
const contentHeight = contentRef.value.offsetHeight;
|
|
40948
40983
|
const viewportWidth = window.innerWidth || document.documentElement.clientWidth || 0;
|
|
40984
|
+
const viewportHeight = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
40949
40985
|
const gutter = 8;
|
|
40950
40986
|
let left = triggerRect.left + triggerRect.width / 2 - contentWidth / 2;
|
|
40951
40987
|
left = Math.max(gutter, Math.min(left, viewportWidth - contentWidth - gutter));
|
|
40988
|
+
const aboveTop = triggerRect.top - contentHeight - 10;
|
|
40989
|
+
const below = aboveTop < gutter;
|
|
40990
|
+
const preferredTop = below ? triggerRect.bottom + 10 : aboveTop;
|
|
40991
|
+
const top = Math.max(gutter, Math.min(preferredTop, viewportHeight - contentHeight - gutter));
|
|
40952
40992
|
position.value = {
|
|
40953
|
-
top: `${
|
|
40954
|
-
left: `${left}px
|
|
40993
|
+
top: `${top}px`,
|
|
40994
|
+
left: `${left}px`,
|
|
40995
|
+
below
|
|
40955
40996
|
};
|
|
40956
40997
|
};
|
|
40957
40998
|
const open = async () => {
|
|
@@ -41072,7 +41113,7 @@ var _sfc_main$12 = /*@__PURE__*/ Object.assign({ inheritAttrs: false }, {
|
|
|
41072
41113
|
};
|
|
41073
41114
|
}
|
|
41074
41115
|
});
|
|
41075
|
-
var SdTooltip_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$12, [["__scopeId", "data-v-
|
|
41116
|
+
var SdTooltip_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$12, [["__scopeId", "data-v-71c6de4c"]]);
|
|
41076
41117
|
//#endregion
|
|
41077
41118
|
//#region src/internal/toolbar/built-in/ButtonGroup.vue
|
|
41078
41119
|
var _hoisted_1$10 = [
|
|
@@ -46523,7 +46564,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
|
|
|
46523
46564
|
}
|
|
46524
46565
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
46525
46566
|
this.colorIndex = 0;
|
|
46526
|
-
this.version = "2.
|
|
46567
|
+
this.version = "2.24.0-next.1";
|
|
46527
46568
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
46528
46569
|
this.superdocId = config.superdocId || require_uuid.v4();
|
|
46529
46570
|
this.colors = this.config.colors ?? [];
|