@studiometa/ui 0.2.18 → 0.2.19

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.
@@ -54,7 +54,6 @@ var AbstractScrollAnimation = class extends (0, import_js_toolkit.withFreezedOpt
54
54
  0,
55
55
  1
56
56
  );
57
- this.$options.playRange = [0, 0];
58
57
  this.render(progress);
59
58
  }
60
59
  render(progress) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/ui/atoms/ScrollAnimation/AbstractScrollAnimation.ts"],
4
- "sourcesContent": ["import { Base, withFreezedOptions } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig, ScrollInViewProps } from '@studiometa/js-toolkit';\nimport { map, clamp, animate } from '@studiometa/js-toolkit/utils';\nimport type { Keyframe } from '@studiometa/js-toolkit/utils';\n\nexport interface AbstractScrollAnimationProps extends BaseProps {\n $options: {\n playRange: [number, number];\n from: Keyframe;\n to: Keyframe;\n keyframes: Keyframe[];\n easing: [number,number,number,number];\n };\n}\n\n/**\n * AbstractScrollAnimation class.\n */\nexport class AbstractScrollAnimation<T extends BaseProps = BaseProps> extends withFreezedOptions<Base>(Base)<T & AbstractScrollAnimationProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'AbstractScrollAnimation',\n options: {\n playRange: {\n type: Array,\n default: () => [0, 1],\n },\n from: {\n type: Object,\n default: () => ({}),\n },\n to: {\n type: Object,\n default: () => ({}),\n },\n keyframes: {\n type: Array,\n },\n easing: {\n type: Array,\n default: () => [0, 0, 1, 1],\n },\n },\n };\n\n /**\n * Get the target element for the animation.\n */\n get target() {\n return this.$el as HTMLElement;\n }\n\n /**\n * Lazily get animation.\n */\n get animation():ReturnType<typeof animate> {\n let { keyframes } = this.$options;\n const { from, to } = this.$options;\n\n if (keyframes.length <= 0 && from && to) {\n keyframes = [from, to];\n }\n\n const animation = animate(this.target, keyframes, { easing: this.$options.easing });\n\n Object.defineProperty(this, 'animation', {\n value: animation,\n configurable: true,\n });\n\n return animation;\n }\n\n scrolledInView(props:ScrollInViewProps) {\n const progress = map(\n clamp(props.dampedProgress.y, this.$options.playRange[0], this.$options.playRange[1]),\n this.$options.playRange[0],\n this.$options.playRange[1],\n 0,\n 1,\n );\n\n this.$options.playRange = [0, 0];\n\n this.render(progress);\n }\n\n /**\n * Render the animation for the given progress.\n */\n render(progress:number) {\n this.animation.progress(progress);\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAyC;AAEzC,mBAAoC;AAgB7B,IAAM,0BAAN,kBAAuE,sCAAyB,sBAAI,EAAoC;AAAA,EAgC7I,IAAI,SAAS;AACX,WAAO,KAAK;AAAA,EACd;AAAA,EAKA,IAAI,YAAuC;AACzC,QAAI,EAAE,UAAU,IAAI,KAAK;AACzB,UAAM,EAAE,MAAM,GAAG,IAAI,KAAK;AAE1B,QAAI,UAAU,UAAU,KAAK,QAAQ,IAAI;AACvC,kBAAY,CAAC,MAAM,EAAE;AAAA,IACvB;AAEA,UAAM,gBAAY,sBAAQ,KAAK,QAAQ,WAAW,EAAE,QAAQ,KAAK,SAAS,OAAO,CAAC;AAElF,WAAO,eAAe,MAAM,aAAa;AAAA,MACvC,OAAO;AAAA,MACP,cAAc;AAAA,IAChB,CAAC;AAED,WAAO;AAAA,EACT;AAAA,EAEA,eAAe,OAAyB;AACtC,UAAM,eAAW;AAAA,UACf,oBAAM,MAAM,eAAe,GAAG,KAAK,SAAS,UAAU,IAAI,KAAK,SAAS,UAAU,EAAE;AAAA,MACpF,KAAK,SAAS,UAAU;AAAA,MACxB,KAAK,SAAS,UAAU;AAAA,MACxB;AAAA,MACA;AAAA,IACF;AAEA,SAAK,SAAS,YAAY,CAAC,GAAG,CAAC;AAE/B,SAAK,OAAO,QAAQ;AAAA,EACtB;AAAA,EAKA,OAAO,UAAiB;AACtB,SAAK,UAAU,SAAS,QAAQ;AAAA,EAClC;AACF;AAzEE,cAJW,yBAIJ,UAAqB;AAAA,EAC1B,MAAM;AAAA,EACN,SAAS;AAAA,IACP,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS,MAAM,CAAC,GAAG,CAAC;AAAA,IACtB;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS,OAAO,CAAC;AAAA,IACnB;AAAA,IACA,IAAI;AAAA,MACF,MAAM;AAAA,MACN,SAAS,OAAO,CAAC;AAAA,IACnB;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;AAAA,IAC5B;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { Base, withFreezedOptions } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig, ScrollInViewProps } from '@studiometa/js-toolkit';\nimport { map, clamp, animate } from '@studiometa/js-toolkit/utils';\nimport type { Keyframe } from '@studiometa/js-toolkit/utils';\n\nexport interface AbstractScrollAnimationProps extends BaseProps {\n $options: {\n playRange: [number, number];\n from: Keyframe;\n to: Keyframe;\n keyframes: Keyframe[];\n easing: [number,number,number,number];\n };\n}\n\n/**\n * AbstractScrollAnimation class.\n */\nexport class AbstractScrollAnimation<T extends BaseProps = BaseProps> extends withFreezedOptions<Base>(Base)<T & AbstractScrollAnimationProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'AbstractScrollAnimation',\n options: {\n playRange: {\n type: Array,\n default: () => [0, 1],\n },\n from: {\n type: Object,\n default: () => ({}),\n },\n to: {\n type: Object,\n default: () => ({}),\n },\n keyframes: {\n type: Array,\n },\n easing: {\n type: Array,\n default: () => [0, 0, 1, 1],\n },\n },\n };\n\n /**\n * Get the target element for the animation.\n */\n get target() {\n return this.$el as HTMLElement;\n }\n\n /**\n * Lazily get animation.\n */\n get animation():ReturnType<typeof animate> {\n let { keyframes } = this.$options;\n const { from, to } = this.$options;\n\n if (keyframes.length <= 0 && from && to) {\n keyframes = [from, to];\n }\n\n const animation = animate(this.target, keyframes, { easing: this.$options.easing });\n\n Object.defineProperty(this, 'animation', {\n value: animation,\n configurable: true,\n });\n\n return animation;\n }\n\n scrolledInView(props:ScrollInViewProps) {\n const progress = map(\n clamp(props.dampedProgress.y, this.$options.playRange[0], this.$options.playRange[1]),\n this.$options.playRange[0],\n this.$options.playRange[1],\n 0,\n 1,\n );\n\n this.render(progress);\n }\n\n /**\n * Render the animation for the given progress.\n */\n render(progress:number) {\n this.animation.progress(progress);\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAyC;AAEzC,mBAAoC;AAgB7B,IAAM,0BAAN,kBAAuE,sCAAyB,sBAAI,EAAoC;AAAA,EAgC7I,IAAI,SAAS;AACX,WAAO,KAAK;AAAA,EACd;AAAA,EAKA,IAAI,YAAuC;AACzC,QAAI,EAAE,UAAU,IAAI,KAAK;AACzB,UAAM,EAAE,MAAM,GAAG,IAAI,KAAK;AAE1B,QAAI,UAAU,UAAU,KAAK,QAAQ,IAAI;AACvC,kBAAY,CAAC,MAAM,EAAE;AAAA,IACvB;AAEA,UAAM,gBAAY,sBAAQ,KAAK,QAAQ,WAAW,EAAE,QAAQ,KAAK,SAAS,OAAO,CAAC;AAElF,WAAO,eAAe,MAAM,aAAa;AAAA,MACvC,OAAO;AAAA,MACP,cAAc;AAAA,IAChB,CAAC;AAED,WAAO;AAAA,EACT;AAAA,EAEA,eAAe,OAAyB;AACtC,UAAM,eAAW;AAAA,UACf,oBAAM,MAAM,eAAe,GAAG,KAAK,SAAS,UAAU,IAAI,KAAK,SAAS,UAAU,EAAE;AAAA,MACpF,KAAK,SAAS,UAAU;AAAA,MACxB,KAAK,SAAS,UAAU;AAAA,MACxB;AAAA,MACA;AAAA,IACF;AAEA,SAAK,OAAO,QAAQ;AAAA,EACtB;AAAA,EAKA,OAAO,UAAiB;AACtB,SAAK,UAAU,SAAS,QAAQ;AAAA,EAClC;AACF;AAvEE,cAJW,yBAIJ,UAAqB;AAAA,EAC1B,MAAM;AAAA,EACN,SAAS;AAAA,IACP,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS,MAAM,CAAC,GAAG,CAAC;AAAA,IACtB;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS,OAAO,CAAC;AAAA,IACnB;AAAA,IACA,IAAI;AAAA,MACF,MAAM;AAAA,MACN,SAAS,OAAO,CAAC;AAAA,IACnB;AAAA,IACA,WAAW;AAAA,MACT,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;AAAA,IAC5B;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -49,7 +49,6 @@ class AbstractScrollAnimation extends withFreezedOptions(Base) {
49
49
  0,
50
50
  1
51
51
  );
52
- this.$options.playRange = [0, 0];
53
52
  this.render(progress);
54
53
  }
55
54
  render(progress) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../packages/ui/atoms/ScrollAnimation/AbstractScrollAnimation.ts"],
4
- "sourcesContent": ["import { Base, withFreezedOptions } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig, ScrollInViewProps } from '@studiometa/js-toolkit';\nimport { map, clamp, animate } from '@studiometa/js-toolkit/utils';\nimport type { Keyframe } from '@studiometa/js-toolkit/utils';\n\nexport interface AbstractScrollAnimationProps extends BaseProps {\n $options: {\n playRange: [number, number];\n from: Keyframe;\n to: Keyframe;\n keyframes: Keyframe[];\n easing: [number,number,number,number];\n };\n}\n\n/**\n * AbstractScrollAnimation class.\n */\nexport class AbstractScrollAnimation<T extends BaseProps = BaseProps> extends withFreezedOptions<Base>(Base)<T & AbstractScrollAnimationProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'AbstractScrollAnimation',\n options: {\n playRange: {\n type: Array,\n default: () => [0, 1],\n },\n from: {\n type: Object,\n default: () => ({}),\n },\n to: {\n type: Object,\n default: () => ({}),\n },\n keyframes: {\n type: Array,\n },\n easing: {\n type: Array,\n default: () => [0, 0, 1, 1],\n },\n },\n };\n\n /**\n * Get the target element for the animation.\n */\n get target() {\n return this.$el as HTMLElement;\n }\n\n /**\n * Lazily get animation.\n */\n get animation():ReturnType<typeof animate> {\n let { keyframes } = this.$options;\n const { from, to } = this.$options;\n\n if (keyframes.length <= 0 && from && to) {\n keyframes = [from, to];\n }\n\n const animation = animate(this.target, keyframes, { easing: this.$options.easing });\n\n Object.defineProperty(this, 'animation', {\n value: animation,\n configurable: true,\n });\n\n return animation;\n }\n\n scrolledInView(props:ScrollInViewProps) {\n const progress = map(\n clamp(props.dampedProgress.y, this.$options.playRange[0], this.$options.playRange[1]),\n this.$options.playRange[0],\n this.$options.playRange[1],\n 0,\n 1,\n );\n\n this.$options.playRange = [0, 0];\n\n this.render(progress);\n }\n\n /**\n * Render the animation for the given progress.\n */\n render(progress:number) {\n this.animation.progress(progress);\n }\n}\n"],
5
- "mappings": "AAAA,SAAS,MAAM,0BAA0B;AAEzC,SAAS,KAAK,OAAO,eAAe;AAgB7B,MAAM,gCAAiE,mBAAyB,IAAI,EAAoC;AAAA,EAI7I,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,SAAS;AAAA,MACP,WAAW;AAAA,QACT,MAAM;AAAA,QACN,SAAS,MAAM,CAAC,GAAG,CAAC;AAAA,MACtB;AAAA,MACA,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,SAAS,OAAO,CAAC;AAAA,MACnB;AAAA,MACA,IAAI;AAAA,QACF,MAAM;AAAA,QACN,SAAS,OAAO,CAAC;AAAA,MACnB;AAAA,MACA,WAAW;AAAA,QACT,MAAM;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,SAAS,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;AAAA,MAC5B;AAAA,IACF;AAAA,EACF;AAAA,EAKA,IAAI,SAAS;AACX,WAAO,KAAK;AAAA,EACd;AAAA,EAKA,IAAI,YAAuC;AACzC,QAAI,EAAE,UAAU,IAAI,KAAK;AACzB,UAAM,EAAE,MAAM,GAAG,IAAI,KAAK;AAE1B,QAAI,UAAU,UAAU,KAAK,QAAQ,IAAI;AACvC,kBAAY,CAAC,MAAM,EAAE;AAAA,IACvB;AAEA,UAAM,YAAY,QAAQ,KAAK,QAAQ,WAAW,EAAE,QAAQ,KAAK,SAAS,OAAO,CAAC;AAElF,WAAO,eAAe,MAAM,aAAa;AAAA,MACvC,OAAO;AAAA,MACP,cAAc;AAAA,IAChB,CAAC;AAED,WAAO;AAAA,EACT;AAAA,EAEA,eAAe,OAAyB;AACtC,UAAM,WAAW;AAAA,MACf,MAAM,MAAM,eAAe,GAAG,KAAK,SAAS,UAAU,IAAI,KAAK,SAAS,UAAU,EAAE;AAAA,MACpF,KAAK,SAAS,UAAU;AAAA,MACxB,KAAK,SAAS,UAAU;AAAA,MACxB;AAAA,MACA;AAAA,IACF;AAEA,SAAK,SAAS,YAAY,CAAC,GAAG,CAAC;AAE/B,SAAK,OAAO,QAAQ;AAAA,EACtB;AAAA,EAKA,OAAO,UAAiB;AACtB,SAAK,UAAU,SAAS,QAAQ;AAAA,EAClC;AACF;",
4
+ "sourcesContent": ["import { Base, withFreezedOptions } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig, ScrollInViewProps } from '@studiometa/js-toolkit';\nimport { map, clamp, animate } from '@studiometa/js-toolkit/utils';\nimport type { Keyframe } from '@studiometa/js-toolkit/utils';\n\nexport interface AbstractScrollAnimationProps extends BaseProps {\n $options: {\n playRange: [number, number];\n from: Keyframe;\n to: Keyframe;\n keyframes: Keyframe[];\n easing: [number,number,number,number];\n };\n}\n\n/**\n * AbstractScrollAnimation class.\n */\nexport class AbstractScrollAnimation<T extends BaseProps = BaseProps> extends withFreezedOptions<Base>(Base)<T & AbstractScrollAnimationProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'AbstractScrollAnimation',\n options: {\n playRange: {\n type: Array,\n default: () => [0, 1],\n },\n from: {\n type: Object,\n default: () => ({}),\n },\n to: {\n type: Object,\n default: () => ({}),\n },\n keyframes: {\n type: Array,\n },\n easing: {\n type: Array,\n default: () => [0, 0, 1, 1],\n },\n },\n };\n\n /**\n * Get the target element for the animation.\n */\n get target() {\n return this.$el as HTMLElement;\n }\n\n /**\n * Lazily get animation.\n */\n get animation():ReturnType<typeof animate> {\n let { keyframes } = this.$options;\n const { from, to } = this.$options;\n\n if (keyframes.length <= 0 && from && to) {\n keyframes = [from, to];\n }\n\n const animation = animate(this.target, keyframes, { easing: this.$options.easing });\n\n Object.defineProperty(this, 'animation', {\n value: animation,\n configurable: true,\n });\n\n return animation;\n }\n\n scrolledInView(props:ScrollInViewProps) {\n const progress = map(\n clamp(props.dampedProgress.y, this.$options.playRange[0], this.$options.playRange[1]),\n this.$options.playRange[0],\n this.$options.playRange[1],\n 0,\n 1,\n );\n\n this.render(progress);\n }\n\n /**\n * Render the animation for the given progress.\n */\n render(progress:number) {\n this.animation.progress(progress);\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,MAAM,0BAA0B;AAEzC,SAAS,KAAK,OAAO,eAAe;AAgB7B,MAAM,gCAAiE,mBAAyB,IAAI,EAAoC;AAAA,EAI7I,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,SAAS;AAAA,MACP,WAAW;AAAA,QACT,MAAM;AAAA,QACN,SAAS,MAAM,CAAC,GAAG,CAAC;AAAA,MACtB;AAAA,MACA,MAAM;AAAA,QACJ,MAAM;AAAA,QACN,SAAS,OAAO,CAAC;AAAA,MACnB;AAAA,MACA,IAAI;AAAA,QACF,MAAM;AAAA,QACN,SAAS,OAAO,CAAC;AAAA,MACnB;AAAA,MACA,WAAW;AAAA,QACT,MAAM;AAAA,MACR;AAAA,MACA,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,SAAS,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;AAAA,MAC5B;AAAA,IACF;AAAA,EACF;AAAA,EAKA,IAAI,SAAS;AACX,WAAO,KAAK;AAAA,EACd;AAAA,EAKA,IAAI,YAAuC;AACzC,QAAI,EAAE,UAAU,IAAI,KAAK;AACzB,UAAM,EAAE,MAAM,GAAG,IAAI,KAAK;AAE1B,QAAI,UAAU,UAAU,KAAK,QAAQ,IAAI;AACvC,kBAAY,CAAC,MAAM,EAAE;AAAA,IACvB;AAEA,UAAM,YAAY,QAAQ,KAAK,QAAQ,WAAW,EAAE,QAAQ,KAAK,SAAS,OAAO,CAAC;AAElF,WAAO,eAAe,MAAM,aAAa;AAAA,MACvC,OAAO;AAAA,MACP,cAAc;AAAA,IAChB,CAAC;AAED,WAAO;AAAA,EACT;AAAA,EAEA,eAAe,OAAyB;AACtC,UAAM,WAAW;AAAA,MACf,MAAM,MAAM,eAAe,GAAG,KAAK,SAAS,UAAU,IAAI,KAAK,SAAS,UAAU,EAAE;AAAA,MACpF,KAAK,SAAS,UAAU;AAAA,MACxB,KAAK,SAAS,UAAU;AAAA,MACxB;AAAA,MACA;AAAA,IACF;AAEA,SAAK,OAAO,QAAQ;AAAA,EACtB;AAAA,EAKA,OAAO,UAAiB;AACtB,SAAK,UAAU,SAAS,QAAQ;AAAA,EAClC;AACF;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiometa/ui",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "description": "A set of opiniated, unstyled and accessible components",
5
5
  "publishConfig": {
6
6
  "access": "public"