@salesforcedevs/docs-components 1.27.22-banner → 1.27.22-banner-6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.27.22-banner",
3
+ "version": "1.27.22-banner-6",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -25,5 +25,5 @@
25
25
  "@types/lodash.orderby": "4.6.9",
26
26
  "@types/lodash.uniqby": "4.7.9"
27
27
  },
28
- "gitHead": "c75e59bd77c2c61b628eb54068cd366f486bd6da"
28
+ "gitHead": "7c2d0518bbabd8ad478bcbca57641b8e7982363a"
29
29
  }
@@ -2,134 +2,232 @@
2
2
  @import "dxHelpers/text";
3
3
 
4
4
  :host {
5
- --doc-banner-bg: var(--neutral-90, #e5e5e5);
6
- --doc-banner-height: 44px;
7
- --doc-banner-padding-x-left: 40px;
8
- --doc-banner-padding-x-right: 24px;
9
- --doc-banner-icon-size: 20px;
10
- --doc-banner-close-icon-size: 14px;
11
- --doc-banner-close-color: #747474;
12
- --doc-banner-primary-bg: #0176d3;
13
- --doc-banner-primary-bg-hover: #0160b3;
14
- }
15
-
16
- .doc-notification-bar {
5
+ display: block;
6
+
7
+ --doc-banner-padding-x-left: var(--dx-g-spacing-2xl);
8
+ --doc-banner-padding-x-right: var(--dx-g-spacing-lg);
9
+ --doc-banner-info-icon-outer-size: var(--dx-g-icon-size-lg-b);
10
+ --doc-banner-info-icon-size: var(--dx-g-icon-size-lg);
11
+ --doc-banner-bar-min-height: calc(
12
+ var(--dx-g-spacing-3xl) - var(--dx-g-spacing-xs)
13
+ );
14
+ --doc-banner-close-wrap-width: calc(
15
+ var(--doc-banner-bar-min-height) + var(--dx-g-spacing-xs)
16
+ );
17
+ --doc-banner-icon-frame-width: calc(
18
+ var(--doc-banner-padding-x-left) +
19
+ var(--doc-banner-info-icon-outer-size) + var(--dx-g-spacing-sm)
20
+ );
21
+ --doc-banner-close-color: var(--dx-g-gray-50);
22
+ --doc-banner-text-vertical-padding: calc(
23
+ (var(--dx-g-spacing-xs) + var(--dx-g-spacing-sm)) / 2
24
+ );
25
+ }
26
+
27
+ :host > div {
17
28
  display: flex;
18
- align-items: center;
29
+ align-items: flex-start;
19
30
  justify-content: space-between;
20
31
  width: 100%;
21
- max-width: 1280px;
22
- height: var(--doc-banner-height);
23
- padding-left: var(--doc-banner-padding-x-left);
24
- padding-right: var(--doc-banner-padding-x-right);
25
- background: var(--doc-banner-bg);
32
+ margin: 0;
33
+ min-height: var(--doc-banner-bar-min-height);
34
+ padding: 0 var(--doc-banner-padding-x-right) 0
35
+ var(--doc-banner-padding-x-left);
36
+ background: var(--dx-g-gray-90);
26
37
  box-sizing: border-box;
27
38
  }
28
39
 
29
- .doc-notification-bar .icon-wrap,
30
- .doc-notification-bar .actions,
31
- .doc-notification-bar .close-wrap {
40
+ .icon-wrap,
41
+ .main,
42
+ .content,
43
+ .actions,
44
+ .close-wrap {
32
45
  display: flex;
33
46
  align-items: center;
47
+ }
48
+
49
+ .icon-wrap,
50
+ .close-wrap {
34
51
  flex-shrink: 0;
35
52
  }
36
53
 
37
- .doc-notification-bar .icon-wrap {
38
- width: 28px;
39
- height: var(--doc-banner-height);
40
- padding-right: var(--dx-g-spacing-sm);
54
+ .main {
55
+ flex: 1 1 0;
56
+ min-width: 0;
57
+ align-self: flex-start;
58
+ padding: var(--doc-banner-text-vertical-padding) 0;
59
+ gap: var(--dx-g-spacing-md);
60
+ flex-wrap: wrap;
61
+ }
62
+
63
+ .icon-wrap {
64
+ width: calc(
65
+ var(--doc-banner-info-icon-outer-size) + var(--dx-g-spacing-sm)
66
+ );
67
+ min-height: var(--dx-g-spacing-xl);
68
+ align-self: flex-start;
69
+ justify-content: flex-start;
70
+ align-items: flex-start;
41
71
  }
42
72
 
43
- .doc-notification-bar .icon-wrap dx-icon {
44
- --dx-c-icon-size: var(--doc-banner-icon-size);
73
+ .icon-wrap dx-icon {
74
+ --dx-c-icon-size: var(--doc-banner-info-icon-size);
45
75
 
46
- width: var(--doc-banner-icon-size);
47
- height: var(--doc-banner-icon-size);
76
+ width: var(--doc-banner-info-icon-size);
77
+ height: var(--doc-banner-info-icon-size);
78
+ margin: calc(var(--dx-g-spacing-sm) + var(--dx-g-spacing-xs))
79
+ var(--dx-g-spacing-sm) 0 0;
48
80
  }
49
81
 
50
- .doc-notification-bar .content {
51
- flex: 1;
82
+ .content {
83
+ flex: 0 1 auto;
52
84
  min-width: 0;
53
- max-width: 1136px;
54
- height: var(--doc-banner-height);
55
- padding: 6px 0;
56
- display: flex;
57
- align-items: center;
58
- box-sizing: border-box;
85
+ max-width: 100%;
86
+ min-height: var(--dx-g-spacing-xl);
87
+ align-items: flex-start;
88
+ gap: var(--dx-g-spacing-sm);
59
89
  }
60
90
 
61
- .doc-notification-bar .message {
91
+ .message {
62
92
  margin: 0;
63
- color: var(--dx-g-neutral-30, #444);
93
+ padding: var(--doc-banner-text-vertical-padding) 0;
94
+ font-size: var(--dx-g-text-sm);
95
+ font-weight: var(--dx-g-font-normal);
96
+ line-height: var(--doc-banner-info-icon-size);
97
+ color: var(--dx-g-gray-30);
64
98
  }
65
99
 
66
- .doc-notification-bar .message a {
100
+ .message a {
67
101
  color: var(--dx-g-cloud-blue-vibrant-50);
68
102
  text-decoration: underline;
69
103
  }
70
104
 
71
- .doc-notification-bar .message a:hover {
105
+ .message a:hover {
72
106
  opacity: 0.9;
73
107
  }
74
108
 
75
- .doc-notification-bar .actions {
76
- width: 215px;
77
- height: 32px;
78
- gap: var(--dx-g-spacing-sm);
109
+ .actions {
110
+ flex-shrink: 0;
111
+ min-height: var(--dx-g-spacing-xl);
112
+ gap: var(--dx-g-spacing-smd);
113
+ flex-wrap: wrap;
79
114
  }
80
115
 
81
- .doc-notification-bar .primary-btn {
82
- --dx-c-button-primary-color: var(--doc-banner-primary-bg);
83
- --dx-c-button-primary-color-hover: var(--doc-banner-primary-bg-hover);
116
+ .primary-btn {
117
+ --dx-c-button-primary-color: var(--dx-g-cloud-blue-vibrant-50);
118
+ --dx-c-button-primary-color-hover: var(--dx-g-cloud-blue-vibrant-40);
84
119
  --dx-c-button-vertical-spacing: 0;
85
120
  --dx-c-button-horizontal-spacing: var(--dx-g-spacing-md);
86
121
 
87
- min-width: 144px;
88
- height: 32px;
89
- border-radius: 4px;
122
+ min-width: min(
123
+ calc(var(--dx-g-spacing-5xl) + var(--dx-g-spacing-3xl)),
124
+ 100%
125
+ );
126
+ height: var(--dx-g-spacing-xl);
127
+ border-radius: var(--dx-g-spacing-xs);
90
128
  }
91
129
 
92
- .doc-notification-bar .primary-btn::part(container) {
93
- min-width: 144px;
130
+ .primary-btn::part(container) {
131
+ min-width: min(
132
+ calc(var(--dx-g-spacing-5xl) + var(--dx-g-spacing-3xl)),
133
+ 100%
134
+ );
94
135
  width: 100%;
95
- height: 32px;
136
+ height: var(--dx-g-spacing-xl);
96
137
  padding: 0 var(--dx-g-spacing-md);
97
- border-radius: 4px;
98
- box-sizing: border-box;
138
+ border-radius: var(--dx-g-spacing-xs);
99
139
  }
100
140
 
101
- .doc-notification-bar .close-wrap {
141
+ .close-wrap {
142
+ align-self: flex-start;
102
143
  justify-content: center;
103
- width: 52px;
104
- height: var(--doc-banner-height);
144
+ align-items: center;
145
+ width: var(--doc-banner-close-wrap-width);
146
+ height: var(--doc-banner-bar-min-height);
147
+ padding: var(--dx-g-spacing-smd) var(--dx-g-spacing-sm)
148
+ var(--dx-g-spacing-md);
149
+ margin-left: auto;
150
+ box-sizing: border-box;
151
+ cursor: pointer;
105
152
  }
106
153
 
107
- .doc-notification-bar .close {
154
+ .close-wrap .close-btn {
155
+ width: 100%;
156
+ height: 100%;
108
157
  display: flex;
109
158
  align-items: center;
110
159
  justify-content: center;
111
- width: 100%;
112
- height: 100%;
113
- padding: 2.9px;
114
- margin: 0;
115
- color: var(--doc-banner-close-color);
116
- background: none;
117
- border: none;
118
- cursor: pointer;
119
- border-radius: 0;
160
+ pointer-events: none;
120
161
  box-sizing: border-box;
121
- }
122
-
123
- .doc-notification-bar .close:hover {
124
- background: rgb(0 0 0 / 5%);
125
- }
126
-
127
- .doc-notification-bar .close svg {
128
- width: var(--doc-banner-close-icon-size);
129
- height: var(--doc-banner-close-icon-size);
130
- flex-shrink: 0;
131
- }
132
-
133
- .doc-notification-bar .close svg path {
134
- stroke: currentcolor;
162
+ padding: 2.9038px 0 0 2.9038px;
163
+
164
+ --dx-c-icon-size: var(--dx-g-icon-size-sm);
165
+ --dx-c-button-custom-color: var(--doc-banner-close-color);
166
+ --dx-c-button-custom-color-hover: var(--doc-banner-close-color);
167
+ --dx-c-button-custom-background: transparent;
168
+ --dx-c-button-custom-background-hover: rgb(0 0 0 / 5%);
169
+ --dx-c-button-custom-border: 1px solid transparent;
170
+ --dx-c-button-custom-border-hover: 1px solid transparent;
171
+ }
172
+
173
+ @media (max-width: 1279px) {
174
+ :host {
175
+ --doc-banner-padding-x-left: var(--dx-g-spacing-xl);
176
+ --doc-banner-padding-x-right: var(--dx-g-spacing-md);
177
+ }
178
+
179
+ :host > div {
180
+ position: relative;
181
+ max-width: 100%;
182
+ min-height: calc(
183
+ var(--doc-banner-bar-min-height) + var(--dx-g-spacing-xl)
184
+ );
185
+ flex-wrap: wrap;
186
+ align-content: space-between;
187
+ padding: 0 var(--doc-banner-padding-x-right) 0 0;
188
+ }
189
+
190
+ .icon-wrap {
191
+ position: absolute;
192
+ left: 0;
193
+ top: 0;
194
+ bottom: 0;
195
+ width: var(--doc-banner-icon-frame-width);
196
+ min-height: 0;
197
+ padding: 0 0 0 var(--doc-banner-padding-x-left);
198
+ order: 0;
199
+ }
200
+
201
+ .main {
202
+ order: 1;
203
+ flex-wrap: wrap;
204
+ margin-left: var(--doc-banner-icon-frame-width);
205
+ gap: var(--dx-g-spacing-2xs);
206
+ }
207
+
208
+ .content {
209
+ order: 0;
210
+ }
211
+
212
+ .close-wrap {
213
+ order: 2;
214
+ min-height: var(--doc-banner-bar-min-height);
215
+ }
216
+
217
+ .actions {
218
+ order: 1;
219
+ flex: 0 0 100%;
220
+ width: 100%;
221
+ }
222
+ }
223
+
224
+ @media (max-width: 768px) {
225
+ :host {
226
+ --doc-banner-padding-x-left: var(--dx-g-spacing-lg);
227
+ --doc-banner-padding-x-right: var(--dx-g-spacing-sm);
228
+ }
229
+
230
+ :host > div {
231
+ min-height: var(--doc-banner-bar-min-height);
232
+ }
135
233
  }
@@ -1,70 +1,76 @@
1
1
  <template>
2
- <div class="doc-notification-bar" part="container">
3
- <div class="icon-wrap" part="icon-wrap">
4
- <dx-icon symbol="info" part="icon" color="#9E9E9E"></dx-icon>
5
- </div>
6
- <div class="content" part="content">
7
- <p class="message dx-text-body-4" part="message">
8
- <template lwc:if={messageText}>{messageText}</template>
9
- <template lwc:if={hasMessageLink}>
10
- <a
11
- href={messageLinkUrl}
12
- target="_blank"
13
- rel="noopener noreferrer"
14
- part="message-link"
15
- >
16
- {messageLinkText}
17
- </a>
18
- </template>
19
- </p>
20
- </div>
21
- <div class="actions" part="actions">
22
- <template lwc:if={hasPrimaryButton}>
23
- <dx-button
24
- class="primary-btn"
25
- href={buttonHref}
26
- variant="primary"
27
- size="small"
28
- part="button"
29
- >
30
- {buttonLabel}
31
- </dx-button>
32
- </template>
33
- <template lwc:if={hasSecondaryAction}>
34
- <dx-button
35
- variant="inline"
36
- onclick={handleSecondaryClick}
37
- part="secondary"
38
- >
39
- {secondaryLabel}
40
- </dx-button>
41
- </template>
42
- </div>
43
- <template lwc:if={showCloseButton}>
44
- <div class="close-wrap" part="close-wrap">
45
- <button
46
- type="button"
47
- class="close"
48
- part="close"
2
+ <template lwc:if={showBanner}>
3
+ <div class="doc-notification-bar" part="container">
4
+ <div class="icon-wrap" part="icon-wrap">
5
+ <dx-icon
6
+ symbol="info"
7
+ size="override"
8
+ part="icon"
9
+ color={iconColor}
10
+ ></dx-icon>
11
+ </div>
12
+ <div class="main" part="main">
13
+ <div class="content" part="content">
14
+ <p class="message dx-text-body-4" part="message">
15
+ <template lwc:if={messageText}>{messageText}</template>
16
+ <template lwc:if={hasMessageLink}>
17
+ <a
18
+ href={messageLinkUrl}
19
+ target="_blank"
20
+ rel="noopener noreferrer"
21
+ part="message-link"
22
+ >
23
+ {messageLinkText}
24
+ </a>
25
+ </template>
26
+ </p>
27
+ </div>
28
+ <div class="actions" part="actions">
29
+ <template lwc:if={hasPrimaryButton}>
30
+ <dx-button
31
+ class="primary-btn"
32
+ href={buttonHref}
33
+ variant="primary"
34
+ size="small"
35
+ part="button"
36
+ >
37
+ {buttonLabel}
38
+ </dx-button>
39
+ </template>
40
+ <template lwc:if={hasSecondaryAction}>
41
+ <dx-button
42
+ class="secondary-btn"
43
+ variant="inline"
44
+ onclick={handleSecondaryClick}
45
+ part="secondary"
46
+ >
47
+ {secondaryLabel}
48
+ </dx-button>
49
+ </template>
50
+ </div>
51
+ </div>
52
+ <template lwc:if={showCloseButton}>
53
+ <div
54
+ class="close-wrap"
55
+ part="close-wrap"
56
+ role="button"
57
+ tabindex="0"
49
58
  aria-label="Close"
50
59
  onclick={handleCloseClick}
60
+ onkeydown={handleCloseKeydown}
51
61
  >
52
- <svg
53
- width="14"
54
- height="14"
55
- viewBox="0 0 14 14"
56
- fill="none"
57
- xmlns="http://www.w3.org/2000/svg"
62
+ <dx-button
63
+ class="close-btn"
64
+ variant="icon-only"
65
+ icon-symbol="close"
66
+ icon-size="override"
67
+ icon-color={iconColor}
58
68
  aria-hidden="true"
59
- >
60
- <path
61
- d="M1 1L13 13M13 1L1 13"
62
- stroke-width="2"
63
- stroke-linecap="round"
64
- />
65
- </svg>
66
- </button>
67
- </div>
68
- </template>
69
- </div>
69
+ tabindex="-1"
70
+ part="close"
71
+ ></dx-button>
72
+ </div>
73
+ </template>
74
+ </div>
75
+ </template>
70
76
  </template>
@@ -1,20 +1,27 @@
1
- import { LightningElement, api } from "lwc";
1
+ import { LightningElement, api, track } from "lwc";
2
2
  import { normalizeBoolean } from "dxUtils/normalizers";
3
3
 
4
+ const LOCALE_BANNER_STORAGE_PREFIX = "dsc-doc-locale-banner-dismissed-";
5
+
6
+ const DEFAULT_MESSAGE_TEXT = "This page was machine-translated ";
7
+ const DEFAULT_BUTTON_LABEL = "Switch to English";
8
+
4
9
  export default class Banner extends LightningElement {
5
- @api messageText = "";
10
+ @api messageText = DEFAULT_MESSAGE_TEXT;
6
11
 
7
12
  @api messageLinkUrl = "";
8
13
 
9
14
  @api messageLinkText = "here";
10
15
 
11
- @api buttonLabel = "";
16
+ @api buttonLabel = DEFAULT_BUTTON_LABEL;
12
17
 
13
18
  @api buttonHref = "";
14
19
 
15
20
  @api secondaryLabel = "";
16
21
 
17
- _showCloseButton = false;
22
+ @api dismissStorageKey = "";
23
+
24
+ _showCloseButton = true;
18
25
 
19
26
  @api
20
27
  get showCloseButton(): boolean {
@@ -24,6 +31,25 @@ export default class Banner extends LightningElement {
24
31
  this._showCloseButton = normalizeBoolean(value);
25
32
  }
26
33
 
34
+ @track private _dismissed = false;
35
+
36
+ connectedCallback() {
37
+ if (
38
+ this.dismissStorageKey &&
39
+ typeof window !== "undefined" &&
40
+ window.sessionStorage
41
+ ) {
42
+ this._dismissed =
43
+ window.sessionStorage.getItem(
44
+ `${LOCALE_BANNER_STORAGE_PREFIX}${this.dismissStorageKey}`
45
+ ) === "true";
46
+ }
47
+ }
48
+
49
+ get showBanner(): boolean {
50
+ return !this._dismissed;
51
+ }
52
+
27
53
  get hasMessageLink(): boolean {
28
54
  return !!this.messageLinkUrl;
29
55
  }
@@ -36,15 +62,48 @@ export default class Banner extends LightningElement {
36
62
  return !!this.secondaryLabel;
37
63
  }
38
64
 
65
+ get iconColor(): string {
66
+ return "gray-50";
67
+ }
68
+
69
+ persistDismissAndHide() {
70
+ if (
71
+ this.dismissStorageKey &&
72
+ typeof window !== "undefined" &&
73
+ window.sessionStorage
74
+ ) {
75
+ window.sessionStorage.setItem(
76
+ `${LOCALE_BANNER_STORAGE_PREFIX}${this.dismissStorageKey}`,
77
+ "true"
78
+ );
79
+ }
80
+ this._dismissed = true;
81
+ }
82
+
39
83
  handleSecondaryClick() {
84
+ this.persistDismissAndHide();
40
85
  this.dispatchEvent(
41
- new CustomEvent("dismiss", { bubbles: true, composed: true })
86
+ new CustomEvent("dismissLocaleBanner", {
87
+ bubbles: true,
88
+ composed: true
89
+ })
42
90
  );
43
91
  }
44
92
 
45
93
  handleCloseClick() {
94
+ this.persistDismissAndHide();
46
95
  this.dispatchEvent(
47
- new CustomEvent("dismiss", { bubbles: true, composed: true })
96
+ new CustomEvent("dismissLocaleBanner", {
97
+ bubbles: true,
98
+ composed: true
99
+ })
48
100
  );
49
101
  }
102
+
103
+ handleCloseKeydown(event: KeyboardEvent) {
104
+ if (event.key === "Enter" || event.key === " ") {
105
+ event.preventDefault();
106
+ this.handleCloseClick();
107
+ }
108
+ }
50
109
  }
@@ -57,7 +57,10 @@
57
57
  </div>
58
58
  </div>
59
59
  <div lwc:if={showFooter} class="footer-container">
60
- <dx-footer variant="no-signup"></dx-footer>
60
+ <dx-footer
61
+ variant="no-signup"
62
+ mfe-config-origin={effectiveFooterOrigin}
63
+ ></dx-footer>
61
64
  </div>
62
65
  </div>
63
66
  </div>
@@ -1,3 +1,4 @@
1
+ import { api } from "lwc";
1
2
  import ContentLayout from "doc/contentLayout";
2
3
  import cx from "classnames";
3
4
 
@@ -15,6 +16,16 @@ export default class LwcContentLayout extends ContentLayout {
15
16
  private allTabsCache: any[] | null = null;
16
17
  private mainSlotCache: any = null;
17
18
 
19
+ /** Optional origin URL for the footer MFE (e.g. wp-json endpoint). Passed through to dx-footer. */
20
+ @api origin: string | null = null;
21
+
22
+ /** When origin is provided, pass it to the footer; otherwise use dx-footer's default. */
23
+ get effectiveFooterOrigin(): string {
24
+ return (
25
+ this.origin ?? `${window.location.origin}/developer/en-us/wp-json`
26
+ );
27
+ }
28
+
18
29
  private setRNBByTab() {
19
30
  const tabPanelListItem = this.getTabPanelList();
20
31
  this.rnbByTab = tabPanelListItem?.id === RNB_BY_TAB;
@@ -68,6 +68,16 @@ export default class RedocReference extends LightningElement {
68
68
  this._parentDocPhaseInfo = value;
69
69
  }
70
70
 
71
+ /** Optional origin URL for the footer MFE (e.g. wp-json endpoint). Passed through to dx-footer. */
72
+ @api origin: string | null = null;
73
+
74
+ /** When origin is provided, pass it to the footer; otherwise use dx-footer's default. */
75
+ get effectiveFooterOrigin(): string {
76
+ return (
77
+ this.origin ?? `${window.location.origin}/developer/en-us/wp-json`
78
+ );
79
+ }
80
+
71
81
  connectedCallback(): void {
72
82
  window.addEventListener("scroll", this.handleScrollAndResize);
73
83
  window.addEventListener("resize", this.handleScrollAndResize);
@@ -338,7 +348,7 @@ export default class RedocReference extends LightningElement {
338
348
  // Appends footer component to container
339
349
  private insertFooter(container: HTMLElement): void {
340
350
  const footerElement = createElement("dx-footer", { is: DxFooter });
341
- Object.assign(footerElement, { variant: "no-signup" });
351
+ Object.assign(footerElement, { variant: "no-signup", mfeConfigOrigin: this.effectiveFooterOrigin });
342
352
  container.appendChild(footerElement);
343
353
  }
344
354
 
@@ -48,6 +48,9 @@ export default class DocXmlContent extends LightningElementWithState<{
48
48
  /** Optional origin URL for the footer MFE (e.g. wp-json endpoint). Passed through to dx-footer-mfe. */
49
49
  @api origin: string | null = null;
50
50
 
51
+ /** Optional base URL for the canonical link (e.g. https://developer.salesforce.com). When set, used instead of window.location for the canonical href. */
52
+ @api baseUrl: string | null = null;
53
+
51
54
  @api
52
55
  get allLanguages(): Array<Language> {
53
56
  return this._allLanguages;
@@ -766,21 +769,19 @@ export default class DocXmlContent extends LightningElementWithState<{
766
769
  }
767
770
 
768
771
  if (this.pageReference) {
769
- const metadescription = document.querySelector(
772
+ const canonicalLink = document.querySelector(
770
773
  'link[rel="canonical"]'
771
774
  );
772
- if (metadescription) {
775
+ if (canonicalLink) {
773
776
  const copyPageReference = { ...this.pageReference };
774
777
  copyPageReference.docId = copyPageReference.docId
775
778
  ? this.dropVersionFromDocId(copyPageReference.docId)
776
779
  : copyPageReference.docId;
777
- metadescription.setAttribute(
778
- "href",
779
- window.location.protocol +
780
- "//" +
781
- window.location.host +
782
- this.pageReferenceToString(copyPageReference)
783
- );
780
+ const path = this.pageReferenceToString(copyPageReference);
781
+ const origin = this.baseUrl
782
+ ? this.baseUrl.replace(/\/$/, "")
783
+ : `${window.location.protocol}//${window.location.host}`;
784
+ canonicalLink.setAttribute("href", `${origin}${path}`);
784
785
  }
785
786
  }
786
787
 
@@ -125,7 +125,7 @@ dx-toc {
125
125
  max-width: 1000px;
126
126
  flex: 1;
127
127
  width: 0;
128
- word-break: break-word;
128
+ overflow-wrap: break-word;
129
129
  }
130
130
 
131
131
  .is-sticky {