@bbki.ng/components 2.1.43 → 2.2.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/dist/index.cjs +49 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +48 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ __export(lib_exports, {
|
|
|
33
33
|
Button: () => Button,
|
|
34
34
|
ButtonType: () => ButtonType,
|
|
35
35
|
DropImage: () => DropImage,
|
|
36
|
+
DropZone: () => DropZone,
|
|
36
37
|
Error: () => Error2,
|
|
37
38
|
ErrorBoundary: () => ErrorBoundary,
|
|
38
39
|
Gallery: () => Gallery,
|
|
@@ -1094,13 +1095,13 @@ var RandomRowsLayout = import_react20.default.memo(
|
|
|
1094
1095
|
colNum,
|
|
1095
1096
|
generateRandomBoolean()
|
|
1096
1097
|
);
|
|
1097
|
-
const
|
|
1098
|
+
const cls5 = (0, import_classnames11.default)(
|
|
1098
1099
|
"flex items-center justify-center flex-shrink-0 flex-grow-0",
|
|
1099
1100
|
"basis-full",
|
|
1100
1101
|
generatedCls
|
|
1101
1102
|
);
|
|
1102
1103
|
return /* @__PURE__ */ import_react20.default.createElement("div", {
|
|
1103
|
-
className:
|
|
1104
|
+
className: cls5,
|
|
1104
1105
|
key: col
|
|
1105
1106
|
}, cellRenderer(indexRef.current - 1, randBoolArr[col], col));
|
|
1106
1107
|
}));
|
|
@@ -1299,6 +1300,51 @@ var LoadingSpiral = (props) => {
|
|
|
1299
1300
|
)
|
|
1300
1301
|
});
|
|
1301
1302
|
};
|
|
1303
|
+
|
|
1304
|
+
// lib/drop-zone/DropZone.tsx
|
|
1305
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
1306
|
+
var import_classnames14 = __toESM(require("classnames"), 1);
|
|
1307
|
+
var DropZone = (props) => {
|
|
1308
|
+
const { onDrop, children, className, style } = props;
|
|
1309
|
+
const [coverVisible, setCoverVisible] = (0, import_react23.useState)(false);
|
|
1310
|
+
const handleDrop = (e) => {
|
|
1311
|
+
e.preventDefault();
|
|
1312
|
+
setCoverVisible(false);
|
|
1313
|
+
const file = e.dataTransfer.files[0];
|
|
1314
|
+
onDrop(file);
|
|
1315
|
+
};
|
|
1316
|
+
const handleDocDragEnter = (0, import_react23.useCallback)((e) => {
|
|
1317
|
+
e.preventDefault();
|
|
1318
|
+
setCoverVisible(true);
|
|
1319
|
+
}, []);
|
|
1320
|
+
(0, import_react23.useEffect)(() => {
|
|
1321
|
+
document.addEventListener("dragenter", handleDocDragEnter);
|
|
1322
|
+
return () => {
|
|
1323
|
+
document.removeEventListener("dragenter", handleDocDragEnter);
|
|
1324
|
+
};
|
|
1325
|
+
}, []);
|
|
1326
|
+
if (props.disabled) {
|
|
1327
|
+
return /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, children);
|
|
1328
|
+
}
|
|
1329
|
+
const handleDragOver = (e) => {
|
|
1330
|
+
e.preventDefault();
|
|
1331
|
+
setCoverVisible(true);
|
|
1332
|
+
};
|
|
1333
|
+
const coverCls = (0, import_classnames14.default)("fixed", "top-0", "left-0", "h-full", "w-full", {
|
|
1334
|
+
"text-blur": coverVisible,
|
|
1335
|
+
"z-[999]": coverVisible,
|
|
1336
|
+
block: coverVisible,
|
|
1337
|
+
hidden: !coverVisible
|
|
1338
|
+
});
|
|
1339
|
+
return /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement("div", {
|
|
1340
|
+
className: coverCls,
|
|
1341
|
+
onDragLeave: () => {
|
|
1342
|
+
setCoverVisible(false);
|
|
1343
|
+
},
|
|
1344
|
+
onDragOver: handleDragOver,
|
|
1345
|
+
onDrop: handleDrop
|
|
1346
|
+
}), children);
|
|
1347
|
+
};
|
|
1302
1348
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1303
1349
|
0 && (module.exports = {
|
|
1304
1350
|
Article,
|
|
@@ -1308,6 +1354,7 @@ var LoadingSpiral = (props) => {
|
|
|
1308
1354
|
Button,
|
|
1309
1355
|
ButtonType,
|
|
1310
1356
|
DropImage,
|
|
1357
|
+
DropZone,
|
|
1311
1358
|
Error,
|
|
1312
1359
|
ErrorBoundary,
|
|
1313
1360
|
Gallery,
|