@onside/install-widget 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -19,6 +19,8 @@ It is the source of truth for UX + analytics for partner integrations.
19
19
  ### Notes
20
20
 
21
21
  - Required analytics context in GTM payload: `location`, `page`, `onside_token`, `attribution_token`, `platform`, `browser`.
22
+ - Optional additive device fields (for richer analytics/debug): `iosDeviceClass`, `isInAppBrowser`, `browserDetail`.
23
+ Existing required fields remain backward-compatible.
22
24
  - If a modal is shown, redirect must not happen in the same click action.
23
25
  - `onside_token` cookie must be present before requesting install URL.
24
26
 
@@ -77,6 +79,17 @@ function App() {
77
79
  }
78
80
  ```
79
81
 
82
+ Core modules can be imported via subpaths (without the UI layer):
83
+
84
+ ```ts
85
+ import { useInstallUrl } from "@onside/install-widget/hooks";
86
+ import {
87
+ getDeviceInfo,
88
+ resolveInstallConditions,
89
+ getInstallUrl,
90
+ } from "@onside/install-widget/utils";
91
+ ```
92
+
80
93
  Style customization:
81
94
 
82
95
  ```tsx
@@ -0,0 +1,48 @@
1
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import { useCallback as s } from "react";
3
+ import { B as d } from "./install-package-DowlG4hO.js";
4
+ import { D as c } from "./Dialog-yEP-7Deb.js";
5
+ import { trackModalEvent as m } from "./utils.js";
6
+ const N = ({
7
+ open: t,
8
+ onClose: l
9
+ }) => {
10
+ const n = "is_android", a = s(() => {
11
+ m(n, "click", "close"), l();
12
+ }, [l]), i = s(
13
+ (r) => {
14
+ r || a();
15
+ },
16
+ [a]
17
+ );
18
+ return /* @__PURE__ */ e(
19
+ c,
20
+ {
21
+ "aria-labelledby": n,
22
+ className: "outline-hidden",
23
+ isDisplayingMargins: !0,
24
+ open: t,
25
+ onOpenChange: i,
26
+ children: /* @__PURE__ */ o("div", { className: "flex h-full flex-col items-center justify-between text-center", children: [
27
+ /* @__PURE__ */ o("div", { className: "m-auto", children: [
28
+ /* @__PURE__ */ e("p", { className: "text-2xl font-bold", children: "Onside is for iPhone and iPad" }),
29
+ /* @__PURE__ */ e("p", { className: "mt-3 px-10 font-sans text-xs font-normal", children: "To install Onside, please use an iPhone or iPad." })
30
+ ] }),
31
+ /* @__PURE__ */ e(
32
+ d,
33
+ {
34
+ className: "mt-2 w-full",
35
+ onClick: a,
36
+ size: "lg",
37
+ type: "button",
38
+ variant: "secondary",
39
+ children: "Close"
40
+ }
41
+ )
42
+ ] })
43
+ }
44
+ );
45
+ };
46
+ export {
47
+ N as AndroidPlatformModal
48
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),r=require("./install-package-B17QfMPy.cjs"),c=require("./Dialog-yZ9bWtK1.cjs"),d=require("./utils.cjs"),u=({open:t,onClose:s})=>{const a="is_android",l=n.useCallback(()=>{d.trackModalEvent(a,"click","close"),s()},[s]),i=n.useCallback(o=>{o||l()},[l]);return e.jsx(c.Dialog,{"aria-labelledby":a,className:"outline-hidden",isDisplayingMargins:!0,open:t,onOpenChange:i,children:e.jsxs("div",{className:"flex h-full flex-col items-center justify-between text-center",children:[e.jsxs("div",{className:"m-auto",children:[e.jsx("p",{className:"text-2xl font-bold",children:"Onside is for iPhone and iPad"}),e.jsx("p",{className:"mt-3 px-10 font-sans text-xs font-normal",children:"To install Onside, please use an iPhone or iPad."})]}),e.jsx(r.Button,{className:"mt-2 w-full",onClick:l,size:"lg",type:"button",variant:"secondary",children:"Close"})]})})};exports.AndroidPlatformModal=u;