@dlightjs/components
Version:
DLight components library
1 lines • 53.8 kB
Source Map (JSON)
{"version":3,"sources":["../temp-t0pa0u/index.ts","../temp-t0pa0u/Router/utils.ts","../temp-t0pa0u/Router/Navigator.ts","../temp-t0pa0u/Router/RouteGroup.view.ts","../temp-t0pa0u/Router/Route.view.ts","../temp-t0pa0u/Router/Link.view.ts","../temp-t0pa0u/Lazy/Lazy.view.ts","../temp-t0pa0u/Stack/HStack.view.ts","../temp-t0pa0u/Injection/utils.ts","../temp-t0pa0u/Stack/VStack.view.ts","../temp-t0pa0u/Stack/ZStack.view.ts","../temp-t0pa0u/Stack/Spacer.view.ts"],"sourcesContent":["export * from \"./Router\";\nexport * from \"./Lazy/Lazy.view\";\nexport * from \"./Stack\";","export function getHashLocation() {\n return location.hash.slice(2);\n}\nexport function getHistoryLocation() {\n return location.pathname.slice(1);\n}\nexport function getPath(url: string, mode: \"history\" | \"hash\") {\n let newHref: any;\n if (url[0] === \"/\") {\n newHref = url;\n } else {\n // ---- Relative path\n if (url[0] !== \".\") url = \"./\" + url;\n const baseUrl = mode === \"history\" ? window.location.pathname : window.location.hash.replace(/^#/, \"\");\n const splitUrls = url.split(\"/\");\n const currUrls = baseUrl.split(\"/\").filter(u => u);\n let idx = 0;\n for (const splitUrl of splitUrls) {\n if (![\".\", \"..\"].includes(splitUrl)) break;\n if (splitUrl === \"..\") {\n if (currUrls.length === 0) {\n console.warn(`no ../ in ${url}`);\n }\n currUrls.pop();\n }\n idx++;\n }\n newHref = \"/\" + [...currUrls, ...splitUrls.slice(idx)].join(\"/\");\n }\n return newHref;\n}\nexport function trimPath(path: string) {\n return path.replace(/(^\\/+)|(\\/+$)/g, \"\");\n}\nexport function paramObjCompare(obj1: any, obj2: any) {\n if (!obj1 && !obj2) return true;\n if (!obj1 || !obj2) return false;\n if (Object.keys(obj1).length !== Object.keys(obj2).length) return false;\n return Object.keys(obj1).every(key => obj2[key] === obj1[key]);\n}\nexport function isDLightClass(comp: any) {\n return !!comp.prototype?.Body;\n}","import { getPath } from \"./utils\";\nexport class Navigator {\n mode: \"hash\" | \"history\";\n constructor(mode: \"hash\" | \"history\" = \"history\") {\n this.mode = mode;\n }\n hashTo(url: string) {\n window.location.href = \"#\" + getPath(url, this.mode);\n }\n historyTo(url: string) {\n window.history.pushState({}, \"\", getPath(url, this.mode));\n }\n to(url: string) {\n if (this.mode === \"hash\") {\n this.hashTo(url);\n return;\n }\n this.historyTo(url);\n }\n}","import { createElement as $$createElement, setStyle as $$setStyle, setDataset as $$setDataset, setEvent as $$setEvent, delegateEvent as $$delegateEvent, setHTMLProp as $$setHTMLProp, setHTMLAttr as $$setHTMLAttr, setHTMLProps as $$setHTMLProps, setHTMLAttrs as $$setHTMLAttrs, createTextNode as $$createTextNode, updateText as $$updateText, insertNode as $$insertNode, ForNode as $$ForNode, CondNode as $$CondNode, ExpNode as $$ExpNode, EnvNode as $$EnvNode, TryNode as $$TryNode, SnippetNode as $$SnippetNode, PropView as $$PropView, render as $$render } from \"@dlightjs/dlight\";\nimport { DLightViewProp, Pretty, Typed, View, required } from \"@dlightjs/dlight\";\nimport { Navigator } from \"./Navigator\";\nimport { getHashLocation, getHistoryLocation, isDLightClass, paramObjCompare, trimPath } from \"./utils\";\nimport { RouteGroupEnv, RouteGroupProps, RouteInfo, RouteOption } from \"./types\";\nconst rawHistoryPushState = history.pushState;\nlet historyPushStateFuncs: Array<() => any> = [];\nclass RouteGroup extends View implements RouteGroupProps {\n constructor() {\n super();\n this.homeUrl = this.homeUrl.bind(this);\n this.collectRoutes = this.collectRoutes.bind(this);\n this.updateRoute = this.updateRoute.bind(this);\n this.changePath = this.changePath.bind(this);\n this.historyChangeListen = this.historyChangeListen.bind(this);\n this.hashChangeListen = this.hashChangeListen.bind(this);\n this.willMount = this.willMount.bind(this);\n this.didMount = this.didMount.bind(this);\n this.willUnmount = this.willUnmount.bind(this);\n }\n $e$_dl_router_baseUrl;\n _dl_router_baseUrl = \"/\";\n $$_dl_router_baseUrl = 1;\n $p$mode;\n mode: RouteGroupProps[\"mode\"] = \"history\";\n $$mode = 2;\n $s$mode = [\"currentPath\"];\n $p$loading;\n loading?: RouteGroupProps[\"loading\"];\n $p$guard;\n guard?: RouteGroupProps[\"guard\"];\n $p$onPathUpdate;\n onPathUpdate?: RouteGroupProps[\"onPathUpdate\"];\n $p$afterEnter;\n afterEnter?: RouteGroupProps[\"afterEnter\"];\n $p$beforeLeave;\n beforeLeave?: RouteGroupProps[\"beforeLeave\"];\n get routes() {\n return this._$children;\n }\n routeMap: Record<string, RouteOption> = {};\n hitPath: string = \" NONE \";\n $$hitPath = 256;\n prevInfo: RouteInfo = {\n path: \"\"\n };\n currentPath: string;\n $$currentPath = 1024;\n get $f$currentPath() {\n if (this._$cache(\"currentPath\", [this.mode])) {\n return this.currentPath;\n }\n return this.mode === \"hash\" ? getHashLocation() : getHistoryLocation();\n }\n viewHolder: {\n view?: DLightViewProp | DLightViewProp | DLightViewProp;\n propView: boolean;\n params?: Record<string, string>;\n } = {\n propView: true\n };\n $$viewHolder = 2048;\n homeUrl(path: string) {\n // ---- Replace the leading \"~/\" with the base url\n return path.replace(/^~/, this._dl_router_baseUrl);\n }\n loaded = false;\n collectRoutes(key: string, value: RouteOption) {\n this.routeMap[key] = value;\n // ---- After the first render, setting the routeMap means change lazy or comp\n // So we need to update the route and get the new view\n if (this.loaded) this.updateRoute(this.prevInfo.path);\n }\n async updateRoute(currUrl: string) {\n if (!this.loaded) this.loaded = true;\n const fullCurrUrl = \"/\" + currUrl;\n currUrl = trimPath(fullCurrUrl.replace(new RegExp(`^${this._dl_router_baseUrl}`), \"\"));\n for (const [targetUrl, {\n comp,\n children,\n loading,\n redirect,\n info\n }] of Object.entries(this.routeMap)) {\n const newTargetUrl = this.homeUrl(targetUrl);\n // ---- Check if the route is a root route\n const isRootRoute = newTargetUrl === \"\" && currUrl === \"\";\n\n // ---- Check if the current path is a parent path of the target path\n const isParentPath = currUrl.startsWith(newTargetUrl + \"/\");\n let pathMatch: RegExpMatchArray | null = null;\n let params: Record<string, string> | undefined;\n if (!isParentPath) {\n // ---- Using regex to check if the current path matches the target path\n pathMatch = currUrl.match(new RegExp(`^${newTargetUrl}$`));\n if (pathMatch) params = pathMatch.groups;\n }\n const isMatch = isRootRoute || isParentPath || !!pathMatch;\n if (!isMatch) continue;\n\n // ---- Same order below, children > comp\n if (targetUrl === this.hitPath && paramObjCompare(params, this.viewHolder.params)) {\n if (children || !isDLightClass(comp) || this.viewHolder.view === comp) {\n // ---- When condition is the same, ignore\n return;\n }\n }\n\n // ---- Check guard\n const currInfo = {\n ...info,\n path: fullCurrUrl\n };\n if (this.guard) {\n const canGo = await this.guard(currInfo, this.prevInfo, this._dl_router_baseUrl);\n if (canGo === false) {\n this.navigator.to(this.prevInfo.path);\n return;\n }\n if (typeof canGo === \"string\") {\n this.navigator.to(this.homeUrl(canGo));\n return;\n }\n }\n // ---- Check redirect\n if (redirect) {\n this.navigator.to(this.homeUrl(redirect));\n return;\n }\n\n // ---- Life cycle\n this.beforeLeave && (await this.beforeLeave(currInfo, this.prevInfo, this._dl_router_baseUrl));\n const afterEnter = async () => {\n this.afterEnter && (await this.afterEnter(currInfo, this.prevInfo, this._dl_router_baseUrl));\n };\n if (children) {\n this._$ud(this.viewHolder = {\n view: children,\n propView: true\n }, \"viewHolder\");\n afterEnter();\n } else if (comp) {\n if (isDLightClass(comp)) {\n // ---- It's a component class\n this._$ud(this.viewHolder = {\n view: comp,\n propView: false,\n params\n }, \"viewHolder\");\n afterEnter();\n } else {\n // ---- It's a lazy loaded component\n const newLoading = loading ?? this.loading;\n if (newLoading) {\n this._$ud(this.viewHolder = {\n view: newLoading,\n propView: !!(newLoading as any).propViewFunc\n }, \"viewHolder\");\n }\n comp().then((module: any) => {\n this._$ud(this.viewHolder = {\n view: module.default,\n propView: false,\n params\n }, \"viewHolder\");\n afterEnter();\n });\n }\n }\n this._$ud(this.hitPath = targetUrl, \"hitPath\");\n this.prevInfo = {\n path: fullCurrUrl,\n ...params\n };\n return;\n }\n }\n navigator = new Navigator();\n $$navigator = 8192;\n changePath(path: string) {\n if (path === this.currentPath) return;\n this._$ud(this.currentPath = path, \"currentPath\");\n this.onPathUpdate && this.onPathUpdate(this.currentPath);\n }\n firstIn = false;\n historyChangeListen() {\n const newUrl = getHistoryLocation();\n this.changePath(newUrl);\n if (\"/\" + newUrl === this.prevInfo.path) return;\n this.updateRoute(newUrl);\n }\n hashChangeListen() {\n const newUrl = getHashLocation();\n this.changePath(newUrl);\n if (\"/\" + newUrl === this.prevInfo.path) return;\n this.updateRoute(newUrl);\n }\n willMount() {\n this._$ud(this.navigator.mode = this.mode!, \"navigator\");\n Promise.resolve().then(() => {\n if (this.mode === \"hash\") {\n this.hashChangeListen();\n } else {\n this.historyChangeListen();\n }\n });\n }\n didMount() {\n if (this.mode === \"hash\") {\n addEventListener(\"load\", this.hashChangeListen);\n addEventListener(\"hashchange\", this.hashChangeListen);\n return;\n }\n addEventListener(\"load\", this.historyChangeListen);\n addEventListener(\"popstate\", this.historyChangeListen);\n\n // ---- Listen to pushState\n historyPushStateFuncs.push(this.historyChangeListen);\n history.pushState = new Proxy(rawHistoryPushState, {\n apply(target, thisArg, argArray) {\n const res = target.apply(thisArg, (argArray as any));\n historyPushStateFuncs.forEach(func => func());\n return res;\n }\n });\n }\n willUnmount() {\n if (this.mode === \"hash\") {\n removeEventListener(\"load\", this.hashChangeListen);\n removeEventListener(\"hashchange\", this.hashChangeListen);\n return;\n }\n removeEventListener(\"load\", this.historyChangeListen);\n removeEventListener(\"popstate\", this.historyChangeListen);\n // ---- Delete current historyChangeListen\n historyPushStateFuncs = historyPushStateFuncs.filter(func => func !== this.historyChangeListen);\n if (historyPushStateFuncs.length > 0) {\n history.pushState = new Proxy(rawHistoryPushState, {\n apply(target, thisArg, argArray) {\n const res = target.apply(thisArg, (argArray as any));\n historyPushStateFuncs.forEach(func => func());\n return res;\n }\n });\n } else {\n history.pushState = rawHistoryPushState;\n }\n }\n Body() {\n let $node0, $node1, $node2;\n this._$update = $changed => {\n if ($changed & 257) {\n $node0 && $node0.updateEnv(\"_dl_router_baseUrl\", () => \"/\" + trimPath(`${this._dl_router_baseUrl}/${this.hitPath}`), [this._dl_router_baseUrl, this.hitPath]);\n }\n if ($changed & 1026) {\n $node0 && $node0.updateEnv(\"path\", () => this.currentPath, [this.currentPath]);\n }\n if ($changed & 2048) {\n $node2 && $node2.updateCond();\n }\n if ($changed & 8192) {\n $node0 && $node0.updateEnv(\"navigator\", () => this.navigator, [this.navigator]);\n }\n $node2 && $node2.update($changed);\n };\n $node0 = new $$EnvNode({\n _dl_router_routesCollect: this.collectRoutes,\n _dl_router_baseUrl: \"/\" + trimPath(`${this._dl_router_baseUrl}/${this.hitPath}`),\n path: this.currentPath,\n navigator: this.navigator\n }, {\n _dl_router_routesCollect: [],\n _dl_router_baseUrl: [this._dl_router_baseUrl, this.hitPath],\n path: [this.currentPath],\n navigator: [this.navigator]\n });\n $node1 = new $$ExpNode(this.routes, []);\n $node2 = new $$CondNode(2048, $thisCond => {\n if (this.viewHolder.propView) {\n if ($thisCond.cond === 0) {\n $thisCond.didntChange = true;\n return [];\n }\n $thisCond.cond = 0;\n let $node0;\n $thisCond.updateFunc = $changed => {\n if ($changed & 2048) {\n $node0 && $node0.update(() => this.viewHolder.view, [this.viewHolder?.view]);\n }\n };\n $node0 = new $$ExpNode(this.viewHolder.view, [this.viewHolder?.view]);\n return $thisCond.cond === 0 ? [$node0] : $thisCond.updateCond();\n } else {\n if ($thisCond.cond === 1) {\n $thisCond.didntChange = true;\n return [];\n }\n $thisCond.cond = 1;\n let $node0, $node1;\n $thisCond.updateFunc = $changed => {\n if ($changed & 2048) {\n $node1 && $node1.update(() => $node0, [this.viewHolder?.view]);\n }\n $node0 && $node0.update($changed);\n };\n $node0 = new $$PropView($addUpdate => {\n let $node0;\n $addUpdate($changed => {\n if ($changed & 2048) {\n $node0 && $node0._$setProps(() => this.viewHolder.params, [this.viewHolder?.params]);\n }\n });\n $node0 = new (this.viewHolder.view as any)();\n $node0._$init(null, null, null, null);\n return [$node0];\n });\n $node1 = new $$ExpNode($node0, [this.viewHolder?.view]);\n return $thisCond.cond === 1 ? [$node1] : $thisCond.updateCond();\n }\n });\n $node0.initNodes([$node1, $node2]);\n return [$node0];\n }\n}\nexport default ((RouteGroup as Pretty) as Typed<RouteGroupProps>);","import { createElement as $$createElement, setStyle as $$setStyle, setDataset as $$setDataset, setEvent as $$setEvent, delegateEvent as $$delegateEvent, setHTMLProp as $$setHTMLProp, setHTMLAttr as $$setHTMLAttr, setHTMLProps as $$setHTMLProps, setHTMLAttrs as $$setHTMLAttrs, createTextNode as $$createTextNode, updateText as $$updateText, insertNode as $$insertNode, ForNode as $$ForNode, CondNode as $$CondNode, ExpNode as $$ExpNode, EnvNode as $$EnvNode, TryNode as $$TryNode, SnippetNode as $$SnippetNode, PropView as $$PropView, render as $$render } from \"@dlightjs/dlight\";\nimport { View, type Pretty, type Typed, DLightViewProp, required } from \"@dlightjs/dlight\";\nimport { RouteGroupEnv, RouteOption, RouteProps } from \"./types\";\nclass Route extends View implements RouteProps {\n constructor() {\n super();\n this.collectRoutes = this.collectRoutes.bind(this);\n }\n $e$_dl_router_routesCollect;\n _dl_router_routesCollect: RouteGroupEnv[\"_dl_router_routesCollect\"] = required;\n $$_dl_router_routesCollect = 1;\n $s$_dl_router_routesCollect = [\"collectRoutes\"];\n $p$path;\n _$contentKey = \"path\";\n path: RouteProps[\"path\"] = (\".*\" as RouteProps[\"path\"]);\n $$path = 2;\n $s$path = [\"collectRoutes\"];\n $p$comp;\n comp?: RouteProps[\"comp\"];\n $$comp = 4;\n $s$comp = [\"collectRoutes\"];\n get children() {\n return this._$children;\n }\n $p$loading;\n loading?: RouteProps[\"loading\"];\n $$loading = 8;\n $s$loading = [\"collectRoutes\"];\n $p$redirect;\n redirect?: RouteProps[\"redirect\"];\n $$redirect = 16;\n $s$redirect = [\"collectRoutes\"];\n $p$info;\n info?: RouteOption[\"info\"];\n $$info = 32;\n $s$info = [\"collectRoutes\"];\n $w$collectRoutes;\n collectRoutes() {\n if (this._$cache(\"collectRoutes\", [this._dl_router_routesCollect, this.path, this.comp, this.loading, this.redirect, this.info])) {\n return;\n }\n this._dl_router_routesCollect!(this.path!, {\n comp: this.comp,\n children: this.children,\n loading: this.loading,\n redirect: this.redirect,\n info: this.info\n });\n }\n}\nexport default ((Route as Pretty) as Typed<RouteProps>);","import { createElement as $$createElement, setStyle as $$setStyle, setDataset as $$setDataset, setEvent as $$setEvent, delegateEvent as $$delegateEvent, setHTMLProp as $$setHTMLProp, setHTMLAttr as $$setHTMLAttr, setHTMLProps as $$setHTMLProps, setHTMLAttrs as $$setHTMLAttrs, createTextNode as $$createTextNode, updateText as $$updateText, insertNode as $$insertNode, ForNode as $$ForNode, CondNode as $$CondNode, ExpNode as $$ExpNode, EnvNode as $$EnvNode, TryNode as $$TryNode, SnippetNode as $$SnippetNode, PropView as $$PropView, render as $$render } from \"@dlightjs/dlight\";\nimport { View, type Pretty, type Typed, ContentProp, required, DLightViewProp } from \"@dlightjs/dlight\";\nimport { RouteEnv } from \"./types\";\nimport { Navigator } from \"./Navigator\";\nimport { getHashLocation, getHistoryLocation } from \"./utils\";\ninterface LinkProps {\n /**\n * @brief The content of the link\n */\n content?: ContentProp<string>;\n /**\n * @brief The path to navigate to\n */\n to: string;\n /**\n * @brief The mode of navigation, will retrieved from the navigator if not provided\n */\n mode?: \"hash\" | \"history\";\n /**\n * @brief The style of the a tag\n */\n style?: Record<string, string>;\n /**\n * @brief The class of the a tag\n */\n class?: string;\n}\nclass Link extends View implements LinkProps {\n constructor() {\n super();\n this.handleClick = this.handleClick.bind(this);\n }\n $p$content;\n _$contentKey = \"content\";\n content: LinkProps[\"content\"] = required;\n $$content = 1;\n $p$to;\n to: LinkProps[\"to\"] = required;\n $p$mode;\n mode: LinkProps[\"mode\"] = \"history\";\n $$mode = 4;\n $s$mode = [\"nav\"];\n $p$style;\n style?: LinkProps[\"style\"] = {};\n $$style = 8;\n $p$class;\n class?: LinkProps[\"class\"] = \"\";\n $$class = 16;\n get children() {\n return this._$children;\n }\n $e$navigator;\n navigator: RouteEnv[\"navigator\"] = required;\n $$navigator = 32;\n $s$navigator = [\"nav\"];\n nav;\n get $f$nav() {\n if (this._$cache(\"nav\", [this.navigator, this.mode])) {\n return this.nav;\n }\n return this.navigator ?? new Navigator(this.mode);\n }\n handleClick(e: Event) {\n e.preventDefault();\n if (this.to.startsWith(\"http\")) return window.open(this.to, \"_blank\");\n if (this.to.startsWith(\"?\")) {\n // ---- return current path with query\n const currentPath = this.nav.mode === \"history\" ? getHistoryLocation() : getHashLocation();\n return this.nav.to(currentPath + this.to);\n }\n this.nav.to(this.to);\n }\n Body() {\n let $node0, $node1;\n this._$update = $changed => {\n if ($changed & 1) {\n $node1 && $node1.update(() => this.children ?? this.content, [this.content]);\n }\n if ($changed & 8) {\n $node0 && $$setStyle($node0, this.style);\n }\n if ($changed & 16) {\n $node0 && $$setHTMLProp($node0, \"className\", () => this.class, [this.class]);\n }\n };\n $node0 = $$createElement(\"a\");\n $$setStyle($node0, this.style);\n $$setHTMLProp($node0, \"className\", () => this.class, [this.class]);\n $$delegateEvent($node0, \"click\", this.handleClick);\n $node1 = new $$ExpNode(this.children ?? this.content, [this.content]);\n $$insertNode($node0, $node1, 0);\n $node0._$nodes = [$node1];\n return [$node0];\n }\n}\nexport default ((Link as Pretty) as Typed<LinkProps>);","import { createElement as $$createElement, setStyle as $$setStyle, setDataset as $$setDataset, setEvent as $$setEvent, delegateEvent as $$delegateEvent, setHTMLProp as $$setHTMLProp, setHTMLAttr as $$setHTMLAttr, setHTMLProps as $$setHTMLProps, setHTMLAttrs as $$setHTMLAttrs, createTextNode as $$createTextNode, updateText as $$updateText, insertNode as $$insertNode, ForNode as $$ForNode, CondNode as $$CondNode, ExpNode as $$ExpNode, EnvNode as $$EnvNode, TryNode as $$TryNode, SnippetNode as $$SnippetNode, PropView as $$PropView, render as $$render } from \"@dlightjs/dlight\";\nimport { Pretty, View } from \"@dlightjs/dlight\";\n\n/**\n * @example\n * ```js\n * import { lazy } from \"@dlightjs/components\"\n * const MyComp = lazy(() => import(\"./MyComp.view\"))\n *\n * import Loading from \"./Loading.view\"\n * const MyComp = lazy(() => import(\"./MyComp.view\"), Loading)\n * ```\n */\nexport function lazy<T>(importFunc: () => Promise<{\n default: T;\n}>, FallbackCls?: any) {\n class LazyComp extends View {\n constructor() {\n super();\n this.willMount = this.willMount.bind(this);\n }\n _$forwardProps;\n _$forwardPropsSet = new Set();\n _$forwardPropsId = [];\n ViewCls?: any;\n $$ViewCls = 8;\n willMount() {\n void importFunc().then((module: any) => {\n this._$ud(this.ViewCls = module.default, \"ViewCls\");\n });\n }\n Body() {\n let $node0;\n this._$update = $changed => {\n if ($changed & 8) {\n $node0 && $node0.updateCond();\n }\n $node0 && $node0.update($changed);\n };\n $node0 = new $$CondNode(8, $thisCond => {\n if (this.ViewCls) {\n if ($thisCond.cond === 0) {\n $thisCond.didntChange = true;\n return [];\n }\n $thisCond.cond = 0;\n let $node0, $node1;\n $thisCond.updateFunc = $changed => {\n if ($changed & 8) {\n $node1 && $node1.update(() => $node0, [this.ViewCls]);\n }\n $node0 && $node0.update($changed);\n };\n $node0 = new $$PropView($addUpdate => {\n let $node0;\n $node0 = new this.ViewCls();\n $node0._$init(null, null, null, this);\n return [$node0];\n });\n $node1 = new $$ExpNode($node0, [this.ViewCls]);\n return $thisCond.cond === 0 ? [$node1] : $thisCond.updateCond();\n } else if (FallbackCls) {\n if ($thisCond.cond === 1) {\n $thisCond.didntChange = true;\n return [];\n }\n $thisCond.cond = 1;\n let $node0;\n $thisCond.updateFunc = $changed => {};\n $node0 = new FallbackCls();\n $node0._$init(null, null, null, null);\n return $thisCond.cond === 1 ? [$node0] : $thisCond.updateCond();\n } else {\n if ($thisCond.cond === 2) {\n $thisCond.didntChange = true;\n return [];\n }\n $thisCond.cond = 2;\n $thisCond.updateFunc = $changed => {};\n return $thisCond.cond === 2 ? [] : $thisCond.updateCond();\n }\n });\n return [$node0];\n }\n }\n return ((LazyComp as Pretty) as T);\n}","import { createElement as $$createElement, setStyle as $$setStyle, setDataset as $$setDataset, setEvent as $$setEvent, delegateEvent as $$delegateEvent, setHTMLProp as $$setHTMLProp, setHTMLAttr as $$setHTMLAttr, setHTMLProps as $$setHTMLProps, setHTMLAttrs as $$setHTMLAttrs, createTextNode as $$createTextNode, updateText as $$updateText, insertNode as $$insertNode, ForNode as $$ForNode, CondNode as $$CondNode, ExpNode as $$ExpNode, EnvNode as $$EnvNode, TryNode as $$TryNode, SnippetNode as $$SnippetNode, PropView as $$PropView, render as $$render } from \"@dlightjs/dlight\";\nimport { DLightViewProp, Pretty, Typed, View, required, CSSProperties } from \"@dlightjs/dlight\";\nimport { injectFuncToInitNodes } from \"../Injection/utils\";\ninterface HStackProps {\n spacing?: number;\n alignment?: \"top\" | \"bottom\" | \"center\";\n width?: string;\n height?: string;\n style?: CSSProperties;\n class?: string;\n}\nclass HStack extends View implements HStackProps {\n constructor() {\n super();\n this.setStyles = this.setStyles.bind(this);\n this.didMount = this.didMount.bind(this);\n }\n $p$spacing;\n spacing = 0;\n $$spacing = 1;\n $p$alignment;\n alignment: HStackProps[\"alignment\"] = \"top\";\n $$alignment = 2;\n $s$alignment = [\"margin\"];\n $p$width;\n width = \"100%\";\n $$width = 4;\n $p$height;\n height = \"max-content\";\n $$height = 8;\n $p$style;\n style?: HStackProps[\"style\"] = {};\n $$style = 16;\n $p$class;\n class?: HStackProps[\"class\"];\n $$class = 32;\n get children() {\n return this._$children;\n }\n margin;\n get $f$margin() {\n if (this._$cache(\"margin\", [this.alignment])) {\n return this.margin;\n }\n return {\n top: \"0 0 auto 0\",\n bottom: \"auto 0 0 0\",\n center: \"auto 0\"\n }[this.alignment!] ?? \"0 0 auto 0\";\n }\n nodes: any[] = [];\n setStyles(nodes: any) {\n View.loopShallowEls(nodes, (el: HTMLElement) => {\n el.style.flexShrink = \"0\";\n el.style.margin = this.margin;\n });\n }\n didMount() {\n this.setStyles(this.nodes);\n injectFuncToInitNodes(this.nodes, this.setStyles);\n }\n Body() {\n let $node0, $node1;\n this._$update = $changed => {\n if ($changed & 29) {\n $node0 && $$setStyle($node0, {\n ...this.style,\n height: this.height,\n width: this.width,\n columnGap: `${this.spacing}px`,\n display: \"flex\",\n flexDirection: \"row\"\n });\n }\n if ($changed & 32) {\n $node0 && $$setHTMLProp($node0, \"className\", () => this.class, [this.class]);\n }\n };\n $node0 = $$createElement(\"div\");\n $$setHTMLProp($node0, \"className\", () => this.class, [this.class]);\n $$setStyle($node0, {\n ...this.style,\n height: this.height,\n width: this.width,\n columnGap: `${this.spacing}px`,\n display: \"flex\",\n flexDirection: \"row\"\n });\n $node1 = new $$ExpNode(this.children, []);\n View.addDidMount($node1, (node: any) => {\n this.nodes = node._$nodes;\n });\n $$insertNode($node0, $node1, 0);\n $node0._$nodes = [$node1];\n return [$node0];\n }\n}\nexport default ((HStack as Pretty) as Typed<HStackProps>);","export function loopNodes(nodes: any[], runFunc: (node: any) => void) {\n const stack = [...nodes].reverse();\n while (stack.length > 0) {\n const node = stack.pop();\n runFunc(node);\n if (!(\"_$dlNodeType\" in node)) {\n if (node._$nodes) {\n stack.push(...[...node._$nodes].reverse());\n } else {\n stack.push(...[...node.childNodes].reverse());\n }\n } else node._$nodes && stack.push(...[...node._$nodes].reverse());\n }\n}\nexport function injectFuncToInitNodes(nodes: any[], func: (node: any) => void) {\n const inject = (nodes: any[]) => {\n loopNodes(nodes, node => {\n if (node.initNewNodes) {\n const baseInitNewNodes = node.initNewNodes;\n node.initNewNodes = function (newNodes: any) {\n baseInitNewNodes.call(this, newNodes);\n func(newNodes);\n inject(newNodes);\n };\n }\n });\n };\n inject(nodes);\n}","import { createElement as $$createElement, setStyle as $$setStyle, setDataset as $$setDataset, setEvent as $$setEvent, delegateEvent as $$delegateEvent, setHTMLProp as $$setHTMLProp, setHTMLAttr as $$setHTMLAttr, setHTMLProps as $$setHTMLProps, setHTMLAttrs as $$setHTMLAttrs, createTextNode as $$createTextNode, updateText as $$updateText, insertNode as $$insertNode, ForNode as $$ForNode, CondNode as $$CondNode, ExpNode as $$ExpNode, EnvNode as $$EnvNode, TryNode as $$TryNode, SnippetNode as $$SnippetNode, PropView as $$PropView, render as $$render } from \"@dlightjs/dlight\";\nimport { CSSProperties, DLightViewProp, Pretty, Typed, View, required } from \"@dlightjs/dlight\";\nimport { injectFuncToInitNodes } from \"../Injection/utils\";\ninterface VStackProps {\n spacing?: number;\n alignment?: \"leading\" | \"tailing\" | \"center\";\n width?: string;\n height?: string;\n style?: CSSProperties;\n class?: string;\n}\nclass VStack extends View implements VStackProps {\n constructor() {\n super();\n this.setStyles = this.setStyles.bind(this);\n this.didMount = this.didMount.bind(this);\n }\n $p$spacing;\n spacing = 0;\n $$spacing = 1;\n $p$alignment;\n alignment: VStackProps[\"alignment\"] = \"leading\";\n $$alignment = 2;\n $s$alignment = [\"margin\"];\n $p$width;\n width = \"max-content\";\n $$width = 4;\n $p$height;\n height = \"100%\";\n $$height = 8;\n $p$style;\n style?: VStackProps[\"style\"] = {};\n $$style = 16;\n $p$class;\n class?: VStackProps[\"class\"];\n $$class = 32;\n get children() {\n return this._$children;\n }\n margin;\n get $f$margin() {\n if (this._$cache(\"margin\", [this.alignment])) {\n return this.margin;\n }\n return {\n leading: \"0 auto 0 0\",\n tailing: \"0 0 0 auto\",\n center: \"0 auto\"\n }[this.alignment!] ?? \"0 auto 0 0\";\n }\n nodes: any[] = [];\n setStyles(nodes: any) {\n View.loopShallowEls(nodes, (el: HTMLElement) => {\n el.style.flexShrink = \"0\";\n el.style.margin = this.margin;\n });\n }\n didMount() {\n this.setStyles(this.nodes);\n injectFuncToInitNodes(this.nodes, this.setStyles);\n }\n Body() {\n let $node0, $node1;\n this._$update = $changed => {\n if ($changed & 29) {\n $node0 && $$setStyle($node0, {\n ...this.style,\n height: this.height,\n width: this.width,\n rowGap: `${this.spacing}px`,\n display: \"flex\",\n flexDirection: \"column\"\n });\n }\n if ($changed & 32) {\n $node0 && $$setHTMLProp($node0, \"className\", () => this.class, [this.class]);\n }\n };\n $node0 = $$createElement(\"div\");\n $$setHTMLProp($node0, \"className\", () => this.class, [this.class]);\n $$setStyle($node0, {\n ...this.style,\n height: this.height,\n width: this.width,\n rowGap: `${this.spacing}px`,\n display: \"flex\",\n flexDirection: \"column\"\n });\n $node1 = new $$ExpNode(this.children, []);\n View.addDidMount($node1, (node: any) => {\n this.nodes = node._$nodes;\n });\n $$insertNode($node0, $node1, 0);\n $node0._$nodes = [$node1];\n return [$node0];\n }\n}\nexport default ((VStack as Pretty) as Typed<VStackProps>);","import { createElement as $$createElement, setStyle as $$setStyle, setDataset as $$setDataset, setEvent as $$setEvent, delegateEvent as $$delegateEvent, setHTMLProp as $$setHTMLProp, setHTMLAttr as $$setHTMLAttr, setHTMLProps as $$setHTMLProps, setHTMLAttrs as $$setHTMLAttrs, createTextNode as $$createTextNode, updateText as $$updateText, insertNode as $$insertNode, ForNode as $$ForNode, CondNode as $$CondNode, ExpNode as $$ExpNode, EnvNode as $$EnvNode, TryNode as $$TryNode, SnippetNode as $$SnippetNode, PropView as $$PropView, render as $$render } from \"@dlightjs/dlight\";\nimport { CSSProperties, DLightViewProp, Pretty, Typed, View, required } from \"@dlightjs/dlight\";\nimport { injectFuncToInitNodes } from \"../Injection/utils\";\ninterface ZStackProps {\n hAlignment?: \"leading\" | \"center\" | \"tailing\";\n vAlignment?: \"top\" | \"center\" | \"bottom\";\n width?: string;\n height?: string;\n style?: CSSProperties;\n class?: string;\n}\nclass ZStack extends View implements ZStackProps {\n constructor() {\n super();\n this.setStyles = this.setStyles.bind(this);\n this.didMount = this.didMount.bind(this);\n }\n $p$hAlignment;\n hAlignment: ZStackProps[\"hAlignment\"] = \"center\";\n $$hAlignment = 1;\n $s$hAlignment = [\"justifyItems\"];\n $p$vAlignment;\n vAlignment: ZStackProps[\"vAlignment\"] = \"center\";\n $$vAlignment = 2;\n $s$vAlignment = [\"alignItems\"];\n $p$width;\n width = \"max-content\";\n $$width = 4;\n $p$height;\n height = \"max-content\";\n $$height = 8;\n $p$style;\n style?: ZStackProps[\"style\"] = {};\n $$style = 16;\n $p$class;\n class?: ZStackProps[\"class\"];\n $$class = 32;\n get children() {\n return this._$children;\n }\n justifyItems;\n $$justifyItems = 64;\n get $f$justifyItems() {\n if (this._$cache(\"justifyItems\", [this.hAlignment])) {\n return this.justifyItems;\n }\n return {\n leading: \"flex-start\",\n center: \"center\",\n tailing: \"flex-end\"\n }[this.hAlignment!] ?? \"center\";\n }\n alignItems;\n $$alignItems = 128;\n get $f$alignItems() {\n if (this._$cache(\"alignItems\", [this.vAlignment])) {\n return this.alignItems;\n }\n return {\n top: \"flex-start\",\n center: \"center\",\n bottom: \"flex-end\"\n }[this.vAlignment!] ?? \"center\";\n }\n nodes: any[] = [];\n setStyles(nodes: any) {\n View.loopShallowEls(nodes, (el: HTMLElement) => {\n el.style.position = \"absolute\";\n el.style.gridArea = \"1 / 1/ 1 / 1\";\n });\n }\n didMount() {\n this.setStyles(this.nodes);\n injectFuncToInitNodes(this.nodes, this.setStyles);\n }\n Body() {\n let $node0, $node1;\n this._$update = $changed => {\n if ($changed & 32) {\n $node0 && $$setHTMLProp($node0, \"className\", () => this.class, [this.class]);\n }\n if ($changed & 223) {\n $node0 && $$setStyle($node0, {\n ...this.style,\n height: this.height,\n width: this.width,\n display: \"grid\",\n alignItems: this.alignItems,\n justifyItems: this.justifyItems\n });\n }\n };\n $node0 = $$createElement(\"div\");\n $$setHTMLProp($node0, \"className\", () => this.class, [this.class]);\n $$setStyle($node0, {\n ...this.style,\n height: this.height,\n width: this.width,\n display: \"grid\",\n alignItems: this.alignItems,\n justifyItems: this.justifyItems\n });\n $node1 = new $$ExpNode(this.children, []);\n View.addDidMount($node1, (node: any) => {\n this.nodes = node._$nodes;\n });\n $$insertNode($node0, $node1, 0);\n $node0._$nodes = [$node1];\n return [$node0];\n }\n}\nexport default ((ZStack as Pretty) as Typed<ZStack>);","import { createElement as $$createElement, setStyle as $$setStyle, setDataset as $$setDataset, setEvent as $$setEvent, delegateEvent as $$delegateEvent, setHTMLProp as $$setHTMLProp, setHTMLAttr as $$setHTMLAttr, setHTMLProps as $$setHTMLProps, setHTMLAttrs as $$setHTMLAttrs, createTextNode as $$createTextNode, updateText as $$updateText, insertNode as $$insertNode, ForNode as $$ForNode, CondNode as $$CondNode, ExpNode as $$ExpNode, EnvNode as $$EnvNode, TryNode as $$TryNode, SnippetNode as $$SnippetNode, PropView as $$PropView, render as $$render } from \"@dlightjs/dlight\";\nimport { Pretty, Typed, View } from \"@dlightjs/dlight\";\nclass Spacer extends View {\n isSpacer = true;\n Body() {\n let $node0;\n $node0 = $$createElement(\"div\");\n $$setStyle($node0, {\n flexGrow: 1\n });\n return [$node0];\n }\n}\nexport default ((Spacer as Pretty) as Typed);"],"mappings":"mbAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,YAAAE,EAAA,SAAAC,EAAA,cAAAC,EAAA,UAAAC,EAAA,eAAAC,EAAA,WAAAC,GAAA,WAAAC,EAAA,WAAAC,EAAA,SAAAC,KAAA,eAAAC,GAAAX,ICAO,SAASY,GAAkB,CAChC,OAAO,SAAS,KAAK,MAAM,CAAC,CAC9B,CACO,SAASC,GAAqB,CACnC,OAAO,SAAS,SAAS,MAAM,CAAC,CAClC,CACO,SAASC,EAAQC,EAAaC,EAA0B,CAC7D,IAAIC,EACJ,GAAIF,EAAI,CAAC,IAAM,IACbE,EAAUF,MACL,CAEDA,EAAI,CAAC,IAAM,MAAKA,EAAM,KAAOA,GACjC,IAAMG,EAAUF,IAAS,UAAY,OAAO,SAAS,SAAW,OAAO,SAAS,KAAK,QAAQ,KAAM,EAAE,EAC/FG,EAAYJ,EAAI,MAAM,GAAG,EACzBK,EAAWF,EAAQ,MAAM,GAAG,EAAE,OAAOG,GAAKA,CAAC,EAC7CC,EAAM,EACV,QAAWC,KAAYJ,EAAW,CAChC,GAAI,CAAC,CAAC,IAAK,IAAI,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