From 1dcafe6e476b9c7346bb1f218fca64d019d9afa2 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 9 Dec 2025 17:11:48 +0530 Subject: [PATCH] chore: remove usage file --- app/javascript/ui/usage.md | 46 -------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 app/javascript/ui/usage.md diff --git a/app/javascript/ui/usage.md b/app/javascript/ui/usage.md deleted file mode 100644 index 2e19bf1d917..00000000000 --- a/app/javascript/ui/usage.md +++ /dev/null @@ -1,46 +0,0 @@ -# Chatwoot UI Components Usage Guide - -This document explains how to use the Chatwoot UI components library, which can be used both as Web Components (Custom Elements) and as Vue components. - -## Installation - -```bash -npm install @chatwoot/ui -# or -yarn add @chatwoot/ui -# or -pnpm add @chatwoot/ui -``` - -## Usage - -### As Web Components (Custom Elements) - -Web Components can be used in any HTML page or application, regardless of the framework. - -```html - - - - - -``` - -When the script loads, it automatically registers all custom elements with the browser, making them immediately available for use. - -#### Accessing the Store in Web Components - -The components have access to a global store instance. When using Web Components, the store is available through `window.__CHATWOOT_STORE__`. - -You can interact with the store from your JavaScript: - -```javascript -// Access the store -const store = window.__CHATWOOT_STORE__; - -// Check store state -console.log(store.state.someData); - -// Dispatch actions -store.dispatch('someAction', { data: 'example' }); -```