diff --git a/package.json b/package.json index b1f4c02..c5fa75b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flowise-embed-react", - "version": "1.0.2", + "version": "1.0.4", "description": "React library to display flowise chatbot on your website", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/rollup.config.js b/rollup.config.js index 3c8f6d2..aa6f978 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -4,13 +4,14 @@ import { babel } from "@rollup/plugin-babel"; import typescript from "@rollup/plugin-typescript"; import { typescriptPaths } from "rollup-plugin-typescript-paths"; -const extensions = [".ts", ".tsx"]; +const extensions = ['.js', '.jsx', '.ts', '.tsx', '.json'] const indexConfig = { input: "./src/index.ts", output: { file: "./dist/index.js", format: "es", + inlineDynamicImports: true, }, external: ["react", "react/jsx-runtime", "flowise-embed"], plugins: [ diff --git a/src/BubbleChat.tsx b/src/BubbleChat.tsx index 7a6a228..6f959b8 100644 --- a/src/BubbleChat.tsx +++ b/src/BubbleChat.tsx @@ -22,7 +22,7 @@ export const BubbleChat = (props: Props) => { useEffect(() => { ;(async () => { - await import('flowise-embed/dist/web') + await import('flowise-embed/dist/web.js') setIsInitialized(true) })() return () => { diff --git a/src/FullPageChat.tsx b/src/FullPageChat.tsx index b51233a..8c6bb71 100644 --- a/src/FullPageChat.tsx +++ b/src/FullPageChat.tsx @@ -24,7 +24,7 @@ export const FullPageChat = ({ style, className, ...assignableProps }: Props) => useEffect(() => { ;(async () => { - await import('flowise-embed/dist/web') + await import('flowise-embed/dist/web.js') })() }, []) diff --git a/yarn.lock b/yarn.lock index e55a51c..ee0e65b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1335,6 +1335,11 @@ vite "^4.0.1" vite-tsconfig-paths "^4.0.3" +"@microsoft/fetch-event-source@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@microsoft/fetch-event-source/-/fetch-event-source-2.0.1.tgz#9ceecc94b49fbaa15666e38ae8587f64acce007d" + integrity sha512-W6CLUJ2eBMw3Rec70qrsEW0jOm/3twwJv21mrmj2yORiaVmVYGS4sSS5yUwvQc1ZlDLYGPnClVWmUUMagKNsfA== + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1402,11 +1407,6 @@ estree-walker "^2.0.2" picomatch "^2.3.1" -"@socket.io/component-emitter@~3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@socket.io/component-emitter/-/component-emitter-3.1.0.tgz#96116f2a912e0c02817345b3c10751069920d553" - integrity sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg== - "@ts-stack/markdown@^1.4.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@ts-stack/markdown/-/markdown-1.5.0.tgz#5dc298a20dc3dc040143c5a5948201eb6bf5419d" @@ -1848,7 +1848,7 @@ debug@2.6.9: dependencies: ms "2.0.0" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -1903,6 +1903,11 @@ destroy@1.2.0: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== +device-detector-js@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/device-detector-js/-/device-detector-js-3.0.3.tgz#03424a45962bd80294e8004a2557dc7e7b98247e" + integrity sha512-jM89LJAvP6uOd84at8OlD9dWP8KeYCCHUde0RT0HQo/stdoRH4b54Xl/fntx2nEXCmqiFhmo+/cJetS2VGUHPw== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -1947,22 +1952,6 @@ encodeurl@~1.0.2: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== -engine.io-client@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/engine.io-client/-/engine.io-client-6.5.2.tgz#8709e22c291d4297ae80318d3c8baeae71f0e002" - integrity sha512-CQZqbrpEYnrpGqC07a9dJDz4gePZUgTPMU3NKJPSeQOyw27Tst4Pl3FemKoFGAlHzgZmKjoRmiJvbWfhCXUlIg== - dependencies: - "@socket.io/component-emitter" "~3.1.0" - debug "~4.3.1" - engine.io-parser "~5.2.1" - ws "~8.11.0" - xmlhttprequest-ssl "~2.0.0" - -engine.io-parser@~5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-5.2.1.tgz#9f213c77512ff1a6cc0c7a86108a7ffceb16fcfb" - integrity sha512-9JktcM3u18nU9N2Lz3bWeBgxVgOKpw7yhRaoxQA3FUDZzzw+9WlA6p4G4u0RixNkg14fH7EfEc/RhpurtiROTQ== - esbuild@^0.18.10, esbuild@~0.18.20: version "0.18.20" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.18.20.tgz#4709f5a34801b43b799ab7d6d82f7284a9b7a7a6" @@ -2264,16 +2253,19 @@ flatted@^3.2.7: integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== flowise-embed@*: - version "1.0.13" - resolved "https://registry.yarnpkg.com/flowise-embed/-/flowise-embed-1.0.13.tgz#4b56f41f4edb58a60518ca6546d2139b0d85f629" - integrity sha512-XElyjbV4C4cj0zw0RzrxqJZr3W4+2UEEW0+KIs1MtVpdCckw0ATYQyxCIGIShEOP1L8SdzpACBISHFg2u/pJ5Q== + version "2.0.3" + resolved "https://registry.yarnpkg.com/flowise-embed/-/flowise-embed-2.0.3.tgz#18cb1126475e49644ee337b1688bb803ea0e256a" + integrity sha512-dJg2hlj4XLElQ3Q091yyzTrfqiDSgKHNMDadJM9S+5zRFGxZePvXPsqEYTckQX24W5LoBdKxHnvAyord+xCnRA== dependencies: "@babel/core" "^7.22.1" + "@microsoft/fetch-event-source" "^2.0.1" "@ts-stack/markdown" "^1.4.0" + device-detector-js "^3.0.3" lodash "^4.17.21" - socket.io-client "^4.6.2" + prettier "^3.1.0" solid-element "1.7.0" solid-js "1.7.1" + zod "^3.22.4" forwarded@0.2.0: version "0.2.0" @@ -2925,6 +2917,11 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier@^3.1.0: + version "3.3.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105" + integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== + prism-react-renderer@^1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-1.3.5.tgz#786bb69aa6f73c32ba1ee813fbe17a0115435085" @@ -3238,24 +3235,6 @@ smob@^0.0.6: resolved "https://registry.yarnpkg.com/smob/-/smob-0.0.6.tgz#09b268fea916158a2781c152044c6155adbb8aa1" integrity sha512-V21+XeNni+tTyiST1MHsa84AQhT1aFZipzPpOFAVB8DkHzwJyjjAmt9bgwnuZiZWnIbMo2duE29wybxv/7HWUw== -socket.io-client@^4.6.2: - version "4.7.2" - resolved "https://registry.yarnpkg.com/socket.io-client/-/socket.io-client-4.7.2.tgz#f2f13f68058bd4e40f94f2a1541f275157ff2c08" - integrity sha512-vtA0uD4ibrYD793SOIAwlo8cj6haOeMHrGvwPxJsxH7CeIksqJ+3Zc06RvWTIFgiSqx4A3sOnTXpfAEE2Zyz6w== - dependencies: - "@socket.io/component-emitter" "~3.1.0" - debug "~4.3.2" - engine.io-client "~6.5.2" - socket.io-parser "~4.2.4" - -socket.io-parser@~4.2.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.2.4.tgz#c806966cf7270601e47469ddeec30fbdfda44c83" - integrity sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew== - dependencies: - "@socket.io/component-emitter" "~3.1.0" - debug "~4.3.1" - solid-element@1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/solid-element/-/solid-element-1.7.0.tgz#0341f14af71dc39642ce6fb73328d754d7d3c29d" @@ -3571,11 +3550,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== -ws@~8.11.0: - version "8.11.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" - integrity sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg== - xdg-default-browser@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/xdg-default-browser/-/xdg-default-browser-2.1.0.tgz#41a057b8da1128610ece9b32c136a52e42e0d152" @@ -3584,11 +3558,6 @@ xdg-default-browser@^2.1.0: execa "^0.2.2" titleize "^1.0.0" -xmlhttprequest-ssl@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz#91360c86b914e67f44dce769180027c0da618c67" - integrity sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A== - yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" @@ -3603,3 +3572,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zod@^3.22.4: + version "3.23.8" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" + integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==