@plasmicapp/react-web 1.0.5 → 1.0.6
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.
- package/dist/all.d.ts +57 -0
- package/dist/index.cjs.js +57 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/react-web.esm.js +57 -0
- package/dist/react-web.esm.js.map +1 -1
- package/dist/render/ssr.d.ts +57 -0
- package/package.json +2 -2
- package/skinny/dist/index.js +2 -2
- package/skinny/dist/plume/checkbox/index.js +1 -1
- package/skinny/dist/plume/menu/index.js +1 -1
- package/skinny/dist/plume/menu-button/index.js +1 -1
- package/skinny/dist/plume/select/index.js +1 -1
- package/skinny/dist/plume/switch/index.js +1 -1
- package/skinny/dist/render/ssr.d.ts +57 -0
- package/skinny/dist/{ssr-e496f477.js → ssr-6a83562a.js} +58 -1
- package/skinny/dist/{ssr-e496f477.js.map → ssr-6a83562a.js.map} +1 -1
package/dist/render/ssr.d.ts
CHANGED
|
@@ -15,6 +15,63 @@ export interface PlasmicRootProviderProps extends PlasmicDataSourceContextValue
|
|
|
15
15
|
disableLoadingBoundary?: boolean;
|
|
16
16
|
suspenseFallback?: React.ReactNode;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* PlasmicRootProvider sets up the React context that Plasmic-generated components
|
|
20
|
+
* rely on including data sources, i18n, Head, and Link.
|
|
21
|
+
*
|
|
22
|
+
* In Next.js app router, props passed from a Server to a Client Components must be serializable
|
|
23
|
+
* but several PlasmicRootProvider props are not (e.g. `loader`, `Link` from `next/link`).
|
|
24
|
+
* We recommend defining a Client Component wrapper (`ClientPlasmicRootProvider` in
|
|
25
|
+
* `plasmic-init-client.tsx`) that imports non-serializable values and passes them to
|
|
26
|
+
* PlasmicRootProvider (and only accepts serializable props from its caller).
|
|
27
|
+
*
|
|
28
|
+
* Loader example:
|
|
29
|
+
*
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // plasmic-init-client.tsx
|
|
32
|
+
* "use client";
|
|
33
|
+
* import { PlasmicRootProvider } from "@plasmicapp/loader-nextjs";
|
|
34
|
+
* import { PLASMIC } from "@/plasmic-init";
|
|
35
|
+
* export function ClientPlasmicRootProvider(
|
|
36
|
+
* props: Omit<React.ComponentProps<typeof PlasmicRootProvider>, "loader">
|
|
37
|
+
* ) {
|
|
38
|
+
* return <PlasmicRootProvider loader={PLASMIC} {...props} />;
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* Codegen example:
|
|
43
|
+
*
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // plasmic-init-client.tsx
|
|
46
|
+
* "use client";
|
|
47
|
+
* import { PlasmicRootProvider } from "@plasmicapp/react-web";
|
|
48
|
+
* import Link from "next/link";
|
|
49
|
+
* export function ClientPlasmicRootProvider(
|
|
50
|
+
* props: Omit<React.ComponentProps<typeof PlasmicRootProvider>, "Link">
|
|
51
|
+
* ) {
|
|
52
|
+
* return <PlasmicRootProvider Link={Link} {...props} />;
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* A Server Component can then render `ClientPlasmicRootProvider` and pass
|
|
57
|
+
* serializable props such as prefetched data and children:
|
|
58
|
+
*
|
|
59
|
+
* ```tsx
|
|
60
|
+
* import { PLASMIC } from "@/plasmic-init";
|
|
61
|
+
* import { ClientPlasmicRootProvider } from "@/plasmic-init-client";
|
|
62
|
+
* export default async function MyPage() {
|
|
63
|
+
* const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
|
|
64
|
+
* return (
|
|
65
|
+
* <ClientPlasmicRootProvider prefetchedData={prefetchedData}>
|
|
66
|
+
* {yourContent()}
|
|
67
|
+
* </ClientPlasmicRootProvider>
|
|
68
|
+
* );
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* See https://nextjs.org/docs/app/getting-started/server-and-client-components#passing-data-from-server-to-client-components
|
|
73
|
+
* for more on the Server/Client Component boundary.
|
|
74
|
+
*/
|
|
18
75
|
export declare function PlasmicRootProvider(props: PlasmicRootProviderProps): React.JSX.Element;
|
|
19
76
|
export declare const useIsSSR: typeof useAriaIsSSR;
|
|
20
77
|
export declare function useHasPlasmicRoot(): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/react-web",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "plasmic library for rendering in the presentational style",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"react": ">=18.0.0",
|
|
143
143
|
"react-dom": ">=18.0.0"
|
|
144
144
|
},
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "5f674c9df3345496989eb0d1e09ddd30604757a9"
|
|
146
146
|
}
|
package/skinny/dist/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import * as React from 'react';
|
|
|
7
7
|
import React__default from 'react';
|
|
8
8
|
export { PlasmicHead, plasmicHeadMeta } from './render/PlasmicHead/index.js';
|
|
9
9
|
export { PlasmicImg } from './render/PlasmicImg/index.js';
|
|
10
|
-
import { T as Trans } from './ssr-
|
|
11
|
-
export { P as PlasmicLink, a as PlasmicRootProvider, g as genTranslatableString, u as useIsSSR, b as usePlasmicTranslator } from './ssr-
|
|
10
|
+
import { T as Trans } from './ssr-6a83562a.js';
|
|
11
|
+
export { P as PlasmicLink, a as PlasmicRootProvider, g as genTranslatableString, u as useIsSSR, b as usePlasmicTranslator } from './ssr-6a83562a.js';
|
|
12
12
|
import { m as mergeProps, c as createElementWithChildren, e as ensureNotArray, N as NONE, a as mergePropVals, i as isReactNode, b as isBrowser, u as useIsomorphicLayoutEffect } from './react-utils-2892a561.js';
|
|
13
13
|
import get from 'dlv';
|
|
14
14
|
export { default as get } from 'dlv';
|
|
@@ -4,7 +4,7 @@ import { VisuallyHidden } from '@react-aria/visually-hidden';
|
|
|
4
4
|
import { useToggleState } from '@react-stately/toggle';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { m as mergeProps } from '../../react-utils-2892a561.js';
|
|
7
|
-
import { c as useEnsureSSRProvider } from '../../ssr-
|
|
7
|
+
import { c as useEnsureSSRProvider } from '../../ssr-6a83562a.js';
|
|
8
8
|
import { m as mergeVariantToggles } from '../../plume-utils-bc11b672.js';
|
|
9
9
|
import { g as getStyleProps } from '../../props-utils-9d995f69.js';
|
|
10
10
|
import 'classnames';
|
|
@@ -3,7 +3,7 @@ import { useMenu as useMenu$1, useMenuSection, useMenuItem as useMenuItem$1 } fr
|
|
|
3
3
|
import { useTreeState } from '@react-stately/tree';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { m as mergeProps } from '../../react-utils-2892a561.js';
|
|
6
|
-
import { c as useEnsureSSRProvider } from '../../ssr-
|
|
6
|
+
import { c as useEnsureSSRProvider } from '../../ssr-6a83562a.js';
|
|
7
7
|
import { r as renderCollectionNode, u as useDerivedItemsFromChildren, a as renderAsCollectionChild } from '../../collection-utils-690045f9.js';
|
|
8
8
|
import { n as noOutline, m as mergeVariantToggles } from '../../plume-utils-bc11b672.js';
|
|
9
9
|
import { g as getStyleProps } from '../../props-utils-9d995f69.js';
|
|
@@ -7,7 +7,7 @@ import { usePress } from '@react-aria/interactions';
|
|
|
7
7
|
import { useMenuTrigger as useMenuTrigger$1 } from '@react-aria/menu';
|
|
8
8
|
import { g as getPlumeType, m as mergeVariantToggles } from '../../plume-utils-bc11b672.js';
|
|
9
9
|
import { useFocusable } from '@react-aria/focus';
|
|
10
|
-
import { c as useEnsureSSRProvider } from '../../ssr-
|
|
10
|
+
import { c as useEnsureSSRProvider } from '../../ssr-6a83562a.js';
|
|
11
11
|
import { g as getStyleProps } from '../../props-utils-9d995f69.js';
|
|
12
12
|
import 'classnames';
|
|
13
13
|
import '@plasmicapp/data-sources-context';
|
|
@@ -6,7 +6,7 @@ import { useSelect as useSelect$1, HiddenSelect } from '@react-aria/select';
|
|
|
6
6
|
import { useSelectState } from '@react-stately/select';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { m as mergeProps, d as mergeRefs } from '../../react-utils-2892a561.js';
|
|
9
|
-
import { c as useEnsureSSRProvider } from '../../ssr-
|
|
9
|
+
import { c as useEnsureSSRProvider } from '../../ssr-6a83562a.js';
|
|
10
10
|
import { g as getChildProp, r as renderCollectionNode, b as useDerivedItems, a as renderAsCollectionChild } from '../../collection-utils-690045f9.js';
|
|
11
11
|
import { m as mergeVariantToggles, n as noOutline } from '../../plume-utils-bc11b672.js';
|
|
12
12
|
import { g as getStyleProps } from '../../props-utils-9d995f69.js';
|
|
@@ -4,7 +4,7 @@ import { VisuallyHidden } from '@react-aria/visually-hidden';
|
|
|
4
4
|
import { useToggleState } from '@react-stately/toggle';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { m as mergeProps } from '../../react-utils-2892a561.js';
|
|
7
|
-
import { c as useEnsureSSRProvider } from '../../ssr-
|
|
7
|
+
import { c as useEnsureSSRProvider } from '../../ssr-6a83562a.js';
|
|
8
8
|
import { m as mergeVariantToggles } from '../../plume-utils-bc11b672.js';
|
|
9
9
|
import { g as getStyleProps } from '../../props-utils-9d995f69.js';
|
|
10
10
|
import 'classnames';
|
|
@@ -15,6 +15,63 @@ export interface PlasmicRootProviderProps extends PlasmicDataSourceContextValue
|
|
|
15
15
|
disableLoadingBoundary?: boolean;
|
|
16
16
|
suspenseFallback?: React.ReactNode;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* PlasmicRootProvider sets up the React context that Plasmic-generated components
|
|
20
|
+
* rely on including data sources, i18n, Head, and Link.
|
|
21
|
+
*
|
|
22
|
+
* In Next.js app router, props passed from a Server to a Client Components must be serializable
|
|
23
|
+
* but several PlasmicRootProvider props are not (e.g. `loader`, `Link` from `next/link`).
|
|
24
|
+
* We recommend defining a Client Component wrapper (`ClientPlasmicRootProvider` in
|
|
25
|
+
* `plasmic-init-client.tsx`) that imports non-serializable values and passes them to
|
|
26
|
+
* PlasmicRootProvider (and only accepts serializable props from its caller).
|
|
27
|
+
*
|
|
28
|
+
* Loader example:
|
|
29
|
+
*
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // plasmic-init-client.tsx
|
|
32
|
+
* "use client";
|
|
33
|
+
* import { PlasmicRootProvider } from "@plasmicapp/loader-nextjs";
|
|
34
|
+
* import { PLASMIC } from "@/plasmic-init";
|
|
35
|
+
* export function ClientPlasmicRootProvider(
|
|
36
|
+
* props: Omit<React.ComponentProps<typeof PlasmicRootProvider>, "loader">
|
|
37
|
+
* ) {
|
|
38
|
+
* return <PlasmicRootProvider loader={PLASMIC} {...props} />;
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* Codegen example:
|
|
43
|
+
*
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // plasmic-init-client.tsx
|
|
46
|
+
* "use client";
|
|
47
|
+
* import { PlasmicRootProvider } from "@plasmicapp/react-web";
|
|
48
|
+
* import Link from "next/link";
|
|
49
|
+
* export function ClientPlasmicRootProvider(
|
|
50
|
+
* props: Omit<React.ComponentProps<typeof PlasmicRootProvider>, "Link">
|
|
51
|
+
* ) {
|
|
52
|
+
* return <PlasmicRootProvider Link={Link} {...props} />;
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* A Server Component can then render `ClientPlasmicRootProvider` and pass
|
|
57
|
+
* serializable props such as prefetched data and children:
|
|
58
|
+
*
|
|
59
|
+
* ```tsx
|
|
60
|
+
* import { PLASMIC } from "@/plasmic-init";
|
|
61
|
+
* import { ClientPlasmicRootProvider } from "@/plasmic-init-client";
|
|
62
|
+
* export default async function MyPage() {
|
|
63
|
+
* const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
|
|
64
|
+
* return (
|
|
65
|
+
* <ClientPlasmicRootProvider prefetchedData={prefetchedData}>
|
|
66
|
+
* {yourContent()}
|
|
67
|
+
* </ClientPlasmicRootProvider>
|
|
68
|
+
* );
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* See https://nextjs.org/docs/app/getting-started/server-and-client-components#passing-data-from-server-to-client-components
|
|
73
|
+
* for more on the Server/Client Component boundary.
|
|
74
|
+
*/
|
|
18
75
|
export declare function PlasmicRootProvider(props: PlasmicRootProviderProps): React.JSX.Element;
|
|
19
76
|
export declare const useIsSSR: typeof useAriaIsSSR;
|
|
20
77
|
export declare function useHasPlasmicRoot(): boolean;
|
|
@@ -156,6 +156,63 @@ function isIterable(val) {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
var PlasmicRootContext = React.createContext(undefined);
|
|
159
|
+
/**
|
|
160
|
+
* PlasmicRootProvider sets up the React context that Plasmic-generated components
|
|
161
|
+
* rely on including data sources, i18n, Head, and Link.
|
|
162
|
+
*
|
|
163
|
+
* In Next.js app router, props passed from a Server to a Client Components must be serializable
|
|
164
|
+
* but several PlasmicRootProvider props are not (e.g. `loader`, `Link` from `next/link`).
|
|
165
|
+
* We recommend defining a Client Component wrapper (`ClientPlasmicRootProvider` in
|
|
166
|
+
* `plasmic-init-client.tsx`) that imports non-serializable values and passes them to
|
|
167
|
+
* PlasmicRootProvider (and only accepts serializable props from its caller).
|
|
168
|
+
*
|
|
169
|
+
* Loader example:
|
|
170
|
+
*
|
|
171
|
+
* ```tsx
|
|
172
|
+
* // plasmic-init-client.tsx
|
|
173
|
+
* "use client";
|
|
174
|
+
* import { PlasmicRootProvider } from "@plasmicapp/loader-nextjs";
|
|
175
|
+
* import { PLASMIC } from "@/plasmic-init";
|
|
176
|
+
* export function ClientPlasmicRootProvider(
|
|
177
|
+
* props: Omit<React.ComponentProps<typeof PlasmicRootProvider>, "loader">
|
|
178
|
+
* ) {
|
|
179
|
+
* return <PlasmicRootProvider loader={PLASMIC} {...props} />;
|
|
180
|
+
* }
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
* Codegen example:
|
|
184
|
+
*
|
|
185
|
+
* ```tsx
|
|
186
|
+
* // plasmic-init-client.tsx
|
|
187
|
+
* "use client";
|
|
188
|
+
* import { PlasmicRootProvider } from "@plasmicapp/react-web";
|
|
189
|
+
* import Link from "next/link";
|
|
190
|
+
* export function ClientPlasmicRootProvider(
|
|
191
|
+
* props: Omit<React.ComponentProps<typeof PlasmicRootProvider>, "Link">
|
|
192
|
+
* ) {
|
|
193
|
+
* return <PlasmicRootProvider Link={Link} {...props} />;
|
|
194
|
+
* }
|
|
195
|
+
* ```
|
|
196
|
+
*
|
|
197
|
+
* A Server Component can then render `ClientPlasmicRootProvider` and pass
|
|
198
|
+
* serializable props such as prefetched data and children:
|
|
199
|
+
*
|
|
200
|
+
* ```tsx
|
|
201
|
+
* import { PLASMIC } from "@/plasmic-init";
|
|
202
|
+
* import { ClientPlasmicRootProvider } from "@/plasmic-init-client";
|
|
203
|
+
* export default async function MyPage() {
|
|
204
|
+
* const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
|
|
205
|
+
* return (
|
|
206
|
+
* <ClientPlasmicRootProvider prefetchedData={prefetchedData}>
|
|
207
|
+
* {yourContent()}
|
|
208
|
+
* </ClientPlasmicRootProvider>
|
|
209
|
+
* );
|
|
210
|
+
* }
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* See https://nextjs.org/docs/app/getting-started/server-and-client-components#passing-data-from-server-to-client-components
|
|
214
|
+
* for more on the Server/Client Component boundary.
|
|
215
|
+
*/
|
|
159
216
|
function PlasmicRootProvider(props) {
|
|
160
217
|
var _a;
|
|
161
218
|
var platform = props.platform, children = props.children, userAuthToken = props.userAuthToken, isUserLoading = props.isUserLoading, authRedirectUri = props.authRedirectUri, user = props.user, disableLoadingBoundary = props.disableLoadingBoundary, suspenseFallback = props.suspenseFallback;
|
|
@@ -211,4 +268,4 @@ function MaybeWrap(props) {
|
|
|
211
268
|
}
|
|
212
269
|
|
|
213
270
|
export { PlasmicLink as P, Trans as T, PlasmicRootProvider as a, usePlasmicTranslator as b, useEnsureSSRProvider as c, genTranslatableString as g, useIsSSR as u };
|
|
214
|
-
//# sourceMappingURL=ssr-
|
|
271
|
+
//# sourceMappingURL=ssr-6a83562a.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-e496f477.js","sources":["../../src/render/PlasmicLink.tsx","../../src/render/translation.tsx","../../src/render/ssr.tsx"],"sourcesContent":["import { usePlasmicLinkMaybe } from \"@plasmicapp/host\";\nimport React from \"react\";\nimport { omit, pick } from \"../common\";\n\n// These props are used internally by PlasmicLink to determine how to render the link\nconst INTERNAL_PROPS = [\"component\", \"platform\", \"legacyBehavior\"] as const;\n\nexport const PlasmicLink = React.forwardRef(function PlasmicLink(\n props: any,\n ref: React.Ref<any>\n) {\n // The usePlasmicLinkMaybe function may be undefined, if host is not up-to-date\n const Link = usePlasmicLinkMaybe?.() ?? PlasmicLinkInternal;\n if (Link === PlasmicLink || Link === PlasmicLinkInternal) {\n // Just in case, break the cycle\n return <PlasmicLinkInternal {...props} ref={ref} />;\n } else {\n // Don't pass internal props (component/platform/legacyBehavior) to non-PlasmicLinkInternal\n // eslint-disable-next-line react/forbid-elements\n return <Link {...omit(props, ...INTERNAL_PROPS)} ref={ref} />;\n }\n});\n\nexport const PlasmicLinkInternal = React.forwardRef(\n function PlasmicLinkInternal(props: any, ref: React.Ref<any>) {\n // props.href is required for nextjs; if no props.href,\n // then we just render the default anchor element\n if (props.platform === \"nextjs\" && props.href) {\n const nextjsProps = [\n \"href\",\n \"replace\",\n \"scroll\",\n \"shallow\",\n \"passHref\",\n \"prefetch\",\n \"locale\",\n ];\n\n // If this is a fragment identifier link, then we set\n // scroll={false} so that smooth scrolling works\n const isFragment = props.href?.startsWith(\"#\");\n\n // Default to legacy behavior (nested <a> tag) unless legacyBehavior\n // is explicitly set to false. Older codegen may not set this prop at\n // all, so we treat undefined as legacy for backwards compatibility.\n // https://github.com/plasmicapp/plasmic-internal/pull/2203#issuecomment-3877931788\n if (props.legacyBehavior !== false) {\n return React.createElement(\n props.component,\n {\n scroll: !isFragment,\n legacyBehavior: true,\n ...pick(props, ...nextjsProps),\n },\n <a {...omit(props, ...INTERNAL_PROPS, ...nextjsProps)} ref={ref} />\n );\n }\n\n // pass props directly to Link (no nested <a>)\n return React.createElement(props.component, {\n scroll: !isFragment,\n ...omit(props, ...INTERNAL_PROPS),\n ref,\n });\n }\n\n if (props.platform === \"gatsby\" && isInternalHref(props.href)) {\n return React.createElement(props.component, {\n ...omit(props, ...INTERNAL_PROPS, \"href\"),\n ...{ to: props.href, ref },\n });\n }\n\n if (props.platform === \"tanstack\" && isInternalHref(props.href)) {\n return React.createElement(props.component, {\n ...omit(props, ...INTERNAL_PROPS, \"href\"),\n ...{ to: props.href, ref },\n });\n }\n\n return <a {...omit(props, ...INTERNAL_PROPS)} ref={ref} />;\n }\n);\n\nfunction isInternalHref(href: string): boolean {\n return /^\\/(?!\\/)/.test(href);\n}\n","import {\n PlasmicTranslatorContext as HostPlasmicTranslatorContext,\n PlasmicI18NContextValue,\n PlasmicTranslator,\n usePlasmicTranslator as useHostPlasmicTranslator,\n} from \"@plasmicapp/host\";\nimport React from \"react\";\n\n// Make the refactor to host backwards compatible for loader\nexport const PlasmicTranslatorContext =\n HostPlasmicTranslatorContext ??\n React.createContext<PlasmicI18NContextValue | PlasmicTranslator | undefined>(\n undefined\n );\n\nexport const usePlasmicTranslator =\n useHostPlasmicTranslator ??\n (() => {\n const _t = React.useContext(PlasmicTranslatorContext);\n const translator = _t\n ? typeof _t === \"function\"\n ? _t\n : _t.translator\n : undefined;\n return translator;\n });\n\nexport interface TransProps {\n transKey?: string;\n children?: React.ReactNode;\n}\n\nexport function genTranslatableString(\n elt: React.ReactNode,\n opts?: {\n tagPrefix?: string;\n }\n) {\n const components: {\n [key: string]: React.ReactElement;\n } = {};\n let componentsCount = 0;\n\n const getText = (node: React.ReactNode): string => {\n if (!node) {\n return \"\";\n }\n if (\n typeof node === \"number\" ||\n typeof node === \"boolean\" ||\n typeof node === \"string\"\n ) {\n return node.toString();\n }\n if (typeof node !== \"object\") {\n return \"\";\n }\n if (Array.isArray(node) || isIterable(node)) {\n return Array.from(node)\n .map((child) => getText(child))\n .filter((child) => !!child)\n .join(\"\");\n }\n const nodeChildren: React.ReactNode =\n (hasKey(node, \"props\") &&\n hasKey(node.props, \"children\") &&\n (node.props.children as React.ReactNode | undefined)) ||\n (hasKey(node, \"children\") && node.children) ||\n [];\n const contents = `${React.Children.toArray(nodeChildren)\n .map((child) => getText(child))\n .filter((child) => !!child)\n .join(\"\")}`;\n if (React.isValidElement(node) && node.type === React.Fragment) {\n return contents;\n }\n const prefix = opts?.tagPrefix ?? \"\";\n const componentId = `${prefix}${componentsCount + 1}`;\n componentsCount++;\n components[componentId] = React.isValidElement(node)\n ? React.cloneElement(node as any, {\n key: componentId,\n children: undefined,\n })\n : (node as never);\n return `<${componentId}>${contents}</${componentId}>`;\n };\n\n const str = getText(elt);\n return {\n str,\n components,\n componentsCount,\n };\n}\n\nexport function Trans({ transKey, children }: TransProps) {\n const _t = React.useContext(PlasmicTranslatorContext);\n const translator = _t\n ? typeof _t === \"function\"\n ? _t\n : _t.translator\n : undefined;\n if (!translator) {\n warnNoTranslationFunctionAtMostOnce();\n return children;\n }\n\n const { str, components, componentsCount } = genTranslatableString(children, {\n tagPrefix: typeof _t === \"object\" ? _t.tagPrefix : undefined,\n });\n return translator(\n transKey ?? str,\n componentsCount > 0 ? { components } : undefined\n );\n}\n\nlet hasWarned = false;\nfunction warnNoTranslationFunctionAtMostOnce() {\n if (!hasWarned) {\n console.warn(\n \"Using Plasmic Translation but no translation function has been provided\"\n );\n hasWarned = true;\n }\n}\n\nfunction hasKey<K extends string>(v: any, key: K): v is Record<K, any> {\n return typeof v === \"object\" && v !== null && key in v;\n}\n\nfunction isIterable(val: any): val is Iterable<any> {\n return val != null && typeof val[Symbol.iterator] === \"function\";\n}\n","import {\n PlasmicDataSourceContextProvider,\n PlasmicDataSourceContextValue,\n} from \"@plasmicapp/data-sources-context\";\nimport {\n DataProvider,\n PlasmicI18NContextValue,\n PlasmicLinkProvider,\n} from \"@plasmicapp/host\";\nimport { SSRProvider, useIsSSR as useAriaIsSSR } from \"@react-aria/ssr\";\nimport * as React from \"react\";\nimport { PlasmicHeadContext } from \"./PlasmicHead\";\nimport { PlasmicLinkInternal } from \"./PlasmicLink\";\nimport { PlasmicTranslatorContext } from \"./translation\";\nexport {\n PlasmicDataSourceContextProvider,\n useCurrentUser,\n} from \"@plasmicapp/data-sources-context\";\n// import { PlasmicLink } from \"./PlasmicLink\";\n\nexport interface PlasmicRootContextValue {\n platform?: \"nextjs\" | \"gatsby\";\n}\n\nconst PlasmicRootContext = React.createContext<\n PlasmicRootContextValue | undefined\n>(undefined);\n\nexport interface PlasmicRootProviderProps\n extends PlasmicDataSourceContextValue {\n platform?: \"nextjs\" | \"gatsby\";\n children?: React.ReactNode;\n i18n?: PlasmicI18NContextValue;\n Head?: React.ComponentType<any>;\n Link?: React.ComponentType<any>;\n disableLoadingBoundary?: boolean;\n suspenseFallback?: React.ReactNode;\n}\n\nexport function PlasmicRootProvider(props: PlasmicRootProviderProps) {\n const {\n platform,\n children,\n userAuthToken,\n isUserLoading,\n authRedirectUri,\n user,\n disableLoadingBoundary,\n suspenseFallback,\n } = props;\n const context = React.useMemo(\n () => ({\n platform,\n }),\n [platform]\n );\n const dataSourceContextValue = React.useMemo(\n () => ({\n userAuthToken,\n user,\n isUserLoading,\n authRedirectUri,\n }),\n [userAuthToken, isUserLoading, user, authRedirectUri]\n );\n const reactMajorVersion = +React.version.split(\".\")[0];\n\n return (\n <MaybeWrap\n cond={!disableLoadingBoundary && reactMajorVersion >= 18}\n wrapper={(children_) => (\n <DataProvider\n name=\"plasmicInternalEnableLoadingBoundary\"\n hidden\n data={true}\n >\n <React.Suspense fallback={suspenseFallback ?? \"Loading...\"}>\n {children_}\n </React.Suspense>\n </DataProvider>\n )}\n >\n <PlasmicRootContext.Provider value={context}>\n <MaybeWrap\n cond={reactMajorVersion < 18}\n wrapper={(children_) => <SSRProvider>{children_}</SSRProvider>}\n >\n <PlasmicDataSourceContextProvider value={dataSourceContextValue}>\n <PlasmicTranslatorContext.Provider value={props.i18n}>\n <PlasmicHeadContext.Provider value={props.Head}>\n <SafePlasmicLinkProvider\n Link={props.Link ?? PlasmicLinkInternal}\n >\n {children}\n </SafePlasmicLinkProvider>\n </PlasmicHeadContext.Provider>\n </PlasmicTranslatorContext.Provider>\n </PlasmicDataSourceContextProvider>\n </MaybeWrap>\n </PlasmicRootContext.Provider>\n </MaybeWrap>\n );\n}\n\n/**\n * A PlasmicLinkProvider that anticipates PlasmicLinkProvider may not exist yet from\n * @plasmicapp/host if the user is using an older version\n */\nfunction SafePlasmicLinkProvider(\n props: React.ComponentProps<typeof PlasmicLinkProvider>\n) {\n if (PlasmicLinkProvider) {\n return <PlasmicLinkProvider {...props} />;\n } else {\n return <>{props.children}</>;\n }\n}\n\nexport const useIsSSR = useAriaIsSSR;\n\nexport function useHasPlasmicRoot() {\n return !!React.useContext(PlasmicRootContext);\n}\n\nlet hasWarnedSSR = false;\n/**\n * Warns the user if PlasmicRootProvider is not used\n */\nexport function useEnsureSSRProvider() {\n const hasRoot = useHasPlasmicRoot();\n if (hasRoot || hasWarnedSSR || process.env.NODE_ENV !== \"development\") {\n return;\n }\n\n hasWarnedSSR = true;\n console.warn(\n `Plasmic: To ensure your components work correctly with server-side rendering, please use PlasmicRootProvider at the root of your application. See https://docs.plasmic.app/learn/ssr`\n );\n}\n\nfunction MaybeWrap(props: {\n children: React.ReactElement;\n cond: boolean;\n wrapper: (children: React.ReactElement) => React.ReactElement;\n}) {\n return props.cond ? props.wrapper(props.children) : props.children;\n}\n"],"names":["React","HostPlasmicTranslatorContext","useHostPlasmicTranslator","useAriaIsSSR"],"mappings":";;;;;;;;AAIA;AACA,IAAM,cAAc,GAAG,CAAC,WAAW,EA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/translation.tsx","../../src/render/ssr.tsx"],"sourcesContent":["import { usePlasmicLinkMaybe } from \"@plasmicapp/host\";\nimport React from \"react\";\nimport { omit, pick } from \"../common\";\n\n// These props are used internally by PlasmicLink to determine how to render the link\nconst INTERNAL_PROPS = [\"component\", \"platform\", \"legacyBehavior\"] as const;\n\nexport const PlasmicLink = React.forwardRef(function PlasmicLink(\n props: any,\n ref: React.Ref<any>\n) {\n // The usePlasmicLinkMaybe function may be undefined, if host is not up-to-date\n const Link = usePlasmicLinkMaybe?.() ?? PlasmicLinkInternal;\n if (Link === PlasmicLink || Link === PlasmicLinkInternal) {\n // Just in case, break the cycle\n return <PlasmicLinkInternal {...props} ref={ref} />;\n } else {\n // Don't pass internal props (component/platform/legacyBehavior) to non-PlasmicLinkInternal\n // eslint-disable-next-line react/forbid-elements\n return <Link {...omit(props, ...INTERNAL_PROPS)} ref={ref} />;\n }\n});\n\nexport const PlasmicLinkInternal = React.forwardRef(\n function PlasmicLinkInternal(props: any, ref: React.Ref<any>) {\n // props.href is required for nextjs; if no props.href,\n // then we just render the default anchor element\n if (props.platform === \"nextjs\" && props.href) {\n const nextjsProps = [\n \"href\",\n \"replace\",\n \"scroll\",\n \"shallow\",\n \"passHref\",\n \"prefetch\",\n \"locale\",\n ];\n\n // If this is a fragment identifier link, then we set\n // scroll={false} so that smooth scrolling works\n const isFragment = props.href?.startsWith(\"#\");\n\n // Default to legacy behavior (nested <a> tag) unless legacyBehavior\n // is explicitly set to false. Older codegen may not set this prop at\n // all, so we treat undefined as legacy for backwards compatibility.\n // https://github.com/plasmicapp/plasmic-internal/pull/2203#issuecomment-3877931788\n if (props.legacyBehavior !== false) {\n return React.createElement(\n props.component,\n {\n scroll: !isFragment,\n legacyBehavior: true,\n ...pick(props, ...nextjsProps),\n },\n <a {...omit(props, ...INTERNAL_PROPS, ...nextjsProps)} ref={ref} />\n );\n }\n\n // pass props directly to Link (no nested <a>)\n return React.createElement(props.component, {\n scroll: !isFragment,\n ...omit(props, ...INTERNAL_PROPS),\n ref,\n });\n }\n\n if (props.platform === \"gatsby\" && isInternalHref(props.href)) {\n return React.createElement(props.component, {\n ...omit(props, ...INTERNAL_PROPS, \"href\"),\n ...{ to: props.href, ref },\n });\n }\n\n if (props.platform === \"tanstack\" && isInternalHref(props.href)) {\n return React.createElement(props.component, {\n ...omit(props, ...INTERNAL_PROPS, \"href\"),\n ...{ to: props.href, ref },\n });\n }\n\n return <a {...omit(props, ...INTERNAL_PROPS)} ref={ref} />;\n }\n);\n\nfunction isInternalHref(href: string): boolean {\n return /^\\/(?!\\/)/.test(href);\n}\n","import {\n PlasmicTranslatorContext as HostPlasmicTranslatorContext,\n PlasmicI18NContextValue,\n PlasmicTranslator,\n usePlasmicTranslator as useHostPlasmicTranslator,\n} from \"@plasmicapp/host\";\nimport React from \"react\";\n\n// Make the refactor to host backwards compatible for loader\nexport const PlasmicTranslatorContext =\n HostPlasmicTranslatorContext ??\n React.createContext<PlasmicI18NContextValue | PlasmicTranslator | undefined>(\n undefined\n );\n\nexport const usePlasmicTranslator =\n useHostPlasmicTranslator ??\n (() => {\n const _t = React.useContext(PlasmicTranslatorContext);\n const translator = _t\n ? typeof _t === \"function\"\n ? _t\n : _t.translator\n : undefined;\n return translator;\n });\n\nexport interface TransProps {\n transKey?: string;\n children?: React.ReactNode;\n}\n\nexport function genTranslatableString(\n elt: React.ReactNode,\n opts?: {\n tagPrefix?: string;\n }\n) {\n const components: {\n [key: string]: React.ReactElement;\n } = {};\n let componentsCount = 0;\n\n const getText = (node: React.ReactNode): string => {\n if (!node) {\n return \"\";\n }\n if (\n typeof node === \"number\" ||\n typeof node === \"boolean\" ||\n typeof node === \"string\"\n ) {\n return node.toString();\n }\n if (typeof node !== \"object\") {\n return \"\";\n }\n if (Array.isArray(node) || isIterable(node)) {\n return Array.from(node)\n .map((child) => getText(child))\n .filter((child) => !!child)\n .join(\"\");\n }\n const nodeChildren: React.ReactNode =\n (hasKey(node, \"props\") &&\n hasKey(node.props, \"children\") &&\n (node.props.children as React.ReactNode | undefined)) ||\n (hasKey(node, \"children\") && node.children) ||\n [];\n const contents = `${React.Children.toArray(nodeChildren)\n .map((child) => getText(child))\n .filter((child) => !!child)\n .join(\"\")}`;\n if (React.isValidElement(node) && node.type === React.Fragment) {\n return contents;\n }\n const prefix = opts?.tagPrefix ?? \"\";\n const componentId = `${prefix}${componentsCount + 1}`;\n componentsCount++;\n components[componentId] = React.isValidElement(node)\n ? React.cloneElement(node as any, {\n key: componentId,\n children: undefined,\n })\n : (node as never);\n return `<${componentId}>${contents}</${componentId}>`;\n };\n\n const str = getText(elt);\n return {\n str,\n components,\n componentsCount,\n };\n}\n\nexport function Trans({ transKey, children }: TransProps) {\n const _t = React.useContext(PlasmicTranslatorContext);\n const translator = _t\n ? typeof _t === \"function\"\n ? _t\n : _t.translator\n : undefined;\n if (!translator) {\n warnNoTranslationFunctionAtMostOnce();\n return children;\n }\n\n const { str, components, componentsCount } = genTranslatableString(children, {\n tagPrefix: typeof _t === \"object\" ? _t.tagPrefix : undefined,\n });\n return translator(\n transKey ?? str,\n componentsCount > 0 ? { components } : undefined\n );\n}\n\nlet hasWarned = false;\nfunction warnNoTranslationFunctionAtMostOnce() {\n if (!hasWarned) {\n console.warn(\n \"Using Plasmic Translation but no translation function has been provided\"\n );\n hasWarned = true;\n }\n}\n\nfunction hasKey<K extends string>(v: any, key: K): v is Record<K, any> {\n return typeof v === \"object\" && v !== null && key in v;\n}\n\nfunction isIterable(val: any): val is Iterable<any> {\n return val != null && typeof val[Symbol.iterator] === \"function\";\n}\n","import {\n PlasmicDataSourceContextProvider,\n PlasmicDataSourceContextValue,\n} from \"@plasmicapp/data-sources-context\";\nimport {\n DataProvider,\n PlasmicI18NContextValue,\n PlasmicLinkProvider,\n} from \"@plasmicapp/host\";\nimport { SSRProvider, useIsSSR as useAriaIsSSR } from \"@react-aria/ssr\";\nimport * as React from \"react\";\nimport { PlasmicHeadContext } from \"./PlasmicHead\";\nimport { PlasmicLinkInternal } from \"./PlasmicLink\";\nimport { PlasmicTranslatorContext } from \"./translation\";\nexport {\n PlasmicDataSourceContextProvider,\n useCurrentUser,\n} from \"@plasmicapp/data-sources-context\";\n// import { PlasmicLink } from \"./PlasmicLink\";\n\nexport interface PlasmicRootContextValue {\n platform?: \"nextjs\" | \"gatsby\";\n}\n\nconst PlasmicRootContext = React.createContext<\n PlasmicRootContextValue | undefined\n>(undefined);\n\nexport interface PlasmicRootProviderProps\n extends PlasmicDataSourceContextValue {\n platform?: \"nextjs\" | \"gatsby\";\n children?: React.ReactNode;\n i18n?: PlasmicI18NContextValue;\n Head?: React.ComponentType<any>;\n Link?: React.ComponentType<any>;\n disableLoadingBoundary?: boolean;\n suspenseFallback?: React.ReactNode;\n}\n\n/**\n * PlasmicRootProvider sets up the React context that Plasmic-generated components\n * rely on including data sources, i18n, Head, and Link.\n *\n * In Next.js app router, props passed from a Server to a Client Components must be serializable\n * but several PlasmicRootProvider props are not (e.g. `loader`, `Link` from `next/link`).\n * We recommend defining a Client Component wrapper (`ClientPlasmicRootProvider` in\n * `plasmic-init-client.tsx`) that imports non-serializable values and passes them to\n * PlasmicRootProvider (and only accepts serializable props from its caller).\n *\n * Loader example:\n *\n * ```tsx\n * // plasmic-init-client.tsx\n * \"use client\";\n * import { PlasmicRootProvider } from \"@plasmicapp/loader-nextjs\";\n * import { PLASMIC } from \"@/plasmic-init\";\n * export function ClientPlasmicRootProvider(\n * props: Omit<React.ComponentProps<typeof PlasmicRootProvider>, \"loader\">\n * ) {\n * return <PlasmicRootProvider loader={PLASMIC} {...props} />;\n * }\n * ```\n *\n * Codegen example:\n *\n * ```tsx\n * // plasmic-init-client.tsx\n * \"use client\";\n * import { PlasmicRootProvider } from \"@plasmicapp/react-web\";\n * import Link from \"next/link\";\n * export function ClientPlasmicRootProvider(\n * props: Omit<React.ComponentProps<typeof PlasmicRootProvider>, \"Link\">\n * ) {\n * return <PlasmicRootProvider Link={Link} {...props} />;\n * }\n * ```\n *\n * A Server Component can then render `ClientPlasmicRootProvider` and pass\n * serializable props such as prefetched data and children:\n *\n * ```tsx\n * import { PLASMIC } from \"@/plasmic-init\";\n * import { ClientPlasmicRootProvider } from \"@/plasmic-init-client\";\n * export default async function MyPage() {\n * const prefetchedData = await PLASMIC.fetchComponentData(\"YourPage\");\n * return (\n * <ClientPlasmicRootProvider prefetchedData={prefetchedData}>\n * {yourContent()}\n * </ClientPlasmicRootProvider>\n * );\n * }\n * ```\n *\n * See https://nextjs.org/docs/app/getting-started/server-and-client-components#passing-data-from-server-to-client-components\n * for more on the Server/Client Component boundary.\n */\nexport function PlasmicRootProvider(props: PlasmicRootProviderProps) {\n const {\n platform,\n children,\n userAuthToken,\n isUserLoading,\n authRedirectUri,\n user,\n disableLoadingBoundary,\n suspenseFallback,\n } = props;\n const context = React.useMemo(\n () => ({\n platform,\n }),\n [platform]\n );\n const dataSourceContextValue = React.useMemo(\n () => ({\n userAuthToken,\n user,\n isUserLoading,\n authRedirectUri,\n }),\n [userAuthToken, isUserLoading, user, authRedirectUri]\n );\n const reactMajorVersion = +React.version.split(\".\")[0];\n\n return (\n <MaybeWrap\n cond={!disableLoadingBoundary && reactMajorVersion >= 18}\n wrapper={(children_) => (\n <DataProvider\n name=\"plasmicInternalEnableLoadingBoundary\"\n hidden\n data={true}\n >\n <React.Suspense fallback={suspenseFallback ?? \"Loading...\"}>\n {children_}\n </React.Suspense>\n </DataProvider>\n )}\n >\n <PlasmicRootContext.Provider value={context}>\n <MaybeWrap\n cond={reactMajorVersion < 18}\n wrapper={(children_) => <SSRProvider>{children_}</SSRProvider>}\n >\n <PlasmicDataSourceContextProvider value={dataSourceContextValue}>\n <PlasmicTranslatorContext.Provider value={props.i18n}>\n <PlasmicHeadContext.Provider value={props.Head}>\n <SafePlasmicLinkProvider\n Link={props.Link ?? PlasmicLinkInternal}\n >\n {children}\n </SafePlasmicLinkProvider>\n </PlasmicHeadContext.Provider>\n </PlasmicTranslatorContext.Provider>\n </PlasmicDataSourceContextProvider>\n </MaybeWrap>\n </PlasmicRootContext.Provider>\n </MaybeWrap>\n );\n}\n\n/**\n * A PlasmicLinkProvider that anticipates PlasmicLinkProvider may not exist yet from\n * @plasmicapp/host if the user is using an older version\n */\nfunction SafePlasmicLinkProvider(\n props: React.ComponentProps<typeof PlasmicLinkProvider>\n) {\n if (PlasmicLinkProvider) {\n return <PlasmicLinkProvider {...props} />;\n } else {\n return <>{props.children}</>;\n }\n}\n\nexport const useIsSSR = useAriaIsSSR;\n\nexport function useHasPlasmicRoot() {\n return !!React.useContext(PlasmicRootContext);\n}\n\nlet hasWarnedSSR = false;\n/**\n * Warns the user if PlasmicRootProvider is not used\n */\nexport function useEnsureSSRProvider() {\n const hasRoot = useHasPlasmicRoot();\n if (hasRoot || hasWarnedSSR || process.env.NODE_ENV !== \"development\") {\n return;\n }\n\n hasWarnedSSR = true;\n console.warn(\n `Plasmic: To ensure your components work correctly with server-side rendering, please use PlasmicRootProvider at the root of your application. See https://docs.plasmic.app/learn/ssr`\n );\n}\n\nfunction MaybeWrap(props: {\n children: React.ReactElement;\n cond: boolean;\n wrapper: (children: React.ReactElement) => React.ReactElement;\n}) {\n return props.cond ? props.wrapper(props.children) : props.children;\n}\n"],"names":["React","HostPlasmicTranslatorContext","useHostPlasmicTranslator","useAriaIsSSR"],"mappings":";;;;;;;;AAIA;AACA,IAAM,cAAc,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,gBAAgB,CAAU,CAAC;AAErE,IAAM,WAAW,GAAGA,cAAK,CAAC,UAAU,CAAC,SAAS,WAAW,CAC9D,KAAU,EACV,GAAmB,EAAA;;;IAGnB,IAAM,IAAI,GAAG,CAAA,EAAA,GAAA,mBAAmB,KAAA,IAAA,IAAnB,mBAAmB,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAnB,mBAAmB,EAAI,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,mBAAmB,CAAC;AAC5D,IAAA,IAAI,IAAI,KAA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