@gooddata/sdk-ui-semantic-search 10.38.0-alpha.1 → 10.38.0-alpha.2
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/esm/SearchItem.d.ts +20 -0
- package/esm/SearchItem.d.ts.map +1 -0
- package/esm/SearchItem.js +28 -0
- package/esm/SearchItem.js.map +1 -0
- package/esm/SemanticSearch.d.ts.map +1 -1
- package/esm/SemanticSearch.js +32 -11
- package/esm/SemanticSearch.js.map +1 -1
- package/esm/SemanticSearchItem.d.ts +11 -0
- package/esm/SemanticSearchItem.d.ts.map +1 -0
- package/esm/SemanticSearchItem.js +17 -0
- package/esm/SemanticSearchItem.js.map +1 -0
- package/esm/hooks/useSearchMetrics.d.ts +3 -4
- package/esm/hooks/useSearchMetrics.d.ts.map +1 -1
- package/esm/hooks/useSearchMetrics.js +12 -9
- package/esm/hooks/useSearchMetrics.js.map +1 -1
- package/esm/internal/GroupResultCounter.d.ts +8 -0
- package/esm/internal/GroupResultCounter.d.ts.map +1 -0
- package/esm/internal/GroupResultCounter.js +15 -0
- package/esm/internal/GroupResultCounter.js.map +1 -0
- package/esm/internal/HistorySearchTreeView.d.ts +12 -0
- package/esm/internal/HistorySearchTreeView.d.ts.map +1 -0
- package/esm/internal/HistorySearchTreeView.js +30 -0
- package/esm/internal/HistorySearchTreeView.js.map +1 -0
- package/esm/internal/HistorySearchTreeViewItem.d.ts +7 -0
- package/esm/internal/HistorySearchTreeViewItem.d.ts.map +1 -0
- package/esm/internal/HistorySearchTreeViewItem.js +19 -0
- package/esm/internal/HistorySearchTreeViewItem.js.map +1 -0
- package/esm/internal/LeveledSearchTreeView.d.ts +22 -0
- package/esm/internal/LeveledSearchTreeView.d.ts.map +1 -0
- package/esm/internal/LeveledSearchTreeView.js +84 -0
- package/esm/internal/LeveledSearchTreeView.js.map +1 -0
- package/esm/internal/LeveledSearchTreeViewItem.d.ts +11 -0
- package/esm/internal/LeveledSearchTreeViewItem.d.ts.map +1 -0
- package/esm/internal/LeveledSearchTreeViewItem.js +24 -0
- package/esm/internal/LeveledSearchTreeViewItem.js.map +1 -0
- package/esm/internal/SearchItemDetails.d.ts +12 -0
- package/esm/internal/SearchItemDetails.d.ts.map +1 -0
- package/esm/{utils/renderDetails.js → internal/SearchItemDetails.js} +33 -27
- package/esm/internal/SearchItemDetails.js.map +1 -0
- package/esm/internal/SearchItemIcon.d.ts +13 -0
- package/esm/internal/SearchItemIcon.d.ts.map +1 -0
- package/esm/internal/SearchItemIcon.js +46 -0
- package/esm/internal/SearchItemIcon.js.map +1 -0
- package/esm/internal/SearchOverlay.d.ts +4 -5
- package/esm/internal/SearchOverlay.d.ts.map +1 -1
- package/esm/internal/SearchOverlay.js +58 -97
- package/esm/internal/SearchOverlay.js.map +1 -1
- package/esm/internal/UpdateDate.d.ts +2 -3
- package/esm/internal/UpdateDate.d.ts.map +1 -1
- package/esm/internal/UpdateDate.js +7 -5
- package/esm/internal/UpdateDate.js.map +1 -1
- package/esm/localization/bundles/en-US.json +16 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts +4 -0
- package/esm/localization/bundles/en-US.localization-bundle.d.ts.map +1 -1
- package/esm/localization/bundles/en-US.localization-bundle.js +4 -0
- package/esm/localization/bundles/en-US.localization-bundle.js.map +1 -1
- package/esm/utils/getAriaLabel.d.ts +5 -0
- package/esm/utils/getAriaLabel.d.ts.map +1 -0
- package/esm/utils/getAriaLabel.js +27 -0
- package/esm/utils/getAriaLabel.js.map +1 -0
- package/esm/utils/searchItem.d.ts +8 -0
- package/esm/utils/searchItem.d.ts.map +1 -0
- package/esm/utils/searchItem.js +15 -0
- package/esm/utils/searchItem.js.map +1 -0
- package/package.json +13 -13
- package/styles/css/internal.css +62 -43
- package/styles/css/internal.css.map +1 -1
- package/styles/css/main.css +61 -23
- package/styles/css/main.css.map +1 -1
- package/styles/scss/internal.scss +1 -17
- package/styles/scss/main.scss +64 -16
- package/esm/ResultsItem.d.ts +0 -9
- package/esm/ResultsItem.d.ts.map +0 -1
- package/esm/ResultsItem.js +0 -16
- package/esm/ResultsItem.js.map +0 -1
- package/esm/SearchListItem.d.ts +0 -15
- package/esm/SearchListItem.d.ts.map +0 -1
- package/esm/SearchListItem.js +0 -30
- package/esm/SearchListItem.js.map +0 -1
- package/esm/SearchResultsDropdownList.d.ts +0 -36
- package/esm/SearchResultsDropdownList.d.ts.map +0 -1
- package/esm/SearchResultsDropdownList.js +0 -20
- package/esm/SearchResultsDropdownList.js.map +0 -1
- package/esm/internal/AnnotatedResultsItem.d.ts +0 -9
- package/esm/internal/AnnotatedResultsItem.d.ts.map +0 -1
- package/esm/internal/AnnotatedResultsItem.js +0 -26
- package/esm/internal/AnnotatedResultsItem.js.map +0 -1
- package/esm/internal/HistoryItem.d.ts +0 -11
- package/esm/internal/HistoryItem.d.ts.map +0 -1
- package/esm/internal/HistoryItem.js +0 -19
- package/esm/internal/HistoryItem.js.map +0 -1
- package/esm/internal/SearchList.d.ts +0 -30
- package/esm/internal/SearchList.d.ts.map +0 -1
- package/esm/internal/SearchList.js +0 -18
- package/esm/internal/SearchList.js.map +0 -1
- package/esm/types.d.ts +0 -34
- package/esm/types.d.ts.map +0 -1
- package/esm/types.js +0 -3
- package/esm/types.js.map +0 -1
- package/esm/utils/getAreaLabel.d.ts +0 -4
- package/esm/utils/getAreaLabel.d.ts.map +0 -1
- package/esm/utils/getAreaLabel.js +0 -15
- package/esm/utils/getAreaLabel.js.map +0 -1
- package/esm/utils/renderDetails.d.ts +0 -8
- package/esm/utils/renderDetails.d.ts.map +0 -1
- package/esm/utils/renderDetails.js.map +0 -1
- package/esm/utils/renderItemIcon.d.ts +0 -8
- package/esm/utils/renderItemIcon.d.ts.map +0 -1
- package/esm/utils/renderItemIcon.js +0 -44
- package/esm/utils/renderItemIcon.js.map +0 -1
- package/esm/utils/renderLock.d.ts +0 -5
- package/esm/utils/renderLock.d.ts.map +0 -1
- package/esm/utils/renderLock.js +0 -9
- package/esm/utils/renderLock.js.map +0 -1
@@ -0,0 +1,12 @@
|
|
1
|
+
import { type ISemanticSearchResultItem, type ISemanticSearchRelationship } from "@gooddata/sdk-model";
|
2
|
+
import React from "react";
|
3
|
+
type Props = {
|
4
|
+
item: ISemanticSearchResultItem | ISemanticSearchRelationship;
|
5
|
+
};
|
6
|
+
/**
|
7
|
+
* Render the details of the item in a bubble.
|
8
|
+
* @internal
|
9
|
+
*/
|
10
|
+
export declare function SearchItemDetails({ item }: Props): React.JSX.Element | null;
|
11
|
+
export {};
|
12
|
+
//# sourceMappingURL=SearchItemDetails.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SearchItemDetails.d.ts","sourceRoot":"","sources":["../../src/internal/SearchItemDetails.tsx"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EACnC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,KAAK,KAAK,GAAG;IACT,IAAI,EAAE,yBAAyB,GAAG,2BAA2B,CAAC;CACjE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,4BAiChD"}
|
@@ -1,7 +1,8 @@
|
|
1
|
-
// (C) 2024 GoodData Corporation
|
2
|
-
import
|
1
|
+
// (C) 2024-2025 GoodData Corporation
|
2
|
+
import { isSemanticSearchResultItem, } from "@gooddata/sdk-model";
|
3
|
+
import React, { useState } from "react";
|
3
4
|
import { FormattedMessage } from "react-intl";
|
4
|
-
import { Bubble, BubbleHoverTrigger, EllipsisText,
|
5
|
+
import { Bubble, BubbleHoverTrigger, EllipsisText, UiIcon, Typography } from "@gooddata/sdk-ui-kit";
|
5
6
|
/**
|
6
7
|
* Maximum number of lines for the description before ellipsis.
|
7
8
|
*/
|
@@ -9,51 +10,56 @@ const MAX_LINES = 7;
|
|
9
10
|
/**
|
10
11
|
* Align points for the details bubble.
|
11
12
|
*/
|
12
|
-
const BUBBLE_ALIGN_POINTS = [{ align: "
|
13
|
+
const BUBBLE_ALIGN_POINTS = [{ align: "tr tl", offset: { x: 4, y: 4 } }];
|
13
14
|
/**
|
14
15
|
* Arrow style for the details bubble.
|
15
16
|
*/
|
16
17
|
const ARROW_STYLE = { display: "none" };
|
18
|
+
/**
|
19
|
+
* Render the details of the item in a bubble.
|
20
|
+
* @internal
|
21
|
+
*/
|
22
|
+
export function SearchItemDetails({ item }) {
|
23
|
+
const [isHovered, setIsHovered] = useState(false);
|
24
|
+
if (!isSemanticSearchResultItem(item)) {
|
25
|
+
return null;
|
26
|
+
}
|
27
|
+
return (React.createElement("div", { className: "gd-semantic-search__results-item__details", onPointerEnter: () => setIsHovered(true), onPointerLeave: () => setIsHovered(false) },
|
28
|
+
React.createElement(BubbleHoverTrigger, { eventsOnBubble: true, className: "gd-semantic-search__bubble_trigger" },
|
29
|
+
React.createElement(UiIcon, { type: "question", size: 16, color: isHovered ? "complementary-7" : "complementary-6" }),
|
30
|
+
React.createElement(Bubble, { className: "bubble-light gd-semantic-search__bubble", alignPoints: BUBBLE_ALIGN_POINTS, arrowStyle: ARROW_STYLE },
|
31
|
+
React.createElement("div", { className: "gd-semantic-search__results-item__details__contents" },
|
32
|
+
React.createElement(Typography, { tagName: "h3" }, item.title),
|
33
|
+
React.createElement(Description, { item: item }),
|
34
|
+
React.createElement(FormattedMessage, { tagName: "h4", id: "semantic-search.id" }),
|
35
|
+
React.createElement(Typography, { tagName: "p" }, item.id),
|
36
|
+
React.createElement(Tags, { item: item }),
|
37
|
+
React.createElement(Score, { item: item }))))));
|
38
|
+
}
|
17
39
|
/**
|
18
40
|
* Render the tags if there are any.
|
19
41
|
*/
|
20
|
-
|
42
|
+
function Tags({ item }) {
|
21
43
|
if (item.tags?.some((tag) => tag !== item.title)) {
|
22
44
|
return (React.createElement(React.Fragment, null,
|
23
45
|
React.createElement(FormattedMessage, { tagName: "h4", id: "semantic-search.tags" }),
|
24
46
|
React.createElement(Typography, { tagName: "p" }, item.tags.join(", "))));
|
25
47
|
}
|
26
48
|
return null;
|
27
|
-
}
|
49
|
+
}
|
28
50
|
/**
|
29
51
|
* Render the description if it is different from the title.
|
30
52
|
*/
|
31
|
-
|
53
|
+
function Description({ item }) {
|
32
54
|
if (item.description && item.description !== item.title) {
|
33
55
|
return React.createElement(EllipsisText, { maxLines: MAX_LINES, text: item.description });
|
34
56
|
}
|
35
57
|
return null;
|
36
|
-
}
|
37
|
-
|
58
|
+
}
|
59
|
+
function Score({ item }) {
|
38
60
|
const score = item.score ? Math.round(Math.min(1, Math.max(0, item.score)) * 100) : 0;
|
39
61
|
return (React.createElement("div", { className: "gd-semantic-search__results-item__details__contents__match" },
|
40
62
|
React.createElement("hr", null),
|
41
63
|
React.createElement(FormattedMessage, { id: "semantic-search.match", tagName: "h4", values: { score } })));
|
42
|
-
}
|
43
|
-
|
44
|
-
* Render the details of the item in a bubble.
|
45
|
-
*/
|
46
|
-
export const renderDetails = (listItem, theme) => {
|
47
|
-
return (React.createElement("span", { className: "gd-semantic-search__results-item__details" },
|
48
|
-
React.createElement(BubbleHoverTrigger, { eventsOnBubble: true, className: "gd-semantic-search__bubble_trigger" },
|
49
|
-
React.createElement(Icon.QuestionMark, { color: theme?.palette?.complementary?.c7 ?? "#6D7680" }),
|
50
|
-
React.createElement(Bubble, { className: "bubble-light gd-semantic-search__bubble", alignPoints: BUBBLE_ALIGN_POINTS, arrowStyle: ARROW_STYLE },
|
51
|
-
React.createElement("div", { className: "gd-semantic-search__results-item__details__contents" },
|
52
|
-
React.createElement(Typography, { tagName: "h3" }, listItem.item.title),
|
53
|
-
renderDescription(listItem.item),
|
54
|
-
React.createElement(FormattedMessage, { tagName: "h4", id: "semantic-search.id" }),
|
55
|
-
React.createElement(Typography, { tagName: "p" }, listItem.item.id),
|
56
|
-
renderTags(listItem.item),
|
57
|
-
renderScore(listItem.item))))));
|
58
|
-
};
|
59
|
-
//# sourceMappingURL=renderDetails.js.map
|
64
|
+
}
|
65
|
+
//# sourceMappingURL=SearchItemDetails.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SearchItemDetails.js","sourceRoot":"","sources":["../../src/internal/SearchItemDetails.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EACH,0BAA0B,GAG7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEpG;;GAEG;AACH,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB;;GAEG;AACH,MAAM,mBAAmB,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AACzE;;GAEG;AACH,MAAM,WAAW,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAMxC;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAE,IAAI,EAAS;IAC7C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,CACH,6BACI,SAAS,EAAC,2CAA2C,EACrD,cAAc,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EACxC,cAAc,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC;QAEzC,oBAAC,kBAAkB,IAAC,cAAc,QAAC,SAAS,EAAC,oCAAoC;YAC7E,oBAAC,MAAM,IAAC,IAAI,EAAC,UAAU,EAA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AAC,WAAW,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;QACtD,OAAO,oBAAC,YAAY,IAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,GAAI,CAAC;IACzE,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,KAAK,CAAC,EAAE,IAAI,EAAuC;IACxD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtF,OAAO,CACH,6BAAK,SAAS,EAAC,4DAA4D;QACvE,+BAAM;QACN,oBAAC,gBAAgB,IAAC,EAAE,EAAC,uBAAuB,EAAC,OAAO,EAAC,IAAI,EAAC,MAAM,EAAE,EAAE,KAAK,EAAE,GAAI,CAC7E,CACT,CAAC;AACN,CAAC"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { type ISemanticSearchRelationship, type ISemanticSearchResultItem } from "@gooddata/sdk-model";
|
3
|
+
import { type IconType } from "@gooddata/sdk-ui-kit";
|
4
|
+
type Props = {
|
5
|
+
item: ISemanticSearchResultItem | ISemanticSearchRelationship;
|
6
|
+
icon?: IconType;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Pick an icon according to the item type.
|
10
|
+
*/
|
11
|
+
export declare function SearchItemIcon({ item, icon }: Props): React.JSX.Element;
|
12
|
+
export {};
|
13
|
+
//# sourceMappingURL=SearchItemIcon.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SearchItemIcon.d.ts","sourceRoot":"","sources":["../../src/internal/SearchItemIcon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEH,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EACjC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAyC,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE5F,KAAK,KAAK,GAAG;IACT,IAAI,EAAE,yBAAyB,GAAG,2BAA2B,CAAC;IAC9D,IAAI,CAAC,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,qBAwCnD"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
// (C) 2024-2025 GoodData Corporation
|
2
|
+
import React from "react";
|
3
|
+
import { isSemanticSearchResultItem, } from "@gooddata/sdk-model";
|
4
|
+
import { useTheme } from "@gooddata/sdk-ui-theme-provider";
|
5
|
+
import { Icon, UiIcon, InsightIcon } from "@gooddata/sdk-ui-kit";
|
6
|
+
/**
|
7
|
+
* Pick an icon according to the item type.
|
8
|
+
*/
|
9
|
+
export function SearchItemIcon({ item, icon }) {
|
10
|
+
const theme = useTheme();
|
11
|
+
if (icon) {
|
12
|
+
return React.createElement(UiIcon, { type: icon, color: "complementary-5" });
|
13
|
+
}
|
14
|
+
const props = {
|
15
|
+
color: theme?.palette?.complementary?.c5 ?? "#B0BECA",
|
16
|
+
ariaHidden: true,
|
17
|
+
};
|
18
|
+
const type = isSemanticSearchResultItem(item) ? item.type : item.sourceObjectType;
|
19
|
+
const visualizationUrl = isSemanticSearchResultItem(item) ? item.visualizationUrl : undefined;
|
20
|
+
return (React.createElement("div", { "aria-label": type, role: "img" }, (() => {
|
21
|
+
switch (type) {
|
22
|
+
case "dashboard":
|
23
|
+
return React.createElement(Icon.Dashboard, { ...props });
|
24
|
+
case "visualization":
|
25
|
+
return React.createElement(InsightIcon, { visualizationUrl: visualizationUrl, iconProps: props });
|
26
|
+
case "dataset":
|
27
|
+
return React.createElement(Icon.Dataset, { ...props });
|
28
|
+
case "attribute":
|
29
|
+
return React.createElement(Icon.Attribute, { ...props });
|
30
|
+
case "label":
|
31
|
+
return React.createElement(Icon.Label, { ...props });
|
32
|
+
case "fact":
|
33
|
+
return React.createElement(Icon.Fact, { ...props });
|
34
|
+
case "metric":
|
35
|
+
return React.createElement(Icon.Metric, { ...props });
|
36
|
+
case "date":
|
37
|
+
return React.createElement(Icon.Date, { ...props });
|
38
|
+
default:
|
39
|
+
return exhaustiveCheck(type);
|
40
|
+
}
|
41
|
+
})()));
|
42
|
+
}
|
43
|
+
const exhaustiveCheck = (type) => {
|
44
|
+
throw new Error(`Unknown item type: ${type}`);
|
45
|
+
};
|
46
|
+
//# sourceMappingURL=SearchItemIcon.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SearchItemIcon.js","sourceRoot":"","sources":["../../src/internal/SearchItemIcon.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACH,0BAA0B,GAG7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAc,IAAI,EAAE,MAAM,EAAE,WAAW,EAAiB,MAAM,sBAAsB,CAAC;AAO5F;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,IAAI,EAAE,IAAI,EAAS;IAChD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,IAAI,IAAI,EAAE,CAAC;QACP,OAAO,oBAAC,MAAM,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,iBAAiB,GAAG,CAAC;IAC1D,CAAC;IAED,MAAM,KAAK,GAAe;QACtB,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,IAAI,SAAS;QACrD,UAAU,EAAE,IAAI;KACnB,CAAC;IACF,MAAM,IAAI,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAA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-
import { GenAIObjectType, ISemanticSearchResultItem } from "@gooddata/sdk-model";
|
1
|
+
import React from "react";
|
2
|
+
import { GenAIObjectType, ISemanticSearchResultItem, type ISemanticSearchRelationship } from "@gooddata/sdk-model";
|
3
3
|
import { IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
|
4
|
-
import { ListItem } from "../types.js";
|
5
4
|
export type SearchOnSelect = {
|
6
|
-
item: ISemanticSearchResultItem;
|
5
|
+
item: ISemanticSearchResultItem | ISemanticSearchRelationship;
|
7
6
|
index: number;
|
8
7
|
preventDefault: () => void;
|
9
8
|
itemUrl?: string;
|
@@ -21,7 +20,7 @@ export type SearchOverlayProps = {
|
|
21
20
|
/**
|
22
21
|
* A function called when the search request is completed.
|
23
22
|
*/
|
24
|
-
onSearch?: (query: string, searchResults?:
|
23
|
+
onSearch?: (query: string, searchResults?: ISemanticSearchResultItem[]) => void;
|
25
24
|
/**
|
26
25
|
* An analytical backend to use for the search. Can be omitted and taken from context.
|
27
26
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SearchOverlay.d.ts","sourceRoot":"","sources":["../../src/internal/SearchOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,
|
1
|
+
{"version":3,"file":"SearchOverlay.d.ts","sourceRoot":"","sources":["../../src/internal/SearchOverlay.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAG/D,OAAO,EACH,eAAe,EACf,yBAAyB,EACzB,KAAK,2BAA2B,EACnC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AA8C/D,MAAM,MAAM,cAAc,GAAG;IACzB,IAAI,EAAE,yBAAyB,GAAG,2BAA2B,CAAC;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC7B;;OAEG;IACH,QAAQ,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,yBAAyB,EAAE,KAAK,IAAI,CAAC;IAChF;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,CACX,KAAK,EAAE,kBAAkB,GAAG;QAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAC/F,QAAQ,EAAE;QACN,WAAW,EAAE,MAAM,IAAI,CAAC;KAC3B,KACA,KAAK,CAAC,SAAS,CAAC;CACxB,CAAC;AAiMF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAUtD,CAAC"}
|
@@ -1,16 +1,14 @@
|
|
1
1
|
// (C) 2024-2025 GoodData Corporation
|
2
|
-
import
|
2
|
+
import React, { useMemo, useCallback, useEffect } from "react";
|
3
3
|
import classnames from "classnames";
|
4
4
|
import { FormattedMessage, injectIntl } from "react-intl";
|
5
|
-
import { Input, LoadingMask, Message, useHeaderSearch } from "@gooddata/sdk-ui-kit";
|
5
|
+
import { Input, LoadingMask, Message, useHeaderSearch, UiTreeViewEventsProvider, useUiTreeViewEventPublisher, } from "@gooddata/sdk-ui-kit";
|
6
6
|
import { useWorkspaceStrict, useLocalStorage, useDebouncedState } from "@gooddata/sdk-ui";
|
7
|
-
import { useSemanticSearch
|
8
|
-
import { getUIPath } from "../utils/getUIPath.js";
|
7
|
+
import { useSemanticSearch } from "../hooks/index.js";
|
9
8
|
import { IntlWrapper } from "../localization/IntlWrapper.js";
|
10
|
-
import { SearchList } from "./SearchList.js";
|
11
|
-
import { HistoryItem } from "./HistoryItem.js";
|
12
|
-
import { AnnotatedResultsItem } from "./AnnotatedResultsItem.js";
|
13
9
|
import { MetadataTimezoneProvider } from "./metadataTimezoneContext.js";
|
10
|
+
import { LeveledSearchTreeView } from "./LeveledSearchTreeView.js";
|
11
|
+
import { HistorySearchTreeView } from "./HistorySearchTreeView.js";
|
14
12
|
/**
|
15
13
|
* A time in milliseconds to wait before sending a search request after the user stops typing.
|
16
14
|
*/
|
@@ -57,131 +55,93 @@ const SearchOverlayCore = (props) => {
|
|
57
55
|
deepSearch,
|
58
56
|
limit,
|
59
57
|
});
|
60
|
-
// Results wrapped into ListItems
|
61
|
-
const searchResultsItems = React.useMemo(() => searchResults
|
62
|
-
.filter((item) => {
|
63
|
-
// Filter out items with similarity score below the threshold
|
64
|
-
return (item.score ?? 0) >= threshold;
|
65
|
-
})
|
66
|
-
.flatMap((item) => {
|
67
|
-
// Look up parent items if available
|
68
|
-
const parentDashboards = relationships.filter((rel) => rel.targetObjectId === item.id &&
|
69
|
-
rel.targetObjectType === item.type &&
|
70
|
-
rel.sourceObjectType === "dashboard");
|
71
|
-
const isLocked = item.workspaceId !== effectiveWorkspace;
|
72
|
-
// The item itself
|
73
|
-
const listItems = [
|
74
|
-
{
|
75
|
-
item,
|
76
|
-
url: getUIPath(item.type, item.id, effectiveWorkspace),
|
77
|
-
isLocked,
|
78
|
-
},
|
79
|
-
];
|
80
|
-
// Potentially, the item's parent dashboards
|
81
|
-
if (parentDashboards.length)
|
82
|
-
listItems.push(...parentDashboards.map((parent) => ({
|
83
|
-
item,
|
84
|
-
parentRef: parent,
|
85
|
-
url: getUIPath("dashboardVisualization", parent.sourceObjectId, effectiveWorkspace, item.id),
|
86
|
-
isLocked,
|
87
|
-
})));
|
88
|
-
return listItems;
|
89
|
-
}), [searchResults, effectiveWorkspace, relationships, threshold]);
|
90
|
-
// Report metrics
|
91
|
-
React.useEffect(() => {
|
92
|
-
onSearch?.(searchTerm, searchResultsItems);
|
93
|
-
// I don't want to report on search string change, only on results
|
94
|
-
// But I do need searchTerm, it will update with results anyway
|
95
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
96
|
-
}, [onSearch, searchResultsItems]);
|
97
58
|
// Search history
|
98
59
|
const [searchHistory, setSearchHistory] = useLocalStorage(SEARCH_HISTORY_KEY, SEARCH_HISTORY_EMPTY);
|
99
|
-
const onResultSelect =
|
60
|
+
const onResultSelect = useCallback((item, { newTab }, event) => {
|
100
61
|
setSearchHistory([...new Set([searchTerm, ...searchHistory])].slice(0, MAX_SEARCH_HISTORY_LENGTH));
|
101
|
-
const
|
62
|
+
const itemData = item.data;
|
63
|
+
const itemUrl = item.url;
|
64
|
+
const itemIndex = searchResults.findIndex((result) => result.id === item.id);
|
102
65
|
// Call the onSelect callback
|
103
66
|
onSelect({
|
104
|
-
item:
|
105
|
-
index:
|
106
|
-
preventDefault:
|
107
|
-
itemUrl:
|
67
|
+
item: itemData,
|
68
|
+
index: itemIndex,
|
69
|
+
preventDefault: event.preventDefault.bind(event),
|
70
|
+
itemUrl: itemUrl,
|
108
71
|
newTab,
|
109
72
|
});
|
110
73
|
// If the default was not prevented - simulate browser navigation for keyboard event
|
111
|
-
if (
|
74
|
+
if (itemUrl && !event.defaultPrevented && event.nativeEvent instanceof KeyboardEvent) {
|
112
75
|
if (newTab) {
|
113
|
-
window.open(
|
76
|
+
window.open(itemUrl, "_blank");
|
114
77
|
}
|
115
78
|
else {
|
116
|
-
window.location.href =
|
79
|
+
window.location.href = itemUrl;
|
117
80
|
}
|
118
81
|
}
|
119
82
|
// Trigger the dialog closing unless it's opening in a new tab
|
120
83
|
if (!newTab) {
|
121
84
|
toggleOpen();
|
122
85
|
}
|
123
|
-
}, [searchTerm, searchHistory, onSelect, setSearchHistory, toggleOpen,
|
124
|
-
const
|
125
|
-
const
|
126
|
-
|
86
|
+
}, [searchTerm, searchHistory, onSelect, setSearchHistory, toggleOpen, searchResults]);
|
87
|
+
const inputAccessibilityConfig = useMemo(() => ({ ariaLabel: intl.formatMessage({ id: "semantic-search.label" }) }), [intl]);
|
88
|
+
const onValueChange = useCallback((value) => setValue(String(value)), [setValue]);
|
89
|
+
const onEscKeyPress = useCallback((e) => {
|
90
|
+
if (value.length > 0) {
|
91
|
+
e.stopPropagation();
|
92
|
+
}
|
93
|
+
}, [value]);
|
94
|
+
// Send input keydown events to the tree view
|
95
|
+
const onKeyDown = useUiTreeViewEventPublisher("keydown");
|
96
|
+
const handleKeyDown = useCallback((event) => {
|
97
|
+
// Ignore the Space key when the input is focused
|
98
|
+
if (event.code === "Space") {
|
99
|
+
return;
|
100
|
+
}
|
101
|
+
onKeyDown(event);
|
102
|
+
}, [onKeyDown]);
|
103
|
+
// Report metrics
|
104
|
+
useEffect(() => {
|
105
|
+
onSearch?.(searchTerm, searchResults);
|
106
|
+
// I don't want to report on search string change, only on results
|
107
|
+
// But I do need searchTerm, it will update with results anyway
|
108
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
109
|
+
}, [onSearch, searchResults]);
|
110
|
+
useEffect(() => {
|
127
111
|
if (searchStatus === "error") {
|
128
112
|
// Report error to the console
|
129
113
|
// UI will display a generic error message
|
130
114
|
console.error(searchError);
|
131
115
|
}
|
132
116
|
}, [searchStatus, searchError]);
|
133
|
-
|
134
|
-
|
135
|
-
const onEscKeyPress = React.useCallback((e) => {
|
136
|
-
if (value.length > 0) {
|
137
|
-
e.stopPropagation();
|
138
|
-
}
|
139
|
-
}, [value]);
|
140
|
-
const Wrapper = ({ children, status, }) => {
|
141
|
-
const comp = renderFooter?.({ ...props, status, value }, {
|
142
|
-
closeSearch: toggleOpen,
|
143
|
-
});
|
144
|
-
if (comp) {
|
145
|
-
return (React.createElement("div", null,
|
146
|
-
children,
|
147
|
-
comp));
|
148
|
-
}
|
149
|
-
return React.createElement(React.Fragment, null, children);
|
150
|
-
};
|
151
|
-
return (React.createElement("div", { ref: ref, className: classnames("gd-semantic-search__overlay", className) },
|
152
|
-
React.createElement(Input, { className: "gd-semantic-search__overlay-input", autofocus: true, placeholder: intl.formatMessage({ id: "semantic-search.placeholder" }), accessibilityConfig: {
|
153
|
-
ariaLabel: intl.formatMessage({ id: "semantic-search.label" }),
|
154
|
-
}, isSearch: true, clearOnEsc: true, value: value, onChange: (e) => setValue(String(e)), onEscKeyPress: onEscKeyPress }),
|
117
|
+
return (React.createElement("div", { className: classnames("gd-semantic-search__overlay", className) },
|
118
|
+
React.createElement(Input, { className: "gd-semantic-search__overlay-input", autofocus: true, placeholder: intl.formatMessage({ id: "semantic-search.placeholder" }), accessibilityConfig: inputAccessibilityConfig, isSearch: true, clearOnEsc: true, value: value, onChange: onValueChange, onEscKeyPress: onEscKeyPress, onKeyDown: handleKeyDown }),
|
155
119
|
(() => {
|
156
120
|
switch (searchStatus) {
|
157
121
|
case "loading":
|
158
|
-
return
|
159
|
-
React.createElement(LoadingMask, { height: LOADING_HEIGHT })));
|
122
|
+
return React.createElement(LoadingMask, { height: LOADING_HEIGHT });
|
160
123
|
case "error":
|
161
|
-
return (React.createElement(
|
162
|
-
React.createElement(
|
163
|
-
React.createElement(
|
164
|
-
|
165
|
-
|
166
|
-
React.createElement(FormattedMessage, { id: "semantic-search.error.text" })))));
|
124
|
+
return (React.createElement("div", { className: "gd-semantic-search__overlay-error" },
|
125
|
+
React.createElement(Message, { type: "error" },
|
126
|
+
React.createElement(FormattedMessage, { tagName: "strong", id: "semantic-search.error.title" }),
|
127
|
+
" ",
|
128
|
+
React.createElement(FormattedMessage, { id: "semantic-search.error.text" }))));
|
167
129
|
case "success":
|
168
130
|
if (!searchResults.length) {
|
169
|
-
return (React.createElement(
|
170
|
-
React.createElement(
|
171
|
-
React.createElement(FormattedMessage, { id: "semantic-search.no-results", values: { query: searchTerm } }))));
|
131
|
+
return (React.createElement("div", { className: "gd-semantic-search__overlay-no-results" },
|
132
|
+
React.createElement(FormattedMessage, { id: "semantic-search.no-results", values: { query: searchTerm } })));
|
172
133
|
}
|
173
|
-
return (React.createElement(
|
174
|
-
React.createElement(SearchList, { items: searchResultsItems, width: width, onSelect: onResultSelect, ItemComponent: AnnotatedResultsItem })));
|
134
|
+
return (React.createElement(LeveledSearchTreeView, { workspace: effectiveWorkspace, searchResults: searchResults, searchRelationships: relationships, threshold: threshold, onSelect: onResultSelect }));
|
175
135
|
case "idle":
|
176
|
-
if (
|
177
|
-
return (React.createElement(
|
178
|
-
React.createElement(SearchList, { items: searchHistoryItems, width: width, onSelect: onHistorySelect, ItemComponent: HistoryItem })));
|
136
|
+
if (searchHistory.length) {
|
137
|
+
return (React.createElement(HistorySearchTreeView, { searchHistory: searchHistory, onSelect: setImmediate }));
|
179
138
|
}
|
180
139
|
// fallthrough
|
181
140
|
default:
|
182
141
|
return null;
|
183
142
|
}
|
184
|
-
})()
|
143
|
+
})(),
|
144
|
+
renderFooter?.({ ...props, status: searchStatus, value }, { closeSearch: toggleOpen })));
|
185
145
|
};
|
186
146
|
/**
|
187
147
|
* Inject `intl` prop to the component.
|
@@ -195,6 +155,7 @@ const SearchOverlayWithIntl = injectIntl(SearchOverlayCore);
|
|
195
155
|
export const SearchOverlay = ({ locale, metadataTimezone, ...props }) => {
|
196
156
|
return (React.createElement(MetadataTimezoneProvider, { value: metadataTimezone },
|
197
157
|
React.createElement(IntlWrapper, { locale: locale },
|
198
|
-
React.createElement(
|
158
|
+
React.createElement(UiTreeViewEventsProvider, null,
|
159
|
+
React.createElement(SearchOverlayWithIntl, { ...props })))));
|
199
160
|
};
|
200
161
|
//# sourceMappingURL=SearchOverlay.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SearchOverlay.js","sourceRoot":"","sources":["../../src/internal/SearchOverlay.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"SearchOverlay.js","sourceRoot":"","sources":["../../src/internal/SearchOverlay.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAyB,MAAM,YAAY,CAAC;AAOjF,OAAO,EACH,KAAK,EACL,WAAW,EACX,OAAO,EACP,eAAe,EACf,wBAAwB,EACxB,2BAA2B,GAE9B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAA6B,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;GAEG;AACH,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB;;GAEG;AACH,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B;;GAEG;AACH,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC;;GAEG;AACH,MAAM,kBAAkB,GAAG,4BAA4B,CAAC;AACxD;;GAEG;AACH,MAAM,oBAAoB,GAAa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AAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,CACrF,CACT,CAAC;AACN,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,qBAAqB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAClG,OAAO,CACH,oBAAC,wBAAwB,IAAC,KAAK,EAAE,gBAAgB;QAC7C,oBAAC,WAAW,IAAC,MAAM,EAAE,MAAM;YACvB,oBAAC,wBAAwB;gBACrB,oBAAC,qBAAqB,OAAK,KAAK,GAAI,CACb,CACjB,CACS,CAC9B,CAAC;AACN,CAAC,CAAC"}
|
@@ -1,12 +1,11 @@
|
|
1
|
-
import { ListItem } from "../types.js";
|
2
|
-
import { ISemanticSearchResultItem } from "@gooddata/sdk-model";
|
3
1
|
import * as React from "react";
|
4
2
|
/**
|
5
3
|
* Props for the update date component.
|
6
4
|
* @internal
|
7
5
|
*/
|
8
6
|
export type UpdateDateProps = {
|
9
|
-
|
7
|
+
createdAt?: string;
|
8
|
+
modifiedAt?: string;
|
10
9
|
};
|
11
10
|
/**
|
12
11
|
* Rendering the update date as memoized component.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UpdateDate.d.ts","sourceRoot":"","sources":["../../src/internal/UpdateDate.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
1
|
+
{"version":3,"file":"UpdateDate.d.ts","sourceRoot":"","sources":["../../src/internal/UpdateDate.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAQF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,6CAgCtB,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// (C) 2024 GoodData Corporation
|
1
|
+
// (C) 2024-2025 GoodData Corporation
|
2
2
|
import * as React from "react";
|
3
3
|
import { getDateTimeConfig } from "@gooddata/sdk-ui-kit";
|
4
4
|
import { defineMessages, FormattedDate, FormattedMessage, FormattedTime } from "react-intl";
|
@@ -16,9 +16,9 @@ const messages = defineMessages({
|
|
16
16
|
* the date formatting was one of the bottlenecks.
|
17
17
|
* @internal
|
18
18
|
*/
|
19
|
-
export const UpdatedDate = React.memo(function UpdatedDate({
|
19
|
+
export const UpdatedDate = React.memo(function UpdatedDate({ createdAt, modifiedAt }) {
|
20
20
|
const timezone = useMetadataTimezone() ?? DEFAULT_MD_TIMEZONE;
|
21
|
-
const timestamp =
|
21
|
+
const timestamp = modifiedAt ?? createdAt;
|
22
22
|
if (!timestamp)
|
23
23
|
return null;
|
24
24
|
const config = getDateTimeConfig(timestamp, { dateTimezone: timezone });
|
@@ -32,8 +32,10 @@ export const UpdatedDate = React.memo(function UpdatedDate({ listItem: { item }
|
|
32
32
|
React.createElement(FormattedTime, { value: config.date, hour: "numeric", minute: "2-digit" })));
|
33
33
|
}
|
34
34
|
else if (config.isCurrentYear) {
|
35
|
-
return React.createElement(
|
35
|
+
return (React.createElement("span", null,
|
36
|
+
React.createElement(FormattedDate, { value: config.date, day: "numeric", month: "short" })));
|
36
37
|
}
|
37
|
-
return React.createElement(
|
38
|
+
return (React.createElement("span", null,
|
39
|
+
React.createElement(FormattedDate, { value: config.date, day: "numeric", month: "short", year: "numeric" })));
|
38
40
|
});
|
39
41
|
//# sourceMappingURL=UpdateDate.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UpdateDate.js","sourceRoot":"","sources":["../../src/internal/UpdateDate.tsx"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"file":"UpdateDate.js","sourceRoot":"","sources":["../../src/internal/UpdateDate.tsx"],"names":[],"mappings":"A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AE,CAAC,EAAE,GAAI;;YAExC,oBAAC,aAAa,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAC,SAAS,EAAC,MAAM,EAAC,SAAS,GAAG,CAClE,CACV,CAAC;IACN,CAAC;SAAM,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;QAC9B,OAAO,CACH;YACI,oBAAC,aAAa,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,GAAG,EAAC,SAAS,EAAC,KAAK,EAAC,OAAO,GAAG,CAC9D,CACV,CAAC;IACN,CAAC;IACD,OAAO,CACH;QACI,oBAAC,aAAa,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,GAAG,EAAC,SAAS,EAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,SAAS,GAAG,CAC7E,CACV,CAAC;AACN,CAAC,CAAC,CAAC"}
|
@@ -11,6 +11,10 @@
|
|
11
11
|
"value": "No results found for “{query}”.",
|
12
12
|
"comment": "Message shown when semantic search returns no results. The {query} placeholder shows the search term entered by the user."
|
13
13
|
},
|
14
|
+
"semantic-search.results.count": {
|
15
|
+
"value": "{count, plural, one {# result} other {# results}}",
|
16
|
+
"comment": "Information about number of search results."
|
17
|
+
},
|
14
18
|
"semantic-search.label": {
|
15
19
|
"value": "Search dashboards or visualization",
|
16
20
|
"comment": "Label for the input box that is used in semantic search."
|
@@ -35,6 +39,18 @@
|
|
35
39
|
"value": "Previous search",
|
36
40
|
"comment": "Area-label for the search history icon."
|
37
41
|
},
|
42
|
+
"semantic-search.tree": {
|
43
|
+
"value": "Semantic search tree",
|
44
|
+
"comment": "ARIA label for the semantic search results tree view component."
|
45
|
+
},
|
46
|
+
"semantic-search.tree.history": {
|
47
|
+
"value": "Semantic search tree history",
|
48
|
+
"comment": "ARIA label for the semantic search history tree view component."
|
49
|
+
},
|
50
|
+
"semantic-search.edit": {
|
51
|
+
"value": "Edit",
|
52
|
+
"comment": "Label for the edit action in semantic search results tree view."
|
53
|
+
},
|
38
54
|
"semantic-search.date.at": {
|
39
55
|
"value": "at",
|
40
56
|
"comment": "Label for the date range filter identifying hour. Example: Today at 4:30."
|
@@ -2,12 +2,16 @@ export declare const en_US: {
|
|
2
2
|
"semantic-search.error.title": string;
|
3
3
|
"semantic-search.error.text": string;
|
4
4
|
"semantic-search.no-results": string;
|
5
|
+
"semantic-search.results.count": string;
|
5
6
|
"semantic-search.label": string;
|
6
7
|
"semantic-search.placeholder": string;
|
7
8
|
"semantic-search.id": string;
|
8
9
|
"semantic-search.tags": string;
|
9
10
|
"semantic-search.match": string;
|
10
11
|
"semantic-search.previous-search": string;
|
12
|
+
"semantic-search.tree": string;
|
13
|
+
"semantic-search.tree.history": string;
|
14
|
+
"semantic-search.edit": string;
|
11
15
|
"semantic-search.date.at": string;
|
12
16
|
"semantic-search.ask.ai.assistant": string;
|
13
17
|
"gs.date.today": string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"en-US.localization-bundle.d.ts","sourceRoot":"","sources":["../../../src/localization/bundles/en-US.localization-bundle.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK
|
1
|
+
{"version":3,"file":"en-US.localization-bundle.d.ts","sourceRoot":"","sources":["../../../src/localization/bundles/en-US.localization-bundle.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;CAkBjB,CAAC"}
|
@@ -4,12 +4,16 @@ export const en_US = {
|
|
4
4
|
"semantic-search.error.title": "Our search service is temporarily down.",
|
5
5
|
"semantic-search.error.text": "We are working to resolve the issue.",
|
6
6
|
"semantic-search.no-results": "No results found for “{query}”.",
|
7
|
+
"semantic-search.results.count": "{count, plural, one {# result} other {# results}}",
|
7
8
|
"semantic-search.label": "Search dashboards or visualization",
|
8
9
|
"semantic-search.placeholder": "Search dashboards or visualization…",
|
9
10
|
"semantic-search.id": "ID",
|
10
11
|
"semantic-search.tags": "Tags",
|
11
12
|
"semantic-search.match": "{score}% match",
|
12
13
|
"semantic-search.previous-search": "Previous search",
|
14
|
+
"semantic-search.tree": "Semantic search tree",
|
15
|
+
"semantic-search.tree.history": "Semantic search tree history",
|
16
|
+
"semantic-search.edit": "Edit",
|
13
17
|
"semantic-search.date.at": "at",
|
14
18
|
"semantic-search.ask.ai.assistant": "Ask AI Assistant",
|
15
19
|
"gs.date.today": "Today",
|