@stll/folio-vue 0.2.0 → 0.4.0

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.
@@ -11,18 +11,18 @@ import { browserClock as re, createLayoutScheduler as ie } from "@stll/folio-cor
11
11
  import { createLayoutSession as ae } from "@stll/folio-core/controller/layoutSession";
12
12
  import { parseDocx as oe } from "@stll/folio-core/docx/parser";
13
13
  import { getFootnoteText as _ } from "@stll/folio-core/docx/footnoteParser";
14
- import { convertHeaderFooterPmDocToContent as v, convertHeaderFooterToContent as y } from "@stll/folio-core/layout-bridge/convert/headerFooterLayout";
15
- import { LayoutPainter as se } from "@stll/folio-core/layout-painter";
16
- import { LayoutSelectionGate as ce } from "@stll/folio-core/paged-layout/LayoutSelectionGate";
17
- import { getTransactionDirtyRange as le } from "@stll/folio-core/paged-layout/transactionDirtyRange";
18
- import { fromProseDoc as b } from "@stll/folio-core/prosemirror/conversion/fromProseDoc";
19
- import { ExtensionManager as ue } from "@stll/folio-core/prosemirror/extensions/ExtensionManager";
20
- import { getChangedParagraphIds as de, hasStructuralChanges as fe, hasUntrackedChanges as pe } from "@stll/folio-core/prosemirror/extensions/features/ParagraphChangeTrackerExtension";
21
- import { createStarterKit as me } from "@stll/folio-core/prosemirror/extensions/StarterKit";
22
- import { createTemplatePreviewValuesPlugin as he } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
23
- import { templateSlashMenuPlugin as ge } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
24
- import { findVerticalScrollParent as x } from "@stll/folio-core/utils/findVerticalScrollParent";
25
- import { MIN_CELL_WIDTH_TWIPS as S, MIN_ROW_HEIGHT_TWIPS as _e, TWIPS_PER_PIXEL as C, commitColumnResize as ve, commitRightEdgeResize as ye, commitRowResize as be, readColumnWidthAt as w, readColumnWidths as xe, readRowHeight as T } from "@stll/folio-core/prosemirror/tableResize";
14
+ import { convertHeaderFooterPmDocToContent as se, convertHeaderFooterToContent as ce } from "@stll/folio-core/layout-bridge/convert/headerFooterLayout";
15
+ import { LayoutPainter as le } from "@stll/folio-core/layout-painter";
16
+ import { LayoutSelectionGate as ue } from "@stll/folio-core/paged-layout/LayoutSelectionGate";
17
+ import { getTransactionDirtyRange as de } from "@stll/folio-core/paged-layout/transactionDirtyRange";
18
+ import { fromProseDoc as v } from "@stll/folio-core/prosemirror/conversion/fromProseDoc";
19
+ import { ExtensionManager as fe } from "@stll/folio-core/prosemirror/extensions/ExtensionManager";
20
+ import { getChangedParagraphIds as pe, hasStructuralChanges as me, hasUntrackedChanges as he } from "@stll/folio-core/prosemirror/extensions/features/ParagraphChangeTrackerExtension";
21
+ import { createStarterKit as ge } from "@stll/folio-core/prosemirror/extensions/StarterKit";
22
+ import { createTemplatePreviewValuesPlugin as _e } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
23
+ import { templateSlashMenuPlugin as ve } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
24
+ import { findVerticalScrollParent as y } from "@stll/folio-core/utils/findVerticalScrollParent";
25
+ import { MIN_CELL_WIDTH_TWIPS as b, MIN_ROW_HEIGHT_TWIPS as ye, TWIPS_PER_PIXEL as x, commitColumnResize as be, commitRightEdgeResize as S, commitRowResize as C, readColumnWidthAt as w, readColumnWidths as T, readRowHeight as xe } from "@stll/folio-core/prosemirror/tableResize";
26
26
  import { extractTrackedChanges as E } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
27
27
  //#region src/composables/useDocxEditor.ts
28
28
  var Se = 24, Ce = 32, we = 96, Te = 250, Ee = [];
@@ -92,7 +92,7 @@ function k(e, t, n, r, i, a) {
92
92
  ...a,
93
93
  rId: t
94
94
  } : a, s = t ? n?.getView(t) : null;
95
- return s ? v(s.state.doc, r, i, o) : y(e, r, i, o);
95
+ return s ? se(s.state.doc, r, i, o) : ce(e, r, i, o);
96
96
  }
97
97
  function Ae(e, t, n, r, i) {
98
98
  if (!e || e.size === 0) return;
@@ -160,38 +160,38 @@ function Ne() {
160
160
  return typeof document > "u" || !("fonts" in document) ? !0 : document.fonts.status === "loaded";
161
161
  }
162
162
  function j(e) {
163
- let { hiddenContainer: t, pagesContainer: n, readOnly: u = !1, pageGap: _ = Se, documentKey: v, editorMode: y, author: x, externalPlugins: S = [], onAnonymizationMatchesChange: _e, showTemplateDirectives: C, onSlashMenuChange: ve, onSlashMenuKeyAction: ye, onChange: be, onError: w, onSelectionUpdate: xe, onEditorViewReady: T, onReadOnlyEditAttempt: E, featureFlags: D, onSelectiveSaveTripwire: O } = e, A = a(null), j = a(null), M = a(null), N = a(null), P = a([]), F = a([]), I = i(!1), L = i(null), R = i(!1), z = new ue(me());
164
- z.buildSchema(), z.initializeRuntime();
165
- let B = p(!1), V = d({ onMatchesChange: (e) => _e?.(e) }), H = f(), U = ge({
166
- onChange: (e) => ve?.(e),
167
- onKeyAction: (e) => ye?.(e) ?? !1
168
- }), W = he(), G = () => o(C) === !0;
169
- function Pe() {
163
+ let { hiddenContainer: t, pagesContainer: n, readOnly: u = !1, pageGap: _ = Se, documentKey: se, password: ce, editorMode: y, author: b, externalPlugins: ye = [], onAnonymizationMatchesChange: x, showTemplateDirectives: be, onSlashMenuChange: S, onSlashMenuKeyAction: C, onChange: w, onError: T, onSelectionUpdate: xe, onEditorViewReady: E, onReadOnlyEditAttempt: D, featureFlags: O, onSelectiveSaveTripwire: A } = e, j = a(null), M = a(null), N = a(null), P = a(null), F = a([]), I = a([]), L = i(!1), R = i(null), z = i(!1), B = new fe(ge());
164
+ B.buildSchema(), B.initializeRuntime();
165
+ let V = p(!1), H = d({ onMatchesChange: (e) => x?.(e) }), U = f(), W = ve({
166
+ onChange: (e) => S?.(e),
167
+ onKeyAction: (e) => C?.(e) ?? !1
168
+ }), G = _e(), K = () => o(be) === !0;
169
+ function q() {
170
170
  return [
171
- B,
172
- ...S,
173
171
  V,
174
- ...G() ? [H, U] : [],
175
- W
172
+ ...ye,
173
+ H,
174
+ ...K() ? [U, W] : [],
175
+ G
176
176
  ];
177
177
  }
178
- let K = ee(), q = new ce(), Fe = ae(), Ie = new se({
178
+ let J = ee(), Y = new ue(), Pe = ae(), Fe = new le({
179
179
  pageGap: _,
180
180
  showShadow: !0
181
181
  });
182
- function Le(e) {
183
- e.layout && (N.value = e.layout), e.blocks && (P.value = e.blocks), e.measures && (F.value = e.measures), e.blockLookup && Ie.setBlockLookup(e.blockLookup), e.layout && K.emit("layoutComplete", e.layout);
182
+ function Ie(e) {
183
+ e.layout && (P.value = e.layout), e.blocks && (F.value = e.blocks), e.measures && (I.value = e.measures), e.blockLookup && Fe.setBlockLookup(e.blockLookup), e.layout && J.emit("layoutComplete", e.layout);
184
184
  }
185
- function J(e, t = {}) {
186
- let r = n.value, i = r instanceof HTMLDivElement ? r : null, a = A.value, o = a?.package.document, s = o?.sections?.[0]?.properties ?? o?.finalSectionProperties ?? null, u = l(s), d = c(s), f = De(s), p = u.w - d.left - d.right, m = a?.package.styles ?? null, h = a?.package.theme ?? null, ee = a?.package.settings?.defaultTabStop, g = ke(a, s);
185
+ function X(e, t = {}) {
186
+ let r = n.value, i = r instanceof HTMLDivElement ? r : null, a = j.value, o = a?.package.document, s = o?.sections?.[0]?.properties ?? o?.finalSectionProperties ?? null, u = l(s), d = c(s), f = De(s), p = u.w - d.left - d.right, m = a?.package.styles ?? null, h = a?.package.theme ?? null, ee = a?.package.settings?.defaultTabStop, g = ke(a, s);
187
187
  try {
188
- Le(ne({
188
+ Ie(ne({
189
189
  contentWidth: p,
190
190
  columns: f,
191
191
  pageSize: u,
192
192
  margins: d,
193
193
  pageGap: _,
194
- syncCoordinator: q,
194
+ syncCoordinator: Y,
195
195
  headerContent: g.header.hf,
196
196
  footerContent: g.footer.hf,
197
197
  firstPageHeaderContent: g.firstHeader.hf,
@@ -206,11 +206,11 @@ function j(e) {
206
206
  document: a,
207
207
  defaultTabStop: ee,
208
208
  styles: m,
209
- layout: N.value,
209
+ layout: P.value,
210
210
  hfPMs: null,
211
- painter: Ie,
211
+ painter: Fe,
212
212
  pagesContainer: i,
213
- session: Fe,
213
+ session: Pe,
214
214
  renderHfFromContentOrPm: k,
215
215
  renderHeaderFooterContentByRId: Ae,
216
216
  documentFontsAreLoaded: Ne,
@@ -220,139 +220,139 @@ function j(e) {
220
220
  }, e, t));
221
221
  } catch (e) {
222
222
  let t = e instanceof Error ? e : Error(String(e));
223
- w?.(t);
223
+ T?.(t);
224
224
  }
225
225
  }
226
- let Y = ie({
227
- runLayout: (e, t) => J(e, t),
226
+ let Z = ie({
227
+ runLayout: (e, t) => X(e, t),
228
228
  debounceMs: Ce,
229
229
  maxDelayMs: we,
230
230
  clock: re
231
- }), X = null;
232
- function Re() {
233
- X !== null && (window.clearTimeout(X), X = null);
234
- let e = j.value, t = A.value;
231
+ }), Q = null;
232
+ function Le() {
233
+ Q !== null && (window.clearTimeout(Q), Q = null);
234
+ let e = M.value, t = j.value;
235
235
  if (!(!e || !t)) try {
236
- let n = b(e.state.doc, t);
237
- A.value = n, be?.(n), K.emit("docChange", n);
236
+ let n = v(e.state.doc, t);
237
+ j.value = n, w?.(n), J.emit("docChange", n);
238
238
  } catch (e) {
239
- w?.(e instanceof Error ? e : Error(String(e)));
239
+ T?.(e instanceof Error ? e : Error(String(e)));
240
240
  }
241
241
  }
242
- function ze() {
243
- X !== null && window.clearTimeout(X), X = window.setTimeout(() => {
244
- X = null, Re();
242
+ function Re() {
243
+ Q !== null && window.clearTimeout(Q), Q = window.setTimeout(() => {
244
+ Q = null, Le();
245
245
  }, Te);
246
246
  }
247
- let Z = g({
247
+ let $ = g({
248
248
  getHost: () => t.value,
249
- getDocument: () => A.value,
250
- getStyles: () => A.value?.package.styles ?? null,
251
- getExtensionManager: () => z,
252
- getExternalPlugins: Pe,
249
+ getDocument: () => j.value,
250
+ getStyles: () => j.value?.package.styles ?? null,
251
+ getExtensionManager: () => B,
252
+ getExternalPlugins: q,
253
253
  getCollaboration: () => void 0,
254
254
  getCollaborationModules: () => null,
255
255
  getPrecomputedInitialState: () => null,
256
256
  getReadOnly: () => o(u),
257
- getDocumentKey: () => o(v),
258
- getDocumentContext: () => A.value,
259
- onTransaction: Be,
257
+ getDocumentKey: () => o(se),
258
+ getDocumentContext: () => j.value,
259
+ onTransaction: ze,
260
260
  onSelectionChange: (e) => {
261
- M.value = e, xe?.(e), K.emit("selectionChange", {
261
+ N.value = e, xe?.(e), J.emit("selectionChange", {
262
262
  from: e.selection.from,
263
263
  to: e.selection.to
264
264
  });
265
265
  },
266
266
  onKeyDown: () => !1,
267
- onReadOnlyEditAttempt: () => E?.(),
268
- onEditorViewReady: Ve,
267
+ onReadOnlyEditAttempt: () => D?.(),
268
+ onEditorViewReady: Be,
269
269
  onEditorViewDestroy: () => {
270
- j.value = null, I.value = !1, T?.(null);
270
+ M.value = null, L.value = !1, E?.(null);
271
271
  },
272
272
  onRemoteSelectionsChange: () => {}
273
273
  });
274
- function Be(e, t) {
275
- M.value = t, e.docChanged && (R.value = !0, q.incrementStateSeq(), Y.schedule(t, le(e)), ze()), q.requestRender();
274
+ function ze(e, t) {
275
+ N.value = t, e.docChanged && (z.value = !0, Y.incrementStateSeq(), Z.schedule(t, de(e)), Re()), Y.requestRender();
276
276
  }
277
- function Ve(e) {
278
- j.value = e, M.value = e.state, I.value = !0, J(e.state, { reason: "initial" }), q.requestRender(), Ue(e), T?.(e), o(u) || requestAnimationFrame(() => {
279
- j.value === e && e.focus();
277
+ function Be(e) {
278
+ M.value = e, N.value = e.state, L.value = !0, X(e.state, { reason: "initial" }), Y.requestRender(), He(e), E?.(e), o(u) || requestAnimationFrame(() => {
279
+ M.value === e && e.focus();
280
280
  });
281
281
  }
282
- let He = h({
283
- getEditorApi: () => Z.api,
284
- getLayout: () => N.value,
285
- runLayout: (e, t) => J(e, t),
286
- emitter: K
282
+ let Ve = h({
283
+ getEditorApi: () => $.api,
284
+ getLayout: () => P.value,
285
+ runLayout: (e, t) => X(e, t),
286
+ emitter: J
287
287
  });
288
- function Ue(e) {
289
- m(o(y) === "suggesting", e.state, e.dispatch, o(x));
288
+ function He(e) {
289
+ m(o(y) === "suggesting", e.state, e.dispatch, o(b));
290
290
  }
291
- s([() => o(y), () => o(x)], () => {
292
- let e = j.value;
293
- e && Ue(e);
294
- }), s(() => o(u), () => Z.syncEditable());
295
- function We(e) {
296
- let t = G();
297
- if (t === e.state.plugins.includes(H)) return;
298
- let n = e.state.plugins.filter((e) => e !== H && e !== U);
291
+ s([() => o(y), () => o(b)], () => {
292
+ let e = M.value;
293
+ e && He(e);
294
+ }), s(() => o(u), () => $.syncEditable());
295
+ function Ue(e) {
296
+ let t = K();
297
+ if (t === e.state.plugins.includes(U)) return;
298
+ let n = e.state.plugins.filter((e) => e !== U && e !== W);
299
299
  if (t) {
300
- let e = n.indexOf(W), t = e === -1 ? n.length : e;
301
- n.splice(t, 0, H, U);
300
+ let e = n.indexOf(G), t = e === -1 ? n.length : e;
301
+ n.splice(t, 0, U, W);
302
302
  }
303
303
  e.updateState(e.state.reconfigure({ plugins: n }));
304
304
  }
305
- s(() => G(), () => {
306
- let e = j.value;
307
- e && We(e);
305
+ s(() => K(), () => {
306
+ let e = M.value;
307
+ e && Ue(e);
308
308
  });
309
- function Ge() {
310
- Z.ensureView();
309
+ function We() {
310
+ $.ensureView();
311
311
  }
312
- function Q() {
313
- R.value = !1, Y.dispose(), Z.destroyView(), Z.ensureView(), Z.getView() || Ke();
312
+ function Ge() {
313
+ z.value = !1, Z.dispose(), $.destroyView(), $.ensureView(), $.getView() || Ke();
314
314
  }
315
315
  function Ke() {
316
- let e = A.value;
316
+ let e = j.value;
317
317
  if (e) try {
318
318
  let t = te({
319
319
  document: e,
320
320
  styles: e.package.styles ?? null,
321
- manager: z,
322
- externalPlugins: Pe(),
321
+ manager: B,
322
+ externalPlugins: q(),
323
323
  collaborationModules: null,
324
324
  reason: "mount"
325
325
  });
326
- M.value = t, J(t, { reason: "initial" });
326
+ N.value = t, X(t, { reason: "initial" });
327
327
  } catch (e) {
328
- w?.(e instanceof Error ? e : Error(String(e)));
328
+ T?.(e instanceof Error ? e : Error(String(e)));
329
329
  }
330
330
  }
331
331
  s([t, n], () => {
332
- t.value && A.value && !Z.getView() && Ge();
332
+ t.value && j.value && !$.getView() && We();
333
333
  }, { flush: "post" });
334
334
  async function qe(e) {
335
- L.value = null, I.value = !1;
335
+ R.value = null, L.value = !1;
336
336
  try {
337
- A.value = await oe(e), Q();
337
+ j.value = await oe(e, { password: o(ce) }), Ge();
338
338
  } catch (e) {
339
339
  let t = e instanceof Error ? e : Error(String(e));
340
- L.value = t.message, w?.(t);
340
+ R.value = t.message, T?.(t);
341
341
  }
342
342
  }
343
343
  function Je(e) {
344
- L.value = null, A.value = e, Q();
344
+ R.value = null, j.value = e, Ge();
345
345
  }
346
346
  async function Ye(e) {
347
- let t = j.value, n = A.value;
347
+ let t = M.value, n = j.value;
348
348
  if (!t || !n) return null;
349
- let r = t.state, { resolveSelectiveSaveFlags: i } = await import("@stll/folio-core/docx/selectiveSaveFlags"), a = i(o(D)), s = b(r.doc, n), c = s.originalBuffer ?? null, l = a.selectiveSave && e?.selective !== !1, u = l || a.selectiveSaveTripwire, { repackDocx: d, createDocx: f } = await import("@stll/folio-core/docx/rezip"), p = null;
349
+ let r = t.state, { resolveSelectiveSaveFlags: i } = await import("@stll/folio-core/docx/selectiveSaveFlags"), a = i(o(O)), s = v(r.doc, n), c = s.originalBuffer ?? null, l = a.selectiveSave && e?.selective !== !1, u = l || a.selectiveSaveTripwire, { repackDocx: d, createDocx: f } = await import("@stll/folio-core/docx/rezip"), p = null;
350
350
  if (u && c) {
351
351
  let { attemptSelectiveSave: e } = await import("@stll/folio-core/docx/selectiveSave");
352
352
  p = await e(s, c, {
353
- changedParaIds: de(r),
354
- structuralChange: fe(r),
355
- hasUntrackedChanges: pe(r),
353
+ changedParaIds: pe(r),
354
+ structuralChange: me(r),
355
+ hasUntrackedChanges: he(r),
356
356
  maxBytes: a.selectiveSaveMaxBytes
357
357
  });
358
358
  }
@@ -361,41 +361,41 @@ function j(e) {
361
361
  else if (a.selectiveSaveTripwire) try {
362
362
  h = await d(s);
363
363
  } catch {}
364
- if (a.selectiveSaveTripwire && h && O) try {
364
+ if (a.selectiveSaveTripwire && h && A) try {
365
365
  let { compareSelectiveVsFull: e } = await import("@stll/folio-core/docx/selectiveSaveTripwire");
366
- O(await e(p, h));
366
+ A(await e(p, h));
367
367
  } catch {}
368
- return R.value = !1, new Blob([m], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" });
368
+ return z.value = !1, new Blob([m], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" });
369
369
  }
370
370
  function Xe() {
371
- return A.value;
371
+ return j.value;
372
372
  }
373
373
  function Ze(e) {
374
- A.value = e;
374
+ j.value = e;
375
375
  }
376
376
  function Qe() {
377
- return z.getCommands();
377
+ return B.getCommands();
378
378
  }
379
379
  function $e() {
380
- j.value?.focus();
380
+ M.value?.focus();
381
381
  }
382
382
  function et() {
383
- let e = j.value;
384
- e && J(e.state, { reason: "manual" });
385
- }
386
- function $() {
387
- Y.dispose(), X !== null && (window.clearTimeout(X), X = null), Z.destroyView(), z.destroy(), M.value = null, N.value = null, A.value = null, I.value = !1;
388
- }
389
- return r($), {
390
- editor: He,
391
- editorView: j,
392
- editorState: M,
393
- isReady: I,
394
- isDirty: R,
395
- parseError: L,
396
- layout: N,
397
- blocks: P,
398
- measures: F,
383
+ let e = M.value;
384
+ e && X(e.state, { reason: "manual" });
385
+ }
386
+ function tt() {
387
+ Z.dispose(), Q !== null && (window.clearTimeout(Q), Q = null), $.destroyView(), B.destroy(), N.value = null, P.value = null, j.value = null, L.value = !1;
388
+ }
389
+ return r(tt), {
390
+ editor: Ve,
391
+ editorView: M,
392
+ editorState: N,
393
+ isReady: L,
394
+ isDirty: z,
395
+ parseError: R,
396
+ layout: P,
397
+ blocks: F,
398
+ measures: I,
399
399
  loadBuffer: qe,
400
400
  loadDocument: Je,
401
401
  save: Ye,
@@ -404,7 +404,7 @@ function j(e) {
404
404
  getCommands: Qe,
405
405
  focus: $e,
406
406
  reLayout: et,
407
- destroy: $
407
+ destroy: tt
408
408
  };
409
409
  }
410
410
  function M(e, t) {
@@ -425,7 +425,7 @@ function N({ pagesContainer: e, onScrollExtendSelection: t }) {
425
425
  function c() {
426
426
  if (s) return s;
427
427
  let t = e.value;
428
- return t ? (s = x(t), s) : null;
428
+ return t ? (s = y(t), s) : null;
429
429
  }
430
430
  function l() {
431
431
  o = !1, n !== null && (cancelAnimationFrame(n), n = null);
@@ -494,8 +494,8 @@ function P() {
494
494
  r.preventDefault();
495
495
  let t = r.clientX - e.startX, n = parseFloat(e.handle.style.left);
496
496
  e.handle.style.left = `${n + t}px`, e.startX = r.clientX;
497
- let i = Math.round(t * C), a = e.origWidths.left + i, o = e.origWidths.right - i;
498
- a >= S && o >= S && (e.origWidths = {
497
+ let i = Math.round(t * x), a = e.origWidths.left + i, o = e.origWidths.right - i;
498
+ a >= b && o >= b && (e.origWidths = {
499
499
  left: a,
500
500
  right: o
501
501
  });
@@ -505,21 +505,21 @@ function P() {
505
505
  r.preventDefault();
506
506
  let e = r.clientY - t.startY, n = parseFloat(t.handle.style.top);
507
507
  t.handle.style.top = `${n + e}px`, t.startY = r.clientY;
508
- let i = Math.round(e * C), a = t.origHeight + i;
509
- a >= _e && (t.origHeight = a);
508
+ let i = Math.round(e * x), a = t.origHeight + i;
509
+ a >= ye && (t.origHeight = a);
510
510
  return;
511
511
  }
512
512
  if (n.active && n.handle) {
513
513
  r.preventDefault();
514
514
  let e = r.clientX - n.startX, t = parseFloat(n.handle.style.left);
515
515
  n.handle.style.left = `${t + e}px`, n.startX = r.clientX;
516
- let i = Math.round(e * C), a = n.origWidth + i;
517
- a >= S && (n.origWidth = a);
516
+ let i = Math.round(e * x), a = n.origWidth + i;
517
+ a >= b && (n.origWidth = a);
518
518
  }
519
519
  }
520
520
  function s(i) {
521
521
  if (e.active) {
522
- e.active = !1, e.handle?.classList.remove("dragging"), r && ve(r, {
522
+ e.active = !1, e.handle?.classList.remove("dragging"), r && be(r, {
523
523
  pmStart: e.tablePmStart,
524
524
  colIdx: e.columnIndex,
525
525
  newLeft: e.origWidths.left,
@@ -528,14 +528,14 @@ function P() {
528
528
  return;
529
529
  }
530
530
  if (t.active) {
531
- t.active = !1, t.handle?.classList.remove("dragging"), r && be(r, {
531
+ t.active = !1, t.handle?.classList.remove("dragging"), r && C(r, {
532
532
  pmStart: t.tablePmStart,
533
533
  rowIdx: t.rowIndex,
534
534
  newHeight: t.origHeight
535
535
  }), t.handle = null;
536
536
  return;
537
537
  }
538
- n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r && ye(r, {
538
+ n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r && S(r, {
539
539
  pmStart: n.tablePmStart,
540
540
  colIdx: n.columnIndex,
541
541
  newWidth: n.origWidth
@@ -553,17 +553,17 @@ function P() {
553
553
  };
554
554
  }
555
555
  function F(e, t) {
556
- let n = xe(e, t.tablePmStart, t.columnIndex);
556
+ let n = T(e, t.tablePmStart, t.columnIndex);
557
557
  n && (t.origWidths = n);
558
558
  }
559
559
  function I(e, t, n) {
560
- let r = T(e, t.tablePmStart, t.rowIndex);
560
+ let r = xe(e, t.tablePmStart, t.rowIndex);
561
561
  if (r != null) {
562
562
  t.origHeight = r;
563
563
  return;
564
564
  }
565
565
  let i = n.closest(".layout-table")?.querySelector(`[data-row-index="${t.rowIndex}"]`), a = i ? i.getBoundingClientRect().height : 30;
566
- t.origHeight = Math.round(a * C);
566
+ t.origHeight = Math.round(a * x);
567
567
  }
568
568
  function L(e, t) {
569
569
  let n = w(e, t.tablePmStart, t.columnIndex);
@@ -0,0 +1,14 @@
1
+ import { Node as PMNode } from 'prosemirror-model';
2
+ import { Layout } from '@stll/folio-core/layout-engine';
3
+ /**
4
+ * The plain text of a single rendered page (1-based), read by joining each of
5
+ * the page's layout fragments' `[pmStart, pmEnd)` document text with a
6
+ * newline. Fragments with no `pmStart`/`pmEnd` (e.g. a page-shell placeholder)
7
+ * are skipped. Returns `null` when the layout hasn't been computed yet or the
8
+ * page number is out of range.
9
+ *
10
+ * Mirrors `@stll/folio-react`'s `components/pageText.ts`; kept as a separate
11
+ * file rather than shared so `@stll/folio-vue` doesn't cross-import the React
12
+ * package.
13
+ */
14
+ export declare const getPageTextFromLayout: (layout: Layout | null, doc: PMNode, page: number) => string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/folio-vue",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Vue 3 editor for folio: a Word-document (.docx) editor for the browser, built on @stll/folio-core and ProseMirror.",
5
5
  "keywords": [
6
6
  "document-editor",