@ceed/ads 1.2.2-next.4 → 1.2.2-next.5
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/components/Markdown/Markdown.d.ts +1 -1
- package/dist/index.cjs +62 -40
- package/dist/index.js +79 -51
- package/framer/index.js +28 -28
- package/package.json +1 -1
|
@@ -27,7 +27,7 @@ declare const Markdown: {
|
|
|
27
27
|
defaultLinkAction?: "_self" | "_blank" | "_parent" | "_top" | "_unfencedTop" | undefined;
|
|
28
28
|
markdownOptions?: import("react-markdown").Options | undefined;
|
|
29
29
|
boldFontWeight?: "sm" | "md" | "lg" | "xl" | undefined;
|
|
30
|
-
}): React.JSX.Element;
|
|
30
|
+
}): React.JSX.Element | null;
|
|
31
31
|
displayName: string;
|
|
32
32
|
};
|
|
33
33
|
export { Markdown };
|
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __esm = (fn, res) => function __init() {
|
|
9
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
+
};
|
|
8
11
|
var __export = (target, all) => {
|
|
9
12
|
for (var name in all)
|
|
10
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -27,6 +30,53 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
30
|
));
|
|
28
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
32
|
|
|
33
|
+
// src/libs/rehype-accent/index.ts
|
|
34
|
+
var rehype_accent_exports = {};
|
|
35
|
+
__export(rehype_accent_exports, {
|
|
36
|
+
rehypeAccent: () => rehypeAccent
|
|
37
|
+
});
|
|
38
|
+
function rehypeAccent(options) {
|
|
39
|
+
const { accentColor } = options;
|
|
40
|
+
return (tree) => {
|
|
41
|
+
(0, import_unist_util_visit.visit)(tree, "text", (node, index, parent) => {
|
|
42
|
+
const value = node.value;
|
|
43
|
+
const regex = /\|\|.*?\|\|/g;
|
|
44
|
+
let match;
|
|
45
|
+
let lastIndex = 0;
|
|
46
|
+
const newNodes = [];
|
|
47
|
+
while ((match = regex.exec(value)) !== null) {
|
|
48
|
+
if (match.index > lastIndex) {
|
|
49
|
+
newNodes.push({
|
|
50
|
+
type: "text",
|
|
51
|
+
value: value.slice(lastIndex, match.index)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const innerText = match[0].split("||")[1];
|
|
55
|
+
newNodes.push({
|
|
56
|
+
type: "element",
|
|
57
|
+
tagName: "p",
|
|
58
|
+
properties: { textColor: accentColor },
|
|
59
|
+
children: [{ type: "text", value: innerText }]
|
|
60
|
+
});
|
|
61
|
+
lastIndex = match.index + match[0].length;
|
|
62
|
+
}
|
|
63
|
+
if (lastIndex < value.length) {
|
|
64
|
+
newNodes.push({ type: "text", value: value.slice(lastIndex) });
|
|
65
|
+
}
|
|
66
|
+
if (newNodes.length) {
|
|
67
|
+
parent.children.splice(index, 1, ...newNodes);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
var import_unist_util_visit;
|
|
73
|
+
var init_rehype_accent = __esm({
|
|
74
|
+
"src/libs/rehype-accent/index.ts"() {
|
|
75
|
+
"use strict";
|
|
76
|
+
import_unist_util_visit = require("unist-util-visit");
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
30
80
|
// src/index.ts
|
|
31
81
|
var index_exports = {};
|
|
32
82
|
__export(index_exports, {
|
|
@@ -4679,47 +4729,16 @@ var import_joy42 = require("@mui/joy");
|
|
|
4679
4729
|
// src/components/Markdown/Markdown.tsx
|
|
4680
4730
|
var import_react32 = __toESM(require("react"));
|
|
4681
4731
|
var import_joy43 = require("@mui/joy");
|
|
4682
|
-
|
|
4683
|
-
// src/libs/rehype-accent/index.ts
|
|
4684
|
-
var import_unist_util_visit = require("unist-util-visit");
|
|
4685
|
-
function rehypeAccent(options) {
|
|
4686
|
-
const { accentColor } = options;
|
|
4687
|
-
return (tree) => {
|
|
4688
|
-
(0, import_unist_util_visit.visit)(tree, "text", (node, index, parent) => {
|
|
4689
|
-
const value = node.value;
|
|
4690
|
-
const regex = /\|\|.*?\|\|/g;
|
|
4691
|
-
let match;
|
|
4692
|
-
let lastIndex = 0;
|
|
4693
|
-
const newNodes = [];
|
|
4694
|
-
while ((match = regex.exec(value)) !== null) {
|
|
4695
|
-
if (match.index > lastIndex) {
|
|
4696
|
-
newNodes.push({
|
|
4697
|
-
type: "text",
|
|
4698
|
-
value: value.slice(lastIndex, match.index)
|
|
4699
|
-
});
|
|
4700
|
-
}
|
|
4701
|
-
const innerText = match[0].split("||")[1];
|
|
4702
|
-
newNodes.push({
|
|
4703
|
-
type: "element",
|
|
4704
|
-
tagName: "p",
|
|
4705
|
-
properties: { textColor: accentColor },
|
|
4706
|
-
children: [{ type: "text", value: innerText }]
|
|
4707
|
-
});
|
|
4708
|
-
lastIndex = match.index + match[0].length;
|
|
4709
|
-
}
|
|
4710
|
-
if (lastIndex < value.length) {
|
|
4711
|
-
newNodes.push({ type: "text", value: value.slice(lastIndex) });
|
|
4712
|
-
}
|
|
4713
|
-
if (newNodes.length) {
|
|
4714
|
-
parent.children.splice(index, 1, ...newNodes);
|
|
4715
|
-
}
|
|
4716
|
-
});
|
|
4717
|
-
};
|
|
4718
|
-
}
|
|
4719
|
-
|
|
4720
|
-
// src/components/Markdown/Markdown.tsx
|
|
4721
4732
|
var LazyReactMarkdown = (0, import_react32.lazy)(() => import("react-markdown"));
|
|
4722
4733
|
var Markdown = (props) => {
|
|
4734
|
+
const [rehypeAccent2, setRehypeAccent] = (0, import_react32.useState)(null);
|
|
4735
|
+
(0, import_react32.useEffect)(() => {
|
|
4736
|
+
const loadRehypeAccent = async () => {
|
|
4737
|
+
const module2 = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
4738
|
+
setRehypeAccent(() => module2.rehypeAccent);
|
|
4739
|
+
};
|
|
4740
|
+
loadRehypeAccent();
|
|
4741
|
+
}, []);
|
|
4723
4742
|
const {
|
|
4724
4743
|
color,
|
|
4725
4744
|
textColor,
|
|
@@ -4731,6 +4750,9 @@ var Markdown = (props) => {
|
|
|
4731
4750
|
content,
|
|
4732
4751
|
...innerProps
|
|
4733
4752
|
} = props;
|
|
4753
|
+
if (!rehypeAccent2) {
|
|
4754
|
+
return null;
|
|
4755
|
+
}
|
|
4734
4756
|
return /* @__PURE__ */ import_react32.default.createElement(
|
|
4735
4757
|
Typography,
|
|
4736
4758
|
{
|
|
@@ -4745,7 +4767,7 @@ var Markdown = (props) => {
|
|
|
4745
4767
|
{
|
|
4746
4768
|
...markdownOptions,
|
|
4747
4769
|
children: content,
|
|
4748
|
-
rehypePlugins: [[
|
|
4770
|
+
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
4749
4771
|
components: {
|
|
4750
4772
|
h1: ({ children }) => /* @__PURE__ */ import_react32.default.createElement(Typography, { color, textColor, level: "h1" }, children),
|
|
4751
4773
|
h2: ({ children }) => /* @__PURE__ */ import_react32.default.createElement(Typography, { color, textColor, level: "h2" }, children),
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,59 @@
|
|
|
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: "p",
|
|
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
|
+
|
|
1
57
|
// src/index.ts
|
|
2
58
|
import {
|
|
3
59
|
useTheme as useTheme2,
|
|
@@ -4639,49 +4695,18 @@ Uploader.displayName = "Uploader";
|
|
|
4639
4695
|
import { Grid } from "@mui/joy";
|
|
4640
4696
|
|
|
4641
4697
|
// src/components/Markdown/Markdown.tsx
|
|
4642
|
-
import React30, { lazy, Suspense } from "react";
|
|
4698
|
+
import React30, { lazy, Suspense, useEffect as useEffect8, useState as useState9 } from "react";
|
|
4643
4699
|
import { Link as Link2 } from "@mui/joy";
|
|
4644
|
-
|
|
4645
|
-
// src/libs/rehype-accent/index.ts
|
|
4646
|
-
import { visit } from "unist-util-visit";
|
|
4647
|
-
function rehypeAccent(options) {
|
|
4648
|
-
const { accentColor } = options;
|
|
4649
|
-
return (tree) => {
|
|
4650
|
-
visit(tree, "text", (node, index, parent) => {
|
|
4651
|
-
const value = node.value;
|
|
4652
|
-
const regex = /\|\|.*?\|\|/g;
|
|
4653
|
-
let match;
|
|
4654
|
-
let lastIndex = 0;
|
|
4655
|
-
const newNodes = [];
|
|
4656
|
-
while ((match = regex.exec(value)) !== null) {
|
|
4657
|
-
if (match.index > lastIndex) {
|
|
4658
|
-
newNodes.push({
|
|
4659
|
-
type: "text",
|
|
4660
|
-
value: value.slice(lastIndex, match.index)
|
|
4661
|
-
});
|
|
4662
|
-
}
|
|
4663
|
-
const innerText = match[0].split("||")[1];
|
|
4664
|
-
newNodes.push({
|
|
4665
|
-
type: "element",
|
|
4666
|
-
tagName: "p",
|
|
4667
|
-
properties: { textColor: accentColor },
|
|
4668
|
-
children: [{ type: "text", value: innerText }]
|
|
4669
|
-
});
|
|
4670
|
-
lastIndex = match.index + match[0].length;
|
|
4671
|
-
}
|
|
4672
|
-
if (lastIndex < value.length) {
|
|
4673
|
-
newNodes.push({ type: "text", value: value.slice(lastIndex) });
|
|
4674
|
-
}
|
|
4675
|
-
if (newNodes.length) {
|
|
4676
|
-
parent.children.splice(index, 1, ...newNodes);
|
|
4677
|
-
}
|
|
4678
|
-
});
|
|
4679
|
-
};
|
|
4680
|
-
}
|
|
4681
|
-
|
|
4682
|
-
// src/components/Markdown/Markdown.tsx
|
|
4683
4700
|
var LazyReactMarkdown = lazy(() => import("react-markdown"));
|
|
4684
4701
|
var Markdown = (props) => {
|
|
4702
|
+
const [rehypeAccent2, setRehypeAccent] = useState9(null);
|
|
4703
|
+
useEffect8(() => {
|
|
4704
|
+
const loadRehypeAccent = async () => {
|
|
4705
|
+
const module = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
4706
|
+
setRehypeAccent(() => module.rehypeAccent);
|
|
4707
|
+
};
|
|
4708
|
+
loadRehypeAccent();
|
|
4709
|
+
}, []);
|
|
4685
4710
|
const {
|
|
4686
4711
|
color,
|
|
4687
4712
|
textColor,
|
|
@@ -4693,6 +4718,9 @@ var Markdown = (props) => {
|
|
|
4693
4718
|
content,
|
|
4694
4719
|
...innerProps
|
|
4695
4720
|
} = props;
|
|
4721
|
+
if (!rehypeAccent2) {
|
|
4722
|
+
return null;
|
|
4723
|
+
}
|
|
4696
4724
|
return /* @__PURE__ */ React30.createElement(
|
|
4697
4725
|
Typography,
|
|
4698
4726
|
{
|
|
@@ -4707,7 +4735,7 @@ var Markdown = (props) => {
|
|
|
4707
4735
|
{
|
|
4708
4736
|
...markdownOptions,
|
|
4709
4737
|
children: content,
|
|
4710
|
-
rehypePlugins: [[
|
|
4738
|
+
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
4711
4739
|
components: {
|
|
4712
4740
|
h1: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: "h1" }, children),
|
|
4713
4741
|
h2: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: "h2" }, children),
|
|
@@ -4802,10 +4830,10 @@ MenuButton.displayName = "MenuButton";
|
|
|
4802
4830
|
import React32, {
|
|
4803
4831
|
forwardRef as forwardRef9,
|
|
4804
4832
|
useCallback as useCallback12,
|
|
4805
|
-
useEffect as
|
|
4833
|
+
useEffect as useEffect9,
|
|
4806
4834
|
useImperativeHandle as useImperativeHandle4,
|
|
4807
4835
|
useRef as useRef7,
|
|
4808
|
-
useState as
|
|
4836
|
+
useState as useState10
|
|
4809
4837
|
} from "react";
|
|
4810
4838
|
import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
|
|
4811
4839
|
import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
|
|
@@ -4918,9 +4946,9 @@ var MonthPicker = forwardRef9(
|
|
|
4918
4946
|
),
|
|
4919
4947
|
{ disableStrict: true }
|
|
4920
4948
|
);
|
|
4921
|
-
const [anchorEl, setAnchorEl] =
|
|
4949
|
+
const [anchorEl, setAnchorEl] = useState10(null);
|
|
4922
4950
|
const open = Boolean(anchorEl);
|
|
4923
|
-
|
|
4951
|
+
useEffect9(() => {
|
|
4924
4952
|
if (!anchorEl) {
|
|
4925
4953
|
innerRef.current?.blur();
|
|
4926
4954
|
}
|
|
@@ -5051,11 +5079,11 @@ var MonthPicker = forwardRef9(
|
|
|
5051
5079
|
import React33, {
|
|
5052
5080
|
forwardRef as forwardRef10,
|
|
5053
5081
|
useCallback as useCallback13,
|
|
5054
|
-
useEffect as
|
|
5082
|
+
useEffect as useEffect10,
|
|
5055
5083
|
useImperativeHandle as useImperativeHandle5,
|
|
5056
5084
|
useMemo as useMemo11,
|
|
5057
5085
|
useRef as useRef8,
|
|
5058
|
-
useState as
|
|
5086
|
+
useState as useState11
|
|
5059
5087
|
} from "react";
|
|
5060
5088
|
import { IMaskInput as IMaskInput4, IMask as IMask4 } from "react-imask";
|
|
5061
5089
|
import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
|
|
@@ -5177,13 +5205,13 @@ var MonthRangePicker = forwardRef10(
|
|
|
5177
5205
|
),
|
|
5178
5206
|
{ disableStrict: true }
|
|
5179
5207
|
);
|
|
5180
|
-
const [anchorEl, setAnchorEl] =
|
|
5208
|
+
const [anchorEl, setAnchorEl] = useState11(null);
|
|
5181
5209
|
const open = Boolean(anchorEl);
|
|
5182
5210
|
const calendarValue = useMemo11(
|
|
5183
5211
|
() => value ? parseDates2(value) : void 0,
|
|
5184
5212
|
[value]
|
|
5185
5213
|
);
|
|
5186
|
-
|
|
5214
|
+
useEffect10(() => {
|
|
5187
5215
|
if (!anchorEl) {
|
|
5188
5216
|
innerRef.current?.blur();
|
|
5189
5217
|
}
|
|
@@ -5432,7 +5460,7 @@ function Navigator(props) {
|
|
|
5432
5460
|
Navigator.displayName = "Navigator";
|
|
5433
5461
|
|
|
5434
5462
|
// src/components/PercentageInput/PercentageInput.tsx
|
|
5435
|
-
import React37, { useCallback as useCallback14, useMemo as useMemo12, useState as
|
|
5463
|
+
import React37, { useCallback as useCallback14, useMemo as useMemo12, useState as useState12 } from "react";
|
|
5436
5464
|
import { NumericFormat as NumericFormat2 } from "react-number-format";
|
|
5437
5465
|
import { styled as styled23, useThemeProps as useThemeProps8 } from "@mui/joy";
|
|
5438
5466
|
var padDecimal = (value, decimalScale) => {
|
|
@@ -5495,7 +5523,7 @@ var PercentageInput = React37.forwardRef(function PercentageInput2(inProps, ref)
|
|
|
5495
5523
|
[onChange, name]
|
|
5496
5524
|
)
|
|
5497
5525
|
);
|
|
5498
|
-
const [internalError, setInternalError] =
|
|
5526
|
+
const [internalError, setInternalError] = useState12(
|
|
5499
5527
|
max && _value && _value > max || min && _value && _value < min
|
|
5500
5528
|
);
|
|
5501
5529
|
const value = useMemo12(() => {
|