@remotion/animation-utils 4.0.437 → 4.0.439

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.
@@ -12,6 +12,10 @@ var PERCENTAGE = NUMBER + "%";
12
12
  function call(...args) {
13
13
  return "\\(\\s*(" + args.join(")\\s*,\\s*(") + ")\\s*\\)";
14
14
  }
15
+ var MODERN_VALUE = "(?:none|[-+]?\\d*\\.?\\d+(?:%|deg|rad|grad|turn)?)";
16
+ function modernColorCall(name) {
17
+ return new RegExp(name + "\\(\\s*(" + MODERN_VALUE + ")\\s+(" + MODERN_VALUE + ")\\s+(" + MODERN_VALUE + ")(?:\\s*\\/\\s*(" + MODERN_VALUE + "))?\\s*\\)");
18
+ }
15
19
  function getColorMatchers() {
16
20
  const cachedMatchers = {
17
21
  rgb: undefined,
@@ -22,7 +26,12 @@ function getColorMatchers() {
22
26
  hex4: undefined,
23
27
  hex5: undefined,
24
28
  hex6: undefined,
25
- hex8: undefined
29
+ hex8: undefined,
30
+ oklch: undefined,
31
+ oklab: undefined,
32
+ lab: undefined,
33
+ lch: undefined,
34
+ hwb: undefined
26
35
  };
27
36
  if (cachedMatchers.rgb === undefined) {
28
37
  cachedMatchers.rgb = new RegExp("rgb" + call(NUMBER, NUMBER, NUMBER));
@@ -33,6 +42,11 @@ function getColorMatchers() {
33
42
  cachedMatchers.hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
34
43
  cachedMatchers.hex6 = /^#([0-9a-fA-F]{6})$/;
35
44
  cachedMatchers.hex8 = /^#([0-9a-fA-F]{8})$/;
45
+ cachedMatchers.oklch = modernColorCall("oklch");
46
+ cachedMatchers.oklab = modernColorCall("oklab");
47
+ cachedMatchers.lab = modernColorCall("lab");
48
+ cachedMatchers.lch = modernColorCall("lch");
49
+ cachedMatchers.hwb = modernColorCall("hwb");
36
50
  }
37
51
  return cachedMatchers;
38
52
  }
@@ -94,7 +108,7 @@ var isColorValue = (value) => {
94
108
  return true;
95
109
  }
96
110
  const matchers = getColorMatchers();
97
- return matchers.rgb?.test(value) || matchers.rgba?.test(value) || matchers.hsl?.test(value) || matchers.hsla?.test(value) || matchers.hex3?.test(value) || matchers.hex4?.test(value) || matchers.hex5?.test(value) || matchers.hex6?.test(value) || matchers.hex8?.test(value);
111
+ return matchers.rgb?.test(value) || matchers.rgba?.test(value) || matchers.hsl?.test(value) || matchers.hsla?.test(value) || matchers.hex3?.test(value) || matchers.hex4?.test(value) || matchers.hex5?.test(value) || matchers.hex6?.test(value) || matchers.hex8?.test(value) || matchers.oklch?.test(value) || matchers.oklab?.test(value) || matchers.lab?.test(value) || matchers.lch?.test(value) || matchers.hwb?.test(value);
98
112
  };
99
113
  var classifyParts = (parts) => {
100
114
  return parts.map((part) => {
@@ -7,6 +7,19 @@ const constants_1 = require("./constants");
7
7
  function call(...args) {
8
8
  return '\\(\\s*(' + args.join(')\\s*,\\s*(') + ')\\s*\\)';
9
9
  }
10
+ const MODERN_VALUE = '(?:none|[-+]?\\d*\\.?\\d+(?:%|deg|rad|grad|turn)?)';
11
+ function modernColorCall(name) {
12
+ return new RegExp(name +
13
+ '\\(\\s*(' +
14
+ MODERN_VALUE +
15
+ ')\\s+(' +
16
+ MODERN_VALUE +
17
+ ')\\s+(' +
18
+ MODERN_VALUE +
19
+ ')(?:\\s*\\/\\s*(' +
20
+ MODERN_VALUE +
21
+ '))?\\s*\\)');
22
+ }
10
23
  function getColorMatchers() {
11
24
  const cachedMatchers = {
12
25
  rgb: undefined,
@@ -18,6 +31,11 @@ function getColorMatchers() {
18
31
  hex5: undefined,
19
32
  hex6: undefined,
20
33
  hex8: undefined,
34
+ oklch: undefined,
35
+ oklab: undefined,
36
+ lab: undefined,
37
+ lch: undefined,
38
+ hwb: undefined,
21
39
  };
22
40
  if (cachedMatchers.rgb === undefined) {
23
41
  cachedMatchers.rgb = new RegExp('rgb' + call(constants_1.NUMBER, constants_1.NUMBER, constants_1.NUMBER));
@@ -29,6 +47,11 @@ function getColorMatchers() {
29
47
  /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
30
48
  cachedMatchers.hex6 = /^#([0-9a-fA-F]{6})$/;
31
49
  cachedMatchers.hex8 = /^#([0-9a-fA-F]{8})$/;
50
+ cachedMatchers.oklch = modernColorCall('oklch');
51
+ cachedMatchers.oklab = modernColorCall('oklab');
52
+ cachedMatchers.lab = modernColorCall('lab');
53
+ cachedMatchers.lch = modernColorCall('lch');
54
+ cachedMatchers.hwb = modernColorCall('hwb');
32
55
  }
33
56
  return cachedMatchers;
34
57
  }
@@ -92,7 +115,7 @@ const classifyArgsOfFunction = (value) => {
92
115
  });
93
116
  };
94
117
  const isColorValue = (value) => {
95
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
118
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
96
119
  if (Object.keys(no_react_1.NoReactInternals.colorNames).includes(value)) {
97
120
  return true;
98
121
  }
@@ -105,7 +128,12 @@ const isColorValue = (value) => {
105
128
  ((_f = matchers.hex4) === null || _f === void 0 ? void 0 : _f.test(value)) ||
106
129
  ((_g = matchers.hex5) === null || _g === void 0 ? void 0 : _g.test(value)) ||
107
130
  ((_h = matchers.hex6) === null || _h === void 0 ? void 0 : _h.test(value)) ||
108
- ((_j = matchers.hex8) === null || _j === void 0 ? void 0 : _j.test(value)));
131
+ ((_j = matchers.hex8) === null || _j === void 0 ? void 0 : _j.test(value)) ||
132
+ ((_k = matchers.oklch) === null || _k === void 0 ? void 0 : _k.test(value)) ||
133
+ ((_l = matchers.oklab) === null || _l === void 0 ? void 0 : _l.test(value)) ||
134
+ ((_m = matchers.lab) === null || _m === void 0 ? void 0 : _m.test(value)) ||
135
+ ((_o = matchers.lch) === null || _o === void 0 ? void 0 : _o.test(value)) ||
136
+ ((_p = matchers.hwb) === null || _p === void 0 ? void 0 : _p.test(value)));
109
137
  };
110
138
  const classifyParts = (parts) => {
111
139
  return parts.map((part) => {
package/dist/type.d.ts CHANGED
@@ -21,6 +21,11 @@ type ColorMatchers = {
21
21
  hex5: MatcherType;
22
22
  hex6: MatcherType;
23
23
  hex8: MatcherType;
24
+ oklch: MatcherType;
25
+ oklab: MatcherType;
26
+ lab: MatcherType;
27
+ lch: MatcherType;
28
+ hwb: MatcherType;
24
29
  };
25
30
  type Style = React.CSSProperties;
26
31
  type CSSPropertiesKey = keyof Style;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "name": "Chetan Karwa",
8
8
  "email": "cbkarwa@gmail.com"
9
9
  },
10
- "version": "4.0.437",
10
+ "version": "4.0.439",
11
11
  "description": "Helpers for animating CSS properties",
12
12
  "main": "./dist/index.js",
13
13
  "module": "./dist/index.mjs",
@@ -20,7 +20,7 @@
20
20
  "test": "bun test src"
21
21
  },
22
22
  "dependencies": {
23
- "remotion": "4.0.437"
23
+ "remotion": "4.0.439"
24
24
  },
25
25
  "files": [
26
26
  "dist",
@@ -31,7 +31,7 @@
31
31
  "react-dom": ">=16.8.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@remotion/eslint-config-internal": "4.0.437",
34
+ "@remotion/eslint-config-internal": "4.0.439",
35
35
  "eslint": "9.19.0",
36
36
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
37
37
  },