@lemonsliceai/lemon-slice-widget 1.0.7 → 1.0.9

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.
Files changed (3) hide show
  1. package/README.md +38 -0
  2. package/dist/index.js +41 -41
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -9,3 +9,41 @@ LemonSlice agents are created on [https://lemonslice.com/](https://lemonslice.co
9
9
  <lemon-slice-widget agent-id="agent_id"></lemon-slice-widget>
10
10
  <script type="module" src="https://unpkg.com/@lemonsliceai/lemon-slice-widget"></script>
11
11
  ```
12
+
13
+ ## Configuration
14
+
15
+ ### Attributes
16
+
17
+ - **`agent-id`** (required): Your LemonSlice agent ID
18
+ - **`inline`**: Display widget inline instead of floating (default: `false`)
19
+ - **`show-minimize-button`**: Show/hide the minimize button (default: `true`)
20
+ - **`initial-state`**: Initial widget state on load - `"minimized"`, `"active"`, or `"hidden"` (default: `"minimized"`)
21
+ - **`controlled-widget-state`**: Dynamically control widget state - `"minimized"`, `"active"`, or `"hidden"`
22
+ - **`controlled-show-minimize-button`**: Dynamically control minimize button visibility - `"true"` or `"false"`
23
+
24
+ ### Examples
25
+
26
+ ```html
27
+ <!-- Start expanded -->
28
+ <lemon-slice-widget agent-id="agent_id" initial-state="active"></lemon-slice-widget>
29
+
30
+ <!-- Hide minimize button -->
31
+ <lemon-slice-widget agent-id="agent_id" show-minimize-button="false"></lemon-slice-widget>
32
+
33
+ <!-- Inline widget -->
34
+ <lemon-slice-widget agent-id="agent_id" inline></lemon-slice-widget>
35
+ ```
36
+
37
+ ### Dynamic Control
38
+
39
+ Control the widget dynamically by updating attributes:
40
+
41
+ ```javascript
42
+ const widget = document.querySelector('lemon-slice-widget');
43
+
44
+ // Change widget state
45
+ widget.setAttribute('controlled-widget-state', 'active');
46
+
47
+ // Toggle minimize button
48
+ widget.setAttribute('controlled-show-minimize-button', 'false');
49
+ ```