@salesforcedevs/docs-components 1.3.104-alpha03 → 1.3.105-image-resizing-1

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.3.104-alpha03",
3
+ "version": "1.3.105-image-resizing-1",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -7,6 +7,7 @@
7
7
  @import "dxHelpers/text";
8
8
  @import "dxHelpers/reset";
9
9
  @import "dxHelpers/table";
10
+ @import "docHelpers/imgStyle";
10
11
 
11
12
  .doc-content {
12
13
  width: 100%;
@@ -49,8 +50,6 @@ img.content-image {
49
50
  margin-top: var(--dx-g-spacing-lg);
50
51
  margin-bottom: var(--dx-g-spacing-sm);
51
52
  display: block;
52
- margin-left: auto;
53
- margin-right: auto;
54
53
  }
55
54
 
56
55
  td > img.content-image:first-child:last-child[alt="Yes"],
@@ -111,6 +110,10 @@ h6 {
111
110
  margin: var(--dx-g-spacing-sm) 0 var(--dx-g-spacing-sm) 0;
112
111
  }
113
112
 
113
+ img {
114
+ image-rendering: -webkit-optimize-contrast;
115
+ }
116
+
114
117
  p,
115
118
  .p {
116
119
  font-family: var(--dx-g-font-sans);
@@ -366,13 +369,30 @@ ul ul ul ul ul ul {
366
369
  margin: var(--dx-g-spacing-lg) 0;
367
370
  }
368
371
 
369
- figure {
372
+ figure,
373
+ .fig {
370
374
  margin: var(--dx-g-spacing-lg) 0;
375
+ text-align: left;
376
+ display: flex;
377
+ flex-direction: column;
378
+ align-items: left;
379
+ justify-content: left;
371
380
  }
372
381
 
373
- figcaption {
382
+ figcaption,
383
+ .figcap {
384
+ display: block;
374
385
  font-size: var(--dx-g-text-xs);
375
- margin-top: var(--dx-g-spacing-sm);
386
+ margin: var(--dx-g-spacing-sm) 0;
387
+ order: 2;
388
+ }
389
+
390
+ .figcap .image {
391
+ order: 1;
392
+ }
393
+
394
+ .fig.fig-centered {
395
+ text-align: center;
376
396
  }
377
397
 
378
398
  code,
@@ -253,6 +253,7 @@ export default class Content extends LightningElement {
253
253
  const label = mediaEl.getAttribute("label");
254
254
  const width = mediaEl.getAttribute("width");
255
255
  const height = mediaEl.getAttribute("height");
256
+ const className = mediaEl.getAttribute("class");
256
257
 
257
258
  if (isImage) {
258
259
  src = src.startsWith("/")
@@ -277,8 +278,11 @@ export default class Content extends LightningElement {
277
278
  if (width) {
278
279
  img.width = parseFloat(width);
279
280
  }
281
+ if (className) {
282
+ img.className = className;
283
+ }
280
284
 
281
- img.className = "content-image";
285
+ img.className = `content-image ${img.className}`;
282
286
  mediaEl.parentNode!.insertBefore(img, mediaEl);
283
287
  } else {
284
288
  const contentMediaEl = createElement("doc-content-media", {
@@ -324,9 +328,8 @@ export default class Content extends LightningElement {
324
328
  event.preventDefault();
325
329
  // eslint-disable-next-line no-use-before-define
326
330
  const target = event.currentTarget.dataset.id;
327
- const [page, docId, deliverable, tempContentDocumentId] = target.split(
328
- "/"
329
- );
331
+ const [page, docId, deliverable, tempContentDocumentId] =
332
+ target.split("/");
330
333
  const [contentDocumentId, hash] = tempContentDocumentId.split("#");
331
334
  const newPageReference = {
332
335
  page: page,
@@ -43,14 +43,12 @@ dx-toc {
43
43
  .content-body-container {
44
44
  display: flex;
45
45
  flex-direction: row;
46
- justify-content: center;
47
- max-width: var(--dx-g-doc-content-max-width);
48
- margin: auto;
49
- padding: 0 var(--dx-g-header-padding-horizontal);
46
+ padding-right: var(--dx-g-page-padding-horizontal);
50
47
  }
51
48
 
52
49
  .content-body {
53
- margin: var(--dx-g-spacing-sm) 0 var(--dx-g-spacing-xl);
50
+ margin: var(--dx-g-spacing-sm) var(--dx-c-content-vertical-spacing)
51
+ var(--dx-g-spacing-xl);
54
52
  flex: 1;
55
53
  width: 0;
56
54
  }
@@ -58,11 +56,11 @@ dx-toc {
58
56
  .is-sticky {
59
57
  height: 100vh;
60
58
  position: sticky;
61
- top: 135px;
59
+ top: 0;
62
60
  }
63
61
 
64
62
  .right-nav-bar {
65
- margin-left: var(--dx-c-content-vertical-spacing);
63
+ max-width: 275px;
66
64
  }
67
65
 
68
66
  @media screen and (max-width: 1024px) {
@@ -37,8 +37,9 @@
37
37
  if:true={shouldDisplayFeedback}
38
38
  ></doc-sprig-survey>
39
39
  </div>
40
- <div if:true={showToc} class="right-nav-bar is-sticky">
40
+ <div class="right-nav-bar is-sticky">
41
41
  <dx-toc
42
+ if:true={showToc}
42
43
  title={tocTitle}
43
44
  options={tocOptions}
44
45
  value={tocValue}
@@ -82,7 +82,7 @@ header:not(.has-brand) > .header_l2 {
82
82
 
83
83
  .header_l2_group-title {
84
84
  margin-right: 0;
85
- padding: var(--dx-g-spacing-smd) var(--dx-g-header-padding-horizontal);
85
+ padding: var(--dx-g-spacing-smd) var(--dx-g-page-padding-horizontal);
86
86
  }
87
87
 
88
88
  .header_l2_group-title .header_lang-dropdown {
@@ -6,6 +6,77 @@
6
6
  if:true={showBanner}
7
7
  banner-markup={bannerMarkup}
8
8
  ></dx-banner>
9
+ <div class="header_l1">
10
+ <div if:true={showMenuButton} class="nav_menu-ctas">
11
+ <dx-button
12
+ aria-label="Menu Button"
13
+ class="nav_menu-button"
14
+ icon-size="large"
15
+ icon-symbol={mobileMenuIconSymbol}
16
+ variant="tertiary"
17
+ onclick={toggleMobileNavMenu}
18
+ ></dx-button>
19
+ </div>
20
+ <dx-logo label={title}></dx-logo>
21
+ <dx-header-nav
22
+ if:true={showDesktopNavItems}
23
+ aria-label="Global Navigation Bar"
24
+ nav-items={navItems}
25
+ onrequestopennavmenu={onRequestOpenNavMenu}
26
+ pathname={pathname}
27
+ variant="small"
28
+ ></dx-header-nav>
29
+ <div class="header-cta-container">
30
+ <dx-header-search
31
+ if:true={hasSearch}
32
+ coveo-organization-id={coveoOrganizationId}
33
+ coveo-public-access-token={coveoPublicAccessToken}
34
+ coveo-search-pipeline={coveoSearchPipeline}
35
+ coveo-search-hub={coveoSearchHub}
36
+ mobile={tablet}
37
+ onstatechange={handleStateChange}
38
+ ></dx-header-search>
39
+ </div>
40
+ <div
41
+ if:true={showTbidLogin}
42
+ class="header-tbid-login"
43
+ onclick={closeMobileNavMenu}
44
+ >
45
+ <dw-tbid-login-menu
46
+ tbid-api-base-url={tbidApiBaseUrl}
47
+ tbid-base-url={tbidBaseUrl}
48
+ ></dw-tbid-login-menu>
49
+ </div>
50
+ <div if:true={showSignup} class="header-login-signup">
51
+ <dx-button
52
+ aria-label="Browse Trials"
53
+ size="small"
54
+ href={signupLink}
55
+ onclick={handleSignUpClick}
56
+ >
57
+ Browse Trials
58
+ </dx-button>
59
+ </div>
60
+ <dx-header-mobile-nav-menu
61
+ if:true={hasNavItems}
62
+ nav-items={navItems}
63
+ open={showMobileNavMenu}
64
+ pathname={pathname}
65
+ value={mobileNavMenuValue}
66
+ onchange={onMobileNavMenuChange}
67
+ onrequestclose={closeMobileNavMenu}
68
+ >
69
+ <dx-button
70
+ aria-label={bailLabel}
71
+ if:true={hasBailLink}
72
+ href={bailHref}
73
+ variant="tertiary"
74
+ icon-symbol="new_window"
75
+ >
76
+ {bailLabel}
77
+ </dx-button>
78
+ </dx-header-mobile-nav-menu>
79
+ </div>
9
80
  <div class="header_l2">
10
81
  <div class="header_l2_group header_l2_group-title">
11
82
  <a href={headerHref} class="home-link">
@@ -59,6 +59,20 @@ export default class Header extends HeaderBase {
59
59
  return this.scopedNavItems && this.scopedNavItems.length > 0;
60
60
  }
61
61
 
62
+ private get showDesktopNavItems(): boolean {
63
+ return !this.mobile && this.hasNavItems;
64
+ }
65
+
66
+ private get showTbidLogin(): boolean {
67
+ return this.showSignup;
68
+ }
69
+
70
+ private get showSignup(): boolean {
71
+ return this.signupLink
72
+ ? (this.tablet && !this.isSearchOpen) || !this.tablet
73
+ : false;
74
+ }
75
+
62
76
  private get hasLanguages(): boolean {
63
77
  return !!(this.languages && this.languages.length);
64
78
  }
@@ -77,6 +91,10 @@ export default class Header extends HeaderBase {
77
91
  );
78
92
  }
79
93
 
94
+ private get showMenuButton(): boolean {
95
+ return this.mobile && this.hasNavItems;
96
+ }
97
+
80
98
  connectedCallback(): void {
81
99
  super.connectedCallback();
82
100
  this.tabletMatchMedia = window.matchMedia(
@@ -5,15 +5,9 @@
5
5
  .doc-phase-container {
6
6
  display: flex;
7
7
  flex-direction: column;
8
- align-items: center;
9
- padding-left: var(--dx-g-header-padding-horizontal);
10
- padding-right: var(--dx-g-header-padding-horizontal);
8
+ padding-left: var(--dx-g-spacing-3xl);
9
+ padding-right: var(--dx-g-spacing-3xl);
11
10
  width: 100%;
12
- border: none;
13
- }
14
-
15
- .max-width-container {
16
- max-width: var(--dx-g-doc-content-max-width);
17
11
  }
18
12
 
19
13
  .doc-phase-title-container {
@@ -37,7 +31,6 @@ dx-button {
37
31
  */
38
32
 
39
33
  .doc-phase-body {
40
- display: block;
41
34
  max-height: 1000px;
42
35
  overflow: hidden;
43
36
  padding-top: var(--dx-g-spacing-smd);
@@ -1,30 +1,28 @@
1
1
  <template>
2
2
  <div class={className} part="container">
3
- <div class="max-width-container">
4
- <div class="doc-phase-title-container">
5
- <dx-icon
6
- class="doc-status-icon doc-phase-icon"
7
- symbol="recipe"
8
- size="large"
9
- color="status-icon-color"
10
- ></dx-icon>
11
- <p class="doc-status-title doc-phase-title dx-text-body-3">
12
- {docPhaseTitle}
13
- </p>
14
- <dx-button
15
- variant="inline"
16
- onclick={onButtonClick}
17
- aria-label={hideBodyText}
18
- >
19
- {hideBodyText}
20
- </dx-button>
21
- </div>
22
- <!--
3
+ <div class="doc-phase-title-container">
4
+ <dx-icon
5
+ class="doc-status-icon doc-phase-icon"
6
+ symbol="recipe"
7
+ size="large"
8
+ color="status-icon-color"
9
+ ></dx-icon>
10
+ <p class="doc-status-title doc-phase-title dx-text-body-3">
11
+ {docPhaseTitle}
12
+ </p>
13
+ <dx-button
14
+ variant="inline"
15
+ onclick={onButtonClick}
16
+ aria-label={hideBodyText}
17
+ >
18
+ {hideBodyText}
19
+ </dx-button>
20
+ </div>
21
+ <!--
23
22
  NOTE: Here we are rendering mark up using lwc:dom & innerHTML
24
23
  option instead of slots because the html markup will come as a
25
24
  property to the component from a configuration
26
25
  -->
27
- <span lwc:dom="manual" class={bodyClassName}></span>
28
- </div>
26
+ <span lwc:dom="manual" class={bodyClassName}></span>
29
27
  </div>
30
28
  </template>
@@ -0,0 +1,58 @@
1
+ .content-image.image-framed {
2
+ border: 1px solid black;
3
+ }
4
+
5
+ .content-image.image-framed-light {
6
+ border: 1px solid var(--dx-g-gray-90);
7
+ }
8
+
9
+ .content-image.image-xxl,
10
+ .content-image.image-full {
11
+ max-width: 1000px;
12
+ width: 100%;
13
+ }
14
+
15
+ .content-image.image-xl {
16
+ max-width: 750px;
17
+ width: 100%;
18
+ }
19
+
20
+ .content-image.image-lg {
21
+ max-width: 660px;
22
+ width: 100%;
23
+ }
24
+
25
+ .content-image.image-md {
26
+ max-width: 500px;
27
+ width: 100%;
28
+ }
29
+
30
+ .content-image.image-sm {
31
+ max-width: 330px;
32
+ width: 100%;
33
+ }
34
+
35
+ .content-image.image-xs {
36
+ max-width: 250px;
37
+ width: 100%;
38
+ }
39
+
40
+ .content-image.image-xxs {
41
+ max-width: 125px;
42
+ width: 100%;
43
+ }
44
+
45
+ .content-image.image-icon-lg {
46
+ max-width: 32px;
47
+ width: 100%;
48
+ }
49
+
50
+ .content-image.image-icon-md {
51
+ max-width: 20px;
52
+ width: 100%;
53
+ }
54
+
55
+ .content-image.image-icon-sm {
56
+ max-width: 16px;
57
+ width: 100%;
58
+ }