@planningcenter/core-automations 0.1.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/CHANGELOG.md +16 -0
- package/README.md +68 -0
- package/dist/cjs/core-automations.esm.js +2 -0
- package/dist/cjs/core-automations.esm.js.map +1 -0
- package/dist/cjs/core-automations.js +2 -0
- package/dist/cjs/core-automations.js.map +1 -0
- package/dist/cjs/core-automations.modern.mjs +2 -0
- package/dist/cjs/core-automations.modern.mjs.map +1 -0
- package/dist/cjs/core-automations.umd.js +2 -0
- package/dist/cjs/core-automations.umd.js.map +1 -0
- package/dist/types/src/automations.d.ts +19 -0
- package/dist/types/src/automations.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/tests/setupJest.d.ts +2 -0
- package/dist/types/tests/setupJest.d.ts.map +1 -0
- package/package.json +73 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2023-03-14
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Set up intial repo with components extracted from People's original implementation.
|
|
13
|
+
- Set up basic theme that includes necessary icons along with host app styles.
|
|
14
|
+
- Add basic usage information to README.
|
|
15
|
+
|
|
16
|
+
[0.1.0]: https://github.com/planningcenter/core-automations/releases/tag/v0.1.0
|
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @planningcenter/core-automations
|
|
2
|
+
|
|
3
|
+
A package for implementing core automations in a product.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn add @planningcenter/core-automations
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Displaying Core Automations
|
|
14
|
+
|
|
15
|
+
```jsx
|
|
16
|
+
import { Automations } from "@planningcenter/core-automation"
|
|
17
|
+
|
|
18
|
+
...
|
|
19
|
+
|
|
20
|
+
<Automations
|
|
21
|
+
blankStateDescription="Automations supercharge your form..."
|
|
22
|
+
currentPersonCanCreate={true}
|
|
23
|
+
currentPersonId={123456789}
|
|
24
|
+
defaultApp="people"
|
|
25
|
+
theme={theme} // Tapestry-React theme object
|
|
26
|
+
triggerConditions={{ data: { relationships: { form: { data: { id: form.id } } } } }}
|
|
27
|
+
triggerName="people.v2.events.form_submission.created"
|
|
28
|
+
triggerResource="vzfnx3tc87lx1c1d8Ak1clkrwqZfnA294t..."
|
|
29
|
+
/>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
#### Props
|
|
33
|
+
|
|
34
|
+
- `blankStateDescription` (string): Text to be displayed when there are no current automations
|
|
35
|
+
- `currentPersonCanCreate` (boolean): Can the user create an automation?
|
|
36
|
+
- `currentPersonId` (number): ID of current user
|
|
37
|
+
- `defaultApp` (string): Which app should be selected by default?
|
|
38
|
+
- `theme` (object) optional: Accepts a [Tapestry-React theme object](https://planningcenter.github.io/tapestry-react/theming)
|
|
39
|
+
- `triggerConditions` (object): The specific conditions for triggering this automation
|
|
40
|
+
- `triggerName` (string): Name of trigger
|
|
41
|
+
- `triggerResource` (string): An encrypted trigger resource
|
|
42
|
+
|
|
43
|
+
### Theming
|
|
44
|
+
|
|
45
|
+
Each host app can pass in a `Tapestry-React` theme file to the `theme` prop to customize the colors and styles of the component. Although some UI elements will remain consistent across all apps, the colors and styles of `<Button>`s and `<Link>`s will be directly affected by the `theme` oject passed in. If none is passed in, the default `Tapestry-React` theme will be used.
|
|
46
|
+
|
|
47
|
+
If your app is already using `Tapestry-React`, you can simply reuse whatever you normally pass to `ThemeProvider`. If your app is not currently using `Tapestry-React`, you can create a simple theme object that defines the `primary` colors to be used. Although there are plenty of other values that can be defined, the following colors that start with `primary*` are the most important.
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
const theme = {
|
|
51
|
+
colors: {
|
|
52
|
+
primary: "#4076e2",
|
|
53
|
+
primaryLight: "#6590e7",
|
|
54
|
+
primaryLighter: "#adc3f0",
|
|
55
|
+
primaryLightest: ...,
|
|
56
|
+
primaryDark: ...,
|
|
57
|
+
primaryDarker: ...,
|
|
58
|
+
primaryDarkest: ...,
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
For more information about theming in Tapestry-React, see <https://planningcenter.github.io/tapestry-react/theming>.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## Contributing
|
|
67
|
+
|
|
68
|
+
If you'd like to contribute, you can find details for getting started in the [contribution guide](/CONTRIBUTING.md).
|