This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-web/src/DoricRegistry.ts

77 lines
2.8 KiB
TypeScript
Raw Normal View History

2019-12-19 11:52:15 +08:00
import { DoricPluginClass } from "./DoricPlugin"
2019-12-19 13:34:56 +08:00
import { ShaderPlugin } from "./plugins/ShaderPlugin"
2019-12-19 20:44:14 +08:00
import { DoricViewNodeClass } from "./shader/DoricViewNode"
2019-12-20 17:28:24 +08:00
import { DoricStackNode } from "./shader/DoricStackNode"
import { DoricVLayoutNode } from './shader/DoricVLayoutNode'
import { DoricHLayoutNode } from './shader/DoricHLayoutNode'
2019-12-20 17:56:01 +08:00
import { DoricTextNode } from "./shader/DoricTextNode"
2019-12-21 16:37:55 +08:00
import { DoricImageNode } from "./shader/DoricImageNode"
2019-12-21 16:57:07 +08:00
import { DoricScrollerNode } from "./shader/DoricScrollerNode"
2019-12-21 17:44:17 +08:00
import { ModalPlugin } from './plugins/ModalPlugin'
2019-12-25 15:19:41 +08:00
import { StoragePlugin } from "./plugins/StoragePlugin"
2019-12-26 17:09:03 +08:00
import { NavigatorPlugin } from "./navigate/NavigatorPlugin"
2019-12-26 19:01:28 +08:00
import { PopoverPlugin } from './plugins/PopoverPlugin'
2019-12-28 14:25:03 +08:00
import { DoricListItemNode } from "./shader/DoricListItemNode"
import { DoricListNode } from "./shader/DoricListNode"
2020-01-04 14:43:28 +08:00
import { DoricDraggableNode } from "./shader/DoricDraggableNode"
2021-04-14 17:46:58 +08:00
import { DoricRefreshableNode } from "./shader/DoricRefreshableNode"
2021-04-16 17:19:02 +08:00
import { AnimatePlugin } from "./plugins/AnimatePlugin"
2021-04-16 19:37:10 +08:00
import { DoricSwitchNode } from "./shader/DoricSwitchNode"
2021-04-20 18:03:26 +08:00
import { DoricSliderNode } from "./shader/DoricSliderNode"
import { DoricSlideItemNode } from "./shader/DoricSlideItemNode"
2021-04-30 16:47:11 +08:00
import { NotificationPlugin } from "./plugins/NotificationPlugin"
2019-12-19 11:52:15 +08:00
const bundles: Map<string, string> = new Map
const plugins: Map<string, DoricPluginClass> = new Map
2019-12-19 20:44:14 +08:00
const nodes: Map<string, DoricViewNodeClass> = new Map
2019-12-19 11:52:15 +08:00
export function acquireJSBundle(name: string) {
return bundles.get(name)
}
export function registerJSBundle(name: string, bundle: string) {
bundles.set(name, bundle)
}
export function registerPlugin(name: string, plugin: DoricPluginClass) {
plugins.set(name, plugin)
}
export function acquirePlugin(name: string) {
return plugins.get(name)
}
2019-12-19 13:34:56 +08:00
2019-12-19 20:44:14 +08:00
export function registerViewNode(name: string, node: DoricViewNodeClass) {
nodes.set(name, node)
}
export function acquireViewNode(name: string) {
return nodes.get(name)
}
2019-12-26 11:25:41 +08:00
2019-12-19 13:34:56 +08:00
registerPlugin('shader', ShaderPlugin)
2019-12-21 17:44:17 +08:00
registerPlugin('modal', ModalPlugin)
2019-12-25 15:19:41 +08:00
registerPlugin('storage', StoragePlugin)
2019-12-26 11:25:41 +08:00
registerPlugin('navigator', NavigatorPlugin)
2019-12-26 19:01:28 +08:00
registerPlugin('popover', PopoverPlugin)
2021-04-16 17:19:02 +08:00
registerPlugin('animate', AnimatePlugin)
2021-04-30 16:47:11 +08:00
registerPlugin('notification', NotificationPlugin)
2019-12-19 20:44:14 +08:00
2019-12-20 17:28:24 +08:00
registerViewNode('Stack', DoricStackNode)
registerViewNode('VLayout', DoricVLayoutNode)
2019-12-20 17:56:01 +08:00
registerViewNode('HLayout', DoricHLayoutNode)
2019-12-21 16:37:55 +08:00
registerViewNode('Text', DoricTextNode)
2019-12-21 16:57:07 +08:00
registerViewNode('Image', DoricImageNode)
2019-12-28 14:25:03 +08:00
registerViewNode('Scroller', DoricScrollerNode)
registerViewNode('ListItem', DoricListItemNode)
2020-01-04 14:43:28 +08:00
registerViewNode('List', DoricListNode)
2021-04-14 17:46:58 +08:00
registerViewNode('Draggable', DoricDraggableNode)
2021-04-16 19:37:10 +08:00
registerViewNode('Refreshable', DoricRefreshableNode)
2021-04-20 18:03:26 +08:00
registerViewNode('Switch', DoricSwitchNode)
registerViewNode('Slider', DoricSliderNode)
registerViewNode('SlideItem', DoricSlideItemNode)