@plasmicpkgs/plasmic-basic-components 0.0.233 → 0.0.235
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/ConditionGuard.d.ts +1 -1
- package/dist/Embed.d.ts +1 -1
- package/dist/Embed.stories.d.ts +17 -0
- package/dist/Iframe.d.ts +1 -1
- package/dist/LoadingBoundary.d.ts +1 -1
- package/dist/Repeater.d.ts +2 -2
- package/dist/ScrollRevealer.d.ts +1 -1
- package/dist/SideEffect.d.ts +1 -1
- package/dist/Timer.d.ts +1 -1
- package/dist/Video.d.ts +1 -2
- package/dist/index.d.ts +0 -9
- package/dist/plasmic-basic-components.cjs.development.js +71 -64
- package/dist/plasmic-basic-components.cjs.development.js.map +1 -1
- package/dist/plasmic-basic-components.cjs.production.min.js +1 -1
- package/dist/plasmic-basic-components.cjs.production.min.js.map +1 -1
- package/dist/plasmic-basic-components.esm.js +71 -64
- package/dist/plasmic-basic-components.esm.js.map +1 -1
- package/package.json +9 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plasmic-basic-components.cjs.production.min.js","sources":["../src/ConditionGuard.tsx","../src/Data.tsx","../src/common.ts","../src/Embed.tsx","../src/Iframe.tsx","../src/LoadingBoundary.tsx","../src/Repeater.tsx","../src/ScrollRevealer.tsx","../src/SideEffect.tsx","../src/Timer.tsx","../src/Video.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport interface ConditionGuardProps {\n condition: boolean;\n onNotSatisfied?: () => Promise<void>;\n children: React.ReactNode;\n skipPaths?: Array<{ path: string }>;\n}\n\nfunction ConditionGuardOnNotSatisfied({\n onNotSatisfied,\n}: Pick<ConditionGuardProps, \"onNotSatisfied\">) {\n const ref = React.useRef(false);\n React.useEffect(() => {\n if (!ref.current) {\n ref.current = true;\n onNotSatisfied?.();\n }\n }, [onNotSatisfied]);\n return null;\n}\n\nfunction isCurrentLocationInSkipPaths(skipPaths?: Array<{ path: string }>) {\n const pathname = window.location.pathname;\n // Ignore search params\n const currentPath = window.location.origin + pathname;\n const plasmicPathname = (globalThis as any)?.[\"__PLASMIC_STUDIO_PATH\"]?.();\n return skipPaths?.some(\n ({ path }) =>\n path === pathname || path === currentPath || path === plasmicPathname\n );\n}\n\nexport default function ConditionGuard({\n condition,\n onNotSatisfied,\n children,\n skipPaths,\n}: ConditionGuardProps) {\n if (!condition && !isCurrentLocationInSkipPaths(skipPaths)) {\n return <ConditionGuardOnNotSatisfied onNotSatisfied={onNotSatisfied} />;\n }\n\n return <>{children}</>;\n}\n\nexport const conditionGuardMeta: ComponentMeta<ConditionGuardProps> = {\n name: \"hostless-condition-guard\",\n displayName: \"Condition Guard\",\n description: \"Ensure some condition, or else run an interaction. Examples: ensure all users have a database row, or require new users to setup a profile.\",\n importName: \"ConditionGuard\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n children: \"slot\",\n condition: {\n type: \"boolean\",\n displayName: \"Condition\",\n description: \"The condition to guard against\",\n helpText: \"Condition to check. Render contents only if true. Run interaction if false.\",\n defaultValue: true,\n },\n onNotSatisfied: {\n type: \"eventHandler\",\n displayName: \"On condition false\",\n description: \"The action to run when the condition is not satisfied\",\n argTypes: [],\n },\n skipPaths: {\n type: \"array\",\n displayName: \"Skip Paths\",\n description: \"Paths that the action should not run\",\n itemType: {\n type: \"object\",\n fields: {\n path: \"href\",\n },\n nameFunc: (item: any) => item?.path,\n },\n },\n },\n};\n\nexport function registerConditionGuard(\n loader?: { registerComponent: typeof registerComponent },\n customConditionGuardMeta?: ComponentMeta<ConditionGuardProps>\n) {\n if (loader) {\n loader.registerComponent(\n ConditionGuard,\n customConditionGuardMeta ?? conditionGuardMeta\n );\n } else {\n registerComponent(\n ConditionGuard,\n customConditionGuardMeta ?? conditionGuardMeta\n );\n }\n}\n","import {\n applySelector as _applySelector,\n ComponentMeta,\n DataProvider as _DataProvider,\n DataProviderProps,\n repeatedElement,\n SelectorDict,\n useDataEnv as _useDataEnv,\n useSelector as _useSelector,\n useSelectors as _useSelectors,\n} from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { ComponentProps, createElement, ReactNode } from \"react\";\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components\";\n\n/**\n * @deprecated This should be imported from @plasmicapp/host instead.\n */\nexport const applySelector: typeof _applySelector = function (...args) {\n console.warn(\n \"DEPRECATED: Import applySelector from @plasmicapp/host instead.\"\n );\n return _applySelector(...args);\n};\n\n/**\n * @deprecated This should be imported from @plasmicapp/host instead.\n */\nexport const useSelector: typeof _useSelector = function (...args) {\n console.warn(\"DEPRECATED: Import useSelector from @plasmicapp/host instead.\");\n return _useSelector(...args);\n};\n\n/**\n * @deprecated This should be imported from @plasmicapp/host instead.\n */\nexport const useSelectors: typeof _useSelectors = function (...args) {\n console.warn(\n \"DEPRECATED: Import useSelectors from @plasmicapp/host instead.\"\n );\n return _useSelectors(...args);\n};\n\n/**\n * @deprecated This should be imported from @plasmicapp/host instead.\n */\nexport const useDataEnv: typeof _useDataEnv = function (...args) {\n console.warn(\"DEPRECATED: Import useDataEnv from @plasmicapp/host instead.\");\n return _useDataEnv(...args);\n};\n\nexport const DataProvider: typeof _DataProvider = function (...args) {\n return _DataProvider(...args);\n};\n\nexport interface CommonDynamicProps {\n className?: string;\n tag?: string;\n propSelectors?: SelectorDict;\n}\n\nexport function DynamicElement<\n Tag extends keyof JSX.IntrinsicElements = \"div\"\n>({\n tag = \"div\",\n className,\n children,\n propSelectors,\n ...props\n}: CommonDynamicProps & ComponentProps<Tag>) {\n const computed = _useSelectors(propSelectors);\n return createElement(tag, {\n children,\n ...props,\n ...computed,\n className: className + \" \" + computed.className,\n });\n}\n\nexport interface DynamicTextProps extends CommonDynamicProps {\n selector?: string;\n}\n\nexport function DynamicText({\n selector,\n propSelectors,\n ...props\n}: DynamicTextProps) {\n return (\n <DynamicElement\n {...props}\n propSelectors={{ ...propSelectors, children: selector }}\n >\n {/*This is the default text*/}\n (DynamicText requires a selector)\n </DynamicElement>\n );\n}\n\nexport interface DynamicImageProps\n extends CommonDynamicProps,\n ComponentProps<\"img\"> {\n selector?: string;\n}\n\nexport function DynamicImage({\n selector,\n propSelectors,\n ...props\n}: DynamicImageProps) {\n return (\n <DynamicElement<\"img\">\n tag={\"img\"}\n loading={\"lazy\"}\n style={{\n objectFit: \"cover\",\n }}\n {...props}\n propSelectors={{ ...propSelectors, src: selector }}\n // Default image placeholder\n src=\"https://studio.plasmic.app/static/img/placeholder.png\"\n />\n );\n}\n\nexport interface DynamicRepeaterProps {\n children?: ReactNode;\n loopItemName?: string;\n keySelector?: string;\n selector?: string;\n data?: any;\n}\n\nexport function DynamicRepeater({\n children,\n loopItemName,\n keySelector,\n selector,\n data,\n}: DynamicRepeaterProps) {\n // Defaults to an array of three items.\n const finalData = data ?? _useSelector(selector) ?? [1, 2, 3];\n return (\n <>\n {finalData?.map?.((item: any, index: number) => (\n <_DataProvider\n key={_applySelector(item, keySelector) ?? index}\n name={loopItemName}\n data={item}\n >\n {repeatedElement(index, children)}\n </_DataProvider>\n ))}\n </>\n );\n}\n\nexport const dynamicRepeaterProps = {\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField\",\n },\n loopItemName: {\n type: \"string\",\n defaultValue: \"item\",\n description:\n \"The name of the variable to use to store the current item in the loop\",\n },\n children: {\n type: \"slot\",\n isRepeated: true,\n },\n} as const;\n\nexport const dynamicRepeaterMeta: ComponentMeta<DynamicRepeaterProps> = {\n name: \"hostless-dynamic-repeater\",\n displayName: \"Dynamic Repeater\",\n importName: \"DynamicRepeater\",\n importPath: thisModule,\n props: dynamicRepeaterProps,\n};\n\nexport function registerDynamicRepeater(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicRepeaterMeta?: ComponentMeta<DynamicRepeaterProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicRepeater,\n customDynamicRepeaterMeta ?? dynamicRepeaterMeta\n );\n } else {\n registerComponent(\n DynamicRepeater,\n customDynamicRepeaterMeta ?? dynamicRepeaterMeta\n );\n }\n}\n\nexport const dataProviderMeta: ComponentMeta<DataProviderProps> = {\n name: \"hostless-data-provider\",\n displayName: \"Data Provider\",\n importName: \"DataProvider\",\n importPath: thisModule,\n providesData: true,\n // description: \"Makes some specified data available to the subtree in a context\",\n props: {\n name: {\n type: \"string\",\n defaultValue: \"celebrities\",\n description: \"The name of the variable to store the data in\",\n },\n data: {\n type: \"object\",\n defaultValue: [\n {\n name: \"Fill Murray\",\n birthYear: 1950,\n profilePicture: [\"https://www.fillmurray.com/200/300\"],\n },\n {\n name: \"Place Cage\",\n birthYear: 1950,\n profilePicture: [\"https://www.placecage.com/200/300\"],\n },\n ],\n },\n children: {\n type: \"slot\",\n },\n },\n};\n\nexport function registerDataProvider(\n loader?: { registerComponent: typeof registerComponent },\n customDataProviderMeta?: ComponentMeta<DataProviderProps>\n) {\n if (loader) {\n loader.registerComponent(\n _DataProvider,\n customDataProviderMeta ?? dataProviderMeta\n );\n } else {\n registerComponent(\n _DataProvider,\n customDataProviderMeta ?? dataProviderMeta\n );\n }\n}\n\nconst dynamicPropsWithoutTag = {\n propSelectors: {\n type: \"object\",\n defaultValueHint: {},\n description:\n \"An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value.\",\n },\n} as const;\n\nconst dynamicProps = {\n ...dynamicPropsWithoutTag,\n tag: {\n type: \"string\",\n defaultValueHint: \"div\",\n description: \"The HTML tag to use\",\n },\n} as const;\n\n// TODO Eventually we'll want to expose all the base HTML properties, but in the nicer way that we do within the studio.\n\nexport const dynamicElementMeta: ComponentMeta<CommonDynamicProps> = {\n name: \"hostless-dynamic-element\",\n displayName: \"Dynamic Element\",\n importName: \"DynamicElement\",\n importPath: thisModule,\n props: { ...dynamicProps, children: \"slot\" },\n};\n\nexport function registerDynamicElement(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicElementMeta?: ComponentMeta<CommonDynamicProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicElement,\n customDynamicElementMeta ?? dynamicElementMeta\n );\n } else {\n registerComponent(\n DynamicElement,\n customDynamicElementMeta ?? dynamicElementMeta\n );\n }\n}\n\nexport const dynamicTextMeta: ComponentMeta<DynamicTextProps> = {\n name: \"hostless-dynamic-text\",\n importName: \"DynamicText\",\n displayName: \"Dynamic Text\",\n importPath: thisModule,\n props: {\n ...dynamicProps,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the text, such as: someVariable.0.someField\",\n },\n },\n};\n\nexport function registerDynamicText(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicTextMeta?: ComponentMeta<DynamicTextProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicText,\n customDynamicTextMeta ?? dynamicTextMeta\n );\n } else {\n registerComponent(DynamicText, customDynamicTextMeta ?? dynamicTextMeta);\n }\n}\n\nexport const dynamicImageMeta: ComponentMeta<DynamicImageProps> = {\n name: \"hostless-dynamic-image\",\n displayName: \"Dynamic Image\",\n importName: \"DynamicImage\",\n importPath: thisModule,\n props: {\n ...dynamicPropsWithoutTag,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the image source URL, such as: someVariable.0.someField\",\n },\n },\n};\n\nexport function registerDynamicImage(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicImageMeta?: ComponentMeta<DynamicImageProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicImage,\n customDynamicImageMeta ?? dynamicImageMeta\n );\n } else {\n registerComponent(DynamicImage, customDynamicImageMeta ?? dynamicImageMeta);\n }\n}\n","import React from \"react\";\n\nexport const tuple = <T extends any[]>(...args: T): T => args;\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nexport const isBrowser = typeof window !== \"undefined\";\n\nexport const useIsomorphicLayoutEffect = isBrowser\n ? React.useLayoutEffect\n : React.useEffect;\n\nexport function useFirstRender() {\n const ref = React.useRef(true);\n const firstRender = ref.current;\n ref.current = false;\n return firstRender;\n}\n\n// Fix for React.useId type since it's only available for React 18+\nexport const useId: (() => string) | undefined = React.useId;\n","import { usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useRef } from \"react\";\nimport { ensure, useFirstRender, useId } from \"./common\";\n\nexport interface EmbedProps {\n className?: string;\n code: string;\n hideInEditor?: boolean;\n}\n\n/**\n * A common use case for embedding HTML snippets is loading/running script tags, so most of the logic here is for\n * handling that.\n *\n * You can't just write innerHTML with some <script> tags in there. You need to explicitly add each one via the DOM API.\n *\n * You also can't just add the script tags and expect them to run sequentially, and sometimes there are multiple scripts\n * with dependencies on each other. You have to explicitly wait for earlier ones to finish loading.\n *\n * One last complication is that Next.js can run the effect multiple times in development mode. There's nothing actually\n * that we can/should do about that, but just something to be aware of if you are here debugging issues.\n */\nexport default function Embed({\n className,\n code,\n hideInEditor = false,\n}: EmbedProps) {\n const rootElt = useRef<HTMLDivElement>(null);\n const inEditor = usePlasmicCanvasContext();\n const htmlId = useId?.();\n const firstRender = useFirstRender();\n useEffect(() => {\n if (hideInEditor && inEditor) {\n return;\n }\n // If it's the first render and we already set the global id for this component, it means that\n // the HTML is already present in the DOM from the server-rendered HTML. We don't want to re-run.\n // If it's not the first render, then it can mean that some dependency changed.\n if (\n htmlId &&\n !inEditor &&\n firstRender &&\n (window as any)[makePlasmicVarName(htmlId)]\n ) {\n return;\n }\n // Load scripts sequentially one at a time, since later scripts can depend on earlier ones.\n (async () => {\n for (const oldScript of Array.from(\n ensure(rootElt.current).querySelectorAll(\"script\")\n )) {\n const newScript = document.createElement(\"script\");\n // This doesn't actually have the effect we want, we need to explicitly wait on the load event, since all\n // dynamically injected scripts are always async.\n newScript.async = false;\n Array.from(oldScript.attributes).forEach((attr) =>\n newScript.setAttribute(attr.name, attr.value)\n );\n newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n ensure(oldScript.parentNode).replaceChild(newScript, oldScript);\n // Only scripts with src will ever fire a load event.\n if (newScript.src) {\n await new Promise((resolve) =>\n newScript.addEventListener(\"load\", resolve)\n );\n }\n }\n })();\n }, [htmlId, firstRender, code, hideInEditor, inEditor]);\n const effectiveCode =\n hideInEditor && inEditor\n ? \"\"\n : inEditor || !htmlId\n ? code\n : addIdentifierScript(htmlId, code);\n return (\n <div\n ref={rootElt}\n className={className}\n dangerouslySetInnerHTML={{ __html: effectiveCode }}\n style={{ whiteSpace: \"normal\" }}\n />\n );\n}\n\nfunction makePlasmicVarName(id: string) {\n return `__plasmic_${id.replace(/[^a-z0-9]/gi, \"\")}`;\n}\n\nfunction addIdentifierScript(id: string, code: string) {\n return `<script>\n var ${makePlasmicVarName(id)} = 1;\n </script>\n ${code}`;\n}\n\nexport const embedMeta: ComponentMeta<EmbedProps> = {\n name: \"hostless-embed\",\n displayName: \"Embed HTML\",\n importName: \"Embed\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n code: {\n type: \"code\",\n lang: \"html\",\n defaultValue: \"<div>Paste your embed code via the right sidebar</div>\",\n description: \"The HTML code to be embedded\",\n },\n hideInEditor: {\n type: \"boolean\",\n displayName: \"Hide in editor\",\n description:\n \"Disable running the code while editing in Plasmic Studio (may require reload)\",\n editOnly: true,\n },\n },\n defaultStyles: {\n maxWidth: \"100%\",\n },\n};\n\nexport function registerEmbed(\n loader?: { registerComponent: typeof registerComponent },\n customEmbedMeta?: ComponentMeta<EmbedProps>\n) {\n if (loader) {\n loader.registerComponent(Embed, customEmbedMeta ?? embedMeta);\n } else {\n registerComponent(Embed, customEmbedMeta ?? embedMeta);\n }\n}\n","import { ComponentMeta, PlasmicCanvasContext } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { useContext } from \"react\";\n\nexport interface IframeProps {\n src: string;\n preview?: boolean;\n className?: string;\n onLoad?: React.ComponentProps<\"iframe\">[\"onLoad\"];\n}\n\nexport default function Iframe({\n preview,\n src,\n className,\n onLoad,\n}: IframeProps) {\n const isEditing = useContext(PlasmicCanvasContext);\n if (isEditing && !preview) {\n return (\n <div className={className}>\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n background: \"#eee\",\n color: \"#888\",\n fontSize: \"36px\",\n fontFamily: \"sans-serif\",\n fontWeight: \"bold\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n }}\n >\n Iframe placeholder\n </div>\n </div>\n );\n }\n return <iframe src={src} className={className} onLoad={onLoad} />;\n}\n\nexport const iframeMeta: ComponentMeta<IframeProps> = {\n name: \"hostless-iframe\",\n displayName: \"Iframe\",\n importName: \"Iframe\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n src: {\n type: \"string\",\n defaultValue: \"https://www.example.com\",\n },\n preview: {\n type: \"boolean\",\n description: \"Load the iframe while editing in Plasmic Studio\",\n },\n onLoad: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n },\n defaultStyles: {\n width: \"300px\",\n height: \"150px\",\n maxWidth: \"100%\",\n },\n};\n\nexport function registerIframe(\n loader?: { registerComponent: typeof registerComponent },\n customIframeMeta?: ComponentMeta<IframeProps>\n) {\n if (loader) {\n loader.registerComponent(Iframe, customIframeMeta ?? iframeMeta);\n } else {\n registerComponent(Iframe, customIframeMeta ?? iframeMeta);\n }\n}\n","import { DataProvider, useDataEnv } from \"@plasmicapp/host\";\nimport registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport * as plasmicQuery from \"@plasmicapp/query\";\nimport React, { Suspense, useState } from \"react\";\nimport { useIsomorphicLayoutEffect } from \"./common\";\n\ninterface LoadingBoundaryProps {\n loadingState?: React.ReactNode;\n children?: React.ReactNode;\n forceLoading?: boolean;\n}\n\nconst reactMajorVersion = +React.version.split(\".\")[0];\n\nif (reactMajorVersion < 18) {\n console.warn(\"The LoadingBoundary component only works with React 18+\");\n}\n\nconst enableLoadingBoundaryKey = \"plasmicInternalEnableLoadingBoundary\";\nconst hasLoadingBoundaryKey = \"plasmicInternalHasLoadingBoundary\";\n\nfunction useIsClient() {\n const [loaded, setLoaded] = useState(false);\n useIsomorphicLayoutEffect(() => {\n setLoaded(true);\n }, []);\n return loaded;\n}\n\nlet hasWarnedDisabledLoadingBoundary = false;\n\nfunction warnDisabledLoadingBoundary() {\n if (!hasWarnedDisabledLoadingBoundary) {\n hasWarnedDisabledLoadingBoundary = true;\n console.warn(\n `LoadingBoundary feature is not enabled. To use the LoadingBoundary component make sure to upgrade your @plasmicapp/* dependencies to the latest version and to wrap you App inside <PlasmicRootProvider />`\n );\n }\n}\n\nexport default function LoadingBoundary({\n children,\n forceLoading,\n loadingState,\n}: LoadingBoundaryProps) {\n const isClient = useIsClient();\n const enableLoadingBoundary = !!useDataEnv()?.[enableLoadingBoundaryKey];\n\n if (!isClient && !plasmicQuery.isPlasmicPrepass?.()) {\n return null;\n }\n\n if (forceLoading) {\n return <>{loadingState ?? null}</>;\n }\n\n if (reactMajorVersion < 18) {\n return <>{children ?? null}</>;\n }\n\n if (!enableLoadingBoundary) {\n warnDisabledLoadingBoundary();\n return <>{children ?? null}</>;\n }\n\n return (\n <Suspense fallback={<>{loadingState ?? null}</>}>\n <DataProvider hidden name={hasLoadingBoundaryKey} data={true}>\n {children ?? null}\n </DataProvider>\n </Suspense>\n );\n}\n\nexport const loadingBoundaryMeta: ComponentMeta<LoadingBoundaryProps> = {\n name: \"hostless-loading-boundary\",\n displayName: \"Loading Boundary\",\n importName: \"LoadingBoundary\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n children: \"slot\",\n loadingState: {\n type: \"slot\",\n displayName: \"Loading state\",\n defaultValue: {\n type: \"text\",\n value: \"Loading...\",\n },\n },\n forceLoading: {\n type: \"boolean\",\n editOnly: true,\n displayName: \"Preview loading\",\n description:\n \"Force preview the 'Loading' state - impacts only editor, and not published page behavior\",\n },\n },\n providesData: true,\n styleSections: false,\n description: \"Handle the loading state of queries and integrations\",\n};\n\nexport function registerLoadingBoundary(\n loader?: { registerComponent: typeof registerComponent },\n customLoadingBoundaryMeta?: ComponentMeta<LoadingBoundaryProps>\n) {\n if (loader) {\n loader.registerComponent(\n LoadingBoundary,\n customLoadingBoundaryMeta ?? loadingBoundaryMeta\n );\n } else {\n registerComponent(\n LoadingBoundary,\n customLoadingBoundaryMeta ?? loadingBoundaryMeta\n );\n }\n}\n","import {\n ComponentMeta,\n DataProvider,\n registerComponent,\n repeatedElement,\n} from \"@plasmicapp/host\";\nimport React from \"react\";\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components\";\n\nconst defaultItemName = \"currentItem\";\nconst defaultIndexName = \"currentIndex\";\n\ninterface RepeaterProps<T> {\n children: React.ReactNode;\n items: T[];\n itemName?: string;\n indexName?: string;\n}\n\nfunction Repeater<T>(props: RepeaterProps<T>) {\n const { children, items, itemName, indexName } = props;\n\n if (!Array.isArray(items)) {\n throw new Error(\"Repeater received an invalid collection: not an array.\");\n }\n\n return (\n <>\n {items.map((item, index) => (\n <DataProvider\n key={index.toString()}\n name={itemName || defaultItemName}\n data={item}\n >\n <DataProvider name={indexName || defaultIndexName} data={index}>\n {repeatedElement(index, children)}\n </DataProvider>\n </DataProvider>\n ))}\n </>\n );\n}\n\nexport const repeaterMeta: ComponentMeta<RepeaterProps<any>> = {\n name: `plasmic-repeater`,\n displayName: \"Repeater\",\n importName: \"Repeater\",\n importPath: thisModule,\n providesData: true,\n props: {\n children: {\n type: \"slot\",\n isRepeated: true,\n },\n items: {\n type: \"array\",\n defaultValue: [1, 2, 3],\n displayName: \"Collection\",\n description: \"Items array (JavaScript expression).\",\n },\n itemName: {\n type: \"string\",\n defaultValue: defaultItemName,\n defaultValueHint: defaultItemName,\n displayName: \"Item\",\n description: \"Data context key for the current item.\",\n },\n indexName: {\n type: \"string\",\n defaultValue: defaultIndexName,\n defaultValueHint: defaultIndexName,\n displayName: \"Index\",\n description: \"Data context key for the index of the current item.\",\n },\n },\n};\n\nexport function registerRepeater(\n loader?: { registerComponent: typeof registerComponent },\n customRepeaterMeta?: ComponentMeta<RepeaterProps<any>>\n) {\n if (loader) {\n loader.registerComponent(Repeater, customRepeaterMeta ?? repeaterMeta);\n } else {\n registerComponent(Repeater, customRepeaterMeta ?? repeaterMeta);\n }\n}\n\nexport default Repeater;\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React, {\n ReactNode,\n RefObject,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nexport function useDirectionalIntersection({\n ref,\n scrollDownThreshold = 0.5,\n scrollUpThreshold = 0,\n}: {\n ref: RefObject<HTMLElement>;\n scrollDownThreshold?: number;\n scrollUpThreshold?: number;\n}) {\n const [revealed, setRevealed] = useState(false);\n useEffect(() => {\n if (ref.current && typeof IntersectionObserver === \"function\") {\n const handler = (entries: IntersectionObserverEntry[]) => {\n if (entries[0].intersectionRatio >= scrollDownThreshold) {\n setRevealed(true);\n } else if (entries[0].intersectionRatio <= scrollUpThreshold) {\n setRevealed(false);\n }\n };\n\n const observer = new IntersectionObserver(handler, {\n root: null,\n rootMargin: \"0%\",\n threshold: [scrollUpThreshold, scrollDownThreshold],\n });\n observer.observe(ref.current);\n\n return () => {\n setRevealed(false);\n observer.disconnect();\n };\n }\n return () => {};\n }, [ref.current, scrollDownThreshold, scrollUpThreshold]);\n return revealed;\n}\n\nexport interface ScrollRevealerProps {\n children?: ReactNode;\n className?: string;\n scrollUpThreshold?: number;\n scrollDownThreshold?: number;\n}\n\n/**\n * Unlike react-awesome-reveal, ScrollRevealer:\n *\n * - has configurable thresholds\n * - triggers arbitrary render/unrender animations\n *\n * TODO: Merge this inta a general Reveal component, perhaps forking react-awesome-reveal, so that we don't have two different reveal components for users.\n */\nexport default function ScrollRevealer({\n children,\n className,\n scrollDownThreshold = 0.5,\n scrollUpThreshold = 0,\n}: ScrollRevealerProps) {\n const intersectionRef = useRef<HTMLDivElement>(null);\n const revealed = useDirectionalIntersection({\n ref: intersectionRef,\n scrollUpThreshold,\n scrollDownThreshold,\n });\n return (\n <div className={className} ref={intersectionRef}>\n {revealed ? children : null}\n </div>\n );\n}\n\nexport const scrollRevealerMeta: ComponentMeta<ScrollRevealerProps> = {\n name: \"hostless-scroll-revealer\",\n importName: \"ScrollRevealer\",\n displayName: \"Scroll Revealer\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n children: \"slot\",\n scrollDownThreshold: {\n type: \"number\",\n displayName: \"Scroll down threshold\",\n defaultValueHint: 0.5,\n description:\n \"How much of the element (as a fraction) must you scroll into view for it to appear (defaults to 0.5)\",\n },\n scrollUpThreshold: {\n type: \"number\",\n displayName: \"Scroll up threshold\",\n defaultValueHint: 0,\n description:\n \"While scrolling up, how much of the element (as a fraction) can still be scrolled in view before it disappears (defaults to 0, meaning you must scroll up until it's completely out of view)\",\n },\n },\n defaultStyles: {\n width: \"stretch\",\n maxWidth: \"100%\",\n },\n};\n\nexport function registerScrollRevealer(\n loader?: { registerComponent: typeof registerComponent },\n customScrollRevealerMeta?: ComponentMeta<ScrollRevealerProps>\n) {\n if (loader) {\n loader.registerComponent(\n ScrollRevealer,\n customScrollRevealerMeta ?? scrollRevealerMeta\n );\n } else {\n registerComponent(\n ScrollRevealer,\n customScrollRevealerMeta ?? scrollRevealerMeta\n );\n }\n}\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport interface SideEffectProps {\n onMount?: () => Promise<void>;\n onUnmount?: () => Promise<void>;\n deps?: unknown[];\n}\n\nexport default function SideEffect({\n deps,\n onMount,\n onUnmount,\n}: SideEffectProps) {\n React.useEffect(() => {\n onMount?.();\n return () => {\n onUnmount?.();\n };\n }, deps ?? []);\n return null;\n}\n\nexport const sideEffectMeta: CodeComponentMeta<SideEffectProps> = {\n name: \"hostless-side-effect\",\n displayName: \"Side Effect\",\n description: \"Run actions on load, unload, and when data changes.\",\n importName: \"SideEffect\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n onMount: {\n type: \"eventHandler\",\n displayName: \"On load\",\n description: \"Actions to run when this Side Effect component is mounted.\",\n argTypes: [],\n },\n onUnmount: {\n type: \"eventHandler\",\n displayName: \"On unload\",\n description:\n \"Actions to run when this Side Effect component is unmounted.\",\n argTypes: [],\n },\n deps: {\n type: \"array\",\n displayName: \"When data changes\",\n description:\n \"List of values which should trigger a re-run of the actions if changed.\",\n },\n },\n};\n\nexport function registerSideEffect(\n loader?: { registerComponent: typeof registerComponent },\n customMeta?: CodeComponentMeta<SideEffectProps>\n) {\n if (loader) {\n loader.registerComponent(SideEffect, customMeta ?? sideEffectMeta);\n } else {\n registerComponent(SideEffect, customMeta ?? sideEffectMeta);\n }\n}\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { useEffect, useMemo, useRef } from \"react\";\nimport { useIsomorphicLayoutEffect } from \"./common\";\n\nexport interface TimerProps {\n onTick: () => void;\n isRunning?: boolean;\n intervalSeconds?: number;\n runWhileEditing: boolean;\n \"data-plasmic-canvas-envs\"?: number;\n}\n\nexport function useInterval(callback: () => void, delay: number | null) {\n const savedCallback = useRef(callback);\n\n // Remember the latest callback if it changes.\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n // Set up the interval.\n useEffect(() => {\n // Don't schedule if no delay is specified.\n // Note: 0 is a valid value for delay.\n if (!delay && delay !== 0) {\n return;\n }\n\n const id = setInterval(() => savedCallback.current(), delay);\n\n return () => clearInterval(id);\n }, [delay]);\n}\n\nexport default function Timer({\n intervalSeconds = 1,\n isRunning = false,\n onTick = () => {},\n runWhileEditing,\n \"data-plasmic-canvas-envs\": canvasId,\n}: TimerProps) {\n const isEditMode = useMemo(() => canvasId !== undefined, [canvasId]);\n useInterval(\n onTick,\n // Delay in milliseconds or null to stop it\n isRunning && (isEditMode ? runWhileEditing : true)\n ? intervalSeconds * 1000\n : null\n );\n return null;\n}\n\nexport const timerMeta: CodeComponentMeta<TimerProps> = {\n name: \"hostless-timer\",\n displayName: \"Timer\",\n description: \"Run something periodically\",\n importName: \"Timer\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n onTick: {\n type: \"eventHandler\",\n displayName: \"Run this every interval\",\n description: \"Actions to run periodically\",\n argTypes: [],\n },\n isRunning: {\n type: \"boolean\",\n displayName: \"Is Running?\",\n defaultValue: true,\n },\n runWhileEditing: {\n type: \"boolean\",\n displayName: \"Run while editing\",\n description:\n \"Normally this only runs in the live site or in preview mode, but you can force it to run even while you are editing in the canvas (Please enable interactive mode to observe state changes)\",\n defaultValue: false,\n },\n intervalSeconds: {\n type: \"number\",\n displayName: \"Interval (seconds)\",\n description: \"Interval in seconds\",\n },\n },\n};\n\nexport function registerTimer(\n loader?: { registerComponent: typeof registerComponent },\n customMeta?: CodeComponentMeta<TimerProps>\n) {\n if (loader) {\n loader.registerComponent(Timer, customMeta ?? timerMeta);\n } else {\n registerComponent(Timer, customMeta ?? timerMeta);\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport type VideoProps = Pick<\n React.ComponentProps<\"video\">,\n | \"autoPlay\"\n | \"controls\"\n | \"loop\"\n | \"muted\"\n | \"playsInline\"\n | \"poster\"\n | \"preload\"\n | \"src\"\n>;\n\nconst Video = React.forwardRef<HTMLVideoElement, VideoProps>(\n (props: VideoProps, ref) => {\n return <video ref={ref} {...props} />;\n }\n);\n\nexport default Video;\n\nexport const videoMeta: ComponentMeta<VideoProps> = {\n name: \"hostless-html-video\",\n importName: \"Video\",\n displayName: \"HTML Video\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n src: {\n type: \"string\",\n defaultValue:\n \"https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm\",\n displayName: \"Source URL\",\n description: \"URL to a video file.\",\n },\n autoPlay: {\n type: \"boolean\",\n displayName: \"Auto Play\",\n description:\n \"Whether the video show automatically start playing when the player loads. Chrome and other browsers require 'muted' to also be set for 'autoplay' to work.\",\n helpText: \"Requires 'Muted' to also be set for 'Auto Play' to work.\",\n },\n controls: {\n type: \"boolean\",\n displayName: \"Show Controls\",\n description: \"Whether the video player controls should be displayed\",\n defaultValue: true,\n },\n playsInline: {\n type: \"boolean\",\n displayName: \"Plays inline\",\n description:\n \"Usually on mobile, when tilted landscape, videos can play fullscreen. Turn this on to prevent that.\",\n },\n loop: {\n type: \"boolean\",\n displayName: \"Loop\",\n description: \"Whether the video should be played again after it finishes\",\n },\n muted: {\n type: \"boolean\",\n displayName: \"Muted\",\n description: \"Whether audio should be muted\",\n },\n poster: {\n type: \"imageUrl\",\n displayName: \"Poster (placeholder) image\",\n description: \"Image to show while video is downloading\",\n },\n preload: {\n type: \"choice\",\n options: [\"none\", \"metadata\", \"auto\"],\n displayName: \"Preload\",\n description:\n \"Whether to preload nothing, metadata only, or the full video\",\n },\n },\n defaultStyles: {\n height: \"hug\",\n width: \"640px\",\n maxWidth: \"100%\",\n },\n};\n\nexport function registerVideo(\n loader?: { registerComponent: typeof registerComponent },\n customVideoMeta?: ComponentMeta<VideoProps>\n) {\n if (loader) {\n loader.registerComponent(Video, customVideoMeta ?? videoMeta);\n } else {\n registerComponent(Video, customVideoMeta ?? videoMeta);\n }\n}\n"],"names":["ConditionGuardOnNotSatisfied","_ref","onNotSatisfied","ref","React","useRef","useEffect","current","ConditionGuard","_ref3","skipPaths","pathname","currentPath","plasmicPathname","children","condition","window","location","origin","globalThis","_globalThis$__PLASMIC","call","some","_ref2","path","conditionGuardMeta","name","displayName","description","importName","importPath","props","type","helpText","defaultValue","argTypes","itemType","fields","nameFunc","item","thisModule","DynamicElement","tag","_ref$tag","className","propSelectors","_objectWithoutPropertiesLoose","_excluded","computed","_useSelectors","createElement","_extends","DynamicText","selector","_excluded2","DynamicImage","_excluded3","loading","style","objectFit","src","DynamicRepeater","_ref4","loopItemName","keySelector","data","finalData","_ref5","_useSelector","map","index","_applySelector2","_DataProvider","key","_applySelector","repeatedElement","dynamicRepeaterProps","isRepeated","dynamicRepeaterMeta","dataProviderMeta","providesData","birthYear","profilePicture","dynamicPropsWithoutTag","defaultValueHint","dynamicProps","dynamicElementMeta","dynamicTextMeta","dynamicImageMeta","ensure","x","Error","useIsomorphicLayoutEffect","useLayoutEffect","useId","Embed","code","_ref$hideInEditor","hideInEditor","rootElt","inEditor","usePlasmicCanvasContext","htmlId","firstRender","useFirstRender","makePlasmicVarName","_regeneratorRuntime","mark","_callee","_loop","_i","_Array$from","wrap","_context2","prev","next","oldScript","newScript","_context","document","async","Array","from","attributes","forEach","attr","setAttribute","value","appendChild","createTextNode","innerHTML","parentNode","replaceChild","Promise","resolve","addEventListener","stop","querySelectorAll","length","delegateYield","effectiveCode","id","addIdentifierScript","dangerouslySetInnerHTML","__html","whiteSpace","replace","embedMeta","lang","editOnly","defaultStyles","maxWidth","Iframe","preview","onLoad","useContext","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","display","alignItems","justifyContent","overflow","iframeMeta","width","height","reactMajorVersion","version","split","console","warn","hasWarnedDisabledLoadingBoundary","LoadingBoundary","_useState","loaded","setLoaded","forceLoading","loadingState","isClient","useState","enableLoadingBoundary","_useDataEnv","useDataEnv","plasmicQuery","Suspense","fallback","DataProvider","hidden","loadingBoundaryMeta","styleSections","Repeater","items","itemName","indexName","isArray","toString","repeaterMeta","useDirectionalIntersection","_ref$scrollDownThresh","scrollDownThreshold","_ref$scrollUpThreshol","scrollUpThreshold","revealed","setRevealed","IntersectionObserver","observer","entries","intersectionRatio","root","rootMargin","threshold","observe","disconnect","ScrollRevealer","_ref2$scrollDownThres","_ref2$scrollUpThresho","intersectionRef","scrollRevealerMeta","SideEffect","deps","onMount","onUnmount","sideEffectMeta","useInterval","callback","delay","savedCallback","setInterval","clearInterval","Timer","intervalSeconds","_ref$intervalSeconds","_ref$isRunning","isRunning","_ref$onTick","onTick","runWhileEditing","canvasId","isEditMode","useMemo","undefined","timerMeta","Video","forwardRef","videoMeta","autoPlay","controls","playsInline","loop","muted","poster","preload","options","apply","arguments","loader","customConditionGuardMeta","registerComponent","customDataProviderMeta","customDynamicElementMeta","customDynamicImageMeta","customDynamicRepeaterMeta","customDynamicTextMeta","customEmbedMeta","customIframeMeta","customLoadingBoundaryMeta","customRepeaterMeta","customScrollRevealerMeta","customMeta","customVideoMeta"],"mappings":"wRAYA,SAASA,EAA4BC,OACnCC,EAAcD,EAAdC,eAEMC,EAAMC,EAAMC,QAAO,GAOzB,OANAD,EAAME,WAAU,WACTH,EAAII,UACPJ,EAAII,SAAU,QACdL,GAAAA,OAED,CAACA,IACG,cAceM,EAAcC,OAXAC,IAC9BC,EAEAC,EACAC,EASNX,EAAcO,EAAdP,eACAY,EAAQL,EAARK,SAGA,OALSL,EAATM,YAZoCL,EAe3BD,EAATC,UAdMC,EAAWK,OAAOC,SAASN,SAE3BC,EAAcI,OAAOC,SAASC,OAASP,EACvCE,QAAmBM,mBAAkBC,EAAlBD,WAA4C,8BAA5CC,EAAAC,KAAAF,kBAClBT,SAAAA,EAAWY,MAChB,SAAAC,GAAA,IAAGC,EAAID,EAAJC,KAAI,OACLA,IAASb,GAAYa,IAASZ,GAAeY,IAASX,MAcnDT,gCAAGU,GAHDV,gBAACJ,GAA6BE,eAAgBA,QAM5CuB,EAAyD,CACpEC,KAAM,2BACNC,YAAa,kBACbC,YAAa,8IACbC,WAAY,iBACZC,WAAY,wCACZC,MAAO,CACLjB,SAAU,OACVC,UAAW,CACTiB,KAAM,UACNL,YAAa,YACbC,YAAa,iCACbK,SAAU,8EACVC,cAAc,GAEhBhC,eAAgB,CACd8B,KAAM,eACNL,YAAa,qBACbC,YAAa,wDACbO,SAAU,IAEZzB,UAAW,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CzD9CoH,EACAS,GAEIT,EACFA,EAAOE,kBAAkBjH,QAAQwH,EAAAA,EAAoBrG,GAErD8F,EAAkBjH,QAAQwH,EAAAA,EAAoBrG,6CCyBhD4F,EACAU,GAEIV,EACFA,EAAOE,kBACLrF,QACA6F,EAAAA,EAA6B7E,GAG/BqE,EACErF,QACA6F,EAAAA,EAA6B7E,sCCrCjCmE,EACAW,GAEIX,EACFA,EAAOE,kBAAkBnE,QAAU4E,EAAAA,EAAsBtE,GAEzD6D,oBAAkBnE,QAAU4E,EAAAA,EAAsBtE,4CC0BpD2D,EACAY,GAEIZ,EACFA,EAAOE,kBACL5C,QACAsD,EAAAA,EAA4BlD,GAG9BwC,EACE5C,QACAsD,EAAAA,EAA4BlD,wCCnEhCsC,EACAa,GAEIb,EACFA,EAAOE,kBAAkBvC,QAAYkD,EAAAA,EAAc9C,GAEnDmC,EAAkBvC,QAAYkD,EAAAA,EAAc9C,mCC2B9CiC,EACAa,GAEIb,EACFA,EAAOE,kBAAkB5B,QAAOuC,EAAAA,EAAc3B,GAE9CgB,EAAkB5B,QAAOuC,EAAAA,EAAc3B,mCCNzCc,EACAc,GAEId,EACFA,EAAOE,kBAAkBf,QAAO2B,EAAAA,EAAmBzB,GAEnDa,EAAkBf,QAAO2B,EAAAA,EAAmBzB,wHT/CF,WAE5C,OADA3E,QAAQC,KAAK,gEACNW,aAAWwE,aAAAC,2FApB4B,WAE9C,OADArF,QAAQC,KAAK,iEACN9G,cAAYiM,aAAAC,iCAM6B,WAIhD,OAHArF,QAAQC,KACN,kEAEKjI,eAAaoN,aAAAC"}
|
|
1
|
+
{"version":3,"file":"plasmic-basic-components.cjs.production.min.js","sources":["../src/ConditionGuard.tsx","../src/Data.tsx","../src/common.ts","../src/Embed.tsx","../src/Iframe.tsx","../src/LoadingBoundary.tsx","../src/Repeater.tsx","../src/ScrollRevealer.tsx","../src/SideEffect.tsx","../src/Timer.tsx","../src/Video.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport interface ConditionGuardProps {\n condition: boolean;\n onNotSatisfied?: () => Promise<void>;\n children: React.ReactNode;\n skipPaths?: Array<{ path: string }>;\n}\n\nfunction ConditionGuardOnNotSatisfied({\n onNotSatisfied,\n}: Pick<ConditionGuardProps, \"onNotSatisfied\">) {\n const ref = React.useRef(false);\n React.useEffect(() => {\n if (!ref.current) {\n ref.current = true;\n onNotSatisfied?.();\n }\n }, [onNotSatisfied]);\n return null;\n}\n\nfunction isCurrentLocationInSkipPaths(skipPaths?: Array<{ path: string }>) {\n const pathname = window.location.pathname;\n // Ignore search params\n const currentPath = window.location.origin + pathname;\n const plasmicPathname = (globalThis as any)?.[\"__PLASMIC_STUDIO_PATH\"]?.();\n return skipPaths?.some(\n ({ path }) =>\n path === pathname || path === currentPath || path === plasmicPathname\n );\n}\n\nexport function ConditionGuard({\n condition,\n onNotSatisfied,\n children,\n skipPaths,\n}: ConditionGuardProps) {\n if (!condition && !isCurrentLocationInSkipPaths(skipPaths)) {\n return <ConditionGuardOnNotSatisfied onNotSatisfied={onNotSatisfied} />;\n }\n\n return <>{children}</>;\n}\n\nexport const conditionGuardMeta: ComponentMeta<ConditionGuardProps> = {\n name: \"hostless-condition-guard\",\n displayName: \"Condition Guard\",\n description:\n \"Ensure some condition, or else run an interaction. Examples: ensure all users have a database row, or require new users to setup a profile.\",\n importName: \"ConditionGuard\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n children: \"slot\",\n condition: {\n type: \"boolean\",\n displayName: \"Condition\",\n description: \"The condition to guard against\",\n helpText:\n \"Condition to check. Render contents only if true. Run interaction if false.\",\n defaultValue: true,\n },\n onNotSatisfied: {\n type: \"eventHandler\",\n displayName: \"On condition false\",\n description: \"The action to run when the condition is not satisfied\",\n argTypes: [],\n },\n skipPaths: {\n type: \"array\",\n displayName: \"Skip Paths\",\n description: \"Paths that the action should not run\",\n itemType: {\n type: \"object\",\n fields: {\n path: \"href\",\n },\n nameFunc: (item: any) => item?.path,\n },\n },\n },\n};\n\nexport function registerConditionGuard(\n loader?: { registerComponent: typeof registerComponent },\n customConditionGuardMeta?: ComponentMeta<ConditionGuardProps>\n) {\n if (loader) {\n loader.registerComponent(\n ConditionGuard,\n customConditionGuardMeta ?? conditionGuardMeta\n );\n } else {\n registerComponent(\n ConditionGuard,\n customConditionGuardMeta ?? conditionGuardMeta\n );\n }\n}\n","import {\n applySelector as _applySelector,\n ComponentMeta,\n DataProvider as _DataProvider,\n DataProviderProps,\n repeatedElement,\n SelectorDict,\n useDataEnv as _useDataEnv,\n useSelector as _useSelector,\n useSelectors as _useSelectors,\n} from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { ComponentProps, createElement, ReactNode } from \"react\";\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components\";\n\n/**\n * @deprecated This should be imported from @plasmicapp/host instead.\n */\nexport const applySelector: typeof _applySelector = function (...args) {\n console.warn(\n \"DEPRECATED: Import applySelector from @plasmicapp/host instead.\"\n );\n return _applySelector(...args);\n};\n\n/**\n * @deprecated This should be imported from @plasmicapp/host instead.\n */\nexport const useSelector: typeof _useSelector = function (...args) {\n console.warn(\"DEPRECATED: Import useSelector from @plasmicapp/host instead.\");\n return _useSelector(...args);\n};\n\n/**\n * @deprecated This should be imported from @plasmicapp/host instead.\n */\nexport const useSelectors: typeof _useSelectors = function (...args) {\n console.warn(\n \"DEPRECATED: Import useSelectors from @plasmicapp/host instead.\"\n );\n return _useSelectors(...args);\n};\n\n/**\n * @deprecated This should be imported from @plasmicapp/host instead.\n */\nexport const useDataEnv: typeof _useDataEnv = function (...args) {\n console.warn(\"DEPRECATED: Import useDataEnv from @plasmicapp/host instead.\");\n return _useDataEnv(...args);\n};\n\nexport const DataProvider: typeof _DataProvider = function (...args) {\n return _DataProvider(...args);\n};\n\nexport interface CommonDynamicProps {\n className?: string;\n tag?: string;\n propSelectors?: SelectorDict;\n}\n\nexport function DynamicElement<\n Tag extends keyof JSX.IntrinsicElements = \"div\"\n>({\n tag = \"div\",\n className,\n children,\n propSelectors,\n ...props\n}: CommonDynamicProps & ComponentProps<Tag>) {\n const computed = _useSelectors(propSelectors);\n return createElement(tag, {\n children,\n ...props,\n ...computed,\n className: className + \" \" + computed.className,\n });\n}\n\nexport interface DynamicTextProps extends CommonDynamicProps {\n selector?: string;\n}\n\nexport function DynamicText({\n selector,\n propSelectors,\n ...props\n}: DynamicTextProps) {\n return (\n <DynamicElement\n {...props}\n propSelectors={{ ...propSelectors, children: selector }}\n >\n {/*This is the default text*/}\n (DynamicText requires a selector)\n </DynamicElement>\n );\n}\n\nexport interface DynamicImageProps\n extends CommonDynamicProps,\n ComponentProps<\"img\"> {\n selector?: string;\n}\n\nexport function DynamicImage({\n selector,\n propSelectors,\n ...props\n}: DynamicImageProps) {\n return (\n <DynamicElement<\"img\">\n tag={\"img\"}\n loading={\"lazy\"}\n style={{\n objectFit: \"cover\",\n }}\n {...props}\n propSelectors={{ ...propSelectors, src: selector }}\n // Default image placeholder\n src=\"https://studio.plasmic.app/static/img/placeholder.png\"\n />\n );\n}\n\nexport interface DynamicRepeaterProps {\n children?: ReactNode;\n loopItemName?: string;\n keySelector?: string;\n selector?: string;\n data?: any;\n}\n\nexport function DynamicRepeater({\n children,\n loopItemName,\n keySelector,\n selector,\n data,\n}: DynamicRepeaterProps) {\n // Defaults to an array of three items.\n const finalData = data ?? _useSelector(selector) ?? [1, 2, 3];\n return (\n <>\n {finalData?.map?.((item: any, index: number) => (\n <_DataProvider\n key={_applySelector(item, keySelector) ?? index}\n name={loopItemName}\n data={item}\n >\n {repeatedElement(index, children)}\n </_DataProvider>\n ))}\n </>\n );\n}\n\nexport const dynamicRepeaterProps = {\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField\",\n },\n loopItemName: {\n type: \"string\",\n defaultValue: \"item\",\n description:\n \"The name of the variable to use to store the current item in the loop\",\n },\n children: {\n type: \"slot\",\n isRepeated: true,\n },\n} as const;\n\nexport const dynamicRepeaterMeta: ComponentMeta<DynamicRepeaterProps> = {\n name: \"hostless-dynamic-repeater\",\n displayName: \"Dynamic Repeater\",\n importName: \"DynamicRepeater\",\n importPath: thisModule,\n props: dynamicRepeaterProps,\n};\n\nexport function registerDynamicRepeater(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicRepeaterMeta?: ComponentMeta<DynamicRepeaterProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicRepeater,\n customDynamicRepeaterMeta ?? dynamicRepeaterMeta\n );\n } else {\n registerComponent(\n DynamicRepeater,\n customDynamicRepeaterMeta ?? dynamicRepeaterMeta\n );\n }\n}\n\nexport const dataProviderMeta: ComponentMeta<DataProviderProps> = {\n name: \"hostless-data-provider\",\n displayName: \"Data Provider\",\n importName: \"DataProvider\",\n importPath: thisModule,\n providesData: true,\n // description: \"Makes some specified data available to the subtree in a context\",\n props: {\n name: {\n type: \"string\",\n defaultValue: \"celebrities\",\n description: \"The name of the variable to store the data in\",\n },\n data: {\n type: \"object\",\n defaultValue: [\n {\n name: \"Fill Murray\",\n birthYear: 1950,\n profilePicture: [\"https://www.fillmurray.com/200/300\"],\n },\n {\n name: \"Place Cage\",\n birthYear: 1950,\n profilePicture: [\"https://www.placecage.com/200/300\"],\n },\n ],\n },\n children: {\n type: \"slot\",\n },\n },\n};\n\nexport function registerDataProvider(\n loader?: { registerComponent: typeof registerComponent },\n customDataProviderMeta?: ComponentMeta<DataProviderProps>\n) {\n if (loader) {\n loader.registerComponent(\n _DataProvider,\n customDataProviderMeta ?? dataProviderMeta\n );\n } else {\n registerComponent(\n _DataProvider,\n customDataProviderMeta ?? dataProviderMeta\n );\n }\n}\n\nconst dynamicPropsWithoutTag = {\n propSelectors: {\n type: \"object\",\n defaultValueHint: {},\n description:\n \"An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value.\",\n },\n} as const;\n\nconst dynamicProps = {\n ...dynamicPropsWithoutTag,\n tag: {\n type: \"string\",\n defaultValueHint: \"div\",\n description: \"The HTML tag to use\",\n },\n} as const;\n\n// TODO Eventually we'll want to expose all the base HTML properties, but in the nicer way that we do within the studio.\n\nexport const dynamicElementMeta: ComponentMeta<CommonDynamicProps> = {\n name: \"hostless-dynamic-element\",\n displayName: \"Dynamic Element\",\n importName: \"DynamicElement\",\n importPath: thisModule,\n props: { ...dynamicProps, children: \"slot\" },\n};\n\nexport function registerDynamicElement(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicElementMeta?: ComponentMeta<CommonDynamicProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicElement,\n customDynamicElementMeta ?? dynamicElementMeta\n );\n } else {\n registerComponent(\n DynamicElement,\n customDynamicElementMeta ?? dynamicElementMeta\n );\n }\n}\n\nexport const dynamicTextMeta: ComponentMeta<DynamicTextProps> = {\n name: \"hostless-dynamic-text\",\n importName: \"DynamicText\",\n displayName: \"Dynamic Text\",\n importPath: thisModule,\n props: {\n ...dynamicProps,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the text, such as: someVariable.0.someField\",\n },\n },\n};\n\nexport function registerDynamicText(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicTextMeta?: ComponentMeta<DynamicTextProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicText,\n customDynamicTextMeta ?? dynamicTextMeta\n );\n } else {\n registerComponent(DynamicText, customDynamicTextMeta ?? dynamicTextMeta);\n }\n}\n\nexport const dynamicImageMeta: ComponentMeta<DynamicImageProps> = {\n name: \"hostless-dynamic-image\",\n displayName: \"Dynamic Image\",\n importName: \"DynamicImage\",\n importPath: thisModule,\n props: {\n ...dynamicPropsWithoutTag,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the image source URL, such as: someVariable.0.someField\",\n },\n },\n};\n\nexport function registerDynamicImage(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicImageMeta?: ComponentMeta<DynamicImageProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicImage,\n customDynamicImageMeta ?? dynamicImageMeta\n );\n } else {\n registerComponent(DynamicImage, customDynamicImageMeta ?? dynamicImageMeta);\n }\n}\n","import React from \"react\";\n\nexport const tuple = <T extends any[]>(...args: T): T => args;\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n\nexport const isBrowser = typeof window !== \"undefined\";\n\nexport const useIsomorphicLayoutEffect = isBrowser\n ? React.useLayoutEffect\n : React.useEffect;\n\nexport function useFirstRender() {\n const ref = React.useRef(true);\n const firstRender = ref.current;\n ref.current = false;\n return firstRender;\n}\n\n// Fix for React.useId type since it's only available for React 18+\nexport const useId: (() => string) | undefined = React.useId;\n","import { usePlasmicCanvasContext } from \"@plasmicapp/host\";\nimport registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useRef } from \"react\";\nimport { ensure, useFirstRender, useId } from \"./common\";\n\nexport interface EmbedProps {\n className?: string;\n code: string;\n hideInEditor?: boolean;\n}\n\n/**\n * A common use case for embedding HTML snippets is loading/running script tags, so most of the logic here is for\n * handling that.\n *\n * You can't just write innerHTML with some <script> tags in there. You need to explicitly add each one via the DOM API.\n *\n * You also can't just add the script tags and expect them to run sequentially, and sometimes there are multiple scripts\n * with dependencies on each other. You have to explicitly wait for earlier ones to finish loading.\n *\n * One last complication is that Next.js can run the effect multiple times in development mode. There's nothing actually\n * that we can/should do about that, but just something to be aware of if you are here debugging issues.\n */\nexport function Embed({ className, code, hideInEditor = false }: EmbedProps) {\n const rootElt = useRef<HTMLDivElement>(null);\n const inEditor = usePlasmicCanvasContext();\n const htmlId = useId?.();\n const firstRender = useFirstRender();\n useEffect(() => {\n if (hideInEditor && inEditor) {\n return;\n }\n // If it's the first render and we already set the global id for this component, it means that\n // the HTML is already present in the DOM from the server-rendered HTML. We don't want to re-run.\n // If it's not the first render, then it can mean that some dependency changed.\n if (\n htmlId &&\n !inEditor &&\n firstRender &&\n (window as any)[makePlasmicVarName(htmlId)]\n ) {\n return;\n }\n\n // Load scripts sequentially one at a time, since later scripts can depend on earlier ones.\n let cleanup = false;\n (async () => {\n for (const oldScript of Array.from(\n ensure(rootElt.current).querySelectorAll(\"script\")\n )) {\n const newScript = document.createElement(\"script\");\n // This doesn't actually have the effect we want, we need to explicitly wait on the load event, since all\n // dynamically injected scripts are always async.\n newScript.async = false;\n Array.from(oldScript.attributes).forEach((attr) =>\n newScript.setAttribute(attr.name, attr.value)\n );\n newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n ensure(oldScript.parentNode).replaceChild(newScript, oldScript);\n // Only scripts with src will ever fire a load event.\n if (newScript.src) {\n await new Promise((resolve) =>\n newScript.addEventListener(\"load\", resolve)\n );\n if (cleanup) {\n return;\n }\n }\n }\n return () => {\n cleanup = true;\n };\n })();\n }, [htmlId, code, hideInEditor, inEditor]);\n const effectiveCode =\n hideInEditor && inEditor\n ? \"\"\n : inEditor || !htmlId\n ? code\n : addIdentifierScript(htmlId, code);\n return (\n <div\n ref={rootElt}\n className={className}\n dangerouslySetInnerHTML={{ __html: effectiveCode }}\n style={{ whiteSpace: \"normal\" }}\n />\n );\n}\n\nfunction makePlasmicVarName(id: string) {\n return `__plasmic_${id.replace(/[^a-z0-9]/gi, \"\")}`;\n}\n\nfunction addIdentifierScript(id: string, code: string) {\n return `<script>\n var ${makePlasmicVarName(id)} = 1;\n </script>\n ${code}`;\n}\n\nexport const embedMeta: ComponentMeta<EmbedProps> = {\n name: \"hostless-embed\",\n displayName: \"Embed HTML\",\n importName: \"Embed\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n code: {\n type: \"code\",\n lang: \"html\",\n defaultValue: \"<div>Paste your embed code via the right sidebar</div>\",\n description: \"The HTML code to be embedded\",\n },\n hideInEditor: {\n type: \"boolean\",\n displayName: \"Hide in editor\",\n description:\n \"Disable running the code while editing in Plasmic Studio (may require reload)\",\n editOnly: true,\n },\n },\n defaultStyles: {\n maxWidth: \"100%\",\n },\n};\n\nexport function registerEmbed(\n loader?: { registerComponent: typeof registerComponent },\n customEmbedMeta?: ComponentMeta<EmbedProps>\n) {\n if (loader) {\n loader.registerComponent(Embed, customEmbedMeta ?? embedMeta);\n } else {\n registerComponent(Embed, customEmbedMeta ?? embedMeta);\n }\n}\n","import { ComponentMeta, PlasmicCanvasContext } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { useContext } from \"react\";\n\nexport interface IframeProps {\n src: string;\n preview?: boolean;\n className?: string;\n onLoad?: React.ComponentProps<\"iframe\">[\"onLoad\"];\n}\n\nexport function Iframe({ preview, src, className, onLoad }: IframeProps) {\n const isEditing = useContext(PlasmicCanvasContext);\n if (isEditing && !preview) {\n return (\n <div className={className}>\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n background: \"#eee\",\n color: \"#888\",\n fontSize: \"36px\",\n fontFamily: \"sans-serif\",\n fontWeight: \"bold\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n }}\n >\n Iframe placeholder\n </div>\n </div>\n );\n }\n return <iframe src={src} className={className} onLoad={onLoad} />;\n}\n\nexport const iframeMeta: ComponentMeta<IframeProps> = {\n name: \"hostless-iframe\",\n displayName: \"Iframe\",\n importName: \"Iframe\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n src: {\n type: \"string\",\n defaultValue: \"https://www.example.com\",\n },\n preview: {\n type: \"boolean\",\n description: \"Load the iframe while editing in Plasmic Studio\",\n },\n onLoad: {\n type: \"eventHandler\",\n argTypes: [{ name: \"event\", type: \"object\" }],\n },\n },\n defaultStyles: {\n width: \"300px\",\n height: \"150px\",\n maxWidth: \"100%\",\n },\n};\n\nexport function registerIframe(\n loader?: { registerComponent: typeof registerComponent },\n customIframeMeta?: ComponentMeta<IframeProps>\n) {\n if (loader) {\n loader.registerComponent(Iframe, customIframeMeta ?? iframeMeta);\n } else {\n registerComponent(Iframe, customIframeMeta ?? iframeMeta);\n }\n}\n","import { DataProvider, useDataEnv } from \"@plasmicapp/host\";\nimport registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport * as plasmicQuery from \"@plasmicapp/query\";\nimport React, { Suspense, useState } from \"react\";\nimport { useIsomorphicLayoutEffect } from \"./common\";\n\ninterface LoadingBoundaryProps {\n loadingState?: React.ReactNode;\n children?: React.ReactNode;\n forceLoading?: boolean;\n}\n\nconst reactMajorVersion = +React.version.split(\".\")[0];\n\nif (reactMajorVersion < 18) {\n console.warn(\"The LoadingBoundary component only works with React 18+\");\n}\n\nconst enableLoadingBoundaryKey = \"plasmicInternalEnableLoadingBoundary\";\nconst hasLoadingBoundaryKey = \"plasmicInternalHasLoadingBoundary\";\n\nfunction useIsClient() {\n const [loaded, setLoaded] = useState(false);\n useIsomorphicLayoutEffect(() => {\n setLoaded(true);\n }, []);\n return loaded;\n}\n\nlet hasWarnedDisabledLoadingBoundary = false;\n\nfunction warnDisabledLoadingBoundary() {\n if (!hasWarnedDisabledLoadingBoundary) {\n hasWarnedDisabledLoadingBoundary = true;\n console.warn(\n `LoadingBoundary feature is not enabled. To use the LoadingBoundary component make sure to upgrade your @plasmicapp/* dependencies to the latest version and to wrap you App inside <PlasmicRootProvider />`\n );\n }\n}\n\nexport function LoadingBoundary({\n children,\n forceLoading,\n loadingState,\n}: LoadingBoundaryProps) {\n const isClient = useIsClient();\n const enableLoadingBoundary = !!useDataEnv()?.[enableLoadingBoundaryKey];\n\n if (!isClient && !plasmicQuery.isPlasmicPrepass?.()) {\n return null;\n }\n\n if (forceLoading) {\n return <>{loadingState ?? null}</>;\n }\n\n if (reactMajorVersion < 18) {\n return <>{children ?? null}</>;\n }\n\n if (!enableLoadingBoundary) {\n warnDisabledLoadingBoundary();\n return <>{children ?? null}</>;\n }\n\n return (\n <Suspense fallback={<>{loadingState ?? null}</>}>\n <DataProvider hidden name={hasLoadingBoundaryKey} data={true}>\n {children ?? null}\n </DataProvider>\n </Suspense>\n );\n}\n\nexport const loadingBoundaryMeta: ComponentMeta<LoadingBoundaryProps> = {\n name: \"hostless-loading-boundary\",\n displayName: \"Loading Boundary\",\n importName: \"LoadingBoundary\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n children: \"slot\",\n loadingState: {\n type: \"slot\",\n displayName: \"Loading state\",\n defaultValue: {\n type: \"text\",\n value: \"Loading...\",\n },\n },\n forceLoading: {\n type: \"boolean\",\n editOnly: true,\n displayName: \"Preview loading\",\n description:\n \"Force preview the 'Loading' state - impacts only editor, and not published page behavior\",\n },\n },\n providesData: true,\n styleSections: false,\n description: \"Handle the loading state of queries and integrations\",\n};\n\nexport function registerLoadingBoundary(\n loader?: { registerComponent: typeof registerComponent },\n customLoadingBoundaryMeta?: ComponentMeta<LoadingBoundaryProps>\n) {\n if (loader) {\n loader.registerComponent(\n LoadingBoundary,\n customLoadingBoundaryMeta ?? loadingBoundaryMeta\n );\n } else {\n registerComponent(\n LoadingBoundary,\n customLoadingBoundaryMeta ?? loadingBoundaryMeta\n );\n }\n}\n","import {\n ComponentMeta,\n DataProvider,\n registerComponent,\n repeatedElement,\n} from \"@plasmicapp/host\";\nimport React from \"react\";\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components\";\n\nconst defaultItemName = \"currentItem\";\nconst defaultIndexName = \"currentIndex\";\n\ninterface RepeaterProps<T> {\n children: React.ReactNode;\n items: T[];\n itemName?: string;\n indexName?: string;\n}\n\nexport function Repeater<T>(props: RepeaterProps<T>) {\n const { children, items, itemName, indexName } = props;\n\n if (!Array.isArray(items)) {\n throw new Error(\"Repeater received an invalid collection: not an array.\");\n }\n\n return (\n <>\n {items.map((item, index) => (\n <DataProvider\n key={index.toString()}\n name={itemName || defaultItemName}\n data={item}\n >\n <DataProvider name={indexName || defaultIndexName} data={index}>\n {repeatedElement(index, children)}\n </DataProvider>\n </DataProvider>\n ))}\n </>\n );\n}\n\nexport const repeaterMeta: ComponentMeta<RepeaterProps<any>> = {\n name: `plasmic-repeater`,\n displayName: \"Repeater\",\n importName: \"Repeater\",\n importPath: thisModule,\n providesData: true,\n props: {\n children: {\n type: \"slot\",\n isRepeated: true,\n },\n items: {\n type: \"array\",\n defaultValue: [1, 2, 3],\n displayName: \"Collection\",\n description: \"Items array (JavaScript expression).\",\n },\n itemName: {\n type: \"string\",\n defaultValue: defaultItemName,\n defaultValueHint: defaultItemName,\n displayName: \"Item\",\n description: \"Data context key for the current item.\",\n },\n indexName: {\n type: \"string\",\n defaultValue: defaultIndexName,\n defaultValueHint: defaultIndexName,\n displayName: \"Index\",\n description: \"Data context key for the index of the current item.\",\n },\n },\n};\n\nexport function registerRepeater(\n loader?: { registerComponent: typeof registerComponent },\n customRepeaterMeta?: ComponentMeta<RepeaterProps<any>>\n) {\n if (loader) {\n loader.registerComponent(Repeater, customRepeaterMeta ?? repeaterMeta);\n } else {\n registerComponent(Repeater, customRepeaterMeta ?? repeaterMeta);\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React, {\n ReactNode,\n RefObject,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nexport function useDirectionalIntersection({\n ref,\n scrollDownThreshold = 0.5,\n scrollUpThreshold = 0,\n}: {\n ref: RefObject<HTMLElement>;\n scrollDownThreshold?: number;\n scrollUpThreshold?: number;\n}) {\n const [revealed, setRevealed] = useState(false);\n useEffect(() => {\n if (ref.current && typeof IntersectionObserver === \"function\") {\n const handler = (entries: IntersectionObserverEntry[]) => {\n if (entries[0].intersectionRatio >= scrollDownThreshold) {\n setRevealed(true);\n } else if (entries[0].intersectionRatio <= scrollUpThreshold) {\n setRevealed(false);\n }\n };\n\n const observer = new IntersectionObserver(handler, {\n root: null,\n rootMargin: \"0%\",\n threshold: [scrollUpThreshold, scrollDownThreshold],\n });\n observer.observe(ref.current);\n\n return () => {\n setRevealed(false);\n observer.disconnect();\n };\n }\n return () => {};\n }, [ref.current, scrollDownThreshold, scrollUpThreshold]);\n return revealed;\n}\n\nexport interface ScrollRevealerProps {\n children?: ReactNode;\n className?: string;\n scrollUpThreshold?: number;\n scrollDownThreshold?: number;\n}\n\n/**\n * Unlike react-awesome-reveal, ScrollRevealer:\n *\n * - has configurable thresholds\n * - triggers arbitrary render/unrender animations\n *\n * TODO: Merge this inta a general Reveal component, perhaps forking react-awesome-reveal, so that we don't have two different reveal components for users.\n */\nexport function ScrollRevealer({\n children,\n className,\n scrollDownThreshold = 0.5,\n scrollUpThreshold = 0,\n}: ScrollRevealerProps) {\n const intersectionRef = useRef<HTMLDivElement>(null);\n const revealed = useDirectionalIntersection({\n ref: intersectionRef,\n scrollUpThreshold,\n scrollDownThreshold,\n });\n return (\n <div className={className} ref={intersectionRef}>\n {revealed ? children : null}\n </div>\n );\n}\n\nexport const scrollRevealerMeta: ComponentMeta<ScrollRevealerProps> = {\n name: \"hostless-scroll-revealer\",\n importName: \"ScrollRevealer\",\n displayName: \"Scroll Revealer\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n children: \"slot\",\n scrollDownThreshold: {\n type: \"number\",\n displayName: \"Scroll down threshold\",\n defaultValueHint: 0.5,\n description:\n \"How much of the element (as a fraction) must you scroll into view for it to appear (defaults to 0.5)\",\n },\n scrollUpThreshold: {\n type: \"number\",\n displayName: \"Scroll up threshold\",\n defaultValueHint: 0,\n description:\n \"While scrolling up, how much of the element (as a fraction) can still be scrolled in view before it disappears (defaults to 0, meaning you must scroll up until it's completely out of view)\",\n },\n },\n defaultStyles: {\n width: \"stretch\",\n maxWidth: \"100%\",\n },\n};\n\nexport function registerScrollRevealer(\n loader?: { registerComponent: typeof registerComponent },\n customScrollRevealerMeta?: ComponentMeta<ScrollRevealerProps>\n) {\n if (loader) {\n loader.registerComponent(\n ScrollRevealer,\n customScrollRevealerMeta ?? scrollRevealerMeta\n );\n } else {\n registerComponent(\n ScrollRevealer,\n customScrollRevealerMeta ?? scrollRevealerMeta\n );\n }\n}\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport interface SideEffectProps {\n onMount?: () => Promise<void>;\n onUnmount?: () => Promise<void>;\n deps?: unknown[];\n}\n\nexport function SideEffect({ deps, onMount, onUnmount }: SideEffectProps) {\n React.useEffect(() => {\n onMount?.();\n return () => {\n onUnmount?.();\n };\n }, deps ?? []);\n return null;\n}\n\nexport const sideEffectMeta: CodeComponentMeta<SideEffectProps> = {\n name: \"hostless-side-effect\",\n displayName: \"Side Effect\",\n description: \"Run actions on load, unload, and when data changes.\",\n importName: \"SideEffect\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n onMount: {\n type: \"eventHandler\",\n displayName: \"On load\",\n description: \"Actions to run when this Side Effect component is mounted.\",\n argTypes: [],\n },\n onUnmount: {\n type: \"eventHandler\",\n displayName: \"On unload\",\n description:\n \"Actions to run when this Side Effect component is unmounted.\",\n argTypes: [],\n },\n deps: {\n type: \"array\",\n displayName: \"When data changes\",\n description:\n \"List of values which should trigger a re-run of the actions if changed.\",\n },\n },\n};\n\nexport function registerSideEffect(\n loader?: { registerComponent: typeof registerComponent },\n customMeta?: CodeComponentMeta<SideEffectProps>\n) {\n if (loader) {\n loader.registerComponent(SideEffect, customMeta ?? sideEffectMeta);\n } else {\n registerComponent(SideEffect, customMeta ?? sideEffectMeta);\n }\n}\n","import registerComponent, {\n CodeComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport { useEffect, useMemo, useRef } from \"react\";\nimport { useIsomorphicLayoutEffect } from \"./common\";\n\nexport interface TimerProps {\n onTick: () => void;\n isRunning?: boolean;\n intervalSeconds?: number;\n runWhileEditing: boolean;\n \"data-plasmic-canvas-envs\"?: number;\n}\n\nexport function useInterval(callback: () => void, delay: number | null) {\n const savedCallback = useRef(callback);\n\n // Remember the latest callback if it changes.\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n // Set up the interval.\n useEffect(() => {\n // Don't schedule if no delay is specified.\n // Note: 0 is a valid value for delay.\n if (!delay && delay !== 0) {\n return;\n }\n\n const id = setInterval(() => savedCallback.current(), delay);\n\n return () => clearInterval(id);\n }, [delay]);\n}\n\nexport function Timer({\n intervalSeconds = 1,\n isRunning = false,\n onTick = () => {},\n runWhileEditing,\n \"data-plasmic-canvas-envs\": canvasId,\n}: TimerProps) {\n const isEditMode = useMemo(() => canvasId !== undefined, [canvasId]);\n useInterval(\n onTick,\n // Delay in milliseconds or null to stop it\n isRunning && (isEditMode ? runWhileEditing : true)\n ? intervalSeconds * 1000\n : null\n );\n return null;\n}\n\nexport const timerMeta: CodeComponentMeta<TimerProps> = {\n name: \"hostless-timer\",\n displayName: \"Timer\",\n description: \"Run something periodically\",\n importName: \"Timer\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n onTick: {\n type: \"eventHandler\",\n displayName: \"Run this every interval\",\n description: \"Actions to run periodically\",\n argTypes: [],\n },\n isRunning: {\n type: \"boolean\",\n displayName: \"Is Running?\",\n defaultValue: true,\n },\n runWhileEditing: {\n type: \"boolean\",\n displayName: \"Run while editing\",\n description:\n \"Normally this only runs in the live site or in preview mode, but you can force it to run even while you are editing in the canvas (Please enable interactive mode to observe state changes)\",\n defaultValue: false,\n },\n intervalSeconds: {\n type: \"number\",\n displayName: \"Interval (seconds)\",\n description: \"Interval in seconds\",\n },\n },\n};\n\nexport function registerTimer(\n loader?: { registerComponent: typeof registerComponent },\n customMeta?: CodeComponentMeta<TimerProps>\n) {\n if (loader) {\n loader.registerComponent(Timer, customMeta ?? timerMeta);\n } else {\n registerComponent(Timer, customMeta ?? timerMeta);\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport type VideoProps = Pick<\n React.ComponentProps<\"video\">,\n | \"autoPlay\"\n | \"controls\"\n | \"loop\"\n | \"muted\"\n | \"playsInline\"\n | \"poster\"\n | \"preload\"\n | \"src\"\n>;\n\nexport const Video = React.forwardRef<HTMLVideoElement, VideoProps>(\n (props: VideoProps, ref) => {\n return <video ref={ref} {...props} />;\n }\n);\n\nexport const videoMeta: ComponentMeta<VideoProps> = {\n name: \"hostless-html-video\",\n importName: \"Video\",\n displayName: \"HTML Video\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n src: {\n type: \"string\",\n defaultValue:\n \"https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm\",\n displayName: \"Source URL\",\n description: \"URL to a video file.\",\n },\n autoPlay: {\n type: \"boolean\",\n displayName: \"Auto Play\",\n description:\n \"Whether the video show automatically start playing when the player loads. Chrome and other browsers require 'muted' to also be set for 'autoplay' to work.\",\n helpText: \"Requires 'Muted' to also be set for 'Auto Play' to work.\",\n },\n controls: {\n type: \"boolean\",\n displayName: \"Show Controls\",\n description: \"Whether the video player controls should be displayed\",\n defaultValue: true,\n },\n playsInline: {\n type: \"boolean\",\n displayName: \"Plays inline\",\n description:\n \"Usually on mobile, when tilted landscape, videos can play fullscreen. Turn this on to prevent that.\",\n },\n loop: {\n type: \"boolean\",\n displayName: \"Loop\",\n description: \"Whether the video should be played again after it finishes\",\n },\n muted: {\n type: \"boolean\",\n displayName: \"Muted\",\n description: \"Whether audio should be muted\",\n },\n poster: {\n type: \"imageUrl\",\n displayName: \"Poster (placeholder) image\",\n description: \"Image to show while video is downloading\",\n },\n preload: {\n type: \"choice\",\n options: [\"none\", \"metadata\", \"auto\"],\n displayName: \"Preload\",\n description:\n \"Whether to preload nothing, metadata only, or the full video\",\n },\n },\n defaultStyles: {\n height: \"hug\",\n width: \"640px\",\n maxWidth: \"100%\",\n },\n};\n\nexport function registerVideo(\n loader?: { registerComponent: typeof registerComponent },\n customVideoMeta?: ComponentMeta<VideoProps>\n) {\n if (loader) {\n loader.registerComponent(Video, customVideoMeta ?? videoMeta);\n } else {\n registerComponent(Video, customVideoMeta ?? videoMeta);\n }\n}\n"],"names":["ConditionGuardOnNotSatisfied","_ref","onNotSatisfied","ref","React","useRef","useEffect","current","ConditionGuard","_ref3","skipPaths","pathname","currentPath","plasmicPathname","children","condition","window","location","origin","globalThis","_globalThis$__PLASMIC","call","some","_ref2","path","conditionGuardMeta","name","displayName","description","importName","importPath","props","type","helpText","defaultValue","argTypes","itemType","fields","nameFunc","item","thisModule","DynamicElement","tag","_ref$tag","className","propSelectors","_objectWithoutPropertiesLoose","_excluded","computed","_useSelectors","createElement","_extends","DynamicText","selector","_excluded2","DynamicImage","_excluded3","loading","style","objectFit","src","DynamicRepeater","_ref4","loopItemName","keySelector","data","finalData","_ref5","_useSelector","map","index","_applySelector2","_DataProvider","key","_applySelector","repeatedElement","dynamicRepeaterProps","isRepeated","dynamicRepeaterMeta","dataProviderMeta","providesData","birthYear","profilePicture","dynamicPropsWithoutTag","defaultValueHint","dynamicProps","dynamicElementMeta","dynamicTextMeta","dynamicImageMeta","ensure","x","Error","useIsomorphicLayoutEffect","useLayoutEffect","useId","Embed","code","_ref$hideInEditor","hideInEditor","rootElt","inEditor","usePlasmicCanvasContext","htmlId","firstRender","useFirstRender","makePlasmicVarName","cleanup","_regeneratorRuntime","mark","_callee","_loop","_ret","_i","_Array$from","wrap","_context2","prev","next","oldScript","newScript","_context","document","async","Array","from","attributes","forEach","attr","setAttribute","value","appendChild","createTextNode","innerHTML","parentNode","replaceChild","Promise","resolve","addEventListener","abrupt","v","stop","querySelectorAll","length","delegateYield","t0","effectiveCode","id","addIdentifierScript","dangerouslySetInnerHTML","__html","whiteSpace","replace","embedMeta","lang","editOnly","defaultStyles","maxWidth","Iframe","preview","onLoad","useContext","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","display","alignItems","justifyContent","overflow","iframeMeta","width","height","reactMajorVersion","version","split","console","warn","hasWarnedDisabledLoadingBoundary","LoadingBoundary","_useState","loaded","setLoaded","forceLoading","loadingState","isClient","useState","enableLoadingBoundary","_useDataEnv","useDataEnv","plasmicQuery","Suspense","fallback","DataProvider","hidden","loadingBoundaryMeta","styleSections","Repeater","items","itemName","indexName","isArray","toString","repeaterMeta","useDirectionalIntersection","_ref$scrollDownThresh","scrollDownThreshold","_ref$scrollUpThreshol","scrollUpThreshold","revealed","setRevealed","IntersectionObserver","observer","entries","intersectionRatio","root","rootMargin","threshold","observe","disconnect","ScrollRevealer","_ref2$scrollDownThres","_ref2$scrollUpThresho","intersectionRef","scrollRevealerMeta","SideEffect","deps","onMount","onUnmount","sideEffectMeta","useInterval","callback","delay","savedCallback","setInterval","clearInterval","Timer","intervalSeconds","_ref$intervalSeconds","_ref$isRunning","isRunning","_ref$onTick","onTick","runWhileEditing","canvasId","isEditMode","useMemo","undefined","timerMeta","Video","forwardRef","videoMeta","autoPlay","controls","playsInline","loop","muted","poster","preload","options","apply","arguments","loader","customConditionGuardMeta","registerComponent","customDataProviderMeta","customDynamicElementMeta","customDynamicImageMeta","customDynamicRepeaterMeta","customDynamicTextMeta","customEmbedMeta","customIframeMeta","customLoadingBoundaryMeta","customRepeaterMeta","customScrollRevealerMeta","customMeta","customVideoMeta"],"mappings":"wRAYA,SAASA,EAA4BC,OACnCC,EAAcD,EAAdC,eAEMC,EAAMC,EAAMC,QAAO,GAOzB,OANAD,EAAME,WAAU,WACTH,EAAII,UACPJ,EAAII,SAAU,QACdL,GAAAA,OAED,CAACA,IACG,cAcOM,EAAcC,OAXQC,IAC9BC,EAEAC,EACAC,EASNX,EAAcO,EAAdP,eACAY,EAAQL,EAARK,SAGA,OALSL,EAATM,YAZoCL,EAe3BD,EAATC,UAdMC,EAAWK,OAAOC,SAASN,SAE3BC,EAAcI,OAAOC,SAASC,OAASP,EACvCE,QAAmBM,mBAAkBC,EAAlBD,WAA4C,8BAA5CC,EAAAC,KAAAF,kBAClBT,SAAAA,EAAWY,MAChB,SAAAC,GAAA,IAAGC,EAAID,EAAJC,KAAI,OACLA,IAASb,GAA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B,QAAOuC,EAAAA,EAAc3B,mCCRzCc,EACAc,GAEId,EACFA,EAAOE,kBAAkBf,QAAO2B,EAAAA,EAAmBzB,GAEnDa,EAAkBf,QAAO2B,EAAAA,EAAmBzB,wHT7CF,WAE5C,OADA3E,QAAQC,KAAK,gEACNW,aAAWwE,aAAAC,2FApB4B,WAE9C,OADArF,QAAQC,KAAK,iEACNnH,cAAYsM,aAAAC,iCAM6B,WAIhD,OAHArF,QAAQC,KACN,kEAEKtI,eAAayN,aAAAC"}
|
|
@@ -82,6 +82,49 @@ function registerConditionGuard(loader, customConditionGuardMeta) {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
86
|
+
try {
|
|
87
|
+
var i = n[a](c),
|
|
88
|
+
u = i.value;
|
|
89
|
+
} catch (n) {
|
|
90
|
+
return void e(n);
|
|
91
|
+
}
|
|
92
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
93
|
+
}
|
|
94
|
+
function _asyncToGenerator(n) {
|
|
95
|
+
return function () {
|
|
96
|
+
var t = this,
|
|
97
|
+
e = arguments;
|
|
98
|
+
return new Promise(function (r, o) {
|
|
99
|
+
var a = n.apply(t, e);
|
|
100
|
+
function _next(n) {
|
|
101
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
102
|
+
}
|
|
103
|
+
function _throw(n) {
|
|
104
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
105
|
+
}
|
|
106
|
+
_next(void 0);
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function _extends() {
|
|
111
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
112
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
113
|
+
var t = arguments[e];
|
|
114
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
115
|
+
}
|
|
116
|
+
return n;
|
|
117
|
+
}, _extends.apply(null, arguments);
|
|
118
|
+
}
|
|
119
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
120
|
+
if (null == r) return {};
|
|
121
|
+
var t = {};
|
|
122
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
123
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
124
|
+
t[n] = r[n];
|
|
125
|
+
}
|
|
126
|
+
return t;
|
|
127
|
+
}
|
|
85
128
|
function _regeneratorRuntime() {
|
|
86
129
|
_regeneratorRuntime = function () {
|
|
87
130
|
return e;
|
|
@@ -190,7 +233,7 @@ function _regeneratorRuntime() {
|
|
|
190
233
|
function makeInvokeMethod(e, r, n) {
|
|
191
234
|
var o = h;
|
|
192
235
|
return function (i, a) {
|
|
193
|
-
if (o === f) throw
|
|
236
|
+
if (o === f) throw Error("Generator is already running");
|
|
194
237
|
if (o === s) {
|
|
195
238
|
if ("throw" === i) throw a;
|
|
196
239
|
return {
|
|
@@ -332,7 +375,7 @@ function _regeneratorRuntime() {
|
|
|
332
375
|
} else if (c) {
|
|
333
376
|
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
334
377
|
} else {
|
|
335
|
-
if (!u) throw
|
|
378
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
336
379
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
337
380
|
}
|
|
338
381
|
}
|
|
@@ -372,7 +415,7 @@ function _regeneratorRuntime() {
|
|
|
372
415
|
return o;
|
|
373
416
|
}
|
|
374
417
|
}
|
|
375
|
-
throw
|
|
418
|
+
throw Error("illegal catch attempt");
|
|
376
419
|
},
|
|
377
420
|
delegateYield: function (e, r, n) {
|
|
378
421
|
return this.delegate = {
|
|
@@ -383,62 +426,6 @@ function _regeneratorRuntime() {
|
|
|
383
426
|
}
|
|
384
427
|
}, e;
|
|
385
428
|
}
|
|
386
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
387
|
-
try {
|
|
388
|
-
var info = gen[key](arg);
|
|
389
|
-
var value = info.value;
|
|
390
|
-
} catch (error) {
|
|
391
|
-
reject(error);
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
if (info.done) {
|
|
395
|
-
resolve(value);
|
|
396
|
-
} else {
|
|
397
|
-
Promise.resolve(value).then(_next, _throw);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
function _asyncToGenerator(fn) {
|
|
401
|
-
return function () {
|
|
402
|
-
var self = this,
|
|
403
|
-
args = arguments;
|
|
404
|
-
return new Promise(function (resolve, reject) {
|
|
405
|
-
var gen = fn.apply(self, args);
|
|
406
|
-
function _next(value) {
|
|
407
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
408
|
-
}
|
|
409
|
-
function _throw(err) {
|
|
410
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
411
|
-
}
|
|
412
|
-
_next(undefined);
|
|
413
|
-
});
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
function _extends() {
|
|
417
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
418
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
419
|
-
var source = arguments[i];
|
|
420
|
-
for (var key in source) {
|
|
421
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
422
|
-
target[key] = source[key];
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
return target;
|
|
427
|
-
};
|
|
428
|
-
return _extends.apply(this, arguments);
|
|
429
|
-
}
|
|
430
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
431
|
-
if (source == null) return {};
|
|
432
|
-
var target = {};
|
|
433
|
-
var sourceKeys = Object.keys(source);
|
|
434
|
-
var key, i;
|
|
435
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
436
|
-
key = sourceKeys[i];
|
|
437
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
438
|
-
target[key] = source[key];
|
|
439
|
-
}
|
|
440
|
-
return target;
|
|
441
|
-
}
|
|
442
429
|
|
|
443
430
|
var _excluded = ["tag", "className", "children", "propSelectors"],
|
|
444
431
|
_excluded2 = ["selector", "propSelectors"],
|
|
@@ -722,8 +709,9 @@ function Embed(_ref) {
|
|
|
722
709
|
return;
|
|
723
710
|
}
|
|
724
711
|
// Load scripts sequentially one at a time, since later scripts can depend on earlier ones.
|
|
712
|
+
var cleanup = false;
|
|
725
713
|
_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
726
|
-
var _loop, _i, _Array$from;
|
|
714
|
+
var _loop, _ret, _i, _Array$from;
|
|
727
715
|
return _regeneratorRuntime().wrap(function _callee$(_context2) {
|
|
728
716
|
while (1) switch (_context2.prev = _context2.next) {
|
|
729
717
|
case 0:
|
|
@@ -743,7 +731,7 @@ function Embed(_ref) {
|
|
|
743
731
|
ensure(oldScript.parentNode).replaceChild(newScript, oldScript);
|
|
744
732
|
// Only scripts with src will ever fire a load event.
|
|
745
733
|
if (!newScript.src) {
|
|
746
|
-
_context.next =
|
|
734
|
+
_context.next = 11;
|
|
747
735
|
break;
|
|
748
736
|
}
|
|
749
737
|
_context.next = 9;
|
|
@@ -751,6 +739,14 @@ function Embed(_ref) {
|
|
|
751
739
|
return newScript.addEventListener("load", resolve);
|
|
752
740
|
});
|
|
753
741
|
case 9:
|
|
742
|
+
if (!cleanup) {
|
|
743
|
+
_context.next = 11;
|
|
744
|
+
break;
|
|
745
|
+
}
|
|
746
|
+
return _context.abrupt("return", {
|
|
747
|
+
v: void 0
|
|
748
|
+
});
|
|
749
|
+
case 11:
|
|
754
750
|
case "end":
|
|
755
751
|
return _context.stop();
|
|
756
752
|
}
|
|
@@ -759,21 +755,32 @@ function Embed(_ref) {
|
|
|
759
755
|
_i = 0, _Array$from = Array.from(ensure(rootElt.current).querySelectorAll("script"));
|
|
760
756
|
case 2:
|
|
761
757
|
if (!(_i < _Array$from.length)) {
|
|
762
|
-
_context2.next =
|
|
758
|
+
_context2.next = 10;
|
|
763
759
|
break;
|
|
764
760
|
}
|
|
765
761
|
return _context2.delegateYield(_loop(), "t0", 4);
|
|
766
762
|
case 4:
|
|
763
|
+
_ret = _context2.t0;
|
|
764
|
+
if (!_ret) {
|
|
765
|
+
_context2.next = 7;
|
|
766
|
+
break;
|
|
767
|
+
}
|
|
768
|
+
return _context2.abrupt("return", _ret.v);
|
|
769
|
+
case 7:
|
|
767
770
|
_i++;
|
|
768
771
|
_context2.next = 2;
|
|
769
772
|
break;
|
|
770
|
-
case
|
|
773
|
+
case 10:
|
|
774
|
+
return _context2.abrupt("return", function () {
|
|
775
|
+
cleanup = true;
|
|
776
|
+
});
|
|
777
|
+
case 11:
|
|
771
778
|
case "end":
|
|
772
779
|
return _context2.stop();
|
|
773
780
|
}
|
|
774
781
|
}, _callee);
|
|
775
782
|
}))();
|
|
776
|
-
}, [htmlId,
|
|
783
|
+
}, [htmlId, code, hideInEditor, inEditor]);
|
|
777
784
|
var effectiveCode = hideInEditor && inEditor ? "" : inEditor || !htmlId ? code : addIdentifierScript(htmlId, code);
|
|
778
785
|
return React.createElement("div", {
|
|
779
786
|
ref: rootElt,
|