@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
|
@@ -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,
|
|
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) {
|
|
@@ -231,9 +223,11 @@ function DynamicCollectionGrid(_ref9) {
|
|
|
231
223
|
}
|
|
232
224
|
}));
|
|
233
225
|
}
|
|
234
|
-
var thisModule = "@plasmicpkgs/plasmic-basic-components
|
|
235
|
-
|
|
236
|
-
name: "
|
|
226
|
+
var thisModule = "@plasmicpkgs/plasmic-basic-components";
|
|
227
|
+
var dataProviderMeta = {
|
|
228
|
+
name: "hostless-data-provider",
|
|
229
|
+
displayName: "Data Provider",
|
|
230
|
+
importName: "DataProvider",
|
|
237
231
|
importPath: thisModule,
|
|
238
232
|
// description: "Makes some specified data available to the subtree in a context",
|
|
239
233
|
props: {
|
|
@@ -258,24 +252,31 @@ registerComponent(DataProvider, {
|
|
|
258
252
|
type: "slot",
|
|
259
253
|
defaultValue: [{
|
|
260
254
|
type: "component",
|
|
261
|
-
name: "
|
|
255
|
+
name: "hostless-dynamic-text",
|
|
262
256
|
props: {
|
|
263
257
|
selector: "celebrities.0.name"
|
|
264
258
|
}
|
|
265
259
|
}, {
|
|
266
260
|
type: "component",
|
|
267
|
-
name: "
|
|
261
|
+
name: "hostless-dynamic-image",
|
|
268
262
|
props: {
|
|
269
263
|
selector: "celebrities.0.profilePicture"
|
|
270
264
|
}
|
|
271
265
|
}]
|
|
272
266
|
}
|
|
273
267
|
}
|
|
274
|
-
}
|
|
268
|
+
};
|
|
269
|
+
function registerDataProvider(loader, customDataProviderMeta) {
|
|
270
|
+
if (loader) {
|
|
271
|
+
loader.registerComponent(DataProvider, customDataProviderMeta != null ? customDataProviderMeta : dataProviderMeta);
|
|
272
|
+
} else {
|
|
273
|
+
registerComponent(DataProvider, customDataProviderMeta != null ? customDataProviderMeta : dataProviderMeta);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
275
276
|
var dynamicPropsWithoutTag = {
|
|
276
277
|
propSelectors: {
|
|
277
278
|
type: "object",
|
|
278
|
-
|
|
279
|
+
defaultValueHint: {},
|
|
279
280
|
description: "An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value."
|
|
280
281
|
}
|
|
281
282
|
};
|
|
@@ -283,39 +284,66 @@ var dynamicPropsWithoutTag = {
|
|
|
283
284
|
var dynamicProps = /*#__PURE__*/_extends({}, dynamicPropsWithoutTag, {
|
|
284
285
|
tag: {
|
|
285
286
|
type: "string",
|
|
286
|
-
|
|
287
|
+
defaultValueHint: "div",
|
|
287
288
|
description: "The HTML tag to use"
|
|
288
289
|
}
|
|
289
290
|
}); // TODO Eventually we'll want to expose all the base HTML properties, but in the nicer way that we do within the studio.
|
|
290
291
|
|
|
291
292
|
|
|
292
|
-
|
|
293
|
-
name: "
|
|
293
|
+
var dynamicElementMeta = {
|
|
294
|
+
name: "hostless-dynamic-element",
|
|
295
|
+
displayName: "Dynamic Element",
|
|
296
|
+
importName: "DynamicElement",
|
|
294
297
|
importPath: thisModule,
|
|
295
|
-
props: _extends({}, dynamicProps, {
|
|
298
|
+
props: /*#__PURE__*/_extends({}, dynamicProps, {
|
|
296
299
|
children: "slot"
|
|
297
300
|
})
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
+
};
|
|
302
|
+
function registerDynamicElement(loader, customDynamicElementMeta) {
|
|
303
|
+
if (loader) {
|
|
304
|
+
loader.registerComponent(DynamicElement, customDynamicElementMeta != null ? customDynamicElementMeta : dynamicElementMeta);
|
|
305
|
+
} else {
|
|
306
|
+
registerComponent(DynamicElement, customDynamicElementMeta != null ? customDynamicElementMeta : dynamicElementMeta);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
var dynamicTextMeta = {
|
|
310
|
+
name: "hostless-dynamic-text",
|
|
311
|
+
importName: "DynamicText",
|
|
312
|
+
displayName: "Dynamic Text",
|
|
301
313
|
importPath: thisModule,
|
|
302
|
-
props: _extends({}, dynamicProps, {
|
|
314
|
+
props: /*#__PURE__*/_extends({}, dynamicProps, {
|
|
303
315
|
selector: {
|
|
304
316
|
type: "string",
|
|
305
317
|
description: "The selector expression to use to get the text, such as: someVariable.0.someField"
|
|
306
318
|
}
|
|
307
319
|
})
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
320
|
+
};
|
|
321
|
+
function registerDynamicText(loader, customDynamicTextMeta) {
|
|
322
|
+
if (loader) {
|
|
323
|
+
loader.registerComponent(DynamicText, customDynamicTextMeta != null ? customDynamicTextMeta : dynamicTextMeta);
|
|
324
|
+
} else {
|
|
325
|
+
registerComponent(DynamicText, customDynamicTextMeta != null ? customDynamicTextMeta : dynamicTextMeta);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
var dynamicImageMeta = {
|
|
329
|
+
name: "hostless-dynamic-image",
|
|
330
|
+
displayName: "Dynamic Image",
|
|
331
|
+
importName: "DynamicImage",
|
|
311
332
|
importPath: thisModule,
|
|
312
|
-
props: _extends({}, dynamicPropsWithoutTag, {
|
|
333
|
+
props: /*#__PURE__*/_extends({}, dynamicPropsWithoutTag, {
|
|
313
334
|
selector: {
|
|
314
335
|
type: "string",
|
|
315
336
|
description: "The selector expression to use to get the image source URL, such as: someVariable.0.someField"
|
|
316
337
|
}
|
|
317
338
|
})
|
|
318
|
-
}
|
|
339
|
+
};
|
|
340
|
+
function registerDynamicImage(loader, customDynamicImageMeta) {
|
|
341
|
+
if (loader) {
|
|
342
|
+
loader.registerComponent(DynamicImage, customDynamicImageMeta != null ? customDynamicImageMeta : dynamicImageMeta);
|
|
343
|
+
} else {
|
|
344
|
+
registerComponent(DynamicImage, customDynamicImageMeta != null ? customDynamicImageMeta : dynamicImageMeta);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
319
347
|
var dynamicCollectionProps = /*#__PURE__*/_extends({}, dynamicProps, {
|
|
320
348
|
selector: {
|
|
321
349
|
type: "string",
|
|
@@ -328,11 +356,20 @@ var dynamicCollectionProps = /*#__PURE__*/_extends({}, dynamicProps, {
|
|
|
328
356
|
},
|
|
329
357
|
children: "slot"
|
|
330
358
|
});
|
|
331
|
-
|
|
332
|
-
name: "
|
|
359
|
+
var dynamicCollectionMeta = {
|
|
360
|
+
name: "hostless-dynamic-collection",
|
|
361
|
+
displayName: "Dynamic Collection",
|
|
362
|
+
importName: "DynamicCollection",
|
|
333
363
|
importPath: thisModule,
|
|
334
364
|
props: dynamicCollectionProps
|
|
335
|
-
}
|
|
365
|
+
};
|
|
366
|
+
function registerDynamicCollection(loader, customDynamicCollectionMeta) {
|
|
367
|
+
if (loader) {
|
|
368
|
+
loader.registerComponent(DynamicCollection, customDynamicCollectionMeta != null ? customDynamicCollectionMeta : dynamicCollectionMeta);
|
|
369
|
+
} else {
|
|
370
|
+
registerComponent(DynamicCollection, customDynamicCollectionMeta != null ? customDynamicCollectionMeta : dynamicCollectionMeta);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
336
373
|
var dynamicCollectionGridProps = /*#__PURE__*/_extends({}, dynamicCollectionProps, {
|
|
337
374
|
columns: {
|
|
338
375
|
type: "number",
|
|
@@ -350,70 +387,28 @@ var dynamicCollectionGridProps = /*#__PURE__*/_extends({}, dynamicCollectionProp
|
|
|
350
387
|
description: "The gap between rows"
|
|
351
388
|
}
|
|
352
389
|
});
|
|
353
|
-
|
|
354
|
-
name: "
|
|
390
|
+
var dynamicCollectionGridMeta = {
|
|
391
|
+
name: "hostless-dynamic-collection-grid",
|
|
392
|
+
displayName: "Dynamic Collection Grid",
|
|
393
|
+
importName: "DynamicCollectionGrid",
|
|
355
394
|
importPath: thisModule,
|
|
356
395
|
props: dynamicCollectionGridProps
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
_ref$hideInEditor = _ref.hideInEditor,
|
|
364
|
-
hideInEditor = _ref$hideInEditor === void 0 ? false : _ref$hideInEditor;
|
|
365
|
-
var rootElt = useRef(null);
|
|
366
|
-
useEffect(function () {
|
|
367
|
-
if (hideInEditor) {
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
Array.from(ensure(rootElt.current).querySelectorAll("script")).forEach(function (oldScript) {
|
|
372
|
-
var newScript = document.createElement("script");
|
|
373
|
-
Array.from(oldScript.attributes).forEach(function (attr) {
|
|
374
|
-
return newScript.setAttribute(attr.name, attr.value);
|
|
375
|
-
});
|
|
376
|
-
newScript.appendChild(document.createTextNode(oldScript.innerHTML));
|
|
377
|
-
ensure(oldScript.parentNode).replaceChild(newScript, oldScript);
|
|
378
|
-
});
|
|
379
|
-
}, [code, hideInEditor]);
|
|
380
|
-
var effectiveCode = hideInEditor ? "" : code;
|
|
381
|
-
return React.createElement("div", {
|
|
382
|
-
ref: rootElt,
|
|
383
|
-
className: className,
|
|
384
|
-
dangerouslySetInnerHTML: {
|
|
385
|
-
__html: effectiveCode
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
registerComponent(Embed, {
|
|
390
|
-
name: "Embed",
|
|
391
|
-
importPath: "@plasmicpkgs/plasmic-basic-components/Embed",
|
|
392
|
-
props: {
|
|
393
|
-
code: {
|
|
394
|
-
type: "string",
|
|
395
|
-
defaultValue: "https://www.example.com"
|
|
396
|
-
},
|
|
397
|
-
hideInEditor: {
|
|
398
|
-
type: "boolean",
|
|
399
|
-
displayName: "Hide in editor",
|
|
400
|
-
description: "Disable running the code while editing in Plasmic Studio (may require reload)"
|
|
401
|
-
}
|
|
402
|
-
},
|
|
403
|
-
isDefaultExport: true,
|
|
404
|
-
defaultStyles: {
|
|
405
|
-
maxWidth: "100%"
|
|
396
|
+
};
|
|
397
|
+
function registerDynamicCollectionGrid(loader, customDynamicCollectionGridMeta) {
|
|
398
|
+
if (loader) {
|
|
399
|
+
loader.registerComponent(DynamicCollectionGrid, customDynamicCollectionGridMeta != null ? customDynamicCollectionGridMeta : dynamicCollectionGridMeta);
|
|
400
|
+
} else {
|
|
401
|
+
registerComponent(DynamicCollectionGrid, customDynamicCollectionGridMeta != null ? customDynamicCollectionGridMeta : dynamicCollectionGridMeta);
|
|
406
402
|
}
|
|
407
|
-
}
|
|
403
|
+
}
|
|
408
404
|
|
|
409
|
-
/** @format */
|
|
410
405
|
function Iframe(_ref) {
|
|
411
|
-
var
|
|
406
|
+
var preview = _ref.preview,
|
|
412
407
|
src = _ref.src,
|
|
413
408
|
className = _ref.className;
|
|
414
409
|
var isEditing = useContext(PlasmicCanvasContext);
|
|
415
410
|
|
|
416
|
-
if (isEditing && !
|
|
411
|
+
if (isEditing && !preview) {
|
|
417
412
|
return React.createElement("div", {
|
|
418
413
|
className: className
|
|
419
414
|
}, React.createElement("div", {
|
|
@@ -441,27 +436,34 @@ function Iframe(_ref) {
|
|
|
441
436
|
className: className
|
|
442
437
|
});
|
|
443
438
|
}
|
|
444
|
-
|
|
445
|
-
name: "
|
|
446
|
-
|
|
439
|
+
var iframeMeta = {
|
|
440
|
+
name: "hostless-iframe",
|
|
441
|
+
displayName: "Iframe",
|
|
442
|
+
importName: "Iframe",
|
|
443
|
+
importPath: "@plasmicpkgs/plasmic-basic-components",
|
|
447
444
|
props: {
|
|
448
445
|
src: {
|
|
449
446
|
type: "string",
|
|
450
447
|
defaultValue: "https://www.example.com"
|
|
451
448
|
},
|
|
452
|
-
|
|
449
|
+
preview: {
|
|
453
450
|
type: "boolean",
|
|
454
|
-
displayName: "Preview",
|
|
455
451
|
description: "Load the iframe while editing in Plasmic Studio"
|
|
456
452
|
}
|
|
457
453
|
},
|
|
458
|
-
isDefaultExport: true,
|
|
459
454
|
defaultStyles: {
|
|
460
455
|
width: "300px",
|
|
461
456
|
height: "150px",
|
|
462
457
|
maxWidth: "100%"
|
|
463
458
|
}
|
|
464
|
-
}
|
|
459
|
+
};
|
|
460
|
+
function registerIframe(loader, customIframeMeta) {
|
|
461
|
+
if (loader) {
|
|
462
|
+
loader.registerComponent(Iframe, customIframeMeta != null ? customIframeMeta : iframeMeta);
|
|
463
|
+
} else {
|
|
464
|
+
registerComponent(Iframe, customIframeMeta != null ? customIframeMeta : iframeMeta);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
465
467
|
|
|
466
468
|
function useDirectionalIntersection(_ref) {
|
|
467
469
|
var ref = _ref.ref,
|
|
@@ -527,40 +529,49 @@ function ScrollRevealer(_ref2) {
|
|
|
527
529
|
ref: intersectionRef
|
|
528
530
|
}, revealed ? children : null);
|
|
529
531
|
}
|
|
530
|
-
|
|
531
|
-
name: "
|
|
532
|
+
var scrollRevealerMeta = {
|
|
533
|
+
name: "hostless-scroll-revealer",
|
|
534
|
+
importName: "ScrollRevealer",
|
|
532
535
|
displayName: "Scroll Revealer",
|
|
533
|
-
importPath: "@plasmicpkgs/plasmic-basic-components
|
|
536
|
+
importPath: "@plasmicpkgs/plasmic-basic-components",
|
|
534
537
|
props: {
|
|
535
538
|
children: "slot",
|
|
536
539
|
scrollDownThreshold: {
|
|
537
540
|
type: "number",
|
|
538
541
|
displayName: "Scroll down threshold",
|
|
539
|
-
|
|
542
|
+
defaultValueHint: 0.5,
|
|
540
543
|
description: "How much of the element (as a fraction) must you scroll into view for it to appear (defaults to 0.5)"
|
|
541
544
|
},
|
|
542
545
|
scrollUpThreshold: {
|
|
543
546
|
type: "number",
|
|
544
547
|
displayName: "Scroll up threshold",
|
|
545
|
-
|
|
548
|
+
defaultValueHint: 0,
|
|
546
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)"
|
|
547
550
|
}
|
|
548
551
|
},
|
|
549
|
-
isDefaultExport: true,
|
|
550
552
|
defaultStyles: {
|
|
551
553
|
width: "stretch",
|
|
552
554
|
maxWidth: "100%"
|
|
553
555
|
}
|
|
554
|
-
}
|
|
556
|
+
};
|
|
557
|
+
function registerScrollRevealer(loader, customScrollRevealerMeta) {
|
|
558
|
+
if (loader) {
|
|
559
|
+
loader.registerComponent(ScrollRevealer, customScrollRevealerMeta != null ? customScrollRevealerMeta : scrollRevealerMeta);
|
|
560
|
+
} else {
|
|
561
|
+
registerComponent(ScrollRevealer, customScrollRevealerMeta != null ? customScrollRevealerMeta : scrollRevealerMeta);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
555
564
|
|
|
556
565
|
var Video = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
557
566
|
return React.createElement("video", Object.assign({
|
|
558
567
|
ref: ref
|
|
559
568
|
}, props));
|
|
560
569
|
});
|
|
561
|
-
|
|
562
|
-
name: "
|
|
563
|
-
|
|
570
|
+
var videoMeta = {
|
|
571
|
+
name: "hostless-html-video",
|
|
572
|
+
importName: "Video",
|
|
573
|
+
displayName: "HTML Video",
|
|
574
|
+
importPath: "@plasmicpkgs/plasmic-basic-components",
|
|
564
575
|
props: {
|
|
565
576
|
src: {
|
|
566
577
|
type: "string",
|
|
@@ -593,13 +604,11 @@ registerComponent(Video, {
|
|
|
593
604
|
displayName: "Muted",
|
|
594
605
|
description: "Whether audio should be muted"
|
|
595
606
|
},
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
// "Image to show while video is downloading",
|
|
602
|
-
// },
|
|
607
|
+
poster: {
|
|
608
|
+
type: "imageUrl",
|
|
609
|
+
displayName: "Poster (placeholder) image",
|
|
610
|
+
description: "Image to show while video is downloading"
|
|
611
|
+
},
|
|
603
612
|
preload: {
|
|
604
613
|
type: "choice",
|
|
605
614
|
options: ["none", "metadata", "auto"],
|
|
@@ -607,13 +616,19 @@ registerComponent(Video, {
|
|
|
607
616
|
description: "Whether to preload nothing, metadata only, or the full video"
|
|
608
617
|
}
|
|
609
618
|
},
|
|
610
|
-
isDefaultExport: true,
|
|
611
619
|
defaultStyles: {
|
|
612
620
|
height: "hug",
|
|
613
621
|
width: "640px",
|
|
614
622
|
maxWidth: "100%"
|
|
615
623
|
}
|
|
616
|
-
}
|
|
624
|
+
};
|
|
625
|
+
function registerVideo(loader, customVideoMeta) {
|
|
626
|
+
if (loader) {
|
|
627
|
+
loader.registerComponent(Video, customVideoMeta != null ? customVideoMeta : videoMeta);
|
|
628
|
+
} else {
|
|
629
|
+
registerComponent(Video, customVideoMeta != null ? customVideoMeta : videoMeta);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
617
632
|
|
|
618
|
-
export { DataContext, DataProvider, DynamicCollection, DynamicCollectionGrid, DynamicElement, DynamicImage, DynamicText,
|
|
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 };
|
|
619
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","/** @format */\n\nimport { repeatedElement } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, {\n ComponentProps,\n createContext,\n createElement,\n CSSProperties,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n name?: string;\n data?: any;\n children?: ReactNode;\n}\n\nexport function DataProvider({ name, data, children }: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider value={{ ...existingEnv, [name]: data }}>\n {children}\n </DataContext.Provider>\n );\n }\n}\n\nexport interface CommonDynamicProps {\n className?: string;\n tag?: string;\n propSelectors?: SelectorDict;\n}\n\nexport function DynamicElement<\n Tag extends keyof JSX.IntrinsicElements = \"div\"\n>({\n tag = \"div\",\n className,\n children,\n propSelectors,\n ...props\n}: CommonDynamicProps & ComponentProps<Tag>) {\n const computed = useSelectors(propSelectors);\n return createElement(tag, {\n children,\n ...props,\n ...computed,\n className: className + \" \" + computed.className,\n });\n}\n\nexport function DynamicText({\n selector,\n propSelectors,\n ...props\n}: CommonDynamicProps & {\n selector?: string;\n}) {\n return (\n <DynamicElement\n {...props}\n propSelectors={{ ...propSelectors, children: selector }}\n >\n {/*This is the default text*/}\n (DynamicText requires a selector)\n </DynamicElement>\n );\n}\n\nexport function DynamicImage({\n selector,\n propSelectors,\n ...props\n}: CommonDynamicProps &\n ComponentProps<\"img\"> & {\n selector?: string;\n }) {\n return (\n <DynamicElement<\"img\">\n tag={\"img\"}\n loading={\"lazy\"}\n style={{\n objectFit: \"cover\",\n }}\n {...props}\n propSelectors={{ ...propSelectors, src: selector }}\n // Default image placeholder\n src=\"https://studio.plasmic.app/static/img/placeholder.png\"\n />\n );\n}\n\nexport interface DynamicCollectionProps extends CommonDynamicProps {\n children?: ReactNode;\n style?: CSSProperties;\n loopItemName?: string;\n keySelector?: string;\n selector?: string;\n data?: any;\n}\n\nexport function DynamicCollection({\n selector,\n loopItemName,\n children,\n data,\n keySelector,\n ...props\n}: DynamicCollectionProps) {\n // Defaults to an array of three items.\n const finalData = data ?? useSelector(selector) ?? [1, 2, 3];\n return (\n <DynamicElement {...props}>\n {finalData?.map?.((item: any, index: number) => (\n <DataProvider\n key={applySelector(item, keySelector) ?? index}\n name={loopItemName}\n data={item}\n >\n {repeatedElement(index === 0, children)}\n </DataProvider>\n ))}\n </DynamicElement>\n );\n}\n\nexport interface DynamicCollectionGridProps extends DynamicCollectionProps {\n columns?: number;\n columnGap?: number;\n rowGap?: number;\n}\n\nexport function DynamicCollectionGrid({\n columns,\n columnGap = 0,\n rowGap = 0,\n ...props\n}: DynamicCollectionGridProps) {\n return (\n <DynamicCollection\n {...props}\n style={{\n display: \"grid\",\n gridTemplateColumns: `repeat(${columns}, 1fr)`,\n columnGap: `${columnGap}px`,\n rowGap: `${rowGap}px`,\n }}\n />\n );\n}\n\nconst thisModule = \"@plasmicpkgs/plasmic-basic-components/Data\";\n\nregisterComponent(DataProvider, {\n name: \"DataProvider\",\n importPath: thisModule,\n // description: \"Makes some specified data available to the subtree in a context\",\n props: {\n name: {\n type: \"string\",\n defaultValue: \"celebrities\",\n description: \"The name of the variable to store the data in\",\n },\n data: {\n type: \"object\",\n defaultValue: [\n {\n name: \"Fill Murray\",\n birthYear: 1950,\n profilePicture: [\"https://www.fillmurray.com/200/300\"],\n },\n {\n name: \"Place Cage\",\n birthYear: 1950,\n profilePicture: [\"https://www.placecage.com/200/300\"],\n },\n ],\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"component\",\n name: \"DynamicText\",\n props: {\n selector: \"celebrities.0.name\",\n },\n },\n {\n type: \"component\",\n name: \"DynamicImage\",\n props: {\n selector: \"celebrities.0.profilePicture\",\n },\n },\n ],\n },\n },\n});\n\nconst dynamicPropsWithoutTag = {\n propSelectors: {\n type: \"object\",\n // defaultValueHint: {},\n description:\n \"An object whose keys are prop names and values are selector expressions. Use this to set any prop to a dynamic value.\",\n },\n} as const;\n\nconst dynamicProps = {\n ...dynamicPropsWithoutTag,\n tag: {\n type: \"string\",\n // defaultValueHint: \"div\",\n description: \"The HTML tag to use\",\n },\n} as const;\n\n// TODO Eventually we'll want to expose all the base HTML properties, but in the nicer way that we do within the studio.\n\nregisterComponent(DynamicElement, {\n name: \"DynamicElement\",\n importPath: thisModule,\n props: { ...dynamicProps, children: \"slot\" },\n});\n\nregisterComponent(DynamicText, {\n name: \"DynamicText\",\n importPath: thisModule,\n props: {\n ...dynamicProps,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the text, such as: someVariable.0.someField\",\n },\n },\n});\n\nregisterComponent(DynamicImage, {\n name: \"DynamicImage\",\n importPath: thisModule,\n props: {\n ...dynamicPropsWithoutTag,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the image source URL, such as: someVariable.0.someField\",\n },\n },\n});\n\nexport const dynamicCollectionProps = {\n ...dynamicProps,\n selector: {\n type: \"string\",\n description:\n \"The selector expression to use to get the array of data to loop over, such as: someVariable.0.someField\",\n },\n loopItemName: {\n type: \"string\",\n defaultValue: \"item\",\n description:\n \"The name of the variable to use to store the current item in the loop\",\n },\n children: \"slot\",\n} as const;\n\nregisterComponent(DynamicCollection, {\n name: \"DynamicCollection\",\n importPath: thisModule,\n props: dynamicCollectionProps,\n});\n\nexport const dynamicCollectionGridProps = {\n ...dynamicCollectionProps,\n columns: {\n type: \"number\",\n defaultValue: 2,\n description: \"The number of columns to use in the grid\",\n },\n columnGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between columns\",\n },\n rowGap: {\n type: \"number\",\n defaultValue: 8,\n description: \"The gap between rows\",\n },\n} as const;\n\nregisterComponent(DynamicCollectionGrid, {\n name: \"DynamicCollectionGrid\",\n importPath: thisModule,\n props: dynamicCollectionGridProps,\n});\n","/** @format */\n\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { useEffect, useRef } from \"react\";\nimport { ensure } from \"./common\";\n\nexport interface EmbedProps {\n className?: string;\n code: string;\n hideInEditor?: boolean;\n}\n\nexport default function Embed({\n className,\n code,\n hideInEditor = false,\n}: EmbedProps) {\n const rootElt = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (hideInEditor) {\n return;\n }\n Array.from(ensure(rootElt.current).querySelectorAll(\"script\")).forEach(\n (oldScript) => {\n const newScript = document.createElement(\"script\");\n Array.from(oldScript.attributes).forEach((attr) =>\n newScript.setAttribute(attr.name, attr.value)\n );\n newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n ensure(oldScript.parentNode).replaceChild(newScript, oldScript);\n }\n );\n }, [code, hideInEditor]);\n const effectiveCode = hideInEditor ? \"\" : code;\n return (\n <div\n ref={rootElt}\n className={className}\n dangerouslySetInnerHTML={{ __html: effectiveCode }}\n />\n );\n}\n\nregisterComponent(Embed, {\n name: \"Embed\",\n importPath: \"@plasmicpkgs/plasmic-basic-components/Embed\",\n props: {\n code: {\n type: \"string\",\n defaultValue: \"https://www.example.com\",\n },\n hideInEditor: {\n type: \"boolean\",\n displayName: \"Hide in editor\",\n description:\n \"Disable running the code while editing in Plasmic Studio (may require reload)\",\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n maxWidth: \"100%\",\n },\n});\n","/** @format */\n\nimport { PlasmicCanvasContext } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { useContext } from \"react\";\n\nexport interface IframeProps {\n src: string;\n hideInEditor?: boolean;\n className?: string;\n}\n\nexport default function Iframe({ hideInEditor, src, className }: IframeProps) {\n const isEditing = useContext(PlasmicCanvasContext);\n if (isEditing && !hideInEditor) {\n return (\n <div className={className}>\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n background: \"#eee\",\n color: \"#888\",\n fontSize: \"36px\",\n fontFamily: \"sans-serif\",\n fontWeight: \"bold\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n }}\n >\n Iframe placeholder\n </div>\n </div>\n );\n }\n return <iframe src={src} className={className} />;\n}\n\nregisterComponent(Iframe, {\n name: \"Iframe\",\n importPath: \"@plasmicpkgs/plasmic-basic-components/Iframe\",\n props: {\n src: {\n type: \"string\",\n defaultValue: \"https://www.example.com\",\n },\n hideInEditor: {\n type: \"boolean\",\n displayName: \"Preview\",\n description: \"Load the iframe while editing in Plasmic Studio\",\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n width: \"300px\",\n height: \"150px\",\n maxWidth: \"100%\",\n },\n});\n","import registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, {\n ReactNode,\n RefObject,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nexport function useDirectionalIntersection({\n ref,\n scrollDownThreshold = 0.5,\n scrollUpThreshold = 0,\n}: {\n ref: RefObject<HTMLElement>;\n scrollDownThreshold?: number;\n scrollUpThreshold?: number;\n}) {\n const [revealed, setRevealed] = useState(false);\n useEffect(() => {\n if (ref.current && typeof IntersectionObserver === \"function\") {\n const handler = (entries: IntersectionObserverEntry[]) => {\n if (entries[0].intersectionRatio >= scrollDownThreshold) {\n setRevealed(true);\n } else if (entries[0].intersectionRatio <= scrollUpThreshold) {\n setRevealed(false);\n }\n };\n\n const observer = new IntersectionObserver(handler, {\n root: null,\n rootMargin: \"0%\",\n threshold: [scrollUpThreshold, scrollDownThreshold],\n });\n observer.observe(ref.current);\n\n return () => {\n setRevealed(false);\n observer.disconnect();\n };\n }\n return () => {};\n }, [ref.current, scrollDownThreshold, scrollUpThreshold]);\n return revealed;\n}\n\n/**\n * Unlike react-awesome-reveal, ScrollRevealer:\n *\n * - has configurable thresholds\n * - triggers arbitrary render/unrender animations\n *\n * TODO: Merge this inta a general Reveal component, perhaps forking react-awesome-reveal, so that we don't have two different reveal components for users.\n */\nexport default function ScrollRevealer({\n children,\n className,\n scrollDownThreshold = 0.5,\n scrollUpThreshold = 0,\n}: {\n children?: ReactNode;\n className?: string;\n scrollUpThreshold?: number;\n scrollDownThreshold?: number;\n}) {\n const intersectionRef = useRef<HTMLDivElement>(null);\n const revealed = useDirectionalIntersection({\n ref: intersectionRef,\n scrollUpThreshold,\n scrollDownThreshold,\n });\n return (\n <div className={className} ref={intersectionRef}>\n {revealed ? children : null}\n </div>\n );\n}\n\nregisterComponent(ScrollRevealer, {\n name: \"ScrollRevealer\",\n displayName: \"Scroll Revealer\",\n importPath: \"@plasmicpkgs/plasmic-basic-components/ScrollRevealer\",\n props: {\n children: \"slot\",\n scrollDownThreshold: {\n type: \"number\",\n displayName: \"Scroll down threshold\",\n // defaultValueHint: 0.5,\n description:\n \"How much of the element (as a fraction) must you scroll into view for it to appear (defaults to 0.5)\",\n },\n scrollUpThreshold: {\n type: \"number\",\n displayName: \"Scroll up threshold\",\n // defaultValueHint: 0,\n description:\n \"While scrolling up, how much of the element (as a fraction) can still be scrolled in view before it disappears (defaults to 0, meaning you must scroll up until it's completely out of view)\",\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n width: \"stretch\",\n maxWidth: \"100%\",\n },\n});\n","import registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\n\ntype VideoProps = Pick<\n React.ComponentProps<\"video\">,\n | \"autoPlay\"\n | \"controls\"\n | \"loop\"\n | \"muted\"\n | \"playsInline\"\n | \"poster\"\n | \"preload\"\n | \"src\"\n>;\n\nconst Video = React.forwardRef<HTMLVideoElement, VideoProps>(\n (props: VideoProps, ref) => {\n return <video ref={ref} {...props} />;\n }\n);\n\nexport default Video;\n\nregisterComponent(Video, {\n name: \"Video\",\n importPath: \"@plasmicpkgs/plasmic-basic-components/Video\",\n props: {\n src: {\n type: \"string\",\n defaultValue:\n \"https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm\",\n displayName: \"Source URL\",\n description: \"URL to a video file.\",\n },\n autoPlay: {\n type: \"boolean\",\n displayName: \"Auto Play\",\n description:\n \"Whether the video show automatically start playing when the player loads\",\n },\n controls: {\n type: \"boolean\",\n displayName: \"Show Controls\",\n description: \"Whether the video player controls should be displayed\",\n },\n playsInline: {\n type: \"boolean\",\n displayName: \"Plays inline\",\n description:\n \"Usually on mobile, when tilted landscape, videos can play fullscreen. Turn this on to prevent that.\",\n },\n loop: {\n type: \"boolean\",\n displayName: \"Loop\",\n description: \"Whether the video should be played again after it finishes\",\n },\n muted: {\n type: \"boolean\",\n displayName: \"Muted\",\n description: \"Whether audio should be muted\",\n },\n // TODO enable this once image is a type\n // poster: {\n // type: \"image\",\n // displayName: \"Poster (placeholder) image\",\n // description:\n // \"Image to show while video is downloading\",\n // },\n preload: {\n type: \"choice\",\n options: [\"none\", \"metadata\", \"auto\"],\n displayName: \"Preload\",\n description:\n \"Whether to preload nothing, metadata only, or the full video\",\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n height: \"hug\",\n width: \"640px\",\n maxWidth: \"100%\",\n },\n});\n"],"names":["tuple","args","ensure","x","undefined","Error","DataContext","createContext","applySelector","rawData","selector","curData","split","key","useSelector","useDataEnv","useSelectors","selectors","Object","fromEntries","entries","filter","map","useContext","DataProvider","name","data","children","existingEnv","React","Provider","value","DynamicElement","tag","className","propSelectors","props","computed","createElement","DynamicText","DynamicImage","loading","style","objectFit","src","DynamicCollection","loopItemName","keySelector","finalData","item","index","repeatedElement","DynamicCollectionGrid","columns","columnGap","rowGap","display","gridTemplateColumns","thisModule","registerComponent","importPath","type","defaultValue","description","birthYear","profilePicture","dynamicPropsWithoutTag","dynamicProps","dynamicCollectionProps","dynamicCollectionGridProps","Embed","code","hideInEditor","rootElt","useRef","useEffect","Array","from","current","querySelectorAll","forEach","oldScript","newScript","document","attributes","attr","setAttribute","appendChild","createTextNode","innerHTML","parentNode","replaceChild","effectiveCode","ref","dangerouslySetInnerHTML","__html","displayName","isDefaultExport","defaultStyles","maxWidth","Iframe","isEditing","PlasmicCanvasContext","position","top","left","right","bottom","background","color","fontSize","fontFamily","fontWeight","alignItems","justifyContent","overflow","width","height","useDirectionalIntersection","scrollDownThreshold","scrollUpThreshold","useState","revealed","setRevealed","IntersectionObserver","handler","intersectionRatio","observer","root","rootMargin","threshold","observe","disconnect","ScrollRevealer","intersectionRef","Video","forwardRef","autoPlay","controls","playsInline","loop","muted","preload","options"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,IAAMA,KAAK,GAAG,SAARA,KAAQ;AAAA,oCAAqBC,IAArB;AAAqBA,IAAAA,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;;ICOYG,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,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;AAA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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;AA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1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/plasmic-basic-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Plasmic registration call for the HTML5 video element",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "tsdx build
|
|
22
|
+
"build": "tsdx build",
|
|
23
23
|
"start": "tsdx watch",
|
|
24
24
|
"test": "tsdx test --passWithNoTests",
|
|
25
25
|
"lint": "tsdx lint",
|
|
@@ -28,19 +28,15 @@
|
|
|
28
28
|
"analyze": "size-limit --why"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@rollup/plugin-commonjs": "^19.0.0",
|
|
32
|
-
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
33
31
|
"@size-limit/preset-small-lib": "^4.11.0",
|
|
34
32
|
"@types/node": "^14.0.26",
|
|
35
|
-
"rollup": "^2.47.0",
|
|
36
|
-
"rollup-plugin-typescript2": "^0.30.0",
|
|
37
33
|
"size-limit": "^4.11.0",
|
|
38
34
|
"tsdx": "^0.14.1",
|
|
39
35
|
"tslib": "^2.2.0",
|
|
40
36
|
"typescript": "^3.9.7"
|
|
41
37
|
},
|
|
42
38
|
"dependencies": {
|
|
43
|
-
"@plasmicapp/host": "^0.0.
|
|
39
|
+
"@plasmicapp/host": "^0.0.47"
|
|
44
40
|
},
|
|
45
41
|
"peerDependencies": {
|
|
46
42
|
"react": ">=16.8.0",
|