mg-library 1.0.492 → 1.0.493

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.
Files changed (2) hide show
  1. package/blocks.js +0 -119
  2. package/package.json +1 -1
package/blocks.js CHANGED
@@ -89,10 +89,6 @@ export function MGWelcome(props) {
89
89
  <Text>
90
90
  <Text style={{ marginBottom: 10 }}>{item.content}</Text>
91
91
  </Text>
92
- <Text>
93
- <Text style={{ marginBottom: 10 }}>{item.imageUrl}</Text>
94
- </Text>
95
-
96
92
  </Card>
97
93
  )}
98
94
  ListHeaderComponent={listHeaderComponent}
@@ -103,20 +99,6 @@ export function MGWelcome(props) {
103
99
 
104
100
  }
105
101
 
106
- async function getImageDimensions(uuid) {
107
- try {
108
- const response = await fetch('https://ucarecdn.com/${uuid}/-/metadata/');
109
- const data = await response.json();
110
- return data.image_info ? {
111
- width: data.image_info.width,
112
- height: data.image_info.height
113
- } : null;
114
- } catch (error) {
115
- console.error(error);
116
- return null;
117
- }
118
- }
119
-
120
102
  export function MGLogin(props) {
121
103
 
122
104
  const [isKeyboardVisible, setIsKeyboardVisible] = useState(false);
@@ -304,100 +286,6 @@ function getHeightForCamera() {
304
286
  return Dimensions.get('window').height;
305
287
  }
306
288
 
307
- /* export function MGCamera(props) {
308
- let camera;
309
- let captureWidth = 0;
310
- let captureHeight = 0;
311
- try {
312
- captureWidth = Math.floor(getWidthForCamera() * 0.47);
313
- captureHeight = Math.floor(getHeightForCamera() * 0.31);
314
- } catch (error) {
315
- captureWidth = 205;
316
- captureHeight = 275;
317
- }
318
- const __takePicture = async () => {
319
- if (!camera)
320
- return;
321
- let photo = await camera.takePictureAsync({ quality: 1 });
322
- props.dispatch(props.actions.startProcessing());
323
- photo = await ImageManipulator.manipulateAsync(
324
- photo.uri,
325
- [{ resize: { width: captureWidth, height: captureHeight } }],
326
- { compress: 1, format: ImageManipulator.SaveFormat.JPEG }
327
- );
328
- photo = await ImageManipulator.manipulateAsync(
329
- photo.uri,
330
- [{ flip: 'horizontal' }],
331
- { compress: 1, format: ImageManipulator.SaveFormat.JPEG }
332
- );
333
- props.process.fileUri = photo.uri;
334
- props.process.goForward(props.nextStep);
335
- props.dispatch(props.actions.endProcessing());
336
- }
337
- const [type, setType] = useState(Camera.Constants.Type.front);
338
- const FlipIcon = () => (
339
- <MaterialCommunityIcons
340
- name='camera-flip-outline'
341
- size={30}
342
- style={{ color: 'white' }} />
343
- );
344
- const TakeIcon = () => (
345
- <MaterialCommunityIcons
346
- name='camera-outline'
347
- size={30}
348
- style={{ color: 'white' }} />
349
- );
350
- const cardHeader = (
351
- <View style={{ marginLeft: 15, marginTop: 10, marginBottom: 10 }}>
352
- <Text category='h6'>{mgFunctionsLib.i18nString('photo', props.language)}</Text>
353
- <Text>{mgFunctionsLib.i18nString('takePhoto', props.language)}</Text>
354
- </View>
355
- );
356
- const cardFooter = (
357
- <View>
358
- <View style={{ flexDirection: 'row' }}>
359
- <View style={{ flex: 1, alignItems: 'center' }}>
360
- <Button
361
- style={{ width: 150 }}
362
- status='primary'
363
- accessoryLeft={FlipIcon}
364
- onPress={() => {
365
- setType(
366
- type === Camera.Constants.Type.back ? Camera.Constants.Type.front : Camera.Constants.Type.back
367
- )
368
- }}>
369
- <Text>{mgFunctionsLib.i18nString('doInvertCamera', props.language)}</Text>
370
- </Button>
371
- </View>
372
- <View style={{ flex: 1, alignItems: 'center' }}>
373
- <Button
374
- style={{ width: 150 }}
375
- status='primary'
376
- accessoryLeft={TakeIcon}
377
- onPress={__takePicture}>
378
- <Text>{mgFunctionsLib.i18nString('doTakePhoto', props.language)}</Text>
379
- </Button>
380
- </View>
381
- </View>
382
- </View>
383
- );
384
- return (
385
- <View>
386
- <Card header={cardHeader} footer={cardFooter}>
387
- <View style={{ alignItems: 'center' }}>
388
- <Camera
389
- style={{ width: captureWidth, height: captureHeight }}
390
- type={type}
391
- ref={(r) => {
392
- camera = r
393
- }}>
394
- </Camera>
395
- </View>
396
- </Card>
397
- </View>
398
- )
399
- } */
400
-
401
289
  export function MGCamera(props) {
402
290
  let camera;
403
291
  let captureWidth = 0;
@@ -634,13 +522,6 @@ export function MGGoBack(props) {
634
522
  color={props.theme['color-primary-500']}
635
523
  onPress={() => props.process.goBack()} />
636
524
  );
637
- /* return (
638
- <View style={{ flexGrow: 1, alignItems: 'flex-start', marginTop: -20 }}>
639
- <Button
640
- appearance='ghost'
641
- accessoryLeft={goBackIcon} />
642
- </View>
643
- ) */
644
525
  return (
645
526
  <View style={{ alignItems: 'flex-start', marginTop: -20 }}>
646
527
  <Button
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mg-library",
3
- "version": "1.0.492",
3
+ "version": "1.0.493",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {