@one-commerce/sdk-backoffice-vue3 1.17.0 → 1.19.0-alpha.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.
@@ -73,7 +73,18 @@ exports.Errors = exports.Message = void 0;
73
73
 
74
74
  var api = {};
75
75
 
76
- Object.defineProperty(api, "__esModule", { value: true });
76
+ (function (exports) {
77
+ Object.defineProperty(exports, "__esModule", { value: true });
78
+ exports.Backoffice = void 0;
79
+ (function (Backoffice) {
80
+ (function (Context) {
81
+ (function (AvailableContext) {
82
+ AvailableContext["ADD_TO_CART"] = "backofficeAddToCart";
83
+ })(Context.AvailableContext || (Context.AvailableContext = {}));
84
+ })(Backoffice.Context || (Backoffice.Context = {}));
85
+ })(exports.Backoffice || (exports.Backoffice = {}));
86
+
87
+ }(api));
77
88
 
78
89
  (function (exports) {
79
90
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -299,6 +310,10 @@ class Sdk extends Events {
299
310
  console.warn('[SDK Core] ', ...data);
300
311
  }
301
312
 
313
+ initializeContextClass() {
314
+ return new this.contextClass(this.callFunction.bind(this));
315
+ }
316
+
302
317
  initializeServiceGetters() {
303
318
  if (this.instances) {
304
319
  Object.keys(this.instances).forEach(serviceName => {
@@ -326,6 +341,8 @@ class Sdk extends Events {
326
341
 
327
342
  _defineProperty(this, "instances", void 0);
328
343
 
344
+ _defineProperty(this, "contextClass", void 0);
345
+
329
346
  this.initializeServiceGetters();
330
347
  this.origin = options.origin;
331
348
  this.channel = new Channel({
@@ -411,6 +428,8 @@ class Sdk extends Events {
411
428
  if (typeof options.autoheight !== 'undefined') {
412
429
  this.autoheight = options.autoheight;
413
430
  }
431
+
432
+ this.contextClass = options.context;
414
433
  }
415
434
  }
416
435
 
@@ -465,7 +484,8 @@ class BackofficeSdk extends Sdk {
465
484
  layout: new BackofficeLayout(this.callFunction.bind(this)),
466
485
  authorization: new BackofficeAuthorization(this.callFunction.bind(this)),
467
486
  customer: new BackofficeCustomer(this.callFunction.bind(this)),
468
- plugin: new BackofficePlugin(this.callFunction.bind(this))
487
+ plugin: new BackofficePlugin(this.callFunction.bind(this)),
488
+ context: this.initializeContextClass()
469
489
  });
470
490
  }
471
491
 
@@ -506,6 +526,7 @@ var index = {
506
526
  obj.authorization.update(payload);
507
527
  obj.customer.update(payload);
508
528
  obj.plugin.update(payload);
529
+ obj.context.update(payload);
509
530
  };
510
531
 
511
532
  sdk.on(SdkEvents.INIT, function (payload) {