@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
@@ -3,7 +3,7 @@ import { resolveReactiveProp, isLitResult } from './utils.js';
3
3
  /**
4
4
  * Conditionally renders content based on a reactive condition.
5
5
  *
6
- * Returns a memo works in both JSX and `html` templates.
6
+ * Returns a memo: works in both JSX and `html` templates.
7
7
  *
8
8
  * @example JSX
9
9
  * <Show when={isLoggedIn()} fallback={<Login />}>
@@ -13,34 +13,22 @@ import { resolveReactiveProp, isLitResult } from './utils.js';
13
13
  * @example html template
14
14
  * Show({ when: isLoggedIn, fallback: html`<p>Login</p>`, children: html`<p>Dashboard</p>` })
15
15
  */
16
- // export function Show<T>(props: ShowProps<T>): Accessor<any> {
17
- // const when = normalizeAccessor(props.when);
18
16
  // return createMemo(() => {
19
- // const value = when();
20
- // if (isTruthy(value)) {
21
- // return typeof props.children === 'function'
22
- // ? props.children(value)
23
- // : props.children;
24
- // }
25
- // return props.fallback ?? null;
26
- // });
27
- // }
28
17
  export function Show(props) {
29
18
  // Read `when` lazily through the prop getter so `when={cond()}` re-runs the caller's
30
19
  // expression inside these memos (reactive), while `when={cond}` / `when={() => cond}`
31
- // still work resolveReactiveProp unwraps the accessor form once.
20
+ // still work: resolveReactiveProp unwraps the accessor form once.
32
21
  const when = resolveReactiveProp(() => props.when);
33
- // const {when} = props
34
22
  // Named for a watcher: three memos at one line, two of them anonymous, is what a graph of
35
23
  // a page with a few conditions turns into.
36
24
  const value = createMemo(when, undefined, { name: 'Show.when' });
37
25
  const cond = createMemo(value, undefined, { name: 'Show.cond' });
38
26
  // Each branch renders in its own scope so that leaving it tears down whatever
39
- // it registered an event listener, an observer, a timer. Without this the
27
+ // it registered, an event listener, an observer, a timer. Without this the
40
28
  // branch's `onCleanup`s land on the enclosing owner and only run when the
41
29
  // whole tree dies, so a closed <Show> kept listening and reacting.
42
30
  //
43
- // Keyed on which branch is showing, NOT on every re-run: the memo also re-runs
31
+ // Keyed on which branch is showing, not on every re-run: the memo also re-runs
44
32
  // when the value changes within the same branch, and disposing then would
45
33
  // throw away DOM the runtime deliberately reuses.
46
34
  const parentOwner = getOwner();
@@ -60,7 +48,6 @@ export function Show(props) {
60
48
  // return props.fallback ?? null;
61
49
  // }
62
50
  // }
63
- // const value = when();
64
51
  const evaluate = cond();
65
52
  enterBranch(evaluate ? 'when' : 'fallback');
66
53
  return runWithOwner(branchScope, () => {
@@ -82,108 +69,10 @@ export function Show(props) {
82
69
  return props.fallback;
83
70
  });
84
71
  // if (isTruthy(value)) {
85
- // let children = props.children;
86
- // // handle children on jsx
87
- // // if(Array.isArray(children)) {
88
- // // children = makeArrayFlat(children);
89
- // // // console.log('is truthy', children);
90
- // // // if(children)
91
- // // // children = (children as any[]).map((c: any) => typeof c === 'function' ? c(value) : c) as any;
92
- // // // return children;
93
- // // }
94
- // if (typeof children === 'function' && !isLitResult(children)) {
95
- // if (isSignal<any>(value)) {
96
- // // value = (value as any)() as any;
97
- // return (children as (item: T) => any)((value as any)());
98
- // }
99
- // return (children as (item: T) => any)(value as T);
100
- // }
101
- // return children;
102
- // // return typeof props.children === 'function'
103
- // // ? props.children(value)
104
- // // : props.children;
105
- // }
106
- // let value =
107
- // typeof condition === 'function' ? (condition as () => T)() : condition;
108
- // if (value != null && value !== false) {
109
- // // console.log('value', value);
110
- // const children = props.children;
111
- // if (typeof children === 'function' && !isLitResult(children)) {
112
- // if (isSignal<any>(value)) {
113
- // value = (value as any)() as any;
114
- // }
115
- // return (children as (item: T) => any)(value as T);
116
- // }
117
- // return children;
118
- // }
119
72
  return props.fallback ?? null;
120
73
  }, undefined,
121
74
  // Not `Show`: the compiler already marks the memo it wraps the component in with that,
122
75
  // and two cards of the same name in one graph is worse than a longer one.
123
76
  { name: 'Show.result' });
124
77
  }
125
- // export function Show1<T>(props: ShowProps<T>): any {
126
- // const when = normalizeAccessor(props.when);
127
- // return createMemo(
128
- // () => {
129
- // if (isResource(when)) {
130
- // if (when.loading) {
131
- // return props.fallback ?? null;
132
- // }
133
- // }
134
- // const value = when();
135
- // if (isTruthy(value)) {
136
- // let children = props.children;
137
- // // handle children on jsx
138
- // // if(Array.isArray(children)) {
139
- // // children = makeArrayFlat(children);
140
- // // // console.log('is truthy', children);
141
- // // // if(children)
142
- // // // children = (children as any[]).map((c: any) => typeof c === 'function' ? c(value) : c) as any;
143
- // // // return children;
144
- // // }
145
- // if (typeof children === 'function' && !isLitResult(children)) {
146
- // if (isSignal<any>(value)) {
147
- // // value = (value as any)() as any;
148
- // return (children as (item: T) => any)((value as any)());
149
- // }
150
- // return (children as (item: T) => any)(value as T);
151
- // }
152
- // return children;
153
- // // return typeof props.children === 'function'
154
- // // ? props.children(value)
155
- // // : props.children;
156
- // }
157
- // // let value =
158
- // // typeof condition === 'function' ? (condition as () => T)() : condition;
159
- // // if (value != null && value !== false) {
160
- // // // console.log('value', value);
161
- // // const children = props.children;
162
- // // if (typeof children === 'function' && !isLitResult(children)) {
163
- // // if (isSignal<any>(value)) {
164
- // // value = (value as any)() as any;
165
- // // }
166
- // // return (children as (item: T) => any)(value as T);
167
- // // }
168
- // // return children;
169
- // // }
170
- // return props.fallback ?? null;
171
- // },
172
- // undefined,
173
- // { name: 'show' }
174
- // );
175
- // }
176
78
  // if (isTruthy(value)) {
177
- // const children = props.children;
178
- // if (typeof children === 'function' && !isLitResult(children)) {
179
- // if (isSignal<any>(value)) {
180
- // // value = (value as any)() as any;
181
- // return (children as (item: T) => any)((value as any)());
182
- // }
183
- // return (children as (item: T) => any)(value as T);
184
- // }
185
- // return children;
186
- // // return typeof props.children === 'function'
187
- // // ? props.children(value)
188
- // // : props.children;
189
- // }
@@ -1 +1,67 @@
1
- import{createChildOwner as y,createMemo as i,disposeScope as h,getOwner as p,runWithOwner as w,untrack as f}from"@fluixi/reactive/signal";function s(e){return()=>{let n=e();return typeof n=="function"?n():n}}function l(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function O(e){let n=s(()=>e.when),r=i(n,void 0,{name:"Show.when"}),u=i(r,void 0,{name:"Show.cond"}),T=p(),a=null,c=null,d=t=>{t!==c&&(a&&h(a),a=y(T),c=t)};return i(()=>{let t=u();return d(t?"when":"fallback"),w(a,()=>{if(t){let o=e.children;return typeof o=="function"&&!l(o)?typeof r=="function"?f(()=>f(r)?o(r()):e.fallback):o(r):o}return e.fallback});return e.fallback??null},void 0,{name:"Show.result"})}export{O as Show};
1
+ // src/lib/flow/show.ts
2
+ import {
3
+ createChildOwner,
4
+ createMemo,
5
+ disposeScope,
6
+ getOwner,
7
+ runWithOwner,
8
+ untrack
9
+ } from "@fluixi/reactive/signal";
10
+
11
+ // src/lib/flow/utils.ts
12
+ function resolveReactiveProp(read) {
13
+ return () => {
14
+ const value = read();
15
+ return typeof value === "function" ? value() : value;
16
+ };
17
+ }
18
+ function isLitResult(value) {
19
+ if (!value || typeof value !== "object") return false;
20
+ return !!(typeof value["_$litType$"] !== "undefined" || typeof value["_$litDirective$"] !== "undefined" || Array.isArray(value.strings) && Array.isArray(value.values));
21
+ }
22
+
23
+ // src/lib/flow/show.ts
24
+ function Show(props) {
25
+ const when = resolveReactiveProp(() => props.when);
26
+ const value = createMemo(when, void 0, { name: "Show.when" });
27
+ const cond = createMemo(value, void 0, { name: "Show.cond" });
28
+ const parentOwner = getOwner();
29
+ let branchScope = null;
30
+ let shown = null;
31
+ const enterBranch = (next) => {
32
+ if (next === shown) return;
33
+ if (branchScope) disposeScope(branchScope);
34
+ branchScope = createChildOwner(parentOwner);
35
+ shown = next;
36
+ };
37
+ return createMemo(
38
+ () => {
39
+ const evaluate = cond();
40
+ enterBranch(evaluate ? "when" : "fallback");
41
+ return runWithOwner(branchScope, () => {
42
+ if (evaluate) {
43
+ let children = props.children;
44
+ if (typeof children === "function" && !isLitResult(children)) {
45
+ if (typeof value === "function") {
46
+ return untrack(() => {
47
+ if (!untrack(value)) return props.fallback;
48
+ return children(value());
49
+ });
50
+ }
51
+ return children(value);
52
+ }
53
+ return children;
54
+ }
55
+ return props.fallback;
56
+ });
57
+ return props.fallback ?? null;
58
+ },
59
+ void 0,
60
+ // Not `Show`: the compiler already marks the memo it wraps the component in with that,
61
+ // and two cards of the same name in one graph is worse than a longer one.
62
+ { name: "Show.result" }
63
+ );
64
+ }
65
+ export {
66
+ Show
67
+ };
@@ -1 +1,43 @@
1
- "use strict";var o=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var f=(e,n)=>{for(var r in n)o(e,r,{get:n[r],enumerable:!0})},d=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of c(n))!a.call(e,t)&&t!==r&&o(e,t,{get:()=>n[t],enumerable:!(s=i(n,t))||s.enumerable});return e};var p=e=>d(o({},"__esModule",{value:!0}),e);var m={};f(m,{styleMap:()=>y});module.exports=p(m);var l=require("@fluixi/reactive/signal");function g(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}function y(e){return(0,l.createMemo)(()=>{let n=typeof e=="function"?e():e,r=[];for(let[s,t]of Object.entries(n)){if(!s)continue;let u=typeof t=="function"?t():t;u!=null&&r.push(`${g(s)}: ${u}`)}return r.join("; ")},void 0,{name:"StyleMap"})}
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/style-map.ts
21
+ var style_map_exports = {};
22
+ __export(style_map_exports, {
23
+ styleMap: () => styleMap
24
+ });
25
+ module.exports = __toCommonJS(style_map_exports);
26
+ var import_signal = require("@fluixi/reactive/signal");
27
+ function toKebab(prop) {
28
+ return prop.startsWith("--") ? prop : prop.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
29
+ }
30
+ function styleMap(input) {
31
+ return (0, import_signal.createMemo)(() => {
32
+ const map = typeof input === "function" ? input() : input;
33
+ const parts = [];
34
+ for (const [prop, val] of Object.entries(map)) {
35
+ if (!prop) continue;
36
+ const resolved = typeof val === "function" ? val() : val;
37
+ if (resolved != null) {
38
+ parts.push(`${toKebab(prop)}: ${resolved}`);
39
+ }
40
+ }
41
+ return parts.join("; ");
42
+ }, void 0, { name: "StyleMap" });
43
+ }
@@ -1,6 +1,6 @@
1
1
  import { Accessor } from '@fluixi/reactive/signal';
2
2
  /**
3
- * A single style property value static or reactive.
3
+ * A single style property value: static or reactive.
4
4
  * Numbers are converted to strings as-is (no `px` appended automatically).
5
5
  */
6
6
  export type StyleValue = string | number | null | undefined | Accessor<string | number | null | undefined> | (() => string | number | null | undefined);
@@ -36,11 +36,11 @@ export type StyleMapInput = Record<string, StyleValue> | Accessor<Record<string,
36
36
  *
37
37
  * // camelCase is converted automatically
38
38
  * styleMap({ backgroundColor: '#fff', fontSize: '1rem' })
39
- * // "background-color: #fff; font-size: 1rem"
39
+ * // -> "background-color: #fff; font-size: 1rem"
40
40
  *
41
41
  * // CSS custom properties pass through unchanged
42
42
  * styleMap({ '--radius': radius })
43
- * // "--radius: 8px"
43
+ * // -> "--radius: 8px"
44
44
  */
45
45
  export declare function styleMap(input: StyleMapInput): Accessor<string>;
46
46
  //# sourceMappingURL=style-map.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { createMemo } from '@fluixi/reactive/signal';
2
- /** camelCase kebab-case; CSS custom properties (--) pass through unchanged. */
2
+ /** camelCase -> kebab-case; CSS custom properties (--) pass through unchanged. */
3
3
  function toKebab(prop) {
4
4
  return prop.startsWith('--')
5
5
  ? prop
@@ -28,11 +28,11 @@ function toKebab(prop) {
28
28
  *
29
29
  * // camelCase is converted automatically
30
30
  * styleMap({ backgroundColor: '#fff', fontSize: '1rem' })
31
- * // "background-color: #fff; font-size: 1rem"
31
+ * // -> "background-color: #fff; font-size: 1rem"
32
32
  *
33
33
  * // CSS custom properties pass through unchanged
34
34
  * styleMap({ '--radius': radius })
35
- * // "--radius: 8px"
35
+ * // -> "--radius: 8px"
36
36
  */
37
37
  export function styleMap(input) {
38
38
  return createMemo(() => {
@@ -1 +1,22 @@
1
- import{createMemo as u}from"@fluixi/reactive/signal";function l(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}function a(e){return u(()=>{let n=typeof e=="function"?e():e,r=[];for(let[s,t]of Object.entries(n)){if(!s)continue;let o=typeof t=="function"?t():t;o!=null&&r.push(`${l(s)}: ${o}`)}return r.join("; ")},void 0,{name:"StyleMap"})}export{a as styleMap};
1
+ // src/lib/flow/style-map.ts
2
+ import { createMemo } from "@fluixi/reactive/signal";
3
+ function toKebab(prop) {
4
+ return prop.startsWith("--") ? prop : prop.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
5
+ }
6
+ function styleMap(input) {
7
+ return createMemo(() => {
8
+ const map = typeof input === "function" ? input() : input;
9
+ const parts = [];
10
+ for (const [prop, val] of Object.entries(map)) {
11
+ if (!prop) continue;
12
+ const resolved = typeof val === "function" ? val() : val;
13
+ if (resolved != null) {
14
+ parts.push(`${toKebab(prop)}: ${resolved}`);
15
+ }
16
+ }
17
+ return parts.join("; ");
18
+ }, void 0, { name: "StyleMap" });
19
+ }
20
+ export {
21
+ styleMap
22
+ };
@@ -1 +1,91 @@
1
- "use strict";var l=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var w=(e,n)=>{for(var a in n)l(e,a,{get:n[a],enumerable:!0})},b=(e,n,a,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of p(n))!A.call(e,o)&&o!==a&&l(e,o,{get:()=>n[o],enumerable:!(c=y(n,o))||c.enumerable});return e};var M=e=>b(l({},"__esModule",{value:!0}),e);var x={};w(x,{Match:()=>m,Switch:()=>N});module.exports=M(x);var t=require("@fluixi/reactive/signal");function h(e){return()=>{let n=e();return typeof n=="function"?n():n}}function d(e){return e!=null&&e!==!1}var s=Symbol("match");function m(e){return{[s]:!0,when:h(()=>e.when),get children(){return e.children}}}function N(e){let n=Array.isArray(e.children)?e.children:[e.children],a=(0,t.getOwner)(),c=null,o=-1,f=i=>{i!==o&&(c&&(0,t.disposeScope)(c),c=(0,t.createChildOwner)(a),o=i)};return(0,t.createMemo)(()=>{for(let i=0;i<n.length;i+=1){let r=n[i],T=0;for(;typeof r=="function"&&!r[s]&&T++<10;)r=r();if(!r||typeof r!="object"||r[s]!==!0)continue;let u=r.when();if(d(u))return f(i),(0,t.runWithOwner)(c,()=>typeof r.children=="function"?r.children(u):r.children)}return f(-2),(0,t.runWithOwner)(c,()=>e.fallback??null)},void 0,{name:"Switch"})}
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/switch.ts
21
+ var switch_exports = {};
22
+ __export(switch_exports, {
23
+ Match: () => Match,
24
+ Switch: () => Switch
25
+ });
26
+ module.exports = __toCommonJS(switch_exports);
27
+ var import_signal = require("@fluixi/reactive/signal");
28
+
29
+ // src/lib/flow/utils.ts
30
+ function resolveReactiveProp(read) {
31
+ return () => {
32
+ const value = read();
33
+ return typeof value === "function" ? value() : value;
34
+ };
35
+ }
36
+ function isTruthy(value) {
37
+ return value !== null && value !== void 0 && value !== false;
38
+ }
39
+
40
+ // src/lib/flow/switch.ts
41
+ var MATCH_MARKER = /* @__PURE__ */ Symbol("match");
42
+ function Match(props) {
43
+ return {
44
+ [MATCH_MARKER]: true,
45
+ // Lazy read through the prop getter. Switch calls `branch.when()` inside its memo,
46
+ // so `when={cond()}` reacts; `when={cond}` unwraps via resolveReactiveProp.
47
+ when: resolveReactiveProp(() => props.when),
48
+ // Lazy, like `when`. Read eagerly, every branch's children were built the
49
+ // moment the Match node was, before Switch had chosen one, so they were
50
+ // created outside the branch's scope (and non-matching branches were built
51
+ // for nothing). Switch reads this inside the selected branch's scope.
52
+ get children() {
53
+ return props.children;
54
+ }
55
+ };
56
+ }
57
+ function Switch(props) {
58
+ const branches = Array.isArray(props.children) ? props.children : [props.children];
59
+ const parentOwner = (0, import_signal.getOwner)();
60
+ let branchScope = null;
61
+ let shown = -1;
62
+ const enterBranch = (index) => {
63
+ if (index === shown) return;
64
+ if (branchScope) (0, import_signal.disposeScope)(branchScope);
65
+ branchScope = (0, import_signal.createChildOwner)(parentOwner);
66
+ shown = index;
67
+ };
68
+ return (0, import_signal.createMemo)(() => {
69
+ for (let i = 0; i < branches.length; i += 1) {
70
+ const raw = branches[i];
71
+ let branch = raw;
72
+ let guard = 0;
73
+ while (typeof branch === "function" && !branch[MATCH_MARKER] && guard++ < 10) {
74
+ branch = branch();
75
+ }
76
+ if (!branch || typeof branch !== "object" || branch[MATCH_MARKER] !== true) {
77
+ continue;
78
+ }
79
+ const value = branch.when();
80
+ if (isTruthy(value)) {
81
+ enterBranch(i);
82
+ return (0, import_signal.runWithOwner)(
83
+ branchScope,
84
+ () => typeof branch.children === "function" ? branch.children(value) : branch.children
85
+ );
86
+ }
87
+ }
88
+ enterBranch(-2);
89
+ return (0, import_signal.runWithOwner)(branchScope, () => props.fallback ?? null);
90
+ }, void 0, { name: "Switch" });
91
+ }
@@ -9,7 +9,7 @@ export interface MatchProps<T> {
9
9
  */
10
10
  children: any | ((val: NonNullable<T>) => any);
11
11
  }
12
- /** @internal Opaque shape returned by Match consumed by Switch. */
12
+ /** @internal Opaque shape returned by Match: consumed by Switch. */
13
13
  export interface MatchNode<T = any> {
14
14
  [MATCH_MARKER]: true;
15
15
  when: Accessor<T | null | undefined | false>;
@@ -38,10 +38,10 @@ export interface SwitchProps {
38
38
  children: MatchNode | MatchNode[];
39
39
  }
40
40
  /**
41
- * Multi-branch conditional rendering mirrors SolidJS `<Switch>/<Match>`.
41
+ * Multi-branch conditional rendering: mirrors SolidJS `<Switch>/<Match>`.
42
42
  *
43
43
  * Evaluates `Match` branches in order and renders the first truthy one.
44
- * Returns a memo works in both JSX and `html` templates.
44
+ * Returns a memo: works in both JSX and `html` templates.
45
45
  *
46
46
  * @example JSX
47
47
  * <Switch fallback={<p>Nothing</p>}>
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/lib/flow/switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkF,MAAM,yBAAyB,CAAC;AAInI,QAAA,MAAM,YAAY,eAAkB,CAAC;AAErC,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,4CAA4C;IAC5C,IAAI,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC;IACjD;;;OAGG;IACH,QAAQ,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;CAChD;AAED,qEAAqE;AACrE,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG;IAChC,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC;IAC7C,QAAQ,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;CAChD;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAc3D;AAED,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf;;;;;OAKG;IACH,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,CA6CxD"}
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/lib/flow/switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkF,MAAM,yBAAyB,CAAC;AAInI,QAAA,MAAM,YAAY,eAAkB,CAAC;AAErC,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,4CAA4C;IAC5C,IAAI,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC;IACjD;;;OAGG;IACH,QAAQ,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;CAChD;AAED,oEAAoE;AACpE,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG;IAChC,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC;IAC7C,QAAQ,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;CAChD;AAED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAc3D;AAED,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf;;;;;OAKG;IACH,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,CA6CxD"}
@@ -15,11 +15,11 @@ const MATCH_MARKER = Symbol('match');
15
15
  export function Match(props) {
16
16
  return {
17
17
  [MATCH_MARKER]: true,
18
- // Lazy read through the prop getter Switch calls `branch.when()` inside its memo,
18
+ // Lazy read through the prop getter. Switch calls `branch.when()` inside its memo,
19
19
  // so `when={cond()}` reacts; `when={cond}` unwraps via resolveReactiveProp.
20
20
  when: resolveReactiveProp(() => props.when),
21
21
  // Lazy, like `when`. Read eagerly, every branch's children were built the
22
- // moment the Match node was before Switch had chosen one so they were
22
+ // moment the Match node was, before Switch had chosen one, so they were
23
23
  // created outside the branch's scope (and non-matching branches were built
24
24
  // for nothing). Switch reads this inside the selected branch's scope.
25
25
  get children() {
@@ -28,10 +28,10 @@ export function Match(props) {
28
28
  };
29
29
  }
30
30
  /**
31
- * Multi-branch conditional rendering mirrors SolidJS `<Switch>/<Match>`.
31
+ * Multi-branch conditional rendering: mirrors SolidJS `<Switch>/<Match>`.
32
32
  *
33
33
  * Evaluates `Match` branches in order and renders the first truthy one.
34
- * Returns a memo works in both JSX and `html` templates.
34
+ * Returns a memo: works in both JSX and `html` templates.
35
35
  *
36
36
  * @example JSX
37
37
  * <Switch fallback={<p>Nothing</p>}>
@@ -51,8 +51,8 @@ export function Match(props) {
51
51
  export function Switch(props) {
52
52
  const branches = Array.isArray(props.children) ? props.children : [props.children];
53
53
  // Each branch renders in its own scope, disposed when a different branch takes
54
- // over, so whatever it registered with `onCleanup` a listener, an observer, a
55
- // timer goes with it. Keyed on which branch is showing, not on every re-run:
54
+ // over, so whatever it registered with `onCleanup`, a listener, an observer, a
55
+ // timer: goes with it. Keyed on which branch is showing, not on every re-run:
56
56
  // the memo also re-runs when a `when` value changes within the same branch, and
57
57
  // disposing then would throw away DOM the runtime deliberately reuses.
58
58
  const parentOwner = getOwner();
@@ -1 +1,70 @@
1
- import{createMemo as T,createChildOwner as y,disposeScope as p,getOwner as A,runWithOwner as u}from"@fluixi/reactive/signal";function s(e){return()=>{let t=e();return typeof t=="function"?t():t}}function f(e){return e!=null&&e!==!1}var o=Symbol("match");function x(e){return{[o]:!0,when:s(()=>e.when),get children(){return e.children}}}function R(e){let t=Array.isArray(e.children)?e.children:[e.children],h=A(),c=null,i=-1,a=r=>{r!==i&&(c&&p(c),c=y(h),i=r)};return T(()=>{for(let r=0;r<t.length;r+=1){let n=t[r],d=0;for(;typeof n=="function"&&!n[o]&&d++<10;)n=n();if(!n||typeof n!="object"||n[o]!==!0)continue;let l=n.when();if(f(l))return a(r),u(c,()=>typeof n.children=="function"?n.children(l):n.children)}return a(-2),u(c,()=>e.fallback??null)},void 0,{name:"Switch"})}export{x as Match,R as Switch};
1
+ // src/lib/flow/switch.ts
2
+ import { createMemo, createChildOwner, disposeScope, getOwner, runWithOwner } from "@fluixi/reactive/signal";
3
+
4
+ // src/lib/flow/utils.ts
5
+ function resolveReactiveProp(read) {
6
+ return () => {
7
+ const value = read();
8
+ return typeof value === "function" ? value() : value;
9
+ };
10
+ }
11
+ function isTruthy(value) {
12
+ return value !== null && value !== void 0 && value !== false;
13
+ }
14
+
15
+ // src/lib/flow/switch.ts
16
+ var MATCH_MARKER = /* @__PURE__ */ Symbol("match");
17
+ function Match(props) {
18
+ return {
19
+ [MATCH_MARKER]: true,
20
+ // Lazy read through the prop getter. Switch calls `branch.when()` inside its memo,
21
+ // so `when={cond()}` reacts; `when={cond}` unwraps via resolveReactiveProp.
22
+ when: resolveReactiveProp(() => props.when),
23
+ // Lazy, like `when`. Read eagerly, every branch's children were built the
24
+ // moment the Match node was, before Switch had chosen one, so they were
25
+ // created outside the branch's scope (and non-matching branches were built
26
+ // for nothing). Switch reads this inside the selected branch's scope.
27
+ get children() {
28
+ return props.children;
29
+ }
30
+ };
31
+ }
32
+ function Switch(props) {
33
+ const branches = Array.isArray(props.children) ? props.children : [props.children];
34
+ const parentOwner = getOwner();
35
+ let branchScope = null;
36
+ let shown = -1;
37
+ const enterBranch = (index) => {
38
+ if (index === shown) return;
39
+ if (branchScope) disposeScope(branchScope);
40
+ branchScope = createChildOwner(parentOwner);
41
+ shown = index;
42
+ };
43
+ return createMemo(() => {
44
+ for (let i = 0; i < branches.length; i += 1) {
45
+ const raw = branches[i];
46
+ let branch = raw;
47
+ let guard = 0;
48
+ while (typeof branch === "function" && !branch[MATCH_MARKER] && guard++ < 10) {
49
+ branch = branch();
50
+ }
51
+ if (!branch || typeof branch !== "object" || branch[MATCH_MARKER] !== true) {
52
+ continue;
53
+ }
54
+ const value = branch.when();
55
+ if (isTruthy(value)) {
56
+ enterBranch(i);
57
+ return runWithOwner(
58
+ branchScope,
59
+ () => typeof branch.children === "function" ? branch.children(value) : branch.children
60
+ );
61
+ }
62
+ }
63
+ enterBranch(-2);
64
+ return runWithOwner(branchScope, () => props.fallback ?? null);
65
+ }, void 0, { name: "Switch" });
66
+ }
67
+ export {
68
+ Match,
69
+ Switch
70
+ };
@@ -1 +1,44 @@
1
- "use strict";var s=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var T=(e,r)=>{for(var o in r)s(e,o,{get:r[o],enumerable:!0})},u=(e,r,o,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of c(r))!f.call(e,n)&&n!==o&&s(e,n,{get:()=>r[n],enumerable:!(t=i(r,n))||t.enumerable});return e};var p=e=>u(s({},"__esModule",{value:!0}),e);var d={};T(d,{isLitResult:()=>l,isTruthy:()=>a,normalizeAccessor:()=>y,resolveReactiveProp:()=>A});module.exports=p(d);function y(e){return typeof e=="function"?e:(()=>e)}function A(e){return()=>{let r=e();return typeof r=="function"?r():r}}function a(e){return e!=null&&e!==!1}function l(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}
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/utils.ts
21
+ var utils_exports = {};
22
+ __export(utils_exports, {
23
+ isLitResult: () => isLitResult,
24
+ isTruthy: () => isTruthy,
25
+ normalizeAccessor: () => normalizeAccessor,
26
+ resolveReactiveProp: () => resolveReactiveProp
27
+ });
28
+ module.exports = __toCommonJS(utils_exports);
29
+ function normalizeAccessor(value) {
30
+ return typeof value === "function" ? value : (() => value);
31
+ }
32
+ function resolveReactiveProp(read) {
33
+ return () => {
34
+ const value = read();
35
+ return typeof value === "function" ? value() : value;
36
+ };
37
+ }
38
+ function isTruthy(value) {
39
+ return value !== null && value !== void 0 && value !== false;
40
+ }
41
+ function isLitResult(value) {
42
+ if (!value || typeof value !== "object") return false;
43
+ return !!(typeof value["_$litType$"] !== "undefined" || typeof value["_$litDirective$"] !== "undefined" || Array.isArray(value.strings) && Array.isArray(value.values));
44
+ }
@@ -8,7 +8,7 @@ export declare function normalizeAccessor<T>(value: T | Accessor<T>): Accessor<T
8
8
  *
9
9
  * The compiler emits control-flow value props (each/when/component/mount) as getters, so
10
10
  * `read()` re-runs the caller's expression INSIDE the tracking scope where the returned
11
- * accessor is invoked this is what makes `each={items()}` reactive. If the read value is
11
+ * accessor is invoked, this is what makes `each={items()}` reactive. If the read value is
12
12
  * itself a function (the `each={items}` accessor form), it is called once. This unwraps at
13
13
  * most one level, so `each={() => items()}` doesn't double-call.
14
14
  */
@@ -11,7 +11,7 @@ export function normalizeAccessor(value) {
11
11
  *
12
12
  * The compiler emits control-flow value props (each/when/component/mount) as getters, so
13
13
  * `read()` re-runs the caller's expression INSIDE the tracking scope where the returned
14
- * accessor is invoked this is what makes `each={items()}` reactive. If the read value is
14
+ * accessor is invoked, this is what makes `each={items()}` reactive. If the read value is
15
15
  * itself a function (the `each={items}` accessor form), it is called once. This unwraps at
16
16
  * most one level, so `each={() => items()}` doesn't double-call.
17
17
  */