@lunora/studio 1.0.0-alpha.2 → 1.0.0-alpha.21
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/__assets__/package-og.svg +1 -1
- package/dist/index.d.ts +23 -17
- package/dist/index.js +34 -34
- package/dist/mount.d.ts +1 -1
- package/dist/mount.js +1 -1
- package/dist/packem_shared/{ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js → ADMIN_FUNCTIONS-CdaxLGkE.js} +3 -0
- package/dist/packem_shared/{ApiDocsPanel-DpRjJhG5.js → ApiDocsPanel-BgrN4kml.js} +3 -3
- package/dist/packem_shared/{ApiReferencePanel-DMIUp-kK.js → ApiReferencePanel-1vubqG5s.js} +2 -2
- package/dist/packem_shared/{ApiTab-DURGU15e.js → ApiTab-CHkX49o_.js} +4 -4
- package/dist/packem_shared/{AuditPanel-BC59Nhst.js → AuditPanel-CP9HM9nq.js} +19 -31
- package/dist/packem_shared/{CommandPalette-Dx_CoB9i.js → CommandPalette-BtgkBzZI.js} +2 -2
- package/dist/packem_shared/{ConfirmButton-WQVUoGFb.js → ConfirmButton-C2eVi2Qv.js} +1 -1
- package/dist/packem_shared/{ConnectionBadge-Bxagrip8.js → ConnectionBadge-B2DDM2Tn.js} +1 -1
- package/dist/packem_shared/{createStudioI18n-CgvlmDkN.js → DEFAULT_LOCALE-CiX4W7Kr.js} +1 -1
- package/dist/packem_shared/{DataBrowser-Coz6jJE6.js → DataBrowser-Bb1gTQ6c.js} +182 -249
- package/dist/packem_shared/{ExportImportPanel-WO34fJxy.js → ExportImportPanel-Dj87tRa5.js} +9 -5
- package/dist/packem_shared/{FileBrowser-Zcr-Qgxo.js → FileBrowser-CWvxp_is.js} +7 -7
- package/dist/packem_shared/{FunctionRunner-j0Rd5m9t.js → FunctionRunner-DlWApMCH.js} +4 -4
- package/dist/packem_shared/{FunctionStatsPanel-DboBl-XL.js → FunctionStatsPanel-CuO2Tmw-.js} +141 -198
- package/dist/packem_shared/{GlobalDataBrowser-9MhPEfgN.js → GlobalDataBrowser-3X9uRfdO.js} +37 -66
- package/dist/packem_shared/{HealthPanel-DOIgbUtx.js → HealthPanel-Dj0GRo5P.js} +31 -23
- package/dist/packem_shared/{HomePanel-bdOCNA-p.js → HomePanel-BewOCuag.js} +450 -389
- package/dist/packem_shared/{InsightsPanel-DaZPnSgt.js → InsightsPanel-y_Q-xdPY.js} +104 -66
- package/dist/packem_shared/{LogsPanel-CWdqAGpQ.js → LogsPanel-C7crgYoS.js} +35 -47
- package/dist/packem_shared/{MailPanel-D_EGtDnS.js → MailPanel-PILidruz.js} +31 -38
- package/dist/packem_shared/{MetricsPanel-E4Gv6wTO.js → MetricsPanel-DioILzgf.js} +34 -48
- package/dist/packem_shared/{MigrationsPanel-DQdPY9io.js → MigrationsPanel-DkIcRoE5.js} +31 -38
- package/dist/packem_shared/{OpenRpcReferencePanel-j2p3HB0s.js → OpenRpcReferencePanel-vbcYbv3V.js} +2 -2
- package/dist/packem_shared/{PitrPanel-BbBkQR6t.js → PitrPanel-yKJ1JPPk.js} +4 -4
- package/dist/packem_shared/{ScheduledJobs-Ok1CYYwI.js → ScheduledJobs-BWNwIN3I.js} +164 -61
- package/dist/packem_shared/{SchemaViewer-D8XGnp-X.js → SchemaViewer-CNr8Wame.js} +4 -4
- package/dist/packem_shared/{SecurityAdvisorPanel-Cdm2IxLW.js → SecurityAdvisorPanel-BBzv7L3c.js} +44 -31
- package/dist/packem_shared/SettingsPanel-BKSKl8tl.js +390 -0
- package/dist/packem_shared/{ShardInput-DNCsT1KW.js → ShardInput-gx_DZXXn.js} +1 -1
- package/dist/packem_shared/SqlEditorPanel-CkemCQvy.js +13 -0
- package/dist/packem_shared/Studio-QkOjc2NS.js +33 -0
- package/dist/packem_shared/{StudioApp-dvywkJ8I.js → StudioApp-TEElspKL.js} +278 -4
- package/dist/packem_shared/{StudioI18nProvider-Dcajsznk.js → StudioI18nProvider-B-tDCZIi.js} +1 -1
- package/dist/packem_shared/TableEditor-JS3sXYgS.js +11 -0
- package/dist/packem_shared/{advisor-view-DBlzJi6C.js → advisor-view-CGcfMiPq.js} +1 -1
- package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-Cnij4Zp5.d.ts} +1 -1
- package/dist/packem_shared/{cf-links-BZfRdxSE.js → cf-links-2cktDedA.js} +1 -1
- package/dist/packem_shared/{data-grid-CCh2Couo.js → data-grid-B5CaV3wS.js} +2 -2
- package/dist/packem_shared/{grid-features-DTjG6Sex.js → grid-features-CzUfqgsM.js} +3 -3
- package/dist/packem_shared/{internal-BBZYexre.js → internal-rXJEAhXS.js} +1 -1
- package/dist/packem_shared/{live-status-bPff1O7Y.js → live-status-FZ0psC1z.js} +1 -1
- package/dist/packem_shared/{reference-view-BCKIoai7.js → reference-view-B4E49Lip.js} +3 -3
- package/dist/packem_shared/{sql-editor-panel-CW2y2x9h.js → sql-editor-panel-CUJoYF1Z.js} +6 -6
- package/dist/packem_shared/{studio-BDVd7rIV.js → studio-c5Vf7kSh.js} +2897 -1668
- package/dist/packem_shared/{TableEditor-DIVDk3vT.js → table-editor-9fhJ4hMJ.js} +43 -7
- package/dist/packem_shared/{table-list-sidebar-aZHLq70w.js → table-list-sidebar-Bg7uzbvC.js} +2 -2
- package/dist/packem_shared/use-admin-query-BkbdNFNz.js +105 -0
- package/dist/standalone/studio.js +198 -176
- package/dist/styles.css +1 -1
- package/package.json +13 -12
- package/dist/packem_shared/SettingsPanel-D3WF2mBU.js +0 -176
- package/dist/packem_shared/SqlEditorPanel-BuQ7f2Hs.js +0 -13
- package/dist/packem_shared/Studio-D36od9Oz.js +0 -33
- package/dist/packem_shared/use-live-admin-D1h1Fzsd.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-B74RYcOy.js +0 -76
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { useLunora } from '@lunora/react';
|
|
2
|
-
import { useState, useCallback, useEffect, useMemo } from 'react';
|
|
3
|
-
import { B as Badge } from './badge-B2PKA1-5.js';
|
|
4
|
-
import { C as Card, a as CardContent } from './card-DURq3ElK.js';
|
|
5
|
-
import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
|
|
6
|
-
import { useT } from './createStudioI18n-CgvlmDkN.js';
|
|
7
|
-
import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js';
|
|
8
|
-
import { b as CLOUDFLARE_WORKERS_URL } from './cf-links-BZfRdxSE.js';
|
|
9
|
-
import { c as callOptions, e as errorMessage, f as fireAndForget, a as adminRef } from './internal-BBZYexre.js';
|
|
10
|
-
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
11
|
-
|
|
12
|
-
const GET_SETTINGS = adminRef(ADMIN_FUNCTIONS.getSettings);
|
|
13
|
-
const KIND_VARIANT = {
|
|
14
|
-
binding: "outline",
|
|
15
|
-
secret: "destructive",
|
|
16
|
-
var: "secondary"
|
|
17
|
-
};
|
|
18
|
-
const SettingsPanel = ({
|
|
19
|
-
initialShardKey
|
|
20
|
-
}) => {
|
|
21
|
-
const client = useLunora();
|
|
22
|
-
const t = useT();
|
|
23
|
-
const [result, setResult] = useState(null);
|
|
24
|
-
const [error, setError] = useState(null);
|
|
25
|
-
const [loading, setLoading] = useState(false);
|
|
26
|
-
const refresh = useCallback(async () => {
|
|
27
|
-
setLoading(true);
|
|
28
|
-
setError(null);
|
|
29
|
-
try {
|
|
30
|
-
const settings = await client.query(GET_SETTINGS, {}, callOptions(initialShardKey ?? ""));
|
|
31
|
-
setResult(settings);
|
|
32
|
-
} catch (error_) {
|
|
33
|
-
setResult(null);
|
|
34
|
-
setError(errorMessage(error_));
|
|
35
|
-
} finally {
|
|
36
|
-
setLoading(false);
|
|
37
|
-
}
|
|
38
|
-
}, [client, initialShardKey]);
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
fireAndForget(refresh());
|
|
41
|
-
}, [refresh]);
|
|
42
|
-
const deployRows = useMemo(() => {
|
|
43
|
-
const deploy = result?.deploy;
|
|
44
|
-
if (deploy === void 0) {
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
const rows = [];
|
|
48
|
-
if (deploy.workerUrl !== void 0) {
|
|
49
|
-
rows.push({
|
|
50
|
-
label: t("URL"),
|
|
51
|
-
value: deploy.workerUrl
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
if (deploy.environment !== void 0) {
|
|
55
|
-
rows.push({
|
|
56
|
-
label: t("Environment"),
|
|
57
|
-
value: deploy.environment
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
if (deploy.deploymentId !== void 0) {
|
|
61
|
-
rows.push({
|
|
62
|
-
label: t("Deployment"),
|
|
63
|
-
value: deploy.deploymentId
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
if (deploy.versionTag !== void 0) {
|
|
67
|
-
rows.push({
|
|
68
|
-
label: t("Version"),
|
|
69
|
-
value: deploy.versionTag
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return rows;
|
|
73
|
-
}, [result, t]);
|
|
74
|
-
const settings_0 = result?.settings ?? [];
|
|
75
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
76
|
-
className: "flex flex-col gap-4",
|
|
77
|
-
"data-testid": "lunora-settings",
|
|
78
|
-
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
79
|
-
className: "flex flex-wrap items-center gap-3",
|
|
80
|
-
children: /* @__PURE__ */ jsxDEV("a", {
|
|
81
|
-
className: "text-sm text-primary underline-offset-4 hover:underline",
|
|
82
|
-
"data-testid": "set-cf-link",
|
|
83
|
-
href: CLOUDFLARE_WORKERS_URL,
|
|
84
|
-
rel: "noreferrer",
|
|
85
|
-
target: "_blank",
|
|
86
|
-
children: t("Open in Cloudflare")
|
|
87
|
-
}, void 0, false)
|
|
88
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("p", {
|
|
89
|
-
className: "text-sm text-muted-foreground",
|
|
90
|
-
"data-testid": "set-readonly-note",
|
|
91
|
-
children: t("View-only — values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard.")
|
|
92
|
-
}, void 0, false), error !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
93
|
-
className: "text-sm text-destructive",
|
|
94
|
-
"data-testid": "set-error",
|
|
95
|
-
role: "alert",
|
|
96
|
-
children: error
|
|
97
|
-
}, void 0, false), deployRows.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
|
|
98
|
-
className: "py-0",
|
|
99
|
-
"data-testid": "set-deploy",
|
|
100
|
-
children: [/* @__PURE__ */ jsxDEV("header", {
|
|
101
|
-
className: "border-b border-border px-4 py-3",
|
|
102
|
-
children: /* @__PURE__ */ jsxDEV("span", {
|
|
103
|
-
className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
|
|
104
|
-
children: t("Deployment")
|
|
105
|
-
}, void 0, false)
|
|
106
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(CardContent, {
|
|
107
|
-
className: "py-3",
|
|
108
|
-
children: /* @__PURE__ */ jsxDEV("dl", {
|
|
109
|
-
className: "grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",
|
|
110
|
-
children: deployRows.map((row) => /* @__PURE__ */ jsxDEV("div", {
|
|
111
|
-
className: "contents",
|
|
112
|
-
"data-testid": "set-deploy-row",
|
|
113
|
-
children: [/* @__PURE__ */ jsxDEV("dt", {
|
|
114
|
-
className: "text-muted-foreground",
|
|
115
|
-
children: row.label
|
|
116
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("dd", {
|
|
117
|
-
className: "truncate font-mono text-xs",
|
|
118
|
-
title: row.value,
|
|
119
|
-
children: row.value
|
|
120
|
-
}, void 0, false)]
|
|
121
|
-
}, row.label, true))
|
|
122
|
-
}, void 0, false)
|
|
123
|
-
}, void 0, false)]
|
|
124
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV(Card, {
|
|
125
|
-
className: "py-0",
|
|
126
|
-
children: [/* @__PURE__ */ jsxDEV("header", {
|
|
127
|
-
className: "border-b border-border px-4 py-3",
|
|
128
|
-
children: /* @__PURE__ */ jsxDEV("span", {
|
|
129
|
-
className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
|
|
130
|
-
children: t("Environment & bindings")
|
|
131
|
-
}, void 0, false)
|
|
132
|
-
}, void 0, false), error === null && !loading && settings_0.length === 0 && /* @__PURE__ */ jsxDEV("p", {
|
|
133
|
-
className: "px-4 py-8 text-center text-sm text-muted-foreground",
|
|
134
|
-
"data-testid": "set-empty",
|
|
135
|
-
children: t("No environment variables or bindings.")
|
|
136
|
-
}, void 0, false), settings_0.length > 0 && /* @__PURE__ */ jsxDEV(CardContent, {
|
|
137
|
-
className: "px-0 py-0",
|
|
138
|
-
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
139
|
-
"data-testid": "set-table",
|
|
140
|
-
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
141
|
-
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
142
|
-
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
143
|
-
children: t("name")
|
|
144
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
145
|
-
children: t("kind")
|
|
146
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
147
|
-
children: t("value")
|
|
148
|
-
}, void 0, false)]
|
|
149
|
-
}, void 0, true)
|
|
150
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
151
|
-
children: settings_0.map((entry) => /* @__PURE__ */ jsxDEV(TableRow, {
|
|
152
|
-
"data-testid": "set-row",
|
|
153
|
-
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
154
|
-
className: "font-mono text-xs font-medium",
|
|
155
|
-
children: entry.name
|
|
156
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
157
|
-
children: /* @__PURE__ */ jsxDEV(Badge, {
|
|
158
|
-
variant: KIND_VARIANT[entry.kind],
|
|
159
|
-
children: entry.bindingType ?? entry.kind
|
|
160
|
-
}, void 0, false)
|
|
161
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
162
|
-
className: "max-w-[28ch] truncate font-mono text-xs text-muted-foreground",
|
|
163
|
-
children: entry.value ?? /* @__PURE__ */ jsxDEV("span", {
|
|
164
|
-
className: "text-muted-foreground",
|
|
165
|
-
children: "—"
|
|
166
|
-
}, void 0, false)
|
|
167
|
-
}, void 0, false)]
|
|
168
|
-
}, entry.name, true))
|
|
169
|
-
}, void 0, false)]
|
|
170
|
-
}, void 0, true)
|
|
171
|
-
}, void 0, false)]
|
|
172
|
-
}, void 0, true)]
|
|
173
|
-
}, void 0, true);
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
export { SettingsPanel };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import 'react/compiler-runtime';
|
|
2
|
-
import '@lunora/react';
|
|
3
|
-
import 'react';
|
|
4
|
-
export { S as SqlEditorPanel } from './sql-editor-panel-CW2y2x9h.js';
|
|
5
|
-
import './ShardInput-DNCsT1KW.js';
|
|
6
|
-
import './table-_RzNvy3R.js';
|
|
7
|
-
import './createStudioI18n-CgvlmDkN.js';
|
|
8
|
-
import './ADMIN_FUNCTION_PREFIX-DmBqMZ-z.js';
|
|
9
|
-
import './internal-BBZYexre.js';
|
|
10
|
-
import './shard-history-DyebH1R5.js';
|
|
11
|
-
import './data-grid-CCh2Couo.js';
|
|
12
|
-
import './grid-features-DTjG6Sex.js';
|
|
13
|
-
import 'react/jsx-dev-runtime';
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import 'react/compiler-runtime';
|
|
2
|
-
import '@tanstack/react-router';
|
|
3
|
-
import 'react';
|
|
4
|
-
export { S as Studio } from './studio-BDVd7rIV.js';
|
|
5
|
-
import './ErrorBoundary-BzAApI7J.js';
|
|
6
|
-
import './badge-B2PKA1-5.js';
|
|
7
|
-
import './input-XH4r1Pt1.js';
|
|
8
|
-
import './reference-view-BCKIoai7.js';
|
|
9
|
-
import './InsightsPanel-DaZPnSgt.js';
|
|
10
|
-
import './SecurityAdvisorPanel-Cdm2IxLW.js';
|
|
11
|
-
import './ApiTab-DURGU15e.js';
|
|
12
|
-
import './TableEditor-DIVDk3vT.js';
|
|
13
|
-
import './ExportImportPanel-WO34fJxy.js';
|
|
14
|
-
import './MigrationsPanel-DQdPY9io.js';
|
|
15
|
-
import './PitrPanel-BbBkQR6t.js';
|
|
16
|
-
import './FunctionRunner-j0Rd5m9t.js';
|
|
17
|
-
import './FunctionStatsPanel-DboBl-XL.js';
|
|
18
|
-
import './HomePanel-bdOCNA-p.js';
|
|
19
|
-
import './AuditPanel-BC59Nhst.js';
|
|
20
|
-
import './LogsPanel-CWdqAGpQ.js';
|
|
21
|
-
import './MailPanel-D_EGtDnS.js';
|
|
22
|
-
import './HealthPanel-DOIgbUtx.js';
|
|
23
|
-
import './MetricsPanel-E4Gv6wTO.js';
|
|
24
|
-
import './SchemaViewer-D8XGnp-X.js';
|
|
25
|
-
import './SettingsPanel-D3WF2mBU.js';
|
|
26
|
-
import './sql-editor-panel-CW2y2x9h.js';
|
|
27
|
-
import './FileBrowser-Zcr-Qgxo.js';
|
|
28
|
-
import './createStudioI18n-CgvlmDkN.js';
|
|
29
|
-
import './StudioI18nProvider-Dcajsznk.js';
|
|
30
|
-
import './internal-BBZYexre.js';
|
|
31
|
-
import './utils-B05Dmz_H.js';
|
|
32
|
-
import './CommandPalette-Dx_CoB9i.js';
|
|
33
|
-
import 'react/jsx-dev-runtime';
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { c } from 'react/compiler-runtime';
|
|
2
|
-
import { useLunora } from '@lunora/react';
|
|
3
|
-
import { useRef, useEffect } from 'react';
|
|
4
|
-
import { a as adminRef, c as callOptions } from './internal-BBZYexre.js';
|
|
5
|
-
|
|
6
|
-
const useLiveAdmin = (functionPath, args, shardKey, onValue, t0, onError) => {
|
|
7
|
-
const $ = c(17);
|
|
8
|
-
const enabled = t0 === void 0 ? true : t0;
|
|
9
|
-
const client = useLunora();
|
|
10
|
-
const callbackRef = useRef(onValue);
|
|
11
|
-
const errorRef = useRef(onError);
|
|
12
|
-
const argsRef = useRef(args);
|
|
13
|
-
let t1;
|
|
14
|
-
if ($[0] !== args || $[1] !== onError || $[2] !== onValue) {
|
|
15
|
-
t1 = () => {
|
|
16
|
-
callbackRef.current = onValue;
|
|
17
|
-
errorRef.current = onError;
|
|
18
|
-
argsRef.current = args;
|
|
19
|
-
};
|
|
20
|
-
$[0] = args;
|
|
21
|
-
$[1] = onError;
|
|
22
|
-
$[2] = onValue;
|
|
23
|
-
$[3] = t1;
|
|
24
|
-
} else {
|
|
25
|
-
t1 = $[3];
|
|
26
|
-
}
|
|
27
|
-
useEffect(t1);
|
|
28
|
-
let t2;
|
|
29
|
-
if ($[4] !== args) {
|
|
30
|
-
t2 = JSON.stringify(args);
|
|
31
|
-
$[4] = args;
|
|
32
|
-
$[5] = t2;
|
|
33
|
-
} else {
|
|
34
|
-
t2 = $[5];
|
|
35
|
-
}
|
|
36
|
-
const argsKey = t2;
|
|
37
|
-
let t3;
|
|
38
|
-
if ($[6] !== client || $[7] !== enabled || $[8] !== functionPath || $[9] !== shardKey) {
|
|
39
|
-
t3 = () => {
|
|
40
|
-
if (!enabled) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
return client.subscribe(adminRef(functionPath), argsRef.current, (value) => {
|
|
44
|
-
callbackRef.current(value);
|
|
45
|
-
}, {
|
|
46
|
-
...callOptions(shardKey),
|
|
47
|
-
onError: (error) => errorRef.current?.(error.message)
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
$[6] = client;
|
|
51
|
-
$[7] = enabled;
|
|
52
|
-
$[8] = functionPath;
|
|
53
|
-
$[9] = shardKey;
|
|
54
|
-
$[10] = t3;
|
|
55
|
-
} else {
|
|
56
|
-
t3 = $[10];
|
|
57
|
-
}
|
|
58
|
-
let t4;
|
|
59
|
-
if ($[11] !== argsKey || $[12] !== client || $[13] !== enabled || $[14] !== functionPath || $[15] !== shardKey) {
|
|
60
|
-
t4 = [client, functionPath, argsKey, shardKey, enabled];
|
|
61
|
-
$[11] = argsKey;
|
|
62
|
-
$[12] = client;
|
|
63
|
-
$[13] = enabled;
|
|
64
|
-
$[14] = functionPath;
|
|
65
|
-
$[15] = shardKey;
|
|
66
|
-
$[16] = t4;
|
|
67
|
-
} else {
|
|
68
|
-
t4 = $[16];
|
|
69
|
-
}
|
|
70
|
-
useEffect(t3, t4);
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export { useLiveAdmin as u };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { c } from 'react/compiler-runtime';
|
|
2
|
-
import { useState, useRef, useEffect } from 'react';
|
|
3
|
-
import useDebounced from './useDebounced-Dxncpg6z.js';
|
|
4
|
-
import { f as fireAndForget } from './internal-BBZYexre.js';
|
|
5
|
-
|
|
6
|
-
const useLiveShardSeed = (shardKey, seed, t0) => {
|
|
7
|
-
const $ = c(11);
|
|
8
|
-
let t1;
|
|
9
|
-
if ($[0] !== t0) {
|
|
10
|
-
t1 = t0 === void 0 ? [] : t0;
|
|
11
|
-
$[0] = t0;
|
|
12
|
-
$[1] = t1;
|
|
13
|
-
} else {
|
|
14
|
-
t1 = $[1];
|
|
15
|
-
}
|
|
16
|
-
const extraDeps = t1;
|
|
17
|
-
const [committedShard, setCommittedShard] = useState(void 0);
|
|
18
|
-
let t2;
|
|
19
|
-
if ($[2] !== shardKey) {
|
|
20
|
-
t2 = shardKey.trim();
|
|
21
|
-
$[2] = shardKey;
|
|
22
|
-
$[3] = t2;
|
|
23
|
-
} else {
|
|
24
|
-
t2 = $[3];
|
|
25
|
-
}
|
|
26
|
-
const debouncedShard = useDebounced(t2, 400);
|
|
27
|
-
const seedRef = useRef(seed);
|
|
28
|
-
let t3;
|
|
29
|
-
if ($[4] !== seed) {
|
|
30
|
-
t3 = () => {
|
|
31
|
-
seedRef.current = seed;
|
|
32
|
-
};
|
|
33
|
-
$[4] = seed;
|
|
34
|
-
$[5] = t3;
|
|
35
|
-
} else {
|
|
36
|
-
t3 = $[5];
|
|
37
|
-
}
|
|
38
|
-
useEffect(t3);
|
|
39
|
-
let t4;
|
|
40
|
-
if ($[6] !== debouncedShard) {
|
|
41
|
-
t4 = () => {
|
|
42
|
-
const live = {
|
|
43
|
-
current: true
|
|
44
|
-
};
|
|
45
|
-
fireAndForget((async () => {
|
|
46
|
-
try {
|
|
47
|
-
await seedRef.current(debouncedShard);
|
|
48
|
-
if (live.current) {
|
|
49
|
-
setCommittedShard(debouncedShard);
|
|
50
|
-
}
|
|
51
|
-
} catch {
|
|
52
|
-
}
|
|
53
|
-
})());
|
|
54
|
-
return () => {
|
|
55
|
-
live.current = false;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
$[6] = debouncedShard;
|
|
59
|
-
$[7] = t4;
|
|
60
|
-
} else {
|
|
61
|
-
t4 = $[7];
|
|
62
|
-
}
|
|
63
|
-
let t5;
|
|
64
|
-
if ($[8] !== debouncedShard || $[9] !== extraDeps) {
|
|
65
|
-
t5 = [debouncedShard, ...extraDeps];
|
|
66
|
-
$[8] = debouncedShard;
|
|
67
|
-
$[9] = extraDeps;
|
|
68
|
-
$[10] = t5;
|
|
69
|
-
} else {
|
|
70
|
-
t5 = $[10];
|
|
71
|
-
}
|
|
72
|
-
useEffect(t4, t5);
|
|
73
|
-
return committedShard;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export { useLiveShardSeed as u };
|