@easy-editor/core 1.0.2 → 1.0.3
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 +9 -9
- package/README.md +36 -36
- package/dist/designer/setting/setting-manager.d.ts +3 -3
- package/dist/designer/setting/setting-top-entry.d.ts +1 -0
- package/dist/document/node/node.d.ts +18 -3
- package/dist/index.cjs +1192 -410
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1176 -410
- package/dist/materials/component-meta.d.ts +15 -1
- package/dist/materials/index.d.ts +1 -0
- package/dist/materials/materials.d.ts +57 -7
- package/dist/materials/registry/index.d.ts +6 -0
- package/dist/materials/registry/material-registry.d.ts +59 -0
- package/dist/materials/registry/types.d.ts +168 -0
- package/dist/remote/core/errors.d.ts +60 -0
- package/dist/remote/core/index.d.ts +7 -0
- package/dist/remote/core/types.d.ts +60 -0
- package/dist/remote/index.d.ts +6 -0
- package/dist/remote/state/index.d.ts +6 -0
- package/dist/remote/state/loading-state.d.ts +108 -0
- package/dist/remote/state/resource-registry.d.ts +80 -0
- package/dist/simulator/index.d.ts +1 -0
- package/dist/simulator/resource-consumer.d.ts +17 -0
- package/dist/simulator/simulator.d.ts +3 -1
- package/dist/types/assets.d.ts +32 -0
- package/dist/types/component.d.ts +2 -5
- package/dist/types/index.d.ts +2 -0
- package/dist/types/meta.d.ts +5 -0
- package/dist/types/npm-info.d.ts +37 -0
- package/dist/types/schema.d.ts +2 -1
- package/dist/utils/is.d.ts +4 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright © 2024-PRESENT JinSo <https://github.com/JinSooo>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright © 2024-PRESENT JinSo <https://github.com/JinSooo>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
# @easy-editor/core
|
|
2
|
-
|
|
3
|
-
Core specification and type package for EasyEditor, a cross-framework low-code editor with a scalable architecture.
|
|
4
|
-
|
|
5
|
-
## Package Structure
|
|
6
|
-
|
|
7
|
-
This package provides two main entry points:
|
|
8
|
-
|
|
9
|
-
### 1. Main Entry Point (`@easy-editor/core`)
|
|
10
|
-
|
|
11
|
-
The main entry point provides specifications, interfaces, and types:
|
|
12
|
-
- Core interfaces and abstract classes
|
|
13
|
-
- Type definitions for all components and modules
|
|
14
|
-
- Base structures for plugins, documents, and components
|
|
15
|
-
- Standard events and constants
|
|
16
|
-
- Utility functions and helpers
|
|
17
|
-
|
|
18
|
-
### 2. Engine Entry Point (`@easy-editor/core/engine`)
|
|
19
|
-
|
|
20
|
-
The engine entry point provides the concrete implementation that users should import and use directly:
|
|
21
|
-
- Ready-to-use editor instance
|
|
22
|
-
- Fully configured plugin system
|
|
23
|
-
- Initialized core modules
|
|
24
|
-
- Export of common services (designer, project, etc.)
|
|
25
|
-
- Lifecycle management (init, destroy)
|
|
26
|
-
|
|
27
|
-
## Features
|
|
28
|
-
|
|
29
|
-
- **Framework Agnostic**: Core is designed to work with any frontend framework
|
|
30
|
-
- **Plugin Architecture**: Extensible system for adding features and capabilities
|
|
31
|
-
- **Visual Design**: Complete designer implementation with drag-and-drop, alignment, and undo/redo
|
|
32
|
-
- **Component Model**: Structured component definition and management system
|
|
33
|
-
- **Event System**: Powerful event bus for communication between modules
|
|
34
|
-
- **Configuration System**: Centralized config management with plugin integration
|
|
35
|
-
- **Project Management**: Handles documents, history, serialization, and more
|
|
36
|
-
- **Type Safety**: Comprehensive TypeScript definitions for all components
|
|
1
|
+
# @easy-editor/core
|
|
2
|
+
|
|
3
|
+
Core specification and type package for EasyEditor, a cross-framework low-code editor with a scalable architecture.
|
|
4
|
+
|
|
5
|
+
## Package Structure
|
|
6
|
+
|
|
7
|
+
This package provides two main entry points:
|
|
8
|
+
|
|
9
|
+
### 1. Main Entry Point (`@easy-editor/core`)
|
|
10
|
+
|
|
11
|
+
The main entry point provides specifications, interfaces, and types:
|
|
12
|
+
- Core interfaces and abstract classes
|
|
13
|
+
- Type definitions for all components and modules
|
|
14
|
+
- Base structures for plugins, documents, and components
|
|
15
|
+
- Standard events and constants
|
|
16
|
+
- Utility functions and helpers
|
|
17
|
+
|
|
18
|
+
### 2. Engine Entry Point (`@easy-editor/core/engine`)
|
|
19
|
+
|
|
20
|
+
The engine entry point provides the concrete implementation that users should import and use directly:
|
|
21
|
+
- Ready-to-use editor instance
|
|
22
|
+
- Fully configured plugin system
|
|
23
|
+
- Initialized core modules
|
|
24
|
+
- Export of common services (designer, project, etc.)
|
|
25
|
+
- Lifecycle management (init, destroy)
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
- **Framework Agnostic**: Core is designed to work with any frontend framework
|
|
30
|
+
- **Plugin Architecture**: Extensible system for adding features and capabilities
|
|
31
|
+
- **Visual Design**: Complete designer implementation with drag-and-drop, alignment, and undo/redo
|
|
32
|
+
- **Component Model**: Structured component definition and management system
|
|
33
|
+
- **Event System**: Powerful event bus for communication between modules
|
|
34
|
+
- **Configuration System**: Centralized config management with plugin integration
|
|
35
|
+
- **Project Management**: Handles documents, history, serialization, and more
|
|
36
|
+
- **Type Safety**: Comprehensive TypeScript definitions for all components
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type Editor } from '../..';
|
|
1
|
+
import { type Editor, type Node } from '../..';
|
|
2
2
|
import type { SettingTopEntry } from './setting-top-entry';
|
|
3
3
|
export declare class SettingsManager {
|
|
4
4
|
readonly editor: Editor;
|
|
5
|
-
|
|
5
|
+
_sessionId: string;
|
|
6
6
|
private accessor _settings;
|
|
7
7
|
get length(): number | undefined;
|
|
8
8
|
get componentMeta(): import("../..").ComponentMeta | null | undefined;
|
|
@@ -11,6 +11,6 @@ export declare class SettingsManager {
|
|
|
11
11
|
private designer?;
|
|
12
12
|
constructor(editor: Editor);
|
|
13
13
|
private init;
|
|
14
|
-
|
|
14
|
+
setup(nodes: Node[]): void;
|
|
15
15
|
purge(): void;
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type SettingTopEntry } from '
|
|
1
|
+
import { type SettingTopEntry } from '../../designer';
|
|
2
2
|
import { type NodeSchema, TRANSFORM_STAGE } from '../../types';
|
|
3
3
|
import type { Document } from '../document';
|
|
4
|
-
import type
|
|
4
|
+
import { type PropValue, type PropsMap } from '../prop/prop';
|
|
5
5
|
import { Props } from '../prop/props';
|
|
6
6
|
import { NodeChildren } from './node-children';
|
|
7
7
|
export declare enum NODE_EVENT {
|
|
@@ -38,8 +38,12 @@ export declare class Node<Schema extends NodeSchema = NodeSchema> {
|
|
|
38
38
|
*/
|
|
39
39
|
get isPurged(): boolean;
|
|
40
40
|
props: Props;
|
|
41
|
-
_settingEntry: SettingTopEntry;
|
|
41
|
+
_settingEntry: SettingTopEntry | undefined;
|
|
42
42
|
get settingEntry(): SettingTopEntry;
|
|
43
|
+
/**
|
|
44
|
+
* 刷新组件配置项
|
|
45
|
+
*/
|
|
46
|
+
refreshSettingEntry(): void;
|
|
43
47
|
constructor(document: Document, Schema: Schema);
|
|
44
48
|
import(data: Schema, checkId?: boolean): void;
|
|
45
49
|
export<T = NodeSchema>(stage?: TRANSFORM_STAGE): T;
|
|
@@ -146,6 +150,17 @@ export declare class Node<Schema extends NodeSchema = NodeSchema> {
|
|
|
146
150
|
remove(purge?: boolean, useMutator?: boolean): void;
|
|
147
151
|
removeChild(node: Node): void;
|
|
148
152
|
isValidComponent(): boolean;
|
|
153
|
+
get isRemote(): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* 获取用于物料使用计数追踪的 key
|
|
156
|
+
* 对于远程组件返回版本化名称(如 "AreaChart@1.0.0")
|
|
157
|
+
* 对于本地组件返回原始名称
|
|
158
|
+
*/
|
|
159
|
+
get materialUsageKey(): string;
|
|
160
|
+
/**
|
|
161
|
+
* 判断当前节点是否为远程物料组件
|
|
162
|
+
*/
|
|
163
|
+
isRemoteComponent(): boolean;
|
|
149
164
|
get componentMeta(): import("../..").ComponentMeta;
|
|
150
165
|
get propsData(): PropsMap | null;
|
|
151
166
|
getRect(): DOMRect | null;
|