@stll/folio-vue 0.33.0 → 0.34.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/components/DocxEditor/types.d.ts +1 -1
- package/dist/composables/useTrackedChanges.d.ts +5 -2
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +1 -1
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -26
- package/dist/{useZoom-CX69Me_z.js → useZoom-BKM59EqE.js} +357 -354
- package/dist/useZoom-C0dkG1Q4.cjs +1 -0
- package/dist/utils/comments.d.ts +1 -1
- package/package.json +2 -2
- package/dist/useZoom-QSSrGY_r.cjs +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type { OutlineDepth } from '@stll/folio-core/utils/outlineDepth';
|
|
|
26
26
|
export type { KeyboardShortcutScope } from '@stll/folio-core/managers/editorShortcuts';
|
|
27
27
|
export type { ScrollToParaIdOptions } from '@stll/folio-core/paged-layout/paragraphFlash';
|
|
28
28
|
export type { BlockRect } from '@stll/folio-core/paged-layout/blockGeometry';
|
|
29
|
-
export type { FolioSuggestion, SuggestionKind, SuggestionAppliedAs, } from '@stll/folio-core/prosemirror/
|
|
29
|
+
export type { FolioSuggestion, SuggestionKind, SuggestionAppliedAs, } from '@stll/folio-core/prosemirror/suggestionQueries';
|
|
30
30
|
export type { FontOption } from './utils/fontOptions';
|
|
31
31
|
export type { FontDefinition } from './components/DocxEditor/types';
|
|
32
32
|
export { FolioUIProvider } from './ui/folio-ui';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, i as r, l as i, o as a, r as o, s, t as c, u as l } from "./useZoom-
|
|
1
|
+
import { a as e, c as t, d as n, i as r, l as i, o as a, r as o, s, t as c, u as l } from "./useZoom-BKM59EqE.js";
|
|
2
2
|
import { S as u, a as d, b as f, g as p, m, n as h, r as g, v as _, x as v, y } from "./folio-ui-ctJdVP-s.js";
|
|
3
3
|
import { t as ee } from "./zIndex-FOGfTBdc.js";
|
|
4
4
|
import { S as te, T as ne, _ as re, d as ie, i as ae, n as oe, r as b, t as se, w as ce } from "./StylePicker-F3cLPvRE.js";
|
|
@@ -55,10 +55,11 @@ import { onPaintedLayoutChange as jn, readBlockRects as Mn } from "@stll/folio-c
|
|
|
55
55
|
import { getPageTextFromLayout as Nn } from "@stll/folio-core/paged-layout/pageText";
|
|
56
56
|
import { findParagraphFragmentsByParaId as Pn, flashParagraphElements as Fn } from "@stll/folio-core/paged-layout/paragraphFlash";
|
|
57
57
|
import { getPageScrollTarget as In } from "@stll/folio-core/paged-layout/scrollNavigation";
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
58
|
+
import { blockSdtAttrsToSdtProperties as Ln, findBlockSdtMatch as Rn, findBlockSdtMatches as zn, removeContentControlTr as Bn, setContentControlContentTr as Vn, setContentControlValueTr as Hn } from "@stll/folio-core/prosemirror/commands/contentControls";
|
|
59
|
+
import { setContentControlContentBlocksTr as Un } from "@stll/folio-core/prosemirror/commands/contentControlsBlockFill";
|
|
60
|
+
import { projectMarkupView as Wn, visibleCaretPosition as Gn } from "@stll/folio-core/prosemirror/markupViewProjection";
|
|
61
|
+
import { findAIEditRevisionRange as Kn } from "@stll/folio-core/prosemirror/revisionRangeQueries";
|
|
62
|
+
import { findSuggestionRange as qn, getSuggestions as Jn } from "@stll/folio-core/prosemirror/suggestionQueries";
|
|
62
63
|
import { findStartPosForParaId as Yn } from "@stll/folio-core/prosemirror/utils/findParagraphByParaId";
|
|
63
64
|
import { deriveBlockId as Xn, getFolioParaIdFromBlockId as Zn, getFolioParaIdFromBlockId as Qn, isFolioBlockId as $n, isSequentialFolioBlockId as er } from "@stll/folio-core/types/block-id";
|
|
64
65
|
import { FontFaceLifecycle as tr } from "@stll/folio-core/fonts/FontFaceLifecycle";
|
|
@@ -884,7 +885,7 @@ function Oi(e) {
|
|
|
884
885
|
reason: "unsupportedBlock"
|
|
885
886
|
}))
|
|
886
887
|
};
|
|
887
|
-
let c = new Set(
|
|
888
|
+
let c = new Set(Jn(s.state).map((e) => e.suggestionId)), l = e.editor.applyCanonicalDocumentOperations({
|
|
888
889
|
undefinedReferences: n,
|
|
889
890
|
snapshot: r,
|
|
890
891
|
batch: {
|
|
@@ -960,7 +961,7 @@ function Oi(e) {
|
|
|
960
961
|
};
|
|
961
962
|
}, s = e.editorView.value;
|
|
962
963
|
if (!s) return o();
|
|
963
|
-
let c = new Set(
|
|
964
|
+
let c = new Set(Jn(s.state).map((e) => e.suggestionId)), l = e.editor.applyCanonicalDocumentOperations({
|
|
964
965
|
undefinedReferences: n,
|
|
965
966
|
snapshot: r,
|
|
966
967
|
batch: i,
|
|
@@ -988,7 +989,7 @@ function Oi(e) {
|
|
|
988
989
|
scrollToAIEditOperation: (t) => {
|
|
989
990
|
let n = e.editorView.value;
|
|
990
991
|
if (!n) return !1;
|
|
991
|
-
let r =
|
|
992
|
+
let r = Kn(n.state, t);
|
|
992
993
|
if (!r) return !1;
|
|
993
994
|
let { from: i, to: a } = En(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
994
995
|
return n.dispatch(n.state.tr.setSelection(q.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
@@ -1048,12 +1049,12 @@ function Oi(e) {
|
|
|
1048
1049
|
},
|
|
1049
1050
|
getSuggestions: () => {
|
|
1050
1051
|
let t = e.editorView.value;
|
|
1051
|
-
return t ?
|
|
1052
|
+
return t ? Jn(t.state) : [];
|
|
1052
1053
|
},
|
|
1053
1054
|
exportPendingSuggestions: () => {
|
|
1054
1055
|
let n = e.editorView.value;
|
|
1055
1056
|
if (!n || !e.editor.getCanonicalStoryProjection($t.MAIN)) return [];
|
|
1056
|
-
let r = new Set(
|
|
1057
|
+
let r = new Set(Jn(n.state).map((e) => e.suggestionId));
|
|
1057
1058
|
return t.exportPendingSuggestions({
|
|
1058
1059
|
activeSuggestionIds: r,
|
|
1059
1060
|
snapshotForStory: (t, n) => {
|
|
@@ -1083,7 +1084,7 @@ function Oi(e) {
|
|
|
1083
1084
|
}),
|
|
1084
1085
|
activeSuggestionIds: () => {
|
|
1085
1086
|
let t = e.editorView.value;
|
|
1086
|
-
return new Set(t ?
|
|
1087
|
+
return new Set(t ? Jn(t.state).map((e) => e.suggestionId) : []);
|
|
1087
1088
|
}
|
|
1088
1089
|
}),
|
|
1089
1090
|
acceptSuggestion: (t, n) => {
|
|
@@ -1092,7 +1093,7 @@ function Oi(e) {
|
|
|
1092
1093
|
accepted: !1,
|
|
1093
1094
|
appliedAs: null
|
|
1094
1095
|
};
|
|
1095
|
-
let i =
|
|
1096
|
+
let i = Jn(r.state).find((e) => e.suggestionId === t)?.appliedAs ?? null, a = e.editor.getCanonicalDocument() ? e.editor.resolveCanonicalSuggestion(t, "accept", n?.author ?? e.author()) : !1;
|
|
1096
1097
|
return {
|
|
1097
1098
|
accepted: a,
|
|
1098
1099
|
appliedAs: a ? i : null
|
|
@@ -1102,7 +1103,7 @@ function Oi(e) {
|
|
|
1102
1103
|
scrollToSuggestion: (t) => {
|
|
1103
1104
|
let n = e.editorView.value;
|
|
1104
1105
|
if (!n) return !1;
|
|
1105
|
-
let r =
|
|
1106
|
+
let r = qn(n.state, t);
|
|
1106
1107
|
if (!r) return !1;
|
|
1107
1108
|
let { from: i, to: a } = En(n.state.doc.content.size, r), o = n.state.doc.resolve(i), s = n.state.doc.resolve(a);
|
|
1108
1109
|
return n.dispatch(n.state.tr.setSelection(q.between(o, s))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
@@ -1126,7 +1127,7 @@ function Oi(e) {
|
|
|
1126
1127
|
layout: e.layout.value,
|
|
1127
1128
|
doc: n.state.doc,
|
|
1128
1129
|
page: t,
|
|
1129
|
-
projection:
|
|
1130
|
+
projection: Wn(n.state, e.markupView?.value ?? "all-markup")
|
|
1130
1131
|
}) : null;
|
|
1131
1132
|
},
|
|
1132
1133
|
getTargetPage: (t, n) => {
|
|
@@ -1153,8 +1154,8 @@ function Oi(e) {
|
|
|
1153
1154
|
onLayoutChange: h,
|
|
1154
1155
|
getContentControls: (t = {}) => {
|
|
1155
1156
|
let n = e.editorView.value;
|
|
1156
|
-
return n ?
|
|
1157
|
-
properties:
|
|
1157
|
+
return n ? zn(n.state.doc, t).map((e) => ({
|
|
1158
|
+
properties: Ln(e.node),
|
|
1158
1159
|
path: e.path,
|
|
1159
1160
|
pmPos: e.pos
|
|
1160
1161
|
})) : [];
|
|
@@ -1162,7 +1163,7 @@ function Oi(e) {
|
|
|
1162
1163
|
scrollToContentControl: (t) => {
|
|
1163
1164
|
let n = e.editorView.value;
|
|
1164
1165
|
if (!n) return !1;
|
|
1165
|
-
let r =
|
|
1166
|
+
let r = Rn(n.state.doc, t);
|
|
1166
1167
|
if (!r) return !1;
|
|
1167
1168
|
let i = r.pos + 1, a = n.state.doc.resolve(i);
|
|
1168
1169
|
return n.dispatch(n.state.tr.setSelection(q.near(a))), requestAnimationFrame(() => e.scrollVisiblePositionIntoView(i)), !0;
|
|
@@ -1170,19 +1171,19 @@ function Oi(e) {
|
|
|
1170
1171
|
setContentControlContent: (t, n, r = {}) => {
|
|
1171
1172
|
let i = e.editorView.value;
|
|
1172
1173
|
if (!i) return !1;
|
|
1173
|
-
let a = typeof n == "string" ?
|
|
1174
|
+
let a = typeof n == "string" ? Vn(i.state, t, n, r) : Un(i.state, t, n, r);
|
|
1174
1175
|
return a ? (i.dispatch(a), !0) : !1;
|
|
1175
1176
|
},
|
|
1176
1177
|
setContentControlValue: (t, n, r = {}) => {
|
|
1177
1178
|
let i = e.editorView.value;
|
|
1178
1179
|
if (!i) return !1;
|
|
1179
|
-
let a =
|
|
1180
|
+
let a = Hn(i.state, t, n, r);
|
|
1180
1181
|
return a ? (i.dispatch(a), !0) : !1;
|
|
1181
1182
|
},
|
|
1182
1183
|
removeContentControl: (t, n = {}) => {
|
|
1183
1184
|
let r = e.editorView.value;
|
|
1184
1185
|
if (!r) return !1;
|
|
1185
|
-
let i =
|
|
1186
|
+
let i = Bn(r.state, t, n);
|
|
1186
1187
|
return i ? (r.dispatch(i), !0) : !1;
|
|
1187
1188
|
}
|
|
1188
1189
|
} };
|
|
@@ -1262,11 +1263,11 @@ var Ri = {
|
|
|
1262
1263
|
function zi(e, t = Ri) {
|
|
1263
1264
|
R(() => e.isReady.value ? e.sourceBuffer() : null, (n, r, i) => {
|
|
1264
1265
|
if (!n) return;
|
|
1265
|
-
let a = !1, o = [];
|
|
1266
|
+
let a = !1, o = [], s = !1;
|
|
1266
1267
|
t.loadEmbedded(n).then(({ faces: n, familyMap: r }) => {
|
|
1267
|
-
a ? t.remove(n) : (o = n, (n.length !== 0 || r.size !== 0) && (e.setEmbeddedFontFamilies(new Map(r)), e.remeasure()));
|
|
1268
|
+
a ? t.remove(n) : (o = n, (n.length !== 0 || r.size !== 0) && (s = !0, e.setEmbeddedFontFamilies(new Map(r)), e.remeasure()));
|
|
1268
1269
|
}), i(() => {
|
|
1269
|
-
a = !0, t.remove(o), e.setEmbeddedFontFamilies(null);
|
|
1270
|
+
a = !0, t.remove(o), s && e.setEmbeddedFontFamilies(null);
|
|
1270
1271
|
});
|
|
1271
1272
|
}, { immediate: !0 });
|
|
1272
1273
|
let n = new tr((e) => t.remove(e)), r = n.subscribe(e.remeasure);
|
|
@@ -2005,7 +2006,7 @@ var la = (e) => {
|
|
|
2005
2006
|
markupView: e.markupView.value,
|
|
2006
2007
|
zoom: e.zoom.value,
|
|
2007
2008
|
zIndex: ee.selectionOverlay
|
|
2008
|
-
}), { selection: o } = i.state, s = r.getBoundingClientRect(), c = o.empty ? wr(r,
|
|
2009
|
+
}), { selection: o } = i.state, s = r.getBoundingClientRect(), c = o.empty ? wr(r, Gn(Wn(i.state, e.markupView.value), o.head), s) : null;
|
|
2009
2010
|
if (Re({
|
|
2010
2011
|
hiddenHost: e.hiddenContainer.value,
|
|
2011
2012
|
editorView: i,
|
|
@@ -4120,7 +4121,7 @@ var la = (e) => {
|
|
|
4120
4121
|
onCopy: () => f.onCopy?.(),
|
|
4121
4122
|
onCut: () => f.onCut?.(),
|
|
4122
4123
|
onPaste: () => f.onPaste?.()
|
|
4123
|
-
}), mr = o(Y, H), hr = S(() => mr.value.entries), Z = mi({
|
|
4124
|
+
}), mr = o(Y, H, J), hr = S(() => mr.value.entries), Z = mi({
|
|
4124
4125
|
editor: J,
|
|
4125
4126
|
editorView: Y,
|
|
4126
4127
|
getDocument: pn,
|
|
@@ -5118,7 +5119,7 @@ var la = (e) => {
|
|
|
5118
5119
|
])
|
|
5119
5120
|
], 14, Bo));
|
|
5120
5121
|
}
|
|
5121
|
-
}), [["__scopeId", "data-v-
|
|
5122
|
+
}), [["__scopeId", "data-v-a856286a"]]);
|
|
5122
5123
|
// src/utils/listState.ts
|
|
5123
5124
|
function ns() {
|
|
5124
5125
|
return V;
|