@plasmicpkgs/react-awesome-reveal 3.8.4 → 3.8.9

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
@@ -7,6 +7,7 @@ declare const effectNameToComponent: {
7
7
  readonly flip: React.FC<import("react-awesome-reveal").FlipProps>;
8
8
  readonly hinge: React.FC<Pick<import("react-awesome-reveal").RevealProps, "cascade" | "damping" | "delay" | "duration" | "fraction" | "triggerOnce" | "className" | "style" | "childClassName" | "childStyle" | "onVisibilityChange">>;
9
9
  readonly jackinthebox: React.FC<Pick<import("react-awesome-reveal").RevealProps, "cascade" | "damping" | "delay" | "duration" | "fraction" | "triggerOnce" | "className" | "style" | "childClassName" | "childStyle" | "onVisibilityChange">>;
10
+ readonly roll: React.FC<import("react-awesome-reveal").RollProps>;
10
11
  readonly rotate: React.FC<import("react-awesome-reveal").RotateProps>;
11
12
  readonly slide: React.FC<import("react-awesome-reveal").SlideProps>;
12
13
  readonly zoom: React.FC<import("react-awesome-reveal").ZoomProps>;
@@ -23,16 +23,14 @@ function _objectWithoutPropertiesLoose(source, excluded) {
23
23
  return target;
24
24
  }
25
25
 
26
+ var _excluded = ["effect", "className"];
26
27
  var effectNameToComponent = {
27
28
  bounce: reactAwesomeReveal.Bounce,
28
29
  fade: reactAwesomeReveal.Fade,
29
30
  flip: reactAwesomeReveal.Flip,
30
31
  hinge: reactAwesomeReveal.Hinge,
31
32
  jackinthebox: reactAwesomeReveal.JackInTheBox,
32
- // Roll seems not to be working properly in the canvas as of
33
- // `react-awesome-reveal@3.8.1`
34
-
35
- /* roll: Roll, */
33
+ roll: reactAwesomeReveal.Roll,
36
34
  rotate: reactAwesomeReveal.Rotate,
37
35
  slide: reactAwesomeReveal.Slide,
38
36
  zoom: reactAwesomeReveal.Zoom
@@ -42,7 +40,7 @@ function Reveal(_ref) {
42
40
  var _ref$effect = _ref.effect,
43
41
  effect = _ref$effect === void 0 ? "fade" : _ref$effect,
44
42
  className = _ref.className,
45
- props = _objectWithoutPropertiesLoose(_ref, ["effect", "className"]);
43
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
46
44
 
47
45
  var Comp = effectNameToComponent[effect];
48
46
 
@@ -66,13 +64,14 @@ var revealMeta = {
66
64
  displayName: "Reveal",
67
65
  importPath: "@plasmicpkgs/react-awesome-reveal",
68
66
  props: {
69
- // `big` seems not to be working properly as of `react-awesome-reveal@3.8.1`
70
-
71
- /* big: {
72
- type: "boolean",
73
- displayName: "Big",
74
- description: `Causes the animation to start farther. Only applied to "fade" Effect and "down", "left", "right" and "up" directions`,
75
- }, */
67
+ big: {
68
+ type: "boolean",
69
+ displayName: "Big",
70
+ description: "Causes the animation to start farther",
71
+ hidden: function hidden(props) {
72
+ return (props.effect || "fade") !== "fade" || !["down", "left", "up", "right"].includes(props.direction);
73
+ }
74
+ },
76
75
  cascade: {
77
76
  type: "boolean",
78
77
  displayName: "Cascade",
@@ -88,24 +87,38 @@ var revealMeta = {
88
87
  damping: {
89
88
  type: "number",
90
89
  displayName: "Damping",
91
- description: "Factor that affects the delay that each animated element in a cascade animation will be assigned (defaults to 0.5)"
90
+ description: "Factor that affects the delay that each animated element in a cascade animation will be assigned",
91
+ defaultValueHint: 0.5
92
92
  },
93
93
  delay: {
94
94
  type: "number",
95
95
  displayName: "Delay",
96
- description: "Initial delay, in milliseconds"
96
+ description: "Initial delay, in milliseconds",
97
+ defaultValueHint: 0
97
98
  },
98
99
  direction: {
99
100
  type: "choice",
100
- options: ["horizontal", "vertical", "bottom-left", "bottom-right", "down", "left", "right", "top-left", "top-right", "up"],
101
- defaultValue: "up",
101
+ options: function options(props) {
102
+ var effect = props.effect || "fade";
103
+
104
+ var maybeAddOptions = function maybeAddOptions(effects, options) {
105
+ return effects.includes(effect) ? options : [];
106
+ };
107
+
108
+ 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"]));
109
+ },
110
+ hidden: function hidden(props) {
111
+ var effect = props.effect || "fade";
112
+ return ["hinge", "jackinthebox", "roll"].includes(effect);
113
+ },
102
114
  displayName: "Direction",
103
115
  description: "Origin of the animation (the valid values depend on the chosen Effect)"
104
116
  },
105
117
  duration: {
106
118
  type: "number",
107
119
  displayName: "Duration",
108
- description: "Animation duration, in milliseconds (defaults to 1000)"
120
+ description: "Animation duration, in milliseconds",
121
+ defaultValueHint: 1000
109
122
  },
110
123
  effect: {
111
124
  type: "choice",
@@ -113,7 +126,8 @@ var revealMeta = {
113
126
  return v;
114
127
  }),
115
128
  displayName: "Effect",
116
- description: "The Reveal animation effect to be applied"
129
+ description: "The Reveal animation effect to be applied",
130
+ defaultValueHint: "fade"
117
131
  },
118
132
  // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`
119
133
 
@@ -126,12 +140,17 @@ var revealMeta = {
126
140
  reverse: {
127
141
  type: "boolean",
128
142
  displayName: "Reverse",
129
- description: "Whether the animation should make element(s) disappear. Not applied to \"hinge\" and \"jackinthebox\" effects"
143
+ description: "Whether the animation should make element(s) disappear",
144
+ hidden: function hidden(props) {
145
+ return ["hinge", "jackinthebox"].includes(props.effect || "fade");
146
+ }
130
147
  },
131
148
  triggerOnce: {
132
149
  type: "boolean",
133
150
  displayName: "Trigger Once",
134
- description: "Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport"
151
+ description: "Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport",
152
+ // Some effects don't work correctly when `false`
153
+ defaultValue: true
135
154
  }
136
155
  }
137
156
  };
@@ -1 +1 @@
1
- {"version":3,"file":"react-awesome-reveal.cjs.development.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\n 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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ACPX,MAAAA,IAAI,EAAE,SADC;AAEPF,MAAAA,WAAW,EAAE,SAFN;AAGPG,MAAAA,WAAW;AAHJ,KArEJ;AA0ELW,IAAAA,WAAW,EAAE;AACXZ,MAAAA,IAAI,EAAE,SADK;AAEXF,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;;;;;;"}
1
+ {"version":3,"file":"react-awesome-reveal.cjs.development.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\n Roll,\n Rotate,\n Slide,\n Zoom,\n} from \"react-awesome-reveal\";\n\nconst effectNameToComponent = {\n bounce: Bounce,\n fade: Fade,\n flip: Flip,\n hinge: Hinge,\n jackinthebox: JackInTheBox,\n roll: Roll,\n rotate: Rotate,\n slide: Slide,\n zoom: Zoom,\n} as const;\n\ntype Effect = keyof typeof effectNameToComponent;\n\nconst effects = Object.keys(effectNameToComponent);\n\nexport interface RevealProps extends React.ComponentProps<typeof Fade> {\n className?: string;\n effect?: Effect;\n}\n\nexport function Reveal({ effect = \"fade\", className, ...props }: RevealProps) {\n const Comp = effectNameToComponent[effect] as any;\n if (!Comp) {\n throw new Error(`Please specify a valid effect: ${effects.join(\", \")}`);\n }\n // Rendering plain strings seems to result in an infinite loop from\n // \"react-awesome-reveal\" (except for when `cascading` is set).\n // So we create a wrapper `div`.\n const children =\n props.cascade ||\n ![\"string\", \"number\", \"boolean\"].includes(typeof props.children) ? (\n props.children\n ) : (\n <div> {props.children} </div>\n );\n return <Comp className={className} {...props} children={children} />;\n}\n\nexport const revealMeta: ComponentMeta<RevealProps> = {\n name: \"hostless-reveal\",\n importName: \"Reveal\",\n displayName: \"Reveal\",\n importPath: \"@plasmicpkgs/react-awesome-reveal\",\n props: {\n big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther`,\n hidden: (props) =>\n (props.effect || \"fade\") !== \"fade\" ||\n ![\"down\", \"left\", \"up\", \"right\"].includes(props.direction as string),\n },\n cascade: {\n type: \"boolean\",\n displayName: \"Cascade\",\n description: \"Stagger its children animations\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"img\",\n src: \"https://placekitten.com/300/200\",\n },\n ],\n },\n damping: {\n type: \"number\",\n displayName: \"Damping\",\n description:\n \"Factor that affects the delay that each animated element in a cascade animation will be assigned\",\n defaultValueHint: 0.5\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n defaultValueHint: 0,\n },\n direction: {\n type: \"choice\",\n options: (props) => {\n const effect = props.effect || \"fade\";\n const maybeAddOptions = (effects: Effect[], options: string[]) =>\n effects.includes(effect) ? options : [];\n return ([] as string[])\n .concat(maybeAddOptions([\"flip\"], [\"horizontal\", \"vertical\"]))\n .concat(\n maybeAddOptions(\n [\"bounce\", \"fade\", \"slide\", \"zoom\"],\n [\"down\", \"left\", \"right\", \"up\"]\n )\n )\n .concat(\n maybeAddOptions(\n [\"fade\", \"rotate\"],\n [\"bottom-left\", \"bottom-right\", \"top-left\", \"top-right\"]\n )\n );\n },\n hidden: (props) => {\n const effect = props.effect || \"fade\";\n return [\"hinge\", \"jackinthebox\", \"roll\"].includes(effect);\n },\n displayName: \"Direction\",\n description:\n \"Origin of the animation (the valid values depend on the chosen Effect)\",\n },\n duration: {\n type: \"number\",\n displayName: \"Duration\",\n description: \"Animation duration, in milliseconds\",\n defaultValueHint: 1000,\n },\n effect: {\n type: \"choice\",\n options: effects.map((v) => v),\n displayName: \"Effect\",\n description: \"The Reveal animation effect to be applied\",\n defaultValueHint: \"fade\"\n },\n // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* fraction: {\n type: \"number\",\n displayName: \"Fraction\",\n description:\n \"Float number between 0 and 1 indicating how much the element should be in viewport before the animation is triggered\",\n }, */\n reverse: {\n type: \"boolean\",\n displayName: \"Reverse\",\n description: `Whether the animation should make element(s) disappear`,\n hidden: (props) =>\n [\"hinge\", \"jackinthebox\"].includes(props.effect || \"fade\"),\n },\n triggerOnce: {\n type: \"boolean\",\n displayName: \"Trigger Once\",\n description:\n \"Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport\",\n // Some effects don't work correctly when `false`\n defaultValue: true,\n },\n },\n};\n\nexport function registerReveal(\n loader?: { registerComponent: typeof registerComponent },\n customRevealMeta?: ComponentMeta<RevealProps>\n) {\n if (loader) {\n loader.registerComponent(Reveal, customRevealMeta ?? revealMeta);\n } else {\n registerComponent(Reveal, customRevealMeta ?? revealMeta);\n }\n}\n"],"names":["effectNameToComponent","bounce","Bounce","fade","Fade","flip","Flip","hinge","Hinge","jackinthebox","JackInTheBox","roll","Roll","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","className","props","Comp","Error","join","children","cascade","includes","React","revealMeta","name","importName","displayName","importPath","big","type","description","hidden","direction","defaultValue","src","damping","defaultValueHint","delay","options","maybeAddOptions","concat","duration","map","v","reverse","triggerOnce","registerReveal","loader","customRevealMeta","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAMA,qBAAqB,GAAG;AAC5BC,EAAAA,MAAM,EAAEC,yBADoB;AAE5BC,EAAAA,IAAI,EAAEC,uBAFsB;AAG5BC,EAAAA,IAAI,EAAEC,uBAHsB;AAI5BC,EAAAA,KAAK,EAAEC,wBAJqB;AAK5BC,EAAAA,YAAY,EAAEC,+BAL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AnD,CADM;AAAA;AAJD,KArFJ;AA4FLgC,IAAAA,WAAW,EAAE;AACXhB,MAAAA,IAAI,EAAE,SADK;AAEXH,MAAAA,WAAW,EAAE,cAFF;AAGXI,MAAAA,WAAW,EACT,uHAJS;AAKX;AACAG,MAAAA,YAAY,EAAE;AANH;AA5FR;AAL6C;SA4GtCa,eACdC,QACAC;AAEA,MAAID,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyBrC,MAAzB,EAAiCoC,gBAAjC,WAAiCA,gBAAjC,GAAqDzB,UAArD;AACD,GAFD,MAEO;AACL0B,IAAAA,iBAAiB,CAACrC,MAAD,EAASoC,gBAAT,WAASA,gBAAT,GAA6BzB,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}))}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;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@plasmicapp/host/registerComponent")),a=e(require("react")),i=require("react-awesome-reveal"),n=["effect","className"],o={bounce:i.Bounce,fade:i.Fade,flip:i.Flip,hinge:i.Hinge,jackinthebox:i.JackInTheBox,roll:i.Roll,rotate:i.Rotate,slide:i.Slide,zoom:i.Zoom},r=Object.keys(o);function l(e){var t=e.effect,i=void 0===t?"fade":t,l=e.className,c=function(e,t){if(null==e)return{};var a,i,n={},o=Object.keys(e);for(i=0;i<o.length;i++)t.indexOf(a=o[i])>=0||(n[a]=e[a]);return n}(e,n),s=o[i];if(!s)throw new Error("Please specify a valid effect: "+r.join(", "));var d=c.cascade||!["string","number","boolean"].includes(typeof c.children)?c.children:a.createElement("div",null," ",c.children," ");return a.createElement(s,Object.assign({className:l},c,{children:d}))}var c={name:"hostless-reveal",importName:"Reveal",displayName:"Reveal",importPath:"@plasmicpkgs/react-awesome-reveal",props:{big:{type:"boolean",displayName:"Big",description:"Causes the animation to start farther",hidden:function(e){return"fade"!==(e.effect||"fade")||!["down","left","up","right"].includes(e.direction)}},cascade:{type:"boolean",displayName:"Cascade",description:"Stagger its children animations"},children:{type:"slot",defaultValue:[{type:"img",src:"https://placekitten.com/300/200"}]},damping:{type:"number",displayName:"Damping",description:"Factor that affects the delay that each animated element in a cascade animation will be assigned",defaultValueHint:.5},delay:{type:"number",displayName:"Delay",description:"Initial delay, in milliseconds",defaultValueHint:0},direction:{type:"choice",options:function(e){var t=e.effect||"fade",a=function(e,a){return e.includes(t)?a:[]};return[].concat(a(["flip"],["horizontal","vertical"])).concat(a(["bounce","fade","slide","zoom"],["down","left","right","up"])).concat(a(["fade","rotate"],["bottom-left","bottom-right","top-left","top-right"]))},hidden:function(e){return["hinge","jackinthebox","roll"].includes(e.effect||"fade")},displayName:"Direction",description:"Origin of the animation (the valid values depend on the chosen Effect)"},duration:{type:"number",displayName:"Duration",description:"Animation duration, in milliseconds",defaultValueHint:1e3},effect:{type:"choice",options:r.map((function(e){return e})),displayName:"Effect",description:"The Reveal animation effect to be applied",defaultValueHint:"fade"},reverse:{type:"boolean",displayName:"Reverse",description:"Whether the animation should make element(s) disappear",hidden:function(e){return["hinge","jackinthebox"].includes(e.effect||"fade")}},triggerOnce:{type:"boolean",displayName:"Trigger Once",description:"Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport",defaultValue:!0}}};exports.Reveal=l,exports.registerReveal=function(e,a){e?e.registerComponent(l,null!=a?a:c):t(l,null!=a?a:c)},exports.revealMeta=c;
2
2
  //# sourceMappingURL=react-awesome-reveal.cjs.production.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-awesome-reveal.cjs.production.min.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\n 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"}
1
+ {"version":3,"file":"react-awesome-reveal.cjs.production.min.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\n Roll,\n Rotate,\n Slide,\n Zoom,\n} from \"react-awesome-reveal\";\n\nconst effectNameToComponent = {\n bounce: Bounce,\n fade: Fade,\n flip: Flip,\n hinge: Hinge,\n jackinthebox: JackInTheBox,\n roll: Roll,\n rotate: Rotate,\n slide: Slide,\n zoom: Zoom,\n} as const;\n\ntype Effect = keyof typeof effectNameToComponent;\n\nconst effects = Object.keys(effectNameToComponent);\n\nexport interface RevealProps extends React.ComponentProps<typeof Fade> {\n className?: string;\n effect?: Effect;\n}\n\nexport function Reveal({ effect = \"fade\", className, ...props }: RevealProps) {\n const Comp = effectNameToComponent[effect] as any;\n if (!Comp) {\n throw new Error(`Please specify a valid effect: ${effects.join(\", \")}`);\n }\n // Rendering plain strings seems to result in an infinite loop from\n // \"react-awesome-reveal\" (except for when `cascading` is set).\n // So we create a wrapper `div`.\n const children =\n props.cascade ||\n ![\"string\", \"number\", \"boolean\"].includes(typeof props.children) ? (\n props.children\n ) : (\n <div> {props.children} </div>\n );\n return <Comp className={className} {...props} children={children} />;\n}\n\nexport const revealMeta: ComponentMeta<RevealProps> = {\n name: \"hostless-reveal\",\n importName: \"Reveal\",\n displayName: \"Reveal\",\n importPath: \"@plasmicpkgs/react-awesome-reveal\",\n props: {\n big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther`,\n hidden: (props) =>\n (props.effect || \"fade\") !== \"fade\" ||\n ![\"down\", \"left\", \"up\", \"right\"].includes(props.direction as string),\n },\n cascade: {\n type: \"boolean\",\n displayName: \"Cascade\",\n description: \"Stagger its children animations\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"img\",\n src: \"https://placekitten.com/300/200\",\n },\n ],\n },\n damping: {\n type: \"number\",\n displayName: \"Damping\",\n description:\n \"Factor that affects the delay that each animated element in a cascade animation will be assigned\",\n defaultValueHint: 0.5\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n defaultValueHint: 0,\n },\n direction: {\n type: \"choice\",\n options: (props) => {\n const effect = props.effect || \"fade\";\n const maybeAddOptions = (effects: Effect[], options: string[]) =>\n effects.includes(effect) ? options : [];\n return ([] as string[])\n .concat(maybeAddOptions([\"flip\"], [\"horizontal\", \"vertical\"]))\n .concat(\n maybeAddOptions(\n [\"bounce\", \"fade\", \"slide\", \"zoom\"],\n [\"down\", \"left\", \"right\", \"up\"]\n )\n )\n .concat(\n maybeAddOptions(\n [\"fade\", \"rotate\"],\n [\"bottom-left\", \"bottom-right\", \"top-left\", \"top-right\"]\n )\n );\n },\n hidden: (props) => {\n const effect = props.effect || \"fade\";\n return [\"hinge\", \"jackinthebox\", \"roll\"].includes(effect);\n },\n displayName: \"Direction\",\n description:\n \"Origin of the animation (the valid values depend on the chosen Effect)\",\n },\n duration: {\n type: \"number\",\n displayName: \"Duration\",\n description: \"Animation duration, in milliseconds\",\n defaultValueHint: 1000,\n },\n effect: {\n type: \"choice\",\n options: effects.map((v) => v),\n displayName: \"Effect\",\n description: \"The Reveal animation effect to be applied\",\n defaultValueHint: \"fade\"\n },\n // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* fraction: {\n type: \"number\",\n displayName: \"Fraction\",\n description:\n \"Float number between 0 and 1 indicating how much the element should be in viewport before the animation is triggered\",\n }, */\n reverse: {\n type: \"boolean\",\n displayName: \"Reverse\",\n description: `Whether the animation should make element(s) disappear`,\n hidden: (props) =>\n [\"hinge\", \"jackinthebox\"].includes(props.effect || \"fade\"),\n },\n triggerOnce: {\n type: \"boolean\",\n displayName: \"Trigger Once\",\n description:\n \"Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport\",\n // Some effects don't work correctly when `false`\n defaultValue: true,\n },\n },\n};\n\nexport function registerReveal(\n loader?: { registerComponent: typeof registerComponent },\n customRevealMeta?: ComponentMeta<RevealProps>\n) {\n if (loader) {\n loader.registerComponent(Reveal, customRevealMeta ?? revealMeta);\n } else {\n registerComponent(Reveal, customRevealMeta ?? revealMeta);\n }\n}\n"],"names":["effectNameToComponent","bounce","Bounce","fade","Fade","flip","Flip","hinge","Hinge","jackinthebox","JackInTheBox","roll","Roll","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","className","props","Comp","Error","join","children","cascade","includes","React","revealMeta","name","importName","displayName","importPath","big","type","description","hidden","direction","defaultValue","src","damping","defaultValueHint","delay","options","maybeAddOptions","concat","duration","map","v","reverse","triggerOnce","loader","customRevealMeta","registerComponent"],"mappings":"kRAgBMA,EAAwB,CAC5BC,OAAQC,SACRC,KAAMC,OACNC,KAAMC,OACNC,MAAOC,QACPC,aAAcC,eACdC,KAAMC,OACNC,OAAQC,SACRC,MAAOC,QACPC,KAAMC,QAKFC,EAAUC,OAAOC,KAAKrB,YAOZsB,aAASC,OAAAA,aAAS,SAAQC,IAAAA,UAAcC,0IAChDC,EAAO1B,EAAsBuB,OAC9BG,QACG,IAAIC,wCAAwCR,EAAQS,KAAK,WAK3DC,EACJJ,EAAMK,UACL,CAAC,SAAU,SAAU,WAAWC,gBAAgBN,EAAMI,UACrDJ,EAAMI,SAENG,+BAAOP,EAAMI,qBAEVG,gBAACN,iBAAKF,UAAWA,GAAeC,GAAOI,SAAUA,SAG7CI,EAAyC,CACpDC,KAAM,kBACNC,WAAY,SACZC,YAAa,SACbC,WAAY,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"}
@@ -1,6 +1,6 @@
1
1
  import registerComponent from '@plasmicapp/host/registerComponent';
2
2
  import React from 'react';
3
- import { Bounce, Fade, Flip, Hinge, JackInTheBox, Rotate, Slide, Zoom } from 'react-awesome-reveal';
3
+ import { Bounce, Fade, Flip, Hinge, JackInTheBox, Roll, Rotate, Slide, Zoom } from 'react-awesome-reveal';
4
4
 
5
5
  function _objectWithoutPropertiesLoose(source, excluded) {
6
6
  if (source == null) return {};
@@ -17,16 +17,14 @@ function _objectWithoutPropertiesLoose(source, excluded) {
17
17
  return target;
18
18
  }
19
19
 
20
+ var _excluded = ["effect", "className"];
20
21
  var effectNameToComponent = {
21
22
  bounce: Bounce,
22
23
  fade: Fade,
23
24
  flip: Flip,
24
25
  hinge: Hinge,
25
26
  jackinthebox: JackInTheBox,
26
- // Roll seems not to be working properly in the canvas as of
27
- // `react-awesome-reveal@3.8.1`
28
-
29
- /* roll: Roll, */
27
+ roll: Roll,
30
28
  rotate: Rotate,
31
29
  slide: Slide,
32
30
  zoom: Zoom
@@ -36,7 +34,7 @@ function Reveal(_ref) {
36
34
  var _ref$effect = _ref.effect,
37
35
  effect = _ref$effect === void 0 ? "fade" : _ref$effect,
38
36
  className = _ref.className,
39
- props = _objectWithoutPropertiesLoose(_ref, ["effect", "className"]);
37
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
40
38
 
41
39
  var Comp = effectNameToComponent[effect];
42
40
 
@@ -60,13 +58,14 @@ var revealMeta = {
60
58
  displayName: "Reveal",
61
59
  importPath: "@plasmicpkgs/react-awesome-reveal",
62
60
  props: {
63
- // `big` seems not to be working properly as of `react-awesome-reveal@3.8.1`
64
-
65
- /* big: {
66
- type: "boolean",
67
- displayName: "Big",
68
- description: `Causes the animation to start farther. Only applied to "fade" Effect and "down", "left", "right" and "up" directions`,
69
- }, */
61
+ big: {
62
+ type: "boolean",
63
+ displayName: "Big",
64
+ description: "Causes the animation to start farther",
65
+ hidden: function hidden(props) {
66
+ return (props.effect || "fade") !== "fade" || !["down", "left", "up", "right"].includes(props.direction);
67
+ }
68
+ },
70
69
  cascade: {
71
70
  type: "boolean",
72
71
  displayName: "Cascade",
@@ -82,24 +81,38 @@ var revealMeta = {
82
81
  damping: {
83
82
  type: "number",
84
83
  displayName: "Damping",
85
- description: "Factor that affects the delay that each animated element in a cascade animation will be assigned (defaults to 0.5)"
84
+ description: "Factor that affects the delay that each animated element in a cascade animation will be assigned",
85
+ defaultValueHint: 0.5
86
86
  },
87
87
  delay: {
88
88
  type: "number",
89
89
  displayName: "Delay",
90
- description: "Initial delay, in milliseconds"
90
+ description: "Initial delay, in milliseconds",
91
+ defaultValueHint: 0
91
92
  },
92
93
  direction: {
93
94
  type: "choice",
94
- options: ["horizontal", "vertical", "bottom-left", "bottom-right", "down", "left", "right", "top-left", "top-right", "up"],
95
- defaultValue: "up",
95
+ options: function options(props) {
96
+ var effect = props.effect || "fade";
97
+
98
+ var maybeAddOptions = function maybeAddOptions(effects, options) {
99
+ return effects.includes(effect) ? options : [];
100
+ };
101
+
102
+ 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"]));
103
+ },
104
+ hidden: function hidden(props) {
105
+ var effect = props.effect || "fade";
106
+ return ["hinge", "jackinthebox", "roll"].includes(effect);
107
+ },
96
108
  displayName: "Direction",
97
109
  description: "Origin of the animation (the valid values depend on the chosen Effect)"
98
110
  },
99
111
  duration: {
100
112
  type: "number",
101
113
  displayName: "Duration",
102
- description: "Animation duration, in milliseconds (defaults to 1000)"
114
+ description: "Animation duration, in milliseconds",
115
+ defaultValueHint: 1000
103
116
  },
104
117
  effect: {
105
118
  type: "choice",
@@ -107,7 +120,8 @@ var revealMeta = {
107
120
  return v;
108
121
  }),
109
122
  displayName: "Effect",
110
- description: "The Reveal animation effect to be applied"
123
+ description: "The Reveal animation effect to be applied",
124
+ defaultValueHint: "fade"
111
125
  },
112
126
  // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`
113
127
 
@@ -120,12 +134,17 @@ var revealMeta = {
120
134
  reverse: {
121
135
  type: "boolean",
122
136
  displayName: "Reverse",
123
- description: "Whether the animation should make element(s) disappear. Not applied to \"hinge\" and \"jackinthebox\" effects"
137
+ description: "Whether the animation should make element(s) disappear",
138
+ hidden: function hidden(props) {
139
+ return ["hinge", "jackinthebox"].includes(props.effect || "fade");
140
+ }
124
141
  },
125
142
  triggerOnce: {
126
143
  type: "boolean",
127
144
  displayName: "Trigger Once",
128
- description: "Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport"
145
+ description: "Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport",
146
+ // Some effects don't work correctly when `false`
147
+ defaultValue: true
129
148
  }
130
149
  }
131
150
  };
@@ -1 +1 @@
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;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,CAAhB;SAOgBoB;yBAASC;MAAAA,kCAAS;MAAQC,iBAAAA;MAAcC;;AACtD,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,CAAC,QAAD,EAAW,QAAX,EAAqB,SAArB,EAAgCC,QAAhC,CAAyC,OAAON,KAAK,CAACI,QAAtD,CADD,GAEEJ,KAAK,CAACI,QAFR,GA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W,EACT;AAjBO,KAhCN;AAmDLO,IAAAA,QAAQ,EAAE;AACRR,MAAAA,IAAI,EAAE,QADE;AAERF,MAAAA,WAAW,EAAE,UAFL;AAGRG,MAAAA,WAAW,EAAE;AAHL,KAnDL;AAwDLhB,IAAAA,MAAM,EAAE;AACNe,MAAAA,IAAI,EAAE,QADA;AAENO,MAAAA,OAAO,eAAE1B,OAAO,CAAC4B,GAAR,CAAY,UAACC,CAAD;AAAA,eAAOA,CAAP;AAAA,OAAZ,CAFH;AAGNZ,MAAAA,WAAW,EAAE,QAHP;AAING,MAAAA,WAAW,EAAE;AAJP,KAxDH;AA8DL;;AACA;;;;;;AAMAU,IAAAA,OAAO,EAAE;AACPX,MAAAA,IAAI,EAAE,SADC;AAEPF,MAAAA,WAAW,EAAE,SAFN;AAGPG,MAAAA,WAAW;AAHJ,KArEJ;AA0ELW,IAAAA,WAAW,EAAE;AACXZ,MAAAA,IAAI,EAAE,SADK;AAEXF,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;;;;"}
1
+ {"version":3,"file":"react-awesome-reveal.esm.js","sources":["../src/index.tsx"],"sourcesContent":["import registerComponent, {\n ComponentMeta,\n} from \"@plasmicapp/host/registerComponent\";\nimport React from \"react\";\nimport {\n Bounce,\n Fade,\n Flip,\n Hinge,\n JackInTheBox,\n Roll,\n Rotate,\n Slide,\n Zoom,\n} from \"react-awesome-reveal\";\n\nconst effectNameToComponent = {\n bounce: Bounce,\n fade: Fade,\n flip: Flip,\n hinge: Hinge,\n jackinthebox: JackInTheBox,\n roll: Roll,\n rotate: Rotate,\n slide: Slide,\n zoom: Zoom,\n} as const;\n\ntype Effect = keyof typeof effectNameToComponent;\n\nconst effects = Object.keys(effectNameToComponent);\n\nexport interface RevealProps extends React.ComponentProps<typeof Fade> {\n className?: string;\n effect?: Effect;\n}\n\nexport function Reveal({ effect = \"fade\", className, ...props }: RevealProps) {\n const Comp = effectNameToComponent[effect] as any;\n if (!Comp) {\n throw new Error(`Please specify a valid effect: ${effects.join(\", \")}`);\n }\n // Rendering plain strings seems to result in an infinite loop from\n // \"react-awesome-reveal\" (except for when `cascading` is set).\n // So we create a wrapper `div`.\n const children =\n props.cascade ||\n ![\"string\", \"number\", \"boolean\"].includes(typeof props.children) ? (\n props.children\n ) : (\n <div> {props.children} </div>\n );\n return <Comp className={className} {...props} children={children} />;\n}\n\nexport const revealMeta: ComponentMeta<RevealProps> = {\n name: \"hostless-reveal\",\n importName: \"Reveal\",\n displayName: \"Reveal\",\n importPath: \"@plasmicpkgs/react-awesome-reveal\",\n props: {\n big: {\n type: \"boolean\",\n displayName: \"Big\",\n description: `Causes the animation to start farther`,\n hidden: (props) =>\n (props.effect || \"fade\") !== \"fade\" ||\n ![\"down\", \"left\", \"up\", \"right\"].includes(props.direction as string),\n },\n cascade: {\n type: \"boolean\",\n displayName: \"Cascade\",\n description: \"Stagger its children animations\",\n },\n children: {\n type: \"slot\",\n defaultValue: [\n {\n type: \"img\",\n src: \"https://placekitten.com/300/200\",\n },\n ],\n },\n damping: {\n type: \"number\",\n displayName: \"Damping\",\n description:\n \"Factor that affects the delay that each animated element in a cascade animation will be assigned\",\n defaultValueHint: 0.5\n },\n delay: {\n type: \"number\",\n displayName: \"Delay\",\n description: \"Initial delay, in milliseconds\",\n defaultValueHint: 0,\n },\n direction: {\n type: \"choice\",\n options: (props) => {\n const effect = props.effect || \"fade\";\n const maybeAddOptions = (effects: Effect[], options: string[]) =>\n effects.includes(effect) ? options : [];\n return ([] as string[])\n .concat(maybeAddOptions([\"flip\"], [\"horizontal\", \"vertical\"]))\n .concat(\n maybeAddOptions(\n [\"bounce\", \"fade\", \"slide\", \"zoom\"],\n [\"down\", \"left\", \"right\", \"up\"]\n )\n )\n .concat(\n maybeAddOptions(\n [\"fade\", \"rotate\"],\n [\"bottom-left\", \"bottom-right\", \"top-left\", \"top-right\"]\n )\n );\n },\n hidden: (props) => {\n const effect = props.effect || \"fade\";\n return [\"hinge\", \"jackinthebox\", \"roll\"].includes(effect);\n },\n displayName: \"Direction\",\n description:\n \"Origin of the animation (the valid values depend on the chosen Effect)\",\n },\n duration: {\n type: \"number\",\n displayName: \"Duration\",\n description: \"Animation duration, in milliseconds\",\n defaultValueHint: 1000,\n },\n effect: {\n type: \"choice\",\n options: effects.map((v) => v),\n displayName: \"Effect\",\n description: \"The Reveal animation effect to be applied\",\n defaultValueHint: \"fade\"\n },\n // `fraction` seems not to be working properly as of `react-awesome-reveal@3.8.1`\n /* fraction: {\n type: \"number\",\n displayName: \"Fraction\",\n description:\n \"Float number between 0 and 1 indicating how much the element should be in viewport before the animation is triggered\",\n }, */\n reverse: {\n type: \"boolean\",\n displayName: \"Reverse\",\n description: `Whether the animation should make element(s) disappear`,\n hidden: (props) =>\n [\"hinge\", \"jackinthebox\"].includes(props.effect || \"fade\"),\n },\n triggerOnce: {\n type: \"boolean\",\n displayName: \"Trigger Once\",\n description:\n \"Whether the animation should run only once, instead of everytime the element enters, exits and re-enters the viewport\",\n // Some effects don't work correctly when `false`\n defaultValue: true,\n },\n },\n};\n\nexport function registerReveal(\n loader?: { registerComponent: typeof registerComponent },\n customRevealMeta?: ComponentMeta<RevealProps>\n) {\n if (loader) {\n loader.registerComponent(Reveal, customRevealMeta ?? revealMeta);\n } else {\n registerComponent(Reveal, customRevealMeta ?? revealMeta);\n }\n}\n"],"names":["effectNameToComponent","bounce","Bounce","fade","Fade","flip","Flip","hinge","Hinge","jackinthebox","JackInTheBox","roll","Roll","rotate","Rotate","slide","Slide","zoom","Zoom","effects","Object","keys","Reveal","effect","className","props","Comp","Error","join","children","cascade","includes","React","revealMeta","name","importName","displayName","importPath","big","type","description","hidden","direction","defaultValue","src","damping","defaultValueHint","delay","options","maybeAddOptions","concat","duration","map","v","reverse","triggerOnce","registerReveal","loader","customRevealMeta","registerComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBA,IAAMA,qBAAqB,GAAG;AAC5BC,EAAAA,MAAM,EAAEC,MADoB;AAE5BC,EAAAA,IAAI,EAAEC,IAFsB;AAG5BC,EAAAA,IAAI,EAAEC,IAHsB;AAI5BC,EAAAA,KAAK,EAAEC,KAJqB;AAK5BC,EAAAA,YAAY,EAAEC,YALc;AAM5BC,EAAAA,IAAI,EAAEC,IANsB;AAO5BC,EAAAA,MAAM,EAAEC,MAPoB;AAQ5BC,EAAAA,KAAK,EAAEC,KARqB;AAS5BC,EAAAA,IAAI,EAAEC;AATsB,CAA9B;AAcA,IAAMC,OAAO,gBAAGC,MAAM,CAACC,IAAP,CAAYrB,qBAAZ,CAAhB;SAOgBsB;yBAASC;MAAAA,kCAAS;MAAQC,iBAAAA;MAAcC;;AACtD,MAAMC,IAAI,GAAG1B,qBAAqB,CAACuB,MAAD,CAAlC;;AACA,MAAI,CAACG,IAAL,EAAW;AACT,UAAM,IAAIC,KAAJ,qCAA4CR,OAAO,CAACS,IAAR,CAAa,IAAb,CAA5C,CAAN;AACD;AAED;AACA;;;AACA,MAAMC,QAAQ,GACZJ,KAAK,CAACK,OAAN,IACA,CAAC,CAAC,QAAD,EAAW,QAAX,EAAqB,SAArB,EAAgCC,QAAhC,CAAyC,OAAON,KAAK,CAACI,QAAtD,CADD,GAEEJ,KAAK,CAACI,QAFR,GAIEG,mBAAA,MAAA,MAAA,KAAA,EAAOP,KAAK,CAACI,QAAb,KAAA,CALJ;AAOA,SAAOG,mBAAA,CAACN,IAAD;AAAMF,IAAAA,SAAS,EAAEA;KAAeC;AAAOI,IAAAA,QAAQ,EAAEA;IAAjD,CAAP;AACD;IAE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AA,eAAOA,CAAP;AAAA,OAAZ,CAFH;AAGNjB,MAAAA,WAAW,EAAE,QAHP;AAINI,MAAAA,WAAW,EAAE,2CAJP;AAKNM,MAAAA,gBAAgB,EAAE;AALZ,KAvEH;AA8EL;;AACA;;;;;;AAMAQ,IAAAA,OAAO,EAAE;AACPf,MAAAA,IAAI,EAAE,SADC;AAEPH,MAAAA,WAAW,EAAE,SAFN;AAGPI,MAAAA,WAAW,0DAHJ;AAIPC,MAAAA,MAAM,EAAE,gBAAChB,KAAD;AAAA,eACN,CAAC,OAAD,EAAU,cAAV,EAA0BM,QAA1B,CAAmCN,KAAK,CAACF,MAAN,IAAgB,MAAnD,CADM;AAAA;AAJD,KArFJ;AA4FLgC,IAAAA,WAAW,EAAE;AACXhB,MAAAA,IAAI,EAAE,SADK;AAEXH,MAAAA,WAAW,EAAE,cAFF;AAGXI,MAAAA,WAAW,EACT,uHAJS;AAKX;AACAG,MAAAA,YAAY,EAAE;AANH;AA5FR;AAL6C;SA4GtCa,eACdC,QACAC;AAEA,MAAID,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CAAyBrC,MAAzB,EAAiCoC,gBAAjC,WAAiCA,gBAAjC,GAAqDzB,UAArD;AACD,GAFD,MAEO;AACL0B,IAAAA,iBAAiB,CAACrC,MAAD,EAASoC,gBAAT,WAASA,gBAAT,GAA6BzB,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.4",
3
+ "version": "3.8.9",
4
4
  "description": "Plasmic registration call for react-awesome-reveal",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -28,6 +28,7 @@
28
28
  "analyze": "size-limit --why"
29
29
  },
30
30
  "devDependencies": {
31
+ "@plasmicapp/host": "^1.0.0",
31
32
  "@size-limit/preset-small-lib": "^4.11.0",
32
33
  "@types/node": "^14.0.26",
33
34
  "size-limit": "^4.11.0",
@@ -36,10 +37,10 @@
36
37
  "typescript": "^3.9.7"
37
38
  },
38
39
  "dependencies": {
39
- "@plasmicapp/host": "^0.0.32",
40
40
  "react-awesome-reveal": "^3.8.0"
41
41
  },
42
42
  "peerDependencies": {
43
+ "@plasmicapp/host": "^1.0.0",
43
44
  "react": ">=16.8.0",
44
45
  "react-dom": ">=16.8.0"
45
46
  }