ng-miam 9.1.25 → 9.1.27

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.
Files changed (27) hide show
  1. package/bundles/ng-miam.umd.js +44 -18
  2. package/bundles/ng-miam.umd.js.map +1 -1
  3. package/bundles/ng-miam.umd.min.js +1 -1
  4. package/bundles/ng-miam.umd.min.js.map +1 -1
  5. package/esm2015/lib/_services/analytics.service.js +5 -2
  6. package/esm2015/lib/_services/context.service.js +14 -4
  7. package/esm2015/lib/_services/recipes.service.js +14 -6
  8. package/esm2015/lib/_types/builded/mealz-interface.js +1 -1
  9. package/esm2015/lib/_types/builded/mealz-internal-interface.js +1 -1
  10. package/esm2015/lib/_web-components/recipe-cards/recipe-card/recipe-card.component.js +3 -2
  11. package/esm2015/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.js +3 -2
  12. package/esm2015/lib/_web-components/recipe-modal/recipe-modal.component.js +6 -6
  13. package/esm2015/lib/environments/version.js +2 -2
  14. package/fesm2015/ng-miam.js +40 -17
  15. package/fesm2015/ng-miam.js.map +1 -1
  16. package/lib/_services/analytics.service.d.ts.map +1 -1
  17. package/lib/_services/context.service.d.ts.map +1 -1
  18. package/lib/_services/recipes.service.d.ts +5 -2
  19. package/lib/_services/recipes.service.d.ts.map +1 -1
  20. package/lib/_types/builded/mealz-interface.d.ts +4 -0
  21. package/lib/_types/builded/mealz-interface.d.ts.map +1 -1
  22. package/lib/_types/builded/mealz-internal-interface.d.ts +2 -2
  23. package/lib/_types/builded/mealz-internal-interface.d.ts.map +1 -1
  24. package/lib/_web-components/recipe-cards/recipe-card/recipe-card.component.d.ts.map +1 -1
  25. package/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.d.ts.map +1 -1
  26. package/lib/environments/version.d.ts +1 -1
  27. package/package.json +1 -1
@@ -3651,7 +3651,7 @@
3651
3651
  EventJourney["EMPTY"] = "";
3652
3652
  })(EventJourney || (EventJourney = {}));
3653
3653
 
3654
- var VERSION = '9.1.25'; // TODO: replace by ##VERSION## and update it in the CI/CD
3654
+ var VERSION = "9.1.27"; // TODO: replace by ##VERSION## and update it in the CI/CD
3655
3655
 
3656
3656
  var ContextRegistryService = /** @class */ (function () {
3657
3657
  function ContextRegistryService() {
@@ -3763,7 +3763,10 @@
3763
3763
  var _this = this;
3764
3764
  var detectedJourney = journey !== null && journey !== void 0 ? journey : detectJourney();
3765
3765
  actions.forEach(function (action) {
3766
- _this.sendEvent('recipe.add', action.params.eventTrace.originPath, { recipe_id: action.params.recipeId }, detectedJourney);
3766
+ _this.sendEvent('recipe.add', action.params.eventTrace.originPath, {
3767
+ recipe_id: action.params.recipeId,
3768
+ category_id: action.params.eventTrace.props.category_id
3769
+ }, detectedJourney);
3767
3770
  });
3768
3771
  };
3769
3772
  AnalyticsService.prototype.sendUpdateGuestsEvents = function (actions, journey) {
@@ -5489,23 +5492,23 @@
5489
5492
  // Open modal showing recipe details
5490
5493
  RecipesService.prototype.display = function (recipeId, _e) {
5491
5494
  var _this = this;
5492
- var _f = _e.previewAllowed, previewAllowed = _f === void 0 ? true : _f, _g = _e.guests, guests = _g === void 0 ? null : _g, _h = _e.previewMode, previewMode = _h === void 0 ? false : _h, _j = _e.displayGuests, displayGuests = _j === void 0 ? true : _j, _k = _e.helpButtonAllowed, helpButtonAllowed = _k === void 0 ? true : _k;
5495
+ var _f = _e.previewAllowed, previewAllowed = _f === void 0 ? true : _f, _g = _e.guests, guests = _g === void 0 ? null : _g, _h = _e.previewMode, previewMode = _h === void 0 ? false : _h, _j = _e.displayGuests, displayGuests = _j === void 0 ? true : _j, _k = _e.helpButtonAllowed, helpButtonAllowed = _k === void 0 ? true : _k, _l = _e.eventTrace, eventTrace = _l === void 0 ? { originPath: '', props: {} } : _l;
5493
5496
  if (!recipeId) {
5494
5497
  return;
5495
5498
  }
5496
5499
  this.get(recipeId, { include: ['ingredients', 'recipe-steps', 'recipe-type', 'sponsors', 'tags', 'recipe-provider'] })
5497
5500
  .pipe(operators.skipWhile(function (recipe) { return recipe.is_loading; }))
5498
5501
  .subscribe(function (recipe) {
5499
- _this.displayObject(recipe, { previewAllowed: previewAllowed, guests: guests, previewMode: previewMode, displayGuests: displayGuests, helpButtonAllowed: helpButtonAllowed });
5502
+ _this.displayObject(recipe, { previewAllowed: previewAllowed, guests: guests, previewMode: previewMode, displayGuests: displayGuests, helpButtonAllowed: helpButtonAllowed, eventTrace: eventTrace });
5500
5503
  });
5501
5504
  };
5502
5505
  RecipesService.prototype.displayObject = function (recipe, _e) {
5503
- var _f = _e.previewAllowed, previewAllowed = _f === void 0 ? true : _f, _g = _e.guests, guests = _g === void 0 ? null : _g, _h = _e.previewMode, previewMode = _h === void 0 ? false : _h, _j = _e.wasAdded, wasAdded = _j === void 0 ? false : _j, _k = _e.displayGuests, displayGuests = _k === void 0 ? true : _k, _l = _e.helpButtonAllowed, helpButtonAllowed = _l === void 0 ? true : _l;
5506
+ var _f = _e.previewAllowed, previewAllowed = _f === void 0 ? true : _f, _g = _e.guests, guests = _g === void 0 ? null : _g, _h = _e.previewMode, previewMode = _h === void 0 ? false : _h, _j = _e.wasAdded, wasAdded = _j === void 0 ? false : _j, _k = _e.displayGuests, displayGuests = _k === void 0 ? true : _k, _l = _e.helpButtonAllowed, helpButtonAllowed = _l === void 0 ? true : _l, _m = _e.eventTrace, eventTrace = _m === void 0 ? { originPath: '', props: {} } : _m;
5504
5507
  if (!recipe) {
5505
5508
  return;
5506
5509
  }
5507
5510
  recipe.modifiedGuests = guests || +recipe.guests;
5508
- this.displayedRecipe$.next({ previewAllowed: previewAllowed, recipe: recipe, previewMode: previewMode, wasAdded: wasAdded, displayGuests: displayGuests, helpButtonAllowed: helpButtonAllowed });
5511
+ this.displayedRecipe$.next({ previewAllowed: previewAllowed, recipe: recipe, previewMode: previewMode, wasAdded: wasAdded, displayGuests: displayGuests, helpButtonAllowed: helpButtonAllowed, eventTrace: eventTrace });
5509
5512
  };
5510
5513
  RecipesService.prototype.openBasket = function (analyticsPath) {
5511
5514
  if (analyticsPath === void 0) { analyticsPath = ''; }
@@ -5515,7 +5518,15 @@
5515
5518
  RecipesService.prototype.openRecipeDetails = function (recipeId, guests, initialTabIndex, path, categoryId) {
5516
5519
  if (path === void 0) { path = ''; }
5517
5520
  if (categoryId === void 0) { categoryId = null; }
5518
- this.display(recipeId, { previewAllowed: true, previewMode: false, guests: guests });
5521
+ this.display(recipeId, {
5522
+ previewAllowed: true,
5523
+ previewMode: false,
5524
+ guests: guests,
5525
+ eventTrace: {
5526
+ originPath: path,
5527
+ props: Object.assign({ recipe_id: recipeId }, (categoryId ? { category_id: categoryId } : {}))
5528
+ }
5529
+ });
5519
5530
  this.recipeDetailsTabIndex$.next(initialTabIndex);
5520
5531
  this.analyticsService.sendEvent('recipe.display', path, { recipe_id: recipeId, category_id: categoryId });
5521
5532
  };
@@ -8233,6 +8244,13 @@
8233
8244
  recipes: {
8234
8245
  hidden: this.recipesService.hidden,
8235
8246
  addAllIngredientsCTAWasClicked: this.addAllProductsWasClicked,
8247
+ openDetails: function (recipeId, guests, initialTabIndex, path, plannerOrCategoryId, categoryId) {
8248
+ if (path === void 0) { path = ''; }
8249
+ if (plannerOrCategoryId === void 0) { plannerOrCategoryId = null; }
8250
+ if (categoryId === void 0) { categoryId = null; }
8251
+ var resolvedCategoryId = typeof plannerOrCategoryId === 'string' ? plannerOrCategoryId : categoryId;
8252
+ return _this.recipesService.openRecipeDetails(recipeId, guests, initialTabIndex, path, resolvedCategoryId);
8253
+ },
8236
8254
  setDefaultIngredientPicture: function (url) { return _this.defaultIngredientPicture = url; },
8237
8255
  setDefaultRecipePicture: function (url) { return _this.defaultRecipePicture = url; },
8238
8256
  // We keep those just in case
@@ -8424,14 +8442,20 @@
8424
8442
  logLevel: this.logLevel$
8425
8443
  },
8426
8444
  recipes: {
8427
- openDetails: function (recipeId, guests, initialTabIndex, path, categoryId) {
8445
+ openDetails: function (recipeId, guests, initialTabIndex, path, plannerOrCategoryId, categoryId) {
8428
8446
  if (path === void 0) { path = ''; }
8447
+ if (plannerOrCategoryId === void 0) { plannerOrCategoryId = null; }
8429
8448
  if (categoryId === void 0) { categoryId = null; }
8430
- return _this.recipesService.openRecipeDetails(recipeId, guests, initialTabIndex, path, categoryId);
8449
+ var resolvedCategoryId = typeof plannerOrCategoryId === 'string' ? plannerOrCategoryId : categoryId;
8450
+ return _this.recipesService.openRecipeDetails(recipeId, guests, initialTabIndex, path, resolvedCategoryId);
8431
8451
  },
8432
- updateRecipeLike: function (recipeLikeId, recipeId, isPast, path) {
8452
+ updateRecipeLike: function (recipeLikeId, recipeId, isPast, path, categoryId) {
8433
8453
  if (path === void 0) { path = ''; }
8434
- var eventTrace = { originPath: path, props: { recipe_id: recipeId } };
8454
+ if (categoryId === void 0) { categoryId = null; }
8455
+ var eventTrace = {
8456
+ originPath: path,
8457
+ props: Object.assign({ recipe_id: recipeId }, (categoryId ? { category_id: categoryId } : {}))
8458
+ };
8435
8459
  var recipeLike = _this.recipeLikesService.prepareRecipeLikeForUpdate(recipeId, recipeLikeId, isPast);
8436
8460
  _this.recipeLikesService.updateLike(recipeId, recipeLike, eventTrace);
8437
8461
  },
@@ -20934,7 +20958,8 @@
20934
20958
  previewAllowed: this.previewAllowed,
20935
20959
  guests: this.recipe.modifiedGuests,
20936
20960
  displayGuests: this.displayGuests,
20937
- helpButtonAllowed: this.helpButtonAllowed
20961
+ helpButtonAllowed: this.helpButtonAllowed,
20962
+ eventTrace: this.eventTrace
20938
20963
  });
20939
20964
  this.analyticsService.sendEvent('recipe.display', this.path, {
20940
20965
  recipe_id: this.recipe.id,
@@ -21440,7 +21465,8 @@
21440
21465
  previewAllowed: this.previewAllowed,
21441
21466
  guests: this.recipe.modifiedGuests,
21442
21467
  displayGuests: this.displayGuests,
21443
- helpButtonAllowed: this.helpButtonAllowed
21468
+ helpButtonAllowed: this.helpButtonAllowed,
21469
+ eventTrace: this.eventTrace
21444
21470
  });
21445
21471
  this.displayed.emit();
21446
21472
  this.analyticsService.sendEvent('recipe.display', this.path, {
@@ -29203,7 +29229,7 @@
29203
29229
  }
29204
29230
  if (rf & 2) {
29205
29231
  var ctx_r5 = i0__namespace.ɵɵnextContext(2);
29206
- i0__namespace.ɵɵproperty("recipeId", ctx_r5.recipe.id)("guestNumber", ctx_r5.recipe.modifiedGuests)("previewAllowed", ctx_r5.previewAllowed)("stepsOnLeftSide", ctx_r5.detailsStepsOnLeftSide)("moreRecipesImageURL", ctx_r5.detailsMoreRecipesImageURL)("pricingGuestsText", ctx_r5.detailsPricingGuestsText)("displayGuests", ctx_r5.displayGuestsInDetails)("helpButtonAllowed", ctx_r5.helpButtonAllowedInDetails);
29232
+ i0__namespace.ɵɵproperty("recipeId", ctx_r5.recipe.id)("guestNumber", ctx_r5.recipe.modifiedGuests)("originTrace", ctx_r5.eventTrace)("previewAllowed", ctx_r5.previewAllowed)("stepsOnLeftSide", ctx_r5.detailsStepsOnLeftSide)("moreRecipesImageURL", ctx_r5.detailsMoreRecipesImageURL)("pricingGuestsText", ctx_r5.detailsPricingGuestsText)("displayGuests", ctx_r5.displayGuestsInDetails)("helpButtonAllowed", ctx_r5.helpButtonAllowedInDetails);
29207
29233
  }
29208
29234
  }
29209
29235
  function RecipeModalComponent_ng_miam_modal_0_ng_miam_store_locator_11_Template(rf, ctx) {
@@ -29229,7 +29255,7 @@
29229
29255
  i0__namespace.ɵɵpipe(6, "async");
29230
29256
  i0__namespace.ɵɵtemplate(7, RecipeModalComponent_ng_miam_modal_0_div_7_Template, 2, 6, "div", 4);
29231
29257
  i0__namespace.ɵɵpipe(8, "async");
29232
- i0__namespace.ɵɵtemplate(9, RecipeModalComponent_ng_miam_modal_0_ng_miam_recipe_details_9_Template, 2, 8, "ng-miam-recipe-details", 5);
29258
+ i0__namespace.ɵɵtemplate(9, RecipeModalComponent_ng_miam_modal_0_ng_miam_recipe_details_9_Template, 2, 9, "ng-miam-recipe-details", 5);
29233
29259
  i0__namespace.ɵɵpipe(10, "async");
29234
29260
  i0__namespace.ɵɵtemplate(11, RecipeModalComponent_ng_miam_modal_0_ng_miam_store_locator_11_Template, 1, 1, "ng-miam-store-locator", 6);
29235
29261
  i0__namespace.ɵɵelementEnd();
@@ -29360,8 +29386,8 @@
29360
29386
  RecipeModalComponent.prototype.listenToRecipeDisplayed = function () {
29361
29387
  var _this = this;
29362
29388
  this.subscriptions.push(this.recipesService.displayedRecipe$.subscribe(function (result) {
29363
- var _a;
29364
- _this.registerTrace({ originPath: '', props: { recipe_id: (_a = result === null || result === void 0 ? void 0 : result.recipe) === null || _a === void 0 ? void 0 : _a.id } });
29389
+ var _a, _b;
29390
+ _this.registerTrace((_a = result === null || result === void 0 ? void 0 : result.eventTrace) !== null && _a !== void 0 ? _a : { originPath: '', props: { recipe_id: (_b = result === null || result === void 0 ? void 0 : result.recipe) === null || _b === void 0 ? void 0 : _b.id } });
29365
29391
  if (!(result === null || result === void 0 ? void 0 : result.recipe)) {
29366
29392
  _this.handleEmptyRecipe(result);
29367
29393
  }
@@ -29489,7 +29515,7 @@
29489
29515
  return RecipeModalComponent;
29490
29516
  }());
29491
29517
  RecipeModalComponent.ɵfac = function RecipeModalComponent_Factory(t) { return new (t || RecipeModalComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(RecipesService), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(PrintService), i0__namespace.ɵɵdirectiveInject(BasketTransferService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(RecipeDetailsService), i0__namespace.ɵɵdirectiveInject(ProductReplacementService), i0__namespace.ɵɵdirectiveInject(PointOfSalesService), i0__namespace.ɵɵdirectiveInject(StoreLocatorService), i0__namespace.ɵɵdirectiveInject(BasketTransferService)); };
29492
- RecipeModalComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: RecipeModalComponent, selectors: [["ng-miam-recipe-modal"]], inputs: { detailsStepsOnLeftSide: "detailsStepsOnLeftSide", detailsMoreRecipesImageURL: "detailsMoreRecipesImageURL", detailsPricingGuestsText: "detailsPricingGuestsText" }, outputs: { hasChangesOnClose: "hasChangesOnClose" }, decls: 3, vars: 3, consts: [["modalStyle", "right", 3, "display", "noHeaderMode", "confirmButtonDisabled", "cancelButtonDisabled", "cancelButtonIsLoading", "placeOrderFooter", "redirectToCartFooter", "totalPrice", "title", "miam-recipe-modal__basket-preview-modal", "ngClass", "displayChange", "close", "cancel", "confirm", 4, "ngIf"], ["modalStyle", "right", 3, "noHeaderMode", "display", "cancelButtonDisabled", "cancelButtonIsLoading", "close", 4, "ngIf"], ["modalStyle", "right", 3, "display", "noHeaderMode", "confirmButtonDisabled", "cancelButtonDisabled", "cancelButtonIsLoading", "placeOrderFooter", "redirectToCartFooter", "totalPrice", "title", "ngClass", "displayChange", "close", "cancel", "confirm"], ["header", "", 4, "ngIf"], ["class", "miam-wrapper-preview", 3, "hidden", 4, "ngIf"], [3, "recipeId", "guestNumber", "previewAllowed", "stepsOnLeftSide", "moreRecipesImageURL", "pricingGuestsText", "displayGuests", "helpButtonAllowed", "recipeAdded", "recipeError", "closeDetails", 4, "ngIf"], [3, "originTrace", 4, "ngIf"], ["header", ""], [1, "miam-wrapper-preview"], [3, "recipeId", "displayItemsUnitaryPrice", "isStoreLocatorDisplayed", "originTrace"], [3, "recipeId", "guestNumber", "previewAllowed", "stepsOnLeftSide", "moreRecipesImageURL", "pricingGuestsText", "displayGuests", "helpButtonAllowed", "recipeAdded", "recipeError", "closeDetails"], ["details", ""], [3, "originTrace"], ["modalStyle", "right", 3, "noHeaderMode", "display", "cancelButtonDisabled", "cancelButtonIsLoading", "close"], [3, "addProductMode", "originTrace", "selected"], [3, "basketEntry", "loadOnSelect", "originTrace", "selected"]], template: function RecipeModalComponent_Template(rf, ctx) {
29518
+ RecipeModalComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: RecipeModalComponent, selectors: [["ng-miam-recipe-modal"]], inputs: { detailsStepsOnLeftSide: "detailsStepsOnLeftSide", detailsMoreRecipesImageURL: "detailsMoreRecipesImageURL", detailsPricingGuestsText: "detailsPricingGuestsText" }, outputs: { hasChangesOnClose: "hasChangesOnClose" }, decls: 3, vars: 3, consts: [["modalStyle", "right", 3, "display", "noHeaderMode", "confirmButtonDisabled", "cancelButtonDisabled", "cancelButtonIsLoading", "placeOrderFooter", "redirectToCartFooter", "totalPrice", "title", "miam-recipe-modal__basket-preview-modal", "ngClass", "displayChange", "close", "cancel", "confirm", 4, "ngIf"], ["modalStyle", "right", 3, "noHeaderMode", "display", "cancelButtonDisabled", "cancelButtonIsLoading", "close", 4, "ngIf"], ["modalStyle", "right", 3, "display", "noHeaderMode", "confirmButtonDisabled", "cancelButtonDisabled", "cancelButtonIsLoading", "placeOrderFooter", "redirectToCartFooter", "totalPrice", "title", "ngClass", "displayChange", "close", "cancel", "confirm"], ["header", "", 4, "ngIf"], ["class", "miam-wrapper-preview", 3, "hidden", 4, "ngIf"], [3, "recipeId", "guestNumber", "originTrace", "previewAllowed", "stepsOnLeftSide", "moreRecipesImageURL", "pricingGuestsText", "displayGuests", "helpButtonAllowed", "recipeAdded", "recipeError", "closeDetails", 4, "ngIf"], [3, "originTrace", 4, "ngIf"], ["header", ""], [1, "miam-wrapper-preview"], [3, "recipeId", "displayItemsUnitaryPrice", "isStoreLocatorDisplayed", "originTrace"], [3, "recipeId", "guestNumber", "originTrace", "previewAllowed", "stepsOnLeftSide", "moreRecipesImageURL", "pricingGuestsText", "displayGuests", "helpButtonAllowed", "recipeAdded", "recipeError", "closeDetails"], ["details", ""], [3, "originTrace"], ["modalStyle", "right", 3, "noHeaderMode", "display", "cancelButtonDisabled", "cancelButtonIsLoading", "close"], [3, "addProductMode", "originTrace", "selected"], [3, "basketEntry", "loadOnSelect", "originTrace", "selected"]], template: function RecipeModalComponent_Template(rf, ctx) {
29493
29519
  if (rf & 1) {
29494
29520
  i0__namespace.ɵɵtemplate(0, RecipeModalComponent_ng_miam_modal_0_Template, 12, 32, "ng-miam-modal", 0);
29495
29521
  i0__namespace.ɵɵtemplate(1, RecipeModalComponent_ng_miam_modal_1_Template, 2, 6, "ng-miam-modal", 1);