amotify 0.2.157 → 0.2.158

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.
@@ -2,7 +2,7 @@ import ReactDOMClient from 'react-dom/client'
2
2
  import * as ReactRouterDOM from 'react-router-dom'
3
3
  import React,{ StrictMode,useEffect,useState } from 'react'
4
4
 
5
- import $$,{ UUID } from 'jmini'
5
+ import $$,{ Filer,UUID } from 'jmini'
6
6
 
7
7
  import {
8
8
  Config,
@@ -14,6 +14,8 @@ import {
14
14
  Button,
15
15
  Plate,
16
16
  Column,
17
+ Cropper,
18
+ Img,
17
19
  } from 'amotify'
18
20
 
19
21
  import '../../dist/@styles/style.css'
@@ -32,11 +34,43 @@ let Test = () => {
32
34
 
33
35
  let accordionID = 'accordionIDD'
34
36
 
37
+ let [ val_image,set_image ] = useState( '' )
38
+
35
39
  return <Box>
36
40
  <Plate size='S'>
37
41
  <Column
38
42
  padding={ 2 }
39
43
  >
44
+ <Button.Prime
45
+ onClick={ () => {
46
+ Cropper.openDialogNEdit( {
47
+ // use: '16:9',
48
+ // use: '9:16',
49
+
50
+ // use: '3:4',
51
+ // use: '4:3',
52
+
53
+ use: [ 9,16 ],
54
+
55
+ develops: [
56
+ { size: 'L' }
57
+ ],
58
+ onProcessFinished: async ( files ) => {
59
+ console.log( files )
60
+
61
+ let filer = await await Filer.fromFile( files[ 0 ] )
62
+ set_image( await filer.toDataURL() )
63
+ }
64
+ } )
65
+ } }
66
+ >
67
+ Submit
68
+ </Button.Prime>
69
+
70
+ { val_image && <Img
71
+ src={ val_image }
72
+ /> }
73
+
40
74
  <Input.Select
41
75
  options={ [
42
76
  { value: 'option1',label: 'Option 1',searchValue: 'Option 1' },