@salesforcedevs/dw-components 1.28.1-banner-3 → 1.28.5-node22-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,30 +1,29 @@
1
1
  {
2
- "name": "@salesforcedevs/dw-components",
3
- "version": "1.28.1-banner-3",
4
- "description": "Lightning web components for https://developer.salesforce.com",
5
- "license": "MIT",
6
- "engines": {
7
- "node": "20.x"
8
- },
9
- "publishConfig": {
10
- "access": "public"
11
- },
12
- "dependencies": {
13
- "@types/youtube-player": "5.5.11",
14
- "classnames": "2.5.1",
15
- "lodash.clonedeep": "4.5.0",
16
- "lodash.orderby": "4.6.0",
17
- "lodash.uniqby": "4.7.0",
18
- "query-string": "7.1.3",
19
- "youtube-player": "5.6.0"
20
- },
21
- "devDependencies": {
22
- "@types/classnames": "2.3.1",
23
- "@types/lodash.clonedeep": "4.5.9",
24
- "@types/lodash.orderby": "4.6.9",
25
- "@types/lodash.uniqby": "4.7.9",
26
- "@types/setimmediate": "1.0.4",
27
- "setimmediate": "1.0.5"
28
- },
29
- "gitHead": "26a6b8de7d0fde3193ad24c909921175c8ab0e1e"
30
- }
2
+ "name": "@salesforcedevs/dw-components",
3
+ "version": "1.28.5-node22-1",
4
+ "description": "Lightning web components for https://developer.salesforce.com",
5
+ "license": "MIT",
6
+ "engines": {
7
+ "node": "22.x"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "dependencies": {
13
+ "@types/youtube-player": "5.5.11",
14
+ "classnames": "2.5.1",
15
+ "lodash.clonedeep": "4.5.0",
16
+ "lodash.orderby": "4.6.0",
17
+ "lodash.uniqby": "4.7.0",
18
+ "query-string": "7.1.3",
19
+ "youtube-player": "5.6.0"
20
+ },
21
+ "devDependencies": {
22
+ "@types/classnames": "2.3.1",
23
+ "@types/lodash.clonedeep": "4.5.9",
24
+ "@types/lodash.orderby": "4.6.9",
25
+ "@types/lodash.uniqby": "4.7.9",
26
+ "@types/setimmediate": "1.0.4",
27
+ "setimmediate": "1.0.5"
28
+ }
29
+ }
@@ -32,6 +32,7 @@
32
32
  {featuredCodeSample.ctaOne.text}
33
33
  </dx-button>
34
34
  <dx-button
35
+ lwc:if={featuredCodeSample.ctaTwo}
35
36
  target={target}
36
37
  variant="secondary"
37
38
  size="large"
@@ -84,6 +85,7 @@
84
85
  {item.ctaOne.text}
85
86
  </dx-button>
86
87
  <dx-button
88
+ lwc:if={item.ctaTwo}
87
89
  target={target}
88
90
  variant="secondary"
89
91
  size="large"
@@ -49,6 +49,7 @@ export default class DocsGrid extends LightningElement {
49
49
  private _apiDocs?: any[] = [];
50
50
  private _languageList?: any[] = [];
51
51
  private _productFiltersList?: any[] = [];
52
+ private _availableServices: any[] = [];
52
53
  private matchDesktop!: MediaQueryList;
53
54
  private matchMobile!: MediaQueryList;
54
55
  private matchMobileSmall!: MediaQueryList;
@@ -140,7 +141,39 @@ export default class DocsGrid extends LightningElement {
140
141
  }
141
142
 
142
143
  set otherDocs(value: any) {
144
+ this.applyOtherDocs(value);
145
+ }
146
+
147
+ private applyOtherDocs(value: any): void {
148
+ const previousFilterValues = this.productFiltersList.map(
149
+ (filter) => filter.value
150
+ );
151
+ const previouslySelected = this.selectedProductFilters || [];
152
+ const previouslySelectedSet = new Set(previouslySelected);
153
+ const hadAllFiltersSelected =
154
+ !!previousFilterValues.length &&
155
+ previousFilterValues.every((filterValue) =>
156
+ previouslySelectedSet.has(filterValue)
157
+ );
158
+
143
159
  this._otherDocs = this.transformOtherDocs(value);
160
+
161
+ // Rebuild product filters after other docs updates so SSG and
162
+ // non-SSG flows use the same setter-based filter refresh path.
163
+ if (this._availableServices.length) {
164
+ this.productFiltersList = this._availableServices;
165
+
166
+ if (hadAllFiltersSelected) {
167
+ this.selectedProductFilters = this.productFiltersList.map(
168
+ (filter) => filter.value
169
+ );
170
+ }
171
+ }
172
+
173
+ // Recompute visible cards/counts once transformed other docs are merged.
174
+ if (this.dataRetrieved) {
175
+ this.calculatePagination(this.page.toString(), true);
176
+ }
144
177
  }
145
178
 
146
179
  private transformOtherDocs(value: any): any[] {
@@ -177,16 +210,16 @@ export default class DocsGrid extends LightningElement {
177
210
 
178
211
  if (response.ok) {
179
212
  const data = await response.json();
180
- this._otherDocs = this.transformOtherDocs(data);
213
+ this.applyOtherDocs(data);
181
214
  } else {
182
215
  console.error(
183
216
  `Failed to fetch sitemetadata: ${response.status}`
184
217
  );
185
- this._otherDocs = [];
218
+ this.applyOtherDocs([]);
186
219
  }
187
220
  } catch (error) {
188
221
  console.error("Error fetching sitemetadata:", error);
189
- this._otherDocs = [];
222
+ this.applyOtherDocs([]);
190
223
  } finally {
191
224
  this._isFetchingOtherDocs = false;
192
225
  }
@@ -393,7 +426,8 @@ export default class DocsGrid extends LightningElement {
393
426
  }
394
427
 
395
428
  if (json.available_services) {
396
- this.productFiltersList = json.available_services;
429
+ this._availableServices = json.available_services;
430
+ this.productFiltersList = this._availableServices;
397
431
 
398
432
  if (!this.selectedProductFilters!.length) {
399
433
  this.selectedProductFilters =
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.