@vickbk/tests 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/LICENSE +21 -0
  3. package/README.md +225 -2
  4. package/dist/console-Cf1taTRK.mjs +39 -0
  5. package/dist/console-Cf1taTRK.mjs.map +1 -0
  6. package/dist/dom-DeHbD1ni.mjs +459 -0
  7. package/dist/dom-DeHbD1ni.mjs.map +1 -0
  8. package/dist/index-CKsosUpb.d.mts +249 -0
  9. package/dist/index-CKsosUpb.d.mts.map +1 -0
  10. package/dist/index-DtGBqDev.d.mts +25 -0
  11. package/dist/index-DtGBqDev.d.mts.map +1 -0
  12. package/dist/index.cjs +3 -0
  13. package/dist/index.d.cts +6 -0
  14. package/dist/index.d.cts.map +1 -0
  15. package/dist/index.d.mts +6 -0
  16. package/dist/index.d.mts.map +1 -0
  17. package/dist/index.mjs +1 -0
  18. package/dist/pattern-to-regex-BrMJtzu8.cjs +19 -0
  19. package/dist/pattern-to-regex-BrMJtzu8.cjs.map +1 -0
  20. package/dist/pattern-to-regex-CO5Y0oDU.mjs +14 -0
  21. package/dist/pattern-to-regex-CO5Y0oDU.mjs.map +1 -0
  22. package/dist/playwright.cjs +327 -0
  23. package/dist/playwright.cjs.map +1 -0
  24. package/dist/playwright.d.cts +254 -0
  25. package/dist/playwright.d.cts.map +1 -0
  26. package/dist/playwright.d.mts +254 -0
  27. package/dist/playwright.d.mts.map +1 -0
  28. package/dist/playwright.mjs +308 -0
  29. package/dist/playwright.mjs.map +1 -0
  30. package/dist/promises.cjs +45 -0
  31. package/dist/promises.cjs.map +1 -0
  32. package/dist/promises.d.cts +34 -0
  33. package/dist/promises.d.cts.map +1 -0
  34. package/dist/promises.d.mts +34 -0
  35. package/dist/promises.d.mts.map +1 -0
  36. package/dist/promises.mjs +43 -0
  37. package/dist/promises.mjs.map +1 -0
  38. package/dist/react.cjs +173 -0
  39. package/dist/react.cjs.map +1 -0
  40. package/dist/react.d.cts +17 -0
  41. package/dist/react.d.cts.map +1 -0
  42. package/dist/react.d.mts +17 -0
  43. package/dist/react.d.mts.map +1 -0
  44. package/dist/react.mjs +170 -0
  45. package/dist/react.mjs.map +1 -0
  46. package/dist/rolldown-runtime-VH7oDXx4.cjs +28 -0
  47. package/dist/types-BlSFP07Z.d.cts +8 -0
  48. package/dist/types-BlSFP07Z.d.cts.map +1 -0
  49. package/dist/types-BlSFP07Z.d.mts +8 -0
  50. package/dist/types-BlSFP07Z.d.mts.map +1 -0
  51. package/dist/vitest/console.d.mts +2 -0
  52. package/dist/vitest/console.mjs +1 -0
  53. package/dist/vitest/dom.d.mts +2 -0
  54. package/dist/vitest/dom.mjs +1 -0
  55. package/dist/vitest.d.mts +49 -0
  56. package/dist/vitest.d.mts.map +1 -0
  57. package/dist/vitest.mjs +57 -0
  58. package/dist/vitest.mjs.map +1 -0
  59. package/package.json +165 -3
@@ -0,0 +1,34 @@
1
+ //#region src/features/promises/utils/resolvedPromise.d.ts
2
+ /**
3
+ * Creates a fulfilled promise augmented with Vitest's fulfilled-promise metadata.
4
+ *
5
+ * @param value The value with which the promise is fulfilled.
6
+ * @returns A fulfilled Promise<T> with `status: "fulfilled"` and its `value`.
7
+ * @example
8
+ * ```ts
9
+ * const payload = await resolvedPromise({ id: 1 });
10
+ * expect(payload).toEqual({ id: 1 });
11
+ * ```
12
+ */
13
+ export declare function resolvedPromise<T>(value: T): Promise<T> & {
14
+ status: "fulfilled";
15
+ value: T;
16
+ };
17
+ //#endregion
18
+ //#region src/features/promises/utils/rejectedPromise.d.ts
19
+ /**
20
+ * Creates a rejected promise augmented with Vitest's rejected-promise metadata.
21
+ *
22
+ * @param reason The rejection reason, preserved as an unknown value; defaults to `undefined`.
23
+ * @returns A rejected Promise<never> with `status: "rejected"` and its `reason`.
24
+ * @example
25
+ * ```ts
26
+ * await expect(rejectedPromise(new Error("Request failed"))).rejects.toThrow("Request failed");
27
+ * ```
28
+ */
29
+ export declare function rejectedPromise(reason?: unknown): Promise<never> & {
30
+ status: "rejected";
31
+ reason: unknown;
32
+ };
33
+ //#endregion
34
+ //# sourceMappingURL=promises.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promises.d.cts","names":[],"sources":["../src/features/promises/utils/resolvedPromise.ts","../src/features/promises/utils/rejectedPromise.ts"],"mappings":";;;;;;;;;;;;wBAWgB,gBAAgB,GAC9B,OAAO,IACN,QAAQ;EAAO;EAAqB,OAAO;;;;;;;;;;;;;;wBCH9B,gBACd,mBACC;EAAmB;EAAoB"}
@@ -0,0 +1,34 @@
1
+ //#region src/features/promises/utils/resolvedPromise.d.ts
2
+ /**
3
+ * Creates a fulfilled promise augmented with Vitest's fulfilled-promise metadata.
4
+ *
5
+ * @param value The value with which the promise is fulfilled.
6
+ * @returns A fulfilled Promise<T> with `status: "fulfilled"` and its `value`.
7
+ * @example
8
+ * ```ts
9
+ * const payload = await resolvedPromise({ id: 1 });
10
+ * expect(payload).toEqual({ id: 1 });
11
+ * ```
12
+ */
13
+ export declare function resolvedPromise<T>(value: T): Promise<T> & {
14
+ status: "fulfilled";
15
+ value: T;
16
+ };
17
+ //#endregion
18
+ //#region src/features/promises/utils/rejectedPromise.d.ts
19
+ /**
20
+ * Creates a rejected promise augmented with Vitest's rejected-promise metadata.
21
+ *
22
+ * @param reason The rejection reason, preserved as an unknown value; defaults to `undefined`.
23
+ * @returns A rejected Promise<never> with `status: "rejected"` and its `reason`.
24
+ * @example
25
+ * ```ts
26
+ * await expect(rejectedPromise(new Error("Request failed"))).rejects.toThrow("Request failed");
27
+ * ```
28
+ */
29
+ export declare function rejectedPromise(reason?: unknown): Promise<never> & {
30
+ status: "rejected";
31
+ reason: unknown;
32
+ };
33
+ //#endregion
34
+ //# sourceMappingURL=promises.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promises.d.mts","names":[],"sources":["../src/features/promises/utils/resolvedPromise.ts","../src/features/promises/utils/rejectedPromise.ts"],"mappings":";;;;;;;;;;;;wBAWgB,gBAAgB,GAC9B,OAAO,IACN,QAAQ;EAAO;EAAqB,OAAO;;;;;;;;;;;;;;wBCH9B,gBACd,mBACC;EAAmB;EAAoB"}
@@ -0,0 +1,43 @@
1
+ //#region src/features/promises/utils/resolvedPromise.ts
2
+ /**
3
+ * Creates a fulfilled promise augmented with Vitest's fulfilled-promise metadata.
4
+ *
5
+ * @param value The value with which the promise is fulfilled.
6
+ * @returns A fulfilled Promise<T> with `status: "fulfilled"` and its `value`.
7
+ * @example
8
+ * ```ts
9
+ * const payload = await resolvedPromise({ id: 1 });
10
+ * expect(payload).toEqual({ id: 1 });
11
+ * ```
12
+ */
13
+ function resolvedPromise(value) {
14
+ const promise = Promise.resolve(value);
15
+ return Object.assign(promise, {
16
+ status: "fulfilled",
17
+ value
18
+ });
19
+ }
20
+ //#endregion
21
+ //#region src/features/promises/utils/rejectedPromise.ts
22
+ /**
23
+ * Creates a rejected promise augmented with Vitest's rejected-promise metadata.
24
+ *
25
+ * @param reason The rejection reason, preserved as an unknown value; defaults to `undefined`.
26
+ * @returns A rejected Promise<never> with `status: "rejected"` and its `reason`.
27
+ * @example
28
+ * ```ts
29
+ * await expect(rejectedPromise(new Error("Request failed"))).rejects.toThrow("Request failed");
30
+ * ```
31
+ */
32
+ function rejectedPromise(reason = void 0) {
33
+ const promise = Promise.reject(reason);
34
+ promise.catch((error) => error);
35
+ return Object.assign(promise, {
36
+ status: "rejected",
37
+ reason
38
+ });
39
+ }
40
+ //#endregion
41
+ export { rejectedPromise, resolvedPromise };
42
+
43
+ //# sourceMappingURL=promises.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promises.mjs","names":[],"sources":["../src/features/promises/utils/resolvedPromise.ts","../src/features/promises/utils/rejectedPromise.ts"],"sourcesContent":["/**\n * Creates a fulfilled promise augmented with Vitest's fulfilled-promise metadata.\n *\n * @param value The value with which the promise is fulfilled.\n * @returns A fulfilled Promise<T> with `status: \"fulfilled\"` and its `value`.\n * @example\n * ```ts\n * const payload = await resolvedPromise({ id: 1 });\n * expect(payload).toEqual({ id: 1 });\n * ```\n */\nexport function resolvedPromise<T>(\n value: T,\n): Promise<T> & { status: \"fulfilled\"; value: T } {\n const promise = Promise.resolve(value);\n return Object.assign(promise, { status: \"fulfilled\" as const, value });\n}\n","/**\n * Creates a rejected promise augmented with Vitest's rejected-promise metadata.\n *\n * @param reason The rejection reason, preserved as an unknown value; defaults to `undefined`.\n * @returns A rejected Promise<never> with `status: \"rejected\"` and its `reason`.\n * @example\n * ```ts\n * await expect(rejectedPromise(new Error(\"Request failed\"))).rejects.toThrow(\"Request failed\");\n * ```\n */\nexport function rejectedPromise(\n reason: unknown = undefined,\n): Promise<never> & { status: \"rejected\"; reason: unknown } {\n const promise = Promise.reject<never>(reason);\n\n promise.catch((error) => error);\n\n return Object.assign(promise, { status: \"rejected\" as const, reason });\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,gBACd,OACgD;CAChD,MAAM,UAAU,QAAQ,QAAQ,KAAK;CACrC,OAAO,OAAO,OAAO,SAAS;EAAE,QAAQ;EAAsB;CAAM,CAAC;AACvE;;;;;;;;;;;;;ACNA,SAAgB,gBACd,SAAkB,KAAA,GACwC;CAC1D,MAAM,UAAU,QAAQ,OAAc,MAAM;CAE5C,QAAQ,OAAO,UAAU,KAAK;CAE9B,OAAO,OAAO,OAAO,SAAS;EAAE,QAAQ;EAAqB;CAAO,CAAC;AACvE"}
package/dist/react.cjs ADDED
@@ -0,0 +1,173 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
3
+ let react = require("react");
4
+ react = require_rolldown_runtime.__toESM(react, 1);
5
+ //#region src/features/react/utils/resolveArrayChild.ts
6
+ /**
7
+ * Resolves one array child and supplies a stable key when the result is an
8
+ * element without one.
9
+ *
10
+ * @param child - The child value to resolve.
11
+ * @param index - The child's position in its containing array.
12
+ * @param resolveTree - The recursive tree resolver.
13
+ * @returns The resolved child.
14
+ * @example
15
+ * ```ts
16
+ * await resolveArrayChild(<Page />, 0, resolveRscTree);
17
+ * ```
18
+ */
19
+ async function resolveArrayChild(child, index, resolveTree) {
20
+ const resolvedChild = await resolveTree(child);
21
+ if (react.isValidElement(resolvedChild)) {
22
+ const keyToUse = resolvedChild.key ?? child?.key ?? `rsc-key-${index}`;
23
+ return react.cloneElement(resolvedChild, { key: keyToUse });
24
+ }
25
+ return resolvedChild;
26
+ }
27
+ //#endregion
28
+ //#region src/features/react/utils/isClassComponent.ts
29
+ /**
30
+ * Determines whether a component type is a React class component.
31
+ *
32
+ * @param type - The value to inspect.
33
+ * @returns `true` when the value is a React class component.
34
+ * @example
35
+ * ```ts
36
+ * isClassComponent(MyClassComponent); // true
37
+ * ```
38
+ */
39
+ function isClassComponent(type) {
40
+ return typeof type === "function" && Boolean(type.prototype?.isReactComponent);
41
+ }
42
+ //#endregion
43
+ //#region src/features/react/utils/executeServerComponent.ts
44
+ /**
45
+ * Executes a server component and awaits an asynchronous result when present.
46
+ * Component errors intentionally propagate to the caller.
47
+ *
48
+ * @param type - The server component to execute.
49
+ * @param props - Props passed to the component.
50
+ * @returns The component's resolved render result.
51
+ * @example
52
+ * ```ts
53
+ * await executeServerComponent(Page, { title: "Hello" });
54
+ * ```
55
+ */
56
+ async function executeServerComponent(type, props) {
57
+ if (isClassComponent(type)) return new type(props).render();
58
+ return await type(props);
59
+ }
60
+ //#endregion
61
+ //#region src/features/react/utils/isClientComponent.ts
62
+ /**
63
+ * Determines whether a component should be kept behind a client boundary.
64
+ * React client/module references and functions containing hook calls are not
65
+ * invoked directly by the resolver.
66
+ *
67
+ * @param type - The React element type to inspect.
68
+ * @returns `true` when the type represents a client boundary.
69
+ * @example
70
+ * ```ts
71
+ * isClientComponent({ $$typeof: Symbol.for("react.client.reference") }); // true
72
+ * ```
73
+ */
74
+ function isClientComponent(type) {
75
+ if (type === null || typeof type !== "function" && typeof type !== "object") return false;
76
+ const reference = type;
77
+ if (reference.$$typeof === Symbol.for("react.client.reference") || reference.$$typeof === Symbol.for("react.module.reference") || typeof reference.$$id === "string") return true;
78
+ return typeof type === "function" && /\buse[A-Z0-9_]\w*\s*\(/.test(Function.prototype.toString.call(type));
79
+ }
80
+ //#endregion
81
+ //#region src/features/react/utils/resolveProps.ts
82
+ /**
83
+ * Resolves React elements and arrays nested in a component's props.
84
+ *
85
+ * @param props - The component props to inspect.
86
+ * @param resolveTree - The recursive tree resolver.
87
+ * @returns Updated props and whether any prop value changed.
88
+ * @example
89
+ * ```ts
90
+ * const result = await resolveProps({ children: <Page /> }, resolveRscTree);
91
+ * ```
92
+ */
93
+ async function resolveProps(props, resolveTree) {
94
+ const newProps = { ...props };
95
+ let hasChanged = false;
96
+ for (const key of Object.keys(newProps)) {
97
+ const value = newProps[key];
98
+ if (react.isValidElement(value) || Array.isArray(value)) {
99
+ const resolved = await resolveTree(value);
100
+ if (resolved !== value) {
101
+ newProps[key] = resolved;
102
+ hasChanged = true;
103
+ }
104
+ }
105
+ }
106
+ return {
107
+ newProps,
108
+ hasChanged
109
+ };
110
+ }
111
+ //#endregion
112
+ //#region src/features/react/utils/resolveElement.ts
113
+ /**
114
+ * Resolves a server component element or recursively updates its element props.
115
+ * Client component boundaries remain untouched and component errors propagate.
116
+ *
117
+ * @param node - The React element to resolve.
118
+ * @param resolveTree - The recursive tree resolver.
119
+ * @returns The resolved render result or the updated original element.
120
+ * @example
121
+ * ```ts
122
+ * await resolveElement(<ServerPage />, resolveRscTree);
123
+ * ```
124
+ */
125
+ async function resolveElement(node, resolveTree) {
126
+ const { type, props } = node;
127
+ if (typeof type === "function" && !isClientComponent(type)) return resolveTree(await executeServerComponent(type, props));
128
+ if (props && typeof props === "object") {
129
+ const { newProps, hasChanged } = await resolveProps(props, resolveTree);
130
+ if (hasChanged) return react.cloneElement(node, newProps);
131
+ }
132
+ return node;
133
+ }
134
+ //#endregion
135
+ //#region src/features/react/utils/traverseTree.ts
136
+ /**
137
+ * Traverses arrays and React elements, delegating component resolution.
138
+ *
139
+ * @param node - The tree value to visit.
140
+ * @param resolveTree - The recursive tree resolver.
141
+ * @returns The traversed value with server components resolved.
142
+ * @example
143
+ * ```ts
144
+ * await traverseTree(tree, resolveRscTree);
145
+ * ```
146
+ */
147
+ async function traverseTree(node, resolveTree) {
148
+ if (!node || typeof node !== "object") return node;
149
+ if (Array.isArray(node)) return Promise.all(node.map((child, index) => resolveArrayChild(child, index, resolveTree)));
150
+ if (react.isValidElement(node)) return resolveElement(node, resolveTree);
151
+ return node;
152
+ }
153
+ //#endregion
154
+ //#region src/features/react/utils/resolveRscTree.ts
155
+ /**
156
+ * Recursively resolves synchronous and asynchronous React Server Components.
157
+ * Client component boundaries are preserved, and component errors are allowed
158
+ * to reject the returned promise.
159
+ *
160
+ * @param node - The React node or tree to resolve.
161
+ * @returns A promise for the resolved React tree.
162
+ * @example
163
+ * ```ts
164
+ * const resolved = await resolveRscTree(<ServerPage />);
165
+ * ```
166
+ */
167
+ async function resolveRscTree(node) {
168
+ return traverseTree(node, resolveRscTree);
169
+ }
170
+ //#endregion
171
+ exports.resolveRscTree = resolveRscTree;
172
+
173
+ //# sourceMappingURL=react.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.cjs","names":["React","ClassComponent","FunctionComponent","React","React","React"],"sources":["../src/features/react/utils/resolveArrayChild.ts","../src/features/react/utils/isClassComponent.ts","../src/features/react/utils/executeServerComponent.ts","../src/features/react/utils/isClientComponent.ts","../src/features/react/utils/resolveProps.ts","../src/features/react/utils/resolveElement.ts","../src/features/react/utils/traverseTree.ts","../src/features/react/utils/resolveRscTree.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport * as React from \"react\";\nimport type { ResolveTree } from \"./types\";\n\n/**\n * Resolves one array child and supplies a stable key when the result is an\n * element without one.\n *\n * @param child - The child value to resolve.\n * @param index - The child's position in its containing array.\n * @param resolveTree - The recursive tree resolver.\n * @returns The resolved child.\n * @example\n * ```ts\n * await resolveArrayChild(<Page />, 0, resolveRscTree);\n * ```\n */\nexport async function resolveArrayChild(\n child: ReactNode,\n index: number,\n resolveTree: ResolveTree,\n): Promise<ReactNode> {\n const resolvedChild = await resolveTree(child);\n if (React.isValidElement(resolvedChild)) {\n const keyToUse =\n resolvedChild.key ??\n (child as { key?: string })?.key ??\n `rsc-key-${index}`;\n return React.cloneElement(resolvedChild, { key: keyToUse });\n }\n return resolvedChild;\n}\n","/**\n * Determines whether a component type is a React class component.\n *\n * @param type - The value to inspect.\n * @returns `true` when the value is a React class component.\n * @example\n * ```ts\n * isClassComponent(MyClassComponent); // true\n * ```\n */\nexport function isClassComponent(type: unknown): boolean {\n return (\n typeof type === \"function\" &&\n Boolean(\n (type as { prototype?: { isReactComponent?: unknown } }).prototype\n ?.isReactComponent,\n )\n );\n}\n","import type * as React from \"react\";\nimport type { ReactNode } from \"react\";\nimport { isClassComponent } from \"./isClassComponent\";\n\n/**\n * Executes a server component and awaits an asynchronous result when present.\n * Component errors intentionally propagate to the caller.\n *\n * @param type - The server component to execute.\n * @param props - Props passed to the component.\n * @returns The component's resolved render result.\n * @example\n * ```ts\n * await executeServerComponent(Page, { title: \"Hello\" });\n * ```\n */\nexport async function executeServerComponent(\n type: React.ComponentType<Record<string, unknown>>,\n props: Record<string, unknown>,\n): Promise<ReactNode> {\n if (isClassComponent(type)) {\n const ClassComponent = type as React.ComponentClass<\n Record<string, unknown>\n >;\n return new ClassComponent(props).render();\n }\n\n const FunctionComponent = type as React.FunctionComponent<\n Record<string, unknown>\n >;\n return await FunctionComponent(props);\n}\n","/**\n * Determines whether a component should be kept behind a client boundary.\n * React client/module references and functions containing hook calls are not\n * invoked directly by the resolver.\n *\n * @param type - The React element type to inspect.\n * @returns `true` when the type represents a client boundary.\n * @example\n * ```ts\n * isClientComponent({ $$typeof: Symbol.for(\"react.client.reference\") }); // true\n * ```\n */\nexport function isClientComponent(type: unknown): boolean {\n if (type === null || (typeof type !== \"function\" && typeof type !== \"object\")) {\n return false;\n }\n\n const reference = type as { $$typeof?: symbol; $$id?: unknown };\n if (\n reference.$$typeof === Symbol.for(\"react.client.reference\") ||\n reference.$$typeof === Symbol.for(\"react.module.reference\") ||\n typeof reference.$$id === \"string\"\n ) {\n return true;\n }\n\n return (\n typeof type === \"function\" &&\n /\\buse[A-Z0-9_]\\w*\\s*\\(/.test(Function.prototype.toString.call(type))\n );\n}\n","import * as React from \"react\";\nimport type { ResolveTree } from \"./types\";\n\n/**\n * Resolves React elements and arrays nested in a component's props.\n *\n * @param props - The component props to inspect.\n * @param resolveTree - The recursive tree resolver.\n * @returns Updated props and whether any prop value changed.\n * @example\n * ```ts\n * const result = await resolveProps({ children: <Page /> }, resolveRscTree);\n * ```\n */\nexport async function resolveProps(\n props: Record<string, unknown>,\n resolveTree: ResolveTree,\n): Promise<{ newProps: Record<string, unknown>; hasChanged: boolean }> {\n const newProps: Record<string, unknown> = { ...props };\n let hasChanged = false;\n\n for (const key of Object.keys(newProps)) {\n const value = newProps[key];\n if (React.isValidElement(value) || Array.isArray(value)) {\n const resolved = await resolveTree(value as React.ReactNode);\n if (resolved !== value) {\n newProps[key] = resolved;\n hasChanged = true;\n }\n }\n }\n\n return { newProps, hasChanged };\n}\n","import type { ReactNode } from \"react\";\nimport * as React from \"react\";\nimport { executeServerComponent } from \"./executeServerComponent\";\nimport { isClientComponent } from \"./isClientComponent\";\nimport { resolveProps } from \"./resolveProps\";\nimport type { ResolveTree } from \"./types\";\n\n/**\n * Resolves a server component element or recursively updates its element props.\n * Client component boundaries remain untouched and component errors propagate.\n *\n * @param node - The React element to resolve.\n * @param resolveTree - The recursive tree resolver.\n * @returns The resolved render result or the updated original element.\n * @example\n * ```ts\n * await resolveElement(<ServerPage />, resolveRscTree);\n * ```\n */\nexport async function resolveElement(\n node: React.ReactElement,\n resolveTree: ResolveTree,\n): Promise<ReactNode> {\n const { type, props } = node;\n\n if (typeof type === \"function\" && !isClientComponent(type)) {\n const serverResult = await executeServerComponent(\n type as React.ComponentType<Record<string, unknown>>,\n props as Record<string, unknown>,\n );\n return resolveTree(serverResult);\n }\n\n if (props && typeof props === \"object\") {\n const { newProps, hasChanged } = await resolveProps(\n props as Record<string, unknown>,\n resolveTree,\n );\n if (hasChanged) {\n return React.cloneElement(node, newProps);\n }\n }\n\n return node;\n}\n","import * as React from \"react\";\nimport type { ReactNode } from \"react\";\nimport { resolveArrayChild } from \"./resolveArrayChild\";\nimport { resolveElement } from \"./resolveElement\";\nimport type { ResolveTree } from \"./types\";\n\n/**\n * Traverses arrays and React elements, delegating component resolution.\n *\n * @param node - The tree value to visit.\n * @param resolveTree - The recursive tree resolver.\n * @returns The traversed value with server components resolved.\n * @example\n * ```ts\n * await traverseTree(tree, resolveRscTree);\n * ```\n */\nexport async function traverseTree(\n node: ReactNode,\n resolveTree: ResolveTree,\n): Promise<ReactNode> {\n if (!node || typeof node !== \"object\") return node;\n\n if (Array.isArray(node)) {\n return Promise.all(\n node.map((child, index) => resolveArrayChild(child, index, resolveTree)),\n );\n }\n\n if (React.isValidElement(node)) {\n return resolveElement(node, resolveTree);\n }\n\n return node;\n}\n","import type { ReactNode } from \"react\";\nimport { traverseTree } from \"./traverseTree\";\n\n/**\n * Recursively resolves synchronous and asynchronous React Server Components.\n * Client component boundaries are preserved, and component errors are allowed\n * to reject the returned promise.\n *\n * @param node - The React node or tree to resolve.\n * @returns A promise for the resolved React tree.\n * @example\n * ```ts\n * const resolved = await resolveRscTree(<ServerPage />);\n * ```\n */\nexport async function resolveRscTree(node: ReactNode): Promise<ReactNode> {\n return traverseTree(node, resolveRscTree);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,eAAsB,kBACpB,OACA,OACA,aACoB;CACpB,MAAM,gBAAgB,MAAM,YAAY,KAAK;CAC7C,IAAIA,MAAM,eAAe,aAAa,GAAG;EACvC,MAAM,WACJ,cAAc,OACb,OAA4B,OAC7B,WAAW;EACb,OAAOA,MAAM,aAAa,eAAe,EAAE,KAAK,SAAS,CAAC;CAC5D;CACA,OAAO;AACT;;;;;;;;;;;;;ACrBA,SAAgB,iBAAiB,MAAwB;CACvD,OACE,OAAO,SAAS,cAChB,QACG,KAAwD,WACrD,gBACN;AAEJ;;;;;;;;;;;;;;;ACFA,eAAsB,uBACpB,MACA,OACoB;CACpB,IAAI,iBAAiB,IAAI,GAIvB,OAAO,IAAIC,KAAe,KAAK,CAAC,CAAC,OAAO;CAM1C,OAAO,MAAMC,KAAkB,KAAK;AACtC;;;;;;;;;;;;;;;ACnBA,SAAgB,kBAAkB,MAAwB;CACxD,IAAI,SAAS,QAAS,OAAO,SAAS,cAAc,OAAO,SAAS,UAClE,OAAO;CAGT,MAAM,YAAY;CAClB,IACE,UAAU,aAAa,OAAO,IAAI,wBAAwB,KAC1D,UAAU,aAAa,OAAO,IAAI,wBAAwB,KAC1D,OAAO,UAAU,SAAS,UAE1B,OAAO;CAGT,OACE,OAAO,SAAS,cAChB,yBAAyB,KAAK,SAAS,UAAU,SAAS,KAAK,IAAI,CAAC;AAExE;;;;;;;;;;;;;;AChBA,eAAsB,aACpB,OACA,aACqE;CACrE,MAAM,WAAoC,EAAE,GAAG,MAAM;CACrD,IAAI,aAAa;CAEjB,KAAK,MAAM,OAAO,OAAO,KAAK,QAAQ,GAAG;EACvC,MAAM,QAAQ,SAAS;EACvB,IAAIC,MAAM,eAAe,KAAK,KAAK,MAAM,QAAQ,KAAK,GAAG;GACvD,MAAM,WAAW,MAAM,YAAY,KAAwB;GAC3D,IAAI,aAAa,OAAO;IACtB,SAAS,OAAO;IAChB,aAAa;GACf;EACF;CACF;CAEA,OAAO;EAAE;EAAU;CAAW;AAChC;;;;;;;;;;;;;;;ACdA,eAAsB,eACpB,MACA,aACoB;CACpB,MAAM,EAAE,MAAM,UAAU;CAExB,IAAI,OAAO,SAAS,cAAc,CAAC,kBAAkB,IAAI,GAKvD,OAAO,YAAY,MAJQ,uBACzB,MACA,KACF,CAC+B;CAGjC,IAAI,SAAS,OAAO,UAAU,UAAU;EACtC,MAAM,EAAE,UAAU,eAAe,MAAM,aACrC,OACA,WACF;EACA,IAAI,YACF,OAAOC,MAAM,aAAa,MAAM,QAAQ;CAE5C;CAEA,OAAO;AACT;;;;;;;;;;;;;;AC3BA,eAAsB,aACpB,MACA,aACoB;CACpB,IAAI,CAAC,QAAQ,OAAO,SAAS,UAAU,OAAO;CAE9C,IAAI,MAAM,QAAQ,IAAI,GACpB,OAAO,QAAQ,IACb,KAAK,KAAK,OAAO,UAAU,kBAAkB,OAAO,OAAO,WAAW,CAAC,CACzE;CAGF,IAAIC,MAAM,eAAe,IAAI,GAC3B,OAAO,eAAe,MAAM,WAAW;CAGzC,OAAO;AACT;;;;;;;;;;;;;;;ACnBA,eAAsB,eAAe,MAAqC;CACxE,OAAO,aAAa,MAAM,cAAc;AAC1C"}
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/features/react/utils/resolveRscTree.d.ts
3
+ /**
4
+ * Recursively resolves synchronous and asynchronous React Server Components.
5
+ * Client component boundaries are preserved, and component errors are allowed
6
+ * to reject the returned promise.
7
+ *
8
+ * @param node - The React node or tree to resolve.
9
+ * @returns A promise for the resolved React tree.
10
+ * @example
11
+ * ```ts
12
+ * const resolved = await resolveRscTree(<ServerPage />);
13
+ * ```
14
+ */
15
+ export declare function resolveRscTree(node: ReactNode): Promise<ReactNode>;
16
+ //#endregion
17
+ //# sourceMappingURL=react.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.cts","names":[],"sources":["../src/features/react/utils/resolveRscTree.ts"],"mappings":";;;;;;;;;;;;;;wBAesB,eAAe,MAAM,YAAY,QAAQ"}
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/features/react/utils/resolveRscTree.d.ts
3
+ /**
4
+ * Recursively resolves synchronous and asynchronous React Server Components.
5
+ * Client component boundaries are preserved, and component errors are allowed
6
+ * to reject the returned promise.
7
+ *
8
+ * @param node - The React node or tree to resolve.
9
+ * @returns A promise for the resolved React tree.
10
+ * @example
11
+ * ```ts
12
+ * const resolved = await resolveRscTree(<ServerPage />);
13
+ * ```
14
+ */
15
+ export declare function resolveRscTree(node: ReactNode): Promise<ReactNode>;
16
+ //#endregion
17
+ //# sourceMappingURL=react.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.mts","names":[],"sources":["../src/features/react/utils/resolveRscTree.ts"],"mappings":";;;;;;;;;;;;;;wBAesB,eAAe,MAAM,YAAY,QAAQ"}
package/dist/react.mjs ADDED
@@ -0,0 +1,170 @@
1
+ import * as React from "react";
2
+ //#region src/features/react/utils/resolveArrayChild.ts
3
+ /**
4
+ * Resolves one array child and supplies a stable key when the result is an
5
+ * element without one.
6
+ *
7
+ * @param child - The child value to resolve.
8
+ * @param index - The child's position in its containing array.
9
+ * @param resolveTree - The recursive tree resolver.
10
+ * @returns The resolved child.
11
+ * @example
12
+ * ```ts
13
+ * await resolveArrayChild(<Page />, 0, resolveRscTree);
14
+ * ```
15
+ */
16
+ async function resolveArrayChild(child, index, resolveTree) {
17
+ const resolvedChild = await resolveTree(child);
18
+ if (React.isValidElement(resolvedChild)) {
19
+ const keyToUse = resolvedChild.key ?? child?.key ?? `rsc-key-${index}`;
20
+ return React.cloneElement(resolvedChild, { key: keyToUse });
21
+ }
22
+ return resolvedChild;
23
+ }
24
+ //#endregion
25
+ //#region src/features/react/utils/isClassComponent.ts
26
+ /**
27
+ * Determines whether a component type is a React class component.
28
+ *
29
+ * @param type - The value to inspect.
30
+ * @returns `true` when the value is a React class component.
31
+ * @example
32
+ * ```ts
33
+ * isClassComponent(MyClassComponent); // true
34
+ * ```
35
+ */
36
+ function isClassComponent(type) {
37
+ return typeof type === "function" && Boolean(type.prototype?.isReactComponent);
38
+ }
39
+ //#endregion
40
+ //#region src/features/react/utils/executeServerComponent.ts
41
+ /**
42
+ * Executes a server component and awaits an asynchronous result when present.
43
+ * Component errors intentionally propagate to the caller.
44
+ *
45
+ * @param type - The server component to execute.
46
+ * @param props - Props passed to the component.
47
+ * @returns The component's resolved render result.
48
+ * @example
49
+ * ```ts
50
+ * await executeServerComponent(Page, { title: "Hello" });
51
+ * ```
52
+ */
53
+ async function executeServerComponent(type, props) {
54
+ if (isClassComponent(type)) return new type(props).render();
55
+ return await type(props);
56
+ }
57
+ //#endregion
58
+ //#region src/features/react/utils/isClientComponent.ts
59
+ /**
60
+ * Determines whether a component should be kept behind a client boundary.
61
+ * React client/module references and functions containing hook calls are not
62
+ * invoked directly by the resolver.
63
+ *
64
+ * @param type - The React element type to inspect.
65
+ * @returns `true` when the type represents a client boundary.
66
+ * @example
67
+ * ```ts
68
+ * isClientComponent({ $$typeof: Symbol.for("react.client.reference") }); // true
69
+ * ```
70
+ */
71
+ function isClientComponent(type) {
72
+ if (type === null || typeof type !== "function" && typeof type !== "object") return false;
73
+ const reference = type;
74
+ if (reference.$$typeof === Symbol.for("react.client.reference") || reference.$$typeof === Symbol.for("react.module.reference") || typeof reference.$$id === "string") return true;
75
+ return typeof type === "function" && /\buse[A-Z0-9_]\w*\s*\(/.test(Function.prototype.toString.call(type));
76
+ }
77
+ //#endregion
78
+ //#region src/features/react/utils/resolveProps.ts
79
+ /**
80
+ * Resolves React elements and arrays nested in a component's props.
81
+ *
82
+ * @param props - The component props to inspect.
83
+ * @param resolveTree - The recursive tree resolver.
84
+ * @returns Updated props and whether any prop value changed.
85
+ * @example
86
+ * ```ts
87
+ * const result = await resolveProps({ children: <Page /> }, resolveRscTree);
88
+ * ```
89
+ */
90
+ async function resolveProps(props, resolveTree) {
91
+ const newProps = { ...props };
92
+ let hasChanged = false;
93
+ for (const key of Object.keys(newProps)) {
94
+ const value = newProps[key];
95
+ if (React.isValidElement(value) || Array.isArray(value)) {
96
+ const resolved = await resolveTree(value);
97
+ if (resolved !== value) {
98
+ newProps[key] = resolved;
99
+ hasChanged = true;
100
+ }
101
+ }
102
+ }
103
+ return {
104
+ newProps,
105
+ hasChanged
106
+ };
107
+ }
108
+ //#endregion
109
+ //#region src/features/react/utils/resolveElement.ts
110
+ /**
111
+ * Resolves a server component element or recursively updates its element props.
112
+ * Client component boundaries remain untouched and component errors propagate.
113
+ *
114
+ * @param node - The React element to resolve.
115
+ * @param resolveTree - The recursive tree resolver.
116
+ * @returns The resolved render result or the updated original element.
117
+ * @example
118
+ * ```ts
119
+ * await resolveElement(<ServerPage />, resolveRscTree);
120
+ * ```
121
+ */
122
+ async function resolveElement(node, resolveTree) {
123
+ const { type, props } = node;
124
+ if (typeof type === "function" && !isClientComponent(type)) return resolveTree(await executeServerComponent(type, props));
125
+ if (props && typeof props === "object") {
126
+ const { newProps, hasChanged } = await resolveProps(props, resolveTree);
127
+ if (hasChanged) return React.cloneElement(node, newProps);
128
+ }
129
+ return node;
130
+ }
131
+ //#endregion
132
+ //#region src/features/react/utils/traverseTree.ts
133
+ /**
134
+ * Traverses arrays and React elements, delegating component resolution.
135
+ *
136
+ * @param node - The tree value to visit.
137
+ * @param resolveTree - The recursive tree resolver.
138
+ * @returns The traversed value with server components resolved.
139
+ * @example
140
+ * ```ts
141
+ * await traverseTree(tree, resolveRscTree);
142
+ * ```
143
+ */
144
+ async function traverseTree(node, resolveTree) {
145
+ if (!node || typeof node !== "object") return node;
146
+ if (Array.isArray(node)) return Promise.all(node.map((child, index) => resolveArrayChild(child, index, resolveTree)));
147
+ if (React.isValidElement(node)) return resolveElement(node, resolveTree);
148
+ return node;
149
+ }
150
+ //#endregion
151
+ //#region src/features/react/utils/resolveRscTree.ts
152
+ /**
153
+ * Recursively resolves synchronous and asynchronous React Server Components.
154
+ * Client component boundaries are preserved, and component errors are allowed
155
+ * to reject the returned promise.
156
+ *
157
+ * @param node - The React node or tree to resolve.
158
+ * @returns A promise for the resolved React tree.
159
+ * @example
160
+ * ```ts
161
+ * const resolved = await resolveRscTree(<ServerPage />);
162
+ * ```
163
+ */
164
+ async function resolveRscTree(node) {
165
+ return traverseTree(node, resolveRscTree);
166
+ }
167
+ //#endregion
168
+ export { resolveRscTree };
169
+
170
+ //# sourceMappingURL=react.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.mjs","names":["ClassComponent","FunctionComponent"],"sources":["../src/features/react/utils/resolveArrayChild.ts","../src/features/react/utils/isClassComponent.ts","../src/features/react/utils/executeServerComponent.ts","../src/features/react/utils/isClientComponent.ts","../src/features/react/utils/resolveProps.ts","../src/features/react/utils/resolveElement.ts","../src/features/react/utils/traverseTree.ts","../src/features/react/utils/resolveRscTree.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport * as React from \"react\";\nimport type { ResolveTree } from \"./types\";\n\n/**\n * Resolves one array child and supplies a stable key when the result is an\n * element without one.\n *\n * @param child - The child value to resolve.\n * @param index - The child's position in its containing array.\n * @param resolveTree - The recursive tree resolver.\n * @returns The resolved child.\n * @example\n * ```ts\n * await resolveArrayChild(<Page />, 0, resolveRscTree);\n * ```\n */\nexport async function resolveArrayChild(\n child: ReactNode,\n index: number,\n resolveTree: ResolveTree,\n): Promise<ReactNode> {\n const resolvedChild = await resolveTree(child);\n if (React.isValidElement(resolvedChild)) {\n const keyToUse =\n resolvedChild.key ??\n (child as { key?: string })?.key ??\n `rsc-key-${index}`;\n return React.cloneElement(resolvedChild, { key: keyToUse });\n }\n return resolvedChild;\n}\n","/**\n * Determines whether a component type is a React class component.\n *\n * @param type - The value to inspect.\n * @returns `true` when the value is a React class component.\n * @example\n * ```ts\n * isClassComponent(MyClassComponent); // true\n * ```\n */\nexport function isClassComponent(type: unknown): boolean {\n return (\n typeof type === \"function\" &&\n Boolean(\n (type as { prototype?: { isReactComponent?: unknown } }).prototype\n ?.isReactComponent,\n )\n );\n}\n","import type * as React from \"react\";\nimport type { ReactNode } from \"react\";\nimport { isClassComponent } from \"./isClassComponent\";\n\n/**\n * Executes a server component and awaits an asynchronous result when present.\n * Component errors intentionally propagate to the caller.\n *\n * @param type - The server component to execute.\n * @param props - Props passed to the component.\n * @returns The component's resolved render result.\n * @example\n * ```ts\n * await executeServerComponent(Page, { title: \"Hello\" });\n * ```\n */\nexport async function executeServerComponent(\n type: React.ComponentType<Record<string, unknown>>,\n props: Record<string, unknown>,\n): Promise<ReactNode> {\n if (isClassComponent(type)) {\n const ClassComponent = type as React.ComponentClass<\n Record<string, unknown>\n >;\n return new ClassComponent(props).render();\n }\n\n const FunctionComponent = type as React.FunctionComponent<\n Record<string, unknown>\n >;\n return await FunctionComponent(props);\n}\n","/**\n * Determines whether a component should be kept behind a client boundary.\n * React client/module references and functions containing hook calls are not\n * invoked directly by the resolver.\n *\n * @param type - The React element type to inspect.\n * @returns `true` when the type represents a client boundary.\n * @example\n * ```ts\n * isClientComponent({ $$typeof: Symbol.for(\"react.client.reference\") }); // true\n * ```\n */\nexport function isClientComponent(type: unknown): boolean {\n if (type === null || (typeof type !== \"function\" && typeof type !== \"object\")) {\n return false;\n }\n\n const reference = type as { $$typeof?: symbol; $$id?: unknown };\n if (\n reference.$$typeof === Symbol.for(\"react.client.reference\") ||\n reference.$$typeof === Symbol.for(\"react.module.reference\") ||\n typeof reference.$$id === \"string\"\n ) {\n return true;\n }\n\n return (\n typeof type === \"function\" &&\n /\\buse[A-Z0-9_]\\w*\\s*\\(/.test(Function.prototype.toString.call(type))\n );\n}\n","import * as React from \"react\";\nimport type { ResolveTree } from \"./types\";\n\n/**\n * Resolves React elements and arrays nested in a component's props.\n *\n * @param props - The component props to inspect.\n * @param resolveTree - The recursive tree resolver.\n * @returns Updated props and whether any prop value changed.\n * @example\n * ```ts\n * const result = await resolveProps({ children: <Page /> }, resolveRscTree);\n * ```\n */\nexport async function resolveProps(\n props: Record<string, unknown>,\n resolveTree: ResolveTree,\n): Promise<{ newProps: Record<string, unknown>; hasChanged: boolean }> {\n const newProps: Record<string, unknown> = { ...props };\n let hasChanged = false;\n\n for (const key of Object.keys(newProps)) {\n const value = newProps[key];\n if (React.isValidElement(value) || Array.isArray(value)) {\n const resolved = await resolveTree(value as React.ReactNode);\n if (resolved !== value) {\n newProps[key] = resolved;\n hasChanged = true;\n }\n }\n }\n\n return { newProps, hasChanged };\n}\n","import type { ReactNode } from \"react\";\nimport * as React from \"react\";\nimport { executeServerComponent } from \"./executeServerComponent\";\nimport { isClientComponent } from \"./isClientComponent\";\nimport { resolveProps } from \"./resolveProps\";\nimport type { ResolveTree } from \"./types\";\n\n/**\n * Resolves a server component element or recursively updates its element props.\n * Client component boundaries remain untouched and component errors propagate.\n *\n * @param node - The React element to resolve.\n * @param resolveTree - The recursive tree resolver.\n * @returns The resolved render result or the updated original element.\n * @example\n * ```ts\n * await resolveElement(<ServerPage />, resolveRscTree);\n * ```\n */\nexport async function resolveElement(\n node: React.ReactElement,\n resolveTree: ResolveTree,\n): Promise<ReactNode> {\n const { type, props } = node;\n\n if (typeof type === \"function\" && !isClientComponent(type)) {\n const serverResult = await executeServerComponent(\n type as React.ComponentType<Record<string, unknown>>,\n props as Record<string, unknown>,\n );\n return resolveTree(serverResult);\n }\n\n if (props && typeof props === \"object\") {\n const { newProps, hasChanged } = await resolveProps(\n props as Record<string, unknown>,\n resolveTree,\n );\n if (hasChanged) {\n return React.cloneElement(node, newProps);\n }\n }\n\n return node;\n}\n","import * as React from \"react\";\nimport type { ReactNode } from \"react\";\nimport { resolveArrayChild } from \"./resolveArrayChild\";\nimport { resolveElement } from \"./resolveElement\";\nimport type { ResolveTree } from \"./types\";\n\n/**\n * Traverses arrays and React elements, delegating component resolution.\n *\n * @param node - The tree value to visit.\n * @param resolveTree - The recursive tree resolver.\n * @returns The traversed value with server components resolved.\n * @example\n * ```ts\n * await traverseTree(tree, resolveRscTree);\n * ```\n */\nexport async function traverseTree(\n node: ReactNode,\n resolveTree: ResolveTree,\n): Promise<ReactNode> {\n if (!node || typeof node !== \"object\") return node;\n\n if (Array.isArray(node)) {\n return Promise.all(\n node.map((child, index) => resolveArrayChild(child, index, resolveTree)),\n );\n }\n\n if (React.isValidElement(node)) {\n return resolveElement(node, resolveTree);\n }\n\n return node;\n}\n","import type { ReactNode } from \"react\";\nimport { traverseTree } from \"./traverseTree\";\n\n/**\n * Recursively resolves synchronous and asynchronous React Server Components.\n * Client component boundaries are preserved, and component errors are allowed\n * to reject the returned promise.\n *\n * @param node - The React node or tree to resolve.\n * @returns A promise for the resolved React tree.\n * @example\n * ```ts\n * const resolved = await resolveRscTree(<ServerPage />);\n * ```\n */\nexport async function resolveRscTree(node: ReactNode): Promise<ReactNode> {\n return traverseTree(node, resolveRscTree);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,eAAsB,kBACpB,OACA,OACA,aACoB;CACpB,MAAM,gBAAgB,MAAM,YAAY,KAAK;CAC7C,IAAI,MAAM,eAAe,aAAa,GAAG;EACvC,MAAM,WACJ,cAAc,OACb,OAA4B,OAC7B,WAAW;EACb,OAAO,MAAM,aAAa,eAAe,EAAE,KAAK,SAAS,CAAC;CAC5D;CACA,OAAO;AACT;;;;;;;;;;;;;ACrBA,SAAgB,iBAAiB,MAAwB;CACvD,OACE,OAAO,SAAS,cAChB,QACG,KAAwD,WACrD,gBACN;AAEJ;;;;;;;;;;;;;;;ACFA,eAAsB,uBACpB,MACA,OACoB;CACpB,IAAI,iBAAiB,IAAI,GAIvB,OAAO,IAAIA,KAAe,KAAK,CAAC,CAAC,OAAO;CAM1C,OAAO,MAAMC,KAAkB,KAAK;AACtC;;;;;;;;;;;;;;;ACnBA,SAAgB,kBAAkB,MAAwB;CACxD,IAAI,SAAS,QAAS,OAAO,SAAS,cAAc,OAAO,SAAS,UAClE,OAAO;CAGT,MAAM,YAAY;CAClB,IACE,UAAU,aAAa,OAAO,IAAI,wBAAwB,KAC1D,UAAU,aAAa,OAAO,IAAI,wBAAwB,KAC1D,OAAO,UAAU,SAAS,UAE1B,OAAO;CAGT,OACE,OAAO,SAAS,cAChB,yBAAyB,KAAK,SAAS,UAAU,SAAS,KAAK,IAAI,CAAC;AAExE;;;;;;;;;;;;;;AChBA,eAAsB,aACpB,OACA,aACqE;CACrE,MAAM,WAAoC,EAAE,GAAG,MAAM;CACrD,IAAI,aAAa;CAEjB,KAAK,MAAM,OAAO,OAAO,KAAK,QAAQ,GAAG;EACvC,MAAM,QAAQ,SAAS;EACvB,IAAI,MAAM,eAAe,KAAK,KAAK,MAAM,QAAQ,KAAK,GAAG;GACvD,MAAM,WAAW,MAAM,YAAY,KAAwB;GAC3D,IAAI,aAAa,OAAO;IACtB,SAAS,OAAO;IAChB,aAAa;GACf;EACF;CACF;CAEA,OAAO;EAAE;EAAU;CAAW;AAChC;;;;;;;;;;;;;;;ACdA,eAAsB,eACpB,MACA,aACoB;CACpB,MAAM,EAAE,MAAM,UAAU;CAExB,IAAI,OAAO,SAAS,cAAc,CAAC,kBAAkB,IAAI,GAKvD,OAAO,YAAY,MAJQ,uBACzB,MACA,KACF,CAC+B;CAGjC,IAAI,SAAS,OAAO,UAAU,UAAU;EACtC,MAAM,EAAE,UAAU,eAAe,MAAM,aACrC,OACA,WACF;EACA,IAAI,YACF,OAAO,MAAM,aAAa,MAAM,QAAQ;CAE5C;CAEA,OAAO;AACT;;;;;;;;;;;;;;AC3BA,eAAsB,aACpB,MACA,aACoB;CACpB,IAAI,CAAC,QAAQ,OAAO,SAAS,UAAU,OAAO;CAE9C,IAAI,MAAM,QAAQ,IAAI,GACpB,OAAO,QAAQ,IACb,KAAK,KAAK,OAAO,UAAU,kBAAkB,OAAO,OAAO,WAAW,CAAC,CACzE;CAGF,IAAI,MAAM,eAAe,IAAI,GAC3B,OAAO,eAAe,MAAM,WAAW;CAGzC,OAAO;AACT;;;;;;;;;;;;;;;ACnBA,eAAsB,eAAe,MAAqC;CACxE,OAAO,aAAa,MAAM,cAAc;AAC1C"}
@@ -0,0 +1,28 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ Object.defineProperty(exports, "__toESM", {
24
+ enumerable: true,
25
+ get: function() {
26
+ return __toESM;
27
+ }
28
+ });
@@ -0,0 +1,8 @@
1
+ //#region src/shared/regex/types.d.ts
2
+ type TEXT_PATTERN = RegExp | string;
3
+ type LABEL_LOCATOR = [TEXT_PATTERN, string];
4
+ type TEXT_WITH_NTH = [TEXT_PATTERN, number];
5
+ type TEXT_MATCHER = TEXT_PATTERN | TEXT_WITH_NTH;
6
+ //#endregion
7
+ export { TEXT_WITH_NTH as i, TEXT_MATCHER as n, TEXT_PATTERN as r, LABEL_LOCATOR as t };
8
+ //# sourceMappingURL=types-BlSFP07Z.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-BlSFP07Z.d.cts","names":[],"sources":["../src/shared/regex/types.ts"],"mappings":";KAAY,eAAe;KACf,iBAAiB;KACjB,iBAAiB;KACjB,eAAe,eAAe"}
@@ -0,0 +1,8 @@
1
+ //#region src/shared/regex/types.d.ts
2
+ type TEXT_PATTERN = RegExp | string;
3
+ type LABEL_LOCATOR = [TEXT_PATTERN, string];
4
+ type TEXT_WITH_NTH = [TEXT_PATTERN, number];
5
+ type TEXT_MATCHER = TEXT_PATTERN | TEXT_WITH_NTH;
6
+ //#endregion
7
+ export { TEXT_WITH_NTH as i, TEXT_MATCHER as n, TEXT_PATTERN as r, LABEL_LOCATOR as t };
8
+ //# sourceMappingURL=types-BlSFP07Z.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-BlSFP07Z.d.mts","names":[],"sources":["../src/shared/regex/types.ts"],"mappings":";KAAY,eAAe;KACf,iBAAiB;KACjB,iBAAiB;KACjB,eAAe,eAAe"}
@@ -0,0 +1,2 @@
1
+ import { n as shutConsole, t as resetConsole } from "../index-DtGBqDev.mjs";
2
+ export { resetConsole, shutConsole };
@@ -0,0 +1 @@
1
+ export { t as resetConsole, n as shutConsole } from "../console-Cf1taTRK.mjs";
@@ -0,0 +1,2 @@
1
+ import { a as shouldSee, c as shouldHaveTestId, d as isChecked, f as clickLabelInput, h as ToggleState, i as togglePopover, l as shouldHaveAttributes, m as ToggleConfig, n as userTypes, o as shouldNotSee, p as fireEvent, r as userClicks, s as shouldNotHaveTestId, t as userTypesMultiple, u as isNotChecked } from "../index-CKsosUpb.mjs";
2
+ export { type ToggleConfig, type ToggleState, clickLabelInput, fireEvent, isChecked, isNotChecked, shouldHaveAttributes, shouldHaveTestId, shouldNotHaveTestId, shouldNotSee, shouldSee, togglePopover, userClicks, userTypes, userTypesMultiple };
@@ -0,0 +1 @@
1
+ export { f as clickLabelInput, p as fireEvent, d as isChecked, u as isNotChecked, l as shouldHaveAttributes, c as shouldHaveTestId, s as shouldNotHaveTestId, o as shouldNotSee, a as shouldSee, i as togglePopover, r as userClicks, n as userTypes, t as userTypesMultiple } from "../dom-DeHbD1ni.mjs";