@wix/himalaya-cli 0.1318.0 → 0.1319.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/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +2 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/theme/src/index.d.ts +21 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview-page/src/capabilities.generated.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/brand-color-math.d.ts +98 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +9 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core/brand-color-math.mjs +183 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/theme.mjs +189 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +8 -0
- package/dist/cli.mjs +473 -372
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/app-config.md +1 -1
- package/guides/importable-sdks.md +1 -0
- package/guides/sdk-reference.json +39 -2
- package/guides/web-page-sdk-reference.md +1 -0
- package/package.json +2 -2
- package/templates/beauty-salon-owner/config.ts +1 -1
- package/templates/beauty-salon-owner/dev/index.ts +125 -24
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-attachments.ts +41 -2
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +59 -31
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-aria/index.ts +154 -13
- package/templates/community-club-owner/config.ts +1 -1
- package/templates/community-club-owner/dev/index.ts +125 -24
- package/templates/community-club-owner/tier5-src/_shared/aria-attachments.ts +41 -2
- package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +59 -31
- package/templates/community-club-owner/tier5-src/himi-owner-lite-aria/index.ts +154 -13
- package/templates/events-meetups-owner/config.ts +1 -1
- package/templates/events-meetups-owner/dev/index.ts +125 -24
- package/templates/events-meetups-owner/tier5-src/_shared/aria-attachments.ts +41 -2
- package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +59 -31
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-aria/index.ts +154 -13
- package/templates/gym-fitness-owner/config.ts +1 -1
- package/templates/gym-fitness-owner/dev/index.ts +125 -24
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-attachments.ts +41 -2
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +59 -31
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-aria/index.ts +154 -13
- package/templates/nonprofit-cause-owner/config.ts +1 -1
- package/templates/nonprofit-cause-owner/dev/index.ts +125 -24
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-attachments.ts +41 -2
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +59 -31
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-aria/index.ts +154 -13
- package/templates/owner-lite/config.ts +1 -1
- package/templates/owner-lite/dev/index.ts +125 -24
- package/templates/owner-lite/tier5-src/_shared/aria-attachments.ts +41 -2
- package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +59 -31
- package/templates/owner-lite/tier5-src/himi-owner-lite-aria/index.ts +154 -13
- package/templates/podcast-creator-owner/config.ts +1 -1
- package/templates/podcast-creator-owner/dev/index.ts +125 -24
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-attachments.ts +41 -2
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +59 -31
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-aria/index.ts +154 -13
- package/templates/portfolio-creative-owner/config.ts +1 -1
- package/templates/portfolio-creative-owner/dev/index.ts +125 -24
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-attachments.ts +41 -2
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +59 -31
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-aria/index.ts +154 -13
- package/templates/restaurant-owner/config.ts +1 -1
- package/templates/restaurant-owner/dev/index.ts +125 -24
- package/templates/restaurant-owner/tier5-src/_shared/aria-attachments.ts +41 -2
- package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +59 -31
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-aria/index.ts +154 -13
- package/templates/retail-store-owner/config.ts +1 -1
- package/templates/retail-store-owner/dev/index.ts +125 -24
- package/templates/retail-store-owner/tier5-src/_shared/aria-attachments.ts +41 -2
- package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +59 -31
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-aria/index.ts +154 -13
- package/templates/yoga-studio-owner/config.ts +1 -1
- package/templates/yoga-studio-owner/dev/index.ts +125 -24
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-attachments.ts +41 -2
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +59 -31
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-aria/index.ts +154 -13
|
@@ -36,11 +36,12 @@ export declare const CAPABILITY_REGISTRY: {
|
|
|
36
36
|
readonly speech: readonly ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"];
|
|
37
37
|
readonly system_intents: readonly ["donate", "refreshShortcuts"];
|
|
38
38
|
readonly tasks: readonly ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"];
|
|
39
|
+
readonly theme: readonly ["applyOverlay", "clearOverlay", "surfaces"];
|
|
39
40
|
readonly ui: readonly ["alert", "snackbar"];
|
|
40
41
|
readonly wix_cashier: readonly ["isAvailable", "proceedToPayment"];
|
|
41
42
|
};
|
|
42
43
|
/** A capability id backed by an @himalaya/* SDK binding. */
|
|
43
|
-
export type SdkCapability = "app_info" | "audio_record" | "base44" | "biometrics" | "browser_auth" | "calendar" | "calls" | "camera" | "clipboard" | "contacts" | "file_picker" | "files" | "godot" | "haptic" | "health" | "himi_apps" | "iap" | "keyboard" | "live_activity" | "local_database" | "location" | "media_playback" | "motion" | "on_device_ai" | "open_url" | "pdf" | "photos" | "presigned_upload" | "push" | "release_control" | "secure_storage" | "share" | "speaker_diarization" | "speech" | "system_intents" | "tasks" | "ui" | "wix_cashier";
|
|
44
|
+
export type SdkCapability = "app_info" | "audio_record" | "base44" | "biometrics" | "browser_auth" | "calendar" | "calls" | "camera" | "clipboard" | "contacts" | "file_picker" | "files" | "godot" | "haptic" | "health" | "himi_apps" | "iap" | "keyboard" | "live_activity" | "local_database" | "location" | "media_playback" | "motion" | "on_device_ai" | "open_url" | "pdf" | "photos" | "presigned_upload" | "push" | "release_control" | "secure_storage" | "share" | "speaker_diarization" | "speech" | "system_intents" | "tasks" | "theme" | "ui" | "wix_cashier";
|
|
44
45
|
/** All `capability.<id>.<verb>` action ids, flattened (the worker-bridge wire vocabulary). */
|
|
45
46
|
export declare const CAPABILITY_ACTION_IDS: readonly string[];
|
|
46
47
|
/** Capability id → the @himalaya/* package(s) a worker imports to reach it — every dispatch
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/theme/src/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface RuntimeBrand {
|
|
2
|
+
/** #RRGGBB */
|
|
3
|
+
primaryColor: string;
|
|
4
|
+
/** #RRGGBB; absent ⇒ derived, as at build time. */
|
|
5
|
+
secondaryColor?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ApplyBrandResult {
|
|
8
|
+
applied: boolean;
|
|
9
|
+
/** Why it was not applied: `invalid_color`, `stale_scope`, a native rejection reason. */
|
|
10
|
+
reason?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Brand the shell with [brand]: the five accent tokens on every scheme, and the accent glow when
|
|
14
|
+
* the app's tokens have one. Idempotent; the last call wins. Rejects nothing by throwing: a bad
|
|
15
|
+
* colour or a refused write answers `{ applied: false, reason }`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function applyBrand(brand: RuntimeBrand): Promise<ApplyBrandResult>;
|
|
18
|
+
/** Drop the runtime brand: the app's registered tokens paint again. */
|
|
19
|
+
export declare function clearBrand(): Promise<void>;
|
|
20
|
+
/** Capability version, for bundles that gate on min binary version. */
|
|
21
|
+
export declare const version = 1;
|
|
@@ -34,6 +34,7 @@ import type * as SpeakerDiarizationSdk from "@wix/himalaya/speaker-diarization";
|
|
|
34
34
|
import type * as SpeechSdk from "@wix/himalaya/speech";
|
|
35
35
|
import type * as SystemIntentsSdk from "@wix/himalaya/system-intents";
|
|
36
36
|
import type * as TasksSdk from "@wix/himalaya/tasks";
|
|
37
|
+
import type * as ThemeSdk from "@wix/himalaya/theme";
|
|
37
38
|
import type * as UiSdk from "@wix/himalaya/ui";
|
|
38
39
|
import type * as WixCashierSdk from "@wix/himalaya/wix-cashier";
|
|
39
40
|
type PageModule<T> = {
|
|
@@ -79,6 +80,7 @@ export interface HimalayaPageCapabilities {
|
|
|
79
80
|
readonly "speech": PageModule<typeof SpeechSdk>;
|
|
80
81
|
readonly "system_intents": PageModule<typeof SystemIntentsSdk>;
|
|
81
82
|
readonly "tasks": PageModule<typeof TasksSdk>;
|
|
83
|
+
readonly "theme": PageModule<typeof ThemeSdk>;
|
|
82
84
|
readonly "ui": PageModule<typeof UiSdk>;
|
|
83
85
|
readonly "wix_cashier": PageModule<typeof WixCashierSdk>;
|
|
84
86
|
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/** `color` over `background` at `colorWeight` (1 = the colour, 0 = the background). */
|
|
2
|
+
export declare function mix(color: string, background: string, colorWeight: number): string;
|
|
3
|
+
export declare function relativeLuminance(color: string): number;
|
|
4
|
+
/** WCAG contrast ratio between two hexes (order-independent). */
|
|
5
|
+
export declare function contrastRatio(a: string, b: string): number;
|
|
6
|
+
/** CIE L* (perceptual lightness, 0–100) of a hex color. */
|
|
7
|
+
export declare function lstar(color: string): number;
|
|
8
|
+
/** The LIGHT-arm tint weight. Named rather than inlined because two producers use it — the
|
|
9
|
+
* engine below and `site analyze`'s tokens overlay — and they must not drift. */
|
|
10
|
+
export declare const ACCENT_SURFACE_LIGHT_WEIGHT = 0.12;
|
|
11
|
+
/** A tinted container background for `accent` on `surface`. */
|
|
12
|
+
export declare function deriveAccentSurface(accent: string, surface: string, weight: number): string;
|
|
13
|
+
/** The second accent for a brand that supplies only one: a shade of the primary.
|
|
14
|
+
*
|
|
15
|
+
* DARKER, which is what a second arm of a brand looks like for the overwhelming majority of
|
|
16
|
+
* accents. A brand that is ALREADY near-black is the exception — shading it further yields
|
|
17
|
+
* black, which is neither the brand nor distinguishable from the primary — so those step
|
|
18
|
+
* toward white by the same weight instead. Either way the result is derived from the
|
|
19
|
+
* customer's own accent and can never be a template hex. */
|
|
20
|
+
export declare function deriveSecondaryAccent(primary: string): string;
|
|
21
|
+
export declare const ACCENT_TEXT_MIN_CONTRAST = 4.5;
|
|
22
|
+
/** The text arm of `accent` on `surfaces`: `accent` itself when it already clears
|
|
23
|
+
* {@link ACCENT_TEXT_MIN_CONTRAST} on EVERY one of them, else the smallest same-hue step toward
|
|
24
|
+
* whichever pole (black or white) gives the worst surface the most contrast — measured on the
|
|
25
|
+
* ROUNDED hex, so the token that is returned, not an unrounded intermediate, is what passes.
|
|
26
|
+
*
|
|
27
|
+
* `surfaces` is the page first, then the other NEUTRAL surfaces a transparent label can sit on in
|
|
28
|
+
* that scheme ({@link TEXT_BACKDROP_TOKENS}) — a non-filled Button has no background of
|
|
29
|
+
* its own, so a card is as much its backdrop as the page. `accentSurface` is deliberately not one
|
|
30
|
+
* of them: it is itself derived FROM the accent, so a tint close to the label can make any target
|
|
31
|
+
* unreachable, and chasing it would move the brand to satisfy its own shadow. When no step clears
|
|
32
|
+
* every surface (a light page with a dark card), the page-only arm is returned. */
|
|
33
|
+
export declare function deriveAccentText(accent: string, surfaces: string | readonly string[]): string;
|
|
34
|
+
/** Per scheme, the NEUTRAL surfaces besides the page that a transparent label may sit on —
|
|
35
|
+
* every {@link TEXT_BACKDROP_TOKENS} entry the tokens define. See {@link deriveAccentText}. */
|
|
36
|
+
export type TextSurfaces = Partial<Record<"light" | "dark" | "highContrast", readonly string[]>>;
|
|
37
|
+
/** The neutral non-page surfaces {@link deriveAccentText} also judges a label against. */
|
|
38
|
+
export declare const TEXT_BACKDROP_TOKENS: readonly ["surfaceSecondary", "surfaceElevated", "surfaceSubtle", "surfaceTertiary"];
|
|
39
|
+
/** {@link TextSurfaces} read off a (merged) `colors` palette: each of
|
|
40
|
+
* {@link TEXT_BACKDROP_TOKENS} the palette DEFINES, per arm — a bare string paints every arm,
|
|
41
|
+
* and an object's missing arm is answered by its light arm, the resolution `createBrandTokens`
|
|
42
|
+
* and `--apply` already use for `surfacePrimary`. An undefined token contributes nothing. */
|
|
43
|
+
export declare function textSurfacesOf(colors: Record<string, unknown>): TextSurfaces;
|
|
44
|
+
/** One arm's worth of a colour token: the three schemes a shell renders. */
|
|
45
|
+
export type AccentArms = {
|
|
46
|
+
light: string;
|
|
47
|
+
dark: string;
|
|
48
|
+
highContrast: string;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* RFC 0059 / #2932 — the colour tokens a BRAND owns: the accent family `deriveAccentFamily` returns
|
|
52
|
+
* and brand application writes. One brand reads as one brand on every platform, so these are not
|
|
53
|
+
* idiom-eligible: `idiom-overlay-parity` fails an overlay that sets one, and brand application
|
|
54
|
+
* strips any it finds (`stripBrandFromIdiom`) — an overlay accent would otherwise beat the
|
|
55
|
+
* customer's brand on that platform. Pinned against `deriveAccentFamily`'s keys by a test.
|
|
56
|
+
*/
|
|
57
|
+
export declare const BRAND_COLOR_TOKENS: readonly ["accentPrimary", "accentSecondary", "accentSurface", "textOnAccent", "accentText"];
|
|
58
|
+
/** The one shadow whose COLOUR the brand owns: a kit's accent `glow`, which brand application
|
|
59
|
+
* retints to the brand. Its colour is not idiom-eligible either; its radius and opacity are. */
|
|
60
|
+
export declare const BRAND_GLOW_SHADOW = "glow";
|
|
61
|
+
export type BrandColorToken = (typeof BRAND_COLOR_TOKENS)[number];
|
|
62
|
+
/**
|
|
63
|
+
* RFC 0059 / #2932 — remove every brand colour from every idiom overlay — the accent family from
|
|
64
|
+
* `colors`, the accent glow's colour from `shadows` (dropping what is left empty) — in place.
|
|
65
|
+
* With the brand gone from the overlays, each idiom inherits the BASE's brand arms through the
|
|
66
|
+
* overlay merge — so a brand applied to the base is applied on every platform. A document with no
|
|
67
|
+
* `idiom` block is untouched.
|
|
68
|
+
*/
|
|
69
|
+
export declare function stripBrandFromIdiom(tokens: Record<string, unknown>): void;
|
|
70
|
+
/**
|
|
71
|
+
* The WHOLE accent family — every token, every arm — from one primary, one secondary and the
|
|
72
|
+
* surfaces they will be painted on.
|
|
73
|
+
*
|
|
74
|
+
* Extracted so there is literally ONE implementation (#2169's single engine), because the
|
|
75
|
+
* `--apply` overlay needs the same answer and cannot get it by guessing. That path deep-merges
|
|
76
|
+
* its tokens overlay into the target's committed `tokens.json`, and a shipped template carries
|
|
77
|
+
* REAL per-scheme values (`beauty-salon-owner`'s accentPrimary is `#8E3D6B` light / `#9C547D`
|
|
78
|
+
* dark). So an overlay that writes only a `light` arm leaves the template's `dark` and
|
|
79
|
+
* `highContrast` arms untouched, and the applied app renders the customer's brand in light mode
|
|
80
|
+
* and a DIFFERENT BUSINESS'S brand in dark — the #2252 chimera, one scheme over. An overlay must
|
|
81
|
+
* therefore write complete tokens, which means it must derive every arm the way the engine does.
|
|
82
|
+
*
|
|
83
|
+
* Each dark/highContrast arm is TUNED against its own surface rather than copied, and each
|
|
84
|
+
* `accentSurface` arm is tinted from that arm's tuned accent (not the raw brand) so it stays
|
|
85
|
+
* visible on a near-black page. `textOnAccent` is judged per arm against that arm's accent, and
|
|
86
|
+
* `accentText` (#3275) is that arm's accent moved only as far as it must to read as TEXT on that
|
|
87
|
+
* arm's page AND on each of `textSurfaces` — the other neutral surfaces a transparent label can sit
|
|
88
|
+
* on in that scheme (omitted ⇒ the page alone).
|
|
89
|
+
*/
|
|
90
|
+
export declare function deriveAccentFamily(primary: string, secondary: string, surfaces: AccentArms, textSurfaces?: TextSurfaces): {
|
|
91
|
+
accentPrimary: AccentArms;
|
|
92
|
+
accentSecondary: AccentArms;
|
|
93
|
+
accentSurface: AccentArms;
|
|
94
|
+
textOnAccent: AccentArms;
|
|
95
|
+
accentText: AccentArms;
|
|
96
|
+
};
|
|
97
|
+
/** Derive a shell's design tokens from its base tokens, a brand, and an optional
|
|
98
|
+
* design kit. Pure — no filesystem, no contract type, no shell identity. */
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts
CHANGED
|
@@ -743,7 +743,7 @@ export interface OrientationEnvelope {
|
|
|
743
743
|
export declare const DEFAULT_ORIENTATION_ENVELOPE: Required<OrientationEnvelope>;
|
|
744
744
|
/** Fill in the absent families. Total, so callers never branch on `undefined`. */
|
|
745
745
|
export declare function resolveOrientationEnvelope(env?: OrientationEnvelope): Required<OrientationEnvelope>;
|
|
746
|
-
export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_storage" | "share" | "push" | "file_picker" | "files" | "open_url" | "pdf" | "clipboard" | "photos" | "presigned_upload" | "ui" | "calendar" | "contacts" | "tasks" | "audio_record" | "audio_record_background" | "calls" | "location" | "location_background" | "motion" | "health" | "media_playback" | "webview" | "browser_auth" | "haptic" | "himi_apps" | "iap" | "keyboard" | "wix_cashier" | "live_activity" | "local_database" | "speech" | "speaker_diarization" | "system_intents" | "on_device_ai" | "app_info" | "release_control" | "godot" | "base44" | "animation";
|
|
746
|
+
export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_storage" | "share" | "push" | "file_picker" | "files" | "open_url" | "pdf" | "clipboard" | "theme" | "photos" | "presigned_upload" | "ui" | "calendar" | "contacts" | "tasks" | "audio_record" | "audio_record_background" | "calls" | "location" | "location_background" | "motion" | "health" | "media_playback" | "webview" | "browser_auth" | "haptic" | "himi_apps" | "iap" | "keyboard" | "wix_cashier" | "live_activity" | "local_database" | "speech" | "speaker_diarization" | "system_intents" | "on_device_ai" | "app_info" | "release_control" | "godot" | "base44" | "animation";
|
|
747
747
|
/** `defineApp({ wixIap })` — the purchases-service app a build binds this app to. */
|
|
748
748
|
export interface WixIapConfig {
|
|
749
749
|
/** The purchases service's app UUID, registered on the app's own auth site. Not a secret. */
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts
CHANGED
|
@@ -2793,6 +2793,11 @@ export interface DrawerHeader {
|
|
|
2793
2793
|
* instead of the avatar/identity row. */
|
|
2794
2794
|
logo?: string;
|
|
2795
2795
|
actions?: DrawerHeaderAction[];
|
|
2796
|
+
/** RFC 0070 §2 — live `$service:` bindings (nav worker). Unset, unresolved or an empty string ⇒
|
|
2797
|
+
* the sibling literal. No `logoPath`: `logo` is a glyph; bind a site logo through `imageUrlPath`. */
|
|
2798
|
+
titlePath?: string;
|
|
2799
|
+
subtitlePath?: string;
|
|
2800
|
+
imageUrlPath?: string;
|
|
2796
2801
|
}
|
|
2797
2802
|
/** RFC 0010 — a single drawer destination (mirrors NavTabItem). */
|
|
2798
2803
|
export interface DrawerItem {
|
|
@@ -2815,6 +2820,8 @@ export interface DrawerItem {
|
|
|
2815
2820
|
hiddenPath?: string;
|
|
2816
2821
|
labelPath?: string;
|
|
2817
2822
|
iconPath?: string;
|
|
2823
|
+
/** RFC 0070 §1.2 — with `hiddenPath`, hidden until the path resolves (fail-closed). */
|
|
2824
|
+
hiddenUntilResolved?: boolean;
|
|
2818
2825
|
}
|
|
2819
2826
|
/** RFC 0010 — a single bottom-nav tab. */
|
|
2820
2827
|
export interface NavTabItem {
|
|
@@ -2839,6 +2846,8 @@ export interface NavTabItem {
|
|
|
2839
2846
|
hiddenPath?: string;
|
|
2840
2847
|
labelPath?: string;
|
|
2841
2848
|
iconPath?: string;
|
|
2849
|
+
/** RFC 0070 §1.2 — with `hiddenPath`, hidden until the path resolves (fail-closed). */
|
|
2850
|
+
hiddenUntilResolved?: boolean;
|
|
2842
2851
|
}
|
|
2843
2852
|
/** RFC 0010 — live or static badge on a nav tab. */
|
|
2844
2853
|
export interface NavBadge {
|
|
@@ -51,6 +51,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
51
51
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
52
52
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
53
53
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
54
|
+
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
54
55
|
"ui": ["alert", "snackbar"],
|
|
55
56
|
"wix_cashier": ["isAvailable", "proceedToPayment"]
|
|
56
57
|
};
|
|
@@ -51,6 +51,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
51
51
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
52
52
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
53
53
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
54
|
+
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
54
55
|
"ui": ["alert", "snackbar"],
|
|
55
56
|
"wix_cashier": ["isAvailable", "proceedToPayment"]
|
|
56
57
|
};
|
|
@@ -51,6 +51,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
51
51
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
52
52
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
53
53
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
54
|
+
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
54
55
|
"ui": ["alert", "snackbar"],
|
|
55
56
|
"wix_cashier": ["isAvailable", "proceedToPayment"]
|
|
56
57
|
};
|
|
@@ -51,6 +51,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
51
51
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
52
52
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
53
53
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
54
|
+
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
54
55
|
"ui": ["alert", "snackbar"],
|
|
55
56
|
"wix_cashier": ["isAvailable", "proceedToPayment"]
|
|
56
57
|
};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// ../../core/ts/src/brand-color-math.ts
|
|
2
|
+
function channel(hex, offset) {
|
|
3
|
+
return Number.parseInt(hex.slice(offset, offset + 2), 16);
|
|
4
|
+
}
|
|
5
|
+
function toHex(r, g, b) {
|
|
6
|
+
return `#${[r, g, b].map((value) => Math.round(value).toString(16).padStart(2, "0")).join("")}`.toUpperCase();
|
|
7
|
+
}
|
|
8
|
+
function mix(color, background, colorWeight) {
|
|
9
|
+
const values = [1, 3, 5].map((offset) => channel(color, offset) * colorWeight + channel(background, offset) * (1 - colorWeight));
|
|
10
|
+
return toHex(values[0], values[1], values[2]);
|
|
11
|
+
}
|
|
12
|
+
function relativeLuminance(color) {
|
|
13
|
+
const linear = [1, 3, 5].map((offset) => {
|
|
14
|
+
const value = channel(color, offset) / 255;
|
|
15
|
+
return value <= 0.03928 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
|
|
16
|
+
});
|
|
17
|
+
return 0.2126 * linear[0] + 0.7152 * linear[1] + 0.0722 * linear[2];
|
|
18
|
+
}
|
|
19
|
+
function contrastRatio(a, b) {
|
|
20
|
+
const la = relativeLuminance(a);
|
|
21
|
+
const lb = relativeLuminance(b);
|
|
22
|
+
return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
|
|
23
|
+
}
|
|
24
|
+
function lstar(color) {
|
|
25
|
+
const y = relativeLuminance(color);
|
|
26
|
+
return y <= 8856e-6 ? y * 903.3 : 116 * Math.cbrt(y) - 16;
|
|
27
|
+
}
|
|
28
|
+
var ACCENT_SURFACE_MIN_DELTA = 1.08;
|
|
29
|
+
var ACCENT_SURFACE_LIGHT_WEIGHT = 0.12;
|
|
30
|
+
function deriveAccentSurface(accent, surface, weight) {
|
|
31
|
+
const tint = mix(accent, surface, weight);
|
|
32
|
+
if (contrastRatio(tint, surface) >= ACCENT_SURFACE_MIN_DELTA) return tint;
|
|
33
|
+
const away = relativeLuminance(surface) < 0.5 ? "#FFFFFF" : "#000000";
|
|
34
|
+
for (let w = 0.02; w <= 0.5; w += 0.02) {
|
|
35
|
+
const candidate = mix(away, surface, w);
|
|
36
|
+
if (contrastRatio(candidate, surface) >= ACCENT_SURFACE_MIN_DELTA) return candidate;
|
|
37
|
+
}
|
|
38
|
+
return tint;
|
|
39
|
+
}
|
|
40
|
+
var SECONDARY_SHADE_WEIGHT = 0.72;
|
|
41
|
+
var SECONDARY_MIN_LSTAR = 22;
|
|
42
|
+
function deriveSecondaryAccent(primary) {
|
|
43
|
+
const shade = mix(primary, "#000000", SECONDARY_SHADE_WEIGHT);
|
|
44
|
+
if (lstar(shade) >= SECONDARY_MIN_LSTAR) return shade;
|
|
45
|
+
return mix(primary, "#FFFFFF", SECONDARY_SHADE_WEIGHT);
|
|
46
|
+
}
|
|
47
|
+
function textOn(color) {
|
|
48
|
+
const luminance = relativeLuminance(color);
|
|
49
|
+
const whiteContrast = 1.05 / (luminance + 0.05);
|
|
50
|
+
const blackContrast = (luminance + 0.05) / 0.05;
|
|
51
|
+
return whiteContrast >= blackContrast ? "#FFFFFF" : "#000000";
|
|
52
|
+
}
|
|
53
|
+
var DARK_ARM_MIN_LIFT = 0.08;
|
|
54
|
+
var DARK_ARM_TARGET_CONTRAST = 3.4;
|
|
55
|
+
var DARK_ARM_FLOOR_CONTRAST = 3;
|
|
56
|
+
var DARK_ARM_LSTAR_CAP = 80;
|
|
57
|
+
function tuneDarkAccent(brand, darkSurface, lightSurface) {
|
|
58
|
+
const kitInherentlyDark = lstar(lightSurface) < 50;
|
|
59
|
+
if (kitInherentlyDark && contrastRatio(brand, darkSurface) >= DARK_ARM_TARGET_CONTRAST && lstar(brand) <= DARK_ARM_LSTAR_CAP) {
|
|
60
|
+
return brand;
|
|
61
|
+
}
|
|
62
|
+
let lift = DARK_ARM_MIN_LIFT;
|
|
63
|
+
let candidate = mix(brand, "#FFFFFF", 1 - lift);
|
|
64
|
+
while (contrastRatio(candidate, darkSurface) < DARK_ARM_TARGET_CONTRAST && lift < 0.6) {
|
|
65
|
+
lift += 0.04;
|
|
66
|
+
candidate = mix(brand, "#FFFFFF", 1 - lift);
|
|
67
|
+
}
|
|
68
|
+
while (lstar(candidate) > DARK_ARM_LSTAR_CAP) {
|
|
69
|
+
const darker = mix(candidate, "#000000", 0.94);
|
|
70
|
+
if (contrastRatio(darker, darkSurface) < DARK_ARM_FLOOR_CONTRAST) break;
|
|
71
|
+
candidate = darker;
|
|
72
|
+
}
|
|
73
|
+
return candidate;
|
|
74
|
+
}
|
|
75
|
+
function textOnArm(accent) {
|
|
76
|
+
return contrastRatio("#FFFFFF", accent) >= 4.5 ? "#FFFFFF" : textOn(accent);
|
|
77
|
+
}
|
|
78
|
+
var HIGH_CONTRAST_TARGET = 8.5;
|
|
79
|
+
function tuneHighContrastAccent(brand, surface) {
|
|
80
|
+
const towards = relativeLuminance(surface) < 0.5 ? "#FFFFFF" : "#000000";
|
|
81
|
+
let candidate = brand;
|
|
82
|
+
for (let lift = 0; lift <= 0.9 && contrastRatio(candidate, surface) < HIGH_CONTRAST_TARGET; lift += 0.04) {
|
|
83
|
+
candidate = mix(brand, towards, 1 - lift);
|
|
84
|
+
}
|
|
85
|
+
return candidate;
|
|
86
|
+
}
|
|
87
|
+
var ACCENT_TEXT_MIN_CONTRAST = 4.5;
|
|
88
|
+
var MID_GREY_LUMINANCE = 0.179;
|
|
89
|
+
function deriveAccentText(accent, surfaces) {
|
|
90
|
+
const all = (typeof surfaces === "string" ? [surfaces] : [...surfaces]).map((s) => s.slice(0, 7));
|
|
91
|
+
const page = all[0];
|
|
92
|
+
const worst = (color) => Math.min(...all.map((s) => contrastRatio(color, s)));
|
|
93
|
+
const opaque = accent.length === 9 ? mix(accent.slice(0, 7), page, channel(accent, 7) / 255) : accent;
|
|
94
|
+
if (worst(opaque) >= ACCENT_TEXT_MIN_CONTRAST) return opaque;
|
|
95
|
+
const pole = worst("#FFFFFF") >= worst("#000000") ? "#FFFFFF" : "#000000";
|
|
96
|
+
for (let step = 1; step <= 100; step++) {
|
|
97
|
+
const candidate = mix(pole, opaque, step / 100);
|
|
98
|
+
if (worst(candidate) >= ACCENT_TEXT_MIN_CONTRAST) return candidate;
|
|
99
|
+
}
|
|
100
|
+
if (all.length > 1) {
|
|
101
|
+
const side = (hex) => relativeLuminance(hex) > MID_GREY_LUMINANCE;
|
|
102
|
+
const sameSide = all.filter((s) => side(s) === side(page));
|
|
103
|
+
return deriveAccentText(accent, sameSide.length < all.length ? sameSide : [page]);
|
|
104
|
+
}
|
|
105
|
+
return pole;
|
|
106
|
+
}
|
|
107
|
+
var TEXT_BACKDROP_TOKENS = ["surfaceSecondary", "surfaceElevated", "surfaceSubtle", "surfaceTertiary"];
|
|
108
|
+
function textSurfacesOf(colors) {
|
|
109
|
+
const out = { light: [], dark: [], highContrast: [] };
|
|
110
|
+
for (const name of TEXT_BACKDROP_TOKENS) {
|
|
111
|
+
const value = colors[name];
|
|
112
|
+
for (const arm of ["light", "dark", "highContrast"]) {
|
|
113
|
+
const hex = typeof value === "string" ? value : value && typeof value === "object" && !Array.isArray(value) ? value[arm] ?? value.light : void 0;
|
|
114
|
+
if (typeof hex === "string" && hex.startsWith("#") && hex.length >= 7) out[arm].push(hex);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
var BRAND_COLOR_TOKENS = ["accentPrimary", "accentSecondary", "accentSurface", "textOnAccent", "accentText"];
|
|
120
|
+
var BRAND_GLOW_SHADOW = "glow";
|
|
121
|
+
function stripBrandFromIdiom(tokens) {
|
|
122
|
+
const idiom = tokens.idiom;
|
|
123
|
+
if (!idiom || typeof idiom !== "object" || Array.isArray(idiom)) return;
|
|
124
|
+
for (const overlay of Object.values(idiom)) {
|
|
125
|
+
if (!overlay || typeof overlay !== "object" || Array.isArray(overlay)) continue;
|
|
126
|
+
const o = overlay;
|
|
127
|
+
const colors = o.colors;
|
|
128
|
+
if (colors && typeof colors === "object" && !Array.isArray(colors)) {
|
|
129
|
+
for (const key of BRAND_COLOR_TOKENS) delete colors[key];
|
|
130
|
+
if (Object.keys(colors).length === 0) delete o.colors;
|
|
131
|
+
}
|
|
132
|
+
const shadows = o.shadows;
|
|
133
|
+
const glow = shadows && typeof shadows === "object" && !Array.isArray(shadows) ? shadows[BRAND_GLOW_SHADOW] : void 0;
|
|
134
|
+
if (glow && typeof glow === "object" && !Array.isArray(glow) && "color" in glow) {
|
|
135
|
+
delete glow.color;
|
|
136
|
+
if (Object.keys(glow).length === 0) delete shadows[BRAND_GLOW_SHADOW];
|
|
137
|
+
if (Object.keys(shadows).length === 0) delete o.shadows;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function deriveAccentFamily(primary, secondary, surfaces, textSurfaces = {}) {
|
|
142
|
+
const primaryDark = tuneDarkAccent(primary, surfaces.dark, surfaces.light);
|
|
143
|
+
const secondaryDark = tuneDarkAccent(secondary, surfaces.dark, surfaces.light);
|
|
144
|
+
const primaryHigh = tuneHighContrastAccent(primary, surfaces.highContrast);
|
|
145
|
+
const secondaryHigh = tuneHighContrastAccent(secondary, surfaces.highContrast);
|
|
146
|
+
return {
|
|
147
|
+
accentPrimary: { light: primary, dark: primaryDark, highContrast: primaryHigh },
|
|
148
|
+
accentSecondary: { light: secondary, dark: secondaryDark, highContrast: secondaryHigh },
|
|
149
|
+
accentSurface: {
|
|
150
|
+
light: deriveAccentSurface(primary, surfaces.light, ACCENT_SURFACE_LIGHT_WEIGHT),
|
|
151
|
+
dark: deriveAccentSurface(primaryDark, surfaces.dark, 0.24),
|
|
152
|
+
highContrast: deriveAccentSurface(primaryHigh, surfaces.highContrast, 0.24)
|
|
153
|
+
},
|
|
154
|
+
textOnAccent: {
|
|
155
|
+
light: textOnArm(primary),
|
|
156
|
+
dark: textOnArm(primaryDark),
|
|
157
|
+
highContrast: textOn(primaryHigh)
|
|
158
|
+
},
|
|
159
|
+
accentText: {
|
|
160
|
+
light: deriveAccentText(primary, [surfaces.light, ...textSurfaces.light ?? []]),
|
|
161
|
+
dark: deriveAccentText(primaryDark, [surfaces.dark, ...textSurfaces.dark ?? []]),
|
|
162
|
+
highContrast: deriveAccentText(primaryHigh, [surfaces.highContrast, ...textSurfaces.highContrast ?? []])
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
export {
|
|
167
|
+
ACCENT_SURFACE_LIGHT_WEIGHT,
|
|
168
|
+
ACCENT_TEXT_MIN_CONTRAST,
|
|
169
|
+
BRAND_COLOR_TOKENS,
|
|
170
|
+
BRAND_GLOW_SHADOW,
|
|
171
|
+
TEXT_BACKDROP_TOKENS,
|
|
172
|
+
contrastRatio,
|
|
173
|
+
deriveAccentFamily,
|
|
174
|
+
deriveAccentSurface,
|
|
175
|
+
deriveAccentText,
|
|
176
|
+
deriveSecondaryAccent,
|
|
177
|
+
lstar,
|
|
178
|
+
mix,
|
|
179
|
+
relativeLuminance,
|
|
180
|
+
stripBrandFromIdiom,
|
|
181
|
+
textSurfacesOf
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=brand-color-math.mjs.map
|
|
@@ -51,6 +51,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
51
51
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
52
52
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
53
53
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
54
|
+
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
54
55
|
"ui": ["alert", "snackbar"],
|
|
55
56
|
"wix_cashier": ["isAvailable", "proceedToPayment"]
|
|
56
57
|
};
|
|
@@ -51,6 +51,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
51
51
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
52
52
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
53
53
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
54
|
+
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
54
55
|
"ui": ["alert", "snackbar"],
|
|
55
56
|
"wix_cashier": ["isAvailable", "proceedToPayment"]
|
|
56
57
|
};
|
|
@@ -51,6 +51,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
51
51
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
52
52
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
53
53
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
54
|
+
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
54
55
|
"ui": ["alert", "snackbar"],
|
|
55
56
|
"wix_cashier": ["isAvailable", "proceedToPayment"]
|
|
56
57
|
};
|
|
@@ -36,6 +36,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
36
36
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
37
37
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
38
38
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
39
|
+
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
39
40
|
"ui": ["alert", "snackbar"],
|
|
40
41
|
"wix_cashier": ["isAvailable", "proceedToPayment"]
|
|
41
42
|
};
|
|
@@ -51,6 +51,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
51
51
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
52
52
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
53
53
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
54
|
+
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
54
55
|
"ui": ["alert", "snackbar"],
|
|
55
56
|
"wix_cashier": ["isAvailable", "proceedToPayment"]
|
|
56
57
|
};
|