@hubsync/esign-web-sdk-react 6.3.5

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Ionic
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # Verdocs React SDK
2
+
3
+ > Library of components and embeds to quickly build Verdocs-enabled apps in React.
4
+
5
+ This SDK provides UI controls and components for building rich, Verdocs-enabled document signing experiences for the Web. Components
6
+ are built in [StencilJS](https://stenciljs.com/) for maximum portability between front-end frameworks. This package contains the
7
+ React framework components - for Angular or Vue, please see the parent repository.
8
+
9
+ ## Installation
10
+
11
+ Begin by installing the SDK into your app. Currently React >= 16.7.0 is supported. You will also need the Verdocs JS SDK:
12
+
13
+ npm i -S @verdocs/web-sdk-react @verdocs/js-sdk
14
+
15
+ or:
16
+
17
+ yarn add @verdocs/web-sdk-react @verdocs/js-sdk
18
+
19
+ Then authenticate to the Verdocs API somewhere in your app. The best way to do this is by logging in with a username/password
20
+ created at [Verdocs.com](https://verdocs.com). Most Web applications have some type of login process, and if your app uses the
21
+ same username/password for access, you can reuse that for this step:
22
+
23
+ ```typescript
24
+ import {Auth} from '@verdocs/js-sdk/Users';
25
+ import {Transport} from '@verdocs/js-sdk/HTTP';
26
+
27
+ try {
28
+ const {accessToken} = await Auth.authenticateUser({
29
+ username: MY_USERNAME,
30
+ password: MY_PASSWORD,
31
+ });
32
+ console.log('Authenticated to Verdocs', accessToken.substring(0, 10));
33
+ Transport.setAuthToken(accessToken);
34
+ } catch (e) {
35
+ console.error('Unable to authenticate to Verdocs.', e);
36
+ }
37
+ ```
38
+
39
+ Note that the components in this library leverage the same underlying Verdocs JS SDK that you can call directly from your code.
40
+ Authenticating via the above process will provide access both for the JS SDK and this library's components at the same time.
41
+
42
+ ## Usage
43
+
44
+ ```typescript jsx
45
+ import { PdfViewer } from "@verdocs/web-sdk-react";
46
+
47
+ export const SimplePDFView: FC = () => {
48
+ const templateId = "c3fc6310-bf9d-47a1-b0ad-daf2bbf657c2";
49
+ const documentId = "ed117472-4d4e-4c62-9386-af047a3373a2";
50
+ const pdfurl = `https://api.verdocs.com/templates/${templateId}/documents/${documentId}?file=true`;
51
+
52
+ return (
53
+ <div style={{ width: 600, height: 800 }}>
54
+ <PdfViewer src={pdfUrl} />
55
+ </div>
56
+ );
57
+ };
58
+ ```
59
+
60
+ Components available in this package are broken down into three categories:
61
+
62
+ - `controls` - Low level UI controls such as drop-downs, buttons, etc. UI controls should be 100% independent from one another. If
63
+ a control requires data to operate properly, it should be passed in as a property (controls should not call the API directly).
64
+ - `elements` - Elements are widgets that combine one or more controls and potentially additional business logic into a functional unit,
65
+ such as a search result entry, a Template preview "card", or a document "actions" menu (with appropriate logic to hide/show certain
66
+ options that may not be available based on the document's state). Elements are more complex than simple controls, but still require the
67
+ parent to provide some data, control, and business logic.
68
+ - `embeds` - Embeds are fully functional "mini-apps". If provided with appropriate configurations (e.g API endpoints and authorization
69
+ details) they can be used to represent entire experiences such as document preview, document signing, or search.
70
+
71
+ For more information, please refer to the [Verdocs Embeds Documentation](https://developers.verdocs.com/embeds/index.html).
72
+
73
+ ## Styles and Fonts
74
+
75
+ Most of the widgets in this library specify "Barlow" as the default font, but do not include it as a dependency to keep the package size
76
+ as small as possible. To support Barlow in your own app, including the following lines of code in your `<head>` tag:
77
+
78
+ ```html
79
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
80
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
81
+ <link href="https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;700&display=swap" rel="stylesheet" />
82
+ ```
83
+
84
+ ## compomnents.ts fixups
85
+
86
+ Replace
87
+
88
+ `import type { JSX } from '@verdocs/web-sdk/components';`
89
+
90
+ with
91
+
92
+ `import type { JSX } from '@verdocs/web-sdk/dist/types';`