@gudhub/ssg-web-components-library 1.0.48 → 1.0.50

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": "@gudhub/ssg-web-components-library",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -13,17 +13,20 @@ class ContentsComponent extends GHComponent {
13
13
  this.newHeadings = [];
14
14
  const fullUrl = new URL('http://website.com' + window.location.search);
15
15
  const url = fullUrl.searchParams.get('path');
16
- for (let h in this.headings) {
16
+ for (const heading of this.headings) {
17
17
  let div = document.createElement('div');
18
- div.innerHTML = this.headings[h].text;
19
- let text = div.querySelector('a') ? div.querySelector('a').innerText : this.headings[h].text;
18
+ div.innerHTML = heading.text;
19
+
20
+ const linkInside = div.querySelector('a');
21
+ let text = linkInside ? `<span>${linkInside.innerText}</span>` : heading.text;
22
+
20
23
  let textId = text.match(/>(.*?)</)[1].replace(/ /g, '-');
21
- let iterationH = {
22
- "text": text,
23
- "level": this.headings[h].level,
24
- "link": `${url}#${textId}`,
25
- };
26
- this.newHeadings.push(iterationH)
24
+
25
+ this.newHeadings.push({
26
+ text: text,
27
+ level: heading.level,
28
+ link: `${url}#${textId}`,
29
+ });
27
30
  }
28
31
 
29
32
  super.render(html);
@@ -178,7 +178,7 @@ class MasonryGallery extends GHComponent {
178
178
 
179
179
  const promise = new Promise((res, rej) => {
180
180
  const img = document.createElement('img');
181
- img.setAttribute('src', typeof(+imageSrc) === 'number' ? `https://gudhub.com/userdata/35113/${imageSrc}.jpg` : imageSrc);
181
+ img.setAttribute('src', imageSrc);
182
182
  img.setAttribute('alt', imageAlt);
183
183
  img.setAttribute('title', imageTitle);
184
184
 
@@ -23,7 +23,6 @@ prices-cards {
23
23
  padding: 30px 20px;
24
24
  display: flex;
25
25
  flex-direction: column;
26
- justify-content: space-between;
27
26
  align-items: center;
28
27
  .title_card {
29
28
  color: var(--block-primary-h-color);
@@ -54,9 +53,11 @@ prices-cards {
54
53
  padding: 30px;
55
54
  margin: 0;
56
55
  border-radius: var(--block-secondary-border-radius);
56
+ width: 100%;
57
+ height: 100%;
57
58
  display: flex;
59
+ justify-content: space-between;
58
60
  flex-direction: column;
59
- width: 100%;
60
61
  }
61
62
  .feature_list {
62
63
  list-style: none;