@uniformdev/mesh-sdk-react 18.28.0 → 18.30.1-alpha.15
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 +338 -13
- package/dist/index.esm.js +748 -34
- package/dist/index.js +787 -59
- package/dist/index.mjs +748 -34
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -31,46 +31,58 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
// src/index.ts
|
|
32
32
|
var src_exports = {};
|
|
33
33
|
__export(src_exports, {
|
|
34
|
-
AddListButton: () =>
|
|
35
|
-
Button: () =>
|
|
36
|
-
Callout: () =>
|
|
34
|
+
AddListButton: () => import_design_system34.AddListButton,
|
|
35
|
+
Button: () => import_design_system34.Button,
|
|
36
|
+
Callout: () => import_design_system34.Callout,
|
|
37
37
|
DamSelectedItem: () => DamSelectedItem,
|
|
38
|
+
DataRefreshButton: () => DataRefreshButton,
|
|
38
39
|
DataResourceVariablesList: () => DataResourceVariablesList,
|
|
39
40
|
DataSourceEditor: () => DataSourceEditor,
|
|
40
41
|
DataTypeEditor: () => DataTypeEditor,
|
|
41
42
|
DefaultSearchRow: () => DefaultSearchRow,
|
|
42
43
|
DefaultSelectedItem: () => DefaultSelectedItem,
|
|
43
44
|
EntrySearch: () => EntrySearch,
|
|
44
|
-
|
|
45
|
+
EntrySearchContainer: () => EntrySearchContainer,
|
|
46
|
+
EntrySearchContext: () => EntrySearchContext,
|
|
47
|
+
EntrySearchFilter: () => EntrySearchFilter,
|
|
48
|
+
EntrySearchFilterContainer: () => EntrySearchFilterContainer2,
|
|
49
|
+
EntrySearchListItem: () => EntrySearchListItem,
|
|
50
|
+
EntrySearchListItemLoadingSkeleton: () => EntrySearchListItemLoadingSkeleton,
|
|
51
|
+
EntrySearchProvider: () => EntrySearchProvider,
|
|
52
|
+
EntrySearchResultItem: () => EntrySearchResultItem,
|
|
53
|
+
EntrySearchResultItemButton: () => EntrySearchResultItemButton,
|
|
54
|
+
EntrySearchResultList: () => EntrySearchResultList,
|
|
55
|
+
Heading: () => import_design_system34.Heading,
|
|
45
56
|
Icons: () => icons_exports,
|
|
46
|
-
Input: () =>
|
|
47
|
-
InputComboBox: () =>
|
|
48
|
-
InputKeywordSearch: () =>
|
|
49
|
-
InputSelect: () =>
|
|
50
|
-
InputToggle: () =>
|
|
57
|
+
Input: () => import_design_system34.Input,
|
|
58
|
+
InputComboBox: () => import_design_system34.InputComboBox,
|
|
59
|
+
InputKeywordSearch: () => import_design_system34.InputKeywordSearch,
|
|
60
|
+
InputSelect: () => import_design_system34.InputSelect,
|
|
61
|
+
InputToggle: () => import_design_system34.InputToggle,
|
|
51
62
|
InputVariables: () => InputVariables,
|
|
52
|
-
KeywordSearchInput: () =>
|
|
53
|
-
Label: () =>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
KeywordSearchInput: () => import_design_system34.InputKeywordSearch,
|
|
64
|
+
Label: () => import_design_system34.Label,
|
|
65
|
+
LinkButton: () => LinkButton,
|
|
66
|
+
LoadingIndicator: () => import_design_system34.LoadingIndicator,
|
|
67
|
+
LoadingOverlay: () => import_design_system34.LoadingOverlay,
|
|
68
|
+
Menu: () => import_design_system34.Menu,
|
|
69
|
+
MenuItem: () => import_design_system34.MenuItem,
|
|
58
70
|
MeshApp: () => MeshApp,
|
|
59
|
-
ParameterGroup: () =>
|
|
60
|
-
ParameterImage: () =>
|
|
61
|
-
ParameterImageInner: () =>
|
|
62
|
-
ParameterInput: () =>
|
|
63
|
-
ParameterInputInner: () =>
|
|
64
|
-
ParameterLabel: () =>
|
|
65
|
-
ParameterMenuButton: () =>
|
|
66
|
-
ParameterSelect: () =>
|
|
67
|
-
ParameterSelectInner: () =>
|
|
68
|
-
ParameterShell: () =>
|
|
69
|
-
ParameterShellContext: () =>
|
|
70
|
-
ParameterTextarea: () =>
|
|
71
|
-
ParameterTextareaInner: () =>
|
|
72
|
-
ParameterToggle: () =>
|
|
73
|
-
ParameterToggleInner: () =>
|
|
71
|
+
ParameterGroup: () => import_design_system34.ParameterGroup,
|
|
72
|
+
ParameterImage: () => import_design_system34.ParameterImage,
|
|
73
|
+
ParameterImageInner: () => import_design_system34.ParameterImageInner,
|
|
74
|
+
ParameterInput: () => import_design_system34.ParameterInput,
|
|
75
|
+
ParameterInputInner: () => import_design_system34.ParameterInputInner,
|
|
76
|
+
ParameterLabel: () => import_design_system34.ParameterLabel,
|
|
77
|
+
ParameterMenuButton: () => import_design_system34.ParameterMenuButton,
|
|
78
|
+
ParameterSelect: () => import_design_system34.ParameterSelect,
|
|
79
|
+
ParameterSelectInner: () => import_design_system34.ParameterSelectInner,
|
|
80
|
+
ParameterShell: () => import_design_system34.ParameterShell,
|
|
81
|
+
ParameterShellContext: () => import_design_system33.ParameterShellContext,
|
|
82
|
+
ParameterTextarea: () => import_design_system34.ParameterTextarea,
|
|
83
|
+
ParameterTextareaInner: () => import_design_system34.ParameterTextareaInner,
|
|
84
|
+
ParameterToggle: () => import_design_system34.ParameterToggle,
|
|
85
|
+
ParameterToggleInner: () => import_design_system34.ParameterToggleInner,
|
|
74
86
|
ProductPreviewList: () => ProductPreviewList,
|
|
75
87
|
ProductQuery: () => ProductQuery,
|
|
76
88
|
ProductQueryContext: () => ProductQueryContext,
|
|
@@ -78,6 +90,7 @@ __export(src_exports, {
|
|
|
78
90
|
ProductSearchContext: () => ProductSearchContext,
|
|
79
91
|
ProductSearchRow: () => ProductSearchRow,
|
|
80
92
|
ProductSelectedItem: () => ProductSelectedItem,
|
|
93
|
+
QueryFilter: () => QueryFilter,
|
|
81
94
|
RequestBody: () => RequestBody,
|
|
82
95
|
RequestHeaders: () => RequestHeaders,
|
|
83
96
|
RequestMethodSelect: () => RequestMethodSelect,
|
|
@@ -87,13 +100,13 @@ __export(src_exports, {
|
|
|
87
100
|
RequestUrl: () => RequestUrl,
|
|
88
101
|
RequestUrlInput: () => RequestUrlInput,
|
|
89
102
|
ResolvableLoadingValue: () => ResolvableLoadingValue,
|
|
90
|
-
ScrollableList: () =>
|
|
91
|
-
ScrollableListItem: () =>
|
|
103
|
+
ScrollableList: () => import_design_system34.ScrollableList,
|
|
104
|
+
ScrollableListItem: () => import_design_system34.ScrollableListItem,
|
|
92
105
|
SelectionField: () => SelectionField,
|
|
93
|
-
Switch: () =>
|
|
106
|
+
Switch: () => import_design_system34.Switch,
|
|
94
107
|
TextVariableRenderer: () => TextVariableRenderer,
|
|
95
|
-
Textarea: () =>
|
|
96
|
-
Theme: () =>
|
|
108
|
+
Textarea: () => import_design_system34.Textarea,
|
|
109
|
+
Theme: () => import_design_system34.Theme,
|
|
97
110
|
UniformMeshLocationContext: () => UniformMeshLocationContext,
|
|
98
111
|
UniformMeshLocationContextProvider: () => UniformMeshLocationContextProvider,
|
|
99
112
|
UniformMeshSdkContext: () => UniformMeshSdkContext,
|
|
@@ -166,9 +179,10 @@ __export(src_exports, {
|
|
|
166
179
|
selectedItemTitle: () => selectedItemTitle,
|
|
167
180
|
urlEncodeRequestParameter: () => urlEncodeRequestParameter,
|
|
168
181
|
urlEncodeRequestUrl: () => urlEncodeRequestUrl,
|
|
182
|
+
useEntrySearchContext: () => useEntrySearchContext,
|
|
169
183
|
useInitializeUniformMeshSdk: () => useInitializeUniformMeshSdk,
|
|
170
184
|
useMeshLocation: () => useMeshLocation,
|
|
171
|
-
useParameterShell: () =>
|
|
185
|
+
useParameterShell: () => import_design_system33.useParameterShell,
|
|
172
186
|
useProductQueryContext: () => useProductQueryContext,
|
|
173
187
|
useProductSearchContext: () => useProductSearchContext,
|
|
174
188
|
useRequest: () => useRequest,
|
|
@@ -1134,12 +1148,12 @@ var import_design_system10 = require("@uniformdev/design-system");
|
|
|
1134
1148
|
var import_react21 = __toESM(require("react"));
|
|
1135
1149
|
var import_react_use3 = require("react-use");
|
|
1136
1150
|
|
|
1137
|
-
// src/components/EntrySearch/DefaultSearchRow.tsx
|
|
1151
|
+
// src/components/legacy/EntrySearch/DefaultSearchRow.tsx
|
|
1138
1152
|
var import_react9 = require("@emotion/react");
|
|
1139
1153
|
var import_design_system4 = require("@uniformdev/design-system");
|
|
1140
1154
|
var import_react10 = require("react");
|
|
1141
1155
|
|
|
1142
|
-
// src/components/EntrySearch/styles/DefaultSearchRow.styles.ts
|
|
1156
|
+
// src/components/legacy/EntrySearch/styles/DefaultSearchRow.styles.ts
|
|
1143
1157
|
var import_react8 = require("@emotion/react");
|
|
1144
1158
|
var searchRowContainer = import_react8.css`
|
|
1145
1159
|
cursor: pointer;
|
|
@@ -1180,7 +1194,7 @@ var searchRowBtn = import_react8.css`
|
|
|
1180
1194
|
inset: 0 var(--spacing-sm) 0 auto;
|
|
1181
1195
|
`;
|
|
1182
1196
|
|
|
1183
|
-
// src/components/EntrySearch/DefaultSearchRow.tsx
|
|
1197
|
+
// src/components/legacy/EntrySearch/DefaultSearchRow.tsx
|
|
1184
1198
|
var import_jsx_runtime19 = require("@emotion/react/jsx-runtime");
|
|
1185
1199
|
var DefaultSearchRow = ({ result, isSelected, triggerSelection }) => {
|
|
1186
1200
|
const popoverRef = (0, import_react10.useRef)(null);
|
|
@@ -1254,7 +1268,7 @@ var DefaultSearchRow = ({ result, isSelected, triggerSelection }) => {
|
|
|
1254
1268
|
);
|
|
1255
1269
|
};
|
|
1256
1270
|
|
|
1257
|
-
// src/components/EntrySearch/DefaultSelectedItem.tsx
|
|
1271
|
+
// src/components/legacy/EntrySearch/DefaultSelectedItem.tsx
|
|
1258
1272
|
var import_react12 = require("@emotion/react");
|
|
1259
1273
|
var import_design_system6 = require("@uniformdev/design-system");
|
|
1260
1274
|
var import_react13 = require("react");
|
|
@@ -1272,7 +1286,7 @@ function openWindowWithCloseCallback(href, callback) {
|
|
|
1272
1286
|
}, 500);
|
|
1273
1287
|
}
|
|
1274
1288
|
|
|
1275
|
-
// src/components/EntrySearch/styles/DefaultSelectedItem.styles.ts
|
|
1289
|
+
// src/components/legacy/EntrySearch/styles/DefaultSelectedItem.styles.ts
|
|
1276
1290
|
var import_react11 = require("@emotion/react");
|
|
1277
1291
|
var import_design_system5 = require("@uniformdev/design-system");
|
|
1278
1292
|
var selectedItemContainer = import_react11.css`
|
|
@@ -1356,7 +1370,7 @@ var selectItemLinkBtn = import_react11.css`
|
|
|
1356
1370
|
}
|
|
1357
1371
|
`;
|
|
1358
1372
|
|
|
1359
|
-
// src/components/EntrySearch/DefaultSelectedItem.tsx
|
|
1373
|
+
// src/components/legacy/EntrySearch/DefaultSelectedItem.tsx
|
|
1360
1374
|
var import_jsx_runtime20 = require("@emotion/react/jsx-runtime");
|
|
1361
1375
|
var DefaultSelectedItem = ({
|
|
1362
1376
|
selectedItem,
|
|
@@ -1539,7 +1553,7 @@ var DefaultSelectedItem = ({
|
|
|
1539
1553
|
] }) }, selectedItem.id);
|
|
1540
1554
|
};
|
|
1541
1555
|
|
|
1542
|
-
// src/components/EntrySearch/EntrySearch.tsx
|
|
1556
|
+
// src/components/legacy/EntrySearch/EntrySearch.tsx
|
|
1543
1557
|
var import_react16 = require("@emotion/react");
|
|
1544
1558
|
var import_design_system7 = require("@uniformdev/design-system");
|
|
1545
1559
|
var React5 = __toESM(require("react"));
|
|
@@ -1580,7 +1594,7 @@ function useLoadingDelay(loading, { delay = 500, minDuration = 200 } = {
|
|
|
1580
1594
|
return state === "DISPLAY" || state === "EXPIRE";
|
|
1581
1595
|
}
|
|
1582
1596
|
|
|
1583
|
-
// src/components/EntrySearch/styles/EntrySearch.styles.ts
|
|
1597
|
+
// src/components/legacy/EntrySearch/styles/EntrySearch.styles.ts
|
|
1584
1598
|
var import_react15 = require("@emotion/react");
|
|
1585
1599
|
var entrySearchWrapper = import_react15.css`
|
|
1586
1600
|
background: var(--white);
|
|
@@ -1691,7 +1705,7 @@ var badgeIcon = import_react15.css`
|
|
|
1691
1705
|
height: calc(var(--spacing-lg) + var(--spacing-xs));
|
|
1692
1706
|
`;
|
|
1693
1707
|
|
|
1694
|
-
// src/components/EntrySearch/EntrySearch.tsx
|
|
1708
|
+
// src/components/legacy/EntrySearch/EntrySearch.tsx
|
|
1695
1709
|
var import_jsx_runtime21 = require("@emotion/react/jsx-runtime");
|
|
1696
1710
|
var DefaultNoResults = ({ searchText, selectedContentType }) => {
|
|
1697
1711
|
let message = "No content found";
|
|
@@ -4036,17 +4050,717 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
4036
4050
|
};
|
|
4037
4051
|
}
|
|
4038
4052
|
|
|
4039
|
-
// src/components/
|
|
4053
|
+
// src/components/EntrySearch/DataRefreshButton.tsx
|
|
4054
|
+
var import_react38 = require("@emotion/react");
|
|
4040
4055
|
var import_design_system23 = require("@uniformdev/design-system");
|
|
4056
|
+
var import_jsx_runtime44 = require("@emotion/react/jsx-runtime");
|
|
4057
|
+
var DataRefreshButton = ({
|
|
4058
|
+
buttonText,
|
|
4059
|
+
isLoading,
|
|
4060
|
+
onRefreshData,
|
|
4061
|
+
...props
|
|
4062
|
+
}) => {
|
|
4063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_design_system23.Button, { buttonType: "primaryInvert", onClick: onRefreshData, disabled: isLoading, ...props, children: [
|
|
4064
|
+
!isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4065
|
+
import_design_system23.LoadingIndicator,
|
|
4066
|
+
{
|
|
4067
|
+
css: import_react38.css`
|
|
4068
|
+
${isLoading ? "opacity: 0.2;" : void 0}
|
|
4069
|
+
`
|
|
4070
|
+
}
|
|
4071
|
+
),
|
|
4072
|
+
buttonText
|
|
4073
|
+
] });
|
|
4074
|
+
};
|
|
4075
|
+
|
|
4076
|
+
// src/components/EntrySearch/EntrySearchContainer.tsx
|
|
4077
|
+
var import_design_system24 = require("@uniformdev/design-system");
|
|
4078
|
+
|
|
4079
|
+
// src/components/EntrySearch/styles/EntrySearchContainer.styles.ts
|
|
4080
|
+
var import_react39 = require("@emotion/react");
|
|
4081
|
+
var EntrySearchBtnGroup = import_react39.css`
|
|
4082
|
+
align-items: center;
|
|
4083
|
+
display: flex;
|
|
4084
|
+
gap: var(--spacing-sm);
|
|
4085
|
+
`;
|
|
4086
|
+
|
|
4087
|
+
// src/components/EntrySearch/EntrySearchContainer.tsx
|
|
4088
|
+
var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
|
|
4089
|
+
var EntrySearchContainer = ({
|
|
4090
|
+
searchFilters,
|
|
4091
|
+
resultList,
|
|
4092
|
+
onSave,
|
|
4093
|
+
onCancel,
|
|
4094
|
+
children
|
|
4095
|
+
}) => {
|
|
4096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system24.IconsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system24.VerticalRhythm, { children: [
|
|
4097
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system24.Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_design_system24.VerticalRhythm, { children: [
|
|
4098
|
+
searchFilters,
|
|
4099
|
+
!resultList ? null : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system24.ScrollableList, { role: "list", children: resultList })
|
|
4100
|
+
] }) }),
|
|
4101
|
+
children,
|
|
4102
|
+
!onSave && !onCancel ? null : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { css: EntrySearchBtnGroup, children: [
|
|
4103
|
+
!onSave ? null : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system24.Button, { buttonType: "primary", onClick: onSave, children: "Save" }),
|
|
4104
|
+
!onCancel ? null : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system24.Button, { buttonType: "ghostDestructive", onClick: onCancel, children: "Cancel" })
|
|
4105
|
+
] })
|
|
4106
|
+
] }) });
|
|
4107
|
+
};
|
|
4108
|
+
|
|
4109
|
+
// src/components/EntrySearch/EntrySearchFilter.tsx
|
|
4110
|
+
var import_design_system25 = require("@uniformdev/design-system");
|
|
4111
|
+
var import_react42 = require("react");
|
|
4112
|
+
|
|
4113
|
+
// src/components/EntrySearch/hooks/EntrySearchContext.tsx
|
|
4114
|
+
var import_react40 = require("react");
|
|
4115
|
+
var import_jsx_runtime46 = require("@emotion/react/jsx-runtime");
|
|
4116
|
+
var EntrySearchContext = (0, import_react40.createContext)({
|
|
4117
|
+
onSetQuery: () => {
|
|
4118
|
+
},
|
|
4119
|
+
onSelectItem: () => {
|
|
4120
|
+
},
|
|
4121
|
+
query: {
|
|
4122
|
+
contentType: "",
|
|
4123
|
+
keywordSearch: ""
|
|
4124
|
+
},
|
|
4125
|
+
list: {},
|
|
4126
|
+
onSetList: () => {
|
|
4127
|
+
},
|
|
4128
|
+
selectedListItems: [],
|
|
4129
|
+
onRemoveAllSelectedItems: () => {
|
|
4130
|
+
}
|
|
4131
|
+
});
|
|
4132
|
+
var EntrySearchProvider = ({ currentlySelectedItems, children }) => {
|
|
4133
|
+
const [query, setQuery] = (0, import_react40.useState)({
|
|
4134
|
+
contentType: "",
|
|
4135
|
+
keywordSearch: ""
|
|
4136
|
+
});
|
|
4137
|
+
const querySearchDeferred = (0, import_react40.useDeferredValue)(query);
|
|
4138
|
+
const [selectedItems, setSelectedItems] = (0, import_react40.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
4139
|
+
const [list, setList] = (0, import_react40.useState)({});
|
|
4140
|
+
const onSetQuery = (0, import_react40.useCallback)(
|
|
4141
|
+
(value) => {
|
|
4142
|
+
setQuery(value);
|
|
4143
|
+
},
|
|
4144
|
+
[setQuery]
|
|
4145
|
+
);
|
|
4146
|
+
const onSelectItem = (0, import_react40.useCallback)(
|
|
4147
|
+
(selectedResult) => {
|
|
4148
|
+
if (Array.isArray(selectedResult)) {
|
|
4149
|
+
setSelectedItems(selectedResult);
|
|
4150
|
+
} else {
|
|
4151
|
+
if (selectedItems.some((item) => item.id === selectedResult.id)) {
|
|
4152
|
+
setSelectedItems((prev) => prev.filter((item) => item.id !== selectedResult.id));
|
|
4153
|
+
} else {
|
|
4154
|
+
setSelectedItems((prev) => [...prev, selectedResult]);
|
|
4155
|
+
}
|
|
4156
|
+
}
|
|
4157
|
+
},
|
|
4158
|
+
[setSelectedItems, selectedItems]
|
|
4159
|
+
);
|
|
4160
|
+
const onRemoveAllSelectedItems = (0, import_react40.useCallback)(() => {
|
|
4161
|
+
setSelectedItems([]);
|
|
4162
|
+
}, [setSelectedItems]);
|
|
4163
|
+
const onSetList = (0, import_react40.useCallback)(
|
|
4164
|
+
(value) => {
|
|
4165
|
+
setList(value);
|
|
4166
|
+
},
|
|
4167
|
+
[setList]
|
|
4168
|
+
);
|
|
4169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4170
|
+
EntrySearchContext.Provider,
|
|
4171
|
+
{
|
|
4172
|
+
value: {
|
|
4173
|
+
onSetQuery,
|
|
4174
|
+
query: querySearchDeferred,
|
|
4175
|
+
onSelectItem,
|
|
4176
|
+
selectedListItems: selectedItems,
|
|
4177
|
+
onRemoveAllSelectedItems,
|
|
4178
|
+
list,
|
|
4179
|
+
onSetList
|
|
4180
|
+
},
|
|
4181
|
+
children
|
|
4182
|
+
}
|
|
4183
|
+
);
|
|
4184
|
+
};
|
|
4185
|
+
var useEntrySearchContext = () => {
|
|
4186
|
+
const contextValues = (0, import_react40.useContext)(EntrySearchContext);
|
|
4187
|
+
return { ...contextValues };
|
|
4188
|
+
};
|
|
4189
|
+
|
|
4190
|
+
// src/components/EntrySearch/styles/EntrySearchFilterContainer.styles.ts
|
|
4191
|
+
var import_react41 = require("@emotion/react");
|
|
4192
|
+
var EntrySearchFilterContainerLabel = import_react41.css`
|
|
4193
|
+
align-items: center;
|
|
4194
|
+
display: flex;
|
|
4195
|
+
font-size: var(--fs-sm);
|
|
4196
|
+
font-weight: var(--fw-bold);
|
|
4197
|
+
line-height: 1rem;
|
|
4198
|
+
margin-bottom: var(--spacing-sm);
|
|
4199
|
+
`;
|
|
4200
|
+
var EntrySearchFilterContainer = import_react41.css`
|
|
4201
|
+
display: grid;
|
|
4202
|
+
gap: var(--spacing-base);
|
|
4203
|
+
`;
|
|
4204
|
+
var EntrySearchFilterDropdownAndTextSearch = import_react41.css`
|
|
4205
|
+
grid-template-columns: 0.5fr 1fr;
|
|
4206
|
+
`;
|
|
4207
|
+
var EntrySearchFilterGrid = (gridColumns) => import_react41.css`
|
|
4208
|
+
display: grid;
|
|
4209
|
+
grid-template-columns: ${gridColumns};
|
|
4210
|
+
gap: var(--spacing-base);
|
|
4211
|
+
`;
|
|
4212
|
+
|
|
4213
|
+
// src/components/EntrySearch/EntrySearchFilter.tsx
|
|
4214
|
+
var import_jsx_runtime47 = require("@emotion/react/jsx-runtime");
|
|
4215
|
+
var EntrySearchFilter = ({
|
|
4216
|
+
requireContentType,
|
|
4217
|
+
typeSelectorAllTypesOptionText = "All content types",
|
|
4218
|
+
searchInputName = "searchText",
|
|
4219
|
+
searchInputPlaceholderText = "Enter keyword to narrow your results",
|
|
4220
|
+
selectLabel = "Content Type Select",
|
|
4221
|
+
selectOptions
|
|
4222
|
+
}) => {
|
|
4223
|
+
const { query, onSetQuery } = useEntrySearchContext();
|
|
4224
|
+
const [searchState, setSearchState] = (0, import_react42.useState)({
|
|
4225
|
+
contentType: "any",
|
|
4226
|
+
keywordSearch: ""
|
|
4227
|
+
});
|
|
4228
|
+
const handleFilterChange = (value) => {
|
|
4229
|
+
setSearchState((prev) => {
|
|
4230
|
+
return { ...prev, ...value };
|
|
4231
|
+
});
|
|
4232
|
+
onSetQuery({ ...query, ...value });
|
|
4233
|
+
};
|
|
4234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("fieldset", { css: [EntrySearchFilterContainer, EntrySearchFilterDropdownAndTextSearch], children: [
|
|
4235
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4236
|
+
import_design_system25.InputSelect,
|
|
4237
|
+
{
|
|
4238
|
+
label: selectLabel,
|
|
4239
|
+
showLabel: false,
|
|
4240
|
+
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
4241
|
+
options: [
|
|
4242
|
+
...!requireContentType ? [{ value: "any", label: typeSelectorAllTypesOptionText }] : [],
|
|
4243
|
+
...selectOptions ? selectOptions.map((option) => {
|
|
4244
|
+
return { value: option.id, label: option.name };
|
|
4245
|
+
}) : []
|
|
4246
|
+
],
|
|
4247
|
+
value: searchState.contentType
|
|
4248
|
+
}
|
|
4249
|
+
),
|
|
4250
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4251
|
+
import_design_system25.InputKeywordSearch,
|
|
4252
|
+
{
|
|
4253
|
+
inputFieldName: searchInputName,
|
|
4254
|
+
placeholder: searchInputPlaceholderText,
|
|
4255
|
+
onSearchTextChanged: (e) => handleFilterChange({ keywordSearch: e }),
|
|
4256
|
+
disabledFieldSubmission: true,
|
|
4257
|
+
onClear: () => handleFilterChange({ keywordSearch: "" }),
|
|
4258
|
+
value: searchState.keywordSearch
|
|
4259
|
+
}
|
|
4260
|
+
)
|
|
4261
|
+
] });
|
|
4262
|
+
};
|
|
4263
|
+
|
|
4264
|
+
// src/components/EntrySearch/EntrySearchFilterContainer.tsx
|
|
4265
|
+
var import_jsx_runtime48 = require("@emotion/react/jsx-runtime");
|
|
4266
|
+
var EntrySearchFilterContainer2 = ({ label, children }) => {
|
|
4267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { children: [
|
|
4268
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { css: EntrySearchFilterContainerLabel, children: label }),
|
|
4269
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { css: EntrySearchFilterContainer, children })
|
|
4270
|
+
] });
|
|
4271
|
+
};
|
|
4272
|
+
|
|
4273
|
+
// src/components/EntrySearch/EntrySearchListItem.tsx
|
|
4274
|
+
var import_design_system27 = require("@uniformdev/design-system");
|
|
4275
|
+
|
|
4276
|
+
// src/components/EntrySearch/styles/EntrySearchListItem.styles.ts
|
|
4277
|
+
var import_react43 = require("@emotion/react");
|
|
4278
|
+
var import_design_system26 = require("@uniformdev/design-system");
|
|
4279
|
+
var EntryListItemContainer = import_react43.css`
|
|
4280
|
+
align-items: center;
|
|
4281
|
+
border: 1px solid var(--gray-300);
|
|
4282
|
+
border-radius: var(--rounded-base);
|
|
4283
|
+
background: var(--white);
|
|
4284
|
+
display: grid;
|
|
4285
|
+
grid-template-columns: 1fr 32px;
|
|
4286
|
+
padding: var(--spacing-sm);
|
|
4287
|
+
|
|
4288
|
+
&[hidden] {
|
|
4289
|
+
display: none;
|
|
4290
|
+
}
|
|
4291
|
+
`;
|
|
4292
|
+
var EntryListItemLoading = import_react43.css`
|
|
4293
|
+
animation: ${import_design_system26.skeletonLoading} 1s linear infinite alternate;
|
|
4294
|
+
border-color: transparent;
|
|
4295
|
+
min-height: 42px;
|
|
4296
|
+
position: relative;
|
|
4297
|
+
|
|
4298
|
+
&:before,
|
|
4299
|
+
&:after {
|
|
4300
|
+
background: var(--gray-200);
|
|
4301
|
+
content: '';
|
|
4302
|
+
display: block;
|
|
4303
|
+
height: 1rem;
|
|
4304
|
+
}
|
|
4305
|
+
|
|
4306
|
+
&:before {
|
|
4307
|
+
border-radius: var(--rounded-base);
|
|
4308
|
+
width: 10rem;
|
|
4309
|
+
}
|
|
4310
|
+
|
|
4311
|
+
&:after {
|
|
4312
|
+
border-radius: var(--rounded-full);
|
|
4313
|
+
width: 1rem;
|
|
4314
|
+
}
|
|
4315
|
+
`;
|
|
4316
|
+
var EntryListItemHeadingGroup = import_react43.css`
|
|
4317
|
+
align-items: center;
|
|
4318
|
+
display: grid;
|
|
4319
|
+
`;
|
|
4320
|
+
var EntryListItemTitle = import_react43.css`
|
|
4321
|
+
color: var(--brand-secondary-1);
|
|
4322
|
+
display: block;
|
|
4323
|
+
font-size: var(--fs-sm);
|
|
4324
|
+
`;
|
|
4325
|
+
var EntryListItemSubtitle = import_react43.css`
|
|
4326
|
+
color: var(--gray-500);
|
|
4327
|
+
display: block;
|
|
4328
|
+
font-size: var(--fs-xs);
|
|
4329
|
+
line-height: 1;
|
|
4330
|
+
`;
|
|
4331
|
+
var EntryListItemInfoContainer = import_react43.css`
|
|
4332
|
+
align-items: center;
|
|
4333
|
+
display: flex;
|
|
4334
|
+
justify-content: center;
|
|
4335
|
+
`;
|
|
4336
|
+
var EntryListItemControlledContent = import_react43.css`
|
|
4337
|
+
display: flex;
|
|
4338
|
+
gap: var(--spacing-sm);
|
|
4339
|
+
`;
|
|
4340
|
+
var EntryListItemUnControlledContent = import_react43.css`
|
|
4341
|
+
margin-top: var(--spacing-sm);
|
|
4342
|
+
grid-column: 1 / -1;
|
|
4343
|
+
`;
|
|
4344
|
+
|
|
4345
|
+
// src/components/EntrySearch/EntrySearchListItem.tsx
|
|
4346
|
+
var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
|
|
4347
|
+
var EntrySearchListItem = ({
|
|
4348
|
+
id,
|
|
4349
|
+
title,
|
|
4350
|
+
contentType,
|
|
4351
|
+
image,
|
|
4352
|
+
popoverData,
|
|
4353
|
+
onSelect,
|
|
4354
|
+
isMulti = false,
|
|
4355
|
+
children,
|
|
4356
|
+
...props
|
|
4357
|
+
}) => {
|
|
4358
|
+
const { onSelectItem, selectedListItems } = useEntrySearchContext();
|
|
4359
|
+
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
4360
|
+
const handleSelectItem = () => {
|
|
4361
|
+
var _a;
|
|
4362
|
+
const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
|
|
4363
|
+
const selectedItem = { id, title, contentType, image, popoverData, ...extraData };
|
|
4364
|
+
if (isMulti) {
|
|
4365
|
+
return onSelectItem(selectedItem);
|
|
4366
|
+
}
|
|
4367
|
+
return onSelectItem([selectedItem]);
|
|
4368
|
+
};
|
|
4369
|
+
const hideWhenInSelectedList = selectedListItems.some((item) => item.id === id);
|
|
4370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { role: "listitem", hidden: hideWhenInSelectedList, css: EntryListItemContainer, ...props, children: [
|
|
4371
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { role: "button", onClick: handleSelectItem, css: EntryListItemControlledContent, children: [
|
|
4372
|
+
!image ? null : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
|
|
4373
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { role: "heading", css: EntryListItemHeadingGroup, children: [
|
|
4374
|
+
!contentType ? null : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { css: EntryListItemSubtitle, children: formatedContentType }),
|
|
4375
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { css: EntryListItemTitle, children: title })
|
|
4376
|
+
] })
|
|
4377
|
+
] }),
|
|
4378
|
+
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { css: EntryListItemInfoContainer, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system27.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData }) }),
|
|
4379
|
+
!children ? null : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { css: EntryListItemUnControlledContent, children })
|
|
4380
|
+
] });
|
|
4381
|
+
};
|
|
4382
|
+
var EntrySearchListItemLoadingSkeleton = () => {
|
|
4383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { role: "presentation", css: [EntryListItemContainer, EntryListItemLoading] });
|
|
4384
|
+
};
|
|
4385
|
+
|
|
4386
|
+
// src/components/EntrySearch/EntrySearchResultItem.tsx
|
|
4387
|
+
var import_design_system28 = require("@uniformdev/design-system");
|
|
4388
|
+
var import_timeago3 = require("timeago.js");
|
|
4389
|
+
|
|
4390
|
+
// src/components/EntrySearch/styles/EntrySearchResultItem.styles.ts
|
|
4391
|
+
var import_react44 = require("@emotion/react");
|
|
4392
|
+
var EntrySearchResultItemContainer = import_react44.css`
|
|
4393
|
+
align-items: center;
|
|
4394
|
+
border: 1px solid var(--gray-300);
|
|
4395
|
+
border-radius: var(--rounded-base);
|
|
4396
|
+
background: var(--gray-50);
|
|
4397
|
+
display: grid;
|
|
4398
|
+
grid-template-columns: 1fr auto;
|
|
4399
|
+
padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) var(--spacing-md);
|
|
4400
|
+
`;
|
|
4401
|
+
var EntrySearchResultItemSubtitle = import_react44.css`
|
|
4402
|
+
color: var(--gray-500);
|
|
4403
|
+
display: block;
|
|
4404
|
+
font-size: var(--fs-xs);
|
|
4405
|
+
line-height: 1;
|
|
4406
|
+
`;
|
|
4407
|
+
var EntrySearchResultItemTitle = import_react44.css`
|
|
4408
|
+
align-items: center;
|
|
4409
|
+
color: var(--brand-secondary-1);
|
|
4410
|
+
display: flex;
|
|
4411
|
+
gap: var(--spacing-xs);
|
|
4412
|
+
`;
|
|
4413
|
+
var EntrySearchResultItemTimeStamp = import_react44.css`
|
|
4414
|
+
color: var(--gray-500);
|
|
4415
|
+
font-size: var(--fs-xs);
|
|
4416
|
+
`;
|
|
4417
|
+
var EntrySearchAuthorStateGroup = import_react44.css`
|
|
4418
|
+
align-items: center;
|
|
4419
|
+
display: flex;
|
|
4420
|
+
gap: var(--spacing-sm);
|
|
4421
|
+
`;
|
|
4422
|
+
var EntrySearchUpdateGroup = import_react44.css`
|
|
4423
|
+
display: grid;
|
|
4424
|
+
`;
|
|
4425
|
+
var EntrySearchContentContainer = import_react44.css`
|
|
4426
|
+
display: flex;
|
|
4427
|
+
gap: var(--spacing-base);
|
|
4428
|
+
`;
|
|
4429
|
+
var EntrySearchImage = import_react44.css`
|
|
4430
|
+
width: 56px;
|
|
4431
|
+
object-fit: contain;
|
|
4432
|
+
`;
|
|
4433
|
+
|
|
4434
|
+
// src/components/EntrySearch/EntrySearchResultItem.tsx
|
|
4435
|
+
var import_jsx_runtime50 = require("@emotion/react/jsx-runtime");
|
|
4436
|
+
var EntrySearchResultItem = ({
|
|
4437
|
+
id,
|
|
4438
|
+
title,
|
|
4439
|
+
name,
|
|
4440
|
+
contentType,
|
|
4441
|
+
popoverData,
|
|
4442
|
+
publishStatus,
|
|
4443
|
+
editLinkIcon,
|
|
4444
|
+
editLink,
|
|
4445
|
+
imageUrl,
|
|
4446
|
+
onRemove,
|
|
4447
|
+
createdAt,
|
|
4448
|
+
publishedAt,
|
|
4449
|
+
hideRemoveButton = false,
|
|
4450
|
+
children
|
|
4451
|
+
}) => {
|
|
4452
|
+
const { onSelectItem } = useEntrySearchContext();
|
|
4453
|
+
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
4454
|
+
const onRemoveItem = () => {
|
|
4455
|
+
onSelectItem({ id });
|
|
4456
|
+
onRemove == null ? void 0 : onRemove();
|
|
4457
|
+
};
|
|
4458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { css: EntrySearchResultItemContainer, children: [
|
|
4459
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { css: EntrySearchContentContainer, children: [
|
|
4460
|
+
!imageUrl ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: EntrySearchImage }),
|
|
4461
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { children: [
|
|
4462
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { css: EntrySearchResultItemSubtitle, children: formatedContentType }),
|
|
4463
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("span", { role: "heading", css: EntrySearchResultItemTitle, children: [
|
|
4464
|
+
title != null ? title : name,
|
|
4465
|
+
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system28.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4466
|
+
] }),
|
|
4467
|
+
!createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { css: EntrySearchAuthorStateGroup, children: [
|
|
4468
|
+
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system28.Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
|
|
4469
|
+
!createdAt && !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { css: EntrySearchUpdateGroup, children: [
|
|
4470
|
+
!createdAt ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("small", { css: EntrySearchResultItemTimeStamp, children: [
|
|
4471
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("strong", { children: "Last updated: " }),
|
|
4472
|
+
(0, import_timeago3.format)(createdAt)
|
|
4473
|
+
] }),
|
|
4474
|
+
!publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("small", { css: EntrySearchResultItemTimeStamp, children: [
|
|
4475
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("strong", { children: "Last published: " }),
|
|
4476
|
+
(0, import_timeago3.format)(publishedAt)
|
|
4477
|
+
] })
|
|
4478
|
+
] })
|
|
4479
|
+
] }),
|
|
4480
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { children })
|
|
4481
|
+
] })
|
|
4482
|
+
] }) }),
|
|
4483
|
+
!editLink && hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { css: EntrySearchAuthorStateGroup, children: [
|
|
4484
|
+
!editLink ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
|
|
4485
|
+
hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_design_system28.Button, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
|
|
4486
|
+
] })
|
|
4487
|
+
] });
|
|
4488
|
+
};
|
|
4489
|
+
|
|
4490
|
+
// src/components/EntrySearch/styles/EntrySearchResultItemButton.styles.ts
|
|
4491
|
+
var import_react45 = require("@emotion/react");
|
|
4492
|
+
var import_design_system29 = require("@uniformdev/design-system");
|
|
4493
|
+
var ButtonStyles = import_react45.css`
|
|
4494
|
+
${import_design_system29.button}
|
|
4495
|
+
background: transparent;
|
|
4496
|
+
border: 1px solid var(--brand-secondary-1);
|
|
4497
|
+
color: var(--brand-secondary-1);
|
|
4498
|
+
padding: var(--spacing-sm);
|
|
4499
|
+
font-size: var(--fs-sm);
|
|
4500
|
+
line-height: 1;
|
|
4501
|
+
gap: var(--spacing-xs);
|
|
4502
|
+
transition: border-color var(--duration-fast) var(--timing-ease-out),
|
|
4503
|
+
background-color var(--duration-fast) var(--timing-ease-out);
|
|
4504
|
+
|
|
4505
|
+
&:hover {
|
|
4506
|
+
background: var(--gray-100);
|
|
4507
|
+
border-color: var(--gray-300);
|
|
4508
|
+
}
|
|
4509
|
+
|
|
4510
|
+
&:disabled {
|
|
4511
|
+
background: var(--gray-300);
|
|
4512
|
+
border-color: var(--gray-200);
|
|
4513
|
+
color: var(--gray-500);
|
|
4514
|
+
}
|
|
4515
|
+
|
|
4516
|
+
&:link {
|
|
4517
|
+
text-decoration: none;
|
|
4518
|
+
}
|
|
4519
|
+
`;
|
|
4520
|
+
var ButtonIcon = import_react45.css`
|
|
4521
|
+
width: 1rem;
|
|
4522
|
+
height: 1rem;
|
|
4523
|
+
`;
|
|
4524
|
+
|
|
4525
|
+
// src/components/EntrySearch/EntrySearchResultItemButton.tsx
|
|
4526
|
+
var import_jsx_runtime51 = require("@emotion/react/jsx-runtime");
|
|
4527
|
+
var EntrySearchResultItemButton = ({
|
|
4528
|
+
text,
|
|
4529
|
+
icon,
|
|
4530
|
+
...props
|
|
4531
|
+
}) => {
|
|
4532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("button", { type: "button", css: ButtonStyles, ...props, children: [
|
|
4533
|
+
!icon ? null : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Image, { src: icon, css: ButtonIcon }),
|
|
4534
|
+
text
|
|
4535
|
+
] });
|
|
4536
|
+
};
|
|
4537
|
+
var LinkButton = ({
|
|
4538
|
+
text,
|
|
4539
|
+
icon,
|
|
4540
|
+
...props
|
|
4541
|
+
}) => {
|
|
4542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
|
|
4543
|
+
!icon ? null : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Image, { src: icon, css: ButtonIcon }),
|
|
4544
|
+
text
|
|
4545
|
+
] });
|
|
4546
|
+
};
|
|
4547
|
+
|
|
4548
|
+
// src/components/EntrySearch/EntrySearchResultList.tsx
|
|
4549
|
+
var import_design_system30 = require("@uniformdev/design-system");
|
|
4550
|
+
var import_react_beautiful_dnd3 = require("react-beautiful-dnd");
|
|
4551
|
+
|
|
4552
|
+
// src/components/EntrySearch/styles/EntrySearchResultList.styles.ts
|
|
4553
|
+
var import_react46 = require("@emotion/react");
|
|
4554
|
+
var EntrySearchResultListContainer = import_react46.css`
|
|
4555
|
+
align-items: center;
|
|
4556
|
+
display: flex;
|
|
4557
|
+
gap: var(--spacing-sm);
|
|
4558
|
+
justify-content: space-between;
|
|
4559
|
+
`;
|
|
4560
|
+
var EntrySearchResultListCounterContainer = import_react46.css`
|
|
4561
|
+
align-items: center;
|
|
4562
|
+
display: flex;
|
|
4563
|
+
gap: var(--spacing-sm);
|
|
4564
|
+
`;
|
|
4565
|
+
var EntrySearchResultListTitle = import_react46.css`
|
|
4566
|
+
font-weight: var(--fw-bold);
|
|
4567
|
+
line-height: 1;
|
|
4568
|
+
`;
|
|
4569
|
+
|
|
4570
|
+
// src/components/EntrySearch/EntrySearchResultList.tsx
|
|
4571
|
+
var import_jsx_runtime52 = require("@emotion/react/jsx-runtime");
|
|
4572
|
+
var EntrySearchResultList = ({
|
|
4573
|
+
resultLabelText = "Selected",
|
|
4574
|
+
removeButtonText = "Remove all",
|
|
4575
|
+
onRemoveAllSelected,
|
|
4576
|
+
hideRemoveButton = false,
|
|
4577
|
+
additionalButtons,
|
|
4578
|
+
renderResultComponent = (value) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(EntrySearchResultItem, { ...value }),
|
|
4579
|
+
disableDnD = false
|
|
4580
|
+
}) => {
|
|
4581
|
+
const { selectedListItems, onRemoveAllSelectedItems, onSelectItem } = useEntrySearchContext();
|
|
4582
|
+
const handleRemoveAllSelectedItems = () => {
|
|
4583
|
+
onRemoveAllSelectedItems();
|
|
4584
|
+
onRemoveAllSelected == null ? void 0 : onRemoveAllSelected();
|
|
4585
|
+
};
|
|
4586
|
+
const onDragEnd = (res) => {
|
|
4587
|
+
var _a, _b;
|
|
4588
|
+
if (res.destination && res.source.droppableId === ((_a = res.destination) == null ? void 0 : _a.droppableId)) {
|
|
4589
|
+
const result = [...selectedListItems || []];
|
|
4590
|
+
const [removed] = (_b = result == null ? void 0 : result.splice(res.source.index, 1)) != null ? _b : [];
|
|
4591
|
+
result == null ? void 0 : result.splice(res.destination.index, 0, removed);
|
|
4592
|
+
onSelectItem(result);
|
|
4593
|
+
return result;
|
|
4594
|
+
}
|
|
4595
|
+
};
|
|
4596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
4597
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { role: "group", css: EntrySearchResultListContainer, children: [
|
|
4598
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { role: "note", css: EntrySearchResultListCounterContainer, children: [
|
|
4599
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { css: EntrySearchResultListTitle, children: resultLabelText }),
|
|
4600
|
+
" ",
|
|
4601
|
+
!selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system30.Counter, { count: selectedListItems.length })
|
|
4602
|
+
] }),
|
|
4603
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { css: EntrySearchResultListCounterContainer, children: [
|
|
4604
|
+
additionalButtons,
|
|
4605
|
+
hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4606
|
+
import_design_system30.Button,
|
|
4607
|
+
{
|
|
4608
|
+
buttonType: "ghostDestructive",
|
|
4609
|
+
size: "xs",
|
|
4610
|
+
disabled: selectedListItems.length === 0,
|
|
4611
|
+
onClick: handleRemoveAllSelectedItems,
|
|
4612
|
+
children: removeButtonText
|
|
4613
|
+
}
|
|
4614
|
+
)
|
|
4615
|
+
] })
|
|
4616
|
+
] }),
|
|
4617
|
+
!selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react_beautiful_dnd3.DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react_beautiful_dnd3.Droppable, { droppableId: "canvas-multi-select", children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
4618
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_design_system30.VerticalRhythm, { gap: "sm", children: selectedListItems.map((item, i) => {
|
|
4619
|
+
const renderListItem = renderResultComponent(item);
|
|
4620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4621
|
+
import_react_beautiful_dnd3.Draggable,
|
|
4622
|
+
{
|
|
4623
|
+
draggableId: item.title,
|
|
4624
|
+
index: i,
|
|
4625
|
+
isDragDisabled: disableDnD,
|
|
4626
|
+
children: (provided2, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
4627
|
+
"div",
|
|
4628
|
+
{
|
|
4629
|
+
ref: provided2.innerRef,
|
|
4630
|
+
"data-dragging": snapshot.isDragging,
|
|
4631
|
+
...provided2.draggableProps,
|
|
4632
|
+
...provided2.dragHandleProps,
|
|
4633
|
+
children: renderListItem
|
|
4634
|
+
}
|
|
4635
|
+
)
|
|
4636
|
+
},
|
|
4637
|
+
item.title
|
|
4638
|
+
);
|
|
4639
|
+
}) }),
|
|
4640
|
+
provided.placeholder
|
|
4641
|
+
] }) }) })
|
|
4642
|
+
] });
|
|
4643
|
+
};
|
|
4644
|
+
|
|
4645
|
+
// src/components/EntrySearch/QueryFilter.tsx
|
|
4646
|
+
var import_design_system31 = require("@uniformdev/design-system");
|
|
4647
|
+
var import_react47 = require("react");
|
|
4648
|
+
var import_jsx_runtime53 = require("@emotion/react/jsx-runtime");
|
|
4649
|
+
var QueryFilter = ({
|
|
4650
|
+
requireContentType,
|
|
4651
|
+
queryFilterTitle = "Configure Query",
|
|
4652
|
+
contentTypeLabel = "Filter by content type",
|
|
4653
|
+
typeSelectorAllTypesOptionText = "All content types",
|
|
4654
|
+
contentTypeOptions,
|
|
4655
|
+
countLabel = "Count",
|
|
4656
|
+
countValue = 5,
|
|
4657
|
+
sortLabel = "Sort",
|
|
4658
|
+
sortOptions,
|
|
4659
|
+
sortOrderLabel = "Sort Order",
|
|
4660
|
+
sortOrderOptions = [
|
|
4661
|
+
{
|
|
4662
|
+
name: "Ascending",
|
|
4663
|
+
id: "asc"
|
|
4664
|
+
},
|
|
4665
|
+
{
|
|
4666
|
+
name: "Descending",
|
|
4667
|
+
id: "desc"
|
|
4668
|
+
}
|
|
4669
|
+
],
|
|
4670
|
+
children
|
|
4671
|
+
}) => {
|
|
4672
|
+
var _a, _b;
|
|
4673
|
+
const { query, onSetQuery } = useEntrySearchContext();
|
|
4674
|
+
const [queryState, setQueryState] = (0, import_react47.useState)({
|
|
4675
|
+
contentType: "",
|
|
4676
|
+
count: countValue != null ? countValue : 5,
|
|
4677
|
+
sortBy: (_a = sortOptions[0].id) != null ? _a : "",
|
|
4678
|
+
sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
|
|
4679
|
+
});
|
|
4680
|
+
const handleFilterChange = (value) => {
|
|
4681
|
+
setQueryState((prev) => ({ ...prev, ...value }));
|
|
4682
|
+
onSetQuery({ ...query, ...value });
|
|
4683
|
+
};
|
|
4684
|
+
(0, import_react47.useEffect)(() => {
|
|
4685
|
+
onSetQuery(queryState);
|
|
4686
|
+
}, [onSetQuery, queryState]);
|
|
4687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("fieldset", { children: [
|
|
4688
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { css: EntrySearchFilterContainerLabel, children: queryFilterTitle }),
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { css: EntrySearchFilterContainer, children: [
|
|
4690
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { css: EntrySearchFilterGrid("1fr minmax(100px, 0.2fr)"), children: [
|
|
4691
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4692
|
+
import_design_system31.InputSelect,
|
|
4693
|
+
{
|
|
4694
|
+
label: contentTypeLabel,
|
|
4695
|
+
options: [
|
|
4696
|
+
...!requireContentType ? [{ value: "", label: typeSelectorAllTypesOptionText }] : [],
|
|
4697
|
+
...contentTypeOptions ? contentTypeOptions.map((option) => {
|
|
4698
|
+
return { value: option.id, label: option.name };
|
|
4699
|
+
}) : []
|
|
4700
|
+
],
|
|
4701
|
+
onChange: (e) => handleFilterChange({ contentType: e.target.value }),
|
|
4702
|
+
value: queryState.contentType
|
|
4703
|
+
}
|
|
4704
|
+
),
|
|
4705
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4706
|
+
import_design_system31.Input,
|
|
4707
|
+
{
|
|
4708
|
+
label: countLabel,
|
|
4709
|
+
type: "number",
|
|
4710
|
+
onChange: (e) => handleFilterChange({ count: e.target.value }),
|
|
4711
|
+
defaultValue: countValue,
|
|
4712
|
+
value: queryState.count
|
|
4713
|
+
}
|
|
4714
|
+
)
|
|
4715
|
+
] }),
|
|
4716
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { css: EntrySearchFilterGrid("repeat(2, 1fr)"), children: [
|
|
4717
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4718
|
+
import_design_system31.InputSelect,
|
|
4719
|
+
{
|
|
4720
|
+
label: sortLabel,
|
|
4721
|
+
options: [
|
|
4722
|
+
{
|
|
4723
|
+
label: "Select a sort",
|
|
4724
|
+
value: ""
|
|
4725
|
+
},
|
|
4726
|
+
...sortOptions ? sortOptions.map((option) => {
|
|
4727
|
+
return { value: option.id, label: option.name };
|
|
4728
|
+
}) : []
|
|
4729
|
+
],
|
|
4730
|
+
onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
|
|
4731
|
+
value: queryState.sortBy
|
|
4732
|
+
}
|
|
4733
|
+
),
|
|
4734
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
4735
|
+
import_design_system31.InputSelect,
|
|
4736
|
+
{
|
|
4737
|
+
label: sortOrderLabel,
|
|
4738
|
+
options: [
|
|
4739
|
+
...sortOrderOptions ? sortOrderOptions.map((option) => {
|
|
4740
|
+
return { value: option.id, label: option.name };
|
|
4741
|
+
}) : []
|
|
4742
|
+
],
|
|
4743
|
+
onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
|
|
4744
|
+
value: queryState.sortOrder
|
|
4745
|
+
}
|
|
4746
|
+
)
|
|
4747
|
+
] }),
|
|
4748
|
+
children
|
|
4749
|
+
] })
|
|
4750
|
+
] });
|
|
4751
|
+
};
|
|
4752
|
+
|
|
4753
|
+
// src/components/MeshApp.tsx
|
|
4754
|
+
var import_design_system32 = require("@uniformdev/design-system");
|
|
4041
4755
|
|
|
4042
4756
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
4043
4757
|
var import_mesh_sdk = require("@uniformdev/mesh-sdk");
|
|
4044
|
-
var
|
|
4758
|
+
var import_react48 = require("react");
|
|
4045
4759
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
4046
|
-
const [error, setError] = (0,
|
|
4047
|
-
const [sdk, setSdk] = (0,
|
|
4048
|
-
const initializationInProgress = (0,
|
|
4049
|
-
(0,
|
|
4760
|
+
const [error, setError] = (0, import_react48.useState)();
|
|
4761
|
+
const [sdk, setSdk] = (0, import_react48.useState)();
|
|
4762
|
+
const initializationInProgress = (0, import_react48.useRef)(false);
|
|
4763
|
+
(0, import_react48.useEffect)(
|
|
4050
4764
|
() => {
|
|
4051
4765
|
if (typeof window === "undefined" || sdk) {
|
|
4052
4766
|
return;
|
|
@@ -4079,7 +4793,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
|
4079
4793
|
};
|
|
4080
4794
|
|
|
4081
4795
|
// src/components/MeshApp.tsx
|
|
4082
|
-
var
|
|
4796
|
+
var import_jsx_runtime54 = require("@emotion/react/jsx-runtime");
|
|
4083
4797
|
var MeshApp = ({
|
|
4084
4798
|
children,
|
|
4085
4799
|
loadingComponent,
|
|
@@ -4088,18 +4802,18 @@ var MeshApp = ({
|
|
|
4088
4802
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
4089
4803
|
if (initializing || !sdk) {
|
|
4090
4804
|
const LoadingComponent = loadingComponent;
|
|
4091
|
-
return LoadingComponent ? /* @__PURE__ */ (0,
|
|
4805
|
+
return LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(LoadingComponent, {}) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system32.LoadingIndicator, {});
|
|
4092
4806
|
}
|
|
4093
4807
|
if (error) {
|
|
4094
4808
|
const ErrorComponent = errorComponent;
|
|
4095
4809
|
if (ErrorComponent) {
|
|
4096
|
-
return /* @__PURE__ */ (0,
|
|
4810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorComponent, { error });
|
|
4097
4811
|
}
|
|
4098
4812
|
throw error;
|
|
4099
4813
|
}
|
|
4100
|
-
return /* @__PURE__ */ (0,
|
|
4101
|
-
/* @__PURE__ */ (0,
|
|
4102
|
-
/* @__PURE__ */ (0,
|
|
4814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
|
|
4815
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system32.Theme, {}),
|
|
4816
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(UniformMeshLocationContextProvider, { children })
|
|
4103
4817
|
] });
|
|
4104
4818
|
};
|
|
4105
4819
|
|
|
@@ -4110,7 +4824,7 @@ function useUniformMeshLocation() {
|
|
|
4110
4824
|
}
|
|
4111
4825
|
|
|
4112
4826
|
// src/hooks/index.ts
|
|
4113
|
-
var
|
|
4827
|
+
var import_design_system33 = require("@uniformdev/design-system");
|
|
4114
4828
|
|
|
4115
4829
|
// src/utils/createLocationValidator.ts
|
|
4116
4830
|
function createLocationValidator(setValue, validate) {
|
|
@@ -4121,7 +4835,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
4121
4835
|
}
|
|
4122
4836
|
|
|
4123
4837
|
// src/index.ts
|
|
4124
|
-
var
|
|
4838
|
+
var import_design_system34 = require("@uniformdev/design-system");
|
|
4125
4839
|
__reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
4126
4840
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4127
4841
|
0 && (module.exports = {
|
|
@@ -4129,12 +4843,23 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
4129
4843
|
Button,
|
|
4130
4844
|
Callout,
|
|
4131
4845
|
DamSelectedItem,
|
|
4846
|
+
DataRefreshButton,
|
|
4132
4847
|
DataResourceVariablesList,
|
|
4133
4848
|
DataSourceEditor,
|
|
4134
4849
|
DataTypeEditor,
|
|
4135
4850
|
DefaultSearchRow,
|
|
4136
4851
|
DefaultSelectedItem,
|
|
4137
4852
|
EntrySearch,
|
|
4853
|
+
EntrySearchContainer,
|
|
4854
|
+
EntrySearchContext,
|
|
4855
|
+
EntrySearchFilter,
|
|
4856
|
+
EntrySearchFilterContainer,
|
|
4857
|
+
EntrySearchListItem,
|
|
4858
|
+
EntrySearchListItemLoadingSkeleton,
|
|
4859
|
+
EntrySearchProvider,
|
|
4860
|
+
EntrySearchResultItem,
|
|
4861
|
+
EntrySearchResultItemButton,
|
|
4862
|
+
EntrySearchResultList,
|
|
4138
4863
|
Heading,
|
|
4139
4864
|
Icons,
|
|
4140
4865
|
Input,
|
|
@@ -4145,6 +4870,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
4145
4870
|
InputVariables,
|
|
4146
4871
|
KeywordSearchInput,
|
|
4147
4872
|
Label,
|
|
4873
|
+
LinkButton,
|
|
4148
4874
|
LoadingIndicator,
|
|
4149
4875
|
LoadingOverlay,
|
|
4150
4876
|
Menu,
|
|
@@ -4172,6 +4898,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
4172
4898
|
ProductSearchContext,
|
|
4173
4899
|
ProductSearchRow,
|
|
4174
4900
|
ProductSelectedItem,
|
|
4901
|
+
QueryFilter,
|
|
4175
4902
|
RequestBody,
|
|
4176
4903
|
RequestHeaders,
|
|
4177
4904
|
RequestMethodSelect,
|
|
@@ -4260,6 +4987,7 @@ __reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
|
4260
4987
|
selectedItemTitle,
|
|
4261
4988
|
urlEncodeRequestParameter,
|
|
4262
4989
|
urlEncodeRequestUrl,
|
|
4990
|
+
useEntrySearchContext,
|
|
4263
4991
|
useInitializeUniformMeshSdk,
|
|
4264
4992
|
useMeshLocation,
|
|
4265
4993
|
useParameterShell,
|