@vibes.diy/base 13.1.2 → 13.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { AttachmentChip } from "../attachments/use-attachments.js";
|
|
3
|
-
export declare function AttachmentButton({ onFiles, disabled, className, }: {
|
|
3
|
+
export declare function AttachmentButton({ onFiles, onBeforeSelect, disabled, className, }: {
|
|
4
4
|
readonly onFiles: (files: File[]) => void;
|
|
5
|
+
readonly onBeforeSelect?: () => boolean;
|
|
5
6
|
readonly disabled?: boolean;
|
|
6
7
|
readonly className?: string;
|
|
7
8
|
}): React.JSX.Element;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import React, { useRef } from "react";
|
|
2
2
|
import { ATTACHMENT_ACCEPT } from "../attachments/attachment-types.js";
|
|
3
3
|
import { PaperclipIcon } from "./icons/PaperclipIcon.js";
|
|
4
|
-
export function AttachmentButton({ onFiles, disabled, className, }) {
|
|
4
|
+
export function AttachmentButton({ onFiles, onBeforeSelect, disabled, className, }) {
|
|
5
5
|
const inputRef = useRef(null);
|
|
6
6
|
return (React.createElement(React.Fragment, null,
|
|
7
7
|
React.createElement("input", { ref: inputRef, type: "file", multiple: true, accept: ATTACHMENT_ACCEPT, style: { display: "none" }, onChange: (e) => {
|
|
8
8
|
onFiles(Array.from(e.target.files ?? []));
|
|
9
9
|
e.target.value = "";
|
|
10
10
|
} }),
|
|
11
|
-
React.createElement("button", { type: "button", "aria-label": "Attach files", title: "Attach files", disabled: disabled, onClick: () =>
|
|
11
|
+
React.createElement("button", { type: "button", "aria-label": "Attach files", title: "Attach files", disabled: disabled, onClick: () => {
|
|
12
|
+
if (onBeforeSelect?.() === false)
|
|
13
|
+
return;
|
|
14
|
+
inputRef.current?.click();
|
|
15
|
+
}, className: className ?? "text-light-primary dark:text-dark-primary hover:text-light-secondary dark:hover:text-dark-secondary", style: {
|
|
12
16
|
background: "none",
|
|
13
17
|
border: "none",
|
|
14
18
|
cursor: disabled ? "default" : "pointer",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentRow.js","sourceRoot":"","sources":["../../jsr/components/AttachmentRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,MAAM,UAAU,gBAAgB,CAAC,EAC/B,OAAO,EACP,QAAQ,EACR,SAAS,
|
|
1
|
+
{"version":3,"file":"AttachmentRow.js","sourceRoot":"","sources":["../../jsr/components/AttachmentRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,MAAM,UAAU,gBAAgB,CAAC,EAC/B,OAAO,EACP,cAAc,EACd,QAAQ,EACR,SAAS,GAaV;IACC,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAChD,OAAO,CACL;QACE,+BACE,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,MAAM,EACX,QAAQ,QACR,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAC1B,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;gBAC1C,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;YACtB,CAAC,GACD;QACF,gCACE,IAAI,EAAC,QAAQ,gBACF,cAAc,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E,aAAa;YACtB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;YACN,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,GAAG;SACd;QAED,qDAAmB,IAAI,CAAC,MAAM,KAAK,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAQ;QACnG,8BAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAG,IAAI,CAAC,IAAI,CAAQ;QACtG,IAAI,CAAC,MAAM,KAAK,OAAO,IAAI,kCAAO,IAAI,CAAC,KAAK,CAAQ;QACrD,gCACE,IAAI,EAAC,QAAQ,gBACD,UAAU,IAAI,CAAC,IAAI,EAAE,EACjC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAChC,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,aAGpF,CACJ,CACR,CAAC,CACE,CACP,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/base",
|
|
3
|
-
"version": "13.1.
|
|
3
|
+
"version": "13.1.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@adviser/cement": "~0.5.34",
|
|
12
12
|
"@emotion/css": "~11.13.5",
|
|
13
|
-
"@vibes.diy/use-vibes-types": "13.1.
|
|
14
|
-
"@vibes.diy/vibe-runtime": "13.1.
|
|
15
|
-
"@vibes.diy/vibe-types": "13.1.
|
|
13
|
+
"@vibes.diy/use-vibes-types": "13.1.3",
|
|
14
|
+
"@vibes.diy/vibe-runtime": "13.1.3",
|
|
15
|
+
"@vibes.diy/vibe-types": "13.1.3",
|
|
16
16
|
"officeparser": "~7.8.0",
|
|
17
17
|
"qrcode-generator": "~2.0.4",
|
|
18
18
|
"react": "~19.2.8"
|