@uniformdev/mesh-sdk-react 19.80.0 → 19.80.1-alpha.149
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 +8 -18
- package/dist/index.d.ts +8 -18
- package/dist/index.esm.js +190 -172
- package/dist/index.js +195 -177
- package/dist/index.mjs +190 -172
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -5136,7 +5136,6 @@ var tableCellDragIcon = css25`
|
|
|
5136
5136
|
`;
|
|
5137
5137
|
var variableName = css25`
|
|
5138
5138
|
border: none;
|
|
5139
|
-
color: var(--brand-secondary-5);
|
|
5140
5139
|
font-weight: var(--fw-medium);
|
|
5141
5140
|
padding: 0;
|
|
5142
5141
|
background: none;
|
|
@@ -5246,7 +5245,7 @@ function VariablesList() {
|
|
|
5246
5245
|
{
|
|
5247
5246
|
onButtonClick: () => dispatch({ type: "edit", variable: "" }),
|
|
5248
5247
|
"aria-label": "Add variable",
|
|
5249
|
-
buttonText: "
|
|
5248
|
+
buttonText: "Add variable",
|
|
5250
5249
|
icon: "math-plus",
|
|
5251
5250
|
css: { marginLeft: "var(--spacing-md)" }
|
|
5252
5251
|
}
|
|
@@ -6141,9 +6140,9 @@ var DataRefreshButton = ({
|
|
|
6141
6140
|
};
|
|
6142
6141
|
|
|
6143
6142
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6144
|
-
import { css as
|
|
6143
|
+
import { css as css32 } from "@emotion/react";
|
|
6145
6144
|
import { bindVariables } from "@uniformdev/canvas";
|
|
6146
|
-
import { Container, IconsProvider, ScrollableList, VerticalRhythm as VerticalRhythm2 } from "@uniformdev/design-system";
|
|
6145
|
+
import { Callout as Callout5, Container, IconsProvider, ScrollableList, VerticalRhythm as VerticalRhythm2 } from "@uniformdev/design-system";
|
|
6147
6146
|
|
|
6148
6147
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
6149
6148
|
import { bindVariablesToObject as bindVariablesToObject2 } from "@uniformdev/canvas";
|
|
@@ -6168,9 +6167,14 @@ var ObjectSearchContext = createContext5({
|
|
|
6168
6167
|
},
|
|
6169
6168
|
selectedListItems: [],
|
|
6170
6169
|
onRemoveAllSelectedItems: () => {
|
|
6171
|
-
}
|
|
6170
|
+
},
|
|
6171
|
+
isMulti: false
|
|
6172
6172
|
});
|
|
6173
|
-
var ObjectSearchProvider = ({
|
|
6173
|
+
var ObjectSearchProvider = ({
|
|
6174
|
+
currentlySelectedItems,
|
|
6175
|
+
isMulti = false,
|
|
6176
|
+
children
|
|
6177
|
+
}) => {
|
|
6174
6178
|
const [query, setQuery] = useState15({
|
|
6175
6179
|
contentType: "",
|
|
6176
6180
|
keyword: ""
|
|
@@ -6224,6 +6228,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
|
|
|
6224
6228
|
selectedListItems: selectedItems,
|
|
6225
6229
|
onRemoveAllSelectedItems,
|
|
6226
6230
|
list,
|
|
6231
|
+
isMulti,
|
|
6227
6232
|
onSetList
|
|
6228
6233
|
}),
|
|
6229
6234
|
[
|
|
@@ -6234,6 +6239,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
|
|
|
6234
6239
|
selectedItems,
|
|
6235
6240
|
onRemoveAllSelectedItems,
|
|
6236
6241
|
list,
|
|
6242
|
+
isMulti,
|
|
6237
6243
|
onSetList
|
|
6238
6244
|
]
|
|
6239
6245
|
);
|
|
@@ -6254,8 +6260,148 @@ function bindQuery(query, inputs) {
|
|
|
6254
6260
|
return result;
|
|
6255
6261
|
}
|
|
6256
6262
|
|
|
6257
|
-
// src/components/ObjectSearch/
|
|
6263
|
+
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
6264
|
+
import { Chip, Popover } from "@uniformdev/design-system";
|
|
6265
|
+
|
|
6266
|
+
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
6267
|
+
import { css as css31 } from "@emotion/react";
|
|
6268
|
+
import { skeletonLoading } from "@uniformdev/design-system";
|
|
6269
|
+
var ObjectListItemContainer = css31`
|
|
6270
|
+
align-items: center;
|
|
6271
|
+
border: 1px solid var(--gray-300);
|
|
6272
|
+
border-radius: var(--rounded-base);
|
|
6273
|
+
background: var(--white);
|
|
6274
|
+
display: grid;
|
|
6275
|
+
grid-template-columns: 1fr auto;
|
|
6276
|
+
padding: var(--spacing-sm);
|
|
6277
|
+
`;
|
|
6278
|
+
var ObjectListItemContainerDisabled = css31`
|
|
6279
|
+
opacity: var(--opacity-50);
|
|
6280
|
+
pointer-events: none;
|
|
6281
|
+
`;
|
|
6282
|
+
var ObjectListItemLoading = css31`
|
|
6283
|
+
animation: ${skeletonLoading} 1s linear infinite alternate;
|
|
6284
|
+
border-color: transparent;
|
|
6285
|
+
min-height: 42px;
|
|
6286
|
+
position: relative;
|
|
6287
|
+
|
|
6288
|
+
&:before,
|
|
6289
|
+
&:after {
|
|
6290
|
+
background: var(--gray-200);
|
|
6291
|
+
content: '';
|
|
6292
|
+
display: block;
|
|
6293
|
+
height: 1rem;
|
|
6294
|
+
}
|
|
6295
|
+
|
|
6296
|
+
&:before {
|
|
6297
|
+
border-radius: var(--rounded-base);
|
|
6298
|
+
width: 10rem;
|
|
6299
|
+
}
|
|
6300
|
+
|
|
6301
|
+
&:after {
|
|
6302
|
+
border-radius: var(--rounded-full);
|
|
6303
|
+
width: 1rem;
|
|
6304
|
+
}
|
|
6305
|
+
`;
|
|
6306
|
+
var ObjectListItemHeadingGroup = css31`
|
|
6307
|
+
align-items: center;
|
|
6308
|
+
display: grid;
|
|
6309
|
+
`;
|
|
6310
|
+
var ObjectListItemThumbnail = css31`
|
|
6311
|
+
width: 30px;
|
|
6312
|
+
object-fit: contain;
|
|
6313
|
+
`;
|
|
6314
|
+
var ObjectListItemTitle = css31`
|
|
6315
|
+
color: var(--brand-secondary-1);
|
|
6316
|
+
display: block;
|
|
6317
|
+
font-size: var(--fs-sm);
|
|
6318
|
+
`;
|
|
6319
|
+
var ObjectListItemSubtitle = css31`
|
|
6320
|
+
color: var(--gray-500);
|
|
6321
|
+
display: block;
|
|
6322
|
+
font-size: var(--fs-xs);
|
|
6323
|
+
line-height: 1;
|
|
6324
|
+
`;
|
|
6325
|
+
var ObjectListItemInfoContainer = css31`
|
|
6326
|
+
align-items: center;
|
|
6327
|
+
display: flex;
|
|
6328
|
+
gap: var(--spacing-sm);
|
|
6329
|
+
justify-content: center;
|
|
6330
|
+
`;
|
|
6331
|
+
var ObjectListItemControlledContent = css31`
|
|
6332
|
+
display: flex;
|
|
6333
|
+
gap: var(--spacing-sm);
|
|
6334
|
+
`;
|
|
6335
|
+
var ObjectListItemUnControlledContent = css31`
|
|
6336
|
+
margin-top: var(--spacing-sm);
|
|
6337
|
+
grid-column: 1 / -1;
|
|
6338
|
+
`;
|
|
6339
|
+
|
|
6340
|
+
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
6258
6341
|
import { jsx as jsx59, jsxs as jsxs34 } from "@emotion/react/jsx-runtime";
|
|
6342
|
+
var ObjectSearchListItem = ({
|
|
6343
|
+
id,
|
|
6344
|
+
title,
|
|
6345
|
+
contentType,
|
|
6346
|
+
image,
|
|
6347
|
+
imageUrl,
|
|
6348
|
+
popoverData,
|
|
6349
|
+
onSelect,
|
|
6350
|
+
isMulti,
|
|
6351
|
+
disabled,
|
|
6352
|
+
children
|
|
6353
|
+
}) => {
|
|
6354
|
+
const { onSelectItem, selectedListItems, isMulti: globalIsMulti } = useObjectSearchContext();
|
|
6355
|
+
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
6356
|
+
const handleSelectItem = () => {
|
|
6357
|
+
var _a;
|
|
6358
|
+
const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
|
|
6359
|
+
const selectedItem = { id, title, contentType, imageUrl, image, popoverData, ...extraData };
|
|
6360
|
+
if (isMulti === true || globalIsMulti) {
|
|
6361
|
+
return onSelectItem(selectedItem);
|
|
6362
|
+
}
|
|
6363
|
+
return onSelectItem([selectedItem]);
|
|
6364
|
+
};
|
|
6365
|
+
const selected = selectedListItems.some((item) => item.id === id);
|
|
6366
|
+
return /* @__PURE__ */ jsxs34(
|
|
6367
|
+
"div",
|
|
6368
|
+
{
|
|
6369
|
+
role: "listitem",
|
|
6370
|
+
css: [ObjectListItemContainer, disabled ? ObjectListItemContainerDisabled : void 0],
|
|
6371
|
+
"data-testid": "list-item",
|
|
6372
|
+
children: [
|
|
6373
|
+
/* @__PURE__ */ jsxs34(
|
|
6374
|
+
"div",
|
|
6375
|
+
{
|
|
6376
|
+
role: "button",
|
|
6377
|
+
onClick: handleSelectItem,
|
|
6378
|
+
css: ObjectListItemControlledContent,
|
|
6379
|
+
"aria-disabled": disabled,
|
|
6380
|
+
children: [
|
|
6381
|
+
!imageUrl ? null : /* @__PURE__ */ jsx59("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectListItemThumbnail }),
|
|
6382
|
+
!image || imageUrl ? null : /* @__PURE__ */ jsx59("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
|
|
6383
|
+
/* @__PURE__ */ jsxs34("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
|
|
6384
|
+
!contentType ? null : /* @__PURE__ */ jsx59("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
|
|
6385
|
+
/* @__PURE__ */ jsx59("span", { css: ObjectListItemTitle, "data-testid": "title", children: title })
|
|
6386
|
+
] })
|
|
6387
|
+
]
|
|
6388
|
+
}
|
|
6389
|
+
),
|
|
6390
|
+
/* @__PURE__ */ jsxs34("div", { css: ObjectListItemInfoContainer, children: [
|
|
6391
|
+
selected ? /* @__PURE__ */ jsx59(Chip, { text: "selected", size: "xs" }) : null,
|
|
6392
|
+
!popoverData ? null : /* @__PURE__ */ jsx59(Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, iconColor: "default", children: popoverData })
|
|
6393
|
+
] }),
|
|
6394
|
+
!children ? null : /* @__PURE__ */ jsx59("div", { css: ObjectListItemUnControlledContent, children })
|
|
6395
|
+
]
|
|
6396
|
+
}
|
|
6397
|
+
);
|
|
6398
|
+
};
|
|
6399
|
+
var ObjectSearchListItemLoadingSkeleton = () => {
|
|
6400
|
+
return /* @__PURE__ */ jsx59("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
|
|
6401
|
+
};
|
|
6402
|
+
|
|
6403
|
+
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6404
|
+
import { jsx as jsx60, jsxs as jsxs35 } from "@emotion/react/jsx-runtime";
|
|
6259
6405
|
var ObjectSearchContainer = ({
|
|
6260
6406
|
label,
|
|
6261
6407
|
enableDynamicInputToResultId,
|
|
@@ -6267,19 +6413,20 @@ var ObjectSearchContainer = ({
|
|
|
6267
6413
|
const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
|
|
6268
6414
|
const { flatVariables } = useVariables(true);
|
|
6269
6415
|
const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
|
|
6270
|
-
const
|
|
6416
|
+
const listItems = resultList != null ? resultList : /* @__PURE__ */ jsx60(DefaultResultList, {});
|
|
6417
|
+
const body = /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
|
|
6271
6418
|
searchFilters,
|
|
6272
|
-
|
|
6419
|
+
/* @__PURE__ */ jsx60(
|
|
6273
6420
|
ScrollableList,
|
|
6274
6421
|
{
|
|
6275
6422
|
role: "list",
|
|
6276
|
-
css:
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
children:
|
|
6423
|
+
css: css32`
|
|
6424
|
+
> div {
|
|
6425
|
+
transition: max-height var(--duration-slow) var(--timing-ease-out);
|
|
6426
|
+
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
6427
|
+
}
|
|
6428
|
+
`,
|
|
6429
|
+
children: listItems
|
|
6283
6430
|
}
|
|
6284
6431
|
)
|
|
6285
6432
|
] });
|
|
@@ -6310,8 +6457,8 @@ var ObjectSearchContainer = ({
|
|
|
6310
6457
|
}
|
|
6311
6458
|
]);
|
|
6312
6459
|
};
|
|
6313
|
-
return /* @__PURE__ */
|
|
6314
|
-
/* @__PURE__ */
|
|
6460
|
+
return /* @__PURE__ */ jsx60(IconsProvider, { children: /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
|
|
6461
|
+
/* @__PURE__ */ jsx60(Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ jsx60(
|
|
6315
6462
|
InputVariables,
|
|
6316
6463
|
{
|
|
6317
6464
|
label,
|
|
@@ -6329,14 +6476,25 @@ var ObjectSearchContainer = ({
|
|
|
6329
6476
|
children
|
|
6330
6477
|
] }) });
|
|
6331
6478
|
};
|
|
6479
|
+
var DefaultResultList = () => {
|
|
6480
|
+
var _a;
|
|
6481
|
+
const { list } = useObjectSearchContext();
|
|
6482
|
+
if (!list.items) {
|
|
6483
|
+
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ jsx60(ObjectSearchListItemLoadingSkeleton, {}, i));
|
|
6484
|
+
}
|
|
6485
|
+
if (list.items.length === 0) {
|
|
6486
|
+
return /* @__PURE__ */ jsx60(Callout5, { type: "info", children: "No results were found" });
|
|
6487
|
+
}
|
|
6488
|
+
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ jsx60(ObjectSearchListItem, { ...item }, item.id));
|
|
6489
|
+
};
|
|
6332
6490
|
|
|
6333
6491
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6334
6492
|
import { InputKeywordSearch as InputKeywordSearch2, InputSelect as InputSelect6 } from "@uniformdev/design-system";
|
|
6335
6493
|
import { useMemo as useMemo15, useState as useState16 } from "react";
|
|
6336
6494
|
|
|
6337
6495
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
6338
|
-
import { css as
|
|
6339
|
-
var ObjectSearchFilterContainerLabel =
|
|
6496
|
+
import { css as css33 } from "@emotion/react";
|
|
6497
|
+
var ObjectSearchFilterContainerLabel = css33`
|
|
6340
6498
|
align-items: center;
|
|
6341
6499
|
display: flex;
|
|
6342
6500
|
font-size: var(--fs-sm);
|
|
@@ -6344,18 +6502,18 @@ var ObjectSearchFilterContainerLabel = css32`
|
|
|
6344
6502
|
line-height: 1rem;
|
|
6345
6503
|
margin-bottom: var(--spacing-sm);
|
|
6346
6504
|
`;
|
|
6347
|
-
var ObjectSearchFilterContainer =
|
|
6505
|
+
var ObjectSearchFilterContainer = css33`
|
|
6348
6506
|
display: grid;
|
|
6349
6507
|
gap: var(--spacing-base);
|
|
6350
6508
|
`;
|
|
6351
|
-
var ObjectSearchFilterGrid = (gridColumns) =>
|
|
6509
|
+
var ObjectSearchFilterGrid = (gridColumns) => css33`
|
|
6352
6510
|
display: grid;
|
|
6353
6511
|
grid-template-columns: ${gridColumns};
|
|
6354
6512
|
gap: var(--spacing-base);
|
|
6355
6513
|
`;
|
|
6356
6514
|
|
|
6357
6515
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6358
|
-
import { jsx as
|
|
6516
|
+
import { jsx as jsx61, jsxs as jsxs36 } from "@emotion/react/jsx-runtime";
|
|
6359
6517
|
var ObjectSearchFilter = ({
|
|
6360
6518
|
requireContentType,
|
|
6361
6519
|
typeSelectorAllTypesOptionText = "All content types",
|
|
@@ -6388,7 +6546,7 @@ var ObjectSearchFilter = ({
|
|
|
6388
6546
|
];
|
|
6389
6547
|
}, [requireContentType, typeSelectorAllTypesOptionText, selectOptions]);
|
|
6390
6548
|
const shouldRenderSelect = memoizedSelectOptions.length > 0;
|
|
6391
|
-
return /* @__PURE__ */
|
|
6549
|
+
return /* @__PURE__ */ jsxs36(
|
|
6392
6550
|
"fieldset",
|
|
6393
6551
|
{
|
|
6394
6552
|
css: [
|
|
@@ -6396,7 +6554,7 @@ var ObjectSearchFilter = ({
|
|
|
6396
6554
|
ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
|
|
6397
6555
|
],
|
|
6398
6556
|
children: [
|
|
6399
|
-
memoizedSelectOptions.length ? /* @__PURE__ */
|
|
6557
|
+
memoizedSelectOptions.length ? /* @__PURE__ */ jsx61(
|
|
6400
6558
|
InputSelect6,
|
|
6401
6559
|
{
|
|
6402
6560
|
label: selectLabel,
|
|
@@ -6406,7 +6564,7 @@ var ObjectSearchFilter = ({
|
|
|
6406
6564
|
value: query.contentType
|
|
6407
6565
|
}
|
|
6408
6566
|
) : null,
|
|
6409
|
-
/* @__PURE__ */
|
|
6567
|
+
/* @__PURE__ */ jsx61(
|
|
6410
6568
|
InputKeywordSearch2,
|
|
6411
6569
|
{
|
|
6412
6570
|
inputFieldName: searchInputName,
|
|
@@ -6423,154 +6581,14 @@ var ObjectSearchFilter = ({
|
|
|
6423
6581
|
};
|
|
6424
6582
|
|
|
6425
6583
|
// src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
|
|
6426
|
-
import { jsx as
|
|
6584
|
+
import { jsx as jsx62, jsxs as jsxs37 } from "@emotion/react/jsx-runtime";
|
|
6427
6585
|
var ObjectSearchFilterContainer2 = ({ label, children }) => {
|
|
6428
|
-
return /* @__PURE__ */
|
|
6429
|
-
label ? /* @__PURE__ */
|
|
6430
|
-
/* @__PURE__ */
|
|
6586
|
+
return /* @__PURE__ */ jsxs37("div", { children: [
|
|
6587
|
+
label ? /* @__PURE__ */ jsx62("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
|
|
6588
|
+
/* @__PURE__ */ jsx62("div", { css: ObjectSearchFilterContainer, children })
|
|
6431
6589
|
] });
|
|
6432
6590
|
};
|
|
6433
6591
|
|
|
6434
|
-
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
6435
|
-
import { Chip, Popover } from "@uniformdev/design-system";
|
|
6436
|
-
|
|
6437
|
-
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
6438
|
-
import { css as css33 } from "@emotion/react";
|
|
6439
|
-
import { skeletonLoading } from "@uniformdev/design-system";
|
|
6440
|
-
var ObjectListItemContainer = css33`
|
|
6441
|
-
align-items: center;
|
|
6442
|
-
border: 1px solid var(--gray-300);
|
|
6443
|
-
border-radius: var(--rounded-base);
|
|
6444
|
-
background: var(--white);
|
|
6445
|
-
display: grid;
|
|
6446
|
-
grid-template-columns: 1fr auto;
|
|
6447
|
-
padding: var(--spacing-sm);
|
|
6448
|
-
`;
|
|
6449
|
-
var ObjectListItemContainerDisabled = css33`
|
|
6450
|
-
opacity: var(--opacity-50);
|
|
6451
|
-
pointer-events: none;
|
|
6452
|
-
`;
|
|
6453
|
-
var ObjectListItemLoading = css33`
|
|
6454
|
-
animation: ${skeletonLoading} 1s linear infinite alternate;
|
|
6455
|
-
border-color: transparent;
|
|
6456
|
-
min-height: 42px;
|
|
6457
|
-
position: relative;
|
|
6458
|
-
|
|
6459
|
-
&:before,
|
|
6460
|
-
&:after {
|
|
6461
|
-
background: var(--gray-200);
|
|
6462
|
-
content: '';
|
|
6463
|
-
display: block;
|
|
6464
|
-
height: 1rem;
|
|
6465
|
-
}
|
|
6466
|
-
|
|
6467
|
-
&:before {
|
|
6468
|
-
border-radius: var(--rounded-base);
|
|
6469
|
-
width: 10rem;
|
|
6470
|
-
}
|
|
6471
|
-
|
|
6472
|
-
&:after {
|
|
6473
|
-
border-radius: var(--rounded-full);
|
|
6474
|
-
width: 1rem;
|
|
6475
|
-
}
|
|
6476
|
-
`;
|
|
6477
|
-
var ObjectListItemHeadingGroup = css33`
|
|
6478
|
-
align-items: center;
|
|
6479
|
-
display: grid;
|
|
6480
|
-
`;
|
|
6481
|
-
var ObjectListItemThumbnail = css33`
|
|
6482
|
-
width: 30px;
|
|
6483
|
-
object-fit: contain;
|
|
6484
|
-
`;
|
|
6485
|
-
var ObjectListItemTitle = css33`
|
|
6486
|
-
color: var(--brand-secondary-1);
|
|
6487
|
-
display: block;
|
|
6488
|
-
font-size: var(--fs-sm);
|
|
6489
|
-
`;
|
|
6490
|
-
var ObjectListItemSubtitle = css33`
|
|
6491
|
-
color: var(--gray-500);
|
|
6492
|
-
display: block;
|
|
6493
|
-
font-size: var(--fs-xs);
|
|
6494
|
-
line-height: 1;
|
|
6495
|
-
`;
|
|
6496
|
-
var ObjectListItemInfoContainer = css33`
|
|
6497
|
-
align-items: center;
|
|
6498
|
-
display: flex;
|
|
6499
|
-
gap: var(--spacing-sm);
|
|
6500
|
-
justify-content: center;
|
|
6501
|
-
`;
|
|
6502
|
-
var ObjectListItemControlledContent = css33`
|
|
6503
|
-
display: flex;
|
|
6504
|
-
gap: var(--spacing-sm);
|
|
6505
|
-
`;
|
|
6506
|
-
var ObjectListItemUnControlledContent = css33`
|
|
6507
|
-
margin-top: var(--spacing-sm);
|
|
6508
|
-
grid-column: 1 / -1;
|
|
6509
|
-
`;
|
|
6510
|
-
|
|
6511
|
-
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
6512
|
-
import { jsx as jsx62, jsxs as jsxs37 } from "@emotion/react/jsx-runtime";
|
|
6513
|
-
var ObjectSearchListItem = ({
|
|
6514
|
-
id,
|
|
6515
|
-
title,
|
|
6516
|
-
contentType,
|
|
6517
|
-
image,
|
|
6518
|
-
imageUrl,
|
|
6519
|
-
popoverData,
|
|
6520
|
-
onSelect,
|
|
6521
|
-
isMulti = false,
|
|
6522
|
-
disabled,
|
|
6523
|
-
children
|
|
6524
|
-
}) => {
|
|
6525
|
-
const { onSelectItem, selectedListItems } = useObjectSearchContext();
|
|
6526
|
-
const formatedContentType = Array.isArray(contentType) ? contentType.join(", ") : contentType;
|
|
6527
|
-
const handleSelectItem = () => {
|
|
6528
|
-
var _a;
|
|
6529
|
-
const extraData = (_a = onSelect == null ? void 0 : onSelect()) != null ? _a : {};
|
|
6530
|
-
const selectedItem = { id, title, contentType, imageUrl, image, popoverData, ...extraData };
|
|
6531
|
-
if (isMulti) {
|
|
6532
|
-
return onSelectItem(selectedItem);
|
|
6533
|
-
}
|
|
6534
|
-
return onSelectItem([selectedItem]);
|
|
6535
|
-
};
|
|
6536
|
-
const selected = selectedListItems.some((item) => item.id === id);
|
|
6537
|
-
return /* @__PURE__ */ jsxs37(
|
|
6538
|
-
"div",
|
|
6539
|
-
{
|
|
6540
|
-
role: "listitem",
|
|
6541
|
-
css: [ObjectListItemContainer, disabled ? ObjectListItemContainerDisabled : void 0],
|
|
6542
|
-
"data-testid": "list-item",
|
|
6543
|
-
children: [
|
|
6544
|
-
/* @__PURE__ */ jsxs37(
|
|
6545
|
-
"div",
|
|
6546
|
-
{
|
|
6547
|
-
role: "button",
|
|
6548
|
-
onClick: handleSelectItem,
|
|
6549
|
-
css: ObjectListItemControlledContent,
|
|
6550
|
-
"aria-disabled": disabled,
|
|
6551
|
-
children: [
|
|
6552
|
-
!imageUrl ? null : /* @__PURE__ */ jsx62("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectListItemThumbnail }),
|
|
6553
|
-
!image || imageUrl ? null : /* @__PURE__ */ jsx62("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
|
|
6554
|
-
/* @__PURE__ */ jsxs37("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
|
|
6555
|
-
!contentType ? null : /* @__PURE__ */ jsx62("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
|
|
6556
|
-
/* @__PURE__ */ jsx62("span", { css: ObjectListItemTitle, "data-testid": "title", children: title })
|
|
6557
|
-
] })
|
|
6558
|
-
]
|
|
6559
|
-
}
|
|
6560
|
-
),
|
|
6561
|
-
/* @__PURE__ */ jsxs37("div", { css: ObjectListItemInfoContainer, children: [
|
|
6562
|
-
selected ? /* @__PURE__ */ jsx62(Chip, { text: "selected", size: "xs" }) : null,
|
|
6563
|
-
!popoverData ? null : /* @__PURE__ */ jsx62(Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, iconColor: "default", children: popoverData })
|
|
6564
|
-
] }),
|
|
6565
|
-
!children ? null : /* @__PURE__ */ jsx62("div", { css: ObjectListItemUnControlledContent, children })
|
|
6566
|
-
]
|
|
6567
|
-
}
|
|
6568
|
-
);
|
|
6569
|
-
};
|
|
6570
|
-
var ObjectSearchListItemLoadingSkeleton = () => {
|
|
6571
|
-
return /* @__PURE__ */ jsx62("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
|
|
6572
|
-
};
|
|
6573
|
-
|
|
6574
6592
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
6575
6593
|
import { Badge, Button as Button4, Popover as Popover2 } from "@uniformdev/design-system";
|
|
6576
6594
|
import { format as timeagoFormat } from "timeago.js";
|
|
@@ -7114,7 +7132,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
7114
7132
|
import {
|
|
7115
7133
|
AddListButton as AddListButton2,
|
|
7116
7134
|
Button as Button6,
|
|
7117
|
-
Callout as
|
|
7135
|
+
Callout as Callout6,
|
|
7118
7136
|
DrawerContent,
|
|
7119
7137
|
Heading,
|
|
7120
7138
|
Input as Input6,
|
|
@@ -7153,7 +7171,7 @@ export {
|
|
|
7153
7171
|
$isVariableNode,
|
|
7154
7172
|
AddListButton2 as AddListButton,
|
|
7155
7173
|
Button6 as Button,
|
|
7156
|
-
|
|
7174
|
+
Callout6 as Callout,
|
|
7157
7175
|
ControlledValuePlugin,
|
|
7158
7176
|
DISCONNECT_VARIABLE_COMMAND,
|
|
7159
7177
|
DamSelectedItem,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk-react",
|
|
3
|
-
"version": "19.80.
|
|
3
|
+
"version": "19.80.1-alpha.149+7f4e45fecc",
|
|
4
4
|
"description": "Uniform Mesh Framework SDK for React",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -50,15 +50,15 @@
|
|
|
50
50
|
"@lexical/selection": "^0.12.0",
|
|
51
51
|
"@lexical/utils": "^0.12.0",
|
|
52
52
|
"@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v4.10.1/react-icons-all-files-4.10.1.tgz",
|
|
53
|
-
"@uniformdev/canvas": "19.80.
|
|
54
|
-
"@uniformdev/design-system": "19.80.
|
|
55
|
-
"@uniformdev/mesh-sdk": "19.80.
|
|
53
|
+
"@uniformdev/canvas": "19.80.1-alpha.149+7f4e45fecc",
|
|
54
|
+
"@uniformdev/design-system": "19.80.1-alpha.149+7f4e45fecc",
|
|
55
|
+
"@uniformdev/mesh-sdk": "19.80.1-alpha.149+7f4e45fecc",
|
|
56
56
|
"dequal": "^2.0.3",
|
|
57
57
|
"lexical": "^0.12.0",
|
|
58
58
|
"mitt": "^3.0.0",
|
|
59
59
|
"react-beautiful-dnd": "13.1.1",
|
|
60
60
|
"react-hook-form": "^7.47.0",
|
|
61
|
-
"react-use": "17.4.
|
|
61
|
+
"react-use": "17.4.2",
|
|
62
62
|
"timeago.js": "4.0.2",
|
|
63
63
|
"uuid": "9.0.1",
|
|
64
64
|
"zod": "3.22.4"
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"@emotion/react": "11.11.1",
|
|
74
74
|
"@storybook/react": "6.5.16",
|
|
75
75
|
"@svgr/cli": "6.5.1",
|
|
76
|
-
"@types/react": "18.2.
|
|
77
|
-
"@types/react-beautiful-dnd": "13.1.
|
|
78
|
-
"@types/react-dom": "18.2.
|
|
76
|
+
"@types/react": "18.2.40",
|
|
77
|
+
"@types/react-beautiful-dnd": "13.1.7",
|
|
78
|
+
"@types/react-dom": "18.2.17",
|
|
79
79
|
"@types/uuid": "9.0.4",
|
|
80
80
|
"react": "18.2.0",
|
|
81
81
|
"react-dom": "18.2.0"
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "7f4e45fecc013dc224fbd0a2975f6d208382b05e"
|
|
90
90
|
}
|