@plasmicpkgs/plasmic-basic-components 0.0.7 → 0.0.8
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/EmbedCss.d.ts +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/plasmic-basic-components.cjs.development.js +32 -0
- 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 +30 -1
- package/dist/plasmic-basic-components.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import registerComponent, { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
3
|
+
export interface EmbedCssProps {
|
|
4
|
+
css: string;
|
|
5
|
+
}
|
|
6
|
+
export default function EmbedCss({ css }: EmbedCssProps): JSX.Element;
|
|
7
|
+
export declare const embedCssMeta: ComponentMeta<EmbedCssProps>;
|
|
8
|
+
export declare function registerEmbedCss(loader?: {
|
|
9
|
+
registerComponent: typeof registerComponent;
|
|
10
|
+
}, customEmbedCssMeta?: ComponentMeta<EmbedCssProps>): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -587,12 +587,42 @@ function registerVideo(loader, customVideoMeta) {
|
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
|
|
590
|
+
function EmbedCss(_ref) {
|
|
591
|
+
var css = _ref.css;
|
|
592
|
+
return React__default.createElement("style", {
|
|
593
|
+
dangerouslySetInnerHTML: {
|
|
594
|
+
__html: css
|
|
595
|
+
}
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
var embedCssMeta = {
|
|
599
|
+
name: "hostless-embed-css",
|
|
600
|
+
displayName: "EmbedCss",
|
|
601
|
+
importName: "EmbedCss",
|
|
602
|
+
importPath: "@plasmicpkgs/plasmic-basic-components",
|
|
603
|
+
props: {
|
|
604
|
+
css: {
|
|
605
|
+
type: "string",
|
|
606
|
+
defaultValueHint: "Some CSS snippet",
|
|
607
|
+
description: "CSS rules to be inserted"
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
};
|
|
611
|
+
function registerEmbedCss(loader, customEmbedCssMeta) {
|
|
612
|
+
if (loader) {
|
|
613
|
+
loader.registerComponent(EmbedCss, customEmbedCssMeta != null ? customEmbedCssMeta : embedCssMeta);
|
|
614
|
+
} else {
|
|
615
|
+
registerComponent(EmbedCss, customEmbedCssMeta != null ? customEmbedCssMeta : embedCssMeta);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
590
619
|
exports.DataContext = DataContext;
|
|
591
620
|
exports.DataProvider = DataProvider;
|
|
592
621
|
exports.DynamicElement = DynamicElement;
|
|
593
622
|
exports.DynamicImage = DynamicImage;
|
|
594
623
|
exports.DynamicRepeater = DynamicRepeater;
|
|
595
624
|
exports.DynamicText = DynamicText;
|
|
625
|
+
exports.EmbedCss = EmbedCss;
|
|
596
626
|
exports.Iframe = Iframe;
|
|
597
627
|
exports.ScrollRevealer = ScrollRevealer;
|
|
598
628
|
exports.Video = Video;
|
|
@@ -603,12 +633,14 @@ exports.dynamicImageMeta = dynamicImageMeta;
|
|
|
603
633
|
exports.dynamicRepeaterMeta = dynamicRepeaterMeta;
|
|
604
634
|
exports.dynamicRepeaterProps = dynamicRepeaterProps;
|
|
605
635
|
exports.dynamicTextMeta = dynamicTextMeta;
|
|
636
|
+
exports.embedCssMeta = embedCssMeta;
|
|
606
637
|
exports.iframeMeta = iframeMeta;
|
|
607
638
|
exports.registerDataProvider = registerDataProvider;
|
|
608
639
|
exports.registerDynamicElement = registerDynamicElement;
|
|
609
640
|
exports.registerDynamicImage = registerDynamicImage;
|
|
610
641
|
exports.registerDynamicRepeater = registerDynamicRepeater;
|
|
611
642
|
exports.registerDynamicText = registerDynamicText;
|
|
643
|
+
exports.registerEmbedCss = registerEmbedCss;
|
|
612
644
|
exports.registerIframe = registerIframe;
|
|
613
645
|
exports.registerScrollRevealer = registerScrollRevealer;
|
|
614
646
|
exports.registerVideo = registerVideo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plasmic-basic-components.cjs.development.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,mBAAa,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;AAA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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plasmic-basic-components.cjs.development.js","sources":["../src/common.ts","../src/Data.tsx","../src/Iframe.tsx","../src/ScrollRevealer.tsx","../src/Video.tsx","../src/EmbedCss.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","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport interface EmbedCssProps {\n css: string;\n}\n\nexport default function EmbedCss({\n css\n}: EmbedCssProps) {\n return (\n <style\n dangerouslySetInnerHTML={{ __html: css }}\n />\n );\n}\n\nexport const embedCssMeta: ComponentMeta<EmbedCssProps> = { \n name: \"hostless-embed-css\",\n displayName: \"EmbedCss\",\n importName: \"EmbedCss\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n css: {\n type: \"string\",\n defaultValueHint: \"Some CSS snippet\",\n description: \"CSS rules to be inserted\",\n },\n },\n};\n\nexport function registerEmbedCss(\n loader?: { registerComponent: typeof registerComponent },\n customEmbedCssMeta?: ComponentMeta<EmbedCssProps>\n) {\n if (loader) {\n loader.registerComponent(EmbedCss, customEmbedCssMeta ?? embedCssMeta);\n } else {\n registerComponent(EmbedCss, customEmbedCssMeta ?? embedCssMeta);\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","EmbedC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AAW,EAAE,UAF2C;AAGxDC,EAAAA,UAAU,EAAE,UAH4C;AAIxDC,EAAAA,UAAU,EAAE,uCAJ4C;AAKxDvB,EAAAA,KAAK,EAAE;AACL4G,IAAAA,GAAG,EAAE;AACH3F,MAAAA,IAAI,EAAE,QADH;AAEHiB,MAAAA,gBAAgB,EAAE,kBAFf;AAGHhB,MAAAA,WAAW,EAAE;AAHV;AADA;AALiD,CAAnD;AAcP,SAAgB8F,iBACdvF,QACAwF;AAEA,MAAIxF,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyBgF,QAAzB,EAAmCM,kBAAnC,WAAmCA,kBAAnC,GAAyDF,YAAzD;AACD,GAFD,MAEO;AACLpF,IAAAA,iBAAiB,CAACgF,QAAD,EAAWM,kBAAX,WAAWA,kBAAX,GAAiCF,YAAjC,CAAjB;AACD;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@plasmicapp/host"),r=e(require("@plasmicapp/host/registerComponent")),o=require("react"),a=e(o);function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function i(e,t){if(null==e)return{};var r,o,a={},n=Object.keys(e);for(o=0;o<n.length;o++)t.indexOf(r=n[o])>=0||(a[r]=e[r]);return a}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var s=o.createContext(void 0),c="@plasmicpkgs/plasmic-basic-components";function p(e,t){if(t){for(var r,o=e,a=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return l(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,void 0):void 0}}(e))){r&&(e=r);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t.split("."));!(r=a()).done;){var n;o=null==(n=o)?void 0:n[r.value]}return o}}function m(e){return p(d(),e)}function u(e){void 0===e&&(e={});var t=d();return Object.fromEntries(Object.entries(e).filter((function(e){return!!e[0]&&!!e[1]})).map((function(e){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t}(e[0],p(t,e[1]))})))}function d(){return o.useContext(s)}function h(e){var t,r,o=e.name,i=e.data,l=e.children,c=null!=(t=d())?t:{};return o?a.createElement(s.Provider,{value:n({},c,(r={},r[o]=i,r))},l):a.createElement(a.Fragment,null,l)}function f(e){var t=e.tag,r=void 0===t?"div":t,a=e.className,l=e.children,s=e.propSelectors,c=i(e,["tag","className","children","propSelectors"]),p=u(s);return o.createElement(r,n({children:l},c,p,{className:a+" "+p.className}))}function y(e){var t=e.selector,r=e.propSelectors,o=i(e,["selector","propSelectors"]);return a.createElement(f,Object.assign({},o,{propSelectors:n({},r,{children:t})}),"(DynamicText requires a selector)")}function v(e){var t=e.selector,r=e.propSelectors,o=i(e,["selector","propSelectors"]);return a.createElement(f,Object.assign({tag:"img",loading:"lazy",style:{objectFit:"cover"}},o,{propSelectors:n({},r,{src:t}),src:"https://studio.plasmic.app/static/img/placeholder.png"}))}function g(e){var r,o=e.children,n=e.loopItemName,i=e.keySelector,l=e.data,s=null!=(r=null!=l?l:m(e.selector))?r:[1,2,3];return a.createElement(a.Fragment,null,null==s||null==s.map?void 0:s.map((function(e,r){var l;return a.createElement(h,{key:null!=(l=p(e,i))?l:r,name:n,data:e},t.repeatedElement(0===r,o))})))}var x={selector:{type:"string",description:"The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField"},loopItemName:{type:"string",defaultValue:"item",description:"The name of the variable to use to store the current item in the loop"},children:"slot"},b={name:"hostless-dynamic-repeater",displayName:"Dynamic Repeater",importName:"DynamicRepeater",importPath:c,props:x},w={name:"hostless-data-provider",displayName:"Data Provider",importName:"DataProvider",importPath:c,props:{name:{type:"string",defaultValue:"celebrities",description:"The name of the variable to store the data in"},data:{type:"object",defaultValue:[{name:"Fill Murray",birthYear:1950,profilePicture:["https://www.fillmurray.com/200/300"]},{name:"Place Cage",birthYear:1950,profilePicture:["https://www.placecage.com/200/300"]}]},children:{type:"slot",defaultValue:[{type:"component",name:"hostless-dynamic-text",props:{selector:"celebrities.0.name"}},{type:"component",name:"hostless-dynamic-image",props:{selector:"celebrities.0.profilePicture"}}]}}},N={propSelectors:{type:"object",defaultValueHint:{},description:"An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value."}},S=n({},N,{tag:{type:"string",defaultValueHint:"div",description:"The HTML tag to use"}}),D={name:"hostless-dynamic-element",displayName:"Dynamic Element",importName:"DynamicElement",importPath:c,props:n({},S,{children:"slot"})},P={name:"hostless-dynamic-text",importName:"DynamicText",displayName:"Dynamic Text",importPath:c,props:n({},S,{selector:{type:"string",description:"The selector expression to use to get the text, such as: someVariable.0.someField"}})},T={name:"hostless-dynamic-image",displayName:"Dynamic Image",importName:"DynamicImage",importPath:c,props:n({},N,{selector:{type:"string",description:"The selector expression to use to get the image source URL, such as: someVariable.0.someField"}})};function E(e){var r=e.preview,n=e.src,i=e.className;return o.useContext(t.PlasmicCanvasContext)&&!r?a.createElement("div",{className:i},a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"#eee",color:"#888",fontSize:"36px",fontFamily:"sans-serif",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"}},"Iframe placeholder")):a.createElement("iframe",{src:n,className:i})}var I={name:"hostless-iframe",displayName:"Iframe",importName:"Iframe",importPath:"@plasmicpkgs/plasmic-basic-components",props:{src:{type:"string",defaultValue:"https://www.example.com"},preview:{type:"boolean",description:"Load the iframe while editing in Plasmic Studio"}},defaultStyles:{width:"300px",height:"150px",maxWidth:"100%"}};function C(e){var t=e.ref,r=e.scrollDownThreshold,a=void 0===r?.5:r,n=e.scrollUpThreshold,i=void 0===n?0:n,l=o.useState(!1),s=l[0],c=l[1];return o.useEffect((function(){if(t.current&&"function"==typeof IntersectionObserver){var e=new IntersectionObserver((function(e){e[0].intersectionRatio>=a?c(!0):e[0].intersectionRatio<=i&&c(!1)}),{root:null,rootMargin:"0%",threshold:[i,a]});return e.observe(t.current),function(){c(!1),e.disconnect()}}return function(){}}),[t.current,a,i]),s}function j(e){var t=e.children,r=e.className,n=e.scrollDownThreshold,i=void 0===n?.5:n,l=e.scrollUpThreshold,s=void 0===l?0:l,c=o.useRef(null),p=C({ref:c,scrollUpThreshold:s,scrollDownThreshold:i});return a.createElement("div",{className:r,ref:c},p?t:null)}var R={name:"hostless-scroll-revealer",importName:"ScrollRevealer",displayName:"Scroll Revealer",importPath:"@plasmicpkgs/plasmic-basic-components",props:{children:"slot",scrollDownThreshold:{type:"number",displayName:"Scroll down threshold",defaultValueHint:.5,description:"How much of the element (as a fraction) must you scroll into view for it to appear (defaults to 0.5)"},scrollUpThreshold:{type:"number",displayName:"Scroll up threshold",defaultValueHint:0,description:"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)"}},defaultStyles:{width:"stretch",maxWidth:"100%"}},V=a.forwardRef((function(e,t){return a.createElement("video",Object.assign({ref:t},e))})),M={name:"hostless-html-video",importName:"Video",displayName:"HTML Video",importPath:"@plasmicpkgs/plasmic-basic-components",props:{src:{type:"string",defaultValue:"https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm",displayName:"Source URL",description:"URL to a video file."},autoPlay:{type:"boolean",displayName:"Auto Play",description:"Whether the video show automatically start playing when the player loads"},controls:{type:"boolean",displayName:"Show Controls",description:"Whether the video player controls should be displayed"},playsInline:{type:"boolean",displayName:"Plays inline",description:"Usually on mobile, when tilted landscape, videos can play fullscreen. Turn this on to prevent that."},loop:{type:"boolean",displayName:"Loop",description:"Whether the video should be played again after it finishes"},muted:{type:"boolean",displayName:"Muted",description:"Whether audio should be muted"},poster:{type:"imageUrl",displayName:"Poster (placeholder) image",description:"Image to show while video is downloading"},preload:{type:"choice",options:["none","metadata","auto"],displayName:"Preload",description:"Whether to preload nothing, metadata only, or the full video"}},defaultStyles:{height:"hug",width:"640px",maxWidth:"100%"}};exports.DataContext=s,exports.DataProvider=h,exports.DynamicElement=f,exports.DynamicImage=v,exports.DynamicRepeater=g,exports.DynamicText=y,exports.Iframe=E,exports.ScrollRevealer=j,exports.Video=V,exports.applySelector=p,exports.dataProviderMeta=w,exports.dynamicElementMeta=D,exports.dynamicImageMeta=T,exports.dynamicRepeaterMeta=b,exports.dynamicRepeaterProps=x,exports.dynamicTextMeta=P,exports.iframeMeta=I,exports.registerDataProvider=function(e,t){e?e.registerComponent(h,null!=t?t:w):r(h,null!=t?t:w)},exports.registerDynamicElement=function(e,t){e?e.registerComponent(f,null!=t?t:D):r(f,null!=t?t:D)},exports.registerDynamicImage=function(e,t){e?e.registerComponent(v,null!=t?t:T):r(v,null!=t?t:T)},exports.registerDynamicRepeater=function(e,t){e?e.registerComponent(g,null!=t?t:b):r(g,null!=t?t:b)},exports.registerDynamicText=function(e,t){e?e.registerComponent(y,null!=t?t:P):r(y,null!=t?t:P)},exports.registerIframe=function(e,t){e?e.registerComponent(E,null!=t?t:I):r(E,null!=t?t:I)},exports.registerScrollRevealer=function(e,t){e?e.registerComponent(j,null!=t?t:R):r(j,null!=t?t:R)},exports.registerVideo=function(e,t){e?e.registerComponent(V,null!=t?t:M):r(V,null!=t?t:M)},exports.scrollRevealerMeta=R,exports.useDataEnv=d,exports.useDirectionalIntersection=C,exports.useSelector=m,exports.useSelectors=u,exports.videoMeta=M;
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@plasmicapp/host"),r=e(require("@plasmicapp/host/registerComponent")),o=require("react"),a=e(o);function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}function s(e,t){if(null==e)return{};var r,o,a={},n=Object.keys(e);for(o=0;o<n.length;o++)t.indexOf(r=n[o])>=0||(a[r]=e[r]);return a}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var l=o.createContext(void 0),p="@plasmicpkgs/plasmic-basic-components";function c(e,t){if(t){for(var r,o=e,a=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,void 0):void 0}}(e))){r&&(e=r);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t.split("."));!(r=a()).done;){var n;o=null==(n=o)?void 0:n[r.value]}return o}}function m(e){return c(d(),e)}function u(e){void 0===e&&(e={});var t=d();return Object.fromEntries(Object.entries(e).filter((function(e){return!!e[0]&&!!e[1]})).map((function(e){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t}(e[0],c(t,e[1]))})))}function d(){return o.useContext(l)}function h(e){var t,r,o=e.name,s=e.data,i=e.children,p=null!=(t=d())?t:{};return o?a.createElement(l.Provider,{value:n({},p,(r={},r[o]=s,r))},i):a.createElement(a.Fragment,null,i)}function y(e){var t=e.tag,r=void 0===t?"div":t,a=e.className,i=e.children,l=e.propSelectors,p=s(e,["tag","className","children","propSelectors"]),c=u(l);return o.createElement(r,n({children:i},p,c,{className:a+" "+c.className}))}function f(e){var t=e.selector,r=e.propSelectors,o=s(e,["selector","propSelectors"]);return a.createElement(y,Object.assign({},o,{propSelectors:n({},r,{children:t})}),"(DynamicText requires a selector)")}function v(e){var t=e.selector,r=e.propSelectors,o=s(e,["selector","propSelectors"]);return a.createElement(y,Object.assign({tag:"img",loading:"lazy",style:{objectFit:"cover"}},o,{propSelectors:n({},r,{src:t}),src:"https://studio.plasmic.app/static/img/placeholder.png"}))}function g(e){var r,o=e.children,n=e.loopItemName,s=e.keySelector,i=e.data,l=null!=(r=null!=i?i:m(e.selector))?r:[1,2,3];return a.createElement(a.Fragment,null,null==l||null==l.map?void 0:l.map((function(e,r){var i;return a.createElement(h,{key:null!=(i=c(e,s))?i:r,name:n,data:e},t.repeatedElement(0===r,o))})))}var b={selector:{type:"string",description:"The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField"},loopItemName:{type:"string",defaultValue:"item",description:"The name of the variable to use to store the current item in the loop"},children:"slot"},x={name:"hostless-dynamic-repeater",displayName:"Dynamic Repeater",importName:"DynamicRepeater",importPath:p,props:b},w={name:"hostless-data-provider",displayName:"Data Provider",importName:"DataProvider",importPath:p,props:{name:{type:"string",defaultValue:"celebrities",description:"The name of the variable to store the data in"},data:{type:"object",defaultValue:[{name:"Fill Murray",birthYear:1950,profilePicture:["https://www.fillmurray.com/200/300"]},{name:"Place Cage",birthYear:1950,profilePicture:["https://www.placecage.com/200/300"]}]},children:{type:"slot",defaultValue:[{type:"component",name:"hostless-dynamic-text",props:{selector:"celebrities.0.name"}},{type:"component",name:"hostless-dynamic-image",props:{selector:"celebrities.0.profilePicture"}}]}}},N={propSelectors:{type:"object",defaultValueHint:{},description:"An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value."}},S=n({},N,{tag:{type:"string",defaultValueHint:"div",description:"The HTML tag to use"}}),P={name:"hostless-dynamic-element",displayName:"Dynamic Element",importName:"DynamicElement",importPath:p,props:n({},S,{children:"slot"})},D={name:"hostless-dynamic-text",importName:"DynamicText",displayName:"Dynamic Text",importPath:p,props:n({},S,{selector:{type:"string",description:"The selector expression to use to get the text, such as: someVariable.0.someField"}})},C={name:"hostless-dynamic-image",displayName:"Dynamic Image",importName:"DynamicImage",importPath:p,props:n({},N,{selector:{type:"string",description:"The selector expression to use to get the image source URL, such as: someVariable.0.someField"}})};function E(e){var r=e.preview,n=e.src,s=e.className;return o.useContext(t.PlasmicCanvasContext)&&!r?a.createElement("div",{className:s},a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"#eee",color:"#888",fontSize:"36px",fontFamily:"sans-serif",fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"}},"Iframe placeholder")):a.createElement("iframe",{src:n,className:s})}var T={name:"hostless-iframe",displayName:"Iframe",importName:"Iframe",importPath:"@plasmicpkgs/plasmic-basic-components",props:{src:{type:"string",defaultValue:"https://www.example.com"},preview:{type:"boolean",description:"Load the iframe while editing in Plasmic Studio"}},defaultStyles:{width:"300px",height:"150px",maxWidth:"100%"}};function I(e){var t=e.ref,r=e.scrollDownThreshold,a=void 0===r?.5:r,n=e.scrollUpThreshold,s=void 0===n?0:n,i=o.useState(!1),l=i[0],p=i[1];return o.useEffect((function(){if(t.current&&"function"==typeof IntersectionObserver){var e=new IntersectionObserver((function(e){e[0].intersectionRatio>=a?p(!0):e[0].intersectionRatio<=s&&p(!1)}),{root:null,rootMargin:"0%",threshold:[s,a]});return e.observe(t.current),function(){p(!1),e.disconnect()}}return function(){}}),[t.current,a,s]),l}function j(e){var t=e.children,r=e.className,n=e.scrollDownThreshold,s=void 0===n?.5:n,i=e.scrollUpThreshold,l=void 0===i?0:i,p=o.useRef(null),c=I({ref:p,scrollUpThreshold:l,scrollDownThreshold:s});return a.createElement("div",{className:r,ref:p},c?t:null)}var R={name:"hostless-scroll-revealer",importName:"ScrollRevealer",displayName:"Scroll Revealer",importPath:"@plasmicpkgs/plasmic-basic-components",props:{children:"slot",scrollDownThreshold:{type:"number",displayName:"Scroll down threshold",defaultValueHint:.5,description:"How much of the element (as a fraction) must you scroll into view for it to appear (defaults to 0.5)"},scrollUpThreshold:{type:"number",displayName:"Scroll up threshold",defaultValueHint:0,description:"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)"}},defaultStyles:{width:"stretch",maxWidth:"100%"}},V=a.forwardRef((function(e,t){return a.createElement("video",Object.assign({ref:t},e))})),M={name:"hostless-html-video",importName:"Video",displayName:"HTML Video",importPath:"@plasmicpkgs/plasmic-basic-components",props:{src:{type:"string",defaultValue:"https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm",displayName:"Source URL",description:"URL to a video file."},autoPlay:{type:"boolean",displayName:"Auto Play",description:"Whether the video show automatically start playing when the player loads"},controls:{type:"boolean",displayName:"Show Controls",description:"Whether the video player controls should be displayed"},playsInline:{type:"boolean",displayName:"Plays inline",description:"Usually on mobile, when tilted landscape, videos can play fullscreen. Turn this on to prevent that."},loop:{type:"boolean",displayName:"Loop",description:"Whether the video should be played again after it finishes"},muted:{type:"boolean",displayName:"Muted",description:"Whether audio should be muted"},poster:{type:"imageUrl",displayName:"Poster (placeholder) image",description:"Image to show while video is downloading"},preload:{type:"choice",options:["none","metadata","auto"],displayName:"Preload",description:"Whether to preload nothing, metadata only, or the full video"}},defaultStyles:{height:"hug",width:"640px",maxWidth:"100%"}};function O(e){return a.createElement("style",{dangerouslySetInnerHTML:{__html:e.css}})}var U={name:"hostless-embed-css",displayName:"EmbedCss",importName:"EmbedCss",importPath:"@plasmicpkgs/plasmic-basic-components",props:{css:{type:"string",defaultValueHint:"Some CSS snippet",description:"CSS rules to be inserted"}}};exports.DataContext=l,exports.DataProvider=h,exports.DynamicElement=y,exports.DynamicImage=v,exports.DynamicRepeater=g,exports.DynamicText=f,exports.EmbedCss=O,exports.Iframe=E,exports.ScrollRevealer=j,exports.Video=V,exports.applySelector=c,exports.dataProviderMeta=w,exports.dynamicElementMeta=P,exports.dynamicImageMeta=C,exports.dynamicRepeaterMeta=x,exports.dynamicRepeaterProps=b,exports.dynamicTextMeta=D,exports.embedCssMeta=U,exports.iframeMeta=T,exports.registerDataProvider=function(e,t){e?e.registerComponent(h,null!=t?t:w):r(h,null!=t?t:w)},exports.registerDynamicElement=function(e,t){e?e.registerComponent(y,null!=t?t:P):r(y,null!=t?t:P)},exports.registerDynamicImage=function(e,t){e?e.registerComponent(v,null!=t?t:C):r(v,null!=t?t:C)},exports.registerDynamicRepeater=function(e,t){e?e.registerComponent(g,null!=t?t:x):r(g,null!=t?t:x)},exports.registerDynamicText=function(e,t){e?e.registerComponent(f,null!=t?t:D):r(f,null!=t?t:D)},exports.registerEmbedCss=function(e,t){e?e.registerComponent(O,null!=t?t:U):r(O,null!=t?t:U)},exports.registerIframe=function(e,t){e?e.registerComponent(E,null!=t?t:T):r(E,null!=t?t:T)},exports.registerScrollRevealer=function(e,t){e?e.registerComponent(j,null!=t?t:R):r(j,null!=t?t:R)},exports.registerVideo=function(e,t){e?e.registerComponent(V,null!=t?t:M):r(V,null!=t?t:M)},exports.scrollRevealerMeta=R,exports.useDataEnv=d,exports.useDirectionalIntersection=I,exports.useSelector=m,exports.useSelectors=u,exports.videoMeta=M;
|
|
2
2
|
//# sourceMappingURL=plasmic-basic-components.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plasmic-basic-components.cjs.production.min.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":["DataContext","createContext","undefined","thisModule","applySelector","rawData","selector","curData","split","_curData","useSelector","useDataEnv","useSelectors","selectors","Object","fromEntries","entries","filter","map","args","tuple","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","key","repeatedElement","dynamicRepeaterProps","type","description","defaultValue","dynamicRepeaterMeta","displayName","importName","importPath","dataProviderMeta","birthYear","profilePicture","dynamicPropsWithoutTag","defaultValueHint","dynamicProps","dynamicElementMeta","dynamicTextMeta","dynamicImageMeta","Iframe","preview","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","display","alignItems","justifyContent","overflow","iframeMeta","defaultStyles","width","height","maxWidth","useDirectionalIntersection","ref","scrollDownThreshold","scrollUpThreshold","useState","revealed","setRevealed","useEffect","current","IntersectionObserver","observer","intersectionRatio","root","rootMargin","threshold","observe","disconnect","ScrollRevealer","intersectionRef","useRef","scrollRevealerMeta","Video","forwardRef","videoMeta","autoPlay","controls","playsInline","loop","muted","poster","preload","options","loader","customDataProviderMeta","registerComponent","customDynamicElementMeta","customDynamicImageMeta","customDynamicRepeaterMeta","customDynamicTextMeta","customIframeMeta","customScrollRevealerMeta","customVideoMeta"],"mappings":"srBAAO,ICaMA,EAAcC,qBAAoCC,GAEzDC,EAAa,iDAEHC,EACdC,EACAC,MAEKA,aAGDC,EAAUF,wrBACIC,EAASE,MAAM,qBAAM,OACrCD,WAAUA,UAAAE,kBAELF,YAKOG,EAAYJ,UAEnBF,EADSO,IACcL,YAGhBM,EAAaC,YAAAA,IAAAA,EAA0B,QAC/CR,EAAUM,WACTG,OAAOC,YACZD,OAAOE,QAAQH,GACZI,QAAO,oCACPC,KAAI,mBD3CU,sCAAqBC,2BAAAA,yBAAeA,EC2CzBC,MAAWhB,EAAcC,aAIzD,SAAgBM,WACPU,aAAWrB,YASJsB,aAAeC,IAAAA,KAAMC,IAAAA,KAAMC,IAAAA,SACnCC,WAAcf,OAAgB,UAC/BY,EAIDI,gBAAC3B,EAAY4B,UAASC,WAAYH,UAAcH,GAAOC,OACpDC,GAJEE,gCAAGF,YAgBEK,aAGdC,IAAAA,aAAM,QACNC,IAAAA,UACAP,IAAAA,SACAQ,IAAAA,cACGC,sDAEGC,EAAWvB,EAAaqB,UACvBG,gBAAcL,KACnBN,SAAAA,GACGS,EACAC,GACHH,UAAWA,EAAY,IAAMG,EAASH,sBAQ1BK,SACd/B,IAAAA,SACA2B,IAAAA,cACGC,2CAGDP,gBAACG,mBACKI,GACJD,mBAAoBA,GAAeR,SAAUnB,oDAcnCgC,SACdhC,IAAAA,SACA2B,IAAAA,cACGC,2CAGDP,gBAACG,iBACCC,IAAK,MACLQ,QAAS,OACTC,MAAO,CACLC,UAAW,UAETP,GACJD,mBAAoBA,GAAeS,IAAKpC,IAExCoC,IAAI,oEAaMC,WACdlB,IAAAA,SACAmB,IAAAA,aACAC,IAAAA,YAEArB,IAAAA,KAGMsB,iBAAYtB,EA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QAAcqG,EAAAA,EAA0BhE,4CAiC5D+D,EACAG,GAEIH,EACFA,EAAOE,kBACL9F,QACA+F,EAAAA,EAA4B5D,GAG9B2D,EACE9F,QACA+F,EAAAA,EAA4B5D,0CAkDhCyD,EACAI,GAEIJ,EACFA,EAAOE,kBACLtF,QACAwF,EAAAA,EAA0B3D,GAG5ByD,EAAkBtF,QAAcwF,EAAAA,EAA0B3D,6CAlL5DuD,EACAK,GAEIL,EACFA,EAAOE,kBACLjF,QACAoF,EAAAA,EAA6BxE,GAG/BqE,EACEjF,QACAoF,EAAAA,EAA6BxE,yCAiIjCmE,EACAM,GAEIN,EACFA,EAAOE,kBACLvF,QACA2F,EAAAA,EAAyB9D,GAG3B0D,EAAkBvF,QAAa2F,EAAAA,EAAyB9D,oCCzR1DwD,EACAO,GAEIP,EACFA,EAAOE,kBAAkBxD,QAAQ6D,EAAAA,EAAoB5C,GAErDuC,EAAkBxD,QAAQ6D,EAAAA,EAAoB5C,4CCyChDqC,EACAQ,GAEIR,EACFA,EAAOE,kBACLjB,QACAuB,EAAAA,EAA4BpB,GAG9Bc,EACEjB,QACAuB,EAAAA,EAA4BpB,mCCpChCY,EACAS,GAEIT,EACFA,EAAOE,kBAAkBb,QAAOoB,EAAAA,EAAmBlB,GAEnDW,EAAkBb,QAAOoB,EAAAA,EAAmBlB"}
|
|
1
|
+
{"version":3,"file":"plasmic-basic-components.cjs.production.min.js","sources":["../src/common.ts","../src/Data.tsx","../src/Iframe.tsx","../src/ScrollRevealer.tsx","../src/Video.tsx","../src/EmbedCss.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","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport interface EmbedCssProps {\n css: string;\n}\n\nexport default function EmbedCss({\n css\n}: EmbedCssProps) {\n return (\n <style\n dangerouslySetInnerHTML={{ __html: css }}\n />\n );\n}\n\nexport const embedCssMeta: ComponentMeta<EmbedCssProps> = { \n name: \"hostless-embed-css\",\n displayName: \"EmbedCss\",\n importName: \"EmbedCss\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n css: {\n type: \"string\",\n defaultValueHint: \"Some CSS snippet\",\n description: \"CSS rules to be inserted\",\n },\n },\n};\n\nexport function registerEmbedCss(\n loader?: { registerComponent: typeof registerComponent },\n customEmbedCssMeta?: ComponentMeta<EmbedCssProps>\n) {\n if (loader) {\n loader.registerComponent(EmbedCss, customEmbedCssMeta ?? embedCssMeta);\n } else {\n registerComponent(EmbedCss, customEmbedCssMeta ?? embedCssMeta);\n }\n}\n"],"names":["DataContext","createContext","undefined","thisModule","applySelector","rawData","selector","curData","split","_curData","useSelector","useDataEnv","useSelectors","selectors","Object","fromEntries","entries","filter","map","args","tuple","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","key","repeatedElement","dynamicRepeaterProps","type","description","defaultValue","dynamicRepeaterMeta","displayName","importName","importPath","dataProviderMeta","birthYear","profilePicture","dynamicPropsWithoutTag","defaultValueHint","dynamicProps","dynamicElementMeta","dynamicTextMeta","dynamicImageMeta","Iframe","preview","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","display","alignItems","justifyContent","overflow","iframeMeta","defaultStyles","width","height","maxWidth","useDirectionalIntersection","ref","scrollDownThreshold","scrollUpThreshold","useState","revealed","setRevealed","useEffect","current","IntersectionObserver","observer","intersectionRatio","root","rootMargin","threshold","observe","disconnect","ScrollRevealer","intersectionRef","useRef","scrollRevealerMeta","Video","forwardRef","videoMeta","autoPlay","controls","playsInline","loop","muted","poster","preload","options","EmbedCss","dangerouslySetInnerHTML","__html","css","embedCssMeta","loader","customDataProviderMeta","registerComponent","customDynamicElementMeta","customDynamicImageMeta","customDynamicRepeaterMeta","customDynamicTextMeta","customEmbedCssMeta","customIframeMeta","customScrollRevealerMeta","customVideoMeta"],"mappings":"srBAAO,ICaMA,EAAcC,qBAAoCC,GAEzDC,EAAa,iDAEHC,EACdC,EACAC,MAEKA,aAGDC,EAAUF,wrBACIC,EAASE,MAAM,qBAAM,OACrCD,WAAUA,UAAAE,kBAELF,YAKOG,EAAYJ,UAEnBF,EADSO,IACcL,YAGhBM,EAAaC,YAAAA,IAAAA,EAA0B,QAC/CR,EAAUM,WACTG,OAAOC,YACZD,OAAOE,QAAQH,GACZI,QAAO,oCACPC,KAAI,mBD3CU,sCAAqBC,2BAAAA,yBAAeA,EC2CzBC,MAAWhB,EAAcC,aAIzD,SAAgBM,WACPU,aAAWrB,YASJsB,aAAeC,IAAAA,KAAMC,IAAAA,KAAMC,IAAAA,SACnCC,WAAcf,OAAgB,UAC/BY,EAIDI,gBAAC3B,EAAY4B,UAASC,WAAYH,UAAcH,GAAOC,OACpDC,GAJEE,gCAAGF,YAgBEK,aAGdC,IAAAA,aAAM,QACNC,IAAAA,UACAP,IAAAA,SACAQ,IAAAA,cACGC,sDAEGC,EAAWvB,EAAaqB,UACvBG,gBAAcL,KACnBN,SAAAA,GACGS,EACAC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AAAA,EAAoBlD,GAErD4C,EAAkB7D,QAAQmE,EAAAA,EAAoBlD,4CCyChD0C,EACAS,GAEIT,EACFA,EAAOE,kBACLtB,QACA6B,EAAAA,EAA4B1B,GAG9BmB,EACEtB,QACA6B,EAAAA,EAA4B1B,mCCpChCiB,EACAU,GAEIV,EACFA,EAAOE,kBAAkBlB,QAAO0B,EAAAA,EAAmBxB,GAEnDgB,EAAkBlB,QAAO0B,EAAAA,EAAmBxB"}
|
|
@@ -580,5 +580,34 @@ function registerVideo(loader, customVideoMeta) {
|
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
|
|
583
|
-
|
|
583
|
+
function EmbedCss(_ref) {
|
|
584
|
+
var css = _ref.css;
|
|
585
|
+
return React.createElement("style", {
|
|
586
|
+
dangerouslySetInnerHTML: {
|
|
587
|
+
__html: css
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
var embedCssMeta = {
|
|
592
|
+
name: "hostless-embed-css",
|
|
593
|
+
displayName: "EmbedCss",
|
|
594
|
+
importName: "EmbedCss",
|
|
595
|
+
importPath: "@plasmicpkgs/plasmic-basic-components",
|
|
596
|
+
props: {
|
|
597
|
+
css: {
|
|
598
|
+
type: "string",
|
|
599
|
+
defaultValueHint: "Some CSS snippet",
|
|
600
|
+
description: "CSS rules to be inserted"
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
};
|
|
604
|
+
function registerEmbedCss(loader, customEmbedCssMeta) {
|
|
605
|
+
if (loader) {
|
|
606
|
+
loader.registerComponent(EmbedCss, customEmbedCssMeta != null ? customEmbedCssMeta : embedCssMeta);
|
|
607
|
+
} else {
|
|
608
|
+
registerComponent(EmbedCss, customEmbedCssMeta != null ? customEmbedCssMeta : embedCssMeta);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
export { DataContext, DataProvider, DynamicElement, DynamicImage, DynamicRepeater, DynamicText, EmbedCss, Iframe, ScrollRevealer, Video, applySelector, dataProviderMeta, dynamicElementMeta, dynamicImageMeta, dynamicRepeaterMeta, dynamicRepeaterProps, dynamicTextMeta, embedCssMeta, iframeMeta, registerDataProvider, registerDynamicElement, registerDynamicImage, registerDynamicRepeater, registerDynamicText, registerEmbedCss, registerIframe, registerScrollRevealer, registerVideo, scrollRevealerMeta, useDataEnv, useDirectionalIntersection, useSelector, useSelectors, videoMeta };
|
|
584
613
|
//# sourceMappingURL=plasmic-basic-components.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
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,C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AAE;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;;;;"}
|
|
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","../src/EmbedCss.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","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\nexport interface EmbedCssProps {\n css: string;\n}\n\nexport default function EmbedCss({\n css\n}: EmbedCssProps) {\n return (\n <style\n dangerouslySetInnerHTML={{ __html: css }}\n />\n );\n}\n\nexport const embedCssMeta: ComponentMeta<EmbedCssProps> = { \n name: \"hostless-embed-css\",\n displayName: \"EmbedCss\",\n importName: \"EmbedCss\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n css: {\n type: \"string\",\n defaultValueHint: \"Some CSS snippet\",\n description: \"CSS rules to be inserted\",\n },\n },\n};\n\nexport function registerEmbedCss(\n loader?: { registerComponent: typeof registerComponent },\n customEmbedCssMeta?: ComponentMeta<EmbedCssProps>\n) {\n if (loader) {\n loader.registerComponent(EmbedCss, customEmbedCssMeta ?? embedCssMeta);\n } else {\n registerComponent(EmbedCss, customEmbedCssMeta ?? embedCssMeta);\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","EmbedCss","css","dangerouslySetInnerHTML","__html","embedCssMeta","registerEmbedCss","customEmbedCssMeta"],"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,Q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