@wix/himalaya-cli 0.1613.0 → 0.1615.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/ui/src/index.d.ts +53 -13
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/ui.mjs +31 -5
- package/dist/cli.mjs +1638 -1330
- package/dist/preview-assets.generated.bin +0 -0
- package/fixtures/wix-canned.json +4 -0
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +3 -0
- package/guides/designing-himi-screens.md +4 -1
- package/guides/hhp.md +2 -2
- package/guides/sdk-reference.json +28 -4
- package/package.json +2 -2
- package/template-icons/salon-spa.png +0 -0
- package/templates/beauty-salon/tier5-src/_shared/branded-load-state.ts +5 -2
- package/templates/beauty-salon/tier5-src/_shared/himi-account.ts +31 -0
- package/templates/beauty-salon/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +50 -3
- package/templates/beauty-salon/tier5-src/himi-booking-services/index.ts +70 -3
- package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +40 -8
- package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
- package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +178 -12
- package/templates/branded-lite/dev/index.ts +192 -0
- package/templates/branded-lite/l10n/en.json +1 -1
- package/templates/branded-lite/tier5-src/_shared/branded-load-state.ts +5 -2
- package/templates/branded-lite/tier5-src/_shared/himi-account.ts +31 -0
- package/templates/branded-lite/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +50 -3
- package/templates/branded-lite/tier5-src/himi-booking-services/index.ts +70 -3
- package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +40 -8
- package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-galleries/index.ts +104 -12
- package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +178 -12
- package/templates/community-club/tier5-src/_shared/branded-load-state.ts +5 -2
- package/templates/community-club/tier5-src/_shared/himi-account.ts +31 -0
- package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +178 -12
- package/templates/events-meetups/tier5-src/_shared/branded-load-state.ts +5 -2
- package/templates/events-meetups/tier5-src/_shared/himi-account.ts +31 -0
- package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +178 -12
- package/templates/gym-fitness/tier5-src/_shared/branded-load-state.ts +5 -2
- package/templates/gym-fitness/tier5-src/_shared/himi-account.ts +31 -0
- package/templates/gym-fitness/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +50 -3
- package/templates/gym-fitness/tier5-src/himi-booking-services/index.ts +70 -3
- package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +40 -8
- package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
- package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +178 -12
- package/templates/nonprofit-cause/tier5-src/_shared/branded-load-state.ts +5 -2
- package/templates/nonprofit-cause/tier5-src/_shared/himi-account.ts +31 -0
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +178 -12
- package/templates/podcast-creator/tier5-src/_shared/branded-load-state.ts +5 -2
- package/templates/podcast-creator/tier5-src/_shared/himi-account.ts +31 -0
- package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +178 -12
- package/templates/portfolio-creative/tier5-src/_shared/branded-load-state.ts +5 -2
- package/templates/portfolio-creative/tier5-src/_shared/himi-account.ts +31 -0
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +178 -12
- package/templates/restaurant/tier5-src/_shared/branded-load-state.ts +5 -2
- package/templates/restaurant/tier5-src/_shared/himi-account.ts +31 -0
- package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +178 -12
- package/templates/retail-store/tier5-src/_shared/branded-load-state.ts +5 -2
- package/templates/retail-store/tier5-src/_shared/himi-account.ts +31 -0
- package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +178 -12
- package/templates/salon-spa/README.md +53 -0
- package/templates/salon-spa/config.ts +272 -0
- package/templates/salon-spa/dev/index.ts +19893 -0
- package/templates/salon-spa/himalaya.content.json +49 -0
- package/templates/salon-spa/himalaya.template.json +14 -0
- package/templates/salon-spa/icon.png +0 -0
- package/templates/salon-spa/platforms.json +1 -0
- package/templates/salon-spa/tier5-src/_shared/app-locale.ts +61 -0
- package/templates/salon-spa/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/salon-spa/tier5-src/_shared/booking-session.ts +222 -0
- package/templates/salon-spa/tier5-src/_shared/branded-lite-hosted.ts +278 -0
- package/templates/salon-spa/tier5-src/_shared/branded-load-state.ts +109 -0
- package/templates/salon-spa/tier5-src/_shared/business-chat-copy.ts +40 -0
- package/templates/salon-spa/tier5-src/_shared/business-chat-history.ts +48 -0
- package/templates/salon-spa/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/salon-spa/tier5-src/_shared/business-chat-model.ts +56 -0
- package/templates/salon-spa/tier5-src/_shared/business-chat-presenter.ts +581 -0
- package/templates/salon-spa/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/salon-spa/tier5-src/_shared/collection-contract.ts +230 -0
- package/templates/salon-spa/tier5-src/_shared/collection-query.ts +193 -0
- package/templates/salon-spa/tier5-src/_shared/collection-service.ts +400 -0
- package/templates/salon-spa/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/salon-spa/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/salon-spa/tier5-src/_shared/engine-intl.ts +508 -0
- package/templates/salon-spa/tier5-src/_shared/himi-account.ts +164 -0
- package/templates/salon-spa/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/salon-spa/tier5-src/_shared/himi-bookings.ts +318 -0
- package/templates/salon-spa/tier5-src/_shared/himi-copy.ts +89 -0
- package/templates/salon-spa/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/salon-spa/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/salon-spa/tier5-src/_shared/host-events.ts +66 -0
- package/templates/salon-spa/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/salon-spa/tier5-src/_shared/iap-attendance-form.ts +106 -0
- package/templates/salon-spa/tier5-src/_shared/iap-attendance-purchase.ts +211 -0
- package/templates/salon-spa/tier5-src/_shared/iap-attendance.ts +38 -0
- package/templates/salon-spa/tier5-src/_shared/iap-worker.ts +125 -0
- package/templates/salon-spa/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/salon-spa/tier5-src/_shared/member-access.ts +52 -0
- package/templates/salon-spa/tier5-src/_shared/member-account-routes.ts +52 -0
- package/templates/salon-spa/tier5-src/_shared/member-bookings.ts +94 -0
- package/templates/salon-spa/tier5-src/_shared/offset-page.ts +10 -0
- package/templates/salon-spa/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/salon-spa/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/salon-spa/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/salon-spa/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/salon-spa/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/salon-spa/tier5-src/_shared/weekly-goal.ts +107 -0
- package/templates/salon-spa/tier5-src/_shared/wix-service-price.ts +146 -0
- package/templates/salon-spa/tier5-src/business-chat/index.ts +669 -0
- package/templates/salon-spa/tier5-src/himi-booking-account/index.ts +241 -0
- package/templates/salon-spa/tier5-src/himi-booking-bookings/index.ts +466 -0
- package/templates/salon-spa/tier5-src/himi-booking-saved/index.ts +103 -0
- package/templates/salon-spa/tier5-src/himi-booking-service/index.ts +1170 -0
- package/templates/salon-spa/tier5-src/himi-booking-services/index.ts +791 -0
- package/templates/salon-spa/tier5-src/himi-booking-time/index.ts +1712 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-agenda/index.ts +950 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-galleries/index.ts +282 -0
- package/templates/salon-spa/tier5-src/himi-salon-home/index.ts +544 -0
- package/templates/salon-spa/tier5-src/himi-store-account/index.ts +925 -0
- package/templates/salon-spa/tokens.json +341 -0
- package/templates/yoga-studio/dev/index.ts +192 -0
- package/templates/yoga-studio/tier5-src/_shared/branded-load-state.ts +5 -2
- package/templates/yoga-studio/tier5-src/_shared/himi-account.ts +31 -0
- package/templates/yoga-studio/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +50 -3
- package/templates/yoga-studio/tier5-src/himi-booking-services/index.ts +70 -3
- package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +40 -8
- package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
- package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +178 -12
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/ui/src/index.d.ts
CHANGED
|
@@ -39,37 +39,77 @@ export declare function alert(options: AlertOptions): Promise<AlertResult>;
|
|
|
39
39
|
* `warning`, `danger`). Use `danger` for errors; the hosts also accept `error` as an alias of it. */
|
|
40
40
|
export type SnackbarTone = "info" | "success" | "warning" | "danger";
|
|
41
41
|
export interface SnackbarOptions {
|
|
42
|
+
/** At most two lines on screen; a longer message is ellipsised. */
|
|
42
43
|
message: string;
|
|
43
44
|
/** Default "info". */
|
|
44
45
|
tone?: SnackbarTone;
|
|
45
|
-
/** Auto-dismiss delay in ms, on every host
|
|
46
|
+
/** Auto-dismiss delay in ms, clamped on every host to {@link SNACKBAR_LIMITS} (2–10 s, at least
|
|
47
|
+
* 4 s with an `action` so it can be reached by VoiceOver / TalkBack before it goes). Absent, 0 or
|
|
48
|
+
* less: the default, 3000 (4000 with an `action`). */
|
|
46
49
|
durationMs?: number;
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
50
|
+
/** A thumbnail of the thing the toast is about: a 40 pt square at the leading edge. `https:` on
|
|
51
|
+
* every host; a local `file:` URL on iOS and macOS only, whose image pipeline already reads local
|
|
52
|
+
* files. Any other URL is ignored (the toast shows without it), and an image that fails to load
|
|
53
|
+
* just hides. */
|
|
54
|
+
imageUrl?: string;
|
|
55
|
+
/** One action button ("Undo", "View"). Tapping it dismisses the snackbar and resolves the call
|
|
56
|
+
* `{ actionTapped: true }`. With an `actionId` the tap also runs that action with `args`. The id
|
|
57
|
+
* must be a worker action:
|
|
49
58
|
* - one of this bundle's own `tier5.<svc>.<action>` ids — run on THIS worker, never another
|
|
50
59
|
* screen's or the app-level worker's;
|
|
51
60
|
* - an app service's `app.<svc>.<action>` — needs `app_services` and an exported action (an app
|
|
52
61
|
* service's own id needs neither). The web host refuses it until it hosts app services.
|
|
53
62
|
* Any other id (`capability.*`, `himi.*`, a registered handler) is refused when the snackbar is
|
|
54
63
|
* requested: the call rejects and nothing is shown. A host that cannot tell which worker asked
|
|
55
|
-
* (React Native, an embedded web region) refuses every `action` the same way.
|
|
64
|
+
* (React Native, an embedded web region) refuses every `action` the same way. An APP SERVICE
|
|
65
|
+
* must name an `actionId`: an awaited result carries no gesture credit (RFC 0074 §7), so its
|
|
66
|
+
* View has to run as an action of its own. */
|
|
56
67
|
action?: SnackbarAction;
|
|
57
68
|
}
|
|
58
69
|
export interface SnackbarAction {
|
|
59
|
-
/** The button's text — also its VoiceOver / TalkBack / screen-reader label.
|
|
70
|
+
/** The button's text — also its VoiceOver / TalkBack / screen-reader label. At most 24
|
|
71
|
+
* characters; a longer label is ellipsised. */
|
|
60
72
|
label: string;
|
|
61
|
-
/** What the tap runs: one of this bundle's own `tier5.<svc>.<action>` ids, or
|
|
62
|
-
|
|
73
|
+
/** What the tap runs, if anything: one of this bundle's own `tier5.<svc>.<action>` ids, or
|
|
74
|
+
* `app.<svc>.<action>`. A screen worker may leave it out and branch on `actionTapped` instead
|
|
75
|
+
* ("Undo"); an app service may not. */
|
|
76
|
+
actionId?: string;
|
|
63
77
|
/** The action's arguments, which the reducer receives as typed JSON. */
|
|
64
78
|
args?: Record<string, unknown>;
|
|
65
79
|
}
|
|
80
|
+
/** What a snackbar call resolves with. */
|
|
81
|
+
export interface SnackbarResult {
|
|
82
|
+
/** The user tapped the action. Always false for a snackbar without one (resolved on
|
|
83
|
+
* presentation); with one, false when it was dismissed any other way — timed out, swiped, closed,
|
|
84
|
+
* or replaced by a newer snackbar. */
|
|
85
|
+
actionTapped: boolean;
|
|
86
|
+
}
|
|
87
|
+
/** #4661 — the constraints that keep a snackbar a toast, enforced here and again by every host. */
|
|
88
|
+
export declare const SNACKBAR_LIMITS: {
|
|
89
|
+
readonly messageLines: 2;
|
|
90
|
+
readonly labelChars: 24;
|
|
91
|
+
readonly minDurationMs: 2000;
|
|
92
|
+
/** The floor with an action: long enough to reach it with a screen reader. */
|
|
93
|
+
readonly minActionDurationMs: 4000;
|
|
94
|
+
readonly maxDurationMs: 10000;
|
|
95
|
+
/** The thumbnail's side, in pt / dp / CSS px. */
|
|
96
|
+
readonly imageSize: 40;
|
|
97
|
+
};
|
|
98
|
+
/** The duration a host shows a snackbar for: absent / non-finite / 0 or less → undefined (the host
|
|
99
|
+
* default applies), else clamped to {@link SNACKBAR_LIMITS}. */
|
|
100
|
+
export declare function snackbarDurationMs(durationMs: number | undefined, hasAction: boolean): number | undefined;
|
|
101
|
+
/** An action label as every host draws it: at most {@link SNACKBAR_LIMITS}.labelChars characters
|
|
102
|
+
* (by code point, so an emoji is never cut in half), the last one an ellipsis when it was cut. */
|
|
103
|
+
export declare function snackbarLabel(label: string): string;
|
|
66
104
|
/** Show a transient snackbar toast: it floats above the tab bar, slides and fades in and out
|
|
67
|
-
* (fades only under reduced motion), queues behind one that is already showing, and is
|
|
68
|
-
* by VoiceOver / TalkBack
|
|
105
|
+
* (fades only under reduced motion), queues behind one that is already showing, and is announced
|
|
106
|
+
* by VoiceOver / TalkBack / the screen reader. Without an `action` it resolves
|
|
107
|
+
* `{ actionTapped: false }` once it is queued, as before; with one it resolves when the snackbar
|
|
108
|
+
* goes, `{ actionTapped: true }` only if the action was tapped (see {@link SnackbarResult}).
|
|
69
109
|
* Rejects with `no_ui_host` if no presenter is attached; with an `action`, also with
|
|
70
|
-
* `invalid_action` (empty label
|
|
71
|
-
* actions), or, for an `app.*` id, `undeclared` (no
|
|
72
|
-
* `no_action`, `not_booted` or `unavailable`. */
|
|
73
|
-
export declare function snackbar(options: SnackbarOptions): Promise<
|
|
110
|
+
* `invalid_action` (empty label), `action_id_required` (an app service with no `actionId`),
|
|
111
|
+
* `action_not_allowed` (not one of this bundle's actions), or, for an `app.*` id, `undeclared` (no
|
|
112
|
+
* `app_services`), `not_exported`, `no_service`, `no_action`, `not_booted` or `unavailable`. */
|
|
113
|
+
export declare function snackbar(options: SnackbarOptions): Promise<SnackbarResult>;
|
|
74
114
|
/** Capability version, for bundles that gate on min binary version. */
|
|
75
115
|
export declare const version = 1;
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts
CHANGED
|
@@ -1332,6 +1332,9 @@ export interface SnackbarProps {
|
|
|
1332
1332
|
severity?: Severity;
|
|
1333
1333
|
/** #1059 — action label; overridable for localized hosts. Default "Take action". */
|
|
1334
1334
|
actionLabel?: string;
|
|
1335
|
+
/** #4661 — a 40 pt/dp thumbnail at the leading edge (`https:` or a local file/asset URL; any
|
|
1336
|
+
* other is ignored), drawn by the same presenter as a worker's `ui.snackbar({ imageUrl })`. */
|
|
1337
|
+
imageUrl?: string;
|
|
1335
1338
|
}
|
|
1336
1339
|
export interface AlertDialogProps {
|
|
1337
1340
|
title: string;
|
|
@@ -28,22 +28,48 @@ async function alert(options) {
|
|
|
28
28
|
const r = await dispatch("capability.ui.alert", params);
|
|
29
29
|
return { confirmed: r?.confirmed === true || r?.confirmed === "true" };
|
|
30
30
|
}
|
|
31
|
+
var SNACKBAR_LIMITS = {
|
|
32
|
+
messageLines: 2,
|
|
33
|
+
labelChars: 24,
|
|
34
|
+
minDurationMs: 2e3,
|
|
35
|
+
/** The floor with an action: long enough to reach it with a screen reader. */
|
|
36
|
+
minActionDurationMs: 4e3,
|
|
37
|
+
maxDurationMs: 1e4,
|
|
38
|
+
/** The thumbnail's side, in pt / dp / CSS px. */
|
|
39
|
+
imageSize: 40
|
|
40
|
+
};
|
|
41
|
+
function snackbarDurationMs(durationMs, hasAction) {
|
|
42
|
+
if (typeof durationMs !== "number" || !Number.isFinite(durationMs) || durationMs <= 0) return void 0;
|
|
43
|
+
const min = hasAction ? SNACKBAR_LIMITS.minActionDurationMs : SNACKBAR_LIMITS.minDurationMs;
|
|
44
|
+
return Math.min(SNACKBAR_LIMITS.maxDurationMs, Math.max(min, Math.trunc(durationMs)));
|
|
45
|
+
}
|
|
46
|
+
function snackbarLabel(label) {
|
|
47
|
+
const chars = Array.from(label ?? "");
|
|
48
|
+
return chars.length <= SNACKBAR_LIMITS.labelChars ? chars.join("") : `${chars.slice(0, SNACKBAR_LIMITS.labelChars - 1).join("")}\u2026`;
|
|
49
|
+
}
|
|
31
50
|
async function snackbar(options) {
|
|
32
51
|
const params = { message: options.message ?? "" };
|
|
33
52
|
if (options.tone) params.tone = options.tone;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
53
|
+
const durationMs = snackbarDurationMs(options.durationMs, !!options.action);
|
|
54
|
+
if (durationMs !== void 0) params.durationMs = durationMs;
|
|
55
|
+
if (typeof options.imageUrl === "string" && options.imageUrl.trim()) params.imageUrl = options.imageUrl.trim();
|
|
37
56
|
if (options.action) {
|
|
38
57
|
const { label, actionId, args } = options.action;
|
|
39
|
-
|
|
58
|
+
const action = { label: snackbarLabel(label) };
|
|
59
|
+
if (actionId) action.actionId = actionId;
|
|
60
|
+
if (args !== void 0) action.args = args;
|
|
61
|
+
params.action = JSON.stringify(action);
|
|
40
62
|
}
|
|
41
|
-
await dispatch("capability.ui.snackbar", params);
|
|
63
|
+
const r = await dispatch("capability.ui.snackbar", params);
|
|
64
|
+
return { actionTapped: r?.actionTapped === true || r?.actionTapped === "true" };
|
|
42
65
|
}
|
|
43
66
|
var version = 1;
|
|
44
67
|
export {
|
|
68
|
+
SNACKBAR_LIMITS,
|
|
45
69
|
alert,
|
|
46
70
|
snackbar,
|
|
71
|
+
snackbarDurationMs,
|
|
72
|
+
snackbarLabel,
|
|
47
73
|
version
|
|
48
74
|
};
|
|
49
75
|
//# sourceMappingURL=ui.mjs.map
|