@wix/himalaya-cli 0.1622.0 → 0.1624.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 +28 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +18 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/badges-v2/src/extensions.d.ts +42 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/events/src/index.d.ts +8 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/ui.mjs +15 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-badges.mjs +13 -0
- package/dist/cli.mjs +3511 -2583
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +3 -1
- package/guides/component-reference.md +21 -2
- package/guides/designing-himi-screens.md +3 -1
- package/guides/himi-json-output.md +34 -0
- package/guides/one-app-to-himi-app.md +104 -0
- package/guides/sdk-reference.json +55 -5
- package/package.json +2 -2
- package/templates/branded-lite/tier5-src/_shared/access-gates-table.ts +8 -0
- package/templates/branded-lite/tier5-src/_shared/access-gates.ts +341 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-access-nav/index.ts +45 -0
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/ui/src/index.d.ts
CHANGED
|
@@ -16,6 +16,27 @@ export interface AlertOptions {
|
|
|
16
16
|
* screen worker needs `app_services` and an exported action, a `tier5.*` must be this worker's
|
|
17
17
|
* own; anything else rejects (`action_not_allowed`). Cancel and dismissal run nothing. */
|
|
18
18
|
confirm?: AlertConfirm;
|
|
19
|
+
/** Up to three buttons, replacing the four options above; see `AlertButtonOptions`. */
|
|
20
|
+
buttons?: AlertButtonOptions[];
|
|
21
|
+
}
|
|
22
|
+
/** #4659 — `"cancel"` (at most one) sits in the cancel position and is what dismissal by scrim, back
|
|
23
|
+
* or Esc resolves as; `"destructive"` draws with the `danger` token. Default `"default"`. */
|
|
24
|
+
export type AlertButtonRole = "default" | "cancel" | "destructive";
|
|
25
|
+
/** #4659 — one button of an `alert({ buttons })`. Test id `alert.<id>`; its label is the accessible
|
|
26
|
+
* name. Buttons draw in platform order and the result names the one pressed (`buttonId`). With
|
|
27
|
+
* `buttons`, `confirmLabel` / `cancelLabel` / `destructive` / `confirm` are not sent; `confirm` is
|
|
28
|
+
* shorthand for one `role: "default"` button. Each `actionId` is checked when you set it exactly as
|
|
29
|
+
* `confirm.actionId` is (reject, show nothing); from an app service only a `default`-role press
|
|
30
|
+
* carries gesture credit. More than three buttons, more than one `cancel`, or an empty / repeated
|
|
31
|
+
* `id` or empty `label` rejects `invalid_buttons`. */
|
|
32
|
+
export interface AlertButtonOptions {
|
|
33
|
+
id: string;
|
|
34
|
+
label: string;
|
|
35
|
+
role?: AlertButtonRole;
|
|
36
|
+
/** Run on press, as a new invocation (see `AlertOptions.confirm`). Omit to just await the press. */
|
|
37
|
+
actionId?: string;
|
|
38
|
+
/** Passed to the action (JSON types kept). */
|
|
39
|
+
args?: Record<string, unknown>;
|
|
19
40
|
}
|
|
20
41
|
/** The affirmative button of an `alert()`: its label and the action its press runs. */
|
|
21
42
|
export interface AlertConfirm {
|
|
@@ -25,9 +46,14 @@ export interface AlertConfirm {
|
|
|
25
46
|
args?: Record<string, unknown>;
|
|
26
47
|
}
|
|
27
48
|
export interface AlertResult {
|
|
28
|
-
/** true ⇒ the user tapped confirm
|
|
29
|
-
* externally (e.g. a deep-link reset cleared all
|
|
49
|
+
/** true ⇒ the user tapped confirm (with `buttons`: a `default`-role button); false ⇒ cancel,
|
|
50
|
+
* another button, or the alert was dismissed externally (e.g. a deep-link reset cleared all
|
|
51
|
+
* presented overlays). */
|
|
30
52
|
confirmed: boolean;
|
|
53
|
+
/** #4659 — the id of the button pressed: one of `buttons`, or `"confirm"` / `"cancel"` for the
|
|
54
|
+
* legacy options. Dismissal by scrim/back/Esc resolves as the `cancel` button; with none, or when
|
|
55
|
+
* the host clears the alert, it is `null`. */
|
|
56
|
+
buttonId: string | null;
|
|
31
57
|
}
|
|
32
58
|
/** Present a modal alert on the current screen. Resolves when the user picks a
|
|
33
59
|
* button. Rejects with `ui_busy` while another alert() is pending, and with
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts
CHANGED
|
@@ -1360,10 +1360,23 @@ export interface SnackbarProps {
|
|
|
1360
1360
|
* other is ignored), drawn by the same presenter as a worker's `ui.snackbar({ imageUrl })`. */
|
|
1361
1361
|
imageUrl?: string;
|
|
1362
1362
|
}
|
|
1363
|
+
/** An AlertDialog / `ui.alert` button role. Unset or unknown reads as `"default"`. */
|
|
1364
|
+
export type AlertButtonRole = "default" | "cancel" | "destructive";
|
|
1365
|
+
/** One AlertDialog button: test id `alert.<id>`, its label as the accessible name. */
|
|
1366
|
+
export interface AlertButton {
|
|
1367
|
+
id: string;
|
|
1368
|
+
label: string;
|
|
1369
|
+
/** `"cancel"` (at most one) takes the cancel position and is what scrim/back/Esc dismissal
|
|
1370
|
+
* resolves as; `"destructive"` draws with the `danger` token. Default `"default"`. */
|
|
1371
|
+
role?: AlertButtonRole;
|
|
1372
|
+
/** Runs on press. */
|
|
1373
|
+
action?: Action;
|
|
1374
|
+
}
|
|
1363
1375
|
export interface AlertDialogProps {
|
|
1364
1376
|
title: string;
|
|
1365
1377
|
message?: string;
|
|
1366
|
-
|
|
1378
|
+
/** Required unless `buttons` is set. */
|
|
1379
|
+
confirmAction?: Action;
|
|
1367
1380
|
cancelAction?: Action;
|
|
1368
1381
|
destructive?: boolean;
|
|
1369
1382
|
/** #1059 — confirm button label; overridable (mirrors NavigationActionRouter's
|
|
@@ -1376,6 +1389,10 @@ export interface AlertDialogProps {
|
|
|
1376
1389
|
* `aria-modal`). TRI-STATE: absent takes this component's default (**true**), an
|
|
1377
1390
|
* explicit `false` opts it out. */
|
|
1378
1391
|
modal?: boolean;
|
|
1392
|
+
/** Up to three buttons, drawn in platform order (iOS/macOS: the cancel button in the
|
|
1393
|
+
* cancel position, two side by side, three stacked; Android/web: Material order). They replace
|
|
1394
|
+
* `confirmAction`/`cancelAction`; setting both is a validator warning, and the buttons win. */
|
|
1395
|
+
buttons?: AlertButton[];
|
|
1379
1396
|
}
|
|
1380
1397
|
export type TextMark = "bold" | "italic" | "underline" | "code" | "link";
|
|
1381
1398
|
export interface TextRun {
|
|
@@ -1 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
import { type WixBadge, type WixCallOptions, type WixCursorPaging, type WixCursorPagingMetadata } from "./index.js";
|
|
2
|
+
/** One badge given to one member. */
|
|
3
|
+
export interface WixBadgeAssignment {
|
|
4
|
+
id?: string;
|
|
5
|
+
badgeId?: string;
|
|
6
|
+
memberId?: string;
|
|
7
|
+
createdDate?: string;
|
|
8
|
+
updatedDate?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface WixQueryBadgeAssignmentsRequest {
|
|
11
|
+
query?: {
|
|
12
|
+
filter?: Record<string, unknown>;
|
|
13
|
+
cursorPaging?: WixCursorPaging;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface WixQueryBadgeAssignmentsResponse {
|
|
17
|
+
badgeAssignments?: WixBadgeAssignment[];
|
|
18
|
+
pagingMetadata?: WixCursorPagingMetadata;
|
|
19
|
+
}
|
|
20
|
+
/** The badge icon exactly as the live API sends it. The generated `WixBadge.icon` is typed `string`
|
|
21
|
+
* from the upstream package, but the service returns this image object. */
|
|
22
|
+
export interface WixBadgeIcon {
|
|
23
|
+
id?: string;
|
|
24
|
+
url?: string;
|
|
25
|
+
height?: number;
|
|
26
|
+
width?: number;
|
|
27
|
+
}
|
|
28
|
+
/** Which badges members hold — POST /badges/v4/assignments/query. A Visitor can read it
|
|
29
|
+
* (`BADGES.BADGE_READ_MEMBERS`), so a members list can show badges without a sign-in.
|
|
30
|
+
* Filter by `memberId: { $in: [...] }` and page with `cursorPaging`: a member can hold dozens of
|
|
31
|
+
* badges, so one page of many members can need several calls.
|
|
32
|
+
*
|
|
33
|
+
* Prefer this over the generated `listMembersBadgeIds`, whose route
|
|
34
|
+
* (`POST /badges/v4/badges/members`) answers 404 on the live service.
|
|
35
|
+
*
|
|
36
|
+
* @scope visitor — an anonymous Visitor reads it (200, observed live). The generated spec declares the app
|
|
37
|
+
* identity only, so a signed-in member's read is not yet observed: an empty or refused answer means "no badge
|
|
38
|
+
* known", never "no badge held". */
|
|
39
|
+
export declare function queryBadgeAssignments(req?: WixQueryBadgeAssignmentsRequest, opts?: WixCallOptions): Promise<WixQueryBadgeAssignmentsResponse>;
|
|
40
|
+
/** The icon image URL of a badge, or "" when it has none. Reads the live `{ url }` object and also the
|
|
41
|
+
* plain string the generated type promises, so a caller needs no cast. */
|
|
42
|
+
export declare function badgeIconUrl(badge: Pick<WixBadge, "icon">): string;
|
|
@@ -49,7 +49,7 @@ export interface WixEventScheduling {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
export interface WixEventLocation {
|
|
52
|
-
/** VENUE | ONLINE
|
|
52
|
+
/** VENUE | ONLINE (Events v3 `Location.LocationType`; `TBD` is not a type). */
|
|
53
53
|
type?: string;
|
|
54
54
|
name?: string;
|
|
55
55
|
address?: string;
|
|
@@ -66,7 +66,11 @@ export interface WixEvent {
|
|
|
66
66
|
* rewriting one would lose a real event. A union here would be a claim this SDK cannot
|
|
67
67
|
* enforce. Compare against `WixEventStatus` when you need the set it knows. */
|
|
68
68
|
eventStatus?: string;
|
|
69
|
-
/** EventType: RSVP |
|
|
69
|
+
/** EventType: RSVP | TICKETING | EXTERNAL | NONE — the GA values of the v3
|
|
70
|
+
* `RegistrationType.Type` enum that `decodeEvent` reads from `registration.type`.
|
|
71
|
+
* (v1 spelled `TICKETING` / `NONE` as `TICKETS` / `NO_REGISTRATION`; v3 does not.) Not narrowed
|
|
72
|
+
* to a union for the same reason as `eventStatus`: `decodeEvent` passes an unrecognised
|
|
73
|
+
* value straight through rather than drop it. */
|
|
70
74
|
eventType?: string;
|
|
71
75
|
scheduling?: WixEventScheduling;
|
|
72
76
|
location?: WixEventLocation;
|
|
@@ -183,7 +187,8 @@ export declare function getEvent(eventId: string, opts?: {
|
|
|
183
187
|
export declare function deleteEvent(eventId: string): Promise<WixDeleteEventResponse>;
|
|
184
188
|
/** Write shape for create/update (Events v3). Verified-minimal: a create needs
|
|
185
189
|
* BOTH `name` and `title`, a `dateAndTimeSettings` window, a `location`, and a
|
|
186
|
-
* `registration.initialType` (RSVP |
|
|
190
|
+
* `registration.initialType` (RSVP | TICKETING in Events v3
|
|
191
|
+
* `InitialRegistrationType.Type`). */
|
|
187
192
|
export interface WixEventWrite {
|
|
188
193
|
name?: string;
|
|
189
194
|
title?: string;
|
|
@@ -17,6 +17,18 @@ function dispatch(handlerId, params, _options) {
|
|
|
17
17
|
async function alert(options) {
|
|
18
18
|
const params = { title: options.title ?? "" };
|
|
19
19
|
if (options.message) params.message = options.message;
|
|
20
|
+
if (options.buttons) {
|
|
21
|
+
params.buttons = JSON.stringify(options.buttons.map(({ id, label, role, actionId, args }) => ({
|
|
22
|
+
id,
|
|
23
|
+
label,
|
|
24
|
+
role: role ?? "default",
|
|
25
|
+
...actionId === void 0 ? {} : { actionId },
|
|
26
|
+
...args === void 0 ? {} : { args }
|
|
27
|
+
})));
|
|
28
|
+
const r2 = await dispatch("capability.ui.alert", params);
|
|
29
|
+
const pressed = typeof r2?.buttonId === "string" && options.buttons.some((b) => b.id === r2.buttonId) ? r2.buttonId : null;
|
|
30
|
+
return { confirmed: r2?.confirmed === true || r2?.confirmed === "true", buttonId: pressed };
|
|
31
|
+
}
|
|
20
32
|
if (options.confirmLabel) params.confirmLabel = options.confirmLabel;
|
|
21
33
|
if (options.cancelLabel) params.cancelLabel = options.cancelLabel;
|
|
22
34
|
if (options.destructive) params.destructive = true;
|
|
@@ -26,7 +38,9 @@ async function alert(options) {
|
|
|
26
38
|
params.confirmLabel = label;
|
|
27
39
|
}
|
|
28
40
|
const r = await dispatch("capability.ui.alert", params);
|
|
29
|
-
|
|
41
|
+
const confirmed = r?.confirmed === true || r?.confirmed === "true";
|
|
42
|
+
if (r?.buttonId === "confirm" || r?.buttonId === "cancel" || r?.buttonId === null) return { confirmed, buttonId: r.buttonId };
|
|
43
|
+
return { confirmed, buttonId: confirmed ? "confirm" : options.cancelLabel ? "cancel" : null };
|
|
30
44
|
}
|
|
31
45
|
var SNACKBAR_LIMITS = {
|
|
32
46
|
messageLines: 2,
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
// ../../stdlib/wix-sdk/badges-v2/src/extensions.ts
|
|
2
|
+
function queryBadgeAssignments(req = {}, opts) {
|
|
3
|
+
return wixCall("POST", "/badges/v4/assignments/query", req, opts);
|
|
4
|
+
}
|
|
5
|
+
function badgeIconUrl(badge) {
|
|
6
|
+
const icon = badge.icon;
|
|
7
|
+
if (typeof icon === "string") return icon;
|
|
8
|
+
const url = icon?.url;
|
|
9
|
+
return typeof url === "string" ? url : "";
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
// ../../stdlib/wix-sdk/badges-v2/src/index.ts
|
|
2
13
|
function wixCallHeaders(opts) {
|
|
3
14
|
const site = opts?.site?.trim();
|
|
@@ -155,6 +166,7 @@ function updateBadgesOrder(req = {}, opts) {
|
|
|
155
166
|
}
|
|
156
167
|
export {
|
|
157
168
|
assignBadge,
|
|
169
|
+
badgeIconUrl,
|
|
158
170
|
count,
|
|
159
171
|
create,
|
|
160
172
|
get,
|
|
@@ -162,6 +174,7 @@ export {
|
|
|
162
174
|
listMembers,
|
|
163
175
|
listMembersBadgeIds,
|
|
164
176
|
query,
|
|
177
|
+
queryBadgeAssignments,
|
|
165
178
|
unassignBadge,
|
|
166
179
|
update,
|
|
167
180
|
updateBadgesOrder,
|