@joyfill/components 1.0.0-rc.1.0.0

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 ADDED
@@ -0,0 +1,84 @@
1
+ ## Install
2
+
3
+ `npm install @joyfill/components`
4
+ or
5
+ `yarn add @joyfill/components`
6
+
7
+ ## Getting Started
8
+
9
+ Head over to [Joyfill developer docs](https://joyfill.readme.io/docs/quick-start) to learn more, find guided tutorials and much more.
10
+
11
+ ## Usage
12
+
13
+ ```
14
+
15
+ import { JoyDoc } from '@joyfill/components';
16
+
17
+ const App = () => {
18
+ return (
19
+ <JoyDoc
20
+ mode="edit"
21
+ onChange={(params, changes, doc) => console.log(params, changes, doc)}
22
+ />
23
+ );
24
+ }
25
+
26
+ ```
27
+
28
+ ## JoyDoc Properties
29
+
30
+ * `mode: 'edit' | 'fill' | 'readonly'`
31
+ * **Required***
32
+ * Enables and disables certain JoyDoc functionality and features.
33
+ * Options
34
+ * `edit` is the mode where the form/pdf is desinged, styled, and configured.
35
+ * `fill` is the mode where you simply input the field data into the built form/pdf.
36
+ * `readonly` is the mode where everything is locked down and you're simply viewing the form/pdf and the inputed data.
37
+ * `doc: object`
38
+ * The default JoyDoc JSON starting object to load into the component view. Must be in the JoyDoc JSON data structure.
39
+ * `fieldOptions: [object, ...]`
40
+ * Overwrite the list of field options that can be dragged and dropped on the form/pdf.
41
+ * Field option objects can have any JoyDoc JSON property. Any property set will be used as the new field defaults when dragged and dropped to the form/pdf.
42
+ * `fieldSettings: object`
43
+ * Enable and disable default file, page, and field settings. You can also add your own custom metadata settings components to the UI.
44
+ * Head over to the [developer docs](https://joyfill.readme.io/docs/quick-start) to learn more about customizing settings.
45
+ * `onChange: (params: object, changes: object, doc: object) => {}`
46
+ * Used to listen to any changes to the style, layout, values, etc. across all modes.
47
+ * `params: object`
48
+ * `target: ('file' | 'page' | 'field')` Determines the object within the doc (JoyDoc JSON structure) that was targeted with the change event.
49
+ * `fileId` The id of the file that the change happened.
50
+ * `pageId` The id of the page that the change happened.
51
+ * `fieldId` The id of the field that the change happened.
52
+ * `fieldIdentifier` The custom id of the field that the change happened.
53
+ * `changes: object`
54
+ * Can contain any of the JoyDoc JSON structure supported properties.
55
+ * `doc: object`
56
+ * Fully updated doc (JoyDoc JSON structure) after all changes have been applied.
57
+ * `onUploadAsync: (params: object, fileUploads) => Promise`
58
+ * **Required,** if you want to support PDF uploads, page backgrounds, and image fields.
59
+ * Must return a promise that will resolve to `{ url: string }`.
60
+ * `url` must be a valid image url or image base64 uri.
61
+ * Utilize this handler to upload images for fields, page backgrounds, etc. to your own asset hosting service.
62
+ * `params: object`
63
+ * `target: ('file' | 'page' | 'field')` Determines the object within the doc (JoyDoc JSON structure) that was targeted with the change event.
64
+ * `fileId` The id of the file that the change happened.
65
+ * `pageId` The id of the page that the change happened.
66
+ * `fieldId` The id of the field that the change happened.
67
+ * `fieldIdentifier` The custom id of the field that the change happened.
68
+
69
+
70
+ ## Contributing
71
+
72
+ **Environment Versions**
73
+
74
+ * Module manage `yarn`
75
+ * Node version `18+`
76
+
77
+ **Commands**
78
+
79
+ * Run Tests `yarn run test`
80
+ * Coverage Report `yarn run coverage`
81
+ * Auto Fix Linting Errors `yarn run lint-fix`
82
+ * See Linting Linting `yarn run lint`
83
+ * Generate Visual Coverage Report `yarn coverage-report -- filename`
84
+