mce 0.1.0
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/LICENSE +21 -0
- package/README.md +126 -0
- package/dist/components/Auxiliary.vue.d.ts +3 -0
- package/dist/components/Bottombar.vue.d.ts +13 -0
- package/dist/components/ContextMenu.vue.d.ts +25 -0
- package/dist/components/Drawboard.vue.d.ts +58 -0
- package/dist/components/Drawing.vue.d.ts +3 -0
- package/dist/components/Floatbar.vue.d.ts +54 -0
- package/dist/components/Frame.vue.d.ts +11 -0
- package/dist/components/Frames.vue.d.ts +3 -0
- package/dist/components/GoBackSelectedArea.vue.d.ts +3 -0
- package/dist/components/Hover.vue.d.ts +3 -0
- package/dist/components/Rulers.vue.d.ts +8 -0
- package/dist/components/Scrollbars.vue.d.ts +12 -0
- package/dist/components/Selector.vue.d.ts +197 -0
- package/dist/components/Starter.vue.d.ts +3 -0
- package/dist/components/Statusbar.vue.d.ts +3 -0
- package/dist/components/TextEditor.vue.d.ts +6 -0
- package/dist/components/shared/Dialog.vue.d.ts +58 -0
- package/dist/components/shared/Menu.vue.d.ts +71 -0
- package/dist/components/shared/Overlay.vue.d.ts +64 -0
- package/dist/components/shared/Ruler.vue.d.ts +17 -0
- package/dist/components/shared/Scrollbar.vue.d.ts +21 -0
- package/dist/components/shared/Tooltip.vue.d.ts +71 -0
- package/dist/components/shared/Transformable.vue.d.ts +79 -0
- package/dist/composables/editor.d.ts +3 -0
- package/dist/composables/index.d.ts +4 -0
- package/dist/composables/menu.d.ts +7 -0
- package/dist/composables/overlay.d.ts +60 -0
- package/dist/composables/strategy.d.ts +40 -0
- package/dist/editor.d.ts +29 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +5815 -0
- package/dist/indexeddb/IndexeddbProvider.d.ts +31 -0
- package/dist/indexeddb/index.d.ts +1 -0
- package/dist/indexeddb/indexeddb.d.ts +23 -0
- package/dist/models/Doc.d.ts +57 -0
- package/dist/models/Model.d.ts +32 -0
- package/dist/models/Workspace.d.ts +17 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/plugins/0.command.d.ts +27 -0
- package/dist/plugins/0.config/base.d.ts +30 -0
- package/dist/plugins/0.config.d.ts +16 -0
- package/dist/plugins/0.context.d.ts +32 -0
- package/dist/plugins/0.element.d.ts +14 -0
- package/dist/plugins/0.font.d.ts +18 -0
- package/dist/plugins/0.i18n.d.ts +13 -0
- package/dist/plugins/1.frame.d.ts +24 -0
- package/dist/plugins/1.hotkey.d.ts +39 -0
- package/dist/plugins/1.upload.d.ts +13 -0
- package/dist/plugins/2.box.d.ts +20 -0
- package/dist/plugins/2.exporter/0.json.d.ts +10 -0
- package/dist/plugins/2.exporter/image.d.ts +11 -0
- package/dist/plugins/2.exporter/pdf.d.ts +9 -0
- package/dist/plugins/2.exporter/pptx.d.ts +9 -0
- package/dist/plugins/2.exporter/video.d.ts +10 -0
- package/dist/plugins/2.exporter.d.ts +27 -0
- package/dist/plugins/2.loader/0.url.d.ts +2 -0
- package/dist/plugins/2.loader/image.d.ts +2 -0
- package/dist/plugins/2.loader/json.d.ts +2 -0
- package/dist/plugins/2.loader/pptx.d.ts +2 -0
- package/dist/plugins/2.loader/txt.d.ts +2 -0
- package/dist/plugins/2.loader.d.ts +23 -0
- package/dist/plugins/3.view.d.ts +12 -0
- package/dist/plugins/4.0.text.d.ts +11 -0
- package/dist/plugins/4.1.lock.d.ts +20 -0
- package/dist/plugins/4.2.element.d.ts +45 -0
- package/dist/plugins/4.3.frame.d.ts +21 -0
- package/dist/plugins/4.4.doc.d.ts +23 -0
- package/dist/plugins/align.d.ts +16 -0
- package/dist/plugins/arrange.d.ts +19 -0
- package/dist/plugins/auxiliary.d.ts +14 -0
- package/dist/plugins/clipboard.d.ts +22 -0
- package/dist/plugins/flip.d.ts +10 -0
- package/dist/plugins/frame.d.ts +14 -0
- package/dist/plugins/group.d.ts +14 -0
- package/dist/plugins/history.d.ts +21 -0
- package/dist/plugins/import.d.ts +15 -0
- package/dist/plugins/insert/image.d.ts +13 -0
- package/dist/plugins/insert/text.d.ts +14 -0
- package/dist/plugins/menu.d.ts +12 -0
- package/dist/plugins/move.d.ts +20 -0
- package/dist/plugins/new.d.ts +12 -0
- package/dist/plugins/open.d.ts +12 -0
- package/dist/plugins/preference.d.ts +16 -0
- package/dist/plugins/saveAs.d.ts +15 -0
- package/dist/plugins/select.d.ts +20 -0
- package/dist/plugins/snapshot.d.ts +17 -0
- package/dist/plugins/theme.d.ts +8 -0
- package/dist/plugins/ui.d.ts +16 -0
- package/dist/plugins/visibility.d.ts +14 -0
- package/dist/plugins/zoom.d.ts +32 -0
- package/dist/preset-plugins.d.ts +1 -0
- package/dist/sw.d.ts +1 -0
- package/dist/typed-global.d.ts +26 -0
- package/dist/typed-plugins.d.ts +58 -0
- package/dist/types/box.d.ts +9 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/BSTree/BSTree.d.ts +18 -0
- package/dist/utils/BSTree/BSTreeKV.d.ts +210 -0
- package/dist/utils/BSTree/LinkedList.d.ts +179 -0
- package/dist/utils/BSTree/Queue.d.ts +81 -0
- package/dist/utils/BSTree/index.d.ts +1 -0
- package/dist/utils/BSTree/utils.d.ts +47 -0
- package/dist/utils/box.d.ts +7 -0
- package/dist/utils/constants.d.ts +4 -0
- package/dist/utils/create.d.ts +3 -0
- package/dist/utils/helper.d.ts +1 -0
- package/dist/utils/image.d.ts +26 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/propsFactory.d.ts +57 -0
- package/dist/utils/random.d.ts +3 -0
- package/package.json +147 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Element2D, Vector2Data } from 'modern-canvas';
|
|
2
|
+
import type { Element } from 'modern-idoc';
|
|
3
|
+
import type { AxisAlignedBoundingBox } from '../types';
|
|
4
|
+
declare global {
|
|
5
|
+
namespace Mce {
|
|
6
|
+
interface AddElementOptions {
|
|
7
|
+
frame?: Element2D;
|
|
8
|
+
positionToFit?: boolean;
|
|
9
|
+
sizeToFit?: boolean;
|
|
10
|
+
position?: Vector2Data;
|
|
11
|
+
inPointerPosition?: boolean;
|
|
12
|
+
active?: boolean;
|
|
13
|
+
regenId?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface ResizeElementOptions {
|
|
16
|
+
deep?: boolean;
|
|
17
|
+
textToFit?: boolean;
|
|
18
|
+
textFontSizeToFit?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface Editor {
|
|
21
|
+
addElement: {
|
|
22
|
+
(element: Element, options?: AddElementOptions): Element2D;
|
|
23
|
+
(element: Element[], options?: AddElementOptions): Element2D[];
|
|
24
|
+
};
|
|
25
|
+
deleteElement: (id: string) => void;
|
|
26
|
+
updateElement: (id: string, properties: Record<string, any>) => void;
|
|
27
|
+
getElement: (id: string) => Element2D | undefined;
|
|
28
|
+
resizeElement: (element: Element2D, width: number, height: number, options?: ResizeElementOptions) => void;
|
|
29
|
+
pointerActivateElement: (element: Element2D | undefined, event?: MouseEvent | PointerEvent) => void;
|
|
30
|
+
deleteCurrentElements: () => void;
|
|
31
|
+
selectArea: (areaInDrawboard: AxisAlignedBoundingBox) => Element2D[];
|
|
32
|
+
}
|
|
33
|
+
interface Events {
|
|
34
|
+
addElement: [element: Element2D[]];
|
|
35
|
+
}
|
|
36
|
+
interface Hotkeys {
|
|
37
|
+
delete: [event: KeyboardEvent];
|
|
38
|
+
}
|
|
39
|
+
interface Commands {
|
|
40
|
+
delete: () => void;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
declare const _default: import("..").Plugin;
|
|
45
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Element } from 'modern-idoc';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface Editor {
|
|
5
|
+
addFrame: (element?: Element, toIndex?: number) => void;
|
|
6
|
+
duplicateFrame: (index?: number) => void;
|
|
7
|
+
moveFrame: (fromIndex: number, toIndex: number) => void;
|
|
8
|
+
deleteFrame: (index?: number) => void;
|
|
9
|
+
setActiveFrame: (index?: number) => void;
|
|
10
|
+
}
|
|
11
|
+
interface Events {
|
|
12
|
+
addFrame: [index: number];
|
|
13
|
+
duplicateFrame: [index: number];
|
|
14
|
+
moveFrame: [fromIndex: number, toIndex: number];
|
|
15
|
+
deleteFrame: [index: number];
|
|
16
|
+
setActiveFrame: [index: number, oldIndex: number];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
declare const _default: import("..").Plugin;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Document, NormalizedDocument } from 'modern-idoc';
|
|
2
|
+
import { Doc } from '../models';
|
|
3
|
+
declare global {
|
|
4
|
+
namespace Mce {
|
|
5
|
+
interface Editor {
|
|
6
|
+
getDoc: () => NormalizedDocument;
|
|
7
|
+
setDoc: (doc: Document | string) => Promise<Doc>;
|
|
8
|
+
loadDoc: (source: any) => Promise<Doc>;
|
|
9
|
+
clearDoc: () => void;
|
|
10
|
+
}
|
|
11
|
+
interface Options {
|
|
12
|
+
doc?: Document | string;
|
|
13
|
+
}
|
|
14
|
+
interface Events {
|
|
15
|
+
setDoc: [doc: Doc];
|
|
16
|
+
loadDoc: [doc: Doc, source: any];
|
|
17
|
+
clearDoc: [];
|
|
18
|
+
updateDoc: [update: Uint8Array, origin: any];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
declare const _default: import("..").Plugin;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace Mce {
|
|
3
|
+
type AlignCommandDirection = 'left' | 'horizontal-center' | 'right' | 'top' | 'vertical-center' | 'bottom';
|
|
4
|
+
interface Commands {
|
|
5
|
+
align: (direction: AlignCommandDirection) => void;
|
|
6
|
+
alignLeft: () => void;
|
|
7
|
+
alignHorizontalCenter: () => void;
|
|
8
|
+
alignRight: () => void;
|
|
9
|
+
alignTop: () => void;
|
|
10
|
+
alignVerticalCenter: () => void;
|
|
11
|
+
alignBottom: () => void;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
declare const _default: import("..").Plugin;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Element2D } from 'modern-canvas';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface Hotkeys {
|
|
5
|
+
raiseToFront: [event: KeyboardEvent];
|
|
6
|
+
raise: [event: KeyboardEvent];
|
|
7
|
+
lower: [event: KeyboardEvent];
|
|
8
|
+
lowerToBack: [event: KeyboardEvent];
|
|
9
|
+
}
|
|
10
|
+
interface Commands {
|
|
11
|
+
raiseToFront: (target?: Element2D | Element2D[]) => void;
|
|
12
|
+
raise: (target?: Element2D) => void;
|
|
13
|
+
lower: (target?: Element2D) => void;
|
|
14
|
+
lowerToBack: (target?: Element2D | Element2D[]) => void;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
declare const _default: import("..").Plugin;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface Editor {
|
|
5
|
+
auxiliaryLines: ComputedRef<Record<string, any>[]>;
|
|
6
|
+
getAdsorptionPoints: (resizing?: boolean) => {
|
|
7
|
+
x: number[];
|
|
8
|
+
y: number[];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import("..").Plugin;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface Hotkeys {
|
|
5
|
+
copy: [event: KeyboardEvent];
|
|
6
|
+
cut: [event: KeyboardEvent];
|
|
7
|
+
paste: [event: KeyboardEvent];
|
|
8
|
+
duplicate: [event: KeyboardEvent];
|
|
9
|
+
}
|
|
10
|
+
interface Commands {
|
|
11
|
+
copy: () => Promise<void>;
|
|
12
|
+
cut: () => Promise<void>;
|
|
13
|
+
paste: () => Promise<void>;
|
|
14
|
+
duplicate: () => Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
interface Editor {
|
|
17
|
+
copiedData: Ref<any | undefined>;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
declare const _default: import("..").Plugin;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace Mce {
|
|
3
|
+
interface Commands {
|
|
4
|
+
'frame': () => void;
|
|
5
|
+
'unframe': () => void;
|
|
6
|
+
'frame/unframe': () => void;
|
|
7
|
+
}
|
|
8
|
+
interface Hotkeys {
|
|
9
|
+
'frame/unframe': [event: KeyboardEvent];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import("..").Plugin;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace Mce {
|
|
3
|
+
interface Commands {
|
|
4
|
+
'group': () => void;
|
|
5
|
+
'ungroup': () => void;
|
|
6
|
+
'group/ungroup': () => void;
|
|
7
|
+
}
|
|
8
|
+
interface Hotkeys {
|
|
9
|
+
'group/ungroup': [event: KeyboardEvent];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import("..").Plugin;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface Editor {
|
|
5
|
+
canUndo: Ref<boolean>;
|
|
6
|
+
canRedo: Ref<boolean>;
|
|
7
|
+
undo: () => void;
|
|
8
|
+
redo: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface Hotkeys {
|
|
11
|
+
undo: [event: KeyboardEvent];
|
|
12
|
+
redo: [event: KeyboardEvent];
|
|
13
|
+
}
|
|
14
|
+
interface Commands {
|
|
15
|
+
undo: () => void;
|
|
16
|
+
redo: () => void;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
declare const _default: import("..").Plugin;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Element2D } from 'modern-canvas';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface ImportOptions extends AddElementOptions {
|
|
5
|
+
}
|
|
6
|
+
interface Commands {
|
|
7
|
+
import: (options?: ImportOptions) => Promise<Element2D[]>;
|
|
8
|
+
}
|
|
9
|
+
interface Hotkeys {
|
|
10
|
+
import: [event: KeyboardEvent];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
declare const _default: import("..").Plugin;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Element2D } from 'modern-canvas';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface InsertImageOptions extends AddElementOptions {
|
|
5
|
+
}
|
|
6
|
+
interface Commands {
|
|
7
|
+
insertImage: (url: string, options?: InsertImageOptions) => Promise<Element2D>;
|
|
8
|
+
drawImage: () => void;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import("../..").Plugin;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Element2D } from 'modern-canvas';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface InsertTextOptions extends AddElementOptions {
|
|
5
|
+
style?: Record<string, any>;
|
|
6
|
+
}
|
|
7
|
+
interface Commands {
|
|
8
|
+
insertText: (content?: string, options?: InsertTextOptions) => Element2D;
|
|
9
|
+
drawText: (content?: string, options?: InsertTextOptions) => void;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import("../..").Plugin;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface Editor {
|
|
5
|
+
systemMenus: ComputedRef<any[]>;
|
|
6
|
+
contextMenus: ComputedRef<any[]>;
|
|
7
|
+
}
|
|
8
|
+
type MenuKey = 'edit' | 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'duplicate' | 'delete' | 'layer' | 'frame/unframe' | 'group/ungroup' | 'hide/show' | 'lock/unlock' | 'arrange' | 'raiseToFront' | 'raise' | 'lower' | 'lowerToBack' | 'flip' | 'flipX' | 'flipY' | 'align' | 'alignLeft' | 'alignHorizontalCenter' | 'alignRight' | 'alignTop' | 'alignVerticalCenter' | 'alignBottom';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import("..").Plugin;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace Mce {
|
|
3
|
+
type MoveCommandDirection = 'left' | 'top' | 'right' | 'bottom';
|
|
4
|
+
interface Commands {
|
|
5
|
+
move: (direction: MoveCommandDirection, distance?: number) => void;
|
|
6
|
+
moveLeft: (distance?: number) => void;
|
|
7
|
+
moveTop: (distance?: number) => void;
|
|
8
|
+
moveRight: (distance?: number) => void;
|
|
9
|
+
moveBottom: (distance?: number) => void;
|
|
10
|
+
}
|
|
11
|
+
interface Hotkeys {
|
|
12
|
+
moveLeft: [event: KeyboardEvent];
|
|
13
|
+
moveTop: [event: KeyboardEvent];
|
|
14
|
+
moveRight: [event: KeyboardEvent];
|
|
15
|
+
moveBottom: [event: KeyboardEvent];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
declare const _default: import("..").Plugin;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface Commands {
|
|
5
|
+
preferences: () => void;
|
|
6
|
+
}
|
|
7
|
+
interface Hotkeys {
|
|
8
|
+
preferences: [event: KeyboardEvent];
|
|
9
|
+
}
|
|
10
|
+
interface Editor {
|
|
11
|
+
preferencesVisible: Ref<boolean>;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
declare const _default: import("..").Plugin;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace Mce {
|
|
3
|
+
interface SaveAsOptions extends ExporterOptions {
|
|
4
|
+
filename?: string;
|
|
5
|
+
}
|
|
6
|
+
interface Commands {
|
|
7
|
+
saveAs: (type: keyof Exporters, options?: SaveAsOptions) => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
interface Editor {
|
|
10
|
+
saveAs: (type: keyof Exporters, options?: SaveAsOptions) => Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
declare const _default: import("..").Plugin;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace Mce {
|
|
3
|
+
interface Hotkeys {
|
|
4
|
+
selectAll: [event: KeyboardEvent];
|
|
5
|
+
deselectAll: [event: KeyboardEvent];
|
|
6
|
+
selectParent: [event: KeyboardEvent];
|
|
7
|
+
previousSelection: [event: KeyboardEvent];
|
|
8
|
+
nextSelection: [event: KeyboardEvent];
|
|
9
|
+
}
|
|
10
|
+
interface Commands {
|
|
11
|
+
selectAll: () => void;
|
|
12
|
+
deselectAll: () => void;
|
|
13
|
+
selectParent: () => void;
|
|
14
|
+
previousSelection: () => void;
|
|
15
|
+
nextSelection: () => void;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
declare const _default: import("..").Plugin;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Element } from 'modern-idoc';
|
|
2
|
+
import { Element2D } from 'modern-canvas';
|
|
3
|
+
declare global {
|
|
4
|
+
namespace Mce {
|
|
5
|
+
interface Config {
|
|
6
|
+
frameScreenshot: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface Editor {
|
|
9
|
+
snapshot: () => void;
|
|
10
|
+
captureElementScreenshot: (element: Element | Element2D) => Promise<HTMLCanvasElement>;
|
|
11
|
+
captureFrameScreenshot: (pageIndex: number) => void;
|
|
12
|
+
renderFrameThumb: (target: HTMLCanvasElement) => void;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
declare const _default: import("..").Plugin;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AxisAlignedBoundingBox } from '../types';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
interface Commands {
|
|
5
|
+
startTyping: (e?: PointerEvent) => Promise<boolean>;
|
|
6
|
+
startTransform: (e?: PointerEvent) => boolean;
|
|
7
|
+
}
|
|
8
|
+
interface Events {
|
|
9
|
+
setTransform: [value: {
|
|
10
|
+
aabb: AxisAlignedBoundingBox;
|
|
11
|
+
}];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
declare const _default: import("..").Plugin;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace Mce {
|
|
3
|
+
interface Commands {
|
|
4
|
+
'hide': () => void;
|
|
5
|
+
'show': () => void;
|
|
6
|
+
'hide/show': () => void;
|
|
7
|
+
}
|
|
8
|
+
interface Hotkeys {
|
|
9
|
+
'hide/show': [event: KeyboardEvent];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import("..").Plugin;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace Mce {
|
|
3
|
+
interface Commands {
|
|
4
|
+
zoomIn: () => void;
|
|
5
|
+
zoomOut: () => void;
|
|
6
|
+
zoomTo100: () => void;
|
|
7
|
+
zoomToFit: () => void;
|
|
8
|
+
zoomToCover: () => void;
|
|
9
|
+
zoomToSelection: () => void;
|
|
10
|
+
}
|
|
11
|
+
interface Hotkeys {
|
|
12
|
+
zoomIn: [event: KeyboardEvent];
|
|
13
|
+
zoomOut: [event: KeyboardEvent];
|
|
14
|
+
zoomTo100: [event: KeyboardEvent];
|
|
15
|
+
zoomToFit: [event: KeyboardEvent];
|
|
16
|
+
zoomToCover: [event: KeyboardEvent];
|
|
17
|
+
zoomToSelection: [event: KeyboardEvent];
|
|
18
|
+
}
|
|
19
|
+
interface Config {
|
|
20
|
+
zoomToFitOffset: {
|
|
21
|
+
left?: number;
|
|
22
|
+
top?: number;
|
|
23
|
+
right?: number;
|
|
24
|
+
bottom?: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
interface Editor {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
declare const _default: import("..").Plugin;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const presetPlugins: import("./editor").Plugin[];
|
package/dist/sw.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerSw(): Promise<void>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
namespace Mce {
|
|
3
|
+
interface Editor {}
|
|
4
|
+
interface Options {}
|
|
5
|
+
interface Events {}
|
|
6
|
+
interface Hotkeys {}
|
|
7
|
+
interface Commands {}
|
|
8
|
+
interface Exporters {}
|
|
9
|
+
interface Config {}
|
|
10
|
+
|
|
11
|
+
type State
|
|
12
|
+
= | 'loading'
|
|
13
|
+
| 'drawing'
|
|
14
|
+
| 'selecting'
|
|
15
|
+
| 'transforming'
|
|
16
|
+
| 'typing'
|
|
17
|
+
| 'cropping'
|
|
18
|
+
| 'imageReplacing'
|
|
19
|
+
| 'shapeReplacing'
|
|
20
|
+
| undefined
|
|
21
|
+
|
|
22
|
+
type StateContext = Record<string, any>
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* prettier-ignore */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
// Generated by script. ‼️ DO NOT MODIFY THIS FILE ‼️
|
|
5
|
+
import './plugins/0.command'
|
|
6
|
+
import './plugins/0.config'
|
|
7
|
+
import './plugins/0.config/base'
|
|
8
|
+
import './plugins/0.context'
|
|
9
|
+
import './plugins/0.element'
|
|
10
|
+
import './plugins/0.font'
|
|
11
|
+
import './plugins/0.i18n'
|
|
12
|
+
import './plugins/1.frame'
|
|
13
|
+
import './plugins/1.hotkey'
|
|
14
|
+
import './plugins/1.upload'
|
|
15
|
+
import './plugins/2.box'
|
|
16
|
+
import './plugins/2.exporter'
|
|
17
|
+
import './plugins/2.exporter/0.json'
|
|
18
|
+
import './plugins/2.exporter/image'
|
|
19
|
+
import './plugins/2.exporter/pdf'
|
|
20
|
+
import './plugins/2.exporter/pptx'
|
|
21
|
+
import './plugins/2.exporter/video'
|
|
22
|
+
import './plugins/2.loader'
|
|
23
|
+
import './plugins/2.loader/0.url'
|
|
24
|
+
import './plugins/2.loader/image'
|
|
25
|
+
import './plugins/2.loader/json'
|
|
26
|
+
import './plugins/2.loader/pptx'
|
|
27
|
+
import './plugins/2.loader/txt'
|
|
28
|
+
import './plugins/3.view'
|
|
29
|
+
import './plugins/4.0.text'
|
|
30
|
+
import './plugins/4.1.lock'
|
|
31
|
+
import './plugins/4.2.element'
|
|
32
|
+
import './plugins/4.3.frame'
|
|
33
|
+
import './plugins/4.4.doc'
|
|
34
|
+
import './plugins/align'
|
|
35
|
+
import './plugins/arrange'
|
|
36
|
+
import './plugins/auxiliary'
|
|
37
|
+
import './plugins/clipboard'
|
|
38
|
+
import './plugins/flip'
|
|
39
|
+
import './plugins/frame'
|
|
40
|
+
import './plugins/group'
|
|
41
|
+
import './plugins/history'
|
|
42
|
+
import './plugins/import'
|
|
43
|
+
import './plugins/insert/image'
|
|
44
|
+
import './plugins/insert/text'
|
|
45
|
+
import './plugins/menu'
|
|
46
|
+
import './plugins/move'
|
|
47
|
+
import './plugins/new'
|
|
48
|
+
import './plugins/open'
|
|
49
|
+
import './plugins/preference'
|
|
50
|
+
import './plugins/saveAs'
|
|
51
|
+
import './plugins/select'
|
|
52
|
+
import './plugins/snapshot'
|
|
53
|
+
import './plugins/theme'
|
|
54
|
+
import './plugins/ui'
|
|
55
|
+
import './plugins/visibility'
|
|
56
|
+
import './plugins/zoom'
|
|
57
|
+
|
|
58
|
+
export {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './box';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import BSTreeKV from './BSTreeKV';
|
|
2
|
+
/**
|
|
3
|
+
* Special-case of the binary search tree in which the search key is equal to the element type.
|
|
4
|
+
* This definition is suitable when the element type can not be split between what defines its order
|
|
5
|
+
* and what does not (eg. primitive types as opposed to indexed records).
|
|
6
|
+
*
|
|
7
|
+
* The table below shows some use-case examples for both interfaces:
|
|
8
|
+
*
|
|
9
|
+
* element type | most suitable interface
|
|
10
|
+
* ------------------------------------|----------------------------
|
|
11
|
+
* number | BSTree<number>
|
|
12
|
+
* string | BSTree<string>
|
|
13
|
+
* { order: number, data: string } | BSTreeKV<{order: number}, {order: number, data: string}>
|
|
14
|
+
*
|
|
15
|
+
* @see BSTreeKV
|
|
16
|
+
*/
|
|
17
|
+
export default class BSTree<T> extends BSTreeKV<T, T> {
|
|
18
|
+
}
|