@streamoid/settings 0.4.7 → 0.6.1
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/index.d.mts +139 -11
- package/dist/index.d.ts +139 -11
- package/dist/index.js +474 -229
- package/dist/index.mjs +474 -230
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1511,7 +1511,11 @@ var TAB_LABELS = {
|
|
|
1511
1511
|
organizationWorkspaces: "Workspaces",
|
|
1512
1512
|
organizationDomains: "Domains & requests",
|
|
1513
1513
|
referral: "Referral",
|
|
1514
|
-
|
|
1514
|
+
/* "Billing & usage", not "Billing". The tab has held usage history as well
|
|
1515
|
+
as the plan and invoices since the credits work, and hosts had started
|
|
1516
|
+
saying "Billing & usage" in their own rails while this said "Billing" —
|
|
1517
|
+
so the nav item and the thing it opened disagreed by a word. */
|
|
1518
|
+
billing: "Billing & usage",
|
|
1515
1519
|
apikey: "API Keys"
|
|
1516
1520
|
};
|
|
1517
1521
|
var TAB_DESCRIPTIONS = {
|
|
@@ -1599,7 +1603,7 @@ function ScopeHeader({
|
|
|
1599
1603
|
}) {
|
|
1600
1604
|
const displayName = name?.trim() || (kind === "workspace" ? "Workspace" : "Organization");
|
|
1601
1605
|
const ScopeIcon = kind === "workspace" ? import_icons.SiconWorkspace : import_icons.SiconGlobe;
|
|
1602
|
-
const roleLabel = role === "admin" ? "You're an admin" : role ? "You're a member" : null;
|
|
1606
|
+
const roleLabel = role === "admin" ? "You're an admin" : role === "member" ? "You're a member" : role === "guest" ? "You're a guest" : null;
|
|
1603
1607
|
const detail = [roleLabel, ...facts].filter((part) => typeof part === "string" && part.length > 0).join(" \xB7 ");
|
|
1604
1608
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1605
1609
|
"div",
|
|
@@ -2097,8 +2101,9 @@ function OrganizationAffiliationCard({
|
|
|
2097
2101
|
let cancelled = false;
|
|
2098
2102
|
organizationAdapter.list().then((orgs) => {
|
|
2099
2103
|
if (cancelled) return;
|
|
2100
|
-
|
|
2101
|
-
|
|
2104
|
+
const joinable = orgs.filter((org) => org.role !== "guest");
|
|
2105
|
+
setAvailableOrgs(joinable);
|
|
2106
|
+
setSelectedOrgId((prev) => prev || joinable[0]?._id || "");
|
|
2102
2107
|
}).catch(() => {
|
|
2103
2108
|
if (!cancelled) setAvailableOrgs([]);
|
|
2104
2109
|
});
|
|
@@ -2581,12 +2586,19 @@ function InviteUpdateModal({
|
|
|
2581
2586
|
onSave,
|
|
2582
2587
|
onRemove,
|
|
2583
2588
|
canRemove = true,
|
|
2589
|
+
showOrganizationStanding = false,
|
|
2590
|
+
organizationName,
|
|
2591
|
+
allowGuestStanding = true,
|
|
2592
|
+
initialOrganizationStanding = "guest",
|
|
2584
2593
|
onInvite
|
|
2585
2594
|
}) {
|
|
2586
2595
|
useOverlayOpen(open, onClose);
|
|
2587
2596
|
const [emailValue, setEmailValue] = (0, import_react7.useState)("");
|
|
2588
2597
|
const [hasChanges, setHasChanges] = (0, import_react7.useState)(false);
|
|
2589
2598
|
const [role, setRole] = (0, import_react7.useState)("admin");
|
|
2599
|
+
const [orgStanding, setOrgStanding] = (0, import_react7.useState)(
|
|
2600
|
+
initialOrganizationStanding
|
|
2601
|
+
);
|
|
2590
2602
|
const [canUseCredits, setCanUseCredits] = (0, import_react7.useState)(false);
|
|
2591
2603
|
const [canInviteUser, setCanInviteUser] = (0, import_react7.useState)(false);
|
|
2592
2604
|
const [artifaxOn, setArtifaxOn] = (0, import_react7.useState)(!hiddenApps.includes("artifax"));
|
|
@@ -2623,6 +2635,7 @@ function InviteUpdateModal({
|
|
|
2623
2635
|
setEmailValue("");
|
|
2624
2636
|
setHasChanges(false);
|
|
2625
2637
|
setRole("admin");
|
|
2638
|
+
setOrgStanding(initialOrganizationStanding);
|
|
2626
2639
|
setCanUseCredits(true);
|
|
2627
2640
|
setCanInviteUser(true);
|
|
2628
2641
|
setArtifaxOn(!hidden.has("artifax"));
|
|
@@ -2632,7 +2645,7 @@ function InviteUpdateModal({
|
|
|
2632
2645
|
setStoreSearch("");
|
|
2633
2646
|
setSelectedStores(/* @__PURE__ */ new Set());
|
|
2634
2647
|
}
|
|
2635
|
-
}, [open, initialPermissions, hiddenKey]);
|
|
2648
|
+
}, [open, initialPermissions, hiddenKey, initialOrganizationStanding]);
|
|
2636
2649
|
if (!open) return null;
|
|
2637
2650
|
const isInvite = mode === "invite";
|
|
2638
2651
|
const hasEmail = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(emailValue.trim());
|
|
@@ -3008,6 +3021,95 @@ function InviteUpdateModal({
|
|
|
3008
3021
|
]
|
|
3009
3022
|
}
|
|
3010
3023
|
),
|
|
3024
|
+
showOrganizationStanding && mode === "invite" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3025
|
+
"div",
|
|
3026
|
+
{
|
|
3027
|
+
className: "flex flex-col items-start justify-center shrink-0 w-full",
|
|
3028
|
+
style: { gap: T6.spXs },
|
|
3029
|
+
children: [
|
|
3030
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FieldLabel2, { text: "Organization access" }),
|
|
3031
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3032
|
+
"div",
|
|
3033
|
+
{
|
|
3034
|
+
className: "shrink-0 w-full relative",
|
|
3035
|
+
style: { borderRadius: T6.rXl },
|
|
3036
|
+
children: [
|
|
3037
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3038
|
+
"div",
|
|
3039
|
+
{
|
|
3040
|
+
"aria-hidden": true,
|
|
3041
|
+
className: "absolute inset-0 pointer-events-none",
|
|
3042
|
+
style: {
|
|
3043
|
+
border: `0.5px solid ${T6.borderSubtle}`,
|
|
3044
|
+
borderRadius: T6.rXl
|
|
3045
|
+
}
|
|
3046
|
+
}
|
|
3047
|
+
),
|
|
3048
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-row items-center size-full", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3049
|
+
"div",
|
|
3050
|
+
{
|
|
3051
|
+
className: "flex items-center w-full",
|
|
3052
|
+
style: { padding: T6.spXs },
|
|
3053
|
+
children: [
|
|
3054
|
+
["colleague", "Colleague"],
|
|
3055
|
+
...allowGuestStanding ? [["guest", "Guest"]] : []
|
|
3056
|
+
].map(([value, label]) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3057
|
+
"div",
|
|
3058
|
+
{
|
|
3059
|
+
className: "flex-1 min-w-0 cursor-pointer",
|
|
3060
|
+
style: {
|
|
3061
|
+
background: orgStanding === value ? T6.neutral300 : "transparent",
|
|
3062
|
+
borderRadius: T6.rMd
|
|
3063
|
+
},
|
|
3064
|
+
onClick: () => {
|
|
3065
|
+
setOrgStanding(value);
|
|
3066
|
+
markChanged();
|
|
3067
|
+
},
|
|
3068
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-row items-center justify-center size-full", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3069
|
+
"div",
|
|
3070
|
+
{
|
|
3071
|
+
className: "flex items-center justify-center w-full",
|
|
3072
|
+
style: { padding: T6.spMd },
|
|
3073
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3074
|
+
"span",
|
|
3075
|
+
{
|
|
3076
|
+
style: {
|
|
3077
|
+
fontFamily: T6.font,
|
|
3078
|
+
fontSize: T6.fsSm,
|
|
3079
|
+
fontWeight: orgStanding === value ? 500 : 400,
|
|
3080
|
+
lineHeight: T6.lhSm,
|
|
3081
|
+
color: orgStanding === value ? T6.inverse : T6.muted,
|
|
3082
|
+
textAlign: "center"
|
|
3083
|
+
},
|
|
3084
|
+
children: label
|
|
3085
|
+
}
|
|
3086
|
+
)
|
|
3087
|
+
}
|
|
3088
|
+
) })
|
|
3089
|
+
},
|
|
3090
|
+
value
|
|
3091
|
+
))
|
|
3092
|
+
}
|
|
3093
|
+
) })
|
|
3094
|
+
]
|
|
3095
|
+
}
|
|
3096
|
+
),
|
|
3097
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3098
|
+
"span",
|
|
3099
|
+
{
|
|
3100
|
+
style: {
|
|
3101
|
+
fontFamily: T6.font,
|
|
3102
|
+
fontSize: T6.fsXs,
|
|
3103
|
+
fontWeight: 400,
|
|
3104
|
+
lineHeight: T6.lhXs,
|
|
3105
|
+
color: T6.tertiary
|
|
3106
|
+
},
|
|
3107
|
+
children: orgStanding === "colleague" ? `Joins ${organizationName || "the organization"} as a member \u2014 they'll also see its shared workspaces.` : `This workspace only. They see nothing else in ${organizationName || "the organization"}.`
|
|
3108
|
+
}
|
|
3109
|
+
)
|
|
3110
|
+
]
|
|
3111
|
+
}
|
|
3112
|
+
),
|
|
3011
3113
|
role !== "admin" && shownApps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3012
3114
|
"div",
|
|
3013
3115
|
{
|
|
@@ -3640,7 +3742,11 @@ function InviteUpdateModal({
|
|
|
3640
3742
|
catalogixStores: role === "admin" || showsApp("catalogix") ? Array.from(selectedStores) : []
|
|
3641
3743
|
};
|
|
3642
3744
|
if (isInvite && onInvite) {
|
|
3643
|
-
onInvite(
|
|
3745
|
+
onInvite(
|
|
3746
|
+
perms,
|
|
3747
|
+
emailValue.trim(),
|
|
3748
|
+
showOrganizationStanding ? orgStanding : void 0
|
|
3749
|
+
);
|
|
3644
3750
|
} else if (onSave) {
|
|
3645
3751
|
onSave(perms);
|
|
3646
3752
|
}
|
|
@@ -4370,7 +4476,7 @@ function TeamsContent({
|
|
|
4370
4476
|
organizationName,
|
|
4371
4477
|
hiddenApps
|
|
4372
4478
|
} = {}) {
|
|
4373
|
-
const { auth, api, workspace, toast } = useSettingsAdapters();
|
|
4479
|
+
const { auth, api, workspace, organization, toast } = useSettingsAdapters();
|
|
4374
4480
|
const user = auth.user;
|
|
4375
4481
|
const [activeTab, setActiveTab] = (0, import_react8.useState)("active");
|
|
4376
4482
|
const [activeMembers, setActiveMembers] = (0, import_react8.useState)([]);
|
|
@@ -4672,7 +4778,7 @@ function TeamsContent({
|
|
|
4672
4778
|
toast.error(msg);
|
|
4673
4779
|
}
|
|
4674
4780
|
};
|
|
4675
|
-
const handleInvite = async (permissions, email) => {
|
|
4781
|
+
const handleInvite = async (permissions, email, organizationStanding) => {
|
|
4676
4782
|
if (highestRole === "member") {
|
|
4677
4783
|
toast.error("You do not have permission to invite users");
|
|
4678
4784
|
closeModal();
|
|
@@ -4686,7 +4792,12 @@ function TeamsContent({
|
|
|
4686
4792
|
inviteAccess: permissions.canInviteUser,
|
|
4687
4793
|
role: permissions.role,
|
|
4688
4794
|
serviceIds,
|
|
4689
|
-
storeIds: permissions.catalogixStores || []
|
|
4795
|
+
storeIds: permissions.catalogixStores || [],
|
|
4796
|
+
// Omitted when the control was never shown, which leaves the backend
|
|
4797
|
+
// deriving the standing from the invitee's email domain as before.
|
|
4798
|
+
...organizationStanding ? {
|
|
4799
|
+
organizationRole: organizationStanding === "colleague" ? "member" : "guest"
|
|
4800
|
+
} : {}
|
|
4690
4801
|
});
|
|
4691
4802
|
toast.success(`Invitation sent to ${email}`);
|
|
4692
4803
|
await fetchData();
|
|
@@ -4707,6 +4818,9 @@ function TeamsContent({
|
|
|
4707
4818
|
const members = activeTab === "active" ? filteredActive : filteredPending;
|
|
4708
4819
|
const workspaceCurrent = workspace.current;
|
|
4709
4820
|
const orgVisibility = workspaceCurrent?.orgVisibility ?? "private";
|
|
4821
|
+
const workspaceOrgId = workspaceCurrent?.organizationId;
|
|
4822
|
+
const orgCurrent = organization.current;
|
|
4823
|
+
const mayGrantOrgMembership = !!workspaceOrgId && orgCurrent?.id === workspaceOrgId && orgCurrent?.role !== "guest" && (orgCurrent?.role === "admin" || orgCurrent?.inviteAccess === true);
|
|
4710
4824
|
const teamInnerContent = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
4711
4825
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4712
4826
|
ScopeHeader,
|
|
@@ -4814,6 +4928,8 @@ function TeamsContent({
|
|
|
4814
4928
|
// Must be admin or have invite permission, AND cannot remove yourself
|
|
4815
4929
|
(highestRole === "admin" || currentMemberPermissions?.canInviteUser === true) && modal.target?.userId !== user?.id
|
|
4816
4930
|
),
|
|
4931
|
+
showOrganizationStanding: mayGrantOrgMembership,
|
|
4932
|
+
organizationName: organizationName ?? orgCurrent?.name,
|
|
4817
4933
|
onInvite: handleInvite
|
|
4818
4934
|
}
|
|
4819
4935
|
)
|
|
@@ -5022,6 +5138,10 @@ function OrganizationInviteModal({
|
|
|
5022
5138
|
mode,
|
|
5023
5139
|
userEmail = "email@domain.in",
|
|
5024
5140
|
initialRole,
|
|
5141
|
+
lockRole,
|
|
5142
|
+
canClaimDomain = true,
|
|
5143
|
+
claimableDomain,
|
|
5144
|
+
lockedRoleLabel,
|
|
5025
5145
|
initialInviteAccess,
|
|
5026
5146
|
allowSubmitWithoutChanges = false,
|
|
5027
5147
|
canRemove = true,
|
|
@@ -5034,7 +5154,7 @@ function OrganizationInviteModal({
|
|
|
5034
5154
|
useOverlayOpen(open, onClose);
|
|
5035
5155
|
const [inviteMode, setInviteMode] = (0, import_react9.useState)("email");
|
|
5036
5156
|
const [emailValue, setEmailValue] = (0, import_react9.useState)("");
|
|
5037
|
-
const [domainValue, setDomainValue] = (0, import_react9.useState)("");
|
|
5157
|
+
const [domainValue, setDomainValue] = (0, import_react9.useState)(claimableDomain ?? "");
|
|
5038
5158
|
const [hasChanges, setHasChanges] = (0, import_react9.useState)(false);
|
|
5039
5159
|
const [role, setRole] = (0, import_react9.useState)("admin");
|
|
5040
5160
|
const [inviteAccess, setInviteAccess] = (0, import_react9.useState)(false);
|
|
@@ -5046,19 +5166,22 @@ function OrganizationInviteModal({
|
|
|
5046
5166
|
if (!open) {
|
|
5047
5167
|
setInviteMode("email");
|
|
5048
5168
|
setEmailValue("");
|
|
5049
|
-
setDomainValue("");
|
|
5169
|
+
setDomainValue(claimableDomain ?? "");
|
|
5050
5170
|
setHasChanges(false);
|
|
5051
5171
|
setRole("admin");
|
|
5052
5172
|
setInviteAccess(true);
|
|
5053
5173
|
}
|
|
5054
|
-
}, [open, mode, initialRole, initialInviteAccess]);
|
|
5174
|
+
}, [open, mode, initialRole, initialInviteAccess, claimableDomain]);
|
|
5055
5175
|
if (!open) return null;
|
|
5056
5176
|
const isInvite = mode === "invite";
|
|
5057
5177
|
const isEmailInvite = isInvite && inviteMode === "email";
|
|
5058
5178
|
const isDomainInvite = isInvite && inviteMode === "domain";
|
|
5059
5179
|
const hasEmail = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(emailValue.trim());
|
|
5060
5180
|
const hasDomain = /^[^\s@]+\.[^\s@]+$/.test(domainValue.trim());
|
|
5061
|
-
const isSubmitDisabled = isEmailInvite ? !hasEmail : isDomainInvite ? !hasDomain :
|
|
5181
|
+
const isSubmitDisabled = isEmailInvite ? !hasEmail : isDomainInvite ? !hasDomain : (
|
|
5182
|
+
// A locked role has nothing this modal can legitimately submit.
|
|
5183
|
+
lockRole || !(allowSubmitWithoutChanges || hasChanges)
|
|
5184
|
+
);
|
|
5062
5185
|
function markChanged() {
|
|
5063
5186
|
setHasChanges(true);
|
|
5064
5187
|
}
|
|
@@ -5133,7 +5256,7 @@ function OrganizationInviteModal({
|
|
|
5133
5256
|
className: "flex flex-col items-start w-full",
|
|
5134
5257
|
style: { padding: `${T9.sp3xl} ${T9.sp6xl}`, gap: T9.sp3xl },
|
|
5135
5258
|
children: [
|
|
5136
|
-
isInvite && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5259
|
+
isInvite && canClaimDomain && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5137
5260
|
"div",
|
|
5138
5261
|
{
|
|
5139
5262
|
className: "flex flex-col items-start justify-center shrink-0 w-full",
|
|
@@ -5194,9 +5317,9 @@ function OrganizationInviteModal({
|
|
|
5194
5317
|
}
|
|
5195
5318
|
),
|
|
5196
5319
|
isDomainInvite && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5197
|
-
"
|
|
5320
|
+
"span",
|
|
5198
5321
|
{
|
|
5199
|
-
className: "flex-1 min-w-0
|
|
5322
|
+
className: "flex-1 min-w-0 truncate",
|
|
5200
5323
|
style: {
|
|
5201
5324
|
fontFamily: T9.font,
|
|
5202
5325
|
fontSize: T9.fsSm,
|
|
@@ -5204,9 +5327,7 @@ function OrganizationInviteModal({
|
|
|
5204
5327
|
lineHeight: T9.lhSm,
|
|
5205
5328
|
color: T9.primary
|
|
5206
5329
|
},
|
|
5207
|
-
|
|
5208
|
-
value: domainValue,
|
|
5209
|
-
onChange: (e) => setDomainValue(e.target.value)
|
|
5330
|
+
children: domainValue
|
|
5210
5331
|
}
|
|
5211
5332
|
),
|
|
5212
5333
|
!isInvite && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
@@ -5239,9 +5360,10 @@ function OrganizationInviteModal({
|
|
|
5239
5360
|
color: T9.muted
|
|
5240
5361
|
},
|
|
5241
5362
|
children: [
|
|
5242
|
-
"Anyone
|
|
5243
|
-
domainValue.trim()
|
|
5244
|
-
"
|
|
5363
|
+
"Anyone who signs up or logs in with an @",
|
|
5364
|
+
domainValue.trim(),
|
|
5365
|
+
" ",
|
|
5366
|
+
"address will automatically join this organization from now on."
|
|
5245
5367
|
]
|
|
5246
5368
|
}
|
|
5247
5369
|
)
|
|
@@ -5255,7 +5377,21 @@ function OrganizationInviteModal({
|
|
|
5255
5377
|
style: { gap: T9.spXs },
|
|
5256
5378
|
children: [
|
|
5257
5379
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(FieldLabel3, { text: isDomainInvite ? "Auto-join role" : "Role" }),
|
|
5258
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.
|
|
5380
|
+
lockRole ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5381
|
+
"span",
|
|
5382
|
+
{
|
|
5383
|
+
style: {
|
|
5384
|
+
fontFamily: T9.font,
|
|
5385
|
+
fontSize: T9.fsSm,
|
|
5386
|
+
lineHeight: T9.lhSm,
|
|
5387
|
+
color: T9.muted
|
|
5388
|
+
},
|
|
5389
|
+
children: [
|
|
5390
|
+
lockedRoleLabel || "Guest",
|
|
5391
|
+
" \u2014 invited to specific workspaces only, with no access to the rest of the organization. Remove them to end that access."
|
|
5392
|
+
]
|
|
5393
|
+
}
|
|
5394
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
5259
5395
|
SegmentedToggle,
|
|
5260
5396
|
{
|
|
5261
5397
|
options: [
|
|
@@ -5273,7 +5409,7 @@ function OrganizationInviteModal({
|
|
|
5273
5409
|
]
|
|
5274
5410
|
}
|
|
5275
5411
|
),
|
|
5276
|
-
!isDomainInvite && role === "member" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5412
|
+
!isDomainInvite && !lockRole && role === "member" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5277
5413
|
"div",
|
|
5278
5414
|
{
|
|
5279
5415
|
className: "flex items-center shrink-0 w-full cursor-pointer",
|
|
@@ -5787,6 +5923,12 @@ function OrganizationModal({
|
|
|
5787
5923
|
|
|
5788
5924
|
// src/organization-content.tsx
|
|
5789
5925
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
5926
|
+
function orgRoleLabel(role) {
|
|
5927
|
+
if (role === "admin") return "Org admin";
|
|
5928
|
+
if (role === "member") return "Member";
|
|
5929
|
+
if (role === "guest") return "Guest";
|
|
5930
|
+
return role || "Member";
|
|
5931
|
+
}
|
|
5790
5932
|
var T11 = {
|
|
5791
5933
|
primary: "var(--alias-text---icons-primary)",
|
|
5792
5934
|
inverse: "var(--alias-text---icons-inverse)",
|
|
@@ -5930,7 +6072,7 @@ function MemberRow({
|
|
|
5930
6072
|
RoleChip,
|
|
5931
6073
|
{
|
|
5932
6074
|
role: member.role === "admin" ? "admin" : "member",
|
|
5933
|
-
label: member.role
|
|
6075
|
+
label: orgRoleLabel(member.role)
|
|
5934
6076
|
}
|
|
5935
6077
|
),
|
|
5936
6078
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
@@ -6038,7 +6180,7 @@ function InviteRow({
|
|
|
6038
6180
|
RoleChip,
|
|
6039
6181
|
{
|
|
6040
6182
|
role: role === "admin" ? "admin" : "member",
|
|
6041
|
-
label: role
|
|
6183
|
+
label: orgRoleLabel(role)
|
|
6042
6184
|
}
|
|
6043
6185
|
),
|
|
6044
6186
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
@@ -6185,7 +6327,8 @@ function JoinRequestRow({
|
|
|
6185
6327
|
function Section({
|
|
6186
6328
|
title,
|
|
6187
6329
|
children,
|
|
6188
|
-
empty
|
|
6330
|
+
empty,
|
|
6331
|
+
emptyText
|
|
6189
6332
|
}) {
|
|
6190
6333
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex flex-col items-start shrink-0 w-full", style: { gap: T11.spMd }, children: [
|
|
6191
6334
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
@@ -6220,7 +6363,7 @@ function Section({
|
|
|
6220
6363
|
lineHeight: T11.lhSm,
|
|
6221
6364
|
color: T11.muted
|
|
6222
6365
|
},
|
|
6223
|
-
children: "Nothing here yet"
|
|
6366
|
+
children: emptyText ?? "Nothing here yet"
|
|
6224
6367
|
}
|
|
6225
6368
|
) }) : children
|
|
6226
6369
|
}
|
|
@@ -6240,7 +6383,9 @@ function OrganizationContent({
|
|
|
6240
6383
|
const [invites, setInvites] = (0, import_react11.useState)([]);
|
|
6241
6384
|
const [workspaces, setWorkspaces] = (0, import_react11.useState)([]);
|
|
6242
6385
|
const [joinRequests, setJoinRequests] = (0, import_react11.useState)([]);
|
|
6243
|
-
const [highestRole, setHighestRole] = (0, import_react11.useState)("
|
|
6386
|
+
const [highestRole, setHighestRole] = (0, import_react11.useState)("guest");
|
|
6387
|
+
const [emailDomain, setEmailDomain] = (0, import_react11.useState)(null);
|
|
6388
|
+
const [canClaimEmailDomain, setCanClaimEmailDomain] = (0, import_react11.useState)(true);
|
|
6244
6389
|
const [searchQuery, setSearchQuery] = (0, import_react11.useState)("");
|
|
6245
6390
|
const [loadingData, setLoadingData] = (0, import_react11.useState)(false);
|
|
6246
6391
|
const [modal, setModal] = (0, import_react11.useState)({ open: false, mode: "invite" });
|
|
@@ -6255,6 +6400,12 @@ function OrganizationContent({
|
|
|
6255
6400
|
organization.getHighestRole?.().catch(() => null) ?? Promise.resolve(null)
|
|
6256
6401
|
]);
|
|
6257
6402
|
if (highestRoleRes?.role) setHighestRole(highestRoleRes.role);
|
|
6403
|
+
if (highestRoleRes?.emailDomain !== void 0) {
|
|
6404
|
+
setEmailDomain(highestRoleRes.emailDomain ?? null);
|
|
6405
|
+
}
|
|
6406
|
+
if (highestRoleRes?.canClaimEmailDomain !== void 0) {
|
|
6407
|
+
setCanClaimEmailDomain(highestRoleRes.canClaimEmailDomain);
|
|
6408
|
+
}
|
|
6258
6409
|
if (membersRes) setMembers(membersRes.filter((m) => m?.user));
|
|
6259
6410
|
if (invitesRes) setInvites(invitesRes);
|
|
6260
6411
|
if (workspacesRes) setWorkspaces(workspacesRes);
|
|
@@ -6345,7 +6496,7 @@ function OrganizationContent({
|
|
|
6345
6496
|
const openUpdateModal = (member) => setModal({ open: true, mode: "update", target: member });
|
|
6346
6497
|
const closeModal = () => setModal({ open: false, mode: "invite" });
|
|
6347
6498
|
const handleInviteEmail = async (input) => {
|
|
6348
|
-
if (highestRole
|
|
6499
|
+
if (highestRole !== "admin") {
|
|
6349
6500
|
toast.error("You do not have permission to invite members");
|
|
6350
6501
|
closeModal();
|
|
6351
6502
|
return;
|
|
@@ -6360,7 +6511,7 @@ function OrganizationContent({
|
|
|
6360
6511
|
}
|
|
6361
6512
|
};
|
|
6362
6513
|
const handleInviteDomain = async (input) => {
|
|
6363
|
-
if (highestRole
|
|
6514
|
+
if (highestRole !== "admin") {
|
|
6364
6515
|
toast.error("You do not have permission to invite members");
|
|
6365
6516
|
closeModal();
|
|
6366
6517
|
return;
|
|
@@ -6380,7 +6531,7 @@ function OrganizationContent({
|
|
|
6380
6531
|
closeModal();
|
|
6381
6532
|
return;
|
|
6382
6533
|
}
|
|
6383
|
-
if (highestRole
|
|
6534
|
+
if (highestRole !== "admin") {
|
|
6384
6535
|
toast.error("You do not have permission to manage members");
|
|
6385
6536
|
closeModal();
|
|
6386
6537
|
return;
|
|
@@ -6413,7 +6564,7 @@ function OrganizationContent({
|
|
|
6413
6564
|
closeModal();
|
|
6414
6565
|
return;
|
|
6415
6566
|
}
|
|
6416
|
-
if (highestRole
|
|
6567
|
+
if (highestRole !== "admin") {
|
|
6417
6568
|
toast.error("You do not have permission to manage members");
|
|
6418
6569
|
closeModal();
|
|
6419
6570
|
return;
|
|
@@ -6432,7 +6583,7 @@ function OrganizationContent({
|
|
|
6432
6583
|
closeModal();
|
|
6433
6584
|
};
|
|
6434
6585
|
const handleCancelInvite = async (invite) => {
|
|
6435
|
-
if (highestRole
|
|
6586
|
+
if (highestRole !== "admin") {
|
|
6436
6587
|
toast.error("You do not have permission to manage invites");
|
|
6437
6588
|
return;
|
|
6438
6589
|
}
|
|
@@ -6457,7 +6608,7 @@ function OrganizationContent({
|
|
|
6457
6608
|
};
|
|
6458
6609
|
const handleResendInvite = async (invite) => {
|
|
6459
6610
|
if (invite.kind !== "email") return;
|
|
6460
|
-
if (highestRole
|
|
6611
|
+
if (highestRole !== "admin") {
|
|
6461
6612
|
toast.error("You do not have permission to invite members");
|
|
6462
6613
|
return;
|
|
6463
6614
|
}
|
|
@@ -6673,14 +6824,22 @@ function OrganizationContent({
|
|
|
6673
6824
|
}
|
|
6674
6825
|
);
|
|
6675
6826
|
const domainsView = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
6676
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6677
|
-
|
|
6827
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6828
|
+
Section,
|
|
6678
6829
|
{
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6830
|
+
title: "Auto-join by email domain",
|
|
6831
|
+
empty: domainInvites.length === 0,
|
|
6832
|
+
emptyText: canClaimEmailDomain ? void 0 : `Auto-join needs a company email domain.${emailDomain ? ` ${emailDomain} is a public email provider, so it` : " A public email provider"} can't be claimed \u2014 invite people by email instead.`,
|
|
6833
|
+
children: domainInvites.map((inv) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6834
|
+
InviteRow,
|
|
6835
|
+
{
|
|
6836
|
+
invite: inv,
|
|
6837
|
+
onCancel: () => void handleCancelInvite(inv)
|
|
6838
|
+
},
|
|
6839
|
+
inv._id
|
|
6840
|
+
))
|
|
6841
|
+
}
|
|
6842
|
+
),
|
|
6684
6843
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6685
6844
|
Section,
|
|
6686
6845
|
{
|
|
@@ -6710,10 +6869,14 @@ function OrganizationContent({
|
|
|
6710
6869
|
open: modal.open,
|
|
6711
6870
|
mode: modal.mode,
|
|
6712
6871
|
userEmail: modal.target?.user.email,
|
|
6713
|
-
initialRole: modal.target?.role,
|
|
6872
|
+
initialRole: modal.target?.role === "admin" || modal.target?.role === "member" ? modal.target.role : void 0,
|
|
6714
6873
|
initialInviteAccess: modal.target?.inviteAccess,
|
|
6715
6874
|
allowSubmitWithoutChanges: false,
|
|
6875
|
+
lockRole: modal.target?.role === "guest",
|
|
6876
|
+
lockedRoleLabel: orgRoleLabel(modal.target?.role),
|
|
6716
6877
|
canRemove: highestRole === "admin",
|
|
6878
|
+
canClaimDomain: canClaimEmailDomain,
|
|
6879
|
+
claimableDomain: emailDomain,
|
|
6717
6880
|
onClose: closeModal,
|
|
6718
6881
|
onInviteEmail: handleInviteEmail,
|
|
6719
6882
|
onInviteDomain: handleInviteDomain,
|
|
@@ -6783,7 +6946,7 @@ function OrganizationContent({
|
|
|
6783
6946
|
variant: "primary",
|
|
6784
6947
|
size: "md",
|
|
6785
6948
|
styleVariant: "icon-left",
|
|
6786
|
-
state: highestRole
|
|
6949
|
+
state: highestRole !== "admin" ? "disabled" : "default",
|
|
6787
6950
|
icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons7.SiconUserAdd, { className: "w-5 h-5", color: "var(--alias-text---icons-inverse)" }),
|
|
6788
6951
|
onClick: openInviteModal
|
|
6789
6952
|
}
|
|
@@ -10809,194 +10972,202 @@ function ProfileTab() {
|
|
|
10809
10972
|
}
|
|
10810
10973
|
auth.clearAuth();
|
|
10811
10974
|
};
|
|
10812
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.
|
|
10975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
10813
10976
|
"div",
|
|
10814
10977
|
{
|
|
10815
10978
|
className: "flex flex-col items-start flex-1 min-w-0",
|
|
10816
10979
|
style: { gap: "var(--spacing-3xl)" },
|
|
10817
|
-
children:
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
}
|
|
10848
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10849
|
-
"div",
|
|
10850
|
-
{
|
|
10851
|
-
"aria-label": "Profile",
|
|
10852
|
-
className: "flex items-center justify-center",
|
|
10853
|
-
style: {
|
|
10854
|
-
width: 100,
|
|
10855
|
-
height: 100,
|
|
10856
|
-
borderRadius: "var(--radius-full)",
|
|
10857
|
-
backgroundColor: "var(--alias-surface-raised)",
|
|
10858
|
-
border: "1px solid var(--alias-border-subtle)",
|
|
10859
|
-
flexShrink: 0
|
|
10860
|
-
},
|
|
10861
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10862
|
-
"span",
|
|
10863
|
-
{
|
|
10864
|
-
style: {
|
|
10865
|
-
color: "var(--alias-text---icons-primary)",
|
|
10866
|
-
fontFamily: "var(--font-family-font-family-display)",
|
|
10867
|
-
fontSize: 34,
|
|
10868
|
-
fontWeight: 600,
|
|
10869
|
-
lineHeight: "34px"
|
|
10870
|
-
},
|
|
10871
|
-
children: profileInitial
|
|
10980
|
+
children: [
|
|
10981
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
10982
|
+
"div",
|
|
10983
|
+
{
|
|
10984
|
+
className: "flex items-start w-full",
|
|
10985
|
+
style: {
|
|
10986
|
+
backgroundColor: "var(--alias-surface-base)",
|
|
10987
|
+
borderRadius: "var(--radius-3xl)",
|
|
10988
|
+
border: "1px solid var(--alias-border-subtle)",
|
|
10989
|
+
padding: "var(--spacing-6xl)",
|
|
10990
|
+
gap: "var(--spacing-6xl)"
|
|
10991
|
+
},
|
|
10992
|
+
children: [
|
|
10993
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
10994
|
+
"div",
|
|
10995
|
+
{
|
|
10996
|
+
className: "flex flex-col items-center shrink-0",
|
|
10997
|
+
style: { gap: "var(--spacing-md)", width: 120 },
|
|
10998
|
+
children: [
|
|
10999
|
+
profileImage ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11000
|
+
"img",
|
|
11001
|
+
{
|
|
11002
|
+
src: profileImage,
|
|
11003
|
+
alt: "Profile",
|
|
11004
|
+
style: {
|
|
11005
|
+
width: 100,
|
|
11006
|
+
height: 100,
|
|
11007
|
+
borderRadius: "var(--radius-full)",
|
|
11008
|
+
objectFit: "cover",
|
|
11009
|
+
flexShrink: 0
|
|
10872
11010
|
}
|
|
10873
|
-
|
|
10874
|
-
|
|
10875
|
-
|
|
10876
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10877
|
-
"input",
|
|
10878
|
-
{
|
|
10879
|
-
ref: fileInputRef,
|
|
10880
|
-
type: "file",
|
|
10881
|
-
accept: "image/*",
|
|
10882
|
-
style: { display: "none" },
|
|
10883
|
-
onChange: handleImageChange
|
|
10884
|
-
}
|
|
10885
|
-
),
|
|
10886
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center justify-center", style: { gap: 10 }, children: [
|
|
10887
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10888
|
-
import_ui13.ScButton,
|
|
11011
|
+
}
|
|
11012
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11013
|
+
"div",
|
|
10889
11014
|
{
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
11015
|
+
"aria-label": "Profile",
|
|
11016
|
+
className: "flex items-center justify-center",
|
|
11017
|
+
style: {
|
|
11018
|
+
width: 100,
|
|
11019
|
+
height: 100,
|
|
11020
|
+
borderRadius: "var(--radius-full)",
|
|
11021
|
+
backgroundColor: "var(--alias-surface-raised)",
|
|
11022
|
+
border: "1px solid var(--alias-border-subtle)",
|
|
11023
|
+
flexShrink: 0
|
|
11024
|
+
},
|
|
11025
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11026
|
+
"span",
|
|
11027
|
+
{
|
|
11028
|
+
style: {
|
|
11029
|
+
color: "var(--alias-text---icons-primary)",
|
|
11030
|
+
fontFamily: "var(--font-family-font-family-display)",
|
|
11031
|
+
fontSize: 34,
|
|
11032
|
+
fontWeight: 600,
|
|
11033
|
+
lineHeight: "34px"
|
|
11034
|
+
},
|
|
11035
|
+
children: profileInitial
|
|
11036
|
+
}
|
|
11037
|
+
)
|
|
10896
11038
|
}
|
|
10897
11039
|
),
|
|
10898
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui11.ScVDivider, {}),
|
|
10899
11040
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10900
|
-
|
|
11041
|
+
"input",
|
|
10901
11042
|
{
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
11043
|
+
ref: fileInputRef,
|
|
11044
|
+
type: "file",
|
|
11045
|
+
accept: "image/*",
|
|
11046
|
+
style: { display: "none" },
|
|
11047
|
+
onChange: handleImageChange
|
|
11048
|
+
}
|
|
11049
|
+
),
|
|
11050
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
11051
|
+
"div",
|
|
11052
|
+
{
|
|
11053
|
+
className: "flex flex-col items-stretch w-full",
|
|
11054
|
+
style: { gap: "var(--spacing-md)" },
|
|
11055
|
+
children: [
|
|
11056
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11057
|
+
import_ui13.ScButton,
|
|
11058
|
+
{
|
|
11059
|
+
text: "Upload photo",
|
|
11060
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons12.SiconUpload, { className: "w-5 h-5", color: PRIMARY_COLOR3 }),
|
|
11061
|
+
styleVariant: "icon-left",
|
|
11062
|
+
variant: "outline",
|
|
11063
|
+
size: "md",
|
|
11064
|
+
state: disableAllActions ? "disabled" : "default",
|
|
11065
|
+
onClick: handleUploadClick
|
|
11066
|
+
}
|
|
11067
|
+
),
|
|
11068
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11069
|
+
import_ui13.ScButton,
|
|
11070
|
+
{
|
|
11071
|
+
text: "Remove photo",
|
|
11072
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11073
|
+
import_icons12.SiconDelete,
|
|
11074
|
+
{
|
|
11075
|
+
className: "w-5 h-5",
|
|
11076
|
+
color: PRIMARY_COLOR3
|
|
11077
|
+
}
|
|
11078
|
+
),
|
|
11079
|
+
styleVariant: "icon-left",
|
|
11080
|
+
variant: "outline",
|
|
11081
|
+
size: "md",
|
|
11082
|
+
state: disableAllActions || !profileImage ? "disabled" : "default",
|
|
11083
|
+
onClick: handleDeleteImage
|
|
11084
|
+
}
|
|
11085
|
+
)
|
|
11086
|
+
]
|
|
10914
11087
|
}
|
|
10915
11088
|
)
|
|
10916
|
-
]
|
|
10917
|
-
]
|
|
10918
|
-
}
|
|
10919
|
-
),
|
|
10920
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10921
|
-
"div",
|
|
10922
|
-
{
|
|
10923
|
-
className: "shrink-0",
|
|
10924
|
-
style: {
|
|
10925
|
-
width: 0,
|
|
10926
|
-
alignSelf: "stretch",
|
|
10927
|
-
borderLeft: "0.5px solid var(--alias-border-divider)"
|
|
11089
|
+
]
|
|
10928
11090
|
}
|
|
10929
|
-
|
|
10930
|
-
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
11091
|
+
),
|
|
11092
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11093
|
+
"div",
|
|
11094
|
+
{
|
|
11095
|
+
className: "shrink-0",
|
|
11096
|
+
style: {
|
|
11097
|
+
width: 0,
|
|
11098
|
+
alignSelf: "stretch",
|
|
11099
|
+
borderLeft: "0.5px solid var(--alias-border-divider)"
|
|
11100
|
+
}
|
|
11101
|
+
}
|
|
11102
|
+
),
|
|
11103
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
11104
|
+
"div",
|
|
11105
|
+
{
|
|
11106
|
+
className: "flex flex-col flex-1 min-w-0",
|
|
11107
|
+
style: { gap: "var(--spacing-3xl)" },
|
|
11108
|
+
children: [
|
|
11109
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-start w-full", style: { gap: "var(--spacing-3xl)" }, children: [
|
|
11110
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex-1 min-w-0", style: { overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11111
|
+
import_ui12.ScTextField,
|
|
11112
|
+
{
|
|
11113
|
+
label: "Full Name",
|
|
11114
|
+
labelGroup: "label",
|
|
11115
|
+
state: "filled",
|
|
11116
|
+
placeholderFilled: "Enter your name",
|
|
11117
|
+
tfGroup: "none",
|
|
11118
|
+
className: "sc-text-field-full-width",
|
|
11119
|
+
style: { width: "100%" },
|
|
11120
|
+
value: fullName,
|
|
11121
|
+
onChange: (e) => setFullName(e.target.value)
|
|
11122
|
+
}
|
|
11123
|
+
) }),
|
|
11124
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11125
|
+
SpecializationDropdown,
|
|
11126
|
+
{
|
|
11127
|
+
value: selectedSpec,
|
|
11128
|
+
onChange: setSelectedSpec,
|
|
11129
|
+
disabled: disableAllActions
|
|
11130
|
+
}
|
|
11131
|
+
) })
|
|
11132
|
+
] }),
|
|
11133
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-start w-full", style: { gap: "var(--spacing-3xl)" }, children: [
|
|
11134
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11135
|
+
LanguageDropdown,
|
|
11136
|
+
{
|
|
11137
|
+
value: selectedLanguage,
|
|
11138
|
+
onChange: setSelectedLanguage,
|
|
11139
|
+
disabled: disableAllActions
|
|
11140
|
+
}
|
|
11141
|
+
) }),
|
|
11142
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex-1 min-w-0" })
|
|
11143
|
+
] }),
|
|
11144
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-full", style: { overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10939
11145
|
import_ui12.ScTextField,
|
|
10940
11146
|
{
|
|
10941
|
-
label: "
|
|
11147
|
+
label: "Email ID",
|
|
10942
11148
|
labelGroup: "label",
|
|
10943
|
-
state: "
|
|
10944
|
-
|
|
10945
|
-
|
|
11149
|
+
state: "default",
|
|
11150
|
+
value: user?.email ?? "",
|
|
11151
|
+
placeholderFilled: user?.email ?? "chris@kepler.com",
|
|
11152
|
+
tfGroup: "icon-right",
|
|
11153
|
+
tfRightIcon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11154
|
+
import_icons12.SiconLock,
|
|
11155
|
+
{
|
|
11156
|
+
className: "w-6 h-6",
|
|
11157
|
+
color: "var(--alias-text---icons-primary)"
|
|
11158
|
+
}
|
|
11159
|
+
),
|
|
10946
11160
|
className: "sc-text-field-full-width",
|
|
10947
11161
|
style: { width: "100%" },
|
|
10948
|
-
|
|
10949
|
-
onChange: (e) => setFullName(e.target.value)
|
|
11162
|
+
readOnly: true
|
|
10950
11163
|
}
|
|
10951
11164
|
) }),
|
|
10952
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10953
|
-
|
|
10954
|
-
{
|
|
10955
|
-
value: selectedSpec,
|
|
10956
|
-
onChange: setSelectedSpec,
|
|
10957
|
-
disabled: disableAllActions
|
|
10958
|
-
}
|
|
10959
|
-
) })
|
|
10960
|
-
] }),
|
|
10961
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-start w-full", style: { gap: "var(--spacing-3xl)" }, children: [
|
|
10962
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10963
|
-
LanguageDropdown,
|
|
11165
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11166
|
+
"div",
|
|
10964
11167
|
{
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
}
|
|
10969
|
-
) }),
|
|
10970
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex-1 min-w-0" })
|
|
10971
|
-
] }),
|
|
10972
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-full", style: { overflow: "hidden" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10973
|
-
import_ui12.ScTextField,
|
|
10974
|
-
{
|
|
10975
|
-
label: "Email ID",
|
|
10976
|
-
labelGroup: "label",
|
|
10977
|
-
state: "default",
|
|
10978
|
-
value: user?.email ?? "",
|
|
10979
|
-
placeholderFilled: user?.email ?? "chris@kepler.com",
|
|
10980
|
-
tfGroup: "icon-right",
|
|
10981
|
-
tfRightIcon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10982
|
-
import_icons12.SiconLock,
|
|
10983
|
-
{
|
|
10984
|
-
className: "w-6 h-6",
|
|
10985
|
-
color: "var(--alias-text---icons-primary)"
|
|
10986
|
-
}
|
|
10987
|
-
),
|
|
10988
|
-
className: "sc-text-field-full-width",
|
|
10989
|
-
style: { width: "100%" },
|
|
10990
|
-
readOnly: true
|
|
10991
|
-
}
|
|
10992
|
-
) }),
|
|
10993
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
10994
|
-
"div",
|
|
10995
|
-
{
|
|
10996
|
-
className: "flex items-center w-full",
|
|
10997
|
-
style: { gap: "var(--spacing-3xl)", justifyContent: "flex-end", paddingTop: "var(--spacing-md)" },
|
|
10998
|
-
children: [
|
|
10999
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11168
|
+
className: "flex items-center w-full",
|
|
11169
|
+
style: { justifyContent: "flex-end", paddingTop: "var(--spacing-md)" },
|
|
11170
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11000
11171
|
import_ui13.ScButton,
|
|
11001
11172
|
{
|
|
11002
11173
|
text: saving ? "Saving..." : "Save changes",
|
|
@@ -11005,25 +11176,69 @@ function ProfileTab() {
|
|
|
11005
11176
|
state: saving || !dirty ? "disabled" : "default",
|
|
11006
11177
|
onClick: handleSave
|
|
11007
11178
|
}
|
|
11008
|
-
),
|
|
11009
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11010
|
-
import_ui13.ScButton,
|
|
11011
|
-
{
|
|
11012
|
-
text: "Logout",
|
|
11013
|
-
variant: "error",
|
|
11014
|
-
size: "md",
|
|
11015
|
-
onClick: handleLogout
|
|
11016
|
-
}
|
|
11017
11179
|
)
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
|
|
11025
|
-
|
|
11026
|
-
|
|
11180
|
+
}
|
|
11181
|
+
)
|
|
11182
|
+
]
|
|
11183
|
+
}
|
|
11184
|
+
)
|
|
11185
|
+
]
|
|
11186
|
+
}
|
|
11187
|
+
),
|
|
11188
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
11189
|
+
"div",
|
|
11190
|
+
{
|
|
11191
|
+
className: "flex items-center w-full",
|
|
11192
|
+
style: {
|
|
11193
|
+
backgroundColor: "var(--alias-surface-base)",
|
|
11194
|
+
borderRadius: "var(--radius-3xl)",
|
|
11195
|
+
border: "1px solid var(--alias-border-subtle)",
|
|
11196
|
+
padding: "var(--spacing-6xl)",
|
|
11197
|
+
gap: "var(--spacing-3xl)"
|
|
11198
|
+
},
|
|
11199
|
+
children: [
|
|
11200
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col min-w-0 flex-1", style: { gap: "var(--spacing-xs)" }, children: [
|
|
11201
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11202
|
+
"span",
|
|
11203
|
+
{
|
|
11204
|
+
style: {
|
|
11205
|
+
fontFamily: "var(--font-family-font-family-body)",
|
|
11206
|
+
fontSize: "var(--font-size-font-size-md)",
|
|
11207
|
+
fontWeight: 600,
|
|
11208
|
+
lineHeight: "var(--line-height-line-height-md)",
|
|
11209
|
+
color: "var(--alias-text---icons-primary)"
|
|
11210
|
+
},
|
|
11211
|
+
children: "Session"
|
|
11212
|
+
}
|
|
11213
|
+
),
|
|
11214
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11215
|
+
"span",
|
|
11216
|
+
{
|
|
11217
|
+
className: "truncate",
|
|
11218
|
+
style: {
|
|
11219
|
+
fontFamily: "var(--font-family-font-family-body)",
|
|
11220
|
+
fontSize: "var(--font-size-font-size-sm)",
|
|
11221
|
+
lineHeight: "var(--line-height-line-height-sm)",
|
|
11222
|
+
color: "var(--alias-text---icons-muted)"
|
|
11223
|
+
},
|
|
11224
|
+
title: user?.email ?? void 0,
|
|
11225
|
+
children: user?.email ? `Signed in as ${user.email}` : "Signed in"
|
|
11226
|
+
}
|
|
11227
|
+
)
|
|
11228
|
+
] }),
|
|
11229
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11230
|
+
import_ui13.ScButton,
|
|
11231
|
+
{
|
|
11232
|
+
text: "Log out",
|
|
11233
|
+
variant: "outline",
|
|
11234
|
+
size: "md",
|
|
11235
|
+
onClick: handleLogout
|
|
11236
|
+
}
|
|
11237
|
+
)
|
|
11238
|
+
]
|
|
11239
|
+
}
|
|
11240
|
+
)
|
|
11241
|
+
]
|
|
11027
11242
|
}
|
|
11028
11243
|
);
|
|
11029
11244
|
}
|
|
@@ -11242,6 +11457,7 @@ function SettingsContent({
|
|
|
11242
11457
|
adapters,
|
|
11243
11458
|
activeTab = "profile",
|
|
11244
11459
|
onClose,
|
|
11460
|
+
onBack,
|
|
11245
11461
|
hiddenApps
|
|
11246
11462
|
}) {
|
|
11247
11463
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SettingsAdaptersProvider, { adapters, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
@@ -11249,6 +11465,7 @@ function SettingsContent({
|
|
|
11249
11465
|
{
|
|
11250
11466
|
activeTab,
|
|
11251
11467
|
onClose: onClose ?? adapters.navigation.close,
|
|
11468
|
+
onBack: onBack === null ? null : onBack ?? adapters.navigation.back,
|
|
11252
11469
|
hiddenApps
|
|
11253
11470
|
}
|
|
11254
11471
|
) });
|
|
@@ -11256,6 +11473,7 @@ function SettingsContent({
|
|
|
11256
11473
|
function SettingsContentInner({
|
|
11257
11474
|
activeTab,
|
|
11258
11475
|
onClose,
|
|
11476
|
+
onBack,
|
|
11259
11477
|
hiddenApps
|
|
11260
11478
|
}) {
|
|
11261
11479
|
const {
|
|
@@ -11626,6 +11844,33 @@ function SettingsContentInner({
|
|
|
11626
11844
|
width: "100%"
|
|
11627
11845
|
},
|
|
11628
11846
|
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col w-full flex-1 min-h-0", style: { gap: 20, paddingTop: 16 }, children: [
|
|
11847
|
+
onBack !== null && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex items-center shrink-0", style: { paddingLeft: 20 }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
11848
|
+
"button",
|
|
11849
|
+
{
|
|
11850
|
+
type: "button",
|
|
11851
|
+
"aria-label": "Back to previous screen",
|
|
11852
|
+
className: "flex items-center cursor-pointer",
|
|
11853
|
+
style: {
|
|
11854
|
+
gap: "var(--spacing-sm)",
|
|
11855
|
+
padding: "var(--spacing-xs) var(--spacing-md)",
|
|
11856
|
+
marginLeft: "calc(var(--spacing-md) * -1)",
|
|
11857
|
+
border: "1px solid transparent",
|
|
11858
|
+
borderRadius: "var(--radius-xl)",
|
|
11859
|
+
background: "transparent",
|
|
11860
|
+
height: 32,
|
|
11861
|
+
color: "var(--alias-text---icons-muted)",
|
|
11862
|
+
fontFamily: "var(--font-family-font-family-body)",
|
|
11863
|
+
fontSize: "var(--font-size-font-size-sm)",
|
|
11864
|
+
fontWeight: 500,
|
|
11865
|
+
lineHeight: "var(--line-height-line-height-sm)"
|
|
11866
|
+
},
|
|
11867
|
+
onClick: () => onBack ? onBack() : window.history.back(),
|
|
11868
|
+
children: [
|
|
11869
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons12.SiconLeft, { className: "w-4 h-4 shrink-0", color: "var(--alias-text---icons-muted)" }),
|
|
11870
|
+
"Back"
|
|
11871
|
+
]
|
|
11872
|
+
}
|
|
11873
|
+
) }),
|
|
11629
11874
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
11630
11875
|
"div",
|
|
11631
11876
|
{
|