@pyreon/vue-compat 0.5.6 → 0.6.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.
@@ -1,503 +1,166 @@
1
- import { Fragment, createContext, h as pyreonH, onMount, onUnmount, onUpdate, popContext, pushContext, useContext } from "@pyreon/core";
2
- import { batch, computed as computed$1, createStore, effect, nextTick as nextTick$1, signal } from "@pyreon/reactivity";
3
- import { mount } from "@pyreon/runtime-dom";
4
-
5
- //#region src/jsx-runtime.ts
6
-
7
- function getCurrentCtx() {
8
- return _currentCtx;
9
- }
10
- function getHookIndex() {
11
- return _hookIndex++;
12
- }
13
-
14
- //#endregion
15
- //#region src/index.ts
16
-
17
- /**
18
- * Creates a reactive ref wrapping the given value.
19
- * Access via `.value` — reads track, writes trigger.
20
- *
21
- * Inside a component: hook-indexed. The setter also calls `scheduleRerender()`.
22
- * Outside a component: creates a standalone reactive ref.
23
- */
24
- function ref(value) {
25
- const ctx = getCurrentCtx();
26
- if (ctx) {
27
- const idx = getHookIndex();
28
- if (idx < ctx.hooks.length) return ctx.hooks[idx];
29
- const s = signal(value);
30
- const {
31
- scheduleRerender
32
- } = ctx;
33
- const r = {
34
- [V_IS_REF]: true,
35
- get value() {
36
- return s();
37
- },
38
- set value(v) {
39
- s.set(v);
40
- scheduleRerender();
41
- },
42
- _signal: s,
43
- _scheduleRerender: scheduleRerender
44
- };
45
- ctx.hooks[idx] = r;
46
- return r;
47
- }
48
- const s = signal(value);
49
- return {
50
- [V_IS_REF]: true,
51
- get value() {
52
- return s();
53
- },
54
- set value(v) {
55
- s.set(v);
56
- },
57
- _signal: s
58
- };
59
- }
60
- /**
61
- * Creates a shallow ref — same as `ref()` in Pyreon since signals are inherently shallow.
62
- */
63
- function shallowRef(value) {
64
- return ref(value);
65
- }
66
- /**
67
- * Force trigger a ref's subscribers, even if the value hasn't changed.
68
- */
69
- function triggerRef(r) {
70
- const internal = r;
71
- if (internal._signal) {
72
- const current = internal._signal.peek();
73
- internal._signal.set(void 0);
74
- internal._signal.set(current);
75
- }
76
- if (internal._scheduleRerender) internal._scheduleRerender();
77
- }
78
- /**
79
- * Returns `true` if the value is a ref (created by `ref()` or `computed()`).
80
- */
81
- function isRef(val) {
82
- return val !== null && typeof val === "object" && val[V_IS_REF] === true;
83
- }
84
- /**
85
- * Unwraps a ref: if it has `.value`, return `.value`; otherwise return as-is.
86
- */
87
- function unref(r) {
88
- return isRef(r) ? r.value : r;
89
- }
90
- function computed(fnOrOptions) {
91
- const ctx = getCurrentCtx();
92
- if (ctx) {
93
- const idx = getHookIndex();
94
- if (idx < ctx.hooks.length) return ctx.hooks[idx];
95
- const getter = typeof fnOrOptions === "function" ? fnOrOptions : fnOrOptions.get;
96
- const setter = typeof fnOrOptions === "object" ? fnOrOptions.set : void 0;
97
- const c = computed$1(getter);
98
- const {
99
- scheduleRerender
100
- } = ctx;
101
- const r = {
102
- [V_IS_REF]: true,
103
- get value() {
104
- return c();
105
- },
106
- set value(v) {
107
- if (!setter) throw new Error("Cannot set value of a computed ref — computed refs are readonly");
108
- setter(v);
109
- scheduleRerender();
110
- }
111
- };
112
- ctx.hooks[idx] = r;
113
- return r;
114
- }
115
- const getter = typeof fnOrOptions === "function" ? fnOrOptions : fnOrOptions.get;
116
- const setter = typeof fnOrOptions === "object" ? fnOrOptions.set : void 0;
117
- const c = computed$1(getter);
118
- return {
119
- [V_IS_REF]: true,
120
- get value() {
121
- return c();
122
- },
123
- set value(v) {
124
- if (!setter) throw new Error("Cannot set value of a computed ref — computed refs are readonly");
125
- setter(v);
126
- }
127
- };
128
- }
129
- /**
130
- * Creates a deeply reactive proxy from a plain object.
131
- * Backed by Pyreon's `createStore()`.
132
- *
133
- * Inside a component: hook-indexed. Proxy wrapper intercepts sets to
134
- * call `scheduleRerender()`.
135
- */
136
- function reactive(obj) {
137
- const ctx = getCurrentCtx();
138
- if (ctx) {
139
- const idx = getHookIndex();
140
- if (idx < ctx.hooks.length) return ctx.hooks[idx];
141
- const proxy = createStore(obj);
142
- rawMap.set(proxy, obj);
143
- const {
144
- scheduleRerender
145
- } = ctx;
146
- const wrapped = new Proxy(proxy, {
147
- set(target, key, value, receiver) {
148
- const result = Reflect.set(target, key, value, receiver);
149
- scheduleRerender();
150
- return result;
151
- },
152
- deleteProperty(target, key) {
153
- const result = Reflect.deleteProperty(target, key);
154
- scheduleRerender();
155
- return result;
156
- }
157
- });
158
- rawMap.set(wrapped, obj);
159
- ctx.hooks[idx] = wrapped;
160
- return wrapped;
161
- }
162
- const proxy = createStore(obj);
163
- rawMap.set(proxy, obj);
164
- return proxy;
165
- }
166
- /**
167
- * Creates a shallow reactive proxy — same as `reactive()` in Pyreon.
168
- */
169
- function shallowReactive(obj) {
170
- return reactive(obj);
171
- }
172
- /**
173
- * Returns a readonly proxy that throws on mutation attempts.
174
- *
175
- * Inside a component: hook-indexed.
176
- */
177
- function readonly(obj) {
178
- const ctx = getCurrentCtx();
179
- if (ctx) {
180
- const idx = getHookIndex();
181
- if (idx < ctx.hooks.length) return ctx.hooks[idx];
182
- const proxy = _createReadonlyProxy(obj);
183
- ctx.hooks[idx] = proxy;
184
- return proxy;
185
- }
186
- return _createReadonlyProxy(obj);
187
- }
188
- function _createReadonlyProxy(obj) {
189
- return new Proxy(obj, {
190
- get(target, key) {
191
- if (key === V_IS_READONLY) return true;
192
- if (key === V_RAW) return target;
193
- return Reflect.get(target, key);
194
- },
195
- set(_target, key) {
196
- if (key === V_IS_READONLY || key === V_RAW) return true;
197
- throw new Error(`Cannot set property "${String(key)}" on a readonly object`);
198
- },
199
- deleteProperty(_target, key) {
200
- throw new Error(`Cannot delete property "${String(key)}" from a readonly object`);
201
- }
202
- });
203
- }
204
- /**
205
- * Returns the raw (unwrapped) object behind a reactive or readonly proxy.
206
- */
207
- function toRaw(proxy) {
208
- const readonlyRaw = proxy[V_RAW];
209
- if (readonlyRaw) return readonlyRaw;
210
- return rawMap.get(proxy) ?? proxy;
211
- }
212
- /**
213
- * Creates a ref linked to a property of a reactive object.
214
- * Reading/writing the ref's `.value` reads/writes the original property.
215
- *
216
- * Inside a component: hook-indexed.
217
- */
218
- function toRef(obj, key) {
219
- const ctx = getCurrentCtx();
220
- if (ctx) {
221
- const idx = getHookIndex();
222
- if (idx < ctx.hooks.length) return ctx.hooks[idx];
223
- const r = _createToRef(obj, key);
224
- ctx.hooks[idx] = r;
225
- return r;
226
- }
227
- return _createToRef(obj, key);
228
- }
229
- function _createToRef(obj, key) {
230
- return {
231
- [V_IS_REF]: true,
232
- get value() {
233
- return obj[key];
234
- },
235
- set value(newValue) {
236
- obj[key] = newValue;
237
- }
238
- };
239
- }
240
- /**
241
- * Converts all properties of a reactive object into individual refs.
242
- * Each ref is linked to the original property (not a copy).
243
- *
244
- * Inside a component: hook-indexed (the entire result, not individual refs).
245
- */
246
- function toRefs(obj) {
247
- const ctx = getCurrentCtx();
248
- if (ctx) {
249
- const idx = getHookIndex();
250
- if (idx < ctx.hooks.length) return ctx.hooks[idx];
251
- const result = {};
252
- for (const key of Object.keys(obj)) result[key] = _createToRef(obj, key);
253
- ctx.hooks[idx] = result;
254
- return result;
255
- }
256
- const result = {};
257
- for (const key of Object.keys(obj)) result[key] = _createToRef(obj, key);
258
- return result;
259
- }
260
- /**
261
- * Watches a reactive source and calls `cb` when it changes.
262
- *
263
- * Inside a component: hook-indexed, created once. Disposed on unmount.
264
- */
265
- function watch(source, cb, options) {
266
- const ctx = getCurrentCtx();
267
- if (ctx) {
268
- const idx = getHookIndex();
269
- if (idx < ctx.hooks.length) return ctx.hooks[idx];
270
- const getter = isRef(source) ? () => source.value : source;
271
- let oldValue;
272
- let initialized = false;
273
- if (options?.immediate) {
274
- oldValue = void 0;
275
- const current = getter();
276
- cb(current, oldValue);
277
- oldValue = current;
278
- initialized = true;
279
- }
280
- let running = false;
281
- const e = effect(() => {
282
- if (running) return;
283
- running = true;
284
- try {
285
- const newValue = getter();
286
- if (initialized) cb(newValue, oldValue);
287
- oldValue = newValue;
288
- initialized = true;
289
- } finally {
290
- running = false;
291
- }
292
- });
293
- const stop = () => e.dispose();
294
- ctx.hooks[idx] = stop;
295
- ctx.unmountCallbacks.push(stop);
296
- return stop;
297
- }
298
- const getter = isRef(source) ? () => source.value : source;
299
- let oldValue;
300
- let initialized = false;
301
- if (options?.immediate) {
302
- oldValue = void 0;
303
- const current = getter();
304
- cb(current, oldValue);
305
- oldValue = current;
306
- initialized = true;
307
- }
308
- let running = false;
309
- const e = effect(() => {
310
- if (running) return;
311
- running = true;
312
- try {
313
- const newValue = getter();
314
- if (initialized) cb(newValue, oldValue);
315
- oldValue = newValue;
316
- initialized = true;
317
- } finally {
318
- running = false;
319
- }
320
- });
321
- return () => e.dispose();
322
- }
323
- /**
324
- * Runs the given function reactively — re-executes whenever its tracked
325
- * dependencies change.
326
- *
327
- * Inside a component: hook-indexed, created once. Disposed on unmount.
328
- */
329
- function watchEffect(fn) {
330
- const ctx = getCurrentCtx();
331
- if (ctx) {
332
- const idx = getHookIndex();
333
- if (idx < ctx.hooks.length) return ctx.hooks[idx];
334
- let running = false;
335
- const e = effect(() => {
336
- if (running) return;
337
- running = true;
338
- try {
339
- fn();
340
- } finally {
341
- running = false;
342
- }
343
- });
344
- const stop = () => e.dispose();
345
- ctx.hooks[idx] = stop;
346
- ctx.unmountCallbacks.push(stop);
347
- return stop;
348
- }
349
- let running = false;
350
- const e = effect(() => {
351
- if (running) return;
352
- running = true;
353
- try {
354
- fn();
355
- } finally {
356
- running = false;
357
- }
358
- });
359
- return () => e.dispose();
360
- }
361
- /**
362
- * Registers a callback to run after the component is mounted.
363
- * Hook-indexed: only registered on first render.
364
- */
365
- function onMounted(fn) {
366
- const ctx = getCurrentCtx();
367
- if (!ctx) {
368
- onMount(() => {
369
- fn();
370
- });
371
- return;
372
- }
373
- const idx = getHookIndex();
374
- if (idx < ctx.hooks.length) return;
375
- ctx.hooks[idx] = true;
376
- ctx.pendingEffects.push({
377
- fn: () => {
378
- fn();
379
- },
380
- deps: [],
381
- cleanup: void 0
382
- });
383
- }
384
- /**
385
- * Registers a callback to run when the component is unmounted.
386
- * Hook-indexed: only registered on first render.
387
- */
388
- function onUnmounted(fn) {
389
- const ctx = getCurrentCtx();
390
- if (!ctx) {
391
- onUnmount(fn);
392
- return;
393
- }
394
- const idx = getHookIndex();
395
- if (idx < ctx.hooks.length) return;
396
- ctx.hooks[idx] = true;
397
- ctx.unmountCallbacks.push(fn);
398
- }
399
- /**
400
- * Registers a callback to run after a reactive update (not on initial mount).
401
- * Hook-indexed: registered once, fires on each re-render.
402
- */
403
- function onUpdated(fn) {
404
- const ctx = getCurrentCtx();
405
- if (!ctx) {
406
- onUpdate(fn);
407
- return;
408
- }
409
- const idx = getHookIndex();
410
- if (idx >= ctx.hooks.length) {
411
- ctx.hooks[idx] = true;
412
- return;
413
- }
414
- ctx.pendingEffects.push({
415
- fn: () => {
416
- fn();
417
- },
418
- deps: void 0,
419
- cleanup: void 0
420
- });
421
- }
422
- /**
423
- * Registers a callback to run before mount.
424
- * In Pyreon there is no pre-mount phase — maps to `onMounted()`.
425
- */
426
- function onBeforeMount(fn) {
427
- onMounted(fn);
428
- }
429
- /**
430
- * Registers a callback to run before unmount.
431
- * In Pyreon there is no pre-unmount phase — maps to `onUnmounted()`.
432
- */
433
- function onBeforeUnmount(fn) {
434
- onUnmounted(fn);
435
- }
436
- /**
437
- * Returns a Promise that resolves after all pending reactive updates have flushed.
438
- */
439
- function nextTick() {
440
- return nextTick$1();
441
- }
442
- function getOrCreateContext(key, defaultValue) {
443
- if (!_contextRegistry.has(key)) _contextRegistry.set(key, createContext(defaultValue));
444
- return _contextRegistry.get(key);
445
- }
446
- /**
447
- * Provides a value to all descendant components.
448
- *
449
- * Inside a component: hook-indexed, pushed once. Popped on unmount.
450
- */
451
- function provide(key, value) {
452
- const ctx = getCurrentCtx();
453
- if (ctx) {
454
- const idx = getHookIndex();
455
- if (idx < ctx.hooks.length) return;
456
- ctx.hooks[idx] = true;
457
- const vueCtx = getOrCreateContext(key);
458
- pushContext(new Map([[vueCtx.id, value]]));
459
- ctx.unmountCallbacks.push(() => popContext());
460
- return;
461
- }
462
- const vueCtx = getOrCreateContext(key);
463
- pushContext(new Map([[vueCtx.id, value]]));
464
- }
465
- /**
466
- * Injects a value provided by an ancestor component.
467
- */
468
- function inject(key, defaultValue) {
469
- const value = useContext(getOrCreateContext(key));
470
- return value !== void 0 ? value : defaultValue;
471
- }
472
- /**
473
- * Defines a component using Vue 3 Composition API style.
474
- * Only supports the `setup()` function — Options API is not supported.
475
- */
476
- function defineComponent(options) {
477
- if (typeof options === "function") return options;
478
- const comp = props => {
479
- const result = options.setup(props);
480
- if (typeof result === "function") return result();
481
- return result;
482
- };
483
- if (options.name) Object.defineProperty(comp, "name", {
484
- value: options.name
485
- });
486
- return comp;
487
- }
488
- /**
489
- * Creates a Pyreon application instance — Vue 3 `createApp()` compatible.
490
- */
491
- function createApp(component, props) {
492
- return {
493
- mount(el) {
494
- const container = typeof el === "string" ? document.querySelector(el) : el;
495
- if (!container) throw new Error(`Cannot find mount target: ${el}`);
496
- return mount(pyreonH(component, props ?? null), container);
497
- }
498
- };
499
- }
1
+ import { ComponentFn, Fragment, Props, VNodeChild, h as pyreonH } from "@pyreon/core";
2
+ import { batch } from "@pyreon/reactivity";
500
3
 
4
+ //#region src/index.d.ts
5
+ declare const V_IS_REF: unique symbol;
6
+ interface Ref<T = unknown> {
7
+ value: T;
8
+ readonly [V_IS_REF]: true;
9
+ }
10
+ /**
11
+ * Creates a reactive ref wrapping the given value.
12
+ * Access via `.value` — reads track, writes trigger.
13
+ *
14
+ * Inside a component: hook-indexed. The setter also calls `scheduleRerender()`.
15
+ * Outside a component: creates a standalone reactive ref.
16
+ */
17
+ declare function ref<T>(value: T): Ref<T>;
18
+ /**
19
+ * Creates a shallow ref — same as `ref()` in Pyreon since signals are inherently shallow.
20
+ */
21
+ declare function shallowRef<T>(value: T): Ref<T>;
22
+ /**
23
+ * Force trigger a ref's subscribers, even if the value hasn't changed.
24
+ */
25
+ declare function triggerRef<T>(r: Ref<T>): void;
26
+ /**
27
+ * Returns `true` if the value is a ref (created by `ref()` or `computed()`).
28
+ */
29
+ declare function isRef(val: unknown): val is Ref;
30
+ /**
31
+ * Unwraps a ref: if it has `.value`, return `.value`; otherwise return as-is.
32
+ */
33
+ declare function unref<T>(r: T | Ref<T>): T;
34
+ interface ComputedRef<T = unknown> extends Ref<T> {
35
+ readonly value: T;
36
+ }
37
+ interface WritableComputedRef<T = unknown> extends Ref<T> {
38
+ value: T;
39
+ }
40
+ /**
41
+ * Creates a computed ref. Supports both readonly and writable forms.
42
+ *
43
+ * Inside a component: hook-indexed.
44
+ */
45
+ declare function computed<T>(getter: () => T): ComputedRef<T>;
46
+ declare function computed<T>(options: {
47
+ get: () => T;
48
+ set: (value: T) => void;
49
+ }): WritableComputedRef<T>;
50
+ /**
51
+ * Creates a deeply reactive proxy from a plain object.
52
+ * Backed by Pyreon's `createStore()`.
53
+ *
54
+ * Inside a component: hook-indexed. Proxy wrapper intercepts sets to
55
+ * call `scheduleRerender()`.
56
+ */
57
+ declare function reactive<T extends object>(obj: T): T;
58
+ /**
59
+ * Creates a shallow reactive proxy — same as `reactive()` in Pyreon.
60
+ */
61
+ declare function shallowReactive<T extends object>(obj: T): T;
62
+ /**
63
+ * Returns a readonly proxy that throws on mutation attempts.
64
+ *
65
+ * Inside a component: hook-indexed.
66
+ */
67
+ declare function readonly<T extends object>(obj: T): Readonly<T>;
68
+ /**
69
+ * Returns the raw (unwrapped) object behind a reactive or readonly proxy.
70
+ */
71
+ declare function toRaw<T extends object>(proxy: T): T;
72
+ /**
73
+ * Creates a ref linked to a property of a reactive object.
74
+ * Reading/writing the ref's `.value` reads/writes the original property.
75
+ *
76
+ * Inside a component: hook-indexed.
77
+ */
78
+ declare function toRef<T extends object, K extends keyof T>(obj: T, key: K): Ref<T[K]>;
79
+ /**
80
+ * Converts all properties of a reactive object into individual refs.
81
+ * Each ref is linked to the original property (not a copy).
82
+ *
83
+ * Inside a component: hook-indexed (the entire result, not individual refs).
84
+ */
85
+ declare function toRefs<T extends object>(obj: T): { [K in keyof T]: Ref<T[K]> };
86
+ interface WatchOptions {
87
+ /** Call the callback immediately with current value. Default: false */
88
+ immediate?: boolean;
89
+ /** Ignored in Pyreon — dependencies are tracked automatically. */
90
+ deep?: boolean;
91
+ }
92
+ type WatchSource<T> = Ref<T> | (() => T);
93
+ /**
94
+ * Watches a reactive source and calls `cb` when it changes.
95
+ *
96
+ * Inside a component: hook-indexed, created once. Disposed on unmount.
97
+ */
98
+ declare function watch<T>(source: WatchSource<T>, cb: (newValue: T, oldValue: T | undefined) => void, options?: WatchOptions): () => void;
99
+ /**
100
+ * Runs the given function reactively — re-executes whenever its tracked
101
+ * dependencies change.
102
+ *
103
+ * Inside a component: hook-indexed, created once. Disposed on unmount.
104
+ */
105
+ declare function watchEffect(fn: () => void): () => void;
106
+ /**
107
+ * Registers a callback to run after the component is mounted.
108
+ * Hook-indexed: only registered on first render.
109
+ */
110
+ declare function onMounted(fn: () => void): void;
111
+ /**
112
+ * Registers a callback to run when the component is unmounted.
113
+ * Hook-indexed: only registered on first render.
114
+ */
115
+ declare function onUnmounted(fn: () => void): void;
116
+ /**
117
+ * Registers a callback to run after a reactive update (not on initial mount).
118
+ * Hook-indexed: registered once, fires on each re-render.
119
+ */
120
+ declare function onUpdated(fn: () => void): void;
121
+ /**
122
+ * Registers a callback to run before mount.
123
+ * In Pyreon there is no pre-mount phase — maps to `onMounted()`.
124
+ */
125
+ declare function onBeforeMount(fn: () => void): void;
126
+ /**
127
+ * Registers a callback to run before unmount.
128
+ * In Pyreon there is no pre-unmount phase — maps to `onUnmounted()`.
129
+ */
130
+ declare function onBeforeUnmount(fn: () => void): void;
131
+ /**
132
+ * Returns a Promise that resolves after all pending reactive updates have flushed.
133
+ */
134
+ declare function nextTick(): Promise<void>;
135
+ /**
136
+ * Provides a value to all descendant components.
137
+ *
138
+ * Inside a component: hook-indexed, pushed once. Popped on unmount.
139
+ */
140
+ declare function provide<T>(key: string | symbol, value: T): void;
141
+ /**
142
+ * Injects a value provided by an ancestor component.
143
+ */
144
+ declare function inject<T>(key: string | symbol, defaultValue?: T): T | undefined;
145
+ interface ComponentOptions<P extends Props = Props> {
146
+ /** The setup function — called once during component initialization. */
147
+ setup: (props: P) => (() => VNodeChild) | VNodeChild;
148
+ /** Optional name for debugging. */
149
+ name?: string;
150
+ }
151
+ /**
152
+ * Defines a component using Vue 3 Composition API style.
153
+ * Only supports the `setup()` function — Options API is not supported.
154
+ */
155
+ declare function defineComponent<P extends Props = Props>(options: ComponentOptions<P> | ((props: P) => VNodeChild)): ComponentFn<P>;
156
+ interface App {
157
+ /** Mount the application into a DOM element. Returns an unmount function. */
158
+ mount(el: string | Element): () => void;
159
+ }
160
+ /**
161
+ * Creates a Pyreon application instance — Vue 3 `createApp()` compatible.
162
+ */
163
+ declare function createApp(component: ComponentFn, props?: Props): App;
501
164
  //#endregion
502
- export { Fragment, batch, computed, createApp, defineComponent, pyreonH as h, inject, isRef, nextTick, onBeforeMount, onBeforeUnmount, onMounted, onUnmounted, onUpdated, provide, reactive, readonly, ref, shallowReactive, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, watch, watchEffect };
503
- //# sourceMappingURL=index.d.ts.map
165
+ export { ComputedRef, Fragment, Ref, WatchOptions, WritableComputedRef, batch, computed, createApp, defineComponent, pyreonH as h, inject, isRef, nextTick, onBeforeMount, onBeforeUnmount, onMounted, onUnmounted, onUpdated, provide, reactive, readonly, ref, shallowReactive, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, watch, watchEffect };
166
+ //# sourceMappingURL=index2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["pyreonComputed","pyreonNextTick","pyreonMount"],"sources":["../../../src/jsx-runtime.ts","../../../src/index.ts"],"mappings":";;;;;;AA+CA,SAAgB,aAAA,CAAA,EAAsC;EACpD,OAAO,WAAA;;AAGT,SAAgB,YAAA,CAAA,EAAuB;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;;;iBA+EI,WAAA,CAAY,EAAA;;;;AA1T5B;iBAmWgB,SAAA,CAAU,EAAA;;;;;iBA2BV,WAAA,CAAY,EAAA;;;;;iBAgBZ,SAAA,CAAU,EAAA;;;;;iBA2BV,aAAA,CAAc,EAAA;;;;AAzW9B;iBAiXgB,eAAA,CAAgB,EAAA;;;;iBAShB,QAAA,CAAA,GAAY,OAAA;;;;;AAvV5B;iBA4WgB,OAAA,GAAA,CAAW,GAAA,mBAAsB,KAAA,EAAO,CAAA;;;;iBAmBxC,MAAA,GAAA,CAAU,GAAA,mBAAsB,YAAA,GAAe,CAAA,GAAI,CAAA;AAAA,UAQzD,gBAAA,WAA2B,KAAA,GAAQ,KAAA;EAvYc;EAyYzD,KAAA,GAAQ,KAAA,EAAO,CAAA,YAAa,UAAA,IAAc,UAAA;EAzYgB;EA2Y1D,IAAA;AAAA;;;;;iBAOc,eAAA,WAA0B,KAAA,GAAQ,KAAA,CAAA,CAChD,OAAA,EAAS,gBAAA,CAAiB,CAAA,MAAO,KAAA,EAAO,CAAA,KAAM,UAAA,IAC7C,WAAA,CAAY,CAAA;AAAA,UA0BL,GAAA;EAramD;EAua3D,KAAA,CAAM,EAAA,WAAa,OAAA;AAAA;AAnYrB;;;AAAA,iBAyYgB,SAAA,CAAU,SAAA,EAAW,WAAA,EAAa,KAAA,GAAQ,KAAA,GAAQ,GAAA"}
@@ -1,92 +1,10 @@
1
- import { Fragment, h, onUnmount } from "@pyreon/core";
2
- import { runUntracked, signal } from "@pyreon/reactivity";
1
+ import { ComponentFn, Fragment, Props, VNode, VNodeChild } from "@pyreon/core";
3
2
 
4
- //#region src/jsx-runtime.ts
5
-
6
- function beginRender(ctx) {
7
- _currentCtx = ctx;
8
- _hookIndex = 0;
9
- ctx.pendingEffects = [];
10
- ctx.pendingLayoutEffects = [];
11
- }
12
- function endRender() {
13
- _currentCtx = null;
14
- _hookIndex = 0;
15
- }
16
- function runLayoutEffects(entries) {
17
- for (const entry of entries) {
18
- if (entry.cleanup) entry.cleanup();
19
- const cleanup = entry.fn();
20
- entry.cleanup = typeof cleanup === "function" ? cleanup : void 0;
21
- }
22
- }
23
- function scheduleEffects(ctx, entries) {
24
- if (entries.length === 0) return;
25
- queueMicrotask(() => {
26
- for (const entry of entries) {
27
- if (ctx.unmounted) return;
28
- if (entry.cleanup) entry.cleanup();
29
- const cleanup = entry.fn();
30
- entry.cleanup = typeof cleanup === "function" ? cleanup : void 0;
31
- }
32
- });
33
- }
34
- function wrapCompatComponent(vueComponent) {
35
- let wrapped = _wrapperCache.get(vueComponent);
36
- if (wrapped) return wrapped;
37
- wrapped = props => {
38
- const ctx = {
39
- hooks: [],
40
- scheduleRerender: () => {},
41
- pendingEffects: [],
42
- pendingLayoutEffects: [],
43
- unmounted: false,
44
- unmountCallbacks: []
45
- };
46
- const version = signal(0);
47
- let updateScheduled = false;
48
- ctx.scheduleRerender = () => {
49
- if (ctx.unmounted || updateScheduled) return;
50
- updateScheduled = true;
51
- queueMicrotask(() => {
52
- updateScheduled = false;
53
- if (!ctx.unmounted) version.set(version.peek() + 1);
54
- });
55
- };
56
- onUnmount(() => {
57
- ctx.unmounted = true;
58
- for (const cb of ctx.unmountCallbacks) cb();
59
- });
60
- return () => {
61
- version();
62
- beginRender(ctx);
63
- const result = runUntracked(() => vueComponent(props));
64
- const layoutEffects = ctx.pendingLayoutEffects;
65
- const effects = ctx.pendingEffects;
66
- endRender();
67
- runLayoutEffects(layoutEffects);
68
- scheduleEffects(ctx, effects);
69
- return result;
70
- };
71
- };
72
- _wrapperCache.set(vueComponent, wrapped);
73
- return wrapped;
74
- }
75
- function jsx(type, props, key) {
76
- const {
77
- children,
78
- ...rest
79
- } = props;
80
- const propsWithKey = key != null ? {
81
- ...rest,
82
- key
83
- } : rest;
84
- if (typeof type === "function") return h(wrapCompatComponent(type), children !== void 0 ? {
85
- ...propsWithKey,
86
- children
87
- } : propsWithKey);
88
- return h(type, propsWithKey, ...(children === void 0 ? [] : Array.isArray(children) ? children : [children]));
89
- }
3
+ //#region src/jsx-runtime.d.ts
4
+ declare function jsx(type: string | ComponentFn | symbol, props: Props & {
5
+ children?: VNodeChild | VNodeChild[];
6
+ }, key?: string | number | null): VNode;
7
+ declare const jsxs: typeof jsx;
90
8
  //#endregion
91
9
  export { Fragment, jsx, jsxs };
92
- //# sourceMappingURL=jsx-runtime.d.ts.map
10
+ //# sourceMappingURL=jsx-runtime2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-runtime.d.ts","names":[],"sources":["../../../src/jsx-runtime.ts"],"mappings":";;;;;AAuDA,SAAgB,WAAA,CAAY,GAAA,EAA0B;EACpD,WAAA,GAAc,GAAA;EACd,UAAA,GAAa,CAAA;EACb,GAAA,CAAI,cAAA,GAAiB,EAAE;EACvB,GAAA,CAAI,oBAAA,GAAuB,EAAE;;AAG/B,SAAgB,SAAA,CAAA,EAAkB;EAChC,WAAA,GAAc,IAAA;EACd,UAAA,GAAa,CAAA;;AAKf,SAAS,gBAAA,CAAiB,OAAA,EAA8B;EACtD,KAAK,MAAM,KAAA,IAAS,OAAA,EAAS;IAC3B,IAAI,KAAA,CAAM,OAAA,EAAS,KAAA,CAAM,OAAA,CAAA,CAAS;IAClC,MAAM,OAAA,GAAU,KAAA,CAAM,EAAA,CAAA,CAAI;IAC1B,KAAA,CAAM,OAAA,GAAU,OAAO,OAAA,KAAY,UAAA,GAAa,OAAA,GAAU,KAAA,CAAA;;;AAI9D,SAAS,eAAA,CAAgB,GAAA,EAAoB,OAAA,EAA8B;EACzE,IAAI,OAAA,CAAQ,MAAA,KAAW,CAAA,EAAG;EAC1B,cAAA,CAAA,MAAqB;IACnB,KAAK,MAAM,KAAA,IAAS,OAAA,EAAS;MAC3B,IAAI,GAAA,CAAI,SAAA,EAAW;MACnB,IAAI,KAAA,CAAM,OAAA,EAAS,KAAA,CAAM,OAAA,CAAA,CAAS;MAClC,MAAM,OAAA,GAAU,KAAA,CAAM,EAAA,CAAA,CAAI;MAC1B,KAAA,CA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B,aAAA,CAAc;MAC/B,eAAA,CAAgB,GAAA,EAAK,OAAA,CAAQ;MAE7B,OAAO,MAAA;;;EAIX,aAAA,CAAc,GAAA,CAAI,YAAA,EAAc,OAAA,CAAQ;EACxC,OAAO,OAAA;;AAKT,SAAgB,GAAA,CACd,IAAA,EACA,KAAA,EACA,GAAA,EACO;EACP,MAAM;IAAE,QAAA;IAAU,GAAG;EAAA,CAAA,GAAS,KAAA;EAC9B,MAAM,YAAA,GAAgB,GAAA,IAAO,IAAA,GAAO;IAAE,GAAG,IAAA;IAAM;GAAK,GAAG,IAAA;EAEvD,IAAI,OAAO,IAAA,KAAS,UAAA,EAIlB,OAAO,CAAA,CAFS,mBAAA,CAAoB,IAAA,CAAK,EAClB,QAAA,KAAa,KAAA,CAAA,GAAY;IAAE,GAAG,YAAA;IAAc;GAAU,GAAG,YAAA,CAC/C;EAMnC,OAAO,CAAA,CAAE,IAAA,EAAM,YAAA,EAAc,IAFV,QAAA,KAAa,KAAA,CAAA,GAAY,EAAE,GAAG,KAAA,CAAM,OAAA,CAAQ,QAAA,CAAS,GAAG,QAAA,GAAW,CAAC,QAAA,CAAS,EAEnC"}
1
+ {"version":3,"file":"jsx-runtime2.d.ts","names":[],"sources":["../../../src/jsx-runtime.ts"],"mappings":";;;iBA2JgB,GAAA,CACd,IAAA,WAAe,WAAA,WACf,KAAA,EAAO,KAAA;EAAU,QAAA,GAAW,UAAA,GAAa,UAAA;AAAA,GACzC,GAAA,4BACC,KAAA;AAAA,cAiBU,IAAA,SAAI,GAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyreon/vue-compat",
3
- "version": "0.5.6",
3
+ "version": "0.6.0",
4
4
  "description": "Vue 3-compatible Composition API shim for Pyreon — write Vue-style code that runs on Pyreon's reactive engine",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -49,9 +49,9 @@
49
49
  "prepublishOnly": "bun run build"
50
50
  },
51
51
  "dependencies": {
52
- "@pyreon/core": "^0.5.6",
53
- "@pyreon/reactivity": "^0.5.6",
54
- "@pyreon/runtime-dom": "^0.5.6"
52
+ "@pyreon/core": "^0.6.0",
53
+ "@pyreon/reactivity": "^0.6.0",
54
+ "@pyreon/runtime-dom": "^0.6.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@happy-dom/global-registrator": "^20.8.3",