@carbon/ai-chat-components 1.1.0 → 1.2.0-rc.0
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/custom-elements.json +3999 -4626
- package/es/components/carousel/src/carousel.d.ts +1 -1
- package/es/components/carousel/src/carousel.js +5 -3
- package/es/components/carousel/src/carousel.js.map +1 -1
- package/es/components/chat-button/src/chat-button.scss.js +1 -1
- package/es/components/chat-history/src/chat-history.scss.js +1 -1
- package/es/components/chat-history/src/history-delete-panel.d.ts +10 -0
- package/es/components/chat-history/src/history-delete-panel.js +39 -0
- package/es/components/chat-history/src/history-delete-panel.js.map +1 -1
- package/es/components/chat-history/src/history-panel-item.js +1 -1
- package/es/components/chat-history/src/history-panel-item.js.map +1 -1
- package/es/components/chat-history/src/history-shell.d.ts +7 -0
- package/es/components/chat-history/src/history-shell.js +43 -0
- package/es/components/chat-history/src/history-shell.js.map +1 -1
- package/es/components/code-snippet/src/code-snippet.js +1 -0
- package/es/components/code-snippet/src/code-snippet.js.map +1 -1
- package/es/components/code-snippet/src/code-snippet.scss.js +1 -1
- package/es/components/code-snippet/src/codemirror/base-setup.d.ts +1 -0
- package/es/components/code-snippet/src/codemirror/base-setup.js +4 -1
- package/es/components/code-snippet/src/codemirror/base-setup.js.map +1 -1
- package/es/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +1 -0
- package/es/components/code-snippet/src/codemirror/codemirror-runtime.js +1 -0
- package/es/components/code-snippet/src/codemirror/codemirror-runtime.js.map +1 -1
- package/es/components/code-snippet/src/codemirror/diff-decorator.d.ts +30 -0
- package/es/components/code-snippet/src/codemirror/diff-decorator.js +80 -0
- package/es/components/code-snippet/src/codemirror/diff-decorator.js.map +1 -0
- package/es/components/code-snippet/src/codemirror/editor-manager.d.ts +2 -1
- package/es/components/code-snippet/src/codemirror/editor-manager.js +7 -2
- package/es/components/code-snippet/src/codemirror/editor-manager.js.map +1 -1
- package/es/components/markdown/src/markdown-token-tree.js +2 -10
- package/es/components/markdown/src/markdown-token-tree.js.map +1 -1
- package/es/components/markdown/src/plugins/markdown-it-attrs.d.ts +3 -3
- package/es/components/markdown/src/plugins/markdown-it-attrs.js +171 -57
- package/es/components/markdown/src/plugins/markdown-it-attrs.js.map +1 -1
- package/es/components/table/src/table.template.d.ts +1 -1
- package/es/components/table/src/table.template.js +6 -6
- package/es/components/table/src/table.template.js.map +1 -1
- package/es/globals/utils/focus-utils.d.ts +13 -1
- package/es/globals/utils/focus-utils.js +25 -1
- package/es/globals/utils/focus-utils.js.map +1 -1
- package/es/react/carousel.d.ts +4 -0
- package/es/react/carousel.js +31 -0
- package/es/react/carousel.js.map +1 -0
- package/es-custom/components/carousel/src/carousel.d.ts +1 -1
- package/es-custom/components/carousel/src/carousel.js +5 -3
- package/es-custom/components/carousel/src/carousel.js.map +1 -1
- package/es-custom/components/chat-button/src/chat-button.scss.js +1 -1
- package/es-custom/components/chat-history/src/chat-history.scss.js +1 -1
- package/es-custom/components/chat-history/src/history-delete-panel.d.ts +10 -0
- package/es-custom/components/chat-history/src/history-delete-panel.js +39 -0
- package/es-custom/components/chat-history/src/history-delete-panel.js.map +1 -1
- package/es-custom/components/chat-history/src/history-panel-item.js +1 -1
- package/es-custom/components/chat-history/src/history-panel-item.js.map +1 -1
- package/es-custom/components/chat-history/src/history-shell.d.ts +7 -0
- package/es-custom/components/chat-history/src/history-shell.js +43 -0
- package/es-custom/components/chat-history/src/history-shell.js.map +1 -1
- package/es-custom/components/code-snippet/src/code-snippet.js +1 -0
- package/es-custom/components/code-snippet/src/code-snippet.js.map +1 -1
- package/es-custom/components/code-snippet/src/code-snippet.scss.js +1 -1
- package/es-custom/components/code-snippet/src/codemirror/base-setup.d.ts +1 -0
- package/es-custom/components/code-snippet/src/codemirror/base-setup.js +4 -1
- package/es-custom/components/code-snippet/src/codemirror/base-setup.js.map +1 -1
- package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +1 -0
- package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.js +1 -0
- package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.js.map +1 -1
- package/es-custom/components/code-snippet/src/codemirror/diff-decorator.d.ts +30 -0
- package/es-custom/components/code-snippet/src/codemirror/diff-decorator.js +80 -0
- package/es-custom/components/code-snippet/src/codemirror/diff-decorator.js.map +1 -0
- package/es-custom/components/code-snippet/src/codemirror/editor-manager.d.ts +2 -1
- package/es-custom/components/code-snippet/src/codemirror/editor-manager.js +7 -2
- package/es-custom/components/code-snippet/src/codemirror/editor-manager.js.map +1 -1
- package/es-custom/components/markdown/src/markdown-token-tree.js +2 -10
- package/es-custom/components/markdown/src/markdown-token-tree.js.map +1 -1
- package/es-custom/components/markdown/src/plugins/markdown-it-attrs.d.ts +3 -3
- package/es-custom/components/markdown/src/plugins/markdown-it-attrs.js +171 -57
- package/es-custom/components/markdown/src/plugins/markdown-it-attrs.js.map +1 -1
- package/es-custom/components/table/src/table.template.d.ts +1 -1
- package/es-custom/components/table/src/table.template.js +6 -6
- package/es-custom/components/table/src/table.template.js.map +1 -1
- package/es-custom/globals/utils/focus-utils.d.ts +13 -1
- package/es-custom/globals/utils/focus-utils.js +25 -1
- package/es-custom/globals/utils/focus-utils.js.map +1 -1
- package/es-custom/react/carousel.d.ts +4 -0
- package/es-custom/react/carousel.js +31 -0
- package/es-custom/react/carousel.js.map +1 -0
- package/package.json +4 -4
- package/es/components/markdown/src/plugins/markdownItAttrs/core.d.ts +0 -26
- package/es/components/markdown/src/plugins/markdownItAttrs/core.js +0 -330
- package/es/components/markdown/src/plugins/markdownItAttrs/core.js.map +0 -1
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.d.ts +0 -6
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js +0 -63
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js.map +0 -1
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.d.ts +0 -6
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.js +0 -43
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.js.map +0 -1
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.d.ts +0 -5
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.js +0 -55
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.js.map +0 -1
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.d.ts +0 -19
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js +0 -210
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js.map +0 -1
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.d.ts +0 -13
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js +0 -156
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js.map +0 -1
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.d.ts +0 -13
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js +0 -216
- package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js.map +0 -1
- package/es/components/markdown/src/plugins/markdownItAttrs/types.d.ts +0 -34
- package/es/components/markdown/src/plugins/markdownItAttrs/types.js +0 -8
- package/es/components/markdown/src/plugins/markdownItAttrs/types.js.map +0 -1
- package/es/components/markdown/src/plugins/markdownItAttrs/utils.d.ts +0 -25
- package/es/components/markdown/src/plugins/markdownItAttrs/utils.js +0 -62
- package/es/components/markdown/src/plugins/markdownItAttrs/utils.js.map +0 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/core.d.ts +0 -26
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/core.js +0 -330
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/core.js.map +0 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.d.ts +0 -6
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js +0 -63
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js.map +0 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.d.ts +0 -6
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.js +0 -43
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.js.map +0 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/index.d.ts +0 -5
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/index.js +0 -55
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/index.js.map +0 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.d.ts +0 -19
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js +0 -210
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js.map +0 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.d.ts +0 -13
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js +0 -156
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js.map +0 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.d.ts +0 -13
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js +0 -216
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js.map +0 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/types.d.ts +0 -34
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/types.js +0 -8
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/types.js.map +0 -1
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/utils.d.ts +0 -25
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/utils.js +0 -62
- package/es-custom/components/markdown/src/plugins/markdownItAttrs/utils.js.map +0 -1
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { test } from './markdownItAttrs/core.js';
|
|
9
|
-
import { createPatterns } from './markdownItAttrs/patterns/index.js';
|
|
10
|
-
|
|
11
8
|
/*
|
|
12
9
|
* Copyright IBM Corp. 2025
|
|
13
10
|
*
|
|
@@ -16,67 +13,184 @@ import { createPatterns } from './markdownItAttrs/patterns/index.js';
|
|
|
16
13
|
*
|
|
17
14
|
* @license
|
|
18
15
|
*/
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
16
|
+
const LEFT = "{{";
|
|
17
|
+
const RIGHT = "}}";
|
|
18
|
+
const ALLOWED = new Set(["target", "rel", "class", "id"]);
|
|
19
|
+
/**
|
|
20
|
+
* Parses the body between `{{` and `}}` into a list of allowed attribute pairs.
|
|
21
|
+
* Supports `key=value` and `key="quoted value"`, space-separated. Disallowed
|
|
22
|
+
* keys and malformed fragments are dropped silently.
|
|
23
|
+
*/
|
|
24
|
+
function parseAttrs(body) {
|
|
25
|
+
const attrs = [];
|
|
26
|
+
let key = "";
|
|
27
|
+
let value = "";
|
|
28
|
+
let parsingKey = true;
|
|
29
|
+
let inQuotes = false;
|
|
30
|
+
const commit = () => {
|
|
31
|
+
if (key !== "" && ALLOWED.has(key)) {
|
|
32
|
+
attrs.push([key, value]);
|
|
33
|
+
}
|
|
34
|
+
key = "";
|
|
35
|
+
value = "";
|
|
36
|
+
parsingKey = true;
|
|
37
|
+
};
|
|
38
|
+
for (let i = 0; i < body.length; i++) {
|
|
39
|
+
const ch = body.charAt(i);
|
|
40
|
+
if (ch === "=" && parsingKey) {
|
|
41
|
+
parsingKey = false;
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (ch === '"' && !parsingKey) {
|
|
45
|
+
inQuotes = !inQuotes;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (ch === " " && !inQuotes) {
|
|
49
|
+
commit();
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
if (parsingKey) {
|
|
53
|
+
key += ch;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
value += ch;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
commit();
|
|
60
|
+
return attrs;
|
|
61
|
+
}
|
|
24
62
|
/**
|
|
25
|
-
*
|
|
63
|
+
* Applies parsed attributes to a token, merging `class` with any pre-existing
|
|
64
|
+
* class and pushing the rest.
|
|
26
65
|
*/
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
66
|
+
function applyAttrs(token, attrs) {
|
|
67
|
+
for (const [key, value] of attrs) {
|
|
68
|
+
if (key === "class") {
|
|
69
|
+
token.attrJoin("class", value);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
token.attrPush([key, value]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Walks backwards to find the `*_open` token matching the close token at
|
|
78
|
+
* `closeIndex` (same level, matching type). Returns `null` when no match is
|
|
79
|
+
* found, which causes the handler to silently bail.
|
|
80
|
+
*/
|
|
81
|
+
function findMatchingOpen(tokens, closeIndex) {
|
|
82
|
+
const close = tokens[closeIndex];
|
|
83
|
+
const openType = close.type.replace(/_close$/, "_open");
|
|
84
|
+
for (let i = closeIndex - 1; i >= 0; i--) {
|
|
85
|
+
if (tokens[i].type === openType && tokens[i].level === close.level) {
|
|
86
|
+
return tokens[i];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Looks for a `*_close` child (e.g. `link_close`) immediately followed by a
|
|
93
|
+
* text child starting with `{{…}}`. When matched, applies the attributes to
|
|
94
|
+
* the matching opening token and rewrites/removes the text child. Returns
|
|
95
|
+
* true if a mutation occurred so the caller can rescan for additional
|
|
96
|
+
* link-attribute pairs on the same inline token.
|
|
97
|
+
*/
|
|
98
|
+
function handleInlineAttributes(inlineToken) {
|
|
99
|
+
const children = inlineToken.children;
|
|
100
|
+
if (!children) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
for (let i = 1; i < children.length; i++) {
|
|
104
|
+
const prev = children[i - 1];
|
|
105
|
+
const curr = children[i];
|
|
106
|
+
if (prev.nesting !== -1 || curr.type !== "text") {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (!curr.content.startsWith(LEFT)) {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const closeIdx = curr.content.indexOf(RIGHT, LEFT.length);
|
|
113
|
+
if (closeIdx === -1) {
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
const openToken = findMatchingOpen(children, i - 1);
|
|
117
|
+
if (!openToken) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const body = curr.content.slice(LEFT.length, closeIdx);
|
|
121
|
+
applyAttrs(openToken, parseAttrs(body));
|
|
122
|
+
const remainder = curr.content.slice(closeIdx + RIGHT.length);
|
|
123
|
+
if (remainder.length === 0) {
|
|
124
|
+
children.splice(i, 1);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
curr.content = remainder;
|
|
128
|
+
}
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* When the last text child of an `inline` token ends with `}}`, apply the
|
|
135
|
+
* attributes to the matching block's opening token (heading_open /
|
|
136
|
+
* paragraph_open / etc.) and strip them from the rendered text.
|
|
137
|
+
*/
|
|
138
|
+
function handleEndOfBlock(tokens, inlineIndex) {
|
|
139
|
+
const children = tokens[inlineIndex].children;
|
|
140
|
+
if (!children || children.length === 0) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const last = children[children.length - 1];
|
|
144
|
+
if (last.type !== "text" || !last.content.endsWith(RIGHT)) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const openIdx = last.content.lastIndexOf(LEFT);
|
|
148
|
+
if (openIdx === -1) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
// Find the closing block token that follows this inline.
|
|
152
|
+
let closeIdx = -1;
|
|
153
|
+
for (let i = inlineIndex + 1; i < tokens.length; i++) {
|
|
154
|
+
if (tokens[i].nesting === -1) {
|
|
155
|
+
closeIdx = i;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (closeIdx === -1) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const openToken = findMatchingOpen(tokens, closeIdx);
|
|
163
|
+
if (!openToken) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const body = last.content.slice(openIdx + LEFT.length, last.content.length - RIGHT.length);
|
|
167
|
+
applyAttrs(openToken, parseAttrs(body));
|
|
168
|
+
// Strip `{{…}}` and a single trailing space between the content and the
|
|
169
|
+
// attribute block, so `# Heading {{id=foo}}` does not render as
|
|
170
|
+
// `<h1>Heading </h1>`.
|
|
171
|
+
let trimmed = last.content.slice(0, openIdx);
|
|
172
|
+
if (trimmed.endsWith(" ")) {
|
|
173
|
+
trimmed = trimmed.slice(0, -1);
|
|
174
|
+
}
|
|
175
|
+
last.content = trimmed;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Markdown-it plugin that applies a fixed set of HTML attributes to links,
|
|
179
|
+
* headings, and paragraphs using `{{key=value}}` syntax.
|
|
180
|
+
*/
|
|
181
|
+
function markdownItAttrs(md) {
|
|
45
182
|
function curlyAttrs(state) {
|
|
46
183
|
const tokens = state.tokens;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// Check if all tests in the pattern match
|
|
54
|
-
const patternMatches = pattern.tests.every((rule) => {
|
|
55
|
-
const result = test(tokens, tokenIndex, rule);
|
|
56
|
-
if (result.j !== null) {
|
|
57
|
-
childIndex = result.j; // Store child token index if matched within children
|
|
58
|
-
}
|
|
59
|
-
return result.match;
|
|
60
|
-
});
|
|
61
|
-
// If pattern matched, apply the transformation
|
|
62
|
-
if (patternMatches) {
|
|
63
|
-
try {
|
|
64
|
-
pattern.transform(tokens, tokenIndex, childIndex ?? undefined);
|
|
65
|
-
// For inline patterns, re-check the same position since tokens may have changed
|
|
66
|
-
if (pattern.name === "inline attributes" ||
|
|
67
|
-
pattern.name === "inline nesting 0") {
|
|
68
|
-
patternIndex--;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
console.error(`markdown-it-attrs: Error in pattern '${pattern.name}': ${error.message}`);
|
|
73
|
-
console.error(error.stack);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
184
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
185
|
+
if (tokens[i].type !== "inline") {
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
while (handleInlineAttributes(tokens[i])) {
|
|
189
|
+
// Loop until no more link-attribute pairs remain on this inline token.
|
|
76
190
|
}
|
|
191
|
+
handleEndOfBlock(tokens, i);
|
|
77
192
|
}
|
|
78
193
|
}
|
|
79
|
-
// Register the curlyAttrs function to run before linkify in the markdown-it processing pipeline
|
|
80
194
|
md.core.ruler.before("linkify", "curly_attributes", curlyAttrs);
|
|
81
195
|
}
|
|
82
196
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-it-attrs.js","sources":["../../../../../src/components/markdown/src/plugins/markdown-it-attrs.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown-it-attrs.js","sources":["../../../../../src/components/markdown/src/plugins/markdown-it-attrs.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AA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AC5C,SAAS,UAAU,CAAC,KAAgB,EAAA;AAClC,QAAA,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM;AAC3B,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE;gBAC/B;YACF;YACA,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;;YAE1C;AACA,YAAA,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;QAC7B;IACF;AAEA,IAAA,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,kBAAkB,EAAE,UAAU,CAAC;AACjE;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@carbon/web-components/es-custom/components/data-table/index.js";
|
|
2
2
|
import "@carbon/web-components/es-custom/components/checkbox/index.js";
|
|
3
|
-
import "@carbon/web-components/es-custom/components/button/index.js";
|
|
3
|
+
import "@carbon/web-components/es-custom/components/icon-button/index.js";
|
|
4
4
|
import "@carbon/web-components/es-custom/components/layer/index.js";
|
|
5
5
|
import type { CDSAIChatTable } from "./table.js";
|
|
6
6
|
/**
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import '@carbon/web-components/es-custom/components/data-table/index.js';
|
|
9
9
|
import '@carbon/web-components/es-custom/components/checkbox/index.js';
|
|
10
|
-
import '@carbon/web-components/es-custom/components/button/index.js';
|
|
10
|
+
import '@carbon/web-components/es-custom/components/icon-button/index.js';
|
|
11
11
|
import '@carbon/web-components/es-custom/components/layer/index.js';
|
|
12
12
|
import { iconLoader } from '@carbon/web-components/es-custom/globals/internal/icon-loader.js';
|
|
13
13
|
import Download16 from '@carbon/icons/es/download/16.js';
|
|
@@ -40,14 +40,14 @@ function tableTemplate(tableElement) {
|
|
|
40
40
|
aria-label=${filterPlaceholderText}
|
|
41
41
|
></cds-custom-table-toolbar-search>`
|
|
42
42
|
: ""}
|
|
43
|
-
<cds-custom-button
|
|
43
|
+
<cds-custom-icon-button
|
|
44
44
|
@click=${handleDownload}
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
align=${tooltipPosition}
|
|
46
|
+
kind="ghost"
|
|
47
47
|
>
|
|
48
|
-
${iconLoader(Download16)}
|
|
48
|
+
${iconLoader(Download16, { slot: "icon" })}
|
|
49
49
|
<span slot="tooltip-content">${downloadLabelText}</span>
|
|
50
|
-
</cds-custom-button>
|
|
50
|
+
</cds-custom-icon-button>
|
|
51
51
|
</cds-custom-table-toolbar-content>
|
|
52
52
|
</cds-custom-table-toolbar>`;
|
|
53
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.template.js","sources":["../../../../src/components/table/src/table.template.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;AAcH;;AAEG;AACH,SAAS,aAAa,CAAC,YAA4B,EAAA;AACjD,IAAA,MAAM,EACJ,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,EACN,eAAe,EAAE,cAAc,EAC/B,YAAY,EAAE,gBAAgB,EAC9B,eAAe,EAAE,mBAAmB,EACpC,kBAAkB,EAAE,iBAAiB,GACtC,GAAG,YAAY;AAEhB,IAAA,SAAS,cAAc,GAAA;;AAErB,QAAA,MAAM,KAAK,GACT,QAAQ,CAAC,GAAG,KAAK,KAAK,IAAI,QAAQ,CAAC,eAAe,CAAC,GAAG,KAAK,KAAK;QAClE,MAAM,eAAe,GAAG,KAAK,GAAG,aAAa,GAAG,YAAY;AAE5D,QAAA,OAAO,IAAI,CAAA,CAAA;;UAEL;cACE,IAAI,CAAA,CAAA;;4BAEY,qBAAqB;2BACtB,qBAAqB;AACP,wCAAA;AAC/B,cAAE,EAAE;;mBAEK,cAAc;
|
|
1
|
+
{"version":3,"file":"table.template.js","sources":["../../../../src/components/table/src/table.template.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;AAcH;;AAEG;AACH,SAAS,aAAa,CAAC,YAA4B,EAAA;AACjD,IAAA,MAAM,EACJ,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,EACN,eAAe,EAAE,cAAc,EAC/B,YAAY,EAAE,gBAAgB,EAC9B,eAAe,EAAE,mBAAmB,EACpC,kBAAkB,EAAE,iBAAiB,GACtC,GAAG,YAAY;AAEhB,IAAA,SAAS,cAAc,GAAA;;AAErB,QAAA,MAAM,KAAK,GACT,QAAQ,CAAC,GAAG,KAAK,KAAK,IAAI,QAAQ,CAAC,eAAe,CAAC,GAAG,KAAK,KAAK;QAClE,MAAM,eAAe,GAAG,KAAK,GAAG,aAAa,GAAG,YAAY;AAE5D,QAAA,OAAO,IAAI,CAAA,CAAA;;UAEL;cACE,IAAI,CAAA,CAAA;;4BAEY,qBAAqB;2BACtB,qBAAqB;AACP,wCAAA;AAC/B,cAAE,EAAE;;mBAEK,cAAc;kBACf,eAAe;;;YAGrB,UAAU,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACX,iBAAiB,CAAA;;;yBAGjC;IACvB;AAEA,IAAA,SAAS,cAAc,GAAA;AACrB,QAAA,OAAO,IAAI,CAAA,CAAA;;UAEL,OAAO,CAAC,GAAG,CACX,CAAC,MAAM,KACL,IAAI,CAAA,CAAA;AACC,eAAA,EAAA,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAA;cACjC,CACL;;sBAEa;IACpB;AAEA,IAAA,SAAS,WAAW,GAAA;AAClB,QAAA,OAAO,IAAI,CAAA,CAAA;QACP,MAAM,CACN,gBAAgB,EAChB,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,EACf,CAAC,GAAG,KACF,IAAI,CAAA,CAAA,kBAAA,EAAqB,GAAG,CAAC,EAAE;eAC1B,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAI;AACxB,YAAA,OAAO,IAAI,CAAA,CAAA;AACN,iBAAA,EAAA,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAA;gBAC7B;AACJ,QAAA,CAAC,CAAC,CAAA;YACF,CACL;sBACe;IACpB;;;;;AAOA,IAAA,OAAO,IAAI,CAAA,CAAA;;aAEA,MAAM;;;0BAGO,iBAAiB;;MAErC,UAAU;AACZ,QAAA,IAAI,CAAA,CAAA;SACC,UAAU,CAAA;AACb,KAAA,CAAA;MACA,gBAAgB;AAClB,QAAA,IAAI,CAAA,CAAA;SACC,gBAAgB,CAAA;AACnB,KAAA,CAAA;AACA,IAAA,EAAA,cAAc,EAAE,CAAA,CAAA,EAAI,cAAc,EAAE,CAAA,CAAA,EAAI,WAAW,EAAE;eAC5C;AACf;;;;"}
|
|
@@ -54,4 +54,16 @@ declare function walkComposedTree(node: Node, whatToShow?: number, filter?: (nod
|
|
|
54
54
|
* @returns A tuple containing the first and last focusable children. If no focusable children are found, `null` is returned for both
|
|
55
55
|
*/
|
|
56
56
|
declare function getFirstAndLastFocusableChildren(walker: IterableIterator<HTMLElement>): [first: HTMLElement | null, last: HTMLElement | null];
|
|
57
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Finds a descendant of `searchRoot` via `selector` and focuses it after the next
|
|
59
|
+
* two animation frames. Use when DOM updates (Lit, React, reorder) replace or move
|
|
60
|
+
* nodes so the previous focused element is detached (e.g. list pin/unpin).
|
|
61
|
+
*
|
|
62
|
+
* Tries {@link tryFocus} first for visibility/focusability checks; if that does
|
|
63
|
+
* not take focus (e.g. some custom element hosts), falls back to {@link HTMLElement.focus}.
|
|
64
|
+
*
|
|
65
|
+
* @param searchRoot - Root to query (`Element`, `ShadowRoot`, `Document`, or `DocumentFragment`, e.g. Lit `renderRoot`)
|
|
66
|
+
* @param selector - CSS selector that resolves to the node to focus.
|
|
67
|
+
*/
|
|
68
|
+
declare function focusElementAfterRepaint(searchRoot: Document | Element | ShadowRoot | DocumentFragment, selector: string): void;
|
|
69
|
+
export { getDeepActiveElement, isElementInvisible, isFocusable, tryFocus, walkComposedTree, getFirstAndLastFocusableChildren, focusElementAfterRepaint, };
|
|
@@ -175,6 +175,30 @@ function getFirstAndLastFocusableChildren(walker) {
|
|
|
175
175
|
}
|
|
176
176
|
return [firstFocusableChild, lastFocusableChild];
|
|
177
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* Finds a descendant of `searchRoot` via `selector` and focuses it after the next
|
|
180
|
+
* two animation frames. Use when DOM updates (Lit, React, reorder) replace or move
|
|
181
|
+
* nodes so the previous focused element is detached (e.g. list pin/unpin).
|
|
182
|
+
*
|
|
183
|
+
* Tries {@link tryFocus} first for visibility/focusability checks; if that does
|
|
184
|
+
* not take focus (e.g. some custom element hosts), falls back to {@link HTMLElement.focus}.
|
|
185
|
+
*
|
|
186
|
+
* @param searchRoot - Root to query (`Element`, `ShadowRoot`, `Document`, or `DocumentFragment`, e.g. Lit `renderRoot`)
|
|
187
|
+
* @param selector - CSS selector that resolves to the node to focus.
|
|
188
|
+
*/
|
|
189
|
+
function focusElementAfterRepaint(searchRoot, selector) {
|
|
190
|
+
requestAnimationFrame(() => {
|
|
191
|
+
requestAnimationFrame(() => {
|
|
192
|
+
const el = searchRoot.querySelector(selector);
|
|
193
|
+
if (!(el instanceof HTMLElement)) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (!tryFocus(el)) {
|
|
197
|
+
el.focus();
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
}
|
|
178
202
|
|
|
179
|
-
export { getDeepActiveElement, getFirstAndLastFocusableChildren, isElementInvisible, isFocusable, tryFocus, walkComposedTree };
|
|
203
|
+
export { focusElementAfterRepaint, getDeepActiveElement, getFirstAndLastFocusableChildren, isElementInvisible, isFocusable, tryFocus, walkComposedTree };
|
|
180
204
|
//# sourceMappingURL=focus-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus-utils.js","sources":["../../../src/globals/utils/focus-utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AAEH;;;;;;AAMG;AACH,SAAS,oBAAoB,GAAA;AAC3B,IAAA,IAAI,aAAa,GAAG,QAAQ,CAAC,aAAa;;IAG1C,OAAO,aAAa,EAAE;;AAEpB,QAAA,IAAI,aAAa,YAAY,eAAe,EAAE;AAC5C,YAAA,MAAM,gBAAgB,GAAG,aAAa,CAAC,gBAAgB,CAAC;AACtD,gBAAA,OAAO,EAAE,IAAI;AACd,aAAA,CAAC;;YAEF,MAAM,eAAe,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,EAAE,KAAI;AACnD,gBAAA,IAAK,EAAU,CAAC,UAAU,EAAE,aAAa,EAAE;AACzC,oBAAA,OAAO,IAAI;gBACb;AACA,gBAAA,QACE,EAAE,KAAK,QAAQ,CAAC,aAAa,IAAI,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC;AAExE,YAAA,CAAC,CAAC;YACF,IAAI,eAAe,EAAE;gBACnB,aAAa,GAAG,eAAe;gBAC/B;YACF;QACF;;AAGA,QAAA,MAAM,UAAU,GAAI,aAAqB,CAAC,UAAU;AACpD,QAAA,IAAI,UAAU,EAAE,aAAa,EAAE;AAC7B,YAAA,aAAa,GAAG,UAAU,CAAC,aAAa;YACxC;QACF;;QAGA;IACF;AAEA,IAAA,OAAO,aAAa;AACtB;AAEA;;;;;;AAMG;AACH,SAAS,kBAAkB,CACzB,OAAgB,EAChB,aAAuB,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAA;IAE9C,IAAI,CAAC,OAAO,IAAI,EAAE,OAAO,YAAY,WAAW,CAAC,EAAE;AACjD,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,IAAI,UAA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G,WAAW;QACnC;QACA,kBAAkB,GAAG,WAAW;IAClC;AAEA,IAAA,OAAO,CAAC,mBAAmB,EAAE,kBAAkB,CAAC;AAClD;AAEA;;;;;;;;;;AAUG;AACH,SAAS,wBAAwB,CAC/B,UAA8D,EAC9D,QAAgB,EAAA;IAEhB,qBAAqB,CAAC,MAAK;QACzB,qBAAqB,CAAC,MAAK;YACzB,MAAM,EAAE,GAAG,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC;AAC7C,YAAA,IAAI,EAAE,EAAE,YAAY,WAAW,CAAC,EAAE;gBAChC;YACF;AACA,YAAA,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;gBACjB,EAAE,CAAC,KAAK,EAAE;YACZ;AACF,QAAA,CAAC,CAAC;AACJ,IAAA,CAAC,CAAC;AACJ;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { createComponent } from '@lit/react';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import CDSAICarousel from '../components/carousel/src/carousel.js';
|
|
11
|
+
import { withWebComponentBridge } from './utils/withWebComponentBridge.js';
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Copyright IBM Corp. 2026
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*
|
|
19
|
+
* @license
|
|
20
|
+
*/
|
|
21
|
+
const Carousel = withWebComponentBridge(createComponent({
|
|
22
|
+
tagName: "cds-custom-aichat-carousel",
|
|
23
|
+
elementClass: CDSAICarousel,
|
|
24
|
+
react: React,
|
|
25
|
+
events: {
|
|
26
|
+
onChange: "cds-custom-aichat-carousel-onchange",
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
export { Carousel, Carousel as default };
|
|
31
|
+
//# sourceMappingURL=carousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel.js","sources":["../../src/react/carousel.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;AAOG;AASH,MAAM,QAAQ,GAAG,sBAAsB,CACrC,eAAe,CAAC;AACd,IAAA,OAAO,EAAE,qBAAqB;AAC9B,IAAA,YAAY,EAAE,aAAa;AAC3B,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,QAAQ,EAAE,8BAA8B;AACzC,KAAA;AACF,CAAA,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/ai-chat-components",
|
|
3
3
|
"description": "AI Chat Components",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0-rc.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@carbon/icon-helpers": "^10.47.0",
|
|
53
53
|
"@carbon/icons": "^11.53.0",
|
|
54
|
-
"@carbon/styles": "1.
|
|
54
|
+
"@carbon/styles": "1.105.0",
|
|
55
55
|
"@carbon/utilities": "^0.18.0",
|
|
56
56
|
"@carbon/web-components": "^2.51.1",
|
|
57
57
|
"@codemirror/autocomplete": "^6.20.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@lezer/highlight": "^1.1.6",
|
|
87
87
|
"@lit/react": "^1.0.8",
|
|
88
88
|
"csv-stringify": "^6.5.2",
|
|
89
|
-
"dompurify": "^3.
|
|
89
|
+
"dompurify": "^3.4.0",
|
|
90
90
|
"lit": "^3.1.0",
|
|
91
91
|
"lodash-es": "^4.18.1",
|
|
92
92
|
"markdown-it": "^14.1.0",
|
|
@@ -148,5 +148,5 @@
|
|
|
148
148
|
"web-dev-server-plugin-lit-css": "^4.0.0",
|
|
149
149
|
"webpack-dev-server": "^5.2.3"
|
|
150
150
|
},
|
|
151
|
-
"gitHead": "
|
|
151
|
+
"gitHead": "10b4979ee468b5df8110170020fe4525177c503b"
|
|
152
152
|
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Token } from "markdown-it";
|
|
2
|
-
import type { MarkdownItAttrsOptions, AttributePair, DetectingStrRule, DetectingRule, MatchedResult } from "./types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Parses attribute strings in the format {.class #id key=val} and returns an array of attribute key-value pairs.
|
|
5
|
-
*/
|
|
6
|
-
export declare function getAttrs(str: string, start: number, options: Required<MarkdownItAttrsOptions>): AttributePair[];
|
|
7
|
-
/**
|
|
8
|
-
* Applies an array of attribute pairs to a token, handling special cases for class and css-module attributes.
|
|
9
|
-
*/
|
|
10
|
-
export declare function addAttrs(attrs: AttributePair[], token: Token): Token;
|
|
11
|
-
/**
|
|
12
|
-
* Creates a function that tests whether a string contains attribute delimiters at a specified position (start, end, or only).
|
|
13
|
-
*/
|
|
14
|
-
export declare function hasDelimiters(where: "start" | "end" | "only", options: Required<MarkdownItAttrsOptions>): DetectingStrRule;
|
|
15
|
-
/**
|
|
16
|
-
* Removes attribute delimiters and their contents from the end of a string.
|
|
17
|
-
*/
|
|
18
|
-
export declare function removeDelimiter(str: string, options: Required<MarkdownItAttrsOptions>): string;
|
|
19
|
-
/**
|
|
20
|
-
* Finds the matching opening token for a given closing token by searching backwards through the token array.
|
|
21
|
-
*/
|
|
22
|
-
export declare function getMatchingOpeningToken(tokens: Token[], closingTokenIndex: number): Token | false;
|
|
23
|
-
/**
|
|
24
|
-
* Tests whether a token at a given index matches a detecting rule, recursively checking nested rules.
|
|
25
|
-
*/
|
|
26
|
-
export declare function test(tokens: Token[], baseIndex: number, rule: DetectingRule): MatchedResult;
|