@bbki.ng/components 2.6.16 → 3.0.0

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.
Files changed (149) hide show
  1. package/dist/Button.d.ts +1 -0
  2. package/dist/_virtual/_commonjsHelpers.mjs +6 -0
  3. package/dist/_virtual/index.mjs +4 -0
  4. package/dist/_virtual/jsx-runtime.mjs +7 -0
  5. package/dist/_virtual/jsx-runtime2.mjs +4 -0
  6. package/dist/_virtual/react-jsx-runtime.development.mjs +4 -0
  7. package/dist/_virtual/react-jsx-runtime.production.min.mjs +4 -0
  8. package/dist/article/Article.d.ts +11 -0
  9. package/dist/article/Article.mjs +43 -0
  10. package/dist/blink-dot/BlinkDot.d.ts +5 -0
  11. package/dist/blink-dot/BlinkDot.mjs +20 -0
  12. package/dist/blur-cover/BlurCover.d.ts +6 -0
  13. package/dist/blur-cover/BlurCover.mjs +28 -0
  14. package/dist/breadcrumb/Breadcrumb.d.ts +9 -0
  15. package/dist/breadcrumb/Breadcrumb.mjs +35 -0
  16. package/dist/button/Button.d.ts +18 -0
  17. package/dist/button/Button.mjs +35 -0
  18. package/dist/canvas/Canvas.d.ts +23 -0
  19. package/dist/canvas/Canvas.mjs +85 -0
  20. package/dist/canvas/useRenderer.d.ts +10 -0
  21. package/dist/canvas/useRenderer.mjs +31 -0
  22. package/dist/context-menu/index.d.ts +27 -0
  23. package/dist/context-menu/index.mjs +131 -0
  24. package/dist/drop-image/DropImage.d.ts +25 -0
  25. package/dist/drop-image/DropImage.mjs +151 -0
  26. package/dist/drop-image/useDropImage.d.ts +19 -0
  27. package/dist/drop-image/useDropImage.mjs +67 -0
  28. package/dist/drop-image/utils.d.ts +2 -0
  29. package/dist/drop-image/utils.mjs +4 -0
  30. package/dist/drop-zone/DropZone.d.ts +9 -0
  31. package/dist/drop-zone/DropZone.mjs +44 -0
  32. package/dist/img/Gallery.d.ts +11 -0
  33. package/dist/img/Gallery.mjs +37 -0
  34. package/dist/img/Img.d.ts +3 -0
  35. package/dist/img/Img.mjs +80 -0
  36. package/dist/img/RandomRowsLayout.d.ts +9 -0
  37. package/dist/img/RandomRowsLayout.mjs +49 -0
  38. package/dist/img/types.d.ts +21 -0
  39. package/dist/img/types.mjs +4 -0
  40. package/dist/img/utils.d.ts +7 -0
  41. package/dist/img/utils.mjs +15 -0
  42. package/dist/index.d.ts +25 -380
  43. package/dist/index.mjs +79 -0
  44. package/dist/input/index.d.ts +3 -0
  45. package/dist/input/index.mjs +17 -0
  46. package/dist/label/index.d.ts +5 -0
  47. package/dist/label/index.mjs +17 -0
  48. package/dist/layout/layout.d.ts +7 -0
  49. package/dist/layout/layout.mjs +27 -0
  50. package/dist/link/Link.d.ts +17 -0
  51. package/dist/link/Link.mjs +83 -0
  52. package/dist/list/list.d.ts +23 -0
  53. package/dist/list/list.mjs +76 -0
  54. package/dist/loading-spiral/LoadingSpiral.d.ts +5 -0
  55. package/dist/loading-spiral/LoadingSpiral.mjs +37 -0
  56. package/dist/loading-spiral/constants.d.ts +6 -0
  57. package/dist/loading-spiral/constants.mjs +61 -0
  58. package/dist/loading-spiral/createOptions.d.ts +17 -0
  59. package/dist/loading-spiral/createOptions.mjs +30 -0
  60. package/dist/loading-spiral/createSettings.d.ts +16 -0
  61. package/dist/loading-spiral/createSettings.mjs +21 -0
  62. package/dist/loading-spiral/useCanvasRef.d.ts +4 -0
  63. package/dist/loading-spiral/utils.d.ts +1 -0
  64. package/dist/logo/Logo.d.ts +6 -0
  65. package/dist/logo/Logo.mjs +36 -0
  66. package/dist/nav/Nav.d.ts +10 -0
  67. package/dist/nav/Nav.mjs +27 -0
  68. package/dist/node_modules/.pnpm/@babel_runtime@7.18.9/node_modules/@babel/runtime/helpers/esm/extends.mjs +13 -0
  69. package/dist/node_modules/.pnpm/@floating-ui_core@1.6.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +519 -0
  70. package/dist/node_modules/.pnpm/@floating-ui_dom@1.6.3/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +373 -0
  71. package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.0.8_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs +182 -0
  72. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs +108 -0
  73. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs +120 -0
  74. package/dist/node_modules/.pnpm/@radix-ui_primitive@1.0.1/node_modules/@radix-ui/primitive/dist/index.mjs +9 -0
  75. package/dist/node_modules/.pnpm/@radix-ui_react-arrow@1.0.3_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-arrow/dist/index.mjs +19 -0
  76. package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.0.3_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom_04e7d2b59cf7ec97f40d26a998d7601d/node_modules/@radix-ui/react-collection/dist/index.mjs +60 -0
  77. package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs +16 -0
  78. package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs +25 -0
  79. package/dist/node_modules/.pnpm/@radix-ui_react-context-menu@2.1.5_@types_react-dom@18.0.6_@types_react@18.0.15_react-d_1ce4db5e792f73d797e22c043cc3d326/node_modules/@radix-ui/react-context-menu/dist/index.mjs +213 -0
  80. package/dist/node_modules/.pnpm/@radix-ui_react-context@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-context/dist/index.mjs +88 -0
  81. package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs +9 -0
  82. package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.0.5_@types_react-dom@18.0.6_@types_react@18.0.15_re_0263a24376d55e4c2bb8fa2f75f1db3c/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +136 -0
  83. package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +20 -0
  84. package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.0.4_@types_react-dom@18.0.6_@types_react@18.0.15_react-do_a79d961df31bbecb3b2c94878dbb0724/node_modules/@radix-ui/react-focus-scope/dist/index.mjs +188 -0
  85. package/dist/node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.mjs +61 -0
  86. package/dist/node_modules/.pnpm/@radix-ui_react-id@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-id/dist/index.mjs +18 -0
  87. package/dist/node_modules/.pnpm/@radix-ui_react-label@2.1.1_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-label/dist/index.mjs +20 -0
  88. package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.0.6_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-menu/dist/index.mjs +657 -0
  89. package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.1.3_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-popper/dist/index.mjs +218 -0
  90. package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.0.4_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-portal/dist/index.mjs +14 -0
  91. package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.0.1_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-presence/dist/index.mjs +81 -0
  92. package/dist/node_modules/.pnpm/@radix-ui_react-primitive@1.0.3_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-primitive/dist/index.mjs +44 -0
  93. package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.0.1_@types_react-dom@18.0.6_@types_react@18.0.15_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-primitive/dist/index.mjs +31 -0
  94. package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.0.4_@types_react-dom@18.0.6_@types_react@18.0.15_react-d_69cf2e3e4b4e2c2fefdb8ea262543b5e/node_modules/@radix-ui/react-roving-focus/dist/index.mjs +199 -0
  95. package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.0.2_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.mjs +53 -0
  96. package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.1.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.mjs +48 -0
  97. package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs +16 -0
  98. package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs +37 -0
  99. package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.0.3_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs +17 -0
  100. package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs +6 -0
  101. package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.0.1_@types_react@18.0.15_react@18.2.0/node_modules/@radix-ui/react-use-size/dist/index.mjs +37 -0
  102. package/dist/node_modules/.pnpm/aria-hidden@1.2.3/node_modules/aria-hidden/dist/es2015/index.mjs +49 -0
  103. package/dist/node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs +6 -0
  104. package/dist/node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.mjs +40 -0
  105. package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs +23 -0
  106. package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.mjs +7 -0
  107. package/dist/node_modules/.pnpm/phenomenon@1.6.0/node_modules/phenomenon/dist/phenomenon.mjs +109 -0
  108. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll-bar/dist/es2015/component.mjs +61 -0
  109. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.mjs +7 -0
  110. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.mjs +25 -0
  111. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/Combination.mjs +17 -0
  112. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.mjs +116 -0
  113. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/UI.mjs +46 -0
  114. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.mjs +16 -0
  115. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.mjs +62 -0
  116. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/medium.mjs +5 -0
  117. package/dist/node_modules/.pnpm/react-remove-scroll@2.5.5_@types_react@18.0.15_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.mjs +7 -0
  118. package/dist/node_modules/.pnpm/react-style-singleton@2.2.1_@types_react@18.0.15_react@18.2.0/node_modules/react-style-singleton/dist/es2015/component.mjs +11 -0
  119. package/dist/node_modules/.pnpm/react-style-singleton@2.2.1_@types_react@18.0.15_react@18.2.0/node_modules/react-style-singleton/dist/es2015/hook.mjs +15 -0
  120. package/dist/node_modules/.pnpm/react-style-singleton@2.2.1_@types_react@18.0.15_react@18.2.0/node_modules/react-style-singleton/dist/es2015/singleton.mjs +30 -0
  121. package/dist/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.development.mjs +589 -0
  122. package/dist/node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react-jsx-runtime.production.min.mjs +32 -0
  123. package/dist/node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.mjs +8 -0
  124. package/dist/node_modules/.pnpm/tslib@2.4.1/node_modules/tslib/tslib.es6.mjs +29 -0
  125. package/dist/node_modules/.pnpm/use-callback-ref@1.3.1_@types_react@18.0.15_react@18.2.0/node_modules/use-callback-ref/dist/es2015/assignRef.mjs +6 -0
  126. package/dist/node_modules/.pnpm/use-callback-ref@1.3.1_@types_react@18.0.15_react@18.2.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.mjs +26 -0
  127. package/dist/node_modules/.pnpm/use-callback-ref@1.3.1_@types_react@18.0.15_react@18.2.0/node_modules/use-callback-ref/dist/es2015/useRef.mjs +25 -0
  128. package/dist/node_modules/.pnpm/use-sidecar@1.1.2_@types_react@18.0.15_react@18.2.0/node_modules/use-sidecar/dist/es2015/exports.mjs +21 -0
  129. package/dist/node_modules/.pnpm/use-sidecar@1.1.2_@types_react@18.0.15_react@18.2.0/node_modules/use-sidecar/dist/es2015/medium.mjs +67 -0
  130. package/dist/page/Page.d.ts +28 -0
  131. package/dist/page/Page.mjs +67 -0
  132. package/dist/panel/Panel.d.ts +6 -0
  133. package/dist/panel/Panel.mjs +17 -0
  134. package/dist/pop-confirm/PopConfirm.d.ts +10 -0
  135. package/dist/pop-confirm/PopConfirm.mjs +40 -0
  136. package/dist/skeleton/Seleton.d.ts +23 -0
  137. package/dist/skeleton/Seleton.mjs +69 -0
  138. package/dist/spinner/Spinner.d.ts +7 -0
  139. package/dist/table/Table.d.ts +18 -0
  140. package/dist/table/Table.mjs +34 -0
  141. package/dist/tag/Tag.d.ts +10 -0
  142. package/dist/tag/Tag.mjs +33 -0
  143. package/package.json +22 -13
  144. package/dist/index.cjs +0 -1816
  145. package/dist/index.cjs.map +0 -1
  146. package/dist/index.css +0 -1821
  147. package/dist/index.css.map +0 -1
  148. package/dist/index.js +0 -1738
  149. package/dist/index.js.map +0 -1
package/dist/index.js DELETED
@@ -1,1738 +0,0 @@
1
- // lib/article/Article.tsx
2
- import classNames2 from "classnames";
3
- import React3 from "react";
4
-
5
- // lib/blink-dot/BlinkDot.tsx
6
- import classNames from "classnames";
7
- import React from "react";
8
- var BlinkDot = (props) => {
9
- const { className } = props;
10
- const status = props.status || "hidden";
11
- const statusCls = classNames({
12
- "animate-ping-fast": status === "blink",
13
- hidden: status === "hidden"
14
- });
15
- return /* @__PURE__ */ React.createElement("span", {
16
- className: classNames("inline-flex justify-center items-center relative")
17
- }, /* @__PURE__ */ React.createElement("span", {
18
- className: `absolute inline-flex h-full w-full rounded-full text-red-600 -top-[28px] -left-[3px] ${statusCls} ${className}`
19
- }, "."));
20
- };
21
-
22
- // lib/blur-cover/BlurCover.tsx
23
- import React2 from "react";
24
- import cls from "classnames";
25
- var BlurCover = (props) => {
26
- const { status } = props;
27
- const coverCls = cls(
28
- "absolute",
29
- "block",
30
- "text-blur",
31
- "transition-all",
32
- "duration-200",
33
- "top-0",
34
- "left-0",
35
- "h-full",
36
- "w-full",
37
- {
38
- "z-[49]": status === "show",
39
- "opacity-0": status === "silent",
40
- "opacity-100": status === "show",
41
- "pointer-events-none": status === "silent"
42
- },
43
- props.className
44
- );
45
- return /* @__PURE__ */ React2.createElement("div", {
46
- className: coverCls
47
- });
48
- };
49
-
50
- // lib/article/Article.tsx
51
- var Article = (props) => {
52
- const { title, content, children, date, className, description } = props;
53
- return /* @__PURE__ */ React3.createElement("div", {
54
- className: classNames2("article", className)
55
- }, /* @__PURE__ */ React3.createElement("div", {
56
- className: "mb-16 leading-none"
57
- }, /* @__PURE__ */ React3.createElement("span", {
58
- className: "text-[2.25rem] p-16"
59
- }, title), props.loading && title && /* @__PURE__ */ React3.createElement(BlinkDot, {
60
- status: "blink",
61
- className: "!-top-[42px] !-left-16"
62
- }), date ? /* @__PURE__ */ React3.createElement("div", {
63
- className: "py-16 px-18 pb-0 text-gray-400"
64
- }, /* @__PURE__ */ React3.createElement("small", null, date)) : null), description && /* @__PURE__ */ React3.createElement("div", {
65
- className: "mb-128"
66
- }, description), /* @__PURE__ */ React3.createElement("div", {
67
- className: "text-black relative p-16"
68
- }, children || content, /* @__PURE__ */ React3.createElement(BlurCover, {
69
- status: props.loading ? "show" : "silent"
70
- })));
71
- };
72
-
73
- // lib/button/Button.tsx
74
- import React4 from "react";
75
- import classNames3 from "classnames";
76
- var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
77
- ButtonType2["DANGER"] = "danger";
78
- ButtonType2["PRIMARY"] = "primary";
79
- ButtonType2["NORMAL"] = "normal";
80
- ButtonType2["DISABLED"] = "disabled";
81
- return ButtonType2;
82
- })(ButtonType || {});
83
- function Button(props) {
84
- const typeClsMap = {
85
- ["danger" /* DANGER */]: "text-red-500",
86
- ["primary" /* PRIMARY */]: "text-blue-600",
87
- ["disabled" /* DISABLED */]: "text-gray-400 cursor-not-allowed",
88
- ["normal" /* NORMAL */]: "text-black"
89
- };
90
- const [pressed, setPressed] = React4.useState(false);
91
- const { type = "normal" /* NORMAL */, className = "", onClick, btnType } = props;
92
- const shadowTransCls = type === "disabled" /* DISABLED */ ? "" : classNames3(
93
- "transition-all duration-200 ease-in-out shadow-button active:shadow-empty",
94
- {
95
- "shadow-empty": pressed,
96
- "hover:shadow-button-hover": !pressed
97
- }
98
- );
99
- const handleClick = (e) => {
100
- if (type === "disabled" /* DISABLED */) {
101
- return;
102
- }
103
- setPressed(true);
104
- setTimeout(() => {
105
- setPressed(false);
106
- onClick(e);
107
- }, 280);
108
- };
109
- return /* @__PURE__ */ React4.createElement("button", {
110
- className: `${typeClsMap[type]} ${className} ${shadowTransCls} py-8 px-16 transition-all duration-200 ease-in-out`,
111
- onClick: handleClick,
112
- type: btnType
113
- }, props.children);
114
- }
115
- Button.displayName = "Button";
116
-
117
- // lib/logo/Logo.tsx
118
- import * as React5 from "react";
119
- var Logo = React5.memo(
120
- (props) => /* @__PURE__ */ React5.createElement("svg", {
121
- xmlns: "http://www.w3.org/2000/svg",
122
- width: "48",
123
- height: "48",
124
- viewBox: "0 0 48 48",
125
- fill: "none",
126
- onClick: props.onClick,
127
- className: props.className
128
- }, /* @__PURE__ */ React5.createElement("path", {
129
- d: "M29.1152 21.3106C32.0605 21.3106 34.4481 18.9101 34.4481 15.9489V24.6457C34.4481 25.7585 33.5508 26.6607 32.444 26.6607H15.1207C14.0138 26.6607 13.1166 25.7585 13.1166 24.6457V15.9489C13.1166 18.9101 15.5042 21.3106 18.4494 21.3106C21.3947 21.3106 23.7823 18.9101 23.7823 15.9489C23.7823 18.9101 26.17 21.3106 29.1152 21.3106Z",
130
- fill: "#9CA3AF"
131
- }), /* @__PURE__ */ React5.createElement("path", {
132
- d: "M23.7823 15.9373L23.7823 15.9489C23.7823 15.9451 23.7823 15.9412 23.7823 15.9373Z",
133
- fill: "#9CA3AF"
134
- }), /* @__PURE__ */ React5.createElement("path", {
135
- d: "M23.1143 28.004C23.1205 30.9598 25.5057 33.3541 28.4472 33.3541C31.3886 33.3541 33.7738 30.9598 33.7801 28.004H23.1143Z",
136
- fill: "#9CA3AF"
137
- }), /* @__PURE__ */ React5.createElement("path", {
138
- d: "M13.7846 28.004C13.7846 28.0079 13.7846 28.0117 13.7846 28.0156C13.7908 30.9714 16.1761 33.3657 19.1175 33.3657C22.0589 33.3657 24.4442 30.9714 24.4504 28.0156H13.7846V28.004Z",
139
- fill: "#9CA3AF"
140
- }), /* @__PURE__ */ React5.createElement("path", {
141
- d: "M14.4527 15.9373C14.4527 16.6792 13.8545 17.2806 13.1166 17.2806C12.3786 17.2806 11.7805 16.6792 11.7805 15.9373C11.7805 15.1954 12.3786 14.594 13.1166 14.594C13.8545 14.594 14.4527 15.1954 14.4527 15.9373Z",
142
- fill: "#9CA3AF"
143
- }), /* @__PURE__ */ React5.createElement("path", {
144
- d: "M25.1184 15.2657C25.1184 16.0076 24.5202 16.609 23.7823 16.609C23.0444 16.609 22.4462 16.0076 22.4462 15.2657C22.4462 14.5238 23.0444 13.9224 23.7823 13.9224C24.5202 13.9224 25.1184 14.5238 25.1184 15.2657Z",
145
- fill: "#9CA3AF"
146
- }), /* @__PURE__ */ React5.createElement("path", {
147
- d: "M35.7842 15.9373C35.7842 16.6792 35.186 17.2806 34.4481 17.2806C33.7102 17.2806 33.112 16.6792 33.112 15.9373C33.112 15.1954 33.7102 14.594 34.4481 14.594C35.186 14.594 35.7842 15.1954 35.7842 15.9373Z",
148
- fill: "#9CA3AF"
149
- })),
150
- () => {
151
- return true;
152
- }
153
- );
154
-
155
- // lib/nav/Nav.tsx
156
- import React8 from "react";
157
-
158
- // lib/breadcrumb/Breadcrumb.tsx
159
- import React7 from "react";
160
- import classNames5 from "classnames";
161
-
162
- // lib/link/Link.tsx
163
- import classNames4 from "classnames";
164
- import { Link as BaseLink } from "react-router-dom";
165
- import React6 from "react";
166
- var LinkColor = /* @__PURE__ */ ((LinkColor2) => {
167
- LinkColor2["BLUE"] = "blue";
168
- LinkColor2["RED"] = "red";
169
- LinkColor2["GRAY"] = "gray";
170
- return LinkColor2;
171
- })(LinkColor || {});
172
- var COLOR_MAPPING = {
173
- ["blue" /* BLUE */]: "text-blue-600",
174
- ["red" /* RED */]: "text-red-500",
175
- ["gray" /* GRAY */]: "text-gray-400"
176
- };
177
- var HOVER_COLOR_MAPPING = {
178
- ["blue" /* BLUE */]: "[&:not(:focus)]:hover:md:bg-blue-100 [&:not(:focus)]:hover:md:text-blue-600",
179
- ["red" /* RED */]: "[&:not(:focus)]:hover:md:bg-red-100 [&:not(:focus)]:hover:md:text-red-500",
180
- ["gray" /* GRAY */]: "[&:not(:focus)]:hover:md:bg-gray-100 [&:not(:focus)]:hover:md:text-gray-400"
181
- };
182
- var FOCUS_BG_COLOR_MAPPING = {
183
- ["blue" /* BLUE */]: "focus:bg-blue-100",
184
- ["red" /* RED */]: "focus:bg-red-100",
185
- ["gray" /* GRAY */]: "focus:bg-gray-100"
186
- };
187
- var Link = (props) => {
188
- const {
189
- color = "blue" /* BLUE */,
190
- external,
191
- className,
192
- children,
193
- status,
194
- readonly,
195
- ...rest
196
- } = props;
197
- const linkCls = classNames4(
198
- className,
199
- "rounded",
200
- "!no-underline",
201
- "inline-block",
202
- "transition-colors",
203
- "active:scale-[0.97]",
204
- COLOR_MAPPING[color],
205
- HOVER_COLOR_MAPPING[color],
206
- FOCUS_BG_COLOR_MAPPING[color]
207
- );
208
- if (external) {
209
- return /* @__PURE__ */ React6.createElement("a", {
210
- href: props.to,
211
- className: linkCls,
212
- target: "_blank",
213
- rel: "noreferrer",
214
- style: { padding: 4 }
215
- }, children);
216
- }
217
- if (readonly) {
218
- const isNonEnName = !/^[a-zA-Z~]+$/.test(children);
219
- const offsetCls = classNames4({ "relative top-[2px]": isNonEnName });
220
- return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement("span", {
221
- className: classNames4("text-gray-400", offsetCls),
222
- style: { padding: 4 }
223
- }, children), /* @__PURE__ */ React6.createElement(BlinkDot, {
224
- status
225
- }));
226
- }
227
- return /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(BaseLink, {
228
- ...rest,
229
- className: linkCls,
230
- style: { padding: 4 }
231
- }, children), /* @__PURE__ */ React6.createElement(BlinkDot, {
232
- className: "-top-3 left-1",
233
- status
234
- }));
235
- };
236
-
237
- // lib/breadcrumb/Breadcrumb.tsx
238
- var Breadcrumb = (props) => {
239
- const { paths, loading } = props;
240
- const PathElements = paths.map(({ path, name }, index) => {
241
- const slash = index === 0 ? null : /* @__PURE__ */ React7.createElement("span", {
242
- className: "text-gray-400"
243
- }, "/");
244
- const isNonEnName = !/^[a-zA-Z~]+$/.test(name);
245
- const offsetCls = classNames5({ "relative top-[2px]": isNonEnName });
246
- const isLast = index === paths.length - 1;
247
- const status = loading && isLast ? "blink" : "hidden";
248
- return /* @__PURE__ */ React7.createElement("span", {
249
- key: path || name
250
- }, slash, /* @__PURE__ */ React7.createElement(Link, {
251
- to: path ?? "",
252
- className: offsetCls,
253
- readonly: !path,
254
- status
255
- }, name));
256
- });
257
- return /* @__PURE__ */ React7.createElement("div", {
258
- className: "breadcrumb"
259
- }, PathElements);
260
- };
261
-
262
- // lib/nav/Nav.tsx
263
- import { useNavigate } from "react-router-dom";
264
- var Nav = (props) => {
265
- if (props.mini) {
266
- return /* @__PURE__ */ React8.createElement("div", {
267
- className: `p-8 w-full flex items-center ${props.className}`
268
- }, /* @__PURE__ */ React8.createElement(Breadcrumb, {
269
- paths: props.paths
270
- }));
271
- }
272
- const nav = useNavigate();
273
- return /* @__PURE__ */ React8.createElement("div", {
274
- className: `p-8 w-full flex items-center ${props.className}`
275
- }, props.customLogo || /* @__PURE__ */ React8.createElement(Logo, {
276
- className: "mr-8",
277
- onClick: () => {
278
- nav("/");
279
- }
280
- }), /* @__PURE__ */ React8.createElement(Breadcrumb, {
281
- paths: props.paths,
282
- loading: props.loading
283
- }));
284
- };
285
-
286
- // lib/tag/Tag.tsx
287
- import classNames6 from "classnames";
288
- import React9 from "react";
289
- var Tag = (props) => {
290
- return /* @__PURE__ */ React9.createElement(Link, {
291
- ...props,
292
- color: "gray" /* GRAY */
293
- }, /* @__PURE__ */ React9.createElement("small", null, props.prefix || "#", props.children));
294
- };
295
- var Tags = (props) => {
296
- const { tags, className } = props;
297
- return /* @__PURE__ */ React9.createElement("div", {
298
- className: classNames6(className, "inline-block")
299
- }, tags.map((tag, index) => {
300
- const isLast = index === tags.length - 1;
301
- return /* @__PURE__ */ React9.createElement(Tag, {
302
- ...tag,
303
- key: tag.to,
304
- className: classNames6({ "mr-8": !isLast })
305
- });
306
- }));
307
- };
308
-
309
- // lib/panel/Panel.tsx
310
- import React10, { useEffect, useState } from "react";
311
- var Panel = (props) => {
312
- const { className = "", children } = props;
313
- const [show, setShow] = useState(false);
314
- useEffect(() => {
315
- setShow(true);
316
- }, []);
317
- return /* @__PURE__ */ React10.createElement("div", {
318
- className: `transition-all ease-in-out duration-900 ${className} ${show ? "shadow-panel" : "shadow-empty"} p-32`
319
- }, children);
320
- };
321
-
322
- // lib/page/Page.tsx
323
- import React11 from "react";
324
- var Page = (props) => {
325
- const { nav, main } = props;
326
- return /* @__PURE__ */ React11.createElement("main", {
327
- className: "flex flex-col h-full"
328
- }, /* @__PURE__ */ React11.createElement("div", {
329
- className: `flx-grow-0 w-full fixed top-0 z-50`
330
- }, nav), /* @__PURE__ */ React11.createElement("section", {
331
- className: "flex-grow flex-shrink-0 px-6"
332
- }, main));
333
- };
334
- var NotFound = (props) => {
335
- return /* @__PURE__ */ React11.createElement(Error2, {
336
- error: { name: "404", message: "Not Found" }
337
- });
338
- };
339
- var Error2 = (props) => {
340
- const { error } = props;
341
- return /* @__PURE__ */ React11.createElement("div", {
342
- className: "prose"
343
- }, /* @__PURE__ */ React11.createElement("pre", null, /* @__PURE__ */ React11.createElement("code", {
344
- className: "javascript language-javascript"
345
- }, error.name, ":", error.message)));
346
- };
347
- var ErrorBoundary = class extends React11.Component {
348
- constructor(props) {
349
- super(props);
350
- this.state = { hasError: false };
351
- }
352
- static getDerivedStateFromError(error) {
353
- return { hasError: true, error };
354
- }
355
- render() {
356
- if (this.state.error && this.state.hasError) {
357
- return /* @__PURE__ */ React11.createElement(Article, {
358
- title: "\u51FA\u9519"
359
- }, /* @__PURE__ */ React11.createElement("div", {
360
- className: "relative h-256"
361
- }, /* @__PURE__ */ React11.createElement(Error2, {
362
- error: this.state.error
363
- })));
364
- }
365
- return this.props.children;
366
- }
367
- };
368
-
369
- // lib/pop-confirm/PopConfirm.tsx
370
- import React12, { useState as useState2 } from "react";
371
- var PopConfirm = (props) => {
372
- const [loading, setLoading] = useState2(false);
373
- const { onOk, onCancel, children, content, className } = props;
374
- return /* @__PURE__ */ React12.createElement(Panel, {
375
- className
376
- }, /* @__PURE__ */ React12.createElement("div", {
377
- className: "mb-32"
378
- }, children || content), /* @__PURE__ */ React12.createElement("div", {
379
- className: "flex justify-end"
380
- }, onCancel && /* @__PURE__ */ React12.createElement(Button, {
381
- onClick: onCancel,
382
- type: "normal" /* NORMAL */
383
- }, "Cancel"), onOk && /* @__PURE__ */ React12.createElement(Button, {
384
- onClick: async (e) => {
385
- setLoading(true);
386
- await onOk(e);
387
- setLoading(false);
388
- },
389
- className: "ml-16 relative",
390
- type: loading ? "disabled" /* DISABLED */ : "primary" /* PRIMARY */
391
- }, "OK", loading && /* @__PURE__ */ React12.createElement(BlinkDot, {
392
- className: "!absolute top-2 right-2"
393
- }))));
394
- };
395
-
396
- // lib/table/Table.tsx
397
- import React13 from "react";
398
- var Table = (props) => {
399
- const { rowCount, rowRenderer, headerRenderer, className } = props;
400
- const rows = [];
401
- for (let i = 0; i < rowCount; i++) {
402
- rows.push(/* @__PURE__ */ React13.createElement("tr", {
403
- key: i
404
- }, rowRenderer(i)));
405
- }
406
- return /* @__PURE__ */ React13.createElement("table", {
407
- className
408
- }, headerRenderer && /* @__PURE__ */ React13.createElement("thead", null, /* @__PURE__ */ React13.createElement("tr", null, headerRenderer())), /* @__PURE__ */ React13.createElement("tbody", null, rows));
409
- };
410
- Table.HCell = (props) => /* @__PURE__ */ React13.createElement("th", {
411
- ...props
412
- }, props.children);
413
- Table.Cell = (props) => /* @__PURE__ */ React13.createElement("td", {
414
- ...props
415
- }, props.children);
416
-
417
- // lib/skeleton/Seleton.tsx
418
- import classNames7 from "classnames";
419
- import React15 from "react";
420
-
421
- // lib/list/list.tsx
422
- import cls2 from "classnames";
423
- import React14 from "react";
424
- var List = (props) => {
425
- const { items, itemRenderer, className, horizontal, compact, footer } = props;
426
- const spaceCls = compact ? "" : horizontal ? "mr-3" : "mb-16";
427
- return /* @__PURE__ */ React14.createElement("ul", {
428
- className: cls2(className, "list-style-none", {
429
- flex: horizontal,
430
- "items-center": horizontal
431
- })
432
- }, items.map((item, index) => {
433
- return /* @__PURE__ */ React14.createElement("li", {
434
- key: item.id || index,
435
- className: cls2(spaceCls, "flex-shrink-0", { "!my-0": horizontal })
436
- }, itemRenderer(item, index));
437
- }), footer && /* @__PURE__ */ React14.createElement("li", {
438
- key: "footer",
439
- className: cls2(spaceCls, "flex-shrink-0", { "!my-0": horizontal })
440
- }, footer));
441
- };
442
- var TitledList = (props) => {
443
- const { title, description, ...rest } = props;
444
- if (!title) {
445
- return /* @__PURE__ */ React14.createElement(List, {
446
- ...rest
447
- });
448
- }
449
- return /* @__PURE__ */ React14.createElement(Article, {
450
- title,
451
- description,
452
- className: "w-fit"
453
- }, /* @__PURE__ */ React14.createElement(List, {
454
- ...rest
455
- }));
456
- };
457
- var LinkList = (props) => {
458
- const { title, description, links, ...rest } = props;
459
- const renderLink = ({ name, to, external, ...rest2 }) => {
460
- return /* @__PURE__ */ React14.createElement(Link, {
461
- to,
462
- key: name,
463
- external,
464
- ...rest2
465
- }, name);
466
- };
467
- return /* @__PURE__ */ React14.createElement(TitledList, {
468
- title,
469
- description,
470
- items: links,
471
- itemRenderer: renderLink,
472
- ...rest
473
- });
474
- };
475
-
476
- // lib/skeleton/Seleton.tsx
477
- var SkeletonColor = /* @__PURE__ */ ((SkeletonColor2) => {
478
- SkeletonColor2["BLUE"] = "blue";
479
- SkeletonColor2["RED"] = "red";
480
- SkeletonColor2["GRAY"] = "gray";
481
- SkeletonColor2["BLACK"] = "black";
482
- return SkeletonColor2;
483
- })(SkeletonColor || {});
484
- var COLOR_MAPPING2 = {
485
- ["blue" /* BLUE */]: "bg-blue-100",
486
- ["red" /* RED */]: "bg-red-100",
487
- ["gray" /* GRAY */]: "bg-gray-100",
488
- ["black" /* BLACK */]: "bg-gray-200"
489
- };
490
- var Skeleton = (props) => {
491
- const {
492
- bgColor = "gray" /* GRAY */,
493
- width = 26,
494
- height = 24,
495
- className
496
- } = props;
497
- return /* @__PURE__ */ React15.createElement("div", {
498
- className: classNames7(
499
- COLOR_MAPPING2[bgColor],
500
- "animate-pulse",
501
- "rounded",
502
- className
503
- ),
504
- style: { width, height }
505
- });
506
- };
507
- var ArticleSkeleton = (props) => {
508
- const { children, titleLength = 0, descriptionLength } = props;
509
- return /* @__PURE__ */ React15.createElement(Article, {
510
- title: /* @__PURE__ */ React15.createElement(Skeleton, {
511
- width: 36 * titleLength,
512
- height: 36,
513
- bgColor: "black" /* BLACK */
514
- }),
515
- description: descriptionLength && /* @__PURE__ */ React15.createElement(Skeleton, {
516
- width: 16 * descriptionLength
517
- })
518
- }, children);
519
- };
520
- var LinkListSkeleton = (props) => {
521
- const { linksLength, ...rest } = props;
522
- const renderSkeleton = (length) => {
523
- return /* @__PURE__ */ React15.createElement(Skeleton, {
524
- className: "inline-block align-middle",
525
- width: length * 16,
526
- bgColor: "blue" /* BLUE */
527
- });
528
- };
529
- if (!rest.titleLength) {
530
- return /* @__PURE__ */ React15.createElement(List, {
531
- items: linksLength,
532
- itemRenderer: renderSkeleton
533
- });
534
- }
535
- return /* @__PURE__ */ React15.createElement(ArticleSkeleton, {
536
- ...rest
537
- }, /* @__PURE__ */ React15.createElement(List, {
538
- items: linksLength,
539
- itemRenderer: renderSkeleton
540
- }));
541
- };
542
-
543
- // lib/drop-image/DropImage.tsx
544
- import cls3 from "classnames";
545
- import React16, {
546
- useEffect as useEffect2,
547
- useCallback as useCallback2
548
- } from "react";
549
- import { useState as useState4 } from "react";
550
-
551
- // lib/drop-image/utils.ts
552
- var wait = (d) => new Promise((r) => setTimeout(r, d));
553
-
554
- // lib/drop-image/useDropImage.ts
555
- import {
556
- useState as useState3,
557
- useCallback,
558
- useRef
559
- } from "react";
560
- var useDropImage = (params) => {
561
- const [isDragOver, setIsDragOver] = useState3(false);
562
- const [imageSrc, setImageSrc] = useState3("");
563
- const [imageSize, setImageSize] = useState3({ width: 0, height: 0 });
564
- const imageFile = useRef();
565
- const {
566
- portraitImageWidth = 384,
567
- landscapeImageWidth = 500,
568
- onDrop = () => {
569
- },
570
- onImageLoad = () => {
571
- }
572
- } = params || {};
573
- const reset = () => {
574
- setImageSrc("");
575
- setImageSize({ width: 0, height: 0 });
576
- setIsDragOver(false);
577
- imageFile.current = null;
578
- };
579
- const calcDefaultImgSize2 = (img, defaultWidth) => {
580
- const { width, height } = img;
581
- const whRatio = width / height;
582
- const isHorizontal = width > height;
583
- const finalWidth = defaultWidth || (isHorizontal ? landscapeImageWidth : portraitImageWidth);
584
- return {
585
- width: finalWidth,
586
- height: finalWidth / whRatio
587
- };
588
- };
589
- const setPreviewImageSrcByFile = (file) => {
590
- try {
591
- setImageSrc(URL.createObjectURL(file));
592
- } catch (e) {
593
- setImageSrc("");
594
- }
595
- };
596
- const handleDragOver = useCallback((ev) => {
597
- ev.preventDefault();
598
- setIsDragOver(true);
599
- if (!ev.dataTransfer) {
600
- return;
601
- }
602
- ev.dataTransfer.dropEffect = "move";
603
- }, []);
604
- const handleDragLeave = useCallback(() => {
605
- setIsDragOver(false);
606
- }, []);
607
- const handleDrop = useCallback((ev) => {
608
- ev.preventDefault();
609
- setIsDragOver(false);
610
- const file = ev.dataTransfer ? ev.dataTransfer.files[0] : void 0;
611
- if (!file || !file.type.startsWith("image")) {
612
- return;
613
- }
614
- imageFile.current = file;
615
- setPreviewImageSrcByFile(file);
616
- onDrop(ev, file);
617
- }, []);
618
- const handleImgLoad = (img) => {
619
- const updateFunc = async () => {
620
- const p = "decode" in img ? img.decode : Promise.resolve;
621
- try {
622
- await p();
623
- } catch (e) {
624
- }
625
- setImageSize(
626
- calcDefaultImgSize2({
627
- width: img.naturalWidth,
628
- height: img.naturalHeight
629
- })
630
- );
631
- if (!imageFile.current) {
632
- return;
633
- }
634
- onImageLoad(img, imageFile.current);
635
- };
636
- if (img.complete) {
637
- updateFunc().then();
638
- return;
639
- }
640
- img.onload = updateFunc;
641
- };
642
- const imageRef = useCallback((input) => {
643
- if (!input) {
644
- return;
645
- }
646
- handleImgLoad(input);
647
- }, []);
648
- return {
649
- isDragOver,
650
- imageSrc,
651
- imageRef,
652
- imageSize,
653
- handleDragOver,
654
- handleDragLeave,
655
- handleDrop,
656
- reset
657
- };
658
- };
659
-
660
- // lib/drop-image/DropImage.tsx
661
- var ImagePreviewer = (props) => {
662
- const {
663
- visible: showImagePreviewer,
664
- imageRef,
665
- imageSize,
666
- imageSrc,
667
- className
668
- } = props;
669
- return /* @__PURE__ */ React16.createElement("img", {
670
- className: cls3(
671
- className,
672
- "max-w-[100%]",
673
- "h-[auto]",
674
- "duration-300",
675
- "transition-opacity",
676
- "opacity-100",
677
- {
678
- "opacity-0": !showImagePreviewer,
679
- "!m-0": !showImagePreviewer,
680
- "!p-0": !showImagePreviewer
681
- }
682
- ),
683
- ref: imageRef,
684
- src: imageSrc,
685
- width: imageSize.width,
686
- height: imageSize.height
687
- });
688
- };
689
- var GhostDropImage = (props) => {
690
- const {
691
- onDrop = () => {
692
- },
693
- onUploadFinish = () => {
694
- },
695
- uploader,
696
- waitTimeAfterFinish = 2e3,
697
- className = "",
698
- children,
699
- placeholder
700
- } = props;
701
- const [coverVisible, setCoverVisible] = useState4(false);
702
- const [imageVisible, setImageVisible] = useState4(false);
703
- const handleDocDragEnter = useCallback2(() => {
704
- setCoverVisible(true);
705
- }, []);
706
- const {
707
- handleDragLeave,
708
- handleDragOver,
709
- handleDrop,
710
- imageRef,
711
- imageSize,
712
- imageSrc,
713
- reset
714
- } = useDropImage({
715
- onImageLoad: () => {
716
- setImageVisible(true);
717
- },
718
- onDrop: async (e, file) => {
719
- onDrop(e, file);
720
- setCoverVisible(false);
721
- const result = await uploader(file);
722
- await wait(waitTimeAfterFinish);
723
- onUploadFinish(result);
724
- setImageVisible(false);
725
- reset();
726
- }
727
- });
728
- useEffect2(() => {
729
- document.addEventListener("dragenter", handleDocDragEnter);
730
- return () => {
731
- document.removeEventListener("dragenter", handleDocDragEnter);
732
- };
733
- }, []);
734
- const coverCls = cls3("fixed", "top-0", "left-0", "h-full", "w-full", {
735
- "lqip-blur": coverVisible,
736
- "z-[999]": coverVisible,
737
- block: coverVisible,
738
- hidden: !coverVisible
739
- });
740
- return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement("div", {
741
- className: coverCls,
742
- onDragLeave: () => {
743
- handleDragLeave();
744
- setCoverVisible(false);
745
- },
746
- onDragOver: handleDragOver,
747
- onDrop: handleDrop
748
- }), !imageVisible && placeholder, children ? children({
749
- visible: imageVisible,
750
- imageRef,
751
- imageSize,
752
- imageSrc
753
- }) : /* @__PURE__ */ React16.createElement(ImagePreviewer, {
754
- className,
755
- visible: imageVisible,
756
- imageRef,
757
- imageSrc,
758
- imageSize
759
- }));
760
- };
761
- var DropImage = (props) => {
762
- const {
763
- uploader,
764
- defaultBgColor = "#F3F4F6",
765
- onDrop,
766
- dragOverBgColor = "#EFF6FF",
767
- waitTimeAfterFinish = 2e3,
768
- placeholder = "",
769
- className = "",
770
- onUploadFinish = () => {
771
- },
772
- ghost,
773
- children,
774
- dropAreaStyle = {
775
- width: 300,
776
- height: 300
777
- }
778
- } = props;
779
- if (ghost) {
780
- return /* @__PURE__ */ React16.createElement(GhostDropImage, {
781
- ...props
782
- });
783
- }
784
- const [showImagePreviewer, setShowImagePreviewer] = useState4(false);
785
- const {
786
- handleDragLeave,
787
- handleDragOver,
788
- handleDrop,
789
- imageRef,
790
- imageSize,
791
- imageSrc,
792
- isDragOver,
793
- reset
794
- } = useDropImage({
795
- onDrop,
796
- onImageLoad: async (image, file) => {
797
- await wait(500);
798
- setShowImagePreviewer(true);
799
- await onUploadFinish(await uploader(file, image));
800
- await wait(waitTimeAfterFinish);
801
- setShowImagePreviewer(false);
802
- await wait(500);
803
- reset();
804
- }
805
- });
806
- const getDropAreaStyle = () => {
807
- return Object.assign({}, dropAreaStyle, {
808
- background: isDragOver ? dragOverBgColor : defaultBgColor,
809
- width: imageSize.width || dropAreaStyle.width,
810
- height: imageSize.height || dropAreaStyle.height
811
- });
812
- };
813
- return /* @__PURE__ */ React16.createElement("div", {
814
- className: cls3(
815
- className,
816
- "transition-all items-center justify-center flex duration-200 ease-in-out",
817
- {
818
- "shadow-input": !imageSrc,
819
- "shadow-empty": imageSrc
820
- }
821
- ),
822
- onDragLeave: handleDragLeave,
823
- onDragOver: handleDragOver,
824
- onDrop: handleDrop,
825
- style: getDropAreaStyle()
826
- }, children ? children({
827
- visible: showImagePreviewer,
828
- imageRef,
829
- imageSize,
830
- imageSrc
831
- }) : /* @__PURE__ */ React16.createElement(ImagePreviewer, {
832
- visible: showImagePreviewer,
833
- imageRef,
834
- imageSrc,
835
- imageSize
836
- }), !imageSrc && placeholder);
837
- };
838
-
839
- // lib/layout/layout.tsx
840
- import cls4 from "classnames";
841
- import React17 from "react";
842
- var ThreeColLayout = (props) => {
843
- const { leftRenderer, middleRenderer, rightRenderer } = props;
844
- const colCls = cls4("max-h-full overflow-auto xl:!block py-128");
845
- return /* @__PURE__ */ React17.createElement("div", {
846
- className: "grid grid-cols-1 xl:grid-cols-3 gap-4 h-full w-full"
847
- }, /* @__PURE__ */ React17.createElement("div", {
848
- className: cls4("hidden", colCls)
849
- }, leftRenderer && leftRenderer()), /* @__PURE__ */ React17.createElement("div", {
850
- className: cls4(colCls, "sm:px-128 xl:px-0 no-scrollbar", "relative", {
851
- hidden: !middleRenderer
852
- })
853
- }, middleRenderer && middleRenderer()), /* @__PURE__ */ React17.createElement("div", {
854
- className: cls4("hidden", colCls)
855
- }, rightRenderer && rightRenderer()));
856
- };
857
-
858
- // lib/img/Img.tsx
859
- import classnames from "classnames";
860
- import React18, { useState as useState5 } from "react";
861
-
862
- // lib/img/types.ts
863
- var ossProcessType = /* @__PURE__ */ ((ossProcessType2) => {
864
- ossProcessType2["THUMBNAIL"] = "thumbnail";
865
- ossProcessType2["WEBP"] = "webp";
866
- ossProcessType2["NULL"] = "null";
867
- ossProcessType2["oWEBP"] = "owebp";
868
- ossProcessType2["PROG"] = "prog";
869
- return ossProcessType2;
870
- })(ossProcessType || {});
871
-
872
- // lib/img/utils.ts
873
- var addOssWebpProcessStyle = (originUrl, style) => {
874
- const OSS_ADDRESS = "https://zjh-im-res.oss-cn-shenzhen.aliyuncs.com";
875
- const isInvalidOSSImgUrl = !originUrl.startsWith(OSS_ADDRESS);
876
- const isProcessedOssImg = /x-oss-process=style\/\w+/.test(originUrl);
877
- const isWebpImg = /webp$/.test(originUrl);
878
- if (isInvalidOSSImgUrl || isProcessedOssImg || isWebpImg && style === "webp" /* WEBP */ || style === "null" /* NULL */) {
879
- return originUrl;
880
- }
881
- return `${originUrl}?x-oss-process=style/${style}`;
882
- };
883
- var calcDefaultImgSize = (img, defaultWidth, scale) => {
884
- const { width, height } = img;
885
- const whRatio = width / height;
886
- const isHorizontal = width > height;
887
- const finalWidth = (defaultWidth || (isHorizontal ? 576 : 384)) * (scale || 1);
888
- return {
889
- width: finalWidth,
890
- height: finalWidth / whRatio
891
- };
892
- };
893
-
894
- // lib/img/Img.tsx
895
- var emptyDataURL = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
896
- var Img = (props) => {
897
- const {
898
- src,
899
- className,
900
- renderedWidth,
901
- avgColor,
902
- thumbnailSrc,
903
- processType,
904
- size,
905
- removeBlurBgAfterLoad
906
- } = props;
907
- const { width, height } = calcDefaultImgSize(
908
- props,
909
- renderedWidth,
910
- size === "normal" ? 0.6 : 1
911
- );
912
- const [loaded, setLoaded] = useState5(false);
913
- const [decoded, setDecoded] = useState5(false);
914
- const baseWrapperStyle = {
915
- width: "initial",
916
- height: "initial",
917
- backgroundSize: "cover",
918
- backgroundColor: avgColor || "#f1f1f1",
919
- backgroundPosition: "0% 0%",
920
- backgroundImage: `url(${thumbnailSrc ? thumbnailSrc : addOssWebpProcessStyle(src, "thumbnail" /* THUMBNAIL */)})`
921
- };
922
- const dynamicWrapperStyle = loaded && removeBlurBgAfterLoad ? { backgroundImage: "none" } : {};
923
- const handleImgLoad = (img) => {
924
- const updateFunc = async () => {
925
- const p = "decode" in img ? img.decode : Promise.resolve;
926
- try {
927
- await p();
928
- } catch (e) {
929
- }
930
- setDecoded(true);
931
- setLoaded(true);
932
- };
933
- if (img.complete) {
934
- updateFunc().then();
935
- return;
936
- }
937
- img.onload = updateFunc;
938
- };
939
- return /* @__PURE__ */ React18.createElement("span", {
940
- className: classnames(
941
- className,
942
- "inline-block",
943
- "relative",
944
- "overflow-hidden",
945
- "duration-500",
946
- "leading-none",
947
- "align-bottom",
948
- "border-0"
949
- ),
950
- draggable: false,
951
- style: Object.assign({}, baseWrapperStyle, dynamicWrapperStyle)
952
- }, /* @__PURE__ */ React18.createElement("img", {
953
- ref: (input) => {
954
- if (!input) {
955
- return;
956
- }
957
- handleImgLoad(input);
958
- },
959
- width,
960
- height,
961
- src: addOssWebpProcessStyle(src, processType || "webp" /* WEBP */),
962
- decoding: "async",
963
- loading: "lazy",
964
- crossOrigin: "anonymous",
965
- style: {
966
- contentVisibility: "auto"
967
- },
968
- className: classnames(
969
- "transition-opacity",
970
- "opacity-100",
971
- "duration-500",
972
- {
973
- "opacity-0": !decoded
974
- }
975
- )
976
- }), /* @__PURE__ */ React18.createElement("img", {
977
- src: emptyDataURL,
978
- className: classnames(
979
- "lqip-blur",
980
- "absolute",
981
- "h-full",
982
- "w-full",
983
- "duration-500",
984
- "transition-opacity",
985
- {
986
- "opacity-100": !decoded,
987
- "opacity-0": decoded
988
- }
989
- ),
990
- crossOrigin: "anonymous",
991
- style: { top: 0, left: 0 }
992
- }));
993
- };
994
-
995
- // lib/img/Gallery.tsx
996
- import classnames3 from "classnames";
997
- import React20 from "react";
998
-
999
- // lib/img/RandomRowsLayout.tsx
1000
- import classnames2 from "classnames";
1001
- import React19 from "react";
1002
- var last = (arr) => {
1003
- if (arr.length < 2) {
1004
- return arr[0];
1005
- }
1006
- return arr[arr.length - 1];
1007
- };
1008
- var defaultCellClsGenerator = (colNum, isCenterSingleCell) => {
1009
- const isSingleCell = colNum === 1;
1010
- const singleCellWidth = isCenterSingleCell ? "full" : "1/2";
1011
- const cellWidth = isSingleCell ? singleCellWidth : "1/2";
1012
- return `md:basis-${cellWidth}`;
1013
- };
1014
- var generateRandomBoolean = (p = 0.5) => Math.random() < p;
1015
- var generateRandomColNum = (total) => {
1016
- const colNumArr = [];
1017
- if (total <= 2) {
1018
- return [total];
1019
- }
1020
- let colSum = 0;
1021
- while (colSum < total) {
1022
- const p = last(colNumArr) === 2 ? 0.9 : 0.5;
1023
- const num = generateRandomBoolean(p) ? 1 : 2;
1024
- colNumArr.push(num);
1025
- colSum += num;
1026
- }
1027
- return colNumArr;
1028
- };
1029
- var sumColNumByIdx = (colNums, idx) => {
1030
- let sum = 0;
1031
- for (let i = 0; i < idx; i++) {
1032
- sum += colNums[i];
1033
- }
1034
- return sum;
1035
- };
1036
- var RandomRowsLayout = React19.memo(
1037
- (props) => {
1038
- const {
1039
- cellsCount,
1040
- cellRenderer,
1041
- classNames: classNames9 = "",
1042
- cellWrapperClsGenerator = defaultCellClsGenerator
1043
- } = props;
1044
- const colNums = generateRandomColNum(cellsCount);
1045
- return /* @__PURE__ */ React19.createElement("div", {
1046
- className: classNames9
1047
- }, colNums.map((colNum, row) => {
1048
- const randBool = generateRandomBoolean(
1049
- colNum < 2 ? 0.6 : 0.5
1050
- );
1051
- const randBoolArr = [randBool, !randBool];
1052
- return /* @__PURE__ */ React19.createElement("div", {
1053
- className: "flex items-center flex-wrap",
1054
- key: row
1055
- }, new Array(colNum).fill(null).map((_, col) => {
1056
- const generatedCls = cellWrapperClsGenerator(
1057
- colNum,
1058
- generateRandomBoolean()
1059
- );
1060
- const currentIdx = sumColNumByIdx(colNums, row) + col;
1061
- const cls6 = classnames2(
1062
- "flex items-center justify-center flex-shrink-0 flex-grow-0",
1063
- "basis-full",
1064
- generatedCls
1065
- );
1066
- return /* @__PURE__ */ React19.createElement("div", {
1067
- className: cls6,
1068
- key: col
1069
- }, cellRenderer(currentIdx, randBoolArr[col], col));
1070
- }));
1071
- }));
1072
- },
1073
- (prevProps, nextProps) => {
1074
- return prevProps.cellsCount === nextProps.cellsCount;
1075
- }
1076
- );
1077
-
1078
- // lib/img/Gallery.tsx
1079
- var defaultImageRenderer = (img, index, col) => {
1080
- return /* @__PURE__ */ React20.createElement("div", {
1081
- className: classnames3("mb-128", {
1082
- "md:mr-64": col === 0,
1083
- "md:ml-64": col !== 0
1084
- })
1085
- }, img);
1086
- };
1087
- var Gallery = (props) => {
1088
- const {
1089
- images,
1090
- children,
1091
- imageRenderer = defaultImageRenderer,
1092
- className = "",
1093
- ...rest
1094
- } = props;
1095
- const renderImage = (index, isLargeImage, col) => {
1096
- const image = images[index];
1097
- if (!image) {
1098
- return null;
1099
- }
1100
- return imageRenderer(
1101
- /* @__PURE__ */ React20.createElement(Img, {
1102
- ...image,
1103
- size: isLargeImage ? "large" : "normal"
1104
- }),
1105
- index,
1106
- col,
1107
- isLargeImage
1108
- );
1109
- };
1110
- return /* @__PURE__ */ React20.createElement("div", {
1111
- className: classnames3("w-full flex justify-center", className)
1112
- }, /* @__PURE__ */ React20.createElement(RandomRowsLayout, {
1113
- classNames: "mx-32 mt-128 max-w-screen-xl",
1114
- cellsCount: images.length,
1115
- cellRenderer: renderImage,
1116
- ...rest
1117
- }), children);
1118
- };
1119
-
1120
- // lib/loading-spiral/LoadingSpiral.tsx
1121
- import Phenomenon from "phenomenon";
1122
- import classNames8 from "classnames";
1123
- import React21, { useEffect as useEffect3, useRef as useRef2 } from "react";
1124
-
1125
- // lib/loading-spiral/createSettings.ts
1126
- var createSettings = (settings) => {
1127
- const { canvas, step = 0.09 } = settings;
1128
- const uniforms = {
1129
- uProgress: {
1130
- type: "float",
1131
- value: 0
1132
- }
1133
- };
1134
- return {
1135
- uniforms,
1136
- devicePixelRatio: window.devicePixelRatio,
1137
- shouldRender: true,
1138
- canvas,
1139
- onRender: (r) => {
1140
- const { uProgress } = r.uniforms;
1141
- uProgress.value += step;
1142
- }
1143
- };
1144
- };
1145
-
1146
- // lib/loading-spiral/constants.ts
1147
- var VERTEX_SHADER = `
1148
- attribute float ${"aPercent" /* PERCENT */};
1149
- attribute float ${"aPointSize" /* POINT_SIZE */};
1150
-
1151
- uniform mat4 uProjectionMatrix;
1152
- uniform mat4 uModelMatrix;
1153
- uniform mat4 uViewMatrix;
1154
- uniform float uProgress;
1155
-
1156
- varying vec3 vColor;
1157
-
1158
- vec3 curve(float _percent) {
1159
- const float PI2 = 3.141592653589793 * 2.0;
1160
- const float _length = 0.3;
1161
- const float radius = 0.056;
1162
- float t = mod(_percent, 0.25) / 0.25;
1163
- t = mod(_percent, 0.25) - (2.0 * (1.0 - t) * t * -0.0185 + t * t * 0.25);
1164
- float x = _length * sin(PI2 * _percent);
1165
- float y = radius * cos(PI2 * 3.0 * _percent);
1166
-
1167
- if (
1168
- floor(_percent / 0.25) == 0.0
1169
- || floor(_percent / 0.25) == 2.0
1170
- ) {
1171
- t = t * -1.0;
1172
- }
1173
- float z = radius * sin(PI2 * 2.0 * (_percent - t));
1174
- return vec3(x, y, z);
1175
- }
1176
-
1177
- mat4 rotateX(float _angle){
1178
- return mat4(
1179
- 1.0, 0.0, 0.0, 0.0,
1180
- 0.0, cos(_angle), -sin(_angle), 0.0,
1181
- 0.0, sin(_angle), cos(_angle), 0.0,
1182
- 0.0, 0.0, 0.0, 1.0
1183
- );
1184
- }
1185
-
1186
- void main(){
1187
- gl_Position = uProjectionMatrix
1188
- * uModelMatrix
1189
- * uViewMatrix
1190
- * rotateX(uProgress)
1191
- * vec4(curve(${"aPercent" /* PERCENT */}), 1.0);
1192
-
1193
- gl_PointSize = ${"aPointSize" /* POINT_SIZE */};
1194
- }
1195
- `;
1196
- var FRAGMENT_SHADER = `
1197
- precision mediump float;
1198
- uniform float uProgress;
1199
- void main(){
1200
- gl_FragColor = vec4(0.81, 0.83, 0.85, 1.0);
1201
- }
1202
- `;
1203
-
1204
- // lib/loading-spiral/createOptions.ts
1205
- var createOptions = () => {
1206
- const attributes = [
1207
- {
1208
- name: "aPercent" /* PERCENT */,
1209
- data: (i, total) => [i / total],
1210
- size: 1
1211
- },
1212
- {
1213
- name: "aPointSize" /* POINT_SIZE */,
1214
- data: () => [window.devicePixelRatio * 1.3],
1215
- size: 1
1216
- }
1217
- ];
1218
- const uniforms = {
1219
- uProgress: {
1220
- type: "float",
1221
- value: [0]
1222
- }
1223
- };
1224
- return {
1225
- uniforms,
1226
- attributes,
1227
- multiplier: 4e3,
1228
- vertex: VERTEX_SHADER,
1229
- fragment: FRAGMENT_SHADER
1230
- };
1231
- };
1232
-
1233
- // lib/loading-spiral/LoadingSpiral.tsx
1234
- var LoadingSpiral = (props) => {
1235
- const { className, step } = props || {};
1236
- const canvasRef = useRef2(null);
1237
- useEffect3(() => {
1238
- if (!canvasRef.current) {
1239
- return;
1240
- }
1241
- const phenomenon = new Phenomenon({
1242
- settings: createSettings({ canvas: canvasRef.current, step }),
1243
- context: {
1244
- antialias: true,
1245
- alpha: true
1246
- }
1247
- });
1248
- phenomenon.add(
1249
- "spiral",
1250
- createOptions()
1251
- );
1252
- }, []);
1253
- return /* @__PURE__ */ React21.createElement("canvas", {
1254
- style: {
1255
- maxWidth: 500,
1256
- maxHeight: 500,
1257
- imageRendering: "pixelated"
1258
- },
1259
- ref: canvasRef,
1260
- className: classNames8(
1261
- "h-full w-full overflow-hidden flex justify-center items-center aspect-1",
1262
- className
1263
- )
1264
- });
1265
- };
1266
-
1267
- // lib/drop-zone/DropZone.tsx
1268
- import React22, { useCallback as useCallback3, useEffect as useEffect4, useState as useState6 } from "react";
1269
- import cls5 from "classnames";
1270
- var DropZone = (props) => {
1271
- const { onDrop, children, className, style } = props;
1272
- const [coverVisible, setCoverVisible] = useState6(false);
1273
- const handleDrop = (e) => {
1274
- e.preventDefault();
1275
- setCoverVisible(false);
1276
- const file = e.dataTransfer.files[0];
1277
- onDrop(file);
1278
- };
1279
- const handleDocDragEnter = useCallback3((e) => {
1280
- e.preventDefault();
1281
- setCoverVisible(true);
1282
- }, []);
1283
- useEffect4(() => {
1284
- document.addEventListener("dragenter", handleDocDragEnter);
1285
- return () => {
1286
- document.removeEventListener("dragenter", handleDocDragEnter);
1287
- };
1288
- }, []);
1289
- if (props.disabled) {
1290
- return /* @__PURE__ */ React22.createElement(React22.Fragment, null, children);
1291
- }
1292
- const handleDragOver = (e) => {
1293
- e.preventDefault();
1294
- setCoverVisible(true);
1295
- };
1296
- const coverCls = cls5("fixed", "top-0", "left-0", "h-full", "w-full", {
1297
- "text-blur": coverVisible,
1298
- "z-[999]": coverVisible,
1299
- block: coverVisible,
1300
- hidden: !coverVisible
1301
- });
1302
- return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement("div", {
1303
- className: coverCls,
1304
- onDragLeave: () => {
1305
- setCoverVisible(false);
1306
- },
1307
- onDragOver: handleDragOver,
1308
- onDrop: handleDrop
1309
- }), children);
1310
- };
1311
-
1312
- // lib/context-menu/index.tsx
1313
- import * as React23 from "react";
1314
- import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
1315
- import {
1316
- CheckIcon,
1317
- ChevronRightIcon,
1318
- DotFilledIcon
1319
- } from "@radix-ui/react-icons";
1320
- import cn from "classnames";
1321
- "use client";
1322
- var ContextMenu = ContextMenuPrimitive.Root;
1323
- var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
1324
- var ContextMenuGroup = ContextMenuPrimitive.Group;
1325
- var ContextMenuPortal = ContextMenuPrimitive.Portal;
1326
- var ContextMenuSub = ContextMenuPrimitive.Sub;
1327
- var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
1328
- var ContextMenuSubTrigger = React23.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.SubTrigger, {
1329
- ref,
1330
- className: cn(
1331
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
1332
- inset && "pl-32",
1333
- className
1334
- ),
1335
- ...props
1336
- }, children, /* @__PURE__ */ React23.createElement(ChevronRightIcon, {
1337
- className: "ml-auto"
1338
- })));
1339
- ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
1340
- var ContextMenuSubContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.SubContent, {
1341
- ref,
1342
- className: cn(
1343
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1344
- className
1345
- ),
1346
- ...props
1347
- }));
1348
- ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
1349
- var ContextMenuContent = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Portal, null, /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Content, {
1350
- ref,
1351
- className: cn(
1352
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1353
- className
1354
- ),
1355
- ...props
1356
- })));
1357
- ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
1358
- var ContextMenuItem = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Item, {
1359
- ref,
1360
- className: cn(
1361
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1362
- inset && "pl-32",
1363
- className
1364
- ),
1365
- ...props
1366
- }));
1367
- ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
1368
- var ContextMenuCheckboxItem = React23.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.CheckboxItem, {
1369
- ref,
1370
- className: cn(
1371
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-32 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1372
- className
1373
- ),
1374
- checked,
1375
- ...props
1376
- }, /* @__PURE__ */ React23.createElement("span", {
1377
- className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center"
1378
- }, /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React23.createElement(CheckIcon, {
1379
- className: "h-4 w-4"
1380
- }))), children));
1381
- ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
1382
- var ContextMenuRadioItem = React23.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.RadioItem, {
1383
- ref,
1384
- className: cn(
1385
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-32 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1386
- className
1387
- ),
1388
- ...props
1389
- }, /* @__PURE__ */ React23.createElement("span", {
1390
- className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center"
1391
- }, /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React23.createElement(DotFilledIcon, {
1392
- className: "h-4 w-4 fill-current"
1393
- }))), children));
1394
- ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
1395
- var ContextMenuLabel = React23.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Label, {
1396
- ref,
1397
- className: cn(
1398
- "px-2 py-1.5 text-sm font-semibold text-foreground",
1399
- inset && "pl-32",
1400
- className
1401
- ),
1402
- ...props
1403
- }));
1404
- ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
1405
- var ContextMenuSeparator = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(ContextMenuPrimitive.Separator, {
1406
- ref,
1407
- className: cn("-mx-1 my-1 h-px bg-border", className),
1408
- ...props
1409
- }));
1410
- ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
1411
- var ContextMenuShortcut = ({
1412
- className,
1413
- ...props
1414
- }) => {
1415
- return /* @__PURE__ */ React23.createElement("span", {
1416
- className: cn(
1417
- "ml-auto text-xs tracking-widest text-muted-foreground",
1418
- className
1419
- ),
1420
- ...props
1421
- });
1422
- };
1423
- ContextMenuShortcut.displayName = "ContextMenuShortcut";
1424
-
1425
- // lib/form/index.tsx
1426
- import * as React25 from "react";
1427
- import { z } from "zod";
1428
- import { Slot } from "@radix-ui/react-slot";
1429
- import { zodResolver } from "@hookform/resolvers/zod";
1430
- import {
1431
- Controller,
1432
- useForm,
1433
- FormProvider,
1434
- useFormContext
1435
- } from "react-hook-form";
1436
- import cn3 from "classnames";
1437
-
1438
- // lib/label/index.tsx
1439
- import * as React24 from "react";
1440
- import * as LabelPrimitive from "@radix-ui/react-label";
1441
- import { cva } from "class-variance-authority";
1442
- import cn2 from "classnames";
1443
- "use client";
1444
- var labelVariants = cva(
1445
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
1446
- );
1447
- var Label2 = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React24.createElement(LabelPrimitive.Root, {
1448
- ref,
1449
- className: cn2(labelVariants(), className),
1450
- ...props
1451
- }));
1452
- Label2.displayName = LabelPrimitive.Root.displayName;
1453
-
1454
- // lib/form/index.tsx
1455
- "use client";
1456
- var Form = FormProvider;
1457
- var FormFieldContext = React25.createContext(
1458
- {}
1459
- );
1460
- var FormField = ({
1461
- ...props
1462
- }) => {
1463
- return /* @__PURE__ */ React25.createElement(FormFieldContext.Provider, {
1464
- value: { name: props.name }
1465
- }, /* @__PURE__ */ React25.createElement(Controller, {
1466
- ...props
1467
- }));
1468
- };
1469
- var useFormField = () => {
1470
- const fieldContext = React25.useContext(FormFieldContext);
1471
- const itemContext = React25.useContext(FormItemContext);
1472
- const { getFieldState, formState } = useFormContext();
1473
- const fieldState = getFieldState(fieldContext.name, formState);
1474
- if (!fieldContext) {
1475
- throw new Error("useFormField should be used within <FormField>");
1476
- }
1477
- const { id } = itemContext;
1478
- return {
1479
- id,
1480
- name: fieldContext.name,
1481
- formItemId: `${id}-form-item`,
1482
- formDescriptionId: `${id}-form-item-description`,
1483
- formMessageId: `${id}-form-item-message`,
1484
- ...fieldState
1485
- };
1486
- };
1487
- var FormItemContext = React25.createContext(
1488
- {}
1489
- );
1490
- var FormItem = React25.forwardRef(({ className, ...props }, ref) => {
1491
- const id = React25.useId();
1492
- return /* @__PURE__ */ React25.createElement(FormItemContext.Provider, {
1493
- value: { id }
1494
- }, /* @__PURE__ */ React25.createElement("div", {
1495
- ref,
1496
- className: cn3("space-y-2", className),
1497
- ...props
1498
- }));
1499
- });
1500
- FormItem.displayName = "FormItem";
1501
- var FormLabel = React25.forwardRef(({ className, ...props }, ref) => {
1502
- const { error, formItemId } = useFormField();
1503
- return /* @__PURE__ */ React25.createElement(Label2, {
1504
- ref,
1505
- className: cn3(error && "text-destructive", className),
1506
- htmlFor: formItemId,
1507
- ...props
1508
- });
1509
- });
1510
- FormLabel.displayName = "FormLabel";
1511
- var FormControl = React25.forwardRef(({ ...props }, ref) => {
1512
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
1513
- return /* @__PURE__ */ React25.createElement(Slot, {
1514
- ref,
1515
- id: formItemId,
1516
- "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
1517
- "aria-invalid": !!error,
1518
- ...props
1519
- });
1520
- });
1521
- FormControl.displayName = "FormControl";
1522
- var FormDescription = React25.forwardRef(({ className, ...props }, ref) => {
1523
- const { formDescriptionId } = useFormField();
1524
- return /* @__PURE__ */ React25.createElement("p", {
1525
- ref,
1526
- id: formDescriptionId,
1527
- className: cn3("text-sm text-muted-foreground", className),
1528
- ...props
1529
- });
1530
- });
1531
- FormDescription.displayName = "FormDescription";
1532
- var FormMessage = React25.forwardRef(({ className, children, ...props }, ref) => {
1533
- const { error, formMessageId } = useFormField();
1534
- const body = error ? String(error == null ? void 0 : error.message) : children;
1535
- if (!body) {
1536
- return null;
1537
- }
1538
- return /* @__PURE__ */ React25.createElement("p", {
1539
- ref,
1540
- id: formMessageId,
1541
- className: cn3("text-sm font-medium text-destructive", className),
1542
- ...props
1543
- }, body);
1544
- });
1545
- FormMessage.displayName = "FormMessage";
1546
-
1547
- // lib/input/index.tsx
1548
- import * as React26 from "react";
1549
- import cn4 from "classnames";
1550
- var Input = React26.forwardRef(
1551
- ({ className, type, ...props }, ref) => {
1552
- return /* @__PURE__ */ React26.createElement("input", {
1553
- type,
1554
- className: cn4(
1555
- "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1556
- className
1557
- ),
1558
- ref,
1559
- ...props
1560
- });
1561
- }
1562
- );
1563
- Input.displayName = "Input";
1564
-
1565
- // lib/canvas/Canvas.tsx
1566
- import React27, { useEffect as useEffect6 } from "react";
1567
-
1568
- // lib/canvas/useRenderer.ts
1569
- import { useEffect as useEffect5, useRef as useRef3, useState as useState7 } from "react";
1570
- import Phenomenon2 from "phenomenon";
1571
- var useRenderer = (uniform) => {
1572
- const canvasRef = useRef3(null);
1573
- const [renderer, setRenderer] = useState7(null);
1574
- useEffect5(() => {
1575
- if (!canvasRef.current) {
1576
- return;
1577
- }
1578
- const renderer2 = new Phenomenon2({
1579
- settings: {
1580
- uniforms: uniform,
1581
- devicePixelRatio: window.devicePixelRatio,
1582
- shouldRender: true,
1583
- canvas: canvasRef.current,
1584
- mode: 4
1585
- },
1586
- context: {
1587
- antialias: true,
1588
- alpha: true
1589
- }
1590
- });
1591
- setRenderer(renderer2);
1592
- return () => {
1593
- renderer2 == null ? void 0 : renderer2.destroy();
1594
- window.removeEventListener("resize", renderer2 == null ? void 0 : renderer2.resize);
1595
- };
1596
- }, [canvasRef.current]);
1597
- return {
1598
- canvasRef,
1599
- renderer
1600
- };
1601
- };
1602
-
1603
- // lib/canvas/Canvas.tsx
1604
- var Canvas = (props) => {
1605
- const {
1606
- fragment,
1607
- vertex,
1608
- uniforms = {},
1609
- name,
1610
- attributes = [],
1611
- onRender,
1612
- ...rest
1613
- } = props;
1614
- const { canvasRef, renderer } = useRenderer(uniforms);
1615
- const instName = name ?? "default";
1616
- useEffect6(() => {
1617
- if (renderer == null || canvasRef.current == null) {
1618
- return;
1619
- }
1620
- const aCopy = attributes.map((attr) => ({
1621
- ...attr,
1622
- data: (i, total) => attr.data(i, total)
1623
- }));
1624
- const uCopy = Object.keys(uniforms).reduce((acc, key) => {
1625
- acc[key] = {
1626
- ...uniforms[key],
1627
- value: [...uniforms[key].value]
1628
- };
1629
- return acc;
1630
- }, {});
1631
- const vertices = [
1632
- { x: -100, y: 100, z: 0 },
1633
- { x: -100, y: -100, z: 0 },
1634
- { x: 100, y: 100, z: 0 },
1635
- { x: 100, y: -100, z: 0 },
1636
- { x: -100, y: -100, z: 0 },
1637
- { x: 100, y: 100, z: 0 }
1638
- ];
1639
- renderer.add(instName, {
1640
- uniforms: {
1641
- ...uCopy,
1642
- uProgress: {
1643
- type: "float",
1644
- value: 0
1645
- }
1646
- },
1647
- attributes: aCopy,
1648
- fragment,
1649
- vertex,
1650
- mode: 4,
1651
- geometry: { vertices },
1652
- onRender: (inst) => {
1653
- if (inst.uniforms.uProgress != void 0) {
1654
- inst.uniforms.uProgress.value += 0.09;
1655
- }
1656
- if (onRender) {
1657
- onRender(inst);
1658
- }
1659
- }
1660
- });
1661
- return () => {
1662
- renderer.remove(instName);
1663
- };
1664
- }, [renderer]);
1665
- return /* @__PURE__ */ React27.createElement("canvas", {
1666
- style: {
1667
- ...props.style,
1668
- imageRendering: "pixelated"
1669
- },
1670
- ref: canvasRef,
1671
- ...rest
1672
- });
1673
- };
1674
- export {
1675
- Article,
1676
- ArticleSkeleton,
1677
- BlinkDot,
1678
- BlurCover,
1679
- Breadcrumb,
1680
- Button,
1681
- ButtonType,
1682
- Canvas,
1683
- ContextMenu,
1684
- ContextMenuCheckboxItem,
1685
- ContextMenuContent,
1686
- ContextMenuGroup,
1687
- ContextMenuItem,
1688
- ContextMenuLabel,
1689
- ContextMenuPortal,
1690
- ContextMenuRadioGroup,
1691
- ContextMenuRadioItem,
1692
- ContextMenuSeparator,
1693
- ContextMenuShortcut,
1694
- ContextMenuSub,
1695
- ContextMenuSubContent,
1696
- ContextMenuSubTrigger,
1697
- ContextMenuTrigger,
1698
- DropImage,
1699
- DropZone,
1700
- Error2 as Error,
1701
- ErrorBoundary,
1702
- Form,
1703
- FormControl,
1704
- FormDescription,
1705
- FormField,
1706
- FormItem,
1707
- FormLabel,
1708
- FormMessage,
1709
- Gallery,
1710
- Img,
1711
- Input,
1712
- Label2 as Label,
1713
- Link,
1714
- LinkColor,
1715
- LinkList,
1716
- LinkListSkeleton,
1717
- List,
1718
- LoadingSpiral,
1719
- Logo,
1720
- Nav,
1721
- NotFound,
1722
- Page,
1723
- Panel,
1724
- PopConfirm,
1725
- Skeleton,
1726
- SkeletonColor,
1727
- Table,
1728
- Tag,
1729
- Tags,
1730
- ThreeColLayout,
1731
- TitledList,
1732
- ossProcessType,
1733
- useForm,
1734
- useFormField,
1735
- z,
1736
- zodResolver
1737
- };
1738
- //# sourceMappingURL=index.js.map