@soma-vertical-web/multi-lib 0.0.49 → 0.0.50
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/SearchPageScreening-BIyp1dAW.mjs +112 -0
- package/SearchPageScreening-gO7dG13l.js +1 -0
- package/cms/ContentTypes/Search/SearchContentScreening.d.ts +3 -0
- package/cms/index.d.ts +2 -0
- package/cms/server.d.ts +1 -0
- package/data/api/cms/index.d.ts +1 -1
- package/index.js +9 -9
- package/index.mjs +2328 -2320
- package/index2.js +1 -1
- package/index2.mjs +371 -457
- package/layout/index.d.ts +1 -1
- package/layout/team-component/Header/Composite/HeaderDesktopWrapper.d.ts +1 -3
- package/layout/team-component/Header/Composite/HeaderMobileWrapper.d.ts +1 -3
- package/layout/team-component/Header/Composite/SearchButton.d.ts +1 -5
- package/layout/team-component/Header/index.d.ts +1 -1
- package/package.json +1 -1
- package/types/cms/ContentTypes/Search/index.d.ts +31 -0
- package/types/data/api/cms/index.d.ts +2 -1
- package/types/layout/team-components/Header/index.d.ts +1 -5
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsxs as v, Fragment as C, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { Utils as h } from "@soma-vertical-web/core-components";
|
|
3
|
+
const d = "fuzzy", y = "operator", x = (e) => ({
|
|
4
|
+
isDepartment: e != null && e.length ? e[0].key === "category-1" : !1
|
|
5
|
+
}), N = (e, o) => {
|
|
6
|
+
const n = decodeURIComponent(o ?? "").slice(1).split("/");
|
|
7
|
+
return e.map((t) => {
|
|
8
|
+
if (t.key === "category-2" && t.__typename === "FacetBoolean") {
|
|
9
|
+
const s = t.values;
|
|
10
|
+
return {
|
|
11
|
+
...t,
|
|
12
|
+
values: s.filter(
|
|
13
|
+
(r) => !n.find(
|
|
14
|
+
(a) => a.toLowerCase() === r.value || a.toLowerCase() === r.name.toLowerCase()
|
|
15
|
+
)
|
|
16
|
+
)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
});
|
|
21
|
+
}, b = (e, o) => o ? e === "category-1" : !1, R = (e) => e.key === "operator" && (e.value === "and" || e.value === "or"), z = (e) => e.type === "TEXT", F = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), S = (e) => {
|
|
22
|
+
const { key: o, name: n, values: t } = e;
|
|
23
|
+
return {
|
|
24
|
+
__typename: "FacetBoolean",
|
|
25
|
+
key: o,
|
|
26
|
+
label: n,
|
|
27
|
+
values: t.slice().sort((s, r) => s.name.localeCompare(r.name))
|
|
28
|
+
};
|
|
29
|
+
}, D = ({ key: e, values: o }) => ({
|
|
30
|
+
__typename: "FacetRange",
|
|
31
|
+
key: e,
|
|
32
|
+
values: o
|
|
33
|
+
}), T = (e, o, n) => {
|
|
34
|
+
if (!(e instanceof Object) || !("facets" in e))
|
|
35
|
+
return [];
|
|
36
|
+
const { facets: t = [] } = e, s = o != null && o.length ? o[0].key === "category-1" : !1;
|
|
37
|
+
return t.filter(
|
|
38
|
+
(a) => !n || !b(a.key, s)
|
|
39
|
+
).map(
|
|
40
|
+
(a) => z(a) ? S(a) : D(a)
|
|
41
|
+
);
|
|
42
|
+
}, j = (e, o) => {
|
|
43
|
+
const n = e.find(({ key: s }) => s === d) ?? null, t = e.find(({ key: s }) => s === y) ?? null;
|
|
44
|
+
n && F(n) && o.append(d, n.value), t && R(t) && o.append(y, t.value);
|
|
45
|
+
}, E = (e) => e.map((o) => {
|
|
46
|
+
const [n, t] = o.split("/");
|
|
47
|
+
return { key: n, value: t };
|
|
48
|
+
}), w = (e, o) => {
|
|
49
|
+
const n = decodeURIComponent(o ?? "").slice(1).split("/"), t = e.filter(({ value: r }) => !n.includes(decodeURIComponent(r))).map((r) => ({
|
|
50
|
+
...r,
|
|
51
|
+
value: decodeURIComponent(r.value)
|
|
52
|
+
})), { isDepartment: s } = x(t);
|
|
53
|
+
return t == null ? void 0 : t.filter((r) => !b(r.key, s));
|
|
54
|
+
}, I = ({ pathname: e, searchParams: o }, n) => {
|
|
55
|
+
const t = o.get("sort") ?? "", s = o.get("query") ?? null, r = parseInt(o.get("page") ?? "1", 10);
|
|
56
|
+
return {
|
|
57
|
+
sort: t,
|
|
58
|
+
facets: E(n),
|
|
59
|
+
term: s,
|
|
60
|
+
base: s ? "" : e,
|
|
61
|
+
page: r
|
|
62
|
+
};
|
|
63
|
+
}, L = (e) => {
|
|
64
|
+
const o = new URLSearchParams();
|
|
65
|
+
return Object.entries(e).forEach(([n, t]) => {
|
|
66
|
+
Array.isArray(t) ? t.forEach((s) => o.append(n, s)) : t !== void 0 && o.append(n, t);
|
|
67
|
+
}), o;
|
|
68
|
+
}, p = {
|
|
69
|
+
"responsive-mobile-flex": "_responsive-mobile-flex_t5bry_2",
|
|
70
|
+
"responsive-desktop-flex": "_responsive-desktop-flex_t5bry_13",
|
|
71
|
+
"responsive-mobile-block": "_responsive-mobile-block_t5bry_24",
|
|
72
|
+
"responsive-desktop-block": "_responsive-desktop-block_t5bry_35"
|
|
73
|
+
}, O = {}, P = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
74
|
+
__proto__: null,
|
|
75
|
+
default: O
|
|
76
|
+
}, Symbol.toStringTag, { value: "Module" })), A = ({
|
|
77
|
+
children: e,
|
|
78
|
+
data: o,
|
|
79
|
+
SectionZone: n,
|
|
80
|
+
className: t
|
|
81
|
+
}) => {
|
|
82
|
+
var f, u;
|
|
83
|
+
const s = ((f = o == null ? void 0 : o.filter((m) => {
|
|
84
|
+
var c, l;
|
|
85
|
+
return ((l = (c = m.config) == null ? void 0 : c.responsive) == null ? void 0 : l.deviceType) === "mobile";
|
|
86
|
+
})[0]) == null ? void 0 : f.sections) || [], r = ((u = o == null ? void 0 : o.filter((m) => {
|
|
87
|
+
var c, l;
|
|
88
|
+
return ((l = (c = m.config) == null ? void 0 : c.responsive) == null ? void 0 : l.deviceType) === "desktop";
|
|
89
|
+
})[0]) == null ? void 0 : u.sections) || [], a = s.slice(0, 1), _ = s.slice(1, s.length), g = r.slice(0, 1), k = r.slice(1, r.length);
|
|
90
|
+
return /* @__PURE__ */ v(C, { children: [
|
|
91
|
+
/* @__PURE__ */ v("div", { className: t, children: [
|
|
92
|
+
/* @__PURE__ */ i("div", { className: p["responsive-mobile-flex"], children: /* @__PURE__ */ i(n, { data: a ?? [] }) }),
|
|
93
|
+
/* @__PURE__ */ i("div", { className: p["responsive-desktop-flex"], children: /* @__PURE__ */ i(n, { data: g ?? [] }) })
|
|
94
|
+
] }),
|
|
95
|
+
e,
|
|
96
|
+
/* @__PURE__ */ i("div", { className: p["responsive-mobile-flex"], children: /* @__PURE__ */ i(n, { data: _ ?? [] }) }),
|
|
97
|
+
/* @__PURE__ */ i("div", { className: p["responsive-desktop-flex"], children: /* @__PURE__ */ i(n, { data: k ?? [] }) }),
|
|
98
|
+
/* @__PURE__ */ i(h.Divider, {})
|
|
99
|
+
] });
|
|
100
|
+
};
|
|
101
|
+
export {
|
|
102
|
+
A as S,
|
|
103
|
+
P as _,
|
|
104
|
+
j as a,
|
|
105
|
+
T as b,
|
|
106
|
+
L as c,
|
|
107
|
+
N as d,
|
|
108
|
+
w as e,
|
|
109
|
+
O as f,
|
|
110
|
+
I as p,
|
|
111
|
+
p as r
|
|
112
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),x=require("@soma-vertical-web/core-components"),v="fuzzy",d="operator",h=e=>({isDepartment:e!=null&&e.length?e[0].key==="category-1":!1}),C=(e,t)=>{const s=decodeURIComponent(t??"").slice(1).split("/");return e.map(o=>{if(o.key==="category-2"&&o.__typename==="FacetBoolean"){const n=o.values;return{...o,values:n.filter(r=>!s.find(c=>c.toLowerCase()===r.value||c.toLowerCase()===r.name.toLowerCase()))}}return o})},y=(e,t)=>t?e==="category-1":!1,j=e=>e.key==="operator"&&(e.value==="and"||e.value==="or"),S=e=>e.type==="TEXT",R=e=>e.key==="fuzzy"&&(e.value==="0"||e.value==="1"||e.value==="auto"),F=e=>{const{key:t,name:s,values:o}=e;return{__typename:"FacetBoolean",key:t,label:s,values:o.slice().sort((n,r)=>n.name.localeCompare(r.name))}},z=({key:e,values:t})=>({__typename:"FacetRange",key:e,values:t}),E=(e,t,s)=>{if(!(e instanceof Object)||!("facets"in e))return[];const{facets:o=[]}=e,n=t!=null&&t.length?t[0].key==="category-1":!1;return o.filter(c=>!s||!y(c.key,n)).map(c=>S(c)?F(c):z(c))},N=(e,t)=>{const s=e.find(({key:n})=>n===v)??null,o=e.find(({key:n})=>n===d)??null;s&&R(s)&&t.append(v,s.value),o&&j(o)&&t.append(d,o.value)},B=e=>e.map(t=>{const[s,o]=t.split("/");return{key:s,value:o}}),D=(e,t)=>{const s=decodeURIComponent(t??"").slice(1).split("/"),o=e.filter(({value:r})=>!s.includes(decodeURIComponent(r))).map(r=>({...r,value:decodeURIComponent(r.value)})),{isDepartment:n}=h(o);return o==null?void 0:o.filter(r=>!y(r.key,n))},O=({pathname:e,searchParams:t},s)=>{const o=t.get("sort")??"",n=t.get("query")??null,r=parseInt(t.get("page")??"1",10);return{sort:o,facets:B(s),term:n,base:n?"":e,page:r}},P=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([s,o])=>{Array.isArray(o)?o.forEach(n=>t.append(s,n)):o!==void 0&&t.append(s,o)}),t},p={"responsive-mobile-flex":"_responsive-mobile-flex_t5bry_2","responsive-desktop-flex":"_responsive-desktop-flex_t5bry_13","responsive-mobile-block":"_responsive-mobile-block_t5bry_24","responsive-desktop-block":"_responsive-desktop-block_t5bry_35"},g={},U=Object.freeze(Object.defineProperty({__proto__:null,default:g},Symbol.toStringTag,{value:"Module"})),w=({children:e,data:t,SectionZone:s,className:o})=>{var u,f;const n=((u=t==null?void 0:t.filter(m=>{var i,l;return((l=(i=m.config)==null?void 0:i.responsive)==null?void 0:l.deviceType)==="mobile"})[0])==null?void 0:u.sections)||[],r=((f=t==null?void 0:t.filter(m=>{var i,l;return((l=(i=m.config)==null?void 0:i.responsive)==null?void 0:l.deviceType)==="desktop"})[0])==null?void 0:f.sections)||[],c=n.slice(0,1),_=n.slice(1,n.length),b=r.slice(0,1),k=r.slice(1,r.length);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:o,children:[a.jsx("div",{className:p["responsive-mobile-flex"],children:a.jsx(s,{data:c??[]})}),a.jsx("div",{className:p["responsive-desktop-flex"],children:a.jsx(s,{data:b??[]})})]}),e,a.jsx("div",{className:p["responsive-mobile-flex"],children:a.jsx(s,{data:_??[]})}),a.jsx("div",{className:p["responsive-desktop-flex"],children:a.jsx(s,{data:k??[]})}),a.jsx(x.Utils.Divider,{})]})};exports.SearchPageScreening=w;exports.__viteBrowserExternal=U;exports.addSearchParamsFacets=N;exports.convertSearchParams=P;exports.filterNonCategorySelected=C;exports.filterNonRootFacets=D;exports.formattedFacets=E;exports.fs=g;exports.parseSearchState=O;exports.responsive=p;
|
package/cms/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export declare const clientCMS: {
|
|
|
14
14
|
TextAccordionSection: ({ data, id: sectionId, ICONS, }: import('../types/cms/Sections/TextAccordion').TextAccordionSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
TipbarScreening: ({ CONSTANTS, data }: import('../types/cms/ContentTypes/Tipbar').TipbarScreeningProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
ImageGrid: (data: import('../types/cms/Sections/ImageGrid').ImageGridSectionType) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
SearchPageScreening: ({ children, data, SectionZone, className, }: import('../types/cms/ContentTypes/Search').SearchPageScrenningProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
SearchContent: ({ SectionZone, CMS_PROJECT_NAME, storeId, previewId }: import('../types/cms/ContentTypes/Search').SearchContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
};
|
|
18
20
|
helpers: typeof helpers;
|
|
19
21
|
};
|
package/cms/server.d.ts
CHANGED
|
@@ -36,5 +36,6 @@ export declare const serverCMS: {
|
|
|
36
36
|
title: string;
|
|
37
37
|
description: string;
|
|
38
38
|
} | null>;
|
|
39
|
+
SearchPageContent: ({ children, SectionZone, className, ...props }: import('../types/cms/ContentTypes/Search').SearchPageContentProps) => Promise<import("react/jsx-runtime").JSX.Element>;
|
|
39
40
|
};
|
|
40
41
|
};
|
package/data/api/cms/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GetContentTypeProps } from '../../../types/data/api/cms';
|
|
2
2
|
|
|
3
|
-
export declare function getContentType<T>({ contentType, NextCookies, CMS_PROJECT_NAME, storeId, }: GetContentTypeProps): Promise<{
|
|
3
|
+
export declare function getContentType<T>({ contentType, NextCookies, CMS_PROJECT_NAME, storeId, previewId }: GetContentTypeProps): Promise<{
|
|
4
4
|
status: number;
|
|
5
5
|
data: T[];
|
|
6
6
|
error?: undefined;
|