@eazo/sdk 0.9.0 → 0.11.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/PROTOCOL.md +3 -4
- package/README.md +1 -15
- package/dist/internal/banner-ui/icons.d.ts +12 -0
- package/dist/internal/banner-ui/icons.d.ts.map +1 -0
- package/dist/internal/banner-ui/icons.js +12 -0
- package/dist/internal/banner-ui/icons.js.map +1 -0
- package/dist/internal/banner-ui/index.d.ts +8 -0
- package/dist/internal/banner-ui/index.d.ts.map +1 -0
- package/dist/internal/banner-ui/index.js +111 -0
- package/dist/internal/banner-ui/index.js.map +1 -0
- package/dist/internal/banner-ui/store-links.d.ts +5 -0
- package/dist/internal/banner-ui/store-links.d.ts.map +1 -0
- package/dist/internal/banner-ui/store-links.js +28 -0
- package/dist/internal/banner-ui/store-links.js.map +1 -0
- package/dist/internal/banner-ui/styles.d.ts +5 -0
- package/dist/internal/banner-ui/styles.d.ts.map +1 -0
- package/dist/internal/banner-ui/styles.js +122 -0
- package/dist/internal/banner-ui/styles.js.map +1 -0
- package/dist/internal/bridge/protocol.d.ts +1 -0
- package/dist/internal/bridge/protocol.d.ts.map +1 -1
- package/dist/internal/bridge/protocol.js +2 -1
- package/dist/internal/bridge/protocol.js.map +1 -1
- package/dist/internal/capabilities/device.d.ts +0 -1
- package/dist/internal/capabilities/device.d.ts.map +1 -1
- package/dist/internal/capabilities/device.js +0 -11
- package/dist/internal/capabilities/device.js.map +1 -1
- package/dist/internal/capabilities/memory.d.ts.map +1 -1
- package/dist/internal/capabilities/memory.js +26 -0
- package/dist/internal/capabilities/memory.js.map +1 -1
- package/dist/internal/store.d.ts.map +1 -1
- package/dist/internal/store.js +0 -1
- package/dist/internal/store.js.map +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +3 -20
- package/dist/react.js.map +1 -1
- package/dist/types.d.ts +0 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/PROTOCOL.md
CHANGED
|
@@ -64,7 +64,7 @@ The `appId` field on `ready` is the Eazo app ID (e.g. `i_xxx`). Hosts that need
|
|
|
64
64
|
- Method names (`fn`): `<capability>.<action>`; action is camelCase
|
|
65
65
|
- Examples: `auth.getToken`, `auth.getSession`, `device.getContext`, `storage.get`
|
|
66
66
|
- Event names (`name`): `<capability>.<event>`; past tense or state descriptor
|
|
67
|
-
- Examples: `auth.changed`, `
|
|
67
|
+
- Examples: `auth.changed`, `auth.loginCancelled`
|
|
68
68
|
|
|
69
69
|
## Capability advertisement
|
|
70
70
|
|
|
@@ -96,6 +96,7 @@ The app checks this list before sending a request; unsupported methods fail imme
|
|
|
96
96
|
| `auth.requestLogin` | `{ preferredProvider?: string }` (optional) | `{ started: boolean }` | Host should display its native login UI and return promptly (don't block on user). The SDK then waits for `auth.changed` (success) or `auth.loginCancelled` (dismiss). If the host can't show native UI, respond `NOT_SUPPORTED` — SDK falls back to the web login UI inside the WebView. |
|
|
97
97
|
| `device.getContext` | — | `DeviceContext` | Usually unused — hello already contains this |
|
|
98
98
|
| `share.compose` | `{ text?: string; images?: string[]; sourceAppId?: string }` | `{ accepted: boolean }` | App hands raw share materials (text + up to 4 images, each `https://...` or `data:image/...;base64,...`) to the host. Host opens its compose surface, AI-drafts a post from the inputs, and lets the user edit and publish. Respond promptly after navigation begins — the SDK times out at 10 s. If the host can't accept the share, respond `NOT_SUPPORTED`; the SDK falls back to a "Continue in the Eazo app" download CTA in the web. Reject with `DENIED` when the host requires a logged-in user and none is signed in. |
|
|
99
|
+
| `memory.reportAction` | `MemoryActionParams` (see `memory.ts`) — same payload posted to `/api/open/gum/action` | — (any data is ignored) | Fire-and-forget side-channel: when the SDK reports a user action, it forwards the same payload to the mobile host so the host can react locally (analytics, on-device memory, UI hints). The HTTP POST to Gum still happens in parallel and is the source of truth. Hosts that don't care about side-channel actions should respond `NOT_SUPPORTED` — the SDK swallows it silently and the HTTP path is unaffected. Hosts MUST NOT block on this request; respond promptly. Sent only when `getHost() === "eazoMobile"`. |
|
|
99
100
|
|
|
100
101
|
### Events
|
|
101
102
|
|
|
@@ -103,7 +104,6 @@ The app checks this list before sending a request; unsupported methods fail imme
|
|
|
103
104
|
|---|---|---|
|
|
104
105
|
| `auth.changed` | `{ authenticated, user, token }` | Login, logout, account switch |
|
|
105
106
|
| `auth.loginCancelled` | — (optional `{ reason?: string }`) | User dismissed the native login UI without authenticating. Causes the app's in-flight `auth.login()` to reject with `DENIED`. |
|
|
106
|
-
| `device.safeArea.changed` | `{ top?, bottom? }` | Keyboard / orientation |
|
|
107
107
|
|
|
108
108
|
## Version evolution
|
|
109
109
|
|
|
@@ -122,8 +122,7 @@ window.addEventListener("message", (e) => {
|
|
|
122
122
|
send({
|
|
123
123
|
ch: "eazo-sdk", v: 1, t: "hello",
|
|
124
124
|
session: { authenticated: true, user, token },
|
|
125
|
-
device: { platform: "mobile", locale: "zh-CN",
|
|
126
|
-
safeArea: { top: 44, bottom: 34 }, backendUrl: "https://api.eazo.ai" },
|
|
125
|
+
device: { platform: "mobile", locale: "zh-CN", backendUrl: "https://api.eazo.ai" },
|
|
127
126
|
capabilities: ["auth.*"],
|
|
128
127
|
});
|
|
129
128
|
}
|
package/README.md
CHANGED
|
@@ -90,23 +90,10 @@ import { device } from "@eazo/sdk";
|
|
|
90
90
|
|
|
91
91
|
device.platform // 'web' | 'mobile'
|
|
92
92
|
device.locale // 'zh-CN' | ...
|
|
93
|
-
device.safeArea // { top: number; bottom: number }
|
|
94
93
|
device.backendUrl // '' when running web-only
|
|
95
94
|
device.getContext() // full DeviceContext
|
|
96
95
|
```
|
|
97
96
|
|
|
98
|
-
`<EazoProvider>` also mirrors `device.safeArea` onto `document.documentElement` as CSS custom properties so app layouts can avoid host chrome without reading device state directly:
|
|
99
|
-
|
|
100
|
-
```css
|
|
101
|
-
/* On the web SDK falls back to 0; inside Eazo Mobile the host fills in the
|
|
102
|
-
effective reserved area (status bar on top, "Hosted by Eazo" chrome on
|
|
103
|
-
the bottom). */
|
|
104
|
-
body {
|
|
105
|
-
padding-top: var(--eazo-safe-area-top, 0px);
|
|
106
|
-
padding-bottom: var(--eazo-safe-area-bottom, 0px);
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
97
|
### `share`
|
|
111
98
|
|
|
112
99
|
Hand share materials (text + images) to the platform's compose surface. Inside the Eazo Mobile WebView the host opens its native compose page, AI-drafts a post from the inputs, and lets the user edit and publish; in a plain browser the SDK shows a "Continue in the Eazo app" CTA pointing to https://eazo.ai/.
|
|
@@ -135,7 +122,7 @@ Rule: inside React render, read reactive state via `useEazo(selector)`. Outside
|
|
|
135
122
|
|
|
136
123
|
```tsx
|
|
137
124
|
const user = useEazo((s) => s.auth.user);
|
|
138
|
-
const { platform,
|
|
125
|
+
const { platform, locale } = useEazo((s) => s.device);
|
|
139
126
|
```
|
|
140
127
|
|
|
141
128
|
### Server (Next.js route handler)
|
|
@@ -173,7 +160,6 @@ interface User {
|
|
|
173
160
|
interface DeviceContext {
|
|
174
161
|
platform: "web" | "mobile";
|
|
175
162
|
locale: string;
|
|
176
|
-
safeArea: { top: number; bottom: number };
|
|
177
163
|
backendUrl: string;
|
|
178
164
|
}
|
|
179
165
|
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type IconProps = {
|
|
3
|
+
size?: number;
|
|
4
|
+
};
|
|
5
|
+
type LogoProps = {
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function EazoLogo({ width, height }: LogoProps): React.ReactElement;
|
|
10
|
+
export declare function CloseIcon({ size }: IconProps): React.ReactElement;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/internal/banner-ui/icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,KAAK,SAAS,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnC,KAAK,SAAS,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,wBAAgB,QAAQ,CAAC,EAAE,KAAU,EAAE,MAAW,EAAE,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CAmCnF;AAED,wBAAgB,SAAS,CAAC,EAAE,IAAS,EAAE,EAAE,SAAS,GAAG,KAAK,CAAC,YAAY,CAgBtE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EazoLogo = EazoLogo;
|
|
4
|
+
exports.CloseIcon = CloseIcon;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
function EazoLogo({ width = 80, height = 22 }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("svg", { fill: "none", width: width, height: height, viewBox: "0 0 102 28", xmlns: "http://www.w3.org/2000/svg", "aria-label": "Eazo", role: "img", children: (0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("path", { fill: "#d4614a", d: "M14 0C20.3203 0 23.4804 0.000304997 25.547 1.83089C25.7666 2.02539 25.9746 2.23342 26.1691 2.45296C27.9997 4.51954 28 7.67968 28 14C28 20.3203 27.9997 23.4804 26.1691 25.547C25.9746 25.7666 25.7666 25.9746 25.547 26.1691C23.4805 27.9998 20.3204 28 14 28C7.67962 28 4.51955 27.9997 2.45296 26.1691C2.23342 25.9746 2.02539 25.7666 1.83089 25.547C0.00030903 23.4804 0 20.3203 0 14C0 7.67964 0.000219325 4.51954 1.83089 2.45296C2.02539 2.23342 2.23342 2.02539 2.45296 1.83089C4.51956 0.000342965 7.67972 0 14 0ZM15.8013 3.55924C15.2979 3.42895 14.7602 3.5169 14.3281 3.7985C13.8963 4.08425 13.6117 4.534 13.5477 5.03809C13.3632 6.49627 13.1268 8.35808 13.0179 9.19889C12.9846 9.46368 12.8013 9.68257 12.5451 9.77083C12.4734 9.79604 12.402 9.82575 12.332 9.85514C12.0798 9.95587 11.7895 9.91005 11.5835 9.73779L8.32731 6.98405C7.93412 6.65208 7.41148 6.50551 6.89518 6.57275C6.37955 6.64433 5.92116 6.93006 5.63737 7.35433L4.35107 9.2832C4.06722 9.70766 3.98665 10.229 4.13005 10.7165C4.27347 11.2039 4.62677 11.6072 5.09847 11.8216C6.46683 12.4436 8.21457 13.2386 9.00407 13.6001C9.25066 13.7093 9.41171 13.9484 9.41878 14.2131C9.42094 14.2887 9.42468 14.3607 9.43245 14.4364C9.45399 14.7009 9.31988 14.9527 9.0861 15.0915L5.39128 17.2528C4.94474 17.5176 4.63617 17.9544 4.5459 18.4502C4.45564 18.9503 4.59324 19.4634 4.92074 19.8584L6.40641 21.6449C6.73437 22.0356 7.22223 22.271 7.74284 22.292C8.26327 22.3087 8.76631 22.1067 9.12142 21.7371L12.1315 18.6017C12.2789 18.4463 12.5035 18.3872 12.7091 18.4502C12.7738 18.4712 12.8399 18.4927 12.9062 18.5094C12.9445 18.5178 12.9831 18.5261 13.0213 18.5345C13.2852 18.5976 13.4898 18.8034 13.5511 19.0597L14.5229 23.1453C14.6405 23.6368 14.9723 24.0565 15.4321 24.2961C15.8921 24.5313 16.436 24.5654 16.9224 24.3849L19.1281 23.5612C19.6144 23.3763 19.9955 23.0021 20.174 22.5233C20.3524 22.0485 20.3099 21.5187 20.0578 21.0775C19.3262 19.7914 18.3921 18.1516 17.9717 17.4077C17.8396 17.1767 17.8537 16.8913 18.0081 16.6729C18.0513 16.6099 18.0939 16.5467 18.1323 16.4837C18.2749 16.2568 18.5369 16.13 18.8091 16.151L23.1032 16.5122C23.6221 16.5584 24.1356 16.3822 24.5103 16.0291C24.8849 15.6761 25.0861 15.1845 25.0571 14.6802L24.9329 12.3856C24.9057 11.877 24.6553 11.4057 24.2448 11.0947C23.8343 10.7837 23.3044 10.662 22.7933 10.7586C21.3099 11.036 19.4153 11.393 18.5584 11.5527C18.2912 11.603 18.0175 11.5028 17.8521 11.293C17.8054 11.2341 17.7568 11.1744 17.7062 11.1198C17.5294 10.9181 17.4849 10.6365 17.5911 10.3929L19.2739 6.5306C19.4774 6.06407 19.4626 5.53381 19.234 5.07568C19.0054 4.62203 18.5854 4.28653 18.0822 4.15625L15.8013 3.55924Z" }), (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M51.1045 22.4374C51.1045 22.7812 50.9227 22.9555 50.5585 22.9555H37.8749C37.5158 22.9555 37.3336 22.7812 37.3336 22.4374V5.18962C37.3336 4.84098 37.5158 4.66663 37.8749 4.66663H50.3714C50.7304 4.66663 50.9124 4.84098 50.9124 5.18962V7.38799C50.9124 7.73662 50.7304 7.91086 50.3714 7.91086H41.0053V11.867H48.2472C48.6063 11.867 48.7885 12.0412 48.7885 12.385V14.443C48.7885 14.7916 48.6063 14.9659 48.2472 14.9659H41.0053V19.7016H50.5585C50.9227 19.7016 51.1045 19.876 51.1045 20.2246V22.4374Z" }), (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M65.1894 7.75115C65.2602 7.45094 65.4523 7.29602 65.7709 7.29602H67.6674C68.0265 7.29602 68.2087 7.47026 68.2087 7.81889V22.4374C68.2087 22.7812 68.0265 22.9555 67.6674 22.9555H65.7307C65.4121 22.9555 65.2197 22.8055 65.1489 22.5004L64.9568 21.0671C64.3803 21.7547 63.6824 22.297 62.8581 22.6892C62.0388 23.0863 61.1032 23.2799 60.0563 23.2799C58.5493 23.2799 57.1787 22.9216 55.9498 22.1953C54.7158 21.469 53.7448 20.4861 53.0317 19.2465C52.3187 18.0069 51.9598 16.6366 51.9598 15.1452C51.9598 13.6635 52.3187 12.2979 53.0317 11.0583C53.7448 9.81868 54.721 8.83581 55.955 8.11916C57.194 7.39768 58.5594 7.03937 60.0563 7.03937C61.1234 7.03937 62.0641 7.23304 62.8884 7.62525C63.7077 8.01263 64.4056 8.55488 64.9872 9.25216L65.1894 7.75115ZM60.1119 20.0793C61.0222 20.0793 61.8467 19.8711 62.58 19.4498C63.3184 19.0285 63.8947 18.4475 64.3145 17.7067C64.7342 16.961 64.9467 16.1281 64.9467 15.1984C64.9467 14.2687 64.7344 13.4261 64.3197 12.6708C63.905 11.9202 63.3333 11.3247 62.6 10.8889C61.8718 10.4579 61.0476 10.24 60.1373 10.24C59.2371 10.24 58.4279 10.4531 57.7149 10.884C57.0018 11.315 56.4454 11.9057 56.0458 12.6611C55.6413 13.4164 55.4391 14.259 55.4391 15.1984C55.4391 16.1377 55.6363 16.9754 56.0308 17.7114C56.4202 18.4474 56.9764 19.0285 57.6894 19.4498C58.4025 19.8711 59.2066 20.0793 60.1119 20.0793Z" }), (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M83.6077 22.4373C83.6077 22.7811 83.4257 22.9555 83.0667 22.9555H70.9495C70.5904 22.9555 70.4084 22.7811 70.4084 22.4373V20.9798C70.4084 20.7426 70.4842 20.5247 70.6359 20.3262L78.6112 10.3416H71.0962C70.7371 10.3416 70.5551 10.1674 70.5551 9.82356V7.81883C70.5551 7.4702 70.7371 7.29596 71.0962 7.29596H82.8089C83.1679 7.29596 83.3499 7.4702 83.3499 7.81883V9.16013C83.3499 9.39255 83.2741 9.61049 83.1173 9.80902L75.0257 19.9097H83.0667C83.4257 19.9097 83.6077 20.0841 83.6077 20.4327V22.4373Z" }), (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M92.8323 23.3332C91.305 23.3332 89.8992 22.9701 88.6045 22.2486C87.3048 21.5223 86.278 20.5393 85.5245 19.29C84.7659 18.0455 84.3866 16.6849 84.3866 15.2129C84.3866 13.7167 84.766 12.3463 85.5297 11.0971C86.2933 9.84777 87.3251 8.86003 88.6248 8.12886C89.9194 7.40253 91.3353 7.03937 92.8575 7.03937C94.3949 7.03937 95.811 7.40253 97.1107 8.12886C98.4104 8.86003 99.4421 9.84777 100.201 11.0971C100.964 12.3463 101.349 13.7167 101.349 15.2129C101.349 16.6849 100.964 18.0455 100.196 19.29C99.427 20.5393 98.3953 21.5223 97.0905 22.2486C95.7857 22.9701 94.3647 23.3332 92.8323 23.3332ZM92.8728 20.1325C93.7679 20.1325 94.5972 19.9147 95.3659 19.4789C96.1295 19.0479 96.7416 18.4524 97.1917 17.7067C97.6418 16.9513 97.8693 16.1184 97.8693 15.1984C97.8693 14.2783 97.6418 13.4407 97.1917 12.6805C96.7416 11.9202 96.1295 11.3247 95.3659 10.8889C94.5972 10.4579 93.7679 10.24 92.8728 10.24C91.9726 10.24 91.1381 10.4579 90.3694 10.8889C89.6007 11.3247 88.9937 11.9202 88.5386 12.6805C88.0885 13.4407 87.8662 14.2783 87.8662 15.1984C87.8662 16.1184 88.0885 16.9513 88.5386 17.7067C88.9937 18.4524 89.6007 19.0479 90.3694 19.4789C91.1381 19.9147 91.9726 20.1325 92.8728 20.1325Z" })] }) }));
|
|
8
|
+
}
|
|
9
|
+
function CloseIcon({ size = 16 }) {
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: (0, jsx_runtime_1.jsx)("path", { d: "M18 6L6 18M6 6l12 12" }) }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../../src/internal/banner-ui/icons.tsx"],"names":[],"mappings":";;AAMA,4BAmCC;AAED,8BAgBC;;AArDD,SAAgB,QAAQ,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAa;IAC7D,OAAO,CACL,gCACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAC,YAAY,EACpB,KAAK,EAAC,4BAA4B,gBACvB,MAAM,EACjB,IAAI,EAAC,KAAK,YAEV,0CACE,iCACE,IAAI,EAAC,SAAS,EACd,CAAC,EAAC,qiFAAqiF,GACviF,EACF,iCACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,8eAA8e,GAChf,EACF,iCACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,uyCAAuyC,GACzyC,EACF,iCACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,ifAAif,GACnf,EACF,iCACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,qpCAAqpC,GACvpC,IACA,GACA,CACP,CAAC;AACJ,CAAC;AAED,SAAgB,SAAS,CAAC,EAAE,IAAI,GAAG,EAAE,EAAa;IAChD,OAAO,CACL,gCACE,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,YAElB,iCAAM,CAAC,EAAC,sBAAsB,GAAG,GAC7B,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Top-of-page promo banner that points users to the Eazo mobile app.
|
|
4
|
+
* Mounted by `<EazoProvider>` and rendered only in pure-web environments
|
|
5
|
+
* (not the eazoMobile WebView, not embedded iframes). Dismissal is per-tab.
|
|
6
|
+
*/
|
|
7
|
+
export declare function EazoBrandBanner(): React.ReactElement | null;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/banner-ui/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuC/B;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,KAAK,CAAC,YAAY,GAAG,IAAI,CA+D3D"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.EazoBrandBanner = EazoBrandBanner;
|
|
38
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
const React = __importStar(require("react"));
|
|
40
|
+
const env_1 = require("../env");
|
|
41
|
+
const icons_1 = require("./icons");
|
|
42
|
+
const store_links_1 = require("./store-links");
|
|
43
|
+
const styles_1 = require("./styles");
|
|
44
|
+
const DISMISS_KEY = "eazo:banner:dismissed";
|
|
45
|
+
const MOBILE_BREAKPOINT_PX = 480;
|
|
46
|
+
function readDismissed() {
|
|
47
|
+
try {
|
|
48
|
+
return window.sessionStorage.getItem(DISMISS_KEY) === "1";
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// Private mode / disabled storage — treat as not dismissed; the close
|
|
52
|
+
// button will still hide it for the lifetime of the page.
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function writeDismissed() {
|
|
57
|
+
try {
|
|
58
|
+
window.sessionStorage.setItem(DISMISS_KEY, "1");
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// Ignore: dismissal still works in-memory via React state.
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function currentBannerHeight() {
|
|
65
|
+
if (typeof window === "undefined")
|
|
66
|
+
return styles_1.BANNER_HEIGHT_DESKTOP;
|
|
67
|
+
return window.innerWidth <= MOBILE_BREAKPOINT_PX
|
|
68
|
+
? styles_1.BANNER_HEIGHT_MOBILE
|
|
69
|
+
: styles_1.BANNER_HEIGHT_DESKTOP;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Top-of-page promo banner that points users to the Eazo mobile app.
|
|
73
|
+
* Mounted by `<EazoProvider>` and rendered only in pure-web environments
|
|
74
|
+
* (not the eazoMobile WebView, not embedded iframes). Dismissal is per-tab.
|
|
75
|
+
*/
|
|
76
|
+
function EazoBrandBanner() {
|
|
77
|
+
const [visible, setVisible] = React.useState(false);
|
|
78
|
+
const [storeUrl, setStoreUrl] = React.useState("");
|
|
79
|
+
React.useEffect(() => {
|
|
80
|
+
if ((0, env_1.getHost)() !== "web")
|
|
81
|
+
return;
|
|
82
|
+
if (readDismissed())
|
|
83
|
+
return;
|
|
84
|
+
(0, styles_1.ensureBannerStylesInjected)();
|
|
85
|
+
setStoreUrl((0, store_links_1.resolveStoreUrl)());
|
|
86
|
+
setVisible(true);
|
|
87
|
+
}, []);
|
|
88
|
+
React.useEffect(() => {
|
|
89
|
+
if (!visible)
|
|
90
|
+
return;
|
|
91
|
+
const html = document.documentElement;
|
|
92
|
+
const previousPaddingTop = html.style.paddingTop;
|
|
93
|
+
const apply = () => {
|
|
94
|
+
html.style.paddingTop = `${currentBannerHeight()}px`;
|
|
95
|
+
};
|
|
96
|
+
apply();
|
|
97
|
+
window.addEventListener("resize", apply);
|
|
98
|
+
return () => {
|
|
99
|
+
window.removeEventListener("resize", apply);
|
|
100
|
+
html.style.paddingTop = previousPaddingTop;
|
|
101
|
+
};
|
|
102
|
+
}, [visible]);
|
|
103
|
+
if (!visible)
|
|
104
|
+
return null;
|
|
105
|
+
const dismiss = () => {
|
|
106
|
+
writeDismissed();
|
|
107
|
+
setVisible(false);
|
|
108
|
+
};
|
|
109
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "eazo-banner-root", role: "region", "aria-label": "Eazo app promotion", children: [(0, jsx_runtime_1.jsx)("span", { className: "eazo-banner-brand", children: (0, jsx_runtime_1.jsx)(icons_1.EazoLogo, { width: 72, height: 20 }) }), (0, jsx_runtime_1.jsx)("span", { className: "eazo-banner-copy", children: "Get the full Eazo experience in our mobile app." }), (0, jsx_runtime_1.jsx)("a", { className: "eazo-banner-cta", href: storeUrl, target: "_blank", rel: "noreferrer noopener", children: "Get the app" }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "eazo-banner-close", "aria-label": "Dismiss banner", onClick: dismiss, children: (0, jsx_runtime_1.jsx)(icons_1.CloseIcon, { size: 16 }) })] }));
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internal/banner-ui/index.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8Cb,0CA+DC;;AA3GD,6CAA+B;AAE/B,gCAAiC;AACjC,mCAA8C;AAC9C,+CAAgD;AAChD,qCAIkB;AAElB,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAC5C,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC,SAAS,aAAa;IACpB,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC;IAC5D,CAAC;IAAC,MAAM,CAAC;QACP,sEAAsE;QACtE,0DAA0D;QAC1D,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,cAAc;IACrB,IAAI,CAAC;QACH,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,2DAA2D;IAC7D,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO,8BAAqB,CAAC;IAChE,OAAO,MAAM,CAAC,UAAU,IAAI,oBAAoB;QAC9C,CAAC,CAAC,6BAAoB;QACtB,CAAC,CAAC,8BAAqB,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,SAAgB,eAAe;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAS,EAAE,CAAC,CAAC;IAE3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EAAE,MAAM,EAAE,EAAE,GAAI,GAC9B,EACP,iCAAM,SAAS,EAAC,kBAAkB,gEAE3B,EACP,8BACE,SAAS,EAAC,iBAAiB,EAC3B,IAAI,EAAE,QAAQ,EACd,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,4BAGvB,EACJ,mCACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,mBAAmB,gBAClB,gBAAgB,EAC3B,OAAO,EAAE,OAAO,YAEhB,uBAAC,iBAAS,IAAC,IAAI,EAAE,EAAE,GAAI,GAChB,IACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const APP_STORE_URL = "https://eazo.ai/";
|
|
2
|
+
export declare const PLAY_STORE_URL = "https://eazo.ai/";
|
|
3
|
+
export declare const MARKETING_URL = "https://eazo.ai/";
|
|
4
|
+
export declare function resolveStoreUrl(): string;
|
|
5
|
+
//# sourceMappingURL=store-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-links.d.ts","sourceRoot":"","sources":["../../../src/internal/banner-ui/store-links.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,qBAAqB,CAAC;AAChD,eAAO,MAAM,cAAc,qBAAqB,CAAC;AACjD,eAAO,MAAM,aAAa,qBAAqB,CAAC;AAUhD,wBAAgB,eAAe,IAAI,MAAM,CAMxC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MARKETING_URL = exports.PLAY_STORE_URL = exports.APP_STORE_URL = void 0;
|
|
4
|
+
exports.resolveStoreUrl = resolveStoreUrl;
|
|
5
|
+
// TODO(banner): replace placeholders once the iOS App Store ID and Android
|
|
6
|
+
// package name are confirmed by the mobile team. Until then, all platforms
|
|
7
|
+
// fall back to the marketing site so users never hit a 404.
|
|
8
|
+
exports.APP_STORE_URL = "https://eazo.ai/";
|
|
9
|
+
exports.PLAY_STORE_URL = "https://eazo.ai/";
|
|
10
|
+
exports.MARKETING_URL = "https://eazo.ai/";
|
|
11
|
+
function detectPlatform(ua) {
|
|
12
|
+
if (/iPhone|iPad|iPod/i.test(ua))
|
|
13
|
+
return "ios";
|
|
14
|
+
if (/Android/i.test(ua))
|
|
15
|
+
return "android";
|
|
16
|
+
return "desktop";
|
|
17
|
+
}
|
|
18
|
+
function resolveStoreUrl() {
|
|
19
|
+
if (typeof navigator === "undefined")
|
|
20
|
+
return exports.MARKETING_URL;
|
|
21
|
+
const platform = detectPlatform(navigator.userAgent);
|
|
22
|
+
if (platform === "ios")
|
|
23
|
+
return exports.APP_STORE_URL;
|
|
24
|
+
if (platform === "android")
|
|
25
|
+
return exports.PLAY_STORE_URL;
|
|
26
|
+
return exports.MARKETING_URL;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=store-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-links.js","sourceRoot":"","sources":["../../../src/internal/banner-ui/store-links.ts"],"names":[],"mappings":";;;AAeA,0CAMC;AArBD,2EAA2E;AAC3E,2EAA2E;AAC3E,4DAA4D;AAC/C,QAAA,aAAa,GAAG,kBAAkB,CAAC;AACnC,QAAA,cAAc,GAAG,kBAAkB,CAAC;AACpC,QAAA,aAAa,GAAG,kBAAkB,CAAC;AAIhD,SAAS,cAAc,CAAC,EAAU;IAChC,IAAI,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/C,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1C,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,eAAe;IAC7B,IAAI,OAAO,SAAS,KAAK,WAAW;QAAE,OAAO,qBAAa,CAAC;IAC3D,MAAM,QAAQ,GAAG,cAAc,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACrD,IAAI,QAAQ,KAAK,KAAK;QAAE,OAAO,qBAAa,CAAC;IAC7C,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,sBAAc,CAAC;IAClD,OAAO,qBAAa,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const BANNER_HEIGHT_DESKTOP = 52;
|
|
2
|
+
export declare const BANNER_HEIGHT_MOBILE = 64;
|
|
3
|
+
export declare const BANNER_UI_CSS = "\n.eazo-banner-root {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 2147483550;\n display: flex;\n align-items: center;\n gap: 12px;\n height: 52px;\n padding: 0 14px 0 18px;\n background: #f1ebe0;\n color: #11130f;\n font-family: inherit;\n box-sizing: border-box;\n animation: eazo-banner-slide-down 220ms cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n@keyframes eazo-banner-slide-down {\n from { transform: translateY(-100%); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n\n.eazo-banner-brand {\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n color: #11130f;\n}\n\n.eazo-banner-copy {\n flex: 1;\n min-width: 0;\n font-size: 14px;\n font-weight: 500;\n color: rgba(17, 19, 15, 0.62);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.eazo-banner-cta {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n height: 34px;\n padding: 0 14px;\n border-radius: 12px;\n background: #d4614a;\n color: #ffffff;\n font-size: 13px;\n font-weight: 600;\n text-decoration: none;\n cursor: pointer;\n transition: filter 160ms ease, box-shadow 160ms ease;\n}\n.eazo-banner-cta:hover {\n filter: brightness(1.06);\n box-shadow: 0 8px 18px rgba(212, 97, 74, 0.36);\n}\n\n.eazo-banner-close {\n flex-shrink: 0;\n width: 28px;\n height: 28px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border: 0;\n border-radius: 999px;\n background: transparent;\n color: rgba(17, 19, 15, 0.52);\n cursor: pointer;\n padding: 0;\n transition: color 120ms ease, background 120ms ease;\n}\n.eazo-banner-close:hover {\n color: #11130f;\n background: rgba(17, 19, 15, 0.06);\n}\n\n@media (max-width: 480px) {\n .eazo-banner-root {\n height: 64px;\n padding: 0 10px 0 14px;\n gap: 10px;\n }\n .eazo-banner-copy {\n font-size: 12px;\n line-height: 1.25;\n white-space: normal;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n }\n .eazo-banner-cta {\n height: 32px;\n padding: 0 12px;\n font-size: 12px;\n }\n}\n";
|
|
4
|
+
export declare function ensureBannerStylesInjected(): void;
|
|
5
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/internal/banner-ui/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,eAAO,MAAM,aAAa,slEAsGzB,CAAC;AAEF,wBAAgB,0BAA0B,IAAI,IAAI,CAQjD"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BANNER_UI_CSS = exports.BANNER_HEIGHT_MOBILE = exports.BANNER_HEIGHT_DESKTOP = void 0;
|
|
4
|
+
exports.ensureBannerStylesInjected = ensureBannerStylesInjected;
|
|
5
|
+
const STYLE_ID = "eazo-sdk-banner-ui";
|
|
6
|
+
exports.BANNER_HEIGHT_DESKTOP = 52;
|
|
7
|
+
exports.BANNER_HEIGHT_MOBILE = 64;
|
|
8
|
+
exports.BANNER_UI_CSS = `
|
|
9
|
+
.eazo-banner-root {
|
|
10
|
+
position: fixed;
|
|
11
|
+
top: 0;
|
|
12
|
+
left: 0;
|
|
13
|
+
right: 0;
|
|
14
|
+
z-index: 2147483550;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 12px;
|
|
18
|
+
height: ${exports.BANNER_HEIGHT_DESKTOP}px;
|
|
19
|
+
padding: 0 14px 0 18px;
|
|
20
|
+
background: #f1ebe0;
|
|
21
|
+
color: #11130f;
|
|
22
|
+
font-family: inherit;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
animation: eazo-banner-slide-down 220ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@keyframes eazo-banner-slide-down {
|
|
28
|
+
from { transform: translateY(-100%); opacity: 0; }
|
|
29
|
+
to { transform: translateY(0); opacity: 1; }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.eazo-banner-brand {
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
flex-shrink: 0;
|
|
36
|
+
color: #11130f;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.eazo-banner-copy {
|
|
40
|
+
flex: 1;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
font-weight: 500;
|
|
44
|
+
color: rgba(17, 19, 15, 0.62);
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.eazo-banner-cta {
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
height: 34px;
|
|
55
|
+
padding: 0 14px;
|
|
56
|
+
border-radius: 12px;
|
|
57
|
+
background: #d4614a;
|
|
58
|
+
color: #ffffff;
|
|
59
|
+
font-size: 13px;
|
|
60
|
+
font-weight: 600;
|
|
61
|
+
text-decoration: none;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
transition: filter 160ms ease, box-shadow 160ms ease;
|
|
64
|
+
}
|
|
65
|
+
.eazo-banner-cta:hover {
|
|
66
|
+
filter: brightness(1.06);
|
|
67
|
+
box-shadow: 0 8px 18px rgba(212, 97, 74, 0.36);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.eazo-banner-close {
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
width: 28px;
|
|
73
|
+
height: 28px;
|
|
74
|
+
display: inline-flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
border: 0;
|
|
78
|
+
border-radius: 999px;
|
|
79
|
+
background: transparent;
|
|
80
|
+
color: rgba(17, 19, 15, 0.52);
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
padding: 0;
|
|
83
|
+
transition: color 120ms ease, background 120ms ease;
|
|
84
|
+
}
|
|
85
|
+
.eazo-banner-close:hover {
|
|
86
|
+
color: #11130f;
|
|
87
|
+
background: rgba(17, 19, 15, 0.06);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@media (max-width: 480px) {
|
|
91
|
+
.eazo-banner-root {
|
|
92
|
+
height: ${exports.BANNER_HEIGHT_MOBILE}px;
|
|
93
|
+
padding: 0 10px 0 14px;
|
|
94
|
+
gap: 10px;
|
|
95
|
+
}
|
|
96
|
+
.eazo-banner-copy {
|
|
97
|
+
font-size: 12px;
|
|
98
|
+
line-height: 1.25;
|
|
99
|
+
white-space: normal;
|
|
100
|
+
display: -webkit-box;
|
|
101
|
+
-webkit-line-clamp: 2;
|
|
102
|
+
-webkit-box-orient: vertical;
|
|
103
|
+
}
|
|
104
|
+
.eazo-banner-cta {
|
|
105
|
+
height: 32px;
|
|
106
|
+
padding: 0 12px;
|
|
107
|
+
font-size: 12px;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
function ensureBannerStylesInjected() {
|
|
112
|
+
if (typeof document === "undefined")
|
|
113
|
+
return;
|
|
114
|
+
if (document.getElementById(STYLE_ID))
|
|
115
|
+
return;
|
|
116
|
+
const style = document.createElement("style");
|
|
117
|
+
style.id = STYLE_ID;
|
|
118
|
+
style.setAttribute("data-eazo-sdk", "banner-ui");
|
|
119
|
+
style.textContent = exports.BANNER_UI_CSS;
|
|
120
|
+
document.head.appendChild(style);
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/internal/banner-ui/styles.ts"],"names":[],"mappings":";;;AA6GA,gEAQC;AArHD,MAAM,QAAQ,GAAG,oBAAoB,CAAC;AAEzB,QAAA,qBAAqB,GAAG,EAAE,CAAC;AAC3B,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAE1B,QAAA,aAAa,GAAG;;;;;;;;;;YAUjB,6BAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0EnB,4BAAoB;;;;;;;;;;;;;;;;;;CAkBjC,CAAC;AAEF,SAAgB,0BAA0B;IACxC,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO;IAC5C,IAAI,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC;QAAE,OAAO;IAC9C,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,GAAG,QAAQ,CAAC;IACpB,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;IACjD,KAAK,CAAC,WAAW,GAAG,qBAAa,CAAC;IAClC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -7,6 +7,7 @@ export declare const AUTH_REQUEST_LOGIN = "auth.requestLogin";
|
|
|
7
7
|
export declare const AUTH_CHANGED_EVENT = "auth.changed";
|
|
8
8
|
export declare const AUTH_LOGIN_CANCELLED_EVENT = "auth.loginCancelled";
|
|
9
9
|
export declare const SHARE_COMPOSE = "share.compose";
|
|
10
|
+
export declare const MEMORY_REPORT_ACTION = "memory.reportAction";
|
|
10
11
|
export type ErrorCode = "NOT_SUPPORTED" | "TIMEOUT" | "DENIED" | "INVALID_ARGS" | "INTERNAL";
|
|
11
12
|
export interface BridgeError {
|
|
12
13
|
code: ErrorCode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/internal/bridge/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEvD,eAAO,MAAM,OAAO,EAAG,UAAmB,CAAC;AAC3C,eAAO,MAAM,OAAO,EAAG,CAAU,CAAC;AAElC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,kBAAkB,QAAS,CAAC;AAGzC,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AACtD,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD,eAAO,MAAM,0BAA0B,wBAAwB,CAAC;AAChE,eAAO,MAAM,aAAa,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/internal/bridge/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEvD,eAAO,MAAM,OAAO,EAAG,UAAmB,CAAC;AAC3C,eAAO,MAAM,OAAO,EAAG,CAAU,CAAC;AAElC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,kBAAkB,QAAS,CAAC;AAGzC,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AACtD,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD,eAAO,MAAM,0BAA0B,wBAAwB,CAAC;AAChE,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,oBAAoB,wBAAwB,CAAC;AAE1D,MAAM,MAAM,SAAS,GACjB,e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MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,gBAAgB,GAAG,aAAa,CAAC;AACjF,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,eAAe,CAAC;AAEhE,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,iBAAiB,CAIrE;AAED,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAIjF;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,KAAM,YAAW,WAAW;IACjE,IAAI,EAAE,SAAS,CAAC;gBACJ,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM;CAK7C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BridgeErrorObject = exports.SHARE_COMPOSE = exports.AUTH_LOGIN_CANCELLED_EVENT = exports.AUTH_CHANGED_EVENT = exports.AUTH_REQUEST_LOGIN = exports.REQUEST_TIMEOUT_MS = exports.HELLO_TIMEOUT_MS = exports.VERSION = exports.CHANNEL = void 0;
|
|
3
|
+
exports.BridgeErrorObject = exports.MEMORY_REPORT_ACTION = exports.SHARE_COMPOSE = exports.AUTH_LOGIN_CANCELLED_EVENT = exports.AUTH_CHANGED_EVENT = exports.AUTH_REQUEST_LOGIN = exports.REQUEST_TIMEOUT_MS = exports.HELLO_TIMEOUT_MS = exports.VERSION = exports.CHANNEL = void 0;
|
|
4
4
|
exports.isEazoEnvelope = isEazoEnvelope;
|
|
5
5
|
exports.isCapabilitySupported = isCapabilitySupported;
|
|
6
6
|
exports.CHANNEL = "eazo-sdk";
|
|
@@ -12,6 +12,7 @@ exports.AUTH_REQUEST_LOGIN = "auth.requestLogin";
|
|
|
12
12
|
exports.AUTH_CHANGED_EVENT = "auth.changed";
|
|
13
13
|
exports.AUTH_LOGIN_CANCELLED_EVENT = "auth.loginCancelled";
|
|
14
14
|
exports.SHARE_COMPOSE = "share.compose";
|
|
15
|
+
exports.MEMORY_REPORT_ACTION = "memory.reportAction";
|
|
15
16
|
function isEazoEnvelope(msg) {
|
|
16
17
|
if (!msg || typeof msg !== "object")
|
|
17
18
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/internal/bridge/protocol.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/internal/bridge/protocol.ts"],"names":[],"mappings":";;;AAsEA,wCAIC;AAED,sDAIC;AA9EY,QAAA,OAAO,GAAG,UAAmB,CAAC;AAC9B,QAAA,OAAO,GAAG,CAAU,CAAC;AAErB,QAAA,gBAAgB,GAAG,IAAI,CAAC;AACxB,QAAA,kBAAkB,GAAG,KAAM,CAAC;AAEzC,6DAA6D;AAChD,QAAA,kBAAkB,GAAG,mBAAmB,CAAC;AACzC,QAAA,kBAAkB,GAAG,cAAc,CAAC;AACpC,QAAA,0BAA0B,GAAG,qBAAqB,CAAC;AACnD,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,oBAAoB,GAAG,qBAAqB,CAAC;AAyD1D,SAAgB,cAAc,CAAC,GAAY;IACzC,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAClD,MAAM,CAAC,GAAG,GAA8B,CAAC;IACzC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,eAAO,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,eAAO,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC;AACjF,CAAC;AAED,SAAgB,qBAAqB,CAAC,YAAsB,EAAE,EAAU;IACtE,IAAI,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,YAAY,CAAC,QAAQ,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,KAAK;IAE1C,YAAY,IAAe,EAAE,OAAe;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAPD,8CAOC"}
|
|
@@ -4,7 +4,6 @@ export declare function _bootstrapDevice(): Promise<void>;
|
|
|
4
4
|
export declare const device: {
|
|
5
5
|
readonly platform: DeviceContext["platform"];
|
|
6
6
|
readonly locale: string;
|
|
7
|
-
readonly safeArea: DeviceContext["safeArea"];
|
|
8
7
|
readonly backendUrl: string;
|
|
9
8
|
getContext(): DeviceContext;
|
|
10
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../src/internal/capabilities/device.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../../src/internal/capabilities/device.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAkBjD,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEhD;AAaD,eAAO,MAAM,MAAM;uBACD,aAAa,CAAC,UAAU,CAAC;qBAK3B,MAAM;yBAKF,MAAM;kBAKV,aAAa;CAI5B,CAAC"}
|
|
@@ -11,7 +11,6 @@ function webDefaults() {
|
|
|
11
11
|
return {
|
|
12
12
|
platform: "web",
|
|
13
13
|
locale,
|
|
14
|
-
safeArea: { top: 0, bottom: 0 },
|
|
15
14
|
backendUrl,
|
|
16
15
|
};
|
|
17
16
|
}
|
|
@@ -31,12 +30,6 @@ function ensureBootstrap() {
|
|
|
31
30
|
if (!hello)
|
|
32
31
|
return;
|
|
33
32
|
(0, store_1.setDevice)(hello.device);
|
|
34
|
-
const bridge = (0, bootstrap_1.getBridge)();
|
|
35
|
-
bridge?.on("device.safeArea.changed", (payload) => {
|
|
36
|
-
const patch = payload;
|
|
37
|
-
const current = store_1.store.getSnapshot().device.safeArea;
|
|
38
|
-
(0, store_1.setDevice)({ safeArea: { ...current, ...patch } });
|
|
39
|
-
});
|
|
40
33
|
})();
|
|
41
34
|
return bootstrapPromise;
|
|
42
35
|
}
|
|
@@ -49,10 +42,6 @@ exports.device = {
|
|
|
49
42
|
ensureBootstrap().catch(() => undefined);
|
|
50
43
|
return store_1.store.getSnapshot().device.locale;
|
|
51
44
|
},
|
|
52
|
-
get safeArea() {
|
|
53
|
-
ensureBootstrap().catch(() => undefined);
|
|
54
|
-
return store_1.store.getSnapshot().device.safeArea;
|
|
55
|
-
},
|
|
56
45
|
get backendUrl() {
|
|
57
46
|
ensureBootstrap().catch(() => undefined);
|
|
58
47
|
return store_1.store.getSnapshot().device.backendUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/internal/capabilities/device.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../src/internal/capabilities/device.ts"],"names":[],"mappings":";;;AAkBA,0DAEC;AAED,4CAEC;AAvBD,4CAAgD;AAChD,oCAA4C;AAE5C,SAAS,WAAW;IAClB,MAAM,MAAM,GACV,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;IACxF,MAAM,UAAU,GACd,CAAC,O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EAAE,CAAC,MAAM,CAAC,UAAU,CAAC;IAC/C,CAAC;IAED,UAAU;QACR,eAAe,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACzC,OAAO,aAAK,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC;IACpC,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/internal/capabilities/memory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/internal/capabilities/memory.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,kBAAkB;IACjC,6GAA6G;IAC7G,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA8CD,eAAO,MAAM,MAAM;IACjB;;;;;;;;;;;;;;;;;;;OAmBG;yBACwB,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CA4C9D,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.memory = void 0;
|
|
4
|
+
const bootstrap_1 = require("../bootstrap");
|
|
5
|
+
const protocol_1 = require("../bridge/protocol");
|
|
4
6
|
const config_1 = require("../config");
|
|
5
7
|
const env_1 = require("../env");
|
|
6
8
|
const auth_1 = require("./auth");
|
|
@@ -23,6 +25,29 @@ function detectPlatform() {
|
|
|
23
25
|
}
|
|
24
26
|
return "web";
|
|
25
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Forward the action to the mobile host via the SDK bridge. Fire-and-forget:
|
|
30
|
+
* never throws, never blocks the HTTP report. Only attempted when running
|
|
31
|
+
* inside the Eazo Mobile WebView; in pure-web / iframe environments this is
|
|
32
|
+
* a no-op. Failures (NOT_SUPPORTED, TIMEOUT, transport errors) are
|
|
33
|
+
* intentionally swallowed — the HTTP path remains the source of truth.
|
|
34
|
+
*/
|
|
35
|
+
function notifyMobile(payload) {
|
|
36
|
+
if ((0, env_1.getHost)() !== "eazoMobile")
|
|
37
|
+
return;
|
|
38
|
+
void (async () => {
|
|
39
|
+
try {
|
|
40
|
+
const hello = await (0, bootstrap_1.waitForBootstrap)();
|
|
41
|
+
const bridge = (0, bootstrap_1.getBridge)();
|
|
42
|
+
if (!hello || !bridge?.getStatus().ready)
|
|
43
|
+
return;
|
|
44
|
+
await bridge.request(protocol_1.MEMORY_REPORT_ACTION, payload);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// Best-effort — the HTTP POST below is the durable record.
|
|
48
|
+
}
|
|
49
|
+
})();
|
|
50
|
+
}
|
|
26
51
|
// ---------------------------------------------------------------------------
|
|
27
52
|
// Public API
|
|
28
53
|
// ---------------------------------------------------------------------------
|
|
@@ -61,6 +86,7 @@ exports.memory = {
|
|
|
61
86
|
// Auto-detect platform when not provided by the caller.
|
|
62
87
|
const platform = params.platform ?? detectPlatform();
|
|
63
88
|
const payload = { ...params, metadata, platform };
|
|
89
|
+
notifyMobile(payload);
|
|
64
90
|
const res = await fetch(`${(0, config_1.getApiBase)()}/api/open/gum/action`, {
|
|
65
91
|
method: "POST",
|
|
66
92
|
headers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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AE,OAAO,CAAC,aAAa,CAAC,GAAG,IAAI,CAQ7D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAQ7D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAQ7D"}
|
package/dist/internal/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/internal/store.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/internal/store.ts"],"names":[],"mappings":";;;AAsFA,0BAWC;AAED,8BAQC;AAED,gCAQC;AAED,gCAQC;AA5GD,MAAM,YAAY,GAAc;IAC9B,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF,MAAM,cAAc,GAAkB;IACpC,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,EAAE;CACf,CAAC;AAEF,MAAM,gBAAgB,GAAiB;IACrC,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,EAAE;IACb,gBAAgB,EAAE,KAAK;IACvB,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,KAAK;CAClB,CAAC;AAMF,MAAM,gBAAgB,GAAiB;IACrC,IAAI,EAAE,KAAK;CACZ,CAAC;AAOW,QAAA,aAAa,GAAsB;IAC9C,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,cAAc;IACtB,OAAO,EAAE,gBAAgB;IACzB,OAAO,EAAE,gBAAgB;CAC1B,CAAC;AAEF,IAAI,QAAQ,GAAsB,qBAAa,CAAC;AAChD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAY,CAAC;AAEzB,QAAA,KAAK,GAAG;IACnB,WAAW;QACT,OAAO,QAAQ,C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GAAG,CAAC,CAC1C,CAAC;IACF,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,OAAO,CAAC,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED,SAAgB,UAAU,CAAC,KAA4B;IACrD,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;IACjC,MAAM,IAAI,GAAiB,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;IACpD,MAAM,OAAO,GAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAA+B,CAAC,IAAI,CACnE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CACpC,CAAC;IACF,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,OAAO,CAAC,EAAE,GAAG,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED,SAAgB,UAAU,CAAC,KAA4B;IACrD,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;IACjC,MAAM,IAAI,GAAiB,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;IACpD,MAAM,OAAO,GAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAA+B,CAAC,IAAI,CACnE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CACpC,CAAC;IACF,IAAI,CAAC,OAAO;QAAE,OAAO;IACrB,OAAO,CAAC,EAAE,GAAG,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
package/dist/react.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare function EazoProvider(props: {
|
|
|
18
18
|
* the hook only re-renders when the selector's return value changes (Object.is).
|
|
19
19
|
*
|
|
20
20
|
* const user = useEazo(s => s.auth.user);
|
|
21
|
-
* const { platform,
|
|
21
|
+
* const { platform, locale } = useEazo(s => s.device);
|
|
22
22
|
*/
|
|
23
23
|
export declare function useEazo<T>(selector: (state: EazoState) => T): T;
|
|
24
24
|
//# sourceMappingURL=react.d.ts.map
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIzC;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,CAgBrF;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,CAAC,GAAG,CAAC,CAkB/D"}
|
package/dist/react.js
CHANGED
|
@@ -37,6 +37,7 @@ exports.EazoProvider = EazoProvider;
|
|
|
37
37
|
exports.useEazo = useEazo;
|
|
38
38
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
39
|
const React = __importStar(require("react"));
|
|
40
|
+
const banner_ui_1 = require("./internal/banner-ui");
|
|
40
41
|
const bootstrap_1 = require("./internal/bootstrap");
|
|
41
42
|
const auth_1 = require("./internal/capabilities/auth");
|
|
42
43
|
const device_1 = require("./internal/capabilities/device");
|
|
@@ -61,32 +62,14 @@ function EazoProvider(props) {
|
|
|
61
62
|
void (0, auth_1._bootstrapAuth)();
|
|
62
63
|
void (0, device_1._bootstrapDevice)();
|
|
63
64
|
}, []);
|
|
64
|
-
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)(MountedContext.Provider, { value: true, children: [props.children, (0, jsx_runtime_1.jsx)(login_ui_1.LoginUI, {}), (0, jsx_runtime_1.jsx)(share_ui_1.ShareDownloadModal, {})] }));
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Mirrors the reported device safe area onto `document.documentElement` as
|
|
69
|
-
* `--eazo-safe-area-top` / `--eazo-safe-area-bottom`. Apps reference these
|
|
70
|
-
* from CSS (`padding-top: var(--eazo-safe-area-top, 0)`) to avoid the host
|
|
71
|
-
* chrome (status bar, "Hosted by Eazo" pill, etc.) without needing to read
|
|
72
|
-
* device state themselves.
|
|
73
|
-
*/
|
|
74
|
-
function useSafeAreaCssVars() {
|
|
75
|
-
const safeArea = React.useSyncExternalStore(store_1.store.subscribe, () => store_1.store.getSnapshot().device.safeArea, () => store_1.INITIAL_STATE.device.safeArea);
|
|
76
|
-
React.useEffect(() => {
|
|
77
|
-
if (typeof document === "undefined")
|
|
78
|
-
return;
|
|
79
|
-
const root = document.documentElement;
|
|
80
|
-
root.style.setProperty("--eazo-safe-area-top", `${safeArea.top}px`);
|
|
81
|
-
root.style.setProperty("--eazo-safe-area-bottom", `${safeArea.bottom}px`);
|
|
82
|
-
}, [safeArea.top, safeArea.bottom]);
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)(MountedContext.Provider, { value: true, children: [props.children, (0, jsx_runtime_1.jsx)(banner_ui_1.EazoBrandBanner, {}), (0, jsx_runtime_1.jsx)(login_ui_1.LoginUI, {}), (0, jsx_runtime_1.jsx)(share_ui_1.ShareDownloadModal, {})] }));
|
|
83
66
|
}
|
|
84
67
|
/**
|
|
85
68
|
* Subscribe to a slice of the Eazo state. The selector runs on every update;
|
|
86
69
|
* the hook only re-renders when the selector's return value changes (Object.is).
|
|
87
70
|
*
|
|
88
71
|
* const user = useEazo(s => s.auth.user);
|
|
89
|
-
* const { platform,
|
|
72
|
+
* const { platform, locale } = useEazo(s => s.device);
|
|
90
73
|
*/
|
|
91
74
|
function useEazo(selector) {
|
|
92
75
|
const mounted = React.useContext(MountedContext);
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBb,oCAgBC;AASD,0BAkBC;;AAlED,6CAA+B;AAE/B,oDAAuD;AACvD,oDAAiD;AACjD,uDAA8D;AAC9D,2DAAkE;AAClE,kDAA8C;AAC9C,kDAAyD;AACzD,4CAAwD;AAGxD,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAElD;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAAC,KAAoC;IAC/D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,iFAAiF;QACjF,IAAA,qBAAS,GAAE,CAAC;QACZ,KAAK,IAAA,qBAAc,GAAE,CAAC;QACtB,KAAK,IAAA,yBAAgB,GAAE,CAAC;IAC1B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,wBAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,aACjC,KAAK,CAAC,QAAQ,EACf,uBAAC,2BAAe,KAAG,EACnB,uBAAC,kBAAO,KAAG,EACX,uBAAC,6BAAkB,KAAG,IACE,CAC3B,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,OAAO,CAAI,QAAiC;IAC1D,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IACjD,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,IAAI,CAAC,OAAO,EAAE,CAAC;QACtD,OAAO,CAAC,IAAI,CACV,wFAAwF,CACzF,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CACnC,GAAG,EAAE,CAAC,QAAQ,CAAC,aAAK,CAAC,WAAW,EAAE,CAAC,EACnC,CAAC,QAAQ,CAAC,CACX,CAAC;IACF,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CACzC,GAAG,EAAE,CAAC,QAAQ,CAAC,qBAAa,CAAC,EAC7B,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,OAAO,KAAK,CAAC,oBAAoB,CAAC,aAAK,CAAC,SAAS,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC;AACrF,CAAC"}
|
package/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;CACvB"}
|
package/package.json
CHANGED