@plasmicpkgs/react-scroll-parallax 0.0.2 → 0.0.3
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/ParallaxProvider.d.ts +6 -0
- package/dist/ParallaxWrapper.d.ts +7 -2
- package/dist/index.d.ts +3 -1
- package/dist/react-scroll-parallax.cjs.development.js +38 -7
- package/dist/react-scroll-parallax.cjs.development.js.map +1 -1
- package/dist/react-scroll-parallax.cjs.production.min.js +1 -1
- package/dist/react-scroll-parallax.cjs.production.min.js.map +1 -1
- package/dist/react-scroll-parallax.esm.js +34 -8
- package/dist/react-scroll-parallax.esm.js.map +1 -1
- package/package.json +3 -8
- package/ParallaxWrapper/dist/ParallaxWrapper.d.ts +0 -10
- package/ParallaxWrapper/dist/index.cjs.js +0 -61
- package/ParallaxWrapper/dist/index.cjs.js.map +0 -1
- package/ParallaxWrapper/dist/index.esm.js +0 -52
- package/ParallaxWrapper/dist/index.esm.js.map +0 -1
- package/ParallaxWrapper/package.json +0 -6
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import registerComponent, { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
+
import { ParallaxProviderProps } from "react-scroll-parallax";
|
|
3
|
+
export declare const parallaxProviderMeta: ComponentMeta<ParallaxProviderProps>;
|
|
4
|
+
export declare function registerParallaxProvider(loader?: {
|
|
5
|
+
registerComponent: typeof registerComponent;
|
|
6
|
+
}, customParallaxProviderMeta?: ComponentMeta<ParallaxProviderProps>): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import registerComponent, { ComponentMeta } from "@plasmicapp/host/registerComponent";
|
|
2
|
+
import React from "react";
|
|
2
3
|
export interface ParallaxWrapperProps {
|
|
3
4
|
xStart?: string;
|
|
4
5
|
xEnd?: string;
|
|
@@ -6,5 +7,9 @@ export interface ParallaxWrapperProps {
|
|
|
6
7
|
yEnd?: string;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
previewInEditor?: boolean;
|
|
10
|
+
children: React.ReactNode;
|
|
9
11
|
}
|
|
10
|
-
export default function ParallaxWrapper({ xStart, xEnd, yStart, yEnd, disabled, previewInEditor, }: ParallaxWrapperProps): JSX.Element;
|
|
12
|
+
export default function ParallaxWrapper({ xStart, xEnd, yStart, yEnd, disabled, previewInEditor, children, }: ParallaxWrapperProps): JSX.Element;
|
|
13
|
+
export declare function registerParallaxWrapper(loader?: {
|
|
14
|
+
registerComponent: typeof registerComponent;
|
|
15
|
+
}, customParallaxWrapperMeta?: ComponentMeta<ParallaxWrapperProps>): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
4
6
|
|
|
5
|
-
var registerComponent = _interopDefault(require('@plasmicapp/host/registerComponent'));
|
|
6
7
|
var host = require('@plasmicapp/host');
|
|
8
|
+
var registerComponent = _interopDefault(require('@plasmicapp/host/registerComponent'));
|
|
7
9
|
var React = require('react');
|
|
8
10
|
var React__default = _interopDefault(React);
|
|
9
11
|
var reactScrollParallax = require('react-scroll-parallax');
|
|
@@ -18,17 +20,18 @@ function ParallaxWrapper(_ref) {
|
|
|
18
20
|
_ref$yEnd = _ref.yEnd,
|
|
19
21
|
yEnd = _ref$yEnd === void 0 ? "0" : _ref$yEnd,
|
|
20
22
|
disabled = _ref.disabled,
|
|
21
|
-
previewInEditor = _ref.previewInEditor
|
|
23
|
+
previewInEditor = _ref.previewInEditor,
|
|
24
|
+
children = _ref.children;
|
|
22
25
|
var inEditor = React.useContext(host.PlasmicCanvasContext);
|
|
23
26
|
return React__default.createElement(reactScrollParallax.Parallax, {
|
|
24
27
|
disabled: disabled || inEditor && !previewInEditor,
|
|
25
28
|
x: [xStart, xEnd],
|
|
26
29
|
y: [yStart, yEnd]
|
|
27
|
-
});
|
|
30
|
+
}, children);
|
|
28
31
|
}
|
|
29
|
-
|
|
32
|
+
var parallaxWrapperMeta = {
|
|
30
33
|
name: "Parallax",
|
|
31
|
-
importPath: "@plasmicpkgs/react-scroll-parallax
|
|
34
|
+
importPath: "@plasmicpkgs/react-scroll-parallax",
|
|
32
35
|
props: {
|
|
33
36
|
children: "slot",
|
|
34
37
|
yStart: {
|
|
@@ -60,9 +63,37 @@ registerComponent(ParallaxWrapper, {
|
|
|
60
63
|
description: "Enable the parallax effect in the editor."
|
|
61
64
|
}
|
|
62
65
|
},
|
|
63
|
-
isDefaultExport: true,
|
|
64
66
|
defaultStyles: {
|
|
65
67
|
maxWidth: "100%"
|
|
66
68
|
}
|
|
67
|
-
}
|
|
69
|
+
};
|
|
70
|
+
function registerParallaxWrapper(loader, customParallaxWrapperMeta) {
|
|
71
|
+
if (loader) {
|
|
72
|
+
loader.registerComponent(ParallaxWrapper, customParallaxWrapperMeta != null ? customParallaxWrapperMeta : parallaxWrapperMeta);
|
|
73
|
+
} else {
|
|
74
|
+
registerComponent(ParallaxWrapper, customParallaxWrapperMeta != null ? customParallaxWrapperMeta : parallaxWrapperMeta);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
var parallaxProviderMeta = {
|
|
79
|
+
name: "hostless-parallax-provider",
|
|
80
|
+
displayName: "Parallax Provider",
|
|
81
|
+
importName: "ParallaxProvider",
|
|
82
|
+
importPath: "react-scroll-parallax",
|
|
83
|
+
props: {
|
|
84
|
+
children: "slot"
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
function registerParallaxProvider(loader, customParallaxProviderMeta) {
|
|
88
|
+
if (loader) {
|
|
89
|
+
loader.registerComponent(reactScrollParallax.ParallaxProvider, customParallaxProviderMeta != null ? customParallaxProviderMeta : parallaxProviderMeta);
|
|
90
|
+
} else {
|
|
91
|
+
registerComponent(reactScrollParallax.ParallaxProvider, customParallaxProviderMeta != null ? customParallaxProviderMeta : parallaxProviderMeta);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
exports.ParallaxWrapper = ParallaxWrapper;
|
|
96
|
+
exports.parallaxProviderMeta = parallaxProviderMeta;
|
|
97
|
+
exports.registerParallaxProvider = registerParallaxProvider;
|
|
98
|
+
exports.registerParallaxWrapper = registerParallaxWrapper;
|
|
68
99
|
//# sourceMappingURL=react-scroll-parallax.cjs.development.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-scroll-parallax.cjs.development.js","sources":["../src/ParallaxWrapper.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"react-scroll-parallax.cjs.development.js","sources":["../src/ParallaxWrapper.tsx","../src/ParallaxProvider.tsx"],"sourcesContent":["import { PlasmicCanvasContext } from \"@plasmicapp/host\";\nimport registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React, { useContext } from \"react\";\nimport { Parallax } from \"react-scroll-parallax\";\n\nexport interface ParallaxWrapperProps {\n xStart?: string;\n xEnd?: string;\n yStart?: string;\n yEnd?: string;\n disabled?: boolean;\n previewInEditor?: boolean;\n children: React.ReactNode;\n}\n\nexport default function ParallaxWrapper({\n xStart = \"0\",\n xEnd = \"0\",\n yStart = \"0\",\n yEnd = \"0\",\n disabled,\n previewInEditor,\n children,\n}: ParallaxWrapperProps) {\n const inEditor = useContext(PlasmicCanvasContext);\n return (\n <Parallax\n disabled={disabled || (inEditor && !previewInEditor)}\n x={[xStart, xEnd]}\n y={[yStart, yEnd]}\n >\n {children}\n </Parallax>\n );\n}\n\nconst parallaxWrapperMeta: ComponentMeta<ParallaxWrapperProps> = {\n name: \"Parallax\",\n importPath: \"@plasmicpkgs/react-scroll-parallax\",\n props: {\n children: \"slot\",\n yStart: {\n type: \"string\",\n defaultValue: \"-50%\",\n description:\n \"The vertical offset at the start (when just scrolling into view). Can be % or px.\",\n },\n yEnd: {\n type: \"string\",\n defaultValue: \"50%\",\n description:\n \"The vertical offset at the end (when just scrolling out of view). Can be % or px.\",\n },\n xStart: {\n type: \"string\",\n defaultValue: \"50%\",\n description:\n \"The horizontal offset at the start (when just scrolling into view). Can be % or px.\",\n },\n xEnd: {\n type: \"string\",\n defaultValue: \"-50%\",\n description:\n \"The horizontal offset at the end (when just scrolling out of view). Can be % or px.\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Disables the parallax effect.\",\n },\n previewInEditor: {\n type: \"boolean\",\n description: \"Enable the parallax effect in the editor.\",\n },\n },\n defaultStyles: {\n maxWidth: \"100%\",\n },\n};\n\nexport function registerParallaxWrapper(\n loader?: { registerComponent: typeof registerComponent },\n customParallaxWrapperMeta?: ComponentMeta<ParallaxWrapperProps>\n) {\n if (loader) {\n loader.registerComponent(\n ParallaxWrapper,\n customParallaxWrapperMeta ?? parallaxWrapperMeta\n );\n } else {\n registerComponent(\n ParallaxWrapper,\n customParallaxWrapperMeta ?? parallaxWrapperMeta\n );\n }\n}\n","import registerComponent, { ComponentMeta } from \"@plasmicapp/host/registerComponent\";\nimport { ParallaxProvider, ParallaxProviderProps } from \"react-scroll-parallax\";\n\nexport const parallaxProviderMeta: ComponentMeta<ParallaxProviderProps> = {\n name: \"hostless-parallax-provider\",\n displayName: \"Parallax Provider\",\n importName: \"ParallaxProvider\",\n importPath: \"react-scroll-parallax\",\n props: {children: \"slot\"}\n}\n\nexport function registerParallaxProvider(\n loader?: { registerComponent: typeof registerComponent },\n customParallaxProviderMeta?: ComponentMeta<ParallaxProviderProps>\n) {\n if (loader) {\n loader.registerComponent(ParallaxProvider, customParallaxProviderMeta ?? parallaxProviderMeta);\n } else {\n registerComponent(ParallaxProvider, customParallaxProviderMeta ?? parallaxProviderMeta);\n }\n}\n"],"names":["ParallaxWrapper","xStart","xEnd","yStart","yEnd","disabled","previewInEditor","children","inEditor","useContext","PlasmicCanvasContext","React","Parallax","x","y","parallaxWrapperMeta","name","importPath","props","type","defaultValue","description","defaultStyles","maxWidth","registerParallaxWrapper","loader","customParallaxWrapperMeta","registerComponent","parallaxProviderMeta","displayName","importName","registerParallaxProvider","customParallaxProviderMeta","ParallaxProvider"],"mappings":";;;;;;;;;;;;SAiBwBA;yBACtBC;MAAAA,kCAAS;uBACTC;MAAAA,8BAAO;yBACPC;MAAAA,kCAAS;uBACTC;MAAAA,8BAAO;MACPC,gBAAAA;MACAC,uBAAAA;MACAC,gBAAAA;AAEA,MAAMC,QAAQ,GAAGC,gBAAU,CAACC,yBAAD,CAA3B;AACA,SACEC,4BAAA,CAACC,4BAAD;AACEP,IAAAA,QAAQ,EAAEA,QAAQ,IAAKG,QAAQ,IAAI,CAACF;AACpCO,IAAAA,CAAC,EAAE,CAACZ,MAAD,EAASC,IAAT;AACHY,IAAAA,CAAC,EAAE,CAACX,MAAD,EAASC,IAAT;GAHL,EAKGG,QALH,CADF;AASD;AAED,IAAMQ,mBAAmB,GAAwC;AAC/DC,EAAAA,IAAI,EAAE,UADyD;AAE/DC,EAAAA,UAAU,EAAE,oCAFmD;AAG/DC,EAAAA,KAAK,EAAE;AACLX,IAAAA,QAAQ,EAAE,MADL;AAELJ,IAAAA,MAAM,EAAE;AACNgB,MAAAA,IAAI,EAAE,QADA;AAENC,MAAAA,YAAY,EAAE,MAFR;AAGNC,MAAAA,WAAW,EACT;AAJI,KAFH;AAQLjB,IAAAA,IAAI,EAAE;AACJe,MAAAA,IAAI,EAAE,QADF;AAEJC,MAAAA,YAAY,EAAE,KAFV;AAGJC,MAAAA,WAAW,EACT;AAJE,KARD;AAcLpB,IAAAA,MAAM,EAAE;AACNkB,MAAAA,IAAI,EAAE,QADA;AAENC,MAAAA,YAAY,EAAE,KAFR;AAGNC,MAAAA,WAAW,EACT;AAJI,KAdH;AAoBLnB,IAAAA,IAAI,EAAE;AACJiB,MAAAA,IAAI,EAAE,QADF;AAEJC,MAAAA,YAAY,EAAE,MAFV;AAGJC,MAAAA,WAAW,EACT;AAJE,KApBD;AA0BLhB,IAAAA,QAAQ,EAAE;AACRc,MAAAA,IAAI,EAAE,SADE;AAERE,MAAAA,WAAW,EAAE;AAFL,KA1BL;AA8BLf,IAAAA,eAAe,EAAE;AACfa,MAAAA,IAAI,EAAE,SADS;AAEfE,MAAAA,WAAW,EAAE;AAFE;AA9BZ,GAHwD;AAsC/DC,EAAAA,aAAa,EAAE;AACbC,IAAAA,QAAQ,EAAE;AADG;AAtCgD,CAAjE;SA2CgBC,wBACdC,QACAC;AAEA,MAAID,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CACE3B,eADF,EAEE0B,yBAFF,WAEEA,yBAFF,GAE+BX,mBAF/B;AAID,GALD,MAKO;AACLY,IAAAA,iBAAiB,CACf3B,eADe,EAEf0B,yBAFe,WAEfA,yBAFe,GAEcX,mBAFd,CAAjB;AAID;AACF;;IC7FYa,oBAAoB,GAAyC;AACxEZ,EAAAA,IAAI,EAAE,4BADkE;AAExEa,EAAAA,WAAW,EAAE,mBAF2D;AAGxEC,EAAAA,UAAU,EAAE,kBAH4D;AAIxEb,EAAAA,UAAU,EAAE,uBAJ4D;AAKxEC,EAAAA,KAAK,EAAE;AAACX,IAAAA,QAAQ,EAAE;AAAX;AALiE,CAAnE;AAQP,SAAgBwB,yBACdN,QACAO;AAEA,MAAIP,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyBM,oCAAzB,EAA2CD,0BAA3C,WAA2CA,0BAA3C,GAAyEJ,oBAAzE;AACD,GAFD,MAEO;AACLD,IAAAA,iBAAiB,CAACM,oCAAD,EAAmBD,0BAAnB,WAAmBA,0BAAnB,GAAiDJ,oBAAjD,CAAjB;AACD;AACF;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@plasmicapp/host"),t=e(require("@plasmicapp/host/registerComponent")),a=require("react"),l=e(a),o=require("react-scroll-parallax");function i(e){var t=e.xStart,i=void 0===t?"0":t,n=e.xEnd,s=void 0===n?"0":n,p=e.yStart,d=void 0===p?"0":p,c=e.yEnd,u=void 0===c?"0":c,x=e.disabled,f=e.previewInEditor,h=e.children,v=a.useContext(r.PlasmicCanvasContext);return l.createElement(o.Parallax,{disabled:x||v&&!f,x:[i,s],y:[d,u]},h)}var n={name:"Parallax",importPath:"@plasmicpkgs/react-scroll-parallax",props:{children:"slot",yStart:{type:"string",defaultValue:"-50%",description:"The vertical offset at the start (when just scrolling into view). Can be % or px."},yEnd:{type:"string",defaultValue:"50%",description:"The vertical offset at the end (when just scrolling out of view). Can be % or px."},xStart:{type:"string",defaultValue:"50%",description:"The horizontal offset at the start (when just scrolling into view). Can be % or px."},xEnd:{type:"string",defaultValue:"-50%",description:"The horizontal offset at the end (when just scrolling out of view). Can be % or px."},disabled:{type:"boolean",description:"Disables the parallax effect."},previewInEditor:{type:"boolean",description:"Enable the parallax effect in the editor."}},defaultStyles:{maxWidth:"100%"}},s={name:"hostless-parallax-provider",displayName:"Parallax Provider",importName:"ParallaxProvider",importPath:"react-scroll-parallax",props:{children:"slot"}};exports.ParallaxWrapper=i,exports.parallaxProviderMeta=s,exports.registerParallaxProvider=function(e,r){e?e.registerComponent(o.ParallaxProvider,null!=r?r:s):t(o.ParallaxProvider,null!=r?r:s)},exports.registerParallaxWrapper=function(e,r){e?e.registerComponent(i,null!=r?r:n):t(i,null!=r?r:n)};
|
|
2
2
|
//# sourceMappingURL=react-scroll-parallax.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-scroll-parallax.cjs.production.min.js","sources":["../src/ParallaxWrapper.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"react-scroll-parallax.cjs.production.min.js","sources":["../src/ParallaxWrapper.tsx","../src/ParallaxProvider.tsx"],"sourcesContent":["import { PlasmicCanvasContext } from \"@plasmicapp/host\";\nimport registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React, { useContext } from \"react\";\nimport { Parallax } from \"react-scroll-parallax\";\n\nexport interface ParallaxWrapperProps {\n xStart?: string;\n xEnd?: string;\n yStart?: string;\n yEnd?: string;\n disabled?: boolean;\n previewInEditor?: boolean;\n children: React.ReactNode;\n}\n\nexport default function ParallaxWrapper({\n xStart = \"0\",\n xEnd = \"0\",\n yStart = \"0\",\n yEnd = \"0\",\n disabled,\n previewInEditor,\n children,\n}: ParallaxWrapperProps) {\n const inEditor = useContext(PlasmicCanvasContext);\n return (\n <Parallax\n disabled={disabled || (inEditor && !previewInEditor)}\n x={[xStart, xEnd]}\n y={[yStart, yEnd]}\n >\n {children}\n </Parallax>\n );\n}\n\nconst parallaxWrapperMeta: ComponentMeta<ParallaxWrapperProps> = {\n name: \"Parallax\",\n importPath: \"@plasmicpkgs/react-scroll-parallax\",\n props: {\n children: \"slot\",\n yStart: {\n type: \"string\",\n defaultValue: \"-50%\",\n description:\n \"The vertical offset at the start (when just scrolling into view). Can be % or px.\",\n },\n yEnd: {\n type: \"string\",\n defaultValue: \"50%\",\n description:\n \"The vertical offset at the end (when just scrolling out of view). Can be % or px.\",\n },\n xStart: {\n type: \"string\",\n defaultValue: \"50%\",\n description:\n \"The horizontal offset at the start (when just scrolling into view). Can be % or px.\",\n },\n xEnd: {\n type: \"string\",\n defaultValue: \"-50%\",\n description:\n \"The horizontal offset at the end (when just scrolling out of view). Can be % or px.\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Disables the parallax effect.\",\n },\n previewInEditor: {\n type: \"boolean\",\n description: \"Enable the parallax effect in the editor.\",\n },\n },\n defaultStyles: {\n maxWidth: \"100%\",\n },\n};\n\nexport function registerParallaxWrapper(\n loader?: { registerComponent: typeof registerComponent },\n customParallaxWrapperMeta?: ComponentMeta<ParallaxWrapperProps>\n) {\n if (loader) {\n loader.registerComponent(\n ParallaxWrapper,\n customParallaxWrapperMeta ?? parallaxWrapperMeta\n );\n } else {\n registerComponent(\n ParallaxWrapper,\n customParallaxWrapperMeta ?? parallaxWrapperMeta\n );\n }\n}\n","import registerComponent, { ComponentMeta } from \"@plasmicapp/host/registerComponent\";\nimport { ParallaxProvider, ParallaxProviderProps } from \"react-scroll-parallax\";\n\nexport const parallaxProviderMeta: ComponentMeta<ParallaxProviderProps> = {\n name: \"hostless-parallax-provider\",\n displayName: \"Parallax Provider\",\n importName: \"ParallaxProvider\",\n importPath: \"react-scroll-parallax\",\n props: {children: \"slot\"}\n}\n\nexport function registerParallaxProvider(\n loader?: { registerComponent: typeof registerComponent },\n customParallaxProviderMeta?: ComponentMeta<ParallaxProviderProps>\n) {\n if (loader) {\n loader.registerComponent(ParallaxProvider, customParallaxProviderMeta ?? parallaxProviderMeta);\n } else {\n registerComponent(ParallaxProvider, customParallaxProviderMeta ?? parallaxProviderMeta);\n }\n}\n"],"names":["ParallaxWrapper","xStart","xEnd","yStart","yEnd","disabled","previewInEditor","children","inEditor","useContext","PlasmicCanvasContext","React","Parallax","x","y","parallaxWrapperMeta","name","importPath","props","type","defaultValue","description","defaultStyles","maxWidth","parallaxProviderMeta","displayName","importName","loader","customParallaxProviderMeta","registerComponent","ParallaxProvider","customParallaxWrapperMeta"],"mappings":"qSAiBwBA,aACtBC,OAAAA,aAAS,UACTC,KAAAA,aAAO,UACPC,OAAAA,aAAS,UACTC,KAAAA,aAAO,MACPC,IAAAA,SACAC,IAAAA,gBACAC,IAAAA,SAEMC,EAAWC,aAAWC,+BAE1BC,gBAACC,YACCP,SAAUA,GAAaG,IAAaF,EACpCO,EAAG,CAACZ,EAAQC,GACZY,EAAG,CAACX,EAAQC,IAEXG,GAKP,IAAMQ,EAA2D,CAC/DC,KAAM,WACNC,WAAY,qCACZC,MAAO,CACLX,SAAU,OACVJ,OAAQ,CACNgB,KAAM,SACNC,aAAc,OACdC,YACE,qFAEJjB,KAAM,CACJe,KAAM,SACNC,aAAc,MACdC,YACE,qFAEJpB,OAAQ,CACNkB,KAAM,SACNC,aAAc,MACdC,YACE,uFAEJnB,KAAM,CACJiB,KAAM,SACNC,aAAc,OACdC,YACE,uFAEJhB,SAAU,CACRc,KAAM,UACNE,YAAa,iCAEff,gBAAiB,CACfa,KAAM,UACNE,YAAa,8CAGjBC,cAAe,CACbC,SAAU,SC1EDC,EAA6D,CACxER,KAAM,6BACNS,YAAa,oBACbC,WAAY,mBACZT,WAAY,wBACZC,MAAO,CAACX,SAAU,4GAIlBoB,EACAC,GAEID,EACFA,EAAOE,kBAAkBC,yBAAkBF,EAAAA,EAA8BJ,GAEzEK,EAAkBC,yBAAkBF,EAAAA,EAA8BJ,6CDgEpEG,EACAI,GAEIJ,EACFA,EAAOE,kBACL7B,QACA+B,EAAAA,EAA6BhB,GAG/Bc,EACE7B,QACA+B,EAAAA,EAA6BhB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import registerComponent from '@plasmicapp/host/registerComponent';
|
|
2
1
|
import { PlasmicCanvasContext } from '@plasmicapp/host';
|
|
2
|
+
import registerComponent from '@plasmicapp/host/registerComponent';
|
|
3
3
|
import React, { useContext } from 'react';
|
|
4
|
-
import { Parallax } from 'react-scroll-parallax';
|
|
4
|
+
import { Parallax, ParallaxProvider } from 'react-scroll-parallax';
|
|
5
5
|
|
|
6
6
|
function ParallaxWrapper(_ref) {
|
|
7
7
|
var _ref$xStart = _ref.xStart,
|
|
@@ -13,17 +13,18 @@ function ParallaxWrapper(_ref) {
|
|
|
13
13
|
_ref$yEnd = _ref.yEnd,
|
|
14
14
|
yEnd = _ref$yEnd === void 0 ? "0" : _ref$yEnd,
|
|
15
15
|
disabled = _ref.disabled,
|
|
16
|
-
previewInEditor = _ref.previewInEditor
|
|
16
|
+
previewInEditor = _ref.previewInEditor,
|
|
17
|
+
children = _ref.children;
|
|
17
18
|
var inEditor = useContext(PlasmicCanvasContext);
|
|
18
19
|
return React.createElement(Parallax, {
|
|
19
20
|
disabled: disabled || inEditor && !previewInEditor,
|
|
20
21
|
x: [xStart, xEnd],
|
|
21
22
|
y: [yStart, yEnd]
|
|
22
|
-
});
|
|
23
|
+
}, children);
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
var parallaxWrapperMeta = {
|
|
25
26
|
name: "Parallax",
|
|
26
|
-
importPath: "@plasmicpkgs/react-scroll-parallax
|
|
27
|
+
importPath: "@plasmicpkgs/react-scroll-parallax",
|
|
27
28
|
props: {
|
|
28
29
|
children: "slot",
|
|
29
30
|
yStart: {
|
|
@@ -55,9 +56,34 @@ registerComponent(ParallaxWrapper, {
|
|
|
55
56
|
description: "Enable the parallax effect in the editor."
|
|
56
57
|
}
|
|
57
58
|
},
|
|
58
|
-
isDefaultExport: true,
|
|
59
59
|
defaultStyles: {
|
|
60
60
|
maxWidth: "100%"
|
|
61
61
|
}
|
|
62
|
-
}
|
|
62
|
+
};
|
|
63
|
+
function registerParallaxWrapper(loader, customParallaxWrapperMeta) {
|
|
64
|
+
if (loader) {
|
|
65
|
+
loader.registerComponent(ParallaxWrapper, customParallaxWrapperMeta != null ? customParallaxWrapperMeta : parallaxWrapperMeta);
|
|
66
|
+
} else {
|
|
67
|
+
registerComponent(ParallaxWrapper, customParallaxWrapperMeta != null ? customParallaxWrapperMeta : parallaxWrapperMeta);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
var parallaxProviderMeta = {
|
|
72
|
+
name: "hostless-parallax-provider",
|
|
73
|
+
displayName: "Parallax Provider",
|
|
74
|
+
importName: "ParallaxProvider",
|
|
75
|
+
importPath: "react-scroll-parallax",
|
|
76
|
+
props: {
|
|
77
|
+
children: "slot"
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
function registerParallaxProvider(loader, customParallaxProviderMeta) {
|
|
81
|
+
if (loader) {
|
|
82
|
+
loader.registerComponent(ParallaxProvider, customParallaxProviderMeta != null ? customParallaxProviderMeta : parallaxProviderMeta);
|
|
83
|
+
} else {
|
|
84
|
+
registerComponent(ParallaxProvider, customParallaxProviderMeta != null ? customParallaxProviderMeta : parallaxProviderMeta);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { ParallaxWrapper, parallaxProviderMeta, registerParallaxProvider, registerParallaxWrapper };
|
|
63
89
|
//# sourceMappingURL=react-scroll-parallax.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-scroll-parallax.esm.js","sources":["../src/ParallaxWrapper.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"react-scroll-parallax.esm.js","sources":["../src/ParallaxWrapper.tsx","../src/ParallaxProvider.tsx"],"sourcesContent":["import { PlasmicCanvasContext } from \"@plasmicapp/host\";\nimport registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React, { useContext } from \"react\";\nimport { Parallax } from \"react-scroll-parallax\";\n\nexport interface ParallaxWrapperProps {\n xStart?: string;\n xEnd?: string;\n yStart?: string;\n yEnd?: string;\n disabled?: boolean;\n previewInEditor?: boolean;\n children: React.ReactNode;\n}\n\nexport default function ParallaxWrapper({\n xStart = \"0\",\n xEnd = \"0\",\n yStart = \"0\",\n yEnd = \"0\",\n disabled,\n previewInEditor,\n children,\n}: ParallaxWrapperProps) {\n const inEditor = useContext(PlasmicCanvasContext);\n return (\n <Parallax\n disabled={disabled || (inEditor && !previewInEditor)}\n x={[xStart, xEnd]}\n y={[yStart, yEnd]}\n >\n {children}\n </Parallax>\n );\n}\n\nconst parallaxWrapperMeta: ComponentMeta<ParallaxWrapperProps> = {\n name: \"Parallax\",\n importPath: \"@plasmicpkgs/react-scroll-parallax\",\n props: {\n children: \"slot\",\n yStart: {\n type: \"string\",\n defaultValue: \"-50%\",\n description:\n \"The vertical offset at the start (when just scrolling into view). Can be % or px.\",\n },\n yEnd: {\n type: \"string\",\n defaultValue: \"50%\",\n description:\n \"The vertical offset at the end (when just scrolling out of view). Can be % or px.\",\n },\n xStart: {\n type: \"string\",\n defaultValue: \"50%\",\n description:\n \"The horizontal offset at the start (when just scrolling into view). Can be % or px.\",\n },\n xEnd: {\n type: \"string\",\n defaultValue: \"-50%\",\n description:\n \"The horizontal offset at the end (when just scrolling out of view). Can be % or px.\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Disables the parallax effect.\",\n },\n previewInEditor: {\n type: \"boolean\",\n description: \"Enable the parallax effect in the editor.\",\n },\n },\n defaultStyles: {\n maxWidth: \"100%\",\n },\n};\n\nexport function registerParallaxWrapper(\n loader?: { registerComponent: typeof registerComponent },\n customParallaxWrapperMeta?: ComponentMeta<ParallaxWrapperProps>\n) {\n if (loader) {\n loader.registerComponent(\n ParallaxWrapper,\n customParallaxWrapperMeta ?? parallaxWrapperMeta\n );\n } else {\n registerComponent(\n ParallaxWrapper,\n customParallaxWrapperMeta ?? parallaxWrapperMeta\n );\n }\n}\n","import registerComponent, { ComponentMeta } from \"@plasmicapp/host/registerComponent\";\nimport { ParallaxProvider, ParallaxProviderProps } from \"react-scroll-parallax\";\n\nexport const parallaxProviderMeta: ComponentMeta<ParallaxProviderProps> = {\n name: \"hostless-parallax-provider\",\n displayName: \"Parallax Provider\",\n importName: \"ParallaxProvider\",\n importPath: \"react-scroll-parallax\",\n props: {children: \"slot\"}\n}\n\nexport function registerParallaxProvider(\n loader?: { registerComponent: typeof registerComponent },\n customParallaxProviderMeta?: ComponentMeta<ParallaxProviderProps>\n) {\n if (loader) {\n loader.registerComponent(ParallaxProvider, customParallaxProviderMeta ?? parallaxProviderMeta);\n } else {\n registerComponent(ParallaxProvider, customParallaxProviderMeta ?? parallaxProviderMeta);\n }\n}\n"],"names":["ParallaxWrapper","xStart","xEnd","yStart","yEnd","disabled","previewInEditor","children","inEditor","useContext","PlasmicCanvasContext","React","Parallax","x","y","parallaxWrapperMeta","name","importPath","props","type","defaultValue","description","defaultStyles","maxWidth","registerParallaxWrapper","loader","customParallaxWrapperMeta","registerComponent","parallaxProviderMeta","displayName","importName","registerParallaxProvider","customParallaxProviderMeta","ParallaxProvider"],"mappings":";;;;;SAiBwBA;yBACtBC;MAAAA,kCAAS;uBACTC;MAAAA,8BAAO;yBACPC;MAAAA,kCAAS;uBACTC;MAAAA,8BAAO;MACPC,gBAAAA;MACAC,uBAAAA;MACAC,gBAAAA;AAEA,MAAMC,QAAQ,GAAGC,UAAU,CAACC,oBAAD,CAA3B;AACA,SACEC,mBAAA,CAACC,QAAD;AACEP,IAAAA,QAAQ,EAAEA,QAAQ,IAAKG,QAAQ,IAAI,CAACF;AACpCO,IAAAA,CAAC,EAAE,CAACZ,MAAD,EAASC,IAAT;AACHY,IAAAA,CAAC,EAAE,CAACX,MAAD,EAASC,IAAT;GAHL,EAKGG,QALH,CADF;AASD;AAED,IAAMQ,mBAAmB,GAAwC;AAC/DC,EAAAA,IAAI,EAAE,UADyD;AAE/DC,EAAAA,UAAU,EAAE,oCAFmD;AAG/DC,EAAAA,KAAK,EAAE;AACLX,IAAAA,QAAQ,EAAE,MADL;AAELJ,IAAAA,MAAM,EAAE;AACNgB,MAAAA,IAAI,EAAE,QADA;AAENC,MAAAA,YAAY,EAAE,MAFR;AAGNC,MAAAA,WAAW,EACT;AAJI,KAFH;AAQLjB,IAAAA,IAAI,EAAE;AACJe,MAAAA,IAAI,EAAE,QADF;AAEJC,MAAAA,YAAY,EAAE,KAFV;AAGJC,MAAAA,WAAW,EACT;AAJE,KARD;AAcLpB,IAAAA,MAAM,EAAE;AACNkB,MAAAA,IAAI,EAAE,QADA;AAENC,MAAAA,YAAY,EAAE,KAFR;AAGNC,MAAAA,WAAW,EACT;AAJI,KAdH;AAoBLnB,IAAAA,IAAI,EAAE;AACJiB,MAAAA,IAAI,EAAE,QADF;AAEJC,MAAAA,YAAY,EAAE,MAFV;AAGJC,MAAAA,WAAW,EACT;AAJE,KApBD;AA0BLhB,IAAAA,QAAQ,EAAE;AACRc,MAAAA,IAAI,EAAE,SADE;AAERE,MAAAA,WAAW,EAAE;AAFL,KA1BL;AA8BLf,IAAAA,eAAe,EAAE;AACfa,MAAAA,IAAI,EAAE,SADS;AAEfE,MAAAA,WAAW,EAAE;AAFE;AA9BZ,GAHwD;AAsC/DC,EAAAA,aAAa,EAAE;AACbC,IAAAA,QAAQ,EAAE;AADG;AAtCgD,CAAjE;SA2CgBC,wBACdC,QACAC;AAEA,MAAID,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CACE3B,eADF,EAEE0B,yBAFF,WAEEA,yBAFF,GAE+BX,mBAF/B;AAID,GALD,MAKO;AACLY,IAAAA,iBAAiB,CACf3B,eADe,EAEf0B,yBAFe,WAEfA,yBAFe,GAEcX,mBAFd,CAAjB;AAID;AACF;;IC7FYa,oBAAoB,GAAyC;AACxEZ,EAAAA,IAAI,EAAE,4BADkE;AAExEa,EAAAA,WAAW,EAAE,mBAF2D;AAGxEC,EAAAA,UAAU,EAAE,kBAH4D;AAIxEb,EAAAA,UAAU,EAAE,uBAJ4D;AAKxEC,EAAAA,KAAK,EAAE;AAACX,IAAAA,QAAQ,EAAE;AAAX;AALiE,CAAnE;AAQP,SAAgBwB,yBACdN,QACAO;AAEA,MAAIP,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyBM,gBAAzB,EAA2CD,0BAA3C,WAA2CA,0BAA3C,GAAyEJ,oBAAzE;AACD,GAFD,MAEO;AACLD,IAAAA,iBAAiB,CAACM,gBAAD,EAAmBD,0BAAnB,WAAmBA,0BAAnB,GAAiDJ,oBAAjD,CAAjB;AACD;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/react-scroll-parallax",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Plasmic registration call for the HTML5 video element",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"module": "dist/react-scroll-parallax.esm.js",
|
|
8
8
|
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
"ParallaxWrapper"
|
|
9
|
+
"dist"
|
|
11
10
|
],
|
|
12
11
|
"size-limit": [
|
|
13
12
|
{
|
|
@@ -20,7 +19,7 @@
|
|
|
20
19
|
}
|
|
21
20
|
],
|
|
22
21
|
"scripts": {
|
|
23
|
-
"build": "tsdx build
|
|
22
|
+
"build": "tsdx build",
|
|
24
23
|
"start": "tsdx watch",
|
|
25
24
|
"test": "tsdx test --passWithNoTests",
|
|
26
25
|
"lint": "tsdx lint",
|
|
@@ -29,12 +28,8 @@
|
|
|
29
28
|
"analyze": "size-limit --why"
|
|
30
29
|
},
|
|
31
30
|
"devDependencies": {
|
|
32
|
-
"@rollup/plugin-commonjs": "^19.0.0",
|
|
33
|
-
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
34
31
|
"@size-limit/preset-small-lib": "^4.11.0",
|
|
35
32
|
"@types/node": "^14.0.26",
|
|
36
|
-
"rollup": "^2.47.0",
|
|
37
|
-
"rollup-plugin-typescript2": "^0.30.0",
|
|
38
33
|
"size-limit": "^4.11.0",
|
|
39
34
|
"tsdx": "^0.14.1",
|
|
40
35
|
"tslib": "^2.2.0",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface ParallaxWrapperProps {
|
|
3
|
-
xStart?: string;
|
|
4
|
-
xEnd?: string;
|
|
5
|
-
yStart?: string;
|
|
6
|
-
yEnd?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
previewInEditor?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export default function ParallaxWrapper({ xStart, xEnd, yStart, yEnd, disabled, previewInEditor, }: ParallaxWrapperProps): JSX.Element;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var registerComponent = require('@plasmicapp/host/registerComponent');
|
|
6
|
-
var host = require('@plasmicapp/host');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var reactScrollParallax = require('react-scroll-parallax');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
-
|
|
12
|
-
var registerComponent__default = /*#__PURE__*/_interopDefaultLegacy(registerComponent);
|
|
13
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
-
|
|
15
|
-
function ParallaxWrapper(_a) {
|
|
16
|
-
var _b = _a.xStart, xStart = _b === void 0 ? "0" : _b, _c = _a.xEnd, xEnd = _c === void 0 ? "0" : _c, _d = _a.yStart, yStart = _d === void 0 ? "0" : _d, _e = _a.yEnd, yEnd = _e === void 0 ? "0" : _e, disabled = _a.disabled, previewInEditor = _a.previewInEditor;
|
|
17
|
-
var inEditor = React.useContext(host.PlasmicCanvasContext);
|
|
18
|
-
return (React__default["default"].createElement(reactScrollParallax.Parallax, { disabled: disabled || (inEditor && !previewInEditor), x: [xStart, xEnd], y: [yStart, yEnd] }));
|
|
19
|
-
}
|
|
20
|
-
registerComponent__default["default"](ParallaxWrapper, {
|
|
21
|
-
name: "Parallax",
|
|
22
|
-
importPath: "@plasmicpkgs/react-scroll-parallax/ParallaxWrapper",
|
|
23
|
-
props: {
|
|
24
|
-
children: "slot",
|
|
25
|
-
yStart: {
|
|
26
|
-
type: "string",
|
|
27
|
-
defaultValue: "-50%",
|
|
28
|
-
description: "The vertical offset at the start (when just scrolling into view). Can be % or px.",
|
|
29
|
-
},
|
|
30
|
-
yEnd: {
|
|
31
|
-
type: "string",
|
|
32
|
-
defaultValue: "50%",
|
|
33
|
-
description: "The vertical offset at the end (when just scrolling out of view). Can be % or px.",
|
|
34
|
-
},
|
|
35
|
-
xStart: {
|
|
36
|
-
type: "string",
|
|
37
|
-
defaultValue: "50%",
|
|
38
|
-
description: "The horizontal offset at the start (when just scrolling into view). Can be % or px.",
|
|
39
|
-
},
|
|
40
|
-
xEnd: {
|
|
41
|
-
type: "string",
|
|
42
|
-
defaultValue: "-50%",
|
|
43
|
-
description: "The horizontal offset at the end (when just scrolling out of view). Can be % or px.",
|
|
44
|
-
},
|
|
45
|
-
disabled: {
|
|
46
|
-
type: "boolean",
|
|
47
|
-
description: "Disables the parallax effect.",
|
|
48
|
-
},
|
|
49
|
-
previewInEditor: {
|
|
50
|
-
type: "boolean",
|
|
51
|
-
description: "Enable the parallax effect in the editor.",
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
isDefaultExport: true,
|
|
55
|
-
defaultStyles: {
|
|
56
|
-
maxWidth: "100%",
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
exports["default"] = ParallaxWrapper;
|
|
61
|
-
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../src/ParallaxWrapper.tsx"],"sourcesContent":["import registerComponent from \"@plasmicapp/host/registerComponent\";\nimport { PlasmicCanvasContext } from \"@plasmicapp/host\";\nimport React, { useContext } from \"react\";\nimport { Parallax } from \"react-scroll-parallax\";\n\nexport interface ParallaxWrapperProps {\n xStart?: string;\n xEnd?: string;\n yStart?: string;\n yEnd?: string;\n disabled?: boolean;\n previewInEditor?: boolean;\n}\n\nexport default function ParallaxWrapper({\n xStart = \"0\",\n xEnd = \"0\",\n yStart = \"0\",\n yEnd = \"0\",\n disabled,\n previewInEditor,\n}: ParallaxWrapperProps) {\n const inEditor = useContext(PlasmicCanvasContext);\n return (\n <Parallax\n disabled={disabled || (inEditor && !previewInEditor)}\n x={[xStart, xEnd]}\n y={[yStart, yEnd]}\n />\n );\n}\n\nregisterComponent(ParallaxWrapper, {\n name: \"Parallax\",\n importPath: \"@plasmicpkgs/react-scroll-parallax/ParallaxWrapper\",\n props: {\n children: \"slot\",\n yStart: {\n type: \"string\",\n defaultValue: \"-50%\",\n description:\n \"The vertical offset at the start (when just scrolling into view). Can be % or px.\",\n },\n yEnd: {\n type: \"string\",\n defaultValue: \"50%\",\n description:\n \"The vertical offset at the end (when just scrolling out of view). Can be % or px.\",\n },\n xStart: {\n type: \"string\",\n defaultValue: \"50%\",\n description:\n \"The horizontal offset at the start (when just scrolling into view). Can be % or px.\",\n },\n xEnd: {\n type: \"string\",\n defaultValue: \"-50%\",\n description:\n \"The horizontal offset at the end (when just scrolling out of view). Can be % or px.\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Disables the parallax effect.\",\n },\n previewInEditor: {\n type: \"boolean\",\n description: \"Enable the parallax effect in the editor.\",\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n maxWidth: \"100%\",\n },\n});\n"],"names":["useContext","PlasmicCanvasContext","React","Parallax","registerComponent"],"mappings":";;;;;;;;;;;;;;SAcwB,eAAe,CAAC,EAOjB;QANrB,cAAY,EAAZ,MAAM,mBAAG,GAAG,KAAA,EACZ,YAAU,EAAV,IAAI,mBAAG,GAAG,KAAA,EACV,cAAY,EAAZ,MAAM,mBAAG,GAAG,KAAA,EACZ,YAAU,EAAV,IAAI,mBAAG,GAAG,KAAA,EACV,QAAQ,cAAA,EACR,eAAe,qBAAA;IAEf,IAAM,QAAQ,GAAGA,gBAAU,CAACC,yBAAoB,CAAC,CAAC;IAClD,QACEC,wCAACC,4BAAQ,IACP,QAAQ,EAAE,QAAQ,KAAK,QAAQ,IAAI,CAAC,eAAe,CAAC,EACpD,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,EACjB,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,GACjB,EACF;AACJ,CAAC;AAEDC,qCAAiB,CAAC,eAAe,EAAE;IACjC,IAAI,EAAE,UAAU;IAChB,UAAU,EAAE,oDAAoD;IAChE,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,MAAM;YACpB,WAAW,EACT,mFAAmF;SACtF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,KAAK;YACnB,WAAW,EACT,mFAAmF;SACtF;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,KAAK;YACnB,WAAW,EACT,qFAAqF;SACxF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,MAAM;YACpB,WAAW,EACT,qFAAqF;SACxF;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,+BAA+B;SAC7C;QACD,eAAe,EAAE;YACf,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,2CAA2C;SACzD;KACF;IACD,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE;QACb,QAAQ,EAAE,MAAM;KACjB;CACF,CAAC;;;;"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import registerComponent from '@plasmicapp/host/registerComponent';
|
|
2
|
-
import { PlasmicCanvasContext } from '@plasmicapp/host';
|
|
3
|
-
import React, { useContext } from 'react';
|
|
4
|
-
import { Parallax } from 'react-scroll-parallax';
|
|
5
|
-
|
|
6
|
-
function ParallaxWrapper(_a) {
|
|
7
|
-
var _b = _a.xStart, xStart = _b === void 0 ? "0" : _b, _c = _a.xEnd, xEnd = _c === void 0 ? "0" : _c, _d = _a.yStart, yStart = _d === void 0 ? "0" : _d, _e = _a.yEnd, yEnd = _e === void 0 ? "0" : _e, disabled = _a.disabled, previewInEditor = _a.previewInEditor;
|
|
8
|
-
var inEditor = useContext(PlasmicCanvasContext);
|
|
9
|
-
return (React.createElement(Parallax, { disabled: disabled || (inEditor && !previewInEditor), x: [xStart, xEnd], y: [yStart, yEnd] }));
|
|
10
|
-
}
|
|
11
|
-
registerComponent(ParallaxWrapper, {
|
|
12
|
-
name: "Parallax",
|
|
13
|
-
importPath: "@plasmicpkgs/react-scroll-parallax/ParallaxWrapper",
|
|
14
|
-
props: {
|
|
15
|
-
children: "slot",
|
|
16
|
-
yStart: {
|
|
17
|
-
type: "string",
|
|
18
|
-
defaultValue: "-50%",
|
|
19
|
-
description: "The vertical offset at the start (when just scrolling into view). Can be % or px.",
|
|
20
|
-
},
|
|
21
|
-
yEnd: {
|
|
22
|
-
type: "string",
|
|
23
|
-
defaultValue: "50%",
|
|
24
|
-
description: "The vertical offset at the end (when just scrolling out of view). Can be % or px.",
|
|
25
|
-
},
|
|
26
|
-
xStart: {
|
|
27
|
-
type: "string",
|
|
28
|
-
defaultValue: "50%",
|
|
29
|
-
description: "The horizontal offset at the start (when just scrolling into view). Can be % or px.",
|
|
30
|
-
},
|
|
31
|
-
xEnd: {
|
|
32
|
-
type: "string",
|
|
33
|
-
defaultValue: "-50%",
|
|
34
|
-
description: "The horizontal offset at the end (when just scrolling out of view). Can be % or px.",
|
|
35
|
-
},
|
|
36
|
-
disabled: {
|
|
37
|
-
type: "boolean",
|
|
38
|
-
description: "Disables the parallax effect.",
|
|
39
|
-
},
|
|
40
|
-
previewInEditor: {
|
|
41
|
-
type: "boolean",
|
|
42
|
-
description: "Enable the parallax effect in the editor.",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
isDefaultExport: true,
|
|
46
|
-
defaultStyles: {
|
|
47
|
-
maxWidth: "100%",
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export { ParallaxWrapper as default };
|
|
52
|
-
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../src/ParallaxWrapper.tsx"],"sourcesContent":["import registerComponent from \"@plasmicapp/host/registerComponent\";\nimport { PlasmicCanvasContext } from \"@plasmicapp/host\";\nimport React, { useContext } from \"react\";\nimport { Parallax } from \"react-scroll-parallax\";\n\nexport interface ParallaxWrapperProps {\n xStart?: string;\n xEnd?: string;\n yStart?: string;\n yEnd?: string;\n disabled?: boolean;\n previewInEditor?: boolean;\n}\n\nexport default function ParallaxWrapper({\n xStart = \"0\",\n xEnd = \"0\",\n yStart = \"0\",\n yEnd = \"0\",\n disabled,\n previewInEditor,\n}: ParallaxWrapperProps) {\n const inEditor = useContext(PlasmicCanvasContext);\n return (\n <Parallax\n disabled={disabled || (inEditor && !previewInEditor)}\n x={[xStart, xEnd]}\n y={[yStart, yEnd]}\n />\n );\n}\n\nregisterComponent(ParallaxWrapper, {\n name: \"Parallax\",\n importPath: \"@plasmicpkgs/react-scroll-parallax/ParallaxWrapper\",\n props: {\n children: \"slot\",\n yStart: {\n type: \"string\",\n defaultValue: \"-50%\",\n description:\n \"The vertical offset at the start (when just scrolling into view). Can be % or px.\",\n },\n yEnd: {\n type: \"string\",\n defaultValue: \"50%\",\n description:\n \"The vertical offset at the end (when just scrolling out of view). Can be % or px.\",\n },\n xStart: {\n type: \"string\",\n defaultValue: \"50%\",\n description:\n \"The horizontal offset at the start (when just scrolling into view). Can be % or px.\",\n },\n xEnd: {\n type: \"string\",\n defaultValue: \"-50%\",\n description:\n \"The horizontal offset at the end (when just scrolling out of view). Can be % or px.\",\n },\n disabled: {\n type: \"boolean\",\n description: \"Disables the parallax effect.\",\n },\n previewInEditor: {\n type: \"boolean\",\n description: \"Enable the parallax effect in the editor.\",\n },\n },\n isDefaultExport: true,\n defaultStyles: {\n maxWidth: \"100%\",\n },\n});\n"],"names":[],"mappings":";;;;;SAcwB,eAAe,CAAC,EAOjB;QANrB,cAAY,EAAZ,MAAM,mBAAG,GAAG,KAAA,EACZ,YAAU,EAAV,IAAI,mBAAG,GAAG,KAAA,EACV,cAAY,EAAZ,MAAM,mBAAG,GAAG,KAAA,EACZ,YAAU,EAAV,IAAI,mBAAG,GAAG,KAAA,EACV,QAAQ,cAAA,EACR,eAAe,qBAAA;IAEf,IAAM,QAAQ,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAClD,QACE,oBAAC,QAAQ,IACP,QAAQ,EAAE,QAAQ,KAAK,QAAQ,IAAI,CAAC,eAAe,CAAC,EACpD,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,EACjB,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,GACjB,EACF;AACJ,CAAC;AAED,iBAAiB,CAAC,eAAe,EAAE;IACjC,IAAI,EAAE,UAAU;IAChB,UAAU,EAAE,oDAAoD;IAChE,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,MAAM;YACpB,WAAW,EACT,mFAAmF;SACtF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,KAAK;YACnB,WAAW,EACT,mFAAmF;SACtF;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,KAAK;YACnB,WAAW,EACT,qFAAqF;SACxF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,MAAM;YACpB,WAAW,EACT,qFAAqF;SACxF;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,+BAA+B;SAC7C;QACD,eAAe,EAAE;YACf,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,2CAA2C;SACzD;KACF;IACD,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE;QACb,QAAQ,EAAE,MAAM;KACjB;CACF,CAAC;;;;"}
|