@sanity/vision 5.31.0-next.42 → 5.31.0-next.46
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { useTranslation, useKeyValueStore, useDateTimeFormat, ContextMenuButton, Translate, usePerspective, useDataset, useScheduledDraftsEnabled, useActiveReleases, useWorkspace, sortReleases,
|
|
4
|
-
import { Spinner, rem, useTheme, Flex, Card, Label, Box, Text, Tooltip, Stack, useToast, TextInput, MenuButton, Menu, MenuItem, Code, Button, Hotkeys, useClickOutsideEvent, Popover, Inline,
|
|
3
|
+
import { useTranslation, useKeyValueStore, useClient, useCurrentUser, useDateTimeFormat, ContextMenuButton, UserAvatar, Translate, usePerspective, useDataset, useScheduledDraftsEnabled, useActiveReleases, useWorkspace, sortReleases, isCardinalityOneRelease, getReleaseIdFromReleaseDocumentId } from "sanity";
|
|
4
|
+
import { Spinner, rem, useTheme, Flex, Card, Label, Box, Text, Tooltip, Stack, useToast, TextInput, MenuButton, Menu, MenuItem, Code, Badge, Button, Dialog, Tab, TabList, Hotkeys, useClickOutsideEvent, Popover, Inline, Grid, Select, Container, Heading } from "@sanity/ui";
|
|
5
5
|
import { useState, useEffect, forwardRef, useRef, useImperativeHandle, Fragment, useEffectEvent, Component } from "react";
|
|
6
6
|
import { SplitPane } from "@rexxars/react-split-pane";
|
|
7
|
-
import { ErrorOutlineIcon, TrashIcon, AddIcon, SearchIcon, StopIcon, PlayIcon, HelpCircleIcon, CopyIcon, LinkIcon, DocumentSheetIcon, ChevronLeftIcon, ChevronRightIcon } from "@sanity/icons";
|
|
7
|
+
import { ErrorOutlineIcon, UsersIcon, UnpublishIcon, TrashIcon, LockIcon, AddIcon, SearchIcon, StopIcon, PlayIcon, HelpCircleIcon, CopyIcon, LinkIcon, DocumentSheetIcon, ChevronLeftIcon, ChevronRightIcon } from "@sanity/icons";
|
|
8
8
|
import { isHotkey } from "is-hotkey-esm";
|
|
9
9
|
import { closeBrackets } from "@codemirror/autocomplete";
|
|
10
10
|
import { history, defaultKeymap, historyKeymap } from "@codemirror/commands";
|
|
@@ -313,13 +313,13 @@ Root.displayName = "Root";
|
|
|
313
313
|
const Header = styled(Card).withConfig({
|
|
314
314
|
displayName: "Header",
|
|
315
315
|
componentId: "sc-r315za-1"
|
|
316
|
-
})`border-bottom:1px solid var(--card-border-color);`, StyledLabel = styled(Label).withConfig({
|
|
316
|
+
})`position:relative;flex-shrink:0;z-index:6;background:var(--card-bg-color);overflow:visible;border-bottom:1px solid var(--card-border-color);`, StyledLabel = styled(Label).withConfig({
|
|
317
317
|
displayName: "StyledLabel",
|
|
318
318
|
componentId: "sc-r315za-2"
|
|
319
319
|
})`flex:1;`, SplitpaneContainer = styled(Box).withConfig({
|
|
320
320
|
displayName: "SplitpaneContainer",
|
|
321
321
|
componentId: "sc-r315za-3"
|
|
322
|
-
})`position:relative;`, QueryCopyLink = styled.a.withConfig({
|
|
322
|
+
})`position:relative;min-height:0;z-index:1;`, QueryCopyLink = styled.a.withConfig({
|
|
323
323
|
displayName: "QueryCopyLink",
|
|
324
324
|
componentId: "sc-r315za-4"
|
|
325
325
|
})`cursor:pointer;margin-right:auto;`, InputBackgroundContainer = styled(Box).withConfig({
|
|
@@ -358,7 +358,7 @@ const Header = styled(Card).withConfig({
|
|
|
358
358
|
})`position:relative;width:100%;height:100%;z-index:20;`, ResultFooter = styled(Flex).withConfig({
|
|
359
359
|
displayName: "ResultFooter",
|
|
360
360
|
componentId: "sc-r315za-12"
|
|
361
|
-
})`border-top:1px solid var(--card-border-color);`, TimingsCard = styled(Card).withConfig({
|
|
361
|
+
})`border-top:1px solid var(--card-border-color);flex-wrap:wrap;`, TimingsCard = styled(Card).withConfig({
|
|
362
362
|
displayName: "TimingsCard",
|
|
363
363
|
componentId: "sc-r315za-13"
|
|
364
364
|
})`position:relative;`, TimingsTextContainer = styled(Flex).withConfig({
|
|
@@ -372,7 +372,7 @@ const Header = styled(Card).withConfig({
|
|
|
372
372
|
})`position:relative;`, SaveResultLabel = styled(Text).withConfig({
|
|
373
373
|
displayName: "SaveResultLabel",
|
|
374
374
|
componentId: "sc-r315za-16"
|
|
375
|
-
})`transform:initial;&:before,&:after{content:none;}> span{display:flex !important;gap:${({
|
|
375
|
+
})`transform:initial;&:before,&:after{content:none;}> span{display:flex !important;flex-wrap:wrap;gap:${({
|
|
376
376
|
theme
|
|
377
377
|
}) => rem(theme.sanity.space[3])};align-items:center;}`, ControlsContainer = styled(Box).withConfig({
|
|
378
378
|
displayName: "ControlsContainer",
|
|
@@ -426,30 +426,110 @@ function parseParams(value, t) {
|
|
|
426
426
|
error: validationError
|
|
427
427
|
};
|
|
428
428
|
}
|
|
429
|
-
const STORED_QUERIES_NAMESPACE = "studio.vision-tool.saved-queries",
|
|
429
|
+
const STORED_QUERIES_NAMESPACE = "studio.vision-tool.saved-queries", SHARED_QUERY_DOCUMENT_TYPE = "vision.sharedQuery", SHARED_QUERIES_QUERY = `*[_type == $sharedQueryType]{
|
|
430
|
+
_id,
|
|
431
|
+
authorId,
|
|
432
|
+
savedAt,
|
|
433
|
+
title,
|
|
434
|
+
url
|
|
435
|
+
} | order(savedAt desc)`, SHARED_QUERY_LISTEN_OPTIONS = {
|
|
436
|
+
events: ["welcome", "mutation", "reconnect"],
|
|
437
|
+
includeResult: !0,
|
|
438
|
+
visibility: "query"
|
|
439
|
+
}, defaultValue = {
|
|
430
440
|
queries: []
|
|
431
441
|
}, keyValueStoreKey = STORED_QUERIES_NAMESPACE;
|
|
432
442
|
function useSavedQueries() {
|
|
433
|
-
const $ = c(
|
|
443
|
+
const $ = c(45), keyValueStore = useKeyValueStore();
|
|
434
444
|
let t0;
|
|
435
|
-
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 =
|
|
436
|
-
|
|
445
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = {
|
|
446
|
+
apiVersion: DEFAULT_API_VERSION
|
|
447
|
+
}, $[0] = t0) : t0 = $[0];
|
|
448
|
+
const workspaceClient = useClient(t0), currentUser = useCurrentUser(), [value, setValue] = useState(defaultValue);
|
|
437
449
|
let t1;
|
|
438
|
-
$[1]
|
|
439
|
-
const
|
|
450
|
+
$[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[1] = t1) : t1 = $[1];
|
|
451
|
+
const [sharedQueries, setSharedQueries] = useState(t1), [saving, setSaving] = useState(!1);
|
|
440
452
|
let t2;
|
|
441
|
-
$[
|
|
442
|
-
|
|
453
|
+
$[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[2] = t2) : t2 = $[2];
|
|
454
|
+
const [deleting, setDeleting] = useState(t2), [saveQueryError, setSaveQueryError] = useState(), [deleteQueryError, setDeleteQueryError] = useState(), [error, setError] = useState();
|
|
455
|
+
let t3;
|
|
456
|
+
$[3] !== keyValueStore ? (t3 = keyValueStore.getKey(keyValueStoreKey), $[3] = keyValueStore, $[4] = t3) : t3 = $[4];
|
|
457
|
+
const personalQueries = t3;
|
|
458
|
+
let t4;
|
|
459
|
+
$[5] !== currentUser?.id ? (t4 = (docs) => {
|
|
460
|
+
const currentUserId = currentUser?.id;
|
|
461
|
+
return docs.map((doc) => ({
|
|
462
|
+
_key: doc._id,
|
|
463
|
+
authorId: doc.authorId,
|
|
464
|
+
isOwnedByCurrentUser: doc.authorId === currentUserId,
|
|
465
|
+
savedAt: doc.savedAt,
|
|
466
|
+
shared: !0,
|
|
467
|
+
title: doc.title,
|
|
468
|
+
url: doc.url
|
|
469
|
+
}));
|
|
470
|
+
}, $[5] = currentUser?.id, $[6] = t4) : t4 = $[6];
|
|
471
|
+
const mapSharedQueries = t4;
|
|
472
|
+
let t5, t6;
|
|
473
|
+
$[7] !== personalQueries ? (t5 = () => {
|
|
474
|
+
const sub = personalQueries.pipe(startWith(defaultValue), map(_temp$5)).subscribe({
|
|
443
475
|
next: setValue,
|
|
444
476
|
error: (err) => setError(err)
|
|
445
477
|
});
|
|
446
478
|
return () => sub?.unsubscribe();
|
|
447
|
-
}, $[
|
|
448
|
-
let
|
|
449
|
-
$[
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
479
|
+
}, t6 = [personalQueries], $[7] = personalQueries, $[8] = t5, $[9] = t6) : (t5 = $[8], t6 = $[9]), useEffect(t5, t6);
|
|
480
|
+
let t7, t8;
|
|
481
|
+
$[10] !== mapSharedQueries || $[11] !== workspaceClient ? (t7 = () => {
|
|
482
|
+
let cancelled = !1;
|
|
483
|
+
const fetchSharedQueries = async () => {
|
|
484
|
+
const nextDocs = await workspaceClient.fetch(SHARED_QUERIES_QUERY, {
|
|
485
|
+
sharedQueryType: SHARED_QUERY_DOCUMENT_TYPE
|
|
486
|
+
}) || [];
|
|
487
|
+
cancelled || setSharedQueries(mapSharedQueries(nextDocs));
|
|
488
|
+
};
|
|
489
|
+
fetchSharedQueries().catch((err_0) => {
|
|
490
|
+
cancelled || setError(err_0);
|
|
491
|
+
});
|
|
492
|
+
const sub_0 = workspaceClient.observable.listen("*[_type == $sharedQueryType]", {
|
|
493
|
+
sharedQueryType: SHARED_QUERY_DOCUMENT_TYPE
|
|
494
|
+
}, SHARED_QUERY_LISTEN_OPTIONS).subscribe({
|
|
495
|
+
next: () => {
|
|
496
|
+
fetchSharedQueries().catch((err_1) => {
|
|
497
|
+
cancelled || setError(err_1);
|
|
498
|
+
});
|
|
499
|
+
},
|
|
500
|
+
error: (err_2) => {
|
|
501
|
+
cancelled || setError(err_2);
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
return () => {
|
|
505
|
+
cancelled = !0, sub_0.unsubscribe();
|
|
506
|
+
};
|
|
507
|
+
}, t8 = [workspaceClient, mapSharedQueries], $[10] = mapSharedQueries, $[11] = workspaceClient, $[12] = t7, $[13] = t8) : (t7 = $[12], t8 = $[13]), useEffect(t7, t8);
|
|
508
|
+
let t9;
|
|
509
|
+
$[14] !== sharedQueries || $[15] !== value.queries ? (t9 = [...sharedQueries, ...value.queries].sort(_temp2$4), $[14] = sharedQueries, $[15] = value.queries, $[16] = t9) : t9 = $[16];
|
|
510
|
+
const queries = t9;
|
|
511
|
+
let t10;
|
|
512
|
+
$[17] !== currentUser || $[18] !== keyValueStore || $[19] !== mapSharedQueries || $[20] !== value.queries || $[21] !== workspaceClient ? (t10 = async (query) => {
|
|
513
|
+
if (setSaving(!0), setSaveQueryError(void 0), query.shared) {
|
|
514
|
+
if (!currentUser?.id) {
|
|
515
|
+
const authError = new Error("No current user found. Unable to save shared query.");
|
|
516
|
+
throw setSaveQueryError(authError), setSaving(!1), authError;
|
|
517
|
+
}
|
|
518
|
+
try {
|
|
519
|
+
const createdDoc = await workspaceClient.create({
|
|
520
|
+
_type: SHARED_QUERY_DOCUMENT_TYPE,
|
|
521
|
+
authorId: currentUser.id,
|
|
522
|
+
savedAt: query.savedAt,
|
|
523
|
+
title: query.title,
|
|
524
|
+
url: query.url
|
|
525
|
+
});
|
|
526
|
+
setSharedQueries((prev) => [...mapSharedQueries([createdDoc]), ...prev]), setSaving(!1);
|
|
527
|
+
return;
|
|
528
|
+
} catch (t112) {
|
|
529
|
+
const err_3 = t112, saveError = err_3 instanceof Error ? err_3 : new Error(String(err_3));
|
|
530
|
+
throw setSaveQueryError(saveError), setSaving(!1), saveError;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
453
533
|
try {
|
|
454
534
|
const newQueries = [{
|
|
455
535
|
...query,
|
|
@@ -460,15 +540,33 @@ function useSavedQueries() {
|
|
|
460
540
|
}), await keyValueStore.setKey(keyValueStoreKey, {
|
|
461
541
|
queries: newQueries
|
|
462
542
|
});
|
|
463
|
-
} catch (
|
|
464
|
-
|
|
543
|
+
} catch (t122) {
|
|
544
|
+
const err_4 = t122, saveError_0 = err_4 instanceof Error ? err_4 : new Error(String(err_4));
|
|
545
|
+
throw setSaveQueryError(saveError_0), setSaving(!1), saveError_0;
|
|
465
546
|
}
|
|
466
547
|
setSaving(!1);
|
|
467
|
-
}, $[
|
|
468
|
-
const saveQuery =
|
|
469
|
-
let
|
|
470
|
-
$[
|
|
471
|
-
setSaving(!0), setSaveQueryError(void 0)
|
|
548
|
+
}, $[17] = currentUser, $[18] = keyValueStore, $[19] = mapSharedQueries, $[20] = value.queries, $[21] = workspaceClient, $[22] = t10) : t10 = $[22];
|
|
549
|
+
const saveQuery = t10;
|
|
550
|
+
let t11;
|
|
551
|
+
$[23] !== currentUser || $[24] !== keyValueStore || $[25] !== mapSharedQueries || $[26] !== value.queries || $[27] !== workspaceClient ? (t11 = async (query_0) => {
|
|
552
|
+
if (setSaving(!0), setSaveQueryError(void 0), query_0.shared) {
|
|
553
|
+
if (!currentUser?.id || query_0.authorId !== currentUser.id) {
|
|
554
|
+
const authError_0 = new Error("Only the author can update a shared query.");
|
|
555
|
+
throw setSaveQueryError(authError_0), setSaving(!1), authError_0;
|
|
556
|
+
}
|
|
557
|
+
try {
|
|
558
|
+
const updatedDoc = await workspaceClient.patch(query_0._key).set({
|
|
559
|
+
savedAt: query_0.savedAt,
|
|
560
|
+
title: query_0.title,
|
|
561
|
+
url: query_0.url
|
|
562
|
+
}).commit(), [updatedSharedQuery] = mapSharedQueries([updatedDoc]);
|
|
563
|
+
setSharedQueries((prev_0) => prev_0.map((existingQuery) => existingQuery._key === query_0._key ? updatedSharedQuery : existingQuery)), setSaving(!1);
|
|
564
|
+
return;
|
|
565
|
+
} catch (t122) {
|
|
566
|
+
const err_5 = t122, updateError = err_5 instanceof Error ? err_5 : new Error(String(err_5));
|
|
567
|
+
throw setSaveQueryError(updateError), setSaving(!1), updateError;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
472
570
|
try {
|
|
473
571
|
const updatedQueries = value.queries.map((q) => q._key === query_0._key ? {
|
|
474
572
|
...q,
|
|
@@ -479,15 +577,30 @@ function useSavedQueries() {
|
|
|
479
577
|
}), await keyValueStore.setKey(keyValueStoreKey, {
|
|
480
578
|
queries: updatedQueries
|
|
481
579
|
});
|
|
482
|
-
} catch (
|
|
483
|
-
|
|
580
|
+
} catch (t132) {
|
|
581
|
+
const err_6 = t132, updateError_0 = err_6 instanceof Error ? err_6 : new Error(String(err_6));
|
|
582
|
+
throw setSaveQueryError(updateError_0), setSaving(!1), updateError_0;
|
|
484
583
|
}
|
|
485
584
|
setSaving(!1);
|
|
486
|
-
}, $[
|
|
487
|
-
const updateQuery =
|
|
488
|
-
let
|
|
489
|
-
$[
|
|
490
|
-
setDeleting((
|
|
585
|
+
}, $[23] = currentUser, $[24] = keyValueStore, $[25] = mapSharedQueries, $[26] = value.queries, $[27] = workspaceClient, $[28] = t11) : t11 = $[28];
|
|
586
|
+
const updateQuery = t11;
|
|
587
|
+
let t12;
|
|
588
|
+
$[29] !== currentUser || $[30] !== keyValueStore || $[31] !== sharedQueries || $[32] !== value.queries || $[33] !== workspaceClient ? (t12 = async (key) => {
|
|
589
|
+
setDeleting((prev_1) => [...prev_1, key]), setDeleteQueryError(void 0);
|
|
590
|
+
const clearDeleting = () => setDeleting((prev_2) => prev_2.filter((k) => k !== key)), sharedQuery = sharedQueries.find((query_1) => query_1._key === key && query_1.shared);
|
|
591
|
+
if (sharedQuery) {
|
|
592
|
+
if (!currentUser?.id || sharedQuery.authorId !== currentUser.id) {
|
|
593
|
+
setDeleteQueryError(new Error("Only the author can delete a shared query.")), clearDeleting();
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
try {
|
|
597
|
+
await workspaceClient.delete(key), setSharedQueries((prev_3) => prev_3.filter((query_2) => query_2._key !== key));
|
|
598
|
+
} catch (t132) {
|
|
599
|
+
setDeleteQueryError(t132);
|
|
600
|
+
}
|
|
601
|
+
clearDeleting();
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
491
604
|
try {
|
|
492
605
|
const filteredQueries = value.queries.filter((q_0) => q_0._key !== key);
|
|
493
606
|
setValue({
|
|
@@ -495,15 +608,15 @@ function useSavedQueries() {
|
|
|
495
608
|
}), await keyValueStore.setKey(keyValueStoreKey, {
|
|
496
609
|
queries: filteredQueries
|
|
497
610
|
});
|
|
498
|
-
} catch (
|
|
499
|
-
setDeleteQueryError(
|
|
611
|
+
} catch (t14) {
|
|
612
|
+
setDeleteQueryError(t14);
|
|
500
613
|
}
|
|
501
|
-
|
|
502
|
-
}, $[
|
|
503
|
-
const deleteQuery =
|
|
504
|
-
let
|
|
505
|
-
return $[
|
|
506
|
-
queries
|
|
614
|
+
clearDeleting();
|
|
615
|
+
}, $[29] = currentUser, $[30] = keyValueStore, $[31] = sharedQueries, $[32] = value.queries, $[33] = workspaceClient, $[34] = t12) : t12 = $[34];
|
|
616
|
+
const deleteQuery = t12;
|
|
617
|
+
let t13;
|
|
618
|
+
return $[35] !== deleteQuery || $[36] !== deleteQueryError || $[37] !== deleting || $[38] !== error || $[39] !== queries || $[40] !== saveQuery || $[41] !== saveQueryError || $[42] !== saving || $[43] !== updateQuery ? (t13 = {
|
|
619
|
+
queries,
|
|
507
620
|
saveQuery,
|
|
508
621
|
updateQuery,
|
|
509
622
|
deleteQuery,
|
|
@@ -512,7 +625,10 @@ function useSavedQueries() {
|
|
|
512
625
|
saveQueryError,
|
|
513
626
|
deleteQueryError,
|
|
514
627
|
error
|
|
515
|
-
}, $[
|
|
628
|
+
}, $[35] = deleteQuery, $[36] = deleteQueryError, $[37] = deleting, $[38] = error, $[39] = queries, $[40] = saveQuery, $[41] = saveQueryError, $[42] = saving, $[43] = updateQuery, $[44] = t13) : t13 = $[44], t13;
|
|
629
|
+
}
|
|
630
|
+
function _temp2$4(a, b) {
|
|
631
|
+
return new Date(b.savedAt || 0).getTime() - new Date(a.savedAt || 0).getTime();
|
|
516
632
|
}
|
|
517
633
|
function _temp$5(data) {
|
|
518
634
|
return data || defaultValue;
|
|
@@ -525,48 +641,53 @@ const FixedHeader = styled(Stack).withConfig({
|
|
|
525
641
|
}) => theme.sanity.color.base.bg};z-index:1;`, ScrollContainer = styled(Box).withConfig({
|
|
526
642
|
displayName: "ScrollContainer",
|
|
527
643
|
componentId: "sc-14q7beb-1"
|
|
528
|
-
})`height:
|
|
529
|
-
theme
|
|
530
|
-
}) => theme.sanity.color.base.border};border-radius:4px;}`;
|
|
644
|
+
})`height:auto;width:100%;min-width:0;overflow:visible;`;
|
|
531
645
|
function QueryRecall(t0) {
|
|
532
|
-
const $ = c(
|
|
646
|
+
const $ = c(130), {
|
|
533
647
|
url,
|
|
534
648
|
getStateFromUrl,
|
|
535
649
|
setStateFromParsedUrl,
|
|
536
650
|
currentQuery,
|
|
537
651
|
currentParams,
|
|
538
|
-
generateUrl
|
|
539
|
-
|
|
652
|
+
generateUrl,
|
|
653
|
+
compactMode: t1
|
|
654
|
+
} = t0, compactMode = t1 === void 0 ? !1 : t1, toast = useToast(), {
|
|
540
655
|
saveQuery,
|
|
541
656
|
updateQuery,
|
|
542
657
|
queries,
|
|
543
658
|
deleteQuery,
|
|
544
|
-
saving
|
|
545
|
-
saveQueryError
|
|
659
|
+
saving
|
|
546
660
|
} = useSavedQueries(), {
|
|
547
661
|
t
|
|
548
662
|
} = useTranslation(visionLocaleNamespace);
|
|
549
|
-
let
|
|
550
|
-
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
663
|
+
let t2;
|
|
664
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = {
|
|
551
665
|
month: "short",
|
|
552
666
|
day: "numeric",
|
|
553
667
|
year: "numeric",
|
|
554
668
|
hour: "numeric",
|
|
555
669
|
minute: "2-digit",
|
|
556
670
|
hour12: !0
|
|
557
|
-
}, $[0] =
|
|
558
|
-
const formatDate = useDateTimeFormat(
|
|
559
|
-
let t2;
|
|
560
|
-
$[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[1] = t2) : t2 = $[1];
|
|
561
|
-
const [optimisticTitles, setOptimisticTitles] = useState(t2), [searchQuery, setSearchQuery] = useState(""), [selectedUrl, setSelectedUrl] = useState(url);
|
|
671
|
+
}, $[0] = t2) : t2 = $[0];
|
|
672
|
+
const formatDate = useDateTimeFormat(t2), [editingKey, setEditingKey] = useState(null), [editingTitle, setEditingTitle] = useState("");
|
|
562
673
|
let t3;
|
|
563
|
-
$[
|
|
674
|
+
$[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[1] = t3) : t3 = $[1];
|
|
675
|
+
const [optimisticTitles, setOptimisticTitles] = useState(t3), [searchQuery, setSearchQuery] = useState(""), [queryFilter, setQueryFilter] = useState("all"), [selectedUrl, setSelectedUrl] = useState(url);
|
|
676
|
+
let t4;
|
|
677
|
+
$[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t4 = [], $[2] = t4) : t4 = $[2];
|
|
678
|
+
const [pendingUnshareKeys, setPendingUnshareKeys] = useState(t4), [shareDialogQuery, setShareDialogQuery] = useState(null);
|
|
679
|
+
let t5;
|
|
680
|
+
$[3] !== currentParams || $[4] !== currentQuery || $[5] !== formatDate || $[6] !== generateUrl || $[7] !== getStateFromUrl || $[8] !== queries || $[9] !== saveQuery || $[10] !== t || $[11] !== toast ? (t5 = async () => {
|
|
564
681
|
const newUrl = generateUrl(currentQuery, currentParams);
|
|
565
682
|
if (queries?.some((q) => {
|
|
683
|
+
if (q.shared)
|
|
684
|
+
return !1;
|
|
566
685
|
const savedQueryObj = getStateFromUrl(q.url);
|
|
567
686
|
return savedQueryObj && savedQueryObj.query === currentQuery && isEqual(savedQueryObj.params, currentParams);
|
|
568
687
|
})) {
|
|
569
688
|
const duplicateQuery = queries?.find((q_0) => {
|
|
689
|
+
if (q_0.shared)
|
|
690
|
+
return !1;
|
|
570
691
|
const savedQueryObj_0 = getStateFromUrl(q_0.url);
|
|
571
692
|
return savedQueryObj_0 && savedQueryObj_0.query === currentQuery && isEqual(savedQueryObj_0.params, currentParams);
|
|
572
693
|
});
|
|
@@ -578,65 +699,145 @@ function QueryRecall(t0) {
|
|
|
578
699
|
});
|
|
579
700
|
return;
|
|
580
701
|
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
702
|
+
if (newUrl)
|
|
703
|
+
try {
|
|
704
|
+
await saveQuery({
|
|
705
|
+
shared: !1,
|
|
706
|
+
url: newUrl,
|
|
707
|
+
savedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
708
|
+
title: t("label.untitled-query")
|
|
709
|
+
}), setSelectedUrl(newUrl), toast.push({
|
|
710
|
+
closable: !0,
|
|
711
|
+
status: "success",
|
|
712
|
+
title: t("save-query.success")
|
|
713
|
+
});
|
|
714
|
+
} catch (t62) {
|
|
715
|
+
const err = t62;
|
|
716
|
+
toast.push({
|
|
717
|
+
closable: !0,
|
|
718
|
+
status: "error",
|
|
719
|
+
title: t("save-query.error"),
|
|
720
|
+
description: err instanceof Error ? err.message : String(err)
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
}, $[3] = currentParams, $[4] = currentQuery, $[5] = formatDate, $[6] = generateUrl, $[7] = getStateFromUrl, $[8] = queries, $[9] = saveQuery, $[10] = t, $[11] = toast, $[12] = t5) : t5 = $[12];
|
|
724
|
+
const handleSave = t5;
|
|
725
|
+
let t6;
|
|
726
|
+
$[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t6 = (query) => {
|
|
727
|
+
setShareDialogQuery(query);
|
|
728
|
+
}, $[13] = t6) : t6 = $[13];
|
|
729
|
+
const handleShareQuery = t6;
|
|
730
|
+
let t7;
|
|
731
|
+
$[14] !== deleteQuery || $[15] !== saveQuery || $[16] !== shareDialogQuery || $[17] !== t || $[18] !== toast ? (t7 = async () => {
|
|
732
|
+
if (!shareDialogQuery)
|
|
733
|
+
return;
|
|
734
|
+
const sharedQueryKey = shareDialogQuery._key, sharedQueryUrl = shareDialogQuery.url, sharedQueryTitle = shareDialogQuery.title || t("label.untitled-query");
|
|
735
|
+
try {
|
|
736
|
+
await saveQuery({
|
|
737
|
+
shared: !0,
|
|
738
|
+
title: sharedQueryTitle,
|
|
739
|
+
url: sharedQueryUrl,
|
|
740
|
+
savedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
741
|
+
}), await deleteQuery(sharedQueryKey), toast.push({
|
|
742
|
+
closable: !0,
|
|
743
|
+
status: "success",
|
|
744
|
+
title: t("save-query.shared-success")
|
|
745
|
+
});
|
|
746
|
+
} catch (t82) {
|
|
747
|
+
const err_0 = t82;
|
|
748
|
+
toast.push({
|
|
749
|
+
closable: !0,
|
|
750
|
+
status: "error",
|
|
751
|
+
title: t("save-query.error"),
|
|
752
|
+
description: err_0 instanceof Error ? err_0.message : String(err_0)
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
setShareDialogQuery(null);
|
|
756
|
+
}, $[14] = deleteQuery, $[15] = saveQuery, $[16] = shareDialogQuery, $[17] = t, $[18] = toast, $[19] = t7) : t7 = $[19];
|
|
757
|
+
const handleConfirmShareQuery = t7;
|
|
758
|
+
let t8;
|
|
759
|
+
$[20] !== deleteQuery || $[21] !== formatDate || $[22] !== getStateFromUrl || $[23] !== queries || $[24] !== saveQuery || $[25] !== t || $[26] !== toast ? (t8 = async (query_0) => {
|
|
760
|
+
setPendingUnshareKeys((prev) => [...prev, query_0._key]);
|
|
761
|
+
const clearPending = () => setPendingUnshareKeys((prev_0) => prev_0.filter((key) => key !== query_0._key)), nextQueryObj = getStateFromUrl(query_0.url), duplicatePersonalQuery = queries?.find((existingQuery) => {
|
|
762
|
+
if (existingQuery._key === query_0._key || existingQuery.shared)
|
|
763
|
+
return !1;
|
|
764
|
+
const existingQueryObj = getStateFromUrl(existingQuery.url);
|
|
765
|
+
return nextQueryObj && existingQueryObj && existingQueryObj.query === nextQueryObj.query && isEqual(existingQueryObj.params, nextQueryObj.params);
|
|
766
|
+
}), unsharedQueryTitle = query_0.title || t("label.untitled-query");
|
|
767
|
+
if (duplicatePersonalQuery) {
|
|
768
|
+
toast.push({
|
|
769
|
+
closable: !0,
|
|
770
|
+
status: "warning",
|
|
771
|
+
title: t("save-query.already-saved"),
|
|
772
|
+
description: `${duplicatePersonalQuery.title} - ${formatDate.format(new Date(duplicatePersonalQuery.savedAt || ""))}`
|
|
773
|
+
}), clearPending();
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
776
|
+
try {
|
|
777
|
+
await saveQuery({
|
|
778
|
+
shared: !1,
|
|
779
|
+
title: unsharedQueryTitle,
|
|
780
|
+
url: query_0.url,
|
|
781
|
+
savedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
782
|
+
}), await deleteQuery(query_0._key), toast.push({
|
|
783
|
+
closable: !0,
|
|
784
|
+
status: "success",
|
|
785
|
+
title: t("save-query.unshared-success")
|
|
786
|
+
}), clearPending();
|
|
787
|
+
} catch (t92) {
|
|
788
|
+
const err_1 = t92;
|
|
789
|
+
toast.push({
|
|
790
|
+
closable: !0,
|
|
791
|
+
status: "error",
|
|
792
|
+
title: t("save-query.error"),
|
|
793
|
+
description: err_1 instanceof Error ? err_1.message : String(err_1)
|
|
794
|
+
}), clearPending();
|
|
795
|
+
}
|
|
796
|
+
}, $[20] = deleteQuery, $[21] = formatDate, $[22] = getStateFromUrl, $[23] = queries, $[24] = saveQuery, $[25] = t, $[26] = toast, $[27] = t8) : t8 = $[27];
|
|
797
|
+
const handleUnshareQuery = t8;
|
|
798
|
+
let t9;
|
|
799
|
+
$[28] !== t || $[29] !== toast || $[30] !== updateQuery ? (t9 = async (query_1, newTitle) => {
|
|
800
|
+
setEditingKey(null), setOptimisticTitles((prev_1) => ({
|
|
801
|
+
...prev_1,
|
|
802
|
+
[query_1._key]: newTitle
|
|
602
803
|
}));
|
|
603
804
|
try {
|
|
604
805
|
await updateQuery({
|
|
605
|
-
...
|
|
806
|
+
...query_1,
|
|
606
807
|
title: newTitle
|
|
607
|
-
}), setOptimisticTitles((
|
|
808
|
+
}), setOptimisticTitles((prev_3) => {
|
|
608
809
|
const next_0 = {
|
|
609
|
-
...
|
|
810
|
+
...prev_3
|
|
610
811
|
};
|
|
611
|
-
return delete next_0[
|
|
812
|
+
return delete next_0[query_1._key], next_0;
|
|
612
813
|
});
|
|
613
|
-
} catch (
|
|
614
|
-
const
|
|
615
|
-
setOptimisticTitles((
|
|
814
|
+
} catch (t102) {
|
|
815
|
+
const err_2 = t102;
|
|
816
|
+
setOptimisticTitles((prev_2) => {
|
|
616
817
|
const next = {
|
|
617
|
-
...
|
|
818
|
+
...prev_2
|
|
618
819
|
};
|
|
619
|
-
return delete next[
|
|
820
|
+
return delete next[query_1._key], next;
|
|
620
821
|
}), toast.push({
|
|
621
822
|
closable: !0,
|
|
622
823
|
status: "error",
|
|
623
824
|
title: t("save-query.error"),
|
|
624
|
-
description:
|
|
825
|
+
description: err_2.message
|
|
625
826
|
});
|
|
626
827
|
}
|
|
627
|
-
}, $[
|
|
628
|
-
const handleTitleSave =
|
|
629
|
-
let
|
|
630
|
-
$[
|
|
828
|
+
}, $[28] = t, $[29] = toast, $[30] = updateQuery, $[31] = t9) : t9 = $[31];
|
|
829
|
+
const handleTitleSave = t9;
|
|
830
|
+
let t10;
|
|
831
|
+
$[32] !== currentParams || $[33] !== currentQuery || $[34] !== formatDate || $[35] !== generateUrl || $[36] !== getStateFromUrl || $[37] !== queries || $[38] !== t || $[39] !== toast || $[40] !== updateQuery ? (t10 = async (query_2) => {
|
|
631
832
|
const newUrl_0 = generateUrl(currentQuery, currentParams);
|
|
632
833
|
if (queries?.some((q_1) => {
|
|
633
|
-
if (q_1._key ===
|
|
834
|
+
if (q_1._key === query_2._key)
|
|
634
835
|
return !1;
|
|
635
836
|
const savedQueryObj_1 = getStateFromUrl(q_1.url);
|
|
636
837
|
return savedQueryObj_1 && savedQueryObj_1.query === currentQuery && isEqual(savedQueryObj_1.params, currentParams);
|
|
637
838
|
})) {
|
|
638
839
|
const duplicateQuery_0 = queries?.find((q_2) => {
|
|
639
|
-
if (q_2._key ===
|
|
840
|
+
if (q_2._key === query_2._key)
|
|
640
841
|
return !1;
|
|
641
842
|
const savedQueryObj_2 = getStateFromUrl(q_2.url);
|
|
642
843
|
return savedQueryObj_2 && savedQueryObj_2.query === currentQuery && isEqual(savedQueryObj_2.params, currentParams);
|
|
@@ -651,7 +852,7 @@ function QueryRecall(t0) {
|
|
|
651
852
|
}
|
|
652
853
|
try {
|
|
653
854
|
await updateQuery({
|
|
654
|
-
...
|
|
855
|
+
...query_2,
|
|
655
856
|
url: newUrl_0,
|
|
656
857
|
savedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
657
858
|
}), setSelectedUrl(newUrl_0), toast.push({
|
|
@@ -659,69 +860,111 @@ function QueryRecall(t0) {
|
|
|
659
860
|
status: "success",
|
|
660
861
|
title: t("save-query.success")
|
|
661
862
|
});
|
|
662
|
-
} catch (
|
|
663
|
-
const
|
|
863
|
+
} catch (t112) {
|
|
864
|
+
const err_3 = t112;
|
|
664
865
|
toast.push({
|
|
665
866
|
closable: !0,
|
|
666
867
|
status: "error",
|
|
667
868
|
title: t("save-query.error"),
|
|
668
|
-
description:
|
|
869
|
+
description: err_3.message
|
|
669
870
|
});
|
|
670
871
|
}
|
|
671
|
-
}, $[
|
|
672
|
-
const handleUpdate =
|
|
673
|
-
let T0, T1,
|
|
674
|
-
if ($[
|
|
675
|
-
const filteredQueries = queries?.filter((q_3) =>
|
|
872
|
+
}, $[32] = currentParams, $[33] = currentQuery, $[34] = formatDate, $[35] = generateUrl, $[36] = getStateFromUrl, $[37] = queries, $[38] = t, $[39] = toast, $[40] = updateQuery, $[41] = t10) : t10 = $[41];
|
|
873
|
+
const handleUpdate = t10;
|
|
874
|
+
let T0, T1, t11, t12, t13, t14;
|
|
875
|
+
if ($[42] !== compactMode || $[43] !== currentParams || $[44] !== currentQuery || $[45] !== deleteQuery || $[46] !== editingKey || $[47] !== editingTitle || $[48] !== formatDate || $[49] !== getStateFromUrl || $[50] !== handleSave || $[51] !== handleTitleSave || $[52] !== handleUnshareQuery || $[53] !== handleUpdate || $[54] !== optimisticTitles || $[55] !== pendingUnshareKeys || $[56] !== queries || $[57] !== queryFilter || $[58] !== saving || $[59] !== searchQuery || $[60] !== selectedUrl || $[61] !== setStateFromParsedUrl || $[62] !== t) {
|
|
876
|
+
const filteredQueries = queries?.filter((q_3) => !pendingUnshareKeys.includes(q_3._key))?.filter((q_4) => {
|
|
877
|
+
const matchesSearch = (q_4.title ?? "").toLowerCase().includes(searchQuery.toLowerCase()), matchesFilter = queryFilter === "all" || queryFilter === "personal" && !q_4.shared || queryFilter === "shared" && q_4.shared;
|
|
878
|
+
return matchesSearch && matchesFilter;
|
|
879
|
+
});
|
|
676
880
|
T1 = ScrollContainer;
|
|
677
|
-
let
|
|
678
|
-
$[
|
|
679
|
-
|
|
680
|
-
}, $[
|
|
681
|
-
let
|
|
682
|
-
$[
|
|
683
|
-
let
|
|
684
|
-
$[
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
let
|
|
688
|
-
$[
|
|
689
|
-
let
|
|
690
|
-
$[
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
] }), $[
|
|
694
|
-
let
|
|
695
|
-
$[
|
|
696
|
-
let
|
|
697
|
-
$[
|
|
698
|
-
let
|
|
699
|
-
$[
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
881
|
+
let t152;
|
|
882
|
+
$[69] !== t ? (t152 = t("label.saved-queries"), $[69] = t, $[70] = t152) : t152 = $[70];
|
|
883
|
+
let t162;
|
|
884
|
+
$[71] !== t152 ? (t162 = /* @__PURE__ */ jsx(StyledLabel, { muted: !0, children: t152 }), $[71] = t152, $[72] = t162) : t162 = $[72];
|
|
885
|
+
let t172;
|
|
886
|
+
$[73] !== t ? (t172 = t("action.save-query"), $[73] = t, $[74] = t172) : t172 = $[74];
|
|
887
|
+
let t18;
|
|
888
|
+
$[75] !== handleSave ? (t18 = () => {
|
|
889
|
+
handleSave();
|
|
890
|
+
}, $[75] = handleSave, $[76] = t18) : t18 = $[76];
|
|
891
|
+
let t19;
|
|
892
|
+
$[77] !== saving || $[78] !== t172 || $[79] !== t18 ? (t19 = /* @__PURE__ */ jsx(Button, { label: t172, icon: AddIcon, disabled: saving, onClick: t18, mode: "bleed" }), $[77] = saving, $[78] = t172, $[79] = t18, $[80] = t19) : t19 = $[80];
|
|
893
|
+
let t20;
|
|
894
|
+
$[81] !== t162 || $[82] !== t19 ? (t20 = /* @__PURE__ */ jsxs(Flex, { padding: 3, paddingTop: 2, paddingBottom: 0, justify: "space-between", align: "center", children: [
|
|
895
|
+
t162,
|
|
896
|
+
t19
|
|
897
|
+
] }), $[81] = t162, $[82] = t19, $[83] = t20) : t20 = $[83];
|
|
898
|
+
let t21;
|
|
899
|
+
$[84] !== t ? (t21 = t("label.search-queries"), $[84] = t, $[85] = t21) : t21 = $[85];
|
|
900
|
+
let t22;
|
|
901
|
+
$[86] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t22 = (event) => setSearchQuery(event.currentTarget.value), $[86] = t22) : t22 = $[86];
|
|
902
|
+
let t23;
|
|
903
|
+
$[87] !== searchQuery || $[88] !== t21 ? (t23 = /* @__PURE__ */ jsx(Box, { padding: 3, paddingTop: 0, children: /* @__PURE__ */ jsx(TextInput, { placeholder: t21, icon: SearchIcon, value: searchQuery, onChange: t22 }) }), $[87] = searchQuery, $[88] = t21, $[89] = t23) : t23 = $[89];
|
|
904
|
+
let t24;
|
|
905
|
+
$[90] !== t ? (t24 = t("label.all"), $[90] = t, $[91] = t24) : t24 = $[91];
|
|
906
|
+
const t25 = queryFilter === "all";
|
|
907
|
+
let t26;
|
|
908
|
+
$[92] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t26 = () => setQueryFilter("all"), $[92] = t26) : t26 = $[92];
|
|
909
|
+
let t27;
|
|
910
|
+
$[93] !== t24 || $[94] !== t25 ? (t27 = /* @__PURE__ */ jsx(Tab, { id: "query-filter-all", "aria-controls": "vision-query-recall-list", label: t24, selected: t25, onClick: t26 }), $[93] = t24, $[94] = t25, $[95] = t27) : t27 = $[95];
|
|
911
|
+
let t28;
|
|
912
|
+
$[96] !== t ? (t28 = t("label.personal"), $[96] = t, $[97] = t28) : t28 = $[97];
|
|
913
|
+
const t29 = queryFilter === "personal";
|
|
914
|
+
let t30;
|
|
915
|
+
$[98] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t30 = () => setQueryFilter("personal"), $[98] = t30) : t30 = $[98];
|
|
916
|
+
let t31;
|
|
917
|
+
$[99] !== t28 || $[100] !== t29 ? (t31 = /* @__PURE__ */ jsx(Tab, { id: "query-filter-personal", "aria-controls": "vision-query-recall-list", label: t28, selected: t29, onClick: t30 }), $[99] = t28, $[100] = t29, $[101] = t31) : t31 = $[101];
|
|
918
|
+
let t32;
|
|
919
|
+
$[102] !== t ? (t32 = t("label.shared"), $[102] = t, $[103] = t32) : t32 = $[103];
|
|
920
|
+
const t33 = queryFilter === "shared";
|
|
921
|
+
let t34;
|
|
922
|
+
$[104] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t34 = () => setQueryFilter("shared"), $[104] = t34) : t34 = $[104];
|
|
923
|
+
let t35;
|
|
924
|
+
$[105] !== t32 || $[106] !== t33 ? (t35 = /* @__PURE__ */ jsx(Tab, { id: "query-filter-shared", "aria-controls": "vision-query-recall-list", label: t32, selected: t33, onClick: t34 }), $[105] = t32, $[106] = t33, $[107] = t35) : t35 = $[107];
|
|
925
|
+
let t36;
|
|
926
|
+
$[108] !== t27 || $[109] !== t31 || $[110] !== t35 ? (t36 = /* @__PURE__ */ jsx(Box, { paddingX: 3, paddingBottom: 2, children: /* @__PURE__ */ jsxs(TabList, { space: 1, children: [
|
|
927
|
+
t27,
|
|
928
|
+
t31,
|
|
929
|
+
t35
|
|
930
|
+
] }) }), $[108] = t27, $[109] = t31, $[110] = t35, $[111] = t36) : t36 = $[111], $[112] !== t20 || $[113] !== t23 || $[114] !== t36 ? (t14 = /* @__PURE__ */ jsxs(FixedHeader, { space: 3, children: [
|
|
931
|
+
t20,
|
|
932
|
+
t23,
|
|
933
|
+
t36
|
|
934
|
+
] }), $[112] = t20, $[113] = t23, $[114] = t36, $[115] = t14) : t14 = $[115], T0 = Stack, t11 = "vision-query-recall-list", t12 = 3, t13 = filteredQueries?.map((q_5, index) => {
|
|
935
|
+
const queryObj = getStateFromUrl(q_5.url), fullQueryPreview = queryObj?.query || "", shortQueryPreview = fullQueryPreview.split("{")[0], isSelected = selectedUrl === q_5.url, canMutateQuery = !q_5.shared || q_5.isOwnedByCurrentUser, areQueriesEqual = queryObj && currentQuery === queryObj.query && isEqual(currentParams, queryObj.params), isEdited = isSelected && !areQueriesEqual && canMutateQuery;
|
|
936
|
+
return /* @__PURE__ */ jsx(Card, { width: "fill", paddingX: compactMode ? 3 : 4, paddingY: compactMode ? 3 : 4, tone: "default", onClick: (event_0) => {
|
|
937
|
+
if (event_0.target?.closest('[data-query-actions="true"]'))
|
|
938
|
+
return;
|
|
939
|
+
setSelectedUrl(q_5.url);
|
|
940
|
+
const parsedUrl = getStateFromUrl(q_5.url);
|
|
707
941
|
parsedUrl && setStateFromParsedUrl(parsedUrl);
|
|
708
942
|
}, style: {
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
943
|
+
borderTop: index === 0 ? "1px solid var(--card-border-color)" : void 0,
|
|
944
|
+
position: "relative",
|
|
945
|
+
borderBottom: "1px solid var(--card-border-color)",
|
|
946
|
+
borderLeft: isSelected ? "2px solid var(--card-muted-fg-color)" : "2px solid transparent",
|
|
947
|
+
cursor: "pointer"
|
|
948
|
+
}, children: /* @__PURE__ */ jsxs(Stack, { space: compactMode ? 2 : 3, children: [
|
|
949
|
+
/* @__PURE__ */ jsxs(Flex, { justify: "space-between", align: "center", style: {
|
|
950
|
+
minHeight: "25px"
|
|
951
|
+
}, children: [
|
|
952
|
+
/* @__PURE__ */ jsxs(Flex, { align: "center", gap: 2, paddingRight: 1, style: {
|
|
953
|
+
minWidth: 0,
|
|
954
|
+
flex: 1
|
|
955
|
+
}, children: [
|
|
956
|
+
editingKey === q_5._key ? /* @__PURE__ */ jsx(TextInput, { value: editingTitle, onChange: (event_1) => setEditingTitle(event_1.currentTarget.value), onKeyDown: (event_2) => {
|
|
957
|
+
event_2.key === "Enter" ? handleTitleSave(q_5, editingTitle) : event_2.key === "Escape" && setEditingKey(null);
|
|
958
|
+
}, onBlur: () => handleTitleSave(q_5, editingTitle), autoFocus: !0, style: {
|
|
716
959
|
maxWidth: "170px",
|
|
717
960
|
height: "24px"
|
|
718
|
-
} }) : /* @__PURE__ */ jsx(Text, { weight: "bold", size: 3, textOverflow: "ellipsis", style: {
|
|
719
|
-
maxWidth: "
|
|
720
|
-
cursor: "pointer",
|
|
721
|
-
padding: "
|
|
722
|
-
}, title: optimisticTitles[
|
|
723
|
-
setEditingKey(
|
|
724
|
-
}, children: optimisticTitles[
|
|
961
|
+
} }) : /* @__PURE__ */ jsx(Text, { weight: "bold", size: compactMode ? 2 : 3, textOverflow: "ellipsis", style: {
|
|
962
|
+
maxWidth: compactMode ? "180px" : "220px",
|
|
963
|
+
cursor: canMutateQuery ? "pointer" : "default",
|
|
964
|
+
padding: "2px 0"
|
|
965
|
+
}, title: optimisticTitles[q_5._key] || q_5.title || q_5._key.slice(q_5._key.length - 5, q_5._key.length), onClick: canMutateQuery ? () => {
|
|
966
|
+
setEditingKey(q_5._key), setEditingTitle(q_5.title || q_5._key.slice(0, 5));
|
|
967
|
+
} : void 0, children: optimisticTitles[q_5._key] || q_5.title || q_5._key.slice(q_5._key.length - 5, q_5._key.length) }),
|
|
725
968
|
isEdited && /* @__PURE__ */ jsx(Box, { style: {
|
|
726
969
|
width: "6px",
|
|
727
970
|
height: "6px",
|
|
@@ -729,16 +972,84 @@ function QueryRecall(t0) {
|
|
|
729
972
|
backgroundColor: "var(--card-focus-ring-color)"
|
|
730
973
|
} })
|
|
731
974
|
] }),
|
|
732
|
-
/* @__PURE__ */ jsx(
|
|
733
|
-
|
|
734
|
-
|
|
975
|
+
/* @__PURE__ */ jsx(Flex, { align: "center", gap: 2, children: /* @__PURE__ */ jsx(Box, { "data-query-actions": "true", style: {
|
|
976
|
+
width: "25px",
|
|
977
|
+
height: "25px",
|
|
978
|
+
display: "flex",
|
|
979
|
+
alignItems: "center"
|
|
980
|
+
}, children: (!q_5.shared || canMutateQuery) && /* @__PURE__ */ jsx(MenuButton, { button: /* @__PURE__ */ jsx(ContextMenuButton, {}), id: `${q_5._key}-menu`, menu: /* @__PURE__ */ jsxs(Menu, { children: [
|
|
981
|
+
!q_5.shared && /* @__PURE__ */ jsx(MenuItem, { icon: UsersIcon, padding: 3, text: t("label.share"), onClick: (event_3) => {
|
|
982
|
+
event_3.stopPropagation(), handleShareQuery(q_5);
|
|
983
|
+
} }),
|
|
984
|
+
q_5.shared && canMutateQuery && /* @__PURE__ */ jsx(MenuItem, { icon: UnpublishIcon, padding: 3, text: t("action.unshare"), onClick: (event_4) => {
|
|
985
|
+
event_4.stopPropagation(), handleUnshareQuery(q_5);
|
|
986
|
+
} }),
|
|
987
|
+
canMutateQuery && /* @__PURE__ */ jsx(MenuItem, { tone: "critical", padding: 3, icon: TrashIcon, text: t("action.delete"), onClick: (event_5) => {
|
|
988
|
+
event_5.stopPropagation(), deleteQuery(q_5._key);
|
|
989
|
+
} })
|
|
990
|
+
] }), popover: {
|
|
735
991
|
portal: !0,
|
|
736
992
|
placement: "bottom-end",
|
|
737
993
|
tone: "default"
|
|
738
|
-
} })
|
|
994
|
+
} }) }) })
|
|
995
|
+
] }),
|
|
996
|
+
fullQueryPreview ? /* @__PURE__ */ jsx(Tooltip, { content: /* @__PURE__ */ jsx(Box, { padding: 2, style: {
|
|
997
|
+
maxWidth: "420px",
|
|
998
|
+
maxHeight: "220px",
|
|
999
|
+
overflow: "auto"
|
|
1000
|
+
}, children: /* @__PURE__ */ jsx(Code, { size: 1, children: fullQueryPreview }) }), placement: "top", portal: !0, children: /* @__PURE__ */ jsx(Code, { muted: !0, size: 1, children: shortQueryPreview }) }) : /* @__PURE__ */ jsx(Code, { muted: !0 }),
|
|
1001
|
+
compactMode ? /* @__PURE__ */ jsxs(Stack, { space: 1, style: {
|
|
1002
|
+
paddingTop: 0,
|
|
1003
|
+
minHeight: "30px"
|
|
1004
|
+
}, children: [
|
|
1005
|
+
/* @__PURE__ */ jsxs(Flex, { align: "center", gap: 2, style: {
|
|
1006
|
+
minHeight: "18px"
|
|
1007
|
+
}, children: [
|
|
1008
|
+
/* @__PURE__ */ jsx(Box, { style: {
|
|
1009
|
+
display: "flex",
|
|
1010
|
+
alignItems: "center",
|
|
1011
|
+
justifyContent: "center",
|
|
1012
|
+
width: "17px",
|
|
1013
|
+
height: "17px"
|
|
1014
|
+
}, children: q_5.shared ? /* @__PURE__ */ jsx(UserAvatar, { size: 0, user: q_5.authorId || "", withTooltip: !0 }) : /* @__PURE__ */ jsx(Box, { style: {
|
|
1015
|
+
display: "flex",
|
|
1016
|
+
alignItems: "center",
|
|
1017
|
+
justifyContent: "center",
|
|
1018
|
+
lineHeight: 0,
|
|
1019
|
+
color: "var(--card-muted-fg-color)"
|
|
1020
|
+
}, children: /* @__PURE__ */ jsx(LockIcon, {}) }) }),
|
|
1021
|
+
/* @__PURE__ */ jsx(Badge, { mode: "outline", tone: q_5.shared ? "primary" : "default", style: {
|
|
1022
|
+
whiteSpace: "nowrap",
|
|
1023
|
+
overflow: "hidden",
|
|
1024
|
+
textOverflow: "ellipsis"
|
|
1025
|
+
}, children: q_5.shared ? t("label.shared") : t("label.personal") })
|
|
1026
|
+
] }),
|
|
1027
|
+
/* @__PURE__ */ jsx(Text, { size: 1, muted: !0, children: formatDate.format(new Date(q_5.savedAt || "")) })
|
|
1028
|
+
] }) : /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 2, style: {
|
|
1029
|
+
paddingTop: "2px",
|
|
1030
|
+
minHeight: "20px"
|
|
1031
|
+
}, children: [
|
|
1032
|
+
/* @__PURE__ */ jsx(Box, { style: {
|
|
1033
|
+
display: "flex",
|
|
1034
|
+
alignItems: "center",
|
|
1035
|
+
justifyContent: "center",
|
|
1036
|
+
width: "17px",
|
|
1037
|
+
height: "17px"
|
|
1038
|
+
}, children: q_5.shared ? /* @__PURE__ */ jsx(UserAvatar, { size: 0, user: q_5.authorId || "", withTooltip: !0 }) : /* @__PURE__ */ jsx(Box, { style: {
|
|
1039
|
+
display: "flex",
|
|
1040
|
+
alignItems: "center",
|
|
1041
|
+
justifyContent: "center",
|
|
1042
|
+
lineHeight: 0,
|
|
1043
|
+
color: "var(--card-muted-fg-color)"
|
|
1044
|
+
}, children: /* @__PURE__ */ jsx(LockIcon, {}) }) }),
|
|
1045
|
+
/* @__PURE__ */ jsx(Badge, { mode: "outline", tone: q_5.shared ? "primary" : "default", style: {
|
|
1046
|
+
whiteSpace: "nowrap",
|
|
1047
|
+
overflow: "hidden",
|
|
1048
|
+
textOverflow: "ellipsis"
|
|
1049
|
+
}, children: q_5.shared ? t("label.shared") : t("label.personal") }),
|
|
1050
|
+
/* @__PURE__ */ jsx(Text, { size: 1, muted: !0, children: "\u2022" }),
|
|
1051
|
+
/* @__PURE__ */ jsx(Text, { size: 1, muted: !0, children: formatDate.format(new Date(q_5.savedAt || "")) })
|
|
739
1052
|
] }),
|
|
740
|
-
/* @__PURE__ */ jsx(Code, { muted: !0, children: queryObj?.query.split("{")[0] }),
|
|
741
|
-
/* @__PURE__ */ jsx(Flex, { align: "center", gap: 1, children: /* @__PURE__ */ jsx(Text, { size: 1, muted: !0, children: formatDate.format(new Date(q_4.savedAt || "")) }) }),
|
|
742
1053
|
isEdited && /* @__PURE__ */ jsx(Button, { mode: "ghost", tone: "default", size: 1, padding: 2, style: {
|
|
743
1054
|
height: "24px",
|
|
744
1055
|
position: "absolute",
|
|
@@ -746,19 +1057,27 @@ function QueryRecall(t0) {
|
|
|
746
1057
|
bottom: "16px",
|
|
747
1058
|
fontSize: "12px"
|
|
748
1059
|
}, text: t("action.update"), onClick: (e) => {
|
|
749
|
-
e.stopPropagation(), handleUpdate(
|
|
1060
|
+
e.stopPropagation(), handleUpdate(q_5);
|
|
750
1061
|
} })
|
|
751
|
-
] }) },
|
|
752
|
-
}), $[
|
|
1062
|
+
] }) }, q_5._key);
|
|
1063
|
+
}), $[42] = compactMode, $[43] = currentParams, $[44] = currentQuery, $[45] = deleteQuery, $[46] = editingKey, $[47] = editingTitle, $[48] = formatDate, $[49] = getStateFromUrl, $[50] = handleSave, $[51] = handleTitleSave, $[52] = handleUnshareQuery, $[53] = handleUpdate, $[54] = optimisticTitles, $[55] = pendingUnshareKeys, $[56] = queries, $[57] = queryFilter, $[58] = saving, $[59] = searchQuery, $[60] = selectedUrl, $[61] = setStateFromParsedUrl, $[62] = t, $[63] = T0, $[64] = T1, $[65] = t11, $[66] = t12, $[67] = t13, $[68] = t14;
|
|
753
1064
|
} else
|
|
754
|
-
T0 = $[
|
|
755
|
-
let
|
|
756
|
-
$[
|
|
757
|
-
let
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
1065
|
+
T0 = $[63], T1 = $[64], t11 = $[65], t12 = $[66], t13 = $[67], t14 = $[68];
|
|
1066
|
+
let t15;
|
|
1067
|
+
$[116] !== T0 || $[117] !== t11 || $[118] !== t12 || $[119] !== t13 ? (t15 = /* @__PURE__ */ jsx(T0, { id: t11, paddingY: t12, children: t13 }), $[116] = T0, $[117] = t11, $[118] = t12, $[119] = t13, $[120] = t15) : t15 = $[120];
|
|
1068
|
+
let t16;
|
|
1069
|
+
$[121] !== handleConfirmShareQuery || $[122] !== shareDialogQuery || $[123] !== t ? (t16 = shareDialogQuery && /* @__PURE__ */ jsx(Dialog, { id: "vision-query-recall-share-dialog", width: 1, header: t("label.share"), onClose: () => setShareDialogQuery(null), footer: /* @__PURE__ */ jsxs(Flex, { width: "fill", justify: "flex-end", gap: 3, padding: 3, align: "center", children: [
|
|
1070
|
+
/* @__PURE__ */ jsx(Button, { mode: "bleed", padding: 2, text: t("action.query-cancel"), onClick: () => setShareDialogQuery(null) }),
|
|
1071
|
+
/* @__PURE__ */ jsx(Button, { padding: 2, tone: "primary", text: t("action.save-shared-query"), onClick: () => {
|
|
1072
|
+
handleConfirmShareQuery();
|
|
1073
|
+
} })
|
|
1074
|
+
] }), children: /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Text, { size: 2, children: t("save-query.share-warning") }) }) }), $[121] = handleConfirmShareQuery, $[122] = shareDialogQuery, $[123] = t, $[124] = t16) : t16 = $[124];
|
|
1075
|
+
let t17;
|
|
1076
|
+
return $[125] !== T1 || $[126] !== t14 || $[127] !== t15 || $[128] !== t16 ? (t17 = /* @__PURE__ */ jsxs(T1, { children: [
|
|
1077
|
+
t14,
|
|
1078
|
+
t15,
|
|
1079
|
+
t16
|
|
1080
|
+
] }), $[125] = T1, $[126] = t14, $[127] = t15, $[128] = t16, $[129] = t17) : t17 = $[129], t17;
|
|
762
1081
|
}
|
|
763
1082
|
function narrowBreakpoint() {
|
|
764
1083
|
return typeof window < "u" && window.innerWidth > 600;
|
|
@@ -774,34 +1093,43 @@ function calculatePaneSizeOptions(height) {
|
|
|
774
1093
|
};
|
|
775
1094
|
}
|
|
776
1095
|
function usePaneSize(t0) {
|
|
777
|
-
const $ = c(
|
|
1096
|
+
const $ = c(7), {
|
|
778
1097
|
visionRootRef
|
|
779
|
-
} = t0, [
|
|
1098
|
+
} = t0, [rootSize, setRootSize] = useState(_temp$4), [isNarrowBreakpoint, setIsNarrowBreakpoint] = useState(_temp2$3), [paneSizeOptions, setPaneSizeOptions] = useState(_temp3$2);
|
|
780
1099
|
let t1, t2;
|
|
781
1100
|
$[0] !== visionRootRef ? (t1 = () => {
|
|
782
1101
|
if (!visionRootRef.current)
|
|
783
1102
|
return;
|
|
784
1103
|
const handleResize = (entries) => {
|
|
785
|
-
setIsNarrowBreakpoint(narrowBreakpoint());
|
|
786
1104
|
const entry = entries?.[0];
|
|
787
|
-
entry &&
|
|
1105
|
+
entry && (setRootSize({
|
|
1106
|
+
width: entry.contentRect.width,
|
|
1107
|
+
height: entry.contentRect.height
|
|
1108
|
+
}), setIsNarrowBreakpoint(entry.contentRect.width > 600), setPaneSizeOptions(calculatePaneSizeOptions(entry.contentRect.height)));
|
|
788
1109
|
}, resizeObserver = new ResizeObserver(handleResize);
|
|
789
1110
|
return resizeObserver.observe(visionRootRef.current), () => {
|
|
790
1111
|
resizeObserver.disconnect();
|
|
791
1112
|
};
|
|
792
1113
|
}, t2 = [visionRootRef], $[0] = visionRootRef, $[1] = t1, $[2] = t2) : (t1 = $[1], t2 = $[2]), useEffect(t1, t2);
|
|
793
1114
|
let t3;
|
|
794
|
-
return $[3] !== isNarrowBreakpoint || $[4] !== paneSizeOptions ? (t3 = {
|
|
1115
|
+
return $[3] !== isNarrowBreakpoint || $[4] !== paneSizeOptions || $[5] !== rootSize ? (t3 = {
|
|
795
1116
|
paneSizeOptions,
|
|
796
|
-
isNarrowBreakpoint
|
|
797
|
-
|
|
1117
|
+
isNarrowBreakpoint,
|
|
1118
|
+
rootSize
|
|
1119
|
+
}, $[3] = isNarrowBreakpoint, $[4] = paneSizeOptions, $[5] = rootSize, $[6] = t3) : t3 = $[6], t3;
|
|
798
1120
|
}
|
|
799
|
-
function
|
|
1121
|
+
function _temp3$2() {
|
|
800
1122
|
return calculatePaneSizeOptions(void 0);
|
|
801
1123
|
}
|
|
802
|
-
function
|
|
1124
|
+
function _temp2$3() {
|
|
803
1125
|
return narrowBreakpoint();
|
|
804
1126
|
}
|
|
1127
|
+
function _temp$4() {
|
|
1128
|
+
return {
|
|
1129
|
+
width: typeof window < "u" ? window.innerWidth : 1e3,
|
|
1130
|
+
height: typeof window < "u" ? window.innerHeight : 800
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
805
1133
|
function VisionGuiControls(t0) {
|
|
806
1134
|
const $ = c(30), {
|
|
807
1135
|
hasValidParams,
|
|
@@ -922,7 +1250,7 @@ const PinnedReleasePerspectiveOption = (t0) => {
|
|
|
922
1250
|
return $[8] !== t4 || $[9] !== text ? (t5 = /* @__PURE__ */ jsx("option", { value: "pinnedRelease", disabled: t4, children: text }), $[8] = t4, $[9] = text, $[10] = t5) : t5 = $[10], t5;
|
|
923
1251
|
};
|
|
924
1252
|
function VisionGuiHeader(t0) {
|
|
925
|
-
const $ = c(
|
|
1253
|
+
const $ = c(68), {
|
|
926
1254
|
onChangeDataset,
|
|
927
1255
|
dataset,
|
|
928
1256
|
customApiVersion,
|
|
@@ -953,71 +1281,77 @@ function VisionGuiHeader(t0) {
|
|
|
953
1281
|
let t2;
|
|
954
1282
|
$[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = [1, 4, 8, 12], $[1] = t2) : t2 = $[1];
|
|
955
1283
|
let t3;
|
|
956
|
-
$[2]
|
|
1284
|
+
$[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t3 = [1, 2], $[2] = t3) : t3 = $[2];
|
|
957
1285
|
let t4;
|
|
958
|
-
$[
|
|
1286
|
+
$[3] !== t ? (t4 = t("settings.dataset-label"), $[3] = t, $[4] = t4) : t4 = $[4];
|
|
959
1287
|
let t5;
|
|
960
|
-
$[
|
|
1288
|
+
$[5] !== t4 ? (t5 = /* @__PURE__ */ jsx(Card, { paddingTop: 2, paddingBottom: 3, children: /* @__PURE__ */ jsx(StyledLabel, { children: t4 }) }), $[5] = t4, $[6] = t5) : t5 = $[6];
|
|
961
1289
|
let t6;
|
|
962
|
-
$[
|
|
1290
|
+
$[7] !== datasets ? (t6 = datasets.map(_temp2$2), $[7] = datasets, $[8] = t6) : t6 = $[8];
|
|
963
1291
|
let t7;
|
|
964
|
-
$[
|
|
965
|
-
t4,
|
|
966
|
-
t6
|
|
967
|
-
] }) }), $[12] = t4, $[13] = t6, $[14] = t7) : t7 = $[14];
|
|
1292
|
+
$[9] !== dataset || $[10] !== onChangeDataset || $[11] !== t6 ? (t7 = /* @__PURE__ */ jsx(Select, { value: dataset, onChange: onChangeDataset, children: t6 }), $[9] = dataset, $[10] = onChangeDataset, $[11] = t6, $[12] = t7) : t7 = $[12];
|
|
968
1293
|
let t8;
|
|
969
|
-
$[
|
|
1294
|
+
$[13] !== t5 || $[14] !== t7 ? (t8 = /* @__PURE__ */ jsx(Box, { padding: 1, column: t3, children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1295
|
+
t5,
|
|
1296
|
+
t7
|
|
1297
|
+
] }) }), $[13] = t5, $[14] = t7, $[15] = t8) : t8 = $[15];
|
|
970
1298
|
let t9;
|
|
971
|
-
$[
|
|
972
|
-
|
|
1299
|
+
$[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t9 = [1, 2], $[16] = t9) : t9 = $[16];
|
|
1300
|
+
let t10;
|
|
1301
|
+
$[17] !== t ? (t10 = t("settings.api-version-label"), $[17] = t, $[18] = t10) : t10 = $[18];
|
|
973
1302
|
let t11;
|
|
974
|
-
$[19]
|
|
975
|
-
|
|
976
|
-
$[20] !== t ? (t12 = t("settings.other-api-version-label"), $[20] = t, $[21] = t12) : t12 = $[21];
|
|
1303
|
+
$[19] !== t10 ? (t11 = /* @__PURE__ */ jsx(Card, { paddingTop: 2, paddingBottom: 3, children: /* @__PURE__ */ jsx(StyledLabel, { children: t10 }) }), $[19] = t10, $[20] = t11) : t11 = $[20];
|
|
1304
|
+
const t12 = customApiVersion === !1 ? apiVersion : "other";
|
|
977
1305
|
let t13;
|
|
978
|
-
$[
|
|
1306
|
+
$[21] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t13 = API_VERSIONS.map(_temp3$1), $[21] = t13) : t13 = $[21];
|
|
979
1307
|
let t14;
|
|
980
|
-
$[
|
|
981
|
-
t11,
|
|
982
|
-
t13
|
|
983
|
-
] }), $[24] = onChangeApiVersion, $[25] = t10, $[26] = t13, $[27] = t14) : t14 = $[27];
|
|
1308
|
+
$[22] !== t ? (t14 = t("settings.other-api-version-label"), $[22] = t, $[23] = t14) : t14 = $[23];
|
|
984
1309
|
let t15;
|
|
985
|
-
$[
|
|
986
|
-
t9,
|
|
987
|
-
t14
|
|
988
|
-
] }) }), $[28] = t14, $[29] = t9, $[30] = t15) : t15 = $[30];
|
|
1310
|
+
$[24] !== t14 ? (t15 = /* @__PURE__ */ jsx("option", { value: "other", children: t14 }, "other"), $[24] = t14, $[25] = t15) : t15 = $[25];
|
|
989
1311
|
let t16;
|
|
990
|
-
$[
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
] })
|
|
1312
|
+
$[26] !== onChangeApiVersion || $[27] !== t12 || $[28] !== t15 ? (t16 = /* @__PURE__ */ jsxs(Select, { "data-testid": "api-version-selector", value: t12, onChange: onChangeApiVersion, children: [
|
|
1313
|
+
t13,
|
|
1314
|
+
t15
|
|
1315
|
+
] }), $[26] = onChangeApiVersion, $[27] = t12, $[28] = t15, $[29] = t16) : t16 = $[29];
|
|
994
1316
|
let t17;
|
|
995
|
-
$[
|
|
1317
|
+
$[30] !== t11 || $[31] !== t16 ? (t17 = /* @__PURE__ */ jsx(Box, { padding: 1, column: t9, children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1318
|
+
t11,
|
|
1319
|
+
t16
|
|
1320
|
+
] }) }), $[30] = t11, $[31] = t16, $[32] = t17) : t17 = $[32];
|
|
996
1321
|
let t18;
|
|
997
|
-
$[
|
|
1322
|
+
$[33] !== customApiVersion || $[34] !== customApiVersionElementRef || $[35] !== isValidApiVersion || $[36] !== onCustomApiVersionChange || $[37] !== t ? (t18 = customApiVersion !== !1 && /* @__PURE__ */ jsx(Box, { padding: 1, column: [1, 2], children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1323
|
+
/* @__PURE__ */ jsx(Card, { paddingTop: 2, paddingBottom: 3, children: /* @__PURE__ */ jsx(StyledLabel, { textOverflow: "ellipsis", children: t("settings.custom-api-version-label") }) }),
|
|
1324
|
+
/* @__PURE__ */ jsx(TextInput, { ref: customApiVersionElementRef, value: customApiVersion, onChange: onCustomApiVersionChange, customValidity: isValidApiVersion ? void 0 : t("settings.error.invalid-api-version"), maxLength: 11 })
|
|
1325
|
+
] }) }), $[33] = customApiVersion, $[34] = customApiVersionElementRef, $[35] = isValidApiVersion, $[36] = onCustomApiVersionChange, $[37] = t, $[38] = t18) : t18 = $[38];
|
|
998
1326
|
let t19;
|
|
999
|
-
$[
|
|
1327
|
+
$[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t19 = [1, 2], $[39] = t19) : t19 = $[39];
|
|
1000
1328
|
let t20;
|
|
1001
|
-
$[
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
] }) }), $[42] = t18, $[43] = t20) : t20 = $[43];
|
|
1005
|
-
const t21 = perspective || "default";
|
|
1329
|
+
$[40] !== t ? (t20 = t("settings.perspective-label"), $[40] = t, $[41] = t20) : t20 = $[41];
|
|
1330
|
+
let t21;
|
|
1331
|
+
$[42] !== t20 ? (t21 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(StyledLabel, { children: t20 }) }), $[42] = t20, $[43] = t21) : t21 = $[43];
|
|
1006
1332
|
let t22;
|
|
1007
|
-
$[44]
|
|
1333
|
+
$[44] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(PerspectivePopover, {}) }), $[44] = t22) : t22 = $[44];
|
|
1334
|
+
let t23;
|
|
1335
|
+
$[45] !== t21 ? (t23 = /* @__PURE__ */ jsx(Card, { paddingBottom: 1, children: /* @__PURE__ */ jsxs(Inline, { space: 1, children: [
|
|
1336
|
+
t21,
|
|
1337
|
+
t22
|
|
1338
|
+
] }) }), $[45] = t21, $[46] = t23) : t23 = $[46];
|
|
1339
|
+
const t24 = perspective || "default";
|
|
1340
|
+
let t25;
|
|
1341
|
+
$[47] !== isScheduledDraftsEnabled || $[48] !== pinnedPerspective || $[49] !== t ? (t25 = SUPPORTED_PERSPECTIVES.map((perspectiveName) => perspectiveName === "pinnedRelease" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1008
1342
|
/* @__PURE__ */ jsx(PinnedReleasePerspectiveOption, { pinnedPerspective, t }),
|
|
1009
1343
|
/* @__PURE__ */ jsx("option", { value: "default", children: t("settings.perspectives.default") }, "default"),
|
|
1010
1344
|
/* @__PURE__ */ jsx("hr", {})
|
|
1011
|
-
] }, "pinnedRelease") : perspectiveName === "scheduledDrafts" ? isScheduledDraftsEnabled ? /* @__PURE__ */ jsx("option", { value: "scheduledDrafts", children: t("settings.perspectives.scheduled-drafts") }, "scheduledDrafts") : null : /* @__PURE__ */ jsx("option", { children: perspectiveName }, perspectiveName)), $[
|
|
1012
|
-
let
|
|
1013
|
-
$[
|
|
1014
|
-
let
|
|
1015
|
-
$[
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
] }) }), $[
|
|
1019
|
-
let
|
|
1020
|
-
$[
|
|
1345
|
+
] }, "pinnedRelease") : perspectiveName === "scheduledDrafts" ? isScheduledDraftsEnabled ? /* @__PURE__ */ jsx("option", { value: "scheduledDrafts", children: t("settings.perspectives.scheduled-drafts") }, "scheduledDrafts") : null : /* @__PURE__ */ jsx("option", { children: perspectiveName }, perspectiveName)), $[47] = isScheduledDraftsEnabled, $[48] = pinnedPerspective, $[49] = t, $[50] = t25) : t25 = $[50];
|
|
1346
|
+
let t26;
|
|
1347
|
+
$[51] !== onChangePerspective || $[52] !== t24 || $[53] !== t25 ? (t26 = /* @__PURE__ */ jsx(Select, { value: t24, onChange: onChangePerspective, children: t25 }), $[51] = onChangePerspective, $[52] = t24, $[53] = t25, $[54] = t26) : t26 = $[54];
|
|
1348
|
+
let t27;
|
|
1349
|
+
$[55] !== t23 || $[56] !== t26 ? (t27 = /* @__PURE__ */ jsx(Box, { padding: 1, column: t19, children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1350
|
+
t23,
|
|
1351
|
+
t26
|
|
1352
|
+
] }) }), $[55] = t23, $[56] = t26, $[57] = t27) : t27 = $[57];
|
|
1353
|
+
let t28;
|
|
1354
|
+
$[58] !== customApiVersion || $[59] !== t || $[60] !== url ? (t28 = typeof url == "string" ? /* @__PURE__ */ jsx(Box, { padding: 1, flex: 1, column: [1, customApiVersion === !1 ? 6 : 4], children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1021
1355
|
/* @__PURE__ */ jsx(Card, { paddingTop: 2, paddingBottom: 3, children: /* @__PURE__ */ jsxs(StyledLabel, { children: [
|
|
1022
1356
|
t("query.url"),
|
|
1023
1357
|
"\xA0",
|
|
@@ -1031,15 +1365,15 @@ function VisionGuiHeader(t0) {
|
|
|
1031
1365
|
/* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(TextInput, { readOnly: !0, type: "url", ref: operationUrlElement, value: url }) }),
|
|
1032
1366
|
/* @__PURE__ */ jsx(Tooltip, { content: t("action.copy-url-to-clipboard"), children: /* @__PURE__ */ jsx(Button, { "aria-label": t("action.copy-url-to-clipboard"), type: "button", mode: "ghost", icon: CopyIcon, onClick: handleCopyUrl }) })
|
|
1033
1367
|
] })
|
|
1034
|
-
] }) }) : /* @__PURE__ */ jsx(Box, { flex: 1 }), $[
|
|
1035
|
-
let
|
|
1036
|
-
return $[
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
] }) }), $[
|
|
1368
|
+
] }) }) : /* @__PURE__ */ jsx(Box, { flex: 1 }), $[58] = customApiVersion, $[59] = t, $[60] = url, $[61] = t28) : t28 = $[61];
|
|
1369
|
+
let t29;
|
|
1370
|
+
return $[62] !== t17 || $[63] !== t18 || $[64] !== t27 || $[65] !== t28 || $[66] !== t8 ? (t29 = /* @__PURE__ */ jsx(Header, { paddingX: 3, paddingY: 2, children: /* @__PURE__ */ jsxs(Grid, { columns: t2, children: [
|
|
1371
|
+
t8,
|
|
1372
|
+
t17,
|
|
1373
|
+
t18,
|
|
1374
|
+
t27,
|
|
1375
|
+
t28
|
|
1376
|
+
] }) }), $[62] = t17, $[63] = t18, $[64] = t27, $[65] = t28, $[66] = t8, $[67] = t29) : t29 = $[67], t29;
|
|
1043
1377
|
}
|
|
1044
1378
|
function _temp3$1(version) {
|
|
1045
1379
|
return /* @__PURE__ */ jsx("option", { children: version }, version);
|
|
@@ -1360,7 +1694,7 @@ function SaveJsonButton(t0) {
|
|
|
1360
1694
|
return $[0] !== blobUrl ? (t1 = /* @__PURE__ */ jsx(Button, { as: "a", download: "query-result.json", href: blobUrl, icon: DocumentSheetIcon, mode: "ghost", text: "JSON", tone: "default" }), $[0] = blobUrl, $[1] = t1) : t1 = $[1], t1;
|
|
1361
1695
|
}
|
|
1362
1696
|
function VisionGuiResult(t0) {
|
|
1363
|
-
const $ = c(
|
|
1697
|
+
const $ = c(84), {
|
|
1364
1698
|
error,
|
|
1365
1699
|
queryInProgress,
|
|
1366
1700
|
queryResult,
|
|
@@ -1368,88 +1702,108 @@ function VisionGuiResult(t0) {
|
|
|
1368
1702
|
listenMutations,
|
|
1369
1703
|
dataset,
|
|
1370
1704
|
queryTime,
|
|
1371
|
-
e2eTime
|
|
1372
|
-
|
|
1705
|
+
e2eTime,
|
|
1706
|
+
compactFooter: t1
|
|
1707
|
+
} = t0, compactFooter = t1 === void 0 ? !1 : t1, {
|
|
1373
1708
|
t
|
|
1374
1709
|
} = useTranslation(visionLocaleNamespace), hasResult = !error && !queryInProgress && typeof queryResult < "u";
|
|
1375
|
-
let t1;
|
|
1376
|
-
$[0] !== hasResult || $[1] !== queryResult ? (t1 = hasResult ? getJsonBlobUrl(queryResult) : "", $[0] = hasResult, $[1] = queryResult, $[2] = t1) : t1 = $[2];
|
|
1377
|
-
const jsonUrl = t1;
|
|
1378
1710
|
let t2;
|
|
1379
|
-
$[
|
|
1380
|
-
const
|
|
1381
|
-
let
|
|
1382
|
-
$[
|
|
1711
|
+
$[0] !== hasResult || $[1] !== queryResult ? (t2 = hasResult ? getJsonBlobUrl(queryResult) : "", $[0] = hasResult, $[1] = queryResult, $[2] = t2) : t2 = $[2];
|
|
1712
|
+
const jsonUrl = t2;
|
|
1713
|
+
let t3;
|
|
1714
|
+
$[3] !== hasResult || $[4] !== queryResult ? (t3 = hasResult ? getCsvBlobUrl(queryResult) : "", $[3] = hasResult, $[4] = queryResult, $[5] = t3) : t3 = $[5];
|
|
1715
|
+
const csvUrl = t3, t4 = error ? "critical" : "default", t5 = !!error;
|
|
1383
1716
|
let t6;
|
|
1384
|
-
$[
|
|
1717
|
+
$[6] !== t ? (t6 = t("result.label"), $[6] = t, $[7] = t6) : t6 = $[7];
|
|
1385
1718
|
let t7;
|
|
1386
|
-
$[
|
|
1719
|
+
$[8] !== t6 ? (t7 = /* @__PURE__ */ jsx(InputBackgroundContainer, { children: /* @__PURE__ */ jsx(Box, { marginLeft: 3, children: /* @__PURE__ */ jsx(StyledLabel, { muted: !0, children: t6 }) }) }), $[8] = t6, $[9] = t7) : t7 = $[9];
|
|
1387
1720
|
let t8;
|
|
1388
|
-
$[
|
|
1721
|
+
$[10] !== listenInProgress || $[11] !== listenMutations || $[12] !== queryInProgress ? (t8 = (queryInProgress || listenInProgress && listenMutations.length === 0) && /* @__PURE__ */ jsx(Box, { marginTop: 3, children: /* @__PURE__ */ jsx(DelayedSpinner, {}) }), $[10] = listenInProgress, $[11] = listenMutations, $[12] = queryInProgress, $[13] = t8) : t8 = $[13];
|
|
1389
1722
|
let t9;
|
|
1390
|
-
$[
|
|
1723
|
+
$[14] !== error ? (t9 = error && /* @__PURE__ */ jsx(QueryErrorDialog, { error }), $[14] = error, $[15] = t9) : t9 = $[15];
|
|
1391
1724
|
let t10;
|
|
1392
|
-
$[
|
|
1725
|
+
$[16] !== dataset || $[17] !== hasResult || $[18] !== queryResult ? (t10 = hasResult && /* @__PURE__ */ jsx(ResultView, { data: queryResult, datasetName: dataset }), $[16] = dataset, $[17] = hasResult, $[18] = queryResult, $[19] = t10) : t10 = $[19];
|
|
1393
1726
|
let t11;
|
|
1394
|
-
$[
|
|
1395
|
-
|
|
1727
|
+
$[20] !== dataset || $[21] !== listenInProgress || $[22] !== listenMutations ? (t11 = listenInProgress && listenMutations.length > 0 && /* @__PURE__ */ jsx(ResultView, { data: listenMutations, datasetName: dataset }), $[20] = dataset, $[21] = listenInProgress, $[22] = listenMutations, $[23] = t11) : t11 = $[23];
|
|
1728
|
+
let t12;
|
|
1729
|
+
$[24] !== t10 || $[25] !== t11 || $[26] !== t8 || $[27] !== t9 ? (t12 = /* @__PURE__ */ jsxs(Box, { padding: 3, paddingTop: 5, children: [
|
|
1396
1730
|
t8,
|
|
1397
1731
|
t9,
|
|
1398
|
-
t10
|
|
1399
|
-
] }), $[24] = t10, $[25] = t7, $[26] = t8, $[27] = t9, $[28] = t11) : t11 = $[28];
|
|
1400
|
-
let t12;
|
|
1401
|
-
$[29] !== t11 || $[30] !== t6 ? (t12 = /* @__PURE__ */ jsxs(Result, { overflow: "auto", children: [
|
|
1402
|
-
t6,
|
|
1732
|
+
t10,
|
|
1403
1733
|
t11
|
|
1404
|
-
] }), $[
|
|
1734
|
+
] }), $[24] = t10, $[25] = t11, $[26] = t8, $[27] = t9, $[28] = t12) : t12 = $[28];
|
|
1405
1735
|
let t13;
|
|
1406
|
-
$[
|
|
1736
|
+
$[29] !== t12 || $[30] !== t7 ? (t13 = /* @__PURE__ */ jsxs(Result, { overflow: "auto", children: [
|
|
1737
|
+
t7,
|
|
1738
|
+
t12
|
|
1739
|
+
] }), $[29] = t12, $[30] = t7, $[31] = t13) : t13 = $[31];
|
|
1407
1740
|
let t14;
|
|
1408
|
-
$[
|
|
1409
|
-
|
|
1410
|
-
$[37] !== t ? (t15 = t("result.execution-time-label"), $[37] = t, $[38] = t15) : t15 = $[38];
|
|
1411
|
-
let t16;
|
|
1412
|
-
$[39] !== queryTime || $[40] !== t ? (t16 = typeof queryTime == "number" ? `${queryTime}ms` : t("result.timing-not-applicable"), $[39] = queryTime, $[40] = t, $[41] = t16) : t16 = $[41];
|
|
1741
|
+
$[32] !== t13 || $[33] !== t4 || $[34] !== t5 ? (t14 = /* @__PURE__ */ jsx(ResultInnerContainer, { flex: 1, children: /* @__PURE__ */ jsx(ResultContainer, { flex: 1, overflow: "hidden", tone: t4, $isInvalid: t5, children: t13 }) }), $[32] = t13, $[33] = t4, $[34] = t5, $[35] = t14) : t14 = $[35];
|
|
1742
|
+
const t15 = compactFooter ? "flex-start" : "space-between", t16 = compactFooter ? "stretch" : void 0;
|
|
1413
1743
|
let t17;
|
|
1414
|
-
$[
|
|
1415
|
-
|
|
1744
|
+
$[36] !== compactFooter ? (t17 = compactFooter ? "column" : ["column", "column", "row"], $[36] = compactFooter, $[37] = t17) : t17 = $[37];
|
|
1745
|
+
const t18 = compactFooter ? 3 : 4, t19 = compactFooter ? 2 : 3;
|
|
1746
|
+
let t20;
|
|
1747
|
+
$[38] !== compactFooter ? (t20 = compactFooter ? {
|
|
1748
|
+
width: "100%"
|
|
1749
|
+
} : {
|
|
1750
|
+
minWidth: 0
|
|
1751
|
+
}, $[38] = compactFooter, $[39] = t20) : t20 = $[39];
|
|
1752
|
+
const t21 = compactFooter ? 1 : 2;
|
|
1753
|
+
let t22;
|
|
1754
|
+
$[40] !== t ? (t22 = t("result.execution-time-label"), $[40] = t, $[41] = t22) : t22 = $[41];
|
|
1755
|
+
let t23;
|
|
1756
|
+
$[42] !== queryTime || $[43] !== t ? (t23 = typeof queryTime == "number" ? `${queryTime}ms` : t("result.timing-not-applicable"), $[42] = queryTime, $[43] = t, $[44] = t23) : t23 = $[44];
|
|
1757
|
+
let t24;
|
|
1758
|
+
$[45] !== t21 || $[46] !== t22 || $[47] !== t23 ? (t24 = /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Text, { muted: !0, size: t21, children: [
|
|
1759
|
+
t22,
|
|
1416
1760
|
":",
|
|
1417
1761
|
" ",
|
|
1418
|
-
|
|
1419
|
-
] }) }), $[
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1762
|
+
t23
|
|
1763
|
+
] }) }), $[45] = t21, $[46] = t22, $[47] = t23, $[48] = t24) : t24 = $[48];
|
|
1764
|
+
const t25 = compactFooter ? 3 : 4, t26 = compactFooter ? 1 : 2;
|
|
1765
|
+
let t27;
|
|
1766
|
+
$[49] !== t ? (t27 = t("result.end-to-end-time-label"), $[49] = t, $[50] = t27) : t27 = $[50];
|
|
1767
|
+
let t28;
|
|
1768
|
+
$[51] !== e2eTime || $[52] !== t ? (t28 = typeof e2eTime == "number" ? `${e2eTime}ms` : t("result.timing-not-applicable"), $[51] = e2eTime, $[52] = t, $[53] = t28) : t28 = $[53];
|
|
1769
|
+
let t29;
|
|
1770
|
+
$[54] !== t26 || $[55] !== t27 || $[56] !== t28 ? (t29 = /* @__PURE__ */ jsxs(Text, { muted: !0, size: t26, children: [
|
|
1771
|
+
t27,
|
|
1427
1772
|
":",
|
|
1428
1773
|
" ",
|
|
1429
|
-
|
|
1430
|
-
] })
|
|
1431
|
-
let
|
|
1432
|
-
$[
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1774
|
+
t28
|
|
1775
|
+
] }), $[54] = t26, $[55] = t27, $[56] = t28, $[57] = t29) : t29 = $[57];
|
|
1776
|
+
let t30;
|
|
1777
|
+
$[58] !== t25 || $[59] !== t29 ? (t30 = /* @__PURE__ */ jsx(Box, { marginLeft: t25, children: t29 }), $[58] = t25, $[59] = t29, $[60] = t30) : t30 = $[60];
|
|
1778
|
+
let t31;
|
|
1779
|
+
$[61] !== t24 || $[62] !== t30 ? (t31 = /* @__PURE__ */ jsxs(TimingsTextContainer, { align: "center", children: [
|
|
1780
|
+
t24,
|
|
1781
|
+
t30
|
|
1782
|
+
] }), $[61] = t24, $[62] = t30, $[63] = t31) : t31 = $[63];
|
|
1783
|
+
let t32;
|
|
1784
|
+
$[64] !== t18 || $[65] !== t19 || $[66] !== t20 || $[67] !== t31 ? (t32 = /* @__PURE__ */ jsx(TimingsCard, { paddingX: t18, paddingY: t19, sizing: "border", style: t20, children: t31 }), $[64] = t18, $[65] = t19, $[66] = t20, $[67] = t31, $[68] = t32) : t32 = $[68];
|
|
1785
|
+
let t33;
|
|
1786
|
+
$[69] !== compactFooter || $[70] !== csvUrl || $[71] !== hasResult || $[72] !== jsonUrl || $[73] !== t ? (t33 = hasResult && /* @__PURE__ */ jsx(DownloadsCard, { paddingX: compactFooter ? 3 : 4, paddingY: compactFooter ? 2 : 3, sizing: "border", style: compactFooter ? {
|
|
1787
|
+
width: "100%"
|
|
1788
|
+
} : {
|
|
1789
|
+
marginLeft: "auto",
|
|
1790
|
+
minWidth: 0
|
|
1791
|
+
}, children: /* @__PURE__ */ jsx(SaveResultLabel, { muted: !0, size: compactFooter ? 1 : 2, children: /* @__PURE__ */ jsx(Translate, { components: {
|
|
1438
1792
|
SaveResultButtons: () => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1439
1793
|
/* @__PURE__ */ jsx(SaveJsonButton, { blobUrl: jsonUrl }),
|
|
1440
1794
|
/* @__PURE__ */ jsx(SaveCsvButton, { blobUrl: csvUrl })
|
|
1441
1795
|
] })
|
|
1442
|
-
}, i18nKey: "result.save-result-as-format", t }) }) }), $[
|
|
1443
|
-
let
|
|
1444
|
-
$[
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
] }), $[
|
|
1448
|
-
let
|
|
1449
|
-
return $[
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
] }), $[
|
|
1796
|
+
}, i18nKey: "result.save-result-as-format", t }) }) }), $[69] = compactFooter, $[70] = csvUrl, $[71] = hasResult, $[72] = jsonUrl, $[73] = t, $[74] = t33) : t33 = $[74];
|
|
1797
|
+
let t34;
|
|
1798
|
+
$[75] !== t15 || $[76] !== t16 || $[77] !== t17 || $[78] !== t32 || $[79] !== t33 ? (t34 = /* @__PURE__ */ jsxs(ResultFooter, { justify: t15, align: t16, direction: t17, children: [
|
|
1799
|
+
t32,
|
|
1800
|
+
t33
|
|
1801
|
+
] }), $[75] = t15, $[76] = t16, $[77] = t17, $[78] = t32, $[79] = t33, $[80] = t34) : t34 = $[80];
|
|
1802
|
+
let t35;
|
|
1803
|
+
return $[81] !== t14 || $[82] !== t34 ? (t35 = /* @__PURE__ */ jsxs(ResultOuterContainer, { direction: "column", "data-testid": "vision-result", children: [
|
|
1804
|
+
t14,
|
|
1805
|
+
t34
|
|
1806
|
+
] }), $[81] = t14, $[82] = t34, $[83] = t35) : t35 = $[83], t35;
|
|
1453
1807
|
}
|
|
1454
1808
|
function nodeContains(node, other) {
|
|
1455
1809
|
return !node || !other ? !1 : node === other || !!(node.compareDocumentPosition(other) & 16);
|