@uniformdev/mesh-sdk-react 19.45.1 → 19.45.2-alpha.6
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 +20 -4
- package/dist/index.d.ts +20 -4
- package/dist/index.esm.js +106 -81
- package/dist/index.js +378 -353
- package/dist/index.mjs +106 -81
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -33,9 +33,9 @@ var src_exports = {};
|
|
|
33
33
|
__export(src_exports, {
|
|
34
34
|
$createVariableNode: () => $createVariableNode,
|
|
35
35
|
$isVariableNode: () => $isVariableNode,
|
|
36
|
-
AddListButton: () =>
|
|
37
|
-
Button: () =>
|
|
38
|
-
Callout: () =>
|
|
36
|
+
AddListButton: () => import_design_system40.AddListButton,
|
|
37
|
+
Button: () => import_design_system40.Button,
|
|
38
|
+
Callout: () => import_design_system40.Callout,
|
|
39
39
|
ControlledValuePlugin: () => ControlledValuePlugin,
|
|
40
40
|
DamSelectedItem: () => DamSelectedItem,
|
|
41
41
|
DataRefreshButton: () => DataRefreshButton,
|
|
@@ -46,24 +46,24 @@ __export(src_exports, {
|
|
|
46
46
|
DataTypeEditor: () => DataTypeEditor,
|
|
47
47
|
DefaultSearchRow: () => DefaultSearchRow,
|
|
48
48
|
DefaultSelectedItem: () => DefaultSelectedItem,
|
|
49
|
-
DrawerContent: () =>
|
|
49
|
+
DrawerContent: () => import_design_system40.DrawerContent,
|
|
50
50
|
EDIT_VARIABLE_COMMAND: () => EDIT_VARIABLE_COMMAND,
|
|
51
51
|
EntrySearch: () => EntrySearch,
|
|
52
|
-
Heading: () =>
|
|
52
|
+
Heading: () => import_design_system40.Heading,
|
|
53
53
|
INSERT_VARIABLE_COMMAND: () => INSERT_VARIABLE_COMMAND,
|
|
54
54
|
Icons: () => icons_exports,
|
|
55
|
-
Input: () =>
|
|
56
|
-
InputComboBox: () =>
|
|
57
|
-
InputKeywordSearch: () =>
|
|
58
|
-
InputSelect: () =>
|
|
59
|
-
InputToggle: () =>
|
|
55
|
+
Input: () => import_design_system40.Input,
|
|
56
|
+
InputComboBox: () => import_design_system40.InputComboBox,
|
|
57
|
+
InputKeywordSearch: () => import_design_system40.InputKeywordSearch,
|
|
58
|
+
InputSelect: () => import_design_system40.InputSelect,
|
|
59
|
+
InputToggle: () => import_design_system40.InputToggle,
|
|
60
60
|
InputVariables: () => InputVariables,
|
|
61
|
-
Label: () =>
|
|
61
|
+
Label: () => import_design_system40.Label,
|
|
62
62
|
LinkButton: () => LinkButton,
|
|
63
|
-
LoadingIndicator: () =>
|
|
64
|
-
LoadingOverlay: () =>
|
|
65
|
-
Menu: () =>
|
|
66
|
-
MenuItem: () =>
|
|
63
|
+
LoadingIndicator: () => import_design_system40.LoadingIndicator,
|
|
64
|
+
LoadingOverlay: () => import_design_system40.LoadingOverlay,
|
|
65
|
+
Menu: () => import_design_system40.Menu,
|
|
66
|
+
MenuItem: () => import_design_system40.MenuItem,
|
|
67
67
|
MeshApp: () => MeshApp,
|
|
68
68
|
OPEN_INSERT_VARIABLE_COMMAND: () => OPEN_INSERT_VARIABLE_COMMAND,
|
|
69
69
|
ObjectSearchContainer: () => ObjectSearchContainer,
|
|
@@ -77,22 +77,22 @@ __export(src_exports, {
|
|
|
77
77
|
ObjectSearchResultList: () => ObjectSearchResultList,
|
|
78
78
|
ParamTypeDynamicDataProvider: () => ParamTypeDynamicDataProvider,
|
|
79
79
|
ParameterConnectionIndicator: () => ParameterConnectionIndicator,
|
|
80
|
-
ParameterGroup: () =>
|
|
81
|
-
ParameterImage: () =>
|
|
82
|
-
ParameterImageInner: () =>
|
|
83
|
-
ParameterInput: () =>
|
|
84
|
-
ParameterInputInner: () =>
|
|
85
|
-
ParameterLabel: () =>
|
|
86
|
-
ParameterMenuButton: () =>
|
|
80
|
+
ParameterGroup: () => import_design_system40.ParameterGroup,
|
|
81
|
+
ParameterImage: () => import_design_system40.ParameterImage,
|
|
82
|
+
ParameterImageInner: () => import_design_system40.ParameterImageInner,
|
|
83
|
+
ParameterInput: () => import_design_system40.ParameterInput,
|
|
84
|
+
ParameterInputInner: () => import_design_system40.ParameterInputInner,
|
|
85
|
+
ParameterLabel: () => import_design_system40.ParameterLabel,
|
|
86
|
+
ParameterMenuButton: () => import_design_system40.ParameterMenuButton,
|
|
87
87
|
ParameterOrSingleVariable: () => ParameterOrSingleVariable,
|
|
88
|
-
ParameterSelect: () =>
|
|
89
|
-
ParameterSelectInner: () =>
|
|
90
|
-
ParameterShell: () =>
|
|
88
|
+
ParameterSelect: () => import_design_system40.ParameterSelect,
|
|
89
|
+
ParameterSelectInner: () => import_design_system40.ParameterSelectInner,
|
|
90
|
+
ParameterShell: () => import_design_system40.ParameterShell,
|
|
91
91
|
ParameterShellContext: () => import_design_system14.ParameterShellContext,
|
|
92
|
-
ParameterTextarea: () =>
|
|
93
|
-
ParameterTextareaInner: () =>
|
|
94
|
-
ParameterToggle: () =>
|
|
95
|
-
ParameterToggleInner: () =>
|
|
92
|
+
ParameterTextarea: () => import_design_system40.ParameterTextarea,
|
|
93
|
+
ParameterTextareaInner: () => import_design_system40.ParameterTextareaInner,
|
|
94
|
+
ParameterToggle: () => import_design_system40.ParameterToggle,
|
|
95
|
+
ParameterToggleInner: () => import_design_system40.ParameterToggleInner,
|
|
96
96
|
ParameterVariables: () => ParameterVariables,
|
|
97
97
|
ProductPreviewList: () => ProductPreviewList,
|
|
98
98
|
ProductQuery: () => ProductQuery,
|
|
@@ -111,13 +111,13 @@ __export(src_exports, {
|
|
|
111
111
|
RequestUrl: () => RequestUrl,
|
|
112
112
|
RequestUrlInput: () => RequestUrlInput,
|
|
113
113
|
ResolvableLoadingValue: () => ResolvableLoadingValue,
|
|
114
|
-
ScrollableList: () =>
|
|
115
|
-
ScrollableListItem: () =>
|
|
114
|
+
ScrollableList: () => import_design_system40.ScrollableList,
|
|
115
|
+
ScrollableListItem: () => import_design_system40.ScrollableListItem,
|
|
116
116
|
SelectionField: () => SelectionField,
|
|
117
|
-
Switch: () =>
|
|
117
|
+
Switch: () => import_design_system40.Switch,
|
|
118
118
|
TextVariableRenderer: () => TextVariableRenderer,
|
|
119
|
-
Textarea: () =>
|
|
120
|
-
Theme: () =>
|
|
119
|
+
Textarea: () => import_design_system40.Textarea,
|
|
120
|
+
Theme: () => import_design_system40.Theme,
|
|
121
121
|
VariableEditor: () => VariableEditor,
|
|
122
122
|
VariableNode: () => VariableNode,
|
|
123
123
|
VariablesList: () => VariablesList,
|
|
@@ -2976,6 +2976,7 @@ var import_design_system14 = require("@uniformdev/design-system");
|
|
|
2976
2976
|
|
|
2977
2977
|
// src/components/Variables/composer/ControlledValuePlugin.tsx
|
|
2978
2978
|
var import_LexicalComposerContext = require("@lexical/react/LexicalComposerContext");
|
|
2979
|
+
var import_lite = require("dequal/lite");
|
|
2979
2980
|
var import_react30 = require("react");
|
|
2980
2981
|
|
|
2981
2982
|
// src/components/Variables/util/deserializeVariablesEditorState.ts
|
|
@@ -3087,12 +3088,17 @@ function ControlledValuePlugin({
|
|
|
3087
3088
|
extraDependencies
|
|
3088
3089
|
}) {
|
|
3089
3090
|
const [editor] = (0, import_LexicalComposerContext.useLexicalComposerContext)();
|
|
3091
|
+
const lastValueRef = (0, import_react30.useRef)(value);
|
|
3090
3092
|
(0, import_react30.useEffect)(() => {
|
|
3091
3093
|
if (!enabled) {
|
|
3092
3094
|
return;
|
|
3093
3095
|
}
|
|
3096
|
+
if ((0, import_lite.dequal)(lastValueRef.current, value)) {
|
|
3097
|
+
return;
|
|
3098
|
+
}
|
|
3094
3099
|
setTimeout(() => {
|
|
3095
3100
|
if (editor) {
|
|
3101
|
+
lastValueRef.current = value;
|
|
3096
3102
|
setVariablesEditorValue(editor, value);
|
|
3097
3103
|
}
|
|
3098
3104
|
});
|
|
@@ -3106,8 +3112,9 @@ var import_useLexicalNodeSelection = require("@lexical/react/useLexicalNodeSelec
|
|
|
3106
3112
|
var import_selection = require("@lexical/selection");
|
|
3107
3113
|
var import_utils = require("@lexical/utils");
|
|
3108
3114
|
var import_canvas3 = require("@uniformdev/canvas");
|
|
3115
|
+
var import_design_system18 = require("@uniformdev/design-system");
|
|
3109
3116
|
var import_lexical4 = require("lexical");
|
|
3110
|
-
var
|
|
3117
|
+
var import_react38 = require("react");
|
|
3111
3118
|
|
|
3112
3119
|
// src/components/Variables/util/prettifyBindExpression.tsx
|
|
3113
3120
|
function prettifyBindExpression(bindExpression) {
|
|
@@ -3171,15 +3178,15 @@ function InfoVariableReference({ children }) {
|
|
|
3171
3178
|
}
|
|
3172
3179
|
|
|
3173
3180
|
// src/components/Variables/composer/VariablesPlugin.tsx
|
|
3174
|
-
var
|
|
3181
|
+
var import_react36 = require("@emotion/react");
|
|
3175
3182
|
var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerContext");
|
|
3176
3183
|
var import_LexicalTypeaheadMenuPlugin = require("@lexical/react/LexicalTypeaheadMenuPlugin");
|
|
3177
3184
|
var import_AiFillPlusCircle = require("@react-icons/all-files/ai/AiFillPlusCircle");
|
|
3178
3185
|
var import_canvas2 = require("@uniformdev/canvas");
|
|
3179
3186
|
var import_design_system17 = require("@uniformdev/design-system");
|
|
3180
|
-
var
|
|
3187
|
+
var import_lite2 = require("dequal/lite");
|
|
3181
3188
|
var import_lexical3 = require("lexical");
|
|
3182
|
-
var
|
|
3189
|
+
var import_react37 = require("react");
|
|
3183
3190
|
var import_react_dom = require("react-dom");
|
|
3184
3191
|
|
|
3185
3192
|
// src/components/Variables/toolbox/SelectVariableMenu.styles.ts
|
|
@@ -3212,11 +3219,11 @@ var variablesTipText = import_react32.css`
|
|
|
3212
3219
|
`;
|
|
3213
3220
|
|
|
3214
3221
|
// src/components/Variables/useOnVariableUpdated.ts
|
|
3215
|
-
var
|
|
3222
|
+
var import_react35 = require("react");
|
|
3216
3223
|
|
|
3217
3224
|
// src/components/Variables/VariablesProvider.tsx
|
|
3218
3225
|
var import_mitt = __toESM(require("mitt"));
|
|
3219
|
-
var
|
|
3226
|
+
var import_react34 = require("react");
|
|
3220
3227
|
|
|
3221
3228
|
// src/components/Variables/VariableEditor.tsx
|
|
3222
3229
|
var import_zod = require("@hookform/resolvers/zod");
|
|
@@ -3327,61 +3334,71 @@ function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip }) {
|
|
|
3327
3334
|
|
|
3328
3335
|
// src/components/Variables/VariablesProvider.tsx
|
|
3329
3336
|
var import_jsx_runtime31 = require("@emotion/react/jsx-runtime");
|
|
3330
|
-
var VariablesContext =
|
|
3337
|
+
var VariablesContext = (0, import_react34.createContext)(null);
|
|
3331
3338
|
function VariablesProvider({
|
|
3332
3339
|
value,
|
|
3333
3340
|
onChange,
|
|
3334
3341
|
editVariableComponent,
|
|
3335
3342
|
readOnly,
|
|
3343
|
+
isLoading,
|
|
3336
3344
|
children,
|
|
3337
3345
|
knownUndefinedValues = {}
|
|
3338
3346
|
}) {
|
|
3339
|
-
const [editing, setEditing] =
|
|
3340
|
-
const [editingContext, setEditingContext] =
|
|
3341
|
-
const events =
|
|
3347
|
+
const [editing, setEditing] = (0, import_react34.useState)();
|
|
3348
|
+
const [editingContext, setEditingContext] = (0, import_react34.useState)();
|
|
3349
|
+
const events = (0, import_react34.useMemo)(() => (0, import_mitt.default)(), []);
|
|
3342
3350
|
if (!readOnly && !onChange) {
|
|
3343
3351
|
throw new Error("onChange must be provided when readOnly is false");
|
|
3344
3352
|
}
|
|
3345
3353
|
const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
|
|
3346
|
-
const
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3354
|
+
const valueBasedContextValue = (0, import_react34.useMemo)(
|
|
3355
|
+
() => ({
|
|
3356
|
+
flatVariables: flattenVariables(value),
|
|
3357
|
+
dispatch: (event) => {
|
|
3358
|
+
if (readOnly) {
|
|
3359
|
+
console.warn(
|
|
3360
|
+
`Received ignored mutation event in read-only variables context: ${JSON.stringify(event)}`
|
|
3361
|
+
);
|
|
3362
|
+
return;
|
|
3363
|
+
}
|
|
3364
|
+
if (event.type === "set") {
|
|
3365
|
+
const { name, ...varValue } = event.variable;
|
|
3366
|
+
onChange == null ? void 0 : onChange({ ...value, [event.variable.name]: varValue });
|
|
3367
|
+
if (event.openEditor) {
|
|
3368
|
+
setEditing(event.variable.name);
|
|
3369
|
+
setEditingContext(event.context);
|
|
3370
|
+
}
|
|
3371
|
+
} else if (event.type === "edit") {
|
|
3372
|
+
setEditing(event.variable);
|
|
3360
3373
|
setEditingContext(event.context);
|
|
3374
|
+
} else if (event.type === "remove") {
|
|
3375
|
+
const newValue = { ...value };
|
|
3376
|
+
delete newValue[event.variable];
|
|
3377
|
+
onChange == null ? void 0 : onChange(newValue);
|
|
3378
|
+
} else if (event.type === "reorder") {
|
|
3379
|
+
onChange == null ? void 0 : onChange(event.result);
|
|
3380
|
+
} else if (event.type === "cancelEdit") {
|
|
3381
|
+
setEditing(void 0);
|
|
3382
|
+
setEditingContext(void 0);
|
|
3383
|
+
} else {
|
|
3384
|
+
throw new Error(`Unknown event ${JSON.stringify(event)}`);
|
|
3361
3385
|
}
|
|
3362
|
-
}
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
variables: value,
|
|
3379
|
-
isEditing: typeof editing !== "undefined",
|
|
3380
|
-
events,
|
|
3381
|
-
canDispatch: true,
|
|
3382
|
-
readOnly,
|
|
3383
|
-
knownUndefinedValues
|
|
3384
|
-
};
|
|
3386
|
+
},
|
|
3387
|
+
variables: value,
|
|
3388
|
+
readOnly
|
|
3389
|
+
}),
|
|
3390
|
+
[onChange, readOnly, value]
|
|
3391
|
+
);
|
|
3392
|
+
const contextValue = (0, import_react34.useMemo)(() => {
|
|
3393
|
+
return {
|
|
3394
|
+
...valueBasedContextValue,
|
|
3395
|
+
isEditing: typeof editing !== "undefined",
|
|
3396
|
+
events,
|
|
3397
|
+
canDispatch: true,
|
|
3398
|
+
knownUndefinedValues,
|
|
3399
|
+
isLoading: !!isLoading
|
|
3400
|
+
};
|
|
3401
|
+
}, [editing, events, knownUndefinedValues, valueBasedContextValue, isLoading]);
|
|
3385
3402
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(VariablesContext.Provider, { value: contextValue, children: [
|
|
3386
3403
|
children,
|
|
3387
3404
|
typeof editing !== "undefined" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
@@ -3404,7 +3421,7 @@ function VariablesProvider({
|
|
|
3404
3421
|
] });
|
|
3405
3422
|
}
|
|
3406
3423
|
function useVariables(returnEmptyWithoutProvider = false) {
|
|
3407
|
-
const context =
|
|
3424
|
+
const context = (0, import_react34.useContext)(VariablesContext);
|
|
3408
3425
|
if (!context) {
|
|
3409
3426
|
if (returnEmptyWithoutProvider) {
|
|
3410
3427
|
return {
|
|
@@ -3416,7 +3433,8 @@ function useVariables(returnEmptyWithoutProvider = false) {
|
|
|
3416
3433
|
isEditing: false,
|
|
3417
3434
|
variables: {},
|
|
3418
3435
|
knownUndefinedValues: {},
|
|
3419
|
-
canDispatch: false
|
|
3436
|
+
canDispatch: false,
|
|
3437
|
+
isLoading: false
|
|
3420
3438
|
};
|
|
3421
3439
|
}
|
|
3422
3440
|
throw new Error("No VariablesProvider present");
|
|
@@ -3434,7 +3452,7 @@ function flattenVariables(variables) {
|
|
|
3434
3452
|
// src/components/Variables/useOnVariableUpdated.ts
|
|
3435
3453
|
function useOnVariableUpdated(fn, disabled) {
|
|
3436
3454
|
const { variables, events, canDispatch } = useVariables(true);
|
|
3437
|
-
(0,
|
|
3455
|
+
(0, import_react35.useEffect)(() => {
|
|
3438
3456
|
if (disabled || !canDispatch) {
|
|
3439
3457
|
return;
|
|
3440
3458
|
}
|
|
@@ -3518,7 +3536,7 @@ function useVariablesMenu({
|
|
|
3518
3536
|
getEditorContext
|
|
3519
3537
|
}) {
|
|
3520
3538
|
const { variables, canDispatch, readOnly } = useVariables(true);
|
|
3521
|
-
const canEditVariable = (0,
|
|
3539
|
+
const canEditVariable = (0, import_react37.useCallback)(
|
|
3522
3540
|
(name, variable) => (
|
|
3523
3541
|
// name === '' means new var. Add var perms computed by menu options.
|
|
3524
3542
|
name === "" || canDispatch && enableEditingVariables && !readOnly && !(variable == null ? void 0 : variable.readOnly)
|
|
@@ -3526,7 +3544,7 @@ function useVariablesMenu({
|
|
|
3526
3544
|
[canDispatch, enableEditingVariables, readOnly]
|
|
3527
3545
|
);
|
|
3528
3546
|
const canAddVariable = canDispatch && showAddVariableMenuOption && !readOnly;
|
|
3529
|
-
const { groupedVariables, menuOptions } = (0,
|
|
3547
|
+
const { groupedVariables, menuOptions } = (0, import_react37.useMemo)(() => {
|
|
3530
3548
|
const groupedVariables2 = variablesToGroupedList(variables, filterVariable, getEditorContext == null ? void 0 : getEditorContext());
|
|
3531
3549
|
if (canAddVariable) {
|
|
3532
3550
|
groupedVariables2.unshift({
|
|
@@ -3548,7 +3566,7 @@ function useVariablesMenu({
|
|
|
3548
3566
|
);
|
|
3549
3567
|
return { menuOptions: menuOptions2, groupedVariables: groupedVariables2 };
|
|
3550
3568
|
}, [variables, filterVariable, getEditorContext, canAddVariable, showAddVariableMenuOption]);
|
|
3551
|
-
const onSelect = (0,
|
|
3569
|
+
const onSelect = (0, import_react37.useCallback)(
|
|
3552
3570
|
({ queryString, value, nodeToReplace, editor, overwriteExistingValue }) => {
|
|
3553
3571
|
if (value === ADD_VARIABLE_OPTION) {
|
|
3554
3572
|
editor.update(() => {
|
|
@@ -3571,7 +3589,8 @@ function useVariablesMenu({
|
|
|
3571
3589
|
hasClickEvent: canEditVariable(value, targetVariable),
|
|
3572
3590
|
referenceIsValid: true,
|
|
3573
3591
|
tooltip: (_a = targetVariable == null ? void 0 : targetVariable.tooltip) != null ? _a : targetVariable == null ? void 0 : targetVariable.helpText,
|
|
3574
|
-
isFresh: true
|
|
3592
|
+
isFresh: true,
|
|
3593
|
+
isLoading: false
|
|
3575
3594
|
});
|
|
3576
3595
|
if (nodeToReplace) {
|
|
3577
3596
|
nodeToReplace.replace(variableNode);
|
|
@@ -3594,17 +3613,17 @@ function VariablesPlugin({
|
|
|
3594
3613
|
filterVariable
|
|
3595
3614
|
}) {
|
|
3596
3615
|
const [editor] = (0, import_LexicalComposerContext2.useLexicalComposerContext)();
|
|
3597
|
-
const { variables, dispatch, isEditing, canDispatch, readOnly, knownUndefinedValues } = useVariables(true);
|
|
3598
|
-
const variablesRef = (0,
|
|
3599
|
-
variablesRef.current = { variables, knownUndefinedValues };
|
|
3600
|
-
const canEditVariable = (0,
|
|
3616
|
+
const { variables, dispatch, isEditing, canDispatch, readOnly, knownUndefinedValues, isLoading } = useVariables(true);
|
|
3617
|
+
const variablesRef = (0, import_react37.useRef)({ variables, knownUndefinedValues, isLoading });
|
|
3618
|
+
variablesRef.current = { variables, knownUndefinedValues, isLoading };
|
|
3619
|
+
const canEditVariable = (0, import_react37.useCallback)(
|
|
3601
3620
|
(name, variable) => (
|
|
3602
3621
|
// name === '' means new var. Add var perms computed by menu options.
|
|
3603
3622
|
name === "" || canDispatch && enableEditingVariables && !readOnly && !(variable == null ? void 0 : variable.readOnly)
|
|
3604
3623
|
),
|
|
3605
3624
|
[canDispatch, enableEditingVariables, readOnly]
|
|
3606
3625
|
);
|
|
3607
|
-
const [editingKey, setEditingKey] = (0,
|
|
3626
|
+
const [editingKey, setEditingKey] = (0, import_react37.useState)(null);
|
|
3608
3627
|
useOnVariableUpdated(({ name, latestValue }) => {
|
|
3609
3628
|
editor.update(() => {
|
|
3610
3629
|
var _a;
|
|
@@ -3620,18 +3639,18 @@ function VariablesPlugin({
|
|
|
3620
3639
|
});
|
|
3621
3640
|
});
|
|
3622
3641
|
}, editingKey === null);
|
|
3623
|
-
(0,
|
|
3642
|
+
(0, import_react37.useEffect)(() => {
|
|
3624
3643
|
if (editingKey !== null && !isEditing) {
|
|
3625
3644
|
setEditingKey(null);
|
|
3626
3645
|
}
|
|
3627
3646
|
}, [editingKey, isEditing]);
|
|
3628
|
-
const [queryString, setQueryString] = (0,
|
|
3647
|
+
const [queryString, setQueryString] = (0, import_react37.useState)(null);
|
|
3629
3648
|
const { groupedVariables, menuOptions, onSelect } = useVariablesMenu({
|
|
3630
3649
|
showAddVariableMenuOption,
|
|
3631
3650
|
filterVariable,
|
|
3632
3651
|
getEditorContext
|
|
3633
3652
|
});
|
|
3634
|
-
const { filteredGroupedVariables, filteredMenuOptions } = (0,
|
|
3653
|
+
const { filteredGroupedVariables, filteredMenuOptions } = (0, import_react37.useMemo)(() => {
|
|
3635
3654
|
if (!queryString) {
|
|
3636
3655
|
return {
|
|
3637
3656
|
filteredGroupedVariables: groupedVariables,
|
|
@@ -3651,7 +3670,7 @@ function VariablesPlugin({
|
|
|
3651
3670
|
)
|
|
3652
3671
|
};
|
|
3653
3672
|
}, [queryString, groupedVariables, menuOptions]);
|
|
3654
|
-
const onSelectOption = (0,
|
|
3673
|
+
const onSelectOption = (0, import_react37.useCallback)(
|
|
3655
3674
|
(selectedOption, nodeToReplace, closeMenu) => {
|
|
3656
3675
|
if (selectedOption.key === ADD_VARIABLE_OPTION) {
|
|
3657
3676
|
setEditingKey(void 0);
|
|
@@ -3667,7 +3686,7 @@ function VariablesPlugin({
|
|
|
3667
3686
|
},
|
|
3668
3687
|
[editor, onSelect, queryString, replaceValueOnVariableInsert]
|
|
3669
3688
|
);
|
|
3670
|
-
(0,
|
|
3689
|
+
(0, import_react37.useEffect)(() => {
|
|
3671
3690
|
editor.registerCommand(
|
|
3672
3691
|
EDIT_VARIABLE_COMMAND,
|
|
3673
3692
|
({ reference, sourceKey }) => {
|
|
@@ -3705,7 +3724,8 @@ function VariablesPlugin({
|
|
|
3705
3724
|
hasClickEvent: canEditVariable(reference, targetVariable),
|
|
3706
3725
|
referenceIsValid: true,
|
|
3707
3726
|
tooltip: (_a = targetVariable == null ? void 0 : targetVariable.tooltip) != null ? _a : targetVariable == null ? void 0 : targetVariable.helpText,
|
|
3708
|
-
isFresh: true
|
|
3727
|
+
isFresh: true,
|
|
3728
|
+
isLoading: false
|
|
3709
3729
|
});
|
|
3710
3730
|
if (targetKey) {
|
|
3711
3731
|
(_b = (0, import_lexical3.$getNodeByKey)(targetKey)) == null ? void 0 : _b.replace(variableNode);
|
|
@@ -3718,35 +3738,38 @@ function VariablesPlugin({
|
|
|
3718
3738
|
import_lexical3.COMMAND_PRIORITY_NORMAL
|
|
3719
3739
|
);
|
|
3720
3740
|
}, [editor, disableVariables, canDispatch, dispatch, canEditVariable, readOnly, getEditorContext]);
|
|
3721
|
-
const updateExistingNodeIfChanged = (0,
|
|
3741
|
+
const updateExistingNodeIfChanged = (0, import_react37.useCallback)(
|
|
3722
3742
|
(variableNode) => {
|
|
3723
3743
|
var _a, _b, _c;
|
|
3724
3744
|
const targetVar = variablesRef.current.variables[variableNode.reference];
|
|
3725
3745
|
const targetUndefinedVar = variablesRef.current.knownUndefinedValues[variableNode.reference];
|
|
3746
|
+
const isLoadingVariables = variablesRef.current.isLoading;
|
|
3726
3747
|
const tooltip = (_c = (_b = (_a = targetVar == null ? void 0 : targetVar.tooltip) != null ? _a : targetVar == null ? void 0 : targetVar.helpText) != null ? _b : targetUndefinedVar == null ? void 0 : targetUndefinedVar.error) != null ? _c : targetUndefinedVar == null ? void 0 : targetUndefinedVar.info;
|
|
3727
3748
|
const currentState = variableNode.getState();
|
|
3728
3749
|
const newState = {
|
|
3729
3750
|
...currentState,
|
|
3730
|
-
// if we lose a display name we 'latch' it to last known (prevents flashes during mesh var updates)
|
|
3731
|
-
|
|
3751
|
+
// if we lose a display name we 'latch' it to last known (prevents flashes during mesh var updates),
|
|
3752
|
+
// unless we're also loading the whole var state
|
|
3753
|
+
displayName: (targetVar == null ? void 0 : targetVar.displayName) || (isLoadingVariables ? void 0 : currentState.displayName) || variableNode.reference,
|
|
3754
|
+
isLoading: isLoadingVariables && !targetVar && !(targetUndefinedVar == null ? void 0 : targetUndefinedVar.info),
|
|
3732
3755
|
hasClickEvent: canEditVariable(variableNode.reference, targetVar),
|
|
3733
|
-
referenceIsValid: (targetUndefinedVar == null ? void 0 : targetUndefinedVar.info) ? "info" : Boolean(targetVar),
|
|
3756
|
+
referenceIsValid: (targetUndefinedVar == null ? void 0 : targetUndefinedVar.info) ? "info" : isLoadingVariables ? true : Boolean(targetVar),
|
|
3734
3757
|
tooltip
|
|
3735
3758
|
};
|
|
3736
|
-
if (!(0,
|
|
3759
|
+
if (!(0, import_lite2.dequal)(currentState, newState)) {
|
|
3737
3760
|
variableNode.setState(newState);
|
|
3738
3761
|
}
|
|
3739
3762
|
},
|
|
3740
3763
|
[canEditVariable]
|
|
3741
3764
|
);
|
|
3742
|
-
(0,
|
|
3765
|
+
(0, import_react37.useEffect)(() => {
|
|
3743
3766
|
editor.update(() => {
|
|
3744
3767
|
(0, import_lexical3.$nodesOfType)(VariableNode).forEach((variableNode) => {
|
|
3745
3768
|
updateExistingNodeIfChanged(variableNode);
|
|
3746
3769
|
});
|
|
3747
3770
|
});
|
|
3748
3771
|
}, [editor, variables, canEditVariable, updateExistingNodeIfChanged]);
|
|
3749
|
-
(0,
|
|
3772
|
+
(0, import_react37.useEffect)(() => {
|
|
3750
3773
|
return editor.registerNodeTransform(VariableNode, (variableNode) => {
|
|
3751
3774
|
updateExistingNodeIfChanged(variableNode);
|
|
3752
3775
|
});
|
|
@@ -3770,7 +3793,7 @@ function VariablesPlugin({
|
|
|
3770
3793
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3771
3794
|
"div",
|
|
3772
3795
|
{
|
|
3773
|
-
css:
|
|
3796
|
+
css: import_react36.css`
|
|
3774
3797
|
box-shadow: var(--shadow-base);
|
|
3775
3798
|
border-radius: var(--rounded-base);
|
|
3776
3799
|
background: var(--gray-50);
|
|
@@ -3849,7 +3872,8 @@ var VariableNode = class _VariableNode extends import_lexical4.DecoratorNode {
|
|
|
3849
3872
|
referenceIsValid: true,
|
|
3850
3873
|
isFresh: false,
|
|
3851
3874
|
hasClickEvent: void 0,
|
|
3852
|
-
tooltip: void 0
|
|
3875
|
+
tooltip: void 0,
|
|
3876
|
+
isLoading: false
|
|
3853
3877
|
});
|
|
3854
3878
|
}
|
|
3855
3879
|
/** Gets the node's current state */
|
|
@@ -3909,7 +3933,7 @@ function VariableNodeComponent({
|
|
|
3909
3933
|
}) {
|
|
3910
3934
|
const [editor] = (0, import_LexicalComposerContext3.useLexicalComposerContext)();
|
|
3911
3935
|
const [isSelected, setSelected, clearSelection] = (0, import_useLexicalNodeSelection.useLexicalNodeSelection)(nodeKey);
|
|
3912
|
-
const onDelete = (0,
|
|
3936
|
+
const onDelete = (0, import_react38.useCallback)(
|
|
3913
3937
|
(event) => {
|
|
3914
3938
|
if (isSelected && (0, import_lexical4.$isNodeSelection)((0, import_lexical4.$getSelection)())) {
|
|
3915
3939
|
event.preventDefault();
|
|
@@ -3922,7 +3946,7 @@ function VariableNodeComponent({
|
|
|
3922
3946
|
},
|
|
3923
3947
|
[isSelected, nodeKey]
|
|
3924
3948
|
);
|
|
3925
|
-
(0,
|
|
3949
|
+
(0, import_react38.useEffect)(() => {
|
|
3926
3950
|
return (0, import_utils.mergeRegister)(
|
|
3927
3951
|
editor.registerCommand(import_lexical4.KEY_DELETE_COMMAND, onDelete, import_lexical4.COMMAND_PRIORITY_LOW),
|
|
3928
3952
|
editor.registerCommand(import_lexical4.KEY_BACKSPACE_COMMAND, onDelete, import_lexical4.COMMAND_PRIORITY_LOW),
|
|
@@ -3990,6 +4014,7 @@ function VariableNodeComponent({
|
|
|
3990
4014
|
{
|
|
3991
4015
|
...state,
|
|
3992
4016
|
reference,
|
|
4017
|
+
displayName: state.isLoading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_design_system18.LoadingIndicator, { size: "sm" }) : state.displayName,
|
|
3993
4018
|
selected: isSelected,
|
|
3994
4019
|
onClick: state.hasClickEvent ? () => {
|
|
3995
4020
|
setSelected(!isSelected);
|
|
@@ -4007,8 +4032,8 @@ function $isTargetWithinDecorator(target) {
|
|
|
4007
4032
|
}
|
|
4008
4033
|
|
|
4009
4034
|
// src/components/Variables/InputVariables.tsx
|
|
4010
|
-
var
|
|
4011
|
-
var
|
|
4035
|
+
var import_design_system20 = require("@uniformdev/design-system");
|
|
4036
|
+
var import_react48 = require("react");
|
|
4012
4037
|
var import_uuid2 = require("uuid");
|
|
4013
4038
|
|
|
4014
4039
|
// src/components/Variables/composer/EditorRefPlugin.tsx
|
|
@@ -4028,10 +4053,10 @@ function EditorRefPlugin({
|
|
|
4028
4053
|
// src/components/Variables/composer/PasteTransformerPlugin.tsx
|
|
4029
4054
|
var import_LexicalComposerContext5 = require("@lexical/react/LexicalComposerContext");
|
|
4030
4055
|
var import_lexical5 = require("lexical");
|
|
4031
|
-
var
|
|
4056
|
+
var import_react39 = require("react");
|
|
4032
4057
|
function PasteTransformerPlugin({ transformPaste }) {
|
|
4033
4058
|
const [editor] = (0, import_LexicalComposerContext5.useLexicalComposerContext)();
|
|
4034
|
-
(0,
|
|
4059
|
+
(0, import_react39.useEffect)(() => {
|
|
4035
4060
|
editor.registerCommand(
|
|
4036
4061
|
import_lexical5.PASTE_COMMAND,
|
|
4037
4062
|
(event) => {
|
|
@@ -4054,17 +4079,17 @@ function PasteTransformerPlugin({ transformPaste }) {
|
|
|
4054
4079
|
}
|
|
4055
4080
|
|
|
4056
4081
|
// src/components/Variables/styles/InputVariables.styles.ts
|
|
4057
|
-
var
|
|
4058
|
-
var menuContainer =
|
|
4082
|
+
var import_react40 = require("@emotion/react");
|
|
4083
|
+
var menuContainer = import_react40.css`
|
|
4059
4084
|
position: relative;
|
|
4060
4085
|
`;
|
|
4061
|
-
var menuBtn2 =
|
|
4086
|
+
var menuBtn2 = import_react40.css`
|
|
4062
4087
|
position: absolute;
|
|
4063
4088
|
top: 50%;
|
|
4064
4089
|
right: var(--spacing-sm);
|
|
4065
4090
|
transform: translateY(-50%);
|
|
4066
4091
|
`;
|
|
4067
|
-
var input =
|
|
4092
|
+
var input = import_react40.css`
|
|
4068
4093
|
appearance: none;
|
|
4069
4094
|
background-color: var(--white);
|
|
4070
4095
|
border: 1px solid var(--gray-400);
|
|
@@ -4100,8 +4125,8 @@ var input = import_react39.css`
|
|
|
4100
4125
|
`;
|
|
4101
4126
|
|
|
4102
4127
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
4103
|
-
var
|
|
4104
|
-
var
|
|
4128
|
+
var React10 = __toESM(require("react"));
|
|
4129
|
+
var import_react41 = require("react");
|
|
4105
4130
|
|
|
4106
4131
|
// src/components/Variables/util/hasReferencedVariables.ts
|
|
4107
4132
|
var import_canvas4 = require("@uniformdev/canvas");
|
|
@@ -4131,14 +4156,14 @@ function useInputVariablesState({
|
|
|
4131
4156
|
}) {
|
|
4132
4157
|
const { variables } = useVariables(true);
|
|
4133
4158
|
const hasVariablesInValue = hasReferencedVariables(value != null ? value : "");
|
|
4134
|
-
const [lastKnownId] =
|
|
4135
|
-
const [hadVariablesInValue, setHadVariablesInValue] =
|
|
4136
|
-
|
|
4159
|
+
const [lastKnownId] = React10.useState(id);
|
|
4160
|
+
const [hadVariablesInValue, setHadVariablesInValue] = React10.useState(hasVariablesInValue);
|
|
4161
|
+
React10.useEffect(() => {
|
|
4137
4162
|
if (hasVariablesInValue) {
|
|
4138
4163
|
setHadVariablesInValue(true);
|
|
4139
4164
|
}
|
|
4140
4165
|
}, [hasVariablesInValue]);
|
|
4141
|
-
|
|
4166
|
+
React10.useEffect(() => {
|
|
4142
4167
|
if (id !== lastKnownId) {
|
|
4143
4168
|
setHadVariablesInValue(hasVariablesInValue);
|
|
4144
4169
|
}
|
|
@@ -4146,7 +4171,7 @@ function useInputVariablesState({
|
|
|
4146
4171
|
const hadVariablesInValueForReals = inputWhenNoVariables ? hadVariablesInValue : hasVariablesInValue;
|
|
4147
4172
|
const disableVariablesForReals = disableVariables || Object.keys(variables).length === 0 && !showAddVariableMenuOption;
|
|
4148
4173
|
const disableResetForReals = !inputWhenNoVariables || !hadVariablesInValueForReals;
|
|
4149
|
-
const sharedMenuProps = (0,
|
|
4174
|
+
const sharedMenuProps = (0, import_react41.useMemo)(
|
|
4150
4175
|
() => ({
|
|
4151
4176
|
menuTooltip,
|
|
4152
4177
|
showAddVariableMenuOption,
|
|
@@ -4176,15 +4201,15 @@ function useInputVariablesState({
|
|
|
4176
4201
|
}
|
|
4177
4202
|
|
|
4178
4203
|
// src/components/Variables/toolbox/VariableField.styles.ts
|
|
4179
|
-
var
|
|
4180
|
-
var labelText =
|
|
4204
|
+
var import_react42 = require("@emotion/react");
|
|
4205
|
+
var labelText = import_react42.css`
|
|
4181
4206
|
align-items: center;
|
|
4182
4207
|
display: flex;
|
|
4183
4208
|
gap: var(--spacing-xs);
|
|
4184
4209
|
font-weight: var(--fw-regular);
|
|
4185
4210
|
margin: 0 0 var(--spacing-xs);
|
|
4186
4211
|
`;
|
|
4187
|
-
var variableBindButton =
|
|
4212
|
+
var variableBindButton = import_react42.css`
|
|
4188
4213
|
align-items: center;
|
|
4189
4214
|
border: none;
|
|
4190
4215
|
border-radius: var(--rounded-base);
|
|
@@ -4215,8 +4240,8 @@ var import_lexical6 = require("lexical");
|
|
|
4215
4240
|
// src/components/Variables/toolbox/SelectVariableMenu.tsx
|
|
4216
4241
|
var import_BsFillPlusCircleFill = require("@react-icons/all-files/bs/BsFillPlusCircleFill");
|
|
4217
4242
|
var import_CgUsbC = require("@react-icons/all-files/cg/CgUsbC");
|
|
4218
|
-
var
|
|
4219
|
-
var
|
|
4243
|
+
var import_design_system19 = require("@uniformdev/design-system");
|
|
4244
|
+
var import_react43 = require("react");
|
|
4220
4245
|
var import_jsx_runtime34 = require("@emotion/react/jsx-runtime");
|
|
4221
4246
|
function SelectVariableMenu({
|
|
4222
4247
|
onSelectVariable,
|
|
@@ -4230,12 +4255,12 @@ function SelectVariableMenu({
|
|
|
4230
4255
|
filterVariable
|
|
4231
4256
|
}) {
|
|
4232
4257
|
const { variables, dispatch, isEditing, canDispatch, readOnly } = useVariables(true);
|
|
4233
|
-
const btnRef = (0,
|
|
4234
|
-
const [openedAdd, setOpenedAdd] = (0,
|
|
4258
|
+
const btnRef = (0, import_react43.useRef)(null);
|
|
4259
|
+
const [openedAdd, setOpenedAdd] = (0, import_react43.useState)(false);
|
|
4235
4260
|
useOnVariableUpdated(({ name, latestValue }) => {
|
|
4236
4261
|
onSelectVariable == null ? void 0 : onSelectVariable({ ...latestValue[name], name });
|
|
4237
4262
|
}, !openedAdd);
|
|
4238
|
-
(0,
|
|
4263
|
+
(0, import_react43.useEffect)(() => {
|
|
4239
4264
|
if (openedAdd && !isEditing) {
|
|
4240
4265
|
setOpenedAdd(false);
|
|
4241
4266
|
}
|
|
@@ -4247,7 +4272,7 @@ function SelectVariableMenu({
|
|
|
4247
4272
|
return null;
|
|
4248
4273
|
}
|
|
4249
4274
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
4250
|
-
|
|
4275
|
+
import_design_system19.Menu,
|
|
4251
4276
|
{
|
|
4252
4277
|
placement: "bottom-start",
|
|
4253
4278
|
withoutPortal: true,
|
|
@@ -4266,26 +4291,26 @@ function SelectVariableMenu({
|
|
|
4266
4291
|
menuLabel: menuTooltip,
|
|
4267
4292
|
children: [
|
|
4268
4293
|
showAddVariableMenuOptionForReals ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4269
|
-
|
|
4294
|
+
import_design_system19.MenuItem,
|
|
4270
4295
|
{
|
|
4271
4296
|
onClick: () => {
|
|
4272
4297
|
setOpenedAdd(true);
|
|
4273
4298
|
dispatch({ type: "edit", variable: "", context: getEditorContext == null ? void 0 : getEditorContext() });
|
|
4274
4299
|
},
|
|
4275
4300
|
"data-testid": "add-variable-button",
|
|
4276
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
4301
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_design_system19.HorizontalRhythm, { gap: "sm", align: "center", children: [
|
|
4277
4302
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_BsFillPlusCircleFill.BsFillPlusCircleFill, { fill: "var(--gray-500)", size: "1.25em" }),
|
|
4278
4303
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: typeof showAddVariableMenuOption === "string" ? showAddVariableMenuOption : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_jsx_runtime34.Fragment, { children: "Add\u2026" }) })
|
|
4279
4304
|
] })
|
|
4280
4305
|
}
|
|
4281
4306
|
) : null,
|
|
4282
|
-
showAddVariableMenuOptionForReals && menuHasVariableOptions ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4307
|
+
showAddVariableMenuOptionForReals && menuHasVariableOptions ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system19.MenuItemSeparator, {}) : null,
|
|
4283
4308
|
variablesGroups.map((group) => {
|
|
4284
4309
|
var _a;
|
|
4285
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system19.MenuGroup, { title: (_a = group.name) != null ? _a : "", children: group.variables.map((variable) => {
|
|
4286
4311
|
const { name, displayName, helpText } = variable;
|
|
4287
4312
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
4288
|
-
|
|
4313
|
+
import_design_system19.MenuItem,
|
|
4289
4314
|
{
|
|
4290
4315
|
id: name,
|
|
4291
4316
|
css: menuItemTextGroup,
|
|
@@ -4299,9 +4324,9 @@ function SelectVariableMenu({
|
|
|
4299
4324
|
);
|
|
4300
4325
|
}) }, group.name);
|
|
4301
4326
|
}),
|
|
4302
|
-
menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4303
|
-
onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4304
|
-
tip && (menuHasVariableOptions || onResetVariables) ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4327
|
+
menuHasVariableOptions && onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system19.MenuItemSeparator, {}) : null,
|
|
4328
|
+
onResetVariables ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system19.MenuItem, { onClick: onResetVariables, css: { color: "var(--brand-secondary-5)" }, children: "Reset" }) : null,
|
|
4329
|
+
tip && (menuHasVariableOptions || onResetVariables) ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_design_system19.MenuItemSeparator, {}) : null,
|
|
4305
4330
|
tip ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("i", { css: variablesTipText, children: tip }) : null
|
|
4306
4331
|
]
|
|
4307
4332
|
}
|
|
@@ -4369,14 +4394,14 @@ var import_LexicalAutoFocusPlugin = require("@lexical/react/LexicalAutoFocusPlug
|
|
|
4369
4394
|
var import_LexicalClearEditorPlugin = require("@lexical/react/LexicalClearEditorPlugin");
|
|
4370
4395
|
var import_LexicalComposer = require("@lexical/react/LexicalComposer");
|
|
4371
4396
|
var import_LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin");
|
|
4372
|
-
var
|
|
4397
|
+
var import_react46 = require("react");
|
|
4373
4398
|
|
|
4374
4399
|
// src/components/Variables/composer/DisablePlugin.tsx
|
|
4375
4400
|
var import_LexicalComposerContext7 = require("@lexical/react/LexicalComposerContext");
|
|
4376
|
-
var
|
|
4401
|
+
var import_react44 = require("react");
|
|
4377
4402
|
function DisablePlugin({ disabled }) {
|
|
4378
4403
|
const [editor] = (0, import_LexicalComposerContext7.useLexicalComposerContext)();
|
|
4379
|
-
(0,
|
|
4404
|
+
(0, import_react44.useEffect)(() => {
|
|
4380
4405
|
editor.setEditable(!disabled);
|
|
4381
4406
|
}, [editor, disabled]);
|
|
4382
4407
|
return null;
|
|
@@ -4385,10 +4410,10 @@ function DisablePlugin({ disabled }) {
|
|
|
4385
4410
|
// src/components/Variables/composer/SingleLineTextPlugin.tsx
|
|
4386
4411
|
var import_LexicalComposerContext8 = require("@lexical/react/LexicalComposerContext");
|
|
4387
4412
|
var import_lexical7 = require("lexical");
|
|
4388
|
-
var
|
|
4413
|
+
var import_react45 = require("react");
|
|
4389
4414
|
function SingleLineTextPlugin() {
|
|
4390
4415
|
const [editor] = (0, import_LexicalComposerContext8.useLexicalComposerContext)();
|
|
4391
|
-
(0,
|
|
4416
|
+
(0, import_react45.useEffect)(() => {
|
|
4392
4417
|
editor.registerNodeTransform(import_lexical7.LineBreakNode, (node) => {
|
|
4393
4418
|
node.remove();
|
|
4394
4419
|
});
|
|
@@ -4441,8 +4466,8 @@ function VariablesComposer(props) {
|
|
|
4441
4466
|
autoFocus,
|
|
4442
4467
|
...variablesPluginProps
|
|
4443
4468
|
} = props;
|
|
4444
|
-
const [lastEmittedValue, setLastEmittedValue] = (0,
|
|
4445
|
-
const editorConfig = (0,
|
|
4469
|
+
const [lastEmittedValue, setLastEmittedValue] = (0, import_react46.useState)(value);
|
|
4470
|
+
const editorConfig = (0, import_react46.useMemo)(
|
|
4446
4471
|
() => ({
|
|
4447
4472
|
namespace: "uniform",
|
|
4448
4473
|
onError(error) {
|
|
@@ -4454,8 +4479,8 @@ function VariablesComposer(props) {
|
|
|
4454
4479
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4455
4480
|
[]
|
|
4456
4481
|
);
|
|
4457
|
-
const editorState = (0,
|
|
4458
|
-
const updateTimeout = (0,
|
|
4482
|
+
const editorState = (0, import_react46.useRef)();
|
|
4483
|
+
const updateTimeout = (0, import_react46.useRef)();
|
|
4459
4484
|
if (typeof document === "undefined")
|
|
4460
4485
|
return null;
|
|
4461
4486
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_LexicalComposer.LexicalComposer, { initialConfig: editorConfig, children: [
|
|
@@ -4497,7 +4522,7 @@ var import_LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin")
|
|
|
4497
4522
|
var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
|
|
4498
4523
|
var import_utils2 = require("@lexical/utils");
|
|
4499
4524
|
var import_lexical9 = require("lexical");
|
|
4500
|
-
var
|
|
4525
|
+
var import_react47 = require("react");
|
|
4501
4526
|
var import_jsx_runtime38 = require("@emotion/react/jsx-runtime");
|
|
4502
4527
|
function VariablesComposerInput({ css: css37, ...contentEditableProps }) {
|
|
4503
4528
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
|
|
@@ -4515,7 +4540,7 @@ function VariablesComposerInput({ css: css37, ...contentEditableProps }) {
|
|
|
4515
4540
|
}
|
|
4516
4541
|
function RichishCopyAndPastePlugin() {
|
|
4517
4542
|
const [editor] = (0, import_LexicalComposerContext9.useLexicalComposerContext)();
|
|
4518
|
-
(0,
|
|
4543
|
+
(0, import_react47.useEffect)(() => {
|
|
4519
4544
|
editor.registerCommand(
|
|
4520
4545
|
import_lexical9.COPY_COMMAND,
|
|
4521
4546
|
(event) => {
|
|
@@ -4607,7 +4632,7 @@ function InputVariables(props) {
|
|
|
4607
4632
|
editorRef,
|
|
4608
4633
|
filterVariable
|
|
4609
4634
|
} = props;
|
|
4610
|
-
const [finalId] = (0,
|
|
4635
|
+
const [finalId] = (0, import_react48.useState)(id != null ? id : () => (0, import_uuid2.v4)());
|
|
4611
4636
|
const { dispatch, canDispatch, isEditing } = useVariables(true);
|
|
4612
4637
|
const { disableVariablesForReals, hadVariablesInValue, sharedMenuProps } = useInputVariablesState(props);
|
|
4613
4638
|
const disableInlineVariablesForReals = disableVariablesForReals || disableInlineMenu;
|
|
@@ -4640,10 +4665,10 @@ function InputVariables(props) {
|
|
|
4640
4665
|
)
|
|
4641
4666
|
}
|
|
4642
4667
|
),
|
|
4643
|
-
caption ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4644
|
-
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4645
|
-
warningMessage ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4646
|
-
infoMessage ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4668
|
+
caption ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.Caption, { children: caption }) : null,
|
|
4669
|
+
errorMessage ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.ErrorMessage, { message: errorMessage }) : null,
|
|
4670
|
+
warningMessage ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.WarningMessage, { message: warningMessage }) : null,
|
|
4671
|
+
infoMessage ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system20.InfoMessage, { message: infoMessage }) : null
|
|
4647
4672
|
]
|
|
4648
4673
|
}
|
|
4649
4674
|
);
|
|
@@ -4712,12 +4737,12 @@ function InputVariablesOverlayMenu({
|
|
|
4712
4737
|
// src/components/Variables/ParameterConnectionIndicator.tsx
|
|
4713
4738
|
var import_CgUsbC2 = require("@react-icons/all-files/cg/CgUsbC");
|
|
4714
4739
|
var import_canvas6 = require("@uniformdev/canvas");
|
|
4715
|
-
var
|
|
4716
|
-
var
|
|
4740
|
+
var import_design_system21 = require("@uniformdev/design-system");
|
|
4741
|
+
var import_react50 = require("react");
|
|
4717
4742
|
|
|
4718
4743
|
// src/components/Variables/styles/ParameterVariables.styles.ts
|
|
4719
|
-
var
|
|
4720
|
-
var variableBindButton2 =
|
|
4744
|
+
var import_react49 = require("@emotion/react");
|
|
4745
|
+
var variableBindButton2 = import_react49.css`
|
|
4721
4746
|
align-items: center;
|
|
4722
4747
|
border: none;
|
|
4723
4748
|
border-radius: var(--rounded-base);
|
|
@@ -4746,7 +4771,7 @@ var variableBindButton2 = import_react48.css`
|
|
|
4746
4771
|
max-height: unset;
|
|
4747
4772
|
}
|
|
4748
4773
|
`;
|
|
4749
|
-
var input2 =
|
|
4774
|
+
var input2 = import_react49.css`
|
|
4750
4775
|
display: block;
|
|
4751
4776
|
appearance: none;
|
|
4752
4777
|
box-sizing: border-box;
|
|
@@ -4795,7 +4820,7 @@ var input2 = import_react48.css`
|
|
|
4795
4820
|
margin: 0;
|
|
4796
4821
|
}
|
|
4797
4822
|
`;
|
|
4798
|
-
var inputMultiLine = (lines) =>
|
|
4823
|
+
var inputMultiLine = (lines) => import_react49.css`
|
|
4799
4824
|
// 1.5 = line height, spacing-md = top and bottom padding
|
|
4800
4825
|
height: calc(${lines * 1.5}em + var(--spacing-md));
|
|
4801
4826
|
resize: vertical;
|
|
@@ -4811,7 +4836,7 @@ function ParameterConnectionIndicator({
|
|
|
4811
4836
|
disabled,
|
|
4812
4837
|
menuTooltip = "Insert variable"
|
|
4813
4838
|
}) {
|
|
4814
|
-
const hasVariablesInValue = (0,
|
|
4839
|
+
const hasVariablesInValue = (0, import_react50.useMemo)(() => {
|
|
4815
4840
|
let result = false;
|
|
4816
4841
|
(0, import_canvas6.bindVariablesToObject)({
|
|
4817
4842
|
value,
|
|
@@ -4822,10 +4847,10 @@ function ParameterConnectionIndicator({
|
|
|
4822
4847
|
});
|
|
4823
4848
|
return result;
|
|
4824
4849
|
}, [value]);
|
|
4825
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
4850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_design_system21.HorizontalRhythm, { align: "center", gap: "xs", css: { width: "100%" }, children: [
|
|
4826
4851
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { css: { flex: 1 }, children }),
|
|
4827
4852
|
disabled ? null : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4828
|
-
|
|
4853
|
+
import_design_system21.Menu,
|
|
4829
4854
|
{
|
|
4830
4855
|
placement: "bottom-start",
|
|
4831
4856
|
withoutPortal: true,
|
|
@@ -4847,7 +4872,7 @@ function ParameterConnectionIndicator({
|
|
|
4847
4872
|
}
|
|
4848
4873
|
|
|
4849
4874
|
// src/components/Variables/ParameterOrSingleVariable.tsx
|
|
4850
|
-
var
|
|
4875
|
+
var import_design_system22 = require("@uniformdev/design-system");
|
|
4851
4876
|
var import_jsx_runtime41 = require("@emotion/react/jsx-runtime");
|
|
4852
4877
|
function ParameterOrSingleVariable(props) {
|
|
4853
4878
|
const {
|
|
@@ -4876,7 +4901,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
4876
4901
|
children: [
|
|
4877
4902
|
editorRef ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(EditorRefPlugin, { editorRef }) : null,
|
|
4878
4903
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ControlledValuePlugin, { enabled: true, value }),
|
|
4879
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
4904
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_design_system22.HorizontalRhythm, { align: "center", gap: "xs", css: { width: "100%" }, children: [
|
|
4880
4905
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { css: { flex: 1 }, children: inputWhenNoVariables && !hadVariablesInValue ? inputWhenNoVariables : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4881
4906
|
VariablesComposerInput,
|
|
4882
4907
|
{
|
|
@@ -4903,8 +4928,8 @@ function ParameterOrSingleVariable(props) {
|
|
|
4903
4928
|
}
|
|
4904
4929
|
|
|
4905
4930
|
// src/components/Variables/ParameterVariables.tsx
|
|
4906
|
-
var
|
|
4907
|
-
var
|
|
4931
|
+
var import_react51 = require("@emotion/react");
|
|
4932
|
+
var import_design_system23 = require("@uniformdev/design-system");
|
|
4908
4933
|
var import_jsx_runtime42 = require("@emotion/react/jsx-runtime");
|
|
4909
4934
|
function ParameterVariables(props) {
|
|
4910
4935
|
const {
|
|
@@ -4942,7 +4967,7 @@ function ParameterVariables(props) {
|
|
|
4942
4967
|
editorRef ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(EditorRefPlugin, { editorRef }) : null,
|
|
4943
4968
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ControlledValuePlugin, { value, enabled: useInputWhenNoVariables }),
|
|
4944
4969
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4945
|
-
|
|
4970
|
+
import_design_system23.HorizontalRhythm,
|
|
4946
4971
|
{
|
|
4947
4972
|
align: "center",
|
|
4948
4973
|
gap: "xs",
|
|
@@ -4961,7 +4986,7 @@ function ParameterVariables(props) {
|
|
|
4961
4986
|
"data-text-value": value,
|
|
4962
4987
|
css: [
|
|
4963
4988
|
input2,
|
|
4964
|
-
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(4) :
|
|
4989
|
+
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(4) : import_react51.css``
|
|
4965
4990
|
]
|
|
4966
4991
|
}
|
|
4967
4992
|
) }),
|
|
@@ -5011,13 +5036,13 @@ function variableDefaultTextValue(defaultValue) {
|
|
|
5011
5036
|
}
|
|
5012
5037
|
|
|
5013
5038
|
// src/components/Variables/VariablesList.tsx
|
|
5014
|
-
var
|
|
5015
|
-
var
|
|
5039
|
+
var import_react53 = require("@emotion/react");
|
|
5040
|
+
var import_design_system24 = require("@uniformdev/design-system");
|
|
5016
5041
|
var import_react_beautiful_dnd2 = require("react-beautiful-dnd");
|
|
5017
5042
|
|
|
5018
5043
|
// src/components/Variables/styles/VariablesList.styles.ts
|
|
5019
|
-
var
|
|
5020
|
-
var tableRow = (isDragging) =>
|
|
5044
|
+
var import_react52 = require("@emotion/react");
|
|
5045
|
+
var tableRow = (isDragging) => import_react52.css`
|
|
5021
5046
|
position: relative;
|
|
5022
5047
|
${isDragging ? `
|
|
5023
5048
|
display: table;
|
|
@@ -5025,7 +5050,7 @@ var tableRow = (isDragging) => import_react51.css`
|
|
|
5025
5050
|
top: auto !important;
|
|
5026
5051
|
` : void 0}
|
|
5027
5052
|
`;
|
|
5028
|
-
var tableCellDragIcon =
|
|
5053
|
+
var tableCellDragIcon = import_react52.css`
|
|
5029
5054
|
&::after {
|
|
5030
5055
|
content: '';
|
|
5031
5056
|
display: block;
|
|
@@ -5043,7 +5068,7 @@ var tableCellDragIcon = import_react51.css`
|
|
|
5043
5068
|
opacity: 1;
|
|
5044
5069
|
}
|
|
5045
5070
|
`;
|
|
5046
|
-
var variableName =
|
|
5071
|
+
var variableName = import_react52.css`
|
|
5047
5072
|
border: none;
|
|
5048
5073
|
color: var(--brand-secondary-5);
|
|
5049
5074
|
font-weight: var(--fw-medium);
|
|
@@ -5054,7 +5079,7 @@ var variableName = import_react51.css`
|
|
|
5054
5079
|
white-space: nowrap;
|
|
5055
5080
|
max-width: 20ch;
|
|
5056
5081
|
`;
|
|
5057
|
-
var variableValue =
|
|
5082
|
+
var variableValue = import_react52.css`
|
|
5058
5083
|
overflow: hidden;
|
|
5059
5084
|
text-overflow: ellipsis;
|
|
5060
5085
|
white-space: nowrap;
|
|
@@ -5084,13 +5109,13 @@ function VariablesList() {
|
|
|
5084
5109
|
}
|
|
5085
5110
|
};
|
|
5086
5111
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
5087
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react_beautiful_dnd2.DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react_beautiful_dnd2.Droppable, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
5088
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5089
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5090
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5091
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5112
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react_beautiful_dnd2.DragDropContext, { onDragEnd: (res) => onDragEnd(res), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react_beautiful_dnd2.Droppable, { droppableId: "variables-table", children: (provided) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_design_system24.Table, { ...provided.droppableProps, ref: provided.innerRef, children: [
|
|
5113
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system24.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_design_system24.TableRow, { children: [
|
|
5114
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system24.TableCellHead, { children: "Name" }),
|
|
5115
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system24.TableCellHead, { children: "Default Value" }),
|
|
5116
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system24.TableCellHead, {})
|
|
5092
5117
|
] }) }),
|
|
5093
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
5118
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_design_system24.TableBody, { children: [
|
|
5094
5119
|
sorted.map(({ name, displayName, default: defaultValue, readOnly }, index) => {
|
|
5095
5120
|
const text = displayName != null ? displayName : name;
|
|
5096
5121
|
const textValue = variableDefaultTextValue(defaultValue);
|
|
@@ -5101,7 +5126,7 @@ function VariablesList() {
|
|
|
5101
5126
|
index,
|
|
5102
5127
|
isDragDisabled: sorted.length === 1,
|
|
5103
5128
|
children: (provided2, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
5104
|
-
|
|
5129
|
+
import_design_system24.TableRow,
|
|
5105
5130
|
{
|
|
5106
5131
|
ref: provided2.innerRef,
|
|
5107
5132
|
...provided2.dragHandleProps,
|
|
@@ -5110,7 +5135,7 @@ function VariablesList() {
|
|
|
5110
5135
|
css: tableRow(snapshot.isDragging),
|
|
5111
5136
|
"data-dragging": snapshot.isDragging,
|
|
5112
5137
|
children: [
|
|
5113
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5138
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system24.TableCellData, { css: sorted.length > 1 ? tableCellDragIcon : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5114
5139
|
"button",
|
|
5115
5140
|
{
|
|
5116
5141
|
css: variableName,
|
|
@@ -5123,21 +5148,21 @@ function VariablesList() {
|
|
|
5123
5148
|
children: text
|
|
5124
5149
|
}
|
|
5125
5150
|
) }),
|
|
5126
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5127
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5151
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system24.TableCellData, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { css: variableValue, title: textValue, children: textValue }) }),
|
|
5152
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system24.TableCellData, { align: "right", children: readOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5128
5153
|
"button",
|
|
5129
5154
|
{
|
|
5130
5155
|
type: "button",
|
|
5131
5156
|
title: `delete ${text}`,
|
|
5132
5157
|
css: [
|
|
5133
|
-
|
|
5134
|
-
|
|
5158
|
+
import_design_system24.button,
|
|
5159
|
+
import_react53.css`
|
|
5135
5160
|
background: transparent;
|
|
5136
5161
|
`
|
|
5137
5162
|
],
|
|
5138
5163
|
"aria-controls": text,
|
|
5139
5164
|
onClick: () => dispatch({ type: "remove", variable: name }),
|
|
5140
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5165
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system24.Icon, { icon: "trash", iconColor: "red" })
|
|
5141
5166
|
}
|
|
5142
5167
|
) })
|
|
5143
5168
|
]
|
|
@@ -5151,7 +5176,7 @@ function VariablesList() {
|
|
|
5151
5176
|
] })
|
|
5152
5177
|
] }) }) }),
|
|
5153
5178
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5154
|
-
|
|
5179
|
+
import_design_system24.AddListButton,
|
|
5155
5180
|
{
|
|
5156
5181
|
onButtonClick: () => dispatch({ type: "edit", variable: "" }),
|
|
5157
5182
|
"aria-label": "Add variable",
|
|
@@ -5187,7 +5212,7 @@ function DataResourceDynamicInputProviderRenderer({
|
|
|
5187
5212
|
}
|
|
5188
5213
|
|
|
5189
5214
|
// src/components/DataResourceVariablesList.tsx
|
|
5190
|
-
var
|
|
5215
|
+
var import_design_system25 = require("@uniformdev/design-system");
|
|
5191
5216
|
var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
|
|
5192
5217
|
function DataResourceVariablesList(props) {
|
|
5193
5218
|
const {
|
|
@@ -5217,9 +5242,9 @@ function DataResourceVariablesListExplicit({
|
|
|
5217
5242
|
if (NoVariablesComponent) {
|
|
5218
5243
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NoVariablesComponent, {});
|
|
5219
5244
|
}
|
|
5220
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system25.Callout, { type: "note", children: "No settings are required." });
|
|
5221
5246
|
}
|
|
5222
|
-
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DataResourceDynamicInputProvider, { dynamicInputs, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DataResourceDynamicInputProvider, { dynamicInputs, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_design_system25.VerticalRhythm, { children: variableDefinitions.map((variableDefinition) => {
|
|
5223
5248
|
var _a, _b, _c;
|
|
5224
5249
|
const VariableRenderer = variableDefinition.type ? (_a = typeRenderers == null ? void 0 : typeRenderers[variableDefinition.type]) != null ? _a : TextVariableRenderer : TextVariableRenderer;
|
|
5225
5250
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
@@ -5258,16 +5283,16 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
5258
5283
|
}
|
|
5259
5284
|
|
|
5260
5285
|
// src/components/Request/RequestBody.tsx
|
|
5261
|
-
var
|
|
5262
|
-
var
|
|
5263
|
-
var
|
|
5286
|
+
var import_react55 = require("@emotion/react");
|
|
5287
|
+
var import_design_system26 = require("@uniformdev/design-system");
|
|
5288
|
+
var import_react56 = require("react");
|
|
5264
5289
|
|
|
5265
5290
|
// src/components/Request/RequestProvider.tsx
|
|
5266
|
-
var
|
|
5291
|
+
var React11 = __toESM(require("react"));
|
|
5267
5292
|
var import_jsx_runtime46 = require("@emotion/react/jsx-runtime");
|
|
5268
|
-
var RequestContext =
|
|
5293
|
+
var RequestContext = React11.createContext(null);
|
|
5269
5294
|
function RequestProvider({ value, onChange, children }) {
|
|
5270
|
-
const contextValue =
|
|
5295
|
+
const contextValue = React11.useMemo(() => {
|
|
5271
5296
|
return {
|
|
5272
5297
|
dispatch: (event) => {
|
|
5273
5298
|
if (event.type === "setRelativeUrl") {
|
|
@@ -5336,7 +5361,7 @@ function RequestProvider({ value, onChange, children }) {
|
|
|
5336
5361
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RequestContext.Provider, { value: contextValue, children });
|
|
5337
5362
|
}
|
|
5338
5363
|
function useRequest() {
|
|
5339
|
-
const context =
|
|
5364
|
+
const context = React11.useContext(RequestContext);
|
|
5340
5365
|
if (!context) {
|
|
5341
5366
|
throw new Error("No RequestProvider present");
|
|
5342
5367
|
}
|
|
@@ -5344,11 +5369,11 @@ function useRequest() {
|
|
|
5344
5369
|
}
|
|
5345
5370
|
|
|
5346
5371
|
// src/components/Request/styles/Request.styles.ts
|
|
5347
|
-
var
|
|
5348
|
-
var innerContentStyles =
|
|
5372
|
+
var import_react54 = require("@emotion/react");
|
|
5373
|
+
var innerContentStyles = import_react54.css`
|
|
5349
5374
|
background: var(--white);
|
|
5350
5375
|
`;
|
|
5351
|
-
var requestTypeContainer = (bgColor) =>
|
|
5376
|
+
var requestTypeContainer = (bgColor) => import_react54.css`
|
|
5352
5377
|
align-items: start;
|
|
5353
5378
|
background: ${bgColor};
|
|
5354
5379
|
display: grid;
|
|
@@ -5386,11 +5411,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
|
|
|
5386
5411
|
};
|
|
5387
5412
|
function RequestBody() {
|
|
5388
5413
|
const { request, dispatch } = useRequest();
|
|
5389
|
-
const [language, setLanguage] = (0,
|
|
5414
|
+
const [language, setLanguage] = (0, import_react56.useState)("json");
|
|
5390
5415
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
5391
5416
|
"div",
|
|
5392
5417
|
{
|
|
5393
|
-
css:
|
|
5418
|
+
css: import_react55.css`
|
|
5394
5419
|
background: var(--white);
|
|
5395
5420
|
`,
|
|
5396
5421
|
children: [
|
|
@@ -5398,11 +5423,11 @@ function RequestBody() {
|
|
|
5398
5423
|
RequestTypeContainer,
|
|
5399
5424
|
{
|
|
5400
5425
|
bgColor: "var(--gray-100)",
|
|
5401
|
-
css:
|
|
5426
|
+
css: import_react55.css`
|
|
5402
5427
|
padding: var(--spacing-sm) var(--spacing-base);
|
|
5403
5428
|
`,
|
|
5404
5429
|
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5405
|
-
|
|
5430
|
+
import_design_system26.InputSelect,
|
|
5406
5431
|
{
|
|
5407
5432
|
label: "Language",
|
|
5408
5433
|
showLabel: false,
|
|
@@ -5425,7 +5450,7 @@ function RequestBody() {
|
|
|
5425
5450
|
}
|
|
5426
5451
|
),
|
|
5427
5452
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5428
|
-
|
|
5453
|
+
import_design_system26.JsonEditor,
|
|
5429
5454
|
{
|
|
5430
5455
|
height: 200,
|
|
5431
5456
|
defaultValue: request.body,
|
|
@@ -5442,7 +5467,7 @@ function RequestBody() {
|
|
|
5442
5467
|
}
|
|
5443
5468
|
|
|
5444
5469
|
// src/components/Request/RequestHeaders.tsx
|
|
5445
|
-
var
|
|
5470
|
+
var import_design_system27 = require("@uniformdev/design-system");
|
|
5446
5471
|
var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
|
|
5447
5472
|
function RequestHeaders({
|
|
5448
5473
|
disableVariables,
|
|
@@ -5462,30 +5487,30 @@ function RequestHeaders({
|
|
|
5462
5487
|
index
|
|
5463
5488
|
});
|
|
5464
5489
|
};
|
|
5465
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5466
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5467
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5468
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5469
|
-
addOmitIfEmpty ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system27.Table, { children: [
|
|
5491
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system27.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system27.TableRow, { children: [
|
|
5492
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system27.TableCellHead, { children: "Name" }),
|
|
5493
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system27.TableCellHead, { children: "Value" }),
|
|
5494
|
+
addOmitIfEmpty ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system27.TableCellHead, { children: "Omit If Empty" }) : null
|
|
5470
5495
|
] }) }),
|
|
5471
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5496
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system27.TableBody, { children: [
|
|
5472
5497
|
(_b = (_a = request.baseRequest) == null ? void 0 : _a.headers) == null ? void 0 : _b.map((baseHeader) => {
|
|
5473
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5474
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system27.TableRow, { children: [
|
|
5499
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system27.TableCellData, { width: "50%", children: [
|
|
5475
5500
|
baseHeader.key,
|
|
5476
5501
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("br", {}),
|
|
5477
5502
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("small", { children: "from data source" }) })
|
|
5478
5503
|
] }),
|
|
5479
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5504
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system27.TableCellData, { width: "50%", children: [
|
|
5480
5505
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseHeader.value }),
|
|
5481
|
-
request.headers.find((p) => p.key === baseHeader.key) ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5506
|
+
request.headers.find((p) => p.key === baseHeader.key) ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system27.WarningMessage, { message: "overridden below" }) : null
|
|
5482
5507
|
] })
|
|
5483
5508
|
] }, baseHeader.key);
|
|
5484
5509
|
}),
|
|
5485
5510
|
deezHeaders.map((header, index) => {
|
|
5486
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5487
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5488
|
-
|
|
5511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system27.TableRow, { children: [
|
|
5512
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system27.TableCellData, { width: "50%", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5513
|
+
import_design_system27.Input,
|
|
5489
5514
|
{
|
|
5490
5515
|
label: header.key,
|
|
5491
5516
|
value: header.key,
|
|
@@ -5504,7 +5529,7 @@ function RequestHeaders({
|
|
|
5504
5529
|
"data-testid": "header-key"
|
|
5505
5530
|
}
|
|
5506
5531
|
) }),
|
|
5507
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5532
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system27.TableCellData, { width: "50%", children: header.key ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5508
5533
|
InputVariables,
|
|
5509
5534
|
{
|
|
5510
5535
|
value: header.value,
|
|
@@ -5515,8 +5540,8 @@ function RequestHeaders({
|
|
|
5515
5540
|
"data-testid": "header-value"
|
|
5516
5541
|
}
|
|
5517
5542
|
) : null }),
|
|
5518
|
-
addOmitIfEmpty ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5519
|
-
|
|
5543
|
+
addOmitIfEmpty ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_design_system27.TableCellData, { width: "50%", children: header.key ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5544
|
+
import_design_system27.Input,
|
|
5520
5545
|
{
|
|
5521
5546
|
type: "checkbox",
|
|
5522
5547
|
checked: header.omitIfEmpty,
|
|
@@ -5539,13 +5564,13 @@ function RequestHeaders({
|
|
|
5539
5564
|
}
|
|
5540
5565
|
|
|
5541
5566
|
// src/components/Request/RequestMethodSelect.tsx
|
|
5542
|
-
var
|
|
5567
|
+
var import_design_system28 = require("@uniformdev/design-system");
|
|
5543
5568
|
var import_jsx_runtime50 = require("@emotion/react/jsx-runtime");
|
|
5544
5569
|
function RequestMethodSelect(props) {
|
|
5545
5570
|
var _a;
|
|
5546
5571
|
const { request, dispatch } = useRequest();
|
|
5547
5572
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5548
|
-
|
|
5573
|
+
import_design_system28.InputSelect,
|
|
5549
5574
|
{
|
|
5550
5575
|
...props,
|
|
5551
5576
|
options: [
|
|
@@ -5560,7 +5585,7 @@ function RequestMethodSelect(props) {
|
|
|
5560
5585
|
}
|
|
5561
5586
|
|
|
5562
5587
|
// src/components/Request/RequestParameters.tsx
|
|
5563
|
-
var
|
|
5588
|
+
var import_design_system29 = require("@uniformdev/design-system");
|
|
5564
5589
|
var import_jsx_runtime51 = require("@emotion/react/jsx-runtime");
|
|
5565
5590
|
function RequestParameters({
|
|
5566
5591
|
disableVariables,
|
|
@@ -5581,30 +5606,30 @@ function RequestParameters({
|
|
|
5581
5606
|
index
|
|
5582
5607
|
});
|
|
5583
5608
|
};
|
|
5584
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5585
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5586
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5587
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5588
|
-
addOmitIfEmpty ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system29.Table, { children: [
|
|
5610
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system29.TableHead, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system29.TableRow, { children: [
|
|
5611
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system29.TableCellHead, { children: "Name" }),
|
|
5612
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system29.TableCellHead, { children: "Value" }),
|
|
5613
|
+
addOmitIfEmpty ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system29.TableCellHead, { children: "Omit If Empty" }) : null
|
|
5589
5614
|
] }) }),
|
|
5590
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5615
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system29.TableBody, { children: [
|
|
5591
5616
|
(_b = (_a = request.baseRequest) == null ? void 0 : _a.parameters) == null ? void 0 : _b.map((baseParameter) => {
|
|
5592
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5593
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system29.TableRow, { children: [
|
|
5618
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system29.TableCellData, { width: "50%", children: [
|
|
5594
5619
|
baseParameter.key,
|
|
5595
5620
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("br", {}),
|
|
5596
5621
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("i", { css: { color: "var(--gray-500)" }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("small", { children: "from data source" }) })
|
|
5597
5622
|
] }),
|
|
5598
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5623
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system29.TableCellData, { width: "50%", children: [
|
|
5599
5624
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseParameter.value }),
|
|
5600
|
-
request.parameters.find((p) => p.key === baseParameter.key) ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5625
|
+
request.parameters.find((p) => p.key === baseParameter.key) ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system29.WarningMessage, { message: "overridden below" }) : null
|
|
5601
5626
|
] })
|
|
5602
5627
|
] }, baseParameter.key);
|
|
5603
5628
|
}),
|
|
5604
5629
|
deezParameters.map((parameter, index) => {
|
|
5605
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5606
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5607
|
-
|
|
5630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system29.TableRow, { children: [
|
|
5631
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system29.TableCellData, { width: "50%", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5632
|
+
import_design_system29.Input,
|
|
5608
5633
|
{
|
|
5609
5634
|
label: parameter.key,
|
|
5610
5635
|
value: parameter.key,
|
|
@@ -5627,7 +5652,7 @@ function RequestParameters({
|
|
|
5627
5652
|
"data-testid": "parameter-key"
|
|
5628
5653
|
}
|
|
5629
5654
|
) }),
|
|
5630
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5655
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system29.TableCellData, { width: "50%", children: parameter.key ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5631
5656
|
InputVariables,
|
|
5632
5657
|
{
|
|
5633
5658
|
value: parameter.value,
|
|
@@ -5643,8 +5668,8 @@ function RequestParameters({
|
|
|
5643
5668
|
enableEditingVariables: true
|
|
5644
5669
|
}
|
|
5645
5670
|
) : null }),
|
|
5646
|
-
addOmitIfEmpty ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5647
|
-
|
|
5671
|
+
addOmitIfEmpty ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_design_system29.TableCellData, { width: "50%", children: parameter.key ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5672
|
+
import_design_system29.Input,
|
|
5648
5673
|
{
|
|
5649
5674
|
type: "checkbox",
|
|
5650
5675
|
checked: parameter.omitIfEmpty,
|
|
@@ -5669,8 +5694,8 @@ function RequestParameters({
|
|
|
5669
5694
|
}
|
|
5670
5695
|
|
|
5671
5696
|
// src/components/Request/RequestUrl.tsx
|
|
5672
|
-
var
|
|
5673
|
-
var
|
|
5697
|
+
var import_react57 = require("@emotion/react");
|
|
5698
|
+
var import_react58 = require("react");
|
|
5674
5699
|
|
|
5675
5700
|
// src/components/Request/urlEncodeRequestParameter.ts
|
|
5676
5701
|
function urlEncodeRequestUrl(url, varValues) {
|
|
@@ -5696,7 +5721,7 @@ function RequestUrl() {
|
|
|
5696
5721
|
var _a, _b;
|
|
5697
5722
|
const { variables } = useVariables();
|
|
5698
5723
|
const { request } = useRequest();
|
|
5699
|
-
const mergedParameters = (0,
|
|
5724
|
+
const mergedParameters = (0, import_react58.useMemo)(() => {
|
|
5700
5725
|
var _a2;
|
|
5701
5726
|
if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
|
|
5702
5727
|
return request.parameters;
|
|
@@ -5706,7 +5731,7 @@ function RequestUrl() {
|
|
|
5706
5731
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
5707
5732
|
"small",
|
|
5708
5733
|
{
|
|
5709
|
-
css:
|
|
5734
|
+
css: import_react57.css`
|
|
5710
5735
|
display: inline-block;
|
|
5711
5736
|
margin-bottom: var(--spacing-xs);
|
|
5712
5737
|
word-break: break-word;
|
|
@@ -5940,16 +5965,16 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
5940
5965
|
}
|
|
5941
5966
|
|
|
5942
5967
|
// src/components/MeshApp.tsx
|
|
5943
|
-
var
|
|
5968
|
+
var import_design_system30 = require("@uniformdev/design-system");
|
|
5944
5969
|
|
|
5945
5970
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
5946
5971
|
var import_mesh_sdk = require("@uniformdev/mesh-sdk");
|
|
5947
|
-
var
|
|
5972
|
+
var import_react59 = require("react");
|
|
5948
5973
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
5949
|
-
const [error, setError] = (0,
|
|
5950
|
-
const [sdk, setSdk] = (0,
|
|
5951
|
-
const initializationInProgress = (0,
|
|
5952
|
-
(0,
|
|
5974
|
+
const [error, setError] = (0, import_react59.useState)();
|
|
5975
|
+
const [sdk, setSdk] = (0, import_react59.useState)();
|
|
5976
|
+
const initializationInProgress = (0, import_react59.useRef)(false);
|
|
5977
|
+
(0, import_react59.useEffect)(
|
|
5953
5978
|
() => {
|
|
5954
5979
|
if (typeof window === "undefined" || sdk) {
|
|
5955
5980
|
return;
|
|
@@ -5991,7 +6016,7 @@ var MeshApp = ({
|
|
|
5991
6016
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
5992
6017
|
if (initializing || !sdk) {
|
|
5993
6018
|
const LoadingComponent = loadingComponent;
|
|
5994
|
-
return LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(LoadingComponent, {}) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6019
|
+
return LoadingComponent ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(LoadingComponent, {}) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_design_system30.LoadingIndicator, {});
|
|
5995
6020
|
}
|
|
5996
6021
|
if (error) {
|
|
5997
6022
|
const ErrorComponent = errorComponent;
|
|
@@ -6001,14 +6026,14 @@ var MeshApp = ({
|
|
|
6001
6026
|
throw error;
|
|
6002
6027
|
}
|
|
6003
6028
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
|
|
6004
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6029
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_design_system30.Theme, {}),
|
|
6005
6030
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(UniformMeshLocationContextProvider, { children })
|
|
6006
6031
|
] });
|
|
6007
6032
|
};
|
|
6008
6033
|
|
|
6009
6034
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
6010
|
-
var
|
|
6011
|
-
var
|
|
6035
|
+
var import_react60 = require("@emotion/react");
|
|
6036
|
+
var import_design_system31 = require("@uniformdev/design-system");
|
|
6012
6037
|
var import_jsx_runtime57 = require("@emotion/react/jsx-runtime");
|
|
6013
6038
|
var DataRefreshButton = ({
|
|
6014
6039
|
buttonText,
|
|
@@ -6016,11 +6041,11 @@ var DataRefreshButton = ({
|
|
|
6016
6041
|
onRefreshData,
|
|
6017
6042
|
...props
|
|
6018
6043
|
}) => {
|
|
6019
|
-
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
6044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_design_system31.Button, { buttonType: "primaryInvert", onClick: onRefreshData, disabled: isLoading, ...props, children: [
|
|
6020
6045
|
!isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6021
|
-
|
|
6046
|
+
import_design_system31.LoadingIndicator,
|
|
6022
6047
|
{
|
|
6023
|
-
css:
|
|
6048
|
+
css: import_react60.css`
|
|
6024
6049
|
${isLoading ? "opacity: 0.2;" : void 0}
|
|
6025
6050
|
`
|
|
6026
6051
|
}
|
|
@@ -6030,15 +6055,15 @@ var DataRefreshButton = ({
|
|
|
6030
6055
|
};
|
|
6031
6056
|
|
|
6032
6057
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6033
|
-
var
|
|
6058
|
+
var import_react62 = require("@emotion/react");
|
|
6034
6059
|
var import_canvas8 = require("@uniformdev/canvas");
|
|
6035
|
-
var
|
|
6060
|
+
var import_design_system32 = require("@uniformdev/design-system");
|
|
6036
6061
|
|
|
6037
6062
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
6038
6063
|
var import_canvas7 = require("@uniformdev/canvas");
|
|
6039
|
-
var
|
|
6064
|
+
var import_react61 = require("react");
|
|
6040
6065
|
var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
|
|
6041
|
-
var ObjectSearchContext = (0,
|
|
6066
|
+
var ObjectSearchContext = (0, import_react61.createContext)({
|
|
6042
6067
|
onSetQuery: () => {
|
|
6043
6068
|
},
|
|
6044
6069
|
onSelectItem: () => {
|
|
@@ -6053,15 +6078,15 @@ var ObjectSearchContext = (0, import_react60.createContext)({
|
|
|
6053
6078
|
}
|
|
6054
6079
|
});
|
|
6055
6080
|
var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
|
|
6056
|
-
const [query, setQuery] = (0,
|
|
6081
|
+
const [query, setQuery] = (0, import_react61.useState)({
|
|
6057
6082
|
contentType: "",
|
|
6058
6083
|
keyword: ""
|
|
6059
6084
|
});
|
|
6060
6085
|
const { flatVariables } = useVariables(true);
|
|
6061
|
-
const querySearchDeferred = (0,
|
|
6062
|
-
const [selectedItems, setSelectedItems] = (0,
|
|
6063
|
-
const [list, setList] = (0,
|
|
6064
|
-
const onSetQuery = (0,
|
|
6086
|
+
const querySearchDeferred = (0, import_react61.useDeferredValue)(query);
|
|
6087
|
+
const [selectedItems, setSelectedItems] = (0, import_react61.useState)(currentlySelectedItems != null ? currentlySelectedItems : []);
|
|
6088
|
+
const [list, setList] = (0, import_react61.useState)({});
|
|
6089
|
+
const onSetQuery = (0, import_react61.useCallback)(
|
|
6065
6090
|
(value2) => {
|
|
6066
6091
|
if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
|
|
6067
6092
|
return setQuery({
|
|
@@ -6073,7 +6098,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
|
|
|
6073
6098
|
},
|
|
6074
6099
|
[setQuery]
|
|
6075
6100
|
);
|
|
6076
|
-
const onSelectItem = (0,
|
|
6101
|
+
const onSelectItem = (0, import_react61.useCallback)(
|
|
6077
6102
|
(selectedResult) => {
|
|
6078
6103
|
if (Array.isArray(selectedResult)) {
|
|
6079
6104
|
setSelectedItems(selectedResult);
|
|
@@ -6087,17 +6112,17 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
|
|
|
6087
6112
|
},
|
|
6088
6113
|
[setSelectedItems, selectedItems]
|
|
6089
6114
|
);
|
|
6090
|
-
const onRemoveAllSelectedItems = (0,
|
|
6115
|
+
const onRemoveAllSelectedItems = (0, import_react61.useCallback)(() => {
|
|
6091
6116
|
setSelectedItems([]);
|
|
6092
6117
|
}, [setSelectedItems]);
|
|
6093
|
-
const onSetList = (0,
|
|
6118
|
+
const onSetList = (0, import_react61.useCallback)(
|
|
6094
6119
|
(value2) => {
|
|
6095
6120
|
setList(value2);
|
|
6096
6121
|
},
|
|
6097
6122
|
[setList]
|
|
6098
6123
|
);
|
|
6099
|
-
const boundQuery = (0,
|
|
6100
|
-
const value = (0,
|
|
6124
|
+
const boundQuery = (0, import_react61.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
6125
|
+
const value = (0, import_react61.useMemo)(
|
|
6101
6126
|
() => ({
|
|
6102
6127
|
boundQuery,
|
|
6103
6128
|
onSetQuery,
|
|
@@ -6122,7 +6147,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
|
|
|
6122
6147
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ObjectSearchContext.Provider, { value, children });
|
|
6123
6148
|
};
|
|
6124
6149
|
function useObjectSearchContext() {
|
|
6125
|
-
return (0,
|
|
6150
|
+
return (0, import_react61.useContext)(ObjectSearchContext);
|
|
6126
6151
|
}
|
|
6127
6152
|
function bindQuery(query, inputs) {
|
|
6128
6153
|
const { result, errors } = (0, import_canvas7.bindVariablesToObject)({
|
|
@@ -6148,13 +6173,13 @@ var ObjectSearchContainer = ({
|
|
|
6148
6173
|
var _a, _b;
|
|
6149
6174
|
const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
|
|
6150
6175
|
const { flatVariables } = useVariables(true);
|
|
6151
|
-
const body = /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
6176
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_design_system32.VerticalRhythm, { children: [
|
|
6152
6177
|
searchFilters,
|
|
6153
6178
|
!resultList ? null : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6154
|
-
|
|
6179
|
+
import_design_system32.ScrollableList,
|
|
6155
6180
|
{
|
|
6156
6181
|
role: "list",
|
|
6157
|
-
css:
|
|
6182
|
+
css: import_react62.css`
|
|
6158
6183
|
> div {
|
|
6159
6184
|
transition: max-height var(--duration-slow) var(--timing-ease-out);
|
|
6160
6185
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
@@ -6191,8 +6216,8 @@ var ObjectSearchContainer = ({
|
|
|
6191
6216
|
}
|
|
6192
6217
|
]);
|
|
6193
6218
|
};
|
|
6194
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6195
|
-
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_design_system32.IconsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_design_system32.VerticalRhythm, { children: [
|
|
6220
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_design_system32.Container, { backgroundColor: "gray-50", padding: "var(--spacing-base)", border: true, children: label ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6196
6221
|
InputVariables,
|
|
6197
6222
|
{
|
|
6198
6223
|
label,
|
|
@@ -6207,12 +6232,12 @@ var ObjectSearchContainer = ({
|
|
|
6207
6232
|
};
|
|
6208
6233
|
|
|
6209
6234
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6210
|
-
var
|
|
6211
|
-
var
|
|
6235
|
+
var import_design_system33 = require("@uniformdev/design-system");
|
|
6236
|
+
var import_react64 = require("react");
|
|
6212
6237
|
|
|
6213
6238
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
6214
|
-
var
|
|
6215
|
-
var ObjectSearchFilterContainerLabel =
|
|
6239
|
+
var import_react63 = require("@emotion/react");
|
|
6240
|
+
var ObjectSearchFilterContainerLabel = import_react63.css`
|
|
6216
6241
|
align-items: center;
|
|
6217
6242
|
display: flex;
|
|
6218
6243
|
font-size: var(--fs-sm);
|
|
@@ -6220,14 +6245,14 @@ var ObjectSearchFilterContainerLabel = import_react62.css`
|
|
|
6220
6245
|
line-height: 1rem;
|
|
6221
6246
|
margin-bottom: var(--spacing-sm);
|
|
6222
6247
|
`;
|
|
6223
|
-
var ObjectSearchFilterContainer =
|
|
6248
|
+
var ObjectSearchFilterContainer = import_react63.css`
|
|
6224
6249
|
display: grid;
|
|
6225
6250
|
gap: var(--spacing-base);
|
|
6226
6251
|
`;
|
|
6227
|
-
var ObjectSearchFilterDropdownAndTextSearch =
|
|
6252
|
+
var ObjectSearchFilterDropdownAndTextSearch = import_react63.css`
|
|
6228
6253
|
grid-template-columns: 0.5fr 1fr;
|
|
6229
6254
|
`;
|
|
6230
|
-
var ObjectSearchFilterGrid = (gridColumns) =>
|
|
6255
|
+
var ObjectSearchFilterGrid = (gridColumns) => import_react63.css`
|
|
6231
6256
|
display: grid;
|
|
6232
6257
|
grid-template-columns: ${gridColumns};
|
|
6233
6258
|
gap: var(--spacing-base);
|
|
@@ -6244,7 +6269,7 @@ var ObjectSearchFilter = ({
|
|
|
6244
6269
|
selectOptions
|
|
6245
6270
|
}) => {
|
|
6246
6271
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
6247
|
-
const [searchState, setSearchState] = (0,
|
|
6272
|
+
const [searchState, setSearchState] = (0, import_react64.useState)({
|
|
6248
6273
|
contentType: "",
|
|
6249
6274
|
keyword: ""
|
|
6250
6275
|
});
|
|
@@ -6256,7 +6281,7 @@ var ObjectSearchFilter = ({
|
|
|
6256
6281
|
};
|
|
6257
6282
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("fieldset", { css: [ObjectSearchFilterContainer, ObjectSearchFilterDropdownAndTextSearch], children: [
|
|
6258
6283
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6259
|
-
|
|
6284
|
+
import_design_system33.InputSelect,
|
|
6260
6285
|
{
|
|
6261
6286
|
label: selectLabel,
|
|
6262
6287
|
showLabel: false,
|
|
@@ -6272,7 +6297,7 @@ var ObjectSearchFilter = ({
|
|
|
6272
6297
|
}
|
|
6273
6298
|
),
|
|
6274
6299
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6275
|
-
|
|
6300
|
+
import_design_system33.InputKeywordSearch,
|
|
6276
6301
|
{
|
|
6277
6302
|
inputFieldName: searchInputName,
|
|
6278
6303
|
placeholder: searchInputPlaceholderText,
|
|
@@ -6295,12 +6320,12 @@ var ObjectSearchFilterContainer2 = ({ label, children }) => {
|
|
|
6295
6320
|
};
|
|
6296
6321
|
|
|
6297
6322
|
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
6298
|
-
var
|
|
6323
|
+
var import_design_system35 = require("@uniformdev/design-system");
|
|
6299
6324
|
|
|
6300
6325
|
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
6301
|
-
var
|
|
6302
|
-
var
|
|
6303
|
-
var ObjectListItemContainer =
|
|
6326
|
+
var import_react65 = require("@emotion/react");
|
|
6327
|
+
var import_design_system34 = require("@uniformdev/design-system");
|
|
6328
|
+
var ObjectListItemContainer = import_react65.css`
|
|
6304
6329
|
align-items: center;
|
|
6305
6330
|
border: 1px solid var(--gray-300);
|
|
6306
6331
|
border-radius: var(--rounded-base);
|
|
@@ -6309,12 +6334,12 @@ var ObjectListItemContainer = import_react64.css`
|
|
|
6309
6334
|
grid-template-columns: 1fr auto;
|
|
6310
6335
|
padding: var(--spacing-sm);
|
|
6311
6336
|
`;
|
|
6312
|
-
var ObjectListItemContainerDisabled =
|
|
6337
|
+
var ObjectListItemContainerDisabled = import_react65.css`
|
|
6313
6338
|
opacity: var(--opacity-50);
|
|
6314
6339
|
pointer-events: none;
|
|
6315
6340
|
`;
|
|
6316
|
-
var ObjectListItemLoading =
|
|
6317
|
-
animation: ${
|
|
6341
|
+
var ObjectListItemLoading = import_react65.css`
|
|
6342
|
+
animation: ${import_design_system34.skeletonLoading} 1s linear infinite alternate;
|
|
6318
6343
|
border-color: transparent;
|
|
6319
6344
|
min-height: 42px;
|
|
6320
6345
|
position: relative;
|
|
@@ -6337,32 +6362,32 @@ var ObjectListItemLoading = import_react64.css`
|
|
|
6337
6362
|
width: 1rem;
|
|
6338
6363
|
}
|
|
6339
6364
|
`;
|
|
6340
|
-
var ObjectListItemHeadingGroup =
|
|
6365
|
+
var ObjectListItemHeadingGroup = import_react65.css`
|
|
6341
6366
|
align-items: center;
|
|
6342
6367
|
display: grid;
|
|
6343
6368
|
`;
|
|
6344
|
-
var ObjectListItemTitle =
|
|
6369
|
+
var ObjectListItemTitle = import_react65.css`
|
|
6345
6370
|
color: var(--brand-secondary-1);
|
|
6346
6371
|
display: block;
|
|
6347
6372
|
font-size: var(--fs-sm);
|
|
6348
6373
|
`;
|
|
6349
|
-
var ObjectListItemSubtitle =
|
|
6374
|
+
var ObjectListItemSubtitle = import_react65.css`
|
|
6350
6375
|
color: var(--gray-500);
|
|
6351
6376
|
display: block;
|
|
6352
6377
|
font-size: var(--fs-xs);
|
|
6353
6378
|
line-height: 1;
|
|
6354
6379
|
`;
|
|
6355
|
-
var ObjectListItemInfoContainer =
|
|
6380
|
+
var ObjectListItemInfoContainer = import_react65.css`
|
|
6356
6381
|
align-items: center;
|
|
6357
6382
|
display: flex;
|
|
6358
6383
|
gap: var(--spacing-sm);
|
|
6359
6384
|
justify-content: center;
|
|
6360
6385
|
`;
|
|
6361
|
-
var ObjectListItemControlledContent =
|
|
6386
|
+
var ObjectListItemControlledContent = import_react65.css`
|
|
6362
6387
|
display: flex;
|
|
6363
6388
|
gap: var(--spacing-sm);
|
|
6364
6389
|
`;
|
|
6365
|
-
var ObjectListItemUnControlledContent =
|
|
6390
|
+
var ObjectListItemUnControlledContent = import_react65.css`
|
|
6366
6391
|
margin-top: var(--spacing-sm);
|
|
6367
6392
|
grid-column: 1 / -1;
|
|
6368
6393
|
`;
|
|
@@ -6415,8 +6440,8 @@ var ObjectSearchListItem = ({
|
|
|
6415
6440
|
}
|
|
6416
6441
|
),
|
|
6417
6442
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { css: ObjectListItemInfoContainer, children: [
|
|
6418
|
-
selected ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6419
|
-
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6443
|
+
selected ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_design_system35.Chip, { text: "selected", size: "xs" }) : null,
|
|
6444
|
+
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_design_system35.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, iconColor: "default", children: popoverData })
|
|
6420
6445
|
] }),
|
|
6421
6446
|
!children ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { css: ObjectListItemUnControlledContent, children })
|
|
6422
6447
|
]
|
|
@@ -6428,14 +6453,14 @@ var ObjectSearchListItemLoadingSkeleton = () => {
|
|
|
6428
6453
|
};
|
|
6429
6454
|
|
|
6430
6455
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
6431
|
-
var
|
|
6456
|
+
var import_design_system37 = require("@uniformdev/design-system");
|
|
6432
6457
|
var import_timeago3 = require("timeago.js");
|
|
6433
6458
|
|
|
6434
6459
|
// src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
|
|
6435
|
-
var
|
|
6436
|
-
var
|
|
6437
|
-
var ButtonStyles =
|
|
6438
|
-
${
|
|
6460
|
+
var import_react66 = require("@emotion/react");
|
|
6461
|
+
var import_design_system36 = require("@uniformdev/design-system");
|
|
6462
|
+
var ButtonStyles = import_react66.css`
|
|
6463
|
+
${import_design_system36.button}
|
|
6439
6464
|
background: transparent;
|
|
6440
6465
|
border: 1px solid var(--brand-secondary-1);
|
|
6441
6466
|
color: var(--brand-secondary-1);
|
|
@@ -6461,7 +6486,7 @@ var ButtonStyles = import_react65.css`
|
|
|
6461
6486
|
text-decoration: none;
|
|
6462
6487
|
}
|
|
6463
6488
|
`;
|
|
6464
|
-
var ButtonIcon =
|
|
6489
|
+
var ButtonIcon = import_react66.css`
|
|
6465
6490
|
width: 1rem;
|
|
6466
6491
|
height: 1rem;
|
|
6467
6492
|
`;
|
|
@@ -6490,8 +6515,8 @@ var LinkButton = ({
|
|
|
6490
6515
|
};
|
|
6491
6516
|
|
|
6492
6517
|
// src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
|
|
6493
|
-
var
|
|
6494
|
-
var ObjectSearchResultItemContainer =
|
|
6518
|
+
var import_react67 = require("@emotion/react");
|
|
6519
|
+
var ObjectSearchResultItemContainer = import_react67.css`
|
|
6495
6520
|
align-items: center;
|
|
6496
6521
|
border: 1px solid var(--gray-300);
|
|
6497
6522
|
border-radius: var(--rounded-base);
|
|
@@ -6507,7 +6532,7 @@ var ObjectSearchResultItemContainer = import_react66.css`
|
|
|
6507
6532
|
}
|
|
6508
6533
|
}
|
|
6509
6534
|
`;
|
|
6510
|
-
var ObjectSearchDragHandle =
|
|
6535
|
+
var ObjectSearchDragHandle = import_react67.css`
|
|
6511
6536
|
border-left: 2px dotted var(--gray-300);
|
|
6512
6537
|
border-right: 2px dotted var(--gray-300);
|
|
6513
6538
|
position: absolute;
|
|
@@ -6516,35 +6541,35 @@ var ObjectSearchDragHandle = import_react66.css`
|
|
|
6516
6541
|
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
6517
6542
|
opacity: 0;
|
|
6518
6543
|
`;
|
|
6519
|
-
var ObjectSearchResultItemSubtitle =
|
|
6544
|
+
var ObjectSearchResultItemSubtitle = import_react67.css`
|
|
6520
6545
|
color: var(--gray-500);
|
|
6521
6546
|
display: block;
|
|
6522
6547
|
font-size: var(--fs-xs);
|
|
6523
6548
|
line-height: 1;
|
|
6524
6549
|
`;
|
|
6525
|
-
var ObjectSearchResultItemTitle =
|
|
6550
|
+
var ObjectSearchResultItemTitle = import_react67.css`
|
|
6526
6551
|
align-items: center;
|
|
6527
6552
|
color: var(--brand-secondary-1);
|
|
6528
6553
|
display: flex;
|
|
6529
6554
|
gap: var(--spacing-xs);
|
|
6530
6555
|
`;
|
|
6531
|
-
var ObjectSearchResultItemTimeStamp =
|
|
6556
|
+
var ObjectSearchResultItemTimeStamp = import_react67.css`
|
|
6532
6557
|
color: var(--gray-500);
|
|
6533
6558
|
font-size: var(--fs-xs);
|
|
6534
6559
|
`;
|
|
6535
|
-
var ObjectSearchAuthorStateGroup =
|
|
6560
|
+
var ObjectSearchAuthorStateGroup = import_react67.css`
|
|
6536
6561
|
align-items: center;
|
|
6537
6562
|
display: flex;
|
|
6538
6563
|
gap: var(--spacing-sm);
|
|
6539
6564
|
`;
|
|
6540
|
-
var ObjectSearchUpdateGroup =
|
|
6565
|
+
var ObjectSearchUpdateGroup = import_react67.css`
|
|
6541
6566
|
display: grid;
|
|
6542
6567
|
`;
|
|
6543
|
-
var ObjectSearchContentContainer =
|
|
6568
|
+
var ObjectSearchContentContainer = import_react67.css`
|
|
6544
6569
|
display: flex;
|
|
6545
6570
|
gap: var(--spacing-base);
|
|
6546
6571
|
`;
|
|
6547
|
-
var ObjectSearchImage =
|
|
6572
|
+
var ObjectSearchImage = import_react67.css`
|
|
6548
6573
|
width: 56px;
|
|
6549
6574
|
object-fit: contain;
|
|
6550
6575
|
`;
|
|
@@ -6582,10 +6607,10 @@ var ObjectSearchResultItem = ({
|
|
|
6582
6607
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { css: ObjectSearchResultItemSubtitle, children: formatedContentType }),
|
|
6583
6608
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { role: "heading", css: ObjectSearchResultItemTitle, children: [
|
|
6584
6609
|
title != null ? title : name,
|
|
6585
|
-
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6610
|
+
!popoverData ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_design_system37.Popover, { baseId: title, ariaLabel: title, buttonText: `See ${title} details`, children: popoverData })
|
|
6586
6611
|
] }),
|
|
6587
6612
|
!createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
6588
|
-
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6613
|
+
!(publishStatus == null ? void 0 : publishStatus.text) ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_design_system37.Badge, { ...publishStatus, size: "sm", uppercaseText: true }),
|
|
6589
6614
|
!createdAt && !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { css: ObjectSearchUpdateGroup, children: [
|
|
6590
6615
|
!createdAt ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
6591
6616
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("strong", { children: "Last updated: " }),
|
|
@@ -6602,36 +6627,36 @@ var ObjectSearchResultItem = ({
|
|
|
6602
6627
|
] }) }),
|
|
6603
6628
|
!editLink && hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
6604
6629
|
!editLink ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
|
|
6605
|
-
hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
6630
|
+
hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_design_system37.Button, { buttonType: "ghostDestructive", onClick: onRemoveItem, children: "Remove" })
|
|
6606
6631
|
] })
|
|
6607
6632
|
] });
|
|
6608
6633
|
};
|
|
6609
6634
|
|
|
6610
6635
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
6611
|
-
var
|
|
6636
|
+
var import_design_system38 = require("@uniformdev/design-system");
|
|
6612
6637
|
var import_react_beautiful_dnd3 = require("react-beautiful-dnd");
|
|
6613
6638
|
|
|
6614
6639
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
6615
|
-
var
|
|
6616
|
-
var ObjectSearchResultListContainer =
|
|
6640
|
+
var import_react68 = require("@emotion/react");
|
|
6641
|
+
var ObjectSearchResultListContainer = import_react68.css`
|
|
6617
6642
|
align-items: center;
|
|
6618
6643
|
display: flex;
|
|
6619
6644
|
gap: var(--spacing-sm);
|
|
6620
6645
|
justify-content: space-between;
|
|
6621
6646
|
`;
|
|
6622
|
-
var ObjectSearchDragContainer =
|
|
6647
|
+
var ObjectSearchDragContainer = import_react68.css`
|
|
6623
6648
|
margin: 0 0 var(--spacing-sm);
|
|
6624
6649
|
`;
|
|
6625
|
-
var ObjectSearchContainerDragging =
|
|
6650
|
+
var ObjectSearchContainerDragging = import_react68.css`
|
|
6626
6651
|
box-shadow: var(--shadow-base);
|
|
6627
6652
|
opacity: var(--opacity-50);
|
|
6628
6653
|
`;
|
|
6629
|
-
var ObjectSearchResultListCounterContainer =
|
|
6654
|
+
var ObjectSearchResultListCounterContainer = import_react68.css`
|
|
6630
6655
|
align-items: center;
|
|
6631
6656
|
display: flex;
|
|
6632
6657
|
gap: var(--spacing-sm);
|
|
6633
6658
|
`;
|
|
6634
|
-
var ObjectSearchResultListTitle =
|
|
6659
|
+
var ObjectSearchResultListTitle = import_react68.css`
|
|
6635
6660
|
font-weight: var(--fw-bold);
|
|
6636
6661
|
line-height: 1;
|
|
6637
6662
|
`;
|
|
@@ -6669,12 +6694,12 @@ function ObjectSearchResultList({
|
|
|
6669
6694
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
|
|
6670
6695
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
|
|
6671
6696
|
" ",
|
|
6672
|
-
!selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6697
|
+
!selectedListItems.length ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_design_system38.Counter, { count: selectedListItems.length })
|
|
6673
6698
|
] }),
|
|
6674
6699
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
|
|
6675
6700
|
additionalButtons,
|
|
6676
6701
|
hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6677
|
-
|
|
6702
|
+
import_design_system38.Button,
|
|
6678
6703
|
{
|
|
6679
6704
|
buttonType: "ghostDestructive",
|
|
6680
6705
|
size: "xs",
|
|
@@ -6719,8 +6744,8 @@ function ObjectSearchResultList({
|
|
|
6719
6744
|
}
|
|
6720
6745
|
|
|
6721
6746
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
6722
|
-
var
|
|
6723
|
-
var
|
|
6747
|
+
var import_design_system39 = require("@uniformdev/design-system");
|
|
6748
|
+
var import_react69 = require("react");
|
|
6724
6749
|
var import_jsx_runtime66 = require("@emotion/react/jsx-runtime");
|
|
6725
6750
|
var QueryFilter = ({
|
|
6726
6751
|
requireContentType,
|
|
@@ -6752,7 +6777,7 @@ var QueryFilter = ({
|
|
|
6752
6777
|
}) => {
|
|
6753
6778
|
var _a, _b, _c, _d;
|
|
6754
6779
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
6755
|
-
const [queryState, setQueryState] = (0,
|
|
6780
|
+
const [queryState, setQueryState] = (0, import_react69.useState)({
|
|
6756
6781
|
contentType: "",
|
|
6757
6782
|
keyword: "",
|
|
6758
6783
|
count: countValue != null ? countValue : 5,
|
|
@@ -6763,12 +6788,12 @@ var QueryFilter = ({
|
|
|
6763
6788
|
setQueryState((prev) => ({ ...prev, ...value }));
|
|
6764
6789
|
onSetQuery({ ...query, ...value });
|
|
6765
6790
|
};
|
|
6766
|
-
(0,
|
|
6791
|
+
(0, import_react69.useEffect)(() => {
|
|
6767
6792
|
onSetQuery(queryState);
|
|
6768
6793
|
}, [onSetQuery, queryState]);
|
|
6769
6794
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("fieldset", { children: [
|
|
6770
6795
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
|
|
6771
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
6796
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { css: ObjectSearchFilterContainer, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_design_system39.VerticalRhythm, { children: [
|
|
6772
6797
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6773
6798
|
InputVariables,
|
|
6774
6799
|
{
|
|
@@ -6778,7 +6803,7 @@ var QueryFilter = ({
|
|
|
6778
6803
|
disableInlineMenu: true,
|
|
6779
6804
|
id: "qf_searchText",
|
|
6780
6805
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6781
|
-
|
|
6806
|
+
import_design_system39.InputKeywordSearch,
|
|
6782
6807
|
{
|
|
6783
6808
|
id: "qf_searchText",
|
|
6784
6809
|
inputFieldName: searchInputName,
|
|
@@ -6801,7 +6826,7 @@ var QueryFilter = ({
|
|
|
6801
6826
|
onChange: (newType) => handleFilterChange({ contentType: newType }),
|
|
6802
6827
|
disableInlineMenu: true,
|
|
6803
6828
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6804
|
-
|
|
6829
|
+
import_design_system39.InputSelect,
|
|
6805
6830
|
{
|
|
6806
6831
|
id: "qf_contentType",
|
|
6807
6832
|
label: contentTypeLabel,
|
|
@@ -6828,7 +6853,7 @@ var QueryFilter = ({
|
|
|
6828
6853
|
onChange: (newCount) => handleFilterChange({ count: newCount }),
|
|
6829
6854
|
disableInlineMenu: true,
|
|
6830
6855
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6831
|
-
|
|
6856
|
+
import_design_system39.Input,
|
|
6832
6857
|
{
|
|
6833
6858
|
id: "qf_count",
|
|
6834
6859
|
label: countLabel,
|
|
@@ -6852,7 +6877,7 @@ var QueryFilter = ({
|
|
|
6852
6877
|
onChange: (newSortBy) => handleFilterChange({ sortBy: newSortBy }),
|
|
6853
6878
|
disableInlineMenu: true,
|
|
6854
6879
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6855
|
-
|
|
6880
|
+
import_design_system39.InputSelect,
|
|
6856
6881
|
{
|
|
6857
6882
|
label: sortLabel,
|
|
6858
6883
|
id: "qf_sortBy",
|
|
@@ -6882,7 +6907,7 @@ var QueryFilter = ({
|
|
|
6882
6907
|
onChange: (newSort) => handleFilterChange({ sortOrder: newSort }),
|
|
6883
6908
|
disableInlineMenu: true,
|
|
6884
6909
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6885
|
-
|
|
6910
|
+
import_design_system39.InputSelect,
|
|
6886
6911
|
{
|
|
6887
6912
|
label: sortOrderLabel,
|
|
6888
6913
|
id: "qf_sortOrder",
|
|
@@ -6906,7 +6931,7 @@ var QueryFilter = ({
|
|
|
6906
6931
|
};
|
|
6907
6932
|
|
|
6908
6933
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
6909
|
-
var
|
|
6934
|
+
var import_react70 = require("react");
|
|
6910
6935
|
var import_jsx_runtime67 = require("@emotion/react/jsx-runtime");
|
|
6911
6936
|
function ParamTypeDynamicDataProvider(props) {
|
|
6912
6937
|
const { children } = props;
|
|
@@ -6915,7 +6940,7 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
6915
6940
|
} = useMeshLocation("paramType");
|
|
6916
6941
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
6917
6942
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
6918
|
-
const variables = (0,
|
|
6943
|
+
const variables = (0, import_react70.useMemo)(
|
|
6919
6944
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
6920
6945
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
6921
6946
|
);
|
|
@@ -6928,9 +6953,9 @@ var JsonMeshVariableEditor = ({
|
|
|
6928
6953
|
variable,
|
|
6929
6954
|
context
|
|
6930
6955
|
}) => {
|
|
6931
|
-
const sillyRef = (0,
|
|
6956
|
+
const sillyRef = (0, import_react70.useRef)(false);
|
|
6932
6957
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
6933
|
-
(0,
|
|
6958
|
+
(0, import_react70.useEffect)(() => {
|
|
6934
6959
|
if (sillyRef.current) {
|
|
6935
6960
|
return;
|
|
6936
6961
|
}
|
|
@@ -6967,7 +6992,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
6967
6992
|
}
|
|
6968
6993
|
|
|
6969
6994
|
// src/index.ts
|
|
6970
|
-
var
|
|
6995
|
+
var import_design_system40 = require("@uniformdev/design-system");
|
|
6971
6996
|
__reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
6972
6997
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6973
6998
|
0 && (module.exports = {
|