Skip to content

Commit 5ecb218

Browse files
authored
Update Workflows (#46)
* Consolidate triggers. * Re-add navigation * Add workflow image * Remove google tag manager * Update images.
1 parent a5b3fda commit 5ecb218

25 files changed

+1381
-555
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
id: samelogic-js.elementeventprops.delaydefaultbehavior
3+
title: ElementEventProps.delayDefaultBehavior property
4+
hide_title: true
5+
---
6+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
7+
8+
[@samelogic/samelogic-js](./samelogic-js.md) &gt; [ElementEventProps](./samelogic-js.elementeventprops.md) &gt; [delayDefaultBehavior](./samelogic-js.elementeventprops.delaydefaultbehavior.md)
9+
10+
## ElementEventProps.delayDefaultBehavior property
11+
12+
If the element had a default behavior, it will be delayed until the workflow is completed.
13+
14+
<b>Signature:</b>
15+
16+
```typescript
17+
delayDefaultBehavior?: boolean;
18+
```

docs/references/sdks/web/reference/samelogic-js.elementeventprops.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ export interface ElementEventProps extends TriggerEventProps
2323
| Property | Type | Description |
2424
| --- | --- | --- |
2525
| [cssSelector](./samelogic-js.elementeventprops.cssselector.md) | string | The CSS Selector of the element that was clicked or hovered over. |
26+
| [delayDefaultBehavior?](./samelogic-js.elementeventprops.delaydefaultbehavior.md) | boolean | <i>(Optional)</i> If the element had a default behavior, it will be delayed until the workflow is completed. |
2627
| [event](./samelogic-js.elementeventprops.event.md) | 'ElementClick' &#124; 'ElementMouseOver' | |

docs/references/sdks/web/reference/samelogic-js.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ The main entry point to samelogic.js is the [Samelogic](./samelogic-js.samelogic
2727
| [PageEventProps](./samelogic-js.pageeventprops.md) | The shape of the payload for the PageView event. |
2828
| [StepConfig](./samelogic-js.stepconfig.md) | |
2929
| [StepNeeds](./samelogic-js.stepneeds.md) | |
30-
| [TriggerConfig](./samelogic-js.triggerconfig.md) | The configuration of a trigger. Triggers are made up of events. All events must be met before the trigger is fired. The order of the event is not taken into account. |
3130
| [TriggerEventProps](./samelogic-js.triggereventprops.md) | The properties of an event. |
3231
| [WorkflowConfig](./samelogic-js.workflowconfig.md) | This is the configuration of a workflow. Workflows are made up of steps and triggers. Triggers are events used to trigger the execution of steps. |
3332

3433
## Type Aliases
3534

3635
| Type Alias | Description |
3736
| --- | --- |
37+
| [TriggerConfig](./samelogic-js.triggerconfig.md) | The configuration of a trigger. |
3838
| [TriggerEvents](./samelogic-js.triggerevents.md) | The different trigger events that are supported. The properties of this object is dependent on the [TriggerEventProps.event](./samelogic-js.triggereventprops.event.md) property. |
3939
| [TriggerEventType](./samelogic-js.triggereventtype.md) | The type of event. This will determine what properties of [TriggerEvents](./samelogic-js.triggerevents.md) are required. |

docs/references/sdks/web/reference/samelogic-js.triggerconfig.events.md

-18
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
11
---
22
id: samelogic-js.triggerconfig
3-
title: TriggerConfig interface
3+
title: TriggerConfig type
44
hide_title: true
55
---
66
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
77

88
[@samelogic/samelogic-js](./samelogic-js.md) &gt; [TriggerConfig](./samelogic-js.triggerconfig.md)
99

10-
## TriggerConfig interface
10+
## TriggerConfig type
1111

12-
The configuration of a trigger. Triggers are made up of events. All events must be met before the trigger is fired. The order of the event is not taken into account.
12+
The configuration of a trigger.
1313

1414
<b>Signature:</b>
1515

1616
```typescript
17-
export interface TriggerConfig
17+
export declare type TriggerConfig = TriggerEvents;
1818
```
19-
20-
## Properties
21-
22-
| Property | Type | Description |
23-
| --- | --- | --- |
24-
| [events](./samelogic-js.triggerconfig.events.md) | [TriggerEvents](./samelogic-js.triggerevents.md)<!-- -->\[\] | The events that must be met before the trigger is fired. |
19+
**References:** [TriggerEvents](./samelogic-js.triggerevents.md)

docs/references/sdks/web/reference/samelogic-js.workflowconfig.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ When the Samelogic SDK is initialized, the workflow configuration is loaded and
2727
| --- | --- | --- |
2828
| [name](./samelogic-js.workflowconfig.name.md) | string | The name given to the workflow. |
2929
| [steps](./samelogic-js.workflowconfig.steps.md) | [StepConfig](./samelogic-js.stepconfig.md)<!-- -->\[\] | The configuration of all the steps to be executed when the trigger is fired. |
30-
| [trigger?](./samelogic-js.workflowconfig.trigger.md) | [TriggerConfig](./samelogic-js.triggerconfig.md) | <i>(Optional)</i> The configuration of the trigger. |
30+
| [triggers?](./samelogic-js.workflowconfig.triggers.md) | [TriggerConfig](./samelogic-js.triggerconfig.md)<!-- -->\[\] | <i>(Optional)</i> A list of events or conditions that needs to be met to trigger the execution of the steps. If this is not specified, the trigger will be executed immediately. The order of the trigger is not taken into account. |

docs/references/sdks/web/reference/samelogic-js.workflowconfig.trigger.md

-18
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
id: samelogic-js.workflowconfig.triggers
3+
title: WorkflowConfig.triggers property
4+
hide_title: true
5+
---
6+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
7+
8+
[@samelogic/samelogic-js](./samelogic-js.md) &gt; [WorkflowConfig](./samelogic-js.workflowconfig.md) &gt; [triggers](./samelogic-js.workflowconfig.triggers.md)
9+
10+
## WorkflowConfig.triggers property
11+
12+
A list of events or conditions that needs to be met to trigger the execution of the steps. If this is not specified, the trigger will be executed immediately. The order of the trigger is not taken into account.
13+
14+
<b>Signature:</b>
15+
16+
```typescript
17+
triggers?: TriggerConfig[];
18+
```

docs/workflows/data_mapping.mdx

+5
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ title: Data Mapping
44
sidebar_label: Data Mapping
55
slug: /workflows/data_mapping
66
---
7+
8+
import Image from "@theme/IdealImage";
9+
import workflowImg from "./images/data-mapping-workflow.png";
10+
11+
<Image height={600} img={workflowImg} />
Loading
Loading
28.2 KB
Loading
53.7 KB
Loading

docs/workflows/overview.mdx

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ title: Workflows Overview
44
slug: /workflows
55
---
66

7-
Workflows make it easy to automate various steps that should happen during an experiment.
7+
import Image from "@theme/IdealImage";
8+
import workflowImg from "./images/workflow-example.png";
9+
10+
Workflows make it easy to run various actions that should happen for an experiment. Workflows are made up of one or more steps that can be executed by one or more trigger events.
11+
12+
<Image height={500} img={workflowImg} />
813

914
### Triggers
1015

11-
Triggers are defined as a list of events that occur in the application to start the workflow. Please see [Triggers Overview documentation](./workflows/triggers) for more details.
16+
Triggers are a a list of events that occurs in the application to start the workflow. For example, a trigger can be configured to fire when the user clicks on an element on a specific page. Please see [Triggers Overview documentation](./workflows/triggers) for more details.
1217

1318
### Steps
1419

15-
Steps are defined as a group of actions that are executed after a workflow is triggered. Please see [Steps Overview documentation](./steps)
20+
Steps are a set of actions that are executed after a workflow is triggered. Please see [Steps Overview documentation](./steps)

docs/workflows/triggers.mdx

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
id: triggers
3+
title: Workflow Triggers
4+
sidebar_label: Triggers
5+
slug: /workflows/triggers
6+
---
7+
8+
A trigger is a specific activity that starts a workflow—for example, a user interaction within the application, such as clicking or hovering a button. A workflow will begin automatically when no trigger is specified.
9+
10+
You can combine triggers; all trigger conditions must be met for the workflow to execute. You can arrange triggers in a sequence that represents complex user flows that might need to happen.
11+
12+
We currently support the following triggers:
13+
14+
- Element Hover - When the user mouse over a specified element.
15+
- Element Click - When the user clicks a specified element.
16+
- Page View - When the user visits a specified page URL.
17+
18+
## Element Interactions
19+
20+
There are a few triggers available to start a workflow when the user is interacting with elements in your product. Setting up a trigger on an element requires some understanding of [CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors).
21+
22+
An example of a cssSelector is using the element ID such as `#my-element-id`, where `my-element-id` is the element's ID.
23+
24+
The available triggers for elements are:
25+
26+
1. `ElementClick`
27+
2. `ElementMouseOver`
28+
29+
## Page Interactions
30+
31+
Triggers can be further constrained by the page URL pattern. Page View triggers will only allow a Workflow to be triggered if there is a match of the URL pattern, which can include wildcards.
32+
33+
The page trigger is known as `PageView`.
34+
35+
Example matches:
36+
37+
URL Pattern: `https://samelogic.com/*\/docs`
38+
39+
Matches:
40+
41+
- :white_check_mark: - `https://samelogic.com/myproduct/docs`
42+
- :white_check_mark: - `https://samelogic.com/hello/docs?param=123`
43+
- :x: - `https://samelogic.com/hello`
44+
45+
URL Pattern: `https://*.samelogic.com/`
46+
47+
Matches:
48+
49+
- :white_check_mark: - `https://app.samelogic.com/`
50+
- :white_check_mark: - `https://app.samelogic.com/hello/docs?param=123`
51+
- :x: - `https://should-not-run.samelogic.com/hello`

docs/workflows/triggers/click_on.mdx

-11
This file was deleted.

docs/workflows/triggers/filters.mdx

-19
This file was deleted.

docs/workflows/triggers/hover_on.mdx

-11
This file was deleted.

docs/workflows/triggers/overview.mdx

-12
This file was deleted.

docs/workflows/triggers/page_view.mdx

-20
This file was deleted.

docusaurus.config.js

+22-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,29 @@ module.exports = {
99
favicon: "img/favicon.png",
1010
organizationName: "Samelogic, Inc.", // Usually your GitHub org/user name.
1111
projectName: "Samelogic", // Usually your repo name.
12+
plugins: [
13+
"@docusaurus/theme-live-codeblock",
14+
[
15+
"@docusaurus/plugin-ideal-image",
16+
{
17+
quality: 70,
18+
max: 1030, // max resized image's size.
19+
min: 640, // min resized image's size. if original is lower, use that size.
20+
steps: 2, // the max number of images generated between min and max (inclusive)
21+
},
22+
],
23+
],
1224
themeConfig: {
25+
gtag: {
26+
trackingID: "GTM-KVPQMPT",
27+
},
28+
liveCodeBlock: {
29+
/**
30+
* The position of the live playground, above or under the editor
31+
* Possible values: "top" | "bottom"
32+
*/
33+
playgroundPosition: "bottom",
34+
},
1335
navbar: {
1436
title: "",
1537
logo: {
@@ -93,19 +115,6 @@ module.exports = {
93115
],
94116
copyright: `Copyright © ${new Date().getFullYear()} Samelogic, Inc.`,
95117
},
96-
gtag: {
97-
trackingID: "GTM-KVPQMPT",
98-
},
99-
},
100-
plugins: ["@docusaurus/theme-live-codeblock"],
101-
themeConfig: {
102-
liveCodeBlock: {
103-
/**
104-
* The position of the live playground, above or under the editor
105-
* Possible values: "top" | "bottom"
106-
*/
107-
playgroundPosition: "bottom",
108-
},
109118
},
110119
presets: [
111120
[

0 commit comments

Comments
 (0)