@every-app/sdk 0.0.7 → 0.0.9
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GatewayRequiredError.d.ts","sourceRoot":"","sources":["../../src/client/GatewayRequiredError.tsx"],"names":[],"mappings":"AAEA,UAAU,yBAAyB;IACjC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"GatewayRequiredError.d.ts","sourceRoot":"","sources":["../../src/client/GatewayRequiredError.tsx"],"names":[],"mappings":"AAEA,UAAU,yBAAyB;IACjC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAmFD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,aAAa,EACb,KAAK,GACN,EAAE,yBAAyB,2CA6C3B"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// Button gradient styles
|
|
3
|
-
const BUTTON_GRADIENT = "linear-gradient(180deg, #424242 0%, #353535 50%, #2a2a2a 100%)";
|
|
4
|
-
const BUTTON_GRADIENT_HOVER = "linear-gradient(180deg, #4d4d4d 0%, #404040 50%, #353535 100%)";
|
|
5
2
|
// CSS custom properties for theming
|
|
6
3
|
const CSS_VARIABLES = `
|
|
7
4
|
@media (prefers-color-scheme: light) {
|
|
@@ -10,7 +7,7 @@ const CSS_VARIABLES = `
|
|
|
10
7
|
--gateway-text: oklch(0% 0 0);
|
|
11
8
|
--gateway-text-muted: oklch(40% 0 0);
|
|
12
9
|
--gateway-icon-bg: oklch(94% 0 0);
|
|
13
|
-
--gateway-icon-stroke: oklch(
|
|
10
|
+
--gateway-icon-stroke: oklch(80% 0.18 90);
|
|
14
11
|
--gateway-border: oklch(94% 0 0);
|
|
15
12
|
}
|
|
16
13
|
}
|
|
@@ -20,7 +17,7 @@ const CSS_VARIABLES = `
|
|
|
20
17
|
--gateway-text: oklch(92% 0 0);
|
|
21
18
|
--gateway-text-muted: oklch(60% 0 0);
|
|
22
19
|
--gateway-icon-bg: oklch(22% 0 0);
|
|
23
|
-
--gateway-icon-stroke: oklch(
|
|
20
|
+
--gateway-icon-stroke: oklch(85% 0.18 90);
|
|
24
21
|
--gateway-border: oklch(30% 0 0);
|
|
25
22
|
}
|
|
26
23
|
}
|
|
@@ -39,7 +36,7 @@ const styles = {
|
|
|
39
36
|
colorScheme: "light dark",
|
|
40
37
|
},
|
|
41
38
|
content: {
|
|
42
|
-
maxWidth: "
|
|
39
|
+
maxWidth: "520px",
|
|
43
40
|
width: "100%",
|
|
44
41
|
textAlign: "left",
|
|
45
42
|
},
|
|
@@ -67,16 +64,17 @@ const styles = {
|
|
|
67
64
|
color: "var(--gateway-text-muted, oklch(40% 0 0))",
|
|
68
65
|
marginBottom: "20px",
|
|
69
66
|
},
|
|
70
|
-
|
|
71
|
-
display: "inline-block",
|
|
72
|
-
padding: "10px 20px",
|
|
67
|
+
urlText: {
|
|
73
68
|
fontSize: "14px",
|
|
74
|
-
|
|
75
|
-
color: "
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
lineHeight: 1.5,
|
|
70
|
+
color: "var(--gateway-text-muted, oklch(40% 0 0))",
|
|
71
|
+
wordBreak: "break-all",
|
|
72
|
+
},
|
|
73
|
+
urlLink: {
|
|
74
|
+
color: "rgb(168, 162, 158)",
|
|
75
|
+
textDecoration: "underline",
|
|
76
|
+
textDecorationColor: "rgb(87, 83, 78)",
|
|
77
|
+
textUnderlineOffset: "2px",
|
|
80
78
|
},
|
|
81
79
|
};
|
|
82
80
|
/**
|
|
@@ -87,11 +85,7 @@ const styles = {
|
|
|
87
85
|
* the app through the Gateway and provides a link to do so.
|
|
88
86
|
*/
|
|
89
87
|
export function GatewayRequiredError({ gatewayOrigin, appId, }) {
|
|
90
|
-
const
|
|
91
|
-
const gatewayUrl = `${gatewayOrigin}/apps/${appId}${window.location.pathname}`;
|
|
92
|
-
return (_jsxs("div", { style: styles.container, children: [_jsx("style", { children: CSS_VARIABLES }), _jsxs("div", { style: styles.content, children: [_jsx("div", { style: styles.iconContainer, children: _jsxs("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "var(--gateway-icon-stroke, oklch(55% 0.22 25))", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }), _jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), _jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })] }) }), _jsx("h1", { style: styles.title, children: "Gateway
|
|
93
|
-
e.currentTarget.style.background = BUTTON_GRADIENT_HOVER;
|
|
94
|
-
}, onMouseOut: (e) => {
|
|
95
|
-
e.currentTarget.style.background = BUTTON_GRADIENT;
|
|
96
|
-
}, children: "Open in Gateway" })] })] }));
|
|
88
|
+
const isLocalhost = window.location.hostname === "localhost";
|
|
89
|
+
const gatewayUrl = `${gatewayOrigin}/apps/${appId}${window.location.pathname}${isLocalhost ? "dev" : ""}`;
|
|
90
|
+
return (_jsxs("div", { style: styles.container, children: [_jsx("style", { children: CSS_VARIABLES }), _jsxs("div", { style: styles.content, children: [_jsx("div", { style: styles.iconContainer, children: _jsxs("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "var(--gateway-icon-stroke, oklch(55% 0.22 25))", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }), _jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), _jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })] }) }), _jsx("h1", { style: styles.title, children: "Open in Gateway" }), _jsx("p", { style: styles.description, children: "The Gateway handles sign in and user auth. Access your app from there so this works properly." }), _jsxs("p", { style: styles.urlText, children: ["Go to", " ", _jsx("a", { href: gatewayUrl, style: styles.urlLink, children: gatewayUrl })] })] })] }));
|
|
97
91
|
}
|
package/package.json
CHANGED
|
@@ -11,12 +11,6 @@ interface GatewayRequiredErrorProps {
|
|
|
11
11
|
appId: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
// Button gradient styles
|
|
15
|
-
const BUTTON_GRADIENT =
|
|
16
|
-
"linear-gradient(180deg, #424242 0%, #353535 50%, #2a2a2a 100%)";
|
|
17
|
-
const BUTTON_GRADIENT_HOVER =
|
|
18
|
-
"linear-gradient(180deg, #4d4d4d 0%, #404040 50%, #353535 100%)";
|
|
19
|
-
|
|
20
14
|
// CSS custom properties for theming
|
|
21
15
|
const CSS_VARIABLES = `
|
|
22
16
|
@media (prefers-color-scheme: light) {
|
|
@@ -25,7 +19,7 @@ const CSS_VARIABLES = `
|
|
|
25
19
|
--gateway-text: oklch(0% 0 0);
|
|
26
20
|
--gateway-text-muted: oklch(40% 0 0);
|
|
27
21
|
--gateway-icon-bg: oklch(94% 0 0);
|
|
28
|
-
--gateway-icon-stroke: oklch(
|
|
22
|
+
--gateway-icon-stroke: oklch(80% 0.18 90);
|
|
29
23
|
--gateway-border: oklch(94% 0 0);
|
|
30
24
|
}
|
|
31
25
|
}
|
|
@@ -35,7 +29,7 @@ const CSS_VARIABLES = `
|
|
|
35
29
|
--gateway-text: oklch(92% 0 0);
|
|
36
30
|
--gateway-text-muted: oklch(60% 0 0);
|
|
37
31
|
--gateway-icon-bg: oklch(22% 0 0);
|
|
38
|
-
--gateway-icon-stroke: oklch(
|
|
32
|
+
--gateway-icon-stroke: oklch(85% 0.18 90);
|
|
39
33
|
--gateway-border: oklch(30% 0 0);
|
|
40
34
|
}
|
|
41
35
|
}
|
|
@@ -56,7 +50,7 @@ const styles = {
|
|
|
56
50
|
colorScheme: "light dark",
|
|
57
51
|
} satisfies CSSProperties,
|
|
58
52
|
content: {
|
|
59
|
-
maxWidth: "
|
|
53
|
+
maxWidth: "520px",
|
|
60
54
|
width: "100%",
|
|
61
55
|
textAlign: "left",
|
|
62
56
|
} satisfies CSSProperties,
|
|
@@ -84,16 +78,17 @@ const styles = {
|
|
|
84
78
|
color: "var(--gateway-text-muted, oklch(40% 0 0))",
|
|
85
79
|
marginBottom: "20px",
|
|
86
80
|
} satisfies CSSProperties,
|
|
87
|
-
|
|
88
|
-
display: "inline-block",
|
|
89
|
-
padding: "10px 20px",
|
|
81
|
+
urlText: {
|
|
90
82
|
fontSize: "14px",
|
|
91
|
-
|
|
92
|
-
color: "
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
83
|
+
lineHeight: 1.5,
|
|
84
|
+
color: "var(--gateway-text-muted, oklch(40% 0 0))",
|
|
85
|
+
wordBreak: "break-all",
|
|
86
|
+
} satisfies CSSProperties,
|
|
87
|
+
urlLink: {
|
|
88
|
+
color: "rgb(168, 162, 158)",
|
|
89
|
+
textDecoration: "underline",
|
|
90
|
+
textDecorationColor: "rgb(87, 83, 78)",
|
|
91
|
+
textUnderlineOffset: "2px",
|
|
97
92
|
} satisfies CSSProperties,
|
|
98
93
|
};
|
|
99
94
|
|
|
@@ -108,8 +103,8 @@ export function GatewayRequiredError({
|
|
|
108
103
|
gatewayOrigin,
|
|
109
104
|
appId,
|
|
110
105
|
}: GatewayRequiredErrorProps) {
|
|
111
|
-
const
|
|
112
|
-
const gatewayUrl = `${gatewayOrigin}/apps/${appId}${window.location.pathname}`;
|
|
106
|
+
const isLocalhost = window.location.hostname === "localhost";
|
|
107
|
+
const gatewayUrl = `${gatewayOrigin}/apps/${appId}${window.location.pathname}${isLocalhost ? "dev" : ""}`;
|
|
113
108
|
|
|
114
109
|
return (
|
|
115
110
|
<div style={styles.container}>
|
|
@@ -134,27 +129,21 @@ export function GatewayRequiredError({
|
|
|
134
129
|
</div>
|
|
135
130
|
|
|
136
131
|
{/* Title */}
|
|
137
|
-
<h1 style={styles.title}>Gateway
|
|
132
|
+
<h1 style={styles.title}>Open in Gateway</h1>
|
|
138
133
|
|
|
139
134
|
{/* Description */}
|
|
140
135
|
<p style={styles.description}>
|
|
141
|
-
|
|
142
|
-
|
|
136
|
+
The Gateway handles sign in and user auth. Access your app from there
|
|
137
|
+
so this works properly.
|
|
143
138
|
</p>
|
|
144
139
|
|
|
145
|
-
{/*
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
style={styles.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
onMouseOut={(e) => {
|
|
153
|
-
e.currentTarget.style.background = BUTTON_GRADIENT;
|
|
154
|
-
}}
|
|
155
|
-
>
|
|
156
|
-
Open in Gateway
|
|
157
|
-
</a>
|
|
140
|
+
{/* URL Link */}
|
|
141
|
+
<p style={styles.urlText}>
|
|
142
|
+
Go to{" "}
|
|
143
|
+
<a href={gatewayUrl} style={styles.urlLink}>
|
|
144
|
+
{gatewayUrl}
|
|
145
|
+
</a>
|
|
146
|
+
</p>
|
|
158
147
|
</div>
|
|
159
148
|
</div>
|
|
160
149
|
);
|