@carbon/ai-chat-components 1.1.0 → 1.2.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.
Files changed (141) hide show
  1. package/custom-elements.json +148 -775
  2. package/es/components/carousel/src/carousel.d.ts +1 -1
  3. package/es/components/carousel/src/carousel.js +5 -3
  4. package/es/components/carousel/src/carousel.js.map +1 -1
  5. package/es/components/chat-button/src/chat-button.scss.js +1 -1
  6. package/es/components/chat-history/src/chat-history.scss.js +1 -1
  7. package/es/components/chat-history/src/history-delete-panel.d.ts +10 -0
  8. package/es/components/chat-history/src/history-delete-panel.js +39 -0
  9. package/es/components/chat-history/src/history-delete-panel.js.map +1 -1
  10. package/es/components/chat-history/src/history-panel-item.js +1 -1
  11. package/es/components/chat-history/src/history-panel-item.js.map +1 -1
  12. package/es/components/chat-history/src/history-shell.d.ts +7 -0
  13. package/es/components/chat-history/src/history-shell.js +43 -0
  14. package/es/components/chat-history/src/history-shell.js.map +1 -1
  15. package/es/components/code-snippet/src/code-snippet.js +1 -0
  16. package/es/components/code-snippet/src/code-snippet.js.map +1 -1
  17. package/es/components/code-snippet/src/code-snippet.scss.js +1 -1
  18. package/es/components/code-snippet/src/codemirror/base-setup.d.ts +1 -0
  19. package/es/components/code-snippet/src/codemirror/base-setup.js +4 -1
  20. package/es/components/code-snippet/src/codemirror/base-setup.js.map +1 -1
  21. package/es/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +1 -0
  22. package/es/components/code-snippet/src/codemirror/codemirror-runtime.js +1 -0
  23. package/es/components/code-snippet/src/codemirror/codemirror-runtime.js.map +1 -1
  24. package/es/components/code-snippet/src/codemirror/diff-decorator.d.ts +30 -0
  25. package/es/components/code-snippet/src/codemirror/diff-decorator.js +80 -0
  26. package/es/components/code-snippet/src/codemirror/diff-decorator.js.map +1 -0
  27. package/es/components/code-snippet/src/codemirror/editor-manager.d.ts +2 -1
  28. package/es/components/code-snippet/src/codemirror/editor-manager.js +7 -2
  29. package/es/components/code-snippet/src/codemirror/editor-manager.js.map +1 -1
  30. package/es/components/markdown/src/markdown-token-tree.js +2 -10
  31. package/es/components/markdown/src/markdown-token-tree.js.map +1 -1
  32. package/es/components/markdown/src/plugins/markdown-it-attrs.d.ts +3 -3
  33. package/es/components/markdown/src/plugins/markdown-it-attrs.js +171 -57
  34. package/es/components/markdown/src/plugins/markdown-it-attrs.js.map +1 -1
  35. package/es/components/table/src/table.template.d.ts +1 -1
  36. package/es/components/table/src/table.template.js +6 -6
  37. package/es/components/table/src/table.template.js.map +1 -1
  38. package/es/globals/utils/focus-utils.d.ts +13 -1
  39. package/es/globals/utils/focus-utils.js +25 -1
  40. package/es/globals/utils/focus-utils.js.map +1 -1
  41. package/es/react/carousel.d.ts +4 -0
  42. package/es/react/carousel.js +31 -0
  43. package/es/react/carousel.js.map +1 -0
  44. package/es-custom/components/carousel/src/carousel.d.ts +1 -1
  45. package/es-custom/components/carousel/src/carousel.js +5 -3
  46. package/es-custom/components/carousel/src/carousel.js.map +1 -1
  47. package/es-custom/components/chat-button/src/chat-button.scss.js +1 -1
  48. package/es-custom/components/chat-history/src/chat-history.scss.js +1 -1
  49. package/es-custom/components/chat-history/src/history-delete-panel.d.ts +10 -0
  50. package/es-custom/components/chat-history/src/history-delete-panel.js +39 -0
  51. package/es-custom/components/chat-history/src/history-delete-panel.js.map +1 -1
  52. package/es-custom/components/chat-history/src/history-panel-item.js +1 -1
  53. package/es-custom/components/chat-history/src/history-panel-item.js.map +1 -1
  54. package/es-custom/components/chat-history/src/history-shell.d.ts +7 -0
  55. package/es-custom/components/chat-history/src/history-shell.js +43 -0
  56. package/es-custom/components/chat-history/src/history-shell.js.map +1 -1
  57. package/es-custom/components/code-snippet/src/code-snippet.js +1 -0
  58. package/es-custom/components/code-snippet/src/code-snippet.js.map +1 -1
  59. package/es-custom/components/code-snippet/src/code-snippet.scss.js +1 -1
  60. package/es-custom/components/code-snippet/src/codemirror/base-setup.d.ts +1 -0
  61. package/es-custom/components/code-snippet/src/codemirror/base-setup.js +4 -1
  62. package/es-custom/components/code-snippet/src/codemirror/base-setup.js.map +1 -1
  63. package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +1 -0
  64. package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.js +1 -0
  65. package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.js.map +1 -1
  66. package/es-custom/components/code-snippet/src/codemirror/diff-decorator.d.ts +30 -0
  67. package/es-custom/components/code-snippet/src/codemirror/diff-decorator.js +80 -0
  68. package/es-custom/components/code-snippet/src/codemirror/diff-decorator.js.map +1 -0
  69. package/es-custom/components/code-snippet/src/codemirror/editor-manager.d.ts +2 -1
  70. package/es-custom/components/code-snippet/src/codemirror/editor-manager.js +7 -2
  71. package/es-custom/components/code-snippet/src/codemirror/editor-manager.js.map +1 -1
  72. package/es-custom/components/markdown/src/markdown-token-tree.js +2 -10
  73. package/es-custom/components/markdown/src/markdown-token-tree.js.map +1 -1
  74. package/es-custom/components/markdown/src/plugins/markdown-it-attrs.d.ts +3 -3
  75. package/es-custom/components/markdown/src/plugins/markdown-it-attrs.js +171 -57
  76. package/es-custom/components/markdown/src/plugins/markdown-it-attrs.js.map +1 -1
  77. package/es-custom/components/table/src/table.template.d.ts +1 -1
  78. package/es-custom/components/table/src/table.template.js +6 -6
  79. package/es-custom/components/table/src/table.template.js.map +1 -1
  80. package/es-custom/globals/utils/focus-utils.d.ts +13 -1
  81. package/es-custom/globals/utils/focus-utils.js +25 -1
  82. package/es-custom/globals/utils/focus-utils.js.map +1 -1
  83. package/es-custom/react/carousel.d.ts +4 -0
  84. package/es-custom/react/carousel.js +31 -0
  85. package/es-custom/react/carousel.js.map +1 -0
  86. package/package.json +4 -4
  87. package/telemetry.yml +2 -2
  88. package/es/components/markdown/src/plugins/markdownItAttrs/core.d.ts +0 -26
  89. package/es/components/markdown/src/plugins/markdownItAttrs/core.js +0 -330
  90. package/es/components/markdown/src/plugins/markdownItAttrs/core.js.map +0 -1
  91. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.d.ts +0 -6
  92. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js +0 -63
  93. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js.map +0 -1
  94. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.d.ts +0 -6
  95. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.js +0 -43
  96. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/code.js.map +0 -1
  97. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.d.ts +0 -5
  98. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.js +0 -55
  99. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/index.js.map +0 -1
  100. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.d.ts +0 -19
  101. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js +0 -210
  102. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js.map +0 -1
  103. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.d.ts +0 -13
  104. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js +0 -156
  105. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js.map +0 -1
  106. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.d.ts +0 -13
  107. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js +0 -216
  108. package/es/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js.map +0 -1
  109. package/es/components/markdown/src/plugins/markdownItAttrs/types.d.ts +0 -34
  110. package/es/components/markdown/src/plugins/markdownItAttrs/types.js +0 -8
  111. package/es/components/markdown/src/plugins/markdownItAttrs/types.js.map +0 -1
  112. package/es/components/markdown/src/plugins/markdownItAttrs/utils.d.ts +0 -25
  113. package/es/components/markdown/src/plugins/markdownItAttrs/utils.js +0 -62
  114. package/es/components/markdown/src/plugins/markdownItAttrs/utils.js.map +0 -1
  115. package/es-custom/components/markdown/src/plugins/markdownItAttrs/core.d.ts +0 -26
  116. package/es-custom/components/markdown/src/plugins/markdownItAttrs/core.js +0 -330
  117. package/es-custom/components/markdown/src/plugins/markdownItAttrs/core.js.map +0 -1
  118. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.d.ts +0 -6
  119. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js +0 -63
  120. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/blocks.js.map +0 -1
  121. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.d.ts +0 -6
  122. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.js +0 -43
  123. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/code.js.map +0 -1
  124. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/index.d.ts +0 -5
  125. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/index.js +0 -55
  126. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/index.js.map +0 -1
  127. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.d.ts +0 -19
  128. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js +0 -210
  129. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/inline.js.map +0 -1
  130. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.d.ts +0 -13
  131. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js +0 -156
  132. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/lists.js.map +0 -1
  133. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.d.ts +0 -13
  134. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js +0 -216
  135. package/es-custom/components/markdown/src/plugins/markdownItAttrs/patterns/tables.js.map +0 -1
  136. package/es-custom/components/markdown/src/plugins/markdownItAttrs/types.d.ts +0 -34
  137. package/es-custom/components/markdown/src/plugins/markdownItAttrs/types.js +0 -8
  138. package/es-custom/components/markdown/src/plugins/markdownItAttrs/types.js.map +0 -1
  139. package/es-custom/components/markdown/src/plugins/markdownItAttrs/utils.d.ts +0 -25
  140. package/es-custom/components/markdown/src/plugins/markdownItAttrs/utils.js +0 -62
  141. package/es-custom/components/markdown/src/plugins/markdownItAttrs/utils.js.map +0 -1
@@ -1,216 +0,0 @@
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 { getMatchingOpeningToken, getAttrs, addAttrs, hasDelimiters } from '../core.js';
9
- import { hidden } from '../utils.js';
10
-
11
- /*
12
- * Copyright IBM Corp. 2025
13
- *
14
- * This source code is licensed under the Apache-2.0 license found in the
15
- * LICENSE file in the root directory of this source tree.
16
- *
17
- * @license
18
- */
19
- /**
20
- * Pattern for table attributes.
21
- */
22
- function createTablePattern(options) {
23
- return {
24
- name: "tables",
25
- tests: [
26
- {
27
- shift: 0,
28
- type: "table_close",
29
- },
30
- {
31
- shift: 1,
32
- type: "paragraph_open",
33
- },
34
- {
35
- shift: 2,
36
- type: "inline",
37
- content: hasDelimiters("only", options),
38
- },
39
- ],
40
- transform: (tokens, tokenIndex) => {
41
- const token = tokens[tokenIndex + 2];
42
- const tableOpen = getMatchingOpeningToken(tokens, tokenIndex);
43
- if (!tableOpen) {
44
- return;
45
- }
46
- const attrs = getAttrs(token.content, 0, options);
47
- addAttrs(attrs, tableOpen);
48
- tokens.splice(tokenIndex + 1, 3);
49
- },
50
- };
51
- }
52
- /**
53
- * Pattern for table header metadata calculation (used for colspan/rowspan).
54
- */
55
- function createTableTheadMetadataPattern() {
56
- return {
57
- name: "tables thead metadata",
58
- tests: [
59
- {
60
- shift: 0,
61
- type: "tr_close",
62
- },
63
- {
64
- shift: 1,
65
- type: "thead_close",
66
- },
67
- {
68
- shift: 2,
69
- type: "tbody_open",
70
- },
71
- ],
72
- transform: (tokens, tokenIndex) => {
73
- // Find the matching opening tr token
74
- const trOpen = getMatchingOpeningToken(tokens, tokenIndex);
75
- if (!trOpen) {
76
- return;
77
- }
78
- const thToken = tokens[tokenIndex - 1];
79
- let columnCount = 0;
80
- let currentIndex = tokenIndex;
81
- // Count the number of columns by walking backwards through table headers
82
- while (--currentIndex) {
83
- if (tokens[currentIndex] === trOpen) {
84
- // Store column count in metadata for use in tbody calculations
85
- tokens[currentIndex - 1].meta = Object.assign({}, tokens[currentIndex + 2].meta, {
86
- colsnum: columnCount,
87
- });
88
- break;
89
- }
90
- columnCount +=
91
- (tokens[currentIndex].level === thToken.level &&
92
- tokens[currentIndex].type === thToken.type
93
- ? 1
94
- : 0) >> 0;
95
- }
96
- // Also store column count in tbody metadata
97
- tokens[tokenIndex + 2].meta = Object.assign({}, tokens[tokenIndex + 2].meta, {
98
- colsnum: columnCount,
99
- });
100
- },
101
- };
102
- }
103
- /**
104
- * Pattern for table body calculation for handling colspan/rowspan.
105
- */
106
- function createTableTbodyCalculatePattern() {
107
- return {
108
- name: "tables tbody calculate",
109
- tests: [
110
- {
111
- shift: 0,
112
- type: "tbody_close",
113
- hidden: false,
114
- },
115
- ],
116
- transform: (tokens, tokenIndex) => {
117
- // Find the tbody_open token
118
- let tbodyOpenIndex = tokenIndex - 2;
119
- while (tbodyOpenIndex > 0 &&
120
- "tbody_open" !== tokens[--tbodyOpenIndex].type) {
121
- // Continue searching backwards
122
- }
123
- // Get the calculated column count from metadata
124
- const totalColumns = tokens[tbodyOpenIndex].meta?.colsnum ?? 0;
125
- if (totalColumns < 2) {
126
- return;
127
- }
128
- const targetLevel = tokens[tokenIndex].level + 2;
129
- // Process each token in the table body
130
- for (let currentTokenIndex = tbodyOpenIndex; currentTokenIndex < tokenIndex; currentTokenIndex++) {
131
- if (tokens[currentTokenIndex].level > targetLevel) {
132
- continue;
133
- }
134
- const token = tokens[currentTokenIndex];
135
- const rowspan = token.hidden
136
- ? 0
137
- : Number(token.attrGet("rowspan")) || 0;
138
- const colspan = token.hidden
139
- ? 0
140
- : Number(token.attrGet("colspan")) || 0;
141
- // Handle rowspan > 1: update metadata for affected rows
142
- if (rowspan > 1) {
143
- let availableColumns = totalColumns - (colspan > 0 ? colspan : 1);
144
- for (let searchIndex = currentTokenIndex, remainingRows = rowspan; searchIndex < tokenIndex && remainingRows > 1; searchIndex++) {
145
- if ("tr_open" == tokens[searchIndex].type) {
146
- tokens[searchIndex].meta = Object.assign({}, tokens[searchIndex].meta);
147
- if (tokens[searchIndex].meta &&
148
- tokens[searchIndex].meta.colsnum) {
149
- availableColumns -= 1;
150
- }
151
- tokens[searchIndex].meta.colsnum =
152
- availableColumns;
153
- remainingRows--;
154
- }
155
- }
156
- }
157
- // Hide cells that exceed the column count in a row
158
- if ("tr_open" == token.type &&
159
- token.meta &&
160
- token.meta.colsnum) {
161
- const maxColumns = token.meta.colsnum;
162
- for (let searchIndex = currentTokenIndex, cellCount = 0; searchIndex < tokenIndex; searchIndex++) {
163
- if ("td_open" == tokens[searchIndex].type) {
164
- cellCount += 1;
165
- }
166
- else if ("tr_close" == tokens[searchIndex].type) {
167
- break;
168
- }
169
- // Hide cells beyond the maximum column count
170
- if (cellCount > maxColumns) {
171
- tokens[searchIndex].hidden || hidden(tokens[searchIndex]);
172
- }
173
- }
174
- }
175
- // Handle colspan > 1: adjust colspan value and hide excess cells
176
- if (colspan > 1) {
177
- const cellIndices = [];
178
- let rowEndIndex = currentTokenIndex + 3;
179
- let columnsInRow = totalColumns;
180
- for (let searchIndex = currentTokenIndex; searchIndex > tbodyOpenIndex; searchIndex--) {
181
- if ("tr_open" == tokens[searchIndex].type) {
182
- columnsInRow =
183
- tokens[searchIndex].meta?.colsnum ??
184
- columnsInRow;
185
- break;
186
- }
187
- else if ("td_open" === tokens[searchIndex].type) {
188
- cellIndices.unshift(searchIndex);
189
- }
190
- }
191
- for (let searchIndex = currentTokenIndex + 2; searchIndex < tokenIndex; searchIndex++) {
192
- if ("tr_close" == tokens[searchIndex].type) {
193
- rowEndIndex = searchIndex;
194
- break;
195
- }
196
- else if ("td_open" == tokens[searchIndex].type) {
197
- cellIndices.push(searchIndex);
198
- }
199
- }
200
- const cellOffset = cellIndices.indexOf(currentTokenIndex);
201
- let actualColspan = columnsInRow - cellOffset;
202
- actualColspan = actualColspan > colspan ? colspan : actualColspan;
203
- if (colspan > actualColspan) {
204
- token.attrSet("colspan", actualColspan + "");
205
- }
206
- for (let hideIndex = cellIndices.slice(columnsInRow + 1 - totalColumns - actualColspan)[0]; hideIndex < rowEndIndex; hideIndex++) {
207
- tokens[hideIndex].hidden || hidden(tokens[hideIndex]);
208
- }
209
- }
210
- }
211
- },
212
- };
213
- }
214
-
215
- export { createTablePattern, createTableTbodyCalculatePattern, createTableTheadMetadataPattern };
216
- //# sourceMappingURL=tables.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tables.js","sources":["../../../../../../../src/components/markdown/src/plugins/markdownItAttrs/patterns/tables.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;;;AAOG;AAWH;;AAEG;AACG,SAAU,kBAAkB,CAChC,OAAyC,EAAA;IAEzC,OAAO;AACL,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,KAAK,EAAE;AACL,YAAA;AACE,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,IAAI,EAAE,aAAa;AACpB,aAAA;AACD,YAAA;AACE,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,IAAI,EAAE,gBAAgB;AACvB,aAAA;AACD,YAAA;AACE,gBAAA,KAAK,EAAE,CAAC;AACR,gBAAA,IAAI,EAAE,QAAQ;AACd,gBAAA,OAAO,EAAE,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC;AACxC,aAAA;AACF,SAAA;AACD,QAAA,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,KAAI;YAChC,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;YACpC,MAAM,SAAS,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,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE;4BAC1C,WAAW,GAAG,WAAW;4BACzB;wBACF;6BAAO,IAAI,SAAS,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE;AAChD,4BAAA,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;wBAC/B;oBACF;oBAEA,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC;AACzD,oBAAA,IAAI,aAAa,GAAG,YAAY,GAAG,UAAU;AAC7C,oBAAA,aAAa,GAAG,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa;AACjE,oBAAA,IAAI,OAAO,GAAG,aAAa,EAAE;wBAC3B,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,GAAG,EAAE,CAAC;oBAC9C;oBAEA,KACE,IAAI,SAAS,GAAG,WAAW,CAAC,KAAK,CAC/B,YAAY,GAAG,CAAC,GAAG,YAAY,GAAG,aAAa,CAChD,CAAC,CAAC,CAAC,EACJ,SAAS,GAAG,WAAW,EACvB,SAAS,EAAE,EACX;AACA,wBAAA,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;oBACvD;gBACF;YACF;QACF,CAAC;KACF;AACH;;;;"}
@@ -1,34 +0,0 @@
1
- import type { Token } from "markdown-it";
2
- export interface MarkdownItAttrsOptions {
3
- leftDelimiter?: string;
4
- rightDelimiter?: string;
5
- allowedAttributes?: (string | RegExp)[];
6
- }
7
- export type AttributePair = [string, string];
8
- export type DetectingStrRule = (str: string) => boolean;
9
- export interface DetectingRule {
10
- shift?: number;
11
- position?: number;
12
- type?: string | DetectingStrRule;
13
- tag?: string | DetectingStrRule;
14
- children?: DetectingRule[] | ((arr: unknown[]) => boolean);
15
- content?: string | DetectingStrRule;
16
- markup?: string | DetectingStrRule;
17
- info?: string | DetectingStrRule;
18
- nesting?: number;
19
- level?: number;
20
- block?: boolean;
21
- hidden?: boolean;
22
- attrs?: AttributePair[];
23
- map?: [number, number][];
24
- meta?: unknown;
25
- }
26
- export interface CurlyAttrsPattern {
27
- name: string;
28
- tests: DetectingRule[];
29
- transform: (tokens: Token[], i: number, j?: number) => void;
30
- }
31
- export interface MatchedResult {
32
- match: boolean;
33
- j: number | null;
34
- }
@@ -1,8 +0,0 @@
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
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,25 +0,0 @@
1
- import type { Token } from "markdown-it";
2
- /**
3
- * Escapes special regex characters in a string for use in regular expressions.
4
- */
5
- export declare function escapeRegExp(s: string): string;
6
- /**
7
- * Gets an element from an array, supporting negative indices for accessing from the end.
8
- */
9
- export declare function get<T>(arr: T[], n: number): T | undefined;
10
- /**
11
- * Returns the last element of an array, or an empty object if the array is empty.
12
- */
13
- export declare function last<T>(arr: T[]): T;
14
- /**
15
- * Type guard to check if a value is a non-empty array of objects.
16
- */
17
- export declare function isArrayOfObjects(arr: unknown): arr is Record<string, unknown>[];
18
- /**
19
- * Type guard to check if a value is a non-empty array of functions.
20
- */
21
- export declare function isArrayOfFunctions(arr: unknown): arr is ((arg: unknown) => boolean)[];
22
- /**
23
- * Recursively hides a token and all its children by setting their hidden flag and clearing content.
24
- */
25
- export declare function hidden(token: Token): void;
@@ -1,62 +0,0 @@
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
- /*
9
- * Copyright IBM Corp. 2025
10
- *
11
- * This source code is licensed under the Apache-2.0 license found in the
12
- * LICENSE file in the root directory of this source tree.
13
- *
14
- * @license
15
- */
16
- /**
17
- * Escapes special regex characters in a string for use in regular expressions.
18
- */
19
- function escapeRegExp(s) {
20
- return s.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
21
- }
22
- /**
23
- * Gets an element from an array, supporting negative indices for accessing from the end.
24
- */
25
- function get(arr, n) {
26
- return n >= 0 ? arr[n] : arr[arr.length + n];
27
- }
28
- /**
29
- * Returns the last element of an array, or an empty object if the array is empty.
30
- */
31
- function last(arr) {
32
- return arr.slice(-1)[0] || {};
33
- }
34
- /**
35
- * Type guard to check if a value is a non-empty array of objects.
36
- */
37
- function isArrayOfObjects(arr) {
38
- return (Array.isArray(arr) &&
39
- arr.length > 0 &&
40
- arr.every((i) => typeof i === "object"));
41
- }
42
- /**
43
- * Type guard to check if a value is a non-empty array of functions.
44
- */
45
- function isArrayOfFunctions(arr) {
46
- return (Array.isArray(arr) &&
47
- arr.length > 0 &&
48
- arr.every((i) => typeof i === "function"));
49
- }
50
- /**
51
- * Recursively hides a token and all its children by setting their hidden flag and clearing content.
52
- */
53
- function hidden(token) {
54
- token.hidden = true;
55
- token.children?.forEach((t) => {
56
- t.content = "";
57
- hidden(t);
58
- });
59
- }
60
-
61
- export { escapeRegExp, get, hidden, isArrayOfFunctions, isArrayOfObjects, last };
62
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../src/components/markdown/src/plugins/markdownItAttrs/utils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AAIH;;AAEG;AACG,SAAU,YAAY,CAAC,CAAS,EAAA;IACpC,OAAO,CAAC,CAAC,OAAO,CAAC,uBAAuB,EAAE,MAAM,CAAC;AACnD;AAEA;;AAEG;AACG,SAAU,GAAG,CAAI,GAAQ,EAAE,CAAS,EAAA;IACxC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9C;AAEA;;AAEG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