oasis-editor 0.0.102 → 0.0.104

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.
@@ -1,7 +1,7 @@
1
1
  import { JSX } from 'solid-js';
2
2
  import { EditorState } from './model.js';
3
3
  import { CommandRef } from './commands/CommandRef.js';
4
- import { RibbonRow, RibbonSize, RibbonTabId } from './pluginUiTypes.js';
4
+ import { RibbonGroupResizePolicy, RibbonRow, RibbonSize, RibbonTabId } from './pluginUiTypes.js';
5
5
 
6
6
  export type Unsubscribe = () => void;
7
7
  export interface OasisCommandContext {
@@ -47,6 +47,7 @@ export interface PluginAction {
47
47
  group?: string;
48
48
  row?: RibbonRow;
49
49
  ribbonSize?: RibbonSize;
50
+ ribbonGroupResize?: RibbonGroupResizePolicy;
50
51
  order?: number;
51
52
  }
52
53
  export interface PluginMenuItem extends PluginAction {
@@ -2,3 +2,12 @@ export declare const RIBBON_TABS: readonly ["file", "home", "insert", "draw", "l
2
2
  export type RibbonTabId = (typeof RIBBON_TABS)[number];
3
3
  export type RibbonRow = 1 | 2;
4
4
  export type RibbonSize = "normal" | "large";
5
+ export type RibbonGroupResizeState = "full" | "compact" | "collapsed";
6
+ export interface RibbonGroupResizePolicy {
7
+ states?: RibbonGroupResizeState[];
8
+ priority?: number;
9
+ compactMinWidth?: number;
10
+ collapsedMinWidth?: number;
11
+ collapsedIcon?: string;
12
+ compactLabels?: "show" | "hide";
13
+ }
@@ -1,5 +1,6 @@
1
1
  import { Element as XmlElement } from '@xmldom/xmldom';
2
2
  import { EditorParagraphStyle } from '../../core/model.js';
3
+ import { ThemeColorMap } from './themeColors.js';
3
4
 
4
5
  export declare function normalizeImportedParagraphStyle(style: EditorParagraphStyle | undefined): EditorParagraphStyle | undefined;
5
6
  export declare function withDocxImplicitSingleLineHeight(style: EditorParagraphStyle | undefined): EditorParagraphStyle;
@@ -15,4 +16,4 @@ export interface ParagraphAutospacingFlags {
15
16
  * reproduce that collapsing; see `collapseCellAutospacing` in tables.ts.
16
17
  */
17
18
  export declare function parseAutospacingFlags(paragraphProperties: XmlElement | null): ParagraphAutospacingFlags;
18
- export declare function parseParagraphStyle(paragraphProperties: XmlElement | null): EditorParagraphStyle | undefined;
19
+ export declare function parseParagraphStyle(paragraphProperties: XmlElement | null, colors?: ThemeColorMap): EditorParagraphStyle | undefined;
@@ -1,6 +1,7 @@
1
1
  import { Element as XmlElement } from '@xmldom/xmldom';
2
+ import { ThemeColorMap } from './themeColors.js';
2
3
 
3
4
  export declare function stripUndefined<T extends object>(value: T): Partial<T> | undefined;
4
5
  export declare function emptyOrUndefined<T extends object>(obj: T): T | undefined;
5
6
  export declare function mergeStyles<T extends object>(base: T | undefined, local: T | undefined): T | undefined;
6
- export declare function parseShdFill(element: XmlElement | null): string | undefined;
7
+ export declare function parseShdFill(element: XmlElement | null, colors?: ThemeColorMap): string | undefined;
@@ -2,6 +2,7 @@ import { Element as XmlElement } from '@xmldom/xmldom';
2
2
  import { EditorParagraphNode, EditorTableCellStyle, EditorTableRowNode, EditorTableRowStyle, EditorTableStyle, EditorTableConditionalFlags } from '../../core/model.js';
3
3
  import { EditorTableBorders } from './borders.js';
4
4
  import { ParagraphAutospacingFlags } from './paragraphStyle.js';
5
+ import { ThemeColorMap } from './themeColors.js';
5
6
 
6
7
  export declare function parseTableConditionalFlags(properties: XmlElement | null): EditorTableConditionalFlags | undefined;
7
8
  export declare function parseTableStyle(tblPr: XmlElement | null, tableStyleId?: string): EditorTableStyle | undefined;
@@ -15,7 +16,7 @@ export declare function getTableCellVMerge(cellProperties: XmlElement | null): "
15
16
  * anchor cell's colspan so both representations render identically.
16
17
  */
17
18
  export declare function getTableCellHMerge(cellProperties: XmlElement | null): "restart" | "continue" | undefined;
18
- export declare function parseTableCellStyle(cellProperties: XmlElement | null, tableDefaultMargins?: EditorTableStyle["defaultCellMargins"]): EditorTableCellStyle | undefined;
19
+ export declare function parseTableCellStyle(cellProperties: XmlElement | null, tableDefaultMargins?: EditorTableStyle["defaultCellMargins"], colors?: ThemeColorMap): EditorTableCellStyle | undefined;
19
20
  export declare function isTableHeaderRow(rowNode: XmlElement): boolean;
20
21
  /**
21
22
  * Reproduces Word's HTML-style margin collapsing for paragraphs that use "auto