@duskmoon-dev/components 0.3.0 → 0.3.3
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/README.md +33 -5
- package/dist/{chunk-r9wkv7xd.js → chunk-fwjzvsrx.js} +3 -3
- package/dist/classes/chat.d.ts +35 -0
- package/dist/classes/index.d.ts +2 -0
- package/dist/classes/index.js +1282 -1177
- package/dist/classes/markdown.d.ts +9 -0
- package/dist/components/anchor/index.js +2 -2
- package/dist/components/app/index.js +85 -85
- package/dist/components/cascader/index.js +2 -2
- package/dist/components/chat/Chat.d.ts +14 -0
- package/dist/components/chat/Chat.types.d.ts +47 -0
- package/dist/components/chat/index.d.ts +2 -0
- package/dist/components/chat/index.js +220 -0
- package/dist/components/color-picker/index.js +4 -4
- package/dist/components/config-provider/index.js +2 -2
- package/dist/components/dm-breadcrumb/index.js +18 -18
- package/dist/components/dm-date-picker/index.js +94 -94
- package/dist/components/dm-drawer/index.js +16 -16
- package/dist/components/dm-layout/index.js +189 -189
- package/dist/components/dm-menu/index.js +24 -24
- package/dist/components/dm-message/index.js +18 -18
- package/dist/components/dm-page-header/index.js +158 -158
- package/dist/components/dm-pagination/index.js +39 -39
- package/dist/components/dm-pro-table/index.js +1558 -1558
- package/dist/components/dm-provider/index.js +94 -94
- package/dist/components/dm-query/index.js +33 -31
- package/dist/components/dm-search/index.js +25 -25
- package/dist/components/dm-splitter/index.js +32 -32
- package/dist/components/dm-status/index.js +25 -25
- package/dist/components/dm-table/index.js +595 -595
- package/dist/components/dm-tabs/index.js +34 -34
- package/dist/components/dm-toolbar/index.js +23 -23
- package/dist/components/dm-tree/index.js +92 -92
- package/dist/components/dm-truncate/index.js +33 -33
- package/dist/components/dropdown/index.js +83 -83
- package/dist/components/form/index.js +2 -2
- package/dist/components/grid/index.js +2 -2
- package/dist/components/input/index.js +4 -4
- package/dist/components/markdown/Markdown.d.ts +3 -0
- package/dist/components/markdown/Markdown.types.d.ts +14 -0
- package/dist/components/markdown/index.d.ts +2 -0
- package/dist/components/markdown/index.js +171 -0
- package/dist/components/message/index.js +5 -5
- package/dist/components/notification/index.js +2 -2
- package/dist/components/popconfirm/index.js +42 -42
- package/dist/components/skeleton/index.js +5 -5
- package/dist/components/spin/index.js +2 -2
- package/dist/components/steps/index.js +2 -2
- package/dist/components/table/index.js +2 -2
- package/dist/components/tabs/index.js +2 -2
- package/dist/components/tag/index.js +2 -2
- package/dist/components/tour/index.js +62 -62
- package/dist/components/typography/index.js +4 -4
- package/dist/components/upload/index.js +5 -5
- package/dist/generated/version.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1845 -1512
- package/dist/infrastructure.js +11 -11
- package/dist/styles.css +13457 -9832
- package/dist/theme/index.js +3 -3
- package/dist/utils/index.js +5 -5
- package/package.json +18 -7
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
export type MarkdownFrontMatterMode = "render" | "hidden" | "disabled";
|
|
3
|
+
export interface MarkdownProps extends Omit<ComponentProps<"div">, "children"> {
|
|
4
|
+
/** Markdown source to render. */
|
|
5
|
+
markdown?: string;
|
|
6
|
+
/** Convert soft line endings to `<br>` elements. @default true */
|
|
7
|
+
breaks?: boolean;
|
|
8
|
+
/** Add a visual swatch to inline code containing a valid CSS color. @default true */
|
|
9
|
+
colorChips?: boolean;
|
|
10
|
+
/** Control handling of YAML front matter at the beginning of the source. @default "render" */
|
|
11
|
+
frontMatter?: MarkdownFrontMatterMode;
|
|
12
|
+
/** Optional color variant used to build the `markdown-body-{variant}` class. */
|
|
13
|
+
variant?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/markdown/Markdown.tsx
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import ReactMarkdown from "react-markdown";
|
|
6
|
+
import remarkBreaks from "remark-breaks";
|
|
7
|
+
import remarkGfm from "remark-gfm";
|
|
8
|
+
|
|
9
|
+
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
10
|
+
function r(e) {
|
|
11
|
+
var t, f, n = "";
|
|
12
|
+
if (typeof e == "string" || typeof e == "number")
|
|
13
|
+
n += e;
|
|
14
|
+
else if (typeof e == "object")
|
|
15
|
+
if (Array.isArray(e)) {
|
|
16
|
+
var o = e.length;
|
|
17
|
+
for (t = 0;t < o; t++)
|
|
18
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
19
|
+
} else
|
|
20
|
+
for (f in e)
|
|
21
|
+
e[f] && (n && (n += " "), n += f);
|
|
22
|
+
return n;
|
|
23
|
+
}
|
|
24
|
+
function clsx() {
|
|
25
|
+
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
26
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
27
|
+
return n;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/utils/cn.ts
|
|
31
|
+
function cn(...inputs) {
|
|
32
|
+
return clsx(inputs);
|
|
33
|
+
}
|
|
34
|
+
// src/classes/markdown.ts
|
|
35
|
+
var markdownBaseClass = "markdown-body";
|
|
36
|
+
var markdownFrontMatterClass = "dm-front-matter";
|
|
37
|
+
var markdownColorCodeClass = "dm-color-code";
|
|
38
|
+
var markdownColorChipClass = "dm-color-chip";
|
|
39
|
+
var markdownColorChipSwatchClass = "dm-color-chip-swatch";
|
|
40
|
+
function getMarkdownClasses({
|
|
41
|
+
variant,
|
|
42
|
+
className
|
|
43
|
+
}) {
|
|
44
|
+
return cn(markdownBaseClass, variant && `${markdownBaseClass}-${variant}`, className);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// src/components/markdown/Markdown.tsx
|
|
48
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
49
|
+
function splitFrontMatter(markdown) {
|
|
50
|
+
const source = markdown.startsWith("\uFEFF") ? markdown.slice(1) : markdown;
|
|
51
|
+
const lines = source.split(/\r?\n/);
|
|
52
|
+
if (lines.length < 2 || lines[0] !== "---")
|
|
53
|
+
return;
|
|
54
|
+
for (let index = 1;index < lines.length; index += 1) {
|
|
55
|
+
if (lines[index] === "---" || lines[index] === "...") {
|
|
56
|
+
return {
|
|
57
|
+
source: lines.slice(1, index).join(`
|
|
58
|
+
`),
|
|
59
|
+
body: lines.slice(index + 1).join(`
|
|
60
|
+
`)
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
function numberInRange(value, minimum, maximum) {
|
|
67
|
+
if (!/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(value))
|
|
68
|
+
return false;
|
|
69
|
+
const number = Number(value);
|
|
70
|
+
return Number.isFinite(number) && number >= minimum && number <= maximum;
|
|
71
|
+
}
|
|
72
|
+
function percentage(value) {
|
|
73
|
+
return value.endsWith("%") && numberInRange(value.slice(0, -1), 0, 100);
|
|
74
|
+
}
|
|
75
|
+
function alpha(value) {
|
|
76
|
+
return percentage(value) || numberInRange(value, 0, 1);
|
|
77
|
+
}
|
|
78
|
+
function isCssColor(value) {
|
|
79
|
+
if (!value || Array.from(value).some((character) => character.charCodeAt(0) > 127) || value.trim() !== value) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
if (/^#[\da-f]{3,4}(?:[\da-f]{2}){0,2}$/i.test(value))
|
|
83
|
+
return true;
|
|
84
|
+
const match = /^(rgba?|hsla?)\((.*)\)$/i.exec(value);
|
|
85
|
+
if (!match || match[2].includes("(") || match[2].includes(")"))
|
|
86
|
+
return false;
|
|
87
|
+
const name = match[1].toLowerCase();
|
|
88
|
+
const parts = match[2].split(",").map((part) => part.trim());
|
|
89
|
+
const hasAlpha = name.endsWith("a");
|
|
90
|
+
if (parts.length !== (hasAlpha ? 4 : 3))
|
|
91
|
+
return false;
|
|
92
|
+
if (name.startsWith("rgb")) {
|
|
93
|
+
const channels = parts.slice(0, 3);
|
|
94
|
+
const allPercentages = channels.every(percentage);
|
|
95
|
+
const allNumbers = channels.every((part) => numberInRange(part, 0, 255));
|
|
96
|
+
return (allPercentages || allNumbers) && (!hasAlpha || alpha(parts[3]));
|
|
97
|
+
}
|
|
98
|
+
const hue = parts[0].replace(/deg$/i, "");
|
|
99
|
+
return numberInRange(hue, 0, 360) && percentage(parts[1]) && percentage(parts[2]) && (!hasAlpha || alpha(parts[3]));
|
|
100
|
+
}
|
|
101
|
+
function markdownSource(markdown, mode) {
|
|
102
|
+
if (mode === "disabled")
|
|
103
|
+
return { body: markdown, source: undefined };
|
|
104
|
+
const frontMatter = splitFrontMatter(markdown);
|
|
105
|
+
return frontMatter ?? { body: markdown, source: undefined };
|
|
106
|
+
}
|
|
107
|
+
var Markdown = forwardRef(function Markdown({
|
|
108
|
+
markdown = "",
|
|
109
|
+
breaks = true,
|
|
110
|
+
colorChips = true,
|
|
111
|
+
frontMatter = "render",
|
|
112
|
+
variant,
|
|
113
|
+
className,
|
|
114
|
+
...props
|
|
115
|
+
}, ref) {
|
|
116
|
+
const source = markdownSource(markdown, frontMatter);
|
|
117
|
+
const components = colorChips ? {
|
|
118
|
+
code({ children, className: codeClassName, node, ...codeProps }) {
|
|
119
|
+
const value = String(children).replace(/\n$/, "");
|
|
120
|
+
const isInline = node?.position?.start.line === node?.position?.end.line;
|
|
121
|
+
if (!isInline || !isCssColor(value)) {
|
|
122
|
+
return /* @__PURE__ */ jsx("code", {
|
|
123
|
+
className: codeClassName,
|
|
124
|
+
...codeProps,
|
|
125
|
+
children
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return /* @__PURE__ */ jsxs("code", {
|
|
129
|
+
className: markdownColorCodeClass,
|
|
130
|
+
...codeProps,
|
|
131
|
+
children: [
|
|
132
|
+
children,
|
|
133
|
+
/* @__PURE__ */ jsx("span", {
|
|
134
|
+
className: markdownColorChipClass,
|
|
135
|
+
role: "img",
|
|
136
|
+
"aria-label": `Color ${value}`,
|
|
137
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
138
|
+
className: markdownColorChipSwatchClass,
|
|
139
|
+
style: { backgroundColor: value },
|
|
140
|
+
"aria-hidden": "true"
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
} : undefined;
|
|
147
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
148
|
+
ref,
|
|
149
|
+
className: getMarkdownClasses({ variant, className }),
|
|
150
|
+
...props,
|
|
151
|
+
children: [
|
|
152
|
+
frontMatter === "render" && source.source !== undefined ? /* @__PURE__ */ jsx("div", {
|
|
153
|
+
className: markdownFrontMatterClass,
|
|
154
|
+
children: /* @__PURE__ */ jsx("pre", {
|
|
155
|
+
children: /* @__PURE__ */ jsx("code", {
|
|
156
|
+
className: "language-yaml",
|
|
157
|
+
children: source.source
|
|
158
|
+
})
|
|
159
|
+
})
|
|
160
|
+
}) : null,
|
|
161
|
+
/* @__PURE__ */ jsx(ReactMarkdown, {
|
|
162
|
+
remarkPlugins: breaks ? [remarkGfm, remarkBreaks] : [remarkGfm],
|
|
163
|
+
components,
|
|
164
|
+
children: source.body
|
|
165
|
+
})
|
|
166
|
+
]
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
export {
|
|
170
|
+
Markdown
|
|
171
|
+
};
|
|
@@ -154,13 +154,13 @@ function config(nextConfig) {
|
|
|
154
154
|
emit();
|
|
155
155
|
}
|
|
156
156
|
function MessageHolder({ className }) {
|
|
157
|
-
const
|
|
157
|
+
const snapshot = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
158
158
|
return /* @__PURE__ */ jsx("div", {
|
|
159
159
|
className: getMessageHolderClasses({
|
|
160
|
-
placement:
|
|
160
|
+
placement: snapshot.config.placement,
|
|
161
161
|
className
|
|
162
162
|
}),
|
|
163
|
-
children:
|
|
163
|
+
children: snapshot.messages.map((item) => /* @__PURE__ */ jsxs("div", {
|
|
164
164
|
className: getMessageClasses({
|
|
165
165
|
type: item.type,
|
|
166
166
|
className: item.className
|
|
@@ -200,6 +200,6 @@ var message = {
|
|
|
200
200
|
useMessage: () => [message, /* @__PURE__ */ jsx(MessageHolder, {}, "message-holder")]
|
|
201
201
|
};
|
|
202
202
|
export {
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
MessageHolder,
|
|
204
|
+
message
|
|
205
205
|
};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
// src/components/popconfirm/Popconfirm.tsx
|
|
4
|
+
import {
|
|
5
|
+
forwardRef,
|
|
6
|
+
useId,
|
|
7
|
+
useState
|
|
8
|
+
} from "react";
|
|
9
|
+
|
|
3
10
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
4
11
|
function r(e) {
|
|
5
12
|
var t, f, n = "";
|
|
@@ -25,6 +32,41 @@ function clsx() {
|
|
|
25
32
|
function cn(...inputs) {
|
|
26
33
|
return clsx(inputs);
|
|
27
34
|
}
|
|
35
|
+
// src/classes/popconfirm.ts
|
|
36
|
+
var popconfirmWrapperClass = "popover-wrapper popconfirm-wrapper";
|
|
37
|
+
var popconfirmBaseClass = "popover popconfirm";
|
|
38
|
+
var popconfirmOpenClass = "popover-show popconfirm-open";
|
|
39
|
+
var popconfirmArrowClass = "popover-arrow popconfirm-arrow";
|
|
40
|
+
var popconfirmNoArrowClass = "popover-no-arrow popconfirm-no-arrow";
|
|
41
|
+
var popconfirmBodyClass = "popconfirm-body";
|
|
42
|
+
var popconfirmIconClass = "popconfirm-icon";
|
|
43
|
+
var popconfirmContentClass = "popconfirm-content";
|
|
44
|
+
var popconfirmTitleClass = "popconfirm-title";
|
|
45
|
+
var popconfirmDescriptionClass = "popconfirm-description";
|
|
46
|
+
var popconfirmActionsClass = "popconfirm-actions";
|
|
47
|
+
var popconfirmPlacementClasses = {
|
|
48
|
+
top: "popover-top popconfirm-top",
|
|
49
|
+
bottom: "popover-bottom popconfirm-bottom",
|
|
50
|
+
left: "popover-left popconfirm-left",
|
|
51
|
+
right: "popover-right popconfirm-right",
|
|
52
|
+
topLeft: "popover-top popconfirm-top-left",
|
|
53
|
+
topRight: "popover-top popconfirm-top-right",
|
|
54
|
+
bottomLeft: "popover-bottom popconfirm-bottom-left",
|
|
55
|
+
bottomRight: "popover-bottom popconfirm-bottom-right",
|
|
56
|
+
leftTop: "popover-left popconfirm-left-top",
|
|
57
|
+
leftBottom: "popover-left popconfirm-left-bottom",
|
|
58
|
+
rightTop: "popover-right popconfirm-right-top",
|
|
59
|
+
rightBottom: "popover-right popconfirm-right-bottom"
|
|
60
|
+
};
|
|
61
|
+
function getPopconfirmClasses({
|
|
62
|
+
placement = "top",
|
|
63
|
+
open,
|
|
64
|
+
arrow = true,
|
|
65
|
+
className
|
|
66
|
+
}) {
|
|
67
|
+
return cn(popconfirmBaseClass, popconfirmPlacementClasses[placement], open && popconfirmOpenClass, !arrow && popconfirmNoArrowClass, className);
|
|
68
|
+
}
|
|
69
|
+
|
|
28
70
|
// src/classes/button.ts
|
|
29
71
|
var buttonBaseClass = "btn";
|
|
30
72
|
var buttonColorClasses = {
|
|
@@ -123,48 +165,6 @@ function Button({
|
|
|
123
165
|
]
|
|
124
166
|
});
|
|
125
167
|
}
|
|
126
|
-
// src/components/popconfirm/Popconfirm.tsx
|
|
127
|
-
import {
|
|
128
|
-
forwardRef,
|
|
129
|
-
useId,
|
|
130
|
-
useState
|
|
131
|
-
} from "react";
|
|
132
|
-
|
|
133
|
-
// src/classes/popconfirm.ts
|
|
134
|
-
var popconfirmWrapperClass = "popover-wrapper popconfirm-wrapper";
|
|
135
|
-
var popconfirmBaseClass = "popover popconfirm";
|
|
136
|
-
var popconfirmOpenClass = "popover-show popconfirm-open";
|
|
137
|
-
var popconfirmArrowClass = "popover-arrow popconfirm-arrow";
|
|
138
|
-
var popconfirmNoArrowClass = "popover-no-arrow popconfirm-no-arrow";
|
|
139
|
-
var popconfirmBodyClass = "popconfirm-body";
|
|
140
|
-
var popconfirmIconClass = "popconfirm-icon";
|
|
141
|
-
var popconfirmContentClass = "popconfirm-content";
|
|
142
|
-
var popconfirmTitleClass = "popconfirm-title";
|
|
143
|
-
var popconfirmDescriptionClass = "popconfirm-description";
|
|
144
|
-
var popconfirmActionsClass = "popconfirm-actions";
|
|
145
|
-
var popconfirmPlacementClasses = {
|
|
146
|
-
top: "popover-top popconfirm-top",
|
|
147
|
-
bottom: "popover-bottom popconfirm-bottom",
|
|
148
|
-
left: "popover-left popconfirm-left",
|
|
149
|
-
right: "popover-right popconfirm-right",
|
|
150
|
-
topLeft: "popover-top popconfirm-top-left",
|
|
151
|
-
topRight: "popover-top popconfirm-top-right",
|
|
152
|
-
bottomLeft: "popover-bottom popconfirm-bottom-left",
|
|
153
|
-
bottomRight: "popover-bottom popconfirm-bottom-right",
|
|
154
|
-
leftTop: "popover-left popconfirm-left-top",
|
|
155
|
-
leftBottom: "popover-left popconfirm-left-bottom",
|
|
156
|
-
rightTop: "popover-right popconfirm-right-top",
|
|
157
|
-
rightBottom: "popover-right popconfirm-right-bottom"
|
|
158
|
-
};
|
|
159
|
-
function getPopconfirmClasses({
|
|
160
|
-
placement = "top",
|
|
161
|
-
open,
|
|
162
|
-
arrow = true,
|
|
163
|
-
className
|
|
164
|
-
}) {
|
|
165
|
-
return cn(popconfirmBaseClass, popconfirmPlacementClasses[placement], open && popconfirmOpenClass, !arrow && popconfirmNoArrowClass, className);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
168
|
// src/components/popconfirm/Popconfirm.tsx
|
|
169
169
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
170
170
|
function normalizeTriggers(trigger) {
|
|
@@ -229,10 +229,10 @@ var Skeleton = Object.assign(SkeletonRoot, {
|
|
|
229
229
|
Node: SkeletonNode
|
|
230
230
|
});
|
|
231
231
|
export {
|
|
232
|
-
|
|
233
|
-
SkeletonInput,
|
|
234
|
-
SkeletonImage,
|
|
235
|
-
SkeletonButton,
|
|
232
|
+
Skeleton,
|
|
236
233
|
SkeletonAvatar,
|
|
237
|
-
|
|
234
|
+
SkeletonButton,
|
|
235
|
+
SkeletonImage,
|
|
236
|
+
SkeletonInput,
|
|
237
|
+
SkeletonNode
|
|
238
238
|
};
|
|
@@ -65,8 +65,8 @@ function useDelayedSpinning(spinning, delay) {
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
if (!spinning) {
|
|
68
|
-
const
|
|
69
|
-
return () => window.clearTimeout(
|
|
68
|
+
const resetTimer = window.setTimeout(() => setDelayedActive(false), 0);
|
|
69
|
+
return () => window.clearTimeout(resetTimer);
|
|
70
70
|
}
|
|
71
71
|
const resetTimer = window.setTimeout(() => setDelayedActive(false), 0);
|
|
72
72
|
const showTimer = window.setTimeout(() => setDelayedActive(true), delay);
|
|
@@ -112,8 +112,8 @@ function getRecordKey(record, index, rowKey) {
|
|
|
112
112
|
return rowKey(record, index);
|
|
113
113
|
}
|
|
114
114
|
if (rowKey) {
|
|
115
|
-
const
|
|
116
|
-
return typeof
|
|
115
|
+
const key = record[rowKey];
|
|
116
|
+
return typeof key === "string" || typeof key === "number" ? key : index;
|
|
117
117
|
}
|
|
118
118
|
const key = record.key;
|
|
119
119
|
return typeof key === "string" || typeof key === "number" ? key : index;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
// src/components/tour/Tour.tsx
|
|
4
|
+
import {
|
|
5
|
+
forwardRef,
|
|
6
|
+
useEffect,
|
|
7
|
+
useId,
|
|
8
|
+
useState
|
|
9
|
+
} from "react";
|
|
10
|
+
|
|
3
11
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
4
12
|
function r(e) {
|
|
5
13
|
var t, f, n = "";
|
|
@@ -25,6 +33,60 @@ function clsx() {
|
|
|
25
33
|
function cn(...inputs) {
|
|
26
34
|
return clsx(inputs);
|
|
27
35
|
}
|
|
36
|
+
// src/classes/tour.ts
|
|
37
|
+
var tourRootClass = "tour-root";
|
|
38
|
+
var tourOpenClass = "tour-open";
|
|
39
|
+
var tourMaskClass = "tour-mask";
|
|
40
|
+
var tourMaskHiddenClass = "tour-mask-hidden";
|
|
41
|
+
var tourTargetClass = "tour-target";
|
|
42
|
+
var tourPanelClass = "tour-panel popover";
|
|
43
|
+
var tourArrowClass = "tour-arrow popover-arrow";
|
|
44
|
+
var tourHeaderClass = "tour-header";
|
|
45
|
+
var tourTitleClass = "tour-title";
|
|
46
|
+
var tourCloseClass = "tour-close";
|
|
47
|
+
var tourBodyClass = "tour-body";
|
|
48
|
+
var tourCoverClass = "tour-cover";
|
|
49
|
+
var tourFooterClass = "tour-footer";
|
|
50
|
+
var tourIndicatorsClass = "tour-indicators";
|
|
51
|
+
var tourIndicatorClass = "tour-indicator";
|
|
52
|
+
var tourIndicatorActiveClass = "tour-indicator-active";
|
|
53
|
+
var tourActionsClass = "tour-actions";
|
|
54
|
+
var tourPlacementClasses = {
|
|
55
|
+
top: "popover-top tour-top",
|
|
56
|
+
bottom: "popover-bottom tour-bottom",
|
|
57
|
+
left: "popover-left tour-left",
|
|
58
|
+
right: "popover-right tour-right",
|
|
59
|
+
topLeft: "popover-top tour-top-left",
|
|
60
|
+
topRight: "popover-top tour-top-right",
|
|
61
|
+
bottomLeft: "popover-bottom tour-bottom-left",
|
|
62
|
+
bottomRight: "popover-bottom tour-bottom-right",
|
|
63
|
+
leftTop: "popover-left tour-left-top",
|
|
64
|
+
leftBottom: "popover-left tour-left-bottom",
|
|
65
|
+
rightTop: "popover-right tour-right-top",
|
|
66
|
+
rightBottom: "popover-right tour-right-bottom"
|
|
67
|
+
};
|
|
68
|
+
function getTourRootClasses({
|
|
69
|
+
open,
|
|
70
|
+
className
|
|
71
|
+
}) {
|
|
72
|
+
return cn(tourRootClass, open && tourOpenClass, className);
|
|
73
|
+
}
|
|
74
|
+
function getTourMaskClasses({
|
|
75
|
+
visible,
|
|
76
|
+
className
|
|
77
|
+
}) {
|
|
78
|
+
return cn(tourMaskClass, !visible && tourMaskHiddenClass, className);
|
|
79
|
+
}
|
|
80
|
+
function getTourPanelClasses({
|
|
81
|
+
placement = "bottom",
|
|
82
|
+
className
|
|
83
|
+
}) {
|
|
84
|
+
return cn(tourPanelClass, "popover-show", tourPlacementClasses[placement], className);
|
|
85
|
+
}
|
|
86
|
+
function getTourIndicatorClasses({ active }) {
|
|
87
|
+
return cn(tourIndicatorClass, active && tourIndicatorActiveClass);
|
|
88
|
+
}
|
|
89
|
+
|
|
28
90
|
// src/classes/button.ts
|
|
29
91
|
var buttonBaseClass = "btn";
|
|
30
92
|
var buttonColorClasses = {
|
|
@@ -123,68 +185,6 @@ function Button({
|
|
|
123
185
|
]
|
|
124
186
|
});
|
|
125
187
|
}
|
|
126
|
-
// src/components/tour/Tour.tsx
|
|
127
|
-
import {
|
|
128
|
-
forwardRef,
|
|
129
|
-
useEffect,
|
|
130
|
-
useId,
|
|
131
|
-
useState
|
|
132
|
-
} from "react";
|
|
133
|
-
|
|
134
|
-
// src/classes/tour.ts
|
|
135
|
-
var tourRootClass = "tour-root";
|
|
136
|
-
var tourOpenClass = "tour-open";
|
|
137
|
-
var tourMaskClass = "tour-mask";
|
|
138
|
-
var tourMaskHiddenClass = "tour-mask-hidden";
|
|
139
|
-
var tourTargetClass = "tour-target";
|
|
140
|
-
var tourPanelClass = "tour-panel popover";
|
|
141
|
-
var tourArrowClass = "tour-arrow popover-arrow";
|
|
142
|
-
var tourHeaderClass = "tour-header";
|
|
143
|
-
var tourTitleClass = "tour-title";
|
|
144
|
-
var tourCloseClass = "tour-close";
|
|
145
|
-
var tourBodyClass = "tour-body";
|
|
146
|
-
var tourCoverClass = "tour-cover";
|
|
147
|
-
var tourFooterClass = "tour-footer";
|
|
148
|
-
var tourIndicatorsClass = "tour-indicators";
|
|
149
|
-
var tourIndicatorClass = "tour-indicator";
|
|
150
|
-
var tourIndicatorActiveClass = "tour-indicator-active";
|
|
151
|
-
var tourActionsClass = "tour-actions";
|
|
152
|
-
var tourPlacementClasses = {
|
|
153
|
-
top: "popover-top tour-top",
|
|
154
|
-
bottom: "popover-bottom tour-bottom",
|
|
155
|
-
left: "popover-left tour-left",
|
|
156
|
-
right: "popover-right tour-right",
|
|
157
|
-
topLeft: "popover-top tour-top-left",
|
|
158
|
-
topRight: "popover-top tour-top-right",
|
|
159
|
-
bottomLeft: "popover-bottom tour-bottom-left",
|
|
160
|
-
bottomRight: "popover-bottom tour-bottom-right",
|
|
161
|
-
leftTop: "popover-left tour-left-top",
|
|
162
|
-
leftBottom: "popover-left tour-left-bottom",
|
|
163
|
-
rightTop: "popover-right tour-right-top",
|
|
164
|
-
rightBottom: "popover-right tour-right-bottom"
|
|
165
|
-
};
|
|
166
|
-
function getTourRootClasses({
|
|
167
|
-
open,
|
|
168
|
-
className
|
|
169
|
-
}) {
|
|
170
|
-
return cn(tourRootClass, open && tourOpenClass, className);
|
|
171
|
-
}
|
|
172
|
-
function getTourMaskClasses({
|
|
173
|
-
visible,
|
|
174
|
-
className
|
|
175
|
-
}) {
|
|
176
|
-
return cn(tourMaskClass, !visible && tourMaskHiddenClass, className);
|
|
177
|
-
}
|
|
178
|
-
function getTourPanelClasses({
|
|
179
|
-
placement = "bottom",
|
|
180
|
-
className
|
|
181
|
-
}) {
|
|
182
|
-
return cn(tourPanelClass, "popover-show", tourPlacementClasses[placement], className);
|
|
183
|
-
}
|
|
184
|
-
function getTourIndicatorClasses({ active }) {
|
|
185
|
-
return cn(tourIndicatorClass, active && tourIndicatorActiveClass);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
188
|
// src/components/tour/Tour.tsx
|
|
189
189
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
190
190
|
var defaultCloseIcon = "x";
|
|
@@ -185,12 +185,12 @@ function UploadRoot({
|
|
|
185
185
|
}
|
|
186
186
|
const uploadFile = fileToUploadFile(sourceFile);
|
|
187
187
|
if (result === false) {
|
|
188
|
-
const
|
|
188
|
+
const nextFile = {
|
|
189
189
|
...uploadFile,
|
|
190
190
|
status: undefined,
|
|
191
191
|
percent: undefined
|
|
192
192
|
};
|
|
193
|
-
commitFileList([...currentFileListRef.current,
|
|
193
|
+
commitFileList([...currentFileListRef.current, nextFile], nextFile);
|
|
194
194
|
continue;
|
|
195
195
|
}
|
|
196
196
|
if (result instanceof File) {
|
|
@@ -200,9 +200,9 @@ function UploadRoot({
|
|
|
200
200
|
type: result.type || sourceFile.type
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
const
|
|
204
|
-
commitFileList([...currentFileListRef.current,
|
|
205
|
-
startRequest(
|
|
203
|
+
const nextFile = fileToUploadFile(uploadSource);
|
|
204
|
+
commitFileList([...currentFileListRef.current, nextFile], nextFile);
|
|
205
|
+
startRequest(nextFile, uploadSource);
|
|
206
206
|
continue;
|
|
207
207
|
}
|
|
208
208
|
const nextFile = fileToUploadFile(uploadSource);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.3.
|
|
1
|
+
export declare const version = "0.3.3";
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type { Breakpoint } from "./components/grid";
|
|
|
8
8
|
export * from "./components/button";
|
|
9
9
|
export * from "./components/calendar";
|
|
10
10
|
export * from "./components/card";
|
|
11
|
+
export * from "./components/chat";
|
|
11
12
|
export * from "./components/carousel";
|
|
12
13
|
export * from "./components/cascader";
|
|
13
14
|
export * from "./components/badge";
|
|
@@ -95,5 +96,6 @@ export * from "./components/transfer";
|
|
|
95
96
|
export * from "./components/tree";
|
|
96
97
|
export * from "./components/tree-select";
|
|
97
98
|
export * from "./components/typography";
|
|
99
|
+
export * from "./components/markdown";
|
|
98
100
|
export * from "./components/upload";
|
|
99
101
|
export * from "./components/watermark";
|