@plasmicpkgs/react-awesome-reveal 3.8.2 → 3.8.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/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: {
@@ -12,8 +13,13 @@ declare const effectNameToComponent: {
12
13
  readonly zoom: React.FC<import("react-awesome-reveal").ZoomProps>;
13
14
  };
14
15
  declare type Effect = keyof typeof effectNameToComponent;
15
- export declare function Reveal({ effect, className, ...props }: React.ComponentProps<typeof Fade> & {
16
+ export interface RevealProps extends React.ComponentProps<typeof Fade> {
16
17
  className?: string;
17
18
  effect?: Effect;
18
- }): JSX.Element;
19
+ }
20
+ export declare function Reveal({ effect, className, ...props }: RevealProps): JSX.Element;
21
+ export declare const revealMeta: ComponentMeta<RevealProps>;
22
+ export declare function registerReveal(loader?: {
23
+ registerComponent: typeof registerComponent;
24
+ }, customRevealMeta?: ComponentMeta<RevealProps>): void;
19
25
  export {};
@@ -38,6 +38,7 @@ var effects = /*#__PURE__*/Object.keys(effectNameToComponent);
38
38
  function Reveal(_ref) {
39
39
  var _ref$effect = _ref.effect,
40
40
  effect = _ref$effect === void 0 ? "fade" : _ref$effect,
41
+ className = _ref.className,
41
42
  props = _objectWithoutPropertiesLoose(_ref, ["effect", "className"]);
42
43
 
43
44
  var Comp = effectNameToComponent[effect];
@@ -50,21 +51,26 @@ function Reveal(_ref) {
50
51
 
51
52
 
52
53
  var children = props.cascade || !["string", "number", "boolean"].includes(typeof props.children) ? props.children : React.createElement("div", null, " ", props.children, " ");
53
- return React.createElement(Comp, Object.assign({}, props, {
54
+ return React.createElement(Comp, Object.assign({
55
+ className: className
56
+ }, props, {
54
57
  children: children
55
58
  }));
56
59
  }
57
- registerComponent(Reveal, {
58
- name: "Reveal",
60
+ var revealMeta = {
61
+ name: "hostless-reveal",
62
+ importName: "Reveal",
63
+ displayName: "Reveal",
59
64
  importPath: "@plasmicpkgs/react-awesome-reveal",
60
65
  props: {
61
- // `big` seems not to be working properly as of `react-awesome-reveal@3.8.1`
62
-
63
- /* big: {
64
- type: "boolean",
65
- displayName: "Big",
66
- description: `Causes the animation to start farther. Only applied to "fade" Effect and "down", "left", "right" and "up" directions`,
67
- }, */
66
+ big: {
67
+ type: "boolean",
68
+ displayName: "Big",
69
+ description: "Causes the animation to start farther",
70
+ hidden: function hidden(props) {
71
+ return (props.effect || "fade") !== "fade" || !["down", "left", "up", "right"].includes(props.direction);
72
+ }
73
+ },
68
74
  cascade: {
69
75
  type: "boolean",
70
76
  displayName: "Cascade",
@@ -72,39 +78,55 @@ registerComponent(Reveal, {
72
78
  },
73
79
  children: {
74
80
  type: "slot",
75
- defaultValue: "Reveal text"
81
+ defaultValue: [{
82
+ type: "img",
83
+ src: "https://placekitten.com/300/200"
84
+ }]
85
+ },
86
+ damping: {
87
+ type: "number",
88
+ displayName: "Damping",
89
+ description: "Factor that affects the delay that each animated element in a cascade animation will be assigned",
90
+ defaultValueHint: 0.5
76
91
  },
77
- // Keeping only basic props for now
78
-
79
- /* damping: {
80
- type: "number",
81
- displayName: "Damping",
82
- description:
83
- "Factor that affects the delay that each animated element in a cascade animation will be assigned (defaults to 0.5)",
84
- }, */
85
92
  delay: {
86
93
  type: "number",
87
94
  displayName: "Delay",
88
- description: "Initial delay, in milliseconds"
95
+ description: "Initial delay, in milliseconds",
96
+ defaultValueHint: 0
89
97
  },
90
98
  direction: {
91
99
  type: "choice",
92
- options: ["horizontal", "vertical", "bottom-left", "bottom-right", "down", "left", "right", "top-left", "top-right", "up"],
100
+ options: function options(props) {
101
+ var effect = props.effect || "fade";
102
+
103
+ var maybeAddOptions = function maybeAddOptions(effects, options) {
104
+ return effects.includes(effect) ? options : [];
105
+ };
106
+
107
+ return [].concat(maybeAddOptions(["flip"], ["horizontal", "vertical"])).concat(maybeAddOptions(["bounce", "fade", "slide", "zoom"], ["down", "left", "right", "up"])).concat(maybeAddOptions(["fade", "rotate"], ["bottom-left", "bottom-right", "top-left", "top-right"]));
108
+ },
109
+ hidden: function hidden(props) {
110
+ var effect = props.effect || "fade";
111
+ return ["hinge", "jackinthebox", "roll"].includes(effect);
112
+ },
93
113
  displayName: "Direction",
94
114
  description: "Origin of the animation (the valid values depend on the chosen Effect)"
95
115
  },
96
116
  duration: {
97
117
  type: "number",
98
118
  displayName: "Duration",
99
- description: "Animation duration, in milliseconds (defaults to 1000)"
119
+ description: "Animation duration, in milliseconds",
120
+ defaultValueHint: 1000
100
121
  },
101
122
  effect: {
102
123
  type: "choice",
103
- options: effects.map(function (v) {
124
+ options: /*#__PURE__*/effects.map(function (v) {
104
125
  return v;
105
126
  }),
106
127
  displayName: "Effect",
107
- description: "The Reveal animation effect to be applied"
128
+ description: "The Reveal animation effect to be applied",
129
+ defaultValueHint: "fade"
108
130
  },
109
131
  // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`
110
132
 
@@ -117,15 +139,29 @@ registerComponent(Reveal, {
117
139
  reverse: {
118
140
  type: "boolean",
119
141
  displayName: "Reverse",
120
- description: "Whether the animation should make element(s) disappear. Not applied to \"hinge\" and \"jackinthebox\" effects"
142
+ description: "Whether the animation should make element(s) disappear",
143
+ hidden: function hidden(props) {
144
+ return ["hinge", "jackinthebox"].includes(props.effect || "fade");
145
+ }
121
146
  },
122
147
  triggerOnce: {
123
148
  type: "boolean",
124
149
  displayName: "Trigger Once",
125
- description: "Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport"
150
+ description: "Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport",
151
+ // Some effects don't work correctly when `false`
152
+ defaultValue: true
126
153
  }
127
154
  }
128
- });
155
+ };
156
+ function registerReveal(loader, customRevealMeta) {
157
+ if (loader) {
158
+ loader.registerComponent(Reveal, customRevealMeta != null ? customRevealMeta : revealMeta);
159
+ } else {
160
+ registerComponent(Reveal, customRevealMeta != null ? customRevealMeta : revealMeta);
161
+ }
162
+ }
129
163
 
130
164
  exports.Reveal = Reveal;
165
+ exports.registerReveal = registerReveal;
166
+ exports.revealMeta = revealMeta;
131
167
  //# 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 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 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 {...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 // Keeping only basic props for now\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","roll","Roll","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","props","Comp","Error","join","children","cascade","includes","React","registerComponent","name","importPath","type","displayName","description","defaultValue","delay","direction","options","duration","map","v","reverse","triggerOnce"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAcA,IAAMA,qBAAqB,GA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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,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,EAAgC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ule",{value:!0});var t=e(require("@plasmicapp/host/registerComponent")),i=e(require("react")),n=require("react-awesome-reveal"),a={bounce:n.Bounce,fade:n.Fade,flip:n.Flip,hinge:n.Hinge,jackinthebox:n.JackInTheBox,roll:n.Roll,rotate:n.Rotate,slide:n.Slide,zoom:n.Zoom},o=Object.keys(a);function r(e){var t=e.effect,n=void 0===t?"fade":t,r=function(e,t){if(null==e)return{};var i,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(i=o[n])>=0||(a[i]=e[i]);return a}(e,["effect","className"]),l=a[n];if(!l)throw new Error("Please specify a valid effect: "+o.join(", "));var c=r.cascade||!["string","number","boolean"].includes(typeof r.children)?r.children:i.createElement("div",null," ",r.children," ");return i.createElement(l,Object.assign({},r,{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"},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,roll:i.Roll,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"]),c=n[i];if(!c)throw new Error("Please specify a valid effect: "+o.join(", "));var s=l.cascade||!["string","number","boolean"].includes(typeof l.children)?l.children:a.createElement("div",null," ",l.children," ");return a.createElement(c,Object.assign({className:r},l,{children:s}))}var l={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:o.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=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 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 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 {...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 // Keeping only basic props for now\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","roll","Roll","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","props","Comp","Error","join","children","cascade","includes","React","registerComponent","name","importPath","type","displayName","description","defaultValue","delay","direction","options","duration","map","v","reverse","triggerOnce"],"mappings":"yPAcMA,EAAwB,CAC5BC,OAAQC,SACRC,KAAMC,OACNC,KAAMC,OACNC,MAAOC,QACPC,aAAcC,eACdC,KAAMC,OACNC,OAAQC,SACRC,MAAOC,QACPC,KAAMC,QAKFC,EAAUC,OAAOC,KAAKrB,YAEZsB,aACdC,OAAAA,aAAS,SAENC,+JAKGC,EAAOzB,EAAsBuB,OAC9BE,QACG,IAAIC,wCAAwCP,EAAQQ,KAAK,WAK3DC,EACJJ,EAAMK,UACL,CAAC,SAAU,SAAU,WAAWC,gBAAgBN,EAAMI,UACrDJ,EAAMI,SAENG,+BAAOP,EAAMI,qBAEVG,gBAACN,mBAASD,GAAOI,SAAUA,KAGpCI,EAAkBV,EAAQ,CACxBW,KAAM,SACNC,WAAY,oCACZV,MAAO,CAOLK,QAAS,CACPM,KAAM,UACNC,YAAa,UACbC,YAAa,mCAEfT,SAAU,CACRO,KAAM,OACNG,aAAc,eAShBC,MAAO,CACLJ,KAAM,SACNC,YAAa,QACbC,YAAa,kCAEfG,UAAW,CACTL,KAAM,SACNM,QAAS,CACP,aACA,WACA,cACA,eACA,OACA,OACA,QACA,WACA,YACA,MAEFL,YAAa,YACbC,YACE,0EAEJK,SAAU,CACRP,KAAM,SACNC,YAAa,WACbC,YAAa,0DAEfd,OAAQ,CACNY,KAAM,SACNM,QAAStB,EAAQwB,KAAI,SAACC,UAAMA,KAC5BR,YAAa,SACbC,YAAa,6CASfQ,QAAS,CACPV,KAAM,UACNC,YAAa,UACbC,yHAEFS,YAAa,CACXX,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 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":"yPAgBMA,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,+JAChDC,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,oCACZZ,MAAO,CACLa,IAAK,CACHC,KAAM,UACNH,YAAa,MACbI,oDACAC,OAAQ,SAAChB,SACsB,UAA5BA,EAAMF,QAAU,UAChB,CAAC,OAAQ,OAAQ,KAAM,SAASQ,SAASN,EAAMiB,aAEpDZ,QAAS,CACPS,KAAM,UACNH,YAAa,UACbI,YAAa,mCAEfX,SAAU,CACRU,KAAM,OACNI,aAAc,CACZ,CACEJ,KAAM,MACNK,IAAK,qCAIXC,QAAS,CACPN,KAAM,SACNH,YAAa,UACbI,YACE,mGACFM,iBAAkB,IAEpBC,MAAO,CACLR,KAAM,SACNH,YAAa,QACbI,YAAa,iCACbM,iBAAkB,GAEpBJ,UAAW,CACTH,KAAM,SACNS,QAAS,SAACvB,OACFF,EAASE,EAAMF,QAAU,OACzB0B,EAAkB,SAAC9B,EAAmB6B,UAC1C7B,EAAQY,SAASR,GAAUyB,EAAU,UAC/B,GACLE,OAAOD,EAAgB,CAAC,QAAS,CAAC,aAAc,cAChDC,OACCD,EACE,CAAC,SAAU,OAAQ,QAAS,QAC5B,CAAC,OAAQ,OAAQ,QAAS,QAG7BC,OACCD,EACE,CAAC,OAAQ,UACT,CAAC,cAAe,eAAgB,WAAY,gBAIpDR,OAAQ,SAAChB,SAEA,CAAC,QAAS,eAAgB,QAAQM,SAD1BN,EAAMF,QAAU,SAGjCa,YAAa,YACbI,YACE,0EAEJW,SAAU,CACRZ,KAAM,SACNH,YAAa,WACbI,YAAa,sCACbM,iBAAkB,KAEpBvB,OAAQ,CACNgB,KAAM,SACNS,QAAS7B,EAAQiC,KAAI,SAACC,UAAMA,KAC5BjB,YAAa,SACbI,YAAa,4CACbM,iBAAkB,QASpBQ,QAAS,CACPf,KAAM,UACNH,YAAa,UACbI,qEACAC,OAAQ,SAAChB,SACP,CAAC,QAAS,gBAAgBM,SAASN,EAAMF,QAAU,UAEvDgC,YAAa,CACXhB,KAAM,UACNH,YAAa,eACbI,YACE,wHAEFG,cAAc,sDAMlBa,EACAC,GAEID,EACFA,EAAOE,kBAAkBpC,QAAQmC,EAAAA,EAAoBxB,GAErDyB,EAAkBpC,QAAQmC,EAAAA,EAAoBxB"}
@@ -32,6 +32,7 @@ var effects = /*#__PURE__*/Object.keys(effectNameToComponent);
32
32
  function Reveal(_ref) {
33
33
  var _ref$effect = _ref.effect,
34
34
  effect = _ref$effect === void 0 ? "fade" : _ref$effect,
35
+ className = _ref.className,
35
36
  props = _objectWithoutPropertiesLoose(_ref, ["effect", "className"]);
36
37
 
37
38
  var Comp = effectNameToComponent[effect];
@@ -44,21 +45,26 @@ function Reveal(_ref) {
44
45
 
45
46
 
46
47
  var children = props.cascade || !["string", "number", "boolean"].includes(typeof props.children) ? props.children : React.createElement("div", null, " ", props.children, " ");
47
- return React.createElement(Comp, Object.assign({}, props, {
48
+ return React.createElement(Comp, Object.assign({
49
+ className: className
50
+ }, props, {
48
51
  children: children
49
52
  }));
50
53
  }
51
- registerComponent(Reveal, {
52
- name: "Reveal",
54
+ var revealMeta = {
55
+ name: "hostless-reveal",
56
+ importName: "Reveal",
57
+ displayName: "Reveal",
53
58
  importPath: "@plasmicpkgs/react-awesome-reveal",
54
59
  props: {
55
- // `big` seems not to be working properly as of `react-awesome-reveal@3.8.1`
56
-
57
- /* big: {
58
- type: "boolean",
59
- displayName: "Big",
60
- description: `Causes the animation to start farther. Only applied to "fade" Effect and "down", "left", "right" and "up" directions`,
61
- }, */
60
+ big: {
61
+ type: "boolean",
62
+ displayName: "Big",
63
+ description: "Causes the animation to start farther",
64
+ hidden: function hidden(props) {
65
+ return (props.effect || "fade") !== "fade" || !["down", "left", "up", "right"].includes(props.direction);
66
+ }
67
+ },
62
68
  cascade: {
63
69
  type: "boolean",
64
70
  displayName: "Cascade",
@@ -66,39 +72,55 @@ registerComponent(Reveal, {
66
72
  },
67
73
  children: {
68
74
  type: "slot",
69
- defaultValue: "Reveal text"
75
+ defaultValue: [{
76
+ type: "img",
77
+ src: "https://placekitten.com/300/200"
78
+ }]
79
+ },
80
+ damping: {
81
+ type: "number",
82
+ displayName: "Damping",
83
+ description: "Factor that affects the delay that each animated element in a cascade animation will be assigned",
84
+ defaultValueHint: 0.5
70
85
  },
71
- // Keeping only basic props for now
72
-
73
- /* damping: {
74
- type: "number",
75
- displayName: "Damping",
76
- description:
77
- "Factor that affects the delay that each animated element in a cascade animation will be assigned (defaults to 0.5)",
78
- }, */
79
86
  delay: {
80
87
  type: "number",
81
88
  displayName: "Delay",
82
- description: "Initial delay, in milliseconds"
89
+ description: "Initial delay, in milliseconds",
90
+ defaultValueHint: 0
83
91
  },
84
92
  direction: {
85
93
  type: "choice",
86
- options: ["horizontal", "vertical", "bottom-left", "bottom-right", "down", "left", "right", "top-left", "top-right", "up"],
94
+ options: function options(props) {
95
+ var effect = props.effect || "fade";
96
+
97
+ var maybeAddOptions = function maybeAddOptions(effects, options) {
98
+ return effects.includes(effect) ? options : [];
99
+ };
100
+
101
+ return [].concat(maybeAddOptions(["flip"], ["horizontal", "vertical"])).concat(maybeAddOptions(["bounce", "fade", "slide", "zoom"], ["down", "left", "right", "up"])).concat(maybeAddOptions(["fade", "rotate"], ["bottom-left", "bottom-right", "top-left", "top-right"]));
102
+ },
103
+ hidden: function hidden(props) {
104
+ var effect = props.effect || "fade";
105
+ return ["hinge", "jackinthebox", "roll"].includes(effect);
106
+ },
87
107
  displayName: "Direction",
88
108
  description: "Origin of the animation (the valid values depend on the chosen Effect)"
89
109
  },
90
110
  duration: {
91
111
  type: "number",
92
112
  displayName: "Duration",
93
- description: "Animation duration, in milliseconds (defaults to 1000)"
113
+ description: "Animation duration, in milliseconds",
114
+ defaultValueHint: 1000
94
115
  },
95
116
  effect: {
96
117
  type: "choice",
97
- options: effects.map(function (v) {
118
+ options: /*#__PURE__*/effects.map(function (v) {
98
119
  return v;
99
120
  }),
100
121
  displayName: "Effect",
101
- description: "The Reveal animation effect to be applied"
122
+ description: "The Reveal animation effect to be applied",
123
+ defaultValueHint: "fade"
102
124
  },
103
125
  // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`
104
126
 
@@ -111,15 +133,27 @@ registerComponent(Reveal, {
111
133
  reverse: {
112
134
  type: "boolean",
113
135
  displayName: "Reverse",
114
- description: "Whether the animation should make element(s) disappear. Not applied to \"hinge\" and \"jackinthebox\" effects"
136
+ description: "Whether the animation should make element(s) disappear",
137
+ hidden: function hidden(props) {
138
+ return ["hinge", "jackinthebox"].includes(props.effect || "fade");
139
+ }
115
140
  },
116
141
  triggerOnce: {
117
142
  type: "boolean",
118
143
  displayName: "Trigger Once",
119
- description: "Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport"
144
+ description: "Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport",
145
+ // Some effects don't work correctly when `false`
146
+ defaultValue: true
120
147
  }
121
148
  }
122
- });
149
+ };
150
+ function registerReveal(loader, customRevealMeta) {
151
+ if (loader) {
152
+ loader.registerComponent(Reveal, customRevealMeta != null ? customRevealMeta : revealMeta);
153
+ } else {
154
+ registerComponent(Reveal, customRevealMeta != null ? customRevealMeta : revealMeta);
155
+ }
156
+ }
123
157
 
124
- export { Reveal };
158
+ export { Reveal, registerReveal, revealMeta };
125
159
  //# 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 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 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 {...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 // Keeping only basic props for now\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","roll","Roll","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","props","Comp","Error","join","children","cascade","includes","React","registerComponent","name","importPath","type","displayName","description","defaultValue","delay","direction","options","duration","map","v","reverse","triggerOnce"],"mappings":";;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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 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,EAAq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al",
3
- "version": "3.8.2",
3
+ "version": "3.8.6",
4
4
  "description": "Plasmic registration call for react-awesome-reveal",
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.32",
39
+ "@plasmicapp/host": "^1.0.0",
40
40
  "react-awesome-reveal": "^3.8.0"
41
41
  },
42
42
  "peerDependencies": {