@hellotext/hellotext 2.0.0 → 2.0.2

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 CHANGED
@@ -30,7 +30,7 @@ Import the library into your app.
30
30
  import Hellotext from '@hellotext/hellotext'
31
31
  ```
32
32
 
33
- If you're running in a non-browser environment, such as Node.js, you can import the vanilla implementation which only includes
33
+ If you're running in a non-browser environment, such as Node.js, you can import the vanilla implementation which only includes
34
34
  Hellotext.js class without initializing other libraries that rely on the browser environment.
35
35
 
36
36
  ```javascript
@@ -55,6 +55,31 @@ Learn how to leverage the library to track events and collect forms.
55
55
  - [Forms](/docs/forms.md)
56
56
  - [Webchat](/docs/webchat.md)
57
57
 
58
+ ## CSS
59
+
60
+ 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.
61
+
62
+ ## For Bundler Users (Vite, Webpack, etc.)
63
+
64
+ The CSS is not automatically imported to avoid issues with SSR frameworks. Import it separately:
65
+
66
+ ```javascript
67
+ // Import the library
68
+ import Hellotext from '@hellotext/hellotext'
69
+
70
+ // Import the CSS separately
71
+ import '@hellotext/hellotext/styles/index.css'
72
+ ```
73
+
74
+ ## For Script Tag Users
75
+
76
+ The UMD bundle (`dist/hellotext.js`) includes the CSS automatically:
77
+
78
+ ```html
79
+ <script src="https://unpkg.com/@hellotext/hellotext"></script>
80
+ <!-- CSS is included in the bundle -->
81
+ ```
82
+
58
83
  ## Events
59
84
 
60
85
  This library emits events that you can listen to and perform specific action when the event happens.
@@ -134,7 +159,7 @@ Hellotext.initialize('HELLOTEXT_BUSINESS_ID', configurationOptions)
134
159
  #### Configuration Options
135
160
 
136
161
  | Property | Description | Type | Default |
137
- |---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-------------------------------------------|
162
+ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ----------------------------------------- |
138
163
  | 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 |
139
164
  | autoGenerateSession | Whether the library should automatically generate a session when no session is found in the query or the cookies | Boolean | true |
140
165
  | 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 } |