@micromag/media-gallery 0.3.832 → 0.4.4
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/assets/css/styles.css +1 -1
- package/es/index.d.ts +29 -0
- package/es/index.js +27 -56
- package/es/styles.css +1 -0
- package/package.json +21 -23
- package/scss/styles.scss +0 -1
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.container .browser{--bs-input-color:hsla(0,0%,100%,.07)!important}
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Media } from '@micromag/core';
|
|
3
|
+
|
|
4
|
+
interface MediaGalleryProps {
|
|
5
|
+
value?: {
|
|
6
|
+
id?: string | number;
|
|
7
|
+
} | null;
|
|
8
|
+
types?: string | unknown[] | null;
|
|
9
|
+
source?: string;
|
|
10
|
+
filters?: {
|
|
11
|
+
id?: string;
|
|
12
|
+
}[] | null;
|
|
13
|
+
fields?: {
|
|
14
|
+
id?: string;
|
|
15
|
+
}[] | null;
|
|
16
|
+
columns?: {
|
|
17
|
+
id?: string;
|
|
18
|
+
}[];
|
|
19
|
+
isPicker?: boolean;
|
|
20
|
+
multiple?: boolean;
|
|
21
|
+
medias?: Media[] | null;
|
|
22
|
+
onChange?: ((...args: unknown[]) => void) | null;
|
|
23
|
+
onMediaFormOpen?: ((...args: unknown[]) => void) | null;
|
|
24
|
+
onMediaFormClose?: ((...args: unknown[]) => void) | null;
|
|
25
|
+
className?: string | null;
|
|
26
|
+
}
|
|
27
|
+
declare function MediaGallery({ value, types, source, filters, fields: providedFields, columns, isPicker, multiple, medias: initialMedias, onChange, onMediaFormOpen, onMediaFormClose, className, }: MediaGalleryProps): react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
export { MediaGallery as default };
|
package/es/index.js
CHANGED
|
@@ -3,10 +3,8 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
3
3
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import isArray from 'lodash/isArray';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
6
|
import React, { useMemo, useCallback, useState } from 'react';
|
|
8
7
|
import { MediasPickerContainer, MediasBrowserContainer } from '@panneau/medias';
|
|
9
|
-
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
10
8
|
import { useStory } from '@micromag/core/contexts';
|
|
11
9
|
import { useApi, useMediaCreate } from '@micromag/data';
|
|
12
10
|
import { FormattedMessage } from 'react-intl';
|
|
@@ -447,60 +445,35 @@ function filters() {
|
|
|
447
445
|
}];
|
|
448
446
|
}
|
|
449
447
|
|
|
450
|
-
var styles = {"container":"
|
|
448
|
+
var styles = {"container":"container","browser":"browser"};
|
|
451
449
|
|
|
452
|
-
var propTypes = {
|
|
453
|
-
value: PropTypes.shape({
|
|
454
|
-
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
455
|
-
}),
|
|
456
|
-
types: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
|
|
457
|
-
source: PropTypes.string,
|
|
458
|
-
filters: PropTypes.arrayOf(PropTypes.shape({
|
|
459
|
-
id: PropTypes.string
|
|
460
|
-
})),
|
|
461
|
-
fields: PropTypes.arrayOf(PropTypes.shape({
|
|
462
|
-
id: PropTypes.string
|
|
463
|
-
})),
|
|
464
|
-
columns: PropTypes.arrayOf(PropTypes.shape({
|
|
465
|
-
id: PropTypes.string
|
|
466
|
-
})),
|
|
467
|
-
isPicker: PropTypes.bool,
|
|
468
|
-
multiple: PropTypes.bool,
|
|
469
|
-
medias: PropTypes$1.medias,
|
|
470
|
-
onChange: PropTypes.func,
|
|
471
|
-
onMediaFormOpen: PropTypes.func,
|
|
472
|
-
onMediaFormClose: PropTypes.func,
|
|
473
|
-
className: PropTypes.string
|
|
474
|
-
};
|
|
475
|
-
var defaultProps = {
|
|
476
|
-
value: null,
|
|
477
|
-
types: null,
|
|
478
|
-
source: 'all',
|
|
479
|
-
filters: null,
|
|
480
|
-
fields: null,
|
|
481
|
-
columns: defaultColumns,
|
|
482
|
-
isPicker: false,
|
|
483
|
-
multiple: false,
|
|
484
|
-
medias: null,
|
|
485
|
-
onChange: null,
|
|
486
|
-
onMediaFormOpen: null,
|
|
487
|
-
onMediaFormClose: null,
|
|
488
|
-
className: null
|
|
489
|
-
};
|
|
490
450
|
function MediaGallery(_ref) {
|
|
491
|
-
var value = _ref.value,
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
451
|
+
var _ref$value = _ref.value,
|
|
452
|
+
value = _ref$value === void 0 ? null : _ref$value,
|
|
453
|
+
_ref$types = _ref.types,
|
|
454
|
+
types = _ref$types === void 0 ? null : _ref$types,
|
|
455
|
+
_ref$source = _ref.source,
|
|
456
|
+
source = _ref$source === void 0 ? 'all' : _ref$source,
|
|
457
|
+
_ref$filters = _ref.filters,
|
|
458
|
+
filters$1 = _ref$filters === void 0 ? null : _ref$filters,
|
|
459
|
+
_ref$fields = _ref.fields,
|
|
460
|
+
providedFields = _ref$fields === void 0 ? null : _ref$fields,
|
|
461
|
+
_ref$columns = _ref.columns,
|
|
462
|
+
columns = _ref$columns === void 0 ? defaultColumns : _ref$columns,
|
|
463
|
+
_ref$isPicker = _ref.isPicker,
|
|
464
|
+
isPicker = _ref$isPicker === void 0 ? false : _ref$isPicker,
|
|
465
|
+
_ref$multiple = _ref.multiple,
|
|
466
|
+
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
467
|
+
_ref$medias = _ref.medias,
|
|
468
|
+
initialMedias = _ref$medias === void 0 ? null : _ref$medias,
|
|
469
|
+
_ref$onChange = _ref.onChange,
|
|
470
|
+
onChange = _ref$onChange === void 0 ? null : _ref$onChange,
|
|
471
|
+
_ref$onMediaFormOpen = _ref.onMediaFormOpen,
|
|
472
|
+
onMediaFormOpen = _ref$onMediaFormOpen === void 0 ? null : _ref$onMediaFormOpen,
|
|
473
|
+
_ref$onMediaFormClose = _ref.onMediaFormClose,
|
|
474
|
+
onMediaFormClose = _ref$onMediaFormClose === void 0 ? null : _ref$onMediaFormClose,
|
|
475
|
+
_ref$className = _ref.className,
|
|
476
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
504
477
|
var api = useApi();
|
|
505
478
|
var story = useStory();
|
|
506
479
|
var _ref2 = story || {},
|
|
@@ -672,7 +645,5 @@ function MediaGallery(_ref) {
|
|
|
672
645
|
withReplace: true
|
|
673
646
|
}));
|
|
674
647
|
}
|
|
675
|
-
MediaGallery.propTypes = propTypes;
|
|
676
|
-
MediaGallery.defaultProps = defaultProps;
|
|
677
648
|
|
|
678
649
|
export { MediaGallery as default };
|
package/es/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.container .browser{--bs-input-color:hsla(0,0%,100%,.07)!important}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/media-gallery",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -34,36 +34,34 @@
|
|
|
34
34
|
"module": "es/index.js",
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
|
+
"types": "./es/index.d.ts",
|
|
37
38
|
"import": "./es/index.js"
|
|
38
39
|
},
|
|
39
|
-
"./scss/styles": "./scss/styles.scss",
|
|
40
|
-
"./scss/styles.scss": "./scss/styles.scss",
|
|
41
40
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
42
41
|
"./assets/css/styles.css": "./assets/css/styles.css"
|
|
43
42
|
},
|
|
44
43
|
"files": [
|
|
45
44
|
"lib",
|
|
46
45
|
"es",
|
|
47
|
-
"assets"
|
|
48
|
-
"scss"
|
|
46
|
+
"assets"
|
|
49
47
|
],
|
|
50
48
|
"scripts": {
|
|
51
|
-
"clean": "rm -rf es && rm -rf lib && rm -rf assets
|
|
49
|
+
"clean": "rm -rf es && rm -rf lib && rm -rf assets",
|
|
52
50
|
"prepublishOnly": "npm run build",
|
|
53
|
-
"build": "../../scripts/prepare-package.sh --
|
|
51
|
+
"build": "../../scripts/prepare-package.sh --types"
|
|
54
52
|
},
|
|
55
53
|
"devDependencies": {
|
|
56
|
-
"@panneau/data": "^
|
|
57
|
-
"@panneau/displays": "^
|
|
58
|
-
"@panneau/fields": "^
|
|
59
|
-
"@panneau/filters": "^
|
|
60
|
-
"@panneau/uppy": "^
|
|
61
|
-
"react": "^
|
|
62
|
-
"react-dom": "^
|
|
54
|
+
"@panneau/data": "^4.0.18",
|
|
55
|
+
"@panneau/displays": "^4.0.18",
|
|
56
|
+
"@panneau/fields": "^4.0.18",
|
|
57
|
+
"@panneau/filters": "^4.0.18",
|
|
58
|
+
"@panneau/uppy": "^4.0.18",
|
|
59
|
+
"react": "^19.2.0",
|
|
60
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
63
61
|
},
|
|
64
62
|
"peerDependencies": {
|
|
65
|
-
"react": "^
|
|
66
|
-
"react-dom": "^
|
|
63
|
+
"react": "^19.2.0",
|
|
64
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
67
65
|
},
|
|
68
66
|
"dependencies": {
|
|
69
67
|
"@babel/runtime": "^7.13.10",
|
|
@@ -71,20 +69,20 @@
|
|
|
71
69
|
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
|
72
70
|
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
|
73
71
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
74
|
-
"@micromag/core": "^0.
|
|
75
|
-
"@micromag/data": "^0.
|
|
76
|
-
"@panneau/medias": "^
|
|
72
|
+
"@micromag/core": "^0.4.4",
|
|
73
|
+
"@micromag/data": "^0.4.4",
|
|
74
|
+
"@panneau/medias": "^4.0.18",
|
|
77
75
|
"bootstrap": "^5.3.7",
|
|
78
76
|
"classnames": "^2.2.6",
|
|
79
|
-
"lodash": "^4.17.
|
|
77
|
+
"lodash": "^4.17.23",
|
|
80
78
|
"pretty-bytes": "^6.1.1",
|
|
81
|
-
"
|
|
82
|
-
"react-intl": "^6.6.4",
|
|
79
|
+
"react-intl": "^8.1.3",
|
|
83
80
|
"wouter": "^3.0.0"
|
|
84
81
|
},
|
|
85
82
|
"publishConfig": {
|
|
86
83
|
"access": "public",
|
|
87
84
|
"registry": "https://registry.npmjs.org/"
|
|
88
85
|
},
|
|
89
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "04b8519c3a3ddace5a21497e22faa11865d57f6d",
|
|
87
|
+
"types": "es/index.d.ts"
|
|
90
88
|
}
|
package/scss/styles.scss
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import '~@micromag/media-gallery/assets/css/styles.css';
|