@om_patel_26/chat-widget 1.0.4 → 1.0.5

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
@@ -77,6 +77,55 @@ import serviceAccountKey from './service-account-key.json';
77
77
 
78
78
  **📚 For detailed Vue.js setup guide, see [VUE_INSTALLATION_GUIDE.md](./VUE_INSTALLATION_GUIDE.md)**
79
79
 
80
+ ### Nuxt 3 Usage (Important: Use ClientOnly!)
81
+
82
+ ```bash
83
+ # Install
84
+ npm install @om_patel_26/chat-widget
85
+ ```
86
+
87
+ **⚠️ CRITICAL: The component MUST be wrapped in `<ClientOnly>` for Nuxt SSR!**
88
+
89
+ ```vue
90
+ <template>
91
+ <div>
92
+ <ClientOnly>
93
+ <ChatWidget
94
+ :df-project-id="'your-project-id'"
95
+ :df-agent-id="'your-agent-id'"
96
+ :service-account-key="serviceAccountKey"
97
+ />
98
+ <template #fallback>
99
+ <div>Loading chat...</div>
100
+ </template>
101
+ </ClientOnly>
102
+ </div>
103
+ </template>
104
+
105
+ <script setup>
106
+ import ChatWidget from '@om_patel_26/chat-widget/nuxt';
107
+ import '@om_patel_26/chat-widget/dist/styles.css';
108
+ import serviceAccountKey from './service-account-key.json';
109
+ </script>
110
+ ```
111
+
112
+ **In `nuxt.config.ts`:**
113
+ ```typescript
114
+ export default defineNuxtConfig({
115
+ css: ['@om_patel_26/chat-widget/dist/styles.css'],
116
+
117
+ vite: {
118
+ optimizeDeps: {
119
+ exclude: ['@om_patel_26/chat-widget'],
120
+ },
121
+ },
122
+ });
123
+ ```
124
+
125
+ **Why ClientOnly?** The widget uses browser APIs (`localStorage`, `window`, `WebSocket`) that don't exist during SSR.
126
+
127
+ **📚 For detailed Nuxt 3 setup guide, see [NUXT_USAGE.md](./NUXT_USAGE.md)**
128
+
80
129
  ---
81
130
 
82
131
  ### React/Next.js Usage
@@ -1,8 +1,8 @@
1
1
  import _sfc_main from "./ChatWidget.vue.esm2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../_virtual/_plugin-vue_export-helper.esm.js";
4
- const ChatWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0ea40880"]]);
4
+ const ChatWidgetComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0ea40880"]]);
5
5
  export {
6
- ChatWidget as default
6
+ ChatWidgetComponent as default
7
7
  };
8
8
  //# sourceMappingURL=ChatWidget.vue.esm.js.map
@@ -2,9 +2,11 @@
2
2
  * Nuxt 3 Entry Point
3
3
  * SSR-optimized entry point for Nuxt 3
4
4
  */
5
- export { default } from '../components/ChatWidget.vue';
6
- export { default as ChatWidget } from '../components/ChatWidget.vue';
5
+ import ChatWidgetComponent from '../components/ChatWidget.vue';
6
+ export default ChatWidgetComponent;
7
+ export { ChatWidgetComponent as ChatWidget };
7
8
  export { useChatWidget } from '../composables/useChatWidget';
8
9
  export type { UseChatWidgetReturn } from '../composables/useChatWidget';
9
- export type { WidgetConfig, WidgetState, ChatMessage, } from '../core/types';
10
+ export type { WidgetConfig, WidgetState, ChatMessage, RichContent, ChipOption, } from '../core/types';
11
+ export { WidgetStateManager } from '../core/stateManager';
10
12
  //# sourceMappingURL=nuxt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nuxt.d.ts","sourceRoot":"","sources":["../../src/entry/nuxt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGxE,YAAY,EACV,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"nuxt.d.ts","sourceRoot":"","sources":["../../src/entry/nuxt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,mBAAmB,MAAM,8BAA8B,CAAC;AAG/D,eAAe,mBAAmB,CAAC;AACnC,OAAO,EAAE,mBAAmB,IAAI,UAAU,EAAE,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGxE,YAAY,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,WAAW,EACX,UAAU,GACX,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
package/dist/nuxt.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./components/ChatWidget.vue.cjs.js"),t=require("./composables/useChatWidget.cjs.js");exports.ChatWidget=e.default,exports.default=e.default,exports.useChatWidget=t.useChatWidget;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./components/ChatWidget.vue.cjs.js"),t=require("./composables/useChatWidget.cjs.js"),s=require("./core/stateManager.cjs.js");exports.ChatWidget=e.default,exports.default=e.default,exports.useChatWidget=t.useChatWidget,exports.WidgetStateManager=s.WidgetStateManager;
2
2
  //# sourceMappingURL=nuxt.cjs.js.map
package/dist/nuxt.esm.js CHANGED
@@ -1,8 +1,10 @@
1
- import { default as default2, default as default3 } from "./components/ChatWidget.vue.esm.js";
1
+ import ChatWidgetComponent from "./components/ChatWidget.vue.esm.js";
2
2
  import { useChatWidget } from "./composables/useChatWidget.esm.js";
3
+ import { WidgetStateManager } from "./core/stateManager.esm.js";
3
4
  export {
4
- default2 as ChatWidget,
5
- default3 as default,
5
+ ChatWidgetComponent as ChatWidget,
6
+ WidgetStateManager,
7
+ ChatWidgetComponent as default,
6
8
  useChatWidget
7
9
  };
8
10
  //# sourceMappingURL=nuxt.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nuxt.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"nuxt.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@om_patel_26/chat-widget",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Universal chat widget for Vue 3, Nuxt 3, React, and Next.js with SSR support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",