@webstudio-is/css-data 0.3.0 → 0.15.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.
Files changed (42) hide show
  1. package/lib/__generated__/keyword-values.js +6617 -6615
  2. package/lib/__generated__/properties.js +3200 -3198
  3. package/lib/__generated__/units.js +33 -31
  4. package/lib/cjs/__generated__/keyword-values.cjs +6636 -6617
  5. package/lib/cjs/__generated__/properties.cjs +3219 -3200
  6. package/lib/cjs/__generated__/units.cjs +52 -33
  7. package/lib/cjs/index.cjs +19 -18
  8. package/lib/cjs/popularity-index.cjs +4631 -4612
  9. package/lib/cjs/schema.cjs +87 -53
  10. package/lib/popularity-index.js +4612 -4610
  11. package/lib/schema.js +66 -49
  12. package/package.json +11 -19
  13. package/src/__generated__/keyword-values.ts +6616 -0
  14. package/src/__generated__/properties.ts +3200 -0
  15. package/src/__generated__/units.ts +32 -0
  16. package/{lib/cjs/index.d.ts → src/index.ts} +0 -1
  17. package/src/popularity-index.ts +4611 -0
  18. package/src/schema.ts +119 -0
  19. package/lib/__generated__/keyword-values.d.ts +0 -302
  20. package/lib/__generated__/keyword-values.d.ts.map +0 -1
  21. package/lib/__generated__/properties.d.ts +0 -3199
  22. package/lib/__generated__/properties.d.ts.map +0 -1
  23. package/lib/__generated__/units.d.ts +0 -2
  24. package/lib/__generated__/units.d.ts.map +0 -1
  25. package/lib/cjs/__generated__/keyword-values.d.ts +0 -302
  26. package/lib/cjs/__generated__/keyword-values.d.ts.map +0 -1
  27. package/lib/cjs/__generated__/properties.d.ts +0 -3199
  28. package/lib/cjs/__generated__/properties.d.ts.map +0 -1
  29. package/lib/cjs/__generated__/units.d.ts +0 -2
  30. package/lib/cjs/__generated__/units.d.ts.map +0 -1
  31. package/lib/cjs/index.d.ts.map +0 -1
  32. package/lib/cjs/popularity-index.d.ts +0 -7
  33. package/lib/cjs/popularity-index.d.ts.map +0 -1
  34. package/lib/cjs/schema.d.ts +0 -607
  35. package/lib/cjs/schema.d.ts.map +0 -1
  36. package/lib/index.d.ts +0 -5
  37. package/lib/index.d.ts.map +0 -1
  38. package/lib/popularity-index.d.ts +0 -7
  39. package/lib/popularity-index.d.ts.map +0 -1
  40. package/lib/schema.d.ts +0 -607
  41. package/lib/schema.d.ts.map +0 -1
  42. package/lib/tsconfig.tsbuildinfo +0 -1
@@ -1,58 +1,92 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Breakpoints = exports.Breakpoint = exports.CssRule = exports.Style = exports.StyleValue = exports.VarValue = exports.ValidStaticStyleValue = exports.validStaticValueTypes = exports.UnsetValue = exports.InvalidValue = exports.FontFamilyValue = exports.KeywordValue = exports.UnitValue = exports.Unit = void 0;
4
- const units_1 = require("./__generated__/units");
5
- const zod_1 = require("zod");
6
- exports.Unit = zod_1.z.union([zod_1.z.enum(units_1.units), zod_1.z.literal("number")]);
7
- exports.UnitValue = zod_1.z.object({
8
- type: zod_1.z.literal("unit"),
9
- unit: exports.Unit,
10
- value: zod_1.z.number(),
11
- });
12
- exports.KeywordValue = zod_1.z.object({
13
- type: zod_1.z.literal("keyword"),
14
- // @todo use exact type
15
- value: zod_1.z.string(),
16
- });
17
- exports.FontFamilyValue = zod_1.z.object({
18
- type: zod_1.z.literal("fontFamily"),
19
- value: zod_1.z.array(zod_1.z.string()),
20
- });
21
- // We want to be able to render the invalid value
22
- // and show it is invalid visually, without saving it to the db
23
- exports.InvalidValue = zod_1.z.object({
24
- type: zod_1.z.literal("invalid"),
25
- value: zod_1.z.string(),
26
- });
27
- exports.UnsetValue = zod_1.z.object({
28
- type: zod_1.z.literal("unset"),
29
- value: zod_1.z.literal(""),
30
- });
31
- exports.validStaticValueTypes = ["unit", "keyword", "fontFamily"];
32
- exports.ValidStaticStyleValue = zod_1.z.union([
33
- exports.UnitValue,
34
- exports.KeywordValue,
35
- exports.FontFamilyValue,
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var schema_exports = {};
20
+ __export(schema_exports, {
21
+ Breakpoint: () => Breakpoint,
22
+ Breakpoints: () => Breakpoints,
23
+ CssRule: () => CssRule,
24
+ validStaticValueTypes: () => validStaticValueTypes
25
+ });
26
+ module.exports = __toCommonJS(schema_exports);
27
+ var import_units = require("./__generated__/units");
28
+ var import_zod = require("zod");
29
+ const Unit = import_zod.z.union([import_zod.z.enum(import_units.units), import_zod.z.literal("number")]);
30
+ const UnitValue = import_zod.z.object({
31
+ type: import_zod.z.literal("unit"),
32
+ unit: Unit,
33
+ value: import_zod.z.number()
34
+ });
35
+ const KeywordValue = import_zod.z.object({
36
+ type: import_zod.z.literal("keyword"),
37
+ value: import_zod.z.string()
38
+ });
39
+ const FontFamilyValue = import_zod.z.object({
40
+ type: import_zod.z.literal("fontFamily"),
41
+ value: import_zod.z.array(import_zod.z.string())
42
+ });
43
+ const RgbValue = import_zod.z.object({
44
+ type: import_zod.z.literal("rgb"),
45
+ r: import_zod.z.number(),
46
+ g: import_zod.z.number(),
47
+ b: import_zod.z.number(),
48
+ alpha: import_zod.z.number()
49
+ });
50
+ const InvalidValue = import_zod.z.object({
51
+ type: import_zod.z.literal("invalid"),
52
+ value: import_zod.z.string()
53
+ });
54
+ const UnsetValue = import_zod.z.object({
55
+ type: import_zod.z.literal("unset"),
56
+ value: import_zod.z.literal("")
57
+ });
58
+ const validStaticValueTypes = [
59
+ "unit",
60
+ "keyword",
61
+ "fontFamily",
62
+ "rgb"
63
+ ];
64
+ const ValidStaticStyleValue = import_zod.z.union([
65
+ UnitValue,
66
+ KeywordValue,
67
+ FontFamilyValue,
68
+ RgbValue
36
69
  ]);
37
- exports.VarValue = zod_1.z.object({
38
- type: zod_1.z.literal("var"),
39
- value: zod_1.z.string(),
40
- fallbacks: zod_1.z.array(exports.ValidStaticStyleValue),
41
- });
42
- exports.StyleValue = zod_1.z.union([
43
- exports.ValidStaticStyleValue,
44
- exports.InvalidValue,
45
- exports.UnsetValue,
46
- exports.VarValue,
70
+ const VarValue = import_zod.z.object({
71
+ type: import_zod.z.literal("var"),
72
+ value: import_zod.z.string(),
73
+ fallbacks: import_zod.z.array(ValidStaticStyleValue)
74
+ });
75
+ const StyleValue = import_zod.z.union([
76
+ ValidStaticStyleValue,
77
+ InvalidValue,
78
+ UnsetValue,
79
+ VarValue,
80
+ RgbValue
47
81
  ]);
48
- exports.Style = zod_1.z.record(zod_1.z.string(), exports.StyleValue);
49
- exports.CssRule = zod_1.z.object({
50
- style: exports.Style,
51
- breakpoint: zod_1.z.optional(zod_1.z.string()),
82
+ const Style = import_zod.z.record(import_zod.z.string(), StyleValue);
83
+ const CssRule = import_zod.z.object({
84
+ style: Style,
85
+ breakpoint: import_zod.z.optional(import_zod.z.string())
52
86
  });
53
- exports.Breakpoint = zod_1.z.object({
54
- id: zod_1.z.string(),
55
- label: zod_1.z.string(),
56
- minWidth: zod_1.z.number(),
87
+ const Breakpoint = import_zod.z.object({
88
+ id: import_zod.z.string(),
89
+ label: import_zod.z.string(),
90
+ minWidth: import_zod.z.number()
57
91
  });
58
- exports.Breakpoints = zod_1.z.array(exports.Breakpoint);
92
+ const Breakpoints = import_zod.z.array(Breakpoint);