@ankhorage/templates 6.0.0 → 7.0.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/commands.d.ts +6 -2
- package/dist/commands.d.ts.map +1 -1
- package/dist/internal/zora-nodes.d.ts +3 -1
- package/dist/internal/zora-nodes.d.ts.map +1 -1
- package/dist/internal/zora-nodes.js.map +1 -1
- package/dist/templates/shared/zora-node-helpers.d.ts.map +1 -1
- package/dist/templates/shared/zora-node-helpers.js +8 -0
- package/dist/templates/shared/zora-node-helpers.js.map +1 -1
- package/dist/templates/starter/categories/fallback/screens.d.ts.map +1 -1
- package/dist/templates/starter/categories/fallback/screens.js +8 -0
- package/dist/templates/starter/categories/fallback/screens.js.map +1 -1
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/api.d.ts +3 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/api.d.ts.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/api.js +18 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/api.js.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/apiEndpoints.d.ts +165 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/apiEndpoints.d.ts.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/apiEndpoints.js +138 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/apiEndpoints.js.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/apiSchemas.d.ts +33 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/apiSchemas.d.ts.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/apiSchemas.js +80 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/apiSchemas.js.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/bindings.d.ts.map +1 -1
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/bindings.js +32 -125
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/bindings.js.map +1 -1
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/catalogScreenBody.d.ts +3 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/catalogScreenBody.d.ts.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/catalogScreenBody.js +44 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/catalogScreenBody.js.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/contentScreen.d.ts +29 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/contentScreen.d.ts.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/contentScreen.js +32 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/contentScreen.js.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/productCreateScreenBody.d.ts +3 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/productCreateScreenBody.d.ts.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/productCreateScreenBody.js +88 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/productCreateScreenBody.js.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/productDetailScreenBody.d.ts +8 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/productDetailScreenBody.d.ts.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/productDetailScreenBody.js +96 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/productDetailScreenBody.js.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/scanScreenBody.d.ts +3 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/scanScreenBody.d.ts.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/scanScreenBody.js +20 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/scanScreenBody.js.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/screens.d.ts.map +1 -1
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/screens.js +24 -385
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/screens.js.map +1 -1
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/settingsScreen.d.ts +8 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/settingsScreen.d.ts.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/settingsScreen.js +44 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/settingsScreen.js.map +1 -0
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/template.d.ts.map +1 -1
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/template.js +2 -5
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/template.js.map +1 -1
- package/package.json +3 -4
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/dataSources.d.ts +0 -3
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/dataSources.d.ts.map +0 -1
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/dataSources.js +0 -14
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/dataSources.js.map +0 -1
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/externalDataSource.d.ts +0 -3
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/externalDataSource.d.ts.map +0 -1
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/externalDataSource.js +0 -46
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/externalDataSource.js.map +0 -1
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/generatedApi.d.ts +0 -3
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/generatedApi.d.ts.map +0 -1
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/generatedApi.js +0 -43
- package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/generatedApi.js.map +0 -1
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { createZoraNode } from '../../../../shared';
|
|
2
|
+
export function createNutritionProductCreateBody(idPrefix) {
|
|
3
|
+
return [
|
|
4
|
+
createZoraNode(`${idPrefix}-create-form-panel`, 'Panel', {
|
|
5
|
+
title: 'Direct product create form',
|
|
6
|
+
description: 'Create a product through the Nutrition API when barcode lookup finds no match.',
|
|
7
|
+
tone: 'subtle',
|
|
8
|
+
}, [
|
|
9
|
+
createZoraNode(`${idPrefix}-create-barcode-field`, 'FormField', {
|
|
10
|
+
label: 'Barcode',
|
|
11
|
+
description: 'Prefilled from scan or manual entry and normalized by the Nutrition API.',
|
|
12
|
+
required: true,
|
|
13
|
+
}),
|
|
14
|
+
createZoraNode(`${idPrefix}-create-barcode-input`, 'Input', {
|
|
15
|
+
placeholder: '7612345678901',
|
|
16
|
+
keyboardType: 'number-pad',
|
|
17
|
+
size: 'm',
|
|
18
|
+
}),
|
|
19
|
+
createZoraNode(`${idPrefix}-create-name-field`, 'FormField', {
|
|
20
|
+
label: 'Product name',
|
|
21
|
+
description: 'Required by the Nutrition API create request.',
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
createZoraNode(`${idPrefix}-create-name-input`, 'Input', {
|
|
25
|
+
placeholder: 'Product name',
|
|
26
|
+
size: 'm',
|
|
27
|
+
}),
|
|
28
|
+
createZoraNode(`${idPrefix}-create-brand-field`, 'FormField', {
|
|
29
|
+
label: 'Brand',
|
|
30
|
+
description: 'Optional product brand.',
|
|
31
|
+
}),
|
|
32
|
+
createZoraNode(`${idPrefix}-create-brand-input`, 'Input', {
|
|
33
|
+
placeholder: 'Brand',
|
|
34
|
+
size: 'm',
|
|
35
|
+
}),
|
|
36
|
+
createZoraNode(`${idPrefix}-create-package-label-field`, 'FormField', {
|
|
37
|
+
label: 'Package label',
|
|
38
|
+
description: 'Optional package text such as 500ml or 6 x 33cl.',
|
|
39
|
+
}),
|
|
40
|
+
createZoraNode(`${idPrefix}-create-package-label-input`, 'Input', {
|
|
41
|
+
placeholder: '500ml',
|
|
42
|
+
size: 'm',
|
|
43
|
+
}),
|
|
44
|
+
createZoraNode(`${idPrefix}-create-nutrition-basis-field`, 'FormField', {
|
|
45
|
+
label: 'nutritionFacts.basis',
|
|
46
|
+
description: 'Use per_100g, per_100ml, or per_serving.',
|
|
47
|
+
}),
|
|
48
|
+
createZoraNode(`${idPrefix}-create-nutrition-basis-input`, 'Input', {
|
|
49
|
+
placeholder: 'per_100g',
|
|
50
|
+
autoCapitalize: 'none',
|
|
51
|
+
size: 'm',
|
|
52
|
+
}),
|
|
53
|
+
createZoraNode(`${idPrefix}-create-nutrition-facts-field`, 'FormField', {
|
|
54
|
+
label: 'nutritionFacts',
|
|
55
|
+
description: 'Structured numeric fields such as energyKcal, proteinG, carbohydratesG, sugarsG, fatG, and saltG.',
|
|
56
|
+
}),
|
|
57
|
+
createZoraNode(`${idPrefix}-create-nutrition-facts-input`, 'Input', {
|
|
58
|
+
placeholder: '{"basis":"per_100g","energyKcal":42,"proteinG":3.4}',
|
|
59
|
+
autoCapitalize: 'none',
|
|
60
|
+
size: 'm',
|
|
61
|
+
}),
|
|
62
|
+
createZoraNode(`${idPrefix}-create-image-refs-field`, 'FormField', {
|
|
63
|
+
label: 'imageRefs',
|
|
64
|
+
description: 'Image inputs contain storage bucket/path plus optional image metadata.',
|
|
65
|
+
}),
|
|
66
|
+
createZoraNode(`${idPrefix}-create-image-refs-input`, 'Input', {
|
|
67
|
+
placeholder: '[{"bucket":"nutrition","path":"products/front.jpg"}]',
|
|
68
|
+
autoCapitalize: 'none',
|
|
69
|
+
size: 'm',
|
|
70
|
+
}),
|
|
71
|
+
createZoraNode(`${idPrefix}-create-duplicate-notice`, 'Notice', {
|
|
72
|
+
title: 'Duplicate barcode handling',
|
|
73
|
+
description: 'The Nutrition API enforces barcode uniqueness and reports duplicate products as an HTTP conflict.',
|
|
74
|
+
}),
|
|
75
|
+
createZoraNode(`${idPrefix}-create-submit-button`, 'Button', {
|
|
76
|
+
children: 'Create product',
|
|
77
|
+
color: 'primary',
|
|
78
|
+
size: 'm',
|
|
79
|
+
fullWidth: true,
|
|
80
|
+
}),
|
|
81
|
+
createZoraNode(`${idPrefix}-create-error-notice`, 'Notice', {
|
|
82
|
+
title: 'Validation and availability',
|
|
83
|
+
description: 'The app surfaces canonical API-operation diagnostics for invalid input or backend availability failures.',
|
|
84
|
+
}),
|
|
85
|
+
]),
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=productCreateScreenBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productCreateScreenBody.js","sourceRoot":"","sources":["../../../../../../src/templates/starter/categories/food-drink/nutrition-catalog-scan/productCreateScreenBody.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,oBAAoB,CAAC;AAEnE,MAAM,UAAU,gCAAgC,CAAC,QAAgB;IAC/D,OAAO;QACL,cAAc,CACZ,GAAG,QAAQ,oBAAoB,EAC/B,OAAO,EACP;YACE,KAAK,EAAE,4BAA4B;YACnC,WAAW,EACT,gFAAgF;YAClF,IAAI,EAAE,QAAQ;SACf,EACD;YACE,cAAc,CAAC,GAAG,QAAQ,uBAAuB,EAAE,WAAW,EAAE;gBAC9D,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,0EAA0E;gBACvF,QAAQ,EAAE,IAAI;aACf,CAAC;YACF,cAAc,CAAC,GAAG,QAAQ,uBAAuB,EAAE,OAAO,EAAE;gBAC1D,WAAW,EAAE,eAAe;gBAC5B,YAAY,EAAE,YAAY;gBAC1B,IAAI,EAAE,GAAG;aACV,CAAC;YACF,cAAc,CAAC,GAAG,QAAQ,oBAAoB,EAAE,WAAW,EAAE;gBAC3D,KAAK,EAAE,cAAc;gBACrB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,EAAE,WAAW,EAAE;gBACjE,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,wEAAwE;aACtF,CAAC;YACF,cAAc,CAAC,GAAG,QAAQ,0BAA0B,EAAE,OAAO,EAAE;gBAC7D,WAAW,EAAE,sDAAsD;gBACnE,cAAc,EAAE,MAAM;gBACtB,IAAI,EAAE,GAAG;aACV,CAAC;YACF,cAAc,CAAC,GAAG,QAAQ,0BAA0B,EAAE,QAAQ,EAAE;gBAC9D,KAAK,EAAE,4BAA4B;gBACnC,WAAW,EACT,mGAAmG;aACtG,CAAC;YACF,cAAc,CAAC,GAAG,QAAQ,uBAAuB,EAAE,QAAQ,EAAE;gBAC3D,QAAQ,EAAE,gBAAgB;gBAC1B,KAAK,EAAE,SAAS;gBAChB,IAAI,EAAE,GAAG;gBACT,SAAS,EAAE,IAAI;aAChB,CAAC;YACF,cAAc,CAAC,GAAG,QAAQ,sBAAsB,EAAE,QAAQ,EAAE;gBAC1D,KAAK,EAAE,6BAA6B;gBACpC,WAAW,EACT,0GAA0G;aAC7G,CAAC;SACH,CACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ZoraNode } from '../../../../shared';
|
|
2
|
+
export declare const nutritionProductDetailOperation: {
|
|
3
|
+
readonly apiId: "nutrition";
|
|
4
|
+
readonly endpointId: "products";
|
|
5
|
+
readonly operationId: "products.read";
|
|
6
|
+
};
|
|
7
|
+
export declare function createNutritionProductDetailBody(idPrefix: string): ZoraNode[];
|
|
8
|
+
//# sourceMappingURL=productDetailScreenBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productDetailScreenBody.d.ts","sourceRoot":"","sources":["../../../../../../src/templates/starter/categories/food-drink/nutrition-catalog-scan/productDetailScreenBody.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiC,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAElF,eAAO,MAAM,+BAA+B;;;;CAIJ,CAAC;AAyFzC,wBAAgB,gCAAgC,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,CA2B7E"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { createSection, createZoraNode } from '../../../../shared';
|
|
2
|
+
export const nutritionProductDetailOperation = {
|
|
3
|
+
apiId: 'nutrition',
|
|
4
|
+
endpointId: 'products',
|
|
5
|
+
operationId: 'products.read',
|
|
6
|
+
};
|
|
7
|
+
function createDetailValueCard(args) {
|
|
8
|
+
return createZoraNode(args.id, 'Card', {
|
|
9
|
+
eyebrow: args.label,
|
|
10
|
+
title: args.placeholder,
|
|
11
|
+
tone: 'outline',
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const DETAIL_FIELDS = [
|
|
15
|
+
['name', 'Name', 'Loading name...'],
|
|
16
|
+
['brand', 'Brand', 'Loading brand...'],
|
|
17
|
+
['package-label', 'Package label', 'Loading package label...'],
|
|
18
|
+
['barcode', 'Barcode', 'Loading barcode...'],
|
|
19
|
+
['barcode-type', 'Barcode type', 'Loading barcode type...'],
|
|
20
|
+
['created-at', 'Created at', 'Loading created timestamp...'],
|
|
21
|
+
['updated-at', 'Updated at', 'Loading updated timestamp...'],
|
|
22
|
+
];
|
|
23
|
+
const NUTRITION_FIELDS = [
|
|
24
|
+
['nutrition-basis', 'Basis', 'Loading basis...'],
|
|
25
|
+
['energy-kj', 'Energy (kJ)', 'Loading energy...'],
|
|
26
|
+
['energy-kcal', 'Energy (kcal)', 'Loading energy...'],
|
|
27
|
+
['fat-g', 'Fat (g)', 'Loading fat...'],
|
|
28
|
+
['saturated-fat-g', 'Saturated fat (g)', 'Loading saturated fat...'],
|
|
29
|
+
['carbohydrates-g', 'Carbohydrates (g)', 'Loading carbohydrates...'],
|
|
30
|
+
['sugars-g', 'Sugars (g)', 'Loading sugars...'],
|
|
31
|
+
['fiber-g', 'Fiber (g)', 'Loading fiber...'],
|
|
32
|
+
['protein-g', 'Protein (g)', 'Loading protein...'],
|
|
33
|
+
['salt-g', 'Salt (g)', 'Loading salt...'],
|
|
34
|
+
];
|
|
35
|
+
function createValueCards(idPrefix, fields) {
|
|
36
|
+
return fields.map(([id, label, placeholder]) => createDetailValueCard({ id: `${idPrefix}-detail-${id}-value`, label, placeholder }));
|
|
37
|
+
}
|
|
38
|
+
function createImageRefList(idPrefix) {
|
|
39
|
+
return {
|
|
40
|
+
id: `${idPrefix}-detail-image-ref-list`,
|
|
41
|
+
type: 'Panel',
|
|
42
|
+
props: {
|
|
43
|
+
title: 'Product images',
|
|
44
|
+
description: 'Each block reflects one image ref returned by the Nutrition API.',
|
|
45
|
+
tone: 'subtle',
|
|
46
|
+
},
|
|
47
|
+
repeat: {
|
|
48
|
+
source: {
|
|
49
|
+
kind: 'operation',
|
|
50
|
+
operation: nutritionProductDetailOperation,
|
|
51
|
+
path: 'product.imageRefs',
|
|
52
|
+
},
|
|
53
|
+
itemAlias: 'imageRef',
|
|
54
|
+
keyPath: 'path',
|
|
55
|
+
},
|
|
56
|
+
children: [
|
|
57
|
+
createDetailValueCard({
|
|
58
|
+
id: `${idPrefix}-detail-image-ref-kind-value`,
|
|
59
|
+
label: 'Kind',
|
|
60
|
+
placeholder: 'Loading image kind...',
|
|
61
|
+
}),
|
|
62
|
+
createDetailValueCard({
|
|
63
|
+
id: `${idPrefix}-detail-image-ref-bucket-value`,
|
|
64
|
+
label: 'Bucket',
|
|
65
|
+
placeholder: 'Loading bucket...',
|
|
66
|
+
}),
|
|
67
|
+
createDetailValueCard({
|
|
68
|
+
id: `${idPrefix}-detail-image-ref-path-value`,
|
|
69
|
+
label: 'Path',
|
|
70
|
+
placeholder: 'Loading path...',
|
|
71
|
+
}),
|
|
72
|
+
createDetailValueCard({
|
|
73
|
+
id: `${idPrefix}-detail-image-ref-public-url-value`,
|
|
74
|
+
label: 'Public URL',
|
|
75
|
+
placeholder: 'Loading image URL...',
|
|
76
|
+
}),
|
|
77
|
+
],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export function createNutritionProductDetailBody(idPrefix) {
|
|
81
|
+
return [
|
|
82
|
+
createSection(`${idPrefix}-detail-summary-section`, {
|
|
83
|
+
title: 'Product details',
|
|
84
|
+
description: 'Loaded through the Nutrition API using the current route parameter ID.',
|
|
85
|
+
}, createValueCards(idPrefix, DETAIL_FIELDS)),
|
|
86
|
+
createSection(`${idPrefix}-detail-nutrition-section`, {
|
|
87
|
+
title: 'Nutrition facts',
|
|
88
|
+
description: 'Bindings read the cached Nutrition API product response.',
|
|
89
|
+
}, createValueCards(idPrefix, NUTRITION_FIELDS)),
|
|
90
|
+
createSection(`${idPrefix}-detail-images-section`, {
|
|
91
|
+
title: 'Image refs',
|
|
92
|
+
description: 'Product image refs render from the cached Nutrition API response.',
|
|
93
|
+
}, [createImageRefList(idPrefix)]),
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=productDetailScreenBody.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"productDetailScreenBody.js","sourceRoot":"","sources":["../../../../../../src/templates/starter/categories/food-drink/nutrition-catalog-scan/productDetailScreenBody.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAiB,MAAM,oBAAoB,CAAC;AAElF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,KAAK,EAAE,WAAW;IAClB,UAAU,EAAE,UAAU;IACtB,WAAW,EAAE,eAAe;CACU,CAAC;AAEzC,SAAS,qBAAqB,CAAC,IAI9B;IACC,OAAO,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE;QACrC,OAAO,EAAE,IAAI,CAAC,KAAK;QACnB,KAAK,EAAE,IAAI,CAAC,WAAW;QACvB,IAAI,EAAE,SAAS;KAChB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,aAAa,GAAG;IACpB,CAAC,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC;IACnC,CAAC,OAAO,EAAE,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C;YACE,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,mEAAmE;SACjF,EACD,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAC/B;KACF,CAAC;AACJ,CAAC"}
|
package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/scanScreenBody.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanScreenBody.d.ts","sourceRoot":"","sources":["../../../../../../src/templates/starter/categories/food-drink/nutrition-catalog-scan/scanScreenBody.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,CAkBpE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createZoraNode } from '../../../../shared';
|
|
2
|
+
export function createNutritionScanBody(idPrefix) {
|
|
3
|
+
return [
|
|
4
|
+
createZoraNode(`${idPrefix}-scan-scanner`, 'BarcodeScannerView', {
|
|
5
|
+
permissionStatus: 'unknown',
|
|
6
|
+
title: 'Scan product barcode',
|
|
7
|
+
description: 'Point the camera at a barcode to look up or add a product.',
|
|
8
|
+
overlayTitle: 'Align barcode',
|
|
9
|
+
overlayDescription: 'Hold the barcode inside the frame. Scanning starts automatically.',
|
|
10
|
+
cornerLabel: 'EAN',
|
|
11
|
+
requestPermissionLabel: 'Allow camera access',
|
|
12
|
+
manualEntryLabel: 'Enter barcode manually',
|
|
13
|
+
}),
|
|
14
|
+
createZoraNode(`${idPrefix}-scan-lookup-notice`, 'Notice', {
|
|
15
|
+
title: 'Lookup behavior',
|
|
16
|
+
description: 'GET /products/by-barcode/:barcode opens product detail on 200, opens create with a prefilled barcode on 404, and surfaces retry messaging for invalid input or backend unavailability.',
|
|
17
|
+
}),
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=scanScreenBody.js.map
|
package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/scanScreenBody.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanScreenBody.js","sourceRoot":"","sources":["../../../../../../src/templates/starter/categories/food-drink/nutrition-catalog-scan/scanScreenBody.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,oBAAoB,CAAC;AAEnE,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,OAAO;QACL,cAAc,CAAC,GAAG,QAAQ,eAAe,EAAE,oBAAoB,EAAE;YAC/D,gBAAgB,EAAE,SAAS;YAC3B,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EAAE,4DAA4D;YACzE,YAAY,EAAE,eAAe;YAC7B,kBAAkB,EAAE,mEAAmE;YACvF,WAAW,EAAE,KAAK;YAClB,sBAAsB,EAAE,qBAAqB;YAC7C,gBAAgB,EAAE,wBAAwB;SAC3C,CAAC;QACF,cAAc,CAAC,GAAG,QAAQ,qBAAqB,EAAE,QAAQ,EAAE;YACzD,KAAK,EAAE,iBAAiB;YACxB,WAAW,EACT,wLAAwL;SAC3L,CAAC;KACH,CAAC;AACJ,CAAC"}
|
package/dist/templates/starter/categories/food-drink/nutrition-catalog-scan/screens.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screens.d.ts","sourceRoot":"","sources":["../../../../../../src/templates/starter/categories/food-drink/nutrition-catalog-scan/screens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"screens.d.ts","sourceRoot":"","sources":["../../../../../../src/templates/starter/categories/food-drink/nutrition-catalog-scan/screens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAS3D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAI9D,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,6BAA6B,GACvC,WAAW,CAAC,SAAS,CAAC,CA6ExB"}
|