@salesforcedevs/docs-components 1.3.20-content-image-1 → 1.3.22

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/LICENSE ADDED
@@ -0,0 +1,12 @@
1
+ Copyright (c) 2020, Salesforce.com, Inc.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
+
6
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
+
8
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
+
10
+ * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.20-content-image-1",
3
+ "version": "1.3.22",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -24,5 +24,5 @@
24
24
  "@types/lodash.orderby": "^4.6.7",
25
25
  "@types/lodash.uniqby": "^4.7.7"
26
26
  },
27
- "gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
27
+ "gitHead": "78accbacab7e5ff5cc7cf327092884064a86d78f"
28
28
  }
@@ -25,6 +25,7 @@ import {
25
25
  REFERENCE_TYPES,
26
26
  oldReferenceIdNewReferenceIdMap
27
27
  } from "./constants";
28
+ import { restoreScroll } from "dx/scrollManager";
28
29
 
29
30
  export default class AmfReference extends LightningElement {
30
31
  @api breadcrumbs?: string | null | undefined = null;
@@ -138,7 +139,6 @@ export default class AmfReference extends LightningElement {
138
139
  protected _amfConfigMap: Map<string, AmfConfig> = new Map();
139
140
  protected _referenceSetConfig!: ReferenceSetConfig;
140
141
  protected _currentReferenceId = "";
141
- protected _scrollInterval = 0;
142
142
 
143
143
  protected parentReferenceUrls = [];
144
144
  protected amfMap: Record<string, AmfModelRecord> = {};
@@ -182,9 +182,6 @@ export default class AmfReference extends LightningElement {
182
182
  "popstate",
183
183
  this._boundUpdateSelectedItemFromUrlQuery
184
184
  );
185
- this._scrollInterval = window.setInterval(() => {
186
- this.saveScroll();
187
- }, 1000);
188
185
  }
189
186
 
190
187
  disconnectedCallback(): void {
@@ -196,20 +193,6 @@ export default class AmfReference extends LightningElement {
196
193
  "popstate",
197
194
  this._boundUpdateSelectedItemFromUrlQuery
198
195
  );
199
- window.clearInterval(this._scrollInterval);
200
- }
201
-
202
- saveScroll() {
203
- window.history.replaceState(
204
- { scrollValue: document.body.scrollTop },
205
- "",
206
- window.location.href
207
- );
208
- }
209
-
210
- restoreScroll() {
211
- document.body.scrollTop = document.documentElement.scrollTop =
212
- window.history.state?.scrollValue;
213
196
  }
214
197
 
215
198
  renderedCallback(): void {
@@ -841,7 +824,7 @@ export default class AmfReference extends LightningElement {
841
824
  this.loadMarkdownBasedReference();
842
825
  }
843
826
 
844
- this.restoreScroll();
827
+ restoreScroll(); // don't try this at home kids
845
828
  }
846
829
 
847
830
  /**
@@ -849,8 +832,6 @@ export default class AmfReference extends LightningElement {
849
832
  * @param event
850
833
  */
851
834
  protected onApiNavigationChanged(): void {
852
- this.saveScroll();
853
-
854
835
  const specBasedReference = this.isSpecBasedReference(
855
836
  this._currentReferenceId
856
837
  );
@@ -1280,8 +1261,6 @@ export default class AmfReference extends LightningElement {
1280
1261
  }
1281
1262
 
1282
1263
  onNavSelect(event: CustomEvent): void {
1283
- this.saveScroll();
1284
-
1285
1264
  const name = event.detail.name;
1286
1265
  if (name) {
1287
1266
  const urlReferenceId = this.getReferenceIdFromUrl(name);
@@ -59,6 +59,11 @@ img.content-image {
59
59
  margin-right: auto;
60
60
  }
61
61
 
62
+ td > img.content-image:first-child:last-child[alt="Yes"],
63
+ td > img.content-image:first-child:last-child[alt="No"] {
64
+ width: var(--dx-g-spacing-md);
65
+ }
66
+
62
67
  h1 {
63
68
  font-family: var(--dx-g-font-display);
64
69
  font-size: var(--dx-g-text-4xl);
@@ -278,6 +283,27 @@ a:hover,
278
283
  text-decoration: underline;
279
284
  }
280
285
 
286
+ @media (max-width: 640px) {
287
+ /* Mobile */
288
+ img.content-image {
289
+ max-width: 95vw;
290
+ }
291
+ }
292
+
293
+ @media (min-width: 641px) {
294
+ /* Tablet (medium) */
295
+ img.content-image {
296
+ max-width: 80vw;
297
+ }
298
+ }
299
+
300
+ @media (min-width: 769px) {
301
+ /* Desktop */
302
+ img.content-image {
303
+ max-width: min(60vw, 650px);
304
+ }
305
+ }
306
+
281
307
  ul,
282
308
  ol {
283
309
  margin-left: var(--dx-g-spacing-lg);
@@ -264,6 +264,7 @@ export default class Content extends LightningElement {
264
264
 
265
265
  const img: HTMLImageElement = document.createElement("img");
266
266
  img.src = src;
267
+ img.alt = "";
267
268
  if (alt) {
268
269
  img.alt = alt;
269
270
  }
@@ -148,10 +148,6 @@ export default class ContentLayout extends LightningElement {
148
148
  this.searchSyncer.init();
149
149
  }
150
150
 
151
- this._scrollInterval = window.setInterval(() => {
152
- this.saveScroll();
153
- }, 1000);
154
-
155
151
  document.addEventListener(
156
152
  "scroll",
157
153
  this.scrollThresholdHandler.bind(this)
@@ -188,14 +184,6 @@ export default class ContentLayout extends LightningElement {
188
184
  document.removeEventListener("scroll", this.scrollThresholdHandler);
189
185
  }
190
186
 
191
- saveScroll() {
192
- window.history.replaceState(
193
- { scrollValue: document.body.scrollTop },
194
- "",
195
- window.location.href
196
- );
197
- }
198
-
199
187
  restoreScroll() {
200
188
  document.body.scrollTop = document.documentElement.scrollTop =
201
189
  window.history.state?.scrollValue;