@duskmoon-dev/components 0.2.1 → 0.3.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/README.md +33 -5
- package/dist/classes/index.d.ts +1 -0
- package/dist/classes/index.js +100 -15
- package/dist/classes/markdown.d.ts +9 -0
- package/dist/components/alert/Alert.types.d.ts +1 -1
- package/dist/components/alert/index.js +6 -0
- package/dist/components/auto-complete/AutoComplete.types.d.ts +1 -1
- package/dist/components/auto-complete/index.js +3 -0
- package/dist/components/badge/Badge.types.d.ts +1 -1
- package/dist/components/badge/index.js +4 -0
- package/dist/components/button/Button.types.d.ts +1 -1
- package/dist/components/button/index.js +3 -0
- package/dist/components/checkbox/Checkbox.types.d.ts +1 -1
- package/dist/components/checkbox/index.js +8 -1
- package/dist/components/divider/Divider.types.d.ts +1 -1
- package/dist/components/divider/index.js +8 -2
- package/dist/components/dm-drawer/index.js +3 -0
- package/dist/components/dm-page-header/index.js +3 -0
- package/dist/components/dm-pro-table/index.js +3 -0
- package/dist/components/dm-query/index.js +3 -0
- package/dist/components/dm-search/index.js +3 -0
- package/dist/components/dm-table/index.js +3 -0
- package/dist/components/dm-toolbar/index.js +3 -0
- package/dist/components/dropdown/index.js +3 -0
- 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/popconfirm/index.js +3 -0
- package/dist/components/progress/Progress.types.d.ts +1 -1
- package/dist/components/progress/index.js +6 -3
- package/dist/components/radio/Radio.types.d.ts +1 -1
- package/dist/components/radio/index.js +8 -1
- package/dist/components/rate/Rate.types.d.ts +1 -1
- package/dist/components/rate/index.js +8 -2
- package/dist/components/slider/Slider.types.d.ts +1 -1
- package/dist/components/slider/index.js +9 -2
- package/dist/components/switch/Switch.types.d.ts +1 -1
- package/dist/components/switch/index.js +8 -1
- package/dist/components/tag/Tag.types.d.ts +1 -1
- package/dist/components/tag/index.js +5 -2
- package/dist/components/timeline/Timeline.types.d.ts +1 -1
- package/dist/components/timeline/index.js +6 -1
- package/dist/components/tour/index.js +3 -0
- package/dist/generated/version.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +252 -43
- package/dist/infrastructure.js +1 -1
- package/dist/styles.css +545 -0
- package/package.json +9 -2
package/dist/index.js
CHANGED
|
@@ -79,7 +79,7 @@ var ThemeInitScript = () => {
|
|
|
79
79
|
import { useCallback as useCallback2, useState as useState2 } from "react";
|
|
80
80
|
|
|
81
81
|
// src/generated/version.ts
|
|
82
|
-
var version = "0.
|
|
82
|
+
var version = "0.3.1";
|
|
83
83
|
|
|
84
84
|
// src/infrastructure.ts
|
|
85
85
|
var theme = {
|
|
@@ -239,6 +239,9 @@ var buttonColorClasses = {
|
|
|
239
239
|
primary: "btn-primary",
|
|
240
240
|
secondary: "btn-secondary",
|
|
241
241
|
tertiary: "btn-tertiary",
|
|
242
|
+
accent: "btn-accent",
|
|
243
|
+
neutral: "btn-neutral",
|
|
244
|
+
base: "btn-base",
|
|
242
245
|
info: "btn-info",
|
|
243
246
|
success: "btn-success",
|
|
244
247
|
warning: "btn-warning",
|
|
@@ -1349,6 +1352,10 @@ var badgeBaseClass = "badge";
|
|
|
1349
1352
|
var badgeColorClasses = {
|
|
1350
1353
|
primary: "badge-primary",
|
|
1351
1354
|
secondary: "badge-secondary",
|
|
1355
|
+
tertiary: "badge-tertiary",
|
|
1356
|
+
accent: "badge-accent",
|
|
1357
|
+
neutral: "badge-neutral",
|
|
1358
|
+
base: "badge-base",
|
|
1352
1359
|
info: "badge-info",
|
|
1353
1360
|
success: "badge-success",
|
|
1354
1361
|
warning: "badge-warning",
|
|
@@ -1687,6 +1694,12 @@ import { forwardRef as forwardRef5 } from "react";
|
|
|
1687
1694
|
// src/classes/alert.ts
|
|
1688
1695
|
var alertBaseClass = "alert";
|
|
1689
1696
|
var alertColorClasses = {
|
|
1697
|
+
primary: "alert-primary",
|
|
1698
|
+
secondary: "alert-secondary",
|
|
1699
|
+
tertiary: "alert-tertiary",
|
|
1700
|
+
accent: "alert-accent",
|
|
1701
|
+
neutral: "alert-neutral",
|
|
1702
|
+
base: "alert-base",
|
|
1690
1703
|
info: "alert-info",
|
|
1691
1704
|
success: "alert-success",
|
|
1692
1705
|
warning: "alert-warning",
|
|
@@ -2870,6 +2883,9 @@ var autoCompleteColorClasses = {
|
|
|
2870
2883
|
primary: "autocomplete-primary",
|
|
2871
2884
|
secondary: "autocomplete-secondary",
|
|
2872
2885
|
tertiary: "autocomplete-tertiary",
|
|
2886
|
+
accent: "autocomplete-accent",
|
|
2887
|
+
neutral: "autocomplete-neutral",
|
|
2888
|
+
base: "autocomplete-base",
|
|
2873
2889
|
info: "autocomplete-info",
|
|
2874
2890
|
success: "autocomplete-success",
|
|
2875
2891
|
warning: "autocomplete-warning",
|
|
@@ -3309,7 +3325,14 @@ var checkboxLabelBaseClass = "checkbox-text";
|
|
|
3309
3325
|
var checkboxColorClasses = {
|
|
3310
3326
|
primary: "checkbox-primary",
|
|
3311
3327
|
secondary: "checkbox-secondary",
|
|
3312
|
-
tertiary: "checkbox-tertiary"
|
|
3328
|
+
tertiary: "checkbox-tertiary",
|
|
3329
|
+
accent: "checkbox-accent",
|
|
3330
|
+
neutral: "checkbox-neutral",
|
|
3331
|
+
base: "checkbox-base",
|
|
3332
|
+
info: "checkbox-info",
|
|
3333
|
+
success: "checkbox-success",
|
|
3334
|
+
warning: "checkbox-warning",
|
|
3335
|
+
error: "checkbox-error"
|
|
3313
3336
|
};
|
|
3314
3337
|
var checkboxSizeClasses = {
|
|
3315
3338
|
sm: "checkbox-sm",
|
|
@@ -4411,10 +4434,16 @@ var dividerThicknessClasses = {
|
|
|
4411
4434
|
thick: "divider-thick"
|
|
4412
4435
|
};
|
|
4413
4436
|
var dividerColorClasses = {
|
|
4414
|
-
neutral: "",
|
|
4415
4437
|
primary: "divider-primary",
|
|
4416
4438
|
secondary: "divider-secondary",
|
|
4417
|
-
tertiary: "divider-tertiary"
|
|
4439
|
+
tertiary: "divider-tertiary",
|
|
4440
|
+
accent: "divider-accent",
|
|
4441
|
+
neutral: "divider-neutral",
|
|
4442
|
+
base: "divider-base",
|
|
4443
|
+
info: "divider-info",
|
|
4444
|
+
success: "divider-success",
|
|
4445
|
+
warning: "divider-warning",
|
|
4446
|
+
error: "divider-error"
|
|
4418
4447
|
};
|
|
4419
4448
|
var dividerSpacingClasses = {
|
|
4420
4449
|
normal: "",
|
|
@@ -12919,13 +12948,16 @@ import { forwardRef as forwardRef59 } from "react";
|
|
|
12919
12948
|
// src/classes/progress.ts
|
|
12920
12949
|
var progressBaseClass = "progress";
|
|
12921
12950
|
var progressColorClasses = {
|
|
12922
|
-
primary: "",
|
|
12951
|
+
primary: "progress-primary",
|
|
12923
12952
|
secondary: "progress-secondary",
|
|
12924
12953
|
tertiary: "progress-tertiary",
|
|
12954
|
+
accent: "progress-accent",
|
|
12955
|
+
neutral: "progress-neutral",
|
|
12956
|
+
base: "progress-base",
|
|
12957
|
+
info: "progress-info",
|
|
12925
12958
|
success: "progress-success",
|
|
12926
|
-
error: "progress-error",
|
|
12927
12959
|
warning: "progress-warning",
|
|
12928
|
-
|
|
12960
|
+
error: "progress-error"
|
|
12929
12961
|
};
|
|
12930
12962
|
var progressSizeClasses = {
|
|
12931
12963
|
sm: "progress-sm",
|
|
@@ -13195,7 +13227,14 @@ var radioLabelBaseClass = "radio-label";
|
|
|
13195
13227
|
var radioColorClasses = {
|
|
13196
13228
|
primary: "radio-primary",
|
|
13197
13229
|
secondary: "radio-secondary",
|
|
13198
|
-
tertiary: "radio-tertiary"
|
|
13230
|
+
tertiary: "radio-tertiary",
|
|
13231
|
+
accent: "radio-accent",
|
|
13232
|
+
neutral: "radio-neutral",
|
|
13233
|
+
base: "radio-base",
|
|
13234
|
+
info: "radio-info",
|
|
13235
|
+
success: "radio-success",
|
|
13236
|
+
warning: "radio-warning",
|
|
13237
|
+
error: "radio-error"
|
|
13199
13238
|
};
|
|
13200
13239
|
var radioSizeClasses = {
|
|
13201
13240
|
sm: "radio-sm",
|
|
@@ -13292,10 +13331,16 @@ var rateSizeClasses = {
|
|
|
13292
13331
|
xl: "rating-xl"
|
|
13293
13332
|
};
|
|
13294
13333
|
var rateColorClasses = {
|
|
13295
|
-
primary: "",
|
|
13334
|
+
primary: "rating-primary",
|
|
13296
13335
|
secondary: "rating-secondary",
|
|
13297
13336
|
tertiary: "rating-tertiary",
|
|
13298
|
-
|
|
13337
|
+
accent: "rating-accent",
|
|
13338
|
+
neutral: "rating-neutral",
|
|
13339
|
+
base: "rating-base",
|
|
13340
|
+
info: "rating-info",
|
|
13341
|
+
success: "rating-success",
|
|
13342
|
+
warning: "rating-warning",
|
|
13343
|
+
error: "rating-error"
|
|
13299
13344
|
};
|
|
13300
13345
|
function getRateClasses({
|
|
13301
13346
|
size = "md",
|
|
@@ -14030,9 +14075,16 @@ var sliderSizeClasses = {
|
|
|
14030
14075
|
lg: "slider-lg"
|
|
14031
14076
|
};
|
|
14032
14077
|
var sliderColorClasses = {
|
|
14033
|
-
primary: "",
|
|
14078
|
+
primary: "slider-primary",
|
|
14034
14079
|
secondary: "slider-secondary",
|
|
14035
|
-
tertiary: "slider-tertiary"
|
|
14080
|
+
tertiary: "slider-tertiary",
|
|
14081
|
+
accent: "slider-accent",
|
|
14082
|
+
neutral: "slider-neutral",
|
|
14083
|
+
base: "slider-base",
|
|
14084
|
+
info: "slider-info",
|
|
14085
|
+
success: "slider-success",
|
|
14086
|
+
warning: "slider-warning",
|
|
14087
|
+
error: "slider-error"
|
|
14036
14088
|
};
|
|
14037
14089
|
function getSliderClasses({
|
|
14038
14090
|
size = "md",
|
|
@@ -14926,7 +14978,14 @@ var switchSizeClasses = {
|
|
|
14926
14978
|
var switchColorClasses = {
|
|
14927
14979
|
primary: "switch-primary",
|
|
14928
14980
|
secondary: "switch-secondary",
|
|
14929
|
-
tertiary: "switch-tertiary"
|
|
14981
|
+
tertiary: "switch-tertiary",
|
|
14982
|
+
accent: "switch-accent",
|
|
14983
|
+
neutral: "switch-neutral",
|
|
14984
|
+
base: "switch-base",
|
|
14985
|
+
info: "switch-info",
|
|
14986
|
+
success: "switch-success",
|
|
14987
|
+
warning: "switch-warning",
|
|
14988
|
+
error: "switch-error"
|
|
14930
14989
|
};
|
|
14931
14990
|
function getSwitchClasses({
|
|
14932
14991
|
size = "md",
|
|
@@ -15015,10 +15074,13 @@ var tagColorClasses = {
|
|
|
15015
15074
|
primary: "chip-primary",
|
|
15016
15075
|
secondary: "chip-secondary",
|
|
15017
15076
|
tertiary: "chip-tertiary",
|
|
15077
|
+
accent: "chip-accent",
|
|
15078
|
+
neutral: "chip-neutral",
|
|
15079
|
+
base: "chip-base",
|
|
15080
|
+
info: "chip-info",
|
|
15018
15081
|
success: "chip-success",
|
|
15019
|
-
error: "chip-error",
|
|
15020
15082
|
warning: "chip-warning",
|
|
15021
|
-
|
|
15083
|
+
error: "chip-error"
|
|
15022
15084
|
};
|
|
15023
15085
|
function getTagClasses({
|
|
15024
15086
|
color,
|
|
@@ -15434,10 +15496,15 @@ var timelineSizeClasses = {
|
|
|
15434
15496
|
lg: "timeline-lg"
|
|
15435
15497
|
};
|
|
15436
15498
|
var timelineMarkerColorClasses = {
|
|
15437
|
-
primary: "",
|
|
15499
|
+
primary: "timeline-marker-primary",
|
|
15438
15500
|
secondary: "timeline-marker-secondary",
|
|
15439
15501
|
tertiary: "timeline-marker-tertiary",
|
|
15502
|
+
accent: "timeline-marker-accent",
|
|
15503
|
+
neutral: "timeline-marker-neutral",
|
|
15504
|
+
base: "timeline-marker-base",
|
|
15505
|
+
info: "timeline-marker-info",
|
|
15440
15506
|
success: "timeline-marker-success",
|
|
15507
|
+
warning: "timeline-marker-warning",
|
|
15441
15508
|
error: "timeline-marker-error"
|
|
15442
15509
|
};
|
|
15443
15510
|
function getTimelineClasses({
|
|
@@ -17431,8 +17498,149 @@ var Typography = Object.assign(TypographyRoot, {
|
|
|
17431
17498
|
Paragraph,
|
|
17432
17499
|
Link
|
|
17433
17500
|
});
|
|
17501
|
+
// src/components/markdown/Markdown.tsx
|
|
17502
|
+
import { forwardRef as forwardRef78 } from "react";
|
|
17503
|
+
import ReactMarkdown from "react-markdown";
|
|
17504
|
+
import remarkBreaks from "remark-breaks";
|
|
17505
|
+
import remarkGfm from "remark-gfm";
|
|
17506
|
+
|
|
17507
|
+
// src/classes/markdown.ts
|
|
17508
|
+
var markdownBaseClass = "markdown-body";
|
|
17509
|
+
var markdownFrontMatterClass = "dm-front-matter";
|
|
17510
|
+
var markdownColorCodeClass = "dm-color-code";
|
|
17511
|
+
var markdownColorChipClass = "dm-color-chip";
|
|
17512
|
+
var markdownColorChipSwatchClass = "dm-color-chip-swatch";
|
|
17513
|
+
function getMarkdownClasses({
|
|
17514
|
+
variant,
|
|
17515
|
+
className
|
|
17516
|
+
}) {
|
|
17517
|
+
return cn(markdownBaseClass, variant && `${markdownBaseClass}-${variant}`, className);
|
|
17518
|
+
}
|
|
17519
|
+
|
|
17520
|
+
// src/components/markdown/Markdown.tsx
|
|
17521
|
+
import { jsx as jsx92, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
17522
|
+
function splitFrontMatter(markdown) {
|
|
17523
|
+
const source = markdown.startsWith("\uFEFF") ? markdown.slice(1) : markdown;
|
|
17524
|
+
const lines = source.split(/\r?\n/);
|
|
17525
|
+
if (lines.length < 2 || lines[0] !== "---")
|
|
17526
|
+
return;
|
|
17527
|
+
for (let index = 1;index < lines.length; index += 1) {
|
|
17528
|
+
if (lines[index] === "---" || lines[index] === "...") {
|
|
17529
|
+
return {
|
|
17530
|
+
source: lines.slice(1, index).join(`
|
|
17531
|
+
`),
|
|
17532
|
+
body: lines.slice(index + 1).join(`
|
|
17533
|
+
`)
|
|
17534
|
+
};
|
|
17535
|
+
}
|
|
17536
|
+
}
|
|
17537
|
+
return;
|
|
17538
|
+
}
|
|
17539
|
+
function numberInRange(value, minimum, maximum) {
|
|
17540
|
+
if (!/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(value))
|
|
17541
|
+
return false;
|
|
17542
|
+
const number = Number(value);
|
|
17543
|
+
return Number.isFinite(number) && number >= minimum && number <= maximum;
|
|
17544
|
+
}
|
|
17545
|
+
function percentage(value) {
|
|
17546
|
+
return value.endsWith("%") && numberInRange(value.slice(0, -1), 0, 100);
|
|
17547
|
+
}
|
|
17548
|
+
function alpha(value) {
|
|
17549
|
+
return percentage(value) || numberInRange(value, 0, 1);
|
|
17550
|
+
}
|
|
17551
|
+
function isCssColor(value) {
|
|
17552
|
+
if (!value || Array.from(value).some((character) => character.charCodeAt(0) > 127) || value.trim() !== value) {
|
|
17553
|
+
return false;
|
|
17554
|
+
}
|
|
17555
|
+
if (/^#[\da-f]{3,4}(?:[\da-f]{2}){0,2}$/i.test(value))
|
|
17556
|
+
return true;
|
|
17557
|
+
const match = /^(rgba?|hsla?)\((.*)\)$/i.exec(value);
|
|
17558
|
+
if (!match || match[2].includes("(") || match[2].includes(")"))
|
|
17559
|
+
return false;
|
|
17560
|
+
const name = match[1].toLowerCase();
|
|
17561
|
+
const parts = match[2].split(",").map((part) => part.trim());
|
|
17562
|
+
const hasAlpha = name.endsWith("a");
|
|
17563
|
+
if (parts.length !== (hasAlpha ? 4 : 3))
|
|
17564
|
+
return false;
|
|
17565
|
+
if (name.startsWith("rgb")) {
|
|
17566
|
+
const channels = parts.slice(0, 3);
|
|
17567
|
+
const allPercentages = channels.every(percentage);
|
|
17568
|
+
const allNumbers = channels.every((part) => numberInRange(part, 0, 255));
|
|
17569
|
+
return (allPercentages || allNumbers) && (!hasAlpha || alpha(parts[3]));
|
|
17570
|
+
}
|
|
17571
|
+
const hue = parts[0].replace(/deg$/i, "");
|
|
17572
|
+
return numberInRange(hue, 0, 360) && percentage(parts[1]) && percentage(parts[2]) && (!hasAlpha || alpha(parts[3]));
|
|
17573
|
+
}
|
|
17574
|
+
function markdownSource(markdown, mode) {
|
|
17575
|
+
if (mode === "disabled")
|
|
17576
|
+
return { body: markdown, source: undefined };
|
|
17577
|
+
const frontMatter = splitFrontMatter(markdown);
|
|
17578
|
+
return frontMatter ?? { body: markdown, source: undefined };
|
|
17579
|
+
}
|
|
17580
|
+
var Markdown = forwardRef78(function Markdown2({
|
|
17581
|
+
markdown = "",
|
|
17582
|
+
breaks = true,
|
|
17583
|
+
colorChips = true,
|
|
17584
|
+
frontMatter = "render",
|
|
17585
|
+
variant,
|
|
17586
|
+
className,
|
|
17587
|
+
...props
|
|
17588
|
+
}, ref) {
|
|
17589
|
+
const source = markdownSource(markdown, frontMatter);
|
|
17590
|
+
const components = colorChips ? {
|
|
17591
|
+
code({ children, className: codeClassName, node, ...codeProps }) {
|
|
17592
|
+
const value = String(children).replace(/\n$/, "");
|
|
17593
|
+
const isInline = node?.position?.start.line === node?.position?.end.line;
|
|
17594
|
+
if (!isInline || !isCssColor(value)) {
|
|
17595
|
+
return /* @__PURE__ */ jsx92("code", {
|
|
17596
|
+
className: codeClassName,
|
|
17597
|
+
...codeProps,
|
|
17598
|
+
children
|
|
17599
|
+
});
|
|
17600
|
+
}
|
|
17601
|
+
return /* @__PURE__ */ jsxs73("code", {
|
|
17602
|
+
className: markdownColorCodeClass,
|
|
17603
|
+
...codeProps,
|
|
17604
|
+
children: [
|
|
17605
|
+
children,
|
|
17606
|
+
/* @__PURE__ */ jsx92("span", {
|
|
17607
|
+
className: markdownColorChipClass,
|
|
17608
|
+
role: "img",
|
|
17609
|
+
"aria-label": `Color ${value}`,
|
|
17610
|
+
children: /* @__PURE__ */ jsx92("span", {
|
|
17611
|
+
className: markdownColorChipSwatchClass,
|
|
17612
|
+
style: { backgroundColor: value },
|
|
17613
|
+
"aria-hidden": "true"
|
|
17614
|
+
})
|
|
17615
|
+
})
|
|
17616
|
+
]
|
|
17617
|
+
});
|
|
17618
|
+
}
|
|
17619
|
+
} : undefined;
|
|
17620
|
+
return /* @__PURE__ */ jsxs73("div", {
|
|
17621
|
+
ref,
|
|
17622
|
+
className: getMarkdownClasses({ variant, className }),
|
|
17623
|
+
...props,
|
|
17624
|
+
children: [
|
|
17625
|
+
frontMatter === "render" && source.source !== undefined ? /* @__PURE__ */ jsx92("div", {
|
|
17626
|
+
className: markdownFrontMatterClass,
|
|
17627
|
+
children: /* @__PURE__ */ jsx92("pre", {
|
|
17628
|
+
children: /* @__PURE__ */ jsx92("code", {
|
|
17629
|
+
className: "language-yaml",
|
|
17630
|
+
children: source.source
|
|
17631
|
+
})
|
|
17632
|
+
})
|
|
17633
|
+
}) : null,
|
|
17634
|
+
/* @__PURE__ */ jsx92(ReactMarkdown, {
|
|
17635
|
+
remarkPlugins: breaks ? [remarkGfm, remarkBreaks] : [remarkGfm],
|
|
17636
|
+
components,
|
|
17637
|
+
children: source.body
|
|
17638
|
+
})
|
|
17639
|
+
]
|
|
17640
|
+
});
|
|
17641
|
+
});
|
|
17434
17642
|
// src/components/upload/Upload.tsx
|
|
17435
|
-
import
|
|
17643
|
+
import React85, { forwardRef as forwardRef79, useLayoutEffect as useLayoutEffect3, useRef as useRef19, useState as useState57 } from "react";
|
|
17436
17644
|
|
|
17437
17645
|
// src/classes/upload.ts
|
|
17438
17646
|
var uploadBaseClass = "file-upload";
|
|
@@ -17477,7 +17685,7 @@ function getUploadItemClasses({
|
|
|
17477
17685
|
}
|
|
17478
17686
|
|
|
17479
17687
|
// src/components/upload/Upload.tsx
|
|
17480
|
-
import { jsx as
|
|
17688
|
+
import { jsx as jsx93, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
17481
17689
|
var LIST_IGNORE = Symbol("Upload.LIST_IGNORE");
|
|
17482
17690
|
var uidSeed = 0;
|
|
17483
17691
|
function nextUid() {
|
|
@@ -17644,12 +17852,12 @@ function UploadRoot({
|
|
|
17644
17852
|
}
|
|
17645
17853
|
}
|
|
17646
17854
|
function renderTrigger() {
|
|
17647
|
-
const trigger = children ?? /* @__PURE__ */
|
|
17855
|
+
const trigger = children ?? /* @__PURE__ */ jsx93("button", {
|
|
17648
17856
|
type: "button",
|
|
17649
17857
|
children: "Upload"
|
|
17650
17858
|
});
|
|
17651
17859
|
if (dragger) {
|
|
17652
|
-
return /* @__PURE__ */
|
|
17860
|
+
return /* @__PURE__ */ jsx93("div", {
|
|
17653
17861
|
className: uploadDropzoneClass,
|
|
17654
17862
|
role: "button",
|
|
17655
17863
|
tabIndex: disabled ? -1 : 0,
|
|
@@ -17680,8 +17888,8 @@ function UploadRoot({
|
|
|
17680
17888
|
children: trigger
|
|
17681
17889
|
});
|
|
17682
17890
|
}
|
|
17683
|
-
if (
|
|
17684
|
-
return
|
|
17891
|
+
if (React85.isValidElement(trigger)) {
|
|
17892
|
+
return React85.cloneElement(trigger, {
|
|
17685
17893
|
className: joinClasses(uploadTriggerClass, trigger.props.className),
|
|
17686
17894
|
onClick: (event) => {
|
|
17687
17895
|
trigger.props.onClick?.(event);
|
|
@@ -17689,7 +17897,7 @@ function UploadRoot({
|
|
|
17689
17897
|
}
|
|
17690
17898
|
});
|
|
17691
17899
|
}
|
|
17692
|
-
return /* @__PURE__ */
|
|
17900
|
+
return /* @__PURE__ */ jsx93("button", {
|
|
17693
17901
|
type: "button",
|
|
17694
17902
|
className: uploadTriggerClass,
|
|
17695
17903
|
disabled,
|
|
@@ -17697,7 +17905,7 @@ function UploadRoot({
|
|
|
17697
17905
|
children: trigger
|
|
17698
17906
|
});
|
|
17699
17907
|
}
|
|
17700
|
-
return /* @__PURE__ */
|
|
17908
|
+
return /* @__PURE__ */ jsxs74("div", {
|
|
17701
17909
|
...props,
|
|
17702
17910
|
ref,
|
|
17703
17911
|
className: getUploadClasses({
|
|
@@ -17707,7 +17915,7 @@ function UploadRoot({
|
|
|
17707
17915
|
className
|
|
17708
17916
|
}),
|
|
17709
17917
|
children: [
|
|
17710
|
-
/* @__PURE__ */
|
|
17918
|
+
/* @__PURE__ */ jsx93("input", {
|
|
17711
17919
|
ref: inputRef,
|
|
17712
17920
|
className: uploadInputClass,
|
|
17713
17921
|
type: "file",
|
|
@@ -17721,37 +17929,37 @@ function UploadRoot({
|
|
|
17721
17929
|
}
|
|
17722
17930
|
}),
|
|
17723
17931
|
renderTrigger(),
|
|
17724
|
-
mergedFileList.length > 0 ? /* @__PURE__ */
|
|
17932
|
+
mergedFileList.length > 0 ? /* @__PURE__ */ jsx93("div", {
|
|
17725
17933
|
className: getUploadListClasses({ listType }),
|
|
17726
17934
|
children: mergedFileList.map((file) => {
|
|
17727
17935
|
const size = formatSize(file.size);
|
|
17728
|
-
return /* @__PURE__ */
|
|
17936
|
+
return /* @__PURE__ */ jsxs74("div", {
|
|
17729
17937
|
className: getUploadItemClasses({ status: file.status }),
|
|
17730
17938
|
children: [
|
|
17731
|
-
/* @__PURE__ */
|
|
17939
|
+
/* @__PURE__ */ jsxs74("div", {
|
|
17732
17940
|
className: uploadItemInfoClass,
|
|
17733
17941
|
children: [
|
|
17734
|
-
/* @__PURE__ */
|
|
17942
|
+
/* @__PURE__ */ jsx93("button", {
|
|
17735
17943
|
type: "button",
|
|
17736
17944
|
className: uploadPreviewClass,
|
|
17737
17945
|
disabled,
|
|
17738
17946
|
onClick: () => onPreview?.(file),
|
|
17739
|
-
children: /* @__PURE__ */
|
|
17947
|
+
children: /* @__PURE__ */ jsx93("span", {
|
|
17740
17948
|
className: uploadItemNameClass,
|
|
17741
17949
|
children: file.name
|
|
17742
17950
|
})
|
|
17743
17951
|
}),
|
|
17744
|
-
size ? /* @__PURE__ */
|
|
17952
|
+
size ? /* @__PURE__ */ jsx93("span", {
|
|
17745
17953
|
className: uploadItemSizeClass,
|
|
17746
17954
|
children: size
|
|
17747
17955
|
}) : null,
|
|
17748
|
-
typeof file.percent === "number" ? /* @__PURE__ */
|
|
17956
|
+
typeof file.percent === "number" ? /* @__PURE__ */ jsx93("div", {
|
|
17749
17957
|
className: uploadProgressClass,
|
|
17750
17958
|
role: "progressbar",
|
|
17751
17959
|
"aria-valuemin": 0,
|
|
17752
17960
|
"aria-valuemax": 100,
|
|
17753
17961
|
"aria-valuenow": file.percent,
|
|
17754
|
-
children: /* @__PURE__ */
|
|
17962
|
+
children: /* @__PURE__ */ jsx93("div", {
|
|
17755
17963
|
className: uploadProgressBarClass,
|
|
17756
17964
|
style: {
|
|
17757
17965
|
width: `${Math.max(0, Math.min(100, file.percent))}%`
|
|
@@ -17760,9 +17968,9 @@ function UploadRoot({
|
|
|
17760
17968
|
}) : null
|
|
17761
17969
|
]
|
|
17762
17970
|
}),
|
|
17763
|
-
/* @__PURE__ */
|
|
17971
|
+
/* @__PURE__ */ jsx93("div", {
|
|
17764
17972
|
className: uploadItemActionsClass,
|
|
17765
|
-
children: /* @__PURE__ */
|
|
17973
|
+
children: /* @__PURE__ */ jsx93("button", {
|
|
17766
17974
|
type: "button",
|
|
17767
17975
|
className: uploadRemoveClass,
|
|
17768
17976
|
disabled,
|
|
@@ -17778,9 +17986,9 @@ function UploadRoot({
|
|
|
17778
17986
|
]
|
|
17779
17987
|
});
|
|
17780
17988
|
}
|
|
17781
|
-
var UploadFrame =
|
|
17989
|
+
var UploadFrame = forwardRef79(UploadRoot);
|
|
17782
17990
|
UploadFrame.displayName = "Upload";
|
|
17783
|
-
var Dragger =
|
|
17991
|
+
var Dragger = forwardRef79((props, ref) => /* @__PURE__ */ jsx93(UploadFrame, {
|
|
17784
17992
|
...props,
|
|
17785
17993
|
ref,
|
|
17786
17994
|
dragger: true
|
|
@@ -17790,7 +17998,7 @@ var Upload = UploadFrame;
|
|
|
17790
17998
|
Upload.Dragger = Dragger;
|
|
17791
17999
|
Upload.LIST_IGNORE = LIST_IGNORE;
|
|
17792
18000
|
// src/components/watermark/Watermark.tsx
|
|
17793
|
-
import { forwardRef as
|
|
18001
|
+
import { forwardRef as forwardRef80, useMemo as useMemo36 } from "react";
|
|
17794
18002
|
|
|
17795
18003
|
// src/classes/watermark.ts
|
|
17796
18004
|
var watermarkBaseClass = "watermark";
|
|
@@ -17800,7 +18008,7 @@ function getWatermarkClasses({ className }) {
|
|
|
17800
18008
|
}
|
|
17801
18009
|
|
|
17802
18010
|
// src/components/watermark/Watermark.tsx
|
|
17803
|
-
import { jsx as
|
|
18011
|
+
import { jsx as jsx94, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
17804
18012
|
function encodeSvg(svg) {
|
|
17805
18013
|
return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
|
|
17806
18014
|
}
|
|
@@ -17822,7 +18030,7 @@ function createWatermarkSvg({
|
|
|
17822
18030
|
}
|
|
17823
18031
|
return `<svg xmlns="http://www.w3.org/2000/svg" width="${viewWidth}" height="${viewHeight}" viewBox="0 0 ${viewWidth} ${viewHeight}"><text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" fill="${color}" font-size="${fontSize}" font-family="${font?.fontFamily ?? "sans-serif"}" font-weight="${font?.fontWeight ?? 400}" font-style="${font?.fontStyle ?? "normal"}" transform="rotate(${rotate ?? -22} ${viewWidth / 2} ${viewHeight / 2})">${text}</text></svg>`;
|
|
17824
18032
|
}
|
|
17825
|
-
var Watermark =
|
|
18033
|
+
var Watermark = forwardRef80(({
|
|
17826
18034
|
children,
|
|
17827
18035
|
className,
|
|
17828
18036
|
content,
|
|
@@ -17839,17 +18047,17 @@ var Watermark = forwardRef79(({
|
|
|
17839
18047
|
...props
|
|
17840
18048
|
}, ref) => {
|
|
17841
18049
|
const backgroundImage = useMemo36(() => encodeSvg(createWatermarkSvg({ content, image, width, height, rotate, font })), [content, font, height, image, rotate, width]);
|
|
17842
|
-
return /* @__PURE__ */
|
|
18050
|
+
return /* @__PURE__ */ jsxs75("div", {
|
|
17843
18051
|
...props,
|
|
17844
18052
|
ref,
|
|
17845
18053
|
className: getWatermarkClasses({ className }),
|
|
17846
18054
|
style: { position: "relative", ...style },
|
|
17847
18055
|
children: [
|
|
17848
|
-
/* @__PURE__ */
|
|
18056
|
+
/* @__PURE__ */ jsx94("div", {
|
|
17849
18057
|
className: watermarkContentClass,
|
|
17850
18058
|
children
|
|
17851
18059
|
}),
|
|
17852
|
-
/* @__PURE__ */
|
|
18060
|
+
/* @__PURE__ */ jsx94("div", {
|
|
17853
18061
|
"aria-hidden": "true",
|
|
17854
18062
|
"data-watermark-source": image ?? (typeof content === "string" || typeof content === "number" ? String(content) : undefined),
|
|
17855
18063
|
"data-inherit": inherit || undefined,
|
|
@@ -17960,6 +18168,7 @@ export {
|
|
|
17960
18168
|
MessageHolder,
|
|
17961
18169
|
Menu,
|
|
17962
18170
|
Mentions,
|
|
18171
|
+
Markdown,
|
|
17963
18172
|
List,
|
|
17964
18173
|
Link,
|
|
17965
18174
|
Layout,
|