@salesforcedevs/docs-components 1.3.104 → 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",
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",
@@ -24,5 +24,5 @@
24
24
  "@types/lodash.orderby": "^4.6.7",
25
25
  "@types/lodash.uniqby": "^4.7.7"
26
26
  },
27
- "gitHead": "ebf2666c47ab115c2a14383eb6961fb990fd77d3"
27
+ "gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
28
28
  }
@@ -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,
@@ -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
+ }
package/LICENSE DELETED
@@ -1,12 +0,0 @@
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.