@soma-vertical-web/multi-lib 0.0.45 → 0.0.47

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 (30) hide show
  1. package/cms/ContentTypes/PDP/PDPContent.d.ts +3 -0
  2. package/cms/server.d.ts +1 -0
  3. package/contexts/contexts/cms/PDPContentContext.d.ts +6 -0
  4. package/contexts/contexts/plp/PLPNavigationContext.d.ts +6 -0
  5. package/contexts/index.d.ts +6 -0
  6. package/data/helpers/plp/index.d.ts +4 -0
  7. package/index.js +15 -15
  8. package/index.mjs +3112 -2923
  9. package/index2.js +1 -1
  10. package/index2.mjs +104 -81
  11. package/layout/index.d.ts +30 -0
  12. package/layout/team-component/PLPNavigation/Composite/BreadCrumb.d.ts +7 -0
  13. package/layout/team-component/PLPNavigation/Composite/Content.d.ts +7 -0
  14. package/layout/team-component/PLPNavigation/Composite/Filters.d.ts +7 -0
  15. package/layout/team-component/PLPNavigation/Composite/Root.d.ts +7 -0
  16. package/layout/team-component/PLPNavigation/Composite/Selected/Item.d.ts +7 -0
  17. package/layout/team-component/PLPNavigation/Composite/Selected/Selected.d.ts +7 -0
  18. package/layout/team-component/PLPNavigation/Composite/Selected/index.d.ts +1 -0
  19. package/layout/team-component/PLPNavigation/Composite/Selected/interfaces.d.ts +16 -0
  20. package/layout/team-component/PLPNavigation/Composite/Total.d.ts +5 -0
  21. package/layout/team-component/PLPNavigation/PLPNavigation.d.ts +31 -0
  22. package/layout/team-component/PLPNavigation/index.d.ts +1 -0
  23. package/package.json +1 -1
  24. package/style.css +1 -1
  25. package/types/cms/ContentTypes/PDP/index.d.ts +15 -0
  26. package/types/constants.d.ts +4 -0
  27. package/types/contexts/contexts/search.d.ts +1 -1
  28. package/types/layout/team-components/Filter/index.d.ts +1 -1
  29. package/types/layout/team-components/PLPNavigation/index.d.ts +38 -0
  30. package/types/layout/team-components/Sort/index.d.ts +1 -2
package/index2.mjs CHANGED
@@ -19,17 +19,17 @@ const g = async (e, t = {}) => {
19
19
  }).then((c) => c.json()).catch((c) => {
20
20
  console.error("[ERROR FETCH VTEX]", c);
21
21
  });
22
- }, N = /* @__PURE__ */ new Map();
22
+ }, P = /* @__PURE__ */ new Map();
23
23
  async function pe(e, t = {}) {
24
24
  var o;
25
25
  try {
26
26
  const { abort: r = !1 } = t, s = new AbortController();
27
- r && (N.has(e) && ((o = N.get(e)) == null || o.abort(), N.delete(e)), N.set(e, s));
27
+ r && (P.has(e) && ((o = P.get(e)) == null || o.abort(), P.delete(e)), P.set(e, s));
28
28
  const a = g(e, {
29
29
  ...t,
30
30
  ...r ? { signal: s.signal } : {}
31
31
  });
32
- return r && N.delete(e), a;
32
+ return r && P.delete(e), a;
33
33
  } catch (r) {
34
34
  if (r.name === "AbortError") {
35
35
  console.log(`[REQUEST CANCELLED]: ${e}`);
@@ -251,11 +251,11 @@ const ke = n.object().shape({
251
251
  quantity: n.number().integer().nullable(),
252
252
  seller: n.string().required("Seller is required"),
253
253
  price: n.number().integer()
254
- }), Ne = n.object({
254
+ }), Pe = n.object({
255
255
  orderFormId: n.string().nullable(),
256
256
  orderItems: n.array().of(ke)
257
257
  });
258
- async function Pe({
258
+ async function Ne({
259
259
  apiUrl: e,
260
260
  body: t,
261
261
  fetchOptions: o
@@ -264,7 +264,7 @@ async function Pe({
264
264
  console.error("[ERROR FETCHING] Body is required");
265
265
  return;
266
266
  }
267
- await Ne.validate(t);
267
+ await Pe.validate(t);
268
268
  const { orderFormId: r, orderItems: s } = t;
269
269
  return g(
270
270
  `${e}/api/checkout/pub/orderForm/${r}/items/update`,
@@ -538,7 +538,7 @@ const Ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
538
538
  postOrderFormItems: Te,
539
539
  postOrderFormRegion: Ke,
540
540
  postOrderFormRemoveAllItems: qe,
541
- postOrderFormUpdateItems: Pe,
541
+ postOrderFormUpdateItems: Ne,
542
542
  postOrderFormUpdateShippingData: Qe,
543
543
  postOrderformAddress: ge,
544
544
  putOrderFormCustomData: Fe,
@@ -667,7 +667,7 @@ const at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
667
667
  responseAdapter: ft
668
668
  }, Symbol.toStringTag, { value: "Module" }));
669
669
  async function It({ contentType: e, storeId: t, CMS_PROJECT_NAME: o, NextCookies: r }) {
670
- const s = await $({
670
+ const s = await R({
671
671
  contentType: e,
672
672
  storeId: t,
673
673
  CMS_PROJECT_NAME: o,
@@ -727,7 +727,7 @@ async function vt({
727
727
  }
728
728
  return t;
729
729
  }
730
- async function $({
730
+ async function R({
731
731
  contentType: e,
732
732
  NextCookies: t,
733
733
  CMS_PROJECT_NAME: o,
@@ -770,7 +770,7 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
770
770
  __proto__: null,
771
771
  cmsBackup: bt,
772
772
  getCMSContentType: yt,
773
- getContentType: $
773
+ getContentType: R
774
774
  }, Symbol.toStringTag, { value: "Module" })), Rt = ({
775
775
  slug: e,
776
776
  data: t,
@@ -818,7 +818,7 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
818
818
  COMMON_PAGE_COLUMN_GAP: o,
819
819
  ...r
820
820
  }) => {
821
- const { data: s } = await $({
821
+ const { data: s } = await R({
822
822
  contentType: "common_page",
823
823
  ...r
824
824
  });
@@ -841,8 +841,8 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
841
841
  FooterSupport: i,
842
842
  ...c
843
843
  }) => {
844
- var l, m, f, p, S, R, F, O, T, E, b, q;
845
- const { data: u } = await $({
844
+ var l, m, f, p, S, F, $, O, T, E, b, q;
845
+ const { data: u } = await R({
846
846
  contentType: "footer",
847
847
  ...c
848
848
  }), d = Array.isArray(u) && ((m = (l = u[0]) == null ? void 0 : l.name) == null ? void 0 : m.toLowerCase()) === "footer" ? u[0] : null, h = {
@@ -857,8 +857,8 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
857
857
  a,
858
858
  {
859
859
  data: { ...d },
860
- socialInfo: (R = d.socialMedia) == null ? void 0 : R.socialMedia,
861
- socialMedias: (O = (F = d.socialMedia) == null ? void 0 : F.socialMedia) == null ? void 0 : O.medias,
860
+ socialInfo: (F = d.socialMedia) == null ? void 0 : F.socialMedia,
861
+ socialMedias: (O = ($ = d.socialMedia) == null ? void 0 : $.socialMedia) == null ? void 0 : O.medias,
862
862
  payments: h,
863
863
  adornment: {
864
864
  ...(E = (T = d.supportInfo) == null ? void 0 : T.supportInfo) != null && E.content ? {
@@ -886,7 +886,7 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
886
886
  ...o
887
887
  }) => {
888
888
  var a, i, c, u;
889
- const { data: r } = await $({
889
+ const { data: r } = await R({
890
890
  contentType: "header",
891
891
  ...o
892
892
  }), s = (a = r[0]) == null ? void 0 : a.sections.map((d) => d.data);
@@ -902,9 +902,31 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
902
902
  children: e
903
903
  }
904
904
  );
905
- }, Ot = {
905
+ }, Ot = async ({
906
+ children: e,
907
+ productId: t,
908
+ COMMON_PAGE_COLUMN_GAP: o,
909
+ SectionZone: r,
910
+ PDPContentProvider: s,
911
+ ...a
912
+ }) => {
913
+ const { data: i } = await R({
914
+ contentType: "product_page",
915
+ ...a
916
+ });
917
+ return /* @__PURE__ */ I(
918
+ s,
919
+ {
920
+ data: i[0],
921
+ productId: t,
922
+ COMMON_PAGE_COLUMN_GAP: o,
923
+ SectionZone: r,
924
+ children: e
925
+ }
926
+ );
927
+ }, Tt = {
906
928
  "column-modifier": "_column-modifier_1tqap_1"
907
- }, Tt = async ({
929
+ }, Et = async ({
908
930
  children: e,
909
931
  slug: t,
910
932
  SectionZone: o,
@@ -912,7 +934,7 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
912
934
  PLPContentProvider: s,
913
935
  ...a
914
936
  }) => {
915
- const { data: i } = await $({
937
+ const { data: i } = await R({
916
938
  contentType: "categories_page",
917
939
  ...a
918
940
  }), c = i.find(
@@ -942,7 +964,7 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
942
964
  {
943
965
  className: B.classNameConcat(
944
966
  w["responsive-desktop-flex"],
945
- Ot["column-modifier"]
967
+ Tt["column-modifier"]
946
968
  ),
947
969
  style: {
948
970
  minHeight: "100vh"
@@ -970,30 +992,31 @@ const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
970
992
  }
971
993
  ) })
972
994
  ] });
973
- }, Et = async ({
995
+ }, qt = async ({
974
996
  ClientTipbarContent: e,
975
997
  ...t
976
998
  }) => {
977
- const { data: o } = await $({
999
+ const { data: o } = await R({
978
1000
  contentType: "tipbar",
979
1001
  ...t
980
1002
  });
981
1003
  return /* @__PURE__ */ I(e, { data: o });
982
- }, qt = {
1004
+ }, At = {
983
1005
  CommonPageContent: Ft,
984
1006
  HeaderContent: St,
985
- TipbarContent: Et,
1007
+ TipbarContent: qt,
986
1008
  FooterContent: $t,
987
- PLPContent: Tt
988
- }, nr = { Components: qt }, At = n.object({
1009
+ PLPContent: Et,
1010
+ PDPContent: Ot
1011
+ }, sr = { Components: At }, kt = n.object({
989
1012
  query: n.string()
990
1013
  });
991
- async function kt({ apiUrl: e, body: t, fetchOptions: o }) {
1014
+ async function Pt({ apiUrl: e, body: t, fetchOptions: o }) {
992
1015
  if (!t) {
993
1016
  console.error("[ERROR FETCHING] Body is required");
994
1017
  return;
995
1018
  }
996
- await At.validate(t);
1019
+ await kt.validate(t);
997
1020
  const { query: r = "" } = t, s = new URLSearchParams({ query: r });
998
1021
  return g(
999
1022
  `${e}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${s.toString()}`,
@@ -1002,10 +1025,10 @@ async function kt({ apiUrl: e, body: t, fetchOptions: o }) {
1002
1025
  }
1003
1026
  );
1004
1027
  }
1005
- const Nt = (e, t) => me(e, t), Pt = (e) => ({
1028
+ const Nt = (e, t) => me(e, t), wt = (e) => ({
1006
1029
  ...e,
1007
1030
  description: e.description ? Nt(e.description) : e.description
1008
- }), wt = ({
1031
+ }), jt = ({
1009
1032
  offer: e,
1010
1033
  seller: t,
1011
1034
  product: o
@@ -1015,8 +1038,8 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1015
1038
  seller: t
1016
1039
  }), K = (e, t) => ({
1017
1040
  ...e,
1018
- isVariantOf: Pt(t)
1019
- }), jt = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", P = (e) => e.AvailableQuantity > 0, V = (e) => e.spotPrice ?? 0, Dt = (e) => e.Price ?? 0, W = (e, t) => P(e) && !P(t) ? -1 : !P(e) && P(t) ? 1 : V(e) - V(t), Ht = (e, t) => {
1041
+ isVariantOf: wt(t)
1042
+ }), Dt = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", N = (e) => e.AvailableQuantity > 0, V = (e) => e.spotPrice ?? 0, Ht = (e) => e.Price ?? 0, W = (e, t) => N(e) && !N(t) ? -1 : !N(e) && N(t) ? 1 : V(e) - V(t), _t = (e, t) => {
1020
1043
  let o = 0;
1021
1044
  for (let r = 1; r < e.length; r++)
1022
1045
  t(e[o], e[r]) > 0 && (o = r);
@@ -1027,7 +1050,7 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1027
1050
  offer: s.commertialOffer,
1028
1051
  sku: r
1029
1052
  }))
1030
- ), o = Ht(
1053
+ ), o = _t(
1031
1054
  t,
1032
1055
  ({ offer: r }, { offer: s }) => W(r, s)
1033
1056
  );
@@ -1042,11 +1065,11 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1042
1065
  attachment: "ATTACHMENT",
1043
1066
  specification: "SPECIFICATION",
1044
1067
  attribute: "ATTRIBUTE"
1045
- }, _t = (e) => ({
1068
+ }, Bt = (e) => ({
1046
1069
  name: e.name,
1047
1070
  value: e.content,
1048
1071
  valueReference: D.attachment
1049
- }), Bt = (e) => ({
1072
+ }), Gt = (e) => ({
1050
1073
  propertyID: e.id,
1051
1074
  name: e.name,
1052
1075
  value: e.value,
@@ -1063,23 +1086,23 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1063
1086
  name: i,
1064
1087
  value: "",
1065
1088
  valueReference: D.specification
1066
- }), s = Array.isArray(o) ? o.map(_t) : [], a = t ? t.map(Bt) : [];
1089
+ }), s = Array.isArray(o) ? o.map(Bt) : [], a = t ? t.map(Gt) : [];
1067
1090
  return [
1068
1091
  ...r,
1069
1092
  ...s,
1070
1093
  ...a
1071
1094
  ];
1072
- }, L = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Gt = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Ut = (e) => {
1095
+ }, L = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Ut = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Vt = (e) => {
1073
1096
  let t = e.slice(0);
1074
1097
  for (let o = 0; o < L.length; o++)
1075
1098
  t = t.replace(
1076
1099
  new RegExp(L.charAt(o), "g"),
1077
- Gt.charAt(o)
1100
+ Ut.charAt(o)
1078
1101
  );
1079
1102
  return t;
1080
- }, Vt = (e) => e.replace(/[·/_,:]/, "-"), Z = (e) => {
1103
+ }, Lt = (e) => e.replace(/[·/_,:]/, "-"), Z = (e) => {
1081
1104
  const o = e.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
1082
- return Vt(Ut(o)).toLowerCase();
1105
+ return Lt(Vt(o)).toLowerCase();
1083
1106
  }, ee = (e) => `/${e}/p`, te = (e) => {
1084
1107
  const t = Math.max(
1085
1108
  ...e.map((r) => r.NumberOfInstallments)
@@ -1096,7 +1119,7 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1096
1119
  listPrice: 0,
1097
1120
  sellerDefault: !1
1098
1121
  }, s = e.map(
1099
- (a) => wt({
1122
+ (a) => jt({
1100
1123
  offer: a.commertialOffer,
1101
1124
  seller: a,
1102
1125
  product: t
@@ -1104,7 +1127,7 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1104
1127
  ).sort(W).map((a) => (a.seller.sellerId === "1" && a.AvailableQuantity > 0 && (o.price = a.Price, o.listPrice = a.ListPrice, o.sellerDefault = !0), {
1105
1128
  availability: a.AvailableQuantity > 0,
1106
1129
  listPrice: a.ListPrice,
1107
- price: Dt(a),
1130
+ price: Ht(a),
1108
1131
  priceValidUntil: a.PriceValidUntil,
1109
1132
  priceCurrency: "BRL",
1110
1133
  installments: a.Installments,
@@ -1126,7 +1149,7 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1126
1149
  name: r,
1127
1150
  offers: {
1128
1151
  offers: s.map(({ sellerId: i, commertialOffer: c }) => ({
1129
- availability: jt(c.AvailableQuantity > 0),
1152
+ availability: Dt(c.AvailableQuantity > 0),
1130
1153
  listPrice: c.ListPrice,
1131
1154
  price: c.Price,
1132
1155
  quantity: c.AvailableQuantity,
@@ -1138,7 +1161,7 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1138
1161
  sku: o
1139
1162
  // slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
1140
1163
  };
1141
- }, Lt = (e) => {
1164
+ }, Mt = (e) => {
1142
1165
  var y;
1143
1166
  const {
1144
1167
  attributes: t,
@@ -1157,15 +1180,15 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1157
1180
  description: f,
1158
1181
  linkText: p,
1159
1182
  productClusters: S,
1160
- clusterHighlights: R,
1161
- productName: F,
1183
+ clusterHighlights: F,
1184
+ productName: $,
1162
1185
  properties: O,
1163
1186
  productId: T
1164
1187
  } = r, E = l.slice().reverse(), b = re(c, e.isVariantOf), q = te(b.offers[0].installments);
1165
1188
  return {
1166
1189
  sku: a,
1167
1190
  gtin: ((y = o[0]) == null ? void 0 : y.Value) ?? "",
1168
- name: F ?? i,
1191
+ name: $ ?? i,
1169
1192
  description: f,
1170
1193
  releaseDate: r.releaseDate ?? "",
1171
1194
  slug: p,
@@ -1176,12 +1199,12 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1176
1199
  brand: { name: h, brandName: h },
1177
1200
  seo: {
1178
1201
  description: f,
1179
- title: F,
1202
+ title: $,
1180
1203
  canonical: ee(p)
1181
1204
  },
1182
1205
  cluster: {
1183
1206
  generals: S,
1184
- highlights: R
1207
+ highlights: F
1185
1208
  },
1186
1209
  properties: O,
1187
1210
  availability: { status: b.offers[0].availability },
@@ -1212,7 +1235,7 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1212
1235
  },
1213
1236
  installments: q
1214
1237
  };
1215
- }, Mt = (e) => {
1238
+ }, xt = (e) => {
1216
1239
  var y;
1217
1240
  const {
1218
1241
  attributes: t,
@@ -1231,28 +1254,28 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1231
1254
  description: f,
1232
1255
  linkText: p,
1233
1256
  productClusters: S,
1234
- productName: R,
1235
- Coleção: F,
1257
+ productName: F,
1258
+ Coleção: $,
1236
1259
  "ID Coleção": O,
1237
1260
  productId: T
1238
1261
  } = r, E = l.slice().reverse(), b = re(c, e.isVariantOf), q = te(b.offers[0].installments);
1239
1262
  return {
1240
1263
  sku: a,
1241
1264
  gtin: ((y = o[0]) == null ? void 0 : y.Value) ?? "",
1242
- name: R ?? i,
1265
+ name: F ?? i,
1243
1266
  description: f,
1244
1267
  releaseDate: r.releaseDate ?? "",
1245
1268
  slug: p,
1246
1269
  video: u[0],
1247
1270
  categories: l,
1248
1271
  categoriesIds: m,
1249
- collection: F,
1272
+ collection: $,
1250
1273
  collectionId: O,
1251
1274
  id: T,
1252
1275
  brand: { name: h, brandName: h },
1253
1276
  seo: {
1254
1277
  description: f,
1255
- title: R,
1278
+ title: F,
1256
1279
  canonical: ee(p)
1257
1280
  },
1258
1281
  cluster: {
@@ -1301,16 +1324,16 @@ const Nt = (e, t) => me(e, t), Pt = (e) => ({
1301
1324
  },
1302
1325
  installments: q
1303
1326
  };
1304
- }, xt = n.array().of(n.object({
1327
+ }, zt = n.array().of(n.object({
1305
1328
  key: n.string().required(),
1306
1329
  value: n.string().required()
1307
1330
  })).required("Facets are required");
1308
- async function zt({ apiUrl: e, body: t, fetchOptions: o }) {
1331
+ async function Qt({ apiUrl: e, body: t, fetchOptions: o }) {
1309
1332
  if (!t) {
1310
1333
  console.error("[ERROR FETCHING] Body is required");
1311
1334
  return;
1312
1335
  }
1313
- await xt.validate(t);
1336
+ await zt.validate(t);
1314
1337
  const r = new URLSearchParams({}), s = t.map(({ key: i, value: c }) => `${i}/${c}`).join("/");
1315
1338
  ae(t, r);
1316
1339
  const a = `${e}/api/catalog_system/pub/products/crossselling/${s}`;
@@ -1321,7 +1344,7 @@ async function zt({ apiUrl: e, body: t, fetchOptions: o }) {
1321
1344
  const d = X(u.items);
1322
1345
  return d && K(d, u);
1323
1346
  }).filter((u) => !!u).map((u) => ({
1324
- node: Mt(u)
1347
+ node: xt(u)
1325
1348
  })));
1326
1349
  }
1327
1350
  const ne = ({
@@ -1363,7 +1386,7 @@ const ne = ({
1363
1386
  }
1364
1387
  );
1365
1388
  };
1366
- async function Qt({ body: e, extraData: t, ...o }) {
1389
+ async function Jt({ body: e, extraData: t, ...o }) {
1367
1390
  if (!e) {
1368
1391
  console.error("[ERROR FETCHING] Body is required");
1369
1392
  return;
@@ -1393,13 +1416,13 @@ async function Qt({ body: e, extraData: t, ...o }) {
1393
1416
  total: a.count
1394
1417
  },
1395
1418
  products: s.map((c, u) => ({
1396
- node: Lt(c),
1419
+ node: Mt(c),
1397
1420
  cursor: u.toString()
1398
1421
  }))
1399
1422
  }
1400
1423
  };
1401
1424
  }
1402
- async function Jt({ body: e, extraData: t, ...o }) {
1425
+ async function Kt({ body: e, extraData: t, ...o }) {
1403
1426
  if (!e) {
1404
1427
  console.error("[ERROR FETCHING] Body is required");
1405
1428
  return;
@@ -1419,16 +1442,16 @@ async function Jt({ body: e, extraData: t, ...o }) {
1419
1442
  }
1420
1443
  };
1421
1444
  }
1422
- const Kt = n.object({
1445
+ const Wt = n.object({
1423
1446
  query: n.string().optional(),
1424
1447
  locale: n.string().optional()
1425
1448
  });
1426
- async function Wt({ apiUrl: e, body: t, fetchOptions: o }) {
1449
+ async function Xt({ apiUrl: e, body: t, fetchOptions: o }) {
1427
1450
  if (!t) {
1428
1451
  console.error("[ERROR FETCHING] Body is required");
1429
1452
  return;
1430
1453
  }
1431
- await Kt.validate(t);
1454
+ await Wt.validate(t);
1432
1455
  const { query: r = "", locale: s = "default_locale" } = t, a = new URLSearchParams({ query: r, locale: s });
1433
1456
  return g(
1434
1457
  `${e}/api/io/_v/api/intelligent-search/search_suggestions?${a.toString()}`,
@@ -1437,33 +1460,33 @@ async function Wt({ apiUrl: e, body: t, fetchOptions: o }) {
1437
1460
  }
1438
1461
  );
1439
1462
  }
1440
- async function Xt({ apiUrl: e }) {
1463
+ async function Yt({ apiUrl: e }) {
1441
1464
  return g(`${e}/api/io/_v/api/intelligent-search/top_searches`);
1442
1465
  }
1443
- const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1466
+ const Zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1444
1467
  __proto__: null,
1445
- getSearchAutoCompleteSuggestions: kt,
1446
- getSearchCrossellingProducts: zt,
1447
- getSearchFacets: Jt,
1448
- getSearchProducts: Qt,
1449
- getSearchSuggestedTerms: Wt,
1450
- getSearchTopSearchs: Xt
1451
- }, Symbol.toStringTag, { value: "Module" })), Zt = {
1468
+ getSearchAutoCompleteSuggestions: Pt,
1469
+ getSearchCrossellingProducts: Qt,
1470
+ getSearchFacets: Kt,
1471
+ getSearchProducts: Jt,
1472
+ getSearchSuggestedTerms: Xt,
1473
+ getSearchTopSearchs: Yt
1474
+ }, Symbol.toStringTag, { value: "Module" })), er = {
1452
1475
  parseSearchState: de,
1453
1476
  convertSearchParams: ue,
1454
1477
  filterNonRootFacets: le,
1455
1478
  filterNonCategorySelected: ce
1456
- }, sr = {
1479
+ }, ar = {
1457
1480
  checkout: Ze,
1458
1481
  catalog: at,
1459
1482
  cms: Ct,
1460
- search: Yt
1461
- }, ar = {
1462
- catalog: ht,
1463
1483
  search: Zt
1484
+ }, ir = {
1485
+ catalog: ht,
1486
+ search: er
1464
1487
  };
1465
1488
  export {
1466
- sr as serverAPIs,
1467
- nr as serverCMS,
1468
- ar as serverHelpers
1489
+ ar as serverAPIs,
1490
+ sr as serverCMS,
1491
+ ir as serverHelpers
1469
1492
  };
package/layout/index.d.ts CHANGED
@@ -12,6 +12,36 @@ export declare const layout: {
12
12
  Image: ({ alt, className, objectFit, ...props }: import('../types/layout/team-components/Media').CustomImageProps) => import("react/jsx-runtime").JSX.Element;
13
13
  Video: ({ videoRef, ...props }: import('../types/layout/team-components/Media').VideoProps) => import("react/jsx-runtime").JSX.Element;
14
14
  };
15
+ PLPNavigation: {
16
+ BreadCrumb: {
17
+ ({ ICONS, ...props }: import('../types/layout/team-components/PLPNavigation').PLPBreadcrumbProps): import("react/jsx-runtime").JSX.Element;
18
+ displayName: string;
19
+ };
20
+ Content: {
21
+ ({ children, ICONS, PDC_NAVIGATION, searchParams, ...props }: import('../types/layout/team-components/PLPNavigation').PLPContentProps): import("react/jsx-runtime").JSX.Element;
22
+ displayName: string;
23
+ };
24
+ Filters: {
25
+ ({ ICONS, PDC_NAVIGATION, searchParams }: import('../types/layout/team-components/PLPNavigation').PLPNavigationFiltersProps): import("react/jsx-runtime").JSX.Element;
26
+ displayName: string;
27
+ };
28
+ Root: {
29
+ ({ children, onSort, setOpenFilters, style, PDC_NAVIGATION, ICONS, searchParams, ...props }: import('../types/layout/team-components/PLPNavigation').PLPRootProps): import("react/jsx-runtime").JSX.Element;
30
+ displayName: string;
31
+ };
32
+ Selected: {
33
+ ({ callback, selected, CONSTANTS, ...props }: import('./team-component/PLPNavigation/Composite/Selected/interfaces').SelectedProps): import("react/jsx-runtime").JSX.Element;
34
+ displayName: string;
35
+ };
36
+ SelectedItem: {
37
+ ({ callback, facet, CONSTANTS }: import('./team-component/PLPNavigation/Composite/Selected/interfaces').SelectedItemProps): import("react/jsx-runtime").JSX.Element;
38
+ displayName: string;
39
+ };
40
+ Total: {
41
+ (): import("react/jsx-runtime").JSX.Element;
42
+ displayName: string;
43
+ };
44
+ };
15
45
  ProductCard: {
16
46
  Actions: {
17
47
  ({ callback, children, className, data, isKit, ...props }: import('../types/layout/team-components/ProductCard').ActionsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ import { PLPBreadcrumbProps } from '../../../../types/layout/team-components/PLPNavigation';
2
+
3
+ declare const BreadCrumb: {
4
+ ({ ICONS, ...props }: PLPBreadcrumbProps): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export default BreadCrumb;
@@ -0,0 +1,7 @@
1
+ import { PLPContentProps } from '../../../../types/layout/team-components/PLPNavigation';
2
+
3
+ declare const Content: {
4
+ ({ children, ICONS, PDC_NAVIGATION, searchParams, ...props }: PLPContentProps): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export default Content;
@@ -0,0 +1,7 @@
1
+ import { PLPNavigationFiltersProps } from '../../../../types/layout/team-components/PLPNavigation';
2
+
3
+ declare const Filters: {
4
+ ({ ICONS, PDC_NAVIGATION, searchParams }: PLPNavigationFiltersProps): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export default Filters;
@@ -0,0 +1,7 @@
1
+ import { PLPRootProps } from '../../../../types/layout/team-components/PLPNavigation';
2
+
3
+ declare const Root: {
4
+ ({ children, onSort, setOpenFilters, style, PDC_NAVIGATION, ICONS, searchParams, ...props }: PLPRootProps): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export default Root;
@@ -0,0 +1,7 @@
1
+ import { SelectedItemProps } from './interfaces';
2
+
3
+ declare const Item: {
4
+ ({ callback, facet, CONSTANTS }: SelectedItemProps): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export default Item;
@@ -0,0 +1,7 @@
1
+ import { SelectedProps } from './interfaces';
2
+
3
+ declare const Selected: {
4
+ ({ callback, selected, CONSTANTS, ...props }: SelectedProps): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export default Selected;
@@ -0,0 +1 @@
1
+ export { default } from './Selected';
@@ -0,0 +1,16 @@
1
+ import { ICONSType, PLP_FILTERS_COLORSType, PLP_FILTERSType } from '../../../../../types/constants';
2
+ import { FacetsContextProps } from '../../../../../types/contexts/contexts/search';
3
+
4
+ export type SelectedFacetProps = FacetsContextProps['selectedFacets'][0];
5
+ export interface SelectedItemProps {
6
+ facet: SelectedFacetProps;
7
+ callback(value: SelectedFacetProps, remove: boolean): void;
8
+ CONSTANTS: {
9
+ ICONS: ICONSType;
10
+ PLP_FILTERS: PLP_FILTERSType;
11
+ PLP_FILTERS_COLORS: PLP_FILTERS_COLORSType;
12
+ };
13
+ }
14
+ export interface SelectedProps extends Pick<SelectedItemProps, 'callback' | 'CONSTANTS'> {
15
+ selected: SelectedFacetProps[];
16
+ }
@@ -0,0 +1,5 @@
1
+ declare const Total: {
2
+ (): import("react/jsx-runtime").JSX.Element;
3
+ displayName: string;
4
+ };
5
+ export default Total;
@@ -0,0 +1,31 @@
1
+ declare const PLPNavigation: {
2
+ BreadCrumb: {
3
+ ({ ICONS, ...props }: import('../../../types/layout/team-components/PLPNavigation').PLPBreadcrumbProps): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ Content: {
7
+ ({ children, ICONS, PDC_NAVIGATION, searchParams, ...props }: import('../../../types/layout/team-components/PLPNavigation').PLPContentProps): import("react/jsx-runtime").JSX.Element;
8
+ displayName: string;
9
+ };
10
+ Filters: {
11
+ ({ ICONS, PDC_NAVIGATION, searchParams }: import('../../../types/layout/team-components/PLPNavigation').PLPNavigationFiltersProps): import("react/jsx-runtime").JSX.Element;
12
+ displayName: string;
13
+ };
14
+ Root: {
15
+ ({ children, onSort, setOpenFilters, style, PDC_NAVIGATION, ICONS, searchParams, ...props }: import('../../../types/layout/team-components/PLPNavigation').PLPRootProps): import("react/jsx-runtime").JSX.Element;
16
+ displayName: string;
17
+ };
18
+ Selected: {
19
+ ({ callback, selected, CONSTANTS, ...props }: import('./Composite/Selected/interfaces').SelectedProps): import("react/jsx-runtime").JSX.Element;
20
+ displayName: string;
21
+ };
22
+ SelectedItem: {
23
+ ({ callback, facet, CONSTANTS }: import('./Composite/Selected/interfaces').SelectedItemProps): import("react/jsx-runtime").JSX.Element;
24
+ displayName: string;
25
+ };
26
+ Total: {
27
+ (): import("react/jsx-runtime").JSX.Element;
28
+ displayName: string;
29
+ };
30
+ };
31
+ export default PLPNavigation;
@@ -0,0 +1 @@
1
+ export { default } from './PLPNavigation';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soma-vertical-web/multi-lib",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {