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/index.ts

24 lines
916 B
TypeScript
Raw Normal View History

2021-04-13 16:49:38 +08:00
import axios from 'axios';
2021-04-20 18:03:26 +08:00
import smoothscroll from 'smoothscroll-polyfill';
2021-04-13 16:49:38 +08:00
import { registerDoricJSLoader } from './src/DoricBundleLoader';
2019-12-19 10:42:57 +08:00
import { DoricElement } from './src/DoricElement'
2019-12-26 17:18:26 +08:00
import { NavigationElement } from './src/navigate/NavigationElement'
2020-01-03 16:35:04 +08:00
export * from './src/DoricElement'
export * from './src/navigate/NavigationElement'
export * from './src/DoricPlugin'
export * from './src/DoricRegistry'
export * from './src/DoricDriver'
2021-04-13 16:49:38 +08:00
export * from './src/shader/DoricViewNode'
2021-04-20 18:03:26 +08:00
window.customElements.define('doric-div', DoricElement);
window.customElements.define('doric-navigation', NavigationElement);
smoothscroll.polyfill();
2021-04-13 16:49:38 +08:00
registerDoricJSLoader({
filter: (source) => source.startsWith("assets://"),
request: async (source) => {
2021-10-13 15:45:31 +08:00
const ret = await axios.get<string>(source.replace("assets://", `${window.location.href}/../../doric-demo/bundle/`))
2021-04-13 16:49:38 +08:00
return ret.data
}
})