@eigenpal/docx-editor-core 1.3.0 → 1.3.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/chunk-4MYKVWNF.js +1 -0
- package/dist/{chunk-Q5B5GKXD.mjs → chunk-55XWETY4.mjs} +1 -1
- package/dist/chunk-6QO4O52Y.mjs +1 -0
- package/dist/chunk-DE2V4X3B.mjs +1 -0
- package/dist/{chunk-TJRROR6U.js → chunk-DG2CMDSM.js} +1 -1
- package/dist/chunk-HPJBZL37.mjs +1 -0
- package/dist/{chunk-TURYWKNS.js → chunk-J3YFJDZD.js} +1 -1
- package/dist/chunk-JHTURDPX.mjs +1 -0
- package/dist/chunk-LX35TFGF.mjs +1 -0
- package/dist/chunk-NRWQ65NX.js +1 -0
- package/dist/{chunk-WDBZ3QVB.js → chunk-QLAIOTQB.js} +1 -1
- package/dist/chunk-RSU4HTC6.js +1 -0
- package/dist/{chunk-L6YTCHOQ.mjs → chunk-W7CQRQZ6.mjs} +1 -1
- package/dist/chunk-YGWUKRFD.mjs +1 -0
- package/dist/chunk-YM7SMTYY.js +1 -0
- package/dist/chunk-YPKIQMPR.js +1 -0
- package/dist/core.d.mts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/editor/index.d.mts +128 -0
- package/dist/editor/index.d.ts +128 -0
- package/dist/editor/index.js +1 -0
- package/dist/editor/index.mjs +1 -0
- package/dist/{footnotes-BtVc6VFl.d.mts → footnotes-BZ24OTAT.d.mts} +11 -1
- package/dist/{footnotes-DcUMWXul.d.ts → footnotes-DMsicPGd.d.ts} +11 -1
- package/dist/{headerFooterLayout-4E-S4Aay.d.ts → headerFooterLayout-AtAOhM8E.d.ts} +18 -2
- package/dist/{headerFooterLayout-DlJLWmpR.d.mts → headerFooterLayout-CU6hvszp.d.mts} +18 -2
- package/dist/layout-bridge/clickToPositionDom.js +1 -1
- package/dist/layout-bridge/clickToPositionDom.mjs +1 -1
- package/dist/layout-bridge/index.d.mts +109 -5
- package/dist/layout-bridge/index.d.ts +109 -5
- package/dist/layout-bridge/index.js +1 -1
- package/dist/layout-bridge/index.mjs +1 -1
- package/dist/layout-bridge/measuring/index.d.mts +5 -95
- package/dist/layout-bridge/measuring/index.d.ts +5 -95
- package/dist/layout-bridge/measuring/index.js +1 -1
- package/dist/layout-bridge/measuring/index.mjs +1 -1
- package/dist/layout-bridge/tableInsertHover.js +1 -1
- package/dist/layout-bridge/tableInsertHover.mjs +1 -1
- package/dist/layout-engine/index.js +1 -1
- package/dist/layout-engine/index.mjs +1 -1
- package/dist/layout-painter/index.d.mts +2 -2
- package/dist/layout-painter/index.d.ts +2 -2
- package/dist/layout-painter/index.js +1 -1
- package/dist/layout-painter/index.mjs +1 -1
- package/dist/layout-painter/renderPage.d.mts +8 -3
- package/dist/layout-painter/renderPage.d.ts +8 -3
- package/dist/layout-painter/renderPage.js +1 -1
- package/dist/layout-painter/renderPage.mjs +1 -1
- package/dist/measureBlocksPipeline-BMqbRFQB.d.mts +96 -0
- package/dist/measureBlocksPipeline-iYNzAH-o.d.ts +96 -0
- package/dist/prosemirror/applyFormatting.d.mts +67 -0
- package/dist/prosemirror/applyFormatting.d.ts +67 -0
- package/dist/prosemirror/applyFormatting.js +1 -0
- package/dist/prosemirror/applyFormatting.mjs +1 -0
- package/dist/prosemirror/commentIdAllocator.d.mts +50 -0
- package/dist/prosemirror/commentIdAllocator.d.ts +50 -0
- package/dist/prosemirror/commentIdAllocator.js +1 -0
- package/dist/prosemirror/commentIdAllocator.mjs +1 -0
- package/dist/prosemirror/commentOps.d.mts +46 -0
- package/dist/prosemirror/commentOps.d.ts +46 -0
- package/dist/prosemirror/commentOps.js +1 -0
- package/dist/prosemirror/commentOps.mjs +1 -0
- package/dist/prosemirror/imageCommit.d.mts +35 -0
- package/dist/prosemirror/imageCommit.d.ts +35 -0
- package/dist/prosemirror/imageCommit.js +1 -0
- package/dist/prosemirror/imageCommit.mjs +1 -0
- package/dist/prosemirror/paraText.d.mts +52 -0
- package/dist/prosemirror/paraText.d.ts +52 -0
- package/dist/prosemirror/paraText.js +1 -0
- package/dist/prosemirror/paraText.mjs +1 -0
- package/dist/prosemirror/queries.d.mts +65 -0
- package/dist/prosemirror/queries.d.ts +65 -0
- package/dist/prosemirror/queries.js +2 -0
- package/dist/prosemirror/queries.mjs +2 -0
- package/dist/prosemirror/tableResize.d.mts +58 -0
- package/dist/prosemirror/tableResize.d.ts +58 -0
- package/dist/prosemirror/tableResize.js +1 -0
- package/dist/prosemirror/tableResize.mjs +1 -0
- package/dist/utils/autoScroll.d.mts +24 -0
- package/dist/utils/autoScroll.d.ts +24 -0
- package/dist/utils/autoScroll.js +1 -0
- package/dist/utils/autoScroll.mjs +1 -0
- package/package.json +73 -1
- package/dist/chunk-72KLR6TJ.mjs +0 -1
- package/dist/chunk-7JQVKJRN.mjs +0 -1
- package/dist/chunk-7WGN2OBZ.js +0 -1
- package/dist/chunk-JUMHC5Z6.mjs +0 -1
- package/dist/chunk-MEVZCB56.mjs +0 -1
- package/dist/chunk-T4RYVPAB.js +0 -1
- package/dist/chunk-XWC67YLW.js +0 -1
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* @public
|
|
12
12
|
*/
|
|
13
13
|
import '../layout-engine/types.js';
|
|
14
|
-
export { B as BlockLookup, a as BlockLookupEntry, F as FRAGMENT_CLASS_NAMES, I as IMAGE_CLASS_NAMES, b as IMAGE_LAYOUT_OPTIONS, c as ImageHitTestResult, d as ImageLayoutIconHint, e as ImageLayoutOptionDef, L as LAYOUT_IMAGE_CLASSES, f as LayoutPainter, P as PainterOptions, RenderContext, RenderPageOptions, RenderPagesUpdateKind, T as TABLE_CLASS_NAMES, g as TEXTBOX_CLASS_NAMES, h as applySdtFocus, i as
|
|
14
|
+
export { B as BlockLookup, a as BlockLookupEntry, F as FRAGMENT_CLASS_NAMES, I as IMAGE_CLASS_NAMES, b as IMAGE_LAYOUT_OPTIONS, c as ImageHitTestResult, d as ImageLayoutIconHint, e as ImageLayoutOptionDef, L as LAYOUT_IMAGE_CLASSES, f as LayoutPainter, P as PainterOptions, RenderContext, RenderPageOptions, RenderPagesUpdateKind, T as TABLE_CLASS_NAMES, g as TEXTBOX_CLASS_NAMES, h as applySdtFocus, i as buildBlockLookup, j as captureInlinePositionEmu, k as createPainter, l as deriveLayoutChoice, m as enclosingSdtGroupIds, n as findImageElement, o as hitTestImage, isFloatingImageRun, p as isImageLayoutOptionEnabled, isTextWrappingFloatingImageRun, renderAllPagesNow, r as renderFragment, q as renderImageFragment, s as renderLine, renderPage, renderPages, t as renderParagraphFragment, u as renderTableFragment, v as renderTextBoxFragment, w as sliceRunsForLine, x as toolbarValueToLayoutTarget } from './renderPage.js';
|
|
15
15
|
export { P as PageGeometry, p as pageGeometryFromPage, r as resolveAnchoredObjectPosition, a as resolveAnchoredObjectVerticalTop } from '../anchoredObjectPosition-CS-8BfhO.js';
|
|
16
|
-
export { F as FootnoteRenderItem, H as HeaderFooterContent } from '../footnotes-
|
|
16
|
+
export { F as FootnoteRenderItem, H as HeaderFooterContent } from '../footnotes-DMsicPGd.js';
|
|
17
17
|
import '../content-C8fc_tL6.js';
|
|
18
18
|
import '../formatting-_OXU8gLB.js';
|
|
19
19
|
import '../colors-C3vA7HUU.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkYPKIQMPR_js=require('../chunk-YPKIQMPR.js'),chunkQLAIOTQB_js=require('../chunk-QLAIOTQB.js');require('../chunk-FQS436KN.js');var chunkJ3YFJDZD_js=require('../chunk-J3YFJDZD.js');require('../chunk-RSU4HTC6.js'),require('../chunk-IMKU4O3P.js'),require('../chunk-DROCYKAR.js'),require('../chunk-LERLET2D.js'),require('../chunk-FIGLFSNR.js'),require('../chunk-BUCOTKYY.js'),require('../chunk-C45EFOVP.js'),require('../chunk-ISKTBM4L.js'),require('../chunk-JFZIXFRC.js'),require('../chunk-RQVHKDXK.js'),require('../chunk-SCK6ZM5V.js'),require('../chunk-Z3LGMBJC.js'),require('../chunk-3R7QHNI5.js'),require('../chunk-WWBNJ7KF.js'),require('../chunk-4RTVLMRZ.js'),require('../chunk-BHBOAP6Z.js'),require('../chunk-MZ7LW5CH.js'),require('../chunk-N3Y5BUKV.js'),require('../chunk-WVERBZZU.js'),require('../chunk-6LVPRTB6.js'),require('../chunk-LWH66Q7Q.js'),require('../chunk-TUIEV7Q7.js'),require('../chunk-7HANRHHL.js'),require('../chunk-MJ5FQX7Q.js'),require('../chunk-C2BAPYGJ.js'),require('../chunk-4Q2IP5FW.js'),require('../chunk-GSKMHXHG.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"IMAGE_LAYOUT_OPTIONS",{enumerable:true,get:function(){return chunkYPKIQMPR_js.f}});Object.defineProperty(exports,"LAYOUT_IMAGE_CLASSES",{enumerable:true,get:function(){return chunkYPKIQMPR_js.a}});Object.defineProperty(exports,"LayoutPainter",{enumerable:true,get:function(){return chunkYPKIQMPR_js.j}});Object.defineProperty(exports,"buildBlockLookup",{enumerable:true,get:function(){return chunkYPKIQMPR_js.i}});Object.defineProperty(exports,"captureInlinePositionEmu",{enumerable:true,get:function(){return chunkYPKIQMPR_js.d}});Object.defineProperty(exports,"createPainter",{enumerable:true,get:function(){return chunkYPKIQMPR_js.k}});Object.defineProperty(exports,"deriveLayoutChoice",{enumerable:true,get:function(){return chunkYPKIQMPR_js.e}});Object.defineProperty(exports,"findImageElement",{enumerable:true,get:function(){return chunkYPKIQMPR_js.c}});Object.defineProperty(exports,"hitTestImage",{enumerable:true,get:function(){return chunkYPKIQMPR_js.b}});Object.defineProperty(exports,"isImageLayoutOptionEnabled",{enumerable:true,get:function(){return chunkYPKIQMPR_js.g}});Object.defineProperty(exports,"toolbarValueToLayoutTarget",{enumerable:true,get:function(){return chunkYPKIQMPR_js.h}});Object.defineProperty(exports,"FRAGMENT_CLASS_NAMES",{enumerable:true,get:function(){return chunkQLAIOTQB_js.n}});Object.defineProperty(exports,"IMAGE_CLASS_NAMES",{enumerable:true,get:function(){return chunkQLAIOTQB_js.p}});Object.defineProperty(exports,"TABLE_CLASS_NAMES",{enumerable:true,get:function(){return chunkQLAIOTQB_js.v}});Object.defineProperty(exports,"TEXTBOX_CLASS_NAMES",{enumerable:true,get:function(){return chunkQLAIOTQB_js.x}});Object.defineProperty(exports,"applySdtFocus",{enumerable:true,get:function(){return chunkQLAIOTQB_js.m}});Object.defineProperty(exports,"enclosingSdtGroupIds",{enumerable:true,get:function(){return chunkQLAIOTQB_js.l}});Object.defineProperty(exports,"renderAllPagesNow",{enumerable:true,get:function(){return chunkQLAIOTQB_js.C}});Object.defineProperty(exports,"renderFragment",{enumerable:true,get:function(){return chunkQLAIOTQB_js.o}});Object.defineProperty(exports,"renderImageFragment",{enumerable:true,get:function(){return chunkQLAIOTQB_js.q}});Object.defineProperty(exports,"renderLine",{enumerable:true,get:function(){return chunkQLAIOTQB_js.s}});Object.defineProperty(exports,"renderPage",{enumerable:true,get:function(){return chunkQLAIOTQB_js.F}});Object.defineProperty(exports,"renderPages",{enumerable:true,get:function(){return chunkQLAIOTQB_js.B}});Object.defineProperty(exports,"renderParagraphFragment",{enumerable:true,get:function(){return chunkQLAIOTQB_js.t}});Object.defineProperty(exports,"renderTableFragment",{enumerable:true,get:function(){return chunkQLAIOTQB_js.w}});Object.defineProperty(exports,"renderTextBoxFragment",{enumerable:true,get:function(){return chunkQLAIOTQB_js.y}});Object.defineProperty(exports,"sliceRunsForLine",{enumerable:true,get:function(){return chunkQLAIOTQB_js.r}});Object.defineProperty(exports,"isFloatingImageRun",{enumerable:true,get:function(){return chunkJ3YFJDZD_js.c}});Object.defineProperty(exports,"isTextWrappingFloatingImageRun",{enumerable:true,get:function(){return chunkJ3YFJDZD_js.d}});Object.defineProperty(exports,"pageGeometryFromPage",{enumerable:true,get:function(){return chunkJ3YFJDZD_js.f}});Object.defineProperty(exports,"resolveAnchoredObjectPosition",{enumerable:true,get:function(){return chunkJ3YFJDZD_js.g}});Object.defineProperty(exports,"resolveAnchoredObjectVerticalTop",{enumerable:true,get:function(){return chunkJ3YFJDZD_js.h}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{f as IMAGE_LAYOUT_OPTIONS,a as LAYOUT_IMAGE_CLASSES,j as LayoutPainter,i as buildBlockLookup,d as captureInlinePositionEmu,k as createPainter,e as deriveLayoutChoice,c as findImageElement,b as hitTestImage,g as isImageLayoutOptionEnabled,h as toolbarValueToLayoutTarget}from'../chunk-DE2V4X3B.mjs';export{n as FRAGMENT_CLASS_NAMES,p as IMAGE_CLASS_NAMES,v as TABLE_CLASS_NAMES,x as TEXTBOX_CLASS_NAMES,m as applySdtFocus,l as enclosingSdtGroupIds,C as renderAllPagesNow,o as renderFragment,q as renderImageFragment,s as renderLine,F as renderPage,B as renderPages,t as renderParagraphFragment,w as renderTableFragment,y as renderTextBoxFragment,r as sliceRunsForLine}from'../chunk-YGWUKRFD.mjs';import'../chunk-B46V5G46.mjs';export{c as isFloatingImageRun,d as isTextWrappingFloatingImageRun,f as pageGeometryFromPage,g as resolveAnchoredObjectPosition,h as resolveAnchoredObjectVerticalTop}from'../chunk-55XWETY4.mjs';import'../chunk-JHTURDPX.mjs';import'../chunk-FCJWLEKT.mjs';import'../chunk-7E5VBRDL.mjs';import'../chunk-3G44SFHX.mjs';import'../chunk-MOCGHQ4A.mjs';import'../chunk-IUVQJ6PX.mjs';import'../chunk-7OW3VCZE.mjs';import'../chunk-LK6I3HMH.mjs';import'../chunk-QPFJJPIC.mjs';import'../chunk-GYWTUUXX.mjs';import'../chunk-7CZEZ3UL.mjs';import'../chunk-W77JXDEV.mjs';import'../chunk-3ANZ3252.mjs';import'../chunk-4GFTMGSV.mjs';import'../chunk-SWBLJF6R.mjs';import'../chunk-MOKKS75W.mjs';import'../chunk-OZMNIX6U.mjs';import'../chunk-AMENZY5F.mjs';import'../chunk-U67MWOPZ.mjs';import'../chunk-BGY3CB37.mjs';import'../chunk-2XP6GLA4.mjs';import'../chunk-ZX26QZJ5.mjs';import'../chunk-MJ6XZFVD.mjs';import'../chunk-67LVRQIR.mjs';import'../chunk-LE67NTCN.mjs';import'../chunk-VW22RZ6C.mjs';import'../chunk-DI6CRWSW.mjs';import'../chunk-QYUPLKLP.mjs';
|
|
@@ -18,8 +18,8 @@ import { Node } from 'prosemirror-model';
|
|
|
18
18
|
import { I as ImageAttrs } from '../nodes-cEI7hVY2.mjs';
|
|
19
19
|
import { I as ImageLayoutTarget } from '../ImageExtension-BN327PNe.mjs';
|
|
20
20
|
import { WrapType } from '../docx/wrapTypes.mjs';
|
|
21
|
-
import { F as FootnoteRenderItem, H as HeaderFooterContent } from '../footnotes-
|
|
22
|
-
export { a as HeaderFooterLayoutInfo, r as resolveHeaderFooterFloatLeft, b as resolveHeaderFooterFloatingTablePosition } from '../footnotes-
|
|
21
|
+
import { F as FootnoteRenderItem, H as HeaderFooterContent } from '../footnotes-BZ24OTAT.mjs';
|
|
22
|
+
export { a as HeaderFooterLayoutInfo, r as resolveHeaderFooterFloatLeft, b as resolveHeaderFooterFloatingTablePosition } from '../footnotes-BZ24OTAT.mjs';
|
|
23
23
|
import { B as BorderSpec } from '../colors-C3vA7HUU.mjs';
|
|
24
24
|
import { W as Watermark } from '../watermark-DAcnAs_J.mjs';
|
|
25
25
|
import { T as Theme } from '../styles-BOJ93SAm.mjs';
|
|
@@ -638,6 +638,11 @@ interface BlockLookupEntry {
|
|
|
638
638
|
* Block lookup map type
|
|
639
639
|
*/
|
|
640
640
|
type BlockLookup = Map<string, BlockLookupEntry>;
|
|
641
|
+
/**
|
|
642
|
+
* Build the painter's `block.id → { block, measure }` lookup from the parallel
|
|
643
|
+
* blocks/measures arrays. Shared by both adapters' paint step.
|
|
644
|
+
*/
|
|
645
|
+
declare function buildBlockLookup(blocks: FlowBlock[], measures: Measure[]): BlockLookup;
|
|
641
646
|
/**
|
|
642
647
|
* Painter options
|
|
643
648
|
*/
|
|
@@ -718,4 +723,4 @@ declare class LayoutPainter {
|
|
|
718
723
|
*/
|
|
719
724
|
declare function createPainter(options?: PainterOptions): LayoutPainter;
|
|
720
725
|
|
|
721
|
-
export { type BlockLookup as B, FRAGMENT_CLASS_NAMES as F, type FloatingImagePaintRecord, type FloatingImagesLayerOptions, FootnoteRenderItem, HeaderFooterContent, IMAGE_CLASS_NAMES as I, LAYOUT_IMAGE_CLASSES as L, type PainterOptions as P, PAGE_CLASS_NAMES, type RenderContext, type RenderPageOptions, type RenderPagesUpdateKind, TABLE_CLASS_NAMES as T, type BlockLookupEntry as a, applyPageStyles, IMAGE_LAYOUT_OPTIONS as b, type ImageHitTestResult as c, type ImageLayoutIconHint as d, type ImageLayoutOptionDef as e, LayoutPainter as f, floatingImageIsBehindDoc, floatingImageWrapsText, TEXTBOX_CLASS_NAMES as g, applySdtFocus as h,
|
|
726
|
+
export { type BlockLookup as B, FRAGMENT_CLASS_NAMES as F, type FloatingImagePaintRecord, type FloatingImagesLayerOptions, FootnoteRenderItem, HeaderFooterContent, IMAGE_CLASS_NAMES as I, LAYOUT_IMAGE_CLASSES as L, type PainterOptions as P, PAGE_CLASS_NAMES, type RenderContext, type RenderPageOptions, type RenderPagesUpdateKind, TABLE_CLASS_NAMES as T, type BlockLookupEntry as a, applyPageStyles, IMAGE_LAYOUT_OPTIONS as b, type ImageHitTestResult as c, type ImageLayoutIconHint as d, type ImageLayoutOptionDef as e, LayoutPainter as f, floatingImageIsBehindDoc, floatingImageWrapsText, TEXTBOX_CLASS_NAMES as g, applySdtFocus as h, buildBlockLookup as i, isFloatingImageRun, isTextWrappingFloatingImageRun, captureInlinePositionEmu as j, createPainter as k, deriveLayoutChoice as l, enclosingSdtGroupIds as m, findImageElement as n, hitTestImage as o, isImageLayoutOptionEnabled as p, renderImageFragment as q, renderFragment as r, renderAllPagesNow, renderFloatingImagesLayer, renderPage, renderPages, renderLine as s, renderParagraphFragment as t, renderTableFragment as u, renderTextBoxFragment as v, sliceRunsForLine as w, toolbarValueToLayoutTarget as x };
|
|
@@ -18,8 +18,8 @@ import { Node } from 'prosemirror-model';
|
|
|
18
18
|
import { I as ImageAttrs } from '../nodes-75Q9GBxV.js';
|
|
19
19
|
import { I as ImageLayoutTarget } from '../ImageExtension-BlI5afZD.js';
|
|
20
20
|
import { WrapType } from '../docx/wrapTypes.js';
|
|
21
|
-
import { F as FootnoteRenderItem, H as HeaderFooterContent } from '../footnotes-
|
|
22
|
-
export { a as HeaderFooterLayoutInfo, r as resolveHeaderFooterFloatLeft, b as resolveHeaderFooterFloatingTablePosition } from '../footnotes-
|
|
21
|
+
import { F as FootnoteRenderItem, H as HeaderFooterContent } from '../footnotes-DMsicPGd.js';
|
|
22
|
+
export { a as HeaderFooterLayoutInfo, r as resolveHeaderFooterFloatLeft, b as resolveHeaderFooterFloatingTablePosition } from '../footnotes-DMsicPGd.js';
|
|
23
23
|
import { B as BorderSpec } from '../colors-C3vA7HUU.js';
|
|
24
24
|
import { W as Watermark } from '../watermark-DAcnAs_J.js';
|
|
25
25
|
import { T as Theme } from '../styles-BWqX2AS-.js';
|
|
@@ -638,6 +638,11 @@ interface BlockLookupEntry {
|
|
|
638
638
|
* Block lookup map type
|
|
639
639
|
*/
|
|
640
640
|
type BlockLookup = Map<string, BlockLookupEntry>;
|
|
641
|
+
/**
|
|
642
|
+
* Build the painter's `block.id → { block, measure }` lookup from the parallel
|
|
643
|
+
* blocks/measures arrays. Shared by both adapters' paint step.
|
|
644
|
+
*/
|
|
645
|
+
declare function buildBlockLookup(blocks: FlowBlock[], measures: Measure[]): BlockLookup;
|
|
641
646
|
/**
|
|
642
647
|
* Painter options
|
|
643
648
|
*/
|
|
@@ -718,4 +723,4 @@ declare class LayoutPainter {
|
|
|
718
723
|
*/
|
|
719
724
|
declare function createPainter(options?: PainterOptions): LayoutPainter;
|
|
720
725
|
|
|
721
|
-
export { type BlockLookup as B, FRAGMENT_CLASS_NAMES as F, type FloatingImagePaintRecord, type FloatingImagesLayerOptions, FootnoteRenderItem, HeaderFooterContent, IMAGE_CLASS_NAMES as I, LAYOUT_IMAGE_CLASSES as L, type PainterOptions as P, PAGE_CLASS_NAMES, type RenderContext, type RenderPageOptions, type RenderPagesUpdateKind, TABLE_CLASS_NAMES as T, type BlockLookupEntry as a, applyPageStyles, IMAGE_LAYOUT_OPTIONS as b, type ImageHitTestResult as c, type ImageLayoutIconHint as d, type ImageLayoutOptionDef as e, LayoutPainter as f, floatingImageIsBehindDoc, floatingImageWrapsText, TEXTBOX_CLASS_NAMES as g, applySdtFocus as h,
|
|
726
|
+
export { type BlockLookup as B, FRAGMENT_CLASS_NAMES as F, type FloatingImagePaintRecord, type FloatingImagesLayerOptions, FootnoteRenderItem, HeaderFooterContent, IMAGE_CLASS_NAMES as I, LAYOUT_IMAGE_CLASSES as L, type PainterOptions as P, PAGE_CLASS_NAMES, type RenderContext, type RenderPageOptions, type RenderPagesUpdateKind, TABLE_CLASS_NAMES as T, type BlockLookupEntry as a, applyPageStyles, IMAGE_LAYOUT_OPTIONS as b, type ImageHitTestResult as c, type ImageLayoutIconHint as d, type ImageLayoutOptionDef as e, LayoutPainter as f, floatingImageIsBehindDoc, floatingImageWrapsText, TEXTBOX_CLASS_NAMES as g, applySdtFocus as h, buildBlockLookup as i, isFloatingImageRun, isTextWrappingFloatingImageRun, captureInlinePositionEmu as j, createPainter as k, deriveLayoutChoice as l, enclosingSdtGroupIds as m, findImageElement as n, hitTestImage as o, isImageLayoutOptionEnabled as p, renderImageFragment as q, renderFragment as r, renderAllPagesNow, renderFloatingImagesLayer, renderPage, renderPages, renderLine as s, renderParagraphFragment as t, renderTableFragment as u, renderTextBoxFragment as v, sliceRunsForLine as w, toolbarValueToLayoutTarget as x };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkQLAIOTQB_js=require('../chunk-QLAIOTQB.js');require('../chunk-FQS436KN.js');var chunkJ3YFJDZD_js=require('../chunk-J3YFJDZD.js');require('../chunk-RSU4HTC6.js'),require('../chunk-IMKU4O3P.js'),require('../chunk-DROCYKAR.js'),require('../chunk-LERLET2D.js'),require('../chunk-FIGLFSNR.js'),require('../chunk-BUCOTKYY.js'),require('../chunk-C45EFOVP.js'),require('../chunk-ISKTBM4L.js'),require('../chunk-JFZIXFRC.js'),require('../chunk-RQVHKDXK.js'),require('../chunk-SCK6ZM5V.js'),require('../chunk-Z3LGMBJC.js'),require('../chunk-3R7QHNI5.js'),require('../chunk-WWBNJ7KF.js'),require('../chunk-4RTVLMRZ.js'),require('../chunk-BHBOAP6Z.js'),require('../chunk-MZ7LW5CH.js'),require('../chunk-N3Y5BUKV.js'),require('../chunk-WVERBZZU.js'),require('../chunk-6LVPRTB6.js'),require('../chunk-LWH66Q7Q.js'),require('../chunk-TUIEV7Q7.js'),require('../chunk-7HANRHHL.js'),require('../chunk-MJ5FQX7Q.js'),require('../chunk-C2BAPYGJ.js'),require('../chunk-4Q2IP5FW.js'),require('../chunk-GSKMHXHG.js'),require('../chunk-DC7S76ZX.js');Object.defineProperty(exports,"PAGE_CLASS_NAMES",{enumerable:true,get:function(){return chunkQLAIOTQB_js.D}});Object.defineProperty(exports,"applyPageStyles",{enumerable:true,get:function(){return chunkQLAIOTQB_js.E}});Object.defineProperty(exports,"renderAllPagesNow",{enumerable:true,get:function(){return chunkQLAIOTQB_js.C}});Object.defineProperty(exports,"renderFloatingImagesLayer",{enumerable:true,get:function(){return chunkQLAIOTQB_js.u}});Object.defineProperty(exports,"renderPage",{enumerable:true,get:function(){return chunkQLAIOTQB_js.F}});Object.defineProperty(exports,"renderPages",{enumerable:true,get:function(){return chunkQLAIOTQB_js.B}});Object.defineProperty(exports,"resolveHeaderFooterFloatLeft",{enumerable:true,get:function(){return chunkQLAIOTQB_js.z}});Object.defineProperty(exports,"resolveHeaderFooterFloatingTablePosition",{enumerable:true,get:function(){return chunkQLAIOTQB_js.A}});Object.defineProperty(exports,"floatingImageIsBehindDoc",{enumerable:true,get:function(){return chunkJ3YFJDZD_js.b}});Object.defineProperty(exports,"floatingImageWrapsText",{enumerable:true,get:function(){return chunkJ3YFJDZD_js.a}});Object.defineProperty(exports,"isFloatingImageRun",{enumerable:true,get:function(){return chunkJ3YFJDZD_js.c}});Object.defineProperty(exports,"isTextWrappingFloatingImageRun",{enumerable:true,get:function(){return chunkJ3YFJDZD_js.d}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{D as PAGE_CLASS_NAMES,E as applyPageStyles,C as renderAllPagesNow,u as renderFloatingImagesLayer,F as renderPage,B as renderPages,z as resolveHeaderFooterFloatLeft,A as resolveHeaderFooterFloatingTablePosition}from'../chunk-
|
|
1
|
+
export{D as PAGE_CLASS_NAMES,E as applyPageStyles,C as renderAllPagesNow,u as renderFloatingImagesLayer,F as renderPage,B as renderPages,z as resolveHeaderFooterFloatLeft,A as resolveHeaderFooterFloatingTablePosition}from'../chunk-YGWUKRFD.mjs';import'../chunk-B46V5G46.mjs';export{b as floatingImageIsBehindDoc,a as floatingImageWrapsText,c as isFloatingImageRun,d as isTextWrappingFloatingImageRun}from'../chunk-55XWETY4.mjs';import'../chunk-JHTURDPX.mjs';import'../chunk-FCJWLEKT.mjs';import'../chunk-7E5VBRDL.mjs';import'../chunk-3G44SFHX.mjs';import'../chunk-MOCGHQ4A.mjs';import'../chunk-IUVQJ6PX.mjs';import'../chunk-7OW3VCZE.mjs';import'../chunk-LK6I3HMH.mjs';import'../chunk-QPFJJPIC.mjs';import'../chunk-GYWTUUXX.mjs';import'../chunk-7CZEZ3UL.mjs';import'../chunk-W77JXDEV.mjs';import'../chunk-3ANZ3252.mjs';import'../chunk-4GFTMGSV.mjs';import'../chunk-SWBLJF6R.mjs';import'../chunk-MOKKS75W.mjs';import'../chunk-OZMNIX6U.mjs';import'../chunk-AMENZY5F.mjs';import'../chunk-U67MWOPZ.mjs';import'../chunk-BGY3CB37.mjs';import'../chunk-2XP6GLA4.mjs';import'../chunk-ZX26QZJ5.mjs';import'../chunk-MJ6XZFVD.mjs';import'../chunk-67LVRQIR.mjs';import'../chunk-LE67NTCN.mjs';import'../chunk-VW22RZ6C.mjs';import'../chunk-DI6CRWSW.mjs';import'../chunk-QYUPLKLP.mjs';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { WrapTextDirection, FlowBlock, Measure } from './layout-engine/types.mjs';
|
|
2
|
+
import { P as PageGeometry } from './anchoredObjectPosition-KJEyF-wr.mjs';
|
|
3
|
+
|
|
4
|
+
interface FloatingExclusionRect {
|
|
5
|
+
/** Which side the object is on for simple one-sided wrapping. */
|
|
6
|
+
side: 'left' | 'right';
|
|
7
|
+
/** X position relative to the content area. */
|
|
8
|
+
x: number;
|
|
9
|
+
/** Y position relative to the content area. */
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
distTop: number;
|
|
14
|
+
distBottom: number;
|
|
15
|
+
distLeft: number;
|
|
16
|
+
distRight: number;
|
|
17
|
+
wrapText?: WrapTextDirection;
|
|
18
|
+
wrapType?: string;
|
|
19
|
+
}
|
|
20
|
+
interface FloatingImageZone {
|
|
21
|
+
leftMargin: number;
|
|
22
|
+
rightMargin: number;
|
|
23
|
+
topY: number;
|
|
24
|
+
bottomY: number;
|
|
25
|
+
segments?: FloatingLineSegmentZone[];
|
|
26
|
+
/**
|
|
27
|
+
* Full-width vertical band (OOXML `topAndBottom` wrap): no text fits beside
|
|
28
|
+
* it, so any line overlapping `[topY, bottomY]` is pushed below the band.
|
|
29
|
+
*/
|
|
30
|
+
fullWidthBlock?: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface FloatingLineSegmentZone {
|
|
33
|
+
leftOffset: number;
|
|
34
|
+
availableWidth: number;
|
|
35
|
+
}
|
|
36
|
+
interface FloatingLineMargins {
|
|
37
|
+
leftMargin: number;
|
|
38
|
+
rightMargin: number;
|
|
39
|
+
segments?: FloatingLineSegmentZone[];
|
|
40
|
+
}
|
|
41
|
+
declare function rectsToFloatingZones(rects: FloatingExclusionRect[], contentWidth: number): FloatingImageZone[];
|
|
42
|
+
declare function getFloatingMargins(lineY: number, lineHeight: number, zones: FloatingImageZone[] | undefined, paragraphYOffset: number): FloatingLineMargins;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Floating-aware block measurement pipeline.
|
|
46
|
+
*
|
|
47
|
+
* Pre-scans a block list to extract exclusion zones from anchored images,
|
|
48
|
+
* floating tables, and floating text boxes; groups co-located floats so
|
|
49
|
+
* their combined exclusion applies starting from the earliest anchor; then
|
|
50
|
+
* walks the blocks calling the caller-supplied `measureBlock` with the
|
|
51
|
+
* active zones and cumulative Y at each step.
|
|
52
|
+
*
|
|
53
|
+
* Adapters (React, Vue) provide their own `measureBlock` so they can
|
|
54
|
+
* decide e.g. whether to cache paragraph measures. The orchestration,
|
|
55
|
+
* extraction, and grouping live here so both adapters stay in lockstep.
|
|
56
|
+
*
|
|
57
|
+
* @packageDocumentation
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Block-measurement callback shape passed to {@link measureBlocksWithFloats}.
|
|
63
|
+
* Adapters (React, Vue) supply this so they can decide platform-specific
|
|
64
|
+
* concerns (e.g. paragraph-measure caching, per-section width) while
|
|
65
|
+
* sharing the floating-zone orchestration. This is adapter-author API,
|
|
66
|
+
* not end-consumer API.
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
type MeasureBlockFn = (block: FlowBlock, contentWidth: number, floatingZones?: FloatingImageZone[], cumulativeY?: number) => Measure;
|
|
71
|
+
/**
|
|
72
|
+
* Page geometry (CSS px) used to resolve page/margin-relative anchored objects
|
|
73
|
+
* into content-area coordinates — currently the vertical anchor of a top-pinned
|
|
74
|
+
* `topAndBottom` band. Same shape the painter uses (see `pageGeometryFromPage`),
|
|
75
|
+
* so both paths resolve to identical positions.
|
|
76
|
+
*
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
type FloatPageGeometry = PageGeometry;
|
|
80
|
+
/**
|
|
81
|
+
* Walk `blocks` and produce one `Measure` per block. Before measuring, this
|
|
82
|
+
* extracts floating exclusion zones (images / floating tables / floating
|
|
83
|
+
* textboxes), groups overlapping co-located floats, and threads the active
|
|
84
|
+
* zones plus cumulative Y into each `measureBlock` call.
|
|
85
|
+
*
|
|
86
|
+
* Pass `pageGeometry` whenever the document may contain page/margin-anchored
|
|
87
|
+
* `topAndBottom` text boxes (e.g. a title banner pinned to the page top):
|
|
88
|
+
* without it their reserved band falls back to flow-relative Y and the band
|
|
89
|
+
* won't line up with where the painter places the box. Build it with the
|
|
90
|
+
* shared `pageGeometryFromPage` helper.
|
|
91
|
+
*
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
94
|
+
declare function measureBlocksWithFloats(blocks: FlowBlock[], contentWidth: number | number[], measureBlock: MeasureBlockFn, pageGeometry?: FloatPageGeometry): Measure[];
|
|
95
|
+
|
|
96
|
+
export { type FloatPageGeometry as F, type MeasureBlockFn as M, type FloatingExclusionRect as a, type FloatingImageZone as b, type FloatingLineSegmentZone as c, getFloatingMargins as g, measureBlocksWithFloats as m, rectsToFloatingZones as r };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { WrapTextDirection, FlowBlock, Measure } from './layout-engine/types.js';
|
|
2
|
+
import { P as PageGeometry } from './anchoredObjectPosition-CS-8BfhO.js';
|
|
3
|
+
|
|
4
|
+
interface FloatingExclusionRect {
|
|
5
|
+
/** Which side the object is on for simple one-sided wrapping. */
|
|
6
|
+
side: 'left' | 'right';
|
|
7
|
+
/** X position relative to the content area. */
|
|
8
|
+
x: number;
|
|
9
|
+
/** Y position relative to the content area. */
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
distTop: number;
|
|
14
|
+
distBottom: number;
|
|
15
|
+
distLeft: number;
|
|
16
|
+
distRight: number;
|
|
17
|
+
wrapText?: WrapTextDirection;
|
|
18
|
+
wrapType?: string;
|
|
19
|
+
}
|
|
20
|
+
interface FloatingImageZone {
|
|
21
|
+
leftMargin: number;
|
|
22
|
+
rightMargin: number;
|
|
23
|
+
topY: number;
|
|
24
|
+
bottomY: number;
|
|
25
|
+
segments?: FloatingLineSegmentZone[];
|
|
26
|
+
/**
|
|
27
|
+
* Full-width vertical band (OOXML `topAndBottom` wrap): no text fits beside
|
|
28
|
+
* it, so any line overlapping `[topY, bottomY]` is pushed below the band.
|
|
29
|
+
*/
|
|
30
|
+
fullWidthBlock?: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface FloatingLineSegmentZone {
|
|
33
|
+
leftOffset: number;
|
|
34
|
+
availableWidth: number;
|
|
35
|
+
}
|
|
36
|
+
interface FloatingLineMargins {
|
|
37
|
+
leftMargin: number;
|
|
38
|
+
rightMargin: number;
|
|
39
|
+
segments?: FloatingLineSegmentZone[];
|
|
40
|
+
}
|
|
41
|
+
declare function rectsToFloatingZones(rects: FloatingExclusionRect[], contentWidth: number): FloatingImageZone[];
|
|
42
|
+
declare function getFloatingMargins(lineY: number, lineHeight: number, zones: FloatingImageZone[] | undefined, paragraphYOffset: number): FloatingLineMargins;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Floating-aware block measurement pipeline.
|
|
46
|
+
*
|
|
47
|
+
* Pre-scans a block list to extract exclusion zones from anchored images,
|
|
48
|
+
* floating tables, and floating text boxes; groups co-located floats so
|
|
49
|
+
* their combined exclusion applies starting from the earliest anchor; then
|
|
50
|
+
* walks the blocks calling the caller-supplied `measureBlock` with the
|
|
51
|
+
* active zones and cumulative Y at each step.
|
|
52
|
+
*
|
|
53
|
+
* Adapters (React, Vue) provide their own `measureBlock` so they can
|
|
54
|
+
* decide e.g. whether to cache paragraph measures. The orchestration,
|
|
55
|
+
* extraction, and grouping live here so both adapters stay in lockstep.
|
|
56
|
+
*
|
|
57
|
+
* @packageDocumentation
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Block-measurement callback shape passed to {@link measureBlocksWithFloats}.
|
|
63
|
+
* Adapters (React, Vue) supply this so they can decide platform-specific
|
|
64
|
+
* concerns (e.g. paragraph-measure caching, per-section width) while
|
|
65
|
+
* sharing the floating-zone orchestration. This is adapter-author API,
|
|
66
|
+
* not end-consumer API.
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
type MeasureBlockFn = (block: FlowBlock, contentWidth: number, floatingZones?: FloatingImageZone[], cumulativeY?: number) => Measure;
|
|
71
|
+
/**
|
|
72
|
+
* Page geometry (CSS px) used to resolve page/margin-relative anchored objects
|
|
73
|
+
* into content-area coordinates — currently the vertical anchor of a top-pinned
|
|
74
|
+
* `topAndBottom` band. Same shape the painter uses (see `pageGeometryFromPage`),
|
|
75
|
+
* so both paths resolve to identical positions.
|
|
76
|
+
*
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
type FloatPageGeometry = PageGeometry;
|
|
80
|
+
/**
|
|
81
|
+
* Walk `blocks` and produce one `Measure` per block. Before measuring, this
|
|
82
|
+
* extracts floating exclusion zones (images / floating tables / floating
|
|
83
|
+
* textboxes), groups overlapping co-located floats, and threads the active
|
|
84
|
+
* zones plus cumulative Y into each `measureBlock` call.
|
|
85
|
+
*
|
|
86
|
+
* Pass `pageGeometry` whenever the document may contain page/margin-anchored
|
|
87
|
+
* `topAndBottom` text boxes (e.g. a title banner pinned to the page top):
|
|
88
|
+
* without it their reserved band falls back to flow-relative Y and the band
|
|
89
|
+
* won't line up with where the painter places the box. Build it with the
|
|
90
|
+
* shared `pageGeometryFromPage` helper.
|
|
91
|
+
*
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
94
|
+
declare function measureBlocksWithFloats(blocks: FlowBlock[], contentWidth: number | number[], measureBlock: MeasureBlockFn, pageGeometry?: FloatPageGeometry): Measure[];
|
|
95
|
+
|
|
96
|
+
export { type FloatPageGeometry as F, type MeasureBlockFn as M, type FloatingExclusionRect as a, type FloatingImageZone as b, type FloatingLineSegmentZone as c, getFloatingMargins as g, measureBlocksWithFloats as m, rectsToFloatingZones as r };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { EditorView } from 'prosemirror-view';
|
|
2
|
+
import { StyleResolver } from './styles/index.mjs';
|
|
3
|
+
import '../formatting-BH4hcZiq.mjs';
|
|
4
|
+
import '../colors-C3vA7HUU.mjs';
|
|
5
|
+
import '../styles-BOJ93SAm.mjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Agent-facing formatting operations shared by the React and Vue adapters.
|
|
9
|
+
*
|
|
10
|
+
* `applyFormatting` maps a mark-toggle request (bold/italic/underline/strike/
|
|
11
|
+
* color/highlight/fontSize/fontFamily) onto a PM transaction over a paragraph
|
|
12
|
+
* range located by `paraId` (+ optional `search`). `setParagraphStyle` applies
|
|
13
|
+
* a named paragraph style to that range.
|
|
14
|
+
*
|
|
15
|
+
* Both take the `EditorView` as a parameter. `setParagraphStyle` takes the
|
|
16
|
+
* style resolver as an injected dependency so each adapter keeps its own
|
|
17
|
+
* resolver-sourcing strategy (React caches per styles object; Vue rebuilds).
|
|
18
|
+
*
|
|
19
|
+
* Previously duplicated byte-for-byte at
|
|
20
|
+
* `packages/react/.../useDocxEditorRefApi.ts` and
|
|
21
|
+
* `packages/vue/.../useFormattingActions.ts`.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
interface ApplyFormattingOptions {
|
|
25
|
+
paraId: string;
|
|
26
|
+
search?: string;
|
|
27
|
+
marks: {
|
|
28
|
+
bold?: boolean;
|
|
29
|
+
italic?: boolean;
|
|
30
|
+
underline?: boolean | {
|
|
31
|
+
style?: string;
|
|
32
|
+
};
|
|
33
|
+
strike?: boolean;
|
|
34
|
+
color?: {
|
|
35
|
+
rgb?: string;
|
|
36
|
+
themeColor?: string;
|
|
37
|
+
};
|
|
38
|
+
highlight?: string;
|
|
39
|
+
fontSize?: number;
|
|
40
|
+
fontFamily?: {
|
|
41
|
+
ascii?: string;
|
|
42
|
+
hAnsi?: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Apply mark toggles to a paragraph range. Returns false when the paraId /
|
|
48
|
+
* search can't be resolved; true (a no-op) when the resolved range is empty.
|
|
49
|
+
*/
|
|
50
|
+
declare function applyFormatting(view: EditorView, options: ApplyFormattingOptions): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Apply a named paragraph style to the paragraph identified by `paraId`.
|
|
53
|
+
*
|
|
54
|
+
* The style resolver is injected: when present, unknown styleIds are rejected
|
|
55
|
+
* (the agent gets a clear error instead of a silently-broken `<w:pStyle>`), and
|
|
56
|
+
* the resolved paragraph/run formatting is threaded into `applyStyle`. Without
|
|
57
|
+
* a resolver (no styles loaded) the styleId is applied as-is. Returns false
|
|
58
|
+
* when the paraId can't be resolved or the styleId is unknown.
|
|
59
|
+
*/
|
|
60
|
+
declare function setParagraphStyle(view: EditorView, options: {
|
|
61
|
+
paraId: string;
|
|
62
|
+
styleId: string;
|
|
63
|
+
}, deps: {
|
|
64
|
+
styleResolver: StyleResolver | null;
|
|
65
|
+
}): boolean;
|
|
66
|
+
|
|
67
|
+
export { type ApplyFormattingOptions, applyFormatting, setParagraphStyle };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { EditorView } from 'prosemirror-view';
|
|
2
|
+
import { StyleResolver } from './styles/index.js';
|
|
3
|
+
import '../formatting-_OXU8gLB.js';
|
|
4
|
+
import '../colors-C3vA7HUU.js';
|
|
5
|
+
import '../styles-BWqX2AS-.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Agent-facing formatting operations shared by the React and Vue adapters.
|
|
9
|
+
*
|
|
10
|
+
* `applyFormatting` maps a mark-toggle request (bold/italic/underline/strike/
|
|
11
|
+
* color/highlight/fontSize/fontFamily) onto a PM transaction over a paragraph
|
|
12
|
+
* range located by `paraId` (+ optional `search`). `setParagraphStyle` applies
|
|
13
|
+
* a named paragraph style to that range.
|
|
14
|
+
*
|
|
15
|
+
* Both take the `EditorView` as a parameter. `setParagraphStyle` takes the
|
|
16
|
+
* style resolver as an injected dependency so each adapter keeps its own
|
|
17
|
+
* resolver-sourcing strategy (React caches per styles object; Vue rebuilds).
|
|
18
|
+
*
|
|
19
|
+
* Previously duplicated byte-for-byte at
|
|
20
|
+
* `packages/react/.../useDocxEditorRefApi.ts` and
|
|
21
|
+
* `packages/vue/.../useFormattingActions.ts`.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
interface ApplyFormattingOptions {
|
|
25
|
+
paraId: string;
|
|
26
|
+
search?: string;
|
|
27
|
+
marks: {
|
|
28
|
+
bold?: boolean;
|
|
29
|
+
italic?: boolean;
|
|
30
|
+
underline?: boolean | {
|
|
31
|
+
style?: string;
|
|
32
|
+
};
|
|
33
|
+
strike?: boolean;
|
|
34
|
+
color?: {
|
|
35
|
+
rgb?: string;
|
|
36
|
+
themeColor?: string;
|
|
37
|
+
};
|
|
38
|
+
highlight?: string;
|
|
39
|
+
fontSize?: number;
|
|
40
|
+
fontFamily?: {
|
|
41
|
+
ascii?: string;
|
|
42
|
+
hAnsi?: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Apply mark toggles to a paragraph range. Returns false when the paraId /
|
|
48
|
+
* search can't be resolved; true (a no-op) when the resolved range is empty.
|
|
49
|
+
*/
|
|
50
|
+
declare function applyFormatting(view: EditorView, options: ApplyFormattingOptions): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Apply a named paragraph style to the paragraph identified by `paraId`.
|
|
53
|
+
*
|
|
54
|
+
* The style resolver is injected: when present, unknown styleIds are rejected
|
|
55
|
+
* (the agent gets a clear error instead of a silently-broken `<w:pStyle>`), and
|
|
56
|
+
* the resolved paragraph/run formatting is threaded into `applyStyle`. Without
|
|
57
|
+
* a resolver (no styles loaded) the styleId is applied as-is. Returns false
|
|
58
|
+
* when the paraId can't be resolved or the styleId is unknown.
|
|
59
|
+
*/
|
|
60
|
+
declare function setParagraphStyle(view: EditorView, options: {
|
|
61
|
+
paraId: string;
|
|
62
|
+
styleId: string;
|
|
63
|
+
}, deps: {
|
|
64
|
+
styleResolver: StyleResolver | null;
|
|
65
|
+
}): boolean;
|
|
66
|
+
|
|
67
|
+
export { type ApplyFormattingOptions, applyFormatting, setParagraphStyle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkNRWQ65NX_js=require('../chunk-NRWQ65NX.js'),chunkQEACB5VG_js=require('../chunk-QEACB5VG.js'),chunkAPNMO5JT_js=require('../chunk-APNMO5JT.js');require('../chunk-WWBNJ7KF.js'),require('../chunk-4RTVLMRZ.js'),require('../chunk-BHBOAP6Z.js'),require('../chunk-MZ7LW5CH.js'),require('../chunk-N3Y5BUKV.js'),require('../chunk-WVERBZZU.js'),require('../chunk-6LVPRTB6.js'),require('../chunk-LWH66Q7Q.js'),require('../chunk-TUIEV7Q7.js'),require('../chunk-7HANRHHL.js'),require('../chunk-MJ5FQX7Q.js'),require('../chunk-C2BAPYGJ.js');var chunk4Q2IP5FW_js=require('../chunk-4Q2IP5FW.js');require('../chunk-GSKMHXHG.js'),require('../chunk-DC7S76ZX.js');var prosemirrorState=require('prosemirror-state');function I(i,l){let s=chunkNRWQ65NX_js.a(i.state.doc,l.paraId);if(!s)return false;let o=s.from+1,a=s.to-1;if(l.search){let n=chunkNRWQ65NX_js.d(i.state.doc,s.from,s.to,l.search);if(!n)return false;o=n.from,a=n.to;}if(o>=a)return true;let{schema:t}=i.state,e=l.marks,r=i.state.tr;if(e.bold!==void 0&&t.marks.bold&&(r=e.bold?r.addMark(o,a,t.marks.bold.create()):r.removeMark(o,a,t.marks.bold)),e.italic!==void 0&&t.marks.italic&&(r=e.italic?r.addMark(o,a,t.marks.italic.create()):r.removeMark(o,a,t.marks.italic)),e.underline!==void 0&&t.marks.underline)if(e.underline){let n=typeof e.underline=="object"?e.underline.style:void 0;r=r.addMark(o,a,t.marks.underline.create({style:n??"single"}));}else r=r.removeMark(o,a,t.marks.underline);if(e.strike!==void 0&&t.marks.strike&&(r=e.strike?r.addMark(o,a,t.marks.strike.create()):r.removeMark(o,a,t.marks.strike)),e.color!==void 0&&t.marks.textColor&&(e.color&&(e.color.rgb||e.color.themeColor)?r=r.addMark(o,a,t.marks.textColor.create({rgb:e.color.rgb??null,themeColor:e.color.themeColor??null})):r=r.removeMark(o,a,t.marks.textColor)),e.highlight!==void 0&&t.marks.highlight)if(e.highlight){let n=chunkQEACB5VG_js.b(e.highlight);r=r.addMark(o,a,t.marks.highlight.create({color:n||e.highlight}));}else r=r.removeMark(o,a,t.marks.highlight);return e.fontSize!==void 0&&t.marks.fontSize&&(e.fontSize>0?r=r.addMark(o,a,t.marks.fontSize.create({size:chunk4Q2IP5FW_js.l(e.fontSize)})):r=r.removeMark(o,a,t.marks.fontSize)),e.fontFamily!==void 0&&t.marks.fontFamily&&(e.fontFamily&&(e.fontFamily.ascii||e.fontFamily.hAnsi)?r=r.addMark(o,a,t.marks.fontFamily.create({ascii:e.fontFamily.ascii??null,hAnsi:e.fontFamily.hAnsi??e.fontFamily.ascii??null})):r=r.removeMark(o,a,t.marks.fontFamily)),i.dispatch(r),true}function x(i,l,s){let o=chunkNRWQ65NX_js.a(i.state.doc,l.paraId);if(!o)return false;let{styleResolver:a}=s;if(a&&!a.hasParagraphStyle(l.styleId))return false;let t=i.state.doc.resolve(o.from+1),e=i.state.doc.resolve(o.to-1),r=prosemirrorState.TextSelection.between(t,e),n=i.state.apply(i.state.tr.setSelection(r)),p=a?(()=>{let m=a.resolveParagraphStyle(l.styleId);return chunkAPNMO5JT_js.v(l.styleId,{paragraphFormatting:m.paragraphFormatting,runFormatting:m.runFormatting})})():chunkAPNMO5JT_js.v(l.styleId),c=false;return p(n,m=>{c=true,m.setSelection(i.state.selection.map(m.doc,m.mapping)),i.dispatch(m);}),c}exports.applyFormatting=I;exports.setParagraphStyle=x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a,d}from'../chunk-HPJBZL37.mjs';import {b}from'../chunk-XPV6VILW.mjs';import {v}from'../chunk-LAJPGQEE.mjs';import'../chunk-4GFTMGSV.mjs';import'../chunk-SWBLJF6R.mjs';import'../chunk-MOKKS75W.mjs';import'../chunk-OZMNIX6U.mjs';import'../chunk-AMENZY5F.mjs';import'../chunk-U67MWOPZ.mjs';import'../chunk-BGY3CB37.mjs';import'../chunk-2XP6GLA4.mjs';import'../chunk-ZX26QZJ5.mjs';import'../chunk-MJ6XZFVD.mjs';import'../chunk-67LVRQIR.mjs';import'../chunk-LE67NTCN.mjs';import {l}from'../chunk-VW22RZ6C.mjs';import'../chunk-DI6CRWSW.mjs';import'../chunk-QYUPLKLP.mjs';import {TextSelection}from'prosemirror-state';function I(i,l$1){let s=a(i.state.doc,l$1.paraId);if(!s)return false;let o=s.from+1,a$1=s.to-1;if(l$1.search){let n=d(i.state.doc,s.from,s.to,l$1.search);if(!n)return false;o=n.from,a$1=n.to;}if(o>=a$1)return true;let{schema:t}=i.state,e=l$1.marks,r=i.state.tr;if(e.bold!==void 0&&t.marks.bold&&(r=e.bold?r.addMark(o,a$1,t.marks.bold.create()):r.removeMark(o,a$1,t.marks.bold)),e.italic!==void 0&&t.marks.italic&&(r=e.italic?r.addMark(o,a$1,t.marks.italic.create()):r.removeMark(o,a$1,t.marks.italic)),e.underline!==void 0&&t.marks.underline)if(e.underline){let n=typeof e.underline=="object"?e.underline.style:void 0;r=r.addMark(o,a$1,t.marks.underline.create({style:n??"single"}));}else r=r.removeMark(o,a$1,t.marks.underline);if(e.strike!==void 0&&t.marks.strike&&(r=e.strike?r.addMark(o,a$1,t.marks.strike.create()):r.removeMark(o,a$1,t.marks.strike)),e.color!==void 0&&t.marks.textColor&&(e.color&&(e.color.rgb||e.color.themeColor)?r=r.addMark(o,a$1,t.marks.textColor.create({rgb:e.color.rgb??null,themeColor:e.color.themeColor??null})):r=r.removeMark(o,a$1,t.marks.textColor)),e.highlight!==void 0&&t.marks.highlight)if(e.highlight){let n=b(e.highlight);r=r.addMark(o,a$1,t.marks.highlight.create({color:n||e.highlight}));}else r=r.removeMark(o,a$1,t.marks.highlight);return e.fontSize!==void 0&&t.marks.fontSize&&(e.fontSize>0?r=r.addMark(o,a$1,t.marks.fontSize.create({size:l(e.fontSize)})):r=r.removeMark(o,a$1,t.marks.fontSize)),e.fontFamily!==void 0&&t.marks.fontFamily&&(e.fontFamily&&(e.fontFamily.ascii||e.fontFamily.hAnsi)?r=r.addMark(o,a$1,t.marks.fontFamily.create({ascii:e.fontFamily.ascii??null,hAnsi:e.fontFamily.hAnsi??e.fontFamily.ascii??null})):r=r.removeMark(o,a$1,t.marks.fontFamily)),i.dispatch(r),true}function x(i,l,s){let o=a(i.state.doc,l.paraId);if(!o)return false;let{styleResolver:a$1}=s;if(a$1&&!a$1.hasParagraphStyle(l.styleId))return false;let t=i.state.doc.resolve(o.from+1),e=i.state.doc.resolve(o.to-1),r=TextSelection.between(t,e),n=i.state.apply(i.state.tr.setSelection(r)),p=a$1?(()=>{let m=a$1.resolveParagraphStyle(l.styleId);return v(l.styleId,{paragraphFormatting:m.paragraphFormatting,runFormatting:m.runFormatting})})():v(l.styleId),c=false;return p(n,m=>{c=true,m.setSelection(i.state.selection.map(m.doc,m.mapping)),i.dispatch(m);}),c}export{I as applyFormatting,x as setParagraphStyle};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EditorView } from 'prosemirror-view';
|
|
2
|
+
import { e as Comment } from '../content-3xF4WDE8.mjs';
|
|
3
|
+
import '../formatting-BH4hcZiq.mjs';
|
|
4
|
+
import '../colors-C3vA7HUU.mjs';
|
|
5
|
+
import '../docx/wrapTypes.mjs';
|
|
6
|
+
import '../watermark-DAcnAs_J.mjs';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Comment + tracked-change ID allocation.
|
|
10
|
+
*
|
|
11
|
+
* Comments (`w:comment` ids) and tracked changes (`w:ins`/`w:del` revision ids)
|
|
12
|
+
* share a single OOXML ID space — a duplicate ID between the two corrupts the
|
|
13
|
+
* round-trip. Allocation is therefore one monotonic, no-reuse counter, exposed
|
|
14
|
+
* as an **instance-scoped** factory rather than module-global state so two
|
|
15
|
+
* editor instances on one page never share (or collide on) a counter.
|
|
16
|
+
*
|
|
17
|
+
* Kept separate from the comment/tracked-change transaction builders
|
|
18
|
+
* (`commentOps.ts`) so the allocator can be owned independently — the editor
|
|
19
|
+
* engine seeds and threads it without dragging in the PM-text-lookup graph.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/** Sentinel ID for a comment that hasn't been persisted yet (anchored to selection). */
|
|
23
|
+
declare const PENDING_COMMENT_ID = -1;
|
|
24
|
+
interface CommentIdAllocator {
|
|
25
|
+
/** Allocate the next ID and advance the counter. */
|
|
26
|
+
next(): number;
|
|
27
|
+
/**
|
|
28
|
+
* On document load, bump the counter above the highest ID found in the
|
|
29
|
+
* loaded comments and tracked-change marks so subsequent allocations don't
|
|
30
|
+
* collide with already-present IDs.
|
|
31
|
+
*/
|
|
32
|
+
seedAbove(maxId: number): void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create an instance-scoped monotonic comment/revision ID allocator. IDs are
|
|
36
|
+
* never reused (deleting a comment does not free its ID), and the counter is
|
|
37
|
+
* private to this allocator — multiple editors get independent ID spaces.
|
|
38
|
+
*/
|
|
39
|
+
declare function createCommentIdAllocator(): CommentIdAllocator;
|
|
40
|
+
/**
|
|
41
|
+
* Seed an allocator above every comment/revision ID currently in the document
|
|
42
|
+
* — comment objects (including replies, which carry no mark) plus
|
|
43
|
+
* tracked-change `revisionId` marks. Because `seedAbove` only ever raises the
|
|
44
|
+
* counter, this is safe to call on load (React) or before each allocation
|
|
45
|
+
* (Vue): new IDs never collide with or reuse an existing one, and the comment
|
|
46
|
+
* and revision ID spaces stay unified.
|
|
47
|
+
*/
|
|
48
|
+
declare function seedCommentAllocator(allocator: CommentIdAllocator, comments: Comment[] | undefined, view: EditorView | null): void;
|
|
49
|
+
|
|
50
|
+
export { type CommentIdAllocator, PENDING_COMMENT_ID, createCommentIdAllocator, seedCommentAllocator };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EditorView } from 'prosemirror-view';
|
|
2
|
+
import { e as Comment } from '../content-C8fc_tL6.js';
|
|
3
|
+
import '../formatting-_OXU8gLB.js';
|
|
4
|
+
import '../colors-C3vA7HUU.js';
|
|
5
|
+
import '../docx/wrapTypes.js';
|
|
6
|
+
import '../watermark-DAcnAs_J.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Comment + tracked-change ID allocation.
|
|
10
|
+
*
|
|
11
|
+
* Comments (`w:comment` ids) and tracked changes (`w:ins`/`w:del` revision ids)
|
|
12
|
+
* share a single OOXML ID space — a duplicate ID between the two corrupts the
|
|
13
|
+
* round-trip. Allocation is therefore one monotonic, no-reuse counter, exposed
|
|
14
|
+
* as an **instance-scoped** factory rather than module-global state so two
|
|
15
|
+
* editor instances on one page never share (or collide on) a counter.
|
|
16
|
+
*
|
|
17
|
+
* Kept separate from the comment/tracked-change transaction builders
|
|
18
|
+
* (`commentOps.ts`) so the allocator can be owned independently — the editor
|
|
19
|
+
* engine seeds and threads it without dragging in the PM-text-lookup graph.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/** Sentinel ID for a comment that hasn't been persisted yet (anchored to selection). */
|
|
23
|
+
declare const PENDING_COMMENT_ID = -1;
|
|
24
|
+
interface CommentIdAllocator {
|
|
25
|
+
/** Allocate the next ID and advance the counter. */
|
|
26
|
+
next(): number;
|
|
27
|
+
/**
|
|
28
|
+
* On document load, bump the counter above the highest ID found in the
|
|
29
|
+
* loaded comments and tracked-change marks so subsequent allocations don't
|
|
30
|
+
* collide with already-present IDs.
|
|
31
|
+
*/
|
|
32
|
+
seedAbove(maxId: number): void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create an instance-scoped monotonic comment/revision ID allocator. IDs are
|
|
36
|
+
* never reused (deleting a comment does not free its ID), and the counter is
|
|
37
|
+
* private to this allocator — multiple editors get independent ID spaces.
|
|
38
|
+
*/
|
|
39
|
+
declare function createCommentIdAllocator(): CommentIdAllocator;
|
|
40
|
+
/**
|
|
41
|
+
* Seed an allocator above every comment/revision ID currently in the document
|
|
42
|
+
* — comment objects (including replies, which carry no mark) plus
|
|
43
|
+
* tracked-change `revisionId` marks. Because `seedAbove` only ever raises the
|
|
44
|
+
* counter, this is safe to call on load (React) or before each allocation
|
|
45
|
+
* (Vue): new IDs never collide with or reuse an existing one, and the comment
|
|
46
|
+
* and revision ID spaces stay unified.
|
|
47
|
+
*/
|
|
48
|
+
declare function seedCommentAllocator(allocator: CommentIdAllocator, comments: Comment[] | undefined, view: EditorView | null): void;
|
|
49
|
+
|
|
50
|
+
export { type CommentIdAllocator, PENDING_COMMENT_ID, createCommentIdAllocator, seedCommentAllocator };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';require('../chunk-DC7S76ZX.js');var d=-1;function i(){let e=1;return {next:()=>e++,seedAbove(t){t>=e&&(e=t+1);}}}function a(e,t,n){let o=0;for(let r of t??[])o=Math.max(o,r.id);n&&n.state.doc.descendants(r=>{for(let m of r.marks)m.attrs.revisionId!=null&&(o=Math.max(o,m.attrs.revisionId));}),e.seedAbove(o);}exports.PENDING_COMMENT_ID=d;exports.createCommentIdAllocator=i;exports.seedCommentAllocator=a;
|