webc-miam 10.7.0 → 10.8.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.
@@ -6,6 +6,10 @@ import {
6
6
  AttachRecipeCardShowTrackingOptions,
7
7
  RecipeCardShowTrackingHandle
8
8
  } from '../../_utils/attach-recipe-card-show-tracking';
9
+ import {
10
+ AttachProductShowTrackingOptions,
11
+ ProductShowTrackingHandle
12
+ } from '../../_utils/attach-product-show-tracking';
9
13
  import { ComparableProduct } from './comparable-product';
10
14
 
11
15
  export interface MealzInterface {
@@ -44,6 +48,15 @@ export interface MealzInterface {
44
48
  attachRecipeCardShowTracking: (
45
49
  options: AttachRecipeCardShowTrackingOptions
46
50
  ) => RecipeCardShowTrackingHandle;
51
+
52
+ /**
53
+ * Attach viewport-based `product.show` tracking on a recipe details product card root element.
54
+ * Same behaviour as `mealz-product-card` (80% visible for 1s, deduped per recipe/item).
55
+ * Call the returned handle's `disconnect()` when the element is removed.
56
+ */
57
+ attachProductShowTracking: (
58
+ options: AttachProductShowTrackingOptions
59
+ ) => ProductShowTrackingHandle;
47
60
  };
48
61
 
49
62
  // ---------------------------------------------------------------------------------------------------
@@ -1,6 +1,6 @@
1
1
  import { PlausibleProps } from 'mealz-shared-analytics';
2
2
  import { DocumentCollection } from 'miam-jsonapi';
3
- import { BehaviorSubject, Observable, ReplaySubject } from 'rxjs';
3
+ import { BehaviorSubject, Observable, ReplaySubject, Subject } from 'rxjs';
4
4
  import { Basket, BasketEntry, Ingredient, Item, Menu, MenuRecipe, PointOfSale, Recipe, RecipeLike, SponsorBlock, Supplier } from '../../_models';
5
5
  import { RecipePricing } from '../../_models/recipe-pricing';
6
6
  import { Tag } from '../../_models/tag';
@@ -131,6 +131,15 @@ export interface MealzInternalInterface {
131
131
 
132
132
  // ---------------------------------------------------------------------------------------------------
133
133
 
134
+ drawer: {
135
+ /**
136
+ * Emits when a drawer error toast should be shown ({ code }).
137
+ */
138
+ errorToast: () => Observable<{ code: string }>;
139
+ };
140
+
141
+ // ---------------------------------------------------------------------------------------------------
142
+
134
143
  planner: {
135
144
  /**
136
145
  * Emits the item to replace from recipe details view
@@ -469,7 +478,7 @@ export interface MealzInternalInterface {
469
478
  /**
470
479
  * Variable with the list of items with prices
471
480
  */
472
- itemsWithPricesList$: BehaviorSubject<{ item: Item; price: ProductPrice }[]>;
481
+ itemsWithPricesList$: BehaviorSubject<{ item: Item; price: ProductPrice; isOutOfStock?: boolean }[]>;
473
482
 
474
483
  /**
475
484
  * Emits if items are getting fetched