@mainframework/dropzone 1.0.3 → 1.0.5
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/esm/shared/components/FileSelector/FileSelector.d.ts +1 -1
- package/dist/esm/shared/components/FileSelector/FileSelector.js +4 -3
- package/dist/esm/shared/components/FileSelector/FileSelector.js.map +1 -1
- package/dist/esm/shared/components/FileSelector/tailwind.css +1 -0
- package/package.json +6 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FileSelectorProps } from "../../types/types";
|
|
2
|
-
import "
|
|
2
|
+
import "./tailwind.css";
|
|
3
3
|
export declare const FileSelector: ({ inputId, messageParagraph, inputClassName, clickableAreaClassName, dropZoneWrapperClassName, messageParagraphClassName, onChange, onDragOver, onDrop, onDragEnter, onDragLeave, }: FileSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
|
-
import "
|
|
3
|
+
import "./tailwind.css";
|
|
4
4
|
export var FileSelector = function (_a) {
|
|
5
5
|
var inputId = _a.inputId, messageParagraph = _a.messageParagraph, inputClassName = _a.inputClassName, clickableAreaClassName = _a.clickableAreaClassName, dropZoneWrapperClassName = _a.dropZoneWrapperClassName, messageParagraphClassName = _a.messageParagraphClassName, onChange = _a.onChange, onDragOver = _a.onDragOver, onDrop = _a.onDrop, onDragEnter = _a.onDragEnter, onDragLeave = _a.onDragLeave;
|
|
6
6
|
var fileInputRef = useRef(null);
|
|
7
7
|
var refCallback = function (ref) {
|
|
8
8
|
fileInputRef.current = ref;
|
|
9
9
|
};
|
|
10
|
-
var dropZoneButtonClickRef = useRef(function () {
|
|
10
|
+
var dropZoneButtonClickRef = useRef(function (e) {
|
|
11
11
|
var _a;
|
|
12
|
+
e.preventDefault();
|
|
12
13
|
(_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
13
14
|
});
|
|
14
15
|
//Css classes
|
|
@@ -30,6 +31,6 @@ export var FileSelector = function (_a) {
|
|
|
30
31
|
document.removeEventListener("drop", preventDefault);
|
|
31
32
|
};
|
|
32
33
|
}, []);
|
|
33
|
-
return (_jsxs("div", { className: dropZoneWrapperClassNameRef.current, draggable: false, children: [_jsx("button", { className: clickableAreaClassNameRef.current, onDragOver: onDragOver, onDrop: onDrop, onDragEnter: onDragEnter, onDragLeave: onDragLeave, onClick: dropZoneButtonClickRef.current, draggable: true, children: _jsx("p", { className: messageParagraphClassNameRef.current, children: messageParagraphRef.current }) }), _jsx("input", { ref: refCallback, id: inputId, type: "file", className: inputClassesRef.current, onChange: onChange, accept: ".png, .jpg, .jpeg, .pdf, .svg, image/svg+xml, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document", multiple: true })] }));
|
|
34
|
+
return (_jsxs("div", { className: dropZoneWrapperClassNameRef.current, draggable: false, children: [_jsx("button", { type: "button", className: clickableAreaClassNameRef.current, onDragOver: onDragOver, onDrop: onDrop, onDragEnter: onDragEnter, onDragLeave: onDragLeave, onClick: dropZoneButtonClickRef.current, draggable: true, children: _jsx("p", { className: messageParagraphClassNameRef.current, children: messageParagraphRef.current }) }), _jsx("input", { ref: refCallback, id: inputId, type: "file", className: inputClassesRef.current, onChange: onChange, accept: ".png, .jpg, .jpeg, .pdf, .svg, image/svg+xml, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document", multiple: true })] }));
|
|
34
35
|
};
|
|
35
36
|
//# sourceMappingURL=FileSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSelector.js","sourceRoot":"","sources":["../../../../../src/shared/components/FileSelector/FileSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"FileSelector.js","sourceRoot":"","sources":["../../../../../src/shared/components/FileSelector/FileSelector.tsx"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AgB,GAAI,yDAAyD,CAAE,CACnF,CAAC;IAEF,SAAS,CAAC;QACR,2BAA2B;QAC3B,IAAM,cAAc,GAAG,UAAC,KAAgB;YACtC,KAAK,CAAC,cAAc,EAAE,CAAC;QACzB,CAAC,CAAC;QAEF,QAAQ,CAAC,gBAAgB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACtD,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QAElD,OAAO;YACL,UAAU;YACV,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;YACzD,QAAQ,CAAC,mBAAmB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CACL,eAAK,SAAS,EAAE,2BAA2B,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,aACnE,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,yBAAyB,CAAC,OAAO,EAC5C,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,sBAAsB,CAAC,OAAO,EACvC,SAAS,kBAET,YAAG,SAAS,EAAE,4BAA4B,CAAC,OAAO,YAAG,mBAAmB,CAAC,OAAO,GAAK,GAC9E,EAET,gBACE,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,OAAO,EACX,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,eAAe,CAAC,OAAO,EAClC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAC,2IAA2I,EAClJ,QAAQ,SACR,IACE,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tailwindcss v3.4.7 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }body{--tw-bg-opacity:1;background-color:rgb(99 102 241/var(--tw-bg-opacity))}.glow-border{border:2px dotted #0000;-o-border-image:linear-gradient(45deg,cyan,#f0f) 1;border-image:linear-gradient(45deg,cyan,#f0f) 1;box-shadow:0 0 10px #00ffffb3}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mainframework/dropzone",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "A file selection package, without all of the re-rendering issues that come with other dropzone packages",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -14,14 +14,15 @@
|
|
|
14
14
|
},
|
|
15
15
|
"homepage": "https://github.com/TerrySlack/mainframework-dropzone#readme",
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build:css:dev": "npx tailwindcss -i ./src/index.css -o ./src/tailwind.css --watch",
|
|
18
|
-
"build:css:prod": "npx tailwindcss -i ./src/index.css -o ./src/tailwind.css --minify ",
|
|
17
|
+
"build:css:dev": "npx tailwindcss -i ./src/index.css -o ./src/shared/components/FileSelector/tailwind.css --watch",
|
|
18
|
+
"build:css:prod": "npx tailwindcss -i ./src/index.css -o ./src/shared/components/FileSelector/tailwind.css --minify ",
|
|
19
19
|
"husky": "husky",
|
|
20
20
|
"clean": "rimraf dist",
|
|
21
21
|
"lint": "eslint --ext 'ts,tsx' --max-warnings=0 --fix",
|
|
22
22
|
"lint-staged": "lint-staged",
|
|
23
23
|
"prebuild": "yarn husky && yarn clean",
|
|
24
|
-
"
|
|
24
|
+
"copy:css": "copyfiles -a -u 4 src/shared/components/FileSelector/tailwind.css dist/esm/shared/components/FileSelector/",
|
|
25
|
+
"build": "cross-env yarn prebuild && yarn build:css:prod && yarn build:esm && yarn copy:css",
|
|
25
26
|
"build:esm": "tsc",
|
|
26
27
|
"build:cjs": "tsc --module commonjs --outDir dist/cjs",
|
|
27
28
|
"test": "jest --config jestconfig.json"
|
|
@@ -62,6 +63,7 @@
|
|
|
62
63
|
"@types/react": "^18.3.3",
|
|
63
64
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
64
65
|
"@typescript-eslint/parser": "^7.18.0",
|
|
66
|
+
"copyfiles": "^2.4.1",
|
|
65
67
|
"cross-env": "^7.0.3",
|
|
66
68
|
"eslint": "^8.57.0",
|
|
67
69
|
"eslint-config-prettier": "^9.1.0",
|