@uniformdev/mesh-sdk 19.58.0 → 19.58.1
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.esm.js +36 -2
- package/dist/index.js +36 -2
- package/dist/index.mjs +36 -2
- package/package.json +5 -5
package/dist/index.esm.js
CHANGED
|
@@ -646,23 +646,57 @@ async function initializeUniformMeshSDK({
|
|
|
646
646
|
}
|
|
647
647
|
initializing = true;
|
|
648
648
|
let currentMetadata = void 0;
|
|
649
|
+
let temporaryConnectedDataMetadata = void 0;
|
|
649
650
|
const events = mitt();
|
|
650
651
|
const connectResult = await connectToParent({
|
|
651
652
|
dialogResponseHandlers: sdkDialogResponseHandlers,
|
|
652
653
|
onMetadataUpdated: (newMeta) => {
|
|
654
|
+
const typedNewMeta = newMeta;
|
|
655
|
+
if (connectResult.initData.locationType === "paramType") {
|
|
656
|
+
const newMetaAsParamType = typedNewMeta;
|
|
657
|
+
if (temporaryConnectedDataMetadata) {
|
|
658
|
+
if (!newMetaAsParamType.connectedData[temporaryConnectedDataMetadata.key]) {
|
|
659
|
+
newMeta = {
|
|
660
|
+
...typedNewMeta,
|
|
661
|
+
connectedData: {
|
|
662
|
+
[temporaryConnectedDataMetadata.key]: temporaryConnectedDataMetadata.value,
|
|
663
|
+
...newMetaAsParamType.connectedData
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
} else {
|
|
667
|
+
temporaryConnectedDataMetadata = void 0;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
653
671
|
console.debug("Received metadata update", newMeta);
|
|
654
|
-
currentMetadata =
|
|
672
|
+
currentMetadata = typedNewMeta;
|
|
655
673
|
events.emit("onMetadataChanged", { newValue: newMeta });
|
|
656
674
|
}
|
|
657
675
|
});
|
|
658
676
|
const { initData: contextData, parent } = connectResult;
|
|
677
|
+
const editConnectedData = async (options) => {
|
|
678
|
+
const result = await parent.editConnectedData(options);
|
|
679
|
+
if (!result.canceled && contextData.locationType === "paramType") {
|
|
680
|
+
temporaryConnectedDataMetadata = {
|
|
681
|
+
key: result.connectedData.name,
|
|
682
|
+
value: result.connectedData.default
|
|
683
|
+
};
|
|
684
|
+
const newMeta = currentMetadata;
|
|
685
|
+
newMeta.connectedData = {
|
|
686
|
+
...currentMetadata.connectedData,
|
|
687
|
+
[result.connectedData.name]: result.connectedData.default
|
|
688
|
+
};
|
|
689
|
+
events.emit("onMetadataChanged", { newValue: newMeta });
|
|
690
|
+
}
|
|
691
|
+
return result;
|
|
692
|
+
};
|
|
659
693
|
currentMetadata = contextData.locationMetadata;
|
|
660
694
|
const sdk = {
|
|
661
695
|
events,
|
|
662
696
|
getCurrentLocation: () => {
|
|
663
697
|
const location = {
|
|
664
698
|
getDataResource: parent.getDataResource,
|
|
665
|
-
editConnectedData
|
|
699
|
+
editConnectedData,
|
|
666
700
|
type: contextData.locationType,
|
|
667
701
|
isReadOnly: contextData.isReadOnly,
|
|
668
702
|
value: contextData.locationValue,
|
package/dist/index.js
CHANGED
|
@@ -683,23 +683,57 @@ async function initializeUniformMeshSDK({
|
|
|
683
683
|
}
|
|
684
684
|
initializing = true;
|
|
685
685
|
let currentMetadata = void 0;
|
|
686
|
+
let temporaryConnectedDataMetadata = void 0;
|
|
686
687
|
const events = (0, import_mitt.default)();
|
|
687
688
|
const connectResult = await connectToParent({
|
|
688
689
|
dialogResponseHandlers: sdkDialogResponseHandlers,
|
|
689
690
|
onMetadataUpdated: (newMeta) => {
|
|
691
|
+
const typedNewMeta = newMeta;
|
|
692
|
+
if (connectResult.initData.locationType === "paramType") {
|
|
693
|
+
const newMetaAsParamType = typedNewMeta;
|
|
694
|
+
if (temporaryConnectedDataMetadata) {
|
|
695
|
+
if (!newMetaAsParamType.connectedData[temporaryConnectedDataMetadata.key]) {
|
|
696
|
+
newMeta = {
|
|
697
|
+
...typedNewMeta,
|
|
698
|
+
connectedData: {
|
|
699
|
+
[temporaryConnectedDataMetadata.key]: temporaryConnectedDataMetadata.value,
|
|
700
|
+
...newMetaAsParamType.connectedData
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
} else {
|
|
704
|
+
temporaryConnectedDataMetadata = void 0;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
690
708
|
console.debug("Received metadata update", newMeta);
|
|
691
|
-
currentMetadata =
|
|
709
|
+
currentMetadata = typedNewMeta;
|
|
692
710
|
events.emit("onMetadataChanged", { newValue: newMeta });
|
|
693
711
|
}
|
|
694
712
|
});
|
|
695
713
|
const { initData: contextData, parent } = connectResult;
|
|
714
|
+
const editConnectedData = async (options) => {
|
|
715
|
+
const result = await parent.editConnectedData(options);
|
|
716
|
+
if (!result.canceled && contextData.locationType === "paramType") {
|
|
717
|
+
temporaryConnectedDataMetadata = {
|
|
718
|
+
key: result.connectedData.name,
|
|
719
|
+
value: result.connectedData.default
|
|
720
|
+
};
|
|
721
|
+
const newMeta = currentMetadata;
|
|
722
|
+
newMeta.connectedData = {
|
|
723
|
+
...currentMetadata.connectedData,
|
|
724
|
+
[result.connectedData.name]: result.connectedData.default
|
|
725
|
+
};
|
|
726
|
+
events.emit("onMetadataChanged", { newValue: newMeta });
|
|
727
|
+
}
|
|
728
|
+
return result;
|
|
729
|
+
};
|
|
696
730
|
currentMetadata = contextData.locationMetadata;
|
|
697
731
|
const sdk = {
|
|
698
732
|
events,
|
|
699
733
|
getCurrentLocation: () => {
|
|
700
734
|
const location = {
|
|
701
735
|
getDataResource: parent.getDataResource,
|
|
702
|
-
editConnectedData
|
|
736
|
+
editConnectedData,
|
|
703
737
|
type: contextData.locationType,
|
|
704
738
|
isReadOnly: contextData.isReadOnly,
|
|
705
739
|
value: contextData.locationValue,
|
package/dist/index.mjs
CHANGED
|
@@ -646,23 +646,57 @@ async function initializeUniformMeshSDK({
|
|
|
646
646
|
}
|
|
647
647
|
initializing = true;
|
|
648
648
|
let currentMetadata = void 0;
|
|
649
|
+
let temporaryConnectedDataMetadata = void 0;
|
|
649
650
|
const events = mitt();
|
|
650
651
|
const connectResult = await connectToParent({
|
|
651
652
|
dialogResponseHandlers: sdkDialogResponseHandlers,
|
|
652
653
|
onMetadataUpdated: (newMeta) => {
|
|
654
|
+
const typedNewMeta = newMeta;
|
|
655
|
+
if (connectResult.initData.locationType === "paramType") {
|
|
656
|
+
const newMetaAsParamType = typedNewMeta;
|
|
657
|
+
if (temporaryConnectedDataMetadata) {
|
|
658
|
+
if (!newMetaAsParamType.connectedData[temporaryConnectedDataMetadata.key]) {
|
|
659
|
+
newMeta = {
|
|
660
|
+
...typedNewMeta,
|
|
661
|
+
connectedData: {
|
|
662
|
+
[temporaryConnectedDataMetadata.key]: temporaryConnectedDataMetadata.value,
|
|
663
|
+
...newMetaAsParamType.connectedData
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
} else {
|
|
667
|
+
temporaryConnectedDataMetadata = void 0;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
}
|
|
653
671
|
console.debug("Received metadata update", newMeta);
|
|
654
|
-
currentMetadata =
|
|
672
|
+
currentMetadata = typedNewMeta;
|
|
655
673
|
events.emit("onMetadataChanged", { newValue: newMeta });
|
|
656
674
|
}
|
|
657
675
|
});
|
|
658
676
|
const { initData: contextData, parent } = connectResult;
|
|
677
|
+
const editConnectedData = async (options) => {
|
|
678
|
+
const result = await parent.editConnectedData(options);
|
|
679
|
+
if (!result.canceled && contextData.locationType === "paramType") {
|
|
680
|
+
temporaryConnectedDataMetadata = {
|
|
681
|
+
key: result.connectedData.name,
|
|
682
|
+
value: result.connectedData.default
|
|
683
|
+
};
|
|
684
|
+
const newMeta = currentMetadata;
|
|
685
|
+
newMeta.connectedData = {
|
|
686
|
+
...currentMetadata.connectedData,
|
|
687
|
+
[result.connectedData.name]: result.connectedData.default
|
|
688
|
+
};
|
|
689
|
+
events.emit("onMetadataChanged", { newValue: newMeta });
|
|
690
|
+
}
|
|
691
|
+
return result;
|
|
692
|
+
};
|
|
659
693
|
currentMetadata = contextData.locationMetadata;
|
|
660
694
|
const sdk = {
|
|
661
695
|
events,
|
|
662
696
|
getCurrentLocation: () => {
|
|
663
697
|
const location = {
|
|
664
698
|
getDataResource: parent.getDataResource,
|
|
665
|
-
editConnectedData
|
|
699
|
+
editConnectedData,
|
|
666
700
|
type: contextData.locationType,
|
|
667
701
|
isReadOnly: contextData.isReadOnly,
|
|
668
702
|
value: contextData.locationValue,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk",
|
|
3
|
-
"version": "19.58.
|
|
3
|
+
"version": "19.58.1",
|
|
4
4
|
"description": "Uniform Mesh Framework SDK",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@uniformdev/canvas": "19.58.
|
|
37
|
-
"@uniformdev/context": "19.58.
|
|
38
|
-
"@uniformdev/project-map": "19.58.
|
|
36
|
+
"@uniformdev/canvas": "19.58.1",
|
|
37
|
+
"@uniformdev/context": "19.58.1",
|
|
38
|
+
"@uniformdev/project-map": "19.58.1",
|
|
39
39
|
"imagesloaded": "^5.0.0",
|
|
40
40
|
"mitt": "^3.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/imagesloaded": "^4.1.2"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "b889f843979b69f4d17fc6d12a95cc040d9975ad"
|
|
46
46
|
}
|