oasis-editor 0.0.147 → 0.0.148

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.
@@ -23,6 +23,7 @@ export interface EssentialsHistoryCapability {
23
23
  export interface EssentialsFormattingCapability {
24
24
  selectAll: () => boolean;
25
25
  insertFootnote: () => boolean;
26
+ insertText: (text: string, fontFamily?: string | null) => boolean;
26
27
  pastePlainText: () => boolean;
27
28
  bold: () => boolean;
28
29
  italic: () => boolean;
@@ -84,11 +85,13 @@ export interface EssentialsDocumentStyleDescriptor {
84
85
  }
85
86
  export interface EssentialsDocumentCapability {
86
87
  documentStyles: () => EssentialsDocumentStyleDescriptor[];
88
+ newDocument: () => void;
87
89
  exportDocx: () => void;
88
90
  exportPdf: () => void;
89
91
  importDocument: () => void;
90
92
  insertImage: () => void;
91
93
  insertShape: (preset: string) => void;
94
+ openSymbolDialog: () => void;
92
95
  }
93
96
  export interface EssentialsLinkCapability {
94
97
  prompt: () => void;
@@ -21,6 +21,8 @@ export interface EditorDialogsLayerProps {
21
21
  applyParagraphDialogValues: ComponentProps<typeof ParagraphDialog>["onApply"];
22
22
  setParagraphDialogDefault: NonNullable<ComponentProps<typeof ParagraphDialog>["onSetDefault"]>;
23
23
  applyTablePropertiesDialogValues: ComponentProps<typeof TablePropertiesDialog>["onApply"];
24
+ confirmNewDocument: () => void;
25
+ insertSymbol: (symbol: string, fontFamily: string) => void;
24
26
  closeContextMenu: () => void;
25
27
  }
26
28
  /**
@@ -45,6 +45,12 @@ export interface EditorCommandRuntimeDeps {
45
45
  isOpen: boolean;
46
46
  initialCaption: string;
47
47
  }) => void;
48
+ setNewDocumentDialog: (state: {
49
+ isOpen: boolean;
50
+ }) => void;
51
+ setSymbolDialog: (state: {
52
+ isOpen: boolean;
53
+ }) => void;
48
54
  getUiState: () => OasisEditorUiState;
49
55
  updateUiState: (patch: OasisEditorUiState) => OasisEditorUiState;
50
56
  zoom: {
@@ -26,6 +26,8 @@ export interface CreateEditorEssentialsPluginOptions {
26
26
  handleExportDocx: () => Promise<Blob>;
27
27
  handleExportPdf: () => Promise<Blob>;
28
28
  };
29
+ newDocument: () => void;
30
+ openSymbolDialog: () => void;
29
31
  importInputRef: () => HTMLInputElement | undefined;
30
32
  imageInputRef: () => HTMLInputElement | undefined;
31
33
  selectedImageRun: () => SelectedImageRun | null;
@@ -0,0 +1,7 @@
1
+ export interface NewDocumentActionDeps {
2
+ isDirty: () => boolean;
3
+ resetDocument: () => void;
4
+ requestConfirmation: () => void;
5
+ }
6
+ /** Creates the shared New Document action used by the ribbon, menu and shortcut. */
7
+ export declare function createNewDocumentAction(deps: NewDocumentActionDeps): () => void;
@@ -4,6 +4,18 @@ import { ParagraphDialogInitialValues } from '../components/Dialogs/ParagraphDia
4
4
  import { TablePropertiesDialogInitialValues } from '../components/Dialogs/TablePropertiesDialog.js';
5
5
 
6
6
  export interface EditorDialogsState {
7
+ newDocumentDialog: Accessor<{
8
+ isOpen: boolean;
9
+ }>;
10
+ setNewDocumentDialog: Setter<{
11
+ isOpen: boolean;
12
+ }>;
13
+ symbolDialog: Accessor<{
14
+ isOpen: boolean;
15
+ }>;
16
+ setSymbolDialog: Setter<{
17
+ isOpen: boolean;
18
+ }>;
7
19
  linkDialog: Accessor<{
8
20
  isOpen: boolean;
9
21
  initialHref: string;
@@ -0,0 +1,8 @@
1
+ import { JSX } from 'solid-js';
2
+
3
+ export interface NewDocumentConfirmationDialogProps {
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ onConfirm: () => void;
7
+ }
8
+ export declare function NewDocumentConfirmationDialog(props: NewDocumentConfirmationDialogProps): JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { JSX } from 'solid-js';
2
+
3
+ export interface SymbolDialogProps {
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ onInsert: (symbol: string, fontFamily: string) => void;
7
+ }
8
+ export declare function SymbolDialog(props: SymbolDialogProps): JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { JSX } from 'solid-js';
2
+ import { ToolbarActionApi } from './schema/items.js';
3
+
4
+ export declare function SymbolMenu(props: {
5
+ api: ToolbarActionApi;
6
+ }): JSX.Element;
@@ -1,7 +1,8 @@
1
1
  export declare const OASIS_TOOLBAR_ITEMS: {
2
+ readonly newDocument: "editor-toolbar-new-document";
3
+ readonly importDocument: "editor-toolbar-import-document";
2
4
  readonly exportDocx: "editor-toolbar-export-docx";
3
5
  readonly exportPdf: "editor-toolbar-export-pdf";
4
- readonly importDocument: "editor-toolbar-import-document";
5
6
  readonly undo: "editor-toolbar-undo";
6
7
  readonly redo: "editor-toolbar-redo";
7
8
  readonly style: "editor-toolbar-style";
@@ -18,6 +19,7 @@ export declare const OASIS_TOOLBAR_ITEMS: {
18
19
  readonly subscript: "editor-toolbar-subscript";
19
20
  readonly insertImage: "editor-toolbar-insert-image";
20
21
  readonly insertTable: "editor-toolbar-insert-table";
22
+ readonly symbols: "editor-toolbar-symbols";
21
23
  readonly link: "editor-toolbar-link";
22
24
  readonly unlink: "editor-toolbar-unlink";
23
25
  readonly footnote: "editor-toolbar-footnote";
@@ -12,6 +12,7 @@ export interface MenuProps {
12
12
  /** Extra class for the popover panel. */
13
13
  panelClass?: string;
14
14
  keepMounted?: boolean;
15
+ onOpenChange?: (open: boolean) => void;
15
16
  children: JSX.Element;
16
17
  }
17
18
  /**
@@ -0,0 +1,4 @@
1
+ import { SymbolEntry } from './symbolCatalog.js';
2
+
3
+ export declare function getRecentSymbols(): readonly SymbolEntry[];
4
+ export declare function rememberSymbol(character: string): void;
@@ -1,9 +1,10 @@
1
1
  import { Accessor, Setter, JSX } from 'solid-js';
2
- import { RibbonTabId, ToolbarActionApi } from '../schema/items.js';
2
+ import { RibbonTabId, ToolbarActionApi, ToolbarItem } from '../schema/items.js';
3
3
 
4
4
  export interface RibbonTabsProps {
5
5
  activeTab: Accessor<RibbonTabId>;
6
6
  setActiveTab: Setter<RibbonTabId>;
7
7
  api: ToolbarActionApi;
8
+ items: Accessor<ToolbarItem[]>;
8
9
  }
9
10
  export declare function RibbonTabs(props: RibbonTabsProps): JSX.Element;
@@ -30,7 +30,7 @@ export interface RibbonGroupWidth {
30
30
  * supplied, contextual tabs are omitted (used for static/enumeration contexts).
31
31
  */
32
32
  export declare function isRibbonTabVisible(id: RibbonTabId, api?: Pick<ToolbarActionApi, "commands">): boolean;
33
- export declare function buildRibbonTabDefinitions(t: TranslateFn, api?: Pick<ToolbarActionApi, "commands">): RibbonTabDefinition[];
33
+ export declare function buildRibbonTabDefinitions(t: TranslateFn, api?: Pick<ToolbarActionApi, "commands">, items?: ToolbarItem[]): RibbonTabDefinition[];
34
34
  export declare const DEFAULT_RIBBON_TAB: RibbonTabId;
35
35
  export declare const DEFAULT_RIBBON_GROUP = "general";
36
36
  export declare const DEFAULT_RIBBON_ROW: RibbonRow;
@@ -0,0 +1,16 @@
1
+ import { TranslationKey } from '../../../i18n/index.js';
2
+
3
+ export interface SymbolEntry {
4
+ character: string;
5
+ codePoint: string;
6
+ }
7
+ export interface SymbolCategory {
8
+ id: string;
9
+ labelKey: TranslationKey;
10
+ entries: readonly SymbolEntry[];
11
+ }
12
+ export declare const SYMBOL_CATEGORIES: readonly SymbolCategory[];
13
+ export declare const COMMON_SYMBOLS: SymbolEntry[];
14
+ export declare const NUMBER_SYMBOLS: readonly SymbolEntry[];
15
+ export declare const EQUATION_TEMPLATES: readonly SymbolEntry[];
16
+ export declare function getSymbolCategory(id: string): SymbolCategory | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oasis-editor",
3
- "version": "0.0.147",
3
+ "version": "0.0.148",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",