@beyondwork/docx-react-component 1.0.120 → 1.0.122
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/README.md +1 -0
- package/dist/api/public-types.cjs +1713 -55
- package/dist/api/public-types.d.cts +2 -2
- package/dist/api/public-types.d.ts +2 -2
- package/dist/api/public-types.js +6 -6
- package/dist/api/v3.cjs +4958 -406
- package/dist/api/v3.d.cts +3 -3
- package/dist/api/v3.d.ts +3 -3
- package/dist/api/v3.js +14 -14
- package/dist/{canonical-document-fNawStsc.d.cts → canonical-document-ByIqTd4s.d.cts} +9 -1
- package/dist/{canonical-document-fNawStsc.d.ts → canonical-document-ByIqTd4s.d.ts} +9 -1
- package/dist/{chunk-5RNMPLXU.js → chunk-37SEJQ3G.js} +4 -4
- package/dist/{chunk-FXGQM2JB.js → chunk-3OFSP2IX.js} +11 -5
- package/dist/{chunk-U5BSQXF4.js → chunk-3OHVK2D6.js} +70 -12
- package/dist/{chunk-AUQDC5BD.js → chunk-3TUQCHYT.js} +101 -2
- package/dist/{chunk-SJSMYEMU.js → chunk-B4YHWFE3.js} +3 -3
- package/dist/{chunk-XC56YLIS.js → chunk-C2LWJ4CZ.js} +4 -0
- package/dist/{chunk-VDIUVT46.js → chunk-CX42VC67.js} +1 -1
- package/dist/{chunk-KCHEAX4Z.js → chunk-EMDH4IQN.js} +148 -70
- package/dist/{chunk-TMQGWF7R.js → chunk-G3B2OBCZ.js} +352 -17
- package/dist/{chunk-VCL5MJMZ.js → chunk-GON2DNTE.js} +149 -28
- package/dist/{chunk-WVZX4NYG.js → chunk-GZW2ERUO.js} +601 -47
- package/dist/{chunk-WDNEPRFW.js → chunk-ICX54W4U.js} +1 -1
- package/dist/{chunk-FIGWJ43K.js → chunk-IT2DK3A7.js} +1883 -90
- package/dist/{chunk-2ZWFQ74R.js → chunk-OBCP6VTG.js} +1 -1
- package/dist/{chunk-FLNQY74K.js → chunk-OYGMRRR7.js} +1 -1
- package/dist/{chunk-MPYYBRVN.js → chunk-PCXTMEGY.js} +782 -124
- package/dist/{chunk-4JNUMMM7.js → chunk-PGGPPZ65.js} +17 -2
- package/dist/{chunk-KHZNNBTN.js → chunk-QFU7ZOAD.js} +43 -39
- package/dist/{chunk-4ZNQFWFM.js → chunk-QIO6V46H.js} +84 -4
- package/dist/{chunk-IQ2VJEF6.js → chunk-QNGJRZ2D.js} +1 -1
- package/dist/{chunk-BM5NSDII.js → chunk-S4ANOS2M.js} +2 -2
- package/dist/{chunk-AQA7OZ2R.js → chunk-TFSXOIAI.js} +959 -43
- package/dist/{chunk-NQZUGMLW.js → chunk-TMU7JMXX.js} +184 -32
- package/dist/{chunk-KD5K5XIA.js → chunk-UHQOUTAX.js} +568 -88
- package/dist/{chunk-327AIUXL.js → chunk-UWDWGQH5.js} +11 -4
- package/dist/{chunk-BBB4GSDB.js → chunk-XVFENXLK.js} +2 -2
- package/dist/{chunk-MUEN2WOG.js → chunk-ZKSDVHGH.js} +6 -3
- package/dist/compare.cjs +17 -2
- package/dist/compare.d.cts +1 -1
- package/dist/compare.d.ts +1 -1
- package/dist/compare.js +3 -3
- package/dist/core/commands/formatting-commands.d.cts +2 -2
- package/dist/core/commands/formatting-commands.d.ts +2 -2
- package/dist/core/commands/image-commands.cjs +814 -45
- package/dist/core/commands/image-commands.d.cts +2 -2
- package/dist/core/commands/image-commands.d.ts +2 -2
- package/dist/core/commands/image-commands.js +8 -8
- package/dist/core/commands/section-layout-commands.d.cts +2 -2
- package/dist/core/commands/section-layout-commands.d.ts +2 -2
- package/dist/core/commands/style-commands.d.cts +2 -2
- package/dist/core/commands/style-commands.d.ts +2 -2
- package/dist/core/commands/table-structure-commands.cjs +750 -42
- package/dist/core/commands/table-structure-commands.d.cts +2 -2
- package/dist/core/commands/table-structure-commands.d.ts +2 -2
- package/dist/core/commands/table-structure-commands.js +6 -6
- package/dist/core/commands/text-commands.cjs +910 -57
- package/dist/core/commands/text-commands.d.cts +2 -2
- package/dist/core/commands/text-commands.d.ts +2 -2
- package/dist/core/commands/text-commands.js +8 -8
- package/dist/core/selection/mapping.d.cts +2 -2
- package/dist/core/selection/mapping.d.ts +2 -2
- package/dist/core/state/editor-state.cjs +17 -2
- package/dist/core/state/editor-state.d.cts +2 -2
- package/dist/core/state/editor-state.d.ts +2 -2
- package/dist/core/state/editor-state.js +2 -2
- package/dist/index.cjs +6203 -625
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +299 -67
- package/dist/io/docx-session.cjs +354 -102
- package/dist/io/docx-session.d.cts +4 -4
- package/dist/io/docx-session.d.ts +4 -4
- package/dist/io/docx-session.js +5 -5
- package/dist/legal.cjs +183 -31
- package/dist/legal.d.cts +1 -1
- package/dist/legal.d.ts +1 -1
- package/dist/legal.js +3 -3
- package/dist/{loader-CaohrhNl.d.ts → loader-BF8ju_LK.d.ts} +22 -4
- package/dist/{loader-BpCyGnZl.d.cts → loader-g54WRvj1.d.cts} +22 -4
- package/dist/{public-types-Dpch9JG0.d.cts → public-types-D_y4Ptcj.d.cts} +747 -21
- package/dist/{public-types-C948HNVF.d.ts → public-types-Dl1jiWjk.d.ts} +747 -21
- package/dist/public-types.cjs +1713 -55
- package/dist/public-types.d.cts +2 -2
- package/dist/public-types.d.ts +2 -2
- package/dist/public-types.js +6 -6
- package/dist/runtime/collab.cjs +4 -0
- package/dist/runtime/collab.d.cts +3 -3
- package/dist/runtime/collab.d.ts +3 -3
- package/dist/runtime/collab.js +2 -2
- package/dist/runtime/document-runtime.cjs +3699 -507
- package/dist/runtime/document-runtime.d.cts +2 -2
- package/dist/runtime/document-runtime.d.ts +2 -2
- package/dist/runtime/document-runtime.js +18 -18
- package/dist/{session-Dqg17V3s.d.ts → session-C1EPAkcI.d.ts} +3 -3
- package/dist/{session-BlXE5zxz.d.cts → session-D15QOO0Q.d.cts} +3 -3
- package/dist/session.cjs +951 -104
- package/dist/session.d.cts +5 -5
- package/dist/session.d.ts +5 -5
- package/dist/session.js +10 -8
- package/dist/tailwind.cjs +1752 -91
- package/dist/tailwind.d.cts +2 -2
- package/dist/tailwind.d.ts +2 -2
- package/dist/tailwind.js +10 -10
- package/dist/{types-C9vZVpKy.d.cts → types-BoSRp2Vg.d.cts} +2 -2
- package/dist/{types-B1tlF1bq.d.ts → types-DEvRwq9C.d.ts} +2 -2
- package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +3 -3
- package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +3 -3
- package/dist/ui-tailwind/editor-surface/search-plugin.js +7 -7
- package/dist/ui-tailwind/theme/editor-theme.css +5 -5
- package/dist/ui-tailwind.cjs +1752 -91
- package/dist/ui-tailwind.d.cts +8 -8
- package/dist/ui-tailwind.d.ts +8 -8
- package/dist/ui-tailwind.js +10 -10
- package/package.json +17 -5
- package/dist/ui-tailwind/theme/tokens.css +0 -382
package/dist/api/v3.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { u as MockPayload, A as ApiStatus, U as UxIntent, v as RuntimeApiHandle, w as UiControllerFactory, x as ApiV3Ui } from '../public-types-
|
|
2
|
-
export { y as AgentMetadata, z as AiPe2EvidenceOptions, B as AiPe2GraphOracleReference, D as AiPe2OracleEvidence, F as AiPe2OracleEvidenceProvider, G as AiPe2OracleEvidenceProviderInput, H as AiPe2OracleVerdict, J as ApiV3, K as ApiV3FnMetadata, N as ApiV3UiChrome, O as ApiV3UiDebug, Q as ApiV3UiOverlays, V as ApiV3UiSession, W as ApiV3UiSurface, X as ApiV3UiViewport, Y as BroadcastsVia, Z as ChromeDebugMode, _ as ChromeDocumentMode, $ as ChromeHostPosture, a0 as ChromeMarkupDisplay, a1 as ChromePosture, a2 as ChromeReviewMode, a3 as ChromeSurface, a4 as ChromeSurfaceKind, a5 as CreateApiV3Opts, a6 as DebugAttachment, a7 as DebugSession, a8 as GeometryRect, a9 as LiveEvidence, aa as MockShape, ab as OverlayAnchorQuery, ac as PersistsTo, ad as ScrollTarget, ae as ScrollTargetBehavior, af as SelectionRangeInput, ag as SourceLayer, ah as StateClass, ai as SubscriptionShape, aj as UiBinding, ak as UiController, al as UiControllerKind, am as UiListener, an as UiUnsubscribe, ao as ViewportState, ap as createApiV3, aq as validateApiV3Metadata } from '../public-types-
|
|
1
|
+
import { u as MockPayload, A as ApiStatus, U as UxIntent, v as RuntimeApiHandle, w as UiControllerFactory, x as ApiV3Ui } from '../public-types-D_y4Ptcj.cjs';
|
|
2
|
+
export { y as AgentMetadata, z as AiPe2EvidenceOptions, B as AiPe2GraphOracleReference, D as AiPe2OracleEvidence, F as AiPe2OracleEvidenceProvider, G as AiPe2OracleEvidenceProviderInput, H as AiPe2OracleVerdict, J as ApiV3, K as ApiV3FnMetadata, N as ApiV3UiChrome, O as ApiV3UiDebug, Q as ApiV3UiOverlays, V as ApiV3UiSession, W as ApiV3UiSurface, X as ApiV3UiViewport, Y as BroadcastsVia, Z as ChromeDebugMode, _ as ChromeDocumentMode, $ as ChromeHostPosture, a0 as ChromeMarkupDisplay, a1 as ChromePosture, a2 as ChromeReviewMode, a3 as ChromeSurface, a4 as ChromeSurfaceKind, a5 as CreateApiV3Opts, a6 as DebugAttachment, a7 as DebugSession, a8 as GeometryRect, a9 as LiveEvidence, aa as MockShape, ab as OverlayAnchorQuery, ac as PersistsTo, ad as ScrollTarget, ae as ScrollTargetBehavior, af as SelectionRangeInput, ag as SourceLayer, ah as StateClass, ai as SubscriptionShape, aj as UiBinding, ak as UiController, al as UiControllerKind, am as UiListener, an as UiUnsubscribe, ao as ViewportState, ap as createApiV3, aq as validateApiV3Metadata } from '../public-types-D_y4Ptcj.cjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
import 'y-protocols/awareness';
|
|
6
|
-
import '../canonical-document-
|
|
6
|
+
import '../canonical-document-ByIqTd4s.cjs';
|
|
7
7
|
import 'prosemirror-state';
|
|
8
8
|
import 'prosemirror-model';
|
|
9
9
|
|
package/dist/api/v3.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { u as MockPayload, A as ApiStatus, U as UxIntent, v as RuntimeApiHandle, w as UiControllerFactory, x as ApiV3Ui } from '../public-types-
|
|
2
|
-
export { y as AgentMetadata, z as AiPe2EvidenceOptions, B as AiPe2GraphOracleReference, D as AiPe2OracleEvidence, F as AiPe2OracleEvidenceProvider, G as AiPe2OracleEvidenceProviderInput, H as AiPe2OracleVerdict, J as ApiV3, K as ApiV3FnMetadata, N as ApiV3UiChrome, O as ApiV3UiDebug, Q as ApiV3UiOverlays, V as ApiV3UiSession, W as ApiV3UiSurface, X as ApiV3UiViewport, Y as BroadcastsVia, Z as ChromeDebugMode, _ as ChromeDocumentMode, $ as ChromeHostPosture, a0 as ChromeMarkupDisplay, a1 as ChromePosture, a2 as ChromeReviewMode, a3 as ChromeSurface, a4 as ChromeSurfaceKind, a5 as CreateApiV3Opts, a6 as DebugAttachment, a7 as DebugSession, a8 as GeometryRect, a9 as LiveEvidence, aa as MockShape, ab as OverlayAnchorQuery, ac as PersistsTo, ad as ScrollTarget, ae as ScrollTargetBehavior, af as SelectionRangeInput, ag as SourceLayer, ah as StateClass, ai as SubscriptionShape, aj as UiBinding, ak as UiController, al as UiControllerKind, am as UiListener, an as UiUnsubscribe, ao as ViewportState, ap as createApiV3, aq as validateApiV3Metadata } from '../public-types-
|
|
1
|
+
import { u as MockPayload, A as ApiStatus, U as UxIntent, v as RuntimeApiHandle, w as UiControllerFactory, x as ApiV3Ui } from '../public-types-Dl1jiWjk.js';
|
|
2
|
+
export { y as AgentMetadata, z as AiPe2EvidenceOptions, B as AiPe2GraphOracleReference, D as AiPe2OracleEvidence, F as AiPe2OracleEvidenceProvider, G as AiPe2OracleEvidenceProviderInput, H as AiPe2OracleVerdict, J as ApiV3, K as ApiV3FnMetadata, N as ApiV3UiChrome, O as ApiV3UiDebug, Q as ApiV3UiOverlays, V as ApiV3UiSession, W as ApiV3UiSurface, X as ApiV3UiViewport, Y as BroadcastsVia, Z as ChromeDebugMode, _ as ChromeDocumentMode, $ as ChromeHostPosture, a0 as ChromeMarkupDisplay, a1 as ChromePosture, a2 as ChromeReviewMode, a3 as ChromeSurface, a4 as ChromeSurfaceKind, a5 as CreateApiV3Opts, a6 as DebugAttachment, a7 as DebugSession, a8 as GeometryRect, a9 as LiveEvidence, aa as MockShape, ab as OverlayAnchorQuery, ac as PersistsTo, ad as ScrollTarget, ae as ScrollTargetBehavior, af as SelectionRangeInput, ag as SourceLayer, ah as StateClass, ai as SubscriptionShape, aj as UiBinding, ak as UiController, al as UiControllerKind, am as UiListener, an as UiUnsubscribe, ao as ViewportState, ap as createApiV3, aq as validateApiV3Metadata } from '../public-types-Dl1jiWjk.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
import 'y-protocols/awareness';
|
|
6
|
-
import '../canonical-document-
|
|
6
|
+
import '../canonical-document-ByIqTd4s.js';
|
|
7
7
|
import 'prosemirror-state';
|
|
8
8
|
import 'prosemirror-model';
|
|
9
9
|
|
package/dist/api/v3.js
CHANGED
|
@@ -5,31 +5,31 @@ import {
|
|
|
5
5
|
mockId,
|
|
6
6
|
mockPayload,
|
|
7
7
|
validateApiV3Metadata
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-IT2DK3A7.js";
|
|
9
|
+
import "../chunk-PCXTMEGY.js";
|
|
10
|
+
import "../chunk-C2LWJ4CZ.js";
|
|
11
11
|
import {
|
|
12
12
|
createUiApi,
|
|
13
13
|
emitUxResponse
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-GON2DNTE.js";
|
|
15
|
+
import "../chunk-G3B2OBCZ.js";
|
|
16
16
|
import "../chunk-KFCQYZXR.js";
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-QIO6V46H.js";
|
|
18
|
+
import "../chunk-3TUQCHYT.js";
|
|
19
|
+
import "../chunk-OYGMRRR7.js";
|
|
20
|
+
import "../chunk-S4ANOS2M.js";
|
|
21
|
+
import "../chunk-EMDH4IQN.js";
|
|
22
|
+
import "../chunk-UWDWGQH5.js";
|
|
23
|
+
import "../chunk-TMU7JMXX.js";
|
|
24
24
|
import "../chunk-4BJ6K26R.js";
|
|
25
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-TFSXOIAI.js";
|
|
26
26
|
import "../chunk-OL2UEHRP.js";
|
|
27
27
|
import "../chunk-EB6M3GE6.js";
|
|
28
28
|
import "../chunk-IHE7YOAY.js";
|
|
29
29
|
import "../chunk-MT37IIGN.js";
|
|
30
30
|
import "../chunk-UTL65BUI.js";
|
|
31
31
|
import "../chunk-UFVDIR2C.js";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-PGGPPZ65.js";
|
|
33
33
|
import "../chunk-DNXYUIIS.js";
|
|
34
34
|
import "../chunk-M2HUK3KF.js";
|
|
35
35
|
export {
|
|
@@ -396,6 +396,9 @@ interface CanonicalSourceRef {
|
|
|
396
396
|
readonly partPath?: string;
|
|
397
397
|
readonly storyKind?: string;
|
|
398
398
|
readonly element?: string;
|
|
399
|
+
readonly xmlPath?: string;
|
|
400
|
+
readonly tableCellPath?: string;
|
|
401
|
+
readonly tableDepth?: number;
|
|
399
402
|
readonly ordinal?: number;
|
|
400
403
|
readonly startOffset?: number;
|
|
401
404
|
readonly endOffset?: number;
|
|
@@ -1382,6 +1385,7 @@ interface TableNode {
|
|
|
1382
1385
|
}
|
|
1383
1386
|
interface TableRowNode {
|
|
1384
1387
|
readonly type: "table_row";
|
|
1388
|
+
readonly sourceRef?: CanonicalSourceRef;
|
|
1385
1389
|
/** @deprecated Use `unknownPropertyChildren`. Kept for snapshot back-compat. */
|
|
1386
1390
|
readonly propertiesXml?: string;
|
|
1387
1391
|
readonly unknownPropertyChildren?: UnknownPropertyChild[];
|
|
@@ -1399,6 +1403,7 @@ interface TableRowNode {
|
|
|
1399
1403
|
}
|
|
1400
1404
|
interface TableCellNode {
|
|
1401
1405
|
readonly type: "table_cell";
|
|
1406
|
+
readonly sourceRef?: CanonicalSourceRef;
|
|
1402
1407
|
/** @deprecated Use `unknownPropertyChildren`. Kept for snapshot back-compat. */
|
|
1403
1408
|
readonly propertiesXml?: string;
|
|
1404
1409
|
readonly unknownPropertyChildren?: UnknownPropertyChild[];
|
|
@@ -1698,10 +1703,12 @@ interface BookmarkStartNode {
|
|
|
1698
1703
|
readonly type: "bookmark_start";
|
|
1699
1704
|
readonly bookmarkId: string;
|
|
1700
1705
|
readonly name: string;
|
|
1706
|
+
readonly sourceRef?: CanonicalSourceRef;
|
|
1701
1707
|
}
|
|
1702
1708
|
interface BookmarkEndNode {
|
|
1703
1709
|
readonly type: "bookmark_end";
|
|
1704
1710
|
readonly bookmarkId: string;
|
|
1711
|
+
readonly sourceRef?: CanonicalSourceRef;
|
|
1705
1712
|
}
|
|
1706
1713
|
interface SectionBreakNode {
|
|
1707
1714
|
readonly type: "section_break";
|
|
@@ -2071,6 +2078,7 @@ interface VmlShapeNode {
|
|
|
2071
2078
|
*/
|
|
2072
2079
|
interface OleEmbedNode {
|
|
2073
2080
|
readonly type: "ole_embed";
|
|
2081
|
+
readonly sourceRef?: CanonicalSourceRef;
|
|
2074
2082
|
readonly id: string;
|
|
2075
2083
|
readonly progId?: string;
|
|
2076
2084
|
readonly embedType: "oleObject";
|
|
@@ -2478,4 +2486,4 @@ interface DiagnosticErrorEntry {
|
|
|
2478
2486
|
*/
|
|
2479
2487
|
declare function createCanonicalDocumentId(documentId: string): string;
|
|
2480
2488
|
|
|
2481
|
-
export { type
|
|
2489
|
+
export { type TextProperties as $, type PreserveOnlyObjectSizing as A, type BlockNode as B, type CanonicalDocument as C, type DocumentRootNode as D, type TableCellNode as E, type FieldFamily as F, type TextMark as G, type Mutable as H, type ISO8601DateTime as I, type ParagraphNode as J, type TableIndent as K, type TableCellMargins as L, type ModelValidationIssue as M, type TableNode as N, type OpaqueFragmentRecord as O, type PageSize as P, type FieldRegistryEntry as Q, type RevisionStoryTargetRecord as R, type SectionProperties as S, type TableLook as T, type FootnoteProperties as U, type EndnoteProperties as V, type CanonicalTheme as W, type InlineNode as X, type CanonicalParagraphFormatting as Y, type CanonicalRunFormatting as Z, type FillSpec as _, type PageMargins as a, type StrokeSpec as a0, type ChartModel as a1, type ResolvedTheme as a2, type ColorRef as a3, type SupportedFieldFamily as a4, type HeaderDocument as a5, type FooterDocument as a6, type ParagraphBorders as a7, type AreaChartModel as a8, type Axis as a9, type UnsupportedReason as aA, type ValueAxis as aB, type AxisBase as aa, type BarChartModel as ab, type BubbleChartModel as ac, type BubbleSeries as ad, type CategoryAxis as ae, type CategoryLikeAxis as af, type ChartCommon as ag, type ColorMod as ah, type ComboChartModel as ai, type DataLabelsSpec as aj, type DataPointOverride as ak, type DateAxis as al, type Legend as am, type LineChartModel as an, type LineSeries as ao, type MarkerSpec as ap, type PieChartModel as aq, type PieSeries as ar, type ScatterChartModel as as, type ScatterSeries as at, type Series as au, type SeriesAxis as av, type SeriesBase as aw, type ShapeProperties as ax, type Title as ay, type UnsupportedChartModel as az, type ColumnProperties as b, type PageNumbering as c, type PreservationStore as d, type DocumentNode as e, type PersistedEditorSnapshotVersion as f, CDS_SCHEMA_VERSION as g, type CompatibilityReportVersion as h, type Base64 as i, type CommentThread as j, type CommentEntry as k, type CommentResolution as l, type RevisionMetadataRecord as m, type RevisionRecord as n, createCanonicalDocumentId as o, type TableStyleFormatting as p, type TableWidth as q, type TableBorders as r, type TableStyleConditionalRegion as s, type TableCellBorders as t, type CellShading as u, type CanonicalSourceRef as v, type SdtDataBindingState as w, type FieldRefreshStatus as x, type TocRegion as y, type CanonicalAnchor as z };
|
|
@@ -396,6 +396,9 @@ interface CanonicalSourceRef {
|
|
|
396
396
|
readonly partPath?: string;
|
|
397
397
|
readonly storyKind?: string;
|
|
398
398
|
readonly element?: string;
|
|
399
|
+
readonly xmlPath?: string;
|
|
400
|
+
readonly tableCellPath?: string;
|
|
401
|
+
readonly tableDepth?: number;
|
|
399
402
|
readonly ordinal?: number;
|
|
400
403
|
readonly startOffset?: number;
|
|
401
404
|
readonly endOffset?: number;
|
|
@@ -1382,6 +1385,7 @@ interface TableNode {
|
|
|
1382
1385
|
}
|
|
1383
1386
|
interface TableRowNode {
|
|
1384
1387
|
readonly type: "table_row";
|
|
1388
|
+
readonly sourceRef?: CanonicalSourceRef;
|
|
1385
1389
|
/** @deprecated Use `unknownPropertyChildren`. Kept for snapshot back-compat. */
|
|
1386
1390
|
readonly propertiesXml?: string;
|
|
1387
1391
|
readonly unknownPropertyChildren?: UnknownPropertyChild[];
|
|
@@ -1399,6 +1403,7 @@ interface TableRowNode {
|
|
|
1399
1403
|
}
|
|
1400
1404
|
interface TableCellNode {
|
|
1401
1405
|
readonly type: "table_cell";
|
|
1406
|
+
readonly sourceRef?: CanonicalSourceRef;
|
|
1402
1407
|
/** @deprecated Use `unknownPropertyChildren`. Kept for snapshot back-compat. */
|
|
1403
1408
|
readonly propertiesXml?: string;
|
|
1404
1409
|
readonly unknownPropertyChildren?: UnknownPropertyChild[];
|
|
@@ -1698,10 +1703,12 @@ interface BookmarkStartNode {
|
|
|
1698
1703
|
readonly type: "bookmark_start";
|
|
1699
1704
|
readonly bookmarkId: string;
|
|
1700
1705
|
readonly name: string;
|
|
1706
|
+
readonly sourceRef?: CanonicalSourceRef;
|
|
1701
1707
|
}
|
|
1702
1708
|
interface BookmarkEndNode {
|
|
1703
1709
|
readonly type: "bookmark_end";
|
|
1704
1710
|
readonly bookmarkId: string;
|
|
1711
|
+
readonly sourceRef?: CanonicalSourceRef;
|
|
1705
1712
|
}
|
|
1706
1713
|
interface SectionBreakNode {
|
|
1707
1714
|
readonly type: "section_break";
|
|
@@ -2071,6 +2078,7 @@ interface VmlShapeNode {
|
|
|
2071
2078
|
*/
|
|
2072
2079
|
interface OleEmbedNode {
|
|
2073
2080
|
readonly type: "ole_embed";
|
|
2081
|
+
readonly sourceRef?: CanonicalSourceRef;
|
|
2074
2082
|
readonly id: string;
|
|
2075
2083
|
readonly progId?: string;
|
|
2076
2084
|
readonly embedType: "oleObject";
|
|
@@ -2478,4 +2486,4 @@ interface DiagnosticErrorEntry {
|
|
|
2478
2486
|
*/
|
|
2479
2487
|
declare function createCanonicalDocumentId(documentId: string): string;
|
|
2480
2488
|
|
|
2481
|
-
export { type
|
|
2489
|
+
export { type TextProperties as $, type PreserveOnlyObjectSizing as A, type BlockNode as B, type CanonicalDocument as C, type DocumentRootNode as D, type TableCellNode as E, type FieldFamily as F, type TextMark as G, type Mutable as H, type ISO8601DateTime as I, type ParagraphNode as J, type TableIndent as K, type TableCellMargins as L, type ModelValidationIssue as M, type TableNode as N, type OpaqueFragmentRecord as O, type PageSize as P, type FieldRegistryEntry as Q, type RevisionStoryTargetRecord as R, type SectionProperties as S, type TableLook as T, type FootnoteProperties as U, type EndnoteProperties as V, type CanonicalTheme as W, type InlineNode as X, type CanonicalParagraphFormatting as Y, type CanonicalRunFormatting as Z, type FillSpec as _, type PageMargins as a, type StrokeSpec as a0, type ChartModel as a1, type ResolvedTheme as a2, type ColorRef as a3, type SupportedFieldFamily as a4, type HeaderDocument as a5, type FooterDocument as a6, type ParagraphBorders as a7, type AreaChartModel as a8, type Axis as a9, type UnsupportedReason as aA, type ValueAxis as aB, type AxisBase as aa, type BarChartModel as ab, type BubbleChartModel as ac, type BubbleSeries as ad, type CategoryAxis as ae, type CategoryLikeAxis as af, type ChartCommon as ag, type ColorMod as ah, type ComboChartModel as ai, type DataLabelsSpec as aj, type DataPointOverride as ak, type DateAxis as al, type Legend as am, type LineChartModel as an, type LineSeries as ao, type MarkerSpec as ap, type PieChartModel as aq, type PieSeries as ar, type ScatterChartModel as as, type ScatterSeries as at, type Series as au, type SeriesAxis as av, type SeriesBase as aw, type ShapeProperties as ax, type Title as ay, type UnsupportedChartModel as az, type ColumnProperties as b, type PageNumbering as c, type PreservationStore as d, type DocumentNode as e, type PersistedEditorSnapshotVersion as f, CDS_SCHEMA_VERSION as g, type CompatibilityReportVersion as h, type Base64 as i, type CommentThread as j, type CommentEntry as k, type CommentResolution as l, type RevisionMetadataRecord as m, type RevisionRecord as n, createCanonicalDocumentId as o, type TableStyleFormatting as p, type TableWidth as q, type TableBorders as r, type TableStyleConditionalRegion as s, type TableCellBorders as t, type CellShading as u, type CanonicalSourceRef as v, type SdtDataBindingState as w, type FieldRefreshStatus as x, type TocRegion as y, type CanonicalAnchor as z };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TextTransactionError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3OHVK2D6.js";
|
|
4
4
|
import {
|
|
5
5
|
replaceParagraphScope,
|
|
6
6
|
resolveParagraphScope
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZKSDVHGH.js";
|
|
8
8
|
import {
|
|
9
9
|
cloneParagraphProperties,
|
|
10
10
|
cloneStoryUnit,
|
|
11
11
|
parseTextStory,
|
|
12
12
|
serializeTextStory
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QIO6V46H.js";
|
|
14
14
|
import {
|
|
15
15
|
createSelectionSnapshot
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OYGMRRR7.js";
|
|
17
17
|
|
|
18
18
|
// src/core/commands/image-commands.ts
|
|
19
19
|
function insertImage(document, selection, _data, mimeType, _width, _height, context = { timestamp: (/* @__PURE__ */ new Date()).toISOString() }) {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-Y4XZCMCS.js";
|
|
4
4
|
import {
|
|
5
5
|
applyTextTransaction
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3OHVK2D6.js";
|
|
7
7
|
import {
|
|
8
8
|
createInsertedTableBlock,
|
|
9
9
|
createNoopStructuralMutation,
|
|
@@ -11,13 +11,14 @@ import {
|
|
|
11
11
|
replaceParagraphScope,
|
|
12
12
|
resolveInsertedTableStyleId,
|
|
13
13
|
resolveParagraphScope
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZKSDVHGH.js";
|
|
15
15
|
import {
|
|
16
|
+
NO_EDITABLE_TARGETS_INDEX,
|
|
16
17
|
createEditorSurfaceSnapshot
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3TUQCHYT.js";
|
|
18
19
|
import {
|
|
19
20
|
createSelectionSnapshot
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-OYGMRRR7.js";
|
|
21
22
|
import {
|
|
22
23
|
createEmptyMapping
|
|
23
24
|
} from "./chunk-M2HUK3KF.js";
|
|
@@ -48,7 +49,12 @@ function applyNextStyleToNewParagraph(result, nextStyleId) {
|
|
|
48
49
|
return result;
|
|
49
50
|
}
|
|
50
51
|
const head = result.selection.head;
|
|
51
|
-
const surface = createEditorSurfaceSnapshot(
|
|
52
|
+
const surface = createEditorSurfaceSnapshot(
|
|
53
|
+
result.document,
|
|
54
|
+
result.selection,
|
|
55
|
+
void 0,
|
|
56
|
+
{ editableTargetsByBlockPath: NO_EDITABLE_TARGETS_INDEX }
|
|
57
|
+
);
|
|
52
58
|
let targetBlockIndex = -1;
|
|
53
59
|
for (let i = 0; i < surface.blocks.length; i += 1) {
|
|
54
60
|
const surfaceBlock = surface.blocks[i];
|
|
@@ -6,13 +6,14 @@ import {
|
|
|
6
6
|
logicalPositionToUnitIndex,
|
|
7
7
|
parseTextStory,
|
|
8
8
|
serializeTextStory
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QIO6V46H.js";
|
|
10
10
|
import {
|
|
11
|
+
NO_EDITABLE_TARGETS_INDEX,
|
|
11
12
|
createEditorSurfaceSnapshot
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3TUQCHYT.js";
|
|
13
14
|
import {
|
|
14
15
|
createSelectionSnapshot
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OYGMRRR7.js";
|
|
16
17
|
|
|
17
18
|
// src/core/state/text-transaction.ts
|
|
18
19
|
var TextTransactionError = class extends Error {
|
|
@@ -115,7 +116,7 @@ function applyLinearTextTransaction(document, selection, intent, options) {
|
|
|
115
116
|
const insertionUnits = createInsertionUnits(intent, story, normalizedRange.from, resolvedMarks);
|
|
116
117
|
const unitFrom = logicalPositionToUnitIndex(story.units, normalizedRange.from, "after");
|
|
117
118
|
const unitTo = logicalPositionToUnitIndex(story.units, normalizedRange.to, "before");
|
|
118
|
-
|
|
119
|
+
ensureEditableTransactionRange(story.units, normalizedRange, unitFrom, unitTo);
|
|
119
120
|
const nextUnits = [
|
|
120
121
|
...story.units.slice(0, unitFrom).map(cloneStoryUnit),
|
|
121
122
|
...insertionUnits.map(cloneStoryUnit),
|
|
@@ -493,7 +494,9 @@ function resolveTableParagraphScope(document, selection, target) {
|
|
|
493
494
|
if (!root || root.type !== "doc" || !Array.isArray(root.children)) {
|
|
494
495
|
return null;
|
|
495
496
|
}
|
|
496
|
-
const surface = createEditorSurfaceSnapshot(document, selection
|
|
497
|
+
const surface = createEditorSurfaceSnapshot(document, selection, void 0, {
|
|
498
|
+
editableTargetsByBlockPath: NO_EDITABLE_TARGETS_INDEX
|
|
499
|
+
});
|
|
497
500
|
const selectionFrom = Math.min(selection.anchor, selection.head);
|
|
498
501
|
const selectionTo = Math.max(selection.anchor, selection.head);
|
|
499
502
|
for (let blockIndex = 0; blockIndex < root.children.length; blockIndex += 1) {
|
|
@@ -606,7 +609,9 @@ function resolveTargetlessTableStructureInsertRefusal(document, selection, inten
|
|
|
606
609
|
if (!root || root.type !== "doc" || !Array.isArray(root.children)) {
|
|
607
610
|
return null;
|
|
608
611
|
}
|
|
609
|
-
const surface = createEditorSurfaceSnapshot(document, selection
|
|
612
|
+
const surface = createEditorSurfaceSnapshot(document, selection, void 0, {
|
|
613
|
+
editableTargetsByBlockPath: NO_EDITABLE_TARGETS_INDEX
|
|
614
|
+
});
|
|
610
615
|
if (!selectionTouchesTableStructureBoundary(surface.blocks, selection.anchor)) {
|
|
611
616
|
return null;
|
|
612
617
|
}
|
|
@@ -656,7 +661,9 @@ function resolveTargetedTableParagraphScope(document, selection, target) {
|
|
|
656
661
|
if (cell.verticalMerge === "continue") {
|
|
657
662
|
return "unsupported";
|
|
658
663
|
}
|
|
659
|
-
const surface = createEditorSurfaceSnapshot(document, selection
|
|
664
|
+
const surface = createEditorSurfaceSnapshot(document, selection, void 0, {
|
|
665
|
+
editableTargetsByBlockPath: NO_EDITABLE_TARGETS_INDEX
|
|
666
|
+
});
|
|
660
667
|
const surfaceBlock = surface.blocks[target.tableBlockIndex];
|
|
661
668
|
const surfaceRow = surfaceBlock?.kind === "table" ? surfaceBlock.rows[target.rowIndex] : void 0;
|
|
662
669
|
const surfaceCell = surfaceRow?.cells[target.cellIndex];
|
|
@@ -727,7 +734,9 @@ function resolveTargetedTableParagraphScopeByPath(root, document, selection, tar
|
|
|
727
734
|
const resolved = resolveBlockPathInCanonicalBlocks(root.children, tokens, 0);
|
|
728
735
|
if (!resolved || resolved.block.type !== "paragraph") return null;
|
|
729
736
|
if (resolved.hasVerticalMergeContinuation) return null;
|
|
730
|
-
const surface = createEditorSurfaceSnapshot(document, selection
|
|
737
|
+
const surface = createEditorSurfaceSnapshot(document, selection, void 0, {
|
|
738
|
+
editableTargetsByBlockPath: NO_EDITABLE_TARGETS_INDEX
|
|
739
|
+
});
|
|
731
740
|
const surfaceResolved = resolveBlockPathInSurfaceBlocks(surface.blocks, tokens, 0);
|
|
732
741
|
if (!surfaceResolved || surfaceResolved.kind !== "paragraph") return null;
|
|
733
742
|
if (surfaceResolved.hasVerticalMergeContinuation) return null;
|
|
@@ -1187,7 +1196,9 @@ function resolveTopLevelParagraphScope(document, selection) {
|
|
|
1187
1196
|
if (!root || root.type !== "doc" || !Array.isArray(root.children)) {
|
|
1188
1197
|
return null;
|
|
1189
1198
|
}
|
|
1190
|
-
const surface = createEditorSurfaceSnapshot(document, selection
|
|
1199
|
+
const surface = createEditorSurfaceSnapshot(document, selection, void 0, {
|
|
1200
|
+
editableTargetsByBlockPath: NO_EDITABLE_TARGETS_INDEX
|
|
1201
|
+
});
|
|
1191
1202
|
const selectionFrom = Math.min(selection.anchor, selection.head);
|
|
1192
1203
|
const selectionTo = Math.max(selection.anchor, selection.head);
|
|
1193
1204
|
for (let blockIndex = 0; blockIndex < root.children.length; blockIndex += 1) {
|
|
@@ -1221,7 +1232,9 @@ function resolveTopLevelSdtParagraphScope(document, selection) {
|
|
|
1221
1232
|
if (!root || root.type !== "doc" || !Array.isArray(root.children)) {
|
|
1222
1233
|
return null;
|
|
1223
1234
|
}
|
|
1224
|
-
const surface = createEditorSurfaceSnapshot(document, selection
|
|
1235
|
+
const surface = createEditorSurfaceSnapshot(document, selection, void 0, {
|
|
1236
|
+
editableTargetsByBlockPath: NO_EDITABLE_TARGETS_INDEX
|
|
1237
|
+
});
|
|
1225
1238
|
const selectionFrom = Math.min(selection.anchor, selection.head);
|
|
1226
1239
|
const selectionTo = Math.max(selection.anchor, selection.head);
|
|
1227
1240
|
for (let blockIndex = 0; blockIndex < root.children.length; blockIndex += 1) {
|
|
@@ -1488,16 +1501,61 @@ function normalizeStoryUnits(units) {
|
|
|
1488
1501
|
}
|
|
1489
1502
|
function ensureEditableRange(units) {
|
|
1490
1503
|
const protectedUnit = units.find(
|
|
1491
|
-
(unit) => unit.kind === "opaque_inline" || unit.kind === "opaque_block" || unit.kind === "structural_block" || unit.kind === "image"
|
|
1504
|
+
(unit) => unit.kind === "opaque_inline" || unit.kind === "opaque_block" || unit.kind === "structural_block" || unit.kind === "image" || unit.kind === "protected_inline"
|
|
1505
|
+
);
|
|
1506
|
+
if (!protectedUnit) {
|
|
1507
|
+
return;
|
|
1508
|
+
}
|
|
1509
|
+
throw new TextTransactionError(
|
|
1510
|
+
"unsupported_content",
|
|
1511
|
+
`Text transaction crosses protected ${protectedUnit.kind === "protected_inline" ? protectedUnit.reason : protectedUnit.kind} content.`
|
|
1492
1512
|
);
|
|
1513
|
+
}
|
|
1514
|
+
function ensureEditableTransactionRange(units, range, unitFrom, unitTo) {
|
|
1515
|
+
ensureEditableRange(units.slice(unitFrom, unitTo));
|
|
1516
|
+
const protectedUnit = range.from === range.to ? protectedInlineAtPosition(units, range.from) : protectedInlineOverlappingRange(units, range);
|
|
1493
1517
|
if (!protectedUnit) {
|
|
1494
1518
|
return;
|
|
1495
1519
|
}
|
|
1496
1520
|
throw new TextTransactionError(
|
|
1497
1521
|
"unsupported_content",
|
|
1498
|
-
`Text transaction crosses protected ${protectedUnit.
|
|
1522
|
+
`Text transaction crosses protected ${protectedUnit.reason} content.`
|
|
1499
1523
|
);
|
|
1500
1524
|
}
|
|
1525
|
+
function protectedInlineOverlappingRange(units, range) {
|
|
1526
|
+
let cursor = 0;
|
|
1527
|
+
for (const unit of units) {
|
|
1528
|
+
if (unit.kind === "scope_marker") continue;
|
|
1529
|
+
if (unit.kind === "protected_inline") {
|
|
1530
|
+
const size = Math.max(0, unit.logicalSize);
|
|
1531
|
+
const start = cursor;
|
|
1532
|
+
const end = cursor + size;
|
|
1533
|
+
if (size > 0 && range.from < end && range.to > start || size === 0 && range.from <= start && range.to >= start) {
|
|
1534
|
+
return unit;
|
|
1535
|
+
}
|
|
1536
|
+
cursor = end;
|
|
1537
|
+
continue;
|
|
1538
|
+
}
|
|
1539
|
+
cursor += 1;
|
|
1540
|
+
}
|
|
1541
|
+
return null;
|
|
1542
|
+
}
|
|
1543
|
+
function protectedInlineAtPosition(units, position) {
|
|
1544
|
+
let cursor = 0;
|
|
1545
|
+
for (const unit of units) {
|
|
1546
|
+
if (unit.kind === "scope_marker") continue;
|
|
1547
|
+
if (unit.kind === "protected_inline") {
|
|
1548
|
+
const size = Math.max(0, unit.logicalSize);
|
|
1549
|
+
if (size > 0 && position > cursor && position < cursor + size) {
|
|
1550
|
+
return unit;
|
|
1551
|
+
}
|
|
1552
|
+
cursor += size;
|
|
1553
|
+
continue;
|
|
1554
|
+
}
|
|
1555
|
+
cursor += 1;
|
|
1556
|
+
}
|
|
1557
|
+
return null;
|
|
1558
|
+
}
|
|
1501
1559
|
function containsParagraphBoundaryChange(story, range, insertionUnits) {
|
|
1502
1560
|
if (insertionUnits.some((unit) => unit.kind === "paragraph_break")) {
|
|
1503
1561
|
return true;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
MAIN_STORY_KEY,
|
|
5
5
|
collectCanonicalFieldRegionIdentities,
|
|
6
6
|
collectEditableTargetRefs
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TFSXOIAI.js";
|
|
8
8
|
import {
|
|
9
9
|
describeOpaqueFragment,
|
|
10
10
|
describeStructuredWrapperBlock,
|
|
@@ -2854,6 +2854,7 @@ var PICTURE_EFFECT_SCHEME_ALIASES = {
|
|
|
2854
2854
|
bg2: "lt2"
|
|
2855
2855
|
};
|
|
2856
2856
|
var EMPTY_EDITABLE_TARGETS_BY_BLOCK_PATH = /* @__PURE__ */ new Map();
|
|
2857
|
+
var NO_EDITABLE_TARGETS_INDEX = EMPTY_EDITABLE_TARGETS_BY_BLOCK_PATH;
|
|
2857
2858
|
function indexEditableTargetsByBlockPath(document) {
|
|
2858
2859
|
const targets = collectEditableTargetRefs(document);
|
|
2859
2860
|
if (targets.length === 0) return EMPTY_EDITABLE_TARGETS_BY_BLOCK_PATH;
|
|
@@ -2905,7 +2906,7 @@ function createEditorSurfaceSnapshot(document, _selection, activeStory = { kind:
|
|
|
2905
2906
|
...options.getEffectiveMarkupMode ? { getEffectiveMarkupMode: options.getEffectiveMarkupMode } : {},
|
|
2906
2907
|
...options.authorColorPalette ? { authorColorPalette: options.authorColorPalette } : {}
|
|
2907
2908
|
});
|
|
2908
|
-
const editableTargetsByBlockPath = indexEditableTargetsByBlockPath(document);
|
|
2909
|
+
const editableTargetsByBlockPath = options.editableTargetsByBlockPath ?? indexEditableTargetsByBlockPath(document);
|
|
2909
2910
|
const activeStoryBlockPathBase = getActiveStoryBlockPathBase(document, activeStory);
|
|
2910
2911
|
chartModelStore.beginBuildPass(document);
|
|
2911
2912
|
const unsupportedNumberingFormatsSeen = options.emitFormattingTelemetry ? /* @__PURE__ */ new Set() : null;
|
|
@@ -3186,6 +3187,7 @@ function createTableBlock(tableIndex, table, document, cursor, counters, formatt
|
|
|
3186
3187
|
from: cursor,
|
|
3187
3188
|
to: innerCursor,
|
|
3188
3189
|
styleId: table.styleId,
|
|
3190
|
+
...table.sourceRef !== void 0 ? { sourceRef: table.sourceRef } : {},
|
|
3189
3191
|
gridColumns: table.gridColumns,
|
|
3190
3192
|
rows: []
|
|
3191
3193
|
},
|
|
@@ -3255,6 +3257,7 @@ function createTableBlock(tableIndex, table, document, cursor, counters, formatt
|
|
|
3255
3257
|
resolvedTable.table?.cellMargins
|
|
3256
3258
|
);
|
|
3257
3259
|
cells.push({
|
|
3260
|
+
...cell.sourceRef !== void 0 ? { sourceRef: cell.sourceRef } : {},
|
|
3258
3261
|
gridSpan: cell.gridSpan ?? 1,
|
|
3259
3262
|
verticalMerge: cell.verticalMerge ?? null,
|
|
3260
3263
|
colspan: cell.gridSpan ?? 1,
|
|
@@ -3278,6 +3281,7 @@ function createTableBlock(tableIndex, table, document, cursor, counters, formatt
|
|
|
3278
3281
|
}
|
|
3279
3282
|
const headerLike = row.isHeader === true || resolvedRow?.style.isHeader === true;
|
|
3280
3283
|
rows.push({
|
|
3284
|
+
...row.sourceRef !== void 0 ? { sourceRef: row.sourceRef } : {},
|
|
3281
3285
|
cells,
|
|
3282
3286
|
...row.gridBefore !== void 0 ? { gridBefore: row.gridBefore } : {},
|
|
3283
3287
|
...row.gridAfter !== void 0 ? { gridAfter: row.gridAfter } : {},
|
|
@@ -3308,6 +3312,7 @@ function createTableBlock(tableIndex, table, document, cursor, counters, formatt
|
|
|
3308
3312
|
from: cursor,
|
|
3309
3313
|
to: innerCursor,
|
|
3310
3314
|
styleId: table.styleId,
|
|
3315
|
+
...table.sourceRef !== void 0 ? { sourceRef: table.sourceRef } : {},
|
|
3311
3316
|
gridColumns: table.gridColumns,
|
|
3312
3317
|
...gridColumnsRelative ? { gridColumnsRelative } : {},
|
|
3313
3318
|
...resolvedTable.table?.alignment ? { alignment: resolvedTable.table.alignment } : {},
|
|
@@ -3852,6 +3857,7 @@ function appendInlineSegments(paragraph, node, document, start, promoteSecondary
|
|
|
3852
3857
|
const anchor = surfaceAnchorFromGeometry(node.anchor);
|
|
3853
3858
|
const txbxTextSegment = c.isTextBox ? extractTxbxFirstTextSegment(c.txbxBlocks) : void 0;
|
|
3854
3859
|
const txbxText = txbxTextSegment?.text ?? (c.isTextBox ? c.text : void 0);
|
|
3860
|
+
const txbxBody = c.isTextBox ? surfaceTextBoxBodyFromShape(c, node.sourceRef) : void 0;
|
|
3855
3861
|
const surfaceFill = c.fill;
|
|
3856
3862
|
paragraph.segments.push({
|
|
3857
3863
|
segmentId: `${paragraph.blockId}-segment-${paragraph.segments.length}`,
|
|
@@ -3868,6 +3874,7 @@ function appendInlineSegments(paragraph, node, document, start, promoteSecondary
|
|
|
3868
3874
|
...c.textBoxBody ? { textBoxBody: c.textBoxBody } : {},
|
|
3869
3875
|
...c.preserveOnlyObject ? { preserveOnlyObject: surfacePreserveOnlyObject(c.preserveOnlyObject) } : {},
|
|
3870
3876
|
...txbxText ? { txbxText } : {},
|
|
3877
|
+
...txbxBody ? { txbxBody } : {},
|
|
3871
3878
|
...txbxTextSegment?.marks && txbxTextSegment.marks.length > 0 ? { txbxMarks: txbxTextSegment.marks } : {},
|
|
3872
3879
|
...txbxTextSegment?.markAttrs ? { txbxMarkAttrs: txbxTextSegment.markAttrs } : {}
|
|
3873
3880
|
});
|
|
@@ -4280,6 +4287,97 @@ function extractTxbxFirstTextSegment(blocks) {
|
|
|
4280
4287
|
}
|
|
4281
4288
|
return void 0;
|
|
4282
4289
|
}
|
|
4290
|
+
function surfaceTextBoxBodyFromShape(shape, sourceRef) {
|
|
4291
|
+
if (!shape.isTextBox && shape.txbxContentXml === void 0 && shape.txbxBlocks === void 0) {
|
|
4292
|
+
return void 0;
|
|
4293
|
+
}
|
|
4294
|
+
if (shape.txbxBlocks === void 0) {
|
|
4295
|
+
return {
|
|
4296
|
+
...sourceRef !== void 0 ? { sourceRef } : {},
|
|
4297
|
+
status: shape.txbxContentXml !== void 0 ? "preserve-only" : "unavailable",
|
|
4298
|
+
unavailableReason: "txbx-blocks-unavailable",
|
|
4299
|
+
...shape.textBoxBody !== void 0 ? { bodyProperties: shape.textBoxBody } : {},
|
|
4300
|
+
blockCount: 0,
|
|
4301
|
+
paragraphCount: 0,
|
|
4302
|
+
unsupportedBlockCount: 0,
|
|
4303
|
+
paragraphs: []
|
|
4304
|
+
};
|
|
4305
|
+
}
|
|
4306
|
+
const paragraphs = shape.txbxBlocks.flatMap((block, blockIndex) => {
|
|
4307
|
+
if (block.type !== "paragraph") return [];
|
|
4308
|
+
const children = block.children;
|
|
4309
|
+
const legacyRuns = block.runs;
|
|
4310
|
+
const runs = children !== void 0 ? children.map(
|
|
4311
|
+
(inline, inlineIndex) => surfaceTextBoxRunFromInline(inline, inlineIndex)
|
|
4312
|
+
) : legacyRuns?.map(
|
|
4313
|
+
(run, inlineIndex) => surfaceTextBoxRunFromLegacyRun(run, inlineIndex)
|
|
4314
|
+
) ?? [];
|
|
4315
|
+
const text = runs.map((run) => run.text ?? "").join("");
|
|
4316
|
+
return [{
|
|
4317
|
+
...block.sourceRef !== void 0 ? { sourceRef: block.sourceRef } : {},
|
|
4318
|
+
blockIndex,
|
|
4319
|
+
text,
|
|
4320
|
+
textLength: Array.from(text).length,
|
|
4321
|
+
...block.borders !== void 0 ? { borders: block.borders } : {},
|
|
4322
|
+
runs
|
|
4323
|
+
}];
|
|
4324
|
+
});
|
|
4325
|
+
const unsupportedBlockCount = shape.txbxBlocks.length - paragraphs.length;
|
|
4326
|
+
const unavailableReason = shape.txbxBlocks.length === 0 ? "empty-body" : paragraphs.length === 0 ? "unsupported-content" : void 0;
|
|
4327
|
+
return {
|
|
4328
|
+
...sourceRef !== void 0 ? { sourceRef } : {},
|
|
4329
|
+
status: unavailableReason === void 0 ? "modeled" : "unavailable",
|
|
4330
|
+
...unavailableReason !== void 0 ? { unavailableReason } : {},
|
|
4331
|
+
...shape.textBoxBody !== void 0 ? { bodyProperties: shape.textBoxBody } : {},
|
|
4332
|
+
blockCount: shape.txbxBlocks.length,
|
|
4333
|
+
paragraphCount: paragraphs.length,
|
|
4334
|
+
unsupportedBlockCount,
|
|
4335
|
+
paragraphs
|
|
4336
|
+
};
|
|
4337
|
+
}
|
|
4338
|
+
function surfaceTextBoxRunFromLegacyRun(run, inlineIndex) {
|
|
4339
|
+
const text = run.text ?? "";
|
|
4340
|
+
const cloned = run.marks ? cloneMarks(run.marks) : void 0;
|
|
4341
|
+
return {
|
|
4342
|
+
inlineIndex,
|
|
4343
|
+
kind: "text",
|
|
4344
|
+
text,
|
|
4345
|
+
textLength: Array.from(text).length,
|
|
4346
|
+
...cloned?.marks && cloned.marks.length > 0 ? { marks: cloned.marks } : {},
|
|
4347
|
+
...cloned?.markAttrs ? { markAttrs: cloned.markAttrs } : {}
|
|
4348
|
+
};
|
|
4349
|
+
}
|
|
4350
|
+
function surfaceTextBoxRunFromInline(inline, inlineIndex) {
|
|
4351
|
+
if (inline.type === "text") {
|
|
4352
|
+
const cloned = inline.marks ? cloneMarks(inline.marks) : void 0;
|
|
4353
|
+
return {
|
|
4354
|
+
inlineIndex,
|
|
4355
|
+
kind: "text",
|
|
4356
|
+
text: inline.text,
|
|
4357
|
+
textLength: Array.from(inline.text).length,
|
|
4358
|
+
...cloned?.marks && cloned.marks.length > 0 ? { marks: cloned.marks } : {},
|
|
4359
|
+
...cloned?.markAttrs ? { markAttrs: cloned.markAttrs } : {}
|
|
4360
|
+
};
|
|
4361
|
+
}
|
|
4362
|
+
if (inline.type === "tab") {
|
|
4363
|
+
return { inlineIndex, kind: "tab", text: " ", textLength: 1 };
|
|
4364
|
+
}
|
|
4365
|
+
if (inline.type === "hard_break") {
|
|
4366
|
+
return { inlineIndex, kind: "hard-break", text: "\n", textLength: 1 };
|
|
4367
|
+
}
|
|
4368
|
+
if (inline.type === "symbol") {
|
|
4369
|
+
const cloned = inline.marks ? cloneMarks(inline.marks) : void 0;
|
|
4370
|
+
return {
|
|
4371
|
+
inlineIndex,
|
|
4372
|
+
kind: "symbol",
|
|
4373
|
+
text: inline.char,
|
|
4374
|
+
textLength: Array.from(inline.char).length,
|
|
4375
|
+
...cloned?.marks && cloned.marks.length > 0 ? { marks: cloned.marks } : {},
|
|
4376
|
+
...cloned?.markAttrs ? { markAttrs: cloned.markAttrs } : {}
|
|
4377
|
+
};
|
|
4378
|
+
}
|
|
4379
|
+
return { inlineIndex, kind: "unsupported" };
|
|
4380
|
+
}
|
|
4283
4381
|
function appendComplexPreviewSegment(paragraph, node, start, label, detail, extras = {}) {
|
|
4284
4382
|
const preserveOnlyObject = node.preserveOnlyObject ? surfacePreserveOnlyObject(node.preserveOnlyObject) : void 0;
|
|
4285
4383
|
paragraph.segments.push({
|
|
@@ -4797,5 +4895,6 @@ export {
|
|
|
4797
4895
|
resolveTableStyleResolution,
|
|
4798
4896
|
createFormattingContext,
|
|
4799
4897
|
createViewportCulledSurfaceFromFullSurface,
|
|
4898
|
+
NO_EDITABLE_TARGETS_INDEX,
|
|
4800
4899
|
createEditorSurfaceSnapshot
|
|
4801
4900
|
};
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getRevisionRangeState,
|
|
9
9
|
selectionTouchesRange,
|
|
10
10
|
shouldHideInCleanMode
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QFU7ZOAD.js";
|
|
12
12
|
|
|
13
13
|
// src/ui-tailwind/editor-surface/tw-editor-surface.tsx
|
|
14
14
|
import { useMemo } from "react";
|
|
@@ -674,8 +674,8 @@ var focusRingClass3 = "focus-visible:outline-none focus-visible:shadow-[var(--sh
|
|
|
674
674
|
function TwShellHeader(props) {
|
|
675
675
|
const className = [
|
|
676
676
|
"grid h-12 shrink-0 grid-cols-[1fr_auto_1fr] items-center gap-2 px-4",
|
|
677
|
-
"bg-[var(--color-bg-chrome)]
|
|
678
|
-
|
|
677
|
+
"bg-[var(--color-bg-chrome)]",
|
|
678
|
+
"border-b border-[var(--color-border-subtle)]",
|
|
679
679
|
"transition-colors duration-[var(--motion-fast)]",
|
|
680
680
|
props.className
|
|
681
681
|
].filter(Boolean).join(" ");
|
|
@@ -40,6 +40,10 @@ var BROADCAST_COMMAND_TYPES = /* @__PURE__ */ new Set([
|
|
|
40
40
|
"list.continue-numbering",
|
|
41
41
|
"table.apply-structure",
|
|
42
42
|
"table.apply-text",
|
|
43
|
+
"field.refresh",
|
|
44
|
+
"toc.refresh",
|
|
45
|
+
"bookmark.edit-content",
|
|
46
|
+
"hyperlink.update-destination",
|
|
43
47
|
"image.insert",
|
|
44
48
|
"image.set-layout",
|
|
45
49
|
"image.set-frame",
|