@uniformdev/mesh-sdk-react 18.29.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.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,717 @@ 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
+ popoverData,
4198
+ onSelect,
4199
+ isMulti = false,
4200
+ children,
4201
+ ...props
4202
+ }) => {
4203
+ const { onSelectItem, selectedListItems } = useEntrySearchContext();
4204
+ const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
4205
+ const handleSelectItem = () => {
4206
+ var _a;
4207
+ const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
4208
+ const selectedItem = { id, title, contentType, image, popoverData, ...extraData };
4209
+ if (isMulti) {
4210
+ return onSelectItem(selectedItem);
4211
+ }
4212
+ return onSelectItem([selectedItem]);
4213
+ };
4214
+ const hideWhenInSelectedList = selectedListItems.some((item) => item.id === id);
4215
+ return /* @__PURE__ */ jsxs29("div", { role: "listitem", hidden: hideWhenInSelectedList, css: EntryListItemContainer, ...props, children: [
4216
+ /* @__PURE__ */ jsxs29("div", { role: "button", onClick: handleSelectItem, css: EntryListItemControlledContent, children: [
4217
+ !image ? null : /* @__PURE__ */ jsx49("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
4218
+ /* @__PURE__ */ jsxs29("div", { role: "heading", css: EntryListItemHeadingGroup, children: [
4219
+ !contentType ? null : /* @__PURE__ */ jsx49("span", { css: EntryListItemSubtitle, children: formatedContentType }),
4220
+ /* @__PURE__ */ jsx49("span", { css: EntryListItemTitle, children: title })
4221
+ ] })
4222
+ ] }),
4223
+ !popoverData ? null : /* @__PURE__ */ jsx49("div", { css: EntryListItemInfoContainer, children: /* @__PURE__ */ jsx49(Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData }) }),
4224
+ !children ? null : /* @__PURE__ */ jsx49("div", { css: EntryListItemUnControlledContent, children })
4225
+ ] });
4226
+ };
4227
+ var EntrySearchListItemLoadingSkeleton = () => {
4228
+ return /* @__PURE__ */ jsx49("div", { role: "presentation", css: [EntryListItemContainer, EntryListItemLoading] });
4229
+ };
4230
+
4231
+ // src/components/EntrySearch/EntrySearchResultItem.tsx
4232
+ import { Badge, Button as Button5, Popover as Popover2 } from "@uniformdev/design-system";
4233
+ import { format as timeagoFormat } from "timeago.js";
4234
+
4235
+ // src/components/EntrySearch/styles/EntrySearchResultItem.styles.ts
4236
+ import { css as css29 } from "@emotion/react";
4237
+ var EntrySearchResultItemContainer = css29`
4238
+ align-items: center;
4239
+ border: 1px solid var(--gray-300);
4240
+ border-radius: var(--rounded-base);
4241
+ background: var(--gray-50);
4242
+ display: grid;
4243
+ grid-template-columns: 1fr auto;
4244
+ padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) var(--spacing-md);
4245
+ `;
4246
+ var EntrySearchResultItemSubtitle = css29`
4247
+ color: var(--gray-500);
4248
+ display: block;
4249
+ font-size: var(--fs-xs);
4250
+ line-height: 1;
4251
+ `;
4252
+ var EntrySearchResultItemTitle = css29`
4253
+ align-items: center;
4254
+ color: var(--brand-secondary-1);
4255
+ display: flex;
4256
+ gap: var(--spacing-xs);
4257
+ `;
4258
+ var EntrySearchResultItemTimeStamp = css29`
4259
+ color: var(--gray-500);
4260
+ font-size: var(--fs-xs);
4261
+ `;
4262
+ var EntrySearchAuthorStateGroup = css29`
4263
+ align-items: center;
4264
+ display: flex;
4265
+ gap: var(--spacing-sm);
4266
+ `;
4267
+ var EntrySearchUpdateGroup = css29`
4268
+ display: grid;
4269
+ `;
4270
+ var EntrySearchContentContainer = css29`
4271
+ display: flex;
4272
+ gap: var(--spacing-base);
4273
+ `;
4274
+ var EntrySearchImage = css29`
4275
+ width: 56px;
4276
+ object-fit: contain;
4277
+ `;
4278
+
4279
+ // src/components/EntrySearch/EntrySearchResultItem.tsx
4280
+ import { jsx as jsx50, jsxs as jsxs30 } from "@emotion/react/jsx-runtime";
4281
+ var EntrySearchResultItem = ({
4282
+ id,
4283
+ title,
4284
+ name,
4285
+ contentType,
4286
+ popoverData,
4287
+ publishStatus,
4288
+ editLinkIcon,
4289
+ editLink,
4290
+ imageUrl,
4291
+ onRemove,
4292
+ createdAt,
4293
+ publishedAt,
4294
+ hideRemoveButton = false,
4295
+ children
4296
+ }) => {
4297
+ const { onSelectItem } = useEntrySearchContext();
4298
+ const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
4299
+ const onRemoveItem = () => {
4300
+ onSelectItem({ id });
4301
+ onRemove == null ? void 0 : onRemove();
4302
+ };
4303
+ return /* @__PURE__ */ jsxs30("div", { css: EntrySearchResultItemContainer, children: [
4304
+ /* @__PURE__ */ jsx50("div", { children: /* @__PURE__ */ jsxs30("div", { css: EntrySearchContentContainer, children: [
4305
+ !imageUrl ? null : /* @__PURE__ */ jsx50("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: EntrySearchImage }),
4306
+ /* @__PURE__ */ jsxs30("div", { children: [
4307
+ /* @__PURE__ */ jsx50("span", { css: EntrySearchResultItemSubtitle, children: formatedContentType }),
4308
+ /* @__PURE__ */ jsxs30("span", { role: "heading", css: EntrySearchResultItemTitle, children: [
4309
+ title != null ? title : name,
4310
+ !popoverData ? null : /* @__PURE__ */ jsx50(Popover2, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
4311
+ ] }),
4312
+ !createdAt && !publishStatus ? null : /* @__PURE__ */ jsxs30("div", { css: EntrySearchAuthorStateGroup, children: [
4313
+ !(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ jsx50(Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
4314
+ !createdAt && !publishedAt ? null : /* @__PURE__ */ jsxs30("div", { css: EntrySearchUpdateGroup, children: [
4315
+ !createdAt ? null : /* @__PURE__ */ jsxs30("small", { css: EntrySearchResultItemTimeStamp, children: [
4316
+ /* @__PURE__ */ jsx50("strong", { children: "Last updated: " }),
4317
+ timeagoFormat(createdAt)
4318
+ ] }),
4319
+ !publishedAt ? null : /* @__PURE__ */ jsxs30("small", { css: EntrySearchResultItemTimeStamp, children: [
4320
+ /* @__PURE__ */ jsx50("strong", { children: "Last published: " }),
4321
+ timeagoFormat(publishedAt)
4322
+ ] })
4323
+ ] })
4324
+ ] }),
4325
+ /* @__PURE__ */ jsx50("div", { children })
4326
+ ] })
4327
+ ] }) }),
4328
+ !editLink && hideRemoveButton ? null : /* @__PURE__ */ jsxs30("div", { css: EntrySearchAuthorStateGroup, children: [
4329
+ !editLink ? null : /* @__PURE__ */ jsx50(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
4330
+ hideRemoveButton ? null : /* @__PURE__ */ jsx50(Button5, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
4331
+ ] })
4332
+ ] });
4333
+ };
4334
+
4335
+ // src/components/EntrySearch/styles/EntrySearchResultItemButton.styles.ts
4336
+ import { css as css30 } from "@emotion/react";
4337
+ import { button as button2 } from "@uniformdev/design-system";
4338
+ var ButtonStyles = css30`
4339
+ ${button2}
4340
+ background: transparent;
4341
+ border: 1px solid var(--brand-secondary-1);
4342
+ color: var(--brand-secondary-1);
4343
+ padding: var(--spacing-sm);
4344
+ font-size: var(--fs-sm);
4345
+ line-height: 1;
4346
+ gap: var(--spacing-xs);
4347
+ transition: border-color var(--duration-fast) var(--timing-ease-out),
4348
+ background-color var(--duration-fast) var(--timing-ease-out);
4349
+
4350
+ &:hover {
4351
+ background: var(--gray-100);
4352
+ border-color: var(--gray-300);
4353
+ }
4354
+
4355
+ &:disabled {
4356
+ background: var(--gray-300);
4357
+ border-color: var(--gray-200);
4358
+ color: var(--gray-500);
4359
+ }
4360
+
4361
+ &:link {
4362
+ text-decoration: none;
4363
+ }
4364
+ `;
4365
+ var ButtonIcon = css30`
4366
+ width: 1rem;
4367
+ height: 1rem;
4368
+ `;
4369
+
4370
+ // src/components/EntrySearch/EntrySearchResultItemButton.tsx
4371
+ import { jsx as jsx51, jsxs as jsxs31 } from "@emotion/react/jsx-runtime";
4372
+ var EntrySearchResultItemButton = ({
4373
+ text,
4374
+ icon,
4375
+ ...props
4376
+ }) => {
4377
+ return /* @__PURE__ */ jsxs31("button", { type: "button", css: ButtonStyles, ...props, children: [
4378
+ !icon ? null : /* @__PURE__ */ jsx51(Image, { src: icon, css: ButtonIcon }),
4379
+ text
4380
+ ] });
4381
+ };
4382
+ var LinkButton = ({
4383
+ text,
4384
+ icon,
4385
+ ...props
4386
+ }) => {
4387
+ return /* @__PURE__ */ jsxs31("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
4388
+ !icon ? null : /* @__PURE__ */ jsx51(Image, { src: icon, css: ButtonIcon }),
4389
+ text
4390
+ ] });
4391
+ };
4392
+
4393
+ // src/components/EntrySearch/EntrySearchResultList.tsx
4394
+ import { Button as Button6, Counter, VerticalRhythm as VerticalRhythm2 } from "@uniformdev/design-system";
4395
+ import { DragDropContext as DragDropContext3, Draggable as Draggable3, Droppable as Droppable3 } from "react-beautiful-dnd";
4396
+
4397
+ // src/components/EntrySearch/styles/EntrySearchResultList.styles.ts
4398
+ import { css as css31 } from "@emotion/react";
4399
+ var EntrySearchResultListContainer = css31`
4400
+ align-items: center;
4401
+ display: flex;
4402
+ gap: var(--spacing-sm);
4403
+ justify-content: space-between;
4404
+ `;
4405
+ var EntrySearchResultListCounterContainer = css31`
4406
+ align-items: center;
4407
+ display: flex;
4408
+ gap: var(--spacing-sm);
4409
+ `;
4410
+ var EntrySearchResultListTitle = css31`
4411
+ font-weight: var(--fw-bold);
4412
+ line-height: 1;
4413
+ `;
4414
+
4415
+ // src/components/EntrySearch/EntrySearchResultList.tsx
4416
+ import { Fragment as Fragment7, jsx as jsx52, jsxs as jsxs32 } from "@emotion/react/jsx-runtime";
4417
+ var EntrySearchResultList = ({
4418
+ resultLabelText = "Selected",
4419
+ removeButtonText = "Remove all",
4420
+ onRemoveAllSelected,
4421
+ hideRemoveButton = false,
4422
+ additionalButtons,
4423
+ renderResultComponent = (value) => /* @__PURE__ */ jsx52(EntrySearchResultItem, { ...value }),
4424
+ disableDnD = false
4425
+ }) => {
4426
+ const { selectedListItems, onRemoveAllSelectedItems, onSelectItem } = useEntrySearchContext();
4427
+ const handleRemoveAllSelectedItems = () => {
4428
+ onRemoveAllSelectedItems();
4429
+ onRemoveAllSelected == null ? void 0 : onRemoveAllSelected();
4430
+ };
4431
+ const onDragEnd = (res) => {
4432
+ var _a, _b;
4433
+ if (res.destination && res.source.droppableId === ((_a = res.destination) == null ? void 0 : _a.droppableId)) {
4434
+ const result = [...selectedListItems || []];
4435
+ const [removed] = (_b = result == null ? void 0 : result.splice(res.source.index, 1)) != null ? _b : [];
4436
+ result == null ? void 0 : result.splice(res.destination.index, 0, removed);
4437
+ onSelectItem(result);
4438
+ return result;
4439
+ }
4440
+ };
4441
+ return /* @__PURE__ */ jsxs32(Fragment7, { children: [
4442
+ /* @__PURE__ */ jsxs32("div", { role: "group", css: EntrySearchResultListContainer, children: [
4443
+ /* @__PURE__ */ jsxs32("div", { role: "note", css: EntrySearchResultListCounterContainer, children: [
4444
+ /* @__PURE__ */ jsx52("span", { css: EntrySearchResultListTitle, children: resultLabelText }),
4445
+ " ",
4446
+ !selectedListItems.length ? null : /* @__PURE__ */ jsx52(Counter, { count: selectedListItems.length })
4447
+ ] }),
4448
+ /* @__PURE__ */ jsxs32("div", { css: EntrySearchResultListCounterContainer, children: [
4449
+ additionalButtons,
4450
+ hideRemoveButton ? null : /* @__PURE__ */ jsx52(
4451
+ Button6,
4452
+ {
4453
+ buttonType: "ghostDestructive",
4454
+ size: "xs",
4455
+ disabled: selectedListItems.length === 0,
4456
+ onClick: handleRemoveAllSelectedItems,
4457
+ children: removeButtonText
4458
+ }
4459
+ )
4460
+ ] })
4461
+ ] }),
4462
+ !selectedListItems.length ? null : /* @__PURE__ */ jsx52(DragDropContext3, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx52(Droppable3, { droppableId: "canvas-multi-select", children: (provided) => /* @__PURE__ */ jsxs32("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
4463
+ /* @__PURE__ */ jsx52(VerticalRhythm2, { gap: "sm", children: selectedListItems.map((item, i) => {
4464
+ const renderListItem = renderResultComponent(item);
4465
+ return /* @__PURE__ */ jsx52(
4466
+ Draggable3,
4467
+ {
4468
+ draggableId: item.title,
4469
+ index: i,
4470
+ isDragDisabled: disableDnD,
4471
+ children: (provided2, snapshot) => /* @__PURE__ */ jsx52(
4472
+ "div",
4473
+ {
4474
+ ref: provided2.innerRef,
4475
+ "data-dragging": snapshot.isDragging,
4476
+ ...provided2.draggableProps,
4477
+ ...provided2.dragHandleProps,
4478
+ children: renderListItem
4479
+ }
4480
+ )
4481
+ },
4482
+ item.title
4483
+ );
4484
+ }) }),
4485
+ provided.placeholder
4486
+ ] }) }) })
4487
+ ] });
4488
+ };
4489
+
4490
+ // src/components/EntrySearch/QueryFilter.tsx
4491
+ import { Input as Input7, InputSelect as InputSelect7 } from "@uniformdev/design-system";
4492
+ import { useEffect as useEffect7, useState as useState11 } from "react";
4493
+ import { jsx as jsx53, jsxs as jsxs33 } from "@emotion/react/jsx-runtime";
4494
+ var QueryFilter = ({
4495
+ requireContentType,
4496
+ queryFilterTitle = "Configure Query",
4497
+ contentTypeLabel = "Filter by content type",
4498
+ typeSelectorAllTypesOptionText = "All content types",
4499
+ contentTypeOptions,
4500
+ countLabel = "Count",
4501
+ countValue = 5,
4502
+ sortLabel = "Sort",
4503
+ sortOptions,
4504
+ sortOrderLabel = "Sort Order",
4505
+ sortOrderOptions = [
4506
+ {
4507
+ name: "Ascending",
4508
+ id: "asc"
4509
+ },
4510
+ {
4511
+ name: "Descending",
4512
+ id: "desc"
4513
+ }
4514
+ ],
4515
+ children
4516
+ }) => {
4517
+ var _a, _b;
4518
+ const { query, onSetQuery } = useEntrySearchContext();
4519
+ const [queryState, setQueryState] = useState11({
4520
+ contentType: "",
4521
+ count: countValue != null ? countValue : 5,
4522
+ sortBy: (_a = sortOptions[0].id) != null ? _a : "",
4523
+ sortOrder: (_b = sortOrderOptions[0].id) != null ? _b : ""
4524
+ });
4525
+ const handleFilterChange = (value) => {
4526
+ setQueryState((prev) => ({ ...prev, ...value }));
4527
+ onSetQuery({ ...query, ...value });
4528
+ };
4529
+ useEffect7(() => {
4530
+ onSetQuery(queryState);
4531
+ }, [onSetQuery, queryState]);
4532
+ return /* @__PURE__ */ jsxs33("fieldset", { children: [
4533
+ /* @__PURE__ */ jsx53("span", { css: EntrySearchFilterContainerLabel, children: queryFilterTitle }),
4534
+ /* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterContainer, children: [
4535
+ /* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("1fr minmax(100px, 0.2fr)"), children: [
4536
+ /* @__PURE__ */ jsx53(
4537
+ InputSelect7,
4538
+ {
4539
+ label: contentTypeLabel,
4540
+ options: [
4541
+ ...!requireContentType ? [{ value: "", label: typeSelectorAllTypesOptionText }] : [],
4542
+ ...contentTypeOptions ? contentTypeOptions.map((option) => {
4543
+ return { value: option.id, label: option.name };
4544
+ }) : []
4545
+ ],
4546
+ onChange: (e) => handleFilterChange({ contentType: e.target.value }),
4547
+ value: queryState.contentType
4548
+ }
4549
+ ),
4550
+ /* @__PURE__ */ jsx53(
4551
+ Input7,
4552
+ {
4553
+ label: countLabel,
4554
+ type: "number",
4555
+ onChange: (e) => handleFilterChange({ count: e.target.value }),
4556
+ defaultValue: countValue,
4557
+ value: queryState.count
4558
+ }
4559
+ )
4560
+ ] }),
4561
+ /* @__PURE__ */ jsxs33("div", { css: EntrySearchFilterGrid("repeat(2, 1fr)"), children: [
4562
+ /* @__PURE__ */ jsx53(
4563
+ InputSelect7,
4564
+ {
4565
+ label: sortLabel,
4566
+ options: [
4567
+ {
4568
+ label: "Select a sort",
4569
+ value: ""
4570
+ },
4571
+ ...sortOptions ? sortOptions.map((option) => {
4572
+ return { value: option.id, label: option.name };
4573
+ }) : []
4574
+ ],
4575
+ onChange: (e) => handleFilterChange({ sortBy: e.target.value }),
4576
+ value: queryState.sortBy
4577
+ }
4578
+ ),
4579
+ /* @__PURE__ */ jsx53(
4580
+ InputSelect7,
4581
+ {
4582
+ label: sortOrderLabel,
4583
+ options: [
4584
+ ...sortOrderOptions ? sortOrderOptions.map((option) => {
4585
+ return { value: option.id, label: option.name };
4586
+ }) : []
4587
+ ],
4588
+ onChange: (e) => handleFilterChange({ sortOrder: e.target.value }),
4589
+ value: queryState.sortOrder
4590
+ }
4591
+ )
4592
+ ] }),
4593
+ children
4594
+ ] })
4595
+ ] });
4596
+ };
4597
+
3898
4598
  // src/components/MeshApp.tsx
3899
- import { LoadingIndicator as LoadingIndicator2, Theme as Theme2 } from "@uniformdev/design-system";
4599
+ import { LoadingIndicator as LoadingIndicator3, Theme as Theme2 } from "@uniformdev/design-system";
3900
4600
 
3901
4601
  // src/hooks/useInitializeUniformMeshSdk.ts
3902
4602
  import { initializeUniformMeshSDK } from "@uniformdev/mesh-sdk";
3903
- import { useEffect as useEffect7, useRef as useRef10, useState as useState9 } from "react";
4603
+ import { useEffect as useEffect8, useRef as useRef10, useState as useState12 } from "react";
3904
4604
  var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
3905
- const [error, setError] = useState9();
3906
- const [sdk, setSdk] = useState9();
4605
+ const [error, setError] = useState12();
4606
+ const [sdk, setSdk] = useState12();
3907
4607
  const initializationInProgress = useRef10(false);
3908
- useEffect7(
4608
+ useEffect8(
3909
4609
  () => {
3910
4610
  if (typeof window === "undefined" || sdk) {
3911
4611
  return;
@@ -3938,7 +4638,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
3938
4638
  };
3939
4639
 
3940
4640
  // src/components/MeshApp.tsx
3941
- import { jsx as jsx44, jsxs as jsxs25 } from "@emotion/react/jsx-runtime";
4641
+ import { jsx as jsx54, jsxs as jsxs34 } from "@emotion/react/jsx-runtime";
3942
4642
  var MeshApp = ({
3943
4643
  children,
3944
4644
  loadingComponent,
@@ -3947,18 +4647,18 @@ var MeshApp = ({
3947
4647
  const { initializing, error, sdk } = useInitializeUniformMeshSdk();
3948
4648
  if (initializing || !sdk) {
3949
4649
  const LoadingComponent = loadingComponent;
3950
- return LoadingComponent ? /* @__PURE__ */ jsx44(LoadingComponent, {}) : /* @__PURE__ */ jsx44(LoadingIndicator2, {});
4650
+ return LoadingComponent ? /* @__PURE__ */ jsx54(LoadingComponent, {}) : /* @__PURE__ */ jsx54(LoadingIndicator3, {});
3951
4651
  }
3952
4652
  if (error) {
3953
4653
  const ErrorComponent = errorComponent;
3954
4654
  if (ErrorComponent) {
3955
- return /* @__PURE__ */ jsx44(ErrorComponent, { error });
4655
+ return /* @__PURE__ */ jsx54(ErrorComponent, { error });
3956
4656
  }
3957
4657
  throw error;
3958
4658
  }
3959
- return /* @__PURE__ */ jsxs25(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
3960
- /* @__PURE__ */ jsx44(Theme2, {}),
3961
- /* @__PURE__ */ jsx44(UniformMeshLocationContextProvider, { children })
4659
+ return /* @__PURE__ */ jsxs34(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
4660
+ /* @__PURE__ */ jsx54(Theme2, {}),
4661
+ /* @__PURE__ */ jsx54(UniformMeshLocationContextProvider, { children })
3962
4662
  ] });
3963
4663
  };
3964
4664
 
@@ -3982,17 +4682,17 @@ function createLocationValidator(setValue, validate) {
3982
4682
  // src/index.ts
3983
4683
  import {
3984
4684
  AddListButton as AddListButton2,
3985
- Button as Button3,
4685
+ Button as Button7,
3986
4686
  Callout as Callout4,
3987
4687
  Heading,
3988
- Input as Input7,
4688
+ Input as Input8,
3989
4689
  InputComboBox,
3990
- InputKeywordSearch as InputKeywordSearch2,
3991
- InputSelect as InputSelect6,
3992
- InputToggle,
3993
4690
  InputKeywordSearch as InputKeywordSearch3,
4691
+ InputSelect as InputSelect8,
4692
+ InputToggle,
4693
+ InputKeywordSearch as InputKeywordSearch4,
3994
4694
  Label,
3995
- LoadingIndicator as LoadingIndicator3,
4695
+ LoadingIndicator as LoadingIndicator4,
3996
4696
  LoadingOverlay as LoadingOverlay2,
3997
4697
  Menu as Menu3,
3998
4698
  MenuItem as MenuItem3,
@@ -4010,7 +4710,7 @@ import {
4010
4710
  ParameterTextareaInner,
4011
4711
  ParameterToggle,
4012
4712
  ParameterToggleInner,
4013
- ScrollableList,
4713
+ ScrollableList as ScrollableList2,
4014
4714
  ScrollableListItem,
4015
4715
  Switch,
4016
4716
  Textarea,
@@ -4019,26 +4719,38 @@ import {
4019
4719
  export * from "@uniformdev/mesh-sdk";
4020
4720
  export {
4021
4721
  AddListButton2 as AddListButton,
4022
- Button3 as Button,
4722
+ Button7 as Button,
4023
4723
  Callout4 as Callout,
4024
4724
  DamSelectedItem,
4725
+ DataRefreshButton,
4025
4726
  DataResourceVariablesList,
4026
4727
  DataSourceEditor,
4027
4728
  DataTypeEditor,
4028
4729
  DefaultSearchRow,
4029
4730
  DefaultSelectedItem,
4030
4731
  EntrySearch,
4732
+ EntrySearchContainer,
4733
+ EntrySearchContext,
4734
+ EntrySearchFilter,
4735
+ EntrySearchFilterContainer2 as EntrySearchFilterContainer,
4736
+ EntrySearchListItem,
4737
+ EntrySearchListItemLoadingSkeleton,
4738
+ EntrySearchProvider,
4739
+ EntrySearchResultItem,
4740
+ EntrySearchResultItemButton,
4741
+ EntrySearchResultList,
4031
4742
  Heading,
4032
4743
  icons_exports as Icons,
4033
- Input7 as Input,
4744
+ Input8 as Input,
4034
4745
  InputComboBox,
4035
- InputKeywordSearch2 as InputKeywordSearch,
4036
- InputSelect6 as InputSelect,
4746
+ InputKeywordSearch3 as InputKeywordSearch,
4747
+ InputSelect8 as InputSelect,
4037
4748
  InputToggle,
4038
4749
  InputVariables,
4039
- InputKeywordSearch3 as KeywordSearchInput,
4750
+ InputKeywordSearch4 as KeywordSearchInput,
4040
4751
  Label,
4041
- LoadingIndicator3 as LoadingIndicator,
4752
+ LinkButton,
4753
+ LoadingIndicator4 as LoadingIndicator,
4042
4754
  LoadingOverlay2 as LoadingOverlay,
4043
4755
  Menu3 as Menu,
4044
4756
  MenuItem3 as MenuItem,
@@ -4065,6 +4777,7 @@ export {
4065
4777
  ProductSearchContext,
4066
4778
  ProductSearchRow,
4067
4779
  ProductSelectedItem,
4780
+ QueryFilter,
4068
4781
  RequestBody,
4069
4782
  RequestHeaders,
4070
4783
  RequestMethodSelect,
@@ -4074,7 +4787,7 @@ export {
4074
4787
  RequestUrl,
4075
4788
  RequestUrlInput,
4076
4789
  ResolvableLoadingValue,
4077
- ScrollableList,
4790
+ ScrollableList2 as ScrollableList,
4078
4791
  ScrollableListItem,
4079
4792
  SelectionField,
4080
4793
  Switch,
@@ -4153,6 +4866,7 @@ export {
4153
4866
  selectedItemTitle,
4154
4867
  urlEncodeRequestParameter,
4155
4868
  urlEncodeRequestUrl,
4869
+ useEntrySearchContext,
4156
4870
  useInitializeUniformMeshSdk,
4157
4871
  useMeshLocation,
4158
4872
  useParameterShell,