oasis-editor 0.0.390 → 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.
@@ -0,0 +1,5 @@
1
+ import { EditorDocument } from '../model.js';
2
+ /** Host-confirmed events only. Exporting a Blob, displaying a print dialog
3
+ * or cancelling it is not evidence that a save/print happened.
4
+ * Return a snapshot; the host decides whether and how to persist it. */
5
+ export declare function recordConfirmedDocumentEvent(document: EditorDocument, event: "created" | "saved" | "printed", epochMs: number): EditorDocument;
@@ -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>;
@@ -270,6 +270,12 @@ export interface EditorDocument {
270
270
  * substitution metadata. Preserved on import and re-emitted on export.
271
271
  */
272
272
  fontTable?: EditorFontInfo[];
273
+ /** Actual document lifecycle timestamps, epoch milliseconds. Missing means unknown. */
274
+ coreTimestamps?: {
275
+ created?: number;
276
+ saved?: number;
277
+ printed?: number;
278
+ };
273
279
  metadata?: {
274
280
  title?: string;
275
281
  [key: string]: unknown;