@ankhorage/contracts 7.5.0 → 7.6.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ankhorage/contracts
2
2
 
3
+ ## 7.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 49c4b9f: Add provider-neutral `media` component-property authoring metadata with optional canonical `MediaAssetKind` constraints, so authoring tools can identify accepted media kinds without provider-specific or Image-specific fields.
8
+
3
9
  ## 7.5.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # CONTRACTS
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v7.3.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v7.5.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Serializable app, action, theme, auth, and secret-store contracts for Ankhorage.
9
9
 
package/dist/ui.d.ts CHANGED
@@ -1,6 +1,7 @@
1
+ import type { MediaAssetKind } from './media';
1
2
  import type { ComponentEventDtoKind } from './types';
2
3
  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 UiComponentPropType = 'action' | 'array' | 'boolean' | 'color' | 'enum' | 'imageAsset' | 'media' | 'number' | 'radius' | 'shadow' | 'spacing' | 'string' | 'typographySize' | 'typographyWeight';
4
5
  export type UiComponentPropValue = string | number | boolean | null | readonly UiComponentPropValue[] | {
5
6
  readonly [key: string]: UiComponentPropValue;
6
7
  };
@@ -15,6 +16,7 @@ export interface UiComponentPropSchema {
15
16
  readonly enum?: readonly (number | string)[];
16
17
  readonly default?: UiComponentPropValue;
17
18
  readonly itemSchema?: readonly UiComponentPropArrayItemSchema[];
19
+ readonly mediaKinds?: readonly MediaAssetKind[];
18
20
  }
19
21
  export interface UiComponentBlueprintIcon {
20
22
  readonly name: string;
package/dist/ui.d.ts.map CHANGED
@@ -1 +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,GACJ,SAAS,oBAAoB,EAAE,GAC/B;IACE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAAC;CAC9C,CAAC;AAEN,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;CACxC;AAED,MAAM,WAAW,qBAAqB;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,EAAE,MAAM,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.map CHANGED
@@ -1 +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"]}
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"","sourcesContent":["import type { MediaAssetKind } from './media';\nimport 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 | 'media'\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 readonly mediaKinds?: readonly MediaAssetKind[];\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": "7.5.0",
3
+ "version": "7.6.0",
4
4
  "main": "./dist/index.js",
5
5
  "ankh": {
6
6
  "category": "contracts",
@@ -0,0 +1,33 @@
1
+ import { describe, expect, it } from 'bun:test';
2
+
3
+ import type { UiComponentMeta } from './ui';
4
+
5
+ const imageComponentMeta = {
6
+ name: 'Image',
7
+ category: 'component',
8
+ directManifestNode: true,
9
+ allowedChildren: [],
10
+ props: {
11
+ source: {
12
+ type: 'media',
13
+ category: 'Content',
14
+ label: 'Source',
15
+ mediaKinds: ['image'],
16
+ },
17
+ },
18
+ } as const satisfies UiComponentMeta;
19
+
20
+ describe('UI media authoring metadata', () => {
21
+ it('describes media-backed properties independently from concrete providers', () => {
22
+ expect(imageComponentMeta.props.source).toEqual({
23
+ type: 'media',
24
+ category: 'Content',
25
+ label: 'Source',
26
+ mediaKinds: ['image'],
27
+ });
28
+ });
29
+
30
+ it('remains serializable for package manifests and Studio metadata', () => {
31
+ expect(JSON.parse(JSON.stringify(imageComponentMeta))).toEqual(imageComponentMeta);
32
+ });
33
+ });
package/src/ui.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { MediaAssetKind } from './media';
1
2
  import type { ComponentEventDtoKind } from './types';
2
3
 
3
4
  export type UiComponentCategory = 'component' | 'foundation' | 'layout' | 'pattern';
@@ -9,6 +10,7 @@ export type UiComponentPropType =
9
10
  | 'color'
10
11
  | 'enum'
11
12
  | 'imageAsset'
13
+ | 'media'
12
14
  | 'number'
13
15
  | 'radius'
14
16
  | 'shadow'
@@ -39,6 +41,7 @@ export interface UiComponentPropSchema {
39
41
  readonly enum?: readonly (number | string)[];
40
42
  readonly default?: UiComponentPropValue;
41
43
  readonly itemSchema?: readonly UiComponentPropArrayItemSchema[];
44
+ readonly mediaKinds?: readonly MediaAssetKind[];
42
45
  }
43
46
 
44
47
  export interface UiComponentBlueprintIcon {