@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,128 @@
1
- "use strict";var o=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)o(t,n,{get:e[n],enumerable:!0})},O=(t,e,n,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!S.call(t,r)&&r!==n&&o(t,r,{get:()=>e[r],enumerable:!(u=m(e,r))||u.enumerable});return t};var P=t=>O(o({},"__esModule",{value:!0}),t);var w={};d(w,{asComponent:()=>T,asContext:()=>k,asOutlet:()=>C,asProvider:()=>h,asRoute:()=>R,asRouter:()=>j,asRoutes:()=>a,asSuspense:()=>g,checkRenderType:()=>q,isComponent:()=>s,isContext:()=>x,isOutlet:()=>y,isProvider:()=>c,isRoute:()=>p,isRouter:()=>i,isRoutes:()=>f,isSuspense:()=>b});module.exports=P(w);function j(t){return Object.defineProperty(t,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),t}function a(t){return Object.defineProperty(t,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),t}function R(t){return Object.defineProperty(t,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),t}function C(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),t}function h(t){return Object.defineProperty(t,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),t}function k(t){return Object.defineProperty(t,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),t}function T(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),t}function g(t){return Object.defineProperty(t,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),t}function i(t){return typeof t=="function"&&t[Symbol.for("fluixi-router")]===!0}function f(t){return typeof t=="function"&&t[Symbol.for("fluixi-routes")]===!0}function p(t){return typeof t=="function"&&t[Symbol.for("fluixi-route")]===!0}function y(t){return typeof t=="function"&&t[Symbol.for("fluixi-outlet")]===!0}function c(t){return typeof t=="function"&&t[Symbol.for("fluixi-provider")]===!0}function x(t){return typeof t=="function"&&t[Symbol.for("fluixi-context")]===!0}function s(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}function b(t){return typeof t=="function"&&t[Symbol.for("fluixi-suspense")]===!0}function q(t){return i(t)?{type:"router",value:t}:p(t)?{type:"route",value:t}:f(t)?{type:"routes",value:t}:y(t)?{type:"outlet",value:t}:s(t)?{type:"component",value:t}:b(t)?{type:"suspense",value:t}:c(t)?{type:"provider",value:t}:x(t)?{type:"context",value:t}:{type:"none",value:t}}
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/component/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ asComponent: () => asComponent,
24
+ asContext: () => asContext,
25
+ asOutlet: () => asOutlet,
26
+ asProvider: () => asProvider,
27
+ asRoute: () => asRoute,
28
+ asRouter: () => asRouter,
29
+ asRoutes: () => asRoutes,
30
+ asSuspense: () => asSuspense,
31
+ checkRenderType: () => checkRenderType,
32
+ isComponent: () => isComponent,
33
+ isContext: () => isContext,
34
+ isOutlet: () => isOutlet,
35
+ isProvider: () => isProvider,
36
+ isRoute: () => isRoute,
37
+ isRouter: () => isRouter,
38
+ isRoutes: () => isRoutes,
39
+ isSuspense: () => isSuspense
40
+ });
41
+ module.exports = __toCommonJS(index_exports);
42
+
43
+ // src/lib/component/modifiers.ts
44
+ function asRouter(value) {
45
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-router"), { value: true, enumerable: true });
46
+ return value;
47
+ }
48
+ function asRoutes(value) {
49
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-routes"), { value: true, enumerable: true });
50
+ return value;
51
+ }
52
+ function asRoute(value) {
53
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-route"), { value: true, enumerable: true });
54
+ return value;
55
+ }
56
+ function asOutlet(value) {
57
+ if (typeof value !== "function") return value;
58
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-outlet"), { value: true, enumerable: true });
59
+ return value;
60
+ }
61
+ function asProvider(value) {
62
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-provider"), { value: true, enumerable: true });
63
+ return value;
64
+ }
65
+ function asContext(value) {
66
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-context"), { value: true, enumerable: true });
67
+ return value;
68
+ }
69
+ function asComponent(value) {
70
+ if (typeof value !== "function") return value;
71
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-component"), { value: true, enumerable: true });
72
+ return value;
73
+ }
74
+ function asSuspense(value) {
75
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-suspense"), { value: true, enumerable: true });
76
+ return value;
77
+ }
78
+ function isRouter(value) {
79
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-router")] === true;
80
+ }
81
+ function isRoutes(value) {
82
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-routes")] === true;
83
+ }
84
+ function isRoute(value) {
85
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-route")] === true;
86
+ }
87
+ function isOutlet(value) {
88
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-outlet")] === true;
89
+ }
90
+ function isProvider(value) {
91
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-provider")] === true;
92
+ }
93
+ function isContext(value) {
94
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-context")] === true;
95
+ }
96
+ function isComponent(value) {
97
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-component")] === true;
98
+ }
99
+ function isSuspense(value) {
100
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-suspense")] === true;
101
+ }
102
+ function checkRenderType(value) {
103
+ if (isRouter(value)) {
104
+ return { type: "router", value };
105
+ }
106
+ if (isRoute(value)) {
107
+ return { type: "route", value };
108
+ }
109
+ if (isRoutes(value)) {
110
+ return { type: "routes", value };
111
+ }
112
+ if (isOutlet(value)) {
113
+ return { type: "outlet", value };
114
+ }
115
+ if (isComponent(value)) {
116
+ return { type: "component", value };
117
+ }
118
+ if (isSuspense(value)) {
119
+ return { type: "suspense", value };
120
+ }
121
+ if (isProvider(value)) {
122
+ return { type: "provider", value };
123
+ }
124
+ if (isContext(value)) {
125
+ return { type: "context", value };
126
+ }
127
+ return { type: "none", value };
128
+ }
@@ -1 +1,105 @@
1
- function y(t){return Object.defineProperty(t,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),t}function c(t){return Object.defineProperty(t,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),t}function x(t){return Object.defineProperty(t,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),t}function s(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),t}function b(t){return Object.defineProperty(t,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),t}function m(t){return Object.defineProperty(t,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),t}function l(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),t}function S(t){return Object.defineProperty(t,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),t}function e(t){return typeof t=="function"&&t[Symbol.for("fluixi-router")]===!0}function r(t){return typeof t=="function"&&t[Symbol.for("fluixi-routes")]===!0}function n(t){return typeof t=="function"&&t[Symbol.for("fluixi-route")]===!0}function o(t){return typeof t=="function"&&t[Symbol.for("fluixi-outlet")]===!0}function u(t){return typeof t=="function"&&t[Symbol.for("fluixi-provider")]===!0}function i(t){return typeof t=="function"&&t[Symbol.for("fluixi-context")]===!0}function f(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}function p(t){return typeof t=="function"&&t[Symbol.for("fluixi-suspense")]===!0}function d(t){return e(t)?{type:"router",value:t}:n(t)?{type:"route",value:t}:r(t)?{type:"routes",value:t}:o(t)?{type:"outlet",value:t}:f(t)?{type:"component",value:t}:p(t)?{type:"suspense",value:t}:u(t)?{type:"provider",value:t}:i(t)?{type:"context",value:t}:{type:"none",value:t}}export{l as asComponent,m as asContext,s as asOutlet,b as asProvider,x as asRoute,y as asRouter,c as asRoutes,S as asSuspense,d as checkRenderType,f as isComponent,i as isContext,o as isOutlet,u as isProvider,n as isRoute,e as isRouter,r as isRoutes,p as isSuspense};
1
+ // src/lib/component/modifiers.ts
2
+ function asRouter(value) {
3
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-router"), { value: true, enumerable: true });
4
+ return value;
5
+ }
6
+ function asRoutes(value) {
7
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-routes"), { value: true, enumerable: true });
8
+ return value;
9
+ }
10
+ function asRoute(value) {
11
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-route"), { value: true, enumerable: true });
12
+ return value;
13
+ }
14
+ function asOutlet(value) {
15
+ if (typeof value !== "function") return value;
16
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-outlet"), { value: true, enumerable: true });
17
+ return value;
18
+ }
19
+ function asProvider(value) {
20
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-provider"), { value: true, enumerable: true });
21
+ return value;
22
+ }
23
+ function asContext(value) {
24
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-context"), { value: true, enumerable: true });
25
+ return value;
26
+ }
27
+ function asComponent(value) {
28
+ if (typeof value !== "function") return value;
29
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-component"), { value: true, enumerable: true });
30
+ return value;
31
+ }
32
+ function asSuspense(value) {
33
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-suspense"), { value: true, enumerable: true });
34
+ return value;
35
+ }
36
+ function isRouter(value) {
37
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-router")] === true;
38
+ }
39
+ function isRoutes(value) {
40
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-routes")] === true;
41
+ }
42
+ function isRoute(value) {
43
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-route")] === true;
44
+ }
45
+ function isOutlet(value) {
46
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-outlet")] === true;
47
+ }
48
+ function isProvider(value) {
49
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-provider")] === true;
50
+ }
51
+ function isContext(value) {
52
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-context")] === true;
53
+ }
54
+ function isComponent(value) {
55
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-component")] === true;
56
+ }
57
+ function isSuspense(value) {
58
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-suspense")] === true;
59
+ }
60
+ function checkRenderType(value) {
61
+ if (isRouter(value)) {
62
+ return { type: "router", value };
63
+ }
64
+ if (isRoute(value)) {
65
+ return { type: "route", value };
66
+ }
67
+ if (isRoutes(value)) {
68
+ return { type: "routes", value };
69
+ }
70
+ if (isOutlet(value)) {
71
+ return { type: "outlet", value };
72
+ }
73
+ if (isComponent(value)) {
74
+ return { type: "component", value };
75
+ }
76
+ if (isSuspense(value)) {
77
+ return { type: "suspense", value };
78
+ }
79
+ if (isProvider(value)) {
80
+ return { type: "provider", value };
81
+ }
82
+ if (isContext(value)) {
83
+ return { type: "context", value };
84
+ }
85
+ return { type: "none", value };
86
+ }
87
+ export {
88
+ asComponent,
89
+ asContext,
90
+ asOutlet,
91
+ asProvider,
92
+ asRoute,
93
+ asRouter,
94
+ asRoutes,
95
+ asSuspense,
96
+ checkRenderType,
97
+ isComponent,
98
+ isContext,
99
+ isOutlet,
100
+ isProvider,
101
+ isRoute,
102
+ isRouter,
103
+ isRoutes,
104
+ isSuspense
105
+ };
@@ -1 +1,126 @@
1
- "use strict";var o=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)o(t,n,{get:e[n],enumerable:!0})},O=(t,e,n,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!S.call(t,r)&&r!==n&&o(t,r,{get:()=>e[r],enumerable:!(u=m(e,r))||u.enumerable});return t};var P=t=>O(o({},"__esModule",{value:!0}),t);var w={};d(w,{asComponent:()=>T,asContext:()=>k,asOutlet:()=>C,asProvider:()=>h,asRoute:()=>R,asRouter:()=>j,asRoutes:()=>a,asSuspense:()=>g,checkRenderType:()=>q,isComponent:()=>s,isContext:()=>x,isOutlet:()=>p,isProvider:()=>c,isRoute:()=>y,isRouter:()=>i,isRoutes:()=>f,isSuspense:()=>b});module.exports=P(w);function j(t){return Object.defineProperty(t,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),t}function a(t){return Object.defineProperty(t,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),t}function R(t){return Object.defineProperty(t,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),t}function C(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),t}function h(t){return Object.defineProperty(t,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),t}function k(t){return Object.defineProperty(t,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),t}function T(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),t}function g(t){return Object.defineProperty(t,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),t}function i(t){return typeof t=="function"&&t[Symbol.for("fluixi-router")]===!0}function f(t){return typeof t=="function"&&t[Symbol.for("fluixi-routes")]===!0}function y(t){return typeof t=="function"&&t[Symbol.for("fluixi-route")]===!0}function p(t){return typeof t=="function"&&t[Symbol.for("fluixi-outlet")]===!0}function c(t){return typeof t=="function"&&t[Symbol.for("fluixi-provider")]===!0}function x(t){return typeof t=="function"&&t[Symbol.for("fluixi-context")]===!0}function s(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}function b(t){return typeof t=="function"&&t[Symbol.for("fluixi-suspense")]===!0}function q(t){return i(t)?{type:"router",value:t}:y(t)?{type:"route",value:t}:f(t)?{type:"routes",value:t}:p(t)?{type:"outlet",value:t}:s(t)?{type:"component",value:t}:b(t)?{type:"suspense",value:t}:c(t)?{type:"provider",value:t}:x(t)?{type:"context",value:t}:{type:"none",value:t}}
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/component/modifiers.ts
21
+ var modifiers_exports = {};
22
+ __export(modifiers_exports, {
23
+ asComponent: () => asComponent,
24
+ asContext: () => asContext,
25
+ asOutlet: () => asOutlet,
26
+ asProvider: () => asProvider,
27
+ asRoute: () => asRoute,
28
+ asRouter: () => asRouter,
29
+ asRoutes: () => asRoutes,
30
+ asSuspense: () => asSuspense,
31
+ checkRenderType: () => checkRenderType,
32
+ isComponent: () => isComponent,
33
+ isContext: () => isContext,
34
+ isOutlet: () => isOutlet,
35
+ isProvider: () => isProvider,
36
+ isRoute: () => isRoute,
37
+ isRouter: () => isRouter,
38
+ isRoutes: () => isRoutes,
39
+ isSuspense: () => isSuspense
40
+ });
41
+ module.exports = __toCommonJS(modifiers_exports);
42
+ function asRouter(value) {
43
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-router"), { value: true, enumerable: true });
44
+ return value;
45
+ }
46
+ function asRoutes(value) {
47
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-routes"), { value: true, enumerable: true });
48
+ return value;
49
+ }
50
+ function asRoute(value) {
51
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-route"), { value: true, enumerable: true });
52
+ return value;
53
+ }
54
+ function asOutlet(value) {
55
+ if (typeof value !== "function") return value;
56
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-outlet"), { value: true, enumerable: true });
57
+ return value;
58
+ }
59
+ function asProvider(value) {
60
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-provider"), { value: true, enumerable: true });
61
+ return value;
62
+ }
63
+ function asContext(value) {
64
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-context"), { value: true, enumerable: true });
65
+ return value;
66
+ }
67
+ function asComponent(value) {
68
+ if (typeof value !== "function") return value;
69
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-component"), { value: true, enumerable: true });
70
+ return value;
71
+ }
72
+ function asSuspense(value) {
73
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-suspense"), { value: true, enumerable: true });
74
+ return value;
75
+ }
76
+ function isRouter(value) {
77
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-router")] === true;
78
+ }
79
+ function isRoutes(value) {
80
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-routes")] === true;
81
+ }
82
+ function isRoute(value) {
83
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-route")] === true;
84
+ }
85
+ function isOutlet(value) {
86
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-outlet")] === true;
87
+ }
88
+ function isProvider(value) {
89
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-provider")] === true;
90
+ }
91
+ function isContext(value) {
92
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-context")] === true;
93
+ }
94
+ function isComponent(value) {
95
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-component")] === true;
96
+ }
97
+ function isSuspense(value) {
98
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-suspense")] === true;
99
+ }
100
+ function checkRenderType(value) {
101
+ if (isRouter(value)) {
102
+ return { type: "router", value };
103
+ }
104
+ if (isRoute(value)) {
105
+ return { type: "route", value };
106
+ }
107
+ if (isRoutes(value)) {
108
+ return { type: "routes", value };
109
+ }
110
+ if (isOutlet(value)) {
111
+ return { type: "outlet", value };
112
+ }
113
+ if (isComponent(value)) {
114
+ return { type: "component", value };
115
+ }
116
+ if (isSuspense(value)) {
117
+ return { type: "suspense", value };
118
+ }
119
+ if (isProvider(value)) {
120
+ return { type: "provider", value };
121
+ }
122
+ if (isContext(value)) {
123
+ return { type: "context", value };
124
+ }
125
+ return { type: "none", value };
126
+ }
@@ -1,3 +1,15 @@
1
+ /**
2
+ * Brands on a function, and the guards that read them back.
3
+ *
4
+ * The runtime has to know what a value is before it calls it. A router has to be entered
5
+ * differently from a provider, and a provider's children have to be read under its own
6
+ * owner, so `insert` and `createComponent` ask before dispatching. None of that is
7
+ * inferable from a function, which is why each `as*` stamps a registry symbol and the
8
+ * matching `is*` tests for it.
9
+ *
10
+ * `Symbol.for` rather than a local symbol, so two bundled copies of this module agree.
11
+ * That is the same reason the reactive graph brands its nodes that way.
12
+ */
1
13
  export declare function asRouter(value: any): any;
2
14
  export declare function asRoutes(value: any): any;
3
15
  export declare function asRoute(value: any): any;
@@ -1 +1 @@
1
- {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../../src/lib/component/modifiers.ts"],"names":[],"mappings":"AAKA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,OAGlC;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,OAGlC;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,OAGjC;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,OAIlC;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,OAGpC;AACD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,OAGnC;AACD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,OAIrC;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,OAGpC;AAGD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,WAElC;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,WAElC;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,WAEjC;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,WAElC;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,WAEpC;AACD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,WAEnC;AACD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,WAErC;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,WAEpC;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,GAAG;IAC3C,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;IAC5G,KAAK,EAAE,GAAG,CAAA;CACX,CA0BA"}
1
+ {"version":3,"file":"modifiers.d.ts","sourceRoot":"","sources":["../../../src/lib/component/modifiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,OAGlC;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,OAGlC;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,OAGjC;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,OAIlC;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,OAGpC;AACD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,OAGnC;AACD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,OAIrC;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,OAGpC;AAGD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,WAElC;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,WAElC;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,WAEjC;AACD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,WAElC;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,WAEpC;AACD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,WAEnC;AACD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,WAErC;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,WAEpC;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,GAAG;IAC3C,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;IAC5G,KAAK,EAAE,GAAG,CAAA;CACX,CA0BA"}
@@ -1,6 +1,15 @@
1
- // /**
2
- // * Development mode flag
3
- // */
1
+ /**
2
+ * Brands on a function, and the guards that read them back.
3
+ *
4
+ * The runtime has to know what a value is before it calls it. A router has to be entered
5
+ * differently from a provider, and a provider's children have to be read under its own
6
+ * owner, so `insert` and `createComponent` ask before dispatching. None of that is
7
+ * inferable from a function, which is why each `as*` stamps a registry symbol and the
8
+ * matching `is*` tests for it.
9
+ *
10
+ * `Symbol.for` rather than a local symbol, so two bundled copies of this module agree.
11
+ * That is the same reason the reactive graph brands its nodes that way.
12
+ */
4
13
  export function asRouter(value) {
5
14
  Object.defineProperty(value, Symbol.for('fluixi-router'), { value: true, enumerable: true });
6
15
  return value;
@@ -88,84 +97,3 @@ export function checkRenderType(value) {
88
97
  }
89
98
  return { type: 'none', value };
90
99
  }
91
- // export const DEV =
92
- // typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';
93
- // /**
94
- // * Component props type
95
- // */
96
- // export interface ComponentProps {
97
- // children?: any;
98
- // [key: string]: any;
99
- // }
100
- // /**
101
- // * Component function type
102
- // */
103
- // export type Component<P = ComponentProps> = (props: P) => any;
104
- // /**
105
- // * Create and execute a component
106
- // *
107
- // * Section 2 — createComponent responsibilities:
108
- // * - Create Owner ✓
109
- // * - Untrack execution ✓
110
- // * - Capture output ✓
111
- // * - Lazy children ✓
112
- // * - Context propagation ✓ (via reactive system)
113
- // * - Cleanup attachment ✓
114
- // *
115
- // * Section 1: Components execute once, never re-execute
116
- // *
117
- // * @template P - Props type
118
- // * @param {Component<P>} Comp - Component function
119
- // * @param {P} props - Component props
120
- // * @returns {any} Component output
121
- // *
122
- // * @example
123
- // * ```typescript
124
- // * const MyComponent = (props: { name: string }) => {
125
- // * return html`<div>Hello ${props.name}</div>`;
126
- // * };
127
- // *
128
- // * const result = createComponent(MyComponent, { name: 'World' });
129
- // * ```
130
- // */
131
- // export function createComponent<P extends ComponentProps>(
132
- // Comp: Component<P>,
133
- // props: P
134
- // ): any {
135
- // // Section 1: Component is a plain function
136
- // if (typeof Comp !== 'function') {
137
- // return Comp;
138
- // }
139
- // // Section 3: Make children lazy
140
- // if (props && 'children' in props) {
141
- // const children = props.children;
142
- // // Already lazy, keep as is
143
- // if (typeof children === 'function') {
144
- // // Children are already a function
145
- // } else {
146
- // // Make children lazy by wrapping in getter
147
- // Object.defineProperty(props, 'children', {
148
- // get() {
149
- // return typeof children === 'function' ? children : () => children;
150
- // },
151
- // enumerable: true,
152
- // configurable: true,
153
- // });
154
- // }
155
- // }
156
- // // DEV mode: Mark component for debugging
157
- // if (DEV && Comp.name) {
158
- // try {
159
- // (props as any).__componentName = Comp.name;
160
- // } catch (e) {
161
- // // Silently fail if props is frozen
162
- // }
163
- // }
164
- // // Section 2: Untrack execution - component doesn't track parent dependencies
165
- // // Section 1: Execute once, never re-execute
166
- // return untrack(() => {
167
- // // Section 2: Execute component in untracked context
168
- // // The component function runs once and constructs the reactive graph
169
- // return Comp(props);
170
- // });
171
- // }
@@ -1 +1,105 @@
1
- function p(t){return Object.defineProperty(t,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),t}function c(t){return Object.defineProperty(t,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),t}function x(t){return Object.defineProperty(t,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),t}function s(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),t}function b(t){return Object.defineProperty(t,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),t}function m(t){return Object.defineProperty(t,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),t}function l(t){return typeof t!="function"||Object.defineProperty(t,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),t}function S(t){return Object.defineProperty(t,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),t}function e(t){return typeof t=="function"&&t[Symbol.for("fluixi-router")]===!0}function r(t){return typeof t=="function"&&t[Symbol.for("fluixi-routes")]===!0}function n(t){return typeof t=="function"&&t[Symbol.for("fluixi-route")]===!0}function o(t){return typeof t=="function"&&t[Symbol.for("fluixi-outlet")]===!0}function u(t){return typeof t=="function"&&t[Symbol.for("fluixi-provider")]===!0}function i(t){return typeof t=="function"&&t[Symbol.for("fluixi-context")]===!0}function f(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}function y(t){return typeof t=="function"&&t[Symbol.for("fluixi-suspense")]===!0}function d(t){return e(t)?{type:"router",value:t}:n(t)?{type:"route",value:t}:r(t)?{type:"routes",value:t}:o(t)?{type:"outlet",value:t}:f(t)?{type:"component",value:t}:y(t)?{type:"suspense",value:t}:u(t)?{type:"provider",value:t}:i(t)?{type:"context",value:t}:{type:"none",value:t}}export{l as asComponent,m as asContext,s as asOutlet,b as asProvider,x as asRoute,p as asRouter,c as asRoutes,S as asSuspense,d as checkRenderType,f as isComponent,i as isContext,o as isOutlet,u as isProvider,n as isRoute,e as isRouter,r as isRoutes,y as isSuspense};
1
+ // src/lib/component/modifiers.ts
2
+ function asRouter(value) {
3
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-router"), { value: true, enumerable: true });
4
+ return value;
5
+ }
6
+ function asRoutes(value) {
7
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-routes"), { value: true, enumerable: true });
8
+ return value;
9
+ }
10
+ function asRoute(value) {
11
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-route"), { value: true, enumerable: true });
12
+ return value;
13
+ }
14
+ function asOutlet(value) {
15
+ if (typeof value !== "function") return value;
16
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-outlet"), { value: true, enumerable: true });
17
+ return value;
18
+ }
19
+ function asProvider(value) {
20
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-provider"), { value: true, enumerable: true });
21
+ return value;
22
+ }
23
+ function asContext(value) {
24
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-context"), { value: true, enumerable: true });
25
+ return value;
26
+ }
27
+ function asComponent(value) {
28
+ if (typeof value !== "function") return value;
29
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-component"), { value: true, enumerable: true });
30
+ return value;
31
+ }
32
+ function asSuspense(value) {
33
+ Object.defineProperty(value, /* @__PURE__ */ Symbol.for("fluixi-suspense"), { value: true, enumerable: true });
34
+ return value;
35
+ }
36
+ function isRouter(value) {
37
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-router")] === true;
38
+ }
39
+ function isRoutes(value) {
40
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-routes")] === true;
41
+ }
42
+ function isRoute(value) {
43
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-route")] === true;
44
+ }
45
+ function isOutlet(value) {
46
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-outlet")] === true;
47
+ }
48
+ function isProvider(value) {
49
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-provider")] === true;
50
+ }
51
+ function isContext(value) {
52
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-context")] === true;
53
+ }
54
+ function isComponent(value) {
55
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-component")] === true;
56
+ }
57
+ function isSuspense(value) {
58
+ return typeof value === "function" && value[/* @__PURE__ */ Symbol.for("fluixi-suspense")] === true;
59
+ }
60
+ function checkRenderType(value) {
61
+ if (isRouter(value)) {
62
+ return { type: "router", value };
63
+ }
64
+ if (isRoute(value)) {
65
+ return { type: "route", value };
66
+ }
67
+ if (isRoutes(value)) {
68
+ return { type: "routes", value };
69
+ }
70
+ if (isOutlet(value)) {
71
+ return { type: "outlet", value };
72
+ }
73
+ if (isComponent(value)) {
74
+ return { type: "component", value };
75
+ }
76
+ if (isSuspense(value)) {
77
+ return { type: "suspense", value };
78
+ }
79
+ if (isProvider(value)) {
80
+ return { type: "provider", value };
81
+ }
82
+ if (isContext(value)) {
83
+ return { type: "context", value };
84
+ }
85
+ return { type: "none", value };
86
+ }
87
+ export {
88
+ asComponent,
89
+ asContext,
90
+ asOutlet,
91
+ asProvider,
92
+ asRoute,
93
+ asRouter,
94
+ asRoutes,
95
+ asSuspense,
96
+ checkRenderType,
97
+ isComponent,
98
+ isContext,
99
+ isOutlet,
100
+ isProvider,
101
+ isRoute,
102
+ isRouter,
103
+ isRoutes,
104
+ isSuspense
105
+ };
@@ -1 +1,60 @@
1
- "use strict";var r=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var n in e)r(t,n,{get:e[n],enumerable:!0})},u=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of c(e))!E.call(t,o)&&o!==n&&r(t,o,{get:()=>e[o],enumerable:!(s=l(e,o))||s.enumerable});return t};var f=t=>u(r({},"__esModule",{value:!0}),t);var h={};g(h,{addDelegatedEventListener:()=>v,delegateEvents:()=>i,isDelegatedEvent:()=>$,removeDelegatedEventListener:()=>m});module.exports=f(h);var a=new Set,d=new Set(["scroll","focus","blur"]);function i(t){for(let e of t)a.has(e)||d.has(e)||(a.add(e),document.addEventListener(e,n=>{let s=n.target;for(;s&&s!==document.documentElement;){let o=s["$$"+e];o&&o.call(s,n),s=s.parentNode}}))}function v(t,e,n){t["$$"+e]=n,i([e])}function m(t,e){delete t["$$"+e]}function $(t){return!d.has(t)}
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/delegate.ts
21
+ var delegate_exports = {};
22
+ __export(delegate_exports, {
23
+ addDelegatedEventListener: () => addDelegatedEventListener,
24
+ delegateEvents: () => delegateEvents,
25
+ isDelegatedEvent: () => isDelegatedEvent,
26
+ removeDelegatedEventListener: () => removeDelegatedEventListener
27
+ });
28
+ module.exports = __toCommonJS(delegate_exports);
29
+ var delegatedEvents = /* @__PURE__ */ new Set();
30
+ var NON_DELEGATED = /* @__PURE__ */ new Set([
31
+ "scroll",
32
+ "focus",
33
+ "blur"
34
+ ]);
35
+ function delegateEvents(eventNames) {
36
+ for (const name of eventNames) {
37
+ if (delegatedEvents.has(name) || NON_DELEGATED.has(name)) continue;
38
+ delegatedEvents.add(name);
39
+ document.addEventListener(name, (event) => {
40
+ let node = event.target;
41
+ while (node && node !== document.documentElement) {
42
+ const handler = node["$$" + name];
43
+ if (handler) {
44
+ handler.call(node, event);
45
+ }
46
+ node = node.parentNode;
47
+ }
48
+ });
49
+ }
50
+ }
51
+ function addDelegatedEventListener(element, name, handler) {
52
+ element["$$" + name] = handler;
53
+ delegateEvents([name]);
54
+ }
55
+ function removeDelegatedEventListener(element, name) {
56
+ delete element["$$" + name];
57
+ }
58
+ function isDelegatedEvent(name) {
59
+ return !NON_DELEGATED.has(name);
60
+ }