@uniformdev/mesh-sdk-react 18.13.1-alpha.1 → 18.15.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.ts +4 -2
- package/dist/index.esm.js +312 -253
- package/dist/index.js +336 -277
- package/dist/index.mjs +312 -253
- package/package.json +4 -5
package/dist/index.js
CHANGED
|
@@ -27,9 +27,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
27
27
|
// src/index.ts
|
|
28
28
|
var src_exports = {};
|
|
29
29
|
__export(src_exports, {
|
|
30
|
-
AddListButton: () =>
|
|
31
|
-
Button: () =>
|
|
32
|
-
Callout: () =>
|
|
30
|
+
AddListButton: () => import_design_system24.AddListButton,
|
|
31
|
+
Button: () => import_design_system24.Button,
|
|
32
|
+
Callout: () => import_design_system24.Callout,
|
|
33
33
|
DamSelectedItem: () => DamSelectedItem,
|
|
34
34
|
DataResourceVariablesList: () => DataResourceVariablesList,
|
|
35
35
|
DataSourceEditor: () => DataSourceEditor,
|
|
@@ -37,20 +37,20 @@ __export(src_exports, {
|
|
|
37
37
|
DefaultSearchRow: () => DefaultSearchRow,
|
|
38
38
|
DefaultSelectedItem: () => DefaultSelectedItem,
|
|
39
39
|
EntrySearch: () => EntrySearch,
|
|
40
|
-
Heading: () =>
|
|
40
|
+
Heading: () => import_design_system24.Heading,
|
|
41
41
|
Icons: () => icons_exports,
|
|
42
|
-
Input: () =>
|
|
43
|
-
InputComboBox: () =>
|
|
44
|
-
InputKeywordSearch: () =>
|
|
45
|
-
InputSelect: () =>
|
|
46
|
-
InputToggle: () =>
|
|
42
|
+
Input: () => import_design_system24.Input,
|
|
43
|
+
InputComboBox: () => import_design_system24.InputComboBox,
|
|
44
|
+
InputKeywordSearch: () => import_design_system24.InputKeywordSearch,
|
|
45
|
+
InputSelect: () => import_design_system24.InputSelect,
|
|
46
|
+
InputToggle: () => import_design_system24.InputToggle,
|
|
47
47
|
InputVariables: () => InputVariables,
|
|
48
|
-
KeywordSearchInput: () =>
|
|
49
|
-
Label: () =>
|
|
50
|
-
LoadingIndicator: () =>
|
|
51
|
-
LoadingOverlay: () =>
|
|
52
|
-
Menu: () =>
|
|
53
|
-
MenuItem: () =>
|
|
48
|
+
KeywordSearchInput: () => import_design_system24.InputKeywordSearch,
|
|
49
|
+
Label: () => import_design_system24.Label,
|
|
50
|
+
LoadingIndicator: () => import_design_system24.LoadingIndicator,
|
|
51
|
+
LoadingOverlay: () => import_design_system24.LoadingOverlay,
|
|
52
|
+
Menu: () => import_design_system24.Menu,
|
|
53
|
+
MenuItem: () => import_design_system24.MenuItem,
|
|
54
54
|
MeshApp: () => MeshApp,
|
|
55
55
|
ProductPreviewList: () => ProductPreviewList,
|
|
56
56
|
ProductQuery: () => ProductQuery,
|
|
@@ -68,13 +68,13 @@ __export(src_exports, {
|
|
|
68
68
|
RequestUrl: () => RequestUrl,
|
|
69
69
|
RequestUrlInput: () => RequestUrlInput,
|
|
70
70
|
ResolvableLoadingValue: () => ResolvableLoadingValue,
|
|
71
|
-
ScrollableList: () =>
|
|
72
|
-
ScrollableListItem: () =>
|
|
71
|
+
ScrollableList: () => import_design_system24.ScrollableList,
|
|
72
|
+
ScrollableListItem: () => import_design_system24.ScrollableListItem,
|
|
73
73
|
SelectionField: () => SelectionField,
|
|
74
|
-
Switch: () =>
|
|
74
|
+
Switch: () => import_design_system24.Switch,
|
|
75
75
|
TextVariableRenderer: () => TextVariableRenderer,
|
|
76
|
-
Textarea: () =>
|
|
77
|
-
Theme: () =>
|
|
76
|
+
Textarea: () => import_design_system24.Textarea,
|
|
77
|
+
Theme: () => import_design_system24.Theme,
|
|
78
78
|
UniformMeshLocationContext: () => UniformMeshLocationContext,
|
|
79
79
|
UniformMeshLocationContextProvider: () => UniformMeshLocationContextProvider,
|
|
80
80
|
UniformMeshSdkContext: () => UniformMeshSdkContext,
|
|
@@ -2784,7 +2784,7 @@ function DefaultDamItemRenderer({ item }) {
|
|
|
2784
2784
|
}
|
|
2785
2785
|
|
|
2786
2786
|
// src/components/DataResourceVariablesList.tsx
|
|
2787
|
-
var
|
|
2787
|
+
var import_design_system18 = require("@uniformdev/design-system");
|
|
2788
2788
|
|
|
2789
2789
|
// src/hooks/useMeshLocation.ts
|
|
2790
2790
|
var import_react27 = require("react");
|
|
@@ -2886,22 +2886,55 @@ function useMeshLocation(expectedLocation) {
|
|
|
2886
2886
|
}
|
|
2887
2887
|
|
|
2888
2888
|
// src/components/Variables/InputVariables.tsx
|
|
2889
|
-
var
|
|
2890
|
-
var import_react30 = __toESM(require("@yaireo/tagify/dist/react.tagify"));
|
|
2889
|
+
var import_design_system16 = require("@uniformdev/design-system");
|
|
2891
2890
|
var React11 = __toESM(require("react"));
|
|
2892
2891
|
|
|
2893
|
-
// src/components/Variables/
|
|
2892
|
+
// src/components/Variables/InsertVariableMenu.tsx
|
|
2893
|
+
var import_design_system15 = require("@uniformdev/design-system");
|
|
2894
|
+
var import_react30 = require("react");
|
|
2895
|
+
|
|
2896
|
+
// src/components/Variables/styles/InsertVariableMenu.styles.ts
|
|
2894
2897
|
var import_react28 = require("@emotion/react");
|
|
2895
|
-
var
|
|
2898
|
+
var menuContainer = import_react28.css`
|
|
2899
|
+
position: relative;
|
|
2900
|
+
`;
|
|
2901
|
+
var menuBtn = import_react28.css`
|
|
2902
|
+
background: none;
|
|
2903
|
+
border: none;
|
|
2904
|
+
color: var(--gray-300);
|
|
2905
|
+
padding: 0;
|
|
2906
|
+
position: absolute;
|
|
2907
|
+
bottom: 25%;
|
|
2908
|
+
right: var(--spacing-sm);
|
|
2909
|
+
`;
|
|
2910
|
+
var menuItemTextGroup = import_react28.css`
|
|
2911
|
+
align-items: flex-start;
|
|
2912
|
+
display: flex;
|
|
2913
|
+
flex-direction: column;
|
|
2914
|
+
`;
|
|
2915
|
+
var smallText = import_react28.css`
|
|
2916
|
+
font-size: var(--fs-xs);
|
|
2917
|
+
`;
|
|
2918
|
+
|
|
2919
|
+
// src/components/Variables/VariablesProvider.tsx
|
|
2920
|
+
var React10 = __toESM(require("react"));
|
|
2921
|
+
|
|
2922
|
+
// src/components/Variables/VariableEditor.tsx
|
|
2923
|
+
var import_design_system14 = require("@uniformdev/design-system");
|
|
2924
|
+
var import_formik = require("formik");
|
|
2925
|
+
|
|
2926
|
+
// src/components/Variables/InputVariables.styles.ts
|
|
2927
|
+
var import_react29 = require("@emotion/react");
|
|
2928
|
+
var variablesFormContainer = import_react29.css`
|
|
2896
2929
|
> * {
|
|
2897
2930
|
margin: var(--spacing-base) 0 0;
|
|
2898
2931
|
}
|
|
2899
2932
|
`;
|
|
2900
|
-
var variablesFormBtnGroup =
|
|
2933
|
+
var variablesFormBtnGroup = import_react29.css`
|
|
2901
2934
|
display: flex;
|
|
2902
2935
|
gap: var(--spacing-sm);
|
|
2903
2936
|
`;
|
|
2904
|
-
var tagifyStyles =
|
|
2937
|
+
var tagifyStyles = import_react29.css`
|
|
2905
2938
|
:root {
|
|
2906
2939
|
--tagify-dd-color-primary: rgb(53, 149, 246);
|
|
2907
2940
|
--tagify-dd-bg-color: var(--white);
|
|
@@ -3400,12 +3433,7 @@ var tagifyStyles = import_react28.css`
|
|
|
3400
3433
|
}
|
|
3401
3434
|
`;
|
|
3402
3435
|
|
|
3403
|
-
// src/components/Variables/VariablesProvider.tsx
|
|
3404
|
-
var React10 = __toESM(require("react"));
|
|
3405
|
-
|
|
3406
3436
|
// src/components/Variables/VariableEditor.tsx
|
|
3407
|
-
var import_design_system14 = require("@uniformdev/design-system");
|
|
3408
|
-
var import_formik = require("formik");
|
|
3409
3437
|
var import_jsx_runtime28 = require("@emotion/react/jsx-runtime");
|
|
3410
3438
|
function VariableEditor({ variable, onSubmit, onCancel }) {
|
|
3411
3439
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
@@ -3518,23 +3546,74 @@ function useVariables() {
|
|
|
3518
3546
|
return context;
|
|
3519
3547
|
}
|
|
3520
3548
|
|
|
3521
|
-
// src/components/Variables/
|
|
3549
|
+
// src/components/Variables/InsertVariableMenu.tsx
|
|
3522
3550
|
var import_jsx_runtime30 = require("@emotion/react/jsx-runtime");
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3551
|
+
var InsertVariableMenu = ({
|
|
3552
|
+
onVariableClick,
|
|
3553
|
+
children,
|
|
3554
|
+
textValue,
|
|
3555
|
+
trigger = "${",
|
|
3556
|
+
showAddVariableMenuOption = false
|
|
3557
|
+
}) => {
|
|
3558
|
+
const { variables, dispatch } = useVariables();
|
|
3559
|
+
const btnRef = (0, import_react30.useRef)(null);
|
|
3560
|
+
const hasVariables = Object.entries(variables).length;
|
|
3561
|
+
(0, import_react30.useEffect)(() => {
|
|
3562
|
+
if (textValue === trigger && btnRef.current && btnRef.current.getAttribute("aria-expanded") === "false") {
|
|
3563
|
+
btnRef.current.click();
|
|
3564
|
+
}
|
|
3565
|
+
}, [textValue, btnRef, trigger]);
|
|
3566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { css: menuContainer, children: [
|
|
3567
|
+
children,
|
|
3568
|
+
hasVariables ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3569
|
+
import_design_system15.Menu,
|
|
3570
|
+
{
|
|
3571
|
+
placement: "bottom-start",
|
|
3572
|
+
menuTrigger: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { ref: btnRef, css: menuBtn, type: "button", title: "Insert variable", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.Icon, { icon: "usb-c", iconColor: "currentColor" }) }),
|
|
3573
|
+
menuLabel: "Insert variable",
|
|
3574
|
+
children: [
|
|
3575
|
+
Object.entries(variables).map(([key, value]) => {
|
|
3576
|
+
const { helpText } = value;
|
|
3577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3578
|
+
import_design_system15.MenuItem,
|
|
3579
|
+
{
|
|
3580
|
+
id: key,
|
|
3581
|
+
css: menuItemTextGroup,
|
|
3582
|
+
onClick: () => onVariableClick(decodeURI(`\${${key}}`)),
|
|
3583
|
+
children: [
|
|
3584
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: key }),
|
|
3585
|
+
helpText ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("small", { css: smallText, children: helpText }) : null
|
|
3586
|
+
]
|
|
3587
|
+
},
|
|
3588
|
+
key
|
|
3589
|
+
);
|
|
3590
|
+
}),
|
|
3591
|
+
showAddVariableMenuOption ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
3592
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItemSeparator, {}),
|
|
3593
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_design_system15.MenuItem, { onClick: () => dispatch({ type: "edit", variable: "" }), children: "Add Variable" })
|
|
3594
|
+
] }) : null
|
|
3595
|
+
]
|
|
3596
|
+
}
|
|
3597
|
+
) : null
|
|
3598
|
+
] });
|
|
3599
|
+
};
|
|
3600
|
+
|
|
3601
|
+
// src/components/Variables/InputVariables.tsx
|
|
3602
|
+
var import_jsx_runtime31 = require("@emotion/react/jsx-runtime");
|
|
3526
3603
|
function InputVariables({
|
|
3527
3604
|
"aria-label": ariaLabel,
|
|
3528
3605
|
value,
|
|
3529
|
-
disableVariables,
|
|
3530
3606
|
onChange,
|
|
3531
|
-
onPaste
|
|
3607
|
+
onPaste,
|
|
3608
|
+
onVariableClick,
|
|
3609
|
+
showAddVariableMenuOption,
|
|
3610
|
+
...inputProps
|
|
3532
3611
|
}) {
|
|
3533
3612
|
const { variables, dispatch } = useVariables();
|
|
3534
3613
|
const currentVariables = React11.useRef(variables);
|
|
3535
3614
|
const currentDispatch = React11.useRef(dispatch);
|
|
3536
3615
|
const currentSetValue = React11.useRef(onChange);
|
|
3537
|
-
const
|
|
3616
|
+
const inputRef = React11.useRef(null);
|
|
3538
3617
|
React11.useEffect(() => {
|
|
3539
3618
|
currentVariables.current = variables;
|
|
3540
3619
|
}, [variables]);
|
|
@@ -3545,86 +3624,38 @@ function InputVariables({
|
|
|
3545
3624
|
currentSetValue.current = onChange;
|
|
3546
3625
|
}, [onChange]);
|
|
3547
3626
|
React11.useEffect(() => {
|
|
3548
|
-
var _a;
|
|
3549
|
-
if (((_a =
|
|
3550
|
-
|
|
3551
|
-
var _a2, _b;
|
|
3552
|
-
return onPaste(cleanTagifyValue((_b = (_a2 = tagifyRef.current) == null ? void 0 : _a2.getInputValue()) != null ? _b : ""));
|
|
3553
|
-
};
|
|
3627
|
+
var _a, _b;
|
|
3628
|
+
if (((_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.value) && onPaste) {
|
|
3629
|
+
onPaste((_b = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _b.value);
|
|
3554
3630
|
}
|
|
3555
3631
|
});
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
}, []);
|
|
3575
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
3576
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react29.Global, { styles: tagifyStyles }),
|
|
3577
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3578
|
-
import_react30.default,
|
|
3579
|
-
{
|
|
3580
|
-
tagifyRef,
|
|
3581
|
-
"aria-label": ariaLabel,
|
|
3582
|
-
defaultValue: value,
|
|
3583
|
-
autoFocus: false,
|
|
3584
|
-
whitelist: Object.entries(variables).map(([k, v]) => {
|
|
3585
|
-
var _a;
|
|
3586
|
-
return { name: (_a = v.displayName) != null ? _a : k, value: k };
|
|
3587
|
-
}),
|
|
3588
|
-
settings: {
|
|
3589
|
-
pattern: disableVariables ? null : /\$/,
|
|
3590
|
-
enforceWhitelist: disableVariables,
|
|
3591
|
-
mixTagsInterpolator: ["${", "}"],
|
|
3592
|
-
duplicates: true,
|
|
3593
|
-
tagTextProp: "name",
|
|
3594
|
-
dropdown: {
|
|
3595
|
-
position: "text",
|
|
3596
|
-
enabled: 0,
|
|
3597
|
-
mapValueTo: (v) => v.name,
|
|
3598
|
-
includeSelectedTags: true,
|
|
3599
|
-
searchKeys: ["name", "value"],
|
|
3600
|
-
highlightFirst: true
|
|
3601
|
-
}
|
|
3602
|
-
},
|
|
3603
|
-
InputMode: "textarea",
|
|
3604
|
-
onAdd: (e) => {
|
|
3605
|
-
var _a;
|
|
3606
|
-
const newTagName = (_a = e.detail.data) == null ? void 0 : _a.value;
|
|
3607
|
-
if (newTagName) {
|
|
3608
|
-
handleAddTag(newTagName);
|
|
3609
|
-
}
|
|
3610
|
-
},
|
|
3611
|
-
onRemove: (e) => {
|
|
3612
|
-
handleSetValue(e.detail.tagify.getInputValue());
|
|
3613
|
-
},
|
|
3614
|
-
onChange: (e) => {
|
|
3615
|
-
handleSetValue(e.detail.value);
|
|
3616
|
-
},
|
|
3617
|
-
onInput: (e) => {
|
|
3618
|
-
handleSetValue(e.detail.tagify.getInputValue());
|
|
3632
|
+
const handleSetValue = (rawValue) => {
|
|
3633
|
+
currentSetValue.current(rawValue);
|
|
3634
|
+
};
|
|
3635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3636
|
+
InsertVariableMenu,
|
|
3637
|
+
{
|
|
3638
|
+
showAddVariableMenuOption,
|
|
3639
|
+
textValue: value,
|
|
3640
|
+
onVariableClick,
|
|
3641
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3642
|
+
import_design_system16.Input,
|
|
3643
|
+
{
|
|
3644
|
+
ref: inputRef,
|
|
3645
|
+
label: ariaLabel,
|
|
3646
|
+
showLabel: false,
|
|
3647
|
+
value,
|
|
3648
|
+
onChange: (e) => handleSetValue(e.currentTarget.value),
|
|
3649
|
+
...inputProps
|
|
3619
3650
|
}
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3651
|
+
)
|
|
3652
|
+
}
|
|
3653
|
+
);
|
|
3623
3654
|
}
|
|
3624
3655
|
|
|
3625
3656
|
// src/components/Variables/VariablesList.tsx
|
|
3626
3657
|
var import_react32 = require("@emotion/react");
|
|
3627
|
-
var
|
|
3658
|
+
var import_design_system17 = require("@uniformdev/design-system");
|
|
3628
3659
|
var import_react_beautiful_dnd2 = require("react-beautiful-dnd");
|
|
3629
3660
|
|
|
3630
3661
|
// src/components/Variables/styles/VariablesList.styles.ts
|
|
@@ -3692,7 +3723,7 @@ function variablesToList(variables) {
|
|
|
3692
3723
|
}
|
|
3693
3724
|
|
|
3694
3725
|
// src/components/Variables/VariablesList.tsx
|
|
3695
|
-
var
|
|
3726
|
+
var import_jsx_runtime32 = require("@emotion/react/jsx-runtime");
|
|
3696
3727
|
function VariablesList() {
|
|
3697
3728
|
const { variables, dispatch } = useVariables();
|
|
3698
3729
|
const sorted = variablesToList(variables);
|
|
@@ -3713,24 +3744,24 @@ function VariablesList() {
|
|
|
3713
3744
|
return result;
|
|
3714
3745
|
}
|
|
3715
3746
|
};
|
|
3716
|
-
return /* @__PURE__ */ (0,
|
|
3717
|
-
/* @__PURE__ */ (0,
|
|
3718
|
-
/* @__PURE__ */ (0,
|
|
3719
|
-
/* @__PURE__ */ (0,
|
|
3720
|
-
/* @__PURE__ */ (0,
|
|
3721
|
-
/* @__PURE__ */ (0,
|
|
3747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
3748
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_beautiful_dnd2.DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_beautiful_dnd2.Droppable, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_design_system17.Table, { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
3749
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_design_system17.TableRow, { children: [
|
|
3750
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableCellHead, { children: "Name" }),
|
|
3751
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableCellHead, { children: "Default Value" }),
|
|
3752
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableCellHead, {})
|
|
3722
3753
|
] }) }),
|
|
3723
|
-
/* @__PURE__ */ (0,
|
|
3754
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_design_system17.TableBody, { children: [
|
|
3724
3755
|
sorted.map(({ name, displayName, default: defaultValue }, index) => {
|
|
3725
3756
|
const text = displayName != null ? displayName : name;
|
|
3726
|
-
return /* @__PURE__ */ (0,
|
|
3757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3727
3758
|
import_react_beautiful_dnd2.Draggable,
|
|
3728
3759
|
{
|
|
3729
3760
|
draggableId: name,
|
|
3730
3761
|
index,
|
|
3731
3762
|
isDragDisabled: sorted.length === 1,
|
|
3732
|
-
children: (provided2, snapshot) => /* @__PURE__ */ (0,
|
|
3733
|
-
|
|
3763
|
+
children: (provided2, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3764
|
+
import_design_system17.TableRow,
|
|
3734
3765
|
{
|
|
3735
3766
|
ref: provided2.innerRef,
|
|
3736
3767
|
...provided2.dragHandleProps,
|
|
@@ -3739,7 +3770,7 @@ function VariablesList() {
|
|
|
3739
3770
|
css: tableRow(snapshot.isDragging),
|
|
3740
3771
|
"data-dragging": snapshot.isDragging,
|
|
3741
3772
|
children: [
|
|
3742
|
-
/* @__PURE__ */ (0,
|
|
3773
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3743
3774
|
"button",
|
|
3744
3775
|
{
|
|
3745
3776
|
css: variableName,
|
|
@@ -3752,21 +3783,21 @@ function VariablesList() {
|
|
|
3752
3783
|
children: text
|
|
3753
3784
|
}
|
|
3754
3785
|
) }),
|
|
3755
|
-
/* @__PURE__ */ (0,
|
|
3756
|
-
/* @__PURE__ */ (0,
|
|
3786
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableCellData, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { css: variableValue, title: defaultValue, children: defaultValue }) }),
|
|
3787
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.TableCellData, { align: "right", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3757
3788
|
"button",
|
|
3758
3789
|
{
|
|
3759
3790
|
type: "button",
|
|
3760
3791
|
title: `delete ${text}`,
|
|
3761
3792
|
css: [
|
|
3762
|
-
|
|
3793
|
+
import_design_system17.button,
|
|
3763
3794
|
import_react32.css`
|
|
3764
3795
|
background: transparent;
|
|
3765
3796
|
`
|
|
3766
3797
|
],
|
|
3767
3798
|
"aria-controls": text,
|
|
3768
3799
|
onClick: () => dispatch({ type: "remove", variable: name }),
|
|
3769
|
-
children: /* @__PURE__ */ (0,
|
|
3800
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system17.Icon, { icon: "trash", iconColor: "red" })
|
|
3770
3801
|
}
|
|
3771
3802
|
) })
|
|
3772
3803
|
]
|
|
@@ -3779,8 +3810,8 @@ function VariablesList() {
|
|
|
3779
3810
|
provided.placeholder
|
|
3780
3811
|
] })
|
|
3781
3812
|
] }) }) }),
|
|
3782
|
-
/* @__PURE__ */ (0,
|
|
3783
|
-
|
|
3813
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3814
|
+
import_design_system17.AddListButton,
|
|
3784
3815
|
{
|
|
3785
3816
|
onButtonClick: () => dispatch({ type: "edit", variable: "" }),
|
|
3786
3817
|
"aria-label": "Add variable",
|
|
@@ -3793,7 +3824,7 @@ function VariablesList() {
|
|
|
3793
3824
|
}
|
|
3794
3825
|
|
|
3795
3826
|
// src/components/DataResourceVariablesList.tsx
|
|
3796
|
-
var
|
|
3827
|
+
var import_jsx_runtime33 = require("@emotion/react/jsx-runtime");
|
|
3797
3828
|
function DataResourceVariablesList({
|
|
3798
3829
|
setVariables,
|
|
3799
3830
|
noVariables: NoVariablesComponent,
|
|
@@ -3806,14 +3837,14 @@ function DataResourceVariablesList({
|
|
|
3806
3837
|
const variableDefinitions = variablesToList(dataType.variables);
|
|
3807
3838
|
if (variableDefinitions.length === 0) {
|
|
3808
3839
|
if (NoVariablesComponent) {
|
|
3809
|
-
return /* @__PURE__ */ (0,
|
|
3840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NoVariablesComponent, {});
|
|
3810
3841
|
}
|
|
3811
|
-
return /* @__PURE__ */ (0,
|
|
3842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system18.Callout, { type: "note", children: "No settings are required." });
|
|
3812
3843
|
}
|
|
3813
|
-
return /* @__PURE__ */ (0,
|
|
3844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: variableDefinitions.map((variableDefinition) => {
|
|
3814
3845
|
var _a, _b, _c;
|
|
3815
3846
|
const VariableRenderer = variableDefinition.type ? (_a = typeRenderers == null ? void 0 : typeRenderers[variableDefinition.type]) != null ? _a : TextVariableRenderer : TextVariableRenderer;
|
|
3816
|
-
return /* @__PURE__ */ (0,
|
|
3847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3817
3848
|
VariableRenderer,
|
|
3818
3849
|
{
|
|
3819
3850
|
definition: variableDefinition,
|
|
@@ -3835,9 +3866,9 @@ function DataResourceVariablesList({
|
|
|
3835
3866
|
}) });
|
|
3836
3867
|
}
|
|
3837
3868
|
function TextVariableRenderer({ definition, value, setValue }) {
|
|
3838
|
-
return /* @__PURE__ */ (0,
|
|
3839
|
-
/* @__PURE__ */ (0,
|
|
3840
|
-
|
|
3869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
3870
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3871
|
+
import_design_system18.Input,
|
|
3841
3872
|
{
|
|
3842
3873
|
label: definition.displayName || definition.name,
|
|
3843
3874
|
value,
|
|
@@ -3847,7 +3878,7 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
3847
3878
|
}
|
|
3848
3879
|
}
|
|
3849
3880
|
),
|
|
3850
|
-
definition.default !== "" ? /* @__PURE__ */ (0,
|
|
3881
|
+
definition.default !== "" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("small", { children: [
|
|
3851
3882
|
"Default value: ",
|
|
3852
3883
|
definition.default
|
|
3853
3884
|
] }) : null
|
|
@@ -3857,12 +3888,12 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
3857
3888
|
// src/components/Request/RequestBody.tsx
|
|
3858
3889
|
var import_react34 = require("@emotion/react");
|
|
3859
3890
|
var import_react35 = __toESM(require("@monaco-editor/react"));
|
|
3860
|
-
var
|
|
3891
|
+
var import_design_system19 = require("@uniformdev/design-system");
|
|
3861
3892
|
var import_react36 = require("react");
|
|
3862
3893
|
|
|
3863
3894
|
// src/components/Request/RequestProvider.tsx
|
|
3864
3895
|
var React12 = __toESM(require("react"));
|
|
3865
|
-
var
|
|
3896
|
+
var import_jsx_runtime34 = require("@emotion/react/jsx-runtime");
|
|
3866
3897
|
var RequestContext = React12.createContext(null);
|
|
3867
3898
|
function RequestProvider({ value, onChange, children }) {
|
|
3868
3899
|
const contextValue = React12.useMemo(() => {
|
|
@@ -3931,7 +3962,7 @@ function RequestProvider({ value, onChange, children }) {
|
|
|
3931
3962
|
request: value
|
|
3932
3963
|
};
|
|
3933
3964
|
}, [onChange, value]);
|
|
3934
|
-
return /* @__PURE__ */ (0,
|
|
3965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RequestContext.Provider, { value: contextValue, children });
|
|
3935
3966
|
}
|
|
3936
3967
|
function useRequest() {
|
|
3937
3968
|
const context = React12.useContext(RequestContext);
|
|
@@ -3955,17 +3986,17 @@ var requestTypeContainer = (bgColor) => import_react33.css`
|
|
|
3955
3986
|
`;
|
|
3956
3987
|
|
|
3957
3988
|
// src/components/Request/RequestTypeContainer.tsx
|
|
3958
|
-
var
|
|
3989
|
+
var import_jsx_runtime35 = require("@emotion/react/jsx-runtime");
|
|
3959
3990
|
var RequestTypeContainer = ({
|
|
3960
3991
|
bgColor = "transparent",
|
|
3961
3992
|
children,
|
|
3962
3993
|
...props
|
|
3963
3994
|
}) => {
|
|
3964
|
-
return /* @__PURE__ */ (0,
|
|
3995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { css: requestTypeContainer(bgColor), ...props, children });
|
|
3965
3996
|
};
|
|
3966
3997
|
|
|
3967
3998
|
// src/components/Request/RequestBody.tsx
|
|
3968
|
-
var
|
|
3999
|
+
var import_jsx_runtime36 = require("@emotion/react/jsx-runtime");
|
|
3969
4000
|
var LANGUAGE_OPTIONS = [
|
|
3970
4001
|
{ label: "Text", value: "plaintext" },
|
|
3971
4002
|
{ label: "JSON", value: "json" },
|
|
@@ -3985,22 +4016,22 @@ var LANGUAGE_TO_CONTENT_TYPE = {
|
|
|
3985
4016
|
function RequestBody() {
|
|
3986
4017
|
const { request, dispatch } = useRequest();
|
|
3987
4018
|
const [language, setLanguage] = (0, import_react36.useState)("json");
|
|
3988
|
-
return /* @__PURE__ */ (0,
|
|
4019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
3989
4020
|
"div",
|
|
3990
4021
|
{
|
|
3991
4022
|
css: import_react34.css`
|
|
3992
4023
|
background: var(--white);
|
|
3993
4024
|
`,
|
|
3994
4025
|
children: [
|
|
3995
|
-
/* @__PURE__ */ (0,
|
|
4026
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3996
4027
|
RequestTypeContainer,
|
|
3997
4028
|
{
|
|
3998
4029
|
bgColor: "var(--gray-100)",
|
|
3999
4030
|
css: import_react34.css`
|
|
4000
4031
|
padding: var(--spacing-sm) var(--spacing-base);
|
|
4001
4032
|
`,
|
|
4002
|
-
children: /* @__PURE__ */ (0,
|
|
4003
|
-
|
|
4033
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4034
|
+
import_design_system19.InputSelect,
|
|
4004
4035
|
{
|
|
4005
4036
|
label: "Language",
|
|
4006
4037
|
showLabel: false,
|
|
@@ -4022,7 +4053,7 @@ function RequestBody() {
|
|
|
4022
4053
|
)
|
|
4023
4054
|
}
|
|
4024
4055
|
),
|
|
4025
|
-
/* @__PURE__ */ (0,
|
|
4056
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4026
4057
|
import_react35.default,
|
|
4027
4058
|
{
|
|
4028
4059
|
height: 200,
|
|
@@ -4046,79 +4077,87 @@ function RequestBody() {
|
|
|
4046
4077
|
}
|
|
4047
4078
|
|
|
4048
4079
|
// src/components/Request/RequestHeaders.tsx
|
|
4049
|
-
var
|
|
4050
|
-
var
|
|
4080
|
+
var import_design_system20 = require("@uniformdev/design-system");
|
|
4081
|
+
var import_jsx_runtime37 = require("@emotion/react/jsx-runtime");
|
|
4051
4082
|
function RequestHeaders({ disableVariables }) {
|
|
4052
4083
|
var _a, _b;
|
|
4053
4084
|
const { dispatch, request } = useRequest();
|
|
4054
4085
|
const deezHeaders = [...request.headers, { key: "", value: "" }];
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4086
|
+
const handleUpdateParamFromMenu = ({
|
|
4087
|
+
key,
|
|
4088
|
+
value,
|
|
4089
|
+
index
|
|
4090
|
+
}) => {
|
|
4091
|
+
dispatch({
|
|
4092
|
+
type: "updateHeader",
|
|
4093
|
+
header: { key, value },
|
|
4094
|
+
index
|
|
4095
|
+
});
|
|
4096
|
+
};
|
|
4097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.Table, { children: [
|
|
4098
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system20.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.TableRow, { children: [
|
|
4099
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system20.TableCellHead, { children: "Name" }),
|
|
4100
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system20.TableCellHead, { children: "Value" })
|
|
4059
4101
|
] }) }),
|
|
4060
|
-
/* @__PURE__ */ (0,
|
|
4102
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.TableBody, { children: [
|
|
4061
4103
|
(_b = (_a = request.baseRequest) == null ? void 0 : _a.headers) == null ? void 0 : _b.map((baseHeader) => {
|
|
4062
|
-
return /* @__PURE__ */ (0,
|
|
4063
|
-
/* @__PURE__ */ (0,
|
|
4104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.TableRow, { children: [
|
|
4105
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.TableCellData, { width: "50%", children: [
|
|
4064
4106
|
baseHeader.key,
|
|
4065
|
-
/* @__PURE__ */ (0,
|
|
4066
|
-
/* @__PURE__ */ (0,
|
|
4107
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("br", {}),
|
|
4108
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("small", { children: "from data source" }) })
|
|
4067
4109
|
] }),
|
|
4068
|
-
/* @__PURE__ */ (0,
|
|
4069
|
-
/* @__PURE__ */ (0,
|
|
4070
|
-
request.headers.find((p) => p.key === baseHeader.key) ? /* @__PURE__ */ (0,
|
|
4110
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.TableCellData, { width: "50%", children: [
|
|
4111
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseHeader.value }),
|
|
4112
|
+
request.headers.find((p) => p.key === baseHeader.key) ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system20.WarningMessage, { message: "overridden below" }) : null
|
|
4071
4113
|
] })
|
|
4072
4114
|
] }, baseHeader.key);
|
|
4073
4115
|
}),
|
|
4074
|
-
deezHeaders.map((header, index) =>
|
|
4075
|
-
/* @__PURE__ */ (0,
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
}
|
|
4108
|
-
) : null })
|
|
4109
|
-
] }, index))
|
|
4116
|
+
deezHeaders.map((header, index) => {
|
|
4117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_design_system20.TableRow, { children: [
|
|
4118
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system20.TableCellData, { width: "50%", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4119
|
+
import_design_system20.Input,
|
|
4120
|
+
{
|
|
4121
|
+
label: header.key,
|
|
4122
|
+
value: header.key,
|
|
4123
|
+
showLabel: false,
|
|
4124
|
+
onChange: (e) => {
|
|
4125
|
+
if (e.currentTarget.value) {
|
|
4126
|
+
dispatch({
|
|
4127
|
+
type: "updateHeader",
|
|
4128
|
+
header: { key: e.currentTarget.value, value: header.value },
|
|
4129
|
+
index
|
|
4130
|
+
});
|
|
4131
|
+
} else {
|
|
4132
|
+
dispatch({ type: "removeHeader", index });
|
|
4133
|
+
}
|
|
4134
|
+
},
|
|
4135
|
+
"data-test-id": "header-key"
|
|
4136
|
+
}
|
|
4137
|
+
) }),
|
|
4138
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_design_system20.TableCellData, { width: "50%", children: header.key ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4139
|
+
InputVariables,
|
|
4140
|
+
{
|
|
4141
|
+
value: header.value,
|
|
4142
|
+
onChange: (value) => handleUpdateParamFromMenu({ key: header.key, value, index }),
|
|
4143
|
+
onVariableClick: (value) => handleUpdateParamFromMenu({ key: header.key, value, index }),
|
|
4144
|
+
"data-test-id": "header-value"
|
|
4145
|
+
}
|
|
4146
|
+
) : null })
|
|
4147
|
+
] }, index);
|
|
4148
|
+
})
|
|
4110
4149
|
] })
|
|
4111
4150
|
] }) });
|
|
4112
4151
|
}
|
|
4113
4152
|
|
|
4114
4153
|
// src/components/Request/RequestMethodSelect.tsx
|
|
4115
|
-
var
|
|
4116
|
-
var
|
|
4154
|
+
var import_design_system21 = require("@uniformdev/design-system");
|
|
4155
|
+
var import_jsx_runtime38 = require("@emotion/react/jsx-runtime");
|
|
4117
4156
|
function RequestMethodSelect(props) {
|
|
4118
4157
|
var _a;
|
|
4119
4158
|
const { request, dispatch } = useRequest();
|
|
4120
|
-
return /* @__PURE__ */ (0,
|
|
4121
|
-
|
|
4159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
4160
|
+
import_design_system21.InputSelect,
|
|
4122
4161
|
{
|
|
4123
4162
|
...props,
|
|
4124
4163
|
options: [
|
|
@@ -4133,67 +4172,83 @@ function RequestMethodSelect(props) {
|
|
|
4133
4172
|
}
|
|
4134
4173
|
|
|
4135
4174
|
// src/components/Request/RequestParameters.tsx
|
|
4136
|
-
var
|
|
4137
|
-
var
|
|
4175
|
+
var import_design_system22 = require("@uniformdev/design-system");
|
|
4176
|
+
var import_jsx_runtime39 = require("@emotion/react/jsx-runtime");
|
|
4138
4177
|
function RequestParameters({ disableVariables }) {
|
|
4139
4178
|
var _a, _b;
|
|
4140
4179
|
const { dispatch, request } = useRequest();
|
|
4141
4180
|
const deezParameters = [...request.parameters, { key: "", value: "" }];
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4181
|
+
const handleUpdateParamFromMenu = ({
|
|
4182
|
+
key,
|
|
4183
|
+
value,
|
|
4184
|
+
index
|
|
4185
|
+
}) => {
|
|
4186
|
+
dispatch({
|
|
4187
|
+
type: "updateParameter",
|
|
4188
|
+
parameter: { key, value },
|
|
4189
|
+
index
|
|
4190
|
+
});
|
|
4191
|
+
};
|
|
4192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.Table, { children: [
|
|
4193
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system22.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.TableRow, { children: [
|
|
4194
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system22.TableCellHead, { children: "Name" }),
|
|
4195
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system22.TableCellHead, { children: "Value" })
|
|
4146
4196
|
] }) }),
|
|
4147
|
-
/* @__PURE__ */ (0,
|
|
4197
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.TableBody, { children: [
|
|
4148
4198
|
(_b = (_a = request.baseRequest) == null ? void 0 : _a.parameters) == null ? void 0 : _b.map((baseParameter) => {
|
|
4149
|
-
return /* @__PURE__ */ (0,
|
|
4150
|
-
/* @__PURE__ */ (0,
|
|
4199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.TableRow, { children: [
|
|
4200
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.TableCellData, { width: "50%", children: [
|
|
4151
4201
|
baseParameter.key,
|
|
4152
|
-
/* @__PURE__ */ (0,
|
|
4153
|
-
/* @__PURE__ */ (0,
|
|
4202
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("br", {}),
|
|
4203
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("small", { children: "from data source" }) })
|
|
4154
4204
|
] }),
|
|
4155
|
-
/* @__PURE__ */ (0,
|
|
4156
|
-
/* @__PURE__ */ (0,
|
|
4157
|
-
request.parameters.find((p) => p.key === baseParameter.key) ? /* @__PURE__ */ (0,
|
|
4205
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.TableCellData, { width: "50%", children: [
|
|
4206
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseParameter.value }),
|
|
4207
|
+
request.parameters.find((p) => p.key === baseParameter.key) ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system22.WarningMessage, { message: "overridden below" }) : null
|
|
4158
4208
|
] })
|
|
4159
4209
|
] }, baseParameter.key);
|
|
4160
4210
|
}),
|
|
4161
|
-
deezParameters.map((parameter, index) =>
|
|
4162
|
-
/* @__PURE__ */ (0,
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4211
|
+
deezParameters.map((parameter, index) => {
|
|
4212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_design_system22.TableRow, { children: [
|
|
4213
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system22.TableCellData, { width: "50%", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4214
|
+
import_design_system22.Input,
|
|
4215
|
+
{
|
|
4216
|
+
label: parameter.key,
|
|
4217
|
+
value: parameter.key,
|
|
4218
|
+
showLabel: false,
|
|
4219
|
+
onChange: (e) => {
|
|
4220
|
+
if (e.currentTarget.value) {
|
|
4221
|
+
dispatch({
|
|
4222
|
+
type: "updateParameter",
|
|
4223
|
+
parameter: { key: e.currentTarget.value, value: parameter.value },
|
|
4224
|
+
index
|
|
4225
|
+
});
|
|
4226
|
+
} else {
|
|
4227
|
+
dispatch({ type: "removeParameter", index });
|
|
4228
|
+
}
|
|
4229
|
+
},
|
|
4230
|
+
"data-test-id": "parameter-key"
|
|
4231
|
+
}
|
|
4232
|
+
) }),
|
|
4233
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system22.TableCellData, { width: "50%", children: parameter.key ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4234
|
+
InputVariables,
|
|
4235
|
+
{
|
|
4236
|
+
value: parameter.value,
|
|
4237
|
+
onChange: (selectedVariable) => handleUpdateParamFromMenu({
|
|
4238
|
+
key: parameter.key,
|
|
4239
|
+
value: selectedVariable,
|
|
4240
|
+
index
|
|
4241
|
+
}),
|
|
4242
|
+
onVariableClick: (selectedVariable) => handleUpdateParamFromMenu({
|
|
4243
|
+
key: parameter.key,
|
|
4244
|
+
value: selectedVariable,
|
|
4245
|
+
index
|
|
4246
|
+
}),
|
|
4247
|
+
"data-test-id": "parameter-value"
|
|
4248
|
+
}
|
|
4249
|
+
) : null })
|
|
4250
|
+
] }, index);
|
|
4251
|
+
})
|
|
4197
4252
|
] })
|
|
4198
4253
|
] }) });
|
|
4199
4254
|
}
|
|
@@ -4221,7 +4276,7 @@ function decodeVariablesInUrlEncodedString(string, varValues) {
|
|
|
4221
4276
|
}
|
|
4222
4277
|
|
|
4223
4278
|
// src/components/Request/RequestUrl.tsx
|
|
4224
|
-
var
|
|
4279
|
+
var import_jsx_runtime40 = require("@emotion/react/jsx-runtime");
|
|
4225
4280
|
function RequestUrl() {
|
|
4226
4281
|
var _a, _b;
|
|
4227
4282
|
const { variables } = useVariables();
|
|
@@ -4233,7 +4288,7 @@ function RequestUrl() {
|
|
|
4233
4288
|
}
|
|
4234
4289
|
return request.baseRequest.parameters.filter((baseParam) => !request.parameters.find((p) => p.key === baseParam.key)).concat(request.parameters);
|
|
4235
4290
|
}, [(_a = request.baseRequest) == null ? void 0 : _a.parameters, request.parameters]);
|
|
4236
|
-
return /* @__PURE__ */ (0,
|
|
4291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
4237
4292
|
"small",
|
|
4238
4293
|
{
|
|
4239
4294
|
css: import_react37.css`
|
|
@@ -4242,14 +4297,14 @@ function RequestUrl() {
|
|
|
4242
4297
|
word-break: break-word;
|
|
4243
4298
|
`,
|
|
4244
4299
|
children: [
|
|
4245
|
-
request.baseRequest ? /* @__PURE__ */ (0,
|
|
4246
|
-
/* @__PURE__ */ (0,
|
|
4300
|
+
request.baseRequest ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { children: (_b = request.baseRequest) == null ? void 0 : _b.baseUrl }) : null,
|
|
4301
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { css: { fontWeight: request.baseRequest ? "bold" : "inherit" }, children: [
|
|
4247
4302
|
urlEncodeRequestUrl(request.relativeUrl, variables),
|
|
4248
|
-
mergedParameters.length > 0 ? /* @__PURE__ */ (0,
|
|
4303
|
+
mergedParameters.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
4249
4304
|
"?",
|
|
4250
4305
|
mergedParameters.map((param, index) => {
|
|
4251
4306
|
const encoded = urlEncodeRequestParameter(param, variables);
|
|
4252
|
-
return /* @__PURE__ */ (0,
|
|
4307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { children: [
|
|
4253
4308
|
index > 0 ? "&" : null,
|
|
4254
4309
|
encoded.key,
|
|
4255
4310
|
"=",
|
|
@@ -4264,10 +4319,10 @@ function RequestUrl() {
|
|
|
4264
4319
|
}
|
|
4265
4320
|
|
|
4266
4321
|
// src/components/Request/RequestUrlInput.tsx
|
|
4267
|
-
var
|
|
4322
|
+
var import_jsx_runtime41 = require("@emotion/react/jsx-runtime");
|
|
4268
4323
|
function RequestUrlInput(props) {
|
|
4269
4324
|
const { request, dispatch } = useRequest();
|
|
4270
|
-
return /* @__PURE__ */ (0,
|
|
4325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4271
4326
|
InputVariables,
|
|
4272
4327
|
{
|
|
4273
4328
|
...props,
|
|
@@ -4295,7 +4350,11 @@ function RequestUrlInput(props) {
|
|
|
4295
4350
|
},
|
|
4296
4351
|
onChange: (value) => {
|
|
4297
4352
|
dispatch({ type: "setRelativeUrl", relativeUrl: value });
|
|
4298
|
-
}
|
|
4353
|
+
},
|
|
4354
|
+
onVariableClick: (selectedValue) => {
|
|
4355
|
+
dispatch({ type: "setRelativeUrl", relativeUrl: request.relativeUrl.concat(selectedValue) });
|
|
4356
|
+
},
|
|
4357
|
+
showAddVariableMenuOption: true
|
|
4299
4358
|
}
|
|
4300
4359
|
);
|
|
4301
4360
|
}
|
|
@@ -4335,18 +4394,18 @@ function useRequestParameter(paramName) {
|
|
|
4335
4394
|
}
|
|
4336
4395
|
|
|
4337
4396
|
// src/components/DataSourceEditor.tsx
|
|
4338
|
-
var
|
|
4397
|
+
var import_jsx_runtime42 = require("@emotion/react/jsx-runtime");
|
|
4339
4398
|
function DataSourceEditor({ onChange, children, editVariableComponent }) {
|
|
4340
4399
|
var _a;
|
|
4341
4400
|
const { value } = useMeshLocation("dataSource");
|
|
4342
4401
|
const currentRequestValue = convertDataSourceToRequestData(value);
|
|
4343
|
-
return /* @__PURE__ */ (0,
|
|
4402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4344
4403
|
VariablesProvider,
|
|
4345
4404
|
{
|
|
4346
4405
|
value: (_a = value.variables) != null ? _a : {},
|
|
4347
4406
|
onChange: (newValue) => onChange((prev) => ({ newValue: { ...prev, variables: newValue } })),
|
|
4348
4407
|
editVariableComponent,
|
|
4349
|
-
children: /* @__PURE__ */ (0,
|
|
4408
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4350
4409
|
RequestProvider,
|
|
4351
4410
|
{
|
|
4352
4411
|
value: currentRequestValue,
|
|
@@ -4383,7 +4442,7 @@ function convertRequestDataToDataSource(dataSource, requestData) {
|
|
|
4383
4442
|
}
|
|
4384
4443
|
|
|
4385
4444
|
// src/components/DataTypeEditor.tsx
|
|
4386
|
-
var
|
|
4445
|
+
var import_jsx_runtime43 = require("@emotion/react/jsx-runtime");
|
|
4387
4446
|
function DataTypeEditor({ onChange, children, editVariableComponent }) {
|
|
4388
4447
|
var _a;
|
|
4389
4448
|
const {
|
|
@@ -4391,13 +4450,13 @@ function DataTypeEditor({ onChange, children, editVariableComponent }) {
|
|
|
4391
4450
|
metadata: { dataSource }
|
|
4392
4451
|
} = useMeshLocation("dataType");
|
|
4393
4452
|
const currentRequestValue = convertDataTypeToRequestData(value, dataSource);
|
|
4394
|
-
return /* @__PURE__ */ (0,
|
|
4453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4395
4454
|
VariablesProvider,
|
|
4396
4455
|
{
|
|
4397
4456
|
value: (_a = value.variables) != null ? _a : {},
|
|
4398
4457
|
onChange: (newValue) => onChange((prev) => ({ newValue: { ...prev, variables: newValue } })),
|
|
4399
4458
|
editVariableComponent,
|
|
4400
|
-
children: /* @__PURE__ */ (0,
|
|
4459
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4401
4460
|
RequestProvider,
|
|
4402
4461
|
{
|
|
4403
4462
|
value: currentRequestValue,
|
|
@@ -4443,7 +4502,7 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
4443
4502
|
}
|
|
4444
4503
|
|
|
4445
4504
|
// src/components/MeshApp.tsx
|
|
4446
|
-
var
|
|
4505
|
+
var import_design_system23 = require("@uniformdev/design-system");
|
|
4447
4506
|
|
|
4448
4507
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
4449
4508
|
var import_mesh_sdk = require("@uniformdev/mesh-sdk");
|
|
@@ -4480,7 +4539,7 @@ var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
|
4480
4539
|
};
|
|
4481
4540
|
|
|
4482
4541
|
// src/components/MeshApp.tsx
|
|
4483
|
-
var
|
|
4542
|
+
var import_jsx_runtime44 = require("@emotion/react/jsx-runtime");
|
|
4484
4543
|
var MeshApp = ({
|
|
4485
4544
|
children,
|
|
4486
4545
|
loadingComponent,
|
|
@@ -4489,18 +4548,18 @@ var MeshApp = ({
|
|
|
4489
4548
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
4490
4549
|
if (initializing || !sdk) {
|
|
4491
4550
|
const LoadingComponent = loadingComponent;
|
|
4492
|
-
return LoadingComponent ? /* @__PURE__ */ (0,
|
|
4551
|
+
return LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(LoadingComponent, {}) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system23.LoadingIndicator, {});
|
|
4493
4552
|
}
|
|
4494
4553
|
if (error) {
|
|
4495
4554
|
const ErrorComponent = errorComponent;
|
|
4496
4555
|
if (ErrorComponent) {
|
|
4497
|
-
return /* @__PURE__ */ (0,
|
|
4556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ErrorComponent, { error });
|
|
4498
4557
|
}
|
|
4499
4558
|
throw error;
|
|
4500
4559
|
}
|
|
4501
|
-
return /* @__PURE__ */ (0,
|
|
4502
|
-
/* @__PURE__ */ (0,
|
|
4503
|
-
/* @__PURE__ */ (0,
|
|
4560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
|
|
4561
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_design_system23.Theme, {}),
|
|
4562
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(UniformMeshLocationContextProvider, { children })
|
|
4504
4563
|
] });
|
|
4505
4564
|
};
|
|
4506
4565
|
|
|
@@ -4519,7 +4578,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
4519
4578
|
}
|
|
4520
4579
|
|
|
4521
4580
|
// src/index.ts
|
|
4522
|
-
var
|
|
4581
|
+
var import_design_system24 = require("@uniformdev/design-system");
|
|
4523
4582
|
__reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
4524
4583
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4525
4584
|
0 && (module.exports = {
|