@mrfylke/contact-form 0.1.23 → 0.1.24
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/external-link-page.d.ts +1 -1
- package/lib/components/external-link-page.js +1 -1
- package/lib/index.d.ts +5 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/layouts/contact-page-layout.d.ts +6 -21
- package/lib/layouts/contact-page-layout.d.ts.map +1 -1
- package/lib/layouts/contact-page-layout.js +91 -57
- package/lib/layouts/index.d.ts +1 -1
- package/lib/layouts/index.d.ts.map +1 -1
- package/lib/layouts/index.js +2 -2
- package/lib/lost-property-external/index.d.ts +2 -0
- package/lib/lost-property-external/index.d.ts.map +1 -0
- package/lib/lost-property-external/index.js +17 -0
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts +22 -22
- package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
- package/lib/modules/config/types.d.ts +72 -12
- package/lib/modules/config/types.d.ts.map +1 -1
- package/lib/modules/config/types.js +9 -0
- package/lib/refund/refundFormMachine.d.ts +14 -14
- package/lib/ticket-control/ticket-control-form-machine.d.ts +22 -22
- package/lib/ticketing/ticketingStateMachine.d.ts +8 -8
- package/lib/translations/pages/contact.d.ts +0 -16
- package/lib/translations/pages/contact.d.ts.map +1 -1
- package/lib/translations/pages/contact.js +0 -16
- package/lib/utils/typing.d.ts +32 -0
- package/lib/utils/typing.d.ts.map +1 -0
- package/lib/utils/typing.js +6 -0
- package/lib/utils.d.ts +0 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +1 -5
- package/package.json +6 -1
|
@@ -8,7 +8,7 @@ export type ExternalLinkPageProps = {
|
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* Component for rendering a page that links to an external website.
|
|
11
|
-
* Used when a contact page is configured with an externalUrl in
|
|
11
|
+
* Used when a contact page is configured with an externalUrl in pages.externalUrlByPageId.
|
|
12
12
|
*/
|
|
13
13
|
export declare function ExternalLinkPage({ url, title, description, }: ExternalLinkPageProps): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
//# sourceMappingURL=external-link-page.d.ts.map
|
|
@@ -12,7 +12,7 @@ const icon_1 = require("./icon");
|
|
|
12
12
|
const external_link_page_module_css_1 = __importDefault(require("./external-link-page.module.css"));
|
|
13
13
|
/**
|
|
14
14
|
* Component for rendering a page that links to an external website.
|
|
15
|
-
* Used when a contact page is configured with an externalUrl in
|
|
15
|
+
* Used when a contact page is configured with an externalUrl in pages.externalUrlByPageId.
|
|
16
16
|
*/
|
|
17
17
|
function ExternalLinkPage({ url, title, description, }) {
|
|
18
18
|
const { t } = (0, translations_1.useTranslation)();
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export { ContactFormConfigProvider, useContactFormConfig, useThemeConfig, useIconConfig, useOrgConfig, useApiConfig, } from './modules/config';
|
|
1
|
+
export { ContactFormConfigProvider, useContactFormConfig, useThemeConfig, useIconConfig, useOrgConfig, useApiConfig, buildEnabledPageIds, } from './modules/config';
|
|
2
2
|
export type { TicketControlSubmitPayload, RefundSubmitPayload, MeansOfTransportSubmitPayload, TicketingSubmitPayload, JourneyInfoSubmitPayload, LostPropertySubmitPayload, } from './types/submit-payloads';
|
|
3
3
|
export type { TransportModeType, ReasonForTransportFailure, TicketType, PurchasePlatformType, } from './types';
|
|
4
4
|
export { TicketTypeId } from './types';
|
|
5
|
-
export type { ContactFormConfig, IconComponent, IconName, IconSet, Theme, ThemeColors, ContrastColor, TransportColors, InteractiveColor, StatusColors, TypographyConfig, ApiConfig, OrgConfig, LayoutConfig, LayoutLinkLabel,
|
|
5
|
+
export type { ContactFormConfig, IconComponent, IconName, IconSet, Theme, ThemeColors, ContrastColor, TransportColors, InteractiveColor, StatusColors, TypographyConfig, ApiConfig, OrgConfig, LayoutConfig, LayoutLinkLabel, PagesConfig, FormSchemaOverrides, FormSchemaName, ContactPage, PageId, ExtraPageId, ExtraContactPage, EnabledPageIdsList, } from './modules/config';
|
|
6
6
|
export { ThemeProvider, useTheme, useHtmlDarkMode } from './modules/theme';
|
|
7
7
|
export { Icon } from './components/icon/icon-wrapper';
|
|
8
8
|
export { MonoIcon } from './components/icon/mono-icon-new';
|
|
9
|
+
export type { MonoIcons } from './components/icon';
|
|
9
10
|
export { ButtonLink, Button } from './components/button';
|
|
10
11
|
export type { ButtonLinkProps, ButtonProps } from './components/button';
|
|
11
12
|
export { Typo } from './components/typography';
|
|
@@ -16,10 +17,10 @@ export { FieldWrapperWithError, FileInput, Fieldset, Input, Radio, Select, Texta
|
|
|
16
17
|
export { Checkbox } from './components/checkbox';
|
|
17
18
|
export { type Line } from './server/journey-planner/validators';
|
|
18
19
|
export { useLines, useTransportModeOptions } from './lines/use-lines';
|
|
19
|
-
export {
|
|
20
|
+
export { scrollToFirstErrorMessage, findFirstErrorMessage, getLineName, findOrderFormFields, } from './utils';
|
|
20
21
|
export { commonInputValidator } from './validation';
|
|
21
22
|
export type { InputErrorMessages } from './validation';
|
|
22
|
-
export { ContactPageLayout,
|
|
23
|
+
export { ContactPageLayout, getContactPages, ContactFormContainer, type ContactFormContainerProps, } from './layouts';
|
|
23
24
|
export { ExternalLinkPage, type ExternalLinkPageProps, } from './components/external-link-page';
|
|
24
25
|
export { ErrorContent } from './error-content/error-content';
|
|
25
26
|
export { SuccessContent } from './success-content/success-content';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YA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OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.AppTicketRefundContent = exports.RefundFormEvents = exports.RefundTicketForm = exports.FormType = exports.RefundContent = exports.SuccessContent = exports.ErrorContent = exports.ExternalLinkPage = exports.ContactFormContainer = exports.
|
|
20
|
+
exports.AppTicketRefundContent = exports.RefundFormEvents = exports.RefundTicketForm = exports.FormType = exports.RefundContent = exports.SuccessContent = exports.ErrorContent = exports.ExternalLinkPage = exports.ContactFormContainer = exports.getContactPages = exports.ContactPageLayout = exports.commonInputValidator = exports.findOrderFormFields = exports.getLineName = exports.findFirstErrorMessage = exports.scrollToFirstErrorMessage = exports.useTransportModeOptions = exports.useLines = exports.Checkbox = exports.DepartureTimeField = exports.TimeSelector = exports.DateSelector = exports.getStopOptions = exports.getLineOptions = exports.SearchableSelect = exports.Textarea = exports.Select = exports.Radio = exports.Input = exports.Fieldset = exports.FileInput = exports.FieldWrapperWithError = exports.SectionCard = exports.ErrorMessage = exports.Typo = exports.Button = exports.ButtonLink = exports.MonoIcon = exports.Icon = exports.useHtmlDarkMode = exports.useTheme = exports.ThemeProvider = exports.TicketTypeId = exports.buildEnabledPageIds = exports.useApiConfig = exports.useOrgConfig = exports.useIconConfig = exports.useThemeConfig = exports.useContactFormConfig = exports.ContactFormConfigProvider = void 0;
|
|
21
21
|
exports.ContactFormRoot = exports.JourneyInfoContent = exports.TicketingContent = exports.TicketControlPageContent = exports.MeansOfTransportContent = void 0;
|
|
22
22
|
// Configuration system (NEW - required for setup)
|
|
23
23
|
var config_1 = require("./modules/config");
|
|
@@ -27,6 +27,7 @@ Object.defineProperty(exports, "useThemeConfig", { enumerable: true, get: functi
|
|
|
27
27
|
Object.defineProperty(exports, "useIconConfig", { enumerable: true, get: function () { return config_1.useIconConfig; } });
|
|
28
28
|
Object.defineProperty(exports, "useOrgConfig", { enumerable: true, get: function () { return config_1.useOrgConfig; } });
|
|
29
29
|
Object.defineProperty(exports, "useApiConfig", { enumerable: true, get: function () { return config_1.useApiConfig; } });
|
|
30
|
+
Object.defineProperty(exports, "buildEnabledPageIds", { enumerable: true, get: function () { return config_1.buildEnabledPageIds; } });
|
|
30
31
|
var types_1 = require("./types");
|
|
31
32
|
Object.defineProperty(exports, "TicketTypeId", { enumerable: true, get: function () { return types_1.TicketTypeId; } });
|
|
32
33
|
// Theme system (NEW)
|
|
@@ -72,7 +73,6 @@ var use_lines_1 = require("./lines/use-lines");
|
|
|
72
73
|
Object.defineProperty(exports, "useLines", { enumerable: true, get: function () { return use_lines_1.useLines; } });
|
|
73
74
|
Object.defineProperty(exports, "useTransportModeOptions", { enumerable: true, get: function () { return use_lines_1.useTransportModeOptions; } });
|
|
74
75
|
var utils_1 = require("./utils");
|
|
75
|
-
Object.defineProperty(exports, "shouldShowContactPage", { enumerable: true, get: function () { return utils_1.shouldShowContactPage; } });
|
|
76
76
|
Object.defineProperty(exports, "scrollToFirstErrorMessage", { enumerable: true, get: function () { return utils_1.scrollToFirstErrorMessage; } });
|
|
77
77
|
Object.defineProperty(exports, "findFirstErrorMessage", { enumerable: true, get: function () { return utils_1.findFirstErrorMessage; } });
|
|
78
78
|
Object.defineProperty(exports, "getLineName", { enumerable: true, get: function () { return utils_1.getLineName; } });
|
|
@@ -81,7 +81,7 @@ var validation_1 = require("./validation");
|
|
|
81
81
|
Object.defineProperty(exports, "commonInputValidator", { enumerable: true, get: function () { return validation_1.commonInputValidator; } });
|
|
82
82
|
var layouts_1 = require("./layouts");
|
|
83
83
|
Object.defineProperty(exports, "ContactPageLayout", { enumerable: true, get: function () { return layouts_1.ContactPageLayout; } });
|
|
84
|
-
Object.defineProperty(exports, "
|
|
84
|
+
Object.defineProperty(exports, "getContactPages", { enumerable: true, get: function () { return layouts_1.getContactPages; } });
|
|
85
85
|
Object.defineProperty(exports, "ContactFormContainer", { enumerable: true, get: function () { return layouts_1.ContactFormContainer; } });
|
|
86
86
|
var external_link_page_1 = require("./components/external-link-page");
|
|
87
87
|
Object.defineProperty(exports, "ExternalLinkPage", { enumerable: true, get: function () { return external_link_page_1.ExternalLinkPage; } });
|
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { MonoIcons } from '../components/icon';
|
|
4
|
-
export type ContactPage = {
|
|
5
|
-
title: TranslatedString;
|
|
6
|
-
href: string;
|
|
7
|
-
icon: MonoIcons;
|
|
8
|
-
};
|
|
1
|
+
import { PageText as StaticPageText } from '../translations';
|
|
2
|
+
import type { ContactPage } from '../modules/config';
|
|
9
3
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
4
|
+
* All contact pages (tabs) the package can render, each paired with the form
|
|
5
|
+
* component it renders. Hosts opt into the ones they want via `pages.enabledPageIds`.
|
|
12
6
|
*/
|
|
13
|
-
export declare const
|
|
14
|
-
export
|
|
15
|
-
export type ContactPageLayoutProps = PropsWithChildren<{
|
|
16
|
-
title: string;
|
|
17
|
-
backLink?: {
|
|
18
|
-
href: string;
|
|
19
|
-
label: TranslatedString | Record<string, string>;
|
|
20
|
-
};
|
|
21
|
-
}>;
|
|
22
|
-
declare function ContactPageLayout({ children, backLink }: ContactPageLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export default ContactPageLayout;
|
|
7
|
+
export declare const getContactPages: (PageText?: typeof StaticPageText) => ContactPage[];
|
|
8
|
+
export default function ContactPageLayout(): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element;
|
|
24
9
|
//# sourceMappingURL=contact-page-layout.d.ts.map
|
|
@@ -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":"AAGA,OAAO,EACL,QAAQ,IAAI,cAAc,EAI3B,MAAM,iBAAiB,CAAC;AASzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUrD;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAU,OAAO,cAA+B,KAC/C,WAAW,EAyDb,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,iBAAiB,yVA+ExC"}
|
|
@@ -3,9 +3,9 @@ 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.
|
|
6
|
+
exports.getContactPages = void 0;
|
|
7
|
+
exports.default = ContactPageLayout;
|
|
7
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
9
|
const layout_module_css_1 = __importDefault(require("./layout.module.css"));
|
|
10
10
|
const navigation_1 = require("next/navigation");
|
|
11
11
|
const link_1 = __importDefault(require("next/link"));
|
|
@@ -13,97 +13,131 @@ const translations_1 = require("../translations");
|
|
|
13
13
|
const icon_1 = require("../components/icon");
|
|
14
14
|
const button_1 = require("../components/button");
|
|
15
15
|
const typography_1 = require("../components/typography");
|
|
16
|
+
const external_link_page_1 = require("../components/external-link-page");
|
|
17
|
+
const error_content_1 = require("../error-content/error-content");
|
|
18
|
+
const success_content_1 = require("../success-content/success-content");
|
|
16
19
|
const css_1 = require("../utils/css");
|
|
17
20
|
const config_1 = require("../modules/config");
|
|
21
|
+
const ticket_control_1 = __importDefault(require("../ticket-control"));
|
|
22
|
+
const refund_1 = __importDefault(require("../refund"));
|
|
23
|
+
const means_of_transport_1 = __importDefault(require("../means-of-transport"));
|
|
24
|
+
const ticketing_1 = __importDefault(require("../ticketing"));
|
|
25
|
+
const lost_property_1 = __importDefault(require("../lost-property"));
|
|
26
|
+
const lost_property_external_1 = __importDefault(require("../lost-property-external"));
|
|
27
|
+
const group_travel_1 = __importDefault(require("../group-travel"));
|
|
28
|
+
const journey_info_1 = __importDefault(require("../journey-info"));
|
|
18
29
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
30
|
+
* All contact pages (tabs) the package can render, each paired with the form
|
|
31
|
+
* component it renders. Hosts opt into the ones they want via `pages.enabledPageIds`.
|
|
21
32
|
*/
|
|
22
|
-
const
|
|
33
|
+
const getContactPages = (PageText = translations_1.PageText) => [
|
|
23
34
|
{
|
|
35
|
+
id: 'ticket-control',
|
|
24
36
|
title: PageText.Contact.ticketControl.title,
|
|
25
|
-
|
|
37
|
+
slug: 'ticket-control',
|
|
26
38
|
icon: 'ticketing/TicketInvalid',
|
|
39
|
+
Component: ticket_control_1.default,
|
|
27
40
|
},
|
|
28
41
|
{
|
|
42
|
+
id: 'refund',
|
|
29
43
|
title: PageText.Contact.refund.title,
|
|
30
|
-
|
|
44
|
+
slug: 'refund',
|
|
31
45
|
icon: 'transportation-entur/Taxi',
|
|
46
|
+
Component: refund_1.default,
|
|
32
47
|
},
|
|
33
48
|
{
|
|
49
|
+
id: 'means-of-transport',
|
|
34
50
|
title: PageText.Contact.modeOfTransport.title,
|
|
35
|
-
|
|
51
|
+
slug: 'means-of-transport',
|
|
36
52
|
icon: 'transportation/BusFill',
|
|
53
|
+
Component: means_of_transport_1.default,
|
|
37
54
|
},
|
|
38
55
|
{
|
|
56
|
+
id: 'ticketing',
|
|
39
57
|
title: PageText.Contact.ticketing.title,
|
|
40
|
-
|
|
58
|
+
slug: 'ticketing',
|
|
41
59
|
icon: 'devices/Phone',
|
|
60
|
+
Component: ticketing_1.default,
|
|
42
61
|
},
|
|
43
62
|
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
id: 'lost-property',
|
|
64
|
+
title: PageText.Contact.lostProperty.title,
|
|
65
|
+
slug: 'lost-property',
|
|
66
|
+
icon: 'actions/Support',
|
|
67
|
+
Component: lost_property_1.default,
|
|
47
68
|
},
|
|
48
69
|
{
|
|
70
|
+
id: 'lost-property-external',
|
|
49
71
|
title: PageText.Contact.lostProperty.title,
|
|
50
|
-
|
|
72
|
+
slug: 'lost-property',
|
|
51
73
|
icon: 'actions/Support',
|
|
74
|
+
Component: lost_property_external_1.default,
|
|
52
75
|
},
|
|
53
76
|
{
|
|
77
|
+
id: 'group-travel',
|
|
54
78
|
title: PageText.Contact.groupTravel.title,
|
|
55
|
-
|
|
79
|
+
slug: 'group-travel',
|
|
56
80
|
icon: 'ticketing/TicketMultiple',
|
|
81
|
+
Component: group_travel_1.default,
|
|
57
82
|
},
|
|
58
83
|
{
|
|
84
|
+
id: 'journey-info',
|
|
59
85
|
title: PageText.Contact.journeyInfo.title,
|
|
60
|
-
|
|
86
|
+
slug: 'journey-info',
|
|
61
87
|
icon: 'actions/Feedback',
|
|
88
|
+
Component: journey_info_1.default,
|
|
62
89
|
},
|
|
63
90
|
];
|
|
64
|
-
exports.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const pagesWithoutPrivacyAndTerms = ['/contact/group-travel'];
|
|
68
|
-
/**
|
|
69
|
-
* Extract page ID from href (e.g., '/contact/lost-property' -> 'lost-property')
|
|
70
|
-
*/
|
|
71
|
-
function getPageIdFromHref(href) {
|
|
72
|
-
const parts = href.split('/');
|
|
73
|
-
return parts[parts.length - 1] || '';
|
|
74
|
-
}
|
|
75
|
-
function ContactPageLayout({ children, backLink }) {
|
|
76
|
-
const PageText = (0, translations_1.usePageText)();
|
|
91
|
+
exports.getContactPages = getContactPages;
|
|
92
|
+
function ContactPageLayout() {
|
|
93
|
+
const pageText = (0, translations_1.usePageText)();
|
|
77
94
|
const { t } = (0, translations_1.useTranslation)();
|
|
78
95
|
const pathname = (0, navigation_1.usePathname)();
|
|
79
|
-
const {
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
const { pages, layout } = (0, config_1.useContactFormConfig)();
|
|
97
|
+
const visiblePages = useVisiblePages();
|
|
98
|
+
const basePath = layout?.basePath ?? '/contact';
|
|
99
|
+
const successPath = layout?.successPath ?? `${basePath}/success`;
|
|
100
|
+
const errorPath = layout?.errorPath ?? `${basePath}/error`;
|
|
101
|
+
if (pathname === successPath) {
|
|
102
|
+
return layout?.successContent ?? (0, jsx_runtime_1.jsx)(success_content_1.SuccessContent, {});
|
|
103
|
+
}
|
|
104
|
+
if (pathname === errorPath) {
|
|
105
|
+
return layout?.errorContent ?? (0, jsx_runtime_1.jsx)(error_content_1.ErrorContent, {});
|
|
106
|
+
}
|
|
107
|
+
const matchedPage = visiblePages.find((page) => pathname.includes(`${basePath}/${page.slug}`));
|
|
108
|
+
const externalUrl = matchedPage
|
|
109
|
+
? pages.externalUrlByPageId?.[matchedPage.id]
|
|
110
|
+
: undefined;
|
|
111
|
+
const MatchedComponent = matchedPage?.Component;
|
|
112
|
+
const body = externalUrl ? ((0, jsx_runtime_1.jsx)(external_link_page_1.ExternalLinkPage, { url: externalUrl })) : MatchedComponent ? ((0, jsx_runtime_1.jsx)(MatchedComponent, {})) : null;
|
|
113
|
+
const backLink = layout?.backLinkDefault ?? {
|
|
114
|
+
href: '/',
|
|
115
|
+
label: pageText.Contact.contactPageLayout.homeLink,
|
|
94
116
|
};
|
|
95
|
-
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(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
117
|
+
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: pathname.includes(`${basePath}/${contactPage.slug}`), externalUrl: pages.externalUrlByPageId?.[contactPage.id] }, contactPage.id))) })] })] }), body, displayPrivacyAndTerms(matchedPage) && ((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) }) }))] }));
|
|
118
|
+
}
|
|
119
|
+
const pagesWithoutPrivacyAndTerms = ['group-travel'];
|
|
120
|
+
const displayPrivacyAndTerms = (contactPage) => {
|
|
121
|
+
if (!contactPage)
|
|
122
|
+
return false;
|
|
123
|
+
return !pagesWithoutPrivacyAndTerms.includes(contactPage.slug);
|
|
124
|
+
};
|
|
125
|
+
function useVisiblePages() {
|
|
126
|
+
const pageText = (0, translations_1.usePageText)();
|
|
127
|
+
const { pages } = (0, config_1.useContactFormConfig)();
|
|
128
|
+
const allPages = [...(0, exports.getContactPages)(pageText), ...(pages.extraPages ?? [])];
|
|
129
|
+
return pages.enabledPageIds
|
|
130
|
+
.map((id) => allPages.find((page) => page.id === id))
|
|
131
|
+
.filter((page) => page !== undefined);
|
|
132
|
+
}
|
|
133
|
+
function ContactPageNavLink({ icon, title, href, isActive, externalUrl, }) {
|
|
134
|
+
const { t } = (0, translations_1.useTranslation)();
|
|
135
|
+
const linkClassName = (0, css_1.andIf)({
|
|
136
|
+
[layout_module_css_1.default.contact_page_navigator__link]: true,
|
|
137
|
+
[layout_module_css_1.default.contact_page_navigator__activePage]: isActive,
|
|
138
|
+
});
|
|
139
|
+
if (externalUrl) {
|
|
140
|
+
return ((0, jsx_runtime_1.jsxs)("a", { href: externalUrl, target: "_blank", rel: "noreferrer", className: linkClassName, children: [(0, jsx_runtime_1.jsx)(icon_1.MonoIcon, { size: "large", icon: icon }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(title) })] }));
|
|
141
|
+
}
|
|
142
|
+
return ((0, jsx_runtime_1.jsxs)(link_1.default, { shallow: true, href: href, className: linkClassName, children: [(0, jsx_runtime_1.jsx)(icon_1.MonoIcon, { size: "large", icon: icon }), (0, jsx_runtime_1.jsx)(typography_1.Typo.p, { textType: "body__m", children: t(title) })] }));
|
|
108
143
|
}
|
|
109
|
-
exports.default = ContactPageLayout;
|
package/lib/layouts/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as ContactPageLayout,
|
|
1
|
+
export { default as ContactPageLayout, getContactPages, } from './contact-page-layout';
|
|
2
2
|
export { ContactFormContainer, type ContactFormContainerProps, } from './contact-form-container';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,iBAAiB,EAC5B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,iBAAiB,EAC5B,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,0BAA0B,CAAC"}
|
package/lib/layouts/index.js
CHANGED
|
@@ -3,9 +3,9 @@ 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.ContactFormContainer = exports.
|
|
6
|
+
exports.ContactFormContainer = exports.getContactPages = exports.ContactPageLayout = void 0;
|
|
7
7
|
var contact_page_layout_1 = require("./contact-page-layout");
|
|
8
8
|
Object.defineProperty(exports, "ContactPageLayout", { enumerable: true, get: function () { return __importDefault(contact_page_layout_1).default; } });
|
|
9
|
-
Object.defineProperty(exports, "
|
|
9
|
+
Object.defineProperty(exports, "getContactPages", { enumerable: true, get: function () { return contact_page_layout_1.getContactPages; } });
|
|
10
10
|
var contact_form_container_1 = require("./contact-form-container");
|
|
11
11
|
Object.defineProperty(exports, "ContactFormContainer", { enumerable: true, get: function () { return contact_form_container_1.ContactFormContainer; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lost-property-external/index.tsx"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,+BAA+B,4CAmBtD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = LostPropertyExternalFormContent;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const contact_module_css_1 = __importDefault(require("../contact.module.css"));
|
|
9
|
+
const components_1 = require("../components");
|
|
10
|
+
const link_1 = __importDefault(require("next/link"));
|
|
11
|
+
const translations_1 = require("../translations");
|
|
12
|
+
const typography_1 = require("../components/typography");
|
|
13
|
+
function LostPropertyExternalFormContent() {
|
|
14
|
+
const PageText = (0, translations_1.usePageText)();
|
|
15
|
+
const { t } = (0, translations_1.useTranslation)();
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(components_1.SectionCard, { title: t(PageText.Contact.lostProperty.title), children: (0, jsx_runtime_1.jsxs)(typography_1.Typo.p, { textType: "body__m", children: [t(PageText.Contact.lostProperty.description.info), ' ', (0, jsx_runtime_1.jsx)(link_1.default, { className: contact_module_css_1.default.link, href: t(PageText.Contact.lostProperty.description.url), target: "_blank", rel: "noopener noreferrer", children: t(PageText.Contact.lostProperty.description.externalLink) })] }) }));
|
|
17
|
+
}
|
|
@@ -52,16 +52,6 @@ export type MachinePaths = {
|
|
|
52
52
|
errorPath: string;
|
|
53
53
|
};
|
|
54
54
|
export declare function createMeansOfTransportFormMachine(onSubmit: (schemaName: FormSchemaName, state: Record<string, unknown>) => Promise<Response>, paths?: MachinePaths): import("xstate").StateMachine<MeansOfTransportContextProps, {
|
|
55
|
-
type: "ON_INPUT_CHANGE";
|
|
56
|
-
inputName: "formType" | "isResponseWanted" | "stop";
|
|
57
|
-
value: string | boolean | Line["quays"][0] | undefined;
|
|
58
|
-
} | {
|
|
59
|
-
type: "SELECT_FORM_TYPE";
|
|
60
|
-
formType: FormType;
|
|
61
|
-
} | {
|
|
62
|
-
type: "SUBMIT";
|
|
63
|
-
orderedFormFieldNames: string[];
|
|
64
|
-
} | {
|
|
65
55
|
type: "VALIDATE";
|
|
66
56
|
} | {
|
|
67
57
|
type: "ON_INPUT_CHANGE";
|
|
@@ -73,6 +63,16 @@ export declare function createMeansOfTransportFormMachine(onSubmit: (schemaName:
|
|
|
73
63
|
} | {
|
|
74
64
|
type: "ON_LINE_CHANGE";
|
|
75
65
|
value: Line | undefined;
|
|
66
|
+
} | {
|
|
67
|
+
type: "ON_INPUT_CHANGE";
|
|
68
|
+
inputName: "formType" | "isResponseWanted" | "stop";
|
|
69
|
+
value: string | boolean | Line["quays"][0] | undefined;
|
|
70
|
+
} | {
|
|
71
|
+
type: "SELECT_FORM_TYPE";
|
|
72
|
+
formType: FormType;
|
|
73
|
+
} | {
|
|
74
|
+
type: "SUBMIT";
|
|
75
|
+
orderedFormFieldNames: string[];
|
|
76
76
|
}, {
|
|
77
77
|
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>> | undefined;
|
|
78
78
|
}, {
|
|
@@ -130,7 +130,7 @@ export declare function createMeansOfTransportFormMachine(onSubmit: (schemaName:
|
|
|
130
130
|
} | {
|
|
131
131
|
type: "isInjuryForm";
|
|
132
132
|
params: unknown;
|
|
133
|
-
}, never, "success" | "
|
|
133
|
+
}, never, "success" | "formTypeHandler" | "validating" | "submitting" | {
|
|
134
134
|
editing: "driver" | "transportation" | "delay" | "stop" | "serviceOffering" | "injury" | "selectFormType";
|
|
135
135
|
}, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
136
136
|
states: {
|
|
@@ -171,16 +171,6 @@ export declare function createMeansOfTransportFormMachine(onSubmit: (schemaName:
|
|
|
171
171
|
};
|
|
172
172
|
}>;
|
|
173
173
|
export declare const meansOfTransportFormMachine: import("xstate").StateMachine<MeansOfTransportContextProps, {
|
|
174
|
-
type: "ON_INPUT_CHANGE";
|
|
175
|
-
inputName: "formType" | "isResponseWanted" | "stop";
|
|
176
|
-
value: string | boolean | Line["quays"][0] | undefined;
|
|
177
|
-
} | {
|
|
178
|
-
type: "SELECT_FORM_TYPE";
|
|
179
|
-
formType: FormType;
|
|
180
|
-
} | {
|
|
181
|
-
type: "SUBMIT";
|
|
182
|
-
orderedFormFieldNames: string[];
|
|
183
|
-
} | {
|
|
184
174
|
type: "VALIDATE";
|
|
185
175
|
} | {
|
|
186
176
|
type: "ON_INPUT_CHANGE";
|
|
@@ -192,6 +182,16 @@ export declare const meansOfTransportFormMachine: import("xstate").StateMachine<
|
|
|
192
182
|
} | {
|
|
193
183
|
type: "ON_LINE_CHANGE";
|
|
194
184
|
value: Line | undefined;
|
|
185
|
+
} | {
|
|
186
|
+
type: "ON_INPUT_CHANGE";
|
|
187
|
+
inputName: "formType" | "isResponseWanted" | "stop";
|
|
188
|
+
value: string | boolean | Line["quays"][0] | undefined;
|
|
189
|
+
} | {
|
|
190
|
+
type: "SELECT_FORM_TYPE";
|
|
191
|
+
formType: FormType;
|
|
192
|
+
} | {
|
|
193
|
+
type: "SUBMIT";
|
|
194
|
+
orderedFormFieldNames: string[];
|
|
195
195
|
}, {
|
|
196
196
|
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>> | undefined;
|
|
197
197
|
}, {
|
|
@@ -249,7 +249,7 @@ export declare const meansOfTransportFormMachine: import("xstate").StateMachine<
|
|
|
249
249
|
} | {
|
|
250
250
|
type: "isInjuryForm";
|
|
251
251
|
params: unknown;
|
|
252
|
-
}, never, "success" | "
|
|
252
|
+
}, never, "success" | "formTypeHandler" | "validating" | "submitting" | {
|
|
253
253
|
editing: "driver" | "transportation" | "delay" | "stop" | "serviceOffering" | "injury" | "selectFormType";
|
|
254
254
|
}, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
255
255
|
states: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"means-of-transport-form-machine.d.ts","sourceRoot":"","sources":["../../src/means-of-transport/means-of-transport-form-machine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAUzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,oBAAY,QAAQ;IAClB,MAAM,WAAW;IACjB,cAAc,mBAAmB;IACjC,KAAK,UAAU;IACf,IAAI,SAAS;IACb,eAAe,oBAAoB;IACnC,MAAM,WAAW;CAClB;AAED,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC;IACrB,SAA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CAAC,EACtB,KAAK,CAAC,EAAE,YAAY
|
|
1
|
+
{"version":3,"file":"means-of-transport-form-machine.d.ts","sourceRoot":"","sources":["../../src/means-of-transport/means-of-transport-form-machine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAAwB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAUzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,oBAAY,QAAQ;IAClB,MAAM,WAAW;IACjB,cAAc,mBAAmB;IACjC,KAAK,UAAU;IACf,IAAI,SAAS;IACb,eAAe,oBAAoB;IACnC,MAAM,WAAW;CAClB;AAED,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4Yd,CAAC"}
|
|
@@ -2,10 +2,38 @@
|
|
|
2
2
|
* Configuration types for the contact-form package.
|
|
3
3
|
* These types define the contract between the package and consuming applications.
|
|
4
4
|
*/
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { ComponentType } from 'react';
|
|
6
6
|
import type { Line } from '../../server/journey-planner/validators';
|
|
7
|
-
import type { ContactFormTranslationsOverride } from '../../translations
|
|
7
|
+
import type { ContactFormTranslationsOverride, TranslatedString } from '../../translations';
|
|
8
8
|
import type { TransportModeType } from '../../types';
|
|
9
|
+
import type { MonoIcons } from '../../components/icon';
|
|
10
|
+
import type { AssertExtends, CheckNoConflicts } from '../../utils/typing';
|
|
11
|
+
export type ContactPage = {
|
|
12
|
+
/** Stable page identifier used for `pages.enabledPageIds` / `externalUrlByPageId`. */
|
|
13
|
+
id: PageId;
|
|
14
|
+
title: TranslatedString;
|
|
15
|
+
/** URL segment under the host's basePath, e.g. 'refund' -> `${basePath}/refund`. */
|
|
16
|
+
slug: string;
|
|
17
|
+
icon: MonoIcons;
|
|
18
|
+
/** Body component rendered for this page. */
|
|
19
|
+
Component: ComponentType;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Page id. Hardcoded to match the registry in `getContactPages()` — update
|
|
23
|
+
* both together when adding or removing a page. Host-provided `extraPages`
|
|
24
|
+
* ids must start with `extra-` (e.g. 'extra-skoleskyss').
|
|
25
|
+
*
|
|
26
|
+
* Two ids exist for lost property ('lost-property' and 'lost-property-external'),
|
|
27
|
+
* sharing the same slug/slot. `PagesConfig['enabledPageIds']` only allows one
|
|
28
|
+
* of the two at a time.
|
|
29
|
+
*/
|
|
30
|
+
export type PageId = 'ticket-control' | 'refund' | 'means-of-transport' | 'ticketing' | 'lost-property' | 'lost-property-external' | 'group-travel' | 'journey-info' | ExtraPageId;
|
|
31
|
+
/** Id shape required for host-provided `extraPages` entries. */
|
|
32
|
+
export type ExtraPageId = `extra-${string}`;
|
|
33
|
+
/** A host-provided page for `pages.extraPages` — id must start with `extra-`. */
|
|
34
|
+
export type ExtraContactPage = Omit<ContactPage, 'id'> & {
|
|
35
|
+
id: ExtraPageId;
|
|
36
|
+
};
|
|
9
37
|
/**
|
|
10
38
|
* Icon component type - consumers provide components that render icons
|
|
11
39
|
*/
|
|
@@ -230,21 +258,52 @@ export type LayoutConfig = {
|
|
|
230
258
|
*/
|
|
231
259
|
errorContent?: React.ReactNode;
|
|
232
260
|
};
|
|
261
|
+
declare const enabledPageIdsBrand: unique symbol;
|
|
262
|
+
/**
|
|
263
|
+
* The value `pages.enabledPageIds` must hold. Only `enabledPageIds(...)`
|
|
264
|
+
* (below) can produce this type — a plain array literal can't, so the
|
|
265
|
+
* mutually-exclusive-id check that function runs can't be bypassed.
|
|
266
|
+
*/
|
|
267
|
+
export type EnabledPageIdsList = readonly PageId[] & {
|
|
268
|
+
readonly [enabledPageIdsBrand]: true;
|
|
269
|
+
};
|
|
233
270
|
/**
|
|
234
|
-
*
|
|
235
|
-
*
|
|
271
|
+
* Ids that share a slug/slot — at most one per group may be enabled. A
|
|
272
|
+
* group may list any number of ids (2 or more). Constrained to `PageId`
|
|
273
|
+
* right here, so a typo is caught at this declaration regardless of how
|
|
274
|
+
* (or whether) it's later used.
|
|
236
275
|
*/
|
|
237
|
-
|
|
276
|
+
type ExclusivePageIdGroups = AssertExtends<[
|
|
277
|
+
['lost-property', 'lost-property-external']
|
|
278
|
+
], PageId[][]>;
|
|
279
|
+
/**
|
|
280
|
+
* Build `pages.enabledPageIds`. Required — `PagesConfig` only accepts the
|
|
281
|
+
* value this returns, so TypeScript always runs the mutually-exclusive-id
|
|
282
|
+
* check against `ExclusivePageIdGroups` above.
|
|
283
|
+
*/
|
|
284
|
+
export declare function buildEnabledPageIds<const T extends PageId[]>(ids: CheckNoConflicts<T, ExclusivePageIdGroups>): EnabledPageIdsList;
|
|
285
|
+
/**
|
|
286
|
+
* Configuration for contact pages (tabs).
|
|
287
|
+
* Pages are defined in the package; hosts opt in to the ones they want shown.
|
|
288
|
+
*/
|
|
289
|
+
export type PagesConfig = {
|
|
238
290
|
/**
|
|
239
|
-
* Page IDs to
|
|
240
|
-
*
|
|
291
|
+
* Page IDs to show in the tab navigation. Page IDs match the href slugs
|
|
292
|
+
* (e.g. 'lost-property', 'refund'). Required — an empty array shows no forms.
|
|
293
|
+
* Build with `enabledPageIds(...)`.
|
|
241
294
|
*/
|
|
242
|
-
|
|
295
|
+
enabledPageIds: EnabledPageIdsList;
|
|
243
296
|
/**
|
|
244
297
|
* Map of page IDs to external URLs.
|
|
245
298
|
* When a page ID has an external URL, it should render an external link experience instead of the form.
|
|
246
299
|
*/
|
|
247
|
-
externalUrlByPageId?: Record<
|
|
300
|
+
externalUrlByPageId?: Partial<Record<PageId, string>>;
|
|
301
|
+
/**
|
|
302
|
+
* Host-provided pages the package doesn't know about (e.g. an org-specific
|
|
303
|
+
* form). Its `id` must start with `extra-` (e.g. 'extra-skoleskyss') and be
|
|
304
|
+
* listed in `enabledPageIds` to show.
|
|
305
|
+
*/
|
|
306
|
+
extraPages?: ExtraContactPage[];
|
|
248
307
|
};
|
|
249
308
|
/**
|
|
250
309
|
* Host-provided line filters applied by useLines after standard package filters.
|
|
@@ -351,10 +410,10 @@ export type ContactFormConfig = {
|
|
|
351
410
|
*/
|
|
352
411
|
translations: ContactFormTranslationsOverride;
|
|
353
412
|
/**
|
|
354
|
-
*
|
|
355
|
-
*
|
|
413
|
+
* Which contact pages (tabs) are shown and whether they link externally.
|
|
414
|
+
* Host app must provide `enabledPageIds` - no page is shown by default.
|
|
356
415
|
*/
|
|
357
|
-
|
|
416
|
+
pages: PagesConfig;
|
|
358
417
|
/**
|
|
359
418
|
* Override which form options are available in each XState-driven form flow.
|
|
360
419
|
* Can be loaded from a JSON/YAML/TAML file by the host and passed here.
|
|
@@ -369,4 +428,5 @@ export type ContactFormConfig = {
|
|
|
369
428
|
export type DeepPartial<T> = {
|
|
370
429
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
371
430
|
};
|
|
431
|
+
export {};
|
|
372
432
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/config/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/modules/config/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EACV,+BAA+B,EAC/B,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,MAAM,MAAM,WAAW,GAAG;IACxB,sFAAsF;IACtF,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,gBAAgB,CAAC;IACxB,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,6CAA6C;IAC7C,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,MAAM,GACd,gBAAgB,GAChB,QAAQ,GACR,oBAAoB,GACpB,WAAW,GACX,eAAe,GACf,wBAAwB,GACxB,cAAc,GACd,cAAc,GACd,WAAW,CAAC;AAEhB,gEAAgE;AAChE,MAAM,MAAM,WAAW,GAAG,SAAS,MAA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B,CAAC;CAC3C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC"}
|
|
@@ -4,3 +4,12 @@
|
|
|
4
4
|
* These types define the contract between the package and consuming applications.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.buildEnabledPageIds = buildEnabledPageIds;
|
|
8
|
+
/**
|
|
9
|
+
* Build `pages.enabledPageIds`. Required — `PagesConfig` only accepts the
|
|
10
|
+
* value this returns, so TypeScript always runs the mutually-exclusive-id
|
|
11
|
+
* check against `ExclusivePageIdGroups` above.
|
|
12
|
+
*/
|
|
13
|
+
function buildEnabledPageIds(ids) {
|
|
14
|
+
return ids;
|
|
15
|
+
}
|
|
@@ -146,12 +146,6 @@ export declare function createRefundStateMachine(onSubmit: (schemaName: FormSche
|
|
|
146
146
|
} | {
|
|
147
147
|
type: "navigateToSuccessPage";
|
|
148
148
|
params: unknown;
|
|
149
|
-
} | {
|
|
150
|
-
type: "setFormTypeToUndefined";
|
|
151
|
-
params: unknown;
|
|
152
|
-
} | {
|
|
153
|
-
type: "setInitialAgreementAndFormType";
|
|
154
|
-
params: unknown;
|
|
155
149
|
} | {
|
|
156
150
|
type: "clearValidationErrors";
|
|
157
151
|
params: unknown;
|
|
@@ -173,6 +167,12 @@ export declare function createRefundStateMachine(onSubmit: (schemaName: FormSche
|
|
|
173
167
|
} | {
|
|
174
168
|
type: "onLineChange";
|
|
175
169
|
params: unknown;
|
|
170
|
+
} | {
|
|
171
|
+
type: "setFormTypeToUndefined";
|
|
172
|
+
params: unknown;
|
|
173
|
+
} | {
|
|
174
|
+
type: "setInitialAgreementAndFormType";
|
|
175
|
+
params: unknown;
|
|
176
176
|
} | {
|
|
177
177
|
type: "onPurchasePlatformChange";
|
|
178
178
|
params: unknown;
|
|
@@ -203,7 +203,7 @@ export declare function createRefundStateMachine(onSubmit: (schemaName: FormSche
|
|
|
203
203
|
} | {
|
|
204
204
|
type: "isRefundTaxi";
|
|
205
205
|
params: unknown;
|
|
206
|
-
}, never, "success" | "
|
|
206
|
+
}, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "refundTicketFormHandler" | "refundAndTravelGuaranteeFormHandler" | {
|
|
207
207
|
editing: "ticketBoughtOnBus" | "residualValueOnTravelCard" | "selectFormCategory" | {
|
|
208
208
|
refundOfTicket: "appTicketRefund" | "otherTicketRefund" | "selectRefundOfTicketForm";
|
|
209
209
|
} | {
|
|
@@ -306,12 +306,6 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
|
|
|
306
306
|
} | {
|
|
307
307
|
type: "navigateToSuccessPage";
|
|
308
308
|
params: unknown;
|
|
309
|
-
} | {
|
|
310
|
-
type: "setFormTypeToUndefined";
|
|
311
|
-
params: unknown;
|
|
312
|
-
} | {
|
|
313
|
-
type: "setInitialAgreementAndFormType";
|
|
314
|
-
params: unknown;
|
|
315
309
|
} | {
|
|
316
310
|
type: "clearValidationErrors";
|
|
317
311
|
params: unknown;
|
|
@@ -333,6 +327,12 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
|
|
|
333
327
|
} | {
|
|
334
328
|
type: "onLineChange";
|
|
335
329
|
params: unknown;
|
|
330
|
+
} | {
|
|
331
|
+
type: "setFormTypeToUndefined";
|
|
332
|
+
params: unknown;
|
|
333
|
+
} | {
|
|
334
|
+
type: "setInitialAgreementAndFormType";
|
|
335
|
+
params: unknown;
|
|
336
336
|
} | {
|
|
337
337
|
type: "onPurchasePlatformChange";
|
|
338
338
|
params: unknown;
|
|
@@ -363,7 +363,7 @@ export declare const refundStateMachine: import("xstate").StateMachine<RefundCon
|
|
|
363
363
|
} | {
|
|
364
364
|
type: "isRefundTaxi";
|
|
365
365
|
params: unknown;
|
|
366
|
-
}, never, "success" | "
|
|
366
|
+
}, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "refundTicketFormHandler" | "refundAndTravelGuaranteeFormHandler" | {
|
|
367
367
|
editing: "ticketBoughtOnBus" | "residualValueOnTravelCard" | "selectFormCategory" | {
|
|
368
368
|
refundOfTicket: "appTicketRefund" | "otherTicketRefund" | "selectRefundOfTicketForm";
|
|
369
369
|
} | {
|
|
@@ -78,6 +78,16 @@ export type MachineOptions = MachinePaths & {
|
|
|
78
78
|
includeCustomerNumber?: boolean;
|
|
79
79
|
};
|
|
80
80
|
export declare function createTicketControlFormMachine(onSubmit: (schemaName: FormSchemaName, state: Record<string, unknown>) => Promise<Response>, paths?: Partial<MachineOptions>): import("xstate").StateMachine<TicketControlContextProps, {
|
|
81
|
+
type: "ON_INPUT_CHANGE";
|
|
82
|
+
inputName: "formType" | "feeNumber" | "invoiceNumber" | "appPhoneNumber" | "customerNumber" | "travelCardNumber" | "isAppTicketStorageMode" | "agreesFirstAgreement" | "agreesSecondAgreement" | "hasInternationalBankAccount" | "dateOfTicketControl" | "timeOfTicketControl";
|
|
83
|
+
value: string | boolean | undefined;
|
|
84
|
+
} | {
|
|
85
|
+
type: "SELECT_FORM_TYPE";
|
|
86
|
+
formType: FormType;
|
|
87
|
+
} | {
|
|
88
|
+
type: "SUBMIT";
|
|
89
|
+
orderedFormFieldNames: string[];
|
|
90
|
+
} | {
|
|
81
91
|
type: "VALIDATE";
|
|
82
92
|
} | {
|
|
83
93
|
type: "ON_INPUT_CHANGE";
|
|
@@ -89,16 +99,6 @@ export declare function createTicketControlFormMachine(onSubmit: (schemaName: Fo
|
|
|
89
99
|
} | {
|
|
90
100
|
type: "ON_LINE_CHANGE";
|
|
91
101
|
value: Line | undefined;
|
|
92
|
-
} | {
|
|
93
|
-
type: "ON_INPUT_CHANGE";
|
|
94
|
-
inputName: "formType" | "feeNumber" | "invoiceNumber" | "appPhoneNumber" | "customerNumber" | "travelCardNumber" | "isAppTicketStorageMode" | "agreesFirstAgreement" | "agreesSecondAgreement" | "hasInternationalBankAccount" | "dateOfTicketControl" | "timeOfTicketControl";
|
|
95
|
-
value: string | boolean | undefined;
|
|
96
|
-
} | {
|
|
97
|
-
type: "SELECT_FORM_TYPE";
|
|
98
|
-
formType: FormType;
|
|
99
|
-
} | {
|
|
100
|
-
type: "SUBMIT";
|
|
101
|
-
orderedFormFieldNames: string[];
|
|
102
102
|
}, {
|
|
103
103
|
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>> | undefined;
|
|
104
104
|
}, {
|
|
@@ -147,7 +147,7 @@ export declare function createTicketControlFormMachine(onSubmit: (schemaName: Fo
|
|
|
147
147
|
} | {
|
|
148
148
|
type: "isPostponePaymentForm";
|
|
149
149
|
params: unknown;
|
|
150
|
-
}, never, "success" | "
|
|
150
|
+
}, never, "success" | "formHandler" | "validating" | "submitting" | {
|
|
151
151
|
editing: "feeComplaint" | "postponePayment" | "feedback" | "selectFormType";
|
|
152
152
|
}, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
153
153
|
id: "ticketControlForm";
|
|
@@ -180,6 +180,16 @@ export declare function createTicketControlFormMachine(onSubmit: (schemaName: Fo
|
|
|
180
180
|
};
|
|
181
181
|
}>;
|
|
182
182
|
export declare const ticketControlFormMachine: import("xstate").StateMachine<TicketControlContextProps, {
|
|
183
|
+
type: "ON_INPUT_CHANGE";
|
|
184
|
+
inputName: "formType" | "feeNumber" | "invoiceNumber" | "appPhoneNumber" | "customerNumber" | "travelCardNumber" | "isAppTicketStorageMode" | "agreesFirstAgreement" | "agreesSecondAgreement" | "hasInternationalBankAccount" | "dateOfTicketControl" | "timeOfTicketControl";
|
|
185
|
+
value: string | boolean | undefined;
|
|
186
|
+
} | {
|
|
187
|
+
type: "SELECT_FORM_TYPE";
|
|
188
|
+
formType: FormType;
|
|
189
|
+
} | {
|
|
190
|
+
type: "SUBMIT";
|
|
191
|
+
orderedFormFieldNames: string[];
|
|
192
|
+
} | {
|
|
183
193
|
type: "VALIDATE";
|
|
184
194
|
} | {
|
|
185
195
|
type: "ON_INPUT_CHANGE";
|
|
@@ -191,16 +201,6 @@ export declare const ticketControlFormMachine: import("xstate").StateMachine<Tic
|
|
|
191
201
|
} | {
|
|
192
202
|
type: "ON_LINE_CHANGE";
|
|
193
203
|
value: Line | undefined;
|
|
194
|
-
} | {
|
|
195
|
-
type: "ON_INPUT_CHANGE";
|
|
196
|
-
inputName: "formType" | "feeNumber" | "invoiceNumber" | "appPhoneNumber" | "customerNumber" | "travelCardNumber" | "isAppTicketStorageMode" | "agreesFirstAgreement" | "agreesSecondAgreement" | "hasInternationalBankAccount" | "dateOfTicketControl" | "timeOfTicketControl";
|
|
197
|
-
value: string | boolean | undefined;
|
|
198
|
-
} | {
|
|
199
|
-
type: "SELECT_FORM_TYPE";
|
|
200
|
-
formType: FormType;
|
|
201
|
-
} | {
|
|
202
|
-
type: "SUBMIT";
|
|
203
|
-
orderedFormFieldNames: string[];
|
|
204
204
|
}, {
|
|
205
205
|
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<true, SubmitInput, import("xstate").EventObject>> | undefined;
|
|
206
206
|
}, {
|
|
@@ -249,7 +249,7 @@ export declare const ticketControlFormMachine: import("xstate").StateMachine<Tic
|
|
|
249
249
|
} | {
|
|
250
250
|
type: "isPostponePaymentForm";
|
|
251
251
|
params: unknown;
|
|
252
|
-
}, never, "success" | "
|
|
252
|
+
}, never, "success" | "formHandler" | "validating" | "submitting" | {
|
|
253
253
|
editing: "feeComplaint" | "postponePayment" | "feedback" | "selectFormType";
|
|
254
254
|
}, string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
255
255
|
id: "ticketControlForm";
|
|
@@ -117,9 +117,6 @@ export declare function createTicketingStateMachine(onSubmit: (schemaName: FormS
|
|
|
117
117
|
} | {
|
|
118
118
|
type: "navigateToSuccessPage";
|
|
119
119
|
params: unknown;
|
|
120
|
-
} | {
|
|
121
|
-
type: "setFormTypeToUndefined";
|
|
122
|
-
params: unknown;
|
|
123
120
|
} | {
|
|
124
121
|
type: "clearValidationErrors";
|
|
125
122
|
params: unknown;
|
|
@@ -135,6 +132,9 @@ export declare function createTicketingStateMachine(onSubmit: (schemaName: FormS
|
|
|
135
132
|
} | {
|
|
136
133
|
type: "clearSubmissionError";
|
|
137
134
|
params: unknown;
|
|
135
|
+
} | {
|
|
136
|
+
type: "setFormTypeToUndefined";
|
|
137
|
+
params: unknown;
|
|
138
138
|
}, {
|
|
139
139
|
type: "isFormValid";
|
|
140
140
|
params: unknown;
|
|
@@ -171,7 +171,7 @@ export declare function createTicketingStateMachine(onSubmit: (schemaName: FormS
|
|
|
171
171
|
} | {
|
|
172
172
|
type: "isOrderTravelCard";
|
|
173
173
|
params: unknown;
|
|
174
|
-
}, never, "success" | "
|
|
174
|
+
}, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "appFormHandler" | "webshopFormHandler" | "travelCardFormHandler" | {
|
|
175
175
|
editing: "priceAndTicketTypes" | "selectFormCategory" | {
|
|
176
176
|
webshop: "webshopTicketing" | "webshopAccount" | "selectWebshopForm";
|
|
177
177
|
} | {
|
|
@@ -300,9 +300,6 @@ export declare const ticketingStateMachine: import("xstate").StateMachine<Ticket
|
|
|
300
300
|
} | {
|
|
301
301
|
type: "navigateToSuccessPage";
|
|
302
302
|
params: unknown;
|
|
303
|
-
} | {
|
|
304
|
-
type: "setFormTypeToUndefined";
|
|
305
|
-
params: unknown;
|
|
306
303
|
} | {
|
|
307
304
|
type: "clearValidationErrors";
|
|
308
305
|
params: unknown;
|
|
@@ -318,6 +315,9 @@ export declare const ticketingStateMachine: import("xstate").StateMachine<Ticket
|
|
|
318
315
|
} | {
|
|
319
316
|
type: "clearSubmissionError";
|
|
320
317
|
params: unknown;
|
|
318
|
+
} | {
|
|
319
|
+
type: "setFormTypeToUndefined";
|
|
320
|
+
params: unknown;
|
|
321
321
|
}, {
|
|
322
322
|
type: "isFormValid";
|
|
323
323
|
params: unknown;
|
|
@@ -354,7 +354,7 @@ export declare const ticketingStateMachine: import("xstate").StateMachine<Ticket
|
|
|
354
354
|
} | {
|
|
355
355
|
type: "isOrderTravelCard";
|
|
356
356
|
params: unknown;
|
|
357
|
-
}, never, "success" | "
|
|
357
|
+
}, never, "success" | "validating" | "submitting" | "formCategoryHandler" | "appFormHandler" | "webshopFormHandler" | "travelCardFormHandler" | {
|
|
358
358
|
editing: "priceAndTicketTypes" | "selectFormCategory" | {
|
|
359
359
|
webshop: "webshopTicketing" | "webshopAccount" | "selectWebshopForm";
|
|
360
360
|
} | {
|
|
@@ -182,22 +182,6 @@ export declare const Contact: {
|
|
|
182
182
|
url: import("../../translations/commons").TranslatedString;
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
|
-
skoleskyss: {
|
|
186
|
-
title: import("../../translations/commons").TranslatedString;
|
|
187
|
-
intro: {
|
|
188
|
-
before: import("../../translations/commons").TranslatedString;
|
|
189
|
-
between: import("../../translations/commons").TranslatedString;
|
|
190
|
-
after: import("../../translations/commons").TranslatedString;
|
|
191
|
-
};
|
|
192
|
-
grunnskole: {
|
|
193
|
-
linkText: import("../../translations/commons").TranslatedString;
|
|
194
|
-
href: import("../../translations/commons").TranslatedString;
|
|
195
|
-
};
|
|
196
|
-
videregaaende: {
|
|
197
|
-
linkText: import("../../translations/commons").TranslatedString;
|
|
198
|
-
href: import("../../translations/commons").TranslatedString;
|
|
199
|
-
};
|
|
200
|
-
};
|
|
201
185
|
ticketing: {
|
|
202
186
|
title: import("../../translations/commons").TranslatedString;
|
|
203
187
|
additionalTicketingInfo: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../../src/translations/pages/contact.ts"],"names":[],"mappings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CvC,CAAC"}
|
|
@@ -211,22 +211,6 @@ const ContactInternal = {
|
|
|
211
211
|
url: (0, commons_1.translation)('https://frammr.no/hjelp-og-kontakt/hittegods/', 'https://frammr.no/hjelp-og-kontakt/hittegods/?sprak=3', 'https://frammr.no/hjelp-og-kontakt/hittegods/'),
|
|
212
212
|
},
|
|
213
213
|
},
|
|
214
|
-
skoleskyss: {
|
|
215
|
-
title: (0, commons_1.translation)('Skoleskyss', 'School transport', 'Skuleskyss'),
|
|
216
|
-
intro: {
|
|
217
|
-
before: (0, commons_1.translation)('', '', ''),
|
|
218
|
-
between: (0, commons_1.translation)('', '', ''),
|
|
219
|
-
after: (0, commons_1.translation)('', '', ''),
|
|
220
|
-
},
|
|
221
|
-
grunnskole: {
|
|
222
|
-
linkText: (0, commons_1.translation)('', '', ''),
|
|
223
|
-
href: (0, commons_1.translation)('', '', ''),
|
|
224
|
-
},
|
|
225
|
-
videregaaende: {
|
|
226
|
-
linkText: (0, commons_1.translation)('', '', ''),
|
|
227
|
-
href: (0, commons_1.translation)('', '', ''),
|
|
228
|
-
},
|
|
229
|
-
},
|
|
230
214
|
ticketing: {
|
|
231
215
|
title: (0, commons_1.translation)('Billetter og app', 'Tickets and app', 'Billettar og app'),
|
|
232
216
|
additionalTicketingInfo: {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic, reusable type-level utilities for checking that a value contains
|
|
3
|
+
* at most one member from each of a set of mutually-exclusive groups.
|
|
4
|
+
*/
|
|
5
|
+
/** Identity type used only to check `T` against its constraint at declaration. */
|
|
6
|
+
export type AssertExtends<T extends TConstraint, TConstraint> = T;
|
|
7
|
+
/** Comma-joined, quoted list of a tuple's members, e.g. `'a', 'b', 'c'`. */
|
|
8
|
+
export type Join<T extends string[]> = T extends [
|
|
9
|
+
infer Head extends string,
|
|
10
|
+
...infer Rest extends string[]
|
|
11
|
+
] ? Rest extends [] ? `'${Head}'` : `'${Head}', ${Join<Rest>}` : '';
|
|
12
|
+
/**
|
|
13
|
+
* `never`, unless `T` contains more than one member of `TGroup` — then a
|
|
14
|
+
* string literal describing the conflict. `TGroup` may have any number of
|
|
15
|
+
* members (2 or more).
|
|
16
|
+
*/
|
|
17
|
+
export type GroupConflict<T extends string[], TGroup extends string[]> = {
|
|
18
|
+
[K in keyof TGroup]: TGroup[K] extends T[number] ? [Extract<Exclude<TGroup[number], TGroup[K]>, T[number]>] extends [never] ? never : `Cannot enable more than one of ${Join<TGroup>} — they share a slug, enable exactly one` : never;
|
|
19
|
+
}[number];
|
|
20
|
+
/** Union of every conflict message triggered by `T` across all `TGroups`. */
|
|
21
|
+
export type ConflictMessages<T extends string[], TGroups extends string[][]> = {
|
|
22
|
+
[K in keyof TGroups]: GroupConflict<T, TGroups[K]>;
|
|
23
|
+
}[number];
|
|
24
|
+
/**
|
|
25
|
+
* `T`, unless it violates one of `TGroups` — then the union of triggered
|
|
26
|
+
* conflict messages, which fails to match `T` and surfaces as a precise
|
|
27
|
+
* argument type error at the call site of whatever builder function uses it.
|
|
28
|
+
*/
|
|
29
|
+
export type CheckNoConflicts<T extends string[], TGroups extends string[][]> = [
|
|
30
|
+
ConflictMessages<T, TGroups>
|
|
31
|
+
] extends [never] ? T : ConflictMessages<T, TGroups>;
|
|
32
|
+
//# sourceMappingURL=typing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typing.d.ts","sourceRoot":"","sources":["../../src/utils/typing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kFAAkF;AAClF,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,WAAW,EAAE,WAAW,IAAI,CAAC,CAAC;AAElE,4EAA4E;AAC5E,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,CAAC,SAAS;IAC/C,MAAM,IAAI,SAAS,MAAM;IACzB,GAAG,MAAM,IAAI,SAAS,MAAM,EAAE;CAC/B,GACG,IAAI,SAAS,EAAE,GACb,IAAI,IAAI,GAAG,GACX,IAAI,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,GAC5B,EAAE,CAAC;AAEP;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,MAAM,SAAS,MAAM,EAAE,IAAI;KACtE,CAAC,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,GAC5C,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GACtE,KAAK,GACL,kCAAkC,IAAI,CAAC,MAAM,CAAC,0CAA0C,GAC1F,KAAK;CACV,CAAC,MAAM,CAAC,CAAC;AAEV,6EAA6E;AAC7E,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,OAAO,SAAS,MAAM,EAAE,EAAE,IAAI;KAC5E,CAAC,IAAI,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CACnD,CAAC,MAAM,CAAC,CAAC;AAEV;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,OAAO,SAAS,MAAM,EAAE,EAAE,IAAI;IAC7E,gBAAgB,CAAC,CAAC,EAAE,OAAO,CAAC;CAC7B,SAAS,CAAC,KAAK,CAAC,GACb,CAAC,GACD,gBAAgB,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC"}
|
package/lib/utils.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { FormEvent } from 'react';
|
|
|
4
4
|
import { InputErrorMessages } from './validation';
|
|
5
5
|
import { TranslatedString } from './translations';
|
|
6
6
|
export declare const getContactPageTitle: (subtitle?: TranslatedString) => TranslatedString[];
|
|
7
|
-
export declare const shouldShowContactPage: () => boolean;
|
|
8
7
|
export declare const convertFilesToBase64: (attachments: File[]) => Promise<{
|
|
9
8
|
filename: string;
|
|
10
9
|
body: string;
|
package/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAY,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,mBAAmB,GAC9B,WAAW,gBAAgB,KAC1B,gBAAgB,EAIlB,CAAC;AAEF,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAY,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,mBAAmB,GAC9B,WAAW,gBAAgB,KAC1B,gBAAgB,EAIlB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,aAAa,IAAI,EAAE,KAClB,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CAsB9C,CAAC;AAEF,eAAO,MAAM,oCAAoC,GAC/C,SAAS,GAAG,EACZ,cAAc,iBAAiB,QAqBhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,SAAS,GAAG,EAAE,MAAM,IAAI,GAAG,SAAS,QAkBxE,CAAC;AAEF,eAAO,MAAM,2CAA2C,GACtD,SAAS,GAAG,EACZ,6BAA6B,OAAO,QAUrC,CAAC;AAYF,eAAO,MAAM,mBAAmB,GAAI,GAAG,SAAS,CAAC,eAAe,CAAC,KAAG,MAAM,EAOpC,CAAC;AAEvC,eAAO,MAAM,yBAAyB,GAAI,IAAI,MAAM,GAAG,SAAS,KAAG,IA4BlE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,YAAY,MAAM,EAAE,GAAG,SAAS,EAChC,QAAQ,kBAAkB,KACzB,MAAM,GAAG,SAQX,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAEtE"}
|
package/lib/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findFirstErrorMessage = exports.scrollToFirstErrorMessage = exports.findOrderFormFields = exports.setBankAccountStatusAndResetBankInformation = exports.setLineAndResetStops = exports.setTransportModeAndResetLineAndStops = exports.convertFilesToBase64 = exports.
|
|
3
|
+
exports.findFirstErrorMessage = exports.scrollToFirstErrorMessage = exports.findOrderFormFields = exports.setBankAccountStatusAndResetBankInformation = exports.setLineAndResetStops = exports.setTransportModeAndResetLineAndStops = exports.convertFilesToBase64 = exports.getContactPageTitle = void 0;
|
|
4
4
|
exports.getLineName = getLineName;
|
|
5
5
|
const translations_1 = require("./translations");
|
|
6
6
|
const getContactPageTitle = (subtitle) => {
|
|
@@ -9,10 +9,6 @@ const getContactPageTitle = (subtitle) => {
|
|
|
9
9
|
: [translations_1.PageText.Contact.pageTitle];
|
|
10
10
|
};
|
|
11
11
|
exports.getContactPageTitle = getContactPageTitle;
|
|
12
|
-
const shouldShowContactPage = () => {
|
|
13
|
-
return !!process.env.NEXT_PUBLIC_CONTACT_API_URL;
|
|
14
|
-
};
|
|
15
|
-
exports.shouldShowContactPage = shouldShowContactPage;
|
|
16
12
|
const convertFilesToBase64 = (attachments) => {
|
|
17
13
|
const filePromises = attachments.map((file) => {
|
|
18
14
|
return new Promise((resolve, reject) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrfylke/contact-form",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
"import": "./lib/lost-property/index.js",
|
|
20
20
|
"require": "./lib/lost-property/index.js"
|
|
21
21
|
},
|
|
22
|
+
"./lost-property-external": {
|
|
23
|
+
"types": "./lib/lost-property-external/index.d.ts",
|
|
24
|
+
"import": "./lib/lost-property-external/index.js",
|
|
25
|
+
"require": "./lib/lost-property-external/index.js"
|
|
26
|
+
},
|
|
22
27
|
"./group-travel": {
|
|
23
28
|
"types": "./lib/group-travel/index.d.ts",
|
|
24
29
|
"import": "./lib/group-travel/index.js",
|