@salesforcedevs/dx-components 0.10.1-alpha.23 → 0.10.1-alpha.27

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": "0.10.1-alpha.23",
3
+ "version": "0.10.1-alpha.27",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -16,7 +16,7 @@ const styles = `
16
16
  }
17
17
  </style>`;
18
18
 
19
- export const DarkTheme = (args: any) => `${styles}
19
+ export const Base = (args: any) => `${styles}
20
20
 
21
21
  <span class="dx-text-heading-7 dx-code-block-heading">XML Example - Dark Theme</span>
22
22
  <dx-code-block
@@ -98,74 +98,7 @@ export const DarkTheme = (args: any) => `${styles}
98
98
  language="php"
99
99
  default-theme="dark"
100
100
  ></dx-code-block>`;
101
- DarkTheme.args = mockProps;
102
-
103
- export const LightTheme = (args: any) => `${styles}
104
-
105
- <span class="dx-text-heading-7 dx-code-block-heading">XML Example - Light Theme</span>
106
- <dx-code-block
107
- title="XML example"
108
- code-block="${args.xml}"
109
- language="xml
110
- ></dx-code-block>
111
-
112
- <span class="dx-text-heading-7 dx-code-block-heading">Visualforce Example - Light Theme</span>
113
- <dx-code-block
114
- title="Visualforce example"
115
- code-block="${args.visualforce}"
116
- language="visualforce"
117
- ></dx-code-block>
118
-
119
- <span class="dx-text-heading-7 dx-code-block-heading">Java Example - Light Theme</span>
120
- <dx-code-block
121
- title="Java example"
122
- code-block="${args.java}"
123
- language="java"
124
- ></dx-code-block>
125
-
126
- <span class="dx-text-heading-7 dx-code-block-heading">Light Theme</span>
127
- <dx-code-block
128
- title="HTML Example"
129
- code-block="${args.html}"
130
- source-link="http://www.salesforce.com"
131
- language="html"
132
- ></dx-code-block>
133
-
134
- <span class="dx-text-heading-7 dx-code-block-heading">TypeScript Example - Light Theme</span>
135
- <dx-code-block
136
- title="TypeScript example"
137
- code-block="${args.TypeScript}"
138
- language="TypeScript"
139
- ></dx-code-block>
140
-
141
- <span class="dx-text-heading-7 dx-code-block-heading">Light Theme</span>
142
- <dx-code-block
143
- title="CSS example"
144
- code-block="${args.css}"
145
- language="css"
146
- ></dx-code-block>
147
-
148
- <span class="dx-text-heading-7 dx-code-block-heading">Apex Example - Light Theme</span>
149
- <dx-code-block
150
- title="Apex example"
151
- code-block="${args.apex}"
152
- language="apex"
153
- ></dx-code-block>
154
-
155
- <span class="dx-text-heading-7 dx-code-block-heading">No Language Example - Light Theme</span>
156
- <dx-code-block
157
- title="No Language"
158
- code-block="${args.apex}"
159
- ></dx-code-block>
160
-
161
- <span class="dx-text-heading-7 dx-code-block-heading">Light Theme</span>
162
- <dx-code-block
163
- title="PHP Example"
164
- code-block="${args.php}"
165
- language="php"
166
- ></dx-code-block>`;
167
-
168
- LightTheme.args = mockProps;
101
+ Base.args = mockProps;
169
102
 
170
103
  export const PreTag = (args: any) => `${styles}
171
104
  <span class="dx-text-heading-7 dx-code-block-heading">Dark Theme</span>
@@ -19,7 +19,6 @@
19
19
  }
20
20
 
21
21
  .dx-theme-dark .token.operator {
22
- background-color: var(--dx-g-blue-vibrant-20);
23
22
  color: var(--dx-g-pink-vibrant-65);
24
23
  }
25
24
 
@@ -16,7 +16,6 @@
16
16
 
17
17
  .dx-theme-light .token.operator {
18
18
  color: var(--dx-g-green-vibrant-50);
19
- background-color: #fff;
20
19
  }
21
20
 
22
21
  .dx-theme-light .token.property {
@@ -79,11 +79,6 @@ export default class Input extends LightningElement {
79
79
  return true;
80
80
  }
81
81
 
82
- @api
83
- public setValue = (value: string):void => {
84
- this._value = value;
85
- }
86
-
87
82
  private _errorMessage: string = "";
88
83
  private focused: boolean = false;
89
84
  private input: HTMLInputElement | null = null;
@@ -0,0 +1,29 @@
1
+ export const content = `<div><a name='apex_dev_guide'><!-- --></a><h1 class='helpHead1'>Apex Developer Guide</h1><div class='shortdesc'>Salesforce has changed the way organizations do business by moving enterprise
2
+ applications that were traditionally client-server-based into the Lightning Platform, an
3
+ on-demand, multitenant Web environment. This environment enables you to run and customize
4
+ applications, such as Salesforce Automation and Service &amp; Support, and build new custom
5
+ applications based on particular business needs. </div><div id='sfdc:seealso' class='related-links'>
6
+ <ul class='ullinks'>
7
+ <li class='link ulchildlink'>
8
+ <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_intro_get_started.htm'>Getting Started with Apex</a></strong><br>
9
+ Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Lightning Platform server, in conjunction with calls to the API.</li>
10
+ <li class='link ulchildlink'>
11
+ <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_writing.htm'>Writing Apex</a></strong><br>
12
+ Apex is like Java for Salesforce. It enables you to add and interact with data in the Lightning Platform persistence layer. It uses classes, data types, variables, and if-else statements. You can make it execute based on a condition, or have a block of code execute repeatedly.</li>
13
+ <li class='link ulchildlink'>
14
+ <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_running.htm'>Running Apex</a></strong><br>
15
+ You can access many features of the Salesforce user interface programmatically in Apex, and you can integrate with external SOAP and REST Web services. You can run Apex code using a variety of mechanisms. Apex code runs in atomic transactions. </li>
16
+ <li class='link ulchildlink'>
17
+ <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_debug_test_deploy.htm'>Debugging, Testing, and Deploying Apex</a></strong><br>
18
+ Develop your Apex code in a sandbox and debug it with the Developer Console and debug logs. Unit-test your code, then distribute it to customers using packages.</li>
19
+ <li class='link ulchildlink'>
20
+ <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_reference.htm'>Apex Language Reference</a></strong><br>
21
+ This Apex reference goes into detail about DML statements and the built-in Apex classes and interfaces.</li>
22
+ <li class='link ulchildlink'>
23
+ <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_appendices.htm'>Appendices</a></strong><br>
24
+ </li>
25
+ <li class='link ulchildlink'>
26
+ <strong><a href='atlas.en-us.apexcode.meta/apexcode/glossary_apex.htm'>Glossary</a></strong><br>
27
+ </li>
28
+ </ul>
29
+ </div><!--DRC 228.7--></div>`;
@@ -0,0 +1,8 @@
1
+ export default {
2
+ domain: "http://localhost:3000",
3
+ page: "docs",
4
+ docId: "atlas.en-us.apexcode.meta",
5
+ deliverable: "apexcode",
6
+ contentDocumentId: "apex_dev_guide.htm",
7
+ hash: ""
8
+ };
@@ -1,5 +1,7 @@
1
1
  import { html } from "lit-html";
2
2
  import { SAMPLE_TREES, SAMPLE_TREES_WITH_METHODS } from "./__tests__/mockProps";
3
+ import mockPageReference from "./__tests__/mockPageReference";
4
+ import { content } from "./__tests__/mockDocContent";
3
5
 
4
6
  export const coveoConfig = {
5
7
  coveoOrganizationId: "coveosalesforcetestakshatha",
@@ -188,3 +190,36 @@ export const UseSlot = ({ header, trees, value }: any) => html`
188
190
  <span slot="header">I'm in the sidebar</span>
189
191
  </dx-sidebar>
190
192
  `;
193
+
194
+ export const HighlightedTerm = ({ header, trees, value }: any) => html`
195
+ ${styles(`
196
+ --dx-c-sidebar-min-height: 100vh;
197
+ `)}
198
+
199
+ <style>
200
+ .container {
201
+ display: flex;
202
+ }
203
+ </style>
204
+
205
+ <div class="container">
206
+ <dx-sidebar
207
+ is-storybook="true"
208
+ header="${header}"
209
+ trees="${JSON.stringify(trees)}"
210
+ value="${value}"
211
+ coveo-organization-id="${coveoConfig.coveoOrganizationId}"
212
+ coveo-public-access-token="${coveoConfig.coveoPublicAccessToken}"
213
+ coveo-search-hub="${coveoConfig.coveoSearchHub}"
214
+ coveo-object-type="${coveoConfig.coveoObjectType}"
215
+ coveo-language="${coveoConfig.coveoLanguage}"
216
+ coveo-release="${coveoConfig.coveoRelease}"
217
+ coveo-deliverable="${coveoConfig.coveoDeliverable}"
218
+ ></dx-sidebar>
219
+ <doc-content
220
+ is-storybook="true"
221
+ page-reference="${JSON.stringify(mockPageReference)}"
222
+ docs-data="${content}"
223
+ ></doc-content>
224
+ </div>
225
+ `;
@@ -48,8 +48,19 @@ export default class SidebarSearch extends LightningElement {
48
48
  return !this.value || this.value === "";
49
49
  }
50
50
 
51
- connectedCallback() {
51
+ constructor() {
52
+ super();
53
+
52
54
  this.recentSearches = UserRecentSearches.get();
55
+
56
+ // initialize from url parameters
57
+ const initialValue = new URLSearchParams(window.location.search).get(
58
+ "q"
59
+ );
60
+ if (initialValue && initialValue !== "") {
61
+ this.value = initialValue;
62
+ this.dispatchOnLoading(true);
63
+ }
53
64
  }
54
65
 
55
66
  renderedCallback() {
@@ -119,13 +130,9 @@ export default class SidebarSearch extends LightningElement {
119
130
  this.dispatchOnLoading(isLoading);
120
131
  });
121
132
 
122
- // initialize from url parameters
123
- const initialValue = new URLSearchParams(window.location.search).get(
124
- "q"
125
- );
126
- if (initialValue && initialValue !== "") {
127
- this.value = initialValue;
133
+ if (!this.isValueEmpty) {
128
134
  this.submitSearch();
135
+ this.dispatchHighlightedTermChange();
129
136
  }
130
137
  }
131
138
 
@@ -173,7 +180,6 @@ export default class SidebarSearch extends LightningElement {
173
180
  });
174
181
 
175
182
  private dispatchOnChangeEvent(results: Result[]) {
176
- console.log({ results });
177
183
  this.dispatchEvent(
178
184
  new CustomEvent("change", {
179
185
  detail: {
@@ -192,9 +198,17 @@ export default class SidebarSearch extends LightningElement {
192
198
  );
193
199
  }
194
200
 
195
- private updateHistory(): void {
196
- console.log(window.location);
201
+ private dispatchHighlightedTermChange() {
202
+ this.dispatchEvent(
203
+ new CustomEvent("highlightedtermchange", {
204
+ detail: this.value,
205
+ composed: true,
206
+ bubbles: true
207
+ })
208
+ );
209
+ }
197
210
 
211
+ private updateHistory(): void {
198
212
  if (this.isValueEmpty) {
199
213
  window.history.replaceState({}, "", window.location.pathname);
200
214
  return;
@@ -241,6 +255,7 @@ export default class SidebarSearch extends LightningElement {
241
255
  this.dispatchOnChangeEvent([]);
242
256
  }
243
257
 
258
+ this.dispatchHighlightedTermChange();
244
259
  this.updateHistory();
245
260
  }
246
261
 
@@ -52,8 +52,6 @@ export default class SidebarSearchResult extends LightningElement {
52
52
  private get isSelected() {
53
53
  const resultPathname = this.href.split("?")[0];
54
54
 
55
- console.log(resultPathname, window.location.pathname);
56
-
57
55
  return resultPathname === window.location.pathname;
58
56
  }
59
57