@uniformdev/mesh-sdk-react 19.45.1 → 19.45.2-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +20 -4
- package/dist/index.d.ts +20 -4
- package/dist/index.esm.js +106 -81
- package/dist/index.js +378 -353
- package/dist/index.mjs +106 -81
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -2775,7 +2775,8 @@ import { ParameterShellContext, useParameterShell } from "@uniformdev/design-sys
|
|
|
2775
2775
|
|
|
2776
2776
|
// src/components/Variables/composer/ControlledValuePlugin.tsx
|
|
2777
2777
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
2778
|
-
import {
|
|
2778
|
+
import { dequal } from "dequal/lite";
|
|
2779
|
+
import { useEffect as useEffect5, useRef as useRef8 } from "react";
|
|
2779
2780
|
|
|
2780
2781
|
// src/components/Variables/util/deserializeVariablesEditorState.ts
|
|
2781
2782
|
import { parseVariableExpression } from "@uniformdev/canvas";
|
|
@@ -2886,12 +2887,17 @@ function ControlledValuePlugin({
|
|
|
2886
2887
|
extraDependencies
|
|
2887
2888
|
}) {
|
|
2888
2889
|
const [editor] = useLexicalComposerContext();
|
|
2890
|
+
const lastValueRef = useRef8(value);
|
|
2889
2891
|
useEffect5(() => {
|
|
2890
2892
|
if (!enabled) {
|
|
2891
2893
|
return;
|
|
2892
2894
|
}
|
|
2895
|
+
if (dequal(lastValueRef.current, value)) {
|
|
2896
|
+
return;
|
|
2897
|
+
}
|
|
2893
2898
|
setTimeout(() => {
|
|
2894
2899
|
if (editor) {
|
|
2900
|
+
lastValueRef.current = value;
|
|
2895
2901
|
setVariablesEditorValue(editor, value);
|
|
2896
2902
|
}
|
|
2897
2903
|
});
|
|
@@ -2905,6 +2911,7 @@ import { useLexicalNodeSelection } from "@lexical/react/useLexicalNodeSelection"
|
|
|
2905
2911
|
import { $moveCharacter, $shouldOverrideDefaultCharacterSelection } from "@lexical/selection";
|
|
2906
2912
|
import { mergeRegister } from "@lexical/utils";
|
|
2907
2913
|
import { createVariableReference as createVariableReference2 } from "@uniformdev/canvas";
|
|
2914
|
+
import { LoadingIndicator as LoadingIndicator2 } from "@uniformdev/design-system";
|
|
2908
2915
|
import {
|
|
2909
2916
|
$getNearestNodeFromDOMNode,
|
|
2910
2917
|
$getNodeByKey as $getNodeByKey2,
|
|
@@ -2993,7 +3000,7 @@ import {
|
|
|
2993
3000
|
import { AiFillPlusCircle } from "@react-icons/all-files/ai/AiFillPlusCircle";
|
|
2994
3001
|
import { createVariableReference } from "@uniformdev/canvas";
|
|
2995
3002
|
import { HorizontalRhythm, MenuGroup, MenuItem as MenuItem2, MenuItemSeparator } from "@uniformdev/design-system";
|
|
2996
|
-
import { dequal } from "dequal/lite";
|
|
3003
|
+
import { dequal as dequal2 } from "dequal/lite";
|
|
2997
3004
|
import {
|
|
2998
3005
|
$getNodeByKey,
|
|
2999
3006
|
$insertNodes,
|
|
@@ -3001,7 +3008,7 @@ import {
|
|
|
3001
3008
|
COMMAND_PRIORITY_NORMAL,
|
|
3002
3009
|
createCommand
|
|
3003
3010
|
} from "lexical";
|
|
3004
|
-
import { useCallback, useEffect as useEffect7, useMemo as useMemo8, useRef as
|
|
3011
|
+
import { useCallback, useEffect as useEffect7, useMemo as useMemo8, useRef as useRef9, useState as useState8 } from "react";
|
|
3005
3012
|
import { createPortal } from "react-dom";
|
|
3006
3013
|
|
|
3007
3014
|
// src/components/Variables/toolbox/SelectVariableMenu.styles.ts
|
|
@@ -3038,7 +3045,7 @@ import { useEffect as useEffect6 } from "react";
|
|
|
3038
3045
|
|
|
3039
3046
|
// src/components/Variables/VariablesProvider.tsx
|
|
3040
3047
|
import mitt from "mitt";
|
|
3041
|
-
import
|
|
3048
|
+
import { createContext as createContext3, useContext as useContext5, useMemo as useMemo7, useState as useState7 } from "react";
|
|
3042
3049
|
|
|
3043
3050
|
// src/components/Variables/VariableEditor.tsx
|
|
3044
3051
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
@@ -3149,61 +3156,71 @@ function VariableEditor({ variable, onSubmit, onCancel, disableMeshTip }) {
|
|
|
3149
3156
|
|
|
3150
3157
|
// src/components/Variables/VariablesProvider.tsx
|
|
3151
3158
|
import { jsx as jsx31, jsxs as jsxs17 } from "@emotion/react/jsx-runtime";
|
|
3152
|
-
var VariablesContext =
|
|
3159
|
+
var VariablesContext = createContext3(null);
|
|
3153
3160
|
function VariablesProvider({
|
|
3154
3161
|
value,
|
|
3155
3162
|
onChange,
|
|
3156
3163
|
editVariableComponent,
|
|
3157
3164
|
readOnly,
|
|
3165
|
+
isLoading,
|
|
3158
3166
|
children,
|
|
3159
3167
|
knownUndefinedValues = {}
|
|
3160
3168
|
}) {
|
|
3161
|
-
const [editing, setEditing] =
|
|
3162
|
-
const [editingContext, setEditingContext] =
|
|
3163
|
-
const events =
|
|
3169
|
+
const [editing, setEditing] = useState7();
|
|
3170
|
+
const [editingContext, setEditingContext] = useState7();
|
|
3171
|
+
const events = useMemo7(() => mitt(), []);
|
|
3164
3172
|
if (!readOnly && !onChange) {
|
|
3165
3173
|
throw new Error("onChange must be provided when readOnly is false");
|
|
3166
3174
|
}
|
|
3167
3175
|
const Editor = editVariableComponent != null ? editVariableComponent : VariableEditor;
|
|
3168
|
-
const
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3176
|
+
const valueBasedContextValue = useMemo7(
|
|
3177
|
+
() => ({
|
|
3178
|
+
flatVariables: flattenVariables(value),
|
|
3179
|
+
dispatch: (event) => {
|
|
3180
|
+
if (readOnly) {
|
|
3181
|
+
console.warn(
|
|
3182
|
+
`Received ignored mutation event in read-only variables context: ${JSON.stringify(event)}`
|
|
3183
|
+
);
|
|
3184
|
+
return;
|
|
3185
|
+
}
|
|
3186
|
+
if (event.type === "set") {
|
|
3187
|
+
const { name, ...varValue } = event.variable;
|
|
3188
|
+
onChange == null ? void 0 : onChange({ ...value, [event.variable.name]: varValue });
|
|
3189
|
+
if (event.openEditor) {
|
|
3190
|
+
setEditing(event.variable.name);
|
|
3191
|
+
setEditingContext(event.context);
|
|
3192
|
+
}
|
|
3193
|
+
} else if (event.type === "edit") {
|
|
3194
|
+
setEditing(event.variable);
|
|
3182
3195
|
setEditingContext(event.context);
|
|
3196
|
+
} else if (event.type === "remove") {
|
|
3197
|
+
const newValue = { ...value };
|
|
3198
|
+
delete newValue[event.variable];
|
|
3199
|
+
onChange == null ? void 0 : onChange(newValue);
|
|
3200
|
+
} else if (event.type === "reorder") {
|
|
3201
|
+
onChange == null ? void 0 : onChange(event.result);
|
|
3202
|
+
} else if (event.type === "cancelEdit") {
|
|
3203
|
+
setEditing(void 0);
|
|
3204
|
+
setEditingContext(void 0);
|
|
3205
|
+
} else {
|
|
3206
|
+
throw new Error(`Unknown event ${JSON.stringify(event)}`);
|
|
3183
3207
|
}
|
|
3184
|
-
}
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
variables: value,
|
|
3201
|
-
isEditing: typeof editing !== "undefined",
|
|
3202
|
-
events,
|
|
3203
|
-
canDispatch: true,
|
|
3204
|
-
readOnly,
|
|
3205
|
-
knownUndefinedValues
|
|
3206
|
-
};
|
|
3208
|
+
},
|
|
3209
|
+
variables: value,
|
|
3210
|
+
readOnly
|
|
3211
|
+
}),
|
|
3212
|
+
[onChange, readOnly, value]
|
|
3213
|
+
);
|
|
3214
|
+
const contextValue = useMemo7(() => {
|
|
3215
|
+
return {
|
|
3216
|
+
...valueBasedContextValue,
|
|
3217
|
+
isEditing: typeof editing !== "undefined",
|
|
3218
|
+
events,
|
|
3219
|
+
canDispatch: true,
|
|
3220
|
+
knownUndefinedValues,
|
|
3221
|
+
isLoading: !!isLoading
|
|
3222
|
+
};
|
|
3223
|
+
}, [editing, events, knownUndefinedValues, valueBasedContextValue, isLoading]);
|
|
3207
3224
|
return /* @__PURE__ */ jsxs17(VariablesContext.Provider, { value: contextValue, children: [
|
|
3208
3225
|
children,
|
|
3209
3226
|
typeof editing !== "undefined" ? /* @__PURE__ */ jsx31(
|
|
@@ -3226,7 +3243,7 @@ function VariablesProvider({
|
|
|
3226
3243
|
] });
|
|
3227
3244
|
}
|
|
3228
3245
|
function useVariables(returnEmptyWithoutProvider = false) {
|
|
3229
|
-
const context =
|
|
3246
|
+
const context = useContext5(VariablesContext);
|
|
3230
3247
|
if (!context) {
|
|
3231
3248
|
if (returnEmptyWithoutProvider) {
|
|
3232
3249
|
return {
|
|
@@ -3238,7 +3255,8 @@ function useVariables(returnEmptyWithoutProvider = false) {
|
|
|
3238
3255
|
isEditing: false,
|
|
3239
3256
|
variables: {},
|
|
3240
3257
|
knownUndefinedValues: {},
|
|
3241
|
-
canDispatch: false
|
|
3258
|
+
canDispatch: false,
|
|
3259
|
+
isLoading: false
|
|
3242
3260
|
};
|
|
3243
3261
|
}
|
|
3244
3262
|
throw new Error("No VariablesProvider present");
|
|
@@ -3393,7 +3411,8 @@ function useVariablesMenu({
|
|
|
3393
3411
|
hasClickEvent: canEditVariable(value, targetVariable),
|
|
3394
3412
|
referenceIsValid: true,
|
|
3395
3413
|
tooltip: (_a = targetVariable == null ? void 0 : targetVariable.tooltip) != null ? _a : targetVariable == null ? void 0 : targetVariable.helpText,
|
|
3396
|
-
isFresh: true
|
|
3414
|
+
isFresh: true,
|
|
3415
|
+
isLoading: false
|
|
3397
3416
|
});
|
|
3398
3417
|
if (nodeToReplace) {
|
|
3399
3418
|
nodeToReplace.replace(variableNode);
|
|
@@ -3416,9 +3435,9 @@ function VariablesPlugin({
|
|
|
3416
3435
|
filterVariable
|
|
3417
3436
|
}) {
|
|
3418
3437
|
const [editor] = useLexicalComposerContext2();
|
|
3419
|
-
const { variables, dispatch, isEditing, canDispatch, readOnly, knownUndefinedValues } = useVariables(true);
|
|
3420
|
-
const variablesRef =
|
|
3421
|
-
variablesRef.current = { variables, knownUndefinedValues };
|
|
3438
|
+
const { variables, dispatch, isEditing, canDispatch, readOnly, knownUndefinedValues, isLoading } = useVariables(true);
|
|
3439
|
+
const variablesRef = useRef9({ variables, knownUndefinedValues, isLoading });
|
|
3440
|
+
variablesRef.current = { variables, knownUndefinedValues, isLoading };
|
|
3422
3441
|
const canEditVariable = useCallback(
|
|
3423
3442
|
(name, variable) => (
|
|
3424
3443
|
// name === '' means new var. Add var perms computed by menu options.
|
|
@@ -3527,7 +3546,8 @@ function VariablesPlugin({
|
|
|
3527
3546
|
hasClickEvent: canEditVariable(reference, targetVariable),
|
|
3528
3547
|
referenceIsValid: true,
|
|
3529
3548
|
tooltip: (_a = targetVariable == null ? void 0 : targetVariable.tooltip) != null ? _a : targetVariable == null ? void 0 : targetVariable.helpText,
|
|
3530
|
-
isFresh: true
|
|
3549
|
+
isFresh: true,
|
|
3550
|
+
isLoading: false
|
|
3531
3551
|
});
|
|
3532
3552
|
if (targetKey) {
|
|
3533
3553
|
(_b = $getNodeByKey(targetKey)) == null ? void 0 : _b.replace(variableNode);
|
|
@@ -3545,17 +3565,20 @@ function VariablesPlugin({
|
|
|
3545
3565
|
var _a, _b, _c;
|
|
3546
3566
|
const targetVar = variablesRef.current.variables[variableNode.reference];
|
|
3547
3567
|
const targetUndefinedVar = variablesRef.current.knownUndefinedValues[variableNode.reference];
|
|
3568
|
+
const isLoadingVariables = variablesRef.current.isLoading;
|
|
3548
3569
|
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;
|
|
3549
3570
|
const currentState = variableNode.getState();
|
|
3550
3571
|
const newState = {
|
|
3551
3572
|
...currentState,
|
|
3552
|
-
// if we lose a display name we 'latch' it to last known (prevents flashes during mesh var updates)
|
|
3553
|
-
|
|
3573
|
+
// if we lose a display name we 'latch' it to last known (prevents flashes during mesh var updates),
|
|
3574
|
+
// unless we're also loading the whole var state
|
|
3575
|
+
displayName: (targetVar == null ? void 0 : targetVar.displayName) || (isLoadingVariables ? void 0 : currentState.displayName) || variableNode.reference,
|
|
3576
|
+
isLoading: isLoadingVariables && !targetVar && !(targetUndefinedVar == null ? void 0 : targetUndefinedVar.info),
|
|
3554
3577
|
hasClickEvent: canEditVariable(variableNode.reference, targetVar),
|
|
3555
|
-
referenceIsValid: (targetUndefinedVar == null ? void 0 : targetUndefinedVar.info) ? "info" : Boolean(targetVar),
|
|
3578
|
+
referenceIsValid: (targetUndefinedVar == null ? void 0 : targetUndefinedVar.info) ? "info" : isLoadingVariables ? true : Boolean(targetVar),
|
|
3556
3579
|
tooltip
|
|
3557
3580
|
};
|
|
3558
|
-
if (!
|
|
3581
|
+
if (!dequal2(currentState, newState)) {
|
|
3559
3582
|
variableNode.setState(newState);
|
|
3560
3583
|
}
|
|
3561
3584
|
},
|
|
@@ -3671,7 +3694,8 @@ var VariableNode = class _VariableNode extends DecoratorNode {
|
|
|
3671
3694
|
referenceIsValid: true,
|
|
3672
3695
|
isFresh: false,
|
|
3673
3696
|
hasClickEvent: void 0,
|
|
3674
|
-
tooltip: void 0
|
|
3697
|
+
tooltip: void 0,
|
|
3698
|
+
isLoading: false
|
|
3675
3699
|
});
|
|
3676
3700
|
}
|
|
3677
3701
|
/** Gets the node's current state */
|
|
@@ -3812,6 +3836,7 @@ function VariableNodeComponent({
|
|
|
3812
3836
|
{
|
|
3813
3837
|
...state,
|
|
3814
3838
|
reference,
|
|
3839
|
+
displayName: state.isLoading ? /* @__PURE__ */ jsx33(LoadingIndicator2, { size: "sm" }) : state.displayName,
|
|
3815
3840
|
selected: isSelected,
|
|
3816
3841
|
onClick: state.hasClickEvent ? () => {
|
|
3817
3842
|
setSelected(!isSelected);
|
|
@@ -3922,7 +3947,7 @@ var input = css21`
|
|
|
3922
3947
|
`;
|
|
3923
3948
|
|
|
3924
3949
|
// src/components/Variables/toolbox/InputVariablesProvider.tsx
|
|
3925
|
-
import * as
|
|
3950
|
+
import * as React10 from "react";
|
|
3926
3951
|
import { useMemo as useMemo9 } from "react";
|
|
3927
3952
|
|
|
3928
3953
|
// src/components/Variables/util/hasReferencedVariables.ts
|
|
@@ -3953,14 +3978,14 @@ function useInputVariablesState({
|
|
|
3953
3978
|
}) {
|
|
3954
3979
|
const { variables } = useVariables(true);
|
|
3955
3980
|
const hasVariablesInValue = hasReferencedVariables(value != null ? value : "");
|
|
3956
|
-
const [lastKnownId] =
|
|
3957
|
-
const [hadVariablesInValue, setHadVariablesInValue] =
|
|
3958
|
-
|
|
3981
|
+
const [lastKnownId] = React10.useState(id);
|
|
3982
|
+
const [hadVariablesInValue, setHadVariablesInValue] = React10.useState(hasVariablesInValue);
|
|
3983
|
+
React10.useEffect(() => {
|
|
3959
3984
|
if (hasVariablesInValue) {
|
|
3960
3985
|
setHadVariablesInValue(true);
|
|
3961
3986
|
}
|
|
3962
3987
|
}, [hasVariablesInValue]);
|
|
3963
|
-
|
|
3988
|
+
React10.useEffect(() => {
|
|
3964
3989
|
if (id !== lastKnownId) {
|
|
3965
3990
|
setHadVariablesInValue(hasVariablesInValue);
|
|
3966
3991
|
}
|
|
@@ -4038,7 +4063,7 @@ import { CLEAR_EDITOR_COMMAND } from "lexical";
|
|
|
4038
4063
|
import { BsFillPlusCircleFill } from "@react-icons/all-files/bs/BsFillPlusCircleFill";
|
|
4039
4064
|
import { CgUsbC } from "@react-icons/all-files/cg/CgUsbC";
|
|
4040
4065
|
import { HorizontalRhythm as HorizontalRhythm2, Menu as Menu2, MenuGroup as MenuGroup2, MenuItem as MenuItem3, MenuItemSeparator as MenuItemSeparator2 } from "@uniformdev/design-system";
|
|
4041
|
-
import { useEffect as useEffect11, useRef as
|
|
4066
|
+
import { useEffect as useEffect11, useRef as useRef10, useState as useState10 } from "react";
|
|
4042
4067
|
import { Fragment as Fragment7, jsx as jsx34, jsxs as jsxs19 } from "@emotion/react/jsx-runtime";
|
|
4043
4068
|
function SelectVariableMenu({
|
|
4044
4069
|
onSelectVariable,
|
|
@@ -4052,7 +4077,7 @@ function SelectVariableMenu({
|
|
|
4052
4077
|
filterVariable
|
|
4053
4078
|
}) {
|
|
4054
4079
|
const { variables, dispatch, isEditing, canDispatch, readOnly } = useVariables(true);
|
|
4055
|
-
const btnRef =
|
|
4080
|
+
const btnRef = useRef10(null);
|
|
4056
4081
|
const [openedAdd, setOpenedAdd] = useState10(false);
|
|
4057
4082
|
useOnVariableUpdated(({ name, latestValue }) => {
|
|
4058
4083
|
onSelectVariable == null ? void 0 : onSelectVariable({ ...latestValue[name], name });
|
|
@@ -4191,7 +4216,7 @@ import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
|
4191
4216
|
import { ClearEditorPlugin } from "@lexical/react/LexicalClearEditorPlugin";
|
|
4192
4217
|
import { LexicalComposer } from "@lexical/react/LexicalComposer";
|
|
4193
4218
|
import { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin";
|
|
4194
|
-
import { useMemo as useMemo10, useRef as
|
|
4219
|
+
import { useMemo as useMemo10, useRef as useRef11, useState as useState11 } from "react";
|
|
4195
4220
|
|
|
4196
4221
|
// src/components/Variables/composer/DisablePlugin.tsx
|
|
4197
4222
|
import { useLexicalComposerContext as useLexicalComposerContext7 } from "@lexical/react/LexicalComposerContext";
|
|
@@ -4276,8 +4301,8 @@ function VariablesComposer(props) {
|
|
|
4276
4301
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4277
4302
|
[]
|
|
4278
4303
|
);
|
|
4279
|
-
const editorState =
|
|
4280
|
-
const updateTimeout =
|
|
4304
|
+
const editorState = useRef11();
|
|
4305
|
+
const updateTimeout = useRef11();
|
|
4281
4306
|
if (typeof document === "undefined")
|
|
4282
4307
|
return null;
|
|
4283
4308
|
return /* @__PURE__ */ jsxs21(LexicalComposer, { initialConfig: editorConfig, children: [
|
|
@@ -5107,11 +5132,11 @@ import { InputSelect as InputSelect4, JsonEditor } from "@uniformdev/design-syst
|
|
|
5107
5132
|
import { useState as useState13 } from "react";
|
|
5108
5133
|
|
|
5109
5134
|
// src/components/Request/RequestProvider.tsx
|
|
5110
|
-
import * as
|
|
5135
|
+
import * as React11 from "react";
|
|
5111
5136
|
import { jsx as jsx46 } from "@emotion/react/jsx-runtime";
|
|
5112
|
-
var RequestContext =
|
|
5137
|
+
var RequestContext = React11.createContext(null);
|
|
5113
5138
|
function RequestProvider({ value, onChange, children }) {
|
|
5114
|
-
const contextValue =
|
|
5139
|
+
const contextValue = React11.useMemo(() => {
|
|
5115
5140
|
return {
|
|
5116
5141
|
dispatch: (event) => {
|
|
5117
5142
|
if (event.type === "setRelativeUrl") {
|
|
@@ -5180,7 +5205,7 @@ function RequestProvider({ value, onChange, children }) {
|
|
|
5180
5205
|
return /* @__PURE__ */ jsx46(RequestContext.Provider, { value: contextValue, children });
|
|
5181
5206
|
}
|
|
5182
5207
|
function useRequest() {
|
|
5183
|
-
const context =
|
|
5208
|
+
const context = React11.useContext(RequestContext);
|
|
5184
5209
|
if (!context) {
|
|
5185
5210
|
throw new Error("No RequestProvider present");
|
|
5186
5211
|
}
|
|
@@ -5802,15 +5827,15 @@ function convertRequestDataToDataType(dataType, requestData) {
|
|
|
5802
5827
|
}
|
|
5803
5828
|
|
|
5804
5829
|
// src/components/MeshApp.tsx
|
|
5805
|
-
import { LoadingIndicator as
|
|
5830
|
+
import { LoadingIndicator as LoadingIndicator3, Theme as Theme2 } from "@uniformdev/design-system";
|
|
5806
5831
|
|
|
5807
5832
|
// src/hooks/useInitializeUniformMeshSdk.ts
|
|
5808
5833
|
import { initializeUniformMeshSDK } from "@uniformdev/mesh-sdk";
|
|
5809
|
-
import { useEffect as useEffect15, useRef as
|
|
5834
|
+
import { useEffect as useEffect15, useRef as useRef12, useState as useState14 } from "react";
|
|
5810
5835
|
var useInitializeUniformMeshSdk = ({ autoResizingDisabled } = {}) => {
|
|
5811
5836
|
const [error, setError] = useState14();
|
|
5812
5837
|
const [sdk, setSdk] = useState14();
|
|
5813
|
-
const initializationInProgress =
|
|
5838
|
+
const initializationInProgress = useRef12(false);
|
|
5814
5839
|
useEffect15(
|
|
5815
5840
|
() => {
|
|
5816
5841
|
if (typeof window === "undefined" || sdk) {
|
|
@@ -5853,7 +5878,7 @@ var MeshApp = ({
|
|
|
5853
5878
|
const { initializing, error, sdk } = useInitializeUniformMeshSdk();
|
|
5854
5879
|
if (initializing || !sdk) {
|
|
5855
5880
|
const LoadingComponent = loadingComponent;
|
|
5856
|
-
return LoadingComponent ? /* @__PURE__ */ jsx56(LoadingComponent, {}) : /* @__PURE__ */ jsx56(
|
|
5881
|
+
return LoadingComponent ? /* @__PURE__ */ jsx56(LoadingComponent, {}) : /* @__PURE__ */ jsx56(LoadingIndicator3, {});
|
|
5857
5882
|
}
|
|
5858
5883
|
if (error) {
|
|
5859
5884
|
const ErrorComponent = errorComponent;
|
|
@@ -5870,7 +5895,7 @@ var MeshApp = ({
|
|
|
5870
5895
|
|
|
5871
5896
|
// src/components/ObjectSearch/DataRefreshButton.tsx
|
|
5872
5897
|
import { css as css30 } from "@emotion/react";
|
|
5873
|
-
import { Button as Button3, LoadingIndicator as
|
|
5898
|
+
import { Button as Button3, LoadingIndicator as LoadingIndicator4 } from "@uniformdev/design-system";
|
|
5874
5899
|
import { jsx as jsx57, jsxs as jsxs33 } from "@emotion/react/jsx-runtime";
|
|
5875
5900
|
var DataRefreshButton = ({
|
|
5876
5901
|
buttonText,
|
|
@@ -5880,7 +5905,7 @@ var DataRefreshButton = ({
|
|
|
5880
5905
|
}) => {
|
|
5881
5906
|
return /* @__PURE__ */ jsxs33(Button3, { buttonType: "primaryInvert", onClick: onRefreshData, disabled: isLoading, ...props, children: [
|
|
5882
5907
|
!isLoading ? null : /* @__PURE__ */ jsx57(
|
|
5883
|
-
|
|
5908
|
+
LoadingIndicator4,
|
|
5884
5909
|
{
|
|
5885
5910
|
css: css30`
|
|
5886
5911
|
${isLoading ? "opacity: 0.2;" : void 0}
|
|
@@ -6775,7 +6800,7 @@ var QueryFilter = ({
|
|
|
6775
6800
|
};
|
|
6776
6801
|
|
|
6777
6802
|
// src/components/ParamTypeDynamicDataProvider.tsx
|
|
6778
|
-
import { useEffect as useEffect17, useMemo as useMemo15, useRef as
|
|
6803
|
+
import { useEffect as useEffect17, useMemo as useMemo15, useRef as useRef13 } from "react";
|
|
6779
6804
|
import { jsx as jsx67 } from "@emotion/react/jsx-runtime";
|
|
6780
6805
|
function ParamTypeDynamicDataProvider(props) {
|
|
6781
6806
|
const { children } = props;
|
|
@@ -6797,7 +6822,7 @@ var JsonMeshVariableEditor = ({
|
|
|
6797
6822
|
variable,
|
|
6798
6823
|
context
|
|
6799
6824
|
}) => {
|
|
6800
|
-
const sillyRef =
|
|
6825
|
+
const sillyRef = useRef13(false);
|
|
6801
6826
|
const { editConnectedData } = useMeshLocation("paramType");
|
|
6802
6827
|
useEffect17(() => {
|
|
6803
6828
|
if (sillyRef.current) {
|
|
@@ -6848,7 +6873,7 @@ import {
|
|
|
6848
6873
|
InputSelect as InputSelect8,
|
|
6849
6874
|
InputToggle,
|
|
6850
6875
|
Label,
|
|
6851
|
-
LoadingIndicator as
|
|
6876
|
+
LoadingIndicator as LoadingIndicator5,
|
|
6852
6877
|
LoadingOverlay as LoadingOverlay2,
|
|
6853
6878
|
Menu as Menu4,
|
|
6854
6879
|
MenuItem as MenuItem4,
|
|
@@ -6903,7 +6928,7 @@ export {
|
|
|
6903
6928
|
InputVariables,
|
|
6904
6929
|
Label,
|
|
6905
6930
|
LinkButton,
|
|
6906
|
-
|
|
6931
|
+
LoadingIndicator5 as LoadingIndicator,
|
|
6907
6932
|
LoadingOverlay2 as LoadingOverlay,
|
|
6908
6933
|
Menu4 as Menu,
|
|
6909
6934
|
MenuItem4 as MenuItem,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk-react",
|
|
3
|
-
"version": "19.45.
|
|
3
|
+
"version": "19.45.2-alpha.6+ea4628ae5",
|
|
4
4
|
"description": "Uniform Mesh Framework SDK for React",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"@lexical/selection": "^0.12.0",
|
|
50
50
|
"@lexical/utils": "^0.12.0",
|
|
51
51
|
"@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v4.10.1/react-icons-all-files-4.10.1.tgz",
|
|
52
|
-
"@uniformdev/canvas": "19.45.
|
|
53
|
-
"@uniformdev/design-system": "19.45.
|
|
54
|
-
"@uniformdev/mesh-sdk": "19.45.
|
|
52
|
+
"@uniformdev/canvas": "19.45.2-alpha.6+ea4628ae5",
|
|
53
|
+
"@uniformdev/design-system": "19.45.2-alpha.6+ea4628ae5",
|
|
54
|
+
"@uniformdev/mesh-sdk": "19.45.2-alpha.6+ea4628ae5",
|
|
55
55
|
"dequal": "^2.0.3",
|
|
56
56
|
"lexical": "^0.12.0",
|
|
57
57
|
"mitt": "^3.0.0",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "ea4628ae5765af32b174d3dac546fed03170c9aa"
|
|
89
89
|
}
|