@botonic/react 0.52.0-alpha.0 → 0.52.0

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.
@@ -4,5 +4,7 @@ export interface WebviewActionTriggeredDebugEvent {
4
4
  action: EventAction.WebviewActionTriggered;
5
5
  webview_target_id: string;
6
6
  webview_name: string;
7
+ webview_params?: Record<string, string>;
7
8
  }
9
+ export declare const WebviewActionTriggered: (props: WebviewActionTriggeredDebugEvent) => import("react/jsx-runtime").JSX.Element;
8
10
  export declare const getWebviewActionTriggeredEventConfig: (data: WebviewActionTriggeredDebugEvent) => DebugEventConfig;
@@ -1,17 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getWebviewActionTriggeredEventConfig = void 0;
3
+ exports.getWebviewActionTriggeredEventConfig = exports.WebviewActionTriggered = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const core_1 = require("@botonic/core");
6
6
  const window_restore_1 = require("../icons/window-restore");
7
+ const styles_1 = require("../styles");
8
+ const WebviewActionTriggered = (props) => {
9
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: Object.keys(props.webview_params ?? {}).length > 0
10
+ ? Object.entries(props.webview_params ?? {}).map(([key, value]) => ((0, jsx_runtime_1.jsxs)(styles_1.StyledDebugDetail, { children: [(0, jsx_runtime_1.jsx)(styles_1.StyledDebugLabel, { children: key }), (0, jsx_runtime_1.jsx)(styles_1.StyledDebugValue, { children: value })] }, key)))
11
+ : 'Webview without params' }));
12
+ };
13
+ exports.WebviewActionTriggered = WebviewActionTriggered;
7
14
  const getWebviewActionTriggeredEventConfig = (data) => {
8
15
  const title = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Webview action triggered ", (0, jsx_runtime_1.jsxs)("span", { children: ["- ", data.webview_name] })] }));
9
16
  return {
10
17
  action: core_1.EventAction.WebviewActionTriggered,
11
18
  title,
12
- component: null,
19
+ component: exports.WebviewActionTriggered,
13
20
  icon: (0, jsx_runtime_1.jsx)(window_restore_1.WindowRestoreSvg, {}),
14
- collapsible: false,
21
+ collapsible: true,
15
22
  };
16
23
  };
17
24
  exports.getWebviewActionTriggeredEventConfig = getWebviewActionTriggeredEventConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"webview-action-triggered.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/webview-action-triggered.tsx"],"names":[],"mappings":";;;;AAAA,wCAA2C;AAE3C,4DAA0D;AASnD,MAAM,oCAAoC,GAAG,CAClD,IAAsC,EACpB,EAAE;IACpB,MAAM,KAAK,GAAG,CACZ,0FAC2B,mDAAS,IAAI,CAAC,YAAY,IAAQ,IAC1D,CACJ,CAAA;IAED,OAAO;QACL,MAAM,EAAE,kBAAW,CAAC,sBAAsB;QAC1C,KAAK;QACL,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,uBAAC,iCAAgB,KAAG;QAC1B,WAAW,EAAE,KAAK;KACnB,CAAA;AACH,CAAC,CAAA;AAhBY,QAAA,oCAAoC,wCAgBhD"}
1
+ {"version":3,"file":"webview-action-triggered.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/webview-action-triggered.tsx"],"names":[],"mappings":";;;;AAAA,wCAA2C;AAE3C,4DAA0D;AAC1D,sCAIkB;AAUX,MAAM,sBAAsB,GAAG,CACpC,KAAuC,EACvC,EAAE;IACF,OAAO,CACL,2DACG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC;YACjD,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAC/D,wBAAC,0BAAiB,eAChB,uBAAC,yBAAgB,cAAE,GAAG,GAAoB,EAC1C,uBAAC,yBAAgB,cAAE,KAAK,GAAoB,KAFtB,GAAG,CAGP,CACrB,CAAC;YACJ,CAAC,CAAC,wBAAwB,GAC3B,CACJ,CAAA;AACH,CAAC,CAAA;AAfY,QAAA,sBAAsB,0BAelC;AACM,MAAM,oCAAoC,GAAG,CAClD,IAAsC,EACpB,EAAE;IACpB,MAAM,KAAK,GAAG,CACZ,0FAC2B,mDAAS,IAAI,CAAC,YAAY,IAAQ,IAC1D,CACJ,CAAA;IAED,OAAO;QACL,MAAM,EAAE,kBAAW,CAAC,sBAAsB;QAC1C,KAAK;QACL,SAAS,EAAE,8BAAsB;QACjC,IAAI,EAAE,uBAAC,iCAAgB,KAAG;QAC1B,WAAW,EAAE,IAAI;KAClB,CAAA;AACH,CAAC,CAAA;AAhBY,QAAA,oCAAoC,wCAgBhD"}
@@ -4,5 +4,7 @@ export interface WebviewActionTriggeredDebugEvent {
4
4
  action: EventAction.WebviewActionTriggered;
5
5
  webview_target_id: string;
6
6
  webview_name: string;
7
+ webview_params?: Record<string, string>;
7
8
  }
9
+ export declare const WebviewActionTriggered: (props: WebviewActionTriggeredDebugEvent) => import("react/jsx-runtime").JSX.Element;
8
10
  export declare const getWebviewActionTriggeredEventConfig: (data: WebviewActionTriggeredDebugEvent) => DebugEventConfig;
@@ -1,17 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getWebviewActionTriggeredEventConfig = void 0;
3
+ exports.getWebviewActionTriggeredEventConfig = exports.WebviewActionTriggered = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const core_1 = require("@botonic/core");
6
6
  const window_restore_1 = require("../icons/window-restore");
7
+ const styles_1 = require("../styles");
8
+ const WebviewActionTriggered = (props) => {
9
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: Object.keys(props.webview_params ?? {}).length > 0
10
+ ? Object.entries(props.webview_params ?? {}).map(([key, value]) => ((0, jsx_runtime_1.jsxs)(styles_1.StyledDebugDetail, { children: [(0, jsx_runtime_1.jsx)(styles_1.StyledDebugLabel, { children: key }), (0, jsx_runtime_1.jsx)(styles_1.StyledDebugValue, { children: value })] }, key)))
11
+ : 'Webview without params' }));
12
+ };
13
+ exports.WebviewActionTriggered = WebviewActionTriggered;
7
14
  const getWebviewActionTriggeredEventConfig = (data) => {
8
15
  const title = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Webview action triggered ", (0, jsx_runtime_1.jsxs)("span", { children: ["- ", data.webview_name] })] }));
9
16
  return {
10
17
  action: core_1.EventAction.WebviewActionTriggered,
11
18
  title,
12
- component: null,
19
+ component: exports.WebviewActionTriggered,
13
20
  icon: (0, jsx_runtime_1.jsx)(window_restore_1.WindowRestoreSvg, {}),
14
- collapsible: false,
21
+ collapsible: true,
15
22
  };
16
23
  };
17
24
  exports.getWebviewActionTriggeredEventConfig = getWebviewActionTriggeredEventConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"webview-action-triggered.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/webview-action-triggered.tsx"],"names":[],"mappings":";;;;AAAA,wCAA2C;AAE3C,4DAA0D;AASnD,MAAM,oCAAoC,GAAG,CAClD,IAAsC,EACpB,EAAE;IACpB,MAAM,KAAK,GAAG,CACZ,0FAC2B,mDAAS,IAAI,CAAC,YAAY,IAAQ,IAC1D,CACJ,CAAA;IAED,OAAO;QACL,MAAM,EAAE,kBAAW,CAAC,sBAAsB;QAC1C,KAAK;QACL,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,uBAAC,iCAAgB,KAAG;QAC1B,WAAW,EAAE,KAAK;KACnB,CAAA;AACH,CAAC,CAAA;AAhBY,QAAA,oCAAoC,wCAgBhD"}
1
+ {"version":3,"file":"webview-action-triggered.js","sourceRoot":"","sources":["../../../../../src/components/system-debug-trace/events/webview-action-triggered.tsx"],"names":[],"mappings":";;;;AAAA,wCAA2C;AAE3C,4DAA0D;AAC1D,sCAIkB;AAUX,MAAM,sBAAsB,GAAG,CACpC,KAAuC,EACvC,EAAE;IACF,OAAO,CACL,2DACG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC;YACjD,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAC/D,wBAAC,0BAAiB,eAChB,uBAAC,yBAAgB,cAAE,GAAG,GAAoB,EAC1C,uBAAC,yBAAgB,cAAE,KAAK,GAAoB,KAFtB,GAAG,CAGP,CACrB,CAAC;YACJ,CAAC,CAAC,wBAAwB,GAC3B,CACJ,CAAA;AACH,CAAC,CAAA;AAfY,QAAA,sBAAsB,0BAelC;AACM,MAAM,oCAAoC,GAAG,CAClD,IAAsC,EACpB,EAAE;IACpB,MAAM,KAAK,GAAG,CACZ,0FAC2B,mDAAS,IAAI,CAAC,YAAY,IAAQ,IAC1D,CACJ,CAAA;IAED,OAAO;QACL,MAAM,EAAE,kBAAW,CAAC,sBAAsB;QAC1C,KAAK;QACL,SAAS,EAAE,8BAAsB;QACjC,IAAI,EAAE,uBAAC,iCAAgB,KAAG;QAC1B,WAAW,EAAE,IAAI;KAClB,CAAA;AACH,CAAC,CAAA;AAhBY,QAAA,oCAAoC,wCAgBhD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botonic/react",
3
- "version": "0.52.0-alpha.0",
3
+ "version": "0.52.0",
4
4
  "license": "MIT",
5
5
  "description": "Build Chatbots using React",
6
6
  "main": "./lib/cjs",
@@ -20,7 +20,7 @@
20
20
  "format": "biome format --write src/ tests/"
21
21
  },
22
22
  "dependencies": {
23
- "@botonic/core": "^0.52.0-alpha.0",
23
+ "@botonic/core": "^0.52.0",
24
24
  "axios": "^1.15.2",
25
25
  "emoji-picker-react": "^4.12.0",
26
26
  "lodash.merge": "^4.6.2",
@@ -1,14 +1,36 @@
1
1
  import { EventAction } from '@botonic/core'
2
2
 
3
3
  import { WindowRestoreSvg } from '../icons/window-restore'
4
+ import {
5
+ StyledDebugDetail,
6
+ StyledDebugLabel,
7
+ StyledDebugValue,
8
+ } from '../styles'
4
9
  import type { DebugEventConfig } from '../types'
5
10
 
6
11
  export interface WebviewActionTriggeredDebugEvent {
7
12
  action: EventAction.WebviewActionTriggered
8
13
  webview_target_id: string
9
14
  webview_name: string
15
+ webview_params?: Record<string, string>
10
16
  }
11
17
 
18
+ export const WebviewActionTriggered = (
19
+ props: WebviewActionTriggeredDebugEvent
20
+ ) => {
21
+ return (
22
+ <>
23
+ {Object.keys(props.webview_params ?? {}).length > 0
24
+ ? Object.entries(props.webview_params ?? {}).map(([key, value]) => (
25
+ <StyledDebugDetail key={key}>
26
+ <StyledDebugLabel>{key}</StyledDebugLabel>
27
+ <StyledDebugValue>{value}</StyledDebugValue>
28
+ </StyledDebugDetail>
29
+ ))
30
+ : 'Webview without params'}
31
+ </>
32
+ )
33
+ }
12
34
  export const getWebviewActionTriggeredEventConfig = (
13
35
  data: WebviewActionTriggeredDebugEvent
14
36
  ): DebugEventConfig => {
@@ -21,8 +43,8 @@ export const getWebviewActionTriggeredEventConfig = (
21
43
  return {
22
44
  action: EventAction.WebviewActionTriggered,
23
45
  title,
24
- component: null,
46
+ component: WebviewActionTriggered,
25
47
  icon: <WindowRestoreSvg />,
26
- collapsible: false,
48
+ collapsible: true,
27
49
  }
28
50
  }