@plusscommunities/pluss-core-app 8.0.28 → 8.0.31
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/dist/module/actions/FollowerActions.js +34 -0
- package/dist/module/actions/FollowerActions.js.map +1 -0
- package/dist/module/actions/MediaActions.js +29 -0
- package/dist/module/actions/MediaActions.js.map +1 -0
- package/dist/module/actions/ResidentActions.js +26 -0
- package/dist/module/actions/ResidentActions.js.map +1 -0
- package/dist/module/actions/UserActions.js +223 -0
- package/dist/module/actions/UserActions.js.map +1 -0
- package/dist/module/actions/UserSettingsActions.js +14 -0
- package/dist/module/actions/UserSettingsActions.js.map +1 -0
- package/dist/module/actions/index.js +6 -0
- package/dist/module/actions/index.js.map +1 -0
- package/dist/module/actions/types.js +17 -0
- package/dist/module/actions/types.js.map +1 -0
- package/dist/module/apis/analyticsActions.js +20 -0
- package/dist/module/apis/analyticsActions.js.map +1 -0
- package/dist/module/apis/contactActions.js +27 -0
- package/dist/module/apis/contactActions.js.map +1 -0
- package/dist/module/apis/eventActions.js +161 -0
- package/dist/module/apis/eventActions.js.map +1 -0
- package/dist/module/apis/fileActions.js +93 -0
- package/dist/module/apis/fileActions.js.map +1 -0
- package/dist/module/apis/followerActions.js +38 -0
- package/dist/module/apis/followerActions.js.map +1 -0
- package/dist/module/apis/index.js +13 -0
- package/dist/module/apis/index.js.map +1 -0
- package/dist/module/apis/notificationActions.js +60 -0
- package/dist/module/apis/notificationActions.js.map +1 -0
- package/dist/module/apis/profileActions.js +14 -0
- package/dist/module/apis/profileActions.js.map +1 -0
- package/dist/module/apis/reactionActions.js +76 -0
- package/dist/module/apis/reactionActions.js.map +1 -0
- package/dist/module/apis/settingActions.js +22 -0
- package/dist/module/apis/settingActions.js.map +1 -0
- package/dist/module/apis/stringActions.js +30 -0
- package/dist/module/apis/stringActions.js.map +1 -0
- package/dist/module/apis/typeActions.js +15 -0
- package/dist/module/apis/typeActions.js.map +1 -0
- package/dist/module/apis/userActions.js +104 -0
- package/dist/module/apis/userActions.js.map +1 -0
- 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 +4205 -0
- 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 +165 -0
- package/dist/module/colours.js.map +1 -0
- package/dist/module/components/AddButton.js +43 -0
- package/dist/module/components/AddButton.js.map +1 -0
- package/dist/module/components/AddToCalendarButton.js +225 -0
- package/dist/module/components/AddToCalendarButton.js.map +1 -0
- package/dist/module/components/Attachment.js +55 -0
- package/dist/module/components/Attachment.js.map +1 -0
- package/dist/module/components/AudienceSelectorLauncher.js +64 -0
- package/dist/module/components/AudienceSelectorLauncher.js.map +1 -0
- package/dist/module/components/AudienceSelectorPage.js +351 -0
- package/dist/module/components/AudienceSelectorPage.js.map +1 -0
- package/dist/module/components/AutoOffsetImage.js +184 -0
- package/dist/module/components/AutoOffsetImage.js.map +1 -0
- package/dist/module/components/BackButton.js +58 -0
- package/dist/module/components/BackButton.js.map +1 -0
- package/dist/module/components/CalendarPopup.js +126 -0
- package/dist/module/components/CalendarPopup.js.map +1 -0
- package/dist/module/components/CategoryTabs.js +155 -0
- package/dist/module/components/CategoryTabs.js.map +1 -0
- package/dist/module/components/CommentReply.js +334 -0
- package/dist/module/components/CommentReply.js.map +1 -0
- package/dist/module/components/CommentSection.js +823 -0
- package/dist/module/components/CommentSection.js.map +1 -0
- package/dist/module/components/ConfirmPopup.js +109 -0
- package/dist/module/components/ConfirmPopup.js.map +1 -0
- package/dist/module/components/ConfirmationPopup.js +72 -0
- package/dist/module/components/ConfirmationPopup.js.map +1 -0
- package/dist/module/components/DocumentUploader.js +253 -0
- package/dist/module/components/DocumentUploader.js.map +1 -0
- package/dist/module/components/DropDownItem.js +75 -0
- package/dist/module/components/DropDownItem.js.map +1 -0
- package/dist/module/components/DropDownMenu.js +41 -0
- package/dist/module/components/DropDownMenu.js.map +1 -0
- package/dist/module/components/EmptyStateMain.js +51 -0
- package/dist/module/components/EmptyStateMain.js.map +1 -0
- package/dist/module/components/EmptyStateWidget.js +48 -0
- package/dist/module/components/EmptyStateWidget.js.map +1 -0
- package/dist/module/components/FontScaleButton.js +37 -0
- package/dist/module/components/FontScaleButton.js.map +1 -0
- package/dist/module/components/FontScalePopup.js +76 -0
- package/dist/module/components/FontScalePopup.js.map +1 -0
- package/dist/module/components/Forbidden.js +58 -0
- package/dist/module/components/Forbidden.js.map +1 -0
- package/dist/module/components/FormCard.js +25 -0
- package/dist/module/components/FormCard.js.map +1 -0
- package/dist/module/components/FormCardSection.js +214 -0
- package/dist/module/components/FormCardSection.js.map +1 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js +73 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -0
- package/dist/module/components/FormattedText.js +133 -0
- package/dist/module/components/FormattedText.js.map +1 -0
- package/dist/module/components/GenericInput.js +151 -0
- package/dist/module/components/GenericInput.js.map +1 -0
- package/dist/module/components/GenericInputSection.js +173 -0
- package/dist/module/components/GenericInputSection.js.map +1 -0
- package/dist/module/components/Header.js +459 -0
- package/dist/module/components/Header.js.map +1 -0
- package/dist/module/components/Icon.js +109 -0
- package/dist/module/components/Icon.js.map +1 -0
- package/dist/module/components/ImagePopup.js +400 -0
- package/dist/module/components/ImagePopup.js.map +1 -0
- package/dist/module/components/ImageUploadProgress.js +69 -0
- package/dist/module/components/ImageUploadProgress.js.map +1 -0
- package/dist/module/components/ImageUploader.js +831 -0
- package/dist/module/components/ImageUploader.js.map +1 -0
- package/dist/module/components/InlineButton.js +66 -0
- package/dist/module/components/InlineButton.js.map +1 -0
- package/dist/module/components/Input.js +156 -0
- package/dist/module/components/Input.js.map +1 -0
- package/dist/module/components/LoadingCircles.js +219 -0
- package/dist/module/components/LoadingCircles.js.map +1 -0
- package/dist/module/components/LoadingIndicator.js +86 -0
- package/dist/module/components/LoadingIndicator.js.map +1 -0
- package/dist/module/components/LoadingStateWidget.js +46 -0
- package/dist/module/components/LoadingStateWidget.js.map +1 -0
- package/dist/module/components/MediaPlayer.js +407 -0
- package/dist/module/components/MediaPlayer.js.map +1 -0
- package/dist/module/components/MiddlePopup.js +49 -0
- package/dist/module/components/MiddlePopup.js.map +1 -0
- package/dist/module/components/PDFPopup.js +296 -0
- package/dist/module/components/PDFPopup.js.map +1 -0
- package/dist/module/components/PlussChat.js +1078 -0
- package/dist/module/components/PlussChat.js.map +1 -0
- package/dist/module/components/PlussChatMessage.js +299 -0
- package/dist/module/components/PlussChatMessage.js.map +1 -0
- package/dist/module/components/PlussChatTime.js +59 -0
- package/dist/module/components/PlussChatTime.js.map +1 -0
- package/dist/module/components/Popup.js +126 -0
- package/dist/module/components/Popup.js.map +1 -0
- package/dist/module/components/PopupMenu.js +120 -0
- package/dist/module/components/PopupMenu.js.map +1 -0
- package/dist/module/components/PositionedImage.js +313 -0
- package/dist/module/components/PositionedImage.js.map +1 -0
- package/dist/module/components/ProfilePic.js +105 -0
- package/dist/module/components/ProfilePic.js.map +1 -0
- package/dist/module/components/RadioButton.js +78 -0
- package/dist/module/components/RadioButton.js.map +1 -0
- package/dist/module/components/Reaction.js +117 -0
- package/dist/module/components/Reaction.js.map +1 -0
- package/dist/module/components/Reactions.js +71 -0
- package/dist/module/components/Reactions.js.map +1 -0
- package/dist/module/components/SharingTools.js +189 -0
- package/dist/module/components/SharingTools.js.map +1 -0
- package/dist/module/components/Spinner.js +22 -0
- package/dist/module/components/Spinner.js.map +1 -0
- package/dist/module/components/StickyFooter.js +34 -0
- package/dist/module/components/StickyFooter.js.map +1 -0
- package/dist/module/components/Text.js +57 -0
- package/dist/module/components/Text.js.map +1 -0
- package/dist/module/components/TickIcon.js +24 -0
- package/dist/module/components/TickIcon.js.map +1 -0
- package/dist/module/components/Toggle.js +66 -0
- package/dist/module/components/Toggle.js.map +1 -0
- package/dist/module/components/TouchableSearchBar.js +68 -0
- package/dist/module/components/TouchableSearchBar.js.map +1 -0
- package/dist/module/components/UserListPopup.js +136 -0
- package/dist/module/components/UserListPopup.js.map +1 -0
- package/dist/module/components/UserListing.js +268 -0
- package/dist/module/components/UserListing.js.map +1 -0
- package/dist/module/components/VideoPopup.js +113 -0
- package/dist/module/components/VideoPopup.js.map +1 -0
- package/dist/module/components/WarningPopup.js +85 -0
- package/dist/module/components/WarningPopup.js.map +1 -0
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +289 -0
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js +117 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -0
- package/dist/module/components/index.js +60 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +422 -0
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -0
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +387 -0
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -0
- package/dist/module/config.js +27 -0
- package/dist/module/config.js.map +1 -0
- package/dist/module/constants.js +18 -0
- package/dist/module/constants.js.map +1 -0
- package/dist/module/helper.js +424 -0
- package/dist/module/helper.js.map +1 -0
- package/dist/module/index.js +13 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/js/images/detectFaces.js +31 -0
- package/dist/module/js/images/detectFaces.js.map +1 -0
- package/dist/module/js/images/findLandmarkRange.js +93 -0
- package/dist/module/js/images/findLandmarkRange.js.map +1 -0
- package/dist/module/js/images/getScaledOffset.js +81 -0
- package/dist/module/js/images/getScaledOffset.js.map +1 -0
- package/dist/module/js/site/getSiteLevelFromState.js +29 -0
- package/dist/module/js/site/getSiteLevelFromState.js.map +1 -0
- package/dist/module/js/site/isTVEnabled.js +10 -0
- package/dist/module/js/site/isTVEnabled.js.map +1 -0
- package/dist/module/session.js +58 -0
- package/dist/module/session.js.map +1 -0
- package/dist/module/styles.js +67 -0
- package/dist/module/styles.js.map +1 -0
- package/dist/module/withNavigationFocus.js +30 -0
- package/dist/module/withNavigationFocus.js.map +1 -0
- package/package.json +1 -1
- package/src/components/PDFPopup.js +130 -35
- package/src/components/react-native-expo-image-cropper/ExpoImageManipulator.js +91 -87
|
@@ -0,0 +1,422 @@
|
|
|
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, 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, SafeAreaProvider } 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
|
+
const imageRatio = actualHeight / actualWidth;
|
|
70
|
+
const {
|
|
71
|
+
contentHeight
|
|
72
|
+
} = this.state;
|
|
73
|
+
const originalHeight = contentHeight;
|
|
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
|
+
_defineProperty(this, "onContentLayout", event => {
|
|
135
|
+
this.setState({
|
|
136
|
+
contentHeight: event.nativeEvent.layout.height
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
const {
|
|
140
|
+
squareAspect
|
|
141
|
+
} = this.props;
|
|
142
|
+
this.state = {
|
|
143
|
+
cropMode: false,
|
|
144
|
+
processing: false,
|
|
145
|
+
squareAspect,
|
|
146
|
+
contentHeight: Dimensions.get("window").height - 100 // fallback until onLayout fires
|
|
147
|
+
};
|
|
148
|
+
this.scrollOffset = 0;
|
|
149
|
+
this.currentPos = {
|
|
150
|
+
left: 0,
|
|
151
|
+
top: 0
|
|
152
|
+
};
|
|
153
|
+
this.currentSize = {
|
|
154
|
+
width: 0,
|
|
155
|
+
height: 0
|
|
156
|
+
};
|
|
157
|
+
this.maxSizes = {
|
|
158
|
+
width: 0,
|
|
159
|
+
height: 0
|
|
160
|
+
};
|
|
161
|
+
this.actualSize = {
|
|
162
|
+
width: 0,
|
|
163
|
+
height: 0
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
async componentDidMount() {
|
|
167
|
+
await this.onConvertImageToEditableSize();
|
|
168
|
+
|
|
169
|
+
// Set cropping by default
|
|
170
|
+
this.setState({
|
|
171
|
+
cropMode: true
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
async onConvertImageToEditableSize() {
|
|
175
|
+
try {
|
|
176
|
+
const {
|
|
177
|
+
photo: {
|
|
178
|
+
uri: rawUri
|
|
179
|
+
}
|
|
180
|
+
} = this.props;
|
|
181
|
+
|
|
182
|
+
// expo-image-manipulator only works with file:// URIs.
|
|
183
|
+
// Resolve ph:// (iOS Photo Library) and https:// (remote/stock images) first.
|
|
184
|
+
let resolvedUri = rawUri;
|
|
185
|
+
if (rawUri !== null && rawUri !== void 0 && rawUri.startsWith("ph://")) {
|
|
186
|
+
const assetId = rawUri.replace("ph://", "");
|
|
187
|
+
const assetInfo = await MediaLibrary.getAssetInfoAsync(assetId, {
|
|
188
|
+
shouldDownloadFromNetwork: true
|
|
189
|
+
});
|
|
190
|
+
resolvedUri = assetInfo.localUri || rawUri;
|
|
191
|
+
} else if (rawUri !== null && rawUri !== void 0 && rawUri.startsWith("http")) {
|
|
192
|
+
var _rawUri$split$pop;
|
|
193
|
+
const ext = ((_rawUri$split$pop = rawUri.split(".").pop()) === null || _rawUri$split$pop === void 0 ? void 0 : _rawUri$split$pop.split("?")[0]) || "jpg";
|
|
194
|
+
const file = await File.downloadFileAsync(rawUri, new File(Paths.cache, `crop_${Date.now()}.${ext}`), {
|
|
195
|
+
idempotent: true
|
|
196
|
+
});
|
|
197
|
+
resolvedUri = file.uri;
|
|
198
|
+
}
|
|
199
|
+
const manipulatePromise = ImageManipulator.manipulateAsync(resolvedUri, [{
|
|
200
|
+
resize: {
|
|
201
|
+
width: 1080
|
|
202
|
+
}
|
|
203
|
+
}]);
|
|
204
|
+
// manipulateAsync can hang forever on non-file:// URIs (promise never settles).
|
|
205
|
+
// Promise.race with a timeout ensures the catch block fires.
|
|
206
|
+
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error("Image processing timed out")), 15000));
|
|
207
|
+
const {
|
|
208
|
+
uri,
|
|
209
|
+
width,
|
|
210
|
+
height
|
|
211
|
+
} = await Promise.race([manipulatePromise, timeoutPromise]);
|
|
212
|
+
this.setState({
|
|
213
|
+
uri
|
|
214
|
+
});
|
|
215
|
+
this.actualSize.width = width;
|
|
216
|
+
this.actualSize.height = height;
|
|
217
|
+
} catch (e) {
|
|
218
|
+
console.log("onConvertImageToEditableSize error", e);
|
|
219
|
+
this.onToggleModal();
|
|
220
|
+
Alert.alert("Error", "Unable to prepare this image for editing. Please try a different image.");
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
// eslint-disable-next-line camelcase
|
|
224
|
+
async UNSAFE_componentWillReceiveProps() {
|
|
225
|
+
await this.onConvertImageToEditableSize();
|
|
226
|
+
}
|
|
227
|
+
render() {
|
|
228
|
+
var _this$props$insets;
|
|
229
|
+
const {
|
|
230
|
+
isVisible,
|
|
231
|
+
onPictureChoosed
|
|
232
|
+
} = this.props;
|
|
233
|
+
const {
|
|
234
|
+
uri,
|
|
235
|
+
base64,
|
|
236
|
+
cropMode,
|
|
237
|
+
processing,
|
|
238
|
+
contentHeight
|
|
239
|
+
} = this.state;
|
|
240
|
+
const imageRatio = this.actualSize.height / this.actualSize.width;
|
|
241
|
+
const originalHeight = contentHeight;
|
|
242
|
+
const topMargin = (((_this$props$insets = this.props.insets) === null || _this$props$insets === void 0 ? void 0 : _this$props$insets.top) ?? 0) + 50;
|
|
243
|
+
const cropRatio = originalHeight / width;
|
|
244
|
+
const cropWidth = imageRatio < cropRatio ? width : originalHeight / imageRatio;
|
|
245
|
+
const cropHeight = imageRatio < cropRatio ? width * imageRatio : originalHeight;
|
|
246
|
+
const cropInitialTop = (originalHeight - cropHeight) / 2.0;
|
|
247
|
+
const cropInitialLeft = (width - cropWidth) / 2.0;
|
|
248
|
+
if (this.currentSize.width == 0 && cropMode) {
|
|
249
|
+
this.currentSize.width = cropWidth;
|
|
250
|
+
this.currentSize.height = cropHeight;
|
|
251
|
+
this.currentPos.top = cropInitialTop;
|
|
252
|
+
this.currentPos.left = cropInitialLeft;
|
|
253
|
+
}
|
|
254
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
255
|
+
animationType: "slide",
|
|
256
|
+
transparent: true,
|
|
257
|
+
visible: isVisible,
|
|
258
|
+
hardwareAccelerated: true,
|
|
259
|
+
onRequestClose: () => {
|
|
260
|
+
this.onToggleModal();
|
|
261
|
+
}
|
|
262
|
+
}, uri !== undefined ? /*#__PURE__*/React.createElement(SafeAreaProvider, null, /*#__PURE__*/React.createElement(View, {
|
|
263
|
+
style: styles.container
|
|
264
|
+
}, /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
265
|
+
style: [{
|
|
266
|
+
width
|
|
267
|
+
}, styles.headerContainer]
|
|
268
|
+
}, !cropMode ? /*#__PURE__*/React.createElement(View, {
|
|
269
|
+
style: [styles.headerButtonContainer, {
|
|
270
|
+
justifyContent: "flex-end"
|
|
271
|
+
}]
|
|
272
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
273
|
+
onPress: () => {
|
|
274
|
+
onPictureChoosed({
|
|
275
|
+
uri,
|
|
276
|
+
base64
|
|
277
|
+
});
|
|
278
|
+
this.onToggleModal();
|
|
279
|
+
},
|
|
280
|
+
style: styles.headerButton
|
|
281
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
282
|
+
style: styles.headerButtonText
|
|
283
|
+
}, "Done"))) : /*#__PURE__*/React.createElement(View, {
|
|
284
|
+
style: styles.headerButtonContainer
|
|
285
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
286
|
+
onPress: this.onToggleModal,
|
|
287
|
+
style: styles.headerButton
|
|
288
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
289
|
+
style: styles.headerButtonText
|
|
290
|
+
}, "Cancel")), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
291
|
+
onPress: () => {
|
|
292
|
+
this.onCropImage(() => {
|
|
293
|
+
onPictureChoosed({
|
|
294
|
+
uri: this.state.uri,
|
|
295
|
+
base64: this.state.base64
|
|
296
|
+
});
|
|
297
|
+
this.onToggleModal();
|
|
298
|
+
});
|
|
299
|
+
},
|
|
300
|
+
style: styles.headerButton
|
|
301
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
302
|
+
style: styles.headerButtonText
|
|
303
|
+
}, processing ? "Processing" : "Done")))), /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
304
|
+
onLayout: this.onContentLayout,
|
|
305
|
+
style: [styles.contentContainer, {
|
|
306
|
+
width
|
|
307
|
+
}],
|
|
308
|
+
edges: ["bottom"]
|
|
309
|
+
}, /*#__PURE__*/React.createElement(ScrollView, {
|
|
310
|
+
style: {
|
|
311
|
+
position: "relative",
|
|
312
|
+
flex: 1
|
|
313
|
+
},
|
|
314
|
+
contentContainerStyle: {
|
|
315
|
+
backgroundColor: "black"
|
|
316
|
+
},
|
|
317
|
+
maximumZoomScale: 5,
|
|
318
|
+
minimumZoomScale: 0.5,
|
|
319
|
+
onScroll: this.onHandleScroll,
|
|
320
|
+
bounces: false,
|
|
321
|
+
showsHorizontalScrollIndicator: false,
|
|
322
|
+
showsVerticalScrollIndicator: false,
|
|
323
|
+
ref: c => this.scrollView = c,
|
|
324
|
+
scrollEventThrottle: 16,
|
|
325
|
+
scrollEnabled: false,
|
|
326
|
+
pinchGestureEnabled: false
|
|
327
|
+
}, /*#__PURE__*/React.createElement(AutoHeightImage, {
|
|
328
|
+
style: {
|
|
329
|
+
backgroundColor: "black"
|
|
330
|
+
},
|
|
331
|
+
source: {
|
|
332
|
+
uri
|
|
333
|
+
},
|
|
334
|
+
resizeMode: imageRatio >= 1 ? "contain" : "contain",
|
|
335
|
+
width: width,
|
|
336
|
+
height: originalHeight,
|
|
337
|
+
onLayout: this.calculateMaxSizes
|
|
338
|
+
}), !!cropMode && /*#__PURE__*/React.createElement(ImageCropOverlay, {
|
|
339
|
+
onLayoutChanged: (top, left, width, height) => {
|
|
340
|
+
this.currentSize.width = width;
|
|
341
|
+
this.currentSize.height = height;
|
|
342
|
+
this.currentPos.top = top;
|
|
343
|
+
this.currentPos.left = left;
|
|
344
|
+
},
|
|
345
|
+
initialWidth: cropWidth,
|
|
346
|
+
initialHeight: cropHeight,
|
|
347
|
+
initialTop: cropInitialTop,
|
|
348
|
+
initialLeft: cropInitialLeft,
|
|
349
|
+
minHeight: 100,
|
|
350
|
+
minWidth: 100,
|
|
351
|
+
topMargin: topMargin
|
|
352
|
+
}))))) : /*#__PURE__*/React.createElement(View, {
|
|
353
|
+
style: styles.container
|
|
354
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
355
|
+
style: styles.prepareMessageText
|
|
356
|
+
}, "Preparing...")));
|
|
357
|
+
// }
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
const styles = StyleSheet.create({
|
|
361
|
+
headerContainer: {
|
|
362
|
+
flexDirection: "row",
|
|
363
|
+
backgroundColor: "black",
|
|
364
|
+
justifyContent: "space-between"
|
|
365
|
+
},
|
|
366
|
+
headerButtonContainer: {
|
|
367
|
+
flex: 1,
|
|
368
|
+
flexDirection: "row",
|
|
369
|
+
justifyContent: "space-between"
|
|
370
|
+
},
|
|
371
|
+
headerButton: {
|
|
372
|
+
marginHorizontal: 10,
|
|
373
|
+
width: 60,
|
|
374
|
+
height: 40,
|
|
375
|
+
alignItems: "center",
|
|
376
|
+
justifyContent: "center"
|
|
377
|
+
},
|
|
378
|
+
headerButtonText: {
|
|
379
|
+
fontWeight: "500",
|
|
380
|
+
color: "white",
|
|
381
|
+
fontSize: 18
|
|
382
|
+
},
|
|
383
|
+
contentContainer: {
|
|
384
|
+
flex: 1,
|
|
385
|
+
backgroundColor: "black"
|
|
386
|
+
},
|
|
387
|
+
container: {
|
|
388
|
+
flex: 1,
|
|
389
|
+
backgroundColor: "#000d",
|
|
390
|
+
alignItems: "center",
|
|
391
|
+
justifyContent: "center"
|
|
392
|
+
},
|
|
393
|
+
prepareMessageText: {
|
|
394
|
+
fontFamily: "sf-bold",
|
|
395
|
+
fontSize: 20,
|
|
396
|
+
color: "#fff"
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
export default withSafeAreaInsets(ExpoImageManipulator);
|
|
400
|
+
ExpoImageManipulator.defaultProps = {
|
|
401
|
+
onPictureChoosed: ({
|
|
402
|
+
uri,
|
|
403
|
+
base64
|
|
404
|
+
}) => console.log("URI:", uri, base64),
|
|
405
|
+
dragVelocity: 100,
|
|
406
|
+
resizeVelocity: 50,
|
|
407
|
+
saveOptions: {
|
|
408
|
+
compress: 1,
|
|
409
|
+
format: ImageManipulator.SaveFormat.PNG,
|
|
410
|
+
base64: false
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
ExpoImageManipulator.propTypes = {
|
|
414
|
+
isVisible: PropTypes.bool.isRequired,
|
|
415
|
+
onPictureChoosed: PropTypes.func,
|
|
416
|
+
saveOptions: PropTypes.object,
|
|
417
|
+
photo: PropTypes.object.isRequired,
|
|
418
|
+
onToggleModal: PropTypes.func.isRequired,
|
|
419
|
+
dragVelocity: PropTypes.number,
|
|
420
|
+
resizeVelocity: PropTypes.number
|
|
421
|
+
};
|
|
422
|
+
//# sourceMappingURL=ExpoImageManipulator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","Text","Dimensions","Image","ScrollView","Modal","View","TouchableOpacity","StyleSheet","LogBox","Alert","ImageManipulator","MediaLibrary","File","Paths","PropTypes","AutoHeightImage","withSafeAreaInsets","SafeAreaView","SafeAreaProvider","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","imageRatio","contentHeight","originalHeight","renderedImageWidth","renderedImageHeight","renderedImageY","renderedImageX","renderImageObj","left","top","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$insets","isVisible","onPictureChoosed","topMargin","insets","cropRatio","cropWidth","cropHeight","cropInitialTop","cropInitialLeft","createElement","animationType","transparent","visible","hardwareAccelerated","onRequestClose","undefined","style","styles","container","headerContainer","headerButtonContainer","justifyContent","onPress","headerButton","headerButtonText","onCropImage","onLayout","onContentLayout","contentContainer","edges","position","flex","contentContainerStyle","backgroundColor","maximumZoomScale","minimumZoomScale","onScroll","onHandleScroll","bounces","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","ref","c","scrollView","scrollEventThrottle","scrollEnabled","pinchGestureEnabled","source","resizeMode","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\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\tSafeAreaProvider,\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\tcontentHeight: Dimensions.get(\"window\").height - 100, // fallback until onLayout fires\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\tconst imageRatio = actualHeight / actualWidth;\n\t\tconst { contentHeight } = this.state;\n\t\tconst originalHeight = contentHeight;\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\tonContentLayout = (event) => {\n\t\tthis.setState({\n\t\t\tcontentHeight: event.nativeEvent.layout.height,\n\t\t});\n\t};\n\n\trender() {\n\t\tconst { isVisible, onPictureChoosed } = this.props;\n\t\tconst { uri, base64, cropMode, processing, contentHeight } = this.state;\n\n\t\tconst imageRatio = this.actualSize.height / this.actualSize.width;\n\t\tconst originalHeight = contentHeight;\n\t\tconst topMargin = (this.props.insets?.top ?? 0) + 50;\n\n\t\tconst cropRatio = originalHeight / width;\n\n\t\tconst cropWidth =\n\t\t\timageRatio < cropRatio ? width : originalHeight / imageRatio;\n\t\tconst cropHeight =\n\t\t\timageRatio < cropRatio ? width * imageRatio : originalHeight;\n\n\t\tconst cropInitialTop = (originalHeight - cropHeight) / 2.0;\n\t\tconst 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<SafeAreaProvider>\n\t\t\t\t\t\t<View style={styles.container}>\n\t\t\t\t\t\t\t<SafeAreaView style={[{ width }, styles.headerContainer]}>\n\t\t\t\t\t\t\t\t{!cropMode ? (\n\t\t\t\t\t\t\t\t\t<View\n\t\t\t\t\t\t\t\t\t\tstyle={[\n\t\t\t\t\t\t\t\t\t\t\tstyles.headerButtonContainer,\n\t\t\t\t\t\t\t\t\t\t\t{ justifyContent: \"flex-end\" },\n\t\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\t\t\t\tonPress={() => {\n\t\t\t\t\t\t\t\t\t\t\t\tonPictureChoosed({ uri, base64 });\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\tstyle={styles.headerButton}\n\t\t\t\t\t\t\t\t\t\t>\n\t\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\t</TouchableOpacity>\n\t\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<View style={styles.headerButtonContainer}>\n\t\t\t\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\t\t\t\tonPress={this.onToggleModal}\n\t\t\t\t\t\t\t\t\t\t\tstyle={styles.headerButton}\n\t\t\t\t\t\t\t\t\t\t>\n\t\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\t</TouchableOpacity>\n\t\t\t\t\t\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\t\t\t\t\t\tonPress={() => {\n\t\t\t\t\t\t\t\t\t\t\t\tthis.onCropImage(() => {\n\t\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\t\turi: this.state.uri,\n\t\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\t});\n\t\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\t});\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\tstyle={styles.headerButton}\n\t\t\t\t\t\t\t\t\t\t>\n\t\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\t{processing ? \"Processing\" : \"Done\"}\n\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</SafeAreaView>\n\t\t\t\t\t\t\t<SafeAreaView\n\t\t\t\t\t\t\t\tonLayout={this.onContentLayout}\n\t\t\t\t\t\t\t\tstyle={[styles.contentContainer, { width }]}\n\t\t\t\t\t\t\t\tedges={[\"bottom\"]}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ScrollView\n\t\t\t\t\t\t\t\t\tstyle={{ position: \"relative\", flex: 1 }}\n\t\t\t\t\t\t\t\t\tcontentContainerStyle={{ backgroundColor: \"black\" }}\n\t\t\t\t\t\t\t\t\tmaximumZoomScale={5}\n\t\t\t\t\t\t\t\t\tminimumZoomScale={0.5}\n\t\t\t\t\t\t\t\t\tonScroll={this.onHandleScroll}\n\t\t\t\t\t\t\t\t\tbounces={false}\n\t\t\t\t\t\t\t\t\tshowsHorizontalScrollIndicator={false}\n\t\t\t\t\t\t\t\t\tshowsVerticalScrollIndicator={false}\n\t\t\t\t\t\t\t\t\tref={(c) => (this.scrollView = c)}\n\t\t\t\t\t\t\t\t\tscrollEventThrottle={16}\n\t\t\t\t\t\t\t\t\tscrollEnabled={false}\n\t\t\t\t\t\t\t\t\tpinchGestureEnabled={false}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<AutoHeightImage\n\t\t\t\t\t\t\t\t\t\tstyle={{ backgroundColor: \"black\" }}\n\t\t\t\t\t\t\t\t\t\tsource={{ uri }}\n\t\t\t\t\t\t\t\t\t\tresizeMode={imageRatio >= 1 ? \"contain\" : \"contain\"}\n\t\t\t\t\t\t\t\t\t\twidth={width}\n\t\t\t\t\t\t\t\t\t\theight={originalHeight}\n\t\t\t\t\t\t\t\t\t\tonLayout={this.calculateMaxSizes}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{!!cropMode && (\n\t\t\t\t\t\t\t\t\t\t<ImageCropOverlay\n\t\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\t\tthis.currentSize.width = width;\n\t\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\t\tthis.currentPos.top = top;\n\t\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\t}}\n\t\t\t\t\t\t\t\t\t\t\tinitialWidth={cropWidth}\n\t\t\t\t\t\t\t\t\t\t\tinitialHeight={cropHeight}\n\t\t\t\t\t\t\t\t\t\t\tinitialTop={cropInitialTop}\n\t\t\t\t\t\t\t\t\t\t\tinitialLeft={cropInitialLeft}\n\t\t\t\t\t\t\t\t\t\t\tminHeight={100}\n\t\t\t\t\t\t\t\t\t\t\tminWidth={100}\n\t\t\t\t\t\t\t\t\t\t\ttopMargin={topMargin}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</ScrollView>\n\t\t\t\t\t\t\t</SafeAreaView>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</SafeAreaProvider>\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,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,6CAA6C;AAClE,SACCC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,KAAK,EACLC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,EACVC,MAAM,EACNC,KAAK,QACC,cAAc;AACrB,OAAO,KAAKC,gBAAgB,MAAM,wBAAwB;AAC1D,OAAO,KAAKC,YAAY,MAAM,oBAAoB;AAClD,SAASC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;AAC9C,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,eAAe,MAAM,gCAAgC;AAC5D,SACCC,kBAAkB,EAClBC,YAAY,EACZC,gBAAgB,QACV,gCAAgC;AACvC,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,MAAM;EAAEC;AAAM,CAAC,GAAGnB,UAAU,CAACoB,GAAG,CAAC,QAAQ,CAAC;AAE1Cb,MAAM,CAACc,UAAU,CAAC,CACjB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,CACpB,CAAC;AACFd,MAAM,CAACc,UAAU,CAAC,CACjB,2CAA2C,EAC3C,kDAAkD,EAClD,gCAAgC,CAChC,CAAC;AAEF,MAAMC,oBAAoB,SAASxB,SAAS,CAAC;EAC5CyB,WAAWA,CAACC,KAAK,EAAE;IAClB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,wBA4EE,MAAM;MACrB,IAAI,CAACD,KAAK,CAACE,aAAa,CAAC,CAAC;MAC1B,IAAI,CAACC,QAAQ,CAAC;QAAEC,QAAQ,EAAE;MAAM,CAAC,CAAC;IACnC,CAAC;IAAAH,eAAA,sBAEa,CAACI,QAAQ,GAAG,IAAI,KAAK;MAClC,IAAI,CAACF,QAA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