@ankhorage/zora 2.6.1 → 2.7.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 +6 -0
- package/README.md +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +4 -0
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/patterns/scanner/BarcodeScannerView.d.ts +11 -0
- package/dist/patterns/scanner/BarcodeScannerView.d.ts.map +1 -0
- package/dist/patterns/scanner/BarcodeScannerView.js +77 -0
- package/dist/patterns/scanner/BarcodeScannerView.js.map +1 -0
- package/dist/patterns/scanner/CameraPermissionView.d.ts +11 -0
- package/dist/patterns/scanner/CameraPermissionView.d.ts.map +1 -0
- package/dist/patterns/scanner/CameraPermissionView.js +62 -0
- package/dist/patterns/scanner/CameraPermissionView.js.map +1 -0
- package/dist/patterns/scanner/ScanOverlay.d.ts +11 -0
- package/dist/patterns/scanner/ScanOverlay.d.ts.map +1 -0
- package/dist/patterns/scanner/ScanOverlay.js +85 -0
- package/dist/patterns/scanner/ScanOverlay.js.map +1 -0
- package/dist/patterns/scanner/index.d.ts +5 -0
- package/dist/patterns/scanner/index.d.ts.map +1 -0
- package/dist/patterns/scanner/index.js +4 -0
- package/dist/patterns/scanner/index.js.map +1 -0
- package/dist/patterns/scanner/meta.d.ts +190 -0
- package/dist/patterns/scanner/meta.d.ts.map +1 -0
- package/dist/patterns/scanner/meta.js +186 -0
- package/dist/patterns/scanner/meta.js.map +1 -0
- package/dist/patterns/scanner/types.d.ts +42 -0
- package/dist/patterns/scanner/types.d.ts.map +1 -0
- package/dist/patterns/scanner/types.js +2 -0
- package/dist/patterns/scanner/types.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +8 -0
- package/src/metadata/componentMeta.test.ts +30 -105
- package/src/metadata/componentMeta.ts +8 -0
- package/src/patterns/scanner/BarcodeScannerView.tsx +127 -0
- package/src/patterns/scanner/CameraPermissionView.tsx +108 -0
- package/src/patterns/scanner/ScanOverlay.tsx +99 -0
- package/src/patterns/scanner/index.ts +10 -0
- package/src/patterns/scanner/meta.ts +190 -0
- package/src/patterns/scanner/types.ts +47 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { BarcodeScannerView } from './BarcodeScannerView';
|
|
2
|
+
export { CameraPermissionView } from './CameraPermissionView';
|
|
3
|
+
export { ScanOverlay } from './ScanOverlay';
|
|
4
|
+
export type { BarcodeScannerViewProps, BarcodeScanResult, CameraPermissionStatus, CameraPermissionViewProps, ScanOverlayProps, } from './types';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/scanner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/scanner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { BarcodeScannerView } from './BarcodeScannerView';\nexport { CameraPermissionView } from './CameraPermissionView';\nexport { ScanOverlay } from './ScanOverlay';\nexport type {\n BarcodeScannerViewProps,\n BarcodeScanResult,\n CameraPermissionStatus,\n CameraPermissionViewProps,\n ScanOverlayProps,\n} from './types';\n"]}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
export declare const scanOverlayMeta: {
|
|
2
|
+
readonly name: "ScanOverlay";
|
|
3
|
+
readonly category: "pattern";
|
|
4
|
+
readonly description: "Camera-agnostic scan frame overlay for barcode and QR scanning flows.";
|
|
5
|
+
readonly directManifestNode: true;
|
|
6
|
+
readonly allowedChildren: readonly [];
|
|
7
|
+
readonly blueprint: {
|
|
8
|
+
readonly label: "Scan overlay";
|
|
9
|
+
readonly defaultProps: {
|
|
10
|
+
readonly title: "Align the barcode";
|
|
11
|
+
readonly description: "Hold the barcode inside the frame. Scanning starts automatically.";
|
|
12
|
+
readonly cornerLabel: "SCAN";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
readonly props: {
|
|
16
|
+
readonly title: {
|
|
17
|
+
readonly type: "string";
|
|
18
|
+
readonly category: "Content";
|
|
19
|
+
readonly label: "Title";
|
|
20
|
+
readonly default: "Align the barcode";
|
|
21
|
+
};
|
|
22
|
+
readonly description: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly category: "Content";
|
|
25
|
+
readonly label: "Description";
|
|
26
|
+
readonly default: "Hold the barcode inside the frame. Scanning starts automatically.";
|
|
27
|
+
};
|
|
28
|
+
readonly cornerLabel: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly category: "Content";
|
|
31
|
+
readonly label: "Corner label";
|
|
32
|
+
readonly default: "SCAN";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const cameraPermissionViewMeta: {
|
|
37
|
+
readonly name: "CameraPermissionView";
|
|
38
|
+
readonly category: "pattern";
|
|
39
|
+
readonly description: "ZORA-owned camera permission state for scanner flows.";
|
|
40
|
+
readonly directManifestNode: true;
|
|
41
|
+
readonly allowedChildren: readonly [];
|
|
42
|
+
readonly blueprint: {
|
|
43
|
+
readonly label: "Camera permission";
|
|
44
|
+
readonly defaultProps: {
|
|
45
|
+
readonly status: "unknown";
|
|
46
|
+
readonly requestLabel: "Allow camera access";
|
|
47
|
+
readonly manualEntryLabel: "Enter barcode manually";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly props: {
|
|
51
|
+
readonly status: {
|
|
52
|
+
readonly type: "enum";
|
|
53
|
+
readonly category: "State";
|
|
54
|
+
readonly label: "Permission status";
|
|
55
|
+
readonly enum: readonly ["unknown", "requesting", "denied"];
|
|
56
|
+
readonly default: "unknown";
|
|
57
|
+
};
|
|
58
|
+
readonly title: {
|
|
59
|
+
readonly type: "string";
|
|
60
|
+
readonly category: "Content";
|
|
61
|
+
readonly label: "Title";
|
|
62
|
+
};
|
|
63
|
+
readonly description: {
|
|
64
|
+
readonly type: "string";
|
|
65
|
+
readonly category: "Content";
|
|
66
|
+
readonly label: "Description";
|
|
67
|
+
};
|
|
68
|
+
readonly requestLabel: {
|
|
69
|
+
readonly type: "string";
|
|
70
|
+
readonly category: "Content";
|
|
71
|
+
readonly label: "Request label";
|
|
72
|
+
readonly default: "Allow camera access";
|
|
73
|
+
};
|
|
74
|
+
readonly deniedLabel: {
|
|
75
|
+
readonly type: "string";
|
|
76
|
+
readonly category: "Content";
|
|
77
|
+
readonly label: "Denied label";
|
|
78
|
+
readonly default: "Open settings";
|
|
79
|
+
};
|
|
80
|
+
readonly manualEntryLabel: {
|
|
81
|
+
readonly type: "string";
|
|
82
|
+
readonly category: "Content";
|
|
83
|
+
readonly label: "Manual entry label";
|
|
84
|
+
readonly default: "Enter barcode manually";
|
|
85
|
+
};
|
|
86
|
+
readonly onRequestPermission: {
|
|
87
|
+
readonly type: "action";
|
|
88
|
+
readonly category: "Events";
|
|
89
|
+
readonly label: "Request permission action";
|
|
90
|
+
};
|
|
91
|
+
readonly onManualEntry: {
|
|
92
|
+
readonly type: "action";
|
|
93
|
+
readonly category: "Events";
|
|
94
|
+
readonly label: "Manual entry action";
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export declare const barcodeScannerViewMeta: {
|
|
99
|
+
readonly name: "BarcodeScannerView";
|
|
100
|
+
readonly category: "pattern";
|
|
101
|
+
readonly description: "Composed scanner shell with permission, camera slot, scan overlay, and manual entry affordance.";
|
|
102
|
+
readonly directManifestNode: true;
|
|
103
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble"];
|
|
104
|
+
readonly blueprint: {
|
|
105
|
+
readonly label: "Barcode scanner";
|
|
106
|
+
readonly defaultProps: {
|
|
107
|
+
readonly permissionStatus: "unknown";
|
|
108
|
+
readonly title: "Scan barcode";
|
|
109
|
+
readonly description: "Point the camera at a barcode to continue.";
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
readonly events: {
|
|
113
|
+
readonly onBarcodeScanned: {
|
|
114
|
+
readonly label: "Barcode scanned";
|
|
115
|
+
readonly eventType: "scan";
|
|
116
|
+
readonly description: "Emitted by the app camera adapter after a barcode has been scanned.";
|
|
117
|
+
readonly payloadFields: readonly [{
|
|
118
|
+
readonly path: "value";
|
|
119
|
+
readonly type: "string";
|
|
120
|
+
readonly label: "Barcode value";
|
|
121
|
+
}, {
|
|
122
|
+
readonly path: "type";
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
readonly label: "Barcode type";
|
|
125
|
+
}];
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
readonly slots: {
|
|
129
|
+
readonly camera: {
|
|
130
|
+
readonly label: "Camera adapter";
|
|
131
|
+
readonly allowedChildren: readonly [];
|
|
132
|
+
};
|
|
133
|
+
readonly children: {
|
|
134
|
+
readonly label: "Scanner footer";
|
|
135
|
+
readonly allowedChildren: readonly ["Box", "Stack", "Grid", "Container", "Divider", "Text", "Heading", "Button", "ButtonGroup", "Input", "Textarea", "FormField", "Card", "Panel", "Notice", "EmptyState", "SectionHeader", "SettingsRow", "PostCard", "ChatListItem", "MessageBubble"];
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
readonly props: {
|
|
139
|
+
readonly permissionStatus: {
|
|
140
|
+
readonly type: "enum";
|
|
141
|
+
readonly category: "State";
|
|
142
|
+
readonly label: "Permission status";
|
|
143
|
+
readonly enum: readonly ["unknown", "requesting", "granted", "denied"];
|
|
144
|
+
readonly default: "unknown";
|
|
145
|
+
};
|
|
146
|
+
readonly title: {
|
|
147
|
+
readonly type: "string";
|
|
148
|
+
readonly category: "Content";
|
|
149
|
+
readonly label: "Title";
|
|
150
|
+
readonly default: "Scan barcode";
|
|
151
|
+
};
|
|
152
|
+
readonly description: {
|
|
153
|
+
readonly type: "string";
|
|
154
|
+
readonly category: "Content";
|
|
155
|
+
readonly label: "Description";
|
|
156
|
+
readonly default: "Point the camera at a barcode to continue.";
|
|
157
|
+
};
|
|
158
|
+
readonly overlayTitle: {
|
|
159
|
+
readonly type: "string";
|
|
160
|
+
readonly category: "Content";
|
|
161
|
+
readonly label: "Overlay title";
|
|
162
|
+
};
|
|
163
|
+
readonly overlayDescription: {
|
|
164
|
+
readonly type: "string";
|
|
165
|
+
readonly category: "Content";
|
|
166
|
+
readonly label: "Overlay description";
|
|
167
|
+
};
|
|
168
|
+
readonly requestPermissionLabel: {
|
|
169
|
+
readonly type: "string";
|
|
170
|
+
readonly category: "Content";
|
|
171
|
+
readonly label: "Request permission label";
|
|
172
|
+
};
|
|
173
|
+
readonly manualEntryLabel: {
|
|
174
|
+
readonly type: "string";
|
|
175
|
+
readonly category: "Content";
|
|
176
|
+
readonly label: "Manual entry label";
|
|
177
|
+
};
|
|
178
|
+
readonly onRequestPermission: {
|
|
179
|
+
readonly type: "action";
|
|
180
|
+
readonly category: "Events";
|
|
181
|
+
readonly label: "Request permission action";
|
|
182
|
+
};
|
|
183
|
+
readonly onManualEntry: {
|
|
184
|
+
readonly type: "action";
|
|
185
|
+
readonly category: "Events";
|
|
186
|
+
readonly label: "Manual entry action";
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/patterns/scanner/meta.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCU,CAAC;AAEvC,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DC,CAAC;AAEvC,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuFG,CAAC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { CONTAINER_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';
|
|
2
|
+
export const scanOverlayMeta = {
|
|
3
|
+
name: 'ScanOverlay',
|
|
4
|
+
category: 'pattern',
|
|
5
|
+
description: 'Camera-agnostic scan frame overlay for barcode and QR scanning flows.',
|
|
6
|
+
directManifestNode: true,
|
|
7
|
+
allowedChildren: [],
|
|
8
|
+
blueprint: {
|
|
9
|
+
label: 'Scan overlay',
|
|
10
|
+
defaultProps: {
|
|
11
|
+
title: 'Align the barcode',
|
|
12
|
+
description: 'Hold the barcode inside the frame. Scanning starts automatically.',
|
|
13
|
+
cornerLabel: 'SCAN',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
props: {
|
|
17
|
+
title: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
category: 'Content',
|
|
20
|
+
label: 'Title',
|
|
21
|
+
default: 'Align the barcode',
|
|
22
|
+
},
|
|
23
|
+
description: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
category: 'Content',
|
|
26
|
+
label: 'Description',
|
|
27
|
+
default: 'Hold the barcode inside the frame. Scanning starts automatically.',
|
|
28
|
+
},
|
|
29
|
+
cornerLabel: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
category: 'Content',
|
|
32
|
+
label: 'Corner label',
|
|
33
|
+
default: 'SCAN',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export const cameraPermissionViewMeta = {
|
|
38
|
+
name: 'CameraPermissionView',
|
|
39
|
+
category: 'pattern',
|
|
40
|
+
description: 'ZORA-owned camera permission state for scanner flows.',
|
|
41
|
+
directManifestNode: true,
|
|
42
|
+
allowedChildren: [],
|
|
43
|
+
blueprint: {
|
|
44
|
+
label: 'Camera permission',
|
|
45
|
+
defaultProps: {
|
|
46
|
+
status: 'unknown',
|
|
47
|
+
requestLabel: 'Allow camera access',
|
|
48
|
+
manualEntryLabel: 'Enter barcode manually',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
props: {
|
|
52
|
+
status: {
|
|
53
|
+
type: 'enum',
|
|
54
|
+
category: 'State',
|
|
55
|
+
label: 'Permission status',
|
|
56
|
+
enum: ['unknown', 'requesting', 'denied'],
|
|
57
|
+
default: 'unknown',
|
|
58
|
+
},
|
|
59
|
+
title: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
category: 'Content',
|
|
62
|
+
label: 'Title',
|
|
63
|
+
},
|
|
64
|
+
description: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
category: 'Content',
|
|
67
|
+
label: 'Description',
|
|
68
|
+
},
|
|
69
|
+
requestLabel: {
|
|
70
|
+
type: 'string',
|
|
71
|
+
category: 'Content',
|
|
72
|
+
label: 'Request label',
|
|
73
|
+
default: 'Allow camera access',
|
|
74
|
+
},
|
|
75
|
+
deniedLabel: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
category: 'Content',
|
|
78
|
+
label: 'Denied label',
|
|
79
|
+
default: 'Open settings',
|
|
80
|
+
},
|
|
81
|
+
manualEntryLabel: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
category: 'Content',
|
|
84
|
+
label: 'Manual entry label',
|
|
85
|
+
default: 'Enter barcode manually',
|
|
86
|
+
},
|
|
87
|
+
onRequestPermission: {
|
|
88
|
+
type: 'action',
|
|
89
|
+
category: 'Events',
|
|
90
|
+
label: 'Request permission action',
|
|
91
|
+
},
|
|
92
|
+
onManualEntry: {
|
|
93
|
+
type: 'action',
|
|
94
|
+
category: 'Events',
|
|
95
|
+
label: 'Manual entry action',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
export const barcodeScannerViewMeta = {
|
|
100
|
+
name: 'BarcodeScannerView',
|
|
101
|
+
category: 'pattern',
|
|
102
|
+
description: 'Composed scanner shell with permission, camera slot, scan overlay, and manual entry affordance.',
|
|
103
|
+
directManifestNode: true,
|
|
104
|
+
allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],
|
|
105
|
+
blueprint: {
|
|
106
|
+
label: 'Barcode scanner',
|
|
107
|
+
defaultProps: {
|
|
108
|
+
permissionStatus: 'unknown',
|
|
109
|
+
title: 'Scan barcode',
|
|
110
|
+
description: 'Point the camera at a barcode to continue.',
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
events: {
|
|
114
|
+
onBarcodeScanned: {
|
|
115
|
+
label: 'Barcode scanned',
|
|
116
|
+
eventType: 'scan',
|
|
117
|
+
description: 'Emitted by the app camera adapter after a barcode has been scanned.',
|
|
118
|
+
payloadFields: [
|
|
119
|
+
{ path: 'value', type: 'string', label: 'Barcode value' },
|
|
120
|
+
{ path: 'type', type: 'string', label: 'Barcode type' },
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
slots: {
|
|
125
|
+
camera: {
|
|
126
|
+
label: 'Camera adapter',
|
|
127
|
+
allowedChildren: [],
|
|
128
|
+
},
|
|
129
|
+
children: {
|
|
130
|
+
label: 'Scanner footer',
|
|
131
|
+
allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
props: {
|
|
135
|
+
permissionStatus: {
|
|
136
|
+
type: 'enum',
|
|
137
|
+
category: 'State',
|
|
138
|
+
label: 'Permission status',
|
|
139
|
+
enum: ['unknown', 'requesting', 'granted', 'denied'],
|
|
140
|
+
default: 'unknown',
|
|
141
|
+
},
|
|
142
|
+
title: {
|
|
143
|
+
type: 'string',
|
|
144
|
+
category: 'Content',
|
|
145
|
+
label: 'Title',
|
|
146
|
+
default: 'Scan barcode',
|
|
147
|
+
},
|
|
148
|
+
description: {
|
|
149
|
+
type: 'string',
|
|
150
|
+
category: 'Content',
|
|
151
|
+
label: 'Description',
|
|
152
|
+
default: 'Point the camera at a barcode to continue.',
|
|
153
|
+
},
|
|
154
|
+
overlayTitle: {
|
|
155
|
+
type: 'string',
|
|
156
|
+
category: 'Content',
|
|
157
|
+
label: 'Overlay title',
|
|
158
|
+
},
|
|
159
|
+
overlayDescription: {
|
|
160
|
+
type: 'string',
|
|
161
|
+
category: 'Content',
|
|
162
|
+
label: 'Overlay description',
|
|
163
|
+
},
|
|
164
|
+
requestPermissionLabel: {
|
|
165
|
+
type: 'string',
|
|
166
|
+
category: 'Content',
|
|
167
|
+
label: 'Request permission label',
|
|
168
|
+
},
|
|
169
|
+
manualEntryLabel: {
|
|
170
|
+
type: 'string',
|
|
171
|
+
category: 'Content',
|
|
172
|
+
label: 'Manual entry label',
|
|
173
|
+
},
|
|
174
|
+
onRequestPermission: {
|
|
175
|
+
type: 'action',
|
|
176
|
+
category: 'Events',
|
|
177
|
+
label: 'Request permission action',
|
|
178
|
+
},
|
|
179
|
+
onManualEntry: {
|
|
180
|
+
type: 'action',
|
|
181
|
+
category: 'Events',
|
|
182
|
+
label: 'Manual entry action',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/patterns/scanner/meta.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,uEAAuE;IACpF,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE;QACT,KAAK,EAAE,cAAc;QACrB,YAAY,EAAE;YACZ,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,mEAAmE;YAChF,WAAW,EAAE,MAAM;SACpB;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,mBAAmB;SAC7B;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE,mEAAmE;SAC7E;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE,MAAM;SAChB;KACF;CACmC,CAAC;AAEvC,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,sBAAsB;IAC5B,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,uDAAuD;IACpE,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,SAAS,EAAE;QACT,KAAK,EAAE,mBAAmB;QAC1B,YAAY,EAAE;YACZ,MAAM,EAAE,SAAS;YACjB,YAAY,EAAE,qBAAqB;YACnC,gBAAgB,EAAE,wBAAwB;SAC3C;KACF;IACD,KAAK,E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AC7B;QACD,sBAAsB,EAAE;YACtB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,0BAA0B;SAClC;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,oBAAoB;SAC5B;QACD,mBAAmB,EAAE;YACnB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,2BAA2B;SACnC;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,qBAAqB;SAC7B;KACF;CACmC,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\nimport { CONTAINER_ALLOWED_CHILDREN } from '../../metadata/allowedChildren';\n\nexport const scanOverlayMeta = {\n name: 'ScanOverlay',\n category: 'pattern',\n description: 'Camera-agnostic scan frame overlay for barcode and QR scanning flows.',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Scan overlay',\n defaultProps: {\n title: 'Align the barcode',\n description: 'Hold the barcode inside the frame. Scanning starts automatically.',\n cornerLabel: 'SCAN',\n },\n },\n props: {\n title: {\n type: 'string',\n category: 'Content',\n label: 'Title',\n default: 'Align the barcode',\n },\n description: {\n type: 'string',\n category: 'Content',\n label: 'Description',\n default: 'Hold the barcode inside the frame. Scanning starts automatically.',\n },\n cornerLabel: {\n type: 'string',\n category: 'Content',\n label: 'Corner label',\n default: 'SCAN',\n },\n },\n} as const satisfies ZoraComponentMeta;\n\nexport const cameraPermissionViewMeta = {\n name: 'CameraPermissionView',\n category: 'pattern',\n description: 'ZORA-owned camera permission state for scanner flows.',\n directManifestNode: true,\n allowedChildren: [],\n blueprint: {\n label: 'Camera permission',\n defaultProps: {\n status: 'unknown',\n requestLabel: 'Allow camera access',\n manualEntryLabel: 'Enter barcode manually',\n },\n },\n props: {\n status: {\n type: 'enum',\n category: 'State',\n label: 'Permission status',\n enum: ['unknown', 'requesting', 'denied'],\n default: 'unknown',\n },\n title: {\n type: 'string',\n category: 'Content',\n label: 'Title',\n },\n description: {\n type: 'string',\n category: 'Content',\n label: 'Description',\n },\n requestLabel: {\n type: 'string',\n category: 'Content',\n label: 'Request label',\n default: 'Allow camera access',\n },\n deniedLabel: {\n type: 'string',\n category: 'Content',\n label: 'Denied label',\n default: 'Open settings',\n },\n manualEntryLabel: {\n type: 'string',\n category: 'Content',\n label: 'Manual entry label',\n default: 'Enter barcode manually',\n },\n onRequestPermission: {\n type: 'action',\n category: 'Events',\n label: 'Request permission action',\n },\n onManualEntry: {\n type: 'action',\n category: 'Events',\n label: 'Manual entry action',\n },\n },\n} as const satisfies ZoraComponentMeta;\n\nexport const barcodeScannerViewMeta = {\n name: 'BarcodeScannerView',\n category: 'pattern',\n description:\n 'Composed scanner shell with permission, camera slot, scan overlay, and manual entry affordance.',\n directManifestNode: true,\n allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],\n blueprint: {\n label: 'Barcode scanner',\n defaultProps: {\n permissionStatus: 'unknown',\n title: 'Scan barcode',\n description: 'Point the camera at a barcode to continue.',\n },\n },\n events: {\n onBarcodeScanned: {\n label: 'Barcode scanned',\n eventType: 'scan',\n description: 'Emitted by the app camera adapter after a barcode has been scanned.',\n payloadFields: [\n { path: 'value', type: 'string', label: 'Barcode value' },\n { path: 'type', type: 'string', label: 'Barcode type' },\n ],\n },\n },\n slots: {\n camera: {\n label: 'Camera adapter',\n allowedChildren: [],\n },\n children: {\n label: 'Scanner footer',\n allowedChildren: [...CONTAINER_ALLOWED_CHILDREN],\n },\n },\n props: {\n permissionStatus: {\n type: 'enum',\n category: 'State',\n label: 'Permission status',\n enum: ['unknown', 'requesting', 'granted', 'denied'],\n default: 'unknown',\n },\n title: {\n type: 'string',\n category: 'Content',\n label: 'Title',\n default: 'Scan barcode',\n },\n description: {\n type: 'string',\n category: 'Content',\n label: 'Description',\n default: 'Point the camera at a barcode to continue.',\n },\n overlayTitle: {\n type: 'string',\n category: 'Content',\n label: 'Overlay title',\n },\n overlayDescription: {\n type: 'string',\n category: 'Content',\n label: 'Overlay description',\n },\n requestPermissionLabel: {\n type: 'string',\n category: 'Content',\n label: 'Request permission label',\n },\n manualEntryLabel: {\n type: 'string',\n category: 'Content',\n label: 'Manual entry label',\n },\n onRequestPermission: {\n type: 'action',\n category: 'Events',\n label: 'Request permission action',\n },\n onManualEntry: {\n type: 'action',\n category: 'Events',\n label: 'Manual entry action',\n },\n },\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ButtonProps } from '../../components/button';
|
|
3
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
|
+
export type CameraPermissionStatus = 'unknown' | 'requesting' | 'granted' | 'denied';
|
|
5
|
+
export interface BarcodeScanResult {
|
|
6
|
+
value: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ScanOverlayProps extends ZoraBaseProps {
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
description?: React.ReactNode;
|
|
12
|
+
cornerLabel?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface CameraPermissionViewProps extends ZoraBaseProps {
|
|
15
|
+
status: Exclude<CameraPermissionStatus, 'granted'>;
|
|
16
|
+
title?: React.ReactNode;
|
|
17
|
+
description?: React.ReactNode;
|
|
18
|
+
requestLabel?: React.ReactNode;
|
|
19
|
+
deniedLabel?: React.ReactNode;
|
|
20
|
+
manualEntryLabel?: React.ReactNode;
|
|
21
|
+
onRequestPermission?: () => void | Promise<void>;
|
|
22
|
+
onManualEntry?: () => void | Promise<void>;
|
|
23
|
+
requestButtonProps?: Omit<ButtonProps, 'children' | 'onPress'>;
|
|
24
|
+
manualEntryButtonProps?: Omit<ButtonProps, 'children' | 'onPress'>;
|
|
25
|
+
}
|
|
26
|
+
export interface BarcodeScannerViewProps extends ZoraBaseProps {
|
|
27
|
+
permissionStatus: CameraPermissionStatus;
|
|
28
|
+
camera?: React.ReactNode;
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
title?: React.ReactNode;
|
|
31
|
+
description?: React.ReactNode;
|
|
32
|
+
overlayTitle?: React.ReactNode;
|
|
33
|
+
overlayDescription?: React.ReactNode;
|
|
34
|
+
cornerLabel?: React.ReactNode;
|
|
35
|
+
requestPermissionLabel?: React.ReactNode;
|
|
36
|
+
deniedPermissionLabel?: React.ReactNode;
|
|
37
|
+
manualEntryLabel?: React.ReactNode;
|
|
38
|
+
onRequestPermission?: () => void | Promise<void>;
|
|
39
|
+
onManualEntry?: () => void | Promise<void>;
|
|
40
|
+
onBarcodeScanned?: (result: BarcodeScanResult) => void | Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/scanner/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErF,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,MAAM,EAAE,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AC,IAAI,CAAC,CAAC;IACjD,aAAa,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/scanner/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ButtonProps } from '../../components/button';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport type CameraPermissionStatus = 'unknown' | 'requesting' | 'granted' | 'denied';\n\nexport interface BarcodeScanResult {\n value: string;\n type?: string;\n}\n\nexport interface ScanOverlayProps extends ZoraBaseProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n cornerLabel?: React.ReactNode;\n}\n\nexport interface CameraPermissionViewProps extends ZoraBaseProps {\n status: Exclude<CameraPermissionStatus, 'granted'>;\n title?: React.ReactNode;\n description?: React.ReactNode;\n requestLabel?: React.ReactNode;\n deniedLabel?: React.ReactNode;\n manualEntryLabel?: React.ReactNode;\n onRequestPermission?: () => void | Promise<void>;\n onManualEntry?: () => void | Promise<void>;\n requestButtonProps?: Omit<ButtonProps, 'children' | 'onPress'>;\n manualEntryButtonProps?: Omit<ButtonProps, 'children' | 'onPress'>;\n}\n\nexport interface BarcodeScannerViewProps extends ZoraBaseProps {\n permissionStatus: CameraPermissionStatus;\n camera?: React.ReactNode;\n children?: React.ReactNode;\n title?: React.ReactNode;\n description?: React.ReactNode;\n overlayTitle?: React.ReactNode;\n overlayDescription?: React.ReactNode;\n cornerLabel?: React.ReactNode;\n requestPermissionLabel?: React.ReactNode;\n deniedPermissionLabel?: React.ReactNode;\n manualEntryLabel?: React.ReactNode;\n onRequestPermission?: () => void | Promise<void>;\n onManualEntry?: () => void | Promise<void>;\n onBarcodeScanned?: (result: BarcodeScanResult) => void | Promise<void>;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.7.0",
|
|
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": {
|
package/src/index.ts
CHANGED
|
@@ -317,6 +317,14 @@ export type {
|
|
|
317
317
|
ResponsivePanelSize,
|
|
318
318
|
} from './patterns/responsive-panel';
|
|
319
319
|
export { ResponsivePanel } from './patterns/responsive-panel';
|
|
320
|
+
export type {
|
|
321
|
+
BarcodeScannerViewProps,
|
|
322
|
+
BarcodeScanResult,
|
|
323
|
+
CameraPermissionStatus,
|
|
324
|
+
CameraPermissionViewProps,
|
|
325
|
+
ScanOverlayProps,
|
|
326
|
+
} from './patterns/scanner';
|
|
327
|
+
export { BarcodeScannerView, CameraPermissionView, ScanOverlay } from './patterns/scanner';
|
|
320
328
|
export type { SectionHeaderProps } from './patterns/section-header';
|
|
321
329
|
export { SectionHeader } from './patterns/section-header';
|
|
322
330
|
export type {
|