@copilotkit/react-native 2.0.0-rc.5 → 2.0.0-rc.50

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 (113) hide show
  1. package/README.md +334 -2
  2. package/USAGE.md +382 -21
  3. package/dist/CopilotKitProvider-CBVQLdzn.d.cts +77 -0
  4. package/dist/{CopilotKitProvider-CE4bc6CP.mjs → CopilotKitProvider-CCBBonxr.mjs} +63 -43
  5. package/dist/CopilotKitProvider-CCBBonxr.mjs.map +1 -0
  6. package/dist/CopilotKitProvider-CtQg_0S-.d.mts +77 -0
  7. package/dist/{CopilotKitProvider-Byw3cqe2.cjs → CopilotKitProvider-QdcQrrSA.cjs} +69 -42
  8. package/dist/CopilotKitProvider-QdcQrrSA.cjs.map +1 -0
  9. package/dist/{Markdown-C_9Re36O.cjs → Markdown-DLopAh5W.cjs} +10 -10
  10. package/dist/Markdown-DLopAh5W.cjs.map +1 -0
  11. package/dist/{Markdown-JsYh7oSA.d.mts → Markdown-Du-b_Qpr.d.mts} +3 -3
  12. package/dist/{Markdown-1ips7myr.d.cts → Markdown-UXZdDjzs.d.cts} +3 -3
  13. package/dist/{Markdown-C6AsLHmd.mjs → Markdown-VxtPJ_yh.mjs} +4 -4
  14. package/dist/Markdown-VxtPJ_yh.mjs.map +1 -0
  15. package/dist/{MarkdownRendererContext-CAnuohIS.mjs → MarkdownRendererContext-EobUsERg.mjs} +1 -1
  16. package/dist/{MarkdownRendererContext-CAnuohIS.mjs.map → MarkdownRendererContext-EobUsERg.mjs.map} +1 -1
  17. package/dist/MarkdownRendererContext-cDEHvbw9.cjs +40 -0
  18. package/dist/{MarkdownRendererContext-BRNe808d.cjs.map → MarkdownRendererContext-cDEHvbw9.cjs.map} +1 -1
  19. package/dist/chunk-C0xms8kb.cjs +34 -0
  20. package/dist/components/index.cjs +78 -175
  21. package/dist/components/index.cjs.map +1 -1
  22. package/dist/components/index.d.cts +2 -2
  23. package/dist/components/index.d.mts +2 -2
  24. package/dist/components/index.mjs +76 -174
  25. package/dist/components/index.mjs.map +1 -1
  26. package/dist/generative-ui/index.cjs +612 -0
  27. package/dist/generative-ui/index.cjs.map +1 -0
  28. package/dist/generative-ui/index.d.cts +341 -0
  29. package/dist/generative-ui/index.d.mts +341 -0
  30. package/dist/generative-ui/index.mjs +549 -0
  31. package/dist/generative-ui/index.mjs.map +1 -0
  32. package/dist/headless.cjs +3 -2
  33. package/dist/headless.d.cts +3 -3
  34. package/dist/headless.d.mts +3 -3
  35. package/dist/headless.mjs +2 -2
  36. package/dist/index.cjs +132 -162
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +37 -19
  39. package/dist/index.d.mts +37 -19
  40. package/dist/index.mjs +131 -162
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/polyfills/encoding.cjs +115 -5
  43. package/dist/polyfills/encoding.cjs.map +1 -1
  44. package/dist/polyfills/encoding.d.cts +31 -1
  45. package/dist/polyfills/encoding.d.mts +31 -1
  46. package/dist/polyfills/encoding.mjs +113 -6
  47. package/dist/polyfills/encoding.mjs.map +1 -1
  48. package/dist/polyfills/streams.cjs +1 -1
  49. package/dist/polyfills.cjs +218 -2
  50. package/dist/polyfills.cjs.map +1 -1
  51. package/dist/polyfills.mjs +217 -1
  52. package/dist/polyfills.mjs.map +1 -1
  53. package/package.json +51 -21
  54. package/project.json +6 -1
  55. package/scripts/__tests__/verify-polyfill-barrel.test.mjs +150 -0
  56. package/scripts/verify-polyfill-barrel.mjs +158 -11
  57. package/src/CopilotChat.tsx +114 -93
  58. package/src/CopilotKitProvider.tsx +101 -130
  59. package/src/CopilotPopup.tsx +2 -2
  60. package/src/CopilotSidebar.tsx +7 -5
  61. package/src/__mocks__/react-native.ts +31 -0
  62. package/src/__mocks__/test-copilotkit.tsx +9 -3
  63. package/src/__tests__/attachments-integration.test.tsx +15 -2
  64. package/src/__tests__/copilot-chat-agentid.test.tsx +15 -2
  65. package/src/__tests__/copilot-chat-attachments.test.tsx +15 -2
  66. package/src/__tests__/copilot-chat-configuration.test.tsx +82 -0
  67. package/src/__tests__/copilot-chat-threads.test.tsx +232 -0
  68. package/src/__tests__/copilot-popup.test.tsx +15 -2
  69. package/src/__tests__/copilot-sidebar.test.tsx +15 -2
  70. package/src/__tests__/copilotkit-alias-exports.test.ts +16 -0
  71. package/src/__tests__/copilotkit-provider.test.tsx +68 -73
  72. package/src/__tests__/generative-ui-harness.tsx +243 -0
  73. package/src/__tests__/generative-ui-provider-props.test-d.tsx +106 -0
  74. package/src/__tests__/generative-ui-rn-mock.tsx +54 -0
  75. package/src/__tests__/generative-ui-wiring.test.tsx +720 -0
  76. package/src/__tests__/generative-ui.test.tsx +1000 -0
  77. package/src/__tests__/headless-entry-surface.test.ts +979 -61
  78. package/src/__tests__/headless-integration.test.tsx +11 -1
  79. package/src/__tests__/use-attachments.test.ts +27 -2
  80. package/src/components/CopilotChat.tsx +106 -233
  81. package/src/components/CopilotModal.tsx +1 -1
  82. package/src/components/Markdown.tsx +4 -4
  83. package/src/components/__tests__/CopilotChat-edge-cases.test.tsx +5 -1
  84. package/src/components/__tests__/CopilotChat.test.tsx +12 -4
  85. package/src/components/__tests__/CopilotChatInterrupt.test.tsx +208 -0
  86. package/src/components/__tests__/Markdown.code-alias.test.tsx +1 -1
  87. package/src/components/index.ts +6 -0
  88. package/src/components/messages/AssistantMessage.tsx +3 -3
  89. package/src/components/messages/TypingIndicator.tsx +4 -4
  90. package/src/generative-ui/GenerativeUIActivity.tsx +235 -0
  91. package/src/generative-ui/GenerativeUIProvider.tsx +171 -0
  92. package/src/generative-ui/GenerativeUISurface.tsx +303 -0
  93. package/src/generative-ui/host.tsx +138 -0
  94. package/src/generative-ui/index.ts +93 -0
  95. package/src/generative-ui/internal.ts +55 -0
  96. package/src/headless.ts +4 -0
  97. package/src/hooks/use-attachments.ts +95 -139
  98. package/src/index.ts +10 -4
  99. package/src/polyfills/__tests__/encoding-utf8.test.ts +112 -0
  100. package/src/polyfills/encoding.ts +160 -4
  101. package/src/types.d.ts +0 -13
  102. package/tsdown.config.ts +1 -0
  103. package/dist/CopilotKitProvider-BWjzCdHN.d.mts +0 -121
  104. package/dist/CopilotKitProvider-Btm10msB.d.cts +0 -121
  105. package/dist/CopilotKitProvider-Byw3cqe2.cjs.map +0 -1
  106. package/dist/CopilotKitProvider-CE4bc6CP.mjs.map +0 -1
  107. package/dist/Markdown-C6AsLHmd.mjs.map +0 -1
  108. package/dist/Markdown-C_9Re36O.cjs.map +0 -1
  109. package/dist/MarkdownRendererContext-BRNe808d.cjs +0 -72
  110. package/dist/streaming-fetch-Bm91EsRc.cjs +0 -225
  111. package/dist/streaming-fetch-Bm91EsRc.cjs.map +0 -1
  112. package/dist/streaming-fetch-Dm1oN4f2.mjs +0 -219
  113. package/dist/streaming-fetch-Dm1oN4f2.mjs.map +0 -1
@@ -0,0 +1,243 @@
1
+ /**
2
+ * Shared fixtures of the generative UI tests: the catalog, activity message
3
+ * builders, and a harness that mounts a real CopilotKit core with the React
4
+ * Native provider.
5
+ *
6
+ * A test file that imports this must mock react-native first:
7
+ *
8
+ * ```ts
9
+ * vi.mock("react-native", async () =>
10
+ * (await import("./generative-ui-rn-mock")).createReactNativeMock(),
11
+ * );
12
+ * ```
13
+ *
14
+ * The harness covers the three wiring paths a happy-path mount leaves out:
15
+ * - `messages` seeds the agent's messages before mount, so the provider's
16
+ * own ingest of `agent.messages` runs on `startRun` (the path a real app
17
+ * takes), malformed content included;
18
+ * - `strict` mounts under `<React.StrictMode>`, which runs every effect,
19
+ * its cleanup and the effect again;
20
+ * - `inProduction` runs a callback with `NODE_ENV=production`.
21
+ */
22
+ import React, { StrictMode, useState } from "react";
23
+ import type { ReactNode } from "react";
24
+ import { act } from "@testing-library/react";
25
+ import { vi } from "vitest";
26
+ import { z } from "zod";
27
+ import type { AbstractAgent, RunAgentParameters } from "@ag-ui/client";
28
+ import { GENERATIVE_UI_ACTIVITY_TYPE } from "@copilotkit/shared";
29
+ import type {
30
+ A2UIComponentNode,
31
+ A2UIOperation,
32
+ GenerativeUIRejectedOperation,
33
+ GenerativeUISurfaceContent,
34
+ } from "@copilotkit/shared";
35
+ import { useCopilotKit } from "@copilotkit/react-core/context";
36
+ import { SeededAgent, TestCopilotKit } from "../__mocks__/test-copilotkit";
37
+ import {
38
+ GenerativeUIProvider,
39
+ createGenerativeUI,
40
+ useGenerativeUIAccessibility,
41
+ } from "../generative-ui";
42
+ import type {
43
+ GenerativeUIComponentProps,
44
+ GenerativeUIProviderProps,
45
+ } from "../generative-ui";
46
+
47
+ export function Column({ children }: { children?: ReactNode }) {
48
+ return <div data-testid="column">{children}</div>;
49
+ }
50
+ export function Balance({
51
+ label,
52
+ amount,
53
+ }: GenerativeUIComponentProps<typeof ui, "Balance">) {
54
+ return (
55
+ <div data-testid={`balance-${label}`}>
56
+ {label}: {amount}
57
+ </div>
58
+ );
59
+ }
60
+ function Boom(): ReactNode {
61
+ throw new Error("kaboom");
62
+ }
63
+ /** Throws until `flaky.ok` is set, so a Retry can recover it. */
64
+ export const flaky = { ok: false };
65
+ function Flaky(): ReactNode {
66
+ if (!flaky.ok) throw new Error("not yet");
67
+ return <div data-testid="flaky-ok">recovered</div>;
68
+ }
69
+ /** Applies the accessibility envelope to its own root view. */
70
+ function SelfPanel(): ReactNode {
71
+ const aria = useGenerativeUIAccessibility();
72
+ return (
73
+ <div data-testid="self-panel" data-aria={JSON.stringify(aria)}>
74
+ panel
75
+ </div>
76
+ );
77
+ }
78
+
79
+ export const ui = createGenerativeUI({
80
+ id: "bank",
81
+ components: {
82
+ Column: {
83
+ description: "Stacks children vertically",
84
+ component: Column,
85
+ slots: { children: "multiple" },
86
+ },
87
+ Balance: {
88
+ description: "An account balance",
89
+ component: Balance,
90
+ props: z.object({ label: z.string(), amount: z.number() }),
91
+ },
92
+ Boom: { description: "Always throws", component: Boom },
93
+ Flaky: { description: "Throws until it is fixed", component: Flaky },
94
+ SelfPanel: {
95
+ description: "Applies its own accessibility",
96
+ component: SelfPanel,
97
+ accessibility: "self",
98
+ },
99
+ },
100
+ });
101
+
102
+ export const S = "home-surface";
103
+ export const create: A2UIOperation = {
104
+ version: "1.0",
105
+ createSurface: { surfaceId: S, catalogId: "bank" },
106
+ };
107
+ export const nodes = (...components: A2UIComponentNode[]): A2UIOperation => ({
108
+ version: "1.0",
109
+ updateComponents: { surfaceId: S, components },
110
+ });
111
+ export const activity = (
112
+ operations: A2UIOperation[],
113
+ status: GenerativeUISurfaceContent["status"] = "streaming",
114
+ target = "chat",
115
+ ) => ({
116
+ id: `activity-${operations.length}-${status}`,
117
+ role: "activity",
118
+ activityType: GENERATIVE_UI_ACTIVITY_TYPE,
119
+ content: {
120
+ surfaceId: S,
121
+ target,
122
+ catalogId: "bank",
123
+ operations,
124
+ status,
125
+ rejected: [] as GenerativeUIRejectedOperation[],
126
+ } satisfies GenerativeUISurfaceContent,
127
+ });
128
+
129
+ /** A list with a hole at every index that `entries` does not set. */
130
+ export function sparse(...entries: [number, unknown][]): unknown[] {
131
+ const list: unknown[] = [];
132
+ for (const [index, value] of entries) list[index] = value;
133
+ return list;
134
+ }
135
+
136
+ /**
137
+ * An agent that core can run: `runAgent` records its input and resolves at
138
+ * once, so `copilotkit.runAgent` fires the run-start notification that the
139
+ * provider ingests the agent's messages on.
140
+ */
141
+ export class RunnableAgent extends SeededAgent {
142
+ inputs: RunAgentParameters[] = [];
143
+ async runAgent(parameters?: RunAgentParameters) {
144
+ this.inputs.push(parameters ?? {});
145
+ return { result: undefined, newMessages: [] };
146
+ }
147
+ }
148
+
149
+ export type CopilotKitCore = ReturnType<typeof useCopilotKit>["copilotkit"];
150
+
151
+ /** Publishes the CopilotKit core to the test. */
152
+ function CoreProbe({
153
+ coreRef,
154
+ }: {
155
+ coreRef?: React.MutableRefObject<CopilotKitCore | null>;
156
+ }) {
157
+ const { copilotkit } = useCopilotKit();
158
+ if (coreRef) coreRef.current = copilotkit;
159
+ return null;
160
+ }
161
+
162
+ export interface HarnessProps {
163
+ children: (agent: AbstractAgent) => ReactNode;
164
+ agentRef: React.MutableRefObject<AbstractAgent | null>;
165
+ providerProps?: Partial<GenerativeUIProviderProps>;
166
+ /**
167
+ * The agent's messages before mount. The provider ingests them itself at
168
+ * the next run start (`startRun`), and on every change after that.
169
+ */
170
+ messages?: Array<Record<string, unknown>>;
171
+ /** Mounts the tree under `<React.StrictMode>`. */
172
+ strict?: boolean;
173
+ /** Receives the CopilotKit core. */
174
+ coreRef?: React.MutableRefObject<CopilotKitCore | null>;
175
+ }
176
+
177
+ /** Renders `children` inside a real CopilotKit core and the RN provider. */
178
+ export function Harness({
179
+ children,
180
+ agentRef,
181
+ providerProps,
182
+ messages = [],
183
+ strict = false,
184
+ coreRef,
185
+ }: HarnessProps) {
186
+ const [agent] = useState(() => new RunnableAgent());
187
+ const tree = (
188
+ <TestCopilotKit messages={messages} agentRef={agentRef} agent={agent}>
189
+ <CoreProbe coreRef={coreRef} />
190
+ <GenerativeUIProvider ui={ui} {...providerProps}>
191
+ <AgentChildren agentRef={agentRef}>{children}</AgentChildren>
192
+ </GenerativeUIProvider>
193
+ </TestCopilotKit>
194
+ );
195
+ return strict ? <StrictMode>{tree}</StrictMode> : tree;
196
+ }
197
+ function AgentChildren({
198
+ agentRef,
199
+ children,
200
+ }: {
201
+ agentRef: React.MutableRefObject<AbstractAgent | null>;
202
+ children: (agent: AbstractAgent) => ReactNode;
203
+ }) {
204
+ return <>{children(agentRef.current!)}</>;
205
+ }
206
+
207
+ /** A fresh agent ref for the harness. */
208
+ export function newAgentRef() {
209
+ return { current: null } as React.MutableRefObject<AbstractAgent | null>;
210
+ }
211
+
212
+ /**
213
+ * Starts a run of `agent` on `copilotkit` and waits for it. The provider
214
+ * ingests the agent's messages at the start of the run.
215
+ */
216
+ export async function startRun(
217
+ copilotkit: CopilotKitCore,
218
+ agent: AbstractAgent,
219
+ ) {
220
+ await act(async () => {
221
+ await copilotkit.runAgent({ agent });
222
+ });
223
+ }
224
+
225
+ /** Runs `fn` with `NODE_ENV=production`. */
226
+ export async function inProduction<T>(fn: () => T | Promise<T>): Promise<T> {
227
+ vi.stubEnv("NODE_ENV", "production");
228
+ try {
229
+ return await fn();
230
+ } finally {
231
+ vi.unstubAllEnvs();
232
+ }
233
+ }
234
+
235
+ /** The console calls whose first argument contains `needle`. */
236
+ export function warningsWith(
237
+ warn: { mock: { calls: unknown[][] } },
238
+ needle: string,
239
+ ): string[] {
240
+ return warn.mock.calls
241
+ .map((c) => String(c[0]))
242
+ .filter((message) => message.includes(needle));
243
+ }
@@ -0,0 +1,106 @@
1
+ import type React from "react";
2
+ import { expectTypeOf } from "vitest";
3
+ import type { Message } from "@ag-ui/client";
4
+ import {
5
+ createGenerativeUI,
6
+ GenerativeUIProvider,
7
+ GenerativeUISurface,
8
+ isGenerativeUIActivity,
9
+ } from "../generative-ui";
10
+ import type {
11
+ GenerativeUIAccessibilityWrapperProps,
12
+ GenerativeUIActivityWrapperProps,
13
+ GenerativeUIHost,
14
+ GenerativeUINodeFallbackProps,
15
+ GenerativeUIProviderProps,
16
+ GenerativeUIRejectedOperation,
17
+ GenerativeUIRuntime,
18
+ GenerativeUISurfaceProps,
19
+ GenerativeUISurfaceRootProps,
20
+ GenerativeUIToolConfig,
21
+ } from "../generative-ui";
22
+
23
+ /**
24
+ * Type-level guard for the `@copilotkit/react-native/generative-ui` entry.
25
+ *
26
+ * A `.test-d.tsx` file, like `frontend-tool-render.test-d.tsx`: `tsc --noEmit`
27
+ * (`nx run @copilotkit/react-native:check-types`) compiles it, so every
28
+ * `@ts-expect-error` below is load-bearing, and the `.test-d.` infix keeps it
29
+ * out of vitest's suite glob.
30
+ */
31
+
32
+ const ui = createGenerativeUI({ id: "props-test", components: {} });
33
+
34
+ // ─── `theme` is not a React Native prop ──────────────────────────────────────
35
+ // The web `theme` sets `--a2ui-*` CSS variables. React Native has no CSS
36
+ // variables, so the RN host never applies it; accepting it would drop the
37
+ // value silently.
38
+
39
+ expectTypeOf<GenerativeUIProviderProps>().not.toHaveProperty("theme");
40
+ // The config type this entry exports is the React Native one, without theme.
41
+ expectTypeOf<GenerativeUIToolConfig>().not.toHaveProperty("theme");
42
+ expectTypeOf<GenerativeUIToolConfig>().toHaveProperty("agentIds");
43
+
44
+ export const withTheme = (
45
+ // @ts-expect-error `theme` is not accepted on React Native.
46
+ <GenerativeUIProvider ui={ui} theme={{}}>
47
+ {null}
48
+ </GenerativeUIProvider>
49
+ );
50
+
51
+ export const withoutTheme = (
52
+ <GenerativeUIProvider ui={ui} agentIds={["agent"]}>
53
+ {null}
54
+ </GenerativeUIProvider>
55
+ );
56
+
57
+ // ─── The types a custom `host` and a custom Wrapper need are exported ────────
58
+
59
+ expectTypeOf<GenerativeUIActivityWrapperProps["rejected"]>().toEqualTypeOf<
60
+ GenerativeUIRejectedOperation[]
61
+ >();
62
+ expectTypeOf<
63
+ React.ComponentProps<GenerativeUIHost["SurfaceRoot"]>
64
+ >().toEqualTypeOf<GenerativeUISurfaceRootProps>();
65
+ expectTypeOf<
66
+ React.ComponentProps<GenerativeUIHost["AccessibilityWrapper"]>
67
+ >().toEqualTypeOf<GenerativeUIAccessibilityWrapperProps>();
68
+ expectTypeOf<
69
+ React.ComponentProps<GenerativeUIHost["NodeFallback"]>
70
+ >().toEqualTypeOf<GenerativeUINodeFallbackProps>();
71
+ expectTypeOf<GenerativeUIRuntime>().toBeObject();
72
+
73
+ // ─── isGenerativeUIActivity is a type guard ──────────────────────────────────
74
+
75
+ declare const messages: Message[];
76
+ const activities = messages.filter(isGenerativeUIActivity);
77
+ expectTypeOf(activities[0]!.role).toEqualTypeOf<"activity">();
78
+ expectTypeOf(
79
+ activities[0]!.activityType,
80
+ ).toEqualTypeOf<"generative-ui-surface">();
81
+
82
+ // ─── GenerativeUISurface: `components` is typed by `ui` ──────────────────────
83
+
84
+ const shopUI = createGenerativeUI({
85
+ id: "surface-props-test",
86
+ components: { Card: { component: () => null } },
87
+ });
88
+
89
+ export const typedComponents = (
90
+ <GenerativeUISurface id="a" ui={shopUI} components={["Card"]} />
91
+ );
92
+
93
+ export const unknownComponent = (
94
+ // @ts-expect-error "Nope" is not a component of shopUI.
95
+ <GenerativeUISurface id="a" ui={shopUI} components={["Nope"]} />
96
+ );
97
+
98
+ export const componentsWithoutUI = (
99
+ // @ts-expect-error `components` needs `ui`, which types its names.
100
+ <GenerativeUISurface id="a" components={["Card"]} />
101
+ );
102
+
103
+ // The Wrapper of a named-target surface takes the Activity's Wrapper props.
104
+ expectTypeOf<NonNullable<GenerativeUISurfaceProps["Wrapper"]>>().toEqualTypeOf<
105
+ React.ComponentType<GenerativeUIActivityWrapperProps>
106
+ >();
@@ -0,0 +1,54 @@
1
+ /**
2
+ * React Native host components as DOM elements, so the generative UI tests
3
+ * can query them. The layout and accessibility props a native view would
4
+ * receive are written out as data attributes, so the tests can see what
5
+ * reaches the platform.
6
+ *
7
+ * Use it as the factory of `vi.mock("react-native", ...)`. It imports
8
+ * nothing that imports react-native, so the factory cannot recurse.
9
+ */
10
+ import React from "react";
11
+
12
+ const host =
13
+ (tag: string) =>
14
+ ({
15
+ children,
16
+ testID,
17
+ style,
18
+ onPress,
19
+ accessibilityRole,
20
+ collapsable,
21
+ accessibilityElementsHidden,
22
+ importantForAccessibility,
23
+ accessibilityLiveRegion,
24
+ "aria-hidden": ariaHidden,
25
+ "aria-live": ariaLive,
26
+ }: any) =>
27
+ React.createElement(
28
+ tag,
29
+ {
30
+ "data-testid": testID,
31
+ "data-style": JSON.stringify(style ?? null),
32
+ "data-collapsable": JSON.stringify(collapsable),
33
+ "data-accessibility-elements-hidden": JSON.stringify(
34
+ accessibilityElementsHidden,
35
+ ),
36
+ "data-important-for-accessibility": importantForAccessibility,
37
+ "data-accessibility-live-region": accessibilityLiveRegion,
38
+ "data-aria-hidden": JSON.stringify(ariaHidden),
39
+ "data-aria-live": ariaLive,
40
+ role: accessibilityRole,
41
+ onClick: onPress,
42
+ },
43
+ children,
44
+ );
45
+
46
+ export function createReactNativeMock() {
47
+ return {
48
+ View: host("div"),
49
+ Text: host("span"),
50
+ Pressable: host("button"),
51
+ StyleSheet: { create: (s: unknown) => s, hairlineWidth: 1 },
52
+ Platform: { OS: "ios", select: (o: any) => o.ios ?? o.default },
53
+ };
54
+ }