@uniformdev/mesh-sdk-react 18.31.0 → 18.32.1-alpha.26

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