@wix/himalaya-cli 0.1578.0 → 0.1580.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/calendar/src/index.d.ts +42 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/motion/src/index.d.ts +51 -5
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/media/src/index.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/media/src/rendition.d.ts +42 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +46 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +23 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-media.mjs +78 -0
- package/dist/cli.mjs +9027 -7450
- package/dist/preview-assets.generated.bin +0 -0
- package/dist/quickjs-intl.js +462 -0
- package/dist/quickjs-web-globals.js +540 -0
- package/dist/quickjs-worker-entry.js +313 -0
- package/guides/himi-json-output.md +30 -1
- package/guides/one-app-section-mappings.md +30 -5
- package/guides/one-app-to-himi-app.md +214 -6
- package/guides/one-app-viewer.md +2 -2
- package/guides/sdk-reference.json +79 -7
- package/guides/web-page-sdk-reference.md +1 -1
- package/package.json +3 -2
- package/templates/beauty-salon/dev/index.ts +14 -0
- package/templates/beauty-salon/tier5-src/_shared/himi-bookings.ts +21 -0
- package/templates/beauty-salon/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/beauty-salon/tier5-src/himi-booking-services/index.ts +36 -12
- package/templates/beauty-salon-owner/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/branded-lite/dev/index.ts +14 -0
- package/templates/branded-lite/tier5-src/_shared/himi-bookings.ts +21 -0
- package/templates/branded-lite/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/branded-lite/tier5-src/himi-booking-services/index.ts +36 -12
- package/templates/branded-lite/tier5-src/himi-branded-lite-programs/index.ts +40 -2
- package/templates/brandy/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/community-club/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/community-club-owner/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/events-meetups/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/events-meetups-owner/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/gym-fitness/dev/index.ts +14 -0
- package/templates/gym-fitness/tier5-src/_shared/himi-bookings.ts +21 -0
- package/templates/gym-fitness/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/gym-fitness/tier5-src/himi-booking-services/index.ts +36 -12
- package/templates/gym-fitness-owner/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/himi-chat/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/nonprofit-cause/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/nonprofit-cause-owner/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/owner-lite/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/podcast-creator/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/podcast-creator-owner/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/portfolio-creative/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/portfolio-creative-owner/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/restaurant/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/restaurant-owner/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/retail-store/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/retail-store-owner/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/yoga-studio/dev/index.ts +14 -0
- package/templates/yoga-studio/tier5-src/_shared/himi-bookings.ts +21 -0
- package/templates/yoga-studio/tier5-src/_shared/himi-copy.ts +8 -3
- package/templates/yoga-studio/tier5-src/himi-booking-services/index.ts +36 -12
- package/templates/yoga-studio/tier5-src/himi-branded-lite-programs/index.ts +40 -2
- package/templates/yoga-studio-owner/tier5-src/_shared/himi-copy.ts +8 -3
|
@@ -23,6 +23,8 @@ export declare function getPermissionStatus(): Promise<PermissionStatus>;
|
|
|
23
23
|
export declare function requestPermission(access?: CalendarAccess): Promise<PermissionStatus>;
|
|
24
24
|
/** Events overlapping [start, end) (epoch ms). Requires full access. */
|
|
25
25
|
export declare function listEvents(start: number, end: number): Promise<CalendarEvent[]>;
|
|
26
|
+
/** Create an event directly. Needs calendar access — to let the user add an event with
|
|
27
|
+
* NO permission prompt, use {@link presentEditor} (the system editor) instead. */
|
|
26
28
|
export declare function createEvent(event: NewCalendarEvent): Promise<{
|
|
27
29
|
id: string | null;
|
|
28
30
|
}>;
|
|
@@ -32,4 +34,44 @@ export declare function updateEvent(id: string, patch: Partial<NewCalendarEvent>
|
|
|
32
34
|
export declare function deleteEvent(id: string): Promise<{
|
|
33
35
|
deleted: boolean;
|
|
34
36
|
}>;
|
|
37
|
+
/** A calendar the user has, from {@link listCalendars}. `color` is `#RRGGBB` ("" if unknown). */
|
|
38
|
+
export interface CalendarInfo {
|
|
39
|
+
id: string;
|
|
40
|
+
title: string;
|
|
41
|
+
color: string;
|
|
42
|
+
allowsModifications: boolean;
|
|
43
|
+
isPrimary: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** What {@link presentEditor} resolved with. `saved` is false on cancel. `id` is the new
|
|
46
|
+
* event's id when the platform can report it — always `null` on Android (ACTION_INSERT
|
|
47
|
+
* returns no id) and on web, and `null` on iOS without full access. On web, `downloaded`
|
|
48
|
+
* is true when an .ics file was handed to the browser (the user imports it themselves,
|
|
49
|
+
* so `saved` stays false). */
|
|
50
|
+
export interface CalendarEditorResult {
|
|
51
|
+
saved: boolean;
|
|
52
|
+
id: string | null;
|
|
53
|
+
downloaded?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/** How the system viewer was closed. Android reports `done` always (ACTION_VIEW has no result). */
|
|
56
|
+
export type CalendarViewerAction = "done" | "responded" | "deleted";
|
|
57
|
+
/**
|
|
58
|
+
* Open the system event editor prefilled with `event`; the user saves or cancels. Needs
|
|
59
|
+
* NO calendar permission (the OS editor writes the event, not the app). Resolves
|
|
60
|
+
* `{ saved: false, id: null }` on cancel. Web downloads an .ics instead; macOS rejects
|
|
61
|
+
* `unavailable` (no system editor there).
|
|
62
|
+
*/
|
|
63
|
+
export declare function presentEditor(event?: Partial<NewCalendarEvent>): Promise<CalendarEditorResult>;
|
|
64
|
+
/**
|
|
65
|
+
* Show an existing event in the system viewer (iOS EKEventViewController, Android
|
|
66
|
+
* ACTION_VIEW). Needs full calendar access — rejects `permission_denied` without it, and
|
|
67
|
+
* `not_found` when the id does not resolve. Web and macOS reject `unavailable`.
|
|
68
|
+
*/
|
|
69
|
+
export declare function presentViewer(id: string): Promise<{
|
|
70
|
+
action: CalendarViewerAction;
|
|
71
|
+
}>;
|
|
72
|
+
/** The user's calendars. Needs full access — rejects `permission_denied` without it. */
|
|
73
|
+
export declare function listCalendars(): Promise<CalendarInfo[]>;
|
|
74
|
+
/** One event by id, or `null` when it does not resolve. Needs full access — rejects
|
|
75
|
+
* `permission_denied` without it. */
|
|
76
|
+
export declare function getEvent(id: string): Promise<CalendarEvent | null>;
|
|
35
77
|
export declare const version = 1;
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/motion/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PermissionStatus } from "@wix/himalaya/sdk-types";
|
|
2
2
|
export type { PermissionStatus } from "@wix/himalaya/sdk-types";
|
|
3
|
-
/** Which sensor a watch streams. */
|
|
4
|
-
export type MotionSensor = "steps" | "altitude" | "heading";
|
|
3
|
+
/** Which sensor (or gesture event) a watch streams. */
|
|
4
|
+
export type MotionSensor = "steps" | "altitude" | "heading" | "accelerometer" | "gyroscope" | "magnetometer" | "shake" | "tilt" | "significantMotion";
|
|
5
5
|
/**
|
|
6
6
|
* Whether `getStepCount` can answer a PAST window right now, and if not, what would fix it.
|
|
7
7
|
*
|
|
@@ -26,6 +26,18 @@ export interface MotionAvailability {
|
|
|
26
26
|
/** Whether `getStepCount` can answer a past window — see {@link StepHistoryStatus}. An
|
|
27
27
|
* unknown or absent value reads as "unsupported", never as "available". */
|
|
28
28
|
stepHistory: StepHistoryStatus;
|
|
29
|
+
/** Accelerometer present (web: DeviceMotion exists — false on desktop browsers). */
|
|
30
|
+
accelerometer: boolean;
|
|
31
|
+
/** Gyroscope present (web: DeviceMotion rotationRate). */
|
|
32
|
+
gyroscope: boolean;
|
|
33
|
+
/** Raw magnetometer present. Always false on web — no browser exposes one by default. */
|
|
34
|
+
magnetometer: boolean;
|
|
35
|
+
/** Shake events can be detected (needs an accelerometer). */
|
|
36
|
+
shake: boolean;
|
|
37
|
+
/** Tilt events can be detected (needs an accelerometer). */
|
|
38
|
+
tilt: boolean;
|
|
39
|
+
/** Significant-motion events can be detected (a hardware trigger or an accelerometer). */
|
|
40
|
+
significantMotion: boolean;
|
|
29
41
|
}
|
|
30
42
|
export interface StepSample {
|
|
31
43
|
/** Steps in the sampled window (a DELTA, not a lifetime total). */
|
|
@@ -63,7 +75,31 @@ export interface HeadingSample {
|
|
|
63
75
|
accuracy: number;
|
|
64
76
|
timestamp: number;
|
|
65
77
|
}
|
|
66
|
-
export type MotionSample = StepSample | AltitudeSample | HeadingSample
|
|
78
|
+
export type MotionSample = StepSample | AltitudeSample | HeadingSample
|
|
79
|
+
/** accelerometer / gyroscope / magnetometer: one raw reading. Units: accelerometer g (gravity
|
|
80
|
+
* included; flat face-up ⇒ z ≈ +1 on every platform), gyroscope rad/s, magnetometer µT. */
|
|
81
|
+
| {
|
|
82
|
+
x: number;
|
|
83
|
+
y: number;
|
|
84
|
+
z: number;
|
|
85
|
+
timestampMs: number;
|
|
86
|
+
}
|
|
87
|
+
/** shake: ONE event per shake. `magnitude` is the shake's peak total acceleration, g. */
|
|
88
|
+
| {
|
|
89
|
+
magnitude: number;
|
|
90
|
+
timestampMs: number;
|
|
91
|
+
}
|
|
92
|
+
/** tilt: attitude relative to gravity, degrees. Flat face-up is { pitch: 0, roll: 0 }; pitch is
|
|
93
|
+
* positive when the top edge rises, roll positive when the right edge dips. */
|
|
94
|
+
| {
|
|
95
|
+
pitch: number;
|
|
96
|
+
roll: number;
|
|
97
|
+
timestampMs: number;
|
|
98
|
+
}
|
|
99
|
+
/** significantMotion: the device started moving after a period at rest. */
|
|
100
|
+
| {
|
|
101
|
+
timestampMs: number;
|
|
102
|
+
};
|
|
67
103
|
/**
|
|
68
104
|
* Motion permission status. iOS gates CMPedometer behind a motion authorization;
|
|
69
105
|
* Android 10+ gates the step counter behind runtime ACTIVITY_RECOGNITION. Altitude and
|
|
@@ -121,8 +157,11 @@ export declare function getHeading(): Promise<HeadingSample | null>;
|
|
|
121
157
|
export interface MotionWatchOptions {
|
|
122
158
|
/** Which sensor to stream. Defaults to "steps". */
|
|
123
159
|
sensor?: MotionSensor;
|
|
124
|
-
/** Requested sample interval, ms.
|
|
125
|
-
*
|
|
160
|
+
/** Requested sample interval, ms. For the raw sensors (accelerometer / gyroscope /
|
|
161
|
+
* magnetometer) it is clamped to 16–1000 ms (default 100) and honoured, subject to the
|
|
162
|
+
* 60-samples/s ceiling. For steps / altitude / heading the platform treats it as a hint and
|
|
163
|
+
* may deliver faster (heading is event-driven) or slower (a step sample needs steps to have
|
|
164
|
+
* happened). Ignored by the gesture events, which fire when the gesture happens. */
|
|
126
165
|
intervalMs?: number;
|
|
127
166
|
/** Per-poll bridge timeout. Rarely needs changing — see DEFAULT_POLL_TIMEOUT_MS. */
|
|
128
167
|
pollTimeoutMs?: number;
|
|
@@ -149,6 +188,13 @@ export interface MotionWatcher<T extends MotionSample = MotionSample> extends As
|
|
|
149
188
|
* ```
|
|
150
189
|
*
|
|
151
190
|
* Type the stream by passing the sample type: `watch<HeadingSample>({ sensor: "heading" })`.
|
|
191
|
+
*
|
|
192
|
+
* ```ts
|
|
193
|
+
* // Shake to reroll.
|
|
194
|
+
* for await (const _ of watch({ sensor: "shake" })) reroll();
|
|
195
|
+
* // Tilt to steer.
|
|
196
|
+
* for await (const t of watch<{ pitch: number; roll: number; timestampMs: number }>({ sensor: "tilt" })) steer(t.roll);
|
|
197
|
+
* ```
|
|
152
198
|
*/
|
|
153
199
|
export declare function watch<T extends MotionSample = MotionSample>(options?: MotionWatchOptions): MotionWatcher<T>;
|
|
154
200
|
export declare const version = 1;
|
|
@@ -5,7 +5,7 @@ export declare const CAPABILITY_REGISTRY: {
|
|
|
5
5
|
readonly base44: readonly ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"];
|
|
6
6
|
readonly biometrics: readonly ["available", "confirm"];
|
|
7
7
|
readonly browser_auth: readonly ["start"];
|
|
8
|
-
readonly calendar: readonly ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"];
|
|
8
|
+
readonly calendar: readonly ["createEvent", "deleteEvent", "getEvent", "getPermissionStatus", "listCalendars", "listEvents", "presentEditor", "presentViewer", "requestPermission", "updateEvent"];
|
|
9
9
|
readonly calls: readonly ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"];
|
|
10
10
|
readonly camera: readonly ["capture", "pickDocument", "prepareImage", "scanQR"];
|
|
11
11
|
readonly clipboard: readonly ["hasImage", "hasText", "readText", "writeImage", "writeText"];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** Pure rendition policy shared by web/RN. Native mirrors use the same request fixtures. */
|
|
2
|
+
export interface ImageTarget {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
scale: number;
|
|
6
|
+
mode?: string;
|
|
7
|
+
maxEdge?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The pixel size an image is requested at for a box of `width`×`height` points at `scale`: the box in pixels,
|
|
11
|
+
* its longer edge rounded up to a shared bucket (96 … 1400, or up to `maxEdge`, at most 4096) so nearby sizes
|
|
12
|
+
* share one cached rendition. A size it returns maps to itself. An invalid box asks for `maxEdge` square.
|
|
13
|
+
*/
|
|
14
|
+
export declare function imagePixelSize(width: number, height: number, scale: number, maxEdge?: number): {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
/** Keep the caller's source untouched: this URL belongs to a display request, not entity data. */
|
|
19
|
+
export declare function resolveImageRendition(source: string, target: ImageTarget): {
|
|
20
|
+
url: string;
|
|
21
|
+
family: string;
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
export interface ImageCandidate {
|
|
26
|
+
url: string;
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The renditions a renderer offers for one image, smallest first, so the HOST picks among them by
|
|
32
|
+
* its own layout and pixel density (web `srcset`, a React Native `source` array) with no
|
|
33
|
+
* measurement code of ours. A fixed box gets one candidate per screen density; a fluid one (no
|
|
34
|
+
* numeric width) gets fluid widths, its height from `ratio` when known. A source that cannot be
|
|
35
|
+
* resized safely yields exactly itself.
|
|
36
|
+
*/
|
|
37
|
+
export declare function imageCandidates(source: string, box: {
|
|
38
|
+
width?: number;
|
|
39
|
+
height?: number;
|
|
40
|
+
ratio?: number;
|
|
41
|
+
mode?: string;
|
|
42
|
+
}, scales?: number[]): ImageCandidate[];
|
|
@@ -20,7 +20,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
20
20
|
"base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
|
|
21
21
|
"biometrics": ["available", "confirm"],
|
|
22
22
|
"browser_auth": ["start"],
|
|
23
|
-
"calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
|
|
23
|
+
"calendar": ["createEvent", "deleteEvent", "getEvent", "getPermissionStatus", "listCalendars", "listEvents", "presentEditor", "presentViewer", "requestPermission", "updateEvent"],
|
|
24
24
|
"calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
|
|
25
25
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
26
26
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
@@ -20,7 +20,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
20
20
|
"base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
|
|
21
21
|
"biometrics": ["available", "confirm"],
|
|
22
22
|
"browser_auth": ["start"],
|
|
23
|
-
"calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
|
|
23
|
+
"calendar": ["createEvent", "deleteEvent", "getEvent", "getPermissionStatus", "listCalendars", "listEvents", "presentEditor", "presentViewer", "requestPermission", "updateEvent"],
|
|
24
24
|
"calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
|
|
25
25
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
26
26
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
@@ -101,12 +101,57 @@ async function deleteEvent(id) {
|
|
|
101
101
|
const r = await dispatch("capability.calendar.deleteEvent", { id });
|
|
102
102
|
return { deleted: r?.deleted === true };
|
|
103
103
|
}
|
|
104
|
+
function draftParams(event) {
|
|
105
|
+
const params = {};
|
|
106
|
+
if (event.title !== void 0 && event.title !== "") params.title = event.title;
|
|
107
|
+
if (typeof event.start === "number" && Number.isFinite(event.start)) params.start = event.start;
|
|
108
|
+
if (typeof event.end === "number" && Number.isFinite(event.end)) params.end = event.end;
|
|
109
|
+
if (event.allDay) params.allDay = true;
|
|
110
|
+
if (event.location) params.location = event.location;
|
|
111
|
+
if (event.notes) params.notes = event.notes;
|
|
112
|
+
return params;
|
|
113
|
+
}
|
|
114
|
+
async function presentEditor(event = {}) {
|
|
115
|
+
const r = await dispatch("capability.calendar.presentEditor", draftParams(event));
|
|
116
|
+
const out = { saved: r?.saved === true, id: typeof r?.id === "string" && r.id !== "" ? r.id : null };
|
|
117
|
+
if (r?.downloaded === true) out.downloaded = true;
|
|
118
|
+
return out;
|
|
119
|
+
}
|
|
120
|
+
async function presentViewer(id) {
|
|
121
|
+
const r = await dispatch("capability.calendar.presentViewer", { id });
|
|
122
|
+
const action = r?.action === "responded" || r?.action === "deleted" ? r.action : "done";
|
|
123
|
+
return { action };
|
|
124
|
+
}
|
|
125
|
+
async function listCalendars() {
|
|
126
|
+
const r = await dispatch("capability.calendar.listCalendars");
|
|
127
|
+
if (!Array.isArray(r?.items)) return [];
|
|
128
|
+
return r.items.flatMap((raw) => {
|
|
129
|
+
const c = raw;
|
|
130
|
+
if (!c || typeof c.id !== "string" || c.id === "") return [];
|
|
131
|
+
return [{
|
|
132
|
+
id: c.id,
|
|
133
|
+
title: typeof c.title === "string" ? c.title : "",
|
|
134
|
+
color: typeof c.color === "string" ? c.color : "",
|
|
135
|
+
allowsModifications: c.allowsModifications === true,
|
|
136
|
+
isPrimary: c.isPrimary === true
|
|
137
|
+
}];
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
async function getEvent(id) {
|
|
141
|
+
const r = await dispatch("capability.calendar.getEvent", { id });
|
|
142
|
+
const e = r?.event;
|
|
143
|
+
return e && typeof e.id === "string" && e.id !== "" ? e : null;
|
|
144
|
+
}
|
|
104
145
|
var version = 1;
|
|
105
146
|
export {
|
|
106
147
|
createEvent,
|
|
107
148
|
deleteEvent,
|
|
149
|
+
getEvent,
|
|
108
150
|
getPermissionStatus,
|
|
151
|
+
listCalendars,
|
|
109
152
|
listEvents,
|
|
153
|
+
presentEditor,
|
|
154
|
+
presentViewer,
|
|
110
155
|
requestPermission,
|
|
111
156
|
updateEvent,
|
|
112
157
|
version
|
|
@@ -20,7 +20,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
20
20
|
"base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
|
|
21
21
|
"biometrics": ["available", "confirm"],
|
|
22
22
|
"browser_auth": ["start"],
|
|
23
|
-
"calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
|
|
23
|
+
"calendar": ["createEvent", "deleteEvent", "getEvent", "getPermissionStatus", "listCalendars", "listEvents", "presentEditor", "presentViewer", "requestPermission", "updateEvent"],
|
|
24
24
|
"calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
|
|
25
25
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
26
26
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
@@ -20,7 +20,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
20
20
|
"base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
|
|
21
21
|
"biometrics": ["available", "confirm"],
|
|
22
22
|
"browser_auth": ["start"],
|
|
23
|
-
"calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
|
|
23
|
+
"calendar": ["createEvent", "deleteEvent", "getEvent", "getPermissionStatus", "listCalendars", "listEvents", "presentEditor", "presentViewer", "requestPermission", "updateEvent"],
|
|
24
24
|
"calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
|
|
25
25
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
26
26
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
@@ -20,7 +20,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
20
20
|
"base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
|
|
21
21
|
"biometrics": ["available", "confirm"],
|
|
22
22
|
"browser_auth": ["start"],
|
|
23
|
-
"calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
|
|
23
|
+
"calendar": ["createEvent", "deleteEvent", "getEvent", "getPermissionStatus", "listCalendars", "listEvents", "presentEditor", "presentViewer", "requestPermission", "updateEvent"],
|
|
24
24
|
"calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
|
|
25
25
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
26
26
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
@@ -20,7 +20,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
20
20
|
"base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
|
|
21
21
|
"biometrics": ["available", "confirm"],
|
|
22
22
|
"browser_auth": ["start"],
|
|
23
|
-
"calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
|
|
23
|
+
"calendar": ["createEvent", "deleteEvent", "getEvent", "getPermissionStatus", "listCalendars", "listEvents", "presentEditor", "presentViewer", "requestPermission", "updateEvent"],
|
|
24
24
|
"calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
|
|
25
25
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
26
26
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
@@ -66,6 +66,19 @@ function normalizePermissionStatus(s) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// ../../core/sdk/motion/src/index.ts
|
|
69
|
+
var MIN_RAW_INTERVAL_MS = 16;
|
|
70
|
+
var MAX_RAW_INTERVAL_MS = 1e3;
|
|
71
|
+
var DEFAULT_RAW_INTERVAL_MS = 100;
|
|
72
|
+
var RAW_SENSORS = ["accelerometer", "gyroscope", "magnetometer"];
|
|
73
|
+
function isRawSensor(sensor) {
|
|
74
|
+
return RAW_SENSORS.includes(sensor);
|
|
75
|
+
}
|
|
76
|
+
function clampRawInterval(intervalMs) {
|
|
77
|
+
if (typeof intervalMs !== "number" || !Number.isFinite(intervalMs) || intervalMs <= 0) {
|
|
78
|
+
return DEFAULT_RAW_INTERVAL_MS;
|
|
79
|
+
}
|
|
80
|
+
return Math.min(MAX_RAW_INTERVAL_MS, Math.max(MIN_RAW_INTERVAL_MS, Math.round(intervalMs)));
|
|
81
|
+
}
|
|
69
82
|
var STEP_HISTORY_STATUSES = [
|
|
70
83
|
"available",
|
|
71
84
|
"needs_permission",
|
|
@@ -87,7 +100,13 @@ async function availability() {
|
|
|
87
100
|
steps: r?.steps === true,
|
|
88
101
|
altimeter: r?.altimeter === true,
|
|
89
102
|
heading: r?.heading === true,
|
|
90
|
-
stepHistory: normalizeStepHistory(r?.stepHistory)
|
|
103
|
+
stepHistory: normalizeStepHistory(r?.stepHistory),
|
|
104
|
+
accelerometer: r?.accelerometer === true,
|
|
105
|
+
gyroscope: r?.gyroscope === true,
|
|
106
|
+
magnetometer: r?.magnetometer === true,
|
|
107
|
+
shake: r?.shake === true,
|
|
108
|
+
tilt: r?.tilt === true,
|
|
109
|
+
significantMotion: r?.significantMotion === true
|
|
91
110
|
};
|
|
92
111
|
}
|
|
93
112
|
function normalizeStepHistory(raw) {
|
|
@@ -113,7 +132,8 @@ var DEFAULT_POLL_TIMEOUT_MS = 3e4;
|
|
|
113
132
|
function watch(options) {
|
|
114
133
|
const sensor = options?.sensor ?? "steps";
|
|
115
134
|
const startParams = { sensor };
|
|
116
|
-
if (
|
|
135
|
+
if (isRawSensor(sensor)) startParams.intervalMs = clampRawInterval(options?.intervalMs);
|
|
136
|
+
else if (typeof options?.intervalMs === "number") startParams.intervalMs = options.intervalMs;
|
|
117
137
|
const started = (async () => {
|
|
118
138
|
const r = await dispatch("capability.motion.watchStart", startParams);
|
|
119
139
|
if (!r?.watchId) throw new Error("motion.watch: native handler returned no watchId");
|
|
@@ -20,7 +20,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
20
20
|
"base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
|
|
21
21
|
"biometrics": ["available", "confirm"],
|
|
22
22
|
"browser_auth": ["start"],
|
|
23
|
-
"calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
|
|
23
|
+
"calendar": ["createEvent", "deleteEvent", "getEvent", "getPermissionStatus", "listCalendars", "listEvents", "presentEditor", "presentViewer", "requestPermission", "updateEvent"],
|
|
24
24
|
"calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
|
|
25
25
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
26
26
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
@@ -5,7 +5,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
5
5
|
"base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
|
|
6
6
|
"biometrics": ["available", "confirm"],
|
|
7
7
|
"browser_auth": ["start"],
|
|
8
|
-
"calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
|
|
8
|
+
"calendar": ["createEvent", "deleteEvent", "getEvent", "getPermissionStatus", "listCalendars", "listEvents", "presentEditor", "presentViewer", "requestPermission", "updateEvent"],
|
|
9
9
|
"calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
|
|
10
10
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
11
11
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
@@ -20,7 +20,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
20
20
|
"base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
|
|
21
21
|
"biometrics": ["available", "confirm"],
|
|
22
22
|
"browser_auth": ["start"],
|
|
23
|
-
"calendar": ["createEvent", "deleteEvent", "getPermissionStatus", "listEvents", "requestPermission", "updateEvent"],
|
|
23
|
+
"calendar": ["createEvent", "deleteEvent", "getEvent", "getPermissionStatus", "listCalendars", "listEvents", "presentEditor", "presentViewer", "requestPermission", "updateEvent"],
|
|
24
24
|
"calls": ["answer", "availability", "getPermissionStatus", "getState", "hangup", "listCalls", "offer", "receiveSignal", "reject", "requestPermission", "setMuted", "setRingback", "setSpeaker", "signalNext", "signalStart", "signalStop", "start", "subscribeEvents"],
|
|
25
25
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
26
26
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
@@ -1,3 +1,78 @@
|
|
|
1
|
+
// ../../stdlib/wix-sdk/media/src/rendition.ts
|
|
2
|
+
var BUCKETS = [96, 128, 160, 192, 256, 320, 384, 512, 640, 768, 1024, 1280, 1400, 2048, 2560, 3072, 4096];
|
|
3
|
+
var CREDENTIAL = /(?:[?&])(?:token|expires|signature|x-amz-[^=&#]*|pvt)=/i;
|
|
4
|
+
var WIX = /^(https?:\/\/static\.wixstatic\.com\/media\/([^/?#]+))([^?#]*)([?#].*)?$/i;
|
|
5
|
+
var TRANSFORM = /^\/v1\/(fit|fill)\/([^/]+)\/([^/]+)$/i;
|
|
6
|
+
function imagePixelSize(width, height, scale, maxEdge = 1400) {
|
|
7
|
+
const cap = Number.isFinite(maxEdge) ? Math.max(1, Math.min(4096, Math.floor(maxEdge))) : 1400;
|
|
8
|
+
if (![width, height, scale].every((n) => Number.isFinite(n) && n > 0)) return { width: cap, height: cap };
|
|
9
|
+
const w = Math.ceil(width * scale), h = Math.ceil(height * scale);
|
|
10
|
+
if (!Number.isFinite(w + h)) return { width: cap, height: cap };
|
|
11
|
+
const longest = Math.max(w, h);
|
|
12
|
+
const bucket = Math.min(cap, BUCKETS.find((n) => n >= longest) ?? cap);
|
|
13
|
+
return { width: Math.max(1, Math.ceil(w * bucket / longest)), height: Math.max(1, Math.ceil(h * bucket / longest)) };
|
|
14
|
+
}
|
|
15
|
+
function resolveImageRendition(source, target) {
|
|
16
|
+
const pixels = imagePixelSize(target.width, target.height, target.scale, target.maxEdge);
|
|
17
|
+
const result = { ...pixels, url: source, family: source };
|
|
18
|
+
if (CREDENTIAL.test(source) || /[?&][^=&#]*%[0-9a-f]{2}[^=&#]*=/i.test(source)) return result;
|
|
19
|
+
const wix = WIX.exec(source);
|
|
20
|
+
if (!wix) return result;
|
|
21
|
+
const [, base, id, path, suffix = ""] = wix;
|
|
22
|
+
const transform = path ? TRANSFORM.exec(path) : null;
|
|
23
|
+
if (path && !transform) return result;
|
|
24
|
+
const mode = transform?.[1].toLowerCase() ?? (target.mode === "fill" ? "fill" : "fit");
|
|
25
|
+
const params = transform?.[2].split(",").filter(Boolean) ?? [];
|
|
26
|
+
const dimension = (key) => {
|
|
27
|
+
const param = params.find((p) => new RegExp(`^${key}_[0-9]+$`, "i").test(p));
|
|
28
|
+
return param ? Number(param.slice(2)) : 0;
|
|
29
|
+
};
|
|
30
|
+
const sw = dimension("w"), sh = dimension("h");
|
|
31
|
+
if (transform && (!sw || !sh)) return result;
|
|
32
|
+
const filename = transform?.[3] ?? id;
|
|
33
|
+
const ext = /\.([a-z0-9]+)$/i.exec(filename)?.[1].toLowerCase();
|
|
34
|
+
if (!ext || !["jpg", "jpeg", "png"].includes(ext)) return result;
|
|
35
|
+
const extras = params.filter((p) => !/^(w|h|q)_/i.test(p));
|
|
36
|
+
const quality = params.find((p) => /^q_[0-9]+$/i.test(p)) ?? "q_85";
|
|
37
|
+
let w = pixels.width, h = pixels.height;
|
|
38
|
+
if (transform) {
|
|
39
|
+
if (mode === "fill") {
|
|
40
|
+
const cap = Number.isFinite(target.maxEdge) ? Math.max(1, Math.min(4096, Math.floor(target.maxEdge))) : 1400;
|
|
41
|
+
const covers = target.mode === "fill" || target.mode === "stretch";
|
|
42
|
+
const less = (a, b) => a[0] * b[1] < b[0] * a[1];
|
|
43
|
+
const sx = [w, sw], sy = [h, sh];
|
|
44
|
+
let r = covers === less(sx, sy) ? sy : sx;
|
|
45
|
+
for (const bound of [[1, 1], [cap, Math.max(sw, sh)]]) if (less(bound, r)) r = bound;
|
|
46
|
+
w = Math.max(1, Math.ceil(sw * r[0] / r[1]));
|
|
47
|
+
h = Math.max(1, Math.ceil(sh * r[0] / r[1]));
|
|
48
|
+
} else {
|
|
49
|
+
w = Math.min(w, sw);
|
|
50
|
+
h = Math.min(h, sh);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const gcd = (a, b) => b ? gcd(b, a % b) : a;
|
|
54
|
+
const divisor = gcd(transform ? sw : w, transform ? sh : h);
|
|
55
|
+
const shape = mode === "fill" ? `${(transform ? sw : w) / divisor}:${(transform ? sh : h) / divisor}` : "";
|
|
56
|
+
result.family = `${base}|${mode}|${shape}|${extras.join(",")}${suffix}`;
|
|
57
|
+
if (transform && sw <= pixels.width && sh <= pixels.height) return result;
|
|
58
|
+
result.url = `${base}/v1/${mode}/w_${w},h_${h},${quality}${extras.length ? "," + extras.join(",") : ""}/${transform ? filename : "image." + ext}${suffix}`;
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
var FLUID_WIDTHS = [320, 640, 768, 1024, 1280, 1400, 2048];
|
|
62
|
+
function imageCandidates(source, box, scales = [1, 2, 3]) {
|
|
63
|
+
const fixed = typeof box.width === "number" && box.width > 0 && typeof box.height === "number" && box.height > 0;
|
|
64
|
+
const targets = fixed ? scales.map((scale) => ({ width: box.width, height: box.height, scale, mode: box.mode })) : FLUID_WIDTHS.map((width) => ({ width, height: box.ratio ? width / box.ratio : width, scale: 1, mode: box.ratio ? box.mode : "fit" }));
|
|
65
|
+
const seen = /* @__PURE__ */ new Set();
|
|
66
|
+
const out = [];
|
|
67
|
+
for (const target of targets) {
|
|
68
|
+
const r = resolveImageRendition(source, target);
|
|
69
|
+
if (seen.has(r.url)) continue;
|
|
70
|
+
seen.add(r.url);
|
|
71
|
+
out.push({ url: r.url, width: r.width, height: r.height });
|
|
72
|
+
}
|
|
73
|
+
return out.length > 1 || out[0]?.url !== source ? out : [{ url: source, width: 0, height: 0 }];
|
|
74
|
+
}
|
|
75
|
+
|
|
1
76
|
// ../../stdlib/wix-sdk/media/src/index.ts
|
|
2
77
|
var WIX_LIST_IMAGE = { width: 1e3, height: 1e3, quality: 85 };
|
|
3
78
|
var WIX_DETAIL_IMAGE = { width: 1400, height: 1400, quality: 85 };
|
|
@@ -94,7 +169,10 @@ function isUnsizedWixMedia(url) {
|
|
|
94
169
|
export {
|
|
95
170
|
WIX_DETAIL_IMAGE,
|
|
96
171
|
WIX_LIST_IMAGE,
|
|
172
|
+
imageCandidates,
|
|
173
|
+
imagePixelSize,
|
|
97
174
|
isUnsizedWixMedia,
|
|
175
|
+
resolveImageRendition,
|
|
98
176
|
wixMediaUrl
|
|
99
177
|
};
|
|
100
178
|
//# sourceMappingURL=wix-media.mjs.map
|