@ankhorage/contracts 6.0.0 → 7.1.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/README.md +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/theme.d.ts +44 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +2 -0
- package/dist/theme.js.map +1 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -6
- package/src/contracts.test.ts +40 -0
- package/src/index.ts +1 -1
- package/src/theme.ts +50 -0
- package/src/types.ts +5 -0
- package/dist/nutrition/capture.d.ts +0 -54
- package/dist/nutrition/capture.d.ts.map +0 -1
- package/dist/nutrition/capture.js +0 -8
- package/dist/nutrition/capture.js.map +0 -1
- package/dist/nutrition/common.d.ts +0 -22
- package/dist/nutrition/common.d.ts.map +0 -1
- package/dist/nutrition/common.js +0 -25
- package/dist/nutrition/common.js.map +0 -1
- package/dist/nutrition/index.d.ts +0 -5
- package/dist/nutrition/index.d.ts.map +0 -1
- package/dist/nutrition/index.js +0 -5
- package/dist/nutrition/index.js.map +0 -1
- package/dist/nutrition/products.d.ts +0 -93
- package/dist/nutrition/products.d.ts.map +0 -1
- package/dist/nutrition/products.js +0 -9
- package/dist/nutrition/products.js.map +0 -1
- package/dist/nutrition/review.d.ts +0 -47
- package/dist/nutrition/review.d.ts.map +0 -1
- package/dist/nutrition/review.js +0 -8
- package/dist/nutrition/review.js.map +0 -1
- package/src/nutrition/capture.ts +0 -80
- package/src/nutrition/common.ts +0 -51
- package/src/nutrition/index.ts +0 -4
- package/src/nutrition/nutrition.test.ts +0 -137
- package/src/nutrition/products.ts +0 -134
- package/src/nutrition/review.ts +0 -65
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ankhorage/contracts
|
|
2
2
|
|
|
3
|
+
## 7.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 97fbc01: Add canonical serializable theme-global token overrides and generic component/pattern recipe override values without duplicating runtime token state or package-owned recipe metadata.
|
|
8
|
+
|
|
9
|
+
## 7.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- 24d3c97: Remove the unused nutrition contracts and the public `@ankhorage/contracts/nutrition` subpath export.
|
|
14
|
+
|
|
3
15
|
## 6.0.0
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# CONTRACTS
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Serializable app, action, theme, auth, and secret-store contracts for Ankhorage.
|
|
9
9
|
|
package/dist/index.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ export * from './bindings';
|
|
|
3
3
|
export * from './cli';
|
|
4
4
|
export * from './data';
|
|
5
5
|
export * from './db';
|
|
6
|
-
export * from './nutrition';
|
|
7
6
|
export * from './requirements';
|
|
8
7
|
export * from './runtimeCallbacks';
|
|
9
8
|
export * from './secretManifest';
|
|
10
9
|
export * from './secrets';
|
|
11
10
|
export * from './state';
|
|
12
11
|
export * from './storage';
|
|
12
|
+
export * from './theme';
|
|
13
13
|
export * from './types';
|
|
14
14
|
export * from './ui';
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,13 +3,13 @@ export * from './bindings';
|
|
|
3
3
|
export * from './cli';
|
|
4
4
|
export * from './data';
|
|
5
5
|
export * from './db';
|
|
6
|
-
export * from './nutrition';
|
|
7
6
|
export * from './requirements';
|
|
8
7
|
export * from './runtimeCallbacks';
|
|
9
8
|
export * from './secretManifest';
|
|
10
9
|
export * from './secrets';
|
|
11
10
|
export * from './state';
|
|
12
11
|
export * from './storage';
|
|
12
|
+
export * from './theme';
|
|
13
13
|
export * from './types';
|
|
14
14
|
export * from './ui';
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC","sourcesContent":["export * from './auth';\nexport * from './bindings';\nexport * from './cli';\nexport * from './data';\nexport * from './db';\nexport * from './requirements';\nexport * from './runtimeCallbacks';\nexport * from './secretManifest';\nexport * from './secrets';\nexport * from './state';\nexport * from './storage';\nexport * from './theme';\nexport * from './types';\nexport * from './ui';\n"]}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Numeric token values authored at theme level. */
|
|
2
|
+
export type ThemeNumericTokenOverrides = Readonly<Record<string, number>>;
|
|
3
|
+
/** String token values authored at theme level. */
|
|
4
|
+
export type ThemeStringTokenOverrides = Readonly<Record<string, string>>;
|
|
5
|
+
/** Partial authored override for one semantic heading recipe. */
|
|
6
|
+
export interface ThemeTypographyHeadingOverrides {
|
|
7
|
+
readonly size?: number;
|
|
8
|
+
readonly lineHeight?: number;
|
|
9
|
+
readonly weight?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Theme-global typography source overrides. Font installation remains module-owned. */
|
|
12
|
+
export interface ThemeTypographyTokenOverrides {
|
|
13
|
+
readonly headings?: Readonly<Record<string, ThemeTypographyHeadingOverrides>>;
|
|
14
|
+
readonly sizes?: ThemeNumericTokenOverrides;
|
|
15
|
+
readonly weights?: ThemeStringTokenOverrides;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Theme-global authored token overrides.
|
|
19
|
+
*
|
|
20
|
+
* Color source remains mode-specific on ThemeModeConfig. These values are shared by
|
|
21
|
+
* light and dark mode and are resolved by the render-theme owner rather than copied
|
|
22
|
+
* into every mode branch.
|
|
23
|
+
*/
|
|
24
|
+
export interface ThemeGlobalTokenOverrides {
|
|
25
|
+
readonly spacing?: ThemeNumericTokenOverrides;
|
|
26
|
+
readonly radii?: ThemeNumericTokenOverrides;
|
|
27
|
+
readonly typography?: ThemeTypographyTokenOverrides;
|
|
28
|
+
readonly shadows?: ThemeNumericTokenOverrides;
|
|
29
|
+
}
|
|
30
|
+
/** Serializable value supported by the current theme-recipe metadata field kinds. */
|
|
31
|
+
export type ThemeRecipeOverrideValue = boolean | string;
|
|
32
|
+
/** Persisted values for one component or pattern recipe. */
|
|
33
|
+
export type ThemeRecipeFieldOverrides = Readonly<Record<string, ThemeRecipeOverrideValue>>;
|
|
34
|
+
/**
|
|
35
|
+
* Generic persisted recipe values.
|
|
36
|
+
*
|
|
37
|
+
* The owning UI package defines available recipes, field schemas, defaults and token
|
|
38
|
+
* relationships. Contracts stores selected values only and does not duplicate that metadata.
|
|
39
|
+
*/
|
|
40
|
+
export interface ThemeRecipeOverrides {
|
|
41
|
+
readonly components?: Readonly<Record<string, ThemeRecipeFieldOverrides>>;
|
|
42
|
+
readonly patterns?: Readonly<Record<string, ThemeRecipeFieldOverrides>>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE1E,mDAAmD;AACnD,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEzE,iEAAiE;AACjE,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wFAAwF;AACxF,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC,CAAC;IAC9E,QAAQ,CAAC,KAAK,CAAC,EAAE,0BAA0B,CAAC;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,yBAAyB,CAAC;CAC9C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,OAAO,CAAC,EAAE,0BAA0B,CAAC;IAC9C,QAAQ,CAAC,KAAK,CAAC,EAAE,0BAA0B,CAAC;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,6BAA6B,CAAC;IACpD,QAAQ,CAAC,OAAO,CAAC,EAAE,0BAA0B,CAAC;CAC/C;AAED,qFAAqF;AACrF,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,MAAM,CAAC;AAExD,4DAA4D;AAC5D,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC;AAE3F;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC;IAC1E,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC;CACzE"}
|
package/dist/theme.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"","sourcesContent":["/** Numeric token values authored at theme level. */\nexport type ThemeNumericTokenOverrides = Readonly<Record<string, number>>;\n\n/** String token values authored at theme level. */\nexport type ThemeStringTokenOverrides = Readonly<Record<string, string>>;\n\n/** Partial authored override for one semantic heading recipe. */\nexport interface ThemeTypographyHeadingOverrides {\n readonly size?: number;\n readonly lineHeight?: number;\n readonly weight?: string;\n}\n\n/** Theme-global typography source overrides. Font installation remains module-owned. */\nexport interface ThemeTypographyTokenOverrides {\n readonly headings?: Readonly<Record<string, ThemeTypographyHeadingOverrides>>;\n readonly sizes?: ThemeNumericTokenOverrides;\n readonly weights?: ThemeStringTokenOverrides;\n}\n\n/**\n * Theme-global authored token overrides.\n *\n * Color source remains mode-specific on ThemeModeConfig. These values are shared by\n * light and dark mode and are resolved by the render-theme owner rather than copied\n * into every mode branch.\n */\nexport interface ThemeGlobalTokenOverrides {\n readonly spacing?: ThemeNumericTokenOverrides;\n readonly radii?: ThemeNumericTokenOverrides;\n readonly typography?: ThemeTypographyTokenOverrides;\n readonly shadows?: ThemeNumericTokenOverrides;\n}\n\n/** Serializable value supported by the current theme-recipe metadata field kinds. */\nexport type ThemeRecipeOverrideValue = boolean | string;\n\n/** Persisted values for one component or pattern recipe. */\nexport type ThemeRecipeFieldOverrides = Readonly<Record<string, ThemeRecipeOverrideValue>>;\n\n/**\n * Generic persisted recipe values.\n *\n * The owning UI package defines available recipes, field schemas, defaults and token\n * relationships. Contracts stores selected values only and does not duplicate that metadata.\n */\nexport interface ThemeRecipeOverrides {\n readonly components?: Readonly<Record<string, ThemeRecipeFieldOverrides>>;\n readonly patterns?: Readonly<Record<string, ThemeRecipeFieldOverrides>>;\n}\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { AuthFlowConfig, AuthIdentifierKind, AuthOAuthConfig, AuthSignUpFie
|
|
|
3
3
|
import type { BindingValueSource, ComponentDataBindingRegistry, ScreenDataLoaderDefinition } from './bindings';
|
|
4
4
|
import type { DataSourceRegistry, GeneratedApiRegistry } from './data';
|
|
5
5
|
import type { ScreenRequirements } from './requirements';
|
|
6
|
+
import type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';
|
|
6
7
|
export interface ThemeModeConfig {
|
|
7
8
|
primaryColor: string;
|
|
8
9
|
harmony: ColorHarmony;
|
|
@@ -12,6 +13,10 @@ export interface ThemeConfig {
|
|
|
12
13
|
name: string;
|
|
13
14
|
light: ThemeModeConfig;
|
|
14
15
|
dark: ThemeModeConfig;
|
|
16
|
+
/** Theme-global authored token overrides shared by light and dark mode. */
|
|
17
|
+
tokens?: ThemeGlobalTokenOverrides;
|
|
18
|
+
/** Component/pattern recipe override values; recipe schemas remain package-owned metadata. */
|
|
19
|
+
recipes?: ThemeRecipeOverrides;
|
|
15
20
|
}
|
|
16
21
|
export type ActionType = 'navigate' | 'alert' | 'console' | 'toggleDarkMode' | 'setLanguage' | 'search' | 'filter';
|
|
17
22
|
export interface NavigateAction {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACnG,OAAO,KAAK,EACV,kBAAkB,EAClB,4BAA4B,EAC5B,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACnG,OAAO,KAAK,EACV,kBAAkB,EAClB,4BAA4B,EAC5B,0BAA0B,EA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OAAO,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAC;AAGxF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAGrD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAG3D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAU,CAAC;AAGrE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAU,CAAU,CAAC;AAIpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAGhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,qBAAqB,CAAU,CAAC;AAGpF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,wBAAwB;IAC3B,WAAW;IACX,UAAU;IACV,aAAa;IACb,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,YAAY,CAAU,CAAC;AAG3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAGjF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC","sourcesContent":["import type { ColorHarmony } from '@ankhorage/color-theory';\n\nimport type { AuthFlowConfig, AuthIdentifierKind, AuthOAuthConfig, AuthSignUpField } from './auth';\nimport type {\n BindingValueSource,\n ComponentDataBindingRegistry,\n ScreenDataLoaderDefinition,\n} from './bindings';\nimport type { DataSourceRegistry, GeneratedApiRegistry } from './data';\nimport type { ScreenRequirements } from './requirements';\n\nexport interface ThemeModeConfig {\n primaryColor: string;\n harmony: ColorHarmony;\n}\n\nexport interface ThemeConfig {\n id: string;\n name: string;\n light: ThemeModeConfig;\n dark: ThemeModeConfig;\n}\n\nexport type ActionType =\n | 'navigate'\n | 'alert'\n | 'console'\n | 'toggleDarkMode'\n | 'setLanguage'\n | 'search'\n | 'filter';\n\nexport interface NavigateAction {\n type: 'navigate';\n payload: {\n route: string;\n params?: Record<string, number | string>;\n };\n}\n\nexport interface AlertAction {\n type: 'alert';\n payload?: {\n message?: string;\n };\n}\n\nexport interface ConsoleAction {\n type: 'console';\n payload?: Record<string, unknown>;\n}\n\nexport interface ToggleDarkModeAction {\n type: 'toggleDarkMode';\n payload?: never;\n}\n\nexport interface SetLanguageAction {\n type: 'setLanguage';\n payload: {\n locale: string;\n };\n}\n\nexport interface SearchAction {\n type: 'search';\n payload: {\n query: string;\n scope?: string;\n };\n}\n\nexport interface FilterAction {\n type: 'filter';\n payload: {\n filterKey: string;\n filterValue: string;\n };\n}\n\nexport type Action =\n | AlertAction\n | ConsoleAction\n | FilterAction\n | NavigateAction\n | SearchAction\n | SetLanguageAction\n | ToggleDarkModeAction;\n\nexport type ManifestValue =\n | string\n | number\n | boolean\n | null\n | readonly ManifestValue[]\n | { readonly [key: string]: ManifestValue };\n\nexport type ComponentEventPayloadValue = ManifestValue;\n\nexport interface ComponentEventDto<\n TType extends string = string,\n TPayload extends object = Record<string, ComponentEventPayloadValue>,\n> {\n readonly type: TType;\n readonly sourceNodeId: string;\n readonly payload: TPayload;\n}\n\nexport type FormSubmitValues = Record<string, ComponentEventPayloadValue>;\n\nexport type FormSubmitEventDto = ComponentEventDto<\n 'form.submit',\n {\n readonly values: FormSubmitValues;\n }\n>;\n\nexport type ButtonPressEventDto = ComponentEventDto<'button.press', Record<string, never>>;\n\nexport interface CollectionItemPressPayload {\n readonly itemId: string | number;\n readonly item: Record<string, ComponentEventPayloadValue>;\n}\n\nexport type CollectionItemPressEventDto = ComponentEventDto<\n 'collection.itemPress',\n CollectionItemPressPayload\n>;\n\nexport type ComponentEventDtoKind =\n | ButtonPressEventDto['type']\n | CollectionItemPressEventDto['type']\n | FormSubmitEventDto['type'];\n\nexport type KnownComponentEventDto =\n | ButtonPressEventDto\n | CollectionItemPressEventDto\n | FormSubmitEventDto;\n\nexport const NAVIGATOR_TYPES = ['stack', 'tabs', 'drawer'] as const;\nexport type NavigatorType = (typeof NAVIGATOR_TYPES)[number];\n\nexport const APP_CATEGORIES = [\n 'books_reading',\n 'business_productivity',\n 'developer_tools',\n 'education_learning',\n 'entertainment_media',\n 'finance_money',\n 'food_drink',\n 'games',\n 'graphics_design',\n 'health_fitness',\n 'kids_family',\n 'lifestyle',\n 'medical',\n 'music_audio',\n 'navigation_travel',\n 'news_magazines',\n 'photo_video',\n 'reference',\n 'shopping_commerce',\n 'social_community',\n 'sports',\n 'utilities_tools',\n 'weather',\n] as const;\nexport type AppCategory = (typeof APP_CATEGORIES)[number];\n\nexport const DEPLOYMENT_TARGETS = ['minikube'] as const;\nexport type KnownDeploymentTarget = (typeof DEPLOYMENT_TARGETS)[number];\nexport type DeploymentTarget = KnownDeploymentTarget | (string & {});\n\nexport const DATABASE_PROVIDERS = ['supabase'] as const;\nexport type KnownDatabaseProvider = (typeof DATABASE_PROVIDERS)[number];\nexport type DatabaseProvider = KnownDatabaseProvider | (string & {});\n\nexport const DATABASE_TIERS = ['dev', 'prod'] as const;\nexport type DatabaseTier = (typeof DATABASE_TIERS)[number];\n\nexport const STORAGE_PROVIDERS = ['auto', 's3', 'r2'] as const;\nexport type StorageProvider = (typeof STORAGE_PROVIDERS)[number];\n\nexport const STATE_PROVIDERS = ['legend'] as const;\nexport type KnownStateProvider = (typeof STATE_PROVIDERS)[number];\nexport type StateProvider = KnownStateProvider | (string & {});\n\nexport const STATE_PERSISTENCE_MODES = ['none', 'local', 'secure', 'database'] as const;\nexport type StatePersistenceMode = (typeof STATE_PERSISTENCE_MODES)[number];\n\nexport const AUTHZ_KINDS = ['RBAC', 'ABAC'] as const;\nexport type AuthzKind = (typeof AUTHZ_KINDS)[number];\n\nexport const AUTHZ_ENGINES = ['cerbos', 'native'] as const;\nexport type AuthzEngine = (typeof AUTHZ_ENGINES)[number];\n\nexport const AUTH_SCOPES = ['global', 'none', 'integrated'] as const;\nexport type AuthScope = (typeof AUTH_SCOPES)[number];\n\nexport const AUTH_PROVIDERS = ['supabase'] as const;\nexport type KnownAuthProvider = (typeof AUTH_PROVIDERS)[number];\nexport type AuthProvider = KnownAuthProvider | (string & {});\n\nexport const AUTH_SIGN_IN_IDENTIFIERS = ['email', 'username', 'phone'] as const;\nexport type AuthSignInIdentifier = AuthIdentifierKind;\n\nexport const AUTH_SIGN_UP_POLICIES = ['autoSignIn', 'requireVerification'] as const;\nexport type AuthSignUpPolicy = (typeof AUTH_SIGN_UP_POLICIES)[number];\n\nexport const AUTH_PROFILE_FIELDS = [\n ...AUTH_SIGN_IN_IDENTIFIERS,\n 'firstName',\n 'lastName',\n 'displayName',\n 'avatarUrl',\n] as const;\nexport type KnownAuthProfileField = (typeof AUTH_PROFILE_FIELDS)[number];\nexport type AuthProfileField = KnownAuthProfileField | (string & {});\n\nexport const AUTH_PROFILE_PRIMARY_KEY_STRATEGIES = ['authUserId'] as const;\nexport type AuthProfilePrimaryKeyStrategy = (typeof AUTH_PROFILE_PRIMARY_KEY_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_CREATE_STRATEGIES = ['trigger', 'api', 'app'] as const;\nexport type AuthProfileCreateStrategy = (typeof AUTH_PROFILE_CREATE_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_UPDATE_STRATEGIES = ['api', 'app'] as const;\nexport type AuthProfileUpdateStrategy = (typeof AUTH_PROFILE_UPDATE_STRATEGIES)[number];\n\nexport interface IconSpec {\n name: string;\n provider?: string;\n size?: number | string;\n color?: string;\n}\n\nexport interface UiNodeRepeatSpec {\n source: BindingValueSource;\n itemAlias?: string;\n keyPath?: string;\n empty?: readonly UiNode[];\n}\n\nexport interface UiNode {\n id: string;\n type: string;\n alias?: string;\n props?: Record<string, unknown>;\n children?: UiNode[];\n style?: Record<string, number | string>;\n repeat?: UiNodeRepeatSpec;\n}\n\nexport interface ScreenSpec {\n id: string;\n name: string;\n title?: string;\n description?: string;\n root: UiNode;\n dataLoaders?: readonly ScreenDataLoaderDefinition[];\n requires?: ScreenRequirements;\n}\n\nexport interface NavigatorSpec {\n type: NavigatorType;\n initialRouteName?: string;\n routes: RouteDefinition[];\n options?: Record<string, unknown>;\n}\n\nexport interface RouteDefinition {\n name: string;\n path?: string;\n label?: string;\n icon?: IconSpec;\n /**\n * Whether this route appears in Tabs and Drawer primary navigation.\n *\n * Omitted routes are visible by default. Setting this to `false` hides the\n * route from primary navigation without making it unnavigable. Stack\n * navigators preserve the value but do not present primary navigation.\n */\n showInPrimaryNavigation?: boolean;\n guards?: string[];\n screenId?: string;\n navigator?: NavigatorSpec;\n}\n\nexport type SplashScreenResizeMode = 'contain' | 'cover' | 'native';\n\nexport interface SplashScreenAssetSpec {\n readonly image?: string;\n readonly imageWidth?: number;\n readonly resizeMode?: SplashScreenResizeMode;\n}\n\nexport interface SplashScreenModeSpec extends SplashScreenAssetSpec {\n readonly backgroundColor?: string;\n}\n\nexport interface SplashScreenSpec extends SplashScreenModeSpec {\n readonly dark?: SplashScreenModeSpec;\n}\n\nexport interface DeploymentSpec {\n target: DeploymentTarget;\n monitoring: boolean;\n}\n\nexport interface DatabaseSpec {\n provider: DatabaseProvider;\n tier: DatabaseTier;\n}\n\nexport interface StorageSpec {\n provider: StorageProvider;\n buckets: string[];\n}\n\nexport interface StateSpec {\n readonly provider: StateProvider;\n readonly persistence?: StatePersistenceMode;\n}\n\nexport interface AuthzSpec {\n kind: AuthzKind;\n engine: AuthzEngine;\n}\n\nexport interface AuthSignInSpec {\n identifiers: AuthSignInIdentifier[];\n}\n\nexport interface AuthSignUpSpec {\n requiredFields: AuthSignUpField[];\n optionalFields?: AuthSignUpField[];\n signUpPolicy?: AuthSignUpPolicy;\n}\n\nexport interface AuthProfileSpec {\n fields: AuthProfileField[];\n table?: string;\n primaryKey?: AuthProfilePrimaryKeyStrategy;\n createStrategy?: AuthProfileCreateStrategy;\n updateStrategy?: AuthProfileUpdateStrategy;\n}\n\nexport interface AuthSpec {\n scope: AuthScope;\n provider: AuthProvider;\n authorization?: AuthzSpec;\n flow?: AuthFlowConfig;\n signIn?: AuthSignInSpec;\n signUp?: AuthSignUpSpec;\n oauth?: AuthOAuthConfig;\n profile?: AuthProfileSpec;\n}\n\nexport interface NetworkingSpec {\n domain?: string;\n cdn: boolean;\n}\n\nexport interface InfraManifest {\n deployment?: DeploymentSpec;\n auth?: AuthSpec;\n database?: DatabaseSpec;\n storage?: StorageSpec;\n state?: StateSpec;\n networking?: NetworkingSpec;\n modules: string[];\n modulesConfig?: Record<string, unknown>;\n}\n\nexport interface AppSettings {\n apiBaseUrl?: string;\n localization: {\n defaultLocale: string;\n locales: string[];\n };\n}\n\nexport interface AppManifest {\n metadata: {\n name: string;\n slug: string;\n version: string;\n category: AppCategory;\n themeId: string;\n created?: string;\n updated?: string;\n };\n themes: ThemeConfig[];\n activeThemeId: string;\n activeThemeMode?: 'dark' | 'light';\n splashScreen?: SplashScreenSpec;\n infra: InfraManifest;\n navigator: NavigatorSpec;\n screens: Record<string, ScreenSpec>;\n generatedApis?: GeneratedApiRegistry;\n dataSources?: DataSourceRegistry;\n dataBindings?: ComponentDataBindingRegistry;\n settings: AppSettings;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAgJA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AAGpE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe;IACf,uBAAuB;IACvB,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,OAAO;IACP,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,kBAAkB;IAClB,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AAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC","sourcesContent":["import type { ColorHarmony } from '@ankhorage/color-theory';\n\nimport type { AuthFlowConfig, AuthIdentifierKind, AuthOAuthConfig, AuthSignUpField } from './auth';\nimport type {\n BindingValueSource,\n ComponentDataBindingRegistry,\n ScreenDataLoaderDefinition,\n} from './bindings';\nimport type { DataSourceRegistry, GeneratedApiRegistry } from './data';\nimport type { ScreenRequirements } from './requirements';\nimport type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';\n\nexport interface ThemeModeConfig {\n primaryColor: string;\n harmony: ColorHarmony;\n}\n\nexport interface ThemeConfig {\n id: string;\n name: string;\n light: ThemeModeConfig;\n dark: ThemeModeConfig;\n /** Theme-global authored token overrides shared by light and dark mode. */\n tokens?: ThemeGlobalTokenOverrides;\n /** Component/pattern recipe override values; recipe schemas remain package-owned metadata. */\n recipes?: ThemeRecipeOverrides;\n}\n\nexport type ActionType =\n | 'navigate'\n | 'alert'\n | 'console'\n | 'toggleDarkMode'\n | 'setLanguage'\n | 'search'\n | 'filter';\n\nexport interface NavigateAction {\n type: 'navigate';\n payload: {\n route: string;\n params?: Record<string, number | string>;\n };\n}\n\nexport interface AlertAction {\n type: 'alert';\n payload?: {\n message?: string;\n };\n}\n\nexport interface ConsoleAction {\n type: 'console';\n payload?: Record<string, unknown>;\n}\n\nexport interface ToggleDarkModeAction {\n type: 'toggleDarkMode';\n payload?: never;\n}\n\nexport interface SetLanguageAction {\n type: 'setLanguage';\n payload: {\n locale: string;\n };\n}\n\nexport interface SearchAction {\n type: 'search';\n payload: {\n query: string;\n scope?: string;\n };\n}\n\nexport interface FilterAction {\n type: 'filter';\n payload: {\n filterKey: string;\n filterValue: string;\n };\n}\n\nexport type Action =\n | AlertAction\n | ConsoleAction\n | FilterAction\n | NavigateAction\n | SearchAction\n | SetLanguageAction\n | ToggleDarkModeAction;\n\nexport type ManifestValue =\n | string\n | number\n | boolean\n | null\n | readonly ManifestValue[]\n | { readonly [key: string]: ManifestValue };\n\nexport type ComponentEventPayloadValue = ManifestValue;\n\nexport interface ComponentEventDto<\n TType extends string = string,\n TPayload extends object = Record<string, ComponentEventPayloadValue>,\n> {\n readonly type: TType;\n readonly sourceNodeId: string;\n readonly payload: TPayload;\n}\n\nexport type FormSubmitValues = Record<string, ComponentEventPayloadValue>;\n\nexport type FormSubmitEventDto = ComponentEventDto<\n 'form.submit',\n {\n readonly values: FormSubmitValues;\n }\n>;\n\nexport type ButtonPressEventDto = ComponentEventDto<'button.press', Record<string, never>>;\n\nexport interface CollectionItemPressPayload {\n readonly itemId: string | number;\n readonly item: Record<string, ComponentEventPayloadValue>;\n}\n\nexport type CollectionItemPressEventDto = ComponentEventDto<\n 'collection.itemPress',\n CollectionItemPressPayload\n>;\n\nexport type ComponentEventDtoKind =\n | ButtonPressEventDto['type']\n | CollectionItemPressEventDto['type']\n | FormSubmitEventDto['type'];\n\nexport type KnownComponentEventDto =\n | ButtonPressEventDto\n | CollectionItemPressEventDto\n | FormSubmitEventDto;\n\nexport const NAVIGATOR_TYPES = ['stack', 'tabs', 'drawer'] as const;\nexport type NavigatorType = (typeof NAVIGATOR_TYPES)[number];\n\nexport const APP_CATEGORIES = [\n 'books_reading',\n 'business_productivity',\n 'developer_tools',\n 'education_learning',\n 'entertainment_media',\n 'finance_money',\n 'food_drink',\n 'games',\n 'graphics_design',\n 'health_fitness',\n 'kids_family',\n 'lifestyle',\n 'medical',\n 'music_audio',\n 'navigation_travel',\n 'news_magazines',\n 'photo_video',\n 'reference',\n 'shopping_commerce',\n 'social_community',\n 'sports',\n 'utilities_tools',\n 'weather',\n] as const;\nexport type AppCategory = (typeof APP_CATEGORIES)[number];\n\nexport const DEPLOYMENT_TARGETS = ['minikube'] as const;\nexport type KnownDeploymentTarget = (typeof DEPLOYMENT_TARGETS)[number];\nexport type DeploymentTarget = KnownDeploymentTarget | (string & {});\n\nexport const DATABASE_PROVIDERS = ['supabase'] as const;\nexport type KnownDatabaseProvider = (typeof DATABASE_PROVIDERS)[number];\nexport type DatabaseProvider = KnownDatabaseProvider | (string & {});\n\nexport const DATABASE_TIERS = ['dev', 'prod'] as const;\nexport type DatabaseTier = (typeof DATABASE_TIERS)[number];\n\nexport const STORAGE_PROVIDERS = ['auto', 's3', 'r2'] as const;\nexport type StorageProvider = (typeof STORAGE_PROVIDERS)[number];\n\nexport const STATE_PROVIDERS = ['legend'] as const;\nexport type KnownStateProvider = (typeof STATE_PROVIDERS)[number];\nexport type StateProvider = KnownStateProvider | (string & {});\n\nexport const STATE_PERSISTENCE_MODES = ['none', 'local', 'secure', 'database'] as const;\nexport type StatePersistenceMode = (typeof STATE_PERSISTENCE_MODES)[number];\n\nexport const AUTHZ_KINDS = ['RBAC', 'ABAC'] as const;\nexport type AuthzKind = (typeof AUTHZ_KINDS)[number];\n\nexport const AUTHZ_ENGINES = ['cerbos', 'native'] as const;\nexport type AuthzEngine = (typeof AUTHZ_ENGINES)[number];\n\nexport const AUTH_SCOPES = ['global', 'none', 'integrated'] as const;\nexport type AuthScope = (typeof AUTH_SCOPES)[number];\n\nexport const AUTH_PROVIDERS = ['supabase'] as const;\nexport type KnownAuthProvider = (typeof AUTH_PROVIDERS)[number];\nexport type AuthProvider = KnownAuthProvider | (string & {});\n\nexport const AUTH_SIGN_IN_IDENTIFIERS = ['email', 'username', 'phone'] as const;\nexport type AuthSignInIdentifier = AuthIdentifierKind;\n\nexport const AUTH_SIGN_UP_POLICIES = ['autoSignIn', 'requireVerification'] as const;\nexport type AuthSignUpPolicy = (typeof AUTH_SIGN_UP_POLICIES)[number];\n\nexport const AUTH_PROFILE_FIELDS = [\n ...AUTH_SIGN_IN_IDENTIFIERS,\n 'firstName',\n 'lastName',\n 'displayName',\n 'avatarUrl',\n] as const;\nexport type KnownAuthProfileField = (typeof AUTH_PROFILE_FIELDS)[number];\nexport type AuthProfileField = KnownAuthProfileField | (string & {});\n\nexport const AUTH_PROFILE_PRIMARY_KEY_STRATEGIES = ['authUserId'] as const;\nexport type AuthProfilePrimaryKeyStrategy = (typeof AUTH_PROFILE_PRIMARY_KEY_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_CREATE_STRATEGIES = ['trigger', 'api', 'app'] as const;\nexport type AuthProfileCreateStrategy = (typeof AUTH_PROFILE_CREATE_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_UPDATE_STRATEGIES = ['api', 'app'] as const;\nexport type AuthProfileUpdateStrategy = (typeof AUTH_PROFILE_UPDATE_STRATEGIES)[number];\n\nexport interface IconSpec {\n name: string;\n provider?: string;\n size?: number | string;\n color?: string;\n}\n\nexport interface UiNodeRepeatSpec {\n source: BindingValueSource;\n itemAlias?: string;\n keyPath?: string;\n empty?: readonly UiNode[];\n}\n\nexport interface UiNode {\n id: string;\n type: string;\n alias?: string;\n props?: Record<string, unknown>;\n children?: UiNode[];\n style?: Record<string, number | string>;\n repeat?: UiNodeRepeatSpec;\n}\n\nexport interface ScreenSpec {\n id: string;\n name: string;\n title?: string;\n description?: string;\n root: UiNode;\n dataLoaders?: readonly ScreenDataLoaderDefinition[];\n requires?: ScreenRequirements;\n}\n\nexport interface NavigatorSpec {\n type: NavigatorType;\n initialRouteName?: string;\n routes: RouteDefinition[];\n options?: Record<string, unknown>;\n}\n\nexport interface RouteDefinition {\n name: string;\n path?: string;\n label?: string;\n icon?: IconSpec;\n /**\n * Whether this route appears in Tabs and Drawer primary navigation.\n *\n * Omitted routes are visible by default. Setting this to `false` hides the\n * route from primary navigation without making it unnavigable. Stack\n * navigators preserve the value but do not present primary navigation.\n */\n showInPrimaryNavigation?: boolean;\n guards?: string[];\n screenId?: string;\n navigator?: NavigatorSpec;\n}\n\nexport type SplashScreenResizeMode = 'contain' | 'cover' | 'native';\n\nexport interface SplashScreenAssetSpec {\n readonly image?: string;\n readonly imageWidth?: number;\n readonly resizeMode?: SplashScreenResizeMode;\n}\n\nexport interface SplashScreenModeSpec extends SplashScreenAssetSpec {\n readonly backgroundColor?: string;\n}\n\nexport interface SplashScreenSpec extends SplashScreenModeSpec {\n readonly dark?: SplashScreenModeSpec;\n}\n\nexport interface DeploymentSpec {\n target: DeploymentTarget;\n monitoring: boolean;\n}\n\nexport interface DatabaseSpec {\n provider: DatabaseProvider;\n tier: DatabaseTier;\n}\n\nexport interface StorageSpec {\n provider: StorageProvider;\n buckets: string[];\n}\n\nexport interface StateSpec {\n readonly provider: StateProvider;\n readonly persistence?: StatePersistenceMode;\n}\n\nexport interface AuthzSpec {\n kind: AuthzKind;\n engine: AuthzEngine;\n}\n\nexport interface AuthSignInSpec {\n identifiers: AuthSignInIdentifier[];\n}\n\nexport interface AuthSignUpSpec {\n requiredFields: AuthSignUpField[];\n optionalFields?: AuthSignUpField[];\n signUpPolicy?: AuthSignUpPolicy;\n}\n\nexport interface AuthProfileSpec {\n fields: AuthProfileField[];\n table?: string;\n primaryKey?: AuthProfilePrimaryKeyStrategy;\n createStrategy?: AuthProfileCreateStrategy;\n updateStrategy?: AuthProfileUpdateStrategy;\n}\n\nexport interface AuthSpec {\n scope: AuthScope;\n provider: AuthProvider;\n authorization?: AuthzSpec;\n flow?: AuthFlowConfig;\n signIn?: AuthSignInSpec;\n signUp?: AuthSignUpSpec;\n oauth?: AuthOAuthConfig;\n profile?: AuthProfileSpec;\n}\n\nexport interface NetworkingSpec {\n domain?: string;\n cdn: boolean;\n}\n\nexport interface InfraManifest {\n deployment?: DeploymentSpec;\n auth?: AuthSpec;\n database?: DatabaseSpec;\n storage?: StorageSpec;\n state?: StateSpec;\n networking?: NetworkingSpec;\n modules: string[];\n modulesConfig?: Record<string, unknown>;\n}\n\nexport interface AppSettings {\n apiBaseUrl?: string;\n localization: {\n defaultLocale: string;\n locales: string[];\n };\n}\n\nexport interface AppManifest {\n metadata: {\n name: string;\n slug: string;\n version: string;\n category: AppCategory;\n themeId: string;\n created?: string;\n updated?: string;\n };\n themes: ThemeConfig[];\n activeThemeId: string;\n activeThemeMode?: 'dark' | 'light';\n splashScreen?: SplashScreenSpec;\n infra: InfraManifest;\n navigator: NavigatorSpec;\n screens: Record<string, ScreenSpec>;\n generatedApis?: GeneratedApiRegistry;\n dataSources?: DataSourceRegistry;\n dataBindings?: ComponentDataBindingRegistry;\n settings: AppSettings;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/contracts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"ankh": {
|
|
6
6
|
"category": "contracts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@ankhorage/devtools": "^1.0.6",
|
|
17
|
-
"@ankhorage/paradox": "^0.1.
|
|
17
|
+
"@ankhorage/paradox": "^0.1.20",
|
|
18
18
|
"@changesets/cli": "^2.30.0",
|
|
19
19
|
"@types/bun": "^1.3.13",
|
|
20
20
|
"@types/node": "^25.2.3",
|
|
@@ -45,10 +45,6 @@
|
|
|
45
45
|
"types": "./dist/db.d.ts",
|
|
46
46
|
"default": "./dist/db.js"
|
|
47
47
|
},
|
|
48
|
-
"./nutrition": {
|
|
49
|
-
"types": "./dist/nutrition/index.d.ts",
|
|
50
|
-
"default": "./dist/nutrition/index.js"
|
|
51
|
-
},
|
|
52
48
|
"./runtime": {
|
|
53
49
|
"types": "./dist/runtimeCallbacks.d.ts",
|
|
54
50
|
"default": "./dist/runtimeCallbacks.js"
|
package/src/contracts.test.ts
CHANGED
|
@@ -156,6 +156,46 @@ describe('contracts', () => {
|
|
|
156
156
|
expect(theme.light.harmony).toBe('analogous');
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
+
it('serializes authored global theme tokens and recipe override values', () => {
|
|
160
|
+
const theme: ThemeConfig = {
|
|
161
|
+
id: 'theme-default',
|
|
162
|
+
name: 'Default',
|
|
163
|
+
light: {
|
|
164
|
+
primaryColor: '#3366ff',
|
|
165
|
+
harmony: 'analogous',
|
|
166
|
+
},
|
|
167
|
+
dark: {
|
|
168
|
+
primaryColor: '#7799ff',
|
|
169
|
+
harmony: 'analogous',
|
|
170
|
+
},
|
|
171
|
+
tokens: {
|
|
172
|
+
spacing: { m: 18, l: 28 },
|
|
173
|
+
radii: { m: 10, l: 18 },
|
|
174
|
+
typography: {
|
|
175
|
+
sizes: { body: 16, lead: 20 },
|
|
176
|
+
weights: { body: '400', strong: '700' },
|
|
177
|
+
headings: {
|
|
178
|
+
h1: { size: 34, lineHeight: 42, weight: '700' },
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
shadows: { soft: 3 },
|
|
182
|
+
},
|
|
183
|
+
recipes: {
|
|
184
|
+
components: {
|
|
185
|
+
Card: { compact: true, padding: 'l', radius: 'm', tone: 'subtle' },
|
|
186
|
+
},
|
|
187
|
+
patterns: {
|
|
188
|
+
Panel: { compact: false, padding: 'xl' },
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
expect(JSON.parse(JSON.stringify(theme))).toEqual(theme);
|
|
194
|
+
expect(theme.tokens?.spacing?.m).toBe(18);
|
|
195
|
+
expect(theme.recipes?.components?.Card?.compact).toBe(true);
|
|
196
|
+
expect(theme.recipes?.patterns?.Panel?.padding).toBe('xl');
|
|
197
|
+
});
|
|
198
|
+
|
|
159
199
|
it('accepts serializable splash screen branding on app manifests', () => {
|
|
160
200
|
const splashScreen: SplashScreenSpec = {
|
|
161
201
|
backgroundColor: '#ffffff',
|
package/src/index.ts
CHANGED
|
@@ -3,12 +3,12 @@ export * from './bindings';
|
|
|
3
3
|
export * from './cli';
|
|
4
4
|
export * from './data';
|
|
5
5
|
export * from './db';
|
|
6
|
-
export * from './nutrition';
|
|
7
6
|
export * from './requirements';
|
|
8
7
|
export * from './runtimeCallbacks';
|
|
9
8
|
export * from './secretManifest';
|
|
10
9
|
export * from './secrets';
|
|
11
10
|
export * from './state';
|
|
12
11
|
export * from './storage';
|
|
12
|
+
export * from './theme';
|
|
13
13
|
export * from './types';
|
|
14
14
|
export * from './ui';
|
package/src/theme.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Numeric token values authored at theme level. */
|
|
2
|
+
export type ThemeNumericTokenOverrides = Readonly<Record<string, number>>;
|
|
3
|
+
|
|
4
|
+
/** String token values authored at theme level. */
|
|
5
|
+
export type ThemeStringTokenOverrides = Readonly<Record<string, string>>;
|
|
6
|
+
|
|
7
|
+
/** Partial authored override for one semantic heading recipe. */
|
|
8
|
+
export interface ThemeTypographyHeadingOverrides {
|
|
9
|
+
readonly size?: number;
|
|
10
|
+
readonly lineHeight?: number;
|
|
11
|
+
readonly weight?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Theme-global typography source overrides. Font installation remains module-owned. */
|
|
15
|
+
export interface ThemeTypographyTokenOverrides {
|
|
16
|
+
readonly headings?: Readonly<Record<string, ThemeTypographyHeadingOverrides>>;
|
|
17
|
+
readonly sizes?: ThemeNumericTokenOverrides;
|
|
18
|
+
readonly weights?: ThemeStringTokenOverrides;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Theme-global authored token overrides.
|
|
23
|
+
*
|
|
24
|
+
* Color source remains mode-specific on ThemeModeConfig. These values are shared by
|
|
25
|
+
* light and dark mode and are resolved by the render-theme owner rather than copied
|
|
26
|
+
* into every mode branch.
|
|
27
|
+
*/
|
|
28
|
+
export interface ThemeGlobalTokenOverrides {
|
|
29
|
+
readonly spacing?: ThemeNumericTokenOverrides;
|
|
30
|
+
readonly radii?: ThemeNumericTokenOverrides;
|
|
31
|
+
readonly typography?: ThemeTypographyTokenOverrides;
|
|
32
|
+
readonly shadows?: ThemeNumericTokenOverrides;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Serializable value supported by the current theme-recipe metadata field kinds. */
|
|
36
|
+
export type ThemeRecipeOverrideValue = boolean | string;
|
|
37
|
+
|
|
38
|
+
/** Persisted values for one component or pattern recipe. */
|
|
39
|
+
export type ThemeRecipeFieldOverrides = Readonly<Record<string, ThemeRecipeOverrideValue>>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Generic persisted recipe values.
|
|
43
|
+
*
|
|
44
|
+
* The owning UI package defines available recipes, field schemas, defaults and token
|
|
45
|
+
* relationships. Contracts stores selected values only and does not duplicate that metadata.
|
|
46
|
+
*/
|
|
47
|
+
export interface ThemeRecipeOverrides {
|
|
48
|
+
readonly components?: Readonly<Record<string, ThemeRecipeFieldOverrides>>;
|
|
49
|
+
readonly patterns?: Readonly<Record<string, ThemeRecipeFieldOverrides>>;
|
|
50
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
} from './bindings';
|
|
9
9
|
import type { DataSourceRegistry, GeneratedApiRegistry } from './data';
|
|
10
10
|
import type { ScreenRequirements } from './requirements';
|
|
11
|
+
import type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';
|
|
11
12
|
|
|
12
13
|
export interface ThemeModeConfig {
|
|
13
14
|
primaryColor: string;
|
|
@@ -19,6 +20,10 @@ export interface ThemeConfig {
|
|
|
19
20
|
name: string;
|
|
20
21
|
light: ThemeModeConfig;
|
|
21
22
|
dark: ThemeModeConfig;
|
|
23
|
+
/** Theme-global authored token overrides shared by light and dark mode. */
|
|
24
|
+
tokens?: ThemeGlobalTokenOverrides;
|
|
25
|
+
/** Component/pattern recipe override values; recipe schemas remain package-owned metadata. */
|
|
26
|
+
recipes?: ThemeRecipeOverrides;
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
export type ActionType =
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { NutritionBarcode, NutritionCaptureSubmissionId, NutritionIsoDateTime, NutritionJsonValue, NutritionProductId, NutritionUserId } from './common';
|
|
2
|
-
import type { NutritionFactsPer100g, NutritionImageEvidence, NutritionIngredientStatement, NutritionServing, NutritionStoreObservation } from './products';
|
|
3
|
-
export declare const NUTRITION_CAPTURE_SUBMISSION_STATUSES: readonly ["queued", "needs_more_data", "accepted", "rejected", "merged"];
|
|
4
|
-
export type NutritionCaptureSubmissionStatus = (typeof NUTRITION_CAPTURE_SUBMISSION_STATUSES)[number];
|
|
5
|
-
export interface NutritionCaptureClientContext {
|
|
6
|
-
readonly userId?: NutritionUserId;
|
|
7
|
-
readonly anonymousDeviceId?: string;
|
|
8
|
-
readonly platform?: 'android' | 'ios' | 'web' | (string & {});
|
|
9
|
-
readonly appVersion?: string;
|
|
10
|
-
readonly locale?: string;
|
|
11
|
-
readonly clientCapturedAt?: NutritionIsoDateTime;
|
|
12
|
-
}
|
|
13
|
-
export interface NutritionProductCaptureDraft {
|
|
14
|
-
readonly barcode: NutritionBarcode;
|
|
15
|
-
readonly name?: string;
|
|
16
|
-
readonly brand?: string;
|
|
17
|
-
readonly quantity?: string;
|
|
18
|
-
readonly packageSizeG?: number;
|
|
19
|
-
readonly packageSizeMl?: number;
|
|
20
|
-
readonly serving?: NutritionServing;
|
|
21
|
-
readonly nutrientsPer100g?: NutritionFactsPer100g;
|
|
22
|
-
readonly ingredients?: NutritionIngredientStatement;
|
|
23
|
-
readonly storeObservation?: NutritionStoreObservation;
|
|
24
|
-
readonly images?: readonly NutritionImageEvidence[];
|
|
25
|
-
readonly rawPayload?: NutritionJsonValue;
|
|
26
|
-
}
|
|
27
|
-
export interface NutritionProductCaptureRequest {
|
|
28
|
-
readonly draft: NutritionProductCaptureDraft;
|
|
29
|
-
readonly client?: NutritionCaptureClientContext;
|
|
30
|
-
}
|
|
31
|
-
export interface NutritionProductCaptureResponse {
|
|
32
|
-
readonly submissionId: NutritionCaptureSubmissionId;
|
|
33
|
-
readonly status: NutritionCaptureSubmissionStatus;
|
|
34
|
-
readonly productId?: NutritionProductId;
|
|
35
|
-
readonly message?: string;
|
|
36
|
-
}
|
|
37
|
-
export interface NutritionProductCorrectionRequest {
|
|
38
|
-
readonly productId: NutritionProductId;
|
|
39
|
-
readonly patch: Partial<NutritionProductCaptureDraft>;
|
|
40
|
-
readonly client?: NutritionCaptureClientContext;
|
|
41
|
-
readonly note?: string;
|
|
42
|
-
}
|
|
43
|
-
export interface NutritionCaptureSubmission {
|
|
44
|
-
readonly id: NutritionCaptureSubmissionId;
|
|
45
|
-
readonly status: NutritionCaptureSubmissionStatus;
|
|
46
|
-
readonly draft: NutritionProductCaptureDraft;
|
|
47
|
-
readonly client?: NutritionCaptureClientContext;
|
|
48
|
-
readonly matchedProductId?: NutritionProductId | null;
|
|
49
|
-
readonly reviewerNote?: string;
|
|
50
|
-
readonly createdAt: NutritionIsoDateTime;
|
|
51
|
-
readonly updatedAt: NutritionIsoDateTime;
|
|
52
|
-
readonly decidedAt?: NutritionIsoDateTime | null;
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/nutrition/capture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,4BAA4B,EAC5B,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,qCAAqC,0EAMxC,CAAC;AACX,MAAM,MAAM,gCAAgC,GAC1C,CAAC,OAAO,qCAAqC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,CA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C;IAChD,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,4BAA4B,CAAC,CAAC;IACtD,QAAQ,CAAC,MAAM,CAAC,EAAE,6BAA6B,CAAC;IAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,EAAE,4BAA4B,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,gCAAgC,CAAC;IAClD,QAAQ,CAAC,KAAK,EAAE,4BAA4B,CAAC;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,6BAA6B,CAAC;IAChD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACtD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CAClD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../../src/nutrition/capture.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,MAAM,qCAAqC,GAAG;IACnD,QAAQ;IACR,iBAAiB;IACjB,UAAU;IACV,UAAU;IACV,QAAQ;CACA,CAAC","sourcesContent":["import type {\n NutritionBarcode,\n NutritionCaptureSubmissionId,\n NutritionIsoDateTime,\n NutritionJsonValue,\n NutritionProductId,\n NutritionUserId,\n} from './common';\nimport type {\n NutritionFactsPer100g,\n NutritionImageEvidence,\n NutritionIngredientStatement,\n NutritionServing,\n NutritionStoreObservation,\n} from './products';\n\nexport const NUTRITION_CAPTURE_SUBMISSION_STATUSES = [\n 'queued',\n 'needs_more_data',\n 'accepted',\n 'rejected',\n 'merged',\n] as const;\nexport type NutritionCaptureSubmissionStatus =\n (typeof NUTRITION_CAPTURE_SUBMISSION_STATUSES)[number];\n\nexport interface NutritionCaptureClientContext {\n readonly userId?: NutritionUserId;\n readonly anonymousDeviceId?: string;\n readonly platform?: 'android' | 'ios' | 'web' | (string & {});\n readonly appVersion?: string;\n readonly locale?: string;\n readonly clientCapturedAt?: NutritionIsoDateTime;\n}\n\nexport interface NutritionProductCaptureDraft {\n readonly barcode: NutritionBarcode;\n readonly name?: string;\n readonly brand?: string;\n readonly quantity?: string;\n readonly packageSizeG?: number;\n readonly packageSizeMl?: number;\n readonly serving?: NutritionServing;\n readonly nutrientsPer100g?: NutritionFactsPer100g;\n readonly ingredients?: NutritionIngredientStatement;\n readonly storeObservation?: NutritionStoreObservation;\n readonly images?: readonly NutritionImageEvidence[];\n readonly rawPayload?: NutritionJsonValue;\n}\n\nexport interface NutritionProductCaptureRequest {\n readonly draft: NutritionProductCaptureDraft;\n readonly client?: NutritionCaptureClientContext;\n}\n\nexport interface NutritionProductCaptureResponse {\n readonly submissionId: NutritionCaptureSubmissionId;\n readonly status: NutritionCaptureSubmissionStatus;\n readonly productId?: NutritionProductId;\n readonly message?: string;\n}\n\nexport interface NutritionProductCorrectionRequest {\n readonly productId: NutritionProductId;\n readonly patch: Partial<NutritionProductCaptureDraft>;\n readonly client?: NutritionCaptureClientContext;\n readonly note?: string;\n}\n\nexport interface NutritionCaptureSubmission {\n readonly id: NutritionCaptureSubmissionId;\n readonly status: NutritionCaptureSubmissionStatus;\n readonly draft: NutritionProductCaptureDraft;\n readonly client?: NutritionCaptureClientContext;\n readonly matchedProductId?: NutritionProductId | null;\n readonly reviewerNote?: string;\n readonly createdAt: NutritionIsoDateTime;\n readonly updatedAt: NutritionIsoDateTime;\n readonly decidedAt?: NutritionIsoDateTime | null;\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type NutritionIsoDateTime = string;
|
|
2
|
-
export type NutritionProductId = string;
|
|
3
|
-
export type NutritionCaptureSubmissionId = string;
|
|
4
|
-
export type NutritionReviewId = string;
|
|
5
|
-
export type NutritionUserId = string;
|
|
6
|
-
export type NutritionJsonValue = boolean | number | string | null | readonly NutritionJsonValue[] | {
|
|
7
|
-
readonly [key: string]: NutritionJsonValue;
|
|
8
|
-
};
|
|
9
|
-
export declare const NUTRITION_BARCODE_TYPES: readonly ["ean_8", "ean_13", "upc_a", "upc_e", "gtin_14", "unknown"];
|
|
10
|
-
export type NutritionBarcodeType = (typeof NUTRITION_BARCODE_TYPES)[number];
|
|
11
|
-
export interface NutritionBarcode {
|
|
12
|
-
readonly value: string;
|
|
13
|
-
readonly type: NutritionBarcodeType;
|
|
14
|
-
readonly normalizedValue?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare const NUTRITION_PRODUCT_STATUSES: readonly ["draft", "pending_review", "published", "rejected", "archived"];
|
|
17
|
-
export type NutritionProductStatus = (typeof NUTRITION_PRODUCT_STATUSES)[number];
|
|
18
|
-
export declare const NUTRITION_DATA_SOURCES: readonly ["manual_scan", "user_correction", "open_food_facts", "foodrepo_legacy", "retailer_import", "admin_import"];
|
|
19
|
-
export type NutritionDataSource = (typeof NUTRITION_DATA_SOURCES)[number];
|
|
20
|
-
export declare const NUTRITION_SOURCE_CONFIDENCE_LEVELS: readonly ["unknown", "low", "medium", "high"];
|
|
21
|
-
export type NutritionSourceConfidence = (typeof NUTRITION_SOURCE_CONFIDENCE_LEVELS)[number];
|
|
22
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/nutrition/common.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAC1C,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACxC,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAAC;AAClD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACvC,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC,MAAM,MAAM,kBAAkB,GAC1B,OAAO,GACP,MAAM,GACN,MAAM,GACN,IAAI,GACJ,SAAS,kBAAkB,EAAE,GAC7B;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAAA;CAAE,CAAC;AAEnD,eAAO,MAAM,uBAAuB,sEAO1B,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,eAAO,MAAM,0BAA0B,2EAM7B,CAAC;AACX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjF,eAAO,MAAM,sBAAsB,sHAOzB,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,eAAO,MAAM,kCAAkC,+CAAgD,CAAC;AAChG,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,kCAAkC,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/nutrition/common.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export const NUTRITION_BARCODE_TYPES = [
|
|
2
|
-
'ean_8',
|
|
3
|
-
'ean_13',
|
|
4
|
-
'upc_a',
|
|
5
|
-
'upc_e',
|
|
6
|
-
'gtin_14',
|
|
7
|
-
'unknown',
|
|
8
|
-
];
|
|
9
|
-
export const NUTRITION_PRODUCT_STATUSES = [
|
|
10
|
-
'draft',
|
|
11
|
-
'pending_review',
|
|
12
|
-
'published',
|
|
13
|
-
'rejected',
|
|
14
|
-
'archived',
|
|
15
|
-
];
|
|
16
|
-
export const NUTRITION_DATA_SOURCES = [
|
|
17
|
-
'manual_scan',
|
|
18
|
-
'user_correction',
|
|
19
|
-
'open_food_facts',
|
|
20
|
-
'foodrepo_legacy',
|
|
21
|
-
'retailer_import',
|
|
22
|
-
'admin_import',
|
|
23
|
-
];
|
|
24
|
-
export const NUTRITION_SOURCE_CONFIDENCE_LEVELS = ['unknown', 'low', 'medium', 'high'];
|
|
25
|
-
//# sourceMappingURL=common.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/nutrition/common.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,OAAO;IACP,QAAQ;IACR,OAAO;IACP,OAAO;IACP,SAAS;IACT,SAAS;CACD,CAAC;AASX,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,OAAO;IACP,gBAAgB;IAChB,WAAW;IACX,UAAU;IACV,UAAU;CACF,CAAC;AAGX,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,aAAa;IACb,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;CACN,CAAC;AAGX,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC","sourcesContent":["export type NutritionIsoDateTime = string;\nexport type NutritionProductId = string;\nexport type NutritionCaptureSubmissionId = string;\nexport type NutritionReviewId = string;\nexport type NutritionUserId = string;\n\nexport type NutritionJsonValue =\n | boolean\n | number\n | string\n | null\n | readonly NutritionJsonValue[]\n | { readonly [key: string]: NutritionJsonValue };\n\nexport const NUTRITION_BARCODE_TYPES = [\n 'ean_8',\n 'ean_13',\n 'upc_a',\n 'upc_e',\n 'gtin_14',\n 'unknown',\n] as const;\nexport type NutritionBarcodeType = (typeof NUTRITION_BARCODE_TYPES)[number];\n\nexport interface NutritionBarcode {\n readonly value: string;\n readonly type: NutritionBarcodeType;\n readonly normalizedValue?: string;\n}\n\nexport const NUTRITION_PRODUCT_STATUSES = [\n 'draft',\n 'pending_review',\n 'published',\n 'rejected',\n 'archived',\n] as const;\nexport type NutritionProductStatus = (typeof NUTRITION_PRODUCT_STATUSES)[number];\n\nexport const NUTRITION_DATA_SOURCES = [\n 'manual_scan',\n 'user_correction',\n 'open_food_facts',\n 'foodrepo_legacy',\n 'retailer_import',\n 'admin_import',\n] as const;\nexport type NutritionDataSource = (typeof NUTRITION_DATA_SOURCES)[number];\n\nexport const NUTRITION_SOURCE_CONFIDENCE_LEVELS = ['unknown', 'low', 'medium', 'high'] as const;\nexport type NutritionSourceConfidence = (typeof NUTRITION_SOURCE_CONFIDENCE_LEVELS)[number];\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nutrition/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
package/dist/nutrition/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nutrition/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC","sourcesContent":["export * from './capture';\nexport * from './common';\nexport * from './products';\nexport * from './review';\n"]}
|