@codeleap/web 5.6.2 → 5.7.0

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.
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  Object.defineProperty(exports, "__esModule", { value: true });
3
14
  exports.useStylesFor = void 0;
4
15
  var styles_1 = require("@codeleap/styles");
@@ -17,7 +28,10 @@ var useStylesFor = function (componentName, style) {
17
28
  var key = _a[0], styleValue = _a[1];
18
29
  var isServer = typeof window === 'undefined';
19
30
  var inEnvTransition = isServer ? false : !isMounted;
20
- acc[key] = inEnvTransition ? { opacity: 0 } : styleValue;
31
+ acc[key] = inEnvTransition ? __assign({
32
+ // Despite what it may look like, this is not (just) a joke. The "orphans" property is almost completely useless,
33
+ // so we set it just to force the styles to recompute after hydration. Also picked for comedic impact.
34
+ orphans: 1 }, styleValue) : styleValue;
21
35
  return acc;
22
36
  }, {});
23
37
  }, [styles, isMounted]);
@@ -1 +1 @@
1
- {"version":3,"file":"useStylesFor.js","sourceRoot":"","sources":["../../../src/lib/hooks/useStylesFor.ts"],"names":[],"mappings":";;;AAAA,2CAA8D;AAC9D,+BAA+B;AAC/B,wDAAsD;AACtD,yCAA8C;AAEvC,IAAM,YAAY,GAAG,UAAc,aAAqB,EAAE,KAA2B;IAC1F,IAAM,aAAa,GAAG,IAAA,yBAAgB,EAAC,KAAK,CAAC,CAAA;IAE7C,IAAM,SAAS,GAAG,IAAA,oBAAY,GAAE,CAAA;IAEhC,IAAM,MAAM,GAAG,IAAA,eAAO,EAAC;QACrB,OAAO,mCAAgB,CAAC,OAAO,CAAC,QAAQ,C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A;IAEnB,IAAM,eAAe,GAAG,IAAA,eAAO,EAAC;QAC9B,4EAA4E;QAC5E,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,EAAiB;gBAAhB,GAAG,QAAA,EAAE,UAAU,QAAA;YACzD,IAAM,QAAQ,GAAG,OAAO,MAAM,KAAK,WAAW,CAAA;YAC9C,IAAM,eAAe,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;YAErD,GAAG,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,CAAC;gBAC1B,iHAAiH;gBACjH,sGAAsG;gBACtG,OAAO,EAAE,CAAC,IAEP,UAAU,EAAG,CAAC,CAAC,UAAU,CAAA;YAE9B,OAAO,GAAG,CAAA;QACZ,CAAC,EAAE,EAAO,CAAC,CAAA;IACb,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;IAEvB,OAAO,eAAe,CAAA;AAExB,CAAC,CAAA;AA5BY,QAAA,YAAY,gBA4BxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/web",
3
- "version": "5.6.2",
3
+ "version": "5.7.0",
4
4
  "main": "src/index.ts",
5
5
  "repository": {
6
6
  "url": "https://github.com/codeleap-uk/internal-libs-monorepo.git",
@@ -9,14 +9,14 @@
9
9
  },
10
10
  "license": "UNLICENSED",
11
11
  "devDependencies": {
12
- "@codeleap/config": "5.6.2",
13
- "@codeleap/hooks": "5.6.2",
14
- "@codeleap/i18n": "5.6.2",
15
- "@codeleap/logger": "5.6.2",
16
- "@codeleap/query": "5.6.2",
17
- "@codeleap/types": "5.6.2",
18
- "@codeleap/utils": "5.6.2",
19
- "@codeleap/store": "5.6.2",
12
+ "@codeleap/config": "5.7.0",
13
+ "@codeleap/hooks": "5.7.0",
14
+ "@codeleap/i18n": "5.7.0",
15
+ "@codeleap/logger": "5.7.0",
16
+ "@codeleap/query": "5.7.0",
17
+ "@codeleap/types": "5.7.0",
18
+ "@codeleap/utils": "5.7.0",
19
+ "@codeleap/store": "5.7.0",
20
20
  "@types/react-slick": "^0.23.13"
21
21
  },
22
22
  "scripts": {
@@ -45,14 +45,14 @@
45
45
  "uuid": "^8.3.2"
46
46
  },
47
47
  "peerDependencies": {
48
- "@codeleap/types": "5.6.2",
49
- "@codeleap/utils": "5.6.2",
50
- "@codeleap/hooks": "5.6.2",
51
- "@codeleap/i18n": "5.6.2",
52
- "@codeleap/query": "5.6.2",
53
- "@codeleap/logger": "5.6.2",
54
- "@codeleap/styles": "5.6.2",
55
- "@codeleap/store": "5.6.2",
48
+ "@codeleap/types": "5.7.0",
49
+ "@codeleap/utils": "5.7.0",
50
+ "@codeleap/hooks": "5.7.0",
51
+ "@codeleap/i18n": "5.7.0",
52
+ "@codeleap/query": "5.7.0",
53
+ "@codeleap/logger": "5.7.0",
54
+ "@codeleap/styles": "5.7.0",
55
+ "@codeleap/store": "5.7.0",
56
56
  "@emotion/react": "11.10.6",
57
57
  "@reach/router": "^1.3.4",
58
58
  "axios": "^1.7.9",
package/package.json.bak CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/web",
3
- "version": "5.6.2",
3
+ "version": "5.7.0",
4
4
  "main": "src/index.ts",
5
5
  "repository": {
6
6
  "url": "https://github.com/codeleap-uk/internal-libs-monorepo.git",
@@ -18,11 +18,17 @@ export const useStylesFor = <T = unknown>(componentName: string, style: StylePro
18
18
  const isServer = typeof window === 'undefined'
19
19
  const inEnvTransition = isServer ? false : !isMounted
20
20
 
21
- acc[key] = inEnvTransition ? { opacity: 0 } : styleValue
21
+ acc[key] = inEnvTransition ? {
22
+ // Despite what it may look like, this is not (just) a joke. The "orphans" property is almost completely useless,
23
+ // so we set it just to force the styles to recompute after hydration. Also picked for comedic impact.
24
+ orphans: 1,
25
+
26
+ ...styleValue } : styleValue
22
27
 
23
28
  return acc
24
29
  }, {} as T)
25
30
  }, [styles, isMounted])
26
31
 
27
32
  return processedStyles
33
+
28
34
  }