@ceed/cds 1.23.0 → 1.23.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/dist/chunks/rehype-accent-FZRUD7VI.js +39 -0
- package/dist/components/data-display/DataTable.md +1 -1
- package/dist/components/surfaces/Sheet.md +1 -1
- package/dist/index.browser.js +8 -8
- package/dist/index.browser.js.map +3 -3
- package/dist/index.js +4 -60
- package/framer/index.js +1 -163
- package/package.json +13 -13
package/dist/index.js
CHANGED
|
@@ -1,59 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
-
var __esm = (fn, res) => function __init() {
|
|
4
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
5
|
-
};
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// src/libs/rehype-accent/index.ts
|
|
12
|
-
var rehype_accent_exports = {};
|
|
13
|
-
__export(rehype_accent_exports, {
|
|
14
|
-
rehypeAccent: () => rehypeAccent
|
|
15
|
-
});
|
|
16
|
-
import { visit } from "unist-util-visit";
|
|
17
|
-
function rehypeAccent(options) {
|
|
18
|
-
const { accentColor } = options;
|
|
19
|
-
return (tree) => {
|
|
20
|
-
visit(tree, "text", (node, index, parent) => {
|
|
21
|
-
const value = node.value;
|
|
22
|
-
const regex = /\|\|.*?\|\|/g;
|
|
23
|
-
let match;
|
|
24
|
-
let lastIndex = 0;
|
|
25
|
-
const newNodes = [];
|
|
26
|
-
while ((match = regex.exec(value)) !== null) {
|
|
27
|
-
if (match.index > lastIndex) {
|
|
28
|
-
newNodes.push({
|
|
29
|
-
type: "text",
|
|
30
|
-
value: value.slice(lastIndex, match.index)
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
const innerText = match[0].split("||")[1];
|
|
34
|
-
newNodes.push({
|
|
35
|
-
type: "element",
|
|
36
|
-
tagName: "span",
|
|
37
|
-
properties: { textColor: accentColor },
|
|
38
|
-
children: [{ type: "text", value: innerText }]
|
|
39
|
-
});
|
|
40
|
-
lastIndex = match.index + match[0].length;
|
|
41
|
-
}
|
|
42
|
-
if (lastIndex < value.length) {
|
|
43
|
-
newNodes.push({ type: "text", value: value.slice(lastIndex) });
|
|
44
|
-
}
|
|
45
|
-
if (newNodes.length) {
|
|
46
|
-
parent.children.splice(index, 1, ...newNodes);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
var init_rehype_accent = __esm({
|
|
52
|
-
"src/libs/rehype-accent/index.ts"() {
|
|
53
|
-
"use strict";
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
1
|
// src/index.ts
|
|
58
2
|
import {
|
|
59
3
|
useTheme as useTheme2,
|
|
@@ -5096,10 +5040,10 @@ import { Link as Link2 } from "@mui/joy";
|
|
|
5096
5040
|
import remarkGfm from "remark-gfm";
|
|
5097
5041
|
var LazyReactMarkdown = lazy(() => import("react-markdown"));
|
|
5098
5042
|
var Markdown = (props) => {
|
|
5099
|
-
const [
|
|
5043
|
+
const [rehypeAccent, setRehypeAccent] = useState12(null);
|
|
5100
5044
|
useEffect10(() => {
|
|
5101
5045
|
const loadRehypeAccent = async () => {
|
|
5102
|
-
const module = await
|
|
5046
|
+
const module = await import("./chunks/rehype-accent-FZRUD7VI.js");
|
|
5103
5047
|
setRehypeAccent(() => module.rehypeAccent);
|
|
5104
5048
|
};
|
|
5105
5049
|
loadRehypeAccent();
|
|
@@ -5116,7 +5060,7 @@ var Markdown = (props) => {
|
|
|
5116
5060
|
fallback,
|
|
5117
5061
|
...innerProps
|
|
5118
5062
|
} = props;
|
|
5119
|
-
if (!
|
|
5063
|
+
if (!rehypeAccent) {
|
|
5120
5064
|
return null;
|
|
5121
5065
|
}
|
|
5122
5066
|
return /* @__PURE__ */ React33.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ React33.createElement(
|
|
@@ -5129,7 +5073,7 @@ var Markdown = (props) => {
|
|
|
5129
5073
|
{
|
|
5130
5074
|
...markdownOptions,
|
|
5131
5075
|
children: content,
|
|
5132
|
-
rehypePlugins: [[
|
|
5076
|
+
rehypePlugins: [[rehypeAccent, { accentColor }]],
|
|
5133
5077
|
remarkPlugins: [remarkGfm],
|
|
5134
5078
|
components: {
|
|
5135
5079
|
a: ({ children, href }) => /* @__PURE__ */ React33.createElement(Link2, { href, target: defaultLinkAction }, children),
|