@webstudio-is/fonts 0.271.0 → 0.273.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/index.js +11 -11
- package/lib/types/schema.d.ts +8 -8
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -295,12 +295,12 @@ var getFontFaces = (assets, options) => {
|
|
|
295
295
|
|
|
296
296
|
// src/schema.ts
|
|
297
297
|
import { z } from "zod";
|
|
298
|
-
var
|
|
298
|
+
var fontFormat = z.union([
|
|
299
299
|
z.literal("ttf"),
|
|
300
300
|
z.literal("woff"),
|
|
301
301
|
z.literal("woff2")
|
|
302
302
|
]);
|
|
303
|
-
var
|
|
303
|
+
var axisName = z.enum([
|
|
304
304
|
"wght",
|
|
305
305
|
"wdth",
|
|
306
306
|
"slnt",
|
|
@@ -316,8 +316,8 @@ var AxisName = z.enum([
|
|
|
316
316
|
"YTDE",
|
|
317
317
|
"YTFI"
|
|
318
318
|
]);
|
|
319
|
-
var
|
|
320
|
-
|
|
319
|
+
var variationAxes = z.record(
|
|
320
|
+
axisName,
|
|
321
321
|
z.object({
|
|
322
322
|
name: z.string(),
|
|
323
323
|
min: z.number(),
|
|
@@ -325,16 +325,16 @@ var VariationAxes = z.record(
|
|
|
325
325
|
max: z.number()
|
|
326
326
|
})
|
|
327
327
|
);
|
|
328
|
-
var
|
|
328
|
+
var fontMetaStatic = z.object({
|
|
329
329
|
family: z.string(),
|
|
330
330
|
style: z.enum(FONT_STYLES),
|
|
331
331
|
weight: z.number()
|
|
332
332
|
});
|
|
333
|
-
var
|
|
333
|
+
var fontMetaVariable = z.object({
|
|
334
334
|
family: z.string(),
|
|
335
|
-
variationAxes
|
|
335
|
+
variationAxes
|
|
336
336
|
});
|
|
337
|
-
var
|
|
337
|
+
var fontMeta = z.union([fontMetaStatic, fontMetaVariable]);
|
|
338
338
|
|
|
339
339
|
// src/font-weights.ts
|
|
340
340
|
var fontWeights = {
|
|
@@ -386,10 +386,10 @@ export {
|
|
|
386
386
|
FONT_FORMATS,
|
|
387
387
|
FONT_MIME_TYPES,
|
|
388
388
|
FONT_STYLES,
|
|
389
|
-
FontFormat,
|
|
390
|
-
FontMeta,
|
|
391
|
-
FontMetaStatic,
|
|
392
389
|
SYSTEM_FONTS,
|
|
390
|
+
fontFormat,
|
|
391
|
+
fontMeta,
|
|
392
|
+
fontMetaStatic,
|
|
393
393
|
fontWeightNames,
|
|
394
394
|
fontWeights,
|
|
395
395
|
getFontFaces
|
package/lib/types/schema.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
3
|
-
export type FontFormat = z.infer<typeof
|
|
4
|
-
declare const
|
|
2
|
+
export declare const fontFormat: z.ZodUnion<[z.ZodLiteral<"ttf">, z.ZodLiteral<"woff">, z.ZodLiteral<"woff2">]>;
|
|
3
|
+
export type FontFormat = z.infer<typeof fontFormat>;
|
|
4
|
+
declare const variationAxes: z.ZodRecord<z.ZodEnum<["wght", "wdth", "slnt", "opsz", "ital", "GRAD", "XTRA", "XOPQ", "YOPQ", "YTLC", "YTUC", "YTAS", "YTDE", "YTFI"]>, z.ZodObject<{
|
|
5
5
|
name: z.ZodString;
|
|
6
6
|
min: z.ZodNumber;
|
|
7
7
|
default: z.ZodNumber;
|
|
@@ -17,8 +17,8 @@ declare const VariationAxes: z.ZodRecord<z.ZodEnum<["wght", "wdth", "slnt", "ops
|
|
|
17
17
|
default: number;
|
|
18
18
|
max: number;
|
|
19
19
|
}>>;
|
|
20
|
-
export type VariationAxes = z.infer<typeof
|
|
21
|
-
export declare const
|
|
20
|
+
export type VariationAxes = z.infer<typeof variationAxes>;
|
|
21
|
+
export declare const fontMetaStatic: z.ZodObject<{
|
|
22
22
|
family: z.ZodString;
|
|
23
23
|
style: z.ZodEnum<["normal", "italic", "oblique"]>;
|
|
24
24
|
weight: z.ZodNumber;
|
|
@@ -31,8 +31,8 @@ export declare const FontMetaStatic: z.ZodObject<{
|
|
|
31
31
|
style: "normal" | "italic" | "oblique";
|
|
32
32
|
weight: number;
|
|
33
33
|
}>;
|
|
34
|
-
export type FontMetaStatic = z.infer<typeof
|
|
35
|
-
export declare const
|
|
34
|
+
export type FontMetaStatic = z.infer<typeof fontMetaStatic>;
|
|
35
|
+
export declare const fontMeta: z.ZodUnion<[z.ZodObject<{
|
|
36
36
|
family: z.ZodString;
|
|
37
37
|
style: z.ZodEnum<["normal", "italic", "oblique"]>;
|
|
38
38
|
weight: z.ZodNumber;
|
|
@@ -79,5 +79,5 @@ export declare const FontMeta: z.ZodUnion<[z.ZodObject<{
|
|
|
79
79
|
max: number;
|
|
80
80
|
}>>;
|
|
81
81
|
}>]>;
|
|
82
|
-
export type FontMeta = z.infer<typeof
|
|
82
|
+
export type FontMeta = z.infer<typeof fontMeta>;
|
|
83
83
|
export {};
|