@ceed/ads 1.24.0 → 1.24.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/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,
@@ -6094,10 +6038,10 @@ import { Link as Link2 } from "@mui/joy";
6094
6038
  import remarkGfm from "remark-gfm";
6095
6039
  var LazyReactMarkdown = lazy(() => import("react-markdown"));
6096
6040
  var Markdown = (props) => {
6097
- const [rehypeAccent2, setRehypeAccent] = useState15(null);
6041
+ const [rehypeAccent, setRehypeAccent] = useState15(null);
6098
6042
  useEffect12(() => {
6099
6043
  const loadRehypeAccent = async () => {
6100
- const module = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
6044
+ const module = await import("./chunks/rehype-accent-FZRUD7VI.js");
6101
6045
  setRehypeAccent(() => module.rehypeAccent);
6102
6046
  };
6103
6047
  loadRehypeAccent();
@@ -6114,7 +6058,7 @@ var Markdown = (props) => {
6114
6058
  fallback,
6115
6059
  ...innerProps
6116
6060
  } = props;
6117
- if (!rehypeAccent2) {
6061
+ if (!rehypeAccent) {
6118
6062
  return null;
6119
6063
  }
6120
6064
  return /* @__PURE__ */ React44.createElement(Typography, { component: "div", color, textColor, level: defaultLevel, ...innerProps }, /* @__PURE__ */ React44.createElement(
@@ -6127,7 +6071,7 @@ var Markdown = (props) => {
6127
6071
  {
6128
6072
  ...markdownOptions,
6129
6073
  children: content,
6130
- rehypePlugins: [[rehypeAccent2, { accentColor }]],
6074
+ rehypePlugins: [[rehypeAccent, { accentColor }]],
6131
6075
  remarkPlugins: [remarkGfm],
6132
6076
  components: {
6133
6077
  a: ({ children, href }) => /* @__PURE__ */ React44.createElement(Link2, { href, target: defaultLinkAction }, children),