@upstash/react-redis-browser 0.2.14-rc.7 → 0.2.14-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +18 -4
- package/dist/index.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +133 -96
- package/dist/index.mjs +256 -219
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/components/databrowser/index.tsx
|
|
2
|
-
import { useEffect as
|
|
2
|
+
import { useEffect as useEffect23, useMemo as useMemo12, useRef as useRef11 } from "react";
|
|
3
3
|
|
|
4
4
|
// src/dark-mode-context.tsx
|
|
5
5
|
import { createContext, useContext } from "react";
|
|
@@ -3167,7 +3167,7 @@ var portalRoot = root;
|
|
|
3167
3167
|
var portalWrapper = wrapper;
|
|
3168
3168
|
|
|
3169
3169
|
// src/components/databrowser/components/databrowser-instance.tsx
|
|
3170
|
-
import { useEffect as
|
|
3170
|
+
import { useEffect as useEffect20, useState as useState25 } from "react";
|
|
3171
3171
|
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels";
|
|
3172
3172
|
|
|
3173
3173
|
// src/components/ui/segmented.tsx
|
|
@@ -3368,10 +3368,14 @@ function Toaster() {
|
|
|
3368
3368
|
// src/components/databrowser/hooks/use-fetch-search-indexes.tsx
|
|
3369
3369
|
import { useQuery } from "@tanstack/react-query";
|
|
3370
3370
|
var FETCH_SEARCH_INDEXES_QUERY_KEY = "fetch-search-indexes";
|
|
3371
|
-
var useFetchSearchIndexes = (
|
|
3371
|
+
var useFetchSearchIndexes = ({
|
|
3372
|
+
match,
|
|
3373
|
+
enabled
|
|
3374
|
+
} = {}) => {
|
|
3372
3375
|
const { redisNoPipeline: redis } = useRedis();
|
|
3373
3376
|
return useQuery({
|
|
3374
3377
|
queryKey: [FETCH_SEARCH_INDEXES_QUERY_KEY],
|
|
3378
|
+
enabled: enabled ?? true,
|
|
3375
3379
|
queryFn: async () => {
|
|
3376
3380
|
let cursor = "0";
|
|
3377
3381
|
const finalResult = [];
|
|
@@ -3434,7 +3438,8 @@ var SCAN_COUNTS = [100, 300, 500];
|
|
|
3434
3438
|
var KeysProvider = ({ children }) => {
|
|
3435
3439
|
const { active, search, valuesSearch, isValuesSearchSelected } = useTab();
|
|
3436
3440
|
const { data: searchIndexDetails, isLoading: isIndexDetailsLoading } = useFetchSearchIndex(
|
|
3437
|
-
valuesSearch.index
|
|
3441
|
+
valuesSearch.index,
|
|
3442
|
+
{ enabled: isValuesSearchSelected }
|
|
3438
3443
|
);
|
|
3439
3444
|
const { redisNoPipeline: redis } = useRedis();
|
|
3440
3445
|
const parsedValueQuery = parseJSObjectLiteral(valuesSearch.query);
|
|
@@ -6968,7 +6973,7 @@ var EditorDisplay = ({ dataKey, type }) => {
|
|
|
6968
6973
|
const { data } = useFetchSimpleKey(dataKey, type);
|
|
6969
6974
|
return /* @__PURE__ */ jsxs24("div", { className: "flex h-full w-full flex-col gap-2", children: [
|
|
6970
6975
|
/* @__PURE__ */ jsx44(DisplayHeader, { dataKey, type, content: data ?? void 0 }),
|
|
6971
|
-
/* @__PURE__ */ jsx44("div", { className: "flex h-full grow flex-col gap-2 rounded-md
|
|
6976
|
+
/* @__PURE__ */ jsx44("div", { className: "flex h-full grow flex-col gap-2 rounded-md", children: data === void 0 ? /* @__PURE__ */ jsx44(Spinner, { isLoadingText: "", isLoading: true }) : data === null ? /* @__PURE__ */ jsx44(Fragment7, {}) : /* @__PURE__ */ jsx44(EditorDisplayForm, { dataKey, type, data }, dataKey) })
|
|
6972
6977
|
] });
|
|
6973
6978
|
};
|
|
6974
6979
|
var EditorDisplayForm = ({
|
|
@@ -7015,14 +7020,14 @@ var DataDisplay = () => {
|
|
|
7015
7020
|
const { selectedKey } = useTab();
|
|
7016
7021
|
const { query } = useKeys();
|
|
7017
7022
|
const type = useKeyType(selectedKey);
|
|
7018
|
-
return /* @__PURE__ */ jsx45("div", { className: "h-full rounded-xl bg-zinc-100 p-5", children: !selectedKey ? /* @__PURE__ */ jsx45("div", {}) : !type ? query.isLoading ? /* @__PURE__ */ jsx45("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx45("span", { className: "text-zinc-500", children: "Loading..." }) }) : /* @__PURE__ */ jsx45("div", {}) : !DATA_TYPES.includes(type) ? /* @__PURE__ */ jsx45("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxs25("span", { className: "text-zinc-500", children: [
|
|
7023
|
+
return /* @__PURE__ */ jsx45("div", { className: "h-full rounded-xl bg-zinc-100 p-5 dark:bg-zinc-200", children: !selectedKey ? /* @__PURE__ */ jsx45("div", {}) : !type ? query.isLoading ? /* @__PURE__ */ jsx45("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx45("span", { className: "text-zinc-500", children: "Loading..." }) }) : /* @__PURE__ */ jsx45("div", {}) : !DATA_TYPES.includes(type) ? /* @__PURE__ */ jsx45("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxs25("span", { className: "text-zinc-500", children: [
|
|
7019
7024
|
"Unrecognized key type: ",
|
|
7020
7025
|
type
|
|
7021
7026
|
] }) }) : /* @__PURE__ */ jsx45(Fragment8, { children: SIMPLE_DATA_TYPES.includes(type) ? /* @__PURE__ */ jsx45(EditorDisplay, { dataKey: selectedKey, type }) : type === "search" ? /* @__PURE__ */ jsx45(SearchDisplay, { indexName: selectedKey }) : /* @__PURE__ */ jsx45(ListDisplay, { dataKey: selectedKey, type }) }) });
|
|
7022
7027
|
};
|
|
7023
7028
|
|
|
7024
7029
|
// src/components/databrowser/components/header/index.tsx
|
|
7025
|
-
import { useState as useState14 } from "react";
|
|
7030
|
+
import { useEffect as useEffect15, useState as useState14 } from "react";
|
|
7026
7031
|
import {
|
|
7027
7032
|
IconChevronDown as IconChevronDown2,
|
|
7028
7033
|
IconCircleCheck,
|
|
@@ -7186,7 +7191,7 @@ var EditIndexModal = ({
|
|
|
7186
7191
|
] }) });
|
|
7187
7192
|
};
|
|
7188
7193
|
|
|
7189
|
-
// src/components/databrowser/components/
|
|
7194
|
+
// src/components/databrowser/components/header/search-input.tsx
|
|
7190
7195
|
import { useEffect as useEffect14, useRef as useRef4, useState as useState13 } from "react";
|
|
7191
7196
|
import { IconX as IconX2 } from "@tabler/icons-react";
|
|
7192
7197
|
import { jsx as jsx50, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
@@ -7311,11 +7316,15 @@ var SearchInput = () => {
|
|
|
7311
7316
|
] });
|
|
7312
7317
|
};
|
|
7313
7318
|
|
|
7314
|
-
// src/components/databrowser/components/
|
|
7319
|
+
// src/components/databrowser/components/header/type-selector.tsx
|
|
7315
7320
|
import { jsx as jsx51, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
7316
7321
|
var ALL_TYPES_KEY = "all";
|
|
7317
|
-
function DataTypeSelector() {
|
|
7322
|
+
function DataTypeSelector({ allowSearch }) {
|
|
7318
7323
|
const { search, setSearchType } = useTab();
|
|
7324
|
+
const entries = [
|
|
7325
|
+
[ALL_TYPES_KEY, "All Types"],
|
|
7326
|
+
...Object.entries(DATA_TYPE_NAMES).filter(([key]) => allowSearch || key !== "search")
|
|
7327
|
+
];
|
|
7319
7328
|
return /* @__PURE__ */ jsxs30(
|
|
7320
7329
|
Select,
|
|
7321
7330
|
{
|
|
@@ -7329,13 +7338,7 @@ function DataTypeSelector() {
|
|
|
7329
7338
|
value: search.type === void 0 ? ALL_TYPES_KEY : search.type,
|
|
7330
7339
|
children: [
|
|
7331
7340
|
/* @__PURE__ */ jsx51(SelectTrigger, { className: "!w-auto shrink-0 select-none whitespace-nowrap border-zinc-300 pr-8", children: /* @__PURE__ */ jsx51(SelectValue, {}) }),
|
|
7332
|
-
/* @__PURE__ */ jsx51(SelectContent, { children: /* @__PURE__ */ jsx51(SelectGroup, { children: (() => {
|
|
7333
|
-
const entries = [
|
|
7334
|
-
[ALL_TYPES_KEY, "All Types"],
|
|
7335
|
-
...Object.entries(DATA_TYPE_NAMES)
|
|
7336
|
-
];
|
|
7337
|
-
return entries.map(([key, value]) => /* @__PURE__ */ jsx51(SelectItem, { value: key, children: value }, key));
|
|
7338
|
-
})() }) })
|
|
7341
|
+
/* @__PURE__ */ jsx51(SelectContent, { children: /* @__PURE__ */ jsx51(SelectGroup, { children: entries.map(([key, value]) => /* @__PURE__ */ jsx51(SelectItem, { value: key, children: value }, key)) }) })
|
|
7339
7342
|
]
|
|
7340
7343
|
}
|
|
7341
7344
|
);
|
|
@@ -7343,7 +7346,7 @@ function DataTypeSelector() {
|
|
|
7343
7346
|
|
|
7344
7347
|
// src/components/databrowser/components/header/index.tsx
|
|
7345
7348
|
import { Fragment as Fragment9, jsx as jsx52, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
7346
|
-
var Header = ({ tabType }) => {
|
|
7349
|
+
var Header = ({ tabType, allowSearch }) => {
|
|
7347
7350
|
const { isValuesSearchSelected, setIsValuesSearchSelected } = useTab();
|
|
7348
7351
|
return /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between gap-1.5", children: [
|
|
7349
7352
|
/* @__PURE__ */ jsxs31("div", { className: "flex grow items-center gap-1.5", children: [
|
|
@@ -7373,7 +7376,7 @@ var Header = ({ tabType }) => {
|
|
|
7373
7376
|
}
|
|
7374
7377
|
),
|
|
7375
7378
|
isValuesSearchSelected ? /* @__PURE__ */ jsx52(IndexSelector, {}) : /* @__PURE__ */ jsxs31(Fragment9, { children: [
|
|
7376
|
-
/* @__PURE__ */ jsx52(DataTypeSelector, {}),
|
|
7379
|
+
/* @__PURE__ */ jsx52(DataTypeSelector, { allowSearch }),
|
|
7377
7380
|
/* @__PURE__ */ jsx52(SearchInput, {})
|
|
7378
7381
|
] })
|
|
7379
7382
|
] }),
|
|
@@ -7388,8 +7391,14 @@ var IndexSelector = () => {
|
|
|
7388
7391
|
valuesSearch: { index },
|
|
7389
7392
|
setValuesSearchIndex
|
|
7390
7393
|
} = useTab();
|
|
7391
|
-
const { data: indexes } = useFetchSearchIndexes();
|
|
7394
|
+
const { data: indexes, isLoading } = useFetchSearchIndexes();
|
|
7392
7395
|
const [open, setOpen] = useState14(false);
|
|
7396
|
+
useEffect15(() => {
|
|
7397
|
+
if (!indexes || isLoading) return;
|
|
7398
|
+
if (index && !indexes.includes(index)) {
|
|
7399
|
+
setValuesSearchIndex("");
|
|
7400
|
+
}
|
|
7401
|
+
}, [indexes, index, isLoading, setValuesSearchIndex]);
|
|
7393
7402
|
const [search, setSearch] = useState14("");
|
|
7394
7403
|
const [editingIndex, setEditingIndex] = useState14(null);
|
|
7395
7404
|
const filteredIndexes = indexes?.filter((idx) => idx.toLowerCase().includes(search.toLowerCase()));
|
|
@@ -7559,6 +7568,9 @@ var HeaderError = () => {
|
|
|
7559
7568
|
return /* @__PURE__ */ jsx53("p", { className: "text-sm text-red-600 dark:text-red-400", children: formatUpstashErrorMessage(query.error) });
|
|
7560
7569
|
};
|
|
7561
7570
|
|
|
7571
|
+
// src/components/databrowser/components/query-builder.tsx
|
|
7572
|
+
import { IconExternalLink as IconExternalLink2 } from "@tabler/icons-react";
|
|
7573
|
+
|
|
7562
7574
|
// src/components/databrowser/components/search/query-editor.tsx
|
|
7563
7575
|
import { useMemo as useMemo9 } from "react";
|
|
7564
7576
|
|
|
@@ -8186,31 +8198,46 @@ var QueryEditor = ({ value, onChange, height, schema }) => {
|
|
|
8186
8198
|
};
|
|
8187
8199
|
|
|
8188
8200
|
// src/components/databrowser/components/query-builder.tsx
|
|
8189
|
-
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
8201
|
+
import { jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
8190
8202
|
var QueryBuilder = () => {
|
|
8191
8203
|
const { valuesSearch, setValuesSearchQuery } = useTab();
|
|
8192
8204
|
const { data: indexDetails } = useFetchSearchIndex(valuesSearch.index);
|
|
8193
8205
|
const editorValue = PREFIX + (valuesSearch.query || "{}");
|
|
8194
|
-
return /* @__PURE__ */
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8206
|
+
return /* @__PURE__ */ jsxs32("div", { className: "flex h-full flex-col rounded-lg border border-zinc-300 bg-white px-[6px]", children: [
|
|
8207
|
+
/* @__PURE__ */ jsx55("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx55(
|
|
8208
|
+
QueryEditor,
|
|
8209
|
+
{
|
|
8210
|
+
value: editorValue,
|
|
8211
|
+
onChange: (value) => {
|
|
8212
|
+
const queryPart = value.slice(PREFIX.length);
|
|
8213
|
+
setValuesSearchQuery(queryPart);
|
|
8214
|
+
},
|
|
8215
|
+
schema: indexDetails
|
|
8216
|
+
}
|
|
8217
|
+
) }),
|
|
8218
|
+
/* @__PURE__ */ jsx55("div", { className: "flex items-center justify-end px-2 pb-1.5", children: /* @__PURE__ */ jsxs32(
|
|
8219
|
+
"a",
|
|
8220
|
+
{
|
|
8221
|
+
href: "https://upstash-search.mintlify.app/redis/search/query-operators/boolean-operators/overview",
|
|
8222
|
+
target: "_blank",
|
|
8223
|
+
rel: "noopener noreferrer",
|
|
8224
|
+
className: "flex items-center gap-1 text-xs text-zinc-400 transition-colors hover:text-zinc-600",
|
|
8225
|
+
children: [
|
|
8226
|
+
"Docs",
|
|
8227
|
+
/* @__PURE__ */ jsx55(IconExternalLink2, { size: 12 })
|
|
8228
|
+
]
|
|
8229
|
+
}
|
|
8230
|
+
) })
|
|
8231
|
+
] });
|
|
8205
8232
|
};
|
|
8206
8233
|
|
|
8207
8234
|
// src/components/databrowser/components/search-empty-state.tsx
|
|
8208
8235
|
import { useState as useState16 } from "react";
|
|
8209
|
-
import { IconCode, IconDatabase,
|
|
8236
|
+
import { IconCode, IconDatabase, IconSearch as IconSearch3, IconSparkles } from "@tabler/icons-react";
|
|
8210
8237
|
|
|
8211
8238
|
// src/components/databrowser/components/import-sample-dataset-modal.tsx
|
|
8212
|
-
import { useEffect as
|
|
8213
|
-
import { Fragment as Fragment10, jsx as jsx56, jsxs as
|
|
8239
|
+
import { useEffect as useEffect16, useState as useState15 } from "react";
|
|
8240
|
+
import { Fragment as Fragment10, jsx as jsx56, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
8214
8241
|
var INDEX_NAME = "users-index";
|
|
8215
8242
|
var USER_COUNT = 100;
|
|
8216
8243
|
var firstNames = [
|
|
@@ -8347,7 +8374,7 @@ var ImportSampleDatasetModal = ({
|
|
|
8347
8374
|
const [status, setStatus] = useState15();
|
|
8348
8375
|
const [progress, setProgress] = useState15(0);
|
|
8349
8376
|
const [error, setError] = useState15();
|
|
8350
|
-
|
|
8377
|
+
useEffect16(() => {
|
|
8351
8378
|
if (!open) return;
|
|
8352
8379
|
setProgress(0);
|
|
8353
8380
|
setStatus(void 0);
|
|
@@ -8412,7 +8439,7 @@ var ImportSampleDatasetModal = ({
|
|
|
8412
8439
|
onOpenChange: (isOpen) => {
|
|
8413
8440
|
if (!isRunning) onOpenChange(isOpen);
|
|
8414
8441
|
},
|
|
8415
|
-
children: /* @__PURE__ */
|
|
8442
|
+
children: /* @__PURE__ */ jsxs33(
|
|
8416
8443
|
DialogContent,
|
|
8417
8444
|
{
|
|
8418
8445
|
onInteractOutside: (e) => {
|
|
@@ -8422,9 +8449,9 @@ var ImportSampleDatasetModal = ({
|
|
|
8422
8449
|
if (isRunning) e.preventDefault();
|
|
8423
8450
|
},
|
|
8424
8451
|
children: [
|
|
8425
|
-
/* @__PURE__ */
|
|
8452
|
+
/* @__PURE__ */ jsxs33(DialogHeader, { children: [
|
|
8426
8453
|
/* @__PURE__ */ jsx56(DialogTitle, { children: "Import Sample Dataset" }),
|
|
8427
|
-
!isRunning && !error && /* @__PURE__ */
|
|
8454
|
+
!isRunning && !error && /* @__PURE__ */ jsxs33(DialogDescription, { children: [
|
|
8428
8455
|
"This will create a ",
|
|
8429
8456
|
/* @__PURE__ */ jsx56("strong", { children: "users-index" }),
|
|
8430
8457
|
" with 100 sample user records.",
|
|
@@ -8433,13 +8460,13 @@ var ImportSampleDatasetModal = ({
|
|
|
8433
8460
|
"Each user has name, age, gender, student/employment status, and contact information."
|
|
8434
8461
|
] })
|
|
8435
8462
|
] }),
|
|
8436
|
-
isRunning && /* @__PURE__ */
|
|
8463
|
+
isRunning && /* @__PURE__ */ jsxs33("div", { className: "flex flex-col gap-2 py-4", children: [
|
|
8437
8464
|
/* @__PURE__ */ jsx56("p", { className: "text-sm text-zinc-500", children: status }),
|
|
8438
8465
|
/* @__PURE__ */ jsx56(Progress, { value: progress })
|
|
8439
8466
|
] }),
|
|
8440
8467
|
error && /* @__PURE__ */ jsx56("div", { className: "w-full break-words text-sm text-red-500", children: formatUpstashErrorMessage(error) }),
|
|
8441
|
-
/* @__PURE__ */
|
|
8442
|
-
!isRunning && !error && /* @__PURE__ */
|
|
8468
|
+
/* @__PURE__ */ jsxs33(DialogFooter, { children: [
|
|
8469
|
+
!isRunning && !error && /* @__PURE__ */ jsxs33(Fragment10, { children: [
|
|
8443
8470
|
/* @__PURE__ */ jsx56(Button, { onClick: () => onOpenChange(false), children: "Cancel" }),
|
|
8444
8471
|
/* @__PURE__ */ jsx56(Button, { variant: "primary", onClick: handleImport, children: "Import" })
|
|
8445
8472
|
] }),
|
|
@@ -8453,73 +8480,71 @@ var ImportSampleDatasetModal = ({
|
|
|
8453
8480
|
};
|
|
8454
8481
|
|
|
8455
8482
|
// src/components/databrowser/components/search-empty-state.tsx
|
|
8456
|
-
import { jsx as jsx57, jsxs as
|
|
8483
|
+
import { jsx as jsx57, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
8457
8484
|
var SearchEmptyState = () => {
|
|
8458
8485
|
const [importModalOpen, setImportModalOpen] = useState16(false);
|
|
8459
|
-
return /* @__PURE__ */
|
|
8460
|
-
/* @__PURE__ */
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
|
|
8486
|
-
] })
|
|
8486
|
+
return /* @__PURE__ */ jsxs34("div", { className: "mx-auto flex h-full max-w-4xl gap-8 rounded-xl border border-zinc-200 bg-gradient-to-b from-zinc-50 to-white p-8", children: [
|
|
8487
|
+
/* @__PURE__ */ jsx57(ImportSampleDatasetModal, { open: importModalOpen, onOpenChange: setImportModalOpen }),
|
|
8488
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex-1", children: [
|
|
8489
|
+
/* @__PURE__ */ jsx57("h2", { className: "mb-2 text-lg font-semibold text-zinc-900", children: "Redis Search" }),
|
|
8490
|
+
/* @__PURE__ */ jsx57("p", { className: "mb-6 max-w-md text-sm leading-relaxed text-zinc-600", children: "Redis Search allows you to create indexes on your existing keys and perform fast, full-text searches across your data." }),
|
|
8491
|
+
/* @__PURE__ */ jsxs34("div", { className: "space-y-3", children: [
|
|
8492
|
+
/* @__PURE__ */ jsx57("h3", { className: "text-xs font-medium uppercase tracking-wider text-zinc-400", children: "How it works" }),
|
|
8493
|
+
/* @__PURE__ */ jsxs34("div", { className: "space-y-2.5", children: [
|
|
8494
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-start gap-3", children: [
|
|
8495
|
+
/* @__PURE__ */ jsx57("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-emerald-100 text-emerald-600", children: /* @__PURE__ */ jsx57(IconDatabase, { size: 16 }) }),
|
|
8496
|
+
/* @__PURE__ */ jsxs34("div", { children: [
|
|
8497
|
+
/* @__PURE__ */ jsx57("h4", { className: "text-sm font-medium text-zinc-900", children: "Store your data" }),
|
|
8498
|
+
/* @__PURE__ */ jsx57("p", { className: "text-sm text-zinc-500", children: "Add documents as JSON, Hash, or String keys (string content must be valid JSON)." })
|
|
8499
|
+
] })
|
|
8500
|
+
] }),
|
|
8501
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-start gap-3", children: [
|
|
8502
|
+
/* @__PURE__ */ jsx57("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-emerald-100 text-emerald-600", children: /* @__PURE__ */ jsx57(IconCode, { size: 16 }) }),
|
|
8503
|
+
/* @__PURE__ */ jsxs34("div", { children: [
|
|
8504
|
+
/* @__PURE__ */ jsx57("h4", { className: "text-sm font-medium text-zinc-900", children: "Create an index" }),
|
|
8505
|
+
/* @__PURE__ */ jsx57("p", { className: "text-sm text-zinc-500", children: "Define a search index specifying which fields to search on." })
|
|
8506
|
+
] })
|
|
8507
|
+
] }),
|
|
8508
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex items-start gap-3", children: [
|
|
8509
|
+
/* @__PURE__ */ jsx57("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-emerald-100 text-emerald-600", children: /* @__PURE__ */ jsx57(IconSearch3, { size: 16 }) }),
|
|
8510
|
+
/* @__PURE__ */ jsxs34("div", { children: [
|
|
8511
|
+
/* @__PURE__ */ jsx57("h4", { className: "text-sm font-medium text-zinc-900", children: "Search your data" }),
|
|
8512
|
+
/* @__PURE__ */ jsx57("p", { className: "text-sm text-zinc-500", children: "Query with filters, full-text search, and sorted results." })
|
|
8487
8513
|
] })
|
|
8488
8514
|
] })
|
|
8489
|
-
] })
|
|
8490
|
-
/* @__PURE__ */ jsx57(
|
|
8491
|
-
"a",
|
|
8492
|
-
{
|
|
8493
|
-
href: "https://upstash-search.mintlify.app/redis/search/introduction",
|
|
8494
|
-
target: "_blank",
|
|
8495
|
-
rel: "noopener noreferrer",
|
|
8496
|
-
className: "mt-5 inline-block text-sm text-emerald-600 underline-offset-2 hover:underline",
|
|
8497
|
-
children: "Learn more \u2192"
|
|
8498
|
-
}
|
|
8499
|
-
)
|
|
8515
|
+
] })
|
|
8500
8516
|
] }),
|
|
8501
|
-
/* @__PURE__ */
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
"
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
|
|
8511
|
-
}
|
|
8512
|
-
)
|
|
8513
|
-
] })
|
|
8517
|
+
/* @__PURE__ */ jsx57(
|
|
8518
|
+
"a",
|
|
8519
|
+
{
|
|
8520
|
+
href: "https://upstash-search.mintlify.app/redis/search/introduction",
|
|
8521
|
+
target: "_blank",
|
|
8522
|
+
rel: "noopener noreferrer",
|
|
8523
|
+
className: "mt-5 inline-block text-sm text-emerald-600 underline-offset-2 hover:underline",
|
|
8524
|
+
children: "Learn more \u2192"
|
|
8525
|
+
}
|
|
8526
|
+
)
|
|
8514
8527
|
] }),
|
|
8515
|
-
/* @__PURE__ */
|
|
8528
|
+
/* @__PURE__ */ jsxs34("div", { className: "flex w-72 flex-col items-center justify-center rounded-lg border bg-gradient-to-b from-zinc-50 to-white p-6 shadow-sm", children: [
|
|
8529
|
+
/* @__PURE__ */ jsx57("div", { className: "mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-emerald-100 text-emerald-600", children: /* @__PURE__ */ jsx57(IconSparkles, { size: 24 }) }),
|
|
8530
|
+
/* @__PURE__ */ jsx57("h3", { className: "mb-1 text-sm font-medium text-zinc-900", children: "Try it out" }),
|
|
8531
|
+
/* @__PURE__ */ jsx57("p", { className: "mb-4 text-center text-xs text-zinc-500", children: "Load a sample dataset to explore Redis Search" }),
|
|
8532
|
+
/* @__PURE__ */ jsx57(
|
|
8533
|
+
"button",
|
|
8534
|
+
{
|
|
8535
|
+
onClick: () => setImportModalOpen(true),
|
|
8536
|
+
className: "rounded-lg bg-emerald-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-emerald-700",
|
|
8537
|
+
children: "Load sample data"
|
|
8538
|
+
}
|
|
8539
|
+
)
|
|
8540
|
+
] })
|
|
8516
8541
|
] });
|
|
8517
8542
|
};
|
|
8518
8543
|
|
|
8519
8544
|
// src/components/databrowser/components/sidebar/empty.tsx
|
|
8520
|
-
import { jsx as jsx58, jsxs as
|
|
8545
|
+
import { jsx as jsx58, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
8521
8546
|
var Empty = () => {
|
|
8522
|
-
return /* @__PURE__ */ jsx58("div", { className: "flex h-full w-full items-center justify-center rounded-md border bg-white px-4 py-6 text-center", children: /* @__PURE__ */
|
|
8547
|
+
return /* @__PURE__ */ jsx58("div", { className: "flex h-full w-full items-center justify-center rounded-md border bg-white px-4 py-6 text-center", children: /* @__PURE__ */ jsxs35("div", { className: "space-y-5", children: [
|
|
8523
8548
|
/* @__PURE__ */ jsx58("p", { className: "text-md font-medium", children: "Data on a break" }),
|
|
8524
8549
|
/* @__PURE__ */ jsx58("p", { className: "text-balance text-center", children: '"Quick, lure it back with some CLI magic!"' })
|
|
8525
8550
|
] }) });
|
|
@@ -8532,8 +8557,8 @@ import { IconChevronRight as IconChevronRight3 } from "@tabler/icons-react";
|
|
|
8532
8557
|
// src/components/databrowser/components/sidebar-context-menu.tsx
|
|
8533
8558
|
import { useState as useState17 } from "react";
|
|
8534
8559
|
import { ContextMenuSeparator as ContextMenuSeparator3 } from "@radix-ui/react-context-menu";
|
|
8535
|
-
import { IconCopy as IconCopy3, IconExternalLink as
|
|
8536
|
-
import { Fragment as Fragment11, jsx as jsx59, jsxs as
|
|
8560
|
+
import { IconCopy as IconCopy3, IconExternalLink as IconExternalLink3, IconTrash as IconTrash3 } from "@tabler/icons-react";
|
|
8561
|
+
import { Fragment as Fragment11, jsx as jsx59, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
8537
8562
|
var SidebarContextMenu = ({ children }) => {
|
|
8538
8563
|
const { mutate: deleteKey } = useDeleteKey();
|
|
8539
8564
|
const [isAlertOpen, setAlertOpen] = useState17(false);
|
|
@@ -8545,7 +8570,7 @@ var SidebarContextMenu = ({ children }) => {
|
|
|
8545
8570
|
setSearch
|
|
8546
8571
|
} = useDatabrowserStore();
|
|
8547
8572
|
const { search: currentSearch, selectedKeys } = useTab();
|
|
8548
|
-
return /* @__PURE__ */
|
|
8573
|
+
return /* @__PURE__ */ jsxs36(Fragment11, { children: [
|
|
8549
8574
|
/* @__PURE__ */ jsx59(
|
|
8550
8575
|
DeleteKeyModal,
|
|
8551
8576
|
{
|
|
@@ -8562,7 +8587,7 @@ var SidebarContextMenu = ({ children }) => {
|
|
|
8562
8587
|
}
|
|
8563
8588
|
}
|
|
8564
8589
|
),
|
|
8565
|
-
/* @__PURE__ */
|
|
8590
|
+
/* @__PURE__ */ jsxs36(ContextMenu, { modal: false, children: [
|
|
8566
8591
|
/* @__PURE__ */ jsx59(
|
|
8567
8592
|
ContextMenuTrigger,
|
|
8568
8593
|
{
|
|
@@ -8583,8 +8608,8 @@ var SidebarContextMenu = ({ children }) => {
|
|
|
8583
8608
|
children
|
|
8584
8609
|
}
|
|
8585
8610
|
),
|
|
8586
|
-
/* @__PURE__ */
|
|
8587
|
-
/* @__PURE__ */
|
|
8611
|
+
/* @__PURE__ */ jsxs36(ContextMenuContent, { children: [
|
|
8612
|
+
/* @__PURE__ */ jsxs36(
|
|
8588
8613
|
ContextMenuItem,
|
|
8589
8614
|
{
|
|
8590
8615
|
onClick: () => {
|
|
@@ -8601,7 +8626,7 @@ var SidebarContextMenu = ({ children }) => {
|
|
|
8601
8626
|
]
|
|
8602
8627
|
}
|
|
8603
8628
|
),
|
|
8604
|
-
/* @__PURE__ */
|
|
8629
|
+
/* @__PURE__ */ jsxs36(
|
|
8605
8630
|
ContextMenuItem,
|
|
8606
8631
|
{
|
|
8607
8632
|
onClick: () => {
|
|
@@ -8613,13 +8638,13 @@ var SidebarContextMenu = ({ children }) => {
|
|
|
8613
8638
|
className: "gap-2",
|
|
8614
8639
|
disabled: contextKeys.length !== 1,
|
|
8615
8640
|
children: [
|
|
8616
|
-
/* @__PURE__ */ jsx59(
|
|
8641
|
+
/* @__PURE__ */ jsx59(IconExternalLink3, { size: 16 }),
|
|
8617
8642
|
"Open in new tab"
|
|
8618
8643
|
]
|
|
8619
8644
|
}
|
|
8620
8645
|
),
|
|
8621
8646
|
/* @__PURE__ */ jsx59(ContextMenuSeparator3, {}),
|
|
8622
|
-
/* @__PURE__ */
|
|
8647
|
+
/* @__PURE__ */ jsxs36(ContextMenuItem, { onClick: () => setAlertOpen(true), className: "gap-2", children: [
|
|
8623
8648
|
/* @__PURE__ */ jsx59(IconTrash3, { size: 16 }),
|
|
8624
8649
|
contextKeys.length > 1 ? `Delete ${contextKeys.length} keys` : "Delete key"
|
|
8625
8650
|
] })
|
|
@@ -8629,13 +8654,13 @@ var SidebarContextMenu = ({ children }) => {
|
|
|
8629
8654
|
};
|
|
8630
8655
|
|
|
8631
8656
|
// src/components/databrowser/components/sidebar/keys-list.tsx
|
|
8632
|
-
import { Fragment as Fragment13, jsx as jsx60, jsxs as
|
|
8657
|
+
import { Fragment as Fragment13, jsx as jsx60, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
8633
8658
|
var KeysList = () => {
|
|
8634
8659
|
const { keys } = useKeys();
|
|
8635
8660
|
const lastClickedIndexRef = useRef5(null);
|
|
8636
|
-
return /* @__PURE__ */ jsx60(SidebarContextMenu, { children: /* @__PURE__ */
|
|
8661
|
+
return /* @__PURE__ */ jsx60(SidebarContextMenu, { children: /* @__PURE__ */ jsxs37(Fragment13, { children: [
|
|
8637
8662
|
/* @__PURE__ */ jsx60("div", { className: "h-px" }),
|
|
8638
|
-
keys.map((data, i) => /* @__PURE__ */
|
|
8663
|
+
keys.map((data, i) => /* @__PURE__ */ jsxs37(Fragment12, { children: [
|
|
8639
8664
|
/* @__PURE__ */ jsx60(
|
|
8640
8665
|
KeyItem,
|
|
8641
8666
|
{
|
|
@@ -8645,7 +8670,7 @@ var KeysList = () => {
|
|
|
8645
8670
|
lastClickedIndexRef
|
|
8646
8671
|
}
|
|
8647
8672
|
),
|
|
8648
|
-
i !== keys.length - 1 && /* @__PURE__ */ jsx60("div", { className: "-z-10 mx-[13px] h-px bg-zinc-200 dark:bg-zinc-
|
|
8673
|
+
i !== keys.length - 1 && /* @__PURE__ */ jsx60("div", { className: "-z-10 mx-[13px] h-px bg-zinc-200 dark:bg-zinc-300" })
|
|
8649
8674
|
] }, data[0]))
|
|
8650
8675
|
] }) });
|
|
8651
8676
|
};
|
|
@@ -8687,7 +8712,7 @@ var KeyItem = ({
|
|
|
8687
8712
|
lastClickedIndexRef.current = index;
|
|
8688
8713
|
}
|
|
8689
8714
|
};
|
|
8690
|
-
return /* @__PURE__ */
|
|
8715
|
+
return /* @__PURE__ */ jsxs37(
|
|
8691
8716
|
"button",
|
|
8692
8717
|
{
|
|
8693
8718
|
"data-key": dataKey,
|
|
@@ -8709,9 +8734,9 @@ var KeyItem = ({
|
|
|
8709
8734
|
};
|
|
8710
8735
|
|
|
8711
8736
|
// src/components/databrowser/components/sidebar/skeleton-buttons.tsx
|
|
8712
|
-
import { jsx as jsx61, jsxs as
|
|
8737
|
+
import { jsx as jsx61, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
8713
8738
|
var DEFAULT_SKELETON_COUNT = 6;
|
|
8714
|
-
var LoadingSkeleton = () => /* @__PURE__ */ jsx61("div", { className: "block h-full w-full rounded-lg bg-zinc-100 p-1 pr-3 transition-all", children: Array.from({ length: DEFAULT_SKELETON_COUNT }).fill(0).map((_, idx) => /* @__PURE__ */
|
|
8739
|
+
var LoadingSkeleton = () => /* @__PURE__ */ jsx61("div", { className: "block h-full w-full rounded-lg bg-zinc-100 p-1 pr-3 transition-all", children: Array.from({ length: DEFAULT_SKELETON_COUNT }).fill(0).map((_, idx) => /* @__PURE__ */ jsxs38("div", { className: "flex h-10 items-center gap-2 px-3", children: [
|
|
8715
8740
|
/* @__PURE__ */ jsx61(Skeleton, { className: "size-5 shrink-0 rounded" }),
|
|
8716
8741
|
/* @__PURE__ */ jsx61(Skeleton, { className: "h-4 grow rounded" })
|
|
8717
8742
|
] }, idx)) });
|
|
@@ -8727,7 +8752,7 @@ function Sidebar() {
|
|
|
8727
8752
|
{
|
|
8728
8753
|
query,
|
|
8729
8754
|
disableRoundedInherit: true,
|
|
8730
|
-
className: "min-h-0 rounded-xl bg-zinc-100 px-2 py-5 pr-4",
|
|
8755
|
+
className: "min-h-0 rounded-xl bg-zinc-100 px-2 py-5 pr-4 dark:bg-zinc-200",
|
|
8731
8756
|
scrollBarClassName: "py-5",
|
|
8732
8757
|
children: /* @__PURE__ */ jsx62(KeysList, {})
|
|
8733
8758
|
}
|
|
@@ -8736,7 +8761,7 @@ function Sidebar() {
|
|
|
8736
8761
|
}
|
|
8737
8762
|
|
|
8738
8763
|
// src/components/databrowser/components/ui-query-builder/ui-query-builder.tsx
|
|
8739
|
-
import { useCallback as useCallback4, useEffect as
|
|
8764
|
+
import { useCallback as useCallback4, useEffect as useEffect19, useRef as useRef8, useState as useState24 } from "react";
|
|
8740
8765
|
|
|
8741
8766
|
// src/components/databrowser/components/ui-query-builder/query-builder-context.tsx
|
|
8742
8767
|
import { createContext as createContext6, useCallback as useCallback2, useContext as useContext6, useMemo as useMemo10 } from "react";
|
|
@@ -9270,7 +9295,7 @@ var DynamicWidthInput = ({
|
|
|
9270
9295
|
};
|
|
9271
9296
|
|
|
9272
9297
|
// src/components/databrowser/components/ui-query-builder/condition-common.tsx
|
|
9273
|
-
import { jsx as jsx65, jsxs as
|
|
9298
|
+
import { jsx as jsx65, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
9274
9299
|
var BoostBadge = ({
|
|
9275
9300
|
node,
|
|
9276
9301
|
static: isStatic
|
|
@@ -9299,7 +9324,7 @@ var BoostBadge = ({
|
|
|
9299
9324
|
const isNegative = (node.boost ?? 0) < 0;
|
|
9300
9325
|
const labelBg = isNegative ? "bg-red-50" : "bg-purple-50";
|
|
9301
9326
|
const textColor = isNegative ? "text-red-800" : "text-purple-800";
|
|
9302
|
-
return /* @__PURE__ */
|
|
9327
|
+
return /* @__PURE__ */ jsxs39("span", { className: "relative flex h-[26px] items-center overflow-hidden rounded-md border border-zinc-300 text-sm font-medium", children: [
|
|
9303
9328
|
/* @__PURE__ */ jsx65("span", { className: `flex h-full items-center px-2 ${labelBg} ${textColor}`, children: isNegative ? "Demote" : "Boost" }),
|
|
9304
9329
|
isStatic ? /* @__PURE__ */ jsx65("span", { className: `px-2 ${textColor}`, children: node.boost }) : /* @__PURE__ */ jsx65("span", { className: "flex h-full items-center bg-white px-2", children: /* @__PURE__ */ jsx65(
|
|
9305
9330
|
DynamicWidthInput,
|
|
@@ -9324,7 +9349,7 @@ var NodeActionsMenu = ({ node }) => {
|
|
|
9324
9349
|
const handleToggleNot = () => {
|
|
9325
9350
|
updateNode(node.id, { not: !node.not });
|
|
9326
9351
|
};
|
|
9327
|
-
return /* @__PURE__ */
|
|
9352
|
+
return /* @__PURE__ */ jsxs39(DropdownMenu, { open, onOpenChange: setOpen, children: [
|
|
9328
9353
|
/* @__PURE__ */ jsx65(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx65(
|
|
9329
9354
|
"button",
|
|
9330
9355
|
{
|
|
@@ -9333,8 +9358,8 @@ var NodeActionsMenu = ({ node }) => {
|
|
|
9333
9358
|
children: /* @__PURE__ */ jsx65(IconDots, { size: 16 })
|
|
9334
9359
|
}
|
|
9335
9360
|
) }),
|
|
9336
|
-
/* @__PURE__ */
|
|
9337
|
-
/* @__PURE__ */ jsx65(DropdownMenuItem, { onClick: handleToggleBoost, children: /* @__PURE__ */
|
|
9361
|
+
/* @__PURE__ */ jsxs39(DropdownMenuContent, { align: "end", children: [
|
|
9362
|
+
/* @__PURE__ */ jsx65(DropdownMenuItem, { onClick: handleToggleBoost, children: /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2", children: [
|
|
9338
9363
|
/* @__PURE__ */ jsx65(
|
|
9339
9364
|
"div",
|
|
9340
9365
|
{
|
|
@@ -9349,7 +9374,7 @@ var NodeActionsMenu = ({ node }) => {
|
|
|
9349
9374
|
),
|
|
9350
9375
|
/* @__PURE__ */ jsx65("span", { children: "Boost" })
|
|
9351
9376
|
] }) }),
|
|
9352
|
-
/* @__PURE__ */ jsx65(DropdownMenuItem, { onClick: handleToggleNot, children: /* @__PURE__ */
|
|
9377
|
+
/* @__PURE__ */ jsx65(DropdownMenuItem, { onClick: handleToggleNot, children: /* @__PURE__ */ jsxs39("div", { className: "flex items-center gap-2", children: [
|
|
9353
9378
|
/* @__PURE__ */ jsx65(
|
|
9354
9379
|
"div",
|
|
9355
9380
|
{
|
|
@@ -9383,9 +9408,9 @@ import { DragOverlay as DndKitDragOverlay } from "@dnd-kit/core";
|
|
|
9383
9408
|
import { IconGripVertical as IconGripVertical2 } from "@tabler/icons-react";
|
|
9384
9409
|
|
|
9385
9410
|
// src/components/databrowser/components/ui-query-builder/query-condition.tsx
|
|
9386
|
-
import { useEffect as
|
|
9411
|
+
import { useEffect as useEffect17, useState as useState20 } from "react";
|
|
9387
9412
|
import { IconGripVertical, IconX as IconX3 } from "@tabler/icons-react";
|
|
9388
|
-
import { Fragment as Fragment14, jsx as jsx66, jsxs as
|
|
9413
|
+
import { Fragment as Fragment14, jsx as jsx66, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
9389
9414
|
var formatValueForDisplay = (value) => {
|
|
9390
9415
|
if (Array.isArray(value)) {
|
|
9391
9416
|
return value.join(", ");
|
|
@@ -9436,7 +9461,7 @@ var QueryCondition = ({
|
|
|
9436
9461
|
return void 0;
|
|
9437
9462
|
};
|
|
9438
9463
|
const valueTypeError = getValueTypeError();
|
|
9439
|
-
|
|
9464
|
+
useEffect17(() => {
|
|
9440
9465
|
if (currentFieldType === "boolean") {
|
|
9441
9466
|
if (condition.value === "true") {
|
|
9442
9467
|
updateNode(node.id, {
|
|
@@ -9606,7 +9631,7 @@ var QueryCondition = ({
|
|
|
9606
9631
|
const filteredOperators = OPERATOR_OPTIONS.filter((op) => allowedOperators.includes(op.value));
|
|
9607
9632
|
const isInvalidOperator = !isUnknownField && currentFieldType !== "unknown" && !allowedOperators.includes(condition.operator);
|
|
9608
9633
|
const operatorError = isInvalidOperator ? `"${condition.operator}" is not valid for ${currentFieldType} fields` : void 0;
|
|
9609
|
-
return /* @__PURE__ */
|
|
9634
|
+
return /* @__PURE__ */ jsxs40("div", { className: "group/condition flex items-center gap-1 px-1", children: [
|
|
9610
9635
|
/* @__PURE__ */ jsx66(
|
|
9611
9636
|
"div",
|
|
9612
9637
|
{
|
|
@@ -9617,8 +9642,8 @@ var QueryCondition = ({
|
|
|
9617
9642
|
children: /* @__PURE__ */ jsx66(IconGripVertical, { size: 16 })
|
|
9618
9643
|
}
|
|
9619
9644
|
),
|
|
9620
|
-
/* @__PURE__ */
|
|
9621
|
-
/* @__PURE__ */
|
|
9645
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex", children: [
|
|
9646
|
+
/* @__PURE__ */ jsxs40(Select, { value: condition.field, onValueChange: handleFieldChange, children: [
|
|
9622
9647
|
/* @__PURE__ */ jsx66(
|
|
9623
9648
|
SimpleTooltip,
|
|
9624
9649
|
{
|
|
@@ -9633,12 +9658,12 @@ var QueryCondition = ({
|
|
|
9633
9658
|
)
|
|
9634
9659
|
}
|
|
9635
9660
|
),
|
|
9636
|
-
/* @__PURE__ */
|
|
9661
|
+
/* @__PURE__ */ jsxs40(SelectContent, { children: [
|
|
9637
9662
|
isUnknownField && /* @__PURE__ */ jsx66(SelectItem, { value: condition.field, className: "text-red-500", children: condition.field }, condition.field),
|
|
9638
9663
|
fieldNames.length > 0 ? fieldNames.map((field) => /* @__PURE__ */ jsx66(SelectItem, { value: field, children: field }, field)) : !isUnknownField && /* @__PURE__ */ jsx66("div", { className: "px-2 py-1.5 text-sm text-zinc-500", children: "No fields available" })
|
|
9639
9664
|
] })
|
|
9640
9665
|
] }),
|
|
9641
|
-
/* @__PURE__ */
|
|
9666
|
+
/* @__PURE__ */ jsxs40(Select, { value: condition.operator, onValueChange: handleOperatorChange, children: [
|
|
9642
9667
|
/* @__PURE__ */ jsx66(SimpleTooltip, { content: operatorError || valueTypeError, variant: "error", children: /* @__PURE__ */ jsx66(
|
|
9643
9668
|
SelectTrigger,
|
|
9644
9669
|
{
|
|
@@ -9646,7 +9671,7 @@ var QueryCondition = ({
|
|
|
9646
9671
|
children: /* @__PURE__ */ jsx66(SelectValue, {})
|
|
9647
9672
|
}
|
|
9648
9673
|
) }),
|
|
9649
|
-
/* @__PURE__ */
|
|
9674
|
+
/* @__PURE__ */ jsxs40(SelectContent, { children: [
|
|
9650
9675
|
isInvalidOperator && /* @__PURE__ */ jsx66(
|
|
9651
9676
|
SelectItem,
|
|
9652
9677
|
{
|
|
@@ -9659,8 +9684,8 @@ var QueryCondition = ({
|
|
|
9659
9684
|
filteredOperators.map((op) => /* @__PURE__ */ jsx66(SelectItem, { value: op.value, children: op.label }, op.value))
|
|
9660
9685
|
] })
|
|
9661
9686
|
] }),
|
|
9662
|
-
currentFieldType === "boolean" && condition.operator === "in" ? /* @__PURE__ */
|
|
9663
|
-
/* @__PURE__ */
|
|
9687
|
+
currentFieldType === "boolean" && condition.operator === "in" ? /* @__PURE__ */ jsxs40("div", { className: "flex h-[26px] items-center gap-2 rounded-none rounded-r-md border border-zinc-200 bg-white px-2 text-sm", children: [
|
|
9688
|
+
/* @__PURE__ */ jsxs40("label", { className: "flex items-center gap-1", children: [
|
|
9664
9689
|
/* @__PURE__ */ jsx66(
|
|
9665
9690
|
"input",
|
|
9666
9691
|
{
|
|
@@ -9679,7 +9704,7 @@ var QueryCondition = ({
|
|
|
9679
9704
|
),
|
|
9680
9705
|
/* @__PURE__ */ jsx66("span", { children: "true" })
|
|
9681
9706
|
] }),
|
|
9682
|
-
/* @__PURE__ */
|
|
9707
|
+
/* @__PURE__ */ jsxs40("label", { className: "flex items-center gap-1", children: [
|
|
9683
9708
|
/* @__PURE__ */ jsx66(
|
|
9684
9709
|
"input",
|
|
9685
9710
|
{
|
|
@@ -9698,7 +9723,7 @@ var QueryCondition = ({
|
|
|
9698
9723
|
),
|
|
9699
9724
|
/* @__PURE__ */ jsx66("span", { children: "false" })
|
|
9700
9725
|
] })
|
|
9701
|
-
] }) : currentFieldType === "boolean" ? /* @__PURE__ */
|
|
9726
|
+
] }) : currentFieldType === "boolean" ? /* @__PURE__ */ jsxs40(
|
|
9702
9727
|
Select,
|
|
9703
9728
|
{
|
|
9704
9729
|
value: condition.value === true || condition.value === "true" ? "true" : condition.value === false || condition.value === "false" ? "false" : "true",
|
|
@@ -9711,7 +9736,7 @@ var QueryCondition = ({
|
|
|
9711
9736
|
},
|
|
9712
9737
|
children: [
|
|
9713
9738
|
/* @__PURE__ */ jsx66(SelectTrigger, { className: "h-[26px] w-20 gap-3 rounded-none rounded-r-md border border-zinc-200 bg-white px-2 text-sm font-normal", children: /* @__PURE__ */ jsx66(SelectValue, {}) }),
|
|
9714
|
-
/* @__PURE__ */
|
|
9739
|
+
/* @__PURE__ */ jsxs40(SelectContent, { children: [
|
|
9715
9740
|
/* @__PURE__ */ jsx66(SelectItem, { value: "true", children: "true" }),
|
|
9716
9741
|
/* @__PURE__ */ jsx66(SelectItem, { value: "false", children: "false" })
|
|
9717
9742
|
] })
|
|
@@ -9730,24 +9755,24 @@ var QueryCondition = ({
|
|
|
9730
9755
|
}
|
|
9731
9756
|
)
|
|
9732
9757
|
] }),
|
|
9733
|
-
condition.operator === "fuzzy" && /* @__PURE__ */
|
|
9758
|
+
condition.operator === "fuzzy" && /* @__PURE__ */ jsxs40(
|
|
9734
9759
|
Select,
|
|
9735
9760
|
{
|
|
9736
9761
|
value: String(condition.fuzzyDistance || 1),
|
|
9737
9762
|
onValueChange: handleFuzzyDistanceChange,
|
|
9738
9763
|
children: [
|
|
9739
9764
|
/* @__PURE__ */ jsx66(SelectTrigger, { className: "h-[26px] w-16 gap-3 border-zinc-200 bg-white px-2 text-sm", children: /* @__PURE__ */ jsx66(SelectValue, {}) }),
|
|
9740
|
-
/* @__PURE__ */
|
|
9765
|
+
/* @__PURE__ */ jsxs40(SelectContent, { children: [
|
|
9741
9766
|
/* @__PURE__ */ jsx66(SelectItem, { value: "1", children: "1" }),
|
|
9742
9767
|
/* @__PURE__ */ jsx66(SelectItem, { value: "2", children: "2" })
|
|
9743
9768
|
] })
|
|
9744
9769
|
]
|
|
9745
9770
|
}
|
|
9746
9771
|
),
|
|
9747
|
-
condition.operator === "phrase" && /* @__PURE__ */
|
|
9748
|
-
/* @__PURE__ */
|
|
9772
|
+
condition.operator === "phrase" && /* @__PURE__ */ jsxs40(Fragment14, { children: [
|
|
9773
|
+
/* @__PURE__ */ jsxs40(Select, { value: phraseMode, onValueChange: handlePhraseModeChange, children: [
|
|
9749
9774
|
/* @__PURE__ */ jsx66(SelectTrigger, { className: "h-[26px] w-20 gap-3 border-zinc-200 bg-white px-2 text-sm font-normal", children: /* @__PURE__ */ jsx66(SelectValue, {}) }),
|
|
9750
|
-
/* @__PURE__ */
|
|
9775
|
+
/* @__PURE__ */ jsxs40(SelectContent, { children: [
|
|
9751
9776
|
/* @__PURE__ */ jsx66(SelectItem, { value: "exact", children: "exact" }),
|
|
9752
9777
|
/* @__PURE__ */ jsx66(SelectItem, { value: "slop", children: "slop" }),
|
|
9753
9778
|
/* @__PURE__ */ jsx66(SelectItem, { value: "prefix", children: "prefix" })
|
|
@@ -9767,7 +9792,7 @@ var QueryCondition = ({
|
|
|
9767
9792
|
)
|
|
9768
9793
|
] }),
|
|
9769
9794
|
node.boost !== void 0 && /* @__PURE__ */ jsx66(BoostBadge, { node }),
|
|
9770
|
-
/* @__PURE__ */
|
|
9795
|
+
/* @__PURE__ */ jsxs40(
|
|
9771
9796
|
"div",
|
|
9772
9797
|
{
|
|
9773
9798
|
className: `flex items-center gap-1 transition-all duration-100 ${isDragging ? "opacity-0" : "-translate-x-[2px] opacity-0 group-hover/condition:translate-x-0 group-hover/condition:opacity-100 has-[[data-state=open]]:translate-x-0 has-[[data-state=open]]:opacity-100"}`,
|
|
@@ -9789,7 +9814,7 @@ var QueryCondition = ({
|
|
|
9789
9814
|
};
|
|
9790
9815
|
|
|
9791
9816
|
// src/components/databrowser/components/ui-query-builder/drag-overlay.tsx
|
|
9792
|
-
import { jsx as jsx67, jsxs as
|
|
9817
|
+
import { jsx as jsx67, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
9793
9818
|
var QueryDragOverlay = ({
|
|
9794
9819
|
activeNode,
|
|
9795
9820
|
onDropAnimationComplete
|
|
@@ -9807,14 +9832,14 @@ var QueryDragOverlay = ({
|
|
|
9807
9832
|
};
|
|
9808
9833
|
}
|
|
9809
9834
|
},
|
|
9810
|
-
children: activeNode && activeNode.type === "condition" ? /* @__PURE__ */
|
|
9835
|
+
children: activeNode && activeNode.type === "condition" ? /* @__PURE__ */ jsxs41("div", { className: "relative -mt-1", children: [
|
|
9811
9836
|
/* @__PURE__ */ jsx67("div", { className: "drag-overlay-bg absolute -bottom-1 -top-1 left-0 right-0 rounded-md border border-zinc-300 bg-zinc-100/90 shadow-md" }),
|
|
9812
9837
|
/* @__PURE__ */ jsx67("div", { className: "relative", children: /* @__PURE__ */ jsx67(QueryCondition, { node: activeNode, isDragging: true }) })
|
|
9813
|
-
] }) : activeNode && activeNode.type === "group" ? /* @__PURE__ */
|
|
9838
|
+
] }) : activeNode && activeNode.type === "group" ? /* @__PURE__ */ jsxs41("div", { className: "relative", children: [
|
|
9814
9839
|
/* @__PURE__ */ jsx67("div", { className: "drag-overlay-bg absolute -bottom-1 -top-1 left-0 right-0 rounded-md border border-zinc-300 bg-zinc-100/90 shadow-md" }),
|
|
9815
|
-
/* @__PURE__ */
|
|
9840
|
+
/* @__PURE__ */ jsxs41("div", { className: "relative flex items-center gap-1", children: [
|
|
9816
9841
|
/* @__PURE__ */ jsx67("div", { className: "flex cursor-grab items-center text-zinc-400", children: /* @__PURE__ */ jsx67(IconGripVertical2, { size: 16 }) }),
|
|
9817
|
-
/* @__PURE__ */
|
|
9842
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex h-[26px] w-16 items-center justify-between rounded-md border border-zinc-300 bg-blue-50 px-2 text-sm font-medium capitalize text-zinc-700", children: [
|
|
9818
9843
|
/* @__PURE__ */ jsx67("span", { children: activeNode.groupOperator === "and" ? "And" : "Or" }),
|
|
9819
9844
|
/* @__PURE__ */ jsx67(
|
|
9820
9845
|
"svg",
|
|
@@ -9848,7 +9873,7 @@ var QueryDragOverlay = ({
|
|
|
9848
9873
|
};
|
|
9849
9874
|
|
|
9850
9875
|
// src/components/databrowser/components/ui-query-builder/dnd-context.tsx
|
|
9851
|
-
import { jsx as jsx68, jsxs as
|
|
9876
|
+
import { jsx as jsx68, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
9852
9877
|
var QueryDndProvider = ({
|
|
9853
9878
|
children,
|
|
9854
9879
|
rootNode,
|
|
@@ -9920,7 +9945,7 @@ var QueryDndProvider = ({
|
|
|
9920
9945
|
moveNode(activeIdStr, targetGroupId, adjustedIndex);
|
|
9921
9946
|
};
|
|
9922
9947
|
const activeNode = activeId ? findNodeById(rootNode, String(activeId)) : null;
|
|
9923
|
-
return /* @__PURE__ */
|
|
9948
|
+
return /* @__PURE__ */ jsxs42(
|
|
9924
9949
|
DndContext,
|
|
9925
9950
|
{
|
|
9926
9951
|
sensors,
|
|
@@ -10027,14 +10052,14 @@ var EmptyGroupDropZone = ({ groupId, isOver }) => {
|
|
|
10027
10052
|
};
|
|
10028
10053
|
|
|
10029
10054
|
// src/components/databrowser/components/ui-query-builder/query-group.tsx
|
|
10030
|
-
import { Fragment as Fragment15, jsx as jsx71, jsxs as
|
|
10055
|
+
import { Fragment as Fragment15, jsx as jsx71, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
10031
10056
|
var ChildRow = ({
|
|
10032
10057
|
groupId,
|
|
10033
10058
|
child,
|
|
10034
10059
|
depth,
|
|
10035
10060
|
activeOverId,
|
|
10036
10061
|
droppingId
|
|
10037
|
-
}) => /* @__PURE__ */
|
|
10062
|
+
}) => /* @__PURE__ */ jsxs43("div", { children: [
|
|
10038
10063
|
/* @__PURE__ */ jsx71(
|
|
10039
10064
|
DropIndicator,
|
|
10040
10065
|
{
|
|
@@ -10075,8 +10100,8 @@ var InnerGroup = ({
|
|
|
10075
10100
|
const handleDeleteGroup = () => {
|
|
10076
10101
|
deleteNode(node.id);
|
|
10077
10102
|
};
|
|
10078
|
-
return /* @__PURE__ */
|
|
10079
|
-
/* @__PURE__ */
|
|
10103
|
+
return /* @__PURE__ */ jsxs43("div", { children: [
|
|
10104
|
+
/* @__PURE__ */ jsxs43("div", { className: "group/group flex items-center gap-1 px-1", children: [
|
|
10080
10105
|
!isRoot && /* @__PURE__ */ jsx71(
|
|
10081
10106
|
"div",
|
|
10082
10107
|
{
|
|
@@ -10087,29 +10112,30 @@ var InnerGroup = ({
|
|
|
10087
10112
|
children: /* @__PURE__ */ jsx71(IconGripVertical3, { size: 16 })
|
|
10088
10113
|
}
|
|
10089
10114
|
),
|
|
10090
|
-
/* @__PURE__ */
|
|
10115
|
+
/* @__PURE__ */ jsxs43(Select, { value: node.groupOperator, onValueChange: handleOperatorChange, children: [
|
|
10091
10116
|
/* @__PURE__ */ jsx71(SelectTrigger, { className: "h-[26px] w-16 gap-3 rounded-md border-zinc-300 bg-blue-50 px-2 text-sm font-medium capitalize text-zinc-700 [&>svg]:text-zinc-400", children: /* @__PURE__ */ jsx71(SelectValue, {}) }),
|
|
10092
|
-
/* @__PURE__ */
|
|
10117
|
+
/* @__PURE__ */ jsxs43(SelectContent, { children: [
|
|
10093
10118
|
/* @__PURE__ */ jsx71(SelectItem, { value: "and", children: "And" }),
|
|
10094
10119
|
/* @__PURE__ */ jsx71(SelectItem, { value: "or", children: "Or" })
|
|
10095
10120
|
] })
|
|
10096
10121
|
] }),
|
|
10097
|
-
/* @__PURE__ */
|
|
10122
|
+
/* @__PURE__ */ jsxs43(DropdownMenu, { children: [
|
|
10098
10123
|
/* @__PURE__ */ jsx71(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx71(
|
|
10099
10124
|
"button",
|
|
10100
10125
|
{
|
|
10101
10126
|
type: "button",
|
|
10102
|
-
|
|
10127
|
+
disabled: fieldInfos.length === 0,
|
|
10128
|
+
className: "flex h-[26px] w-[26px] items-center justify-center rounded-md border border-zinc-300 text-zinc-500 transition-colors hover:text-zinc-700 disabled:cursor-not-allowed disabled:opacity-50",
|
|
10103
10129
|
children: /* @__PURE__ */ jsx71(IconPlus4, { size: 16 })
|
|
10104
10130
|
}
|
|
10105
10131
|
) }),
|
|
10106
|
-
/* @__PURE__ */
|
|
10132
|
+
/* @__PURE__ */ jsxs43(DropdownMenuContent, { align: "start", children: [
|
|
10107
10133
|
/* @__PURE__ */ jsx71(DropdownMenuItem, { onClick: handleAddCondition, children: "Add Condition" }),
|
|
10108
10134
|
/* @__PURE__ */ jsx71(DropdownMenuItem, { onClick: handleAddGroup, children: "Add Group" })
|
|
10109
10135
|
] })
|
|
10110
10136
|
] }),
|
|
10111
10137
|
node.boost !== void 0 && /* @__PURE__ */ jsx71(BoostBadge, { node }),
|
|
10112
|
-
!isRoot && /* @__PURE__ */
|
|
10138
|
+
!isRoot && /* @__PURE__ */ jsxs43(
|
|
10113
10139
|
"div",
|
|
10114
10140
|
{
|
|
10115
10141
|
className: `flex -translate-x-[2px] items-center gap-1 opacity-0 transition-all duration-100 group-hover/group:translate-x-0 group-hover/group:opacity-100 has-[[data-state=open]]:translate-x-0 has-[[data-state=open]]:opacity-100`,
|
|
@@ -10128,7 +10154,7 @@ var InnerGroup = ({
|
|
|
10128
10154
|
}
|
|
10129
10155
|
)
|
|
10130
10156
|
] }),
|
|
10131
|
-
/* @__PURE__ */ jsx71("div", { className: `min-h-[20px] ${isRoot ? "" : "ml-[15px] border-l-2 border-zinc-200 pl-3"}`, children: node.children.length === 0 ? /* @__PURE__ */ jsx71(EmptyGroupDropZone, { groupId: node.id, isOver: activeOverId === `drop-${node.id}-end` }) : /* @__PURE__ */
|
|
10157
|
+
/* @__PURE__ */ jsx71("div", { className: `min-h-[20px] ${isRoot ? "" : "ml-[15px] border-l-2 border-zinc-200 pl-3"}`, children: node.children.length === 0 ? /* @__PURE__ */ jsx71(EmptyGroupDropZone, { groupId: node.id, isOver: activeOverId === `drop-${node.id}-end` }) : /* @__PURE__ */ jsxs43(Fragment15, { children: [
|
|
10132
10158
|
node.children.map(
|
|
10133
10159
|
(child) => !child.not && /* @__PURE__ */ jsx71(
|
|
10134
10160
|
ChildRow,
|
|
@@ -10142,9 +10168,9 @@ var InnerGroup = ({
|
|
|
10142
10168
|
child.id
|
|
10143
10169
|
)
|
|
10144
10170
|
),
|
|
10145
|
-
node.children.some((child) => child.not) && /* @__PURE__ */
|
|
10171
|
+
node.children.some((child) => child.not) && /* @__PURE__ */ jsxs43(Tooltip, { delayDuration: 200, children: [
|
|
10146
10172
|
/* @__PURE__ */ jsx71(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx71("div", { className: "ml-2 mt-2 flex h-[26px] w-fit cursor-default select-none items-center rounded-md border border-zinc-300 bg-amber-50 px-2 text-sm font-medium capitalize text-amber-800", children: "Must Not" }) }),
|
|
10147
|
-
/* @__PURE__ */ jsx71(TooltipContent, { side: "right", className: "max-w-xs", children: /* @__PURE__ */
|
|
10173
|
+
/* @__PURE__ */ jsx71(TooltipContent, { side: "right", className: "max-w-xs", children: /* @__PURE__ */ jsxs43("p", { children: [
|
|
10148
10174
|
"Keys matching any of the conditions below are excluded from the results.",
|
|
10149
10175
|
" ",
|
|
10150
10176
|
/* @__PURE__ */ jsx71(
|
|
@@ -10219,7 +10245,7 @@ var QueryGroup = ({ node, isRoot = false, depth }) => {
|
|
|
10219
10245
|
};
|
|
10220
10246
|
|
|
10221
10247
|
// src/components/databrowser/components/ui-query-builder/use-query-state-sync.ts
|
|
10222
|
-
import { useCallback as useCallback3, useEffect as
|
|
10248
|
+
import { useCallback as useCallback3, useEffect as useEffect18, useRef as useRef7, useState as useState23 } from "react";
|
|
10223
10249
|
|
|
10224
10250
|
// src/components/databrowser/components/ui-query-builder/query-stringify.ts
|
|
10225
10251
|
var jsonToJsLiteral = (json) => {
|
|
@@ -10349,7 +10375,7 @@ var useQueryStateSync = () => {
|
|
|
10349
10375
|
});
|
|
10350
10376
|
const lastSyncedQuery = useRef7(valuesSearch.query);
|
|
10351
10377
|
const isOurUpdate = useRef7(false);
|
|
10352
|
-
|
|
10378
|
+
useEffect18(() => {
|
|
10353
10379
|
if (isOurUpdate.current) {
|
|
10354
10380
|
isOurUpdate.current = false;
|
|
10355
10381
|
lastSyncedQuery.current = valuesSearch.query;
|
|
@@ -10383,14 +10409,14 @@ var useQueryStateSync = () => {
|
|
|
10383
10409
|
};
|
|
10384
10410
|
|
|
10385
10411
|
// src/components/databrowser/components/ui-query-builder/ui-query-builder.tsx
|
|
10386
|
-
import { jsx as jsx72, jsxs as
|
|
10412
|
+
import { jsx as jsx72, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
10387
10413
|
var UIQueryBuilder = () => {
|
|
10388
10414
|
const { valuesSearch } = useTab();
|
|
10389
10415
|
const { data: indexDetails } = useFetchSearchIndex(valuesSearch.index);
|
|
10390
10416
|
const { queryState, setQueryState } = useQueryStateSync();
|
|
10391
10417
|
const fieldInfos = indexDetails?.schema ? extractFieldInfo(indexDetails.schema) : [];
|
|
10392
10418
|
const hasNormalized = useRef8(false);
|
|
10393
|
-
|
|
10419
|
+
useEffect19(() => {
|
|
10394
10420
|
if (hasNormalized.current || fieldInfos.length === 0) return;
|
|
10395
10421
|
hasNormalized.current = true;
|
|
10396
10422
|
setQueryState((state) => normalizeQueryState(state, fieldInfos));
|
|
@@ -10406,7 +10432,7 @@ var UIQueryBuilder = () => {
|
|
|
10406
10432
|
setHasTopShadow(scrollTop > 0);
|
|
10407
10433
|
setHasBottomShadow(scrollTop + clientHeight < scrollHeight - 1);
|
|
10408
10434
|
}, []);
|
|
10409
|
-
|
|
10435
|
+
useEffect19(() => {
|
|
10410
10436
|
viewportRef.current = scrollAreaRef.current?.querySelector(
|
|
10411
10437
|
"[data-radix-scroll-area-viewport]"
|
|
10412
10438
|
);
|
|
@@ -10417,7 +10443,7 @@ var UIQueryBuilder = () => {
|
|
|
10417
10443
|
obs.observe(el);
|
|
10418
10444
|
return () => obs.disconnect();
|
|
10419
10445
|
}, [recomputeShadows]);
|
|
10420
|
-
return /* @__PURE__ */ jsx72(QueryBuilderUIProvider, { fieldInfos, setQueryState, children: /* @__PURE__ */
|
|
10446
|
+
return /* @__PURE__ */ jsx72(QueryBuilderUIProvider, { fieldInfos, setQueryState, children: /* @__PURE__ */ jsxs44("div", { className: "relative h-full rounded-lg bg-zinc-50", children: [
|
|
10421
10447
|
/* @__PURE__ */ jsx72(
|
|
10422
10448
|
"div",
|
|
10423
10449
|
{
|
|
@@ -10510,7 +10536,7 @@ var extractFieldInfo = (schema) => {
|
|
|
10510
10536
|
};
|
|
10511
10537
|
|
|
10512
10538
|
// src/components/databrowser/components/databrowser-instance.tsx
|
|
10513
|
-
import { jsx as jsx73, jsxs as
|
|
10539
|
+
import { jsx as jsx73, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
10514
10540
|
var PREFIX = "const query: Query = ";
|
|
10515
10541
|
var QueryBuilderContent = () => {
|
|
10516
10542
|
const { valuesSearch } = useTab();
|
|
@@ -10531,8 +10557,8 @@ var QueryBuilderContent = () => {
|
|
|
10531
10557
|
}
|
|
10532
10558
|
setMode(newMode);
|
|
10533
10559
|
};
|
|
10534
|
-
return /* @__PURE__ */
|
|
10535
|
-
/* @__PURE__ */
|
|
10560
|
+
return /* @__PURE__ */ jsxs45("div", { children: [
|
|
10561
|
+
/* @__PURE__ */ jsxs45("div", { className: "relative h-[200px] max-h-[40vh] min-h-[150px] resize-y overflow-hidden", children: [
|
|
10536
10562
|
/* @__PURE__ */ jsx73("div", { className: "absolute right-4 top-4 z-10", children: /* @__PURE__ */ jsx73(
|
|
10537
10563
|
Segmented,
|
|
10538
10564
|
{
|
|
@@ -10551,12 +10577,7 @@ var QueryBuilderContent = () => {
|
|
|
10551
10577
|
] });
|
|
10552
10578
|
};
|
|
10553
10579
|
var SearchContent = () => {
|
|
10554
|
-
const { valuesSearch, setValuesSearchIndex } = useTab();
|
|
10555
10580
|
const { data: indexes, isLoading } = useFetchSearchIndexes();
|
|
10556
|
-
useEffect19(() => {
|
|
10557
|
-
if (!indexes || isLoading) return;
|
|
10558
|
-
if (valuesSearch.index && !indexes.includes(valuesSearch.index)) setValuesSearchIndex("");
|
|
10559
|
-
}, [indexes, valuesSearch.index, isLoading, setValuesSearchIndex]);
|
|
10560
10581
|
if (isLoading) {
|
|
10561
10582
|
return null;
|
|
10562
10583
|
}
|
|
@@ -10566,11 +10587,14 @@ var SearchContent = () => {
|
|
|
10566
10587
|
};
|
|
10567
10588
|
var DatabrowserInstance = ({
|
|
10568
10589
|
hidden,
|
|
10569
|
-
tabType
|
|
10590
|
+
tabType,
|
|
10591
|
+
allowSearch
|
|
10570
10592
|
}) => {
|
|
10571
10593
|
const { isValuesSearchSelected, setIsValuesSearchSelected } = useTab();
|
|
10572
|
-
const { data: indexes, isLoading } = useFetchSearchIndexes(
|
|
10573
|
-
|
|
10594
|
+
const { data: indexes, isLoading } = useFetchSearchIndexes({
|
|
10595
|
+
enabled: tabType === "search"
|
|
10596
|
+
});
|
|
10597
|
+
useEffect20(() => {
|
|
10574
10598
|
if (tabType === "keys" && isValuesSearchSelected) {
|
|
10575
10599
|
setIsValuesSearchSelected(false);
|
|
10576
10600
|
} else if (tabType === "search" && !isValuesSearchSelected) {
|
|
@@ -10578,7 +10602,7 @@ var DatabrowserInstance = ({
|
|
|
10578
10602
|
}
|
|
10579
10603
|
}, [tabType, isValuesSearchSelected, setIsValuesSearchSelected]);
|
|
10580
10604
|
const showEmptyState = isValuesSearchSelected && !isLoading && (!indexes || indexes.length === 0);
|
|
10581
|
-
return /* @__PURE__ */ jsx73(KeysProvider, { children: /* @__PURE__ */
|
|
10605
|
+
return /* @__PURE__ */ jsx73(KeysProvider, { children: /* @__PURE__ */ jsxs45(
|
|
10582
10606
|
"div",
|
|
10583
10607
|
{
|
|
10584
10608
|
className: cn(
|
|
@@ -10586,12 +10610,12 @@ var DatabrowserInstance = ({
|
|
|
10586
10610
|
hidden && "hidden"
|
|
10587
10611
|
),
|
|
10588
10612
|
children: [
|
|
10589
|
-
/* @__PURE__ */
|
|
10590
|
-
/* @__PURE__ */ jsx73(Header, { tabType }),
|
|
10613
|
+
/* @__PURE__ */ jsxs45("div", { className: "space-y-3 py-5", children: [
|
|
10614
|
+
/* @__PURE__ */ jsx73(Header, { tabType, allowSearch }),
|
|
10591
10615
|
isValuesSearchSelected && !showEmptyState && /* @__PURE__ */ jsx73(SearchContent, {}),
|
|
10592
10616
|
/* @__PURE__ */ jsx73(HeaderError, {})
|
|
10593
10617
|
] }),
|
|
10594
|
-
showEmptyState ? /* @__PURE__ */ jsx73(SearchEmptyState, {}) : /* @__PURE__ */
|
|
10618
|
+
showEmptyState ? /* @__PURE__ */ jsx73(SearchEmptyState, {}) : /* @__PURE__ */ jsxs45(
|
|
10595
10619
|
PanelGroup,
|
|
10596
10620
|
{
|
|
10597
10621
|
autoSaveId: "persistence",
|
|
@@ -10599,7 +10623,7 @@ var DatabrowserInstance = ({
|
|
|
10599
10623
|
className: "h-full w-full text-sm antialiased",
|
|
10600
10624
|
children: [
|
|
10601
10625
|
/* @__PURE__ */ jsx73(Panel, { defaultSize: 30, minSize: 30, children: /* @__PURE__ */ jsx73(Sidebar, {}) }),
|
|
10602
|
-
/* @__PURE__ */
|
|
10626
|
+
/* @__PURE__ */ jsxs45(PanelResizeHandle, { className: "group mx-[2px] flex h-full flex-col items-center justify-center gap-1 rounded-md px-[8px] transition-colors hover:bg-zinc-300/10", children: [
|
|
10603
10627
|
/* @__PURE__ */ jsx73("div", { className: "h-[3px] w-[3px] rounded-full bg-zinc-300" }),
|
|
10604
10628
|
/* @__PURE__ */ jsx73("div", { className: "h-[3px] w-[3px] rounded-full bg-zinc-300" }),
|
|
10605
10629
|
/* @__PURE__ */ jsx73("div", { className: "h-[3px] w-[3px] rounded-full bg-zinc-300" })
|
|
@@ -10615,7 +10639,7 @@ var DatabrowserInstance = ({
|
|
|
10615
10639
|
};
|
|
10616
10640
|
|
|
10617
10641
|
// src/components/databrowser/components/databrowser-tabs.tsx
|
|
10618
|
-
import { useCallback as useCallback6, useEffect as
|
|
10642
|
+
import { useCallback as useCallback6, useEffect as useEffect22, useMemo as useMemo11, useRef as useRef10, useState as useState27 } from "react";
|
|
10619
10643
|
import {
|
|
10620
10644
|
closestCenter,
|
|
10621
10645
|
DndContext as DndContext2,
|
|
@@ -10633,7 +10657,7 @@ import { IconChevronDown as IconChevronDown3, IconPlus as IconPlus5, IconWindowM
|
|
|
10633
10657
|
import * as React15 from "react";
|
|
10634
10658
|
import { IconSearch as IconSearch4 } from "@tabler/icons-react";
|
|
10635
10659
|
import { Command as CommandPrimitive } from "cmdk";
|
|
10636
|
-
import { jsx as jsx74, jsxs as
|
|
10660
|
+
import { jsx as jsx74, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
10637
10661
|
var Command = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx74(
|
|
10638
10662
|
CommandPrimitive,
|
|
10639
10663
|
{
|
|
@@ -10646,7 +10670,7 @@ var Command = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
10646
10670
|
}
|
|
10647
10671
|
));
|
|
10648
10672
|
Command.displayName = CommandPrimitive.displayName;
|
|
10649
|
-
var CommandInput = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
10673
|
+
var CommandInput = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs46("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
10650
10674
|
/* @__PURE__ */ jsx74(IconSearch4, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
10651
10675
|
/* @__PURE__ */ jsx74(
|
|
10652
10676
|
CommandPrimitive.Input,
|
|
@@ -10721,7 +10745,7 @@ import {
|
|
|
10721
10745
|
} from "@tabler/icons-react";
|
|
10722
10746
|
|
|
10723
10747
|
// src/hooks/use-overflow.ts
|
|
10724
|
-
import { useCallback as useCallback5, useEffect as
|
|
10748
|
+
import { useCallback as useCallback5, useEffect as useEffect21, useRef as useRef9, useState as useState26 } from "react";
|
|
10725
10749
|
var useOverflow = () => {
|
|
10726
10750
|
const [isOverflow, setIsOverflow] = useState26(false);
|
|
10727
10751
|
const observerRef = useRef9(null);
|
|
@@ -10738,7 +10762,7 @@ var useOverflow = () => {
|
|
|
10738
10762
|
});
|
|
10739
10763
|
observerRef.current.observe(node);
|
|
10740
10764
|
}, []);
|
|
10741
|
-
|
|
10765
|
+
useEffect21(() => {
|
|
10742
10766
|
return () => {
|
|
10743
10767
|
observerRef.current?.disconnect();
|
|
10744
10768
|
};
|
|
@@ -10756,7 +10780,7 @@ function TabTypeIcon({ selectedKey }) {
|
|
|
10756
10780
|
}
|
|
10757
10781
|
|
|
10758
10782
|
// src/components/databrowser/components/tab.tsx
|
|
10759
|
-
import { jsx as jsx76, jsxs as
|
|
10783
|
+
import { jsx as jsx76, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
10760
10784
|
var Tab = ({ id, isList }) => {
|
|
10761
10785
|
const { active, search, selectedKey, valuesSearch, pinned, isValuesSearchSelected } = useTab();
|
|
10762
10786
|
const {
|
|
@@ -10773,7 +10797,7 @@ var Tab = ({ id, isList }) => {
|
|
|
10773
10797
|
const { ref, isOverflow } = useOverflow();
|
|
10774
10798
|
const label = isValuesSearchSelected ? valuesSearch.index : search.key || selectedKey;
|
|
10775
10799
|
const iconNode = isValuesSearchSelected ? /* @__PURE__ */ jsx76("div", { className: "flex h-[20px] w-[20px] items-center justify-center rounded-md bg-emerald-200 text-emerald-800", children: /* @__PURE__ */ jsx76(IconSearch5, { size: 14 }) }) : search.key ? /* @__PURE__ */ jsx76("div", { className: "flex h-[20px] w-[20px] items-center justify-center rounded-md bg-zinc-100 text-zinc-600", children: /* @__PURE__ */ jsx76(IconSearch5, { size: 14 }) }) : selectedKey ? /* @__PURE__ */ jsx76(TabTypeIcon, { selectedKey }) : void 0;
|
|
10776
|
-
const tabNode = /* @__PURE__ */
|
|
10800
|
+
const tabNode = /* @__PURE__ */ jsxs47(
|
|
10777
10801
|
"div",
|
|
10778
10802
|
{
|
|
10779
10803
|
id: isList ? `list-tab-${id}` : `tab-${id}`,
|
|
@@ -10808,33 +10832,33 @@ var Tab = ({ id, isList }) => {
|
|
|
10808
10832
|
]
|
|
10809
10833
|
}
|
|
10810
10834
|
);
|
|
10811
|
-
return /* @__PURE__ */
|
|
10835
|
+
return /* @__PURE__ */ jsxs47(ContextMenu, { children: [
|
|
10812
10836
|
/* @__PURE__ */ jsx76(SimpleTooltip, { content: isOverflow ? label : void 0, children: /* @__PURE__ */ jsx76(ContextMenuTrigger, { asChild: true, children: tabNode }) }),
|
|
10813
|
-
/* @__PURE__ */
|
|
10837
|
+
/* @__PURE__ */ jsxs47(
|
|
10814
10838
|
ContextMenuContent,
|
|
10815
10839
|
{
|
|
10816
10840
|
onClick: (e) => {
|
|
10817
10841
|
e.stopPropagation();
|
|
10818
10842
|
},
|
|
10819
10843
|
children: [
|
|
10820
|
-
/* @__PURE__ */
|
|
10844
|
+
/* @__PURE__ */ jsxs47(ContextMenuItem, { onSelect: () => togglePinTab(id), className: "gap-2", children: [
|
|
10821
10845
|
/* @__PURE__ */ jsx76(IconPin, { size: 16 }),
|
|
10822
10846
|
pinned ? "Unpin Tab" : "Pin Tab"
|
|
10823
10847
|
] }),
|
|
10824
|
-
/* @__PURE__ */
|
|
10848
|
+
/* @__PURE__ */ jsxs47(ContextMenuItem, { onSelect: () => duplicateTab(id), className: "gap-2", children: [
|
|
10825
10849
|
/* @__PURE__ */ jsx76(IconCopyPlus, { size: 16 }),
|
|
10826
10850
|
"Duplicate Tab"
|
|
10827
10851
|
] }),
|
|
10828
10852
|
/* @__PURE__ */ jsx76(ContextMenuSeparator, {}),
|
|
10829
|
-
/* @__PURE__ */
|
|
10853
|
+
/* @__PURE__ */ jsxs47(ContextMenuItem, { onSelect: () => forceRemoveTab(id), className: "gap-2", children: [
|
|
10830
10854
|
/* @__PURE__ */ jsx76(IconX5, { size: 16 }),
|
|
10831
10855
|
"Close Tab"
|
|
10832
10856
|
] }),
|
|
10833
|
-
/* @__PURE__ */
|
|
10857
|
+
/* @__PURE__ */ jsxs47(ContextMenuItem, { onSelect: () => closeOtherTabs(id), className: "gap-2", children: [
|
|
10834
10858
|
/* @__PURE__ */ jsx76(IconSquareX, { size: 16 }),
|
|
10835
10859
|
"Close Other Tabs"
|
|
10836
10860
|
] }),
|
|
10837
|
-
/* @__PURE__ */
|
|
10861
|
+
/* @__PURE__ */ jsxs47(
|
|
10838
10862
|
ContextMenuItem,
|
|
10839
10863
|
{
|
|
10840
10864
|
onSelect: () => closeAllButPinned(),
|
|
@@ -10853,7 +10877,7 @@ var Tab = ({ id, isList }) => {
|
|
|
10853
10877
|
};
|
|
10854
10878
|
|
|
10855
10879
|
// src/components/databrowser/components/databrowser-tabs.tsx
|
|
10856
|
-
import { jsx as jsx77, jsxs as
|
|
10880
|
+
import { jsx as jsx77, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
10857
10881
|
var SortableTab = ({ id }) => {
|
|
10858
10882
|
const [originalWidth, setOriginalWidth] = useState27(null);
|
|
10859
10883
|
const textRef = useRef10(null);
|
|
@@ -10880,7 +10904,7 @@ var SortableTab = ({ id }) => {
|
|
|
10880
10904
|
}
|
|
10881
10905
|
setNodeRef(element);
|
|
10882
10906
|
};
|
|
10883
|
-
|
|
10907
|
+
useEffect22(() => {
|
|
10884
10908
|
if (textRef.current && isDragging) {
|
|
10885
10909
|
const originalMaxWidth = textRef.current.style.maxWidth;
|
|
10886
10910
|
const originalWhiteSpace = textRef.current.style.whiteSpace;
|
|
@@ -10900,7 +10924,7 @@ var SortableTab = ({ id }) => {
|
|
|
10900
10924
|
};
|
|
10901
10925
|
}
|
|
10902
10926
|
}, [isDragging]);
|
|
10903
|
-
|
|
10927
|
+
useEffect22(() => {
|
|
10904
10928
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
10905
10929
|
if (entries[0]) {
|
|
10906
10930
|
setOriginalWidth(entries[0].contentRect.width);
|
|
@@ -10946,7 +10970,7 @@ var DatabrowserTabs = ({ onFullScreenClick }) => {
|
|
|
10946
10970
|
const [hasLeftShadow, setHasLeftShadow] = useState27(false);
|
|
10947
10971
|
const [hasRightShadow, setHasRightShadow] = useState27(false);
|
|
10948
10972
|
const [isOverflow, setIsOverflow] = useState27(false);
|
|
10949
|
-
|
|
10973
|
+
useEffect22(() => {
|
|
10950
10974
|
const el = scrollRef.current;
|
|
10951
10975
|
if (!el) return;
|
|
10952
10976
|
const onWheel = (event) => {
|
|
@@ -10976,7 +11000,7 @@ var DatabrowserTabs = ({ onFullScreenClick }) => {
|
|
|
10976
11000
|
setHasRightShadow(scrollLeft + clientWidth < scrollWidth - 1);
|
|
10977
11001
|
setIsOverflow(scrollWidth > clientWidth + 1);
|
|
10978
11002
|
}, []);
|
|
10979
|
-
|
|
11003
|
+
useEffect22(() => {
|
|
10980
11004
|
recomputeShadows();
|
|
10981
11005
|
const el = scrollRef.current;
|
|
10982
11006
|
if (!el) return;
|
|
@@ -11004,8 +11028,8 @@ var DatabrowserTabs = ({ onFullScreenClick }) => {
|
|
|
11004
11028
|
reorderTabs(oldIndex, newIndex);
|
|
11005
11029
|
}
|
|
11006
11030
|
};
|
|
11007
|
-
return /* @__PURE__ */ jsx77("div", { className: "relative shrink-0 overflow-hidden rounded-t-lg bg-zinc-300", children: /* @__PURE__ */
|
|
11008
|
-
/* @__PURE__ */
|
|
11031
|
+
return /* @__PURE__ */ jsx77("div", { className: "relative shrink-0 overflow-hidden rounded-t-lg bg-zinc-300", children: /* @__PURE__ */ jsxs48("div", { className: "flex items-center gap-1", children: [
|
|
11032
|
+
/* @__PURE__ */ jsxs48("div", { className: "relative min-w-0 flex-1", children: [
|
|
11009
11033
|
/* @__PURE__ */ jsx77(
|
|
11010
11034
|
"div",
|
|
11011
11035
|
{
|
|
@@ -11018,7 +11042,7 @@ var DatabrowserTabs = ({ onFullScreenClick }) => {
|
|
|
11018
11042
|
className: `tabs-shadow-right pointer-events-none absolute right-0 top-0 z-10 h-full w-6 transition-opacity duration-200 ${hasRightShadow ? "opacity-100" : "opacity-0"}`
|
|
11019
11043
|
}
|
|
11020
11044
|
),
|
|
11021
|
-
/* @__PURE__ */
|
|
11045
|
+
/* @__PURE__ */ jsxs48(
|
|
11022
11046
|
"div",
|
|
11023
11047
|
{
|
|
11024
11048
|
ref: scrollRef,
|
|
@@ -11052,7 +11076,7 @@ var DatabrowserTabs = ({ onFullScreenClick }) => {
|
|
|
11052
11076
|
}
|
|
11053
11077
|
)
|
|
11054
11078
|
] }),
|
|
11055
|
-
/* @__PURE__ */
|
|
11079
|
+
/* @__PURE__ */ jsxs48("div", { className: "flex items-center gap-1 pl-1", children: [
|
|
11056
11080
|
isOverflow && /* @__PURE__ */ jsx77(AddTabButton, {}),
|
|
11057
11081
|
tabs.length > 1 && /* @__PURE__ */ jsx77(TabsListButton, { tabs, onSelectTab: selectTab }),
|
|
11058
11082
|
onFullScreenClick && /* @__PURE__ */ jsx77(
|
|
@@ -11115,8 +11139,8 @@ function TabsListButton({
|
|
|
11115
11139
|
tab.scrollIntoView({ behavior: "smooth" });
|
|
11116
11140
|
}, 20);
|
|
11117
11141
|
};
|
|
11118
|
-
return /* @__PURE__ */
|
|
11119
|
-
/* @__PURE__ */ jsx77(PopoverTrigger, { asChild: true, children: /* @__PURE__ */
|
|
11142
|
+
return /* @__PURE__ */ jsxs48(Popover, { open, onOpenChange: setOpen, children: [
|
|
11143
|
+
/* @__PURE__ */ jsx77(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs48(
|
|
11120
11144
|
Button,
|
|
11121
11145
|
{
|
|
11122
11146
|
variant: "secondary",
|
|
@@ -11129,7 +11153,7 @@ function TabsListButton({
|
|
|
11129
11153
|
]
|
|
11130
11154
|
}
|
|
11131
11155
|
) }),
|
|
11132
|
-
/* @__PURE__ */ jsx77(PopoverContent, { className: "w-96 p-0", align: "end", children: /* @__PURE__ */ jsx77(Command, { children: /* @__PURE__ */
|
|
11156
|
+
/* @__PURE__ */ jsx77(PopoverContent, { className: "w-96 p-0", align: "end", children: /* @__PURE__ */ jsx77(Command, { children: /* @__PURE__ */ jsxs48(CommandList, { children: [
|
|
11133
11157
|
/* @__PURE__ */ jsx77(CommandEmpty, { children: "No tabs" }),
|
|
11134
11158
|
/* @__PURE__ */ jsx77(CommandGroup, { children: sorted.map(([_id, item]) => /* @__PURE__ */ jsx77(
|
|
11135
11159
|
CommandItem,
|
|
@@ -11150,7 +11174,7 @@ function TabsListButton({
|
|
|
11150
11174
|
}
|
|
11151
11175
|
|
|
11152
11176
|
// src/components/databrowser/index.tsx
|
|
11153
|
-
import { jsx as jsx78, jsxs as
|
|
11177
|
+
import { jsx as jsx78, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
11154
11178
|
var RedisBrowser = ({
|
|
11155
11179
|
url,
|
|
11156
11180
|
token,
|
|
@@ -11159,16 +11183,18 @@ var RedisBrowser = ({
|
|
|
11159
11183
|
storage,
|
|
11160
11184
|
disableTelemetry,
|
|
11161
11185
|
onFullScreenClick,
|
|
11162
|
-
theme = "light"
|
|
11186
|
+
theme = "light",
|
|
11187
|
+
allowSearch = false
|
|
11163
11188
|
}) => {
|
|
11164
11189
|
const credentials = useMemo12(() => ({ token, url }), [token, url]);
|
|
11165
11190
|
const rootRef = useRef11(null);
|
|
11166
|
-
|
|
11191
|
+
useEffect23(() => {
|
|
11167
11192
|
queryClient.resetQueries();
|
|
11168
11193
|
}, [credentials.url]);
|
|
11169
11194
|
return /* @__PURE__ */ jsx78(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx78(RedisProvider, { redisCredentials: credentials, telemetry: !disableTelemetry, children: /* @__PURE__ */ jsx78(DarkModeProvider, { theme, children: /* @__PURE__ */ jsx78(DatabrowserProvider, { storage, rootRef, children: /* @__PURE__ */ jsx78(TooltipProvider, { children: /* @__PURE__ */ jsx78(
|
|
11170
11195
|
RedisBrowserRoot,
|
|
11171
11196
|
{
|
|
11197
|
+
allowSearch,
|
|
11172
11198
|
hideTabs,
|
|
11173
11199
|
tabType,
|
|
11174
11200
|
rootRef,
|
|
@@ -11179,11 +11205,12 @@ var RedisBrowser = ({
|
|
|
11179
11205
|
var RedisBrowserRoot = ({
|
|
11180
11206
|
hideTabs,
|
|
11181
11207
|
tabType,
|
|
11208
|
+
allowSearch,
|
|
11182
11209
|
rootRef,
|
|
11183
11210
|
onFullScreenClick
|
|
11184
11211
|
}) => {
|
|
11185
11212
|
const theme = useTheme();
|
|
11186
|
-
|
|
11213
|
+
useEffect23(() => {
|
|
11187
11214
|
portalWrapper.classList.add("text-zinc-700");
|
|
11188
11215
|
portalWrapper.classList.toggle("dark", theme === "dark");
|
|
11189
11216
|
}, [theme]);
|
|
@@ -11195,22 +11222,32 @@ var RedisBrowserRoot = ({
|
|
|
11195
11222
|
className: `ups-db ${theme === "dark" ? "dark" : ""}`,
|
|
11196
11223
|
style: { height: "100%" },
|
|
11197
11224
|
ref: rootRef,
|
|
11198
|
-
children: /* @__PURE__ */
|
|
11225
|
+
children: /* @__PURE__ */ jsxs49("div", { className: "flex h-full flex-col overflow-hidden rounded-[14px] border-[4px] border-zinc-300 text-zinc-700", children: [
|
|
11199
11226
|
!hideTabs && /* @__PURE__ */ jsx78(DatabrowserTabs, { onFullScreenClick }),
|
|
11200
|
-
/* @__PURE__ */ jsx78(DatabrowserInstances, { tabType })
|
|
11227
|
+
/* @__PURE__ */ jsx78(DatabrowserInstances, { tabType, allowSearch })
|
|
11201
11228
|
] })
|
|
11202
11229
|
}
|
|
11203
11230
|
)
|
|
11204
11231
|
);
|
|
11205
11232
|
};
|
|
11206
|
-
var DatabrowserInstances = ({
|
|
11233
|
+
var DatabrowserInstances = ({
|
|
11234
|
+
tabType,
|
|
11235
|
+
allowSearch
|
|
11236
|
+
}) => {
|
|
11207
11237
|
const { tabs, selectedTab, selectTab, addTab } = useDatabrowserStore();
|
|
11208
|
-
|
|
11238
|
+
useEffect23(() => {
|
|
11209
11239
|
if (tabs.length === 0) addTab();
|
|
11210
11240
|
else if (!selectedTab) selectTab(tabs[0][0]);
|
|
11211
11241
|
}, [tabs, selectedTab, addTab, selectTab]);
|
|
11212
11242
|
if (!selectedTab) return;
|
|
11213
|
-
return tabs.map(([id]) => /* @__PURE__ */ jsx78(TabIdProvider, { value: id, children: /* @__PURE__ */ jsx78(
|
|
11243
|
+
return tabs.map(([id]) => /* @__PURE__ */ jsx78(TabIdProvider, { value: id, children: /* @__PURE__ */ jsx78(
|
|
11244
|
+
DatabrowserInstance,
|
|
11245
|
+
{
|
|
11246
|
+
hidden: id !== selectedTab,
|
|
11247
|
+
tabType,
|
|
11248
|
+
allowSearch
|
|
11249
|
+
}
|
|
11250
|
+
) }, id));
|
|
11214
11251
|
};
|
|
11215
11252
|
export {
|
|
11216
11253
|
RedisBrowser
|