@plasmicpkgs/react-awesome-reveal 3.8.3 → 3.8.4

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/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import registerComponent, { ComponentMeta } from "@plasmicapp/host/registerComponent";
1
2
  import React from "react";
2
3
  import { Fade } from "react-awesome-reveal";
3
4
  declare const effectNameToComponent: {
@@ -11,8 +12,13 @@ declare const effectNameToComponent: {
11
12
  readonly zoom: React.FC<import("react-awesome-reveal").ZoomProps>;
12
13
  };
13
14
  declare type Effect = keyof typeof effectNameToComponent;
14
- export declare function Reveal({ effect, className, ...props }: React.ComponentProps<typeof Fade> & {
15
+ export interface RevealProps extends React.ComponentProps<typeof Fade> {
15
16
  className?: string;
16
17
  effect?: Effect;
17
- }): JSX.Element;
18
+ }
19
+ export declare function Reveal({ effect, className, ...props }: RevealProps): JSX.Element;
20
+ export declare const revealMeta: ComponentMeta<RevealProps>;
21
+ export declare function registerReveal(loader?: {
22
+ registerComponent: typeof registerComponent;
23
+ }, customRevealMeta?: ComponentMeta<RevealProps>): void;
18
24
  export {};
@@ -60,8 +60,10 @@ function Reveal(_ref) {
60
60
  children: children
61
61
  }));
62
62
  }
63
- registerComponent(Reveal, {
64
- name: "Reveal",
63
+ var revealMeta = {
64
+ name: "hostless-reveal",
65
+ importName: "Reveal",
66
+ displayName: "Reveal",
65
67
  importPath: "@plasmicpkgs/react-awesome-reveal",
66
68
  props: {
67
69
  // `big` seems not to be working properly as of `react-awesome-reveal@3.8.1`
@@ -78,7 +80,10 @@ registerComponent(Reveal, {
78
80
  },
79
81
  children: {
80
82
  type: "slot",
81
- defaultValue: "Reveal text"
83
+ defaultValue: [{
84
+ type: "img",
85
+ src: "https://placekitten.com/300/200"
86
+ }]
82
87
  },
83
88
  damping: {
84
89
  type: "number",
@@ -93,6 +98,7 @@ registerComponent(Reveal, {
93
98
  direction: {
94
99
  type: "choice",
95
100
  options: ["horizontal", "vertical", "bottom-left", "bottom-right", "down", "left", "right", "top-left", "top-right", "up"],
101
+ defaultValue: "up",
96
102
  displayName: "Direction",
97
103
  description: "Origin of the animation (the valid values depend on the chosen Effect)"
98
104
  },
@@ -103,7 +109,7 @@ registerComponent(Reveal, {
103
109
  },
104
110
  effect: {
105
111
  type: "choice",
106
- options: effects.map(function (v) {
112
+ options: /*#__PURE__*/effects.map(function (v) {
107
113
  return v;
108
114
  }),
109
115
  displayName: "Effect",
@@ -128,7 +134,16 @@ registerComponent(Reveal, {
128
134
  description: "Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport"
129
135
  }
130
136
  }
131
- });
137
+ };
138
+ function registerReveal(loader, customRevealMeta) {
139
+ if (loader) {
140
+ loader.registerComponent(Reveal, customRevealMeta != null ? customRevealMeta : revealMeta);
141
+ } else {
142
+ registerComponent(Reveal, customRevealMeta != null ? customRevealMeta : revealMeta);
143
+ }
144
+ }
132
145
 
133
146
  exports.Reveal = Reveal;
147
+ exports.registerReveal = registerReveal;
148
+ exports.revealMeta = revealMeta;
134
149
  //# sourceMappingURL=react-awesome-reveal.cjs.development.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-awesome-reveal.cjs.development.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\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 seems not to be working properly in the canvas as of\n // `react-awesome-reveal@3.8.1`\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 function Reveal({\n effect = \"fade\",\n className,\n ...props\n}: React.ComponentProps<typeof Fade> & {\n className?: string;\n effect?: Effect;\n}) {\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\nregisterComponent(Reveal, {\n name: \"Reveal\",\n importPath: \"@plasmicpkgs/react-awesome-reveal\",\n props: {\n // `big` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther. Only applied to \"fade\" Effect and \"down\", \"left\", \"right\" and \"up\" directions`,\n }, */\n cascade: {\n type: \"boolean\",\n displayName: \"Cascade\",\n description: \"Stagger its children animations\",\n },\n children: {\n type: \"slot\",\n defaultValue: \"Reveal text\",\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 (defaults to 0.5)\",\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n },\n direction: {\n type: \"choice\",\n options: [\n \"horizontal\",\n \"vertical\",\n \"bottom-left\",\n \"bottom-right\",\n \"down\",\n \"left\",\n \"right\",\n \"top-left\",\n \"top-right\",\n \"up\",\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 (defaults to 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 },\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. Not applied to \"hinge\" and \"jackinthebox\" effects`,\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 },\n },\n});\n"],"names":["effectNameToComponent","bounce","Bounce","fade","Fade","flip","Flip","hinge","Hinge","jackinthebox","JackInTheBox","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","className","props","Comp","Error","join","children","cascade","includes","React","registerComponent","name","importPath","type","displayName","description","defaultValue","damping","delay","direction","options","duration","map","v","reverse","triggerOnce"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaA,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;AAM5B;AACA;;AACA;AACAC,EAAAA,MAAM,EAAEC,yBAToB;AAU5BC,EAAAA,KAAK,EAAEC,wBAVqB;AAW5BC,EAAAA,IAAI,EAAEC;AAXsB,CAA9B;AAgBA,IAAMC,OAAO,gBAAGC,MAAM,CAACC,IAAP,CAAYnB,qBAAZ,CAAhB;SAEgBoB;yBACdC;MAAAA,kCAAS;MACTC,iBAAAA;MACGC;;AAKH,MAAMC,IAAI,GAAGxB,qBAAqB,CAACqB,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,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ACRR,MAAAA,IAAI,EAAE,QADE;AAERC,MAAAA,WAAW,EAAE,UAFL;AAGRC,MAAAA,WAAW,EAAE;AAHL,KA7CL;AAkDLf,IAAAA,MAAM,EAAE;AACNa,MAAAA,IAAI,EAAE,QADA;AAENO,MAAAA,OAAO,EAAExB,OAAO,CAAC0B,GAAR,CAAY,UAACC,CAAD;AAAA,eAAOA,CAAP;AAAA,OAAZ,CAFH;AAGNT,MAAAA,WAAW,EAAE,QAHP;AAINC,MAAAA,WAAW,EAAE;AAJP,KAlDH;AAwDL;;AACA;;;;;;AAMAS,IAAAA,OAAO,EAAE;AACPX,MAAAA,IAAI,EAAE,SADC;AAEPC,MAAAA,WAAW,EAAE,SAFN;AAGPC,MAAAA,WAAW;AAHJ,KA/DJ;AAoELU,IAAAA,WAAW,EAAE;AACXZ,MAAAA,IAAI,EAAE,SADK;AAEXC,MAAAA,WAAW,EAAE,cAFF;AAGXC,MAAAA,WAAW,EACT;AAJS;AApER;AAHiB,CAAT,CAAjB;;;;"}
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 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 seems not to be working properly in the canvas as of\n // `react-awesome-reveal@3.8.1`\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` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther. Only applied to \"fade\" Effect and \"down\", \"left\", \"right\" and \"up\" directions`,\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 (defaults to 0.5)\",\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n },\n direction: {\n type: \"choice\",\n options: [\n \"horizontal\",\n \"vertical\",\n \"bottom-left\",\n \"bottom-right\",\n \"down\",\n \"left\",\n \"right\",\n \"top-left\",\n \"top-right\",\n \"up\",\n ],\n defaultValue: \"up\",\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 (defaults to 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 },\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. Not applied to \"hinge\" and \"jackinthebox\" effects`,\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 },\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","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","type","description","defaultValue","src","damping","delay","direction","options","duration","map","v","reverse","triggerOnce","registerReveal","loader","customRevealMeta","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAeA,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;AAM5B;AACA;;AACA;AACAC,EAAAA,MAAM,EAAEC,yBAToB;AAU5BC,EAAAA,KAAK,EAAEC,wBAVqB;AAW5BC,EAAAA,IAAI,EAAEC;AAXsB,CAA9B;AAgBA,IAAMC,OAAO,gBAAGC,MAAM,CAACC,IAAP,CAAYnB,qBAAZ,CAAhB;SAOgBoB;yBAASC;MAAAA,kCAAS;MAAQC,iBAA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D,EAAS+B,gBAAT,WAASA,gBAAT,GAA6BpB,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={bounce:i.Bounce,fade:i.Fade,flip:i.Flip,hinge:i.Hinge,jackinthebox:i.JackInTheBox,rotate:i.Rotate,slide:i.Slide,zoom:i.Zoom},o=Object.keys(n);function r(e){var t=e.effect,i=void 0===t?"fade":t,r=e.className,l=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,["effect","className"]),s=n[i];if(!s)throw new Error("Please specify a valid effect: "+o.join(", "));var c=l.cascade||!["string","number","boolean"].includes(typeof l.children)?l.children:a.createElement("div",null," ",l.children," ");return a.createElement(s,Object.assign({className:r},l,{children:c}))}t(r,{name:"Reveal",importPath:"@plasmicpkgs/react-awesome-reveal",props:{cascade:{type:"boolean",displayName:"Cascade",description:"Stagger its children animations"},children:{type:"slot",defaultValue:"Reveal text"},damping:{type:"number",displayName:"Damping",description:"Factor that affects the delay that each animated element in a cascade animation will be assigned (defaults to 0.5)"},delay:{type:"number",displayName:"Delay",description:"Initial delay, in milliseconds"},direction:{type:"choice",options:["horizontal","vertical","bottom-left","bottom-right","down","left","right","top-left","top-right","up"],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 (defaults to 1000)"},effect:{type:"choice",options:o.map((function(e){return e})),displayName:"Effect",description:"The Reveal animation effect to be applied"},reverse:{type:"boolean",displayName:"Reverse",description:'Whether the animation should make element(s) disappear. Not applied to "hinge" and "jackinthebox" effects'},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"}}}),exports.Reveal=r;
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={bounce:i.Bounce,fade:i.Fade,flip:i.Flip,hinge:i.Hinge,jackinthebox:i.JackInTheBox,rotate:i.Rotate,slide:i.Slide,zoom:i.Zoom},o=Object.keys(n);function r(e){var t=e.effect,i=void 0===t?"fade":t,r=e.className,l=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,["effect","className"]),s=n[i];if(!s)throw new Error("Please specify a valid effect: "+o.join(", "));var c=l.cascade||!["string","number","boolean"].includes(typeof l.children)?l.children:a.createElement("div",null," ",l.children," ");return a.createElement(s,Object.assign({className:r},l,{children:c}))}var l={name:"hostless-reveal",importName:"Reveal",displayName:"Reveal",importPath:"@plasmicpkgs/react-awesome-reveal",props:{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 (defaults to 0.5)"},delay:{type:"number",displayName:"Delay",description:"Initial delay, in milliseconds"},direction:{type:"choice",options:["horizontal","vertical","bottom-left","bottom-right","down","left","right","top-left","top-right","up"],defaultValue:"up",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 (defaults to 1000)"},effect:{type:"choice",options:o.map((function(e){return e})),displayName:"Effect",description:"The Reveal animation effect to be applied"},reverse:{type:"boolean",displayName:"Reverse",description:'Whether the animation should make element(s) disappear. Not applied to "hinge" and "jackinthebox" effects'},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"}}};exports.Reveal=r,exports.registerReveal=function(e,a){e?e.registerComponent(r,null!=a?a:l):t(r,null!=a?a:l)},exports.revealMeta=l;
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 from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\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 seems not to be working properly in the canvas as of\n // `react-awesome-reveal@3.8.1`\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 function Reveal({\n effect = \"fade\",\n className,\n ...props\n}: React.ComponentProps<typeof Fade> & {\n className?: string;\n effect?: Effect;\n}) {\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\nregisterComponent(Reveal, {\n name: \"Reveal\",\n importPath: \"@plasmicpkgs/react-awesome-reveal\",\n props: {\n // `big` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther. Only applied to \"fade\" Effect and \"down\", \"left\", \"right\" and \"up\" directions`,\n }, */\n cascade: {\n type: \"boolean\",\n displayName: \"Cascade\",\n description: \"Stagger its children animations\",\n },\n children: {\n type: \"slot\",\n defaultValue: \"Reveal text\",\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 (defaults to 0.5)\",\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n },\n direction: {\n type: \"choice\",\n options: [\n \"horizontal\",\n \"vertical\",\n \"bottom-left\",\n \"bottom-right\",\n \"down\",\n \"left\",\n \"right\",\n \"top-left\",\n \"top-right\",\n \"up\",\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 (defaults to 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 },\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. Not applied to \"hinge\" and \"jackinthebox\" effects`,\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 },\n },\n});\n"],"names":["effectNameToComponent","bounce","Bounce","fade","Fade","flip","Flip","hinge","Hinge","jackinthebox","JackInTheBox","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","className","props","Comp","Error","join","children","cascade","includes","React","registerComponent","name","importPath","type","displayName","description","defaultValue","damping","delay","direction","options","duration","map","v","reverse","triggerOnce"],"mappings":"yPAaMA,EAAwB,CAC5BC,OAAQC,SACRC,KAAMC,OACNC,KAAMC,OACNC,MAAOC,QACPC,aAAcC,eAIdC,OAAQC,SACRC,MAAOC,QACPC,KAAMC,QAKFC,EAAUC,OAAOC,KAAKnB,YAEZoB,aACdC,OAAAA,aAAS,SACTC,IAAAA,UACGC,+JAKGC,EAAOxB,EAAsBqB,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,KAG1DI,EAAkBX,EAAQ,CACxBY,KAAM,SACNC,WAAY,oCACZV,MAAO,CAOLK,QAAS,CACPM,KAAM,UACNC,YAAa,UACbC,YAAa,mCAEfT,SAAU,CACRO,KAAM,OACNG,aAAc,eAEhBC,QAAS,CACPJ,KAAM,SACNC,YAAa,UACbC,YACE,sHAEJG,MAAO,CACLL,KAAM,SACNC,YAAa,QACbC,YAAa,kCAEfI,UAAW,CACTN,KAAM,SACNO,QAAS,CACP,aACA,WACA,cACA,eACA,OACA,OACA,QACA,WACA,YACA,MAEFN,YAAa,YACbC,YACE,0EAEJM,SAAU,CACRR,KAAM,SACNC,YAAa,WACbC,YAAa,0DAEff,OAAQ,CACNa,KAAM,SACNO,QAASxB,EAAQ0B,KAAI,SAACC,UAAMA,KAC5BT,YAAa,SACbC,YAAa,6CASfS,QAAS,CACPX,KAAM,UACNC,YAAa,UACbC,yHAEFU,YAAa,CACXZ,KAAM,UACNC,YAAa,eACbC,YACE"}
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 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 seems not to be working properly in the canvas as of\n // `react-awesome-reveal@3.8.1`\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` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther. Only applied to \"fade\" Effect and \"down\", \"left\", \"right\" and \"up\" directions`,\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 (defaults to 0.5)\",\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n },\n direction: {\n type: \"choice\",\n options: [\n \"horizontal\",\n \"vertical\",\n \"bottom-left\",\n \"bottom-right\",\n \"down\",\n \"left\",\n \"right\",\n \"top-left\",\n \"top-right\",\n \"up\",\n ],\n defaultValue: \"up\",\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 (defaults to 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 },\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. Not applied to \"hinge\" and \"jackinthebox\" effects`,\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 },\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","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","type","description","defaultValue","src","damping","delay","direction","options","duration","map","v","reverse","triggerOnce","loader","customRevealMeta","registerComponent"],"mappings":"yPAeMA,EAAwB,CAC5BC,OAAQC,SACRC,KAAMC,OACNC,KAAMC,OACNC,MAAOC,QACPC,aAAcC,eAIdC,OAAQC,SACRC,MAAOC,QACPC,KAAMC,QAKFC,EAAUC,OAAOC,KAAKnB,YAOZoB,aAASC,OAAAA,aAAS,SAAQC,IAAAA,UAAcC,+JAChDC,EAAOxB,EAAsBqB,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,oCACZZ,MAAO,CAOLK,QAAS,CACPQ,KAAM,UACNF,YAAa,UACbG,YAAa,mCAEfV,SAAU,CACRS,KAAM,OACNE,aAAc,CACZ,CACEF,KAAM,MACNG,IAAK,qCAIXC,QAAS,CACPJ,KAAM,SACNF,YAAa,UACbG,YACE,sHAEJI,MAAO,CACLL,KAAM,SACNF,YAAa,QACbG,YAAa,kCAEfK,UAAW,CACTN,KAAM,SACNO,QAAS,CACP,aACA,WACA,cACA,eACA,OACA,OACA,QACA,WACA,YACA,MAEFL,aAAc,KACdJ,YAAa,YACbG,YACE,0EAEJO,SAAU,CACRR,KAAM,SACNF,YAAa,WACbG,YAAa,0DAEfhB,OAAQ,CACNe,KAAM,SACNO,QAAS1B,EAAQ4B,KAAI,SAACC,UAAMA,KAC5BZ,YAAa,SACbG,YAAa,6CASfU,QAAS,CACPX,KAAM,UACNF,YAAa,UACbG,yHAEFW,YAAa,CACXZ,KAAM,UACNF,YAAa,eACbG,YACE,4KAMNY,EACAC,GAEID,EACFA,EAAOE,kBAAkB/B,QAAQ8B,EAAAA,EAAoBnB,GAErDoB,EAAkB/B,QAAQ8B,EAAAA,EAAoBnB"}
@@ -54,8 +54,10 @@ function Reveal(_ref) {
54
54
  children: children
55
55
  }));
56
56
  }
57
- registerComponent(Reveal, {
58
- name: "Reveal",
57
+ var revealMeta = {
58
+ name: "hostless-reveal",
59
+ importName: "Reveal",
60
+ displayName: "Reveal",
59
61
  importPath: "@plasmicpkgs/react-awesome-reveal",
60
62
  props: {
61
63
  // `big` seems not to be working properly as of `react-awesome-reveal@3.8.1`
@@ -72,7 +74,10 @@ registerComponent(Reveal, {
72
74
  },
73
75
  children: {
74
76
  type: "slot",
75
- defaultValue: "Reveal text"
77
+ defaultValue: [{
78
+ type: "img",
79
+ src: "https://placekitten.com/300/200"
80
+ }]
76
81
  },
77
82
  damping: {
78
83
  type: "number",
@@ -87,6 +92,7 @@ registerComponent(Reveal, {
87
92
  direction: {
88
93
  type: "choice",
89
94
  options: ["horizontal", "vertical", "bottom-left", "bottom-right", "down", "left", "right", "top-left", "top-right", "up"],
95
+ defaultValue: "up",
90
96
  displayName: "Direction",
91
97
  description: "Origin of the animation (the valid values depend on the chosen Effect)"
92
98
  },
@@ -97,7 +103,7 @@ registerComponent(Reveal, {
97
103
  },
98
104
  effect: {
99
105
  type: "choice",
100
- options: effects.map(function (v) {
106
+ options: /*#__PURE__*/effects.map(function (v) {
101
107
  return v;
102
108
  }),
103
109
  displayName: "Effect",
@@ -122,7 +128,14 @@ registerComponent(Reveal, {
122
128
  description: "Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport"
123
129
  }
124
130
  }
125
- });
131
+ };
132
+ function registerReveal(loader, customRevealMeta) {
133
+ if (loader) {
134
+ loader.registerComponent(Reveal, customRevealMeta != null ? customRevealMeta : revealMeta);
135
+ } else {
136
+ registerComponent(Reveal, customRevealMeta != null ? customRevealMeta : revealMeta);
137
+ }
138
+ }
126
139
 
127
- export { Reveal };
140
+ export { Reveal, registerReveal, revealMeta };
128
141
  //# sourceMappingURL=react-awesome-reveal.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-awesome-reveal.esm.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\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 seems not to be working properly in the canvas as of\n // `react-awesome-reveal@3.8.1`\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 function Reveal({\n effect = \"fade\",\n className,\n ...props\n}: React.ComponentProps<typeof Fade> & {\n className?: string;\n effect?: Effect;\n}) {\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\nregisterComponent(Reveal, {\n name: \"Reveal\",\n importPath: \"@plasmicpkgs/react-awesome-reveal\",\n props: {\n // `big` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther. Only applied to \"fade\" Effect and \"down\", \"left\", \"right\" and \"up\" directions`,\n }, */\n cascade: {\n type: \"boolean\",\n displayName: \"Cascade\",\n description: \"Stagger its children animations\",\n },\n children: {\n type: \"slot\",\n defaultValue: \"Reveal text\",\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 (defaults to 0.5)\",\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n },\n direction: {\n type: \"choice\",\n options: [\n \"horizontal\",\n \"vertical\",\n \"bottom-left\",\n \"bottom-right\",\n \"down\",\n \"left\",\n \"right\",\n \"top-left\",\n \"top-right\",\n \"up\",\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 (defaults to 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 },\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. Not applied to \"hinge\" and \"jackinthebox\" effects`,\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 },\n },\n});\n"],"names":["effectNameToComponent","bounce","Bounce","fade","Fade","flip","Flip","hinge","Hinge","jackinthebox","JackInTheBox","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","className","props","Comp","Error","join","children","cascade","includes","React","registerComponent","name","importPath","type","displayName","description","defaultValue","damping","delay","direction","options","duration","map","v","reverse","triggerOnce"],"mappings":";;;;;;;;;;;;;;;;;;;AAaA,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;AAM5B;AACA;;AACA;AACAC,EAAAA,MAAM,EAAEC,MAToB;AAU5BC,EAAAA,KAAK,EAAEC,KAVqB;AAW5BC,EAAAA,IAAI,EAAEC;AAXsB,CAA9B;AAgBA,IAAMC,OAAO,gBAAGC,MAAM,CAACC,IAAP,CAAYnB,qBAAZ,CAA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AAA,SAAS,EAAE;AACTN,MAAAA,IAAI,EAAE,QADG;AAETO,MAAAA,OAAO,EAAE,CACP,YADO,EAEP,UAFO,EAGP,aAHO,EAIP,cAJO,EAKP,MALO,EAMP,MANO,EAOP,OAPO,EAQP,UARO,EASP,WATO,EAUP,IAVO,CAFA;AAcTN,MAAAA,WAAW,EAAE,WAdJ;AAeTC,MAAAA,WAAW,EACT;AAhBO,KA3BN;AA6CLM,IAAAA,QAAQ,EAAE;AACRR,MAAAA,IAAI,EAAE,QADE;AAERC,MAAAA,WAAW,EAAE,UAFL;AAGRC,MAAAA,WAAW,EAAE;AAHL,KA7CL;AAkDLf,IAAAA,MAAM,EAAE;AACNa,MAAAA,IAAI,EAAE,QADA;AAENO,MAAAA,OAAO,EAAExB,OAAO,CAAC0B,GAAR,CAAY,UAACC,CAAD;AAAA,eAAOA,CAAP;AAAA,OAAZ,CAFH;AAGNT,MAAAA,WAAW,EAAE,QAHP;AAINC,MAAAA,WAAW,EAAE;AAJP,KAlDH;AAwDL;;AACA;;;;;;AAMAS,IAAAA,OAAO,EAAE;AACPX,MAAAA,IAAI,EAAE,SADC;AAEPC,MAAAA,WAAW,EAAE,SAFN;AAGPC,MAAAA,WAAW;AAHJ,KA/DJ;AAoELU,IAAAA,WAAW,EAAE;AACXZ,MAAAA,IAAI,EAAE,SADK;AAEXC,MAAAA,WAAW,EAAE,cAFF;AAGXC,MAAAA,WAAW,EACT;AAJS;AApER;AAHiB,CAAT,CAAjB;;;;"}
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 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 seems not to be working properly in the canvas as of\n // `react-awesome-reveal@3.8.1`\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` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther. Only applied to \"fade\" Effect and \"down\", \"left\", \"right\" and \"up\" directions`,\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 (defaults to 0.5)\",\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n },\n direction: {\n type: \"choice\",\n options: [\n \"horizontal\",\n \"vertical\",\n \"bottom-left\",\n \"bottom-right\",\n \"down\",\n \"left\",\n \"right\",\n \"top-left\",\n \"top-right\",\n \"up\",\n ],\n defaultValue: \"up\",\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 (defaults to 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 },\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. Not applied to \"hinge\" and \"jackinthebox\" effects`,\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 },\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","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","type","description","defaultValue","src","damping","delay","direction","options","duration","map","v","reverse","triggerOnce","registerReveal","loader","customRevealMeta","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;AAeA,IAAMA,qBAAqB,GAAG;AAC5BC,EAAAA,MAAM,EAAEC,MADoB;AAE5BC,EAAAA,IAAI,EAAEC,IAFsB;AAG5BC,EAAAA,IAAI,EAAEC,IAHsB;AAI5BC,EAAAA,KAAK,EAAEC,KAJqB;AAK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AEXF,MAAAA,WAAW,EAAE,cAFF;AAGXG,MAAAA,WAAW,EACT;AAJS;AA1ER;AAL6C;SAwFtCY,eACdC,QACAC;AAEA,MAAID,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyBhC,MAAzB,EAAiC+B,gBAAjC,WAAiCA,gBAAjC,GAAqDpB,UAArD;AACD,GAFD,MAEO;AACLqB,IAAAA,iBAAiB,CAAChC,MAAD,EAAS+B,gBAAT,WAASA,gBAAT,GAA6BpB,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",
3
+ "version": "3.8.4",
4
4
  "description": "Plasmic registration call for react-awesome-reveal",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",