@ai12z/react 0.0.1-alpha.21 → 0.0.1-alpha.25

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
@@ -7,7 +7,35 @@
7
7
  ```
8
8
  const reactLibrary = require('react-library');
9
9
 
10
- // TODO: DEMONSTRATE API
10
+ ```
11
+
12
+ We are providing the option named as **ctaAttributes** for assigning the JSON object programmatically and sending those object to the API payload for furthur use.
13
+
14
+ ```
15
+ <script>
16
+ const ele = document.querySelector('ai12z-cta');
17
+ ele.ctaAttributes = {
18
+ content: {
19
+ newlist: [
20
+ {
21
+ _uid: "BUY6Drn9e1",
22
+ component: "foo",
23
+ headline: "Foo"
24
+ },
25
+ {
26
+ _uid: "gJZoSLkfZV",
27
+ component: "bar",
28
+ title: "Bar"
29
+ },
30
+ {
31
+ _uid: "X1JAfdsZxy",
32
+ component: "foo",
33
+ headline: "Another headline"
34
+ }
35
+ ]
36
+ }
37
+ };
38
+ </script>
11
39
  ```
12
40
  # Setup
13
41
 
@@ -26,31 +54,39 @@ import { Ai12zCta, Ai12zKnowledgeBox } from '@ai12z/react'
26
54
  ```
27
55
 
28
56
  - Then you can use the element anywhere in your template.
29
- - The control named as **ai12z-cta** allows us to show the search results along with the follow up chat conversations and customize our search results.
57
+ - The control named as **Ai12zCta** allows us to show the search results along with the follow up chat conversations and customize our search results.
30
58
  - This control is having two tag element which is mentioned below.
31
59
 
32
60
  ```
33
- <privacy></privacy>
34
- <cta></cta>
61
+ <Ai12zCta>
62
+ <privacy></privacy>
63
+ <cta></cta>
64
+ </Ai12zCta>
35
65
  ```
36
- - **<privacy></privacy>** This tag element allows us to add the privacy policy links.
37
- - **<cta></cta>** This tag element allows us to customize our page by adding our own tag elements within this element.
66
+ - **<privacy></privacy>** (Optional) This tag element allows us to add the privacy policy links.
67
+ - **<cta></cta>** (Optional) This tag element allows us to customize our page by adding our own tag elements within this element.
38
68
 
39
69
 
40
70
  - The control contains following properties to customize the page.
41
71
 
42
72
  | Property | Description | Example |
43
73
  |-----------|:-----------:|-----------:|
44
- | data-key | Allows us to enter the data-key which is used by API | data-key="123456" |
45
- | data-mode | Allows us to enter the data-mode which will identify the server as local or dev or prod | data-mode="dev" |
46
- | heading | Allows us to show the header text | heading="Search Here 1" |
47
- | button-text | Allows us to customize the button name | button-text="Ask me" |
48
- | help-text | Allows us to customize the helper text | help-text="Type your question here..." |
49
- | no-results-text | allows us to customize the no results found text | no-results-text="No results found..." |
50
-
51
- - The second control named as **ai12z-knowledge-box** allows us to send the query programmmatically through javascript and rendering the query results by clicking on the button.
74
+ | dataKey (Required) | API key from your ai12z project settings | dataKey="123456" |
75
+ | dataMode (Required) | Allows us to enter the data-mode which will identify the server as local or dev or prod | dataMode="dev" |
76
+ | heading (Optional) | Allows us to show the header text | heading="Search Here 1" |
77
+ | buttonText (Optional) | Allows us to customize the button name | buttonText="Ask me" |
78
+ | helpText (Optional) | Allows us to customize the helper text | helpText="Type your question here..." |
79
+ | noResultsText (Optional) | allows us to customize the no results found text | noResultsText="No results found..." |
80
+ | autoSearch (Optional) | allows us to configure the search option | autoSearch="true" |
81
+ | placeholder (Optional) | allows us to customize the placeholder text | placeholder="Enter the text" |
82
+ | iconSrc (Optional) | allows us to add the icon to the search button along with the text or icon only | icon-src= "https://uxwing.com/wp-content/themes/uxwing/download/user-interface/magnifying-glass-icon.png?w=24&h=24" |
83
+ | categorize (Optional) | allows us to customize the search results based on the category. By default the search results will be catogorized. | categorize = "true" |
84
+
85
+ - The second control named as **Ai12zKnowledgeBox** allows us to send the query programmmatically through javascript and rendering the query results by clicking on the button.
52
86
 
53
87
  | Property | Description | Example |
54
88
  |-----------|:-----------:|-----------:|
55
- | question | Allows us to set the question for on-load | question="what does ai12z do" |
56
- | relavance-score | allows us to view the score of clicks, engagement, conversions and negative reviews. | relavance-score="true" |
89
+ | dataKey (Required) | API key from your ai12z project settings | dataKey="123456" |
90
+ | dataMode (Required) | Allows us to enter the data-mode which will identify the server as local or dev or prod | dataMode="dev" |
91
+ | question (Required) | Allows us to set the question for on-load | question="what does ai12z do" |
92
+ | relavanceScore (Optional) | allows us to view the score of clicks, engagement, conversions and negative reviews. | relavanceScore="true" |
@@ -1,6 +1,7 @@
1
1
  import { createReactComponent } from './react-component-lib';
2
2
  import { defineCustomElements } from 'ai12z/loader';
3
3
  defineCustomElements();
4
+ export const Ai12zCategory = createReactComponent('ai12z-category');
4
5
  export const Ai12zChat = createReactComponent('ai12z-chat');
5
6
  export const Ai12zCta = createReactComponent('ai12z-cta');
6
7
  export const Ai12zInputForm = createReactComponent('ai12z-input-form');
@@ -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,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"}
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,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"}
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { JSX } from 'ai12z';
3
+ 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>>;
3
4
  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>>;
4
5
  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>>;
5
6
  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,6 +8,7 @@ import type { JSX } from 'ai12z';
8
8
  import { defineCustomElements } from 'ai12z/loader';
9
9
 
10
10
  defineCustomElements();
11
+ export const Ai12zCategory = /*@__PURE__*/createReactComponent<JSX.Ai12zCategory, HTMLAi12zCategoryElement>('ai12z-category');
11
12
  export const Ai12zChat = /*@__PURE__*/createReactComponent<JSX.Ai12zChat, HTMLAi12zChatElement>('ai12z-chat');
12
13
  export const Ai12zCta = /*@__PURE__*/createReactComponent<JSX.Ai12zCta, HTMLAi12zCtaElement>('ai12z-cta');
13
14
  export const Ai12zInputForm = /*@__PURE__*/createReactComponent<JSX.Ai12zInputForm, HTMLAi12zInputFormElement>('ai12z-input-form');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai12z/react",
3
- "version": "0.0.1-alpha.21",
3
+ "version": "0.0.1-alpha.25",
4
4
  "description": "ai12z React Library",
5
5
  "author": "Alpesh Patel <alpesh@ai12z.com>",
6
6
  "homepage": "",
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "4ec6094f5088180f1c72cf7fe47aee297f2467ab"
36
+ "gitHead": "6619bdf3a320b2905099a71f971a5a6ef23fd2c3"
37
37
  }