@ankhorage/zora 4.1.0 → 4.2.2
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 +18 -0
- package/dist/components/card/meta.d.ts +1 -1
- package/dist/components/icon/meta.d.ts +32 -3
- package/dist/components/icon/meta.d.ts.map +1 -1
- package/dist/components/icon/meta.js +24 -3
- package/dist/components/icon/meta.js.map +1 -1
- package/dist/foundation/meta.d.ts +4 -4
- package/dist/layout/screen/meta.d.ts +1 -1
- package/dist/layout/screen-section/meta.d.ts +1 -1
- package/dist/metadata/allowedChildren.d.ts +3 -3
- package/dist/metadata/allowedChildren.d.ts.map +1 -1
- package/dist/metadata/allowedChildren.js +2 -0
- package/dist/metadata/allowedChildren.js.map +1 -1
- package/dist/metadata/bindableComponentMeta.d.ts +2 -2
- package/dist/patterns/message-bubble/meta.d.ts +1 -1
- package/dist/patterns/notice/meta.d.ts +1 -1
- package/dist/patterns/panel/meta.d.ts +1 -1
- package/dist/patterns/post-card/meta.d.ts +1 -1
- package/dist/patterns/reader/meta.d.ts +2 -2
- package/dist/patterns/scanner/meta.d.ts +2 -2
- package/dist/theme/useZoraTheme.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/icon/meta.test.ts +22 -0
- package/src/components/icon/meta.ts +24 -3
- package/src/metadata/allowedChildren.ts +2 -0
- package/src/metadata/componentMeta.test.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- de3246c: Update Ankhorage dependencies: `@ankhorage/contracts`.
|
|
8
|
+
|
|
9
|
+
## 4.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- de3246c: Update Ankhorage dependencies: `@ankhorage/contracts`.
|
|
14
|
+
|
|
15
|
+
## 4.2.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 3dbdeb2: Allow standalone media-backed Icon nodes and permit Icon and Image in screen containers so generated templates can use their separate SVG and raster assets.
|
|
20
|
+
|
|
3
21
|
## 4.1.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -2,7 +2,7 @@ export declare const cardMeta: {
|
|
|
2
2
|
readonly name: "Card";
|
|
3
3
|
readonly category: "component";
|
|
4
4
|
readonly directManifestNode: true;
|
|
5
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
5
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
6
6
|
readonly blueprint: {
|
|
7
7
|
readonly label: "Card";
|
|
8
8
|
readonly defaultProps: {
|
|
@@ -1,9 +1,38 @@
|
|
|
1
1
|
export declare const iconMeta: {
|
|
2
2
|
readonly name: "Icon";
|
|
3
3
|
readonly category: "component";
|
|
4
|
-
readonly
|
|
4
|
+
readonly description: "Displays a standalone SVG icon from the app media registry.";
|
|
5
|
+
readonly directManifestNode: true;
|
|
5
6
|
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly
|
|
7
|
-
|
|
7
|
+
readonly blueprint: {
|
|
8
|
+
readonly label: "Icon";
|
|
9
|
+
};
|
|
10
|
+
readonly props: {
|
|
11
|
+
readonly source: {
|
|
12
|
+
readonly type: "media";
|
|
13
|
+
readonly category: "Content";
|
|
14
|
+
readonly label: "SVG source";
|
|
15
|
+
readonly mediaKinds: readonly ["image"];
|
|
16
|
+
readonly authoring: {
|
|
17
|
+
readonly authority: "instance";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly size: {
|
|
21
|
+
readonly type: "number";
|
|
22
|
+
readonly category: "Appearance";
|
|
23
|
+
readonly label: "Size";
|
|
24
|
+
readonly authoring: {
|
|
25
|
+
readonly authority: "instance";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
readonly color: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly category: "Appearance";
|
|
31
|
+
readonly label: "Color";
|
|
32
|
+
readonly authoring: {
|
|
33
|
+
readonly authority: "instance";
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
8
37
|
};
|
|
9
38
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/icon/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/icon/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BiB,CAAC"}
|
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
export const iconMeta = {
|
|
2
2
|
name: 'Icon',
|
|
3
3
|
category: 'component',
|
|
4
|
-
|
|
4
|
+
description: 'Displays a standalone SVG icon from the app media registry.',
|
|
5
|
+
directManifestNode: true,
|
|
5
6
|
allowedChildren: [],
|
|
6
|
-
|
|
7
|
-
props: {
|
|
7
|
+
blueprint: { label: 'Icon' },
|
|
8
|
+
props: {
|
|
9
|
+
source: {
|
|
10
|
+
type: 'media',
|
|
11
|
+
category: 'Content',
|
|
12
|
+
label: 'SVG source',
|
|
13
|
+
mediaKinds: ['image'],
|
|
14
|
+
authoring: { authority: 'instance' },
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
type: 'number',
|
|
18
|
+
category: 'Appearance',
|
|
19
|
+
label: 'Size',
|
|
20
|
+
authoring: { authority: 'instance' },
|
|
21
|
+
},
|
|
22
|
+
color: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
category: 'Appearance',
|
|
25
|
+
label: 'Color',
|
|
26
|
+
authoring: { authority: 'instance' },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
8
29
|
};
|
|
9
30
|
//# sourceMappingURL=meta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/icon/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/icon/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,6DAA6D;IAC1E,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IAC5B,KAAK,EAAE;QACL,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,YAAY;YACnB,UAAU,EAAE,CAAC,OAAO,CAAC;YACrB,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,YAAY;YACtB,KAAK,EAAE,MAAM;YACb,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,YAAY;YACtB,KAAK,EAAE,OAAO;YACd,SAAS,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;SACrC;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const iconMeta = {\n name: 'Icon',\n category: 'component',\n description: 'Displays a standalone SVG icon from the app media registry.',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: { label: 'Icon' },\n props: {\n source: {\n type: 'media',\n category: 'Content',\n label: 'SVG source',\n mediaKinds: ['image'],\n authoring: { authority: 'instance' },\n },\n size: {\n type: 'number',\n category: 'Appearance',\n label: 'Size',\n authoring: { authority: 'instance' },\n },\n color: {\n type: 'string',\n category: 'Appearance',\n label: 'Color',\n authoring: { authority: 'instance' },\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -3,7 +3,7 @@ export declare const foundationMetas: {
|
|
|
3
3
|
readonly name: "Box";
|
|
4
4
|
readonly category: "foundation";
|
|
5
5
|
readonly directManifestNode: true;
|
|
6
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
6
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
7
7
|
readonly blueprint: {
|
|
8
8
|
readonly label: "Box";
|
|
9
9
|
};
|
|
@@ -21,7 +21,7 @@ export declare const foundationMetas: {
|
|
|
21
21
|
readonly name: "Container";
|
|
22
22
|
readonly category: "foundation";
|
|
23
23
|
readonly directManifestNode: true;
|
|
24
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
24
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
25
25
|
readonly blueprint: {
|
|
26
26
|
readonly label: "Container";
|
|
27
27
|
};
|
|
@@ -41,7 +41,7 @@ export declare const foundationMetas: {
|
|
|
41
41
|
readonly name: "Grid";
|
|
42
42
|
readonly category: "foundation";
|
|
43
43
|
readonly directManifestNode: true;
|
|
44
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
44
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
45
45
|
readonly blueprint: {
|
|
46
46
|
readonly label: "Grid";
|
|
47
47
|
};
|
|
@@ -75,7 +75,7 @@ export declare const foundationMetas: {
|
|
|
75
75
|
readonly name: "Stack";
|
|
76
76
|
readonly category: "foundation";
|
|
77
77
|
readonly directManifestNode: true;
|
|
78
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
78
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
79
79
|
readonly blueprint: {
|
|
80
80
|
readonly label: "Stack";
|
|
81
81
|
};
|
|
@@ -2,7 +2,7 @@ export declare const screenMeta: {
|
|
|
2
2
|
readonly name: "Screen";
|
|
3
3
|
readonly category: "layout";
|
|
4
4
|
readonly directManifestNode: true;
|
|
5
|
-
readonly allowedChildren: readonly ["ScreenSection", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
5
|
+
readonly allowedChildren: readonly ["ScreenSection", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
6
6
|
readonly blueprint: {
|
|
7
7
|
readonly label: "Screen";
|
|
8
8
|
};
|
|
@@ -2,7 +2,7 @@ export declare const screenSectionMeta: {
|
|
|
2
2
|
readonly name: "ScreenSection";
|
|
3
3
|
readonly category: "layout";
|
|
4
4
|
readonly directManifestNode: true;
|
|
5
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
5
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
6
6
|
readonly blueprint: {
|
|
7
7
|
readonly label: "Screen section";
|
|
8
8
|
readonly defaultProps: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const CONTAINER_ALLOWED_CHILDREN: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
1
|
+
export declare const CONTAINER_ALLOWED_CHILDREN: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
2
2
|
export declare const CONTENT_RAIL_ALLOWED_CHILDREN: readonly ["Box", "Stack", "Card", "Panel", "Image", "ProductCard", "PostCard", "ChatListItem", "MessageBubble", "MissingElement"];
|
|
3
|
-
export declare const SCREEN_SECTION_ALLOWED_CHILDREN: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
4
|
-
export declare const SCREEN_ALLOWED_CHILDREN: readonly ["ScreenSection", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
3
|
+
export declare const SCREEN_SECTION_ALLOWED_CHILDREN: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
4
|
+
export declare const SCREEN_ALLOWED_CHILDREN: readonly ["ScreenSection", "Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
5
5
|
//# sourceMappingURL=allowedChildren.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allowedChildren.d.ts","sourceRoot":"","sources":["../../src/metadata/allowedChildren.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"allowedChildren.d.ts","sourceRoot":"","sources":["../../src/metadata/allowedChildren.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,qWA6B7B,CAAC;AAEX,eAAO,MAAM,6BAA6B,mIAWhC,CAAC;AAEX,eAAO,MAAM,+BAA+B,qWAA2C,CAAC;AAExF,eAAO,MAAM,uBAAuB,sXAA4D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allowedChildren.js","sourceRoot":"","sources":["../../src/metadata/allowedChildren.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,KAAK;IACL,OAAO;IACP,MAAM;IACN,WAAW;IACX,SAAS;IACT,MAAM;IACN,SAAS;IACT,QAAQ;IACR,aAAa;IACb,iBAAiB;IACjB,OAAO;IACP,UAAU;IACV,WAAW;IACX,MAAM;IACN,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,eAAe;IACf,aAAa;IACb,UAAU;IACV,cAAc;IACd,eAAe;IACf,cAAc;IACd,eAAe;IACf,aAAa;IACb,gBAAgB;CACR,CAAC;AAEX,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,KAAK;IACL,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,aAAa;IACb,UAAU;IACV,cAAc;IACd,eAAe;IACf,gBAAgB;CACR,CAAC;AAEX,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,GAAG,0BAA0B,CAAU,CAAC;AAExF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,eAAe,EAAE,GAAG,0BAA0B,CAAU,CAAC","sourcesContent":["export const CONTAINER_ALLOWED_CHILDREN = [\n 'Box',\n 'Stack',\n 'Grid',\n 'Container',\n 'Divider',\n 'Text',\n 'Heading',\n 'Button',\n 'ButtonGroup',\n 'ThemeModeToggle',\n 'Input',\n 'Textarea',\n 'FormField',\n 'Card',\n 'Panel',\n 'Notice',\n 'EmptyState',\n 'SectionHeader',\n 'SettingsRow',\n 'PostCard',\n 'ChatListItem',\n 'MessageBubble',\n 'ProgressRing',\n 'ReaderSurface',\n 'ContentRail',\n 'MissingElement',\n] as const;\n\nexport const CONTENT_RAIL_ALLOWED_CHILDREN = [\n 'Box',\n 'Stack',\n 'Card',\n 'Panel',\n 'Image',\n 'ProductCard',\n 'PostCard',\n 'ChatListItem',\n 'MessageBubble',\n 'MissingElement',\n] as const;\n\nexport const SCREEN_SECTION_ALLOWED_CHILDREN = [...CONTAINER_ALLOWED_CHILDREN] as const;\n\nexport const SCREEN_ALLOWED_CHILDREN = ['ScreenSection', ...CONTAINER_ALLOWED_CHILDREN] as const;\n"]}
|
|
1
|
+
{"version":3,"file":"allowedChildren.js","sourceRoot":"","sources":["../../src/metadata/allowedChildren.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,KAAK;IACL,OAAO;IACP,MAAM;IACN,WAAW;IACX,SAAS;IACT,MAAM;IACN,SAAS;IACT,MAAM;IACN,OAAO;IACP,QAAQ;IACR,aAAa;IACb,iBAAiB;IACjB,OAAO;IACP,UAAU;IACV,WAAW;IACX,MAAM;IACN,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,eAAe;IACf,aAAa;IACb,UAAU;IACV,cAAc;IACd,eAAe;IACf,cAAc;IACd,eAAe;IACf,aAAa;IACb,gBAAgB;CACR,CAAC;AAEX,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,KAAK;IACL,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,aAAa;IACb,UAAU;IACV,cAAc;IACd,eAAe;IACf,gBAAgB;CACR,CAAC;AAEX,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,GAAG,0BAA0B,CAAU,CAAC;AAExF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,eAAe,EAAE,GAAG,0BAA0B,CAAU,CAAC","sourcesContent":["export const CONTAINER_ALLOWED_CHILDREN = [\n 'Box',\n 'Stack',\n 'Grid',\n 'Container',\n 'Divider',\n 'Text',\n 'Heading',\n 'Icon',\n 'Image',\n 'Button',\n 'ButtonGroup',\n 'ThemeModeToggle',\n 'Input',\n 'Textarea',\n 'FormField',\n 'Card',\n 'Panel',\n 'Notice',\n 'EmptyState',\n 'SectionHeader',\n 'SettingsRow',\n 'PostCard',\n 'ChatListItem',\n 'MessageBubble',\n 'ProgressRing',\n 'ReaderSurface',\n 'ContentRail',\n 'MissingElement',\n] as const;\n\nexport const CONTENT_RAIL_ALLOWED_CHILDREN = [\n 'Box',\n 'Stack',\n 'Card',\n 'Panel',\n 'Image',\n 'ProductCard',\n 'PostCard',\n 'ChatListItem',\n 'MessageBubble',\n 'MissingElement',\n] as const;\n\nexport const SCREEN_SECTION_ALLOWED_CHILDREN = [...CONTAINER_ALLOWED_CHILDREN] as const;\n\nexport const SCREEN_ALLOWED_CHILDREN = ['ScreenSection', ...CONTAINER_ALLOWED_CHILDREN] as const;\n"]}
|
|
@@ -848,11 +848,11 @@ export declare const ZORA_BINDABLE_COMPONENT_META: {
|
|
|
848
848
|
};
|
|
849
849
|
readonly headerActions: {
|
|
850
850
|
readonly label: "Header actions";
|
|
851
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
851
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
852
852
|
};
|
|
853
853
|
readonly footerActions: {
|
|
854
854
|
readonly label: "Footer actions";
|
|
855
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
855
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
856
856
|
};
|
|
857
857
|
};
|
|
858
858
|
readonly props: {
|
|
@@ -3,7 +3,7 @@ export declare const messageBubbleMeta: {
|
|
|
3
3
|
readonly category: "pattern";
|
|
4
4
|
readonly description: "Chat/message bubble with direction, author, text, meta, and delivery status presentation.";
|
|
5
5
|
readonly directManifestNode: true;
|
|
6
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
6
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
7
7
|
readonly blueprint: {
|
|
8
8
|
readonly label: "Message bubble";
|
|
9
9
|
readonly icon: {
|
|
@@ -2,7 +2,7 @@ export declare const noticeMeta: {
|
|
|
2
2
|
readonly name: "Notice";
|
|
3
3
|
readonly category: "pattern";
|
|
4
4
|
readonly directManifestNode: true;
|
|
5
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
5
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
6
6
|
readonly blueprint: {
|
|
7
7
|
readonly label: "Notice";
|
|
8
8
|
readonly defaultProps: {
|
|
@@ -2,7 +2,7 @@ export declare const panelMeta: {
|
|
|
2
2
|
readonly name: "Panel";
|
|
3
3
|
readonly category: "pattern";
|
|
4
4
|
readonly directManifestNode: true;
|
|
5
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
5
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
6
6
|
readonly blueprint: {
|
|
7
7
|
readonly label: "Panel";
|
|
8
8
|
readonly defaultProps: {
|
|
@@ -3,7 +3,7 @@ export declare const postCardMeta: {
|
|
|
3
3
|
readonly category: "pattern";
|
|
4
4
|
readonly description: "Social/content post card with author identity, body, media, actions, and comment previews.";
|
|
5
5
|
readonly directManifestNode: true;
|
|
6
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
6
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
7
7
|
readonly blueprint: {
|
|
8
8
|
readonly label: "Post card";
|
|
9
9
|
readonly icon: {
|
|
@@ -125,11 +125,11 @@ export declare const readerSurfaceMeta: {
|
|
|
125
125
|
};
|
|
126
126
|
readonly headerActions: {
|
|
127
127
|
readonly label: "Header actions";
|
|
128
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
128
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
129
129
|
};
|
|
130
130
|
readonly footerActions: {
|
|
131
131
|
readonly label: "Footer actions";
|
|
132
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
132
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
133
133
|
};
|
|
134
134
|
};
|
|
135
135
|
readonly props: {
|
|
@@ -105,7 +105,7 @@ export declare const barcodeScannerViewMeta: {
|
|
|
105
105
|
readonly category: "pattern";
|
|
106
106
|
readonly description: "Composed scanner shell with permission, camera slot, scan overlay, and manual entry affordance.";
|
|
107
107
|
readonly directManifestNode: true;
|
|
108
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
108
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
109
109
|
readonly requirements: {
|
|
110
110
|
readonly permissions: readonly [{
|
|
111
111
|
readonly permission: "camera";
|
|
@@ -145,7 +145,7 @@ export declare const barcodeScannerViewMeta: {
|
|
|
145
145
|
};
|
|
146
146
|
readonly children: {
|
|
147
147
|
readonly label: "Scanner footer";
|
|
148
|
-
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
148
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Icon", "Image", "Button", "ButtonGroup", "ThemeModeToggle", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "ReaderSurface", "ContentRail", "MissingElement"];
|
|
149
149
|
};
|
|
150
150
|
};
|
|
151
151
|
readonly props: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare function useZoraTheme(): {
|
|
2
2
|
theme: import("@ankhorage/surface").SurfaceTheme;
|
|
3
3
|
mode: "light" | "dark";
|
|
4
|
-
setThemeConfig: (config: Partial<import("@ankhorage/
|
|
4
|
+
setThemeConfig: (config: Partial<import("@ankhorage/surface").ThemeConfig>) => void;
|
|
5
5
|
setMode: (mode: "light" | "dark") => void;
|
|
6
6
|
_hasProvider?: boolean;
|
|
7
7
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.2.2",
|
|
5
5
|
"description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/zora#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@ankhorage/color-theory": "^0.3.0",
|
|
41
|
-
"@ankhorage/contracts": "^
|
|
41
|
+
"@ankhorage/contracts": "^11.0.0",
|
|
42
42
|
"@ankhorage/surface": "^3.4.1"
|
|
43
43
|
},
|
|
44
44
|
"files": [
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
import { ZORA_COMPONENT_META } from '../../metadata/componentMeta';
|
|
4
|
+
|
|
5
|
+
test('permits media-backed Icon and Image content in ordinary screen containers', () => {
|
|
6
|
+
const icon = ZORA_COMPONENT_META.Icon;
|
|
7
|
+
expect(icon.directManifestNode).toBe(true);
|
|
8
|
+
expect(icon.allowedChildren).toEqual([]);
|
|
9
|
+
expect(icon.props.source).toMatchObject({ type: 'media', mediaKinds: ['image'] });
|
|
10
|
+
for (const container of [
|
|
11
|
+
ZORA_COMPONENT_META.Box,
|
|
12
|
+
ZORA_COMPONENT_META.Stack,
|
|
13
|
+
ZORA_COMPONENT_META.Grid,
|
|
14
|
+
ZORA_COMPONENT_META.Container,
|
|
15
|
+
ZORA_COMPONENT_META.Card,
|
|
16
|
+
ZORA_COMPONENT_META.Screen,
|
|
17
|
+
ZORA_COMPONENT_META.ScreenSection,
|
|
18
|
+
]) {
|
|
19
|
+
expect(container.allowedChildren).toContain('Icon');
|
|
20
|
+
expect(container.allowedChildren).toContain('Image');
|
|
21
|
+
}
|
|
22
|
+
});
|
|
@@ -3,8 +3,29 @@ import type { ZoraComponentMeta } from '../../metadata';
|
|
|
3
3
|
export const iconMeta = {
|
|
4
4
|
name: 'Icon',
|
|
5
5
|
category: 'component',
|
|
6
|
-
|
|
6
|
+
description: 'Displays a standalone SVG icon from the app media registry.',
|
|
7
|
+
directManifestNode: true,
|
|
7
8
|
allowedChildren: [],
|
|
8
|
-
|
|
9
|
-
props: {
|
|
9
|
+
blueprint: { label: 'Icon' },
|
|
10
|
+
props: {
|
|
11
|
+
source: {
|
|
12
|
+
type: 'media',
|
|
13
|
+
category: 'Content',
|
|
14
|
+
label: 'SVG source',
|
|
15
|
+
mediaKinds: ['image'],
|
|
16
|
+
authoring: { authority: 'instance' },
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
type: 'number',
|
|
20
|
+
category: 'Appearance',
|
|
21
|
+
label: 'Size',
|
|
22
|
+
authoring: { authority: 'instance' },
|
|
23
|
+
},
|
|
24
|
+
color: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
category: 'Appearance',
|
|
27
|
+
label: 'Color',
|
|
28
|
+
authoring: { authority: 'instance' },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
10
31
|
} as const satisfies ZoraComponentMeta;
|