oasis-editor 0.0.87 → 0.0.88

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.
@@ -54,13 +54,23 @@ export interface EssentialsFormattingCapability {
54
54
  setHighlight: (value: string | null) => boolean;
55
55
  setTextShading: (value: string | null) => boolean;
56
56
  setStyleId: (value: string) => boolean;
57
+ setCharacterStyleId: (value: string) => boolean;
57
58
  setUnderlineStyle: (value: string | null) => void;
58
59
  }
59
60
  export interface EssentialsDocumentStyleDescriptor {
60
61
  id: string;
61
62
  name: string;
63
+ type: "paragraph" | "character" | "table";
64
+ qFormat?: boolean;
65
+ uiPriority?: number;
66
+ semiHidden?: boolean;
67
+ unhideWhenUsed?: boolean;
68
+ isUsed?: boolean;
62
69
  fontFamily?: string;
63
70
  fontSize?: number;
71
+ color?: string;
72
+ bold?: boolean;
73
+ italic?: boolean;
64
74
  }
65
75
  export interface EssentialsDocumentCapability {
66
76
  documentStyles: () => EssentialsDocumentStyleDescriptor[];
@@ -42,7 +42,7 @@ export interface AppCommandsControllerDeps {
42
42
  export declare function createAppCommandsController(deps: AppCommandsControllerDeps): {
43
43
  commandsController: {
44
44
  applyBooleanStyleCommand: (key: BooleanStyleKey) => void;
45
- applyValueStyleCommand: <K extends "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
45
+ applyValueStyleCommand: <K extends "styleId" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
46
46
  applyChangeTextCaseCommand: (mode: import('../../core/commands/textCase').TextCaseMode) => void;
47
47
  applyClearFormattingCommand: () => void;
48
48
  applyParagraphStyleCommand: <K extends import('../toolbarStyleState.js').ParagraphStyleKey>(key: K, value: import('../../core/model.js').EditorParagraphStyle[K] | null) => void;
@@ -76,7 +76,7 @@ export declare function createAppCommandsController(deps: AppCommandsControllerD
76
76
  };
77
77
  keyboardCommandsController: {
78
78
  applyBooleanStyleCommand: (style: BooleanStyleKey) => void;
79
- applyValueStyleCommand: <K extends "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
79
+ applyValueStyleCommand: <K extends "styleId" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
80
80
  applyChangeTextCaseCommand: (mode: import('../../core/commands/textCase').TextCaseMode) => void;
81
81
  applyClearFormattingCommand: () => void;
82
82
  applyParagraphStyleCommand: <K extends import('../toolbarStyleState.js').ParagraphStyleKey>(key: K, value: import('../../core/model.js').EditorParagraphStyle[K] | null) => void;
@@ -57,7 +57,7 @@ export interface EditorCommandRuntimeDeps {
57
57
  export declare function createEditorCommandRuntime(deps: EditorCommandRuntimeDeps): {
58
58
  commandsController: {
59
59
  applyBooleanStyleCommand: (key: BooleanStyleKey) => void;
60
- applyValueStyleCommand: <K extends "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
60
+ applyValueStyleCommand: <K extends "styleId" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
61
61
  applyChangeTextCaseCommand: (mode: import('../../core/commands/textCase.js').TextCaseMode) => void;
62
62
  applyClearFormattingCommand: () => void;
63
63
  applyParagraphStyleCommand: <K extends import('../toolbarStyleState.js').ParagraphStyleKey>(key: K, value: import('../../core/model.js').EditorParagraphStyle[K] | null) => void;
@@ -130,7 +130,7 @@ export declare function createEditorInteractionRuntime(deps: EditorInteractionRu
130
130
  pendingCaretTextStyle: import('solid-js').Accessor<import('../../core/model.js').EditorTextStyle | undefined>;
131
131
  clearPendingCaretTextStyle: () => void;
132
132
  toolbarStyleState: () => import('../toolbarStyleState.js').ToolbarStyleState;
133
- applyToolbarValueStyleCommand: <K extends "link" | "underlineStyle" | "textEffect" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
133
+ applyToolbarValueStyleCommand: <K extends "link" | "styleId" | "underlineStyle" | "textEffect" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language">(key: K, value: import('../../core/model.js').EditorTextStyle[K] | null) => void;
134
134
  applyToolbarBooleanStyleCommand: (key: import('../toolbarStyleState.js').BooleanStyleKey) => void;
135
135
  };
136
136
  onEditorMouseDown: (event: MouseEvent) => void;
@@ -0,0 +1,9 @@
1
+ import { JSX } from 'solid-js';
2
+ import { StyleGalleryItem, ToolbarActionApi, ToolbarDocumentStyle } from './schema/items.js';
3
+
4
+ export declare function getQuickStyles(styles: ToolbarDocumentStyle[]): ToolbarDocumentStyle[];
5
+ export interface StyleGalleryProps {
6
+ item: StyleGalleryItem;
7
+ api: ToolbarActionApi;
8
+ }
9
+ export declare function StyleGallery(props: StyleGalleryProps): JSX.Element;
@@ -19,8 +19,17 @@ export interface ToolbarCommandState {
19
19
  export interface ToolbarDocumentStyle {
20
20
  id: string;
21
21
  name: string;
22
+ type: "paragraph" | "character" | "table";
23
+ qFormat?: boolean;
24
+ uiPriority?: number;
25
+ semiHidden?: boolean;
26
+ unhideWhenUsed?: boolean;
27
+ isUsed?: boolean;
22
28
  fontFamily?: string;
23
29
  fontSize?: number;
30
+ color?: string;
31
+ bold?: boolean;
32
+ italic?: boolean;
24
33
  }
25
34
  /**
26
35
  * Narrow surface every toolbar item depends on (DIP/ISP). Items only dispatch
@@ -111,6 +120,13 @@ export interface SelectItem extends ToolbarItemBase {
111
120
  placeholder?: string;
112
121
  width?: "wide" | "small" | "default";
113
122
  }
123
+ export interface StyleGalleryItem extends ToolbarItemBase {
124
+ type: "styleGallery";
125
+ /** Reactive descriptors supplied through the command-state boundary. */
126
+ styles: (api: ToolbarActionApi) => ToolbarDocumentStyle[];
127
+ paragraphCommand: CommandRef;
128
+ characterCommand: CommandRef;
129
+ }
114
130
  export interface ColorPickerItem extends ToolbarItemBase {
115
131
  type: "colorPicker";
116
132
  kind: "color" | "highlight" | "shading";
@@ -143,5 +159,5 @@ export interface CustomItem extends ToolbarItemBase {
143
159
  type: "custom";
144
160
  render: (api: ToolbarActionApi) => JSX.Element;
145
161
  }
146
- export type ToolbarItem = ButtonItem | ToggleItem | SplitItem | MenuItem | SelectItem | ColorPickerItem | GridPickerItem | SeparatorItem | GroupItem | CustomItem;
162
+ export type ToolbarItem = ButtonItem | ToggleItem | SplitItem | MenuItem | SelectItem | StyleGalleryItem | ColorPickerItem | GridPickerItem | SeparatorItem | GroupItem | CustomItem;
147
163
  export type ToolbarItemType = ToolbarItem["type"];
@@ -1,7 +1,7 @@
1
1
  import { EditorState } from '../core/model.js';
2
2
 
3
3
  export type BooleanStyleKey = "bold" | "italic" | "underline" | "strike" | "doubleStrike" | "superscript" | "subscript" | "smallCaps" | "allCaps" | "hidden" | "noProof" | "webHidden" | "specVanish" | "contextualAlternates";
4
- export type ValueStyleKey = "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle" | "underlineColor" | "characterScale" | "characterSpacing" | "baselineShift" | "kerningThreshold" | "ligatures" | "numberSpacing" | "numberForm" | "stylisticSet";
4
+ export type ValueStyleKey = "styleId" | "fontFamily" | "fontSize" | "color" | "highlight" | "shading" | "language" | "textEffect" | "link" | "underlineStyle" | "underlineColor" | "characterScale" | "characterSpacing" | "baselineShift" | "kerningThreshold" | "ligatures" | "numberSpacing" | "numberForm" | "stylisticSet";
5
5
  export type ParagraphStyleKey = "styleId" | "align" | "spacingBefore" | "spacingAfter" | "lineHeight" | "indentLeft" | "indentRight" | "indentFirstLine" | "indentHanging" | "shading" | "tabs" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "pageBreakBefore" | "keepWithNext";
6
6
  export interface ToolbarStyleState {
7
7
  bold: boolean;
@@ -36,6 +36,7 @@ export interface ToolbarStyleState {
36
36
  textEffect: string;
37
37
  link: string;
38
38
  styleId: string;
39
+ characterStyleId: string;
39
40
  align: string;
40
41
  lineHeight: string;
41
42
  spacingBefore: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oasis-editor",
3
- "version": "0.0.87",
3
+ "version": "0.0.88",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",