@wp-typia/block-types 0.1.0 → 0.1.3
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/README.md +8 -0
- package/dist/block-editor/color.d.ts +24 -0
- package/dist/block-editor/color.js +7 -0
- package/dist/block-editor/dimensions.d.ts +17 -0
- package/dist/block-editor/dimensions.js +18 -0
- package/dist/block-editor/index.d.ts +2 -0
- package/dist/block-editor/index.js +2 -0
- package/package.json +16 -2
package/README.md
CHANGED
|
@@ -29,7 +29,15 @@ Shared WordPress block semantic types derived from Gutenberg source and unoffici
|
|
|
29
29
|
## Current v1 areas
|
|
30
30
|
|
|
31
31
|
- block editor alignment and content-position values
|
|
32
|
+
- color and dimensions helper types
|
|
32
33
|
- layout and flex vocabulary
|
|
33
34
|
- spacing sides and axes
|
|
34
35
|
- typography enums used by core block supports
|
|
35
36
|
- block support keys used by `block.json`
|
|
37
|
+
|
|
38
|
+
## Typia pipeline notes
|
|
39
|
+
|
|
40
|
+
- `CssColorValue` and `MinHeightValue` are richer DX aliases that currently rely on template literal types.
|
|
41
|
+
- imported template literal aliases are not yet consumed by the `sync-types` metadata pipeline
|
|
42
|
+
- when a type must round-trip through `types.ts` -> `typia.manifest.json` -> `typia-validator.php`, prefer pipeline-compatible aliases such as `CssNamedColor` and `MinHeightKeyword`
|
|
43
|
+
- for broader CSS-like string shapes in `types.ts`, prefer native Typia constraints on `string`, for example `string & tags.Pattern<"..."> & tags.MaxLength<...>`
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Practical CSS color vocabulary used by block editor controls and theme.json values.
|
|
3
|
+
*
|
|
4
|
+
* This is primarily a type-level DX helper today. Typia metadata generation does
|
|
5
|
+
* not yet consume template literal aliases like `#${string}` or `rgb(${string})`
|
|
6
|
+
* when they are imported into `types.ts`.
|
|
7
|
+
*/
|
|
8
|
+
export type CssColorValue = `#${string}` | `rgb(${string})` | `rgba(${string})` | `hsl(${string})` | `hsla(${string})` | `var(${string})` | `color-mix(${string})` | "transparent" | "currentColor";
|
|
9
|
+
/**
|
|
10
|
+
* Pipeline-compatible named-color subset for use in `types.ts`.
|
|
11
|
+
*
|
|
12
|
+
* Prefer this alias when the value needs to flow through `sync-types`,
|
|
13
|
+
* `typia.manifest.json`, and the generated PHP validator unchanged.
|
|
14
|
+
*/
|
|
15
|
+
export type CssNamedColor = "transparent" | "currentColor" | "inherit" | "initial" | "unset";
|
|
16
|
+
export declare const CSS_NAMED_COLORS: readonly ["transparent", "currentColor", "inherit", "initial", "unset"];
|
|
17
|
+
/**
|
|
18
|
+
* Derived from Gutenberg duotone preset structures.
|
|
19
|
+
*/
|
|
20
|
+
export interface DuotonePalette {
|
|
21
|
+
colors: readonly [CssColorValue, CssColorValue];
|
|
22
|
+
name?: string;
|
|
23
|
+
slug?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derived from Gutenberg aspect ratio presets and dimensions controls.
|
|
3
|
+
*/
|
|
4
|
+
export type AspectRatio = "auto" | "1" | "1/1" | "4/3" | "3/4" | "3/2" | "2/3" | "16/9" | "9/16" | "21/9";
|
|
5
|
+
export declare const ASPECT_RATIOS: readonly ["auto", "1", "1/1", "4/3", "3/4", "3/2", "2/3", "16/9", "9/16", "21/9"];
|
|
6
|
+
/**
|
|
7
|
+
* Practical min-height value surface for WordPress dimension controls.
|
|
8
|
+
*
|
|
9
|
+
* This is primarily a type-level DX helper today. Typia metadata generation does
|
|
10
|
+
* not yet consume imported template literal aliases such as `${number}px`.
|
|
11
|
+
*/
|
|
12
|
+
export type MinHeightValue = `${number}px` | `${number}rem` | `${number}em` | `${number}%` | `${number}vh` | `${number}vw` | `var(${string})` | `clamp(${string})` | `min(${string})` | `max(${string})`;
|
|
13
|
+
/**
|
|
14
|
+
* Pipeline-compatible min-height keyword subset for use in `types.ts`.
|
|
15
|
+
*/
|
|
16
|
+
export type MinHeightKeyword = "auto" | "inherit" | "initial" | "unset";
|
|
17
|
+
export declare const MIN_HEIGHT_KEYWORDS: readonly ["auto", "inherit", "initial", "unset"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-typia/block-types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Shared WordPress block semantic types derived from Gutenberg and unofficial declarations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,6 +21,16 @@
|
|
|
21
21
|
"import": "./dist/block-editor/alignment.js",
|
|
22
22
|
"default": "./dist/block-editor/alignment.js"
|
|
23
23
|
},
|
|
24
|
+
"./block-editor/color": {
|
|
25
|
+
"types": "./dist/block-editor/color.d.ts",
|
|
26
|
+
"import": "./dist/block-editor/color.js",
|
|
27
|
+
"default": "./dist/block-editor/color.js"
|
|
28
|
+
},
|
|
29
|
+
"./block-editor/dimensions": {
|
|
30
|
+
"types": "./dist/block-editor/dimensions.d.ts",
|
|
31
|
+
"import": "./dist/block-editor/dimensions.js",
|
|
32
|
+
"default": "./dist/block-editor/dimensions.js"
|
|
33
|
+
},
|
|
24
34
|
"./block-editor/layout": {
|
|
25
35
|
"types": "./dist/block-editor/layout.d.ts",
|
|
26
36
|
"import": "./dist/block-editor/layout.js",
|
|
@@ -72,7 +82,11 @@
|
|
|
72
82
|
"publishConfig": {
|
|
73
83
|
"access": "public"
|
|
74
84
|
},
|
|
75
|
-
"
|
|
85
|
+
"engines": {
|
|
86
|
+
"node": ">=20.0.0",
|
|
87
|
+
"npm": ">=10.0.0",
|
|
88
|
+
"bun": ">=1.3.10"
|
|
89
|
+
},
|
|
76
90
|
"devDependencies": {
|
|
77
91
|
"@types/react": "^18.3.12",
|
|
78
92
|
"@types/wordpress__block-editor": "^11.5.17",
|