oasis-editor 0.0.391 → 0.0.392

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.
@@ -4,7 +4,15 @@ import { FieldStorySpan } from './fieldStoryGraph.js';
4
4
  export type NumericFieldCommand = "PAGE" | "NUMPAGES" | "SECTION" | "SECTIONPAGES";
5
5
  export type ReferenceFieldCommand = "REF" | "PAGEREF";
6
6
  export type TemporalFieldCommand = "DATE" | "TIME" | "CREATEDATE" | "SAVEDATE" | "PRINTDATE";
7
- export type EvaluatableField = {
7
+ export interface SequenceField {
8
+ type: "SEQ";
9
+ identifier: string;
10
+ operation: "next" | "repeat" | "reset";
11
+ reset?: number;
12
+ headingLevel?: number;
13
+ format?: PageNumberFormat;
14
+ }
15
+ export type EvaluatableField = SequenceField | {
8
16
  type: TemporalFieldCommand;
9
17
  temporal: true;
10
18
  picture?: string;
@@ -23,6 +31,9 @@ export type FieldDependency = {
23
31
  name: string;
24
32
  } | {
25
33
  kind: "clock" | "created" | "saved" | "printed";
34
+ } | {
35
+ kind: "sequence";
36
+ name: string;
26
37
  };
27
38
  /** All numbers are the caller's one-based display values, not array indexes.
28
39
  * No DOM, clock, mutable editor state or layout service is consulted here.
@@ -30,6 +41,8 @@ export type FieldDependency = {
30
41
  * when it has positively established that the target does not exist. */
31
42
  export interface FieldEvaluationContext {
32
43
  temporal?: TemporalFieldContext;
44
+ /** Precomputed value for this exact SEQ occurrence, never a mutable counter. */
45
+ sequenceValue?: number;
33
46
  pageNumber?: number;
34
47
  totalPages?: number;
35
48
  sectionNumber?: number;
@@ -0,0 +1,7 @@
1
+ import { EditorDocument } from '../model.js';
2
+ export declare function sequenceOccurrenceKey(paragraphId: string, runIndex: number): string;
3
+ /** Resolve main-story occurrences in XML order, independently of selection,
4
+ * pagination and cached display text. A malformed/ambiguous story is not
5
+ * evaluated. Unsupported sequence operations poison their own identifier
6
+ * until a definite reset; unrelated sequences are unaffected. */
7
+ export declare function resolveBodySequences(document: EditorDocument): Map<string, number>;