@plasmicpkgs/plasmic-basic-components 0.0.1 → 0.0.5
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 +36 -5
- package/dist/Embed.d.ts +5 -3
- package/dist/Iframe.d.ts +8 -3
- package/dist/ScrollRevealer.d.ts +12 -6
- package/dist/Video.d.ts +6 -0
- package/dist/index.d.ts +3 -1
- package/dist/plasmic-basic-components.cjs.development.js +146 -113
- package/dist/plasmic-basic-components.cjs.development.js.map +1 -1
- package/dist/plasmic-basic-components.cjs.production.min.js +1 -1
- package/dist/plasmic-basic-components.cjs.production.min.js.map +1 -1
- package/dist/plasmic-basic-components.esm.js +129 -114
- package/dist/plasmic-basic-components.esm.js.map +1 -1
- package/package.json +3 -7
package/dist/Data.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { ComponentMeta } from "@plasmicapp/host";
|
|
2
|
+
import registerComponent from "@plasmicapp/host/registerComponent";
|
|
2
3
|
import React, { ComponentProps, CSSProperties, ReactNode } from "react";
|
|
3
4
|
export declare type DataDict = Record<string, any>;
|
|
4
5
|
export declare const DataContext: React.Context<Record<string, any> | undefined>;
|
|
@@ -19,12 +20,14 @@ export interface CommonDynamicProps {
|
|
|
19
20
|
propSelectors?: SelectorDict;
|
|
20
21
|
}
|
|
21
22
|
export declare function DynamicElement<Tag extends keyof JSX.IntrinsicElements = "div">({ tag, className, children, propSelectors, ...props }: CommonDynamicProps & ComponentProps<Tag>): React.DOMElement<any, Element>;
|
|
22
|
-
export
|
|
23
|
+
export interface DynamicTextProps extends CommonDynamicProps {
|
|
23
24
|
selector?: string;
|
|
24
|
-
}
|
|
25
|
-
export declare function
|
|
25
|
+
}
|
|
26
|
+
export declare function DynamicText({ selector, propSelectors, ...props }: DynamicTextProps): JSX.Element;
|
|
27
|
+
export interface DynamicImageProps extends CommonDynamicProps, ComponentProps<"img"> {
|
|
26
28
|
selector?: string;
|
|
27
|
-
}
|
|
29
|
+
}
|
|
30
|
+
export declare function DynamicImage({ selector, propSelectors, ...props }: DynamicImageProps): JSX.Element;
|
|
28
31
|
export interface DynamicCollectionProps extends CommonDynamicProps {
|
|
29
32
|
children?: ReactNode;
|
|
30
33
|
style?: CSSProperties;
|
|
@@ -40,6 +43,22 @@ export interface DynamicCollectionGridProps extends DynamicCollectionProps {
|
|
|
40
43
|
rowGap?: number;
|
|
41
44
|
}
|
|
42
45
|
export declare function DynamicCollectionGrid({ columns, columnGap, rowGap, ...props }: DynamicCollectionGridProps): JSX.Element;
|
|
46
|
+
export declare const dataProviderMeta: ComponentMeta<DataProviderProps>;
|
|
47
|
+
export declare function registerDataProvider(loader?: {
|
|
48
|
+
registerComponent: typeof registerComponent;
|
|
49
|
+
}, customDataProviderMeta?: ComponentMeta<DataProviderProps>): void;
|
|
50
|
+
export declare const dynamicElementMeta: ComponentMeta<CommonDynamicProps>;
|
|
51
|
+
export declare function registerDynamicElement(loader?: {
|
|
52
|
+
registerComponent: typeof registerComponent;
|
|
53
|
+
}, customDynamicElementMeta?: ComponentMeta<CommonDynamicProps>): void;
|
|
54
|
+
export declare const dynamicTextMeta: ComponentMeta<DynamicTextProps>;
|
|
55
|
+
export declare function registerDynamicText(loader?: {
|
|
56
|
+
registerComponent: typeof registerComponent;
|
|
57
|
+
}, customDynamicTextMeta?: ComponentMeta<DynamicTextProps>): void;
|
|
58
|
+
export declare const dynamicImageMeta: ComponentMeta<DynamicImageProps>;
|
|
59
|
+
export declare function registerDynamicImage(loader?: {
|
|
60
|
+
registerComponent: typeof registerComponent;
|
|
61
|
+
}, customDynamicImageMeta?: ComponentMeta<DynamicImageProps>): void;
|
|
43
62
|
export declare const dynamicCollectionProps: {
|
|
44
63
|
readonly selector: {
|
|
45
64
|
readonly type: "string";
|
|
@@ -53,13 +72,19 @@ export declare const dynamicCollectionProps: {
|
|
|
53
72
|
readonly children: "slot";
|
|
54
73
|
readonly tag: {
|
|
55
74
|
readonly type: "string";
|
|
75
|
+
readonly defaultValueHint: "div";
|
|
56
76
|
readonly description: "The HTML tag to use";
|
|
57
77
|
};
|
|
58
78
|
readonly propSelectors: {
|
|
59
79
|
readonly type: "object";
|
|
80
|
+
readonly defaultValueHint: {};
|
|
60
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.";
|
|
61
82
|
};
|
|
62
83
|
};
|
|
84
|
+
export declare const dynamicCollectionMeta: ComponentMeta<DynamicCollectionProps>;
|
|
85
|
+
export declare function registerDynamicCollection(loader?: {
|
|
86
|
+
registerComponent: typeof registerComponent;
|
|
87
|
+
}, customDynamicCollectionMeta?: ComponentMeta<DynamicCollectionProps>): void;
|
|
63
88
|
export declare const dynamicCollectionGridProps: {
|
|
64
89
|
readonly columns: {
|
|
65
90
|
readonly type: "number";
|
|
@@ -88,10 +113,16 @@ export declare const dynamicCollectionGridProps: {
|
|
|
88
113
|
readonly children: "slot";
|
|
89
114
|
readonly tag: {
|
|
90
115
|
readonly type: "string";
|
|
116
|
+
readonly defaultValueHint: "div";
|
|
91
117
|
readonly description: "The HTML tag to use";
|
|
92
118
|
};
|
|
93
119
|
readonly propSelectors: {
|
|
94
120
|
readonly type: "object";
|
|
121
|
+
readonly defaultValueHint: {};
|
|
95
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.";
|
|
96
123
|
};
|
|
97
124
|
};
|
|
125
|
+
export declare const dynamicCollectionGridMeta: ComponentMeta<DynamicCollectionGridProps>;
|
|
126
|
+
export declare function registerDynamicCollectionGrid(loader?: {
|
|
127
|
+
registerComponent: typeof registerComponent;
|
|
128
|
+
}, customDynamicCollectionGridMeta?: ComponentMeta<DynamicCollectionGridProps>): void;
|
package/dist/Embed.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="react" />
|
|
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
|
|
7
|
+
export declare const embedMeta: ComponentMeta<EmbedProps>;
|
|
8
|
+
export declare function registerEmbed(loader?: {
|
|
9
|
+
registerComponent: typeof registerComponent;
|
|
10
|
+
}, customEmbedMeta?: ComponentMeta<EmbedProps>): void;
|
package/dist/Iframe.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
/** @format */
|
|
2
1
|
/// <reference types="react" />
|
|
2
|
+
import { ComponentMeta } from "@plasmicapp/host";
|
|
3
|
+
import registerComponent from "@plasmicapp/host/registerComponent";
|
|
3
4
|
export interface IframeProps {
|
|
4
5
|
src: string;
|
|
5
|
-
|
|
6
|
+
preview?: boolean;
|
|
6
7
|
className?: string;
|
|
7
8
|
}
|
|
8
|
-
export default function Iframe({
|
|
9
|
+
export default function Iframe({ preview, src, className }: IframeProps): JSX.Element;
|
|
10
|
+
export declare const iframeMeta: ComponentMeta<IframeProps>;
|
|
11
|
+
export declare function registerIframe(loader?: {
|
|
12
|
+
registerComponent: typeof registerComponent;
|
|
13
|
+
}, customIframeMeta?: ComponentMeta<IframeProps>): void;
|
package/dist/ScrollRevealer.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import registerComponent, { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
1
2
|
import { ReactNode, RefObject } from "react";
|
|
2
3
|
export declare function useDirectionalIntersection({ ref, scrollDownThreshold, scrollUpThreshold, }: {
|
|
3
4
|
ref: RefObject<HTMLElement>;
|
|
4
5
|
scrollDownThreshold?: number;
|
|
5
6
|
scrollUpThreshold?: number;
|
|
6
7
|
}): boolean;
|
|
8
|
+
export interface ScrollRevealerProps {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
scrollUpThreshold?: number;
|
|
12
|
+
scrollDownThreshold?: number;
|
|
13
|
+
}
|
|
7
14
|
/**
|
|
8
15
|
* Unlike react-awesome-reveal, ScrollRevealer:
|
|
9
16
|
*
|
|
@@ -12,9 +19,8 @@ export declare function useDirectionalIntersection({ ref, scrollDownThreshold, s
|
|
|
12
19
|
*
|
|
13
20
|
* 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.
|
|
14
21
|
*/
|
|
15
|
-
export default function ScrollRevealer({ children, className, scrollDownThreshold, scrollUpThreshold, }:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}): JSX.Element;
|
|
22
|
+
export default function ScrollRevealer({ children, className, scrollDownThreshold, scrollUpThreshold, }: ScrollRevealerProps): JSX.Element;
|
|
23
|
+
export declare const scrollRevealerMeta: ComponentMeta<ScrollRevealerProps>;
|
|
24
|
+
export declare function registerScrollRevealer(loader?: {
|
|
25
|
+
registerComponent: typeof registerComponent;
|
|
26
|
+
}, customScrollRevealerMeta?: ComponentMeta<ScrollRevealerProps>): void;
|
package/dist/Video.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import registerComponent, { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
1
2
|
import React from "react";
|
|
3
|
+
export declare type VideoProps = Pick<React.ComponentProps<"video">, "autoPlay" | "controls" | "loop" | "muted" | "playsInline" | "poster" | "preload" | "src">;
|
|
2
4
|
declare const Video: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "autoPlay" | "controls" | "loop" | "muted" | "playsInline" | "poster" | "preload" | "src"> & React.RefAttributes<HTMLVideoElement>>;
|
|
3
5
|
export default Video;
|
|
6
|
+
export declare const videoMeta: ComponentMeta<VideoProps>;
|
|
7
|
+
export declare function registerVideo(loader?: {
|
|
8
|
+
registerComponent: typeof registerComponent;
|
|
9
|
+
}, customVideoMeta?: ComponentMeta<VideoProps>): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./Data";
|
|
2
|
-
export
|
|
2
|
+
export * from "./Iframe";
|
|
3
3
|
export { default as Iframe } from "./Iframe";
|
|
4
|
+
export * from "./ScrollRevealer";
|
|
4
5
|
export { default as ScrollRevealer } from "./ScrollRevealer";
|
|
6
|
+
export * from "./Video";
|
|
5
7
|
export { default as Video } from "./Video";
|
|
@@ -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) {
|
|
@@ -238,9 +230,11 @@ function DynamicCollectionGrid(_ref9) {
|
|
|
238
230
|
}
|
|
239
231
|
}));
|
|
240
232
|
}
|
|
241
|
-
var thisModule = "@plasmicpkgs/plasmic-basic-components
|
|
242
|
-
|
|
243
|
-
name: "
|
|
233
|
+
var thisModule = "@plasmicpkgs/plasmic-basic-components";
|
|
234
|
+
var dataProviderMeta = {
|
|
235
|
+
name: "hostless-data-provider",
|
|
236
|
+
displayName: "Data Provider",
|
|
237
|
+
importName: "DataProvider",
|
|
244
238
|
importPath: thisModule,
|
|
245
239
|
// description: "Makes some specified data available to the subtree in a context",
|
|
246
240
|
props: {
|
|
@@ -265,24 +259,31 @@ registerComponent(DataProvider, {
|
|
|
265
259
|
type: "slot",
|
|
266
260
|
defaultValue: [{
|
|
267
261
|
type: "component",
|
|
268
|
-
name: "
|
|
262
|
+
name: "hostless-dynamic-text",
|
|
269
263
|
props: {
|
|
270
264
|
selector: "celebrities.0.name"
|
|
271
265
|
}
|
|
272
266
|
}, {
|
|
273
267
|
type: "component",
|
|
274
|
-
name: "
|
|
268
|
+
name: "hostless-dynamic-image",
|
|
275
269
|
props: {
|
|
276
270
|
selector: "celebrities.0.profilePicture"
|
|
277
271
|
}
|
|
278
272
|
}]
|
|
279
273
|
}
|
|
280
274
|
}
|
|
281
|
-
}
|
|
275
|
+
};
|
|
276
|
+
function registerDataProvider(loader, customDataProviderMeta) {
|
|
277
|
+
if (loader) {
|
|
278
|
+
loader.registerComponent(DataProvider, customDataProviderMeta != null ? customDataProviderMeta : dataProviderMeta);
|
|
279
|
+
} else {
|
|
280
|
+
registerComponent(DataProvider, customDataProviderMeta != null ? customDataProviderMeta : dataProviderMeta);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
282
283
|
var dynamicPropsWithoutTag = {
|
|
283
284
|
propSelectors: {
|
|
284
285
|
type: "object",
|
|
285
|
-
|
|
286
|
+
defaultValueHint: {},
|
|
286
287
|
description: "An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value."
|
|
287
288
|
}
|
|
288
289
|
};
|
|
@@ -290,39 +291,66 @@ var dynamicPropsWithoutTag = {
|
|
|
290
291
|
var dynamicProps = /*#__PURE__*/_extends({}, dynamicPropsWithoutTag, {
|
|
291
292
|
tag: {
|
|
292
293
|
type: "string",
|
|
293
|
-
|
|
294
|
+
defaultValueHint: "div",
|
|
294
295
|
description: "The HTML tag to use"
|
|
295
296
|
}
|
|
296
297
|
}); // TODO Eventually we'll want to expose all the base HTML properties, but in the nicer way that we do within the studio.
|
|
297
298
|
|
|
298
299
|
|
|
299
|
-
|
|
300
|
-
name: "
|
|
300
|
+
var dynamicElementMeta = {
|
|
301
|
+
name: "hostless-dynamic-element",
|
|
302
|
+
displayName: "Dynamic Element",
|
|
303
|
+
importName: "DynamicElement",
|
|
301
304
|
importPath: thisModule,
|
|
302
|
-
props: _extends({}, dynamicProps, {
|
|
305
|
+
props: /*#__PURE__*/_extends({}, dynamicProps, {
|
|
303
306
|
children: "slot"
|
|
304
307
|
})
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
+
};
|
|
309
|
+
function registerDynamicElement(loader, customDynamicElementMeta) {
|
|
310
|
+
if (loader) {
|
|
311
|
+
loader.registerComponent(DynamicElement, customDynamicElementMeta != null ? customDynamicElementMeta : dynamicElementMeta);
|
|
312
|
+
} else {
|
|
313
|
+
registerComponent(DynamicElement, customDynamicElementMeta != null ? customDynamicElementMeta : dynamicElementMeta);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
var dynamicTextMeta = {
|
|
317
|
+
name: "hostless-dynamic-text",
|
|
318
|
+
importName: "DynamicText",
|
|
319
|
+
displayName: "Dynamic Text",
|
|
308
320
|
importPath: thisModule,
|
|
309
|
-
props: _extends({}, dynamicProps, {
|
|
321
|
+
props: /*#__PURE__*/_extends({}, dynamicProps, {
|
|
310
322
|
selector: {
|
|
311
323
|
type: "string",
|
|
312
324
|
description: "The selector expression to use to get the text, such as: someVariable.0.someField"
|
|
313
325
|
}
|
|
314
326
|
})
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
|
|
327
|
+
};
|
|
328
|
+
function registerDynamicText(loader, customDynamicTextMeta) {
|
|
329
|
+
if (loader) {
|
|
330
|
+
loader.registerComponent(DynamicText, customDynamicTextMeta != null ? customDynamicTextMeta : dynamicTextMeta);
|
|
331
|
+
} else {
|
|
332
|
+
registerComponent(DynamicText, customDynamicTextMeta != null ? customDynamicTextMeta : dynamicTextMeta);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
var dynamicImageMeta = {
|
|
336
|
+
name: "hostless-dynamic-image",
|
|
337
|
+
displayName: "Dynamic Image",
|
|
338
|
+
importName: "DynamicImage",
|
|
318
339
|
importPath: thisModule,
|
|
319
|
-
props: _extends({}, dynamicPropsWithoutTag, {
|
|
340
|
+
props: /*#__PURE__*/_extends({}, dynamicPropsWithoutTag, {
|
|
320
341
|
selector: {
|
|
321
342
|
type: "string",
|
|
322
343
|
description: "The selector expression to use to get the image source URL, such as: someVariable.0.someField"
|
|
323
344
|
}
|
|
324
345
|
})
|
|
325
|
-
}
|
|
346
|
+
};
|
|
347
|
+
function registerDynamicImage(loader, customDynamicImageMeta) {
|
|
348
|
+
if (loader) {
|
|
349
|
+
loader.registerComponent(DynamicImage, customDynamicImageMeta != null ? customDynamicImageMeta : dynamicImageMeta);
|
|
350
|
+
} else {
|
|
351
|
+
registerComponent(DynamicImage, customDynamicImageMeta != null ? customDynamicImageMeta : dynamicImageMeta);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
326
354
|
var dynamicCollectionProps = /*#__PURE__*/_extends({}, dynamicProps, {
|
|
327
355
|
selector: {
|
|
328
356
|
type: "string",
|
|
@@ -335,11 +363,20 @@ var dynamicCollectionProps = /*#__PURE__*/_extends({}, dynamicProps, {
|
|
|
335
363
|
},
|
|
336
364
|
children: "slot"
|
|
337
365
|
});
|
|
338
|
-
|
|
339
|
-
name: "
|
|
366
|
+
var dynamicCollectionMeta = {
|
|
367
|
+
name: "hostless-dynamic-collection",
|
|
368
|
+
displayName: "Dynamic Collection",
|
|
369
|
+
importName: "DynamicCollection",
|
|
340
370
|
importPath: thisModule,
|
|
341
371
|
props: dynamicCollectionProps
|
|
342
|
-
}
|
|
372
|
+
};
|
|
373
|
+
function registerDynamicCollection(loader, customDynamicCollectionMeta) {
|
|
374
|
+
if (loader) {
|
|
375
|
+
loader.registerComponent(DynamicCollection, customDynamicCollectionMeta != null ? customDynamicCollectionMeta : dynamicCollectionMeta);
|
|
376
|
+
} else {
|
|
377
|
+
registerComponent(DynamicCollection, customDynamicCollectionMeta != null ? customDynamicCollectionMeta : dynamicCollectionMeta);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
343
380
|
var dynamicCollectionGridProps = /*#__PURE__*/_extends({}, dynamicCollectionProps, {
|
|
344
381
|
columns: {
|
|
345
382
|
type: "number",
|
|
@@ -357,70 +394,28 @@ var dynamicCollectionGridProps = /*#__PURE__*/_extends({}, dynamicCollectionProp
|
|
|
357
394
|
description: "The gap between rows"
|
|
358
395
|
}
|
|
359
396
|
});
|
|
360
|
-
|
|
361
|
-
name: "
|
|
397
|
+
var dynamicCollectionGridMeta = {
|
|
398
|
+
name: "hostless-dynamic-collection-grid",
|
|
399
|
+
displayName: "Dynamic Collection Grid",
|
|
400
|
+
importName: "DynamicCollectionGrid",
|
|
362
401
|
importPath: thisModule,
|
|
363
402
|
props: dynamicCollectionGridProps
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
_ref$hideInEditor = _ref.hideInEditor,
|
|
371
|
-
hideInEditor = _ref$hideInEditor === void 0 ? false : _ref$hideInEditor;
|
|
372
|
-
var rootElt = React.useRef(null);
|
|
373
|
-
React.useEffect(function () {
|
|
374
|
-
if (hideInEditor) {
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
Array.from(ensure(rootElt.current).querySelectorAll("script")).forEach(function (oldScript) {
|
|
379
|
-
var newScript = document.createElement("script");
|
|
380
|
-
Array.from(oldScript.attributes).forEach(function (attr) {
|
|
381
|
-
return newScript.setAttribute(attr.name, attr.value);
|
|
382
|
-
});
|
|
383
|
-
newScript.appendChild(document.createTextNode(oldScript.innerHTML));
|
|
384
|
-
ensure(oldScript.parentNode).replaceChild(newScript, oldScript);
|
|
385
|
-
});
|
|
386
|
-
}, [code, hideInEditor]);
|
|
387
|
-
var effectiveCode = hideInEditor ? "" : code;
|
|
388
|
-
return React__default.createElement("div", {
|
|
389
|
-
ref: rootElt,
|
|
390
|
-
className: className,
|
|
391
|
-
dangerouslySetInnerHTML: {
|
|
392
|
-
__html: effectiveCode
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
registerComponent(Embed, {
|
|
397
|
-
name: "Embed",
|
|
398
|
-
importPath: "@plasmicpkgs/plasmic-basic-components/Embed",
|
|
399
|
-
props: {
|
|
400
|
-
code: {
|
|
401
|
-
type: "string",
|
|
402
|
-
defaultValue: "https://www.example.com"
|
|
403
|
-
},
|
|
404
|
-
hideInEditor: {
|
|
405
|
-
type: "boolean",
|
|
406
|
-
displayName: "Hide in editor",
|
|
407
|
-
description: "Disable running the code while editing in Plasmic Studio (may require reload)"
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
isDefaultExport: true,
|
|
411
|
-
defaultStyles: {
|
|
412
|
-
maxWidth: "100%"
|
|
403
|
+
};
|
|
404
|
+
function registerDynamicCollectionGrid(loader, customDynamicCollectionGridMeta) {
|
|
405
|
+
if (loader) {
|
|
406
|
+
loader.registerComponent(DynamicCollectionGrid, customDynamicCollectionGridMeta != null ? customDynamicCollectionGridMeta : dynamicCollectionGridMeta);
|
|
407
|
+
} else {
|
|
408
|
+
registerComponent(DynamicCollectionGrid, customDynamicCollectionGridMeta != null ? customDynamicCollectionGridMeta : dynamicCollectionGridMeta);
|
|
413
409
|
}
|
|
414
|
-
}
|
|
410
|
+
}
|
|
415
411
|
|
|
416
|
-
/** @format */
|
|
417
412
|
function Iframe(_ref) {
|
|
418
|
-
var
|
|
413
|
+
var preview = _ref.preview,
|
|
419
414
|
src = _ref.src,
|
|
420
415
|
className = _ref.className;
|
|
421
416
|
var isEditing = React.useContext(host.PlasmicCanvasContext);
|
|
422
417
|
|
|
423
|
-
if (isEditing && !
|
|
418
|
+
if (isEditing && !preview) {
|
|
424
419
|
return React__default.createElement("div", {
|
|
425
420
|
className: className
|
|
426
421
|
}, React__default.createElement("div", {
|
|
@@ -448,27 +443,34 @@ function Iframe(_ref) {
|
|
|
448
443
|
className: className
|
|
449
444
|
});
|
|
450
445
|
}
|
|
451
|
-
|
|
452
|
-
name: "
|
|
453
|
-
|
|
446
|
+
var iframeMeta = {
|
|
447
|
+
name: "hostless-iframe",
|
|
448
|
+
displayName: "Iframe",
|
|
449
|
+
importName: "Iframe",
|
|
450
|
+
importPath: "@plasmicpkgs/plasmic-basic-components",
|
|
454
451
|
props: {
|
|
455
452
|
src: {
|
|
456
453
|
type: "string",
|
|
457
454
|
defaultValue: "https://www.example.com"
|
|
458
455
|
},
|
|
459
|
-
|
|
456
|
+
preview: {
|
|
460
457
|
type: "boolean",
|
|
461
|
-
displayName: "Preview",
|
|
462
458
|
description: "Load the iframe while editing in Plasmic Studio"
|
|
463
459
|
}
|
|
464
460
|
},
|
|
465
|
-
isDefaultExport: true,
|
|
466
461
|
defaultStyles: {
|
|
467
462
|
width: "300px",
|
|
468
463
|
height: "150px",
|
|
469
464
|
maxWidth: "100%"
|
|
470
465
|
}
|
|
471
|
-
}
|
|
466
|
+
};
|
|
467
|
+
function registerIframe(loader, customIframeMeta) {
|
|
468
|
+
if (loader) {
|
|
469
|
+
loader.registerComponent(Iframe, customIframeMeta != null ? customIframeMeta : iframeMeta);
|
|
470
|
+
} else {
|
|
471
|
+
registerComponent(Iframe, customIframeMeta != null ? customIframeMeta : iframeMeta);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
472
474
|
|
|
473
475
|
function useDirectionalIntersection(_ref) {
|
|
474
476
|
var ref = _ref.ref,
|
|
@@ -534,40 +536,49 @@ function ScrollRevealer(_ref2) {
|
|
|
534
536
|
ref: intersectionRef
|
|
535
537
|
}, revealed ? children : null);
|
|
536
538
|
}
|
|
537
|
-
|
|
538
|
-
name: "
|
|
539
|
+
var scrollRevealerMeta = {
|
|
540
|
+
name: "hostless-scroll-revealer",
|
|
541
|
+
importName: "ScrollRevealer",
|
|
539
542
|
displayName: "Scroll Revealer",
|
|
540
|
-
importPath: "@plasmicpkgs/plasmic-basic-components
|
|
543
|
+
importPath: "@plasmicpkgs/plasmic-basic-components",
|
|
541
544
|
props: {
|
|
542
545
|
children: "slot",
|
|
543
546
|
scrollDownThreshold: {
|
|
544
547
|
type: "number",
|
|
545
548
|
displayName: "Scroll down threshold",
|
|
546
|
-
|
|
549
|
+
defaultValueHint: 0.5,
|
|
547
550
|
description: "How much of the element (as a fraction) must you scroll into view for it to appear (defaults to 0.5)"
|
|
548
551
|
},
|
|
549
552
|
scrollUpThreshold: {
|
|
550
553
|
type: "number",
|
|
551
554
|
displayName: "Scroll up threshold",
|
|
552
|
-
|
|
555
|
+
defaultValueHint: 0,
|
|
553
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)"
|
|
554
557
|
}
|
|
555
558
|
},
|
|
556
|
-
isDefaultExport: true,
|
|
557
559
|
defaultStyles: {
|
|
558
560
|
width: "stretch",
|
|
559
561
|
maxWidth: "100%"
|
|
560
562
|
}
|
|
561
|
-
}
|
|
563
|
+
};
|
|
564
|
+
function registerScrollRevealer(loader, customScrollRevealerMeta) {
|
|
565
|
+
if (loader) {
|
|
566
|
+
loader.registerComponent(ScrollRevealer, customScrollRevealerMeta != null ? customScrollRevealerMeta : scrollRevealerMeta);
|
|
567
|
+
} else {
|
|
568
|
+
registerComponent(ScrollRevealer, customScrollRevealerMeta != null ? customScrollRevealerMeta : scrollRevealerMeta);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
562
571
|
|
|
563
572
|
var Video = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
|
|
564
573
|
return React__default.createElement("video", Object.assign({
|
|
565
574
|
ref: ref
|
|
566
575
|
}, props));
|
|
567
576
|
});
|
|
568
|
-
|
|
569
|
-
name: "
|
|
570
|
-
|
|
577
|
+
var videoMeta = {
|
|
578
|
+
name: "hostless-html-video",
|
|
579
|
+
importName: "Video",
|
|
580
|
+
displayName: "HTML Video",
|
|
581
|
+
importPath: "@plasmicpkgs/plasmic-basic-components",
|
|
571
582
|
props: {
|
|
572
583
|
src: {
|
|
573
584
|
type: "string",
|
|
@@ -600,13 +611,11 @@ registerComponent(Video, {
|
|
|
600
611
|
displayName: "Muted",
|
|
601
612
|
description: "Whether audio should be muted"
|
|
602
613
|
},
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
// "Image to show while video is downloading",
|
|
609
|
-
// },
|
|
614
|
+
poster: {
|
|
615
|
+
type: "imageUrl",
|
|
616
|
+
displayName: "Poster (placeholder) image",
|
|
617
|
+
description: "Image to show while video is downloading"
|
|
618
|
+
},
|
|
610
619
|
preload: {
|
|
611
620
|
type: "choice",
|
|
612
621
|
options: ["none", "metadata", "auto"],
|
|
@@ -614,13 +623,19 @@ registerComponent(Video, {
|
|
|
614
623
|
description: "Whether to preload nothing, metadata only, or the full video"
|
|
615
624
|
}
|
|
616
625
|
},
|
|
617
|
-
isDefaultExport: true,
|
|
618
626
|
defaultStyles: {
|
|
619
627
|
height: "hug",
|
|
620
628
|
width: "640px",
|
|
621
629
|
maxWidth: "100%"
|
|
622
630
|
}
|
|
623
|
-
}
|
|
631
|
+
};
|
|
632
|
+
function registerVideo(loader, customVideoMeta) {
|
|
633
|
+
if (loader) {
|
|
634
|
+
loader.registerComponent(Video, customVideoMeta != null ? customVideoMeta : videoMeta);
|
|
635
|
+
} else {
|
|
636
|
+
registerComponent(Video, customVideoMeta != null ? customVideoMeta : videoMeta);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
624
639
|
|
|
625
640
|
exports.DataContext = DataContext;
|
|
626
641
|
exports.DataProvider = DataProvider;
|
|
@@ -629,14 +644,32 @@ exports.DynamicCollectionGrid = DynamicCollectionGrid;
|
|
|
629
644
|
exports.DynamicElement = DynamicElement;
|
|
630
645
|
exports.DynamicImage = DynamicImage;
|
|
631
646
|
exports.DynamicText = DynamicText;
|
|
632
|
-
exports.Embed = Embed;
|
|
633
647
|
exports.Iframe = Iframe;
|
|
634
648
|
exports.ScrollRevealer = ScrollRevealer;
|
|
635
649
|
exports.Video = Video;
|
|
636
650
|
exports.applySelector = applySelector;
|
|
651
|
+
exports.dataProviderMeta = dataProviderMeta;
|
|
652
|
+
exports.dynamicCollectionGridMeta = dynamicCollectionGridMeta;
|
|
637
653
|
exports.dynamicCollectionGridProps = dynamicCollectionGridProps;
|
|
654
|
+
exports.dynamicCollectionMeta = dynamicCollectionMeta;
|
|
638
655
|
exports.dynamicCollectionProps = dynamicCollectionProps;
|
|
656
|
+
exports.dynamicElementMeta = dynamicElementMeta;
|
|
657
|
+
exports.dynamicImageMeta = dynamicImageMeta;
|
|
658
|
+
exports.dynamicTextMeta = dynamicTextMeta;
|
|
659
|
+
exports.iframeMeta = iframeMeta;
|
|
660
|
+
exports.registerDataProvider = registerDataProvider;
|
|
661
|
+
exports.registerDynamicCollection = registerDynamicCollection;
|
|
662
|
+
exports.registerDynamicCollectionGrid = registerDynamicCollectionGrid;
|
|
663
|
+
exports.registerDynamicElement = registerDynamicElement;
|
|
664
|
+
exports.registerDynamicImage = registerDynamicImage;
|
|
665
|
+
exports.registerDynamicText = registerDynamicText;
|
|
666
|
+
exports.registerIframe = registerIframe;
|
|
667
|
+
exports.registerScrollRevealer = registerScrollRevealer;
|
|
668
|
+
exports.registerVideo = registerVideo;
|
|
669
|
+
exports.scrollRevealerMeta = scrollRevealerMeta;
|
|
639
670
|
exports.useDataEnv = useDataEnv;
|
|
671
|
+
exports.useDirectionalIntersection = useDirectionalIntersection;
|
|
640
672
|
exports.useSelector = useSelector;
|
|
641
673
|
exports.useSelectors = useSelectors;
|
|
674
|
+
exports.videoMeta = videoMeta;
|
|
642
675
|
//# sourceMappingURL=plasmic-basic-components.cjs.development.js.map
|