@plasmicpkgs/plasmic-basic-components 0.0.233 → 0.0.235
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/ConditionGuard.d.ts +1 -1
- package/dist/Embed.d.ts +1 -1
- package/dist/Embed.stories.d.ts +17 -0
- package/dist/Iframe.d.ts +1 -1
- package/dist/LoadingBoundary.d.ts +1 -1
- package/dist/Repeater.d.ts +2 -2
- package/dist/ScrollRevealer.d.ts +1 -1
- package/dist/SideEffect.d.ts +1 -1
- package/dist/Timer.d.ts +1 -1
- package/dist/Video.d.ts +1 -2
- package/dist/index.d.ts +0 -9
- package/dist/plasmic-basic-components.cjs.development.js +71 -64
- 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 +71 -64
- package/dist/plasmic-basic-components.esm.js.map +1 -1
- package/package.json +9 -4
package/dist/ConditionGuard.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface ConditionGuardProps {
|
|
|
8
8
|
path: string;
|
|
9
9
|
}>;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export declare function ConditionGuard({ condition, onNotSatisfied, children, skipPaths, }: ConditionGuardProps): React.JSX.Element;
|
|
12
12
|
export declare const conditionGuardMeta: ComponentMeta<ConditionGuardProps>;
|
|
13
13
|
export declare function registerConditionGuard(loader?: {
|
|
14
14
|
registerComponent: typeof registerComponent;
|
package/dist/Embed.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface EmbedProps {
|
|
|
17
17
|
* One last complication is that Next.js can run the effect multiple times in development mode. There's nothing actually
|
|
18
18
|
* that we can/should do about that, but just something to be aware of if you are here debugging issues.
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export declare function Embed({ className, code, hideInEditor }: EmbedProps): React.JSX.Element;
|
|
21
21
|
export declare const embedMeta: ComponentMeta<EmbedProps>;
|
|
22
22
|
export declare function registerEmbed(loader?: {
|
|
23
23
|
registerComponent: typeof registerComponent;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StoryObj } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Embed } from "./Embed";
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: typeof Embed;
|
|
7
|
+
args: {
|
|
8
|
+
code: string;
|
|
9
|
+
};
|
|
10
|
+
render: (args: any) => React.JSX.Element;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
13
|
+
declare type Story = StoryObj<typeof Embed>;
|
|
14
|
+
export declare const HtmlCssJs: Story;
|
|
15
|
+
export declare const HtmlCssJsSsr: Story;
|
|
16
|
+
export declare const Iframe: Story;
|
|
17
|
+
export declare const ScriptsLoadedSequentially: Story;
|
package/dist/Iframe.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface IframeProps {
|
|
|
7
7
|
className?: string;
|
|
8
8
|
onLoad?: React.ComponentProps<"iframe">["onLoad"];
|
|
9
9
|
}
|
|
10
|
-
export
|
|
10
|
+
export declare function Iframe({ preview, src, className, onLoad }: IframeProps): React.JSX.Element;
|
|
11
11
|
export declare const iframeMeta: ComponentMeta<IframeProps>;
|
|
12
12
|
export declare function registerIframe(loader?: {
|
|
13
13
|
registerComponent: typeof registerComponent;
|
|
@@ -5,7 +5,7 @@ interface LoadingBoundaryProps {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
forceLoading?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export declare function LoadingBoundary({ children, forceLoading, loadingState, }: LoadingBoundaryProps): React.JSX.Element | null;
|
|
9
9
|
export declare const loadingBoundaryMeta: ComponentMeta<LoadingBoundaryProps>;
|
|
10
10
|
export declare function registerLoadingBoundary(loader?: {
|
|
11
11
|
registerComponent: typeof registerComponent;
|
package/dist/Repeater.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ interface RepeaterProps<T> {
|
|
|
6
6
|
itemName?: string;
|
|
7
7
|
indexName?: string;
|
|
8
8
|
}
|
|
9
|
-
declare function Repeater<T>(props: RepeaterProps<T>): React.JSX.Element;
|
|
9
|
+
export declare function Repeater<T>(props: RepeaterProps<T>): React.JSX.Element;
|
|
10
10
|
export declare const repeaterMeta: ComponentMeta<RepeaterProps<any>>;
|
|
11
11
|
export declare function registerRepeater(loader?: {
|
|
12
12
|
registerComponent: typeof registerComponent;
|
|
13
13
|
}, customRepeaterMeta?: ComponentMeta<RepeaterProps<any>>): void;
|
|
14
|
-
export
|
|
14
|
+
export {};
|
package/dist/ScrollRevealer.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface ScrollRevealerProps {
|
|
|
19
19
|
*
|
|
20
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.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export declare function ScrollRevealer({ children, className, scrollDownThreshold, scrollUpThreshold, }: ScrollRevealerProps): React.JSX.Element;
|
|
23
23
|
export declare const scrollRevealerMeta: ComponentMeta<ScrollRevealerProps>;
|
|
24
24
|
export declare function registerScrollRevealer(loader?: {
|
|
25
25
|
registerComponent: typeof registerComponent;
|
package/dist/SideEffect.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface SideEffectProps {
|
|
|
4
4
|
onUnmount?: () => Promise<void>;
|
|
5
5
|
deps?: unknown[];
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export declare function SideEffect({ deps, onMount, onUnmount }: SideEffectProps): null;
|
|
8
8
|
export declare const sideEffectMeta: CodeComponentMeta<SideEffectProps>;
|
|
9
9
|
export declare function registerSideEffect(loader?: {
|
|
10
10
|
registerComponent: typeof registerComponent;
|
package/dist/Timer.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface TimerProps {
|
|
|
7
7
|
"data-plasmic-canvas-envs"?: number;
|
|
8
8
|
}
|
|
9
9
|
export declare function useInterval(callback: () => void, delay: number | null): void;
|
|
10
|
-
export
|
|
10
|
+
export declare function Timer({ intervalSeconds, isRunning, onTick, runWhileEditing, "data-plasmic-canvas-envs": canvasId, }: TimerProps): null;
|
|
11
11
|
export declare const timerMeta: CodeComponentMeta<TimerProps>;
|
|
12
12
|
export declare function registerTimer(loader?: {
|
|
13
13
|
registerComponent: typeof registerComponent;
|
package/dist/Video.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import registerComponent, { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
2
|
import React from "react";
|
|
3
3
|
export declare type VideoProps = Pick<React.ComponentProps<"video">, "autoPlay" | "controls" | "loop" | "muted" | "playsInline" | "poster" | "preload" | "src">;
|
|
4
|
-
declare const Video: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "autoPlay" | "controls" | "loop" | "muted" | "playsInline" | "poster" | "preload" | "src"> & React.RefAttributes<HTMLVideoElement>>;
|
|
5
|
-
export default Video;
|
|
4
|
+
export declare const Video: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "autoPlay" | "controls" | "loop" | "muted" | "playsInline" | "poster" | "preload" | "src"> & React.RefAttributes<HTMLVideoElement>>;
|
|
6
5
|
export declare const videoMeta: ComponentMeta<VideoProps>;
|
|
7
6
|
export declare function registerVideo(loader?: {
|
|
8
7
|
registerComponent: typeof registerComponent;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
export * from "./ConditionGuard";
|
|
2
|
-
export { default as ConditionGuard } from "./ConditionGuard";
|
|
3
2
|
export * from "./Data";
|
|
4
3
|
export * from "./Embed";
|
|
5
|
-
export { default as Embed } from "./Embed";
|
|
6
4
|
export * from "./Iframe";
|
|
7
|
-
export { default as Iframe } from "./Iframe";
|
|
8
5
|
export * from "./LoadingBoundary";
|
|
9
|
-
export { default as LoadingBoundary } from "./LoadingBoundary";
|
|
10
6
|
export * from "./Repeater";
|
|
11
|
-
export { default as Repeater } from "./Repeater";
|
|
12
7
|
export * from "./ScrollRevealer";
|
|
13
|
-
export { default as ScrollRevealer } from "./ScrollRevealer";
|
|
14
8
|
export * from "./SideEffect";
|
|
15
|
-
export { default as SideEffect } from "./SideEffect";
|
|
16
9
|
export * from "./Timer";
|
|
17
|
-
export { default as Timer } from "./Timer";
|
|
18
10
|
export * from "./Video";
|
|
19
|
-
export { default as Video } from "./Video";
|
|
@@ -89,6 +89,49 @@ function registerConditionGuard(loader, customConditionGuardMeta) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
93
|
+
try {
|
|
94
|
+
var i = n[a](c),
|
|
95
|
+
u = i.value;
|
|
96
|
+
} catch (n) {
|
|
97
|
+
return void e(n);
|
|
98
|
+
}
|
|
99
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
100
|
+
}
|
|
101
|
+
function _asyncToGenerator(n) {
|
|
102
|
+
return function () {
|
|
103
|
+
var t = this,
|
|
104
|
+
e = arguments;
|
|
105
|
+
return new Promise(function (r, o) {
|
|
106
|
+
var a = n.apply(t, e);
|
|
107
|
+
function _next(n) {
|
|
108
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
109
|
+
}
|
|
110
|
+
function _throw(n) {
|
|
111
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
112
|
+
}
|
|
113
|
+
_next(void 0);
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function _extends() {
|
|
118
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
119
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
120
|
+
var t = arguments[e];
|
|
121
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
122
|
+
}
|
|
123
|
+
return n;
|
|
124
|
+
}, _extends.apply(null, arguments);
|
|
125
|
+
}
|
|
126
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
127
|
+
if (null == r) return {};
|
|
128
|
+
var t = {};
|
|
129
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
130
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
131
|
+
t[n] = r[n];
|
|
132
|
+
}
|
|
133
|
+
return t;
|
|
134
|
+
}
|
|
92
135
|
function _regeneratorRuntime() {
|
|
93
136
|
_regeneratorRuntime = function () {
|
|
94
137
|
return e;
|
|
@@ -197,7 +240,7 @@ function _regeneratorRuntime() {
|
|
|
197
240
|
function makeInvokeMethod(e, r, n) {
|
|
198
241
|
var o = h;
|
|
199
242
|
return function (i, a) {
|
|
200
|
-
if (o === f) throw
|
|
243
|
+
if (o === f) throw Error("Generator is already running");
|
|
201
244
|
if (o === s) {
|
|
202
245
|
if ("throw" === i) throw a;
|
|
203
246
|
return {
|
|
@@ -339,7 +382,7 @@ function _regeneratorRuntime() {
|
|
|
339
382
|
} else if (c) {
|
|
340
383
|
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
341
384
|
} else {
|
|
342
|
-
if (!u) throw
|
|
385
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
343
386
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
344
387
|
}
|
|
345
388
|
}
|
|
@@ -379,7 +422,7 @@ function _regeneratorRuntime() {
|
|
|
379
422
|
return o;
|
|
380
423
|
}
|
|
381
424
|
}
|
|
382
|
-
throw
|
|
425
|
+
throw Error("illegal catch attempt");
|
|
383
426
|
},
|
|
384
427
|
delegateYield: function (e, r, n) {
|
|
385
428
|
return this.delegate = {
|
|
@@ -390,62 +433,6 @@ function _regeneratorRuntime() {
|
|
|
390
433
|
}
|
|
391
434
|
}, e;
|
|
392
435
|
}
|
|
393
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
394
|
-
try {
|
|
395
|
-
var info = gen[key](arg);
|
|
396
|
-
var value = info.value;
|
|
397
|
-
} catch (error) {
|
|
398
|
-
reject(error);
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
if (info.done) {
|
|
402
|
-
resolve(value);
|
|
403
|
-
} else {
|
|
404
|
-
Promise.resolve(value).then(_next, _throw);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
function _asyncToGenerator(fn) {
|
|
408
|
-
return function () {
|
|
409
|
-
var self = this,
|
|
410
|
-
args = arguments;
|
|
411
|
-
return new Promise(function (resolve, reject) {
|
|
412
|
-
var gen = fn.apply(self, args);
|
|
413
|
-
function _next(value) {
|
|
414
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
415
|
-
}
|
|
416
|
-
function _throw(err) {
|
|
417
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
418
|
-
}
|
|
419
|
-
_next(undefined);
|
|
420
|
-
});
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
function _extends() {
|
|
424
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
425
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
426
|
-
var source = arguments[i];
|
|
427
|
-
for (var key in source) {
|
|
428
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
429
|
-
target[key] = source[key];
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
return target;
|
|
434
|
-
};
|
|
435
|
-
return _extends.apply(this, arguments);
|
|
436
|
-
}
|
|
437
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
438
|
-
if (source == null) return {};
|
|
439
|
-
var target = {};
|
|
440
|
-
var sourceKeys = Object.keys(source);
|
|
441
|
-
var key, i;
|
|
442
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
443
|
-
key = sourceKeys[i];
|
|
444
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
445
|
-
target[key] = source[key];
|
|
446
|
-
}
|
|
447
|
-
return target;
|
|
448
|
-
}
|
|
449
436
|
|
|
450
437
|
var _excluded = ["tag", "className", "children", "propSelectors"],
|
|
451
438
|
_excluded2 = ["selector", "propSelectors"],
|
|
@@ -729,8 +716,9 @@ function Embed(_ref) {
|
|
|
729
716
|
return;
|
|
730
717
|
}
|
|
731
718
|
// Load scripts sequentially one at a time, since later scripts can depend on earlier ones.
|
|
719
|
+
var cleanup = false;
|
|
732
720
|
_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
733
|
-
var _loop, _i, _Array$from;
|
|
721
|
+
var _loop, _ret, _i, _Array$from;
|
|
734
722
|
return _regeneratorRuntime().wrap(function _callee$(_context2) {
|
|
735
723
|
while (1) switch (_context2.prev = _context2.next) {
|
|
736
724
|
case 0:
|
|
@@ -750,7 +738,7 @@ function Embed(_ref) {
|
|
|
750
738
|
ensure(oldScript.parentNode).replaceChild(newScript, oldScript);
|
|
751
739
|
// Only scripts with src will ever fire a load event.
|
|
752
740
|
if (!newScript.src) {
|
|
753
|
-
_context.next =
|
|
741
|
+
_context.next = 11;
|
|
754
742
|
break;
|
|
755
743
|
}
|
|
756
744
|
_context.next = 9;
|
|
@@ -758,6 +746,14 @@ function Embed(_ref) {
|
|
|
758
746
|
return newScript.addEventListener("load", resolve);
|
|
759
747
|
});
|
|
760
748
|
case 9:
|
|
749
|
+
if (!cleanup) {
|
|
750
|
+
_context.next = 11;
|
|
751
|
+
break;
|
|
752
|
+
}
|
|
753
|
+
return _context.abrupt("return", {
|
|
754
|
+
v: void 0
|
|
755
|
+
});
|
|
756
|
+
case 11:
|
|
761
757
|
case "end":
|
|
762
758
|
return _context.stop();
|
|
763
759
|
}
|
|
@@ -766,21 +762,32 @@ function Embed(_ref) {
|
|
|
766
762
|
_i = 0, _Array$from = Array.from(ensure(rootElt.current).querySelectorAll("script"));
|
|
767
763
|
case 2:
|
|
768
764
|
if (!(_i < _Array$from.length)) {
|
|
769
|
-
_context2.next =
|
|
765
|
+
_context2.next = 10;
|
|
770
766
|
break;
|
|
771
767
|
}
|
|
772
768
|
return _context2.delegateYield(_loop(), "t0", 4);
|
|
773
769
|
case 4:
|
|
770
|
+
_ret = _context2.t0;
|
|
771
|
+
if (!_ret) {
|
|
772
|
+
_context2.next = 7;
|
|
773
|
+
break;
|
|
774
|
+
}
|
|
775
|
+
return _context2.abrupt("return", _ret.v);
|
|
776
|
+
case 7:
|
|
774
777
|
_i++;
|
|
775
778
|
_context2.next = 2;
|
|
776
779
|
break;
|
|
777
|
-
case
|
|
780
|
+
case 10:
|
|
781
|
+
return _context2.abrupt("return", function () {
|
|
782
|
+
cleanup = true;
|
|
783
|
+
});
|
|
784
|
+
case 11:
|
|
778
785
|
case "end":
|
|
779
786
|
return _context2.stop();
|
|
780
787
|
}
|
|
781
788
|
}, _callee);
|
|
782
789
|
}))();
|
|
783
|
-
}, [htmlId,
|
|
790
|
+
}, [htmlId, code, hideInEditor, inEditor]);
|
|
784
791
|
var effectiveCode = hideInEditor && inEditor ? "" : inEditor || !htmlId ? code : addIdentifierScript(htmlId, code);
|
|
785
792
|
return React__default.createElement("div", {
|
|
786
793
|
ref: rootElt,
|