@declarion/react 0.87.0 → 0.88.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-lib/app.js +28 -28
- package/dist-lib/components/actions/ActionButton.js +86 -85
- package/dist-lib/components/actions/ActionResultDialog.impl.js +47 -47
- package/dist-lib/components/actions/ActionRunner.js +47 -47
- package/dist-lib/components/actions/ObjectActionBar.js +9 -9
- package/dist-lib/components/actions/RowActionsKebab.js +19 -19
- package/dist-lib/components/agents/AgentChatPanel.impl.js +53 -53
- package/dist-lib/components/chrome/AssociationTabs.js +21 -21
- package/dist-lib/components/chrome/RecordHeader.js +33 -40
- package/dist-lib/components/detail-layout/AssociatedBlock.js +387 -381
- package/dist-lib/components/detail-layout/ChildrenBlock.js +12 -13
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +198 -198
- package/dist-lib/components/detail-layout/DraggableChildrenTable.js +114 -114
- package/dist-lib/components/detail-layout/EditableChildrenTable.js +160 -160
- package/dist-lib/components/detail-layout/EvidenceBlock.js +20 -21
- package/dist-lib/components/detail-layout/PropertiesBlock.js +45 -39
- package/dist-lib/components/detail-layout/QuickAddForm.js +9 -9
- package/dist-lib/components/detail-layout/TimelineComposer.js +87 -89
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +100 -99
- package/dist-lib/components/fields/FileReferenceField.js +9 -9
- package/dist-lib/components/fields/StructureField.js +57 -47
- package/dist-lib/components/fields/TimestampField.js +59 -54
- package/dist-lib/components/fields/cells/factories/money.js +14 -23
- package/dist-lib/components/fields/cells/factories/nextRun.js +1 -1
- package/dist-lib/components/fields/cells/factories/text.js +18 -3
- package/dist-lib/components/fields/cells/factories/timestamp.js +24 -12
- package/dist-lib/components/file-widgets/DocumentCard.js +108 -106
- package/dist-lib/components/layout/Layout.js +306 -361
- package/dist-lib/components/layout/Rail.js +42 -41
- package/dist-lib/components/layout/Sidebar.js +132 -117
- package/dist-lib/components/layout/TabStrip.js +116 -115
- package/dist-lib/components/layout/TenantChip.js +47 -54
- package/dist-lib/components/layout/TopBar.js +108 -105
- package/dist-lib/components/list/InlineEditCell.js +23 -23
- package/dist-lib/components/list/QuickPeek.js +65 -66
- package/dist-lib/components/pages/DocumentsMenu.js +42 -42
- package/dist-lib/components/pages/ExportMenu.js +25 -25
- package/dist-lib/components/pages/RecordDocumentsPanel.js +35 -35
- package/dist-lib/components/pages/RecordNotesPanel.js +94 -93
- package/dist-lib/components/pages/SmartDetailPage.impl.js +421 -417
- package/dist-lib/components/pages/SmartListPage.impl.js +293 -295
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +310 -310
- package/dist-lib/components/pages/auth/AuthShell.js +73 -73
- package/dist-lib/components/pages/auth/SignIn.js +32 -32
- package/dist-lib/components/pages/auth/SignUp.impl.js +3 -3
- package/dist-lib/components/pages/auth/SignUpCode.js +9 -9
- package/dist-lib/components/pages/list/ListFloatbar.js +12 -12
- package/dist-lib/components/pages/list/ListHeader.js +19 -19
- package/dist-lib/components/pages/list/ListNoRows.js +15 -15
- package/dist-lib/components/pages/list/ListToolbar.js +145 -145
- package/dist-lib/components/pages/list/useActiveView.js +14 -5
- package/dist-lib/components/pages/list/useListQuery.js +121 -81
- package/dist-lib/components/pages/list/useListRowInteraction.js +70 -70
- package/dist-lib/components/pages/list/useRowMenu.js +7 -7
- package/dist-lib/components/pages/profile/Preferences.impl.js +81 -78
- package/dist-lib/components/pages/profile/Profile.impl.js +191 -189
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +166 -158
- package/dist-lib/components/shared/ChangePasswordDialog.impl.js +23 -23
- package/dist-lib/components/shared/MarkdownRenderer.js +9 -9
- package/dist-lib/hooks/useAuth.js +11 -11
- package/dist-lib/hooks/useBranding.js +4 -4
- package/dist-lib/hooks/useDisplayTimeZone.js +8 -0
- package/dist-lib/hooks/useFollowAgentOpen.js +24 -24
- package/dist-lib/hooks/useImpersonation.js +6 -6
- package/dist-lib/hooks/useMutations.js +23 -23
- package/dist-lib/hooks/useObjectStatus.js +5 -5
- package/dist-lib/hooks/useParams.js +59 -51
- package/dist-lib/hooks/useProperties.js +8 -8
- package/dist-lib/hooks/useRowTenant.js +18 -6
- package/dist-lib/hooks/useText.js +9 -7
- package/dist-lib/hooks/useUiPreferences.js +71 -0
- package/dist-lib/index.d.ts +22 -6
- package/dist-lib/index.js +127 -126
- package/dist-lib/lib/actions.js +116 -84
- package/dist-lib/lib/child-config.js +10 -1
- package/dist-lib/lib/format-count.js +16 -1
- package/dist-lib/lib/language.js +23 -21
- package/dist-lib/lib/money-text.js +29 -0
- package/dist-lib/lib/profile.js +4 -0
- package/dist-lib/lib/role-label.js +8 -0
- package/dist-lib/lib/schema-routing.js +34 -14
- package/dist-lib/lib/shortcut.js +10 -0
- package/dist-lib/lib/timestamp.js +93 -31
- package/dist-lib/stores/auth.js +9 -8
- package/dist-lib/stores/preferences.js +56 -17
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/testing.js +25 -28
- package/dist-lib/types/schema.js +33 -27
- package/dist-lib/{useResponsiveMode-D3SKz5z4.d.ts → useResponsiveMode-9_eJT18k.d.ts} +5 -5
- package/package.json +1 -1
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { pageInsetX as
|
|
11
|
-
import { useEffect as
|
|
12
|
-
import { Fragment as
|
|
1
|
+
import { UI_PREFERENCES_PARAM_CODE as e, usePreferencesStore as t } from "../../../stores/preferences.js";
|
|
2
|
+
import { Icon as n } from "../../primitives/Icons.js";
|
|
3
|
+
import { IconBtn as r } from "../../primitives/IconBtn.js";
|
|
4
|
+
import { useText as i } from "../../../hooks/useText.js";
|
|
5
|
+
import { useResponsiveMode as ee } from "../../../hooks/useResponsiveMode.js";
|
|
6
|
+
import { useEffectiveParam as te, usePublicParams as a } from "../../../hooks/useParams.js";
|
|
7
|
+
import { isValidLogoUrl as o } from "../../../lib/branding.js";
|
|
8
|
+
import { BrandLogo as s } from "../../primitives/BrandLogo.js";
|
|
9
|
+
import { useBranding as ne } from "../../../hooks/useBranding.js";
|
|
10
|
+
import { pageInsetX as c } from "../../../lib/page-inset.js";
|
|
11
|
+
import { useEffect as l, useMemo as u } from "react";
|
|
12
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/pages/auth/AuthShell.tsx
|
|
14
|
-
var
|
|
15
|
-
function
|
|
14
|
+
var m = 560;
|
|
15
|
+
function h(e) {
|
|
16
16
|
try {
|
|
17
17
|
return new URL(e).host;
|
|
18
18
|
} catch {
|
|
19
19
|
return e;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function g(e, t) {
|
|
23
23
|
if (!e) return "";
|
|
24
24
|
let n = t ? t.slice(0, 7) : "";
|
|
25
25
|
if (!n || !t) return e;
|
|
26
26
|
let r = Math.min(e.length, t.length);
|
|
27
27
|
return e.slice(0, r) === t.slice(0, r) ? e : `${e}+${n}`;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
O
|
|
33
|
-
}, [
|
|
34
|
-
let M = A?.identity, N =
|
|
35
|
-
|
|
29
|
+
function _({ children: _, tenantSlug: v, tagline: y, subTagline: b, version: x, badges: S, brandName: re }) {
|
|
30
|
+
let C = i(), w = t((e) => e.colorScheme), T = ee(), E = t((e) => e.set), D = t((e) => e.hydrateFromParameter), O = te(e).value, k = () => E("colorScheme", w === "dark" ? "light" : "dark"), { branding: A } = ne(), j = A?.chrome?.auth?.brand_panel;
|
|
31
|
+
l(() => {
|
|
32
|
+
D(O);
|
|
33
|
+
}, [O, D]);
|
|
34
|
+
let M = A?.identity, N = re ?? M?.wordmark ?? M?.app_name ?? "", P = y ?? C(M?.auth_tagline), F = b ?? C(M?.auth_subtagline), I = x ?? M?.version_label ?? "", L = u(() => S && S.length ? S : (M?.auth_badges ?? []).map((e) => C(e)).filter(Boolean).slice(0, 8).map((e) => [e, "shield"]), [
|
|
35
|
+
S,
|
|
36
36
|
M?.auth_badges,
|
|
37
|
-
|
|
38
|
-
]), R = M?.workspace_domain ?? "", z = !!(
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
37
|
+
C
|
|
38
|
+
]), R = M?.workspace_domain ?? "", z = !!(v && R), B = M?.status_url ?? "", V = !!B, H = M?.legal_links, U = u(() => [
|
|
39
|
+
[C("auth.footer.security", "Security"), H?.security_url ?? ""],
|
|
40
|
+
[C("auth.footer.privacy", "Privacy"), H?.privacy_url ?? ""],
|
|
41
|
+
[C("auth.footer.terms", "Terms"), H?.terms_url ?? ""],
|
|
42
|
+
[C("auth.footer.docs", "Docs"), H?.docs_url ?? ""]
|
|
43
43
|
].filter(([, e]) => !!e), [
|
|
44
44
|
H?.security_url,
|
|
45
45
|
H?.privacy_url,
|
|
46
46
|
H?.terms_url,
|
|
47
47
|
H?.docs_url,
|
|
48
|
-
|
|
49
|
-
]), W = M?.legal_entity ?? "", G = `© ${(/* @__PURE__ */ new Date()).getFullYear()}${W ? ` ${W}` : ""}`, { data: K } =
|
|
48
|
+
C
|
|
49
|
+
]), W = M?.legal_entity ?? "", G = `© ${(/* @__PURE__ */ new Date()).getFullYear()}${W ? ` ${W}` : ""}`, { data: K } = a(), q = K?.meta, J = g(q?.version, q?.revision), Y = [q?.region ? C("auth.meta.region", "Region: {value}", { value: q.region }) : "", J ? C("auth.meta.build", "Build {value}", { value: J }) : ""].filter(Boolean).join(" · "), X = T.isPhone || T.height < m, Z = j !== "end", Q = o(M?.app_logo_on_accent) ? M?.app_logo_on_accent : M?.app_logo, $ = !X && /* @__PURE__ */ p("div", {
|
|
50
50
|
"data-testid": "auth-brand-panel",
|
|
51
51
|
style: {
|
|
52
52
|
padding: "36px 36px 28px",
|
|
@@ -58,7 +58,7 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
58
58
|
overflow: "hidden"
|
|
59
59
|
},
|
|
60
60
|
children: [
|
|
61
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ f("div", { style: {
|
|
62
62
|
position: "absolute",
|
|
63
63
|
top: -80,
|
|
64
64
|
right: -80,
|
|
@@ -67,7 +67,7 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
67
67
|
borderRadius: "50%",
|
|
68
68
|
background: "radial-gradient(circle, var(--auth-panel-glow-1) 0%, transparent 70%)"
|
|
69
69
|
} }),
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ f("div", { style: {
|
|
71
71
|
position: "absolute",
|
|
72
72
|
bottom: -60,
|
|
73
73
|
left: -40,
|
|
@@ -76,7 +76,7 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
76
76
|
borderRadius: "50%",
|
|
77
77
|
background: "radial-gradient(circle, var(--auth-panel-glow-2) 0%, transparent 70%)"
|
|
78
78
|
} }),
|
|
79
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ p("div", {
|
|
80
80
|
style: {
|
|
81
81
|
display: "flex",
|
|
82
82
|
alignItems: "center",
|
|
@@ -84,11 +84,11 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
84
84
|
position: "relative"
|
|
85
85
|
},
|
|
86
86
|
children: [
|
|
87
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ f(s, {
|
|
88
88
|
appLogo: Q,
|
|
89
89
|
size: 34
|
|
90
90
|
}),
|
|
91
|
-
N && /* @__PURE__ */
|
|
91
|
+
N && /* @__PURE__ */ f("span", {
|
|
92
92
|
style: {
|
|
93
93
|
fontSize: 18,
|
|
94
94
|
fontWeight: 600,
|
|
@@ -96,7 +96,7 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
96
96
|
},
|
|
97
97
|
children: N
|
|
98
98
|
}),
|
|
99
|
-
I && /* @__PURE__ */
|
|
99
|
+
I && /* @__PURE__ */ f("span", {
|
|
100
100
|
className: "mono",
|
|
101
101
|
style: {
|
|
102
102
|
fontSize: 10,
|
|
@@ -109,7 +109,7 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
109
109
|
})
|
|
110
110
|
]
|
|
111
111
|
}),
|
|
112
|
-
(Q || N) && /* @__PURE__ */
|
|
112
|
+
(Q || N) && /* @__PURE__ */ p("div", {
|
|
113
113
|
style: {
|
|
114
114
|
marginTop: 48,
|
|
115
115
|
position: "relative",
|
|
@@ -118,11 +118,11 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
118
118
|
alignItems: "center",
|
|
119
119
|
gap: 16
|
|
120
120
|
},
|
|
121
|
-
children: [Q && /* @__PURE__ */
|
|
121
|
+
children: [Q && /* @__PURE__ */ f(s, {
|
|
122
122
|
appLogo: Q,
|
|
123
123
|
size: 96,
|
|
124
124
|
radius: 0
|
|
125
|
-
}), N && /* @__PURE__ */
|
|
125
|
+
}), N && /* @__PURE__ */ f("span", {
|
|
126
126
|
style: {
|
|
127
127
|
fontSize: 28,
|
|
128
128
|
fontWeight: 600,
|
|
@@ -132,13 +132,13 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
132
132
|
children: N
|
|
133
133
|
})]
|
|
134
134
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ p("div", {
|
|
136
136
|
style: {
|
|
137
137
|
marginTop: "auto",
|
|
138
138
|
position: "relative"
|
|
139
139
|
},
|
|
140
140
|
children: [
|
|
141
|
-
P && /* @__PURE__ */
|
|
141
|
+
P && /* @__PURE__ */ f("h1", {
|
|
142
142
|
style: {
|
|
143
143
|
margin: 0,
|
|
144
144
|
fontSize: 26,
|
|
@@ -148,7 +148,7 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
148
148
|
},
|
|
149
149
|
children: P
|
|
150
150
|
}),
|
|
151
|
-
F && /* @__PURE__ */
|
|
151
|
+
F && /* @__PURE__ */ f("p", {
|
|
152
152
|
style: {
|
|
153
153
|
margin: "10px 0 0",
|
|
154
154
|
fontSize: 13,
|
|
@@ -157,7 +157,7 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
157
157
|
},
|
|
158
158
|
children: F
|
|
159
159
|
}),
|
|
160
|
-
L.length > 0 && /* @__PURE__ */
|
|
160
|
+
L.length > 0 && /* @__PURE__ */ f("div", {
|
|
161
161
|
style: {
|
|
162
162
|
marginTop: 22,
|
|
163
163
|
display: "grid",
|
|
@@ -166,22 +166,22 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
166
166
|
fontSize: 11.5,
|
|
167
167
|
color: "var(--auth-panel-fg-dim)"
|
|
168
168
|
},
|
|
169
|
-
children: L.map(([
|
|
170
|
-
let r =
|
|
171
|
-
return /* @__PURE__ */
|
|
169
|
+
children: L.map(([e, t]) => {
|
|
170
|
+
let r = n[t];
|
|
171
|
+
return /* @__PURE__ */ p("div", {
|
|
172
172
|
style: {
|
|
173
173
|
display: "flex",
|
|
174
174
|
alignItems: "center",
|
|
175
175
|
gap: 6
|
|
176
176
|
},
|
|
177
|
-
children: [r && /* @__PURE__ */
|
|
177
|
+
children: [r && /* @__PURE__ */ f(r, {
|
|
178
178
|
size: 12,
|
|
179
179
|
style: { color: "var(--auth-panel-fg)" }
|
|
180
|
-
}), /* @__PURE__ */
|
|
181
|
-
},
|
|
180
|
+
}), /* @__PURE__ */ f("span", { children: e })]
|
|
181
|
+
}, e);
|
|
182
182
|
})
|
|
183
183
|
}),
|
|
184
|
-
V && /* @__PURE__ */
|
|
184
|
+
V && /* @__PURE__ */ f("a", {
|
|
185
185
|
href: B,
|
|
186
186
|
target: "_blank",
|
|
187
187
|
rel: "noopener noreferrer",
|
|
@@ -199,13 +199,13 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
199
199
|
color: "var(--auth-panel-fg-muted)",
|
|
200
200
|
textDecoration: "none"
|
|
201
201
|
},
|
|
202
|
-
children:
|
|
202
|
+
children: h(B)
|
|
203
203
|
})
|
|
204
204
|
]
|
|
205
205
|
})
|
|
206
206
|
]
|
|
207
207
|
});
|
|
208
|
-
return /* @__PURE__ */
|
|
208
|
+
return /* @__PURE__ */ p("div", {
|
|
209
209
|
style: {
|
|
210
210
|
minHeight: "var(--app-height)",
|
|
211
211
|
background: "var(--background)",
|
|
@@ -215,11 +215,11 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
215
215
|
overflowX: "hidden"
|
|
216
216
|
},
|
|
217
217
|
children: [
|
|
218
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ p("div", {
|
|
219
219
|
style: {
|
|
220
220
|
paddingTop: X ? 12 : 16,
|
|
221
221
|
paddingBottom: X ? 12 : 16,
|
|
222
|
-
...X ?
|
|
222
|
+
...X ? c(14) : {
|
|
223
223
|
paddingLeft: 20,
|
|
224
224
|
paddingRight: 20
|
|
225
225
|
},
|
|
@@ -228,11 +228,11 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
228
228
|
gap: 10
|
|
229
229
|
},
|
|
230
230
|
children: [
|
|
231
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ f(s, {
|
|
232
232
|
appLogo: M?.app_logo,
|
|
233
233
|
size: 26
|
|
234
234
|
}),
|
|
235
|
-
N && /* @__PURE__ */
|
|
235
|
+
N && /* @__PURE__ */ f("span", {
|
|
236
236
|
style: {
|
|
237
237
|
fontSize: 14,
|
|
238
238
|
fontWeight: 600,
|
|
@@ -244,7 +244,7 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
244
244
|
},
|
|
245
245
|
children: N
|
|
246
246
|
}),
|
|
247
|
-
z && /* @__PURE__ */
|
|
247
|
+
z && /* @__PURE__ */ p("span", {
|
|
248
248
|
className: "mono",
|
|
249
249
|
style: {
|
|
250
250
|
marginLeft: 6,
|
|
@@ -256,20 +256,20 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
256
256
|
borderRadius: "var(--radius-sm)"
|
|
257
257
|
},
|
|
258
258
|
children: [
|
|
259
|
-
|
|
259
|
+
v,
|
|
260
260
|
".",
|
|
261
261
|
R
|
|
262
262
|
]
|
|
263
263
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
icon:
|
|
264
|
+
/* @__PURE__ */ f("div", { style: { flex: 1 } }),
|
|
265
|
+
/* @__PURE__ */ f(r, {
|
|
266
|
+
icon: f(w === "dark" ? n.sun : n.moon, { size: 14 }),
|
|
267
267
|
onClick: k,
|
|
268
|
-
title:
|
|
268
|
+
title: C("auth.toggle_theme", "Toggle theme")
|
|
269
269
|
})
|
|
270
270
|
]
|
|
271
271
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ f("div", {
|
|
273
273
|
style: {
|
|
274
274
|
flex: 1,
|
|
275
275
|
display: "flex",
|
|
@@ -277,20 +277,20 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
277
277
|
justifyContent: "center",
|
|
278
278
|
paddingTop: X ? 16 : 20,
|
|
279
279
|
paddingBottom: X ? 12 : 20,
|
|
280
|
-
...X ?
|
|
280
|
+
...X ? c(12) : {
|
|
281
281
|
paddingLeft: 20,
|
|
282
282
|
paddingRight: 20
|
|
283
283
|
},
|
|
284
284
|
minWidth: 0
|
|
285
285
|
},
|
|
286
|
-
children: /* @__PURE__ */
|
|
286
|
+
children: /* @__PURE__ */ p("div", {
|
|
287
287
|
style: {
|
|
288
288
|
display: "grid",
|
|
289
289
|
gridTemplateColumns: X ? "minmax(0, 1fr)" : "1fr 1fr",
|
|
290
290
|
gap: 0,
|
|
291
291
|
width: X ? "100%" : 980,
|
|
292
292
|
maxWidth: "100%",
|
|
293
|
-
minHeight: X ? "auto" :
|
|
293
|
+
minHeight: X ? "auto" : m,
|
|
294
294
|
background: "var(--surface)",
|
|
295
295
|
border: "1px solid var(--border)",
|
|
296
296
|
borderRadius: X ? "var(--radius-lg)" : "var(--radius-xl)",
|
|
@@ -299,7 +299,7 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
299
299
|
},
|
|
300
300
|
children: [
|
|
301
301
|
Z && $,
|
|
302
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ f("div", {
|
|
303
303
|
"data-testid": "auth-form-panel",
|
|
304
304
|
style: {
|
|
305
305
|
padding: X ? "28px 20px 24px" : "36px 40px",
|
|
@@ -308,13 +308,13 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
308
308
|
justifyContent: "center",
|
|
309
309
|
minWidth: 0
|
|
310
310
|
},
|
|
311
|
-
children:
|
|
311
|
+
children: _
|
|
312
312
|
}),
|
|
313
313
|
!Z && $
|
|
314
314
|
]
|
|
315
315
|
})
|
|
316
316
|
}),
|
|
317
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ p("div", {
|
|
318
318
|
style: {
|
|
319
319
|
padding: X ? "12px 14px calc(12px + var(--safe-area-bottom))" : "14px 20px",
|
|
320
320
|
display: "flex",
|
|
@@ -326,15 +326,15 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
326
326
|
minWidth: 0
|
|
327
327
|
},
|
|
328
328
|
children: [
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
U.map(([e, t]) => /* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ f("span", { children: G }),
|
|
330
|
+
U.map(([e, t]) => /* @__PURE__ */ f("a", {
|
|
331
331
|
href: t,
|
|
332
332
|
target: "_blank",
|
|
333
333
|
rel: "noopener noreferrer",
|
|
334
334
|
style: { color: "inherit" },
|
|
335
335
|
children: e
|
|
336
336
|
}, e)),
|
|
337
|
-
Y && /* @__PURE__ */
|
|
337
|
+
Y && /* @__PURE__ */ p(d, { children: [!X && /* @__PURE__ */ f("div", { style: { flex: 1 } }), /* @__PURE__ */ f("span", {
|
|
338
338
|
className: "mono",
|
|
339
339
|
style: {
|
|
340
340
|
maxWidth: "100%",
|
|
@@ -348,4 +348,4 @@ function v({ children: v, tenantSlug: y, tagline: b, subTagline: x, version: S,
|
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
350
|
//#endregion
|
|
351
|
-
export {
|
|
351
|
+
export { _ as AuthShell, g as formatBuildLabel };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { sanitizeRedirectPath as e } from "../../../api/auth-redirect.js";
|
|
2
2
|
import { checkSetup as t, listIdentityProviders as n, ssoAuthorizeUrl as r } from "../../../api/auth.js";
|
|
3
3
|
import { useSchema as i } from "../../../hooks/useSchema.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { failureTitle as a } from "../../../lib/failure.js";
|
|
5
|
+
import { Icon as o } from "../../primitives/Icons.js";
|
|
6
|
+
import { Btn as s } from "../../primitives/Btn.js";
|
|
7
|
+
import { useText as c } from "../../../hooks/useText.js";
|
|
8
|
+
import { FieldLabel as l, PasswordInput as u, TextInput as d } from "../../primitives/Fields.js";
|
|
9
9
|
import { toast as f } from "../../../lib/toast.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { accessibleRedirectPath as p } from "../../../lib/schema-routing.js";
|
|
11
|
+
import { useAuth as m } from "../../../hooks/useAuth.js";
|
|
12
|
+
import { AuthShell as h } from "./AuthShell.js";
|
|
13
|
+
import { BlankScreen as g } from "../../shared/BlankScreen.js";
|
|
14
|
+
import { GitHubIcon as _, GoogleIcon as v, MicrosoftIcon as y } from "./icons.js";
|
|
15
15
|
import { useEffect as b, useState as x } from "react";
|
|
16
16
|
import { useQuery as S } from "@tanstack/react-query";
|
|
17
17
|
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
@@ -20,27 +20,27 @@ import { Link as E, useNavigate as D, useSearchParams as O } from "react-router"
|
|
|
20
20
|
var k = "sso-failure", A = {
|
|
21
21
|
google: {
|
|
22
22
|
name: "Google",
|
|
23
|
-
icon: /* @__PURE__ */ w(
|
|
23
|
+
icon: /* @__PURE__ */ w(v, { size: 14 })
|
|
24
24
|
},
|
|
25
25
|
microsoft: {
|
|
26
26
|
name: "Microsoft",
|
|
27
|
-
icon: /* @__PURE__ */ w(
|
|
27
|
+
icon: /* @__PURE__ */ w(y, { size: 14 })
|
|
28
28
|
},
|
|
29
29
|
azure: {
|
|
30
30
|
name: "Microsoft",
|
|
31
|
-
icon: /* @__PURE__ */ w(
|
|
31
|
+
icon: /* @__PURE__ */ w(y, { size: 14 })
|
|
32
32
|
},
|
|
33
33
|
github: {
|
|
34
34
|
name: "GitHub",
|
|
35
|
-
icon: /* @__PURE__ */ w(
|
|
35
|
+
icon: /* @__PURE__ */ w(_, { size: 14 })
|
|
36
36
|
},
|
|
37
37
|
apple: {
|
|
38
38
|
name: "Apple",
|
|
39
|
-
icon: /* @__PURE__ */ w(
|
|
39
|
+
icon: /* @__PURE__ */ w(o.shield, { size: 13 })
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
function j() {
|
|
43
|
-
let
|
|
43
|
+
let _ = D(), [v] = O(), { login: y, isLoginPending: j, isAuthenticated: N } = m(), { data: P } = i(), F = c(), [I, L] = x(""), [R, z] = x(""), [B, V] = x(!0), H = e(v.get("next") || v.get("redirect")), U = v.get("sso_error"), W = c("errors"), { data: G, isPending: K } = S({
|
|
44
44
|
queryKey: ["check-setup"],
|
|
45
45
|
queryFn: t
|
|
46
46
|
}), { data: q } = S({
|
|
@@ -49,30 +49,30 @@ function j() {
|
|
|
49
49
|
staleTime: 6e4
|
|
50
50
|
});
|
|
51
51
|
if (b(() => {
|
|
52
|
-
G?.needs_setup &&
|
|
53
|
-
}, [G,
|
|
52
|
+
G?.needs_setup && _("/signup", { replace: !0 });
|
|
53
|
+
}, [G, _]), b(() => {
|
|
54
54
|
if (!N || !P) return;
|
|
55
|
-
let e =
|
|
56
|
-
M(H, e) && f.warning(F("auth.inaccessible_redirect", "You do not have access to that page. We opened your default page instead.")),
|
|
55
|
+
let e = p(H, P);
|
|
56
|
+
M(H, e) && f.warning(F("auth.inaccessible_redirect", "You do not have access to that page. We opened your default page instead.")), _(e, { replace: !0 });
|
|
57
57
|
}, [
|
|
58
58
|
N,
|
|
59
|
-
|
|
59
|
+
_,
|
|
60
60
|
H,
|
|
61
61
|
P,
|
|
62
62
|
F
|
|
63
63
|
]), b(() => {
|
|
64
64
|
U && f.error(W(U, "Sign-in failed."), void 0, { id: k });
|
|
65
|
-
}, [W, U]), K || G?.needs_setup) return /* @__PURE__ */ w(
|
|
65
|
+
}, [W, U]), K || G?.needs_setup) return /* @__PURE__ */ w(g, {});
|
|
66
66
|
function J(e) {
|
|
67
|
-
e.preventDefault(),
|
|
67
|
+
e.preventDefault(), y({
|
|
68
68
|
email: I,
|
|
69
69
|
password: R,
|
|
70
70
|
remember: B
|
|
71
71
|
}, { onError: (e) => {
|
|
72
|
-
f.error(
|
|
72
|
+
f.error(a(W, e));
|
|
73
73
|
} });
|
|
74
74
|
}
|
|
75
|
-
return /* @__PURE__ */ w(
|
|
75
|
+
return /* @__PURE__ */ w(h, { children: /* @__PURE__ */ T("form", {
|
|
76
76
|
onSubmit: J,
|
|
77
77
|
children: [
|
|
78
78
|
/* @__PURE__ */ w("div", {
|
|
@@ -112,9 +112,9 @@ function j() {
|
|
|
112
112
|
children: q.map((e) => {
|
|
113
113
|
let t = A[e.slug.toLowerCase()] ?? {
|
|
114
114
|
name: e.name,
|
|
115
|
-
icon: /* @__PURE__ */ w(
|
|
115
|
+
icon: /* @__PURE__ */ w(o.shield, { size: 13 })
|
|
116
116
|
};
|
|
117
|
-
return /* @__PURE__ */ w(
|
|
117
|
+
return /* @__PURE__ */ w(s, {
|
|
118
118
|
size: "md",
|
|
119
119
|
style: {
|
|
120
120
|
justifyContent: "center",
|
|
@@ -163,10 +163,10 @@ function j() {
|
|
|
163
163
|
gap: 12
|
|
164
164
|
},
|
|
165
165
|
children: [
|
|
166
|
-
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w(
|
|
166
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w(l, { children: F("auth.field.email", "Email") }), /* @__PURE__ */ w(d, {
|
|
167
167
|
value: I,
|
|
168
168
|
onChange: L,
|
|
169
|
-
prefix: /* @__PURE__ */ w(
|
|
169
|
+
prefix: /* @__PURE__ */ w(o.email, { size: 13 }),
|
|
170
170
|
placeholder: F("auth.field.email_placeholder", "you@company.com"),
|
|
171
171
|
autoFocus: !0,
|
|
172
172
|
required: !0
|
|
@@ -177,7 +177,7 @@ function j() {
|
|
|
177
177
|
alignItems: "center"
|
|
178
178
|
},
|
|
179
179
|
children: [
|
|
180
|
-
/* @__PURE__ */ w(
|
|
180
|
+
/* @__PURE__ */ w(l, { children: F("auth.field.password", "Password") }),
|
|
181
181
|
/* @__PURE__ */ w("div", { style: { flex: 1 } }),
|
|
182
182
|
/* @__PURE__ */ w(E, {
|
|
183
183
|
to: "/forgot",
|
|
@@ -190,7 +190,7 @@ function j() {
|
|
|
190
190
|
children: F("auth.signin.forgot_link", "Forgot?")
|
|
191
191
|
})
|
|
192
192
|
]
|
|
193
|
-
}), /* @__PURE__ */ w(
|
|
193
|
+
}), /* @__PURE__ */ w(u, {
|
|
194
194
|
value: R,
|
|
195
195
|
onChange: z,
|
|
196
196
|
placeholder: F("auth.signin.password_placeholder", "Your password")
|
|
@@ -214,7 +214,7 @@ function j() {
|
|
|
214
214
|
F("auth.signin.remember", "Keep me signed in on this device")
|
|
215
215
|
]
|
|
216
216
|
}),
|
|
217
|
-
/* @__PURE__ */ w(
|
|
217
|
+
/* @__PURE__ */ w(s, {
|
|
218
218
|
type: "submit",
|
|
219
219
|
size: "md",
|
|
220
220
|
kind: "primary",
|
|
@@ -5,8 +5,8 @@ import { Btn as r } from "../../primitives/Btn.js";
|
|
|
5
5
|
import { useText as i } from "../../../hooks/useText.js";
|
|
6
6
|
import { useResponsiveMode as a } from "../../../hooks/useResponsiveMode.js";
|
|
7
7
|
import { FieldLabel as o, PasswordInput as s, TextInput as c } from "../../primitives/Fields.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { usePublicParams as l } from "../../../hooks/useParams.js";
|
|
9
|
+
import { getBrandingIdentity as u } from "../../../lib/branding.js";
|
|
10
10
|
import { useAuth as d } from "../../../hooks/useAuth.js";
|
|
11
11
|
import { AuthShell as f } from "./AuthShell.js";
|
|
12
12
|
import { BlankScreen as p } from "../../shared/BlankScreen.js";
|
|
@@ -17,7 +17,7 @@ import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
|
17
17
|
import { Link as b, useNavigate as x } from "react-router";
|
|
18
18
|
//#region src/components/pages/auth/SignUp.impl.tsx
|
|
19
19
|
function S() {
|
|
20
|
-
let t = x(), { signup: S, isSignupPending: w, isAuthenticated: T } = d(), [E, D] = g(null), O = a(), k = i(), [A, j] = g(""), [M, N] = g(""), [P, F] = g(""), [I, L] = g(""), [R, z] = g(!1), { data: B } =
|
|
20
|
+
let t = x(), { signup: S, isSignupPending: w, isAuthenticated: T } = d(), [E, D] = g(null), O = a(), k = i(), [A, j] = g(""), [M, N] = g(""), [P, F] = g(""), [I, L] = g(""), [R, z] = g(!1), { data: B } = l(), V = u(B), H = V?.legal_links?.terms_url ?? "", U = V?.legal_links?.privacy_url ?? "", W = O.isPhone, { data: G, isPending: K } = _({
|
|
21
21
|
queryKey: ["check-setup"],
|
|
22
22
|
queryFn: e
|
|
23
23
|
}), q = G?.needs_setup || G?.signup_enabled;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resendSignupCode as e } from "../../../api/auth.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { failureTitle as t } from "../../../lib/failure.js";
|
|
3
|
+
import { Btn as n } from "../../primitives/Btn.js";
|
|
4
|
+
import { useText as r } from "../../../hooks/useText.js";
|
|
5
5
|
import { useAuth as i } from "../../../hooks/useAuth.js";
|
|
6
6
|
import { AuthShell as a } from "./AuthShell.js";
|
|
7
7
|
import { CodeInput as o } from "./CodeInput.js";
|
|
@@ -9,7 +9,7 @@ import { useEffect as s, useState as c } from "react";
|
|
|
9
9
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/pages/auth/SignUpCode.tsx
|
|
11
11
|
function d({ email: d, retryAfterSeconds: f, onUseAnotherEmail: p }) {
|
|
12
|
-
let m =
|
|
12
|
+
let m = r(), h = r("errors"), { confirmSignup: g, isConfirmSignupPending: _ } = i(), [v, y] = c(""), [b, x] = c(""), [S, C] = c(f), [w, T] = c(!1);
|
|
13
13
|
s(() => {
|
|
14
14
|
if (S <= 0) return;
|
|
15
15
|
let e = window.setTimeout(() => C((e) => e - 1), 1e3);
|
|
@@ -19,7 +19,7 @@ function d({ email: d, retryAfterSeconds: f, onUseAnotherEmail: p }) {
|
|
|
19
19
|
e.preventDefault(), x(""), g({
|
|
20
20
|
email: d,
|
|
21
21
|
code: v
|
|
22
|
-
}, { onError: (e) => x(
|
|
22
|
+
}, { onError: (e) => x(t(h, e)) });
|
|
23
23
|
}
|
|
24
24
|
async function D() {
|
|
25
25
|
T(!0), x("");
|
|
@@ -27,7 +27,7 @@ function d({ email: d, retryAfterSeconds: f, onUseAnotherEmail: p }) {
|
|
|
27
27
|
let t = await e(d);
|
|
28
28
|
y(""), C(t.retry_after_seconds);
|
|
29
29
|
} catch (e) {
|
|
30
|
-
x(
|
|
30
|
+
x(t(h, e));
|
|
31
31
|
} finally {
|
|
32
32
|
T(!1);
|
|
33
33
|
}
|
|
@@ -79,7 +79,7 @@ function d({ email: d, retryAfterSeconds: f, onUseAnotherEmail: p }) {
|
|
|
79
79
|
},
|
|
80
80
|
children: b
|
|
81
81
|
}),
|
|
82
|
-
/* @__PURE__ */ l(
|
|
82
|
+
/* @__PURE__ */ l(n, {
|
|
83
83
|
type: "submit",
|
|
84
84
|
size: "md",
|
|
85
85
|
kind: "primary",
|
|
@@ -98,7 +98,7 @@ function d({ email: d, retryAfterSeconds: f, onUseAnotherEmail: p }) {
|
|
|
98
98
|
gap: 12,
|
|
99
99
|
fontSize: 12
|
|
100
100
|
},
|
|
101
|
-
children: [/* @__PURE__ */ l(
|
|
101
|
+
children: [/* @__PURE__ */ l(n, {
|
|
102
102
|
size: "sm",
|
|
103
103
|
kind: "ghost",
|
|
104
104
|
disabled: S > 0 || w,
|
|
@@ -106,7 +106,7 @@ function d({ email: d, retryAfterSeconds: f, onUseAnotherEmail: p }) {
|
|
|
106
106
|
e.preventDefault(), D();
|
|
107
107
|
},
|
|
108
108
|
children: S > 0 ? m("auth.signup_code.resend_in", "Send again in {seconds} s", { seconds: S }) : m("auth.signup_code.resend", "Send again")
|
|
109
|
-
}), /* @__PURE__ */ l(
|
|
109
|
+
}), /* @__PURE__ */ l(n, {
|
|
110
110
|
size: "sm",
|
|
111
111
|
kind: "ghost",
|
|
112
112
|
onClick: (e) => {
|