@tradly/asset 1.0.14 → 1.0.16
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 +172 -15
- package/dist/esm/index.js +3 -0
- package/dist/esm/native/FileUpload.native.js +35 -23
- package/dist/esm/native/MediaGallery.native.js +17 -10
- package/dist/esm/native/MediaPopup.native.js +44 -23
- package/dist/esm/native/MediaTab.native.js +66 -41
- package/dist/esm/native/Pagination.native.js +43 -19
- package/dist/esm/native/THEME_EXAMPLE.js +112 -0
- package/dist/esm/native/VideosGallery.native.js +14 -7
- package/dist/esm/native/theme.js +167 -0
- package/dist/index.js +14 -0
- package/dist/native/FileUpload.native.js +35 -23
- package/dist/native/MediaGallery.native.js +17 -10
- package/dist/native/MediaPopup.native.js +44 -23
- package/dist/native/MediaTab.native.js +62 -37
- package/dist/native/Pagination.native.js +43 -19
- package/dist/native/THEME_EXAMPLE.js +117 -0
- package/dist/native/VideosGallery.native.js +14 -7
- package/dist/native/theme.js +173 -0
- package/package.json +2 -2
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
/**
|
|
8
|
+
* Theme configuration for React Native Media Gallery
|
|
9
|
+
* Provides easy customization for dark/light mode and brand colors
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export var createTheme = function createTheme() {
|
|
13
|
+
var customTheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14
|
+
var isDark = customTheme.mode === "dark";
|
|
15
|
+
|
|
16
|
+
// Default light theme
|
|
17
|
+
var defaultLightTheme = {
|
|
18
|
+
mode: "light",
|
|
19
|
+
// Colors
|
|
20
|
+
colors: {
|
|
21
|
+
// Primary colors
|
|
22
|
+
primary: "#3B3269",
|
|
23
|
+
primaryLight: "#5A4A8A",
|
|
24
|
+
primaryDark: "#2A1F4A",
|
|
25
|
+
// Background colors
|
|
26
|
+
background: "#FFFFFF",
|
|
27
|
+
backgroundSecondary: "#F5F5F5",
|
|
28
|
+
backgroundTertiary: "#E5E5E5",
|
|
29
|
+
// Text colors
|
|
30
|
+
text: "#000000",
|
|
31
|
+
textSecondary: "#4F4F4F",
|
|
32
|
+
textTertiary: "#6B7280",
|
|
33
|
+
textInverse: "#FFFFFF",
|
|
34
|
+
// Border colors
|
|
35
|
+
border: "#E5E5E5",
|
|
36
|
+
borderLight: "#F0F0F0",
|
|
37
|
+
borderDark: "#D1D5DB",
|
|
38
|
+
// Overlay
|
|
39
|
+
overlay: "rgba(0, 0, 0, 0.5)",
|
|
40
|
+
// Tab colors
|
|
41
|
+
tabActive: "#3B3269",
|
|
42
|
+
tabInactive: "#4F4F4F",
|
|
43
|
+
tabIndicator: "#3B3269",
|
|
44
|
+
tabBackground: "#FFFFFF",
|
|
45
|
+
// Image/Video item
|
|
46
|
+
itemBackground: "#FFFFFF",
|
|
47
|
+
itemShadow: "#000000",
|
|
48
|
+
// Pagination
|
|
49
|
+
paginationBackground: "#F5F5F5",
|
|
50
|
+
paginationButton: "#FFFFFF",
|
|
51
|
+
paginationButtonActive: "#3B3269",
|
|
52
|
+
paginationText: "#6B7280",
|
|
53
|
+
paginationTextActive: "#FFFFFF",
|
|
54
|
+
paginationBorder: "#D1D5DB",
|
|
55
|
+
// Upload button
|
|
56
|
+
uploadBorder: "#3B3269",
|
|
57
|
+
uploadBackground: "#FFFFFF",
|
|
58
|
+
uploadIconBackground: "#3B3269",
|
|
59
|
+
uploadText: "#000000",
|
|
60
|
+
// Loading
|
|
61
|
+
loadingBackground: "#E5E5E5",
|
|
62
|
+
loadingText: "#666666"
|
|
63
|
+
},
|
|
64
|
+
// Spacing
|
|
65
|
+
spacing: {
|
|
66
|
+
xs: 4,
|
|
67
|
+
sm: 8,
|
|
68
|
+
md: 12,
|
|
69
|
+
lg: 16,
|
|
70
|
+
xl: 20,
|
|
71
|
+
xxl: 24
|
|
72
|
+
},
|
|
73
|
+
// Border radius
|
|
74
|
+
radius: {
|
|
75
|
+
sm: 6,
|
|
76
|
+
md: 8,
|
|
77
|
+
lg: 12,
|
|
78
|
+
xl: 16,
|
|
79
|
+
xxl: 20
|
|
80
|
+
},
|
|
81
|
+
// Typography
|
|
82
|
+
typography: {
|
|
83
|
+
title: {
|
|
84
|
+
fontSize: 24,
|
|
85
|
+
fontWeight: "bold"
|
|
86
|
+
},
|
|
87
|
+
subtitle: {
|
|
88
|
+
fontSize: 18,
|
|
89
|
+
fontWeight: "600"
|
|
90
|
+
},
|
|
91
|
+
body: {
|
|
92
|
+
fontSize: 16,
|
|
93
|
+
fontWeight: "500"
|
|
94
|
+
},
|
|
95
|
+
caption: {
|
|
96
|
+
fontSize: 14,
|
|
97
|
+
fontWeight: "400"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// Default dark theme
|
|
103
|
+
var defaultDarkTheme = {
|
|
104
|
+
mode: "dark",
|
|
105
|
+
colors: {
|
|
106
|
+
// Primary colors (can keep same or adjust)
|
|
107
|
+
primary: "#5A4A8A",
|
|
108
|
+
primaryLight: "#7A6AAA",
|
|
109
|
+
primaryDark: "#3B3269",
|
|
110
|
+
// Background colors
|
|
111
|
+
background: "#1A1A1A",
|
|
112
|
+
backgroundSecondary: "#2A2A2A",
|
|
113
|
+
backgroundTertiary: "#3A3A3A",
|
|
114
|
+
// Text colors
|
|
115
|
+
text: "#FFFFFF",
|
|
116
|
+
textSecondary: "#CCCCCC",
|
|
117
|
+
textTertiary: "#999999",
|
|
118
|
+
textInverse: "#000000",
|
|
119
|
+
// Border colors
|
|
120
|
+
border: "#3A3A3A",
|
|
121
|
+
borderLight: "#2A2A2A",
|
|
122
|
+
borderDark: "#4A4A4A",
|
|
123
|
+
// Overlay
|
|
124
|
+
overlay: "rgba(0, 0, 0, 0.7)",
|
|
125
|
+
// Tab colors
|
|
126
|
+
tabActive: "#7A6AAA",
|
|
127
|
+
tabInactive: "#CCCCCC",
|
|
128
|
+
tabIndicator: "#7A6AAA",
|
|
129
|
+
tabBackground: "#1A1A1A",
|
|
130
|
+
// Image/Video item
|
|
131
|
+
itemBackground: "#2A2A2A",
|
|
132
|
+
itemShadow: "#000000",
|
|
133
|
+
// Pagination
|
|
134
|
+
paginationBackground: "#2A2A2A",
|
|
135
|
+
paginationButton: "#1A1A1A",
|
|
136
|
+
paginationButtonActive: "#5A4A8A",
|
|
137
|
+
paginationText: "#CCCCCC",
|
|
138
|
+
paginationTextActive: "#FFFFFF",
|
|
139
|
+
paginationBorder: "#3A3A3A",
|
|
140
|
+
// Upload button
|
|
141
|
+
uploadBorder: "#5A4A8A",
|
|
142
|
+
uploadBackground: "#1A1A1A",
|
|
143
|
+
uploadIconBackground: "#5A4A8A",
|
|
144
|
+
uploadText: "#FFFFFF",
|
|
145
|
+
// Loading
|
|
146
|
+
loadingBackground: "#2A2A2A",
|
|
147
|
+
loadingText: "#999999"
|
|
148
|
+
},
|
|
149
|
+
spacing: defaultLightTheme.spacing,
|
|
150
|
+
radius: defaultLightTheme.radius,
|
|
151
|
+
typography: defaultLightTheme.typography
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// Merge custom theme with defaults
|
|
155
|
+
var baseTheme = isDark ? defaultDarkTheme : defaultLightTheme;
|
|
156
|
+
return _objectSpread(_objectSpread({}, baseTheme), {}, {
|
|
157
|
+
colors: _objectSpread(_objectSpread({}, baseTheme.colors), customTheme.colors || {}),
|
|
158
|
+
spacing: _objectSpread(_objectSpread({}, baseTheme.spacing), customTheme.spacing || {}),
|
|
159
|
+
radius: _objectSpread(_objectSpread({}, baseTheme.radius), customTheme.radius || {}),
|
|
160
|
+
typography: _objectSpread(_objectSpread({}, baseTheme.typography), customTheme.typography || {}),
|
|
161
|
+
// Bottom sheet height (0.85 = 85% of screen, 0.9 = 90%, etc.)
|
|
162
|
+
bottomSheetHeight: customTheme.bottomSheetHeight || 0.9
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// Export default light theme
|
|
167
|
+
export var defaultTheme = createTheme();
|
package/dist/index.js
CHANGED
|
@@ -39,13 +39,26 @@ Object.defineProperty(exports, "VideosGallery", {
|
|
|
39
39
|
return _VideosGallery.default;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "createTheme", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _theme.createTheme;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
42
48
|
exports.default = void 0;
|
|
49
|
+
Object.defineProperty(exports, "defaultTheme", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function get() {
|
|
52
|
+
return _theme.defaultTheme;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
43
55
|
var _MediaPopup = _interopRequireDefault(require("./components/MediaPopup"));
|
|
44
56
|
var _MediaTab = _interopRequireDefault(require("./components/MediaTab"));
|
|
45
57
|
var _MediaGallery = _interopRequireDefault(require("./components/MediaGallery"));
|
|
46
58
|
var _VideosGallery = _interopRequireDefault(require("./components/VideosGallery"));
|
|
47
59
|
var _FileUpload = _interopRequireDefault(require("./components/FileUpload"));
|
|
48
60
|
var _MediaApiService = _interopRequireDefault(require("./core/MediaApiService"));
|
|
61
|
+
var _theme = require("./native/theme");
|
|
49
62
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
50
63
|
/**
|
|
51
64
|
* @tradly/asset
|
|
@@ -56,5 +69,6 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
56
69
|
// Export main component
|
|
57
70
|
// Export sub-components for advanced usage
|
|
58
71
|
// Export API service
|
|
72
|
+
// Export React Native theme utilities
|
|
59
73
|
// Export default as MediaPopup for convenience
|
|
60
74
|
var _default = exports.default = _MediaPopup.default;
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
10
|
var _Icons = require("./Icons.native");
|
|
11
|
+
var _theme = require("./theme");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
|
|
13
14
|
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
@@ -84,6 +85,8 @@ var FileUpload = function FileUpload(_ref) {
|
|
|
84
85
|
onUploadError = _ref.onUploadError,
|
|
85
86
|
picker = _ref.picker,
|
|
86
87
|
pickerOptions = _ref.pickerOptions,
|
|
88
|
+
_ref$theme = _ref.theme,
|
|
89
|
+
theme = _ref$theme === void 0 ? _theme.defaultTheme : _ref$theme,
|
|
87
90
|
containerStyle = _ref.containerStyle,
|
|
88
91
|
buttonStyle = _ref.buttonStyle,
|
|
89
92
|
iconContainerStyle = _ref.iconContainerStyle,
|
|
@@ -233,12 +236,18 @@ var FileUpload = function FileUpload(_ref) {
|
|
|
233
236
|
}();
|
|
234
237
|
if (isLoading) {
|
|
235
238
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
236
|
-
style: [styles.loadingContainer,
|
|
239
|
+
style: [styles.loadingContainer, {
|
|
240
|
+
backgroundColor: theme.colors.loadingBackground,
|
|
241
|
+
borderRadius: theme.radius.md
|
|
242
|
+
}, loadingStyle],
|
|
237
243
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
238
244
|
size: "small",
|
|
239
|
-
color:
|
|
245
|
+
color: theme.colors.primary
|
|
240
246
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
241
|
-
style: styles.loadingText,
|
|
247
|
+
style: [styles.loadingText, {
|
|
248
|
+
color: theme.colors.loadingText,
|
|
249
|
+
marginTop: theme.spacing.sm
|
|
250
|
+
}],
|
|
242
251
|
children: "Uploading..."
|
|
243
252
|
})]
|
|
244
253
|
});
|
|
@@ -247,13 +256,26 @@ var FileUpload = function FileUpload(_ref) {
|
|
|
247
256
|
style: [styles.container, containerStyle],
|
|
248
257
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
249
258
|
onPress: handlePickFile,
|
|
250
|
-
style: [styles.button,
|
|
259
|
+
style: [styles.button, {
|
|
260
|
+
borderColor: theme.colors.uploadBorder,
|
|
261
|
+
backgroundColor: theme.colors.uploadBackground,
|
|
262
|
+
borderRadius: theme.radius.md
|
|
263
|
+
}, buttonStyle],
|
|
251
264
|
disabled: isLoading,
|
|
252
265
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
253
|
-
style: [styles.iconContainer,
|
|
266
|
+
style: [styles.iconContainer, {
|
|
267
|
+
backgroundColor: theme.colors.uploadIconBackground,
|
|
268
|
+
borderRadius: theme.radius.xl,
|
|
269
|
+
marginBottom: theme.spacing.sm,
|
|
270
|
+
padding: theme.spacing.md
|
|
271
|
+
}, iconContainerStyle],
|
|
254
272
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icons.CameraIcon, {})
|
|
255
273
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
256
|
-
style: [styles.title,
|
|
274
|
+
style: [styles.title, {
|
|
275
|
+
color: theme.colors.uploadText,
|
|
276
|
+
marginTop: theme.spacing.sm,
|
|
277
|
+
fontSize: theme.typography.caption.fontSize
|
|
278
|
+
}, titleStyle],
|
|
257
279
|
children: title
|
|
258
280
|
})]
|
|
259
281
|
})
|
|
@@ -271,34 +293,24 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
271
293
|
justifyContent: "center",
|
|
272
294
|
alignItems: "center",
|
|
273
295
|
borderWidth: 1,
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
borderRadius: 8,
|
|
277
|
-
backgroundColor: "#FFFFFF"
|
|
296
|
+
borderStyle: "dashed"
|
|
297
|
+
// Colors applied via theme
|
|
278
298
|
},
|
|
279
299
|
iconContainer: {
|
|
280
|
-
|
|
281
|
-
backgroundColor: "#3B3269",
|
|
282
|
-
borderRadius: 20,
|
|
283
|
-
marginBottom: 8
|
|
300
|
+
// Colors and spacing applied via theme
|
|
284
301
|
},
|
|
285
302
|
title: {
|
|
286
|
-
|
|
287
|
-
color: "#000000",
|
|
288
|
-
marginTop: 8
|
|
303
|
+
// Colors and typography applied via theme
|
|
289
304
|
},
|
|
290
305
|
loadingContainer: {
|
|
291
306
|
width: "100%",
|
|
292
307
|
height: 160,
|
|
293
308
|
justifyContent: "center",
|
|
294
|
-
alignItems: "center"
|
|
295
|
-
|
|
296
|
-
borderRadius: 8
|
|
309
|
+
alignItems: "center"
|
|
310
|
+
// Colors applied via theme
|
|
297
311
|
},
|
|
298
312
|
loadingText: {
|
|
299
|
-
|
|
300
|
-
fontSize: 14,
|
|
301
|
-
color: "#666666"
|
|
313
|
+
// Colors applied via theme
|
|
302
314
|
}
|
|
303
315
|
});
|
|
304
316
|
var _default = exports.default = FileUpload;
|
|
@@ -10,6 +10,7 @@ var _reactNative = require("react-native");
|
|
|
10
10
|
var _FileUpload = _interopRequireDefault(require("./FileUpload.native"));
|
|
11
11
|
var _ImagesSkeleton = _interopRequireDefault(require("./ImagesSkeleton.native"));
|
|
12
12
|
var _Pagination = _interopRequireDefault(require("./Pagination.native"));
|
|
13
|
+
var _theme = require("./theme");
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
@@ -41,6 +42,8 @@ var ImagesGallery = function ImagesGallery(_ref) {
|
|
|
41
42
|
onError = _ref.onError,
|
|
42
43
|
picker = _ref.picker,
|
|
43
44
|
pickerOptions = _ref.pickerOptions,
|
|
45
|
+
_ref$theme = _ref.theme,
|
|
46
|
+
theme = _ref$theme === void 0 ? _theme.defaultTheme : _ref$theme,
|
|
44
47
|
containerStyle = _ref.containerStyle,
|
|
45
48
|
gridStyle = _ref.gridStyle,
|
|
46
49
|
imageItemStyle = _ref.imageItemStyle,
|
|
@@ -139,7 +142,8 @@ var ImagesGallery = function ImagesGallery(_ref) {
|
|
|
139
142
|
apiService: apiService,
|
|
140
143
|
onUploadError: onError,
|
|
141
144
|
picker: picker,
|
|
142
|
-
pickerOptions: pickerOptions
|
|
145
|
+
pickerOptions: pickerOptions,
|
|
146
|
+
theme: theme
|
|
143
147
|
})
|
|
144
148
|
});
|
|
145
149
|
}
|
|
@@ -152,7 +156,9 @@ var ImagesGallery = function ImagesGallery(_ref) {
|
|
|
152
156
|
},
|
|
153
157
|
style: [styles.imageItem, {
|
|
154
158
|
width: ITEM_SIZE,
|
|
155
|
-
height: ITEM_SIZE
|
|
159
|
+
height: ITEM_SIZE,
|
|
160
|
+
backgroundColor: theme.colors.itemBackground,
|
|
161
|
+
shadowColor: theme.colors.itemShadow
|
|
156
162
|
}, imageItemStyle],
|
|
157
163
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
158
164
|
source: {
|
|
@@ -180,13 +186,19 @@ var ImagesGallery = function ImagesGallery(_ref) {
|
|
|
180
186
|
contentContainerStyle: [styles.grid, gridStyle],
|
|
181
187
|
showsVerticalScrollIndicator: false,
|
|
182
188
|
ListFooterComponent: total_count > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
183
|
-
style: [styles.paginationContainer,
|
|
189
|
+
style: [styles.paginationContainer, {
|
|
190
|
+
backgroundColor: theme.colors.paginationBackground,
|
|
191
|
+
paddingVertical: theme.spacing.lg,
|
|
192
|
+
paddingHorizontal: theme.spacing.sm,
|
|
193
|
+
marginTop: theme.spacing.sm
|
|
194
|
+
}, paginationContainerStyle],
|
|
184
195
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pagination.default, {
|
|
185
196
|
nextPage: function nextPage(value) {
|
|
186
197
|
return loadMedia(value);
|
|
187
198
|
},
|
|
188
199
|
pageCount: Math.ceil(total_count / 30),
|
|
189
|
-
current_page: currentPage
|
|
200
|
+
current_page: currentPage,
|
|
201
|
+
theme: theme
|
|
190
202
|
})
|
|
191
203
|
}) : null
|
|
192
204
|
})
|
|
@@ -206,8 +218,6 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
206
218
|
margin: ITEM_MARGIN,
|
|
207
219
|
borderRadius: 8,
|
|
208
220
|
overflow: 'hidden',
|
|
209
|
-
backgroundColor: '#FFFFFF',
|
|
210
|
-
shadowColor: '#000',
|
|
211
221
|
shadowOffset: {
|
|
212
222
|
width: 0,
|
|
213
223
|
height: 2
|
|
@@ -221,10 +231,7 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
221
231
|
height: '100%'
|
|
222
232
|
},
|
|
223
233
|
paginationContainer: {
|
|
224
|
-
|
|
225
|
-
paddingHorizontal: 8,
|
|
226
|
-
backgroundColor: '#F5F5F5',
|
|
227
|
-
marginTop: 8
|
|
234
|
+
// Styles applied via theme
|
|
228
235
|
}
|
|
229
236
|
});
|
|
230
237
|
var _default = exports.default = ImagesGallery;
|
|
@@ -8,6 +8,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _MediaTab = _interopRequireDefault(require("./MediaTab.native"));
|
|
10
10
|
var _Icons = require("./Icons.native");
|
|
11
|
+
var _theme = require("./theme");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
14
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
@@ -31,10 +32,18 @@ var MediaPopup = function MediaPopup(_ref) {
|
|
|
31
32
|
title = _ref$title === void 0 ? 'Media Gallery' : _ref$title,
|
|
32
33
|
picker = _ref.picker,
|
|
33
34
|
pickerOptions = _ref.pickerOptions,
|
|
35
|
+
theme = _ref.theme,
|
|
36
|
+
overlayStyle = _ref.overlayStyle,
|
|
34
37
|
containerStyle = _ref.containerStyle,
|
|
35
38
|
headerStyle = _ref.headerStyle,
|
|
36
39
|
titleStyle = _ref.titleStyle,
|
|
37
|
-
closeButtonStyle = _ref.closeButtonStyle
|
|
40
|
+
closeButtonStyle = _ref.closeButtonStyle,
|
|
41
|
+
closeButtonTextStyle = _ref.closeButtonTextStyle,
|
|
42
|
+
bottomSheetHeight = _ref.bottomSheetHeight;
|
|
43
|
+
var currentTheme = _react.default.useMemo(function () {
|
|
44
|
+
return (0, _theme.createTheme)(theme);
|
|
45
|
+
}, [theme]);
|
|
46
|
+
var sheetHeight = bottomSheetHeight || currentTheme.bottomSheetHeight || 0.9;
|
|
38
47
|
var _React$useState = _react.default.useState(new _reactNative.Animated.Value(SCREEN_HEIGHT)),
|
|
39
48
|
_React$useState2 = _slicedToArray(_React$useState, 1),
|
|
40
49
|
slideAnim = _React$useState2[0];
|
|
@@ -73,18 +82,35 @@ var MediaPopup = function MediaPopup(_ref) {
|
|
|
73
82
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback, {
|
|
74
83
|
onPress: handleClose,
|
|
75
84
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
76
|
-
style: styles.overlay,
|
|
85
|
+
style: [styles.overlay, {
|
|
86
|
+
backgroundColor: currentTheme.colors.overlay
|
|
87
|
+
}, overlayStyle],
|
|
77
88
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback, {
|
|
78
89
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
|
|
79
|
-
style: [styles.container,
|
|
90
|
+
style: [styles.container, {
|
|
91
|
+
backgroundColor: currentTheme.colors.background,
|
|
92
|
+
borderTopLeftRadius: currentTheme.radius.xxl,
|
|
93
|
+
borderTopRightRadius: currentTheme.radius.xxl,
|
|
94
|
+
height: SCREEN_HEIGHT * sheetHeight,
|
|
95
|
+
maxHeight: SCREEN_HEIGHT * sheetHeight,
|
|
96
|
+
padding: currentTheme.spacing.xl
|
|
97
|
+
}, containerStyle, {
|
|
80
98
|
transform: [{
|
|
81
99
|
translateY: slideAnim
|
|
82
100
|
}]
|
|
83
101
|
}],
|
|
84
102
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
85
|
-
style: [styles.header,
|
|
103
|
+
style: [styles.header, {
|
|
104
|
+
borderBottomColor: currentTheme.colors.border,
|
|
105
|
+
marginBottom: currentTheme.spacing.lg,
|
|
106
|
+
paddingBottom: currentTheme.spacing.md
|
|
107
|
+
}, headerStyle],
|
|
86
108
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
87
|
-
style: [styles.title,
|
|
109
|
+
style: [styles.title, {
|
|
110
|
+
fontSize: currentTheme.typography.title.fontSize,
|
|
111
|
+
fontWeight: currentTheme.typography.title.fontWeight,
|
|
112
|
+
color: currentTheme.colors.text
|
|
113
|
+
}, titleStyle],
|
|
88
114
|
children: title
|
|
89
115
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
90
116
|
onPress: handleClose,
|
|
@@ -95,7 +121,10 @@ var MediaPopup = function MediaPopup(_ref) {
|
|
|
95
121
|
left: 10,
|
|
96
122
|
right: 10
|
|
97
123
|
},
|
|
98
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icons.CloseIcon, {
|
|
124
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icons.CloseIcon, {
|
|
125
|
+
size: 24,
|
|
126
|
+
color: currentTheme.colors.text
|
|
127
|
+
})
|
|
99
128
|
})]
|
|
100
129
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MediaTab.default, {
|
|
101
130
|
imagePopup: isOpen,
|
|
@@ -106,7 +135,8 @@ var MediaPopup = function MediaPopup(_ref) {
|
|
|
106
135
|
apiService: apiService,
|
|
107
136
|
onError: onError,
|
|
108
137
|
picker: picker,
|
|
109
|
-
pickerOptions: pickerOptions
|
|
138
|
+
pickerOptions: pickerOptions,
|
|
139
|
+
theme: currentTheme
|
|
110
140
|
})]
|
|
111
141
|
})
|
|
112
142
|
})
|
|
@@ -117,16 +147,10 @@ var MediaPopup = function MediaPopup(_ref) {
|
|
|
117
147
|
var styles = _reactNative.StyleSheet.create({
|
|
118
148
|
overlay: {
|
|
119
149
|
flex: 1,
|
|
120
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
121
150
|
justifyContent: 'flex-end'
|
|
122
151
|
},
|
|
123
152
|
container: {
|
|
124
|
-
|
|
125
|
-
borderTopLeftRadius: 20,
|
|
126
|
-
borderTopRightRadius: 20,
|
|
127
|
-
maxHeight: SCREEN_HEIGHT * 0.85,
|
|
128
|
-
minHeight: 200,
|
|
129
|
-
padding: 20,
|
|
153
|
+
width: '100%',
|
|
130
154
|
shadowColor: '#000',
|
|
131
155
|
shadowOffset: {
|
|
132
156
|
width: 0,
|
|
@@ -134,25 +158,22 @@ var styles = _reactNative.StyleSheet.create({
|
|
|
134
158
|
},
|
|
135
159
|
shadowOpacity: 0.25,
|
|
136
160
|
shadowRadius: 3.84,
|
|
137
|
-
elevation: 5
|
|
161
|
+
elevation: 5,
|
|
162
|
+
overflow: 'hidden' // Ensure content doesn't overflow
|
|
138
163
|
},
|
|
139
164
|
header: {
|
|
140
165
|
flexDirection: 'row',
|
|
141
166
|
alignItems: 'center',
|
|
142
167
|
justifyContent: 'space-between',
|
|
143
|
-
|
|
144
|
-
paddingBottom: 12,
|
|
145
|
-
borderBottomWidth: 1,
|
|
146
|
-
borderBottomColor: '#E5E5E5'
|
|
168
|
+
borderBottomWidth: 1
|
|
147
169
|
},
|
|
148
170
|
title: {
|
|
149
|
-
|
|
150
|
-
fontWeight: 'bold',
|
|
151
|
-
color: '#000000'
|
|
171
|
+
flex: 1
|
|
152
172
|
},
|
|
153
173
|
closeButton: {
|
|
154
174
|
padding: 8,
|
|
155
|
-
borderRadius: 20
|
|
175
|
+
borderRadius: 20,
|
|
176
|
+
marginLeft: 12
|
|
156
177
|
}
|
|
157
178
|
});
|
|
158
179
|
var _default = exports.default = MediaPopup;
|