oasis-editor 0.0.9 → 0.0.11
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.
- package/dist/{OasisEditorApp-kUhRrsHZ.js → OasisEditorApp-BgOoWqpC.js} +644 -96
- package/dist/app/controllers/EditorCommandsController.d.ts +3 -0
- package/dist/core/commands/builtinCommands.d.ts +1 -1
- package/dist/core/commands/publicCommandTypes.d.ts +5 -0
- package/dist/core/commands/shape.d.ts +9 -0
- package/dist/core/commands/text.d.ts +15 -0
- package/dist/core/editorCommands.d.ts +1 -0
- package/dist/export/pdf/OasisPdfWriter.d.ts +30 -0
- package/dist/export/pdf/draw/drawBlockList.d.ts +2 -2
- package/dist/export/pdf/draw/drawTextBoxShape.d.ts +34 -0
- package/dist/i18n/locales/en.d.ts +16 -0
- package/dist/i18n/locales/pt-BR.d.ts +16 -0
- package/dist/{index-D1GDOw-0.js → index-L71R0x7D.js} +536 -153
- package/dist/layoutProjection/presetGeometry.d.ts +31 -0
- package/dist/oasis-editor.js +54 -54
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/plugins/internal/createEssentialsPlugin.d.ts +10 -0
- package/dist/plugins/internal/essentialsCommandGroups.d.ts +4 -2
- package/dist/ui/canvas/presetGeometry.d.ts +7 -0
- package/dist/ui/fontSizeUnits.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OasisPlugin } from '../../../../core/plugin.js';
|
|
2
|
+
import { TextCaseMode } from '../../../../core/commands/text.js';
|
|
2
3
|
import { ToolbarStyleState } from '../../../../ui/toolbarStyleState.js';
|
|
3
4
|
|
|
4
5
|
export interface EssentialsFeatureGate {
|
|
@@ -7,6 +8,9 @@ export interface EssentialsFeatureGate {
|
|
|
7
8
|
export interface EssentialsStyleCapability {
|
|
8
9
|
state: () => ToolbarStyleState;
|
|
9
10
|
}
|
|
11
|
+
export interface EssentialsSelectionCapability {
|
|
12
|
+
isCollapsed: () => boolean;
|
|
13
|
+
}
|
|
10
14
|
export interface EssentialsHistoryCapability {
|
|
11
15
|
canUndo: () => boolean;
|
|
12
16
|
canRedo: () => boolean;
|
|
@@ -42,6 +46,10 @@ export interface EssentialsFormattingCapability {
|
|
|
42
46
|
splitBlock: () => boolean;
|
|
43
47
|
setFontFamily: (value: string | null) => boolean;
|
|
44
48
|
setFontSize: (value: number | null) => boolean;
|
|
49
|
+
increaseFontSize: () => boolean;
|
|
50
|
+
decreaseFontSize: () => boolean;
|
|
51
|
+
changeTextCase: (mode: TextCaseMode) => boolean;
|
|
52
|
+
clearFormatting: () => boolean;
|
|
45
53
|
setColor: (value: string | null) => boolean;
|
|
46
54
|
setHighlight: (value: string | null) => boolean;
|
|
47
55
|
setTextShading: (value: string | null) => boolean;
|
|
@@ -60,6 +68,7 @@ export interface EssentialsDocumentCapability {
|
|
|
60
68
|
exportPdf: () => void;
|
|
61
69
|
importDocument: () => void;
|
|
62
70
|
insertImage: () => void;
|
|
71
|
+
insertShape: (preset: string) => void;
|
|
63
72
|
}
|
|
64
73
|
export interface EssentialsLinkCapability {
|
|
65
74
|
prompt: () => void;
|
|
@@ -129,6 +138,7 @@ export interface EssentialsTableCapability {
|
|
|
129
138
|
export interface EssentialsPluginDeps {
|
|
130
139
|
gate: EssentialsFeatureGate;
|
|
131
140
|
style: EssentialsStyleCapability;
|
|
141
|
+
selection: EssentialsSelectionCapability;
|
|
132
142
|
history: EssentialsHistoryCapability;
|
|
133
143
|
formatting: EssentialsFormattingCapability;
|
|
134
144
|
document: EssentialsDocumentCapability;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { OasisPlugin } from '../../../../core/plugin.js';
|
|
2
2
|
import { ActionCommandBuilder, CommandBuilder, ValueCommandBuilder } from '../../essentialsCommandBuilders.js';
|
|
3
|
-
import { EssentialsBrowserCapability, EssentialsDocumentCapability, EssentialsFeatureGate, EssentialsFormattingCapability, EssentialsHistoryCapability, EssentialsImageCapability, EssentialsLinkCapability, EssentialsParagraphCapability, EssentialsSectionCapability, EssentialsStyleCapability, EssentialsTableCapability } from '../../createEssentialsPlugin.js';
|
|
3
|
+
import { EssentialsBrowserCapability, EssentialsDocumentCapability, EssentialsFeatureGate, EssentialsFormattingCapability, EssentialsHistoryCapability, EssentialsImageCapability, EssentialsLinkCapability, EssentialsParagraphCapability, EssentialsSectionCapability, EssentialsSelectionCapability, EssentialsStyleCapability, EssentialsTableCapability } from '../../createEssentialsPlugin.js';
|
|
4
4
|
|
|
5
5
|
interface CoreFormattingGroupDeps {
|
|
6
6
|
gate: EssentialsFeatureGate;
|
|
7
7
|
style: EssentialsStyleCapability;
|
|
8
|
+
selection: EssentialsSelectionCapability;
|
|
8
9
|
history: EssentialsHistoryCapability;
|
|
9
10
|
formatting: EssentialsFormattingCapability;
|
|
10
11
|
link: EssentialsLinkCapability;
|
|
11
12
|
command: CommandBuilder;
|
|
12
13
|
valueCommand: ValueCommandBuilder;
|
|
14
|
+
actionCommand: ActionCommandBuilder;
|
|
13
15
|
}
|
|
14
16
|
interface DocumentAndBrowserGroupDeps {
|
|
15
17
|
gate: EssentialsFeatureGate;
|
|
@@ -32,7 +34,7 @@ interface TableGroupDeps {
|
|
|
32
34
|
table: EssentialsTableCapability;
|
|
33
35
|
actionCommand: ActionCommandBuilder;
|
|
34
36
|
}
|
|
35
|
-
export declare function buildCoreFormattingCommands({ gate, style, history, formatting, link, command, valueCommand, }: CoreFormattingGroupDeps): NonNullable<OasisPlugin["commands"]>;
|
|
37
|
+
export declare function buildCoreFormattingCommands({ gate, style, selection, history, formatting, link, command, valueCommand, actionCommand, }: CoreFormattingGroupDeps): NonNullable<OasisPlugin["commands"]>;
|
|
36
38
|
export declare function buildDocumentAndBrowserCommands({ gate, style, document, link, image, browser, actionCommand, }: DocumentAndBrowserGroupDeps): NonNullable<OasisPlugin["commands"]>;
|
|
37
39
|
export declare function buildParagraphAndSectionCommands({ style, paragraph, section, valueCommand, actionCommand, }: ParagraphAndSectionGroupDeps): NonNullable<OasisPlugin["commands"]>;
|
|
38
40
|
export declare function buildTableCommands({ gate, table, actionCommand, }: TableGroupDeps): NonNullable<OasisPlugin["commands"]>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a canvas {@link Path2D} for a DrawingML preset shape from its
|
|
3
|
+
* backend-agnostic geometry (see
|
|
4
|
+
* {@link getPresetPathSegments}). Used to fill/stroke shapes and
|
|
5
|
+
* non-rectangular text boxes on the canvas.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildPresetPath(preset: string | undefined, x: number, y: number, width: number, height: number): Path2D;
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/** Standard point sizes offered in the toolbar and font dialog dropdowns. */
|
|
7
7
|
export declare const STANDARD_FONT_SIZES_PT: number[];
|
|
8
|
+
/** Next larger standard point size (Word's "Grow Font"). */
|
|
9
|
+
export declare function nextFontSizePt(currentPt: number): number;
|
|
10
|
+
/** Next smaller standard point size (Word's "Shrink Font"). */
|
|
11
|
+
export declare function previousFontSizePt(currentPt: number): number;
|
|
8
12
|
/** Convert a model pixel size to a point value, rounded to 2 decimals. */
|
|
9
13
|
export declare function fontSizePxToPt(px: number): number;
|
|
10
14
|
/** Convert a user-facing point size to a model pixel size, rounded to 4 decimals. */
|