@wix/editor 1.435.0 → 1.437.0

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.
@@ -934,7 +934,7 @@
934
934
  }
935
935
  var index$2 = new PlatformSDKShape(ControllersSDKShape).withPublicMethod("get").build();
936
936
 
937
- class BindingConnectionItem {
937
+ class CmsBindingConnectionItem {
938
938
  constructor(privateAPI, pointer, bindingTarget, config) {
939
939
  this.pointer = pointer;
940
940
  this.bindingTarget = bindingTarget;
@@ -958,7 +958,7 @@
958
958
  this.config = {};
959
959
  }
960
960
  }
961
- class BindingsSDKShape extends BaseSDKShape {
961
+ class CmsBindingsSDKShape extends BaseSDKShape {
962
962
  async get(target) {
963
963
  const privateAPI = await this.getPlatformPrivateAPI();
964
964
  const editorPointer = await privateAPI.components.getSingleSelectedEditorPointer();
@@ -969,10 +969,15 @@
969
969
  if (!config) {
970
970
  return null;
971
971
  }
972
- return new BindingConnectionItem(privateAPI, editorPointer, target, config);
972
+ return new CmsBindingConnectionItem(
973
+ privateAPI,
974
+ editorPointer,
975
+ target,
976
+ config
977
+ );
973
978
  }
974
979
  }
975
- var index$1 = new PlatformSDKShape(BindingsSDKShape).withPublicMethod("get").build();
980
+ var index$1 = new PlatformSDKShape(CmsBindingsSDKShape).withPublicMethod("get").build();
976
981
 
977
982
  class BindingsProvider {
978
983
  constructor(privateAPI, editorPointer, controllerRef, dataItemTarget, name) {
@@ -999,7 +1004,7 @@
999
1004
  config: data.config
1000
1005
  }
1001
1006
  );
1002
- return new BindingConnectionItem(
1007
+ return new CmsBindingConnectionItem(
1003
1008
  this.#privateAPI,
1004
1009
  this.editorPointer,
1005
1010
  this.dataItemTarget,
@@ -1031,6 +1036,105 @@
1031
1036
  }
1032
1037
  var index = new PlatformSDKShape(BindingsProvidersSDKShape).withPublicMethod("list").build();
1033
1038
 
1039
+ class ProvidersPublicSDKShape extends BaseSDKShape {
1040
+ constructor(overriddenApplicationContext = null, childPath = []) {
1041
+ super(overriddenApplicationContext);
1042
+ this.overriddenApplicationContext = overriddenApplicationContext;
1043
+ this.childPath = childPath;
1044
+ }
1045
+ async attach(providerType, data) {
1046
+ const privateAPI = await this.getPlatformPrivateAPI();
1047
+ const manifestContextId = await this.getRequiredManifestContextId();
1048
+ const result = await privateAPI.providers.attach(
1049
+ manifestContextId,
1050
+ this.childPath,
1051
+ providerType,
1052
+ data
1053
+ );
1054
+ return result;
1055
+ }
1056
+ async detach(providerType) {
1057
+ const privateAPI = await this.getPlatformPrivateAPI();
1058
+ const manifestContextId = await this.getRequiredManifestContextId();
1059
+ const result = await privateAPI.providers.detach(
1060
+ manifestContextId,
1061
+ this.childPath,
1062
+ providerType
1063
+ );
1064
+ return result;
1065
+ }
1066
+ async list(options) {
1067
+ const privateAPI = await this.getPlatformPrivateAPI();
1068
+ const manifestContextId = await this.getRequiredManifestContextId();
1069
+ const result = await privateAPI.providers.list(
1070
+ manifestContextId,
1071
+ this.childPath,
1072
+ options
1073
+ );
1074
+ return result;
1075
+ }
1076
+ }
1077
+ const providersPublicSDKShape = new PlatformSDKShape(
1078
+ ProvidersPublicSDKShape
1079
+ ).withPublicMethod("attach").withPublicMethod("detach").withPublicMethod("list").build();
1080
+
1081
+ class BindingsPublicSDKShape extends BaseSDKShape {
1082
+ constructor(overriddenApplicationContext = null, childPath = []) {
1083
+ super(overriddenApplicationContext);
1084
+ this.overriddenApplicationContext = overriddenApplicationContext;
1085
+ this.childPath = childPath;
1086
+ }
1087
+ // uses the bindings map to bind component props to provider items
1088
+ async bind(bindings) {
1089
+ const privateAPI = await this.getPlatformPrivateAPI();
1090
+ const manifestContextId = await this.getRequiredManifestContextId();
1091
+ const result = await privateAPI.bindings.bind(
1092
+ manifestContextId,
1093
+ this.childPath,
1094
+ bindings
1095
+ );
1096
+ return result;
1097
+ }
1098
+ // removes the bindings of specific props from the component and provider bindings map
1099
+ // if props is 'ALL' - unbinds all props from the component
1100
+ async unbind(props) {
1101
+ const privateAPI = await this.getPlatformPrivateAPI();
1102
+ const manifestContextId = await this.getRequiredManifestContextId();
1103
+ const result = await privateAPI.bindings.unbind(
1104
+ manifestContextId,
1105
+ this.childPath,
1106
+ props
1107
+ );
1108
+ return result;
1109
+ }
1110
+ // gets the binding map for all attached providers of the editor pointer
1111
+ // providerTypes: optionally filter by provider types
1112
+ // includeDisplayNames: optionally add props and context items display names
1113
+ async listBindings(options) {
1114
+ const privateAPI = await this.getPlatformPrivateAPI();
1115
+ const manifestContextId = await this.getRequiredManifestContextId();
1116
+ const result = await privateAPI.bindings.listBindings(
1117
+ manifestContextId,
1118
+ this.childPath,
1119
+ options
1120
+ );
1121
+ return result;
1122
+ }
1123
+ // finds the available binding options for the target prop of the provided component
1124
+ async findBindingCandidates(propPath) {
1125
+ const privateAPI = await this.getPlatformPrivateAPI();
1126
+ const manifestContextId = await this.getRequiredManifestContextId();
1127
+ return privateAPI.bindings.findBindingCandidates(
1128
+ manifestContextId,
1129
+ this.childPath,
1130
+ propPath
1131
+ );
1132
+ }
1133
+ }
1134
+ const bindingsPublicSDKShape = new PlatformSDKShape(
1135
+ BindingsPublicSDKShape
1136
+ ).withPublicMethod("bind").withPublicMethod("unbind").withPublicMethod("listBindings").withPublicMethod("findBindingCandidates").build();
1137
+
1034
1138
  class Workspace {
1035
1139
  constructor(applicationContext) {
1036
1140
  this.applicationContext = applicationContext;
@@ -1136,8 +1240,9 @@
1136
1240
  exports.Workspace = Workspace;
1137
1241
  exports.WorkspaceHost = WorkspaceHost;
1138
1242
  exports.application = index$d;
1139
- exports.bindings = index$1;
1243
+ exports.bindings = bindingsPublicSDKShape;
1140
1244
  exports.bindingsProviders = index;
1245
+ exports.cmsBindings = index$1;
1141
1246
  exports.controllers = index$2;
1142
1247
  exports.editor = editor;
1143
1248
  exports.element = index$5;
@@ -1149,6 +1254,7 @@
1149
1254
  exports.modals = index$6;
1150
1255
  exports.panels = index$7;
1151
1256
  exports.preferences = index$4;
1257
+ exports.providers = providersPublicSDKShape;
1152
1258
  exports.widget = index$9;
1153
1259
 
1154
1260
  }));