@mrfylke/contact-form 0.1.25 → 0.1.27

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.
Files changed (117) hide show
  1. package/README.md +41 -13
  2. package/lib/ContactFormRoot.d.ts.map +1 -1
  3. package/lib/ContactFormRoot.js +4 -3
  4. package/lib/components/icon/generated-icons.d.ts +26 -26
  5. package/lib/components/icon/generated-icons.js +108 -108
  6. package/lib/contact.module.css +0 -9
  7. package/lib/group-travel/index.d.ts.map +1 -1
  8. package/lib/group-travel/index.js +1 -2
  9. package/lib/index.d.ts +2 -2
  10. package/lib/index.d.ts.map +1 -1
  11. package/lib/index.js +3 -2
  12. package/lib/journey-info/index.d.ts.map +1 -1
  13. package/lib/journey-info/index.js +10 -8
  14. package/lib/journey-info/journeyInfoStateMachine.d.ts +2 -2
  15. package/lib/journey-info/journeyInfoStateMachine.d.ts.map +1 -1
  16. package/lib/journey-info/journeyInfoStateMachine.js +1 -1
  17. package/lib/layouts/contact-pages.js +1 -1
  18. package/lib/lost-property/LostPropertyMachine.d.ts +2 -2
  19. package/lib/lost-property/LostPropertyMachine.d.ts.map +1 -1
  20. package/lib/lost-property/LostPropertyMachine.js +1 -1
  21. package/lib/lost-property-external/index.d.ts.map +1 -1
  22. package/lib/lost-property-external/index.js +1 -2
  23. package/lib/means-of-transport/forms/serviceOfferingForm.d.ts.map +1 -1
  24. package/lib/means-of-transport/forms/serviceOfferingForm.js +3 -1
  25. package/lib/means-of-transport/index.d.ts.map +1 -1
  26. package/lib/means-of-transport/index.js +8 -2
  27. package/lib/means-of-transport/means-of-transport-form-machine.d.ts +4 -2
  28. package/lib/means-of-transport/means-of-transport-form-machine.d.ts.map +1 -1
  29. package/lib/means-of-transport/means-of-transport-form-machine.js +9 -3
  30. package/lib/modules/config/context.d.ts +8 -1
  31. package/lib/modules/config/context.d.ts.map +1 -1
  32. package/lib/modules/config/context.js +7 -1
  33. package/lib/modules/config/default-submit.d.ts +3 -0
  34. package/lib/modules/config/default-submit.d.ts.map +1 -0
  35. package/lib/modules/config/default-submit.js +13 -0
  36. package/lib/modules/config/index.d.ts +1 -0
  37. package/lib/modules/config/index.d.ts.map +1 -1
  38. package/lib/modules/config/index.js +1 -0
  39. package/lib/modules/config/types.d.ts +52 -25
  40. package/lib/modules/config/types.d.ts.map +1 -1
  41. package/lib/modules/org-data/index.d.ts +1 -2
  42. package/lib/modules/org-data/index.d.ts.map +1 -1
  43. package/lib/modules/org-data/index.js +1 -2
  44. package/lib/refund/forms/refund-and-travel-guarantee/index.d.ts.map +1 -1
  45. package/lib/refund/forms/refund-and-travel-guarantee/index.js +1 -1
  46. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.d.ts.map +1 -1
  47. package/lib/refund/forms/refund-and-travel-guarantee/refundCarForm.js +1 -1
  48. package/lib/refund/forms/refund-ticket/appTicketRefund.d.ts.map +1 -1
  49. package/lib/refund/forms/refund-ticket/appTicketRefund.js +18 -2
  50. package/lib/refund/forms/refund-ticket/index.d.ts.map +1 -1
  51. package/lib/refund/forms/refund-ticket/index.js +1 -1
  52. package/lib/refund/forms/refund-ticket/otherTicketRefund.d.ts.map +1 -1
  53. package/lib/refund/forms/refund-ticket/otherTicketRefund.js +19 -3
  54. package/lib/refund/forms/residualValueOnTravelCard/index.d.ts.map +1 -1
  55. package/lib/refund/forms/residualValueOnTravelCard/index.js +1 -2
  56. package/lib/refund/index.d.ts.map +1 -1
  57. package/lib/refund/index.js +9 -0
  58. package/lib/refund/refundFormMachine.d.ts +11 -2
  59. package/lib/refund/refundFormMachine.d.ts.map +1 -1
  60. package/lib/refund/refundFormMachine.js +24 -2
  61. package/lib/server/index.d.ts +1 -0
  62. package/lib/server/index.d.ts.map +1 -1
  63. package/lib/server/index.js +3 -1
  64. package/lib/server/submit-route-handler.d.ts +20 -0
  65. package/lib/server/submit-route-handler.d.ts.map +1 -0
  66. package/lib/server/submit-route-handler.js +62 -0
  67. package/lib/ticket-control/forms/feeComplaintForm.d.ts.map +1 -1
  68. package/lib/ticket-control/forms/feeComplaintForm.js +2 -2
  69. package/lib/ticket-control/forms/postponePayment.d.ts.map +1 -1
  70. package/lib/ticket-control/forms/postponePayment.js +2 -2
  71. package/lib/ticket-control/index.d.ts.map +1 -1
  72. package/lib/ticket-control/index.js +2 -0
  73. package/lib/ticket-control/ticket-control-form-machine.d.ts +5 -2
  74. package/lib/ticket-control/ticket-control-form-machine.d.ts.map +1 -1
  75. package/lib/ticket-control/ticket-control-form-machine.js +14 -4
  76. package/lib/ticketing/forms/travel-card/orderTravelCard.d.ts.map +1 -1
  77. package/lib/ticketing/forms/travel-card/orderTravelCard.js +1 -1
  78. package/lib/ticketing/ticketingStateMachine.d.ts +2 -2
  79. package/lib/ticketing/ticketingStateMachine.d.ts.map +1 -1
  80. package/lib/translations/commons.d.ts +1 -0
  81. package/lib/translations/commons.d.ts.map +1 -1
  82. package/lib/translations/commons.js +4 -4
  83. package/lib/translations/index.d.ts +2 -6
  84. package/lib/translations/index.d.ts.map +1 -1
  85. package/lib/translations/index.js +1 -9
  86. package/lib/translations/language-context.d.ts +0 -8
  87. package/lib/translations/language-context.d.ts.map +1 -1
  88. package/lib/translations/language-context.js +1 -31
  89. package/lib/translations/merge-overrides.d.ts +1 -7
  90. package/lib/translations/merge-overrides.d.ts.map +1 -1
  91. package/lib/translations/merge-overrides.js +1 -13
  92. package/lib/translations/pages/contact.d.ts +9 -4
  93. package/lib/translations/pages/contact.d.ts.map +1 -1
  94. package/lib/translations/pages/contact.js +10 -5
  95. package/lib/translations/server/endpoints.d.ts +0 -62
  96. package/lib/translations/server/endpoints.d.ts.map +1 -1
  97. package/lib/translations/server/endpoints.js +0 -62
  98. package/lib/translations/types.d.ts +0 -6
  99. package/lib/translations/types.d.ts.map +1 -1
  100. package/lib/types/submit-payloads.d.ts +2 -0
  101. package/lib/types/submit-payloads.d.ts.map +1 -1
  102. package/package.json +1 -1
  103. package/lib/translations/common/index.d.ts +0 -3
  104. package/lib/translations/common/index.d.ts.map +0 -1
  105. package/lib/translations/common/index.js +0 -7
  106. package/lib/translations/common/layout.d.ts +0 -8
  107. package/lib/translations/common/layout.d.ts.map +0 -1
  108. package/lib/translations/common/layout.js +0 -11
  109. package/lib/translations/common/titles.d.ts +0 -4
  110. package/lib/translations/common/titles.d.ts.map +0 -1
  111. package/lib/translations/common/titles.js +0 -7
  112. package/lib/translations/json-to-override.d.ts +0 -19
  113. package/lib/translations/json-to-override.d.ts.map +0 -1
  114. package/lib/translations/json-to-override.js +0 -65
  115. package/lib/translations/load-org-translations.d.ts +0 -19
  116. package/lib/translations/load-org-translations.d.ts.map +0 -1
  117. package/lib/translations/load-org-translations.js +0 -23
@@ -1 +0,0 @@
1
- {"version":3,"file":"json-to-override.d.ts","sourceRoot":"","sources":["../../src/translations/json-to-override.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAG/D;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC9B,MAAM,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,CAAC;AAE7E,MAAM,MAAM,qBAAqB,GAAG;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,GAAG,oBAAoB,EAAE,CAAC;CAC9D,CAAC;AAEF;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,qBAAqB,GAC1B,+BAA+B,CAqEjC"}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsonTranslationsToOverride = jsonTranslationsToOverride;
4
- const merge_overrides_1 = require("./merge-overrides");
5
- /**
6
- * Convert a JSON translation object (from org config) to ContactFormTranslationsOverride format.
7
- * Recursively converts no/en/nn objects to TranslatedString format.
8
- */
9
- function jsonTranslationsToOverride(json) {
10
- function convertValue(value) {
11
- if (typeof value === 'string') {
12
- return value;
13
- }
14
- if (Array.isArray(value)) {
15
- return value.map(convertValue);
16
- }
17
- if (value && typeof value === 'object') {
18
- // Check if it's a translation object (has no/en/nn keys)
19
- if ('no' in value || 'en' in value || 'nn' in value) {
20
- return (0, merge_overrides_1.jsonToTranslatedString)(value);
21
- }
22
- // Otherwise it's a nested object
23
- const result = {};
24
- for (const key in value) {
25
- const val = value[key];
26
- if (val === undefined)
27
- continue;
28
- if (Array.isArray(val)) {
29
- result[key] = val.map(convertValue);
30
- }
31
- else {
32
- result[key] = convertValue(val);
33
- }
34
- }
35
- return result;
36
- }
37
- return value;
38
- }
39
- const result = {};
40
- if (json.pages) {
41
- const pagesVal = json.pages;
42
- result.pages = (Array.isArray(pagesVal)
43
- ? pagesVal.map(convertValue)
44
- : convertValue(pagesVal));
45
- }
46
- if (json.components) {
47
- const componentsVal = json.components;
48
- result.components = (Array.isArray(componentsVal)
49
- ? componentsVal.map(convertValue)
50
- : convertValue(componentsVal));
51
- }
52
- if (json.common) {
53
- const commonVal = json.common;
54
- result.common = (Array.isArray(commonVal)
55
- ? commonVal.map(convertValue)
56
- : convertValue(commonVal));
57
- }
58
- if (json.server) {
59
- const serverVal = json.server;
60
- result.server = (Array.isArray(serverVal)
61
- ? serverVal.map(convertValue)
62
- : convertValue(serverVal));
63
- }
64
- return result;
65
- }
@@ -1,19 +0,0 @@
1
- import type { JsonTranslationObject } from './json-to-override';
2
- import type { ContactFormTranslationsOverride } from './types';
3
- /**
4
- * Load translations from an org JSON config file.
5
- * The org JSON should have a `translations` property with the structure:
6
- * {
7
- * translations: {
8
- * pages?: { ... },
9
- * components?: { ... },
10
- * modules?: { ... },
11
- * common?: { ... },
12
- * server?: { ... }
13
- * }
14
- * }
15
- */
16
- export declare function loadOrgTranslations(orgJson: {
17
- translations?: JsonTranslationObject;
18
- }): ContactFormTranslationsOverride | undefined;
19
- //# sourceMappingURL=load-org-translations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"load-org-translations.d.ts","sourceRoot":"","sources":["../../src/translations/load-org-translations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE;IAC3C,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACtC,GAAG,+BAA+B,GAAG,SAAS,CAK9C"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadOrgTranslations = loadOrgTranslations;
4
- const json_to_override_1 = require("./json-to-override");
5
- /**
6
- * Load translations from an org JSON config file.
7
- * The org JSON should have a `translations` property with the structure:
8
- * {
9
- * translations: {
10
- * pages?: { ... },
11
- * components?: { ... },
12
- * modules?: { ... },
13
- * common?: { ... },
14
- * server?: { ... }
15
- * }
16
- * }
17
- */
18
- function loadOrgTranslations(orgJson) {
19
- if (!orgJson.translations) {
20
- return undefined;
21
- }
22
- return (0, json_to_override_1.jsonTranslationsToOverride)(orgJson.translations);
23
- }