@lytjs/core 4.0.5 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,288 @@
1
+ # @lytjs/core
2
+
3
+ Lyt.js 核心入口 - 整合响应式、编译器、虚拟 DOM、渲染器和组件系统,提供完整的应用开发能力。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npm install @lytjs/core
9
+
10
+ # 或使用 pnpm
11
+ pnpm add @lytjs/core
12
+ ```
13
+
14
+ ## 特性
15
+
16
+ - 🚀 零运行时依赖,极致轻量
17
+ - 🎨 所见即代码,无 `v-` 前缀的模板语法
18
+ - 🔄 完整的 Composition API
19
+ - 📦 内置组件系统、插槽、KeepAlive、Suspense
20
+ - 🌐 Web Component 支持
21
+ - 🔌 插件系统
22
+
23
+ ## 快速开始
24
+
25
+ ### 创建应用
26
+
27
+ ```javascript
28
+ import { createApp, defineComponent, h } from '@lytjs/core';
29
+
30
+ const App = defineComponent({
31
+ setup() {
32
+ return { count: 0 };
33
+ },
34
+ render() {
35
+ return h('div', [
36
+ h('h1', `Count: ${this.count}`),
37
+ h('button', {
38
+ onClick: () => this.count++
39
+ }, 'Increment')
40
+ ]);
41
+ }
42
+ });
43
+
44
+ const app = createApp(App);
45
+ app.mount('#app');
46
+ ```
47
+
48
+ ### 使用模板
49
+
50
+ ```javascript
51
+ import { createApp, defineComponent } from '@lytjs/core';
52
+
53
+ const App = defineComponent({
54
+ setup() {
55
+ return { count: 0 };
56
+ },
57
+ template: `
58
+ <div>
59
+ <h1>Count: {{ count }}</h1>
60
+ <button @click="count++">Increment</button>
61
+ </div>
62
+ `
63
+ });
64
+
65
+ const app = createApp(App);
66
+ app.mount('#app');
67
+ ```
68
+
69
+ ### 使用插件
70
+
71
+ ```javascript
72
+ import { createApp, defineComponent } from '@lytjs/core';
73
+
74
+ const myPlugin = {
75
+ install(app, options) {
76
+ app.config.globalProperties.$hello = 'Hello from plugin!';
77
+ }
78
+ };
79
+
80
+ const app = createApp(App);
81
+ app.use(myPlugin, { someOption: true });
82
+ app.mount('#app');
83
+ ```
84
+
85
+ ### Web Component
86
+
87
+ ```javascript
88
+ import { defineCustomElement, defineComponent } from '@lytjs/core';
89
+
90
+ const MyComponent = defineComponent({
91
+ props: ['name'],
92
+ template: `<div>Hello, {{ name }}!</div>`
93
+ });
94
+
95
+ customElements.define('my-component', defineCustomElement(MyComponent));
96
+ ```
97
+
98
+ ## API 参考
99
+
100
+ ### 应用 API
101
+
102
+ | API | 说明 |
103
+ |------|------|
104
+ | `createApp(rootComponent, rootProps)` | 创建应用实例 |
105
+ | `createSSRApp(rootComponent, rootProps)` | 创建 SSR 应用实例 |
106
+
107
+ ### 应用实例
108
+
109
+ | API | 说明 |
110
+ |------|------|
111
+ | `app.mount(container)` | 挂载应用到 DOM 容器 |
112
+ | `app.unmount()` | 卸载应用 |
113
+ | `app.use(plugin, options)` | 安装插件 |
114
+ | `app.component(name, component)` | 注册全局组件 |
115
+ | `app.directive(name, directive)` | 注册全局指令 |
116
+ | `app.provide(key, value)` | 全局提供值 |
117
+ | `app.config` | 应用配置对象 |
118
+
119
+ ### 组件定义
120
+
121
+ | API | 说明 |
122
+ |------|------|
123
+ | `defineComponent(options)` | 定义组件 |
124
+ | `defineAsyncComponent(loader)` | 定义异步组件 |
125
+ | `resolveComponent(name)` | 解析组件 |
126
+
127
+ ### 渲染 API
128
+
129
+ | API | 说明 |
130
+ |------|------|
131
+ | `h(type, props, children)` | 创建虚拟节点 |
132
+ | `render(vnode, container)` | 渲染虚拟节点 |
133
+
134
+ ### 依赖注入
135
+
136
+ | API | 说明 |
137
+ |------|------|
138
+ | `provide(key, value)` | 提供值给后代组件 |
139
+ | `inject(key, defaultValue)` | 注入祖先组件提供的值 |
140
+
141
+ ### 内置组件
142
+
143
+ | 组件 | 说明 |
144
+ |------|------|
145
+ | `KeepAlive` | 缓存失活组件实例 |
146
+ | `Teleport` | 将内容渲染到指定 DOM 位置 |
147
+ | `Transition` | 单个元素/组件的过渡动画 |
148
+ | `TransitionGroup` | 列表的过渡动画 |
149
+ | `Suspense` | 等待异步依赖 |
150
+
151
+ ## 模板语法
152
+
153
+ Lyt.js 的模板语法与原生 HTML 更接近,去掉了 `v-` 前缀:
154
+
155
+ ### 插值
156
+
157
+ ```html
158
+ <span>Text: {{ message }}</span>
159
+ ```
160
+
161
+ ### 指令
162
+
163
+ ```html
164
+ <!-- 条件渲染 -->
165
+ <div if="visible">显示</div>
166
+ <div else-if="pending">加载中...</div>
167
+ <div else>隐藏</div>
168
+
169
+ <!-- 列表渲染 -->
170
+ <ul>
171
+ <li each="(item, index) in items" :key="item.id">
172
+ {{ index }}: {{ item.text }}
173
+ </li>
174
+ </ul>
175
+
176
+ <!-- 事件绑定 -->
177
+ <button @click="handleClick">点击</button>
178
+ <input @input="handleInput" />
179
+
180
+ <!-- 属性绑定 -->
181
+ <img :src="imageUrl" :alt="altText" />
182
+ <div :class="{ active: isActive }"></div>
183
+ ```
184
+
185
+ ## 组件生命周期
186
+
187
+ ```javascript
188
+ import { defineComponent, onMounted, onUpdated, onUnmounted } from '@lytjs/core';
189
+
190
+ const MyComponent = defineComponent({
191
+ setup() {
192
+ onMounted(() => {
193
+ console.log('组件已挂载');
194
+ });
195
+
196
+ onUpdated(() => {
197
+ console.log('组件已更新');
198
+ });
199
+
200
+ onUnmounted(() => {
201
+ console.log('组件已卸载');
202
+ });
203
+
204
+ return {};
205
+ }
206
+ });
207
+ ```
208
+
209
+ | 生命周期 | 说明 |
210
+ |----------|------|
211
+ | `onBeforeMount` | 组件挂载前 |
212
+ | `onMounted` | 组件挂载后 |
213
+ | `onBeforeUpdate` | 组件更新前 |
214
+ | `onUpdated` | 组件更新后 |
215
+ | `onBeforeUnmount` | 组件卸载前 |
216
+ | `onUnmounted` | 组件卸载后 |
217
+
218
+ ## 示例
219
+
220
+ ### Todo List
221
+
222
+ ```javascript
223
+ import { createApp, defineComponent, ref } from '@lytjs/core';
224
+
225
+ const App = defineComponent({
226
+ setup() {
227
+ const todos = ref([{ id: 1, text: 'Learn Lyt.js', done: false }]);
228
+ const newTodo = ref('');
229
+
230
+ function addTodo() {
231
+ if (newTodo.value.trim()) {
232
+ todos.value.push({
233
+ id: Date.now(),
234
+ text: newTodo.value,
235
+ done: false
236
+ });
237
+ newTodo.value = '';
238
+ }
239
+ }
240
+
241
+ function toggleTodo(todo) {
242
+ todo.done = !todo.done;
243
+ }
244
+
245
+ return { todos, newTodo, addTodo, toggleTodo };
246
+ },
247
+ template: `
248
+ <div>
249
+ <h1>Todo List</h1>
250
+ <div>
251
+ <input v-model="newTodo" @keyup.enter="addTodo" />
252
+ <button @click="addTodo">Add</button>
253
+ </div>
254
+ <ul>
255
+ <li
256
+ each="todo in todos"
257
+ :key="todo.id"
258
+ :class="{ done: todo.done }"
259
+ @click="toggleTodo(todo)"
260
+ >
261
+ {{ todo.text }}
262
+ </li>
263
+ </ul>
264
+ </div>
265
+ `
266
+ });
267
+
268
+ createApp(App).mount('#app');
269
+ ```
270
+
271
+ ## 性能
272
+
273
+ - 核心体积:2.13 KB (ESM gzip)
274
+ - 零运行时依赖
275
+ - Block Tree 虚拟 DOM 优化
276
+ - Patch Flag 差异化更新
277
+
278
+ ## 兼容性
279
+
280
+ - Node.js >= 18.0.0
281
+ - Chrome 64+
282
+ - Firefox 63+
283
+ - Safari 12+
284
+ - Edge 79+
285
+
286
+ ## License
287
+
288
+ MIT
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- var O=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var Y=(n,e)=>{for(var t in e)O(n,t,{get:e[t],enumerable:!0})},h=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of q(e))!X.call(n,o)&&o!==t&&O(n,o,{get:()=>e[o],enumerable:!(i=$(e,o))||i.enumerable});return n},A=(n,e,t)=>(h(n,e,"default"),t&&h(t,e,"default"));var K=n=>h(O({},"__esModule",{value:!0}),n);var v={};Y(v,{Fragment:()=>j,ShapeFlags:()=>L,createApp:()=>B,h:()=>I});module.exports=K(v);var y=require("@lytjs/common"),L=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(L||{}),j=Symbol("Fragment");function Z(n,e){if(e!=null)if((0,y.isStringOrNumber)(e))n.children=String(e),n.shapeFlag|=8;else if((0,y.isArray)(e)){let t=[];for(let i=0;i<e.length;i++){let o=e[i];if(!(o==null||typeof o=="boolean"))if((0,y.isArray)(o))for(let d=0;d<o.length;d++){let s=o[d];s!=null&&typeof s!="boolean"&&t.push((0,y.isVNode)(s)?s:E(String(s)))}else(0,y.isVNode)(o)?t.push(o):t.push(E(String(o)))}n.children=t,n.shapeFlag|=16}else typeof e=="object"&&(n.children=e,n.shapeFlag|=32)}function E(n,e=null,t=null){var u,f;let i=0;typeof n=="string"?i=1:n===j?i=0:typeof n=="function"?i=2:typeof n=="object"&&n!==null&&(n.setup||n.__vccOpts||n.render)&&(i=4);let o=(u=e==null?void 0:e.key)!=null?u:null,d=(f=e==null?void 0:e.ref)!=null?f:null,s=e;if(e){let{key:C,ref:p,...P}=e;s=P}let b={type:n,props:s,children:null,key:o,ref:d,shapeFlag:i,el:null,component:null};return t!=null&&Z(b,t),b}function I(n,e,t){return E(n,e||null,t||null)}var N=require("@lytjs/common");function D(n){return Object.create(n||null)}function V(n){return n!==null&&typeof n=="object"&&typeof n.install=="function"}function _(n){return typeof n=="function"}function F(n,e,...t){if(V(e)){let i=e.onBeforeInstall?e.onBeforeInstall(n,...t):void 0;if((0,N.isPromise)(i))return i.then(()=>{let o=e.install(n,...t);if((0,N.isPromise)(o))return o.then(()=>{if(e.onInstalled)return e.onInstalled(n,...t)});if(e.onInstalled)return e.onInstalled(n,...t)});{let o=e.install(n,...t);if((0,N.isPromise)(o))return o.then(()=>{if(e.onInstalled)return e.onInstalled(n,...t)});if(e.onInstalled)return e.onInstalled(n,...t)}}else if(_(e))return e(n,...t)}function S(n,e){if(V(e)){if(typeof e.uninstall=="function")return e.uninstall(n)}else _(e)}var T=require("@lytjs/reactivity"),H=require("@lytjs/compiler"),c=require("@lytjs/component"),M=require("@lytjs/renderer"),G=100,g=new Map;function J(n){let e=g.get(n);if(e)return g.delete(n),g.set(n,e),e;let{code:t}=(0,H.compile)(n);if(e=new Function("h","_ctx",`return ${t}`),g.size>=G){let i=g.keys().next().value;g.delete(i)}return g.set(n,e),e}function Q(n){let e={...n};if(n.state&&typeof n.state!="function"){let t=n.state;e.state=()=>({...t})}if(typeof n.render=="function"){let t=n.render;e.render=(i,o)=>t(i)}if(n.computed){let t={};for(let i of Object.keys(n.computed)){let o=n.computed[i];typeof o=="function"?t[i]={get:o}:t[i]=o}e.computed=t}if(typeof n.init=="function"){let t=n.init;e.init=function(i,o){return t.call(this,i)}}return e}function W(){return{createElement(n){return document.createElement(n)},createText(n){return document.createTextNode(n)},createComment(n){return document.createComment(n)},setAttribute(n,e,t){n.setAttribute(e,String(t))},removeAttribute(n,e){n.removeAttribute(e)},setStyle(n,e){if(typeof e=="string")n.style.cssText=e;else if(e&&typeof e=="object")for(let t in e)n.style[t]=e[t]},setClass(n,e){if(typeof e=="string")n.className=e;else if(e&&typeof e=="object"){let t=[];for(let[i,o]of Object.entries(e))o&&t.push(i);n.className=t.join(" ")}else n.className=""},insert(n,e,t){t!=null?n.insertBefore(e,t):n.appendChild(e)},remove(n){n.parentNode&&n.parentNode.removeChild(n)},replace(n,e,t){n.replaceChild(t,e)},addEventListener(n,e,t,i){n.addEventListener(e,t,i)},removeEventListener(n,e,t){n.removeEventListener(e,t)},nextTick(n){Promise.resolve().then(n)},parentNode(n){return n.parentNode},nextSibling(n){return n.nextSibling},querySelector(n){return document.querySelector(n)}}}function B(n,e){let t=new Set,i={},o={},d=D(),s={},b={},u=null,f=null,C=null,p=null,P=!1,w=Q(typeof n=="function"?{render:n}:n),U=(0,c.defineComponent)(w),r={config:s,globalProperties:b,get _instance(){return u},mount(a){if(P)return r;let l;if(typeof a=="string"){if(l=document.querySelector(a),!l)throw new Error(`[Lyt] \u627E\u4E0D\u5230\u6302\u8F7D\u76EE\u6807: "${a}"`)}else l=a;p=l;let m=W();f=(0,M.createRenderer)(m),u=(0,c.createComponentInstance)(U),(0,c.setupComponent)(u,e||{},null);let R=u.type;if(!R.render&&R.template){let k=J(R.template);R.render=(x,z)=>k(x,z.renderProxy)}return(0,c.mountComponent)(u,I),u.subTree&&f.mount(u.subTree,l),C=(0,T.effect)(()=>{if(!(!u||!u.isMounted||!f)&&((0,c.updateComponent)(u,I),u.subTree&&p)){let k=p.firstChild,x=u.subTree;p.innerHTML="",f.mount(x,p)}},{lazy:!0}),P=!0,r},unmount(){P&&(C&&((0,T.stop)(C),C=null),u&&(0,c.unmountComponent)(u),p&&(p.innerHTML=""),u=null,f=null,p=null,P=!1)},use(a,...l){if(t.has(a))return r;t.add(a);let m=F({use:r.use.bind(r),unuse:r.unuse.bind(r),isInstalled:r.isInstalled.bind(r),provide:r.provide.bind(r),inject:r.inject.bind(r),config:s,globalProperties:b},a,...l);return m instanceof Promise?m.then(()=>r):r},unuse(a){if(!t.has(a))return r;t.delete(a);let l=S({use:r.use.bind(r),unuse:r.unuse.bind(r),isInstalled:r.isInstalled.bind(r),provide:r.provide.bind(r),inject:r.inject.bind(r),config:s,globalProperties:b},a);return l instanceof Promise?l.then(()=>r):r},isInstalled(a){return t.has(a)},provide(a,l){return d[a]=l,r},inject(a,l){let m=d[a];return m!==void 0?m:l},component(a,l){return l?(i[a]=l,r):i[a]},directive(a,l){return l?(o[a]=l,r):o[a]}};return r}A(v,require("@lytjs/common"),module.exports);
1
+ var O=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var Y=(n,e)=>{for(var t in e)O(n,t,{get:e[t],enumerable:!0})},h=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of q(e))!X.call(n,o)&&o!==t&&O(n,o,{get:()=>e[o],enumerable:!(i=$(e,o))||i.enumerable});return n},A=(n,e,t)=>(h(n,e,"default"),t&&h(t,e,"default"));var K=n=>h(O({},"__esModule",{value:!0}),n);var v={};Y(v,{Fragment:()=>j,ShapeFlags:()=>L,createApp:()=>B,h:()=>I});module.exports=K(v);var y=require("@lytjs/common"),L=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(L||{}),j=Symbol("Fragment");function Z(n,e){if(e!=null)if((0,y.isStringOrNumber)(e))n.children=String(e),n.shapeFlag|=8;else if((0,y.isArray)(e)){let t=[];for(let i=0;i<e.length;i++){let o=e[i];if(!(o==null||typeof o=="boolean"))if((0,y.isArray)(o))for(let d=0;d<o.length;d++){let s=o[d];s!=null&&typeof s!="boolean"&&t.push((0,y.isVNode)(s)?s:E(String(s)))}else(0,y.isVNode)(o)?t.push(o):t.push(E(String(o)))}n.children=t,n.shapeFlag|=16}else typeof e=="object"&&(n.children=e,n.shapeFlag|=32)}function E(n,e=null,t=null){var u,f;let i=0;typeof n=="string"?i=1:n===j?i=0:typeof n=="function"?i=2:typeof n=="object"&&n!==null&&(n.setup||n.__vccOpts||n.render)&&(i=4);let o=(u=e==null?void 0:e.key)!=null?u:null,d=(f=e==null?void 0:e.ref)!=null?f:null,s=e;if(e){let{key:C,ref:p,...P}=e;s=P}let b={type:n,props:s,children:null,key:o,ref:d,shapeFlag:i,el:null,component:null};return t!=null&&Z(b,t),b}function I(n,e,t){return E(n,e||null,t||null)}var N=require("@lytjs/common");function D(n){return Object.create(n||null)}function V(n){return n!==null&&typeof n=="object"&&typeof n.install=="function"}function _(n){return typeof n=="function"}function F(n,e,...t){if(V(e)){let i=e.onBeforeInstall?e.onBeforeInstall(n,...t):void 0;if((0,N.isPromise)(i))return i.then(()=>{let o=e.install(n,...t);if((0,N.isPromise)(o))return o.then(()=>{if(e.onInstalled)return e.onInstalled(n,...t)});if(e.onInstalled)return e.onInstalled(n,...t)});{let o=e.install(n,...t);if((0,N.isPromise)(o))return o.then(()=>{if(e.onInstalled)return e.onInstalled(n,...t)});if(e.onInstalled)return e.onInstalled(n,...t)}}else if(_(e))return e(n,...t)}function S(n,e){if(V(e)){if(typeof e.uninstall=="function")return e.uninstall(n)}else _(e)}var T=require("@lytjs/reactivity"),H=require("@lytjs/compiler"),c=require("@lytjs/component"),M=require("@lytjs/renderer"),G=100,g=new Map;function J(n){let e=g.get(n);if(e)return g.delete(n),g.set(n,e),e;let{code:t}=(0,H.compile)(n);if(e=new Function("h","_ctx",`return ${t}`),g.size>=G){let i=g.keys().next().value;i!==void 0&&g.delete(i)}return g.set(n,e),e}function Q(n){let e={...n};if(n.state&&typeof n.state!="function"){let t=n.state;e.state=()=>({...t})}if(typeof n.render=="function"){let t=n.render;e.render=(i,o)=>t(i)}if(n.computed){let t={};for(let i of Object.keys(n.computed)){let o=n.computed[i];typeof o=="function"?t[i]={get:o}:t[i]=o}e.computed=t}if(typeof n.init=="function"){let t=n.init;e.init=function(i,o){return t.call(this,i)}}return e}function W(){return{createElement(n){return document.createElement(n)},createText(n){return document.createTextNode(n)},createComment(n){return document.createComment(n)},setAttribute(n,e,t){n.setAttribute(e,String(t))},removeAttribute(n,e){n.removeAttribute(e)},setStyle(n,e){if(typeof e=="string")n.style.cssText=e;else if(e&&typeof e=="object")for(let t in e)n.style[t]=e[t]},setClass(n,e){if(typeof e=="string")n.className=e;else if(e&&typeof e=="object"){let t=[];for(let[i,o]of Object.entries(e))o&&t.push(i);n.className=t.join(" ")}else n.className=""},insert(n,e,t){t!=null?n.insertBefore(e,t):n.appendChild(e)},remove(n){n.parentNode&&n.parentNode.removeChild(n)},replace(n,e,t){n.replaceChild(t,e)},addEventListener(n,e,t,i){n.addEventListener(e,t,i)},removeEventListener(n,e,t){n.removeEventListener(e,t)},nextTick(n){Promise.resolve().then(n)},parentNode(n){return n.parentNode},nextSibling(n){return n.nextSibling},querySelector(n){return document.querySelector(n)}}}function B(n,e){let t=new Set,i={},o={},d=D(),s={},b={},u=null,f=null,C=null,p=null,P=!1,w=Q(typeof n=="function"?{render:n}:n),U=(0,c.defineComponent)(w),r={config:s,globalProperties:b,get _instance(){return u},mount(a){if(P)return r;let l;if(typeof a=="string"){if(l=document.querySelector(a),!l)throw new Error(`[Lyt] \u627E\u4E0D\u5230\u6302\u8F7D\u76EE\u6807: "${a}"`)}else l=a;p=l;let m=W();f=(0,M.createRenderer)(m),u=(0,c.createComponentInstance)(U),(0,c.setupComponent)(u,e||{},null);let R=u.type;if(!R.render&&R.template){let k=J(R.template);R.render=(x,z)=>k(x,z.renderProxy)}return(0,c.mountComponent)(u,I),u.subTree&&f.mount(u.subTree,l),C=(0,T.effect)(()=>{if(!(!u||!u.isMounted||!f)&&((0,c.updateComponent)(u,I),u.subTree&&p)){let k=p.firstChild,x=u.subTree;p.innerHTML="",f.mount(x,p)}},{lazy:!0}),P=!0,r},unmount(){P&&(C&&((0,T.stop)(C),C=null),u&&(0,c.unmountComponent)(u),p&&(p.innerHTML=""),u=null,f=null,p=null,P=!1)},use(a,...l){if(t.has(a))return r;t.add(a);let m=F({use:r.use.bind(r),unuse:r.unuse.bind(r),isInstalled:r.isInstalled.bind(r),provide:r.provide.bind(r),inject:r.inject.bind(r),config:s,globalProperties:b},a,...l);return m instanceof Promise?m.then(()=>r):r},unuse(a){if(!t.has(a))return r;t.delete(a);let l=S({use:r.use.bind(r),unuse:r.unuse.bind(r),isInstalled:r.isInstalled.bind(r),provide:r.provide.bind(r),inject:r.inject.bind(r),config:s,globalProperties:b},a);return l instanceof Promise?l.then(()=>r):r},isInstalled(a){return t.has(a)},provide(a,l){return d[a]=l,r},inject(a,l){let m=d[a];return m!==void 0?m:l},component(a,l){return l?(i[a]=l,r):i[a]},directive(a,l){return l?(o[a]=l,r):o[a]}};return r}A(v,require("@lytjs/common"),module.exports);
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{isStringOrNumber as F,isArray as N,isVNode as T}from"@lytjs/common";var x=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(x||{}),h=Symbol("Fragment");function S(n,e){if(e!=null)if(F(e))n.children=String(e),n.shapeFlag|=8;else if(N(e)){let t=[];for(let i=0;i<e.length;i++){let r=e[i];if(!(r==null||typeof r=="boolean"))if(N(r))for(let c=0;c<r.length;c++){let s=r[c];s!=null&&typeof s!="boolean"&&t.push(T(s)?s:C(String(s)))}else T(r)?t.push(r):t.push(C(String(r)))}n.children=t,n.shapeFlag|=16}else typeof e=="object"&&(n.children=e,n.shapeFlag|=32)}function C(n,e=null,t=null){var u,p;let i=0;typeof n=="string"?i=1:n===h?i=0:typeof n=="function"?i=2:typeof n=="object"&&n!==null&&(n.setup||n.__vccOpts||n.render)&&(i=4);let r=(u=e==null?void 0:e.key)!=null?u:null,c=(p=e==null?void 0:e.ref)!=null?p:null,s=e;if(e){let{key:v,ref:d,...g}=e;s=g}let m={type:n,props:s,children:null,key:r,ref:c,shapeFlag:i,el:null,component:null};return t!=null&&S(m,t),m}function P(n,e,t){return C(n,e||null,t||null)}import{isPromise as I}from"@lytjs/common";function O(n){return Object.create(n||null)}function E(n){return n!==null&&typeof n=="object"&&typeof n.install=="function"}function L(n){return typeof n=="function"}function j(n,e,...t){if(E(e)){let i=e.onBeforeInstall?e.onBeforeInstall(n,...t):void 0;if(I(i))return i.then(()=>{let r=e.install(n,...t);if(I(r))return r.then(()=>{if(e.onInstalled)return e.onInstalled(n,...t)});if(e.onInstalled)return e.onInstalled(n,...t)});{let r=e.install(n,...t);if(I(r))return r.then(()=>{if(e.onInstalled)return e.onInstalled(n,...t)});if(e.onInstalled)return e.onInstalled(n,...t)}}else if(L(e))return e(n,...t)}function k(n,e){if(E(e)){if(typeof e.uninstall=="function")return e.uninstall(n)}else L(e)}import{effect as H,stop as M}from"@lytjs/reactivity";import{compile as B}from"@lytjs/compiler";import{defineComponent as w,createComponentInstance as U,setupComponent as z,mountComponent as $,updateComponent as q,unmountComponent as X}from"@lytjs/component";import{createRenderer as Y}from"@lytjs/renderer";var K=100,y=new Map;function Z(n){let e=y.get(n);if(e)return y.delete(n),y.set(n,e),e;let{code:t}=B(n);if(e=new Function("h","_ctx",`return ${t}`),y.size>=K){let i=y.keys().next().value;y.delete(i)}return y.set(n,e),e}function G(n){let e={...n};if(n.state&&typeof n.state!="function"){let t=n.state;e.state=()=>({...t})}if(typeof n.render=="function"){let t=n.render;e.render=(i,r)=>t(i)}if(n.computed){let t={};for(let i of Object.keys(n.computed)){let r=n.computed[i];typeof r=="function"?t[i]={get:r}:t[i]=r}e.computed=t}if(typeof n.init=="function"){let t=n.init;e.init=function(i,r){return t.call(this,i)}}return e}function J(){return{createElement(n){return document.createElement(n)},createText(n){return document.createTextNode(n)},createComment(n){return document.createComment(n)},setAttribute(n,e,t){n.setAttribute(e,String(t))},removeAttribute(n,e){n.removeAttribute(e)},setStyle(n,e){if(typeof e=="string")n.style.cssText=e;else if(e&&typeof e=="object")for(let t in e)n.style[t]=e[t]},setClass(n,e){if(typeof e=="string")n.className=e;else if(e&&typeof e=="object"){let t=[];for(let[i,r]of Object.entries(e))r&&t.push(i);n.className=t.join(" ")}else n.className=""},insert(n,e,t){t!=null?n.insertBefore(e,t):n.appendChild(e)},remove(n){n.parentNode&&n.parentNode.removeChild(n)},replace(n,e,t){n.replaceChild(t,e)},addEventListener(n,e,t,i){n.addEventListener(e,t,i)},removeEventListener(n,e,t){n.removeEventListener(e,t)},nextTick(n){Promise.resolve().then(n)},parentNode(n){return n.parentNode},nextSibling(n){return n.nextSibling},querySelector(n){return document.querySelector(n)}}}function Q(n,e){let t=new Set,i={},r={},c=O(),s={},m={},u=null,p=null,v=null,d=null,g=!1,D=G(typeof n=="function"?{render:n}:n),V=w(D),o={config:s,globalProperties:m,get _instance(){return u},mount(a){if(g)return o;let l;if(typeof a=="string"){if(l=document.querySelector(a),!l)throw new Error(`[Lyt] \u627E\u4E0D\u5230\u6302\u8F7D\u76EE\u6807: "${a}"`)}else l=a;d=l;let f=J();p=Y(f),u=U(V),z(u,e||{},null);let b=u.type;if(!b.render&&b.template){let R=Z(b.template);b.render=(A,_)=>R(A,_.renderProxy)}return $(u,P),u.subTree&&p.mount(u.subTree,l),v=H(()=>{if(!(!u||!u.isMounted||!p)&&(q(u,P),u.subTree&&d)){let R=d.firstChild,A=u.subTree;d.innerHTML="",p.mount(A,d)}},{lazy:!0}),g=!0,o},unmount(){g&&(v&&(M(v),v=null),u&&X(u),d&&(d.innerHTML=""),u=null,p=null,d=null,g=!1)},use(a,...l){if(t.has(a))return o;t.add(a);let f=j({use:o.use.bind(o),unuse:o.unuse.bind(o),isInstalled:o.isInstalled.bind(o),provide:o.provide.bind(o),inject:o.inject.bind(o),config:s,globalProperties:m},a,...l);return f instanceof Promise?f.then(()=>o):o},unuse(a){if(!t.has(a))return o;t.delete(a);let l=k({use:o.use.bind(o),unuse:o.unuse.bind(o),isInstalled:o.isInstalled.bind(o),provide:o.provide.bind(o),inject:o.inject.bind(o),config:s,globalProperties:m},a);return l instanceof Promise?l.then(()=>o):o},isInstalled(a){return t.has(a)},provide(a,l){return c[a]=l,o},inject(a,l){let f=c[a];return f!==void 0?f:l},component(a,l){return l?(i[a]=l,o):i[a]},directive(a,l){return l?(r[a]=l,o):r[a]}};return o}export*from"@lytjs/common";export{h as Fragment,x as ShapeFlags,Q as createApp,P as h};
1
+ import{isStringOrNumber as F,isArray as N,isVNode as T}from"@lytjs/common";var x=(s=>(s[s.ELEMENT=1]="ELEMENT",s[s.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",s[s.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",s[s.TEXT_CHILDREN=8]="TEXT_CHILDREN",s[s.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",s[s.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",s))(x||{}),h=Symbol("Fragment");function S(n,e){if(e!=null)if(F(e))n.children=String(e),n.shapeFlag|=8;else if(N(e)){let t=[];for(let i=0;i<e.length;i++){let r=e[i];if(!(r==null||typeof r=="boolean"))if(N(r))for(let c=0;c<r.length;c++){let s=r[c];s!=null&&typeof s!="boolean"&&t.push(T(s)?s:C(String(s)))}else T(r)?t.push(r):t.push(C(String(r)))}n.children=t,n.shapeFlag|=16}else typeof e=="object"&&(n.children=e,n.shapeFlag|=32)}function C(n,e=null,t=null){var u,p;let i=0;typeof n=="string"?i=1:n===h?i=0:typeof n=="function"?i=2:typeof n=="object"&&n!==null&&(n.setup||n.__vccOpts||n.render)&&(i=4);let r=(u=e==null?void 0:e.key)!=null?u:null,c=(p=e==null?void 0:e.ref)!=null?p:null,s=e;if(e){let{key:v,ref:d,...g}=e;s=g}let m={type:n,props:s,children:null,key:r,ref:c,shapeFlag:i,el:null,component:null};return t!=null&&S(m,t),m}function P(n,e,t){return C(n,e||null,t||null)}import{isPromise as I}from"@lytjs/common";function O(n){return Object.create(n||null)}function E(n){return n!==null&&typeof n=="object"&&typeof n.install=="function"}function L(n){return typeof n=="function"}function j(n,e,...t){if(E(e)){let i=e.onBeforeInstall?e.onBeforeInstall(n,...t):void 0;if(I(i))return i.then(()=>{let r=e.install(n,...t);if(I(r))return r.then(()=>{if(e.onInstalled)return e.onInstalled(n,...t)});if(e.onInstalled)return e.onInstalled(n,...t)});{let r=e.install(n,...t);if(I(r))return r.then(()=>{if(e.onInstalled)return e.onInstalled(n,...t)});if(e.onInstalled)return e.onInstalled(n,...t)}}else if(L(e))return e(n,...t)}function k(n,e){if(E(e)){if(typeof e.uninstall=="function")return e.uninstall(n)}else L(e)}import{effect as H,stop as M}from"@lytjs/reactivity";import{compile as B}from"@lytjs/compiler";import{defineComponent as w,createComponentInstance as U,setupComponent as z,mountComponent as $,updateComponent as q,unmountComponent as X}from"@lytjs/component";import{createRenderer as Y}from"@lytjs/renderer";var K=100,y=new Map;function Z(n){let e=y.get(n);if(e)return y.delete(n),y.set(n,e),e;let{code:t}=B(n);if(e=new Function("h","_ctx",`return ${t}`),y.size>=K){let i=y.keys().next().value;i!==void 0&&y.delete(i)}return y.set(n,e),e}function G(n){let e={...n};if(n.state&&typeof n.state!="function"){let t=n.state;e.state=()=>({...t})}if(typeof n.render=="function"){let t=n.render;e.render=(i,r)=>t(i)}if(n.computed){let t={};for(let i of Object.keys(n.computed)){let r=n.computed[i];typeof r=="function"?t[i]={get:r}:t[i]=r}e.computed=t}if(typeof n.init=="function"){let t=n.init;e.init=function(i,r){return t.call(this,i)}}return e}function J(){return{createElement(n){return document.createElement(n)},createText(n){return document.createTextNode(n)},createComment(n){return document.createComment(n)},setAttribute(n,e,t){n.setAttribute(e,String(t))},removeAttribute(n,e){n.removeAttribute(e)},setStyle(n,e){if(typeof e=="string")n.style.cssText=e;else if(e&&typeof e=="object")for(let t in e)n.style[t]=e[t]},setClass(n,e){if(typeof e=="string")n.className=e;else if(e&&typeof e=="object"){let t=[];for(let[i,r]of Object.entries(e))r&&t.push(i);n.className=t.join(" ")}else n.className=""},insert(n,e,t){t!=null?n.insertBefore(e,t):n.appendChild(e)},remove(n){n.parentNode&&n.parentNode.removeChild(n)},replace(n,e,t){n.replaceChild(t,e)},addEventListener(n,e,t,i){n.addEventListener(e,t,i)},removeEventListener(n,e,t){n.removeEventListener(e,t)},nextTick(n){Promise.resolve().then(n)},parentNode(n){return n.parentNode},nextSibling(n){return n.nextSibling},querySelector(n){return document.querySelector(n)}}}function Q(n,e){let t=new Set,i={},r={},c=O(),s={},m={},u=null,p=null,v=null,d=null,g=!1,D=G(typeof n=="function"?{render:n}:n),V=w(D),o={config:s,globalProperties:m,get _instance(){return u},mount(a){if(g)return o;let l;if(typeof a=="string"){if(l=document.querySelector(a),!l)throw new Error(`[Lyt] \u627E\u4E0D\u5230\u6302\u8F7D\u76EE\u6807: "${a}"`)}else l=a;d=l;let f=J();p=Y(f),u=U(V),z(u,e||{},null);let b=u.type;if(!b.render&&b.template){let R=Z(b.template);b.render=(A,_)=>R(A,_.renderProxy)}return $(u,P),u.subTree&&p.mount(u.subTree,l),v=H(()=>{if(!(!u||!u.isMounted||!p)&&(q(u,P),u.subTree&&d)){let R=d.firstChild,A=u.subTree;d.innerHTML="",p.mount(A,d)}},{lazy:!0}),g=!0,o},unmount(){g&&(v&&(M(v),v=null),u&&X(u),d&&(d.innerHTML=""),u=null,p=null,d=null,g=!1)},use(a,...l){if(t.has(a))return o;t.add(a);let f=j({use:o.use.bind(o),unuse:o.unuse.bind(o),isInstalled:o.isInstalled.bind(o),provide:o.provide.bind(o),inject:o.inject.bind(o),config:s,globalProperties:m},a,...l);return f instanceof Promise?f.then(()=>o):o},unuse(a){if(!t.has(a))return o;t.delete(a);let l=k({use:o.use.bind(o),unuse:o.unuse.bind(o),isInstalled:o.isInstalled.bind(o),provide:o.provide.bind(o),inject:o.inject.bind(o),config:s,globalProperties:m},a);return l instanceof Promise?l.then(()=>o):o},isInstalled(a){return t.has(a)},provide(a,l){return c[a]=l,o},inject(a,l){let f=c[a];return f!==void 0?f:l},component(a,l){return l?(i[a]=l,o):i[a]},directive(a,l){return l?(r[a]=l,o):r[a]}};return o}export*from"@lytjs/common";export{h as Fragment,x as ShapeFlags,Q as createApp,P as h};
@@ -1 +1 @@
1
- {"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../src/create-app.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../../src/create-app.ts"],"names":[],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- var S=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var F=(e,t)=>{for(var n in t)S(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of G(t))!Q.call(e,c)&&c!==n&&S(e,c,{get:()=>t[c],enumerable:!(a=J(t,c))||a.enumerable});return e},R=(e,t,n)=>(k(e,t,"default"),n&&k(n,t,"default"));var ee=e=>k(S({},"__esModule",{value:!0}),e);var de={};F(de,{defineCustomElement:()=>j,defineCustomElementFromSFC:()=>Y,isBrowser:()=>I,registerComponents:()=>K,unregisterElement:()=>X});module.exports=ee(de);var E={};F(E,{Fragment:()=>M,ShapeFlags:()=>V,createApp:()=>z,h:()=>_});var A=require("@lytjs/common"),V=(f=>(f[f.ELEMENT=1]="ELEMENT",f[f.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",f[f.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",f[f.TEXT_CHILDREN=8]="TEXT_CHILDREN",f[f.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",f[f.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",f))(V||{}),M=Symbol("Fragment");function te(e,t){if(t!=null)if((0,A.isStringOrNumber)(t))e.children=String(t),e.shapeFlag|=8;else if((0,A.isArray)(t)){let n=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c==null||typeof c=="boolean"))if((0,A.isArray)(c))for(let m=0;m<c.length;m++){let f=c[m];f!=null&&typeof f!="boolean"&&n.push((0,A.isVNode)(f)?f:w(String(f)))}else(0,A.isVNode)(c)?n.push(c):n.push(w(String(c)))}e.children=n,e.shapeFlag|=16}else typeof t=="object"&&(e.children=t,e.shapeFlag|=32)}function w(e,t=null,n=null){var y,h;let a=0;typeof e=="string"?a=1:e===M?a=0:typeof e=="function"?a=2:typeof e=="object"&&e!==null&&(e.setup||e.__vccOpts||e.render)&&(a=4);let c=(y=t==null?void 0:t.key)!=null?y:null,m=(h=t==null?void 0:t.ref)!=null?h:null,f=t;if(t){let{key:b,ref:o,...i}=t;f=i}let g={type:e,props:f,children:null,key:c,ref:m,shapeFlag:a,el:null,component:null};return n!=null&&te(g,n),g}function _(e,t,n){return w(e,t||null,n||null)}var T=require("@lytjs/common");function D(e){return Object.create(e||null)}function H(e){return e!==null&&typeof e=="object"&&typeof e.install=="function"}function B(e){return typeof e=="function"}function U(e,t,...n){if(H(t)){let a=t.onBeforeInstall?t.onBeforeInstall(e,...n):void 0;if((0,T.isPromise)(a))return a.then(()=>{let c=t.install(e,...n);if((0,T.isPromise)(c))return c.then(()=>{if(t.onInstalled)return t.onInstalled(e,...n)});if(t.onInstalled)return t.onInstalled(e,...n)});{let c=t.install(e,...n);if((0,T.isPromise)(c))return c.then(()=>{if(t.onInstalled)return t.onInstalled(e,...n)});if(t.onInstalled)return t.onInstalled(e,...n)}}else if(B(t))return t(e,...n)}function $(e,t){if(H(t)){if(typeof t.uninstall=="function")return t.uninstall(e)}else B(t)}var x=require("@lytjs/reactivity"),W=require("@lytjs/compiler"),v=require("@lytjs/component"),q=require("@lytjs/renderer"),ne=100,P=new Map;function oe(e){let t=P.get(e);if(t)return P.delete(e),P.set(e,t),t;let{code:n}=(0,W.compile)(e);if(t=new Function("h","_ctx",`return ${n}`),P.size>=ne){let a=P.keys().next().value;P.delete(a)}return P.set(e,t),t}function re(e){let t={...e};if(e.state&&typeof e.state!="function"){let n=e.state;t.state=()=>({...n})}if(typeof e.render=="function"){let n=e.render;t.render=(a,c)=>n(a)}if(e.computed){let n={};for(let a of Object.keys(e.computed)){let c=e.computed[a];typeof c=="function"?n[a]={get:c}:n[a]=c}t.computed=n}if(typeof e.init=="function"){let n=e.init;t.init=function(a,c){return n.call(this,a)}}return t}function ie(){return{createElement(e){return document.createElement(e)},createText(e){return document.createTextNode(e)},createComment(e){return document.createComment(e)},setAttribute(e,t,n){e.setAttribute(t,String(n))},removeAttribute(e,t){e.removeAttribute(t)},setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let n in t)e.style[n]=t[n]},setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let n=[];for(let[a,c]of Object.entries(t))c&&n.push(a);e.className=n.join(" ")}else e.className=""},insert(e,t,n){n!=null?e.insertBefore(t,n):e.appendChild(t)},remove(e){e.parentNode&&e.parentNode.removeChild(e)},replace(e,t,n){e.replaceChild(n,t)},addEventListener(e,t,n,a){e.addEventListener(t,n,a)},removeEventListener(e,t,n){e.removeEventListener(t,n)},nextTick(e){Promise.resolve().then(e)},parentNode(e){return e.parentNode},nextSibling(e){return e.nextSibling},querySelector(e){return document.querySelector(e)}}}function z(e,t){let n=new Set,a={},c={},m=D(),f={},g={},y=null,h=null,b=null,o=null,i=!1,r=re(typeof e=="function"?{render:e}:e),u=(0,v.defineComponent)(r),s={config:f,globalProperties:g,get _instance(){return y},mount(d){if(i)return s;let p;if(typeof d=="string"){if(p=document.querySelector(d),!p)throw new Error(`[Lyt] \u627E\u4E0D\u5230\u6302\u8F7D\u76EE\u6807: "${d}"`)}else p=d;o=p;let C=ie();h=(0,q.createRenderer)(C),y=(0,v.createComponentInstance)(u),(0,v.setupComponent)(y,t||{},null);let N=y.type;if(!N.render&&N.template){let L=oe(N.template);N.render=(O,Z)=>L(O,Z.renderProxy)}return(0,v.mountComponent)(y,_),y.subTree&&h.mount(y.subTree,p),b=(0,x.effect)(()=>{if(!(!y||!y.isMounted||!h)&&((0,v.updateComponent)(y,_),y.subTree&&o)){let L=o.firstChild,O=y.subTree;o.innerHTML="",h.mount(O,o)}},{lazy:!0}),i=!0,s},unmount(){i&&(b&&((0,x.stop)(b),b=null),y&&(0,v.unmountComponent)(y),o&&(o.innerHTML=""),y=null,h=null,o=null,i=!1)},use(d,...p){if(n.has(d))return s;n.add(d);let C=U({use:s.use.bind(s),unuse:s.unuse.bind(s),isInstalled:s.isInstalled.bind(s),provide:s.provide.bind(s),inject:s.inject.bind(s),config:f,globalProperties:g},d,...p);return C instanceof Promise?C.then(()=>s):s},unuse(d){if(!n.has(d))return s;n.delete(d);let p=$({use:s.use.bind(s),unuse:s.unuse.bind(s),isInstalled:s.isInstalled.bind(s),provide:s.provide.bind(s),inject:s.inject.bind(s),config:f,globalProperties:g},d);return p instanceof Promise?p.then(()=>s):s},isInstalled(d){return n.has(d)},provide(d,p){return m[d]=p,s},inject(d,p){let C=m[d];return C!==void 0?C:p},component(d,p){return p?(a[d]=p,s):a[d]},directive(d,p){return p?(c[d]=p,s):c[d]}};return s}R(E,require("@lytjs/common"));function I(){return typeof globalThis.window!="undefined"&&typeof globalThis.document!="undefined"&&typeof globalThis.HTMLElement!="undefined"&&typeof globalThis.customElements!="undefined"}function se(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function ae(e){if(e===""||e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e==="undefined")return;let t=Number(e);if(!isNaN(t)&&e.trim()!=="")return t;if(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]"))try{return JSON.parse(e)}catch(n){}return e}function le(e,t){return t&&t[e]?t[e]:se(e)}function ce(e){let t=[],n=e;if(n.emits&&(Array.isArray(n.emits)?t.push(...n.emits):typeof n.emits=="object"&&t.push(...Object.keys(n.emits))),n.methods){for(let a of Object.keys(n.methods))if(a.startsWith("on")&&a.length>2){let c=a.charAt(2).toLowerCase()+a.slice(3);t.push(c)}}return t}function ue(e,t={}){let{shadowMode:n="open",styles:a="",propMappings:c,eventMappings:m={},attributeConverters:f={}}=t,g=t.observedAttributes||[],y=ce(e);return class extends HTMLElement{constructor(){super();this._shadowRoot=null;this._instance=null;this._props={};this._container=null;this._connected=!1;this._eventCleanups=[];this._effectCleanup=null;this._updateScheduled=!1}static get observedAttributes(){return g}connectedCallback(){if(!this._connected){if(this._connected=!0,this._shadowRoot=this.attachShadow({mode:n}),a){let o=document.createElement("style");o.textContent=a,this._shadowRoot.appendChild(o)}this._container=document.createElement("div"),this._shadowRoot.appendChild(this._container),this._syncAttributesToProps(),this._mountComponent(),this._forwardSlots()}}disconnectedCallback(){if(this._connected){this._connected=!1;for(let o of this._eventCleanups)o();this._eventCleanups=[],this._effectCleanup&&(this._effectCleanup(),this._effectCleanup=null),this._instance=null,this._container&&(this._container.innerHTML="")}}attributeChangedCallback(o,i,l){i!==l&&this._connected&&(this._syncAttributesToProps(),this._updateComponent())}_syncAttributesToProps(){let o={};for(let i of g)if(this.hasAttribute(i)){let l=this.getAttribute(i),r=le(i,c);f[i]?o[r]=f[i](l):o[r]=ae(l)}if(e.props){for(let[i,l]of Object.entries(e.props))if(o[i]===void 0){let r=l;r&&typeof r=="object"&&"default"in r?o[i]=typeof r.default=="function"?r.default():r.default:r==null}}this._props=o}_mountComponent(){let o=e.render?e.render:e.template?this._compileTemplate(e.template):null;if(!o)return;let i=this._createComponentContext(),l=o.call(i,_,i);l&&this._container&&this._renderVNode(l,this._container),this._setupReactiveUpdates(i,o)}_compileTemplate(o){try{let i=Function("return require")(),{compile:l}=i("../../compiler/src/index.ts"),{code:r}=l(o);return new Function("h","_ctx",`return ${r}`)}catch(i){return null}}_createComponentContext(){let o=e.state?typeof e.state=="function"?e.state():{...e.state}:{},i=e.computed||{},l=e.methods||{},r={...this._props,...o};for(let[u,s]of Object.entries(i))typeof s=="function"?Object.defineProperty(r,u,{get:s.bind(r),enumerable:!0}):s&&typeof s=="object"&&"get"in s&&Object.defineProperty(r,u,{get:s.get.bind(r),enumerable:!0});for(let[u,s]of Object.entries(l))typeof s=="function"&&(r[u]=s.bind(r));return r.emit=(u,...s)=>{let d=m[u]||u,p=new CustomEvent(d,{detail:s.length===1?s[0]:s,bubbles:!0,composed:!0});this.dispatchEvent(p)},r.$el=this._container,r.$attrs={...this._props},r.$slots=this._getSlotContent(),r}_setupReactiveUpdates(o,i){try{let l=Function("return require")(),{effect:r,stop:u}=l("../../reactivity/src/index.ts"),s=r(()=>{if(!this._connected||!this._container)return;let p=i.call(o,_,o);p&&(this._container.innerHTML="",this._renderVNode(p,this._container))},{lazy:!0}),d=e.state?typeof e.state=="function"?Object.keys(e.state()):Object.keys(e.state):[];for(let p of d){let C=o[p];Object.defineProperty(o,p,{get(){return C},set(N){C=N;try{s()}catch(L){}},enumerable:!0})}this._effectCleanup=()=>{try{u(s)}catch(p){}}}catch(l){let r=e.state?typeof e.state=="function"?Object.keys(e.state()):Object.keys(e.state):[];for(let u of r){let d=o[u],p=this;Object.defineProperty(o,u,{get(){return d},set(C){d=C,p._scheduleUpdate(o,i)},enumerable:!0})}}}_scheduleUpdate(o,i){this._updateScheduled||(this._updateScheduled=!0,Promise.resolve().then(()=>{if(this._updateScheduled=!1,!this._connected||!this._container)return;let l=i.call(o,_,o);l&&(this._container.innerHTML="",this._renderVNode(l,this._container))}))}_updateComponent(){if(!this._container)return;let o=e.render?e.render:e.template?this._compileTemplate(e.template):null;if(!o)return;let i=this._createComponentContext(),l=o.call(i,_,i);this._container.innerHTML="",l&&this._renderVNode(l,this._container)}_renderVNode(o,i){let l=this._vNodeToElement(o);l&&i.appendChild(l)}_vNodeToElement(o){if(!o)return null;if(typeof o.type=="symbol"){let i=document.createDocumentFragment();if(Array.isArray(o.children))for(let l of o.children){let r=this._vNodeToElement(l);r&&i.appendChild(r)}return i}if(typeof o.children=="string")return document.createTextNode(o.children);if(typeof o.type=="string"){let i=document.createElement(o.type);if(o.props)for(let[l,r]of Object.entries(o.props))if(l==="style"&&typeof r=="object")for(let[u,s]of Object.entries(r))i.style[u]=s;else if(l==="class"){if(typeof r=="string")i.className=r;else if(typeof r=="object"){let u=[];for(let[s,d]of Object.entries(r))d&&u.push(s);i.className=u.join(" ")}}else if(l.startsWith("on")&&typeof r=="function"){let u=l.slice(2).toLowerCase();i.addEventListener(u,r),this._eventCleanups.push(()=>{i.removeEventListener(u,r)})}else l==="ref"&&typeof r=="function"?r(i):i.setAttribute(l,String(r));if(Array.isArray(o.children))for(let l of o.children){let r=this._vNodeToElement(l);r&&i.appendChild(r)}else typeof o.children=="string"&&(i.textContent=o.children);return i}return typeof o.type=="object"||typeof o.type=="function"?o.component?this._vNodeToElement(o.component.subTree||o):document.createComment("component"):null}_forwardSlots(){if(!this._shadowRoot||!this._container)return;let o=this.querySelectorAll("[slot]");for(let l of o){let r=l.getAttribute("slot")||"default",u=document.createElement("slot");r!=="default"&&u.setAttribute("name",r),this._container.appendChild(u)}let i=document.createElement("slot");this._container.appendChild(i)}_getSlotContent(){var r;let o={},i=this.querySelectorAll("[slot]");for(let u of i){let s=u.getAttribute("slot")||"default";o[s]||(o[s]=[]),o[s].push(u.cloneNode(!0))}let l=[];for(let u of Array.from(this.childNodes))(r=u.hasAttribute)!=null&&r.call(u,"slot")||l.push(u.cloneNode(!0));return l.length>0&&(o.default=l),o}get _lytInstance(){return this._instance}get _lytProps(){return{...this._props}}}}function j(e,t,n){if(!e.includes("-"))throw new Error(`[Lyt Web Component] \u6807\u7B7E\u540D "${e}" \u5FC5\u987B\u5305\u542B\u8FDE\u5B57\u7B26 (-)\u3002\u8FD9\u662F Custom Element \u89C4\u8303\u7684\u8981\u6C42\u3002`);if(!I())return;let a=ue(t,n);customElements.define(e,a)}function K(e){for(let{tagName:t,component:n,options:a}of e)j(t,n,a)}function X(e){if(I())try{let t=customElements;t.__unregister&&t.__unregister(e)}catch(t){}}async function Y(e,t,n){let a=t.match(/<template>([\s\S]*?)<\/template>/),c=t.match(/<script[^>]*>([\s\S]*?)<\/script>/),m=/<style[^>]*>([\s\S]*?)<\/style>/g,f=[],g;for(;(g=m.exec(t))!==null;)f.push(g);let y=(n==null?void 0:n.styles)||"";for(let i of f)y+=i[1]+`
1
+ var S=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var F=(e,t)=>{for(var n in t)S(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of G(t))!Q.call(e,c)&&c!==n&&S(e,c,{get:()=>t[c],enumerable:!(a=J(t,c))||a.enumerable});return e},R=(e,t,n)=>(k(e,t,"default"),n&&k(n,t,"default"));var ee=e=>k(S({},"__esModule",{value:!0}),e);var de={};F(de,{defineCustomElement:()=>j,defineCustomElementFromSFC:()=>Y,isBrowser:()=>I,registerComponents:()=>K,unregisterElement:()=>X});module.exports=ee(de);var E={};F(E,{Fragment:()=>M,ShapeFlags:()=>V,createApp:()=>z,h:()=>_});var A=require("@lytjs/common"),V=(f=>(f[f.ELEMENT=1]="ELEMENT",f[f.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",f[f.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",f[f.TEXT_CHILDREN=8]="TEXT_CHILDREN",f[f.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",f[f.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",f))(V||{}),M=Symbol("Fragment");function te(e,t){if(t!=null)if((0,A.isStringOrNumber)(t))e.children=String(t),e.shapeFlag|=8;else if((0,A.isArray)(t)){let n=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c==null||typeof c=="boolean"))if((0,A.isArray)(c))for(let m=0;m<c.length;m++){let f=c[m];f!=null&&typeof f!="boolean"&&n.push((0,A.isVNode)(f)?f:w(String(f)))}else(0,A.isVNode)(c)?n.push(c):n.push(w(String(c)))}e.children=n,e.shapeFlag|=16}else typeof t=="object"&&(e.children=t,e.shapeFlag|=32)}function w(e,t=null,n=null){var y,h;let a=0;typeof e=="string"?a=1:e===M?a=0:typeof e=="function"?a=2:typeof e=="object"&&e!==null&&(e.setup||e.__vccOpts||e.render)&&(a=4);let c=(y=t==null?void 0:t.key)!=null?y:null,m=(h=t==null?void 0:t.ref)!=null?h:null,f=t;if(t){let{key:b,ref:o,...i}=t;f=i}let g={type:e,props:f,children:null,key:c,ref:m,shapeFlag:a,el:null,component:null};return n!=null&&te(g,n),g}function _(e,t,n){return w(e,t||null,n||null)}var T=require("@lytjs/common");function D(e){return Object.create(e||null)}function H(e){return e!==null&&typeof e=="object"&&typeof e.install=="function"}function B(e){return typeof e=="function"}function U(e,t,...n){if(H(t)){let a=t.onBeforeInstall?t.onBeforeInstall(e,...n):void 0;if((0,T.isPromise)(a))return a.then(()=>{let c=t.install(e,...n);if((0,T.isPromise)(c))return c.then(()=>{if(t.onInstalled)return t.onInstalled(e,...n)});if(t.onInstalled)return t.onInstalled(e,...n)});{let c=t.install(e,...n);if((0,T.isPromise)(c))return c.then(()=>{if(t.onInstalled)return t.onInstalled(e,...n)});if(t.onInstalled)return t.onInstalled(e,...n)}}else if(B(t))return t(e,...n)}function $(e,t){if(H(t)){if(typeof t.uninstall=="function")return t.uninstall(e)}else B(t)}var x=require("@lytjs/reactivity"),W=require("@lytjs/compiler"),v=require("@lytjs/component"),q=require("@lytjs/renderer"),ne=100,P=new Map;function oe(e){let t=P.get(e);if(t)return P.delete(e),P.set(e,t),t;let{code:n}=(0,W.compile)(e);if(t=new Function("h","_ctx",`return ${n}`),P.size>=ne){let a=P.keys().next().value;a!==void 0&&P.delete(a)}return P.set(e,t),t}function re(e){let t={...e};if(e.state&&typeof e.state!="function"){let n=e.state;t.state=()=>({...n})}if(typeof e.render=="function"){let n=e.render;t.render=(a,c)=>n(a)}if(e.computed){let n={};for(let a of Object.keys(e.computed)){let c=e.computed[a];typeof c=="function"?n[a]={get:c}:n[a]=c}t.computed=n}if(typeof e.init=="function"){let n=e.init;t.init=function(a,c){return n.call(this,a)}}return t}function ie(){return{createElement(e){return document.createElement(e)},createText(e){return document.createTextNode(e)},createComment(e){return document.createComment(e)},setAttribute(e,t,n){e.setAttribute(t,String(n))},removeAttribute(e,t){e.removeAttribute(t)},setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let n in t)e.style[n]=t[n]},setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let n=[];for(let[a,c]of Object.entries(t))c&&n.push(a);e.className=n.join(" ")}else e.className=""},insert(e,t,n){n!=null?e.insertBefore(t,n):e.appendChild(t)},remove(e){e.parentNode&&e.parentNode.removeChild(e)},replace(e,t,n){e.replaceChild(n,t)},addEventListener(e,t,n,a){e.addEventListener(t,n,a)},removeEventListener(e,t,n){e.removeEventListener(t,n)},nextTick(e){Promise.resolve().then(e)},parentNode(e){return e.parentNode},nextSibling(e){return e.nextSibling},querySelector(e){return document.querySelector(e)}}}function z(e,t){let n=new Set,a={},c={},m=D(),f={},g={},y=null,h=null,b=null,o=null,i=!1,r=re(typeof e=="function"?{render:e}:e),u=(0,v.defineComponent)(r),s={config:f,globalProperties:g,get _instance(){return y},mount(d){if(i)return s;let p;if(typeof d=="string"){if(p=document.querySelector(d),!p)throw new Error(`[Lyt] \u627E\u4E0D\u5230\u6302\u8F7D\u76EE\u6807: "${d}"`)}else p=d;o=p;let C=ie();h=(0,q.createRenderer)(C),y=(0,v.createComponentInstance)(u),(0,v.setupComponent)(y,t||{},null);let N=y.type;if(!N.render&&N.template){let L=oe(N.template);N.render=(O,Z)=>L(O,Z.renderProxy)}return(0,v.mountComponent)(y,_),y.subTree&&h.mount(y.subTree,p),b=(0,x.effect)(()=>{if(!(!y||!y.isMounted||!h)&&((0,v.updateComponent)(y,_),y.subTree&&o)){let L=o.firstChild,O=y.subTree;o.innerHTML="",h.mount(O,o)}},{lazy:!0}),i=!0,s},unmount(){i&&(b&&((0,x.stop)(b),b=null),y&&(0,v.unmountComponent)(y),o&&(o.innerHTML=""),y=null,h=null,o=null,i=!1)},use(d,...p){if(n.has(d))return s;n.add(d);let C=U({use:s.use.bind(s),unuse:s.unuse.bind(s),isInstalled:s.isInstalled.bind(s),provide:s.provide.bind(s),inject:s.inject.bind(s),config:f,globalProperties:g},d,...p);return C instanceof Promise?C.then(()=>s):s},unuse(d){if(!n.has(d))return s;n.delete(d);let p=$({use:s.use.bind(s),unuse:s.unuse.bind(s),isInstalled:s.isInstalled.bind(s),provide:s.provide.bind(s),inject:s.inject.bind(s),config:f,globalProperties:g},d);return p instanceof Promise?p.then(()=>s):s},isInstalled(d){return n.has(d)},provide(d,p){return m[d]=p,s},inject(d,p){let C=m[d];return C!==void 0?C:p},component(d,p){return p?(a[d]=p,s):a[d]},directive(d,p){return p?(c[d]=p,s):c[d]}};return s}R(E,require("@lytjs/common"));function I(){return typeof globalThis.window!="undefined"&&typeof globalThis.document!="undefined"&&typeof globalThis.HTMLElement!="undefined"&&typeof globalThis.customElements!="undefined"}function se(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function ae(e){if(e===""||e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e==="undefined")return;let t=Number(e);if(!isNaN(t)&&e.trim()!=="")return t;if(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]"))try{return JSON.parse(e)}catch(n){}return e}function le(e,t){return t&&t[e]?t[e]:se(e)}function ce(e){let t=[],n=e;if(n.emits&&(Array.isArray(n.emits)?t.push(...n.emits):typeof n.emits=="object"&&t.push(...Object.keys(n.emits))),n.methods){for(let a of Object.keys(n.methods))if(a.startsWith("on")&&a.length>2){let c=a.charAt(2).toLowerCase()+a.slice(3);t.push(c)}}return t}function ue(e,t={}){let{shadowMode:n="open",styles:a="",propMappings:c,eventMappings:m={},attributeConverters:f={}}=t,g=t.observedAttributes||[],y=ce(e);return class extends HTMLElement{constructor(){super();this._shadowRoot=null;this._instance=null;this._props={};this._container=null;this._connected=!1;this._eventCleanups=[];this._effectCleanup=null;this._updateScheduled=!1}static get observedAttributes(){return g}connectedCallback(){if(!this._connected){if(this._connected=!0,this._shadowRoot=this.attachShadow({mode:n}),a){let o=document.createElement("style");o.textContent=a,this._shadowRoot.appendChild(o)}this._container=document.createElement("div"),this._shadowRoot.appendChild(this._container),this._syncAttributesToProps(),this._mountComponent(),this._forwardSlots()}}disconnectedCallback(){if(this._connected){this._connected=!1;for(let o of this._eventCleanups)o();this._eventCleanups=[],this._effectCleanup&&(this._effectCleanup(),this._effectCleanup=null),this._instance=null,this._container&&(this._container.innerHTML="")}}attributeChangedCallback(o,i,l){i!==l&&this._connected&&(this._syncAttributesToProps(),this._updateComponent())}_syncAttributesToProps(){let o={};for(let i of g)if(this.hasAttribute(i)){let l=this.getAttribute(i),r=le(i,c);f[i]?o[r]=f[i](l):o[r]=ae(l)}if(e.props){for(let[i,l]of Object.entries(e.props))if(o[i]===void 0){let r=l;r&&typeof r=="object"&&"default"in r?o[i]=typeof r.default=="function"?r.default():r.default:r==null}}this._props=o}_mountComponent(){let o=e.render?e.render:e.template?this._compileTemplate(e.template):null;if(!o)return;let i=this._createComponentContext(),l=o.call(i,_,i);l&&this._container&&this._renderVNode(l,this._container),this._setupReactiveUpdates(i,o)}_compileTemplate(o){try{let i=Function("return require")(),{compile:l}=i("../../compiler/src/index.ts"),{code:r}=l(o);return new Function("h","_ctx",`return ${r}`)}catch(i){return null}}_createComponentContext(){let o=e.state?typeof e.state=="function"?e.state():{...e.state}:{},i=e.computed||{},l=e.methods||{},r={...this._props,...o};for(let[u,s]of Object.entries(i))typeof s=="function"?Object.defineProperty(r,u,{get:s.bind(r),enumerable:!0}):s&&typeof s=="object"&&"get"in s&&Object.defineProperty(r,u,{get:s.get.bind(r),enumerable:!0});for(let[u,s]of Object.entries(l))typeof s=="function"&&(r[u]=s.bind(r));return r.emit=(u,...s)=>{let d=m[u]||u,p=new CustomEvent(d,{detail:s.length===1?s[0]:s,bubbles:!0,composed:!0});this.dispatchEvent(p)},r.$el=this._container,r.$attrs={...this._props},r.$slots=this._getSlotContent(),r}_setupReactiveUpdates(o,i){try{let l=Function("return require")(),{effect:r,stop:u}=l("../../reactivity/src/index.ts"),s=r(()=>{if(!this._connected||!this._container)return;let p=i.call(o,_,o);p&&(this._container.innerHTML="",this._renderVNode(p,this._container))},{lazy:!0}),d=e.state?typeof e.state=="function"?Object.keys(e.state()):Object.keys(e.state):[];for(let p of d){let C=o[p];Object.defineProperty(o,p,{get(){return C},set(N){C=N;try{s()}catch(L){}},enumerable:!0})}this._effectCleanup=()=>{try{u(s)}catch(p){}}}catch(l){let r=e.state?typeof e.state=="function"?Object.keys(e.state()):Object.keys(e.state):[];for(let u of r){let d=o[u],p=this;Object.defineProperty(o,u,{get(){return d},set(C){d=C,p._scheduleUpdate(o,i)},enumerable:!0})}}}_scheduleUpdate(o,i){this._updateScheduled||(this._updateScheduled=!0,Promise.resolve().then(()=>{if(this._updateScheduled=!1,!this._connected||!this._container)return;let l=i.call(o,_,o);l&&(this._container.innerHTML="",this._renderVNode(l,this._container))}))}_updateComponent(){if(!this._container)return;let o=e.render?e.render:e.template?this._compileTemplate(e.template):null;if(!o)return;let i=this._createComponentContext(),l=o.call(i,_,i);this._container.innerHTML="",l&&this._renderVNode(l,this._container)}_renderVNode(o,i){let l=this._vNodeToElement(o);l&&i.appendChild(l)}_vNodeToElement(o){if(!o)return null;if(typeof o.type=="symbol"){let i=document.createDocumentFragment();if(Array.isArray(o.children))for(let l of o.children){let r=this._vNodeToElement(l);r&&i.appendChild(r)}return i}if(typeof o.children=="string")return document.createTextNode(o.children);if(typeof o.type=="string"){let i=document.createElement(o.type);if(o.props)for(let[l,r]of Object.entries(o.props))if(l==="style"&&typeof r=="object")for(let[u,s]of Object.entries(r))i.style[u]=s;else if(l==="class"){if(typeof r=="string")i.className=r;else if(typeof r=="object"){let u=[];for(let[s,d]of Object.entries(r))d&&u.push(s);i.className=u.join(" ")}}else if(l.startsWith("on")&&typeof r=="function"){let u=l.slice(2).toLowerCase();i.addEventListener(u,r),this._eventCleanups.push(()=>{i.removeEventListener(u,r)})}else l==="ref"&&typeof r=="function"?r(i):i.setAttribute(l,String(r));if(Array.isArray(o.children))for(let l of o.children){let r=this._vNodeToElement(l);r&&i.appendChild(r)}else typeof o.children=="string"&&(i.textContent=o.children);return i}return typeof o.type=="object"||typeof o.type=="function"?o.component?this._vNodeToElement(o.component.subTree||o):document.createComment("component"):null}_forwardSlots(){if(!this._shadowRoot||!this._container)return;let o=this.querySelectorAll("[slot]");for(let l of o){let r=l.getAttribute("slot")||"default",u=document.createElement("slot");r!=="default"&&u.setAttribute("name",r),this._container.appendChild(u)}let i=document.createElement("slot");this._container.appendChild(i)}_getSlotContent(){var r;let o={},i=this.querySelectorAll("[slot]");for(let u of i){let s=u.getAttribute("slot")||"default";o[s]||(o[s]=[]),o[s].push(u.cloneNode(!0))}let l=[];for(let u of Array.from(this.childNodes))(r=u.hasAttribute)!=null&&r.call(u,"slot")||l.push(u.cloneNode(!0));return l.length>0&&(o.default=l),o}get _lytInstance(){return this._instance}get _lytProps(){return{...this._props}}}}function j(e,t,n){if(!e.includes("-"))throw new Error(`[Lyt Web Component] \u6807\u7B7E\u540D "${e}" \u5FC5\u987B\u5305\u542B\u8FDE\u5B57\u7B26 (-)\u3002\u8FD9\u662F Custom Element \u89C4\u8303\u7684\u8981\u6C42\u3002`);if(!I())return;let a=ue(t,n);customElements.define(e,a)}function K(e){for(let{tagName:t,component:n,options:a}of e)j(t,n,a)}function X(e){if(I())try{let t=customElements;t.__unregister&&t.__unregister(e)}catch(t){}}async function Y(e,t,n){let a=t.match(/<template>([\s\S]*?)<\/template>/),c=t.match(/<script[^>]*>([\s\S]*?)<\/script>/),m=/<style[^>]*>([\s\S]*?)<\/style>/g,f=[],g;for(;(g=m.exec(t))!==null;)f.push(g);let y=(n==null?void 0:n.styles)||"";for(let i of f)y+=i[1]+`
2
2
  `;let h=a?a[1].trim():void 0,b={};if(c){let i=c[1].trim();if(i.match(/export\s+default\s*(\{[\s\S]*\}|\([\s\S]*\)[\s\S]*?\))/))try{let r={},u={exports:r};new Function("module","exports",`"use strict"; ${i.replace(/export\s+default\s*/,"module.exports =")}`)(u,r),b=u.exports||r}catch(r){}}let o={...n,styles:y};h&&!b.template&&!b.render&&(b.template=h),j(e,b,o)}
@@ -1,2 +1,2 @@
1
- var S=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var K=(e,t)=>{for(var n in t)S(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of q(t))!z.call(e,c)&&c!==n&&S(e,c,{get:()=>t[c],enumerable:!(a=W(t,c))||a.enumerable});return e},E=(e,t,n)=>(k(e,t,"default"),n&&k(n,t,"default"));var A={};K(A,{Fragment:()=>I,ShapeFlags:()=>x,createApp:()=>U,h:()=>v});import{isStringOrNumber as X,isArray as w,isVNode as V}from"@lytjs/common";var x=(f=>(f[f.ELEMENT=1]="ELEMENT",f[f.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",f[f.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",f[f.TEXT_CHILDREN=8]="TEXT_CHILDREN",f[f.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",f[f.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",f))(x||{}),I=Symbol("Fragment");function Y(e,t){if(t!=null)if(X(t))e.children=String(t),e.shapeFlag|=8;else if(w(t)){let n=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c==null||typeof c=="boolean"))if(w(c))for(let m=0;m<c.length;m++){let f=c[m];f!=null&&typeof f!="boolean"&&n.push(V(f)?f:T(String(f)))}else V(c)?n.push(c):n.push(T(String(c)))}e.children=n,e.shapeFlag|=16}else typeof t=="object"&&(e.children=t,e.shapeFlag|=32)}function T(e,t=null,n=null){var y,h;let a=0;typeof e=="string"?a=1:e===I?a=0:typeof e=="function"?a=2:typeof e=="object"&&e!==null&&(e.setup||e.__vccOpts||e.render)&&(a=4);let c=(y=t==null?void 0:t.key)!=null?y:null,m=(h=t==null?void 0:t.ref)!=null?h:null,f=t;if(t){let{key:b,ref:o,...i}=t;f=i}let g={type:e,props:f,children:null,key:c,ref:m,shapeFlag:a,el:null,component:null};return n!=null&&Y(g,n),g}function v(e,t,n){return T(e,t||null,n||null)}import{isPromise as j}from"@lytjs/common";function M(e){return Object.create(e||null)}function F(e){return e!==null&&typeof e=="object"&&typeof e.install=="function"}function D(e){return typeof e=="function"}function H(e,t,...n){if(F(t)){let a=t.onBeforeInstall?t.onBeforeInstall(e,...n):void 0;if(j(a))return a.then(()=>{let c=t.install(e,...n);if(j(c))return c.then(()=>{if(t.onInstalled)return t.onInstalled(e,...n)});if(t.onInstalled)return t.onInstalled(e,...n)});{let c=t.install(e,...n);if(j(c))return c.then(()=>{if(t.onInstalled)return t.onInstalled(e,...n)});if(t.onInstalled)return t.onInstalled(e,...n)}}else if(D(t))return t(e,...n)}function B(e,t){if(F(t)){if(typeof t.uninstall=="function")return t.uninstall(e)}else D(t)}import{effect as Z,stop as J}from"@lytjs/reactivity";import{compile as G}from"@lytjs/compiler";import{defineComponent as Q,createComponentInstance as ee,setupComponent as te,mountComponent as ne,updateComponent as oe,unmountComponent as re}from"@lytjs/component";import{createRenderer as ie}from"@lytjs/renderer";var se=100,_=new Map;function ae(e){let t=_.get(e);if(t)return _.delete(e),_.set(e,t),t;let{code:n}=G(e);if(t=new Function("h","_ctx",`return ${n}`),_.size>=se){let a=_.keys().next().value;_.delete(a)}return _.set(e,t),t}function le(e){let t={...e};if(e.state&&typeof e.state!="function"){let n=e.state;t.state=()=>({...n})}if(typeof e.render=="function"){let n=e.render;t.render=(a,c)=>n(a)}if(e.computed){let n={};for(let a of Object.keys(e.computed)){let c=e.computed[a];typeof c=="function"?n[a]={get:c}:n[a]=c}t.computed=n}if(typeof e.init=="function"){let n=e.init;t.init=function(a,c){return n.call(this,a)}}return t}function ce(){return{createElement(e){return document.createElement(e)},createText(e){return document.createTextNode(e)},createComment(e){return document.createComment(e)},setAttribute(e,t,n){e.setAttribute(t,String(n))},removeAttribute(e,t){e.removeAttribute(t)},setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let n in t)e.style[n]=t[n]},setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let n=[];for(let[a,c]of Object.entries(t))c&&n.push(a);e.className=n.join(" ")}else e.className=""},insert(e,t,n){n!=null?e.insertBefore(t,n):e.appendChild(t)},remove(e){e.parentNode&&e.parentNode.removeChild(e)},replace(e,t,n){e.replaceChild(n,t)},addEventListener(e,t,n,a){e.addEventListener(t,n,a)},removeEventListener(e,t,n){e.removeEventListener(t,n)},nextTick(e){Promise.resolve().then(e)},parentNode(e){return e.parentNode},nextSibling(e){return e.nextSibling},querySelector(e){return document.querySelector(e)}}}function U(e,t){let n=new Set,a={},c={},m=M(),f={},g={},y=null,h=null,b=null,o=null,i=!1,r=le(typeof e=="function"?{render:e}:e),u=Q(r),s={config:f,globalProperties:g,get _instance(){return y},mount(d){if(i)return s;let p;if(typeof d=="string"){if(p=document.querySelector(d),!p)throw new Error(`[Lyt] \u627E\u4E0D\u5230\u6302\u8F7D\u76EE\u6807: "${d}"`)}else p=d;o=p;let C=ce();h=ie(C),y=ee(u),te(y,t||{},null);let P=y.type;if(!P.render&&P.template){let N=ae(P.template);P.render=(R,$)=>N(R,$.renderProxy)}return ne(y,v),y.subTree&&h.mount(y.subTree,p),b=Z(()=>{if(!(!y||!y.isMounted||!h)&&(oe(y,v),y.subTree&&o)){let N=o.firstChild,R=y.subTree;o.innerHTML="",h.mount(R,o)}},{lazy:!0}),i=!0,s},unmount(){i&&(b&&(J(b),b=null),y&&re(y),o&&(o.innerHTML=""),y=null,h=null,o=null,i=!1)},use(d,...p){if(n.has(d))return s;n.add(d);let C=H({use:s.use.bind(s),unuse:s.unuse.bind(s),isInstalled:s.isInstalled.bind(s),provide:s.provide.bind(s),inject:s.inject.bind(s),config:f,globalProperties:g},d,...p);return C instanceof Promise?C.then(()=>s):s},unuse(d){if(!n.has(d))return s;n.delete(d);let p=B({use:s.use.bind(s),unuse:s.unuse.bind(s),isInstalled:s.isInstalled.bind(s),provide:s.provide.bind(s),inject:s.inject.bind(s),config:f,globalProperties:g},d);return p instanceof Promise?p.then(()=>s):s},isInstalled(d){return n.has(d)},provide(d,p){return m[d]=p,s},inject(d,p){let C=m[d];return C!==void 0?C:p},component(d,p){return p?(a[d]=p,s):a[d]},directive(d,p){return p?(c[d]=p,s):c[d]}};return s}E(A,Fe);import*as Fe from"@lytjs/common";function L(){return typeof globalThis.window!="undefined"&&typeof globalThis.document!="undefined"&&typeof globalThis.HTMLElement!="undefined"&&typeof globalThis.customElements!="undefined"}function ue(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function de(e){if(e===""||e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e==="undefined")return;let t=Number(e);if(!isNaN(t)&&e.trim()!=="")return t;if(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]"))try{return JSON.parse(e)}catch(n){}return e}function fe(e,t){return t&&t[e]?t[e]:ue(e)}function pe(e){let t=[],n=e;if(n.emits&&(Array.isArray(n.emits)?t.push(...n.emits):typeof n.emits=="object"&&t.push(...Object.keys(n.emits))),n.methods){for(let a of Object.keys(n.methods))if(a.startsWith("on")&&a.length>2){let c=a.charAt(2).toLowerCase()+a.slice(3);t.push(c)}}return t}function ye(e,t={}){let{shadowMode:n="open",styles:a="",propMappings:c,eventMappings:m={},attributeConverters:f={}}=t,g=t.observedAttributes||[],y=pe(e);return class extends HTMLElement{constructor(){super();this._shadowRoot=null;this._instance=null;this._props={};this._container=null;this._connected=!1;this._eventCleanups=[];this._effectCleanup=null;this._updateScheduled=!1}static get observedAttributes(){return g}connectedCallback(){if(!this._connected){if(this._connected=!0,this._shadowRoot=this.attachShadow({mode:n}),a){let o=document.createElement("style");o.textContent=a,this._shadowRoot.appendChild(o)}this._container=document.createElement("div"),this._shadowRoot.appendChild(this._container),this._syncAttributesToProps(),this._mountComponent(),this._forwardSlots()}}disconnectedCallback(){if(this._connected){this._connected=!1;for(let o of this._eventCleanups)o();this._eventCleanups=[],this._effectCleanup&&(this._effectCleanup(),this._effectCleanup=null),this._instance=null,this._container&&(this._container.innerHTML="")}}attributeChangedCallback(o,i,l){i!==l&&this._connected&&(this._syncAttributesToProps(),this._updateComponent())}_syncAttributesToProps(){let o={};for(let i of g)if(this.hasAttribute(i)){let l=this.getAttribute(i),r=fe(i,c);f[i]?o[r]=f[i](l):o[r]=de(l)}if(e.props){for(let[i,l]of Object.entries(e.props))if(o[i]===void 0){let r=l;r&&typeof r=="object"&&"default"in r?o[i]=typeof r.default=="function"?r.default():r.default:r==null}}this._props=o}_mountComponent(){let o=e.render?e.render:e.template?this._compileTemplate(e.template):null;if(!o)return;let i=this._createComponentContext(),l=o.call(i,v,i);l&&this._container&&this._renderVNode(l,this._container),this._setupReactiveUpdates(i,o)}_compileTemplate(o){try{let i=Function("return require")(),{compile:l}=i("../../compiler/src/index.ts"),{code:r}=l(o);return new Function("h","_ctx",`return ${r}`)}catch(i){return null}}_createComponentContext(){let o=e.state?typeof e.state=="function"?e.state():{...e.state}:{},i=e.computed||{},l=e.methods||{},r={...this._props,...o};for(let[u,s]of Object.entries(i))typeof s=="function"?Object.defineProperty(r,u,{get:s.bind(r),enumerable:!0}):s&&typeof s=="object"&&"get"in s&&Object.defineProperty(r,u,{get:s.get.bind(r),enumerable:!0});for(let[u,s]of Object.entries(l))typeof s=="function"&&(r[u]=s.bind(r));return r.emit=(u,...s)=>{let d=m[u]||u,p=new CustomEvent(d,{detail:s.length===1?s[0]:s,bubbles:!0,composed:!0});this.dispatchEvent(p)},r.$el=this._container,r.$attrs={...this._props},r.$slots=this._getSlotContent(),r}_setupReactiveUpdates(o,i){try{let l=Function("return require")(),{effect:r,stop:u}=l("../../reactivity/src/index.ts"),s=r(()=>{if(!this._connected||!this._container)return;let p=i.call(o,v,o);p&&(this._container.innerHTML="",this._renderVNode(p,this._container))},{lazy:!0}),d=e.state?typeof e.state=="function"?Object.keys(e.state()):Object.keys(e.state):[];for(let p of d){let C=o[p];Object.defineProperty(o,p,{get(){return C},set(P){C=P;try{s()}catch(N){}},enumerable:!0})}this._effectCleanup=()=>{try{u(s)}catch(p){}}}catch(l){let r=e.state?typeof e.state=="function"?Object.keys(e.state()):Object.keys(e.state):[];for(let u of r){let d=o[u],p=this;Object.defineProperty(o,u,{get(){return d},set(C){d=C,p._scheduleUpdate(o,i)},enumerable:!0})}}}_scheduleUpdate(o,i){this._updateScheduled||(this._updateScheduled=!0,Promise.resolve().then(()=>{if(this._updateScheduled=!1,!this._connected||!this._container)return;let l=i.call(o,v,o);l&&(this._container.innerHTML="",this._renderVNode(l,this._container))}))}_updateComponent(){if(!this._container)return;let o=e.render?e.render:e.template?this._compileTemplate(e.template):null;if(!o)return;let i=this._createComponentContext(),l=o.call(i,v,i);this._container.innerHTML="",l&&this._renderVNode(l,this._container)}_renderVNode(o,i){let l=this._vNodeToElement(o);l&&i.appendChild(l)}_vNodeToElement(o){if(!o)return null;if(typeof o.type=="symbol"){let i=document.createDocumentFragment();if(Array.isArray(o.children))for(let l of o.children){let r=this._vNodeToElement(l);r&&i.appendChild(r)}return i}if(typeof o.children=="string")return document.createTextNode(o.children);if(typeof o.type=="string"){let i=document.createElement(o.type);if(o.props)for(let[l,r]of Object.entries(o.props))if(l==="style"&&typeof r=="object")for(let[u,s]of Object.entries(r))i.style[u]=s;else if(l==="class"){if(typeof r=="string")i.className=r;else if(typeof r=="object"){let u=[];for(let[s,d]of Object.entries(r))d&&u.push(s);i.className=u.join(" ")}}else if(l.startsWith("on")&&typeof r=="function"){let u=l.slice(2).toLowerCase();i.addEventListener(u,r),this._eventCleanups.push(()=>{i.removeEventListener(u,r)})}else l==="ref"&&typeof r=="function"?r(i):i.setAttribute(l,String(r));if(Array.isArray(o.children))for(let l of o.children){let r=this._vNodeToElement(l);r&&i.appendChild(r)}else typeof o.children=="string"&&(i.textContent=o.children);return i}return typeof o.type=="object"||typeof o.type=="function"?o.component?this._vNodeToElement(o.component.subTree||o):document.createComment("component"):null}_forwardSlots(){if(!this._shadowRoot||!this._container)return;let o=this.querySelectorAll("[slot]");for(let l of o){let r=l.getAttribute("slot")||"default",u=document.createElement("slot");r!=="default"&&u.setAttribute("name",r),this._container.appendChild(u)}let i=document.createElement("slot");this._container.appendChild(i)}_getSlotContent(){var r;let o={},i=this.querySelectorAll("[slot]");for(let u of i){let s=u.getAttribute("slot")||"default";o[s]||(o[s]=[]),o[s].push(u.cloneNode(!0))}let l=[];for(let u of Array.from(this.childNodes))(r=u.hasAttribute)!=null&&r.call(u,"slot")||l.push(u.cloneNode(!0));return l.length>0&&(o.default=l),o}get _lytInstance(){return this._instance}get _lytProps(){return{...this._props}}}}function O(e,t,n){if(!e.includes("-"))throw new Error(`[Lyt Web Component] \u6807\u7B7E\u540D "${e}" \u5FC5\u987B\u5305\u542B\u8FDE\u5B57\u7B26 (-)\u3002\u8FD9\u662F Custom Element \u89C4\u8303\u7684\u8981\u6C42\u3002`);if(!L())return;let a=ye(t,n);customElements.define(e,a)}function me(e){for(let{tagName:t,component:n,options:a}of e)O(t,n,a)}function ge(e){if(L())try{let t=customElements;t.__unregister&&t.__unregister(e)}catch(t){}}async function he(e,t,n){let a=t.match(/<template>([\s\S]*?)<\/template>/),c=t.match(/<script[^>]*>([\s\S]*?)<\/script>/),m=/<style[^>]*>([\s\S]*?)<\/style>/g,f=[],g;for(;(g=m.exec(t))!==null;)f.push(g);let y=(n==null?void 0:n.styles)||"";for(let i of f)y+=i[1]+`
1
+ var S=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var K=(e,t)=>{for(var n in t)S(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of q(t))!z.call(e,c)&&c!==n&&S(e,c,{get:()=>t[c],enumerable:!(a=W(t,c))||a.enumerable});return e},E=(e,t,n)=>(k(e,t,"default"),n&&k(n,t,"default"));var A={};K(A,{Fragment:()=>I,ShapeFlags:()=>x,createApp:()=>U,h:()=>v});import{isStringOrNumber as X,isArray as w,isVNode as V}from"@lytjs/common";var x=(f=>(f[f.ELEMENT=1]="ELEMENT",f[f.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",f[f.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",f[f.TEXT_CHILDREN=8]="TEXT_CHILDREN",f[f.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",f[f.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",f))(x||{}),I=Symbol("Fragment");function Y(e,t){if(t!=null)if(X(t))e.children=String(t),e.shapeFlag|=8;else if(w(t)){let n=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c==null||typeof c=="boolean"))if(w(c))for(let m=0;m<c.length;m++){let f=c[m];f!=null&&typeof f!="boolean"&&n.push(V(f)?f:T(String(f)))}else V(c)?n.push(c):n.push(T(String(c)))}e.children=n,e.shapeFlag|=16}else typeof t=="object"&&(e.children=t,e.shapeFlag|=32)}function T(e,t=null,n=null){var y,h;let a=0;typeof e=="string"?a=1:e===I?a=0:typeof e=="function"?a=2:typeof e=="object"&&e!==null&&(e.setup||e.__vccOpts||e.render)&&(a=4);let c=(y=t==null?void 0:t.key)!=null?y:null,m=(h=t==null?void 0:t.ref)!=null?h:null,f=t;if(t){let{key:b,ref:o,...i}=t;f=i}let g={type:e,props:f,children:null,key:c,ref:m,shapeFlag:a,el:null,component:null};return n!=null&&Y(g,n),g}function v(e,t,n){return T(e,t||null,n||null)}import{isPromise as j}from"@lytjs/common";function M(e){return Object.create(e||null)}function F(e){return e!==null&&typeof e=="object"&&typeof e.install=="function"}function D(e){return typeof e=="function"}function H(e,t,...n){if(F(t)){let a=t.onBeforeInstall?t.onBeforeInstall(e,...n):void 0;if(j(a))return a.then(()=>{let c=t.install(e,...n);if(j(c))return c.then(()=>{if(t.onInstalled)return t.onInstalled(e,...n)});if(t.onInstalled)return t.onInstalled(e,...n)});{let c=t.install(e,...n);if(j(c))return c.then(()=>{if(t.onInstalled)return t.onInstalled(e,...n)});if(t.onInstalled)return t.onInstalled(e,...n)}}else if(D(t))return t(e,...n)}function B(e,t){if(F(t)){if(typeof t.uninstall=="function")return t.uninstall(e)}else D(t)}import{effect as Z,stop as J}from"@lytjs/reactivity";import{compile as G}from"@lytjs/compiler";import{defineComponent as Q,createComponentInstance as ee,setupComponent as te,mountComponent as ne,updateComponent as oe,unmountComponent as re}from"@lytjs/component";import{createRenderer as ie}from"@lytjs/renderer";var se=100,_=new Map;function ae(e){let t=_.get(e);if(t)return _.delete(e),_.set(e,t),t;let{code:n}=G(e);if(t=new Function("h","_ctx",`return ${n}`),_.size>=se){let a=_.keys().next().value;a!==void 0&&_.delete(a)}return _.set(e,t),t}function le(e){let t={...e};if(e.state&&typeof e.state!="function"){let n=e.state;t.state=()=>({...n})}if(typeof e.render=="function"){let n=e.render;t.render=(a,c)=>n(a)}if(e.computed){let n={};for(let a of Object.keys(e.computed)){let c=e.computed[a];typeof c=="function"?n[a]={get:c}:n[a]=c}t.computed=n}if(typeof e.init=="function"){let n=e.init;t.init=function(a,c){return n.call(this,a)}}return t}function ce(){return{createElement(e){return document.createElement(e)},createText(e){return document.createTextNode(e)},createComment(e){return document.createComment(e)},setAttribute(e,t,n){e.setAttribute(t,String(n))},removeAttribute(e,t){e.removeAttribute(t)},setStyle(e,t){if(typeof t=="string")e.style.cssText=t;else if(t&&typeof t=="object")for(let n in t)e.style[n]=t[n]},setClass(e,t){if(typeof t=="string")e.className=t;else if(t&&typeof t=="object"){let n=[];for(let[a,c]of Object.entries(t))c&&n.push(a);e.className=n.join(" ")}else e.className=""},insert(e,t,n){n!=null?e.insertBefore(t,n):e.appendChild(t)},remove(e){e.parentNode&&e.parentNode.removeChild(e)},replace(e,t,n){e.replaceChild(n,t)},addEventListener(e,t,n,a){e.addEventListener(t,n,a)},removeEventListener(e,t,n){e.removeEventListener(t,n)},nextTick(e){Promise.resolve().then(e)},parentNode(e){return e.parentNode},nextSibling(e){return e.nextSibling},querySelector(e){return document.querySelector(e)}}}function U(e,t){let n=new Set,a={},c={},m=M(),f={},g={},y=null,h=null,b=null,o=null,i=!1,r=le(typeof e=="function"?{render:e}:e),u=Q(r),s={config:f,globalProperties:g,get _instance(){return y},mount(d){if(i)return s;let p;if(typeof d=="string"){if(p=document.querySelector(d),!p)throw new Error(`[Lyt] \u627E\u4E0D\u5230\u6302\u8F7D\u76EE\u6807: "${d}"`)}else p=d;o=p;let C=ce();h=ie(C),y=ee(u),te(y,t||{},null);let P=y.type;if(!P.render&&P.template){let N=ae(P.template);P.render=(R,$)=>N(R,$.renderProxy)}return ne(y,v),y.subTree&&h.mount(y.subTree,p),b=Z(()=>{if(!(!y||!y.isMounted||!h)&&(oe(y,v),y.subTree&&o)){let N=o.firstChild,R=y.subTree;o.innerHTML="",h.mount(R,o)}},{lazy:!0}),i=!0,s},unmount(){i&&(b&&(J(b),b=null),y&&re(y),o&&(o.innerHTML=""),y=null,h=null,o=null,i=!1)},use(d,...p){if(n.has(d))return s;n.add(d);let C=H({use:s.use.bind(s),unuse:s.unuse.bind(s),isInstalled:s.isInstalled.bind(s),provide:s.provide.bind(s),inject:s.inject.bind(s),config:f,globalProperties:g},d,...p);return C instanceof Promise?C.then(()=>s):s},unuse(d){if(!n.has(d))return s;n.delete(d);let p=B({use:s.use.bind(s),unuse:s.unuse.bind(s),isInstalled:s.isInstalled.bind(s),provide:s.provide.bind(s),inject:s.inject.bind(s),config:f,globalProperties:g},d);return p instanceof Promise?p.then(()=>s):s},isInstalled(d){return n.has(d)},provide(d,p){return m[d]=p,s},inject(d,p){let C=m[d];return C!==void 0?C:p},component(d,p){return p?(a[d]=p,s):a[d]},directive(d,p){return p?(c[d]=p,s):c[d]}};return s}E(A,Fe);import*as Fe from"@lytjs/common";function L(){return typeof globalThis.window!="undefined"&&typeof globalThis.document!="undefined"&&typeof globalThis.HTMLElement!="undefined"&&typeof globalThis.customElements!="undefined"}function ue(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function de(e){if(e===""||e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e==="undefined")return;let t=Number(e);if(!isNaN(t)&&e.trim()!=="")return t;if(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]"))try{return JSON.parse(e)}catch(n){}return e}function fe(e,t){return t&&t[e]?t[e]:ue(e)}function pe(e){let t=[],n=e;if(n.emits&&(Array.isArray(n.emits)?t.push(...n.emits):typeof n.emits=="object"&&t.push(...Object.keys(n.emits))),n.methods){for(let a of Object.keys(n.methods))if(a.startsWith("on")&&a.length>2){let c=a.charAt(2).toLowerCase()+a.slice(3);t.push(c)}}return t}function ye(e,t={}){let{shadowMode:n="open",styles:a="",propMappings:c,eventMappings:m={},attributeConverters:f={}}=t,g=t.observedAttributes||[],y=pe(e);return class extends HTMLElement{constructor(){super();this._shadowRoot=null;this._instance=null;this._props={};this._container=null;this._connected=!1;this._eventCleanups=[];this._effectCleanup=null;this._updateScheduled=!1}static get observedAttributes(){return g}connectedCallback(){if(!this._connected){if(this._connected=!0,this._shadowRoot=this.attachShadow({mode:n}),a){let o=document.createElement("style");o.textContent=a,this._shadowRoot.appendChild(o)}this._container=document.createElement("div"),this._shadowRoot.appendChild(this._container),this._syncAttributesToProps(),this._mountComponent(),this._forwardSlots()}}disconnectedCallback(){if(this._connected){this._connected=!1;for(let o of this._eventCleanups)o();this._eventCleanups=[],this._effectCleanup&&(this._effectCleanup(),this._effectCleanup=null),this._instance=null,this._container&&(this._container.innerHTML="")}}attributeChangedCallback(o,i,l){i!==l&&this._connected&&(this._syncAttributesToProps(),this._updateComponent())}_syncAttributesToProps(){let o={};for(let i of g)if(this.hasAttribute(i)){let l=this.getAttribute(i),r=fe(i,c);f[i]?o[r]=f[i](l):o[r]=de(l)}if(e.props){for(let[i,l]of Object.entries(e.props))if(o[i]===void 0){let r=l;r&&typeof r=="object"&&"default"in r?o[i]=typeof r.default=="function"?r.default():r.default:r==null}}this._props=o}_mountComponent(){let o=e.render?e.render:e.template?this._compileTemplate(e.template):null;if(!o)return;let i=this._createComponentContext(),l=o.call(i,v,i);l&&this._container&&this._renderVNode(l,this._container),this._setupReactiveUpdates(i,o)}_compileTemplate(o){try{let i=Function("return require")(),{compile:l}=i("../../compiler/src/index.ts"),{code:r}=l(o);return new Function("h","_ctx",`return ${r}`)}catch(i){return null}}_createComponentContext(){let o=e.state?typeof e.state=="function"?e.state():{...e.state}:{},i=e.computed||{},l=e.methods||{},r={...this._props,...o};for(let[u,s]of Object.entries(i))typeof s=="function"?Object.defineProperty(r,u,{get:s.bind(r),enumerable:!0}):s&&typeof s=="object"&&"get"in s&&Object.defineProperty(r,u,{get:s.get.bind(r),enumerable:!0});for(let[u,s]of Object.entries(l))typeof s=="function"&&(r[u]=s.bind(r));return r.emit=(u,...s)=>{let d=m[u]||u,p=new CustomEvent(d,{detail:s.length===1?s[0]:s,bubbles:!0,composed:!0});this.dispatchEvent(p)},r.$el=this._container,r.$attrs={...this._props},r.$slots=this._getSlotContent(),r}_setupReactiveUpdates(o,i){try{let l=Function("return require")(),{effect:r,stop:u}=l("../../reactivity/src/index.ts"),s=r(()=>{if(!this._connected||!this._container)return;let p=i.call(o,v,o);p&&(this._container.innerHTML="",this._renderVNode(p,this._container))},{lazy:!0}),d=e.state?typeof e.state=="function"?Object.keys(e.state()):Object.keys(e.state):[];for(let p of d){let C=o[p];Object.defineProperty(o,p,{get(){return C},set(P){C=P;try{s()}catch(N){}},enumerable:!0})}this._effectCleanup=()=>{try{u(s)}catch(p){}}}catch(l){let r=e.state?typeof e.state=="function"?Object.keys(e.state()):Object.keys(e.state):[];for(let u of r){let d=o[u],p=this;Object.defineProperty(o,u,{get(){return d},set(C){d=C,p._scheduleUpdate(o,i)},enumerable:!0})}}}_scheduleUpdate(o,i){this._updateScheduled||(this._updateScheduled=!0,Promise.resolve().then(()=>{if(this._updateScheduled=!1,!this._connected||!this._container)return;let l=i.call(o,v,o);l&&(this._container.innerHTML="",this._renderVNode(l,this._container))}))}_updateComponent(){if(!this._container)return;let o=e.render?e.render:e.template?this._compileTemplate(e.template):null;if(!o)return;let i=this._createComponentContext(),l=o.call(i,v,i);this._container.innerHTML="",l&&this._renderVNode(l,this._container)}_renderVNode(o,i){let l=this._vNodeToElement(o);l&&i.appendChild(l)}_vNodeToElement(o){if(!o)return null;if(typeof o.type=="symbol"){let i=document.createDocumentFragment();if(Array.isArray(o.children))for(let l of o.children){let r=this._vNodeToElement(l);r&&i.appendChild(r)}return i}if(typeof o.children=="string")return document.createTextNode(o.children);if(typeof o.type=="string"){let i=document.createElement(o.type);if(o.props)for(let[l,r]of Object.entries(o.props))if(l==="style"&&typeof r=="object")for(let[u,s]of Object.entries(r))i.style[u]=s;else if(l==="class"){if(typeof r=="string")i.className=r;else if(typeof r=="object"){let u=[];for(let[s,d]of Object.entries(r))d&&u.push(s);i.className=u.join(" ")}}else if(l.startsWith("on")&&typeof r=="function"){let u=l.slice(2).toLowerCase();i.addEventListener(u,r),this._eventCleanups.push(()=>{i.removeEventListener(u,r)})}else l==="ref"&&typeof r=="function"?r(i):i.setAttribute(l,String(r));if(Array.isArray(o.children))for(let l of o.children){let r=this._vNodeToElement(l);r&&i.appendChild(r)}else typeof o.children=="string"&&(i.textContent=o.children);return i}return typeof o.type=="object"||typeof o.type=="function"?o.component?this._vNodeToElement(o.component.subTree||o):document.createComment("component"):null}_forwardSlots(){if(!this._shadowRoot||!this._container)return;let o=this.querySelectorAll("[slot]");for(let l of o){let r=l.getAttribute("slot")||"default",u=document.createElement("slot");r!=="default"&&u.setAttribute("name",r),this._container.appendChild(u)}let i=document.createElement("slot");this._container.appendChild(i)}_getSlotContent(){var r;let o={},i=this.querySelectorAll("[slot]");for(let u of i){let s=u.getAttribute("slot")||"default";o[s]||(o[s]=[]),o[s].push(u.cloneNode(!0))}let l=[];for(let u of Array.from(this.childNodes))(r=u.hasAttribute)!=null&&r.call(u,"slot")||l.push(u.cloneNode(!0));return l.length>0&&(o.default=l),o}get _lytInstance(){return this._instance}get _lytProps(){return{...this._props}}}}function O(e,t,n){if(!e.includes("-"))throw new Error(`[Lyt Web Component] \u6807\u7B7E\u540D "${e}" \u5FC5\u987B\u5305\u542B\u8FDE\u5B57\u7B26 (-)\u3002\u8FD9\u662F Custom Element \u89C4\u8303\u7684\u8981\u6C42\u3002`);if(!L())return;let a=ye(t,n);customElements.define(e,a)}function me(e){for(let{tagName:t,component:n,options:a}of e)O(t,n,a)}function ge(e){if(L())try{let t=customElements;t.__unregister&&t.__unregister(e)}catch(t){}}async function he(e,t,n){let a=t.match(/<template>([\s\S]*?)<\/template>/),c=t.match(/<script[^>]*>([\s\S]*?)<\/script>/),m=/<style[^>]*>([\s\S]*?)<\/style>/g,f=[],g;for(;(g=m.exec(t))!==null;)f.push(g);let y=(n==null?void 0:n.styles)||"";for(let i of f)y+=i[1]+`
2
2
  `;let h=a?a[1].trim():void 0,b={};if(c){let i=c[1].trim();if(i.match(/export\s+default\s*(\{[\s\S]*\}|\([\s\S]*\)[\s\S]*?\))/))try{let r={},u={exports:r};new Function("module","exports",`"use strict"; ${i.replace(/export\s+default\s*/,"module.exports =")}`)(u,r),b=u.exports||r}catch(r){}}let o={...n,styles:y};h&&!b.template&&!b.render&&(b.template=h),O(e,b,o)}export{O as defineCustomElement,he as defineCustomElementFromSFC,L as isBrowser,me as registerComponents,ge as unregisterElement};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lytjs/core",
3
- "version": "4.0.5",
3
+ "version": "4.2.0",
4
4
  "description": "Lyt.js 核心入口 - 整合响应式、编译器、虚拟 DOM、渲染器和组件系统",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -61,12 +61,12 @@
61
61
  "createApp"
62
62
  ],
63
63
  "dependencies": {
64
- "@lytjs/common": "^4.0.5",
65
- "@lytjs/reactivity": "^4.0.5",
66
- "@lytjs/compiler": "^4.0.5",
67
- "@lytjs/vdom": "^4.0.5",
68
- "@lytjs/renderer": "^4.0.5",
69
- "@lytjs/component": "^4.0.5"
64
+ "@lytjs/common": "^4.2.0",
65
+ "@lytjs/reactivity": "^4.2.0",
66
+ "@lytjs/compiler": "^4.2.0",
67
+ "@lytjs/vdom": "^4.2.0",
68
+ "@lytjs/renderer": "^4.2.0",
69
+ "@lytjs/component": "^4.2.0"
70
70
  },
71
71
  "engines": {
72
72
  "node": ">=18.0.0"