@easy-editor/core 0.0.14 → 0.0.16

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/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from './simulator';
8
8
  export * from './types';
9
9
  export * from './utils';
10
10
  export declare const DEV = "_EASY_EDITOR_DEV_";
11
+ export declare const version = "_EASY_EDITOR_VERSION_";
package/dist/index.js CHANGED
@@ -11143,9 +11143,11 @@ const createEasyEditor = config => {
11143
11143
  return new Editor(config);
11144
11144
  };
11145
11145
 
11146
- const DEV = '_EASY_EDITOR_DEV_';
11146
+ const DEV = 'false';
11147
11147
  configure({
11148
11148
  enforceActions: 'always'
11149
11149
  });
11150
+ const version = '0.0.16';
11151
+ console.log(`%c EasyEditor %c v${version} `, 'padding: 2px 1px; border-radius: 3px 0 0 3px; color: #fff; background: #606060; font-weight: bold;', 'padding: 2px 1px; border-radius: 0 3px 3px 0; color: #fff; background: #42c02e; font-weight: bold;');
11150
11152
 
11151
- export { AutoFit, COMPONENT_META_EVENT, ComponentMeta, ComponentMetaManager, DESIGNER_EVENT, DETECTING_EVENT, DEV, DOCUMENT_EVENT, DRAGON_EVENT, Designer, Detecting, Document, DragObject, DragObjectType, Dragon, DropLocation, EDITOR_EVENT, Editor, EventBus, GLOBAL_EVENT, HISTORY_EVENT, History, Hotkey, LocationDetailType, NODE_CHILDREN_EVENT, NODE_EVENT, Node$1 as Node, NodeChildren, OffsetObserver, PROJECT_EVENT, PluginContext, PluginManager, PluginRuntime, PositionNO, Project, Prop, PropValueChangedType, Props, SELECTION_EVENT, Selection, Session, SetterManager, SettingField, SettingPropEntry, SettingTopEntry, SettingsManager, Simulator, TRANSFORM_STAGE, UNSET, Viewport, clipboard, cloneDeep, comparePosition, contains, createEasyEditor, createEventBus, createLogger, createOffsetObserver, ensureNode, generateSessionId, getClosestClickableNode, getClosestNode, getConvertedExtraKey, getOriginalExtraKey, getSourceSensor, getWindow, getZLevelTop, insertChild, insertChildren, isComponentMeta, isDocument, isDocumentElem, isDragAnyObject, isDragEvent, isDragNodeDataObject, isDragNodeObject, isDynamicSetter, isElement, isExtraKey, isInvalidPoint, isJSExpression, isJSFunction, isLocateEvent, isLocationChildrenDetail, isLocationData, isLowCodeComponentType, isNode, isNodeSchema, isObject, isPlainObject, isProCodeComponentType, isProp, isPurgeable, isRegisterOptions, isSameAs, isSetterConfig, isSettingField, isShaken, isSimulator, isText, isValidArrayIndex, logger, makeEventsHandler, setShaken, splitPath, uniqueId };
11153
+ export { AutoFit, COMPONENT_META_EVENT, ComponentMeta, ComponentMetaManager, DESIGNER_EVENT, DETECTING_EVENT, DEV, DOCUMENT_EVENT, DRAGON_EVENT, Designer, Detecting, Document, DragObject, DragObjectType, Dragon, DropLocation, EDITOR_EVENT, Editor, EventBus, GLOBAL_EVENT, HISTORY_EVENT, History, Hotkey, LocationDetailType, NODE_CHILDREN_EVENT, NODE_EVENT, Node$1 as Node, NodeChildren, OffsetObserver, PROJECT_EVENT, PluginContext, PluginManager, PluginRuntime, PositionNO, Project, Prop, PropValueChangedType, Props, SELECTION_EVENT, Selection, Session, SetterManager, SettingField, SettingPropEntry, SettingTopEntry, SettingsManager, Simulator, TRANSFORM_STAGE, UNSET, Viewport, clipboard, cloneDeep, comparePosition, contains, createEasyEditor, createEventBus, createLogger, createOffsetObserver, ensureNode, generateSessionId, getClosestClickableNode, getClosestNode, getConvertedExtraKey, getOriginalExtraKey, getSourceSensor, getWindow, getZLevelTop, insertChild, insertChildren, isComponentMeta, isDocument, isDocumentElem, isDragAnyObject, isDragEvent, isDragNodeDataObject, isDragNodeObject, isDynamicSetter, isElement, isExtraKey, isInvalidPoint, isJSExpression, isJSFunction, isLocateEvent, isLocationChildrenDetail, isLocationData, isLowCodeComponentType, isNode, isNodeSchema, isObject, isPlainObject, isProCodeComponentType, isProp, isPurgeable, isRegisterOptions, isSameAs, isSetterConfig, isSettingField, isShaken, isSimulator, isText, isValidArrayIndex, logger, makeEventsHandler, setShaken, splitPath, uniqueId, version };
@@ -0,0 +1,20 @@
1
+ import type { JSExpression, JSONObject } from '../document';
2
+ export interface DataSourceItem {
3
+ id: string;
4
+ isInit?: boolean | JSExpression;
5
+ type?: string;
6
+ options?: {
7
+ uri: string | JSExpression;
8
+ params?: JSONObject | JSExpression;
9
+ method?: string | JSExpression;
10
+ shouldFetch?: string;
11
+ willFetch?: string;
12
+ fit?: string;
13
+ didFetch?: string;
14
+ };
15
+ dataHandler?: JSExpression;
16
+ }
17
+ export interface DataSource {
18
+ list?: DataSourceItem[];
19
+ dataHandler?: JSExpression;
20
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './common';
2
+ export * from './data-source';
2
3
  export * from './event';
3
4
  export * from './schema';
@@ -1,4 +1,5 @@
1
1
  import type { CompositeValue, JSExpression, JSFunction, JSONObject, PropsMap } from '../document';
2
+ import type { DataSource } from './data-source';
2
3
  export interface ProjectSchema<T = RootSchema> {
3
4
  id?: string;
4
5
  version: string;
@@ -40,6 +41,10 @@ export interface RootSchema extends NodeSchema {
40
41
  * 样式文件
41
42
  */
42
43
  css?: string;
44
+ /**
45
+ * 异步数据源配置
46
+ */
47
+ dataSource?: DataSource;
43
48
  }
44
49
  export interface NodeSchema {
45
50
  id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-editor/core",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "A cross-framework low-code engine with scale-out design.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",