@stackframe/stack 2.7.23 → 2.7.26
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/CHANGELOG.md +29 -0
- package/dist/components/elements/maybe-full-page.js +1 -0
- package/dist/components/elements/maybe-full-page.js.map +1 -1
- package/dist/components/elements/sidebar-layout.js +2 -9
- package/dist/components/elements/sidebar-layout.js.map +1 -1
- package/dist/components-page/account-settings.js +70 -83
- package/dist/components-page/account-settings.js.map +1 -1
- package/dist/esm/components/elements/maybe-full-page.js +1 -0
- package/dist/esm/components/elements/maybe-full-page.js.map +1 -1
- package/dist/esm/components/elements/sidebar-layout.js +2 -9
- package/dist/esm/components/elements/sidebar-layout.js.map +1 -1
- package/dist/esm/components-page/account-settings.js +69 -80
- package/dist/esm/components-page/account-settings.js.map +1 -1
- package/dist/esm/generated/global-css.js +1 -1
- package/dist/esm/generated/global-css.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js +6 -10
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/esm/lib/stack-app/projects/index.js +2 -1
- package/dist/esm/lib/stack-app/projects/index.js.map +1 -1
- package/dist/esm/lib/stack-app/users/index.js.map +1 -1
- package/dist/generated/global-css.js +1 -1
- package/dist/generated/global-css.js.map +1 -1
- package/dist/index.d.mts +1056 -53
- package/dist/index.d.ts +1056 -53
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js +1 -0
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js +5 -9
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/lib/stack-app/project-configs/index.js.map +1 -1
- package/dist/lib/stack-app/projects/index.js +2 -1
- package/dist/lib/stack-app/projects/index.js.map +1 -1
- package/dist/lib/stack-app/users/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/admin-app-impl-CTQhv9tV.d.ts +0 -395
- package/dist/admin-app-impl-DpyRKp1e.d.mts +0 -395
- package/dist/components/credential-sign-in.d.mts +0 -5
- package/dist/components/credential-sign-in.d.ts +0 -5
- package/dist/components/credential-sign-up.d.mts +0 -7
- package/dist/components/credential-sign-up.d.ts +0 -7
- package/dist/components/elements/form-warning.d.mts +0 -7
- package/dist/components/elements/form-warning.d.ts +0 -7
- package/dist/components/elements/maybe-full-page.d.mts +0 -11
- package/dist/components/elements/maybe-full-page.d.ts +0 -11
- package/dist/components/elements/separator-with-text.d.mts +0 -7
- package/dist/components/elements/separator-with-text.d.ts +0 -7
- package/dist/components/elements/sidebar-layout.d.mts +0 -19
- package/dist/components/elements/sidebar-layout.d.ts +0 -19
- package/dist/components/elements/ssr-layout-effect.d.mts +0 -8
- package/dist/components/elements/ssr-layout-effect.d.ts +0 -8
- package/dist/components/elements/user-avatar.d.mts +0 -13
- package/dist/components/elements/user-avatar.d.ts +0 -13
- package/dist/components/iframe-preventer.d.mts +0 -8
- package/dist/components/iframe-preventer.d.ts +0 -8
- package/dist/components/link.d.mts +0 -14
- package/dist/components/link.d.ts +0 -14
- package/dist/components/magic-link-sign-in.d.mts +0 -5
- package/dist/components/magic-link-sign-in.d.ts +0 -5
- package/dist/components/message-cards/known-error-message-card.d.mts +0 -9
- package/dist/components/message-cards/known-error-message-card.d.ts +0 -9
- package/dist/components/message-cards/message-card.d.mts +0 -14
- package/dist/components/message-cards/message-card.d.ts +0 -14
- package/dist/components/message-cards/predefined-message-card.d.mts +0 -8
- package/dist/components/message-cards/predefined-message-card.d.ts +0 -8
- package/dist/components/oauth-button-group.d.mts +0 -14
- package/dist/components/oauth-button-group.d.ts +0 -14
- package/dist/components/oauth-button.d.mts +0 -8
- package/dist/components/oauth-button.d.ts +0 -8
- package/dist/components/passkey-button.d.mts +0 -7
- package/dist/components/passkey-button.d.ts +0 -7
- package/dist/components/profile-image-editor.d.mts +0 -11
- package/dist/components/profile-image-editor.d.ts +0 -11
- package/dist/components/selected-team-switcher.d.mts +0 -33
- package/dist/components/selected-team-switcher.d.ts +0 -33
- package/dist/components/team-icon.d.mts +0 -30
- package/dist/components/team-icon.d.ts +0 -30
- package/dist/components/user-button.d.mts +0 -15
- package/dist/components/user-button.d.ts +0 -15
- package/dist/components-page/account-settings.d.mts +0 -24
- package/dist/components-page/account-settings.d.ts +0 -24
- package/dist/components-page/auth-page.d.mts +0 -24
- package/dist/components-page/auth-page.d.ts +0 -24
- package/dist/components-page/email-verification.d.mts +0 -8
- package/dist/components-page/email-verification.d.ts +0 -8
- package/dist/components-page/error-page.d.mts +0 -8
- package/dist/components-page/error-page.d.ts +0 -8
- package/dist/components-page/forgot-password.d.mts +0 -10
- package/dist/components-page/forgot-password.d.ts +0 -10
- package/dist/components-page/magic-link-callback.d.mts +0 -8
- package/dist/components-page/magic-link-callback.d.ts +0 -8
- package/dist/components-page/oauth-callback.d.mts +0 -7
- package/dist/components-page/oauth-callback.d.ts +0 -7
- package/dist/components-page/password-reset.d.mts +0 -12
- package/dist/components-page/password-reset.d.ts +0 -12
- package/dist/components-page/sign-in.d.mts +0 -10
- package/dist/components-page/sign-in.d.ts +0 -10
- package/dist/components-page/sign-out.d.mts +0 -7
- package/dist/components-page/sign-out.d.ts +0 -7
- package/dist/components-page/sign-up.d.mts +0 -11
- package/dist/components-page/sign-up.d.ts +0 -11
- package/dist/components-page/stack-handler.d.mts +0 -72
- package/dist/components-page/stack-handler.d.ts +0 -72
- package/dist/components-page/team-creation.d.mts +0 -7
- package/dist/components-page/team-creation.d.ts +0 -7
- package/dist/components-page/team-invitation.d.mts +0 -8
- package/dist/components-page/team-invitation.d.ts +0 -8
- package/dist/generated/global-css.d.mts +0 -3
- package/dist/generated/global-css.d.ts +0 -3
- package/dist/generated/quetzal-translations.d.mts +0 -4
- package/dist/generated/quetzal-translations.d.ts +0 -4
- package/dist/global.d.d.mts +0 -2
- package/dist/global.d.d.ts +0 -2
- package/dist/index-C7D6Vt7X.d.mts +0 -560
- package/dist/index-DQk7XJpU.d.ts +0 -560
- package/dist/lib/auth.d.mts +0 -33
- package/dist/lib/auth.d.ts +0 -33
- package/dist/lib/cookie.d.mts +0 -33
- package/dist/lib/cookie.d.ts +0 -33
- package/dist/lib/hooks.d.mts +0 -53
- package/dist/lib/hooks.d.ts +0 -53
- package/dist/lib/stack-app/api-keys/index.d.mts +0 -40
- package/dist/lib/stack-app/api-keys/index.d.ts +0 -40
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.d.mts +0 -30
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.d.ts +0 -30
- package/dist/lib/stack-app/apps/implementations/client-app-impl.d.mts +0 -30
- package/dist/lib/stack-app/apps/implementations/client-app-impl.d.ts +0 -30
- package/dist/lib/stack-app/apps/implementations/common.d.mts +0 -45
- package/dist/lib/stack-app/apps/implementations/common.d.ts +0 -45
- package/dist/lib/stack-app/apps/implementations/index.d.mts +0 -36
- package/dist/lib/stack-app/apps/implementations/index.d.ts +0 -36
- package/dist/lib/stack-app/apps/implementations/server-app-impl.d.mts +0 -30
- package/dist/lib/stack-app/apps/implementations/server-app-impl.d.ts +0 -30
- package/dist/lib/stack-app/apps/index.d.mts +0 -23
- package/dist/lib/stack-app/apps/index.d.ts +0 -23
- package/dist/lib/stack-app/apps/interfaces/admin-app.d.mts +0 -23
- package/dist/lib/stack-app/apps/interfaces/admin-app.d.ts +0 -23
- package/dist/lib/stack-app/apps/interfaces/client-app.d.mts +0 -23
- package/dist/lib/stack-app/apps/interfaces/client-app.d.ts +0 -23
- package/dist/lib/stack-app/apps/interfaces/server-app.d.mts +0 -23
- package/dist/lib/stack-app/apps/interfaces/server-app.d.ts +0 -23
- package/dist/lib/stack-app/common.d.mts +0 -63
- package/dist/lib/stack-app/common.d.ts +0 -63
- package/dist/lib/stack-app/connected-accounts/index.d.mts +0 -13
- package/dist/lib/stack-app/connected-accounts/index.d.ts +0 -13
- package/dist/lib/stack-app/contact-channels/index.d.mts +0 -38
- package/dist/lib/stack-app/contact-channels/index.d.ts +0 -38
- package/dist/lib/stack-app/email-templates/index.d.mts +0 -15
- package/dist/lib/stack-app/email-templates/index.d.ts +0 -15
- package/dist/lib/stack-app/index.d.mts +0 -23
- package/dist/lib/stack-app/index.d.ts +0 -23
- package/dist/lib/stack-app/permissions/index.d.mts +0 -21
- package/dist/lib/stack-app/permissions/index.d.ts +0 -21
- package/dist/lib/stack-app/project-configs/index.d.mts +0 -82
- package/dist/lib/stack-app/project-configs/index.d.ts +0 -82
- package/dist/lib/stack-app/projects/index.d.mts +0 -23
- package/dist/lib/stack-app/projects/index.d.ts +0 -23
- package/dist/lib/stack-app/teams/index.d.mts +0 -23
- package/dist/lib/stack-app/teams/index.d.ts +0 -23
- package/dist/lib/stack-app/users/index.d.mts +0 -23
- package/dist/lib/stack-app/users/index.d.ts +0 -23
- package/dist/lib/translations.d.mts +0 -5
- package/dist/lib/translations.d.ts +0 -5
- package/dist/providers/stack-provider-client.d.mts +0 -39
- package/dist/providers/stack-provider-client.d.ts +0 -39
- package/dist/providers/stack-provider.d.mts +0 -42
- package/dist/providers/stack-provider.d.ts +0 -42
- package/dist/providers/theme-provider.d.mts +0 -40
- package/dist/providers/theme-provider.d.ts +0 -40
- package/dist/providers/translation-provider-client.d.mts +0 -14
- package/dist/providers/translation-provider-client.d.ts +0 -14
- package/dist/providers/translation-provider.d.mts +0 -10
- package/dist/providers/translation-provider.d.ts +0 -10
- package/dist/utils/browser-script.d.mts +0 -7
- package/dist/utils/browser-script.d.ts +0 -7
- package/dist/utils/constants.d.mts +0 -79
- package/dist/utils/constants.d.ts +0 -79
- package/dist/utils/url.d.mts +0 -3
- package/dist/utils/url.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @stackframe/stack
|
|
2
2
|
|
|
3
|
+
## 2.7.26
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Various changes
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @stackframe/stack-shared@2.7.26
|
|
10
|
+
- @stackframe/stack-ui@2.7.26
|
|
11
|
+
- @stackframe/stack-sc@2.7.26
|
|
12
|
+
|
|
13
|
+
## 2.7.25
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Various changes
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @stackframe/stack-ui@2.7.25
|
|
20
|
+
- @stackframe/stack-sc@2.7.25
|
|
21
|
+
- @stackframe/stack-shared@2.7.25
|
|
22
|
+
|
|
23
|
+
## 2.7.24
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Various changes
|
|
28
|
+
- @stackframe/stack-sc@2.7.24
|
|
29
|
+
- @stackframe/stack-shared@2.7.24
|
|
30
|
+
- @stackframe/stack-ui@2.7.24
|
|
31
|
+
|
|
3
32
|
## 2.7.23
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/elements/maybe-full-page.tsx"],"sourcesContent":["\"use client\";\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\n\nimport React, { useId } from \"react\";\nimport { SsrScript } from \"./ssr-layout-effect\";\n\nexport function MaybeFullPage({\n children,\n fullPage,\n}: {\n children: React.ReactNode,\n fullPage: boolean,\n size?: number,\n containerClassName?: string,\n}) {\n const uniqueId = useId();\n const id = `stack-full-page-container-${uniqueId}`;\n\n const scriptString = `(([id]) => {\n const el = document.getElementById(id);\n if (!el) {\n // component is not full page\n return;\n }\n const offset = el.getBoundingClientRect().top + document.documentElement.scrollTop;\n el.style.minHeight = \\`calc(100vh - \\${offset}px)\\`;\n })(${JSON.stringify([id])})`;\n\n if (fullPage) {\n return (\n <>\n <div\n suppressHydrationWarning\n id={id}\n style={{\n minHeight: '100vh',\n alignSelf: 'stretch',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n className=\"stack-scope\"\n >\n {children}\n </div>\n <SsrScript script={scriptString} />\n </>\n );\n } else {\n return <>\n {children}\n </>;\n }\n\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,mBAA6B;AAC7B,+BAA0B;AA0BpB;AAxBC,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AACF,GAKG;AACD,QAAM,eAAW,oBAAM;AACvB,QAAM,KAAK,6BAA6B,QAAQ;AAEhD,QAAM,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAQhB,KAAK,UAAU,CAAC,EAAE,CAAC,CAAC;AAEzB,MAAI,UAAU;AACZ,WACE,4EACE;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,0BAAwB;AAAA,UACxB;AAAA,UACA,OAAO;AAAA,YACL,WAAW;AAAA,YACX,WAAW;AAAA,YACX,SAAS;AAAA,YACT,gBAAgB;AAAA,YAChB,YAAY;AAAA,UACd;AAAA,UACA,WAAU;AAAA,UAET;AAAA;AAAA,MACH;AAAA,MACA,4CAAC,sCAAU,QAAQ,cAAc;AAAA,OACnC;AAAA,EAEJ,OAAO;AACL,WAAO,2EACJ,UACH;AAAA,EACF;AAEF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/elements/maybe-full-page.tsx"],"sourcesContent":["\"use client\";\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\n\nimport React, { useId } from \"react\";\nimport { SsrScript } from \"./ssr-layout-effect\";\n\nexport function MaybeFullPage({\n children,\n fullPage,\n}: {\n children: React.ReactNode,\n fullPage: boolean,\n size?: number,\n containerClassName?: string,\n}) {\n const uniqueId = useId();\n const id = `stack-full-page-container-${uniqueId}`;\n\n const scriptString = `(([id]) => {\n const el = document.getElementById(id);\n if (!el) {\n // component is not full page\n return;\n }\n const offset = el.getBoundingClientRect().top + document.documentElement.scrollTop;\n el.style.minHeight = \\`calc(100vh - \\${offset}px)\\`;\n })(${JSON.stringify([id])})`;\n\n if (fullPage) {\n return (\n <>\n <div\n suppressHydrationWarning\n id={id}\n style={{\n minHeight: '100vh',\n alignSelf: 'stretch',\n flexGrow: 1,\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n className=\"stack-scope\"\n >\n {children}\n </div>\n <SsrScript script={scriptString} />\n </>\n );\n } else {\n return <>\n {children}\n </>;\n }\n\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,mBAA6B;AAC7B,+BAA0B;AA0BpB;AAxBC,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AACF,GAKG;AACD,QAAM,eAAW,oBAAM;AACvB,QAAM,KAAK,6BAA6B,QAAQ;AAEhD,QAAM,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAQhB,KAAK,UAAU,CAAC,EAAE,CAAC,CAAC;AAEzB,MAAI,UAAU;AACZ,WACE,4EACE;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,0BAAwB;AAAA,UACxB;AAAA,UACA,OAAO;AAAA,YACL,WAAW;AAAA,YACX,WAAW;AAAA,YACX,UAAU;AAAA,YACV,SAAS;AAAA,YACT,gBAAgB;AAAA,YAChB,YAAY;AAAA,UACd;AAAA,UACA,WAAU;AAAA,UAET;AAAA;AAAA,MACH;AAAA,MACA,4CAAC,sCAAU,QAAQ,cAAc;AAAA,OACnC;AAAA,EAEJ,OAAO;AACL,WAAO,2EACJ,UACH;AAAA,EACF;AAEF;","names":[]}
|
|
@@ -28,19 +28,11 @@ module.exports = __toCommonJS(sidebar_layout_exports);
|
|
|
28
28
|
var import_use_hash = require("@stackframe/stack-shared/dist/hooks/use-hash");
|
|
29
29
|
var import_stack_ui = require("@stackframe/stack-ui");
|
|
30
30
|
var import_lucide_react = require("lucide-react");
|
|
31
|
-
var import_react = require("react");
|
|
32
31
|
var import__ = require("../..");
|
|
33
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
33
|
function SidebarLayout(props) {
|
|
35
|
-
const app = (0, import__.useStackApp)();
|
|
36
|
-
const navigate = app.useNavigate();
|
|
37
34
|
const hash = (0, import_use_hash.useHash)();
|
|
38
35
|
const selectedIndex = props.items.findIndex((item) => item.id && item.id === hash);
|
|
39
|
-
(0, import_react.useEffect)(() => {
|
|
40
|
-
if (selectedIndex === -1) {
|
|
41
|
-
navigate("#" + props.items[0].id);
|
|
42
|
-
}
|
|
43
|
-
}, [hash]);
|
|
44
36
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
45
37
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_stack_ui.cn)("hidden sm:flex stack-scope h-full", props.className), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DesktopLayout, { items: props.items, title: props.title, selectedIndex }) }),
|
|
46
38
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_stack_ui.cn)("sm:hidden stack-scope h-full", props.className), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MobileLayout, { items: props.items, title: props.title, selectedIndex }) })
|
|
@@ -49,13 +41,14 @@ function SidebarLayout(props) {
|
|
|
49
41
|
function Items(props) {
|
|
50
42
|
const app = (0, import__.useStackApp)();
|
|
51
43
|
const navigate = app.useNavigate();
|
|
44
|
+
const activeItemIndex = props.selectedIndex === -1 ? 0 : props.selectedIndex;
|
|
52
45
|
return props.items.map((item, index) => item.type === "item" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
53
46
|
import_stack_ui.Button,
|
|
54
47
|
{
|
|
55
48
|
variant: "ghost",
|
|
56
49
|
size: "sm",
|
|
57
50
|
className: (0, import_stack_ui.cn)(
|
|
58
|
-
|
|
51
|
+
activeItemIndex === index && "sm:bg-muted",
|
|
59
52
|
"justify-start text-md text-zinc-800 dark:text-zinc-300 px-2 text-left"
|
|
60
53
|
),
|
|
61
54
|
onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/elements/sidebar-layout.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\n\nimport { useHash } from '@stackframe/stack-shared/dist/hooks/use-hash';\nimport { Button, Typography, cn } from '@stackframe/stack-ui';\nimport { XIcon } from 'lucide-react';\nimport React, { ReactNode
|
|
1
|
+
{"version":3,"sources":["../../../src/components/elements/sidebar-layout.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\n\nimport { useHash } from '@stackframe/stack-shared/dist/hooks/use-hash';\nimport { Button, Typography, cn } from '@stackframe/stack-ui';\nimport { XIcon } from 'lucide-react';\nimport React, { ReactNode } from 'react';\nimport { useStackApp } from '../..';\n\nexport type SidebarItem = {\n title: React.ReactNode,\n type: 'item' | 'divider',\n description?: React.ReactNode,\n id?: string,\n icon?: React.ReactNode,\n content?: React.ReactNode,\n contentTitle?: React.ReactNode,\n}\n\nexport function SidebarLayout(props: { items: SidebarItem[], title?: ReactNode, className?: string }) {\n const hash = useHash();\n const selectedIndex = props.items.findIndex(item => item.id && (item.id === hash));\n return (\n <>\n <div className={cn(\"hidden sm:flex stack-scope h-full\", props.className)}>\n <DesktopLayout items={props.items} title={props.title} selectedIndex={selectedIndex} />\n </div>\n <div className={cn(\"sm:hidden stack-scope h-full\", props.className)}>\n <MobileLayout items={props.items} title={props.title} selectedIndex={selectedIndex} />\n </div>\n </>\n );\n}\n\nfunction Items(props: { items: SidebarItem[], selectedIndex: number }) {\n const app = useStackApp();\n const navigate = app.useNavigate();\n\n\n const activeItemIndex = props.selectedIndex === -1 ? 0 : props.selectedIndex;\n\n return props.items.map((item, index) => (\n item.type === 'item' ?\n <Button\n key={index}\n variant='ghost'\n size='sm'\n className={cn(\n activeItemIndex === index && \"sm:bg-muted\",\n \"justify-start text-md text-zinc-800 dark:text-zinc-300 px-2 text-left\",\n )}\n onClick={() => {\n if (item.id) {\n navigate('#' + item.id);\n }\n }}\n >\n {item.icon}\n {item.title}\n </Button> :\n <Typography key={index}>\n {item.title}\n </Typography>\n ));\n\n}\n\nfunction DesktopLayout(props: { items: SidebarItem[], title?: ReactNode, selectedIndex: number }) {\n const selectedItem = props.items[props.selectedIndex === -1 ? 0 : props.selectedIndex];\n\n return (\n <div className=\"stack-scope flex w-full h-full max-w-full relative\">\n <div className=\"flex max-w-[200px] min-w-[200px] border-r flex-col items-stretch gap-2 p-2 overflow-y-auto\">\n {props.title && <div className='mb-2 ml-2'>\n <Typography type='h2' className=\"text-lg font-semibold text-zinc-800 dark:text-zinc-300\">{props.title}</Typography>\n </div>}\n\n <Items items={props.items} selectedIndex={props.selectedIndex} />\n </div>\n <div className=\"flex-1 w-0 flex justify-center gap-4 py-2 px-4\">\n <div className='flex flex-col max-w-[800px] w-[800px]'>\n <div className='mt-4 mb-6'>\n <Typography type='h4' className='font-semibold'>{selectedItem.title}</Typography>\n {selectedItem.description && <Typography variant='secondary' type='label'>{selectedItem.description}</Typography>}\n </div>\n <div className='flex-1'>\n {selectedItem.content}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction MobileLayout(props: { items: SidebarItem[], title?: ReactNode, selectedIndex: number }) {\n const selectedItem = props.items[props.selectedIndex];\n const app = useStackApp();\n const navigate = app.useNavigate();\n\n if (props.selectedIndex === -1) {\n return (\n <div className=\"flex flex-col gap-2 p-2\">\n {props.title && <div className='mb-2 ml-2'>\n <Typography type='h2' className=\"text-lg font-semibold text-zinc-800 dark:text-zinc-300\">{props.title}</Typography>\n </div>}\n\n <Items items={props.items} selectedIndex={props.selectedIndex} />\n </div>\n );\n } else {\n return (\n <div className=\"flex-1 flex flex-col gap-4 py-2 px-4\">\n <div className='flex flex-col'>\n <div className='flex justify-between'>\n <Typography type='h4' className='font-semibold'>{selectedItem.title}</Typography>\n <Button\n variant='ghost'\n size='icon'\n onClick={() => { navigate('#'); }}\n >\n <XIcon className='h-5 w-5' />\n </Button>\n </div>\n {selectedItem.description && <Typography variant='secondary' type='label'>{selectedItem.description}</Typography>}\n </div>\n <div className='flex-1'>\n {selectedItem.content}\n </div>\n </div>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,sBAAwB;AACxB,sBAAuC;AACvC,0BAAsB;AAEtB,eAA4B;AAgBxB;AAJG,SAAS,cAAc,OAAwE;AACpG,QAAM,WAAO,yBAAQ;AACrB,QAAM,gBAAgB,MAAM,MAAM,UAAU,UAAQ,KAAK,MAAO,KAAK,OAAO,IAAK;AACjF,SACE,4EACE;AAAA,gDAAC,SAAI,eAAW,oBAAG,qCAAqC,MAAM,SAAS,GACrE,sDAAC,iBAAc,OAAO,MAAM,OAAO,OAAO,MAAM,OAAO,eAA8B,GACvF;AAAA,IACA,4CAAC,SAAI,eAAW,oBAAG,gCAAgC,MAAM,SAAS,GAChE,sDAAC,gBAAa,OAAO,MAAM,OAAO,OAAO,MAAM,OAAO,eAA8B,GACtF;AAAA,KACF;AAEJ;AAEA,SAAS,MAAM,OAAwD;AACrE,QAAM,UAAM,sBAAY;AACxB,QAAM,WAAW,IAAI,YAAY;AAGjC,QAAM,kBAAkB,MAAM,kBAAkB,KAAK,IAAI,MAAM;AAE/D,SAAO,MAAM,MAAM,IAAI,CAAC,MAAM,UAC5B,KAAK,SAAS,SACZ;AAAA,IAAC;AAAA;AAAA,MAEC,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,eAAW;AAAA,QACT,oBAAoB,SAAS;AAAA,QAC7B;AAAA,MACF;AAAA,MACA,SAAS,MAAM;AACb,YAAI,KAAK,IAAI;AACX,mBAAS,MAAM,KAAK,EAAE;AAAA,QACxB;AAAA,MACF;AAAA,MAEC;AAAA,aAAK;AAAA,QACL,KAAK;AAAA;AAAA;AAAA,IAdD;AAAA,EAeP,IACA,4CAAC,8BACE,eAAK,SADS,KAEjB,CACH;AAEH;AAEA,SAAS,cAAc,OAA2E;AAChG,QAAM,eAAe,MAAM,MAAM,MAAM,kBAAkB,KAAK,IAAI,MAAM,aAAa;AAErF,SACE,6CAAC,SAAI,WAAU,sDACb;AAAA,iDAAC,SAAI,WAAU,8FACZ;AAAA,YAAM,SAAS,4CAAC,SAAI,WAAU,aAC7B,sDAAC,8BAAW,MAAK,MAAK,WAAU,0DAA0D,gBAAM,OAAM,GACxG;AAAA,MAEA,4CAAC,SAAM,OAAO,MAAM,OAAO,eAAe,MAAM,eAAe;AAAA,OACjE;AAAA,IACA,4CAAC,SAAI,WAAU,kDACb,uDAAC,SAAI,WAAU,yCACb;AAAA,mDAAC,SAAI,WAAU,aACb;AAAA,oDAAC,8BAAW,MAAK,MAAK,WAAU,iBAAiB,uBAAa,OAAM;AAAA,QACnE,aAAa,eAAe,4CAAC,8BAAW,SAAQ,aAAY,MAAK,SAAS,uBAAa,aAAY;AAAA,SACtG;AAAA,MACA,4CAAC,SAAI,WAAU,UACZ,uBAAa,SAChB;AAAA,OACF,GACF;AAAA,KACF;AAEJ;AAEA,SAAS,aAAa,OAA2E;AAC/F,QAAM,eAAe,MAAM,MAAM,MAAM,aAAa;AACpD,QAAM,UAAM,sBAAY;AACxB,QAAM,WAAW,IAAI,YAAY;AAEjC,MAAI,MAAM,kBAAkB,IAAI;AAC9B,WACE,6CAAC,SAAI,WAAU,2BACZ;AAAA,YAAM,SAAS,4CAAC,SAAI,WAAU,aAC7B,sDAAC,8BAAW,MAAK,MAAK,WAAU,0DAA0D,gBAAM,OAAM,GACxG;AAAA,MAEA,4CAAC,SAAM,OAAO,MAAM,OAAO,eAAe,MAAM,eAAe;AAAA,OACjE;AAAA,EAEJ,OAAO;AACL,WACE,6CAAC,SAAI,WAAU,wCACb;AAAA,mDAAC,SAAI,WAAU,iBACb;AAAA,qDAAC,SAAI,WAAU,wBACb;AAAA,sDAAC,8BAAW,MAAK,MAAK,WAAU,iBAAiB,uBAAa,OAAM;AAAA,UACpE;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,SAAS,MAAM;AAAE,yBAAS,GAAG;AAAA,cAAG;AAAA,cAEhC,sDAAC,6BAAM,WAAU,WAAU;AAAA;AAAA,UAC7B;AAAA,WACF;AAAA,QACC,aAAa,eAAe,4CAAC,8BAAW,SAAQ,aAAY,MAAK,SAAS,uBAAa,aAAY;AAAA,SACtG;AAAA,MACA,4CAAC,SAAI,WAAU,UACZ,uBAAa,SAChB;AAAA,OACF;AAAA,EAEJ;AACF;","names":[]}
|
|
@@ -33,9 +33,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
33
33
|
var account_settings_exports = {};
|
|
34
34
|
__export(account_settings_exports, {
|
|
35
35
|
AccountSettings: () => AccountSettings,
|
|
36
|
-
EditableText: () => EditableText
|
|
37
|
-
TeamCreation: () => TeamCreation,
|
|
38
|
-
useDeleteAccountSection: () => useDeleteAccountSection
|
|
36
|
+
EditableText: () => EditableText
|
|
39
37
|
});
|
|
40
38
|
module.exports = __toCommonJS(account_settings_exports);
|
|
41
39
|
var import_yup = require("@hookform/resolvers/yup");
|
|
@@ -50,7 +48,7 @@ var import_stack_ui = require("@stackframe/stack-ui");
|
|
|
50
48
|
var import_lucide_react = require("lucide-react");
|
|
51
49
|
var import_otp = require("oslo/otp");
|
|
52
50
|
var QRCode = __toESM(require("qrcode"));
|
|
53
|
-
var import_react =
|
|
51
|
+
var import_react = require("react");
|
|
54
52
|
var import_react_hook_form = require("react-hook-form");
|
|
55
53
|
var yup = __toESM(require("yup"));
|
|
56
54
|
var import__ = require("..");
|
|
@@ -138,22 +136,19 @@ function AccountSettings(props) {
|
|
|
138
136
|
) }) });
|
|
139
137
|
}
|
|
140
138
|
function Section(props) {
|
|
141
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
142
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Separator, {}),
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col sm:flex-row gap-2", children: [
|
|
142
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sm:flex-1 flex flex-col justify-center", children: [
|
|
143
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Typography, { className: "font-medium", children: props.title }),
|
|
144
|
+
props.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Typography, { variant: "secondary", type: "footnote", children: props.description })
|
|
145
|
+
] }),
|
|
146
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sm:flex-1 sm:items-end flex flex-col gap-2 ", children: props.children })
|
|
147
|
+
] })
|
|
147
148
|
] });
|
|
148
149
|
}
|
|
149
150
|
function PageLayout(props) {
|
|
150
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
151
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Separator, {}),
|
|
152
|
-
import_react.default.Children.map(props.children, (child) => child && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
153
|
-
child,
|
|
154
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Separator, {})
|
|
155
|
-
] }))
|
|
156
|
-
] });
|
|
151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-col gap-6", children: props.children });
|
|
157
152
|
}
|
|
158
153
|
function ProfilePage() {
|
|
159
154
|
const { t } = (0, import_translations.useTranslation)();
|
|
@@ -341,16 +336,12 @@ function EmailsSection() {
|
|
|
341
336
|
] });
|
|
342
337
|
}
|
|
343
338
|
function EmailsAndAuthPage() {
|
|
344
|
-
const passwordSection = usePasswordSection();
|
|
345
|
-
const mfaSection = useMfaSection();
|
|
346
|
-
const otpSection = useOtpSection();
|
|
347
|
-
const passkeySection = usePasskeySection();
|
|
348
339
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(PageLayout, { children: [
|
|
349
340
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmailsSection, {}),
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
341
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PasswordSection, {}),
|
|
342
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PasskeySection, {}),
|
|
343
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(OtpSection, {}),
|
|
344
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MfaSection, {})
|
|
354
345
|
] });
|
|
355
346
|
}
|
|
356
347
|
function EmailsAndAuthPageSkeleton() {
|
|
@@ -361,7 +352,7 @@ function EmailsAndAuthPageSkeleton() {
|
|
|
361
352
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Skeleton, { className: "h-9 w-full mt-1" })
|
|
362
353
|
] });
|
|
363
354
|
}
|
|
364
|
-
function
|
|
355
|
+
function PasskeySection() {
|
|
365
356
|
const { t } = (0, import_translations.useTranslation)();
|
|
366
357
|
const user = (0, import__.useUser)({ or: "throw" });
|
|
367
358
|
const stackApp = (0, import__.useStackApp)();
|
|
@@ -416,7 +407,7 @@ function usePasskeySection() {
|
|
|
416
407
|
] })
|
|
417
408
|
] }) }) });
|
|
418
409
|
}
|
|
419
|
-
function
|
|
410
|
+
function OtpSection() {
|
|
420
411
|
const { t } = (0, import_translations.useTranslation)();
|
|
421
412
|
const user = (0, import__.useUser)({ or: "throw" });
|
|
422
413
|
const project = (0, import__.useStackApp)().useProject();
|
|
@@ -470,14 +461,12 @@ function useOtpSection() {
|
|
|
470
461
|
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Typography, { variant: "secondary", type: "label", children: t("To enable OTP sign-in, please add a verified sign-in email.") }) }) });
|
|
471
462
|
}
|
|
472
463
|
function SettingsPage() {
|
|
473
|
-
const deleteAccountSection = useDeleteAccountSection();
|
|
474
|
-
const signOutSection = useSignOutSection();
|
|
475
464
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(PageLayout, { children: [
|
|
476
|
-
|
|
477
|
-
|
|
465
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DeleteAccountSection, {}),
|
|
466
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignOutSection, {})
|
|
478
467
|
] });
|
|
479
468
|
}
|
|
480
|
-
function
|
|
469
|
+
function PasswordSection() {
|
|
481
470
|
const { t } = (0, import_translations.useTranslation)();
|
|
482
471
|
const user = (0, import__.useUser)({ or: "throw" });
|
|
483
472
|
const contactChannels = user.useContactChannels();
|
|
@@ -600,7 +589,7 @@ function usePasswordSection() {
|
|
|
600
589
|
}
|
|
601
590
|
);
|
|
602
591
|
}
|
|
603
|
-
function
|
|
592
|
+
function MfaSection() {
|
|
604
593
|
const { t } = (0, import_translations.useTranslation)();
|
|
605
594
|
const project = (0, import__.useStackApp)().useProject();
|
|
606
595
|
const user = (0, import__.useUser)({ or: "throw" });
|
|
@@ -694,7 +683,7 @@ async function generateTotpQrCode(project, user, secret) {
|
|
|
694
683
|
const uri = (0, import_otp.createTOTPKeyURI)(project.displayName, user.primaryEmail ?? user.id, secret);
|
|
695
684
|
return await QRCode.toDataURL(uri);
|
|
696
685
|
}
|
|
697
|
-
function
|
|
686
|
+
function SignOutSection() {
|
|
698
687
|
const { t } = (0, import_translations.useTranslation)();
|
|
699
688
|
const user = (0, import__.useUser)({ or: "throw" });
|
|
700
689
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -714,22 +703,16 @@ function useSignOutSection() {
|
|
|
714
703
|
);
|
|
715
704
|
}
|
|
716
705
|
function TeamPage(props) {
|
|
717
|
-
const teamUserProfileSection = useTeamUserProfileSection(props);
|
|
718
|
-
const teamProfileImageSection = useTeamProfileImageSection(props);
|
|
719
|
-
const teamDisplayNameSection = useTeamDisplayNameSection(props);
|
|
720
|
-
const leaveTeamSection = useLeaveTeamSection(props);
|
|
721
|
-
const memberInvitationSection = useMemberInvitationSection(props);
|
|
722
|
-
const memberListSection = useMemberListSection(props);
|
|
723
706
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(PageLayout, { children: [
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
707
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TeamUserProfileSection, { team: props.team }),
|
|
708
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemberListSection, { team: props.team }),
|
|
709
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemberInvitationSection, { team: props.team }),
|
|
710
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TeamProfileImageSection, { team: props.team }),
|
|
711
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TeamDisplayNameSection, { team: props.team }),
|
|
712
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LeaveTeamSection, { team: props.team })
|
|
730
713
|
] });
|
|
731
714
|
}
|
|
732
|
-
function
|
|
715
|
+
function LeaveTeamSection(props) {
|
|
733
716
|
const { t } = (0, import_translations.useTranslation)();
|
|
734
717
|
const user = (0, import__.useUser)({ or: "redirect" });
|
|
735
718
|
const [leaving, setLeaving] = (0, import_react.useState)(false);
|
|
@@ -772,7 +755,7 @@ function useLeaveTeamSection(props) {
|
|
|
772
755
|
}
|
|
773
756
|
);
|
|
774
757
|
}
|
|
775
|
-
function
|
|
758
|
+
function TeamProfileImageSection(props) {
|
|
776
759
|
const { t } = (0, import_translations.useTranslation)();
|
|
777
760
|
const user = (0, import__.useUser)({ or: "redirect" });
|
|
778
761
|
const updateTeamPermission = user.usePermission(props.team, "$update_team");
|
|
@@ -796,7 +779,7 @@ function useTeamProfileImageSection(props) {
|
|
|
796
779
|
}
|
|
797
780
|
);
|
|
798
781
|
}
|
|
799
|
-
function
|
|
782
|
+
function TeamDisplayNameSection(props) {
|
|
800
783
|
const { t } = (0, import_translations.useTranslation)();
|
|
801
784
|
const user = (0, import__.useUser)({ or: "redirect" });
|
|
802
785
|
const updateTeamPermission = user.usePermission(props.team, "$update_team");
|
|
@@ -818,7 +801,7 @@ function useTeamDisplayNameSection(props) {
|
|
|
818
801
|
}
|
|
819
802
|
);
|
|
820
803
|
}
|
|
821
|
-
function
|
|
804
|
+
function TeamUserProfileSection(props) {
|
|
822
805
|
const { t } = (0, import_translations.useTranslation)();
|
|
823
806
|
const user = (0, import__.useUser)({ or: "redirect" });
|
|
824
807
|
const profile = user.useTeamProfile(props.team);
|
|
@@ -839,22 +822,39 @@ function useTeamUserProfileSection(props) {
|
|
|
839
822
|
}
|
|
840
823
|
);
|
|
841
824
|
}
|
|
842
|
-
function
|
|
843
|
-
const { t } = (0, import_translations.useTranslation)();
|
|
844
|
-
const invitationSchema = (0, import_schema_fields.yupObject)({
|
|
845
|
-
email: (0, import_schema_fields.strictEmailSchema)(t("Please enter a valid email address")).defined().nonEmpty(t("Please enter an email address"))
|
|
846
|
-
});
|
|
825
|
+
function MemberInvitationSection(props) {
|
|
847
826
|
const user = (0, import__.useUser)({ or: "redirect" });
|
|
848
827
|
const inviteMemberPermission = user.usePermission(props.team, "$invite_members");
|
|
849
|
-
const readMemberPermission = user.usePermission(props.team, "$read_members");
|
|
850
|
-
const removeMemberPermission = user.usePermission(props.team, "$remove_members");
|
|
851
828
|
if (!inviteMemberPermission) {
|
|
852
829
|
return null;
|
|
853
830
|
}
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
}
|
|
831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemberInvitationSectionInner, { team: props.team });
|
|
832
|
+
}
|
|
833
|
+
function MemberInvitationsSectionInvitationsList(props) {
|
|
834
|
+
const user = (0, import__.useUser)({ or: "redirect" });
|
|
835
|
+
const { t } = (0, import_translations.useTranslation)();
|
|
836
|
+
const invitationsToShow = props.team.useInvitations();
|
|
837
|
+
const removeMemberPermission = user.usePermission(props.team, "$remove_members");
|
|
838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stack_ui.Table, { className: "mt-6", children: [
|
|
839
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stack_ui.TableRow, { children: [
|
|
840
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableHead, { className: "w-[200px]", children: t("Outstanding invitations") }),
|
|
841
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableHead, { className: "w-[60px]", children: t("Expires") }),
|
|
842
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableHead, { className: "w-[36px] max-w-[36px]" })
|
|
843
|
+
] }) }),
|
|
844
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableBody, { children: invitationsToShow.map((invitation, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stack_ui.TableRow, { children: [
|
|
845
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Typography, { children: invitation.recipientEmail }) }),
|
|
846
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Typography, { variant: "secondary", children: invitation.expiresAt.toLocaleString() }) }),
|
|
847
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableCell, { align: "right", className: "max-w-[36px]", children: removeMemberPermission && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Button, { onClick: async () => await invitation.revoke(), size: "icon", variant: "ghost", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Trash, { className: "w-4 h-4" }) }) })
|
|
848
|
+
] }, invitation.id)) })
|
|
849
|
+
] }) });
|
|
850
|
+
}
|
|
851
|
+
function MemberInvitationSectionInner(props) {
|
|
852
|
+
const user = (0, import__.useUser)({ or: "redirect" });
|
|
853
|
+
const { t } = (0, import_translations.useTranslation)();
|
|
854
|
+
const readMemberPermission = user.usePermission(props.team, "$read_members");
|
|
855
|
+
const invitationSchema = (0, import_schema_fields.yupObject)({
|
|
856
|
+
email: (0, import_schema_fields.strictEmailSchema)(t("Please enter a valid email address")).defined().nonEmpty(t("Please enter an email address"))
|
|
857
|
+
});
|
|
858
858
|
const { register, handleSubmit, formState: { errors }, watch } = (0, import_react_hook_form.useForm)({
|
|
859
859
|
resolver: (0, import_yup.yupResolver)(invitationSchema)
|
|
860
860
|
});
|
|
@@ -872,7 +872,7 @@ function useMemberInvitationSection(props) {
|
|
|
872
872
|
(0, import_react.useEffect)(() => {
|
|
873
873
|
setInvitedEmail(null);
|
|
874
874
|
}, [watch("email")]);
|
|
875
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
876
876
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
877
877
|
Section,
|
|
878
878
|
{
|
|
@@ -905,32 +905,21 @@ function useMemberInvitationSection(props) {
|
|
|
905
905
|
)
|
|
906
906
|
}
|
|
907
907
|
),
|
|
908
|
-
|
|
909
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stack_ui.TableRow, { children: [
|
|
910
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableHead, { className: "w-[200px]", children: t("Outstanding invitations") }),
|
|
911
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableHead, { className: "w-[60px]", children: t("Expires") }),
|
|
912
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableHead, { className: "w-[36px] max-w-[36px]" })
|
|
913
|
-
] }) }),
|
|
914
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableBody, { children: invitationsToShow.map((invitation, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stack_ui.TableRow, { children: [
|
|
915
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Typography, { children: invitation.recipientEmail }) }),
|
|
916
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Typography, { variant: "secondary", children: invitation.expiresAt.toLocaleString() }) }),
|
|
917
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.TableCell, { align: "right", className: "max-w-[36px]", children: removeMemberPermission && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Button, { onClick: async () => await invitation.revoke(), size: "icon", variant: "ghost", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Trash, { className: "w-4 h-4" }) }) })
|
|
918
|
-
] }, invitation.id)) })
|
|
919
|
-
] }) })
|
|
908
|
+
readMemberPermission && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemberInvitationsSectionInvitationsList, { team: props.team })
|
|
920
909
|
] });
|
|
921
910
|
}
|
|
922
|
-
function
|
|
923
|
-
const { t } = (0, import_translations.useTranslation)();
|
|
911
|
+
function MemberListSection(props) {
|
|
924
912
|
const user = (0, import__.useUser)({ or: "redirect" });
|
|
925
913
|
const readMemberPermission = user.usePermission(props.team, "$read_members");
|
|
926
914
|
const inviteMemberPermission = user.usePermission(props.team, "$invite_members");
|
|
927
915
|
if (!readMemberPermission && !inviteMemberPermission) {
|
|
928
916
|
return null;
|
|
929
917
|
}
|
|
918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemberListSectionInner, { team: props.team });
|
|
919
|
+
}
|
|
920
|
+
function MemberListSectionInner(props) {
|
|
921
|
+
const { t } = (0, import_translations.useTranslation)();
|
|
930
922
|
const users = props.team.useUsers();
|
|
931
|
-
if (!readMemberPermission) {
|
|
932
|
-
return null;
|
|
933
|
-
}
|
|
934
923
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
935
924
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_stack_ui.Typography, { className: "font-medium mb-2", children: t("Members") }),
|
|
936
925
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "border rounded-md", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_stack_ui.Table, { children: [
|
|
@@ -994,7 +983,7 @@ function TeamCreation() {
|
|
|
994
983
|
}
|
|
995
984
|
) }) });
|
|
996
985
|
}
|
|
997
|
-
function
|
|
986
|
+
function DeleteAccountSection() {
|
|
998
987
|
const { t } = (0, import_translations.useTranslation)();
|
|
999
988
|
const user = (0, import__.useUser)({ or: "redirect" });
|
|
1000
989
|
const app = (0, import__.useStackApp)();
|
|
@@ -1088,8 +1077,6 @@ function EditableText(props) {
|
|
|
1088
1077
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1089
1078
|
0 && (module.exports = {
|
|
1090
1079
|
AccountSettings,
|
|
1091
|
-
EditableText
|
|
1092
|
-
TeamCreation,
|
|
1093
|
-
useDeleteAccountSection
|
|
1080
|
+
EditableText
|
|
1094
1081
|
});
|
|
1095
1082
|
//# sourceMappingURL=account-settings.js.map
|