semajsx 0.1.0 → 0.1.2

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.
Files changed (103) hide show
  1. package/dist/{computed-BpjqvQu1.mjs → computed-BidG06Lt.mjs} +2 -2
  2. package/dist/{computed-BpjqvQu1.mjs.map → computed-BidG06Lt.mjs.map} +1 -1
  3. package/dist/{document-OGuk9jhK.mjs → document-BOJDaiBc.mjs} +19 -4
  4. package/dist/document-BOJDaiBc.mjs.map +1 -0
  5. package/dist/{document-DFsOtfef.mjs → document-CwHVG_PJ.mjs} +2 -2
  6. package/dist/dom/index.d.mts +68 -3
  7. package/dist/dom/index.d.mts.map +1 -1
  8. package/dist/dom/index.mjs +4 -4
  9. package/dist/dom/jsx-dev-runtime.d.mts +4 -4
  10. package/dist/dom/jsx-dev-runtime.mjs +1 -1
  11. package/dist/dom/jsx-runtime.d.mts +4 -4
  12. package/dist/dom/jsx-runtime.mjs +2 -2
  13. package/dist/{helpers-DrifjCXb.d.mts → helpers-CfRDJgcP.d.mts} +3 -3
  14. package/dist/{helpers-DrifjCXb.d.mts.map → helpers-CfRDJgcP.d.mts.map} +1 -1
  15. package/dist/{index-DS5X3Pvb.d.mts → index-B1pjI-Su.d.mts} +2 -2
  16. package/dist/{index-DS5X3Pvb.d.mts.map → index-B1pjI-Su.d.mts.map} +1 -1
  17. package/dist/index-DC3tthWf.d.mts +81 -0
  18. package/dist/index-DC3tthWf.d.mts.map +1 -0
  19. package/dist/index.d.mts +7 -7
  20. package/dist/index.mjs +5 -5
  21. package/dist/{island-marker-hZdmHMvx.d.mts → island-marker-BJIO07Vj.d.mts} +1 -1
  22. package/dist/island-marker-BJIO07Vj.d.mts.map +1 -0
  23. package/dist/{jsx-CGW4OyqA.d.mts → jsx-fNlLjLou.d.mts} +2 -2
  24. package/dist/{jsx-CGW4OyqA.d.mts.map → jsx-fNlLjLou.d.mts.map} +1 -1
  25. package/dist/{jsx-runtime-DU8DRISG.d.mts → jsx-runtime-BFuFPDzn.d.mts} +3 -3
  26. package/dist/{jsx-runtime-DU8DRISG.d.mts.map → jsx-runtime-BFuFPDzn.d.mts.map} +1 -1
  27. package/dist/jsx-runtime-D9ZNjMJ2.mjs.map +1 -1
  28. package/dist/{jsx-runtime-mBpL8czJ.d.mts → jsx-runtime-DZx2Yv-t.d.mts} +28 -6
  29. package/dist/{jsx-runtime-mBpL8czJ.d.mts.map → jsx-runtime-DZx2Yv-t.d.mts.map} +1 -1
  30. package/dist/lucide-CVtHepGM.mjs +126 -0
  31. package/dist/lucide-CVtHepGM.mjs.map +1 -0
  32. package/dist/{resource-B1IudM8_.d.mts → resource-BQI6AeJ0.d.mts} +23 -3
  33. package/dist/resource-BQI6AeJ0.d.mts.map +1 -0
  34. package/dist/{resource-BjsDAkbG.mjs → resource-DSlXDZZi.mjs} +2 -2
  35. package/dist/{resource-BjsDAkbG.mjs.map → resource-DSlXDZZi.mjs.map} +1 -1
  36. package/dist/signal/index.d.mts +2 -2
  37. package/dist/signal/index.mjs +3 -3
  38. package/dist/{signal-4PgGfydw.mjs → signal-BN8vHXDb.mjs} +1 -1
  39. package/dist/{signal-4PgGfydw.mjs.map → signal-BN8vHXDb.mjs.map} +1 -1
  40. package/dist/{signal-CLsaPA7c.d.mts → signal-BwxUlXKs.d.mts} +1 -1
  41. package/dist/{signal-CLsaPA7c.d.mts.map → signal-BwxUlXKs.d.mts.map} +1 -1
  42. package/dist/{src-CRi0xsNK.mjs → src-BqX3sryB.mjs} +68 -5
  43. package/dist/src-BqX3sryB.mjs.map +1 -0
  44. package/dist/src-DR-EWgVP.mjs +868 -0
  45. package/dist/src-DR-EWgVP.mjs.map +1 -0
  46. package/dist/{src-DEoBG1zB.mjs → src-DUpFNNM_.mjs} +4 -4
  47. package/dist/{src-DEoBG1zB.mjs.map → src-DUpFNNM_.mjs.map} +1 -1
  48. package/dist/{src-BlS3Hc-L.mjs → src-DW3tIczg.mjs} +75 -5
  49. package/dist/src-DW3tIczg.mjs.map +1 -0
  50. package/dist/{src-Jbt_w0hc.mjs → src-Ds9vl42d.mjs} +37 -35
  51. package/dist/src-Ds9vl42d.mjs.map +1 -0
  52. package/dist/{src-iC-NFwTy.mjs → src-DuSN6go_.mjs} +79 -22
  53. package/dist/src-DuSN6go_.mjs.map +1 -0
  54. package/dist/ssg/index.d.mts +4 -182
  55. package/dist/ssg/index.d.mts.map +1 -1
  56. package/dist/ssg/index.mjs +7 -756
  57. package/dist/ssg/index.mjs.map +1 -1
  58. package/dist/ssg/plugins/docs-theme.d.mts +180 -0
  59. package/dist/ssg/plugins/docs-theme.d.mts.map +1 -0
  60. package/dist/ssg/plugins/docs-theme.mjs +2042 -0
  61. package/dist/ssg/plugins/docs-theme.mjs.map +1 -0
  62. package/dist/ssg/plugins/lucide.d.mts +3 -0
  63. package/dist/ssg/plugins/lucide.mjs +7 -0
  64. package/dist/ssr/client.d.mts +3 -3
  65. package/dist/ssr/client.mjs +5 -5
  66. package/dist/ssr/index.d.mts +3 -3
  67. package/dist/ssr/index.d.mts.map +1 -1
  68. package/dist/ssr/index.mjs +6 -5
  69. package/dist/style/index.d.mts +2 -2
  70. package/dist/style/index.d.mts.map +1 -1
  71. package/dist/style/index.mjs +1 -1
  72. package/dist/style/react.d.mts +2 -2
  73. package/dist/style/react.mjs +2 -2
  74. package/dist/style/vue.d.mts +2 -2
  75. package/dist/style/vue.mjs +2 -2
  76. package/dist/terminal/index.d.mts +4 -4
  77. package/dist/terminal/index.mjs +2 -2
  78. package/dist/terminal/jsx-dev-runtime.d.mts +4 -4
  79. package/dist/terminal/jsx-dev-runtime.mjs +1 -1
  80. package/dist/terminal/jsx-runtime.d.mts +4 -4
  81. package/dist/terminal/jsx-runtime.mjs +1 -1
  82. package/dist/{types-DlNR9ZaJ.d.mts → types-BlaUrkq0.d.mts} +2 -2
  83. package/dist/{types-DlNR9ZaJ.d.mts.map → types-BlaUrkq0.d.mts.map} +1 -1
  84. package/dist/types-CGkRxnQB.d.mts +220 -0
  85. package/dist/types-CGkRxnQB.d.mts.map +1 -0
  86. package/dist/{types-Dgj6n-EE.d.mts → types-CZMcXQTW.d.mts} +9 -4
  87. package/dist/types-CZMcXQTW.d.mts.map +1 -0
  88. package/dist/{types-Bjx1Pp14.d.mts → types-D0jRO840.d.mts} +1 -1
  89. package/dist/{types-Bjx1Pp14.d.mts.map → types-D0jRO840.d.mts.map} +1 -1
  90. package/dist/{types-DEi0apQO.d.mts → types-DucvOZQ2.d.mts} +2 -2
  91. package/dist/{types-DEi0apQO.d.mts.map → types-DucvOZQ2.d.mts.map} +1 -1
  92. package/dist/{utils-BrGmTgfG.mjs → utils-DbTAs943.mjs} +1 -1
  93. package/dist/{utils-BrGmTgfG.mjs.map → utils-DbTAs943.mjs.map} +1 -1
  94. package/package.json +71 -18
  95. package/dist/document-OGuk9jhK.mjs.map +0 -1
  96. package/dist/island-marker-hZdmHMvx.d.mts.map +0 -1
  97. package/dist/jsx-runtime-D2B2BK8X.mjs +0 -4
  98. package/dist/resource-B1IudM8_.d.mts.map +0 -1
  99. package/dist/src-BlS3Hc-L.mjs.map +0 -1
  100. package/dist/src-CRi0xsNK.mjs.map +0 -1
  101. package/dist/src-Jbt_w0hc.mjs.map +0 -1
  102. package/dist/src-iC-NFwTy.mjs.map +0 -1
  103. package/dist/types-Dgj6n-EE.d.mts.map +0 -1
@@ -0,0 +1,220 @@
1
+ import { d as VNode, t as Component } from "./types-CZMcXQTW.mjs";
2
+ import { z } from "zod";
3
+
4
+ //#region ../ssg/src/types.d.ts
5
+ /**
6
+ * Infer a registry type from an array of collections
7
+ * Maps collection names to their data types
8
+ */
9
+ type InferCollections<T extends readonly Collection[]> = { [K in T[number] as K["name"]]: K extends Collection<infer D> ? D : unknown };
10
+ interface CollectionEntry<T = unknown> {
11
+ /** Unique identifier within the collection */
12
+ id: string;
13
+ /** URL-friendly slug */
14
+ slug: string;
15
+ /** Validated frontmatter data */
16
+ data: T;
17
+ /** Raw content body (markdown/mdx) */
18
+ body: string;
19
+ /** Render the content to JSX */
20
+ render: () => Promise<{
21
+ Content: () => VNode;
22
+ }>;
23
+ }
24
+ interface ChangeSet<T = unknown> {
25
+ /** Cursor for next incremental fetch */
26
+ cursor: string;
27
+ /** Newly added entries */
28
+ added: CollectionEntry<T>[];
29
+ /** Updated entries */
30
+ updated: CollectionEntry<T>[];
31
+ /** Deleted entry IDs */
32
+ deleted: string[];
33
+ }
34
+ type WatchCallback<T = unknown> = (changes: ChangeSet<T>) => void;
35
+ interface CollectionSource<T = unknown> {
36
+ /** Unique identifier for this source */
37
+ id: string;
38
+ /** Get all entries from this source */
39
+ getEntries(): Promise<CollectionEntry<T>[]>;
40
+ /** Get a single entry by ID */
41
+ getEntry(id: string): Promise<CollectionEntry<T> | null>;
42
+ /** Watch for changes (optional) */
43
+ watch?(callback: WatchCallback<T>): () => void;
44
+ /** Get incremental changes since cursor (optional) */
45
+ getChanges?(since: string): Promise<ChangeSet<T>>;
46
+ }
47
+ interface CollectionConfig<T extends z.ZodType = z.ZodType> {
48
+ /** Collection name */
49
+ name: string;
50
+ /** Data source (returns raw entries, validated against schema later) */
51
+ source: CollectionSource<unknown>;
52
+ /** Zod schema for validation */
53
+ schema: T;
54
+ }
55
+ interface Collection<T = unknown> {
56
+ name: string;
57
+ source: CollectionSource<unknown>;
58
+ schema: z.ZodType;
59
+ /** Type-only field for inference */
60
+ _outputType?: T;
61
+ }
62
+ interface StaticPath<P = Record<string, string>> {
63
+ params: P;
64
+ props?: Record<string, unknown>;
65
+ }
66
+ interface RouteConfig<TRegistry extends Record<string, unknown> = Record<string, unknown>> {
67
+ /** Route path pattern (e.g., '/blog/:slug') */
68
+ path: string;
69
+ /** Component to render. Props are provided dynamically by the route config. */
70
+ component: (props: any) => VNode;
71
+ /** Static props for the route */
72
+ props?: Record<string, unknown> | ((ssg: SSGInstance<TRegistry>) => Promise<Record<string, unknown>>);
73
+ /** Generate static paths for dynamic routes */
74
+ getStaticPaths?: (ssg: SSGInstance<TRegistry>) => Promise<StaticPath[]>;
75
+ }
76
+ interface MDXConfig {
77
+ /** Remark plugins */
78
+ remarkPlugins?: unknown[];
79
+ /** Rehype plugins */
80
+ rehypePlugins?: unknown[];
81
+ /** Component mapping for MDX */
82
+ components?: Record<string, Component>;
83
+ }
84
+ /**
85
+ * Raw HTML VNode that can be used directly in JSX or converted to string
86
+ */
87
+ declare class RawHTML {
88
+ readonly html: string;
89
+ readonly type = "div";
90
+ readonly props: {
91
+ dangerouslySetInnerHTML: {
92
+ __html: string;
93
+ };
94
+ };
95
+ readonly children: never[];
96
+ constructor(html: string);
97
+ toString(): string;
98
+ }
99
+ interface DocumentProps {
100
+ /** Rendered page content (VNode with toString) */
101
+ children: RawHTML;
102
+ /** Page title */
103
+ title?: string;
104
+ /** Base URL path */
105
+ base: string;
106
+ /** Route path */
107
+ path: string;
108
+ /** Route props */
109
+ props: Record<string, unknown>;
110
+ /** Script tags for islands (as RawHTML) */
111
+ scripts?: RawHTML;
112
+ /** CSS stylesheet paths */
113
+ css?: string[];
114
+ }
115
+ type DocumentTemplate = (props: DocumentProps) => VNode;
116
+ /**
117
+ * Partial SSG config that a plugin's config() hook can return.
118
+ * Each field has a defined merge strategy:
119
+ * - mdx: merge (concat arrays, merge component objects)
120
+ * - document: override (last writer wins)
121
+ * - routes: concat
122
+ * - collections: concat
123
+ */
124
+ interface SSGPluginConfig {
125
+ mdx?: Partial<MDXConfig>;
126
+ document?: DocumentTemplate;
127
+ routes?: RouteConfig[];
128
+ collections?: readonly Collection[];
129
+ }
130
+ interface SSGPlugin {
131
+ /** Plugin name for identification and debugging */
132
+ name: string;
133
+ /** Plugin ordering: 'pre' runs before normal plugins, 'post' runs after */
134
+ enforce?: "pre" | "post";
135
+ /**
136
+ * Modify SSG config before it is resolved.
137
+ * Return partial config to merge.
138
+ * Called in plugin order: enforce:'pre' → normal → enforce:'post' → user config.
139
+ */
140
+ config?(config: SSGConfig): SSGPluginConfig | void;
141
+ /** Called after config is fully resolved. Read-only inspection. */
142
+ configResolved?(config: SSGConfig): void;
143
+ /** Called before build starts */
144
+ buildStart?(): void | Promise<void>;
145
+ /** Called after build completes */
146
+ buildEnd?(result: BuildResult): void | Promise<void>;
147
+ }
148
+ interface SSGConfig<TCollections extends readonly Collection[] = Collection[], TRegistry extends Record<string, unknown> = InferCollections<TCollections>> {
149
+ /** Output directory for built files */
150
+ outDir: string;
151
+ /** Root directory for resolving relative paths (defaults to script location) */
152
+ rootDir?: string;
153
+ /** Base URL path */
154
+ base?: string;
155
+ /** Collections to include */
156
+ collections?: TCollections;
157
+ /** Route definitions */
158
+ routes?: RouteConfig<TRegistry>[];
159
+ /** Plugins that contribute remark/rehype plugins and components.
160
+ * Plugin factories may return arrays (Vite-style); nested arrays are flattened. */
161
+ plugins?: (SSGPlugin | SSGPlugin[])[];
162
+ /** MDX configuration (merged after plugins, takes precedence) */
163
+ mdx?: MDXConfig;
164
+ /** Custom document template */
165
+ document?: DocumentTemplate;
166
+ }
167
+ interface BuildState {
168
+ /** Cursor for each collection */
169
+ cursors: Record<string, string>;
170
+ /** Content hash for each page */
171
+ pageHashes: Record<string, string>;
172
+ /** Last build timestamp */
173
+ timestamp: number;
174
+ }
175
+ interface BuildResult {
176
+ /** New build state for incremental builds */
177
+ state: BuildState;
178
+ /** Paths that were built */
179
+ paths: string[];
180
+ /** Build statistics */
181
+ stats: {
182
+ added: number;
183
+ updated: number;
184
+ deleted: number;
185
+ unchanged: number;
186
+ };
187
+ }
188
+ interface BuildOptions {
189
+ /** Enable incremental build */
190
+ incremental?: boolean;
191
+ /** Previous build state */
192
+ state?: BuildState;
193
+ /** Only build specific collections */
194
+ collections?: string[];
195
+ }
196
+ interface WatchOptions {
197
+ /** Callback when rebuild completes */
198
+ onRebuild?: (result: BuildResult) => void;
199
+ /** Callback on error */
200
+ onError?: (error: Error) => void;
201
+ }
202
+ interface Watcher {
203
+ /** Stop watching */
204
+ close(): void;
205
+ }
206
+ interface SSGInstance<TRegistry extends Record<string, unknown> = Record<string, unknown>> {
207
+ /** Get the root directory for resolving paths */
208
+ getRootDir(): string;
209
+ /** Get all entries from a collection */
210
+ getCollection<K extends keyof TRegistry & string>(name: K): Promise<CollectionEntry<TRegistry[K]>[]>;
211
+ /** Get a single entry from a collection */
212
+ getEntry<K extends keyof TRegistry & string>(name: K, id: string): Promise<CollectionEntry<TRegistry[K]> | null>;
213
+ /** Build the static site */
214
+ build(options?: BuildOptions): Promise<BuildResult>;
215
+ /** Watch for changes and rebuild */
216
+ watch(options?: WatchOptions): Watcher;
217
+ }
218
+ //#endregion
219
+ export { Watcher as S, SSGPlugin as _, Collection as a, WatchCallback as b, CollectionSource as c, InferCollections as d, MDXConfig as f, SSGInstance as g, SSGConfig as h, ChangeSet as i, DocumentProps as l, RouteConfig as m, BuildResult as n, CollectionConfig as o, RawHTML as p, BuildState as r, CollectionEntry as s, BuildOptions as t, DocumentTemplate as u, SSGPluginConfig as v, WatchOptions as x, StaticPath as y };
220
+ //# sourceMappingURL=types-CGkRxnQB.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-CGkRxnQB.d.mts","names":[],"sources":["../../ssg/src/types.ts"],"mappings":";;;;;;AAWA;;KAAY,gBAAA,oBAAoC,UAAA,cACxC,CAAA,YAAa,CAAA,WAAY,CAAA,SAAU,UAAA,YAAsB,CAAA;AAAA,UAOhD,eAAA;;EAEf,EAAA;;EAEA,IAAA;;EAEA,IAAA,EAAM,CAAA;;EAEN,IAAA;;EAEA,MAAA,QAAc,OAAA;IAAU,OAAA,QAAe,KAAA;EAAA;AAAA;AAAA,UAOxB,SAAA;;EAEf,MAAA;EA1B+D;EA4B/D,KAAA,EAAO,eAAA,CAAgB,CAAA;EArBR;EAuBf,OAAA,EAAS,eAAA,CAAgB,CAAA;;EAEzB,OAAA;AAAA;AAAA,KAGU,aAAA,iBAA8B,OAAA,EAAS,SAAA,CAAU,CAAA;AAAA,UAE5C,gBAAA;;EAEf,EAAA;;EAGA,UAAA,IAAc,OAAA,CAAQ,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;AAAA;AAAA,UAOe,WAAA,mBAA8B,MAAA,oBAA0B,MAAA;EAtLb;EAwL1D,UAAA;EAjLe;EAoLf,aAAA,iBAA8B,SAAA,WAC5B,IAAA,EAAM,CAAA,GACL,OAAA,CAAQ,eAAA,CAAgB,SAAA,CAAU,CAAA;EAhLxB;EAmLb,QAAA,iBAAyB,SAAA,WACvB,IAAA,EAAM,CAAA,EACN,EAAA,WACC,OAAA,CAAQ,eAAA,CAAgB,SAAA,CAAU,CAAA;;EAGrC,KAAA,CAAM,OAAA,GAAU,YAAA,GAAe,OAAA,CAAQ,WAAA;;EAGvC,KAAA,CAAM,OAAA,GAAU,YAAA,GAAe,OAAA;AAAA"}
@@ -1,4 +1,4 @@
1
- import { i as WritableSignal, n as ReadableSignal } from "./signal-CLsaPA7c.mjs";
1
+ import { i as WritableSignal, n as ReadableSignal } from "./signal-BwxUlXKs.mjs";
2
2
 
3
3
  //#region ../core/src/types.d.ts
4
4
  /**
@@ -10,10 +10,15 @@ declare const Fragment: symbol;
10
10
  */
11
11
  declare const Portal: symbol;
12
12
  /**
13
+ * Special VNode type for forward support
14
+ * Forward merges its props onto its single child element without producing a DOM node
15
+ */
16
+ declare const Forward: symbol;
17
+ /**
13
18
  * VNode types
14
19
  * - The runtime VNode tree always resolves to these `type` values
15
20
  */
16
- type VNodeType = string | Component<any> | typeof Fragment | typeof Portal;
21
+ type VNodeType = string | Component<any> | typeof Fragment | typeof Portal | typeof Forward;
17
22
  /**
18
23
  * VNode: The basic unit of the runtime render tree
19
24
  * - `type`: the element/component type
@@ -96,5 +101,5 @@ type WithKey<T> = T & {
96
101
  key?: string | number;
97
102
  };
98
103
  //#endregion
99
- export { ContextProvide as a, Portal as c, VNodeType as d, WithKey as f, ContextProps as i, Ref as l, ComponentAPI as n, Fragment as o, WithSignals as p, Context as r, JSXNode as s, Component as t, VNode as u };
100
- //# sourceMappingURL=types-Dgj6n-EE.d.mts.map
104
+ export { ContextProvide as a, JSXNode as c, VNode as d, VNodeType as f, ContextProps as i, Portal as l, WithSignals as m, ComponentAPI as n, Forward as o, WithKey as p, Context as r, Fragment as s, Component as t, Ref as u };
105
+ //# sourceMappingURL=types-CZMcXQTW.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-CZMcXQTW.d.mts","names":[],"sources":["../../core/src/types.ts"],"mappings":";;;;;AAKA;cAAa,QAAA;;;;cAKA,MAAA;;;;;cAMA,OAAA;;;;;KAMD,SAAA,YAAqB,SAAA,eAAwB,QAAA,UAAkB,MAAA,UAAgB,OAAA;;;;;;;UAQ1E,KAAA;EACf,IAAA,EAAM,SAAA;EACN,KAAA,EAAO,MAAA;EACP,QAAA,EAAU,KAAA;EACV,GAAA;AAAA;;;AAJF;;KAWY,YAAA;;;;;KAMA,OAAA,GACR,KAAA,GACA,YAAA,GACA,QAAA,CAAS,OAAA,IACT,cAAA,CAAe,OAAA,IACf,OAAA,CAAQ,OAAA,IACR,qBAAA,CAAsB,OAAA;;;;;KAMd,SAAA,aAAsB,KAAA,EAAO,CAAA,EAAG,GAAA,GAAM,YAAA,KAAiB,OAAA;;;;UAKlD,YAAA;EAvBjB;;;;;EA6BE,MAAA,IAAU,OAAA,EAAS,OAAA,CAAQ,CAAA,IAAK,CAAA;AAAA;;;;;;;;KAWtB,GAAA,MAAS,cAAA,CAAe,CAAA,aAAc,QAAA,EAAU,CAAA;;;;;;;KAShD,OAAA;EAAwB,MAAA,GAAS,CAAA;AAAA;;;;KAKjC,cAAA,aAA2B,OAAA,CAAQ,CAAA,GAAI,CAAA;;;;UAKlC,YAAA;EAGf,OAAA,EAAS,cAAA,GAAiB,cAAA;EAC1B,QAAA,GAAW,OAAA;AAAA;;;;KAMD,QAAA,MAAc,CAAA,GAAI,cAAA,CAAe,CAAA;;;;;KAMjC,WAAA,oBACE,CAAA,GAAI,CAAA,yBACZ,CAAA,CAAE,CAAA,IACF,CAAA,sBACE,CAAA,CAAE,CAAA,IACF,CAAA,CAAE,CAAA,eAAe,IAAA,mBACf,CAAA,CAAE,CAAA,IACF,QAAA,CAAS,CAAA,CAAE,CAAA;;;;KAMT,OAAA,MAAa,CAAA;EACvB,GAAA;AAAA"}
@@ -88,4 +88,4 @@ interface TerminalRoot extends TerminalNodeBase {
88
88
  type TerminalNode = TerminalElement | TerminalText | TerminalRoot;
89
89
  //#endregion
90
90
  export { TerminalText as a, TerminalStyle as i, TerminalNode as n, TerminalRoot as r, TerminalElement as t };
91
- //# sourceMappingURL=types-Bjx1Pp14.d.mts.map
91
+ //# sourceMappingURL=types-D0jRO840.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-Bjx1Pp14.d.mts","names":[],"sources":["../../terminal/src/types.ts"],"mappings":";;;KAEY,YAAA,GAAe,UAAA,QAAkB,IAAA,CAAK,IAAA,CAAK,MAAA;;AAAvD;;KAKY,gBAAA;;;;UAKK,aAAA;EACf,aAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EACA,UAAA;EACA,SAAA;EACA,KAAA;EACA,MAAA;EACA,QAAA;EACA,SAAA;EACA,QAAA;EACA,SAAA;EACA,MAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,YAAA;EACA,YAAA;EACA,WAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,UAAA;EACA,aAAA;EACA,aAAA;EACA,YAAA;EACA,MAAA;EACA,WAAA;EACA,KAAA;EACA,eAAA;EACA,IAAA;EACA,MAAA;EACA,SAAA;EACA,aAAA;EACA,GAAA;AAAA;;;;UAMe,gBAAA;EACf,IAAA,EAAM,gBAAA;EACN,QAAA,GAAW,YAAA;EACX,MAAA,EAAQ,YAAA;EACR,QAAA,EAAU,YAAA;EACV,CAAA;EACA,CAAA;EACA,KAAA;EACA,MAAA;AAAA;AARF;;;AAAA,UAciB,eAAA,SAAwB,gBAAA;EACvC,IAAA;EACA,OAAA;EACA,KAAA,EAAO,aAAA;EACP,KAAA,EAAO,MAAA;AAAA;;;;UAMQ,YAAA,SAAqB,gBAAA;EACpC,IAAA;EACA,OAAA;AAAA;;;;UAMe,YAAA,SAAqB,gBAAA;EACpC,IAAA;EACA,MAAA,EAAQ,MAAA,CAAO,WAAA;AAAA;AApBjB;;;AAAA,KA0BY,YAAA,GAAe,eAAA,GAAkB,YAAA,GAAe,YAAA"}
1
+ {"version":3,"file":"types-D0jRO840.d.mts","names":[],"sources":["../../terminal/src/types.ts"],"mappings":";;;KAEY,YAAA,GAAe,UAAA,QAAkB,IAAA,CAAK,IAAA,CAAK,MAAA;;AAAvD;;KAKY,gBAAA;;;;UAKK,aAAA;EACf,aAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EACA,UAAA;EACA,SAAA;EACA,KAAA;EACA,MAAA;EACA,QAAA;EACA,SAAA;EACA,QAAA;EACA,SAAA;EACA,MAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,YAAA;EACA,YAAA;EACA,WAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,UAAA;EACA,aAAA;EACA,aAAA;EACA,YAAA;EACA,MAAA;EACA,WAAA;EACA,KAAA;EACA,eAAA;EACA,IAAA;EACA,MAAA;EACA,SAAA;EACA,aAAA;EACA,GAAA;AAAA;;;;UAMe,gBAAA;EACf,IAAA,EAAM,gBAAA;EACN,QAAA,GAAW,YAAA;EACX,MAAA,EAAQ,YAAA;EACR,QAAA,EAAU,YAAA;EACV,CAAA;EACA,CAAA;EACA,KAAA;EACA,MAAA;AAAA;AARF;;;AAAA,UAciB,eAAA,SAAwB,gBAAA;EACvC,IAAA;EACA,OAAA;EACA,KAAA,EAAO,aAAA;EACP,KAAA,EAAO,MAAA;AAAA;;;;UAMQ,YAAA,SAAqB,gBAAA;EACpC,IAAA;EACA,OAAA;AAAA;;;;UAMe,YAAA,SAAqB,gBAAA;EACpC,IAAA;EACA,MAAA,EAAQ,MAAA,CAAO,WAAA;AAAA;AApBjB;;;AAAA,KA0BY,YAAA,GAAe,eAAA,GAAkB,YAAA,GAAe,YAAA"}
@@ -1,4 +1,4 @@
1
- import { n as ReadableSignal } from "./types-DlNR9ZaJ.mjs";
1
+ import { n as ReadableSignal } from "./types-BlaUrkq0.mjs";
2
2
 
3
3
  //#region ../style/src/types.d.ts
4
4
  /**
@@ -61,4 +61,4 @@ interface RegistryOptions {
61
61
  }
62
62
  //#endregion
63
63
  export { SignalBindingDef as a, RegistryOptions as i, ClassRefs as n, StyleToken as o, InjectOptions as r, ClassRef as t };
64
- //# sourceMappingURL=types-DEi0apQO.d.mts.map
64
+ //# sourceMappingURL=types-DucvOZQ2.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-DEi0apQO.d.mts","names":[],"sources":["../../style/src/types.ts"],"mappings":";;;;;;UASiB,QAAA;EAUjB;EAAA,SARW,EAAA;;EAET,QAAA;AAAA;;;;KAMU,SAAA,iDACK,CAAA,WAAY,QAAA;;AAO7B;;;UAAiB,gBAAA;;EAEf,MAAA,EAAQ,cAAA;;EAER,KAAA;AAAA;AAUF;;;;;;;AAAA,UAAiB,UAAA;;WAEN,MAAA;;WAEA,CAAA;EAYX;EAAA,SAVW,aAAA;;WAEA,aAAA,GAAgB,gBAAA;;EAEzB,QAAA;AAAA;;;AAcF;UARiB,aAAA;;EAEf,MAAA,GAAS,OAAA,GAAU,UAAA;AAAA;;;;UAMJ,eAAA;EAIf;EAFA,MAAA,GAAS,OAAA,GAAU,UAAA;;EAEnB,MAAA;AAAA"}
1
+ {"version":3,"file":"types-DucvOZQ2.d.mts","names":[],"sources":["../../style/src/types.ts"],"mappings":";;;;;;UASiB,QAAA;EAUjB;EAAA,SARW,EAAA;;EAET,QAAA;AAAA;;;;KAMU,SAAA,iDACK,CAAA,WAAY,QAAA;;AAO7B;;;UAAiB,gBAAA;;EAEf,MAAA,EAAQ,cAAA;;EAER,KAAA;AAAA;AAUF;;;;;;;AAAA,UAAiB,UAAA;;WAEN,MAAA;;WAEA,CAAA;EAYX;EAAA,SAVW,aAAA;;WAEA,aAAA,GAAgB,gBAAA;;EAEzB,QAAA;AAAA;;;AAcF;UARiB,aAAA;;EAEf,MAAA,GAAS,OAAA,GAAU,UAAA;AAAA;;;;UAMJ,eAAA;EAIf;EAFA,MAAA,GAAS,OAAA,GAAU,UAAA;;EAEnB,MAAA;AAAA"}
@@ -26,4 +26,4 @@ function unwrap(value) {
26
26
 
27
27
  //#endregion
28
28
  export { unwrap as n, isSignal as t };
29
- //# sourceMappingURL=utils-BrGmTgfG.mjs.map
29
+ //# sourceMappingURL=utils-DbTAs943.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-BrGmTgfG.mjs","names":[],"sources":["../../signal/src/utils.ts"],"sourcesContent":["import type { ReadableSignal, MaybeSignal } from \"./types\";\n\n/**\n * Check if a value is a signal\n *\n * Uses duck typing to check for the minimal signal interface:\n * - has a `value` property\n * - has a `subscribe` method\n */\nexport function isSignal<T = unknown>(value: unknown): value is ReadableSignal<T> {\n return (\n value != null &&\n typeof value === \"object\" &&\n \"value\" in value &&\n \"subscribe\" in value &&\n typeof value.subscribe === \"function\"\n );\n}\n\n/**\n * Unwrap a signal or return the value as-is\n *\n * Useful for accepting both static values and signals:\n * @example\n * ```ts\n * function Component(props: { count: MaybeSignal<number> }) {\n * const value = unwrap(props.count); // Always get the current value\n * }\n * ```\n */\nexport function unwrap<T>(value: MaybeSignal<T>): T {\n return isSignal(value) ? value.value : value;\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,SAAsB,OAA4C;AAChF,QACE,SAAS,QACT,OAAO,UAAU,YACjB,WAAW,SACX,eAAe,SACf,OAAO,MAAM,cAAc;;;;;;;;;;;;;AAe/B,SAAgB,OAAU,OAA0B;AAClD,QAAO,SAAS,MAAM,GAAG,MAAM,QAAQ"}
1
+ {"version":3,"file":"utils-DbTAs943.mjs","names":[],"sources":["../../signal/src/utils.ts"],"sourcesContent":["import type { ReadableSignal, MaybeSignal } from \"./types\";\n\n/**\n * Check if a value is a signal\n *\n * Uses duck typing to check for the minimal signal interface:\n * - has a `value` property\n * - has a `subscribe` method\n */\nexport function isSignal<T = unknown>(value: unknown): value is ReadableSignal<T> {\n return (\n value != null &&\n typeof value === \"object\" &&\n \"value\" in value &&\n \"subscribe\" in value &&\n typeof value.subscribe === \"function\"\n );\n}\n\n/**\n * Unwrap a signal or return the value as-is\n *\n * Useful for accepting both static values and signals:\n * @example\n * ```ts\n * function Component(props: { count: MaybeSignal<number> }) {\n * const value = unwrap(props.count); // Always get the current value\n * }\n * ```\n */\nexport function unwrap<T>(value: MaybeSignal<T>): T {\n return isSignal(value) ? value.value : value;\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,SAAsB,OAA4C;AAChF,QACE,SAAS,QACT,OAAO,UAAU,YACjB,WAAW,SACX,eAAe,SACf,OAAO,MAAM,cAAc;;;;;;;;;;;;;AAe/B,SAAgB,OAAU,OAA0B;AAClD,QAAO,SAAS,MAAM,GAAG,MAAM,QAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semajsx",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "A signal-based reactive JSX runtime for building modern web applications",
5
5
  "keywords": [
6
6
  "framework",
@@ -23,21 +23,74 @@
23
23
  "type": "module",
24
24
  "types": "./dist/index.d.mts",
25
25
  "exports": {
26
- ".": "./dist/index.mjs",
27
- "./dom": "./dist/dom/index.mjs",
28
- "./dom/jsx-dev-runtime": "./dist/dom/jsx-dev-runtime.mjs",
29
- "./dom/jsx-runtime": "./dist/dom/jsx-runtime.mjs",
30
- "./signal": "./dist/signal/index.mjs",
31
- "./ssg": "./dist/ssg/index.mjs",
32
- "./ssr": "./dist/ssr/index.mjs",
33
- "./ssr/client": "./dist/ssr/client.mjs",
34
- "./style": "./dist/style/index.mjs",
35
- "./style/react": "./dist/style/react.mjs",
36
- "./style/vue": "./dist/style/vue.mjs",
37
- "./tailwind": "./dist/tailwind/index.mjs",
38
- "./terminal": "./dist/terminal/index.mjs",
39
- "./terminal/jsx-dev-runtime": "./dist/terminal/jsx-dev-runtime.mjs",
40
- "./terminal/jsx-runtime": "./dist/terminal/jsx-runtime.mjs",
26
+ ".": {
27
+ "source": "./src/index.ts",
28
+ "default": "./dist/index.mjs"
29
+ },
30
+ "./dom": {
31
+ "source": "./src/dom/index.ts",
32
+ "default": "./dist/dom/index.mjs"
33
+ },
34
+ "./dom/jsx-dev-runtime": {
35
+ "source": "./src/dom/jsx-dev-runtime.ts",
36
+ "default": "./dist/dom/jsx-dev-runtime.mjs"
37
+ },
38
+ "./dom/jsx-runtime": {
39
+ "source": "./src/dom/jsx-runtime.ts",
40
+ "default": "./dist/dom/jsx-runtime.mjs"
41
+ },
42
+ "./signal": {
43
+ "source": "./src/signal/index.ts",
44
+ "default": "./dist/signal/index.mjs"
45
+ },
46
+ "./ssg": {
47
+ "source": "./src/ssg/index.ts",
48
+ "default": "./dist/ssg/index.mjs"
49
+ },
50
+ "./ssg/plugins/docs-theme": {
51
+ "source": "./src/ssg/plugins/docs-theme.ts",
52
+ "default": "./dist/ssg/plugins/docs-theme.mjs"
53
+ },
54
+ "./ssg/plugins/lucide": {
55
+ "source": "./src/ssg/plugins/lucide.ts",
56
+ "default": "./dist/ssg/plugins/lucide.mjs"
57
+ },
58
+ "./ssr": {
59
+ "source": "./src/ssr/index.ts",
60
+ "default": "./dist/ssr/index.mjs"
61
+ },
62
+ "./ssr/client": {
63
+ "source": "./src/ssr/client.ts",
64
+ "default": "./dist/ssr/client.mjs"
65
+ },
66
+ "./style": {
67
+ "source": "./src/style/index.ts",
68
+ "default": "./dist/style/index.mjs"
69
+ },
70
+ "./style/react": {
71
+ "source": "./src/style/react.ts",
72
+ "default": "./dist/style/react.mjs"
73
+ },
74
+ "./style/vue": {
75
+ "source": "./src/style/vue.ts",
76
+ "default": "./dist/style/vue.mjs"
77
+ },
78
+ "./tailwind": {
79
+ "source": "./src/tailwind/index.ts",
80
+ "default": "./dist/tailwind/index.mjs"
81
+ },
82
+ "./terminal": {
83
+ "source": "./src/terminal/index.ts",
84
+ "default": "./dist/terminal/index.mjs"
85
+ },
86
+ "./terminal/jsx-dev-runtime": {
87
+ "source": "./src/terminal/jsx-dev-runtime.ts",
88
+ "default": "./dist/terminal/jsx-dev-runtime.mjs"
89
+ },
90
+ "./terminal/jsx-runtime": {
91
+ "source": "./src/terminal/jsx-runtime.ts",
92
+ "default": "./dist/terminal/jsx-runtime.mjs"
93
+ },
41
94
  "./package.json": "./package.json"
42
95
  },
43
96
  "publishConfig": {
@@ -49,6 +102,8 @@
49
102
  "./dom/jsx-runtime": "./dist/dom/jsx-runtime.mjs",
50
103
  "./signal": "./dist/signal/index.mjs",
51
104
  "./ssg": "./dist/ssg/index.mjs",
105
+ "./ssg/plugins/docs-theme": "./dist/ssg/plugins/docs-theme.mjs",
106
+ "./ssg/plugins/lucide": "./dist/ssg/plugins/lucide.mjs",
52
107
  "./ssr": "./dist/ssr/index.mjs",
53
108
  "./ssr/client": "./dist/ssr/client.mjs",
54
109
  "./style": "./dist/style/index.mjs",
@@ -72,8 +127,6 @@
72
127
  "test:coverage": "vitest run --coverage --config vitest.unit.config.ts",
73
128
  "test:terminal": "vitest run tests/terminal --config vitest.unit.config.ts",
74
129
  "clean": "rm -rf dist",
75
- "prepack": "node scripts/prepack.mjs",
76
- "postpack": "git checkout -- package.json",
77
130
  "prepublishOnly": "bun run build"
78
131
  },
79
132
  "dependencies": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-OGuk9jhK.mjs","names":[],"sources":["../../ssr/src/document.tsx"],"sourcesContent":["/** @jsxImportSource @semajsx/dom */\n\nimport { Fragment } from \"@semajsx/core\";\nimport type { DocumentTemplate } from \"./shared/types\";\n\n/**\n * Default HTML document template\n *\n * This is a simple, production-ready HTML5 document template.\n * You can customize it by providing your own document template to the router.\n *\n * @example\n * ```tsx\n * const router = createViteRouter(routes, {\n * document: DefaultDocument,\n * title: \"My App\" // Required if using DefaultDocument\n * });\n * ```\n */\nexport const DefaultDocument: DocumentTemplate = ({ children, scripts, css, title }) => (\n <html lang=\"en\">\n <head>\n <meta charSet=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n {title && <title>{title}</title>}\n {css.map((href) => (\n <link key={href} rel=\"stylesheet\" href={href} />\n ))}\n </head>\n <body>\n {children}\n {scripts}\n </body>\n </html>\n);\n\n/**\n * Render a document VNode to a complete HTML string\n * Prepends <!DOCTYPE html> to the rendered output\n *\n * @param documentVNode - The document VNode (should be <html> element)\n * @returns Complete HTML string with doctype\n */\nexport function renderDocument(documentVNode: any): string {\n // Import renderToString from render.ts\n // We can't import it directly to avoid circular dependencies\n // So we use a simple HTML renderer for the document shell\n\n const html = renderDocumentVNode(documentVNode);\n return `<!DOCTYPE html>\\n${html}`;\n}\n\n/**\n * Simple HTML renderer for document structure\n * This handles the outer HTML/head/body structure without islands\n */\nfunction renderDocumentVNode(vnode: any): string {\n if (vnode == null) {\n return \"\";\n }\n\n if (typeof vnode === \"string\" || typeof vnode === \"number\") {\n const str = String(vnode);\n // Check if it's already rendered HTML (starts with < or contains HTML tags)\n if (str.startsWith(\"<\") || str.includes(\"</\")) {\n return str;\n }\n return escapeHTML(str);\n }\n\n if (typeof vnode === \"boolean\") {\n return \"\";\n }\n\n if (Array.isArray(vnode)) {\n return vnode.map((child) => renderDocumentVNode(child)).join(\"\");\n }\n\n if (typeof vnode !== \"object\" || !(\"type\" in vnode)) {\n return \"\";\n }\n\n const { type, props, children } = vnode;\n\n // Handle dangerouslySetInnerHTML (for raw HTML injection)\n if (props?.dangerouslySetInnerHTML?.__html) {\n return props.dangerouslySetInnerHTML.__html;\n }\n\n // Handle Fragment (Symbol type)\n if (type === Fragment) {\n return (children || []).map((child: any) => renderDocumentVNode(child)).join(\"\");\n }\n\n // Handle special VNode types\n if (typeof type === \"string\") {\n // Handle internal node types like #text, #signal\n if (type.startsWith(\"#\")) {\n if (type === \"#text\") {\n const value = props?.nodeValue ?? \"\";\n // Check if it's already rendered HTML\n if (typeof value === \"string\" && (value.startsWith(\"<\") || value.includes(\"</\"))) {\n return value;\n }\n return escapeHTML(String(value));\n }\n // For #signal and other special types, render children\n return (children || []).map((child: any) => renderDocumentVNode(child)).join(\"\");\n }\n return renderElement(type, props, children);\n }\n\n if (typeof type === \"function\") {\n const result = type(props || {});\n return renderDocumentVNode(result);\n }\n\n return \"\";\n}\n\n/**\n * Render an HTML element\n */\nfunction renderElement(tag: string, props: any, children: any[]): string {\n const attrs = renderAttributes(props || {});\n\n // Self-closing tags\n const selfClosing = [\"meta\", \"link\", \"br\", \"hr\", \"img\", \"input\"];\n if (selfClosing.includes(tag)) {\n return `<${tag}${attrs} />`;\n }\n\n const childrenHTML = (children || []).map((child) => renderDocumentVNode(child)).join(\"\");\n\n return `<${tag}${attrs}>${childrenHTML}</${tag}>`;\n}\n\n/**\n * Render attributes\n */\nfunction renderAttributes(props: Record<string, any>): string {\n const attrs: string[] = [];\n\n for (const [key, value] of Object.entries(props)) {\n if (key === \"children\" || key === \"key\" || key === \"ref\" || key === \"dangerouslySetInnerHTML\") {\n continue;\n }\n\n if (value == null || value === false) {\n continue;\n }\n\n // Boolean attributes\n if (value === true) {\n attrs.push(key);\n continue;\n }\n\n // Map React attribute names to HTML\n const attrName =\n key === \"className\"\n ? \"class\"\n : key === \"htmlFor\"\n ? \"for\"\n : key === \"charSet\"\n ? \"charset\"\n : key;\n\n attrs.push(`${attrName}=\"${escapeHTML(String(value))}\"`);\n }\n\n return attrs.length > 0 ? \" \" + attrs.join(\" \") : \"\";\n}\n\n/**\n * Escape HTML special characters\n */\nfunction escapeHTML(str: string): string {\n return str\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#39;\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,MAAa,mBAAqC,EAAE,UAAU,SAAS,KAAK,YAC1E,qBAAC;CAAK,MAAK;YACT,qBAAC;EACC,oBAAC,UAAK,SAAQ,UAAU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ment, a as jsxs, i as jsx } from "./src-BlS3Hc-L.mjs";
2
- import "./jsx-runtime-D9ZNjMJ2.mjs";
3
-
4
- export { Fragment, jsx, jsxs };
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource-B1IudM8_.d.mts","names":[],"sources":["../../ssr/src/shared/types.ts","../../ssr/src/client/resource.ts"],"mappings":";;;;;;AAMA;UAAiB,cAAA;;EAEf,EAAA;;EAEA,IAAA;;EAEA,KAAA,EAAO,MAAA;;EAEP,aAAA;AAAA;AAMF;;;AAAA,UAAiB,mBAAA;;EAEf,EAAA;;EAEA,IAAA;;EAEA,KAAA,EAAO,MAAA;;EAEP,aAAA;EASF;EAPE,QAAA;AAAA;;;AAYF;;KALY,uBAAA,IAA2B,OAAA,EAAS,mBAAA;;;;UAK/B,qBAAA;;;AAiBjB;;;EAXE,qBAAA,GAAwB,uBAAA;;;;;EAKxB,OAAA;AAAA;;;;UAMe,SAAA;EAkBA;EAhBf,IAAA;EAgBe;EAdf,OAAA,EAAS,cAAA;;EAET,OAAA;;EAEA,QAAA;EAmBF;EAjBE,GAAA;;EAEA,MAAA;AAAA;AAuBF;;;AAAA,UAjBiB,YAAA;EACf,IAAA;EACA,GAAA;EACA,EAAA;AAAA;;;AA8BF;UAxBiB,aAAA;EACf,GAAA;EACA,IAAA;AAAA;;;;UAMe,YAAA;EAoBR;EAlBP,UAAA;EAwBU;EAtBV,SAAA,EAAW,QAAA;EAsByC;EApBpD,KAAA;AAAA;;;;UAUe,YAAA;EAeA;EAbf,MAAA,EAAQ,MAAA;EAaO;EAXf,KAAA,EAAO,MAAA;AAAA;;;;KAMG,YAAA,IAAgB,OAAA,EAAS,YAAA,KAAiB,KAAA;;;;UAKrC,SAAA;EAyBX;EAvBJ,KAAA;;GAAA,GAAA;AAAA;;;;KAQU,gBAAA,IAAoB,KAAA;6DAE9B,QAAA,EAAU,OAAA;EAEV,OAAA,EAAS,OAAA;EAET,OAAA,EAAS,cAAA,IASL;EAPJ,GAAA,YAYe;E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O,IAAA,WAAe,OAAA,CAAQ,YAAA;;EAG9B,GAAA,CAAI,OAAA,GAAU,UAAA,GAAa,OAAA;IAAU,IAAA;IAAc,KAAA,QAAa,OAAA;EAAA;;EAGhE,KAAA,CAAM,OAAA,GAAU,YAAA,GAAe,OAAA,CAAQ,WAAA;;EAGvC,aAAA,CAAc,OAAA,EAAS,OAAA,GAAU,OAAA,CAAQ,QAAA;;EAGzC,aAAA,IAAiB,aAAA;;EAGjB,mBAAA,CAAoB,QAAA,WAAmB,OAAA;;EAGvC,SAAA,CAAU,QAAA,WAAmB,cAAA;AAAA;;;;;;cC/UlB,YAAA;AAAA,cACA,WAAA;AAAA,cACA,YAAA;;;;UAKI,UAAA;EACf,IAAA;AAAA;;;ADMF;UCAiB,SAAA;EACf,IAAA;EACA,GAAA;EACA,EAAA;AAAA;;;;UAMe,UAAA;EACf,GAAA;EACA,IAAA;AAAA;;;;UAMe,aAAA;EDKjB;ECHE,KAAA,GAAQ,KAAA,EAAO,UAAA,KAAe,KAAA;;EAE9B,IAAA,GAAO,KAAA,EAAO,SAAA,KAAc,KAAA;;EAE5B,KAAA,GAAQ,KAAA,EAAO,UAAA,KAAe,KAAA;;EAE9B,GAAA,GAAM,IAAA;EDQN;ECNA,MAAA,aAAmB,SAAA,OAAgB,SAAA,EAAW,CAAA,EAAG,IAAA,cAAkB,CAAA;AAAA;;;;;;;;;;;;AD8BrE;;;;;;;;;AASA;;;;;AAQA;;iBCjBgB,QAAA,CAAS,OAAA,WAAkB,aAAA;;;;iBA+E3B,YAAA,CAAa,KAAA,EAAO,KAAA;;;;iBAOpB,WAAA,CAAY,KAAA,EAAO,KAAA;;;;iBAOnB,YAAA,CAAa,KAAA,EAAO,KAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"src-BlS3Hc-L.mjs","names":[],"sources":["../../core/src/types.ts","../../core/src/vnode.ts","../../core/src/shared/island-marker.ts","../../core/src/context.ts","../../core/src/helpers.ts","../../core/src/jsx.ts","../../core/src/component.ts","../../core/src/render-core.ts"],"sourcesContent":["import type { ReadableSignal, WritableSignal } from \"./signal\";\n\n/**\n * Special VNode type for fragment support\n */\nexport const Fragment: symbol = Symbol.for(\"semajsx.fragment\");\n\n/**\n * Special VNode type for portal support\n */\nexport const Portal: symbol = Symbol.for(\"semajsx.portal\");\n\n/**\n * VNode types\n * - The runtime VNode tree always resolves to these `type` values\n */\nexport type VNodeType = string | Component<any> | typeof Fragment | typeof Portal;\n\n/**\n * VNode: The basic unit of the runtime render tree\n * - `type`: the element/component type\n * - `props`: attributes or props passed to the node (may be null)\n * - `children`: resolved child nodes (always normalized to VNode[] at render time)\n */\nexport interface VNode {\n type: VNodeType;\n props: Record<string, any> | null;\n children: VNode[];\n key?: string | number | null;\n}\n\n/**\n * Primitive values allowed in JSX\n * - These are normalized during VNode construction\n */\nexport type JSXPrimitive = string | number | boolean | null | undefined;\n\n/**\n * A JSXNode represents any valid \"JSX expression result\"\n * - Could be a raw VNode/primitive, or wrapped in a reactive/async container\n */\nexport type JSXNode =\n | VNode\n | JSXPrimitive\n | Iterable<JSXNode>\n | ReadableSignal<JSXNode>\n | Promise<JSXNode>\n | AsyncIterableIterator<JSXNode>;\n\n/**\n * Component type\n * - Optional `ctx` parameter allows passing in custom API/runtime helpers\n */\nexport type Component<P = any> = (props: P, ctx?: ComponentAPI) => JSXNode;\n\n/**\n * ComponentAPI - Runtime API available to components via second parameter\n */\nexport interface ComponentAPI {\n /**\n * Inject a context value\n * @param context - The context to inject\n * @returns The current value of the context, or undefined if not provided\n */\n inject<T>(context: Context<T>): T | undefined;\n}\n\n/**\n * Ref types\n */\n\n/**\n * Ref - can be a WritableSignal or a callback function\n * This allows both reactive refs and imperative refs\n */\nexport type Ref<T> = WritableSignal<T | null> | ((instance: T | null) => void);\n\n/**\n * Context types\n */\n\n/**\n * Context - a typed Symbol for identifying context\n */\nexport type Context<T> = symbol & { __type?: T };\n\n/**\n * Context provide entry: [Context, value]\n */\nexport type ContextProvide<T = any> = [Context<T>, T];\n\n/**\n * Context component props - supports single or multiple context provides\n */\nexport interface ContextProps {\n // Single context: [ThemeContext, theme]\n // Multiple contexts: [[ThemeContext, theme], [UserContext, user]]\n provide: ContextProvide | ContextProvide[];\n children?: JSXNode;\n}\n\n/**\n * Helper type to allow Signal values for any attribute\n */\nexport type SignalOr<T> = T | ReadableSignal<T>;\n\n/**\n * Makes all properties in T accept Signal values\n * Excludes event handlers (functions) and children\n */\nexport type WithSignals<T> = {\n [K in keyof T]: K extends `on${string}`\n ? T[K] // Event handlers don't need Signal wrapper\n : K extends \"children\"\n ? T[K] // Children handled separately\n : T[K] extends (...args: any[]) => any\n ? T[K] // Other functions don't need Signal wrapper\n : SignalOr<T[K]>;\n};\n\n/**\n * Adds key property to element attributes for list reconciliation\n */\nexport type WithKey<T> = T & {\n key?: string | number;\n};\n","import type { JSXNode, VNode, VNodeType } from \"./types\";\nimport type { Signal } from \"@semajsx/signal\";\nimport { Fragment } from \"./types\";\nimport { isSignal } from \"@semajsx/signal\";\n\n/**\n * Create a VNode (Virtual Node)\n */\nexport function h(\n type: VNodeType,\n props: Record<string, any> | null,\n ...children: JSXNode[]\n): VNode {\n return {\n type,\n props: props || {},\n children: normalizeChildren(children),\n key: props?.key,\n };\n}\n\n/**\n * Create a text VNode\n */\nexport function createTextVNode(text: string | number): VNode {\n return {\n type: \"#text\",\n props: { nodeValue: String(text) },\n children: [],\n };\n}\n\n/**\n * Create a signal VNode wrapper\n */\nexport function createSignalVNode(signal: Signal<unknown>): VNode {\n return {\n type: \"#signal\",\n props: { signal },\n children: [],\n };\n}\n\n/**\n * Normalize children into an array of VNodes\n */\nfunction normalizeChildren(children: JSXNode[]): VNode[] {\n const result: VNode[] = [];\n\n for (const child of children) {\n if (child == null || typeof child === \"boolean\") {\n // Skip nullish and boolean values\n continue;\n }\n\n if (Array.isArray(child)) {\n // Recursively flatten arrays\n result.push(...normalizeChildren(child));\n } else if (typeof child === \"string\" || typeof child === \"number\") {\n // Convert primitives to text nodes\n result.push(createTextVNode(child));\n } else if (isSignal(child)) {\n // Wrap signals in special signal nodes\n result.push(createSignalVNode(child));\n } else if (isVNode(child)) {\n // Already a VNode\n result.push(child);\n } else {\n // Unknown type, skip\n console.warn(\"Unknown child type:\", typeof child);\n }\n }\n\n return result;\n}\n\n/**\n * Check if a value is a VNode\n */\nexport function isVNode(value: unknown): value is VNode {\n return (\n value != null &&\n typeof value === \"object\" &&\n \"type\" in value &&\n \"props\" in value &&\n \"children\" in value\n );\n}\n\n/**\n * Create a Fragment\n */\nexport function createFragment(children: JSXNode[]): VNode {\n return h(Fragment, null, ...children);\n}\n","/**\n * Unique symbol to mark Island components\n * This symbol is used to identify components that should be hydrated on the client\n */\nexport const ISLAND_MARKER: symbol = Symbol.for(\"semajsx.island\");\n","/**\n * Context API implementation\n */\n\nimport { h } from \"./vnode\";\nimport { Fragment } from \"./types\";\nimport type { ComponentAPI, Context as ContextType, ContextProps, VNode } from \"./types\";\n\n// Context map type - stores context values for current render environment\nexport type ContextMap = Map<symbol, any>;\n\n/**\n * Create a new Context (returns a typed Symbol)\n *\n * @param name - Optional name for debugging (defaults to \"anonymous\")\n * @returns Context symbol\n *\n * @example\n * ```typescript\n * const ThemeContext = context<Theme>();\n * const UserContext = context<User>('user'); // With debug name\n *\n * <Context provide={[ThemeContext, theme]}>\n * <App />\n * </Context>\n * ```\n */\nexport function context<T>(name?: string): ContextType<T> {\n const debugName = name || \"anonymous\";\n return Symbol(debugName) as ContextType<T>;\n}\n\n/**\n * Context component - provides context values to child components\n *\n * @example\n * ```typescript\n * // Single context\n * <Context provide={[ThemeContext, theme]}>\n * <App />\n * </Context>\n *\n * // Multiple contexts\n * <Context provide={[\n * [ThemeContext, theme],\n * [UserContext, user]\n * ]}>\n * <App />\n * </Context>\n * ```\n */\nexport function Context(props: ContextProps): VNode {\n const children = props.children\n ? Array.isArray(props.children)\n ? props.children\n : [props.children]\n : [];\n return h(Fragment, null, ...children);\n}\n\n// Mark as special context provider component\n(Context as any).__isContextProvider = true;\n\n/**\n * Create ComponentAPI instance for a component\n *\n * @param contextMap - The context map for current render environment\n * @returns ComponentAPI instance\n */\nexport function createComponentAPI(contextMap: ContextMap): ComponentAPI {\n return {\n inject<T>(context: ContextType<T>): T | undefined {\n return contextMap.get(context);\n },\n };\n}\n","import type { JSXNode } from \"./types\";\nimport type { Signal } from \"@semajsx/signal\";\nimport { computed, signal } from \"@semajsx/signal\";\n\n/**\n * Conditional rendering helper\n *\n * Renders content when condition signal is true, nothing when false.\n *\n * @example\n * // With VNode\n * const hint = when(showHint, <text>Press Ctrl+C to exit</text>);\n *\n * @example\n * // With function (lazy evaluation)\n * const hint = when(showHint, () => <text>Press Ctrl+C to exit</text>);\n */\nexport function when(\n condition: Signal<boolean>,\n content: JSXNode | (() => JSXNode),\n): Signal<JSXNode | null> {\n return computed([condition], (show) => {\n if (!show) return null;\n return typeof content === \"function\" ? content() : content;\n });\n}\n\n/**\n * Async resource helper for Promise<VNode>\n *\n * Renders pending content (or null) while the promise is pending, then renders\n * the resolved VNode. Handle errors in the promise itself using .catch().\n *\n * @example\n * // Handle everything in the promise\n * const content = resource(\n * fetchData()\n * .then(data => <text>{data}</text>)\n * .catch(err => <text color=\"red\">Error: {err.message}</text>)\n * );\n *\n * @example\n * // With optional pending content\n * const content = resource(\n * fetchData().then(data => <text>{data}</text>),\n * <text>Loading...</text>\n * );\n */\nexport function resource(promise: Promise<JSXNode>, pending?: JSXNode): Signal<JSXNode | null> {\n const content = signal<JSXNode | null>(pending || null);\n\n promise\n .then((result) => {\n content.value = result;\n })\n .catch((err) => {\n console.error(\"Unhandled promise rejection in resource():\", err);\n });\n\n return content;\n}\n\n/**\n * Async stream helper for AsyncIterable<VNode>\n *\n * Renders each yielded VNode from the async iterator, replacing the previous\n * content with each new value.\n *\n * @example\n * async function* generateContent() {\n * yield <text>Loading...</text>;\n * const data = await fetchData();\n * yield <text>Data: {data}</text>;\n * }\n *\n * const content = stream(generateContent());\n */\nexport function stream(\n iterator: AsyncIterable<JSXNode>,\n pending?: JSXNode,\n): Signal<JSXNode | null> {\n const content = signal<JSXNode | null>(pending || null);\n\n (async () => {\n try {\n for await (const vnode of iterator) {\n content.value = vnode;\n }\n } catch (err) {\n console.error(\"Error in stream():\", err);\n }\n })();\n\n return content;\n}\n","import { VNode, VNodeType } from \"./types\";\nimport { h } from \"./vnode\";\n\nexport function jsx(type: VNodeType, props: any, key?: any): VNode {\n const { children, ...restProps } = props || {};\n\n if (key !== undefined) {\n restProps.key = key;\n }\n\n if (children !== undefined) {\n return h(type, restProps, children);\n }\n\n return h(type, restProps);\n}\n\nexport function jsxs(type: VNodeType, props: any, key?: any): VNode {\n const { children, ...restProps } = props || {};\n\n if (key !== undefined) {\n restProps.key = key;\n }\n\n if (children !== undefined) {\n const childArray = Array.isArray(children) ? children : [children];\n return h(type, restProps, ...childArray);\n }\n\n return h(type, restProps);\n}\n","import type { JSXNode, JSXPrimitive, VNode } from \"./types\";\nimport { Fragment } from \"./types\";\nimport { isSignal } from \"@semajsx/signal\";\nimport { createSignalVNode, createTextVNode, isVNode } from \"./vnode\";\n\n/**\n * Normalize the `children` prop passed to components so it mirrors React semantics.\n * - 0 children => undefined\n * - 1 child => the child itself\n * - >1 children => array\n */\nexport function normalizeChildrenProp(children: VNode[]): VNode | VNode[] | undefined {\n if (children.length === 0) {\n return undefined;\n }\n if (children.length === 1) {\n return children[0];\n }\n return children;\n}\n\n/**\n * Normalize any JSXNode result from a component into a concrete VNode.\n */\nexport function normalizeComponentResult(result: VNode | JSXPrimitive | Iterable<JSXNode>): VNode {\n if (isVNode(result)) {\n return result;\n }\n\n if (typeof result === \"string\" || typeof result === \"number\") {\n return createTextVNode(result);\n }\n\n if (result == null || typeof result === \"boolean\") {\n return createTextVNode(\"\");\n }\n\n if (Array.isArray(result) || isIterable(result)) {\n const normalizedChildren = normalizeIterableChildren(result);\n return {\n type: Fragment,\n props: {},\n children: normalizedChildren,\n };\n }\n\n throw new Error(`Invalid component return type: ${typeof result}`);\n}\n\nfunction normalizeIterableChildren(children: Iterable<JSXNode>): VNode[] {\n const normalized: VNode[] = [];\n\n for (const child of children) {\n if (child == null || typeof child === \"boolean\") {\n continue;\n }\n\n if (Array.isArray(child) || isIterable(child)) {\n normalized.push(...normalizeIterableChildren(child as Iterable<JSXNode>));\n continue;\n }\n\n if (typeof child === \"string\" || typeof child === \"number\") {\n normalized.push(createTextVNode(child));\n continue;\n }\n\n if (isSignal(child)) {\n normalized.push(createSignalVNode(child));\n continue;\n }\n\n if (isVNode(child)) {\n normalized.push(child);\n continue;\n }\n\n throw new Error(`Invalid child in iterable: ${typeof child}`);\n }\n\n return normalized;\n}\n\nfunction isIterable(value: unknown): value is Iterable<unknown> {\n return value != null && typeof (value as any)[Symbol.iterator] === \"function\";\n}\n","import type { VNode, Ref } from \"./types\";\nimport { Fragment, Portal } from \"./types\";\nimport { isSignal } from \"@semajsx/signal\";\nimport { isVNode } from \"./vnode\";\nimport { resource, stream } from \"./helpers\";\nimport { type ContextMap, createComponentAPI } from \"./context\";\nimport { normalizeChildrenProp, normalizeComponentResult } from \"./component\";\n\n/**\n * Generic rendered node structure\n */\nexport interface RenderedNode<TNode> {\n vnode: VNode;\n node: TNode | null;\n subscriptions: Array<() => void>;\n children: RenderedNode<TNode>[];\n}\n\n/**\n * Operations strategy for different rendering targets\n */\nexport interface RenderStrategy<TNode> {\n /**\n * Create a text node\n */\n createTextNode(text: string): TNode;\n\n /**\n * Create a comment node (used for markers)\n */\n createComment(text: string): TNode;\n\n /**\n * Create an element node\n */\n createElement(type: string): TNode;\n\n /**\n * Get the parent node of a node\n */\n getParent(node: TNode): TNode | null;\n\n /**\n * Get the next sibling of a node\n */\n getNextSibling(node: TNode): TNode | null;\n\n /**\n * Insert a node before another node\n */\n insertBefore(parent: TNode, newNode: TNode, beforeNode: TNode | null): void;\n\n /**\n * Append child to parent\n */\n appendChild(parent: TNode, child: TNode): void;\n\n /**\n * Remove child from its parent\n */\n removeChild(node: TNode): void;\n\n /**\n * Replace old node with new node\n */\n replaceNode(oldNode: TNode, newNode: TNode): void;\n\n /**\n * Set a property on a node\n */\n setProperty(node: TNode, key: string, value: unknown): void;\n\n /**\n * Set a signal property on a node (returns unsubscribe function)\n */\n setSignalProperty(node: TNode, key: string, signal: any): () => void;\n\n /**\n * Optional: Set a ref on a node (returns cleanup function)\n * This is only used for DOM rendering\n */\n setRef?(node: TNode, ref: Ref<TNode>): () => void;\n\n /**\n * Optional: Try to reuse an existing node instead of replacing it\n * Returns true if the node was successfully reused\n * This is used for DOM optimization but not needed for terminal\n */\n tryReuseNode?(\n oldNode: TNode,\n newNode: TNode,\n oldRendered: RenderedNode<TNode>,\n newRendered: RenderedNode<TNode>,\n ): boolean;\n}\n\n/**\n * Check if a value is a Promise\n */\nexport function isPromise<T>(value: any): value is Promise<T> {\n return value && typeof value.then === \"function\";\n}\n\n/**\n * Check if a value is an AsyncIterator\n */\nexport function isAsyncIterator<T>(value: any): value is AsyncIterableIterator<T> {\n return value && typeof value[Symbol.asyncIterator] === \"function\";\n}\n\n/**\n * Core rendering logic - works for both DOM and Terminal\n */\nexport function createRenderer<TNode>(strategy: RenderStrategy<TNode>): {\n renderNode: (vnode: VNode, parentContext: ContextMap) => RenderedNode<TNode>;\n unmount: (node: RenderedNode<TNode>) => void;\n cleanupSubscriptions: (node: RenderedNode<TNode>) => void;\n} {\n /**\n * Helper to recursively collect all actual DOM nodes from a rendered node\n * Handles fragments and signal nodes that may not have their own DOM node\n */\n function collectNodes(rendered: RenderedNode<TNode>): TNode[] {\n const nodes: TNode[] = [];\n\n // Fragment: no node, only children\n if (rendered.vnode.type === Fragment) {\n for (const child of rendered.children) {\n nodes.push(...collectNodes(child));\n }\n return nodes;\n }\n\n // Portal: children are rendered into a different container,\n // so they should not be collected in the parent tree\n if (rendered.vnode.type === Portal) {\n return nodes;\n }\n\n // Signal marker: include marker node + content children\n if (rendered.vnode.type === \"#signal\") {\n if (rendered.node) {\n nodes.push(rendered.node); // marker\n }\n // Collect content children (after marker)\n for (const child of rendered.children) {\n nodes.push(...collectNodes(child));\n }\n return nodes;\n }\n\n // Regular elements and text nodes: just the node itself\n // Children are already attached to the node\n if (rendered.node) {\n nodes.push(rendered.node);\n }\n\n return nodes;\n }\n\n /**\n * Render a single VNode\n */\n function renderNode(vnode: VNode, parentContext: ContextMap): RenderedNode<TNode> {\n const { type } = vnode;\n\n // Text node\n if (type === \"#text\") {\n return renderTextNode(vnode);\n }\n\n // Signal VNode\n if (type === \"#signal\") {\n return renderSignalNode(vnode, parentContext);\n }\n\n // Fragment\n if (type === Fragment) {\n return renderFragment(vnode, parentContext);\n }\n\n // Portal\n if (type === Portal) {\n return renderPortal(vnode, parentContext);\n }\n\n // Component\n if (typeof type === \"function\") {\n return renderComponent(vnode, parentContext);\n }\n\n // Element\n if (typeof type === \"string\") {\n return renderElement(vnode, parentContext);\n }\n\n throw new Error(`Unknown VNode type: ${String(type)}`);\n }\n\n /**\n * Render a text node\n */\n function renderTextNode(vnode: VNode): RenderedNode<TNode> {\n const text = vnode.props?.nodeValue || \"\";\n const node = strategy.createTextNode(text);\n\n return {\n vnode,\n node,\n subscriptions: [],\n children: [],\n };\n }\n\n /**\n * Render a signal VNode\n */\n function renderSignalNode(vnode: VNode, parentContext: ContextMap): RenderedNode<TNode> {\n const signal = vnode.props?.signal;\n // Use captured context if available (for async components), otherwise parent context\n const contextForSignal = vnode.props?.context || parentContext;\n\n if (!isSignal(signal)) {\n throw new Error(\"Signal VNode must have a signal prop\");\n }\n\n // Create a comment node as a marker to track the signal's position in the DOM\n // This is necessary because signal content might be a Fragment (no direct node)\n // or might be empty initially\n const marker = strategy.createComment(\"signal\");\n\n // Get initial value and render it\n const initialValue = signal.value;\n let currentRendered = renderValueToNode(initialValue, contextForSignal);\n\n const subscriptions: Array<() => void> = [];\n\n // Subscribe to signal changes\n const unsubscribe = signal.subscribe((value) => {\n const newRendered = renderValueToNode(value, contextForSignal);\n\n // Collect actual DOM nodes from old and new rendered trees\n const oldContentNodes = collectNodes(currentRendered);\n const newContentNodes = collectNodes(newRendered);\n\n // Get the parent from the marker\n const parent = strategy.getParent(marker);\n if (!parent) {\n console.warn(\"[Signal] Marker not in DOM, cannot update\");\n return;\n }\n\n // Remove all old content nodes\n for (const node of oldContentNodes) {\n strategy.removeChild(node);\n }\n\n // Insert new content nodes after the marker\n let insertAfter = strategy.getNextSibling(marker);\n for (const node of newContentNodes) {\n strategy.insertBefore(parent, node, insertAfter);\n // Update insertAfter to maintain order (insert at the position after the last inserted)\n insertAfter = strategy.getNextSibling(node);\n }\n\n // Unmount old rendered tree: cleans up subscriptions AND removes\n // portal children from their containers (cleanupSubscriptions alone\n // would leave portal content orphaned in the portal container)\n unmount(currentRendered);\n\n currentRendered = newRendered;\n });\n\n subscriptions.push(unsubscribe);\n\n return {\n vnode,\n node: marker,\n subscriptions,\n children: currentRendered ? [currentRendered] : [],\n };\n }\n\n /**\n * Helper to convert a signal value to a rendered node\n */\n function renderValueToNode(value: unknown, context: ContextMap): RenderedNode<TNode> {\n let newVNode: VNode;\n\n // Convert value to VNode\n if (isVNode(value)) {\n newVNode = value;\n } else if (Array.isArray(value)) {\n // Support arrays - wrap in Fragment automatically\n // This allows: computed(todos, list => list.map(...))\n // Without requiring manual Fragment wrapping\n newVNode = {\n type: Fragment,\n props: {},\n children: value.filter(isVNode), // Filter out non-VNodes\n };\n } else if (typeof value === \"string\" || typeof value === \"number\") {\n newVNode = {\n type: \"#text\",\n props: { nodeValue: String(value) },\n children: [],\n };\n } else if (value == null || typeof value === \"boolean\") {\n // Render empty text for null/undefined/boolean\n // This works for both DOM and terminal\n newVNode = {\n type: \"#text\",\n props: { nodeValue: \"\" },\n children: [],\n };\n } else {\n throw new Error(`Invalid signal value type: ${typeof value}`);\n }\n\n return renderNode(newVNode, context);\n }\n\n /**\n * Render a fragment\n */\n function renderFragment(vnode: VNode, parentContext: ContextMap): RenderedNode<TNode> {\n const children = vnode.children.map((child) => renderNode(child, parentContext));\n\n // Fragment has no node of its own\n return {\n vnode,\n node: null,\n subscriptions: [],\n children,\n };\n }\n\n /**\n * Render a portal\n * Portal renders its children into a different container\n */\n function renderPortal(vnode: VNode, parentContext: ContextMap): RenderedNode<TNode> {\n const container = vnode.props?.container;\n\n if (!container) {\n throw new Error(\"Portal must have a container prop\");\n }\n\n // Render children with same context\n const children = vnode.children.map((child) => renderNode(child, parentContext));\n\n // Append all child nodes to the portal container (recursively handles fragments)\n for (const child of children) {\n const nodes = collectNodes(child);\n for (const node of nodes) {\n strategy.appendChild(container, node);\n }\n }\n\n // Portal has no node in the parent tree\n return {\n vnode,\n node: null,\n subscriptions: [],\n children,\n };\n }\n\n /**\n * Render a component\n */\n function renderComponent(vnode: VNode, parentContext: ContextMap): RenderedNode<TNode> {\n if (typeof vnode.type !== \"function\") {\n throw new Error(\"Component vnode must have a function type\");\n }\n\n const Component = vnode.type;\n const props = {\n ...vnode.props,\n children: normalizeChildrenProp(vnode.children),\n };\n\n // Prepare current component's context\n let currentContext = parentContext;\n\n // Check if this is a Context Provider\n const isContextProvider = (Component as any).__isContextProvider;\n\n if (isContextProvider) {\n // Context Provider: create new context map with provided values\n currentContext = new Map(parentContext);\n const provide = (props as any).provide;\n\n if (provide) {\n // Check if it's a single provide [Context, value] or multiple [[Context, value], ...]\n const isSingle = provide.length === 2 && typeof provide[0] === \"symbol\";\n\n if (isSingle) {\n // Single: [Context, value]\n const [context, value] = provide;\n currentContext.set(context, value);\n } else {\n // Multiple: [[Context, value], ...]\n for (const [context, value] of provide) {\n currentContext.set(context, value);\n }\n }\n }\n }\n\n // Create ComponentAPI\n const ctx = createComponentAPI(currentContext);\n\n // Call component function with props and ctx\n const result = Component(props, ctx);\n\n // Handle async component (Promise<VNode>)\n if (isPromise(result)) {\n const pending: VNode = {\n type: \"#text\",\n props: { nodeValue: \"\" },\n children: [],\n };\n const resultSignal = resource(result, pending);\n const signalVNode: VNode = {\n type: \"#signal\",\n props: { signal: resultSignal, context: currentContext },\n children: [],\n };\n const rendered = renderNode(signalVNode, currentContext);\n return {\n vnode,\n node: rendered.node,\n subscriptions: rendered.subscriptions,\n children: [rendered],\n };\n }\n\n // Handle async generator component (AsyncIterableIterator<VNode>)\n if (isAsyncIterator(result)) {\n const pending: VNode = {\n type: \"#text\",\n props: { nodeValue: \"\" },\n children: [],\n };\n const resultSignal = stream(result, pending);\n const signalVNode: VNode = {\n type: \"#signal\",\n props: { signal: resultSignal, context: currentContext },\n children: [],\n };\n const rendered = renderNode(signalVNode, currentContext);\n return {\n vnode,\n node: rendered.node,\n subscriptions: rendered.subscriptions,\n children: [rendered],\n };\n }\n\n // Handle signal component (Signal<VNode>)\n if (isSignal(result)) {\n const signalVNode: VNode = {\n type: \"#signal\",\n props: { signal: result, context: currentContext },\n children: [],\n };\n const rendered = renderNode(signalVNode, currentContext);\n return {\n vnode,\n node: rendered.node,\n subscriptions: rendered.subscriptions,\n children: [rendered],\n };\n }\n\n // Handle normal sync component (VNode)\n const normalizedResult = normalizeComponentResult(result);\n const rendered = renderNode(normalizedResult, currentContext);\n\n return {\n vnode,\n node: rendered.node,\n subscriptions: rendered.subscriptions,\n children: [rendered],\n };\n }\n\n /**\n * Render an element\n */\n function renderElement(vnode: VNode, parentContext: ContextMap): RenderedNode<TNode> {\n if (typeof vnode.type !== \"string\") {\n throw new Error(\"Element vnode must have a string type\");\n }\n\n const element = strategy.createElement(vnode.type);\n const subscriptions: Array<() => void> = [];\n\n // Apply props\n const props = vnode.props || {};\n for (const [key, value] of Object.entries(props)) {\n if (key === \"key\" || key === \"children\") continue;\n\n // Handle ref separately\n if (key === \"ref\") {\n if (strategy.setRef && value != null) {\n const cleanup = strategy.setRef(element, value as Ref<TNode>);\n subscriptions.push(cleanup);\n }\n continue;\n }\n\n if (isSignal(value)) {\n const unsub = strategy.setSignalProperty(element, key, value);\n subscriptions.push(unsub);\n } else {\n strategy.setProperty(element, key, value);\n }\n }\n\n // Render children with same context\n const children = vnode.children.map((child) => renderNode(child, parentContext));\n\n // Append all child nodes (recursively handles fragments and signal wrappers)\n for (const child of children) {\n const nodes = collectNodes(child);\n for (const node of nodes) {\n strategy.appendChild(element, node);\n }\n }\n\n return {\n vnode,\n node: element,\n subscriptions,\n children,\n };\n }\n\n /**\n * Unmount a rendered node\n */\n function unmount(node: RenderedNode<TNode>): void {\n // Cleanup subscriptions\n for (const unsub of node.subscriptions) {\n unsub();\n }\n\n // Recursively unmount children\n for (const child of node.children) {\n unmount(child);\n }\n\n // Remove from tree\n if (node.node) {\n strategy.removeChild(node.node);\n }\n }\n\n /**\n * Clean up subscriptions without removing nodes from tree\n */\n function cleanupSubscriptions(node: RenderedNode<TNode>): void {\n // Cleanup subscriptions\n for (const unsub of node.subscriptions) {\n unsub();\n }\n\n // Recursively cleanup children\n for (const child of node.children) {\n cleanupSubscriptions(child);\n }\n }\n\n return {\n renderNode: renderNode,\n unmount: unmount,\n cleanupSubscriptions: cleanupSubscriptions,\n };\n}\n"],"mappings":";;;;;;;;AAKA,MAAa,WAAmB,OAAO,IAAI,mBAAmB;;;;AAK9D,MAAa,SAAiB,OAAO,IAAI,iBAAiB;;;;;;;ACF1D,SAAgB,EACd,MACA,OACA,GAAG,UACI;AACP,QAAO;EACL;EACA,OAAO,SAAS,EAAE;EAClB,UAAU,kBAAkB,SAAS;EACrC,KAAK,OAAO;EACb;;;;;AAMH,SAAgB,gBAAgB,MAA8B;AAC5D,QAAO;EACL,MAAM;EACN,OAAO,EAAE,WAAW,OAAO,KAAK,EAAE;EAClC,UAAU,EAAE;EACb;;;;;AAMH,SAAgB,kBAAkB,QAAgC;AAChE,QAAO;EACL,MAAM;EACN,OAAO,EAAE,QAAQ;EACjB,UAAU,EAAE;EACb;;;;;AAMH,SAAS,kBAAkB,UAA8B;CACvD,MAAM,SAAkB,EAAE;AAE1B,MAAK,MAAM,SAAS,UAAU;AAC5B,MAAI,SAAS,QAAQ,OAAO,UAAU,UAEpC;AAGF,MAAI,MAAM,QAAQ,MAAM,CAEtB,QAAO,KAAK,GAA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