@uniformdev/mesh-sdk-react 18.29.0 → 18.30.1-alpha.16

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