@panneau/fields 5.0.0-alpha.0 → 5.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -20
- package/dist/boolean/BooleanField.d.ts +1 -1
- package/dist/boolean/BooleanField.js +78 -17
- package/dist/boolean/BooleanField.js.map +1 -1
- package/dist/boolean/index.d.ts +1 -1
- package/dist/color/ColorField.css +5 -5
- package/dist/color/ColorField.d.ts +2 -2
- package/dist/color/ColorField.js.map +1 -1
- package/dist/color/ColorField.module.js +3 -3
- package/dist/color/index.d.ts +1 -1
- package/dist/date/DateField.d.ts +1 -1
- package/dist/date/DateField.js.map +1 -1
- package/dist/date/index.d.ts +1 -1
- package/dist/datetime/DateTimeField.d.ts +1 -1
- package/dist/datetime/DateTimeField.js +107 -20
- package/dist/datetime/DateTimeField.js.map +1 -1
- package/dist/datetime/index.d.ts +1 -1
- package/dist/duration/DurationField.css +11 -0
- package/dist/duration/DurationField.d.ts +26 -0
- package/dist/duration/DurationField.d.ts.map +1 -0
- package/dist/duration/DurationField.js +214 -0
- package/dist/duration/DurationField.js.map +1 -0
- package/dist/duration/DurationField.module.js +12 -0
- package/dist/duration/DurationField.module.js.map +1 -0
- package/dist/duration/index.d.ts +2 -0
- package/dist/duration/index.d.ts.map +1 -0
- package/dist/duration/index.js +1 -0
- package/dist/email/EmailField.d.ts +2 -2
- package/dist/email/EmailField.js.map +1 -1
- package/dist/email/index.d.ts +1 -1
- package/dist/embed/EmbedField.css +60 -0
- package/dist/embed/EmbedField.d.ts +20 -0
- package/dist/embed/EmbedField.d.ts.map +1 -0
- package/dist/embed/EmbedField.js +246 -0
- package/dist/embed/EmbedField.js.map +1 -0
- package/dist/embed/EmbedField.module.js +22 -0
- package/dist/embed/EmbedField.module.js.map +1 -0
- package/dist/embed/index.d.ts +3 -0
- package/dist/embed/index.d.ts.map +1 -0
- package/dist/embed/index.js +3 -0
- package/dist/file/FileField.css +54 -0
- package/dist/file/FileField.d.ts +50 -0
- package/dist/file/FileField.d.ts.map +1 -0
- package/dist/file/FileField.js +288 -0
- package/dist/file/FileField.js.map +1 -0
- package/dist/file/FileField.module.js +22 -0
- package/dist/file/FileField.module.js.map +1 -0
- package/dist/file/index.d.ts +3 -0
- package/dist/file/index.d.ts.map +1 -0
- package/dist/file/index.js +1 -0
- package/dist/group/GroupField.css +2 -2
- package/dist/group/GroupField.d.ts +1 -1
- package/dist/group/GroupField.js.map +1 -1
- package/dist/group/GroupField.module.js +1 -1
- package/dist/group/index.d.ts +1 -1
- package/dist/index.d.ts +18 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -3
- package/dist/json/JsonField.css +7 -0
- package/dist/json/JsonField.d.ts +22 -0
- package/dist/json/JsonField.d.ts.map +1 -0
- package/dist/json/JsonField.js +207 -0
- package/dist/json/JsonField.js.map +1 -0
- package/dist/json/JsonField.module.js +8 -0
- package/dist/json/JsonField.module.js.map +1 -0
- package/dist/json/index.d.ts +2 -0
- package/dist/json/index.d.ts.map +1 -0
- package/dist/json/index.js +1 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/localized/LocalizedField.css +2 -2
- package/dist/localized/LocalizedField.d.ts +1 -1
- package/dist/localized/LocalizedField.d.ts.map +1 -1
- package/dist/localized/LocalizedField.js +1 -0
- package/dist/localized/LocalizedField.js.map +1 -1
- package/dist/localized/LocalizedField.module.js +2 -2
- package/dist/localized/index.d.ts +1 -1
- package/dist/location/LocationField.css +54 -0
- package/dist/location/LocationField.d.ts +31 -0
- package/dist/location/LocationField.d.ts.map +1 -0
- package/dist/location/LocationField.js +563 -0
- package/dist/location/LocationField.js.map +1 -0
- package/dist/location/LocationField.module.js +22 -0
- package/dist/location/LocationField.module.js.map +1 -0
- package/dist/location/LocationMap.d.ts +25 -0
- package/dist/location/LocationMap.d.ts.map +1 -0
- package/dist/location/LocationMap.js +205 -0
- package/dist/location/LocationMap.js.map +1 -0
- package/dist/location/index.d.ts +5 -0
- package/dist/location/index.d.ts.map +1 -0
- package/dist/location/index.js +4 -0
- package/dist/location/leafletCss.d.ts +2 -0
- package/dist/location/leafletCss.d.ts.map +1 -0
- package/dist/location/leafletCss.js +6 -0
- package/dist/location/leafletCss.js.map +1 -0
- package/dist/location/nominatim.d.ts +17 -0
- package/dist/location/nominatim.d.ts.map +1 -0
- package/dist/location/nominatim.js +50 -0
- package/dist/location/nominatim.js.map +1 -0
- package/dist/location/types.d.ts +40 -0
- package/dist/location/types.d.ts.map +1 -0
- package/dist/missing/MissingField.css +4 -3
- package/dist/missing/MissingField.d.ts +4 -3
- package/dist/missing/MissingField.d.ts.map +1 -1
- package/dist/missing/MissingField.js +3 -2
- package/dist/missing/MissingField.js.map +1 -1
- package/dist/missing/MissingField.module.js +3 -3
- package/dist/missing/MissingField.module.js.map +1 -1
- package/dist/number/NumberField.d.ts +1 -1
- package/dist/number/NumberField.js.map +1 -1
- package/dist/number/index.d.ts +1 -1
- package/dist/range/RangeField.d.ts +22 -0
- package/dist/range/RangeField.d.ts.map +1 -0
- package/dist/range/RangeField.js +203 -0
- package/dist/range/RangeField.js.map +1 -0
- package/dist/range/index.d.ts +2 -0
- package/dist/range/index.d.ts.map +1 -0
- package/dist/range/index.js +1 -0
- package/dist/relation/RelationField.css +7 -7
- package/dist/relation/RelationField.d.ts +12 -4
- package/dist/relation/RelationField.d.ts.map +1 -1
- package/dist/relation/RelationField.js +535 -160
- package/dist/relation/RelationField.js.map +1 -1
- package/dist/relation/RelationField.module.js +6 -6
- package/dist/relation/index.d.ts +2 -2
- package/dist/relation/index.d.ts.map +1 -1
- package/dist/relation/index.js +2 -2
- package/dist/repeater/RepeaterField.css +12 -11
- package/dist/repeater/RepeaterField.d.ts +1 -1
- package/dist/repeater/RepeaterField.js +118 -34
- package/dist/repeater/RepeaterField.js.map +1 -1
- package/dist/repeater/RepeaterField.module.js +9 -9
- package/dist/repeater/RepeaterField.module.js.map +1 -1
- package/dist/repeater/index.d.ts +1 -1
- package/dist/select/SelectField.css +1 -1
- package/dist/select/SelectField.d.ts +1 -1
- package/dist/select/SelectField.js.map +1 -1
- package/dist/select/SelectField.module.js +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/shared/DefinitionField.d.ts +5 -3
- package/dist/shared/DefinitionField.d.ts.map +1 -1
- package/dist/shared/DefinitionField.js +81 -73
- package/dist/shared/DefinitionField.js.map +1 -1
- package/dist/shared/builtIn.d.ts +5 -3
- package/dist/shared/builtIn.d.ts.map +1 -1
- package/dist/shared/builtIn.js +21 -3
- package/dist/shared/builtIn.js.map +1 -1
- package/dist/shared/check.d.ts +27 -0
- package/dist/shared/check.d.ts.map +1 -0
- package/dist/shared/check.js +18 -0
- package/dist/shared/check.js.map +1 -0
- package/dist/shared/context.d.ts +28 -5
- package/dist/shared/context.d.ts.map +1 -1
- package/dist/shared/context.js +35 -19
- package/dist/shared/context.js.map +1 -1
- package/dist/shared/cx.js.map +1 -1
- package/dist/shared/dates.js.map +1 -1
- package/dist/shared/embed.d.ts +19 -0
- package/dist/shared/embed.d.ts.map +1 -0
- package/dist/shared/embed.js +14 -0
- package/dist/shared/embed.js.map +1 -0
- package/dist/shared/entry.d.ts +11 -2
- package/dist/shared/entry.d.ts.map +1 -1
- package/dist/shared/entry.js +19 -3
- package/dist/shared/entry.js.map +1 -1
- package/dist/shared/relation.d.ts +41 -5
- package/dist/shared/relation.d.ts.map +1 -1
- package/dist/shared/relation.js +119 -12
- package/dist/shared/relation.js.map +1 -1
- package/dist/shared/types.d.ts +2 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/slug/SlugField.css +18 -0
- package/dist/slug/SlugField.d.ts +33 -5
- package/dist/slug/SlugField.d.ts.map +1 -1
- package/dist/slug/SlugField.js +346 -126
- package/dist/slug/SlugField.js.map +1 -1
- package/dist/slug/SlugField.module.js +14 -0
- package/dist/slug/SlugField.module.js.map +1 -0
- package/dist/slug/index.d.ts +1 -1
- package/dist/slug/index.d.ts.map +1 -1
- package/dist/slug/index.js +1 -1
- package/dist/tags/TagsField.d.ts +17 -0
- package/dist/tags/TagsField.d.ts.map +1 -0
- package/dist/tags/TagsField.js +120 -0
- package/dist/tags/TagsField.js.map +1 -0
- package/dist/tags/index.d.ts +2 -0
- package/dist/tags/index.d.ts.map +1 -0
- package/dist/tags/index.js +1 -0
- package/dist/tel/TelField.d.ts +11 -0
- package/dist/tel/TelField.d.ts.map +1 -0
- package/dist/tel/TelField.js +87 -0
- package/dist/tel/TelField.js.map +1 -0
- package/dist/tel/index.d.ts +2 -0
- package/dist/tel/index.d.ts.map +1 -0
- package/dist/tel/index.js +1 -0
- package/dist/text/TextField.d.ts +12 -4
- package/dist/text/TextField.d.ts.map +1 -1
- package/dist/text/TextField.js +104 -60
- package/dist/text/TextField.js.map +1 -1
- package/dist/text/index.d.ts +1 -1
- package/dist/textarea/TextAreaField.d.ts +1 -1
- package/dist/textarea/TextAreaField.js.map +1 -1
- package/dist/textarea/index.d.ts +1 -1
- package/dist/time/TimeField.d.ts +1 -1
- package/dist/time/TimeField.js +64 -10
- package/dist/time/TimeField.js.map +1 -1
- package/dist/time/index.d.ts +1 -1
- package/dist/upload/FilePicker.css +24 -0
- package/dist/upload/FilePicker.d.ts +14 -0
- package/dist/upload/FilePicker.d.ts.map +1 -0
- package/dist/upload/FilePicker.js +130 -0
- package/dist/upload/FilePicker.js.map +1 -0
- package/dist/upload/FilePicker.module.js +12 -0
- package/dist/upload/FilePicker.module.js.map +1 -0
- package/dist/upload/UploadList.css +93 -0
- package/dist/upload/UploadList.d.ts +18 -0
- package/dist/upload/UploadList.d.ts.map +1 -0
- package/dist/upload/UploadList.js +144 -0
- package/dist/upload/UploadList.js.map +1 -0
- package/dist/upload/UploadList.module.js +32 -0
- package/dist/upload/UploadList.module.js.map +1 -0
- package/dist/upload/files.d.ts +5 -0
- package/dist/upload/files.d.ts.map +1 -0
- package/dist/upload/files.js +26 -0
- package/dist/upload/files.js.map +1 -0
- package/dist/upload/types.d.ts +58 -0
- package/dist/upload/types.d.ts.map +1 -0
- package/dist/upload/useRejectionMessage.d.ts +4 -0
- package/dist/upload/useRejectionMessage.d.ts.map +1 -0
- package/dist/upload/useRejectionMessage.js +25 -0
- package/dist/upload/useRejectionMessage.js.map +1 -0
- package/dist/upload/useUploads.d.ts +30 -0
- package/dist/upload/useUploads.d.ts.map +1 -0
- package/dist/upload/useUploads.js +115 -0
- package/dist/upload/useUploads.js.map +1 -0
- package/dist/uppy/index.d.ts +3 -0
- package/dist/uppy/index.d.ts.map +1 -0
- package/dist/uppy/index.js +1 -0
- package/dist/uppy/uploader.d.ts +44 -0
- package/dist/uppy/uploader.d.ts.map +1 -0
- package/dist/uppy/uploader.js +139 -0
- package/dist/uppy/uploader.js.map +1 -0
- package/dist/url/UrlField.css +2 -2
- package/dist/url/UrlField.d.ts +2 -2
- package/dist/url/UrlField.js +69 -14
- package/dist/url/UrlField.js.map +1 -1
- package/dist/url/UrlField.module.js +1 -1
- package/dist/url/index.d.ts +1 -1
- package/package.json +69 -7
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { matchesMime } from "./files.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
4
|
+
//#region src/upload/useUploads.ts
|
|
5
|
+
var NO_ITEMS = [];
|
|
6
|
+
function rejects(file, { accept, maxSize }) {
|
|
7
|
+
if (accept !== null && accept !== void 0 && accept.length > 0 && !matchesMime(file.type, accept)) return "accept";
|
|
8
|
+
return maxSize !== null && maxSize !== void 0 && file.size > maxSize ? "maxSize" : null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Checks files against `accept` and `maxSize`, uploads them through an upload source, and gives
|
|
12
|
+
* the state of each file for an upload list. Without a source, files are given back as they are,
|
|
13
|
+
* to send in a multipart request. The uploader is made once per source, and stopped when the
|
|
14
|
+
* component unmounts.
|
|
15
|
+
*/
|
|
16
|
+
function useUploads(options) {
|
|
17
|
+
const $ = c(16);
|
|
18
|
+
const latest = useRef(options);
|
|
19
|
+
let t0;
|
|
20
|
+
if ($[0] !== options) {
|
|
21
|
+
t0 = () => {
|
|
22
|
+
latest.current = options;
|
|
23
|
+
};
|
|
24
|
+
$[0] = options;
|
|
25
|
+
$[1] = t0;
|
|
26
|
+
} else t0 = $[1];
|
|
27
|
+
useEffect(t0);
|
|
28
|
+
const { source } = options;
|
|
29
|
+
const [state, setState] = useState(null);
|
|
30
|
+
const uploader = state !== null && state.source === source ? state.uploader : null;
|
|
31
|
+
let t1;
|
|
32
|
+
let t2;
|
|
33
|
+
if ($[2] !== source) {
|
|
34
|
+
t1 = () => {
|
|
35
|
+
if (source === null) return;
|
|
36
|
+
const created = source.createUploader({ onUploaded: (file) => latest.current.onUploaded(file) });
|
|
37
|
+
setState({
|
|
38
|
+
source,
|
|
39
|
+
uploader: created
|
|
40
|
+
});
|
|
41
|
+
return () => created.destroy();
|
|
42
|
+
};
|
|
43
|
+
t2 = [source];
|
|
44
|
+
$[2] = source;
|
|
45
|
+
$[3] = t1;
|
|
46
|
+
$[4] = t2;
|
|
47
|
+
} else {
|
|
48
|
+
t1 = $[3];
|
|
49
|
+
t2 = $[4];
|
|
50
|
+
}
|
|
51
|
+
useEffect(t1, t2);
|
|
52
|
+
let t3;
|
|
53
|
+
let t4;
|
|
54
|
+
if ($[5] !== uploader) {
|
|
55
|
+
t3 = (listener) => uploader?.subscribe(listener) ?? _temp;
|
|
56
|
+
t4 = () => uploader?.getItems() ?? NO_ITEMS;
|
|
57
|
+
$[5] = uploader;
|
|
58
|
+
$[6] = t3;
|
|
59
|
+
$[7] = t4;
|
|
60
|
+
} else {
|
|
61
|
+
t3 = $[6];
|
|
62
|
+
t4 = $[7];
|
|
63
|
+
}
|
|
64
|
+
const items = useSyncExternalStore(t3, t4, _temp2);
|
|
65
|
+
let t5;
|
|
66
|
+
if ($[8] !== items || $[9] !== uploader) {
|
|
67
|
+
let t6;
|
|
68
|
+
let t7;
|
|
69
|
+
let t8;
|
|
70
|
+
let t9;
|
|
71
|
+
if ($[11] !== uploader) {
|
|
72
|
+
t6 = (id) => uploader?.pause(id);
|
|
73
|
+
t7 = (id_0) => uploader?.resume(id_0);
|
|
74
|
+
t8 = (id_1) => uploader?.cancel(id_1);
|
|
75
|
+
t9 = (id_2) => uploader?.retry(id_2);
|
|
76
|
+
$[11] = uploader;
|
|
77
|
+
$[12] = t6;
|
|
78
|
+
$[13] = t7;
|
|
79
|
+
$[14] = t8;
|
|
80
|
+
$[15] = t9;
|
|
81
|
+
} else {
|
|
82
|
+
t6 = $[12];
|
|
83
|
+
t7 = $[13];
|
|
84
|
+
t8 = $[14];
|
|
85
|
+
t9 = $[15];
|
|
86
|
+
}
|
|
87
|
+
t5 = {
|
|
88
|
+
items,
|
|
89
|
+
add(files) {
|
|
90
|
+
for (const file_0 of files) {
|
|
91
|
+
const rejection = rejects(file_0, latest.current);
|
|
92
|
+
if (rejection !== null) latest.current.onRejected?.(file_0, rejection);
|
|
93
|
+
else if (uploader === null) latest.current.onUploaded(file_0);
|
|
94
|
+
else uploader.add([file_0]);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
pause: t6,
|
|
98
|
+
resume: t7,
|
|
99
|
+
cancel: t8,
|
|
100
|
+
retry: t9
|
|
101
|
+
};
|
|
102
|
+
$[8] = items;
|
|
103
|
+
$[9] = uploader;
|
|
104
|
+
$[10] = t5;
|
|
105
|
+
} else t5 = $[10];
|
|
106
|
+
return t5;
|
|
107
|
+
}
|
|
108
|
+
function _temp2() {
|
|
109
|
+
return NO_ITEMS;
|
|
110
|
+
}
|
|
111
|
+
function _temp() {}
|
|
112
|
+
//#endregion
|
|
113
|
+
export { useUploads };
|
|
114
|
+
|
|
115
|
+
//# sourceMappingURL=useUploads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUploads.js","names":["useEffect","useRef","useState","useSyncExternalStore","matchesMime","UploadItem","UploadRejection","UploadSource","UploadedFile","Uploader","UseUploadsOptions","source","accept","maxSize","onUploaded","file","File","onRejected","reason","UseUploadsResult","items","add","files","Iterable","pause","id","resume","cancel","retry","NO_ITEMS","rejects","Pick","undefined","length","type","size","useUploads","options","$","_c","latest","t0","current","state","setState","uploader","t1","t2","created","createUploader","destroy","t3","t4","listener","subscribe","_temp","getItems","_temp2","t5","t6","t7","t8","t9","id_0","id_1","id_2","file_0","rejection","_c"],"sources":["../../src/upload/useUploads.ts"],"sourcesContent":["import { useEffect, useRef, useState, useSyncExternalStore } from 'react';\n\nimport { matchesMime } from './files';\nimport type { UploadItem, UploadRejection, UploadSource, UploadedFile, Uploader } from './types';\n\nexport interface UseUploadsOptions {\n /** Where files are uploaded. Without one, `add()` gives the files themselves. */\n source: UploadSource | null;\n /** Accepted MIME types (`image/*`). Others are refused before they are sent. */\n accept?: readonly string[] | null;\n /** Largest file, in bytes. Larger ones are refused before they are sent. */\n maxSize?: number | null;\n /** Called with each file once it is uploaded: its upload, or the file itself without a source. */\n onUploaded: (file: UploadedFile | File) => void;\n /** Called with each file refused before it was sent. */\n onRejected?: (file: File, reason: UploadRejection) => void;\n}\n\nexport interface UseUploadsResult {\n /** The files being uploaded. */\n items: readonly UploadItem[];\n add: (files: Iterable<File>) => void;\n pause: (id: string) => void;\n resume: (id: string) => void;\n cancel: (id: string) => void;\n retry: (id: string) => void;\n}\n\nconst NO_ITEMS: readonly UploadItem[] = [];\n\nfunction rejects(\n file: File,\n { accept, maxSize }: Pick<UseUploadsOptions, 'accept' | 'maxSize'>,\n): UploadRejection | null {\n if (\n accept !== null &&\n accept !== undefined &&\n accept.length > 0 &&\n !matchesMime(file.type, accept)\n ) {\n return 'accept';\n }\n return maxSize !== null && maxSize !== undefined && file.size > maxSize ? 'maxSize' : null;\n}\n\n/**\n * Checks files against `accept` and `maxSize`, uploads them through an upload source, and gives\n * the state of each file for an upload list. Without a source, files are given back as they are,\n * to send in a multipart request. The uploader is made once per source, and stopped when the\n * component unmounts.\n */\nexport function useUploads(options: UseUploadsOptions): UseUploadsResult {\n // The latest callbacks and limits, read when files are added or uploaded.\n const latest = useRef(options);\n useEffect(() => {\n latest.current = options;\n });\n const { source } = options;\n const [state, setState] = useState<{ source: UploadSource; uploader: Uploader } | null>(null);\n const uploader = state !== null && state.source === source ? state.uploader : null;\n\n useEffect(() => {\n if (source === null) {\n return undefined;\n }\n const created = source.createUploader({\n onUploaded: (file) => latest.current.onUploaded(file),\n });\n setState({ source, uploader: created });\n return () => created.destroy();\n }, [source]);\n\n const items = useSyncExternalStore(\n (listener) => uploader?.subscribe(listener) ?? (() => undefined),\n () => uploader?.getItems() ?? NO_ITEMS,\n () => NO_ITEMS,\n );\n\n return {\n items,\n add(files) {\n for (const file of files) {\n const rejection = rejects(file, latest.current);\n if (rejection !== null) {\n latest.current.onRejected?.(file, rejection);\n } else if (uploader === null) {\n latest.current.onUploaded(file);\n } else {\n uploader.add([file]);\n }\n }\n },\n pause: (id) => uploader?.pause(id),\n resume: (id) => uploader?.resume(id),\n cancel: (id) => uploader?.cancel(id),\n retry: (id) => uploader?.retry(id),\n };\n}\n"],"mappings":";;;;AA4BA,IAAM6B,WAAkC,CAAA;AAExC,SAASC,QACLf,MACA,EAAEH,QAAQC,WACY;CACtB,IACID,WAAW,QACXA,WAAWoB,KAAAA,KACXpB,OAAOqB,SAAS,KAChB,CAAC7B,YAAYW,KAAKmB,MAAMtB,MAAM,GAE9B,OAAO;CAEX,OAAOC,YAAY,QAAQA,YAAYmB,KAAAA,KAAajB,KAAKoB,OAAOtB,UAAU,YAAY;AAC1F;;;;;;;AAQA,SAAOuB,WAAAC,SAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAEH,MAAAC,SAAevC,OAAOoC,OAAO;CAAE,IAAAI;CAAA,IAAAH,EAAA,OAAAD,SAAA;EACrBI,WAAA;GACND,OAAME,UAAWL;EAAH;EACjBC,EAAA,KAAAD;EAAAC,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAFDtC,UAAUyC,EAET;CAC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AAE;GAC5BqC,MAAAG,SAAQpB,UAAQjB,MAAQH,IAAE;GAACa,EAAA,MAAAO;GAAAP,EAAA,MAAAqB;GAAArB,EAAA,MAAAsB;GAAAtB,EAAA,MAAAuB;GAAAvB,EAAA,MAAAwB;EAAA,OAAA;GAAAH,KAAArB,EAAA;GAAAsB,KAAAtB,EAAA;GAAAuB,KAAAvB,EAAA;GAAAwB,KAAAxB,EAAA;EAAA;EAjB/BoB,KAAA;GAAAtC;GAAAC,IAAAC,OAAA;IAGC,KAAK,MAAA4C,UAAc5C,OAAK;KACpB,MAAA6C,YAAkBrC,QAAQf,QAAMyB,OAAME,OAAQ;KAC9C,IAAIyB,cAAc,MACd3B,OAAME,QAAQzB,aAAcF,QAAMoD,SAAS;UACxC,IAAItB,aAAa,MACpBL,OAAME,QAAQ5B,WAAYC,MAAI;UAE9B8B,SAAQxB,IAAK,CAACN,MAAI,CAAC;IACtB;GACJ;GAAAS,OAEEmC;GAA2BjC,QAC1BkC;GAA4BjC,QAC5BkC;GAA4BjC,OAC7BkC;EACX;EAACxB,EAAA,KAAAlB;EAAAkB,EAAA,KAAAO;EAAAP,EAAA,MAAAoB;CAAA,OAAAA,KAAApB,EAAA;CAAA,OAlBMoB;AAkBN;AA7CE,SAAAD,SAAA;CAAA,OAwBO5B;AAAQ;AAxBf,SAAA0B,QAAA,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { type PresignedUploadsLike, type UppyUploadSourceOptions, createUppyUploadSource, createUppyUploader, } from './uploader.js';
|
|
2
|
+
export type { UploadItem, UploadItemStatus, UploadSource, UploadedFile, Uploader, } from '../upload/types.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/uppy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,sBAAsB,EACtB,kBAAkB,GACrB,MAAM,YAAY,CAAC;AACpB,YAAY,EACR,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,QAAQ,GACX,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createUppyUploadSource, createUppyUploader } from "./uploader.js";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import Uppy, { type Body, type Meta } from '@uppy/core';
|
|
2
|
+
import type { Upload, UploadSignRequest } from '@panneau/protocol';
|
|
3
|
+
import type { UploadSource, UploadedFile, Uploader } from '../upload/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Signs and completes direct uploads: `adapter.presignedUploads()` of `@panneau/data` (or
|
|
6
|
+
* `createPresignedUploads()`) gives one.
|
|
7
|
+
*/
|
|
8
|
+
export interface PresignedUploadsLike {
|
|
9
|
+
signRequest(request: UploadSignRequest): Promise<{
|
|
10
|
+
url: string;
|
|
11
|
+
key?: string;
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
}>;
|
|
14
|
+
complete(key: string, options?: {
|
|
15
|
+
name?: string;
|
|
16
|
+
}): Promise<Upload>;
|
|
17
|
+
}
|
|
18
|
+
export interface UppyUploadSourceOptions {
|
|
19
|
+
/** Files larger than this, in bytes, are sent in parts, which can pause and resume. Defaults to 10 MB. */
|
|
20
|
+
multipartThreshold?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Installs what sends files on each Uppy instance: `@uppy/aws-s3` with the backend's
|
|
23
|
+
* signatures by default. Tests install a fake one.
|
|
24
|
+
*/
|
|
25
|
+
install?: (uppy: Uppy<Meta, Body>, uploads: PresignedUploadsLike) => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* An uploader on Uppy 6: files go to S3-compatible storage with URLs that the backend signs, in
|
|
29
|
+
* parts when they are large, then each upload is completed with the backend.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createUppyUploader(uploads: PresignedUploadsLike, { onUploaded, multipartThreshold, install, }: UppyUploadSourceOptions & {
|
|
32
|
+
onUploaded: (file: UploadedFile, upload: Upload) => void;
|
|
33
|
+
}): Uploader;
|
|
34
|
+
/**
|
|
35
|
+
* The upload source of fields on Uppy 6 (`@uppy/core` and `@uppy/aws-s3`, optional peer
|
|
36
|
+
* dependencies of this entry point): pass it as `uploadSource` to `FieldsProvider` or
|
|
37
|
+
* `FormView`, with the signing routes of the backend.
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* const uploadSource = createUppyUploadSource(adapter.presignedUploads());
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function createUppyUploadSource(uploads: PresignedUploadsLike, options?: UppyUploadSourceOptions): UploadSource;
|
|
44
|
+
//# sourceMappingURL=uploader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../src/uppy/uploader.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,EAAE,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAiB,MAAM,YAAY,CAAC;AAEvE,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAGR,YAAY,EACZ,YAAY,EACZ,QAAQ,EACX,MAAM,iBAAiB,CAAC;AAEzB;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACjC,WAAW,CACP,OAAO,EAAE,iBAAiB,GAC3B,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC,CAAC;IAC5E,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACvE;AAED,MAAM,WAAW,uBAAuB;IACpC,0GAA0G;IAC1G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC7E;AAgBD;;;GAGG;AACH,wBAAgB,kBAAkB,CAC9B,OAAO,EAAE,oBAAoB,EAC7B,EACI,UAAU,EACV,kBAA4B,EAC5B,OAAgF,GACnF,EAAE,uBAAuB,GAAG;IAAE,UAAU,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC1F,QAAQ,CA+HV;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,GAAE,uBAA4B,GACtC,YAAY,CAId"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import AwsS3 from "@uppy/aws-s3";
|
|
2
|
+
import Uppy from "@uppy/core";
|
|
3
|
+
//#region src/uppy/uploader.ts
|
|
4
|
+
var MB = 1048576;
|
|
5
|
+
function errorMessage(error) {
|
|
6
|
+
return error instanceof Error ? error.message : String(error);
|
|
7
|
+
}
|
|
8
|
+
function installAwsS3(uppy, uploads, threshold) {
|
|
9
|
+
uppy.use(AwsS3, {
|
|
10
|
+
signRequest: (request) => uploads.signRequest({ ...request }),
|
|
11
|
+
shouldUseMultipart: (file) => (file.size ?? 0) > threshold
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* An uploader on Uppy 6: files go to S3-compatible storage with URLs that the backend signs, in
|
|
16
|
+
* parts when they are large, then each upload is completed with the backend.
|
|
17
|
+
*/
|
|
18
|
+
function createUppyUploader(uploads, { onUploaded, multipartThreshold = 10 * MB, install = (uppy, presigned) => installAwsS3(uppy, presigned, multipartThreshold) }) {
|
|
19
|
+
const uppy = new Uppy({
|
|
20
|
+
autoProceed: true,
|
|
21
|
+
allowMultipleUploadBatches: true
|
|
22
|
+
});
|
|
23
|
+
install(uppy, uploads);
|
|
24
|
+
const completing = /* @__PURE__ */ new Set();
|
|
25
|
+
const failures = /* @__PURE__ */ new Map();
|
|
26
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
27
|
+
let items = [];
|
|
28
|
+
const toItem = (file) => {
|
|
29
|
+
const { bytesUploaded, bytesTotal } = file.progress;
|
|
30
|
+
const failure = failures.get(file.id) ?? null;
|
|
31
|
+
let status = "uploading";
|
|
32
|
+
if (failure !== null) status = "failed";
|
|
33
|
+
else if (completing.has(file.id)) status = "completing";
|
|
34
|
+
else if (file.isPaused === true) status = "paused";
|
|
35
|
+
return {
|
|
36
|
+
id: file.id,
|
|
37
|
+
name: file.name,
|
|
38
|
+
size: file.size,
|
|
39
|
+
mime: file.type !== "" ? file.type : null,
|
|
40
|
+
progress: typeof bytesUploaded === "number" && bytesTotal !== null && bytesTotal > 0 ? Math.min(1, bytesUploaded / bytesTotal) : null,
|
|
41
|
+
status,
|
|
42
|
+
error: failure,
|
|
43
|
+
canPause: (file.size ?? 0) > multipartThreshold
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const update = () => {
|
|
47
|
+
items = uppy.getFiles().map(toItem);
|
|
48
|
+
listeners.forEach((listener) => listener());
|
|
49
|
+
};
|
|
50
|
+
const forget = (id) => {
|
|
51
|
+
completing.delete(id);
|
|
52
|
+
failures.delete(id);
|
|
53
|
+
if (uppy.getFile(id) !== void 0) uppy.removeFile(id);
|
|
54
|
+
};
|
|
55
|
+
uppy.on("state-update", update);
|
|
56
|
+
uppy.on("upload-error", (file, error) => {
|
|
57
|
+
if (file !== void 0) {
|
|
58
|
+
failures.set(file.id, errorMessage(error));
|
|
59
|
+
update();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
uppy.on("upload-success", (file, response) => {
|
|
63
|
+
if (file === void 0) return;
|
|
64
|
+
const key = typeof response.body?.key === "string" ? response.body.key : null;
|
|
65
|
+
if (key === null) {
|
|
66
|
+
failures.set(file.id, "The storage gave no key for this file.");
|
|
67
|
+
update();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
completing.add(file.id);
|
|
71
|
+
update();
|
|
72
|
+
uploads.complete(key, { name: file.name }).then((upload) => {
|
|
73
|
+
forget(file.id);
|
|
74
|
+
onUploaded({
|
|
75
|
+
upload: upload.id,
|
|
76
|
+
name: upload.name ?? file.name,
|
|
77
|
+
mime: upload.mime ?? (file.type !== "" ? file.type : null),
|
|
78
|
+
size: upload.size ?? file.size
|
|
79
|
+
}, upload);
|
|
80
|
+
}).catch((error) => {
|
|
81
|
+
completing.delete(file.id);
|
|
82
|
+
failures.set(file.id, errorMessage(error));
|
|
83
|
+
update();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
return {
|
|
87
|
+
getItems: () => items,
|
|
88
|
+
subscribe(listener) {
|
|
89
|
+
listeners.add(listener);
|
|
90
|
+
return () => listeners.delete(listener);
|
|
91
|
+
},
|
|
92
|
+
add(files) {
|
|
93
|
+
for (const file of files) uppy.addFile({
|
|
94
|
+
name: file.name,
|
|
95
|
+
type: file.type,
|
|
96
|
+
data: file
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
pause(id) {
|
|
100
|
+
if (uppy.getFile(id)?.isPaused !== true) uppy.pauseResume(id);
|
|
101
|
+
},
|
|
102
|
+
resume(id) {
|
|
103
|
+
if (uppy.getFile(id)?.isPaused === true) uppy.pauseResume(id);
|
|
104
|
+
},
|
|
105
|
+
cancel(id) {
|
|
106
|
+
forget(id);
|
|
107
|
+
update();
|
|
108
|
+
},
|
|
109
|
+
retry(id) {
|
|
110
|
+
if (!failures.has(id)) return;
|
|
111
|
+
failures.delete(id);
|
|
112
|
+
update();
|
|
113
|
+
uppy.retryUpload(id);
|
|
114
|
+
},
|
|
115
|
+
destroy() {
|
|
116
|
+
listeners.clear();
|
|
117
|
+
uppy.destroy();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The upload source of fields on Uppy 6 (`@uppy/core` and `@uppy/aws-s3`, optional peer
|
|
123
|
+
* dependencies of this entry point): pass it as `uploadSource` to `FieldsProvider` or
|
|
124
|
+
* `FormView`, with the signing routes of the backend.
|
|
125
|
+
*
|
|
126
|
+
* ```ts
|
|
127
|
+
* const uploadSource = createUppyUploadSource(adapter.presignedUploads());
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
function createUppyUploadSource(uploads, options = {}) {
|
|
131
|
+
return { createUploader: ({ onUploaded }) => createUppyUploader(uploads, {
|
|
132
|
+
...options,
|
|
133
|
+
onUploaded
|
|
134
|
+
}) };
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
export { createUppyUploadSource, createUppyUploader };
|
|
138
|
+
|
|
139
|
+
//# sourceMappingURL=uploader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploader.js","names":["AwsS3","Uppy","Body","Meta","UppyFile","Upload","UploadSignRequest","UploadItem","UploadItemStatus","UploadSource","UploadedFile","Uploader","PresignedUploadsLike","signRequest","request","Promise","url","key","headers","Record","complete","options","name","UppyUploadSourceOptions","multipartThreshold","install","uppy","uploads","MB","errorMessage","error","Error","message","String","installAwsS3","threshold","use","shouldUseMultipart","file","size","createUppyUploader","onUploaded","presigned","upload","autoProceed","allowMultipleUploadBatches","completing","Set","failures","Map","listeners","items","toItem","bytesUploaded","bytesTotal","progress","failure","get","id","status","has","isPaused","mime","type","Math","min","canPause","update","getFiles","map","forEach","listener","forget","delete","getFile","undefined","removeFile","on","set","response","body","add","then","catch","getItems","subscribe","files","addFile","data","pause","pauseResume","resume","cancel","retry","retryUpload","destroy","clear","createUppyUploadSource","createUploader"],"sources":["../../src/uppy/uploader.ts"],"sourcesContent":["import AwsS3 from '@uppy/aws-s3';\nimport Uppy, { type Body, type Meta, type UppyFile } from '@uppy/core';\n\nimport type { Upload, UploadSignRequest } from '@panneau/protocol';\n\nimport type {\n UploadItem,\n UploadItemStatus,\n UploadSource,\n UploadedFile,\n Uploader,\n} from '../upload/types';\n\n/**\n * Signs and completes direct uploads: `adapter.presignedUploads()` of `@panneau/data` (or\n * `createPresignedUploads()`) gives one.\n */\nexport interface PresignedUploadsLike {\n signRequest(\n request: UploadSignRequest,\n ): Promise<{ url: string; key?: string; headers?: Record<string, string> }>;\n complete(key: string, options?: { name?: string }): Promise<Upload>;\n}\n\nexport interface UppyUploadSourceOptions {\n /** Files larger than this, in bytes, are sent in parts, which can pause and resume. Defaults to 10 MB. */\n multipartThreshold?: number;\n /**\n * Installs what sends files on each Uppy instance: `@uppy/aws-s3` with the backend's\n * signatures by default. Tests install a fake one.\n */\n install?: (uppy: Uppy<Meta, Body>, uploads: PresignedUploadsLike) => void;\n}\n\nconst MB = 1024 * 1024;\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction installAwsS3(uppy: Uppy<Meta, Body>, uploads: PresignedUploadsLike, threshold: number) {\n uppy.use(AwsS3<Meta, Body>, {\n // Uppy's request types are interfaces; the protocol's schema is an open object.\n signRequest: (request) => uploads.signRequest({ ...request }),\n shouldUseMultipart: (file) => (file.size ?? 0) > threshold,\n });\n}\n\n/**\n * An uploader on Uppy 6: files go to S3-compatible storage with URLs that the backend signs, in\n * parts when they are large, then each upload is completed with the backend.\n */\nexport function createUppyUploader(\n uploads: PresignedUploadsLike,\n {\n onUploaded,\n multipartThreshold = 10 * MB,\n install = (uppy, presigned) => installAwsS3(uppy, presigned, multipartThreshold),\n }: UppyUploadSourceOptions & { onUploaded: (file: UploadedFile, upload: Upload) => void },\n): Uploader {\n const uppy = new Uppy<Meta, Body>({ autoProceed: true, allowMultipleUploadBatches: true });\n install(uppy, uploads);\n\n // What Uppy doesn't track: files being completed with the backend, and why one failed.\n const completing = new Set<string>();\n const failures = new Map<string, string>();\n const listeners = new Set<() => void>();\n let items: readonly UploadItem[] = [];\n\n const toItem = (file: UppyFile<Meta, Body>): UploadItem => {\n const { bytesUploaded, bytesTotal } = file.progress;\n const failure = failures.get(file.id) ?? null;\n let status: UploadItemStatus = 'uploading';\n if (failure !== null) {\n status = 'failed';\n } else if (completing.has(file.id)) {\n status = 'completing';\n } else if (file.isPaused === true) {\n status = 'paused';\n }\n return {\n id: file.id,\n name: file.name,\n size: file.size,\n mime: file.type !== '' ? file.type : null,\n progress:\n typeof bytesUploaded === 'number' && bytesTotal !== null && bytesTotal > 0\n ? Math.min(1, bytesUploaded / bytesTotal)\n : null,\n status,\n error: failure,\n canPause: (file.size ?? 0) > multipartThreshold,\n };\n };\n\n const update = () => {\n items = uppy.getFiles().map(toItem);\n listeners.forEach((listener) => listener());\n };\n\n const forget = (id: string) => {\n completing.delete(id);\n failures.delete(id);\n if (uppy.getFile(id) !== undefined) {\n uppy.removeFile(id);\n }\n };\n\n uppy.on('state-update', update);\n uppy.on('upload-error', (file, error) => {\n if (file !== undefined) {\n failures.set(file.id, errorMessage(error));\n update();\n }\n });\n uppy.on('upload-success', (file, response) => {\n if (file === undefined) {\n return;\n }\n const key = typeof response.body?.key === 'string' ? response.body.key : null;\n if (key === null) {\n failures.set(file.id, 'The storage gave no key for this file.');\n update();\n return;\n }\n completing.add(file.id);\n update();\n uploads\n .complete(key, { name: file.name })\n .then((upload) => {\n forget(file.id);\n onUploaded(\n {\n upload: upload.id,\n name: upload.name ?? file.name,\n mime: upload.mime ?? (file.type !== '' ? file.type : null),\n size: upload.size ?? file.size,\n },\n upload,\n );\n })\n .catch((error: unknown) => {\n completing.delete(file.id);\n failures.set(file.id, errorMessage(error));\n update();\n });\n });\n\n return {\n getItems: () => items,\n subscribe(listener) {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n add(files) {\n for (const file of files) {\n uppy.addFile({ name: file.name, type: file.type, data: file });\n }\n },\n pause(id) {\n if (uppy.getFile(id)?.isPaused !== true) {\n uppy.pauseResume(id);\n }\n },\n resume(id) {\n if (uppy.getFile(id)?.isPaused === true) {\n uppy.pauseResume(id);\n }\n },\n cancel(id) {\n forget(id);\n update();\n },\n retry(id) {\n if (!failures.has(id)) {\n return;\n }\n failures.delete(id);\n update();\n void uppy.retryUpload(id);\n },\n destroy() {\n listeners.clear();\n uppy.destroy();\n },\n };\n}\n\n/**\n * The upload source of fields on Uppy 6 (`@uppy/core` and `@uppy/aws-s3`, optional peer\n * dependencies of this entry point): pass it as `uploadSource` to `FieldsProvider` or\n * `FormView`, with the signing routes of the backend.\n *\n * ```ts\n * const uploadSource = createUppyUploadSource(adapter.presignedUploads());\n * ```\n */\nexport function createUppyUploadSource(\n uploads: PresignedUploadsLike,\n options: UppyUploadSourceOptions = {},\n): UploadSource {\n return {\n createUploader: ({ onUploaded }) => createUppyUploader(uploads, { ...options, onUploaded }),\n };\n}\n"],"mappings":";;;AAkCA,IAAM4B,KAAK;AAEX,SAASC,aAAaC,OAAwB;CAC1C,OAAOA,iBAAiBC,QAAQD,MAAME,UAAUC,OAAOH,KAAK;AAChE;AAEA,SAASI,aAAaR,MAAwBC,SAA+BQ,WAAmB;CAC5FT,KAAKU,IAAIpC,OAAmB;EAExBa,cAAcC,YAAYa,QAAQd,YAAY,EAAE,GAAGC,QAAQ,CAAC;EAC5DuB,qBAAqBC,UAAUA,KAAKC,QAAQ,KAAKJ;CACrD,CAAC;AACL;;;;;AAMA,SAAgBK,mBACZb,SACA,EACIc,YACAjB,qBAAqB,KAAKI,IAC1BH,WAAWC,MAAMgB,cAAcR,aAAaR,MAAMgB,WAAWlB,kBAAkB,KAE3E;CACR,MAAME,OAAO,IAAIzB,KAAiB;EAAE2C,aAAa;EAAMC,4BAA4B;CAAK,CAAC;CACzFpB,QAAQC,MAAMC,OAAO;CAGrB,MAAMmB,6BAAa,IAAIC,IAAY;CACnC,MAAMC,2BAAW,IAAIC,IAAoB;CACzC,MAAMC,4BAAY,IAAIH,IAAgB;CACtC,IAAII,QA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OAAOd,EAAE;GACTS,OAAO;EACX;EACA0B,MAAMnC,IAAI;GACN,IAAI,CAACV,SAASY,IAAIF,EAAE,GAChB;GAEJV,SAASyB,OAAOf,EAAE;GAClBS,OAAO;GACP,KAAU2B,YAAYpC,EAAE;EAC5B;EACAqC,UAAU;GACN7C,UAAU8C,MAAM;GAChBtE,KAAKqE,QAAQ;EACjB;CACJ;AACJ;;;;;;;;;;AAWA,SAAgBE,uBACZtE,SACAN,UAAmC,CAAC,GACxB;CACZ,OAAO,EACH6E,iBAAiB,EAAEzD,iBAAiBD,mBAAmBb,SAAS;EAAE,GAAGN;EAASoB;CAAW,CAAC,EAC9F;AACJ"}
|
package/dist/url/UrlField.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.panneau-open
|
|
1
|
+
.panneau-url-field-open {
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
padding: var(--panneau-space-1);
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
border-radius: var(--panneau-radius-sm);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.panneau-open
|
|
9
|
+
.panneau-url-field-open:hover {
|
|
10
10
|
color: var(--panneau-color-text);
|
|
11
11
|
}
|
package/dist/url/UrlField.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FieldEntryProps } from '../shared/types';
|
|
2
|
-
import { type TextFieldProps } from '../text/TextField';
|
|
1
|
+
import type { FieldEntryProps } from '../shared/types.js';
|
|
2
|
+
import { type TextFieldProps } from '../text/TextField.js';
|
|
3
3
|
export interface UrlFieldProps extends Omit<TextFieldProps, 'type' | 'inputMode' | 'suffix'> {
|
|
4
4
|
/** Scheme added on blur to a URL without one (`example.com`). Defaults to `https://`. */
|
|
5
5
|
defaultScheme?: string;
|
package/dist/url/UrlField.js
CHANGED
|
@@ -19,24 +19,55 @@ function withScheme(url, scheme = "https://") {
|
|
|
19
19
|
* A URL, with the URL keyboard on phones and a link to open it. A URL typed without a scheme
|
|
20
20
|
* gets `https://` on blur, as v4 did.
|
|
21
21
|
*/
|
|
22
|
-
function UrlField(
|
|
22
|
+
function UrlField(t0) {
|
|
23
|
+
const $ = c(23);
|
|
24
|
+
let onBlur;
|
|
25
|
+
let onChange;
|
|
26
|
+
let props;
|
|
27
|
+
let t1;
|
|
28
|
+
let value;
|
|
29
|
+
if ($[0] !== t0) {
|
|
30
|
+
({value, onChange, onBlur, defaultScheme: t1, ...props} = t0);
|
|
31
|
+
$[0] = t0;
|
|
32
|
+
$[1] = onBlur;
|
|
33
|
+
$[2] = onChange;
|
|
34
|
+
$[3] = props;
|
|
35
|
+
$[4] = t1;
|
|
36
|
+
$[5] = value;
|
|
37
|
+
} else {
|
|
38
|
+
onBlur = $[1];
|
|
39
|
+
onChange = $[2];
|
|
40
|
+
props = $[3];
|
|
41
|
+
t1 = $[4];
|
|
42
|
+
value = $[5];
|
|
43
|
+
}
|
|
44
|
+
const defaultScheme = t1 === void 0 ? "https://" : t1;
|
|
23
45
|
const intl = usePanneauIntl();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
let t2;
|
|
47
|
+
if ($[6] !== value) {
|
|
48
|
+
t2 = value !== null && value !== void 0 && /^https?:\/\//i.test(value);
|
|
49
|
+
$[6] = value;
|
|
50
|
+
$[7] = t2;
|
|
51
|
+
} else t2 = $[7];
|
|
52
|
+
const openable = t2;
|
|
53
|
+
let t3;
|
|
54
|
+
if ($[8] !== defaultScheme || $[9] !== onBlur || $[10] !== onChange || $[11] !== value) {
|
|
55
|
+
t3 = () => {
|
|
33
56
|
if (value !== null && value !== void 0) {
|
|
34
57
|
const next = withScheme(value, defaultScheme);
|
|
35
58
|
if (next !== value) onChange?.(next === "" ? null : next);
|
|
36
59
|
}
|
|
37
60
|
onBlur?.();
|
|
38
|
-
}
|
|
39
|
-
|
|
61
|
+
};
|
|
62
|
+
$[8] = defaultScheme;
|
|
63
|
+
$[9] = onBlur;
|
|
64
|
+
$[10] = onChange;
|
|
65
|
+
$[11] = value;
|
|
66
|
+
$[12] = t3;
|
|
67
|
+
} else t3 = $[12];
|
|
68
|
+
let t4;
|
|
69
|
+
if ($[13] !== intl || $[14] !== openable || $[15] !== value) {
|
|
70
|
+
t4 = openable ? /* @__PURE__ */ jsx("a", {
|
|
40
71
|
href: value,
|
|
41
72
|
target: "_blank",
|
|
42
73
|
rel: "noopener noreferrer",
|
|
@@ -46,8 +77,32 @@ function UrlField({ value, onChange, onBlur, defaultScheme = "https://", ...prop
|
|
|
46
77
|
icon: ExternalLink,
|
|
47
78
|
label: intl.formatMessage(messages.openLink)
|
|
48
79
|
})
|
|
49
|
-
}) : void 0
|
|
50
|
-
|
|
80
|
+
}) : void 0;
|
|
81
|
+
$[13] = intl;
|
|
82
|
+
$[14] = openable;
|
|
83
|
+
$[15] = value;
|
|
84
|
+
$[16] = t4;
|
|
85
|
+
} else t4 = $[16];
|
|
86
|
+
let t5;
|
|
87
|
+
if ($[17] !== onChange || $[18] !== props || $[19] !== t3 || $[20] !== t4 || $[21] !== value) {
|
|
88
|
+
t5 = /* @__PURE__ */ jsx(TextField, {
|
|
89
|
+
autoComplete: "off",
|
|
90
|
+
...props,
|
|
91
|
+
type: "url",
|
|
92
|
+
inputMode: "url",
|
|
93
|
+
value,
|
|
94
|
+
onChange,
|
|
95
|
+
onBlur: t3,
|
|
96
|
+
suffix: t4
|
|
97
|
+
});
|
|
98
|
+
$[17] = onChange;
|
|
99
|
+
$[18] = props;
|
|
100
|
+
$[19] = t3;
|
|
101
|
+
$[20] = t4;
|
|
102
|
+
$[21] = value;
|
|
103
|
+
$[22] = t5;
|
|
104
|
+
} else t5 = $[22];
|
|
105
|
+
return t5;
|
|
51
106
|
}
|
|
52
107
|
/** The `url` type: setting `defaultScheme`. */
|
|
53
108
|
function UrlFieldEntry(props) {
|
package/dist/url/UrlField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlField.js","names":["styles","_c"],"sources":["../../src/url/UrlField.tsx"],"sourcesContent":["import { ExternalLink } from 'lucide-react';\n\nimport { Icon, usePanneauIntl } from '@panneau/ui';\n\nimport { getFieldProps, getSetting, isString } from '../shared/entry';\nimport { messages } from '../shared/messages';\nimport type { FieldEntryProps } from '../shared/types';\nimport { TextField, type TextFieldProps } from '../text/TextField';\nimport styles from './UrlField.module.css';\n\nexport interface UrlFieldProps extends Omit<TextFieldProps, 'type' | 'inputMode' | 'suffix'> {\n /** Scheme added on blur to a URL without one (`example.com`). Defaults to `https://`. */\n defaultScheme?: string;\n}\n\nconst SCHEME = /^[a-z][a-z0-9+.-]*:/i;\n\n/** Adds a scheme to a URL that has none, and isn't a path or an anchor. */\nexport function withScheme(url: string, scheme = 'https://'): string {\n const trimmed = url.trim();\n if (trimmed.startsWith('//')) {\n return `${scheme}${trimmed.slice(2)}`;\n }\n if (trimmed === '' || SCHEME.test(trimmed) || /^[/#?]/.test(trimmed)) {\n return trimmed;\n }\n return `${scheme}${trimmed}`;\n}\n\n/**\n * A URL, with the URL keyboard on phones and a link to open it. A URL typed without a scheme\n * gets `https://` on blur, as v4 did.\n */\nexport function UrlField({\n value,\n onChange,\n onBlur,\n defaultScheme = 'https://',\n ...props\n}: UrlFieldProps) {\n const intl = usePanneauIntl();\n const openable = value !== null && value !== undefined && /^https?:\\/\\//i.test(value);\n return (\n <TextField\n autoComplete=\"off\"\n {...props}\n type=\"url\"\n inputMode=\"url\"\n value={value}\n onChange={onChange}\n onBlur={() => {\n if (value !== null && value !== undefined) {\n const next = withScheme(value, defaultScheme);\n if (next !== value) {\n onChange?.(next === '' ? null : next);\n }\n }\n onBlur?.();\n }}\n suffix={\n openable ? (\n <a\n href={value}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={styles.open}\n title={intl.formatMessage(messages.openLink)}\n >\n <Icon icon={ExternalLink} label={intl.formatMessage(messages.openLink)} />\n </a>\n ) : undefined\n }\n />\n );\n}\n\n/** The `url` type: setting `defaultScheme`. */\nexport function UrlFieldEntry(props: FieldEntryProps) {\n const defaultScheme = getSetting(props.field, 'defaultScheme', isString);\n return (\n <UrlField\n {...getFieldProps(props)}\n value={isString(props.value) ? props.value : null}\n onChange={props.onChange}\n {...(defaultScheme !== undefined ? { defaultScheme } : {})}\n />\n );\n}\n"],"mappings":";;;;;;;;;AAeA,
|
|
1
|
+
{"version":3,"file":"UrlField.js","names":["ExternalLink","Icon","usePanneauIntl","getFieldProps","getSetting","isString","messages","FieldEntryProps","TextField","TextFieldProps","styles","UrlFieldProps","Omit","defaultScheme","SCHEME","withScheme","url","scheme","trimmed","trim","startsWith","slice","test","UrlField","t0","$","_c","onBlur","onChange","props","t1","value","undefined","intl","t2","openable","t3","next","t4","open","formatMessage","openLink","t5","UrlFieldEntry","field","_c","styles"],"sources":["../../src/url/UrlField.tsx"],"sourcesContent":["import { ExternalLink } from 'lucide-react';\n\nimport { Icon, usePanneauIntl } from '@panneau/ui';\n\nimport { getFieldProps, getSetting, isString } from '../shared/entry';\nimport { messages } from '../shared/messages';\nimport type { FieldEntryProps } from '../shared/types';\nimport { TextField, type TextFieldProps } from '../text/TextField';\nimport styles from './UrlField.module.css';\n\nexport interface UrlFieldProps extends Omit<TextFieldProps, 'type' | 'inputMode' | 'suffix'> {\n /** Scheme added on blur to a URL without one (`example.com`). Defaults to `https://`. */\n defaultScheme?: string;\n}\n\nconst SCHEME = /^[a-z][a-z0-9+.-]*:/i;\n\n/** Adds a scheme to a URL that has none, and isn't a path or an anchor. */\nexport function withScheme(url: string, scheme = 'https://'): string {\n const trimmed = url.trim();\n if (trimmed.startsWith('//')) {\n return `${scheme}${trimmed.slice(2)}`;\n }\n if (trimmed === '' || SCHEME.test(trimmed) || /^[/#?]/.test(trimmed)) {\n return trimmed;\n }\n return `${scheme}${trimmed}`;\n}\n\n/**\n * A URL, with the URL keyboard on phones and a link to open it. A URL typed without a scheme\n * gets `https://` on blur, as v4 did.\n */\nexport function UrlField({\n value,\n onChange,\n onBlur,\n defaultScheme = 'https://',\n ...props\n}: UrlFieldProps) {\n const intl = usePanneauIntl();\n const openable = value !== null && value !== undefined && /^https?:\\/\\//i.test(value);\n return (\n <TextField\n autoComplete=\"off\"\n {...props}\n type=\"url\"\n inputMode=\"url\"\n value={value}\n onChange={onChange}\n onBlur={() => {\n if (value !== null && value !== undefined) {\n const next = withScheme(value, defaultScheme);\n if (next !== value) {\n onChange?.(next === '' ? null : next);\n }\n }\n onBlur?.();\n }}\n suffix={\n openable ? (\n <a\n href={value}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={styles.open}\n title={intl.formatMessage(messages.openLink)}\n >\n <Icon icon={ExternalLink} label={intl.formatMessage(messages.openLink)} />\n </a>\n ) : undefined\n }\n />\n );\n}\n\n/** The `url` type: setting `defaultScheme`. */\nexport function UrlFieldEntry(props: FieldEntryProps) {\n const defaultScheme = getSetting(props.field, 'defaultScheme', isString);\n return (\n <UrlField\n {...getFieldProps(props)}\n value={isString(props.value) ? props.value : null}\n onChange={props.onChange}\n {...(defaultScheme !== undefined ? { defaultScheme } : {})}\n />\n );\n}\n"],"mappings":";;;;;;;;;AAeA,IAAMc,SAAS;;AAGf,SAAgBC,WAAWC,KAAaC,SAAS,YAAoB;CACjE,MAAMC,UAAUF,IAAIG,KAAK;CACzB,IAAID,QAAQE,WAAW,IAAI,GACvB,OAAO,GAAGH,SAASC,QAAQG,MAAM,CAAC;CAEtC,IAAIH,YAAY,MAAMJ,OAAOQ,KAAKJ,OAAO,KAAK,SAASI,KAAKJ,OAAO,GAC/D,OAAOA;CAEX,OAAO,GAAGD,SAASC;AACvB;;;;;AAMA,SAAOK,SAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAN,EAAA,OAAAD,IAAA;EAAk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BAAkBmB,KAAAA,IAAlB,EAAAnB,cAAmD,IAAnD,CAAmD;EAACY,EAAA,KAAAZ;EAAAY,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAI,MAAAD,YAAAH,EAAA,OAAAK,MAAAL,EAAA,OAAAS,MAAAT,EAAA,OAAAW,IAAA;EAJ7DE,KAAA,oBAAC,UAAD;GAAS,GACDR;GACG,OAAAI;GACG,UAAAL,MAAKD;GAAS,GACnBQ;EAAoD,CAAA;EAC3DX,EAAA,KAAAI,MAAAD;EAAAH,EAAA,KAAAK;EAAAL,EAAA,KAAAS;EAAAT,EAAA,KAAAW;EAAAX,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OALFa;AAKE"}
|
package/dist/url/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { UrlField, UrlFieldEntry, type UrlFieldProps, withScheme } from './UrlField';
|
|
1
|
+
export { UrlField, UrlFieldEntry, type UrlFieldProps, withScheme } from './UrlField.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|