@inditeai/react 0.0.1 → 0.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/dist/Bubble.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import type { BubbleProps } from '@indite.io/js';
2
+ import type { BubbleProps } from '@inditeai/js/dist';
3
+ import '@inditeai/js/dist/web';
3
4
  type Props = BubbleProps;
4
5
  declare global {
5
6
  namespace JSX {
@@ -1 +1 @@
1
- {"version":3,"file":"Bubble.d.ts","sourceRoot":"","sources":["../src/Bubble.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAGhD,KAAK,KAAK,GAAG,WAAW,CAAA;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,YAAY,EAAE,KAAK,CAAC,iBAAiB,CACnC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,WAAW,CACZ,CAAA;SACF;KACF;CACF;AAID,eAAO,MAAM,MAAM,UAAW,KAAK,SA6BlC,CAAA;AAED,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"Bubble.d.ts","sourceRoot":"","sources":["../src/Bubble.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,uBAAuB,CAAA;AAE9B,KAAK,KAAK,GAAG,WAAW,CAAA;AAExB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,YAAY,EAAE,KAAK,CAAC,iBAAiB,CACnC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,WAAW,CACZ,CAAA;SACF;KACF;CACF;AAID,eAAO,MAAM,MAAM,UAAW,KAAK,SA6BlC,CAAA;AAED,eAAe,MAAM,CAAA"}
package/dist/Popup.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import type { PopupProps } from '@indite.io/js';
2
+ import type { PopupProps } from '@inditeai/js/dist';
3
+ import '@inditeai/js/dist/web';
3
4
  type Props = PopupProps;
4
5
  declare global {
5
6
  namespace JSX {
@@ -1 +1 @@
1
- {"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../src/Popup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG/C,KAAK,KAAK,GAAG,UAAU,CAAA;AAEvB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAClC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,WAAW,CACZ,GAAG;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,CAAA;SACvB;KACF;CACF;AAID,eAAO,MAAM,KAAK,UAAW,KAAK,4CAkCjC,CAAA;AAED,eAAe,KAAK,CAAA"}
1
+ {"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../src/Popup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,uBAAuB,CAAA;AAE9B,KAAK,KAAK,GAAG,UAAU,CAAA;AAEvB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAClC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,WAAW,CACZ,GAAG;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,CAAA;SACvB;KACF;CACF;AAID,eAAO,MAAM,KAAK,UAAW,KAAK,4CAkCjC,CAAA;AAED,eAAe,KAAK,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import type { BotProps } from '@indite.io/js';
2
+ import type { BotProps } from '@inditeai/js/dist';
3
+ import '@inditeai/js/dist/web';
3
4
  type Props = BotProps & {
4
5
  style?: React.CSSProperties;
5
6
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Standard.d.ts","sourceRoot":"","sources":["../src/Standard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG7C,KAAK,KAAK,GAAG,QAAQ,GAAG;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,cAAc,EAAE,KAAK,CAAC,iBAAiB,CACrC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,WAAW,CACZ,GAAG;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,CAAA;SACvB;KACF;CACF;AAID,eAAO,MAAM,QAAQ,6CAA8C,KAAK,4CASvE,CAAA;AAED,eAAe,QAAQ,CAAA"}
1
+ {"version":3,"file":"Standard.d.ts","sourceRoot":"","sources":["../src/Standard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,uBAAuB,CAAA;AAE9B,KAAK,KAAK,GAAG,QAAQ,GAAG;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,UAAU,iBAAiB;YACzB,cAAc,EAAE,KAAK,CAAC,iBAAiB,CACrC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,WAAW,CACZ,GAAG;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,CAAA;SACvB;KACF;CACF;AAID,eAAO,MAAM,QAAQ,6CAA8C,KAAK,4CASvE,CAAA;AAED,eAAe,QAAQ,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { Standard } from './Standard';
2
2
  export { Bubble } from './Bubble';
3
3
  export { Popup } from './Popup';
4
- export * from '@indite.io/js';
4
+ export * from '@inditeai/js/dist';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,cAAc,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,cAAc,mBAAmB,CAAA"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- // v0.0.1
2
- import{jsx as e}from"react/jsx-runtime";import{useRef as r,useEffect as t,useCallback as o}from"react";"function"==typeof SuppressedError&&SuppressedError;const n=o=>{var{style:n,className:s}=o,a=function(e,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(t[o[n]]=e[o[n]])}return t}(o,["style","className"]);const c=r(null);return t((()=>{c.current&&Object.assign(c.current,a)}),[a]),e("bot-standard",{ref:c,style:n,class:s})},s=e=>{const n=r(null),s=o((e=>{const r=document.createElement("bot-bubble");n.current=r,a(n.current,e),document.body.prepend(n.current)}),[]);t((()=>{n.current||s(e),a(n.current,e)}),[s,e]),t((()=>()=>{var e;null===(e=n.current)||void 0===e||e.remove(),n.current=null}),[]);const a=(e,r)=>{Object.assign(e,r)};return null},a=n=>{const s=r(null),a=r(null),c=o((e=>{var r;const t=document.createElement("bot-popup");a.current=t,u(a.current,e),s.current?null===(r=s.current)||void 0===r||r.append(a.current):console.warn("Could not attach popup to container because containerRef.current is null")}),[]);t((()=>{a.current||c(n),u(a.current,n)}),[c,n]),t((()=>()=>{var e;null===(e=a.current)||void 0===e||e.remove(),a.current=null}),[]);const u=(e,r)=>{Object.assign(e,r)};return e("div",{ref:s})},c=()=>{window.postMessage({isFromBot:!0,command:"close"})},u=()=>{window.postMessage({isFromBot:!0,command:"hidePreviewMessage"})},l=()=>{window.postMessage({isFromBot:!0,command:"open"})},i=e=>{const r={isFromBot:!0,command:"setPrefilledVariables",variables:e};window.postMessage(r)},m=e=>{const r={isFromBot:!0,command:"showPreviewMessage",message:e};window.postMessage(r)},p=()=>{window.postMessage({isFromBot:!0,command:"toggle"})},d=e=>{const r={isFromBot:!0,command:"setInputValue",value:e};window.postMessage(r)},w=()=>{window.postMessage({isFromBot:!0,command:"unmount"})};export{s as Bubble,a as Popup,n as Standard,c as close,u as hidePreviewMessage,l as open,d as setInputValue,i as setPrefilledVariables,m as showPreviewMessage,p as toggle,w as unmount};
1
+ // v0.0.2
2
+ import{jsx as r}from"react/jsx-runtime";import{useRef as e,useEffect as t,useCallback as n}from"react";import"@inditeai/js/dist/web";export*from"@inditeai/js/dist";"function"==typeof SuppressedError&&SuppressedError;const o=n=>{var{style:o,className:c}=n,u=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]])}return t}(n,["style","className"]);const l=e(null);return t((()=>{l.current&&Object.assign(l.current,u)}),[u]),r("bot-standard",{ref:l,style:o,class:c})},c=r=>{const o=e(null),c=n((r=>{const e=document.createElement("bot-bubble");o.current=e,u(o.current,r),document.body.prepend(o.current)}),[]);t((()=>{o.current||c(r),u(o.current,r)}),[c,r]),t((()=>()=>{var r;null===(r=o.current)||void 0===r||r.remove(),o.current=null}),[]);const u=(r,e)=>{Object.assign(r,e)};return null},u=o=>{const c=e(null),u=e(null),l=n((r=>{var e;const t=document.createElement("bot-popup");u.current=t,s(u.current,r),c.current?null===(e=c.current)||void 0===e||e.append(u.current):console.warn("Could not attach popup to container because containerRef.current is null")}),[]);t((()=>{u.current||l(o),s(u.current,o)}),[l,o]),t((()=>()=>{var r;null===(r=u.current)||void 0===r||r.remove(),u.current=null}),[]);const s=(r,e)=>{Object.assign(r,e)};return r("div",{ref:c})};export{c as Bubble,u as Popup,o as Standard};
package/package.json CHANGED
@@ -1,13 +1,11 @@
1
1
  {
2
2
  "name": "@inditeai/react",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Convenient library to display bots on your React app",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "module",
8
8
  "scripts": {
9
- "stories:dev": "ladle serve -p 3006",
10
- "stories:build": "ladle build",
11
9
  "dev": "rollup --watch --config rollup.config.js",
12
10
  "build": "rollup --config rollup.config.js",
13
11
  "lint": "eslint --fix \"src/**/*.ts*\"",
@@ -23,7 +21,7 @@
23
21
  "@rollup/plugin-babel": "6.0.3",
24
22
  "@rollup/plugin-node-resolve": "15.1.0",
25
23
  "@rollup/plugin-terser": "0.4.3",
26
- "@indite.io/js": "workspace:*",
24
+ "@inditeai/js": "1.2.0",
27
25
  "@indite.io/lib": "workspace:*",
28
26
  "@indite.io/prisma": "workspace:*",
29
27
  "@indite.io/schemas": "workspace:*",
@@ -41,6 +39,6 @@
41
39
  "@rollup/plugin-typescript": "11.1.2"
42
40
  },
43
41
  "peerDependencies": {
44
- "react": "^16.0.0 || ^17.0.0 || ^18.0.0"
42
+ "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
45
43
  }
46
44
  }
@@ -1,2 +0,0 @@
1
- export declare const Default: () => import("react/jsx-runtime").JSX.Element;
2
- //# sourceMappingURL=bubble.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bubble.stories.d.ts","sourceRoot":"","sources":["../../src/stories/bubble.stories.tsx"],"names":[],"mappings":"AAaA,eAAO,MAAM,OAAO,+CA6CnB,CAAA"}
@@ -1,2 +0,0 @@
1
- export declare const Default: () => import("react/jsx-runtime").JSX.Element;
2
- //# sourceMappingURL=popup.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"popup.stories.d.ts","sourceRoot":"","sources":["../../src/stories/popup.stories.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,+CAiBnB,CAAA"}
@@ -1,3 +0,0 @@
1
- export declare const Default: () => import("react/jsx-runtime").JSX.Element;
2
- export declare const StartWhenIntoView: () => import("react/jsx-runtime").JSX.Element;
3
- //# sourceMappingURL=standard.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"standard.stories.d.ts","sourceRoot":"","sources":["../../src/stories/standard.stories.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,+CAWnB,CAAA;AAED,eAAO,MAAM,iBAAiB,+CAa7B,CAAA"}