@uniformdev/mesh-sdk-react 20.8.1 → 20.8.2-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.esm.js +30 -10
- package/dist/index.js +29 -9
- package/dist/index.mjs +30 -10
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -96,6 +96,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
96
96
|
type: TLocationType;
|
|
97
97
|
}> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
|
|
98
98
|
type: TLocationType;
|
|
99
|
+
}> | Extract<_uniformdev_mesh_sdk.PersonalizationCriteriaLocation<TLocationValue, unknown>, {
|
|
100
|
+
type: TLocationType;
|
|
99
101
|
}>, "setValue"> & {
|
|
100
102
|
setValue: SetLocationValueDispatch<(Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
|
|
101
103
|
type: TLocationType;
|
|
@@ -121,6 +123,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
121
123
|
type: TLocationType;
|
|
122
124
|
}> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
|
|
123
125
|
type: TLocationType;
|
|
126
|
+
}> | Extract<_uniformdev_mesh_sdk.PersonalizationCriteriaLocation<TLocationValue, unknown>, {
|
|
127
|
+
type: TLocationType;
|
|
124
128
|
}>)["value"], Parameters<(Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
|
|
125
129
|
type: TLocationType;
|
|
126
130
|
}> | Extract<_uniformdev_mesh_sdk.AssetParameterLocation, {
|
|
@@ -145,6 +149,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
145
149
|
type: TLocationType;
|
|
146
150
|
}> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
|
|
147
151
|
type: TLocationType;
|
|
152
|
+
}> | Extract<_uniformdev_mesh_sdk.PersonalizationCriteriaLocation<TLocationValue, unknown>, {
|
|
153
|
+
type: TLocationType;
|
|
148
154
|
}>)["setValue"]>[0]>;
|
|
149
155
|
};
|
|
150
156
|
type SetLocationValueDispatch<TValue, TSetValue = TValue> = (dispatch: SetLocationValueFunction<TValue, TSetValue>) => Promise<void> | void;
|
|
@@ -966,12 +972,13 @@ type ObjectSearchResultItemProps = SelectedItemProps & {
|
|
|
966
972
|
* @default false
|
|
967
973
|
*/
|
|
968
974
|
disableDnD?: boolean;
|
|
975
|
+
onClick?: () => void;
|
|
969
976
|
};
|
|
970
977
|
/**
|
|
971
978
|
* @description An opinionated result item, best used for selected results
|
|
972
979
|
* @example <ObjectSearchResultItem id="my-result" title="title" />
|
|
973
980
|
*/
|
|
974
|
-
declare const ObjectSearchResultItem: ({ id, title, contentType, popoverData, publishStatus, editLinkIcon, editLink, imageUrl, onRemove, createdAt, publishedAt, hideRemoveButton, disableDnD, children, }: ObjectSearchResultItemProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
981
|
+
declare const ObjectSearchResultItem: ({ id, title, contentType, popoverData, publishStatus, editLinkIcon, editLink, imageUrl, onRemove, createdAt, publishedAt, hideRemoveButton, disableDnD, children, onClick, }: ObjectSearchResultItemProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
975
982
|
|
|
976
983
|
type SearchQueryProps<TExtraFilters = unknown> = {
|
|
977
984
|
/** sets the content type in the search context */
|
|
@@ -1681,6 +1688,8 @@ type SearchAndFilterProviderProps = {
|
|
|
1681
1688
|
resetFilterValues?: Filter[];
|
|
1682
1689
|
/** sets the list of filter options for each filter row */
|
|
1683
1690
|
filterOptions: FilterOptionGroup[];
|
|
1691
|
+
/** optional function that is used instead of the default reset filter functionality */
|
|
1692
|
+
onResetFilterValues?: () => void;
|
|
1684
1693
|
/** the total number of results */
|
|
1685
1694
|
totalResults?: number;
|
|
1686
1695
|
/** the filter mapper function */
|
|
@@ -1725,7 +1734,7 @@ declare const SearchAndFilterContext: React$1.Context<SearchAndFilterContextProp
|
|
|
1725
1734
|
* Search and filter provider
|
|
1726
1735
|
* @example <SearchAndFilterProvider filters={filters} filterOptions={filterOptions} onSearchChange={onSearchChange} onChange={onChange}>Children</SearchAndFilterProvider>
|
|
1727
1736
|
* */
|
|
1728
|
-
declare const SearchAndFilterProvider: ({ filters, filterOptions, filterVisible, alwaysVisible, defaultSearchTerm, onSearchChange, onChange, resetFilterValues, totalResults, filterMapper, children, allowBindingSearchTerm, }: SearchAndFilterProviderProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1737
|
+
declare const SearchAndFilterProvider: ({ filters, filterOptions, filterVisible, alwaysVisible, defaultSearchTerm, onSearchChange, onChange, resetFilterValues, onResetFilterValues, totalResults, filterMapper, children, allowBindingSearchTerm, }: SearchAndFilterProviderProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1729
1738
|
/** Search and filter hook
|
|
1730
1739
|
* @example const { searchTerm, setSearchTerm, filterVisibility, setFilterVisibility, filters, setFilters, handleAddFilter, handleResetFilters, handleDeleteFilter, filterOptions, validFilterQuery } = useSearchAndFilter();
|
|
1731
1740
|
*/
|
|
@@ -1788,7 +1797,7 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
|
|
|
1788
1797
|
* Search and filter component
|
|
1789
1798
|
* @example <SearchAndFilter filters={filters} filterOptions={filterOptions} onChange={onChange} onSearchChange={onSearchChange} onSearchReset={onSearchReset} totalResults={totalResults} />
|
|
1790
1799
|
* */
|
|
1791
|
-
declare const SearchAndFilter: ({ filters, filterOptions, filterVisible, filterControls, viewSwitchControls, resultsContainerView, filterMapper, additionalFiltersContainer, onChange, defaultSearchTerm, onSearchChange, totalResults, allowBindingSearchTerm, resetFilterValues, }: SearchAndFilterProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1800
|
+
declare const SearchAndFilter: ({ filters, filterOptions, filterVisible, filterControls, viewSwitchControls, resultsContainerView, filterMapper, additionalFiltersContainer, onChange, defaultSearchTerm, onSearchChange, totalResults, allowBindingSearchTerm, resetFilterValues, onResetFilterValues, }: SearchAndFilterProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1792
1801
|
|
|
1793
1802
|
type FilterItemsProps = {
|
|
1794
1803
|
/** The text for the add button */
|
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
96
96
|
type: TLocationType;
|
|
97
97
|
}> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
|
|
98
98
|
type: TLocationType;
|
|
99
|
+
}> | Extract<_uniformdev_mesh_sdk.PersonalizationCriteriaLocation<TLocationValue, unknown>, {
|
|
100
|
+
type: TLocationType;
|
|
99
101
|
}>, "setValue"> & {
|
|
100
102
|
setValue: SetLocationValueDispatch<(Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
|
|
101
103
|
type: TLocationType;
|
|
@@ -121,6 +123,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
121
123
|
type: TLocationType;
|
|
122
124
|
}> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
|
|
123
125
|
type: TLocationType;
|
|
126
|
+
}> | Extract<_uniformdev_mesh_sdk.PersonalizationCriteriaLocation<TLocationValue, unknown>, {
|
|
127
|
+
type: TLocationType;
|
|
124
128
|
}>)["value"], Parameters<(Extract<_uniformdev_mesh_sdk.AssetLibraryLocation, {
|
|
125
129
|
type: TLocationType;
|
|
126
130
|
}> | Extract<_uniformdev_mesh_sdk.AssetParameterLocation, {
|
|
@@ -145,6 +149,8 @@ declare function useMeshLocation<TLocationType extends MeshLocation['type'], TLo
|
|
|
145
149
|
type: TLocationType;
|
|
146
150
|
}> | Extract<_uniformdev_mesh_sdk.AIGenerateLocation<TLocationValue>, {
|
|
147
151
|
type: TLocationType;
|
|
152
|
+
}> | Extract<_uniformdev_mesh_sdk.PersonalizationCriteriaLocation<TLocationValue, unknown>, {
|
|
153
|
+
type: TLocationType;
|
|
148
154
|
}>)["setValue"]>[0]>;
|
|
149
155
|
};
|
|
150
156
|
type SetLocationValueDispatch<TValue, TSetValue = TValue> = (dispatch: SetLocationValueFunction<TValue, TSetValue>) => Promise<void> | void;
|
|
@@ -966,12 +972,13 @@ type ObjectSearchResultItemProps = SelectedItemProps & {
|
|
|
966
972
|
* @default false
|
|
967
973
|
*/
|
|
968
974
|
disableDnD?: boolean;
|
|
975
|
+
onClick?: () => void;
|
|
969
976
|
};
|
|
970
977
|
/**
|
|
971
978
|
* @description An opinionated result item, best used for selected results
|
|
972
979
|
* @example <ObjectSearchResultItem id="my-result" title="title" />
|
|
973
980
|
*/
|
|
974
|
-
declare const ObjectSearchResultItem: ({ id, title, contentType, popoverData, publishStatus, editLinkIcon, editLink, imageUrl, onRemove, createdAt, publishedAt, hideRemoveButton, disableDnD, children, }: ObjectSearchResultItemProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
981
|
+
declare const ObjectSearchResultItem: ({ id, title, contentType, popoverData, publishStatus, editLinkIcon, editLink, imageUrl, onRemove, createdAt, publishedAt, hideRemoveButton, disableDnD, children, onClick, }: ObjectSearchResultItemProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
975
982
|
|
|
976
983
|
type SearchQueryProps<TExtraFilters = unknown> = {
|
|
977
984
|
/** sets the content type in the search context */
|
|
@@ -1681,6 +1688,8 @@ type SearchAndFilterProviderProps = {
|
|
|
1681
1688
|
resetFilterValues?: Filter[];
|
|
1682
1689
|
/** sets the list of filter options for each filter row */
|
|
1683
1690
|
filterOptions: FilterOptionGroup[];
|
|
1691
|
+
/** optional function that is used instead of the default reset filter functionality */
|
|
1692
|
+
onResetFilterValues?: () => void;
|
|
1684
1693
|
/** the total number of results */
|
|
1685
1694
|
totalResults?: number;
|
|
1686
1695
|
/** the filter mapper function */
|
|
@@ -1725,7 +1734,7 @@ declare const SearchAndFilterContext: React$1.Context<SearchAndFilterContextProp
|
|
|
1725
1734
|
* Search and filter provider
|
|
1726
1735
|
* @example <SearchAndFilterProvider filters={filters} filterOptions={filterOptions} onSearchChange={onSearchChange} onChange={onChange}>Children</SearchAndFilterProvider>
|
|
1727
1736
|
* */
|
|
1728
|
-
declare const SearchAndFilterProvider: ({ filters, filterOptions, filterVisible, alwaysVisible, defaultSearchTerm, onSearchChange, onChange, resetFilterValues, totalResults, filterMapper, children, allowBindingSearchTerm, }: SearchAndFilterProviderProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1737
|
+
declare const SearchAndFilterProvider: ({ filters, filterOptions, filterVisible, alwaysVisible, defaultSearchTerm, onSearchChange, onChange, resetFilterValues, onResetFilterValues, totalResults, filterMapper, children, allowBindingSearchTerm, }: SearchAndFilterProviderProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1729
1738
|
/** Search and filter hook
|
|
1730
1739
|
* @example const { searchTerm, setSearchTerm, filterVisibility, setFilterVisibility, filters, setFilters, handleAddFilter, handleResetFilters, handleDeleteFilter, filterOptions, validFilterQuery } = useSearchAndFilter();
|
|
1731
1740
|
*/
|
|
@@ -1788,7 +1797,7 @@ type SearchAndFilterProps = Omit<SearchAndFilterProviderProps, 'children'> & {
|
|
|
1788
1797
|
* Search and filter component
|
|
1789
1798
|
* @example <SearchAndFilter filters={filters} filterOptions={filterOptions} onChange={onChange} onSearchChange={onSearchChange} onSearchReset={onSearchReset} totalResults={totalResults} />
|
|
1790
1799
|
* */
|
|
1791
|
-
declare const SearchAndFilter: ({ filters, filterOptions, filterVisible, filterControls, viewSwitchControls, resultsContainerView, filterMapper, additionalFiltersContainer, onChange, defaultSearchTerm, onSearchChange, totalResults, allowBindingSearchTerm, resetFilterValues, }: SearchAndFilterProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1800
|
+
declare const SearchAndFilter: ({ filters, filterOptions, filterVisible, filterControls, viewSwitchControls, resultsContainerView, filterMapper, additionalFiltersContainer, onChange, defaultSearchTerm, onSearchChange, totalResults, allowBindingSearchTerm, resetFilterValues, onResetFilterValues, }: SearchAndFilterProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
1792
1801
|
|
|
1793
1802
|
type FilterItemsProps = {
|
|
1794
1803
|
/** The text for the add button */
|
package/dist/index.esm.js
CHANGED
|
@@ -3928,7 +3928,7 @@ var DataRefreshButton = ({
|
|
|
3928
3928
|
onRefreshData,
|
|
3929
3929
|
...props
|
|
3930
3930
|
}) => {
|
|
3931
|
-
return /* @__PURE__ */ jsxs22(Button2, { buttonType: "
|
|
3931
|
+
return /* @__PURE__ */ jsxs22(Button2, { buttonType: "ghost", onClick: onRefreshData, disabled: isLoading, ...props, children: [
|
|
3932
3932
|
!isLoading ? null : /* @__PURE__ */ jsx47(
|
|
3933
3933
|
LoadingIndicator3,
|
|
3934
3934
|
{
|
|
@@ -4398,7 +4398,7 @@ var ObjectSearchFilterContainer2 = ({ children }) => {
|
|
|
4398
4398
|
};
|
|
4399
4399
|
|
|
4400
4400
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
4401
|
-
import { Button as Button3, Chip as Chip2, Popover as Popover2 } from "@uniformdev/design-system";
|
|
4401
|
+
import { Button as Button3, Chip as Chip2, Link, Popover as Popover2 } from "@uniformdev/design-system";
|
|
4402
4402
|
import { format as timeagoFormat } from "timeago.js";
|
|
4403
4403
|
|
|
4404
4404
|
// src/components/Image/Image.tsx
|
|
@@ -4510,6 +4510,11 @@ var ObjectSearchResultItemTimeStamp = css19`
|
|
|
4510
4510
|
color: var(--gray-500);
|
|
4511
4511
|
font-size: var(--fs-xs);
|
|
4512
4512
|
`;
|
|
4513
|
+
var ObjectSearchResultItemTitleLink = css19`
|
|
4514
|
+
text-decoration: none;
|
|
4515
|
+
color: var(--primary-action-default);
|
|
4516
|
+
font-size: var(--fs-sm);
|
|
4517
|
+
`;
|
|
4513
4518
|
var ObjectSearchAuthorStateGroup = css19`
|
|
4514
4519
|
align-items: center;
|
|
4515
4520
|
display: flex;
|
|
@@ -4544,7 +4549,8 @@ var ObjectSearchResultItem = ({
|
|
|
4544
4549
|
publishedAt,
|
|
4545
4550
|
hideRemoveButton = false,
|
|
4546
4551
|
disableDnD = false,
|
|
4547
|
-
children
|
|
4552
|
+
children,
|
|
4553
|
+
onClick
|
|
4548
4554
|
}) => {
|
|
4549
4555
|
const { onSelectItem } = useObjectSearchContext();
|
|
4550
4556
|
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
@@ -4567,7 +4573,19 @@ var ObjectSearchResultItem = ({
|
|
|
4567
4573
|
/* @__PURE__ */ jsxs27("div", { children: [
|
|
4568
4574
|
/* @__PURE__ */ jsx55("span", { css: ObjectSearchResultItemSubtitle, "data-testid": "sub-title", children: formatedContentType }),
|
|
4569
4575
|
/* @__PURE__ */ jsxs27("span", { role: "heading", css: ObjectSearchResultItemTitle, "data-testid": "title", children: [
|
|
4570
|
-
|
|
4576
|
+
onClick ? /* @__PURE__ */ jsx55(
|
|
4577
|
+
Link,
|
|
4578
|
+
{
|
|
4579
|
+
onClick: (e) => {
|
|
4580
|
+
e.preventDefault();
|
|
4581
|
+
e.stopPropagation();
|
|
4582
|
+
onClick();
|
|
4583
|
+
},
|
|
4584
|
+
href: editLink,
|
|
4585
|
+
text: title != null ? title : name,
|
|
4586
|
+
css: ObjectSearchResultItemTitleLink
|
|
4587
|
+
}
|
|
4588
|
+
) : /* @__PURE__ */ jsx55("span", { children: title != null ? title : name }),
|
|
4571
4589
|
!popoverData ? null : /* @__PURE__ */ jsx55(Popover2, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4572
4590
|
] }),
|
|
4573
4591
|
!createdAt && !publishStatus ? null : /* @__PURE__ */ jsxs27("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
@@ -6214,8 +6232,6 @@ var SearchAndFilterOptionsContainer = css21`
|
|
|
6214
6232
|
gap: var(--spacing-sm);
|
|
6215
6233
|
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
6216
6234
|
will-change: height;
|
|
6217
|
-
position: relative;
|
|
6218
|
-
z-index: 2;
|
|
6219
6235
|
`;
|
|
6220
6236
|
var SearchAndFilterOptionsInnerContainer = css21`
|
|
6221
6237
|
display: flex;
|
|
@@ -6234,8 +6250,6 @@ var SearchAndFilterAdditionalContainer = css21`
|
|
|
6234
6250
|
flex-wrap: nowrap;
|
|
6235
6251
|
gap: var(--spacing-base);
|
|
6236
6252
|
padding: var(--spacing-base) var(--spacing-md) 0;
|
|
6237
|
-
position: relative;
|
|
6238
|
-
z-index: 0;
|
|
6239
6253
|
`;
|
|
6240
6254
|
|
|
6241
6255
|
// src/components/SearchAndFilter/FilterButton.tsx
|
|
@@ -6394,6 +6408,7 @@ var SearchAndFilterProvider = ({
|
|
|
6394
6408
|
onSearchChange,
|
|
6395
6409
|
onChange,
|
|
6396
6410
|
resetFilterValues = [{ field: "", operator: "", value: "" }],
|
|
6411
|
+
onResetFilterValues,
|
|
6397
6412
|
totalResults,
|
|
6398
6413
|
filterMapper: filterMapper2 = filterMapper,
|
|
6399
6414
|
children,
|
|
@@ -6422,9 +6437,12 @@ var SearchAndFilterProvider = ({
|
|
|
6422
6437
|
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
6423
6438
|
}, [filters, onChange]);
|
|
6424
6439
|
const handleResetFilters = useCallback6(() => {
|
|
6440
|
+
if (onResetFilterValues) {
|
|
6441
|
+
return onResetFilterValues();
|
|
6442
|
+
}
|
|
6425
6443
|
onSearchChange == null ? void 0 : onSearchChange("");
|
|
6426
6444
|
onChange(resetFilterValues);
|
|
6427
|
-
}, [onChange, resetFilterValues, onSearchChange]);
|
|
6445
|
+
}, [onChange, resetFilterValues, onSearchChange, onResetFilterValues]);
|
|
6428
6446
|
const handleDeleteFilter = useCallback6(
|
|
6429
6447
|
(index) => {
|
|
6430
6448
|
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
@@ -7051,7 +7069,8 @@ var SearchAndFilter = ({
|
|
|
7051
7069
|
onSearchChange,
|
|
7052
7070
|
totalResults,
|
|
7053
7071
|
allowBindingSearchTerm = false,
|
|
7054
|
-
resetFilterValues = []
|
|
7072
|
+
resetFilterValues = [],
|
|
7073
|
+
onResetFilterValues
|
|
7055
7074
|
}) => {
|
|
7056
7075
|
return /* @__PURE__ */ jsx79(
|
|
7057
7076
|
SearchAndFilterProvider,
|
|
@@ -7066,6 +7085,7 @@ var SearchAndFilter = ({
|
|
|
7066
7085
|
resetFilterValues,
|
|
7067
7086
|
filterMapper: filterMapper2,
|
|
7068
7087
|
allowBindingSearchTerm,
|
|
7088
|
+
onResetFilterValues,
|
|
7069
7089
|
children: /* @__PURE__ */ jsxs38(VerticalRhythm7, { "data-testid": "search-and-filter", children: [
|
|
7070
7090
|
/* @__PURE__ */ jsxs38("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
|
|
7071
7091
|
/* @__PURE__ */ jsx79(
|
package/dist/index.js
CHANGED
|
@@ -4026,7 +4026,7 @@ var DataRefreshButton = ({
|
|
|
4026
4026
|
onRefreshData,
|
|
4027
4027
|
...props
|
|
4028
4028
|
}) => {
|
|
4029
|
-
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system20.Button, { buttonType: "
|
|
4029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_design_system20.Button, { buttonType: "ghost", onClick: onRefreshData, disabled: isLoading, ...props, children: [
|
|
4030
4030
|
!isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4031
4031
|
import_design_system20.LoadingIndicator,
|
|
4032
4032
|
{
|
|
@@ -4601,6 +4601,11 @@ var ObjectSearchResultItemTimeStamp = import_react49.css`
|
|
|
4601
4601
|
color: var(--gray-500);
|
|
4602
4602
|
font-size: var(--fs-xs);
|
|
4603
4603
|
`;
|
|
4604
|
+
var ObjectSearchResultItemTitleLink = import_react49.css`
|
|
4605
|
+
text-decoration: none;
|
|
4606
|
+
color: var(--primary-action-default);
|
|
4607
|
+
font-size: var(--fs-sm);
|
|
4608
|
+
`;
|
|
4604
4609
|
var ObjectSearchAuthorStateGroup = import_react49.css`
|
|
4605
4610
|
align-items: center;
|
|
4606
4611
|
display: flex;
|
|
@@ -4635,7 +4640,8 @@ var ObjectSearchResultItem = ({
|
|
|
4635
4640
|
publishedAt,
|
|
4636
4641
|
hideRemoveButton = false,
|
|
4637
4642
|
disableDnD = false,
|
|
4638
|
-
children
|
|
4643
|
+
children,
|
|
4644
|
+
onClick
|
|
4639
4645
|
}) => {
|
|
4640
4646
|
const { onSelectItem } = useObjectSearchContext();
|
|
4641
4647
|
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
@@ -4658,7 +4664,19 @@ var ObjectSearchResultItem = ({
|
|
|
4658
4664
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { children: [
|
|
4659
4665
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { css: ObjectSearchResultItemSubtitle, "data-testid": "sub-title", children: formatedContentType }),
|
|
4660
4666
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { role: "heading", css: ObjectSearchResultItemTitle, "data-testid": "title", children: [
|
|
4661
|
-
|
|
4667
|
+
onClick ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4668
|
+
import_design_system26.Link,
|
|
4669
|
+
{
|
|
4670
|
+
onClick: (e) => {
|
|
4671
|
+
e.preventDefault();
|
|
4672
|
+
e.stopPropagation();
|
|
4673
|
+
onClick();
|
|
4674
|
+
},
|
|
4675
|
+
href: editLink,
|
|
4676
|
+
text: title != null ? title : name,
|
|
4677
|
+
css: ObjectSearchResultItemTitleLink
|
|
4678
|
+
}
|
|
4679
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { children: title != null ? title : name }),
|
|
4662
4680
|
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_design_system26.Popover, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4663
4681
|
] }),
|
|
4664
4682
|
!createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
@@ -6287,8 +6305,6 @@ var SearchAndFilterOptionsContainer = import_react63.css`
|
|
|
6287
6305
|
gap: var(--spacing-sm);
|
|
6288
6306
|
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
6289
6307
|
will-change: height;
|
|
6290
|
-
position: relative;
|
|
6291
|
-
z-index: 2;
|
|
6292
6308
|
`;
|
|
6293
6309
|
var SearchAndFilterOptionsInnerContainer = import_react63.css`
|
|
6294
6310
|
display: flex;
|
|
@@ -6307,8 +6323,6 @@ var SearchAndFilterAdditionalContainer = import_react63.css`
|
|
|
6307
6323
|
flex-wrap: nowrap;
|
|
6308
6324
|
gap: var(--spacing-base);
|
|
6309
6325
|
padding: var(--spacing-base) var(--spacing-md) 0;
|
|
6310
|
-
position: relative;
|
|
6311
|
-
z-index: 0;
|
|
6312
6326
|
`;
|
|
6313
6327
|
|
|
6314
6328
|
// src/components/SearchAndFilter/FilterButton.tsx
|
|
@@ -6459,6 +6473,7 @@ var SearchAndFilterProvider = ({
|
|
|
6459
6473
|
onSearchChange,
|
|
6460
6474
|
onChange,
|
|
6461
6475
|
resetFilterValues = [{ field: "", operator: "", value: "" }],
|
|
6476
|
+
onResetFilterValues,
|
|
6462
6477
|
totalResults,
|
|
6463
6478
|
filterMapper: filterMapper2 = filterMapper,
|
|
6464
6479
|
children,
|
|
@@ -6487,9 +6502,12 @@ var SearchAndFilterProvider = ({
|
|
|
6487
6502
|
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
6488
6503
|
}, [filters, onChange]);
|
|
6489
6504
|
const handleResetFilters = (0, import_react64.useCallback)(() => {
|
|
6505
|
+
if (onResetFilterValues) {
|
|
6506
|
+
return onResetFilterValues();
|
|
6507
|
+
}
|
|
6490
6508
|
onSearchChange == null ? void 0 : onSearchChange("");
|
|
6491
6509
|
onChange(resetFilterValues);
|
|
6492
|
-
}, [onChange, resetFilterValues, onSearchChange]);
|
|
6510
|
+
}, [onChange, resetFilterValues, onSearchChange, onResetFilterValues]);
|
|
6493
6511
|
const handleDeleteFilter = (0, import_react64.useCallback)(
|
|
6494
6512
|
(index) => {
|
|
6495
6513
|
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
@@ -7116,7 +7134,8 @@ var SearchAndFilter = ({
|
|
|
7116
7134
|
onSearchChange,
|
|
7117
7135
|
totalResults,
|
|
7118
7136
|
allowBindingSearchTerm = false,
|
|
7119
|
-
resetFilterValues = []
|
|
7137
|
+
resetFilterValues = [],
|
|
7138
|
+
onResetFilterValues
|
|
7120
7139
|
}) => {
|
|
7121
7140
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7122
7141
|
SearchAndFilterProvider,
|
|
@@ -7131,6 +7150,7 @@ var SearchAndFilter = ({
|
|
|
7131
7150
|
resetFilterValues,
|
|
7132
7151
|
filterMapper: filterMapper2,
|
|
7133
7152
|
allowBindingSearchTerm,
|
|
7153
|
+
onResetFilterValues,
|
|
7134
7154
|
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_design_system49.VerticalRhythm, { "data-testid": "search-and-filter", children: [
|
|
7135
7155
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
|
|
7136
7156
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
package/dist/index.mjs
CHANGED
|
@@ -3928,7 +3928,7 @@ var DataRefreshButton = ({
|
|
|
3928
3928
|
onRefreshData,
|
|
3929
3929
|
...props
|
|
3930
3930
|
}) => {
|
|
3931
|
-
return /* @__PURE__ */ jsxs22(Button2, { buttonType: "
|
|
3931
|
+
return /* @__PURE__ */ jsxs22(Button2, { buttonType: "ghost", onClick: onRefreshData, disabled: isLoading, ...props, children: [
|
|
3932
3932
|
!isLoading ? null : /* @__PURE__ */ jsx47(
|
|
3933
3933
|
LoadingIndicator3,
|
|
3934
3934
|
{
|
|
@@ -4398,7 +4398,7 @@ var ObjectSearchFilterContainer2 = ({ children }) => {
|
|
|
4398
4398
|
};
|
|
4399
4399
|
|
|
4400
4400
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
4401
|
-
import { Button as Button3, Chip as Chip2, Popover as Popover2 } from "@uniformdev/design-system";
|
|
4401
|
+
import { Button as Button3, Chip as Chip2, Link, Popover as Popover2 } from "@uniformdev/design-system";
|
|
4402
4402
|
import { format as timeagoFormat } from "timeago.js";
|
|
4403
4403
|
|
|
4404
4404
|
// src/components/Image/Image.tsx
|
|
@@ -4510,6 +4510,11 @@ var ObjectSearchResultItemTimeStamp = css19`
|
|
|
4510
4510
|
color: var(--gray-500);
|
|
4511
4511
|
font-size: var(--fs-xs);
|
|
4512
4512
|
`;
|
|
4513
|
+
var ObjectSearchResultItemTitleLink = css19`
|
|
4514
|
+
text-decoration: none;
|
|
4515
|
+
color: var(--primary-action-default);
|
|
4516
|
+
font-size: var(--fs-sm);
|
|
4517
|
+
`;
|
|
4513
4518
|
var ObjectSearchAuthorStateGroup = css19`
|
|
4514
4519
|
align-items: center;
|
|
4515
4520
|
display: flex;
|
|
@@ -4544,7 +4549,8 @@ var ObjectSearchResultItem = ({
|
|
|
4544
4549
|
publishedAt,
|
|
4545
4550
|
hideRemoveButton = false,
|
|
4546
4551
|
disableDnD = false,
|
|
4547
|
-
children
|
|
4552
|
+
children,
|
|
4553
|
+
onClick
|
|
4548
4554
|
}) => {
|
|
4549
4555
|
const { onSelectItem } = useObjectSearchContext();
|
|
4550
4556
|
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
@@ -4567,7 +4573,19 @@ var ObjectSearchResultItem = ({
|
|
|
4567
4573
|
/* @__PURE__ */ jsxs27("div", { children: [
|
|
4568
4574
|
/* @__PURE__ */ jsx55("span", { css: ObjectSearchResultItemSubtitle, "data-testid": "sub-title", children: formatedContentType }),
|
|
4569
4575
|
/* @__PURE__ */ jsxs27("span", { role: "heading", css: ObjectSearchResultItemTitle, "data-testid": "title", children: [
|
|
4570
|
-
|
|
4576
|
+
onClick ? /* @__PURE__ */ jsx55(
|
|
4577
|
+
Link,
|
|
4578
|
+
{
|
|
4579
|
+
onClick: (e) => {
|
|
4580
|
+
e.preventDefault();
|
|
4581
|
+
e.stopPropagation();
|
|
4582
|
+
onClick();
|
|
4583
|
+
},
|
|
4584
|
+
href: editLink,
|
|
4585
|
+
text: title != null ? title : name,
|
|
4586
|
+
css: ObjectSearchResultItemTitleLink
|
|
4587
|
+
}
|
|
4588
|
+
) : /* @__PURE__ */ jsx55("span", { children: title != null ? title : name }),
|
|
4571
4589
|
!popoverData ? null : /* @__PURE__ */ jsx55(Popover2, { ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
4572
4590
|
] }),
|
|
4573
4591
|
!createdAt && !publishStatus ? null : /* @__PURE__ */ jsxs27("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
@@ -6214,8 +6232,6 @@ var SearchAndFilterOptionsContainer = css21`
|
|
|
6214
6232
|
gap: var(--spacing-sm);
|
|
6215
6233
|
padding: var(--spacing-md) 0 var(--spacing-base);
|
|
6216
6234
|
will-change: height;
|
|
6217
|
-
position: relative;
|
|
6218
|
-
z-index: 2;
|
|
6219
6235
|
`;
|
|
6220
6236
|
var SearchAndFilterOptionsInnerContainer = css21`
|
|
6221
6237
|
display: flex;
|
|
@@ -6234,8 +6250,6 @@ var SearchAndFilterAdditionalContainer = css21`
|
|
|
6234
6250
|
flex-wrap: nowrap;
|
|
6235
6251
|
gap: var(--spacing-base);
|
|
6236
6252
|
padding: var(--spacing-base) var(--spacing-md) 0;
|
|
6237
|
-
position: relative;
|
|
6238
|
-
z-index: 0;
|
|
6239
6253
|
`;
|
|
6240
6254
|
|
|
6241
6255
|
// src/components/SearchAndFilter/FilterButton.tsx
|
|
@@ -6394,6 +6408,7 @@ var SearchAndFilterProvider = ({
|
|
|
6394
6408
|
onSearchChange,
|
|
6395
6409
|
onChange,
|
|
6396
6410
|
resetFilterValues = [{ field: "", operator: "", value: "" }],
|
|
6411
|
+
onResetFilterValues,
|
|
6397
6412
|
totalResults,
|
|
6398
6413
|
filterMapper: filterMapper2 = filterMapper,
|
|
6399
6414
|
children,
|
|
@@ -6422,9 +6437,12 @@ var SearchAndFilterProvider = ({
|
|
|
6422
6437
|
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
6423
6438
|
}, [filters, onChange]);
|
|
6424
6439
|
const handleResetFilters = useCallback6(() => {
|
|
6440
|
+
if (onResetFilterValues) {
|
|
6441
|
+
return onResetFilterValues();
|
|
6442
|
+
}
|
|
6425
6443
|
onSearchChange == null ? void 0 : onSearchChange("");
|
|
6426
6444
|
onChange(resetFilterValues);
|
|
6427
|
-
}, [onChange, resetFilterValues, onSearchChange]);
|
|
6445
|
+
}, [onChange, resetFilterValues, onSearchChange, onResetFilterValues]);
|
|
6428
6446
|
const handleDeleteFilter = useCallback6(
|
|
6429
6447
|
(index) => {
|
|
6430
6448
|
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
@@ -7051,7 +7069,8 @@ var SearchAndFilter = ({
|
|
|
7051
7069
|
onSearchChange,
|
|
7052
7070
|
totalResults,
|
|
7053
7071
|
allowBindingSearchTerm = false,
|
|
7054
|
-
resetFilterValues = []
|
|
7072
|
+
resetFilterValues = [],
|
|
7073
|
+
onResetFilterValues
|
|
7055
7074
|
}) => {
|
|
7056
7075
|
return /* @__PURE__ */ jsx79(
|
|
7057
7076
|
SearchAndFilterProvider,
|
|
@@ -7066,6 +7085,7 @@ var SearchAndFilter = ({
|
|
|
7066
7085
|
resetFilterValues,
|
|
7067
7086
|
filterMapper: filterMapper2,
|
|
7068
7087
|
allowBindingSearchTerm,
|
|
7088
|
+
onResetFilterValues,
|
|
7069
7089
|
children: /* @__PURE__ */ jsxs38(VerticalRhythm7, { "data-testid": "search-and-filter", children: [
|
|
7070
7090
|
/* @__PURE__ */ jsxs38("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
|
|
7071
7091
|
/* @__PURE__ */ jsx79(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk-react",
|
|
3
|
-
"version": "20.8.
|
|
3
|
+
"version": "20.8.2-alpha.21+42bfa4ce42",
|
|
4
4
|
"description": "Uniform Mesh Framework SDK for React",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@lexical/selection": "0.25.0",
|
|
51
51
|
"@lexical/utils": "0.25.0",
|
|
52
52
|
"@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v5.2.1/react-icons-all-files-5.2.1.tgz",
|
|
53
|
-
"@uniformdev/canvas": "20.8.
|
|
54
|
-
"@uniformdev/design-system": "20.8.
|
|
55
|
-
"@uniformdev/mesh-sdk": "20.8.
|
|
56
|
-
"@uniformdev/richtext": "20.8.
|
|
53
|
+
"@uniformdev/canvas": "20.8.2-alpha.21+42bfa4ce42",
|
|
54
|
+
"@uniformdev/design-system": "20.8.2-alpha.21+42bfa4ce42",
|
|
55
|
+
"@uniformdev/mesh-sdk": "20.8.2-alpha.21+42bfa4ce42",
|
|
56
|
+
"@uniformdev/richtext": "20.8.2-alpha.21+42bfa4ce42",
|
|
57
57
|
"dequal": "^2.0.3",
|
|
58
58
|
"lexical": "0.25.0",
|
|
59
59
|
"mitt": "3.0.1",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "42bfa4ce42d4efdd35192096f1d4c23577e6cf2b"
|
|
90
90
|
}
|