@uniformdev/mesh-sdk 19.38.2 → 19.38.3-alpha.78
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 +52 -8
- package/dist/index.d.ts +52 -8
- package/dist/index.esm.js +29 -16
- package/dist/index.js +29 -16
- package/dist/index.mjs +29 -16
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ApiClient, ClientOptions, ExceptProject } from '@uniformdev/context/api';
|
|
2
|
-
import { DataSource, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, DataType
|
|
2
|
+
import { DataSource, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, DataType, DataVariableDefinition, DataResourceVariables } from '@uniformdev/canvas';
|
|
3
3
|
import { ProjectMapNode } from '@uniformdev/project-map';
|
|
4
|
-
import { DataType } from '@uniformdev/canvas/.';
|
|
5
4
|
import { Emitter } from 'mitt';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -646,10 +645,28 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
|
|
|
646
645
|
settings: TIntegrationConfiguration;
|
|
647
646
|
/** The Uniform project ID */
|
|
648
647
|
projectId: string;
|
|
649
|
-
/**
|
|
648
|
+
/**
|
|
649
|
+
* Current dynamic inputs that are configured on the composition (if any).
|
|
650
|
+
* Use the <ParamTypeDynamicDataProvider> to wire up dynamic data in your parameter.
|
|
651
|
+
*/
|
|
650
652
|
dynamicInputs: DynamicInputs;
|
|
653
|
+
/**
|
|
654
|
+
* The connected data for the current component. Connected data is provided as a map
|
|
655
|
+
* of the binding expression text to the value of that binding expression. For example,
|
|
656
|
+
* if the value is "Hello ${#jptr:/MyData/fields/name}" then this value would be:
|
|
657
|
+
* { "#jptr:/MyData/fields/name": "value-of-connected-data" }
|
|
658
|
+
*
|
|
659
|
+
* Use the <ParamTypeDynamicDataProvider> to wire up dynamic data in your parameter.
|
|
660
|
+
*/
|
|
661
|
+
connectedData: Record<string, unknown>;
|
|
662
|
+
};
|
|
663
|
+
type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'> & {
|
|
664
|
+
/**
|
|
665
|
+
* Opens a dialog on the Uniform platform to edit or select a dynamic token to connect to.
|
|
666
|
+
* Returns the result of the dialog. Useful to build data-enabled parameter types.
|
|
667
|
+
*/
|
|
668
|
+
editConnectedData: Awaited<ReturnType<typeof connectToParent>>['parent']['editConnectedData'];
|
|
651
669
|
};
|
|
652
|
-
type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'>;
|
|
653
670
|
|
|
654
671
|
type SettingsLocationMetadata = {
|
|
655
672
|
projectId: string;
|
|
@@ -687,7 +704,7 @@ interface DialogResponseData {
|
|
|
687
704
|
dialogId: string;
|
|
688
705
|
error?: string;
|
|
689
706
|
}
|
|
690
|
-
type DialogType = 'location' | 'confirm';
|
|
707
|
+
type DialogType = 'location' | 'confirm' | 'currentLocation';
|
|
691
708
|
type OpenDialogResult = {
|
|
692
709
|
/** Unique ID of this dialog which can be used to close it */
|
|
693
710
|
dialogId: string;
|
|
@@ -698,6 +715,7 @@ type OpenDialogResult = {
|
|
|
698
715
|
*/
|
|
699
716
|
dialogLocation?: string;
|
|
700
717
|
};
|
|
718
|
+
type DialogSizes = 'narrow' | 'medium' | 'wide';
|
|
701
719
|
interface DialogOptions<TDialogParams = DialogParams> {
|
|
702
720
|
/**
|
|
703
721
|
* By default, dialogs will be closed when they set a value.
|
|
@@ -709,8 +727,13 @@ interface DialogOptions<TDialogParams = DialogParams> {
|
|
|
709
727
|
disableCloseDialogOnSetValue?: boolean;
|
|
710
728
|
/**
|
|
711
729
|
* Options for setting the max width of the dialog.
|
|
730
|
+
* @deprecated Use `width` instead. This property will become ignored in a future release.
|
|
712
731
|
*/
|
|
713
732
|
maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | 'full';
|
|
733
|
+
/**
|
|
734
|
+
* Options for setting the width of the dialog.
|
|
735
|
+
*/
|
|
736
|
+
width?: DialogSizes;
|
|
714
737
|
/**
|
|
715
738
|
* Parameters to pass to the dialog, which will be available in the dialog via
|
|
716
739
|
* the `metadata` object for the dialog location, e.g. `metadata.dialogParams`.
|
|
@@ -754,6 +777,25 @@ type CloseDialogMessage = {
|
|
|
754
777
|
dialogData?: unknown;
|
|
755
778
|
};
|
|
756
779
|
type GetDataResourceMessage = Pick<DataType, 'path' | 'headers' | 'parameters' | 'body' | 'method'>;
|
|
780
|
+
/** Primitive data types that a parameter type accepts to be bound to composition data */
|
|
781
|
+
type BindableTypes = 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
782
|
+
/** Message to parent to create a data connection expression to insert in a param type */
|
|
783
|
+
type EditConnectedDataMessage = {
|
|
784
|
+
/** Bind expression for existing connected data */
|
|
785
|
+
existingConnectedData?: string;
|
|
786
|
+
allowedTypes: BindableTypes[];
|
|
787
|
+
};
|
|
788
|
+
/** Response from parent when creating a data connection expression */
|
|
789
|
+
type EditConnectedDataResponse = {
|
|
790
|
+
canceled: false;
|
|
791
|
+
/** Bind expression for selected data connection */
|
|
792
|
+
connectedData: DataVariableDefinition & {
|
|
793
|
+
name: string;
|
|
794
|
+
};
|
|
795
|
+
} | {
|
|
796
|
+
/** User cancelled selecting dynamic token */
|
|
797
|
+
canceled: true;
|
|
798
|
+
};
|
|
757
799
|
|
|
758
800
|
type MeshSDKEventInterface = Awaited<ReturnType<typeof connectToParent>>['parent'] & {
|
|
759
801
|
initialize: () => Promise<MeshContextData>;
|
|
@@ -775,6 +817,7 @@ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, }:
|
|
|
775
817
|
openDialog: (message: OpenDialogMessage) => Promise<Pick<DialogResponseData, "value" | "dialogId"> | undefined>;
|
|
776
818
|
closeDialog: (message: CloseDialogMessage) => Promise<void>;
|
|
777
819
|
getDataResource: <TExpectedResult>(message: GetDataResourceMessage) => Promise<TExpectedResult>;
|
|
820
|
+
editConnectedData: (message: EditConnectedDataMessage) => Promise<EditConnectedDataResponse>;
|
|
778
821
|
};
|
|
779
822
|
}>;
|
|
780
823
|
|
|
@@ -823,6 +866,7 @@ type SetValueOptions = ValidationResult;
|
|
|
823
866
|
type SetValueMessage = {
|
|
824
867
|
uniformMeshLocationValue: unknown;
|
|
825
868
|
options?: SetValueOptions;
|
|
869
|
+
closeDialog?: boolean;
|
|
826
870
|
};
|
|
827
871
|
type GetDataResourceLocation = {
|
|
828
872
|
getDataResource: Awaited<ReturnType<typeof connectToParent>>['parent']['getDataResource'];
|
|
@@ -843,7 +887,7 @@ type DynamicInput = {
|
|
|
843
887
|
/** Record of dynamic inputs keyed by the input name */
|
|
844
888
|
type DynamicInputs = Record<string, DynamicInput>;
|
|
845
889
|
|
|
846
|
-
type DataTypeLocationValue = Pick<DataType
|
|
890
|
+
type DataTypeLocationValue = Pick<DataType, 'body' | 'method' | 'path' | 'custom' | 'headers' | 'parameters' | 'variables'>;
|
|
847
891
|
type DataConnectorInfo = {
|
|
848
892
|
type: string;
|
|
849
893
|
displayName: string;
|
|
@@ -868,7 +912,7 @@ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = {
|
|
|
868
912
|
/** Settings defined at the integration level (arbitrary type used on settings location) */
|
|
869
913
|
settings: TIntegrationConfiguration;
|
|
870
914
|
/** The current data resource's data type */
|
|
871
|
-
dataType: DataType
|
|
915
|
+
dataType: DataType;
|
|
872
916
|
/** The data type's archetype value. */
|
|
873
917
|
archetype: string;
|
|
874
918
|
/**
|
|
@@ -990,4 +1034,4 @@ declare function initializeUniformMeshSDK({ autoResizingDisabled, }?: {
|
|
|
990
1034
|
autoResizingDisabled?: boolean;
|
|
991
1035
|
}): Promise<UniformMeshSDK | undefined>;
|
|
992
1036
|
|
|
993
|
-
export { CSSHeight, CloseDialogMessage, CloseLocationDialogOptions, DataConnectorInfo, DataResourceLocation, DataResourceLocationMetadata, DataSourceLocation, DataSourceLocationMetadata, DataSourceLocationValue, DataTypeLocation, DataTypeLocationMetadata, DataTypeLocationValue, DialogContext, DialogOptions, DialogParamValue, DialogParams, DialogResponseData, DialogResponseHandler, DialogResponseHandlers, DialogType, DynamicInput, DynamicInputs, GetDataResourceLocation, GetDataResourceMessage, IntegrationDefinitionClient, IntegrationDefinitionDeleteParameters, IntegrationDefinitionGetParameters, IntegrationDefinitionGetResponse, IntegrationDefinitionPutParameters, IntegrationDefinitionPutResponse, IntegrationInstallationClient, IntegrationInstallationDeleteParameters, IntegrationInstallationGetParameters, IntegrationInstallationGetResponse, IntegrationInstallationPutParameters, LocationDialogResponse, MeshContextData, MeshLocation, MeshLocationCore, MeshLocationTypes, MeshSDKEventInterface, OpenConfirmationDialogOptions, OpenConfirmationDialogResult, OpenDialogMessage, OpenDialogResult, OpenLocationDialogOptions, ParamTypeConfigLocation, ParamTypeConfigLocationMetadata, ParamTypeLocation, ParamTypeLocationMetadata, SdkWindow, SetLocationFunction, SetValueMessage, SetValueOptions, SettingsLocation, SettingsLocationMetadata, UniformMeshSDK, UniformMeshSDKEvents, ValidationResult, initializeUniformMeshSDK };
|
|
1037
|
+
export { BindableTypes, CSSHeight, CloseDialogMessage, CloseLocationDialogOptions, DataConnectorInfo, DataResourceLocation, DataResourceLocationMetadata, DataSourceLocation, DataSourceLocationMetadata, DataSourceLocationValue, DataTypeLocation, DataTypeLocationMetadata, DataTypeLocationValue, DialogContext, DialogOptions, DialogParamValue, DialogParams, DialogResponseData, DialogResponseHandler, DialogResponseHandlers, DialogType, DynamicInput, DynamicInputs, EditConnectedDataMessage, EditConnectedDataResponse, GetDataResourceLocation, GetDataResourceMessage, IntegrationDefinitionClient, IntegrationDefinitionDeleteParameters, IntegrationDefinitionGetParameters, IntegrationDefinitionGetResponse, IntegrationDefinitionPutParameters, IntegrationDefinitionPutResponse, IntegrationInstallationClient, IntegrationInstallationDeleteParameters, IntegrationInstallationGetParameters, IntegrationInstallationGetResponse, IntegrationInstallationPutParameters, LocationDialogResponse, MeshContextData, MeshLocation, MeshLocationCore, MeshLocationTypes, MeshSDKEventInterface, OpenConfirmationDialogOptions, OpenConfirmationDialogResult, OpenDialogMessage, OpenDialogResult, OpenLocationDialogOptions, ParamTypeConfigLocation, ParamTypeConfigLocationMetadata, ParamTypeLocation, ParamTypeLocationMetadata, SdkWindow, SetLocationFunction, SetValueMessage, SetValueOptions, SettingsLocation, SettingsLocationMetadata, UniformMeshSDK, UniformMeshSDKEvents, ValidationResult, initializeUniformMeshSDK };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ApiClient, ClientOptions, ExceptProject } from '@uniformdev/context/api';
|
|
2
|
-
import { DataSource, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, DataType
|
|
2
|
+
import { DataSource, RootComponentInstance, ComponentInstance, ComponentDefinition, ComponentDefinitionParameter, DataType, DataVariableDefinition, DataResourceVariables } from '@uniformdev/canvas';
|
|
3
3
|
import { ProjectMapNode } from '@uniformdev/project-map';
|
|
4
|
-
import { DataType } from '@uniformdev/canvas/.';
|
|
5
4
|
import { Emitter } from 'mitt';
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -646,10 +645,28 @@ type ParamTypeLocationMetadata<TParamConfiguration = unknown, TIntegrationConfig
|
|
|
646
645
|
settings: TIntegrationConfiguration;
|
|
647
646
|
/** The Uniform project ID */
|
|
648
647
|
projectId: string;
|
|
649
|
-
/**
|
|
648
|
+
/**
|
|
649
|
+
* Current dynamic inputs that are configured on the composition (if any).
|
|
650
|
+
* Use the <ParamTypeDynamicDataProvider> to wire up dynamic data in your parameter.
|
|
651
|
+
*/
|
|
650
652
|
dynamicInputs: DynamicInputs;
|
|
653
|
+
/**
|
|
654
|
+
* The connected data for the current component. Connected data is provided as a map
|
|
655
|
+
* of the binding expression text to the value of that binding expression. For example,
|
|
656
|
+
* if the value is "Hello ${#jptr:/MyData/fields/name}" then this value would be:
|
|
657
|
+
* { "#jptr:/MyData/fields/name": "value-of-connected-data" }
|
|
658
|
+
*
|
|
659
|
+
* Use the <ParamTypeDynamicDataProvider> to wire up dynamic data in your parameter.
|
|
660
|
+
*/
|
|
661
|
+
connectedData: Record<string, unknown>;
|
|
662
|
+
};
|
|
663
|
+
type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'> & {
|
|
664
|
+
/**
|
|
665
|
+
* Opens a dialog on the Uniform platform to edit or select a dynamic token to connect to.
|
|
666
|
+
* Returns the result of the dialog. Useful to build data-enabled parameter types.
|
|
667
|
+
*/
|
|
668
|
+
editConnectedData: Awaited<ReturnType<typeof connectToParent>>['parent']['editConnectedData'];
|
|
651
669
|
};
|
|
652
|
-
type ParamTypeLocation<TParamValue = unknown, TParamConfiguration = unknown, TParamSetValue = TParamValue, TIntegrationConfiguration = unknown> = MeshLocationCore<TParamValue | undefined, ParamTypeLocationMetadata<TParamConfiguration, TIntegrationConfiguration>, TParamSetValue, 'paramType'>;
|
|
653
670
|
|
|
654
671
|
type SettingsLocationMetadata = {
|
|
655
672
|
projectId: string;
|
|
@@ -687,7 +704,7 @@ interface DialogResponseData {
|
|
|
687
704
|
dialogId: string;
|
|
688
705
|
error?: string;
|
|
689
706
|
}
|
|
690
|
-
type DialogType = 'location' | 'confirm';
|
|
707
|
+
type DialogType = 'location' | 'confirm' | 'currentLocation';
|
|
691
708
|
type OpenDialogResult = {
|
|
692
709
|
/** Unique ID of this dialog which can be used to close it */
|
|
693
710
|
dialogId: string;
|
|
@@ -698,6 +715,7 @@ type OpenDialogResult = {
|
|
|
698
715
|
*/
|
|
699
716
|
dialogLocation?: string;
|
|
700
717
|
};
|
|
718
|
+
type DialogSizes = 'narrow' | 'medium' | 'wide';
|
|
701
719
|
interface DialogOptions<TDialogParams = DialogParams> {
|
|
702
720
|
/**
|
|
703
721
|
* By default, dialogs will be closed when they set a value.
|
|
@@ -709,8 +727,13 @@ interface DialogOptions<TDialogParams = DialogParams> {
|
|
|
709
727
|
disableCloseDialogOnSetValue?: boolean;
|
|
710
728
|
/**
|
|
711
729
|
* Options for setting the max width of the dialog.
|
|
730
|
+
* @deprecated Use `width` instead. This property will become ignored in a future release.
|
|
712
731
|
*/
|
|
713
732
|
maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | 'full';
|
|
733
|
+
/**
|
|
734
|
+
* Options for setting the width of the dialog.
|
|
735
|
+
*/
|
|
736
|
+
width?: DialogSizes;
|
|
714
737
|
/**
|
|
715
738
|
* Parameters to pass to the dialog, which will be available in the dialog via
|
|
716
739
|
* the `metadata` object for the dialog location, e.g. `metadata.dialogParams`.
|
|
@@ -754,6 +777,25 @@ type CloseDialogMessage = {
|
|
|
754
777
|
dialogData?: unknown;
|
|
755
778
|
};
|
|
756
779
|
type GetDataResourceMessage = Pick<DataType, 'path' | 'headers' | 'parameters' | 'body' | 'method'>;
|
|
780
|
+
/** Primitive data types that a parameter type accepts to be bound to composition data */
|
|
781
|
+
type BindableTypes = 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
782
|
+
/** Message to parent to create a data connection expression to insert in a param type */
|
|
783
|
+
type EditConnectedDataMessage = {
|
|
784
|
+
/** Bind expression for existing connected data */
|
|
785
|
+
existingConnectedData?: string;
|
|
786
|
+
allowedTypes: BindableTypes[];
|
|
787
|
+
};
|
|
788
|
+
/** Response from parent when creating a data connection expression */
|
|
789
|
+
type EditConnectedDataResponse = {
|
|
790
|
+
canceled: false;
|
|
791
|
+
/** Bind expression for selected data connection */
|
|
792
|
+
connectedData: DataVariableDefinition & {
|
|
793
|
+
name: string;
|
|
794
|
+
};
|
|
795
|
+
} | {
|
|
796
|
+
/** User cancelled selecting dynamic token */
|
|
797
|
+
canceled: true;
|
|
798
|
+
};
|
|
757
799
|
|
|
758
800
|
type MeshSDKEventInterface = Awaited<ReturnType<typeof connectToParent>>['parent'] & {
|
|
759
801
|
initialize: () => Promise<MeshContextData>;
|
|
@@ -775,6 +817,7 @@ declare function connectToParent({ dialogResponseHandlers, onMetadataUpdated, }:
|
|
|
775
817
|
openDialog: (message: OpenDialogMessage) => Promise<Pick<DialogResponseData, "value" | "dialogId"> | undefined>;
|
|
776
818
|
closeDialog: (message: CloseDialogMessage) => Promise<void>;
|
|
777
819
|
getDataResource: <TExpectedResult>(message: GetDataResourceMessage) => Promise<TExpectedResult>;
|
|
820
|
+
editConnectedData: (message: EditConnectedDataMessage) => Promise<EditConnectedDataResponse>;
|
|
778
821
|
};
|
|
779
822
|
}>;
|
|
780
823
|
|
|
@@ -823,6 +866,7 @@ type SetValueOptions = ValidationResult;
|
|
|
823
866
|
type SetValueMessage = {
|
|
824
867
|
uniformMeshLocationValue: unknown;
|
|
825
868
|
options?: SetValueOptions;
|
|
869
|
+
closeDialog?: boolean;
|
|
826
870
|
};
|
|
827
871
|
type GetDataResourceLocation = {
|
|
828
872
|
getDataResource: Awaited<ReturnType<typeof connectToParent>>['parent']['getDataResource'];
|
|
@@ -843,7 +887,7 @@ type DynamicInput = {
|
|
|
843
887
|
/** Record of dynamic inputs keyed by the input name */
|
|
844
888
|
type DynamicInputs = Record<string, DynamicInput>;
|
|
845
889
|
|
|
846
|
-
type DataTypeLocationValue = Pick<DataType
|
|
890
|
+
type DataTypeLocationValue = Pick<DataType, 'body' | 'method' | 'path' | 'custom' | 'headers' | 'parameters' | 'variables'>;
|
|
847
891
|
type DataConnectorInfo = {
|
|
848
892
|
type: string;
|
|
849
893
|
displayName: string;
|
|
@@ -868,7 +912,7 @@ type DataResourceLocationMetadata<TIntegrationConfiguration = unknown> = {
|
|
|
868
912
|
/** Settings defined at the integration level (arbitrary type used on settings location) */
|
|
869
913
|
settings: TIntegrationConfiguration;
|
|
870
914
|
/** The current data resource's data type */
|
|
871
|
-
dataType: DataType
|
|
915
|
+
dataType: DataType;
|
|
872
916
|
/** The data type's archetype value. */
|
|
873
917
|
archetype: string;
|
|
874
918
|
/**
|
|
@@ -990,4 +1034,4 @@ declare function initializeUniformMeshSDK({ autoResizingDisabled, }?: {
|
|
|
990
1034
|
autoResizingDisabled?: boolean;
|
|
991
1035
|
}): Promise<UniformMeshSDK | undefined>;
|
|
992
1036
|
|
|
993
|
-
export { CSSHeight, CloseDialogMessage, CloseLocationDialogOptions, DataConnectorInfo, DataResourceLocation, DataResourceLocationMetadata, DataSourceLocation, DataSourceLocationMetadata, DataSourceLocationValue, DataTypeLocation, DataTypeLocationMetadata, DataTypeLocationValue, DialogContext, DialogOptions, DialogParamValue, DialogParams, DialogResponseData, DialogResponseHandler, DialogResponseHandlers, DialogType, DynamicInput, DynamicInputs, GetDataResourceLocation, GetDataResourceMessage, IntegrationDefinitionClient, IntegrationDefinitionDeleteParameters, IntegrationDefinitionGetParameters, IntegrationDefinitionGetResponse, IntegrationDefinitionPutParameters, IntegrationDefinitionPutResponse, IntegrationInstallationClient, IntegrationInstallationDeleteParameters, IntegrationInstallationGetParameters, IntegrationInstallationGetResponse, IntegrationInstallationPutParameters, LocationDialogResponse, MeshContextData, MeshLocation, MeshLocationCore, MeshLocationTypes, MeshSDKEventInterface, OpenConfirmationDialogOptions, OpenConfirmationDialogResult, OpenDialogMessage, OpenDialogResult, OpenLocationDialogOptions, ParamTypeConfigLocation, ParamTypeConfigLocationMetadata, ParamTypeLocation, ParamTypeLocationMetadata, SdkWindow, SetLocationFunction, SetValueMessage, SetValueOptions, SettingsLocation, SettingsLocationMetadata, UniformMeshSDK, UniformMeshSDKEvents, ValidationResult, initializeUniformMeshSDK };
|
|
1037
|
+
export { BindableTypes, CSSHeight, CloseDialogMessage, CloseLocationDialogOptions, DataConnectorInfo, DataResourceLocation, DataResourceLocationMetadata, DataSourceLocation, DataSourceLocationMetadata, DataSourceLocationValue, DataTypeLocation, DataTypeLocationMetadata, DataTypeLocationValue, DialogContext, DialogOptions, DialogParamValue, DialogParams, DialogResponseData, DialogResponseHandler, DialogResponseHandlers, DialogType, DynamicInput, DynamicInputs, EditConnectedDataMessage, EditConnectedDataResponse, GetDataResourceLocation, GetDataResourceMessage, IntegrationDefinitionClient, IntegrationDefinitionDeleteParameters, IntegrationDefinitionGetParameters, IntegrationDefinitionGetResponse, IntegrationDefinitionPutParameters, IntegrationDefinitionPutResponse, IntegrationInstallationClient, IntegrationInstallationDeleteParameters, IntegrationInstallationGetParameters, IntegrationInstallationGetResponse, IntegrationInstallationPutParameters, LocationDialogResponse, MeshContextData, MeshLocation, MeshLocationCore, MeshLocationTypes, MeshSDKEventInterface, OpenConfirmationDialogOptions, OpenConfirmationDialogResult, OpenDialogMessage, OpenDialogResult, OpenLocationDialogOptions, ParamTypeConfigLocation, ParamTypeConfigLocationMetadata, ParamTypeLocation, ParamTypeLocationMetadata, SdkWindow, SetLocationFunction, SetValueMessage, SetValueOptions, SettingsLocation, SettingsLocationMetadata, UniformMeshSDK, UniformMeshSDKEvents, ValidationResult, initializeUniformMeshSDK };
|
package/dist/index.esm.js
CHANGED
|
@@ -124,8 +124,8 @@ var DEFAULT_REQUEST_TIMEOUT = 5e3;
|
|
|
124
124
|
|
|
125
125
|
// src/framepost/errors.ts
|
|
126
126
|
var RequestTimeoutError = class _RequestTimeoutError extends Error {
|
|
127
|
-
constructor() {
|
|
128
|
-
super("Request timed out");
|
|
127
|
+
constructor(message) {
|
|
128
|
+
super("Request timed out: " + message);
|
|
129
129
|
Object.setPrototypeOf(this, _RequestTimeoutError.prototype);
|
|
130
130
|
this.name = "RequestTimeoutError";
|
|
131
131
|
}
|
|
@@ -171,7 +171,7 @@ var serializeError = (error) => {
|
|
|
171
171
|
var deserializeError = ({ name, message, stack }) => {
|
|
172
172
|
switch (name) {
|
|
173
173
|
case RequestTimeoutError.name: {
|
|
174
|
-
return new RequestTimeoutError();
|
|
174
|
+
return new RequestTimeoutError(message);
|
|
175
175
|
}
|
|
176
176
|
default: {
|
|
177
177
|
const e = new Error(message);
|
|
@@ -277,7 +277,7 @@ var SharedClient = class {
|
|
|
277
277
|
timer = setTimeout(() => {
|
|
278
278
|
unsubscribeResponseHandler();
|
|
279
279
|
clearOnDestroy();
|
|
280
|
-
reject(new RequestTimeoutError());
|
|
280
|
+
reject(new RequestTimeoutError(requestKey));
|
|
281
281
|
}, options.timeout || this.requestTimeout);
|
|
282
282
|
});
|
|
283
283
|
}
|
|
@@ -503,6 +503,18 @@ async function connectToParent({
|
|
|
503
503
|
return await client.request("getDataResource", message, {
|
|
504
504
|
timeout: 3e4
|
|
505
505
|
});
|
|
506
|
+
},
|
|
507
|
+
editConnectedData: async (message) => {
|
|
508
|
+
return await client.request(
|
|
509
|
+
"editConnectedData",
|
|
510
|
+
message,
|
|
511
|
+
{
|
|
512
|
+
timeout: (
|
|
513
|
+
// 24 hours in ms
|
|
514
|
+
864e5
|
|
515
|
+
)
|
|
516
|
+
}
|
|
517
|
+
);
|
|
506
518
|
}
|
|
507
519
|
}
|
|
508
520
|
};
|
|
@@ -537,9 +549,12 @@ var createSdkWindow = ({
|
|
|
537
549
|
onHeightChange == null ? void 0 : onHeightChange(height);
|
|
538
550
|
return;
|
|
539
551
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
552
|
+
let maxBottom = windowInstance.document.documentElement.getBoundingClientRect().height;
|
|
553
|
+
windowInstance.document.querySelectorAll("div, section, article, menu, nav, footer").forEach((div) => {
|
|
554
|
+
const bottom = div.getBoundingClientRect().bottom;
|
|
555
|
+
maxBottom = Math.max(maxBottom, bottom);
|
|
556
|
+
});
|
|
557
|
+
const windowHeight = `${Math.ceil(maxBottom)}px`;
|
|
543
558
|
if (windowHeight !== oldHeight) {
|
|
544
559
|
oldHeight = windowHeight;
|
|
545
560
|
onHeightChange == null ? void 0 : onHeightChange(windowHeight);
|
|
@@ -647,15 +662,11 @@ async function initializeUniformMeshSDK({
|
|
|
647
662
|
getCurrentLocation: () => {
|
|
648
663
|
const location = {
|
|
649
664
|
getDataResource: parent.getDataResource,
|
|
665
|
+
editConnectedData: parent.editConnectedData,
|
|
650
666
|
type: contextData.locationType,
|
|
651
667
|
isReadOnly: contextData.isReadOnly,
|
|
652
668
|
value: contextData.locationValue,
|
|
653
669
|
setValue: async (value, options) => {
|
|
654
|
-
if (contextData.dialogContext) {
|
|
655
|
-
console.warn(
|
|
656
|
-
"Using setValue() inside a dialog is deprecated. Use dialogContext.returnDialogValue() instead."
|
|
657
|
-
);
|
|
658
|
-
}
|
|
659
670
|
contextData.locationValue = value;
|
|
660
671
|
sdk.events.emit("onValueChanged", { newValue: value });
|
|
661
672
|
await parent.setValue({ uniformMeshLocationValue: value, options });
|
|
@@ -667,7 +678,7 @@ async function initializeUniformMeshSDK({
|
|
|
667
678
|
returnDialogValue: async (value) => {
|
|
668
679
|
contextData.locationValue = value;
|
|
669
680
|
sdk.events.emit("onValueChanged", { newValue: value });
|
|
670
|
-
await parent.setValue({ uniformMeshLocationValue: value });
|
|
681
|
+
await parent.setValue({ uniformMeshLocationValue: value, closeDialog: true });
|
|
671
682
|
}
|
|
672
683
|
} : void 0
|
|
673
684
|
};
|
|
@@ -727,26 +738,28 @@ async function initializeUniformMeshSDK({
|
|
|
727
738
|
},
|
|
728
739
|
openCurrentLocationDialog: async (options) => {
|
|
729
740
|
const result = await parent.openDialog({
|
|
730
|
-
dialogType: "
|
|
741
|
+
dialogType: "currentLocation",
|
|
731
742
|
dialogData: {},
|
|
732
743
|
options: options == null ? void 0 : options.options
|
|
733
744
|
});
|
|
734
745
|
if (!result) {
|
|
735
746
|
return;
|
|
736
747
|
}
|
|
748
|
+
contextData.locationValue = result.value;
|
|
749
|
+
sdk.events.emit("onValueChanged", { newValue: result.value });
|
|
737
750
|
return {
|
|
738
751
|
dialogId: result.dialogId,
|
|
739
752
|
value: result.value,
|
|
740
753
|
closeDialog: async () => {
|
|
741
754
|
await parent.closeDialog({
|
|
742
755
|
dialogId: void 0,
|
|
743
|
-
dialogType: "
|
|
756
|
+
dialogType: "currentLocation"
|
|
744
757
|
});
|
|
745
758
|
}
|
|
746
759
|
};
|
|
747
760
|
},
|
|
748
761
|
closeCurrentLocationDialog: async () => {
|
|
749
|
-
await parent.closeDialog({ dialogId: void 0, dialogType: "
|
|
762
|
+
await parent.closeDialog({ dialogId: void 0, dialogType: "currentLocation" });
|
|
750
763
|
}
|
|
751
764
|
};
|
|
752
765
|
window.UniformMeshSDK = sdk;
|
package/dist/index.js
CHANGED
|
@@ -161,8 +161,8 @@ var DEFAULT_REQUEST_TIMEOUT = 5e3;
|
|
|
161
161
|
|
|
162
162
|
// src/framepost/errors.ts
|
|
163
163
|
var RequestTimeoutError = class _RequestTimeoutError extends Error {
|
|
164
|
-
constructor() {
|
|
165
|
-
super("Request timed out");
|
|
164
|
+
constructor(message) {
|
|
165
|
+
super("Request timed out: " + message);
|
|
166
166
|
Object.setPrototypeOf(this, _RequestTimeoutError.prototype);
|
|
167
167
|
this.name = "RequestTimeoutError";
|
|
168
168
|
}
|
|
@@ -208,7 +208,7 @@ var serializeError = (error) => {
|
|
|
208
208
|
var deserializeError = ({ name, message, stack }) => {
|
|
209
209
|
switch (name) {
|
|
210
210
|
case RequestTimeoutError.name: {
|
|
211
|
-
return new RequestTimeoutError();
|
|
211
|
+
return new RequestTimeoutError(message);
|
|
212
212
|
}
|
|
213
213
|
default: {
|
|
214
214
|
const e = new Error(message);
|
|
@@ -314,7 +314,7 @@ var SharedClient = class {
|
|
|
314
314
|
timer = setTimeout(() => {
|
|
315
315
|
unsubscribeResponseHandler();
|
|
316
316
|
clearOnDestroy();
|
|
317
|
-
reject(new RequestTimeoutError());
|
|
317
|
+
reject(new RequestTimeoutError(requestKey));
|
|
318
318
|
}, options.timeout || this.requestTimeout);
|
|
319
319
|
});
|
|
320
320
|
}
|
|
@@ -540,6 +540,18 @@ async function connectToParent({
|
|
|
540
540
|
return await client.request("getDataResource", message, {
|
|
541
541
|
timeout: 3e4
|
|
542
542
|
});
|
|
543
|
+
},
|
|
544
|
+
editConnectedData: async (message) => {
|
|
545
|
+
return await client.request(
|
|
546
|
+
"editConnectedData",
|
|
547
|
+
message,
|
|
548
|
+
{
|
|
549
|
+
timeout: (
|
|
550
|
+
// 24 hours in ms
|
|
551
|
+
864e5
|
|
552
|
+
)
|
|
553
|
+
}
|
|
554
|
+
);
|
|
543
555
|
}
|
|
544
556
|
}
|
|
545
557
|
};
|
|
@@ -574,9 +586,12 @@ var createSdkWindow = ({
|
|
|
574
586
|
onHeightChange == null ? void 0 : onHeightChange(height);
|
|
575
587
|
return;
|
|
576
588
|
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
589
|
+
let maxBottom = windowInstance.document.documentElement.getBoundingClientRect().height;
|
|
590
|
+
windowInstance.document.querySelectorAll("div, section, article, menu, nav, footer").forEach((div) => {
|
|
591
|
+
const bottom = div.getBoundingClientRect().bottom;
|
|
592
|
+
maxBottom = Math.max(maxBottom, bottom);
|
|
593
|
+
});
|
|
594
|
+
const windowHeight = `${Math.ceil(maxBottom)}px`;
|
|
580
595
|
if (windowHeight !== oldHeight) {
|
|
581
596
|
oldHeight = windowHeight;
|
|
582
597
|
onHeightChange == null ? void 0 : onHeightChange(windowHeight);
|
|
@@ -684,15 +699,11 @@ async function initializeUniformMeshSDK({
|
|
|
684
699
|
getCurrentLocation: () => {
|
|
685
700
|
const location = {
|
|
686
701
|
getDataResource: parent.getDataResource,
|
|
702
|
+
editConnectedData: parent.editConnectedData,
|
|
687
703
|
type: contextData.locationType,
|
|
688
704
|
isReadOnly: contextData.isReadOnly,
|
|
689
705
|
value: contextData.locationValue,
|
|
690
706
|
setValue: async (value, options) => {
|
|
691
|
-
if (contextData.dialogContext) {
|
|
692
|
-
console.warn(
|
|
693
|
-
"Using setValue() inside a dialog is deprecated. Use dialogContext.returnDialogValue() instead."
|
|
694
|
-
);
|
|
695
|
-
}
|
|
696
707
|
contextData.locationValue = value;
|
|
697
708
|
sdk.events.emit("onValueChanged", { newValue: value });
|
|
698
709
|
await parent.setValue({ uniformMeshLocationValue: value, options });
|
|
@@ -704,7 +715,7 @@ async function initializeUniformMeshSDK({
|
|
|
704
715
|
returnDialogValue: async (value) => {
|
|
705
716
|
contextData.locationValue = value;
|
|
706
717
|
sdk.events.emit("onValueChanged", { newValue: value });
|
|
707
|
-
await parent.setValue({ uniformMeshLocationValue: value });
|
|
718
|
+
await parent.setValue({ uniformMeshLocationValue: value, closeDialog: true });
|
|
708
719
|
}
|
|
709
720
|
} : void 0
|
|
710
721
|
};
|
|
@@ -764,26 +775,28 @@ async function initializeUniformMeshSDK({
|
|
|
764
775
|
},
|
|
765
776
|
openCurrentLocationDialog: async (options) => {
|
|
766
777
|
const result = await parent.openDialog({
|
|
767
|
-
dialogType: "
|
|
778
|
+
dialogType: "currentLocation",
|
|
768
779
|
dialogData: {},
|
|
769
780
|
options: options == null ? void 0 : options.options
|
|
770
781
|
});
|
|
771
782
|
if (!result) {
|
|
772
783
|
return;
|
|
773
784
|
}
|
|
785
|
+
contextData.locationValue = result.value;
|
|
786
|
+
sdk.events.emit("onValueChanged", { newValue: result.value });
|
|
774
787
|
return {
|
|
775
788
|
dialogId: result.dialogId,
|
|
776
789
|
value: result.value,
|
|
777
790
|
closeDialog: async () => {
|
|
778
791
|
await parent.closeDialog({
|
|
779
792
|
dialogId: void 0,
|
|
780
|
-
dialogType: "
|
|
793
|
+
dialogType: "currentLocation"
|
|
781
794
|
});
|
|
782
795
|
}
|
|
783
796
|
};
|
|
784
797
|
},
|
|
785
798
|
closeCurrentLocationDialog: async () => {
|
|
786
|
-
await parent.closeDialog({ dialogId: void 0, dialogType: "
|
|
799
|
+
await parent.closeDialog({ dialogId: void 0, dialogType: "currentLocation" });
|
|
787
800
|
}
|
|
788
801
|
};
|
|
789
802
|
window.UniformMeshSDK = sdk;
|
package/dist/index.mjs
CHANGED
|
@@ -124,8 +124,8 @@ var DEFAULT_REQUEST_TIMEOUT = 5e3;
|
|
|
124
124
|
|
|
125
125
|
// src/framepost/errors.ts
|
|
126
126
|
var RequestTimeoutError = class _RequestTimeoutError extends Error {
|
|
127
|
-
constructor() {
|
|
128
|
-
super("Request timed out");
|
|
127
|
+
constructor(message) {
|
|
128
|
+
super("Request timed out: " + message);
|
|
129
129
|
Object.setPrototypeOf(this, _RequestTimeoutError.prototype);
|
|
130
130
|
this.name = "RequestTimeoutError";
|
|
131
131
|
}
|
|
@@ -171,7 +171,7 @@ var serializeError = (error) => {
|
|
|
171
171
|
var deserializeError = ({ name, message, stack }) => {
|
|
172
172
|
switch (name) {
|
|
173
173
|
case RequestTimeoutError.name: {
|
|
174
|
-
return new RequestTimeoutError();
|
|
174
|
+
return new RequestTimeoutError(message);
|
|
175
175
|
}
|
|
176
176
|
default: {
|
|
177
177
|
const e = new Error(message);
|
|
@@ -277,7 +277,7 @@ var SharedClient = class {
|
|
|
277
277
|
timer = setTimeout(() => {
|
|
278
278
|
unsubscribeResponseHandler();
|
|
279
279
|
clearOnDestroy();
|
|
280
|
-
reject(new RequestTimeoutError());
|
|
280
|
+
reject(new RequestTimeoutError(requestKey));
|
|
281
281
|
}, options.timeout || this.requestTimeout);
|
|
282
282
|
});
|
|
283
283
|
}
|
|
@@ -503,6 +503,18 @@ async function connectToParent({
|
|
|
503
503
|
return await client.request("getDataResource", message, {
|
|
504
504
|
timeout: 3e4
|
|
505
505
|
});
|
|
506
|
+
},
|
|
507
|
+
editConnectedData: async (message) => {
|
|
508
|
+
return await client.request(
|
|
509
|
+
"editConnectedData",
|
|
510
|
+
message,
|
|
511
|
+
{
|
|
512
|
+
timeout: (
|
|
513
|
+
// 24 hours in ms
|
|
514
|
+
864e5
|
|
515
|
+
)
|
|
516
|
+
}
|
|
517
|
+
);
|
|
506
518
|
}
|
|
507
519
|
}
|
|
508
520
|
};
|
|
@@ -537,9 +549,12 @@ var createSdkWindow = ({
|
|
|
537
549
|
onHeightChange == null ? void 0 : onHeightChange(height);
|
|
538
550
|
return;
|
|
539
551
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
552
|
+
let maxBottom = windowInstance.document.documentElement.getBoundingClientRect().height;
|
|
553
|
+
windowInstance.document.querySelectorAll("div, section, article, menu, nav, footer").forEach((div) => {
|
|
554
|
+
const bottom = div.getBoundingClientRect().bottom;
|
|
555
|
+
maxBottom = Math.max(maxBottom, bottom);
|
|
556
|
+
});
|
|
557
|
+
const windowHeight = `${Math.ceil(maxBottom)}px`;
|
|
543
558
|
if (windowHeight !== oldHeight) {
|
|
544
559
|
oldHeight = windowHeight;
|
|
545
560
|
onHeightChange == null ? void 0 : onHeightChange(windowHeight);
|
|
@@ -647,15 +662,11 @@ async function initializeUniformMeshSDK({
|
|
|
647
662
|
getCurrentLocation: () => {
|
|
648
663
|
const location = {
|
|
649
664
|
getDataResource: parent.getDataResource,
|
|
665
|
+
editConnectedData: parent.editConnectedData,
|
|
650
666
|
type: contextData.locationType,
|
|
651
667
|
isReadOnly: contextData.isReadOnly,
|
|
652
668
|
value: contextData.locationValue,
|
|
653
669
|
setValue: async (value, options) => {
|
|
654
|
-
if (contextData.dialogContext) {
|
|
655
|
-
console.warn(
|
|
656
|
-
"Using setValue() inside a dialog is deprecated. Use dialogContext.returnDialogValue() instead."
|
|
657
|
-
);
|
|
658
|
-
}
|
|
659
670
|
contextData.locationValue = value;
|
|
660
671
|
sdk.events.emit("onValueChanged", { newValue: value });
|
|
661
672
|
await parent.setValue({ uniformMeshLocationValue: value, options });
|
|
@@ -667,7 +678,7 @@ async function initializeUniformMeshSDK({
|
|
|
667
678
|
returnDialogValue: async (value) => {
|
|
668
679
|
contextData.locationValue = value;
|
|
669
680
|
sdk.events.emit("onValueChanged", { newValue: value });
|
|
670
|
-
await parent.setValue({ uniformMeshLocationValue: value });
|
|
681
|
+
await parent.setValue({ uniformMeshLocationValue: value, closeDialog: true });
|
|
671
682
|
}
|
|
672
683
|
} : void 0
|
|
673
684
|
};
|
|
@@ -727,26 +738,28 @@ async function initializeUniformMeshSDK({
|
|
|
727
738
|
},
|
|
728
739
|
openCurrentLocationDialog: async (options) => {
|
|
729
740
|
const result = await parent.openDialog({
|
|
730
|
-
dialogType: "
|
|
741
|
+
dialogType: "currentLocation",
|
|
731
742
|
dialogData: {},
|
|
732
743
|
options: options == null ? void 0 : options.options
|
|
733
744
|
});
|
|
734
745
|
if (!result) {
|
|
735
746
|
return;
|
|
736
747
|
}
|
|
748
|
+
contextData.locationValue = result.value;
|
|
749
|
+
sdk.events.emit("onValueChanged", { newValue: result.value });
|
|
737
750
|
return {
|
|
738
751
|
dialogId: result.dialogId,
|
|
739
752
|
value: result.value,
|
|
740
753
|
closeDialog: async () => {
|
|
741
754
|
await parent.closeDialog({
|
|
742
755
|
dialogId: void 0,
|
|
743
|
-
dialogType: "
|
|
756
|
+
dialogType: "currentLocation"
|
|
744
757
|
});
|
|
745
758
|
}
|
|
746
759
|
};
|
|
747
760
|
},
|
|
748
761
|
closeCurrentLocationDialog: async () => {
|
|
749
|
-
await parent.closeDialog({ dialogId: void 0, dialogType: "
|
|
762
|
+
await parent.closeDialog({ dialogId: void 0, dialogType: "currentLocation" });
|
|
750
763
|
}
|
|
751
764
|
};
|
|
752
765
|
window.UniformMeshSDK = sdk;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/mesh-sdk",
|
|
3
|
-
"version": "19.38.
|
|
3
|
+
"version": "19.38.3-alpha.78+5c9892bf1",
|
|
4
4
|
"description": "Uniform Mesh Framework SDK",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@uniformdev/canvas": "19.38.
|
|
36
|
-
"@uniformdev/context": "19.38.
|
|
37
|
-
"@uniformdev/project-map": "19.38.
|
|
35
|
+
"@uniformdev/canvas": "19.38.3-alpha.78+5c9892bf1",
|
|
36
|
+
"@uniformdev/context": "19.38.3-alpha.78+5c9892bf1",
|
|
37
|
+
"@uniformdev/project-map": "19.38.3-alpha.78+5c9892bf1",
|
|
38
38
|
"imagesloaded": "^5.0.0",
|
|
39
39
|
"mitt": "^3.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/imagesloaded": "^4.1.2"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "5c9892bf101584d351d06b65e1658a1237594cfb"
|
|
45
45
|
}
|