@uniformdev/mesh-sdk-react 18.27.1-alpha.12 → 18.27.1-alpha.25
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 +248 -12
- package/dist/index.esm.js +773 -34
- package/dist/index.js +813 -59
- package/dist/index.mjs +773 -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,741 @@ 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
|
+
keywordSearch: ""
|
|
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
|
+
keywordSearch: ""
|
|
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
|
+
keywordSearch: ""
|
|
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
|
+
return { value: option.id, label: option.name };
|
|
4090
|
+
}) : []
|
|
4091
|
+
],
|
|
4092
|
+
value: searchState.contentType
|
|
4093
|
+
}
|
|
4094
|
+
),
|
|
4095
|
+
/* @__PURE__ */ jsx47(
|
|
4096
|
+
InputKeywordSearch2,
|
|
4097
|
+
{
|
|
4098
|
+
inputFieldName: searchInputName,
|
|
4099
|
+
placeholder: searchInputPlaceholderText,
|
|
4100
|
+
onSearchTextChanged: (e) => handleFilterChange({ keywordSearch: e }),
|
|
4101
|
+
disabledFieldSubmission: true,
|
|
4102
|
+
onClear: () => handleFilterChange({ keywordSearch: "" }),
|
|
4103
|
+
value: searchState.keywordSearch
|
|
4104
|
+
}
|
|
4105
|
+
)
|
|
4106
|
+
] });
|
|
4107
|
+
};
|
|
4108
|
+
|
|
4109
|
+
// src/components/EntrySearch/EntrySearchFilterContainer.tsx
|
|
4110
|
+
import { jsx as jsx48, jsxs as jsxs28 } from "@emotion/react/jsx-runtime";
|
|
4111
|
+
var EntrySearchFilterContainer2 = ({ label, children }) => {
|
|
4112
|
+
return /* @__PURE__ */ jsxs28("div", { children: [
|
|
4113
|
+
/* @__PURE__ */ jsx48("span", { css: EntrySearchFilterContainerLabel, children: label }),
|
|
4114
|
+
/* @__PURE__ */ jsx48("div", { css: EntrySearchFilterContainer, children })
|
|
4115
|
+
] });
|
|
4116
|
+
};
|
|
4117
|
+
|
|
4118
|
+
// src/components/EntrySearch/EntrySearchListItem.tsx
|
|
4119
|
+
import { Popover } from "@uniformdev/design-system";
|
|
4120
|
+
|
|
4121
|
+
// src/components/EntrySearch/styles/EntrySearchListItem.styles.ts
|
|
4122
|
+
import { css as css28 } from "@emotion/react";
|
|
4123
|
+
import { skeletonLoading } from "@uniformdev/design-system";
|
|
4124
|
+
var EntryListItemContainer = css28`
|
|
4125
|
+
align-items: center;
|
|
4126
|
+
border: 1px solid var(--gray-300);
|
|
4127
|
+
border-radius: var(--rounded-base);
|
|
4128
|
+
background: var(--white);
|
|
4129
|
+
display: grid;
|
|
4130
|
+
grid-template-columns: 1fr 32px;
|
|
4131
|
+
padding: var(--spacing-sm);
|
|
4132
|
+
|
|
4133
|
+
&[hidden] {
|
|
4134
|
+
display: none;
|
|
4135
|
+
}
|
|
4136
|
+
`;
|
|
4137
|
+
var EntryListItemLoading = css28`
|
|
4138
|
+
animation: ${skeletonLoading} 1s linear infinite alternate;
|
|
4139
|
+
border-color: transparent;
|
|
4140
|
+
min-height: 42px;
|
|
4141
|
+
position: relative;
|
|
4142
|
+
|
|
4143
|
+
&:before,
|
|
4144
|
+
&:after {
|
|
4145
|
+
background: var(--gray-200);
|
|
4146
|
+
content: '';
|
|
4147
|
+
display: block;
|
|
4148
|
+
height: 1rem;
|
|
4149
|
+
}
|
|
4150
|
+
|
|
4151
|
+
&:before {
|
|
4152
|
+
border-radius: var(--rounded-base);
|
|
4153
|
+
width: 10rem;
|
|
4154
|
+
}
|
|
4155
|
+
|
|
4156
|
+
&:after {
|
|
4157
|
+
border-radius: var(--rounded-full);
|
|
4158
|
+
width: 1rem;
|
|
4159
|
+
}
|
|
4160
|
+
`;
|
|
4161
|
+
var EntryListItemHeadingGroup = css28`
|
|
4162
|
+
align-items: center;
|
|
4163
|
+
display: grid;
|
|
4164
|
+
`;
|
|
4165
|
+
var EntryListItemTitle = css28`
|
|
4166
|
+
color: var(--brand-secondary-1);
|
|
4167
|
+
display: block;
|
|
4168
|
+
font-size: var(--fs-sm);
|
|
4169
|
+
`;
|
|
4170
|
+
var EntryListItemSubtitle = css28`
|
|
4171
|
+
color: var(--gray-500);
|
|
4172
|
+
display: block;
|
|
4173
|
+
font-size: var(--fs-xs);
|
|
4174
|
+
line-height: 1;
|
|
4175
|
+
`;
|
|
4176
|
+
var EntryListItemInfoContainer = css28`
|
|
4177
|
+
align-items: center;
|
|
4178
|
+
display: flex;
|
|
4179
|
+
justify-content: center;
|
|
4180
|
+
`;
|
|
4181
|
+
var EntryListItemControlledContent = css28`
|
|
4182
|
+
display: flex;
|
|
4183
|
+
gap: var(--spacing-sm);
|
|
4184
|
+
`;
|
|
4185
|
+
var EntryListItemUnControlledContent = css28`
|
|
4186
|
+
margin-top: var(--spacing-sm);
|
|
4187
|
+
grid-column: 1 / -1;
|
|
4188
|
+
`;
|
|
4189
|
+
|
|
4190
|
+
// src/components/EntrySearch/EntrySearchListItem.tsx
|
|
4191
|
+
import { jsx as jsx49, jsxs as jsxs29 } from "@emotion/react/jsx-runtime";
|
|
4192
|
+
var EntrySearchListItem = ({
|
|
4193
|
+
id,
|
|
4194
|
+
title,
|
|
4195
|
+
contentType,
|
|
4196
|
+
image,
|
|
4197
|
+
popoverInfo,
|
|
4198
|
+
onSelect,
|
|
4199
|
+
children,
|
|
4200
|
+
...props
|
|
4201
|
+
}) => {
|
|
4202
|
+
const { onSelectItem, selectedListItems } = useEntrySearchContext();
|
|
4203
|
+
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
4204
|
+
const handleSelectItem = () => {
|
|
4205
|
+
var _a;
|
|
4206
|
+
const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
|
|
4207
|
+
onSelectItem({ id, title, ...extraData });
|
|
4208
|
+
};
|
|
4209
|
+
const hideWhenInSelectedList = selectedListItems.some((item) => item.id === id);
|
|
4210
|
+
return /* @__PURE__ */ jsxs29("div", { role: "listitem", hidden: hideWhenInSelectedList, css: EntryListItemContainer, ...props, children: [
|
|
4211
|
+
/* @__PURE__ */ jsxs29("div", { role: "button", onClick: handleSelectItem, css: EntryListItemControlledContent, children: [
|
|
4212
|
+
!image ? null : /* @__PURE__ */ jsx49("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
|
|
4213
|
+
/* @__PURE__ */ jsxs29("div", { role: "heading", css: EntryListItemHeadingGroup, children: [
|
|
4214
|
+
!contentType ? null : /* @__PURE__ */ jsx49("span", { css: EntryListItemSubtitle, children: formatedContentType }),
|
|
4215
|
+
/* @__PURE__ */ jsx49("span", { css: EntryListItemTitle, children: title })
|
|
4216
|
+
] })
|
|
4217
|
+
] }),
|
|
4218
|
+
!popoverInfo ? null : /* @__PURE__ */ jsx49("div", { css: EntryListItemInfoContainer, children: /* @__PURE__ */ jsx49(Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverInfo }) }),
|
|
4219
|
+
!children ? null : /* @__PURE__ */ jsx49("div", { css: EntryListItemUnControlledContent, children })
|
|
4220
|
+
] });
|
|
4221
|
+
};
|
|
4222
|
+
var EntrySearchListItemLoadingSkeleton = () => {
|
|
4223
|
+
return /* @__PURE__ */ jsx49("div", { role: "presentation", css: [EntryListItemContainer, EntryListItemLoading] });
|
|
4224
|
+
};
|
|
4225
|
+
|
|
4226
|
+
// src/components/EntrySearch/EntrySearchResultItem.tsx
|
|
4227
|
+
import { Button as Button5, Popover as Popover2 } from "@uniformdev/design-system";
|
|
4228
|
+
import { format as timeagoFormat } from "timeago.js";
|
|
4229
|
+
|
|
4230
|
+
// src/components/EntrySearch/styles/PublishStatus.styles.ts
|
|
4231
|
+
import { css as css29 } from "@emotion/react";
|
|
4232
|
+
var StatusBadge = css29`
|
|
4233
|
+
display: inline-flex;
|
|
4234
|
+
padding: var(--spacing-xs) var(--spacing-sm);
|
|
4235
|
+
font-size: var(--fs-xxs);
|
|
4236
|
+
font-weight: var(--fw-bold);
|
|
4237
|
+
line-height: 1;
|
|
4238
|
+
text-transform: uppercase;
|
|
4239
|
+
`;
|
|
4240
|
+
var StatusBadgePublished = css29`
|
|
4241
|
+
background: #c7f1c2;
|
|
4242
|
+
color: #106226;
|
|
4243
|
+
`;
|
|
4244
|
+
var StatusBadgeUnPublished = css29`
|
|
4245
|
+
background: var(--alert);
|
|
4246
|
+
color: var(--alert-text);
|
|
4247
|
+
`;
|
|
4248
|
+
var StatusBadgeModified = css29`
|
|
4249
|
+
background: var(--gray-200);
|
|
4250
|
+
color: var(--brand-primary-1);
|
|
4251
|
+
`;
|
|
4252
|
+
var StatusBadgeDraft = css29`
|
|
4253
|
+
background: var(--gray-200);
|
|
4254
|
+
color: var(--gray-500);
|
|
4255
|
+
`;
|
|
4256
|
+
|
|
4257
|
+
// src/components/EntrySearch/PublishStatus.tsx
|
|
4258
|
+
import { jsx as jsx50 } from "@emotion/react/jsx-runtime";
|
|
4259
|
+
var PublishStatus = ({ status }) => {
|
|
4260
|
+
const statusStyles = {
|
|
4261
|
+
draft: StatusBadgeDraft,
|
|
4262
|
+
modified: StatusBadgeModified,
|
|
4263
|
+
published: StatusBadgePublished,
|
|
4264
|
+
unpublished: StatusBadgeUnPublished
|
|
4265
|
+
};
|
|
4266
|
+
return /* @__PURE__ */ jsx50("span", { role: "status", css: [StatusBadge, statusStyles[status]], children: status });
|
|
4267
|
+
};
|
|
4268
|
+
|
|
4269
|
+
// src/components/EntrySearch/styles/EntrySearchResultItem.styles.ts
|
|
4270
|
+
import { css as css30 } from "@emotion/react";
|
|
4271
|
+
var EntrySearchResultItemContainer = css30`
|
|
4272
|
+
align-items: center;
|
|
4273
|
+
border: 1px solid var(--gray-300);
|
|
4274
|
+
border-radius: var(--rounded-base);
|
|
4275
|
+
background: var(--gray-50);
|
|
4276
|
+
display: grid;
|
|
4277
|
+
grid-template-columns: 1fr auto;
|
|
4278
|
+
padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) var(--spacing-md);
|
|
4279
|
+
`;
|
|
4280
|
+
var EntrySearchResultItemSubtitle = css30`
|
|
4281
|
+
color: var(--gray-500);
|
|
4282
|
+
display: block;
|
|
4283
|
+
font-size: var(--fs-xs);
|
|
4284
|
+
line-height: 1;
|
|
4285
|
+
`;
|
|
4286
|
+
var EntrySearchResultItemTitle = css30`
|
|
4287
|
+
align-items: center;
|
|
4288
|
+
color: var(--brand-secondary-1);
|
|
4289
|
+
display: flex;
|
|
4290
|
+
gap: var(--spacing-xs);
|
|
4291
|
+
`;
|
|
4292
|
+
var EntrySearchResultItemTimeStamp = css30`
|
|
4293
|
+
color: var(--gray-500);
|
|
4294
|
+
font-size: var(--fs-xs);
|
|
4295
|
+
`;
|
|
4296
|
+
var EntrySearchAuthorStateGroup = css30`
|
|
4297
|
+
align-items: center;
|
|
4298
|
+
display: flex;
|
|
4299
|
+
gap: var(--spacing-sm);
|
|
4300
|
+
`;
|
|
4301
|
+
var EntrySearchContentContainer = css30`
|
|
4302
|
+
display: flex;
|
|
4303
|
+
gap: var(--spacing-xs);
|
|
4304
|
+
`;
|
|
4305
|
+
var EntrySearchImage = css30`
|
|
4306
|
+
max-width: 56px;
|
|
4307
|
+
object-fit: contain;
|
|
4308
|
+
`;
|
|
4309
|
+
|
|
4310
|
+
// src/components/EntrySearch/EntrySearchResultItem.tsx
|
|
4311
|
+
import { jsx as jsx51, jsxs as jsxs30 } from "@emotion/react/jsx-runtime";
|
|
4312
|
+
var EntrySearchResultItem = ({
|
|
4313
|
+
id,
|
|
4314
|
+
title,
|
|
4315
|
+
name,
|
|
4316
|
+
contentType,
|
|
4317
|
+
popoverData,
|
|
4318
|
+
publishStatus,
|
|
4319
|
+
editLinkIcon,
|
|
4320
|
+
editLink,
|
|
4321
|
+
imageUrl,
|
|
4322
|
+
onRemove,
|
|
4323
|
+
createdAt,
|
|
4324
|
+
hideRemoveButton = false,
|
|
4325
|
+
children
|
|
4326
|
+
}) => {
|
|
4327
|
+
const { onSelectItem } = useEntrySearchContext();
|
|
4328
|
+
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
4329
|
+
const onRemoveItem = () => {
|
|
4330
|
+
onSelectItem({ id });
|
|
4331
|
+
onRemove == null ? void 0 : onRemove();
|
|
4332
|
+
};
|
|
4333
|
+
return /* @__PURE__ */ jsxs30("div", { css: EntrySearchResultItemContainer, children: [
|
|
4334
|
+
/* @__PURE__ */ jsx51("div", { children: /* @__PURE__ */ jsxs30("div", { css: EntrySearchContentContainer, children: [
|
|
4335
|
+
!imageUrl ? null : /* @__PURE__ */ jsx51("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: EntrySearchImage }),
|
|
4336
|
+
/* @__PURE__ */ jsxs30("div", { children: [
|
|
4337
|
+
/* @__PURE__ */ jsx51("span", { css: EntrySearchResultItemSubtitle, children: formatedContentType }),
|
|
4338
|
+
/* @__PURE__ */ jsxs30("span", { role: "heading", css: EntrySearchResultItemTitle, children: [
|
|
4339
|
+
title != null ? title : name,
|
|
4340
|
+
!popoverData ? null : /* @__PURE__ */ jsx51(Popover2, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4341
|
+
] }),
|
|
4342
|
+
!createdAt && !publishStatus ? null : /* @__PURE__ */ jsxs30("div", { css: EntrySearchAuthorStateGroup, children: [
|
|
4343
|
+
!publishStatus ? null : /* @__PURE__ */ jsx51(PublishStatus, { status: publishStatus }),
|
|
4344
|
+
!createdAt ? null : /* @__PURE__ */ jsxs30("small", { css: EntrySearchResultItemTimeStamp, children: [
|
|
4345
|
+
/* @__PURE__ */ jsx51("strong", { children: "Last updated: " }),
|
|
4346
|
+
timeagoFormat(createdAt)
|
|
4347
|
+
] })
|
|
4348
|
+
] }),
|
|
4349
|
+
/* @__PURE__ */ jsx51("div", { children })
|
|
4350
|
+
] })
|
|
4351
|
+
] }) }),
|
|
4352
|
+
!editLink && hideRemoveButton ? null : /* @__PURE__ */ jsxs30("div", { css: EntrySearchAuthorStateGroup, children: [
|
|
4353
|
+
!editLink ? null : /* @__PURE__ */ jsx51(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
|
|
4354
|
+
hideRemoveButton ? null : /* @__PURE__ */ jsx51(Button5, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
|
|
4355
|
+
] })
|
|
4356
|
+
] });
|
|
4357
|
+
};
|
|
4358
|
+
|
|
4359
|
+
// src/components/EntrySearch/styles/EntrySearchResultItemButton.styles.ts
|
|
4360
|
+
import { css as css31 } from "@emotion/react";
|
|
4361
|
+
import { button as button2 } from "@uniformdev/design-system";
|
|
4362
|
+
var ButtonStyles = css31`
|
|
4363
|
+
${button2}
|
|
4364
|
+
background: transparent;
|
|
4365
|
+
border: 1px solid var(--brand-secondary-1);
|
|
4366
|
+
color: var(--brand-secondary-1);
|
|
4367
|
+
padding: var(--spacing-sm);
|
|
4368
|
+
font-size: var(--fs-sm);
|
|
4369
|
+
line-height: 1;
|
|
4370
|
+
gap: var(--spacing-xs);
|
|
4371
|
+
transition: border-color var(--duration-fast) var(--timing-ease-out),
|
|
4372
|
+
background-color var(--duration-fast) var(--timing-ease-out);
|
|
4373
|
+
|
|
4374
|
+
&:hover {
|
|
4375
|
+
background: var(--gray-100);
|
|
4376
|
+
border-color: var(--gray-300);
|
|
4377
|
+
}
|
|
4378
|
+
|
|
4379
|
+
&:disabled {
|
|
4380
|
+
background: var(--gray-300);
|
|
4381
|
+
border-color: var(--gray-200);
|
|
4382
|
+
color: var(--gray-500);
|
|
4383
|
+
}
|
|
4384
|
+
|
|
4385
|
+
&:link {
|
|
4386
|
+
text-decoration: none;
|
|
4387
|
+
}
|
|
4388
|
+
`;
|
|
4389
|
+
var ButtonIcon = css31`
|
|
4390
|
+
width: 1rem;
|
|
4391
|
+
height: 1rem;
|
|
4392
|
+
`;
|
|
4393
|
+
|
|
4394
|
+
// src/components/EntrySearch/EntrySearchResultItemButton.tsx
|
|
4395
|
+
import { jsx as jsx52, jsxs as jsxs31 } from "@emotion/react/jsx-runtime";
|
|
4396
|
+
var EntrySearchResultItemButton = ({
|
|
4397
|
+
text,
|
|
4398
|
+
icon,
|
|
4399
|
+
...props
|
|
4400
|
+
}) => {
|
|
4401
|
+
return /* @__PURE__ */ jsxs31("button", { type: "button", css: ButtonStyles, ...props, children: [
|
|
4402
|
+
!icon ? null : /* @__PURE__ */ jsx52(Image, { src: icon, css: ButtonIcon }),
|
|
4403
|
+
text
|
|
4404
|
+
] });
|
|
4405
|
+
};
|
|
4406
|
+
var LinkButton = ({
|
|
4407
|
+
text,
|
|
4408
|
+
icon,
|
|
4409
|
+
...props
|
|
4410
|
+
}) => {
|
|
4411
|
+
return /* @__PURE__ */ jsxs31("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
|
|
4412
|
+
!icon ? null : /* @__PURE__ */ jsx52(Image, { src: icon, css: ButtonIcon }),
|
|
4413
|
+
text
|
|
4414
|
+
] });
|
|
4415
|
+
};
|
|
4416
|
+
|
|
4417
|
+
// src/components/EntrySearch/EntrySearchResultList.tsx
|
|
4418
|
+
import { Button as Button6, Counter, VerticalRhythm as VerticalRhythm2 } from "@uniformdev/design-system";
|
|
4419
|
+
import { DragDropContext as DragDropContext3, Draggable as Draggable3, Droppable as Droppable3 } from "react-beautiful-dnd";
|
|
4420
|
+
|
|
4421
|
+
// src/components/EntrySearch/styles/EntrySearchResultList.styles.ts
|
|
4422
|
+
import { css as css32 } from "@emotion/react";
|
|
4423
|
+
var EntrySearchResultListContainer = css32`
|
|
4424
|
+
align-items: center;
|
|
4425
|
+
display: flex;
|
|
4426
|
+
gap: var(--spacing-sm);
|
|
4427
|
+
justify-content: space-between;
|
|
4428
|
+
`;
|
|
4429
|
+
var EntrySearchResultListCounterContainer = css32`
|
|
4430
|
+
align-items: center;
|
|
4431
|
+
display: flex;
|
|
4432
|
+
gap: var(--spacing-sm);
|
|
4433
|
+
`;
|
|
4434
|
+
var EntrySearchResultListTitle = css32`
|
|
4435
|
+
font-weight: var(--fw-bold);
|
|
4436
|
+
line-height: 1;
|
|
4437
|
+
`;
|
|
4438
|
+
|
|
4439
|
+
// src/components/EntrySearch/EntrySearchResultList.tsx
|
|
4440
|
+
import { Fragment as Fragment7, jsx as jsx53, jsxs as jsxs32 } from "@emotion/react/jsx-runtime";
|
|
4441
|
+
var EntrySearchResultList = ({
|
|
4442
|
+
resultLabelText = "Selected",
|
|
4443
|
+
removeButtonText = "Remove all",
|
|
4444
|
+
onRemoveAllSelected,
|
|
4445
|
+
hideRemoveButton = false,
|
|
4446
|
+
additionalButtons,
|
|
4447
|
+
renderResultComponent = (value) => /* @__PURE__ */ jsx53(EntrySearchResultItem, { ...value }),
|
|
4448
|
+
disableDnD = false
|
|
4449
|
+
}) => {
|
|
4450
|
+
const { selectedListItems, onRemoveAllSelectedItems, onSelectItem } = useEntrySearchContext();
|
|
4451
|
+
const handleRemoveAllSelectedItems = () => {
|
|
4452
|
+
onRemoveAllSelectedItems();
|
|
4453
|
+
onRemoveAllSelected == null ? void 0 : onRemoveAllSelected();
|
|
4454
|
+
};
|
|
4455
|
+
const onDragEnd = (res) => {
|
|
4456
|
+
var _a, _b;
|
|
4457
|
+
if (res.destination && res.source.droppableId === ((_a = res.destination) == null ? void 0 : _a.droppableId)) {
|
|
4458
|
+
const result = [...selectedListItems || []];
|
|
4459
|
+
const [removed] = (_b = result == null ? void 0 : result.splice(res.source.index, 1)) != null ? _b : [];
|
|
4460
|
+
result == null ? void 0 : result.splice(res.destination.index, 0, removed);
|
|
4461
|
+
onSelectItem(result);
|
|
4462
|
+
return result;
|
|
4463
|
+
}
|
|
4464
|
+
};
|
|
4465
|
+
return /* @__PURE__ */ jsxs32(Fragment7, { children: [
|
|
4466
|
+
/* @__PURE__ */ jsxs32("div", { role: "group", css: EntrySearchResultListContainer, children: [
|
|
4467
|
+
/* @__PURE__ */ jsxs32("div", { role: "note", css: EntrySearchResultListCounterContainer, children: [
|
|
4468
|
+
/* @__PURE__ */ jsx53("span", { css: EntrySearchResultListTitle, children: resultLabelText }),
|
|
4469
|
+
" ",
|
|
4470
|
+
!selectedListItems.length ? null : /* @__PURE__ */ jsx53(Counter, { count: selectedListItems.length })
|
|
4471
|
+
] }),
|
|
4472
|
+
/* @__PURE__ */ jsxs32("div", { css: EntrySearchResultListCounterContainer, children: [
|
|
4473
|
+
additionalButtons,
|
|
4474
|
+
hideRemoveButton ? null : /* @__PURE__ */ jsx53(
|
|
4475
|
+
Button6,
|
|
4476
|
+
{
|
|
4477
|
+
buttonType: "ghostDestructive",
|
|
4478
|
+
size: "xs",
|
|
4479
|
+
disabled: selectedListItems.length === 0,
|
|
4480
|
+
onClick: handleRemoveAllSelectedItems,
|
|
4481
|
+
children: removeButtonText
|
|
4482
|
+
}
|
|
4483
|
+
)
|
|
4484
|
+
] })
|
|
4485
|
+
] }),
|
|
4486
|
+
!selectedListItems.length ? null : /* @__PURE__ */ jsx53(DragDropContext3, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx53(Droppable3, { droppableId: "canvas-multi-select", children: (provided) => /* @__PURE__ */ jsxs32("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
4487
|
+
/* @__PURE__ */ jsx53(VerticalRhythm2, { gap: "sm", children: selectedListItems.map((item, i) => {
|
|
4488
|
+
const renderListItem = renderResultComponent(item);
|
|
4489
|
+
return /* @__PURE__ */ jsx53(
|
|
4490
|
+
Draggable3,
|
|
4491
|
+
{
|
|
4492
|
+
draggableId: item.title,
|
|
4493
|
+
index: i,
|
|
4494
|
+
isDragDisabled: disableDnD,
|
|
4495
|
+
children: (provided2, snapshot) => /* @__PURE__ */ jsx53(
|
|
4496
|
+
"div",
|
|
4497
|
+
{
|
|
4498
|
+
ref: provided2.innerRef,
|
|
4499
|
+
"data-dragging": snapshot.isDragging,
|
|
4500
|
+
...provided2.draggableProps,
|
|
4501
|
+
...provided2.dragHandleProps,
|
|
4502
|
+
children: renderListItem
|
|
4503
|
+
}
|
|
4504
|
+
)
|
|
4505
|
+
},
|
|
4506
|
+
item.title
|
|
4507
|
+
);
|
|
4508
|
+
}) }),
|
|
4509
|
+
provided.placeholder
|
|
4510
|
+
] }) }) })
|
|
4511
|
+
] });
|
|
4512
|
+
};
|
|
4513
|
+
|
|
4514
|
+
// src/components/EntrySearch/QueryFilter.tsx
|
|
4515
|
+
import { Input as Input7, InputSelect as InputSelect7 } from "@uniformdev/design-system";
|
|
4516
|
+
import { useEffect as useEffect7, useState as useState11 } from "react";
|
|
4517
|
+
import { jsx as jsx54, jsxs as jsxs33 } from "@emotion/react/jsx-runtime";
|
|
4518
|
+
var QueryFilter = ({
|
|
4519
|
+
requireContentType,
|
|
4520
|
+
queryFilterTitle = "Configure Query",
|
|
4521
|
+
contentTypeLabel = "Filter by content type",
|
|
4522
|
+
typeSelectorAllTypesOptionText = "All content types",
|
|
4523
|
+
contentTypeOptions,
|
|
4524
|
+
countLabel = "Count",
|
|
4525
|
+
countValue = 5,
|
|
4526
|
+
sortLabel = "Sort",
|
|
4527
|
+
sortOptions,
|
|
4528
|
+
sortOrderLabel = "Sort Order",
|
|
4529
|
+
sortOrderOptions = [
|
|
4530
|
+
{
|
|
4531
|
+
name: "Ascending",
|
|
4532
|
+
id: "asc"
|
|
4533
|
+
},
|
|
4534
|
+
{
|
|
4535
|
+
name: "Descending",
|
|
4536
|
+
id: "desc"
|
|
4537
|
+
}
|
|
4538
|
+
],
|
|
4539
|
+
children
|
|
4540
|
+
}) => {
|
|
4541
|
+
var _a, _b;
|
|
4542
|
+
const { query, onSetQuery } = useEntrySearchContext();
|
|
4543
|
+
const [queryState, setQueryState] = useState11({
|
|
4544
|
+
contentType: "",
|
|
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__ */ jsx54("span", { css: EntrySearchFilterContainerLabel, children: queryFilterTitle }),
|
|
4558
|
+
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterContainer, children: [
|
|
4559
|
+
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("1fr minmax(100px, 0.2fr)"), children: [
|
|
4560
|
+
/* @__PURE__ */ jsx54(
|
|
4561
|
+
InputSelect7,
|
|
4562
|
+
{
|
|
4563
|
+
label: contentTypeLabel,
|
|
4564
|
+
options: [
|
|
4565
|
+
...!requireContentType ? [{ value: "", label: typeSelectorAllTypesOptionText }] : [],
|
|
4566
|
+
...contentTypeOptions ? contentTypeOptions.map((option) => {
|
|
4567
|
+
return { value: option.id, label: option.name };
|
|
4568
|
+
}) : []
|
|
4569
|
+
],
|
|
4570
|
+
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
4571
|
+
value: queryState.contentType
|
|
4572
|
+
}
|
|
4573
|
+
),
|
|
4574
|
+
/* @__PURE__ */ jsx54(
|
|
4575
|
+
Input7,
|
|
4576
|
+
{
|
|
4577
|
+
label: countLabel,
|
|
4578
|
+
type: "number",
|
|
4579
|
+
onChange: (e) => handleFilterChange({ count: e.target.value }),
|
|
4580
|
+
defaultValue: countValue,
|
|
4581
|
+
value: queryState.count
|
|
4582
|
+
}
|
|
4583
|
+
)
|
|
4584
|
+
] }),
|
|
4585
|
+
/* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("repeat(2, 1fr)"), children: [
|
|
4586
|
+
/* @__PURE__ */ jsx54(
|
|
4587
|
+
InputSelect7,
|
|
4588
|
+
{
|
|
4589
|
+
label: sortLabel,
|
|
4590
|
+
options: [
|
|
4591
|
+
{
|
|
4592
|
+
label: "Select a sort",
|
|
4593
|
+
value: ""
|
|
4594
|
+
},
|
|
4595
|
+
...sortOptions ? sortOptions.map((option) => {
|
|
4596
|
+
return { value: option.id, label: option.name };
|
|
4597
|
+
}) : []
|
|
4598
|
+
],
|
|
4599
|
+
onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
|
|
4600
|
+
value: queryState.sortBy
|
|
4601
|
+
}
|
|
4602
|
+
),
|
|
4603
|
+
/* @__PURE__ */ jsx54(
|
|
4604
|
+
InputSelect7,
|
|
4605
|
+
{
|
|
4606
|
+
label: sortOrderLabel,
|
|
4607
|
+
options: [
|
|
4608
|
+
...sortOrderOptions ? sortOrderOptions.map((option) => {
|
|
4609
|
+
return { value: option.id, label: option.name };
|
|
4610
|
+
}) : []
|
|
4611
|
+
],
|
|
4612
|
+
onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
|
|
4613
|
+
value: queryState.sortOrder
|
|
4614
|
+
}
|
|
4615
|
+
)
|
|
4616
|
+
] }),
|
|
4617
|
+
children
|
|
4618
|
+
] })
|
|
4619
|
+
] });
|
|
4620
|
+
};
|
|
4621
|
+
|
|
3898
4622
|
// src/components/MeshApp.tsx
|
|
3899
|
-
import { LoadingIndicator as
|
|
4623
|
+
import { LoadingIndicator as LoadingIndicator3, Theme as Theme2 } from "@uniformdev/design-system";
|
|
3900
4624
|
|
|
3901
4625
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
3902
4626
|
import { initializeUniformMeshSDK } from "@uniformdev/mesh-sdk";
|
|
3903
|
-
import { useEffect as
|
|
4627
|
+
import { useEffect as useEffect8, useRef as useRef10, useState as useState12 } from "react";
|
|
3904
4628
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
3905
|
-
const [error, setError] =
|
|
3906
|
-
const [sdk, setSdk] =
|
|
4629
|
+
const [error, setError] = useState12();
|
|
4630
|
+
const [sdk, setSdk] = useState12();
|
|
3907
4631
|
const initializationInProgress = useRef10(false);
|
|
3908
|
-
|
|
4632
|
+
useEffect8(
|
|
3909
4633
|
() => {
|
|
3910
4634
|
if (typeof window === "undefined" || sdk) {
|
|
3911
4635
|
return;
|
|
@@ -3938,7 +4662,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
|
3938
4662
|
};
|
|
3939
4663
|
|
|
3940
4664
|
// src/components/MeshApp.tsx
|
|
3941
|
-
import { jsx as
|
|
4665
|
+
import { jsx as jsx55, jsxs as jsxs34 } from "@emotion/react/jsx-runtime";
|
|
3942
4666
|
var MeshApp = ({
|
|
3943
4667
|
children,
|
|
3944
4668
|
loadingComponent,
|
|
@@ -3947,18 +4671,18 @@ var MeshApp = ({
|
|
|
3947
4671
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
3948
4672
|
if (initializing || !sdk) {
|
|
3949
4673
|
const LoadingComponent = loadingComponent;
|
|
3950
|
-
return LoadingComponent ? /* @__PURE__ */
|
|
4674
|
+
return LoadingComponent ? /* @__PURE__ */ jsx55(LoadingComponent, {}) : /* @__PURE__ */ jsx55(LoadingIndicator3, {});
|
|
3951
4675
|
}
|
|
3952
4676
|
if (error) {
|
|
3953
4677
|
const ErrorComponent = errorComponent;
|
|
3954
4678
|
if (ErrorComponent) {
|
|
3955
|
-
return /* @__PURE__ */
|
|
4679
|
+
return /* @__PURE__ */ jsx55(ErrorComponent, { error });
|
|
3956
4680
|
}
|
|
3957
4681
|
throw error;
|
|
3958
4682
|
}
|
|
3959
|
-
return /* @__PURE__ */
|
|
3960
|
-
/* @__PURE__ */
|
|
3961
|
-
/* @__PURE__ */
|
|
4683
|
+
return /* @__PURE__ */ jsxs34(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
|
|
4684
|
+
/* @__PURE__ */ jsx55(Theme2, {}),
|
|
4685
|
+
/* @__PURE__ */ jsx55(UniformMeshLocationContextProvider, { children })
|
|
3962
4686
|
] });
|
|
3963
4687
|
};
|
|
3964
4688
|
|
|
@@ -3982,17 +4706,17 @@ function createLocationValidator(setValue, validate) {
|
|
|
3982
4706
|
// src/index.ts
|
|
3983
4707
|
import {
|
|
3984
4708
|
AddListButton as AddListButton2,
|
|
3985
|
-
Button as
|
|
4709
|
+
Button as Button7,
|
|
3986
4710
|
Callout as Callout4,
|
|
3987
4711
|
Heading,
|
|
3988
|
-
Input as
|
|
4712
|
+
Input as Input8,
|
|
3989
4713
|
InputComboBox,
|
|
3990
|
-
InputKeywordSearch as InputKeywordSearch2,
|
|
3991
|
-
InputSelect as InputSelect6,
|
|
3992
|
-
InputToggle,
|
|
3993
4714
|
InputKeywordSearch as InputKeywordSearch3,
|
|
4715
|
+
InputSelect as InputSelect8,
|
|
4716
|
+
InputToggle,
|
|
4717
|
+
InputKeywordSearch as InputKeywordSearch4,
|
|
3994
4718
|
Label,
|
|
3995
|
-
LoadingIndicator as
|
|
4719
|
+
LoadingIndicator as LoadingIndicator4,
|
|
3996
4720
|
LoadingOverlay as LoadingOverlay2,
|
|
3997
4721
|
Menu as Menu3,
|
|
3998
4722
|
MenuItem as MenuItem3,
|
|
@@ -4010,7 +4734,7 @@ import {
|
|
|
4010
4734
|
ParameterTextareaInner,
|
|
4011
4735
|
ParameterToggle,
|
|
4012
4736
|
ParameterToggleInner,
|
|
4013
|
-
ScrollableList,
|
|
4737
|
+
ScrollableList as ScrollableList2,
|
|
4014
4738
|
ScrollableListItem,
|
|
4015
4739
|
Switch,
|
|
4016
4740
|
Textarea,
|
|
@@ -4019,26 +4743,38 @@ import {
|
|
|
4019
4743
|
export * from "@uniformdev/mesh-sdk";
|
|
4020
4744
|
export {
|
|
4021
4745
|
AddListButton2 as AddListButton,
|
|
4022
|
-
|
|
4746
|
+
Button7 as Button,
|
|
4023
4747
|
Callout4 as Callout,
|
|
4024
4748
|
DamSelectedItem,
|
|
4749
|
+
DataRefreshButton,
|
|
4025
4750
|
DataResourceVariablesList,
|
|
4026
4751
|
DataSourceEditor,
|
|
4027
4752
|
DataTypeEditor,
|
|
4028
4753
|
DefaultSearchRow,
|
|
4029
4754
|
DefaultSelectedItem,
|
|
4030
4755
|
EntrySearch,
|
|
4756
|
+
EntrySearchContainer,
|
|
4757
|
+
EntrySearchContext,
|
|
4758
|
+
EntrySearchFilter,
|
|
4759
|
+
EntrySearchFilterContainer2 as EntrySearchFilterContainer,
|
|
4760
|
+
EntrySearchListItem,
|
|
4761
|
+
EntrySearchListItemLoadingSkeleton,
|
|
4762
|
+
EntrySearchProvider,
|
|
4763
|
+
EntrySearchResultItem,
|
|
4764
|
+
EntrySearchResultItemButton,
|
|
4765
|
+
EntrySearchResultList,
|
|
4031
4766
|
Heading,
|
|
4032
4767
|
icons_exports as Icons,
|
|
4033
|
-
|
|
4768
|
+
Input8 as Input,
|
|
4034
4769
|
InputComboBox,
|
|
4035
|
-
|
|
4036
|
-
|
|
4770
|
+
InputKeywordSearch3 as InputKeywordSearch,
|
|
4771
|
+
InputSelect8 as InputSelect,
|
|
4037
4772
|
InputToggle,
|
|
4038
4773
|
InputVariables,
|
|
4039
|
-
|
|
4774
|
+
InputKeywordSearch4 as KeywordSearchInput,
|
|
4040
4775
|
Label,
|
|
4041
|
-
|
|
4776
|
+
LinkButton,
|
|
4777
|
+
LoadingIndicator4 as LoadingIndicator,
|
|
4042
4778
|
LoadingOverlay2 as LoadingOverlay,
|
|
4043
4779
|
Menu3 as Menu,
|
|
4044
4780
|
MenuItem3 as MenuItem,
|
|
@@ -4065,6 +4801,8 @@ export {
|
|
|
4065
4801
|
ProductSearchContext,
|
|
4066
4802
|
ProductSearchRow,
|
|
4067
4803
|
ProductSelectedItem,
|
|
4804
|
+
PublishStatus,
|
|
4805
|
+
QueryFilter,
|
|
4068
4806
|
RequestBody,
|
|
4069
4807
|
RequestHeaders,
|
|
4070
4808
|
RequestMethodSelect,
|
|
@@ -4074,7 +4812,7 @@ export {
|
|
|
4074
4812
|
RequestUrl,
|
|
4075
4813
|
RequestUrlInput,
|
|
4076
4814
|
ResolvableLoadingValue,
|
|
4077
|
-
ScrollableList,
|
|
4815
|
+
ScrollableList2 as ScrollableList,
|
|
4078
4816
|
ScrollableListItem,
|
|
4079
4817
|
SelectionField,
|
|
4080
4818
|
Switch,
|
|
@@ -4153,6 +4891,7 @@ export {
|
|
|
4153
4891
|
selectedItemTitle,
|
|
4154
4892
|
urlEncodeRequestParameter,
|
|
4155
4893
|
urlEncodeRequestUrl,
|
|
4894
|
+
useEntrySearchContext,
|
|
4156
4895
|
useInitializeUniformMeshSdk,
|
|
4157
4896
|
useMeshLocation,
|
|
4158
4897
|
useParameterShell,
|