@plasmicpkgs/plasmic-basic-components 0.0.2 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Data.d.ts +32 -59
- package/dist/Embed.d.ts +5 -3
- package/dist/Iframe.d.ts +8 -3
- package/dist/ScrollRevealer.d.ts +12 -6
- package/dist/Video.d.ts +6 -0
- package/dist/index.d.ts +3 -1
- package/dist/plasmic-basic-components.cjs.development.js +151 -172
- 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 +134 -169
- package/dist/plasmic-basic-components.esm.js.map +1 -1
- package/package.json +4 -13
- package/Data/dist/Data.d.ts +0 -97
- package/Data/dist/common.d.ts +0 -2
- package/Data/dist/index.cjs.js +0 -267
- package/Data/dist/index.cjs.js.map +0 -1
- package/Data/dist/index.esm.js +0 -246
- package/Data/dist/index.esm.js.map +0 -1
- package/Data/package.json +0 -6
- package/Embed/dist/Embed.d.ts +0 -8
- package/Embed/dist/common.d.ts +0 -2
- package/Embed/dist/index.cjs.js +0 -64
- package/Embed/dist/index.cjs.js.map +0 -1
- package/Embed/dist/index.esm.js +0 -55
- package/Embed/dist/index.esm.js.map +0 -1
- package/Embed/package.json +0 -6
- package/Iframe/dist/Iframe.d.ts +0 -8
- package/Iframe/dist/index.cjs.js +0 -62
- package/Iframe/dist/index.cjs.js.map +0 -1
- package/Iframe/dist/index.esm.js +0 -53
- package/Iframe/dist/index.esm.js.map +0 -1
- package/Iframe/package.json +0 -6
- package/ScrollRevealer/dist/ScrollRevealer.d.ts +0 -20
- package/ScrollRevealer/dist/index.cjs.js +0 -87
- package/ScrollRevealer/dist/index.cjs.js.map +0 -1
- package/ScrollRevealer/dist/index.esm.js +0 -77
- package/ScrollRevealer/dist/index.esm.js.map +0 -1
- package/ScrollRevealer/package.json +0 -6
- package/Video/dist/Video.d.ts +0 -3
- package/Video/dist/index.cjs.js +0 -100
- package/Video/dist/index.cjs.js.map +0 -1
- package/Video/dist/index.esm.js +0 -91
- package/Video/dist/index.esm.js.map +0 -1
- package/Video/package.json +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plasmic-basic-components.esm.js","sources":["../src/common.ts","../src/Data.tsx","../src/Embed.tsx","../src/Iframe.tsx","../src/ScrollRevealer.tsx","../src/Video.tsx"],"sourcesContent":["export 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","/** @format */\n\nimport { repeatedElement } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, {\n ComponentProps,\n createContext,\n createElement,\n CSSProperties,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n name?: string;\n data?: any;\n children?: ReactNode;\n}\n\nexport function DataProvider({ name, data, children }: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider value={{ ...existingEnv, [name]: data }}>\n {children}\n </DataContext.Provider>\n );\n }\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 function DynamicText({\n selector,\n propSelectors,\n ...props\n}: CommonDynamicProps & {\n selector?: string;\n}) {\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 function DynamicImage({\n selector,\n propSelectors,\n ...props\n}: CommonDynamicProps &\n ComponentProps<\"img\"> & {\n selector?: string;\n }) {\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 DynamicCollectionProps extends CommonDynamicProps {\n children?: ReactNode;\n style?: CSSProperties;\n loopItemName?: string;\n keySelector?: string;\n selector?: string;\n data?: any;\n}\n\nexport function DynamicCollection({\n selector,\n loopItemName,\n children,\n data,\n keySelector,\n ...props\n}: DynamicCollectionProps) {\n // Defaults to an array of three items.\n const finalData = data ?? useSelector(selector) ?? [1, 2, 3];\n return (\n <DynamicElement {...props}>\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 === 0, children)}\n </DataProvider>\n ))}\n </DynamicElement>\n );\n}\n\nexport interface DynamicCollectionGridProps extends DynamicCollectionProps {\n columns?: number;\n columnGap?: number;\n rowGap?: number;\n}\n\nexport function DynamicCollectionGrid({\n columns,\n columnGap = 0,\n rowGap = 0,\n ...props\n}: DynamicCollectionGridProps) {\n return (\n <DynamicCollection\n {...props}\n style={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${columns}, 1fr)`,\n columnGap: `${columnGap}px`,\n rowGap: `${rowGap}px`,\n }}\n />\n );\n}\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components/Data\";\n\nregisterComponent(DataProvider, {\n name: \"DataProvider\",\n importPath: thisModule,\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 defaultValue: [\n {\n type: \"component\",\n name: \"DynamicText\",\n props: {\n selector: \"celebrities.0.name\",\n },\n },\n {\n type: \"component\",\n name: \"DynamicImage\",\n props: {\n selector: \"celebrities.0.profilePicture\",\n },\n },\n ],\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\nregisterComponent(DynamicElement, {\n name: \"DynamicElement\",\n importPath: thisModule,\n props: { ...dynamicProps, children: \"slot\" },\n});\n\nregisterComponent(DynamicText, {\n name: \"DynamicText\",\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\nregisterComponent(DynamicImage, {\n name: \"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 const dynamicCollectionProps = {\n ...dynamicProps,\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: \"slot\",\n} as const;\n\nregisterComponent(DynamicCollection, {\n name: \"DynamicCollection\",\n importPath: thisModule,\n props: dynamicCollectionProps,\n});\n\nexport const dynamicCollectionGridProps = {\n ...dynamicCollectionProps,\n columns: {\n type: \"number\",\n defaultValue: 2,\n description: \"The number of columns to use in the grid\",\n },\n columnGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between columns\",\n },\n rowGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between rows\",\n },\n} as const;\n\nregisterComponent(DynamicCollectionGrid, {\n name: \"DynamicCollectionGrid\",\n importPath: thisModule,\n props: dynamicCollectionGridProps,\n});\n","/** @format */\n\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useRef } from \"react\";\nimport { ensure } from \"./common\";\n\nexport interface EmbedProps {\n className?: string;\n code: string;\n hideInEditor?: boolean;\n}\n\nexport default function Embed({\n className,\n code,\n hideInEditor = false,\n}: EmbedProps) {\n const rootElt = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (hideInEditor) {\n return;\n }\n Array.from(ensure(rootElt.current).querySelectorAll(\"script\")).forEach(\n (oldScript) => {\n const newScript = document.createElement(\"script\");\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 }\n );\n }, [code, hideInEditor]);\n const effectiveCode = hideInEditor ? \"\" : code;\n return (\n <div\n ref={rootElt}\n className={className}\n dangerouslySetInnerHTML={{ __html: effectiveCode }}\n />\n );\n}\n\nregisterComponent(Embed, {\n name: \"Embed\",\n importPath: \"@plasmicpkgs/plasmic-basic-components/Embed\",\n props: {\n code: {\n type: \"string\",\n defaultValue: \"https://www.example.com\",\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 },\n },\n isDefaultExport: true,\n defaultStyles: {\n maxWidth: \"100%\",\n },\n});\n","/** @format */\n\nimport { PlasmicCanvasContext } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { useContext } from \"react\";\n\nexport interface IframeProps {\n src: string;\n hideInEditor?: boolean;\n className?: string;\n}\n\nexport default function Iframe({ hideInEditor, src, className }: IframeProps) {\n const isEditing = useContext(PlasmicCanvasContext);\n if (isEditing && !hideInEditor) {\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} />;\n}\n\nregisterComponent(Iframe, {\n name: \"Iframe\",\n importPath: \"@plasmicpkgs/plasmic-basic-components/Iframe\",\n props: {\n src: {\n type: \"string\",\n defaultValue: \"https://www.example.com\",\n },\n hideInEditor: {\n type: \"boolean\",\n displayName: \"Preview\",\n description: \"Load the iframe while editing in Plasmic Studio\",\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n width: \"300px\",\n height: \"150px\",\n maxWidth: \"100%\",\n },\n});\n","import registerComponent 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\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}: {\n children?: ReactNode;\n className?: string;\n scrollUpThreshold?: number;\n scrollDownThreshold?: number;\n}) {\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\nregisterComponent(ScrollRevealer, {\n name: \"ScrollRevealer\",\n displayName: \"Scroll Revealer\",\n importPath: \"@plasmicpkgs/plasmic-basic-components/ScrollRevealer\",\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 isDefaultExport: true,\n defaultStyles: {\n width: \"stretch\",\n maxWidth: \"100%\",\n },\n});\n","import registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\ntype 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\nregisterComponent(Video, {\n name: \"Video\",\n importPath: \"@plasmicpkgs/plasmic-basic-components/Video\",\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\",\n },\n controls: {\n type: \"boolean\",\n displayName: \"Show Controls\",\n description: \"Whether the video player controls should be displayed\",\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 // TODO enable this once image is a type\n // poster: {\n // type: \"image\",\n // displayName: \"Poster (placeholder) image\",\n // description:\n // \"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 isDefaultExport: true,\n defaultStyles: {\n height: \"hug\",\n width: \"640px\",\n maxWidth: \"100%\",\n },\n});\n"],"names":["tuple","args","ensure","x","undefined","Error","DataContext","createContext","applySelector","rawData","selector","curData","split","key","useSelector","useDataEnv","useSelectors","selectors","Object","fromEntries","entries","filter","map","useContext","DataProvider","name","data","children","existingEnv","React","Provider","value","DynamicElement","tag","className","propSelectors","props","computed","createElement","DynamicText","DynamicImage","loading","style","objectFit","src","DynamicCollection","loopItemName","keySelector","finalData","item","index","repeatedElement","DynamicCollectionGrid","columns","columnGap","rowGap","display","gridTemplateColumns","thisModule","registerComponent","importPath","type","defaultValue","description","birthYear","profilePicture","dynamicPropsWithoutTag","dynamicProps","dynamicCollectionProps","dynamicCollectionGridProps","Embed","code","hideInEditor","rootElt","useRef","useEffect","Array","from","current","querySelectorAll","forEach","oldScript","newScript","document","attributes","attr","setAttribute","appendChild","createTextNode","innerHTML","parentNode","replaceChild","effectiveCode","ref","dangerouslySetInnerHTML","__html","displayName","isDefaultExport","defaultStyles","maxWidth","Iframe","isEditing","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","alignItems","justifyContent","overflow","width","height","useDirectionalIntersection","scrollDownThreshold","scrollUpThreshold","useState","revealed","setRevealed","IntersectionObserver","handler","intersectionRatio","observer","root","rootMargin","threshold","observe","disconnect","ScrollRevealer","intersectionRef","Video","forwardRef","autoPlay","controls","playsInline","loop","muted","preload","options"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,KAAK,GAAG,SAARA,KAAQ;AAAA,oCAAqBC,IAArB;AAAqBA,IAAAA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AAAA,IAAI,EAAE,SADE;AAERmC,MAAAA,WAAW,EAAE,eAFL;AAGRjC,MAAAA,WAAW,EAAE;AAHL,KAdL;AAmBL4E,IAAAA,WAAW,EAAE;AACX9E,MAAAA,IAAI,EAAE,SADK;AAEXmC,MAAAA,WAAW,EAAE,cAFF;AAGXjC,MAAAA,WAAW,EACT;AAJS,KAnBR;AAyBL6E,IAAAA,IAAI,EAAE;AACJ/E,MAAAA,IAAI,EAAE,SADF;AAEJmC,MAAAA,WAAW,EAAE,MAFT;AAGJjC,MAAAA,WAAW,EAAE;AAHT,KAzBD;AA8BL8E,IAAAA,KAAK,EAAE;AACLhF,MAAAA,IAAI,EAAE,SADD;AAELmC,MAAAA,WAAW,EAAE,OAFR;AAGLjC,MAAAA,WAAW,EAAE;AAHR,KA9BF;AAmCL;AACA;AACA;AACA;AACA;AACA;AACA;AACA+E,IAAAA,OAAO,EAAE;AACPjF,MAAAA,IAAI,EAAE,QADC;AAEPkF,MAAAA,OAAO,EAAE,CAAC,MAAD,EAAS,UAAT,EAAqB,MAArB,CAFF;AAGP/C,MAAAA,WAAW,EAAE,SAHN;AAIPjC,MAAAA,WAAW,EACT;AALK;AA1CJ,GAHgB;AAqDvBkC,EAAAA,eAAe,EAAE,IArDM;AAsDvBC,EAAAA,aAAa,EAAE;AACbmB,IAAAA,MAAM,EAAE,KADK;AAEbD,IAAAA,KAAK,EAAE,OAFM;AAGbjB,IAAAA,QAAQ,EAAE;AAHG;AAtDQ,CAAR,CAAjB;;;;"}
|
|
1
|
+
{"version":3,"file":"plasmic-basic-components.esm.js","sources":["../src/common.ts","../src/Data.tsx","../src/Iframe.tsx","../src/ScrollRevealer.tsx","../src/Video.tsx"],"sourcesContent":["export 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","import { ComponentMeta, repeatedElement } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, {\n ComponentProps,\n createContext,\n createElement,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components\";\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n name?: string;\n data?: any;\n children?: ReactNode;\n}\n\nexport function DataProvider({ name, data, children }: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider value={{ ...existingEnv, [name]: data }}>\n {children}\n </DataContext.Provider>\n );\n }\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 === 0, 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: \"slot\",\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 // 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 defaultValue: [\n {\n type: \"component\",\n name: \"hostless-dynamic-text\",\n props: {\n selector: \"celebrities.0.name\",\n },\n },\n {\n type: \"component\",\n name: \"hostless-dynamic-image\",\n props: {\n selector: \"celebrities.0.profilePicture\",\n },\n },\n ],\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(DataProvider, customDataProviderMeta ?? dataProviderMeta);\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 { 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}\n\nexport default function Iframe({ preview, src, className }: 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} />;\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 },\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 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 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\",\n },\n controls: {\n type: \"boolean\",\n displayName: \"Show Controls\",\n description: \"Whether the video player controls should be displayed\",\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":["tuple","args","DataContext","createContext","undefined","thisModule","applySelector","rawData","selector","curData","split","key","useSelector","useDataEnv","useSelectors","selectors","Object","fromEntries","entries","filter","map","useContext","DataProvider","name","data","children","existingEnv","React","Provider","value","DynamicElement","tag","className","propSelectors","props","computed","createElement","DynamicText","DynamicImage","loading","style","objectFit","src","DynamicRepeater","loopItemName","keySelector","finalData","item","index","repeatedElement","dynamicRepeaterProps","type","description","defaultValue","dynamicRepeaterMeta","displayName","importName","importPath","registerDynamicRepeater","loader","customDynamicRepeaterMeta","registerComponent","dataProviderMeta","birthYear","profilePicture","registerDataProvider","customDataProviderMeta","dynamicPropsWithoutTag","defaultValueHint","dynamicProps","dynamicElementMeta","registerDynamicElement","customDynamicElementMeta","dynamicTextMeta","registerDynamicText","customDynamicTextMeta","dynamicImageMeta","registerDynamicImage","customDynamicImageMeta","Iframe","preview","isEditing","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","display","alignItems","justifyContent","overflow","iframeMeta","defaultStyles","width","height","maxWidth","registerIframe","customIframeMeta","useDirectionalIntersection","ref","scrollDownThreshold","scrollUpThreshold","useState","revealed","setRevealed","useEffect","current","IntersectionObserver","handler","intersectionRatio","observer","root","rootMargin","threshold","observe","disconnect","ScrollRevealer","intersectionRef","useRef","scrollRevealerMeta","registerScrollRevealer","customScrollRevealerMeta","Video","forwardRef","videoMeta","autoPlay","controls","playsInline","loop","muted","poster","preload","options","registerVideo","customVideoMeta"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,KAAK,GAAG,SAARA,KAAQ;AAAA,oCAAqBC,IAArB;AAAqBA,IAAAA,IAArB;AAAA;;AAAA,SAAoCA,IAApC;AAAA,CAAd;;ICaMC,WAAW,gBAAGC,aAAa,CAAuBC,SAAvB,CAAjC;AAEP,IAAMC,UAAU,GAAG,uCAAnB;AAEA,SAAgBC,cACdC,SACAC;AAEA,MAAI,CAACA,QAAL,EAAe;AACb,WAAOJ,SAAP;AACD;;AACD,MAAIK,OAAO,GAAGF,OAAd;;AACA,uDAAkBC,QAAQ,CAACE,KAAT,CAAe,GAAf,CAAlB,wCAAuC;AAAA;;AAAA,QAA5BC,GAA4B;AACrCF,IAAAA,OAAO,eAAGA,OAAH,qBAAG,SAAUE,GAAV,CAAV;AACD;;AACD,SAAOF,OAAP;AACD;AAID,SAAgBG,YAAYJ;AAC1B,MAAMD,OAAO,GAAGM,UAAU,EAA1B;AACA,SAAOP,aAAa,CAACC,OAAD,EAAUC,QAAV,CAApB;AACD;AAED,SAAgBM,aAAaC;MAAAA;AAAAA,IAAAA,YAA0B;;;AACrD,MAAMR,OAAO,GAAGM,UAAU,EAA1B;AACA,SAAOG,MAAM,CAACC,WAAP,CACLD,MAAM,CAACE,OAAP,CAAeH,SAAf,EACGI,MADH,CACU;AAAA,QAAER,GAAF;AAAA,QAAOH,QAAP;AAAA,WAAqB,CAAC,CAACG,GAAF,IAAS,CAAC,CAACH,QAAhC;AAAA,GADV,EAEGY,GAFH,CAEO;AAAA,QAAET,GAAF;AAAA,QAAOH,QAAP;AAAA,WAAqBR,KAAK,CAACW,GAAD,EAAML,aAAa,CAACC,OAAD,EAAUC,QAAV,CAAnB,CAA1B;AAAA,GAFP,CADK,CAAP;AAKD;AAED,SAAgB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IAAAA,IAAI,EAAE;AACJnF,MAAAA,IAAI,EAAE,SADF;AAEJI,MAAAA,WAAW,EAAE,MAFT;AAGJH,MAAAA,WAAW,EAAE;AAHT,KAzBD;AA8BLmF,IAAAA,KAAK,EAAE;AACLpF,MAAAA,IAAI,EAAE,SADD;AAELI,MAAAA,WAAW,EAAE,OAFR;AAGLH,MAAAA,WAAW,EAAE;AAHR,KA9BF;AAmCLoF,IAAAA,MAAM,EAAE;AACNrF,MAAAA,IAAI,EAAE,UADA;AAENI,MAAAA,WAAW,EAAE,4BAFP;AAGNH,MAAAA,WAAW,EAAE;AAHP,KAnCH;AAwCLqF,IAAAA,OAAO,EAAE;AACPtF,MAAAA,IAAI,EAAE,QADC;AAEPuF,MAAAA,OAAO,EAAE,CAAC,MAAD,EAAS,UAAT,EAAqB,MAArB,CAFF;AAGPnF,MAAAA,WAAW,EAAE,SAHN;AAIPH,MAAAA,WAAW,EACT;AALK;AAxCJ,GAL2C;AAqDlD8C,EAAAA,aAAa,EAAE;AACbE,IAAAA,MAAM,EAAE,KADK;AAEbD,IAAAA,KAAK,EAAE,OAFM;AAGbE,IAAAA,QAAQ,EAAE;AAHG;AArDmC,CAA7C;AA4DP,SAAgBsC,cACdhF,QACAiF;AAEA,MAAIjF,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyBmE,KAAzB,EAAgCY,eAAhC,WAAgCA,eAAhC,GAAmDV,SAAnD;AACD,GAFD,MAEO;AACLrE,IAAAA,iBAAiB,CAACmE,KAAD,EAAQY,eAAR,WAAQA,eAAR,GAA2BV,SAA3B,CAAjB;AACD;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/plasmic-basic-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Plasmic registration call for the HTML5 video element",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"module": "dist/plasmic-basic-components.esm.js",
|
|
8
8
|
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
"Data",
|
|
11
|
-
"Embed",
|
|
12
|
-
"Iframe",
|
|
13
|
-
"ScrollRevealer",
|
|
14
|
-
"Video"
|
|
9
|
+
"dist"
|
|
15
10
|
],
|
|
16
11
|
"size-limit": [
|
|
17
12
|
{
|
|
@@ -24,7 +19,7 @@
|
|
|
24
19
|
}
|
|
25
20
|
],
|
|
26
21
|
"scripts": {
|
|
27
|
-
"build": "tsdx build
|
|
22
|
+
"build": "tsdx build",
|
|
28
23
|
"start": "tsdx watch",
|
|
29
24
|
"test": "tsdx test --passWithNoTests",
|
|
30
25
|
"lint": "tsdx lint",
|
|
@@ -33,19 +28,15 @@
|
|
|
33
28
|
"analyze": "size-limit --why"
|
|
34
29
|
},
|
|
35
30
|
"devDependencies": {
|
|
36
|
-
"@rollup/plugin-commonjs": "^19.0.0",
|
|
37
|
-
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
38
31
|
"@size-limit/preset-small-lib": "^4.11.0",
|
|
39
32
|
"@types/node": "^14.0.26",
|
|
40
|
-
"rollup": "^2.47.0",
|
|
41
|
-
"rollup-plugin-typescript2": "^0.30.0",
|
|
42
33
|
"size-limit": "^4.11.0",
|
|
43
34
|
"tsdx": "^0.14.1",
|
|
44
35
|
"tslib": "^2.2.0",
|
|
45
36
|
"typescript": "^3.9.7"
|
|
46
37
|
},
|
|
47
38
|
"dependencies": {
|
|
48
|
-
"@plasmicapp/host": "^0.0
|
|
39
|
+
"@plasmicapp/host": "^1.0.0"
|
|
49
40
|
},
|
|
50
41
|
"peerDependencies": {
|
|
51
42
|
"react": ">=16.8.0",
|
package/Data/dist/Data.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/** @format */
|
|
2
|
-
import React, { ComponentProps, CSSProperties, ReactNode } from "react";
|
|
3
|
-
export declare type DataDict = Record<string, any>;
|
|
4
|
-
export declare const DataContext: React.Context<Record<string, any> | undefined>;
|
|
5
|
-
export declare function applySelector(rawData: DataDict | undefined, selector: string | undefined): any;
|
|
6
|
-
export declare type SelectorDict = Record<string, string | undefined>;
|
|
7
|
-
export declare function useSelector(selector: string | undefined): any;
|
|
8
|
-
export declare function useSelectors(selectors?: SelectorDict): any;
|
|
9
|
-
export declare function useDataEnv(): Record<string, any> | undefined;
|
|
10
|
-
export interface DataProviderProps {
|
|
11
|
-
name?: string;
|
|
12
|
-
data?: any;
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
}
|
|
15
|
-
export declare function DataProvider({ name, data, children }: DataProviderProps): JSX.Element;
|
|
16
|
-
export interface CommonDynamicProps {
|
|
17
|
-
className?: string;
|
|
18
|
-
tag?: string;
|
|
19
|
-
propSelectors?: SelectorDict;
|
|
20
|
-
}
|
|
21
|
-
export declare function DynamicElement<Tag extends keyof JSX.IntrinsicElements = "div">({ tag, className, children, propSelectors, ...props }: CommonDynamicProps & ComponentProps<Tag>): React.DOMElement<any, Element>;
|
|
22
|
-
export declare function DynamicText({ selector, propSelectors, ...props }: CommonDynamicProps & {
|
|
23
|
-
selector?: string;
|
|
24
|
-
}): JSX.Element;
|
|
25
|
-
export declare function DynamicImage({ selector, propSelectors, ...props }: CommonDynamicProps & ComponentProps<"img"> & {
|
|
26
|
-
selector?: string;
|
|
27
|
-
}): JSX.Element;
|
|
28
|
-
export interface DynamicCollectionProps extends CommonDynamicProps {
|
|
29
|
-
children?: ReactNode;
|
|
30
|
-
style?: CSSProperties;
|
|
31
|
-
loopItemName?: string;
|
|
32
|
-
keySelector?: string;
|
|
33
|
-
selector?: string;
|
|
34
|
-
data?: any;
|
|
35
|
-
}
|
|
36
|
-
export declare function DynamicCollection({ selector, loopItemName, children, data, keySelector, ...props }: DynamicCollectionProps): JSX.Element;
|
|
37
|
-
export interface DynamicCollectionGridProps extends DynamicCollectionProps {
|
|
38
|
-
columns?: number;
|
|
39
|
-
columnGap?: number;
|
|
40
|
-
rowGap?: number;
|
|
41
|
-
}
|
|
42
|
-
export declare function DynamicCollectionGrid({ columns, columnGap, rowGap, ...props }: DynamicCollectionGridProps): JSX.Element;
|
|
43
|
-
export declare const dynamicCollectionProps: {
|
|
44
|
-
readonly selector: {
|
|
45
|
-
readonly type: "string";
|
|
46
|
-
readonly description: "The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField";
|
|
47
|
-
};
|
|
48
|
-
readonly loopItemName: {
|
|
49
|
-
readonly type: "string";
|
|
50
|
-
readonly defaultValue: "item";
|
|
51
|
-
readonly description: "The name of the variable to use to store the current item in the loop";
|
|
52
|
-
};
|
|
53
|
-
readonly children: "slot";
|
|
54
|
-
readonly tag: {
|
|
55
|
-
readonly type: "string";
|
|
56
|
-
readonly description: "The HTML tag to use";
|
|
57
|
-
};
|
|
58
|
-
readonly propSelectors: {
|
|
59
|
-
readonly type: "object";
|
|
60
|
-
readonly description: "An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value.";
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
export declare const dynamicCollectionGridProps: {
|
|
64
|
-
readonly columns: {
|
|
65
|
-
readonly type: "number";
|
|
66
|
-
readonly defaultValue: 2;
|
|
67
|
-
readonly description: "The number of columns to use in the grid";
|
|
68
|
-
};
|
|
69
|
-
readonly columnGap: {
|
|
70
|
-
readonly type: "number";
|
|
71
|
-
readonly defaultValue: 8;
|
|
72
|
-
readonly description: "The gap between columns";
|
|
73
|
-
};
|
|
74
|
-
readonly rowGap: {
|
|
75
|
-
readonly type: "number";
|
|
76
|
-
readonly defaultValue: 8;
|
|
77
|
-
readonly description: "The gap between rows";
|
|
78
|
-
};
|
|
79
|
-
readonly selector: {
|
|
80
|
-
readonly type: "string";
|
|
81
|
-
readonly description: "The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField";
|
|
82
|
-
};
|
|
83
|
-
readonly loopItemName: {
|
|
84
|
-
readonly type: "string";
|
|
85
|
-
readonly defaultValue: "item";
|
|
86
|
-
readonly description: "The name of the variable to use to store the current item in the loop";
|
|
87
|
-
};
|
|
88
|
-
readonly children: "slot";
|
|
89
|
-
readonly tag: {
|
|
90
|
-
readonly type: "string";
|
|
91
|
-
readonly description: "The HTML tag to use";
|
|
92
|
-
};
|
|
93
|
-
readonly propSelectors: {
|
|
94
|
-
readonly type: "object";
|
|
95
|
-
readonly description: "An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value.";
|
|
96
|
-
};
|
|
97
|
-
};
|
package/Data/dist/common.d.ts
DELETED
package/Data/dist/index.cjs.js
DELETED
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var host = require('@plasmicapp/host');
|
|
6
|
-
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var registerComponent__default = /*#__PURE__*/_interopDefaultLegacy(registerComponent);
|
|
12
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
-
|
|
14
|
-
/*! *****************************************************************************
|
|
15
|
-
Copyright (c) Microsoft Corporation.
|
|
16
|
-
|
|
17
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
18
|
-
purpose with or without fee is hereby granted.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
21
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
22
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
23
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
24
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
25
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
26
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
27
|
-
***************************************************************************** */
|
|
28
|
-
|
|
29
|
-
var __assign = function() {
|
|
30
|
-
__assign = Object.assign || function __assign(t) {
|
|
31
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
32
|
-
s = arguments[i];
|
|
33
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
34
|
-
}
|
|
35
|
-
return t;
|
|
36
|
-
};
|
|
37
|
-
return __assign.apply(this, arguments);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
function __rest(s, e) {
|
|
41
|
-
var t = {};
|
|
42
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
43
|
-
t[p] = s[p];
|
|
44
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
45
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
46
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
47
|
-
t[p[i]] = s[p[i]];
|
|
48
|
-
}
|
|
49
|
-
return t;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
var tuple = function () {
|
|
53
|
-
var args = [];
|
|
54
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
55
|
-
args[_i] = arguments[_i];
|
|
56
|
-
}
|
|
57
|
-
return args;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/** @format */
|
|
61
|
-
var DataContext = React.createContext(undefined);
|
|
62
|
-
function applySelector(rawData, selector) {
|
|
63
|
-
if (!selector) {
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
var curData = rawData;
|
|
67
|
-
for (var _i = 0, _a = selector.split("."); _i < _a.length; _i++) {
|
|
68
|
-
var key = _a[_i];
|
|
69
|
-
curData = curData === null || curData === void 0 ? void 0 : curData[key];
|
|
70
|
-
}
|
|
71
|
-
return curData;
|
|
72
|
-
}
|
|
73
|
-
function useSelector(selector) {
|
|
74
|
-
var rawData = useDataEnv();
|
|
75
|
-
return applySelector(rawData, selector);
|
|
76
|
-
}
|
|
77
|
-
function useSelectors(selectors) {
|
|
78
|
-
if (selectors === void 0) { selectors = {}; }
|
|
79
|
-
var rawData = useDataEnv();
|
|
80
|
-
return Object.fromEntries(Object.entries(selectors)
|
|
81
|
-
.filter(function (_a) {
|
|
82
|
-
var key = _a[0], selector = _a[1];
|
|
83
|
-
return !!key && !!selector;
|
|
84
|
-
})
|
|
85
|
-
.map(function (_a) {
|
|
86
|
-
var key = _a[0], selector = _a[1];
|
|
87
|
-
return tuple(key, applySelector(rawData, selector));
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
|
-
function useDataEnv() {
|
|
91
|
-
return React.useContext(DataContext);
|
|
92
|
-
}
|
|
93
|
-
function DataProvider(_a) {
|
|
94
|
-
var _b;
|
|
95
|
-
var _c;
|
|
96
|
-
var name = _a.name, data = _a.data, children = _a.children;
|
|
97
|
-
var existingEnv = (_c = useDataEnv()) !== null && _c !== void 0 ? _c : {};
|
|
98
|
-
if (!name) {
|
|
99
|
-
return React__default["default"].createElement(React__default["default"].Fragment, null, children);
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
return (React__default["default"].createElement(DataContext.Provider, { value: __assign(__assign({}, existingEnv), (_b = {}, _b[name] = data, _b)) }, children));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
function DynamicElement(_a) {
|
|
106
|
-
var _b = _a.tag, tag = _b === void 0 ? "div" : _b, className = _a.className, children = _a.children, propSelectors = _a.propSelectors, props = __rest(_a, ["tag", "className", "children", "propSelectors"]);
|
|
107
|
-
var computed = useSelectors(propSelectors);
|
|
108
|
-
return React.createElement(tag, __assign(__assign(__assign({ children: children }, props), computed), { className: className + " " + computed.className }));
|
|
109
|
-
}
|
|
110
|
-
function DynamicText(_a) {
|
|
111
|
-
var selector = _a.selector, propSelectors = _a.propSelectors, props = __rest(_a, ["selector", "propSelectors"]);
|
|
112
|
-
return (React__default["default"].createElement(DynamicElement, __assign({}, props, { propSelectors: __assign(__assign({}, propSelectors), { children: selector }) }), "(DynamicText requires a selector)"));
|
|
113
|
-
}
|
|
114
|
-
function DynamicImage(_a) {
|
|
115
|
-
var selector = _a.selector, propSelectors = _a.propSelectors, props = __rest(_a, ["selector", "propSelectors"]);
|
|
116
|
-
return (React__default["default"].createElement(DynamicElement, __assign({ tag: "img", loading: "lazy", style: {
|
|
117
|
-
objectFit: "cover",
|
|
118
|
-
} }, props, { propSelectors: __assign(__assign({}, propSelectors), { src: selector }),
|
|
119
|
-
// Default image placeholder
|
|
120
|
-
src: "https://studio.plasmic.app/static/img/placeholder.png" })));
|
|
121
|
-
}
|
|
122
|
-
function DynamicCollection(_a) {
|
|
123
|
-
var _b, _c;
|
|
124
|
-
var selector = _a.selector, loopItemName = _a.loopItemName, children = _a.children, data = _a.data, keySelector = _a.keySelector, props = __rest(_a, ["selector", "loopItemName", "children", "data", "keySelector"]);
|
|
125
|
-
// Defaults to an array of three items.
|
|
126
|
-
var finalData = (_b = data !== null && data !== void 0 ? data : useSelector(selector)) !== null && _b !== void 0 ? _b : [1, 2, 3];
|
|
127
|
-
return (React__default["default"].createElement(DynamicElement, __assign({}, props), (_c = finalData === null || finalData === void 0 ? void 0 : finalData.map) === null || _c === void 0 ? void 0 : _c.call(finalData, function (item, index) {
|
|
128
|
-
var _a;
|
|
129
|
-
return (React__default["default"].createElement(DataProvider, { key: (_a = applySelector(item, keySelector)) !== null && _a !== void 0 ? _a : index, name: loopItemName, data: item }, host.repeatedElement(index === 0, children)));
|
|
130
|
-
})));
|
|
131
|
-
}
|
|
132
|
-
function DynamicCollectionGrid(_a) {
|
|
133
|
-
var columns = _a.columns, _b = _a.columnGap, columnGap = _b === void 0 ? 0 : _b, _c = _a.rowGap, rowGap = _c === void 0 ? 0 : _c, props = __rest(_a, ["columns", "columnGap", "rowGap"]);
|
|
134
|
-
return (React__default["default"].createElement(DynamicCollection, __assign({}, props, { style: {
|
|
135
|
-
display: "grid",
|
|
136
|
-
gridTemplateColumns: "repeat(" + columns + ", 1fr)",
|
|
137
|
-
columnGap: columnGap + "px",
|
|
138
|
-
rowGap: rowGap + "px",
|
|
139
|
-
} })));
|
|
140
|
-
}
|
|
141
|
-
var thisModule = "@plasmicpkgs/plasmic-basic-components/Data";
|
|
142
|
-
registerComponent__default["default"](DataProvider, {
|
|
143
|
-
name: "DataProvider",
|
|
144
|
-
importPath: thisModule,
|
|
145
|
-
// description: "Makes some specified data available to the subtree in a context",
|
|
146
|
-
props: {
|
|
147
|
-
name: {
|
|
148
|
-
type: "string",
|
|
149
|
-
defaultValue: "celebrities",
|
|
150
|
-
description: "The name of the variable to store the data in",
|
|
151
|
-
},
|
|
152
|
-
data: {
|
|
153
|
-
type: "object",
|
|
154
|
-
defaultValue: [
|
|
155
|
-
{
|
|
156
|
-
name: "Fill Murray",
|
|
157
|
-
birthYear: 1950,
|
|
158
|
-
profilePicture: ["https://www.fillmurray.com/200/300"],
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
name: "Place Cage",
|
|
162
|
-
birthYear: 1950,
|
|
163
|
-
profilePicture: ["https://www.placecage.com/200/300"],
|
|
164
|
-
},
|
|
165
|
-
],
|
|
166
|
-
},
|
|
167
|
-
children: {
|
|
168
|
-
type: "slot",
|
|
169
|
-
defaultValue: [
|
|
170
|
-
{
|
|
171
|
-
type: "component",
|
|
172
|
-
name: "DynamicText",
|
|
173
|
-
props: {
|
|
174
|
-
selector: "celebrities.0.name",
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
type: "component",
|
|
179
|
-
name: "DynamicImage",
|
|
180
|
-
props: {
|
|
181
|
-
selector: "celebrities.0.profilePicture",
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
],
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
});
|
|
188
|
-
var dynamicPropsWithoutTag = {
|
|
189
|
-
propSelectors: {
|
|
190
|
-
type: "object",
|
|
191
|
-
// defaultValueHint: {},
|
|
192
|
-
description: "An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value.",
|
|
193
|
-
},
|
|
194
|
-
};
|
|
195
|
-
var dynamicProps = __assign(__assign({}, dynamicPropsWithoutTag), { tag: {
|
|
196
|
-
type: "string",
|
|
197
|
-
// defaultValueHint: "div",
|
|
198
|
-
description: "The HTML tag to use",
|
|
199
|
-
} });
|
|
200
|
-
// TODO Eventually we'll want to expose all the base HTML properties, but in the nicer way that we do within the studio.
|
|
201
|
-
registerComponent__default["default"](DynamicElement, {
|
|
202
|
-
name: "DynamicElement",
|
|
203
|
-
importPath: thisModule,
|
|
204
|
-
props: __assign(__assign({}, dynamicProps), { children: "slot" }),
|
|
205
|
-
});
|
|
206
|
-
registerComponent__default["default"](DynamicText, {
|
|
207
|
-
name: "DynamicText",
|
|
208
|
-
importPath: thisModule,
|
|
209
|
-
props: __assign(__assign({}, dynamicProps), { selector: {
|
|
210
|
-
type: "string",
|
|
211
|
-
description: "The selector expression to use to get the text, such as: someVariable.0.someField",
|
|
212
|
-
} }),
|
|
213
|
-
});
|
|
214
|
-
registerComponent__default["default"](DynamicImage, {
|
|
215
|
-
name: "DynamicImage",
|
|
216
|
-
importPath: thisModule,
|
|
217
|
-
props: __assign(__assign({}, dynamicPropsWithoutTag), { selector: {
|
|
218
|
-
type: "string",
|
|
219
|
-
description: "The selector expression to use to get the image source URL, such as: someVariable.0.someField",
|
|
220
|
-
} }),
|
|
221
|
-
});
|
|
222
|
-
var dynamicCollectionProps = __assign(__assign({}, dynamicProps), { selector: {
|
|
223
|
-
type: "string",
|
|
224
|
-
description: "The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField",
|
|
225
|
-
}, loopItemName: {
|
|
226
|
-
type: "string",
|
|
227
|
-
defaultValue: "item",
|
|
228
|
-
description: "The name of the variable to use to store the current item in the loop",
|
|
229
|
-
}, children: "slot" });
|
|
230
|
-
registerComponent__default["default"](DynamicCollection, {
|
|
231
|
-
name: "DynamicCollection",
|
|
232
|
-
importPath: thisModule,
|
|
233
|
-
props: dynamicCollectionProps,
|
|
234
|
-
});
|
|
235
|
-
var dynamicCollectionGridProps = __assign(__assign({}, dynamicCollectionProps), { columns: {
|
|
236
|
-
type: "number",
|
|
237
|
-
defaultValue: 2,
|
|
238
|
-
description: "The number of columns to use in the grid",
|
|
239
|
-
}, columnGap: {
|
|
240
|
-
type: "number",
|
|
241
|
-
defaultValue: 8,
|
|
242
|
-
description: "The gap between columns",
|
|
243
|
-
}, rowGap: {
|
|
244
|
-
type: "number",
|
|
245
|
-
defaultValue: 8,
|
|
246
|
-
description: "The gap between rows",
|
|
247
|
-
} });
|
|
248
|
-
registerComponent__default["default"](DynamicCollectionGrid, {
|
|
249
|
-
name: "DynamicCollectionGrid",
|
|
250
|
-
importPath: thisModule,
|
|
251
|
-
props: dynamicCollectionGridProps,
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
exports.DataContext = DataContext;
|
|
255
|
-
exports.DataProvider = DataProvider;
|
|
256
|
-
exports.DynamicCollection = DynamicCollection;
|
|
257
|
-
exports.DynamicCollectionGrid = DynamicCollectionGrid;
|
|
258
|
-
exports.DynamicElement = DynamicElement;
|
|
259
|
-
exports.DynamicImage = DynamicImage;
|
|
260
|
-
exports.DynamicText = DynamicText;
|
|
261
|
-
exports.applySelector = applySelector;
|
|
262
|
-
exports.dynamicCollectionGridProps = dynamicCollectionGridProps;
|
|
263
|
-
exports.dynamicCollectionProps = dynamicCollectionProps;
|
|
264
|
-
exports.useDataEnv = useDataEnv;
|
|
265
|
-
exports.useSelector = useSelector;
|
|
266
|
-
exports.useSelectors = useSelectors;
|
|
267
|
-
//# sourceMappingURL=index.cjs.js.map
|