@empathyco/x-components 3.0.0-alpha.222 → 3.0.0-alpha.224

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/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.0.0-alpha.224](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.223...@empathyco/x-components@3.0.0-alpha.224) (2022-11-11)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **animations:** make content-visibility CSS property and createCollapseAnimationMixin work
11
+ together (#839)
12
+ ([50d5c87](https://github.com/empathyco/x/commit/50d5c8744e5a8d2c8db5aed33e71bd8a39a76cf3))
13
+
14
+ # Change Log
15
+
16
+ All notable changes to this project will be documented in this file. See
17
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
18
+
19
+ ## [3.0.0-alpha.223](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.222...@empathyco/x-components@3.0.0-alpha.223) (2022-11-10)
20
+
21
+ **Note:** Version bump only for package @empathyco/x-components
22
+
23
+ # Change Log
24
+
25
+ All notable changes to this project will be documented in this file. See
26
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
27
+
6
28
  ## [3.0.0-alpha.222](https://github.com/empathyco/x/compare/@empathyco/x-components@3.0.0-alpha.221...@empathyco/x-components@3.0.0-alpha.222) (2022-11-10)
7
29
 
8
30
  ### Features
@@ -12,12 +12,23 @@ function createCollapseAnimationMixin(property) {
12
12
  /**
13
13
  * Changes the element's animated property from 0 to the element's content size.
14
14
  *
15
+ * @remarks `content-visibility` CSS property boosts the rendering performance waiting to be
16
+ * needed until rendering the content. This behaviour collides with this animation method.
17
+ * When the `scrollProperty` is evaluated, the content has not been rendered yet and the value
18
+ * is 0 so nothing is animated. To avoid this behaviour, we change the `content-visibility` to
19
+ * default value, force a layer repaint and then, evaluate the `scrollProperty` value which
20
+ * now has value. Then we restore the `content-visibility` value to its previous state.
21
+ *
15
22
  * @param element - The DOM element that is going to be animated.
16
23
  * @internal
17
24
  */
18
25
  expand(element) {
19
26
  element.style[property] = '0';
27
+ const originalValue = element.style['content-visibility'];
28
+ element.style['content-visibility'] = 'visible';
29
+ element.getBoundingClientRect();
20
30
  element.style[property] = `${element[scrollProperty]}px`;
31
+ element.style['content-visibility'] = originalValue;
21
32
  },
22
33
  /**
23
34
  * Removes the animated property from the element.
@@ -1 +1 @@
1
- {"version":3,"file":"animations.mixin.js","sources":["../../../../src/components/animations/animations.mixin.ts"],"sourcesContent":["import Vue, { ComponentOptions } from 'vue';\n\n/**\n * Type options for the property that will be animated.\n */\ntype AnimatedProperty = 'height' | 'width';\n\n/**\n * Adds parametrized methods to a component to allow the collapsing of the provided property.\n *\n * @param property - The property that will be animated.\n * @returns Mixin for the module.\n * @public\n */\nexport function createCollapseAnimationMixin(property: AnimatedProperty): ComponentOptions<Vue> {\n const scrollProperty = property === 'width' ? 'scrollWidth' : 'scrollHeight';\n\n return {\n methods: {\n /**\n * Changes the element's animated property from 0 to the element's content size.\n *\n * @param element - The DOM element that is going to be animated.\n * @internal\n */\n expand(element: HTMLElement): void {\n element.style[property] = '0';\n element.style[property] = `${element[scrollProperty]}px`;\n },\n /**\n * Removes the animated property from the element.\n *\n * @param element - The DOM element that is going to be animated.\n * @internal\n */\n cleanUpAnimationStyles(element: HTMLElement): void {\n element.style.removeProperty(property);\n },\n /**\n * Changes the element's animated property from the element's content size to 0.\n *\n * @param element - The DOM element that is going to be animated.\n * @internal\n */\n collapse(element: HTMLElement): void {\n element.style[property] = `${element[scrollProperty]}px`;\n // This is intended. We want to provoke a layer repaint to apply this style.\n element.getBoundingClientRect();\n element.style[property] = '0';\n }\n }\n };\n}\n"],"names":[],"mappings":"AAOA;;;;;;;SAOgB,4BAA4B,CAAC,QAA0B;IACrE,MAAM,cAAc,GAAG,QAAQ,KAAK,OAAO,GAAG,aAAa,GAAG,cAAc,CAAC;IAE7E,OAAO;QACL,OAAO,EAAE;;;;;;;YAOP,MAAM,CAAC,OAAoB;gBACzB,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;gBAC9B,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC;aAC1D;;;;;;;YAOD,sBAAsB,CAAC,OAAoB;gBACzC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;aACxC;;;;;;;YAOD,QAAQ,CAAC,OAAoB;gBAC3B,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC;;gBAEzD,OAAO,CAAC,qBAAqB,EAAE,CAAC;gBAChC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;aAC/B;SACF;KACF,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"animations.mixin.js","sources":["../../../../src/components/animations/animations.mixin.ts"],"sourcesContent":["import Vue, { ComponentOptions } from 'vue';\n\n/**\n * Type options for the property that will be animated.\n */\ntype AnimatedProperty = 'height' | 'width';\n\n/**\n * Adds parametrized methods to a component to allow the collapsing of the provided property.\n *\n * @param property - The property that will be animated.\n * @returns Mixin for the module.\n * @public\n */\nexport function createCollapseAnimationMixin(property: AnimatedProperty): ComponentOptions<Vue> {\n const scrollProperty = property === 'width' ? 'scrollWidth' : 'scrollHeight';\n\n return {\n methods: {\n /**\n * Changes the element's animated property from 0 to the element's content size.\n *\n * @remarks `content-visibility` CSS property boosts the rendering performance waiting to be\n * needed until rendering the content. This behaviour collides with this animation method.\n * When the `scrollProperty` is evaluated, the content has not been rendered yet and the value\n * is 0 so nothing is animated. To avoid this behaviour, we change the `content-visibility` to\n * default value, force a layer repaint and then, evaluate the `scrollProperty` value which\n * now has value. Then we restore the `content-visibility` value to its previous state.\n *\n * @param element - The DOM element that is going to be animated.\n * @internal\n */\n expand(element: HTMLElement): void {\n element.style[property] = '0';\n const originalValue = (element.style as any)['content-visibility'];\n (element.style as any)['content-visibility'] = 'visible';\n element.getBoundingClientRect();\n element.style[property] = `${element[scrollProperty]}px`;\n (element.style as any)['content-visibility'] = originalValue;\n },\n /**\n * Removes the animated property from the element.\n *\n * @param element - The DOM element that is going to be animated.\n * @internal\n */\n cleanUpAnimationStyles(element: HTMLElement): void {\n element.style.removeProperty(property);\n },\n /**\n * Changes the element's animated property from the element's content size to 0.\n *\n * @param element - The DOM element that is going to be animated.\n * @internal\n */\n collapse(element: HTMLElement): void {\n element.style[property] = `${element[scrollProperty]}px`;\n // This is intended. We want to provoke a layer repaint to apply this style.\n element.getBoundingClientRect();\n element.style[property] = '0';\n }\n }\n };\n}\n"],"names":[],"mappings":"AAOA;;;;;;;SAOgB,4BAA4B,CAAC,QAA0B;IACrE,MAAM,cAAc,GAAG,QAAQ,KAAK,OAAO,GAAG,aAAa,GAAG,cAAc,CAAC;IAE7E,OAAO;QACL,OAAO,EAAE;;;;;;;;;;;;;;YAcP,MAAM,CAAC,OAAoB;gBACzB,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;gBAC9B,MAAM,aAAa,GAAI,OAAO,CAAC,KAAa,CAAC,oBAAoB,CAAC,CAAC;gBAClE,OAAO,CAAC,KAAa,CAAC,oBAAoB,CAAC,GAAG,SAAS,CAAC;gBACzD,OAAO,CAAC,qBAAqB,EAAE,CAAC;gBAChC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC;gBACxD,OAAO,CAAC,KAAa,CAAC,oBAAoB,CAAC,GAAG,aAAa,CAAC;aAC9D;;;;;;;YAOD,sBAAsB,CAAC,OAAoB;gBACzC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;aACxC;;;;;;;YAOD,QAAQ,CAAC,OAAoB;gBAC3B,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC;;gBAEzD,OAAO,CAAC,qBAAqB,EAAE,CAAC;gBAChC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;aAC/B;SACF;KACF,CAAC;AACJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "3.0.0-alpha.222",
3
+ "version": "3.0.0-alpha.224",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -85,7 +85,7 @@
85
85
  "@cypress/vue": "~2.2.4",
86
86
  "@cypress/webpack-dev-server": "~1.8.4",
87
87
  "@empathyco/x-adapter-platform": "^1.0.0-alpha.43",
88
- "@empathyco/x-tailwindcss": "^0.2.0-alpha.26",
88
+ "@empathyco/x-tailwindcss": "^0.2.0-alpha.27",
89
89
  "@microsoft/api-documenter": "~7.15.3",
90
90
  "@microsoft/api-extractor": "~7.19.4",
91
91
  "@rollup/plugin-commonjs": "~21.0.1",
@@ -135,5 +135,5 @@
135
135
  "access": "public",
136
136
  "directory": "dist"
137
137
  },
138
- "gitHead": "3a41e63e2cc9611d146378335f892b5e85200435"
138
+ "gitHead": "b77b5ed8836cc926f9a84be579d276f6b96f9668"
139
139
  }
@@ -1 +1 @@
1
- {"version":3,"file":"animations.mixin.d.ts","sourceRoot":"","sources":["../../../../src/components/animations/animations.mixin.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAE5C;;GAEG;AACH,aAAK,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE3C;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAsC9F"}
1
+ {"version":3,"file":"animations.mixin.d.ts","sourceRoot":"","sources":["../../../../src/components/animations/animations.mixin.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAE5C;;GAEG;AACH,aAAK,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE3C;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAiD9F"}