@wix/himalaya-cli 0.1029.0 → 0.1031.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/dev-server/src/app-config.d.ts +7 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/wix-gateway.d.ts +32 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/wix-gateway.rules.d.ts +2 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +7 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/genie-chat/src/index.d.ts +64 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-genie-chat.mjs +41 -1
- package/dist/cli.mjs +298 -114
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +0 -7
- package/guides/component-reference.md +0 -2
- package/guides/sdk-reference.json +50 -2
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +575 -214
- package/templates/beauty-salon/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/beauty-salon/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/beauty-salon/tier5-src/himi-branded-lite-appearance/index.ts +12 -1
- package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +36 -5
- package/templates/beauty-salon/tier5-src/wix-spaces-app-language/index.ts +4 -2
- package/templates/beauty-salon-owner/config.ts +1 -1
- package/templates/beauty-salon-owner/dev/index.ts +247 -9
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-attachments.ts +179 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +405 -20
- package/templates/beauty-salon-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-bookings.ts +20 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -1
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-home/index.ts +2 -12
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-manage/index.ts +10 -4
- package/templates/branded-lite/dev/index.ts +699 -228
- package/templates/branded-lite/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/branded-lite/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-appearance/index.ts +12 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-notifsettings/index.ts +11 -6
- package/templates/branded-lite/tier5-src/himi-branded-lite-reviews/index.ts +11 -6
- package/templates/branded-lite/tier5-src/himi-store-product/index.ts +36 -5
- package/templates/branded-lite/tier5-src/wix-spaces-app-language/index.ts +4 -2
- package/templates/community-club/dev/index.ts +451 -204
- package/templates/community-club/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/community-club/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/community-club/tier5-src/himi-branded-lite-appearance/index.ts +12 -1
- package/templates/community-club/tier5-src/wix-spaces-app-language/index.ts +4 -2
- package/templates/community-club-owner/config.ts +1 -1
- package/templates/community-club-owner/dev/index.ts +247 -9
- package/templates/community-club-owner/tier5-src/_shared/aria-attachments.ts +179 -0
- package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +405 -20
- package/templates/community-club-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/community-club-owner/tier5-src/_shared/owner-bookings.ts +20 -0
- package/templates/community-club-owner/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/community-club-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -1
- package/templates/community-club-owner/tier5-src/himi-owner-lite-home/index.ts +2 -12
- package/templates/community-club-owner/tier5-src/himi-owner-lite-manage/index.ts +10 -4
- package/templates/events-meetups/dev/index.ts +451 -204
- package/templates/events-meetups/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/events-meetups/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/events-meetups/tier5-src/himi-branded-lite-appearance/index.ts +12 -1
- package/templates/events-meetups/tier5-src/wix-spaces-app-language/index.ts +4 -2
- package/templates/events-meetups-owner/config.ts +1 -1
- package/templates/events-meetups-owner/dev/index.ts +247 -9
- package/templates/events-meetups-owner/tier5-src/_shared/aria-attachments.ts +179 -0
- package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +405 -20
- package/templates/events-meetups-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/events-meetups-owner/tier5-src/_shared/owner-bookings.ts +20 -0
- package/templates/events-meetups-owner/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -1
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-home/index.ts +2 -12
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-manage/index.ts +10 -4
- package/templates/gym-fitness/dev/index.ts +575 -214
- package/templates/gym-fitness/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/gym-fitness/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/gym-fitness/tier5-src/himi-branded-lite-appearance/index.ts +12 -1
- package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +36 -5
- package/templates/gym-fitness/tier5-src/wix-spaces-app-language/index.ts +4 -2
- package/templates/gym-fitness-owner/config.ts +1 -1
- package/templates/gym-fitness-owner/dev/index.ts +247 -9
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-attachments.ts +179 -0
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +405 -20
- package/templates/gym-fitness-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-bookings.ts +20 -0
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -1
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-home/index.ts +2 -12
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-manage/index.ts +10 -4
- package/templates/himi-chat/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/nonprofit-cause/dev/index.ts +451 -204
- package/templates/nonprofit-cause/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/nonprofit-cause/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-appearance/index.ts +12 -1
- package/templates/nonprofit-cause/tier5-src/wix-spaces-app-language/index.ts +4 -2
- package/templates/nonprofit-cause-owner/config.ts +1 -1
- package/templates/nonprofit-cause-owner/dev/index.ts +247 -9
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-attachments.ts +179 -0
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +405 -20
- package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-bookings.ts +20 -0
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -1
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-home/index.ts +2 -12
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-manage/index.ts +10 -4
- package/templates/owner-lite/config.ts +1 -1
- package/templates/owner-lite/dev/index.ts +247 -9
- package/templates/owner-lite/tier5-src/_shared/aria-attachments.ts +179 -0
- package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +405 -20
- package/templates/owner-lite/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/owner-lite/tier5-src/_shared/owner-bookings.ts +20 -0
- package/templates/owner-lite/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/owner-lite/tier5-src/himi-owner-lite-aria/index.ts +40 -1
- package/templates/owner-lite/tier5-src/himi-owner-lite-home/index.ts +2 -12
- package/templates/owner-lite/tier5-src/himi-owner-lite-manage/index.ts +10 -4
- package/templates/podcast-creator/dev/index.ts +451 -204
- package/templates/podcast-creator/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/podcast-creator/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/podcast-creator/tier5-src/himi-branded-lite-appearance/index.ts +12 -1
- package/templates/podcast-creator/tier5-src/wix-spaces-app-language/index.ts +4 -2
- package/templates/podcast-creator-owner/config.ts +1 -1
- package/templates/podcast-creator-owner/dev/index.ts +247 -9
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-attachments.ts +179 -0
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +405 -20
- package/templates/podcast-creator-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-bookings.ts +20 -0
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -1
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-home/index.ts +2 -12
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-manage/index.ts +10 -4
- package/templates/portfolio-creative/dev/index.ts +575 -214
- package/templates/portfolio-creative/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/portfolio-creative/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-appearance/index.ts +12 -1
- package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +36 -5
- package/templates/portfolio-creative/tier5-src/wix-spaces-app-language/index.ts +4 -2
- package/templates/portfolio-creative-owner/config.ts +1 -1
- package/templates/portfolio-creative-owner/dev/index.ts +247 -9
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-attachments.ts +179 -0
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +405 -20
- package/templates/portfolio-creative-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-bookings.ts +20 -0
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -1
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-home/index.ts +2 -12
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-manage/index.ts +10 -4
- package/templates/restaurant/dev/index.ts +451 -204
- package/templates/restaurant/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/restaurant/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/restaurant/tier5-src/himi-branded-lite-appearance/index.ts +12 -1
- package/templates/restaurant/tier5-src/wix-spaces-app-language/index.ts +4 -2
- package/templates/restaurant-owner/config.ts +1 -1
- package/templates/restaurant-owner/dev/index.ts +247 -9
- package/templates/restaurant-owner/tier5-src/_shared/aria-attachments.ts +179 -0
- package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +405 -20
- package/templates/restaurant-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/restaurant-owner/tier5-src/_shared/owner-bookings.ts +20 -0
- package/templates/restaurant-owner/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -1
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-home/index.ts +2 -12
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-manage/index.ts +10 -4
- package/templates/retail-store/dev/index.ts +575 -214
- package/templates/retail-store/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/retail-store/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/retail-store/tier5-src/himi-branded-lite-appearance/index.ts +12 -1
- package/templates/retail-store/tier5-src/himi-store-product/index.ts +36 -5
- package/templates/retail-store/tier5-src/wix-spaces-app-language/index.ts +4 -2
- package/templates/retail-store-owner/config.ts +1 -1
- package/templates/retail-store-owner/dev/index.ts +247 -9
- package/templates/retail-store-owner/tier5-src/_shared/aria-attachments.ts +179 -0
- package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +405 -20
- package/templates/retail-store-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/retail-store-owner/tier5-src/_shared/owner-bookings.ts +20 -0
- package/templates/retail-store-owner/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -1
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-home/index.ts +2 -12
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-manage/index.ts +10 -4
- package/templates/yoga-studio/dev/index.ts +451 -204
- package/templates/yoga-studio/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/yoga-studio/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/yoga-studio/tier5-src/himi-branded-lite-appearance/index.ts +12 -1
- package/templates/yoga-studio/tier5-src/wix-spaces-app-language/index.ts +4 -2
- package/templates/yoga-studio-owner/config.ts +1 -1
- package/templates/yoga-studio-owner/dev/index.ts +247 -9
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-attachments.ts +179 -0
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +405 -20
- package/templates/yoga-studio-owner/tier5-src/_shared/collection-contract.ts +4 -1
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-bookings.ts +20 -0
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-aria/index.ts +40 -1
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-home/index.ts +2 -12
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-manage/index.ts +10 -4
|
@@ -14,6 +14,9 @@ export interface CollectionConfig {
|
|
|
14
14
|
searchPlaceholder?: string;
|
|
15
15
|
sortLabels?: { default: string; az: string; za: string };
|
|
16
16
|
metadata?: string[];
|
|
17
|
+
/** Numeric 0–5 row field rendered as a Rating (accessible "N out of 5") instead of
|
|
18
|
+
* folding a "★★★★☆" glyph string into the metadata line, so screen readers get a value. */
|
|
19
|
+
rating?: string;
|
|
17
20
|
sectioned?: boolean;
|
|
18
21
|
view: 'list' | 'grid';
|
|
19
22
|
backendQuery?: boolean;
|
|
@@ -58,7 +61,7 @@ export const COLLECTIONS: Record<string, CollectionConfig> = {
|
|
|
58
61
|
himiBrandedCoupons: { rows: 'coupons', title: 'name', subtitle: 'subtitle', view: 'list', primaryVerb: { label: 'Get code' } },
|
|
59
62
|
himiBrandedNotifications: { rows: 'items', title: 'name', subtitle: 'subtitle', image: 'photo', metadata: ['unreadDot'], view: 'list' },
|
|
60
63
|
himiBrandedLoyalty: { rows: 'rewards', title: 'name', subtitle: 'description', view: 'grid', primaryVerb: { label: 'Redeem' } },
|
|
61
|
-
himiBrandedReviews: { rows: 'reviews', title: 'title', subtitle: 'body', metadata: ['author', '
|
|
64
|
+
himiBrandedReviews: { rows: 'reviews', title: 'title', subtitle: 'body', metadata: ['author'], rating: 'rating', view: 'list' },
|
|
62
65
|
himiBrandedPortfolio: { rows: 'projects', title: 'title', subtitle: 'subtitle', image: 'image', view: 'grid', gridImageHeight: 180 },
|
|
63
66
|
himiBrandedInvoices: { rows: 'invoices', title: 'title', subtitle: 'subtitle', view: 'list' },
|
|
64
67
|
himiBrandedBadges: { rows: 'badges', title: 'name', subtitle: 'description', view: 'grid' },
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { copyParam } from "./himi-copy.js";
|
|
2
2
|
|
|
3
|
-
/** Host-owned preview input. Absent on native and older hosts.
|
|
3
|
+
/** Host-owned preview input. Absent on native and older hosts.
|
|
4
|
+
*
|
|
5
|
+
* `"sample"` — the built-in demo records; `"live"` — the viewer's own business over the
|
|
6
|
+
* owner rung; `"fixtures"` — a DEV web host over a sealed hermetic gateway, where
|
|
7
|
+
* the dev fixtures are the sample data. `"fixtures"` is neither live nor demo, so a
|
|
8
|
+
* worker READS through the bridge as it does on a device; it is still a preview host
|
|
9
|
+
* (`isOwnerPreviewHost`), so failure copy may name the web preview. */
|
|
4
10
|
function ownerPreviewMode(): unknown {
|
|
5
11
|
return (globalThis as unknown as { himalaya?: { input?: Record<string, unknown> } }).himalaya?.input?.__himiOwnerPreview;
|
|
6
12
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineService } from "@himalaya/state";
|
|
2
2
|
import {
|
|
3
|
+
ACCENT_IDS,
|
|
3
4
|
ACCENT_KEY,
|
|
4
5
|
ACCENT_META,
|
|
5
6
|
DEFAULT_ACCENT,
|
|
@@ -29,6 +30,10 @@ interface State {
|
|
|
29
30
|
accentHex_sage: string;
|
|
30
31
|
accentHex_plum: string;
|
|
31
32
|
accentHex_ocean: string;
|
|
33
|
+
// Per-accent selection flags for the radio group (`selected_<id>`) and the
|
|
34
|
+
// check mark on the swatch (`notSelected_<id>`, hiddenWhen hides on TRUE). Flat
|
|
35
|
+
// fields for the same reason as the hex ones: the swatches are static nodes.
|
|
36
|
+
[flag: `selected_${string}` | `notSelected_${string}`]: boolean | string;
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
interface StorageLike {
|
|
@@ -50,7 +55,13 @@ function paramValue(arg: unknown, key: string): string {
|
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
function build(pendingAccent: string, brandAccent: string): State {
|
|
58
|
+
const flags: Record<string, boolean> = {};
|
|
59
|
+
for (const id of ACCENT_IDS) {
|
|
60
|
+
flags[`selected_${id}`] = id === pendingAccent;
|
|
61
|
+
flags[`notSelected_${id}`] = id !== pendingAccent;
|
|
62
|
+
}
|
|
53
63
|
return {
|
|
64
|
+
...flags,
|
|
54
65
|
pendingAccent,
|
|
55
66
|
brandAccent,
|
|
56
67
|
accentHex_brand: brandAccent || ACCENT_META.amber.hex,
|
|
@@ -85,7 +96,7 @@ const svc = defineService<State, {
|
|
|
85
96
|
selectAccent: (state, arg) => {
|
|
86
97
|
const id = paramValue(arg, "id");
|
|
87
98
|
if (!isAccentId(id)) return state;
|
|
88
|
-
return
|
|
99
|
+
return build(id, state.brandAccent);
|
|
89
100
|
},
|
|
90
101
|
// Apply: persist the accent; the home worker re-reads it on launch.
|
|
91
102
|
apply: (state) => {
|
|
@@ -55,6 +55,12 @@ interface S {
|
|
|
55
55
|
shareUrl: string;
|
|
56
56
|
cartHint: string;
|
|
57
57
|
cartCount: number;
|
|
58
|
+
/** An add-to-cart write is in flight (pending line under the CTA). */
|
|
59
|
+
adding: boolean;
|
|
60
|
+
notAdding: boolean;
|
|
61
|
+
/** The last add succeeded (confirmation + View cart under the CTA). */
|
|
62
|
+
added: boolean;
|
|
63
|
+
notAdded: boolean;
|
|
58
64
|
emptyText: string;
|
|
59
65
|
isLoading: boolean;
|
|
60
66
|
notLoading: boolean;
|
|
@@ -145,6 +151,8 @@ function derive(s: S): S {
|
|
|
145
151
|
return {
|
|
146
152
|
...s,
|
|
147
153
|
saveLabel: s.saved ? copyParam("product.saved", "Saved") : copyParam("product.save", "Save product"),
|
|
154
|
+
notAdding: !s.adding,
|
|
155
|
+
notAdded: !s.added,
|
|
148
156
|
isLoading: s.status === "loading",
|
|
149
157
|
notLoading: s.status !== "loading",
|
|
150
158
|
isErrored: s.status === "error",
|
|
@@ -163,6 +171,7 @@ const svc = defineService<S, {
|
|
|
163
171
|
load: (s: S, arg?: unknown) => Promise<S>;
|
|
164
172
|
setQuantity: (s: S, arg?: unknown) => S;
|
|
165
173
|
addToCart: (s: S) => Promise<S>;
|
|
174
|
+
beginAdd: (s: S, arg?: unknown) => S;
|
|
166
175
|
share: (s: S) => Promise<S>;
|
|
167
176
|
toggleSave: (s: S) => S;
|
|
168
177
|
}>("himiStoreProduct", {
|
|
@@ -179,6 +188,10 @@ const svc = defineService<S, {
|
|
|
179
188
|
shareUrl: "",
|
|
180
189
|
cartHint: "",
|
|
181
190
|
cartCount: 0,
|
|
191
|
+
adding: false,
|
|
192
|
+
notAdding: true,
|
|
193
|
+
added: false,
|
|
194
|
+
notAdded: true,
|
|
182
195
|
emptyText: "",
|
|
183
196
|
isLoading: true,
|
|
184
197
|
notLoading: false,
|
|
@@ -201,7 +214,7 @@ const svc = defineService<S, {
|
|
|
201
214
|
// Storage problems must not prevent browsing or buying a product.
|
|
202
215
|
let saved = false;
|
|
203
216
|
try { saved = isProductSaved(id); } catch { /* save action reports a retryable error */ }
|
|
204
|
-
s = { ...s, saved, saveHint: "" };
|
|
217
|
+
s = { ...s, saved, saveHint: "", adding: false, added: false };
|
|
205
218
|
// A fresh navigation into the product resets any quantity left over
|
|
206
219
|
// from a previous visit to the same worker instance.
|
|
207
220
|
if (!id) return derive({ ...s, status: "ready", quantity: 1, emptyText: copyParam("product.notFoundText", "Product not found.") });
|
|
@@ -254,25 +267,42 @@ const svc = defineService<S, {
|
|
|
254
267
|
const quantity = parseQuantity(argValue(arg, "value"));
|
|
255
268
|
return quantity ? derive({ ...s, quantity }) : s;
|
|
256
269
|
},
|
|
270
|
+
// The pending half of addToCart, as its own reducer so it PUBLISHES before the
|
|
271
|
+
// network write starts: the pending line shows and the top-bar badge ticks up in the same
|
|
272
|
+
// interaction, instead of the tap looking dead until the round-trip (and the badge re-read)
|
|
273
|
+
// settle. Called from addToCart, not from the descriptor.
|
|
274
|
+
beginAdd: (s, arg) => {
|
|
275
|
+
const quantity = parseQuantity(argValue(arg, "quantity")) ?? 1;
|
|
276
|
+
return derive({ ...s, adding: true, added: false, cartHint: "", cartCount: s.cartCount + quantity });
|
|
277
|
+
},
|
|
257
278
|
addToCart: async (s) => {
|
|
258
279
|
const id = inputId();
|
|
259
280
|
if (!id) return derive({ ...s, cartHint: copyParam("product.cartHintNoProduct", "No product to add.") });
|
|
281
|
+
// A second tap while the first write is in flight must not add the line twice.
|
|
282
|
+
if (s.adding) return s;
|
|
260
283
|
const quantity = s.quantity > 0 ? s.quantity : 1;
|
|
284
|
+
const before = s.cartCount;
|
|
285
|
+
await svc.beginAdd({ quantity: String(quantity) });
|
|
286
|
+
s = svc.getState() as S;
|
|
261
287
|
// Optimistic local cart line — the cart repaints from cache immediately (offline or not).
|
|
262
288
|
const line: DbEntity = { id: `line-${id}`, productId: id, name: s.name || "product", title: s.name || "product", subtitle: `Qty ${quantity}`, quantity: String(quantity) };
|
|
263
289
|
await cartPut(line);
|
|
264
290
|
try {
|
|
265
291
|
await addToCurrentCart(id, quantity);
|
|
266
|
-
return derive({ ...s, cartHint: copyTemplate("product.cartHintAdded", "Added {name} to cart.", { name: s.name || "product" }), cartCount: await cartItemCount() });
|
|
267
292
|
} catch (e) {
|
|
268
293
|
if (isBridgeUnavailable(e)) {
|
|
269
294
|
// Offline / no bridge: the optimistic cache line already shows; queue the
|
|
270
295
|
// add to replay (WriteQueue, idempotent) when connectivity returns.
|
|
271
296
|
await queueWrite("tier5.himiStoreProduct.addToCart", { id });
|
|
272
|
-
return derive({ ...s, cartHint: copyTemplate("product.cartHintQueued", "Added {name} to cart. Will sync when you reconnect.", { name: s.name || "product" }) });
|
|
297
|
+
return derive({ ...s, adding: false, added: false, cartHint: copyTemplate("product.cartHintQueued", "Added {name} to cart. Will sync when you reconnect.", { name: s.name || "product" }) });
|
|
273
298
|
}
|
|
274
|
-
|
|
299
|
+
// Roll the optimistic badge back — nothing was added.
|
|
300
|
+
return derive({ ...s, adding: false, added: false, cartCount: before, cartHint: copyParam("product.cartHintFailed", "Could not add to cart. Try again.") });
|
|
275
301
|
}
|
|
302
|
+
// The write LANDED. The badge re-read is outside the write's try on purpose: a failed
|
|
303
|
+
// count must never be mistaken for a failed add. Server count wins; else keep optimistic.
|
|
304
|
+
const count = await cartItemCount().catch(() => 0);
|
|
305
|
+
return derive({ ...s, adding: false, added: true, cartHint: copyTemplate("product.cartHintAdded", "Added {name} to cart.", { name: s.name || "product" }), cartCount: count || s.cartCount });
|
|
276
306
|
},
|
|
277
307
|
toggleSave: (s) => {
|
|
278
308
|
if (s.status !== "ready" || !s.name || !inputId()) return s;
|
|
@@ -291,7 +321,8 @@ const svc = defineService<S, {
|
|
|
291
321
|
await shareSheet({ subject: s.name, text: s.name, ...(s.shareUrl ? { url: s.shareUrl } : {}) });
|
|
292
322
|
return s;
|
|
293
323
|
} catch {
|
|
294
|
-
|
|
324
|
+
// `added: false` — this hint must not render inside the add-to-cart confirmation.
|
|
325
|
+
return derive({ ...s, added: false, cartHint: copyParam("product.shareUnavailable", "Sharing is not available on this device.") });
|
|
295
326
|
}
|
|
296
327
|
},
|
|
297
328
|
},
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
import { defineService } from "@himalaya/state";
|
|
6
6
|
import { dispatch } from "@himalaya/dispatch";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** `selected` drives the row's radio; `subtitle` stays for older descriptors. */
|
|
9
|
+
interface Row { id: string; name: string; subtitle: string; selected: boolean }
|
|
9
10
|
interface S { status: "ready"; options: Row[] }
|
|
10
11
|
|
|
11
12
|
/** Locales with catalogs (`tools/l10n/catalog.<tag>.json`) + LocaleStore support. */
|
|
12
|
-
const LOCALE_OPTIONS: Omit<Row, "subtitle">[] = [
|
|
13
|
+
const LOCALE_OPTIONS: Omit<Row, "subtitle" | "selected">[] = [
|
|
13
14
|
{ id: "en", name: "English" },
|
|
14
15
|
{ id: "es", name: "Español" },
|
|
15
16
|
{ id: "he", name: "עברית" },
|
|
@@ -19,6 +20,7 @@ function withSelected(selected: string): Row[] {
|
|
|
19
20
|
return LOCALE_OPTIONS.map((o) => ({
|
|
20
21
|
...o,
|
|
21
22
|
subtitle: o.id === selected ? "Selected" : "",
|
|
23
|
+
selected: o.id === selected,
|
|
22
24
|
}));
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -37,7 +37,7 @@ export default defineApp({
|
|
|
37
37
|
actions: "http://localhost:8190/v1/actions",
|
|
38
38
|
sync: "http://localhost:8190/v1/sync",
|
|
39
39
|
},
|
|
40
|
-
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui"],
|
|
40
|
+
capabilities: ["live_activity","push","share","secure_storage","open_url","local_database","clipboard","ui","camera","presigned_upload"],
|
|
41
41
|
designTokensPath: "./tokens.json",
|
|
42
42
|
navigation: {
|
|
43
43
|
"navKind": "responsive",
|
|
@@ -50304,7 +50304,7 @@ const SCREENS = runtimeSetting({
|
|
|
50304
50304
|
"itemsPath": "$service:himiOwnerLiteManage.recents",
|
|
50305
50305
|
"items": [
|
|
50306
50306
|
{
|
|
50307
|
-
"id": "",
|
|
50307
|
+
"id": "himi_owner_lite.manage.recent.$item.id",
|
|
50308
50308
|
"body": {
|
|
50309
50309
|
"package": "himalaya",
|
|
50310
50310
|
"type": "VStack",
|
|
@@ -50449,7 +50449,7 @@ const SCREENS = runtimeSetting({
|
|
|
50449
50449
|
"spacing": 14,
|
|
50450
50450
|
"children": [
|
|
50451
50451
|
{
|
|
50452
|
-
"id": "",
|
|
50452
|
+
"id": "himi_owner_lite.manage.recent.create.$item.id",
|
|
50453
50453
|
"body": {
|
|
50454
50454
|
"package": "himalaya",
|
|
50455
50455
|
"type": "Text",
|
|
@@ -50474,7 +50474,7 @@ const SCREENS = runtimeSetting({
|
|
|
50474
50474
|
}
|
|
50475
50475
|
},
|
|
50476
50476
|
{
|
|
50477
|
-
"id": "",
|
|
50477
|
+
"id": "himi_owner_lite.manage.recent.handoff.$item.id",
|
|
50478
50478
|
"body": {
|
|
50479
50479
|
"package": "himalaya",
|
|
50480
50480
|
"type": "Text",
|
|
@@ -50610,7 +50610,7 @@ const SCREENS = runtimeSetting({
|
|
|
50610
50610
|
"itemsPath": "$item.areas",
|
|
50611
50611
|
"items": [
|
|
50612
50612
|
{
|
|
50613
|
-
"id": "",
|
|
50613
|
+
"id": "himi_owner_lite.manage.area.$item.id",
|
|
50614
50614
|
"body": {
|
|
50615
50615
|
"package": "himalaya",
|
|
50616
50616
|
"type": "VStack",
|
|
@@ -50755,7 +50755,7 @@ const SCREENS = runtimeSetting({
|
|
|
50755
50755
|
"spacing": 14,
|
|
50756
50756
|
"children": [
|
|
50757
50757
|
{
|
|
50758
|
-
"id": "",
|
|
50758
|
+
"id": "himi_owner_lite.manage.area.create.$item.id",
|
|
50759
50759
|
"body": {
|
|
50760
50760
|
"package": "himalaya",
|
|
50761
50761
|
"type": "Text",
|
|
@@ -50780,7 +50780,7 @@ const SCREENS = runtimeSetting({
|
|
|
50780
50780
|
}
|
|
50781
50781
|
},
|
|
50782
50782
|
{
|
|
50783
|
-
"id": "",
|
|
50783
|
+
"id": "himi_owner_lite.manage.area.handoff.$item.id",
|
|
50784
50784
|
"body": {
|
|
50785
50785
|
"package": "himalaya",
|
|
50786
50786
|
"type": "Text",
|
|
@@ -51560,7 +51560,7 @@ const SCREENS = runtimeSetting({
|
|
|
51560
51560
|
"props": {
|
|
51561
51561
|
"items": [
|
|
51562
51562
|
{
|
|
51563
|
-
"id": "",
|
|
51563
|
+
"id": "ol_drawer_nav.$item.id",
|
|
51564
51564
|
"body": {
|
|
51565
51565
|
"package": "himalaya",
|
|
51566
51566
|
"type": "ListItem",
|
|
@@ -51612,7 +51612,7 @@ const SCREENS = runtimeSetting({
|
|
|
51612
51612
|
"props": {
|
|
51613
51613
|
"items": [
|
|
51614
51614
|
{
|
|
51615
|
-
"id": "",
|
|
51615
|
+
"id": "ol_drawer_attention.$item.id",
|
|
51616
51616
|
"body": {
|
|
51617
51617
|
"package": "himalaya",
|
|
51618
51618
|
"type": "ListItem",
|
|
@@ -55173,6 +55173,45 @@ const SCREENS = runtimeSetting({
|
|
|
55173
55173
|
}
|
|
55174
55174
|
}
|
|
55175
55175
|
},
|
|
55176
|
+
{
|
|
55177
|
+
"id": "himi_owner_lite_aria.msg_attach_$item.id",
|
|
55178
|
+
"body": {
|
|
55179
|
+
"package": "himalaya",
|
|
55180
|
+
"type": "HStack",
|
|
55181
|
+
"props": {
|
|
55182
|
+
"spacing": 0,
|
|
55183
|
+
"children": [
|
|
55184
|
+
{
|
|
55185
|
+
"id": "",
|
|
55186
|
+
"body": {
|
|
55187
|
+
"package": "himalaya",
|
|
55188
|
+
"type": "Spacer",
|
|
55189
|
+
"props": {}
|
|
55190
|
+
},
|
|
55191
|
+
"modifiers": {
|
|
55192
|
+
"hiddenPath": "$item.notUser"
|
|
55193
|
+
}
|
|
55194
|
+
},
|
|
55195
|
+
{
|
|
55196
|
+
"id": "",
|
|
55197
|
+
"body": {
|
|
55198
|
+
"package": "himalaya",
|
|
55199
|
+
"type": "Text",
|
|
55200
|
+
"props": {
|
|
55201
|
+
"text": "$item.attachText",
|
|
55202
|
+
"style": "footnote",
|
|
55203
|
+
"color": "textSecondary",
|
|
55204
|
+
"maxLines": 3
|
|
55205
|
+
}
|
|
55206
|
+
}
|
|
55207
|
+
}
|
|
55208
|
+
]
|
|
55209
|
+
}
|
|
55210
|
+
},
|
|
55211
|
+
"modifiers": {
|
|
55212
|
+
"hiddenPath": "$item.attachHidden"
|
|
55213
|
+
}
|
|
55214
|
+
},
|
|
55176
55215
|
{
|
|
55177
55216
|
"id": "himi_owner_lite_aria.msg_$item.id.link1",
|
|
55178
55217
|
"body": {
|
|
@@ -58753,6 +58792,203 @@ const SCREENS = runtimeSetting({
|
|
|
58753
58792
|
}
|
|
58754
58793
|
}
|
|
58755
58794
|
},
|
|
58795
|
+
{
|
|
58796
|
+
"id": "himi_owner_lite_aria.attachments.bound",
|
|
58797
|
+
"body": {
|
|
58798
|
+
"package": "himalaya",
|
|
58799
|
+
"type": "LazyList",
|
|
58800
|
+
"props": {
|
|
58801
|
+
"itemsPath": "$service:himiOwnerLiteAria.attachments",
|
|
58802
|
+
"horizontal": true,
|
|
58803
|
+
"spacing": 8,
|
|
58804
|
+
"items": [
|
|
58805
|
+
{
|
|
58806
|
+
"id": "himi_owner_lite_aria.attachment_$item.id",
|
|
58807
|
+
"body": {
|
|
58808
|
+
"package": "himalaya",
|
|
58809
|
+
"type": "VStack",
|
|
58810
|
+
"props": {
|
|
58811
|
+
"spacing": 4,
|
|
58812
|
+
"children": [
|
|
58813
|
+
{
|
|
58814
|
+
"id": "himi_owner_lite_aria.attachment_thumb_$item.id",
|
|
58815
|
+
"body": {
|
|
58816
|
+
"package": "himalaya",
|
|
58817
|
+
"type": "Image",
|
|
58818
|
+
"props": {
|
|
58819
|
+
"url": "$item.thumbUrl",
|
|
58820
|
+
"width": 72,
|
|
58821
|
+
"height": 72,
|
|
58822
|
+
"contentMode": "fill",
|
|
58823
|
+
"shape": "rounded",
|
|
58824
|
+
"contentDescription": "$item.name"
|
|
58825
|
+
}
|
|
58826
|
+
},
|
|
58827
|
+
"modifiers": {
|
|
58828
|
+
"hiddenPath": "$item.thumbHidden"
|
|
58829
|
+
}
|
|
58830
|
+
},
|
|
58831
|
+
{
|
|
58832
|
+
"id": "",
|
|
58833
|
+
"body": {
|
|
58834
|
+
"package": "himalaya",
|
|
58835
|
+
"type": "Text",
|
|
58836
|
+
"props": {
|
|
58837
|
+
"text": "$item.statusText",
|
|
58838
|
+
"style": "caption",
|
|
58839
|
+
"color": "textSecondary",
|
|
58840
|
+
"maxLines": 2
|
|
58841
|
+
}
|
|
58842
|
+
},
|
|
58843
|
+
"modifiers": {
|
|
58844
|
+
"hiddenPath": "$item.statusHidden"
|
|
58845
|
+
}
|
|
58846
|
+
},
|
|
58847
|
+
{
|
|
58848
|
+
"id": "",
|
|
58849
|
+
"body": {
|
|
58850
|
+
"package": "himalaya",
|
|
58851
|
+
"type": "HStack",
|
|
58852
|
+
"props": {
|
|
58853
|
+
"spacing": 8,
|
|
58854
|
+
"children": [
|
|
58855
|
+
{
|
|
58856
|
+
"id": "himi_owner_lite_aria.attachment_retry_$item.id",
|
|
58857
|
+
"body": {
|
|
58858
|
+
"package": "himalaya",
|
|
58859
|
+
"type": "Text",
|
|
58860
|
+
"props": {
|
|
58861
|
+
"text": "Retry",
|
|
58862
|
+
"style": "caption",
|
|
58863
|
+
"color": "accentPrimary",
|
|
58864
|
+
"maxLines": 1
|
|
58865
|
+
}
|
|
58866
|
+
},
|
|
58867
|
+
"modifiers": {
|
|
58868
|
+
"onTap": {
|
|
58869
|
+
"actionId": "tier5.himiOwnerLiteAria.retryAttachment",
|
|
58870
|
+
"params": {
|
|
58871
|
+
"id": "$item.id"
|
|
58872
|
+
}
|
|
58873
|
+
},
|
|
58874
|
+
"hiddenPath": "$item.retryHidden"
|
|
58875
|
+
}
|
|
58876
|
+
},
|
|
58877
|
+
{
|
|
58878
|
+
"id": "himi_owner_lite_aria.attachment_remove_$item.id",
|
|
58879
|
+
"body": {
|
|
58880
|
+
"package": "himalaya",
|
|
58881
|
+
"type": "Icon",
|
|
58882
|
+
"props": {
|
|
58883
|
+
"name": "close",
|
|
58884
|
+
"size": 14,
|
|
58885
|
+
"tint": "textSecondary"
|
|
58886
|
+
}
|
|
58887
|
+
},
|
|
58888
|
+
"modifiers": {
|
|
58889
|
+
"onTap": {
|
|
58890
|
+
"actionId": "tier5.himiOwnerLiteAria.removeAttachment",
|
|
58891
|
+
"params": {
|
|
58892
|
+
"id": "$item.id"
|
|
58893
|
+
}
|
|
58894
|
+
},
|
|
58895
|
+
"accessibilityLabel": "Remove photo"
|
|
58896
|
+
}
|
|
58897
|
+
}
|
|
58898
|
+
]
|
|
58899
|
+
}
|
|
58900
|
+
}
|
|
58901
|
+
}
|
|
58902
|
+
]
|
|
58903
|
+
}
|
|
58904
|
+
},
|
|
58905
|
+
"modifiers": {
|
|
58906
|
+
"width": 72
|
|
58907
|
+
}
|
|
58908
|
+
}
|
|
58909
|
+
]
|
|
58910
|
+
}
|
|
58911
|
+
},
|
|
58912
|
+
"modifiers": {
|
|
58913
|
+
"hiddenPath": "$service:himiOwnerLiteAria.attachmentsHidden",
|
|
58914
|
+
"padding": {
|
|
58915
|
+
"leading": 0,
|
|
58916
|
+
"trailing": 0,
|
|
58917
|
+
"top": 8,
|
|
58918
|
+
"bottom": 0
|
|
58919
|
+
}
|
|
58920
|
+
}
|
|
58921
|
+
},
|
|
58922
|
+
{
|
|
58923
|
+
"id": "",
|
|
58924
|
+
"body": {
|
|
58925
|
+
"package": "himalaya",
|
|
58926
|
+
"type": "HStack",
|
|
58927
|
+
"props": {
|
|
58928
|
+
"spacing": 16,
|
|
58929
|
+
"children": [
|
|
58930
|
+
{
|
|
58931
|
+
"id": "himi_owner_lite_aria.attach.library",
|
|
58932
|
+
"body": {
|
|
58933
|
+
"package": "himalaya",
|
|
58934
|
+
"type": "Icon",
|
|
58935
|
+
"props": {
|
|
58936
|
+
"name": "image",
|
|
58937
|
+
"size": 22,
|
|
58938
|
+
"tint": "accentPrimary"
|
|
58939
|
+
}
|
|
58940
|
+
},
|
|
58941
|
+
"modifiers": {
|
|
58942
|
+
"onTap": {
|
|
58943
|
+
"actionId": "tier5.himiOwnerLiteAria.attach",
|
|
58944
|
+
"params": {
|
|
58945
|
+
"source": "library"
|
|
58946
|
+
}
|
|
58947
|
+
},
|
|
58948
|
+
"accessibilityLabel": "Add a photo"
|
|
58949
|
+
}
|
|
58950
|
+
},
|
|
58951
|
+
{
|
|
58952
|
+
"id": "himi_owner_lite_aria.attach.camera",
|
|
58953
|
+
"body": {
|
|
58954
|
+
"package": "himalaya",
|
|
58955
|
+
"type": "Icon",
|
|
58956
|
+
"props": {
|
|
58957
|
+
"name": "camera",
|
|
58958
|
+
"size": 22,
|
|
58959
|
+
"tint": "accentPrimary"
|
|
58960
|
+
}
|
|
58961
|
+
},
|
|
58962
|
+
"modifiers": {
|
|
58963
|
+
"onTap": {
|
|
58964
|
+
"actionId": "tier5.himiOwnerLiteAria.attach",
|
|
58965
|
+
"params": {
|
|
58966
|
+
"source": "camera"
|
|
58967
|
+
}
|
|
58968
|
+
},
|
|
58969
|
+
"accessibilityLabel": "Take a photo"
|
|
58970
|
+
}
|
|
58971
|
+
},
|
|
58972
|
+
{
|
|
58973
|
+
"id": "",
|
|
58974
|
+
"body": {
|
|
58975
|
+
"package": "himalaya",
|
|
58976
|
+
"type": "Spacer",
|
|
58977
|
+
"props": {}
|
|
58978
|
+
}
|
|
58979
|
+
}
|
|
58980
|
+
]
|
|
58981
|
+
}
|
|
58982
|
+
},
|
|
58983
|
+
"modifiers": {
|
|
58984
|
+
"padding": {
|
|
58985
|
+
"leading": 0,
|
|
58986
|
+
"trailing": 0,
|
|
58987
|
+
"top": 8,
|
|
58988
|
+
"bottom": 0
|
|
58989
|
+
}
|
|
58990
|
+
}
|
|
58991
|
+
},
|
|
58756
58992
|
{
|
|
58757
58993
|
"id": "form_aria",
|
|
58758
58994
|
"body": {
|
|
@@ -58838,7 +59074,9 @@ const SCREENS = runtimeSetting({
|
|
|
58838
59074
|
"wix_api",
|
|
58839
59075
|
"open_url",
|
|
58840
59076
|
"clipboard",
|
|
58841
|
-
"ui"
|
|
59077
|
+
"ui",
|
|
59078
|
+
"camera",
|
|
59079
|
+
"presigned_upload"
|
|
58842
59080
|
],
|
|
58843
59081
|
"minBinaryVersion": "0.1.0",
|
|
58844
59082
|
"bundleVersion": "0.0.1"
|