@hellotext/hellotext 1.8.6 → 2.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 +3 -0
- package/dist/hellotext.js +1 -1
- package/lib/api/businesses.cjs +37 -0
- package/lib/api/businesses.js +3 -9
- package/lib/api/events.cjs +45 -0
- package/lib/api/events.js +8 -14
- package/lib/api/forms.cjs +51 -0
- package/lib/api/forms.js +10 -17
- package/lib/api/index.cjs +51 -0
- package/lib/api/index.js +10 -23
- package/lib/api/response.cjs +76 -0
- package/lib/api/response.js +1 -7
- package/lib/api/submissions.cjs +47 -0
- package/lib/api/submissions.js +9 -17
- package/lib/api/webchat/messages.cjs +70 -0
- package/lib/api/webchat/messages.js +10 -18
- package/lib/api/webchats.cjs +44 -0
- package/lib/api/webchats.js +8 -16
- package/lib/builders/input_builder.cjs +61 -0
- package/lib/builders/input_builder.js +4 -11
- package/lib/builders/logo_builder.cjs +50 -0
- package/lib/builders/logo_builder.js +5 -12
- package/lib/channels/application_channel.cjs +67 -0
- package/lib/channels/application_channel.js +1 -8
- package/lib/channels/{web_chat_channel.js → webchat_channel.cjs} +35 -20
- package/lib/channels/webchat_channel.js +3 -11
- package/lib/controllers/form_controller.cjs +141 -0
- package/lib/controllers/form_controller.js +15 -22
- package/lib/controllers/mixins/usePopover.cjs +59 -0
- package/lib/controllers/mixins/usePopover.js +6 -14
- package/lib/controllers/{web_chat/pagination_controller.js → webchat/emoji_picker_controller.cjs} +74 -29
- package/lib/controllers/webchat/emoji_picker_controller.js +11 -17
- package/lib/controllers/webchat_controller.cjs +433 -0
- package/lib/controllers/webchat_controller.js +49 -51
- package/lib/core/configuration/forms.cjs +49 -0
- package/lib/core/configuration/forms.js +2 -8
- package/lib/core/configuration/{web_chat.js → webchat.cjs} +53 -38
- package/lib/core/configuration/webchat.js +2 -9
- package/lib/core/configuration.cjs +65 -0
- package/lib/core/configuration.js +8 -13
- package/lib/core/event.cjs +71 -0
- package/lib/core/event.js +5 -11
- package/lib/core/index.cjs +20 -0
- package/lib/core/index.js +2 -20
- package/lib/errors/index.cjs +19 -0
- package/lib/errors/index.js +2 -19
- package/lib/errors/invalid_event.cjs +34 -0
- package/lib/errors/invalid_event.js +1 -7
- package/lib/errors/not_initialized_error.cjs +34 -0
- package/lib/errors/not_initialized_error.js +1 -7
- package/lib/hellotext.cjs +152 -0
- package/lib/hellotext.js +18 -27
- package/lib/index.cjs +20 -0
- package/lib/index.js +12 -20
- package/lib/locales/en.cjs +22 -0
- package/lib/locales/en.js +2 -9
- package/lib/locales/es.cjs +22 -0
- package/lib/locales/es.js +2 -9
- package/lib/locales/index.cjs +14 -0
- package/lib/locales/index.js +6 -14
- package/lib/models/business.cjs +65 -0
- package/lib/models/business.js +5 -12
- package/lib/models/cookies.cjs +40 -0
- package/lib/models/cookies.js +3 -10
- package/lib/models/form.cjs +166 -0
- package/lib/models/form.js +10 -17
- package/lib/models/form_collection.cjs +119 -0
- package/lib/models/form_collection.js +15 -22
- package/lib/models/index.cjs +54 -0
- package/lib/models/index.js +7 -54
- package/lib/models/query.cjs +51 -0
- package/lib/models/query.js +3 -9
- package/lib/models/session.cjs +58 -0
- package/lib/models/session.js +12 -17
- package/lib/models/{web_chat.js → webchat.cjs} +14 -22
- package/lib/models/webchat.js +6 -13
- package/lib/vanilla.cjs +13 -0
- package/lib/vanilla.js +1 -13
- package/package.json +34 -7
- package/src/controllers/webchat_controller.js +72 -47
- package/src/hellotext.js +5 -6
- package/src/models/session.js +4 -3
- package/.babelrc +0 -24
- package/.github/workflows/ci.yml +0 -24
- package/.prettierignore +0 -3
- package/.prettierrc.json +0 -18
- package/MIT-LICENSE +0 -20
- package/__tests__/builders/input_builder_test.js +0 -117
- package/__tests__/core/configuration/forms_test.js +0 -30
- package/__tests__/core/configuration/webchat_test.js +0 -163
- package/__tests__/core/configuration_test.js +0 -28
- package/__tests__/core/event_test.js +0 -56
- package/__tests__/hellotext_test.js +0 -197
- package/__tests__/models/business_test.js +0 -26
- package/__tests__/models/cookies_test.js +0 -25
- package/__tests__/models/form_collection_test.js +0 -103
- package/__tests__/models/form_test.js +0 -131
- package/__tests__/models/query_test.js +0 -97
- package/docs/forms.md +0 -176
- package/docs/tracking.md +0 -168
- package/docs/webchat.md +0 -101
- package/jest.config.js +0 -4
- package/jest.setup.js +0 -16
- package/lib/api/web_chat/messages.js +0 -74
- package/lib/api/web_chats.js +0 -53
- package/styles/index.css +0 -38
- package/webpack.config.js +0 -24
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@ This library allows you the following,
|
|
|
6
6
|
|
|
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
|
+
- Use Hellotext Webchat to interact with your customers in real-time.
|
|
9
10
|
|
|
10
11
|
## Installation
|
|
11
12
|
|
|
@@ -76,6 +77,7 @@ Hellotext.removeEventListener(eventName, callback)
|
|
|
76
77
|
- `session-set`: This event is fired when the session value for `Hellotext.session` is set. Either through an API request, or if the session was found in the cookie.
|
|
77
78
|
- `forms:collected` This event is fired when forms are collected. The callback will receive the array of forms collected.
|
|
78
79
|
- `form:completed` This event is fired when a form has been completed. A form is completed when the user fills all required inputs and verifies their OTP(One-Time Password). The callback will receive the form object that was completed, alongside the data the user filled in the form.
|
|
80
|
+
- View Webchat events [here](/docs/webchat.md#events)
|
|
79
81
|
|
|
80
82
|
## Understanding Sessions
|
|
81
83
|
|
|
@@ -136,3 +138,4 @@ Hellotext.initialize('HELLOTEXT_BUSINESS_ID', configurationOptions)
|
|
|
136
138
|
| session | A valid Hellotext session which was stored previously. When not set, Hellotext attempts to retrieve the stored value from `document.cookie` when available, otherwise it creates a new session. | String | null |
|
|
137
139
|
| autoGenerateSession | Whether the library should automatically generate a session when no session is found in the query or the cookies | Boolean | true |
|
|
138
140
|
| 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 } |
|
|
141
|
+
| webchat | An object that controls how Hellotext should control the webchat on the page. See [Webchat](/docs/webchat.md) documentation for more information. | Object | {} |
|