Merged PR 189: Simplify usage of SmartComponent

- Added new Events :
  - AddContainer, AddContainerToSelectedContainer, AppendContainer, AppendContainerToSelectedContainer, SelectContainer, DeleteContainer
  - AddSymbol, SelectSymbol, DeleteSymbol
- Changed the component to an iframe (you only need to copy the whole dist now)
- Added callbacks to every methods in the component
- Create event listener on demand: no need to initialize the event listener!
- Update d.ts
- Added Fastboot and enable it by default on production build
This commit is contained in:
Eric Nguyen 2022-09-21 09:24:14 +00:00
parent 07dbac1b12
commit 23ed3ed1ad
14 changed files with 1047 additions and 108 deletions

View file

@ -7,6 +7,14 @@ import { IContainerProperties } from '../Interfaces/IContainerProperties';
import { IEditorState } from '../Interfaces/IEditorState';
import { ISymbolModel } from '../Interfaces/ISymbolModel';
/// EDITOR DEFAULTS ///
export const FAST_BOOT = import.meta.env.PROD;
export const ENABLE_SHORTCUTS = true;
export const MAX_HISTORY = 200;
export const APPLY_BEHAVIORS_ON_CHILDREN = true;
export const MAX_FRAMERATE = 60;
/// CONTAINER DEFAULTS ///
/** Enable the swap behavior */
@ -41,13 +49,6 @@ export const NOTCHES_LENGTH = 10;
export const DEFAULT_SYMBOL_WIDTH = 32;
export const DEFAULT_SYMBOL_HEIGHT = 32;
/// EDITOR DEFAULTS ///
export const ENABLE_SHORTCUTS = true;
export const MAX_HISTORY = 200;
export const APPLY_BEHAVIORS_ON_CHILDREN = true;
export const MAX_FRAMERATE = 60;
/**
* Returns the default editor state given the configuration
*/