@mrfylke/contact-form 0.1.28 → 0.1.30
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/lib/components/icon/generated-icons.d.ts +6 -6
- package/lib/components/icon/generated-icons.js +8 -8
- package/lib/layouts/contact-page-layout.d.ts.map +1 -1
- package/lib/layouts/contact-page-layout.js +7 -2
- package/lib/layouts/contact-pages.d.ts +1 -0
- package/lib/layouts/contact-pages.d.ts.map +1 -1
- package/lib/layouts/contact-pages.js +5 -2
- package/lib/translations/pages/contact.js +2 -2
- package/package.json +1 -1
|
@@ -1288,7 +1288,7 @@ export declare const icons: {
|
|
|
1288
1288
|
darkable: boolean;
|
|
1289
1289
|
id: string;
|
|
1290
1290
|
};
|
|
1291
|
-
|
|
1291
|
+
Crash: {
|
|
1292
1292
|
relative: string;
|
|
1293
1293
|
absolute: string;
|
|
1294
1294
|
assetType: string;
|
|
@@ -1296,7 +1296,7 @@ export declare const icons: {
|
|
|
1296
1296
|
darkable: boolean;
|
|
1297
1297
|
id: string;
|
|
1298
1298
|
};
|
|
1299
|
-
|
|
1299
|
+
DashboardBackground: {
|
|
1300
1300
|
relative: string;
|
|
1301
1301
|
absolute: string;
|
|
1302
1302
|
assetType: string;
|
|
@@ -1304,7 +1304,7 @@ export declare const icons: {
|
|
|
1304
1304
|
darkable: boolean;
|
|
1305
1305
|
id: string;
|
|
1306
1306
|
};
|
|
1307
|
-
|
|
1307
|
+
Onboarding4: {
|
|
1308
1308
|
relative: string;
|
|
1309
1309
|
absolute: string;
|
|
1310
1310
|
assetType: string;
|
|
@@ -1312,7 +1312,7 @@ export declare const icons: {
|
|
|
1312
1312
|
darkable: boolean;
|
|
1313
1313
|
id: string;
|
|
1314
1314
|
};
|
|
1315
|
-
|
|
1315
|
+
Onboarding5: {
|
|
1316
1316
|
relative: string;
|
|
1317
1317
|
absolute: string;
|
|
1318
1318
|
assetType: string;
|
|
@@ -1320,7 +1320,7 @@ export declare const icons: {
|
|
|
1320
1320
|
darkable: boolean;
|
|
1321
1321
|
id: string;
|
|
1322
1322
|
};
|
|
1323
|
-
|
|
1323
|
+
TicketSplash: {
|
|
1324
1324
|
relative: string;
|
|
1325
1325
|
absolute: string;
|
|
1326
1326
|
assetType: string;
|
|
@@ -1328,7 +1328,7 @@ export declare const icons: {
|
|
|
1328
1328
|
darkable: boolean;
|
|
1329
1329
|
id: string;
|
|
1330
1330
|
};
|
|
1331
|
-
|
|
1331
|
+
"logo/RichLogo": {
|
|
1332
1332
|
relative: string;
|
|
1333
1333
|
absolute: string;
|
|
1334
1334
|
assetType: string;
|
|
@@ -1294,14 +1294,6 @@ exports.icons = {
|
|
|
1294
1294
|
"darkable": false,
|
|
1295
1295
|
"id": "favicon"
|
|
1296
1296
|
},
|
|
1297
|
-
"logo/RichLogo": {
|
|
1298
|
-
"relative": "colors/logo/RichLogo.svg",
|
|
1299
|
-
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/logo/RichLogo.svg",
|
|
1300
|
-
"assetType": "colors",
|
|
1301
|
-
"colorType": "images",
|
|
1302
|
-
"darkable": false,
|
|
1303
|
-
"id": "logo/RichLogo"
|
|
1304
|
-
},
|
|
1305
1297
|
"Crash": {
|
|
1306
1298
|
"relative": "colors/images/Crash.svg",
|
|
1307
1299
|
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/Crash.svg",
|
|
@@ -1342,6 +1334,14 @@ exports.icons = {
|
|
|
1342
1334
|
"darkable": false,
|
|
1343
1335
|
"id": "TicketSplash"
|
|
1344
1336
|
},
|
|
1337
|
+
"logo/RichLogo": {
|
|
1338
|
+
"relative": "colors/logo/RichLogo.svg",
|
|
1339
|
+
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/logo/RichLogo.svg",
|
|
1340
|
+
"assetType": "colors",
|
|
1341
|
+
"colorType": "images",
|
|
1342
|
+
"darkable": false,
|
|
1343
|
+
"id": "logo/RichLogo"
|
|
1344
|
+
},
|
|
1345
1345
|
"BackgroundIllustration-OnBehalfOf": {
|
|
1346
1346
|
"relative": "colors/images/light/BackgroundIllustration-OnBehalfOf.svg",
|
|
1347
1347
|
"absolute": "/home/runner/work/mrfylke-contact-form/mrfylke-contact-form/packages/contact-form/.tmp-icon-assets/colors/images/light/BackgroundIllustration-OnBehalfOf.svg",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-page-layout.d.ts","sourceRoot":"","sources":["../../src/layouts/contact-page-layout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contact-page-layout.d.ts","sourceRoot":"","sources":["../../src/layouts/contact-page-layout.tsx"],"names":[],"mappings":"AAmBA,MAAM,CAAC,OAAO,UAAU,iBAAiB,6UAiFxC"}
|
|
@@ -33,7 +33,12 @@ function ContactPageLayout() {
|
|
|
33
33
|
if (pathname === errorPath) {
|
|
34
34
|
return layout?.errorContent ?? (0, jsx_runtime_1.jsx)(error_content_1.ErrorContent, {});
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const isBasePath = (0, contact_pages_1.stripTrailingSlashes)(pathname) === basePath;
|
|
37
|
+
const activePage = isBasePath
|
|
38
|
+
? undefined
|
|
39
|
+
: (0, contact_pages_1.findMatchedPage)(pathname, basePath, visiblePages);
|
|
40
|
+
if (!isBasePath && !activePage)
|
|
41
|
+
(0, navigation_1.notFound)();
|
|
37
42
|
const externalUrl = activePage
|
|
38
43
|
? pages.externalUrlByPageId?.[activePage.id]
|
|
39
44
|
: undefined;
|
|
@@ -43,7 +48,7 @@ function ContactPageLayout() {
|
|
|
43
48
|
href: '/',
|
|
44
49
|
label: pageText.Contact.contactPageLayout.homeLink,
|
|
45
50
|
};
|
|
46
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: layout_module_css_1.default.layout, children: [(0, jsx_runtime_1.jsxs)("div", { children: [backLink && ((0, jsx_runtime_1.jsx)("div", { className: layout_module_css_1.default.homeLink__container, children: (0, jsx_runtime_1.jsx)(button_1.ButtonLink, { mode: "transparent", href: backLink.href, title: t(backLink.label), icon: { left: (0, jsx_runtime_1.jsx)(icon_1.MonoIcon, { icon: "navigation/ArrowLeft" }) } }) })), (0, jsx_runtime_1.jsxs)("div", { className: layout_module_css_1.default.layout__container, children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.h2, { textType: "heading__2xl", children: t(pageText.Contact.contactPageLayout.title) }), (0, jsx_runtime_1.jsx)("nav", { className: layout_module_css_1.default.contact_page_navigator__container, children: visiblePages.map((contactPage) => ((0, jsx_runtime_1.jsx)(ContactPageNavLink, { icon: contactPage.icon, title: contactPage.title, href: `${basePath}/${contactPage.slug}`, isActive:
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: layout_module_css_1.default.layout, children: [(0, jsx_runtime_1.jsxs)("div", { children: [backLink && ((0, jsx_runtime_1.jsx)("div", { className: layout_module_css_1.default.homeLink__container, children: (0, jsx_runtime_1.jsx)(button_1.ButtonLink, { mode: "transparent", href: backLink.href, title: t(backLink.label), icon: { left: (0, jsx_runtime_1.jsx)(icon_1.MonoIcon, { icon: "navigation/ArrowLeft" }) } }) })), (0, jsx_runtime_1.jsxs)("div", { className: layout_module_css_1.default.layout__container, children: [(0, jsx_runtime_1.jsx)(typography_1.Typo.h2, { textType: "heading__2xl", children: t(pageText.Contact.contactPageLayout.title) }), (0, jsx_runtime_1.jsx)("nav", { className: layout_module_css_1.default.contact_page_navigator__container, children: visiblePages.map((contactPage) => ((0, jsx_runtime_1.jsx)(ContactPageNavLink, { icon: contactPage.icon, title: contactPage.title, href: `${basePath}/${contactPage.slug}`, isActive: activePage?.slug === contactPage.slug, externalUrl: pages.externalUrlByPageId?.[contactPage.id] }, contactPage.id))) })] })] }), body, (0, contact_pages_1.displayPrivacyAndTerms)(activePage) && ((0, jsx_runtime_1.jsx)("div", { className: layout_module_css_1.default.privacyAndTerms, children: (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__s__strong", children: t(pageText.Contact.contactPageLayout.privacyAndTerms) }) }))] }));
|
|
47
52
|
}
|
|
48
53
|
function ContactPageNavLink({ icon, title, href, isActive, externalUrl, }) {
|
|
49
54
|
const { t } = (0, translations_1.useTranslation)();
|
|
@@ -7,6 +7,7 @@ import type { ContactFormConfig, ContactPage } from '../modules/config';
|
|
|
7
7
|
export declare const getContactPages: (PageText?: typeof StaticPageText) => ContactPage[];
|
|
8
8
|
export declare function useVisiblePages(): ContactPage[];
|
|
9
9
|
export declare function getVisiblePages(pages: ContactFormConfig['pages'], pageText: typeof StaticPageText): ContactPage[];
|
|
10
|
+
export declare const stripTrailingSlashes: (pathname: string) => string;
|
|
10
11
|
export declare function findMatchedPage(pathname: string, basePath: string, visiblePages: ContactPage[]): ContactPage | undefined;
|
|
11
12
|
export declare function getPageTitleForPathname(pathname: string, config: ContactFormConfig): TranslatedString | undefined;
|
|
12
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-pages.d.ts","sourceRoot":"","sources":["../../src/layouts/contact-pages.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,IAAI,cAAc,EAC1B,gBAAgB,EAGjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUxE;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAU,OAAO,cAA+B,KAC/C,WAAW,EAyDb,CAAC;AAEF,wBAAgB,eAAe,IAAI,WAAW,EAAE,CAI/C;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,EACjC,QAAQ,EAAE,OAAO,cAAc,GAC9B,WAAW,EAAE,CAMf;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,WAAW,EAAE,GAC1B,WAAW,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"contact-pages.d.ts","sourceRoot":"","sources":["../../src/layouts/contact-pages.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,IAAI,cAAc,EAC1B,gBAAgB,EAGjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUxE;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAU,OAAO,cAA+B,KAC/C,WAAW,EAyDb,CAAC;AAEF,wBAAgB,eAAe,IAAI,WAAW,EAAE,CAI/C;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,EACjC,QAAQ,EAAE,OAAO,cAAc,GAC9B,WAAW,EAAE,CAMf;AAED,eAAO,MAAM,oBAAoB,GAAI,UAAU,MAAM,WACvB,CAAC;AAE/B,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,WAAW,EAAE,GAC1B,WAAW,GAAG,SAAS,CAGzB;AAED,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,iBAAiB,GACxB,gBAAgB,GAAG,SAAS,CAO9B;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,iBAAiB,GACxB,gBAAgB,GAAG,SAAS,CAG9B;AAID,eAAO,MAAM,sBAAsB,GAAI,cAAc,WAAW,YAG/D,CAAC"}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.displayPrivacyAndTerms = exports.getContactPages = void 0;
|
|
6
|
+
exports.displayPrivacyAndTerms = exports.stripTrailingSlashes = exports.getContactPages = void 0;
|
|
7
7
|
exports.useVisiblePages = useVisiblePages;
|
|
8
8
|
exports.getVisiblePages = getVisiblePages;
|
|
9
9
|
exports.findMatchedPage = findMatchedPage;
|
|
@@ -94,8 +94,11 @@ function getVisiblePages(pages, pageText) {
|
|
|
94
94
|
.map((id) => allPages.find((page) => page.id === id))
|
|
95
95
|
.filter((page) => page !== undefined);
|
|
96
96
|
}
|
|
97
|
+
const stripTrailingSlashes = (pathname) => pathname.replace(/\/+$/, '');
|
|
98
|
+
exports.stripTrailingSlashes = stripTrailingSlashes;
|
|
97
99
|
function findMatchedPage(pathname, basePath, visiblePages) {
|
|
98
|
-
|
|
100
|
+
const path = (0, exports.stripTrailingSlashes)(pathname);
|
|
101
|
+
return visiblePages.find((page) => path === `${basePath}/${page.slug}`);
|
|
99
102
|
}
|
|
100
103
|
function getPageTitleForPathname(pathname, config) {
|
|
101
104
|
const basePath = config.layout?.basePath ?? '/contact';
|
|
@@ -212,8 +212,8 @@ exports.Contact = {
|
|
|
212
212
|
ticketing: {
|
|
213
213
|
title: (0, commons_1.translation)('Billetter og app', 'Tickets and app', 'Billettar og app'),
|
|
214
214
|
additionalTicketingInfo: {
|
|
215
|
-
detail: (0, commons_1.translation)('For informasjon om betaling på
|
|
216
|
-
linkText: (0, commons_1.translation)('betaling for
|
|
215
|
+
detail: (0, commons_1.translation)('For informasjon om betaling på ferge, se', 'For information on payment on the ferry, see', 'For informasjon om betaling på ferje, sjå'),
|
|
216
|
+
linkText: (0, commons_1.translation)('betaling for ferge', 'payment on the ferry', 'betaling for ferje'),
|
|
217
217
|
href: (0, commons_1.translation)('', '', ''),
|
|
218
218
|
},
|
|
219
219
|
priceAndTicketTypes: {
|