oasis-editor 0.0.397 → 0.0.398
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-Bzk0rSbq.js +1 -0
- package/dist/assets/{importDocxWorker-C6vLHeaU.js → importDocxWorker-gjomIN7s.js} +2434 -2214
- package/dist/core/document/fieldEvaluation.d.ts +24 -1
- package/dist/core/document/nestedConditionalFields.d.ts +8 -0
- package/dist/core/model/types/document.d.ts +5 -0
- package/dist/defaultToolbar-Bc3d9BXm.js +1 -0
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/ooxml/opc/documentProperties.d.ts +15 -0
- package/dist/sourcePackage-D_eKi6F8.js +1 -0
- package/package.json +1 -1
- package/dist/OasisEditorApp-BTHv-Yyc.js +0 -1
- package/dist/defaultToolbar-Bl3U_cmM.js +0 -1
- package/dist/sourcePackage-DB0wV9SH.js +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PageNumberFormat } from '../model.js';
|
|
2
2
|
import { TemporalFormattingOptions } from '../format/temporalFieldFormat.js';
|
|
3
3
|
import { FieldStorySpan } from './fieldStoryGraph.js';
|
|
4
|
+
import { DocumentPropertyValues } from '../../ooxml/opc/documentProperties.js';
|
|
4
5
|
export type NumericFieldCommand = "PAGE" | "NUMPAGES" | "SECTION" | "SECTIONPAGES";
|
|
5
6
|
export type ReferenceFieldCommand = "REF" | "PAGEREF";
|
|
6
7
|
export type TemporalFieldCommand = "DATE" | "TIME" | "CREATEDATE" | "SAVEDATE" | "PRINTDATE";
|
|
@@ -12,7 +13,22 @@ export interface SequenceField {
|
|
|
12
13
|
headingLevel?: number;
|
|
13
14
|
format?: PageNumberFormat;
|
|
14
15
|
}
|
|
15
|
-
export type
|
|
16
|
+
export type ConditionalOperand = {
|
|
17
|
+
kind: "literal";
|
|
18
|
+
value: string;
|
|
19
|
+
} | {
|
|
20
|
+
kind: "document-variable" | "document-property";
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
export interface NestedConditionalField {
|
|
24
|
+
type: "IF_NESTED";
|
|
25
|
+
left: ConditionalOperand;
|
|
26
|
+
right: ConditionalOperand;
|
|
27
|
+
operator: "=" | "<>" | "<" | ">" | "<=" | ">=";
|
|
28
|
+
whenTrue: string;
|
|
29
|
+
whenFalse: string;
|
|
30
|
+
}
|
|
31
|
+
export type EvaluatableField = SequenceField | NestedConditionalField | {
|
|
16
32
|
type: TemporalFieldCommand;
|
|
17
33
|
temporal: true;
|
|
18
34
|
picture?: string;
|
|
@@ -23,6 +39,9 @@ export type EvaluatableField = SequenceField | {
|
|
|
23
39
|
type: ReferenceFieldCommand;
|
|
24
40
|
bookmark: string;
|
|
25
41
|
hyperlink?: boolean;
|
|
42
|
+
} | {
|
|
43
|
+
type: "DOCPROPERTY";
|
|
44
|
+
name: string;
|
|
26
45
|
} | {
|
|
27
46
|
type: "DOCVARIABLE";
|
|
28
47
|
name: string;
|
|
@@ -59,6 +78,9 @@ export type FieldDependency = {
|
|
|
59
78
|
} | {
|
|
60
79
|
kind: "document-variable";
|
|
61
80
|
name: string;
|
|
81
|
+
} | {
|
|
82
|
+
kind: "document-property";
|
|
83
|
+
name: string;
|
|
62
84
|
};
|
|
63
85
|
/** All numbers are the caller's one-based display values, not array indexes.
|
|
64
86
|
* No DOM, clock, mutable editor state or layout service is consulted here.
|
|
@@ -67,6 +89,7 @@ export type FieldDependency = {
|
|
|
67
89
|
export interface FieldEvaluationContext {
|
|
68
90
|
temporal?: TemporalFieldContext;
|
|
69
91
|
documentVariables?: Readonly<Record<string, string>>;
|
|
92
|
+
documentProperties?: Readonly<DocumentPropertyValues>;
|
|
70
93
|
/** Precomputed value for this exact SEQ occurrence, never a mutable counter. */
|
|
71
94
|
sequenceValue?: number;
|
|
72
95
|
pageNumber?: number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditorParagraphNode } from '../model.js';
|
|
2
|
+
import { NestedConditionalField } from './fieldEvaluation.js';
|
|
3
|
+
import { FieldStoryGraph, FieldStorySpan } from './fieldStoryGraph.js';
|
|
4
|
+
/** Qualify one complete scalar, single-paragraph IF with one or two direct
|
|
5
|
+
* nested DOCVARIABLE/DOCPROPERTY operands. Reject non-operand nesting,
|
|
6
|
+
* arbitrary code, locks, unresolved spans and non-token-boundary insertion.
|
|
7
|
+
* No nested field cache is written or executed. */
|
|
8
|
+
export declare function compileNestedConditionalField(parent: FieldStorySpan, graph: FieldStoryGraph, paragraph: EditorParagraphNode): NestedConditionalField | undefined;
|
|
@@ -270,6 +270,11 @@ export interface EditorDocument {
|
|
|
270
270
|
* substitution metadata. Preserved on import and re-emitted on export.
|
|
271
271
|
*/
|
|
272
272
|
fontTable?: EditorFontInfo[];
|
|
273
|
+
/** Qualified plain-text document properties read from OPC core and custom parts. */
|
|
274
|
+
documentProperties?: {
|
|
275
|
+
core?: Record<string, string>;
|
|
276
|
+
custom?: Record<string, string>;
|
|
277
|
+
};
|
|
273
278
|
/** Imported w:docVars plain-text values. */
|
|
274
279
|
documentVariables?: Record<string, string>;
|
|
275
280
|
/** Actual document lifecycle timestamps, epoch milliseconds. Missing means unknown. */
|