@wix/himalaya-cli 0.1030.0 → 0.1032.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 +386 -132
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/mobile-ux.md +3 -2
- package/guides/qa-builds.md +22 -13
- package/guides/sdk-reference.json +50 -2
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/_shared/owner-load-error.ts +7 -1
- 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/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/tier5-src/_shared/owner-load-error.ts +7 -1
- package/templates/community-club/tier5-src/_shared/owner-load-error.ts +7 -1
- 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/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/tier5-src/_shared/owner-load-error.ts +7 -1
- 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/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/tier5-src/_shared/owner-load-error.ts +7 -1
- 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/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/tier5-src/_shared/owner-load-error.ts +7 -1
- 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/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/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/tier5-src/_shared/owner-load-error.ts +7 -1
- 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/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/tier5-src/_shared/owner-load-error.ts +7 -1
- 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/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/tier5-src/_shared/owner-load-error.ts +7 -1
- 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/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/tier5-src/_shared/owner-load-error.ts +7 -1
- 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/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/surface-showcase/dev/index.ts +1 -1
- package/templates/yoga-studio/tier5-src/_shared/owner-load-error.ts +7 -1
- 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/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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { WixBooking } from "@himalaya/wix-bookings";
|
|
2
|
+
|
|
3
|
+
/** The booking statuses an owner still has to show up for. ONE list for every surface that
|
|
4
|
+
* says "upcoming appointments" — Home's KPI and Manage's Appointments summary used to ask
|
|
5
|
+
* the server two different questions (`$in` these vs `$nin` CANCELED/DECLINED) and Manage
|
|
6
|
+
* then trusted whatever came back, so the two screens could disagree on the same business
|
|
7
|
+
* (Home 9, Manage 11 on the same hermetic fixtures). */
|
|
8
|
+
export const UPCOMING_BOOKING_STATUSES = ["CONFIRMED", "PENDING", "PENDING_APPROVAL", "WAITING_LIST", "CREATED"];
|
|
9
|
+
|
|
10
|
+
/** Count the loaded bookings that are still upcoming. Applied to the response even though
|
|
11
|
+
* the query already filters: a server (or a fixture) that returns a cancelled or past row
|
|
12
|
+
* must not turn it into an appointment the owner is told to expect. */
|
|
13
|
+
export function upcomingBookingCount(bookings: WixBooking[], now: number): number {
|
|
14
|
+
return bookings.filter((booking) => {
|
|
15
|
+
if (!UPCOMING_BOOKING_STATUSES.includes((booking.status ?? "").toUpperCase())) return false;
|
|
16
|
+
const start = booking.startDate || booking.bookedEntity?.slot?.startDate;
|
|
17
|
+
const ms = start ? new Date(start).getTime() : NaN;
|
|
18
|
+
return Number.isFinite(ms) && ms >= now;
|
|
19
|
+
}).length;
|
|
20
|
+
}
|
|
@@ -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
|
}
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
import { defineService } from "@himalaya/state";
|
|
28
28
|
import { open } from "@himalaya/open-url";
|
|
29
29
|
import { writeText } from "@himalaya/clipboard";
|
|
30
|
+
import { capturePhoto } from "@himalaya/camera";
|
|
31
|
+
import { put } from "@himalaya/presigned-upload";
|
|
30
32
|
import { alert } from "@himalaya/ui";
|
|
31
33
|
import {
|
|
32
34
|
activeSiteId,
|
|
@@ -36,7 +38,7 @@ import {
|
|
|
36
38
|
type AriaPromptChip,
|
|
37
39
|
} from "../_shared/aria-chat.js";
|
|
38
40
|
import { WIDGET_SUBTREE_SLOT } from "../_shared/aria-generic-widget.js";
|
|
39
|
-
import { copyParam, stashCopy } from "../_shared/himi-copy.js";
|
|
41
|
+
import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
|
|
40
42
|
import { OWNER_MODULES, ownerModuleIds, ownerModuleScreen } from "../_shared/owner-modules.js";
|
|
41
43
|
|
|
42
44
|
const SERVICE = "himiOwnerLiteAria";
|
|
@@ -199,6 +201,14 @@ const core = createAriaChat({
|
|
|
199
201
|
// English. Says no "sign in": the owner already is, and the missing piece is
|
|
200
202
|
// the app's binding, so there is no action for them to take.
|
|
201
203
|
unavailable: () => copyParam("ownerAria.unavailable", "Aria can't reach your Wix account from here."),
|
|
204
|
+
attachUploading: () => copyParam("ownerAria.attach.uploading", "Uploading…"),
|
|
205
|
+
attachFailed: () => copyParam("ownerAria.attach.failed", "Couldn't upload"),
|
|
206
|
+
attachTooMany: (max) => copyTemplate("ownerAria.attach.tooMany", "You can attach up to {max} photos.", { max }),
|
|
207
|
+
attachUnsupported: () => copyParam("ownerAria.attach.unsupported", "That file type can't be attached."),
|
|
208
|
+
attachTooLarge: (mb) => copyTemplate("ownerAria.attach.tooLarge", "That photo is too large to attach (up to {mb} MB).", { mb }),
|
|
209
|
+
attachWaitUploading: () => copyParam("ownerAria.attach.waitUploading", "Wait for your photo to finish uploading."),
|
|
210
|
+
attachWaitFailed: () => copyParam("ownerAria.attach.waitFailed", "Retry or remove the photo that didn't upload."),
|
|
211
|
+
attachNeedsText: () => copyParam("ownerAria.attach.needsText", "Add a message to send with your photo."),
|
|
202
212
|
toolFailed: () => copyParam("ownerAria.toolFailed", "Aria couldn't finish that. Try again."),
|
|
203
213
|
},
|
|
204
214
|
clientTools: { confirm: confirmWithOwner, userAgent },
|
|
@@ -221,6 +231,25 @@ const core = createAriaChat({
|
|
|
221
231
|
return screenId ? { screenId } : null;
|
|
222
232
|
},
|
|
223
233
|
poll: { action: `${SERVICE}.tick`, fastMs: FAST_MS, idleMs: IDLE_MS },
|
|
234
|
+
// Photo attachments. The two device capabilities live HERE rather than
|
|
235
|
+
// in the shared core so that only a screen which declares them imports them:
|
|
236
|
+
// `camera` for the picker (it returns the image already re-encoded as JPEG and
|
|
237
|
+
// scaled to 2048 px on its longest side, which is also what keeps a phone
|
|
238
|
+
// photo inside the inline upload bound) and `presigned_upload` for the bytes,
|
|
239
|
+
// which go to a self-authorizing url with no Wix credential attached.
|
|
240
|
+
attachments: {
|
|
241
|
+
pick: async (source) => {
|
|
242
|
+
const asset = await capturePhoto({ source, maxEdgePixels: 2048 });
|
|
243
|
+
return asset ? { dataUri: asset.uri, mimeType: asset.mime } : null;
|
|
244
|
+
},
|
|
245
|
+
put: async (url, base64, contentType) => {
|
|
246
|
+
const r = await put(url, { base64 }, { contentType, method: "PUT" });
|
|
247
|
+
return { ok: r.ok, status: r.status };
|
|
248
|
+
},
|
|
249
|
+
// A NEW action on the service, not a return value: the upload outlives the
|
|
250
|
+
// `attach` that started it. `svc` is read at call time, long after it exists.
|
|
251
|
+
settled: (outcome) => { void svc.attachmentSettled(outcome); },
|
|
252
|
+
},
|
|
224
253
|
});
|
|
225
254
|
|
|
226
255
|
const svc = defineService<AriaChatState, {
|
|
@@ -252,6 +281,10 @@ const svc = defineService<AriaChatState, {
|
|
|
252
281
|
widgetPick: (s: AriaChatState, arg?: AriaActionArg) => AriaChatState;
|
|
253
282
|
widgetQuery: (s: AriaChatState, arg?: AriaActionArg) => AriaChatState;
|
|
254
283
|
widgetAnswer: (s: AriaChatState, arg?: AriaActionArg) => AriaChatState;
|
|
284
|
+
attach: (s: AriaChatState, arg?: AriaActionArg) => Promise<AriaChatState>;
|
|
285
|
+
attachmentSettled: (s: AriaChatState, arg?: AriaActionArg) => AriaChatState;
|
|
286
|
+
removeAttachment: (s: AriaChatState, arg?: AriaActionArg) => AriaChatState;
|
|
287
|
+
retryAttachment: (s: AriaChatState, arg?: AriaActionArg) => AriaChatState;
|
|
255
288
|
}>(SERVICE, {
|
|
256
289
|
state: core.initialState,
|
|
257
290
|
actions: {
|
|
@@ -288,6 +321,12 @@ const svc = defineService<AriaChatState, {
|
|
|
288
321
|
widgetPick: core.widgetPick,
|
|
289
322
|
widgetQuery: core.widgetQuery,
|
|
290
323
|
widgetAnswer: core.widgetAnswer,
|
|
324
|
+
// The composer's photos. `attachmentSettled` is dispatched by the upload
|
|
325
|
+
// itself (see `attachments.settled` above), never by the descriptor.
|
|
326
|
+
attach: core.attach,
|
|
327
|
+
attachmentSettled: core.attachmentSettled,
|
|
328
|
+
removeAttachment: core.removeAttachment,
|
|
329
|
+
retryAttachment: core.retryAttachment,
|
|
291
330
|
},
|
|
292
331
|
});
|
|
293
332
|
|
|
@@ -8,7 +8,8 @@ import { queryPosts } from "@himalaya/wix-blog";
|
|
|
8
8
|
import { queryEvents, startDateOf, type WixEvent } from "../_shared/himi-events.js";
|
|
9
9
|
import { countSites } from "@himalaya/wix-site-list";
|
|
10
10
|
import { searchOrders, type WixOrder } from "@himalaya/wix-ecom";
|
|
11
|
-
import { queryBookings
|
|
11
|
+
import { queryBookings } from "@himalaya/wix-bookings";
|
|
12
|
+
import { UPCOMING_BOOKING_STATUSES, upcomingBookingCount } from "../_shared/owner-bookings.js";
|
|
12
13
|
import { queryMembers } from "@himalaya/wix-members";
|
|
13
14
|
import { queryReviews } from "@himalaya/wix-reviews";
|
|
14
15
|
import { queryReservations } from "@himalaya/wix-table-reservations";
|
|
@@ -88,7 +89,6 @@ const PAGE = 100;
|
|
|
88
89
|
const TODAY_PAGE = 50;
|
|
89
90
|
const EVENT_SCAN_MAX_PAGES = 5;
|
|
90
91
|
const EVENT_SCAN_MAX_RECORDS = 500;
|
|
91
|
-
const UPCOMING_BOOKING_STATUSES = ["CONFIRMED", "PENDING", "PENDING_APPROVAL", "WAITING_LIST", "CREATED"];
|
|
92
92
|
const UPCOMING_RESERVATION_STATUSES = ["HELD", "RESERVED", "REQUESTED"];
|
|
93
93
|
const UPCOMING_EVENT_STATUSES = ["UPCOMING", "SCHEDULED"];
|
|
94
94
|
const ATTENTION_MEMBER_STATUSES = ["PENDING"];
|
|
@@ -314,16 +314,6 @@ async function measuredRevenue7d(
|
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
function upcomingBookingCount(bookings: WixBooking[], now: number): number {
|
|
318
|
-
const valid = ["CONFIRMED", "PENDING", "PENDING_APPROVAL", "WAITING_LIST", "CREATED"];
|
|
319
|
-
return bookings.filter((booking) => {
|
|
320
|
-
if (!valid.includes((booking.status ?? "").toUpperCase())) return false;
|
|
321
|
-
const start = booking.startDate || booking.bookedEntity?.slot?.startDate;
|
|
322
|
-
const ms = start ? new Date(start).getTime() : NaN;
|
|
323
|
-
return Number.isFinite(ms) && ms >= now;
|
|
324
|
-
}).length;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
317
|
function enabledSourcesFrom(value: unknown): HomeSourceId[] | undefined {
|
|
328
318
|
if (!value || typeof value !== "object" || Array.isArray(value)) return undefined;
|
|
329
319
|
const holder = value as Record<string, unknown>;
|
|
@@ -7,7 +7,8 @@ import { defineService, navigate } from '@himalaya/state';
|
|
|
7
7
|
import { open } from '@himalaya/open-url';
|
|
8
8
|
import { queryStoreProducts } from '../_shared/himi-store.js';
|
|
9
9
|
import { searchOrders } from '@himalaya/wix-ecom';
|
|
10
|
-
import { queryBookings, queryServices } from '@himalaya/wix-bookings';
|
|
10
|
+
import { queryBookings, queryServices, type WixBooking } from '@himalaya/wix-bookings';
|
|
11
|
+
import { UPCOMING_BOOKING_STATUSES, upcomingBookingCount } from '../_shared/owner-bookings.js';
|
|
11
12
|
import { queryEvents, startDateOf } from '../_shared/himi-events.js';
|
|
12
13
|
import { queryPosts, queryDraftPosts } from '@himalaya/wix-blog';
|
|
13
14
|
import { queryQuestionEntries } from '@himalaya/wix-faq';
|
|
@@ -90,9 +91,14 @@ async function metricFor(metricKey: string): Promise<Metric> {
|
|
|
90
91
|
return partialCount(response, 'services');
|
|
91
92
|
}
|
|
92
93
|
case 'appointments': {
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
const
|
|
94
|
+
// Same question, same count as Home's "Upcoming appointments" (_shared/owner-bookings).
|
|
95
|
+
const nowMs = Date.now();
|
|
96
|
+
const response = await queryBookings({ query: { filter: { startDate: { $gte: new Date(nowMs).toISOString() }, status: { $in: UPCOMING_BOOKING_STATUSES } }, paging: { limit: PAGE, offset: 0 } } });
|
|
97
|
+
const page = partialCount(response, 'bookings');
|
|
98
|
+
const loaded = rows(response, 'bookings');
|
|
99
|
+
// Counted from the loaded page, so it is partial ("+") whenever the server holds more
|
|
100
|
+
// than that page — by its total, its cursor, or a full page — exactly as Home marks it.
|
|
101
|
+
const metric = { count: upcomingBookingCount(loaded as WixBooking[], nowMs), hasMore: page.hasMore || page.count > loaded.length || loaded.length >= PAGE };
|
|
96
102
|
return { ...metric, statusText: metric.count
|
|
97
103
|
? copyTemplate('ownerManage.appointmentsUpcoming', '{count} upcoming', { count: metric.count })
|
|
98
104
|
: copyParam('ownerManage.appointmentsClear', 'No upcoming appointments') };
|
|
@@ -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
|
}
|
|
@@ -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",
|
|
@@ -50387,7 +50387,7 @@ const SCREENS = runtimeSetting({
|
|
|
50387
50387
|
"itemsPath": "$service:himiOwnerLiteManage.recents",
|
|
50388
50388
|
"items": [
|
|
50389
50389
|
{
|
|
50390
|
-
"id": "",
|
|
50390
|
+
"id": "himi_owner_lite.manage.recent.$item.id",
|
|
50391
50391
|
"body": {
|
|
50392
50392
|
"package": "himalaya",
|
|
50393
50393
|
"type": "VStack",
|
|
@@ -50532,7 +50532,7 @@ const SCREENS = runtimeSetting({
|
|
|
50532
50532
|
"spacing": 14,
|
|
50533
50533
|
"children": [
|
|
50534
50534
|
{
|
|
50535
|
-
"id": "",
|
|
50535
|
+
"id": "himi_owner_lite.manage.recent.create.$item.id",
|
|
50536
50536
|
"body": {
|
|
50537
50537
|
"package": "himalaya",
|
|
50538
50538
|
"type": "Text",
|
|
@@ -50557,7 +50557,7 @@ const SCREENS = runtimeSetting({
|
|
|
50557
50557
|
}
|
|
50558
50558
|
},
|
|
50559
50559
|
{
|
|
50560
|
-
"id": "",
|
|
50560
|
+
"id": "himi_owner_lite.manage.recent.handoff.$item.id",
|
|
50561
50561
|
"body": {
|
|
50562
50562
|
"package": "himalaya",
|
|
50563
50563
|
"type": "Text",
|
|
@@ -50693,7 +50693,7 @@ const SCREENS = runtimeSetting({
|
|
|
50693
50693
|
"itemsPath": "$item.areas",
|
|
50694
50694
|
"items": [
|
|
50695
50695
|
{
|
|
50696
|
-
"id": "",
|
|
50696
|
+
"id": "himi_owner_lite.manage.area.$item.id",
|
|
50697
50697
|
"body": {
|
|
50698
50698
|
"package": "himalaya",
|
|
50699
50699
|
"type": "VStack",
|
|
@@ -50838,7 +50838,7 @@ const SCREENS = runtimeSetting({
|
|
|
50838
50838
|
"spacing": 14,
|
|
50839
50839
|
"children": [
|
|
50840
50840
|
{
|
|
50841
|
-
"id": "",
|
|
50841
|
+
"id": "himi_owner_lite.manage.area.create.$item.id",
|
|
50842
50842
|
"body": {
|
|
50843
50843
|
"package": "himalaya",
|
|
50844
50844
|
"type": "Text",
|
|
@@ -50863,7 +50863,7 @@ const SCREENS = runtimeSetting({
|
|
|
50863
50863
|
}
|
|
50864
50864
|
},
|
|
50865
50865
|
{
|
|
50866
|
-
"id": "",
|
|
50866
|
+
"id": "himi_owner_lite.manage.area.handoff.$item.id",
|
|
50867
50867
|
"body": {
|
|
50868
50868
|
"package": "himalaya",
|
|
50869
50869
|
"type": "Text",
|
|
@@ -51643,7 +51643,7 @@ const SCREENS = runtimeSetting({
|
|
|
51643
51643
|
"props": {
|
|
51644
51644
|
"items": [
|
|
51645
51645
|
{
|
|
51646
|
-
"id": "",
|
|
51646
|
+
"id": "ol_drawer_nav.$item.id",
|
|
51647
51647
|
"body": {
|
|
51648
51648
|
"package": "himalaya",
|
|
51649
51649
|
"type": "ListItem",
|
|
@@ -51695,7 +51695,7 @@ const SCREENS = runtimeSetting({
|
|
|
51695
51695
|
"props": {
|
|
51696
51696
|
"items": [
|
|
51697
51697
|
{
|
|
51698
|
-
"id": "",
|
|
51698
|
+
"id": "ol_drawer_attention.$item.id",
|
|
51699
51699
|
"body": {
|
|
51700
51700
|
"package": "himalaya",
|
|
51701
51701
|
"type": "ListItem",
|
|
@@ -55256,6 +55256,45 @@ const SCREENS = runtimeSetting({
|
|
|
55256
55256
|
}
|
|
55257
55257
|
}
|
|
55258
55258
|
},
|
|
55259
|
+
{
|
|
55260
|
+
"id": "himi_owner_lite_aria.msg_attach_$item.id",
|
|
55261
|
+
"body": {
|
|
55262
|
+
"package": "himalaya",
|
|
55263
|
+
"type": "HStack",
|
|
55264
|
+
"props": {
|
|
55265
|
+
"spacing": 0,
|
|
55266
|
+
"children": [
|
|
55267
|
+
{
|
|
55268
|
+
"id": "",
|
|
55269
|
+
"body": {
|
|
55270
|
+
"package": "himalaya",
|
|
55271
|
+
"type": "Spacer",
|
|
55272
|
+
"props": {}
|
|
55273
|
+
},
|
|
55274
|
+
"modifiers": {
|
|
55275
|
+
"hiddenPath": "$item.notUser"
|
|
55276
|
+
}
|
|
55277
|
+
},
|
|
55278
|
+
{
|
|
55279
|
+
"id": "",
|
|
55280
|
+
"body": {
|
|
55281
|
+
"package": "himalaya",
|
|
55282
|
+
"type": "Text",
|
|
55283
|
+
"props": {
|
|
55284
|
+
"text": "$item.attachText",
|
|
55285
|
+
"style": "footnote",
|
|
55286
|
+
"color": "textSecondary",
|
|
55287
|
+
"maxLines": 3
|
|
55288
|
+
}
|
|
55289
|
+
}
|
|
55290
|
+
}
|
|
55291
|
+
]
|
|
55292
|
+
}
|
|
55293
|
+
},
|
|
55294
|
+
"modifiers": {
|
|
55295
|
+
"hiddenPath": "$item.attachHidden"
|
|
55296
|
+
}
|
|
55297
|
+
},
|
|
55259
55298
|
{
|
|
55260
55299
|
"id": "himi_owner_lite_aria.msg_$item.id.link1",
|
|
55261
55300
|
"body": {
|
|
@@ -58836,6 +58875,203 @@ const SCREENS = runtimeSetting({
|
|
|
58836
58875
|
}
|
|
58837
58876
|
}
|
|
58838
58877
|
},
|
|
58878
|
+
{
|
|
58879
|
+
"id": "himi_owner_lite_aria.attachments.bound",
|
|
58880
|
+
"body": {
|
|
58881
|
+
"package": "himalaya",
|
|
58882
|
+
"type": "LazyList",
|
|
58883
|
+
"props": {
|
|
58884
|
+
"itemsPath": "$service:himiOwnerLiteAria.attachments",
|
|
58885
|
+
"horizontal": true,
|
|
58886
|
+
"spacing": 8,
|
|
58887
|
+
"items": [
|
|
58888
|
+
{
|
|
58889
|
+
"id": "himi_owner_lite_aria.attachment_$item.id",
|
|
58890
|
+
"body": {
|
|
58891
|
+
"package": "himalaya",
|
|
58892
|
+
"type": "VStack",
|
|
58893
|
+
"props": {
|
|
58894
|
+
"spacing": 4,
|
|
58895
|
+
"children": [
|
|
58896
|
+
{
|
|
58897
|
+
"id": "himi_owner_lite_aria.attachment_thumb_$item.id",
|
|
58898
|
+
"body": {
|
|
58899
|
+
"package": "himalaya",
|
|
58900
|
+
"type": "Image",
|
|
58901
|
+
"props": {
|
|
58902
|
+
"url": "$item.thumbUrl",
|
|
58903
|
+
"width": 72,
|
|
58904
|
+
"height": 72,
|
|
58905
|
+
"contentMode": "fill",
|
|
58906
|
+
"shape": "rounded",
|
|
58907
|
+
"contentDescription": "$item.name"
|
|
58908
|
+
}
|
|
58909
|
+
},
|
|
58910
|
+
"modifiers": {
|
|
58911
|
+
"hiddenPath": "$item.thumbHidden"
|
|
58912
|
+
}
|
|
58913
|
+
},
|
|
58914
|
+
{
|
|
58915
|
+
"id": "",
|
|
58916
|
+
"body": {
|
|
58917
|
+
"package": "himalaya",
|
|
58918
|
+
"type": "Text",
|
|
58919
|
+
"props": {
|
|
58920
|
+
"text": "$item.statusText",
|
|
58921
|
+
"style": "caption",
|
|
58922
|
+
"color": "textSecondary",
|
|
58923
|
+
"maxLines": 2
|
|
58924
|
+
}
|
|
58925
|
+
},
|
|
58926
|
+
"modifiers": {
|
|
58927
|
+
"hiddenPath": "$item.statusHidden"
|
|
58928
|
+
}
|
|
58929
|
+
},
|
|
58930
|
+
{
|
|
58931
|
+
"id": "",
|
|
58932
|
+
"body": {
|
|
58933
|
+
"package": "himalaya",
|
|
58934
|
+
"type": "HStack",
|
|
58935
|
+
"props": {
|
|
58936
|
+
"spacing": 8,
|
|
58937
|
+
"children": [
|
|
58938
|
+
{
|
|
58939
|
+
"id": "himi_owner_lite_aria.attachment_retry_$item.id",
|
|
58940
|
+
"body": {
|
|
58941
|
+
"package": "himalaya",
|
|
58942
|
+
"type": "Text",
|
|
58943
|
+
"props": {
|
|
58944
|
+
"text": "Retry",
|
|
58945
|
+
"style": "caption",
|
|
58946
|
+
"color": "accentPrimary",
|
|
58947
|
+
"maxLines": 1
|
|
58948
|
+
}
|
|
58949
|
+
},
|
|
58950
|
+
"modifiers": {
|
|
58951
|
+
"onTap": {
|
|
58952
|
+
"actionId": "tier5.himiOwnerLiteAria.retryAttachment",
|
|
58953
|
+
"params": {
|
|
58954
|
+
"id": "$item.id"
|
|
58955
|
+
}
|
|
58956
|
+
},
|
|
58957
|
+
"hiddenPath": "$item.retryHidden"
|
|
58958
|
+
}
|
|
58959
|
+
},
|
|
58960
|
+
{
|
|
58961
|
+
"id": "himi_owner_lite_aria.attachment_remove_$item.id",
|
|
58962
|
+
"body": {
|
|
58963
|
+
"package": "himalaya",
|
|
58964
|
+
"type": "Icon",
|
|
58965
|
+
"props": {
|
|
58966
|
+
"name": "close",
|
|
58967
|
+
"size": 14,
|
|
58968
|
+
"tint": "textSecondary"
|
|
58969
|
+
}
|
|
58970
|
+
},
|
|
58971
|
+
"modifiers": {
|
|
58972
|
+
"onTap": {
|
|
58973
|
+
"actionId": "tier5.himiOwnerLiteAria.removeAttachment",
|
|
58974
|
+
"params": {
|
|
58975
|
+
"id": "$item.id"
|
|
58976
|
+
}
|
|
58977
|
+
},
|
|
58978
|
+
"accessibilityLabel": "Remove photo"
|
|
58979
|
+
}
|
|
58980
|
+
}
|
|
58981
|
+
]
|
|
58982
|
+
}
|
|
58983
|
+
}
|
|
58984
|
+
}
|
|
58985
|
+
]
|
|
58986
|
+
}
|
|
58987
|
+
},
|
|
58988
|
+
"modifiers": {
|
|
58989
|
+
"width": 72
|
|
58990
|
+
}
|
|
58991
|
+
}
|
|
58992
|
+
]
|
|
58993
|
+
}
|
|
58994
|
+
},
|
|
58995
|
+
"modifiers": {
|
|
58996
|
+
"hiddenPath": "$service:himiOwnerLiteAria.attachmentsHidden",
|
|
58997
|
+
"padding": {
|
|
58998
|
+
"leading": 0,
|
|
58999
|
+
"trailing": 0,
|
|
59000
|
+
"top": 8,
|
|
59001
|
+
"bottom": 0
|
|
59002
|
+
}
|
|
59003
|
+
}
|
|
59004
|
+
},
|
|
59005
|
+
{
|
|
59006
|
+
"id": "",
|
|
59007
|
+
"body": {
|
|
59008
|
+
"package": "himalaya",
|
|
59009
|
+
"type": "HStack",
|
|
59010
|
+
"props": {
|
|
59011
|
+
"spacing": 16,
|
|
59012
|
+
"children": [
|
|
59013
|
+
{
|
|
59014
|
+
"id": "himi_owner_lite_aria.attach.library",
|
|
59015
|
+
"body": {
|
|
59016
|
+
"package": "himalaya",
|
|
59017
|
+
"type": "Icon",
|
|
59018
|
+
"props": {
|
|
59019
|
+
"name": "image",
|
|
59020
|
+
"size": 22,
|
|
59021
|
+
"tint": "accentPrimary"
|
|
59022
|
+
}
|
|
59023
|
+
},
|
|
59024
|
+
"modifiers": {
|
|
59025
|
+
"onTap": {
|
|
59026
|
+
"actionId": "tier5.himiOwnerLiteAria.attach",
|
|
59027
|
+
"params": {
|
|
59028
|
+
"source": "library"
|
|
59029
|
+
}
|
|
59030
|
+
},
|
|
59031
|
+
"accessibilityLabel": "Add a photo"
|
|
59032
|
+
}
|
|
59033
|
+
},
|
|
59034
|
+
{
|
|
59035
|
+
"id": "himi_owner_lite_aria.attach.camera",
|
|
59036
|
+
"body": {
|
|
59037
|
+
"package": "himalaya",
|
|
59038
|
+
"type": "Icon",
|
|
59039
|
+
"props": {
|
|
59040
|
+
"name": "camera",
|
|
59041
|
+
"size": 22,
|
|
59042
|
+
"tint": "accentPrimary"
|
|
59043
|
+
}
|
|
59044
|
+
},
|
|
59045
|
+
"modifiers": {
|
|
59046
|
+
"onTap": {
|
|
59047
|
+
"actionId": "tier5.himiOwnerLiteAria.attach",
|
|
59048
|
+
"params": {
|
|
59049
|
+
"source": "camera"
|
|
59050
|
+
}
|
|
59051
|
+
},
|
|
59052
|
+
"accessibilityLabel": "Take a photo"
|
|
59053
|
+
}
|
|
59054
|
+
},
|
|
59055
|
+
{
|
|
59056
|
+
"id": "",
|
|
59057
|
+
"body": {
|
|
59058
|
+
"package": "himalaya",
|
|
59059
|
+
"type": "Spacer",
|
|
59060
|
+
"props": {}
|
|
59061
|
+
}
|
|
59062
|
+
}
|
|
59063
|
+
]
|
|
59064
|
+
}
|
|
59065
|
+
},
|
|
59066
|
+
"modifiers": {
|
|
59067
|
+
"padding": {
|
|
59068
|
+
"leading": 0,
|
|
59069
|
+
"trailing": 0,
|
|
59070
|
+
"top": 8,
|
|
59071
|
+
"bottom": 0
|
|
59072
|
+
}
|
|
59073
|
+
}
|
|
59074
|
+
},
|
|
58839
59075
|
{
|
|
58840
59076
|
"id": "form_aria",
|
|
58841
59077
|
"body": {
|
|
@@ -58921,7 +59157,9 @@ const SCREENS = runtimeSetting({
|
|
|
58921
59157
|
"wix_api",
|
|
58922
59158
|
"open_url",
|
|
58923
59159
|
"clipboard",
|
|
58924
|
-
"ui"
|
|
59160
|
+
"ui",
|
|
59161
|
+
"camera",
|
|
59162
|
+
"presigned_upload"
|
|
58925
59163
|
],
|
|
58926
59164
|
"minBinaryVersion": "0.1.0",
|
|
58927
59165
|
"bundleVersion": "0.0.1"
|