@webstudio-is/css-data 0.2.0 → 0.4.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 (50) hide show
  1. package/lib/__generated__/keyword-values.js +6618 -0
  2. package/lib/__generated__/properties.js +3201 -0
  3. package/lib/__generated__/units.js +34 -0
  4. package/lib/cjs/__generated__/keyword-values.cjs +6638 -0
  5. package/lib/cjs/__generated__/properties.cjs +3221 -0
  6. package/lib/cjs/__generated__/units.cjs +54 -0
  7. package/lib/cjs/index.cjs +19 -18
  8. package/lib/cjs/popularity-index.cjs +4631 -4612
  9. package/lib/cjs/schema.cjs +83 -53
  10. package/lib/index.js +3 -3
  11. package/lib/popularity-index.js +4612 -4610
  12. package/lib/schema.js +63 -50
  13. package/package.json +11 -19
  14. package/src/__generated__/keyword-values.ts +6616 -0
  15. package/src/__generated__/properties.ts +3200 -0
  16. package/src/__generated__/units.ts +32 -0
  17. package/src/index.ts +4 -0
  18. package/src/popularity-index.ts +4611 -0
  19. package/src/schema.ts +103 -0
  20. package/lib/cjs/index.d.ts +0 -5
  21. package/lib/cjs/index.d.ts.map +0 -1
  22. package/lib/cjs/keyword-values.cjs +0 -6619
  23. package/lib/cjs/keyword-values.d.ts +0 -302
  24. package/lib/cjs/keyword-values.d.ts.map +0 -1
  25. package/lib/cjs/popularity-index.d.ts +0 -7
  26. package/lib/cjs/popularity-index.d.ts.map +0 -1
  27. package/lib/cjs/properties.cjs +0 -3202
  28. package/lib/cjs/properties.d.ts +0 -3199
  29. package/lib/cjs/properties.d.ts.map +0 -1
  30. package/lib/cjs/schema.d.ts +0 -598
  31. package/lib/cjs/schema.d.ts.map +0 -1
  32. package/lib/cjs/units.cjs +0 -35
  33. package/lib/cjs/units.d.ts +0 -2
  34. package/lib/cjs/units.d.ts.map +0 -1
  35. package/lib/index.d.ts +0 -5
  36. package/lib/index.d.ts.map +0 -1
  37. package/lib/keyword-values.d.ts +0 -302
  38. package/lib/keyword-values.d.ts.map +0 -1
  39. package/lib/keyword-values.js +0 -6616
  40. package/lib/popularity-index.d.ts +0 -7
  41. package/lib/popularity-index.d.ts.map +0 -1
  42. package/lib/properties.d.ts +0 -3199
  43. package/lib/properties.d.ts.map +0 -1
  44. package/lib/properties.js +0 -3199
  45. package/lib/schema.d.ts +0 -598
  46. package/lib/schema.d.ts.map +0 -1
  47. package/lib/tsconfig.tsbuildinfo +0 -1
  48. package/lib/units.d.ts +0 -2
  49. package/lib/units.d.ts.map +0 -1
  50. package/lib/units.js +0 -32
@@ -1,58 +1,88 @@
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("./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
+ FontFamilyValue: () => FontFamilyValue,
25
+ InvalidValue: () => InvalidValue,
26
+ KeywordValue: () => KeywordValue,
27
+ Style: () => Style,
28
+ StyleValue: () => StyleValue,
29
+ Unit: () => Unit,
30
+ UnitValue: () => UnitValue,
31
+ UnsetValue: () => UnsetValue,
32
+ ValidStaticStyleValue: () => ValidStaticStyleValue,
33
+ VarValue: () => VarValue,
34
+ validStaticValueTypes: () => validStaticValueTypes
35
+ });
36
+ module.exports = __toCommonJS(schema_exports);
37
+ var import_units = require("./__generated__/units");
38
+ var import_zod = require("zod");
39
+ const Unit = import_zod.z.union([import_zod.z.enum(import_units.units), import_zod.z.literal("number")]);
40
+ const UnitValue = import_zod.z.object({
41
+ type: import_zod.z.literal("unit"),
42
+ unit: Unit,
43
+ value: import_zod.z.number()
44
+ });
45
+ const KeywordValue = import_zod.z.object({
46
+ type: import_zod.z.literal("keyword"),
47
+ value: import_zod.z.string()
48
+ });
49
+ const FontFamilyValue = import_zod.z.object({
50
+ type: import_zod.z.literal("fontFamily"),
51
+ value: import_zod.z.array(import_zod.z.string())
52
+ });
53
+ const InvalidValue = import_zod.z.object({
54
+ type: import_zod.z.literal("invalid"),
55
+ value: import_zod.z.string()
56
+ });
57
+ const UnsetValue = import_zod.z.object({
58
+ type: import_zod.z.literal("unset"),
59
+ value: import_zod.z.literal("")
60
+ });
61
+ const validStaticValueTypes = ["unit", "keyword", "fontFamily"];
62
+ const ValidStaticStyleValue = import_zod.z.union([
63
+ UnitValue,
64
+ KeywordValue,
65
+ FontFamilyValue
36
66
  ]);
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,
67
+ const VarValue = import_zod.z.object({
68
+ type: import_zod.z.literal("var"),
69
+ value: import_zod.z.string(),
70
+ fallbacks: import_zod.z.array(ValidStaticStyleValue)
71
+ });
72
+ const StyleValue = import_zod.z.union([
73
+ ValidStaticStyleValue,
74
+ InvalidValue,
75
+ UnsetValue,
76
+ VarValue
47
77
  ]);
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.string(),
78
+ const Style = import_zod.z.record(import_zod.z.string(), StyleValue);
79
+ const CssRule = import_zod.z.object({
80
+ style: Style,
81
+ breakpoint: import_zod.z.optional(import_zod.z.string())
52
82
  });
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(),
83
+ const Breakpoint = import_zod.z.object({
84
+ id: import_zod.z.string(),
85
+ label: import_zod.z.string(),
86
+ minWidth: import_zod.z.number()
57
87
  });
58
- exports.Breakpoints = zod_1.z.array(exports.Breakpoint);
88
+ const Breakpoints = import_zod.z.array(Breakpoint);
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./keyword-values";
2
- export * from "./properties";
3
- export * from "./units";
1
+ export * from "./__generated__/keyword-values";
2
+ export * from "./__generated__/properties";
3
+ export * from "./__generated__/units";
4
4
  export * from "./schema";