@uniformdev/mesh-sdk-react 19.45.0 → 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 +108 -82
- package/dist/index.js +380 -354
- package/dist/index.mjs +108 -82
- 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;
|
|
@@ -4785,7 +4810,8 @@ var input2 = import_react48.css`
|
|
|
4785
4810
|
color: var(--gray-400);
|
|
4786
4811
|
}
|
|
4787
4812
|
|
|
4788
|
-
&[readonly]
|
|
4813
|
+
&[readonly],
|
|
4814
|
+
&[contenteditable='false'] {
|
|
4789
4815
|
cursor: not-allowed;
|
|
4790
4816
|
color: var(--gray-400);
|
|
4791
4817
|
}
|
|
@@ -4794,7 +4820,7 @@ var input2 = import_react48.css`
|
|
|
4794
4820
|
margin: 0;
|
|
4795
4821
|
}
|
|
4796
4822
|
`;
|
|
4797
|
-
var inputMultiLine = (lines) =>
|
|
4823
|
+
var inputMultiLine = (lines) => import_react49.css`
|
|
4798
4824
|
// 1.5 = line height, spacing-md = top and bottom padding
|
|
4799
4825
|
height: calc(${lines * 1.5}em + var(--spacing-md));
|
|
4800
4826
|
resize: vertical;
|
|
@@ -4810,7 +4836,7 @@ function ParameterConnectionIndicator({
|
|
|
4810
4836
|
disabled,
|
|
4811
4837
|
menuTooltip = "Insert variable"
|
|
4812
4838
|
}) {
|
|
4813
|
-
const hasVariablesInValue = (0,
|
|
4839
|
+
const hasVariablesInValue = (0, import_react50.useMemo)(() => {
|
|
4814
4840
|
let result = false;
|
|
4815
4841
|
(0, import_canvas6.bindVariablesToObject)({
|
|
4816
4842
|
value,
|
|
@@ -4821,10 +4847,10 @@ function ParameterConnectionIndicator({
|
|
|
4821
4847
|
});
|
|
4822
4848
|
return result;
|
|
4823
4849
|
}, [value]);
|
|
4824
|
-
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: [
|
|
4825
4851
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { css: { flex: 1 }, children }),
|
|
4826
4852
|
disabled ? null : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4827
|
-
|
|
4853
|
+
import_design_system21.Menu,
|
|
4828
4854
|
{
|
|
4829
4855
|
placement: "bottom-start",
|
|
4830
4856
|
withoutPortal: true,
|
|
@@ -4846,7 +4872,7 @@ function ParameterConnectionIndicator({
|
|
|
4846
4872
|
}
|
|
4847
4873
|
|
|
4848
4874
|
// src/components/Variables/ParameterOrSingleVariable.tsx
|
|
4849
|
-
var
|
|
4875
|
+
var import_design_system22 = require("@uniformdev/design-system");
|
|
4850
4876
|
var import_jsx_runtime41 = require("@emotion/react/jsx-runtime");
|
|
4851
4877
|
function ParameterOrSingleVariable(props) {
|
|
4852
4878
|
const {
|
|
@@ -4875,7 +4901,7 @@ function ParameterOrSingleVariable(props) {
|
|
|
4875
4901
|
children: [
|
|
4876
4902
|
editorRef ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(EditorRefPlugin, { editorRef }) : null,
|
|
4877
4903
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ControlledValuePlugin, { enabled: true, value }),
|
|
4878
|
-
/* @__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: [
|
|
4879
4905
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { css: { flex: 1 }, children: inputWhenNoVariables && !hadVariablesInValue ? inputWhenNoVariables : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4880
4906
|
VariablesComposerInput,
|
|
4881
4907
|
{
|
|
@@ -4902,8 +4928,8 @@ function ParameterOrSingleVariable(props) {
|
|
|
4902
4928
|
}
|
|
4903
4929
|
|
|
4904
4930
|
// src/components/Variables/ParameterVariables.tsx
|
|
4905
|
-
var
|
|
4906
|
-
var
|
|
4931
|
+
var import_react51 = require("@emotion/react");
|
|
4932
|
+
var import_design_system23 = require("@uniformdev/design-system");
|
|
4907
4933
|
var import_jsx_runtime42 = require("@emotion/react/jsx-runtime");
|
|
4908
4934
|
function ParameterVariables(props) {
|
|
4909
4935
|
const {
|
|
@@ -4941,7 +4967,7 @@ function ParameterVariables(props) {
|
|
|
4941
4967
|
editorRef ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(EditorRefPlugin, { editorRef }) : null,
|
|
4942
4968
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ControlledValuePlugin, { value, enabled: useInputWhenNoVariables }),
|
|
4943
4969
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4944
|
-
|
|
4970
|
+
import_design_system23.HorizontalRhythm,
|
|
4945
4971
|
{
|
|
4946
4972
|
align: "center",
|
|
4947
4973
|
gap: "xs",
|
|
@@ -4960,7 +4986,7 @@ function ParameterVariables(props) {
|
|
|
4960
4986
|
"data-text-value": value,
|
|
4961
4987
|
css: [
|
|
4962
4988
|
input2,
|
|
4963
|
-
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(4) :
|
|
4989
|
+
typeof multiLine === "number" ? inputMultiLine(multiLine) : multiLine === true ? inputMultiLine(4) : import_react51.css``
|
|
4964
4990
|
]
|
|
4965
4991
|
}
|
|
4966
4992
|
) }),
|
|
@@ -5010,13 +5036,13 @@ function variableDefaultTextValue(defaultValue) {
|
|
|
5010
5036
|
}
|
|
5011
5037
|
|
|
5012
5038
|
// src/components/Variables/VariablesList.tsx
|
|
5013
|
-
var
|
|
5014
|
-
var
|
|
5039
|
+
var import_react53 = require("@emotion/react");
|
|
5040
|
+
var import_design_system24 = require("@uniformdev/design-system");
|
|
5015
5041
|
var import_react_beautiful_dnd2 = require("react-beautiful-dnd");
|
|
5016
5042
|
|
|
5017
5043
|
// src/components/Variables/styles/VariablesList.styles.ts
|
|
5018
|
-
var
|
|
5019
|
-
var tableRow = (isDragging) =>
|
|
5044
|
+
var import_react52 = require("@emotion/react");
|
|
5045
|
+
var tableRow = (isDragging) => import_react52.css`
|
|
5020
5046
|
position: relative;
|
|
5021
5047
|
${isDragging ? `
|
|
5022
5048
|
display: table;
|
|
@@ -5024,7 +5050,7 @@ var tableRow = (isDragging) => import_react51.css`
|
|
|
5024
5050
|
top: auto !important;
|
|
5025
5051
|
` : void 0}
|
|
5026
5052
|
`;
|
|
5027
|
-
var tableCellDragIcon =
|
|
5053
|
+
var tableCellDragIcon = import_react52.css`
|
|
5028
5054
|
&::after {
|
|
5029
5055
|
content: '';
|
|
5030
5056
|
display: block;
|
|
@@ -5042,7 +5068,7 @@ var tableCellDragIcon = import_react51.css`
|
|
|
5042
5068
|
opacity: 1;
|
|
5043
5069
|
}
|
|
5044
5070
|
`;
|
|
5045
|
-
var variableName =
|
|
5071
|
+
var variableName = import_react52.css`
|
|
5046
5072
|
border: none;
|
|
5047
5073
|
color: var(--brand-secondary-5);
|
|
5048
5074
|
font-weight: var(--fw-medium);
|
|
@@ -5053,7 +5079,7 @@ var variableName = import_react51.css`
|
|
|
5053
5079
|
white-space: nowrap;
|
|
5054
5080
|
max-width: 20ch;
|
|
5055
5081
|
`;
|
|
5056
|
-
var variableValue =
|
|
5082
|
+
var variableValue = import_react52.css`
|
|
5057
5083
|
overflow: hidden;
|
|
5058
5084
|
text-overflow: ellipsis;
|
|
5059
5085
|
white-space: nowrap;
|
|
@@ -5083,13 +5109,13 @@ function VariablesList() {
|
|
|
5083
5109
|
}
|
|
5084
5110
|
};
|
|
5085
5111
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
5086
|
-
/* @__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)(
|
|
5087
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5088
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5089
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5090
|
-
/* @__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, {})
|
|
5091
5117
|
] }) }),
|
|
5092
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
5118
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_design_system24.TableBody, { children: [
|
|
5093
5119
|
sorted.map(({ name, displayName, default: defaultValue, readOnly }, index) => {
|
|
5094
5120
|
const text = displayName != null ? displayName : name;
|
|
5095
5121
|
const textValue = variableDefaultTextValue(defaultValue);
|
|
@@ -5100,7 +5126,7 @@ function VariablesList() {
|
|
|
5100
5126
|
index,
|
|
5101
5127
|
isDragDisabled: sorted.length === 1,
|
|
5102
5128
|
children: (provided2, snapshot) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
5103
|
-
|
|
5129
|
+
import_design_system24.TableRow,
|
|
5104
5130
|
{
|
|
5105
5131
|
ref: provided2.innerRef,
|
|
5106
5132
|
...provided2.dragHandleProps,
|
|
@@ -5109,7 +5135,7 @@ function VariablesList() {
|
|
|
5109
5135
|
css: tableRow(snapshot.isDragging),
|
|
5110
5136
|
"data-dragging": snapshot.isDragging,
|
|
5111
5137
|
children: [
|
|
5112
|
-
/* @__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)(
|
|
5113
5139
|
"button",
|
|
5114
5140
|
{
|
|
5115
5141
|
css: variableName,
|
|
@@ -5122,21 +5148,21 @@ function VariablesList() {
|
|
|
5122
5148
|
children: text
|
|
5123
5149
|
}
|
|
5124
5150
|
) }),
|
|
5125
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5126
|
-
/* @__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)(
|
|
5127
5153
|
"button",
|
|
5128
5154
|
{
|
|
5129
5155
|
type: "button",
|
|
5130
5156
|
title: `delete ${text}`,
|
|
5131
5157
|
css: [
|
|
5132
|
-
|
|
5133
|
-
|
|
5158
|
+
import_design_system24.button,
|
|
5159
|
+
import_react53.css`
|
|
5134
5160
|
background: transparent;
|
|
5135
5161
|
`
|
|
5136
5162
|
],
|
|
5137
5163
|
"aria-controls": text,
|
|
5138
5164
|
onClick: () => dispatch({ type: "remove", variable: name }),
|
|
5139
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5165
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system24.Icon, { icon: "trash", iconColor: "red" })
|
|
5140
5166
|
}
|
|
5141
5167
|
) })
|
|
5142
5168
|
]
|
|
@@ -5150,7 +5176,7 @@ function VariablesList() {
|
|
|
5150
5176
|
] })
|
|
5151
5177
|
] }) }) }),
|
|
5152
5178
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
5153
|
-
|
|
5179
|
+
import_design_system24.AddListButton,
|
|
5154
5180
|
{
|
|
5155
5181
|
onButtonClick: () => dispatch({ type: "edit", variable: "" }),
|
|
5156
5182
|
"aria-label": "Add variable",
|
|
@@ -5186,7 +5212,7 @@ function DataResourceDynamicInputProviderRenderer({
|
|
|
5186
5212
|
}
|
|
5187
5213
|
|
|
5188
5214
|
// src/components/DataResourceVariablesList.tsx
|
|
5189
|
-
var
|
|
5215
|
+
var import_design_system25 = require("@uniformdev/design-system");
|
|
5190
5216
|
var import_jsx_runtime45 = require("@emotion/react/jsx-runtime");
|
|
5191
5217
|
function DataResourceVariablesList(props) {
|
|
5192
5218
|
const {
|
|
@@ -5216,9 +5242,9 @@ function DataResourceVariablesListExplicit({
|
|
|
5216
5242
|
if (NoVariablesComponent) {
|
|
5217
5243
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NoVariablesComponent, {});
|
|
5218
5244
|
}
|
|
5219
|
-
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." });
|
|
5220
5246
|
}
|
|
5221
|
-
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) => {
|
|
5222
5248
|
var _a, _b, _c;
|
|
5223
5249
|
const VariableRenderer = variableDefinition.type ? (_a = typeRenderers == null ? void 0 : typeRenderers[variableDefinition.type]) != null ? _a : TextVariableRenderer : TextVariableRenderer;
|
|
5224
5250
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
@@ -5257,16 +5283,16 @@ function TextVariableRenderer({ definition, value, setValue }) {
|
|
|
5257
5283
|
}
|
|
5258
5284
|
|
|
5259
5285
|
// src/components/Request/RequestBody.tsx
|
|
5260
|
-
var
|
|
5261
|
-
var
|
|
5262
|
-
var
|
|
5286
|
+
var import_react55 = require("@emotion/react");
|
|
5287
|
+
var import_design_system26 = require("@uniformdev/design-system");
|
|
5288
|
+
var import_react56 = require("react");
|
|
5263
5289
|
|
|
5264
5290
|
// src/components/Request/RequestProvider.tsx
|
|
5265
|
-
var
|
|
5291
|
+
var React11 = __toESM(require("react"));
|
|
5266
5292
|
var import_jsx_runtime46 = require("@emotion/react/jsx-runtime");
|
|
5267
|
-
var RequestContext =
|
|
5293
|
+
var RequestContext = React11.createContext(null);
|
|
5268
5294
|
function RequestProvider({ value, onChange, children }) {
|
|
5269
|
-
const contextValue =
|
|
5295
|
+
const contextValue = React11.useMemo(() => {
|
|
5270
5296
|
return {
|
|
5271
5297
|
dispatch: (event) => {
|
|
5272
5298
|
if (event.type === "setRelativeUrl") {
|
|
@@ -5335,7 +5361,7 @@ function RequestProvider({ value, onChange, children }) {
|
|
|
5335
5361
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(RequestContext.Provider, { value: contextValue, children });
|
|
5336
5362
|
}
|
|
5337
5363
|
function useRequest() {
|
|
5338
|
-
const context =
|
|
5364
|
+
const context = React11.useContext(RequestContext);
|
|
5339
5365
|
if (!context) {
|
|
5340
5366
|
throw new Error("No RequestProvider present");
|
|
5341
5367
|
}
|
|
@@ -5343,11 +5369,11 @@ function useRequest() {
|
|
|
5343
5369
|
}
|
|
5344
5370
|
|
|
5345
5371
|
// src/components/Request/styles/Request.styles.ts
|
|
5346
|
-
var
|
|
5347
|
-
var innerContentStyles =
|
|
5372
|
+
var import_react54 = require("@emotion/react");
|
|
5373
|
+
var innerContentStyles = import_react54.css`
|
|
5348
5374
|
background: var(--white);
|
|
5349
5375
|
`;
|
|
5350
|
-
var requestTypeContainer = (bgColor) =>
|
|
5376
|
+
var requestTypeContainer = (bgColor) => import_react54.css`
|
|
5351
5377
|
align-items: start;
|
|
5352
5378
|
background: ${bgColor};
|
|
5353
5379
|
display: grid;
|
|
@@ -5385,11 +5411,11 @@ var LANGUAGE_TO_CONTENT_TYPE = {
|
|
|
5385
5411
|
};
|
|
5386
5412
|
function RequestBody() {
|
|
5387
5413
|
const { request, dispatch } = useRequest();
|
|
5388
|
-
const [language, setLanguage] = (0,
|
|
5414
|
+
const [language, setLanguage] = (0, import_react56.useState)("json");
|
|
5389
5415
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
5390
5416
|
"div",
|
|
5391
5417
|
{
|
|
5392
|
-
css:
|
|
5418
|
+
css: import_react55.css`
|
|
5393
5419
|
background: var(--white);
|
|
5394
5420
|
`,
|
|
5395
5421
|
children: [
|
|
@@ -5397,11 +5423,11 @@ function RequestBody() {
|
|
|
5397
5423
|
RequestTypeContainer,
|
|
5398
5424
|
{
|
|
5399
5425
|
bgColor: "var(--gray-100)",
|
|
5400
|
-
css:
|
|
5426
|
+
css: import_react55.css`
|
|
5401
5427
|
padding: var(--spacing-sm) var(--spacing-base);
|
|
5402
5428
|
`,
|
|
5403
5429
|
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5404
|
-
|
|
5430
|
+
import_design_system26.InputSelect,
|
|
5405
5431
|
{
|
|
5406
5432
|
label: "Language",
|
|
5407
5433
|
showLabel: false,
|
|
@@ -5424,7 +5450,7 @@ function RequestBody() {
|
|
|
5424
5450
|
}
|
|
5425
5451
|
),
|
|
5426
5452
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
5427
|
-
|
|
5453
|
+
import_design_system26.JsonEditor,
|
|
5428
5454
|
{
|
|
5429
5455
|
height: 200,
|
|
5430
5456
|
defaultValue: request.body,
|
|
@@ -5441,7 +5467,7 @@ function RequestBody() {
|
|
|
5441
5467
|
}
|
|
5442
5468
|
|
|
5443
5469
|
// src/components/Request/RequestHeaders.tsx
|
|
5444
|
-
var
|
|
5470
|
+
var import_design_system27 = require("@uniformdev/design-system");
|
|
5445
5471
|
var import_jsx_runtime49 = require("@emotion/react/jsx-runtime");
|
|
5446
5472
|
function RequestHeaders({
|
|
5447
5473
|
disableVariables,
|
|
@@ -5461,30 +5487,30 @@ function RequestHeaders({
|
|
|
5461
5487
|
index
|
|
5462
5488
|
});
|
|
5463
5489
|
};
|
|
5464
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5465
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5466
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5467
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5468
|
-
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
|
|
5469
5495
|
] }) }),
|
|
5470
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5496
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system27.TableBody, { children: [
|
|
5471
5497
|
(_b = (_a = request.baseRequest) == null ? void 0 : _a.headers) == null ? void 0 : _b.map((baseHeader) => {
|
|
5472
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5473
|
-
/* @__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: [
|
|
5474
5500
|
baseHeader.key,
|
|
5475
5501
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("br", {}),
|
|
5476
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" }) })
|
|
5477
5503
|
] }),
|
|
5478
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5504
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_design_system27.TableCellData, { width: "50%", children: [
|
|
5479
5505
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseHeader.value }),
|
|
5480
|
-
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
|
|
5481
5507
|
] })
|
|
5482
5508
|
] }, baseHeader.key);
|
|
5483
5509
|
}),
|
|
5484
5510
|
deezHeaders.map((header, index) => {
|
|
5485
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
5486
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5487
|
-
|
|
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,
|
|
5488
5514
|
{
|
|
5489
5515
|
label: header.key,
|
|
5490
5516
|
value: header.key,
|
|
@@ -5503,7 +5529,7 @@ function RequestHeaders({
|
|
|
5503
5529
|
"data-testid": "header-key"
|
|
5504
5530
|
}
|
|
5505
5531
|
) }),
|
|
5506
|
-
/* @__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)(
|
|
5507
5533
|
InputVariables,
|
|
5508
5534
|
{
|
|
5509
5535
|
value: header.value,
|
|
@@ -5514,8 +5540,8 @@ function RequestHeaders({
|
|
|
5514
5540
|
"data-testid": "header-value"
|
|
5515
5541
|
}
|
|
5516
5542
|
) : null }),
|
|
5517
|
-
addOmitIfEmpty ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5518
|
-
|
|
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,
|
|
5519
5545
|
{
|
|
5520
5546
|
type: "checkbox",
|
|
5521
5547
|
checked: header.omitIfEmpty,
|
|
@@ -5538,13 +5564,13 @@ function RequestHeaders({
|
|
|
5538
5564
|
}
|
|
5539
5565
|
|
|
5540
5566
|
// src/components/Request/RequestMethodSelect.tsx
|
|
5541
|
-
var
|
|
5567
|
+
var import_design_system28 = require("@uniformdev/design-system");
|
|
5542
5568
|
var import_jsx_runtime50 = require("@emotion/react/jsx-runtime");
|
|
5543
5569
|
function RequestMethodSelect(props) {
|
|
5544
5570
|
var _a;
|
|
5545
5571
|
const { request, dispatch } = useRequest();
|
|
5546
5572
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5547
|
-
|
|
5573
|
+
import_design_system28.InputSelect,
|
|
5548
5574
|
{
|
|
5549
5575
|
...props,
|
|
5550
5576
|
options: [
|
|
@@ -5559,7 +5585,7 @@ function RequestMethodSelect(props) {
|
|
|
5559
5585
|
}
|
|
5560
5586
|
|
|
5561
5587
|
// src/components/Request/RequestParameters.tsx
|
|
5562
|
-
var
|
|
5588
|
+
var import_design_system29 = require("@uniformdev/design-system");
|
|
5563
5589
|
var import_jsx_runtime51 = require("@emotion/react/jsx-runtime");
|
|
5564
5590
|
function RequestParameters({
|
|
5565
5591
|
disableVariables,
|
|
@@ -5580,30 +5606,30 @@ function RequestParameters({
|
|
|
5580
5606
|
index
|
|
5581
5607
|
});
|
|
5582
5608
|
};
|
|
5583
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { css: innerContentStyles, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5584
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5585
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5586
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5587
|
-
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
|
|
5588
5614
|
] }) }),
|
|
5589
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5615
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system29.TableBody, { children: [
|
|
5590
5616
|
(_b = (_a = request.baseRequest) == null ? void 0 : _a.parameters) == null ? void 0 : _b.map((baseParameter) => {
|
|
5591
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5592
|
-
/* @__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: [
|
|
5593
5619
|
baseParameter.key,
|
|
5594
5620
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("br", {}),
|
|
5595
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" }) })
|
|
5596
5622
|
] }),
|
|
5597
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5623
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_design_system29.TableCellData, { width: "50%", children: [
|
|
5598
5624
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("i", { css: { color: "var(--gray-500)" }, children: baseParameter.value }),
|
|
5599
|
-
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
|
|
5600
5626
|
] })
|
|
5601
5627
|
] }, baseParameter.key);
|
|
5602
5628
|
}),
|
|
5603
5629
|
deezParameters.map((parameter, index) => {
|
|
5604
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
5605
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5606
|
-
|
|
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,
|
|
5607
5633
|
{
|
|
5608
5634
|
label: parameter.key,
|
|
5609
5635
|
value: parameter.key,
|
|
@@ -5626,7 +5652,7 @@ function RequestParameters({
|
|
|
5626
5652
|
"data-testid": "parameter-key"
|
|
5627
5653
|
}
|
|
5628
5654
|
) }),
|
|
5629
|
-
/* @__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)(
|
|
5630
5656
|
InputVariables,
|
|
5631
5657
|
{
|
|
5632
5658
|
value: parameter.value,
|
|
@@ -5642,8 +5668,8 @@ function RequestParameters({
|
|
|
5642
5668
|
enableEditingVariables: true
|
|
5643
5669
|
}
|
|
5644
5670
|
) : null }),
|
|
5645
|
-
addOmitIfEmpty ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5646
|
-
|
|
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,
|
|
5647
5673
|
{
|
|
5648
5674
|
type: "checkbox",
|
|
5649
5675
|
checked: parameter.omitIfEmpty,
|
|
@@ -5668,8 +5694,8 @@ function RequestParameters({
|
|
|
5668
5694
|
}
|
|
5669
5695
|
|
|
5670
5696
|
// src/components/Request/RequestUrl.tsx
|
|
5671
|
-
var
|
|
5672
|
-
var
|
|
5697
|
+
var import_react57 = require("@emotion/react");
|
|
5698
|
+
var import_react58 = require("react");
|
|
5673
5699
|
|
|
5674
5700
|
// src/components/Request/urlEncodeRequestParameter.ts
|
|
5675
5701
|
function urlEncodeRequestUrl(url, varValues) {
|
|
@@ -5695,7 +5721,7 @@ function RequestUrl() {
|
|
|
5695
5721
|
var _a, _b;
|
|
5696
5722
|
const { variables } = useVariables();
|
|
5697
5723
|
const { request } = useRequest();
|
|
5698
|
-
const mergedParameters = (0,
|
|
5724
|
+
const mergedParameters = (0, import_react58.useMemo)(() => {
|
|
5699
5725
|
var _a2;
|
|
5700
5726
|
if (!((_a2 = request.baseRequest) == null ? void 0 : _a2.parameters)) {
|
|
5701
5727
|
return request.parameters;
|
|
@@ -5705,7 +5731,7 @@ function RequestUrl() {
|
|
|
5705
5731
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
5706
5732
|
"small",
|
|
5707
5733
|
{
|
|
5708
|
-
css:
|
|
5734
|
+
css: import_react57.css`
|
|
5709
5735
|
display: inline-block;
|
|
5710
5736
|
margin-bottom: var(--spacing-xs);
|
|
5711
5737
|
word-break: break-word;
|
|
@@ -5939,16 +5965,16 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
5939
5965
|
}
|
|
5940
5966
|
|
|
5941
5967
|
// src/components/MeshApp.tsx
|
|
5942
|
-
var
|
|
5968
|
+
var import_design_system30 = require("@uniformdev/design-system");
|
|
5943
5969
|
|
|
5944
5970
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
5945
5971
|
var import_mesh_sdk = require("@uniformdev/mesh-sdk");
|
|
5946
|
-
var
|
|
5972
|
+
var import_react59 = require("react");
|
|
5947
5973
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
5948
|
-
const [error, setError] = (0,
|
|
5949
|
-
const [sdk, setSdk] = (0,
|
|
5950
|
-
const initializationInProgress = (0,
|
|
5951
|
-
(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)(
|
|
5952
5978
|
() => {
|
|
5953
5979
|
if (typeof window === "undefined" || sdk) {
|
|
5954
5980
|
return;
|
|
@@ -5990,7 +6016,7 @@ var MeshApp = ({
|
|
|
5990
6016
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
5991
6017
|
if (initializing || !sdk) {
|
|
5992
6018
|
const LoadingComponent = loadingComponent;
|
|
5993
|
-
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, {});
|
|
5994
6020
|
}
|
|
5995
6021
|
if (error) {
|
|
5996
6022
|
const ErrorComponent = errorComponent;
|
|
@@ -6000,14 +6026,14 @@ var MeshApp = ({
|
|
|
6000
6026
|
throw error;
|
|
6001
6027
|
}
|
|
6002
6028
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(UniformMeshSdkContext.Provider, { value: { sdk }, children: [
|
|
6003
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6029
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_design_system30.Theme, {}),
|
|
6004
6030
|
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(UniformMeshLocationContextProvider, { children })
|
|
6005
6031
|
] });
|
|
6006
6032
|
};
|
|
6007
6033
|
|
|
6008
6034
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
6009
|
-
var
|
|
6010
|
-
var
|
|
6035
|
+
var import_react60 = require("@emotion/react");
|
|
6036
|
+
var import_design_system31 = require("@uniformdev/design-system");
|
|
6011
6037
|
var import_jsx_runtime57 = require("@emotion/react/jsx-runtime");
|
|
6012
6038
|
var DataRefreshButton = ({
|
|
6013
6039
|
buttonText,
|
|
@@ -6015,11 +6041,11 @@ var DataRefreshButton = ({
|
|
|
6015
6041
|
onRefreshData,
|
|
6016
6042
|
...props
|
|
6017
6043
|
}) => {
|
|
6018
|
-
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: [
|
|
6019
6045
|
!isLoading ? null : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6020
|
-
|
|
6046
|
+
import_design_system31.LoadingIndicator,
|
|
6021
6047
|
{
|
|
6022
|
-
css:
|
|
6048
|
+
css: import_react60.css`
|
|
6023
6049
|
${isLoading ? "opacity: 0.2;" : void 0}
|
|
6024
6050
|
`
|
|
6025
6051
|
}
|
|
@@ -6029,15 +6055,15 @@ var DataRefreshButton = ({
|
|
|
6029
6055
|
};
|
|
6030
6056
|
|
|
6031
6057
|
// src/components/ObjectSearch/ObjectSearchContainer.tsx
|
|
6032
|
-
var
|
|
6058
|
+
var import_react62 = require("@emotion/react");
|
|
6033
6059
|
var import_canvas8 = require("@uniformdev/canvas");
|
|
6034
|
-
var
|
|
6060
|
+
var import_design_system32 = require("@uniformdev/design-system");
|
|
6035
6061
|
|
|
6036
6062
|
// src/components/ObjectSearch/hooks/ObjectSearchContext.tsx
|
|
6037
6063
|
var import_canvas7 = require("@uniformdev/canvas");
|
|
6038
|
-
var
|
|
6064
|
+
var import_react61 = require("react");
|
|
6039
6065
|
var import_jsx_runtime58 = require("@emotion/react/jsx-runtime");
|
|
6040
|
-
var ObjectSearchContext = (0,
|
|
6066
|
+
var ObjectSearchContext = (0, import_react61.createContext)({
|
|
6041
6067
|
onSetQuery: () => {
|
|
6042
6068
|
},
|
|
6043
6069
|
onSelectItem: () => {
|
|
@@ -6052,15 +6078,15 @@ var ObjectSearchContext = (0, import_react60.createContext)({
|
|
|
6052
6078
|
}
|
|
6053
6079
|
});
|
|
6054
6080
|
var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
|
|
6055
|
-
const [query, setQuery] = (0,
|
|
6081
|
+
const [query, setQuery] = (0, import_react61.useState)({
|
|
6056
6082
|
contentType: "",
|
|
6057
6083
|
keyword: ""
|
|
6058
6084
|
});
|
|
6059
6085
|
const { flatVariables } = useVariables(true);
|
|
6060
|
-
const querySearchDeferred = (0,
|
|
6061
|
-
const [selectedItems, setSelectedItems] = (0,
|
|
6062
|
-
const [list, setList] = (0,
|
|
6063
|
-
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)(
|
|
6064
6090
|
(value2) => {
|
|
6065
6091
|
if (Array.isArray(value2.contentType) && value2.contentType.length > 0) {
|
|
6066
6092
|
return setQuery({
|
|
@@ -6072,7 +6098,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
|
|
|
6072
6098
|
},
|
|
6073
6099
|
[setQuery]
|
|
6074
6100
|
);
|
|
6075
|
-
const onSelectItem = (0,
|
|
6101
|
+
const onSelectItem = (0, import_react61.useCallback)(
|
|
6076
6102
|
(selectedResult) => {
|
|
6077
6103
|
if (Array.isArray(selectedResult)) {
|
|
6078
6104
|
setSelectedItems(selectedResult);
|
|
@@ -6086,17 +6112,17 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
|
|
|
6086
6112
|
},
|
|
6087
6113
|
[setSelectedItems, selectedItems]
|
|
6088
6114
|
);
|
|
6089
|
-
const onRemoveAllSelectedItems = (0,
|
|
6115
|
+
const onRemoveAllSelectedItems = (0, import_react61.useCallback)(() => {
|
|
6090
6116
|
setSelectedItems([]);
|
|
6091
6117
|
}, [setSelectedItems]);
|
|
6092
|
-
const onSetList = (0,
|
|
6118
|
+
const onSetList = (0, import_react61.useCallback)(
|
|
6093
6119
|
(value2) => {
|
|
6094
6120
|
setList(value2);
|
|
6095
6121
|
},
|
|
6096
6122
|
[setList]
|
|
6097
6123
|
);
|
|
6098
|
-
const boundQuery = (0,
|
|
6099
|
-
const value = (0,
|
|
6124
|
+
const boundQuery = (0, import_react61.useMemo)(() => bindQuery(query, flatVariables), [query, flatVariables]);
|
|
6125
|
+
const value = (0, import_react61.useMemo)(
|
|
6100
6126
|
() => ({
|
|
6101
6127
|
boundQuery,
|
|
6102
6128
|
onSetQuery,
|
|
@@ -6121,7 +6147,7 @@ var ObjectSearchProvider = ({ currentlySelectedItems, children }) => {
|
|
|
6121
6147
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ObjectSearchContext.Provider, { value, children });
|
|
6122
6148
|
};
|
|
6123
6149
|
function useObjectSearchContext() {
|
|
6124
|
-
return (0,
|
|
6150
|
+
return (0, import_react61.useContext)(ObjectSearchContext);
|
|
6125
6151
|
}
|
|
6126
6152
|
function bindQuery(query, inputs) {
|
|
6127
6153
|
const { result, errors } = (0, import_canvas7.bindVariablesToObject)({
|
|
@@ -6147,13 +6173,13 @@ var ObjectSearchContainer = ({
|
|
|
6147
6173
|
var _a, _b;
|
|
6148
6174
|
const { onSelectItem, selectedListItems, list } = useObjectSearchContext();
|
|
6149
6175
|
const { flatVariables } = useVariables(true);
|
|
6150
|
-
const body = /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
6176
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_design_system32.VerticalRhythm, { children: [
|
|
6151
6177
|
searchFilters,
|
|
6152
6178
|
!resultList ? null : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6153
|
-
|
|
6179
|
+
import_design_system32.ScrollableList,
|
|
6154
6180
|
{
|
|
6155
6181
|
role: "list",
|
|
6156
|
-
css:
|
|
6182
|
+
css: import_react62.css`
|
|
6157
6183
|
> div {
|
|
6158
6184
|
transition: max-height var(--duration-slow) var(--timing-ease-out);
|
|
6159
6185
|
max-height: ${selectedListItems.length === 0 ? "50vh" : "184px"};
|
|
@@ -6190,8 +6216,8 @@ var ObjectSearchContainer = ({
|
|
|
6190
6216
|
}
|
|
6191
6217
|
]);
|
|
6192
6218
|
};
|
|
6193
|
-
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6194
|
-
/* @__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)(
|
|
6195
6221
|
InputVariables,
|
|
6196
6222
|
{
|
|
6197
6223
|
label,
|
|
@@ -6206,12 +6232,12 @@ var ObjectSearchContainer = ({
|
|
|
6206
6232
|
};
|
|
6207
6233
|
|
|
6208
6234
|
// src/components/ObjectSearch/ObjectSearchFilter.tsx
|
|
6209
|
-
var
|
|
6210
|
-
var
|
|
6235
|
+
var import_design_system33 = require("@uniformdev/design-system");
|
|
6236
|
+
var import_react64 = require("react");
|
|
6211
6237
|
|
|
6212
6238
|
// src/components/ObjectSearch/styles/ObjectSearchFilterContainer.styles.ts
|
|
6213
|
-
var
|
|
6214
|
-
var ObjectSearchFilterContainerLabel =
|
|
6239
|
+
var import_react63 = require("@emotion/react");
|
|
6240
|
+
var ObjectSearchFilterContainerLabel = import_react63.css`
|
|
6215
6241
|
align-items: center;
|
|
6216
6242
|
display: flex;
|
|
6217
6243
|
font-size: var(--fs-sm);
|
|
@@ -6219,14 +6245,14 @@ var ObjectSearchFilterContainerLabel = import_react62.css`
|
|
|
6219
6245
|
line-height: 1rem;
|
|
6220
6246
|
margin-bottom: var(--spacing-sm);
|
|
6221
6247
|
`;
|
|
6222
|
-
var ObjectSearchFilterContainer =
|
|
6248
|
+
var ObjectSearchFilterContainer = import_react63.css`
|
|
6223
6249
|
display: grid;
|
|
6224
6250
|
gap: var(--spacing-base);
|
|
6225
6251
|
`;
|
|
6226
|
-
var ObjectSearchFilterDropdownAndTextSearch =
|
|
6252
|
+
var ObjectSearchFilterDropdownAndTextSearch = import_react63.css`
|
|
6227
6253
|
grid-template-columns: 0.5fr 1fr;
|
|
6228
6254
|
`;
|
|
6229
|
-
var ObjectSearchFilterGrid = (gridColumns) =>
|
|
6255
|
+
var ObjectSearchFilterGrid = (gridColumns) => import_react63.css`
|
|
6230
6256
|
display: grid;
|
|
6231
6257
|
grid-template-columns: ${gridColumns};
|
|
6232
6258
|
gap: var(--spacing-base);
|
|
@@ -6243,7 +6269,7 @@ var ObjectSearchFilter = ({
|
|
|
6243
6269
|
selectOptions
|
|
6244
6270
|
}) => {
|
|
6245
6271
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
6246
|
-
const [searchState, setSearchState] = (0,
|
|
6272
|
+
const [searchState, setSearchState] = (0, import_react64.useState)({
|
|
6247
6273
|
contentType: "",
|
|
6248
6274
|
keyword: ""
|
|
6249
6275
|
});
|
|
@@ -6255,7 +6281,7 @@ var ObjectSearchFilter = ({
|
|
|
6255
6281
|
};
|
|
6256
6282
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("fieldset", { css: [ObjectSearchFilterContainer, ObjectSearchFilterDropdownAndTextSearch], children: [
|
|
6257
6283
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6258
|
-
|
|
6284
|
+
import_design_system33.InputSelect,
|
|
6259
6285
|
{
|
|
6260
6286
|
label: selectLabel,
|
|
6261
6287
|
showLabel: false,
|
|
@@ -6271,7 +6297,7 @@ var ObjectSearchFilter = ({
|
|
|
6271
6297
|
}
|
|
6272
6298
|
),
|
|
6273
6299
|
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6274
|
-
|
|
6300
|
+
import_design_system33.InputKeywordSearch,
|
|
6275
6301
|
{
|
|
6276
6302
|
inputFieldName: searchInputName,
|
|
6277
6303
|
placeholder: searchInputPlaceholderText,
|
|
@@ -6294,12 +6320,12 @@ var ObjectSearchFilterContainer2 = ({ label, children }) => {
|
|
|
6294
6320
|
};
|
|
6295
6321
|
|
|
6296
6322
|
// src/components/ObjectSearch/ObjectSearchListItem.tsx
|
|
6297
|
-
var
|
|
6323
|
+
var import_design_system35 = require("@uniformdev/design-system");
|
|
6298
6324
|
|
|
6299
6325
|
// src/components/ObjectSearch/styles/ObjectSearchListItem.styles.ts
|
|
6300
|
-
var
|
|
6301
|
-
var
|
|
6302
|
-
var ObjectListItemContainer =
|
|
6326
|
+
var import_react65 = require("@emotion/react");
|
|
6327
|
+
var import_design_system34 = require("@uniformdev/design-system");
|
|
6328
|
+
var ObjectListItemContainer = import_react65.css`
|
|
6303
6329
|
align-items: center;
|
|
6304
6330
|
border: 1px solid var(--gray-300);
|
|
6305
6331
|
border-radius: var(--rounded-base);
|
|
@@ -6308,12 +6334,12 @@ var ObjectListItemContainer = import_react64.css`
|
|
|
6308
6334
|
grid-template-columns: 1fr auto;
|
|
6309
6335
|
padding: var(--spacing-sm);
|
|
6310
6336
|
`;
|
|
6311
|
-
var ObjectListItemContainerDisabled =
|
|
6337
|
+
var ObjectListItemContainerDisabled = import_react65.css`
|
|
6312
6338
|
opacity: var(--opacity-50);
|
|
6313
6339
|
pointer-events: none;
|
|
6314
6340
|
`;
|
|
6315
|
-
var ObjectListItemLoading =
|
|
6316
|
-
animation: ${
|
|
6341
|
+
var ObjectListItemLoading = import_react65.css`
|
|
6342
|
+
animation: ${import_design_system34.skeletonLoading} 1s linear infinite alternate;
|
|
6317
6343
|
border-color: transparent;
|
|
6318
6344
|
min-height: 42px;
|
|
6319
6345
|
position: relative;
|
|
@@ -6336,32 +6362,32 @@ var ObjectListItemLoading = import_react64.css`
|
|
|
6336
6362
|
width: 1rem;
|
|
6337
6363
|
}
|
|
6338
6364
|
`;
|
|
6339
|
-
var ObjectListItemHeadingGroup =
|
|
6365
|
+
var ObjectListItemHeadingGroup = import_react65.css`
|
|
6340
6366
|
align-items: center;
|
|
6341
6367
|
display: grid;
|
|
6342
6368
|
`;
|
|
6343
|
-
var ObjectListItemTitle =
|
|
6369
|
+
var ObjectListItemTitle = import_react65.css`
|
|
6344
6370
|
color: var(--brand-secondary-1);
|
|
6345
6371
|
display: block;
|
|
6346
6372
|
font-size: var(--fs-sm);
|
|
6347
6373
|
`;
|
|
6348
|
-
var ObjectListItemSubtitle =
|
|
6374
|
+
var ObjectListItemSubtitle = import_react65.css`
|
|
6349
6375
|
color: var(--gray-500);
|
|
6350
6376
|
display: block;
|
|
6351
6377
|
font-size: var(--fs-xs);
|
|
6352
6378
|
line-height: 1;
|
|
6353
6379
|
`;
|
|
6354
|
-
var ObjectListItemInfoContainer =
|
|
6380
|
+
var ObjectListItemInfoContainer = import_react65.css`
|
|
6355
6381
|
align-items: center;
|
|
6356
6382
|
display: flex;
|
|
6357
6383
|
gap: var(--spacing-sm);
|
|
6358
6384
|
justify-content: center;
|
|
6359
6385
|
`;
|
|
6360
|
-
var ObjectListItemControlledContent =
|
|
6386
|
+
var ObjectListItemControlledContent = import_react65.css`
|
|
6361
6387
|
display: flex;
|
|
6362
6388
|
gap: var(--spacing-sm);
|
|
6363
6389
|
`;
|
|
6364
|
-
var ObjectListItemUnControlledContent =
|
|
6390
|
+
var ObjectListItemUnControlledContent = import_react65.css`
|
|
6365
6391
|
margin-top: var(--spacing-sm);
|
|
6366
6392
|
grid-column: 1 / -1;
|
|
6367
6393
|
`;
|
|
@@ -6414,8 +6440,8 @@ var ObjectSearchListItem = ({
|
|
|
6414
6440
|
}
|
|
6415
6441
|
),
|
|
6416
6442
|
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { css: ObjectListItemInfoContainer, children: [
|
|
6417
|
-
selected ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
6418
|
-
!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 })
|
|
6419
6445
|
] }),
|
|
6420
6446
|
!children ? null : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { css: ObjectListItemUnControlledContent, children })
|
|
6421
6447
|
]
|
|
@@ -6427,14 +6453,14 @@ var ObjectSearchListItemLoadingSkeleton = () => {
|
|
|
6427
6453
|
};
|
|
6428
6454
|
|
|
6429
6455
|
// src/components/ObjectSearch/ObjectSearchResultItem.tsx
|
|
6430
|
-
var
|
|
6456
|
+
var import_design_system37 = require("@uniformdev/design-system");
|
|
6431
6457
|
var import_timeago3 = require("timeago.js");
|
|
6432
6458
|
|
|
6433
6459
|
// src/components/ObjectSearch/styles/ObjectSearchResultItemButton.styles.ts
|
|
6434
|
-
var
|
|
6435
|
-
var
|
|
6436
|
-
var ButtonStyles =
|
|
6437
|
-
${
|
|
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}
|
|
6438
6464
|
background: transparent;
|
|
6439
6465
|
border: 1px solid var(--brand-secondary-1);
|
|
6440
6466
|
color: var(--brand-secondary-1);
|
|
@@ -6460,7 +6486,7 @@ var ButtonStyles = import_react65.css`
|
|
|
6460
6486
|
text-decoration: none;
|
|
6461
6487
|
}
|
|
6462
6488
|
`;
|
|
6463
|
-
var ButtonIcon =
|
|
6489
|
+
var ButtonIcon = import_react66.css`
|
|
6464
6490
|
width: 1rem;
|
|
6465
6491
|
height: 1rem;
|
|
6466
6492
|
`;
|
|
@@ -6489,8 +6515,8 @@ var LinkButton = ({
|
|
|
6489
6515
|
};
|
|
6490
6516
|
|
|
6491
6517
|
// src/components/ObjectSearch/styles/ObjectSearchResultItem.styles.ts
|
|
6492
|
-
var
|
|
6493
|
-
var ObjectSearchResultItemContainer =
|
|
6518
|
+
var import_react67 = require("@emotion/react");
|
|
6519
|
+
var ObjectSearchResultItemContainer = import_react67.css`
|
|
6494
6520
|
align-items: center;
|
|
6495
6521
|
border: 1px solid var(--gray-300);
|
|
6496
6522
|
border-radius: var(--rounded-base);
|
|
@@ -6506,7 +6532,7 @@ var ObjectSearchResultItemContainer = import_react66.css`
|
|
|
6506
6532
|
}
|
|
6507
6533
|
}
|
|
6508
6534
|
`;
|
|
6509
|
-
var ObjectSearchDragHandle =
|
|
6535
|
+
var ObjectSearchDragHandle = import_react67.css`
|
|
6510
6536
|
border-left: 2px dotted var(--gray-300);
|
|
6511
6537
|
border-right: 2px dotted var(--gray-300);
|
|
6512
6538
|
position: absolute;
|
|
@@ -6515,35 +6541,35 @@ var ObjectSearchDragHandle = import_react66.css`
|
|
|
6515
6541
|
transition: opacity var(--duration-fast) var(--timing-ease-out);
|
|
6516
6542
|
opacity: 0;
|
|
6517
6543
|
`;
|
|
6518
|
-
var ObjectSearchResultItemSubtitle =
|
|
6544
|
+
var ObjectSearchResultItemSubtitle = import_react67.css`
|
|
6519
6545
|
color: var(--gray-500);
|
|
6520
6546
|
display: block;
|
|
6521
6547
|
font-size: var(--fs-xs);
|
|
6522
6548
|
line-height: 1;
|
|
6523
6549
|
`;
|
|
6524
|
-
var ObjectSearchResultItemTitle =
|
|
6550
|
+
var ObjectSearchResultItemTitle = import_react67.css`
|
|
6525
6551
|
align-items: center;
|
|
6526
6552
|
color: var(--brand-secondary-1);
|
|
6527
6553
|
display: flex;
|
|
6528
6554
|
gap: var(--spacing-xs);
|
|
6529
6555
|
`;
|
|
6530
|
-
var ObjectSearchResultItemTimeStamp =
|
|
6556
|
+
var ObjectSearchResultItemTimeStamp = import_react67.css`
|
|
6531
6557
|
color: var(--gray-500);
|
|
6532
6558
|
font-size: var(--fs-xs);
|
|
6533
6559
|
`;
|
|
6534
|
-
var ObjectSearchAuthorStateGroup =
|
|
6560
|
+
var ObjectSearchAuthorStateGroup = import_react67.css`
|
|
6535
6561
|
align-items: center;
|
|
6536
6562
|
display: flex;
|
|
6537
6563
|
gap: var(--spacing-sm);
|
|
6538
6564
|
`;
|
|
6539
|
-
var ObjectSearchUpdateGroup =
|
|
6565
|
+
var ObjectSearchUpdateGroup = import_react67.css`
|
|
6540
6566
|
display: grid;
|
|
6541
6567
|
`;
|
|
6542
|
-
var ObjectSearchContentContainer =
|
|
6568
|
+
var ObjectSearchContentContainer = import_react67.css`
|
|
6543
6569
|
display: flex;
|
|
6544
6570
|
gap: var(--spacing-base);
|
|
6545
6571
|
`;
|
|
6546
|
-
var ObjectSearchImage =
|
|
6572
|
+
var ObjectSearchImage = import_react67.css`
|
|
6547
6573
|
width: 56px;
|
|
6548
6574
|
object-fit: contain;
|
|
6549
6575
|
`;
|
|
@@ -6581,10 +6607,10 @@ var ObjectSearchResultItem = ({
|
|
|
6581
6607
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { css: ObjectSearchResultItemSubtitle, children: formatedContentType }),
|
|
6582
6608
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { role: "heading", css: ObjectSearchResultItemTitle, children: [
|
|
6583
6609
|
title != null ? title : name,
|
|
6584
|
-
!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 })
|
|
6585
6611
|
] }),
|
|
6586
6612
|
!createdAt && !publishStatus ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
6587
|
-
!(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 }),
|
|
6588
6614
|
!createdAt && !publishedAt ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { css: ObjectSearchUpdateGroup, children: [
|
|
6589
6615
|
!createdAt ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("small", { css: ObjectSearchResultItemTimeStamp, children: [
|
|
6590
6616
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("strong", { children: "Last updated: " }),
|
|
@@ -6601,36 +6627,36 @@ var ObjectSearchResultItem = ({
|
|
|
6601
6627
|
] }) }),
|
|
6602
6628
|
!editLink && hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { css: ObjectSearchAuthorStateGroup, children: [
|
|
6603
6629
|
!editLink ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(LinkButton, { text: "Edit", href: editLink, icon: editLinkIcon }),
|
|
6604
|
-
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" })
|
|
6605
6631
|
] })
|
|
6606
6632
|
] });
|
|
6607
6633
|
};
|
|
6608
6634
|
|
|
6609
6635
|
// src/components/ObjectSearch/ObjectSearchResultList.tsx
|
|
6610
|
-
var
|
|
6636
|
+
var import_design_system38 = require("@uniformdev/design-system");
|
|
6611
6637
|
var import_react_beautiful_dnd3 = require("react-beautiful-dnd");
|
|
6612
6638
|
|
|
6613
6639
|
// src/components/ObjectSearch/styles/ObjectSearchResultList.styles.ts
|
|
6614
|
-
var
|
|
6615
|
-
var ObjectSearchResultListContainer =
|
|
6640
|
+
var import_react68 = require("@emotion/react");
|
|
6641
|
+
var ObjectSearchResultListContainer = import_react68.css`
|
|
6616
6642
|
align-items: center;
|
|
6617
6643
|
display: flex;
|
|
6618
6644
|
gap: var(--spacing-sm);
|
|
6619
6645
|
justify-content: space-between;
|
|
6620
6646
|
`;
|
|
6621
|
-
var ObjectSearchDragContainer =
|
|
6647
|
+
var ObjectSearchDragContainer = import_react68.css`
|
|
6622
6648
|
margin: 0 0 var(--spacing-sm);
|
|
6623
6649
|
`;
|
|
6624
|
-
var ObjectSearchContainerDragging =
|
|
6650
|
+
var ObjectSearchContainerDragging = import_react68.css`
|
|
6625
6651
|
box-shadow: var(--shadow-base);
|
|
6626
6652
|
opacity: var(--opacity-50);
|
|
6627
6653
|
`;
|
|
6628
|
-
var ObjectSearchResultListCounterContainer =
|
|
6654
|
+
var ObjectSearchResultListCounterContainer = import_react68.css`
|
|
6629
6655
|
align-items: center;
|
|
6630
6656
|
display: flex;
|
|
6631
6657
|
gap: var(--spacing-sm);
|
|
6632
6658
|
`;
|
|
6633
|
-
var ObjectSearchResultListTitle =
|
|
6659
|
+
var ObjectSearchResultListTitle = import_react68.css`
|
|
6634
6660
|
font-weight: var(--fw-bold);
|
|
6635
6661
|
line-height: 1;
|
|
6636
6662
|
`;
|
|
@@ -6668,12 +6694,12 @@ function ObjectSearchResultList({
|
|
|
6668
6694
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { role: "note", css: ObjectSearchResultListCounterContainer, children: [
|
|
6669
6695
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { css: ObjectSearchResultListTitle, children: resultLabelText }),
|
|
6670
6696
|
" ",
|
|
6671
|
-
!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 })
|
|
6672
6698
|
] }),
|
|
6673
6699
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { css: ObjectSearchResultListCounterContainer, children: [
|
|
6674
6700
|
additionalButtons,
|
|
6675
6701
|
hideRemoveButton ? null : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6676
|
-
|
|
6702
|
+
import_design_system38.Button,
|
|
6677
6703
|
{
|
|
6678
6704
|
buttonType: "ghostDestructive",
|
|
6679
6705
|
size: "xs",
|
|
@@ -6718,8 +6744,8 @@ function ObjectSearchResultList({
|
|
|
6718
6744
|
}
|
|
6719
6745
|
|
|
6720
6746
|
// src/components/ObjectSearch/QueryFilter.tsx
|
|
6721
|
-
var
|
|
6722
|
-
var
|
|
6747
|
+
var import_design_system39 = require("@uniformdev/design-system");
|
|
6748
|
+
var import_react69 = require("react");
|
|
6723
6749
|
var import_jsx_runtime66 = require("@emotion/react/jsx-runtime");
|
|
6724
6750
|
var QueryFilter = ({
|
|
6725
6751
|
requireContentType,
|
|
@@ -6751,7 +6777,7 @@ var QueryFilter = ({
|
|
|
6751
6777
|
}) => {
|
|
6752
6778
|
var _a, _b, _c, _d;
|
|
6753
6779
|
const { query, onSetQuery } = useObjectSearchContext();
|
|
6754
|
-
const [queryState, setQueryState] = (0,
|
|
6780
|
+
const [queryState, setQueryState] = (0, import_react69.useState)({
|
|
6755
6781
|
contentType: "",
|
|
6756
6782
|
keyword: "",
|
|
6757
6783
|
count: countValue != null ? countValue : 5,
|
|
@@ -6762,12 +6788,12 @@ var QueryFilter = ({
|
|
|
6762
6788
|
setQueryState((prev) => ({ ...prev, ...value }));
|
|
6763
6789
|
onSetQuery({ ...query, ...value });
|
|
6764
6790
|
};
|
|
6765
|
-
(0,
|
|
6791
|
+
(0, import_react69.useEffect)(() => {
|
|
6766
6792
|
onSetQuery(queryState);
|
|
6767
6793
|
}, [onSetQuery, queryState]);
|
|
6768
6794
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("fieldset", { children: [
|
|
6769
6795
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { css: ObjectSearchFilterContainerLabel, children: queryFilterTitle }),
|
|
6770
|
-
/* @__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: [
|
|
6771
6797
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6772
6798
|
InputVariables,
|
|
6773
6799
|
{
|
|
@@ -6777,7 +6803,7 @@ var QueryFilter = ({
|
|
|
6777
6803
|
disableInlineMenu: true,
|
|
6778
6804
|
id: "qf_searchText",
|
|
6779
6805
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6780
|
-
|
|
6806
|
+
import_design_system39.InputKeywordSearch,
|
|
6781
6807
|
{
|
|
6782
6808
|
id: "qf_searchText",
|
|
6783
6809
|
inputFieldName: searchInputName,
|
|
@@ -6800,7 +6826,7 @@ var QueryFilter = ({
|
|
|
6800
6826
|
onChange: (newType) => handleFilterChange({ contentType: newType }),
|
|
6801
6827
|
disableInlineMenu: true,
|
|
6802
6828
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6803
|
-
|
|
6829
|
+
import_design_system39.InputSelect,
|
|
6804
6830
|
{
|
|
6805
6831
|
id: "qf_contentType",
|
|
6806
6832
|
label: contentTypeLabel,
|
|
@@ -6827,7 +6853,7 @@ var QueryFilter = ({
|
|
|
6827
6853
|
onChange: (newCount) => handleFilterChange({ count: newCount }),
|
|
6828
6854
|
disableInlineMenu: true,
|
|
6829
6855
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6830
|
-
|
|
6856
|
+
import_design_system39.Input,
|
|
6831
6857
|
{
|
|
6832
6858
|
id: "qf_count",
|
|
6833
6859
|
label: countLabel,
|
|
@@ -6851,7 +6877,7 @@ var QueryFilter = ({
|
|
|
6851
6877
|
onChange: (newSortBy) => handleFilterChange({ sortBy: newSortBy }),
|
|
6852
6878
|
disableInlineMenu: true,
|
|
6853
6879
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6854
|
-
|
|
6880
|
+
import_design_system39.InputSelect,
|
|
6855
6881
|
{
|
|
6856
6882
|
label: sortLabel,
|
|
6857
6883
|
id: "qf_sortBy",
|
|
@@ -6881,7 +6907,7 @@ var QueryFilter = ({
|
|
|
6881
6907
|
onChange: (newSort) => handleFilterChange({ sortOrder: newSort }),
|
|
6882
6908
|
disableInlineMenu: true,
|
|
6883
6909
|
inputWhenNoVariables: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6884
|
-
|
|
6910
|
+
import_design_system39.InputSelect,
|
|
6885
6911
|
{
|
|
6886
6912
|
label: sortOrderLabel,
|
|
6887
6913
|
id: "qf_sortOrder",
|
|
@@ -6905,7 +6931,7 @@ var QueryFilter = ({
|
|
|
6905
6931
|
};
|
|
6906
6932
|
|
|
6907
6933
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
6908
|
-
var
|
|
6934
|
+
var import_react70 = require("react");
|
|
6909
6935
|
var import_jsx_runtime67 = require("@emotion/react/jsx-runtime");
|
|
6910
6936
|
function ParamTypeDynamicDataProvider(props) {
|
|
6911
6937
|
const { children } = props;
|
|
@@ -6914,7 +6940,7 @@ function ParamTypeDynamicDataProvider(props) {
|
|
|
6914
6940
|
} = useMeshLocation("paramType");
|
|
6915
6941
|
const dynamicInputsAsVariables = useDynamicInputsAsVariables(dynamicInputs);
|
|
6916
6942
|
const connectedDataAsVariables = useConnectedDataAsVariables(connectedData);
|
|
6917
|
-
const variables = (0,
|
|
6943
|
+
const variables = (0, import_react70.useMemo)(
|
|
6918
6944
|
() => ({ ...connectedDataAsVariables, ...dynamicInputsAsVariables }),
|
|
6919
6945
|
[dynamicInputsAsVariables, connectedDataAsVariables]
|
|
6920
6946
|
);
|
|
@@ -6927,9 +6953,9 @@ var JsonMeshVariableEditor = ({
|
|
|
6927
6953
|
variable,
|
|
6928
6954
|
context
|
|
6929
6955
|
}) => {
|
|
6930
|
-
const sillyRef = (0,
|
|
6956
|
+
const sillyRef = (0, import_react70.useRef)(false);
|
|
6931
6957
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
6932
|
-
(0,
|
|
6958
|
+
(0, import_react70.useEffect)(() => {
|
|
6933
6959
|
if (sillyRef.current) {
|
|
6934
6960
|
return;
|
|
6935
6961
|
}
|
|
@@ -6966,7 +6992,7 @@ function createLocationValidator(setValue, validate) {
|
|
|
6966
6992
|
}
|
|
6967
6993
|
|
|
6968
6994
|
// src/index.ts
|
|
6969
|
-
var
|
|
6995
|
+
var import_design_system40 = require("@uniformdev/design-system");
|
|
6970
6996
|
__reExport(src_exports, require("@uniformdev/mesh-sdk"), module.exports);
|
|
6971
6997
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6972
6998
|
0 && (module.exports = {
|