@salesforcedevs/docs-components 1.34.1 → 1.34.4-topic-alpha.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 +2 -2
- package/src/modules/doc/contentActionToolbar/constants.ts +43 -0
- package/src/modules/doc/contentActionToolbar/contentActionToolbar.css +34 -6
- package/src/modules/doc/contentActionToolbar/contentActionToolbar.html +63 -28
- package/src/modules/doc/contentActionToolbar/contentActionToolbar.ts +372 -61
- package/src/modules/doc/contentActionToolbar/contentActionToolbarMocks.ts +1 -1
- package/src/modules/doc/contentLayout/contentLayout.ts +2 -1
- package/src/modules/doc/redocReference/redocReference.css +1 -0
- package/src/modules/doc/redocReference/redocReference.ts +192 -20
- package/src/modules/doc/unifiedContentLayout/unifiedContentLayout.html +8 -0
- package/src/modules/doc/unifiedContentLayout/unifiedContentLayout.ts +57 -7
- package/src/modules/doc/versionPicker/versionPicker.css +164 -16
- package/src/modules/doc/versionPicker/versionPicker.html +54 -21
- package/src/modules/doc/versionPicker/versionPicker.ts +92 -0
- package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +4 -4
- package/src/modules/docUtils/utils/utils.ts +20 -2
- package/LICENSE +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "1.34.1",
|
|
3
|
+
"version": "1.34.4-topic-alpha.1",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"@types/lodash.orderby": "4.6.9",
|
|
26
26
|
"@types/lodash.uniqby": "4.7.9"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
|
|
29
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:
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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=
|
|
3
|
-
<
|
|
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="
|
|
31
|
+
icon-symbol="new_window"
|
|
10
32
|
icon-size="medium"
|
|
11
33
|
icon-position="right"
|
|
12
|
-
aria-label={
|
|
13
|
-
onclick={
|
|
34
|
+
aria-label={viewMarkdownButtonText}
|
|
35
|
+
onclick={handleViewMarkdown}
|
|
14
36
|
>
|
|
15
|
-
{
|
|
37
|
+
{viewMarkdownButtonText}
|
|
16
38
|
</dx-button>
|
|
17
|
-
</
|
|
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={
|
|
30
|
-
onclick={
|
|
51
|
+
aria-label={viewLlmsButtonText}
|
|
52
|
+
onclick={handleViewLlms}
|
|
31
53
|
>
|
|
32
|
-
{
|
|
54
|
+
{viewLlmsButtonText}
|
|
33
55
|
</dx-button>
|
|
34
56
|
|
|
35
|
-
<div class="divider
|
|
57
|
+
<div class="divider divider_menu"></div>
|
|
36
58
|
|
|
37
|
-
<dx-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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>
|