oasis-editor 0.0.394 → 0.0.396
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/{OasisEditorApp-BJ1DYIA8.js → OasisEditorApp-stxDt_TR.js} +1 -1
- package/dist/assets/{importDocxWorker-DzdhjU7Z.js → importDocxWorker-4mvTDfet.js} +19 -7
- package/dist/core/document/fieldEvaluation.d.ts +2 -1
- package/dist/core/document/styleReference.d.ts +9 -2
- package/dist/core/model/index.d.ts +1 -1
- package/dist/core/model/types/layout.d.ts +12 -0
- package/dist/{defaultToolbar-D4Um9dcp.js → defaultToolbar-E4AWNPJb.js} +1 -1
- package/dist/layoutProjection/fieldDisplayOffsetMap.d.ts +8 -0
- package/dist/layoutProjection/fieldResultProjection.d.ts +4 -4
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/sourcePackage-D80cTee4.js +1 -0
- package/dist/ui/canvas/canvasSnapshotLines.d.ts +2 -1
- package/package.json +1 -1
- package/dist/sourcePackage-BeUrWy2m.js +0 -1
|
@@ -15068,16 +15068,28 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
15068
15068
|
if ("STYLEREF" === t.command) {
|
|
15069
15069
|
const e = r[0];
|
|
15070
15070
|
if (!e || "quoted" !== e.kind && "word" !== e.kind || !e.value.trim() || e.value.length > 128 || /[\r\n\t\\]/.test(e.value)) return;
|
|
15071
|
-
|
|
15071
|
+
let t, n = !1;
|
|
15072
|
+
for (const o of r.slice(1)) {
|
|
15073
|
+
if ("switch" !== o.kind) return;
|
|
15074
|
+
const e = o.value.toLowerCase();
|
|
15075
|
+
if ("l" === e) {
|
|
15076
|
+
if (n) return;
|
|
15077
|
+
n = !0;
|
|
15078
|
+
} else {
|
|
15079
|
+
if ("n" !== e && "p" !== e) return;
|
|
15080
|
+
if (t) return;
|
|
15081
|
+
t = "n" === e ? "number" : "position";
|
|
15082
|
+
}
|
|
15083
|
+
}
|
|
15084
|
+
return t ? {
|
|
15072
15085
|
type: "STYLEREF",
|
|
15073
15086
|
style: e.value,
|
|
15074
|
-
lastOnPage:
|
|
15075
|
-
|
|
15076
|
-
|
|
15077
|
-
return {
|
|
15087
|
+
lastOnPage: n,
|
|
15088
|
+
output: t
|
|
15089
|
+
} : {
|
|
15078
15090
|
type: "STYLEREF",
|
|
15079
15091
|
style: e.value,
|
|
15080
|
-
lastOnPage:
|
|
15092
|
+
lastOnPage: n
|
|
15081
15093
|
};
|
|
15082
15094
|
}
|
|
15083
15095
|
if ("SEQ" === t.command) {
|
|
@@ -15179,7 +15191,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
|
|
|
15179
15191
|
kind: "style-text",
|
|
15180
15192
|
name: e.style,
|
|
15181
15193
|
lastOnPage: e.lastOnPage
|
|
15182
|
-
}], o = t.styleRefText?.(e.style, e.lastOnPage);
|
|
15194
|
+
}], o = t.styleRefText?.(e.style, e.lastOnPage, e.output ?? "text");
|
|
15183
15195
|
return "string" == typeof o && o.length > 0 ? {
|
|
15184
15196
|
status: "resolved",
|
|
15185
15197
|
text: o,
|
|
@@ -27,6 +27,7 @@ export type EvaluatableField = SequenceField | {
|
|
|
27
27
|
type: "STYLEREF";
|
|
28
28
|
style: string;
|
|
29
29
|
lastOnPage: boolean;
|
|
30
|
+
output?: "number" | "position";
|
|
30
31
|
};
|
|
31
32
|
export type FieldDependency = {
|
|
32
33
|
kind: "page" | "document-pages" | "section" | "section-pages";
|
|
@@ -58,7 +59,7 @@ export interface FieldEvaluationContext {
|
|
|
58
59
|
bookmarkText?: (name: string) => string | null | undefined;
|
|
59
60
|
bookmarkPage?: (name: string) => number | null | undefined;
|
|
60
61
|
/** Exact resolved style text for a body occurrence or repeated page story. */
|
|
61
|
-
styleRefText?: (name: string, lastOnPage: boolean) => string | undefined;
|
|
62
|
+
styleRefText?: (name: string, lastOnPage: boolean, output: "text" | "number" | "position") => string | undefined;
|
|
62
63
|
}
|
|
63
64
|
export interface TemporalFieldContext extends TemporalFormattingOptions {
|
|
64
65
|
now?: number;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { EditorDocument, EditorLayoutDocument } from '../model.js';
|
|
2
|
+
export type StyleRefOutput = "text" | "number" | "position";
|
|
3
|
+
export interface StyleRefOptions {
|
|
4
|
+
output?: StyleRefOutput;
|
|
5
|
+
offset?: number;
|
|
6
|
+
zone?: "header" | "footer";
|
|
7
|
+
locale?: "en-US" | "pt-BR";
|
|
8
|
+
}
|
|
2
9
|
/** Read-only lookup of paragraph styles and source-certified paginated text.
|
|
3
10
|
* No DOM, layout mutations, speculative style inheritance, or evaluation of
|
|
4
11
|
* a nested field's cached output. Duplicate style names remain ambiguous. */
|
|
5
12
|
export declare function createStyleRefIndex(document: EditorDocument, layout?: EditorLayoutDocument): {
|
|
6
|
-
forBody: (paragraphId: string, name: string,
|
|
7
|
-
forPage: (pageIndex: number, name: string, lastOnPage?: boolean) => string | undefined;
|
|
13
|
+
forBody: (paragraphId: string, name: string, lastOnPage?: boolean, opts?: StyleRefOptions) => string | undefined;
|
|
14
|
+
forPage: (pageIndex: number, name: string, lastOnPage?: boolean, opts?: StyleRefOptions) => string | undefined;
|
|
8
15
|
};
|
|
@@ -21,7 +21,7 @@ export type { EditorReviewActivity, EditorReviewActivityKind, } from './types/do
|
|
|
21
21
|
export type { EditorOpcPartKind, EditorOpcPartEncoding, EditorOpcRelationship, EditorOpcContentTypes, EditorOpcPart, EditorDocxDiagnostic, EditorDocxSourcePackage, EditorDocxOpaqueObject, } from './types/docxSourcePackage.js';
|
|
22
22
|
export type { EditorPageMargins, EditorPageSettings, EditorColumnsSettings, EditorSection, EditorSectionBreakType, EditorSectionPropertiesSnapshot, EditorPageNumbering, EditorSectionVerticalAlign, EditorFontInfo, EditorFootnoteSettings, EditorFootnotes, EditorEndnoteSettings, EditorEndnotes, EditorDocumentDesign, EditorThemeData, EditorWatermark, EditorPageBorder, EditorDocument, } from './types/document.js';
|
|
23
23
|
export type { EditorPosition, EditorSelection, EditorEditingZone, } from './types/selection.js';
|
|
24
|
-
export type { EditorCaretSlot, EditorLayoutFragmentChar, EditorLayoutFragment, EditorLayoutLine, EditorResolvedTab, EditorLayoutParagraph, EditorLayoutBlock, TableCellBlockPosition, EditorLayoutPage, EditorLayoutDocument, } from './types/layout.js';
|
|
24
|
+
export type { EditorCaretSlot, EditorLayoutFragmentChar, EditorLayoutFragment, EditorLayoutLine, EditorResolvedTab, EditorLayoutDisplayOffsetSpan, EditorLayoutParagraph, EditorLayoutBlock, TableCellBlockPosition, EditorLayoutPage, EditorLayoutDocument, } from './types/layout.js';
|
|
25
25
|
export type { EditorState, ReviewDisplayMode } from './editorState.js';
|
|
26
26
|
export { EDITOR_ASSET_REF_PREFIX } from './types/primitives.js';
|
|
27
27
|
export { DEFAULT_TEXT_STYLE, DEFAULT_PARAGRAPH_STYLE, EFFECTIVE_TEXT_STYLE_DEFAULTS, EFFECTIVE_PARAGRAPH_STYLE_DEFAULTS, } from './styleDefaults.js';
|
|
@@ -59,7 +59,19 @@ export interface EditorLayoutLine {
|
|
|
59
59
|
* truth shared by alignment and the canvas/PDF renderers. */
|
|
60
60
|
trailingHyphenWidth?: number;
|
|
61
61
|
}
|
|
62
|
+
/** One display-only field replacement. Visual offsets belong to the page
|
|
63
|
+
* layout; source offsets belong to the editable DOCX model. Never save this
|
|
64
|
+
* mapping in the document or use it to rewrite field caches. */
|
|
65
|
+
export interface EditorLayoutDisplayOffsetSpan {
|
|
66
|
+
displayStart: number;
|
|
67
|
+
displayEnd: number;
|
|
68
|
+
sourceStart: number;
|
|
69
|
+
sourceEnd: number;
|
|
70
|
+
}
|
|
62
71
|
export interface EditorLayoutParagraph {
|
|
72
|
+
/** Maps per-page visual header/footer positions onto immutable source
|
|
73
|
+
* coordinates; absent means the layout uses source coordinates directly. */
|
|
74
|
+
displayOffsetMap?: EditorLayoutDisplayOffsetSpan[];
|
|
63
75
|
paragraphId: string;
|
|
64
76
|
text: string;
|
|
65
77
|
fragments: EditorLayoutFragment[];
|