@webstudio-is/css-data 0.1.0 → 0.3.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.
- package/lib/{keyword-values.d.ts → __generated__/keyword-values.d.ts} +0 -0
- package/lib/{keyword-values.d.ts.map → __generated__/keyword-values.d.ts.map} +1 -1
- package/lib/__generated__/keyword-values.js +6616 -0
- package/lib/{properties.d.ts → __generated__/properties.d.ts} +0 -0
- package/lib/{properties.d.ts.map → __generated__/properties.d.ts.map} +1 -1
- package/lib/__generated__/properties.js +3199 -0
- package/lib/{units.d.ts → __generated__/units.d.ts} +0 -0
- package/lib/__generated__/units.d.ts.map +1 -0
- package/lib/__generated__/units.js +32 -0
- package/lib/{keyword-values.js → cjs/__generated__/keyword-values.cjs} +0 -0
- package/lib/cjs/__generated__/keyword-values.d.ts +302 -0
- package/lib/cjs/__generated__/keyword-values.d.ts.map +1 -0
- package/lib/{properties.js → cjs/__generated__/properties.cjs} +0 -0
- package/lib/cjs/__generated__/properties.d.ts +3199 -0
- package/lib/cjs/__generated__/properties.d.ts.map +1 -0
- package/lib/{units.js → cjs/__generated__/units.cjs} +0 -0
- package/lib/cjs/__generated__/units.d.ts +2 -0
- package/lib/cjs/__generated__/units.d.ts.map +1 -0
- package/lib/cjs/index.cjs +20 -0
- package/lib/cjs/index.d.ts +5 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/lib/cjs/popularity-index.cjs +4614 -0
- package/lib/cjs/popularity-index.d.ts +7 -0
- package/lib/cjs/popularity-index.d.ts.map +1 -0
- package/lib/cjs/schema.cjs +58 -0
- package/lib/cjs/schema.d.ts +607 -0
- package/lib/cjs/schema.d.ts.map +1 -0
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -20
- package/lib/popularity-index.js +1 -4
- package/lib/schema.d.ts +14 -5
- package/lib/schema.d.ts.map +1 -1
- package/lib/schema.js +46 -49
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +12 -7
- package/lib/units.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popularity-index.d.ts","sourceRoot":"","sources":["../../src/popularity-index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe;;;;;GAigJ3B,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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,
|
|
36
|
+
]);
|
|
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,
|
|
47
|
+
]);
|
|
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()),
|
|
52
|
+
});
|
|
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(),
|
|
57
|
+
});
|
|
58
|
+
exports.Breakpoints = zod_1.z.array(exports.Breakpoint);
|