@plasmicpkgs/plasmic-basic-components 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Data.d.ts CHANGED
@@ -72,10 +72,12 @@ export declare const dynamicCollectionProps: {
72
72
  readonly children: "slot";
73
73
  readonly tag: {
74
74
  readonly type: "string";
75
+ readonly defaultValueHint: "div";
75
76
  readonly description: "The HTML tag to use";
76
77
  };
77
78
  readonly propSelectors: {
78
79
  readonly type: "object";
80
+ readonly defaultValueHint: {};
79
81
  readonly description: "An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value.";
80
82
  };
81
83
  };
@@ -111,10 +113,12 @@ export declare const dynamicCollectionGridProps: {
111
113
  readonly children: "slot";
112
114
  readonly tag: {
113
115
  readonly type: "string";
116
+ readonly defaultValueHint: "div";
114
117
  readonly description: "The HTML tag to use";
115
118
  };
116
119
  readonly propSelectors: {
117
120
  readonly type: "object";
121
+ readonly defaultValueHint: {};
118
122
  readonly description: "An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value.";
119
123
  };
120
124
  };
package/dist/Embed.d.ts CHANGED
@@ -1,11 +1,9 @@
1
- /// <reference types="react" />
2
1
  import registerComponent, { ComponentMeta } from "@plasmicapp/host/registerComponent";
3
2
  export interface EmbedProps {
4
3
  className?: string;
5
4
  code: string;
6
5
  hideInEditor?: boolean;
7
6
  }
8
- export default function Embed({ className, code, hideInEditor, }: EmbedProps): JSX.Element;
9
7
  export declare const embedMeta: ComponentMeta<EmbedProps>;
10
8
  export declare function registerEmbed(loader?: {
11
9
  registerComponent: typeof registerComponent;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  export * from "./Data";
2
- export * from "./Embed";
3
- export { default as Embed } from "./Embed";
4
2
  export * from "./Iframe";
5
3
  export { default as Iframe } from "./Iframe";
6
4
  export * from "./ScrollRevealer";
@@ -87,14 +87,6 @@ var tuple = function tuple() {
87
87
 
88
88
  return args;
89
89
  };
90
- function ensure(x) {
91
- if (x === null || x === undefined) {
92
- debugger;
93
- throw new Error("Value must not be undefined or null");
94
- } else {
95
- return x;
96
- }
97
- }
98
90
 
99
91
  var DataContext = /*#__PURE__*/React.createContext(undefined);
100
92
  function applySelector(rawData, selector) {
@@ -291,7 +283,7 @@ function registerDataProvider(loader, customDataProviderMeta) {
291
283
  var dynamicPropsWithoutTag = {
292
284
  propSelectors: {
293
285
  type: "object",
294
- // defaultValueHint: {},
286
+ defaultValueHint: {},
295
287
  description: "An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value."
296
288
  }
297
289
  };
@@ -299,7 +291,7 @@ var dynamicPropsWithoutTag = {
299
291
  var dynamicProps = /*#__PURE__*/_extends({}, dynamicPropsWithoutTag, {
300
292
  tag: {
301
293
  type: "string",
302
- // defaultValueHint: "div",
294
+ defaultValueHint: "div",
303
295
  description: "The HTML tag to use"
304
296
  }
305
297
  }); // TODO Eventually we'll want to expose all the base HTML properties, but in the nicer way that we do within the studio.
@@ -417,64 +409,6 @@ function registerDynamicCollectionGrid(loader, customDynamicCollectionGridMeta)
417
409
  }
418
410
  }
419
411
 
420
- function Embed(_ref) {
421
- var className = _ref.className,
422
- code = _ref.code,
423
- _ref$hideInEditor = _ref.hideInEditor,
424
- hideInEditor = _ref$hideInEditor === void 0 ? false : _ref$hideInEditor;
425
- var rootElt = React.useRef(null);
426
- React.useEffect(function () {
427
- if (hideInEditor) {
428
- return;
429
- }
430
-
431
- Array.from(ensure(rootElt.current).querySelectorAll("script")).forEach(function (oldScript) {
432
- var newScript = document.createElement("script");
433
- Array.from(oldScript.attributes).forEach(function (attr) {
434
- return newScript.setAttribute(attr.name, attr.value);
435
- });
436
- newScript.appendChild(document.createTextNode(oldScript.innerHTML));
437
- ensure(oldScript.parentNode).replaceChild(newScript, oldScript);
438
- });
439
- }, [code, hideInEditor]);
440
- var effectiveCode = hideInEditor ? "" : code;
441
- return React__default.createElement("div", {
442
- ref: rootElt,
443
- className: className,
444
- dangerouslySetInnerHTML: {
445
- __html: effectiveCode
446
- }
447
- });
448
- }
449
- var embedMeta = {
450
- name: "hostless-embed",
451
- displayName: "Embed",
452
- importName: "Embed",
453
- importPath: "@plasmicpkgs/plasmic-basic-components",
454
- props: {
455
- code: {
456
- type: "string",
457
- defaultValue: "https://www.example.com"
458
- },
459
- hideInEditor: {
460
- type: "boolean",
461
- displayName: "Hide in editor",
462
- description: "Disable running the code while editing in Plasmic Studio (may require reload)",
463
- editOnly: true
464
- }
465
- },
466
- defaultStyles: {
467
- maxWidth: "100%"
468
- }
469
- };
470
- function registerEmbed(loader, customEmbedMeta) {
471
- if (loader) {
472
- loader.registerComponent(Embed, customEmbedMeta != null ? customEmbedMeta : embedMeta);
473
- } else {
474
- registerComponent(Embed, customEmbedMeta != null ? customEmbedMeta : embedMeta);
475
- }
476
- }
477
-
478
412
  function Iframe(_ref) {
479
413
  var preview = _ref.preview,
480
414
  src = _ref.src,
@@ -612,13 +546,13 @@ var scrollRevealerMeta = {
612
546
  scrollDownThreshold: {
613
547
  type: "number",
614
548
  displayName: "Scroll down threshold",
615
- // defaultValueHint: 0.5,
549
+ defaultValueHint: 0.5,
616
550
  description: "How much of the element (as a fraction) must you scroll into view for it to appear (defaults to 0.5)"
617
551
  },
618
552
  scrollUpThreshold: {
619
553
  type: "number",
620
554
  displayName: "Scroll up threshold",
621
- // defaultValueHint: 0,
555
+ defaultValueHint: 0,
622
556
  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)"
623
557
  }
624
558
  },
@@ -710,7 +644,6 @@ exports.DynamicCollectionGrid = DynamicCollectionGrid;
710
644
  exports.DynamicElement = DynamicElement;
711
645
  exports.DynamicImage = DynamicImage;
712
646
  exports.DynamicText = DynamicText;
713
- exports.Embed = Embed;
714
647
  exports.Iframe = Iframe;
715
648
  exports.ScrollRevealer = ScrollRevealer;
716
649
  exports.Video = Video;
@@ -723,7 +656,6 @@ exports.dynamicCollectionProps = dynamicCollectionProps;
723
656
  exports.dynamicElementMeta = dynamicElementMeta;
724
657
  exports.dynamicImageMeta = dynamicImageMeta;
725
658
  exports.dynamicTextMeta = dynamicTextMeta;
726
- exports.embedMeta = embedMeta;
727
659
  exports.iframeMeta = iframeMeta;
728
660
  exports.registerDataProvider = registerDataProvider;
729
661
  exports.registerDynamicCollection = registerDynamicCollection;
@@ -731,7 +663,6 @@ exports.registerDynamicCollectionGrid = registerDynamicCollectionGrid;
731
663
  exports.registerDynamicElement = registerDynamicElement;
732
664
  exports.registerDynamicImage = registerDynamicImage;
733
665
  exports.registerDynamicText = registerDynamicText;
734
- exports.registerEmbed = registerEmbed;
735
666
  exports.registerIframe = registerIframe;
736
667
  exports.registerScrollRevealer = registerScrollRevealer;
737
668
  exports.registerVideo = registerVideo;
@@ -1 +1 @@
1
- {"version":3,"file":"plasmic-basic-components.cjs.development.js","sources":["../src/common.ts","../src/Data.tsx","../src/Embed.tsx","../src/Iframe.tsx","../src/ScrollRevealer.tsx","../src/Video.tsx"],"sourcesContent":["export const tuple = <T extends any[]>(...args: T): T => args;\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n","import { ComponentMeta, repeatedElement } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, {\n ComponentProps,\n createContext,\n createElement,\n CSSProperties,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n name?: string;\n data?: any;\n children?: ReactNode;\n}\n\nexport function DataProvider({ name, data, children }: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider value={{ ...existingEnv, [name]: data }}>\n {children}\n </DataContext.Provider>\n );\n }\n}\n\nexport interface CommonDynamicProps {\n className?: string;\n tag?: string;\n propSelectors?: SelectorDict;\n}\n\nexport function DynamicElement<\n Tag extends keyof JSX.IntrinsicElements = \"div\"\n>({\n tag = \"div\",\n className,\n children,\n propSelectors,\n ...props\n}: CommonDynamicProps & ComponentProps<Tag>) {\n const computed = useSelectors(propSelectors);\n return createElement(tag, {\n children,\n ...props,\n ...computed,\n className: className + \" \" + computed.className,\n });\n}\n\nexport 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 DynamicCollectionProps extends CommonDynamicProps {\n children?: ReactNode;\n style?: CSSProperties;\n loopItemName?: string;\n keySelector?: string;\n selector?: string;\n data?: any;\n}\n\nexport function DynamicCollection({\n selector,\n loopItemName,\n children,\n data,\n keySelector,\n ...props\n}: DynamicCollectionProps) {\n // Defaults to an array of three items.\n const finalData = data ?? useSelector(selector) ?? [1, 2, 3];\n return (\n <DynamicElement {...props}>\n {finalData?.map?.((item: any, index: number) => (\n <DataProvider\n key={applySelector(item, keySelector) ?? index}\n name={loopItemName}\n data={item}\n >\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ))}\n </DynamicElement>\n );\n}\n\nexport interface DynamicCollectionGridProps extends DynamicCollectionProps {\n columns?: number;\n columnGap?: number;\n rowGap?: number;\n}\n\nexport function DynamicCollectionGrid({\n columns,\n columnGap = 0,\n rowGap = 0,\n ...props\n}: DynamicCollectionGridProps) {\n return (\n <DynamicCollection\n {...props}\n style={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${columns}, 1fr)`,\n columnGap: `${columnGap}px`,\n rowGap: `${rowGap}px`,\n }}\n />\n );\n}\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components\";\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\nexport const dynamicCollectionProps = {\n ...dynamicProps,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField\",\n },\n loopItemName: {\n type: \"string\",\n defaultValue: \"item\",\n description:\n \"The name of the variable to use to store the current item in the loop\",\n },\n children: \"slot\",\n} as const;\n\nexport const dynamicCollectionMeta: ComponentMeta<DynamicCollectionProps> = {\n name: \"hostless-dynamic-collection\",\n displayName: \"Dynamic Collection\",\n importName: \"DynamicCollection\",\n importPath: thisModule,\n props: dynamicCollectionProps,\n};\n\nexport function registerDynamicCollection(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicCollectionMeta?: ComponentMeta<DynamicCollectionProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicCollection,\n customDynamicCollectionMeta ?? dynamicCollectionMeta\n );\n } else {\n registerComponent(\n DynamicCollection,\n customDynamicCollectionMeta ?? dynamicCollectionMeta\n );\n }\n}\n\nexport const dynamicCollectionGridProps = {\n ...dynamicCollectionProps,\n columns: {\n type: \"number\",\n defaultValue: 2,\n description: \"The number of columns to use in the grid\",\n },\n columnGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between columns\",\n },\n rowGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between rows\",\n },\n} as const;\n\nexport const dynamicCollectionGridMeta: ComponentMeta<DynamicCollectionGridProps> = {\n name: \"hostless-dynamic-collection-grid\",\n displayName: \"Dynamic Collection Grid\",\n importName: \"DynamicCollectionGrid\",\n importPath: thisModule,\n props: dynamicCollectionGridProps,\n};\n\nexport function registerDynamicCollectionGrid(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicCollectionGridMeta?: ComponentMeta<DynamicCollectionGridProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicCollectionGrid,\n customDynamicCollectionGridMeta ?? dynamicCollectionGridMeta\n );\n } else {\n registerComponent(\n DynamicCollectionGrid,\n customDynamicCollectionGridMeta ?? dynamicCollectionGridMeta\n );\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useRef } from \"react\";\nimport { ensure } from \"./common\";\n\nexport interface EmbedProps {\n className?: string;\n code: string;\n hideInEditor?: boolean;\n}\n\nexport default function Embed({\n className,\n code,\n hideInEditor = false,\n}: EmbedProps) {\n const rootElt = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (hideInEditor) {\n return;\n }\n Array.from(ensure(rootElt.current).querySelectorAll(\"script\")).forEach(\n (oldScript) => {\n const newScript = document.createElement(\"script\");\n Array.from(oldScript.attributes).forEach((attr) =>\n newScript.setAttribute(attr.name, attr.value)\n );\n newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n ensure(oldScript.parentNode).replaceChild(newScript, oldScript);\n }\n );\n }, [code, hideInEditor]);\n const effectiveCode = hideInEditor ? \"\" : code;\n return (\n <div\n ref={rootElt}\n className={className}\n dangerouslySetInnerHTML={{ __html: effectiveCode }}\n />\n );\n}\n\nexport const embedMeta: ComponentMeta<EmbedProps> = {\n name: \"hostless-embed\",\n displayName: \"Embed\",\n importName: \"Embed\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n code: {\n type: \"string\",\n defaultValue: \"https://www.example.com\",\n },\n hideInEditor: {\n type: \"boolean\",\n displayName: \"Hide in editor\",\n description:\n \"Disable running the code while editing in Plasmic Studio (may require reload)\",\n editOnly: true,\n },\n },\n defaultStyles: {\n maxWidth: \"100%\",\n },\n};\n\nexport function registerEmbed(\n loader?: { registerComponent: typeof registerComponent },\n customEmbedMeta?: ComponentMeta<EmbedProps>\n) {\n if (loader) {\n loader.registerComponent(Embed, customEmbedMeta ?? embedMeta);\n } else {\n registerComponent(Embed, customEmbedMeta ?? embedMeta);\n }\n}\n","import { ComponentMeta, PlasmicCanvasContext } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { useContext } from \"react\";\n\nexport interface IframeProps {\n src: string;\n preview?: boolean;\n className?: string;\n}\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","ensure","x","undefined","Error","DataContext","createContext","applySelector","rawData","selector","curData","split","key","useSelector","useDataEnv","useSelectors","selectors","Object","fromEntries","entries","filter","map","useContext","DataProvider","name","data","children","existingEnv","React","Provider","value","DynamicElement","tag","className","propSelectors","props","computed","createElement","DynamicText","DynamicImage","loading","style","objectFit","src","DynamicCollection","loopItemName","keySelector","finalData","item","index","repeatedElement","DynamicCollectionGrid","columns","columnGap","rowGap","display","gridTemplateColumns","thisModule","dataProviderMeta","displayName","importName","importPath","type","defaultValue","description","birthYear","profilePicture","registerDataProvider","loader","customDataProviderMeta","registerComponent","dynamicPropsWithoutTag","dynamicProps","dynamicElementMeta","registerDynamicElement","customDynamicElementMeta","dynamicTextMeta","registerDynamicText","customDynamicTextMeta","dynamicImageMeta","registerDynamicImage","customDynamicImageMeta","dynamicCollectionProps","dynamicCollectionMeta","registerDynamicCollection","customDynamicCollectionMeta","dynamicCollectionGridProps","dynamicCollectionGridMeta","registerDynamicCollectionGrid","customDynamicCollectionGridMeta","Embed","code","hideInEditor","rootElt","useRef","useEffect","Array","from","current","querySelectorAll","forEach","oldScript","newScript","document","attributes","attr","setAttribute","appendChild","createTextNode","innerHTML","parentNode","replaceChild","effectiveCode","ref","dangerouslySetInnerHTML","__html","embedMeta","editOnly","defaultStyles","maxWidth","registerEmbed","customEmbedMeta","Iframe","preview","isEditing","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","alignItems","justifyContent","overflow","iframeMeta","width","height","registerIframe","customIframeMeta","useDirectionalIntersection","scrollDownThreshold","scrollUpThreshold","useState","revealed","setRevealed","IntersectionObserver","handler","intersectionRatio","observer","root","rootMargin","threshold","observe","disconnect","ScrollRevealer","intersectionRef","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;SAESC,OAAUC;AACxB,MAAIA,CAAC,KAAK,IAAN,IAAcA,CAAC,KAAKC,SAAxB,EAAmC;AACjC;AACA,UAAM,IAAIC,KAAJ,uCAAN;AACD,GAHD,MAGO;AACL,WAAOF,CAAP;AACD;AACF;;ICKYG,WAAW,gBAAGC,mBAAa,CAAuBH,SA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AiB,CAAC8F,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"],"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 CSSProperties,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n name?: string;\n data?: any;\n children?: ReactNode;\n}\n\nexport function DataProvider({ name, data, children }: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider value={{ ...existingEnv, [name]: data }}>\n {children}\n </DataContext.Provider>\n );\n }\n}\n\nexport interface CommonDynamicProps {\n className?: string;\n tag?: string;\n propSelectors?: SelectorDict;\n}\n\nexport function DynamicElement<\n Tag extends keyof JSX.IntrinsicElements = \"div\"\n>({\n tag = \"div\",\n className,\n children,\n propSelectors,\n ...props\n}: CommonDynamicProps & ComponentProps<Tag>) {\n const computed = useSelectors(propSelectors);\n return createElement(tag, {\n children,\n ...props,\n ...computed,\n className: className + \" \" + computed.className,\n });\n}\n\nexport 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 DynamicCollectionProps extends CommonDynamicProps {\n children?: ReactNode;\n style?: CSSProperties;\n loopItemName?: string;\n keySelector?: string;\n selector?: string;\n data?: any;\n}\n\nexport function DynamicCollection({\n selector,\n loopItemName,\n children,\n data,\n keySelector,\n ...props\n}: DynamicCollectionProps) {\n // Defaults to an array of three items.\n const finalData = data ?? useSelector(selector) ?? [1, 2, 3];\n return (\n <DynamicElement {...props}>\n {finalData?.map?.((item: any, index: number) => (\n <DataProvider\n key={applySelector(item, keySelector) ?? index}\n name={loopItemName}\n data={item}\n >\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ))}\n </DynamicElement>\n );\n}\n\nexport interface DynamicCollectionGridProps extends DynamicCollectionProps {\n columns?: number;\n columnGap?: number;\n rowGap?: number;\n}\n\nexport function DynamicCollectionGrid({\n columns,\n columnGap = 0,\n rowGap = 0,\n ...props\n}: DynamicCollectionGridProps) {\n return (\n <DynamicCollection\n {...props}\n style={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${columns}, 1fr)`,\n columnGap: `${columnGap}px`,\n rowGap: `${rowGap}px`,\n }}\n />\n );\n}\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components\";\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\nexport const dynamicCollectionProps = {\n ...dynamicProps,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField\",\n },\n loopItemName: {\n type: \"string\",\n defaultValue: \"item\",\n description:\n \"The name of the variable to use to store the current item in the loop\",\n },\n children: \"slot\",\n} as const;\n\nexport const dynamicCollectionMeta: ComponentMeta<DynamicCollectionProps> = {\n name: \"hostless-dynamic-collection\",\n displayName: \"Dynamic Collection\",\n importName: \"DynamicCollection\",\n importPath: thisModule,\n props: dynamicCollectionProps,\n};\n\nexport function registerDynamicCollection(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicCollectionMeta?: ComponentMeta<DynamicCollectionProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicCollection,\n customDynamicCollectionMeta ?? dynamicCollectionMeta\n );\n } else {\n registerComponent(\n DynamicCollection,\n customDynamicCollectionMeta ?? dynamicCollectionMeta\n );\n }\n}\n\nexport const dynamicCollectionGridProps = {\n ...dynamicCollectionProps,\n columns: {\n type: \"number\",\n defaultValue: 2,\n description: \"The number of columns to use in the grid\",\n },\n columnGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between columns\",\n },\n rowGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between rows\",\n },\n} as const;\n\nexport const dynamicCollectionGridMeta: ComponentMeta<DynamicCollectionGridProps> = {\n name: \"hostless-dynamic-collection-grid\",\n displayName: \"Dynamic Collection Grid\",\n importName: \"DynamicCollectionGrid\",\n importPath: thisModule,\n props: dynamicCollectionGridProps,\n};\n\nexport function registerDynamicCollectionGrid(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicCollectionGridMeta?: ComponentMeta<DynamicCollectionGridProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicCollectionGrid,\n customDynamicCollectionGridMeta ?? dynamicCollectionGridMeta\n );\n } else {\n registerComponent(\n DynamicCollectionGrid,\n customDynamicCollectionGridMeta ?? dynamicCollectionGridMeta\n );\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","applySelector","rawData","selector","curData","split","key","useSelector","useDataEnv","useSelectors","selectors","Object","fromEntries","entries","filter","map","useContext","DataProvider","name","data","children","existingEnv","React","Provider","value","DynamicElement","tag","className","propSelectors","props","computed","createElement","DynamicText","DynamicImage","loading","style","objectFit","src","DynamicCollection","loopItemName","keySelector","finalData","item","index","repeatedElement","DynamicCollectionGrid","columns","columnGap","rowGap","display","gridTemplateColumns","thisModule","dataProviderMeta","displayName","importName","importPath","type","defaultValue","description","birthYear","profilePicture","registerDataProvider","loader","customDataProviderMeta","registerComponent","dynamicPropsWithoutTag","defaultValueHint","dynamicProps","dynamicElementMeta","registerDynamicElement","customDynamicElementMeta","dynamicTextMeta","registerDynamicText","customDynamicTextMeta","dynamicImageMeta","registerDynamicImage","customDynamicImageMeta","dynamicCollectionProps","dynamicCollectionMeta","registerDynamicCollection","customDynamicCollectionMeta","dynamicCollectionGridProps","dynamicCollectionGridMeta","registerDynamicCollectionGrid","customDynamicCollectionGridMeta","Iframe","preview","isEditing","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","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;;ICcMC,WAAW,gBAAGC,mBAAa,CAAuBC,SAAvB,CAAjC;AAEP,SAAgBC,cACdC,SACAC;AAEA,MAAI,CAACA,QAAL,EAAe;AACb,WAAOH,SAAP;AACD;;AACD,MAAII,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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nD;AACD,GAFD,MAEO;AACLvE,IAAAA,iBAAiB,CAACqE,KAAD,EAAQY,eAAR,WAAQA,eAAR,GAA2BV,SAA3B,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"),n=e(o);function a(){return(a=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,n={},a=Object.keys(e);for(o=0;o<a.length;o++)t.indexOf(r=a[o])>=0||(n[r]=e[r]);return n}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}function s(e){if(null==e)throw new Error("Value must not be undefined or null");return e}var c=o.createContext(void 0);function p(e,t){if(t){for(var r,o=e,n=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=n()).done;){var a;o=null==(a=o)?void 0:a[r.value]}return o}}function m(e){return p(u(),e)}function d(e){void 0===e&&(e={});var t=u();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 u(){return o.useContext(c)}function h(e){var t,r,o=e.name,i=e.data,l=e.children,s=null!=(t=u())?t:{};return o?n.createElement(c.Provider,{value:a({},s,(r={},r[o]=i,r))},l):n.createElement(n.Fragment,null,l)}function y(e){var t=e.tag,r=void 0===t?"div":t,n=e.className,l=e.children,s=e.propSelectors,c=i(e,["tag","className","children","propSelectors"]),p=d(s);return o.createElement(r,a({children:l},c,p,{className:n+" "+p.className}))}function f(e){var t=e.selector,r=e.propSelectors,o=i(e,["selector","propSelectors"]);return n.createElement(y,Object.assign({},o,{propSelectors:a({},r,{children:t})}),"(DynamicText requires a selector)")}function v(e){var t=e.selector,r=e.propSelectors,o=i(e,["selector","propSelectors"]);return n.createElement(y,Object.assign({tag:"img",loading:"lazy",style:{objectFit:"cover"}},o,{propSelectors:a({},r,{src:t}),src:"https://studio.plasmic.app/static/img/placeholder.png"}))}function g(e){var r,o=e.selector,a=e.loopItemName,l=e.children,s=e.data,c=e.keySelector,d=i(e,["selector","loopItemName","children","data","keySelector"]),u=null!=(r=null!=s?s:m(o))?r:[1,2,3];return n.createElement(y,Object.assign({},d),null==u||null==u.map?void 0:u.map((function(e,r){var o;return n.createElement(h,{key:null!=(o=p(e,c))?o:r,name:a,data:e},t.repeatedElement(0===r,l))})))}function b(e){var t=e.columns,r=e.columnGap,o=void 0===r?0:r,a=e.rowGap,l=void 0===a?0:a,s=i(e,["columns","columnGap","rowGap"]);return n.createElement(g,Object.assign({},s,{style:{display:"grid",gridTemplateColumns:"repeat("+t+", 1fr)",columnGap:o+"px",rowGap:l+"px"}}))}var x="@plasmicpkgs/plasmic-basic-components",w={name:"hostless-data-provider",displayName:"Data Provider",importName:"DataProvider",importPath:x,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",description:"An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value."}},S=a({},N,{tag:{type:"string",description:"The HTML tag to use"}}),C={name:"hostless-dynamic-element",displayName:"Dynamic Element",importName:"DynamicElement",importPath:x,props:a({},S,{children:"slot"})},E={name:"hostless-dynamic-text",importName:"DynamicText",displayName:"Dynamic Text",importPath:x,props:a({},S,{selector:{type:"string",description:"The selector expression to use to get the text, such as: someVariable.0.someField"}})},D={name:"hostless-dynamic-image",displayName:"Dynamic Image",importName:"DynamicImage",importPath:x,props:a({},N,{selector:{type:"string",description:"The selector expression to use to get the image source URL, such as: someVariable.0.someField"}})},P=a({},S,{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"}),T={name:"hostless-dynamic-collection",displayName:"Dynamic Collection",importName:"DynamicCollection",importPath:x,props:P},I=a({},P,{columns:{type:"number",defaultValue:2,description:"The number of columns to use in the grid"},columnGap:{type:"number",defaultValue:8,description:"The gap between columns"},rowGap:{type:"number",defaultValue:8,description:"The gap between rows"}}),j={name:"hostless-dynamic-collection-grid",displayName:"Dynamic Collection Grid",importName:"DynamicCollectionGrid",importPath:x,props:I};function M(e){var t=e.className,r=e.code,a=e.hideInEditor,i=void 0!==a&&a,l=o.useRef(null);return o.useEffect((function(){i||Array.from(s(l.current).querySelectorAll("script")).forEach((function(e){var t=document.createElement("script");Array.from(e.attributes).forEach((function(e){return t.setAttribute(e.name,e.value)})),t.appendChild(document.createTextNode(e.innerHTML)),s(e.parentNode).replaceChild(t,e)}))}),[r,i]),n.createElement("div",{ref:l,className:t,dangerouslySetInnerHTML:{__html:i?"":r}})}var O={name:"hostless-embed",displayName:"Embed",importName:"Embed",importPath:"@plasmicpkgs/plasmic-basic-components",props:{code:{type:"string",defaultValue:"https://www.example.com"},hideInEditor:{type:"boolean",displayName:"Hide in editor",description:"Disable running the code while editing in Plasmic Studio (may require reload)",editOnly:!0}},defaultStyles:{maxWidth:"100%"}};function V(e){var r=e.preview,a=e.src,i=e.className;return o.useContext(t.PlasmicCanvasContext)&&!r?n.createElement("div",{className:i},n.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")):n.createElement("iframe",{src:a,className:i})}var G={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 A(e){var t=e.ref,r=e.scrollDownThreshold,n=void 0===r?.5:r,a=e.scrollUpThreshold,i=void 0===a?0:a,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>=n?c(!0):e[0].intersectionRatio<=i&&c(!1)}),{root:null,rootMargin:"0%",threshold:[i,n]});return e.observe(t.current),function(){c(!1),e.disconnect()}}return function(){}}),[t.current,n,i]),s}function R(e){var t=e.children,r=e.className,a=e.scrollDownThreshold,i=void 0===a?.5:a,l=e.scrollUpThreshold,s=void 0===l?0:l,c=o.useRef(null),p=A({ref:c,scrollUpThreshold:s,scrollDownThreshold:i});return n.createElement("div",{className:r,ref:c},p?t:null)}var k={name:"hostless-scroll-revealer",importName:"ScrollRevealer",displayName:"Scroll Revealer",importPath:"@plasmicpkgs/plasmic-basic-components",props:{children:"slot",scrollDownThreshold:{type:"number",displayName:"Scroll down threshold",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",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%"}},U=n.forwardRef((function(e,t){return n.createElement("video",Object.assign({ref:t},e))})),W={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=c,exports.DataProvider=h,exports.DynamicCollection=g,exports.DynamicCollectionGrid=b,exports.DynamicElement=y,exports.DynamicImage=v,exports.DynamicText=f,exports.Embed=M,exports.Iframe=V,exports.ScrollRevealer=R,exports.Video=U,exports.applySelector=p,exports.dataProviderMeta=w,exports.dynamicCollectionGridMeta=j,exports.dynamicCollectionGridProps=I,exports.dynamicCollectionMeta=T,exports.dynamicCollectionProps=P,exports.dynamicElementMeta=C,exports.dynamicImageMeta=D,exports.dynamicTextMeta=E,exports.embedMeta=O,exports.iframeMeta=G,exports.registerDataProvider=function(e,t){e?e.registerComponent(h,null!=t?t:w):r(h,null!=t?t:w)},exports.registerDynamicCollection=function(e,t){e?e.registerComponent(g,null!=t?t:T):r(g,null!=t?t:T)},exports.registerDynamicCollectionGrid=function(e,t){e?e.registerComponent(b,null!=t?t:j):r(b,null!=t?t:j)},exports.registerDynamicElement=function(e,t){e?e.registerComponent(y,null!=t?t:C):r(y,null!=t?t:C)},exports.registerDynamicImage=function(e,t){e?e.registerComponent(v,null!=t?t:D):r(v,null!=t?t:D)},exports.registerDynamicText=function(e,t){e?e.registerComponent(f,null!=t?t:E):r(f,null!=t?t:E)},exports.registerEmbed=function(e,t){e?e.registerComponent(M,null!=t?t:O):r(M,null!=t?t:O)},exports.registerIframe=function(e,t){e?e.registerComponent(V,null!=t?t:G):r(V,null!=t?t:G)},exports.registerScrollRevealer=function(e,t){e?e.registerComponent(R,null!=t?t:k):r(R,null!=t?t:k)},exports.registerVideo=function(e,t){e?e.registerComponent(U,null!=t?t:W):r(U,null!=t?t:W)},exports.scrollRevealerMeta=k,exports.useDataEnv=u,exports.useDirectionalIntersection=A,exports.useSelector=m,exports.useSelectors=d,exports.videoMeta=W;
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"),n=e(o);function a(){return(a=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,n={},a=Object.keys(e);for(o=0;o<a.length;o++)t.indexOf(r=a[o])>=0||(n[r]=e[r]);return n}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);function c(e,t){if(t){for(var r,o=e,n=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=n()).done;){var a;o=null==(a=o)?void 0:a[r.value]}return o}}function p(e){return c(u(),e)}function m(e){void 0===e&&(e={});var t=u();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 u(){return o.useContext(s)}function d(e){var t,r,o=e.name,i=e.data,l=e.children,c=null!=(t=u())?t:{};return o?n.createElement(s.Provider,{value:a({},c,(r={},r[o]=i,r))},l):n.createElement(n.Fragment,null,l)}function h(e){var t=e.tag,r=void 0===t?"div":t,n=e.className,l=e.children,s=e.propSelectors,c=i(e,["tag","className","children","propSelectors"]),p=m(s);return o.createElement(r,a({children:l},c,p,{className:n+" "+p.className}))}function y(e){var t=e.selector,r=e.propSelectors,o=i(e,["selector","propSelectors"]);return n.createElement(h,Object.assign({},o,{propSelectors:a({},r,{children:t})}),"(DynamicText requires a selector)")}function f(e){var t=e.selector,r=e.propSelectors,o=i(e,["selector","propSelectors"]);return n.createElement(h,Object.assign({tag:"img",loading:"lazy",style:{objectFit:"cover"}},o,{propSelectors:a({},r,{src:t}),src:"https://studio.plasmic.app/static/img/placeholder.png"}))}function v(e){var r,o=e.selector,a=e.loopItemName,l=e.children,s=e.data,m=e.keySelector,u=i(e,["selector","loopItemName","children","data","keySelector"]),y=null!=(r=null!=s?s:p(o))?r:[1,2,3];return n.createElement(h,Object.assign({},u),null==y||null==y.map?void 0:y.map((function(e,r){var o;return n.createElement(d,{key:null!=(o=c(e,m))?o:r,name:a,data:e},t.repeatedElement(0===r,l))})))}function g(e){var t=e.columns,r=e.columnGap,o=void 0===r?0:r,a=e.rowGap,l=void 0===a?0:a,s=i(e,["columns","columnGap","rowGap"]);return n.createElement(v,Object.assign({},s,{style:{display:"grid",gridTemplateColumns:"repeat("+t+", 1fr)",columnGap:o+"px",rowGap:l+"px"}}))}var b="@plasmicpkgs/plasmic-basic-components",x={name:"hostless-data-provider",displayName:"Data Provider",importName:"DataProvider",importPath:b,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"}}]}}},w={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."}},N=a({},w,{tag:{type:"string",defaultValueHint:"div",description:"The HTML tag to use"}}),C={name:"hostless-dynamic-element",displayName:"Dynamic Element",importName:"DynamicElement",importPath:b,props:a({},N,{children:"slot"})},S={name:"hostless-dynamic-text",importName:"DynamicText",displayName:"Dynamic Text",importPath:b,props:a({},N,{selector:{type:"string",description:"The selector expression to use to get the text, such as: someVariable.0.someField"}})},D={name:"hostless-dynamic-image",displayName:"Dynamic Image",importName:"DynamicImage",importPath:b,props:a({},w,{selector:{type:"string",description:"The selector expression to use to get the image source URL, such as: someVariable.0.someField"}})},P=a({},N,{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"}),T={name:"hostless-dynamic-collection",displayName:"Dynamic Collection",importName:"DynamicCollection",importPath:b,props:P},E=a({},P,{columns:{type:"number",defaultValue:2,description:"The number of columns to use in the grid"},columnGap:{type:"number",defaultValue:8,description:"The gap between columns"},rowGap:{type:"number",defaultValue:8,description:"The gap between rows"}}),I={name:"hostless-dynamic-collection-grid",displayName:"Dynamic Collection Grid",importName:"DynamicCollectionGrid",importPath:b,props:E};function j(e){var r=e.preview,a=e.src,i=e.className;return o.useContext(t.PlasmicCanvasContext)&&!r?n.createElement("div",{className:i},n.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")):n.createElement("iframe",{src:a,className:i})}var V={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 O(e){var t=e.ref,r=e.scrollDownThreshold,n=void 0===r?.5:r,a=e.scrollUpThreshold,i=void 0===a?0:a,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>=n?c(!0):e[0].intersectionRatio<=i&&c(!1)}),{root:null,rootMargin:"0%",threshold:[i,n]});return e.observe(t.current),function(){c(!1),e.disconnect()}}return function(){}}),[t.current,n,i]),s}function M(e){var t=e.children,r=e.className,a=e.scrollDownThreshold,i=void 0===a?.5:a,l=e.scrollUpThreshold,s=void 0===l?0:l,c=o.useRef(null),p=O({ref:c,scrollUpThreshold:s,scrollDownThreshold:i});return n.createElement("div",{className:r,ref:c},p?t:null)}var G={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%"}},R=n.forwardRef((function(e,t){return n.createElement("video",Object.assign({ref:t},e))})),U={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=d,exports.DynamicCollection=v,exports.DynamicCollectionGrid=g,exports.DynamicElement=h,exports.DynamicImage=f,exports.DynamicText=y,exports.Iframe=j,exports.ScrollRevealer=M,exports.Video=R,exports.applySelector=c,exports.dataProviderMeta=x,exports.dynamicCollectionGridMeta=I,exports.dynamicCollectionGridProps=E,exports.dynamicCollectionMeta=T,exports.dynamicCollectionProps=P,exports.dynamicElementMeta=C,exports.dynamicImageMeta=D,exports.dynamicTextMeta=S,exports.iframeMeta=V,exports.registerDataProvider=function(e,t){e?e.registerComponent(d,null!=t?t:x):r(d,null!=t?t:x)},exports.registerDynamicCollection=function(e,t){e?e.registerComponent(v,null!=t?t:T):r(v,null!=t?t:T)},exports.registerDynamicCollectionGrid=function(e,t){e?e.registerComponent(g,null!=t?t:I):r(g,null!=t?t:I)},exports.registerDynamicElement=function(e,t){e?e.registerComponent(h,null!=t?t:C):r(h,null!=t?t:C)},exports.registerDynamicImage=function(e,t){e?e.registerComponent(f,null!=t?t:D):r(f,null!=t?t:D)},exports.registerDynamicText=function(e,t){e?e.registerComponent(y,null!=t?t:S):r(y,null!=t?t:S)},exports.registerIframe=function(e,t){e?e.registerComponent(j,null!=t?t:V):r(j,null!=t?t:V)},exports.registerScrollRevealer=function(e,t){e?e.registerComponent(M,null!=t?t:G):r(M,null!=t?t:G)},exports.registerVideo=function(e,t){e?e.registerComponent(R,null!=t?t:U):r(R,null!=t?t:U)},exports.scrollRevealerMeta=G,exports.useDataEnv=u,exports.useDirectionalIntersection=O,exports.useSelector=p,exports.useSelectors=m,exports.videoMeta=U;
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/Embed.tsx","../src/Iframe.tsx","../src/ScrollRevealer.tsx","../src/Video.tsx"],"sourcesContent":["export const tuple = <T extends any[]>(...args: T): T => args;\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n","import { ComponentMeta, repeatedElement } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, {\n ComponentProps,\n createContext,\n createElement,\n CSSProperties,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n name?: string;\n data?: any;\n children?: ReactNode;\n}\n\nexport function DataProvider({ name, data, children }: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider value={{ ...existingEnv, [name]: data }}>\n {children}\n </DataContext.Provider>\n );\n }\n}\n\nexport interface CommonDynamicProps {\n className?: string;\n tag?: string;\n propSelectors?: SelectorDict;\n}\n\nexport function DynamicElement<\n Tag extends keyof JSX.IntrinsicElements = \"div\"\n>({\n tag = \"div\",\n className,\n children,\n propSelectors,\n ...props\n}: CommonDynamicProps & ComponentProps<Tag>) {\n const computed = useSelectors(propSelectors);\n return createElement(tag, {\n children,\n ...props,\n ...computed,\n className: className + \" \" + computed.className,\n });\n}\n\nexport 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 DynamicCollectionProps extends CommonDynamicProps {\n children?: ReactNode;\n style?: CSSProperties;\n loopItemName?: string;\n keySelector?: string;\n selector?: string;\n data?: any;\n}\n\nexport function DynamicCollection({\n selector,\n loopItemName,\n children,\n data,\n keySelector,\n ...props\n}: DynamicCollectionProps) {\n // Defaults to an array of three items.\n const finalData = data ?? useSelector(selector) ?? [1, 2, 3];\n return (\n <DynamicElement {...props}>\n {finalData?.map?.((item: any, index: number) => (\n <DataProvider\n key={applySelector(item, keySelector) ?? index}\n name={loopItemName}\n data={item}\n >\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ))}\n </DynamicElement>\n );\n}\n\nexport interface DynamicCollectionGridProps extends DynamicCollectionProps {\n columns?: number;\n columnGap?: number;\n rowGap?: number;\n}\n\nexport function DynamicCollectionGrid({\n columns,\n columnGap = 0,\n rowGap = 0,\n ...props\n}: DynamicCollectionGridProps) {\n return (\n <DynamicCollection\n {...props}\n style={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${columns}, 1fr)`,\n columnGap: `${columnGap}px`,\n rowGap: `${rowGap}px`,\n }}\n />\n );\n}\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components\";\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\nexport const dynamicCollectionProps = {\n ...dynamicProps,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField\",\n },\n loopItemName: {\n type: \"string\",\n defaultValue: \"item\",\n description:\n \"The name of the variable to use to store the current item in the loop\",\n },\n children: \"slot\",\n} as const;\n\nexport const dynamicCollectionMeta: ComponentMeta<DynamicCollectionProps> = {\n name: \"hostless-dynamic-collection\",\n displayName: \"Dynamic Collection\",\n importName: \"DynamicCollection\",\n importPath: thisModule,\n props: dynamicCollectionProps,\n};\n\nexport function registerDynamicCollection(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicCollectionMeta?: ComponentMeta<DynamicCollectionProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicCollection,\n customDynamicCollectionMeta ?? dynamicCollectionMeta\n );\n } else {\n registerComponent(\n DynamicCollection,\n customDynamicCollectionMeta ?? dynamicCollectionMeta\n );\n }\n}\n\nexport const dynamicCollectionGridProps = {\n ...dynamicCollectionProps,\n columns: {\n type: \"number\",\n defaultValue: 2,\n description: \"The number of columns to use in the grid\",\n },\n columnGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between columns\",\n },\n rowGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between rows\",\n },\n} as const;\n\nexport const dynamicCollectionGridMeta: ComponentMeta<DynamicCollectionGridProps> = {\n name: \"hostless-dynamic-collection-grid\",\n displayName: \"Dynamic Collection Grid\",\n importName: \"DynamicCollectionGrid\",\n importPath: thisModule,\n props: dynamicCollectionGridProps,\n};\n\nexport function registerDynamicCollectionGrid(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicCollectionGridMeta?: ComponentMeta<DynamicCollectionGridProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicCollectionGrid,\n customDynamicCollectionGridMeta ?? dynamicCollectionGridMeta\n );\n } else {\n registerComponent(\n DynamicCollectionGrid,\n customDynamicCollectionGridMeta ?? dynamicCollectionGridMeta\n );\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useRef } from \"react\";\nimport { ensure } from \"./common\";\n\nexport interface EmbedProps {\n className?: string;\n code: string;\n hideInEditor?: boolean;\n}\n\nexport default function Embed({\n className,\n code,\n hideInEditor = false,\n}: EmbedProps) {\n const rootElt = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (hideInEditor) {\n return;\n }\n Array.from(ensure(rootElt.current).querySelectorAll(\"script\")).forEach(\n (oldScript) => {\n const newScript = document.createElement(\"script\");\n Array.from(oldScript.attributes).forEach((attr) =>\n newScript.setAttribute(attr.name, attr.value)\n );\n newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n ensure(oldScript.parentNode).replaceChild(newScript, oldScript);\n }\n );\n }, [code, hideInEditor]);\n const effectiveCode = hideInEditor ? \"\" : code;\n return (\n <div\n ref={rootElt}\n className={className}\n dangerouslySetInnerHTML={{ __html: effectiveCode }}\n />\n );\n}\n\nexport const embedMeta: ComponentMeta<EmbedProps> = {\n name: \"hostless-embed\",\n displayName: \"Embed\",\n importName: \"Embed\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n code: {\n type: \"string\",\n defaultValue: \"https://www.example.com\",\n },\n hideInEditor: {\n type: \"boolean\",\n displayName: \"Hide in editor\",\n description:\n \"Disable running the code while editing in Plasmic Studio (may require reload)\",\n editOnly: true,\n },\n },\n defaultStyles: {\n maxWidth: \"100%\",\n },\n};\n\nexport function registerEmbed(\n loader?: { registerComponent: typeof registerComponent },\n customEmbedMeta?: ComponentMeta<EmbedProps>\n) {\n if (loader) {\n loader.registerComponent(Embed, customEmbedMeta ?? embedMeta);\n } else {\n registerComponent(Embed, customEmbedMeta ?? embedMeta);\n }\n}\n","import { ComponentMeta, PlasmicCanvasContext } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { useContext } from \"react\";\n\nexport interface IframeProps {\n src: string;\n preview?: boolean;\n className?: string;\n}\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":["ensure","x","Error","DataContext","createContext","undefined","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","DynamicCollection","loopItemName","keySelector","finalData","item","index","key","repeatedElement","DynamicCollectionGrid","columns","columnGap","rowGap","display","gridTemplateColumns","thisModule","dataProviderMeta","displayName","importName","importPath","type","defaultValue","description","birthYear","profilePicture","dynamicPropsWithoutTag","dynamicProps","dynamicElementMeta","dynamicTextMeta","dynamicImageMeta","dynamicCollectionProps","dynamicCollectionMeta","dynamicCollectionGridProps","dynamicCollectionGridMeta","Embed","code","hideInEditor","rootElt","useRef","useEffect","Array","from","current","querySelectorAll","forEach","oldScript","newScript","document","attributes","attr","setAttribute","appendChild","createTextNode","innerHTML","parentNode","replaceChild","ref","dangerouslySetInnerHTML","__html","embedMeta","editOnly","defaultStyles","maxWidth","Iframe","preview","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","alignItems","justifyContent","overflow","iframeMeta","width","height","useDirectionalIntersection","scrollDownThreshold","scrollUpThreshold","useState","revealed","setRevealed","IntersectionObserver","observer","intersectionRatio","root","rootMargin","threshold","observe","disconnect","ScrollRevealer","intersectionRef","scrollRevealerMeta","Video","forwardRef","videoMeta","autoPlay","controls","playsInline","loop","muted","poster","preload","options","loader","customDataProviderMeta","registerComponent","customDynamicCollectionMeta","customDynamicCollectionGridMeta","customDynamicElementMeta","customDynamicImageMeta","customDynamicTextMeta","customEmbedMeta","customIframeMeta","customScrollRevealerMeta","customVideoMeta"],"mappings":"+rBAEgBA,EAAUC,MACpBA,MAAAA,QAEI,IAAIC,oDAEHD,MCOEE,EAAcC,qBAAoCC,YAE/CC,EACdC,EACAC,MAEKA,aAGDC,EAAUF,wrBACIC,EAASE,MAAM,qBAAM,OACrCD,WAAUA,UAAAE,kBAELF,YAKOG,EAAYJ,UAEnBF,EADSO,IACcL,YAGhBM,EAAaC,YAAAA,IAAAA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CAtC5DiF,EACAO,GAEIP,EACFA,EAAOE,kBACLrH,QACA0H,EAAAA,EAAyBzF,GAG3BoF,EAAkBrH,QAAa0H,EAAAA,EAAyBzF,mCC1Q1DkF,EACAQ,GAEIR,EACFA,EAAOE,kBAAkB9E,QAAOoF,EAAAA,EAAmB3D,GAEnDqD,EAAkB9E,QAAOoF,EAAAA,EAAmB3D,oCCT9CmD,EACAS,GAEIT,EACFA,EAAOE,kBAAkBjD,QAAQwD,EAAAA,EAAoBxC,GAErDiC,EAAkBjD,QAAQwD,EAAAA,EAAoBxC,4CCyChD+B,EACAU,GAEIV,EACFA,EAAOE,kBACLhB,QACAwB,EAAAA,EAA4BtB,GAG9Bc,EACEhB,QACAwB,EAAAA,EAA4BtB,mCCpChCY,EACAW,GAEIX,EACFA,EAAOE,kBAAkBb,QAAOsB,EAAAA,EAAmBpB,GAEnDW,EAAkBb,QAAOsB,EAAAA,EAAmBpB"}
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 CSSProperties,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n name?: string;\n data?: any;\n children?: ReactNode;\n}\n\nexport function DataProvider({ name, data, children }: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider value={{ ...existingEnv, [name]: data }}>\n {children}\n </DataContext.Provider>\n );\n }\n}\n\nexport interface CommonDynamicProps {\n className?: string;\n tag?: string;\n propSelectors?: SelectorDict;\n}\n\nexport function DynamicElement<\n Tag extends keyof JSX.IntrinsicElements = \"div\"\n>({\n tag = \"div\",\n className,\n children,\n propSelectors,\n ...props\n}: CommonDynamicProps & ComponentProps<Tag>) {\n const computed = useSelectors(propSelectors);\n return createElement(tag, {\n children,\n ...props,\n ...computed,\n className: className + \" \" + computed.className,\n });\n}\n\nexport 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 DynamicCollectionProps extends CommonDynamicProps {\n children?: ReactNode;\n style?: CSSProperties;\n loopItemName?: string;\n keySelector?: string;\n selector?: string;\n data?: any;\n}\n\nexport function DynamicCollection({\n selector,\n loopItemName,\n children,\n data,\n keySelector,\n ...props\n}: DynamicCollectionProps) {\n // Defaults to an array of three items.\n const finalData = data ?? useSelector(selector) ?? [1, 2, 3];\n return (\n <DynamicElement {...props}>\n {finalData?.map?.((item: any, index: number) => (\n <DataProvider\n key={applySelector(item, keySelector) ?? index}\n name={loopItemName}\n data={item}\n >\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ))}\n </DynamicElement>\n );\n}\n\nexport interface DynamicCollectionGridProps extends DynamicCollectionProps {\n columns?: number;\n columnGap?: number;\n rowGap?: number;\n}\n\nexport function DynamicCollectionGrid({\n columns,\n columnGap = 0,\n rowGap = 0,\n ...props\n}: DynamicCollectionGridProps) {\n return (\n <DynamicCollection\n {...props}\n style={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${columns}, 1fr)`,\n columnGap: `${columnGap}px`,\n rowGap: `${rowGap}px`,\n }}\n />\n );\n}\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components\";\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\nexport const dynamicCollectionProps = {\n ...dynamicProps,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField\",\n },\n loopItemName: {\n type: \"string\",\n defaultValue: \"item\",\n description:\n \"The name of the variable to use to store the current item in the loop\",\n },\n children: \"slot\",\n} as const;\n\nexport const dynamicCollectionMeta: ComponentMeta<DynamicCollectionProps> = {\n name: \"hostless-dynamic-collection\",\n displayName: \"Dynamic Collection\",\n importName: \"DynamicCollection\",\n importPath: thisModule,\n props: dynamicCollectionProps,\n};\n\nexport function registerDynamicCollection(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicCollectionMeta?: ComponentMeta<DynamicCollectionProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicCollection,\n customDynamicCollectionMeta ?? dynamicCollectionMeta\n );\n } else {\n registerComponent(\n DynamicCollection,\n customDynamicCollectionMeta ?? dynamicCollectionMeta\n );\n }\n}\n\nexport const dynamicCollectionGridProps = {\n ...dynamicCollectionProps,\n columns: {\n type: \"number\",\n defaultValue: 2,\n description: \"The number of columns to use in the grid\",\n },\n columnGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between columns\",\n },\n rowGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between rows\",\n },\n} as const;\n\nexport const dynamicCollectionGridMeta: ComponentMeta<DynamicCollectionGridProps> = {\n name: \"hostless-dynamic-collection-grid\",\n displayName: \"Dynamic Collection Grid\",\n importName: \"DynamicCollectionGrid\",\n importPath: thisModule,\n props: dynamicCollectionGridProps,\n};\n\nexport function registerDynamicCollectionGrid(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicCollectionGridMeta?: ComponentMeta<DynamicCollectionGridProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicCollectionGrid,\n customDynamicCollectionGridMeta ?? dynamicCollectionGridMeta\n );\n } else {\n registerComponent(\n DynamicCollectionGrid,\n customDynamicCollectionGridMeta ?? dynamicCollectionGridMeta\n );\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","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","DynamicCollection","loopItemName","keySelector","finalData","item","index","key","repeatedElement","DynamicCollectionGrid","columns","columnGap","rowGap","display","gridTemplateColumns","thisModule","dataProviderMeta","displayName","importName","importPath","type","defaultValue","description","birthYear","profilePicture","dynamicPropsWithoutTag","defaultValueHint","dynamicProps","dynamicElementMeta","dynamicTextMeta","dynamicImageMeta","dynamicCollectionProps","dynamicCollectionMeta","dynamicCollectionGridProps","dynamicCollectionGridMeta","Iframe","preview","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","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","customDynamicCollectionMeta","customDynamicCollectionGridMeta","customDynamicElementMeta","customDynamicImageMeta","customDynamicTextMeta","customIframeMeta","customScrollRevealerMeta","customVideoMeta"],"mappings":"srBAAO,ICcMA,EAAcC,qBAAoCC,YAE/CC,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,mBD1CU,sCAAqBC,2BAAAA,yBAAeA,EC0CzBC,MAAWhB,EAAcC,aAIzD,SAAgBM,WACPU,aAAWpB,YASJqB,aAAeC,IAAAA,KAAMC,IAAAA,KAAMC,IAAAA,SACnCC,WAAcf,OAAgB,UAC/BY,EAIDI,gBAAC1B,EAAY2B,UAASC,WAAYH,UAAcH,GAAOC,OACpDC,GAJEE,gCAAGF,YA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AA,EAAmC1D,4CA1JvCsD,EACAK,GAEIL,EACFA,EAAOE,kBACLtG,QACAyG,EAAAA,EAA4BjE,GAG9B8D,EACEtG,QACAyG,EAAAA,EAA4BjE,0CAkDhC4D,EACAM,GAEIN,EACFA,EAAOE,kBACL9F,QACAkG,EAAAA,EAA0BhE,GAG5B4D,EAAkB9F,QAAckG,EAAAA,EAA0BhE,yCAtC5D0D,EACAO,GAEIP,EACFA,EAAOE,kBACL/F,QACAoG,EAAAA,EAAyBlE,GAG3B6D,EAAkB/F,QAAaoG,EAAAA,EAAyBlE,oCC7Q1D2D,EACAQ,GAEIR,EACFA,EAAOE,kBAAkBvD,QAAQ6D,EAAAA,EAAoB7C,GAErDuC,EAAkBvD,QAAQ6D,EAAAA,EAAoB7C,4CCyChDqC,EACAS,GAEIT,EACFA,EAAOE,kBACLjB,QACAwB,EAAAA,EAA4BrB,GAG9Bc,EACEjB,QACAwB,EAAAA,EAA4BrB,mCCpChCY,EACAU,GAEIV,EACFA,EAAOE,kBAAkBb,QAAOqB,EAAAA,EAAmBnB,GAEnDW,EAAkBb,QAAOqB,EAAAA,EAAmBnB"}
@@ -1,6 +1,6 @@
1
1
  import { repeatedElement, PlasmicCanvasContext } from '@plasmicapp/host';
2
2
  import registerComponent from '@plasmicapp/host/registerComponent';
3
- import React, { createContext, useContext, createElement, useRef, useEffect, useState } from 'react';
3
+ import React, { createContext, useContext, createElement, useRef, useState, useEffect } from 'react';
4
4
 
5
5
  function _extends() {
6
6
  _extends = Object.assign || function (target) {
@@ -80,14 +80,6 @@ var tuple = function tuple() {
80
80
 
81
81
  return args;
82
82
  };
83
- function ensure(x) {
84
- if (x === null || x === undefined) {
85
- debugger;
86
- throw new Error("Value must not be undefined or null");
87
- } else {
88
- return x;
89
- }
90
- }
91
83
 
92
84
  var DataContext = /*#__PURE__*/createContext(undefined);
93
85
  function applySelector(rawData, selector) {
@@ -284,7 +276,7 @@ function registerDataProvider(loader, customDataProviderMeta) {
284
276
  var dynamicPropsWithoutTag = {
285
277
  propSelectors: {
286
278
  type: "object",
287
- // defaultValueHint: {},
279
+ defaultValueHint: {},
288
280
  description: "An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value."
289
281
  }
290
282
  };
@@ -292,7 +284,7 @@ var dynamicPropsWithoutTag = {
292
284
  var dynamicProps = /*#__PURE__*/_extends({}, dynamicPropsWithoutTag, {
293
285
  tag: {
294
286
  type: "string",
295
- // defaultValueHint: "div",
287
+ defaultValueHint: "div",
296
288
  description: "The HTML tag to use"
297
289
  }
298
290
  }); // TODO Eventually we'll want to expose all the base HTML properties, but in the nicer way that we do within the studio.
@@ -410,64 +402,6 @@ function registerDynamicCollectionGrid(loader, customDynamicCollectionGridMeta)
410
402
  }
411
403
  }
412
404
 
413
- function Embed(_ref) {
414
- var className = _ref.className,
415
- code = _ref.code,
416
- _ref$hideInEditor = _ref.hideInEditor,
417
- hideInEditor = _ref$hideInEditor === void 0 ? false : _ref$hideInEditor;
418
- var rootElt = useRef(null);
419
- useEffect(function () {
420
- if (hideInEditor) {
421
- return;
422
- }
423
-
424
- Array.from(ensure(rootElt.current).querySelectorAll("script")).forEach(function (oldScript) {
425
- var newScript = document.createElement("script");
426
- Array.from(oldScript.attributes).forEach(function (attr) {
427
- return newScript.setAttribute(attr.name, attr.value);
428
- });
429
- newScript.appendChild(document.createTextNode(oldScript.innerHTML));
430
- ensure(oldScript.parentNode).replaceChild(newScript, oldScript);
431
- });
432
- }, [code, hideInEditor]);
433
- var effectiveCode = hideInEditor ? "" : code;
434
- return React.createElement("div", {
435
- ref: rootElt,
436
- className: className,
437
- dangerouslySetInnerHTML: {
438
- __html: effectiveCode
439
- }
440
- });
441
- }
442
- var embedMeta = {
443
- name: "hostless-embed",
444
- displayName: "Embed",
445
- importName: "Embed",
446
- importPath: "@plasmicpkgs/plasmic-basic-components",
447
- props: {
448
- code: {
449
- type: "string",
450
- defaultValue: "https://www.example.com"
451
- },
452
- hideInEditor: {
453
- type: "boolean",
454
- displayName: "Hide in editor",
455
- description: "Disable running the code while editing in Plasmic Studio (may require reload)",
456
- editOnly: true
457
- }
458
- },
459
- defaultStyles: {
460
- maxWidth: "100%"
461
- }
462
- };
463
- function registerEmbed(loader, customEmbedMeta) {
464
- if (loader) {
465
- loader.registerComponent(Embed, customEmbedMeta != null ? customEmbedMeta : embedMeta);
466
- } else {
467
- registerComponent(Embed, customEmbedMeta != null ? customEmbedMeta : embedMeta);
468
- }
469
- }
470
-
471
405
  function Iframe(_ref) {
472
406
  var preview = _ref.preview,
473
407
  src = _ref.src,
@@ -605,13 +539,13 @@ var scrollRevealerMeta = {
605
539
  scrollDownThreshold: {
606
540
  type: "number",
607
541
  displayName: "Scroll down threshold",
608
- // defaultValueHint: 0.5,
542
+ defaultValueHint: 0.5,
609
543
  description: "How much of the element (as a fraction) must you scroll into view for it to appear (defaults to 0.5)"
610
544
  },
611
545
  scrollUpThreshold: {
612
546
  type: "number",
613
547
  displayName: "Scroll up threshold",
614
- // defaultValueHint: 0,
548
+ defaultValueHint: 0,
615
549
  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)"
616
550
  }
617
551
  },
@@ -696,5 +630,5 @@ function registerVideo(loader, customVideoMeta) {
696
630
  }
697
631
  }
698
632
 
699
- export { DataContext, DataProvider, DynamicCollection, DynamicCollectionGrid, DynamicElement, DynamicImage, DynamicText, Embed, Iframe, ScrollRevealer, Video, applySelector, dataProviderMeta, dynamicCollectionGridMeta, dynamicCollectionGridProps, dynamicCollectionMeta, dynamicCollectionProps, dynamicElementMeta, dynamicImageMeta, dynamicTextMeta, embedMeta, iframeMeta, registerDataProvider, registerDynamicCollection, registerDynamicCollectionGrid, registerDynamicElement, registerDynamicImage, registerDynamicText, registerEmbed, registerIframe, registerScrollRevealer, registerVideo, scrollRevealerMeta, useDataEnv, useDirectionalIntersection, useSelector, useSelectors, videoMeta };
633
+ export { DataContext, DataProvider, DynamicCollection, DynamicCollectionGrid, DynamicElement, DynamicImage, DynamicText, Iframe, ScrollRevealer, Video, applySelector, dataProviderMeta, dynamicCollectionGridMeta, dynamicCollectionGridProps, dynamicCollectionMeta, dynamicCollectionProps, dynamicElementMeta, dynamicImageMeta, dynamicTextMeta, iframeMeta, registerDataProvider, registerDynamicCollection, registerDynamicCollectionGrid, registerDynamicElement, registerDynamicImage, registerDynamicText, registerIframe, registerScrollRevealer, registerVideo, scrollRevealerMeta, useDataEnv, useDirectionalIntersection, useSelector, useSelectors, videoMeta };
700
634
  //# 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/Embed.tsx","../src/Iframe.tsx","../src/ScrollRevealer.tsx","../src/Video.tsx"],"sourcesContent":["export const tuple = <T extends any[]>(...args: T): T => args;\n\nexport function ensure<T>(x: T | null | undefined): T {\n if (x === null || x === undefined) {\n debugger;\n throw new Error(`Value must not be undefined or null`);\n } else {\n return x;\n }\n}\n","import { ComponentMeta, repeatedElement } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, {\n ComponentProps,\n createContext,\n createElement,\n CSSProperties,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n name?: string;\n data?: any;\n children?: ReactNode;\n}\n\nexport function DataProvider({ name, data, children }: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider value={{ ...existingEnv, [name]: data }}>\n {children}\n </DataContext.Provider>\n );\n }\n}\n\nexport interface CommonDynamicProps {\n className?: string;\n tag?: string;\n propSelectors?: SelectorDict;\n}\n\nexport function DynamicElement<\n Tag extends keyof JSX.IntrinsicElements = \"div\"\n>({\n tag = \"div\",\n className,\n children,\n propSelectors,\n ...props\n}: CommonDynamicProps & ComponentProps<Tag>) {\n const computed = useSelectors(propSelectors);\n return createElement(tag, {\n children,\n ...props,\n ...computed,\n className: className + \" \" + computed.className,\n });\n}\n\nexport 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 DynamicCollectionProps extends CommonDynamicProps {\n children?: ReactNode;\n style?: CSSProperties;\n loopItemName?: string;\n keySelector?: string;\n selector?: string;\n data?: any;\n}\n\nexport function DynamicCollection({\n selector,\n loopItemName,\n children,\n data,\n keySelector,\n ...props\n}: DynamicCollectionProps) {\n // Defaults to an array of three items.\n const finalData = data ?? useSelector(selector) ?? [1, 2, 3];\n return (\n <DynamicElement {...props}>\n {finalData?.map?.((item: any, index: number) => (\n <DataProvider\n key={applySelector(item, keySelector) ?? index}\n name={loopItemName}\n data={item}\n >\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ))}\n </DynamicElement>\n );\n}\n\nexport interface DynamicCollectionGridProps extends DynamicCollectionProps {\n columns?: number;\n columnGap?: number;\n rowGap?: number;\n}\n\nexport function DynamicCollectionGrid({\n columns,\n columnGap = 0,\n rowGap = 0,\n ...props\n}: DynamicCollectionGridProps) {\n return (\n <DynamicCollection\n {...props}\n style={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${columns}, 1fr)`,\n columnGap: `${columnGap}px`,\n rowGap: `${rowGap}px`,\n }}\n />\n );\n}\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components\";\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\nexport const dynamicCollectionProps = {\n ...dynamicProps,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField\",\n },\n loopItemName: {\n type: \"string\",\n defaultValue: \"item\",\n description:\n \"The name of the variable to use to store the current item in the loop\",\n },\n children: \"slot\",\n} as const;\n\nexport const dynamicCollectionMeta: ComponentMeta<DynamicCollectionProps> = {\n name: \"hostless-dynamic-collection\",\n displayName: \"Dynamic Collection\",\n importName: \"DynamicCollection\",\n importPath: thisModule,\n props: dynamicCollectionProps,\n};\n\nexport function registerDynamicCollection(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicCollectionMeta?: ComponentMeta<DynamicCollectionProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicCollection,\n customDynamicCollectionMeta ?? dynamicCollectionMeta\n );\n } else {\n registerComponent(\n DynamicCollection,\n customDynamicCollectionMeta ?? dynamicCollectionMeta\n );\n }\n}\n\nexport const dynamicCollectionGridProps = {\n ...dynamicCollectionProps,\n columns: {\n type: \"number\",\n defaultValue: 2,\n description: \"The number of columns to use in the grid\",\n },\n columnGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between columns\",\n },\n rowGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between rows\",\n },\n} as const;\n\nexport const dynamicCollectionGridMeta: ComponentMeta<DynamicCollectionGridProps> = {\n name: \"hostless-dynamic-collection-grid\",\n displayName: \"Dynamic Collection Grid\",\n importName: \"DynamicCollectionGrid\",\n importPath: thisModule,\n props: dynamicCollectionGridProps,\n};\n\nexport function registerDynamicCollectionGrid(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicCollectionGridMeta?: ComponentMeta<DynamicCollectionGridProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicCollectionGrid,\n customDynamicCollectionGridMeta ?? dynamicCollectionGridMeta\n );\n } else {\n registerComponent(\n DynamicCollectionGrid,\n customDynamicCollectionGridMeta ?? dynamicCollectionGridMeta\n );\n }\n}\n","import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useRef } from \"react\";\nimport { ensure } from \"./common\";\n\nexport interface EmbedProps {\n className?: string;\n code: string;\n hideInEditor?: boolean;\n}\n\nexport default function Embed({\n className,\n code,\n hideInEditor = false,\n}: EmbedProps) {\n const rootElt = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (hideInEditor) {\n return;\n }\n Array.from(ensure(rootElt.current).querySelectorAll(\"script\")).forEach(\n (oldScript) => {\n const newScript = document.createElement(\"script\");\n Array.from(oldScript.attributes).forEach((attr) =>\n newScript.setAttribute(attr.name, attr.value)\n );\n newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n ensure(oldScript.parentNode).replaceChild(newScript, oldScript);\n }\n );\n }, [code, hideInEditor]);\n const effectiveCode = hideInEditor ? \"\" : code;\n return (\n <div\n ref={rootElt}\n className={className}\n dangerouslySetInnerHTML={{ __html: effectiveCode }}\n />\n );\n}\n\nexport const embedMeta: ComponentMeta<EmbedProps> = {\n name: \"hostless-embed\",\n displayName: \"Embed\",\n importName: \"Embed\",\n importPath: \"@plasmicpkgs/plasmic-basic-components\",\n props: {\n code: {\n type: \"string\",\n defaultValue: \"https://www.example.com\",\n },\n hideInEditor: {\n type: \"boolean\",\n displayName: \"Hide in editor\",\n description:\n \"Disable running the code while editing in Plasmic Studio (may require reload)\",\n editOnly: true,\n },\n },\n defaultStyles: {\n maxWidth: \"100%\",\n },\n};\n\nexport function registerEmbed(\n loader?: { registerComponent: typeof registerComponent },\n customEmbedMeta?: ComponentMeta<EmbedProps>\n) {\n if (loader) {\n loader.registerComponent(Embed, customEmbedMeta ?? embedMeta);\n } else {\n registerComponent(Embed, customEmbedMeta ?? embedMeta);\n }\n}\n","import { ComponentMeta, PlasmicCanvasContext } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { useContext } from \"react\";\n\nexport interface IframeProps {\n src: string;\n preview?: boolean;\n className?: string;\n}\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","ensure","x","undefined","Error","DataContext","createContext","applySelector","rawData","selector","curData","split","key","useSelector","useDataEnv","useSelectors","selectors","Object","fromEntries","entries","filter","map","useContext","DataProvider","name","data","children","existingEnv","React","Provider","value","DynamicElement","tag","className","propSelectors","props","computed","createElement","DynamicText","DynamicImage","loading","style","objectFit","src","DynamicCollection","loopItemName","keySelector","finalData","item","index","repeatedElement","DynamicCollectionGrid","columns","columnGap","rowGap","display","gridTemplateColumns","thisModule","dataProviderMeta","displayName","importName","importPath","type","defaultValue","description","birthYear","profilePicture","registerDataProvider","loader","customDataProviderMeta","registerComponent","dynamicPropsWithoutTag","dynamicProps","dynamicElementMeta","registerDynamicElement","customDynamicElementMeta","dynamicTextMeta","registerDynamicText","customDynamicTextMeta","dynamicImageMeta","registerDynamicImage","customDynamicImageMeta","dynamicCollectionProps","dynamicCollectionMeta","registerDynamicCollection","customDynamicCollectionMeta","dynamicCollectionGridProps","dynamicCollectionGridMeta","registerDynamicCollectionGrid","customDynamicCollectionGridMeta","Embed","code","hideInEditor","rootElt","useRef","useEffect","Array","from","current","querySelectorAll","forEach","oldScript","newScript","document","attributes","attr","setAttribute","appendChild","createTextNode","innerHTML","parentNode","replaceChild","effectiveCode","ref","dangerouslySetInnerHTML","__html","embedMeta","editOnly","defaultStyles","maxWidth","registerEmbed","customEmbedMeta","Iframe","preview","isEditing","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","alignItems","justifyContent","overflow","iframeMeta","width","height","registerIframe","customIframeMeta","useDirectionalIntersection","scrollDownThreshold","scrollUpThreshold","useState","revealed","setRevealed","IntersectionObserver","handler","intersectionRatio","observer","root","rootMargin","threshold","observe","disconnect","ScrollRevealer","intersectionRef","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;SAESC,OAAUC;AACxB,MAAIA,CAAC,KAAK,IAAN,IAAcA,CAAC,KAAKC,SAAxB,EAAmC;AACjC;AACA,UAAM,IAAIC,KAAJ,uCAAN;AACD,GAHD,MAGO;AACL,WAAOF,CAAP;AACD;AACF;;ICKYG,WAAW,gBAAGC,aAAa,CAAuBH,SAAvB,CAAjC;AAEP,SAAgBI,cACdC,SACAC;AAEA,MAAI,CAACA,QAAL,EAAe;AACb,WAAON,SAAP;AACD;;AACD,MAAIO,OAAO,GAAGF,OAAd;;AACA,uDAAkBC,QAAQ,CAACE,KAAT,CAAe,GAAf,CAAlB,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EAAE;AACX3G,MAAAA,IAAI,EAAE,SADK;AAEXH,MAAAA,WAAW,EAAE,cAFF;AAGXK,MAAAA,WAAW,EACT;AAJS,KAnBR;AAyBL0G,IAAAA,IAAI,EAAE;AACJ5G,MAAAA,IAAI,EAAE,SADF;AAEJH,MAAAA,WAAW,EAAE,MAFT;AAGJK,MAAAA,WAAW,EAAE;AAHT,KAzBD;AA8BL2G,IAAAA,KAAK,EAAE;AACL7G,MAAAA,IAAI,EAAE,SADD;AAELH,MAAAA,WAAW,EAAE,OAFR;AAGLK,MAAAA,WAAW,EAAE;AAHR,KA9BF;AAmCL4G,IAAAA,MAAM,EAAE;AACN9G,MAAAA,IAAI,EAAE,UADA;AAENH,MAAAA,WAAW,EAAE,4BAFP;AAGNK,MAAAA,WAAW,EAAE;AAHP,KAnCH;AAwCL6G,IAAAA,OAAO,EAAE;AACP/G,MAAAA,IAAI,EAAE,QADC;AAEPgH,MAAAA,OAAO,EAAE,CAAC,MAAD,EAAS,UAAT,EAAqB,MAArB,CAFF;AAGPnH,MAAAA,WAAW,EAAE,SAHN;AAIPK,MAAAA,WAAW,EACT;AALK;AAxCJ,GAL2C;AAqDlDsD,EAAAA,aAAa,EAAE;AACbuB,IAAAA,MAAM,EAAE,KADK;AAEbD,IAAAA,KAAK,EAAE,OAFM;AAGbrB,IAAAA,QAAQ,EAAE;AAHG;AArDmC,CAA7C;AA4DP,SAAgBwD,cACd3G,QACA4G;AAEA,MAAI5G,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyB8F,KAAzB,EAAgCY,eAAhC,WAAgCA,eAAhC,GAAmDV,SAAnD;AACD,GAFD,MAEO;AACLhG,IAAAA,iBAAiB,CAAC8F,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"],"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 CSSProperties,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n name?: string;\n data?: any;\n children?: ReactNode;\n}\n\nexport function DataProvider({ name, data, children }: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider value={{ ...existingEnv, [name]: data }}>\n {children}\n </DataContext.Provider>\n );\n }\n}\n\nexport interface CommonDynamicProps {\n className?: string;\n tag?: string;\n propSelectors?: SelectorDict;\n}\n\nexport function DynamicElement<\n Tag extends keyof JSX.IntrinsicElements = \"div\"\n>({\n tag = \"div\",\n className,\n children,\n propSelectors,\n ...props\n}: CommonDynamicProps & ComponentProps<Tag>) {\n const computed = useSelectors(propSelectors);\n return createElement(tag, {\n children,\n ...props,\n ...computed,\n className: className + \" \" + computed.className,\n });\n}\n\nexport 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 DynamicCollectionProps extends CommonDynamicProps {\n children?: ReactNode;\n style?: CSSProperties;\n loopItemName?: string;\n keySelector?: string;\n selector?: string;\n data?: any;\n}\n\nexport function DynamicCollection({\n selector,\n loopItemName,\n children,\n data,\n keySelector,\n ...props\n}: DynamicCollectionProps) {\n // Defaults to an array of three items.\n const finalData = data ?? useSelector(selector) ?? [1, 2, 3];\n return (\n <DynamicElement {...props}>\n {finalData?.map?.((item: any, index: number) => (\n <DataProvider\n key={applySelector(item, keySelector) ?? index}\n name={loopItemName}\n data={item}\n >\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ))}\n </DynamicElement>\n );\n}\n\nexport interface DynamicCollectionGridProps extends DynamicCollectionProps {\n columns?: number;\n columnGap?: number;\n rowGap?: number;\n}\n\nexport function DynamicCollectionGrid({\n columns,\n columnGap = 0,\n rowGap = 0,\n ...props\n}: DynamicCollectionGridProps) {\n return (\n <DynamicCollection\n {...props}\n style={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${columns}, 1fr)`,\n columnGap: `${columnGap}px`,\n rowGap: `${rowGap}px`,\n }}\n />\n );\n}\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components\";\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\nexport const dynamicCollectionProps = {\n ...dynamicProps,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField\",\n },\n loopItemName: {\n type: \"string\",\n defaultValue: \"item\",\n description:\n \"The name of the variable to use to store the current item in the loop\",\n },\n children: \"slot\",\n} as const;\n\nexport const dynamicCollectionMeta: ComponentMeta<DynamicCollectionProps> = {\n name: \"hostless-dynamic-collection\",\n displayName: \"Dynamic Collection\",\n importName: \"DynamicCollection\",\n importPath: thisModule,\n props: dynamicCollectionProps,\n};\n\nexport function registerDynamicCollection(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicCollectionMeta?: ComponentMeta<DynamicCollectionProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicCollection,\n customDynamicCollectionMeta ?? dynamicCollectionMeta\n );\n } else {\n registerComponent(\n DynamicCollection,\n customDynamicCollectionMeta ?? dynamicCollectionMeta\n );\n }\n}\n\nexport const dynamicCollectionGridProps = {\n ...dynamicCollectionProps,\n columns: {\n type: \"number\",\n defaultValue: 2,\n description: \"The number of columns to use in the grid\",\n },\n columnGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between columns\",\n },\n rowGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between rows\",\n },\n} as const;\n\nexport const dynamicCollectionGridMeta: ComponentMeta<DynamicCollectionGridProps> = {\n name: \"hostless-dynamic-collection-grid\",\n displayName: \"Dynamic Collection Grid\",\n importName: \"DynamicCollectionGrid\",\n importPath: thisModule,\n props: dynamicCollectionGridProps,\n};\n\nexport function registerDynamicCollectionGrid(\n loader?: { registerComponent: typeof registerComponent },\n customDynamicCollectionGridMeta?: ComponentMeta<DynamicCollectionGridProps>\n) {\n if (loader) {\n loader.registerComponent(\n DynamicCollectionGrid,\n customDynamicCollectionGridMeta ?? dynamicCollectionGridMeta\n );\n } else {\n registerComponent(\n DynamicCollectionGrid,\n customDynamicCollectionGridMeta ?? dynamicCollectionGridMeta\n );\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","applySelector","rawData","selector","curData","split","key","useSelector","useDataEnv","useSelectors","selectors","Object","fromEntries","entries","filter","map","useContext","DataProvider","name","data","children","existingEnv","React","Provider","value","DynamicElement","tag","className","propSelectors","props","computed","createElement","DynamicText","DynamicImage","loading","style","objectFit","src","DynamicCollection","loopItemName","keySelector","finalData","item","index","repeatedElement","DynamicCollectionGrid","columns","columnGap","rowGap","display","gridTemplateColumns","thisModule","dataProviderMeta","displayName","importName","importPath","type","defaultValue","description","birthYear","profilePicture","registerDataProvider","loader","customDataProviderMeta","registerComponent","dynamicPropsWithoutTag","defaultValueHint","dynamicProps","dynamicElementMeta","registerDynamicElement","customDynamicElementMeta","dynamicTextMeta","registerDynamicText","customDynamicTextMeta","dynamicImageMeta","registerDynamicImage","customDynamicImageMeta","dynamicCollectionProps","dynamicCollectionMeta","registerDynamicCollection","customDynamicCollectionMeta","dynamicCollectionGridProps","dynamicCollectionGridMeta","registerDynamicCollectionGrid","customDynamicCollectionGridMeta","Iframe","preview","isEditing","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","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;;ICcMC,WAAW,gBAAGC,aAAa,CAAuBC,SAAvB,CAAjC;AAEP,SAAgBC,cACdC,SACAC;AAEA,MAAI,CAACA,QAAL,EAAe;AACb,WAAOH,SAAP;AACD;;AACD,MAAII,OAAO,GAAGF,OAAd;;AACA,uDAAkBC,QAAQ,CAACE,KAAT,CAAe,GAAf,CAAlB,wCAAuC;AAAA;;AAAA,QAA5BC,GAA4B;AACrCF,IAAAA,OAAO,eAAGA,OAAH,qBAAG,SAAUE,GAAV,CAAV;AACD;;AACD,SAAOF,OAAP;AACD;AAID,SAAgBG,YAAYJ;AAC1B,MAAMD,OAAO,GAAGM,UAAU,EAA1B;AACA,SAAOP,aAAa,CAACC,OAAD,EAAUC,QAAV,CAApB;AACD;AAED,SAAgBM,aAAaC;MAAAA;AAAAA,IAAAA,YAA0B;;;AACrD,MAAMR,OAAO,GAAGM,UAAU,EAA1B;AACA,SAAOG,MAAM,CAACC,WAAP,CACLD,MAAM,CAACE,OAAP,CAAeH,SAAf,EACGI,MADH,CACU;AAAA,QAAER,GAAF;AAAA,QAAOH,QAAP;AAAA,WAAqB,CAAC,CAACG,GAAF,IAAS,CAAC,CAACH,QAAhC;AAAA,GADV,EAEGY,GAFH,CAEO;AAAA,QAAET,GAAF;AAAA,QAAOH,QAAP;AAAA,WAAqBP,KAAK,CAACU,GAAD,EAAML,aAAa,CAACC,OAAD,EAAUC,QAAV,CAAnB,CAA1B;AAAA,GAFP,CADK,C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plasmic registration call for the HTML5 video element",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  "typescript": "^3.9.7"
37
37
  },
38
38
  "dependencies": {
39
- "@plasmicapp/host": "^0.0.37"
39
+ "@plasmicapp/host": "^0.0.44"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=16.8.0",