@uniformdev/mesh-sdk-react 19.108.0 → 19.112.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.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.esm.js +392 -360
- package/dist/index.js +746 -714
- package/dist/index.mjs +392 -360
- package/package.json +5 -5
package/dist/index.esm.js
CHANGED
|
@@ -1375,8 +1375,8 @@ import {
|
|
|
1375
1375
|
scrollbarStyles as scrollbarStyles2
|
|
1376
1376
|
} from "@uniformdev/design-system";
|
|
1377
1377
|
import * as React5 from "react";
|
|
1378
|
-
import {
|
|
1379
|
-
import { useDebounce as
|
|
1378
|
+
import { Draggable, Droppable } from "react-beautiful-dnd";
|
|
1379
|
+
import { useDebounce as useDebounce3 } from "react-use";
|
|
1380
1380
|
import { v4 } from "uuid";
|
|
1381
1381
|
|
|
1382
1382
|
// src/hooks/useLoadingDelay.ts
|
|
@@ -1412,6 +1412,23 @@ function useLoadingDelay(loading, { delay = 500, minDuration = 200 } = {
|
|
|
1412
1412
|
return state === "DISPLAY" || state === "EXPIRE";
|
|
1413
1413
|
}
|
|
1414
1414
|
|
|
1415
|
+
// src/components/DragDropContext.tsx
|
|
1416
|
+
import { useState as useState4 } from "react";
|
|
1417
|
+
import { DragDropContext as BaseDragDropContext } from "react-beautiful-dnd";
|
|
1418
|
+
import { useDebounce as useDebounce2 } from "react-use";
|
|
1419
|
+
import { jsx as jsx21 } from "@emotion/react/jsx-runtime";
|
|
1420
|
+
function DragDropContext({ children, ...props }) {
|
|
1421
|
+
const [isReady, setIsReady] = useState4(false);
|
|
1422
|
+
useDebounce2(
|
|
1423
|
+
() => {
|
|
1424
|
+
setIsReady(true);
|
|
1425
|
+
},
|
|
1426
|
+
300,
|
|
1427
|
+
[]
|
|
1428
|
+
);
|
|
1429
|
+
return /* @__PURE__ */ jsx21(BaseDragDropContext, { ...props, children: isReady ? children : null });
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1415
1432
|
// src/components/legacy/EntrySearch/styles/EntrySearch.styles.ts
|
|
1416
1433
|
import { css as css10 } from "@emotion/react";
|
|
1417
1434
|
var entrySearchWrapper = css10`
|
|
@@ -1524,7 +1541,7 @@ var badgeIcon = css10`
|
|
|
1524
1541
|
`;
|
|
1525
1542
|
|
|
1526
1543
|
// src/components/legacy/EntrySearch/EntrySearch.tsx
|
|
1527
|
-
import { Fragment as Fragment3, jsx as
|
|
1544
|
+
import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs10 } from "@emotion/react/jsx-runtime";
|
|
1528
1545
|
var DefaultNoResults = ({ searchText, selectedContentType }) => {
|
|
1529
1546
|
let message = "No content found";
|
|
1530
1547
|
if (selectedContentType && selectedContentType !== "any") {
|
|
@@ -1533,7 +1550,7 @@ var DefaultNoResults = ({ searchText, selectedContentType }) => {
|
|
|
1533
1550
|
if (searchText) {
|
|
1534
1551
|
message = `${message} for keyword '${searchText}'.`;
|
|
1535
1552
|
}
|
|
1536
|
-
return /* @__PURE__ */
|
|
1553
|
+
return /* @__PURE__ */ jsx22(Callout, { type: "info", children: message });
|
|
1537
1554
|
};
|
|
1538
1555
|
var EntrySearch = ({
|
|
1539
1556
|
search,
|
|
@@ -1577,7 +1594,7 @@ var EntrySearch = ({
|
|
|
1577
1594
|
const [selectedListItems, setSelectedListItems] = React5.useState([]);
|
|
1578
1595
|
const [loadingMore, setLoadingMore] = React5.useState(false);
|
|
1579
1596
|
const listBoxId = React5.useRef(`x${v4()}`);
|
|
1580
|
-
|
|
1597
|
+
useDebounce3(
|
|
1581
1598
|
() => {
|
|
1582
1599
|
search(textInput, {
|
|
1583
1600
|
count: pageSize,
|
|
@@ -1656,7 +1673,7 @@ var EntrySearch = ({
|
|
|
1656
1673
|
const ResolvedSelectedItemComponent = selectedItemComponent || DefaultSelectedItem;
|
|
1657
1674
|
const ResolvedNoResultsComponent = noResultsComponent || DefaultNoResults;
|
|
1658
1675
|
const CompIcon = logoIcon && typeof logoIcon !== "string" ? logoIcon : null;
|
|
1659
|
-
const resolvedIcon = CompIcon ? /* @__PURE__ */
|
|
1676
|
+
const resolvedIcon = CompIcon ? /* @__PURE__ */ jsx22(CompIcon, { css: badgeIcon }) : /* @__PURE__ */ jsx22("img", { src: logoIcon, alt: "Logo", css: badgeIcon });
|
|
1660
1677
|
const onDragEnd = (res) => {
|
|
1661
1678
|
var _a2, _b2;
|
|
1662
1679
|
if (res.destination && res.source.droppableId === ((_a2 = res.destination) == null ? void 0 : _a2.droppableId)) {
|
|
@@ -1670,7 +1687,7 @@ var EntrySearch = ({
|
|
|
1670
1687
|
return result;
|
|
1671
1688
|
}
|
|
1672
1689
|
};
|
|
1673
|
-
return /* @__PURE__ */
|
|
1690
|
+
return /* @__PURE__ */ jsx22(
|
|
1674
1691
|
"div",
|
|
1675
1692
|
{
|
|
1676
1693
|
css: css11`
|
|
@@ -1685,7 +1702,7 @@ var EntrySearch = ({
|
|
|
1685
1702
|
`,
|
|
1686
1703
|
children: [
|
|
1687
1704
|
showSearchBox ? /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
1688
|
-
/* @__PURE__ */
|
|
1705
|
+
/* @__PURE__ */ jsx22("div", { css: entrySearchWrapper, "data-testid": "component-search", children: /* @__PURE__ */ jsxs10(
|
|
1689
1706
|
"button",
|
|
1690
1707
|
{
|
|
1691
1708
|
css: entrySearchBtn,
|
|
@@ -1696,7 +1713,7 @@ var EntrySearch = ({
|
|
|
1696
1713
|
"aria-controls": `entry-search-config-${listBoxId.current}`,
|
|
1697
1714
|
children: [
|
|
1698
1715
|
resolvedIcon,
|
|
1699
|
-
/* @__PURE__ */
|
|
1716
|
+
/* @__PURE__ */ jsx22(
|
|
1700
1717
|
"span",
|
|
1701
1718
|
{
|
|
1702
1719
|
css: css11`
|
|
@@ -1705,7 +1722,7 @@ var EntrySearch = ({
|
|
|
1705
1722
|
children: "Select"
|
|
1706
1723
|
}
|
|
1707
1724
|
),
|
|
1708
|
-
/* @__PURE__ */
|
|
1725
|
+
/* @__PURE__ */ jsx22("span", { css: entrySearchSelectIcon, children: /* @__PURE__ */ jsx22(
|
|
1709
1726
|
ChevronDown_default,
|
|
1710
1727
|
{
|
|
1711
1728
|
css: [
|
|
@@ -1736,7 +1753,7 @@ var EntrySearch = ({
|
|
|
1736
1753
|
margin-bottom: var(--spacing-base);
|
|
1737
1754
|
`,
|
|
1738
1755
|
children: [
|
|
1739
|
-
/* @__PURE__ */
|
|
1756
|
+
/* @__PURE__ */ jsx22(
|
|
1740
1757
|
InputSelect3,
|
|
1741
1758
|
{
|
|
1742
1759
|
onChange: (e) => setContentTypeSelected(e.target.value),
|
|
@@ -1754,13 +1771,13 @@ var EntrySearch = ({
|
|
|
1754
1771
|
]
|
|
1755
1772
|
}
|
|
1756
1773
|
),
|
|
1757
|
-
/* @__PURE__ */
|
|
1774
|
+
/* @__PURE__ */ jsx22(
|
|
1758
1775
|
"div",
|
|
1759
1776
|
{
|
|
1760
1777
|
css: css11`
|
|
1761
1778
|
flex-grow: 1;
|
|
1762
1779
|
`,
|
|
1763
|
-
children: /* @__PURE__ */
|
|
1780
|
+
children: /* @__PURE__ */ jsx22(
|
|
1764
1781
|
InputKeywordSearch,
|
|
1765
1782
|
{
|
|
1766
1783
|
inputFieldName: "searchText",
|
|
@@ -1784,8 +1801,8 @@ var EntrySearch = ({
|
|
|
1784
1801
|
tabIndex: 0,
|
|
1785
1802
|
"data-testid": "entry-list",
|
|
1786
1803
|
children: [
|
|
1787
|
-
/* @__PURE__ */
|
|
1788
|
-
Array.isArray(results) && results.length > 0 ? results.map((result) => /* @__PURE__ */
|
|
1804
|
+
/* @__PURE__ */ jsx22(LoadingOverlay, { isActive: showLoadingOverlay }),
|
|
1805
|
+
Array.isArray(results) && results.length > 0 ? results.map((result) => /* @__PURE__ */ jsx22(
|
|
1789
1806
|
ResolvedRowComponent,
|
|
1790
1807
|
{
|
|
1791
1808
|
isSelected: selectedListItems.some((item) => item.id === result.id),
|
|
@@ -1793,14 +1810,14 @@ var EntrySearch = ({
|
|
|
1793
1810
|
triggerSelection: () => handleListItemSelect(result)
|
|
1794
1811
|
},
|
|
1795
1812
|
result.id
|
|
1796
|
-
)) : resultsLoading ? null : /* @__PURE__ */
|
|
1813
|
+
)) : resultsLoading ? null : /* @__PURE__ */ jsx22(
|
|
1797
1814
|
ResolvedNoResultsComponent,
|
|
1798
1815
|
{
|
|
1799
1816
|
searchText: textInput || textInput,
|
|
1800
1817
|
selectedContentType: (_b = (_a = contentTypes == null ? void 0 : contentTypes.find((t) => t.id === contentTypeSelected)) == null ? void 0 : _a.name) != null ? _b : contentTypeSelected
|
|
1801
1818
|
}
|
|
1802
1819
|
),
|
|
1803
|
-
!resultsLoading && typeof totalResults !== "undefined" && results && (results == null ? void 0 : results.length) < totalResults && /* @__PURE__ */
|
|
1820
|
+
!resultsLoading && typeof totalResults !== "undefined" && results && (results == null ? void 0 : results.length) < totalResults && /* @__PURE__ */ jsx22("button", { type: "button", css: entrySearchLoadMoreBtn, onClick: handleLoadMoreClick, children: !loadingMore ? "Load More" : /* @__PURE__ */ jsx22(LoadingIndicator, {}) })
|
|
1804
1821
|
]
|
|
1805
1822
|
}
|
|
1806
1823
|
),
|
|
@@ -1812,12 +1829,12 @@ var EntrySearch = ({
|
|
|
1812
1829
|
justify-content: space-between;
|
|
1813
1830
|
`,
|
|
1814
1831
|
children: [
|
|
1815
|
-
/* @__PURE__ */
|
|
1832
|
+
/* @__PURE__ */ jsx22("div", { children: onAddNew && ((_c = contentTypes == null ? void 0 : contentTypes.length) != null ? _c : 0) > 0 ? /* @__PURE__ */ jsx22(
|
|
1816
1833
|
Menu,
|
|
1817
1834
|
{
|
|
1818
1835
|
menuLabel: "Add new menu",
|
|
1819
|
-
menuTrigger: /* @__PURE__ */
|
|
1820
|
-
children: contentTypes == null ? void 0 : contentTypes.map((ct) => /* @__PURE__ */
|
|
1836
|
+
menuTrigger: /* @__PURE__ */ jsx22(Button, { buttonType: "secondary", children: "Add New" }),
|
|
1837
|
+
children: contentTypes == null ? void 0 : contentTypes.map((ct) => /* @__PURE__ */ jsx22(
|
|
1821
1838
|
MenuItem,
|
|
1822
1839
|
{
|
|
1823
1840
|
css: css11`
|
|
@@ -1839,8 +1856,8 @@ var EntrySearch = ({
|
|
|
1839
1856
|
gap: var(--spacing-base);
|
|
1840
1857
|
`,
|
|
1841
1858
|
children: [
|
|
1842
|
-
/* @__PURE__ */
|
|
1843
|
-
/* @__PURE__ */
|
|
1859
|
+
/* @__PURE__ */ jsx22(Button, { buttonType: "unimportant", onClick: handleCancelClick, children: "Cancel" }),
|
|
1860
|
+
/* @__PURE__ */ jsx22(
|
|
1844
1861
|
Button,
|
|
1845
1862
|
{
|
|
1846
1863
|
disabled: !selectedListItems.length,
|
|
@@ -1861,7 +1878,7 @@ var EntrySearch = ({
|
|
|
1861
1878
|
] }) : null,
|
|
1862
1879
|
!listOpen ? multiSelect && selectedListItems.length > 1 ? (
|
|
1863
1880
|
//enable dnd only if selected more then 1 item
|
|
1864
|
-
/* @__PURE__ */
|
|
1881
|
+
/* @__PURE__ */ jsx22(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx22(Droppable, { droppableId: multiSelectId || "canvas-multi-select", children: (provided) => /* @__PURE__ */ jsxs10(
|
|
1865
1882
|
"div",
|
|
1866
1883
|
{
|
|
1867
1884
|
...provided.droppableProps,
|
|
@@ -1872,7 +1889,7 @@ var EntrySearch = ({
|
|
|
1872
1889
|
children: [
|
|
1873
1890
|
selectedListItems == null ? void 0 : selectedListItems.map((selectedItem, index) => {
|
|
1874
1891
|
if (selectedItem == null ? void 0 : selectedItem.id) {
|
|
1875
|
-
return /* @__PURE__ */
|
|
1892
|
+
return /* @__PURE__ */ jsx22(Draggable, { draggableId: selectedItem.id, index, children: (provided2, snapshot) => {
|
|
1876
1893
|
return /* @__PURE__ */ jsxs10(
|
|
1877
1894
|
"div",
|
|
1878
1895
|
{
|
|
@@ -1883,7 +1900,7 @@ var EntrySearch = ({
|
|
|
1883
1900
|
...provided2.dragHandleProps,
|
|
1884
1901
|
children: [
|
|
1885
1902
|
/* @__PURE__ */ jsxs10("span", { css: draggableIconWrapper, children: [
|
|
1886
|
-
/* @__PURE__ */
|
|
1903
|
+
/* @__PURE__ */ jsx22(
|
|
1887
1904
|
MoreVerticalAlt_default,
|
|
1888
1905
|
{
|
|
1889
1906
|
css: [draggableIcon, draggableIconOffset],
|
|
@@ -1891,9 +1908,9 @@ var EntrySearch = ({
|
|
|
1891
1908
|
height: 24
|
|
1892
1909
|
}
|
|
1893
1910
|
),
|
|
1894
|
-
/* @__PURE__ */
|
|
1911
|
+
/* @__PURE__ */ jsx22(MoreVerticalAlt_default, { css: draggableIcon, width: 24, height: 24 })
|
|
1895
1912
|
] }),
|
|
1896
|
-
/* @__PURE__ */
|
|
1913
|
+
/* @__PURE__ */ jsx22(
|
|
1897
1914
|
ResolvedSelectedItemComponent,
|
|
1898
1915
|
{
|
|
1899
1916
|
logoIcon,
|
|
@@ -1913,7 +1930,7 @@ var EntrySearch = ({
|
|
|
1913
1930
|
]
|
|
1914
1931
|
}
|
|
1915
1932
|
) }) })
|
|
1916
|
-
) : selectedListItems == null ? void 0 : selectedListItems.map((selectedItem) => /* @__PURE__ */
|
|
1933
|
+
) : selectedListItems == null ? void 0 : selectedListItems.map((selectedItem) => /* @__PURE__ */ jsx22(
|
|
1917
1934
|
ResolvedSelectedItemComponent,
|
|
1918
1935
|
{
|
|
1919
1936
|
logoIcon,
|
|
@@ -1978,7 +1995,7 @@ var productSearchRowActiveIcon = css12`
|
|
|
1978
1995
|
`;
|
|
1979
1996
|
|
|
1980
1997
|
// src/components/commerce/ProductSearchRow.tsx
|
|
1981
|
-
import { jsx as
|
|
1998
|
+
import { jsx as jsx23, jsxs as jsxs11 } from "@emotion/react/jsx-runtime";
|
|
1982
1999
|
function ProductSearchRow({
|
|
1983
2000
|
result,
|
|
1984
2001
|
isSelected,
|
|
@@ -1988,7 +2005,7 @@ function ProductSearchRow({
|
|
|
1988
2005
|
const { categories, logoIcon } = useProductSearchContext();
|
|
1989
2006
|
const [category] = result.categories || [{ id: "", name: "" }];
|
|
1990
2007
|
const categoryName = typeof category === "undefined" || !categories ? void 0 : (_a = categories.find((c) => c.id === category.id)) == null ? void 0 : _a.name;
|
|
1991
|
-
return /* @__PURE__ */
|
|
2008
|
+
return /* @__PURE__ */ jsx23(
|
|
1992
2009
|
"div",
|
|
1993
2010
|
{
|
|
1994
2011
|
"data-value": result.id,
|
|
@@ -1997,7 +2014,7 @@ function ProductSearchRow({
|
|
|
1997
2014
|
onClick: () => triggerSelection(),
|
|
1998
2015
|
css: [productSearchRowContainer],
|
|
1999
2016
|
children: /* @__PURE__ */ jsxs11("div", { css: [productSearchRowContent, isSelected ? productSearchRowContentActive : void 0], children: [
|
|
2000
|
-
result.thumbnailUrl ? /* @__PURE__ */
|
|
2017
|
+
result.thumbnailUrl ? /* @__PURE__ */ jsx23(
|
|
2001
2018
|
"img",
|
|
2002
2019
|
{
|
|
2003
2020
|
src: result.thumbnailUrl,
|
|
@@ -2009,7 +2026,7 @@ function ProductSearchRow({
|
|
|
2009
2026
|
object-fit: cover;
|
|
2010
2027
|
`
|
|
2011
2028
|
}
|
|
2012
|
-
) : /* @__PURE__ */
|
|
2029
|
+
) : /* @__PURE__ */ jsx23(
|
|
2013
2030
|
Image,
|
|
2014
2031
|
{
|
|
2015
2032
|
src: logoIcon,
|
|
@@ -2022,14 +2039,14 @@ function ProductSearchRow({
|
|
|
2022
2039
|
),
|
|
2023
2040
|
/* @__PURE__ */ jsxs11("h4", { css: [productSearchRowTitle], children: [
|
|
2024
2041
|
result.title,
|
|
2025
|
-
categoryName ? /* @__PURE__ */
|
|
2042
|
+
categoryName ? /* @__PURE__ */ jsx23("span", { css: [productSearchRowCategory], children: categoryName }) : null
|
|
2026
2043
|
] }),
|
|
2027
2044
|
/* @__PURE__ */ jsxs11("p", { css: [productSearchRowDetails], children: [
|
|
2028
2045
|
"SKU: ",
|
|
2029
2046
|
result.sku || result.id,
|
|
2030
|
-
result.price !== void 0 ? /* @__PURE__ */
|
|
2047
|
+
result.price !== void 0 ? /* @__PURE__ */ jsx23("span", { children: result.price }) : null
|
|
2031
2048
|
] }),
|
|
2032
|
-
isSelected ? /* @__PURE__ */
|
|
2049
|
+
isSelected ? /* @__PURE__ */ jsx23(Checkmark_default, { css: [productSearchRowActiveIcon] }) : null
|
|
2033
2050
|
] })
|
|
2034
2051
|
},
|
|
2035
2052
|
result.id
|
|
@@ -2114,7 +2131,7 @@ var productSelectedItemLinkContainer = css14`
|
|
|
2114
2131
|
`;
|
|
2115
2132
|
|
|
2116
2133
|
// src/components/commerce/ProductSelectedItem.tsx
|
|
2117
|
-
import { jsx as
|
|
2134
|
+
import { jsx as jsx24, jsxs as jsxs12 } from "@emotion/react/jsx-runtime";
|
|
2118
2135
|
function ProductSelectedItem({
|
|
2119
2136
|
selectedItem,
|
|
2120
2137
|
onDeselect
|
|
@@ -2123,9 +2140,9 @@ function ProductSelectedItem({
|
|
|
2123
2140
|
const { categories, logoIcon } = useProductSearchContext();
|
|
2124
2141
|
const [category] = selectedItem.categories || [{ id: "", name: "" }];
|
|
2125
2142
|
const categoryName = typeof category === "undefined" || !categories ? void 0 : (_a = categories.find((c) => c.id === category.id)) == null ? void 0 : _a.name;
|
|
2126
|
-
return /* @__PURE__ */
|
|
2143
|
+
return /* @__PURE__ */ jsx24("div", { css: [productSelectedItemContainer], children: /* @__PURE__ */ jsxs12("article", { css: [productSelectedItemDetails], children: [
|
|
2127
2144
|
/* @__PURE__ */ jsxs12("div", { css: [productSelectedItemContent], children: [
|
|
2128
|
-
selectedItem.thumbnailUrl ? /* @__PURE__ */
|
|
2145
|
+
selectedItem.thumbnailUrl ? /* @__PURE__ */ jsx24(
|
|
2129
2146
|
"img",
|
|
2130
2147
|
{
|
|
2131
2148
|
src: selectedItem.thumbnailUrl,
|
|
@@ -2133,7 +2150,7 @@ function ProductSelectedItem({
|
|
|
2133
2150
|
css: [productSelectedItemImage],
|
|
2134
2151
|
loading: "lazy"
|
|
2135
2152
|
}
|
|
2136
|
-
) : /* @__PURE__ */
|
|
2153
|
+
) : /* @__PURE__ */ jsx24("div", { css: [productSelectedItemImage] }),
|
|
2137
2154
|
/* @__PURE__ */ jsxs12(
|
|
2138
2155
|
"div",
|
|
2139
2156
|
{
|
|
@@ -2152,7 +2169,7 @@ function ProductSelectedItem({
|
|
|
2152
2169
|
`,
|
|
2153
2170
|
children: [
|
|
2154
2171
|
selectedItem.title || selectedItem.id || "",
|
|
2155
|
-
categoryName && /* @__PURE__ */
|
|
2172
|
+
categoryName && /* @__PURE__ */ jsx24(
|
|
2156
2173
|
"span",
|
|
2157
2174
|
{
|
|
2158
2175
|
css: css15`
|
|
@@ -2178,7 +2195,7 @@ function ProductSelectedItem({
|
|
|
2178
2195
|
`,
|
|
2179
2196
|
children: [
|
|
2180
2197
|
/* @__PURE__ */ jsxs12("li", { children: [
|
|
2181
|
-
/* @__PURE__ */
|
|
2198
|
+
/* @__PURE__ */ jsx24(
|
|
2182
2199
|
"span",
|
|
2183
2200
|
{
|
|
2184
2201
|
css: css15`
|
|
@@ -2190,7 +2207,7 @@ function ProductSelectedItem({
|
|
|
2190
2207
|
selectedItem.sku || selectedItem.id
|
|
2191
2208
|
] }),
|
|
2192
2209
|
selectedItem.price !== void 0 ? /* @__PURE__ */ jsxs12("li", { children: [
|
|
2193
|
-
/* @__PURE__ */
|
|
2210
|
+
/* @__PURE__ */ jsx24(
|
|
2194
2211
|
"span",
|
|
2195
2212
|
{
|
|
2196
2213
|
css: css15`
|
|
@@ -2199,7 +2216,7 @@ function ProductSelectedItem({
|
|
|
2199
2216
|
children: "Price:"
|
|
2200
2217
|
}
|
|
2201
2218
|
),
|
|
2202
|
-
/* @__PURE__ */
|
|
2219
|
+
/* @__PURE__ */ jsx24("span", { children: selectedItem.price })
|
|
2203
2220
|
] }) : null
|
|
2204
2221
|
]
|
|
2205
2222
|
}
|
|
@@ -2218,8 +2235,8 @@ function ProductSelectedItem({
|
|
|
2218
2235
|
target: "_blank",
|
|
2219
2236
|
css: productedSelectedItemLinkBtn,
|
|
2220
2237
|
children: [
|
|
2221
|
-
/* @__PURE__ */
|
|
2222
|
-
/* @__PURE__ */
|
|
2238
|
+
/* @__PURE__ */ jsx24("span", { css: productedSelectedItemSmallText, children: "Edit" }),
|
|
2239
|
+
/* @__PURE__ */ jsx24(Image, { src: logoIcon, alt: "Logo", css: productSelectedItemIcon })
|
|
2223
2240
|
]
|
|
2224
2241
|
}
|
|
2225
2242
|
) : null,
|
|
@@ -2232,8 +2249,8 @@ function ProductSelectedItem({
|
|
|
2232
2249
|
},
|
|
2233
2250
|
css: productedSelectedItemLinkBtn,
|
|
2234
2251
|
children: [
|
|
2235
|
-
/* @__PURE__ */
|
|
2236
|
-
/* @__PURE__ */
|
|
2252
|
+
/* @__PURE__ */ jsx24("span", { css: productedSelectedItemSmallText, children: "Unlink" }),
|
|
2253
|
+
/* @__PURE__ */ jsx24(Icon3, { icon: CgClose3, iconColor: "red", size: 16 })
|
|
2237
2254
|
]
|
|
2238
2255
|
}
|
|
2239
2256
|
)
|
|
@@ -2242,7 +2259,7 @@ function ProductSelectedItem({
|
|
|
2242
2259
|
}
|
|
2243
2260
|
|
|
2244
2261
|
// src/components/commerce/ProductSearch.tsx
|
|
2245
|
-
import { jsx as
|
|
2262
|
+
import { jsx as jsx25, jsxs as jsxs13 } from "@emotion/react/jsx-runtime";
|
|
2246
2263
|
function ProductSearch({
|
|
2247
2264
|
selectedProducts,
|
|
2248
2265
|
setSelectedProducts,
|
|
@@ -2313,9 +2330,9 @@ function ProductSearch({
|
|
|
2313
2330
|
"There was an error: ",
|
|
2314
2331
|
(categoriesError2 == null ? void 0 : categoriesError2.message) || (searchError == null ? void 0 : searchError.message)
|
|
2315
2332
|
] });
|
|
2316
|
-
return /* @__PURE__ */
|
|
2333
|
+
return /* @__PURE__ */ jsx25(ErrorComp, { categoriesError, searchError: handleSearchState.error });
|
|
2317
2334
|
}
|
|
2318
|
-
return /* @__PURE__ */
|
|
2335
|
+
return /* @__PURE__ */ jsx25(ProductSearchContext.Provider, { value: { categories, logoIcon }, children: /* @__PURE__ */ jsx25(
|
|
2319
2336
|
EntrySearch,
|
|
2320
2337
|
{
|
|
2321
2338
|
search: handleSearch,
|
|
@@ -2353,7 +2370,7 @@ import { css as css17 } from "@emotion/react";
|
|
|
2353
2370
|
import { CgClose as CgClose4 } from "@react-icons/all-files/cg/CgClose";
|
|
2354
2371
|
import { CgInfo as CgInfo2 } from "@react-icons/all-files/cg/CgInfo";
|
|
2355
2372
|
import { Icon as Icon4 } from "@uniformdev/design-system";
|
|
2356
|
-
import { useEffect as useEffect4, useRef as useRef6, useState as
|
|
2373
|
+
import { useEffect as useEffect4, useRef as useRef6, useState as useState6 } from "react";
|
|
2357
2374
|
import { format as timeAgo2 } from "timeago.js";
|
|
2358
2375
|
|
|
2359
2376
|
// src/components/dam/DamSelectedItem.styles.ts
|
|
@@ -2459,7 +2476,7 @@ var damSelectItemImage = css16`
|
|
|
2459
2476
|
`;
|
|
2460
2477
|
|
|
2461
2478
|
// src/components/dam/DamSelectedItem.tsx
|
|
2462
|
-
import { jsx as
|
|
2479
|
+
import { jsx as jsx26, jsxs as jsxs14 } from "@emotion/react/jsx-runtime";
|
|
2463
2480
|
function DamSelectedItem({
|
|
2464
2481
|
selectedItem,
|
|
2465
2482
|
onDeselect,
|
|
@@ -2468,7 +2485,7 @@ function DamSelectedItem({
|
|
|
2468
2485
|
itemDetailsRendererComponent
|
|
2469
2486
|
}) {
|
|
2470
2487
|
const popoverRef = useRef6(null);
|
|
2471
|
-
const [showInfo, setShowInfo] =
|
|
2488
|
+
const [showInfo, setShowInfo] = useState6(false);
|
|
2472
2489
|
useEffect4(() => {
|
|
2473
2490
|
const resizeHandler = () => {
|
|
2474
2491
|
setShowInfo(false);
|
|
@@ -2479,7 +2496,7 @@ function DamSelectedItem({
|
|
|
2479
2496
|
};
|
|
2480
2497
|
}, [popoverRef]);
|
|
2481
2498
|
const ResolvedItemDetailsRendererComponent = itemDetailsRendererComponent != null ? itemDetailsRendererComponent : DefaultDamItemRenderer;
|
|
2482
|
-
return /* @__PURE__ */
|
|
2499
|
+
return /* @__PURE__ */ jsx26(
|
|
2483
2500
|
"div",
|
|
2484
2501
|
{
|
|
2485
2502
|
css: [
|
|
@@ -2491,9 +2508,9 @@ function DamSelectedItem({
|
|
|
2491
2508
|
children: /* @__PURE__ */ jsxs14("div", { css: damSelectedItemInner, children: [
|
|
2492
2509
|
/* @__PURE__ */ jsxs14("div", { css: damSelectedItemDetails, children: [
|
|
2493
2510
|
/* @__PURE__ */ jsxs14("div", { css: damSelectedItemCopy, children: [
|
|
2494
|
-
/* @__PURE__ */
|
|
2511
|
+
/* @__PURE__ */ jsx26("h4", { css: [damSelectedItemTitle], title: `ID: ${selectedItem.id}`, "data-testid": "dam-selected-item", children: selectedItem.title || selectedItem.id || "" }),
|
|
2495
2512
|
selectedItem.popoverData ? /* @__PURE__ */ jsxs14("div", { ref: popoverRef, children: [
|
|
2496
|
-
/* @__PURE__ */
|
|
2513
|
+
/* @__PURE__ */ jsx26(
|
|
2497
2514
|
"button",
|
|
2498
2515
|
{
|
|
2499
2516
|
type: "button",
|
|
@@ -2501,7 +2518,7 @@ function DamSelectedItem({
|
|
|
2501
2518
|
"aria-controls": "path-details",
|
|
2502
2519
|
"aria-expanded": showInfo,
|
|
2503
2520
|
onClick: () => setShowInfo(!showInfo),
|
|
2504
|
-
children: /* @__PURE__ */
|
|
2521
|
+
children: /* @__PURE__ */ jsx26(
|
|
2505
2522
|
Icon4,
|
|
2506
2523
|
{
|
|
2507
2524
|
icon: CgInfo2,
|
|
@@ -2514,7 +2531,7 @@ function DamSelectedItem({
|
|
|
2514
2531
|
)
|
|
2515
2532
|
}
|
|
2516
2533
|
),
|
|
2517
|
-
/* @__PURE__ */
|
|
2534
|
+
/* @__PURE__ */ jsx26(
|
|
2518
2535
|
"div",
|
|
2519
2536
|
{
|
|
2520
2537
|
id: "path-details",
|
|
@@ -2538,7 +2555,7 @@ function DamSelectedItem({
|
|
|
2538
2555
|
)
|
|
2539
2556
|
] }) : null
|
|
2540
2557
|
] }),
|
|
2541
|
-
/* @__PURE__ */
|
|
2558
|
+
/* @__PURE__ */ jsx26(ResolvedItemDetailsRendererComponent, { item: selectedItem })
|
|
2542
2559
|
] }),
|
|
2543
2560
|
/* @__PURE__ */ jsxs14("div", { css: damSelectedItemLinkContainer, children: [
|
|
2544
2561
|
selectedItem.editLink ? typeof selectedItem.editLink === "string" ? /* @__PURE__ */ jsxs14(
|
|
@@ -2556,8 +2573,8 @@ function DamSelectedItem({
|
|
|
2556
2573
|
},
|
|
2557
2574
|
css: damSelectedItemLinkBtn,
|
|
2558
2575
|
children: [
|
|
2559
|
-
/* @__PURE__ */
|
|
2560
|
-
logoIcon ? /* @__PURE__ */
|
|
2576
|
+
/* @__PURE__ */ jsx26("span", { css: damSelectedItemSmallText, children: "Edit" }),
|
|
2577
|
+
logoIcon ? /* @__PURE__ */ jsx26(Image, { src: logoIcon, css: damSelectedItemIcon, alt: "Logo" }) : null
|
|
2561
2578
|
]
|
|
2562
2579
|
}
|
|
2563
2580
|
) : selectedItem.editLink : null,
|
|
@@ -2570,8 +2587,8 @@ function DamSelectedItem({
|
|
|
2570
2587
|
},
|
|
2571
2588
|
css: damSelectedItemLinkBtn,
|
|
2572
2589
|
children: [
|
|
2573
|
-
/* @__PURE__ */
|
|
2574
|
-
/* @__PURE__ */
|
|
2590
|
+
/* @__PURE__ */ jsx26("span", { css: damSelectedItemSmallText, children: "Unlink" }),
|
|
2591
|
+
/* @__PURE__ */ jsx26(Icon4, { icon: CgClose4, iconColor: "red", size: 16 })
|
|
2575
2592
|
]
|
|
2576
2593
|
}
|
|
2577
2594
|
)
|
|
@@ -2585,15 +2602,15 @@ function DefaultDamItemRenderer({ item }) {
|
|
|
2585
2602
|
let preview = null;
|
|
2586
2603
|
if (item.previewUrl && typeof item.previewUrl === "string") {
|
|
2587
2604
|
if (item.type === "image") {
|
|
2588
|
-
preview = /* @__PURE__ */
|
|
2605
|
+
preview = /* @__PURE__ */ jsx26("img", { src: item.previewUrl, alt: item.id, width: "200", css: damSelectItemImage });
|
|
2589
2606
|
} else if (item.type === "video") {
|
|
2590
|
-
preview = /* @__PURE__ */
|
|
2607
|
+
preview = /* @__PURE__ */ jsx26("video", { src: item.previewUrl, title: item.id, width: "200", controls: true, css: damSelectItemImage });
|
|
2591
2608
|
}
|
|
2592
2609
|
} else if (item.previewUrl && typeof item.previewUrl !== "string") {
|
|
2593
2610
|
preview = item.previewUrl;
|
|
2594
2611
|
}
|
|
2595
2612
|
return preview || item.metadata ? /* @__PURE__ */ jsxs14("div", { css: damSelectedItemMediaContainer, children: [
|
|
2596
|
-
preview ? /* @__PURE__ */
|
|
2613
|
+
preview ? /* @__PURE__ */ jsx26("div", { children: preview }) : null,
|
|
2597
2614
|
/* @__PURE__ */ jsxs14("ul", { children: [
|
|
2598
2615
|
item.metadata ? Object.entries(item.metadata).map(([key, value]) => {
|
|
2599
2616
|
return /* @__PURE__ */ jsxs14(
|
|
@@ -2628,7 +2645,7 @@ function DefaultDamItemRenderer({ item }) {
|
|
|
2628
2645
|
);
|
|
2629
2646
|
}) : null,
|
|
2630
2647
|
item.createdDate ? /* @__PURE__ */ jsxs14("li", { css: damSelectedItemSmallText, children: [
|
|
2631
|
-
/* @__PURE__ */
|
|
2648
|
+
/* @__PURE__ */ jsx26("span", { css: damSelectedItemPopoverLabel, children: "Date:" }),
|
|
2632
2649
|
timeAgo2(item.createdDate)
|
|
2633
2650
|
] }) : null
|
|
2634
2651
|
] })
|
|
@@ -2656,7 +2673,7 @@ function useConnectedDataAsVariables(connectedData) {
|
|
|
2656
2673
|
// src/hooks/useDynamicInputsAsVariables.tsx
|
|
2657
2674
|
import { LOCALE_DYNAMIC_INPUT_NAME } from "@uniformdev/canvas";
|
|
2658
2675
|
import { useMemo as useMemo4 } from "react";
|
|
2659
|
-
import { Fragment as Fragment4, jsx as
|
|
2676
|
+
import { Fragment as Fragment4, jsx as jsx27 } from "@emotion/react/jsx-runtime";
|
|
2660
2677
|
function useDynamicInputsAsVariables(dynamicInputs) {
|
|
2661
2678
|
return useMemo4(() => {
|
|
2662
2679
|
const result = Object.entries(dynamicInputs).reduce(
|
|
@@ -2674,14 +2691,14 @@ Current preview value: ${input3.value || "not provided"}`
|
|
|
2674
2691
|
if (!input3.value) {
|
|
2675
2692
|
acc[name] = {
|
|
2676
2693
|
...acc[name],
|
|
2677
|
-
helpText: /* @__PURE__ */
|
|
2694
|
+
helpText: /* @__PURE__ */ jsx27(Fragment4, { children: input3.value || /* @__PURE__ */ jsx27("em", { children: "not provided" }) }),
|
|
2678
2695
|
displayName: name
|
|
2679
2696
|
};
|
|
2680
2697
|
} else {
|
|
2681
2698
|
acc[name] = {
|
|
2682
2699
|
...acc[name],
|
|
2683
2700
|
displayName: input3.value,
|
|
2684
|
-
helpText: /* @__PURE__ */
|
|
2701
|
+
helpText: /* @__PURE__ */ jsx27(Fragment4, { children: name })
|
|
2685
2702
|
};
|
|
2686
2703
|
}
|
|
2687
2704
|
return acc;
|
|
@@ -2696,12 +2713,12 @@ Current preview value: ${input3.value || "not provided"}`
|
|
|
2696
2713
|
import { useMemo as useMemo6, useRef as useRef7 } from "react";
|
|
2697
2714
|
|
|
2698
2715
|
// src/components/UniformMeshLocationContext.tsx
|
|
2699
|
-
import { createContext as createContext2, useContext as useContext4, useMemo as useMemo5, useState as
|
|
2716
|
+
import { createContext as createContext2, useContext as useContext4, useMemo as useMemo5, useState as useState7 } from "react";
|
|
2700
2717
|
|
|
2701
2718
|
// src/components/UniformMeshSdkContext.tsx
|
|
2702
2719
|
import { Theme } from "@uniformdev/design-system";
|
|
2703
2720
|
import { createContext, useContext as useContext3 } from "react";
|
|
2704
|
-
import { jsx as
|
|
2721
|
+
import { jsx as jsx28, jsxs as jsxs15 } from "@emotion/react/jsx-runtime";
|
|
2705
2722
|
var UniformMeshSdkContext = createContext(void 0);
|
|
2706
2723
|
var useUniformMeshSdkContext = () => {
|
|
2707
2724
|
const context = useContext3(UniformMeshSdkContext);
|
|
@@ -2718,13 +2735,13 @@ function useUniformMeshSdk() {
|
|
|
2718
2735
|
}
|
|
2719
2736
|
|
|
2720
2737
|
// src/components/UniformMeshLocationContext.tsx
|
|
2721
|
-
import { jsx as
|
|
2738
|
+
import { jsx as jsx29 } from "@emotion/react/jsx-runtime";
|
|
2722
2739
|
var UniformMeshLocationContext = createContext2(void 0);
|
|
2723
2740
|
var UniformMeshLocationContextProvider = ({
|
|
2724
2741
|
children
|
|
2725
2742
|
}) => {
|
|
2726
2743
|
const sdk = useUniformMeshSdk();
|
|
2727
|
-
const [location, setLocation] =
|
|
2744
|
+
const [location, setLocation] = useState7(sdk.getCurrentLocation());
|
|
2728
2745
|
useMemo5(() => {
|
|
2729
2746
|
const valueChangeListener = (event) => {
|
|
2730
2747
|
setLocation((old) => ({ ...old, value: event.newValue }));
|
|
@@ -2739,7 +2756,7 @@ var UniformMeshLocationContextProvider = ({
|
|
|
2739
2756
|
sdk.events.off("onMetadataChanged", metaChangeListener);
|
|
2740
2757
|
};
|
|
2741
2758
|
}, [sdk]);
|
|
2742
|
-
return /* @__PURE__ */
|
|
2759
|
+
return /* @__PURE__ */ jsx29(UniformMeshLocationContext.Provider, { value: { location }, children });
|
|
2743
2760
|
};
|
|
2744
2761
|
var useUniformMeshLocationContext = () => {
|
|
2745
2762
|
const context = useContext4(UniformMeshLocationContext);
|
|
@@ -2938,7 +2955,7 @@ function prettifyBindExpression(bindExpression) {
|
|
|
2938
2955
|
// src/components/Variables/composer/VariableChip.tsx
|
|
2939
2956
|
import { MultilineChip } from "@uniformdev/design-system";
|
|
2940
2957
|
import { Fragment as Fragment5 } from "react";
|
|
2941
|
-
import { jsx as
|
|
2958
|
+
import { jsx as jsx30 } from "@emotion/react/jsx-runtime";
|
|
2942
2959
|
function VariableChip({
|
|
2943
2960
|
displayName,
|
|
2944
2961
|
referenceIsValid,
|
|
@@ -2954,7 +2971,7 @@ function VariableChip({
|
|
|
2954
2971
|
const referenceIsValidFr = isFresh ? true : referenceIsValid;
|
|
2955
2972
|
const Wrapper = referenceIsValidFr === "info" ? InfoVariableReference : referenceIsValidFr ? Fragment5 : UndefinedVariableReference;
|
|
2956
2973
|
const extraTitle = !referenceIsValidFr ? `${reference} is not defined.` : hasClickEvent && clickToEdit ? "Click to edit" : void 0;
|
|
2957
|
-
return /* @__PURE__ */
|
|
2974
|
+
return /* @__PURE__ */ jsx30(
|
|
2958
2975
|
MultilineChip,
|
|
2959
2976
|
{
|
|
2960
2977
|
title: tooltip ? `${tooltip}${extraTitle ? `
|
|
@@ -2963,12 +2980,12 @@ ${extraTitle}` : ""}` : extraTitle,
|
|
|
2963
2980
|
onClick,
|
|
2964
2981
|
"aria-selected": selected ? true : void 0,
|
|
2965
2982
|
"aria-disabled": disabled,
|
|
2966
|
-
children: /* @__PURE__ */
|
|
2983
|
+
children: /* @__PURE__ */ jsx30(Wrapper, { children: displayName || reference })
|
|
2967
2984
|
}
|
|
2968
2985
|
);
|
|
2969
2986
|
}
|
|
2970
2987
|
function UndefinedVariableReference({ children }) {
|
|
2971
|
-
return /* @__PURE__ */
|
|
2988
|
+
return /* @__PURE__ */ jsx30(
|
|
2972
2989
|
"span",
|
|
2973
2990
|
{
|
|
2974
2991
|
style: {
|
|
@@ -2981,7 +2998,7 @@ function UndefinedVariableReference({ children }) {
|
|
|
2981
2998
|
);
|
|
2982
2999
|
}
|
|
2983
3000
|
function InfoVariableReference({ children }) {
|
|
2984
|
-
return /* @__PURE__ */
|
|
3001
|
+
return /* @__PURE__ */ jsx30(
|
|
2985
3002
|
"span",
|
|
2986
3003
|
{
|
|
2987
3004
|
style: {
|
|
@@ -3014,7 +3031,7 @@ import {
|
|
|
3014
3031
|
COMMAND_PRIORITY_NORMAL,
|
|
3015
3032
|
createCommand
|
|
3016
3033
|
} from "lexical";
|
|
3017
|
-
import { useCallback, useEffect as useEffect7, useMemo as useMemo8, useRef as useRef10, useState as
|
|
3034
|
+
import { useCallback, useEffect as useEffect7, useMemo as useMemo8, useRef as useRef10, useState as useState10 } from "react";
|
|
3018
3035
|
import { createPortal } from "react-dom";
|
|
3019
3036
|
|
|
3020
3037
|
// src/components/Variables/toolbox/SelectVariableMenu.styles.ts
|
|
@@ -3047,11 +3064,11 @@ var variablesTipText = css18`
|
|
|
3047
3064
|
`;
|
|
3048
3065
|
|
|
3049
3066
|
// src/components/Variables/useVariableEditor.ts
|
|
3050
|
-
import { useEffect as useEffect6, useState as
|
|
3067
|
+
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
3051
3068
|
|
|
3052
3069
|
// src/components/Variables/VariablesProvider.tsx
|
|
3053
3070
|
import mitt from "mitt";
|
|
3054
|
-
import { createContext as createContext3, useContext as useContext5, useMemo as useMemo7, useState as
|
|
3071
|
+
import { createContext as createContext3, useContext as useContext5, useMemo as useMemo7, useState as useState8 } from "react";
|
|
3055
3072
|
|
|
3056
3073
|
// src/components/Variables/VariableEditor.tsx
|
|
3057
3074
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
@@ -3069,7 +3086,7 @@ var variablesFormContainer = css19`
|
|
|
3069
3086
|
`;
|
|
3070
3087
|
|
|
3071
3088
|
// src/components/Variables/VariableEditor.tsx
|
|
3072
|
-
import { jsx as
|
|
3089
|
+
import { jsx as jsx31, jsxs as jsxs16 } from "@emotion/react/jsx-runtime";
|
|
3073
3090
|
var schema = z.object({
|
|
3074
3091
|
name: z.string().nonempty("Name can't be empty").regex(/^[^${}]+$/, "$, {, and } are reserved characters and cannot be used in a variable name"),
|
|
3075
3092
|
default: z.string(),
|
|
@@ -3125,7 +3142,7 @@ function VariableEditor({
|
|
|
3125
3142
|
// NOTE: this is intentionally NOT a <form> because it's regularly used in a nested modal and that can make it bubble
|
|
3126
3143
|
// up a submit to its 'parent form' which is not what we want.
|
|
3127
3144
|
/* @__PURE__ */ jsxs16("div", { css: variablesFormContainer, children: [
|
|
3128
|
-
/* @__PURE__ */
|
|
3145
|
+
/* @__PURE__ */ jsx31(
|
|
3129
3146
|
Input2,
|
|
3130
3147
|
{
|
|
3131
3148
|
...nameRegister,
|
|
@@ -3139,7 +3156,7 @@ function VariableEditor({
|
|
|
3139
3156
|
}
|
|
3140
3157
|
}
|
|
3141
3158
|
),
|
|
3142
|
-
/* @__PURE__ */
|
|
3159
|
+
/* @__PURE__ */ jsx31(
|
|
3143
3160
|
Input2,
|
|
3144
3161
|
{
|
|
3145
3162
|
...register("helpText"),
|
|
@@ -3149,7 +3166,7 @@ function VariableEditor({
|
|
|
3149
3166
|
errorMessage: (_f = formState.errors.helpText) == null ? void 0 : _f.message
|
|
3150
3167
|
}
|
|
3151
3168
|
),
|
|
3152
|
-
/* @__PURE__ */
|
|
3169
|
+
/* @__PURE__ */ jsx31(
|
|
3153
3170
|
Input2,
|
|
3154
3171
|
{
|
|
3155
3172
|
...register("default"),
|
|
@@ -3158,14 +3175,14 @@ function VariableEditor({
|
|
|
3158
3175
|
errorMessage: (_g = formState.errors.default) == null ? void 0 : _g.message
|
|
3159
3176
|
}
|
|
3160
3177
|
),
|
|
3161
|
-
/* @__PURE__ */
|
|
3162
|
-
/* @__PURE__ */
|
|
3163
|
-
/* @__PURE__ */
|
|
3178
|
+
/* @__PURE__ */ jsx31(HorizontalRhythm, { justify: "space-between", children: /* @__PURE__ */ jsxs16(HorizontalRhythm, { gap: "sm", children: [
|
|
3179
|
+
/* @__PURE__ */ jsx31(Button2, { type: "button", onClick: submitHandler, children: "OK" }),
|
|
3180
|
+
/* @__PURE__ */ jsx31(Button2, { type: "button", buttonType: "ghost", onClick: () => onCancel({ disconnect: false }), children: "cancel" })
|
|
3164
3181
|
] }) }),
|
|
3165
3182
|
disableMeshTip ? null : /* @__PURE__ */ jsxs16(Callout3, { type: "tip", title: "Customized User Interfaces", children: [
|
|
3166
3183
|
"Developers can create customized user interfaces for variable editing by building a Uniform mesh integration. Get started quickly with our",
|
|
3167
3184
|
" ",
|
|
3168
|
-
/* @__PURE__ */
|
|
3185
|
+
/* @__PURE__ */ jsx31(
|
|
3169
3186
|
"a",
|
|
3170
3187
|
{
|
|
3171
3188
|
href: "https://docs.uniform.app/docs/integrations/mesh-integrations/custom-integrations",
|
|
@@ -3181,7 +3198,7 @@ function VariableEditor({
|
|
|
3181
3198
|
}
|
|
3182
3199
|
|
|
3183
3200
|
// src/components/Variables/VariablesProvider.tsx
|
|
3184
|
-
import { jsx as
|
|
3201
|
+
import { jsx as jsx32, jsxs as jsxs17 } from "@emotion/react/jsx-runtime";
|
|
3185
3202
|
var VariablesContext = createContext3(null);
|
|
3186
3203
|
function VariablesProvider({
|
|
3187
3204
|
value,
|
|
@@ -3192,8 +3209,8 @@ function VariablesProvider({
|
|
|
3192
3209
|
children,
|
|
3193
3210
|
knownUndefinedValues = {}
|
|
3194
3211
|
}) {
|
|
3195
|
-
const [editing, setEditing] =
|
|
3196
|
-
const [editingContext, setEditingContext] =
|
|
3212
|
+
const [editing, setEditing] = useState8();
|
|
3213
|
+
const [editingContext, setEditingContext] = useState8();
|
|
3197
3214
|
const events = useMemo7(
|
|
3198
3215
|
() => mitt(),
|
|
3199
3216
|
[]
|
|
@@ -3252,7 +3269,7 @@ function VariablesProvider({
|
|
|
3252
3269
|
}, [editing, events, knownUndefinedValues, valueBasedContextValue, isLoading]);
|
|
3253
3270
|
return /* @__PURE__ */ jsxs17(VariablesContext.Provider, { value: contextValue, children: [
|
|
3254
3271
|
children,
|
|
3255
|
-
typeof editing !== "undefined" ? /* @__PURE__ */
|
|
3272
|
+
typeof editing !== "undefined" ? /* @__PURE__ */ jsx32(
|
|
3256
3273
|
Editor,
|
|
3257
3274
|
{
|
|
3258
3275
|
context: editingContext,
|
|
@@ -3311,7 +3328,7 @@ function flattenVariables(variables) {
|
|
|
3311
3328
|
// src/components/Variables/useVariableEditor.ts
|
|
3312
3329
|
function useVariableEditor() {
|
|
3313
3330
|
const { variables, events, canDispatch, dispatch, isEditing } = useVariables(true);
|
|
3314
|
-
const [isEditingBinding, setIsEditingBinding] =
|
|
3331
|
+
const [isEditingBinding, setIsEditingBinding] = useState9();
|
|
3315
3332
|
useEffect6(() => {
|
|
3316
3333
|
if (!canDispatch || !isEditingBinding) {
|
|
3317
3334
|
return;
|
|
@@ -3408,7 +3425,7 @@ function variablesToGroupedList(variables, filterFn, context) {
|
|
|
3408
3425
|
}
|
|
3409
3426
|
|
|
3410
3427
|
// src/components/Variables/composer/VariablesPlugin.tsx
|
|
3411
|
-
import { Fragment as Fragment6, jsx as
|
|
3428
|
+
import { Fragment as Fragment6, jsx as jsx33, jsxs as jsxs18 } from "@emotion/react/jsx-runtime";
|
|
3412
3429
|
var OPEN_INSERT_VARIABLE_COMMAND = createCommand("uniform:open-insert-variable");
|
|
3413
3430
|
var EDIT_VARIABLE_COMMAND = createCommand("uniform:edit-variable");
|
|
3414
3431
|
var DISCONNECT_VARIABLE_COMMAND = createCommand(
|
|
@@ -3527,7 +3544,7 @@ function VariablesPlugin({
|
|
|
3527
3544
|
[canDispatch, enableEditingVariables, readOnly]
|
|
3528
3545
|
);
|
|
3529
3546
|
const { editVariable } = useVariableEditor();
|
|
3530
|
-
const [queryString, setQueryString] =
|
|
3547
|
+
const [queryString, setQueryString] = useState10(null);
|
|
3531
3548
|
const { groupedVariables, menuOptions, onSelect } = useVariablesMenu({
|
|
3532
3549
|
showAddVariableMenuOption,
|
|
3533
3550
|
filterVariable,
|
|
@@ -3728,7 +3745,7 @@ function VariablesPlugin({
|
|
|
3728
3745
|
if (disableVariables) {
|
|
3729
3746
|
return null;
|
|
3730
3747
|
}
|
|
3731
|
-
return /* @__PURE__ */
|
|
3748
|
+
return /* @__PURE__ */ jsx33(
|
|
3732
3749
|
LexicalTypeaheadMenuPlugin,
|
|
3733
3750
|
{
|
|
3734
3751
|
onQueryChange: setQueryString,
|
|
@@ -3741,7 +3758,7 @@ function VariablesPlugin({
|
|
|
3741
3758
|
}
|
|
3742
3759
|
let currentCumulativeMenuIndex = -1;
|
|
3743
3760
|
return createPortal(
|
|
3744
|
-
/* @__PURE__ */
|
|
3761
|
+
/* @__PURE__ */ jsx33(
|
|
3745
3762
|
"div",
|
|
3746
3763
|
{
|
|
3747
3764
|
"data-auto-resize-opt-in": true,
|
|
@@ -3760,14 +3777,14 @@ function VariablesPlugin({
|
|
|
3760
3777
|
position: relative;
|
|
3761
3778
|
z-index: var(--z-50);
|
|
3762
3779
|
`,
|
|
3763
|
-
children: /* @__PURE__ */
|
|
3780
|
+
children: /* @__PURE__ */ jsx33("div", { children: filteredGroupedVariables.map((group, index) => {
|
|
3764
3781
|
var _a, _b;
|
|
3765
3782
|
return /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
3766
|
-
/* @__PURE__ */
|
|
3783
|
+
/* @__PURE__ */ jsx33(MenuGroup, { title: (_a = group.name) != null ? _a : "", children: group.variables.map((variable) => {
|
|
3767
3784
|
var _a2;
|
|
3768
3785
|
currentCumulativeMenuIndex++;
|
|
3769
3786
|
const myCumulativeIndex = currentCumulativeMenuIndex;
|
|
3770
|
-
return /* @__PURE__ */
|
|
3787
|
+
return /* @__PURE__ */ jsx33(
|
|
3771
3788
|
MenuItemInner,
|
|
3772
3789
|
{
|
|
3773
3790
|
active: selectedIndex === myCumulativeIndex,
|
|
@@ -3780,18 +3797,18 @@ function VariablesPlugin({
|
|
|
3780
3797
|
},
|
|
3781
3798
|
css: menuItemTextGroup,
|
|
3782
3799
|
children: variable.name === ADD_VARIABLE_OPTION ? /* @__PURE__ */ jsxs18(HorizontalRhythm2, { gap: "sm", align: "center", children: [
|
|
3783
|
-
/* @__PURE__ */
|
|
3800
|
+
/* @__PURE__ */ jsx33(AiFillPlusCircle, { fill: "var(--gray-500)" }),
|
|
3784
3801
|
" ",
|
|
3785
|
-
/* @__PURE__ */
|
|
3802
|
+
/* @__PURE__ */ jsx33("span", { children: variable.displayName })
|
|
3786
3803
|
] }) : /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
3787
|
-
/* @__PURE__ */
|
|
3788
|
-
variable.helpText ? /* @__PURE__ */
|
|
3804
|
+
/* @__PURE__ */ jsx33("span", { children: (_a2 = variable.displayName) != null ? _a2 : variable.name }),
|
|
3805
|
+
variable.helpText ? /* @__PURE__ */ jsx33("small", { css: smallText, children: variable.helpText }) : null
|
|
3789
3806
|
] })
|
|
3790
3807
|
},
|
|
3791
3808
|
group.name + variable.name
|
|
3792
3809
|
);
|
|
3793
3810
|
}) }, (_b = group.name) != null ? _b : `none${index}`),
|
|
3794
|
-
group.name || index === filteredGroupedVariables.length - 1 ? null : /* @__PURE__ */
|
|
3811
|
+
group.name || index === filteredGroupedVariables.length - 1 ? null : /* @__PURE__ */ jsx33(MenuItemSeparator, {})
|
|
3795
3812
|
] });
|
|
3796
3813
|
}) })
|
|
3797
3814
|
}
|
|
@@ -3804,7 +3821,7 @@ function VariablesPlugin({
|
|
|
3804
3821
|
}
|
|
3805
3822
|
|
|
3806
3823
|
// src/components/Variables/composer/VariableNode.tsx
|
|
3807
|
-
import { jsx as
|
|
3824
|
+
import { jsx as jsx34 } from "@emotion/react/jsx-runtime";
|
|
3808
3825
|
var VariableNode = class _VariableNode extends DecoratorNode {
|
|
3809
3826
|
constructor(reference, state, key) {
|
|
3810
3827
|
super(key);
|
|
@@ -3869,7 +3886,7 @@ var VariableNode = class _VariableNode extends DecoratorNode {
|
|
|
3869
3886
|
* rely on Context, etc in this renderer.
|
|
3870
3887
|
*/
|
|
3871
3888
|
decorate() {
|
|
3872
|
-
return /* @__PURE__ */
|
|
3889
|
+
return /* @__PURE__ */ jsx34(VariableNodeComponent, { state: this.__state, reference: this.reference, nodeKey: this.__key });
|
|
3873
3890
|
}
|
|
3874
3891
|
};
|
|
3875
3892
|
function $createVariableNode(variableReference, state) {
|
|
@@ -3962,12 +3979,12 @@ function VariableNodeComponent({
|
|
|
3962
3979
|
)
|
|
3963
3980
|
);
|
|
3964
3981
|
}, [clearSelection, editor, isSelected, nodeKey, onDelete, setSelected]);
|
|
3965
|
-
return /* @__PURE__ */
|
|
3982
|
+
return /* @__PURE__ */ jsx34(
|
|
3966
3983
|
VariableChip,
|
|
3967
3984
|
{
|
|
3968
3985
|
...state,
|
|
3969
3986
|
reference,
|
|
3970
|
-
displayName: state.isLoading ? /* @__PURE__ */
|
|
3987
|
+
displayName: state.isLoading ? /* @__PURE__ */ jsx34(LoadingIndicator2, { size: "sm" }) : state.displayName,
|
|
3971
3988
|
selected: isSelected,
|
|
3972
3989
|
disabled: readOnly,
|
|
3973
3990
|
clickToEdit: state.hasClickEvent,
|
|
@@ -3988,7 +4005,7 @@ function $isTargetWithinDecorator(target) {
|
|
|
3988
4005
|
|
|
3989
4006
|
// src/components/Variables/InputVariables.tsx
|
|
3990
4007
|
import { Caption, ErrorMessage, InfoMessage, WarningMessage } from "@uniformdev/design-system";
|
|
3991
|
-
import { useState as
|
|
4008
|
+
import { useState as useState13 } from "react";
|
|
3992
4009
|
import { v4 as v42 } from "uuid";
|
|
3993
4010
|
|
|
3994
4011
|
// src/components/Variables/composer/EditorRefPlugin.tsx
|
|
@@ -4222,7 +4239,7 @@ import { BsFillPlusCircleFill } from "@react-icons/all-files/bs/BsFillPlusCircle
|
|
|
4222
4239
|
import { CgUsbC } from "@react-icons/all-files/cg/CgUsbC";
|
|
4223
4240
|
import { HorizontalRhythm as HorizontalRhythm3, Menu as Menu2, MenuGroup as MenuGroup2, MenuItem as MenuItem2, MenuItemSeparator as MenuItemSeparator2 } from "@uniformdev/design-system";
|
|
4224
4241
|
import { useRef as useRef11 } from "react";
|
|
4225
|
-
import { Fragment as Fragment7, jsx as
|
|
4242
|
+
import { Fragment as Fragment7, jsx as jsx35, jsxs as jsxs19 } from "@emotion/react/jsx-runtime";
|
|
4226
4243
|
function SelectVariableMenu({
|
|
4227
4244
|
onSelectVariable,
|
|
4228
4245
|
onResetVariables,
|
|
@@ -4248,7 +4265,7 @@ function SelectVariableMenu({
|
|
|
4248
4265
|
{
|
|
4249
4266
|
placement: "bottom-start",
|
|
4250
4267
|
withoutPortal: true,
|
|
4251
|
-
menuTrigger: /* @__PURE__ */
|
|
4268
|
+
menuTrigger: /* @__PURE__ */ jsx35(
|
|
4252
4269
|
"button",
|
|
4253
4270
|
{
|
|
4254
4271
|
...buttonProps,
|
|
@@ -4257,12 +4274,12 @@ function SelectVariableMenu({
|
|
|
4257
4274
|
css: [menuBtn, buttonCss],
|
|
4258
4275
|
type: "button",
|
|
4259
4276
|
"data-testid": "insert-variable",
|
|
4260
|
-
children: /* @__PURE__ */
|
|
4277
|
+
children: /* @__PURE__ */ jsx35(CgUsbC, { size: "1.4rem" })
|
|
4261
4278
|
}
|
|
4262
4279
|
),
|
|
4263
4280
|
menuLabel: menuTooltip,
|
|
4264
4281
|
children: [
|
|
4265
|
-
showAddVariableMenuOptionForReals ? /* @__PURE__ */
|
|
4282
|
+
showAddVariableMenuOptionForReals ? /* @__PURE__ */ jsx35(
|
|
4266
4283
|
MenuItem2,
|
|
4267
4284
|
{
|
|
4268
4285
|
onClick: async () => {
|
|
@@ -4274,15 +4291,15 @@ function SelectVariableMenu({
|
|
|
4274
4291
|
},
|
|
4275
4292
|
"data-testid": "add-variable-button",
|
|
4276
4293
|
children: /* @__PURE__ */ jsxs19(HorizontalRhythm3, { gap: "sm", align: "center", children: [
|
|
4277
|
-
/* @__PURE__ */
|
|
4278
|
-
/* @__PURE__ */
|
|
4294
|
+
/* @__PURE__ */ jsx35(BsFillPlusCircleFill, { fill: "var(--gray-500)", size: "1.25em" }),
|
|
4295
|
+
/* @__PURE__ */ jsx35("span", { children: typeof showAddVariableMenuOption === "string" ? showAddVariableMenuOption : /* @__PURE__ */ jsx35(Fragment7, { children: "Add\u2026" }) })
|
|
4279
4296
|
] })
|
|
4280
4297
|
}
|
|
4281
4298
|
) : null,
|
|
4282
|
-
showAddVariableMenuOptionForReals && menuHasVariableOptions ? /* @__PURE__ */
|
|
4299
|
+
showAddVariableMenuOptionForReals && menuHasVariableOptions ? /* @__PURE__ */ jsx35(MenuItemSeparator2, {}) : null,
|
|
4283
4300
|
variablesGroups.map((group) => {
|
|
4284
4301
|
var _a;
|
|
4285
|
-
return /* @__PURE__ */
|
|
4302
|
+
return /* @__PURE__ */ jsx35(MenuGroup2, { title: (_a = group.name) != null ? _a : "", children: group.variables.map((variable) => {
|
|
4286
4303
|
const { name, displayName, helpText } = variable;
|
|
4287
4304
|
return /* @__PURE__ */ jsxs19(
|
|
4288
4305
|
MenuItem2,
|
|
@@ -4291,25 +4308,25 @@ function SelectVariableMenu({
|
|
|
4291
4308
|
css: menuItemTextGroup,
|
|
4292
4309
|
onClick: () => onSelectVariable == null ? void 0 : onSelectVariable(variable),
|
|
4293
4310
|
children: [
|
|
4294
|
-
/* @__PURE__ */
|
|
4295
|
-
helpText ? /* @__PURE__ */
|
|
4311
|
+
/* @__PURE__ */ jsx35("span", { children: displayName != null ? displayName : name }),
|
|
4312
|
+
helpText ? /* @__PURE__ */ jsx35("small", { css: smallText, children: helpText }) : null
|
|
4296
4313
|
]
|
|
4297
4314
|
},
|
|
4298
4315
|
name
|
|
4299
4316
|
);
|
|
4300
4317
|
}) }, group.name);
|
|
4301
4318
|
}),
|
|
4302
|
-
menuHasVariableOptions && onResetVariables ? /* @__PURE__ */
|
|
4303
|
-
onResetVariables ? /* @__PURE__ */
|
|
4304
|
-
tip && (menuHasVariableOptions || onResetVariables) ? /* @__PURE__ */
|
|
4305
|
-
tip ? /* @__PURE__ */
|
|
4319
|
+
menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ jsx35(MenuItemSeparator2, {}) : null,
|
|
4320
|
+
onResetVariables ? /* @__PURE__ */ jsx35(MenuItem2, { onClick: onResetVariables, css: { color: "var(--brand-secondary-5)" }, children: "Reset" }) : null,
|
|
4321
|
+
tip && (menuHasVariableOptions || onResetVariables) ? /* @__PURE__ */ jsx35(MenuItemSeparator2, {}) : null,
|
|
4322
|
+
tip ? /* @__PURE__ */ jsx35("i", { css: variablesTipText, children: tip }) : null
|
|
4306
4323
|
]
|
|
4307
4324
|
}
|
|
4308
4325
|
);
|
|
4309
4326
|
}
|
|
4310
4327
|
|
|
4311
4328
|
// src/components/Variables/toolbox/VariablesComposerVariableMenu.tsx
|
|
4312
|
-
import { jsx as
|
|
4329
|
+
import { jsx as jsx36 } from "@emotion/react/jsx-runtime";
|
|
4313
4330
|
function VariablesComposerVariableMenu(props) {
|
|
4314
4331
|
const [editor] = useLexicalComposerContext6();
|
|
4315
4332
|
const onSelectVariable = (selectedVariable) => {
|
|
@@ -4325,7 +4342,7 @@ function VariablesComposerVariableMenu(props) {
|
|
|
4325
4342
|
editor.dispatchCommand(CLEAR_EDITOR_COMMAND, void 0);
|
|
4326
4343
|
(_a = props.onResetVariables) == null ? void 0 : _a.call(props);
|
|
4327
4344
|
};
|
|
4328
|
-
return /* @__PURE__ */
|
|
4345
|
+
return /* @__PURE__ */ jsx36(
|
|
4329
4346
|
SelectVariableMenu,
|
|
4330
4347
|
{
|
|
4331
4348
|
...props,
|
|
@@ -4336,7 +4353,7 @@ function VariablesComposerVariableMenu(props) {
|
|
|
4336
4353
|
}
|
|
4337
4354
|
|
|
4338
4355
|
// src/components/Variables/toolbox/VariableField.tsx
|
|
4339
|
-
import { jsx as
|
|
4356
|
+
import { jsx as jsx37, jsxs as jsxs20 } from "@emotion/react/jsx-runtime";
|
|
4340
4357
|
function VariableField({
|
|
4341
4358
|
label,
|
|
4342
4359
|
selectVariableMenuOptions,
|
|
@@ -4347,7 +4364,7 @@ function VariableField({
|
|
|
4347
4364
|
}) {
|
|
4348
4365
|
const { variables } = useVariables(true);
|
|
4349
4366
|
const varCount = Object.keys(variables).length;
|
|
4350
|
-
const variableSelector = (varCount > 0 || (selectVariableMenuOptions == null ? void 0 : selectVariableMenuOptions.showAddVariableMenuOption)) && !disableVariables ? /* @__PURE__ */
|
|
4367
|
+
const variableSelector = (varCount > 0 || (selectVariableMenuOptions == null ? void 0 : selectVariableMenuOptions.showAddVariableMenuOption)) && !disableVariables ? /* @__PURE__ */ jsx37(
|
|
4351
4368
|
VariablesComposerVariableMenu,
|
|
4352
4369
|
{
|
|
4353
4370
|
...selectVariableMenuOptions,
|
|
@@ -4358,7 +4375,7 @@ function VariableField({
|
|
|
4358
4375
|
return /* @__PURE__ */ jsxs20("div", { "data-testid": "variable-field", children: [
|
|
4359
4376
|
/* @__PURE__ */ jsxs20("label", { htmlFor: id, css: labelText, "data-testid": "field-name", children: [
|
|
4360
4377
|
variableSelector,
|
|
4361
|
-
/* @__PURE__ */
|
|
4378
|
+
/* @__PURE__ */ jsx37("span", { children: label })
|
|
4362
4379
|
] }),
|
|
4363
4380
|
children
|
|
4364
4381
|
] });
|
|
@@ -4369,7 +4386,7 @@ import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
|
4369
4386
|
import { ClearEditorPlugin } from "@lexical/react/LexicalClearEditorPlugin";
|
|
4370
4387
|
import { LexicalComposer } from "@lexical/react/LexicalComposer";
|
|
4371
4388
|
import { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin";
|
|
4372
|
-
import { useMemo as useMemo10, useRef as useRef12, useState as
|
|
4389
|
+
import { useMemo as useMemo10, useRef as useRef12, useState as useState12 } from "react";
|
|
4373
4390
|
|
|
4374
4391
|
// src/components/Variables/composer/DisablePlugin.tsx
|
|
4375
4392
|
import { useLexicalComposerContext as useLexicalComposerContext7 } from "@lexical/react/LexicalComposerContext";
|
|
@@ -4429,7 +4446,7 @@ function serializeRecursive(node, buffer) {
|
|
|
4429
4446
|
}
|
|
4430
4447
|
|
|
4431
4448
|
// src/components/Variables/toolbox/VariablesComposer.tsx
|
|
4432
|
-
import { Fragment as Fragment8, jsx as
|
|
4449
|
+
import { Fragment as Fragment8, jsx as jsx38, jsxs as jsxs21 } from "@emotion/react/jsx-runtime";
|
|
4433
4450
|
function VariablesComposer(props) {
|
|
4434
4451
|
const {
|
|
4435
4452
|
value,
|
|
@@ -4441,7 +4458,7 @@ function VariablesComposer(props) {
|
|
|
4441
4458
|
autoFocus,
|
|
4442
4459
|
...variablesPluginProps
|
|
4443
4460
|
} = props;
|
|
4444
|
-
const [lastEmittedValue, setLastEmittedValue] =
|
|
4461
|
+
const [lastEmittedValue, setLastEmittedValue] = useState12(value);
|
|
4445
4462
|
const editorConfig = useMemo10(
|
|
4446
4463
|
() => ({
|
|
4447
4464
|
namespace: "uniform",
|
|
@@ -4459,7 +4476,7 @@ function VariablesComposer(props) {
|
|
|
4459
4476
|
if (typeof document === "undefined")
|
|
4460
4477
|
return null;
|
|
4461
4478
|
return /* @__PURE__ */ jsxs21(LexicalComposer, { initialConfig: editorConfig, children: [
|
|
4462
|
-
/* @__PURE__ */
|
|
4479
|
+
/* @__PURE__ */ jsx38(
|
|
4463
4480
|
OnChangePlugin,
|
|
4464
4481
|
{
|
|
4465
4482
|
ignoreSelectionChange: true,
|
|
@@ -4480,12 +4497,12 @@ function VariablesComposer(props) {
|
|
|
4480
4497
|
}
|
|
4481
4498
|
}
|
|
4482
4499
|
),
|
|
4483
|
-
/* @__PURE__ */
|
|
4484
|
-
/* @__PURE__ */
|
|
4485
|
-
/* @__PURE__ */
|
|
4486
|
-
/* @__PURE__ */
|
|
4487
|
-
/* @__PURE__ */
|
|
4488
|
-
/* @__PURE__ */
|
|
4500
|
+
/* @__PURE__ */ jsx38(Fragment8, { children: multiLine ? null : /* @__PURE__ */ jsx38(SingleLineTextPlugin, {}) }),
|
|
4501
|
+
/* @__PURE__ */ jsx38(ClearEditorPlugin, {}),
|
|
4502
|
+
/* @__PURE__ */ jsx38(VariablesPlugin, { ...variablesPluginProps }),
|
|
4503
|
+
/* @__PURE__ */ jsx38(DisablePlugin, { disabled }),
|
|
4504
|
+
/* @__PURE__ */ jsx38(Fragment8, { children: autoFocus ? /* @__PURE__ */ jsx38(AutoFocusPlugin, {}) : null }),
|
|
4505
|
+
/* @__PURE__ */ jsx38(Fragment8, { children })
|
|
4489
4506
|
] });
|
|
4490
4507
|
}
|
|
4491
4508
|
|
|
@@ -4511,23 +4528,23 @@ import {
|
|
|
4511
4528
|
PASTE_COMMAND as PASTE_COMMAND2
|
|
4512
4529
|
} from "lexical";
|
|
4513
4530
|
import { useEffect as useEffect13 } from "react";
|
|
4514
|
-
import { Fragment as Fragment9, jsx as
|
|
4531
|
+
import { Fragment as Fragment9, jsx as jsx39, jsxs as jsxs22 } from "@emotion/react/jsx-runtime";
|
|
4515
4532
|
function VariablesComposerInput({
|
|
4516
4533
|
css: css37,
|
|
4517
4534
|
placeholder,
|
|
4518
4535
|
...contentEditableProps
|
|
4519
4536
|
}) {
|
|
4520
4537
|
return /* @__PURE__ */ jsxs22("div", { children: [
|
|
4521
|
-
/* @__PURE__ */
|
|
4538
|
+
/* @__PURE__ */ jsx39(
|
|
4522
4539
|
PlainTextPlugin,
|
|
4523
4540
|
{
|
|
4524
|
-
contentEditable: /* @__PURE__ */
|
|
4525
|
-
placeholder: placeholder ? /* @__PURE__ */
|
|
4541
|
+
contentEditable: /* @__PURE__ */ jsx39(ContentEditable, { ...contentEditableProps }),
|
|
4542
|
+
placeholder: placeholder ? /* @__PURE__ */ jsx39(Fragment9, { children: placeholder }) : null,
|
|
4526
4543
|
ErrorBoundary: LexicalErrorBoundary
|
|
4527
4544
|
}
|
|
4528
4545
|
),
|
|
4529
|
-
/* @__PURE__ */
|
|
4530
|
-
/* @__PURE__ */
|
|
4546
|
+
/* @__PURE__ */ jsx39(RichishCopyAndPastePlugin, {}),
|
|
4547
|
+
/* @__PURE__ */ jsx39(HistoryPlugin, {})
|
|
4531
4548
|
] });
|
|
4532
4549
|
}
|
|
4533
4550
|
function RichishCopyAndPastePlugin() {
|
|
@@ -4607,7 +4624,7 @@ function RichishCopyAndPastePlugin() {
|
|
|
4607
4624
|
}
|
|
4608
4625
|
|
|
4609
4626
|
// src/components/Variables/InputVariables.tsx
|
|
4610
|
-
import { Fragment as Fragment10, jsx as
|
|
4627
|
+
import { Fragment as Fragment10, jsx as jsx40, jsxs as jsxs23 } from "@emotion/react/jsx-runtime";
|
|
4611
4628
|
function InputVariables(props) {
|
|
4612
4629
|
const {
|
|
4613
4630
|
id,
|
|
@@ -4634,7 +4651,7 @@ function InputVariables(props) {
|
|
|
4634
4651
|
filterVariable,
|
|
4635
4652
|
styleVariant = "default"
|
|
4636
4653
|
} = props;
|
|
4637
|
-
const [finalId] =
|
|
4654
|
+
const [finalId] = useState13(id != null ? id : () => v42());
|
|
4638
4655
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
4639
4656
|
const { disableVariablesForReals, hadVariablesInValue, sharedMenuProps } = useInputVariablesState(props);
|
|
4640
4657
|
const useInputWithNoVariables = Boolean(inputWhenNoVariables && !hadVariablesInValue);
|
|
@@ -4648,14 +4665,14 @@ function InputVariables(props) {
|
|
|
4648
4665
|
},
|
|
4649
4666
|
css: disabled ? inputDisabled : "",
|
|
4650
4667
|
children: [
|
|
4651
|
-
useInputWithNoVariables ? inputWhenNoVariables : /* @__PURE__ */
|
|
4668
|
+
useInputWithNoVariables ? inputWhenNoVariables : /* @__PURE__ */ jsx40(
|
|
4652
4669
|
InputVariablesOverlayMenu,
|
|
4653
4670
|
{
|
|
4654
4671
|
...sharedMenuProps,
|
|
4655
4672
|
disabled: disableVariablesForReals || disableInlineMenu === true || disableInlineMenu === "by-input",
|
|
4656
4673
|
replaceValueOnVariableInsert: useInputWithNoVariables,
|
|
4657
4674
|
useInputWhenNoVariables: useInputWithNoVariables,
|
|
4658
|
-
children: /* @__PURE__ */
|
|
4675
|
+
children: /* @__PURE__ */ jsx40(
|
|
4659
4676
|
VariablesComposerInput,
|
|
4660
4677
|
{
|
|
4661
4678
|
id: finalId,
|
|
@@ -4663,7 +4680,7 @@ function InputVariables(props) {
|
|
|
4663
4680
|
"data-testid": dataTestId ? dataTestId : "input-container",
|
|
4664
4681
|
"data-text-value": value,
|
|
4665
4682
|
css: [input, styleVariant === "compact" ? inputCompact : null],
|
|
4666
|
-
placeholder: placeholder ? /* @__PURE__ */
|
|
4683
|
+
placeholder: placeholder ? /* @__PURE__ */ jsx40(
|
|
4667
4684
|
Caption,
|
|
4668
4685
|
{
|
|
4669
4686
|
css: [
|
|
@@ -4677,16 +4694,16 @@ function InputVariables(props) {
|
|
|
4677
4694
|
)
|
|
4678
4695
|
}
|
|
4679
4696
|
),
|
|
4680
|
-
caption ? /* @__PURE__ */
|
|
4681
|
-
errorMessage ? /* @__PURE__ */
|
|
4682
|
-
warningMessage ? /* @__PURE__ */
|
|
4683
|
-
infoMessage ? /* @__PURE__ */
|
|
4697
|
+
caption ? /* @__PURE__ */ jsx40(Caption, { children: caption }) : null,
|
|
4698
|
+
errorMessage ? /* @__PURE__ */ jsx40(ErrorMessage, { message: errorMessage }) : null,
|
|
4699
|
+
warningMessage ? /* @__PURE__ */ jsx40(WarningMessage, { message: warningMessage }) : null,
|
|
4700
|
+
infoMessage ? /* @__PURE__ */ jsx40(InfoMessage, { message: infoMessage }) : null
|
|
4684
4701
|
]
|
|
4685
4702
|
}
|
|
4686
4703
|
);
|
|
4687
4704
|
let body = input3;
|
|
4688
4705
|
if (label) {
|
|
4689
|
-
body = /* @__PURE__ */
|
|
4706
|
+
body = /* @__PURE__ */ jsx40(
|
|
4690
4707
|
VariableField,
|
|
4691
4708
|
{
|
|
4692
4709
|
label,
|
|
@@ -4716,9 +4733,9 @@ function InputVariables(props) {
|
|
|
4716
4733
|
autoFocus,
|
|
4717
4734
|
filterVariable,
|
|
4718
4735
|
children: [
|
|
4719
|
-
/* @__PURE__ */
|
|
4720
|
-
/* @__PURE__ */
|
|
4721
|
-
editorRef ? /* @__PURE__ */
|
|
4736
|
+
/* @__PURE__ */ jsx40(PasteTransformerPlugin, { transformPaste }),
|
|
4737
|
+
/* @__PURE__ */ jsx40(ControlledValuePlugin, { value, enabled: useInputWithNoVariables }),
|
|
4738
|
+
editorRef ? /* @__PURE__ */ jsx40(EditorRefPlugin, { editorRef }) : null,
|
|
4722
4739
|
body
|
|
4723
4740
|
]
|
|
4724
4741
|
}
|
|
@@ -4731,11 +4748,11 @@ function InputVariablesOverlayMenu({
|
|
|
4731
4748
|
...props
|
|
4732
4749
|
}) {
|
|
4733
4750
|
if (disabled) {
|
|
4734
|
-
return /* @__PURE__ */
|
|
4751
|
+
return /* @__PURE__ */ jsx40(Fragment10, { children });
|
|
4735
4752
|
}
|
|
4736
4753
|
return /* @__PURE__ */ jsxs23("div", { css: menuContainer, children: [
|
|
4737
4754
|
children,
|
|
4738
|
-
/* @__PURE__ */
|
|
4755
|
+
/* @__PURE__ */ jsx40(
|
|
4739
4756
|
VariablesComposerVariableMenu,
|
|
4740
4757
|
{
|
|
4741
4758
|
...props,
|
|
@@ -4846,7 +4863,7 @@ var inputMultiLine = (lines) => css23`
|
|
|
4846
4863
|
`;
|
|
4847
4864
|
|
|
4848
4865
|
// src/components/Variables/ParameterConnectionIndicator.tsx
|
|
4849
|
-
import { jsx as
|
|
4866
|
+
import { jsx as jsx41, jsxs as jsxs24 } from "@emotion/react/jsx-runtime";
|
|
4850
4867
|
function ParameterConnectionIndicator({
|
|
4851
4868
|
children,
|
|
4852
4869
|
value,
|
|
@@ -4866,20 +4883,20 @@ function ParameterConnectionIndicator({
|
|
|
4866
4883
|
return result;
|
|
4867
4884
|
}, [value]);
|
|
4868
4885
|
return /* @__PURE__ */ jsxs24(HorizontalRhythm4, { align: "center", gap: "xs", css: { width: "100%" }, children: [
|
|
4869
|
-
/* @__PURE__ */
|
|
4870
|
-
disabled ? null : /* @__PURE__ */
|
|
4886
|
+
/* @__PURE__ */ jsx41("div", { css: { flex: 1 }, children }),
|
|
4887
|
+
disabled ? null : /* @__PURE__ */ jsx41(
|
|
4871
4888
|
Menu3,
|
|
4872
4889
|
{
|
|
4873
4890
|
placement: "bottom-start",
|
|
4874
4891
|
withoutPortal: true,
|
|
4875
|
-
menuTrigger: /* @__PURE__ */
|
|
4892
|
+
menuTrigger: /* @__PURE__ */ jsx41(
|
|
4876
4893
|
"button",
|
|
4877
4894
|
{
|
|
4878
4895
|
title: menuTooltip,
|
|
4879
4896
|
"aria-pressed": hasVariablesInValue,
|
|
4880
4897
|
css: [menuBtn, variableBindButton2],
|
|
4881
4898
|
type: "button",
|
|
4882
|
-
children: /* @__PURE__ */
|
|
4899
|
+
children: /* @__PURE__ */ jsx41(CgUsbC2, { size: "1.4rem" })
|
|
4883
4900
|
}
|
|
4884
4901
|
),
|
|
4885
4902
|
menuLabel: menuTooltip,
|
|
@@ -4931,7 +4948,7 @@ function OnDisconnectPlugin({
|
|
|
4931
4948
|
}
|
|
4932
4949
|
|
|
4933
4950
|
// src/components/Variables/ParameterOrSingleVariable.tsx
|
|
4934
|
-
import { jsx as
|
|
4951
|
+
import { jsx as jsx42, jsxs as jsxs25 } from "@emotion/react/jsx-runtime";
|
|
4935
4952
|
function ParameterOrSingleVariable(props) {
|
|
4936
4953
|
const {
|
|
4937
4954
|
value,
|
|
@@ -4973,11 +4990,11 @@ function ParameterOrSingleVariable(props) {
|
|
|
4973
4990
|
replaceValueOnVariableInsert: true,
|
|
4974
4991
|
disabled: true,
|
|
4975
4992
|
children: [
|
|
4976
|
-
/* @__PURE__ */
|
|
4977
|
-
editorRef ? /* @__PURE__ */
|
|
4978
|
-
/* @__PURE__ */
|
|
4993
|
+
/* @__PURE__ */ jsx42(OnDisconnectPlugin, { onDisconnect: handleDisconnect }),
|
|
4994
|
+
editorRef ? /* @__PURE__ */ jsx42(EditorRefPlugin, { editorRef }) : null,
|
|
4995
|
+
/* @__PURE__ */ jsx42(ControlledValuePlugin, { enabled: true, value }),
|
|
4979
4996
|
/* @__PURE__ */ jsxs25(HorizontalRhythm5, { align: "center", gap: "xs", css: { width: "100%" }, children: [
|
|
4980
|
-
/* @__PURE__ */
|
|
4997
|
+
/* @__PURE__ */ jsx42("div", { css: { flex: 1 }, children: inputWhenNoVariables && !hadVariablesInValue ? inputWhenNoVariables : /* @__PURE__ */ jsx42(
|
|
4981
4998
|
VariablesComposerInput,
|
|
4982
4999
|
{
|
|
4983
5000
|
"data-text-value": value,
|
|
@@ -4985,7 +5002,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
4985
5002
|
css: input2
|
|
4986
5003
|
}
|
|
4987
5004
|
) }),
|
|
4988
|
-
disableVariablesForReals ? null : /* @__PURE__ */
|
|
5005
|
+
disableVariablesForReals ? null : /* @__PURE__ */ jsx42(
|
|
4989
5006
|
VariablesComposerVariableMenu,
|
|
4990
5007
|
{
|
|
4991
5008
|
...sharedMenuProps,
|
|
@@ -5005,7 +5022,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
5005
5022
|
// src/components/Variables/ParameterVariables.tsx
|
|
5006
5023
|
import { css as css24 } from "@emotion/react";
|
|
5007
5024
|
import { HorizontalRhythm as HorizontalRhythm6 } from "@uniformdev/design-system";
|
|
5008
|
-
import { jsx as
|
|
5025
|
+
import { jsx as jsx43, jsxs as jsxs26 } from "@emotion/react/jsx-runtime";
|
|
5009
5026
|
function ParameterVariables(props) {
|
|
5010
5027
|
const {
|
|
5011
5028
|
value,
|
|
@@ -5040,8 +5057,8 @@ function ParameterVariables(props) {
|
|
|
5040
5057
|
autoFocus,
|
|
5041
5058
|
filterVariable,
|
|
5042
5059
|
children: [
|
|
5043
|
-
editorRef ? /* @__PURE__ */
|
|
5044
|
-
/* @__PURE__ */
|
|
5060
|
+
editorRef ? /* @__PURE__ */ jsx43(EditorRefPlugin, { editorRef }) : null,
|
|
5061
|
+
/* @__PURE__ */ jsx43(ControlledValuePlugin, { value, enabled: useInputWhenNoVariables }),
|
|
5045
5062
|
/* @__PURE__ */ jsxs26(
|
|
5046
5063
|
HorizontalRhythm6,
|
|
5047
5064
|
{
|
|
@@ -5054,7 +5071,7 @@ function ParameterVariables(props) {
|
|
|
5054
5071
|
}
|
|
5055
5072
|
},
|
|
5056
5073
|
children: [
|
|
5057
|
-
/* @__PURE__ */
|
|
5074
|
+
/* @__PURE__ */ jsx43("div", { css: { flex: 1 }, children: useInputWhenNoVariables ? inputWhenNoVariables : /* @__PURE__ */ jsx43(
|
|
5058
5075
|
VariablesComposerInput,
|
|
5059
5076
|
{
|
|
5060
5077
|
"aria-label": ariaLabel,
|
|
@@ -5067,7 +5084,7 @@ function ParameterVariables(props) {
|
|
|
5067
5084
|
]
|
|
5068
5085
|
}
|
|
5069
5086
|
) }),
|
|
5070
|
-
disableVariablesForReals ? null : /* @__PURE__ */
|
|
5087
|
+
disableVariablesForReals ? null : /* @__PURE__ */ jsx43(
|
|
5071
5088
|
VariablesComposerVariableMenu,
|
|
5072
5089
|
{
|
|
5073
5090
|
...sharedMenuProps,
|
|
@@ -5111,7 +5128,7 @@ import {
|
|
|
5111
5128
|
TableHead,
|
|
5112
5129
|
TableRow
|
|
5113
5130
|
} from "@uniformdev/design-system";
|
|
5114
|
-
import {
|
|
5131
|
+
import { Draggable as Draggable2, Droppable as Droppable2 } from "react-beautiful-dnd";
|
|
5115
5132
|
|
|
5116
5133
|
// src/components/Variables/styles/VariablesList.styles.ts
|
|
5117
5134
|
import { css as css25 } from "@emotion/react";
|
|
@@ -5159,7 +5176,7 @@ var variableValue = css25`
|
|
|
5159
5176
|
`;
|
|
5160
5177
|
|
|
5161
5178
|
// src/components/Variables/VariablesList.tsx
|
|
5162
|
-
import { Fragment as Fragment11, jsx as
|
|
5179
|
+
import { Fragment as Fragment11, jsx as jsx44, jsxs as jsxs27 } from "@emotion/react/jsx-runtime";
|
|
5163
5180
|
function VariablesList() {
|
|
5164
5181
|
const { variables, dispatch, readOnly } = useVariables();
|
|
5165
5182
|
const sorted = variablesToList(variables).filter((variable) => !variable.system);
|
|
@@ -5181,17 +5198,17 @@ function VariablesList() {
|
|
|
5181
5198
|
}
|
|
5182
5199
|
};
|
|
5183
5200
|
return /* @__PURE__ */ jsxs27(Fragment11, { children: [
|
|
5184
|
-
/* @__PURE__ */
|
|
5185
|
-
/* @__PURE__ */
|
|
5186
|
-
/* @__PURE__ */
|
|
5187
|
-
/* @__PURE__ */
|
|
5188
|
-
/* @__PURE__ */
|
|
5201
|
+
/* @__PURE__ */ jsx44(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx44(Droppable2, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ jsxs27(Table, { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
5202
|
+
/* @__PURE__ */ jsx44(TableHead, { children: /* @__PURE__ */ jsxs27(TableRow, { children: [
|
|
5203
|
+
/* @__PURE__ */ jsx44(TableCellHead, { children: "Name" }),
|
|
5204
|
+
/* @__PURE__ */ jsx44(TableCellHead, { children: "Default Value" }),
|
|
5205
|
+
/* @__PURE__ */ jsx44(TableCellHead, {})
|
|
5189
5206
|
] }) }),
|
|
5190
5207
|
/* @__PURE__ */ jsxs27(TableBody, { children: [
|
|
5191
5208
|
sorted.map(({ name, displayName, default: defaultValue }, index) => {
|
|
5192
5209
|
const text = displayName != null ? displayName : name;
|
|
5193
5210
|
const textValue = variableDefaultTextValue(defaultValue);
|
|
5194
|
-
return /* @__PURE__ */
|
|
5211
|
+
return /* @__PURE__ */ jsx44(
|
|
5195
5212
|
Draggable2,
|
|
5196
5213
|
{
|
|
5197
5214
|
draggableId: name,
|
|
@@ -5207,7 +5224,7 @@ function VariablesList() {
|
|
|
5207
5224
|
css: tableRow(snapshot.isDragging),
|
|
5208
5225
|
"data-dragging": snapshot.isDragging,
|
|
5209
5226
|
children: [
|
|
5210
|
-
/* @__PURE__ */
|
|
5227
|
+
/* @__PURE__ */ jsx44(TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: readOnly ? /* @__PURE__ */ jsx44("span", { css: variableName, children: text }) : /* @__PURE__ */ jsx44(
|
|
5211
5228
|
"button",
|
|
5212
5229
|
{
|
|
5213
5230
|
css: variableName,
|
|
@@ -5220,8 +5237,8 @@ function VariablesList() {
|
|
|
5220
5237
|
children: text
|
|
5221
5238
|
}
|
|
5222
5239
|
) }),
|
|
5223
|
-
/* @__PURE__ */
|
|
5224
|
-
/* @__PURE__ */
|
|
5240
|
+
/* @__PURE__ */ jsx44(TableCellData, { children: /* @__PURE__ */ jsx44("span", { css: variableValue, title: textValue, children: textValue }) }),
|
|
5241
|
+
/* @__PURE__ */ jsx44(TableCellData, { align: "right", children: readOnly ? null : /* @__PURE__ */ jsx44(
|
|
5225
5242
|
"button",
|
|
5226
5243
|
{
|
|
5227
5244
|
type: "button",
|
|
@@ -5234,7 +5251,7 @@ function VariablesList() {
|
|
|
5234
5251
|
],
|
|
5235
5252
|
"aria-controls": text,
|
|
5236
5253
|
onClick: () => dispatch({ type: "remove", variable: name }),
|
|
5237
|
-
children: /* @__PURE__ */
|
|
5254
|
+
children: /* @__PURE__ */ jsx44(Icon5, { icon: "trash", iconColor: "red" })
|
|
5238
5255
|
}
|
|
5239
5256
|
) })
|
|
5240
5257
|
]
|
|
@@ -5247,7 +5264,7 @@ function VariablesList() {
|
|
|
5247
5264
|
provided.placeholder
|
|
5248
5265
|
] })
|
|
5249
5266
|
] }) }) }),
|
|
5250
|
-
!readOnly && /* @__PURE__ */
|
|
5267
|
+
!readOnly && /* @__PURE__ */ jsx44(
|
|
5251
5268
|
AddListButton,
|
|
5252
5269
|
{
|
|
5253
5270
|
onButtonClick: () => dispatch({ type: "edit", variable: "" }),
|
|
@@ -5261,37 +5278,37 @@ function VariablesList() {
|
|
|
5261
5278
|
}
|
|
5262
5279
|
|
|
5263
5280
|
// src/components/DataResourceDynamicInputProvider.tsx
|
|
5264
|
-
import { jsx as
|
|
5281
|
+
import { jsx as jsx45 } from "@emotion/react/jsx-runtime";
|
|
5265
5282
|
function DataResourceDynamicInputProvider(props) {
|
|
5266
5283
|
const { children, dynamicInputs } = props;
|
|
5267
5284
|
if (dynamicInputs) {
|
|
5268
|
-
return /* @__PURE__ */
|
|
5285
|
+
return /* @__PURE__ */ jsx45(DataResourceDynamicInputProviderRenderer, { ...props, children });
|
|
5269
5286
|
}
|
|
5270
|
-
return /* @__PURE__ */
|
|
5287
|
+
return /* @__PURE__ */ jsx45(DataResourceDynamicInputProviderContextShim, { children });
|
|
5271
5288
|
}
|
|
5272
5289
|
function DataResourceDynamicInputProviderContextShim(props) {
|
|
5273
5290
|
const {
|
|
5274
5291
|
metadata: { dynamicInputs }
|
|
5275
5292
|
} = useMeshLocation("dataResource");
|
|
5276
|
-
return /* @__PURE__ */
|
|
5293
|
+
return /* @__PURE__ */ jsx45(DataResourceDynamicInputProviderRenderer, { ...props, dynamicInputs });
|
|
5277
5294
|
}
|
|
5278
5295
|
function DataResourceDynamicInputProviderRenderer({
|
|
5279
5296
|
children,
|
|
5280
5297
|
dynamicInputs
|
|
5281
5298
|
}) {
|
|
5282
5299
|
const variables = useDynamicInputsAsVariables(dynamicInputs);
|
|
5283
|
-
return /* @__PURE__ */
|
|
5300
|
+
return /* @__PURE__ */ jsx45(VariablesProvider, { value: variables, readOnly: true, children });
|
|
5284
5301
|
}
|
|
5285
5302
|
|
|
5286
5303
|
// src/components/DataResourceVariablesList.tsx
|
|
5287
5304
|
import { Callout as Callout4, VerticalRhythm } from "@uniformdev/design-system";
|
|
5288
|
-
import { jsx as
|
|
5305
|
+
import { jsx as jsx46 } from "@emotion/react/jsx-runtime";
|
|
5289
5306
|
function DataResourceVariablesList(props) {
|
|
5290
5307
|
const {
|
|
5291
5308
|
value,
|
|
5292
5309
|
metadata: { dataType, dynamicInputs }
|
|
5293
5310
|
} = useMeshLocation("dataResource");
|
|
5294
|
-
return /* @__PURE__ */
|
|
5311
|
+
return /* @__PURE__ */ jsx46(
|
|
5295
5312
|
DataResourceVariablesListExplicit,
|
|
5296
5313
|
{
|
|
5297
5314
|
...props,
|
|
@@ -5312,14 +5329,14 @@ function DataResourceVariablesListExplicit({
|
|
|
5312
5329
|
const variableDefinitions = variablesToList(dataType.variables);
|
|
5313
5330
|
if (variableDefinitions.length === 0) {
|
|
5314
5331
|
if (NoVariablesComponent) {
|
|
5315
|
-
return /* @__PURE__ */
|
|
5332
|
+
return /* @__PURE__ */ jsx46(NoVariablesComponent, {});
|
|
5316
5333
|
}
|
|
5317
|
-
return /* @__PURE__ */
|
|
5334
|
+
return /* @__PURE__ */ jsx46(Callout4, { type: "note", children: "No settings are required." });
|
|
5318
5335
|
}
|
|
5319
|
-
return /* @__PURE__ */
|
|
5336
|
+
return /* @__PURE__ */ jsx46(DataResourceDynamicInputProvider, { dynamicInputs, children: /* @__PURE__ */ jsx46(VerticalRhythm, { children: variableDefinitions.map((variableDefinition) => {
|
|
5320
5337
|
var _a, _b, _c;
|
|
5321
5338
|
const VariableRenderer = variableDefinition.type ? (_a = typeRenderers == null ? void 0 : typeRenderers[variableDefinition.type]) != null ? _a : TextVariableRenderer : TextVariableRenderer;
|
|
5322
|
-
return /* @__PURE__ */
|
|
5339
|
+
return /* @__PURE__ */ jsx46("div", { children: /* @__PURE__ */ jsx46(
|
|
5323
5340
|
VariableRenderer,
|
|
5324
5341
|
{
|
|
5325
5342
|
definition: variableDefinition,
|
|
@@ -5344,7 +5361,7 @@ function DataResourceVariablesListExplicit({
|
|
|
5344
5361
|
}
|
|
5345
5362
|
function TextVariableRenderer({ definition, value, setValue }) {
|
|
5346
5363
|
var _a;
|
|
5347
|
-
return /* @__PURE__ */
|
|
5364
|
+
return /* @__PURE__ */ jsx46("div", { "data-testid": "variable-input-container", children: /* @__PURE__ */ jsx46(
|
|
5348
5365
|
InputVariables,
|
|
5349
5366
|
{
|
|
5350
5367
|
label: definition.displayName || definition.name,
|
|
@@ -5359,11 +5376,11 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
5359
5376
|
// src/components/Request/RequestBody.tsx
|
|
5360
5377
|
import { css as css28 } from "@emotion/react";
|
|
5361
5378
|
import { InputSelect as InputSelect4, JsonEditor } from "@uniformdev/design-system";
|
|
5362
|
-
import { useState as
|
|
5379
|
+
import { useState as useState14 } from "react";
|
|
5363
5380
|
|
|
5364
5381
|
// src/components/Request/RequestProvider.tsx
|
|
5365
5382
|
import * as React11 from "react";
|
|
5366
|
-
import { jsx as
|
|
5383
|
+
import { jsx as jsx47 } from "@emotion/react/jsx-runtime";
|
|
5367
5384
|
var RequestContext = React11.createContext(null);
|
|
5368
5385
|
function RequestProvider({ value, onChange, children }) {
|
|
5369
5386
|
const contextValue = React11.useMemo(() => {
|
|
@@ -5432,7 +5449,7 @@ function RequestProvider({ value, onChange, children }) {
|
|
|
5432
5449
|
request: value
|
|
5433
5450
|
};
|
|
5434
5451
|
}, [onChange, value]);
|
|
5435
|
-
return /* @__PURE__ */
|
|
5452
|
+
return /* @__PURE__ */ jsx47(RequestContext.Provider, { value: contextValue, children });
|
|
5436
5453
|
}
|
|
5437
5454
|
function useRequest() {
|
|
5438
5455
|
const context = React11.useContext(RequestContext);
|
|
@@ -5456,17 +5473,17 @@ var requestTypeContainer = (bgColor) => css27`
|
|
|
5456
5473
|
`;
|
|
5457
5474
|
|
|
5458
5475
|
// src/components/Request/RequestTypeContainer.tsx
|
|
5459
|
-
import { jsx as
|
|
5476
|
+
import { jsx as jsx48 } from "@emotion/react/jsx-runtime";
|
|
5460
5477
|
var RequestTypeContainer = ({
|
|
5461
5478
|
bgColor = "transparent",
|
|
5462
5479
|
children,
|
|
5463
5480
|
...props
|
|
5464
5481
|
}) => {
|
|
5465
|
-
return /* @__PURE__ */
|
|
5482
|
+
return /* @__PURE__ */ jsx48("div", { css: requestTypeContainer(bgColor), ...props, children });
|
|
5466
5483
|
};
|
|
5467
5484
|
|
|
5468
5485
|
// src/components/Request/RequestBody.tsx
|
|
5469
|
-
import { jsx as
|
|
5486
|
+
import { jsx as jsx49, jsxs as jsxs28 } from "@emotion/react/jsx-runtime";
|
|
5470
5487
|
var LANGUAGE_OPTIONS = [
|
|
5471
5488
|
{ label: "Text", value: "plaintext" },
|
|
5472
5489
|
{ label: "JSON", value: "json" },
|
|
@@ -5485,7 +5502,7 @@ var LANGUAGE_TO_CONTENT_TYPE = {
|
|
|
5485
5502
|
};
|
|
5486
5503
|
function RequestBody() {
|
|
5487
5504
|
const { request, dispatch } = useRequest();
|
|
5488
|
-
const [language, setLanguage] =
|
|
5505
|
+
const [language, setLanguage] = useState14("json");
|
|
5489
5506
|
return /* @__PURE__ */ jsxs28(
|
|
5490
5507
|
"div",
|
|
5491
5508
|
{
|
|
@@ -5493,14 +5510,14 @@ function RequestBody() {
|
|
|
5493
5510
|
background: var(--white);
|
|
5494
5511
|
`,
|
|
5495
5512
|
children: [
|
|
5496
|
-
/* @__PURE__ */
|
|
5513
|
+
/* @__PURE__ */ jsx49(
|
|
5497
5514
|
RequestTypeContainer,
|
|
5498
5515
|
{
|
|
5499
5516
|
bgColor: "var(--gray-100)",
|
|
5500
5517
|
css: css28`
|
|
5501
5518
|
padding: var(--spacing-sm) var(--spacing-base);
|
|
5502
5519
|
`,
|
|
5503
|
-
children: /* @__PURE__ */
|
|
5520
|
+
children: /* @__PURE__ */ jsx49(
|
|
5504
5521
|
InputSelect4,
|
|
5505
5522
|
{
|
|
5506
5523
|
label: "Language",
|
|
@@ -5523,7 +5540,7 @@ function RequestBody() {
|
|
|
5523
5540
|
)
|
|
5524
5541
|
}
|
|
5525
5542
|
),
|
|
5526
|
-
/* @__PURE__ */
|
|
5543
|
+
/* @__PURE__ */ jsx49(
|
|
5527
5544
|
JsonEditor,
|
|
5528
5545
|
{
|
|
5529
5546
|
height: 200,
|
|
@@ -5551,7 +5568,7 @@ import {
|
|
|
5551
5568
|
TableRow as TableRow2,
|
|
5552
5569
|
WarningMessage as WarningMessage2
|
|
5553
5570
|
} from "@uniformdev/design-system";
|
|
5554
|
-
import { jsx as
|
|
5571
|
+
import { jsx as jsx50, jsxs as jsxs29 } from "@emotion/react/jsx-runtime";
|
|
5555
5572
|
function RequestHeaders({
|
|
5556
5573
|
disableVariables,
|
|
5557
5574
|
addOmitIfEmpty
|
|
@@ -5570,29 +5587,29 @@ function RequestHeaders({
|
|
|
5570
5587
|
index
|
|
5571
5588
|
});
|
|
5572
5589
|
};
|
|
5573
|
-
return /* @__PURE__ */
|
|
5574
|
-
/* @__PURE__ */
|
|
5575
|
-
/* @__PURE__ */
|
|
5576
|
-
/* @__PURE__ */
|
|
5577
|
-
addOmitIfEmpty ? /* @__PURE__ */
|
|
5590
|
+
return /* @__PURE__ */ jsx50("div", { css: innerContentStyles, children: /* @__PURE__ */ jsxs29(Table2, { children: [
|
|
5591
|
+
/* @__PURE__ */ jsx50(TableHead2, { children: /* @__PURE__ */ jsxs29(TableRow2, { children: [
|
|
5592
|
+
/* @__PURE__ */ jsx50(TableCellHead2, { children: "Name" }),
|
|
5593
|
+
/* @__PURE__ */ jsx50(TableCellHead2, { children: "Value" }),
|
|
5594
|
+
addOmitIfEmpty ? /* @__PURE__ */ jsx50(TableCellHead2, { children: "Omit If Empty" }) : null
|
|
5578
5595
|
] }) }),
|
|
5579
5596
|
/* @__PURE__ */ jsxs29(TableBody2, { children: [
|
|
5580
5597
|
(_b = (_a = request.baseRequest) == null ? void 0 : _a.headers) == null ? void 0 : _b.map((baseHeader) => {
|
|
5581
5598
|
return /* @__PURE__ */ jsxs29(TableRow2, { children: [
|
|
5582
5599
|
/* @__PURE__ */ jsxs29(TableCellData2, { width: "50%", children: [
|
|
5583
5600
|
baseHeader.key,
|
|
5584
|
-
/* @__PURE__ */
|
|
5585
|
-
/* @__PURE__ */
|
|
5601
|
+
/* @__PURE__ */ jsx50("br", {}),
|
|
5602
|
+
/* @__PURE__ */ jsx50("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ jsx50("small", { children: "from data source" }) })
|
|
5586
5603
|
] }),
|
|
5587
5604
|
/* @__PURE__ */ jsxs29(TableCellData2, { width: "50%", children: [
|
|
5588
|
-
/* @__PURE__ */
|
|
5589
|
-
request.headers.find((p) => p.key === baseHeader.key) ? /* @__PURE__ */
|
|
5605
|
+
/* @__PURE__ */ jsx50("i", { css: { color: "var(--gray-500)" }, children: baseHeader.value }),
|
|
5606
|
+
request.headers.find((p) => p.key === baseHeader.key) ? /* @__PURE__ */ jsx50(WarningMessage2, { message: "overridden below" }) : null
|
|
5590
5607
|
] })
|
|
5591
5608
|
] }, baseHeader.key);
|
|
5592
5609
|
}),
|
|
5593
5610
|
deezHeaders.map((header, index) => {
|
|
5594
5611
|
return /* @__PURE__ */ jsxs29(TableRow2, { children: [
|
|
5595
|
-
/* @__PURE__ */
|
|
5612
|
+
/* @__PURE__ */ jsx50(TableCellData2, { width: "50%", children: /* @__PURE__ */ jsx50(
|
|
5596
5613
|
Input3,
|
|
5597
5614
|
{
|
|
5598
5615
|
label: header.key,
|
|
@@ -5612,7 +5629,7 @@ function RequestHeaders({
|
|
|
5612
5629
|
"data-testid": "header-key"
|
|
5613
5630
|
}
|
|
5614
5631
|
) }),
|
|
5615
|
-
/* @__PURE__ */
|
|
5632
|
+
/* @__PURE__ */ jsx50(TableCellData2, { width: "50%", children: header.key ? /* @__PURE__ */ jsx50(
|
|
5616
5633
|
InputVariables,
|
|
5617
5634
|
{
|
|
5618
5635
|
value: header.value,
|
|
@@ -5623,7 +5640,7 @@ function RequestHeaders({
|
|
|
5623
5640
|
"data-testid": "header-value"
|
|
5624
5641
|
}
|
|
5625
5642
|
) : null }),
|
|
5626
|
-
addOmitIfEmpty ? /* @__PURE__ */
|
|
5643
|
+
addOmitIfEmpty ? /* @__PURE__ */ jsx50(TableCellData2, { width: "50%", children: header.key ? /* @__PURE__ */ jsx50(
|
|
5627
5644
|
Input3,
|
|
5628
5645
|
{
|
|
5629
5646
|
type: "checkbox",
|
|
@@ -5648,11 +5665,11 @@ function RequestHeaders({
|
|
|
5648
5665
|
|
|
5649
5666
|
// src/components/Request/RequestMethodSelect.tsx
|
|
5650
5667
|
import { InputSelect as InputSelect5 } from "@uniformdev/design-system";
|
|
5651
|
-
import { jsx as
|
|
5668
|
+
import { jsx as jsx51 } from "@emotion/react/jsx-runtime";
|
|
5652
5669
|
function RequestMethodSelect(props) {
|
|
5653
5670
|
var _a;
|
|
5654
5671
|
const { request, dispatch } = useRequest();
|
|
5655
|
-
return /* @__PURE__ */
|
|
5672
|
+
return /* @__PURE__ */ jsx51(
|
|
5656
5673
|
InputSelect5,
|
|
5657
5674
|
{
|
|
5658
5675
|
...props,
|
|
@@ -5678,7 +5695,7 @@ import {
|
|
|
5678
5695
|
TableRow as TableRow3,
|
|
5679
5696
|
WarningMessage as WarningMessage3
|
|
5680
5697
|
} from "@uniformdev/design-system";
|
|
5681
|
-
import { jsx as
|
|
5698
|
+
import { jsx as jsx52, jsxs as jsxs30 } from "@emotion/react/jsx-runtime";
|
|
5682
5699
|
function RequestParameters({
|
|
5683
5700
|
disableVariables,
|
|
5684
5701
|
addOmitIfEmpty
|
|
@@ -5698,29 +5715,29 @@ function RequestParameters({
|
|
|
5698
5715
|
index
|
|
5699
5716
|
});
|
|
5700
5717
|
};
|
|
5701
|
-
return /* @__PURE__ */
|
|
5702
|
-
/* @__PURE__ */
|
|
5703
|
-
/* @__PURE__ */
|
|
5704
|
-
/* @__PURE__ */
|
|
5705
|
-
addOmitIfEmpty ? /* @__PURE__ */
|
|
5718
|
+
return /* @__PURE__ */ jsx52("div", { css: innerContentStyles, children: /* @__PURE__ */ jsxs30(Table3, { children: [
|
|
5719
|
+
/* @__PURE__ */ jsx52(TableHead3, { children: /* @__PURE__ */ jsxs30(TableRow3, { children: [
|
|
5720
|
+
/* @__PURE__ */ jsx52(TableCellHead3, { children: "Name" }),
|
|
5721
|
+
/* @__PURE__ */ jsx52(TableCellHead3, { children: "Value" }),
|
|
5722
|
+
addOmitIfEmpty ? /* @__PURE__ */ jsx52(TableCellHead3, { children: "Omit If Empty" }) : null
|
|
5706
5723
|
] }) }),
|
|
5707
5724
|
/* @__PURE__ */ jsxs30(TableBody3, { children: [
|
|
5708
5725
|
(_b = (_a = request.baseRequest) == null ? void 0 : _a.parameters) == null ? void 0 : _b.map((baseParameter) => {
|
|
5709
5726
|
return /* @__PURE__ */ jsxs30(TableRow3, { children: [
|
|
5710
5727
|
/* @__PURE__ */ jsxs30(TableCellData3, { width: "50%", children: [
|
|
5711
5728
|
baseParameter.key,
|
|
5712
|
-
/* @__PURE__ */
|
|
5713
|
-
/* @__PURE__ */
|
|
5729
|
+
/* @__PURE__ */ jsx52("br", {}),
|
|
5730
|
+
/* @__PURE__ */ jsx52("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ jsx52("small", { children: "from data source" }) })
|
|
5714
5731
|
] }),
|
|
5715
5732
|
/* @__PURE__ */ jsxs30(TableCellData3, { width: "50%", children: [
|
|
5716
|
-
/* @__PURE__ */
|
|
5717
|
-
request.parameters.find((p) => p.key === baseParameter.key) ? /* @__PURE__ */
|
|
5733
|
+
/* @__PURE__ */ jsx52("i", { css: { color: "var(--gray-500)" }, children: baseParameter.value }),
|
|
5734
|
+
request.parameters.find((p) => p.key === baseParameter.key) ? /* @__PURE__ */ jsx52(WarningMessage3, { message: "overridden below" }) : null
|
|
5718
5735
|
] })
|
|
5719
5736
|
] }, baseParameter.key);
|
|
5720
5737
|
}),
|
|
5721
5738
|
deezParameters.map((parameter, index) => {
|
|
5722
5739
|
return /* @__PURE__ */ jsxs30(TableRow3, { children: [
|
|
5723
|
-
/* @__PURE__ */
|
|
5740
|
+
/* @__PURE__ */ jsx52(TableCellData3, { width: "50%", children: /* @__PURE__ */ jsx52(
|
|
5724
5741
|
Input4,
|
|
5725
5742
|
{
|
|
5726
5743
|
label: parameter.key,
|
|
@@ -5744,7 +5761,7 @@ function RequestParameters({
|
|
|
5744
5761
|
"data-testid": "parameter-key"
|
|
5745
5762
|
}
|
|
5746
5763
|
) }),
|
|
5747
|
-
/* @__PURE__ */
|
|
5764
|
+
/* @__PURE__ */ jsx52(TableCellData3, { width: "50%", children: parameter.key ? /* @__PURE__ */ jsx52(
|
|
5748
5765
|
InputVariables,
|
|
5749
5766
|
{
|
|
5750
5767
|
value: parameter.value,
|
|
@@ -5760,7 +5777,7 @@ function RequestParameters({
|
|
|
5760
5777
|
enableEditingVariables: true
|
|
5761
5778
|
}
|
|
5762
5779
|
) : null }),
|
|
5763
|
-
addOmitIfEmpty ? /* @__PURE__ */
|
|
5780
|
+
addOmitIfEmpty ? /* @__PURE__ */ jsx52(TableCellData3, { width: "50%", children: parameter.key ? /* @__PURE__ */ jsx52(
|
|
5764
5781
|
Input4,
|
|
5765
5782
|
{
|
|
5766
5783
|
type: "checkbox",
|
|
@@ -5808,7 +5825,7 @@ function decodeVariablesInUrlEncodedString(string, varValues) {
|
|
|
5808
5825
|
}
|
|
5809
5826
|
|
|
5810
5827
|
// src/components/Request/RequestUrl.tsx
|
|
5811
|
-
import { Fragment as Fragment12, jsx as
|
|
5828
|
+
import { Fragment as Fragment12, jsx as jsx53, jsxs as jsxs31 } from "@emotion/react/jsx-runtime";
|
|
5812
5829
|
function RequestUrl() {
|
|
5813
5830
|
var _a, _b;
|
|
5814
5831
|
const { variables } = useVariables();
|
|
@@ -5829,7 +5846,7 @@ function RequestUrl() {
|
|
|
5829
5846
|
word-break: break-word;
|
|
5830
5847
|
`,
|
|
5831
5848
|
children: [
|
|
5832
|
-
request.baseRequest ? /* @__PURE__ */
|
|
5849
|
+
request.baseRequest ? /* @__PURE__ */ jsx53("span", { children: (_b = request.baseRequest) == null ? void 0 : _b.baseUrl }) : null,
|
|
5833
5850
|
/* @__PURE__ */ jsxs31("span", { css: { fontWeight: request.baseRequest ? "bold" : "inherit" }, children: [
|
|
5834
5851
|
urlEncodeRequestUrl(request.relativeUrl, variables),
|
|
5835
5852
|
mergedParameters.length > 0 ? /* @__PURE__ */ jsxs31(Fragment12, { children: [
|
|
@@ -5875,10 +5892,10 @@ function transformPastedUrl(value, currentRequest, dispatch) {
|
|
|
5875
5892
|
}
|
|
5876
5893
|
|
|
5877
5894
|
// src/components/Request/RequestUrlInput.tsx
|
|
5878
|
-
import { jsx as
|
|
5895
|
+
import { jsx as jsx54 } from "@emotion/react/jsx-runtime";
|
|
5879
5896
|
function RequestUrlInput(props) {
|
|
5880
5897
|
const { request, dispatch } = useRequest();
|
|
5881
|
-
return /* @__PURE__ */
|
|
5898
|
+
return /* @__PURE__ */ jsx54(
|
|
5882
5899
|
InputVariables,
|
|
5883
5900
|
{
|
|
5884
5901
|
...props,
|
|
@@ -5928,12 +5945,12 @@ function useRequestParameter(paramName) {
|
|
|
5928
5945
|
}
|
|
5929
5946
|
|
|
5930
5947
|
// src/components/DataSourceEditor.tsx
|
|
5931
|
-
import { jsx as
|
|
5948
|
+
import { jsx as jsx55 } from "@emotion/react/jsx-runtime";
|
|
5932
5949
|
function DataSourceEditor({ onChange, children, editVariableComponent }) {
|
|
5933
5950
|
var _a;
|
|
5934
5951
|
const { value } = useMeshLocation("dataSource");
|
|
5935
5952
|
const currentRequestValue = convertDataSourceToRequestData(value);
|
|
5936
|
-
return /* @__PURE__ */
|
|
5953
|
+
return /* @__PURE__ */ jsx55(
|
|
5937
5954
|
VariablesProvider,
|
|
5938
5955
|
{
|
|
5939
5956
|
value: (_a = value.variables) != null ? _a : {},
|
|
@@ -5949,7 +5966,7 @@ function DataSourceEditor({ onChange, children, editVariableComponent }) {
|
|
|
5949
5966
|
},
|
|
5950
5967
|
editVariableComponent,
|
|
5951
5968
|
readOnly: true,
|
|
5952
|
-
children: /* @__PURE__ */
|
|
5969
|
+
children: /* @__PURE__ */ jsx55(
|
|
5953
5970
|
RequestProvider,
|
|
5954
5971
|
{
|
|
5955
5972
|
value: currentRequestValue,
|
|
@@ -5986,7 +6003,7 @@ function convertRequestDataToDataSource(dataSource, requestData) {
|
|
|
5986
6003
|
}
|
|
5987
6004
|
|
|
5988
6005
|
// src/components/DataTypeEditor.tsx
|
|
5989
|
-
import { jsx as
|
|
6006
|
+
import { jsx as jsx56 } from "@emotion/react/jsx-runtime";
|
|
5990
6007
|
function DataTypeEditor({ onChange, children, editVariableComponent }) {
|
|
5991
6008
|
var _a;
|
|
5992
6009
|
const {
|
|
@@ -5995,7 +6012,7 @@ function DataTypeEditor({ onChange, children, editVariableComponent }) {
|
|
|
5995
6012
|
isReadOnly
|
|
5996
6013
|
} = useMeshLocation("dataType");
|
|
5997
6014
|
const currentRequestValue = convertDataTypeToRequestData(value, dataSource);
|
|
5998
|
-
return /* @__PURE__ */
|
|
6015
|
+
return /* @__PURE__ */ jsx56(
|
|
5999
6016
|
VariablesProvider,
|
|
6000
6017
|
{
|
|
6001
6018
|
value: (_a = value.variables) != null ? _a : {},
|
|
@@ -6011,7 +6028,7 @@ function DataTypeEditor({ onChange, children, editVariableComponent }) {
|
|
|
6011
6028
|
},
|
|
6012
6029
|
editVariableComponent,
|
|
6013
6030
|
readOnly: isReadOnly,
|
|
6014
|
-
children: /* @__PURE__ */
|
|
6031
|
+
children: /* @__PURE__ */ jsx56(
|
|
6015
6032
|
RequestProvider,
|
|
6016
6033
|
{
|
|
6017
6034
|
value: currentRequestValue,
|
|
@@ -6061,10 +6078,10 @@ import { LoadingIndicator as LoadingIndicator3, Theme as Theme2 } from "@uniform
|
|
|
6061
6078
|
|
|
6062
6079
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
6063
6080
|
import { initializeUniformMeshSDK } from "@uniformdev/mesh-sdk";
|
|
6064
|
-
import { useEffect as useEffect15, useRef as useRef14, useState as
|
|
6081
|
+
import { useEffect as useEffect15, useRef as useRef14, useState as useState15 } from "react";
|
|
6065
6082
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
6066
|
-
const [error, setError] =
|
|
6067
|
-
const [sdk, setSdk] =
|
|
6083
|
+
const [error, setError] = useState15();
|
|
6084
|
+
const [sdk, setSdk] = useState15();
|
|
6068
6085
|
const initializationInProgress = useRef14(false);
|
|
6069
6086
|
useEffect15(
|
|
6070
6087
|
() => {
|
|
@@ -6099,7 +6116,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
|
6099
6116
|
};
|
|
6100
6117
|
|
|
6101
6118
|
// src/components/MeshApp.tsx
|
|
6102
|
-
import { jsx as
|
|
6119
|
+
import { jsx as jsx57, jsxs as jsxs32 } from "@emotion/react/jsx-runtime";
|
|
6103
6120
|
var MeshApp = ({
|
|
6104
6121
|
children,
|
|
6105
6122
|
loadingComponent,
|
|
@@ -6108,25 +6125,25 @@ var MeshApp = ({
|
|
|
6108
6125
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
6109
6126
|
if (initializing || !sdk) {
|
|
6110
6127
|
const LoadingComponent = loadingComponent;
|
|
6111
|
-
return LoadingComponent ? /* @__PURE__ */
|
|
6128
|
+
return LoadingComponent ? /* @__PURE__ */ jsx57(LoadingComponent, {}) : /* @__PURE__ */ jsx57(LoadingIndicator3, {});
|
|
6112
6129
|
}
|
|
6113
6130
|
if (error) {
|
|
6114
6131
|
const ErrorComponent = errorComponent;
|
|
6115
6132
|
if (ErrorComponent) {
|
|
6116
|
-
return /* @__PURE__ */
|
|
6133
|
+
return /* @__PURE__ */ jsx57(ErrorComponent, { error });
|
|
6117
6134
|
}
|
|
6118
6135
|
throw error;
|
|
6119
6136
|
}
|
|
6120
6137
|
return /* @__PURE__ */ jsxs32(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
|
|
6121
|
-
/* @__PURE__ */
|
|
6122
|
-
/* @__PURE__ */
|
|
6138
|
+
/* @__PURE__ */ jsx57(Theme2, {}),
|
|
6139
|
+
/* @__PURE__ */ jsx57(UniformMeshLocationContextProvider, { children })
|
|
6123
6140
|
] });
|
|
6124
6141
|
};
|
|
6125
6142
|
|
|
6126
6143
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
6127
6144
|
import { css as css30 } from "@emotion/react";
|
|
6128
6145
|
import { Button as Button3, LoadingIndicator as LoadingIndicator4 } from "@uniformdev/design-system";
|
|
6129
|
-
import { jsx as
|
|
6146
|
+
import { jsx as jsx58, jsxs as jsxs33 } from "@emotion/react/jsx-runtime";
|
|
6130
6147
|
var DataRefreshButton = ({
|
|
6131
6148
|
buttonText,
|
|
6132
6149
|
isLoading,
|
|
@@ -6134,7 +6151,7 @@ var DataRefreshButton = ({
|
|
|
6134
6151
|
...props
|
|
6135
6152
|
}) => {
|
|
6136
6153
|
return /* @__PURE__ */ jsxs33(Button3, { buttonType: "primaryInvert", onClick: onRefreshData, disabled: isLoading, ...props, children: [
|
|
6137
|
-
!isLoading ? null : /* @__PURE__ */
|
|
6154
|
+
!isLoading ? null : /* @__PURE__ */ jsx58(
|
|
6138
6155
|
LoadingIndicator4,
|
|
6139
6156
|
{
|
|
6140
6157
|
css: css30`
|
|
@@ -6159,9 +6176,9 @@ import {
|
|
|
6159
6176
|
useContext as useContext7,
|
|
6160
6177
|
useDeferredValue,
|
|
6161
6178
|
useMemo as useMemo14,
|
|
6162
|
-
useState as
|
|
6179
|
+
useState as useState16
|
|
6163
6180
|
} from "react";
|
|
6164
|
-
import { jsx as
|
|
6181
|
+
import { jsx as jsx59 } from "@emotion/react/jsx-runtime";
|
|
6165
6182
|
var ObjectSearchContext = createContext5({
|
|
6166
6183
|
onSetQuery: () => {
|
|
6167
6184
|
},
|
|
@@ -6183,15 +6200,15 @@ var ObjectSearchProvider = ({
|
|
|
6183
6200
|
children,
|
|
6184
6201
|
defaultQuery
|
|
6185
6202
|
}) => {
|
|
6186
|
-
const [query, setQuery] =
|
|
6203
|
+
const [query, setQuery] = useState16({
|
|
6187
6204
|
contentType: "",
|
|
6188
6205
|
keyword: "",
|
|
6189
6206
|
...defaultQuery
|
|
6190
6207
|
});
|
|
6191
6208
|
const { flatVariables } = useVariables(true);
|
|
6192
6209
|
const querySearchDeferred = useDeferredValue(query);
|
|
6193
|
-
const [selectedItems, setSelectedItems] =
|
|
6194
|
-
const [list, setList] =
|
|
6210
|
+
const [selectedItems, setSelectedItems] = useState16(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
6211
|
+
const [list, setList] = useState16({});
|
|
6195
6212
|
const onSetQuery = useCallback4(
|
|
6196
6213
|
(value2) => {
|
|
6197
6214
|
if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
|
|
@@ -6252,7 +6269,7 @@ var ObjectSearchProvider = ({
|
|
|
6252
6269
|
onSetList
|
|
6253
6270
|
]
|
|
6254
6271
|
);
|
|
6255
|
-
return /* @__PURE__ */
|
|
6272
|
+
return /* @__PURE__ */ jsx59(ObjectSearchContext.Provider, { value, children });
|
|
6256
6273
|
};
|
|
6257
6274
|
function useObjectSearchContext() {
|
|
6258
6275
|
return useContext7(ObjectSearchContext);
|
|
@@ -6347,7 +6364,7 @@ var ObjectListItemUnControlledContent = css31`
|
|
|
6347
6364
|
`;
|
|
6348
6365
|
|
|
6349
6366
|
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
6350
|
-
import { jsx as
|
|
6367
|
+
import { jsx as jsx60, jsxs as jsxs34 } from "@emotion/react/jsx-runtime";
|
|
6351
6368
|
var ObjectSearchListItem = ({
|
|
6352
6369
|
id,
|
|
6353
6370
|
title,
|
|
@@ -6387,30 +6404,30 @@ var ObjectSearchListItem = ({
|
|
|
6387
6404
|
css: ObjectListItemControlledContent,
|
|
6388
6405
|
"aria-disabled": disabled,
|
|
6389
6406
|
children: [
|
|
6390
|
-
!imageUrl ? null : /* @__PURE__ */
|
|
6391
|
-
!image || imageUrl ? null : /* @__PURE__ */
|
|
6407
|
+
!imageUrl ? null : /* @__PURE__ */ jsx60("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectListItemThumbnail }),
|
|
6408
|
+
!image || imageUrl ? null : /* @__PURE__ */ jsx60("img", { ...image, loading: (image == null ? void 0 : image.width) && image.height ? "lazy" : "eager" }),
|
|
6392
6409
|
/* @__PURE__ */ jsxs34("div", { role: "heading", css: ObjectListItemHeadingGroup, children: [
|
|
6393
|
-
!contentType ? null : /* @__PURE__ */
|
|
6394
|
-
/* @__PURE__ */
|
|
6410
|
+
!contentType ? null : /* @__PURE__ */ jsx60("span", { css: ObjectListItemSubtitle, children: formatedContentType }),
|
|
6411
|
+
/* @__PURE__ */ jsx60("span", { css: ObjectListItemTitle, "data-testid": "title", children: title })
|
|
6395
6412
|
] })
|
|
6396
6413
|
]
|
|
6397
6414
|
}
|
|
6398
6415
|
),
|
|
6399
6416
|
/* @__PURE__ */ jsxs34("div", { css: ObjectListItemInfoContainer, children: [
|
|
6400
|
-
selected ? /* @__PURE__ */
|
|
6401
|
-
!popoverData ? null : /* @__PURE__ */
|
|
6417
|
+
selected ? /* @__PURE__ */ jsx60(Chip, { text: "selected", size: "xs" }) : null,
|
|
6418
|
+
!popoverData ? null : /* @__PURE__ */ jsx60(Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, iconColor: "default", children: popoverData })
|
|
6402
6419
|
] }),
|
|
6403
|
-
!children ? null : /* @__PURE__ */
|
|
6420
|
+
!children ? null : /* @__PURE__ */ jsx60("div", { css: ObjectListItemUnControlledContent, children })
|
|
6404
6421
|
]
|
|
6405
6422
|
}
|
|
6406
6423
|
);
|
|
6407
6424
|
};
|
|
6408
6425
|
var ObjectSearchListItemLoadingSkeleton = () => {
|
|
6409
|
-
return /* @__PURE__ */
|
|
6426
|
+
return /* @__PURE__ */ jsx60("div", { role: "presentation", css: [ObjectListItemContainer, ObjectListItemLoading] });
|
|
6410
6427
|
};
|
|
6411
6428
|
|
|
6412
6429
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6413
|
-
import { jsx as
|
|
6430
|
+
import { jsx as jsx61, jsxs as jsxs35 } from "@emotion/react/jsx-runtime";
|
|
6414
6431
|
var ObjectSearchContainer = ({
|
|
6415
6432
|
label,
|
|
6416
6433
|
enableDynamicInputToResultId,
|
|
@@ -6422,7 +6439,7 @@ var ObjectSearchContainer = ({
|
|
|
6422
6439
|
const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
|
|
6423
6440
|
const { flatVariables } = useVariables(true);
|
|
6424
6441
|
const inputValue = (_b = (_a = selectedListItems == null ? void 0 : selectedListItems[0]) == null ? void 0 : _a.id) != null ? _b : "";
|
|
6425
|
-
const listItems = resultList != null ? resultList : /* @__PURE__ */
|
|
6442
|
+
const listItems = resultList != null ? resultList : /* @__PURE__ */ jsx61(
|
|
6426
6443
|
ScrollableList,
|
|
6427
6444
|
{
|
|
6428
6445
|
role: "list",
|
|
@@ -6432,7 +6449,7 @@ var ObjectSearchContainer = ({
|
|
|
6432
6449
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
6433
6450
|
}
|
|
6434
6451
|
`,
|
|
6435
|
-
children: /* @__PURE__ */
|
|
6452
|
+
children: /* @__PURE__ */ jsx61(DefaultResultList, {})
|
|
6436
6453
|
}
|
|
6437
6454
|
);
|
|
6438
6455
|
const body = /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
|
|
@@ -6466,8 +6483,8 @@ var ObjectSearchContainer = ({
|
|
|
6466
6483
|
}
|
|
6467
6484
|
]);
|
|
6468
6485
|
};
|
|
6469
|
-
return /* @__PURE__ */
|
|
6470
|
-
/* @__PURE__ */
|
|
6486
|
+
return /* @__PURE__ */ jsx61(IconsProvider, { children: /* @__PURE__ */ jsxs35(VerticalRhythm2, { children: [
|
|
6487
|
+
/* @__PURE__ */ jsx61(Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ jsx61(
|
|
6471
6488
|
InputVariables,
|
|
6472
6489
|
{
|
|
6473
6490
|
label,
|
|
@@ -6489,17 +6506,17 @@ var DefaultResultList = () => {
|
|
|
6489
6506
|
var _a;
|
|
6490
6507
|
const { list } = useObjectSearchContext();
|
|
6491
6508
|
if (!list.items) {
|
|
6492
|
-
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */
|
|
6509
|
+
return Array.from(Array(5).keys()).map((i) => /* @__PURE__ */ jsx61(ObjectSearchListItemLoadingSkeleton, {}, i));
|
|
6493
6510
|
}
|
|
6494
6511
|
if (list.items.length === 0) {
|
|
6495
|
-
return /* @__PURE__ */
|
|
6512
|
+
return /* @__PURE__ */ jsx61(Callout5, { type: "info", children: "No results were found" });
|
|
6496
6513
|
}
|
|
6497
|
-
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */
|
|
6514
|
+
return (_a = list.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ jsx61(ObjectSearchListItem, { ...item }, item.id));
|
|
6498
6515
|
};
|
|
6499
6516
|
|
|
6500
6517
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6501
6518
|
import { InputKeywordSearch as InputKeywordSearch2, InputSelect as InputSelect6 } from "@uniformdev/design-system";
|
|
6502
|
-
import { useMemo as useMemo15, useState as
|
|
6519
|
+
import { useMemo as useMemo15, useState as useState17 } from "react";
|
|
6503
6520
|
|
|
6504
6521
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
6505
6522
|
import { css as css33 } from "@emotion/react";
|
|
@@ -6522,7 +6539,7 @@ var ObjectSearchFilterGrid = (gridColumns) => css33`
|
|
|
6522
6539
|
`;
|
|
6523
6540
|
|
|
6524
6541
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6525
|
-
import { jsx as
|
|
6542
|
+
import { jsx as jsx62, jsxs as jsxs36 } from "@emotion/react/jsx-runtime";
|
|
6526
6543
|
var ObjectSearchFilter = ({
|
|
6527
6544
|
requireContentType,
|
|
6528
6545
|
typeSelectorAllTypesOptionText = "All content types",
|
|
@@ -6533,7 +6550,7 @@ var ObjectSearchFilter = ({
|
|
|
6533
6550
|
}) => {
|
|
6534
6551
|
var _a, _b;
|
|
6535
6552
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
6536
|
-
const [searchState, setSearchState] =
|
|
6553
|
+
const [searchState, setSearchState] = useState17({
|
|
6537
6554
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
6538
6555
|
keyword: (_b = query.keyword) != null ? _b : ""
|
|
6539
6556
|
});
|
|
@@ -6561,7 +6578,7 @@ var ObjectSearchFilter = ({
|
|
|
6561
6578
|
ObjectSearchFilterGrid(shouldRenderSelect ? "1fr 2fr" : "1fr")
|
|
6562
6579
|
],
|
|
6563
6580
|
children: [
|
|
6564
|
-
memoizedSelectOptions.length ? /* @__PURE__ */
|
|
6581
|
+
memoizedSelectOptions.length ? /* @__PURE__ */ jsx62(
|
|
6565
6582
|
InputSelect6,
|
|
6566
6583
|
{
|
|
6567
6584
|
label: selectLabel,
|
|
@@ -6571,7 +6588,7 @@ var ObjectSearchFilter = ({
|
|
|
6571
6588
|
value: query.contentType
|
|
6572
6589
|
}
|
|
6573
6590
|
) : null,
|
|
6574
|
-
/* @__PURE__ */
|
|
6591
|
+
/* @__PURE__ */ jsx62(
|
|
6575
6592
|
InputKeywordSearch2,
|
|
6576
6593
|
{
|
|
6577
6594
|
inputFieldName: searchInputName,
|
|
@@ -6588,11 +6605,11 @@ var ObjectSearchFilter = ({
|
|
|
6588
6605
|
};
|
|
6589
6606
|
|
|
6590
6607
|
// src/components/ObjectSearch/ObjectSearchFilterContainer.tsx
|
|
6591
|
-
import { jsx as
|
|
6608
|
+
import { jsx as jsx63, jsxs as jsxs37 } from "@emotion/react/jsx-runtime";
|
|
6592
6609
|
var ObjectSearchFilterContainer2 = ({ label, children }) => {
|
|
6593
6610
|
return /* @__PURE__ */ jsxs37("div", { children: [
|
|
6594
|
-
label ? /* @__PURE__ */
|
|
6595
|
-
/* @__PURE__ */
|
|
6611
|
+
label ? /* @__PURE__ */ jsx63("span", { css: ObjectSearchFilterContainerLabel, children: label }) : null,
|
|
6612
|
+
/* @__PURE__ */ jsx63("div", { css: ObjectSearchFilterContainer, children })
|
|
6596
6613
|
] });
|
|
6597
6614
|
};
|
|
6598
6615
|
|
|
@@ -6636,14 +6653,14 @@ var ButtonIcon = css34`
|
|
|
6636
6653
|
`;
|
|
6637
6654
|
|
|
6638
6655
|
// src/components/ObjectSearch/ObjectSearchResultItemButton.tsx
|
|
6639
|
-
import { jsx as
|
|
6656
|
+
import { jsx as jsx64, jsxs as jsxs38 } from "@emotion/react/jsx-runtime";
|
|
6640
6657
|
var ObjectSearchResultItemButton = ({
|
|
6641
6658
|
text,
|
|
6642
6659
|
icon,
|
|
6643
6660
|
...props
|
|
6644
6661
|
}) => {
|
|
6645
6662
|
return /* @__PURE__ */ jsxs38("button", { type: "button", css: ButtonStyles, ...props, children: [
|
|
6646
|
-
!icon ? null : /* @__PURE__ */
|
|
6663
|
+
!icon ? null : /* @__PURE__ */ jsx64(Image, { src: icon, css: ButtonIcon }),
|
|
6647
6664
|
text
|
|
6648
6665
|
] });
|
|
6649
6666
|
};
|
|
@@ -6653,7 +6670,7 @@ var LinkButton = ({
|
|
|
6653
6670
|
...props
|
|
6654
6671
|
}) => {
|
|
6655
6672
|
return /* @__PURE__ */ jsxs38("a", { ...props, css: ButtonStyles, target: "_blank", rel: "noopener noreferrer", children: [
|
|
6656
|
-
!icon ? null : /* @__PURE__ */
|
|
6673
|
+
!icon ? null : /* @__PURE__ */ jsx64(Image, { src: icon, css: ButtonIcon }),
|
|
6657
6674
|
text
|
|
6658
6675
|
] });
|
|
6659
6676
|
};
|
|
@@ -6719,7 +6736,7 @@ var ObjectSearchImage = css35`
|
|
|
6719
6736
|
`;
|
|
6720
6737
|
|
|
6721
6738
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
6722
|
-
import { jsx as
|
|
6739
|
+
import { jsx as jsx65, jsxs as jsxs39 } from "@emotion/react/jsx-runtime";
|
|
6723
6740
|
var ObjectSearchResultItem = ({
|
|
6724
6741
|
id,
|
|
6725
6742
|
title,
|
|
@@ -6744,41 +6761,41 @@ var ObjectSearchResultItem = ({
|
|
|
6744
6761
|
onRemove == null ? void 0 : onRemove();
|
|
6745
6762
|
};
|
|
6746
6763
|
return /* @__PURE__ */ jsxs39("div", { css: ObjectSearchResultItemContainer, "data-testid": "search-result-item", children: [
|
|
6747
|
-
disableDnD ? null : /* @__PURE__ */
|
|
6748
|
-
/* @__PURE__ */
|
|
6749
|
-
!imageUrl ? null : /* @__PURE__ */
|
|
6764
|
+
disableDnD ? null : /* @__PURE__ */ jsx65("div", { role: "presentation", className: "drag-handle", css: ObjectSearchDragHandle }),
|
|
6765
|
+
/* @__PURE__ */ jsx65("div", { children: /* @__PURE__ */ jsxs39("div", { css: ObjectSearchContentContainer, children: [
|
|
6766
|
+
!imageUrl ? null : /* @__PURE__ */ jsx65("img", { src: imageUrl, alt: `Thumbnail for ${title}`, css: ObjectSearchImage }),
|
|
6750
6767
|
/* @__PURE__ */ jsxs39("div", { children: [
|
|
6751
|
-
/* @__PURE__ */
|
|
6768
|
+
/* @__PURE__ */ jsx65("span", { css: ObjectSearchResultItemSubtitle, "data-testid": "sub-title", children: formatedContentType }),
|
|
6752
6769
|
/* @__PURE__ */ jsxs39("span", { role: "heading", css: ObjectSearchResultItemTitle, "data-testid": "title", children: [
|
|
6753
6770
|
title != null ? title : name,
|
|
6754
|
-
!popoverData ? null : /* @__PURE__ */
|
|
6771
|
+
!popoverData ? null : /* @__PURE__ */ jsx65(Popover2, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
6755
6772
|
] }),
|
|
6756
6773
|
!createdAt && !publishStatus ? null : /* @__PURE__ */ jsxs39("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
6757
|
-
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */
|
|
6774
|
+
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ jsx65(Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
|
|
6758
6775
|
!createdAt && !publishedAt ? null : /* @__PURE__ */ jsxs39("div", { css: ObjectSearchUpdateGroup, children: [
|
|
6759
6776
|
!createdAt ? null : /* @__PURE__ */ jsxs39("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
6760
|
-
/* @__PURE__ */
|
|
6777
|
+
/* @__PURE__ */ jsx65("strong", { children: "Last updated: " }),
|
|
6761
6778
|
timeagoFormat(createdAt)
|
|
6762
6779
|
] }),
|
|
6763
6780
|
!publishedAt ? null : /* @__PURE__ */ jsxs39("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
6764
|
-
/* @__PURE__ */
|
|
6781
|
+
/* @__PURE__ */ jsx65("strong", { children: "Last published: " }),
|
|
6765
6782
|
timeagoFormat(publishedAt)
|
|
6766
6783
|
] })
|
|
6767
6784
|
] })
|
|
6768
6785
|
] }),
|
|
6769
|
-
/* @__PURE__ */
|
|
6786
|
+
/* @__PURE__ */ jsx65("div", { children })
|
|
6770
6787
|
] })
|
|
6771
6788
|
] }) }),
|
|
6772
6789
|
!editLink && hideRemoveButton ? null : /* @__PURE__ */ jsxs39("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
6773
|
-
!editLink ? null : /* @__PURE__ */
|
|
6774
|
-
hideRemoveButton ? null : /* @__PURE__ */
|
|
6790
|
+
!editLink ? null : /* @__PURE__ */ jsx65(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
|
|
6791
|
+
hideRemoveButton ? null : /* @__PURE__ */ jsx65(Button4, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
|
|
6775
6792
|
] })
|
|
6776
6793
|
] });
|
|
6777
6794
|
};
|
|
6778
6795
|
|
|
6779
6796
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
6780
6797
|
import { Button as Button5, Counter } from "@uniformdev/design-system";
|
|
6781
|
-
import {
|
|
6798
|
+
import { Draggable as Draggable3, Droppable as Droppable3 } from "react-beautiful-dnd";
|
|
6782
6799
|
|
|
6783
6800
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
6784
6801
|
import { css as css36 } from "@emotion/react";
|
|
@@ -6806,16 +6823,17 @@ var ObjectSearchResultListTitle = css36`
|
|
|
6806
6823
|
`;
|
|
6807
6824
|
|
|
6808
6825
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
6809
|
-
import { Fragment as Fragment13, jsx as
|
|
6826
|
+
import { Fragment as Fragment13, jsx as jsx66, jsxs as jsxs40 } from "@emotion/react/jsx-runtime";
|
|
6810
6827
|
function ObjectSearchResultList({
|
|
6811
6828
|
resultLabelText = "Selected",
|
|
6812
6829
|
removeButtonText = "Remove all",
|
|
6813
6830
|
onRemoveAllSelected,
|
|
6814
6831
|
hideRemoveButton = false,
|
|
6815
6832
|
additionalButtons,
|
|
6816
|
-
renderResultComponent = (value) => /* @__PURE__ */
|
|
6833
|
+
renderResultComponent = (value) => /* @__PURE__ */ jsx66(ObjectSearchResultItem, { ...value }),
|
|
6817
6834
|
multiSelectId,
|
|
6818
6835
|
disableDnD = false,
|
|
6836
|
+
getContainerForDnDReparenting,
|
|
6819
6837
|
whenNothingSelected = null
|
|
6820
6838
|
}) {
|
|
6821
6839
|
const { selectedListItems, onRemoveAllSelectedItems, onSelectItem } = useObjectSearchContext();
|
|
@@ -6833,16 +6851,37 @@ function ObjectSearchResultList({
|
|
|
6833
6851
|
return result;
|
|
6834
6852
|
}
|
|
6835
6853
|
};
|
|
6854
|
+
const getDraggableItem = (provided, snapshot, rubric) => {
|
|
6855
|
+
const item = selectedListItems.find((i) => i.id === rubric.draggableId);
|
|
6856
|
+
const renderListItem = renderResultComponent({
|
|
6857
|
+
...item,
|
|
6858
|
+
disableDnD: selectedListItems.length === 1 || disableDnD
|
|
6859
|
+
});
|
|
6860
|
+
return /* @__PURE__ */ jsx66(
|
|
6861
|
+
"div",
|
|
6862
|
+
{
|
|
6863
|
+
css: [
|
|
6864
|
+
ObjectSearchDragContainer,
|
|
6865
|
+
snapshot.isDragging ? ObjectSearchContainerDragging : void 0
|
|
6866
|
+
],
|
|
6867
|
+
ref: provided.innerRef,
|
|
6868
|
+
"data-dragging": snapshot.isDragging,
|
|
6869
|
+
...provided.draggableProps,
|
|
6870
|
+
...provided.dragHandleProps,
|
|
6871
|
+
children: renderListItem
|
|
6872
|
+
}
|
|
6873
|
+
);
|
|
6874
|
+
};
|
|
6836
6875
|
return /* @__PURE__ */ jsxs40(Fragment13, { children: [
|
|
6837
6876
|
/* @__PURE__ */ jsxs40("div", { role: "group", css: ObjectSearchResultListContainer, children: [
|
|
6838
6877
|
/* @__PURE__ */ jsxs40("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
|
|
6839
|
-
/* @__PURE__ */
|
|
6878
|
+
/* @__PURE__ */ jsx66("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
|
|
6840
6879
|
" ",
|
|
6841
|
-
!selectedListItems.length ? null : /* @__PURE__ */
|
|
6880
|
+
!selectedListItems.length ? null : /* @__PURE__ */ jsx66(Counter, { count: selectedListItems.length })
|
|
6842
6881
|
] }),
|
|
6843
6882
|
/* @__PURE__ */ jsxs40("div", { css: ObjectSearchResultListCounterContainer, children: [
|
|
6844
6883
|
additionalButtons,
|
|
6845
|
-
hideRemoveButton ? null : /* @__PURE__ */
|
|
6884
|
+
hideRemoveButton ? null : /* @__PURE__ */ jsx66(
|
|
6846
6885
|
Button5,
|
|
6847
6886
|
{
|
|
6848
6887
|
buttonType: "ghostDestructive",
|
|
@@ -6854,43 +6893,36 @@ function ObjectSearchResultList({
|
|
|
6854
6893
|
)
|
|
6855
6894
|
] })
|
|
6856
6895
|
] }),
|
|
6857
|
-
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
children: (provided2, snapshot) => /* @__PURE__ */ jsx65(
|
|
6868
|
-
"div",
|
|
6896
|
+
!selectedListItems.length ? whenNothingSelected : /* @__PURE__ */ jsx66(DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ jsx66(
|
|
6897
|
+
Droppable3,
|
|
6898
|
+
{
|
|
6899
|
+
droppableId: multiSelectId != null ? multiSelectId : "canvas-multi-select",
|
|
6900
|
+
renderClone: getContainerForDnDReparenting ? getDraggableItem : void 0,
|
|
6901
|
+
getContainerForClone: getContainerForDnDReparenting,
|
|
6902
|
+
children: (provided) => /* @__PURE__ */ jsxs40("div", { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
6903
|
+
selectedListItems.map((item, i) => {
|
|
6904
|
+
return /* @__PURE__ */ jsx66(
|
|
6905
|
+
Draggable3,
|
|
6869
6906
|
{
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
item.id
|
|
6883
|
-
);
|
|
6884
|
-
}),
|
|
6885
|
-
provided.placeholder
|
|
6886
|
-
] }) }) })
|
|
6907
|
+
draggableId: item.id,
|
|
6908
|
+
index: i,
|
|
6909
|
+
isDragDisabled: selectedListItems.length === 1 || disableDnD,
|
|
6910
|
+
children: getDraggableItem
|
|
6911
|
+
},
|
|
6912
|
+
item.id
|
|
6913
|
+
);
|
|
6914
|
+
}),
|
|
6915
|
+
provided.placeholder
|
|
6916
|
+
] })
|
|
6917
|
+
}
|
|
6918
|
+
) })
|
|
6887
6919
|
] });
|
|
6888
6920
|
}
|
|
6889
6921
|
|
|
6890
6922
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
6891
6923
|
import { Input as Input5, InputKeywordSearch as InputKeywordSearch3, InputSelect as InputSelect7, VerticalRhythm as VerticalRhythm3 } from "@uniformdev/design-system";
|
|
6892
|
-
import { useEffect as useEffect16, useState as
|
|
6893
|
-
import { jsx as
|
|
6924
|
+
import { useEffect as useEffect16, useState as useState18 } from "react";
|
|
6925
|
+
import { jsx as jsx67, jsxs as jsxs41 } from "@emotion/react/jsx-runtime";
|
|
6894
6926
|
var QueryFilter = ({
|
|
6895
6927
|
requireContentType,
|
|
6896
6928
|
queryFilterTitle = "Configure Query",
|
|
@@ -6921,7 +6953,7 @@ var QueryFilter = ({
|
|
|
6921
6953
|
}) => {
|
|
6922
6954
|
var _a, _b, _c, _d, _e, _f;
|
|
6923
6955
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
6924
|
-
const [queryState, setQueryState] =
|
|
6956
|
+
const [queryState, setQueryState] = useState18({
|
|
6925
6957
|
contentType: (_a = query.contentType) != null ? _a : "",
|
|
6926
6958
|
keyword: (_b = query.contentType) != null ? _b : "",
|
|
6927
6959
|
count: countValue != null ? countValue : 5,
|
|
@@ -6936,9 +6968,9 @@ var QueryFilter = ({
|
|
|
6936
6968
|
onSetQuery(queryState);
|
|
6937
6969
|
}, [onSetQuery, queryState]);
|
|
6938
6970
|
return /* @__PURE__ */ jsxs41("fieldset", { children: [
|
|
6939
|
-
/* @__PURE__ */
|
|
6940
|
-
/* @__PURE__ */
|
|
6941
|
-
/* @__PURE__ */
|
|
6971
|
+
/* @__PURE__ */ jsx67("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
|
|
6972
|
+
/* @__PURE__ */ jsx67("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ jsxs41(VerticalRhythm3, { children: [
|
|
6973
|
+
/* @__PURE__ */ jsx67(
|
|
6942
6974
|
InputVariables,
|
|
6943
6975
|
{
|
|
6944
6976
|
label: searchInputLabel,
|
|
@@ -6946,7 +6978,7 @@ var QueryFilter = ({
|
|
|
6946
6978
|
onChange: (newQuery) => handleFilterChange({ keyword: newQuery }),
|
|
6947
6979
|
disableInlineMenu: true,
|
|
6948
6980
|
id: "qf_searchText",
|
|
6949
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
6981
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx67(
|
|
6950
6982
|
InputKeywordSearch3,
|
|
6951
6983
|
{
|
|
6952
6984
|
id: "qf_searchText",
|
|
@@ -6961,7 +6993,7 @@ var QueryFilter = ({
|
|
|
6961
6993
|
}
|
|
6962
6994
|
),
|
|
6963
6995
|
/* @__PURE__ */ jsxs41("div", { css: ObjectSearchFilterGrid("1fr 100px"), children: [
|
|
6964
|
-
/* @__PURE__ */
|
|
6996
|
+
/* @__PURE__ */ jsx67(
|
|
6965
6997
|
InputVariables,
|
|
6966
6998
|
{
|
|
6967
6999
|
label: contentTypeLabel,
|
|
@@ -6969,7 +7001,7 @@ var QueryFilter = ({
|
|
|
6969
7001
|
value: (_f = queryState.contentType) != null ? _f : "",
|
|
6970
7002
|
onChange: (newType) => handleFilterChange({ contentType: newType }),
|
|
6971
7003
|
disableInlineMenu: true,
|
|
6972
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
7004
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx67(
|
|
6973
7005
|
InputSelect7,
|
|
6974
7006
|
{
|
|
6975
7007
|
id: "qf_contentType",
|
|
@@ -6988,7 +7020,7 @@ var QueryFilter = ({
|
|
|
6988
7020
|
)
|
|
6989
7021
|
}
|
|
6990
7022
|
),
|
|
6991
|
-
/* @__PURE__ */
|
|
7023
|
+
/* @__PURE__ */ jsx67(
|
|
6992
7024
|
InputVariables,
|
|
6993
7025
|
{
|
|
6994
7026
|
label: countLabel,
|
|
@@ -6996,7 +7028,7 @@ var QueryFilter = ({
|
|
|
6996
7028
|
value: queryState.count.toString(10),
|
|
6997
7029
|
onChange: (newCount) => handleFilterChange({ count: newCount }),
|
|
6998
7030
|
disableInlineMenu: true,
|
|
6999
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
7031
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx67(
|
|
7000
7032
|
Input5,
|
|
7001
7033
|
{
|
|
7002
7034
|
id: "qf_count",
|
|
@@ -7012,7 +7044,7 @@ var QueryFilter = ({
|
|
|
7012
7044
|
)
|
|
7013
7045
|
] }),
|
|
7014
7046
|
/* @__PURE__ */ jsxs41("div", { css: ObjectSearchFilterGrid("2fr 1fr"), children: [
|
|
7015
|
-
/* @__PURE__ */
|
|
7047
|
+
/* @__PURE__ */ jsx67(
|
|
7016
7048
|
InputVariables,
|
|
7017
7049
|
{
|
|
7018
7050
|
id: "qf_sortBy",
|
|
@@ -7020,7 +7052,7 @@ var QueryFilter = ({
|
|
|
7020
7052
|
value: queryState.sortBy,
|
|
7021
7053
|
onChange: (newSortBy) => handleFilterChange({ sortBy: newSortBy }),
|
|
7022
7054
|
disableInlineMenu: true,
|
|
7023
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
7055
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx67(
|
|
7024
7056
|
InputSelect7,
|
|
7025
7057
|
{
|
|
7026
7058
|
label: sortLabel,
|
|
@@ -7042,7 +7074,7 @@ var QueryFilter = ({
|
|
|
7042
7074
|
)
|
|
7043
7075
|
}
|
|
7044
7076
|
),
|
|
7045
|
-
/* @__PURE__ */
|
|
7077
|
+
/* @__PURE__ */ jsx67(
|
|
7046
7078
|
InputVariables,
|
|
7047
7079
|
{
|
|
7048
7080
|
label: sortOrderLabel,
|
|
@@ -7050,7 +7082,7 @@ var QueryFilter = ({
|
|
|
7050
7082
|
value: queryState.sortOrder,
|
|
7051
7083
|
onChange: (newSort) => handleFilterChange({ sortOrder: newSort }),
|
|
7052
7084
|
disableInlineMenu: true,
|
|
7053
|
-
inputWhenNoVariables: /* @__PURE__ */
|
|
7085
|
+
inputWhenNoVariables: /* @__PURE__ */ jsx67(
|
|
7054
7086
|
InputSelect7,
|
|
7055
7087
|
{
|
|
7056
7088
|
label: sortOrderLabel,
|
|
@@ -7076,7 +7108,7 @@ var QueryFilter = ({
|
|
|
7076
7108
|
|
|
7077
7109
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
7078
7110
|
import { useEffect as useEffect17, useMemo as useMemo16, useRef as useRef15 } from "react";
|
|
7079
|
-
import { jsx as
|
|
7111
|
+
import { jsx as jsx68 } from "@emotion/react/jsx-runtime";
|
|
7080
7112
|
function ParamTypeDynamicDataProvider(props) {
|
|
7081
7113
|
const { children } = props;
|
|
7082
7114
|
const {
|
|
@@ -7088,7 +7120,7 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
7088
7120
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
7089
7121
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
7090
7122
|
);
|
|
7091
|
-
return /* @__PURE__ */
|
|
7123
|
+
return /* @__PURE__ */ jsx68(VariablesProvider, { value: variables, onChange: () => {
|
|
7092
7124
|
}, editVariableComponent: JsonMeshVariableEditor, children });
|
|
7093
7125
|
}
|
|
7094
7126
|
var JsonMeshVariableEditor = ({
|