@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/esm/index.js CHANGED
@@ -782,6 +782,7 @@ class ElementSDKShape extends BaseSDKShape {
782
782
  const manifestContextId = await this.getRequiredManifestContextId();
783
783
  return privateAPI.builderComponent.selectBackground(
784
784
  manifestContextId,
785
+ this.childPath,
785
786
  options
786
787
  );
787
788
  }
@@ -933,7 +934,7 @@ class ControllersSDKShape extends BaseSDKShape {
933
934
  }
934
935
  var index$2 = new PlatformSDKShape(ControllersSDKShape).withPublicMethod("get").build();
935
936
 
936
- class BindingConnectionItem {
937
+ class CmsBindingConnectionItem {
937
938
  constructor(privateAPI, pointer, bindingTarget, config) {
938
939
  this.pointer = pointer;
939
940
  this.bindingTarget = bindingTarget;
@@ -957,7 +958,7 @@ class BindingConnectionItem {
957
958
  this.config = {};
958
959
  }
959
960
  }
960
- class BindingsSDKShape extends BaseSDKShape {
961
+ class CmsBindingsSDKShape extends BaseSDKShape {
961
962
  async get(target) {
962
963
  const privateAPI = await this.getPlatformPrivateAPI();
963
964
  const editorPointer = await privateAPI.components.getSingleSelectedEditorPointer();
@@ -968,10 +969,15 @@ class BindingsSDKShape extends BaseSDKShape {
968
969
  if (!config) {
969
970
  return null;
970
971
  }
971
- return new BindingConnectionItem(privateAPI, editorPointer, target, config);
972
+ return new CmsBindingConnectionItem(
973
+ privateAPI,
974
+ editorPointer,
975
+ target,
976
+ config
977
+ );
972
978
  }
973
979
  }
974
- var index$1 = new PlatformSDKShape(BindingsSDKShape).withPublicMethod("get").build();
980
+ var index$1 = new PlatformSDKShape(CmsBindingsSDKShape).withPublicMethod("get").build();
975
981
 
976
982
  class BindingsProvider {
977
983
  constructor(privateAPI, editorPointer, controllerRef, dataItemTarget, name) {
@@ -998,7 +1004,7 @@ class BindingsProvider {
998
1004
  config: data.config
999
1005
  }
1000
1006
  );
1001
- return new BindingConnectionItem(
1007
+ return new CmsBindingConnectionItem(
1002
1008
  this.#privateAPI,
1003
1009
  this.editorPointer,
1004
1010
  this.dataItemTarget,
@@ -1030,6 +1036,105 @@ class BindingsProvidersSDKShape extends BaseSDKShape {
1030
1036
  }
1031
1037
  var index = new PlatformSDKShape(BindingsProvidersSDKShape).withPublicMethod("list").build();
1032
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
+
1033
1138
  class Workspace {
1034
1139
  constructor(applicationContext) {
1035
1140
  this.applicationContext = applicationContext;
@@ -1129,5 +1234,5 @@ const editor = {
1129
1234
  auth
1130
1235
  };
1131
1236
 
1132
- export { BaseSDKShape, ElementSDKShape, PlatformSDKShape, Workspace, WorkspaceHost, index$d as application, index$1 as bindings, index as bindingsProviders, index$2 as controllers, editor, index$5 as element, index$b as elements, index$c as events, index$3 as externalPanels, index$a as info, index$8 as inputs, index$6 as modals, index$7 as panels, index$4 as preferences, index$9 as widget };
1237
+ export { BaseSDKShape, ElementSDKShape, PlatformSDKShape, Workspace, WorkspaceHost, index$d as application, bindingsPublicSDKShape as bindings, index as bindingsProviders, index$1 as cmsBindings, index$2 as controllers, editor, index$5 as element, index$b as elements, index$c as events, index$3 as externalPanels, index$a as info, index$8 as inputs, index$6 as modals, index$7 as panels, index$4 as preferences, providersPublicSDKShape as providers, index$9 as widget };
1133
1238
  //# sourceMappingURL=index.js.map