@uniformdev/mesh-sdk-react 18.31.0 → 18.31.1-alpha.22
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 +355 -13
- package/dist/index.esm.js +787 -34
- package/dist/index.js +826 -59
- package/dist/index.mjs +787 -34
- package/package.json +4 -4
package/dist/index.mjs
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/EntrySearch/DefaultSearchRow.tsx
|
|
958
|
+
// src/components/legacy/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/EntrySearch/styles/DefaultSearchRow.styles.ts
|
|
963
|
+
// src/components/legacy/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/EntrySearch/DefaultSearchRow.tsx
|
|
1004
|
+
// src/components/legacy/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/EntrySearch/DefaultSelectedItem.tsx
|
|
1078
|
+
// src/components/legacy/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/EntrySearch/styles/DefaultSelectedItem.styles.ts
|
|
1096
|
+
// src/components/legacy/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/EntrySearch/DefaultSelectedItem.tsx
|
|
1180
|
+
// src/components/legacy/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/EntrySearch/EntrySearch.tsx
|
|
1363
|
+
// src/components/legacy/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/EntrySearch/styles/EntrySearch.styles.ts
|
|
1414
|
+
// src/components/legacy/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/EntrySearch/EntrySearch.tsx
|
|
1525
|
+
// src/components/legacy/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";
|
|
@@ -3895,17 +3895,756 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
3895
3895
|
};
|
|
3896
3896
|
}
|
|
3897
3897
|
|
|
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 { Button as Button4, Container, IconsProvider, ScrollableList, VerticalRhythm } from "@uniformdev/design-system";
|
|
3923
|
+
|
|
3924
|
+
// src/components/EntrySearch/styles/EntrySearchContainer.styles.ts
|
|
3925
|
+
import { css as css26 } from "@emotion/react";
|
|
3926
|
+
var EntrySearchBtnGroup = css26`
|
|
3927
|
+
align-items: center;
|
|
3928
|
+
display: flex;
|
|
3929
|
+
gap: var(--spacing-sm);
|
|
3930
|
+
`;
|
|
3931
|
+
|
|
3932
|
+
// src/components/EntrySearch/EntrySearchContainer.tsx
|
|
3933
|
+
import { jsx as jsx45, jsxs as jsxs26 } from "@emotion/react/jsx-runtime";
|
|
3934
|
+
var EntrySearchContainer = ({
|
|
3935
|
+
searchFilters,
|
|
3936
|
+
resultList,
|
|
3937
|
+
onSave,
|
|
3938
|
+
onCancel,
|
|
3939
|
+
children
|
|
3940
|
+
}) => {
|
|
3941
|
+
return /* @__PURE__ */ jsx45(IconsProvider, { children: /* @__PURE__ */ jsxs26(VerticalRhythm, { children: [
|
|
3942
|
+
/* @__PURE__ */ jsx45(Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: /* @__PURE__ */ jsxs26(VerticalRhythm, { children: [
|
|
3943
|
+
searchFilters,
|
|
3944
|
+
!resultList ? null : /* @__PURE__ */ jsx45(ScrollableList, { role: "list", children: resultList })
|
|
3945
|
+
] }) }),
|
|
3946
|
+
children,
|
|
3947
|
+
!onSave && !onCancel ? null : /* @__PURE__ */ jsxs26("div", { css: EntrySearchBtnGroup, children: [
|
|
3948
|
+
!onSave ? null : /* @__PURE__ */ jsx45(Button4, { buttonType: "primary", onClick: onSave, children: "Save" }),
|
|
3949
|
+
!onCancel ? null : /* @__PURE__ */ jsx45(Button4, { buttonType: "ghostDestructive", onClick: onCancel, children: "Cancel" })
|
|
3950
|
+
] })
|
|
3951
|
+
] }) });
|
|
3952
|
+
};
|
|
3953
|
+
|
|
3954
|
+
// src/components/EntrySearch/EntrySearchFilter.tsx
|
|
3955
|
+
import { InputKeywordSearch as InputKeywordSearch2, InputSelect as InputSelect6 } from "@uniformdev/design-system";
|
|
3956
|
+
import { useState as useState10 } from "react";
|
|
3957
|
+
|
|
3958
|
+
// src/components/EntrySearch/hooks/EntrySearchContext.tsx
|
|
3959
|
+
import { createContext as createContext5, useCallback, useContext as useContext7, useDeferredValue, useState as useState9 } from "react";
|
|
3960
|
+
import { jsx as jsx46 } from "@emotion/react/jsx-runtime";
|
|
3961
|
+
var EntrySearchContext = createContext5({
|
|
3962
|
+
onSetQuery: () => {
|
|
3963
|
+
},
|
|
3964
|
+
onSelectItem: () => {
|
|
3965
|
+
},
|
|
3966
|
+
query: {
|
|
3967
|
+
contentType: "",
|
|
3968
|
+
keyword: ""
|
|
3969
|
+
},
|
|
3970
|
+
list: {},
|
|
3971
|
+
onSetList: () => {
|
|
3972
|
+
},
|
|
3973
|
+
selectedListItems: [],
|
|
3974
|
+
onRemoveAllSelectedItems: () => {
|
|
3975
|
+
}
|
|
3976
|
+
});
|
|
3977
|
+
var EntrySearchProvider = ({ currentlySelectedItems, children }) => {
|
|
3978
|
+
const [query, setQuery] = useState9({
|
|
3979
|
+
contentType: "",
|
|
3980
|
+
keyword: ""
|
|
3981
|
+
});
|
|
3982
|
+
const querySearchDeferred = useDeferredValue(query);
|
|
3983
|
+
const [selectedItems, setSelectedItems] = useState9(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
3984
|
+
const [list, setList] = useState9({});
|
|
3985
|
+
const onSetQuery = useCallback(
|
|
3986
|
+
(value) => {
|
|
3987
|
+
setQuery(value);
|
|
3988
|
+
},
|
|
3989
|
+
[setQuery]
|
|
3990
|
+
);
|
|
3991
|
+
const onSelectItem = useCallback(
|
|
3992
|
+
(selectedResult) => {
|
|
3993
|
+
if (Array.isArray(selectedResult)) {
|
|
3994
|
+
setSelectedItems(selectedResult);
|
|
3995
|
+
} else {
|
|
3996
|
+
if (selectedItems.some((item) => item.id === selectedResult.id)) {
|
|
3997
|
+
setSelectedItems((prev) => prev.filter((item) => item.id !== selectedResult.id));
|
|
3998
|
+
} else {
|
|
3999
|
+
setSelectedItems((prev) => [...prev, selectedResult]);
|
|
4000
|
+
}
|
|
4001
|
+
}
|
|
4002
|
+
},
|
|
4003
|
+
[setSelectedItems, selectedItems]
|
|
4004
|
+
);
|
|
4005
|
+
const onRemoveAllSelectedItems = useCallback(() => {
|
|
4006
|
+
setSelectedItems([]);
|
|
4007
|
+
}, [setSelectedItems]);
|
|
4008
|
+
const onSetList = useCallback(
|
|
4009
|
+
(value) => {
|
|
4010
|
+
setList(value);
|
|
4011
|
+
},
|
|
4012
|
+
[setList]
|
|
4013
|
+
);
|
|
4014
|
+
return /* @__PURE__ */ jsx46(
|
|
4015
|
+
EntrySearchContext.Provider,
|
|
4016
|
+
{
|
|
4017
|
+
value: {
|
|
4018
|
+
onSetQuery,
|
|
4019
|
+
query: querySearchDeferred,
|
|
4020
|
+
onSelectItem,
|
|
4021
|
+
selectedListItems: selectedItems,
|
|
4022
|
+
onRemoveAllSelectedItems,
|
|
4023
|
+
list,
|
|
4024
|
+
onSetList
|
|
4025
|
+
},
|
|
4026
|
+
children
|
|
4027
|
+
}
|
|
4028
|
+
);
|
|
4029
|
+
};
|
|
4030
|
+
var useEntrySearchContext = () => {
|
|
4031
|
+
const contextValues = useContext7(EntrySearchContext);
|
|
4032
|
+
return { ...contextValues };
|
|
4033
|
+
};
|
|
4034
|
+
|
|
4035
|
+
// src/components/EntrySearch/styles/EntrySearchFilterContainer.styles.ts
|
|
4036
|
+
import { css as css27 } from "@emotion/react";
|
|
4037
|
+
var EntrySearchFilterContainerLabel = css27`
|
|
4038
|
+
align-items: center;
|
|
4039
|
+
display: flex;
|
|
4040
|
+
font-size: var(--fs-sm);
|
|
4041
|
+
font-weight: var(--fw-bold);
|
|
4042
|
+
line-height: 1rem;
|
|
4043
|
+
margin-bottom: var(--spacing-sm);
|
|
4044
|
+
`;
|
|
4045
|
+
var EntrySearchFilterContainer = css27`
|
|
4046
|
+
display: grid;
|
|
4047
|
+
gap: var(--spacing-base);
|
|
4048
|
+
`;
|
|
4049
|
+
var EntrySearchFilterDropdownAndTextSearch = css27`
|
|
4050
|
+
grid-template-columns: 0.5fr 1fr;
|
|
4051
|
+
`;
|
|
4052
|
+
var EntrySearchFilterGrid = (gridColumns) => css27`
|
|
4053
|
+
display: grid;
|
|
4054
|
+
grid-template-columns: ${gridColumns};
|
|
4055
|
+
gap: var(--spacing-base);
|
|
4056
|
+
`;
|
|
4057
|
+
|
|
4058
|
+
// src/components/EntrySearch/EntrySearchFilter.tsx
|
|
4059
|
+
import { jsx as jsx47, jsxs as jsxs27 } from "@emotion/react/jsx-runtime";
|
|
4060
|
+
var EntrySearchFilter = ({
|
|
4061
|
+
requireContentType,
|
|
4062
|
+
typeSelectorAllTypesOptionText = "All content types",
|
|
4063
|
+
searchInputName = "searchText",
|
|
4064
|
+
searchInputPlaceholderText = "Enter keyword to narrow your results",
|
|
4065
|
+
selectLabel = "Content Type Select",
|
|
4066
|
+
selectOptions
|
|
4067
|
+
}) => {
|
|
4068
|
+
const { query, onSetQuery } = useEntrySearchContext();
|
|
4069
|
+
const [searchState, setSearchState] = useState10({
|
|
4070
|
+
contentType: "any",
|
|
4071
|
+
keyword: ""
|
|
4072
|
+
});
|
|
4073
|
+
const handleFilterChange = (value) => {
|
|
4074
|
+
setSearchState((prev) => {
|
|
4075
|
+
return { ...prev, ...value };
|
|
4076
|
+
});
|
|
4077
|
+
onSetQuery({ ...query, ...value });
|
|
4078
|
+
};
|
|
4079
|
+
return /* @__PURE__ */ jsxs27("fieldset", { css: [EntrySearchFilterContainer, EntrySearchFilterDropdownAndTextSearch], children: [
|
|
4080
|
+
/* @__PURE__ */ jsx47(
|
|
4081
|
+
InputSelect6,
|
|
4082
|
+
{
|
|
4083
|
+
label: selectLabel,
|
|
4084
|
+
showLabel: false,
|
|
4085
|
+
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
4086
|
+
options: [
|
|
4087
|
+
...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
|
|
4088
|
+
...selectOptions ? selectOptions.map((option) => {
|
|
4089
|
+
var _a;
|
|
4090
|
+
return { name: option == null ? void 0 : option.name, label: (_a = option.label) != null ? _a : option == null ? void 0 : option.name, id: option.id };
|
|
4091
|
+
}) : []
|
|
4092
|
+
],
|
|
4093
|
+
value: searchState.contentType
|
|
4094
|
+
}
|
|
4095
|
+
),
|
|
4096
|
+
/* @__PURE__ */ jsx47(
|
|
4097
|
+
InputKeywordSearch2,
|
|
4098
|
+
{
|
|
4099
|
+
inputFieldName: searchInputName,
|
|
4100
|
+
placeholder: searchInputPlaceholderText,
|
|
4101
|
+
onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
|
|
4102
|
+
disabledFieldSubmission: true,
|
|
4103
|
+
onClear: () => handleFilterChange({ keyword: "" }),
|
|
4104
|
+
value: searchState.keyword
|
|
4105
|
+
}
|
|
4106
|
+
)
|
|
4107
|
+
] });
|
|
4108
|
+
};
|
|
4109
|
+
|
|
4110
|
+
// src/components/EntrySearch/EntrySearchFilterContainer.tsx
|
|
4111
|
+
import { jsx as jsx48, jsxs as jsxs28 } from "@emotion/react/jsx-runtime";
|
|
4112
|
+
var EntrySearchFilterContainer2 = ({ label, children }) => {
|
|
4113
|
+
return /* @__PURE__ */ jsxs28("div", { children: [
|
|
4114
|
+
/* @__PURE__ */ jsx48("span", { css: EntrySearchFilterContainerLabel, children: label }),
|
|
4115
|
+
/* @__PURE__ */ jsx48("div", { css: EntrySearchFilterContainer, children })
|
|
4116
|
+
] });
|
|
4117
|
+
};
|
|
4118
|
+
|
|
4119
|
+
// src/components/EntrySearch/EntrySearchListItem.tsx
|
|
4120
|
+
import { Popover } from "@uniformdev/design-system";
|
|
4121
|
+
|
|
4122
|
+
// src/components/EntrySearch/styles/EntrySearchListItem.styles.ts
|
|
4123
|
+
import { css as css28 } from "@emotion/react";
|
|
4124
|
+
import { skeletonLoading } from "@uniformdev/design-system";
|
|
4125
|
+
var EntryListItemContainer = css28`
|
|
4126
|
+
align-items: center;
|
|
4127
|
+
border: 1px solid var(--gray-300);
|
|
4128
|
+
border-radius: var(--rounded-base);
|
|
4129
|
+
background: var(--white);
|
|
4130
|
+
display: grid;
|
|
4131
|
+
grid-template-columns: 1fr 32px;
|
|
4132
|
+
padding: var(--spacing-sm);
|
|
4133
|
+
|
|
4134
|
+
&[hidden] {
|
|
4135
|
+
display: none;
|
|
4136
|
+
}
|
|
4137
|
+
`;
|
|
4138
|
+
var EntryListItemLoading = css28`
|
|
4139
|
+
animation: ${skeletonLoading} 1s linear infinite alternate;
|
|
4140
|
+
border-color: transparent;
|
|
4141
|
+
min-height: 42px;
|
|
4142
|
+
position: relative;
|
|
4143
|
+
|
|
4144
|
+
&:before,
|
|
4145
|
+
&:after {
|
|
4146
|
+
background: var(--gray-200);
|
|
4147
|
+
content: '';
|
|
4148
|
+
display: block;
|
|
4149
|
+
height: 1rem;
|
|
4150
|
+
}
|
|
4151
|
+
|
|
4152
|
+
&:before {
|
|
4153
|
+
border-radius: var(--rounded-base);
|
|
4154
|
+
width: 10rem;
|
|
4155
|
+
}
|
|
4156
|
+
|
|
4157
|
+
&:after {
|
|
4158
|
+
border-radius: var(--rounded-full);
|
|
4159
|
+
width: 1rem;
|
|
4160
|
+
}
|
|
4161
|
+
`;
|
|
4162
|
+
var EntryListItemHeadingGroup = css28`
|
|
4163
|
+
align-items: center;
|
|
4164
|
+
display: grid;
|
|
4165
|
+
`;
|
|
4166
|
+
var EntryListItemTitle = css28`
|
|
4167
|
+
color: var(--brand-secondary-1);
|
|
4168
|
+
display: block;
|
|
4169
|
+
font-size: var(--fs-sm);
|
|
4170
|
+
`;
|
|
4171
|
+
var EntryListItemSubtitle = css28`
|
|
4172
|
+
color: var(--gray-500);
|
|
4173
|
+
display: block;
|
|
4174
|
+
font-size: var(--fs-xs);
|
|
4175
|
+
line-height: 1;
|
|
4176
|
+
`;
|
|
4177
|
+
var EntryListItemInfoContainer = css28`
|
|
4178
|
+
align-items: center;
|
|
4179
|
+
display: flex;
|
|
4180
|
+
justify-content: center;
|
|
4181
|
+
`;
|
|
4182
|
+
var EntryListItemControlledContent = css28`
|
|
4183
|
+
display: flex;
|
|
4184
|
+
gap: var(--spacing-sm);
|
|
4185
|
+
`;
|
|
4186
|
+
var EntryListItemUnControlledContent = css28`
|
|
4187
|
+
margin-top: var(--spacing-sm);
|
|
4188
|
+
grid-column: 1 / -1;
|
|
4189
|
+
`;
|
|
4190
|
+
|
|
4191
|
+
// src/components/EntrySearch/EntrySearchListItem.tsx
|
|
4192
|
+
import { jsx as jsx49, jsxs as jsxs29 } from "@emotion/react/jsx-runtime";
|
|
4193
|
+
var EntrySearchListItem = ({
|
|
4194
|
+
id,
|
|
4195
|
+
title,
|
|
4196
|
+
contentType,
|
|
4197
|
+
image,
|
|
4198
|
+
popoverData,
|
|
4199
|
+
onSelect,
|
|
4200
|
+
isMulti = false,
|
|
4201
|
+
children,
|
|
4202
|
+
...props
|
|
4203
|
+
}) => {
|
|
4204
|
+
const { onSelectItem, selectedListItems } = useEntrySearchContext();
|
|
4205
|
+
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
4206
|
+
const handleSelectItem = () => {
|
|
4207
|
+
var _a;
|
|
4208
|
+
const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
|
|
4209
|
+
const selectedItem = { id, title, contentType, image, popoverData, ...extraData };
|
|
4210
|
+
if (isMulti) {
|
|
4211
|
+
return onSelectItem(selectedItem);
|
|
4212
|
+
}
|
|
4213
|
+
return onSelectItem([selectedItem]);
|
|
4214
|
+
};
|
|
4215
|
+
const hideWhenInSelectedList = selectedListItems.some((item) => item.id === id);
|
|
4216
|
+
return /* @__PURE__ */ jsxs29("div", { role: "listitem", hidden: hideWhenInSelectedList, css: EntryListItemContainer, ...props, children: [
|
|
4217
|
+
/* @__PURE__ */ jsxs29("div", { role: "button", onClick: handleSelectItem, css: EntryListItemControlledContent, children: [
|
|
4218
|
+
!image ? null : /* @__PURE__ */ jsx49("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
|
|
4219
|
+
/* @__PURE__ */ jsxs29("div", { role: "heading", css: EntryListItemHeadingGroup, children: [
|
|
4220
|
+
!contentType ? null : /* @__PURE__ */ jsx49("span", { css: EntryListItemSubtitle, children: formatedContentType }),
|
|
4221
|
+
/* @__PURE__ */ jsx49("span", { css: EntryListItemTitle, children: title })
|
|
4222
|
+
] })
|
|
4223
|
+
] }),
|
|
4224
|
+
!popoverData ? null : /* @__PURE__ */ jsx49("div", { css: EntryListItemInfoContainer, children: /* @__PURE__ */ jsx49(Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData }) }),
|
|
4225
|
+
!children ? null : /* @__PURE__ */ jsx49("div", { css: EntryListItemUnControlledContent, children })
|
|
4226
|
+
] });
|
|
4227
|
+
};
|
|
4228
|
+
var EntrySearchListItemLoadingSkeleton = () => {
|
|
4229
|
+
return /* @__PURE__ */ jsx49("div", { role: "presentation", css: [EntryListItemContainer, EntryListItemLoading] });
|
|
4230
|
+
};
|
|
4231
|
+
|
|
4232
|
+
// src/components/EntrySearch/EntrySearchResultItem.tsx
|
|
4233
|
+
import { Badge, Button as Button5, Popover as Popover2 } from "@uniformdev/design-system";
|
|
4234
|
+
import { format as timeagoFormat } from "timeago.js";
|
|
4235
|
+
|
|
4236
|
+
// src/components/EntrySearch/styles/EntrySearchResultItem.styles.ts
|
|
4237
|
+
import { css as css29 } from "@emotion/react";
|
|
4238
|
+
var EntrySearchResultItemContainer = css29`
|
|
4239
|
+
align-items: center;
|
|
4240
|
+
border: 1px solid var(--gray-300);
|
|
4241
|
+
border-radius: var(--rounded-base);
|
|
4242
|
+
background: var(--gray-50);
|
|
4243
|
+
display: grid;
|
|
4244
|
+
grid-template-columns: 1fr auto;
|
|
4245
|
+
padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) var(--spacing-md);
|
|
4246
|
+
position: relative;
|
|
4247
|
+
|
|
4248
|
+
&:hover {
|
|
4249
|
+
.drag-handle {
|
|
4250
|
+
opacity: 1;
|
|
4251
|
+
}
|
|
4252
|
+
}
|
|
4253
|
+
`;
|
|
4254
|
+
var EntrySearchDragHandle = css29`
|
|
4255
|
+
border-left: 2px dotted var(--gray-300);
|
|
4256
|
+
border-right: 2px dotted var(--gray-300);
|
|
4257
|
+
position: absolute;
|
|
4258
|
+
inset: var(--spacing-sm) auto var(--spacing-sm) var(--spacing-sm);
|
|
4259
|
+
width: 5px;
|
|
4260
|
+
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
4261
|
+
opacity: 0;
|
|
4262
|
+
`;
|
|
4263
|
+
var EntrySearchResultItemSubtitle = css29`
|
|
4264
|
+
color: var(--gray-500);
|
|
4265
|
+
display: block;
|
|
4266
|
+
font-size: var(--fs-xs);
|
|
4267
|
+
line-height: 1;
|
|
4268
|
+
`;
|
|
4269
|
+
var EntrySearchResultItemTitle = css29`
|
|
4270
|
+
align-items: center;
|
|
4271
|
+
color: var(--brand-secondary-1);
|
|
4272
|
+
display: flex;
|
|
4273
|
+
gap: var(--spacing-xs);
|
|
4274
|
+
`;
|
|
4275
|
+
var EntrySearchResultItemTimeStamp = css29`
|
|
4276
|
+
color: var(--gray-500);
|
|
4277
|
+
font-size: var(--fs-xs);
|
|
4278
|
+
`;
|
|
4279
|
+
var EntrySearchAuthorStateGroup = css29`
|
|
4280
|
+
align-items: center;
|
|
4281
|
+
display: flex;
|
|
4282
|
+
gap: var(--spacing-sm);
|
|
4283
|
+
`;
|
|
4284
|
+
var EntrySearchUpdateGroup = css29`
|
|
4285
|
+
display: grid;
|
|
4286
|
+
`;
|
|
4287
|
+
var EntrySearchContentContainer = css29`
|
|
4288
|
+
display: flex;
|
|
4289
|
+
gap: var(--spacing-base);
|
|
4290
|
+
`;
|
|
4291
|
+
var EntrySearchImage = css29`
|
|
4292
|
+
width: 56px;
|
|
4293
|
+
object-fit: contain;
|
|
4294
|
+
`;
|
|
4295
|
+
|
|
4296
|
+
// src/components/EntrySearch/EntrySearchResultItem.tsx
|
|
4297
|
+
import { jsx as jsx50, jsxs as jsxs30 } from "@emotion/react/jsx-runtime";
|
|
4298
|
+
var EntrySearchResultItem = ({
|
|
4299
|
+
id,
|
|
4300
|
+
title,
|
|
4301
|
+
name,
|
|
4302
|
+
contentType,
|
|
4303
|
+
popoverData,
|
|
4304
|
+
publishStatus,
|
|
4305
|
+
editLinkIcon,
|
|
4306
|
+
editLink,
|
|
4307
|
+
imageUrl,
|
|
4308
|
+
onRemove,
|
|
4309
|
+
createdAt,
|
|
4310
|
+
publishedAt,
|
|
4311
|
+
hideRemoveButton = false,
|
|
4312
|
+
disableDnD = false,
|
|
4313
|
+
children
|
|
4314
|
+
}) => {
|
|
4315
|
+
const { onSelectItem } = useEntrySearchContext();
|
|
4316
|
+
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
4317
|
+
const onRemoveItem = () => {
|
|
4318
|
+
onSelectItem({ id });
|
|
4319
|
+
onRemove == null ? void 0 : onRemove();
|
|
4320
|
+
};
|
|
4321
|
+
return /* @__PURE__ */ jsxs30("div", { css: EntrySearchResultItemContainer, children: [
|
|
4322
|
+
disableDnD ? null : /* @__PURE__ */ jsx50("div", { role: "presentation", className: "drag-handle", css: EntrySearchDragHandle }),
|
|
4323
|
+
/* @__PURE__ */ jsx50("div", { children: /* @__PURE__ */ jsxs30("div", { css: EntrySearchContentContainer, children: [
|
|
4324
|
+
!imageUrl ? null : /* @__PURE__ */ jsx50("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: EntrySearchImage }),
|
|
4325
|
+
/* @__PURE__ */ jsxs30("div", { children: [
|
|
4326
|
+
/* @__PURE__ */ jsx50("span", { css: EntrySearchResultItemSubtitle, children: formatedContentType }),
|
|
4327
|
+
/* @__PURE__ */ jsxs30("span", { role: "heading", css: EntrySearchResultItemTitle, children: [
|
|
4328
|
+
title != null ? title : name,
|
|
4329
|
+
!popoverData ? null : /* @__PURE__ */ jsx50(Popover2, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4330
|
+
] }),
|
|
4331
|
+
!createdAt && !publishStatus ? null : /* @__PURE__ */ jsxs30("div", { css: EntrySearchAuthorStateGroup, children: [
|
|
4332
|
+
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ jsx50(Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
|
|
4333
|
+
!createdAt && !publishedAt ? null : /* @__PURE__ */ jsxs30("div", { css: EntrySearchUpdateGroup, children: [
|
|
4334
|
+
!createdAt ? null : /* @__PURE__ */ jsxs30("small", { css: EntrySearchResultItemTimeStamp, children: [
|
|
4335
|
+
/* @__PURE__ */ jsx50("strong", { children: "Last updated: " }),
|
|
4336
|
+
timeagoFormat(createdAt)
|
|
4337
|
+
] }),
|
|
4338
|
+
!publishedAt ? null : /* @__PURE__ */ jsxs30("small", { css: EntrySearchResultItemTimeStamp, children: [
|
|
4339
|
+
/* @__PURE__ */ jsx50("strong", { children: "Last published: " }),
|
|
4340
|
+
timeagoFormat(publishedAt)
|
|
4341
|
+
] })
|
|
4342
|
+
] })
|
|
4343
|
+
] }),
|
|
4344
|
+
/* @__PURE__ */ jsx50("div", { children })
|
|
4345
|
+
] })
|
|
4346
|
+
] }) }),
|
|
4347
|
+
!editLink && hideRemoveButton ? null : /* @__PURE__ */ jsxs30("div", { css: EntrySearchAuthorStateGroup, children: [
|
|
4348
|
+
!editLink ? null : /* @__PURE__ */ jsx50(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
|
|
4349
|
+
hideRemoveButton ? null : /* @__PURE__ */ jsx50(Button5, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
|
|
4350
|
+
] })
|
|
4351
|
+
] });
|
|
4352
|
+
};
|
|
4353
|
+
|
|
4354
|
+
// src/components/EntrySearch/styles/EntrySearchResultItemButton.styles.ts
|
|
4355
|
+
import { css as css30 } from "@emotion/react";
|
|
4356
|
+
import { button as button2 } from "@uniformdev/design-system";
|
|
4357
|
+
var ButtonStyles = css30`
|
|
4358
|
+
${button2}
|
|
4359
|
+
background: transparent;
|
|
4360
|
+
border: 1px solid var(--brand-secondary-1);
|
|
4361
|
+
color: var(--brand-secondary-1);
|
|
4362
|
+
padding: var(--spacing-sm);
|
|
4363
|
+
font-size: var(--fs-sm);
|
|
4364
|
+
line-height: 1;
|
|
4365
|
+
gap: var(--spacing-xs);
|
|
4366
|
+
transition: border-color var(--duration-fast) var(--timing-ease-out),
|
|
4367
|
+
background-color var(--duration-fast) var(--timing-ease-out);
|
|
4368
|
+
|
|
4369
|
+
&:hover {
|
|
4370
|
+
background: var(--gray-100);
|
|
4371
|
+
border-color: var(--gray-300);
|
|
4372
|
+
}
|
|
4373
|
+
|
|
4374
|
+
&:disabled {
|
|
4375
|
+
background: var(--gray-300);
|
|
4376
|
+
border-color: var(--gray-200);
|
|
4377
|
+
color: var(--gray-500);
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4380
|
+
&:link {
|
|
4381
|
+
text-decoration: none;
|
|
4382
|
+
}
|
|
4383
|
+
`;
|
|
4384
|
+
var ButtonIcon = css30`
|
|
4385
|
+
width: 1rem;
|
|
4386
|
+
height: 1rem;
|
|
4387
|
+
`;
|
|
4388
|
+
|
|
4389
|
+
// src/components/EntrySearch/EntrySearchResultItemButton.tsx
|
|
4390
|
+
import { jsx as jsx51, jsxs as jsxs31 } from "@emotion/react/jsx-runtime";
|
|
4391
|
+
var EntrySearchResultItemButton = ({
|
|
4392
|
+
text,
|
|
4393
|
+
icon,
|
|
4394
|
+
...props
|
|
4395
|
+
}) => {
|
|
4396
|
+
return /* @__PURE__ */ jsxs31("button", { type: "button", css: ButtonStyles, ...props, children: [
|
|
4397
|
+
!icon ? null : /* @__PURE__ */ jsx51(Image, { src: icon, css: ButtonIcon }),
|
|
4398
|
+
text
|
|
4399
|
+
] });
|
|
4400
|
+
};
|
|
4401
|
+
var LinkButton = ({
|
|
4402
|
+
text,
|
|
4403
|
+
icon,
|
|
4404
|
+
...props
|
|
4405
|
+
}) => {
|
|
4406
|
+
return /* @__PURE__ */ jsxs31("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
|
|
4407
|
+
!icon ? null : /* @__PURE__ */ jsx51(Image, { src: icon, css: ButtonIcon }),
|
|
4408
|
+
text
|
|
4409
|
+
] });
|
|
4410
|
+
};
|
|
4411
|
+
|
|
4412
|
+
// src/components/EntrySearch/EntrySearchResultList.tsx
|
|
4413
|
+
import { Button as Button6, Counter, VerticalRhythm as VerticalRhythm2 } from "@uniformdev/design-system";
|
|
4414
|
+
import { DragDropContext as DragDropContext3, Draggable as Draggable3, Droppable as Droppable3 } from "react-beautiful-dnd";
|
|
4415
|
+
|
|
4416
|
+
// src/components/EntrySearch/styles/EntrySearchResultList.styles.ts
|
|
4417
|
+
import { css as css31 } from "@emotion/react";
|
|
4418
|
+
var EntrySearchResultListContainer = css31`
|
|
4419
|
+
align-items: center;
|
|
4420
|
+
display: flex;
|
|
4421
|
+
gap: var(--spacing-sm);
|
|
4422
|
+
justify-content: space-between;
|
|
4423
|
+
`;
|
|
4424
|
+
var EntrySearchResultListCounterContainer = css31`
|
|
4425
|
+
align-items: center;
|
|
4426
|
+
display: flex;
|
|
4427
|
+
gap: var(--spacing-sm);
|
|
4428
|
+
`;
|
|
4429
|
+
var EntrySearchResultListTitle = css31`
|
|
4430
|
+
font-weight: var(--fw-bold);
|
|
4431
|
+
line-height: 1;
|
|
4432
|
+
`;
|
|
4433
|
+
|
|
4434
|
+
// src/components/EntrySearch/EntrySearchResultList.tsx
|
|
4435
|
+
import { Fragment as Fragment7, jsx as jsx52, jsxs as jsxs32 } from "@emotion/react/jsx-runtime";
|
|
4436
|
+
var EntrySearchResultList = ({
|
|
4437
|
+
resultLabelText = "Selected",
|
|
4438
|
+
removeButtonText = "Remove all",
|
|
4439
|
+
onRemoveAllSelected,
|
|
4440
|
+
hideRemoveButton = false,
|
|
4441
|
+
additionalButtons,
|
|
4442
|
+
renderResultComponent = (value) => /* @__PURE__ */ jsx52(EntrySearchResultItem, { ...value, disableDnD }),
|
|
4443
|
+
disableDnD = false
|
|
4444
|
+
}) => {
|
|
4445
|
+
const { selectedListItems, onRemoveAllSelectedItems, onSelectItem } = useEntrySearchContext();
|
|
4446
|
+
const handleRemoveAllSelectedItems = () => {
|
|
4447
|
+
onRemoveAllSelectedItems();
|
|
4448
|
+
onRemoveAllSelected == null ? void 0 : onRemoveAllSelected();
|
|
4449
|
+
};
|
|
4450
|
+
const onDragEnd = (res) => {
|
|
4451
|
+
var _a, _b;
|
|
4452
|
+
if (res.destination && res.source.droppableId === ((_a = res.destination) == null ? void 0 : _a.droppableId)) {
|
|
4453
|
+
const result = [...selectedListItems || []];
|
|
4454
|
+
const [removed] = (_b = result == null ? void 0 : result.splice(res.source.index, 1)) != null ? _b : [];
|
|
4455
|
+
result == null ? void 0 : result.splice(res.destination.index, 0, removed);
|
|
4456
|
+
onSelectItem(result);
|
|
4457
|
+
return result;
|
|
4458
|
+
}
|
|
4459
|
+
};
|
|
4460
|
+
return /* @__PURE__ */ jsxs32(Fragment7, { children: [
|
|
4461
|
+
/* @__PURE__ */ jsxs32("div", { role: "group", css: EntrySearchResultListContainer, children: [
|
|
4462
|
+
/* @__PURE__ */ jsxs32("div", { role: "note", css: EntrySearchResultListCounterContainer, children: [
|
|
4463
|
+
/* @__PURE__ */ jsx52("span", { css: EntrySearchResultListTitle, children: resultLabelText }),
|
|
4464
|
+
" ",
|
|
4465
|
+
!selectedListItems.length ? null : /* @__PURE__ */ jsx52(Counter, { count: selectedListItems.length })
|
|
4466
|
+
] }),
|
|
4467
|
+
/* @__PURE__ */ jsxs32("div", { css: EntrySearchResultListCounterContainer, children: [
|
|
4468
|
+
additionalButtons,
|
|
4469
|
+
hideRemoveButton ? null : /* @__PURE__ */ jsx52(
|
|
4470
|
+
Button6,
|
|
4471
|
+
{
|
|
4472
|
+
buttonType: "ghostDestructive",
|
|
4473
|
+
size: "xs",
|
|
4474
|
+
disabled: selectedListItems.length === 0,
|
|
4475
|
+
onClick: handleRemoveAllSelectedItems,
|
|
4476
|
+
children: removeButtonText
|
|
4477
|
+
}
|
|
4478
|
+
)
|
|
4479
|
+
] })
|
|
4480
|
+
] }),
|
|
4481
|
+
!selectedListItems.length ? null : /* @__PURE__ */ jsx52(DragDropContext3, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx52(Droppable3, { droppableId: "canvas-multi-select", children: (provided) => /* @__PURE__ */ jsxs32("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
4482
|
+
/* @__PURE__ */ jsx52(VerticalRhythm2, { gap: "sm", children: selectedListItems.map((item, i) => {
|
|
4483
|
+
const renderListItem = renderResultComponent(item);
|
|
4484
|
+
return /* @__PURE__ */ jsx52(
|
|
4485
|
+
Draggable3,
|
|
4486
|
+
{
|
|
4487
|
+
draggableId: item.title,
|
|
4488
|
+
index: i,
|
|
4489
|
+
isDragDisabled: disableDnD,
|
|
4490
|
+
children: (provided2, snapshot) => /* @__PURE__ */ jsx52(
|
|
4491
|
+
"div",
|
|
4492
|
+
{
|
|
4493
|
+
ref: provided2.innerRef,
|
|
4494
|
+
"data-dragging": snapshot.isDragging,
|
|
4495
|
+
...provided2.draggableProps,
|
|
4496
|
+
...provided2.dragHandleProps,
|
|
4497
|
+
children: renderListItem
|
|
4498
|
+
}
|
|
4499
|
+
)
|
|
4500
|
+
},
|
|
4501
|
+
item.title
|
|
4502
|
+
);
|
|
4503
|
+
}) }),
|
|
4504
|
+
provided.placeholder
|
|
4505
|
+
] }) }) })
|
|
4506
|
+
] });
|
|
4507
|
+
};
|
|
4508
|
+
|
|
4509
|
+
// src/components/EntrySearch/QueryFilter.tsx
|
|
4510
|
+
import { Input as Input7, InputKeywordSearch as InputKeywordSearch3, InputSelect as InputSelect7 } from "@uniformdev/design-system";
|
|
4511
|
+
import { useEffect as useEffect7, useState as useState11 } from "react";
|
|
4512
|
+
import { jsx as jsx53, jsxs as jsxs33 } from "@emotion/react/jsx-runtime";
|
|
4513
|
+
var QueryFilter = ({
|
|
4514
|
+
requireContentType,
|
|
4515
|
+
queryFilterTitle = "Configure Query",
|
|
4516
|
+
contentTypeLabel = "Filter by content type",
|
|
4517
|
+
typeSelectorAllTypesOptionText = "All content types",
|
|
4518
|
+
contentTypeOptions,
|
|
4519
|
+
searchInputName = "searchText",
|
|
4520
|
+
searchInputPlaceholderText = "Enter keyword to narrow your results",
|
|
4521
|
+
countLabel = "Count",
|
|
4522
|
+
countValue = 5,
|
|
4523
|
+
sortLabel = "Sort",
|
|
4524
|
+
sortOptions,
|
|
4525
|
+
sortOrderLabel = "Sort Order",
|
|
4526
|
+
sortOrderOptions = [
|
|
4527
|
+
{
|
|
4528
|
+
name: "Ascending",
|
|
4529
|
+
id: "asc",
|
|
4530
|
+
label: "Ascending"
|
|
4531
|
+
},
|
|
4532
|
+
{
|
|
4533
|
+
name: "Descending",
|
|
4534
|
+
id: "desc",
|
|
4535
|
+
label: "Descending"
|
|
4536
|
+
}
|
|
4537
|
+
],
|
|
4538
|
+
children
|
|
4539
|
+
}) => {
|
|
4540
|
+
var _a, _b;
|
|
4541
|
+
const { query, onSetQuery } = useEntrySearchContext();
|
|
4542
|
+
const [queryState, setQueryState] = useState11({
|
|
4543
|
+
contentType: "",
|
|
4544
|
+
keyword: "",
|
|
4545
|
+
count: countValue != null ? countValue : 5,
|
|
4546
|
+
sortBy: (_a = sortOptions[0].id) != null ? _a : "",
|
|
4547
|
+
sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
|
|
4548
|
+
});
|
|
4549
|
+
const handleFilterChange = (value) => {
|
|
4550
|
+
setQueryState((prev) => ({ ...prev, ...value }));
|
|
4551
|
+
onSetQuery({ ...query, ...value });
|
|
4552
|
+
};
|
|
4553
|
+
useEffect7(() => {
|
|
4554
|
+
onSetQuery(queryState);
|
|
4555
|
+
}, [onSetQuery, queryState]);
|
|
4556
|
+
return /* @__PURE__ */ jsxs33("fieldset", { children: [
|
|
4557
|
+
/* @__PURE__ */ jsx53("span", { css: EntrySearchFilterContainerLabel, children: queryFilterTitle }),
|
|
4558
|
+
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterContainer, children: [
|
|
4559
|
+
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("0.5fr 1fr"), children: [
|
|
4560
|
+
/* @__PURE__ */ jsx53(
|
|
4561
|
+
InputSelect7,
|
|
4562
|
+
{
|
|
4563
|
+
label: contentTypeLabel,
|
|
4564
|
+
showLabel: false,
|
|
4565
|
+
options: [
|
|
4566
|
+
...!requireContentType ? [{ id: "", label: typeSelectorAllTypesOptionText }] : [],
|
|
4567
|
+
...contentTypeOptions ? contentTypeOptions.map((option) => {
|
|
4568
|
+
var _a2;
|
|
4569
|
+
return { id: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
|
|
4570
|
+
}) : []
|
|
4571
|
+
],
|
|
4572
|
+
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
4573
|
+
value: queryState.contentType
|
|
4574
|
+
}
|
|
4575
|
+
),
|
|
4576
|
+
/* @__PURE__ */ jsx53(
|
|
4577
|
+
InputKeywordSearch3,
|
|
4578
|
+
{
|
|
4579
|
+
inputFieldName: searchInputName,
|
|
4580
|
+
placeholder: searchInputPlaceholderText,
|
|
4581
|
+
onSearchTextChanged: (e) => handleFilterChange({ keyword: e }),
|
|
4582
|
+
disabledFieldSubmission: true,
|
|
4583
|
+
onClear: () => handleFilterChange({ keyword: "" }),
|
|
4584
|
+
value: queryState.keyword
|
|
4585
|
+
}
|
|
4586
|
+
)
|
|
4587
|
+
] }),
|
|
4588
|
+
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("repeat(2, 1fr) 0.5fr"), children: [
|
|
4589
|
+
/* @__PURE__ */ jsx53(
|
|
4590
|
+
InputSelect7,
|
|
4591
|
+
{
|
|
4592
|
+
label: sortLabel,
|
|
4593
|
+
options: [
|
|
4594
|
+
{
|
|
4595
|
+
label: "Select a sort",
|
|
4596
|
+
id: ""
|
|
4597
|
+
},
|
|
4598
|
+
...sortOptions ? sortOptions.map((option) => {
|
|
4599
|
+
var _a2;
|
|
4600
|
+
return { id: option.id, name: option.name, label: (_a2 = option.label) != null ? _a2 : option.name };
|
|
4601
|
+
}) : []
|
|
4602
|
+
],
|
|
4603
|
+
onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
|
|
4604
|
+
value: queryState.sortBy
|
|
4605
|
+
}
|
|
4606
|
+
),
|
|
4607
|
+
/* @__PURE__ */ jsx53(
|
|
4608
|
+
InputSelect7,
|
|
4609
|
+
{
|
|
4610
|
+
label: sortOrderLabel,
|
|
4611
|
+
options: [
|
|
4612
|
+
...sortOrderOptions ? sortOrderOptions.map((option) => {
|
|
4613
|
+
var _a2;
|
|
4614
|
+
return { value: option.id, label: (_a2 = option.label) != null ? _a2 : option.name, name: option.name };
|
|
4615
|
+
}) : []
|
|
4616
|
+
],
|
|
4617
|
+
onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
|
|
4618
|
+
value: queryState.sortOrder
|
|
4619
|
+
}
|
|
4620
|
+
),
|
|
4621
|
+
/* @__PURE__ */ jsx53(
|
|
4622
|
+
Input7,
|
|
4623
|
+
{
|
|
4624
|
+
label: countLabel,
|
|
4625
|
+
type: "number",
|
|
4626
|
+
onChange: (e) => handleFilterChange({ count: e.target.value }),
|
|
4627
|
+
defaultValue: countValue,
|
|
4628
|
+
value: queryState.count
|
|
4629
|
+
}
|
|
4630
|
+
)
|
|
4631
|
+
] }),
|
|
4632
|
+
children
|
|
4633
|
+
] })
|
|
4634
|
+
] });
|
|
4635
|
+
};
|
|
4636
|
+
|
|
3898
4637
|
// src/components/MeshApp.tsx
|
|
3899
|
-
import { LoadingIndicator as
|
|
4638
|
+
import { LoadingIndicator as LoadingIndicator3, Theme as Theme2 } from "@uniformdev/design-system";
|
|
3900
4639
|
|
|
3901
4640
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
3902
4641
|
import { initializeUniformMeshSDK } from "@uniformdev/mesh-sdk";
|
|
3903
|
-
import { useEffect as
|
|
4642
|
+
import { useEffect as useEffect8, useRef as useRef10, useState as useState12 } from "react";
|
|
3904
4643
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
3905
|
-
const [error, setError] =
|
|
3906
|
-
const [sdk, setSdk] =
|
|
4644
|
+
const [error, setError] = useState12();
|
|
4645
|
+
const [sdk, setSdk] = useState12();
|
|
3907
4646
|
const initializationInProgress = useRef10(false);
|
|
3908
|
-
|
|
4647
|
+
useEffect8(
|
|
3909
4648
|
() => {
|
|
3910
4649
|
if (typeof window === "undefined" || sdk) {
|
|
3911
4650
|
return;
|
|
@@ -3938,7 +4677,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
|
3938
4677
|
};
|
|
3939
4678
|
|
|
3940
4679
|
// src/components/MeshApp.tsx
|
|
3941
|
-
import { jsx as
|
|
4680
|
+
import { jsx as jsx54, jsxs as jsxs34 } from "@emotion/react/jsx-runtime";
|
|
3942
4681
|
var MeshApp = ({
|
|
3943
4682
|
children,
|
|
3944
4683
|
loadingComponent,
|
|
@@ -3947,18 +4686,18 @@ var MeshApp = ({
|
|
|
3947
4686
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
3948
4687
|
if (initializing || !sdk) {
|
|
3949
4688
|
const LoadingComponent = loadingComponent;
|
|
3950
|
-
return LoadingComponent ? /* @__PURE__ */
|
|
4689
|
+
return LoadingComponent ? /* @__PURE__ */ jsx54(LoadingComponent, {}) : /* @__PURE__ */ jsx54(LoadingIndicator3, {});
|
|
3951
4690
|
}
|
|
3952
4691
|
if (error) {
|
|
3953
4692
|
const ErrorComponent = errorComponent;
|
|
3954
4693
|
if (ErrorComponent) {
|
|
3955
|
-
return /* @__PURE__ */
|
|
4694
|
+
return /* @__PURE__ */ jsx54(ErrorComponent, { error });
|
|
3956
4695
|
}
|
|
3957
4696
|
throw error;
|
|
3958
4697
|
}
|
|
3959
|
-
return /* @__PURE__ */
|
|
3960
|
-
/* @__PURE__ */
|
|
3961
|
-
/* @__PURE__ */
|
|
4698
|
+
return /* @__PURE__ */ jsxs34(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
|
|
4699
|
+
/* @__PURE__ */ jsx54(Theme2, {}),
|
|
4700
|
+
/* @__PURE__ */ jsx54(UniformMeshLocationContextProvider, { children })
|
|
3962
4701
|
] });
|
|
3963
4702
|
};
|
|
3964
4703
|
|
|
@@ -3982,17 +4721,17 @@ function createLocationValidator(setValue, validate) {
|
|
|
3982
4721
|
// src/index.ts
|
|
3983
4722
|
import {
|
|
3984
4723
|
AddListButton as AddListButton2,
|
|
3985
|
-
Button as
|
|
4724
|
+
Button as Button7,
|
|
3986
4725
|
Callout as Callout4,
|
|
3987
4726
|
Heading,
|
|
3988
|
-
Input as
|
|
4727
|
+
Input as Input8,
|
|
3989
4728
|
InputComboBox,
|
|
3990
|
-
InputKeywordSearch as
|
|
3991
|
-
InputSelect as
|
|
4729
|
+
InputKeywordSearch as InputKeywordSearch4,
|
|
4730
|
+
InputSelect as InputSelect8,
|
|
3992
4731
|
InputToggle,
|
|
3993
|
-
InputKeywordSearch as
|
|
4732
|
+
InputKeywordSearch as InputKeywordSearch5,
|
|
3994
4733
|
Label,
|
|
3995
|
-
LoadingIndicator as
|
|
4734
|
+
LoadingIndicator as LoadingIndicator4,
|
|
3996
4735
|
LoadingOverlay as LoadingOverlay2,
|
|
3997
4736
|
Menu as Menu3,
|
|
3998
4737
|
MenuItem as MenuItem3,
|
|
@@ -4010,7 +4749,7 @@ import {
|
|
|
4010
4749
|
ParameterTextareaInner,
|
|
4011
4750
|
ParameterToggle,
|
|
4012
4751
|
ParameterToggleInner,
|
|
4013
|
-
ScrollableList,
|
|
4752
|
+
ScrollableList as ScrollableList2,
|
|
4014
4753
|
ScrollableListItem,
|
|
4015
4754
|
Switch,
|
|
4016
4755
|
Textarea,
|
|
@@ -4019,26 +4758,38 @@ import {
|
|
|
4019
4758
|
export * from "@uniformdev/mesh-sdk";
|
|
4020
4759
|
export {
|
|
4021
4760
|
AddListButton2 as AddListButton,
|
|
4022
|
-
|
|
4761
|
+
Button7 as Button,
|
|
4023
4762
|
Callout4 as Callout,
|
|
4024
4763
|
DamSelectedItem,
|
|
4764
|
+
DataRefreshButton,
|
|
4025
4765
|
DataResourceVariablesList,
|
|
4026
4766
|
DataSourceEditor,
|
|
4027
4767
|
DataTypeEditor,
|
|
4028
4768
|
DefaultSearchRow,
|
|
4029
4769
|
DefaultSelectedItem,
|
|
4030
4770
|
EntrySearch,
|
|
4771
|
+
EntrySearchContainer,
|
|
4772
|
+
EntrySearchContext,
|
|
4773
|
+
EntrySearchFilter,
|
|
4774
|
+
EntrySearchFilterContainer2 as EntrySearchFilterContainer,
|
|
4775
|
+
EntrySearchListItem,
|
|
4776
|
+
EntrySearchListItemLoadingSkeleton,
|
|
4777
|
+
EntrySearchProvider,
|
|
4778
|
+
EntrySearchResultItem,
|
|
4779
|
+
EntrySearchResultItemButton,
|
|
4780
|
+
EntrySearchResultList,
|
|
4031
4781
|
Heading,
|
|
4032
4782
|
icons_exports as Icons,
|
|
4033
|
-
|
|
4783
|
+
Input8 as Input,
|
|
4034
4784
|
InputComboBox,
|
|
4035
|
-
|
|
4036
|
-
|
|
4785
|
+
InputKeywordSearch4 as InputKeywordSearch,
|
|
4786
|
+
InputSelect8 as InputSelect,
|
|
4037
4787
|
InputToggle,
|
|
4038
4788
|
InputVariables,
|
|
4039
|
-
|
|
4789
|
+
InputKeywordSearch5 as KeywordSearchInput,
|
|
4040
4790
|
Label,
|
|
4041
|
-
|
|
4791
|
+
LinkButton,
|
|
4792
|
+
LoadingIndicator4 as LoadingIndicator,
|
|
4042
4793
|
LoadingOverlay2 as LoadingOverlay,
|
|
4043
4794
|
Menu3 as Menu,
|
|
4044
4795
|
MenuItem3 as MenuItem,
|
|
@@ -4065,6 +4816,7 @@ export {
|
|
|
4065
4816
|
ProductSearchContext,
|
|
4066
4817
|
ProductSearchRow,
|
|
4067
4818
|
ProductSelectedItem,
|
|
4819
|
+
QueryFilter,
|
|
4068
4820
|
RequestBody,
|
|
4069
4821
|
RequestHeaders,
|
|
4070
4822
|
RequestMethodSelect,
|
|
@@ -4074,7 +4826,7 @@ export {
|
|
|
4074
4826
|
RequestUrl,
|
|
4075
4827
|
RequestUrlInput,
|
|
4076
4828
|
ResolvableLoadingValue,
|
|
4077
|
-
ScrollableList,
|
|
4829
|
+
ScrollableList2 as ScrollableList,
|
|
4078
4830
|
ScrollableListItem,
|
|
4079
4831
|
SelectionField,
|
|
4080
4832
|
Switch,
|
|
@@ -4153,6 +4905,7 @@ export {
|
|
|
4153
4905
|
selectedItemTitle,
|
|
4154
4906
|
urlEncodeRequestParameter,
|
|
4155
4907
|
urlEncodeRequestUrl,
|
|
4908
|
+
useEntrySearchContext,
|
|
4156
4909
|
useInitializeUniformMeshSdk,
|
|
4157
4910
|
useMeshLocation,
|
|
4158
4911
|
useParameterShell,
|