@tmagic/editor 1.4.16 → 1.5.0-beta.1
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/style.css +11 -7
- package/dist/tmagic-editor.js +434 -411
- package/dist/tmagic-editor.umd.cjs +441 -408
- package/package.json +11 -15
- package/src/components/CodeParams.vue +1 -1
- package/src/editorProps.ts +2 -1
- package/src/fields/DataSourceInput.vue +2 -2
- package/src/fields/UISelect.vue +20 -15
- package/src/hooks/index.ts +7 -0
- package/src/hooks/use-stage.ts +13 -7
- package/src/index.ts +2 -0
- package/src/initService.ts +50 -53
- package/src/layouts/sidebar/Sidebar.vue +18 -2
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +12 -14
- package/src/layouts/workspace/viewer/NodeListMenu.vue +2 -1
- package/src/layouts/workspace/viewer/Stage.vue +4 -3
- package/src/services/editor.ts +2 -2
- package/src/services/stageOverlay.ts +3 -1
- package/src/theme/data-source.scss +8 -5
- package/src/theme/page-bar.scss +2 -2
- package/src/utils/data-source/index.ts +25 -23
- package/src/utils/editor.ts +4 -3
- package/src/utils/index.ts +4 -0
- package/src/utils/operator.ts +3 -2
- package/src/utils/props.ts +2 -1
- package/types/index.d.ts +6685 -49
- package/src/shims-vue.d.ts +0 -6
- package/types/Editor.vue.d.ts +0 -2313
- package/types/components/CodeBlockEditor.vue.d.ts +0 -33
- package/types/components/CodeParams.vue.d.ts +0 -28
- package/types/components/ContentMenu.vue.d.ts +0 -81
- package/types/components/FloatingBox.vue.d.ts +0 -70
- package/types/components/Icon.vue.d.ts +0 -15
- package/types/components/Resizer.vue.d.ts +0 -16
- package/types/components/ScrollBar.vue.d.ts +0 -25
- package/types/components/ScrollViewer.vue.d.ts +0 -81
- package/types/components/SearchInput.vue.d.ts +0 -6
- package/types/components/SplitView.vue.d.ts +0 -72
- package/types/components/ToolButton.vue.d.ts +0 -41
- package/types/components/Tree.vue.d.ts +0 -83
- package/types/components/TreeNode.vue.d.ts +0 -83
- package/types/editorProps.d.ts +0 -111
- package/types/fields/Code.vue.d.ts +0 -44
- package/types/fields/CodeLink.vue.d.ts +0 -24
- package/types/fields/CodeSelect.vue.d.ts +0 -28
- package/types/fields/CodeSelectCol.vue.d.ts +0 -31
- package/types/fields/CondOpSelect.vue.d.ts +0 -17
- package/types/fields/DataSourceFieldSelect/FieldSelect.vue.d.ts +0 -36
- package/types/fields/DataSourceFieldSelect/Index.vue.d.ts +0 -31
- package/types/fields/DataSourceFields.vue.d.ts +0 -44
- package/types/fields/DataSourceInput.vue.d.ts +0 -34
- package/types/fields/DataSourceMethodSelect.vue.d.ts +0 -31
- package/types/fields/DataSourceMethods.vue.d.ts +0 -34
- package/types/fields/DataSourceMocks.vue.d.ts +0 -41
- package/types/fields/DataSourceSelect.vue.d.ts +0 -31
- package/types/fields/DisplayConds.vue.d.ts +0 -37
- package/types/fields/EventSelect.vue.d.ts +0 -17
- package/types/fields/KeyValue.vue.d.ts +0 -36
- package/types/fields/PageFragmentSelect.vue.d.ts +0 -31
- package/types/fields/UISelect.vue.d.ts +0 -20
- package/types/hooks/index.d.ts +0 -6
- package/types/hooks/use-code-block-edit.d.ts +0 -189
- package/types/hooks/use-data-source-edit.d.ts +0 -176
- package/types/hooks/use-data-source-method.d.ts +0 -187
- package/types/hooks/use-editor-content-height.d.ts +0 -3
- package/types/hooks/use-filter.d.ts +0 -7
- package/types/hooks/use-float-box.d.ts +0 -17
- package/types/hooks/use-getso.d.ts +0 -5
- package/types/hooks/use-next-float-box-position.d.ts +0 -15
- package/types/hooks/use-node-status.d.ts +0 -16
- package/types/hooks/use-stage.d.ts +0 -3
- package/types/hooks/use-window-rect.d.ts +0 -6
- package/types/icons/AppManageIcon.vue.d.ts +0 -2
- package/types/icons/CenterIcon.vue.d.ts +0 -2
- package/types/icons/CodeIcon.vue.d.ts +0 -2
- package/types/icons/FolderMinusIcon.vue.d.ts +0 -2
- package/types/icons/PinIcon.vue.d.ts +0 -2
- package/types/icons/PinnedIcon.vue.d.ts +0 -2
- package/types/initService.d.ts +0 -9
- package/types/layouts/AddPageBox.vue.d.ts +0 -15
- package/types/layouts/CodeEditor.vue.d.ts +0 -80
- package/types/layouts/Framework.vue.d.ts +0 -25
- package/types/layouts/NavMenu.vue.d.ts +0 -35
- package/types/layouts/PropsPanel.vue.d.ts +0 -535
- package/types/layouts/page-bar/AddButton.vue.d.ts +0 -16
- package/types/layouts/page-bar/PageBar.vue.d.ts +0 -36
- package/types/layouts/page-bar/PageBarScrollContainer.vue.d.ts +0 -29
- package/types/layouts/page-bar/PageList.vue.d.ts +0 -27
- package/types/layouts/page-bar/SwitchTypeButton.vue.d.ts +0 -20
- package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +0 -10
- package/types/layouts/sidebar/Sidebar.vue.d.ts +0 -51
- package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +0 -32
- package/types/layouts/sidebar/code-block/CodeBlockListPanel.vue.d.ts +0 -24
- package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +0 -31
- package/types/layouts/sidebar/data-source/DataSourceList.vue.d.ts +0 -18
- package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +0 -10
- package/types/layouts/sidebar/layer/LayerMenu.vue.d.ts +0 -41
- package/types/layouts/sidebar/layer/LayerNodeTool.vue.d.ts +0 -16
- package/types/layouts/sidebar/layer/LayerPanel.vue.d.ts +0 -25
- package/types/layouts/sidebar/layer/use-click.d.ts +0 -119
- package/types/layouts/sidebar/layer/use-drag.d.ts +0 -14
- package/types/layouts/sidebar/layer/use-keybinding.d.ts +0 -6
- package/types/layouts/sidebar/layer/use-node-status.d.ts +0 -16
- package/types/layouts/workspace/Breadcrumb.vue.d.ts +0 -2
- package/types/layouts/workspace/Workspace.vue.d.ts +0 -41
- package/types/layouts/workspace/viewer/NodeListMenu.vue.d.ts +0 -2
- package/types/layouts/workspace/viewer/Stage.vue.d.ts +0 -34
- package/types/layouts/workspace/viewer/StageOverlay.vue.d.ts +0 -2
- package/types/layouts/workspace/viewer/ViewerMenu.vue.d.ts +0 -42
- package/types/services/BaseService.d.ts +0 -65
- package/types/services/codeBlock.d.ts +0 -130
- package/types/services/componentList.d.ts +0 -16
- package/types/services/dataSource.d.ts +0 -68
- package/types/services/dep.d.ts +0 -33
- package/types/services/editor.d.ts +0 -180
- package/types/services/events.d.ts +0 -18
- package/types/services/history.d.ts +0 -26
- package/types/services/keybinding.d.ts +0 -40
- package/types/services/props.d.ts +0 -92
- package/types/services/stageOverlay.d.ts +0 -30
- package/types/services/storage.d.ts +0 -65
- package/types/services/ui.d.ts +0 -77
- package/types/type.d.ts +0 -657
- package/types/utils/compose.d.ts +0 -5
- package/types/utils/config.d.ts +0 -4
- package/types/utils/content-menu.d.ts +0 -7
- package/types/utils/data-source/formConfigs/base.d.ts +0 -2
- package/types/utils/data-source/formConfigs/http.d.ts +0 -3
- package/types/utils/data-source/index.d.ts +0 -10
- package/types/utils/editor.d.ts +0 -59
- package/types/utils/idle-task.d.ts +0 -13
- package/types/utils/index.d.ts +0 -6
- package/types/utils/keybinding-config.d.ts +0 -7
- package/types/utils/logger.d.ts +0 -5
- package/types/utils/monaco-editor.d.ts +0 -2
- package/types/utils/operator.d.ts +0 -21
- package/types/utils/props.d.ts +0 -23
- package/types/utils/scroll-viewer.d.ts +0 -37
- package/types/utils/tree.d.ts +0 -3
- package/types/utils/undo-redo.d.ts +0 -12
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Writable } from 'type-fest';
|
|
2
|
-
import type { SyncHookPlugin } from '../type';
|
|
3
|
-
import BaseService from './BaseService';
|
|
4
|
-
interface Options {
|
|
5
|
-
namespace?: string;
|
|
6
|
-
protocol?: Protocol;
|
|
7
|
-
}
|
|
8
|
-
export declare enum Protocol {
|
|
9
|
-
OBJECT = "object",
|
|
10
|
-
JSON = "json",
|
|
11
|
-
STRING = "string",
|
|
12
|
-
NUMBER = "number",
|
|
13
|
-
BOOLEAN = "boolean"
|
|
14
|
-
}
|
|
15
|
-
declare const canUsePluginMethods: {
|
|
16
|
-
async: never[];
|
|
17
|
-
sync: readonly ["getStorage", "getNamespace", "clear", "getItem", "removeItem", "setItem"];
|
|
18
|
-
};
|
|
19
|
-
type SyncMethodName = Writable<(typeof canUsePluginMethods)['sync']>;
|
|
20
|
-
/**
|
|
21
|
-
* 数据存储服务
|
|
22
|
-
*/
|
|
23
|
-
export declare class WebStorage extends BaseService {
|
|
24
|
-
private storage;
|
|
25
|
-
private namespace;
|
|
26
|
-
constructor();
|
|
27
|
-
/**
|
|
28
|
-
* 获取数据存储对象,可以通过
|
|
29
|
-
* const storageService = new StorageService();
|
|
30
|
-
* storageService.usePlugin({
|
|
31
|
-
* // 替换存储对象为 sessionStorage
|
|
32
|
-
* async afterGetStorage(): Promise<Storage> {
|
|
33
|
-
* return window.sessionStorage;
|
|
34
|
-
* },
|
|
35
|
-
* });
|
|
36
|
-
*/
|
|
37
|
-
getStorage(): Storage;
|
|
38
|
-
getNamespace(): string;
|
|
39
|
-
/**
|
|
40
|
-
* 清理,支持storageService.usePlugin
|
|
41
|
-
*/
|
|
42
|
-
clear(): void;
|
|
43
|
-
/**
|
|
44
|
-
* 获取存储项,支持storageService.usePlugin
|
|
45
|
-
*/
|
|
46
|
-
getItem(key: string, options?: Options): any;
|
|
47
|
-
/**
|
|
48
|
-
* 获取指定索引位置的key
|
|
49
|
-
*/
|
|
50
|
-
key(index: number): string | null;
|
|
51
|
-
/**
|
|
52
|
-
* 移除存储项,支持storageService.usePlugin
|
|
53
|
-
*/
|
|
54
|
-
removeItem(key: string, options?: Options): void;
|
|
55
|
-
/**
|
|
56
|
-
* 设置存储项,支持storageService.usePlugin
|
|
57
|
-
*/
|
|
58
|
-
setItem(key: string, value: any, options?: Options): void;
|
|
59
|
-
destroy(): void;
|
|
60
|
-
usePlugin(options: SyncHookPlugin<SyncMethodName, WebStorage>): void;
|
|
61
|
-
private getValueAndProtocol;
|
|
62
|
-
}
|
|
63
|
-
export type StorageService = WebStorage;
|
|
64
|
-
declare const _default: WebStorage;
|
|
65
|
-
export default _default;
|
package/types/services/ui.d.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { Writable } from 'type-fest';
|
|
2
|
-
import type { AsyncHookPlugin, UiState } from '../type';
|
|
3
|
-
import BaseService from './BaseService';
|
|
4
|
-
declare const canUsePluginMethods: {
|
|
5
|
-
async: readonly ["zoom", "calcZoom"];
|
|
6
|
-
sync: readonly [];
|
|
7
|
-
};
|
|
8
|
-
type AsyncMethodName = Writable<(typeof canUsePluginMethods)['async']>;
|
|
9
|
-
declare class Ui extends BaseService {
|
|
10
|
-
constructor();
|
|
11
|
-
set<K extends keyof UiState, T extends UiState[K]>(name: K, value: T): void;
|
|
12
|
-
get<K extends keyof UiState>(name: K): {
|
|
13
|
-
uiSelectMode: boolean;
|
|
14
|
-
showSrc: boolean;
|
|
15
|
-
zoom: number;
|
|
16
|
-
stageContainerRect: {
|
|
17
|
-
width: number;
|
|
18
|
-
height: number;
|
|
19
|
-
};
|
|
20
|
-
stageRect: {
|
|
21
|
-
width: number | string;
|
|
22
|
-
height: number | string;
|
|
23
|
-
};
|
|
24
|
-
columnWidth: {
|
|
25
|
-
left: number;
|
|
26
|
-
center: number;
|
|
27
|
-
right: number;
|
|
28
|
-
};
|
|
29
|
-
showGuides: boolean;
|
|
30
|
-
showRule: boolean;
|
|
31
|
-
propsPanelSize: "large" | "default" | "small";
|
|
32
|
-
showAddPageButton: boolean;
|
|
33
|
-
showPageListButton: boolean;
|
|
34
|
-
hideSlideBar: boolean;
|
|
35
|
-
sideBarItems: {
|
|
36
|
-
[x: string]: any;
|
|
37
|
-
text: string;
|
|
38
|
-
tabStyle?: (string | Record<string, any>) | undefined;
|
|
39
|
-
icon?: any;
|
|
40
|
-
$key: string;
|
|
41
|
-
draggable?: boolean | undefined;
|
|
42
|
-
beforeClick?: ((config: import("../type").SideComponent) => boolean | Promise<boolean>) | undefined;
|
|
43
|
-
boxComponentConfig?: {
|
|
44
|
-
component?: any;
|
|
45
|
-
props?: Record<string, any> | undefined;
|
|
46
|
-
} | undefined;
|
|
47
|
-
type: "component";
|
|
48
|
-
component: any;
|
|
49
|
-
props?: Record<string, any> | undefined;
|
|
50
|
-
listeners?: Record<string, Function> | undefined;
|
|
51
|
-
slots?: Record<string, any> | undefined;
|
|
52
|
-
className?: string | undefined;
|
|
53
|
-
display?: (boolean | ((data?: import("../type").Services) => Promise<boolean> | boolean)) | undefined;
|
|
54
|
-
}[];
|
|
55
|
-
navMenuRect: {
|
|
56
|
-
left: number;
|
|
57
|
-
top: number;
|
|
58
|
-
width: number;
|
|
59
|
-
height: number;
|
|
60
|
-
};
|
|
61
|
-
frameworkRect: {
|
|
62
|
-
left: number;
|
|
63
|
-
top: number;
|
|
64
|
-
width: number;
|
|
65
|
-
height: number;
|
|
66
|
-
};
|
|
67
|
-
}[K];
|
|
68
|
-
zoom(zoom: number): Promise<void>;
|
|
69
|
-
calcZoom(): Promise<number>;
|
|
70
|
-
resetState(): void;
|
|
71
|
-
destroy(): void;
|
|
72
|
-
usePlugin(options: AsyncHookPlugin<AsyncMethodName, Ui>): void;
|
|
73
|
-
private setStageRect;
|
|
74
|
-
}
|
|
75
|
-
export type UiService = Ui;
|
|
76
|
-
declare const _default: Ui;
|
|
77
|
-
export default _default;
|