@fluixi/dom 1.0.0-alpha.83 → 1.0.0-alpha.85

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 (182) hide show
  1. package/dist/cdn/dom-client.cjs +1427 -1
  2. package/dist/cdn/dom-client.d.ts +2 -2
  3. package/dist/cdn/dom-client.global.js +2 -1
  4. package/dist/cdn/dom-client.js +3 -3
  5. package/dist/cdn/dom-client.mjs +1430 -1
  6. package/dist/cdn/dom.cjs +3127 -1
  7. package/dist/cdn/dom.d.ts +2 -2
  8. package/dist/cdn/dom.global.js +2 -1
  9. package/dist/cdn/dom.js +4 -4
  10. package/dist/cdn/dom.mjs +3133 -1
  11. package/dist/index.cjs +3155 -1
  12. package/dist/index.js +2 -2
  13. package/dist/index.mjs +3149 -1
  14. package/dist/lib/component/index.cjs +128 -1
  15. package/dist/lib/component/index.mjs +105 -1
  16. package/dist/lib/component/modifiers.cjs +126 -1
  17. package/dist/lib/component/modifiers.d.ts +12 -0
  18. package/dist/lib/component/modifiers.d.ts.map +1 -1
  19. package/dist/lib/component/modifiers.js +12 -84
  20. package/dist/lib/component/modifiers.mjs +105 -1
  21. package/dist/lib/dom/delegate.cjs +60 -1
  22. package/dist/lib/dom/delegate.js +1 -1
  23. package/dist/lib/dom/delegate.mjs +39 -1
  24. package/dist/lib/dom/dynamic-element.cjs +949 -1
  25. package/dist/lib/dom/dynamic-element.d.ts +3 -3
  26. package/dist/lib/dom/dynamic-element.js +2 -2
  27. package/dist/lib/dom/dynamic-element.mjs +928 -1
  28. package/dist/lib/dom/hydration-state.cjs +93 -1
  29. package/dist/lib/dom/hydration-state.d.ts +1 -1
  30. package/dist/lib/dom/hydration-state.js +1 -1
  31. package/dist/lib/dom/hydration-state.mjs +72 -1
  32. package/dist/lib/dom/hydration.cjs +685 -1
  33. package/dist/lib/dom/hydration.js +8 -8
  34. package/dist/lib/dom/hydration.mjs +664 -1
  35. package/dist/lib/dom/index.cjs +2040 -1
  36. package/dist/lib/dom/index.js +1 -1
  37. package/dist/lib/dom/index.mjs +2020 -1
  38. package/dist/lib/dom/integration.cjs +71 -1
  39. package/dist/lib/dom/integration.js +3 -3
  40. package/dist/lib/dom/integration.mjs +51 -1
  41. package/dist/lib/dom/island.cjs +790 -1
  42. package/dist/lib/dom/island.d.ts +1 -1
  43. package/dist/lib/dom/island.js +11 -11
  44. package/dist/lib/dom/island.mjs +769 -1
  45. package/dist/lib/dom/runtime.cjs +1432 -1
  46. package/dist/lib/dom/runtime.d.ts +60 -17
  47. package/dist/lib/dom/runtime.d.ts.map +1 -1
  48. package/dist/lib/dom/runtime.js +122 -79
  49. package/dist/lib/dom/runtime.mjs +1414 -1
  50. package/dist/lib/dom/server/fx-data.cjs +53 -1
  51. package/dist/lib/dom/server/fx-data.d.ts +5 -5
  52. package/dist/lib/dom/server/fx-data.js +6 -6
  53. package/dist/lib/dom/server/fx-data.mjs +32 -1
  54. package/dist/lib/dom/server/host.cjs +66 -1
  55. package/dist/lib/dom/server/host.d.ts +6 -0
  56. package/dist/lib/dom/server/host.d.ts.map +1 -1
  57. package/dist/lib/dom/server/host.js +7 -1
  58. package/dist/lib/dom/server/host.mjs +45 -1
  59. package/dist/lib/dom/server/index.cjs +759 -1
  60. package/dist/lib/dom/server/index.d.ts +1 -1
  61. package/dist/lib/dom/server/index.js +1 -1
  62. package/dist/lib/dom/server/index.mjs +743 -1
  63. package/dist/lib/dom/server/nodes.cjs +302 -1
  64. package/dist/lib/dom/server/nodes.d.ts +2 -2
  65. package/dist/lib/dom/server/nodes.d.ts.map +1 -1
  66. package/dist/lib/dom/server/nodes.js +4 -4
  67. package/dist/lib/dom/server/nodes.mjs +279 -1
  68. package/dist/lib/dom/server/parse-template.cjs +395 -1
  69. package/dist/lib/dom/server/parse-template.d.ts +1 -1
  70. package/dist/lib/dom/server/parse-template.js +4 -4
  71. package/dist/lib/dom/server/parse-template.mjs +372 -1
  72. package/dist/lib/dom/server/render.cjs +691 -1
  73. package/dist/lib/dom/server/render.d.ts +9 -1
  74. package/dist/lib/dom/server/render.d.ts.map +1 -1
  75. package/dist/lib/dom/server/render.js +23 -15
  76. package/dist/lib/dom/server/render.mjs +677 -1
  77. package/dist/lib/dom/server/request-context.cjs +110 -1
  78. package/dist/lib/dom/server/request-context.d.ts +29 -9
  79. package/dist/lib/dom/server/request-context.d.ts.map +1 -1
  80. package/dist/lib/dom/server/request-context.js +28 -8
  81. package/dist/lib/dom/server/request-context.mjs +89 -1
  82. package/dist/lib/dom/server/serialize.cjs +187 -1
  83. package/dist/lib/dom/server/serialize.js +3 -3
  84. package/dist/lib/dom/server/serialize.mjs +164 -1
  85. package/dist/lib/dom/server-renderer.cjs +760 -1
  86. package/dist/lib/dom/server-renderer.js +1 -1
  87. package/dist/lib/dom/server-renderer.mjs +745 -1
  88. package/dist/lib/dom/types.cjs +18 -1
  89. package/dist/lib/dom/utils.cjs +381 -1
  90. package/dist/lib/dom/utils.d.ts +1 -88
  91. package/dist/lib/dom/utils.d.ts.map +1 -1
  92. package/dist/lib/dom/utils.js +2 -99
  93. package/dist/lib/dom/utils.mjs +361 -1
  94. package/dist/lib/dom/versions.cjs +60 -1
  95. package/dist/lib/dom/versions.d.ts +3 -3
  96. package/dist/lib/dom/versions.d.ts.map +1 -1
  97. package/dist/lib/dom/versions.js +17 -5
  98. package/dist/lib/dom/versions.mjs +37 -1
  99. package/dist/lib/element/attributes.cjs +19 -1
  100. package/dist/lib/element/attributes.d.ts +7 -7
  101. package/dist/lib/element/attributes.js +1 -1
  102. package/dist/lib/element/attributes.mjs +1 -0
  103. package/dist/lib/element/index.cjs +19 -1
  104. package/dist/lib/element/index.mjs +1 -0
  105. package/dist/lib/element/types.cjs +18 -1
  106. package/dist/lib/element/types.d.ts +4 -5
  107. package/dist/lib/element/types.d.ts.map +1 -1
  108. package/dist/lib/element/types.js +0 -1
  109. package/dist/lib/flow/class-map.cjs +38 -1
  110. package/dist/lib/flow/class-map.d.ts +3 -3
  111. package/dist/lib/flow/class-map.js +2 -2
  112. package/dist/lib/flow/class-map.mjs +17 -1
  113. package/dist/lib/flow/client-only.cjs +57 -1
  114. package/dist/lib/flow/client-only.d.ts +4 -4
  115. package/dist/lib/flow/client-only.js +3 -3
  116. package/dist/lib/flow/client-only.mjs +36 -1
  117. package/dist/lib/flow/dynamic.cjs +53 -1
  118. package/dist/lib/flow/dynamic.d.ts +2 -2
  119. package/dist/lib/flow/dynamic.js +3 -3
  120. package/dist/lib/flow/dynamic.mjs +32 -1
  121. package/dist/lib/flow/error-boundary.cjs +43 -1
  122. package/dist/lib/flow/error-boundary.d.ts +2 -2
  123. package/dist/lib/flow/error-boundary.js +3 -3
  124. package/dist/lib/flow/error-boundary.mjs +22 -1
  125. package/dist/lib/flow/for.cjs +66 -1
  126. package/dist/lib/flow/for.d.ts +9 -9
  127. package/dist/lib/flow/for.d.ts.map +1 -1
  128. package/dist/lib/flow/for.js +2 -2
  129. package/dist/lib/flow/for.mjs +45 -1
  130. package/dist/lib/flow/index-flow.cjs +67 -1
  131. package/dist/lib/flow/index-flow.d.ts +5 -5
  132. package/dist/lib/flow/index-flow.js +4 -4
  133. package/dist/lib/flow/index-flow.mjs +46 -1
  134. package/dist/lib/flow/index.cjs +805 -1
  135. package/dist/lib/flow/index.mjs +792 -1
  136. package/dist/lib/flow/portal.cjs +538 -1
  137. package/dist/lib/flow/portal.mjs +519 -1
  138. package/dist/lib/flow/show.cjs +81 -1
  139. package/dist/lib/flow/show.d.ts +1 -1
  140. package/dist/lib/flow/show.d.ts.map +1 -1
  141. package/dist/lib/flow/show.js +4 -115
  142. package/dist/lib/flow/show.mjs +67 -1
  143. package/dist/lib/flow/style-map.cjs +43 -1
  144. package/dist/lib/flow/style-map.d.ts +3 -3
  145. package/dist/lib/flow/style-map.js +3 -3
  146. package/dist/lib/flow/style-map.mjs +22 -1
  147. package/dist/lib/flow/switch.cjs +91 -1
  148. package/dist/lib/flow/switch.d.ts +3 -3
  149. package/dist/lib/flow/switch.d.ts.map +1 -1
  150. package/dist/lib/flow/switch.js +6 -6
  151. package/dist/lib/flow/switch.mjs +70 -1
  152. package/dist/lib/flow/utils.cjs +44 -1
  153. package/dist/lib/flow/utils.d.ts +1 -1
  154. package/dist/lib/flow/utils.js +1 -1
  155. package/dist/lib/flow/utils.mjs +23 -1
  156. package/dist/lib/html.cjs +32 -1
  157. package/dist/lib/html.d.ts +6 -6
  158. package/dist/lib/html.js +5 -5
  159. package/dist/lib/html.mjs +11 -1
  160. package/dist/lib/index.cjs +3104 -1
  161. package/dist/lib/index.d.ts +0 -1
  162. package/dist/lib/index.d.ts.map +1 -1
  163. package/dist/lib/index.js +2 -3
  164. package/dist/lib/index.mjs +3097 -1
  165. package/dist/lib/shared/types.cjs +18 -1
  166. package/dist/lib/shared/types.d.ts +8 -8
  167. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  168. package/dist/version.generated.cjs +26 -1
  169. package/dist/version.generated.d.ts +1 -1
  170. package/dist/version.generated.js +2 -2
  171. package/dist/version.generated.mjs +5 -1
  172. package/package.json +7 -6
  173. package/dist/lib/jsx/control-flow/flow.cjs +0 -1
  174. package/dist/lib/jsx/control-flow/flow.d.ts +0 -2
  175. package/dist/lib/jsx/control-flow/flow.d.ts.map +0 -1
  176. package/dist/lib/jsx/control-flow/flow.js +0 -627
  177. package/dist/lib/jsx/control-flow/flow.mjs +0 -0
  178. package/dist/lib/jsx/control-flow/for-flow.cjs +0 -1
  179. package/dist/lib/jsx/control-flow/for-flow.d.ts +0 -2
  180. package/dist/lib/jsx/control-flow/for-flow.d.ts.map +0 -1
  181. package/dist/lib/jsx/control-flow/for-flow.js +0 -1
  182. package/dist/lib/jsx/control-flow/for-flow.mjs +0 -0
@@ -1 +1,60 @@
1
- "use strict";var t=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var u=(e,o)=>{for(var s in o)t(e,s,{get:o[s],enumerable:!0})},m=(e,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of d(o))!f.call(e,r)&&r!==s&&t(e,r,{get:()=>o[r],enumerable:!(n=c(o,r))||n.enumerable});return e};var p=e=>m(t({},"__esModule",{value:!0}),e);var V={};u(V,{registerCoreVersion:()=>x,stampVersions:()=>v,versions:()=>i,warnOnVersionSkew:()=>g});module.exports=p(V);var a="1.0.0-alpha.83";var l=require("@fluixi/reactive/version"),i={dom:a,reactive:l.VERSION};function x(e){i.core=e}function v(e){i.core&&e.setAttribute("fluixi",i.core),e.setAttribute("fx-dom",i.dom),e.setAttribute("fx-reactive",i.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=i)}function g(){let e=[i.core,i.dom,i.reactive].filter(o=>o!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${i.core??"(absent)"}, dom ${i.dom}, reactive ${i.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/dom/versions.ts
21
+ var versions_exports = {};
22
+ __export(versions_exports, {
23
+ registerCoreVersion: () => registerCoreVersion,
24
+ stampVersions: () => stampVersions,
25
+ versions: () => versions,
26
+ warnOnVersionSkew: () => warnOnVersionSkew
27
+ });
28
+ module.exports = __toCommonJS(versions_exports);
29
+
30
+ // src/version.generated.ts
31
+ var VERSION = "1.0.0-alpha.85";
32
+
33
+ // src/lib/dom/versions.ts
34
+ var import_version = require("@fluixi/reactive/version");
35
+ var import_signal = require("@fluixi/reactive/signal");
36
+ var versions = { dom: VERSION, reactive: import_version.VERSION };
37
+ function registerCoreVersion(version) {
38
+ versions.core = version;
39
+ }
40
+ function stampVersions(container) {
41
+ if (versions.core) container.setAttribute("fluixi", versions.core);
42
+ container.setAttribute("fx-dom", versions.dom);
43
+ container.setAttribute("fx-reactive", versions.reactive);
44
+ if (typeof globalThis !== "undefined") globalThis.Fluixi = versions;
45
+ }
46
+ function warnOnVersionSkew() {
47
+ const builds = (0, import_signal.joinedVersions)();
48
+ if (builds.length > 1) {
49
+ console.warn(
50
+ `[fluixi] ${builds.length} builds of @fluixi/reactive are driving one reactive graph: ${builds.join(", ")}. They share it on purpose, so signals still cross between them, but the oldest one decided what the graph looks like. Build the components on one release, or load them as shared-runtime bundles.`
51
+ );
52
+ }
53
+ const present = [versions.core, versions.dom, versions.reactive].filter(
54
+ (v) => v !== void 0
55
+ );
56
+ if (new Set(present).size <= 1) return;
57
+ console.warn(
58
+ `[fluixi] package versions disagree: core ${versions.core ?? "(absent)"}, dom ${versions.dom}, reactive ${versions.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`
59
+ );
60
+ }
@@ -1,6 +1,6 @@
1
1
  /** The versions of the packages this app is running. */
2
2
  export interface FluixiVersions {
3
- /** Absent when the app does not use `@fluixi/core` dom and reactive can run alone. */
3
+ /** Absent when the app does not use `@fluixi/core`: dom and reactive can run alone. */
4
4
  core?: string;
5
5
  dom: string;
6
6
  reactive: string;
@@ -18,8 +18,8 @@ export declare function registerCoreVersion(version: string): void;
18
18
  /**
19
19
  * Stamp the versions onto the mount element and expose them as `window.Fluixi`.
20
20
  *
21
- * The attributes make it visible in the page source and in a screenshot of devtools
22
- * usually all a bug report contains while the global is what you reach for in a console.
21
+ * The attributes make it visible in the page source and in a screenshot of devtools,
22
+ * usually all a bug report contains, while the global is what you reach for in a console.
23
23
  */
24
24
  export declare function stampVersions(container: Element): void;
25
25
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/versions.ts"],"names":[],"mappings":"AAmBA,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,QAAQ,EAAE,cAAiD,CAAC;AAEzE,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;CACxC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAMtD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAYxC"}
1
+ {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/versions.ts"],"names":[],"mappings":"AAoBA,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,uFAAuF;IACvF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,QAAQ,EAAE,cAAiD,CAAC;AAEzE,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;CACxC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAMtD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CA0BxC"}
@@ -2,8 +2,8 @@
2
2
  * Which build of each package is actually running.
3
3
  *
4
4
  * This used to live in `@fluixi/core`, stamped only by *its* `render`. But an app can
5
- * reach the DOM through either entry point `@fluixi/core`'s `render`, or this package's
6
- * `render`/`hydrate` by way of `startClient` and only the first stamped anything. An app
5
+ * reach the DOM through either entry point: `@fluixi/core`'s `render`, or this package's
6
+ * `render`/`hydrate` by way of `startClient`, and only the first stamped anything. An app
7
7
  * that hydrated (the docs site, every SSR app) therefore had no version attributes at all,
8
8
  * which is exactly the case where a bug report needs them most.
9
9
  *
@@ -16,6 +16,7 @@
16
16
  */
17
17
  import { VERSION as DOM } from '../../version.generated.js';
18
18
  import { VERSION as REACTIVE } from '@fluixi/reactive/version';
19
+ import { joinedVersions } from '@fluixi/reactive/signal';
19
20
  export const versions = { dom: DOM, reactive: REACTIVE };
20
21
  /**
21
22
  * Record the `@fluixi/core` version, called by core when it is loaded.
@@ -28,8 +29,8 @@ export function registerCoreVersion(version) {
28
29
  /**
29
30
  * Stamp the versions onto the mount element and expose them as `window.Fluixi`.
30
31
  *
31
- * The attributes make it visible in the page source and in a screenshot of devtools
32
- * usually all a bug report contains while the global is what you reach for in a console.
32
+ * The attributes make it visible in the page source and in a screenshot of devtools,
33
+ * usually all a bug report contains, while the global is what you reach for in a console.
33
34
  */
34
35
  export function stampVersions(container) {
35
36
  if (versions.core)
@@ -47,10 +48,21 @@ export function stampVersions(container) {
47
48
  * surface later as a reactivity bug nobody can reproduce.
48
49
  */
49
50
  export function warnOnVersionSkew() {
51
+ // Two or more builds of @fluixi/reactive sharing one graph. `versions` is module
52
+ // state, so it only ever describes the bundle it was compiled into and cannot see
53
+ // this; the graph itself keeps the list. Standalone web components are how it
54
+ // happens in practice, each carrying its own runtime onto the same page.
55
+ const builds = joinedVersions();
56
+ if (builds.length > 1) {
57
+ console.warn(`[fluixi] ${builds.length} builds of @fluixi/reactive are driving one reactive ` +
58
+ `graph: ${builds.join(', ')}. They share it on purpose, so signals still cross ` +
59
+ `between them, but the oldest one decided what the graph looks like. Build the ` +
60
+ `components on one release, or load them as shared-runtime bundles.`);
61
+ }
50
62
  const present = [versions.core, versions.dom, versions.reactive].filter((v) => v !== undefined);
51
63
  if (new Set(present).size <= 1)
52
64
  return;
53
- console.warn(`[fluixi] package versions disagree core ${versions.core ?? '(absent)'}, ` +
65
+ console.warn(`[fluixi] package versions disagree: core ${versions.core ?? '(absent)'}, ` +
54
66
  `dom ${versions.dom}, reactive ${versions.reactive}. These ship as one release, so a ` +
55
67
  `mismatch usually means a stale lockfile or two copies resolved side by side. ` +
56
68
  `Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`);
@@ -1 +1,37 @@
1
- var o="1.0.0-alpha.83";import{VERSION as s}from"@fluixi/reactive/version";var e={dom:o,reactive:s};function l(i){e.core=i}function c(i){e.core&&i.setAttribute("fluixi",e.core),i.setAttribute("fx-dom",e.dom),i.setAttribute("fx-reactive",e.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=e)}function d(){let i=[e.core,e.dom,e.reactive].filter(r=>r!==void 0);new Set(i).size<=1||console.warn(`[fluixi] package versions disagree — core ${e.core??"(absent)"}, dom ${e.dom}, reactive ${e.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}export{l as registerCoreVersion,c as stampVersions,e as versions,d as warnOnVersionSkew};
1
+ // src/version.generated.ts
2
+ var VERSION = "1.0.0-alpha.85";
3
+
4
+ // src/lib/dom/versions.ts
5
+ import { VERSION as REACTIVE } from "@fluixi/reactive/version";
6
+ import { joinedVersions } from "@fluixi/reactive/signal";
7
+ var versions = { dom: VERSION, reactive: REACTIVE };
8
+ function registerCoreVersion(version) {
9
+ versions.core = version;
10
+ }
11
+ function stampVersions(container) {
12
+ if (versions.core) container.setAttribute("fluixi", versions.core);
13
+ container.setAttribute("fx-dom", versions.dom);
14
+ container.setAttribute("fx-reactive", versions.reactive);
15
+ if (typeof globalThis !== "undefined") globalThis.Fluixi = versions;
16
+ }
17
+ function warnOnVersionSkew() {
18
+ const builds = joinedVersions();
19
+ if (builds.length > 1) {
20
+ console.warn(
21
+ `[fluixi] ${builds.length} builds of @fluixi/reactive are driving one reactive graph: ${builds.join(", ")}. They share it on purpose, so signals still cross between them, but the oldest one decided what the graph looks like. Build the components on one release, or load them as shared-runtime bundles.`
22
+ );
23
+ }
24
+ const present = [versions.core, versions.dom, versions.reactive].filter(
25
+ (v) => v !== void 0
26
+ );
27
+ if (new Set(present).size <= 1) return;
28
+ console.warn(
29
+ `[fluixi] package versions disagree: core ${versions.core ?? "(absent)"}, dom ${versions.dom}, reactive ${versions.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`
30
+ );
31
+ }
32
+ export {
33
+ registerCoreVersion,
34
+ stampVersions,
35
+ versions,
36
+ warnOnVersionSkew
37
+ };
@@ -1 +1,19 @@
1
- "use strict";var r=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(t,e,a,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of o(e))!u.call(t,i)&&i!==a&&r(t,i,{get:()=>e[i],enumerable:!(n=s(e,i))||n.enumerable});return t};var l=t=>c(r({},"__esModule",{value:!0}),t);var g={};module.exports=l(g);
1
+ /*! @fluixi/dom v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from))
10
+ if (!__hasOwnProp.call(to, key) && key !== except)
11
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ }
13
+ return to;
14
+ };
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+
17
+ // src/lib/element/attributes.ts
18
+ var attributes_exports = {};
19
+ module.exports = __toCommonJS(attributes_exports);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * DOM element attribute types the props every element accepts, independent of
2
+ * DOM element attribute types, the props every element accepts, independent of
3
3
  * how it was authored. `@fluixi/jsx` re-exports these into the `JSX` namespace
4
4
  * for JSX consumers; html`` tooling reads them from here directly.
5
5
  *
@@ -14,8 +14,8 @@ import type { ComponentChild } from '../shared/types.js';
14
14
  * applies a function-valued prop as a reactive render effect, so any attribute typed with this
15
15
  * accepts `() => value` without a cast.
16
16
  *
17
- * The accessor may return `undefined` to omit the attribute reactively `setAttribute`
18
- * removes the attr on `undefined`/`null`/`false` so `() => (cond ? 'true' : undefined)`
17
+ * The accessor may return `undefined` to omit the attribute reactively: `setAttribute`
18
+ * removes the attr on `undefined`/`null`/`false`, so `() => (cond ? 'true' : undefined)`
19
19
  * type-checks without a cast.
20
20
  */
21
21
  export type Reactive<T> = T | undefined | Accessor<T | undefined>;
@@ -36,7 +36,7 @@ export type HTMLReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrad
36
36
  *
37
37
  * Selecting the string-valued members keeps the properties and drops
38
38
  * `CSSStyleDeclaration`'s methods, `length` and numeric index. There is
39
- * deliberately no open `[key: string]` fallback it would make every misspelled
39
+ * deliberately no open `[key: string]` fallback, it would make every misspelled
40
40
  * property type-check, and `--*` already covers custom properties. For a property
41
41
  * newer than the TypeScript lib, set it as a custom property or widen at the call
42
42
  * site.
@@ -1046,8 +1046,8 @@ export interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> {
1046
1046
  * Anything the renderer accepts as output. `JSX.Element` aliases this; html``
1047
1047
  * templates produce the same values, so the type is shared rather than duplicated.
1048
1048
  *
1049
- * It is now literally the same type, not a parallel copy. The two had drifted
1050
- * this one lacked `ComponentChild`'s recursive array and lazy child so a
1049
+ * It is now literally the same type, not a parallel copy. The two had drifted:
1050
+ * this one lacked `ComponentChild`'s recursive array and lazy child, so a
1051
1051
  * component annotated with the shared `ComponentChild` was rejected as a JSX
1052
1052
  * component. Both authoring modes compile to the same runtime calls, so
1053
1053
  * "renderable" has to mean one thing.
@@ -1056,7 +1056,7 @@ export type FxElement = ComponentChild;
1056
1056
  /**
1057
1057
  * Every intrinsic tag mapped to the attributes it accepts. `JSX.IntrinsicElements`
1058
1058
  * aliases this. It lives here because html`` tooling needs the same map to type
1059
- * `<div class=…>` inside a template that has nothing to do with JSX.
1059
+ * `<div class=...>` inside a template, that has nothing to do with JSX.
1060
1060
  */
1061
1061
  export interface IntrinsicElements {
1062
1062
  a: AnchorHTMLAttributes;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * DOM element attribute types the props every element accepts, independent of
2
+ * DOM element attribute types, the props every element accepts, independent of
3
3
  * how it was authored. `@fluixi/jsx` re-exports these into the `JSX` namespace
4
4
  * for JSX consumers; html`` tooling reads them from here directly.
5
5
  *
@@ -0,0 +1 @@
1
+ /*! @fluixi/dom v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
@@ -1 +1,19 @@
1
- "use strict";var r=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var m=(p,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of f(e))!j.call(p,t)&&t!==s&&r(p,t,{get:()=>e[t],enumerable:!(o=y(e,t))||o.enumerable});return p};var x=p=>m(r({},"__esModule",{value:!0}),p);var a={};module.exports=x(a);
1
+ /*! @fluixi/dom v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __copyProps = (to, from, except, desc) => {
8
+ if (from && typeof from === "object" || typeof from === "function") {
9
+ for (let key of __getOwnPropNames(from))
10
+ if (!__hasOwnProp.call(to, key) && key !== except)
11
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
+ }
13
+ return to;
14
+ };
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+
17
+ // src/lib/element/index.ts
18
+ var index_exports = {};
19
+ module.exports = __toCommonJS(index_exports);
@@ -0,0 +1 @@
1
+ /*! @fluixi/dom v1.0.0-alpha.85 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
@@ -1 +1,18 @@
1
- "use strict";var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of l(e))!d.call(t,n)&&n!==r&&o(t,n,{get:()=>e[n],enumerable:!(i=s(e,n))||i.enumerable});return t};var a=t=>p(o({},"__esModule",{value:!0}),t);var f={};module.exports=a(f);
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/lib/element/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @fileoverview Advanced types for @fluixi/element
3
2
  * @module @fluixi/dom/element/types
4
3
  */
5
4
  export type PropTypeConstructor = typeof String | typeof Number | typeof Boolean | typeof Object | typeof Array;
@@ -10,7 +9,7 @@ export interface PropDefinition<T = unknown> {
10
9
  }
11
10
  /** Resolve the TS type from a PropDefinition's `type` constructor */
12
11
  export type InferPropType<D extends PropDefinition> = D extends PropDefinition<infer Def> ? D['type'] extends typeof String ? string : D['type'] extends typeof Number ? number : D['type'] extends typeof Boolean ? boolean : D['type'] extends typeof Array ? unknown[] : D['type'] extends typeof Object ? Record<string, unknown> : Def extends undefined ? unknown : Def : unknown;
13
- /** Signal tuple: [accessor, setter] matches createSignal return */
12
+ /** Signal tuple: [accessor, setter]: matches createSignal return */
14
13
  export type SignalTuple<T> = [
15
14
  get: () => T,
16
15
  set: (v: T | ((prev: T) => T)) => void
@@ -19,7 +18,7 @@ export type SignalTuple<T> = [
19
18
  export type PropsSignals<T extends Record<string, PropDefinition>> = {
20
19
  [K in keyof T]: SignalTuple<InferPropType<T[K]>>;
21
20
  };
22
- /** Render function for defineElement fully typed props and event context */
21
+ /** Render function for defineElement: fully typed props and event context */
23
22
  export type ElementRenderFn<T extends Record<string, PropDefinition>, E extends Record<string, EventDefinition> = Record<string, EventDefinition>> = (props: PropsSignals<T>, ctx: ElementRenderContext<E>) => unknown;
24
23
  export interface EventDefinition<T = unknown> {
25
24
  detail?: T;
@@ -59,7 +58,7 @@ export interface TypedFluixiElement<P extends Record<string, PropDefinition>> ex
59
58
  setProp<K extends string & keyof P>(name: K, value: InferPropType<P[K]>): void;
60
59
  getProp<K extends string & keyof P>(name: K): InferPropType<P[K]>;
61
60
  }
62
- /** Constructor type returned by defineElement carries tag name + prop types + event types */
61
+ /** Constructor type returned by defineElement: carries tag name + prop types + event types */
63
62
  export interface FluixiElementConstructor<Tag extends string = string, P extends Record<string, PropDefinition> = Record<string, PropDefinition>, E extends Record<string, EventDefinition> = Record<string, EventDefinition>> {
64
63
  new (): TypedFluixiElement<P>;
65
64
  observedAttributes: string[];
@@ -124,6 +123,6 @@ export type PropToAttribute<P extends Record<string, PropDefinition>> = {
124
123
  attribute: infer A extends string;
125
124
  } ? A : K extends string ? CamelToKebab<K> : never]?: InferPropType<P[K]>;
126
125
  };
127
- /** CamelCase kebab-case at the type level */
126
+ /** CamelCase -> kebab-case at the type level */
128
127
  export type CamelToKebab<S extends string> = S extends `${infer C}${infer Rest}` ? C extends Uppercase<C> ? `-${Lowercase<C>}${CamelToKebab<Rest>}` : `${C}${CamelToKebab<Rest>}` : S;
129
128
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/element/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,MAAM,mBAAmB,GAC3B,OAAO,MAAM,GACb,OAAO,MAAM,GACb,OAAO,OAAO,GACd,OAAO,MAAM,GACb,OAAO,KAAK,CAAC;AAEjB,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO;IACzC,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC5B;AAED,qEAAqE;AACrE,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,cAAc,IAAI,CAAC,SAAS,cAAc,CAC5E,MAAM,GAAG,CACV,GACG,CAAC,CAAC,MAAM,CAAC,SAAS,OAAO,MAAM,GAC7B,MAAM,GACN,CAAC,CAAC,MAAM,CAAC,SAAS,O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AAG;QAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;KAAE,CAAC;IACpE,CAAC,GAAG,EAAE,KAAK,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3D,CAAC,GAAG,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;CAC7C;AAMD,8FAA8F;AAC9F,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI;KACrE,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QAAE,SAAS,EAAE,KAAK,CAAA;KAAE,GAC9C,KAAK,GACL,CAAC,CAAC,CAAC,CAAC,SAAS;QAAE,SAAS,EAAE,MAAM,CAAC,SAAS,MAAM,CAAA;KAAE,GAClD,CAAC,GACD,CAAC,SAAS,MAAM,GAChB,YAAY,CAAC,CAAC,CAAC,GACf,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACjC,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,MAAM,IAAI,EAAE,GAC5E,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,GACpB,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,EAAE,GACvC,GAAG,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,EAAE,GAC7B,CAAC,CAAC"}
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @fileoverview Advanced types for @fluixi/element
3
2
  * @module @fluixi/dom/element/types
4
3
  */
5
4
  export {};
@@ -1 +1,38 @@
1
- "use strict";var i=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var d=(n,o)=>{for(var e in o)i(n,e,{get:o[e],enumerable:!0})},u=(n,o,e,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of a(o))!l.call(n,s)&&s!==e&&i(n,s,{get:()=>o[s],enumerable:!(t=r(o,s))||t.enumerable});return n};var f=n=>u(i({},"__esModule",{value:!0}),n);var C={};d(C,{classMap:()=>p});module.exports=f(C);var c=require("@fluixi/reactive/signal");function p(n){return(0,c.createMemo)(()=>{let o=typeof n=="function"?n():n,e=[];for(let[t,s]of Object.entries(o)){if(!t)continue;(typeof s=="function"?s():s)&&e.push(t)}return e.join(" ")},void 0,{name:"ClassMap"})}
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/flow/class-map.ts
21
+ var class_map_exports = {};
22
+ __export(class_map_exports, {
23
+ classMap: () => classMap
24
+ });
25
+ module.exports = __toCommonJS(class_map_exports);
26
+ var import_signal = require("@fluixi/reactive/signal");
27
+ function classMap(input) {
28
+ return (0, import_signal.createMemo)(() => {
29
+ const map = typeof input === "function" ? input() : input;
30
+ const classes = [];
31
+ for (const [cls, cond] of Object.entries(map)) {
32
+ if (!cls) continue;
33
+ const active = typeof cond === "function" ? cond() : cond;
34
+ if (active) classes.push(cls);
35
+ }
36
+ return classes.join(" ");
37
+ }, void 0, { name: "ClassMap" });
38
+ }
@@ -1,6 +1,6 @@
1
1
  import { Accessor } from '@fluixi/reactive/signal';
2
2
  /**
3
- * A single class condition static boolean or a reactive function.
3
+ * A single class condition: static boolean or a reactive function.
4
4
  */
5
5
  export type ClassCondition = boolean | null | undefined | Accessor<boolean | null | undefined> | (() => boolean | null | undefined);
6
6
  /**
@@ -22,7 +22,7 @@ export type ClassMapInput = Record<string, ClassCondition> | Accessor<Record<str
22
22
  *
23
23
  * @example
24
24
  * // Static
25
- * classMap({ active: true, disabled: false }) // "active"
25
+ * classMap({ active: true, disabled: false }) // -> "active"
26
26
  *
27
27
  * // Per-key reactive values
28
28
  * classMap({ active: isActive, 'text-sm': () => size() === 'sm' })
@@ -30,7 +30,7 @@ export type ClassMapInput = Record<string, ClassCondition> | Accessor<Record<str
30
30
  * // Whole map reactive
31
31
  * classMap(() => ({ active: isActive(), error: hasError() }))
32
32
  *
33
- * // Mixed combine a static base class with reactive conditions
33
+ * // Mixed: combine a static base class with reactive conditions
34
34
  * classMap({ 'btn': true, 'btn-primary': isPrimary, 'btn-disabled': disabled })
35
35
  */
36
36
  export declare function classMap(input: ClassMapInput): Accessor<string>;
@@ -12,7 +12,7 @@ import { createMemo } from '@fluixi/reactive/signal';
12
12
  *
13
13
  * @example
14
14
  * // Static
15
- * classMap({ active: true, disabled: false }) // "active"
15
+ * classMap({ active: true, disabled: false }) // -> "active"
16
16
  *
17
17
  * // Per-key reactive values
18
18
  * classMap({ active: isActive, 'text-sm': () => size() === 'sm' })
@@ -20,7 +20,7 @@ import { createMemo } from '@fluixi/reactive/signal';
20
20
  * // Whole map reactive
21
21
  * classMap(() => ({ active: isActive(), error: hasError() }))
22
22
  *
23
- * // Mixed combine a static base class with reactive conditions
23
+ * // Mixed: combine a static base class with reactive conditions
24
24
  * classMap({ 'btn': true, 'btn-primary': isPrimary, 'btn-disabled': disabled })
25
25
  */
26
26
  export function classMap(input) {
@@ -1 +1,17 @@
1
- import{createMemo as i}from"@fluixi/reactive/signal";function l(n){return i(()=>{let t=typeof n=="function"?n():n,s=[];for(let[e,o]of Object.entries(t)){if(!e)continue;(typeof o=="function"?o():o)&&s.push(e)}return s.join(" ")},void 0,{name:"ClassMap"})}export{l as classMap};
1
+ // src/lib/flow/class-map.ts
2
+ import { createMemo } from "@fluixi/reactive/signal";
3
+ function classMap(input) {
4
+ return createMemo(() => {
5
+ const map = typeof input === "function" ? input() : input;
6
+ const classes = [];
7
+ for (const [cls, cond] of Object.entries(map)) {
8
+ if (!cls) continue;
9
+ const active = typeof cond === "function" ? cond() : cond;
10
+ if (active) classes.push(cls);
11
+ }
12
+ return classes.join(" ");
13
+ }, void 0, { name: "ClassMap" });
14
+ }
15
+ export {
16
+ classMap
17
+ };
@@ -1 +1,57 @@
1
- "use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var f=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},y=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of d(e))!p.call(t,n)&&n!==r&&i(t,n,{get:()=>e[n],enumerable:!(o=c(e,n))||o.enumerable});return t};var v=t=>y(i({},"__esModule",{value:!0}),t);var S={};f(S,{ClientOnly:()=>u,NoSsr:()=>N});module.exports=v(S);var a=require("@fluixi/reactive/signal");var m=Symbol.for("fluixi.dom.server-host"),x=globalThis,h=x[m]??={server:typeof document>"u",nodes:null};function l(){return h.server}var s={active:!1,cursor:null,parents:[]};function u(t){if(l())return t.fallback??null;let e=s.active,[r,o]=(0,a.createSignal)(!e);return e&&queueMicrotask(()=>o(!0)),(0,a.createMemo)(()=>r()?t.children:t.fallback??null,void 0,{name:"client-only"})}var N=u;
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/flow/client-only.ts
21
+ var client_only_exports = {};
22
+ __export(client_only_exports, {
23
+ ClientOnly: () => ClientOnly,
24
+ NoSsr: () => NoSsr
25
+ });
26
+ module.exports = __toCommonJS(client_only_exports);
27
+ var import_signal = require("@fluixi/reactive/signal");
28
+
29
+ // src/lib/dom/server/host.ts
30
+ var STATE = /* @__PURE__ */ Symbol.for("fluixi.dom.server-host");
31
+ var realm = globalThis;
32
+ var state = realm[STATE] ??= {
33
+ server: typeof document === "undefined",
34
+ nodes: null
35
+ };
36
+ function isServer() {
37
+ return state.server;
38
+ }
39
+
40
+ // src/lib/dom/hydration-state.ts
41
+ var hydration = {
42
+ active: false,
43
+ cursor: null,
44
+ parents: []
45
+ };
46
+
47
+ // src/lib/flow/client-only.ts
48
+ function ClientOnly(props) {
49
+ if (isServer()) return props.fallback ?? null;
50
+ const hydrating = hydration.active;
51
+ const [ready, setReady] = (0, import_signal.createSignal)(!hydrating);
52
+ if (hydrating) queueMicrotask(() => setReady(true));
53
+ return (0, import_signal.createMemo)(() => ready() ? props.children : props.fallback ?? null, void 0, {
54
+ name: "client-only"
55
+ });
56
+ }
57
+ var NoSsr = ClientOnly;
@@ -3,7 +3,7 @@ export interface ClientOnlyProps {
3
3
  /**
4
4
  * Rendered instead of `children` on the server, and during hydration.
5
5
  *
6
- * When hydrating, this must produce the same markup the server emitted
6
+ * When hydrating, this must produce the same markup the server emitted,
7
7
  * that is the whole point: the fallback is what both sides agree on.
8
8
  */
9
9
  fallback?: ComponentChild;
@@ -13,13 +13,13 @@ export interface ClientOnlyProps {
13
13
  /**
14
14
  * Renders `children` only in the browser.
15
15
  *
16
- * For subtrees that cannot render on the server they read `window`,
16
+ * For subtrees that cannot render on the server, they read `window`,
17
17
  * `localStorage`, a canvas, or produce time/locale-dependent output that would
18
18
  * differ between the two passes and corrupt hydration.
19
19
  *
20
20
  * The swap is deferred to a microtask rather than done immediately, because
21
21
  * rendering `children` mid-hydration would desync the hydration cursor from the
22
- * server markup the exact bug this component exists to prevent. `hydrate()`
22
+ * server markup, the exact bug this component exists to prevent. `hydrate()`
23
23
  * runs synchronously and clears its flag in a `finally`, so a microtask is the
24
24
  * first moment the pass is guaranteed to be over.
25
25
  *
@@ -36,7 +36,7 @@ export interface ClientOnlyProps {
36
36
  */
37
37
  export declare function ClientOnly(props: ClientOnlyProps): ComponentChild;
38
38
  /**
39
- * `NoSsr` is {@link ClientOnly} the same component under the name used by
39
+ * `NoSsr` is {@link ClientOnly}, the same component under the name used by
40
40
  * other libraries, so the concept is findable either way.
41
41
  */
42
42
  export declare const NoSsr: typeof ClientOnly;
@@ -4,13 +4,13 @@ import { hydration } from '../dom/hydration-state.js';
4
4
  /**
5
5
  * Renders `children` only in the browser.
6
6
  *
7
- * For subtrees that cannot render on the server they read `window`,
7
+ * For subtrees that cannot render on the server, they read `window`,
8
8
  * `localStorage`, a canvas, or produce time/locale-dependent output that would
9
9
  * differ between the two passes and corrupt hydration.
10
10
  *
11
11
  * The swap is deferred to a microtask rather than done immediately, because
12
12
  * rendering `children` mid-hydration would desync the hydration cursor from the
13
- * server markup the exact bug this component exists to prevent. `hydrate()`
13
+ * server markup, the exact bug this component exists to prevent. `hydrate()`
14
14
  * runs synchronously and clears its flag in a `finally`, so a microtask is the
15
15
  * first moment the pass is guaranteed to be over.
16
16
  *
@@ -40,7 +40,7 @@ export function ClientOnly(props) {
40
40
  });
41
41
  }
42
42
  /**
43
- * `NoSsr` is {@link ClientOnly} the same component under the name used by
43
+ * `NoSsr` is {@link ClientOnly}, the same component under the name used by
44
44
  * other libraries, so the concept is findable either way.
45
45
  */
46
46
  export const NoSsr = ClientOnly;