@panneau/field-upload 4.0.11 → 4.0.15

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.
@@ -0,0 +1,107 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Label } from '@panneau/core';
3
+
4
+ type MediaType = 'audio' | 'image' | 'video' | 'document';
5
+ type MediaSource = 'webcam' | 'facebook' | 'instagram' | 'dropbox' | 'google-drive';
6
+ interface Media$1 {
7
+ filename?: string;
8
+ size?: number;
9
+ url?: string;
10
+ id?: string | number;
11
+ [key: string]: unknown;
12
+ }
13
+ interface UppyProps {
14
+ withUUID?: boolean;
15
+ [key: string]: unknown;
16
+ }
17
+ interface UploadFieldProps {
18
+ resource?: string;
19
+ value?: Media$1 | Media$1[] | null;
20
+ name?: string | null;
21
+ types?: MediaType[] | null;
22
+ fileTypes?: string[] | null;
23
+ sources?: MediaSource[];
24
+ withButton?: boolean;
25
+ withFind?: boolean;
26
+ withClearButton?: boolean;
27
+ withoutMedia?: boolean;
28
+ addButtonLabel?: Label | null;
29
+ findButtonLabel?: Label | null;
30
+ clearButtonLabel?: Label | null;
31
+ allowMultipleUploads?: boolean;
32
+ closeAfterFinish?: boolean;
33
+ maxNumberOfFiles?: number;
34
+ namePath?: string;
35
+ thumbnailPath?: string;
36
+ sizePath?: string;
37
+ linkPath?: string | null;
38
+ uppyProps?: UppyProps | null;
39
+ width?: number | null;
40
+ height?: number | null;
41
+ disabled?: boolean;
42
+ uploadDisabled?: boolean;
43
+ outline?: boolean;
44
+ loading?: boolean;
45
+ onChange?: ((value: Media$1 | Media$1[] | null) => void) | null;
46
+ onClear?: (() => void) | null;
47
+ onClickAdd?: (() => void) | null;
48
+ onClickFind?: (() => void) | null;
49
+ onClose?: ((value: Media$1 | Media$1[] | null) => void) | null;
50
+ className?: string | null;
51
+ }
52
+ declare function UploadField({ resource, value, name, types, fileTypes, sources, withButton, withFind, withClearButton, withoutMedia, addButtonLabel: initialAddButtonLabel, findButtonLabel: initialFindButtonLabel, clearButtonLabel: initialCleanButtonLabel, allowMultipleUploads, closeAfterFinish, maxNumberOfFiles, namePath, thumbnailPath, sizePath, linkPath, uppyProps, width, height, disabled, uploadDisabled, outline, loading: parentLoading, onChange, onClear, onClickAdd, onClickFind, className, }: UploadFieldProps): react_jsx_runtime.JSX.Element;
53
+
54
+ declare const _default: {
55
+ id: string;
56
+ component: string;
57
+ }[];
58
+
59
+ interface AudioFieldProps {
60
+ [key: string]: unknown;
61
+ }
62
+ declare function AudioField(props: AudioFieldProps): react_jsx_runtime.JSX.Element;
63
+
64
+ interface ImageFieldProps {
65
+ [key: string]: unknown;
66
+ }
67
+ declare function ImageField(props: ImageFieldProps): react_jsx_runtime.JSX.Element;
68
+
69
+ interface ImagesFieldProps {
70
+ [key: string]: unknown;
71
+ }
72
+ declare function ImagesField(props: ImagesFieldProps): react_jsx_runtime.JSX.Element;
73
+
74
+ interface VideoFieldProps {
75
+ [key: string]: unknown;
76
+ }
77
+ declare function VideoField(props: VideoFieldProps): react_jsx_runtime.JSX.Element;
78
+
79
+ interface DocumentFieldProps {
80
+ [key: string]: unknown;
81
+ }
82
+ declare function DocumentField(props: DocumentFieldProps): react_jsx_runtime.JSX.Element;
83
+
84
+ interface FontFieldProps {
85
+ [key: string]: unknown;
86
+ }
87
+ declare function FontField(props: FontFieldProps): react_jsx_runtime.JSX.Element;
88
+
89
+ interface Media {
90
+ id?: string | number;
91
+ type?: string;
92
+ published?: boolean;
93
+ featured?: boolean;
94
+ created_at?: string;
95
+ updated_at?: string;
96
+ [key: string]: unknown;
97
+ }
98
+ interface UpdateFileFieldProps {
99
+ value?: Media | null;
100
+ onChange?: ((value: Media | null) => void) | null;
101
+ types?: string[] | null;
102
+ fileTypes?: string[] | null;
103
+ [key: string]: unknown;
104
+ }
105
+ declare function UpdateFileField({ value, onChange, ...props }: UpdateFileFieldProps): react_jsx_runtime.JSX.Element;
106
+
107
+ export { AudioField, DocumentField, FontField, ImageField, ImagesField, UpdateFileField, VideoField, UploadField as default, _default as definition };
@@ -6,8 +6,8 @@ import { UppyContextProvider } from '@uppy/react';
6
6
  import Dashboard from '@uppy/react/dashboard';
7
7
  import DashboardModal from '@uppy/react/dashboard-modal';
8
8
  import classNames from 'classnames';
9
- import isArray from 'lodash-es/isArray';
10
- import isObject from 'lodash-es/isObject';
9
+ import isArray from 'lodash/isArray';
10
+ import isObject from 'lodash/isObject';
11
11
  import { useCallback, useMemo, useState, useRef, useEffect } from 'react';
12
12
  import { FormattedMessage } from 'react-intl';
13
13
  import { useQuery } from '@panneau/core/hooks';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/field-upload",
3
- "version": "4.0.11",
3
+ "version": "4.0.15",
4
4
  "description": "An Upload field",
5
5
  "keywords": [
6
6
  "javascript"
@@ -34,21 +34,24 @@
34
34
  ],
35
35
  "license": "ISC",
36
36
  "type": "module",
37
- "module": "es/index.js",
37
+ "module": "dist/index.js",
38
+ "types": "dist/index.d.ts",
38
39
  "style": "./assets/css/styles.css",
39
40
  "exports": {
40
- ".": "./es/index.js",
41
+ ".": {
42
+ "default": "./dist/index.js",
43
+ "types": "./dist/index.d.ts"
44
+ },
41
45
  "./assets/css/styles": "./assets/css/styles.css",
42
46
  "./assets/css/styles.css": "./assets/css/styles.css"
43
47
  },
44
48
  "files": [
45
- "lib",
46
- "es",
49
+ "dist",
47
50
  "assets"
48
51
  ],
49
52
  "scripts": {
50
53
  "prepublishOnly": "npm run build",
51
- "build": "../../scripts/prepare-package.sh"
54
+ "build": "../../scripts/prepare-package.sh --types"
52
55
  },
53
56
  "devDependencies": {
54
57
  "react": "^19.0.0",
@@ -63,25 +66,24 @@
63
66
  "@fortawesome/fontawesome-svg-core": "^6.5.1",
64
67
  "@fortawesome/free-solid-svg-icons": "^6.5.1",
65
68
  "@fortawesome/react-fontawesome": "^0.2.0",
66
- "@panneau/core": "^4.0.11",
67
- "@panneau/element-button": "^4.0.11",
68
- "@panneau/element-label": "^4.0.11",
69
- "@panneau/element-media-card": "^4.0.11",
70
- "@panneau/modal-resource-items": "^4.0.11",
71
- "@panneau/themes": "^4.0.11",
72
- "@panneau/uppy": "^4.0.11",
69
+ "@panneau/core": "^4.0.15",
70
+ "@panneau/element-button": "^4.0.15",
71
+ "@panneau/element-label": "^4.0.15",
72
+ "@panneau/element-media-card": "^4.0.15",
73
+ "@panneau/modal-resource-items": "^4.0.15",
74
+ "@panneau/themes": "^4.0.15",
75
+ "@panneau/uppy": "^4.0.15",
73
76
  "@uppy/core": "^5.1.1",
74
77
  "@uppy/dashboard": "^5.0.4",
75
78
  "@uppy/react": "^5.1.1",
76
79
  "@uppy/utils": "^7.1.3",
77
80
  "classnames": "^2.5.1",
78
- "lodash-es": "^4.17.21",
79
- "prop-types": "^15.7.2",
81
+ "lodash": "^4.17.21",
80
82
  "react-intl": "^5.15.8 || ^6.0.0 || ^7.0.0",
81
83
  "tailwindcss": "^4.1.17"
82
84
  },
83
85
  "publishConfig": {
84
86
  "access": "public"
85
87
  },
86
- "gitHead": "fe8264ed2815da0b5a40339dec99999c6fe70751"
88
+ "gitHead": "83c02ca2f26e02383ef452ffcafda984d0b211cd"
87
89
  }