@plasmicapp/react-web 0.2.227 → 0.2.229

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicapp/react-web",
3
- "version": "0.2.227",
3
+ "version": "0.2.229",
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",
@@ -75,7 +75,7 @@
75
75
  },
76
76
  "prettier": {},
77
77
  "dependencies": {
78
- "@plasmicapp/data-sources": "0.1.92",
78
+ "@plasmicapp/data-sources": "0.1.93",
79
79
  "@plasmicapp/data-sources-context": "0.1.11",
80
80
  "@plasmicapp/host": "1.0.149",
81
81
  "@plasmicapp/query": "0.1.67",
@@ -143,5 +143,5 @@
143
143
  "react": ">=16.8.0",
144
144
  "react-dom": ">=16.8.0"
145
145
  },
146
- "gitHead": "53fbc64e76b6edec87fc05403944e52c292d4d1c"
146
+ "gitHead": "7e4bd9f42a40784d0683c0cd706619771029d678"
147
147
  }
@@ -10,8 +10,8 @@ import { _ as __awaiter, a as __generator, b as __assign, c as __rest, d as __sp
10
10
  export { o as omit, p as pick } from './common-ed411407.js';
11
11
  export { PlasmicHead, plasmicHeadMeta } from './render/PlasmicHead/index.js';
12
12
  export { PlasmicImg } from './render/PlasmicImg/index.js';
13
- import { T as Trans } from './ssr-3ce4cefe.js';
14
- export { P as PlasmicLink, a as PlasmicRootProvider, T as Trans, g as genTranslatableString, u as useIsSSR } from './ssr-3ce4cefe.js';
13
+ import { T as Trans } from './ssr-b32a66e3.js';
14
+ export { P as PlasmicLink, a as PlasmicRootProvider, T as Trans, g as genTranslatableString, u as useIsSSR } from './ssr-b32a66e3.js';
15
15
  import ReactDOM__default from 'react-dom';
16
16
  import { useFocusRing } from '@react-aria/focus';
17
17
  import { proxy, ref, useSnapshot, getVersion, subscribe } from 'valtio';
@@ -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-5ff031c2.js';
7
- import { b as useEnsureSSRProvider } from '../../ssr-3ce4cefe.js';
7
+ import { b as useEnsureSSRProvider } from '../../ssr-b32a66e3.js';
8
8
  import { m as mergeVariantToggles } from '../../plume-utils-e699cd08.js';
9
9
  import { g as getStyleProps } from '../../props-utils-9d74371f.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-5ff031c2.js';
6
- import { b as useEnsureSSRProvider } from '../../ssr-3ce4cefe.js';
6
+ import { b as useEnsureSSRProvider } from '../../ssr-b32a66e3.js';
7
7
  import { r as renderCollectionNode, u as useDerivedItemsFromChildren, a as renderAsCollectionChild } from '../../collection-utils-2f28e4eb.js';
8
8
  import { n as noOutline, m as mergeVariantToggles } from '../../plume-utils-e699cd08.js';
9
9
  import { g as getStyleProps } from '../../props-utils-9d74371f.js';
@@ -7,7 +7,7 @@ import { useMenuTrigger as useMenuTrigger$1 } from '@react-aria/menu';
7
7
  import { usePress } from '@react-aria/interactions';
8
8
  import { g as getPlumeType, m as mergeVariantToggles } from '../../plume-utils-e699cd08.js';
9
9
  import { useFocusable } from '@react-aria/focus';
10
- import { b as useEnsureSSRProvider } from '../../ssr-3ce4cefe.js';
10
+ import { b as useEnsureSSRProvider } from '../../ssr-b32a66e3.js';
11
11
  import { g as getStyleProps } from '../../props-utils-9d74371f.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-5ff031c2.js';
9
- import { b as useEnsureSSRProvider } from '../../ssr-3ce4cefe.js';
9
+ import { b as useEnsureSSRProvider } from '../../ssr-b32a66e3.js';
10
10
  import { g as getChildProp, r as renderCollectionNode, b as useDerivedItems, a as renderAsCollectionChild } from '../../collection-utils-2f28e4eb.js';
11
11
  import { m as mergeVariantToggles, n as noOutline } from '../../plume-utils-e699cd08.js';
12
12
  import { g as getStyleProps } from '../../props-utils-9d74371f.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-5ff031c2.js';
7
- import { b as useEnsureSSRProvider } from '../../ssr-3ce4cefe.js';
7
+ import { b as useEnsureSSRProvider } from '../../ssr-b32a66e3.js';
8
8
  import { m as mergeVariantToggles } from '../../plume-utils-e699cd08.js';
9
9
  import { g as getStyleProps } from '../../props-utils-9d74371f.js';
10
10
  import 'classnames';
@@ -1,21 +1,22 @@
1
+ import { b as __assign, o as omit, p as pick, d as __spreadArray, e as __read } from './common-ed411407.js';
1
2
  import { PlasmicDataSourceContextProvider } from '@plasmicapp/data-sources-context';
2
3
  import { SSRProvider, useIsSSR as useIsSSR$1 } from '@react-aria/ssr';
3
4
  import * as React from 'react';
4
5
  import React__default from 'react';
5
6
  import { PlasmicHeadContext } from './render/PlasmicHead/index.js';
6
7
  import { usePlasmicLinkMaybe, DataProvider, PlasmicLinkProvider } from '@plasmicapp/host';
7
- import { b as __assign, p as pick, d as __spreadArray, e as __read, o as omit } from './common-ed411407.js';
8
8
 
9
9
  var PlasmicLink = React__default.forwardRef(function PlasmicLink(props, ref) {
10
10
  var _a;
11
11
  // The usePlasmicLinkMaybe function may be undefined, if host is not up-to-date
12
12
  var Link = (_a = usePlasmicLinkMaybe === null || usePlasmicLinkMaybe === void 0 ? void 0 : usePlasmicLinkMaybe()) !== null && _a !== void 0 ? _a : PlasmicLinkInternal;
13
- if (Link === PlasmicLink) {
13
+ if (Link === PlasmicLink || Link === PlasmicLinkInternal) {
14
14
  // Just in case, break the cycle
15
15
  return React__default.createElement(PlasmicLinkInternal, __assign({}, props, { ref: ref }));
16
16
  }
17
17
  else {
18
- return React__default.createElement(Link, __assign({}, props, { ref: ref }));
18
+ // Don't pass component/platform props to non-PlasmicLinkInternal
19
+ return React__default.createElement(Link, __assign({}, omit(props, "component", "platform"), { ref: ref }));
19
20
  }
20
21
  });
21
22
  var PlasmicLinkInternal = React__default.forwardRef(function PlasmicLinkInternal(props, ref) {
@@ -147,7 +148,19 @@ function PlasmicRootProvider(props) {
147
148
  React.createElement(PlasmicDataSourceContextProvider, { value: dataSourceContextValue },
148
149
  React.createElement(PlasmicTranslatorContext.Provider, { value: (_a = props.i18n) !== null && _a !== void 0 ? _a : props.translator },
149
150
  React.createElement(PlasmicHeadContext.Provider, { value: props.Head },
150
- React.createElement(PlasmicLinkProvider, { Link: (_b = props.Link) !== null && _b !== void 0 ? _b : PlasmicLinkInternal }, children))))))));
151
+ React.createElement(SafePlasmicLinkProvider, { Link: (_b = props.Link) !== null && _b !== void 0 ? _b : PlasmicLinkInternal }, children))))))));
152
+ }
153
+ /**
154
+ * A PlasmicLinkProvider that anticipates PlasmicLinkProvider may not exist yet from
155
+ * @plasmicapp/host if the user is using an older version
156
+ */
157
+ function SafePlasmicLinkProvider(props) {
158
+ if (PlasmicLinkProvider) {
159
+ return React.createElement(PlasmicLinkProvider, __assign({}, props));
160
+ }
161
+ else {
162
+ return React.createElement(React.Fragment, null, props.children);
163
+ }
151
164
  }
152
165
  var useIsSSR = useIsSSR$1;
153
166
  function useHasPlasmicRoot() {
@@ -170,4 +183,4 @@ function MaybeWrap(props) {
170
183
  }
171
184
 
172
185
  export { PlasmicLink as P, Trans as T, PlasmicRootProvider as a, useEnsureSSRProvider as b, genTranslatableString as g, useIsSSR as u };
173
- //# sourceMappingURL=ssr-3ce4cefe.js.map
186
+ //# sourceMappingURL=ssr-b32a66e3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssr-b32a66e3.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\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 component/platform props to non-PlasmicLinkInternal\n return <Link {...omit(props, \"component\", \"platform\")} 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 return React.createElement(\n props.component,\n { ...pick(props, ...nextjsProps), legacyBehavior: true },\n <a\n {...omit(props, \"component\", \"platform\", ...nextjsProps)}\n ref={ref}\n />\n );\n }\n\n if (props.platform === \"gatsby\" && isInternalHref(props.href)) {\n return React.createElement(props.component, {\n ...omit(props, \"component\", \"platform\", \"href\"),\n ...{ to: props.href, ref },\n });\n }\n\n return <a {...omit(props, \"component\", \"platform\")} ref={ref} />;\n }\n);\n\nfunction isInternalHref(href: string): boolean {\n return /^\\/(?!\\/)/.test(href);\n}\n","import React from \"react\";\n\nexport type PlasmicTranslator = (\n str: string,\n opts?: {\n components?: {\n [key: string]: React.ReactElement;\n };\n }\n) => React.ReactNode;\n\nexport interface PlasmicI18NContextValue {\n translator?: PlasmicTranslator;\n tagPrefix?: string;\n}\n\nexport const PlasmicTranslatorContext = React.createContext<\n PlasmicI18NContextValue | PlasmicTranslator | undefined\n>(undefined);\n\nexport interface TransProps {\n transKey?: string;\n children?: React.ReactNode;\n}\n\nfunction isIterable(val: any): val is Iterable<any> {\n return val != null && typeof val[Symbol.iterator] === \"function\";\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","import {\n PlasmicDataSourceContextProvider,\n PlasmicDataSourceContextValue,\n} from \"@plasmicapp/data-sources-context\";\nimport { SSRProvider, useIsSSR as useAriaIsSSR } from \"@react-aria/ssr\";\nimport * as React from \"react\";\nimport { PlasmicHeadContext } from \"./PlasmicHead\";\nimport {\n PlasmicI18NContextValue,\n PlasmicTranslator,\n PlasmicTranslatorContext,\n} from \"./translation\";\nexport {\n PlasmicDataSourceContextProvider,\n useCurrentUser,\n} from \"@plasmicapp/data-sources-context\";\nimport { DataProvider, PlasmicLinkProvider } from \"@plasmicapp/host\";\nimport { PlasmicLinkInternal } from \"./PlasmicLink\";\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 /**\n * @deprecated use i18n.translator instead\n */\n translator?: PlasmicTranslator;\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 <SSRProvider>\n <PlasmicDataSourceContextProvider value={dataSourceContextValue}>\n <PlasmicTranslatorContext.Provider\n value={props.i18n ?? props.translator}\n >\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 </SSRProvider>\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","useAriaIsSSR"],"mappings":";;;;;;;;IAIa,WAAW,GAAGA,cAAK,CAAC,UAAU,CAAC,SAAS,WAAW,CAC9D,KAAU,EACV,GAAmB;;;IAGnB,IAAM,IAAI,GAAG,MAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,EAAI,mCAAI,mBAAmB,CAAC;IAC5D,IAAI,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,mBAAmB,EAAE;;QAExD,OAAOA,6BAAC,mBAAmB,eAAK,KAAK,IAAE,GAAG,EAAE,GAAG,IAAI,CAAC;KACrD;SAAM;;QAEL,OAAOA,6BAAC,IAAI,eAAK,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,IAAE,GAAG,EAAE,GAAG,IAAI,CAAC;KACrE;AACH,CAAC,EAAE;AAEI,IAAM,mBAAmB,GAAGA,cAAK,CAAC,UAAU,CACjD,SAAS,mBAAmB,CAAC,KAAU,EAAE,GAAmB;;;IAG1D,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE;QAC7C,IAAM,WAAW,GAAG;YAClB,MAAM;YACN,SAAS;YACT,QAAQ;YACR,SAAS;YACT,UAAU;YACV,UAAU;YACV,QAAQ;SACT,CAAC;QAEF,OAAOA,cAAK,CAAC,aAAa,CACxB,KAAK,CAAC,SAAS,wBACV,IAAI,8BAAC,KAAK,UAAK,WAAW,eAAG,cAAc,EAAE,IAAI,KACtDA,+CACM,IAAI,8BAAC,KAAK,EAAE,WAAW,EAAE,UAAU,UAAK,WAAW,cACvD,GAAG,EAAE,GAAG,IACR,CACH,CAAC;KACH;IAED,IAAI,KAAK,CAAC,QAAQ,K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ources":["../../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\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) {\n // Just in case, break the cycle\n return <PlasmicLinkInternal {...props} ref={ref} />;\n } else {\n return <Link {...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 return React.createElement(\n props.component,\n { ...pick(props, ...nextjsProps), legacyBehavior: true },\n <a\n {...omit(props, \"component\", \"platform\", ...nextjsProps)}\n ref={ref}\n />\n );\n }\n\n if (props.platform === \"gatsby\" && isInternalHref(props.href)) {\n return React.createElement(props.component, {\n ...omit(props, \"component\", \"platform\", \"href\"),\n ...{ to: props.href, ref },\n });\n }\n\n return <a {...omit(props, \"component\", \"platform\")} ref={ref} />;\n }\n);\n\nfunction isInternalHref(href: string): boolean {\n return /^\\/(?!\\/)/.test(href);\n}\n","import React from \"react\";\n\nexport type PlasmicTranslator = (\n str: string,\n opts?: {\n components?: {\n [key: string]: React.ReactElement;\n };\n }\n) => React.ReactNode;\n\nexport interface PlasmicI18NContextValue {\n translator?: PlasmicTranslator;\n tagPrefix?: string;\n}\n\nexport const PlasmicTranslatorContext = React.createContext<\n PlasmicI18NContextValue | PlasmicTranslator | undefined\n>(undefined);\n\nexport interface TransProps {\n transKey?: string;\n children?: React.ReactNode;\n}\n\nfunction isIterable(val: any): val is Iterable<any> {\n return val != null && typeof val[Symbol.iterator] === \"function\";\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","import {\n PlasmicDataSourceContextProvider,\n PlasmicDataSourceContextValue,\n} from \"@plasmicapp/data-sources-context\";\nimport { SSRProvider, useIsSSR as useAriaIsSSR } from \"@react-aria/ssr\";\nimport * as React from \"react\";\nimport { PlasmicHeadContext } from \"./PlasmicHead\";\nimport {\n PlasmicI18NContextValue,\n PlasmicTranslator,\n PlasmicTranslatorContext,\n} from \"./translation\";\nexport {\n PlasmicDataSourceContextProvider,\n useCurrentUser,\n} from \"@plasmicapp/data-sources-context\";\nimport { DataProvider, PlasmicLinkProvider } from \"@plasmicapp/host\";\nimport { PlasmicLinkInternal } from \"./PlasmicLink\";\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 /**\n * @deprecated use i18n.translator instead\n */\n translator?: PlasmicTranslator;\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 <SSRProvider>\n <PlasmicDataSourceContextProvider value={dataSourceContextValue}>\n <PlasmicTranslatorContext.Provider\n value={props.i18n ?? props.translator}\n >\n <PlasmicHeadContext.Provider value={props.Head}>\n <PlasmicLinkProvider Link={props.Link ?? PlasmicLinkInternal}>\n {children}\n </PlasmicLinkProvider>\n </PlasmicHeadContext.Provider>\n </PlasmicTranslatorContext.Provider>\n </PlasmicDataSourceContextProvider>\n </SSRProvider>\n </PlasmicRootContext.Provider>\n </MaybeWrap>\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","useAriaIsSSR"],"mappings":";;;;;;;;IAIa,WAAW,GAAGA,cAAK,CAAC,UAAU,CAAC,SAAS,WAAW,CAC9D,KAAU,EACV,GAAmB;;;IAGnB,IAAM,IAAI,GAAG,MAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBA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