@ceed/ads 1.2.2-next.4 → 1.2.2
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 +63 -42
- package/dist/index.js +80 -53
- package/framer/index.js +28 -28
- package/package.json +2 -3
|
@@ -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, {
|
|
@@ -2765,7 +2815,7 @@ function Pagination(props) {
|
|
|
2765
2815
|
onClick: () => handlePageChange(p)
|
|
2766
2816
|
},
|
|
2767
2817
|
p
|
|
2768
|
-
)), /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { active:
|
|
2818
|
+
)), /* @__PURE__ */ import_react23.default.createElement(PaginationButton, { active: true, size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ import_react23.default.createElement(
|
|
2769
2819
|
PaginationButton,
|
|
2770
2820
|
{
|
|
2771
2821
|
key: p,
|
|
@@ -3579,7 +3629,6 @@ function Component(props, apiRef) {
|
|
|
3579
3629
|
background: backgroundProps = {}
|
|
3580
3630
|
} = {},
|
|
3581
3631
|
stripe,
|
|
3582
|
-
isTotalSelected: ___________,
|
|
3583
3632
|
...innerProps
|
|
3584
3633
|
} = props;
|
|
3585
3634
|
const tableId = (0, import_react25.useId)();
|
|
@@ -4679,47 +4728,16 @@ var import_joy42 = require("@mui/joy");
|
|
|
4679
4728
|
// src/components/Markdown/Markdown.tsx
|
|
4680
4729
|
var import_react32 = __toESM(require("react"));
|
|
4681
4730
|
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
4731
|
var LazyReactMarkdown = (0, import_react32.lazy)(() => import("react-markdown"));
|
|
4722
4732
|
var Markdown = (props) => {
|
|
4733
|
+
const [rehypeAccent2, setRehypeAccent] = (0, import_react32.useState)(null);
|
|
4734
|
+
(0, import_react32.useEffect)(() => {
|
|
4735
|
+
const loadRehypeAccent = async () => {
|
|
4736
|
+
const module2 = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
4737
|
+
setRehypeAccent(() => module2.rehypeAccent);
|
|
4738
|
+
};
|
|
4739
|
+
loadRehypeAccent();
|
|
4740
|
+
}, []);
|
|
4723
4741
|
const {
|
|
4724
4742
|
color,
|
|
4725
4743
|
textColor,
|
|
@@ -4731,6 +4749,9 @@ var Markdown = (props) => {
|
|
|
4731
4749
|
content,
|
|
4732
4750
|
...innerProps
|
|
4733
4751
|
} = props;
|
|
4752
|
+
if (!rehypeAccent2) {
|
|
4753
|
+
return null;
|
|
4754
|
+
}
|
|
4734
4755
|
return /* @__PURE__ */ import_react32.default.createElement(
|
|
4735
4756
|
Typography,
|
|
4736
4757
|
{
|
|
@@ -4745,7 +4766,7 @@ var Markdown = (props) => {
|
|
|
4745
4766
|
{
|
|
4746
4767
|
...markdownOptions,
|
|
4747
4768
|
children: content,
|
|
4748
|
-
rehypePlugins: [[
|
|
4769
|
+
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
4749
4770
|
components: {
|
|
4750
4771
|
h1: ({ children }) => /* @__PURE__ */ import_react32.default.createElement(Typography, { color, textColor, level: "h1" }, children),
|
|
4751
4772
|
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,
|
|
@@ -2704,7 +2760,7 @@ function Pagination(props) {
|
|
|
2704
2760
|
onClick: () => handlePageChange(p)
|
|
2705
2761
|
},
|
|
2706
2762
|
p
|
|
2707
|
-
)), /* @__PURE__ */ React21.createElement(PaginationButton, { active:
|
|
2763
|
+
)), /* @__PURE__ */ React21.createElement(PaginationButton, { active: true, size, "aria-current": "page" }, paginationModel.page), afterPages.map((p) => /* @__PURE__ */ React21.createElement(
|
|
2708
2764
|
PaginationButton,
|
|
2709
2765
|
{
|
|
2710
2766
|
key: p,
|
|
@@ -3521,7 +3577,6 @@ function Component(props, apiRef) {
|
|
|
3521
3577
|
background: backgroundProps = {}
|
|
3522
3578
|
} = {},
|
|
3523
3579
|
stripe,
|
|
3524
|
-
isTotalSelected: ___________,
|
|
3525
3580
|
...innerProps
|
|
3526
3581
|
} = props;
|
|
3527
3582
|
const tableId = useId();
|
|
@@ -4639,49 +4694,18 @@ Uploader.displayName = "Uploader";
|
|
|
4639
4694
|
import { Grid } from "@mui/joy";
|
|
4640
4695
|
|
|
4641
4696
|
// src/components/Markdown/Markdown.tsx
|
|
4642
|
-
import React30, { lazy, Suspense } from "react";
|
|
4697
|
+
import React30, { lazy, Suspense, useEffect as useEffect8, useState as useState9 } from "react";
|
|
4643
4698
|
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
4699
|
var LazyReactMarkdown = lazy(() => import("react-markdown"));
|
|
4684
4700
|
var Markdown = (props) => {
|
|
4701
|
+
const [rehypeAccent2, setRehypeAccent] = useState9(null);
|
|
4702
|
+
useEffect8(() => {
|
|
4703
|
+
const loadRehypeAccent = async () => {
|
|
4704
|
+
const module = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
4705
|
+
setRehypeAccent(() => module.rehypeAccent);
|
|
4706
|
+
};
|
|
4707
|
+
loadRehypeAccent();
|
|
4708
|
+
}, []);
|
|
4685
4709
|
const {
|
|
4686
4710
|
color,
|
|
4687
4711
|
textColor,
|
|
@@ -4693,6 +4717,9 @@ var Markdown = (props) => {
|
|
|
4693
4717
|
content,
|
|
4694
4718
|
...innerProps
|
|
4695
4719
|
} = props;
|
|
4720
|
+
if (!rehypeAccent2) {
|
|
4721
|
+
return null;
|
|
4722
|
+
}
|
|
4696
4723
|
return /* @__PURE__ */ React30.createElement(
|
|
4697
4724
|
Typography,
|
|
4698
4725
|
{
|
|
@@ -4707,7 +4734,7 @@ var Markdown = (props) => {
|
|
|
4707
4734
|
{
|
|
4708
4735
|
...markdownOptions,
|
|
4709
4736
|
children: content,
|
|
4710
|
-
rehypePlugins: [[
|
|
4737
|
+
rehypePlugins: [[rehypeAccent2, { accentColor }]],
|
|
4711
4738
|
components: {
|
|
4712
4739
|
h1: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: "h1" }, children),
|
|
4713
4740
|
h2: ({ children }) => /* @__PURE__ */ React30.createElement(Typography, { color, textColor, level: "h2" }, children),
|
|
@@ -4802,10 +4829,10 @@ MenuButton.displayName = "MenuButton";
|
|
|
4802
4829
|
import React32, {
|
|
4803
4830
|
forwardRef as forwardRef9,
|
|
4804
4831
|
useCallback as useCallback12,
|
|
4805
|
-
useEffect as
|
|
4832
|
+
useEffect as useEffect9,
|
|
4806
4833
|
useImperativeHandle as useImperativeHandle4,
|
|
4807
4834
|
useRef as useRef7,
|
|
4808
|
-
useState as
|
|
4835
|
+
useState as useState10
|
|
4809
4836
|
} from "react";
|
|
4810
4837
|
import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
|
|
4811
4838
|
import CalendarTodayIcon3 from "@mui/icons-material/CalendarToday";
|
|
@@ -4918,9 +4945,9 @@ var MonthPicker = forwardRef9(
|
|
|
4918
4945
|
),
|
|
4919
4946
|
{ disableStrict: true }
|
|
4920
4947
|
);
|
|
4921
|
-
const [anchorEl, setAnchorEl] =
|
|
4948
|
+
const [anchorEl, setAnchorEl] = useState10(null);
|
|
4922
4949
|
const open = Boolean(anchorEl);
|
|
4923
|
-
|
|
4950
|
+
useEffect9(() => {
|
|
4924
4951
|
if (!anchorEl) {
|
|
4925
4952
|
innerRef.current?.blur();
|
|
4926
4953
|
}
|
|
@@ -5051,11 +5078,11 @@ var MonthPicker = forwardRef9(
|
|
|
5051
5078
|
import React33, {
|
|
5052
5079
|
forwardRef as forwardRef10,
|
|
5053
5080
|
useCallback as useCallback13,
|
|
5054
|
-
useEffect as
|
|
5081
|
+
useEffect as useEffect10,
|
|
5055
5082
|
useImperativeHandle as useImperativeHandle5,
|
|
5056
5083
|
useMemo as useMemo11,
|
|
5057
5084
|
useRef as useRef8,
|
|
5058
|
-
useState as
|
|
5085
|
+
useState as useState11
|
|
5059
5086
|
} from "react";
|
|
5060
5087
|
import { IMaskInput as IMaskInput4, IMask as IMask4 } from "react-imask";
|
|
5061
5088
|
import CalendarTodayIcon4 from "@mui/icons-material/CalendarToday";
|
|
@@ -5177,13 +5204,13 @@ var MonthRangePicker = forwardRef10(
|
|
|
5177
5204
|
),
|
|
5178
5205
|
{ disableStrict: true }
|
|
5179
5206
|
);
|
|
5180
|
-
const [anchorEl, setAnchorEl] =
|
|
5207
|
+
const [anchorEl, setAnchorEl] = useState11(null);
|
|
5181
5208
|
const open = Boolean(anchorEl);
|
|
5182
5209
|
const calendarValue = useMemo11(
|
|
5183
5210
|
() => value ? parseDates2(value) : void 0,
|
|
5184
5211
|
[value]
|
|
5185
5212
|
);
|
|
5186
|
-
|
|
5213
|
+
useEffect10(() => {
|
|
5187
5214
|
if (!anchorEl) {
|
|
5188
5215
|
innerRef.current?.blur();
|
|
5189
5216
|
}
|
|
@@ -5432,7 +5459,7 @@ function Navigator(props) {
|
|
|
5432
5459
|
Navigator.displayName = "Navigator";
|
|
5433
5460
|
|
|
5434
5461
|
// src/components/PercentageInput/PercentageInput.tsx
|
|
5435
|
-
import React37, { useCallback as useCallback14, useMemo as useMemo12, useState as
|
|
5462
|
+
import React37, { useCallback as useCallback14, useMemo as useMemo12, useState as useState12 } from "react";
|
|
5436
5463
|
import { NumericFormat as NumericFormat2 } from "react-number-format";
|
|
5437
5464
|
import { styled as styled23, useThemeProps as useThemeProps8 } from "@mui/joy";
|
|
5438
5465
|
var padDecimal = (value, decimalScale) => {
|
|
@@ -5495,7 +5522,7 @@ var PercentageInput = React37.forwardRef(function PercentageInput2(inProps, ref)
|
|
|
5495
5522
|
[onChange, name]
|
|
5496
5523
|
)
|
|
5497
5524
|
);
|
|
5498
|
-
const [internalError, setInternalError] =
|
|
5525
|
+
const [internalError, setInternalError] = useState12(
|
|
5499
5526
|
max && _value && _value > max || min && _value && _value < min
|
|
5500
5527
|
);
|
|
5501
5528
|
const value = useMemo12(() => {
|