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