@websolutespa/bom-next 3.0.1 → 3.0.2
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/CHANGELOG.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +24 -0
- package/dist/client/client.d.ts +9 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +18 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/extra.d.ts +17 -0
- package/dist/client/extra.d.ts.map +1 -0
- package/dist/client/extra.js +13 -0
- package/dist/client/extra.js.map +1 -0
- package/dist/client/label.d.ts +15 -0
- package/dist/client/label.d.ts.map +1 -0
- package/dist/client/label.js +20 -0
- package/dist/client/label.js.map +1 -0
- package/dist/client/layout.d.ts +18 -0
- package/dist/client/layout.d.ts.map +1 -0
- package/dist/client/layout.js +13 -0
- package/dist/client/layout.js.map +1 -0
- package/dist/client/local.collection.d.ts +32 -0
- package/dist/client/local.collection.d.ts.map +1 -0
- package/dist/client/local.collection.js +49 -0
- package/dist/client/local.collection.js.map +1 -0
- package/dist/client/metadata.d.ts +43 -0
- package/dist/client/metadata.d.ts.map +1 -0
- package/dist/client/metadata.js +146 -0
- package/dist/client/metadata.js.map +1 -0
- package/dist/client/page.d.ts +404 -0
- package/dist/client/page.d.ts.map +1 -0
- package/dist/client/page.js +13 -0
- package/dist/client/page.js.map +1 -0
- package/dist/client/useApi.d.ts +21 -0
- package/dist/client/useApi.d.ts.map +1 -0
- package/dist/client/useApi.js +65 -0
- package/dist/client/useApi.js.map +1 -0
- package/dist/client/useCollectionApi.d.ts +21 -0
- package/dist/client/useCollectionApi.d.ts.map +1 -0
- package/dist/client/useCollectionApi.js +65 -0
- package/dist/client/useCollectionApi.js.map +1 -0
- package/dist/client/useExtra.d.ts +9 -0
- package/dist/client/useExtra.d.ts.map +1 -0
- package/dist/client/useExtra.js +13 -0
- package/dist/client/useExtra.js.map +1 -0
- package/dist/client/useHttp.d.ts +15 -0
- package/dist/client/useHttp.d.ts.map +1 -0
- package/dist/client/useHttp.js +70 -0
- package/dist/client/useHttp.js.map +1 -0
- package/dist/client/useLabel.d.ts +9 -0
- package/dist/client/useLabel.d.ts.map +1 -0
- package/dist/client/useLabel.js +13 -0
- package/dist/client/useLabel.js.map +1 -0
- package/dist/client/useLayout.d.ts +9 -0
- package/dist/client/useLayout.d.ts.map +1 -0
- package/dist/client/useLayout.js +13 -0
- package/dist/client/useLayout.js.map +1 -0
- package/dist/client/useLink.d.ts +7 -0
- package/dist/client/useLink.d.ts.map +1 -0
- package/dist/client/useLink.js +15 -0
- package/dist/client/useLink.js.map +1 -0
- package/dist/client/useMetaData.d.ts +9 -0
- package/dist/client/useMetaData.d.ts.map +1 -0
- package/dist/client/useMetaData.js +13 -0
- package/dist/client/useMetaData.js.map +1 -0
- package/dist/client/usePage.d.ts +394 -0
- package/dist/client/usePage.d.ts.map +1 -0
- package/dist/client/usePage.js +13 -0
- package/dist/client/usePage.js.map +1 -0
- package/dist/client/useUser.d.ts +9 -0
- package/dist/client/useUser.d.ts.map +1 -0
- package/dist/client/useUser.js +13 -0
- package/dist/client/useUser.js.map +1 -0
- package/dist/client/user.d.ts +20 -0
- package/dist/client/user.d.ts.map +1 -0
- package/dist/client/user.js +33 -0
- package/dist/client/user.js.map +1 -0
- package/dist/exports/client.d.ts +20 -979
- package/dist/exports/client.js +19 -5734
- package/dist/exports/instrumentation.d.ts +2 -13
- package/dist/exports/instrumentation.js +1 -24
- package/dist/exports/proxy.d.ts +5 -71
- package/dist/exports/proxy.js +4 -253
- package/dist/exports/server.d.ts +19 -402
- package/dist/exports/server.js +18 -1973
- package/dist/index.d.ts +18 -499
- package/dist/index.js +10 -200
- package/dist/instrumentation/client.d.ts +8 -0
- package/dist/instrumentation/client.d.ts.map +1 -0
- package/dist/instrumentation/client.js +15 -0
- package/dist/instrumentation/client.js.map +1 -0
- package/dist/instrumentation/sentry/capture.requestError.js +10 -0
- package/dist/instrumentation/sentry/capture.requestError.js.map +1 -0
- package/dist/instrumentation/sentry/capture.routerTransitionStart.js +7 -0
- package/dist/instrumentation/sentry/capture.routerTransitionStart.js.map +1 -0
- package/dist/instrumentation/server.d.ts +13 -0
- package/dist/instrumentation/server.d.ts.map +1 -0
- package/dist/instrumentation/server.js +19 -0
- package/dist/instrumentation/server.js.map +1 -0
- package/dist/{types2.d.ts → instrumentation/types.d.ts} +2 -2
- package/dist/instrumentation/types.d.ts.map +1 -0
- package/dist/lib/breadcrumb.d.ts +15 -0
- package/dist/lib/breadcrumb.d.ts.map +1 -0
- package/dist/lib/breadcrumb.js +20 -0
- package/dist/lib/breadcrumb.js.map +1 -0
- package/dist/lib/const.d.ts +9 -0
- package/dist/lib/const.d.ts.map +1 -0
- package/dist/lib/const.js +9 -0
- package/dist/lib/const.js.map +1 -0
- package/dist/lib/http.d.ts +36 -0
- package/dist/lib/http.d.ts.map +1 -0
- package/dist/{http.js → lib/http.js} +1 -1
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/label.d.ts +16 -0
- package/dist/lib/label.d.ts.map +1 -0
- package/dist/lib/label.js +33 -0
- package/dist/lib/label.js.map +1 -0
- package/dist/lib/layout.defaults.d.ts +9 -0
- package/dist/lib/layout.defaults.d.ts.map +1 -0
- package/dist/lib/layout.defaults.js +161 -0
- package/dist/lib/layout.defaults.js.map +1 -0
- package/dist/lib/link.d.ts +9 -0
- package/dist/lib/link.d.ts.map +1 -0
- package/dist/lib/link.js +16 -0
- package/dist/lib/link.js.map +1 -0
- package/dist/lib/meta-data.d.ts +56 -0
- package/dist/lib/meta-data.d.ts.map +1 -0
- package/dist/lib/open-graph.d.ts +143 -0
- package/dist/lib/open-graph.d.ts.map +1 -0
- package/dist/lib/pagination.d.ts +27 -0
- package/dist/lib/pagination.d.ts.map +1 -0
- package/dist/lib/pagination.js +39 -0
- package/dist/lib/pagination.js.map +1 -0
- package/dist/lib/route.d.ts +17 -0
- package/dist/lib/route.d.ts.map +1 -0
- package/dist/{route.js → lib/route.js} +1 -1
- package/dist/lib/route.js.map +1 -0
- package/dist/lib/store.d.ts +27 -0
- package/dist/lib/store.d.ts.map +1 -0
- package/dist/{store.js → lib/store.js} +1 -24
- package/dist/lib/store.js.map +1 -0
- package/dist/lib/structured-data.d.ts +9 -0
- package/dist/lib/structured-data.d.ts.map +1 -0
- package/dist/lib/twitter-card.d.ts +43 -0
- package/dist/lib/twitter-card.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +13 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +35 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/mock.d.ts +127 -0
- package/dist/mock.d.ts.map +1 -0
- package/dist/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.js +75 -0
- package/dist/node_modules/@selderee/plugin-htmlparser2/lib/hp2-builder.js.map +1 -0
- package/dist/node_modules/deepmerge/dist/cjs.js +86 -0
- package/dist/node_modules/deepmerge/dist/cjs.js.map +1 -0
- package/dist/node_modules/dom-serializer/lib/esm/foreignNames.js +105 -0
- package/dist/node_modules/dom-serializer/lib/esm/foreignNames.js.map +1 -0
- package/dist/node_modules/dom-serializer/lib/esm/index.js +146 -0
- package/dist/node_modules/dom-serializer/lib/esm/index.js.map +1 -0
- package/dist/node_modules/domelementtype/lib/esm/index.js +53 -0
- package/dist/node_modules/domelementtype/lib/esm/index.js.map +1 -0
- package/dist/node_modules/domhandler/lib/esm/index.js +130 -0
- package/dist/node_modules/domhandler/lib/esm/index.js.map +1 -0
- package/dist/node_modules/domhandler/lib/esm/node.js +307 -0
- package/dist/node_modules/domhandler/lib/esm/node.js.map +1 -0
- package/dist/node_modules/entities/lib/esm/decode.js +363 -0
- package/dist/node_modules/entities/lib/esm/decode.js.map +1 -0
- package/dist/node_modules/entities/lib/esm/decode_codepoint.js +59 -0
- package/dist/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -0
- package/dist/node_modules/entities/lib/esm/escape.js +85 -0
- package/dist/node_modules/entities/lib/esm/escape.js.map +1 -0
- package/dist/node_modules/entities/lib/esm/generated/decode-data-html.js +6 -0
- package/dist/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -0
- package/dist/node_modules/entities/lib/esm/generated/decode-data-xml.js +6 -0
- package/dist/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -0
- package/dist/node_modules/html-to-text/lib/html-to-text.js +1816 -0
- package/dist/node_modules/html-to-text/lib/html-to-text.js.map +1 -0
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Parser.js +435 -0
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Parser.js.map +1 -0
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Tokenizer.js +736 -0
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/Tokenizer.js.map +1 -0
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/index.js +19 -0
- package/dist/node_modules/html-to-text/node_modules/htmlparser2/lib/esm/index.js.map +1 -0
- package/dist/node_modules/leac/lib/leac.js +101 -0
- package/dist/node_modules/leac/lib/leac.js.map +1 -0
- package/dist/node_modules/parseley/lib/parseley.js +310 -0
- package/dist/node_modules/parseley/lib/parseley.js.map +1 -0
- package/dist/node_modules/peberminta/lib/core.js +149 -0
- package/dist/node_modules/peberminta/lib/core.js.map +1 -0
- package/dist/node_modules/selderee/lib/selderee.js +319 -0
- package/dist/node_modules/selderee/lib/selderee.js.map +1 -0
- package/dist/proxy/protected-route.d.ts +9 -0
- package/dist/proxy/protected-route.d.ts.map +1 -0
- package/dist/proxy/protected-route.js +40 -0
- package/dist/proxy/protected-route.js.map +1 -0
- package/dist/proxy/proxy.d.ts +31 -0
- package/dist/proxy/proxy.d.ts.map +1 -0
- package/dist/proxy/proxy.js +49 -0
- package/dist/proxy/proxy.js.map +1 -0
- package/dist/proxy/route-auto-detection.d.ts +12 -0
- package/dist/proxy/route-auto-detection.d.ts.map +1 -0
- package/dist/proxy/route-auto-detection.js +82 -0
- package/dist/proxy/route-auto-detection.js.map +1 -0
- package/dist/proxy/route-proxy.d.ts +36 -0
- package/dist/proxy/route-proxy.d.ts.map +1 -0
- package/dist/proxy/route-proxy.js +103 -0
- package/dist/proxy/route-proxy.js.map +1 -0
- package/dist/server/context.d.ts +30 -0
- package/dist/server/context.d.ts.map +1 -0
- package/dist/server/context.js +106 -0
- package/dist/server/context.js.map +1 -0
- package/dist/server/handlers/auth.handler.d.ts +10 -0
- package/dist/server/handlers/auth.handler.d.ts.map +1 -0
- package/dist/server/handlers/auth.handler.js +29 -0
- package/dist/server/handlers/auth.handler.js.map +1 -0
- package/dist/server/handlers/captions.handler.d.ts +10 -0
- package/dist/server/handlers/captions.handler.d.ts.map +1 -0
- package/dist/server/handlers/captions.handler.js +33 -0
- package/dist/server/handlers/captions.handler.js.map +1 -0
- package/dist/server/handlers/collection.handler.d.ts +36 -0
- package/dist/server/handlers/collection.handler.d.ts.map +1 -0
- package/dist/server/handlers/collection.handler.js +166 -0
- package/dist/server/handlers/collection.handler.js.map +1 -0
- package/dist/server/handlers/error-response.js +24 -0
- package/dist/server/handlers/error-response.js.map +1 -0
- package/dist/server/handlers/index.handler.d.ts +9 -0
- package/dist/server/handlers/index.handler.d.ts.map +1 -0
- package/dist/server/handlers/index.handler.js +145 -0
- package/dist/server/handlers/index.handler.js.map +1 -0
- package/dist/server/handlers/preview.handler.d.ts +9 -0
- package/dist/server/handlers/preview.handler.d.ts.map +1 -0
- package/dist/server/handlers/preview.handler.js +15 -0
- package/dist/server/handlers/preview.handler.js.map +1 -0
- package/dist/server/handlers/registry.handler.d.ts +16 -0
- package/dist/server/handlers/registry.handler.d.ts.map +1 -0
- package/dist/server/handlers/registry.handler.js +260 -0
- package/dist/server/handlers/registry.handler.js.map +1 -0
- package/dist/server/handlers/route.handler.d.ts +20 -0
- package/dist/server/handlers/route.handler.d.ts.map +1 -0
- package/dist/server/handlers/route.handler.js +122 -0
- package/dist/server/handlers/route.handler.js.map +1 -0
- package/dist/server/handlers/sitemap.handler.d.ts +30 -0
- package/dist/server/handlers/sitemap.handler.d.ts.map +1 -0
- package/dist/server/handlers/sitemap.handler.js +338 -0
- package/dist/server/handlers/sitemap.handler.js.map +1 -0
- package/dist/server/handlers/static-params.handler.d.ts +24 -0
- package/dist/server/handlers/static-params.handler.d.ts.map +1 -0
- package/dist/server/handlers/static-params.handler.js +56 -0
- package/dist/server/handlers/static-params.handler.js.map +1 -0
- package/dist/server/handlers/vars.handler.d.ts +10 -0
- package/dist/server/handlers/vars.handler.d.ts.map +1 -0
- package/dist/server/handlers/vars.handler.js +159 -0
- package/dist/server/handlers/vars.handler.js.map +1 -0
- package/dist/server/layout.js +88 -0
- package/dist/server/layout.js.map +1 -0
- package/dist/server/lazy.d.ts +11 -0
- package/dist/server/lazy.d.ts.map +1 -0
- package/dist/server/lazy.js +33 -0
- package/dist/server/lazy.js.map +1 -0
- package/dist/server/local-api.d.ts +9 -0
- package/dist/server/local-api.d.ts.map +1 -0
- package/dist/server/local-api.js +60 -0
- package/dist/server/local-api.js.map +1 -0
- package/dist/server/metadata.d.ts +21 -0
- package/dist/server/metadata.d.ts.map +1 -0
- package/dist/server/metadata.js +20 -0
- package/dist/server/metadata.js.map +1 -0
- package/dist/server/mixer-payload.d.ts +63 -0
- package/dist/server/mixer-payload.d.ts.map +1 -0
- package/dist/server/mixer.d.ts +214 -0
- package/dist/server/mixer.d.ts.map +1 -0
- package/dist/server/mixer.js +355 -0
- package/dist/server/mixer.js.map +1 -0
- package/dist/server/page.d.ts +22 -0
- package/dist/server/page.d.ts.map +1 -0
- package/dist/server/page.js +57 -0
- package/dist/server/page.js.map +1 -0
- package/dist/server/utils.d.ts +12 -0
- package/dist/server/utils.d.ts.map +1 -0
- package/dist/{utils2.js → server/utils.js} +3 -3
- package/dist/server/utils.js.map +1 -0
- package/dist/server/utmz.d.ts +9 -0
- package/dist/server/utmz.d.ts.map +1 -0
- package/dist/server/utmz.js +14 -0
- package/dist/server/utmz.js.map +1 -0
- package/dist/types.d.ts +6 -61
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/exports/client.d.ts.map +0 -1
- package/dist/exports/client.js.map +0 -1
- package/dist/exports/instrumentation.d.ts.map +0 -1
- package/dist/exports/instrumentation.js.map +0 -1
- package/dist/exports/proxy.d.ts.map +0 -1
- package/dist/exports/proxy.js.map +0 -1
- package/dist/exports/server.d.ts.map +0 -1
- package/dist/exports/server.js.map +0 -1
- package/dist/http.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index2.d.ts +0 -4
- package/dist/route.js.map +0 -1
- package/dist/store.js.map +0 -1
- package/dist/types2.d.ts.map +0 -1
- package/dist/utils.js +0 -78
- package/dist/utils.js.map +0 -1
- package/dist/utils2.js.map +0 -1
- /package/dist/{config.client.js → instrumentation/sentry/config.client.js} +0 -0
- /package/dist/{config.edge.js → instrumentation/sentry/config.edge.js} +0 -0
- /package/dist/{config.server.js → instrumentation/sentry/config.server.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,201 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}, {
|
|
12
|
-
id: "items.found",
|
|
13
|
-
text: "@items items found"
|
|
14
|
-
}],
|
|
15
|
-
locale: "en",
|
|
16
|
-
locales: [],
|
|
17
|
-
market: "ww",
|
|
18
|
-
markets: [],
|
|
19
|
-
app: {
|
|
20
|
-
id: "app",
|
|
21
|
-
brand: {
|
|
22
|
-
name: "Mixer",
|
|
23
|
-
social: []
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
menu: { main: {
|
|
27
|
-
id: "main",
|
|
28
|
-
items: [{
|
|
29
|
-
id: 1,
|
|
30
|
-
type: "category",
|
|
31
|
-
title: "Collections",
|
|
32
|
-
category: "product_index",
|
|
33
|
-
href: "#collections",
|
|
34
|
-
items: [{
|
|
35
|
-
id: "product_category_tile",
|
|
36
|
-
type: "category",
|
|
37
|
-
title: "Tiles",
|
|
38
|
-
category: "product_category_tile",
|
|
39
|
-
href: "#collections/tiles",
|
|
40
|
-
items: [],
|
|
41
|
-
media: {
|
|
42
|
-
type: "image",
|
|
43
|
-
src: "https://placehold.co/960x600/e4e5eb/f4f5fb.webp?text=placehold"
|
|
44
|
-
}
|
|
45
|
-
}]
|
|
46
|
-
}]
|
|
47
|
-
} },
|
|
48
|
-
tree: {
|
|
49
|
-
id: "homepage",
|
|
50
|
-
category: "homepage",
|
|
51
|
-
schema: "homepage",
|
|
52
|
-
title: "Homepage",
|
|
53
|
-
href: "/",
|
|
54
|
-
items: [
|
|
55
|
-
{
|
|
56
|
-
id: "product_index",
|
|
57
|
-
category: "product_index",
|
|
58
|
-
schema: "product_index",
|
|
59
|
-
title: "Collections",
|
|
60
|
-
href: "#collections",
|
|
61
|
-
items: [
|
|
62
|
-
{
|
|
63
|
-
id: "product_category",
|
|
64
|
-
category: "product_category",
|
|
65
|
-
schema: "product_category",
|
|
66
|
-
title: "Tiles",
|
|
67
|
-
href: "#product_category",
|
|
68
|
-
media: {
|
|
69
|
-
type: "image",
|
|
70
|
-
src: "https://bom-mixer.wslabs.it/assets/header/6366_n_tiles.jpg"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
id: "product_category",
|
|
75
|
-
category: "product_category",
|
|
76
|
-
schema: "product_category",
|
|
77
|
-
title: "3D Elements",
|
|
78
|
-
href: "#product_category",
|
|
79
|
-
media: {
|
|
80
|
-
type: "image",
|
|
81
|
-
src: "https://bom-mixer.wslabs.it/assets/header/6369_n_3d_elements_menu_cover.webp"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: "product_category",
|
|
86
|
-
category: "product_category",
|
|
87
|
-
schema: "product_category",
|
|
88
|
-
title: "Paints",
|
|
89
|
-
href: "#product_category",
|
|
90
|
-
media: {
|
|
91
|
-
type: "image",
|
|
92
|
-
src: "https://bom-mixer.wslabs.it/assets/header/6367_n_paints.jpg"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
id: "product_category",
|
|
97
|
-
category: "product_category",
|
|
98
|
-
schema: "product_category",
|
|
99
|
-
title: "Wood & Metal",
|
|
100
|
-
href: "#product_category",
|
|
101
|
-
media: {
|
|
102
|
-
type: "image",
|
|
103
|
-
src: "https://bom-mixer.wslabs.it/assets/header/6368_n_menu_wood_metal.webp"
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
id: "product_category",
|
|
108
|
-
category: "product_category",
|
|
109
|
-
schema: "product_category",
|
|
110
|
-
title: "Accessories",
|
|
111
|
-
href: "#product_category",
|
|
112
|
-
media: {
|
|
113
|
-
type: "image",
|
|
114
|
-
src: "https://bom-mixer.wslabs.it/assets/header/6371_n_accessories.jpg"
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
id: "product_category",
|
|
119
|
-
category: "product_category",
|
|
120
|
-
schema: "product_category",
|
|
121
|
-
title: "Editions",
|
|
122
|
-
href: "#product_category",
|
|
123
|
-
media: {
|
|
124
|
-
type: "image",
|
|
125
|
-
src: "https://bom-mixer.wslabs.it/assets/header/7858_n_Menu.webp"
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
id: "magazine_index",
|
|
132
|
-
category: "magazine_index",
|
|
133
|
-
schema: "magazine_index",
|
|
134
|
-
title: "Magazine",
|
|
135
|
-
href: "#magazine_index"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
id: "store_index",
|
|
139
|
-
category: "store_index",
|
|
140
|
-
schema: "store_index",
|
|
141
|
-
title: "Stores",
|
|
142
|
-
href: "#store_index"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
id: "contact",
|
|
146
|
-
category: "contact",
|
|
147
|
-
schema: "contact",
|
|
148
|
-
title: "Contacts",
|
|
149
|
-
href: "#contact"
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
id: "shop_index",
|
|
153
|
-
category: "shop_index",
|
|
154
|
-
schema: "shop_index",
|
|
155
|
-
title: "Shop",
|
|
156
|
-
href: "#shop_index"
|
|
157
|
-
}
|
|
158
|
-
]
|
|
159
|
-
},
|
|
160
|
-
topLevelHrefs: {},
|
|
161
|
-
topLevelRoutes: {}
|
|
162
|
-
};
|
|
163
|
-
//#endregion
|
|
164
|
-
//#region src/lib/pagination.ts
|
|
165
|
-
function isPaginationInfo(item) {
|
|
166
|
-
return isObject(item) && typeof item.page === "number" && typeof item.pages === "number" && typeof item.perPage === "number" && typeof item.total === "number" && isArray(item.items);
|
|
167
|
-
}
|
|
168
|
-
function getPagedItems(items, page, perPage) {
|
|
169
|
-
const from = (page - 1) * perPage;
|
|
170
|
-
const to = Math.min(page * perPage, items.length);
|
|
171
|
-
return items.slice(from, to);
|
|
172
|
-
}
|
|
173
|
-
function getMoreItems(items, page, perPage) {
|
|
174
|
-
const total = items.length;
|
|
175
|
-
const position = Math.min(total, perPage * page);
|
|
176
|
-
return items.slice(0, position);
|
|
177
|
-
}
|
|
178
|
-
function getPaginationInfo(items, options) {
|
|
179
|
-
const mode = options?.mode || "pagination";
|
|
180
|
-
const page = options?.page || 1;
|
|
181
|
-
const perPage = options?.perPage || 12;
|
|
182
|
-
const total = items.length;
|
|
183
|
-
const pages = Math.ceil(total / perPage);
|
|
184
|
-
const hasMore = page < pages;
|
|
185
|
-
const prevPage = page > 1 ? page - 1 : void 0;
|
|
186
|
-
const nextPage = page < pages ? page + 1 : void 0;
|
|
187
|
-
return {
|
|
188
|
-
items: mode === "pagination" ? getPagedItems(items, page, perPage) : getMoreItems(items, page, perPage),
|
|
189
|
-
hasMore,
|
|
190
|
-
nextPage,
|
|
191
|
-
page,
|
|
192
|
-
pages,
|
|
193
|
-
perPage,
|
|
194
|
-
prevPage,
|
|
195
|
-
total
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
//#endregion
|
|
1
|
+
import { getRouteLinkCategory, newRouteLink, resolveRoute, routeToLink, routeToRouteLink } from "./lib/route.js";
|
|
2
|
+
import { buildBreadcrumb } from "./lib/breadcrumb.js";
|
|
3
|
+
import { guest } from "./lib/const.js";
|
|
4
|
+
import { getLocalApiRequestOptions, getLocalApiUrl, getRemoteApiRequestOptions, localApiDelete, localApiFetch, localApiGet, localApiPatch, localApiPost, localApiPut } from "./lib/http.js";
|
|
5
|
+
import { LabelService, getLabelFromLabels, interpolateText } from "./lib/label.js";
|
|
6
|
+
import { LayoutDefaults } from "./lib/layout.defaults.js";
|
|
7
|
+
import { getLink } from "./lib/link.js";
|
|
8
|
+
import { getMoreItems, getPagedItems, getPaginationInfo, isPaginationInfo } from "./lib/pagination.js";
|
|
9
|
+
import { BuildStrategy, NextPhase, StoreStrategy, buildStrategy, nextPhase, storeCacheDuration, storeStrategy } from "./lib/store.js";
|
|
10
|
+
import { getPublicUrl, resolveHref, sanitizeHref, sanitizeRedirectFrom, sanitizeRedirectTo, sanitizeRedirectUrl, trimTerminalSlash } from "./lib/utils.js";
|
|
199
11
|
export { BuildStrategy, LabelService, LayoutDefaults, NextPhase, StoreStrategy, buildBreadcrumb, buildStrategy, getLabelFromLabels, getLink, getLocalApiRequestOptions, getLocalApiUrl, getMoreItems, getPagedItems, getPaginationInfo, getPublicUrl, getRemoteApiRequestOptions, getRouteLinkCategory, guest, interpolateText, isPaginationInfo, localApiDelete, localApiFetch, localApiGet, localApiPatch, localApiPost, localApiPut, newRouteLink, nextPhase, resolveHref, resolveRoute, routeToLink, routeToRouteLink, sanitizeHref, sanitizeRedirectFrom, sanitizeRedirectTo, sanitizeRedirectUrl, storeCacheDuration, storeStrategy, trimTerminalSlash };
|
|
200
|
-
|
|
201
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/instrumentation/client.d.ts
|
|
2
|
+
declare function registerClientIntrumentation(): void;
|
|
3
|
+
declare function captureRouterTransitionStart(href: string, navigationType: string): void;
|
|
4
|
+
//# sourceMappingURL=client.d.ts.map
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
export { captureRouterTransitionStart, registerClientIntrumentation };
|
|
8
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","names":[],"sources":["../../src/instrumentation/client.ts"],"mappings":";iBAEgB,4BAAA,CAAA;AAAA,iBASA,4BAAA,CAT4B,IAAA,EAAA,MAAA,EAAA,cAAA,EAAA,MAAA,CAAA,EAAA,IAAA;AAS5C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { onRouterTransitionStart } from "./sentry/capture.routerTransitionStart.js";
|
|
2
|
+
//#region src/instrumentation/client.ts
|
|
3
|
+
function registerClientIntrumentation() {
|
|
4
|
+
if (process.env.NEXT_PUBLIC_SENTRY_DSN) {
|
|
5
|
+
if (process.env.NEXT_RUNTIME === "nodejs") import("./sentry/config.client.js");
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
function captureRouterTransitionStart(href, navigationType) {
|
|
9
|
+
if (process.env.NEXT_PUBLIC_SENTRY_DSN) return onRouterTransitionStart(href, navigationType);
|
|
10
|
+
else console.log("Instrumentation.onRouterTransitionStart", href, navigationType);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { captureRouterTransitionStart, registerClientIntrumentation };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","names":["sentryOnRouterTransitionStart"],"sources":["../../src/instrumentation/client.ts"],"sourcesContent":["import { onRouterTransitionStart as sentryOnRouterTransitionStart } from './sentry/capture.routerTransitionStart';\r\n\r\nexport function registerClientIntrumentation() {\r\n if (process.env.NEXT_PUBLIC_SENTRY_DSN) {\r\n if (process.env.NEXT_RUNTIME === 'nodejs') {\r\n import('./sentry/config.client');\r\n }\r\n }\r\n}\r\n\r\n// This export will instrument router navigations\r\nexport function captureRouterTransitionStart(href: string, navigationType: string): void {\r\n if (process.env.NEXT_PUBLIC_SENTRY_DSN) {\r\n return sentryOnRouterTransitionStart(href, navigationType);\r\n } else {\r\n console.log('Instrumentation.onRouterTransitionStart', href, navigationType);\r\n }\r\n}\r\n\r\n"],"mappings":";;AAEA,SAAgB,+BAA+B;CAC7C,IAAI,QAAQ,IAAI,wBACV;MAAA,QAAQ,IAAI,iBAAiB,UAC/B,OAAO;CAAA;AAGb;AAGA,SAAgB,6BAA6B,MAAc,gBAA8B;CACvF,IAAI,QAAQ,IAAI,wBACd,OAAOA,wBAA8B,MAAM,cAAc;MAEzD,QAAQ,IAAI,2CAA2C,MAAM,cAAc;AAE/E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Sentry from "@sentry/nextjs";
|
|
2
|
+
//#region src/instrumentation/sentry/capture.requestError.ts
|
|
3
|
+
/**
|
|
4
|
+
* Reports errors passed to the the Next.js `onRequestError` instrumentation hook.
|
|
5
|
+
*/
|
|
6
|
+
const captureRequestError = Sentry.captureRequestError;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { captureRequestError };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=capture.requestError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.requestError.js","names":[],"sources":["../../../src/instrumentation/sentry/capture.requestError.ts"],"sourcesContent":["import * as Sentry from '@sentry/nextjs';\r\n\r\n/**\r\n * Reports errors passed to the the Next.js `onRequestError` instrumentation hook.\r\n */\r\nexport const captureRequestError = Sentry.captureRequestError;\r\n"],"mappings":";;;;;AAKA,MAAa,sBAAsB,OAAO"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as Sentry from "@sentry/nextjs";
|
|
2
|
+
//#region src/instrumentation/sentry/capture.routerTransitionStart.ts
|
|
3
|
+
const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { onRouterTransitionStart };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=capture.routerTransitionStart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.routerTransitionStart.js","names":[],"sources":["../../../src/instrumentation/sentry/capture.routerTransitionStart.ts"],"sourcesContent":["import * as Sentry from '@sentry/nextjs';\r\n\r\n// This export will instrument router navigations\r\nexport const onRouterTransitionStart = Sentry.captureRouterTransitionStart;\r\n"],"mappings":";;AAGA,MAAa,0BAA0B,OAAO"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ErrorContext, RequestInfo } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/instrumentation/server.d.ts
|
|
4
|
+
declare function registerIntrumentation(): Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* Reports errors passed to the the Next.js `onRequestError` instrumentation hook.
|
|
7
|
+
*/
|
|
8
|
+
declare function captureRequestError(error: unknown, request: RequestInfo, errorContext: ErrorContext): void;
|
|
9
|
+
//# sourceMappingURL=server.d.ts.map
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { captureRequestError, registerIntrumentation };
|
|
13
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","names":[],"sources":["../../src/instrumentation/server.ts"],"mappings":";;;iBAGsB,sBAAA,CAAA,GAAsB;;AAA5C;AAcA;AAAmC,iBAAnB,mBAAA,CAAmB,KAAA,EAAA,OAAA,EAAA,OAAA,EAA0B,WAA1B,EAAA,YAAA,EAAqD,YAArD,CAAA,EAAA,IAAA;AAA0B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { captureRequestError as captureRequestError$1 } from "./sentry/capture.requestError.js";
|
|
2
|
+
//#region src/instrumentation/server.ts
|
|
3
|
+
async function registerIntrumentation() {
|
|
4
|
+
if (process.env.NEXT_PUBLIC_SENTRY_DSN) {
|
|
5
|
+
if (process.env.NEXT_RUNTIME === "nodejs") await import("./sentry/config.server.js");
|
|
6
|
+
if (process.env.NEXT_RUNTIME === "edge") await import("./sentry/config.edge.js");
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Reports errors passed to the the Next.js `onRequestError` instrumentation hook.
|
|
11
|
+
*/
|
|
12
|
+
function captureRequestError(error, request, errorContext) {
|
|
13
|
+
if (process.env.NEXT_PUBLIC_SENTRY_DSN) return captureRequestError$1(error, request, errorContext);
|
|
14
|
+
else console.log("Instrumentation.captureRequestError", error, errorContext);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { captureRequestError, registerIntrumentation };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","names":["sentryCaptureRequestError"],"sources":["../../src/instrumentation/server.ts"],"sourcesContent":["import { captureRequestError as sentryCaptureRequestError } from './sentry/capture.requestError';\r\nimport { ErrorContext, RequestInfo } from './types';\r\n\r\nexport async function registerIntrumentation() {\r\n if (process.env.NEXT_PUBLIC_SENTRY_DSN) {\r\n if (process.env.NEXT_RUNTIME === 'nodejs') {\r\n await import('./sentry/config.server');\r\n }\r\n if (process.env.NEXT_RUNTIME === 'edge') {\r\n await import('./sentry/config.edge');\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Reports errors passed to the the Next.js `onRequestError` instrumentation hook.\r\n */\r\nexport function captureRequestError(error: unknown, request: RequestInfo, errorContext: ErrorContext): void {\r\n if (process.env.NEXT_PUBLIC_SENTRY_DSN) {\r\n return sentryCaptureRequestError(error, request, errorContext);\r\n } else {\r\n console.log('Instrumentation.captureRequestError', error, errorContext);\r\n }\r\n}\r\n"],"mappings":";;AAGA,eAAsB,yBAAyB;CAC7C,IAAI,QAAQ,IAAI,wBAAwB;EACtC,IAAI,QAAQ,IAAI,iBAAiB,UAC/B,MAAM,OAAO;EAEf,IAAI,QAAQ,IAAI,iBAAiB,QAC/B,MAAM,OAAO;CAEjB;AACF;;;;AAKA,SAAgB,oBAAoB,OAAgB,SAAsB,cAAkC;CAC1G,IAAI,QAAQ,IAAI,wBACd,OAAOA,sBAA0B,OAAO,SAAS,YAAY;MAE7D,QAAQ,IAAI,uCAAuC,OAAO,YAAY;AAE1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/instrumentation/types.ts"],"mappings":";KACY,WAAA;EAAA,IAAA,EAAA,MAAA;EAMA,MAAA,EAAA,MAAA;WAHD;;KAGC,YAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ICategory, IRoute, IRouteLink } from "@websolutespa/bom-core";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/breadcrumb.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Builds the breadcrumb trail from category segments + the current route.
|
|
7
|
+
* Uses currentRoutes (already filtered by market+locale) to resolve each segment's href.
|
|
8
|
+
* Replicates the logic of getBreadcrumbFromSegments without any store calls.
|
|
9
|
+
*/
|
|
10
|
+
declare function buildBreadcrumb(segments: ICategory[], currentRoute: IRoute, currentRoutes: IRoute[]): IRouteLink[];
|
|
11
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { buildBreadcrumb };
|
|
15
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","names":[],"sources":["../../src/lib/breadcrumb.ts"],"mappings":";;;;;;AAQA;AAA+B;AAAW;AAA2B,iBAArD,eAAA,CAAqD,QAAA,EAA3B,SAA2B,EAAA,EAAA,YAAA,EAAA,MAAA,EAAA,aAAA,EAAuB,MAAvB,EAAA,CAAA,EAAkC,UAAlC,EAAA;AAAuB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { routeToLink } from "./route.js";
|
|
2
|
+
import { findRouteOfCategory } from "@websolutespa/bom-core";
|
|
3
|
+
//#region src/lib/breadcrumb.ts
|
|
4
|
+
/**
|
|
5
|
+
* Builds the breadcrumb trail from category segments + the current route.
|
|
6
|
+
* Uses currentRoutes (already filtered by market+locale) to resolve each segment's href.
|
|
7
|
+
* Replicates the logic of getBreadcrumbFromSegments without any store calls.
|
|
8
|
+
*/
|
|
9
|
+
function buildBreadcrumb(segments, currentRoute, currentRoutes) {
|
|
10
|
+
const tree = segments.map((segment) => {
|
|
11
|
+
const route = findRouteOfCategory(currentRoutes, segment.id);
|
|
12
|
+
return route ? routeToLink(route) : null;
|
|
13
|
+
}).filter((x) => x !== null);
|
|
14
|
+
if (!currentRoute.isDefault) tree.push(routeToLink(currentRoute));
|
|
15
|
+
return tree;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { buildBreadcrumb };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","names":[],"sources":["../../src/lib/breadcrumb.ts"],"sourcesContent":["import { findRouteOfCategory, ICategory, IRoute, IRouteLink } from '@websolutespa/bom-core';\r\nimport { routeToLink } from './route';\r\n\r\n/**\r\n * Builds the breadcrumb trail from category segments + the current route.\r\n * Uses currentRoutes (already filtered by market+locale) to resolve each segment's href.\r\n * Replicates the logic of getBreadcrumbFromSegments without any store calls.\r\n */\r\nexport function buildBreadcrumb(segments: ICategory[], currentRoute: IRoute, currentRoutes: IRoute[]): IRouteLink[] {\r\n const tree: IRouteLink[] = segments\r\n .map(segment => {\r\n const route = findRouteOfCategory(currentRoutes, segment.id);\r\n return route ? routeToLink(route) : null;\r\n })\r\n .filter((x): x is IRouteLink => x !== null);\r\n // Append the leaf page only when it is not the default/index route of its category\r\n if (!currentRoute.isDefault) {\r\n tree.push(routeToLink(currentRoute));\r\n }\r\n return tree;\r\n}\r\n"],"mappings":";;;;;;;;AAQA,SAAgB,gBAAgB,UAAuB,cAAsB,eAAuC;CAClH,MAAM,OAAqB,SACxB,KAAI,YAAW;EACd,MAAM,QAAQ,oBAAoB,eAAe,QAAQ,EAAE;EAC3D,OAAO,QAAQ,YAAY,KAAK,IAAI;CACtC,CAAC,CAAC,CACD,QAAQ,MAAuB,MAAM,IAAI;CAE5C,IAAI,CAAC,aAAa,WAChB,KAAK,KAAK,YAAY,YAAY,CAAC;CAErC,OAAO;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.d.ts","names":[],"sources":["../../src/lib/const.ts"],"mappings":";;;cAEa,QAAsD,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.js","names":[],"sources":["../../src/lib/const.ts"],"sourcesContent":["import type { Config, User } from '@websolutespa/payload-plugin-bowl';\r\n\r\nexport const guest = { collection: 'users', roles: ['guest'] } as (User & Config['user']);\r\n"],"mappings":";AAEA,MAAa,QAAQ;CAAE,YAAY;CAAS,OAAO,CAAC,OAAO;AAAE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FetchRequestOptions } from "@websolutespa/bom-core";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/http.d.ts
|
|
4
|
+
type ApiRequestOptions = FetchRequestOptions;
|
|
5
|
+
declare function getLocalApiRequestOptions(): ApiRequestOptions;
|
|
6
|
+
declare function getRemoteApiRequestOptions(token?: string): ApiRequestOptions;
|
|
7
|
+
declare function getLocalApiUrl(pathname: string, origin?: string): string;
|
|
8
|
+
declare function localApiFetch<T = unknown>(pathname: string, options?: ApiRequestOptions, serviceOptions?: {
|
|
9
|
+
locale: string;
|
|
10
|
+
market: string;
|
|
11
|
+
}, origin?: string): Promise<T>;
|
|
12
|
+
declare function localApiGet<T = unknown>(url: string, options?: ApiRequestOptions, serviceOptions?: {
|
|
13
|
+
locale: string;
|
|
14
|
+
market: string;
|
|
15
|
+
}, origin?: string): Promise<T>;
|
|
16
|
+
declare function localApiPost<T = unknown>(url: string, payload?: unknown, options?: ApiRequestOptions, serviceOptions?: {
|
|
17
|
+
locale: string;
|
|
18
|
+
market: string;
|
|
19
|
+
}): Promise<T>;
|
|
20
|
+
declare function localApiPut<T = unknown>(url: string, payload?: unknown, options?: ApiRequestOptions, serviceOptions?: {
|
|
21
|
+
locale: string;
|
|
22
|
+
market: string;
|
|
23
|
+
}): Promise<T>;
|
|
24
|
+
declare function localApiPatch<T = unknown>(url: string, payload?: unknown, options?: ApiRequestOptions, serviceOptions?: {
|
|
25
|
+
locale: string;
|
|
26
|
+
market: string;
|
|
27
|
+
}): Promise<T>;
|
|
28
|
+
declare function localApiDelete<T = unknown>(url: string, options?: ApiRequestOptions, serviceOptions?: {
|
|
29
|
+
locale: string;
|
|
30
|
+
market: string;
|
|
31
|
+
}): Promise<T>;
|
|
32
|
+
//# sourceMappingURL=http.d.ts.map
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { ApiRequestOptions, getLocalApiRequestOptions, getLocalApiUrl, getRemoteApiRequestOptions, localApiDelete, localApiFetch, localApiGet, localApiPatch, localApiPost, localApiPut };
|
|
36
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","names":[],"sources":["../../src/lib/http.ts"],"mappings":";;;KAKY,iBAAA,GAAoB;iBAEhB,yBAAA,CAAA,GAA6B;AAFjC,iBASI,0BAAA,CATgB,KAAmB,CAAA,EAAA,MAAA,CAAA,EASS,iBATT;AAEnC,iBA4BA,cAAA,CA5ByB,QAAI,EAAA,MAAA,EAAA,MAAiB,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAO9C,iBA2BM,aA3BoB,CAAA,IAAA,OAAkB,CAAA,CAAA,QAAA,EAAiB,MAAA,EAAA,OAAA,CAAA,EA2BD,iBA3BC,EAAA,cA2B1C,CA3B0C,EAAA;EAqB7D,MAAA,EAAA,MAAA;EAMM,MAAA,EAAA,MAAA;AAAa,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA,CAAA,EAAwI,OAAxI,CAAgJ,CAAhJ,CAAA;AAAyC,iBActD,WAdsD,CAAA,IAAA,OAAA,CAAA,CAAA,GAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAcP,iBAdO,EAAA,cAAsG,CAAtG,EAAA;EAAuG,MAAA,EAAA,MAAA;EAAR,MAAA,EAAA,MAAA;AAAO,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA,CAAA,EAcd,OAdc,CAcN,CAdM,CAAA;AAc5J,iBAIA,YAJW,CAAA,IAAA,OAAA,CAAA,CAAA,GAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,OAAA,CAAA,EAIwD,iBAJxD,EAAA,cAA2I,CAA3I,EAAA;EAAA,MAAA,EAAA,MAAA;EAAoC,MAAA,EAAA,MAAA;AAAuG,CAAA,CAAA,EAIL,OAJK,CAIG,CAJH,CAAA;AAAR,iBAQ9I,WAR8I,CAAA,IAAA,OAAA,CAAA,CAAA,GAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,OAAA,CAAA,EAQ5E,iBAR4E,EAAA,cAIlI,CAJkI,EAAA;EAAO,MAAA,EAAA,MAAA;EAIrJ,MAAA,EAAA,MAAA;AAAY,CAAA,CAAA,EAIoI,OAJpI,CAI4I,CAJ5I,CAAA;AAAuD,iBAQnE,aARmE,CAAA,IAAA,OAAA,CAAA,CAAA,GAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,OAAA,CAAA,EAQC,iBARD,EAAA,cAAqF,CAArF,EAAA;EAAsF,MAAA,EAAA,MAAA;EAAR,MAAA,EAAA,MAAA;AAAO,CAAA,CAAA,EAQN,OARM,CAQE,CARF,CAAA;AAIxJ,iBAQA,cARW,CAAA,IAAA,OAAA,CAAA,CAAA,GAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAQuC,iBARvC,EAAA,cAA6I,CAA7I,EAAA;EAAA,MAAA,EAAA,MAAA;EAAuD,MAAA,EAAA,MAAA;AAAsF,CAAA,CAAA,EAQxB,OARwB,CAQhB,CARgB,CAAA;AAAR"}
|
|
@@ -56,6 +56,6 @@ async function localApiDelete(url, options = {}, serviceOptions) {
|
|
|
56
56
|
}, serviceOptions);
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
|
-
export {
|
|
59
|
+
export { getLocalApiRequestOptions, getLocalApiUrl, getRemoteApiRequestOptions, localApiDelete, localApiFetch, localApiGet, localApiPatch, localApiPost, localApiPut };
|
|
60
60
|
|
|
61
61
|
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","names":[],"sources":["../../src/lib/http.ts"],"sourcesContent":["import { FetchRequestOptions, httpFetch, isBrowser, merge } from '@websolutespa/bom-core';\r\n\r\nconst API_URL = process.env.NEXT_PUBLIC_URL || 'http://localhost:3000';\r\nconst API_BASE = process.env.NEXT_PUBLIC_API || '/api';\r\n\r\nexport type ApiRequestOptions = FetchRequestOptions;\r\n\r\nexport function getLocalApiRequestOptions(): ApiRequestOptions {\r\n return {\r\n headers: {\r\n },\r\n };\r\n}\r\n\r\nexport function getRemoteApiRequestOptions(token?: string): ApiRequestOptions {\r\n if (token) {\r\n // authenticated end user JWT token bearer (end_users)\r\n return {\r\n // mode: 'cors',\r\n headers: {\r\n Authorization: `JWT ${token}`,\r\n // Authorization: `Bearer ${token}`,\r\n },\r\n };\r\n } else {\r\n // guest user api key (users)\r\n return {\r\n // mode: 'cors',\r\n headers: {\r\n Authorization: `users API-Key ${process.env.STORE_API_KEY}`,\r\n },\r\n };\r\n }\r\n}\r\n\r\nexport function getLocalApiUrl(pathname: string, origin?: string): string {\r\n const url = `${isBrowser ? window.location.origin : (origin || API_URL)}${API_BASE}${pathname}`;\r\n // console.log('getLocalApiUrl', url);\r\n return url;\r\n}\r\n\r\nexport async function localApiFetch<T = unknown>(pathname: string, options: ApiRequestOptions = {}, serviceOptions?: { locale: string, market: string }, origin?: string): Promise<T> {\r\n // console.log('localApiFetch', pathname, options, serviceOptions);\r\n const url = new URL(getLocalApiUrl(pathname, origin));\r\n if (serviceOptions) {\r\n url.searchParams.append('locale', serviceOptions.locale);\r\n url.searchParams.append('market', serviceOptions.market);\r\n }\r\n const apiOptions = merge({ ...getLocalApiRequestOptions() }, options);\r\n console.log('📡 localApiFetch', apiOptions.method, url.href);\r\n const apiResponse = await httpFetch(url.href, apiOptions);\r\n // console.log('localApiFetch', pathname, apiResponse);\r\n return apiResponse;\r\n}\r\n\r\nexport async function localApiGet<T = unknown>(url: string, options: ApiRequestOptions = {}, serviceOptions?: { locale: string, market: string }, origin?: string): Promise<T> {\r\n return await localApiFetch<T>(url, { ...options, method: 'GET' }, serviceOptions, origin);\r\n}\r\n\r\nexport async function localApiPost<T = unknown>(url: string, payload?: unknown, options: ApiRequestOptions = {}, serviceOptions?: { locale: string, market: string }): Promise<T> {\r\n return await localApiFetch<T>(url, { ...options, method: 'POST', body: payload ? JSON.stringify(payload) : undefined }, serviceOptions);\r\n}\r\n\r\nexport async function localApiPut<T = unknown>(url: string, payload?: unknown, options: ApiRequestOptions = {}, serviceOptions?: { locale: string, market: string }): Promise<T> {\r\n return await localApiFetch<T>(url, { ...options, method: 'PUT', body: payload ? JSON.stringify(payload) : undefined }, serviceOptions);\r\n}\r\n\r\nexport async function localApiPatch<T = unknown>(url: string, payload?: unknown, options: ApiRequestOptions = {}, serviceOptions?: { locale: string, market: string }): Promise<T> {\r\n return await localApiFetch<T>(url, { ...options, method: 'PATCH', body: payload ? JSON.stringify(payload) : undefined }, serviceOptions);\r\n}\r\n\r\nexport async function localApiDelete<T = unknown>(url: string, options: ApiRequestOptions = {}, serviceOptions?: { locale: string, market: string }): Promise<T> {\r\n return await localApiFetch<T>(url, { ...options, method: 'DELETE' }, serviceOptions);\r\n}\r\n"],"mappings":";;AAEA,MAAM,UAAU,QAAQ,IAAI,mBAAmB;AAC/C,MAAM,WAAW,QAAQ,IAAI,mBAAmB;AAIhD,SAAgB,4BAA+C;CAC7D,OAAO,EACL,SAAS,CACT,EACF;AACF;AAEA,SAAgB,2BAA2B,OAAmC;CAC5E,IAAI,OAEF,OAAO,EAEL,SAAS,EACP,eAAe,OAAO,QAExB,EACF;MAGA,OAAO,EAEL,SAAS,EACP,eAAe,iBAAiB,QAAQ,IAAI,gBAC9C,EACF;AAEJ;AAEA,SAAgB,eAAe,UAAkB,QAAyB;CAGxE,OAAO,GAFQ,YAAY,OAAO,SAAS,SAAU,UAAU,UAAW,WAAW;AAGvF;AAEA,eAAsB,cAA2B,UAAkB,UAA6B,CAAC,GAAG,gBAAqD,QAA6B;CAEpL,MAAM,MAAM,IAAI,IAAI,eAAe,UAAU,MAAM,CAAC;CACpD,IAAI,gBAAgB;EAClB,IAAI,aAAa,OAAO,UAAU,eAAe,MAAM;EACvD,IAAI,aAAa,OAAO,UAAU,eAAe,MAAM;CACzD;CACA,MAAM,aAAa,MAAM,EAAE,GAAG,0BAA0B,EAAE,GAAG,OAAO;CACpE,QAAQ,IAAI,oBAAoB,WAAW,QAAQ,IAAI,IAAI;CAG3D,OAAO,MAFmB,UAAU,IAAI,MAAM,UAAU;AAG1D;AAEA,eAAsB,YAAyB,KAAa,UAA6B,CAAC,GAAG,gBAAqD,QAA6B;CAC7K,OAAO,MAAM,cAAiB,KAAK;EAAE,GAAG;EAAS,QAAQ;CAAM,GAAG,gBAAgB,MAAM;AAC1F;AAEA,eAAsB,aAA0B,KAAa,SAAmB,UAA6B,CAAC,GAAG,gBAAiE;CAChL,OAAO,MAAM,cAAiB,KAAK;EAAE,GAAG;EAAS,QAAQ;EAAQ,MAAM,UAAU,KAAK,UAAU,OAAO,IAAI,KAAA;CAAU,GAAG,cAAc;AACxI;AAEA,eAAsB,YAAyB,KAAa,SAAmB,UAA6B,CAAC,GAAG,gBAAiE;CAC/K,OAAO,MAAM,cAAiB,KAAK;EAAE,GAAG;EAAS,QAAQ;EAAO,MAAM,UAAU,KAAK,UAAU,OAAO,IAAI,KAAA;CAAU,GAAG,cAAc;AACvI;AAEA,eAAsB,cAA2B,KAAa,SAAmB,UAA6B,CAAC,GAAG,gBAAiE;CACjL,OAAO,MAAM,cAAiB,KAAK;EAAE,GAAG;EAAS,QAAQ;EAAS,MAAM,UAAU,KAAK,UAAU,OAAO,IAAI,KAAA;CAAU,GAAG,cAAc;AACzI;AAEA,eAAsB,eAA4B,KAAa,UAA6B,CAAC,GAAG,gBAAiE;CAC/J,OAAO,MAAM,cAAiB,KAAK;EAAE,GAAG;EAAS,QAAQ;CAAS,GAAG,cAAc;AACrF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ILabel, ILocalizable } from "@websolutespa/bom-core";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/label.d.ts
|
|
4
|
+
declare function getLabelFromLabels(labels: ILabel[]): (key: string, params?: Record<string, any>) => string;
|
|
5
|
+
declare function interpolateText(text: string, dictionary: Record<string, any>): string;
|
|
6
|
+
declare class LabelService {
|
|
7
|
+
labels: ILabel[];
|
|
8
|
+
dictionary: Record<string, ILocalizable | undefined>;
|
|
9
|
+
constructor(labels: ILabel[]);
|
|
10
|
+
getLabel(key: string, params?: Record<string, any>): string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=label.d.ts.map
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { LabelService, getLabelFromLabels, interpolateText };
|
|
16
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","names":[],"sources":["../../src/lib/label.ts"],"mappings":";;;iBAEgB,kBAAA,SAA2B,kCAEX;iBAahB,eAAA,2BAA0C;AAf1C,cAuBH,YAAA,CAvBqB;EAAA,MAAA,EAwBxB,MAxBwB,EAAA;EAAS,UAAA,EAyB7B,MAzB6B,CAAA,MAAA,EAyBd,YAzBc,GAAA,SAAA,CAAA;EAEX,WAAA,CAAA,MAAA,EAwBV,MAxBU,EAAA;EAAM,QAAA,CAAA,GAAA,EAAA,MAAA,EAAA,MAAA,CAAA,EA4BL,MA5BK,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,EAAA,MAAA;AAatC;AAQA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/lib/label.ts
|
|
2
|
+
function getLabelFromLabels(labels) {
|
|
3
|
+
const labelService = new LabelService(labels);
|
|
4
|
+
return (key, params) => {
|
|
5
|
+
return labelService.getLabel(key, params);
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
function parseLabel(dictionary, key, params) {
|
|
9
|
+
const label = dictionary[key] != null ? dictionary[key] : key;
|
|
10
|
+
if (params) return interpolateText(label, params);
|
|
11
|
+
return label;
|
|
12
|
+
}
|
|
13
|
+
function interpolateText(text, dictionary) {
|
|
14
|
+
return text.replace(/@(\w+)/g, (text, key) => {
|
|
15
|
+
const replacer = dictionary[key];
|
|
16
|
+
return typeof replacer !== "undefined" ? String(replacer) : text;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
var LabelService = class {
|
|
20
|
+
labels;
|
|
21
|
+
dictionary;
|
|
22
|
+
constructor(labels) {
|
|
23
|
+
this.labels = labels;
|
|
24
|
+
this.dictionary = Object.fromEntries(labels.map((l) => [l.id, l.text]));
|
|
25
|
+
}
|
|
26
|
+
getLabel(key, params) {
|
|
27
|
+
return parseLabel(this.dictionary, key, params);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { LabelService, getLabelFromLabels, interpolateText };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","names":[],"sources":["../../src/lib/label.ts"],"sourcesContent":["import type { ILabel, ILocalizable } from '@websolutespa/bom-core';\r\n\r\nexport function getLabelFromLabels(labels: ILabel[]) {\r\n const labelService = new LabelService(labels);\r\n return (key: string, params?: Record<string, any>): string => {\r\n return labelService.getLabel(key, params);\r\n };\r\n}\r\n\r\nfunction parseLabel(dictionary: Record<string, ILocalizable | undefined>, key: string, params?: Record<string, any>): string {\r\n const label = (dictionary[key] != null ? dictionary[key] : key) as string;\r\n if (params) {\r\n return interpolateText(label, params);\r\n }\r\n return label;\r\n}\r\n\r\nexport function interpolateText(text: string, dictionary: Record<string, any>): string {\r\n const TEMPLATE_REGEXP: RegExp = /@(\\w+)/g;\r\n return text.replace(TEMPLATE_REGEXP, (text: string, key: string) => {\r\n const replacer: unknown = dictionary[key];\r\n return typeof replacer !== 'undefined' ? String(replacer) : text;\r\n });\r\n}\r\n\r\nexport class LabelService {\r\n labels: ILabel[];\r\n dictionary: Record<string, ILocalizable | undefined>;\r\n constructor(labels: ILabel[]) {\r\n this.labels = labels;\r\n this.dictionary = Object.fromEntries(labels.map(l => [l.id, l.text]));\r\n }\r\n getLabel(key: string, params?: Record<string, any>): string {\r\n return parseLabel(this.dictionary, key, params);\r\n }\r\n}\r\n\r\n/*\r\nexport function resolveLabel(labels: ILabel[], id: string): string {\r\n const label = labels.find(x => x.id === id);\r\n return label && label.text ? label.text.toString() : id;\r\n}\r\n*/\r\n"],"mappings":";AAEA,SAAgB,mBAAmB,QAAkB;CACnD,MAAM,eAAe,IAAI,aAAa,MAAM;CAC5C,QAAQ,KAAa,WAAyC;EAC5D,OAAO,aAAa,SAAS,KAAK,MAAM;CAC1C;AACF;AAEA,SAAS,WAAW,YAAsD,KAAa,QAAsC;CAC3H,MAAM,QAAS,WAAW,QAAQ,OAAO,WAAW,OAAO;CAC3D,IAAI,QACF,OAAO,gBAAgB,OAAO,MAAM;CAEtC,OAAO;AACT;AAEA,SAAgB,gBAAgB,MAAc,YAAyC;CAErF,OAAO,KAAK,QAAQ,YAAkB,MAAc,QAAgB;EAClE,MAAM,WAAoB,WAAW;EACrC,OAAO,OAAO,aAAa,cAAc,OAAO,QAAQ,IAAI;CAC9D,CAAC;AACH;AAEA,IAAa,eAAb,MAA0B;CACxB;CACA;CACA,YAAY,QAAkB;EAC5B,KAAK,SAAS;EACd,KAAK,aAAa,OAAO,YAAY,OAAO,KAAI,MAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;CACtE;CACA,SAAS,KAAa,QAAsC;EAC1D,OAAO,WAAW,KAAK,YAAY,KAAK,MAAM;CAChD;AACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ILayout } from "@websolutespa/bom-core";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/layout.defaults.d.ts
|
|
4
|
+
declare const LayoutDefaults: ILayout;
|
|
5
|
+
//# sourceMappingURL=layout.defaults.d.ts.map
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { LayoutDefaults };
|
|
9
|
+
//# sourceMappingURL=layout.defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.defaults.d.ts","names":[],"sources":["../../src/lib/layout.defaults.ts"],"mappings":";;;cAEa,gBAAgB"}
|