2020-11-26 16:45:25 +01:00
|
|
|
import {
|
|
|
|
|
config,
|
|
|
|
|
createBlock,
|
|
|
|
|
html,
|
|
|
|
|
list,
|
|
|
|
|
mount as blockMount,
|
|
|
|
|
multi,
|
|
|
|
|
patch,
|
|
|
|
|
remove,
|
|
|
|
|
text,
|
|
|
|
|
toggler,
|
|
|
|
|
} from "./blockdom";
|
|
|
|
|
import { mainEventHandler } from "./component/handler";
|
|
|
|
|
|
|
|
|
|
config.shouldNormalizeDom = false;
|
|
|
|
|
config.mainEventHandler = mainEventHandler;
|
|
|
|
|
|
|
|
|
|
export const blockDom = {
|
|
|
|
|
config,
|
|
|
|
|
// bdom entry points
|
|
|
|
|
mount: blockMount,
|
|
|
|
|
patch,
|
|
|
|
|
remove,
|
|
|
|
|
// bdom block types
|
|
|
|
|
list,
|
|
|
|
|
multi,
|
|
|
|
|
text,
|
|
|
|
|
toggler,
|
|
|
|
|
createBlock,
|
|
|
|
|
html,
|
|
|
|
|
};
|
|
|
|
|
|
2021-11-15 14:49:34 +01:00
|
|
|
import type { AppConfig } from "./app/app";
|
2021-11-13 09:02:34 +01:00
|
|
|
import { App } from "./app/app";
|
2020-11-26 16:45:25 +01:00
|
|
|
import { Component } from "./component/component";
|
|
|
|
|
import { getCurrent } from "./component/component_node";
|
|
|
|
|
|
|
|
|
|
export { App, Component };
|
|
|
|
|
|
|
|
|
|
export async function mount<T extends typeof Component>(
|
|
|
|
|
C: T,
|
2021-11-15 14:49:34 +01:00
|
|
|
target: HTMLElement,
|
|
|
|
|
config: AppConfig = {}
|
2020-11-26 16:45:25 +01:00
|
|
|
): Promise<InstanceType<T>> {
|
|
|
|
|
const app = new App(C);
|
2021-11-15 14:49:34 +01:00
|
|
|
return app.configure(config).mount(target);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function useComponent(): Component {
|
|
|
|
|
const current = getCurrent();
|
|
|
|
|
return current!.component;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export { status } from "./component/status";
|
2021-11-16 16:47:20 +01:00
|
|
|
export { Portal } from "./portal";
|
|
|
|
|
export { Memo } from "./memo";
|
2021-11-03 10:00:15 +01:00
|
|
|
export { css, xml } from "./tags";
|
2020-11-26 16:45:25 +01:00
|
|
|
export { useState } from "./reactivity";
|
2021-11-15 15:05:44 +01:00
|
|
|
export { useEffect, useEnv, useExternalListener, useRef, useSubEnv } from "./hooks";
|
2021-11-15 15:01:56 +01:00
|
|
|
export { EventBus, whenReady, loadFile, markup } from "./utils";
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
onWillStart,
|
|
|
|
|
onMounted,
|
|
|
|
|
onWillUnmount,
|
|
|
|
|
onWillUpdateProps,
|
|
|
|
|
onWillPatch,
|
|
|
|
|
onPatched,
|
|
|
|
|
onRender,
|
|
|
|
|
onDestroyed,
|
2021-11-08 10:30:36 +01:00
|
|
|
onError,
|
2021-10-19 09:26:18 +02:00
|
|
|
} from "./component/lifecycle_hooks";
|
2020-10-27 14:41:09 +01:00
|
|
|
|
2019-05-21 14:11:40 +02:00
|
|
|
export const __info__ = {};
|