@rebasepro/studio 0.34.2 → 0.35.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/README.md +1 -1
- package/dist/{ApiExplorer-BhQFd_iR.js → ApiExplorer-C61w8gCc.js} +73 -58
- package/dist/ApiExplorer-C61w8gCc.js.map +1 -0
- package/dist/{ApiKeysView-CLBXUCgu.js → ApiKeysView-BdqASL_2.js} +33 -32
- package/dist/ApiKeysView-BdqASL_2.js.map +1 -0
- package/dist/{BranchesView-BKGhk-PC.js → BranchesView-Bh5lq9T_.js} +5 -5
- package/dist/BranchesView-Bh5lq9T_.js.map +1 -0
- package/dist/{CronJobsView-CwF_m6ZB.js → CronJobsView-DUuyzkJK.js} +392 -8
- package/dist/CronJobsView-DUuyzkJK.js.map +1 -0
- package/dist/FixedEditorOverlay-DtgPBSjq.js +93 -0
- package/dist/FixedEditorOverlay-DtgPBSjq.js.map +1 -0
- package/dist/{JSEditor-Br22PfLh.js → JSEditor-Bi2Aol-Y.js} +27 -21
- package/dist/JSEditor-Bi2Aol-Y.js.map +1 -0
- package/dist/{LogsExplorer-DOLRFQaW.js → LogsExplorer-BA8RfTwd.js} +46 -67
- package/dist/LogsExplorer-BA8RfTwd.js.map +1 -0
- package/dist/{RLSEditor-RE4YpN_z.js → RLSEditor-CTG3jLE7.js} +478 -224
- package/dist/RLSEditor-CTG3jLE7.js.map +1 -0
- package/dist/{SQLEditor-Dj5INEUZ.js → SQLEditor-DRo5kW1h.js} +15 -96
- package/dist/SQLEditor-DRo5kW1h.js.map +1 -0
- package/dist/{SchemaVisualizer-D2_cck4I.js → SchemaVisualizer-Dy4kWKT5.js} +15 -14
- package/dist/SchemaVisualizer-Dy4kWKT5.js.map +1 -0
- package/dist/{StorageView-DHm22S7y.js → StorageView-D0D8z4lI.js} +497 -4
- package/dist/StorageView-D0D8z4lI.js.map +1 -0
- package/dist/TableEditorView-BKhSBG-K.js +1694 -0
- package/dist/TableEditorView-BKhSBG-K.js.map +1 -0
- package/dist/UsersAndRolesView-CKw4SJPj.js +689 -0
- package/dist/UsersAndRolesView-CKw4SJPj.js.map +1 -0
- package/dist/WebhooksView-CFPY-N9h.js +465 -0
- package/dist/WebhooksView-CFPY-N9h.js.map +1 -0
- package/dist/adminFetch-BfOnfRgU.js +108 -0
- package/dist/adminFetch-BfOnfRgU.js.map +1 -0
- package/dist/components/ApiExplorer/TryItPanel.d.ts +6 -0
- package/dist/components/ApiKeys/scope-words.d.ts +1 -1
- package/dist/components/AuthSimulationSelector.d.ts +9 -1
- package/dist/components/CronJobs/DbCronJobsPanel.d.ts +2 -0
- package/dist/components/RLSEditor/DirectRlsPoliciesPanel.d.ts +7 -0
- package/dist/components/RebaseStudio.d.ts +1 -1
- package/dist/components/RebaseStudioApp.d.ts +28 -0
- package/dist/components/SQLEditor/FixedEditorOverlay.d.ts +12 -0
- package/dist/components/SQLEditor/SQLEditor.d.ts +2 -11
- package/dist/components/StorageView/StoragePoliciesPanel.d.ts +2 -0
- package/dist/components/StudioHomePage.d.ts +3 -1
- package/dist/components/TableEditor/TableEditorView.d.ts +2 -0
- package/dist/components/UsersAndRoles/UsersAndRolesView.d.ts +2 -0
- package/dist/components/Webhooks/WebhooksView.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +739 -109
- package/dist/index.es.js.map +1 -1
- package/dist/policy-presets-CJKzAvQp.js +167 -0
- package/dist/policy-presets-CJKzAvQp.js.map +1 -0
- package/dist/{useRunAsUsers-CLaAtXt6.js → useRunAsUsers-CF7tkGzj.js} +22 -3
- package/dist/useRunAsUsers-CF7tkGzj.js.map +1 -0
- package/dist/utils/adminFetch.d.ts +25 -0
- package/package.json +12 -16
- package/dist/ApiExplorer-BhQFd_iR.js.map +0 -1
- package/dist/ApiKeysView-CLBXUCgu.js.map +0 -1
- package/dist/BranchesView-BKGhk-PC.js.map +0 -1
- package/dist/CronJobsView-CwF_m6ZB.js.map +0 -1
- package/dist/JSEditor-Br22PfLh.js.map +0 -1
- package/dist/LogsExplorer-DOLRFQaW.js.map +0 -1
- package/dist/RLSEditor-RE4YpN_z.js.map +0 -1
- package/dist/SQLEditor-Dj5INEUZ.js.map +0 -1
- package/dist/SchemaVisualizer-D2_cck4I.js.map +0 -1
- package/dist/StorageView-DHm22S7y.js.map +0 -1
- package/dist/useRunAsUsers-CLaAtXt6.js.map +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { useApiBase, useApiConfig, useAuthController } from "@rebasepro/app";
|
|
2
|
+
import { useCallback, useRef } from "react";
|
|
3
|
+
//#region src/utils/adminFetch.ts
|
|
4
|
+
var AdminRequestError = class extends Error {
|
|
5
|
+
status;
|
|
6
|
+
code;
|
|
7
|
+
constructor(message, status, code) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = "AdminRequestError";
|
|
10
|
+
this.status = status;
|
|
11
|
+
this.code = code;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
function isRecord(value) {
|
|
15
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16
|
+
}
|
|
17
|
+
function asString(value, fallback = "") {
|
|
18
|
+
return typeof value === "string" ? value : fallback;
|
|
19
|
+
}
|
|
20
|
+
function asNullableString(value) {
|
|
21
|
+
return typeof value === "string" ? value : null;
|
|
22
|
+
}
|
|
23
|
+
function asBoolean(value, fallback = false) {
|
|
24
|
+
return typeof value === "boolean" ? value : fallback;
|
|
25
|
+
}
|
|
26
|
+
function asNumber(value, fallback = 0) {
|
|
27
|
+
return typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
28
|
+
}
|
|
29
|
+
function asStringArray(value) {
|
|
30
|
+
if (!Array.isArray(value)) return [];
|
|
31
|
+
return value.filter((item) => typeof item === "string");
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The database's own words, when the server sent them: outside production a
|
|
35
|
+
* database error's envelope carries `details.dbMessage` (and its detail and
|
|
36
|
+
* hint) under a generic message such as "An unexpected error occurred", and
|
|
37
|
+
* that sentence is the one that says what to fix.
|
|
38
|
+
*/
|
|
39
|
+
function databaseReason(details) {
|
|
40
|
+
if (!isRecord(details) || typeof details.dbMessage !== "string" || !details.dbMessage) return void 0;
|
|
41
|
+
return [
|
|
42
|
+
details.dbMessage,
|
|
43
|
+
typeof details.detail === "string" ? details.detail : void 0,
|
|
44
|
+
typeof details.hint === "string" ? `Hint: ${details.hint}` : void 0
|
|
45
|
+
].filter(Boolean).join(" ");
|
|
46
|
+
}
|
|
47
|
+
function extractError(body, status, statusText) {
|
|
48
|
+
if (isRecord(body)) {
|
|
49
|
+
const err = body.error;
|
|
50
|
+
if (isRecord(err) && typeof err.message === "string") {
|
|
51
|
+
const reason = databaseReason(err.details);
|
|
52
|
+
return {
|
|
53
|
+
message: reason && !err.message.includes(reason) ? `${err.message}: ${reason}` : err.message,
|
|
54
|
+
code: typeof err.code === "string" ? err.code : void 0
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (typeof body.message === "string") return { message: body.message };
|
|
58
|
+
}
|
|
59
|
+
return { message: `${status} ${statusText}`.trim() };
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Authenticated JSON client for Rebase's `/api/*` admin and data endpoints.
|
|
63
|
+
* Carries the active session or proxy token automatically.
|
|
64
|
+
*/
|
|
65
|
+
function useAdminFetch() {
|
|
66
|
+
const apiBase = useApiBase();
|
|
67
|
+
const apiConfig = useApiConfig();
|
|
68
|
+
const authController = useAuthController();
|
|
69
|
+
const apiBaseRef = useRef(apiBase);
|
|
70
|
+
apiBaseRef.current = apiBase;
|
|
71
|
+
const apiConfigRef = useRef(apiConfig);
|
|
72
|
+
apiConfigRef.current = apiConfig;
|
|
73
|
+
const authRef = useRef(authController);
|
|
74
|
+
authRef.current = authController;
|
|
75
|
+
return {
|
|
76
|
+
apiBase,
|
|
77
|
+
requestJson: useCallback(async (path, options = {}) => {
|
|
78
|
+
const url = `${(apiBaseRef.current ?? "/api").replace(/\/+$/, "")}${path.startsWith("/") ? path : `/${path}`}`;
|
|
79
|
+
const getToken = apiConfigRef.current?.getAuthToken ?? authRef.current.getAuthToken;
|
|
80
|
+
const token = getToken ? await getToken() : null;
|
|
81
|
+
const headers = { ...options.headers ?? {} };
|
|
82
|
+
if (token) headers.Authorization = `Bearer ${token}`;
|
|
83
|
+
if (options.body !== void 0 && !headers["Content-Type"]) headers["Content-Type"] = "application/json";
|
|
84
|
+
const res = await fetch(url, {
|
|
85
|
+
method: options.method ?? "GET",
|
|
86
|
+
headers,
|
|
87
|
+
body: options.body !== void 0 ? JSON.stringify(options.body) : void 0,
|
|
88
|
+
signal: options.signal
|
|
89
|
+
});
|
|
90
|
+
const text = await res.text();
|
|
91
|
+
let parsed = void 0;
|
|
92
|
+
if (text) try {
|
|
93
|
+
parsed = JSON.parse(text);
|
|
94
|
+
} catch {
|
|
95
|
+
parsed = text;
|
|
96
|
+
}
|
|
97
|
+
if (!res.ok) {
|
|
98
|
+
const { message, code } = extractError(parsed, res.status, res.statusText);
|
|
99
|
+
throw new AdminRequestError(message, res.status, code);
|
|
100
|
+
}
|
|
101
|
+
return parsed;
|
|
102
|
+
}, [])
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { asStringArray as a, asString as i, asNullableString as n, isRecord as o, asNumber as r, useAdminFetch as s, asBoolean as t };
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=adminFetch-BfOnfRgU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adminFetch-BfOnfRgU.js","names":[],"sources":["../src/utils/adminFetch.ts"],"sourcesContent":["import { useCallback, useRef } from \"react\";\nimport { useApiBase, useApiConfig, useAuthController } from \"@rebasepro/app\";\n\nexport class AdminRequestError extends Error {\n readonly status: number;\n readonly code?: string;\n\n constructor(message: string, status: number, code?: string) {\n super(message);\n this.name = \"AdminRequestError\";\n this.status = status;\n this.code = code;\n }\n}\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nexport function asString(value: unknown, fallback = \"\"): string {\n return typeof value === \"string\" ? value : fallback;\n}\n\nexport function asNullableString(value: unknown): string | null {\n return typeof value === \"string\" ? value : null;\n}\n\nexport function asBoolean(value: unknown, fallback = false): boolean {\n return typeof value === \"boolean\" ? value : fallback;\n}\n\nexport function asNumber(value: unknown, fallback = 0): number {\n return typeof value === \"number\" && Number.isFinite(value) ? value : fallback;\n}\n\nexport function asStringArray(value: unknown): string[] {\n if (!Array.isArray(value)) return [];\n return value.filter((item): item is string => typeof item === \"string\");\n}\n\n/**\n * The database's own words, when the server sent them: outside production a\n * database error's envelope carries `details.dbMessage` (and its detail and\n * hint) under a generic message such as \"An unexpected error occurred\", and\n * that sentence is the one that says what to fix.\n */\nfunction databaseReason(details: unknown): string | undefined {\n if (!isRecord(details) || typeof details.dbMessage !== \"string\" || !details.dbMessage) return undefined;\n return [\n details.dbMessage,\n typeof details.detail === \"string\" ? details.detail : undefined,\n typeof details.hint === \"string\" ? `Hint: ${details.hint}` : undefined\n ].filter(Boolean).join(\" \");\n}\n\nfunction extractError(body: unknown, status: number, statusText: string): { message: string; code?: string } {\n if (isRecord(body)) {\n const err = body.error;\n if (isRecord(err) && typeof err.message === \"string\") {\n const reason = databaseReason(err.details);\n return {\n message: reason && !err.message.includes(reason) ? `${err.message}: ${reason}` : err.message,\n code: typeof err.code === \"string\" ? err.code : undefined\n };\n }\n if (typeof body.message === \"string\") {\n return { message: body.message };\n }\n }\n return { message: `${status} ${statusText}`.trim() };\n}\n\nexport interface AdminFetchOptions {\n method?: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n body?: unknown;\n headers?: Record<string, string>;\n signal?: AbortSignal;\n}\n\n/**\n * Authenticated JSON client for Rebase's `/api/*` admin and data endpoints.\n * Carries the active session or proxy token automatically.\n */\nexport function useAdminFetch() {\n const apiBase = useApiBase();\n const apiConfig = useApiConfig();\n const authController = useAuthController();\n\n const apiBaseRef = useRef(apiBase);\n apiBaseRef.current = apiBase;\n const apiConfigRef = useRef(apiConfig);\n apiConfigRef.current = apiConfig;\n const authRef = useRef(authController);\n authRef.current = authController;\n\n const requestJson = useCallback(async (\n path: string,\n options: AdminFetchOptions = {}\n ): Promise<unknown> => {\n const base = (apiBaseRef.current ?? \"/api\").replace(/\\/+$/, \"\");\n const normalizedPath = path.startsWith(\"/\") ? path : `/${path}`;\n const url = `${base}${normalizedPath}`;\n\n const getToken = apiConfigRef.current?.getAuthToken ?? authRef.current.getAuthToken;\n const token = getToken ? await getToken() : null;\n\n const headers: Record<string, string> = {\n ...(options.headers ?? {})\n };\n if (token) {\n headers.Authorization = `Bearer ${token}`;\n }\n if (options.body !== undefined && !headers[\"Content-Type\"]) {\n headers[\"Content-Type\"] = \"application/json\";\n }\n\n const res = await fetch(url, {\n method: options.method ?? \"GET\",\n headers,\n body: options.body !== undefined ? JSON.stringify(options.body) : undefined,\n signal: options.signal\n });\n\n const text = await res.text();\n let parsed: unknown = undefined;\n if (text) {\n try {\n parsed = JSON.parse(text);\n } catch {\n parsed = text;\n }\n }\n\n if (!res.ok) {\n const { message, code } = extractError(parsed, res.status, res.statusText);\n throw new AdminRequestError(message, res.status, code);\n }\n\n return parsed;\n }, []);\n\n return { apiBase, requestJson };\n}\n"],"mappings":";;;AAGA,IAAa,oBAAb,cAAuC,MAAM;CACzC;CACA;CAEA,YAAY,SAAiB,QAAgB,MAAe;EACxD,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,KAAK,SAAS;EACd,KAAK,OAAO;CAChB;AACJ;AAEA,SAAgB,SAAS,OAAkD;CACvE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC9E;AAEA,SAAgB,SAAS,OAAgB,WAAW,IAAY;CAC5D,OAAO,OAAO,UAAU,WAAW,QAAQ;AAC/C;AAEA,SAAgB,iBAAiB,OAA+B;CAC5D,OAA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token and the {@link IMPERSONATE_HEADER} header, and the server runs it
|
|
17
17
|
* as that user — their uid and roles, under row-level security — or refuses
|
|
18
18
|
* it. It never runs as the administrator instead.
|
|
19
|
+
*
|
|
20
|
+
* Under a host whose requests all run as a service key
|
|
21
|
+
* ({@link StudioCapabilities.requestIdentity}, the hosted console), neither
|
|
22
|
+
* choice exists: a request without a credential is refused by the proxy, and
|
|
23
|
+
* the server refuses impersonation from a service key. The panel says what the
|
|
24
|
+
* request runs as instead, and shows the project's public URL.
|
|
19
25
|
*/
|
|
20
26
|
export declare function TryItPanel({ endpoint, apiUrl, getAuthToken, user, basePath }: TryItPanelProps): React.JSX.Element;
|
|
21
27
|
export {};
|
|
@@ -27,7 +27,7 @@ export declare function scopeDescriptionKey(scope: string): string;
|
|
|
27
27
|
export declare function localizeScopes(t: Translate, catalogue: readonly ScopeSummary[]): ScopeSummary[];
|
|
28
28
|
export declare function planeLabel(t: Translate, plane: ScopePlane): string;
|
|
29
29
|
export declare function planeHint(t: Translate, plane: ScopePlane): string;
|
|
30
|
-
/** "Every
|
|
30
|
+
/** "Every table", "Every storage source", "Every function", "Any project". */
|
|
31
31
|
export declare function everyTargetLabel(t: Translate, targetKind: string): string;
|
|
32
32
|
/** One target as a person reads it: the default storage source is "Default bucket", not `(default)`. */
|
|
33
33
|
export declare function targetLabel(t: Translate, targetKind: string | undefined, target: string): string;
|
|
@@ -12,5 +12,13 @@ export interface AuthSimulationSelectorProps {
|
|
|
12
12
|
/** How many users that search matched, when `users` is only its first page — see `UserSelectPopover`. */
|
|
13
13
|
userTotalCount?: number;
|
|
14
14
|
currentUser: SelectableUser | null;
|
|
15
|
+
/**
|
|
16
|
+
* What every request runs as, when the host fixes it (a service key, in
|
|
17
|
+
* the hosted console). Set, the selector shows this instead of the auth
|
|
18
|
+
* modes and the "Run as" picker: neither choice exists there.
|
|
19
|
+
*/
|
|
20
|
+
fixedIdentityLabel?: string;
|
|
21
|
+
/** Why the identity is fixed, shown on hover over {@link fixedIdentityLabel}. */
|
|
22
|
+
fixedIdentityHint?: string;
|
|
15
23
|
}
|
|
16
|
-
export declare function AuthSimulationSelector({ authMode, setAuthMode, selectedUser, setSelectedUser, users, loading, onUserSearchTextChange, userTotalCount, currentUser }: AuthSimulationSelectorProps): React.JSX.Element;
|
|
24
|
+
export declare function AuthSimulationSelector({ authMode, setAuthMode, selectedUser, setSelectedUser, users, loading, onUserSearchTextChange, userTotalCount, currentUser, fixedIdentityLabel, fixedIdentityHint }: AuthSimulationSelectorProps): React.JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Direct PostgreSQL RLS policy manager over `/api/admin/db/tables`.
|
|
4
|
+
* Works with zero `backend/schema` source files — every change applies live
|
|
5
|
+
* to Postgres and reloads the data API immediately.
|
|
6
|
+
*/
|
|
7
|
+
export declare function DirectRlsPoliciesPanel(): React.JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type CreateRebaseClientResult } from "@rebasepro/client";
|
|
3
|
+
import { type RebaseStudioConfig } from "@rebasepro/app";
|
|
4
|
+
export interface RebaseStudioAppProps {
|
|
5
|
+
/** Base URL of the Rebase API (e.g. `""` for same-origin, or `"http://localhost:3000"`). */
|
|
6
|
+
apiUrl?: string;
|
|
7
|
+
/** Optional pre-created RebaseClient instance. */
|
|
8
|
+
client?: CreateRebaseClientResult<Record<string, unknown>>;
|
|
9
|
+
/** Router basename when mounted under a sub-path (e.g. `"/_studio"`). */
|
|
10
|
+
basename?: string;
|
|
11
|
+
/** Display name shown in the Studio header. */
|
|
12
|
+
name?: string;
|
|
13
|
+
/** Restrict the built-in Studio tools shown in the sidebar. */
|
|
14
|
+
tools?: RebaseStudioConfig["tools"];
|
|
15
|
+
/** Custom views added alongside the built-in Studio tools. */
|
|
16
|
+
devViews?: RebaseStudioConfig["devViews"];
|
|
17
|
+
/** When true, do not wrap in a `<BrowserRouter>` (caller already provides one). */
|
|
18
|
+
withoutRouter?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Standalone Rebase Studio application shell.
|
|
22
|
+
*
|
|
23
|
+
* Mounts the full developer & zero-code BaaS console (Tables, SQL, RLS,
|
|
24
|
+
* Schema Visualizer, Storage & Policies, Users & Roles, Webhooks, Cron,
|
|
25
|
+
* API Explorer, Logs, Branches, Backups, API Keys) with ZERO dependency on
|
|
26
|
+
* `@rebasepro/cms`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function RebaseStudioApp({ apiUrl, client: providedClient, basename, name, tools, devViews, withoutRouter }: RebaseStudioAppProps): React.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The box a result cell is edited in. It closes once: Enter saves, Escape
|
|
4
|
+
* cancels, a click away saves — and the blur a closing box can still receive
|
|
5
|
+
* is not a second answer, which made Enter save twice and Escape save at all.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FixedEditorOverlay: ({ displayValue, onSave, onCancel }: {
|
|
8
|
+
displayValue: string;
|
|
9
|
+
/** What the box holds when it closes — the text as typed. */
|
|
10
|
+
onSave: (val: string) => void;
|
|
11
|
+
onCancel: () => void;
|
|
12
|
+
}) => React.JSX.Element;
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { FixedEditorOverlay } from "./FixedEditorOverlay.js";
|
|
2
3
|
import type { SQLEditorColumnInfo, TableInfo } from "./sql_editor_types.js";
|
|
3
4
|
export type { SQLEditorColumnInfo, TableInfo };
|
|
4
|
-
|
|
5
|
-
* The box a result cell is edited in. It closes once: Enter saves, Escape
|
|
6
|
-
* cancels, a click away saves — and the blur a closing box can still receive
|
|
7
|
-
* is not a second answer, which made Enter save twice and Escape save at all.
|
|
8
|
-
*/
|
|
9
|
-
export declare const FixedEditorOverlay: ({ displayValue, onSave, onCancel }: {
|
|
10
|
-
displayValue: string;
|
|
11
|
-
/** What the box holds when it closes — the text as typed. */
|
|
12
|
-
onSave: (val: string) => void;
|
|
13
|
-
onCancel: () => void;
|
|
14
|
-
}) => React.JSX.Element;
|
|
5
|
+
export { FixedEditorOverlay };
|
|
15
6
|
export declare const SQLEditor: () => React.JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { HomePageSection } from "@rebasepro/
|
|
1
|
+
import type { HomePageSection } from "@rebasepro/app";
|
|
2
2
|
import React from "react";
|
|
3
|
+
/** Group order for the home page; unknown groups are appended in view order. */
|
|
4
|
+
export declare const STUDIO_GROUP_ORDER: string[];
|
|
3
5
|
export declare function StudioHomePage({ additionalActions, additionalChildrenStart, additionalChildrenEnd, sections, hiddenGroups }: {
|
|
4
6
|
additionalActions?: React.ReactNode;
|
|
5
7
|
additionalChildrenStart?: React.ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { StudioBridgeProvider, StudioBridgeContext, useStudioCollectionRegistry, useStudioSidePanelController, useStudioUrlController, useStudioNavigationState, useStudioBreadcrumbs } from "@rebasepro/app";
|
|
2
2
|
export type { StudioBridge, BreadcrumbEntry, BreadcrumbsController } from "@rebasepro/app";
|
|
3
3
|
export * from "./components/RebaseStudio.js";
|
|
4
|
+
export * from "./components/RebaseStudioApp.js";
|
|
4
5
|
export * from "./components/StudioHomePage.js";
|