@hexclave/next 1.0.56 → 1.0.57
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/{admin-app-impl-0kL2lNog.d.ts → admin-app-impl-zKsW1R4h.d.ts} +8 -8
- package/dist/{admin-app-impl-0kL2lNog.d.ts.map → admin-app-impl-zKsW1R4h.d.ts.map} +1 -1
- package/dist/clickmap/clickmap-core.d.ts +1 -1
- package/dist/clickmap/index.d.ts +1 -1
- package/dist/{client-app-B0kBC67Z.d.ts → client-app-oSumAWx3.d.ts} +2 -1
- package/dist/{client-app-B0kBC67Z.d.ts.map → client-app-oSumAWx3.d.ts.map} +1 -1
- package/dist/components/api-key-dialogs.d.ts +1 -1
- package/dist/components/api-key-dialogs.js +4 -4
- package/dist/components/credential-sign-in.js +3 -3
- package/dist/components/credential-sign-up.js +5 -5
- package/dist/components/elements/sidebar-layout.js +2 -2
- package/dist/components/elements/user-avatar.js +1 -1
- package/dist/components/magic-link-sign-in.js +5 -5
- package/dist/components/message-cards/predefined-message-card.js +1 -1
- package/dist/components/passkey-button.js +1 -1
- package/dist/components/profile-image-editor.js +1 -1
- package/dist/components/selected-team-switcher.d.ts +1 -1
- package/dist/components/team-icon.d.ts +1 -1
- package/dist/components/team-icon.js +1 -1
- package/dist/components/team-switcher.d.ts +1 -1
- package/dist/components/team-switcher.js +1 -1
- package/dist/components/user-button.js +1 -1
- package/dist/components-page/account-settings/editable-text.js +1 -1
- package/dist/components-page/account-settings/email-and-auth/emails-section.js +3 -3
- package/dist/components-page/account-settings/email-and-auth/password-section.js +3 -3
- package/dist/components-page/account-settings/payments/payments-page.d.ts +1 -1
- package/dist/components-page/account-settings/teams/leave-team-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-api-keys-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-creation-page.js +3 -3
- package/dist/components-page/account-settings/teams/team-display-name-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-member-invitation-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-member-invitation-section.js +4 -4
- package/dist/components-page/account-settings/teams/team-member-list-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-page.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-profile-image-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-profile-user-section.d.ts +1 -1
- package/dist/components-page/account-settings.js +3 -3
- package/dist/components-page/auth-page.js +1 -1
- package/dist/components-page/cli-auth-confirm.js +1 -1
- package/dist/components-page/forgot-password.js +5 -5
- package/dist/components-page/hexclave-handler-client.d.ts +1 -1
- package/dist/components-page/hexclave-handler-client.js +1 -1
- package/dist/components-page/hexclave-handler.d.ts +1 -1
- package/dist/components-page/mfa.js +3 -3
- package/dist/components-page/oauth-callback.js +1 -1
- package/dist/components-page/onboarding.js +4 -4
- package/dist/components-page/password-reset.js +8 -8
- package/dist/components-page/team-creation.js +5 -5
- package/dist/dev-tool/dev-tool-core.d.ts +1 -1
- package/dist/dev-tool/index.d.ts +1 -1
- package/dist/dev-tool/index.d.ts.map +1 -1
- package/dist/dev-tool/index.js +18 -1
- package/dist/dev-tool/index.js.map +1 -1
- package/dist/dev-tool/index.test.d.ts +1 -0
- package/dist/dev-tool/index.test.js +40 -0
- package/dist/dev-tool/index.test.js.map +1 -0
- package/dist/esm/components/api-key-dialogs.d.ts +1 -1
- package/dist/esm/components/api-key-dialogs.js +4 -4
- package/dist/esm/components/credential-sign-in.js +3 -3
- package/dist/esm/components/credential-sign-up.js +5 -5
- package/dist/esm/components/elements/sidebar-layout.js +2 -2
- package/dist/esm/components/elements/user-avatar.js +1 -1
- package/dist/esm/components/magic-link-sign-in.js +5 -5
- package/dist/esm/components/message-cards/predefined-message-card.js +1 -1
- package/dist/esm/components/passkey-button.js +1 -1
- package/dist/esm/components/profile-image-editor.js +1 -1
- package/dist/esm/components/team-icon.js +1 -1
- package/dist/esm/components/team-switcher.js +1 -1
- package/dist/esm/components/user-button.js +1 -1
- package/dist/esm/components-page/account-settings/editable-text.js +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/emails-section.js +3 -3
- package/dist/esm/components-page/account-settings/email-and-auth/password-section.js +3 -3
- package/dist/esm/components-page/account-settings/teams/team-creation-page.js +3 -3
- package/dist/esm/components-page/account-settings/teams/team-member-invitation-section.js +4 -4
- package/dist/esm/components-page/account-settings.js +3 -3
- package/dist/esm/components-page/auth-page.js +1 -1
- package/dist/esm/components-page/cli-auth-confirm.js +1 -1
- package/dist/esm/components-page/forgot-password.js +5 -5
- package/dist/esm/components-page/hexclave-handler-client.js +1 -1
- package/dist/esm/components-page/mfa.js +3 -3
- package/dist/esm/components-page/oauth-callback.js +1 -1
- package/dist/esm/components-page/onboarding.js +4 -4
- package/dist/esm/components-page/password-reset.js +7 -7
- package/dist/esm/components-page/team-creation.js +5 -5
- package/dist/esm/dev-tool/index.d.ts.map +1 -1
- package/dist/esm/dev-tool/index.js +18 -1
- package/dist/esm/dev-tool/index.js.map +1 -1
- package/dist/esm/dev-tool/index.test.d.ts +1 -0
- package/dist/esm/dev-tool/index.test.js +41 -0
- package/dist/esm/dev-tool/index.test.js.map +1 -0
- package/dist/esm/generated/quetzal-translations.d.ts +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +5 -5
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +3 -3
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/common.js +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/projects/index.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/projects/index.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/projects/index.js.map +1 -1
- package/dist/esm/lib/hexclave-app/users/index.d.ts +1 -1
- package/dist/esm/pushed-config-error-overlay/index.test.js +1 -1
- package/dist/generated/quetzal-translations.d.ts +1 -1
- package/dist/{hexclave-provider-SQbs9rmZ.d.ts → hexclave-provider-DnIE6JQ7.d.ts} +3 -3
- package/dist/{hexclave-provider-SQbs9rmZ.d.ts.map → hexclave-provider-DnIE6JQ7.d.ts.map} +1 -1
- package/dist/{hooks-ykQ7Wsco.d.ts → hooks-Ds3yoNo-.d.ts} +2 -2
- package/dist/{hooks-ykQ7Wsco.d.ts.map → hooks-Ds3yoNo-.d.ts.map} +1 -1
- package/dist/{index-DwE1cNLH.d.ts → index-DE-_vkL4.d.ts} +2 -2
- package/dist/{index-DwE1cNLH.d.ts.map → index-DE-_vkL4.d.ts.map} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/common.js +2 -2
- package/dist/lib/hexclave-app/apps/implementations/index.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/index.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/admin-app.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/client-app.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/server-app.d.ts +1 -1
- package/dist/lib/hexclave-app/index.d.ts +1 -1
- package/dist/lib/hexclave-app/projects/index.d.ts +1 -1
- package/dist/lib/hexclave-app/projects/index.js.map +1 -1
- package/dist/lib/hexclave-app/teams/index.d.ts +1 -1
- package/dist/lib/hexclave-app/users/index.d.ts +1 -1
- package/dist/lib/hooks.d.ts +1 -1
- package/dist/providers/hexclave-context.d.ts +1 -1
- package/dist/providers/hexclave-provider-client.d.ts +1 -1
- package/dist/providers/hexclave-provider.d.ts +1 -1
- package/dist/providers/translation-provider.d.ts +1 -1
- package/dist/pushed-config-error-overlay/index.d.ts +1 -1
- package/dist/pushed-config-error-overlay/index.test.js +1 -1
- package/dist/{quetzal-translations-CK45_4Dm.d.ts → quetzal-translations-XeH3zQ9l.d.ts} +3 -3
- package/dist/{quetzal-translations-CK45_4Dm.d.ts.map → quetzal-translations-XeH3zQ9l.d.ts.map} +1 -1
- package/dist/{translation-provider-DQ3BJepJ.d.ts → translation-provider-WOaZXqAz.d.ts} +2 -2
- package/dist/{translation-provider-DQ3BJepJ.d.ts.map → translation-provider-WOaZXqAz.d.ts.map} +1 -1
- package/package.json +4 -4
- package/src/dev-tool/index.test.ts +58 -0
- package/src/dev-tool/index.ts +27 -1
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +1 -0
- package/src/lib/hexclave-app/projects/index.ts +1 -0
package/dist/{quetzal-translations-CK45_4Dm.d.ts.map → quetzal-translations-XeH3zQ9l.d.ts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quetzal-translations-
|
|
1
|
+
{"version":3,"file":"quetzal-translations-XeH3zQ9l.d.ts","names":[],"sources":["../src/generated/quetzal-translations.ts"],"mappings":";cAUa,WAAA,EAAW,GAAA;AAAA,cAqTX,cAAA,EAAc,GAAA,mIAAA,GAAA,66qBAAA,GAAA,usnBAAA,GAAA,iyrBAAA,GAAA,g+qBAAA,GAAA,8srBAAA,GAAA,2trBAAA,GAAA,41pBAAA,GAAA,m3eAAA,GAAA,oreAAA,GAAA,swpBAAA,GAAA,+0qBAAA,GAAA,8wbAAA,GAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as quetzalLocales } from "./quetzal-translations-
|
|
1
|
+
import { n as quetzalLocales } from "./quetzal-translations-XeH3zQ9l.js";
|
|
2
2
|
|
|
3
3
|
//#region src/providers/translation-provider.d.ts
|
|
4
4
|
declare function TranslationProvider({
|
|
@@ -12,4 +12,4 @@ declare function TranslationProvider({
|
|
|
12
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { TranslationProvider as t };
|
|
15
|
-
//# sourceMappingURL=translation-provider-
|
|
15
|
+
//# sourceMappingURL=translation-provider-WOaZXqAz.d.ts.map
|
package/dist/{translation-provider-DQ3BJepJ.d.ts.map → translation-provider-WOaZXqAz.d.ts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation-provider-
|
|
1
|
+
{"version":3,"file":"translation-provider-WOaZXqAz.d.ts","names":[],"sources":["../src/providers/translation-provider.tsx"],"mappings":";;;iBAQgB,mBAAA;EAAsB,IAAA;EAAM,oBAAA;EAAsB;AAAA;EAChE,IAAA,EAAM,UAAA,QAAkB,cAAA,CAAe,GAAA;EACvC,oBAAA,GAAuB,MAAA;EACvB,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA,gCACjB,GAAA,CAAA,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"//": "THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template (FOR package.json FILES, PLEASE EDIT package-template.json)",
|
|
3
3
|
"name": "@hexclave/next",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.57",
|
|
5
5
|
"repository": "https://github.com/hexclave/hexclave",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"tailwindcss-animate": "^1.0.7",
|
|
75
75
|
"rrweb": "^1.1.3",
|
|
76
76
|
"yup": "^1.7.1",
|
|
77
|
-
"@hexclave/sc": "1.0.
|
|
78
|
-
"@hexclave/
|
|
79
|
-
"@hexclave/
|
|
77
|
+
"@hexclave/sc": "1.0.57",
|
|
78
|
+
"@hexclave/ui": "1.0.57",
|
|
79
|
+
"@hexclave/shared": "1.0.57"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
82
|
"@types/react": ">=18.0.0",
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
|
|
2
|
+
//===========================================
|
|
3
|
+
// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template
|
|
4
|
+
//===========================================
|
|
5
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
6
|
+
import { StackClientApp } from "../lib/hexclave-app";
|
|
7
|
+
import { createDevTool } from "./dev-tool-core";
|
|
8
|
+
import { mountDevTool } from ".";
|
|
9
|
+
|
|
10
|
+
vi.mock("./dev-tool-core", () => ({
|
|
11
|
+
createDevTool: vi.fn(() => () => {}),
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
describe("dev tool visibility", () => {
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
vi.unstubAllEnvs();
|
|
17
|
+
vi.unstubAllGlobals();
|
|
18
|
+
vi.clearAllMocks();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("shows for a development environment project in a production-hosted app", async () => {
|
|
22
|
+
const app = new StackClientApp({
|
|
23
|
+
baseUrl: "https://api.example.com",
|
|
24
|
+
projectId: "00000000-0000-4000-8000-000000000000",
|
|
25
|
+
publishableClientKey: "stack-pk-test",
|
|
26
|
+
tokenStore: "memory",
|
|
27
|
+
redirectMethod: "none",
|
|
28
|
+
devTool: false,
|
|
29
|
+
});
|
|
30
|
+
const getProject = vi.fn(async () => ({
|
|
31
|
+
isDevelopmentEnvironment: true,
|
|
32
|
+
}));
|
|
33
|
+
Reflect.set(app, "getProject", getProject);
|
|
34
|
+
|
|
35
|
+
vi.stubEnv("NODE_ENV", "production");
|
|
36
|
+
vi.stubGlobal("window", {
|
|
37
|
+
location: {
|
|
38
|
+
href: "https://example.com",
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
vi.stubGlobal("document", {
|
|
42
|
+
body: {
|
|
43
|
+
appendChild: () => {},
|
|
44
|
+
},
|
|
45
|
+
createElement: () => ({}),
|
|
46
|
+
});
|
|
47
|
+
vi.stubGlobal("localStorage", {
|
|
48
|
+
getItem: () => null,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
mountDevTool(app);
|
|
52
|
+
|
|
53
|
+
await vi.waitFor(() => {
|
|
54
|
+
expect(getProject).toHaveBeenCalledOnce();
|
|
55
|
+
expect(createDevTool).toHaveBeenCalledOnce();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
package/src/dev-tool/index.ts
CHANGED
|
@@ -24,6 +24,7 @@ function getOverride(): boolean | null {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
let activeDevToolOption: true | "auto" | undefined = undefined;
|
|
27
|
+
let activeProjectIsDevelopmentEnvironment = false;
|
|
27
28
|
|
|
28
29
|
function shouldShow(): boolean {
|
|
29
30
|
const override = getOverride();
|
|
@@ -33,6 +34,10 @@ function shouldShow(): boolean {
|
|
|
33
34
|
// If devTool was explicitly set to true, always show
|
|
34
35
|
if (activeDevToolOption === true) return true;
|
|
35
36
|
|
|
37
|
+
// Development environment projects should expose the tool even when the
|
|
38
|
+
// consuming app itself was built or hosted as production.
|
|
39
|
+
if (activeProjectIsDevelopmentEnvironment) return true;
|
|
40
|
+
|
|
36
41
|
// "auto" behavior (the default):
|
|
37
42
|
const nodeEnv = envVars.NODE_ENV;
|
|
38
43
|
if (nodeEnv !== undefined) {
|
|
@@ -103,8 +108,28 @@ function tryMount() {
|
|
|
103
108
|
export function mountDevTool(app: StackClientApp<true>, devToolOption?: boolean | "auto"): () => void {
|
|
104
109
|
activeApp = app;
|
|
105
110
|
activeDevToolOption = devToolOption === false ? undefined : devToolOption ?? undefined;
|
|
111
|
+
activeProjectIsDevelopmentEnvironment = false;
|
|
106
112
|
tryMount();
|
|
107
113
|
|
|
114
|
+
// The project endpoint is also the source of config warnings, so this uses
|
|
115
|
+
// the backend's development-environment flag instead of inferring it from
|
|
116
|
+
// the SDK's build or the current page's origin.
|
|
117
|
+
queueMicrotask(() => {
|
|
118
|
+
runAsynchronously(async () => {
|
|
119
|
+
const project = await app.getProject();
|
|
120
|
+
if (activeApp !== app) return;
|
|
121
|
+
activeProjectIsDevelopmentEnvironment = project.isDevelopmentEnvironment;
|
|
122
|
+
if (activeProjectIsDevelopmentEnvironment && activeCleanup === null) {
|
|
123
|
+
tryMount();
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
noErrorLogging: true,
|
|
127
|
+
onError: (error) => {
|
|
128
|
+
captureError("dev-tool-project-detection", error);
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
108
133
|
// Capture the cleanup created by THIS specific mount call so that React
|
|
109
134
|
// StrictMode's double-invoke doesn't let the first effect's cleanup tear
|
|
110
135
|
// down the second mount (which would cause the tool to disappear silently).
|
|
@@ -112,6 +137,7 @@ export function mountDevTool(app: StackClientApp<true>, devToolOption?: boolean
|
|
|
112
137
|
|
|
113
138
|
return () => {
|
|
114
139
|
activeApp = null;
|
|
140
|
+
activeProjectIsDevelopmentEnvironment = false;
|
|
115
141
|
if (activeCleanup === myCleanup && myCleanup != null) {
|
|
116
142
|
activeCleanup = null;
|
|
117
143
|
myCleanup();
|
|
@@ -150,7 +176,7 @@ if (typeof window !== 'undefined') {
|
|
|
150
176
|
activeCleanup();
|
|
151
177
|
activeCleanup = null;
|
|
152
178
|
}
|
|
153
|
-
console.log('[Stack DevTool] Reset to default (auto-detect based on NODE_ENV or localhost/file: origin).');
|
|
179
|
+
console.log('[Stack DevTool] Reset to default (auto-detect based on project, NODE_ENV, or localhost/file: origin).');
|
|
154
180
|
},
|
|
155
181
|
};
|
|
156
182
|
}
|
|
@@ -1638,6 +1638,7 @@ export class _HexclaveClientAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
1638
1638
|
return {
|
|
1639
1639
|
id: crud.id,
|
|
1640
1640
|
displayName: crud.display_name,
|
|
1641
|
+
isDevelopmentEnvironment: crud.is_development_environment,
|
|
1641
1642
|
pushedConfigError: crud.pushed_config_error == null ? null : {
|
|
1642
1643
|
message: crud.pushed_config_error.message,
|
|
1643
1644
|
},
|
|
@@ -30,6 +30,7 @@ export type PushConfigOptions = {
|
|
|
30
30
|
export type Project = {
|
|
31
31
|
readonly id: string,
|
|
32
32
|
readonly displayName: string,
|
|
33
|
+
readonly isDevelopmentEnvironment: boolean,
|
|
33
34
|
readonly pushedConfigError: { message: string } | null,
|
|
34
35
|
readonly configWarnings: { message: string }[],
|
|
35
36
|
readonly config: ProjectConfig,
|