@wix/himalaya-cli 0.1616.0 → 0.1618.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/builder.d.ts +15 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +28 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/one-app-section.d.ts +39 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/one-app-visibility.d.ts +22 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +151 -24
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +8 -0
- package/dist/cli.mjs +1042 -389
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +10 -1
- package/guides/component-reference.md +25 -2
- package/guides/designing-himi-screens.md +3 -1
- package/guides/hhp.md +3 -1
- package/guides/himi-json-output.md +11 -1
- package/guides/index.json +1 -1
- package/guides/one-app-section-mappings.md +32 -0
- package/guides/one-app-to-himi-app.md +133 -9
- package/guides/tier-5-add-a-screen.md +1 -1
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +37 -18
- package/templates/beauty-salon/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +8 -3
- package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
- package/templates/beauty-salon/tier5-src/himi-branded-lite-place-summary/index.ts +7 -2
- package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +8 -2
- package/templates/branded-lite/dev/index.ts +95 -47
- package/templates/branded-lite/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +8 -3
- package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-place-summary/index.ts +7 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +7 -2
- package/templates/branded-lite/tier5-src/himi-store-account/index.ts +8 -2
- package/templates/community-club/dev/index.ts +27 -13
- package/templates/community-club/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/community-club/tier5-src/himi-store-account/index.ts +8 -2
- package/templates/events-meetups/dev/index.ts +25 -12
- package/templates/events-meetups/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/events-meetups/tier5-src/himi-store-account/index.ts +8 -2
- package/templates/gym-fitness/dev/index.ts +41 -20
- package/templates/gym-fitness/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +8 -3
- package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
- package/templates/gym-fitness/tier5-src/himi-branded-lite-place-summary/index.ts +7 -2
- package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +8 -2
- package/templates/nonprofit-cause/dev/index.ts +31 -15
- package/templates/nonprofit-cause/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-place-summary/index.ts +7 -2
- package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +8 -2
- package/templates/podcast-creator/dev/index.ts +29 -14
- package/templates/podcast-creator/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/podcast-creator/tier5-src/himi-branded-lite-place-summary/index.ts +7 -2
- package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +8 -2
- package/templates/portfolio-creative/dev/index.ts +31 -15
- package/templates/portfolio-creative/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +8 -2
- package/templates/restaurant/dev/index.ts +27 -13
- package/templates/restaurant/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/restaurant/tier5-src/himi-store-account/index.ts +8 -2
- package/templates/retail-store/dev/index.ts +25 -12
- package/templates/retail-store/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/retail-store/tier5-src/himi-store-account/index.ts +8 -2
- package/templates/salon-spa/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/salon-spa/tier5-src/himi-booking-service/index.ts +8 -3
- package/templates/salon-spa/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
- package/templates/salon-spa/tier5-src/himi-store-account/index.ts +8 -2
- package/templates/yoga-studio/dev/index.ts +37 -18
- package/templates/yoga-studio/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +8 -3
- package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +7 -2
- package/templates/yoga-studio/tier5-src/himi-branded-lite-place-summary/index.ts +7 -2
- package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +7 -2
- package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +8 -2
|
@@ -240,6 +240,21 @@ export declare function errorState(props?: {
|
|
|
240
240
|
ctaLabel?: string;
|
|
241
241
|
placement?: "screen" | "section";
|
|
242
242
|
}): Component;
|
|
243
|
+
/** #4671 — a scannable QR code generated on-device. Pass a literal `value` or a `valuePath`
|
|
244
|
+
* binding (`$service:` / `$item.`). Accessible name: `modifiers.accessibilityLabel` (default
|
|
245
|
+
* "QR code"); the encoded value is never read out. */
|
|
246
|
+
export declare function qrCode(props: {
|
|
247
|
+
value?: string;
|
|
248
|
+
valuePath?: string;
|
|
249
|
+
size?: number;
|
|
250
|
+
errorCorrection?: "L" | "M" | "Q" | "H";
|
|
251
|
+
color?: string;
|
|
252
|
+
background?: string;
|
|
253
|
+
quietZone?: number;
|
|
254
|
+
}, opts?: {
|
|
255
|
+
id?: string;
|
|
256
|
+
modifiers?: Component["modifiers"];
|
|
257
|
+
}): Component;
|
|
243
258
|
export declare function appIntent(pkg: string, type: string, props: unknown, opts?: {
|
|
244
259
|
id?: string;
|
|
245
260
|
}): Component;
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts
CHANGED
|
@@ -670,6 +670,30 @@ export interface ErrorStateProps {
|
|
|
670
670
|
/** `"screen"` (default, ~96px from the top) or `"section"` (~24px). */
|
|
671
671
|
placement?: "screen" | "section";
|
|
672
672
|
}
|
|
673
|
+
/**
|
|
674
|
+
* A scannable QR code for a literal or bound string, generated ON-DEVICE by every renderer from
|
|
675
|
+
* one shared algorithm (#4671) — no image service sees the payload and it renders offline.
|
|
676
|
+
* Accessible name: `modifiers.accessibilityLabel`, default `"QR code"`; the encoded value is never
|
|
677
|
+
* read out. A colour pair under 3:1 contrast falls back to black on white; in dark mode the code
|
|
678
|
+
* keeps a light background unless both `color` and `background` are given.
|
|
679
|
+
*/
|
|
680
|
+
export interface QrCodeProps {
|
|
681
|
+
/** Literal payload (UTF-8). One of `value` / `valuePath` is required. */
|
|
682
|
+
value?: string;
|
|
683
|
+
/** `$service:` / `$item.` binding for the payload; wins over `value` once it resolves to a
|
|
684
|
+
* non-empty string (until then — no worker yet, an empty field — `value` draws). */
|
|
685
|
+
valuePath?: string;
|
|
686
|
+
/** Side length (pt/dp/px), quiet zone included. Default `160`. */
|
|
687
|
+
size?: number;
|
|
688
|
+
/** Default `"M"`. A literal over the level's capacity is a validator error. */
|
|
689
|
+
errorCorrection?: "L" | "M" | "Q" | "H";
|
|
690
|
+
/** Module colour token. Default `"textPrimary"`. */
|
|
691
|
+
color?: string;
|
|
692
|
+
/** Background colour token. Default `"surfacePrimary"`. */
|
|
693
|
+
background?: string;
|
|
694
|
+
/** Light margin, in modules. Default `4` (the spec minimum). */
|
|
695
|
+
quietZone?: number;
|
|
696
|
+
}
|
|
673
697
|
export interface InterpolatedText {
|
|
674
698
|
template: string;
|
|
675
699
|
params?: Record<string, string>;
|
|
@@ -2503,6 +2527,10 @@ export type CoreComponentBody = {
|
|
|
2503
2527
|
package: "himalaya";
|
|
2504
2528
|
type: "ErrorState";
|
|
2505
2529
|
props: ErrorStateProps;
|
|
2530
|
+
} | {
|
|
2531
|
+
package: "himalaya";
|
|
2532
|
+
type: "QrCode";
|
|
2533
|
+
props: QrCodeProps;
|
|
2506
2534
|
} | {
|
|
2507
2535
|
package: "himalaya";
|
|
2508
2536
|
type: "Text";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./business-contact.js";
|
|
2
2
|
export * from "./business-contact-service.js";
|
|
3
3
|
export * from "./one-app-page.js";
|
|
4
|
+
export * from "./one-app-visibility.js";
|
|
5
|
+
export * from "./one-app-section.js";
|
|
4
6
|
export * from "./invite.js";
|
|
5
7
|
import { entitlement } from "@wix/himalaya/checkout";
|
|
6
8
|
type Node = Record<string, any>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Component } from "@wix/himalaya/core";
|
|
2
|
+
import type { IdentityChange } from "@wix/himalaya/wix-platform";
|
|
3
|
+
import { type OneAppSectionVisibility } from "./one-app-visibility.js";
|
|
4
|
+
/** Structural gate: the hidden subtree is empty, so member controls and their
|
|
5
|
+
* onAppear actions do not mount while signed out. Preserve the child's modifiers. */
|
|
6
|
+
export declare function oneAppSection(content: Component, options: {
|
|
7
|
+
id: string;
|
|
8
|
+
service: string;
|
|
9
|
+
}): Component;
|
|
10
|
+
interface SectionState<T> {
|
|
11
|
+
hidden: boolean;
|
|
12
|
+
visibility: "hidden" | "visible";
|
|
13
|
+
data: T | null;
|
|
14
|
+
loading: boolean;
|
|
15
|
+
error: string;
|
|
16
|
+
}
|
|
17
|
+
/** One service per placement, in the SCREEN bundle. Requires wix_platform for
|
|
18
|
+
* the host identity read and reserved onIdentityChange hook on iOS/macOS,
|
|
19
|
+
* Android and web. Also requires app_info and binary 1.9.0 for those hooks.
|
|
20
|
+
* Member reads belong here, never in an eager sibling worker.
|
|
21
|
+
* Non-auth visibility changes call load after updating their experiment/permission
|
|
22
|
+
* inputs. The hidden state and data are never restored from persisted snapshots. */
|
|
23
|
+
export declare function createOneAppSectionService<T>(options: {
|
|
24
|
+
service: string;
|
|
25
|
+
visibility: OneAppSectionVisibility;
|
|
26
|
+
/** Pass () => auth.getIdentity() from the screen worker's Wix Platform binding.
|
|
27
|
+
* Keeping that import at the call site leaves unrelated screen bundles unchanged. */
|
|
28
|
+
getIdentity: () => Promise<{
|
|
29
|
+
authenticated: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
experiments?: () => Readonly<Record<string, boolean | undefined>>;
|
|
32
|
+
otherAllowed?: () => boolean;
|
|
33
|
+
read?: () => Promise<T>;
|
|
34
|
+
}): import("@wix/himalaya/state", { with: { "resolution-mode": "import" } }).ServiceHandle<SectionState<T>> & {
|
|
35
|
+
beginRead: (...args: never[]) => Promise<SectionState<T>>;
|
|
36
|
+
load: (...args: never[]) => Promise<SectionState<T>>;
|
|
37
|
+
onIdentityChange: (change: IdentityChange) => Promise<SectionState<T>>;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Pinned OneApp definitions omit visitorModeEnabled; the source contract defaults it
|
|
2
|
+
* to false. A collected definition (including an explicit true) takes precedence.
|
|
3
|
+
* These are definition IDs, never translated section titles or instance IDs.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ONE_APP_MEMBER_ONLY_SECTIONS: readonly ["food_section", "newBlog_submit_post_section", "selections", "file_share_section", "events_guests_section", "events_discussion_section", "performance_tracker_section", "achievements_participant_carousel_section", "memberships_packages_section", "upcoming_bookings_section", "loyalty_status_section"];
|
|
6
|
+
export interface OneAppSectionVisibility {
|
|
7
|
+
authentication: "signed-in-only" | "visitor-enabled" | "unresolved";
|
|
8
|
+
visitorModeEnabled: boolean | null;
|
|
9
|
+
visitorModeExperiments: string[];
|
|
10
|
+
experiments: string[];
|
|
11
|
+
source: "collected-definition" | "pinned-definition" | "unresolved";
|
|
12
|
+
}
|
|
13
|
+
/** Keep an unknown definition unresolved instead of declaring an unknown section public.
|
|
14
|
+
* Invalid experiment lists remain unresolved too; dropping an unreadable rule would
|
|
15
|
+
* widen access. An empty, present definition has the source's false default.
|
|
16
|
+
* This resolves a policy, not migration scope: the source graph calls it only for
|
|
17
|
+
* ONE_APP_MEMBER_ONLY_SECTIONS. Do not gate other types on a missing definition. */
|
|
18
|
+
export declare function oneAppSectionVisibility(id: string | undefined, definition?: unknown): OneAppSectionVisibility;
|
|
19
|
+
/** Other permission/OS/paid-plan rules are ANDed by the caller, never overridden
|
|
20
|
+
* by signing in. Unknown experiments fail closed. Visitor experiments only apply
|
|
21
|
+
* to visitors; general experiments still apply after sign-in. */
|
|
22
|
+
export declare function isOneAppSectionVisible(rule: OneAppSectionVisibility, signedIn: boolean | null, experiments?: Readonly<Record<string, boolean | undefined>>, otherAllowed?: boolean): boolean;
|
|
@@ -795,6 +795,43 @@ function oneAppPageSection(page, options) {
|
|
|
795
795
|
} } };
|
|
796
796
|
}
|
|
797
797
|
|
|
798
|
+
// ../../stdlib/flows/screens/src/one-app-visibility.ts
|
|
799
|
+
var ONE_APP_MEMBER_ONLY_SECTIONS = [
|
|
800
|
+
"food_section",
|
|
801
|
+
"newBlog_submit_post_section",
|
|
802
|
+
"selections",
|
|
803
|
+
"file_share_section",
|
|
804
|
+
"events_guests_section",
|
|
805
|
+
"events_discussion_section",
|
|
806
|
+
"performance_tracker_section",
|
|
807
|
+
"achievements_participant_carousel_section",
|
|
808
|
+
"memberships_packages_section",
|
|
809
|
+
"upcoming_bookings_section",
|
|
810
|
+
"loyalty_status_section"
|
|
811
|
+
];
|
|
812
|
+
var memberOnly = /* @__PURE__ */ new Set(ONE_APP_MEMBER_ONLY_SECTIONS);
|
|
813
|
+
var object2 = (v) => v !== null && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
814
|
+
function oneAppSectionVisibility(id2, definition) {
|
|
815
|
+
const d = object2(definition);
|
|
816
|
+
const present = definition !== null && typeof definition === "object" && !Array.isArray(definition);
|
|
817
|
+
const list = (key) => d[key] === void 0 ? [] : Array.isArray(d[key]) && d[key].every((v) => typeof v === "string" && v.length > 0) ? [...d[key]] : null;
|
|
818
|
+
const visitorExperiments = list("visitorModeExperiments"), experiments = list("experiments");
|
|
819
|
+
const valid = visitorExperiments !== null && experiments !== null && (d.visitorModeEnabled === void 0 || typeof d.visitorModeEnabled === "boolean");
|
|
820
|
+
const enabled = present && valid ? d.visitorModeEnabled === true : definition === void 0 && id2 && memberOnly.has(id2) ? false : null;
|
|
821
|
+
return {
|
|
822
|
+
authentication: enabled === null ? "unresolved" : enabled ? "visitor-enabled" : "signed-in-only",
|
|
823
|
+
visitorModeEnabled: enabled,
|
|
824
|
+
visitorModeExperiments: visitorExperiments ?? [],
|
|
825
|
+
experiments: experiments ?? [],
|
|
826
|
+
source: enabled === null ? "unresolved" : present ? "collected-definition" : "pinned-definition"
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
function isOneAppSectionVisible(rule, signedIn, experiments = {}, otherAllowed = true) {
|
|
830
|
+
if (signedIn === null || !otherAllowed || rule.authentication === "unresolved") return false;
|
|
831
|
+
if (!rule.experiments.every((key) => experiments[key] === true)) return false;
|
|
832
|
+
return signedIn || rule.visitorModeEnabled === true && rule.visitorModeExperiments.every((key) => experiments[key] === true);
|
|
833
|
+
}
|
|
834
|
+
|
|
798
835
|
// ../../core/sdk/app-info/src/index.ts
|
|
799
836
|
var PLATFORMS = ["ios", "android", "macos", "web", "react-native"];
|
|
800
837
|
function str(v) {
|
|
@@ -838,6 +875,91 @@ async function get() {
|
|
|
838
875
|
};
|
|
839
876
|
}
|
|
840
877
|
|
|
878
|
+
// ../../stdlib/flows/screens/src/one-app-section.ts
|
|
879
|
+
function oneAppSection(content, options) {
|
|
880
|
+
if (!options.id || !options.service) throw new Error("OneApp sections require stable placement and service IDs");
|
|
881
|
+
return { id: options.id, modifiers: { hiddenPath: `$service:${options.service}.hidden` }, body: { package: "himalaya", type: "FragmentSlot", props: {
|
|
882
|
+
casePath: `$service:${options.service}.visibility`,
|
|
883
|
+
defaultCase: "hidden",
|
|
884
|
+
cases: [
|
|
885
|
+
{ id: "hidden", content: { id: `${options.id}.hidden`, body: { package: "himalaya", type: "VStack", props: { children: [] } } } },
|
|
886
|
+
{ id: "visible", content }
|
|
887
|
+
]
|
|
888
|
+
} } };
|
|
889
|
+
}
|
|
890
|
+
function createOneAppSectionService(options) {
|
|
891
|
+
if (!options.service) throw new Error("OneApp sections require a stable service ID");
|
|
892
|
+
let revision = 0;
|
|
893
|
+
let identity = null;
|
|
894
|
+
let compatible = false;
|
|
895
|
+
let compatibility;
|
|
896
|
+
const host = globalThis.himalaya;
|
|
897
|
+
const checkRuntime = () => compatibility ?? (compatibility = (async () => {
|
|
898
|
+
if (host?.hydrationOptOut !== true || !(host.readLifecycleVersion >= 1)) return false;
|
|
899
|
+
try {
|
|
900
|
+
const info = await get();
|
|
901
|
+
if (info.platform === "web") return host.identityChangeVersion === 1;
|
|
902
|
+
const version = info.binaryVersion;
|
|
903
|
+
const match = /^(\d+)\.(\d+)\.(\d+)(?:-|$)/.exec(version);
|
|
904
|
+
return !!match && (Number(match[1]) > 1 || Number(match[1]) === 1 && Number(match[2]) >= 9);
|
|
905
|
+
} catch {
|
|
906
|
+
return false;
|
|
907
|
+
}
|
|
908
|
+
})());
|
|
909
|
+
const hidden = () => ({ hidden: true, visibility: "hidden", data: null, loading: false, error: "" });
|
|
910
|
+
const allowed = () => compatible && isOneAppSectionVisible(options.visibility, identity, options.experiments?.(), options.otherAllowed?.() ?? true);
|
|
911
|
+
const svc = defineService(options.service, {
|
|
912
|
+
state: hidden(),
|
|
913
|
+
notHydrated: ["hidden", "visibility", "data", "loading", "error"],
|
|
914
|
+
notPersisted: ["hidden", "visibility", "data", "loading", "error"],
|
|
915
|
+
actions: {
|
|
916
|
+
beginRead: () => allowed() ? { hidden: false, visibility: "visible", data: null, loading: !!options.read, error: "" } : hidden(),
|
|
917
|
+
load: async () => {
|
|
918
|
+
const mine = ++revision;
|
|
919
|
+
const supported = await checkRuntime();
|
|
920
|
+
if (mine !== revision) return void 0;
|
|
921
|
+
compatible = supported;
|
|
922
|
+
if (!supported) return hidden();
|
|
923
|
+
if (identity === null) {
|
|
924
|
+
try {
|
|
925
|
+
const who = await options.getIdentity();
|
|
926
|
+
if (mine !== revision) return void 0;
|
|
927
|
+
identity = who.authenticated === true;
|
|
928
|
+
} catch {
|
|
929
|
+
if (mine === revision) return hidden();
|
|
930
|
+
return void 0;
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
if (!allowed()) return hidden();
|
|
934
|
+
await svc.beginRead();
|
|
935
|
+
if (mine !== revision) return void 0;
|
|
936
|
+
if (!allowed()) return hidden();
|
|
937
|
+
try {
|
|
938
|
+
const data = options.read ? await options.read() : null;
|
|
939
|
+
if (mine !== revision) return void 0;
|
|
940
|
+
if (!allowed()) return hidden();
|
|
941
|
+
return { hidden: false, visibility: "visible", data, loading: false, error: "" };
|
|
942
|
+
} catch {
|
|
943
|
+
if (mine !== revision) return void 0;
|
|
944
|
+
return allowed() ? { hidden: false, visibility: "visible", data: null, loading: false, error: "Section data is unavailable." } : hidden();
|
|
945
|
+
}
|
|
946
|
+
},
|
|
947
|
+
onIdentityChange: (_state, change) => {
|
|
948
|
+
++revision;
|
|
949
|
+
identity = change.signedIn === true;
|
|
950
|
+
void Promise.resolve().then(() => svc.load());
|
|
951
|
+
if (allowed()) {
|
|
952
|
+
return { hidden: false, visibility: "visible", data: null, loading: !!options.read, error: "" };
|
|
953
|
+
}
|
|
954
|
+
return hidden();
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
if (host?.hydrationOptOut !== true) Object.assign(svc.getState(), hidden());
|
|
959
|
+
void svc.load();
|
|
960
|
+
return svc;
|
|
961
|
+
}
|
|
962
|
+
|
|
841
963
|
// ../../stdlib/flows/auth/src/copy.generated.ts
|
|
842
964
|
var copy_generated_default = {
|
|
843
965
|
"auth.gate.title": "Welcome",
|
|
@@ -2967,21 +3089,21 @@ function fixedPriceRoute(item, currency) {
|
|
|
2967
3089
|
return typeof amount === "string" && /^\d+(?:\.\d+)?$/.test(amount) && Number.isFinite(Number(amount)) && Number(amount) > 0 && /^[A-Z]{3}$/.test(currency) && item.currency === currency ? "appleIap" : "decide";
|
|
2968
3090
|
}
|
|
2969
3091
|
function bookingAttendanceOf(raw) {
|
|
2970
|
-
const s2 =
|
|
2971
|
-
const payment =
|
|
2972
|
-
const fixed =
|
|
2973
|
-
const price =
|
|
2974
|
-
const options =
|
|
2975
|
-
const policy =
|
|
3092
|
+
const s2 = object3(raw);
|
|
3093
|
+
const payment = object3(s2.payment);
|
|
3094
|
+
const fixed = object3(payment.fixed);
|
|
3095
|
+
const price = object3(fixed.price);
|
|
3096
|
+
const options = object3(payment.options);
|
|
3097
|
+
const policy = object3(object3(s2.bookingPolicy).participantsPolicy);
|
|
2976
3098
|
return {
|
|
2977
3099
|
kind: "bookingsService",
|
|
2978
3100
|
type: text(s2.type),
|
|
2979
3101
|
capacity: numeric(s2.defaultCapacity),
|
|
2980
3102
|
maxParticipantsPerBooking: policy.enabled === true ? numeric(policy.maxParticipantsPerBooking) : void 0,
|
|
2981
3103
|
hidden: boolean(s2.hidden),
|
|
2982
|
-
conferencing: boolean(
|
|
3104
|
+
conferencing: boolean(object3(s2.conferencing).enabled),
|
|
2983
3105
|
locations: Array.isArray(s2.locations) ? s2.locations.map(locationType) : void 0,
|
|
2984
|
-
onlineBooking: boolean(
|
|
3106
|
+
onlineBooking: boolean(object3(s2.onlineBooking).enabled),
|
|
2985
3107
|
onlinePayment: boolean(options.online),
|
|
2986
3108
|
deposit: options.deposit === true || fixed.deposit !== void 0,
|
|
2987
3109
|
priceType: text(payment.rateType),
|
|
@@ -2990,9 +3112,9 @@ function bookingAttendanceOf(raw) {
|
|
|
2990
3112
|
};
|
|
2991
3113
|
}
|
|
2992
3114
|
function locationType(raw) {
|
|
2993
|
-
const location =
|
|
3115
|
+
const location = object3(raw);
|
|
2994
3116
|
const type = text(location.type) ?? "UNKNOWN";
|
|
2995
|
-
const addresses = [
|
|
3117
|
+
const addresses = [object3(location.custom).address, location.calculatedAddress].map(object3);
|
|
2996
3118
|
return type === "CUSTOM" && addresses.every(describesNoPlace) ? ADDRESSLESS_CUSTOM : type;
|
|
2997
3119
|
}
|
|
2998
3120
|
function describesNoPlace(address) {
|
|
@@ -3006,16 +3128,16 @@ function describesNoPlace(address) {
|
|
|
3006
3128
|
}
|
|
3007
3129
|
var ONLINE_LABEL = /^(online|virtual)(\s+(class|classes|classroom|course|session|sessions|meeting|lesson|training|workshop|event))?$/i;
|
|
3008
3130
|
function ticketAttendanceOf(event, definition) {
|
|
3009
|
-
const e =
|
|
3010
|
-
const t =
|
|
3011
|
-
const pricing =
|
|
3012
|
-
const price =
|
|
3013
|
-
const registration =
|
|
3131
|
+
const e = object3(event);
|
|
3132
|
+
const t = object3(definition);
|
|
3133
|
+
const pricing = object3(t.pricingMethod);
|
|
3134
|
+
const price = object3(pricing.fixedPrice);
|
|
3135
|
+
const registration = object3(e.registration);
|
|
3014
3136
|
const type = text(registration.type) ?? text(registration.initialType) ?? text(e.eventType);
|
|
3015
3137
|
const status = text(e.status) ?? text(e.eventStatus);
|
|
3016
3138
|
return {
|
|
3017
3139
|
kind: "eventsTicket",
|
|
3018
|
-
location: text(
|
|
3140
|
+
location: text(object3(e.location).type),
|
|
3019
3141
|
registration: type === "TICKETS" || type === "RSVP_AND_TICKETS" ? "TICKETING" : type,
|
|
3020
3142
|
eventStatus: status === "SCHEDULED" ? "UPCOMING" : status,
|
|
3021
3143
|
saleStatus: text(t.saleStatus),
|
|
@@ -3026,12 +3148,12 @@ function ticketAttendanceOf(event, definition) {
|
|
|
3026
3148
|
};
|
|
3027
3149
|
}
|
|
3028
3150
|
function availableTicketAttendanceOf(event, ticket) {
|
|
3029
|
-
const e =
|
|
3030
|
-
const t =
|
|
3031
|
-
const pricing =
|
|
3032
|
-
const fixed =
|
|
3033
|
-
const price =
|
|
3034
|
-
const visible = Array.isArray(t.state) && t.state.length === 0 &&
|
|
3151
|
+
const e = object3(event);
|
|
3152
|
+
const t = object3(ticket);
|
|
3153
|
+
const pricing = object3(t.pricing);
|
|
3154
|
+
const fixed = object3(pricing.fixedPrice);
|
|
3155
|
+
const price = object3(t.price);
|
|
3156
|
+
const visible = Array.isArray(t.state) && t.state.length === 0 && object3(t.dashboard).hidden !== true && typeof t.id === "string" && t.id.length > 0 && typeof e.id === "string" && e.id.length > 0 && t.eventId === e.id;
|
|
3035
3157
|
const fixedPrice = t.free === false && pricing.pricingType === "STANDARD" && sameTicketAmount(fixed.amount, price.amount) && fixed.currency === price.currency;
|
|
3036
3158
|
return ticketAttendanceOf(e, {
|
|
3037
3159
|
hidden: visible ? false : void 0,
|
|
@@ -3044,7 +3166,7 @@ function sameTicketAmount(left, right) {
|
|
|
3044
3166
|
const normalized = (value) => value.replace(/^0+(?=\d)/, "").replace(/(\.\d*?)0+$/, "$1").replace(/\.$/, "");
|
|
3045
3167
|
return valid(left) && valid(right) && normalized(left) === normalized(right);
|
|
3046
3168
|
}
|
|
3047
|
-
function
|
|
3169
|
+
function object3(value) {
|
|
3048
3170
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
3049
3171
|
}
|
|
3050
3172
|
var text = (value) => typeof value === "string" ? value : void 0;
|
|
@@ -5679,6 +5801,7 @@ function checkoutScreen(opts) {
|
|
|
5679
5801
|
});
|
|
5680
5802
|
}
|
|
5681
5803
|
export {
|
|
5804
|
+
ONE_APP_MEMBER_ONLY_SECTIONS,
|
|
5682
5805
|
authScreen,
|
|
5683
5806
|
businessContactLink,
|
|
5684
5807
|
businessContactPoint,
|
|
@@ -5690,6 +5813,7 @@ export {
|
|
|
5690
5813
|
createCheckoutService,
|
|
5691
5814
|
createInviteAvailabilityService,
|
|
5692
5815
|
createInviteService,
|
|
5816
|
+
createOneAppSectionService,
|
|
5693
5817
|
decodeOneAppPage,
|
|
5694
5818
|
detailedHeader,
|
|
5695
5819
|
entitlement,
|
|
@@ -5697,7 +5821,10 @@ export {
|
|
|
5697
5821
|
inviteButton,
|
|
5698
5822
|
inviteScreen,
|
|
5699
5823
|
isOneAppPageId,
|
|
5824
|
+
isOneAppSectionVisible,
|
|
5700
5825
|
oneAppPageContentErrorCode,
|
|
5701
|
-
oneAppPageSection
|
|
5826
|
+
oneAppPageSection,
|
|
5827
|
+
oneAppSection,
|
|
5828
|
+
oneAppSectionVisibility
|
|
5702
5829
|
};
|
|
5703
5830
|
//# sourceMappingURL=screens.mjs.map
|
|
@@ -8800,6 +8800,13 @@ function errorState(props = {}) {
|
|
|
8800
8800
|
body: { package: "himalaya", type: "ErrorState", props }
|
|
8801
8801
|
};
|
|
8802
8802
|
}
|
|
8803
|
+
function qrCode(props, opts) {
|
|
8804
|
+
return {
|
|
8805
|
+
id: opts?.id ?? auto("qr_code"),
|
|
8806
|
+
body: { package: "himalaya", type: "QrCode", props },
|
|
8807
|
+
...opts?.modifiers ? { modifiers: opts.modifiers } : {}
|
|
8808
|
+
};
|
|
8809
|
+
}
|
|
8803
8810
|
function appIntent(pkg, type, props, opts) {
|
|
8804
8811
|
return {
|
|
8805
8812
|
id: opts?.id ?? auto(type.toLowerCase()),
|
|
@@ -9511,6 +9518,7 @@ export {
|
|
|
9511
9518
|
picker,
|
|
9512
9519
|
popover,
|
|
9513
9520
|
progressBar,
|
|
9521
|
+
qrCode,
|
|
9514
9522
|
rating,
|
|
9515
9523
|
richContent,
|
|
9516
9524
|
richContentEditor,
|