mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-04-18 22:00:22 +08:00
move eventBus, appStorage, EditorStore to services directory
This commit is contained in:
parent
15bd209be8
commit
61665cdca0
@ -8,10 +8,10 @@ import {
|
||||
withDefaultSize,
|
||||
withDefaultVariant,
|
||||
} from '@chakra-ui/react';
|
||||
import { initEventBus } from './eventBus';
|
||||
import { EditorStore } from './EditorStore';
|
||||
import { initEventBus } from './services/eventBus';
|
||||
import { EditorStore } from './services/EditorStore';
|
||||
import { StorageHandler } from './types';
|
||||
import { AppStorage } from './AppStorage';
|
||||
import { AppStorage } from './services/AppStorage';
|
||||
import { Application, Module } from '@sunmao-ui/core';
|
||||
|
||||
type SunmaoUIEditorProps = {
|
||||
@ -80,7 +80,5 @@ export function initSunmaoUIEditor(props: SunmaoUIEditorProps = {}) {
|
||||
return {
|
||||
Editor,
|
||||
registry,
|
||||
onChange: () => null,
|
||||
onSave: () => null,
|
||||
};
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ComponentSchema } from '@sunmao-ui/core';
|
||||
import { EventBusType } from '../eventBus';
|
||||
import { EventBusType } from '../services/eventBus';
|
||||
import { IUndoRedoManager, IOperation, OperationList } from './type';
|
||||
|
||||
export class AppModelManager implements IUndoRedoManager {
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { observable, makeObservable, action, toJS } from 'mobx';
|
||||
import { Application, ComponentSchema, Module } from '@sunmao-ui/core';
|
||||
import { produce } from 'immer';
|
||||
import { DefaultNewModule, EmptyAppSchema } from './constants';
|
||||
import { addModuleId, removeModuleId } from './utils/addModuleId';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { StorageHandler } from './types';
|
||||
import { produce } from 'immer';
|
||||
import { DefaultNewModule, EmptyAppSchema } from '../constants';
|
||||
import { addModuleId, removeModuleId } from '../utils/addModuleId';
|
||||
import { StorageHandler } from '../types';
|
||||
|
||||
export class AppStorage {
|
||||
app: Application;
|
@ -5,8 +5,8 @@ import { Registry, StateManager } from '@sunmao-ui/runtime';
|
||||
|
||||
import { EventBusType } from './eventBus';
|
||||
import { AppStorage } from './AppStorage';
|
||||
import { SchemaValidator } from './validator';
|
||||
import { addModuleId } from './utils/addModuleId';
|
||||
import { SchemaValidator } from '../validator';
|
||||
import { addModuleId } from '../utils/addModuleId';
|
||||
|
||||
type EditingTarget = {
|
||||
kind: 'app' | 'module';
|
@ -1,6 +1,6 @@
|
||||
import mitt from 'mitt';
|
||||
import { ComponentSchema } from '@sunmao-ui/core';
|
||||
import { IOperation } from './operations/type';
|
||||
import { IOperation } from '../operations/type';
|
||||
|
||||
export type EventNames = {
|
||||
operation: IOperation;
|
@ -1,7 +1,7 @@
|
||||
import { Application, Module } from '@sunmao-ui/core';
|
||||
import { initSunmaoUI, Registry, StateManager } from '@sunmao-ui/runtime';
|
||||
import { EditorStore } from './EditorStore';
|
||||
import { EventBusType } from './eventBus';
|
||||
import { EditorStore } from './services/EditorStore';
|
||||
import { EventBusType } from './services/eventBus';
|
||||
import { AppModelManager } from './operations/AppModelManager';
|
||||
|
||||
type ReturnOfInit = ReturnType<typeof initSunmaoUI>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user