@salesforcedevs/dx-components 1.15.3 → 1.15.4-ldh-alpha1

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/dx-components",
3
- "version": "1.15.3",
3
+ "version": "1.15.4-ldh-alpha1",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -45,6 +45,5 @@
45
45
  },
46
46
  "volta": {
47
47
  "node": "20.19.0"
48
- },
49
- "gitHead": "f8d314c2694651bca752ec3a45bd0673c4a4ada4"
48
+ }
50
49
  }
@@ -1,9 +1,9 @@
1
1
  // urlWatcherComponent.ts
2
2
  import { LightningElement } from "lwc";
3
- import UrlWatcher from "dxUtils/urlWatcher";
3
+ import { UrlWatcher } from "dxUtils/urlWatcher";
4
4
 
5
5
  export default class UrlWatcherComponent extends LightningElement {
6
- watcher = UrlWatcher;
6
+ watcher = UrlWatcher.getInstance();
7
7
  connectedCallback() {
8
8
  // Just ensure the singleton initializes
9
9
  }
@@ -24,7 +24,24 @@
24
24
  </div>
25
25
  <div class="sidebar-header" show-shadow={showBoxShadow}>
26
26
  <div class="header padding-horizontal" lwc:if={isDesktop}>
27
- <h2 class="dx-text-display-6 header-title">{header}</h2>
27
+ <div class="header-wrapper">
28
+ <div lwc:if={devCenter} class="dev-center-link link-row">
29
+ <a href={devCenter.link} class="dev-center-content">
30
+ <dx-icon symbol="back"></dx-icon>
31
+ <dx-icon
32
+ class="brand-icon"
33
+ lwc:if={devCenter.icon}
34
+ sprite="salesforcebrand"
35
+ symbol={brand}
36
+ size="large"
37
+ ></dx-icon>
38
+ <span class="subtitle dx-text-body-4">
39
+ {devCenter.title}
40
+ </span>
41
+ </a>
42
+ </div>
43
+ <h2 class="dx-text-display-6 header-title">{header}</h2>
44
+ </div>
28
45
  </div>
29
46
  <div class="search padding-horizontal">
30
47
  <dx-sidebar-search
@@ -26,7 +26,27 @@
26
26
  <template lwc:if={expanded}>
27
27
  <div class="sidebar-header" show-shadow={showBoxShadow}>
28
28
  <div class="header padding-horizontal" lwc:if={isDesktop}>
29
- <h2 class="dx-text-display-6 header-title">{header}</h2>
29
+ <div class="header-wrapper">
30
+ <div
31
+ lwc:if={devCenter}
32
+ class="dev-center-link link-row"
33
+ >
34
+ <a href={devCenter.link} class="dev-center-content">
35
+ <dx-icon symbol="back"></dx-icon>
36
+ <dx-icon
37
+ class="brand-icon"
38
+ lwc:if={devCenter.icon}
39
+ sprite="salesforcebrand"
40
+ symbol={brand}
41
+ size="large"
42
+ ></dx-icon>
43
+ <span class="subtitle dx-text-body-4">
44
+ {devCenter.title}
45
+ </span>
46
+ </a>
47
+ </div>
48
+ <h2 class="dx-text-display-6 header-title">{header}</h2>
49
+ </div>
30
50
  </div>
31
51
  <div class="search padding-horizontal">
32
52
  <dx-input
@@ -1,6 +1,7 @@
1
1
  import { LightningElement, api } from "lwc";
2
2
  import type { OptionWithLink } from "typings/custom";
3
3
  import { toJson } from "dxUtils/normalizers";
4
+ import { Brand } from "typings/custom";
4
5
 
5
6
  export const HEIGHT_OF_SIDEBAR_ITEM = 32;
6
7
  export const WAIT_TIME_BEFORE_SCROLL_IN_MS = 500;
@@ -16,11 +17,22 @@ export class SidebarBase extends LightningElement {
16
17
  _value?: string = undefined;
17
18
  showBoxShadow: boolean = false;
18
19
  private scrolling: boolean = false;
20
+ _devCenter: any;
19
21
 
20
22
  @api langValuePath: string = "id";
21
23
  @api language!: string;
22
24
  @api bailHref!: string;
23
25
  @api bailLabel!: string;
26
+ @api brand: Brand | null = null;
27
+
28
+ @api
29
+ get devCenter() {
30
+ return this._devCenter;
31
+ }
32
+
33
+ set devCenter(value) {
34
+ this._devCenter = toJson(value);
35
+ }
24
36
 
25
37
  @api
26
38
  get languages() {
@@ -55,6 +55,18 @@
55
55
  padding-left: var(--dx-g-global-header-padding-horizontal);
56
56
  }
57
57
 
58
+ .header-wrapper {
59
+ display: flex;
60
+ flex-direction: column;
61
+ gap: 0.5rem;
62
+ }
63
+
64
+ .link-row a {
65
+ display: flex;
66
+ align-items: center;
67
+ gap: 0.5rem;
68
+ }
69
+
58
70
  .container {
59
71
  background-color: white;
60
72
  display: flex;
@@ -1,7 +1,7 @@
1
1
  // utils/urlWatcher.ts
2
2
  // there's a _lot_ of typescript fuckery happening here, because this whole class violates the laws of nature
3
3
  // please do not be alarmed.
4
- class UrlWatcher {
4
+ export class UrlWatcher {
5
5
  // eslint-disable-next-line no-use-before-define
6
6
  private static instance: UrlWatcher;
7
7
  private lastUrl: string = window.location.href;
@@ -77,5 +77,3 @@ class UrlWatcher {
77
77
  }
78
78
  }
79
79
  }
80
-
81
- export default UrlWatcher.getInstance();
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.
@@ -1 +0,0 @@
1
- <template></template>