@css-hooks/qwik 4.0.0-next.90 → 4.0.0-next.94

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/LICENSE CHANGED
@@ -2,10 +2,6 @@ MIT License
2
2
 
3
3
  Copyright (c) 2023 Nick Saunders
4
4
 
5
- Copyright (c) BuilderIO
6
-
7
- Copyright (c) Meta Platforms Inc. and affiliates.
8
-
9
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
10
6
  this software and associated documentation files (the "Software"), to deal in
11
7
  the Software without restriction, including without limitation the rights to
package/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  <div align="center">
2
- <a id="logomark" href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.90/.github/logomark.svg" height="128" /></a><br/><br/>
2
+ <a id="logomark" href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.94/.github/logomark.svg" height="128" /></a><br/><br/>
3
3
  <div id="wordmark">
4
- <a href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.90/.github/wordmark-dark.svg" width="256"></a>
4
+ <a href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.94/.github/wordmark-dark.svg" width="256"></a>
5
5
  </div>
6
6
  </div>
7
7
 
8
8
  <br/>
9
9
 
10
10
  <div align="center" id="badges">
11
- <a href="https://github.com/css-hooks/css-hooks/tree/v4.0.0-next.90"><img src="https://img.shields.io/badge/tag-v4.0.0--next.90-ffd700" alt="tag v4.0.0-next.90"></a>
12
- <a href="https://www.npmjs.com/package/@css-hooks/qwik/v/4.0.0-next.90"><img src="https://img.shields.io/badge/npm-v4.0.0--next.90-ffd700" alt="npm version"></a>
13
- <a href="https://github.com/css-hooks/css-hooks/blob/v4.0.0-next.90/LICENSE"><img src="https://img.shields.io/badge/license-MIT-ffd700" alt="license"></a>
11
+ <a href="https://github.com/css-hooks/css-hooks/tree/v4.0.0-next.94"><img src="https://img.shields.io/badge/tag-v4.0.0--next.94-ffd700" alt="tag v4.0.0-next.94"></a>
12
+ <a href="https://www.npmjs.com/package/@css-hooks/qwik/v/4.0.0-next.94"><img src="https://img.shields.io/badge/npm-v4.0.0--next.94-ffd700" alt="npm version"></a>
13
+ <a href="https://github.com/css-hooks/css-hooks/blob/v4.0.0-next.94/LICENSE"><img src="https://img.shields.io/badge/license-MIT-ffd700" alt="license"></a>
14
14
  </div>
15
15
 
16
16
  ---
package/cjs/index.d.ts CHANGED
@@ -21,13 +21,3 @@ export declare function _stringifyValue(value: unknown, propertyName: string): s
21
21
  export declare const createHooks: import("@css-hooks/core").CreateHooksFn<CSSProperties>;
22
22
  /** A style merger configured to use Qwik’s `CSSProperties` type. @public */
23
23
  export declare const mergeStyles: HooksSystem<CSSProperties, CSSPropertyConflicts>["mergeStyles"];
24
- /**
25
- * Following code (c) Builder.io. Source modified to account for custom
26
- * properties.
27
- */
28
- /**
29
- * CSS properties which accept numbers but are not in units of "px".
30
- *
31
- * @internal
32
- */
33
- export declare const _unitlessNumbers: Set<string>;
package/cjs/index.js CHANGED
@@ -5,9 +5,11 @@
5
5
  * @packageDocumentation
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports._unitlessNumbers = exports.mergeStyles = exports.createHooks = void 0;
8
+ exports.mergeStyles = exports.createHooks = void 0;
9
9
  exports._stringifyValue = _stringifyValue;
10
10
  const core_1 = require("@css-hooks/core");
11
+ /** Unitless properties observed in Chromium, Firefox, and WebKit */
12
+ const UNITLESS = /^(--|(Moz(ForceBrokenImageIcon|TabSize)|lineHeight|tabSize|font(SizeAdjus|Weigh)t|widows|scale|(s|WebkitS)hapeImageThreshold|((border|WebkitMaskBox)Image|maskBorder)(Outset|Slice|Width)?|(Moz|Webkit)Bo(rderImage|x(Flex|OrdinalGroup))|stroke(Dash(array|offset)|Miterlimit|Width)|mathDepth|hyphenateLimit(Char|Line)s|readingOrder|Webkit(BoxFlexGroup|HyphenateLimit(After|Before|Lines)|LineClamp|Perspective)|aspectRatio|(i|WebkitI)nitialLetter|flexLineCount|(a|(Moz|Webkit)A)nimation(IterationCount)?|(c|WebkitC)olumn(s|Count)|(f|WebkitF)lex(Grow|Shrink)?|(o|WebkitO)(pacity|rder)|grid(Area|(Column|Row)(End|Start)?)|(fill|flood|stop|stroke)Opacity|orphans|z(Index|oom))$)/;
11
13
  /** @internal */
12
14
  function _stringifyValue(value, propertyName) {
13
15
  switch (typeof value) {
@@ -29,61 +31,6 @@ const hooksSystem = (0, core_1.createHooksSystem)(_stringifyValue);
29
31
  exports.createHooks = hooksSystem.createHooks;
30
32
  /** A style merger configured to use Qwik’s `CSSProperties` type. @public */
31
33
  exports.mergeStyles = hooksSystem.mergeStyles;
32
- /**
33
- * Following code (c) Builder.io. Source modified to account for custom
34
- * properties.
35
- */
36
- /**
37
- * CSS properties which accept numbers but are not in units of "px".
38
- *
39
- * @internal
40
- */
41
- exports._unitlessNumbers = new Set([
42
- "animationIterationCount",
43
- "aspectRatio",
44
- "borderImageOutset",
45
- "borderImageSlice",
46
- "borderImageWidth",
47
- "boxFlex",
48
- "boxFlexGroup",
49
- "boxOrdinalGroup",
50
- "columnCount",
51
- "columns",
52
- "flex",
53
- "flexGrow",
54
- "flexShrink",
55
- "gridArea",
56
- "gridRow",
57
- "gridRowEnd",
58
- "gridRowStart",
59
- "gridColumn",
60
- "gridColumnEnd",
61
- "gridColumnStart",
62
- "fontWeight",
63
- "lineClamp",
64
- "lineHeight",
65
- "opacity",
66
- "order",
67
- "orphans",
68
- "scale",
69
- "tabSize",
70
- "widows",
71
- "zIndex",
72
- "zoom",
73
- "MozAnimationIterationCount", // Known Prefixed Properties
74
- "MozBoxFlex", // TODO: Remove these since they shouldn't be used in modern code
75
- "msFlex",
76
- "msFlexPositive",
77
- "WebkitAnimationIterationCount",
78
- "WebkitBoxFlex",
79
- "WebkitBoxOrdinalGroup",
80
- "WebkitColumnCount",
81
- "WebkitColumns",
82
- "WebkitFlex",
83
- "WebkitFlexGrow",
84
- "WebkitFlexShrink",
85
- "WebkitLineClamp",
86
- ]);
87
34
  function isUnitlessNumber(name) {
88
35
  if (name.startsWith("--")) {
89
36
  return true;
@@ -91,5 +38,5 @@ function isUnitlessNumber(name) {
91
38
  const camelCaseName = name
92
39
  .replace(/^-ms-/, "ms-")
93
40
  .replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
94
- return exports._unitlessNumbers.has(camelCaseName);
41
+ return UNITLESS.test(camelCaseName);
95
42
  }
package/esm/index.d.ts CHANGED
@@ -21,13 +21,3 @@ export declare function _stringifyValue(value: unknown, propertyName: string): s
21
21
  export declare const createHooks: import("@css-hooks/core").CreateHooksFn<CSSProperties>;
22
22
  /** A style merger configured to use Qwik’s `CSSProperties` type. @public */
23
23
  export declare const mergeStyles: HooksSystem<CSSProperties, CSSPropertyConflicts>["mergeStyles"];
24
- /**
25
- * Following code (c) Builder.io. Source modified to account for custom
26
- * properties.
27
- */
28
- /**
29
- * CSS properties which accept numbers but are not in units of "px".
30
- *
31
- * @internal
32
- */
33
- export declare const _unitlessNumbers: Set<string>;
package/esm/index.js CHANGED
@@ -4,6 +4,8 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
  import { createHooksSystem } from "@css-hooks/core";
7
+ /** Unitless properties observed in Chromium, Firefox, and WebKit */
8
+ const UNITLESS = /^(--|(Moz(ForceBrokenImageIcon|TabSize)|lineHeight|tabSize|font(SizeAdjus|Weigh)t|widows|scale|(s|WebkitS)hapeImageThreshold|((border|WebkitMaskBox)Image|maskBorder)(Outset|Slice|Width)?|(Moz|Webkit)Bo(rderImage|x(Flex|OrdinalGroup))|stroke(Dash(array|offset)|Miterlimit|Width)|mathDepth|hyphenateLimit(Char|Line)s|readingOrder|Webkit(BoxFlexGroup|HyphenateLimit(After|Before|Lines)|LineClamp|Perspective)|aspectRatio|(i|WebkitI)nitialLetter|flexLineCount|(a|(Moz|Webkit)A)nimation(IterationCount)?|(c|WebkitC)olumn(s|Count)|(f|WebkitF)lex(Grow|Shrink)?|(o|WebkitO)(pacity|rder)|grid(Area|(Column|Row)(End|Start)?)|(fill|flood|stop|stroke)Opacity|orphans|z(Index|oom))$)/;
7
9
  /** @internal */
8
10
  export function _stringifyValue(value, propertyName) {
9
11
  switch (typeof value) {
@@ -25,61 +27,6 @@ const hooksSystem = createHooksSystem(_stringifyValue);
25
27
  export const createHooks = hooksSystem.createHooks;
26
28
  /** A style merger configured to use Qwik’s `CSSProperties` type. @public */
27
29
  export const mergeStyles = hooksSystem.mergeStyles;
28
- /**
29
- * Following code (c) Builder.io. Source modified to account for custom
30
- * properties.
31
- */
32
- /**
33
- * CSS properties which accept numbers but are not in units of "px".
34
- *
35
- * @internal
36
- */
37
- export const _unitlessNumbers = new Set([
38
- "animationIterationCount",
39
- "aspectRatio",
40
- "borderImageOutset",
41
- "borderImageSlice",
42
- "borderImageWidth",
43
- "boxFlex",
44
- "boxFlexGroup",
45
- "boxOrdinalGroup",
46
- "columnCount",
47
- "columns",
48
- "flex",
49
- "flexGrow",
50
- "flexShrink",
51
- "gridArea",
52
- "gridRow",
53
- "gridRowEnd",
54
- "gridRowStart",
55
- "gridColumn",
56
- "gridColumnEnd",
57
- "gridColumnStart",
58
- "fontWeight",
59
- "lineClamp",
60
- "lineHeight",
61
- "opacity",
62
- "order",
63
- "orphans",
64
- "scale",
65
- "tabSize",
66
- "widows",
67
- "zIndex",
68
- "zoom",
69
- "MozAnimationIterationCount", // Known Prefixed Properties
70
- "MozBoxFlex", // TODO: Remove these since they shouldn't be used in modern code
71
- "msFlex",
72
- "msFlexPositive",
73
- "WebkitAnimationIterationCount",
74
- "WebkitBoxFlex",
75
- "WebkitBoxOrdinalGroup",
76
- "WebkitColumnCount",
77
- "WebkitColumns",
78
- "WebkitFlex",
79
- "WebkitFlexGrow",
80
- "WebkitFlexShrink",
81
- "WebkitLineClamp",
82
- ]);
83
30
  function isUnitlessNumber(name) {
84
31
  if (name.startsWith("--")) {
85
32
  return true;
@@ -87,5 +34,5 @@ function isUnitlessNumber(name) {
87
34
  const camelCaseName = name
88
35
  .replace(/^-ms-/, "ms-")
89
36
  .replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
90
- return _unitlessNumbers.has(camelCaseName);
37
+ return UNITLESS.test(camelCaseName);
91
38
  }
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@css-hooks/qwik",
3
3
  "description": "CSS Hooks for Qwik",
4
- "version": "4.0.0-next.90",
4
+ "version": "4.0.0-next.94",
5
5
  "author": "Nick Saunders",
6
6
  "dependencies": {
7
- "@css-hooks/core": "4.0.0-next.90"
7
+ "@css-hooks/core": "4.0.0-next.94"
8
8
  },
9
9
  "devDependencies": {
10
- "@qwik.dev/core": "^2.0.0-beta.30"
10
+ "@qwik.dev/core": "^2.0.0-beta.30",
11
+ "@test/css-property-inventory": "4.0.0-next.94",
12
+ "@test/quickstart": "4.0.0-next.94"
11
13
  },
12
14
  "files": [
13
15
  "cjs",
@@ -40,7 +42,7 @@
40
42
  "build": "wireit",
41
43
  "codegen": "npm run --silent start -w @scripts/css-property-conflicts -- --casing camel --casing kebab > src/css-property-conflicts.ts",
42
44
  "prepublishOnly": "wireit",
43
- "test": "node --conditions @css-hooks/source --test src/index.test.ts"
45
+ "test": "tsc && node --conditions @css-hooks/source --test test/index.ts test/quickstart.ts"
44
46
  },
45
47
  "wireit": {
46
48
  "attw": {
@@ -56,7 +58,7 @@
56
58
  ]
57
59
  },
58
60
  "build": {
59
- "command": "tsc && tsc --project tsconfig.cjs.json && node -e \"require('node:fs').writeFileSync('cjs/package.json', JSON.stringify({type:'commonjs'}))\"",
61
+ "command": "tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json && node -e \"require('node:fs').writeFileSync('cjs/package.json', JSON.stringify({type:'commonjs'}))\"",
60
62
  "dependencies": [
61
63
  "../core:build"
62
64
  ]