@plasmicpkgs/react-awesome-reveal 3.8.31 → 3.8.36
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/LICENSE.md +21 -0
- package/dist/react-awesome-reveal.cjs.development.js +1 -0
- package/dist/react-awesome-reveal.cjs.development.js.map +1 -1
- package/dist/react-awesome-reveal.cjs.production.min.js +1 -1
- package/dist/react-awesome-reveal.cjs.production.min.js.map +1 -1
- package/dist/react-awesome-reveal.esm.js +1 -0
- package/dist/react-awesome-reveal.esm.js.map +1 -1
- package/package.json +4 -3
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Plasmic
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-awesome-reveal.cjs.development.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\n Roll,\n Rotate,\n Slide,\n Zoom,\n} from \"react-awesome-reveal\";\n\nconst effectNameToComponent = {\n bounce: Bounce,\n fade: Fade,\n flip: Flip,\n hinge: Hinge,\n jackinthebox: JackInTheBox,\n roll: Roll,\n rotate: Rotate,\n slide: Slide,\n zoom: Zoom,\n} as const;\n\ntype Effect = keyof typeof effectNameToComponent;\n\nconst effects = Object.keys(effectNameToComponent);\n\nexport interface RevealProps extends React.ComponentProps<typeof Fade> {\n className?: string;\n effect?: Effect;\n}\n\nexport function Reveal({ effect = \"fade\", className, ...props }: RevealProps) {\n const Comp = effectNameToComponent[effect] as any;\n if (!Comp) {\n throw new Error(`Please specify a valid effect: ${effects.join(\", \")}`);\n }\n // Rendering plain strings seems to result in an infinite loop from\n // \"react-awesome-reveal\" (except for when `cascading` is set).\n // So we create a wrapper `div`.\n const children =\n props.cascade ||\n ![\"string\", \"number\", \"boolean\"].includes(typeof props.children) ? (\n props.children\n ) : (\n <div> {props.children} </div>\n );\n return <Comp className={className} {...props} children={children} />;\n}\n\nexport const revealMeta: ComponentMeta<RevealProps> = {\n name: \"hostless-reveal\",\n importName: \"Reveal\",\n displayName: \"Reveal\",\n importPath: \"@plasmicpkgs/react-awesome-reveal\",\n props: {\n big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther`,\n hidden: (props) =>\n (props.effect || \"fade\") !== \"fade\" ||\n ![\"down\", \"left\", \"up\", \"right\"].includes(props.direction as string),\n },\n cascade: {\n type: \"boolean\",\n displayName: \"Cascade\",\n description: \"Stagger its children animations\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"img\",\n src: \"https://placekitten.com/300/200\",\n },\n ],\n },\n damping: {\n type: \"number\",\n displayName: \"Damping\",\n description:\n \"Factor that affects the delay that each animated element in a cascade animation will be assigned\",\n defaultValueHint: 0.5\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n defaultValueHint: 0,\n },\n direction: {\n type: \"choice\",\n options: (props) => {\n const effect = props.effect || \"fade\";\n const maybeAddOptions = (effects: Effect[], options: string[]) =>\n effects.includes(effect) ? options : [];\n return ([] as string[])\n .concat(maybeAddOptions([\"flip\"], [\"horizontal\", \"vertical\"]))\n .concat(\n maybeAddOptions(\n [\"bounce\", \"fade\", \"slide\", \"zoom\"],\n [\"down\", \"left\", \"right\", \"up\"]\n )\n )\n .concat(\n maybeAddOptions(\n [\"fade\", \"rotate\"],\n [\"bottom-left\", \"bottom-right\", \"top-left\", \"top-right\"]\n )\n );\n },\n hidden: (props) => {\n const effect = props.effect || \"fade\";\n return [\"hinge\", \"jackinthebox\", \"roll\"].includes(effect);\n },\n displayName: \"Direction\",\n description:\n \"Origin of the animation (the valid values depend on the chosen Effect)\",\n },\n duration: {\n type: \"number\",\n displayName: \"Duration\",\n description: \"Animation duration, in milliseconds\",\n defaultValueHint: 1000,\n },\n effect: {\n type: \"choice\",\n options: effects.map((v) => v),\n displayName: \"Effect\",\n description: \"The Reveal animation effect to be applied\",\n defaultValueHint: \"fade\"\n },\n // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* fraction: {\n type: \"number\",\n displayName: \"Fraction\",\n description:\n \"Float number between 0 and 1 indicating how much the element should be in viewport before the animation is triggered\",\n }, */\n reverse: {\n type: \"boolean\",\n displayName: \"Reverse\",\n description: `Whether the animation should make element(s) disappear`,\n hidden: (props) =>\n [\"hinge\", \"jackinthebox\"].includes(props.effect || \"fade\"),\n },\n triggerOnce: {\n type: \"boolean\",\n displayName: \"Trigger Once\",\n description:\n \"Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport\",\n // Some effects don't work correctly when `false`\n defaultValue: true,\n },\n },\n};\n\nexport function registerReveal(\n loader?: { registerComponent: typeof registerComponent },\n customRevealMeta?: ComponentMeta<RevealProps>\n) {\n if (loader) {\n loader.registerComponent(Reveal, customRevealMeta ?? revealMeta);\n } else {\n registerComponent(Reveal, customRevealMeta ?? revealMeta);\n }\n}\n"],"names":["effectNameToComponent","bounce","Bounce","fade","Fade","flip","Flip","hinge","Hinge","jackinthebox","JackInTheBox","roll","Roll","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","className","props","Comp","Error","join","children","cascade","includes","React","revealMeta","name","importName","displayName","importPath","big","type","description","hidden","direction","defaultValue","src","damping","defaultValueHint","delay","options","maybeAddOptions","concat","duration","map","v","reverse","triggerOnce","registerReveal","loader","customRevealMeta","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAMA,qBAAqB,GAAG;AAC5BC,EAAAA,MAAM,EAAEC,yBADoB;AAE5BC,EAAAA,IAAI,EAAEC,uBAFsB;AAG5BC,EAAAA,IAAI,EAAEC,uBAHsB;AAI5BC,EAAAA,KAAK,EAAEC,wBAJqB;AAK5BC,EAAAA,YAAY,EAAEC,+BALc;AAM5BC,EAAAA,IAAI,EAAEC,uBANsB;AAO5BC,EAAAA,MAAM,EAAEC,yBAPoB;AAQ5BC,EAAAA,KAAK,EAAEC,wBARqB;AAS5BC,EAAAA,IAAI,EAAEC;AATsB,CAA9B;AAcA,IAAMC,OAAO,gBAAGC,MAAM,CAACC,IAAP,CAAYrB,qBAAZ,CAAhB;SAOgBsB;yBAASC;MAAAA,kCAAS;MAAQC,iBAAAA;MAAcC;;AACtD,MAAMC,IAAI,GAAG1B,qBAAqB,CAACuB,MAAD,CAAlC;;AACA,MAAI,CAACG,IAAL,EAAW;AACT,UAAM,IAAIC,KAAJ,qCAA4CR,OAAO,CAACS,IAAR,CAAa,IAAb,CAA5C,CAAN;AACD;AAED;AACA;;;AACA,MAAMC,QAAQ,GACZJ,KAAK,CAACK,OAAN,IACA,CAAC,CAAC,QAAD,EAAW,QAAX,EAAqB,SAArB,EAAgCC,QAAhC,CAAyC,OAAON,KAAK,CAACI,QAAtD,CADD,GAEEJ,KAAK,CAACI,QAFR,GAIEG,mBAAA,MAAA,MAAA,KAAA,EAAOP,KAAK,CAACI,QAAb,KAAA,CALJ;AAOA,SAAOG,mBAAA,CAACN,IAAD;AAAMF,IAAAA,SAAS,EAAEA;KAAeC;AAAOI,IAAAA,QAAQ,EAAEA;IAAjD,CAAP;AACD;IAEYI,UAAU,GAA+B;AACpDC,EAAAA,IAAI,EAAE,iBAD8C;AAEpDC,EAAAA,UAAU,EAAE,QAFwC;AAGpDC,EAAAA,WAAW,EAAE,QAHuC;AAIpDC,EAAAA,UAAU,EAAE,mCAJwC;
|
|
1
|
+
{"version":3,"file":"react-awesome-reveal.cjs.development.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\n Roll,\n Rotate,\n Slide,\n Zoom,\n} from \"react-awesome-reveal\";\n\nconst effectNameToComponent = {\n bounce: Bounce,\n fade: Fade,\n flip: Flip,\n hinge: Hinge,\n jackinthebox: JackInTheBox,\n roll: Roll,\n rotate: Rotate,\n slide: Slide,\n zoom: Zoom,\n} as const;\n\ntype Effect = keyof typeof effectNameToComponent;\n\nconst effects = Object.keys(effectNameToComponent);\n\nexport interface RevealProps extends React.ComponentProps<typeof Fade> {\n className?: string;\n effect?: Effect;\n}\n\nexport function Reveal({ effect = \"fade\", className, ...props }: RevealProps) {\n const Comp = effectNameToComponent[effect] as any;\n if (!Comp) {\n throw new Error(`Please specify a valid effect: ${effects.join(\", \")}`);\n }\n // Rendering plain strings seems to result in an infinite loop from\n // \"react-awesome-reveal\" (except for when `cascading` is set).\n // So we create a wrapper `div`.\n const children =\n props.cascade ||\n ![\"string\", \"number\", \"boolean\"].includes(typeof props.children) ? (\n props.children\n ) : (\n <div> {props.children} </div>\n );\n return <Comp className={className} {...props} children={children} />;\n}\n\nexport const revealMeta: ComponentMeta<RevealProps> = {\n name: \"hostless-reveal\",\n importName: \"Reveal\",\n displayName: \"Reveal\",\n importPath: \"@plasmicpkgs/react-awesome-reveal\",\n isAttachment: true,\n props: {\n big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther`,\n hidden: (props) =>\n (props.effect || \"fade\") !== \"fade\" ||\n ![\"down\", \"left\", \"up\", \"right\"].includes(props.direction as string),\n },\n cascade: {\n type: \"boolean\",\n displayName: \"Cascade\",\n description: \"Stagger its children animations\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"img\",\n src: \"https://placekitten.com/300/200\",\n },\n ],\n },\n damping: {\n type: \"number\",\n displayName: \"Damping\",\n description:\n \"Factor that affects the delay that each animated element in a cascade animation will be assigned\",\n defaultValueHint: 0.5\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n defaultValueHint: 0,\n },\n direction: {\n type: \"choice\",\n options: (props) => {\n const effect = props.effect || \"fade\";\n const maybeAddOptions = (effects: Effect[], options: string[]) =>\n effects.includes(effect) ? options : [];\n return ([] as string[])\n .concat(maybeAddOptions([\"flip\"], [\"horizontal\", \"vertical\"]))\n .concat(\n maybeAddOptions(\n [\"bounce\", \"fade\", \"slide\", \"zoom\"],\n [\"down\", \"left\", \"right\", \"up\"]\n )\n )\n .concat(\n maybeAddOptions(\n [\"fade\", \"rotate\"],\n [\"bottom-left\", \"bottom-right\", \"top-left\", \"top-right\"]\n )\n );\n },\n hidden: (props) => {\n const effect = props.effect || \"fade\";\n return [\"hinge\", \"jackinthebox\", \"roll\"].includes(effect);\n },\n displayName: \"Direction\",\n description:\n \"Origin of the animation (the valid values depend on the chosen Effect)\",\n },\n duration: {\n type: \"number\",\n displayName: \"Duration\",\n description: \"Animation duration, in milliseconds\",\n defaultValueHint: 1000,\n },\n effect: {\n type: \"choice\",\n options: effects.map((v) => v),\n displayName: \"Effect\",\n description: \"The Reveal animation effect to be applied\",\n defaultValueHint: \"fade\"\n },\n // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* fraction: {\n type: \"number\",\n displayName: \"Fraction\",\n description:\n \"Float number between 0 and 1 indicating how much the element should be in viewport before the animation is triggered\",\n }, */\n reverse: {\n type: \"boolean\",\n displayName: \"Reverse\",\n description: `Whether the animation should make element(s) disappear`,\n hidden: (props) =>\n [\"hinge\", \"jackinthebox\"].includes(props.effect || \"fade\"),\n },\n triggerOnce: {\n type: \"boolean\",\n displayName: \"Trigger Once\",\n description:\n \"Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport\",\n // Some effects don't work correctly when `false`\n defaultValue: true,\n },\n },\n};\n\nexport function registerReveal(\n loader?: { registerComponent: typeof registerComponent },\n customRevealMeta?: ComponentMeta<RevealProps>\n) {\n if (loader) {\n loader.registerComponent(Reveal, customRevealMeta ?? revealMeta);\n } else {\n registerComponent(Reveal, customRevealMeta ?? revealMeta);\n }\n}\n"],"names":["effectNameToComponent","bounce","Bounce","fade","Fade","flip","Flip","hinge","Hinge","jackinthebox","JackInTheBox","roll","Roll","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","className","props","Comp","Error","join","children","cascade","includes","React","revealMeta","name","importName","displayName","importPath","isAttachment","big","type","description","hidden","direction","defaultValue","src","damping","defaultValueHint","delay","options","maybeAddOptions","concat","duration","map","v","reverse","triggerOnce","registerReveal","loader","customRevealMeta","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAMA,qBAAqB,GAAG;AAC5BC,EAAAA,MAAM,EAAEC,yBADoB;AAE5BC,EAAAA,IAAI,EAAEC,uBAFsB;AAG5BC,EAAAA,IAAI,EAAEC,uB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A,MAAM,EAAE,gBAACjB,KAAD;AAAA,eACN,CAAC,OAAD,EAAU,cAAV,EAA0BM,QAA1B,CAAmCN,KAAK,CAACF,MAAN,IAAgB,MAAnD,CADM;AAAA;AAJD,KArFJ;AA4FLiC,IAAAA,WAAW,EAAE;AACXhB,MAAAA,IAAI,EAAE,SADK;AAEXJ,MAAAA,WAAW,EAAE,cAFF;AAGXK,MAAAA,WAAW,EACT,uHAJS;AAKX;AACAG,MAAAA,YAAY,EAAE;AANH;AA5FR;AAN6C;SA6GtCa,eACdC,QACAC;AAEA,MAAID,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyBtC,MAAzB,EAAiCqC,gBAAjC,WAAiCA,gBAAjC,GAAqD1B,UAArD;AACD,GAFD,MAEO;AACL2B,IAAAA,iBAAiB,CAACtC,MAAD,EAASqC,gBAAT,WAASA,gBAAT,GAA6B1B,UAA7B,CAAjB;AACD;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 t=e(require("@plasmicapp/host/registerComponent")),a=e(require("react")),i=require("react-awesome-reveal"),n=["effect","className"],o={bounce:i.Bounce,fade:i.Fade,flip:i.Flip,hinge:i.Hinge,jackinthebox:i.JackInTheBox,roll:i.Roll,rotate:i.Rotate,slide:i.Slide,zoom:i.Zoom},r=Object.keys(o);function l(e){var t=e.effect,i=void 0===t?"fade":t,l=e.className,c=function(e,t){if(null==e)return{};var a,i,n={},o=Object.keys(e);for(i=0;i<o.length;i++)t.indexOf(a=o[i])>=0||(n[a]=e[a]);return n}(e,n),s=o[i];if(!s)throw new Error("Please specify a valid effect: "+r.join(", "));var d=c.cascade||!["string","number","boolean"].includes(typeof c.children)?c.children:a.createElement("div",null," ",c.children," ");return a.createElement(s,Object.assign({className:l},c,{children:d}))}var c={name:"hostless-reveal",importName:"Reveal",displayName:"Reveal",importPath:"@plasmicpkgs/react-awesome-reveal",props:{big:{type:"boolean",displayName:"Big",description:"Causes the animation to start farther",hidden:function(e){return"fade"!==(e.effect||"fade")||!["down","left","up","right"].includes(e.direction)}},cascade:{type:"boolean",displayName:"Cascade",description:"Stagger its children animations"},children:{type:"slot",defaultValue:[{type:"img",src:"https://placekitten.com/300/200"}]},damping:{type:"number",displayName:"Damping",description:"Factor that affects the delay that each animated element in a cascade animation will be assigned",defaultValueHint:.5},delay:{type:"number",displayName:"Delay",description:"Initial delay, in milliseconds",defaultValueHint:0},direction:{type:"choice",options:function(e){var t=e.effect||"fade",a=function(e,a){return e.includes(t)?a:[]};return[].concat(a(["flip"],["horizontal","vertical"])).concat(a(["bounce","fade","slide","zoom"],["down","left","right","up"])).concat(a(["fade","rotate"],["bottom-left","bottom-right","top-left","top-right"]))},hidden:function(e){return["hinge","jackinthebox","roll"].includes(e.effect||"fade")},displayName:"Direction",description:"Origin of the animation (the valid values depend on the chosen Effect)"},duration:{type:"number",displayName:"Duration",description:"Animation duration, in milliseconds",defaultValueHint:1e3},effect:{type:"choice",options:r.map((function(e){return e})),displayName:"Effect",description:"The Reveal animation effect to be applied",defaultValueHint:"fade"},reverse:{type:"boolean",displayName:"Reverse",description:"Whether the animation should make element(s) disappear",hidden:function(e){return["hinge","jackinthebox"].includes(e.effect||"fade")}},triggerOnce:{type:"boolean",displayName:"Trigger Once",description:"Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport",defaultValue:!0}}};exports.Reveal=l,exports.registerReveal=function(e,a){e?e.registerComponent(l,null!=a?a:c):t(l,null!=a?a:c)},exports.revealMeta=c;
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@plasmicapp/host/registerComponent")),a=e(require("react")),i=require("react-awesome-reveal"),n=["effect","className"],o={bounce:i.Bounce,fade:i.Fade,flip:i.Flip,hinge:i.Hinge,jackinthebox:i.JackInTheBox,roll:i.Roll,rotate:i.Rotate,slide:i.Slide,zoom:i.Zoom},r=Object.keys(o);function l(e){var t=e.effect,i=void 0===t?"fade":t,l=e.className,c=function(e,t){if(null==e)return{};var a,i,n={},o=Object.keys(e);for(i=0;i<o.length;i++)t.indexOf(a=o[i])>=0||(n[a]=e[a]);return n}(e,n),s=o[i];if(!s)throw new Error("Please specify a valid effect: "+r.join(", "));var d=c.cascade||!["string","number","boolean"].includes(typeof c.children)?c.children:a.createElement("div",null," ",c.children," ");return a.createElement(s,Object.assign({className:l},c,{children:d}))}var c={name:"hostless-reveal",importName:"Reveal",displayName:"Reveal",importPath:"@plasmicpkgs/react-awesome-reveal",isAttachment:!0,props:{big:{type:"boolean",displayName:"Big",description:"Causes the animation to start farther",hidden:function(e){return"fade"!==(e.effect||"fade")||!["down","left","up","right"].includes(e.direction)}},cascade:{type:"boolean",displayName:"Cascade",description:"Stagger its children animations"},children:{type:"slot",defaultValue:[{type:"img",src:"https://placekitten.com/300/200"}]},damping:{type:"number",displayName:"Damping",description:"Factor that affects the delay that each animated element in a cascade animation will be assigned",defaultValueHint:.5},delay:{type:"number",displayName:"Delay",description:"Initial delay, in milliseconds",defaultValueHint:0},direction:{type:"choice",options:function(e){var t=e.effect||"fade",a=function(e,a){return e.includes(t)?a:[]};return[].concat(a(["flip"],["horizontal","vertical"])).concat(a(["bounce","fade","slide","zoom"],["down","left","right","up"])).concat(a(["fade","rotate"],["bottom-left","bottom-right","top-left","top-right"]))},hidden:function(e){return["hinge","jackinthebox","roll"].includes(e.effect||"fade")},displayName:"Direction",description:"Origin of the animation (the valid values depend on the chosen Effect)"},duration:{type:"number",displayName:"Duration",description:"Animation duration, in milliseconds",defaultValueHint:1e3},effect:{type:"choice",options:r.map((function(e){return e})),displayName:"Effect",description:"The Reveal animation effect to be applied",defaultValueHint:"fade"},reverse:{type:"boolean",displayName:"Reverse",description:"Whether the animation should make element(s) disappear",hidden:function(e){return["hinge","jackinthebox"].includes(e.effect||"fade")}},triggerOnce:{type:"boolean",displayName:"Trigger Once",description:"Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport",defaultValue:!0}}};exports.Reveal=l,exports.registerReveal=function(e,a){e?e.registerComponent(l,null!=a?a:c):t(l,null!=a?a:c)},exports.revealMeta=c;
|
|
2
2
|
//# sourceMappingURL=react-awesome-reveal.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-awesome-reveal.cjs.production.min.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\n Roll,\n Rotate,\n Slide,\n Zoom,\n} from \"react-awesome-reveal\";\n\nconst effectNameToComponent = {\n bounce: Bounce,\n fade: Fade,\n flip: Flip,\n hinge: Hinge,\n jackinthebox: JackInTheBox,\n roll: Roll,\n rotate: Rotate,\n slide: Slide,\n zoom: Zoom,\n} as const;\n\ntype Effect = keyof typeof effectNameToComponent;\n\nconst effects = Object.keys(effectNameToComponent);\n\nexport interface RevealProps extends React.ComponentProps<typeof Fade> {\n className?: string;\n effect?: Effect;\n}\n\nexport function Reveal({ effect = \"fade\", className, ...props }: RevealProps) {\n const Comp = effectNameToComponent[effect] as any;\n if (!Comp) {\n throw new Error(`Please specify a valid effect: ${effects.join(\", \")}`);\n }\n // Rendering plain strings seems to result in an infinite loop from\n // \"react-awesome-reveal\" (except for when `cascading` is set).\n // So we create a wrapper `div`.\n const children =\n props.cascade ||\n ![\"string\", \"number\", \"boolean\"].includes(typeof props.children) ? (\n props.children\n ) : (\n <div> {props.children} </div>\n );\n return <Comp className={className} {...props} children={children} />;\n}\n\nexport const revealMeta: ComponentMeta<RevealProps> = {\n name: \"hostless-reveal\",\n importName: \"Reveal\",\n displayName: \"Reveal\",\n importPath: \"@plasmicpkgs/react-awesome-reveal\",\n props: {\n big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther`,\n hidden: (props) =>\n (props.effect || \"fade\") !== \"fade\" ||\n ![\"down\", \"left\", \"up\", \"right\"].includes(props.direction as string),\n },\n cascade: {\n type: \"boolean\",\n displayName: \"Cascade\",\n description: \"Stagger its children animations\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"img\",\n src: \"https://placekitten.com/300/200\",\n },\n ],\n },\n damping: {\n type: \"number\",\n displayName: \"Damping\",\n description:\n \"Factor that affects the delay that each animated element in a cascade animation will be assigned\",\n defaultValueHint: 0.5\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n defaultValueHint: 0,\n },\n direction: {\n type: \"choice\",\n options: (props) => {\n const effect = props.effect || \"fade\";\n const maybeAddOptions = (effects: Effect[], options: string[]) =>\n effects.includes(effect) ? options : [];\n return ([] as string[])\n .concat(maybeAddOptions([\"flip\"], [\"horizontal\", \"vertical\"]))\n .concat(\n maybeAddOptions(\n [\"bounce\", \"fade\", \"slide\", \"zoom\"],\n [\"down\", \"left\", \"right\", \"up\"]\n )\n )\n .concat(\n maybeAddOptions(\n [\"fade\", \"rotate\"],\n [\"bottom-left\", \"bottom-right\", \"top-left\", \"top-right\"]\n )\n );\n },\n hidden: (props) => {\n const effect = props.effect || \"fade\";\n return [\"hinge\", \"jackinthebox\", \"roll\"].includes(effect);\n },\n displayName: \"Direction\",\n description:\n \"Origin of the animation (the valid values depend on the chosen Effect)\",\n },\n duration: {\n type: \"number\",\n displayName: \"Duration\",\n description: \"Animation duration, in milliseconds\",\n defaultValueHint: 1000,\n },\n effect: {\n type: \"choice\",\n options: effects.map((v) => v),\n displayName: \"Effect\",\n description: \"The Reveal animation effect to be applied\",\n defaultValueHint: \"fade\"\n },\n // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* fraction: {\n type: \"number\",\n displayName: \"Fraction\",\n description:\n \"Float number between 0 and 1 indicating how much the element should be in viewport before the animation is triggered\",\n }, */\n reverse: {\n type: \"boolean\",\n displayName: \"Reverse\",\n description: `Whether the animation should make element(s) disappear`,\n hidden: (props) =>\n [\"hinge\", \"jackinthebox\"].includes(props.effect || \"fade\"),\n },\n triggerOnce: {\n type: \"boolean\",\n displayName: \"Trigger Once\",\n description:\n \"Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport\",\n // Some effects don't work correctly when `false`\n defaultValue: true,\n },\n },\n};\n\nexport function registerReveal(\n loader?: { registerComponent: typeof registerComponent },\n customRevealMeta?: ComponentMeta<RevealProps>\n) {\n if (loader) {\n loader.registerComponent(Reveal, customRevealMeta ?? revealMeta);\n } else {\n registerComponent(Reveal, customRevealMeta ?? revealMeta);\n }\n}\n"],"names":["effectNameToComponent","bounce","Bounce","fade","Fade","flip","Flip","hinge","Hinge","jackinthebox","JackInTheBox","roll","Roll","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","className","props","Comp","Error","join","children","cascade","includes","React","revealMeta","name","importName","displayName","importPath","big","type","description","hidden","direction","defaultValue","src","damping","defaultValueHint","delay","options","maybeAddOptions","concat","duration","map","v","reverse","triggerOnce","loader","customRevealMeta","registerComponent"],"mappings":"kRAgBMA,EAAwB,CAC5BC,OAAQC,SACRC,KAAMC,OACNC,KAAMC,OACNC,MAAOC,QACPC,aAAcC,eACdC,KAAMC,OACNC,OAAQC,SACRC,MAAOC,QACPC,KAAMC,QAKFC,EAAUC,OAAOC,KAAKrB,YAOZsB,aAASC,OAAAA,aAAS,SAAQC,IAAAA,UAAcC,0IAChDC,EAAO1B,EAAsBuB,OAC9BG,QACG,IAAIC,wCAAwCR,EAAQS,KAAK,WAK3DC,EACJJ,EAAMK,UACL,CAAC,SAAU,SAAU,WAAWC,gBAAgBN,EAAMI,UACrDJ,EAAMI,SAENG,+BAAOP,EAAMI,qBAEVG,gBAACN,iBAAKF,UAAWA,GAAeC,GAAOI,SAAUA,SAG7CI,EAAyC,CACpDC,KAAM,kBACNC,WAAY,SACZC,YAAa,SACbC,WAAY,
|
|
1
|
+
{"version":3,"file":"react-awesome-reveal.cjs.production.min.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\n Roll,\n Rotate,\n Slide,\n Zoom,\n} from \"react-awesome-reveal\";\n\nconst effectNameToComponent = {\n bounce: Bounce,\n fade: Fade,\n flip: Flip,\n hinge: Hinge,\n jackinthebox: JackInTheBox,\n roll: Roll,\n rotate: Rotate,\n slide: Slide,\n zoom: Zoom,\n} as const;\n\ntype Effect = keyof typeof effectNameToComponent;\n\nconst effects = Object.keys(effectNameToComponent);\n\nexport interface RevealProps extends React.ComponentProps<typeof Fade> {\n className?: string;\n effect?: Effect;\n}\n\nexport function Reveal({ effect = \"fade\", className, ...props }: RevealProps) {\n const Comp = effectNameToComponent[effect] as any;\n if (!Comp) {\n throw new Error(`Please specify a valid effect: ${effects.join(\", \")}`);\n }\n // Rendering plain strings seems to result in an infinite loop from\n // \"react-awesome-reveal\" (except for when `cascading` is set).\n // So we create a wrapper `div`.\n const children =\n props.cascade ||\n ![\"string\", \"number\", \"boolean\"].includes(typeof props.children) ? (\n props.children\n ) : (\n <div> {props.children} </div>\n );\n return <Comp className={className} {...props} children={children} />;\n}\n\nexport const revealMeta: ComponentMeta<RevealProps> = {\n name: \"hostless-reveal\",\n importName: \"Reveal\",\n displayName: \"Reveal\",\n importPath: \"@plasmicpkgs/react-awesome-reveal\",\n isAttachment: true,\n props: {\n big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther`,\n hidden: (props) =>\n (props.effect || \"fade\") !== \"fade\" ||\n ![\"down\", \"left\", \"up\", \"right\"].includes(props.direction as string),\n },\n cascade: {\n type: \"boolean\",\n displayName: \"Cascade\",\n description: \"Stagger its children animations\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"img\",\n src: \"https://placekitten.com/300/200\",\n },\n ],\n },\n damping: {\n type: \"number\",\n displayName: \"Damping\",\n description:\n \"Factor that affects the delay that each animated element in a cascade animation will be assigned\",\n defaultValueHint: 0.5\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n defaultValueHint: 0,\n },\n direction: {\n type: \"choice\",\n options: (props) => {\n const effect = props.effect || \"fade\";\n const maybeAddOptions = (effects: Effect[], options: string[]) =>\n effects.includes(effect) ? options : [];\n return ([] as string[])\n .concat(maybeAddOptions([\"flip\"], [\"horizontal\", \"vertical\"]))\n .concat(\n maybeAddOptions(\n [\"bounce\", \"fade\", \"slide\", \"zoom\"],\n [\"down\", \"left\", \"right\", \"up\"]\n )\n )\n .concat(\n maybeAddOptions(\n [\"fade\", \"rotate\"],\n [\"bottom-left\", \"bottom-right\", \"top-left\", \"top-right\"]\n )\n );\n },\n hidden: (props) => {\n const effect = props.effect || \"fade\";\n return [\"hinge\", \"jackinthebox\", \"roll\"].includes(effect);\n },\n displayName: \"Direction\",\n description:\n \"Origin of the animation (the valid values depend on the chosen Effect)\",\n },\n duration: {\n type: \"number\",\n displayName: \"Duration\",\n description: \"Animation duration, in milliseconds\",\n defaultValueHint: 1000,\n },\n effect: {\n type: \"choice\",\n options: effects.map((v) => v),\n displayName: \"Effect\",\n description: \"The Reveal animation effect to be applied\",\n defaultValueHint: \"fade\"\n },\n // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* fraction: {\n type: \"number\",\n displayName: \"Fraction\",\n description:\n \"Float number between 0 and 1 indicating how much the element should be in viewport before the animation is triggered\",\n }, */\n reverse: {\n type: \"boolean\",\n displayName: \"Reverse\",\n description: `Whether the animation should make element(s) disappear`,\n hidden: (props) =>\n [\"hinge\", \"jackinthebox\"].includes(props.effect || \"fade\"),\n },\n triggerOnce: {\n type: \"boolean\",\n displayName: \"Trigger Once\",\n description:\n \"Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport\",\n // Some effects don't work correctly when `false`\n defaultValue: true,\n },\n },\n};\n\nexport function registerReveal(\n loader?: { registerComponent: typeof registerComponent },\n customRevealMeta?: ComponentMeta<RevealProps>\n) {\n if (loader) {\n loader.registerComponent(Reveal, customRevealMeta ?? revealMeta);\n } else {\n registerComponent(Reveal, customRevealMeta ?? revealMeta);\n }\n}\n"],"names":["effectNameToComponent","bounce","Bounce","fade","Fade","flip","Flip","hinge","Hinge","jackinthebox","JackInTheBox","roll","Roll","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","className","props","Comp","Error","join","children","cascade","includes","React","revealMeta","name","importName","displayName","importPath","isAttachment","big","type","description","hidden","direction","defaultValue","src","damping","defaultValueHint","delay","options","maybeAddOptions","concat","duration","map","v","reverse","triggerOnce","loader","customRevealMeta","registerComponent"],"mappings":"kRAgBMA,EAAwB,CAC5BC,OAAQC,SACRC,KAAMC,OACNC,KAAMC,OACNC,MAAOC,QACPC,aAAcC,eACdC,KAAMC,OACNC,OAAQC,SACRC,MAAOC,QACPC,KAAMC,QAKFC,EAAUC,OAAOC,KAAKrB,YAOZsB,aAASC,OAAAA,aAAS,SAAQC,IAAAA,UAAcC,0IAChDC,EAAO1B,EAAsBuB,OAC9BG,QACG,IAAIC,wCAAwCR,EAAQS,KAAK,WAK3DC,EACJJ,EAAMK,UACL,CAAC,SAAU,SAAU,WAAWC,gBAAgBN,EAAMI,UACrDJ,EAAMI,SAENG,+BAAOP,EAAMI,qBAEVG,gBAACN,iBAAKF,UAAWA,GAAeC,GAAOI,SAAUA,SAG7CI,EAAyC,CACpDC,KAAM,kBACNC,WAAY,SACZC,YAAa,SACbC,WAAY,oCACZC,cAAc,EACdb,MAAO,CACLc,IAAK,CACHC,KAAM,UACNJ,YAAa,MACbK,oDACAC,OAAQ,SAACjB,SACsB,UAA5BA,EAAMF,QAAU,UAChB,CAAC,OAAQ,OAAQ,KAAM,SAASQ,SAASN,EAAMkB,aAEpDb,QAAS,CACPU,KAA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"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\n Roll,\n Rotate,\n Slide,\n Zoom,\n} from \"react-awesome-reveal\";\n\nconst effectNameToComponent = {\n bounce: Bounce,\n fade: Fade,\n flip: Flip,\n hinge: Hinge,\n jackinthebox: JackInTheBox,\n roll: Roll,\n rotate: Rotate,\n slide: Slide,\n zoom: Zoom,\n} as const;\n\ntype Effect = keyof typeof effectNameToComponent;\n\nconst effects = Object.keys(effectNameToComponent);\n\nexport interface RevealProps extends React.ComponentProps<typeof Fade> {\n className?: string;\n effect?: Effect;\n}\n\nexport function Reveal({ effect = \"fade\", className, ...props }: RevealProps) {\n const Comp = effectNameToComponent[effect] as any;\n if (!Comp) {\n throw new Error(`Please specify a valid effect: ${effects.join(\", \")}`);\n }\n // Rendering plain strings seems to result in an infinite loop from\n // \"react-awesome-reveal\" (except for when `cascading` is set).\n // So we create a wrapper `div`.\n const children =\n props.cascade ||\n ![\"string\", \"number\", \"boolean\"].includes(typeof props.children) ? (\n props.children\n ) : (\n <div> {props.children} </div>\n );\n return <Comp className={className} {...props} children={children} />;\n}\n\nexport const revealMeta: ComponentMeta<RevealProps> = {\n name: \"hostless-reveal\",\n importName: \"Reveal\",\n displayName: \"Reveal\",\n importPath: \"@plasmicpkgs/react-awesome-reveal\",\n props: {\n big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther`,\n hidden: (props) =>\n (props.effect || \"fade\") !== \"fade\" ||\n ![\"down\", \"left\", \"up\", \"right\"].includes(props.direction as string),\n },\n cascade: {\n type: \"boolean\",\n displayName: \"Cascade\",\n description: \"Stagger its children animations\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"img\",\n src: \"https://placekitten.com/300/200\",\n },\n ],\n },\n damping: {\n type: \"number\",\n displayName: \"Damping\",\n description:\n \"Factor that affects the delay that each animated element in a cascade animation will be assigned\",\n defaultValueHint: 0.5\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n defaultValueHint: 0,\n },\n direction: {\n type: \"choice\",\n options: (props) => {\n const effect = props.effect || \"fade\";\n const maybeAddOptions = (effects: Effect[], options: string[]) =>\n effects.includes(effect) ? options : [];\n return ([] as string[])\n .concat(maybeAddOptions([\"flip\"], [\"horizontal\", \"vertical\"]))\n .concat(\n maybeAddOptions(\n [\"bounce\", \"fade\", \"slide\", \"zoom\"],\n [\"down\", \"left\", \"right\", \"up\"]\n )\n )\n .concat(\n maybeAddOptions(\n [\"fade\", \"rotate\"],\n [\"bottom-left\", \"bottom-right\", \"top-left\", \"top-right\"]\n )\n );\n },\n hidden: (props) => {\n const effect = props.effect || \"fade\";\n return [\"hinge\", \"jackinthebox\", \"roll\"].includes(effect);\n },\n displayName: \"Direction\",\n description:\n \"Origin of the animation (the valid values depend on the chosen Effect)\",\n },\n duration: {\n type: \"number\",\n displayName: \"Duration\",\n description: \"Animation duration, in milliseconds\",\n defaultValueHint: 1000,\n },\n effect: {\n type: \"choice\",\n options: effects.map((v) => v),\n displayName: \"Effect\",\n description: \"The Reveal animation effect to be applied\",\n defaultValueHint: \"fade\"\n },\n // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* fraction: {\n type: \"number\",\n displayName: \"Fraction\",\n description:\n \"Float number between 0 and 1 indicating how much the element should be in viewport before the animation is triggered\",\n }, */\n reverse: {\n type: \"boolean\",\n displayName: \"Reverse\",\n description: `Whether the animation should make element(s) disappear`,\n hidden: (props) =>\n [\"hinge\", \"jackinthebox\"].includes(props.effect || \"fade\"),\n },\n triggerOnce: {\n type: \"boolean\",\n displayName: \"Trigger Once\",\n description:\n \"Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport\",\n // Some effects don't work correctly when `false`\n defaultValue: true,\n },\n },\n};\n\nexport function registerReveal(\n loader?: { registerComponent: typeof registerComponent },\n customRevealMeta?: ComponentMeta<RevealProps>\n) {\n if (loader) {\n loader.registerComponent(Reveal, customRevealMeta ?? revealMeta);\n } else {\n registerComponent(Reveal, customRevealMeta ?? revealMeta);\n }\n}\n"],"names":["effectNameToComponent","bounce","Bounce","fade","Fade","flip","Flip","hinge","Hinge","jackinthebox","JackInTheBox","roll","Roll","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","className","props","Comp","Error","join","children","cascade","includes","React","revealMeta","name","importName","displayName","importPath","big","type","description","hidden","direction","defaultValue","src","damping","defaultValueHint","delay","options","maybeAddOptions","concat","duration","map","v","reverse","triggerOnce","registerReveal","loader","customRevealMeta","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBA,IAAMA,qBAAqB,GAAG;AAC5BC,EAAAA,MAAM,EAAEC,MADoB;AAE5BC,EAAAA,IAAI,EAAEC,IAFsB;AAG5BC,EAAAA,IAAI,EAAEC,IAHsB;AAI5BC,EAAAA,KAAK,EAAEC,KAJqB;AAK5BC,EAAAA,YAAY,EAAEC,YALc;AAM5BC,EAAAA,IAAI,EAAEC,IANsB;AAO5BC,EAAAA,MAAM,EAAEC,MAPoB;AAQ5BC,EAAAA,KAAK,EAAEC,KARqB;AAS5BC,EAAAA,IAAI,EAAEC;AATsB,CAA9B;AAcA,IAAMC,OAAO,gBAAGC,MAAM,CAACC,IAAP,CAAYrB,qBAAZ,CAAhB;SAOgBsB;yBAASC;MAAAA,kCAAS;MAAQC,iBAAAA;MAAcC;;AACtD,MAAMC,IAAI,GAAG1B,qBAAqB,CAACuB,MAAD,CAAlC;;AACA,MAAI,CAACG,IAAL,EAAW;AACT,UAAM,IAAIC,KAAJ,qCAA4CR,OAAO,CAACS,IAAR,CAAa,IAAb,CAA5C,CAAN;AACD;AAED;AACA;;;AACA,MAAMC,QAAQ,GACZJ,KAAK,CAACK,OAAN,IACA,CAAC,CAAC,QAAD,EAAW,QAAX,EAAqB,SAArB,EAAgCC,QAAhC,CAAyC,OAAON,KAAK,CAACI,QAAtD,CADD,GAEEJ,KAAK,CAACI,QAFR,GAIEG,mBAAA,MAAA,MAAA,KAAA,EAAOP,KAAK,CAACI,QAAb,KAAA,CALJ;AAOA,SAAOG,mBAAA,CAACN,IAAD;AAAMF,IAAAA,SAAS,EAAEA;KAAeC;AAAOI,IAAAA,QAAQ,EAAEA;IAAjD,CAAP;AACD;IAEYI,UAAU,GAA+B;AACpDC,EAAAA,IAAI,EAAE,iBAD8C;AAEpDC,EAAAA,UAAU,EAAE,QAFwC;AAGpDC,EAAAA,WAAW,EAAE,QAHuC;AAIpDC,EAAAA,UAAU,EAAE,mCAJwC;
|
|
1
|
+
{"version":3,"file":"react-awesome-reveal.esm.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\n Roll,\n Rotate,\n Slide,\n Zoom,\n} from \"react-awesome-reveal\";\n\nconst effectNameToComponent = {\n bounce: Bounce,\n fade: Fade,\n flip: Flip,\n hinge: Hinge,\n jackinthebox: JackInTheBox,\n roll: Roll,\n rotate: Rotate,\n slide: Slide,\n zoom: Zoom,\n} as const;\n\ntype Effect = keyof typeof effectNameToComponent;\n\nconst effects = Object.keys(effectNameToComponent);\n\nexport interface RevealProps extends React.ComponentProps<typeof Fade> {\n className?: string;\n effect?: Effect;\n}\n\nexport function Reveal({ effect = \"fade\", className, ...props }: RevealProps) {\n const Comp = effectNameToComponent[effect] as any;\n if (!Comp) {\n throw new Error(`Please specify a valid effect: ${effects.join(\", \")}`);\n }\n // Rendering plain strings seems to result in an infinite loop from\n // \"react-awesome-reveal\" (except for when `cascading` is set).\n // So we create a wrapper `div`.\n const children =\n props.cascade ||\n ![\"string\", \"number\", \"boolean\"].includes(typeof props.children) ? (\n props.children\n ) : (\n <div> {props.children} </div>\n );\n return <Comp className={className} {...props} children={children} />;\n}\n\nexport const revealMeta: ComponentMeta<RevealProps> = {\n name: \"hostless-reveal\",\n importName: \"Reveal\",\n displayName: \"Reveal\",\n importPath: \"@plasmicpkgs/react-awesome-reveal\",\n isAttachment: true,\n props: {\n big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther`,\n hidden: (props) =>\n (props.effect || \"fade\") !== \"fade\" ||\n ![\"down\", \"left\", \"up\", \"right\"].includes(props.direction as string),\n },\n cascade: {\n type: \"boolean\",\n displayName: \"Cascade\",\n description: \"Stagger its children animations\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"img\",\n src: \"https://placekitten.com/300/200\",\n },\n ],\n },\n damping: {\n type: \"number\",\n displayName: \"Damping\",\n description:\n \"Factor that affects the delay that each animated element in a cascade animation will be assigned\",\n defaultValueHint: 0.5\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n defaultValueHint: 0,\n },\n direction: {\n type: \"choice\",\n options: (props) => {\n const effect = props.effect || \"fade\";\n const maybeAddOptions = (effects: Effect[], options: string[]) =>\n effects.includes(effect) ? options : [];\n return ([] as string[])\n .concat(maybeAddOptions([\"flip\"], [\"horizontal\", \"vertical\"]))\n .concat(\n maybeAddOptions(\n [\"bounce\", \"fade\", \"slide\", \"zoom\"],\n [\"down\", \"left\", \"right\", \"up\"]\n )\n )\n .concat(\n maybeAddOptions(\n [\"fade\", \"rotate\"],\n [\"bottom-left\", \"bottom-right\", \"top-left\", \"top-right\"]\n )\n );\n },\n hidden: (props) => {\n const effect = props.effect || \"fade\";\n return [\"hinge\", \"jackinthebox\", \"roll\"].includes(effect);\n },\n displayName: \"Direction\",\n description:\n \"Origin of the animation (the valid values depend on the chosen Effect)\",\n },\n duration: {\n type: \"number\",\n displayName: \"Duration\",\n description: \"Animation duration, in milliseconds\",\n defaultValueHint: 1000,\n },\n effect: {\n type: \"choice\",\n options: effects.map((v) => v),\n displayName: \"Effect\",\n description: \"The Reveal animation effect to be applied\",\n defaultValueHint: \"fade\"\n },\n // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* fraction: {\n type: \"number\",\n displayName: \"Fraction\",\n description:\n \"Float number between 0 and 1 indicating how much the element should be in viewport before the animation is triggered\",\n }, */\n reverse: {\n type: \"boolean\",\n displayName: \"Reverse\",\n description: `Whether the animation should make element(s) disappear`,\n hidden: (props) =>\n [\"hinge\", \"jackinthebox\"].includes(props.effect || \"fade\"),\n },\n triggerOnce: {\n type: \"boolean\",\n displayName: \"Trigger Once\",\n description:\n \"Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport\",\n // Some effects don't work correctly when `false`\n defaultValue: true,\n },\n },\n};\n\nexport function registerReveal(\n loader?: { registerComponent: typeof registerComponent },\n customRevealMeta?: ComponentMeta<RevealProps>\n) {\n if (loader) {\n loader.registerComponent(Reveal, customRevealMeta ?? revealMeta);\n } else {\n registerComponent(Reveal, customRevealMeta ?? revealMeta);\n }\n}\n"],"names":["effectNameToComponent","bounce","Bounce","fade","Fade","flip","Flip","hinge","Hinge","jackinthebox","JackInTheBox","roll","Roll","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","className","props","Comp","Error","join","children","cascade","includes","React","revealMeta","name","importName","displayName","importPath","isAttachment","big","type","description","hidden","direction","defaultValue","src","damping","defaultValueHint","delay","options","maybeAddOptions","concat","duration","map","v","reverse","triggerOnce","registerReveal","loader","customRevealMeta","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBA,IAAMA,qBAAqB,GAAG;AAC5BC,EAAAA,MAAM,EAAEC,MADoB;AAE5BC,EAAAA,IAAI,EAAEC,IAFsB;AAG5BC,EAAAA,IAAI,EAAEC,IAHsB;AAI5BC,EAAAA,KAAK,EAAEC,KAJqB;AAK5BC,EAAAA,YAAY,EAAEC,YALc;AAM5BC,EAAAA,IAAI,EAAEC,IANsB;AAO5BC,EAAAA,MAAM,EAAEC,MAPoB;AAQ5BC,EAAAA,KA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;AACXhB,MAAAA,IAAI,EAAE,SADK;AAEXJ,MAAAA,WAAW,EAAE,cAFF;AAGXK,MAAAA,WAAW,EACT,uHAJS;AAKX;AACAG,MAAAA,YAAY,EAAE;AANH;AA5FR;AAN6C;SA6GtCa,eACdC,QACAC;AAEA,MAAID,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyBtC,MAAzB,EAAiCqC,gBAAjC,WAAiCA,gBAAjC,GAAqD1B,UAArD;AACD,GAFD,MAEO;AACL2B,IAAAA,iBAAiB,CAACtC,MAAD,EAASqC,gBAAT,WAASA,gBAAT,GAA6B1B,UAA7B,CAAjB;AACD;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/react-awesome-reveal",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.36",
|
|
4
4
|
"description": "Plasmic registration call for react-awesome-reveal",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"analyze": "size-limit --why"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@plasmicapp/host": "1.0.
|
|
31
|
+
"@plasmicapp/host": "1.0.36",
|
|
32
32
|
"@size-limit/preset-small-lib": "^4.11.0",
|
|
33
33
|
"@types/node": "^14.0.26",
|
|
34
34
|
"size-limit": "^4.11.0",
|
|
@@ -43,5 +43,6 @@
|
|
|
43
43
|
"@plasmicapp/host": "^1.0.0",
|
|
44
44
|
"react": ">=16.8.0",
|
|
45
45
|
"react-dom": ">=16.8.0"
|
|
46
|
-
}
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "9c7331280936955121f7948a75024e3137a844f0"
|
|
47
48
|
}
|