@plusscommunities/pluss-core-app 8.0.27 → 8.0.28
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/package.json +1 -1
- package/src/components/react-native-expo-image-cropper/ExpoImageManipulator.js +21 -22
- package/dist/module/actions/FollowerActions.js +0 -34
- package/dist/module/actions/FollowerActions.js.map +0 -1
- package/dist/module/actions/MediaActions.js +0 -29
- package/dist/module/actions/MediaActions.js.map +0 -1
- package/dist/module/actions/ResidentActions.js +0 -26
- package/dist/module/actions/ResidentActions.js.map +0 -1
- package/dist/module/actions/UserActions.js +0 -223
- package/dist/module/actions/UserActions.js.map +0 -1
- package/dist/module/actions/UserSettingsActions.js +0 -14
- package/dist/module/actions/UserSettingsActions.js.map +0 -1
- package/dist/module/actions/index.js +0 -6
- package/dist/module/actions/index.js.map +0 -1
- package/dist/module/actions/types.js +0 -17
- package/dist/module/actions/types.js.map +0 -1
- package/dist/module/apis/analyticsActions.js +0 -20
- package/dist/module/apis/analyticsActions.js.map +0 -1
- package/dist/module/apis/contactActions.js +0 -27
- package/dist/module/apis/contactActions.js.map +0 -1
- package/dist/module/apis/eventActions.js +0 -161
- package/dist/module/apis/eventActions.js.map +0 -1
- package/dist/module/apis/fileActions.js +0 -93
- package/dist/module/apis/fileActions.js.map +0 -1
- package/dist/module/apis/followerActions.js +0 -38
- package/dist/module/apis/followerActions.js.map +0 -1
- package/dist/module/apis/index.js +0 -13
- package/dist/module/apis/index.js.map +0 -1
- package/dist/module/apis/notificationActions.js +0 -60
- package/dist/module/apis/notificationActions.js.map +0 -1
- package/dist/module/apis/profileActions.js +0 -14
- package/dist/module/apis/profileActions.js.map +0 -1
- package/dist/module/apis/reactionActions.js +0 -76
- package/dist/module/apis/reactionActions.js.map +0 -1
- package/dist/module/apis/settingActions.js +0 -22
- package/dist/module/apis/settingActions.js.map +0 -1
- package/dist/module/apis/stringActions.js +0 -30
- package/dist/module/apis/stringActions.js.map +0 -1
- package/dist/module/apis/typeActions.js +0 -15
- package/dist/module/apis/typeActions.js.map +0 -1
- package/dist/module/apis/userActions.js +0 -104
- package/dist/module/apis/userActions.js.map +0 -1
- package/dist/module/assets/icons/fontawesome/fa-brands-400.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-light-300.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-regular-400.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-solid-900.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa-thin-100.ttf +0 -0
- package/dist/module/assets/icons/fontawesome/fa7-glyphmap.json +0 -4205
- package/dist/module/assets/icons/reactions/heart.png +0 -0
- package/dist/module/assets/icons/reactions/party.png +0 -0
- package/dist/module/assets/icons/reactions/sad.png +0 -0
- package/dist/module/assets/icons/reactions/smile.png +0 -0
- package/dist/module/colours.js +0 -165
- package/dist/module/colours.js.map +0 -1
- package/dist/module/components/AddButton.js +0 -43
- package/dist/module/components/AddButton.js.map +0 -1
- package/dist/module/components/AddToCalendarButton.js +0 -225
- package/dist/module/components/AddToCalendarButton.js.map +0 -1
- package/dist/module/components/Attachment.js +0 -55
- package/dist/module/components/Attachment.js.map +0 -1
- package/dist/module/components/AudienceSelectorLauncher.js +0 -64
- package/dist/module/components/AudienceSelectorLauncher.js.map +0 -1
- package/dist/module/components/AudienceSelectorPage.js +0 -351
- package/dist/module/components/AudienceSelectorPage.js.map +0 -1
- package/dist/module/components/AutoOffsetImage.js +0 -184
- package/dist/module/components/AutoOffsetImage.js.map +0 -1
- package/dist/module/components/BackButton.js +0 -58
- package/dist/module/components/BackButton.js.map +0 -1
- package/dist/module/components/CalendarPopup.js +0 -126
- package/dist/module/components/CalendarPopup.js.map +0 -1
- package/dist/module/components/CategoryTabs.js +0 -155
- package/dist/module/components/CategoryTabs.js.map +0 -1
- package/dist/module/components/CommentReply.js +0 -334
- package/dist/module/components/CommentReply.js.map +0 -1
- package/dist/module/components/CommentSection.js +0 -823
- package/dist/module/components/CommentSection.js.map +0 -1
- package/dist/module/components/ConfirmPopup.js +0 -109
- package/dist/module/components/ConfirmPopup.js.map +0 -1
- package/dist/module/components/ConfirmationPopup.js +0 -72
- package/dist/module/components/ConfirmationPopup.js.map +0 -1
- package/dist/module/components/DocumentUploader.js +0 -253
- package/dist/module/components/DocumentUploader.js.map +0 -1
- package/dist/module/components/DropDownItem.js +0 -75
- package/dist/module/components/DropDownItem.js.map +0 -1
- package/dist/module/components/DropDownMenu.js +0 -41
- package/dist/module/components/DropDownMenu.js.map +0 -1
- package/dist/module/components/EmptyStateMain.js +0 -51
- package/dist/module/components/EmptyStateMain.js.map +0 -1
- package/dist/module/components/EmptyStateWidget.js +0 -48
- package/dist/module/components/EmptyStateWidget.js.map +0 -1
- package/dist/module/components/FontScaleButton.js +0 -37
- package/dist/module/components/FontScaleButton.js.map +0 -1
- package/dist/module/components/FontScalePopup.js +0 -76
- package/dist/module/components/FontScalePopup.js.map +0 -1
- package/dist/module/components/Forbidden.js +0 -58
- package/dist/module/components/Forbidden.js.map +0 -1
- package/dist/module/components/FormCard.js +0 -25
- package/dist/module/components/FormCard.js.map +0 -1
- package/dist/module/components/FormCardSection.js +0 -214
- package/dist/module/components/FormCardSection.js.map +0 -1
- package/dist/module/components/FormCardSectionOptionLauncher.js +0 -73
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +0 -1
- package/dist/module/components/FormattedText.js +0 -133
- package/dist/module/components/FormattedText.js.map +0 -1
- package/dist/module/components/GenericInput.js +0 -151
- package/dist/module/components/GenericInput.js.map +0 -1
- package/dist/module/components/GenericInputSection.js +0 -173
- package/dist/module/components/GenericInputSection.js.map +0 -1
- package/dist/module/components/Header.js +0 -459
- package/dist/module/components/Header.js.map +0 -1
- package/dist/module/components/Icon.js +0 -109
- package/dist/module/components/Icon.js.map +0 -1
- package/dist/module/components/ImagePopup.js +0 -400
- package/dist/module/components/ImagePopup.js.map +0 -1
- package/dist/module/components/ImageUploadProgress.js +0 -69
- package/dist/module/components/ImageUploadProgress.js.map +0 -1
- package/dist/module/components/ImageUploader.js +0 -831
- package/dist/module/components/ImageUploader.js.map +0 -1
- package/dist/module/components/InlineButton.js +0 -66
- package/dist/module/components/InlineButton.js.map +0 -1
- package/dist/module/components/Input.js +0 -156
- package/dist/module/components/Input.js.map +0 -1
- package/dist/module/components/LoadingCircles.js +0 -219
- package/dist/module/components/LoadingCircles.js.map +0 -1
- package/dist/module/components/LoadingIndicator.js +0 -86
- package/dist/module/components/LoadingIndicator.js.map +0 -1
- package/dist/module/components/LoadingStateWidget.js +0 -46
- package/dist/module/components/LoadingStateWidget.js.map +0 -1
- package/dist/module/components/MediaPlayer.js +0 -407
- package/dist/module/components/MediaPlayer.js.map +0 -1
- package/dist/module/components/MiddlePopup.js +0 -49
- package/dist/module/components/MiddlePopup.js.map +0 -1
- package/dist/module/components/PDFPopup.js +0 -203
- package/dist/module/components/PDFPopup.js.map +0 -1
- package/dist/module/components/PlussChat.js +0 -1078
- package/dist/module/components/PlussChat.js.map +0 -1
- package/dist/module/components/PlussChatMessage.js +0 -299
- package/dist/module/components/PlussChatMessage.js.map +0 -1
- package/dist/module/components/PlussChatTime.js +0 -59
- package/dist/module/components/PlussChatTime.js.map +0 -1
- package/dist/module/components/Popup.js +0 -126
- package/dist/module/components/Popup.js.map +0 -1
- package/dist/module/components/PopupMenu.js +0 -120
- package/dist/module/components/PopupMenu.js.map +0 -1
- package/dist/module/components/PositionedImage.js +0 -313
- package/dist/module/components/PositionedImage.js.map +0 -1
- package/dist/module/components/ProfilePic.js +0 -105
- package/dist/module/components/ProfilePic.js.map +0 -1
- package/dist/module/components/RadioButton.js +0 -78
- package/dist/module/components/RadioButton.js.map +0 -1
- package/dist/module/components/Reaction.js +0 -117
- package/dist/module/components/Reaction.js.map +0 -1
- package/dist/module/components/Reactions.js +0 -71
- package/dist/module/components/Reactions.js.map +0 -1
- package/dist/module/components/SharingTools.js +0 -189
- package/dist/module/components/SharingTools.js.map +0 -1
- package/dist/module/components/Spinner.js +0 -22
- package/dist/module/components/Spinner.js.map +0 -1
- package/dist/module/components/StickyFooter.js +0 -34
- package/dist/module/components/StickyFooter.js.map +0 -1
- package/dist/module/components/Text.js +0 -57
- package/dist/module/components/Text.js.map +0 -1
- package/dist/module/components/TickIcon.js +0 -24
- package/dist/module/components/TickIcon.js.map +0 -1
- package/dist/module/components/Toggle.js +0 -66
- package/dist/module/components/Toggle.js.map +0 -1
- package/dist/module/components/TouchableSearchBar.js +0 -68
- package/dist/module/components/TouchableSearchBar.js.map +0 -1
- package/dist/module/components/UserListPopup.js +0 -136
- package/dist/module/components/UserListPopup.js.map +0 -1
- package/dist/module/components/UserListing.js +0 -268
- package/dist/module/components/UserListing.js.map +0 -1
- package/dist/module/components/VideoPopup.js +0 -113
- package/dist/module/components/VideoPopup.js.map +0 -1
- package/dist/module/components/WarningPopup.js +0 -85
- package/dist/module/components/WarningPopup.js.map +0 -1
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +0 -289
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +0 -1
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js +0 -117
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +0 -1
- package/dist/module/components/index.js +0 -60
- package/dist/module/components/index.js.map +0 -1
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +0 -415
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +0 -1
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +0 -387
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +0 -1
- package/dist/module/config.js +0 -27
- package/dist/module/config.js.map +0 -1
- package/dist/module/constants.js +0 -18
- package/dist/module/constants.js.map +0 -1
- package/dist/module/helper.js +0 -424
- package/dist/module/helper.js.map +0 -1
- package/dist/module/index.js +0 -13
- package/dist/module/index.js.map +0 -1
- package/dist/module/js/images/detectFaces.js +0 -31
- package/dist/module/js/images/detectFaces.js.map +0 -1
- package/dist/module/js/images/findLandmarkRange.js +0 -93
- package/dist/module/js/images/findLandmarkRange.js.map +0 -1
- package/dist/module/js/images/getScaledOffset.js +0 -81
- package/dist/module/js/images/getScaledOffset.js.map +0 -1
- package/dist/module/js/site/getSiteLevelFromState.js +0 -29
- package/dist/module/js/site/getSiteLevelFromState.js.map +0 -1
- package/dist/module/js/site/isTVEnabled.js +0 -10
- package/dist/module/js/site/isTVEnabled.js.map +0 -1
- package/dist/module/session.js +0 -58
- package/dist/module/session.js.map +0 -1
- package/dist/module/styles.js +0 -67
- package/dist/module/styles.js.map +0 -1
- package/dist/module/withNavigationFocus.js +0 -30
- package/dist/module/withNavigationFocus.js.map +0 -1
|
@@ -1,415 +0,0 @@
|
|
|
1
|
-
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; }
|
|
2
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
|
-
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); }
|
|
4
|
-
import React, { Component } from "react";
|
|
5
|
-
import { Text } from "@plusscommunities/pluss-core-app/components";
|
|
6
|
-
import { Dimensions, Image, ScrollView, Modal, View, TouchableOpacity, StyleSheet, Platform, LogBox, Alert } from "react-native";
|
|
7
|
-
import * as ImageManipulator from "expo-image-manipulator";
|
|
8
|
-
import * as MediaLibrary from "expo-media-library";
|
|
9
|
-
import { File, Paths } from "expo-file-system";
|
|
10
|
-
import PropTypes from "prop-types";
|
|
11
|
-
import AutoHeightImage from "react-native-auto-height-image";
|
|
12
|
-
import { withSafeAreaInsets, SafeAreaView } from "react-native-safe-area-context";
|
|
13
|
-
import ImageCropOverlay from "./ImageCropOverlay";
|
|
14
|
-
const {
|
|
15
|
-
width
|
|
16
|
-
} = Dimensions.get("window");
|
|
17
|
-
LogBox.ignoreLogs(["componentWillReceiveProps", "componentWillUpdate", "componentWillMount"]);
|
|
18
|
-
LogBox.ignoreLogs(["Warning: componentWillMount is deprecated", "Warning: componentWillReceiveProps is deprecated", "Module RCTImageLoader requires"]);
|
|
19
|
-
class ExpoImageManipulator extends Component {
|
|
20
|
-
constructor(props) {
|
|
21
|
-
super(props);
|
|
22
|
-
_defineProperty(this, "onToggleModal", () => {
|
|
23
|
-
this.props.onToggleModal();
|
|
24
|
-
this.setState({
|
|
25
|
-
cropMode: false
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
_defineProperty(this, "onCropImage", (callback = null) => {
|
|
29
|
-
this.setState({
|
|
30
|
-
processing: true
|
|
31
|
-
});
|
|
32
|
-
const {
|
|
33
|
-
uri
|
|
34
|
-
} = this.state;
|
|
35
|
-
Image.getSize(uri, async (actualWidth, actualHeight) => {
|
|
36
|
-
let cropObj = this.getCropBounds(actualWidth, actualHeight);
|
|
37
|
-
if (cropObj.height > 0 && cropObj.width > 0) {
|
|
38
|
-
let uriToCrop = uri;
|
|
39
|
-
const {
|
|
40
|
-
uri: uriCroped,
|
|
41
|
-
base64,
|
|
42
|
-
width: croppedWidth,
|
|
43
|
-
height: croppedHeight
|
|
44
|
-
} = await this.crop(cropObj, uriToCrop);
|
|
45
|
-
this.actualSize.width = croppedWidth;
|
|
46
|
-
this.actualSize.height = croppedHeight;
|
|
47
|
-
this.setState({
|
|
48
|
-
uri: uriCroped,
|
|
49
|
-
base64,
|
|
50
|
-
cropMode: false,
|
|
51
|
-
processing: false
|
|
52
|
-
}, () => {
|
|
53
|
-
if (callback) callback();
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
this.setState({
|
|
57
|
-
cropMode: false,
|
|
58
|
-
processing: false
|
|
59
|
-
}, () => {
|
|
60
|
-
if (callback) callback();
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
_defineProperty(this, "onHandleScroll", event => {
|
|
66
|
-
this.scrollOffset = event.nativeEvent.contentOffset.y;
|
|
67
|
-
});
|
|
68
|
-
_defineProperty(this, "getCropBounds", (actualWidth, actualHeight) => {
|
|
69
|
-
var _this$props$insets, _this$props$insets2;
|
|
70
|
-
let imageRatio = actualHeight / actualWidth;
|
|
71
|
-
const topInset = ((_this$props$insets = this.props.insets) === null || _this$props$insets === void 0 ? void 0 : _this$props$insets.top) ?? 0;
|
|
72
|
-
const bottomInset = ((_this$props$insets2 = this.props.insets) === null || _this$props$insets2 === void 0 ? void 0 : _this$props$insets2.bottom) ?? 0;
|
|
73
|
-
var originalHeight = Dimensions.get("window").height - topInset - bottomInset - 44;
|
|
74
|
-
let renderedImageWidth = imageRatio < originalHeight / width ? width : originalHeight / imageRatio;
|
|
75
|
-
let renderedImageHeight = imageRatio < originalHeight / width ? width * imageRatio : originalHeight;
|
|
76
|
-
let renderedImageY = (originalHeight - renderedImageHeight) / 2.0;
|
|
77
|
-
let renderedImageX = (width - renderedImageWidth) / 2.0;
|
|
78
|
-
const renderImageObj = {
|
|
79
|
-
left: renderedImageX,
|
|
80
|
-
top: renderedImageY,
|
|
81
|
-
width: renderedImageWidth,
|
|
82
|
-
height: renderedImageHeight
|
|
83
|
-
};
|
|
84
|
-
const cropOverlayObj = {
|
|
85
|
-
left: this.currentPos.left,
|
|
86
|
-
top: this.currentPos.top,
|
|
87
|
-
width: this.currentSize.width,
|
|
88
|
-
height: this.currentSize.height
|
|
89
|
-
};
|
|
90
|
-
var intersectAreaObj = {};
|
|
91
|
-
let x = Math.max(renderImageObj.left, cropOverlayObj.left);
|
|
92
|
-
let num1 = Math.min(renderImageObj.left + renderImageObj.width, cropOverlayObj.left + cropOverlayObj.width);
|
|
93
|
-
let y = Math.max(renderImageObj.top, cropOverlayObj.top);
|
|
94
|
-
let num2 = Math.min(renderImageObj.top + renderImageObj.height, cropOverlayObj.top + cropOverlayObj.height);
|
|
95
|
-
if (num1 >= x && num2 >= y) intersectAreaObj = {
|
|
96
|
-
originX: (x - renderedImageX) * (actualWidth / renderedImageWidth),
|
|
97
|
-
originY: (y - renderedImageY) * (actualWidth / renderedImageWidth),
|
|
98
|
-
width: (num1 - x) * (actualWidth / renderedImageWidth),
|
|
99
|
-
height: (num2 - y) * (actualWidth / renderedImageWidth)
|
|
100
|
-
};else {
|
|
101
|
-
intersectAreaObj = {
|
|
102
|
-
originX: x - renderedImageX,
|
|
103
|
-
originY: y - renderedImageY,
|
|
104
|
-
width: 0,
|
|
105
|
-
height: 0
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
return intersectAreaObj;
|
|
109
|
-
});
|
|
110
|
-
_defineProperty(this, "crop", async (cropObj, uri) => {
|
|
111
|
-
const {
|
|
112
|
-
saveOptions
|
|
113
|
-
} = this.props;
|
|
114
|
-
if (cropObj.height > 0 && cropObj.width > 0) {
|
|
115
|
-
const manipResult = await ImageManipulator.manipulateAsync(uri, [{
|
|
116
|
-
crop: cropObj
|
|
117
|
-
}], saveOptions);
|
|
118
|
-
return manipResult;
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
uri: null,
|
|
122
|
-
base64: null
|
|
123
|
-
};
|
|
124
|
-
});
|
|
125
|
-
_defineProperty(this, "calculateMaxSizes", event => {
|
|
126
|
-
let w1 = event.nativeEvent.layout.width || 100;
|
|
127
|
-
let h1 = event.nativeEvent.layout.height || 100;
|
|
128
|
-
if (this.state.squareAspect) {
|
|
129
|
-
if (w1 < h1) h1 = w1;else w1 = h1;
|
|
130
|
-
}
|
|
131
|
-
this.maxSizes.width = w1;
|
|
132
|
-
this.maxSizes.height = h1;
|
|
133
|
-
});
|
|
134
|
-
const {
|
|
135
|
-
squareAspect
|
|
136
|
-
} = this.props;
|
|
137
|
-
this.state = {
|
|
138
|
-
cropMode: false,
|
|
139
|
-
processing: false,
|
|
140
|
-
squareAspect
|
|
141
|
-
};
|
|
142
|
-
this.scrollOffset = 0;
|
|
143
|
-
this.currentPos = {
|
|
144
|
-
left: 0,
|
|
145
|
-
top: 0
|
|
146
|
-
};
|
|
147
|
-
this.currentSize = {
|
|
148
|
-
width: 0,
|
|
149
|
-
height: 0
|
|
150
|
-
};
|
|
151
|
-
this.maxSizes = {
|
|
152
|
-
width: 0,
|
|
153
|
-
height: 0
|
|
154
|
-
};
|
|
155
|
-
this.actualSize = {
|
|
156
|
-
width: 0,
|
|
157
|
-
height: 0
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
async componentDidMount() {
|
|
161
|
-
await this.onConvertImageToEditableSize();
|
|
162
|
-
|
|
163
|
-
// Set cropping by default
|
|
164
|
-
this.setState({
|
|
165
|
-
cropMode: true
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
async onConvertImageToEditableSize() {
|
|
169
|
-
try {
|
|
170
|
-
const {
|
|
171
|
-
photo: {
|
|
172
|
-
uri: rawUri
|
|
173
|
-
}
|
|
174
|
-
} = this.props;
|
|
175
|
-
|
|
176
|
-
// expo-image-manipulator only works with file:// URIs.
|
|
177
|
-
// Resolve ph:// (iOS Photo Library) and https:// (remote/stock images) first.
|
|
178
|
-
let resolvedUri = rawUri;
|
|
179
|
-
if (rawUri !== null && rawUri !== void 0 && rawUri.startsWith("ph://")) {
|
|
180
|
-
const assetId = rawUri.replace("ph://", "");
|
|
181
|
-
const assetInfo = await MediaLibrary.getAssetInfoAsync(assetId, {
|
|
182
|
-
shouldDownloadFromNetwork: true
|
|
183
|
-
});
|
|
184
|
-
resolvedUri = assetInfo.localUri || rawUri;
|
|
185
|
-
} else if (rawUri !== null && rawUri !== void 0 && rawUri.startsWith("http")) {
|
|
186
|
-
var _rawUri$split$pop;
|
|
187
|
-
const ext = ((_rawUri$split$pop = rawUri.split(".").pop()) === null || _rawUri$split$pop === void 0 ? void 0 : _rawUri$split$pop.split("?")[0]) || "jpg";
|
|
188
|
-
const file = await File.downloadFileAsync(rawUri, new File(Paths.cache, `crop_${Date.now()}.${ext}`), {
|
|
189
|
-
idempotent: true
|
|
190
|
-
});
|
|
191
|
-
resolvedUri = file.uri;
|
|
192
|
-
}
|
|
193
|
-
const manipulatePromise = ImageManipulator.manipulateAsync(resolvedUri, [{
|
|
194
|
-
resize: {
|
|
195
|
-
width: 1080
|
|
196
|
-
}
|
|
197
|
-
}]);
|
|
198
|
-
// manipulateAsync can hang forever on non-file:// URIs (promise never settles).
|
|
199
|
-
// Promise.race with a timeout ensures the catch block fires.
|
|
200
|
-
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error("Image processing timed out")), 15000));
|
|
201
|
-
const {
|
|
202
|
-
uri,
|
|
203
|
-
width,
|
|
204
|
-
height
|
|
205
|
-
} = await Promise.race([manipulatePromise, timeoutPromise]);
|
|
206
|
-
this.setState({
|
|
207
|
-
uri
|
|
208
|
-
});
|
|
209
|
-
this.actualSize.width = width;
|
|
210
|
-
this.actualSize.height = height;
|
|
211
|
-
} catch (e) {
|
|
212
|
-
console.log("onConvertImageToEditableSize error", e);
|
|
213
|
-
this.onToggleModal();
|
|
214
|
-
Alert.alert("Error", "Unable to prepare this image for editing. Please try a different image.");
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
// eslint-disable-next-line camelcase
|
|
218
|
-
async UNSAFE_componentWillReceiveProps() {
|
|
219
|
-
await this.onConvertImageToEditableSize();
|
|
220
|
-
}
|
|
221
|
-
render() {
|
|
222
|
-
var _this$props$insets3, _this$props$insets4;
|
|
223
|
-
const {
|
|
224
|
-
isVisible,
|
|
225
|
-
onPictureChoosed
|
|
226
|
-
} = this.props;
|
|
227
|
-
const {
|
|
228
|
-
uri,
|
|
229
|
-
base64,
|
|
230
|
-
cropMode,
|
|
231
|
-
processing
|
|
232
|
-
} = this.state;
|
|
233
|
-
let imageRatio = this.actualSize.height / this.actualSize.width;
|
|
234
|
-
const topInset = ((_this$props$insets3 = this.props.insets) === null || _this$props$insets3 === void 0 ? void 0 : _this$props$insets3.top) ?? 0;
|
|
235
|
-
const bottomInset = ((_this$props$insets4 = this.props.insets) === null || _this$props$insets4 === void 0 ? void 0 : _this$props$insets4.bottom) ?? 0;
|
|
236
|
-
var originalHeight = Dimensions.get("window").height - topInset - bottomInset - 44;
|
|
237
|
-
const topMargin = topInset + (Platform.OS === "ios" ? 50 : 20);
|
|
238
|
-
let cropRatio = originalHeight / width;
|
|
239
|
-
let cropWidth = imageRatio < cropRatio ? width : originalHeight / imageRatio;
|
|
240
|
-
let cropHeight = imageRatio < cropRatio ? width * imageRatio : originalHeight;
|
|
241
|
-
let cropInitialTop = (originalHeight - cropHeight) / 2.0;
|
|
242
|
-
let cropInitialLeft = (width - cropWidth) / 2.0;
|
|
243
|
-
if (this.currentSize.width == 0 && cropMode) {
|
|
244
|
-
this.currentSize.width = cropWidth;
|
|
245
|
-
this.currentSize.height = cropHeight;
|
|
246
|
-
this.currentPos.top = cropInitialTop;
|
|
247
|
-
this.currentPos.left = cropInitialLeft;
|
|
248
|
-
}
|
|
249
|
-
return /*#__PURE__*/React.createElement(Modal, {
|
|
250
|
-
animationType: "slide",
|
|
251
|
-
transparent: true,
|
|
252
|
-
visible: isVisible,
|
|
253
|
-
hardwareAccelerated: true,
|
|
254
|
-
onRequestClose: () => {
|
|
255
|
-
this.onToggleModal();
|
|
256
|
-
}
|
|
257
|
-
}, uri !== undefined ? /*#__PURE__*/React.createElement(View, {
|
|
258
|
-
style: styles.container
|
|
259
|
-
}, /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
260
|
-
style: [{
|
|
261
|
-
width
|
|
262
|
-
}, styles.headerContainer]
|
|
263
|
-
}, !cropMode ? /*#__PURE__*/React.createElement(View, {
|
|
264
|
-
style: [styles.headerButtonContainer, {
|
|
265
|
-
justifyContent: "flex-end"
|
|
266
|
-
}]
|
|
267
|
-
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
268
|
-
onPress: () => {
|
|
269
|
-
onPictureChoosed({
|
|
270
|
-
uri,
|
|
271
|
-
base64
|
|
272
|
-
});
|
|
273
|
-
this.onToggleModal();
|
|
274
|
-
},
|
|
275
|
-
style: styles.headerButton
|
|
276
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
277
|
-
style: styles.headerButtonText
|
|
278
|
-
}, "Done"))) : /*#__PURE__*/React.createElement(View, {
|
|
279
|
-
style: styles.headerButtonContainer
|
|
280
|
-
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
281
|
-
onPress: this.onToggleModal,
|
|
282
|
-
style: styles.headerButton
|
|
283
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
284
|
-
style: styles.headerButtonText
|
|
285
|
-
}, "Cancel")), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
286
|
-
onPress: () => {
|
|
287
|
-
this.onCropImage(() => {
|
|
288
|
-
onPictureChoosed({
|
|
289
|
-
uri: this.state.uri,
|
|
290
|
-
base64: this.state.base64
|
|
291
|
-
});
|
|
292
|
-
this.onToggleModal();
|
|
293
|
-
});
|
|
294
|
-
},
|
|
295
|
-
style: styles.headerButton
|
|
296
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
297
|
-
style: styles.headerButtonText
|
|
298
|
-
}, processing ? "Processing" : "Done")))), /*#__PURE__*/React.createElement(View, {
|
|
299
|
-
style: [styles.contentContainer, {
|
|
300
|
-
width: Dimensions.get("window").width
|
|
301
|
-
}]
|
|
302
|
-
}, /*#__PURE__*/React.createElement(ScrollView, {
|
|
303
|
-
style: {
|
|
304
|
-
position: "relative",
|
|
305
|
-
flex: 1
|
|
306
|
-
},
|
|
307
|
-
contentContainerStyle: {
|
|
308
|
-
backgroundColor: "black"
|
|
309
|
-
},
|
|
310
|
-
maximumZoomScale: 5,
|
|
311
|
-
minimumZoomScale: 0.5,
|
|
312
|
-
onScroll: this.onHandleScroll,
|
|
313
|
-
bounces: false,
|
|
314
|
-
showsHorizontalScrollIndicator: false,
|
|
315
|
-
showsVerticalScrollIndicator: false,
|
|
316
|
-
ref: c => this.scrollView = c,
|
|
317
|
-
scrollEventThrottle: 16,
|
|
318
|
-
scrollEnabled: false,
|
|
319
|
-
pinchGestureEnabled: false
|
|
320
|
-
}, /*#__PURE__*/React.createElement(AutoHeightImage, {
|
|
321
|
-
style: {
|
|
322
|
-
backgroundColor: "black"
|
|
323
|
-
},
|
|
324
|
-
source: {
|
|
325
|
-
uri
|
|
326
|
-
},
|
|
327
|
-
resizeMode: imageRatio >= 1 ? "contain" : "contain",
|
|
328
|
-
width: width,
|
|
329
|
-
height: originalHeight,
|
|
330
|
-
onLayout: this.calculateMaxSizes
|
|
331
|
-
}), !!cropMode && /*#__PURE__*/React.createElement(ImageCropOverlay, {
|
|
332
|
-
onLayoutChanged: (top, left, width, height) => {
|
|
333
|
-
this.currentSize.width = width;
|
|
334
|
-
this.currentSize.height = height;
|
|
335
|
-
this.currentPos.top = top;
|
|
336
|
-
this.currentPos.left = left;
|
|
337
|
-
},
|
|
338
|
-
initialWidth: cropWidth,
|
|
339
|
-
initialHeight: cropHeight,
|
|
340
|
-
initialTop: cropInitialTop,
|
|
341
|
-
initialLeft: cropInitialLeft,
|
|
342
|
-
minHeight: 100,
|
|
343
|
-
minWidth: 100,
|
|
344
|
-
topMargin: topMargin
|
|
345
|
-
})))) : /*#__PURE__*/React.createElement(View, {
|
|
346
|
-
style: styles.container
|
|
347
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
348
|
-
style: styles.prepareMessageText
|
|
349
|
-
}, "Preparing...")));
|
|
350
|
-
// }
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
const styles = StyleSheet.create({
|
|
354
|
-
headerContainer: {
|
|
355
|
-
flexDirection: "row",
|
|
356
|
-
backgroundColor: "black",
|
|
357
|
-
justifyContent: "space-between"
|
|
358
|
-
},
|
|
359
|
-
headerButtonContainer: {
|
|
360
|
-
flex: 1,
|
|
361
|
-
flexDirection: "row",
|
|
362
|
-
justifyContent: "space-between"
|
|
363
|
-
},
|
|
364
|
-
headerButton: {
|
|
365
|
-
marginHorizontal: 10,
|
|
366
|
-
width: 60,
|
|
367
|
-
height: 40,
|
|
368
|
-
alignItems: "center",
|
|
369
|
-
justifyContent: "center"
|
|
370
|
-
},
|
|
371
|
-
headerButtonText: {
|
|
372
|
-
fontWeight: "500",
|
|
373
|
-
color: "white",
|
|
374
|
-
fontSize: 18
|
|
375
|
-
},
|
|
376
|
-
contentContainer: {
|
|
377
|
-
flex: 1,
|
|
378
|
-
backgroundColor: "black"
|
|
379
|
-
},
|
|
380
|
-
container: {
|
|
381
|
-
flex: 1,
|
|
382
|
-
backgroundColor: "#000d",
|
|
383
|
-
alignItems: "center",
|
|
384
|
-
justifyContent: "center"
|
|
385
|
-
},
|
|
386
|
-
prepareMessageText: {
|
|
387
|
-
fontFamily: "sf-bold",
|
|
388
|
-
fontSize: 20,
|
|
389
|
-
color: "#fff"
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
export default withSafeAreaInsets(ExpoImageManipulator);
|
|
393
|
-
ExpoImageManipulator.defaultProps = {
|
|
394
|
-
onPictureChoosed: ({
|
|
395
|
-
uri,
|
|
396
|
-
base64
|
|
397
|
-
}) => console.log("URI:", uri, base64),
|
|
398
|
-
dragVelocity: 100,
|
|
399
|
-
resizeVelocity: 50,
|
|
400
|
-
saveOptions: {
|
|
401
|
-
compress: 1,
|
|
402
|
-
format: ImageManipulator.SaveFormat.PNG,
|
|
403
|
-
base64: false
|
|
404
|
-
}
|
|
405
|
-
};
|
|
406
|
-
ExpoImageManipulator.propTypes = {
|
|
407
|
-
isVisible: PropTypes.bool.isRequired,
|
|
408
|
-
onPictureChoosed: PropTypes.func,
|
|
409
|
-
saveOptions: PropTypes.object,
|
|
410
|
-
photo: PropTypes.object.isRequired,
|
|
411
|
-
onToggleModal: PropTypes.func.isRequired,
|
|
412
|
-
dragVelocity: PropTypes.number,
|
|
413
|
-
resizeVelocity: PropTypes.number
|
|
414
|
-
};
|
|
415
|
-
//# sourceMappingURL=ExpoImageManipulator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","Text","Dimensions","Image","ScrollView","Modal","View","TouchableOpacity","StyleSheet","Platform","LogBox","Alert","ImageManipulator","MediaLibrary","File","Paths","PropTypes","AutoHeightImage","withSafeAreaInsets","SafeAreaView","ImageCropOverlay","width","get","ignoreLogs","ExpoImageManipulator","constructor","props","_defineProperty","onToggleModal","setState","cropMode","callback","processing","uri","state","getSize","actualWidth","actualHeight","cropObj","getCropBounds","height","uriToCrop","uriCroped","base64","croppedWidth","croppedHeight","crop","actualSize","event","scrollOffset","nativeEvent","contentOffset","y","_this$props$insets","_this$props$insets2","imageRatio","topInset","insets","top","bottomInset","bottom","originalHeight","renderedImageWidth","renderedImageHeight","renderedImageY","renderedImageX","renderImageObj","left","cropOverlayObj","currentPos","currentSize","intersectAreaObj","x","Math","max","num1","min","num2","originX","originY","saveOptions","manipResult","manipulateAsync","w1","layout","h1","squareAspect","maxSizes","componentDidMount","onConvertImageToEditableSize","photo","rawUri","resolvedUri","startsWith","assetId","replace","assetInfo","getAssetInfoAsync","shouldDownloadFromNetwork","localUri","_rawUri$split$pop","ext","split","pop","file","downloadFileAsync","cache","Date","now","idempotent","manipulatePromise","resize","timeoutPromise","Promise","_","reject","setTimeout","Error","race","e","console","log","alert","UNSAFE_componentWillReceiveProps","render","_this$props$insets3","_this$props$insets4","isVisible","onPictureChoosed","topMargin","OS","cropRatio","cropWidth","cropHeight","cropInitialTop","cropInitialLeft","createElement","animationType","transparent","visible","hardwareAccelerated","onRequestClose","undefined","style","styles","container","headerContainer","headerButtonContainer","justifyContent","onPress","headerButton","headerButtonText","onCropImage","contentContainer","position","flex","contentContainerStyle","backgroundColor","maximumZoomScale","minimumZoomScale","onScroll","onHandleScroll","bounces","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","ref","c","scrollView","scrollEventThrottle","scrollEnabled","pinchGestureEnabled","source","resizeMode","onLayout","calculateMaxSizes","onLayoutChanged","initialWidth","initialHeight","initialTop","initialLeft","minHeight","minWidth","prepareMessageText","create","flexDirection","marginHorizontal","alignItems","fontWeight","color","fontSize","fontFamily","defaultProps","dragVelocity","resizeVelocity","compress","format","SaveFormat","PNG","propTypes","bool","isRequired","func","object","number"],"sources":["ExpoImageManipulator.js"],"sourcesContent":["import React, { Component } from \"react\";\nimport { Text } from \"@plusscommunities/pluss-core-app/components\";\nimport {\n\tDimensions,\n\tImage,\n\tScrollView,\n\tModal,\n\tView,\n\tTouchableOpacity,\n\tStyleSheet,\n\tPlatform,\n\tLogBox,\n\tAlert,\n} from \"react-native\";\nimport * as ImageManipulator from \"expo-image-manipulator\";\nimport * as MediaLibrary from \"expo-media-library\";\nimport { File, Paths } from \"expo-file-system\";\nimport PropTypes from \"prop-types\";\nimport AutoHeightImage from \"react-native-auto-height-image\";\nimport {\n\twithSafeAreaInsets,\n\tSafeAreaView,\n} from \"react-native-safe-area-context\";\nimport ImageCropOverlay from \"./ImageCropOverlay\";\n\nconst { width } = Dimensions.get(\"window\");\n\nLogBox.ignoreLogs([\n\t\"componentWillReceiveProps\",\n\t\"componentWillUpdate\",\n\t\"componentWillMount\",\n]);\nLogBox.ignoreLogs([\n\t\"Warning: componentWillMount is deprecated\",\n\t\"Warning: componentWillReceiveProps is deprecated\",\n\t\"Module RCTImageLoader requires\",\n]);\n\nclass ExpoImageManipulator extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tconst { squareAspect } = this.props;\n\t\tthis.state = {\n\t\t\tcropMode: false,\n\t\t\tprocessing: false,\n\t\t\tsquareAspect,\n\t\t};\n\n\t\tthis.scrollOffset = 0;\n\t\tthis.currentPos = { left: 0, top: 0 };\n\t\tthis.currentSize = { width: 0, height: 0 };\n\t\tthis.maxSizes = { width: 0, height: 0 };\n\t\tthis.actualSize = { width: 0, height: 0 };\n\t}\n\n\tasync componentDidMount() {\n\t\tawait this.onConvertImageToEditableSize();\n\n\t\t// Set cropping by default\n\t\tthis.setState({ cropMode: true });\n\t}\n\n\tasync onConvertImageToEditableSize() {\n\t\ttry {\n\t\t\tconst {\n\t\t\t\tphoto: { uri: rawUri },\n\t\t\t} = this.props;\n\n\t\t\t// expo-image-manipulator only works with file:// URIs.\n\t\t\t// Resolve ph:// (iOS Photo Library) and https:// (remote/stock images) first.\n\t\t\tlet resolvedUri = rawUri;\n\t\t\tif (rawUri?.startsWith(\"ph://\")) {\n\t\t\t\tconst assetId = rawUri.replace(\"ph://\", \"\");\n\t\t\t\tconst assetInfo = await MediaLibrary.getAssetInfoAsync(assetId, {\n\t\t\t\t\tshouldDownloadFromNetwork: true,\n\t\t\t\t});\n\t\t\t\tresolvedUri = assetInfo.localUri || rawUri;\n\t\t\t} else if (rawUri?.startsWith(\"http\")) {\n\t\t\t\tconst ext = rawUri.split(\".\").pop()?.split(\"?\")[0] || \"jpg\";\n\t\t\t\tconst file = await File.downloadFileAsync(\n\t\t\t\t\trawUri,\n\t\t\t\t\tnew File(Paths.cache, `crop_${Date.now()}.${ext}`),\n\t\t\t\t\t{ idempotent: true },\n\t\t\t\t);\n\t\t\t\tresolvedUri = file.uri;\n\t\t\t}\n\n\t\t\tconst manipulatePromise = ImageManipulator.manipulateAsync(resolvedUri, [\n\t\t\t\t{ resize: { width: 1080 } },\n\t\t\t]);\n\t\t\t// manipulateAsync can hang forever on non-file:// URIs (promise never settles).\n\t\t\t// Promise.race with a timeout ensures the catch block fires.\n\t\t\tconst timeoutPromise = new Promise((_, reject) =>\n\t\t\t\tsetTimeout(\n\t\t\t\t\t() => reject(new Error(\"Image processing timed out\")),\n\t\t\t\t\t15000,\n\t\t\t\t),\n\t\t\t);\n\t\t\tconst { uri, width, height } = await Promise.race([\n\t\t\t\tmanipulatePromise,\n\t\t\t\ttimeoutPromise,\n\t\t\t]);\n\t\t\tthis.setState({ uri });\n\t\t\tthis.actualSize.width = width;\n\t\t\tthis.actualSize.height = height;\n\t\t} catch (e) {\n\t\t\tconsole.log(\"onConvertImageToEditableSize error\", e);\n\t\t\tthis.onToggleModal();\n\t\t\tAlert.alert(\n\t\t\t\t\"Error\",\n\t\t\t\t\"Unable to prepare this image for editing. Please try a different image.\",\n\t\t\t);\n\t\t}\n\t}\n\n\tonToggleModal = () => {\n\t\tthis.props.onToggleModal();\n\t\tthis.setState({ cropMode: false });\n\t};\n\n\tonCropImage = (callback = null) => {\n\t\tthis.setState({ processing: true });\n\t\tconst { uri } = this.state;\n\t\tImage.getSize(uri, async (actualWidth, actualHeight) => {\n\t\t\tlet cropObj = this.getCropBounds(actualWidth, actualHeight);\n\t\t\tif (cropObj.height > 0 && cropObj.width > 0) {\n\t\t\t\tlet uriToCrop = uri;\n\t\t\t\tconst {\n\t\t\t\t\turi: uriCroped,\n\t\t\t\t\tbase64,\n\t\t\t\t\twidth: croppedWidth,\n\t\t\t\t\theight: croppedHeight,\n\t\t\t\t} = await this.crop(cropObj, uriToCrop);\n\n\t\t\t\tthis.actualSize.width = croppedWidth;\n\t\t\t\tthis.actualSize.height = croppedHeight;\n\n\t\t\t\tthis.setState(\n\t\t\t\t\t{\n\t\t\t\t\t\turi: uriCroped,\n\t\t\t\t\t\tbase64,\n\t\t\t\t\t\tcropMode: false,\n\t\t\t\t\t\tprocessing: false,\n\t\t\t\t\t},\n\t\t\t\t\t() => {\n\t\t\t\t\t\tif (callback) callback();\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis.setState({ cropMode: false, processing: false }, () => {\n\t\t\t\t\tif (callback) callback();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t};\n\n\tonHandleScroll = (event) => {\n\t\tthis.scrollOffset = event.nativeEvent.contentOffset.y;\n\t};\n\n\tgetCropBounds = (actualWidth, actualHeight) => {\n\t\tlet imageRatio = actualHeight / actualWidth;\n\t\tconst topInset = this.props.insets?.top ?? 0;\n\t\tconst bottomInset = this.props.insets?.bottom ?? 0;\n\t\tvar originalHeight =\n\t\t\tDimensions.get(\"window\").height - topInset - bottomInset - 44;\n\t\tlet renderedImageWidth =\n\t\t\timageRatio < originalHeight / width ? width : originalHeight / imageRatio;\n\t\tlet renderedImageHeight =\n\t\t\timageRatio < originalHeight / width ? width * imageRatio : originalHeight;\n\n\t\tlet renderedImageY = (originalHeight - renderedImageHeight) / 2.0;\n\t\tlet renderedImageX = (width - renderedImageWidth) / 2.0;\n\n\t\tconst renderImageObj = {\n\t\t\tleft: renderedImageX,\n\t\t\ttop: renderedImageY,\n\t\t\twidth: renderedImageWidth,\n\t\t\theight: renderedImageHeight,\n\t\t};\n\t\tconst cropOverlayObj = {\n\t\t\tleft: this.currentPos.left,\n\t\t\ttop: this.currentPos.top,\n\t\t\twidth: this.currentSize.width,\n\t\t\theight: this.currentSize.height,\n\t\t};\n\n\t\tvar intersectAreaObj = {};\n\n\t\tlet x = Math.max(renderImageObj.left, cropOverlayObj.left);\n\t\tlet num1 = Math.min(\n\t\t\trenderImageObj.left + renderImageObj.width,\n\t\t\tcropOverlayObj.left + cropOverlayObj.width,\n\t\t);\n\t\tlet y = Math.max(renderImageObj.top, cropOverlayObj.top);\n\t\tlet num2 = Math.min(\n\t\t\trenderImageObj.top + renderImageObj.height,\n\t\t\tcropOverlayObj.top + cropOverlayObj.height,\n\t\t);\n\t\tif (num1 >= x && num2 >= y)\n\t\t\tintersectAreaObj = {\n\t\t\t\toriginX: (x - renderedImageX) * (actualWidth / renderedImageWidth),\n\t\t\t\toriginY: (y - renderedImageY) * (actualWidth / renderedImageWidth),\n\t\t\t\twidth: (num1 - x) * (actualWidth / renderedImageWidth),\n\t\t\t\theight: (num2 - y) * (actualWidth / renderedImageWidth),\n\t\t\t};\n\t\telse {\n\t\t\tintersectAreaObj = {\n\t\t\t\toriginX: x - renderedImageX,\n\t\t\t\toriginY: y - renderedImageY,\n\t\t\t\twidth: 0,\n\t\t\t\theight: 0,\n\t\t\t};\n\t\t}\n\t\treturn intersectAreaObj;\n\t};\n\n\tcrop = async (cropObj, uri) => {\n\t\tconst { saveOptions } = this.props;\n\t\tif (cropObj.height > 0 && cropObj.width > 0) {\n\t\t\tconst manipResult = await ImageManipulator.manipulateAsync(\n\t\t\t\turi,\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\tcrop: cropObj,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tsaveOptions,\n\t\t\t);\n\t\t\treturn manipResult;\n\t\t}\n\t\treturn {\n\t\t\turi: null,\n\t\t\tbase64: null,\n\t\t};\n\t};\n\n\tcalculateMaxSizes = (event) => {\n\t\tlet w1 = event.nativeEvent.layout.width || 100;\n\t\tlet h1 = event.nativeEvent.layout.height || 100;\n\t\tif (this.state.squareAspect) {\n\t\t\tif (w1 < h1) h1 = w1;\n\t\t\telse w1 = h1;\n\t\t}\n\t\tthis.maxSizes.width = w1;\n\t\tthis.maxSizes.height = h1;\n\t};\n\n\t// eslint-disable-next-line camelcase\n\tasync UNSAFE_componentWillReceiveProps() {\n\t\tawait this.onConvertImageToEditableSize();\n\t}\n\n\trender() {\n\t\tconst { isVisible, onPictureChoosed } = this.props;\n\t\tconst { uri, base64, cropMode, processing } = this.state;\n\n\t\tlet imageRatio = this.actualSize.height / this.actualSize.width;\n\t\tconst topInset = this.props.insets?.top ?? 0;\n\t\tconst bottomInset = this.props.insets?.bottom ?? 0;\n\t\tvar originalHeight =\n\t\t\tDimensions.get(\"window\").height - topInset - bottomInset - 44;\n\t\tconst topMargin = topInset + (Platform.OS === \"ios\" ? 50 : 20);\n\n\t\tlet cropRatio = originalHeight / width;\n\n\t\tlet cropWidth =\n\t\t\timageRatio < cropRatio ? width : originalHeight / imageRatio;\n\t\tlet cropHeight =\n\t\t\timageRatio < cropRatio ? width * imageRatio : originalHeight;\n\n\t\tlet cropInitialTop = (originalHeight - cropHeight) / 2.0;\n\t\tlet cropInitialLeft = (width - cropWidth) / 2.0;\n\n\t\tif (this.currentSize.width == 0 && cropMode) {\n\t\t\tthis.currentSize.width = cropWidth;\n\t\t\tthis.currentSize.height = cropHeight;\n\n\t\t\tthis.currentPos.top = cropInitialTop;\n\t\t\tthis.currentPos.left = cropInitialLeft;\n\t\t}\n\n\t\treturn (\n\t\t\t<Modal\n\t\t\t\tanimationType=\"slide\"\n\t\t\t\ttransparent={true}\n\t\t\t\tvisible={isVisible}\n\t\t\t\thardwareAccelerated\n\t\t\t\tonRequestClose={() => {\n\t\t\t\t\tthis.onToggleModal();\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{uri !== undefined ? (\n\t\t\t\t\t<View style={styles.container}>\n\t\t\t\t\t\t<SafeAreaView style={[{ width }, styles.headerContainer]}>\n\t\t\t\t\t\t\t{!cropMode ? (\n\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\t\t\t\tstyles.headerButtonContainer,\n\t\t\t\t\t\t\t\t\t\t{ justifyContent: \"flex-end\" },\n\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\t\t\tonPress={() => {\n\t\t\t\t\t\t\t\t\t\t\tonPictureChoosed({ uri, base64 });\n\t\t\t\t\t\t\t\t\t\t\tthis.onToggleModal();\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tstyle={styles.headerButton}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Text style={styles.headerButtonText}>{\"Done\"}</Text>\n\t\t\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<View style={styles.headerButtonContainer}>\n\t\t\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\t\t\tonPress={this.onToggleModal}\n\t\t\t\t\t\t\t\t\t\tstyle={styles.headerButton}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Text style={styles.headerButtonText}>{\"Cancel\"}</Text>\n\t\t\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\t\t\tonPress={() => {\n\t\t\t\t\t\t\t\t\t\t\tthis.onCropImage(() => {\n\t\t\t\t\t\t\t\t\t\t\t\tonPictureChoosed({\n\t\t\t\t\t\t\t\t\t\t\t\t\turi: this.state.uri,\n\t\t\t\t\t\t\t\t\t\t\t\t\tbase64: this.state.base64,\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\tthis.onToggleModal();\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tstyle={styles.headerButton}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Text style={styles.headerButtonText}>\n\t\t\t\t\t\t\t\t\t\t\t{processing ? \"Processing\" : \"Done\"}\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</SafeAreaView>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\t\tstyles.contentContainer,\n\t\t\t\t\t\t\t\t{ width: Dimensions.get(\"window\").width },\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ScrollView\n\t\t\t\t\t\t\t\tstyle={{ position: \"relative\", flex: 1 }}\n\t\t\t\t\t\t\t\tcontentContainerStyle={{ backgroundColor: \"black\" }}\n\t\t\t\t\t\t\t\tmaximumZoomScale={5}\n\t\t\t\t\t\t\t\tminimumZoomScale={0.5}\n\t\t\t\t\t\t\t\tonScroll={this.onHandleScroll}\n\t\t\t\t\t\t\t\tbounces={false}\n\t\t\t\t\t\t\t\tshowsHorizontalScrollIndicator={false}\n\t\t\t\t\t\t\t\tshowsVerticalScrollIndicator={false}\n\t\t\t\t\t\t\t\tref={(c) => (this.scrollView = c)}\n\t\t\t\t\t\t\t\tscrollEventThrottle={16}\n\t\t\t\t\t\t\t\tscrollEnabled={false}\n\t\t\t\t\t\t\t\tpinchGestureEnabled={false}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<AutoHeightImage\n\t\t\t\t\t\t\t\t\tstyle={{ backgroundColor: \"black\" }}\n\t\t\t\t\t\t\t\t\tsource={{ uri }}\n\t\t\t\t\t\t\t\t\tresizeMode={imageRatio >= 1 ? \"contain\" : \"contain\"}\n\t\t\t\t\t\t\t\t\twidth={width}\n\t\t\t\t\t\t\t\t\theight={originalHeight}\n\t\t\t\t\t\t\t\t\tonLayout={this.calculateMaxSizes}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{!!cropMode && (\n\t\t\t\t\t\t\t\t\t<ImageCropOverlay\n\t\t\t\t\t\t\t\t\t\tonLayoutChanged={(top, left, width, height) => {\n\t\t\t\t\t\t\t\t\t\t\tthis.currentSize.width = width;\n\t\t\t\t\t\t\t\t\t\t\tthis.currentSize.height = height;\n\t\t\t\t\t\t\t\t\t\t\tthis.currentPos.top = top;\n\t\t\t\t\t\t\t\t\t\t\tthis.currentPos.left = left;\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tinitialWidth={cropWidth}\n\t\t\t\t\t\t\t\t\t\tinitialHeight={cropHeight}\n\t\t\t\t\t\t\t\t\t\tinitialTop={cropInitialTop}\n\t\t\t\t\t\t\t\t\t\tinitialLeft={cropInitialLeft}\n\t\t\t\t\t\t\t\t\t\tminHeight={100}\n\t\t\t\t\t\t\t\t\t\tminWidth={100}\n\t\t\t\t\t\t\t\t\t\ttopMargin={topMargin}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</ScrollView>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t) : (\n\t\t\t\t\t<View style={styles.container}>\n\t\t\t\t\t\t<Text style={styles.prepareMessageText}>Preparing...</Text>\n\t\t\t\t\t</View>\n\t\t\t\t)}\n\t\t\t</Modal>\n\t\t);\n\t\t// }\n\t}\n}\n\nconst styles = StyleSheet.create({\n\theaderContainer: {\n\t\tflexDirection: \"row\",\n\t\tbackgroundColor: \"black\",\n\t\tjustifyContent: \"space-between\",\n\t},\n\theaderButtonContainer: {\n\t\tflex: 1,\n\t\tflexDirection: \"row\",\n\t\tjustifyContent: \"space-between\",\n\t},\n\theaderButton: {\n\t\tmarginHorizontal: 10,\n\t\twidth: 60,\n\t\theight: 40,\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t},\n\theaderButtonText: {\n\t\tfontWeight: \"500\",\n\t\tcolor: \"white\",\n\t\tfontSize: 18,\n\t},\n\tcontentContainer: {\n\t\tflex: 1,\n\t\tbackgroundColor: \"black\",\n\t},\n\tcontainer: {\n\t\tflex: 1,\n\t\tbackgroundColor: \"#000d\",\n\t\talignItems: \"center\",\n\t\tjustifyContent: \"center\",\n\t},\n\tprepareMessageText: {\n\t\tfontFamily: \"sf-bold\",\n\t\tfontSize: 20,\n\t\tcolor: \"#fff\",\n\t},\n});\n\nexport default withSafeAreaInsets(ExpoImageManipulator);\n\nExpoImageManipulator.defaultProps = {\n\tonPictureChoosed: ({ uri, base64 }) => console.log(\"URI:\", uri, base64),\n\tdragVelocity: 100,\n\tresizeVelocity: 50,\n\tsaveOptions: {\n\t\tcompress: 1,\n\t\tformat: ImageManipulator.SaveFormat.PNG,\n\t\tbase64: false,\n\t},\n};\n\nExpoImageManipulator.propTypes = {\n\tisVisible: PropTypes.bool.isRequired,\n\tonPictureChoosed: PropTypes.func,\n\tsaveOptions: PropTypes.object,\n\tphoto: PropTypes.object.isRequired,\n\tonToggleModal: PropTypes.func.isRequired,\n\tdragVelocity: PropTypes.number,\n\tresizeVelocity: PropTypes.number,\n};\n"],"mappings":";;;AAAA,OAAOA,KAAK,IA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