@uniformdev/mesh-sdk-react 18.32.1-alpha.26 → 18.33.1-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +15 -411
- package/dist/index.esm.js +35 -816
- package/dist/index.js +61 -864
- package/dist/index.mjs +35 -816
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -955,12 +955,12 @@ import { Callout as Callout2 } from "@uniformdev/design-system";
|
|
|
955
955
|
import React6, { useContext as useContext2, useMemo as useMemo2, useRef as useRef5 } from "react";
|
|
956
956
|
import { useAsync, useAsyncFn as useAsyncFn2 } from "react-use";
|
|
957
957
|
|
|
958
|
-
// src/components/
|
|
958
|
+
// src/components/EntrySearch/DefaultSearchRow.tsx
|
|
959
959
|
import { css as css7 } from "@emotion/react";
|
|
960
960
|
import { useOutsideClick } from "@uniformdev/design-system";
|
|
961
961
|
import { useRef, useState } from "react";
|
|
962
962
|
|
|
963
|
-
// src/components/
|
|
963
|
+
// src/components/EntrySearch/styles/DefaultSearchRow.styles.ts
|
|
964
964
|
import { css as css6 } from "@emotion/react";
|
|
965
965
|
var searchRowContainer = css6`
|
|
966
966
|
cursor: pointer;
|
|
@@ -1001,7 +1001,7 @@ var searchRowBtn = css6`
|
|
|
1001
1001
|
inset: 0 var(--spacing-sm) 0 auto;
|
|
1002
1002
|
`;
|
|
1003
1003
|
|
|
1004
|
-
// src/components/
|
|
1004
|
+
// src/components/EntrySearch/DefaultSearchRow.tsx
|
|
1005
1005
|
import { jsx as jsx19, jsxs as jsxs8 } from "@emotion/react/jsx-runtime";
|
|
1006
1006
|
var DefaultSearchRow = ({ result, isSelected, triggerSelection }) => {
|
|
1007
1007
|
const popoverRef = useRef(null);
|
|
@@ -1075,7 +1075,7 @@ var DefaultSearchRow = ({ result, isSelected, triggerSelection }) => {
|
|
|
1075
1075
|
);
|
|
1076
1076
|
};
|
|
1077
1077
|
|
|
1078
|
-
// src/components/
|
|
1078
|
+
// src/components/EntrySearch/DefaultSelectedItem.tsx
|
|
1079
1079
|
import { css as css9 } from "@emotion/react";
|
|
1080
1080
|
import { Icon as Icon2, useOutsideClick as useOutsideClick2 } from "@uniformdev/design-system";
|
|
1081
1081
|
import { useEffect, useRef as useRef2, useState as useState2 } from "react";
|
|
@@ -1093,7 +1093,7 @@ function openWindowWithCloseCallback(href, callback) {
|
|
|
1093
1093
|
}, 500);
|
|
1094
1094
|
}
|
|
1095
1095
|
|
|
1096
|
-
// src/components/
|
|
1096
|
+
// src/components/EntrySearch/styles/DefaultSelectedItem.styles.ts
|
|
1097
1097
|
import { css as css8 } from "@emotion/react";
|
|
1098
1098
|
import { mq as mq2 } from "@uniformdev/design-system";
|
|
1099
1099
|
var selectedItemContainer = css8`
|
|
@@ -1177,7 +1177,7 @@ var selectItemLinkBtn = css8`
|
|
|
1177
1177
|
}
|
|
1178
1178
|
`;
|
|
1179
1179
|
|
|
1180
|
-
// src/components/
|
|
1180
|
+
// src/components/EntrySearch/DefaultSelectedItem.tsx
|
|
1181
1181
|
import { jsx as jsx20, jsxs as jsxs9 } from "@emotion/react/jsx-runtime";
|
|
1182
1182
|
var DefaultSelectedItem = ({
|
|
1183
1183
|
selectedItem,
|
|
@@ -1360,7 +1360,7 @@ var DefaultSelectedItem = ({
|
|
|
1360
1360
|
] }) }, selectedItem.id);
|
|
1361
1361
|
};
|
|
1362
1362
|
|
|
1363
|
-
// src/components/
|
|
1363
|
+
// src/components/EntrySearch/EntrySearch.tsx
|
|
1364
1364
|
import { css as css11 } from "@emotion/react";
|
|
1365
1365
|
import {
|
|
1366
1366
|
Button,
|
|
@@ -1411,7 +1411,7 @@ function useLoadingDelay(loading, { delay = 500, minDuration = 200 } = {
|
|
|
1411
1411
|
return state === "DISPLAY" || state === "EXPIRE";
|
|
1412
1412
|
}
|
|
1413
1413
|
|
|
1414
|
-
// src/components/
|
|
1414
|
+
// src/components/EntrySearch/styles/EntrySearch.styles.ts
|
|
1415
1415
|
import { css as css10 } from "@emotion/react";
|
|
1416
1416
|
var entrySearchWrapper = css10`
|
|
1417
1417
|
background: var(--white);
|
|
@@ -1522,7 +1522,7 @@ var badgeIcon = css10`
|
|
|
1522
1522
|
height: calc(var(--spacing-lg) + var(--spacing-xs));
|
|
1523
1523
|
`;
|
|
1524
1524
|
|
|
1525
|
-
// src/components/
|
|
1525
|
+
// src/components/EntrySearch/EntrySearch.tsx
|
|
1526
1526
|
import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs10 } from "@emotion/react/jsx-runtime";
|
|
1527
1527
|
var DefaultNoResults = ({ searchText, selectedContentType }) => {
|
|
1528
1528
|
let message = "No content found";
|
|
@@ -2655,18 +2655,6 @@ import { Theme } from "@uniformdev/design-system";
|
|
|
2655
2655
|
import { createContext, useContext as useContext3 } from "react";
|
|
2656
2656
|
import { jsx as jsx26, jsxs as jsxs15 } from "@emotion/react/jsx-runtime";
|
|
2657
2657
|
var UniformMeshSdkContext = createContext(void 0);
|
|
2658
|
-
var UniformMeshSdkContextProvider = ({ children }) => {
|
|
2659
|
-
let value = void 0;
|
|
2660
|
-
if (typeof window !== "undefined" && typeof window.UniformMeshSDK !== "undefined") {
|
|
2661
|
-
value = {
|
|
2662
|
-
sdk: window.UniformMeshSDK
|
|
2663
|
-
};
|
|
2664
|
-
}
|
|
2665
|
-
return /* @__PURE__ */ jsxs15(UniformMeshSdkContext.Provider, { value, children: [
|
|
2666
|
-
/* @__PURE__ */ jsx26(Theme, {}),
|
|
2667
|
-
/* @__PURE__ */ jsx26(UniformMeshLocationContextProvider, { children })
|
|
2668
|
-
] });
|
|
2669
|
-
};
|
|
2670
2658
|
var useUniformMeshSdkContext = () => {
|
|
2671
2659
|
const context = useContext3(UniformMeshSdkContext);
|
|
2672
2660
|
if (!context) {
|
|
@@ -2683,9 +2671,7 @@ function useUniformMeshSdk() {
|
|
|
2683
2671
|
|
|
2684
2672
|
// src/components/UniformMeshLocationContext.tsx
|
|
2685
2673
|
import { jsx as jsx27 } from "@emotion/react/jsx-runtime";
|
|
2686
|
-
var UniformMeshLocationContext = createContext2(
|
|
2687
|
-
void 0
|
|
2688
|
-
);
|
|
2674
|
+
var UniformMeshLocationContext = createContext2(void 0);
|
|
2689
2675
|
var UniformMeshLocationContextProvider = ({
|
|
2690
2676
|
children
|
|
2691
2677
|
}) => {
|
|
@@ -2716,20 +2702,9 @@ var useUniformMeshLocationContext = () => {
|
|
|
2716
2702
|
};
|
|
2717
2703
|
|
|
2718
2704
|
// src/hooks/useMeshLocation.ts
|
|
2719
|
-
var legacyWarned = false;
|
|
2720
2705
|
function useMeshLocation(expectedLocation) {
|
|
2721
2706
|
const { location } = useUniformMeshLocationContext();
|
|
2722
|
-
|
|
2723
|
-
if (expectedLocation === "dataTypeInstance") {
|
|
2724
|
-
effectiveExpected = "dataResource";
|
|
2725
|
-
if (!legacyWarned) {
|
|
2726
|
-
console.warn(
|
|
2727
|
-
"`dataTypeInstance` mesh location is deprecated, please switch to `dataResource` instead."
|
|
2728
|
-
);
|
|
2729
|
-
legacyWarned = true;
|
|
2730
|
-
}
|
|
2731
|
-
}
|
|
2732
|
-
if (effectiveExpected && location.type !== effectiveExpected) {
|
|
2707
|
+
if (expectedLocation && location.type !== expectedLocation) {
|
|
2733
2708
|
throw new Error(`Expected location type ${expectedLocation} but got ${location.type}`);
|
|
2734
2709
|
}
|
|
2735
2710
|
const backdoorLocation = useRef7(location);
|
|
@@ -3216,7 +3191,7 @@ function DataResourceVariablesList({
|
|
|
3216
3191
|
const {
|
|
3217
3192
|
value,
|
|
3218
3193
|
metadata: { dataType }
|
|
3219
|
-
} = useMeshLocation("
|
|
3194
|
+
} = useMeshLocation("dataResource");
|
|
3220
3195
|
const variableDefinitions = variablesToList(dataType.variables);
|
|
3221
3196
|
if (variableDefinitions.length === 0) {
|
|
3222
3197
|
if (NoVariablesComponent) {
|
|
@@ -3895,743 +3870,17 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
3895
3870
|
};
|
|
3896
3871
|
}
|
|
3897
3872
|
|
|
3898
|
-
// src/components/EntrySearch/DataRefreshButton.tsx
|
|
3899
|
-
import { css as css25 } from "@emotion/react";
|
|
3900
|
-
import { Button as Button3, LoadingIndicator as LoadingIndicator2 } from "@uniformdev/design-system";
|
|
3901
|
-
import { jsx as jsx44, jsxs as jsxs25 } from "@emotion/react/jsx-runtime";
|
|
3902
|
-
var DataRefreshButton = ({
|
|
3903
|
-
buttonText,
|
|
3904
|
-
isLoading,
|
|
3905
|
-
onRefreshData,
|
|
3906
|
-
...props
|
|
3907
|
-
}) => {
|
|
3908
|
-
return /* @__PURE__ */ jsxs25(Button3, { buttonType: "primaryInvert", onClick: onRefreshData, disabled: isLoading, ...props, children: [
|
|
3909
|
-
!isLoading ? null : /* @__PURE__ */ jsx44(
|
|
3910
|
-
LoadingIndicator2,
|
|
3911
|
-
{
|
|
3912
|
-
css: css25`
|
|
3913
|
-
${isLoading ? "opacity: 0.2;" : void 0}
|
|
3914
|
-
`
|
|
3915
|
-
}
|
|
3916
|
-
),
|
|
3917
|
-
buttonText
|
|
3918
|
-
] });
|
|
3919
|
-
};
|
|
3920
|
-
|
|
3921
|
-
// src/components/EntrySearch/EntrySearchContainer.tsx
|
|
3922
|
-
import { Container, IconsProvider, ScrollableList, VerticalRhythm } from "@uniformdev/design-system";
|
|
3923
|
-
import { jsx as jsx45, jsxs as jsxs26 } from "@emotion/react/jsx-runtime";
|
|
3924
|
-
var EntrySearchContainer = ({ searchFilters, resultList, children }) => {
|
|
3925
|
-
return /* @__PURE__ */ jsx45(IconsProvider, { children: /* @__PURE__ */ jsxs26(VerticalRhythm, { children: [
|
|
3926
|
-
/* @__PURE__ */ jsx45(Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: /* @__PURE__ */ jsxs26(VerticalRhythm, { children: [
|
|
3927
|
-
searchFilters,
|
|
3928
|
-
!resultList ? null : /* @__PURE__ */ jsx45(ScrollableList, { role: "list", children: resultList })
|
|
3929
|
-
] }) }),
|
|
3930
|
-
children
|
|
3931
|
-
] }) });
|
|
3932
|
-
};
|
|
3933
|
-
|
|
3934
|
-
// src/components/EntrySearch/EntrySearchFilter.tsx
|
|
3935
|
-
import { InputKeywordSearch as InputKeywordSearch2, InputSelect as InputSelect6 } from "@uniformdev/design-system";
|
|
3936
|
-
import { useState as useState10 } from "react";
|
|
3937
|
-
|
|
3938
|
-
// src/components/EntrySearch/hooks/EntrySearchContext.tsx
|
|
3939
|
-
import { createContext as createContext5, useCallback, useContext as useContext7, useDeferredValue, useState as useState9 } from "react";
|
|
3940
|
-
import { jsx as jsx46 } from "@emotion/react/jsx-runtime";
|
|
3941
|
-
var EntrySearchContext = createContext5({
|
|
3942
|
-
onSetQuery: () => {
|
|
3943
|
-
},
|
|
3944
|
-
onSelectItem: () => {
|
|
3945
|
-
},
|
|
3946
|
-
query: {
|
|
3947
|
-
contentType: "",
|
|
3948
|
-
keyword: ""
|
|
3949
|
-
},
|
|
3950
|
-
list: {},
|
|
3951
|
-
onSetList: () => {
|
|
3952
|
-
},
|
|
3953
|
-
selectedListItems: [],
|
|
3954
|
-
onRemoveAllSelectedItems: () => {
|
|
3955
|
-
}
|
|
3956
|
-
});
|
|
3957
|
-
var EntrySearchProvider = ({ currentlySelectedItems, children }) => {
|
|
3958
|
-
const [query, setQuery] = useState9({
|
|
3959
|
-
contentType: "",
|
|
3960
|
-
keyword: ""
|
|
3961
|
-
});
|
|
3962
|
-
const querySearchDeferred = useDeferredValue(query);
|
|
3963
|
-
const [selectedItems, setSelectedItems] = useState9(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
3964
|
-
const [list, setList] = useState9({});
|
|
3965
|
-
const onSetQuery = useCallback(
|
|
3966
|
-
(value) => {
|
|
3967
|
-
if (Array.isArray(value.contentType) && value.contentType.length > 0) {
|
|
3968
|
-
return setQuery({
|
|
3969
|
-
...value,
|
|
3970
|
-
contentType: value.contentType[0].id
|
|
3971
|
-
});
|
|
3972
|
-
}
|
|
3973
|
-
return setQuery(value);
|
|
3974
|
-
},
|
|
3975
|
-
[setQuery]
|
|
3976
|
-
);
|
|
3977
|
-
const onSelectItem = useCallback(
|
|
3978
|
-
(selectedResult) => {
|
|
3979
|
-
if (Array.isArray(selectedResult)) {
|
|
3980
|
-
setSelectedItems(selectedResult);
|
|
3981
|
-
} else {
|
|
3982
|
-
if (selectedItems.some((item) => item.id === selectedResult.id)) {
|
|
3983
|
-
setSelectedItems((prev) => prev.filter((item) => item.id !== selectedResult.id));
|
|
3984
|
-
} else {
|
|
3985
|
-
setSelectedItems((prev) => [...prev, selectedResult]);
|
|
3986
|
-
}
|
|
3987
|
-
}
|
|
3988
|
-
},
|
|
3989
|
-
[setSelectedItems, selectedItems]
|
|
3990
|
-
);
|
|
3991
|
-
const onRemoveAllSelectedItems = useCallback(() => {
|
|
3992
|
-
setSelectedItems([]);
|
|
3993
|
-
}, [setSelectedItems]);
|
|
3994
|
-
const onSetList = useCallback(
|
|
3995
|
-
(value) => {
|
|
3996
|
-
setList(value);
|
|
3997
|
-
},
|
|
3998
|
-
[setList]
|
|
3999
|
-
);
|
|
4000
|
-
return /* @__PURE__ */ jsx46(
|
|
4001
|
-
EntrySearchContext.Provider,
|
|
4002
|
-
{
|
|
4003
|
-
value: {
|
|
4004
|
-
onSetQuery,
|
|
4005
|
-
query: querySearchDeferred,
|
|
4006
|
-
onSelectItem,
|
|
4007
|
-
selectedListItems: selectedItems,
|
|
4008
|
-
onRemoveAllSelectedItems,
|
|
4009
|
-
list,
|
|
4010
|
-
onSetList
|
|
4011
|
-
},
|
|
4012
|
-
children
|
|
4013
|
-
}
|
|
4014
|
-
);
|
|
4015
|
-
};
|
|
4016
|
-
var useEntrySearchContext = () => {
|
|
4017
|
-
const contextValues = useContext7(EntrySearchContext);
|
|
4018
|
-
return { ...contextValues };
|
|
4019
|
-
};
|
|
4020
|
-
|
|
4021
|
-
// src/components/EntrySearch/styles/EntrySearchFilterContainer.styles.ts
|
|
4022
|
-
import { css as css26 } from "@emotion/react";
|
|
4023
|
-
var EntrySearchFilterContainerLabel = css26`
|
|
4024
|
-
align-items: center;
|
|
4025
|
-
display: flex;
|
|
4026
|
-
font-size: var(--fs-sm);
|
|
4027
|
-
font-weight: var(--fw-bold);
|
|
4028
|
-
line-height: 1rem;
|
|
4029
|
-
margin-bottom: var(--spacing-sm);
|
|
4030
|
-
`;
|
|
4031
|
-
var EntrySearchFilterContainer = css26`
|
|
4032
|
-
display: grid;
|
|
4033
|
-
gap: var(--spacing-base);
|
|
4034
|
-
`;
|
|
4035
|
-
var EntrySearchFilterDropdownAndTextSearch = css26`
|
|
4036
|
-
grid-template-columns: 0.5fr 1fr;
|
|
4037
|
-
`;
|
|
4038
|
-
var EntrySearchFilterGrid = (gridColumns) => css26`
|
|
4039
|
-
display: grid;
|
|
4040
|
-
grid-template-columns: ${gridColumns};
|
|
4041
|
-
gap: var(--spacing-base);
|
|
4042
|
-
`;
|
|
4043
|
-
|
|
4044
|
-
// src/components/EntrySearch/EntrySearchFilter.tsx
|
|
4045
|
-
import { jsx as jsx47, jsxs as jsxs27 } from "@emotion/react/jsx-runtime";
|
|
4046
|
-
var EntrySearchFilter = ({
|
|
4047
|
-
requireContentType,
|
|
4048
|
-
typeSelectorAllTypesOptionText = "All content types",
|
|
4049
|
-
searchInputName = "searchText",
|
|
4050
|
-
searchInputPlaceholderText = "Enter keyword to narrow your results",
|
|
4051
|
-
selectLabel = "Content Type Select",
|
|
4052
|
-
selectOptions
|
|
4053
|
-
}) => {
|
|
4054
|
-
const { query, onSetQuery } = useEntrySearchContext();
|
|
4055
|
-
const [searchState, setSearchState] = useState10({
|
|
4056
|
-
contentType: "",
|
|
4057
|
-
keyword: ""
|
|
4058
|
-
});
|
|
4059
|
-
const handleFilterChange = (value) => {
|
|
4060
|
-
setSearchState((prev) => {
|
|
4061
|
-
return { ...prev, ...value };
|
|
4062
|
-
});
|
|
4063
|
-
onSetQuery({ ...query, ...value });
|
|
4064
|
-
};
|
|
4065
|
-
return /* @__PURE__ */ jsxs27("fieldset", { css: [EntrySearchFilterContainer, EntrySearchFilterDropdownAndTextSearch], children: [
|
|
4066
|
-
/* @__PURE__ */ jsx47(
|
|
4067
|
-
InputSelect6,
|
|
4068
|
-
{
|
|
4069
|
-
label: selectLabel,
|
|
4070
|
-
showLabel: false,
|
|
4071
|
-
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
4072
|
-
options: [
|
|
4073
|
-
...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
|
|
4074
|
-
...selectOptions ? selectOptions.map((option) => {
|
|
4075
|
-
var _a;
|
|
4076
|
-
return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
|
|
4077
|
-
}) : []
|
|
4078
|
-
],
|
|
4079
|
-
value: query.contentType
|
|
4080
|
-
}
|
|
4081
|
-
),
|
|
4082
|
-
/* @__PURE__ */ jsx47(
|
|
4083
|
-
InputKeywordSearch2,
|
|
4084
|
-
{
|
|
4085
|
-
inputFieldName: searchInputName,
|
|
4086
|
-
placeholder: searchInputPlaceholderText,
|
|
4087
|
-
onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
|
|
4088
|
-
disabledFieldSubmission: true,
|
|
4089
|
-
onClear: () => handleFilterChange({ keyword: "" }),
|
|
4090
|
-
value: searchState.keyword
|
|
4091
|
-
}
|
|
4092
|
-
)
|
|
4093
|
-
] });
|
|
4094
|
-
};
|
|
4095
|
-
|
|
4096
|
-
// src/components/EntrySearch/EntrySearchFilterContainer.tsx
|
|
4097
|
-
import { jsx as jsx48, jsxs as jsxs28 } from "@emotion/react/jsx-runtime";
|
|
4098
|
-
var EntrySearchFilterContainer2 = ({ label, children }) => {
|
|
4099
|
-
return /* @__PURE__ */ jsxs28("div", { children: [
|
|
4100
|
-
/* @__PURE__ */ jsx48("span", { css: EntrySearchFilterContainerLabel, children: label }),
|
|
4101
|
-
/* @__PURE__ */ jsx48("div", { css: EntrySearchFilterContainer, children })
|
|
4102
|
-
] });
|
|
4103
|
-
};
|
|
4104
|
-
|
|
4105
|
-
// src/components/EntrySearch/EntrySearchListItem.tsx
|
|
4106
|
-
import { Popover } from "@uniformdev/design-system";
|
|
4107
|
-
|
|
4108
|
-
// src/components/EntrySearch/styles/EntrySearchListItem.styles.ts
|
|
4109
|
-
import { css as css27 } from "@emotion/react";
|
|
4110
|
-
import { skeletonLoading } from "@uniformdev/design-system";
|
|
4111
|
-
var EntryListItemContainer = css27`
|
|
4112
|
-
align-items: center;
|
|
4113
|
-
border: 1px solid var(--gray-300);
|
|
4114
|
-
border-radius: var(--rounded-base);
|
|
4115
|
-
background: var(--white);
|
|
4116
|
-
display: grid;
|
|
4117
|
-
grid-template-columns: 1fr 32px;
|
|
4118
|
-
padding: var(--spacing-sm);
|
|
4119
|
-
|
|
4120
|
-
&[hidden] {
|
|
4121
|
-
display: none;
|
|
4122
|
-
}
|
|
4123
|
-
`;
|
|
4124
|
-
var EntryListItemLoading = css27`
|
|
4125
|
-
animation: ${skeletonLoading} 1s linear infinite alternate;
|
|
4126
|
-
border-color: transparent;
|
|
4127
|
-
min-height: 42px;
|
|
4128
|
-
position: relative;
|
|
4129
|
-
|
|
4130
|
-
&:before,
|
|
4131
|
-
&:after {
|
|
4132
|
-
background: var(--gray-200);
|
|
4133
|
-
content: '';
|
|
4134
|
-
display: block;
|
|
4135
|
-
height: 1rem;
|
|
4136
|
-
}
|
|
4137
|
-
|
|
4138
|
-
&:before {
|
|
4139
|
-
border-radius: var(--rounded-base);
|
|
4140
|
-
width: 10rem;
|
|
4141
|
-
}
|
|
4142
|
-
|
|
4143
|
-
&:after {
|
|
4144
|
-
border-radius: var(--rounded-full);
|
|
4145
|
-
width: 1rem;
|
|
4146
|
-
}
|
|
4147
|
-
`;
|
|
4148
|
-
var EntryListItemHeadingGroup = css27`
|
|
4149
|
-
align-items: center;
|
|
4150
|
-
display: grid;
|
|
4151
|
-
`;
|
|
4152
|
-
var EntryListItemTitle = css27`
|
|
4153
|
-
color: var(--brand-secondary-1);
|
|
4154
|
-
display: block;
|
|
4155
|
-
font-size: var(--fs-sm);
|
|
4156
|
-
`;
|
|
4157
|
-
var EntryListItemSubtitle = css27`
|
|
4158
|
-
color: var(--gray-500);
|
|
4159
|
-
display: block;
|
|
4160
|
-
font-size: var(--fs-xs);
|
|
4161
|
-
line-height: 1;
|
|
4162
|
-
`;
|
|
4163
|
-
var EntryListItemInfoContainer = css27`
|
|
4164
|
-
align-items: center;
|
|
4165
|
-
display: flex;
|
|
4166
|
-
justify-content: center;
|
|
4167
|
-
`;
|
|
4168
|
-
var EntryListItemControlledContent = css27`
|
|
4169
|
-
display: flex;
|
|
4170
|
-
gap: var(--spacing-sm);
|
|
4171
|
-
`;
|
|
4172
|
-
var EntryListItemUnControlledContent = css27`
|
|
4173
|
-
margin-top: var(--spacing-sm);
|
|
4174
|
-
grid-column: 1 / -1;
|
|
4175
|
-
`;
|
|
4176
|
-
|
|
4177
|
-
// src/components/EntrySearch/EntrySearchListItem.tsx
|
|
4178
|
-
import { jsx as jsx49, jsxs as jsxs29 } from "@emotion/react/jsx-runtime";
|
|
4179
|
-
var EntrySearchListItem = ({
|
|
4180
|
-
id,
|
|
4181
|
-
title,
|
|
4182
|
-
contentType,
|
|
4183
|
-
image,
|
|
4184
|
-
popoverData,
|
|
4185
|
-
onSelect,
|
|
4186
|
-
isMulti = false,
|
|
4187
|
-
children,
|
|
4188
|
-
...props
|
|
4189
|
-
}) => {
|
|
4190
|
-
const { onSelectItem, selectedListItems } = useEntrySearchContext();
|
|
4191
|
-
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
4192
|
-
const handleSelectItem = () => {
|
|
4193
|
-
var _a;
|
|
4194
|
-
const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
|
|
4195
|
-
const selectedItem = { id, title, contentType, image, popoverData, ...extraData };
|
|
4196
|
-
if (isMulti) {
|
|
4197
|
-
return onSelectItem(selectedItem);
|
|
4198
|
-
}
|
|
4199
|
-
return onSelectItem([selectedItem]);
|
|
4200
|
-
};
|
|
4201
|
-
const hideWhenInSelectedList = selectedListItems.some((item) => item.id === id);
|
|
4202
|
-
return /* @__PURE__ */ jsxs29("div", { role: "listitem", hidden: hideWhenInSelectedList, css: EntryListItemContainer, ...props, children: [
|
|
4203
|
-
/* @__PURE__ */ jsxs29("div", { role: "button", onClick: handleSelectItem, css: EntryListItemControlledContent, children: [
|
|
4204
|
-
!image ? null : /* @__PURE__ */ jsx49("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
|
|
4205
|
-
/* @__PURE__ */ jsxs29("div", { role: "heading", css: EntryListItemHeadingGroup, children: [
|
|
4206
|
-
!contentType ? null : /* @__PURE__ */ jsx49("span", { css: EntryListItemSubtitle, children: formatedContentType }),
|
|
4207
|
-
/* @__PURE__ */ jsx49("span", { css: EntryListItemTitle, children: title })
|
|
4208
|
-
] })
|
|
4209
|
-
] }),
|
|
4210
|
-
!popoverData ? null : /* @__PURE__ */ jsx49("div", { css: EntryListItemInfoContainer, children: /* @__PURE__ */ jsx49(Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData }) }),
|
|
4211
|
-
!children ? null : /* @__PURE__ */ jsx49("div", { css: EntryListItemUnControlledContent, children })
|
|
4212
|
-
] });
|
|
4213
|
-
};
|
|
4214
|
-
var EntrySearchListItemLoadingSkeleton = () => {
|
|
4215
|
-
return /* @__PURE__ */ jsx49("div", { role: "presentation", css: [EntryListItemContainer, EntryListItemLoading] });
|
|
4216
|
-
};
|
|
4217
|
-
|
|
4218
|
-
// src/components/EntrySearch/EntrySearchResultItem.tsx
|
|
4219
|
-
import { Badge, Button as Button4, Popover as Popover2 } from "@uniformdev/design-system";
|
|
4220
|
-
import { format as timeagoFormat } from "timeago.js";
|
|
4221
|
-
|
|
4222
|
-
// src/components/EntrySearch/styles/EntrySearchResultItem.styles.ts
|
|
4223
|
-
import { css as css28 } from "@emotion/react";
|
|
4224
|
-
var EntrySearchResultItemContainer = css28`
|
|
4225
|
-
align-items: center;
|
|
4226
|
-
border: 1px solid var(--gray-300);
|
|
4227
|
-
border-radius: var(--rounded-base);
|
|
4228
|
-
background: var(--gray-50);
|
|
4229
|
-
display: grid;
|
|
4230
|
-
grid-template-columns: 1fr auto;
|
|
4231
|
-
padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) var(--spacing-md);
|
|
4232
|
-
position: relative;
|
|
4233
|
-
|
|
4234
|
-
&:hover {
|
|
4235
|
-
.drag-handle {
|
|
4236
|
-
opacity: 1;
|
|
4237
|
-
}
|
|
4238
|
-
}
|
|
4239
|
-
`;
|
|
4240
|
-
var EntrySearchDragHandle = css28`
|
|
4241
|
-
border-left: 2px dotted var(--gray-300);
|
|
4242
|
-
border-right: 2px dotted var(--gray-300);
|
|
4243
|
-
position: absolute;
|
|
4244
|
-
inset: var(--spacing-sm) auto var(--spacing-sm) var(--spacing-sm);
|
|
4245
|
-
width: 5px;
|
|
4246
|
-
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
4247
|
-
opacity: 0;
|
|
4248
|
-
`;
|
|
4249
|
-
var EntrySearchResultItemSubtitle = css28`
|
|
4250
|
-
color: var(--gray-500);
|
|
4251
|
-
display: block;
|
|
4252
|
-
font-size: var(--fs-xs);
|
|
4253
|
-
line-height: 1;
|
|
4254
|
-
`;
|
|
4255
|
-
var EntrySearchResultItemTitle = css28`
|
|
4256
|
-
align-items: center;
|
|
4257
|
-
color: var(--brand-secondary-1);
|
|
4258
|
-
display: flex;
|
|
4259
|
-
gap: var(--spacing-xs);
|
|
4260
|
-
`;
|
|
4261
|
-
var EntrySearchResultItemTimeStamp = css28`
|
|
4262
|
-
color: var(--gray-500);
|
|
4263
|
-
font-size: var(--fs-xs);
|
|
4264
|
-
`;
|
|
4265
|
-
var EntrySearchAuthorStateGroup = css28`
|
|
4266
|
-
align-items: center;
|
|
4267
|
-
display: flex;
|
|
4268
|
-
gap: var(--spacing-sm);
|
|
4269
|
-
`;
|
|
4270
|
-
var EntrySearchUpdateGroup = css28`
|
|
4271
|
-
display: grid;
|
|
4272
|
-
`;
|
|
4273
|
-
var EntrySearchContentContainer = css28`
|
|
4274
|
-
display: flex;
|
|
4275
|
-
gap: var(--spacing-base);
|
|
4276
|
-
`;
|
|
4277
|
-
var EntrySearchImage = css28`
|
|
4278
|
-
width: 56px;
|
|
4279
|
-
object-fit: contain;
|
|
4280
|
-
`;
|
|
4281
|
-
|
|
4282
|
-
// src/components/EntrySearch/EntrySearchResultItem.tsx
|
|
4283
|
-
import { jsx as jsx50, jsxs as jsxs30 } from "@emotion/react/jsx-runtime";
|
|
4284
|
-
var EntrySearchResultItem = ({
|
|
4285
|
-
id,
|
|
4286
|
-
title,
|
|
4287
|
-
name,
|
|
4288
|
-
contentType,
|
|
4289
|
-
popoverData,
|
|
4290
|
-
publishStatus,
|
|
4291
|
-
editLinkIcon,
|
|
4292
|
-
editLink,
|
|
4293
|
-
imageUrl,
|
|
4294
|
-
onRemove,
|
|
4295
|
-
createdAt,
|
|
4296
|
-
publishedAt,
|
|
4297
|
-
hideRemoveButton = false,
|
|
4298
|
-
disableDnD = false,
|
|
4299
|
-
children
|
|
4300
|
-
}) => {
|
|
4301
|
-
const { onSelectItem } = useEntrySearchContext();
|
|
4302
|
-
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
4303
|
-
const onRemoveItem = () => {
|
|
4304
|
-
onSelectItem({ id });
|
|
4305
|
-
onRemove == null ? void 0 : onRemove();
|
|
4306
|
-
};
|
|
4307
|
-
return /* @__PURE__ */ jsxs30("div", { css: EntrySearchResultItemContainer, children: [
|
|
4308
|
-
disableDnD ? null : /* @__PURE__ */ jsx50("div", { role: "presentation", className: "drag-handle", css: EntrySearchDragHandle }),
|
|
4309
|
-
/* @__PURE__ */ jsx50("div", { children: /* @__PURE__ */ jsxs30("div", { css: EntrySearchContentContainer, children: [
|
|
4310
|
-
!imageUrl ? null : /* @__PURE__ */ jsx50("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: EntrySearchImage }),
|
|
4311
|
-
/* @__PURE__ */ jsxs30("div", { children: [
|
|
4312
|
-
/* @__PURE__ */ jsx50("span", { css: EntrySearchResultItemSubtitle, children: formatedContentType }),
|
|
4313
|
-
/* @__PURE__ */ jsxs30("span", { role: "heading", css: EntrySearchResultItemTitle, children: [
|
|
4314
|
-
title != null ? title : name,
|
|
4315
|
-
!popoverData ? null : /* @__PURE__ */ jsx50(Popover2, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4316
|
-
] }),
|
|
4317
|
-
!createdAt && !publishStatus ? null : /* @__PURE__ */ jsxs30("div", { css: EntrySearchAuthorStateGroup, children: [
|
|
4318
|
-
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ jsx50(Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
|
|
4319
|
-
!createdAt && !publishedAt ? null : /* @__PURE__ */ jsxs30("div", { css: EntrySearchUpdateGroup, children: [
|
|
4320
|
-
!createdAt ? null : /* @__PURE__ */ jsxs30("small", { css: EntrySearchResultItemTimeStamp, children: [
|
|
4321
|
-
/* @__PURE__ */ jsx50("strong", { children: "Last updated: " }),
|
|
4322
|
-
timeagoFormat(createdAt)
|
|
4323
|
-
] }),
|
|
4324
|
-
!publishedAt ? null : /* @__PURE__ */ jsxs30("small", { css: EntrySearchResultItemTimeStamp, children: [
|
|
4325
|
-
/* @__PURE__ */ jsx50("strong", { children: "Last published: " }),
|
|
4326
|
-
timeagoFormat(publishedAt)
|
|
4327
|
-
] })
|
|
4328
|
-
] })
|
|
4329
|
-
] }),
|
|
4330
|
-
/* @__PURE__ */ jsx50("div", { children })
|
|
4331
|
-
] })
|
|
4332
|
-
] }) }),
|
|
4333
|
-
!editLink && hideRemoveButton ? null : /* @__PURE__ */ jsxs30("div", { css: EntrySearchAuthorStateGroup, children: [
|
|
4334
|
-
!editLink ? null : /* @__PURE__ */ jsx50(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
|
|
4335
|
-
hideRemoveButton ? null : /* @__PURE__ */ jsx50(Button4, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
|
|
4336
|
-
] })
|
|
4337
|
-
] });
|
|
4338
|
-
};
|
|
4339
|
-
|
|
4340
|
-
// src/components/EntrySearch/styles/EntrySearchResultItemButton.styles.ts
|
|
4341
|
-
import { css as css29 } from "@emotion/react";
|
|
4342
|
-
import { button as button2 } from "@uniformdev/design-system";
|
|
4343
|
-
var ButtonStyles = css29`
|
|
4344
|
-
${button2}
|
|
4345
|
-
background: transparent;
|
|
4346
|
-
border: 1px solid var(--brand-secondary-1);
|
|
4347
|
-
color: var(--brand-secondary-1);
|
|
4348
|
-
padding: var(--spacing-sm);
|
|
4349
|
-
font-size: var(--fs-sm);
|
|
4350
|
-
line-height: 1;
|
|
4351
|
-
gap: var(--spacing-xs);
|
|
4352
|
-
transition: border-color var(--duration-fast) var(--timing-ease-out),
|
|
4353
|
-
background-color var(--duration-fast) var(--timing-ease-out);
|
|
4354
|
-
|
|
4355
|
-
&:hover {
|
|
4356
|
-
background: var(--gray-100);
|
|
4357
|
-
border-color: var(--gray-300);
|
|
4358
|
-
}
|
|
4359
|
-
|
|
4360
|
-
&:disabled {
|
|
4361
|
-
background: var(--gray-300);
|
|
4362
|
-
border-color: var(--gray-200);
|
|
4363
|
-
color: var(--gray-500);
|
|
4364
|
-
}
|
|
4365
|
-
|
|
4366
|
-
&:link {
|
|
4367
|
-
text-decoration: none;
|
|
4368
|
-
}
|
|
4369
|
-
`;
|
|
4370
|
-
var ButtonIcon = css29`
|
|
4371
|
-
width: 1rem;
|
|
4372
|
-
height: 1rem;
|
|
4373
|
-
`;
|
|
4374
|
-
|
|
4375
|
-
// src/components/EntrySearch/EntrySearchResultItemButton.tsx
|
|
4376
|
-
import { jsx as jsx51, jsxs as jsxs31 } from "@emotion/react/jsx-runtime";
|
|
4377
|
-
var EntrySearchResultItemButton = ({
|
|
4378
|
-
text,
|
|
4379
|
-
icon,
|
|
4380
|
-
...props
|
|
4381
|
-
}) => {
|
|
4382
|
-
return /* @__PURE__ */ jsxs31("button", { type: "button", css: ButtonStyles, ...props, children: [
|
|
4383
|
-
!icon ? null : /* @__PURE__ */ jsx51(Image, { src: icon, css: ButtonIcon }),
|
|
4384
|
-
text
|
|
4385
|
-
] });
|
|
4386
|
-
};
|
|
4387
|
-
var LinkButton = ({
|
|
4388
|
-
text,
|
|
4389
|
-
icon,
|
|
4390
|
-
...props
|
|
4391
|
-
}) => {
|
|
4392
|
-
return /* @__PURE__ */ jsxs31("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
|
|
4393
|
-
!icon ? null : /* @__PURE__ */ jsx51(Image, { src: icon, css: ButtonIcon }),
|
|
4394
|
-
text
|
|
4395
|
-
] });
|
|
4396
|
-
};
|
|
4397
|
-
|
|
4398
|
-
// src/components/EntrySearch/EntrySearchResultList.tsx
|
|
4399
|
-
import { Button as Button5, Counter } from "@uniformdev/design-system";
|
|
4400
|
-
import { DragDropContext as DragDropContext3, Draggable as Draggable3, Droppable as Droppable3 } from "react-beautiful-dnd";
|
|
4401
|
-
|
|
4402
|
-
// src/components/EntrySearch/styles/EntrySearchResultList.styles.ts
|
|
4403
|
-
import { css as css30 } from "@emotion/react";
|
|
4404
|
-
var EntrySearchResultListContainer = css30`
|
|
4405
|
-
align-items: center;
|
|
4406
|
-
display: flex;
|
|
4407
|
-
gap: var(--spacing-sm);
|
|
4408
|
-
justify-content: space-between;
|
|
4409
|
-
`;
|
|
4410
|
-
var EntrySearchDragContainer = css30`
|
|
4411
|
-
margin: 0 0 var(--spacing-sm);
|
|
4412
|
-
|
|
4413
|
-
// &[data-dragging='true'] {
|
|
4414
|
-
// left: auto !important;
|
|
4415
|
-
// top: auto !important;
|
|
4416
|
-
// }
|
|
4417
|
-
`;
|
|
4418
|
-
var EntrySearchResultListCounterContainer = css30`
|
|
4419
|
-
align-items: center;
|
|
4420
|
-
display: flex;
|
|
4421
|
-
gap: var(--spacing-sm);
|
|
4422
|
-
`;
|
|
4423
|
-
var EntrySearchResultListTitle = css30`
|
|
4424
|
-
font-weight: var(--fw-bold);
|
|
4425
|
-
line-height: 1;
|
|
4426
|
-
`;
|
|
4427
|
-
|
|
4428
|
-
// src/components/EntrySearch/EntrySearchResultList.tsx
|
|
4429
|
-
import { Fragment as Fragment7, jsx as jsx52, jsxs as jsxs32 } from "@emotion/react/jsx-runtime";
|
|
4430
|
-
var EntrySearchResultList = ({
|
|
4431
|
-
resultLabelText = "Selected",
|
|
4432
|
-
removeButtonText = "Remove all",
|
|
4433
|
-
onRemoveAllSelected,
|
|
4434
|
-
hideRemoveButton = false,
|
|
4435
|
-
additionalButtons,
|
|
4436
|
-
renderResultComponent = (value) => /* @__PURE__ */ jsx52(EntrySearchResultItem, { ...value, disableDnD }),
|
|
4437
|
-
multiSelectId,
|
|
4438
|
-
disableDnD = false
|
|
4439
|
-
}) => {
|
|
4440
|
-
const { selectedListItems, onRemoveAllSelectedItems, onSelectItem } = useEntrySearchContext();
|
|
4441
|
-
const handleRemoveAllSelectedItems = () => {
|
|
4442
|
-
onRemoveAllSelectedItems();
|
|
4443
|
-
onRemoveAllSelected == null ? void 0 : onRemoveAllSelected();
|
|
4444
|
-
};
|
|
4445
|
-
const onDragEnd = (res) => {
|
|
4446
|
-
var _a, _b;
|
|
4447
|
-
if (res.destination && res.source.droppableId === ((_a = res.destination) == null ? void 0 : _a.droppableId)) {
|
|
4448
|
-
const result = [...selectedListItems || []];
|
|
4449
|
-
const [removed] = (_b = result == null ? void 0 : result.splice(res.source.index, 1)) != null ? _b : [];
|
|
4450
|
-
result == null ? void 0 : result.splice(res.destination.index, 0, removed);
|
|
4451
|
-
onSelectItem(result);
|
|
4452
|
-
return result;
|
|
4453
|
-
}
|
|
4454
|
-
};
|
|
4455
|
-
return /* @__PURE__ */ jsxs32(Fragment7, { children: [
|
|
4456
|
-
/* @__PURE__ */ jsxs32("div", { role: "group", css: EntrySearchResultListContainer, children: [
|
|
4457
|
-
/* @__PURE__ */ jsxs32("div", { role: "note", css: EntrySearchResultListCounterContainer, children: [
|
|
4458
|
-
/* @__PURE__ */ jsx52("span", { css: EntrySearchResultListTitle, children: resultLabelText }),
|
|
4459
|
-
" ",
|
|
4460
|
-
!selectedListItems.length ? null : /* @__PURE__ */ jsx52(Counter, { count: selectedListItems.length })
|
|
4461
|
-
] }),
|
|
4462
|
-
/* @__PURE__ */ jsxs32("div", { css: EntrySearchResultListCounterContainer, children: [
|
|
4463
|
-
additionalButtons,
|
|
4464
|
-
hideRemoveButton ? null : /* @__PURE__ */ jsx52(
|
|
4465
|
-
Button5,
|
|
4466
|
-
{
|
|
4467
|
-
buttonType: "ghostDestructive",
|
|
4468
|
-
size: "xs",
|
|
4469
|
-
disabled: selectedListItems.length === 0,
|
|
4470
|
-
onClick: handleRemoveAllSelectedItems,
|
|
4471
|
-
children: removeButtonText
|
|
4472
|
-
}
|
|
4473
|
-
)
|
|
4474
|
-
] })
|
|
4475
|
-
] }),
|
|
4476
|
-
!selectedListItems.length ? null : /* @__PURE__ */ jsx52(DragDropContext3, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx52(Droppable3, { droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select", children: (provided) => /* @__PURE__ */ jsxs32("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
4477
|
-
selectedListItems.map((item, i) => {
|
|
4478
|
-
const renderListItem = renderResultComponent(item);
|
|
4479
|
-
return /* @__PURE__ */ jsx52(Draggable3, { draggableId: item.id, index: i, isDragDisabled: disableDnD, children: (provided2, snapshot) => /* @__PURE__ */ jsx52(
|
|
4480
|
-
"div",
|
|
4481
|
-
{
|
|
4482
|
-
css: EntrySearchDragContainer,
|
|
4483
|
-
ref: provided2.innerRef,
|
|
4484
|
-
"data-dragging": snapshot.isDragging,
|
|
4485
|
-
...provided2.draggableProps,
|
|
4486
|
-
...provided2.dragHandleProps,
|
|
4487
|
-
children: renderListItem
|
|
4488
|
-
}
|
|
4489
|
-
) }, item.id);
|
|
4490
|
-
}),
|
|
4491
|
-
provided.placeholder
|
|
4492
|
-
] }) }) })
|
|
4493
|
-
] });
|
|
4494
|
-
};
|
|
4495
|
-
|
|
4496
|
-
// src/components/EntrySearch/QueryFilter.tsx
|
|
4497
|
-
import { Input as Input7, InputKeywordSearch as InputKeywordSearch3, InputSelect as InputSelect7 } from "@uniformdev/design-system";
|
|
4498
|
-
import { useEffect as useEffect7, useState as useState11 } from "react";
|
|
4499
|
-
import { jsx as jsx53, jsxs as jsxs33 } from "@emotion/react/jsx-runtime";
|
|
4500
|
-
var QueryFilter = ({
|
|
4501
|
-
requireContentType,
|
|
4502
|
-
queryFilterTitle = "Configure Query",
|
|
4503
|
-
contentTypeLabel = "Filter by content type",
|
|
4504
|
-
typeSelectorAllTypesOptionText = "All content types",
|
|
4505
|
-
contentTypeOptions,
|
|
4506
|
-
searchInputName = "searchText",
|
|
4507
|
-
searchInputPlaceholderText = "Enter keyword to narrow your results",
|
|
4508
|
-
countLabel = "Count",
|
|
4509
|
-
countValue = 5,
|
|
4510
|
-
sortLabel = "Sort",
|
|
4511
|
-
sortOptions,
|
|
4512
|
-
sortOrderLabel = "Sort Order",
|
|
4513
|
-
sortOrderOptions = [
|
|
4514
|
-
{
|
|
4515
|
-
name: "Ascending",
|
|
4516
|
-
id: "asc",
|
|
4517
|
-
label: "Ascending"
|
|
4518
|
-
},
|
|
4519
|
-
{
|
|
4520
|
-
name: "Descending",
|
|
4521
|
-
id: "desc",
|
|
4522
|
-
label: "Descending"
|
|
4523
|
-
}
|
|
4524
|
-
],
|
|
4525
|
-
children
|
|
4526
|
-
}) => {
|
|
4527
|
-
var _a, _b;
|
|
4528
|
-
const { query, onSetQuery } = useEntrySearchContext();
|
|
4529
|
-
const [queryState, setQueryState] = useState11({
|
|
4530
|
-
contentType: "",
|
|
4531
|
-
keyword: "",
|
|
4532
|
-
count: countValue != null ? countValue : 5,
|
|
4533
|
-
sortBy: (_a = sortOptions[0].id) != null ? _a : "",
|
|
4534
|
-
sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
|
|
4535
|
-
});
|
|
4536
|
-
const handleFilterChange = (value) => {
|
|
4537
|
-
setQueryState((prev) => ({ ...prev, ...value }));
|
|
4538
|
-
onSetQuery({ ...query, ...value });
|
|
4539
|
-
};
|
|
4540
|
-
useEffect7(() => {
|
|
4541
|
-
onSetQuery(queryState);
|
|
4542
|
-
}, [onSetQuery, queryState]);
|
|
4543
|
-
return /* @__PURE__ */ jsxs33("fieldset", { children: [
|
|
4544
|
-
/* @__PURE__ */ jsx53("span", { css: EntrySearchFilterContainerLabel, children: queryFilterTitle }),
|
|
4545
|
-
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterContainer, children: [
|
|
4546
|
-
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("0.5fr 1fr"), children: [
|
|
4547
|
-
/* @__PURE__ */ jsx53(
|
|
4548
|
-
InputSelect7,
|
|
4549
|
-
{
|
|
4550
|
-
label: contentTypeLabel,
|
|
4551
|
-
showLabel: false,
|
|
4552
|
-
options: [
|
|
4553
|
-
...!requireContentType ? [{ id: "", label: typeSelectorAllTypesOptionText }] : [],
|
|
4554
|
-
...contentTypeOptions ? contentTypeOptions.map((option) => {
|
|
4555
|
-
var _a2;
|
|
4556
|
-
return { id: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
|
|
4557
|
-
}) : []
|
|
4558
|
-
],
|
|
4559
|
-
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
4560
|
-
value: queryState.contentType
|
|
4561
|
-
}
|
|
4562
|
-
),
|
|
4563
|
-
/* @__PURE__ */ jsx53(
|
|
4564
|
-
InputKeywordSearch3,
|
|
4565
|
-
{
|
|
4566
|
-
inputFieldName: searchInputName,
|
|
4567
|
-
placeholder: searchInputPlaceholderText,
|
|
4568
|
-
onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
|
|
4569
|
-
disabledFieldSubmission: true,
|
|
4570
|
-
onClear: () => handleFilterChange({ keyword: "" }),
|
|
4571
|
-
value: queryState.keyword
|
|
4572
|
-
}
|
|
4573
|
-
)
|
|
4574
|
-
] }),
|
|
4575
|
-
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("repeat(2, 1fr) 0.5fr"), children: [
|
|
4576
|
-
/* @__PURE__ */ jsx53(
|
|
4577
|
-
InputSelect7,
|
|
4578
|
-
{
|
|
4579
|
-
label: sortLabel,
|
|
4580
|
-
options: [
|
|
4581
|
-
{
|
|
4582
|
-
label: "Select a sort",
|
|
4583
|
-
id: ""
|
|
4584
|
-
},
|
|
4585
|
-
...sortOptions ? sortOptions.map((option) => {
|
|
4586
|
-
var _a2;
|
|
4587
|
-
return { id: option.id, name: option.name, label: (_a2 = option.label) != null ? _a2 : option.name };
|
|
4588
|
-
}) : []
|
|
4589
|
-
],
|
|
4590
|
-
onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
|
|
4591
|
-
value: queryState.sortBy
|
|
4592
|
-
}
|
|
4593
|
-
),
|
|
4594
|
-
/* @__PURE__ */ jsx53(
|
|
4595
|
-
InputSelect7,
|
|
4596
|
-
{
|
|
4597
|
-
label: sortOrderLabel,
|
|
4598
|
-
options: [
|
|
4599
|
-
...sortOrderOptions ? sortOrderOptions.map((option) => {
|
|
4600
|
-
var _a2;
|
|
4601
|
-
return { value: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
|
|
4602
|
-
}) : []
|
|
4603
|
-
],
|
|
4604
|
-
onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
|
|
4605
|
-
value: queryState.sortOrder
|
|
4606
|
-
}
|
|
4607
|
-
),
|
|
4608
|
-
/* @__PURE__ */ jsx53(
|
|
4609
|
-
Input7,
|
|
4610
|
-
{
|
|
4611
|
-
label: countLabel,
|
|
4612
|
-
type: "number",
|
|
4613
|
-
onChange: (e) => handleFilterChange({ count: e.target.value }),
|
|
4614
|
-
defaultValue: countValue,
|
|
4615
|
-
value: queryState.count
|
|
4616
|
-
}
|
|
4617
|
-
)
|
|
4618
|
-
] }),
|
|
4619
|
-
children
|
|
4620
|
-
] })
|
|
4621
|
-
] });
|
|
4622
|
-
};
|
|
4623
|
-
|
|
4624
3873
|
// src/components/MeshApp.tsx
|
|
4625
|
-
import { LoadingIndicator as
|
|
3874
|
+
import { LoadingIndicator as LoadingIndicator2, Theme as Theme2 } from "@uniformdev/design-system";
|
|
4626
3875
|
|
|
4627
3876
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
4628
3877
|
import { initializeUniformMeshSDK } from "@uniformdev/mesh-sdk";
|
|
4629
|
-
import { useEffect as
|
|
3878
|
+
import { useEffect as useEffect7, useRef as useRef10, useState as useState9 } from "react";
|
|
4630
3879
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
4631
|
-
const [error, setError] =
|
|
4632
|
-
const [sdk, setSdk] =
|
|
3880
|
+
const [error, setError] = useState9();
|
|
3881
|
+
const [sdk, setSdk] = useState9();
|
|
4633
3882
|
const initializationInProgress = useRef10(false);
|
|
4634
|
-
|
|
3883
|
+
useEffect7(
|
|
4635
3884
|
() => {
|
|
4636
3885
|
if (typeof window === "undefined" || sdk) {
|
|
4637
3886
|
return;
|
|
@@ -4664,7 +3913,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
|
4664
3913
|
};
|
|
4665
3914
|
|
|
4666
3915
|
// src/components/MeshApp.tsx
|
|
4667
|
-
import { jsx as
|
|
3916
|
+
import { jsx as jsx44, jsxs as jsxs25 } from "@emotion/react/jsx-runtime";
|
|
4668
3917
|
var MeshApp = ({
|
|
4669
3918
|
children,
|
|
4670
3919
|
loadingComponent,
|
|
@@ -4673,27 +3922,21 @@ var MeshApp = ({
|
|
|
4673
3922
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
4674
3923
|
if (initializing || !sdk) {
|
|
4675
3924
|
const LoadingComponent = loadingComponent;
|
|
4676
|
-
return LoadingComponent ? /* @__PURE__ */
|
|
3925
|
+
return LoadingComponent ? /* @__PURE__ */ jsx44(LoadingComponent, {}) : /* @__PURE__ */ jsx44(LoadingIndicator2, {});
|
|
4677
3926
|
}
|
|
4678
3927
|
if (error) {
|
|
4679
3928
|
const ErrorComponent = errorComponent;
|
|
4680
3929
|
if (ErrorComponent) {
|
|
4681
|
-
return /* @__PURE__ */
|
|
3930
|
+
return /* @__PURE__ */ jsx44(ErrorComponent, { error });
|
|
4682
3931
|
}
|
|
4683
3932
|
throw error;
|
|
4684
3933
|
}
|
|
4685
|
-
return /* @__PURE__ */
|
|
4686
|
-
/* @__PURE__ */
|
|
4687
|
-
/* @__PURE__ */
|
|
3934
|
+
return /* @__PURE__ */ jsxs25(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
|
|
3935
|
+
/* @__PURE__ */ jsx44(Theme2, {}),
|
|
3936
|
+
/* @__PURE__ */ jsx44(UniformMeshLocationContextProvider, { children })
|
|
4688
3937
|
] });
|
|
4689
3938
|
};
|
|
4690
3939
|
|
|
4691
|
-
// src/hooks/useUniformMeshLocation.ts
|
|
4692
|
-
function useUniformMeshLocation() {
|
|
4693
|
-
const { location } = useUniformMeshLocationContext();
|
|
4694
|
-
return location;
|
|
4695
|
-
}
|
|
4696
|
-
|
|
4697
3940
|
// src/hooks/index.ts
|
|
4698
3941
|
import { ParameterShellContext, useParameterShell } from "@uniformdev/design-system";
|
|
4699
3942
|
|
|
@@ -4708,17 +3951,16 @@ function createLocationValidator(setValue, validate) {
|
|
|
4708
3951
|
// src/index.ts
|
|
4709
3952
|
import {
|
|
4710
3953
|
AddListButton as AddListButton2,
|
|
4711
|
-
Button as
|
|
3954
|
+
Button as Button3,
|
|
4712
3955
|
Callout as Callout4,
|
|
4713
3956
|
Heading,
|
|
4714
|
-
Input as
|
|
3957
|
+
Input as Input7,
|
|
4715
3958
|
InputComboBox,
|
|
4716
|
-
InputKeywordSearch as
|
|
4717
|
-
InputSelect as
|
|
3959
|
+
InputKeywordSearch as InputKeywordSearch2,
|
|
3960
|
+
InputSelect as InputSelect6,
|
|
4718
3961
|
InputToggle,
|
|
4719
|
-
InputKeywordSearch as InputKeywordSearch5,
|
|
4720
3962
|
Label,
|
|
4721
|
-
LoadingIndicator as
|
|
3963
|
+
LoadingIndicator as LoadingIndicator3,
|
|
4722
3964
|
LoadingOverlay as LoadingOverlay2,
|
|
4723
3965
|
Menu as Menu3,
|
|
4724
3966
|
MenuItem as MenuItem3,
|
|
@@ -4736,7 +3978,7 @@ import {
|
|
|
4736
3978
|
ParameterTextareaInner,
|
|
4737
3979
|
ParameterToggle,
|
|
4738
3980
|
ParameterToggleInner,
|
|
4739
|
-
ScrollableList
|
|
3981
|
+
ScrollableList,
|
|
4740
3982
|
ScrollableListItem,
|
|
4741
3983
|
Switch,
|
|
4742
3984
|
Textarea,
|
|
@@ -4745,38 +3987,25 @@ import {
|
|
|
4745
3987
|
export * from "@uniformdev/mesh-sdk";
|
|
4746
3988
|
export {
|
|
4747
3989
|
AddListButton2 as AddListButton,
|
|
4748
|
-
|
|
3990
|
+
Button3 as Button,
|
|
4749
3991
|
Callout4 as Callout,
|
|
4750
3992
|
DamSelectedItem,
|
|
4751
|
-
DataRefreshButton,
|
|
4752
3993
|
DataResourceVariablesList,
|
|
4753
3994
|
DataSourceEditor,
|
|
4754
3995
|
DataTypeEditor,
|
|
4755
3996
|
DefaultSearchRow,
|
|
4756
3997
|
DefaultSelectedItem,
|
|
4757
3998
|
EntrySearch,
|
|
4758
|
-
EntrySearchContainer,
|
|
4759
|
-
EntrySearchContext,
|
|
4760
|
-
EntrySearchFilter,
|
|
4761
|
-
EntrySearchFilterContainer2 as EntrySearchFilterContainer,
|
|
4762
|
-
EntrySearchListItem,
|
|
4763
|
-
EntrySearchListItemLoadingSkeleton,
|
|
4764
|
-
EntrySearchProvider,
|
|
4765
|
-
EntrySearchResultItem,
|
|
4766
|
-
EntrySearchResultItemButton,
|
|
4767
|
-
EntrySearchResultList,
|
|
4768
3999
|
Heading,
|
|
4769
4000
|
icons_exports as Icons,
|
|
4770
|
-
|
|
4001
|
+
Input7 as Input,
|
|
4771
4002
|
InputComboBox,
|
|
4772
|
-
|
|
4773
|
-
|
|
4003
|
+
InputKeywordSearch2 as InputKeywordSearch,
|
|
4004
|
+
InputSelect6 as InputSelect,
|
|
4774
4005
|
InputToggle,
|
|
4775
4006
|
InputVariables,
|
|
4776
|
-
InputKeywordSearch5 as KeywordSearchInput,
|
|
4777
4007
|
Label,
|
|
4778
|
-
|
|
4779
|
-
LoadingIndicator4 as LoadingIndicator,
|
|
4008
|
+
LoadingIndicator3 as LoadingIndicator,
|
|
4780
4009
|
LoadingOverlay2 as LoadingOverlay,
|
|
4781
4010
|
Menu3 as Menu,
|
|
4782
4011
|
MenuItem3 as MenuItem,
|
|
@@ -4803,7 +4032,6 @@ export {
|
|
|
4803
4032
|
ProductSearchContext,
|
|
4804
4033
|
ProductSearchRow,
|
|
4805
4034
|
ProductSelectedItem,
|
|
4806
|
-
QueryFilter,
|
|
4807
4035
|
RequestBody,
|
|
4808
4036
|
RequestHeaders,
|
|
4809
4037
|
RequestMethodSelect,
|
|
@@ -4813,17 +4041,13 @@ export {
|
|
|
4813
4041
|
RequestUrl,
|
|
4814
4042
|
RequestUrlInput,
|
|
4815
4043
|
ResolvableLoadingValue,
|
|
4816
|
-
|
|
4044
|
+
ScrollableList,
|
|
4817
4045
|
ScrollableListItem,
|
|
4818
4046
|
SelectionField,
|
|
4819
4047
|
Switch,
|
|
4820
4048
|
TextVariableRenderer,
|
|
4821
4049
|
Textarea,
|
|
4822
4050
|
Theme3 as Theme,
|
|
4823
|
-
UniformMeshLocationContext,
|
|
4824
|
-
UniformMeshLocationContextProvider,
|
|
4825
|
-
UniformMeshSdkContext,
|
|
4826
|
-
UniformMeshSdkContextProvider,
|
|
4827
4051
|
VariableEditor,
|
|
4828
4052
|
VariablesList,
|
|
4829
4053
|
VariablesProvider,
|
|
@@ -4892,8 +4116,6 @@ export {
|
|
|
4892
4116
|
selectedItemTitle,
|
|
4893
4117
|
urlEncodeRequestParameter,
|
|
4894
4118
|
urlEncodeRequestUrl,
|
|
4895
|
-
useEntrySearchContext,
|
|
4896
|
-
useInitializeUniformMeshSdk,
|
|
4897
4119
|
useMeshLocation,
|
|
4898
4120
|
useParameterShell,
|
|
4899
4121
|
useProductQueryContext,
|
|
@@ -4901,10 +4123,7 @@ export {
|
|
|
4901
4123
|
useRequest,
|
|
4902
4124
|
useRequestHeader,
|
|
4903
4125
|
useRequestParameter,
|
|
4904
|
-
useUniformMeshLocation,
|
|
4905
|
-
useUniformMeshLocationContext,
|
|
4906
4126
|
useUniformMeshSdk,
|
|
4907
|
-
useUniformMeshSdkContext,
|
|
4908
4127
|
useVariables,
|
|
4909
4128
|
variablesToList
|
|
4910
4129
|
};
|