@hellotext/hellotext 2.5.6 → 2.5.8
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 +5 -26
- package/dist/hellotext.js +1 -1
- package/dist/hellotext.js.LICENSE.txt +1 -1
- package/index.d.ts +15 -6
- package/lib/api/acks.cjs +17 -31
- package/lib/api/acks.js +17 -42
- package/lib/api/businesses.cjs +14 -28
- package/lib/api/businesses.js +13 -36
- package/lib/api/events.cjs +26 -40
- package/lib/api/events.js +28 -52
- package/lib/api/forms.cjs +24 -40
- package/lib/api/forms.js +24 -57
- package/lib/api/identifications.cjs +15 -29
- package/lib/api/identifications.js +15 -40
- package/lib/api/index.cjs +26 -46
- package/lib/api/index.js +28 -49
- package/lib/api/push/identities.cjs +43 -0
- package/lib/api/push/identities.js +35 -0
- package/lib/api/response.cjs +30 -52
- package/lib/api/response.js +31 -60
- package/lib/api/submissions.cjs +18 -34
- package/lib/api/submissions.js +18 -48
- package/lib/api/webchat/messages.cjs +44 -64
- package/lib/api/webchat/messages.js +44 -80
- package/lib/api/webchats.cjs +37 -56
- package/lib/api/webchats.js +37 -65
- package/lib/api/whatsapp_widgets.cjs +49 -72
- package/lib/api/whatsapp_widgets.js +48 -91
- package/lib/builders/input_builder.cjs +36 -48
- package/lib/builders/input_builder.js +36 -48
- package/lib/builders/logo_builder.cjs +10 -29
- package/lib/builders/logo_builder.js +20 -28
- package/lib/channels/application_channel.cjs +136 -178
- package/lib/channels/application_channel.js +137 -180
- package/lib/channels/webchat_channel.cjs +125 -170
- package/lib/channels/webchat_channel.js +125 -170
- package/lib/controllers/form_controller.cjs +82 -121
- package/lib/controllers/form_controller.js +82 -130
- package/lib/controllers/message_controller.cjs +211 -282
- package/lib/controllers/message_controller.js +209 -284
- package/lib/controllers/mixins/usePopover.cjs +3 -6
- package/lib/controllers/mixins/usePopover.js +17 -22
- package/lib/controllers/webchat/emoji_picker_controller.cjs +106 -150
- package/lib/controllers/webchat/emoji_picker_controller.js +105 -170
- package/lib/controllers/webchat/useBehaviour.js +5 -5
- package/lib/controllers/webchat/useOpeningSequence.js +6 -6
- package/lib/controllers/webchat/useTeaser.js +9 -9
- package/lib/controllers/webchat_controller.cjs +916 -1088
- package/lib/controllers/webchat_controller.js +926 -1152
- package/lib/core/configuration/forms.cjs +21 -35
- package/lib/core/configuration/forms.js +20 -35
- package/lib/core/configuration/locale.cjs +36 -71
- package/lib/core/configuration/locale.js +36 -70
- package/lib/core/configuration/push.cjs +16 -0
- package/lib/core/configuration/push.js +10 -0
- package/lib/core/configuration/webchat.cjs +142 -182
- package/lib/core/configuration/webchat.js +145 -189
- package/lib/core/configuration/whatsapp.cjs +76 -102
- package/lib/core/configuration/whatsapp.js +76 -105
- package/lib/core/configuration.cjs +62 -75
- package/lib/core/configuration.js +61 -75
- package/lib/core/event.cjs +36 -59
- package/lib/core/event.js +35 -61
- package/lib/core/sanitize_html.js +4 -4
- package/lib/errors/invalid_event.cjs +5 -26
- package/lib/errors/invalid_event.js +5 -26
- package/lib/errors/not_initialized_error.cjs +5 -26
- package/lib/errors/not_initialized_error.js +5 -26
- package/lib/hellotext.cjs +186 -211
- package/lib/hellotext.js +189 -236
- package/lib/index.js +1 -1
- package/lib/models/business.cjs +115 -152
- package/lib/models/business.js +118 -162
- package/lib/models/cookies.cjs +34 -51
- package/lib/models/cookies.js +34 -51
- package/lib/models/fingerprint.cjs +8 -23
- package/lib/models/fingerprint.js +25 -58
- package/lib/models/form.cjs +106 -142
- package/lib/models/form.js +105 -153
- package/lib/models/form_collection.cjs +63 -101
- package/lib/models/form_collection.js +61 -107
- package/lib/models/index.cjs +7 -0
- package/lib/models/index.js +1 -0
- package/lib/models/page.cjs +106 -129
- package/lib/models/page.js +106 -131
- package/lib/models/push.cjs +345 -0
- package/lib/models/push.js +339 -0
- package/lib/models/query.cjs +21 -41
- package/lib/models/query.js +21 -41
- package/lib/models/session.cjs +33 -65
- package/lib/models/session.js +30 -63
- package/lib/models/user.cjs +29 -51
- package/lib/models/user.js +29 -51
- package/lib/models/utm.cjs +15 -27
- package/lib/models/utm.js +17 -32
- package/lib/models/webchat.cjs +52 -76
- package/lib/models/webchat.js +52 -90
- package/lib/models/whatsapp_widget.cjs +41 -59
- package/lib/models/whatsapp_widget.js +41 -73
- package/lib/vanilla.cjs +4 -7
- package/lib/vanilla.js +2 -1
- package/package.json +2 -10
- package/src/api/index.js +5 -0
- package/src/api/push/identities.js +42 -0
- package/src/core/configuration/push.js +12 -0
- package/src/core/configuration.js +5 -0
- package/src/hellotext.js +15 -1
- package/src/index.bundle.js +0 -1
- package/src/models/business.js +1 -0
- package/src/models/index.js +1 -0
- package/src/models/push.js +397 -0
- package/src/vanilla.js +2 -1
- package/styles/index.css +0 -30
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ This library allows you the following,
|
|
|
7
7
|
- Track events happening on your site to [Hellotext](https://www.hellotext.com) in real-time.
|
|
8
8
|
- Use Hellotext Forms to dynamically collect data from your customers based on your specific business requirements.
|
|
9
9
|
- Use Hellotext Webchat to interact with your customers in real-time.
|
|
10
|
+
- Let visitors subscribe and unsubscribe to browser notifications with [Push notifications](/docs/push.md).
|
|
10
11
|
|
|
11
12
|
## Installation
|
|
12
13
|
|
|
@@ -49,37 +50,14 @@ Failing to initialize the class before calling any other method will throw a `No
|
|
|
49
50
|
|
|
50
51
|
## Documentation
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
Follow these guides to set up tracking, forms, chat widgets, and Push notifications on your website.
|
|
53
54
|
|
|
54
55
|
- [Understanding Sessions](/docs/sessions.md)
|
|
55
56
|
- [Tracking Events](/docs/tracking.md)
|
|
56
57
|
- [Forms](/docs/forms.md)
|
|
57
58
|
- [Webchat](/docs/webchat.md)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
The library ships with a minimal CSS file that is used for [Forms](/docs/forms.md). It is pre-bundled but you control when to import it.
|
|
62
|
-
|
|
63
|
-
## For Bundler Users (Vite, Webpack, etc.)
|
|
64
|
-
|
|
65
|
-
The CSS is not automatically imported to avoid issues with SSR frameworks. Import it separately:
|
|
66
|
-
|
|
67
|
-
```javascript
|
|
68
|
-
// Import the library
|
|
69
|
-
import Hellotext from '@hellotext/hellotext'
|
|
70
|
-
|
|
71
|
-
// Import the CSS separately
|
|
72
|
-
import '@hellotext/hellotext/styles/index.css'
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## For Script Tag Users
|
|
76
|
-
|
|
77
|
-
The UMD bundle (`dist/hellotext.js`) includes the CSS automatically:
|
|
78
|
-
|
|
79
|
-
```html
|
|
80
|
-
<script src="https://unpkg.com/@hellotext/hellotext"></script>
|
|
81
|
-
<!-- CSS is included in the bundle -->
|
|
82
|
-
```
|
|
59
|
+
- [WhatsApp widget](/docs/whatsapp.md)
|
|
60
|
+
- [Push notifications](/docs/push.md)
|
|
83
61
|
|
|
84
62
|
## Events
|
|
85
63
|
|
|
@@ -124,3 +102,4 @@ Hellotext.initialize('HELLOTEXT_BUSINESS_ID', configurationOptions)
|
|
|
124
102
|
| forms | An object that controls how Hellotext should control the forms on the page. See [Forms](/docs/forms.md) documentation for more information. | Object | { autoMount: true, successMessage: true } |
|
|
125
103
|
| webchat | An object that overrides the dashboard webchat configuration, or `false` to disable automatic webchat mounting. See [Webchat](/docs/webchat.md). | Object \| false | Dashboard webchat when configured |
|
|
126
104
|
| whatsappWidget | An object that overrides the dashboard WhatsApp widget configuration, or `false` to disable automatic WhatsApp widget mounting. | Object \| false | Dashboard WhatsApp widget when configured |
|
|
105
|
+
| push | Configure browser Push with a notification worker URL and an optional channel ID, or pass `false` to disable it. See the [Push setup guide](/docs/push.md) for the worker file and button examples. | Object \| false | Enabled when available |
|