@plasmicpkgs/react-scroll-parallax 0.0.5 → 0.0.6
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/react-scroll-parallax.cjs.development.js +8 -2
- 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 +8 -2
- package/dist/react-scroll-parallax.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -38,7 +38,7 @@ function ParallaxWrapper(_ref) {
|
|
|
38
38
|
}, children);
|
|
39
39
|
}
|
|
40
40
|
var parallaxWrapperMeta = {
|
|
41
|
-
name: "
|
|
41
|
+
name: "hostless-scroll-parallax",
|
|
42
42
|
displayName: "Scroll Parallax",
|
|
43
43
|
importPath: "@plasmicpkgs/react-scroll-parallax",
|
|
44
44
|
props: {
|
|
@@ -99,7 +99,13 @@ var parallaxProviderMeta = {
|
|
|
99
99
|
importName: "ParallaxProvider",
|
|
100
100
|
importPath: "react-scroll-parallax",
|
|
101
101
|
props: {
|
|
102
|
-
children: "slot"
|
|
102
|
+
children: "slot",
|
|
103
|
+
scrollAxis: {
|
|
104
|
+
type: "choice",
|
|
105
|
+
description: "Scroll axis for setting horizontal/vertical scrolling",
|
|
106
|
+
options: ["vertical", "horizontal"],
|
|
107
|
+
displayName: "Scroll Axis"
|
|
108
|
+
}
|
|
103
109
|
}
|
|
104
110
|
};
|
|
105
111
|
function registerParallaxProvider(loader, customParallaxProviderMeta) {
|
|
@@ -1 +1 @@
|
|
|
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, ParallaxContext } 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 className?: string;\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 className,\n}: ParallaxWrapperProps) {\n const inEditor = useContext(PlasmicCanvasContext);\n const hasContext = useContext(ParallaxContext) != null;\n if (!hasContext) {\n throw new Error(\n \"Scroll Parallax can only be instantiated somewhere inside the Parallax Provider\"\n );\n }\n return (\n <Parallax\n disabled={disabled || (inEditor && !previewInEditor)}\n x={[xStart, xEnd]}\n y={[yStart, yEnd]}\n className={className}\n >\n {children}\n </Parallax>\n );\n}\n\nconst parallaxWrapperMeta: ComponentMeta<ParallaxWrapperProps> = {\n name: \"
|
|
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, ParallaxContext } 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 className?: string;\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 className,\n}: ParallaxWrapperProps) {\n const inEditor = useContext(PlasmicCanvasContext);\n const hasContext = useContext(ParallaxContext) != null;\n if (!hasContext) {\n throw new Error(\n \"Scroll Parallax can only be instantiated somewhere inside the Parallax Provider\"\n );\n }\n return (\n <Parallax\n disabled={disabled || (inEditor && !previewInEditor)}\n x={[xStart, xEnd]}\n y={[yStart, yEnd]}\n className={className}\n >\n {children}\n </Parallax>\n );\n}\n\nconst parallaxWrapperMeta: ComponentMeta<ParallaxWrapperProps> = {\n name: \"hostless-scroll-parallax\",\n displayName: \"Scroll Parallax\",\n importPath: \"@plasmicpkgs/react-scroll-parallax\",\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"img\",\n src: \"https://placekitten.com/300/200\",\n style: {\n maxWidth: \"100%\",\n },\n },\n },\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, {\n ComponentMeta,\n} 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: {\n children: \"slot\",\n scrollAxis: {\n type: \"choice\",\n description: \"Scroll axis for setting horizontal/vertical scrolling\",\n options: [\"vertical\", \"horizontal\"],\n displayName: \"Scroll Axis\",\n },\n },\n};\n\nexport function registerParallaxProvider(\n loader?: { registerComponent: typeof registerComponent },\n customParallaxProviderMeta?: ComponentMeta<ParallaxProviderProps>\n) {\n if (loader) {\n loader.registerComponent(\n ParallaxProvider,\n customParallaxProviderMeta ?? parallaxProviderMeta\n );\n } else {\n registerComponent(\n ParallaxProvider,\n customParallaxProviderMeta ?? parallaxProviderMeta\n );\n }\n}\n"],"names":["ParallaxWrapper","xStart","xEnd","yStart","yEnd","disabled","previewInEditor","children","className","inEditor","useContext","PlasmicCanvasContext","hasContext","ParallaxContext","Error","React","Parallax","x","y","parallaxWrapperMeta","name","displayName","importPath","props","type","defaultValue","src","style","maxWidth","description","defaultStyles","registerParallaxWrapper","loader","customParallaxWrapperMeta","registerComponent","parallaxProviderMeta","importName","scrollAxis","options","registerParallaxProvider","customParallaxProviderMeta","ParallaxProvider"],"mappings":";;;;;;;;;;;;SAkBwBA;yBACtBC;MAAAA,kCAAS;uBACTC;MAAAA,8BAAO;yBACPC;MAAAA,kCAAS;uBACTC;MAAAA,8BAAO;MACPC,gBAAAA;MACAC,uBAAAA;MACAC,gBAAAA;MACAC,iBAAAA;AAEA,MAAMC,QAAQ,GAAGC,gBAAU,CAACC,yBAAD,CAA3B;AACA,MAAMC,UAAU,GAAGF,gBAAU,CAACG,mCAAD,CAAV,IAA+B,IAAlD;;AACA,MAAI,CAACD,UAAL,EAAiB;AACf,UAAM,IAAIE,KAAJ,CACJ,iFADI,CAAN;AAGD;;AACD,SACEC,4BAAA,CAACC,4BAAD;AACEX,IAAAA,QAAQ,EAAEA,QAAQ,IAAKI,QAAQ,IAAI,CAACH;AACpCW,IAAAA,CAAC,EAAE,CAAChB,MAAD,EAASC,IAAT;AAC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,aAAa,EAAE;AACbF,IAAAA,QAAQ,EAAE;AADG;AAhDgD,CAAjE;SAqDgBG,wBACdC,QACAC;AAEA,MAAID,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CACElC,eADF,EAEEiC,yBAFF,WAEEA,yBAFF,GAE+Bd,mBAF/B;AAID,GALD,MAKO;AACLe,IAAAA,iBAAiB,CACflC,eADe,EAEfiC,yBAFe,WAEfA,yBAFe,GAEcd,mBAFd,CAAjB;AAID;AACF;;IC9GYgB,oBAAoB,GAAyC;AACxEf,EAAAA,IAAI,EAAE,4BADkE;AAExEC,EAAAA,WAAW,EAAE,mBAF2D;AAGxEe,EAAAA,UAAU,EAAE,kBAH4D;AAIxEd,EAAAA,UAAU,EAAE,uBAJ4D;AAKxEC,EAAAA,KAAK,EAAE;AACLhB,IAAAA,QAAQ,EAAE,MADL;AAEL8B,IAAAA,UAAU,EAAE;AACVb,MAAAA,IAAI,EAAE,QADI;AAEVK,MAAAA,WAAW,EAAE,uDAFH;AAGVS,MAAAA,OAAO,EAAE,CAAC,UAAD,EAAa,YAAb,CAHC;AAIVjB,MAAAA,WAAW,EAAE;AAJH;AAFP;AALiE,CAAnE;AAgBP,SAAgBkB,yBACdP,QACAQ;AAEA,MAAIR,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CACEO,oCADF,EAEED,0BAFF,WAEEA,0BAFF,GAEgCL,oBAFhC;AAID,GALD,MAKO;AACLD,IAAAA,iBAAiB,CACfO,oCADe,EAEfD,0BAFe,WAEfA,0BAFe,GAEeL,oBAFf,CAAjB;AAID;AACF;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var a=require("@plasmicapp/host"),t=e(require("@plasmicapp/host/registerComponent")),r=require("react"),l=e(r),o=require("react-scroll-parallax");function i(e){var t=e.xStart,i=void 0===t?"0":t,
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var a=require("@plasmicapp/host"),t=e(require("@plasmicapp/host/registerComponent")),r=require("react"),l=e(r),o=require("react-scroll-parallax");function i(e){var t=e.xStart,i=void 0===t?"0":t,s=e.xEnd,n=void 0===s?"0":s,p=e.yStart,c=void 0===p?"0":p,d=e.yEnd,x=void 0===d?"0":d,u=e.disabled,h=e.previewInEditor,f=e.children,v=e.className,m=r.useContext(a.PlasmicCanvasContext);if(null==r.useContext(o.ParallaxContext))throw new Error("Scroll Parallax can only be instantiated somewhere inside the Parallax Provider");return l.createElement(o.Parallax,{disabled:u||m&&!h,x:[i,n],y:[c,x],className:v},f)}var s={name:"hostless-scroll-parallax",displayName:"Scroll Parallax",importPath:"@plasmicpkgs/react-scroll-parallax",props:{children:{type:"slot",defaultValue:{type:"img",src:"https://placekitten.com/300/200",style:{maxWidth:"100%"}}},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%"}},n={name:"hostless-parallax-provider",displayName:"Parallax Provider",importName:"ParallaxProvider",importPath:"react-scroll-parallax",props:{children:"slot",scrollAxis:{type:"choice",description:"Scroll axis for setting horizontal/vertical scrolling",options:["vertical","horizontal"],displayName:"Scroll Axis"}}};exports.ParallaxWrapper=i,exports.parallaxProviderMeta=n,exports.registerParallaxProvider=function(e,a){e?e.registerComponent(o.ParallaxProvider,null!=a?a:n):t(o.ParallaxProvider,null!=a?a:n)},exports.registerParallaxWrapper=function(e,a){e?e.registerComponent(i,null!=a?a:s):t(i,null!=a?a:s)};
|
|
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","../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, ParallaxContext } 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 className?: string;\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 className,\n}: ParallaxWrapperProps) {\n const inEditor = useContext(PlasmicCanvasContext);\n const hasContext = useContext(ParallaxContext) != null;\n if (!hasContext) {\n throw new Error(\n \"Scroll Parallax can only be instantiated somewhere inside the Parallax Provider\"\n );\n }\n return (\n <Parallax\n disabled={disabled || (inEditor && !previewInEditor)}\n x={[xStart, xEnd]}\n y={[yStart, yEnd]}\n className={className}\n >\n {children}\n </Parallax>\n );\n}\n\nconst parallaxWrapperMeta: ComponentMeta<ParallaxWrapperProps> = {\n name: \"
|
|
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, ParallaxContext } 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 className?: string;\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 className,\n}: ParallaxWrapperProps) {\n const inEditor = useContext(PlasmicCanvasContext);\n const hasContext = useContext(ParallaxContext) != null;\n if (!hasContext) {\n throw new Error(\n \"Scroll Parallax can only be instantiated somewhere inside the Parallax Provider\"\n );\n }\n return (\n <Parallax\n disabled={disabled || (inEditor && !previewInEditor)}\n x={[xStart, xEnd]}\n y={[yStart, yEnd]}\n className={className}\n >\n {children}\n </Parallax>\n );\n}\n\nconst parallaxWrapperMeta: ComponentMeta<ParallaxWrapperProps> = {\n name: \"hostless-scroll-parallax\",\n displayName: \"Scroll Parallax\",\n importPath: \"@plasmicpkgs/react-scroll-parallax\",\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"img\",\n src: \"https://placekitten.com/300/200\",\n style: {\n maxWidth: \"100%\",\n },\n },\n },\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, {\n ComponentMeta,\n} 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: {\n children: \"slot\",\n scrollAxis: {\n type: \"choice\",\n description: \"Scroll axis for setting horizontal/vertical scrolling\",\n options: [\"vertical\", \"horizontal\"],\n displayName: \"Scroll Axis\",\n },\n },\n};\n\nexport function registerParallaxProvider(\n loader?: { registerComponent: typeof registerComponent },\n customParallaxProviderMeta?: ComponentMeta<ParallaxProviderProps>\n) {\n if (loader) {\n loader.registerComponent(\n ParallaxProvider,\n customParallaxProviderMeta ?? parallaxProviderMeta\n );\n } else {\n registerComponent(\n ParallaxProvider,\n customParallaxProviderMeta ?? parallaxProviderMeta\n );\n }\n}\n"],"names":["ParallaxWrapper","xStart","xEnd","yStart","yEnd","disabled","previewInEditor","children","className","inEditor","useContext","PlasmicCanvasContext","ParallaxContext","Error","React","Parallax","x","y","parallaxWrapperMeta","name","displayName","importPath","props","type","defaultValue","src","style","maxWidth","description","defaultStyles","parallaxProviderMeta","importName","scrollAxis","options","loader","customParallaxProviderMeta","registerComponent","ParallaxProvider","customParallaxWrapperMeta"],"mappings":"qSAkBwBA,aACtBC,OAAAA,aAAS,UACTC,KAAAA,aAAO,UACPC,OAAAA,aAAS,UACTC,KAAAA,aAAO,MACPC,IAAAA,SACAC,IAAAA,gBACAC,IAAAA,SACAC,IAAAA,UAEMC,EAAWC,aAAWC,2BACsB,MAA/BD,aAAWE,yBAEtB,IAAIC,MACR,0FAIFC,gBAACC,YACCV,SAAUA,GAAaI,IAAaH,EACpCU,EAAG,CAACf,EAAQC,GACZe,EAAG,CAACd,EAAQC,GACZI,UAAWA,GAEVD,GAKP,IAAMW,EAA2D,CAC/DC,KAAM,2BACNC,YAAa,kBACbC,WAAY,qCACZC,MAAO,CACLf,SAAU,CACRgB,KAAM,OACNC,aAAc,CACZD,KAAM,MACNE,IAAK,kCACLC,MAAO,CACLC,SAAU,UAIhBxB,OAAQ,CACNoB,KAAM,SACNC,aAAc,OACdI,YACE,qFAEJxB,KAAM,CACJmB,KAAM,SACNC,aAAc,MACdI,YACE,qFAEJ3B,OAAQ,CACNsB,KAAM,SACNC,aAAc,MACdI,YACE,uFAEJ1B,KAAM,CACJqB,KAAM,SACNC,aAAc,OACdI,YACE,uFAEJvB,SAAU,CACRkB,KAAM,UACNK,YAAa,iCAEftB,gBAAiB,CACfiB,KAAM,UACNK,YAAa,8CAGjBC,cAAe,CACbF,SAAU,SC3FDG,EAA6D,CACxEX,KAAM,6BACNC,YAAa,oBACbW,WAAY,mBACZV,WAAY,wBACZC,MAAO,CACLf,SAAU,OACVyB,WAAY,CACVT,KAAM,SACNK,YAAa,wDACbK,QAAS,CAAC,WAAY,cACtBb,YAAa,oHAMjBc,EACAC,GAEID,EACFA,EAAOE,kBACLC,yBACAF,EAAAA,EAA8BL,GAGhCM,EACEC,yBACAF,EAAAA,EAA8BL,6CDoElCI,EACAI,GAEIJ,EACFA,EAAOE,kBACLpC,QACAsC,EAAAA,EAA6BpB,GAG/BkB,EACEpC,QACAsC,EAAAA,EAA6BpB"}
|
|
@@ -31,7 +31,7 @@ function ParallaxWrapper(_ref) {
|
|
|
31
31
|
}, children);
|
|
32
32
|
}
|
|
33
33
|
var parallaxWrapperMeta = {
|
|
34
|
-
name: "
|
|
34
|
+
name: "hostless-scroll-parallax",
|
|
35
35
|
displayName: "Scroll Parallax",
|
|
36
36
|
importPath: "@plasmicpkgs/react-scroll-parallax",
|
|
37
37
|
props: {
|
|
@@ -92,7 +92,13 @@ var parallaxProviderMeta = {
|
|
|
92
92
|
importName: "ParallaxProvider",
|
|
93
93
|
importPath: "react-scroll-parallax",
|
|
94
94
|
props: {
|
|
95
|
-
children: "slot"
|
|
95
|
+
children: "slot",
|
|
96
|
+
scrollAxis: {
|
|
97
|
+
type: "choice",
|
|
98
|
+
description: "Scroll axis for setting horizontal/vertical scrolling",
|
|
99
|
+
options: ["vertical", "horizontal"],
|
|
100
|
+
displayName: "Scroll Axis"
|
|
101
|
+
}
|
|
96
102
|
}
|
|
97
103
|
};
|
|
98
104
|
function registerParallaxProvider(loader, customParallaxProviderMeta) {
|
|
@@ -1 +1 @@
|
|
|
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, ParallaxContext } 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 className?: string;\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 className,\n}: ParallaxWrapperProps) {\n const inEditor = useContext(PlasmicCanvasContext);\n const hasContext = useContext(ParallaxContext) != null;\n if (!hasContext) {\n throw new Error(\n \"Scroll Parallax can only be instantiated somewhere inside the Parallax Provider\"\n );\n }\n return (\n <Parallax\n disabled={disabled || (inEditor && !previewInEditor)}\n x={[xStart, xEnd]}\n y={[yStart, yEnd]}\n className={className}\n >\n {children}\n </Parallax>\n );\n}\n\nconst parallaxWrapperMeta: ComponentMeta<ParallaxWrapperProps> = {\n name: \"
|
|
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, ParallaxContext } 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 className?: string;\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 className,\n}: ParallaxWrapperProps) {\n const inEditor = useContext(PlasmicCanvasContext);\n const hasContext = useContext(ParallaxContext) != null;\n if (!hasContext) {\n throw new Error(\n \"Scroll Parallax can only be instantiated somewhere inside the Parallax Provider\"\n );\n }\n return (\n <Parallax\n disabled={disabled || (inEditor && !previewInEditor)}\n x={[xStart, xEnd]}\n y={[yStart, yEnd]}\n className={className}\n >\n {children}\n </Parallax>\n );\n}\n\nconst parallaxWrapperMeta: ComponentMeta<ParallaxWrapperProps> = {\n name: \"hostless-scroll-parallax\",\n displayName: \"Scroll Parallax\",\n importPath: \"@plasmicpkgs/react-scroll-parallax\",\n props: {\n children: {\n type: \"slot\",\n defaultValue: {\n type: \"img\",\n src: \"https://placekitten.com/300/200\",\n style: {\n maxWidth: \"100%\",\n },\n },\n },\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, {\n ComponentMeta,\n} 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: {\n children: \"slot\",\n scrollAxis: {\n type: \"choice\",\n description: \"Scroll axis for setting horizontal/vertical scrolling\",\n options: [\"vertical\", \"horizontal\"],\n displayName: \"Scroll Axis\",\n },\n },\n};\n\nexport function registerParallaxProvider(\n loader?: { registerComponent: typeof registerComponent },\n customParallaxProviderMeta?: ComponentMeta<ParallaxProviderProps>\n) {\n if (loader) {\n loader.registerComponent(\n ParallaxProvider,\n customParallaxProviderMeta ?? parallaxProviderMeta\n );\n } else {\n registerComponent(\n ParallaxProvider,\n customParallaxProviderMeta ?? parallaxProviderMeta\n );\n }\n}\n"],"names":["ParallaxWrapper","xStart","xEnd","yStart","yEnd","disabled","previewInEditor","children","className","inEditor","useContext","PlasmicCanvasContext","hasContext","ParallaxContext","Error","React","Parallax","x","y","parallaxWrapperMeta","name","displayName","importPath","props","type","defaultValue","src","style","maxWidth","description","defaultStyles","registerParallaxWrapper","loader","customParallaxWrapperMeta","registerComponent","parallaxProviderMeta","importName","scrollAxis","options","registerParallaxProvider","customParallaxProviderMeta","ParallaxProvider"],"mappings":";;;;;SAkBwBA;yBACtBC;MAAAA,kCAAS;uBACTC;MAAAA,8BAAO;yBACPC;MAAAA,kCAAS;uBACTC;MAAAA,8BAAO;MACPC,gBAAAA;MACAC,uBAAAA;MACAC,gBAAAA;MACAC,iBAAAA;AAEA,MAAMC,QAAQ,GAAGC,UAAU,CAACC,oBAAD,CAA3B;AACA,MAAMC,UAAU,GAAGF,UAAU,CAACG,eAAD,CAAV,IAA+B,IAAlD;;AACA,MAAI,CAACD,UAAL,EAAiB;AACf,UAAM,IAAIE,KAAJ,CACJ,iFADI,CAAN;AAGD;;AACD,SACEC,mBAAA,CAACC,QAAD;AACEX,IAAAA,QAAQ,EAAEA,QAAQ,IAAKI,QAAQ,IAAI,CAACH;AACpCW,IAAAA,CAAC,EAAE,CAAChB,MAAD,EAASC,IAAT;AACHgB,IAAAA,CAAC,EAAE,CAACf,MAAD,EAASC,IAAT;AACHI,IAAAA,SAAS,EAAEA;GAJb,EAMGD,QANH,CADF;AAUD;AAED,IAAMY,mBAAmB,GAAwC;AAC/DC,EAAAA,IAAI,EAAE,0BADyD;AAE/DC,EAAAA,WAAW,EAAE,iBAFkD;AAG/DC,EAAAA,UAAU,EAAE,oCAHmD;AAI/DC,EAAAA,KAAK,EAAE;AACLhB,IAAAA,QAAQ,EAAE;AACRiB,MAAAA,IAAI,EAAE,MADE;AAERC,MAAAA,YAAY,EAAE;AACZD,QAAAA,IAAI,EAAE,KADM;AAEZE,QAAAA,GAAG,EAAE,iCAFO;AAGZC,QAAAA,KAAK,EAAE;AACLC,UAAAA,QAAQ,EAAE;AADL;AAHK;AAFN,KADL;AAWLzB,IAAAA,MAAM,EAAE;AACNqB,MAAAA,IAAI,EAAE,QADA;AAENC,MAAAA,YAAY,EAAE,MAFR;AAGNI,MAAAA,WAAW,EACT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MAAAA,WAAW,EAAE,uDAFH;AAGVS,MAAAA,OAAO,EAAE,CAAC,UAAD,EAAa,YAAb,CAHC;AAIVjB,MAAAA,WAAW,EAAE;AAJH;AAFP;AALiE,CAAnE;AAgBP,SAAgBkB,yBACdP,QACAQ;AAEA,MAAIR,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CACEO,gBADF,EAEED,0BAFF,WAEEA,0BAFF,GAEgCL,oBAFhC;AAID,GALD,MAKO;AACLD,IAAAA,iBAAiB,CACfO,gBADe,EAEfD,0BAFe,WAEfA,0BAFe,GAEeL,oBAFf,CAAjB;AAID;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/react-scroll-parallax",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Plasmic registration call for the HTML5 video element",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"typescript": "^3.9.7"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@plasmicapp/host": "^0.0.
|
|
39
|
+
"@plasmicapp/host": "^0.0.47",
|
|
40
40
|
"react-scroll-parallax": "^2.4.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|