react-native-signature-canvas 4.7.0 → 4.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -50,44 +50,45 @@ import SignatureScreen from 'react-native-signature-canvas';
50
50
 
51
51
  ---
52
52
 
53
- | Prop | Type | Description |
54
- |:------------------------------------| :--------: |:------------------------------------------------------------------------------------------------------------------------------------------------------|
55
- | androidHardwareAccelerationDisabled | `boolean` | androidHardwareAccelerationDisabled for react-native-webview. Default is false |
56
- | autoClear | `boolean` | should auto clear the signature after clicking the Confirm button |
57
- | backgroundColor | `string` | default is "rgba(255,255,255,0)" (_transparent_), background color of the canvas |
58
- | bgHeight | `number` | height of the background image |
59
- | bgWidth | `number` | width of the background image |
60
- | bgSrc | `string` | background image source uri (_url_) |
61
- | clearText | `string` | clear button text |
62
- | confirmText | `string` | save button text |
63
- | customHtml | `(injectedJavaScript: string) => string` | html string that lets you modify things like the layout or elements |
64
- | dataURL | `string` | default is "", Base64 string, draws saved signature from dataURL. |
65
- | descriptionText | `string` | description text for signature |
66
- | dotSize | `number` | radius of a single dot _(not stroke width)_ |
67
- | imageType | `string` | "image/png" (_default_), "image/jpeg"、"image/svg+xml", imageType of exported signature |
68
- | minWidth | `number` | minimum width of a line. Defaults to 0.5 |
69
- | maxWidth | `number` | maximum width of a line. Defaults to 2.5 |
70
- | onOK | `function` | callback function after saving non-empty signature |
71
- | onEmpty | `function` | callback function after trying to save an empty signature |
72
- | onClear | `function` | callback function after clearing the signature |
73
- | onGetData |`function`| callback function when getData() is called
74
- | onBegin | `function` | callback function when a new stroke is started |
75
- | onEnd | `function` | callback function when the stroke has ended |
76
- | onLoadEnd | `function` | callback function when the webview canvas load ended |
77
- | onUndo | `function` | callback function when undo() is called |
78
- | onRedo | `function` | callback function when redo() is called |
79
- | onDraw | `function` | callback function when drawing is enabled |
80
- | onErase | `function` | callback function when erasing is enabled |
81
- | onChangePenColor | `function` | callback function after changing the pen color |
82
- | onChangePenSize | `function` | callback function after changing the pen size
83
- | overlayHeight |`number`| height of the overlay image |
84
- | overlayWidth |`number`| width of the overlay image |
85
- | overlaySrc |`string`| overlay image source uri (url) _must be .png with a transparent background_
86
- | penColor | `string` | default is "black", color of pen |
87
- | rotated | `boolean` | rotate signature pad 90 degrees |
88
- | style | `object` | style of wrapper view |
89
- | trimWhitespace | `boolean` | trim image whitespace |
90
- | webStyle | `string` | webview style for overwrite default style, all style: https://github.com/YanYuanFE/react-native-signature-canvas/blob/master/h5/css/signature-pad.css |
53
+ | Prop | Type | Description |
54
+ |:------------------------------------|:----------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------|
55
+ | androidHardwareAccelerationDisabled | `boolean` | androidHardwareAccelerationDisabled for react-native-webview. Default is false |
56
+ | autoClear | `boolean` | should auto clear the signature after clicking the Confirm button |
57
+ | backgroundColor | `string` | default is "rgba(255,255,255,0)" (_transparent_), background color of the canvas |
58
+ | bgHeight | `number` | height of the background image |
59
+ | bgWidth | `number` | width of the background image |
60
+ | bgSrc | `string` | background image source uri (_url_) |
61
+ | clearText | `string` | clear button text |
62
+ | confirmText | `string` | save button text |
63
+ | customHtml | `(injectedJavaScript: string) => string` | html string that lets you modify things like the layout or elements |
64
+ | dataURL | `string` | default is "", Base64 string, draws saved signature from dataURL. |
65
+ | descriptionText | `string` | description text for signature |
66
+ | dotSize | `number` | radius of a single dot _(not stroke width)_ |
67
+ | imageType | `string` | "image/png" (_default_), "image/jpeg"、"image/svg+xml", imageType of exported signature |
68
+ | minWidth | `number` | minimum width of a line. Defaults to 0.5 |
69
+ | maxWidth | `number` | maximum width of a line. Defaults to 2.5 |
70
+ | onOK | `function` | callback function after saving non-empty signature |
71
+ | onEmpty | `function` | callback function after trying to save an empty signature |
72
+ | onClear | `function` | callback function after clearing the signature |
73
+ | onGetData | `function` | callback function when getData() is called
74
+ | onBegin | `function` | callback function when a new stroke is started |
75
+ | onEnd | `function` | callback function when the stroke has ended |
76
+ | onLoadEnd | `function` | callback function when the webview canvas load ended |
77
+ | onUndo | `function` | callback function when undo() is called |
78
+ | onRedo | `function` | callback function when redo() is called |
79
+ | onDraw | `function` | callback function when drawing is enabled |
80
+ | onErase | `function` | callback function when erasing is enabled |
81
+ | onChangePenColor | `function` | callback function after changing the pen color |
82
+ | onChangePenSize | `function` | callback function after changing the pen size
83
+ | overlayHeight | `number` | height of the overlay image |
84
+ | overlayWidth | `number` | width of the overlay image |
85
+ | overlaySrc | `string` | overlay image source uri (url) _must be .png with a transparent background_
86
+ | penColor | `string` | default is "black", color of pen |
87
+ | rotated | `boolean` | rotate signature pad 90 degrees |
88
+ | style | `object` | style of wrapper view |
89
+ | trimWhitespace | `boolean` | trim image whitespace |
90
+ | webStyle | `string` | webview style for overwrite default style, all style: https://github.com/YanYuanFE/react-native-signature-canvas/blob/master/h5/css/signature-pad.css |
91
+ | androidLayerType | `none、software、hardware` | Sets the android webview layerType |
91
92
 
92
93
  ## Methods
93
94
 
package/h5/html.js CHANGED
@@ -3,7 +3,7 @@ export default (script) =>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="utf-8">
6
- <title>Signature Pad demo</title>
6
+ <title>Signature Canvas</title>
7
7
  <meta name="description" content="Signature Pad - HTML5 canvas based smooth signature drawing using variable width spline interpolation.">
8
8
 
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
package/index.d.ts CHANGED
@@ -47,6 +47,7 @@ declare module "react-native-signature-canvas" {
47
47
  trimWhitespace?: boolean;
48
48
  webStyle?: string;
49
49
  webviewContainerStyle?: StyleProp<ViewStyle>;
50
+ androidLayerType?: "none" | "software" | "hardware";
50
51
  }
51
52
 
52
53
  export type SignatureViewRef = {
package/index.js CHANGED
@@ -72,6 +72,7 @@ const SignatureView = forwardRef(
72
72
  trimWhitespace = false,
73
73
  webStyle = "",
74
74
  webviewContainerStyle = null,
75
+ androidLayerType = "hardware",
75
76
  },
76
77
  ref
77
78
  ) => {
@@ -265,7 +266,7 @@ const SignatureView = forwardRef(
265
266
  bounces={false}
266
267
  style={[webviewContainerStyle]}
267
268
  scrollEnabled={scrollable}
268
- androidLayerType="hardware"
269
+ androidLayerType={androidLayerType}
269
270
  androidHardwareAccelerationDisabled={
270
271
  androidHardwareAccelerationDisabled
271
272
  }
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "react-native-signature-canvas",
3
- "version": "4.7.0",
3
+ "version": "4.7.1",
4
4
  "description": "React Native Signature Component based Canvas for Android && IOS && expo",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "publish": "npm publish",
8
7
  "genlog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
9
8
  "postversion": "git push --follow-tags"
10
9
  },