@soma-vertical-web/multi-lib 0.0.36 → 0.0.37
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/__vite-browser-external-B8mGO3z6.js +1 -0
- package/__vite-browser-external-C4n7rb1H.mjs +85 -0
- package/cms/ContentTypes/Header/index.d.ts +3 -0
- package/cms/Sections/TextAccordion/Component.d.ts +3 -0
- package/cms/helpers/index.d.ts +0 -7
- package/cms/index.d.ts +1 -2
- package/cms/server.d.ts +4 -0
- package/constants.d.ts +1 -0
- package/contexts/hooks/useClipboard.d.ts +4 -0
- package/data/actions/masterDataServices.d.ts +1 -4
- package/data/helpers/utils/getAltTextFromUrl.d.ts +1 -0
- package/data/helpers/utils/getAuthenticatedUser.d.ts +4 -0
- package/data/helpers/utils/index.d.ts +3 -0
- package/data/helpers/utils/inputValidation.d.ts +7 -0
- package/index.d.ts +2 -1
- package/index.js +57 -17
- package/index.mjs +6159 -6089
- package/index2.js +1 -1
- package/index2.mjs +511 -435
- package/layout/index.d.ts +2 -1
- package/layout/utils/DraftJsLinkWrapper/index.d.ts +2 -3
- package/package.json +1 -1
- package/scripts/helpers/index.d.ts +3 -0
- package/scripts/index.d.ts +4 -0
- package/server.d.ts +5 -1
- package/style.css +1 -1
- package/types/cms/ContentTypes/Header/index.d.ts +3 -0
- package/types/cms/Sections/TextAccordion/index.d.ts +8 -1
- package/types/data/actions/index.d.ts +5 -2
- package/types/data/helpers/index.d.ts +5 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c="fuzzy",l="operator",u=e=>({isDepartment:e!=null&&e.length?e[0].key==="category-1":!1}),f=(e,t)=>{const n=decodeURIComponent(t??"").slice(1).split("/");return e.map(o=>{if(o.key==="category-2"&&o.__typename==="FacetBoolean"){const r=o.values;return{...o,values:r.filter(s=>!n.find(a=>a.toLowerCase()===s.value||a.toLowerCase()===s.name.toLowerCase()))}}return o})},i=(e,t)=>t?e==="category-1":!1,y=e=>e.key==="operator"&&(e.value==="and"||e.value==="or"),m=e=>e.type==="TEXT",v=e=>e.key==="fuzzy"&&(e.value==="0"||e.value==="1"||e.value==="auto"),_=e=>{const{key:t,name:n,values:o}=e;return{__typename:"FacetBoolean",key:t,label:n,values:o.slice().sort((r,s)=>r.name.localeCompare(s.name))}},d=({key:e,values:t})=>({__typename:"FacetRange",key:e,values:t}),g=(e,t,n)=>{if(!(e instanceof Object)||!("facets"in e))return[];const{facets:o=[]}=e,r=t!=null&&t.length?t[0].key==="category-1":!1;return o.filter(a=>!n||!i(a.key,r)).map(a=>m(a)?_(a):d(a))},b=(e,t)=>{const n=e.find(({key:r})=>r===c)??null,o=e.find(({key:r})=>r===l)??null;n&&v(n)&&t.append(c,n.value),o&&y(o)&&t.append(l,o.value)},k=e=>e.map(t=>{const[n,o]=t.split("/");return{key:n,value:o}}),S=(e,t)=>{const n=decodeURIComponent(t??"").slice(1).split("/"),o=e.filter(({value:s})=>!n.includes(decodeURIComponent(s))).map(s=>({...s,value:decodeURIComponent(s.value)})),{isDepartment:r}=u(o);return o==null?void 0:o.filter(s=>!i(s.key,r))},R=({pathname:e,searchParams:t},n)=>{const o=t.get("sort")??"",r=t.get("query")??null,s=parseInt(t.get("page")??"1",10);return{sort:o,facets:k(n),term:r,base:r?"":e,page:s}},C=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([n,o])=>{Array.isArray(o)?o.forEach(r=>t.append(n,r)):o!==void 0&&t.append(n,o)}),t},F={"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"},p={},h=Object.freeze(Object.defineProperty({__proto__:null,default:p},Symbol.toStringTag,{value:"Module"}));exports.__viteBrowserExternal=h;exports.addSearchParamsFacets=b;exports.convertSearchParams=C;exports.filterNonCategorySelected=f;exports.filterNonRootFacets=S;exports.formattedFacets=g;exports.fs=p;exports.parseSearchState=R;exports.responsive=F;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const c = "fuzzy", l = "operator", i = (e) => ({
|
|
2
|
+
isDepartment: e != null && e.length ? e[0].key === "category-1" : !1
|
|
3
|
+
}), b = (e, o) => {
|
|
4
|
+
const n = decodeURIComponent(o ?? "").slice(1).split("/");
|
|
5
|
+
return e.map((t) => {
|
|
6
|
+
if (t.key === "category-2" && t.__typename === "FacetBoolean") {
|
|
7
|
+
const s = t.values;
|
|
8
|
+
return {
|
|
9
|
+
...t,
|
|
10
|
+
values: s.filter(
|
|
11
|
+
(r) => !n.find(
|
|
12
|
+
(a) => a.toLowerCase() === r.value || a.toLowerCase() === r.name.toLowerCase()
|
|
13
|
+
)
|
|
14
|
+
)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
});
|
|
19
|
+
}, p = (e, o) => o ? e === "category-1" : !1, u = (e) => e.key === "operator" && (e.value === "and" || e.value === "or"), f = (e) => e.type === "TEXT", y = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), m = (e) => {
|
|
20
|
+
const { key: o, name: n, values: t } = e;
|
|
21
|
+
return {
|
|
22
|
+
__typename: "FacetBoolean",
|
|
23
|
+
key: o,
|
|
24
|
+
label: n,
|
|
25
|
+
values: t.slice().sort((s, r) => s.name.localeCompare(r.name))
|
|
26
|
+
};
|
|
27
|
+
}, _ = ({ key: e, values: o }) => ({
|
|
28
|
+
__typename: "FacetRange",
|
|
29
|
+
key: e,
|
|
30
|
+
values: o
|
|
31
|
+
}), g = (e, o, n) => {
|
|
32
|
+
if (!(e instanceof Object) || !("facets" in e))
|
|
33
|
+
return [];
|
|
34
|
+
const { facets: t = [] } = e, s = o != null && o.length ? o[0].key === "category-1" : !1;
|
|
35
|
+
return t.filter(
|
|
36
|
+
(a) => !n || !p(a.key, s)
|
|
37
|
+
).map(
|
|
38
|
+
(a) => f(a) ? m(a) : _(a)
|
|
39
|
+
);
|
|
40
|
+
}, k = (e, o) => {
|
|
41
|
+
const n = e.find(({ key: s }) => s === c) ?? null, t = e.find(({ key: s }) => s === l) ?? null;
|
|
42
|
+
n && y(n) && o.append(c, n.value), t && u(t) && o.append(l, t.value);
|
|
43
|
+
}, v = (e) => e.map((o) => {
|
|
44
|
+
const [n, t] = o.split("/");
|
|
45
|
+
return { key: n, value: t };
|
|
46
|
+
}), R = (e, o) => {
|
|
47
|
+
const n = decodeURIComponent(o ?? "").slice(1).split("/"), t = e.filter(({ value: r }) => !n.includes(decodeURIComponent(r))).map((r) => ({
|
|
48
|
+
...r,
|
|
49
|
+
value: decodeURIComponent(r.value)
|
|
50
|
+
})), { isDepartment: s } = i(t);
|
|
51
|
+
return t == null ? void 0 : t.filter((r) => !p(r.key, s));
|
|
52
|
+
}, C = ({ pathname: e, searchParams: o }, n) => {
|
|
53
|
+
const t = o.get("sort") ?? "", s = o.get("query") ?? null, r = parseInt(o.get("page") ?? "1", 10);
|
|
54
|
+
return {
|
|
55
|
+
sort: t,
|
|
56
|
+
facets: v(n),
|
|
57
|
+
term: s,
|
|
58
|
+
base: s ? "" : e,
|
|
59
|
+
page: r
|
|
60
|
+
};
|
|
61
|
+
}, z = (e) => {
|
|
62
|
+
const o = new URLSearchParams();
|
|
63
|
+
return Object.entries(e).forEach(([n, t]) => {
|
|
64
|
+
Array.isArray(t) ? t.forEach((s) => o.append(n, s)) : t !== void 0 && o.append(n, t);
|
|
65
|
+
}), o;
|
|
66
|
+
}, S = {
|
|
67
|
+
"responsive-mobile-flex": "_responsive-mobile-flex_t5bry_2",
|
|
68
|
+
"responsive-desktop-flex": "_responsive-desktop-flex_t5bry_13",
|
|
69
|
+
"responsive-mobile-block": "_responsive-mobile-block_t5bry_24",
|
|
70
|
+
"responsive-desktop-block": "_responsive-desktop-block_t5bry_35"
|
|
71
|
+
}, d = {}, E = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
72
|
+
__proto__: null,
|
|
73
|
+
default: d
|
|
74
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
75
|
+
export {
|
|
76
|
+
E as _,
|
|
77
|
+
k as a,
|
|
78
|
+
g as b,
|
|
79
|
+
z as c,
|
|
80
|
+
b as d,
|
|
81
|
+
R as e,
|
|
82
|
+
d as f,
|
|
83
|
+
C as p,
|
|
84
|
+
S as r
|
|
85
|
+
};
|
package/cms/helpers/index.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { ContentState, EditorState } from 'draft-js';
|
|
2
2
|
|
|
3
|
-
interface BlockData {
|
|
4
|
-
type: string;
|
|
5
|
-
text: string;
|
|
6
|
-
style?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const convertDraftToHTML: (contentState: ContentState) => BlockData[];
|
|
9
3
|
export declare const CREATE_CONTENT: (jsonData: string) => EditorState;
|
|
10
4
|
export declare const GET_CONTENT_STATE: (jsonData: string) => ContentState;
|
|
11
5
|
export declare const EXTENDED_BLOCK_RENDER_MAP: Immutable.Map<any, any>;
|
|
@@ -15,4 +9,3 @@ export declare const controllersPositionsAdapter: (position: string) => {
|
|
|
15
9
|
alignItems: string;
|
|
16
10
|
left: string;
|
|
17
11
|
};
|
|
18
|
-
export {};
|
package/cms/index.d.ts
CHANGED
|
@@ -8,11 +8,10 @@ export declare const clientCMS: {
|
|
|
8
8
|
imgStyles?: import('react').HTMLAttributes<HTMLImageElement>["style"];
|
|
9
9
|
} & import('react').HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
BennefitsBarSection: ({ data, CONSTANTS }: import('../types/cms/Sections/BennefitsBar').BennefitsBarSectionType) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
DataScreening: ({ slug, data, SectionZone, COMMON_PAGE_COLUMN_GAP }: import('../types/cms/ContentTypes/CommonPage').DataScreeningProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
SingleBannerSection: (data: import('../types/cms/Sections/Banner').BannerSectionType) => import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
TextContentSection: ({ data, ICONS }: import('../types/cms/Sections/TextContent').TextContentSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
TextContent: ({ data, ICONS }: import('../types/cms/Sections/TextContent').TextContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
13
|
BannerCarousel: (data: import('../types/cms/Sections/BannerCarousel').BannerCarouselSectionType) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
TextAccordionSection: ({ data, id: sectionId, ICONS, }: import('../types/cms/Sections/TextAccordion').TextAccordionSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
15
|
};
|
|
17
16
|
helpers: typeof helpers;
|
|
18
17
|
};
|
package/cms/server.d.ts
ADDED
package/constants.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { GetMasterDataDocumentsProps, PostDocumentProps, UpdateDocumentProps } from '../../types/data/actions';
|
|
2
2
|
|
|
3
3
|
export declare function postDocument({ apiUrl, body, masterDataEntity, fetchOptions }: PostDocumentProps): Promise<any>;
|
|
4
|
-
export declare function getMasterDataDocuments<T extends string>({ searchFields, masterDataEntity,
|
|
5
|
-
data: any;
|
|
6
|
-
scrollId: any;
|
|
7
|
-
}>;
|
|
4
|
+
export declare function getMasterDataDocuments<T extends string>({ searchFields, masterDataEntity, apiUrl, fetchOptions, retrieveAllSubsequentPages, resourcesLength, }: GetMasterDataDocumentsProps<T>): Promise<any[]>;
|
|
8
5
|
export declare function updateDocument({ documentId, masterDataEntity, apiUrl, body, fetchOptions, }: UpdateDocumentProps): Promise<number>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getAltTextFromUrl: (url: string) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const FieldTypes: readonly ["name", "email", "phone", "date", "cpf", "cep"];
|
|
2
|
+
export type FieldType = (typeof FieldTypes)[number] | string;
|
|
3
|
+
export declare const validateInput: ({ type, input, required, }: {
|
|
4
|
+
type: FieldType;
|
|
5
|
+
input: FormDataEntryValue;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
}) => boolean;
|