@uniformdev/mesh-sdk-react 18.27.1-alpha.23 → 18.28.0

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