oasis-editor 0.0.124 → 0.0.126

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.
@@ -16,3 +16,16 @@ export declare const TEXT_BASELINE_RATIO = 0.8;
16
16
  * redefined in tablePagination, tableGeometry and the canvas cell prep.
17
17
  */
18
18
  export declare const NO_WRAP_MEASURE_WIDTH_PX = 100000;
19
+ /**
20
+ * Vertical offset (px) to add to a run's text baseline when
21
+ * `w:textAlignment` is set to a non-default value. Returns 0 for
22
+ * `auto`/`baseline`/absent (the common-baseline default) and whenever the run
23
+ * fills the line (font size ≥ line height), so the default layout is never
24
+ * shifted. Only mixed font sizes within one line are affected.
25
+ *
26
+ * The offset reuses {@link TEXT_BASELINE_RATIO} so canvas and PDF stay in sync:
27
+ * - `top`: run's own baseline sits at `R * fontSize` from the line top
28
+ * - `center`: run centered vertically in the line box
29
+ * - `bottom`: run's descent sits at the line bottom
30
+ */
31
+ export declare function resolveTextAlignmentBaselineOffset(textAlignment: "auto" | "top" | "center" | "baseline" | "bottom" | null | undefined, fontSizePx: number, lineHeightPx: number): number;
@@ -113,6 +113,52 @@ export interface EditorParagraphStyle {
113
113
  textDirection?: "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV" | null;
114
114
  /** `w:outlineLvl/@w:val`: outline level 0–8 (0 = Heading 1 … 8 = Heading 9). */
115
115
  outlineLevel?: number | null;
116
+ /**
117
+ * Paragraph decorations. These are mostly CJK typography, RTL, and
118
+ * legacy/positional flags whose value to the editor is faithful round-trip
119
+ * rather than on-canvas rendering. Booleans follow the same convention as
120
+ * the rest of this interface: the stored value reflects the OOXML state and
121
+ * export honors explicit `w:val="0"`.
122
+ */
123
+ /** `w:suppressLineNumbers/@w:val`: omit this paragraph from section line numbering. */
124
+ suppressLineNumbers?: boolean;
125
+ /** `w:suppressAutoHyphens/@w:val`: disable auto-hyphenation for this paragraph. */
126
+ suppressAutoHyphens?: boolean;
127
+ /** `w:bidi/@w:val`: paragraph flows right-to-left. */
128
+ bidi?: boolean;
129
+ /** `w:kinsoku/@w:val`: East Asian line-breaking rule (default on). */
130
+ kinsoku?: boolean;
131
+ /** `w:wordWrap/@w:val`: allow a Latin word to break across lines (default on). */
132
+ wordWrap?: boolean;
133
+ /** `w:overflowPunct/@w:val`: allow punctuation to overflow the margin (default on). */
134
+ overflowPunct?: boolean;
135
+ /** `w:topLinePunct/@w:val`: compress leading punctuation at line start. */
136
+ topLinePunct?: boolean;
137
+ /** `w:autoSpaceDE/@w:val`: auto-space between East Asian and Latin text (default on). */
138
+ autoSpaceDE?: boolean;
139
+ /** `w:autoSpaceDN/@w:val`: auto-space between East Asian and digits (default on). */
140
+ autoSpaceDN?: boolean;
141
+ /** `w:adjustRightInd/@w:val`: adjust right indent for character grid (default on). */
142
+ adjustRightInd?: boolean;
143
+ /** `w:textAlignment/@w:val`: vertical alignment of text within the line. */
144
+ textAlignment?: "auto" | "top" | "center" | "baseline" | "bottom" | null;
145
+ /** `w:textboxTightWrap/@w:val`: tight wrap behavior for text boxes. */
146
+ textboxTightWrap?: "none" | "allLines" | "firstLineOnly" | "firstLastLine" | null;
147
+ /** `w:divId/@w:val`: HTML-div mapping id (preserve only). */
148
+ divId?: number | null;
149
+ /** `w:cnfStyle/@w:val`: conditional style flags (table-style context). */
150
+ conditionalStyle?: EditorTableConditionalFlags | null;
151
+ /** `w:pBdr/w:between`: border drawn between adjacent matching paragraphs. */
152
+ borderBetween?: EditorBorderStyle | null;
153
+ /** `w:pBdr/w:bar`: vertical bar border at the left of the paragraph. */
154
+ borderBar?: EditorBorderStyle | null;
155
+ /**
156
+ * `w:framePr` — opaque serialized XML preserved verbatim for round-trip when
157
+ * the frame is not a drop cap. Drop-cap frames are owned by `dropCap`; every
158
+ * other `w:framePr` (positioned text frame) is re-emitted so the property is
159
+ * never silently dropped. Not rendered on any surface.
160
+ */
161
+ framePrXml?: string | null;
116
162
  }
117
163
  /** Row properties from a conditional format's `w:trPr`. */
118
164
  export interface EditorConditionalRowStyle {
@@ -14,6 +14,8 @@ interface EditorBoxBorders {
14
14
  borderRight?: EditorBorderStyle | null;
15
15
  borderBottom?: EditorBorderStyle | null;
16
16
  borderLeft?: EditorBorderStyle | null;
17
+ borderBetween?: EditorBorderStyle | null;
18
+ borderBar?: EditorBorderStyle | null;
17
19
  }
18
20
  /**
19
21
  * Serializes a `w:pBdr` element for the defined paragraph border edges. Returns
@@ -19,6 +19,10 @@ export interface EditorBoxBorders {
19
19
  borderEnd?: EditorBorderStyle;
20
20
  borderTopLeftToBottomRight?: EditorBorderStyle;
21
21
  borderTopRightToBottomLeft?: EditorBorderStyle;
22
+ /** `w:pBdr/w:between`: border between adjacent matching paragraphs. */
23
+ borderBetween?: EditorBorderStyle;
24
+ /** `w:pBdr/w:bar`: vertical bar border at the paragraph's leading edge. */
25
+ borderBar?: EditorBorderStyle;
22
26
  }
23
27
  export interface EditorTableBorders extends EditorBoxBorders {
24
28
  borderInsideH?: EditorBorderStyle;