@postnord/pn-marketweb-components 2.1.1 → 2.1.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.
Files changed (61) hide show
  1. package/cjs/loader.cjs.js +1 -1
  2. package/cjs/pn-language-selector_9.cjs.entry.js +7 -4
  3. package/cjs/pn-market-web-components.cjs.js +1 -1
  4. package/cjs/{pn-marketweb-siteheader-login-button_4.cjs.entry.js → pn-marketweb-siteheader-login-button_5.cjs.entry.js} +71 -29
  5. package/cjs/pn-marketweb-siteheader-login-linklist.cjs.entry.js +53 -6
  6. package/cjs/pn-marketweb-siteheader.cjs.entry.js +74 -58
  7. package/collection/collection-manifest.json +1 -0
  8. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.js +8 -38
  9. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.css +3 -1
  10. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.js +74 -8
  11. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.js +20 -1
  12. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.js +64 -8
  13. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.css +0 -0
  14. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.js +88 -0
  15. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.css +9 -2
  16. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js +24 -2
  17. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.stories.js +1 -1
  18. package/collection/components/layout-components/pn-marketweb-siteheader/translations.js +67 -55
  19. package/collection/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.js +46 -0
  20. package/custom-elements/index.d.ts +6 -0
  21. package/custom-elements/index.js +212 -102
  22. package/esm/loader.js +1 -1
  23. package/esm/pn-language-selector_9.entry.js +7 -4
  24. package/esm/pn-market-web-components.js +1 -1
  25. package/esm/{pn-marketweb-siteheader-login-button_4.entry.js → pn-marketweb-siteheader-login-button_5.entry.js} +71 -30
  26. package/esm/pn-marketweb-siteheader-login-linklist.entry.js +53 -6
  27. package/esm/pn-marketweb-siteheader.entry.js +74 -58
  28. package/esm-es5/loader.js +1 -1
  29. package/esm-es5/pn-language-selector_9.entry.js +1 -1
  30. package/esm-es5/pn-market-web-components.js +1 -1
  31. package/esm-es5/pn-marketweb-siteheader-login-button_5.entry.js +1 -0
  32. package/esm-es5/pn-marketweb-siteheader-login-linklist.entry.js +1 -1
  33. package/esm-es5/pn-marketweb-siteheader.entry.js +1 -1
  34. package/package.json +2 -2
  35. package/pn-market-web-components/p-3120cc66.system.entry.js +1 -0
  36. package/pn-market-web-components/{p-70b360dd.entry.js → p-39b54d40.entry.js} +1 -1
  37. package/pn-market-web-components/p-4b0020a0.system.entry.js +1 -0
  38. package/pn-market-web-components/p-67887512.system.js +1 -1
  39. package/pn-market-web-components/p-6995075c.entry.js +1 -0
  40. package/pn-market-web-components/p-b7adbd6d.system.entry.js +1 -0
  41. package/pn-market-web-components/p-c8ceda2e.entry.js +1 -0
  42. package/pn-market-web-components/{p-7f9c643c.system.entry.js → p-e881d111.system.entry.js} +1 -1
  43. package/pn-market-web-components/p-fefc9629.entry.js +1 -0
  44. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  45. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.d.ts +2 -4
  46. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.d.ts +4 -0
  47. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.d.ts +1 -0
  48. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.d.ts +4 -0
  49. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-types.d.ts +2 -2
  50. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.d.ts +8 -0
  51. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.d.ts +2 -0
  52. package/types/components/layout-components/pn-marketweb-siteheader/translations.d.ts +12 -0
  53. package/types/components/layout-components/pn-marketweb-siteheader/unifiedLoginHelper.d.ts +1 -0
  54. package/types/components.d.ts +45 -0
  55. package/esm-es5/pn-marketweb-siteheader-login-button_4.entry.js +0 -1
  56. package/pn-market-web-components/p-20be85a1.system.entry.js +0 -1
  57. package/pn-market-web-components/p-dd01024a.system.entry.js +0 -1
  58. package/pn-market-web-components/p-de823255.entry.js +0 -1
  59. package/pn-market-web-components/p-e4ebf17d.system.entry.js +0 -1
  60. package/pn-market-web-components/p-fe95397b.entry.js +0 -1
  61. package/pn-market-web-components/p-ff83e974.entry.js +0 -1
@@ -17,8 +17,8 @@ export class PnMarketwebSiteheaderLogin {
17
17
  mainMenuButton: '',
18
18
  menuStartButton: '',
19
19
  profileSelectionFlyoutHeading: '',
20
- loginButtonText: '',
21
- loginPreamble: '',
20
+ unifiedLoginButton: '',
21
+ unifiedMyPagesButton: '',
22
22
  };
23
23
  this.siteUrl = '';
24
24
  this.emitEvents = true;
@@ -29,13 +29,16 @@ export class PnMarketwebSiteheaderLogin {
29
29
  this.loggedin = false;
30
30
  /** If this is selected we will show the new profile selection dropdown instead of the login version */
31
31
  this.showProfileSelection = false;
32
+ /** if this is selected we will show the unifiedlogin button along with new look for dropdown */
33
+ this.showUnifiedLogin = false;
32
34
  /** Continiously check if a user is logged in **/
33
35
  this.checkUserLoggedInStateInterval = 0;
36
+ this.loginButtonText = 'Placeholder';
37
+ this.loginInformationRichText = '<a href="#">Read more about the benefits of becoming a customer in the business portal</a>';
34
38
  this.toggleButtonText = ((_a = this.loginDialog) === null || _a === void 0 ? void 0 : _a.loginMenuLinkText) ? this.loginDialog.loginMenuLinkText : '';
35
39
  this.username = this.fullname;
36
40
  }
37
41
  componentWillLoad() {
38
- console.log('env: ', this.environment);
39
42
  const userInfo = this.loggedin && this.fullname ? { given_name: this.fullname } : null;
40
43
  headerState.loginManager = new MarketWebLoginManager({
41
44
  endpoint: this.endpoint,
@@ -157,10 +160,9 @@ export class PnMarketwebSiteheaderLogin {
157
160
  }
158
161
  return (h(Host, Object.assign({}, hostElementAttribute),
159
162
  h("pn-nav-dropdown", { label: this.toggleButtonText, icon: "user", class: "siteheader-logindialog" },
160
- this.environment !== 'production' && !this.loggedin && h("pn-marketweb-siteheader-login-button", { label: /* this.i18n?.loginButtonText */ 'login check' }),
161
- this.environment !== 'production' && this.loggedin && h("pn-marketweb-siteheader-login-mypage-button", { myPageUrl: "https://account.postnord.com/secure/profile" }),
162
- this.loggedin && this.showProfileSelection ? (h("pn-marketweb-siteheader-login-profileselection", { loginDialog: this.loginDialog, loggedin: this.loggedin, i18n: this.i18n, idNamespace: this.emitEvents ? '1' : '2', endpoint: this.endpoint })) : (h("pn-marketweb-siteheader-login-links", { loginDialog: this.loginDialog, loggedin: this.loggedin, idNamespace: this.emitEvents ? '1' : '2', username: this.username })),
163
- this.environment !== 'production' && h("p", null, "L\u00E4s mer om v\u00E5ra inloggade tj\u00E4nster och hur du anv\u00E4nder dem"))));
163
+ this.showUnifiedLogin && (h("pn-marketweb-siteheader-unified-login", { loggedIn: this.loggedin, myPageLabel: this.i18n.unifiedMyPagesButton, myPageUrl: "https://account.postnord.com/secure/profile", logInLabel: this.i18n.unifiedLoginButton })),
164
+ this.loggedin && this.showProfileSelection ? (h("pn-marketweb-siteheader-login-profileselection", { loginDialog: this.loginDialog, loggedin: this.loggedin, i18n: this.i18n, idNamespace: this.emitEvents ? '1' : '2', endpoint: this.endpoint })) : (h("pn-marketweb-siteheader-login-links", { loginDialog: this.loginDialog, loggedin: this.loggedin, idNamespace: this.emitEvents ? '1' : '2', username: this.username, showUnifiedLogin: this.showUnifiedLogin })),
165
+ this.showUnifiedLogin && h("span", { innerHTML: `${this.loginInformationRichText}` }))));
164
166
  }
165
167
  static get is() { return "pn-marketweb-siteheader-login"; }
166
168
  static get originalStyleUrls() { return {
@@ -225,7 +227,7 @@ export class PnMarketwebSiteheaderLogin {
225
227
  "tags": [],
226
228
  "text": ""
227
229
  },
228
- "defaultValue": "{\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n loginButtonText: '',\n loginPreamble: '',\n } as SiteHeaderI18N"
230
+ "defaultValue": "{\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n unifiedLoginButton: '',\n unifiedMyPagesButton: '',\n } as SiteHeaderI18N"
229
231
  },
230
232
  "siteUrl": {
231
233
  "type": "string",
@@ -338,6 +340,24 @@ export class PnMarketwebSiteheaderLogin {
338
340
  "reflect": false,
339
341
  "defaultValue": "false"
340
342
  },
343
+ "showUnifiedLogin": {
344
+ "type": "boolean",
345
+ "mutable": false,
346
+ "complexType": {
347
+ "original": "boolean",
348
+ "resolved": "boolean",
349
+ "references": {}
350
+ },
351
+ "required": false,
352
+ "optional": false,
353
+ "docs": {
354
+ "tags": [],
355
+ "text": "if this is selected we will show the unifiedlogin button along with new look for dropdown"
356
+ },
357
+ "attribute": "show-unified-login",
358
+ "reflect": false,
359
+ "defaultValue": "false"
360
+ },
341
361
  "checkUserLoggedInStateInterval": {
342
362
  "type": "number",
343
363
  "mutable": false,
@@ -372,6 +392,42 @@ export class PnMarketwebSiteheaderLogin {
372
392
  },
373
393
  "attribute": "environment",
374
394
  "reflect": false
395
+ },
396
+ "loginButtonText": {
397
+ "type": "string",
398
+ "mutable": false,
399
+ "complexType": {
400
+ "original": "string",
401
+ "resolved": "string",
402
+ "references": {}
403
+ },
404
+ "required": false,
405
+ "optional": false,
406
+ "docs": {
407
+ "tags": [],
408
+ "text": ""
409
+ },
410
+ "attribute": "login-button-text",
411
+ "reflect": false,
412
+ "defaultValue": "'Placeholder'"
413
+ },
414
+ "loginInformationRichText": {
415
+ "type": "string",
416
+ "mutable": false,
417
+ "complexType": {
418
+ "original": "string",
419
+ "resolved": "string",
420
+ "references": {}
421
+ },
422
+ "required": false,
423
+ "optional": false,
424
+ "docs": {
425
+ "tags": [],
426
+ "text": ""
427
+ },
428
+ "attribute": "login-information-rich-text",
429
+ "reflect": false,
430
+ "defaultValue": "'<a href=\"#\">Read more about the benefits of becoming a customer in the business portal</a>'"
375
431
  }
376
432
  }; }
377
433
  static get states() { return {
@@ -0,0 +1,88 @@
1
+ import { Component, Element, h, Host, Prop } from '@stencil/core';
2
+ export class PnMarketwebSiteheaderUnifiedLogin {
3
+ constructor() {
4
+ this.loggedIn = false;
5
+ }
6
+ render() {
7
+ return (h(Host, null, this.loggedIn ? (h("pn-marketweb-siteheader-login-mypage-button", { label: this.myPageLabel, myPageUrl: this.myPageUrl })) : (h("pn-marketweb-siteheader-login-button", { label: this.logInLabel }))));
8
+ }
9
+ static get is() { return "pn-marketweb-siteheader-unified-login"; }
10
+ static get originalStyleUrls() { return {
11
+ "$": ["pn-marketweb-siteheader-unified-login.scss"]
12
+ }; }
13
+ static get styleUrls() { return {
14
+ "$": ["pn-marketweb-siteheader-unified-login.css"]
15
+ }; }
16
+ static get properties() { return {
17
+ "loggedIn": {
18
+ "type": "boolean",
19
+ "mutable": false,
20
+ "complexType": {
21
+ "original": "boolean",
22
+ "resolved": "boolean",
23
+ "references": {}
24
+ },
25
+ "required": false,
26
+ "optional": false,
27
+ "docs": {
28
+ "tags": [],
29
+ "text": ""
30
+ },
31
+ "attribute": "logged-in",
32
+ "reflect": false,
33
+ "defaultValue": "false"
34
+ },
35
+ "myPageLabel": {
36
+ "type": "string",
37
+ "mutable": false,
38
+ "complexType": {
39
+ "original": "string",
40
+ "resolved": "string",
41
+ "references": {}
42
+ },
43
+ "required": false,
44
+ "optional": false,
45
+ "docs": {
46
+ "tags": [],
47
+ "text": ""
48
+ },
49
+ "attribute": "my-page-label",
50
+ "reflect": false
51
+ },
52
+ "myPageUrl": {
53
+ "type": "string",
54
+ "mutable": false,
55
+ "complexType": {
56
+ "original": "string",
57
+ "resolved": "string",
58
+ "references": {}
59
+ },
60
+ "required": false,
61
+ "optional": false,
62
+ "docs": {
63
+ "tags": [],
64
+ "text": ""
65
+ },
66
+ "attribute": "my-page-url",
67
+ "reflect": false
68
+ },
69
+ "logInLabel": {
70
+ "type": "string",
71
+ "mutable": false,
72
+ "complexType": {
73
+ "original": "string",
74
+ "resolved": "string",
75
+ "references": {}
76
+ },
77
+ "required": false,
78
+ "optional": false,
79
+ "docs": {
80
+ "tags": [],
81
+ "text": ""
82
+ },
83
+ "attribute": "log-in-label",
84
+ "reflect": false
85
+ }
86
+ }; }
87
+ static get elementRef() { return "hostElement"; }
88
+ }
@@ -98,7 +98,7 @@ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dro
98
98
  width: 100%;
99
99
  }
100
100
  pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content pn-marketweb-siteheader-login-links::before,
101
- pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content p::before {
101
+ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content span::before {
102
102
  display: block;
103
103
  content: "";
104
104
  height: 2px;
@@ -106,10 +106,17 @@ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dro
106
106
  width: 100%;
107
107
  margin-bottom: 2.4rem;
108
108
  }
109
- pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content p {
109
+ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content span {
110
110
  font-size: 1.4rem;
111
111
  color: #005D92;
112
112
  }
113
+ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content span a {
114
+ text-decoration: none;
115
+ color: #005D92;
116
+ }
117
+ pn-marketweb-siteheader pn-nav-dropdown .nav-dropdown-content-container .nav-dropdown-content span a:hover {
118
+ text-decoration: underline;
119
+ }
113
120
  pn-marketweb-siteheader pn-nav-dropdown:not(.hydrated) .nav-dropdown-content-container {
114
121
  display: none;
115
122
  }
@@ -36,6 +36,8 @@ export class PnMarketwebSiteheader {
36
36
  this.hideLogin = false;
37
37
  /** If this is selected we will show the new profile selection dropdown instead of the login version */
38
38
  this.showProfileSelection = false;
39
+ /** if this is selected we will show the unified-login button aswell as a new look for dropdown menu */
40
+ this.showUnifiedLogin = false;
39
41
  /** Adjusts the menus URLs */
40
42
  this.siteDomainInUrls = false;
41
43
  /** Autocomplete endpoint */
@@ -59,6 +61,8 @@ export class PnMarketwebSiteheader {
59
61
  mainMenuButton: '',
60
62
  menuStartButton: '',
61
63
  profileSelectionFlyoutHeading: '',
64
+ unifiedLoginButton: '',
65
+ unifiedMyPagesButton: '',
62
66
  };
63
67
  this.gotData = false;
64
68
  this.fetchingData = false;
@@ -345,7 +349,7 @@ export class PnMarketwebSiteheader {
345
349
  h("path", { d: "M108.84,13.35c0,6.34-5.17,9-10,9S89,19.76,89,13.63c0-6.28,5.08-9,10-9S108.84,7.25,108.84,13.35Zm-6.56.18a3.4,3.4,0,1,0-6.8,0,3.29,3.29,0,0,0,3.42,3.41A3.24,3.24,0,0,0,102.28,13.54Zm-83,0c0,4.83-3.32,8.82-8.49,8.82a6.54,6.54,0,0,1-4.65-1.57v5.86H0V5.16H6.17V6.8a6.43,6.43,0,0,1,5.11-2.18C16.41,4.62,19.31,8.58,19.31,13.54Zm-6.53,0A3.27,3.27,0,0,0,9.4,10,3.28,3.28,0,0,0,6,13.54,3.29,3.29,0,0,0,9.4,16.95,3.24,3.24,0,0,0,12.78,13.54Zm103.69,0.27c0-2.54,1.54-3.32,3.6-3.32a6.56,6.56,0,0,1,2.08.3L122.3,5.1a3.92,3.92,0,0,0-1.45-.18c-3.45,0-4.38,2.18-4.38,2.18V5.16H110.3V21.84h6.17v-8ZM141.73,0V21.84h-6.16V20.21a6.43,6.43,0,0,1-5.11,2.18c-5.14,0-8-4-8-8.91s3.32-8.82,8.49-8.82a6.54,6.54,0,0,1,4.65,1.57v-5Zm-6,13.48a3.28,3.28,0,0,0-3.41-3.41A3.24,3.24,0,0,0,129,13.47,3.4,3.4,0,1,0,135.75,13.47ZM81.35,4.62c-3.6,0-4.9,2.18-4.9,2.18V5.16H70.29V21.84h6.16V13.29c0-2.11.79-3.08,2.69-3.08s2.18,1.57,2.18,3.57v8.07h6.22V11.6C87.55,7,85.34,4.62,81.35,4.62ZM64.07,1.42H57.9V21.84h6.16V10.36H67l2.81-5.2H64.07V1.42ZM50.26,11.21c-2-.3-2.87-0.3-2.87-1.09s0.81-.94,2.42-0.94a16.15,16.15,0,0,1,5.11.91L56,5.41a24.56,24.56,0,0,0-6.13-.75c-5.89,0-9,2.27-9,5.89,0,2.81,1.66,4.47,6.53,5.11,2.06,0.27,2.81.39,2.81,1.15s-0.82,1-2.24,1a16.67,16.67,0,0,1-6-1.3L40.77,21.3a22.14,22.14,0,0,0,6.68,1c6.35,0,9.28-2.24,9.28-5.89C56.72,13.54,55.15,12,50.26,11.21ZM40.19,13.35c0,6.34-5.17,9-10,9s-9.82-2.6-9.82-8.73c0-6.28,5.08-9,10-9S40.19,7.25,40.19,13.35Zm-6.56.18a3.4,3.4,0,1,0-6.8,0,3.28,3.28,0,0,0,3.41,3.41A3.24,3.24,0,0,0,33.63,13.54Z", fill: "#00A0D6", transform: "translate(0 0)" }))))),
346
350
  h("div", { class: "siteheader-topright" },
347
351
  h("slot", { name: "toprightstart" }),
348
- this.gotData && this.loginDialog && !this.hideLogin && (h("pn-marketweb-siteheader-login", { token: this.userToken, siteUrl: this.siteDefinition.url, fullname: this.userFullname, loggedin: this.userLoggedin, loginDialog: this.loginDialog, endpoint: this.endpoint, i18n: this.i18n, showProfileSelection: this.showProfileSelection, "check-user-logged-in-state-interval": this.checkUserLoggedInStateInterval })),
352
+ this.gotData && this.loginDialog && !this.hideLogin && (h("pn-marketweb-siteheader-login", { token: this.userToken, siteUrl: this.siteDefinition.url, fullname: this.userFullname, loggedin: this.userLoggedin, loginDialog: this.loginDialog, endpoint: this.endpoint, i18n: this.i18n, showProfileSelection: this.showProfileSelection, showUnifiedLogin: this.showUnifiedLogin, "check-user-logged-in-state-interval": this.checkUserLoggedInStateInterval })),
349
353
  this.gotData && this.languageOptions && this.languageOptions.length && !this.hideLanguageSelector && (h("pn-language-selector", { value: this.language }, this.languageOptions.map(language => (h("pn-language-selector-option", { name: language.nativeName, code: language.twoLetterISOLanguageName, selected: language.isCurrent, url: this.getLanguageVersionUrl(language) }))))),
350
354
  h("slot", { name: "toprightend" }),
351
355
  h("div", { class: "siteheader-menu-top-search" },
@@ -367,7 +371,7 @@ export class PnMarketwebSiteheader {
367
371
  })),
368
372
  h("div", { slot: "footer", class: "siteheader-menu-footer" },
369
373
  h("slot", { name: "menu-footer-cta" }),
370
- this.gotData && this.loginDialog && !this.hideLogin && (h("pn-marketweb-siteheader-login", { emitEvents: false, siteUrl: this.siteDefinition.url, loginDialog: this.loginDialog, endpoint: this.endpoint, fullname: this.userFullname, loggedin: this.userLoggedin, i18n: this.i18n, showProfileSelection: this.showProfileSelection, environment: this.environment })),
374
+ this.gotData && this.loginDialog && !this.hideLogin && (h("pn-marketweb-siteheader-login", { emitEvents: false, siteUrl: this.siteDefinition.url, loginDialog: this.loginDialog, endpoint: this.endpoint, fullname: this.userFullname, loggedin: this.userLoggedin, i18n: this.i18n, showProfileSelection: this.showProfileSelection, showUnifiedLogin: this.showUnifiedLogin, environment: this.environment })),
371
375
  this.gotData && this.languageOptions && this.languageOptions.length && !this.hideLanguageSelector && (h("pn-language-selector", { value: this.language }, this.languageOptions.map(language => (h("pn-language-selector-option", { name: language.nativeName, code: language.twoLetterISOLanguageName, selected: language.isCurrent, url: this.getLanguageVersionUrl(language) }))))),
372
376
  !this.hideSiteSelector && (h("pn-site-selector", { language: this.language },
373
377
  this.gotData && ((_e = this.siteSelector) === null || _e === void 0 ? void 0 : _e.currentSiteTitle) && (h("pn-site-selector-item", { heading: this.siteSelector.currentSiteTitle, description: this.siteSelector.currentSiteDescription })),
@@ -639,6 +643,24 @@ export class PnMarketwebSiteheader {
639
643
  "reflect": true,
640
644
  "defaultValue": "false"
641
645
  },
646
+ "showUnifiedLogin": {
647
+ "type": "boolean",
648
+ "mutable": false,
649
+ "complexType": {
650
+ "original": "boolean",
651
+ "resolved": "boolean",
652
+ "references": {}
653
+ },
654
+ "required": false,
655
+ "optional": false,
656
+ "docs": {
657
+ "tags": [],
658
+ "text": "if this is selected we will show the unified-login button aswell as a new look for dropdown menu"
659
+ },
660
+ "attribute": "show-unified-login",
661
+ "reflect": false,
662
+ "defaultValue": "false"
663
+ },
642
664
  "siteDomainInUrls": {
643
665
  "type": "boolean",
644
666
  "mutable": false,
@@ -477,7 +477,7 @@ DotComSiteHeader.args = {
477
477
  language: 'sv',
478
478
  endpoint: 'https://com-integration.postnord.com',
479
479
  name: 'DotCom User',
480
- loggedin: true,
480
+ loggedin: false,
481
481
  };
482
482
 
483
483
  const TPLSiteHeaderTemplate = ({ ...args }) => {
@@ -1,62 +1,74 @@
1
1
  export const translations = {
2
- 'sv': {
3
- "searchlabel": "Sök",
4
- "searchplaceholder": "Vad letar du efter?",
5
- "searchbuttontext": "Sök",
6
- "menuHomeButton": "Hem",
7
- "menuGoBackButton": "Gå tillbaka",
8
- "mainMenuButton": "Meny",
9
- "menuStartButton": "Start",
10
- "profileSelectionFlyoutHeading": "Inloggad som",
2
+ sv: {
3
+ searchlabel: 'Sök',
4
+ searchplaceholder: 'Vad letar du efter?',
5
+ searchbuttontext: 'Sök',
6
+ menuHomeButton: 'Hem',
7
+ menuGoBackButton: 'Gå tillbaka',
8
+ mainMenuButton: 'Meny',
9
+ menuStartButton: 'Start',
10
+ profileSelectionFlyoutHeading: 'Inloggad som',
11
+ unifiedLoginButton: 'Logga in',
12
+ unifiedMyPagesButton: 'Mina sidor',
11
13
  },
12
- 'en': {
13
- "searchlabel": "Search",
14
- "searchplaceholder": "Search",
15
- "searchbuttontext": "Search",
16
- "menuHomeButton": "Home",
17
- "menuGoBackButton": "Go back",
18
- "mainMenuButton": "Menu",
19
- "menuStartButton": "Start",
20
- "profileSelectionFlyoutHeading": "Logged in as",
14
+ en: {
15
+ searchlabel: 'Search',
16
+ searchplaceholder: 'Search',
17
+ searchbuttontext: 'Search',
18
+ menuHomeButton: 'Home',
19
+ menuGoBackButton: 'Go back',
20
+ mainMenuButton: 'Menu',
21
+ menuStartButton: 'Start',
22
+ profileSelectionFlyoutHeading: 'Logged in as',
23
+ unifiedLoginButton: 'Log in',
24
+ unifiedMyPagesButton: 'My pages',
21
25
  },
22
- 'da': {
23
- "searchlabel": "Søg",
24
- "searchplaceholder": "Søg",
25
- "searchbuttontext": "Søg",
26
- "menuHomeButton": "Hjem",
27
- "menuGoBackButton": "Gå tilbage",
28
- "mainMenuButton": "Menu",
29
- "menuStartButton": "Start",
30
- "profileSelectionFlyoutHeading": "Logget ind som",
26
+ da: {
27
+ searchlabel: 'Søg',
28
+ searchplaceholder: 'Søg',
29
+ searchbuttontext: 'Søg',
30
+ menuHomeButton: 'Hjem',
31
+ menuGoBackButton: 'Gå tilbage',
32
+ mainMenuButton: 'Menu',
33
+ menuStartButton: 'Start',
34
+ profileSelectionFlyoutHeading: 'Logget ind som',
35
+ unifiedLoginButton: 'Log ind',
36
+ unifiedMyPagesButton: 'Mine sider',
31
37
  },
32
- 'no': {
33
- "searchlabel": "Søk",
34
- "searchplaceholder": "Søk",
35
- "searchbuttontext": "Søk",
36
- "menuHomeButton": "Hjem",
37
- "menuGoBackButton": "Gå tilbake",
38
- "mainMenuButton": "Meny",
39
- "menuStartButton": "Start",
40
- "profileSelectionFlyoutHeading": "Logget på som",
38
+ no: {
39
+ searchlabel: 'Søk',
40
+ searchplaceholder: 'Søk',
41
+ searchbuttontext: 'Søk',
42
+ menuHomeButton: 'Hjem',
43
+ menuGoBackButton: 'Gå tilbake',
44
+ mainMenuButton: 'Meny',
45
+ menuStartButton: 'Start',
46
+ profileSelectionFlyoutHeading: 'Logget på som',
47
+ unifiedLoginButton: 'Logg inn',
48
+ unifiedMyPagesButton: 'Sidene mine',
41
49
  },
42
- 'fi': {
43
- "searchlabel": "Hae",
44
- "searchplaceholder": "Hae",
45
- "searchbuttontext": "Hae",
46
- "menuHomeButton": "Koti",
47
- "menuGoBackButton": "Mene takaisin",
48
- "mainMenuButton": "Valikko",
49
- "menuStartButton": "Alkaa",
50
- "profileSelectionFlyoutHeading": "Kirjautunut sisään nimellä",
50
+ fi: {
51
+ searchlabel: 'Hae',
52
+ searchplaceholder: 'Hae',
53
+ searchbuttontext: 'Hae',
54
+ menuHomeButton: 'Koti',
55
+ menuGoBackButton: 'Mene takaisin',
56
+ mainMenuButton: 'Valikko',
57
+ menuStartButton: 'Alkaa',
58
+ profileSelectionFlyoutHeading: 'Kirjautunut sisään nimellä',
59
+ unifiedLoginButton: 'Kirjaudu sisään',
60
+ unifiedMyPagesButton: 'Minun sivujani',
61
+ },
62
+ de: {
63
+ searchlabel: 'Suche',
64
+ searchplaceholder: 'Wonach suchen Sie?',
65
+ searchbuttontext: 'Suche',
66
+ menuHomeButton: 'Start',
67
+ menuGoBackButton: 'Geh zurück',
68
+ mainMenuButton: 'Menü',
69
+ menuStartButton: 'Start',
70
+ profileSelectionFlyoutHeading: 'Eingeloggt als',
71
+ unifiedLoginButton: 'Anmeldung',
72
+ unifiedMyPagesButton: 'Meine Seiten',
51
73
  },
52
- 'de': {
53
- "searchlabel": "Suche",
54
- "searchplaceholder": "Wonach suchen Sie?",
55
- "searchbuttontext": "Suche",
56
- "menuHomeButton": "Start",
57
- "menuGoBackButton": "Geh zurück",
58
- "mainMenuButton": "Menü",
59
- "menuStartButton": "Start",
60
- "profileSelectionFlyoutHeading": "Eingeloggt als",
61
- }
62
74
  };
@@ -0,0 +1,46 @@
1
+ export const getLoginUrl = currentDomain => {
2
+ /* Step 1
3
+ If a user is on on a domain with these patterns / direct urls
4
+
5
+ [market]-[environments].postnord.com
6
+ market = ['se','dk', 'no', 'fi','com','de','tpl'];
7
+ environments = ['integration', 'preproduction', 'production'];
8
+ Or matches
9
+
10
+
11
+ wwwurls = ['www.postnord.se','www.postnord.dk', 'www.postnord.no', 'www.postnord.fi', 'www.postnord.com', 'www.postnord.de', 'www.tpl.postnord.com']
12
+
13
+ Step 2.
14
+ If the above is not matches,
15
+ check if the domain is a portal AT domain
16
+
17
+ portalAtDomains = ['devportal.postnord.com', 'atportal.postnord.com']
18
+ Then use the atportal endpoints to log in (this should have nothing to do with the market domains
19
+ Step 3.
20
+ If non of the above matches, then use the production portal endpoint to log in
21
+
22
+
23
+ */
24
+ let loginUrl = null;
25
+ // const market = ['se', 'dk', 'no', 'fi', 'com', 'de', 'tpl'];
26
+ // const environments = ['integration', 'preproduction', 'production'];
27
+ // const wwwurls = ['www.postnord.se', 'www.postnord.dk', 'www.postnord.no', 'www.postnord.fi', 'www.postnord.com', 'www.postnord.de', 'www.tpl.postnord.com'];
28
+ const portalAtDomains = ['devportal.postnord.com', 'atportal.postnord.com'];
29
+ const marketRegex = '(?:se|dk|no|fi|com|de|tpl)-(?:integration|preproduction|production).(?:postnord.com)';
30
+ const wwwRegex = '(?:www(?:.tpl)?.postnord.(?:se|dk|no|fi|com|de))';
31
+ /* if (
32
+ (market.some(market => currentDomain.includes(market)) && environments.some(environment => currentDomain.includes(environment))) ||
33
+ wwwurls.some(domain => currentDomain.includes(domain))
34
+ ) */
35
+ if (currentDomain.match(marketRegex) || currentDomain.match(wwwRegex)) {
36
+ loginUrl = `${currentDomain}/login?returnUrl=`;
37
+ }
38
+ else if (portalAtDomains.some(atdomain => currentDomain.includes(atdomain))) {
39
+ loginUrl = 'https://atportal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';
40
+ }
41
+ else {
42
+ //production portal endpoint
43
+ loginUrl = 'https://portal.postnord.com/api/unified-login/backend/authorization?redirectionUrl=';
44
+ }
45
+ return loginUrl;
46
+ };
@@ -188,6 +188,12 @@ export const PnMarketwebSiteheaderSearch: {
188
188
  new (): PnMarketwebSiteheaderSearch;
189
189
  };
190
190
 
191
+ interface PnMarketwebSiteheaderUnifiedLogin extends Components.PnMarketwebSiteheaderUnifiedLogin, HTMLElement {}
192
+ export const PnMarketwebSiteheaderUnifiedLogin: {
193
+ prototype: PnMarketwebSiteheaderUnifiedLogin;
194
+ new (): PnMarketwebSiteheaderUnifiedLogin;
195
+ };
196
+
191
197
  interface PnParcelTracker extends Components.PnParcelTracker, HTMLElement {}
192
198
  export const PnParcelTracker: {
193
199
  prototype: PnParcelTracker;