@salesforcedevs/docs-components 1.34.1-redoc-latest-banner-2 → 1.34.3

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/LICENSE ADDED
@@ -0,0 +1,12 @@
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.
package/package.json CHANGED
@@ -1,30 +1,29 @@
1
1
  {
2
- "name": "@salesforcedevs/docs-components",
3
- "version": "1.34.1-redoc-latest-banner-2",
4
- "description": "Docs Lightning web components for DSC",
5
- "license": "MIT",
6
- "main": "index.js",
7
- "engines": {
8
- "node": "22.x"
9
- },
10
- "publishConfig": {
11
- "access": "public"
12
- },
13
- "dependencies": {
14
- "@api-components/amf-helper-mixin": "4.5.29",
15
- "classnames": "2.5.1",
16
- "dompurify": "3.2.4",
17
- "kagekiri": "1.4.2",
18
- "lodash.orderby": "4.6.0",
19
- "lodash.uniqby": "4.7.0",
20
- "query-string": "7.1.3",
21
- "sentence-case": "3.0.4"
22
- },
23
- "devDependencies": {
24
- "@types/classnames": "2.3.1",
25
- "@types/lodash.orderby": "4.6.9",
26
- "@types/lodash.uniqby": "4.7.9"
27
- },
28
- "gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad",
29
- "stableVersion": "1.34.0"
30
- }
2
+ "name": "@salesforcedevs/docs-components",
3
+ "version": "1.34.3",
4
+ "description": "Docs Lightning web components for DSC",
5
+ "license": "MIT",
6
+ "main": "index.js",
7
+ "engines": {
8
+ "node": "22.x"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "dependencies": {
14
+ "@api-components/amf-helper-mixin": "4.5.29",
15
+ "classnames": "2.5.1",
16
+ "dompurify": "3.2.4",
17
+ "kagekiri": "1.4.2",
18
+ "lodash.orderby": "4.6.0",
19
+ "lodash.uniqby": "4.7.0",
20
+ "query-string": "7.1.3",
21
+ "sentence-case": "3.0.4"
22
+ },
23
+ "devDependencies": {
24
+ "@types/classnames": "2.3.1",
25
+ "@types/lodash.orderby": "4.6.9",
26
+ "@types/lodash.uniqby": "4.7.9"
27
+ },
28
+ "gitHead": "c8c3bb1003d40a55fdd5733c7891dcca3931fb24"
29
+ }
@@ -0,0 +1,43 @@
1
+ export const DEFAULT_TOOLTIP_LABEL = "Click to copy";
2
+ export const COPIED_TOOLTIP_LABEL = "Copied!";
3
+ export const COPIED_RESET_MS = 1000;
4
+
5
+ export const ANALYTICS_CONTENT_CATEGORY = "content action toolbar";
6
+ export const MORE_ACTIONS_LABEL = "More actions";
7
+
8
+ export const COPY_MARKDOWN_LABEL = "Copy as Markdown";
9
+ export const VIEW_MARKDOWN_LABEL = "View as Markdown";
10
+ export const COPY_MARKDOWN_URL_LABEL = "Copy URL to Markdown";
11
+ export const VIEW_LLMS_LABEL = "View llms.txt";
12
+ export const COPY_LLMS_URL_LABEL = "Copy URL to llms.txt";
13
+ export const OPEN_CHATGPT_LABEL = "Open in ChatGPT";
14
+ export const OPEN_CLAUDE_LABEL = "Open in Claude";
15
+ export const OPEN_PERPLEXITY_LABEL = "Open in Perplexity";
16
+
17
+ export const LLMS_TXT_PATH = "/docs/llms.txt";
18
+ export const CHATGPT_URL = "https://chatgpt.com/";
19
+ export const CLAUDE_URL = "https://claude.ai/new";
20
+ export const PERPLEXITY_URL = "https://www.perplexity.ai/search";
21
+
22
+ export const ACTION_COPY_MARKDOWN = "copy-markdown";
23
+ export const ACTION_VIEW_MARKDOWN = "view-markdown";
24
+ export const ACTION_COPY_MARKDOWN_URL = "copy-markdown-url";
25
+ export const ACTION_VIEW_LLMS = "view-llms";
26
+ export const ACTION_COPY_LLMS_URL = "copy-llms-url";
27
+ export const ACTION_OPEN_CHATGPT = "open-chatgpt";
28
+ export const ACTION_OPEN_CLAUDE = "open-claude";
29
+ export const ACTION_OPEN_PERPLEXITY = "open-perplexity";
30
+
31
+ export const AI_ASSISTANTS = [
32
+ {
33
+ action: ACTION_OPEN_CHATGPT,
34
+ base: CHATGPT_URL,
35
+ label: OPEN_CHATGPT_LABEL
36
+ },
37
+ { action: ACTION_OPEN_CLAUDE, base: CLAUDE_URL, label: OPEN_CLAUDE_LABEL },
38
+ {
39
+ action: ACTION_OPEN_PERPLEXITY,
40
+ base: PERPLEXITY_URL,
41
+ label: OPEN_PERPLEXITY_LABEL
42
+ }
43
+ ] as const;
@@ -2,16 +2,27 @@
2
2
 
3
3
  :host {
4
4
  display: block;
5
+
6
+ /* 4px gap below the trigger, and the same 4px gap above when the menu
7
+ flips */
8
+ --popover-container-open-transform: translateY(var(--dx-g-spacing-xs));
9
+ --popover-container-open-transform-up: translateY(
10
+ calc(-1 * var(--dx-g-spacing-xs))
11
+ );
5
12
  }
6
13
 
7
14
  .toolbar {
8
15
  display: flex;
9
16
  align-items: center;
10
- flex-wrap: wrap;
17
+ flex-wrap: nowrap;
11
18
  gap: var(--dx-g-spacing-smd);
12
19
  margin-bottom: var(--dx-g-spacing-lg);
13
20
  }
14
21
 
22
+ .toolbar > * {
23
+ flex-shrink: 0;
24
+ }
25
+
15
26
  .toolbar-button {
16
27
  --dx-c-button-font-weight: var(--dx-g-font-demi);
17
28
  --dx-c-button-line-height: var(--dx-g-spacing-mlg);
@@ -24,9 +35,26 @@
24
35
  background-color: var(--dx-g-gray-70);
25
36
  }
26
37
 
27
- @media screen and (max-width: 480px) {
28
- .toolbar-button_copy-url,
29
- .divider_copy-url {
30
- display: none;
31
- }
38
+ .toolbar_no-markdown .divider_view-llms {
39
+ display: none;
40
+ }
41
+
42
+ .toolbar-menu {
43
+ --dx-c-popover-z-index: calc(var(--dx-g-z-index-100) + 6);
44
+
45
+ flex: 0 0 auto;
46
+ }
47
+
48
+ .menu-trigger {
49
+ white-space: nowrap;
50
+ flex-shrink: 0;
51
+ }
52
+
53
+ .toolbar > [data-overflow="true"] {
54
+ display: none;
55
+ }
56
+
57
+ .toolbar > .divider_view-markdown[data-overflow="true"] ~ .divider_menu,
58
+ .toolbar_no-markdown .divider_menu {
59
+ display: none;
32
60
  }
@@ -1,53 +1,88 @@
1
1
  <template>
2
- <div class="toolbar" lwc:if={markdownUrl}>
3
- <dx-tooltip placement="top-right" label={copyMarkdownLabel}>
2
+ <div class={toolbarClass}>
3
+ <template lwc:if={hasMarkdown}>
4
+ <dx-tooltip
5
+ placement="top-right"
6
+ label={copyMarkdownTooltipLabel}
7
+ visible={copyMarkdownTooltipVisible}
8
+ >
9
+ <dx-button
10
+ class="toolbar-button"
11
+ variant="inline"
12
+ size="small"
13
+ icon-sprite="utility"
14
+ icon-symbol="copy"
15
+ icon-size="medium"
16
+ icon-position="right"
17
+ aria-label={copyMarkdownButtonText}
18
+ onclick={handleCopyMarkdown}
19
+ >
20
+ {copyMarkdownButtonText}
21
+ </dx-button>
22
+ </dx-tooltip>
23
+
24
+ <div class="divider divider_view-markdown"></div>
25
+
4
26
  <dx-button
5
- class="toolbar-button"
27
+ class="toolbar-button toolbar-button_view-markdown"
6
28
  variant="inline"
7
29
  size="small"
8
30
  icon-sprite="utility"
9
- icon-symbol="copy"
31
+ icon-symbol="new_window"
10
32
  icon-size="medium"
11
33
  icon-position="right"
12
- aria-label={copyMarkdownButtonText}
13
- onclick={handleCopyMarkdown}
34
+ aria-label={viewMarkdownButtonText}
35
+ onclick={handleViewMarkdown}
14
36
  >
15
- {copyMarkdownButtonText}
37
+ {viewMarkdownButtonText}
16
38
  </dx-button>
17
- </dx-tooltip>
39
+ </template>
18
40
 
19
- <div class="divider"></div>
41
+ <div class="divider divider_view-llms"></div>
20
42
 
21
43
  <dx-button
22
- class="toolbar-button"
44
+ class="toolbar-button toolbar-button_view-llms"
23
45
  variant="inline"
24
46
  size="small"
25
47
  icon-sprite="utility"
26
48
  icon-symbol="new_window"
27
49
  icon-size="medium"
28
50
  icon-position="right"
29
- aria-label={viewMarkdownButtonText}
30
- onclick={handleViewMarkdown}
51
+ aria-label={viewLlmsButtonText}
52
+ onclick={handleViewLlms}
31
53
  >
32
- {viewMarkdownButtonText}
54
+ {viewLlmsButtonText}
33
55
  </dx-button>
34
56
 
35
- <div class="divider divider_copy-url"></div>
57
+ <div class="divider divider_menu"></div>
36
58
 
37
- <dx-tooltip placement="top-right" label={copyUrlLabel}>
38
- <dx-button
39
- class="toolbar-button toolbar-button_copy-url"
40
- variant="inline"
41
- size="small"
42
- icon-sprite="utility"
43
- icon-symbol="link"
44
- icon-size="medium"
45
- icon-position="right"
46
- aria-label={copyUrlButtonText}
47
- onclick={handleCopyUrl}
59
+ <dx-dropdown
60
+ class="toolbar-menu"
61
+ options={menuOptions}
62
+ placement="bottom-end"
63
+ width-mode="fit-content"
64
+ onchange={handleMenuSelect}
65
+ onopen={handleMenuOpen}
66
+ onclose={handleMenuClose}
67
+ >
68
+ <dx-tooltip
69
+ placement="top-right"
70
+ label={menuTooltipLabel}
71
+ visible={menuTooltipVisible}
72
+ suppressed={menuOpen}
48
73
  >
49
- {copyUrlButtonText}
50
- </dx-button>
51
- </dx-tooltip>
74
+ <dx-button
75
+ class="menu-trigger"
76
+ variant="secondary"
77
+ size="small"
78
+ icon-sprite="utility"
79
+ icon-symbol="threedots"
80
+ icon-size="medium"
81
+ icon-only
82
+ >
83
+ {moreActionsLabel}
84
+ </dx-button>
85
+ </dx-tooltip>
86
+ </dx-dropdown>
52
87
  </div>
53
88
  </template>