@ant-design/agentic-ui 2.30.8 → 2.30.9
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.
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* 避免普通文本中的 `:15`(时间)或 `:icon[...]` 被误解析为指令。
|
|
4
4
|
*
|
|
5
5
|
* 依赖与 `remark-directive` 相同:`micromark-extension-directive` + `mdast-util-directive`。
|
|
6
|
+
*
|
|
7
|
+
* 仅使用官方入口 `directive()` 中与 `lib/syntax.js` 一致的 flow[58][0](容器指令),
|
|
8
|
+
* 避免深层路径 `lib/directive-container.js`(未列入 package exports,Next/Turbopack 等会解析失败)。
|
|
6
9
|
*/
|
|
7
10
|
import type { Root } from 'mdast';
|
|
8
11
|
import type { Plugin } from 'unified';
|
|
@@ -3,8 +3,39 @@
|
|
|
3
3
|
* 避免普通文本中的 `:15`(时间)或 `:icon[...]` 被误解析为指令。
|
|
4
4
|
*
|
|
5
5
|
* 依赖与 `remark-directive` 相同:`micromark-extension-directive` + `mdast-util-directive`。
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
*
|
|
7
|
+
* 仅使用官方入口 `directive()` 中与 `lib/syntax.js` 一致的 flow[58][0](容器指令),
|
|
8
|
+
* 避免深层路径 `lib/directive-container.js`(未列入 package exports,Next/Turbopack 等会解析失败)。
|
|
9
|
+
*/ function _define_property(obj, key, value) {
|
|
10
|
+
if (key in obj) {
|
|
11
|
+
Object.defineProperty(obj, key, {
|
|
12
|
+
value: value,
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true
|
|
16
|
+
});
|
|
17
|
+
} else {
|
|
18
|
+
obj[key] = value;
|
|
19
|
+
}
|
|
20
|
+
return obj;
|
|
21
|
+
}
|
|
22
|
+
import { directiveFromMarkdown, directiveToMarkdown } from "mdast-util-directive";
|
|
23
|
+
import { directive } from "micromark-extension-directive";
|
|
24
|
+
/** `:` — 与 micromark-extension-directive 内 `syntax.js` 中 flow/text 映射键一致 */ var MICROMARK_DIRECTIVE_MARK = 58;
|
|
25
|
+
var directiveContainerOnlyMicromarkExtension = function() {
|
|
26
|
+
var _ext_flow;
|
|
27
|
+
var ext = directive();
|
|
28
|
+
var atColon = (_ext_flow = ext.flow) === null || _ext_flow === void 0 ? void 0 : _ext_flow[MICROMARK_DIRECTIVE_MARK];
|
|
29
|
+
var container = Array.isArray(atColon) ? atColon[0] : atColon;
|
|
30
|
+
if (!container) {
|
|
31
|
+
throw new Error('micromark-extension-directive: expected container construct on flow[58]');
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
flow: _define_property({}, MICROMARK_DIRECTIVE_MARK, [
|
|
35
|
+
container
|
|
36
|
+
])
|
|
37
|
+
};
|
|
38
|
+
}();
|
|
8
39
|
/**
|
|
9
40
|
* @returns {undefined}
|
|
10
41
|
* Nothing.
|
|
@@ -13,13 +44,7 @@ import { directiveContainer } from "micromark-extension-directive/lib/directive-
|
|
|
13
44
|
var micromarkExtensions = data.micromarkExtensions || (data.micromarkExtensions = []);
|
|
14
45
|
var fromMarkdownExtensions = data.fromMarkdownExtensions || (data.fromMarkdownExtensions = []);
|
|
15
46
|
var toMarkdownExtensions = data.toMarkdownExtensions || (data.toMarkdownExtensions = []);
|
|
16
|
-
micromarkExtensions.push(
|
|
17
|
-
flow: {
|
|
18
|
-
58: [
|
|
19
|
-
directiveContainer
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
});
|
|
47
|
+
micromarkExtensions.push(directiveContainerOnlyMicromarkExtension);
|
|
23
48
|
fromMarkdownExtensions.push(directiveFromMarkdown());
|
|
24
49
|
toMarkdownExtensions.push(directiveToMarkdown());
|
|
25
50
|
};
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* micromark-extension-directive 未在 package exports 中声明子路径;运行时由 bundler 解析至 lib/
|
|
3
|
-
*/
|
|
4
|
-
declare module 'micromark-extension-directive/lib/directive-container.js' {
|
|
5
|
-
import type { Construct } from 'micromark-util-types';
|
|
6
|
-
|
|
7
|
-
export const directiveContainer: Construct;
|
|
8
|
-
}
|