@ankhorage/contracts 1.9.0 → 1.11.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/CHANGELOG.md +12 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ui.d.ts +109 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +2 -0
- package/dist/ui.js.map +1 -0
- package/package.json +5 -1
- package/src/index.ts +1 -0
- package/src/ui.test.ts +362 -0
- package/src/ui.ts +166 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/contracts
|
|
2
2
|
|
|
3
|
+
## 1.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 17b8d75: Add bindable component metadata contracts for declaring data-bindable component props and events.
|
|
8
|
+
|
|
9
|
+
## 1.10.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- d637fdc: Add provider-neutral UI component metadata contracts for component registries and extension package manifests.
|
|
14
|
+
|
|
3
15
|
## 1.9.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC","sourcesContent":["export * from './auth';\nexport * from './bindings';\nexport * from './data';\nexport * from './db';\nexport * from './state';\nexport * from './storage';\nexport * from './types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC","sourcesContent":["export * from './auth';\nexport * from './bindings';\nexport * from './data';\nexport * from './db';\nexport * from './state';\nexport * from './storage';\nexport * from './types';\nexport * from './ui';\n"]}
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { ComponentEventDtoKind } from './types';
|
|
2
|
+
export type UiComponentCategory = 'component' | 'foundation' | 'layout' | 'pattern';
|
|
3
|
+
export type UiComponentPropType = 'action' | 'array' | 'boolean' | 'color' | 'enum' | 'imageAsset' | 'number' | 'radius' | 'shadow' | 'spacing' | 'string' | 'typographySize' | 'typographyWeight';
|
|
4
|
+
export type UiComponentPropValue = string | number | boolean | null | readonly UiComponentPropValue[] | {
|
|
5
|
+
readonly [key: string]: UiComponentPropValue;
|
|
6
|
+
};
|
|
7
|
+
export interface UiComponentPropArrayItemSchema {
|
|
8
|
+
readonly key: string;
|
|
9
|
+
readonly schema: UiComponentPropSchema;
|
|
10
|
+
}
|
|
11
|
+
export interface UiComponentPropSchema {
|
|
12
|
+
readonly type: UiComponentPropType;
|
|
13
|
+
readonly category: string;
|
|
14
|
+
readonly label?: string;
|
|
15
|
+
readonly enum?: readonly (number | string)[];
|
|
16
|
+
readonly default?: UiComponentPropValue;
|
|
17
|
+
readonly itemSchema?: readonly UiComponentPropArrayItemSchema[];
|
|
18
|
+
}
|
|
19
|
+
export interface UiComponentBlueprintIcon {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly provider?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface UiComponentBlueprint {
|
|
24
|
+
readonly label: string;
|
|
25
|
+
readonly icon?: UiComponentBlueprintIcon;
|
|
26
|
+
readonly defaultProps?: Readonly<Record<string, UiComponentPropValue>>;
|
|
27
|
+
}
|
|
28
|
+
export interface UiComponentI18nFieldMeta {
|
|
29
|
+
readonly keyProp: string;
|
|
30
|
+
readonly defaultTextProp: string;
|
|
31
|
+
}
|
|
32
|
+
export interface UiComponentI18nMeta {
|
|
33
|
+
readonly fields: readonly UiComponentI18nFieldMeta[];
|
|
34
|
+
}
|
|
35
|
+
export type UiComponentEventPayloadKind = ComponentEventDtoKind | (string & {});
|
|
36
|
+
export type UiComponentEventPayloadFieldType = 'boolean' | 'number' | 'object' | 'record' | 'string' | 'unknown';
|
|
37
|
+
export interface UiComponentEventPayloadFieldMeta {
|
|
38
|
+
readonly path: string;
|
|
39
|
+
readonly type: UiComponentEventPayloadFieldType;
|
|
40
|
+
readonly label?: string;
|
|
41
|
+
readonly description?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface UiComponentEventMeta {
|
|
44
|
+
readonly label: string;
|
|
45
|
+
readonly eventType: UiComponentEventPayloadKind;
|
|
46
|
+
readonly description?: string;
|
|
47
|
+
readonly payloadFields?: readonly UiComponentEventPayloadFieldMeta[];
|
|
48
|
+
}
|
|
49
|
+
export type UiBindableValueType = 'array' | 'boolean' | 'date' | 'imageAsset' | 'number' | 'object' | 'record' | 'string' | 'unknown';
|
|
50
|
+
export interface UiBindableValueFieldMeta {
|
|
51
|
+
readonly path: string;
|
|
52
|
+
readonly type: UiBindableValueType;
|
|
53
|
+
readonly label?: string;
|
|
54
|
+
readonly description?: string;
|
|
55
|
+
readonly required?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface UiBindableValueMeta {
|
|
58
|
+
readonly type: UiBindableValueType;
|
|
59
|
+
readonly label?: string;
|
|
60
|
+
readonly description?: string;
|
|
61
|
+
readonly fields?: readonly UiBindableValueFieldMeta[];
|
|
62
|
+
readonly itemType?: UiBindableValueType;
|
|
63
|
+
}
|
|
64
|
+
export interface UiBindablePropMeta {
|
|
65
|
+
readonly value: UiBindableValueMeta;
|
|
66
|
+
readonly label?: string;
|
|
67
|
+
readonly description?: string;
|
|
68
|
+
readonly required?: boolean;
|
|
69
|
+
readonly acceptsFallback?: boolean;
|
|
70
|
+
readonly acceptsTransforms?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface UiBindableEventPayloadMeta {
|
|
73
|
+
readonly eventType: UiComponentEventPayloadKind;
|
|
74
|
+
readonly fields?: readonly UiComponentEventPayloadFieldMeta[];
|
|
75
|
+
}
|
|
76
|
+
export interface UiBindableEventMeta {
|
|
77
|
+
readonly label?: string;
|
|
78
|
+
readonly description?: string;
|
|
79
|
+
readonly payload?: UiBindableEventPayloadMeta;
|
|
80
|
+
}
|
|
81
|
+
export interface UiComponentBindingMeta {
|
|
82
|
+
readonly props?: Readonly<Record<string, UiBindablePropMeta>>;
|
|
83
|
+
readonly events?: Readonly<Record<string, UiBindableEventMeta>>;
|
|
84
|
+
}
|
|
85
|
+
export interface UiComponentSlotMeta {
|
|
86
|
+
readonly label?: string;
|
|
87
|
+
readonly allowedChildren?: readonly string[];
|
|
88
|
+
}
|
|
89
|
+
export interface UiComponentMeta {
|
|
90
|
+
readonly name: string;
|
|
91
|
+
readonly category: UiComponentCategory;
|
|
92
|
+
readonly description?: string;
|
|
93
|
+
readonly directManifestNode: boolean;
|
|
94
|
+
readonly allowedChildren: readonly string[];
|
|
95
|
+
readonly bindings?: UiComponentBindingMeta;
|
|
96
|
+
readonly blueprint?: UiComponentBlueprint;
|
|
97
|
+
readonly events?: Readonly<Record<string, UiComponentEventMeta>>;
|
|
98
|
+
readonly i18n?: UiComponentI18nMeta;
|
|
99
|
+
readonly slots?: Readonly<Record<string, UiComponentSlotMeta>>;
|
|
100
|
+
readonly note?: string;
|
|
101
|
+
readonly props: Readonly<Record<string, UiComponentPropSchema>>;
|
|
102
|
+
}
|
|
103
|
+
export type UiComponentMetaRegistry = Readonly<Record<string, UiComponentMeta>>;
|
|
104
|
+
export interface UiComponentPackageManifest {
|
|
105
|
+
readonly packageName: string;
|
|
106
|
+
readonly displayName?: string;
|
|
107
|
+
readonly components: UiComponentMetaRegistry;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEpF,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,OAAO,GACP,SAAS,GACT,OAAO,GACP,MAAM,GACN,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,gBAAgB,GAChB,kBAAkB,CAAC;AAEvB,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,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AM,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAC3C,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACjE,QAAQ,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAC/D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC;CACjE;AAED,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;AAEhF,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;CAC9C"}
|
package/dist/ui.js
ADDED
package/dist/ui.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentEventDtoKind } from './types';\n\nexport type UiComponentCategory = 'component' | 'foundation' | 'layout' | 'pattern';\n\nexport type UiComponentPropType =\n | 'action'\n | 'array'\n | 'boolean'\n | 'color'\n | 'enum'\n | 'imageAsset'\n | 'number'\n | 'radius'\n | 'shadow'\n | 'spacing'\n | 'string'\n | 'typographySize'\n | 'typographyWeight';\n\nexport type UiComponentPropValue =\n | string\n | number\n | boolean\n | null\n | readonly UiComponentPropValue[]\n | {\n readonly [key: string]: UiComponentPropValue;\n };\n\nexport interface UiComponentPropArrayItemSchema {\n readonly key: string;\n readonly schema: UiComponentPropSchema;\n}\n\nexport interface UiComponentPropSchema {\n readonly type: UiComponentPropType;\n readonly category: string;\n readonly label?: string;\n readonly enum?: readonly (number | string)[];\n readonly default?: UiComponentPropValue;\n readonly itemSchema?: readonly UiComponentPropArrayItemSchema[];\n}\n\nexport interface UiComponentBlueprintIcon {\n readonly name: string;\n readonly provider?: string;\n}\n\nexport interface UiComponentBlueprint {\n readonly label: string;\n readonly icon?: UiComponentBlueprintIcon;\n readonly defaultProps?: Readonly<Record<string, UiComponentPropValue>>;\n}\n\nexport interface UiComponentI18nFieldMeta {\n readonly keyProp: string;\n readonly defaultTextProp: string;\n}\n\nexport interface UiComponentI18nMeta {\n readonly fields: readonly UiComponentI18nFieldMeta[];\n}\n\nexport type UiComponentEventPayloadKind = ComponentEventDtoKind | (string & {});\n\nexport type UiComponentEventPayloadFieldType =\n | 'boolean'\n | 'number'\n | 'object'\n | 'record'\n | 'string'\n | 'unknown';\n\nexport interface UiComponentEventPayloadFieldMeta {\n readonly path: string;\n readonly type: UiComponentEventPayloadFieldType;\n readonly label?: string;\n readonly description?: string;\n}\n\nexport interface UiComponentEventMeta {\n readonly label: string;\n readonly eventType: UiComponentEventPayloadKind;\n readonly description?: string;\n readonly payloadFields?: readonly UiComponentEventPayloadFieldMeta[];\n}\n\nexport type UiBindableValueType =\n | 'array'\n | 'boolean'\n | 'date'\n | 'imageAsset'\n | 'number'\n | 'object'\n | 'record'\n | 'string'\n | 'unknown';\n\nexport interface UiBindableValueFieldMeta {\n readonly path: string;\n readonly type: UiBindableValueType;\n readonly label?: string;\n readonly description?: string;\n readonly required?: boolean;\n}\n\nexport interface UiBindableValueMeta {\n readonly type: UiBindableValueType;\n readonly label?: string;\n readonly description?: string;\n readonly fields?: readonly UiBindableValueFieldMeta[];\n readonly itemType?: UiBindableValueType;\n}\n\nexport interface UiBindablePropMeta {\n readonly value: UiBindableValueMeta;\n readonly label?: string;\n readonly description?: string;\n readonly required?: boolean;\n readonly acceptsFallback?: boolean;\n readonly acceptsTransforms?: boolean;\n}\n\nexport interface UiBindableEventPayloadMeta {\n readonly eventType: UiComponentEventPayloadKind;\n readonly fields?: readonly UiComponentEventPayloadFieldMeta[];\n}\n\nexport interface UiBindableEventMeta {\n readonly label?: string;\n readonly description?: string;\n readonly payload?: UiBindableEventPayloadMeta;\n}\n\nexport interface UiComponentBindingMeta {\n readonly props?: Readonly<Record<string, UiBindablePropMeta>>;\n readonly events?: Readonly<Record<string, UiBindableEventMeta>>;\n}\n\nexport interface UiComponentSlotMeta {\n readonly label?: string;\n readonly allowedChildren?: readonly string[];\n}\n\nexport interface UiComponentMeta {\n readonly name: string;\n readonly category: UiComponentCategory;\n readonly description?: string;\n readonly directManifestNode: boolean;\n readonly allowedChildren: readonly string[];\n readonly bindings?: UiComponentBindingMeta;\n readonly blueprint?: UiComponentBlueprint;\n readonly events?: Readonly<Record<string, UiComponentEventMeta>>;\n readonly i18n?: UiComponentI18nMeta;\n readonly slots?: Readonly<Record<string, UiComponentSlotMeta>>;\n readonly note?: string;\n readonly props: Readonly<Record<string, UiComponentPropSchema>>;\n}\n\nexport type UiComponentMetaRegistry = Readonly<Record<string, UiComponentMeta>>;\n\nexport interface UiComponentPackageManifest {\n readonly packageName: string;\n readonly displayName?: string;\n readonly components: UiComponentMetaRegistry;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/contracts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@ankhorage/color-theory": "^0.0.7"
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
"./storage": {
|
|
41
41
|
"types": "./dist/storage.d.ts",
|
|
42
42
|
"default": "./dist/storage.js"
|
|
43
|
+
},
|
|
44
|
+
"./ui": {
|
|
45
|
+
"types": "./dist/ui.d.ts",
|
|
46
|
+
"default": "./dist/ui.js"
|
|
43
47
|
}
|
|
44
48
|
},
|
|
45
49
|
"description": "Serializable app, action, and theme config contracts for Ankhorage.",
|
package/src/index.ts
CHANGED
package/src/ui.test.ts
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import type { UiComponentMeta, UiComponentMetaRegistry, UiComponentPackageManifest } from './index';
|
|
4
|
+
|
|
5
|
+
function assertSerializable<TValue>(value: TValue): void {
|
|
6
|
+
expect(JSON.parse(JSON.stringify(value))).toEqual(value);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
describe('ui component metadata contracts', () => {
|
|
10
|
+
it('serializes component metadata with props, events, slots, i18n, and blueprint defaults', () => {
|
|
11
|
+
const meta: UiComponentMeta = {
|
|
12
|
+
name: 'Button',
|
|
13
|
+
category: 'component',
|
|
14
|
+
description: 'Action component used to trigger an interaction.',
|
|
15
|
+
directManifestNode: true,
|
|
16
|
+
allowedChildren: [],
|
|
17
|
+
blueprint: {
|
|
18
|
+
label: 'Button',
|
|
19
|
+
icon: {
|
|
20
|
+
name: 'cursor-default-click',
|
|
21
|
+
provider: 'material-community',
|
|
22
|
+
},
|
|
23
|
+
defaultProps: {
|
|
24
|
+
children: 'Continue',
|
|
25
|
+
disabled: false,
|
|
26
|
+
size: 'm',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
events: {
|
|
30
|
+
press: {
|
|
31
|
+
label: 'Press',
|
|
32
|
+
eventType: 'button.press',
|
|
33
|
+
description: 'Emitted when the button is pressed.',
|
|
34
|
+
payloadFields: [],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
i18n: {
|
|
38
|
+
fields: [
|
|
39
|
+
{
|
|
40
|
+
keyProp: 'i18nKey',
|
|
41
|
+
defaultTextProp: 'children',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
slots: {
|
|
46
|
+
icon: {
|
|
47
|
+
label: 'Icon',
|
|
48
|
+
allowedChildren: ['Icon'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
props: {
|
|
52
|
+
children: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
category: 'Content',
|
|
55
|
+
label: 'Label',
|
|
56
|
+
default: 'Continue',
|
|
57
|
+
},
|
|
58
|
+
disabled: {
|
|
59
|
+
type: 'boolean',
|
|
60
|
+
category: 'State',
|
|
61
|
+
label: 'Disabled',
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
size: {
|
|
65
|
+
type: 'enum',
|
|
66
|
+
category: 'Style',
|
|
67
|
+
label: 'Size',
|
|
68
|
+
enum: ['s', 'm', 'l'],
|
|
69
|
+
default: 'm',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
assertSerializable(meta);
|
|
75
|
+
expect(meta.events?.press?.eventType).toBe('button.press');
|
|
76
|
+
expect(meta.props.size?.enum).toEqual(['s', 'm', 'l']);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('serializes component metadata with array item schemas', () => {
|
|
80
|
+
const meta: UiComponentMeta = {
|
|
81
|
+
name: 'DataTable',
|
|
82
|
+
category: 'component',
|
|
83
|
+
directManifestNode: true,
|
|
84
|
+
allowedChildren: [],
|
|
85
|
+
props: {
|
|
86
|
+
columns: {
|
|
87
|
+
type: 'array',
|
|
88
|
+
category: 'Data',
|
|
89
|
+
label: 'Columns',
|
|
90
|
+
itemSchema: [
|
|
91
|
+
{
|
|
92
|
+
key: 'id',
|
|
93
|
+
schema: {
|
|
94
|
+
type: 'string',
|
|
95
|
+
category: 'Data',
|
|
96
|
+
label: 'Column id',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
key: 'label',
|
|
101
|
+
schema: {
|
|
102
|
+
type: 'string',
|
|
103
|
+
category: 'Data',
|
|
104
|
+
label: 'Column label',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
assertSerializable(meta);
|
|
113
|
+
expect(meta.props.columns?.itemSchema?.map((item) => item.key)).toEqual(['id', 'label']);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('serializes bindable prop and event metadata on component metadata', () => {
|
|
117
|
+
const meta: UiComponentMeta = {
|
|
118
|
+
name: 'Button',
|
|
119
|
+
category: 'component',
|
|
120
|
+
directManifestNode: true,
|
|
121
|
+
allowedChildren: [],
|
|
122
|
+
bindings: {
|
|
123
|
+
props: {
|
|
124
|
+
children: {
|
|
125
|
+
label: 'Label',
|
|
126
|
+
description: 'Text content rendered inside the button.',
|
|
127
|
+
acceptsFallback: true,
|
|
128
|
+
acceptsTransforms: true,
|
|
129
|
+
value: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
label: 'Button label',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
disabled: {
|
|
135
|
+
label: 'Disabled',
|
|
136
|
+
value: {
|
|
137
|
+
type: 'boolean',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
events: {
|
|
142
|
+
press: {
|
|
143
|
+
label: 'Press',
|
|
144
|
+
description: 'Runs when the button is pressed.',
|
|
145
|
+
payload: {
|
|
146
|
+
eventType: 'button.press',
|
|
147
|
+
fields: [],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
events: {
|
|
153
|
+
press: {
|
|
154
|
+
label: 'Press',
|
|
155
|
+
eventType: 'button.press',
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
props: {
|
|
159
|
+
children: {
|
|
160
|
+
type: 'string',
|
|
161
|
+
category: 'Content',
|
|
162
|
+
label: 'Label',
|
|
163
|
+
},
|
|
164
|
+
disabled: {
|
|
165
|
+
type: 'boolean',
|
|
166
|
+
category: 'State',
|
|
167
|
+
label: 'Disabled',
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
assertSerializable(meta);
|
|
173
|
+
expect(meta.bindings?.props?.children?.value.type).toBe('string');
|
|
174
|
+
expect(meta.bindings?.events?.press?.payload?.eventType).toBe('button.press');
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it('serializes bindable collection item metadata with nested value fields', () => {
|
|
178
|
+
const meta: UiComponentMeta = {
|
|
179
|
+
name: 'List',
|
|
180
|
+
category: 'pattern',
|
|
181
|
+
directManifestNode: true,
|
|
182
|
+
allowedChildren: [],
|
|
183
|
+
bindings: {
|
|
184
|
+
props: {
|
|
185
|
+
items: {
|
|
186
|
+
label: 'Items',
|
|
187
|
+
value: {
|
|
188
|
+
type: 'array',
|
|
189
|
+
itemType: 'object',
|
|
190
|
+
fields: [
|
|
191
|
+
{
|
|
192
|
+
path: '$.id',
|
|
193
|
+
type: 'string',
|
|
194
|
+
label: 'ID',
|
|
195
|
+
required: true,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
path: '$.title',
|
|
199
|
+
type: 'string',
|
|
200
|
+
label: 'Title',
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
events: {
|
|
207
|
+
itemPress: {
|
|
208
|
+
label: 'Item press',
|
|
209
|
+
payload: {
|
|
210
|
+
eventType: 'collection.itemPress',
|
|
211
|
+
fields: [
|
|
212
|
+
{
|
|
213
|
+
path: 'payload.itemId',
|
|
214
|
+
type: 'string',
|
|
215
|
+
label: 'Item ID',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
path: 'payload.item',
|
|
219
|
+
type: 'record',
|
|
220
|
+
label: 'Item',
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
props: {
|
|
228
|
+
items: {
|
|
229
|
+
type: 'array',
|
|
230
|
+
category: 'Data',
|
|
231
|
+
label: 'Items',
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
assertSerializable(meta);
|
|
237
|
+
expect(meta.bindings?.props?.items?.value.fields?.map((field) => field.path)).toEqual([
|
|
238
|
+
'$.id',
|
|
239
|
+
'$.title',
|
|
240
|
+
]);
|
|
241
|
+
expect(meta.bindings?.events?.itemPress?.payload?.eventType).toBe('collection.itemPress');
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it('serializes a component metadata registry', () => {
|
|
245
|
+
const registry: UiComponentMetaRegistry = {
|
|
246
|
+
Text: {
|
|
247
|
+
name: 'Text',
|
|
248
|
+
category: 'component',
|
|
249
|
+
directManifestNode: true,
|
|
250
|
+
allowedChildren: [],
|
|
251
|
+
bindings: {
|
|
252
|
+
props: {
|
|
253
|
+
children: {
|
|
254
|
+
value: {
|
|
255
|
+
type: 'string',
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
props: {
|
|
261
|
+
children: {
|
|
262
|
+
type: 'string',
|
|
263
|
+
category: 'Content',
|
|
264
|
+
label: 'Text',
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
Screen: {
|
|
269
|
+
name: 'Screen',
|
|
270
|
+
category: 'layout',
|
|
271
|
+
directManifestNode: true,
|
|
272
|
+
allowedChildren: ['Text'],
|
|
273
|
+
props: {},
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
assertSerializable(registry);
|
|
278
|
+
expect(registry.Screen?.allowedChildren).toEqual(['Text']);
|
|
279
|
+
expect(registry.Text?.bindings?.props?.children?.value.type).toBe('string');
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it('serializes a component package manifest for extension packages', () => {
|
|
283
|
+
const manifest: UiComponentPackageManifest = {
|
|
284
|
+
packageName: '@ankhorage/zora-chessboard',
|
|
285
|
+
displayName: 'ZORA Chessboard',
|
|
286
|
+
components: {
|
|
287
|
+
Chessboard: {
|
|
288
|
+
name: 'Chessboard',
|
|
289
|
+
category: 'component',
|
|
290
|
+
directManifestNode: true,
|
|
291
|
+
allowedChildren: [],
|
|
292
|
+
bindings: {
|
|
293
|
+
props: {
|
|
294
|
+
fen: {
|
|
295
|
+
value: {
|
|
296
|
+
type: 'string',
|
|
297
|
+
label: 'FEN',
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
events: {
|
|
302
|
+
move: {
|
|
303
|
+
label: 'Move',
|
|
304
|
+
payload: {
|
|
305
|
+
eventType: 'chess.move',
|
|
306
|
+
fields: [
|
|
307
|
+
{
|
|
308
|
+
path: 'payload.from',
|
|
309
|
+
type: 'string',
|
|
310
|
+
label: 'From square',
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
path: 'payload.to',
|
|
314
|
+
type: 'string',
|
|
315
|
+
label: 'To square',
|
|
316
|
+
},
|
|
317
|
+
],
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
events: {
|
|
323
|
+
move: {
|
|
324
|
+
label: 'Move',
|
|
325
|
+
eventType: 'chess.move',
|
|
326
|
+
payloadFields: [
|
|
327
|
+
{
|
|
328
|
+
path: 'payload.from',
|
|
329
|
+
type: 'string',
|
|
330
|
+
label: 'From square',
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
path: 'payload.to',
|
|
334
|
+
type: 'string',
|
|
335
|
+
label: 'To square',
|
|
336
|
+
},
|
|
337
|
+
],
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
props: {
|
|
341
|
+
fen: {
|
|
342
|
+
type: 'string',
|
|
343
|
+
category: 'Chess',
|
|
344
|
+
label: 'FEN',
|
|
345
|
+
},
|
|
346
|
+
orientation: {
|
|
347
|
+
type: 'enum',
|
|
348
|
+
category: 'Chess',
|
|
349
|
+
label: 'Orientation',
|
|
350
|
+
enum: ['white', 'black'],
|
|
351
|
+
default: 'white',
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
assertSerializable(manifest);
|
|
359
|
+
expect(manifest.components.Chessboard?.events?.move?.eventType).toBe('chess.move');
|
|
360
|
+
expect(manifest.components.Chessboard?.bindings?.props?.fen?.value.type).toBe('string');
|
|
361
|
+
});
|
|
362
|
+
});
|
package/src/ui.ts
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { ComponentEventDtoKind } from './types';
|
|
2
|
+
|
|
3
|
+
export type UiComponentCategory = 'component' | 'foundation' | 'layout' | 'pattern';
|
|
4
|
+
|
|
5
|
+
export type UiComponentPropType =
|
|
6
|
+
| 'action'
|
|
7
|
+
| 'array'
|
|
8
|
+
| 'boolean'
|
|
9
|
+
| 'color'
|
|
10
|
+
| 'enum'
|
|
11
|
+
| 'imageAsset'
|
|
12
|
+
| 'number'
|
|
13
|
+
| 'radius'
|
|
14
|
+
| 'shadow'
|
|
15
|
+
| 'spacing'
|
|
16
|
+
| 'string'
|
|
17
|
+
| 'typographySize'
|
|
18
|
+
| 'typographyWeight';
|
|
19
|
+
|
|
20
|
+
export type UiComponentPropValue =
|
|
21
|
+
| string
|
|
22
|
+
| number
|
|
23
|
+
| boolean
|
|
24
|
+
| null
|
|
25
|
+
| readonly UiComponentPropValue[]
|
|
26
|
+
| {
|
|
27
|
+
readonly [key: string]: UiComponentPropValue;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export interface UiComponentPropArrayItemSchema {
|
|
31
|
+
readonly key: string;
|
|
32
|
+
readonly schema: UiComponentPropSchema;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface UiComponentPropSchema {
|
|
36
|
+
readonly type: UiComponentPropType;
|
|
37
|
+
readonly category: string;
|
|
38
|
+
readonly label?: string;
|
|
39
|
+
readonly enum?: readonly (number | string)[];
|
|
40
|
+
readonly default?: UiComponentPropValue;
|
|
41
|
+
readonly itemSchema?: readonly UiComponentPropArrayItemSchema[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface UiComponentBlueprintIcon {
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly provider?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface UiComponentBlueprint {
|
|
50
|
+
readonly label: string;
|
|
51
|
+
readonly icon?: UiComponentBlueprintIcon;
|
|
52
|
+
readonly defaultProps?: Readonly<Record<string, UiComponentPropValue>>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface UiComponentI18nFieldMeta {
|
|
56
|
+
readonly keyProp: string;
|
|
57
|
+
readonly defaultTextProp: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface UiComponentI18nMeta {
|
|
61
|
+
readonly fields: readonly UiComponentI18nFieldMeta[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type UiComponentEventPayloadKind = ComponentEventDtoKind | (string & {});
|
|
65
|
+
|
|
66
|
+
export type UiComponentEventPayloadFieldType =
|
|
67
|
+
| 'boolean'
|
|
68
|
+
| 'number'
|
|
69
|
+
| 'object'
|
|
70
|
+
| 'record'
|
|
71
|
+
| 'string'
|
|
72
|
+
| 'unknown';
|
|
73
|
+
|
|
74
|
+
export interface UiComponentEventPayloadFieldMeta {
|
|
75
|
+
readonly path: string;
|
|
76
|
+
readonly type: UiComponentEventPayloadFieldType;
|
|
77
|
+
readonly label?: string;
|
|
78
|
+
readonly description?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface UiComponentEventMeta {
|
|
82
|
+
readonly label: string;
|
|
83
|
+
readonly eventType: UiComponentEventPayloadKind;
|
|
84
|
+
readonly description?: string;
|
|
85
|
+
readonly payloadFields?: readonly UiComponentEventPayloadFieldMeta[];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type UiBindableValueType =
|
|
89
|
+
| 'array'
|
|
90
|
+
| 'boolean'
|
|
91
|
+
| 'date'
|
|
92
|
+
| 'imageAsset'
|
|
93
|
+
| 'number'
|
|
94
|
+
| 'object'
|
|
95
|
+
| 'record'
|
|
96
|
+
| 'string'
|
|
97
|
+
| 'unknown';
|
|
98
|
+
|
|
99
|
+
export interface UiBindableValueFieldMeta {
|
|
100
|
+
readonly path: string;
|
|
101
|
+
readonly type: UiBindableValueType;
|
|
102
|
+
readonly label?: string;
|
|
103
|
+
readonly description?: string;
|
|
104
|
+
readonly required?: boolean;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface UiBindableValueMeta {
|
|
108
|
+
readonly type: UiBindableValueType;
|
|
109
|
+
readonly label?: string;
|
|
110
|
+
readonly description?: string;
|
|
111
|
+
readonly fields?: readonly UiBindableValueFieldMeta[];
|
|
112
|
+
readonly itemType?: UiBindableValueType;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface UiBindablePropMeta {
|
|
116
|
+
readonly value: UiBindableValueMeta;
|
|
117
|
+
readonly label?: string;
|
|
118
|
+
readonly description?: string;
|
|
119
|
+
readonly required?: boolean;
|
|
120
|
+
readonly acceptsFallback?: boolean;
|
|
121
|
+
readonly acceptsTransforms?: boolean;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface UiBindableEventPayloadMeta {
|
|
125
|
+
readonly eventType: UiComponentEventPayloadKind;
|
|
126
|
+
readonly fields?: readonly UiComponentEventPayloadFieldMeta[];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface UiBindableEventMeta {
|
|
130
|
+
readonly label?: string;
|
|
131
|
+
readonly description?: string;
|
|
132
|
+
readonly payload?: UiBindableEventPayloadMeta;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface UiComponentBindingMeta {
|
|
136
|
+
readonly props?: Readonly<Record<string, UiBindablePropMeta>>;
|
|
137
|
+
readonly events?: Readonly<Record<string, UiBindableEventMeta>>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface UiComponentSlotMeta {
|
|
141
|
+
readonly label?: string;
|
|
142
|
+
readonly allowedChildren?: readonly string[];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface UiComponentMeta {
|
|
146
|
+
readonly name: string;
|
|
147
|
+
readonly category: UiComponentCategory;
|
|
148
|
+
readonly description?: string;
|
|
149
|
+
readonly directManifestNode: boolean;
|
|
150
|
+
readonly allowedChildren: readonly string[];
|
|
151
|
+
readonly bindings?: UiComponentBindingMeta;
|
|
152
|
+
readonly blueprint?: UiComponentBlueprint;
|
|
153
|
+
readonly events?: Readonly<Record<string, UiComponentEventMeta>>;
|
|
154
|
+
readonly i18n?: UiComponentI18nMeta;
|
|
155
|
+
readonly slots?: Readonly<Record<string, UiComponentSlotMeta>>;
|
|
156
|
+
readonly note?: string;
|
|
157
|
+
readonly props: Readonly<Record<string, UiComponentPropSchema>>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export type UiComponentMetaRegistry = Readonly<Record<string, UiComponentMeta>>;
|
|
161
|
+
|
|
162
|
+
export interface UiComponentPackageManifest {
|
|
163
|
+
readonly packageName: string;
|
|
164
|
+
readonly displayName?: string;
|
|
165
|
+
readonly components: UiComponentMetaRegistry;
|
|
166
|
+
}
|