@ai12z/react 1.0.12 → 1.0.13

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.
Files changed (36) hide show
  1. package/dist/components/stencil-generated/index.js +13 -0
  2. package/dist/components/stencil-generated/index.js.map +1 -0
  3. package/dist/components/stencil-generated/react-component-lib/createComponent.js +65 -0
  4. package/dist/components/stencil-generated/react-component-lib/createComponent.js.map +1 -0
  5. package/dist/components/stencil-generated/react-component-lib/createOverlayComponent.js +98 -0
  6. package/dist/components/stencil-generated/react-component-lib/createOverlayComponent.js.map +1 -0
  7. package/dist/components/stencil-generated/react-component-lib/index.js +3 -0
  8. package/dist/components/stencil-generated/react-component-lib/index.js.map +1 -0
  9. package/dist/components/stencil-generated/react-component-lib/interfaces.js +2 -0
  10. package/dist/components/stencil-generated/react-component-lib/interfaces.js.map +1 -0
  11. package/dist/components/stencil-generated/react-component-lib/utils/attachProps.js +92 -0
  12. package/dist/components/stencil-generated/react-component-lib/utils/attachProps.js.map +1 -0
  13. package/dist/components/stencil-generated/react-component-lib/utils/case.js +7 -0
  14. package/dist/components/stencil-generated/react-component-lib/utils/case.js.map +1 -0
  15. package/dist/components/stencil-generated/react-component-lib/utils/dev.js +13 -0
  16. package/dist/components/stencil-generated/react-component-lib/utils/dev.js.map +1 -0
  17. package/dist/components/stencil-generated/react-component-lib/utils/index.js +31 -0
  18. package/dist/components/stencil-generated/react-component-lib/utils/index.js.map +1 -0
  19. package/dist/index.js +3 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/lib/components/stencil-generated/index.js +3 -0
  22. package/dist/lib/components/stencil-generated/index.js.map +1 -1
  23. package/dist/package.json +2 -2
  24. package/dist/types/components/stencil-generated/index.d.ts +11 -0
  25. package/dist/types/components/stencil-generated/react-component-lib/createComponent.d.ts +10 -0
  26. package/dist/types/components/stencil-generated/react-component-lib/createOverlayComponent.d.ts +21 -0
  27. package/dist/types/components/stencil-generated/react-component-lib/index.d.ts +2 -0
  28. package/dist/types/components/stencil-generated/react-component-lib/interfaces.d.ts +29 -0
  29. package/dist/types/components/stencil-generated/react-component-lib/utils/attachProps.d.ts +9 -0
  30. package/dist/types/components/stencil-generated/react-component-lib/utils/case.d.ts +2 -0
  31. package/dist/types/components/stencil-generated/react-component-lib/utils/dev.d.ts +2 -0
  32. package/dist/types/components/stencil-generated/react-component-lib/utils/index.d.ts +10 -0
  33. package/dist/types/index.d.ts +2 -0
  34. package/dist/types/lib/components/stencil-generated/index.d.ts +3 -0
  35. package/lib/components/stencil-generated/index.ts +3 -0
  36. package/package.json +3 -3
@@ -0,0 +1,13 @@
1
+ import { createReactComponent } from './react-component-lib';
2
+ import { defineCustomElements } from 'ai12z/loader';
3
+ defineCustomElements();
4
+ export const Ai12zBot = createReactComponent('ai12z-bot');
5
+ export const Ai12zCategory = createReactComponent('ai12z-category');
6
+ export const Ai12zChat = createReactComponent('ai12z-chat');
7
+ export const Ai12zCta = createReactComponent('ai12z-cta');
8
+ export const Ai12zInputForm = createReactComponent('ai12z-input-form');
9
+ export const Ai12zKnowledgeBox = createReactComponent('ai12z-knowledge-box');
10
+ export const Ai12zSpinner = createReactComponent('ai12z-spinner');
11
+ export const ChatbotHistory = createReactComponent('chatbot-history');
12
+ export const ChatbotWelcome = createReactComponent('chatbot-welcome');
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/components/stencil-generated/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,oBAAoB,EAAE,CAAC;AACvB,MAAM,CAAC,MAAM,QAAQ,GAAgB,oBAAoB,CAAoC,WAAW,CAAC,CAAC;AAC1G,MAAM,CAAC,MAAM,aAAa,GAAgB,oBAAoB,CAA8C,gBAAgB,CAAC,CAAC;AAC9H,MAAM,CAAC,MAAM,SAAS,GAAgB,oBAAoB,CAAsC,YAAY,CAAC,CAAC;AAC9G,MAAM,CAAC,MAAM,QAAQ,GAAgB,oBAAoB,CAAoC,WAAW,CAAC,CAAC;AAC1G,MAAM,CAAC,MAAM,cAAc,GAAgB,oBAAoB,CAAgD,kBAAkB,CAAC,CAAC;AACnI,MAAM,CAAC,MAAM,iBAAiB,GAAgB,oBAAoB,CAAsD,qBAAqB,CAAC,CAAC;AAC/I,MAAM,CAAC,MAAM,YAAY,GAAgB,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,MAAM,CAAC,MAAM,cAAc,GAAgB,oBAAoB,CAAgD,iBAAiB,CAAC,CAAC;AAClI,MAAM,CAAC,MAAM,cAAc,GAAgB,oBAAoB,CAAgD,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,65 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React, { createElement } from 'react';
13
+ import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';
14
+ export const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) => {
15
+ if (defineCustomElement !== undefined) {
16
+ defineCustomElement();
17
+ }
18
+ const displayName = dashToPascalCase(tagName);
19
+ const ReactComponent = class extends React.Component {
20
+ constructor(props) {
21
+ super(props);
22
+ this.setComponentElRef = (element) => {
23
+ this.componentEl = element;
24
+ };
25
+ }
26
+ componentDidMount() {
27
+ this.componentDidUpdate(this.props);
28
+ }
29
+ componentDidUpdate(prevProps) {
30
+ attachProps(this.componentEl, this.props, prevProps);
31
+ }
32
+ render() {
33
+ const _a = this.props, { children, forwardedRef, style, className, ref } = _a, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
34
+ let propsToPass = Object.keys(cProps).reduce((acc, name) => {
35
+ const value = cProps[name];
36
+ if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
37
+ const eventName = name.substring(2).toLowerCase();
38
+ if (typeof document !== 'undefined' && isCoveredByReact(eventName)) {
39
+ acc[name] = value;
40
+ }
41
+ }
42
+ else {
43
+ const type = typeof value;
44
+ if (type === 'string' || type === 'boolean' || type === 'number') {
45
+ acc[camelToDashCase(name)] = value;
46
+ }
47
+ }
48
+ return acc;
49
+ }, {});
50
+ if (manipulatePropsFunction) {
51
+ propsToPass = manipulatePropsFunction(this.props, propsToPass);
52
+ }
53
+ const newProps = Object.assign(Object.assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style });
54
+ return createElement(tagName, newProps, children);
55
+ }
56
+ static get displayName() {
57
+ return displayName;
58
+ }
59
+ };
60
+ if (ReactComponentContext) {
61
+ ReactComponent.contextType = ReactComponentContext;
62
+ }
63
+ return createForwardRef(ReactComponent, displayName);
64
+ };
65
+ //# sourceMappingURL=createComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createComponent.js","sourceRoot":"","sources":["../../../../lib/components/stencil-generated/react-component-lib/createComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAWxH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAMlC,OAAe,EACf,qBAAuD,EACvD,uBAGuB,EACvB,mBAAgC,EAChC,EAAE;IACF,IAAI,mBAAmB,KAAK,S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IAAI,CAAC,GAAG,KAAK,CAAC;oBACpB,CAAC;gBACH,CAAC;qBAAM,CAAC;oBAGN,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC;oBAE1B,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;wBACjE,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC;oBACrC,CAAC;gBACH,CAAC;gBACD,OAAO,GAAG,CAAC;YACb,CAAC,EAAE,EAAwB,CAAC,CAAC;YAE7B,IAAI,uBAAuB,EAAE,CAAC;gBAC5B,WAAW,GAAG,uBAAuB,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YACjE,CAAC;YAED,MAAM,QAAQ,mCACT,WAAW,KACd,GAAG,EAAE,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAAC,EACpD,KAAK,GACN,CAAC;YASF,OAAO,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACpD,CAAC;QAED,MAAM,KAAK,WAAW;YACpB,OAAO,WAAW,CAAC;QACrB,CAAC;KACF,CAAC;IAGF,IAAI,qBAAqB,EAAE,CAAC;QAC1B,cAAc,CAAC,WAAW,GAAG,qBAAqB,CAAC;IACrD,CAAC;IAED,OAAO,gBAAgB,CAAwB,cAAc,EAAE,WAAW,CAAC,CAAC;AAC9E,CAAC,CAAC"}
@@ -0,0 +1,98 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __rest = (this && this.__rest) || function (s, e) {
11
+ var t = {};
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
+ t[p] = s[p];
14
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
+ t[p[i]] = s[p[i]];
18
+ }
19
+ return t;
20
+ };
21
+ import React from 'react';
22
+ import ReactDOM from 'react-dom';
23
+ import { attachProps, dashToPascalCase, defineCustomElement, setRef } from './utils';
24
+ export const createOverlayComponent = (tagName, controller, customElement) => {
25
+ defineCustomElement(tagName, customElement);
26
+ const displayName = dashToPascalCase(tagName);
27
+ const didDismissEventName = `on${displayName}DidDismiss`;
28
+ const didPresentEventName = `on${displayName}DidPresent`;
29
+ const willDismissEventName = `on${displayName}WillDismiss`;
30
+ const willPresentEventName = `on${displayName}WillPresent`;
31
+ let isDismissing = false;
32
+ class Overlay extends React.Component {
33
+ constructor(props) {
34
+ super(props);
35
+ if (typeof document !== 'undefined') {
36
+ this.el = document.createElement('div');
37
+ }
38
+ this.handleDismiss = this.handleDismiss.bind(this);
39
+ }
40
+ static get displayName() {
41
+ return displayName;
42
+ }
43
+ componentDidMount() {
44
+ if (this.props.isOpen) {
45
+ this.present();
46
+ }
47
+ }
48
+ componentWillUnmount() {
49
+ if (this.overlay) {
50
+ this.overlay.dismiss();
51
+ }
52
+ }
53
+ handleDismiss(event) {
54
+ if (this.props.onDidDismiss) {
55
+ this.props.onDidDismiss(event);
56
+ }
57
+ setRef(this.props.forwardedRef, null);
58
+ }
59
+ shouldComponentUpdate(nextProps) {
60
+ if (this.overlay && nextProps.isOpen !== this.props.isOpen && nextProps.isOpen === false) {
61
+ isDismissing = true;
62
+ }
63
+ return true;
64
+ }
65
+ componentDidUpdate(prevProps) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ if (this.overlay) {
68
+ attachProps(this.overlay, this.props, prevProps);
69
+ }
70
+ if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === true) {
71
+ this.present(prevProps);
72
+ }
73
+ if (this.overlay && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {
74
+ yield this.overlay.dismiss();
75
+ isDismissing = false;
76
+ this.forceUpdate();
77
+ }
78
+ });
79
+ }
80
+ present(prevProps) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ const _a = this.props, { children, isOpen, onDidDismiss, onDidPresent, onWillDismiss, onWillPresent } = _a, cProps = __rest(_a, ["children", "isOpen", "onDidDismiss", "onDidPresent", "onWillDismiss", "onWillPresent"]);
83
+ const elementProps = Object.assign(Object.assign({}, cProps), { ref: this.props.forwardedRef, [didDismissEventName]: this.handleDismiss, [didPresentEventName]: (e) => this.props.onDidPresent && this.props.onDidPresent(e), [willDismissEventName]: (e) => this.props.onWillDismiss && this.props.onWillDismiss(e), [willPresentEventName]: (e) => this.props.onWillPresent && this.props.onWillPresent(e) });
84
+ this.overlay = yield controller.create(Object.assign(Object.assign({}, elementProps), { component: this.el, componentProps: {} }));
85
+ setRef(this.props.forwardedRef, this.overlay);
86
+ attachProps(this.overlay, elementProps, prevProps);
87
+ yield this.overlay.present();
88
+ });
89
+ }
90
+ render() {
91
+ return ReactDOM.createPortal(this.props.isOpen || isDismissing ? this.props.children : null, this.el);
92
+ }
93
+ }
94
+ return React.forwardRef((props, ref) => {
95
+ return React.createElement(Overlay, Object.assign({}, props, { forwardedRef: ref }));
96
+ });
97
+ };
98
+ //# sourceMappingURL=createOverlayComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createOverlayComponent.js","sourceRoot":"","sources":["../../../../lib/components/stencil-generated/react-component-lib/createOverlayComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAA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IAAI,CAAC,EAAE,CAAC,CAAC;QACxG,CAAC;KACF;IAED,OAAO,KAAK,CAAC,UAAU,CAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACzD,OAAO,oBAAC,OAAO,oBAAK,KAAK,IAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { createReactComponent } from './createComponent';
2
+ export { createOverlayComponent } from './createOverlayComponent';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/components/stencil-generated/react-component-lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../lib/components/stencil-generated/react-component-lib/interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,92 @@
1
+ import { camelToDashCase } from './case';
2
+ export const attachProps = (node, newProps, oldProps = {}) => {
3
+ if (node instanceof Element) {
4
+ const className = getClassName(node.classList, newProps, oldProps);
5
+ if (className !== '') {
6
+ node.className = className;
7
+ }
8
+ Object.keys(newProps).forEach((name) => {
9
+ if (name === 'children' ||
10
+ name === 'style' ||
11
+ name === 'ref' ||
12
+ name === 'class' ||
13
+ name === 'className' ||
14
+ name === 'forwardedRef') {
15
+ return;
16
+ }
17
+ if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
18
+ const eventName = name.substring(2);
19
+ const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1);
20
+ if (!isCoveredByReact(eventNameLc)) {
21
+ syncEvent(node, eventNameLc, newProps[name]);
22
+ }
23
+ }
24
+ else {
25
+ node[name] = newProps[name];
26
+ const propType = typeof newProps[name];
27
+ if (propType === 'string') {
28
+ node.setAttribute(camelToDashCase(name), newProps[name]);
29
+ }
30
+ }
31
+ });
32
+ }
33
+ };
34
+ export const getClassName = (classList, newProps, oldProps) => {
35
+ const newClassProp = newProps.className || newProps.class;
36
+ const oldClassProp = oldProps.className || oldProps.class;
37
+ const currentClasses = arrayToMap(classList);
38
+ const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : []);
39
+ const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : []);
40
+ const finalClassNames = [];
41
+ currentClasses.forEach((currentClass) => {
42
+ if (incomingPropClasses.has(currentClass)) {
43
+ finalClassNames.push(currentClass);
44
+ incomingPropClasses.delete(currentClass);
45
+ }
46
+ else if (!oldPropClasses.has(currentClass)) {
47
+ finalClassNames.push(currentClass);
48
+ }
49
+ });
50
+ incomingPropClasses.forEach((s) => finalClassNames.push(s));
51
+ return finalClassNames.join(' ');
52
+ };
53
+ export const transformReactEventName = (eventNameSuffix) => {
54
+ switch (eventNameSuffix) {
55
+ case 'doubleclick':
56
+ return 'dblclick';
57
+ }
58
+ return eventNameSuffix;
59
+ };
60
+ export const isCoveredByReact = (eventNameSuffix) => {
61
+ if (typeof document === 'undefined') {
62
+ return true;
63
+ }
64
+ else {
65
+ const eventName = 'on' + transformReactEventName(eventNameSuffix);
66
+ let isSupported = eventName in document;
67
+ if (!isSupported) {
68
+ const element = document.createElement('div');
69
+ element.setAttribute(eventName, 'return;');
70
+ isSupported = typeof element[eventName] === 'function';
71
+ }
72
+ return isSupported;
73
+ }
74
+ };
75
+ export const syncEvent = (node, eventName, newEventHandler) => {
76
+ const eventStore = node.__events || (node.__events = {});
77
+ const oldEventHandler = eventStore[eventName];
78
+ if (oldEventHandler) {
79
+ node.removeEventListener(eventName, oldEventHandler);
80
+ }
81
+ node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
82
+ if (newEventHandler) {
83
+ newEventHandler.call(this, e);
84
+ }
85
+ }));
86
+ };
87
+ const arrayToMap = (arr) => {
88
+ const map = new Map();
89
+ arr.forEach((s) => map.set(s, s));
90
+ return map;
91
+ };
92
+ //# sourceMappingURL=attachProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachProps.js","sourceRoot":"","sources":["../../../../../lib/components/stencil-generated/react-component-lib/utils/attachProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAiB,EAAE,QAAa,EAAE,WAAgB,EAAE,EAAE,EAAE;IAElF,IAAI,IAAI,YAAY,OAAO,EAAE,CAAC;QAE5B,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnE,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;YACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC7B,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrC,IACE,IAAI,KAAK,UAAU;gBACnB,IAAI,KAAK,OAAO;gBAChB,IAAI,KAAK,KAAK;gBACd,IAAI,KAAK,OAAO;gBAChB,IAAI,KAAK,WAAW;gBACpB,IAAI,KAAK,cAAc,EACvB,CAAC;gBACD,OAAO;YACT,CAAC;YACD,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;gBAClE,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;gBACpC,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC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M,CAAC,MAAM,SAAS,GAAG,CACvB,IAAiF,EACjF,SAAiB,EACjB,eAAmC,EACnC,EAAE;IACF,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC;IACzD,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IAG9C,IAAI,eAAe,EAAE,CAAC;QACpB,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IACvD,CAAC;IAGD,IAAI,CAAC,gBAAgB,CACnB,SAAS,EACT,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,SAAS,OAAO,CAAC,CAAQ;QAChD,IAAI,eAAe,EAAE,CAAC;YACpB,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,GAA4B,EAAE,EAAE;IAClD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;IACrC,GAAgB,CAAC,OAAO,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export const dashToPascalCase = (str) => str
2
+ .toLowerCase()
3
+ .split('-')
4
+ .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
5
+ .join('');
6
+ export const camelToDashCase = (str) => str.replace(/([A-Z])/g, (m) => `-${m[0].toLowerCase()}`);
7
+ //# sourceMappingURL=case.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"case.js","sourceRoot":"","sources":["../../../../../lib/components/stencil-generated/react-component-lib/utils/case.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAE,EAAE,CAC9C,GAAG;KACA,WAAW,EAAE;KACb,KAAK,CAAC,GAAG,CAAC;KACV,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACpE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ export const isDevMode = () => {
2
+ return process && process.env && process.env.NODE_ENV === 'development';
3
+ };
4
+ const warnings = {};
5
+ export const deprecationWarning = (key, message) => {
6
+ if (isDevMode()) {
7
+ if (!warnings[key]) {
8
+ console.warn(message);
9
+ warnings[key] = true;
10
+ }
11
+ }
12
+ };
13
+ //# sourceMappingURL=dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../../../lib/components/stencil-generated/react-component-lib/utils/dev.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,OAAO,IAAI,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,QAAQ,GAA+B,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAE,OAAe,EAAE,EAAE;IACjE,IAAI,SAAS,EAAE,EAAE,CAAC;QAChB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACvB,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ export const setRef = (ref, value) => {
3
+ if (typeof ref === 'function') {
4
+ ref(value);
5
+ }
6
+ else if (ref != null) {
7
+ ref.current = value;
8
+ }
9
+ };
10
+ export const mergeRefs = (...refs) => {
11
+ return (value) => {
12
+ refs.forEach((ref) => {
13
+ setRef(ref, value);
14
+ });
15
+ };
16
+ };
17
+ export const createForwardRef = (ReactComponent, displayName) => {
18
+ const forwardRef = (props, ref) => {
19
+ return React.createElement(ReactComponent, Object.assign({}, props, { forwardedRef: ref }));
20
+ };
21
+ forwardRef.displayName = displayName;
22
+ return React.forwardRef(forwardRef);
23
+ };
24
+ export const defineCustomElement = (tagName, customElement) => {
25
+ if (customElement !== undefined && typeof customElements !== 'undefined' && !customElements.get(tagName)) {
26
+ customElements.define(tagName, customElement);
27
+ }
28
+ };
29
+ export * from './attachProps';
30
+ export * from './case';
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/components/stencil-generated/react-component-lib/utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,GAA+D,EAAE,KAAU,EAAE,EAAE;IACpG,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC9B,GAAG,CAAC,KAAK,CAAC,CAAC;IACb,CAAC;SAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAEtB,GAAmC,CAAC,OAAO,GAAG,KAAK,CAAC;IACvD,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,GAAG,IAAoE,EAC/C,EAAE;IAC1B,OAAO,CAAC,KAAU,EAAE,EAAE;QACpB,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAwB,cAAmB,EAAE,WAAmB,EAAE,EAAE;IAClG,MAAM,UAAU,GAAG,CACjB,KAAuD,EACvD,GAA0C,EAC1C,EAAE;QACF,OAAO,oBAAC,cAAc,oBAAK,KAAK,IAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC1D,CAAC,CAAC;IACF,UAAU,CAAC,WAAW,GAAG,WAAW,CAAC;IAErC,OAAO,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAE,aAAkB,EAAE,EAAE;IACzE,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,cAAc,KAAK,WAAW,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACzG,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAChD,CAAC;AACH,CAAC,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./components/stencil-generated";
2
+ export { defineCustomElements } from "ai12z/loader";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC"}
@@ -8,8 +8,11 @@ export const Ai12zChat = createReactComponent('ai12z-chat');
8
8
  export const Ai12zCta = createReactComponent('ai12z-cta');
9
9
  export const Ai12zInputForm = createReactComponent('ai12z-input-form');
10
10
  export const Ai12zKnowledgeBox = createReactComponent('ai12z-knowledge-box');
11
+ export const Ai12zMic = createReactComponent('ai12z-mic');
11
12
  export const Ai12zSpinner = createReactComponent('ai12z-spinner');
12
13
  export const BotPopover = createReactComponent('bot-popover');
13
14
  export const ChatbotHistory = createReactComponent('chatbot-history');
14
15
  export const ChatbotWelcome = createReactComponent('chatbot-welcome');
16
+ export const DynamicForm = createReactComponent('dynamic-form');
17
+ export const ListData = createReactComponent('list-data');
15
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/components/stencil-generated/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,oBAAoB,EAAE,CAAC;AACvB,MAAM,CAAC,MAAM,QAAQ,GAAgB,oBAAoB,CAAoC,WAAW,CAAC,CAAC;AAC1G,MAAM,CAAC,MAAM,aAAa,GAAgB,oBAAoB,CAA8C,gBAAgB,CAAC,CAAC;AAC9H,MAAM,CAAC,MAAM,aAAa,GAAgB,oBAAoB,CAA8C,gBAAgB,CAAC,CAAC;AAC9H,MAAM,CAAC,MAAM,SAAS,GAAgB,oBAAoB,CAAsC,YAAY,CAAC,CAAC;AAC9G,MAAM,CAAC,MAAM,QAAQ,GAAgB,oBAAoB,CAAoC,WAAW,CAAC,CAAC;AAC1G,MAAM,CAAC,MAAM,cAAc,GAAgB,oBAAoB,CAAgD,kBAAkB,CAAC,CAAC;AACnI,MAAM,CAAC,MAAM,iBAAiB,GAAgB,oBAAoB,CAAsD,qBAAqB,CAAC,CAAC;AAC/I,MAAM,CAAC,MAAM,YAAY,GAAgB,oBAAoB,CAA4C,eAAe,CAAC,CAAC;AAC1H,MAAM,CAAC,MAAM,UAAU,GAAgB,oBAAoB,CAAwC,aAAa,CAAC,CAAC;AAClH,MAAM,CAAC,MAAM,cAAc,GAAgB,o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GAAgB,oBAAoB,CAA0C,cAAc,CAAC,CAAC;AACtH,MAAM,CAAC,MAAM,QAAQ,GAAgB,oBAAoB,CAAoC,WAAW,CAAC,CAAC"}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai12z/react",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "ai12z React Library",
5
5
  "author": "Alpesh Patel <alpesh@ai12z.com>",
6
6
  "homepage": "",
@@ -22,7 +22,7 @@
22
22
  "tsc": "tsc -p . --outDir ./dist"
23
23
  },
24
24
  "dependencies": {
25
- "ai12z": "^1.0.11"
25
+ "ai12z": "^1.0.12"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/react": "^18.2.55",
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import type { JSX } from 'ai12z';
3
+ export declare const Ai12zBot: import("react").ForwardRefExoticComponent<JSX.Ai12zBot & Omit<import("react").HTMLAttributes<HTMLAi12zBotElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLAi12zBotElement>>;
4
+ export declare const Ai12zCategory: import("react").ForwardRefExoticComponent<JSX.Ai12zCategory & Omit<import("react").HTMLAttributes<HTMLAi12zCategoryElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLAi12zCategoryElement>>;
5
+ export declare const Ai12zChat: import("react").ForwardRefExoticComponent<JSX.Ai12zChat & Omit<import("react").HTMLAttributes<HTMLAi12zChatElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLAi12zChatElement>>;
6
+ export declare const Ai12zCta: import("react").ForwardRefExoticComponent<JSX.Ai12zCta & Omit<import("react").HTMLAttributes<HTMLAi12zCtaElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLAi12zCtaElement>>;
7
+ export declare const Ai12zInputForm: import("react").ForwardRefExoticComponent<JSX.Ai12zInputForm & Omit<import("react").HTMLAttributes<HTMLAi12zInputFormElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLAi12zInputFormElement>>;
8
+ export declare const Ai12zKnowledgeBox: import("react").ForwardRefExoticComponent<JSX.Ai12zKnowledgeBox & Omit<import("react").HTMLAttributes<HTMLAi12zKnowledgeBoxElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLAi12zKnowledgeBoxElement>>;
9
+ export declare const Ai12zSpinner: import("react").ForwardRefExoticComponent<JSX.Ai12zSpinner & Omit<import("react").HTMLAttributes<HTMLAi12zSpinnerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLAi12zSpinnerElement>>;
10
+ export declare const ChatbotHistory: import("react").ForwardRefExoticComponent<JSX.ChatbotHistory & Omit<import("react").HTMLAttributes<HTMLChatbotHistoryElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLChatbotHistoryElement>>;
11
+ export declare const ChatbotWelcome: import("react").ForwardRefExoticComponent<JSX.ChatbotWelcome & Omit<import("react").HTMLAttributes<HTMLChatbotWelcomeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLChatbotWelcomeElement>>;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export interface HTMLStencilElement extends HTMLElement {
3
+ componentOnReady(): Promise<this>;
4
+ }
5
+ interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<ElementType> {
6
+ forwardedRef: React.RefObject<ElementType>;
7
+ ref?: React.Ref<any>;
8
+ }
9
+ export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = {}, ExpandedPropsTypes = {}>(tagName: string, ReactComponentContext?: React.Context<ContextStateType>, manipulatePropsFunction?: (originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes, defineCustomElement?: () => void) => React.ForwardRefExoticComponent<React.PropsWithoutRef<import("./utils").StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
10
+ export {};
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { OverlayEventDetail } from './interfaces';
3
+ import { StencilReactForwardedRef } from './utils';
4
+ interface OverlayElement extends HTMLElement {
5
+ present: () => Promise<void>;
6
+ dismiss: (data?: any, role?: string | undefined) => Promise<boolean>;
7
+ }
8
+ export interface ReactOverlayProps {
9
+ children?: React.ReactNode;
10
+ isOpen: boolean;
11
+ onDidDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
12
+ onDidPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
13
+ onWillDismiss?: (event: CustomEvent<OverlayEventDetail>) => void;
14
+ onWillPresent?: (event: CustomEvent<OverlayEventDetail>) => void;
15
+ }
16
+ export declare const createOverlayComponent: <OverlayComponent extends object, OverlayType extends OverlayElement>(tagName: string, controller: {
17
+ create: (options: any) => Promise<OverlayType>;
18
+ }, customElement?: any) => React.ForwardRefExoticComponent<React.PropsWithoutRef<OverlayComponent & ReactOverlayProps & {
19
+ forwardedRef?: StencilReactForwardedRef<OverlayType>;
20
+ }> & React.RefAttributes<OverlayType>>;
21
+ export {};
@@ -0,0 +1,2 @@
1
+ export { createReactComponent } from './createComponent';
2
+ export { createOverlayComponent } from './createOverlayComponent';
@@ -0,0 +1,29 @@
1
+ export interface EventEmitter<T = any> {
2
+ emit: (data?: T) => CustomEvent<T>;
3
+ }
4
+ export interface StyleReactProps {
5
+ class?: string;
6
+ className?: string;
7
+ style?: {
8
+ [key: string]: any;
9
+ };
10
+ }
11
+ export interface OverlayEventDetail<T = any> {
12
+ data?: T;
13
+ role?: string;
14
+ }
15
+ export interface OverlayInterface {
16
+ el: HTMLElement;
17
+ animated: boolean;
18
+ keyboardClose: boolean;
19
+ overlayIndex: number;
20
+ presented: boolean;
21
+ enterAnimation?: any;
22
+ leaveAnimation?: any;
23
+ didPresent: EventEmitter<void>;
24
+ willPresent: EventEmitter<void>;
25
+ willDismiss: EventEmitter<OverlayEventDetail>;
26
+ didDismiss: EventEmitter<OverlayEventDetail>;
27
+ present(): Promise<void>;
28
+ dismiss(data?: any, role?: string): Promise<boolean>;
29
+ }
@@ -0,0 +1,9 @@
1
+ export declare const attachProps: (node: HTMLElement, newProps: any, oldProps?: any) => void;
2
+ export declare const getClassName: (classList: DOMTokenList, newProps: any, oldProps: any) => string;
3
+ export declare const transformReactEventName: (eventNameSuffix: string) => string;
4
+ export declare const isCoveredByReact: (eventNameSuffix: string) => boolean;
5
+ export declare const syncEvent: (node: Element & {
6
+ __events?: {
7
+ [key: string]: (e: Event) => any;
8
+ };
9
+ }, eventName: string, newEventHandler?: (e: Event) => any) => void;
@@ -0,0 +1,2 @@
1
+ export declare const dashToPascalCase: (str: string) => string;
2
+ export declare const camelToDashCase: (str: string) => string;
@@ -0,0 +1,2 @@
1
+ export declare const isDevMode: () => boolean;
2
+ export declare const deprecationWarning: (key: string, message: string) => void;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { StyleReactProps } from '../interfaces';
3
+ export type StencilReactExternalProps<PropType, ElementType> = PropType & Omit<React.HTMLAttributes<ElementType>, 'style'> & StyleReactProps;
4
+ export type StencilReactForwardedRef<T> = ((instance: T | null) => void) | React.MutableRefObject<T | null> | null;
5
+ export declare const setRef: (ref: StencilReactForwardedRef<any> | React.Ref<any> | undefined, value: any) => void;
6
+ export declare const mergeRefs: (...refs: (StencilReactForwardedRef<any> | React.Ref<any> | undefined)[]) => React.RefCallback<any>;
7
+ export declare const createForwardRef: <PropType, ElementType>(ReactComponent: any, displayName: string) => React.ForwardRefExoticComponent<React.PropsWithoutRef<StencilReactExternalProps<PropType, ElementType>> & React.RefAttributes<ElementType>>;
8
+ export declare const defineCustomElement: (tagName: string, customElement: any) => void;
9
+ export * from './attachProps';
10
+ export * from './case';
@@ -0,0 +1,2 @@
1
+ export * from "./components/stencil-generated";
2
+ export { defineCustomElements } from "ai12z/loader";
@@ -7,7 +7,10 @@ export declare const Ai12zChat: import("react").ForwardRefExoticComponent<JSX.Ai
7
7
  export declare const Ai12zCta: import("react").ForwardRefExoticComponent<JSX.Ai12zCta & Omit<import("react").HTMLAttributes<HTMLAi12zCtaElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLAi12zCtaElement>>;
8
8
  export declare const Ai12zInputForm: import("react").ForwardRefExoticComponent<JSX.Ai12zInputForm & Omit<import("react").HTMLAttributes<HTMLAi12zInputFormElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLAi12zInputFormElement>>;
9
9
  export declare const Ai12zKnowledgeBox: import("react").ForwardRefExoticComponent<JSX.Ai12zKnowledgeBox & Omit<import("react").HTMLAttributes<HTMLAi12zKnowledgeBoxElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLAi12zKnowledgeBoxElement>>;
10
+ export declare const Ai12zMic: import("react").ForwardRefExoticComponent<JSX.Ai12zMic & Omit<import("react").HTMLAttributes<HTMLAi12zMicElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLAi12zMicElement>>;
10
11
  export declare const Ai12zSpinner: import("react").ForwardRefExoticComponent<JSX.Ai12zSpinner & Omit<import("react").HTMLAttributes<HTMLAi12zSpinnerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLAi12zSpinnerElement>>;
11
12
  export declare const BotPopover: import("react").ForwardRefExoticComponent<JSX.BotPopover & Omit<import("react").HTMLAttributes<HTMLBotPopoverElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLBotPopoverElement>>;
12
13
  export declare const ChatbotHistory: import("react").ForwardRefExoticComponent<JSX.ChatbotHistory & Omit<import("react").HTMLAttributes<HTMLChatbotHistoryElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLChatbotHistoryElement>>;
13
14
  export declare const ChatbotWelcome: import("react").ForwardRefExoticComponent<JSX.ChatbotWelcome & Omit<import("react").HTMLAttributes<HTMLChatbotWelcomeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLChatbotWelcomeElement>>;
15
+ export declare const DynamicForm: import("react").ForwardRefExoticComponent<JSX.DynamicForm & Omit<import("react").HTMLAttributes<HTMLDynamicFormElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLDynamicFormElement>>;
16
+ export declare const ListData: import("react").ForwardRefExoticComponent<JSX.ListData & Omit<import("react").HTMLAttributes<HTMLListDataElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLListDataElement>>;
@@ -15,7 +15,10 @@ export const Ai12zChat = /*@__PURE__*/createReactComponent<JSX.Ai12zChat, HTMLAi
15
15
  export const Ai12zCta = /*@__PURE__*/createReactComponent<JSX.Ai12zCta, HTMLAi12zCtaElement>('ai12z-cta');
16
16
  export const Ai12zInputForm = /*@__PURE__*/createReactComponent<JSX.Ai12zInputForm, HTMLAi12zInputFormElement>('ai12z-input-form');
17
17
  export const Ai12zKnowledgeBox = /*@__PURE__*/createReactComponent<JSX.Ai12zKnowledgeBox, HTMLAi12zKnowledgeBoxElement>('ai12z-knowledge-box');
18
+ export const Ai12zMic = /*@__PURE__*/createReactComponent<JSX.Ai12zMic, HTMLAi12zMicElement>('ai12z-mic');
18
19
  export const Ai12zSpinner = /*@__PURE__*/createReactComponent<JSX.Ai12zSpinner, HTMLAi12zSpinnerElement>('ai12z-spinner');
19
20
  export const BotPopover = /*@__PURE__*/createReactComponent<JSX.BotPopover, HTMLBotPopoverElement>('bot-popover');
20
21
  export const ChatbotHistory = /*@__PURE__*/createReactComponent<JSX.ChatbotHistory, HTMLChatbotHistoryElement>('chatbot-history');
21
22
  export const ChatbotWelcome = /*@__PURE__*/createReactComponent<JSX.ChatbotWelcome, HTMLChatbotWelcomeElement>('chatbot-welcome');
23
+ export const DynamicForm = /*@__PURE__*/createReactComponent<JSX.DynamicForm, HTMLDynamicFormElement>('dynamic-form');
24
+ export const ListData = /*@__PURE__*/createReactComponent<JSX.ListData, HTMLListDataElement>('list-data');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai12z/react",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "ai12z React Library",
5
5
  "author": "Alpesh Patel <alpesh@ai12z.com>",
6
6
  "homepage": "",
@@ -22,7 +22,7 @@
22
22
  "tsc": "tsc -p . --outDir ./dist"
23
23
  },
24
24
  "dependencies": {
25
- "ai12z": "^1.0.12"
25
+ "ai12z": "^1.0.13"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/react": "^18.2.55",
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "0ceb71c896de70e615eed0e306c3290b6d225cf3"
36
+ "gitHead": "a435381f419fd34d72a3d1bdc8fed2d7dc194558"
37
37
  }