@constructor-io/constructorio-ui-pia 2.2.1 → 2.4.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.
- package/dist/constructorio-ui-pia-bundled.js +78 -22
- package/lib/cjs/components/Answer/Answer.js +2 -1
- package/lib/cjs/components/CioPia/CioPia.js +4 -10
- package/lib/cjs/components/CioPia/PiaCustomCarousel.js +15 -1
- package/lib/cjs/components/ConversationHistory/ConversationHistory.js +4 -2
- package/lib/cjs/components/ConversationHistory/ConversationHistoryStyles.css +1 -0
- package/lib/cjs/components/PiaConversation/PiaConversation.js +2 -2
- package/lib/cjs/components/PiaConversation/PiaModal.js +3 -2
- package/lib/cjs/components/PiaInlineAnswer/PiaInlineAnswer.js +18 -0
- package/lib/cjs/constants.js +0 -1
- package/lib/cjs/index.js +5 -1
- package/lib/cjs/utils/contentTransformers.js +22 -0
- package/lib/cjs/utils/index.js +4 -0
- package/lib/cjs/utils/styleHelpers.js +0 -1
- package/lib/cjs/utils/translate.js +0 -1
- package/lib/cjs/version.js +1 -1
- package/lib/mjs/components/Answer/Answer.js +2 -1
- package/lib/mjs/components/CioPia/CioPia.js +4 -10
- package/lib/mjs/components/CioPia/PiaCustomCarousel.js +27 -2
- package/lib/mjs/components/ConversationHistory/ConversationHistory.js +4 -2
- package/lib/mjs/components/ConversationHistory/ConversationHistoryStyles.css +1 -0
- package/lib/mjs/components/PiaConversation/PiaConversation.js +2 -2
- package/lib/mjs/components/PiaConversation/PiaModal.js +3 -2
- package/lib/mjs/components/PiaInlineAnswer/PiaInlineAnswer.js +14 -0
- package/lib/mjs/constants.js +0 -1
- package/lib/mjs/index.js +2 -0
- package/lib/mjs/utils/contentTransformers.js +16 -0
- package/lib/mjs/utils/index.js +1 -0
- package/lib/mjs/utils/styleHelpers.js +0 -1
- package/lib/mjs/utils/translate.js +0 -1
- package/lib/mjs/version.js +1 -1
- package/lib/types/components/CioPia/CioPia.d.ts +12 -14
- package/lib/types/components/ConversationHistory/ConversationHistory.d.ts +3 -2
- package/lib/types/components/PiaConversation/PiaConversation.d.ts +1 -1
- package/lib/types/components/PiaInlineAnswer/PiaInlineAnswer.d.ts +14 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/types.d.ts +11 -2
- package/lib/types/utils/contentTransformers.d.ts +2 -0
- package/lib/types/utils/index.d.ts +1 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +20 -16
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import CioPia from './components/CioPia';
|
|
2
2
|
export { default as CioPia } from './components/CioPia';
|
|
3
3
|
export type { CioPiaProps } from './components/CioPia';
|
|
4
|
+
export { sanitizeHtml, renderMarkdown } from './utils/contentTransformers';
|
|
4
5
|
export * from './types';
|
|
5
6
|
export default CioPia;
|
package/lib/types/types.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export interface CioPiaProviderProps {
|
|
|
27
27
|
}
|
|
28
28
|
export type CioPiaMode = 'default' | 'conversation';
|
|
29
29
|
export type CioPiaType = 'inline' | 'modal';
|
|
30
|
+
export type DisclaimerPosition = 'top' | 'bottom';
|
|
30
31
|
export type CioPiaDisplayConfigs = {
|
|
31
32
|
learnMoreUrl?: string;
|
|
32
33
|
showFeedback?: boolean;
|
|
@@ -37,6 +38,14 @@ export type CioPiaDisplayConfigs = {
|
|
|
37
38
|
* The last entry always falls back to its own items when currentItems is not provided.
|
|
38
39
|
*/
|
|
39
40
|
showPreviousItems?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Position of the AI disclaimer message relative to the conversation content.
|
|
43
|
+
* - `'top'` — renders the disclaimer above the conversation history or answer.
|
|
44
|
+
* - `'bottom'` — renders the disclaimer below the conversation history or answer.
|
|
45
|
+
*
|
|
46
|
+
* @default 'bottom'
|
|
47
|
+
*/
|
|
48
|
+
disclaimerPosition?: DisclaimerPosition;
|
|
40
49
|
};
|
|
41
50
|
/**
|
|
42
51
|
* Translations type for internationalizing UI strings.
|
|
@@ -104,8 +113,8 @@ export interface FeedbackRenderProps {
|
|
|
104
113
|
onFeedback?: (type: FeedbackType) => void;
|
|
105
114
|
}
|
|
106
115
|
/**
|
|
107
|
-
* Component overrides for CioPia
|
|
108
|
-
* Allows customization of sub-components via reactNode or render props functions
|
|
116
|
+
* Component overrides for CioPia.
|
|
117
|
+
* Allows customization of sub-components via reactNode or render props functions.
|
|
109
118
|
*/
|
|
110
119
|
export interface CioPiaComponentOverrides extends ComponentOverrideProps<CioPiaRenderProps> {
|
|
111
120
|
carousel?: CarouselOverrides<Item>;
|
package/lib/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "2.
|
|
1
|
+
declare const _default: "2.4.0";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructor-io/constructorio-ui-pia",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Constructor.io AI Product Insights Agent UI library for web applications",
|
|
5
5
|
"author": "Constructor.io Corporation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"types": "lib/types/index.d.ts",
|
|
53
53
|
"scripts": {
|
|
54
|
-
"lint": "eslint src
|
|
54
|
+
"lint": "eslint src",
|
|
55
55
|
"check-types": "npx tsc --noEmit",
|
|
56
56
|
"copy-styles": "rsync -am --include='*/' --include='*.css' --exclude='*' src/ lib/mjs/ && rsync -am --include='*/' --include='*.css' --exclude='*' src/ lib/cjs/",
|
|
57
57
|
"dev": "storybook dev -p 6006",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"storybook-docs-dev": "storybook dev --docs -p 6007",
|
|
65
65
|
"serve-built-storybook": "npx http-server docs",
|
|
66
66
|
"compile": "rm -rf lib && tsc -p tsconfig.json && tsc -p tsconfig-cjs.json && npm run copy-styles && vite build",
|
|
67
|
-
"check-license": "license-checker --production --onlyAllow 'Apache-2.0;BSD-3-Clause;MIT;0BSD;BSD-2-Clause;ISC' --excludePackages '
|
|
67
|
+
"check-license": "license-checker --production --onlyAllow 'Apache-2.0;BSD-3-Clause;MIT;0BSD;BSD-2-Clause;ISC' --excludePackages 'lightningcss@1.32.0;lightningcss-darwin-arm64@1.32.0;lightningcss-linux-x64-gnu@1.32.0;lightningcss-linux-x64-musl@1.32.0'",
|
|
68
68
|
"prepare": "husky"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
@@ -82,10 +82,11 @@
|
|
|
82
82
|
"@babel/preset-typescript": "^7.23.3",
|
|
83
83
|
"@chromatic-com/storybook": "^3.2.5",
|
|
84
84
|
"@cspell/eslint-plugin": "^8.17.5",
|
|
85
|
+
"@eslint/js": "^9.39.4",
|
|
85
86
|
"@storybook/addon-a11y": "^8.6.4",
|
|
86
87
|
"@storybook/addon-actions": "^8.6.4",
|
|
87
|
-
"@storybook/addon-essentials": "^8.6.
|
|
88
|
-
"@storybook/addon-interactions": "^8.6.
|
|
88
|
+
"@storybook/addon-essentials": "^8.6.18",
|
|
89
|
+
"@storybook/addon-interactions": "^8.6.18",
|
|
89
90
|
"@storybook/addon-links": "^8.6.4",
|
|
90
91
|
"@storybook/addon-onboarding": "^8.6.4",
|
|
91
92
|
"@storybook/blocks": "^8.6.4",
|
|
@@ -97,32 +98,31 @@
|
|
|
97
98
|
"@storybook/testing-library": "^0.2.1",
|
|
98
99
|
"@testing-library/jest-dom": "^6.6.3",
|
|
99
100
|
"@testing-library/react": "^16.2.0",
|
|
100
|
-
"@types/
|
|
101
|
+
"@types/dompurify": "^3.0.5",
|
|
102
|
+
"@types/jest": "^30.0.0",
|
|
101
103
|
"@types/react": "^19.0.10",
|
|
102
104
|
"@types/react-dom": "^19.0.4",
|
|
103
|
-
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
104
|
-
"@typescript-eslint/parser": "^7.18.0",
|
|
105
105
|
"chromatic": "^11.27.0",
|
|
106
|
-
"eslint": "^
|
|
107
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
108
|
-
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
106
|
+
"eslint": "^9.39.4",
|
|
109
107
|
"eslint-config-prettier": "^10.1.1",
|
|
108
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
110
109
|
"eslint-plugin-import": "^2.31.0",
|
|
111
110
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
112
111
|
"eslint-plugin-prettier": "^5.2.3",
|
|
113
112
|
"eslint-plugin-react": "^7.37.4",
|
|
114
|
-
"eslint-plugin-react-hooks": "^
|
|
115
|
-
"eslint-plugin-storybook": "^0.
|
|
116
|
-
"globals": "^16.
|
|
113
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
114
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
115
|
+
"globals": "^16.5.0",
|
|
117
116
|
"husky": "^9.1.7",
|
|
118
|
-
"jest": "^
|
|
117
|
+
"jest": "^30.3.0",
|
|
119
118
|
"jest-environment-jsdom": "^30.2.0",
|
|
119
|
+
"jest-environment-node": "^30.4.1",
|
|
120
120
|
"license-checker": "^25.0.1",
|
|
121
121
|
"prop-types": "^15.8.1",
|
|
122
122
|
"start-server-and-test": "^2.0.10",
|
|
123
123
|
"storybook": "^8.6.4",
|
|
124
124
|
"typescript": "^4.9.4",
|
|
125
|
-
"typescript-eslint": "^8.
|
|
125
|
+
"typescript-eslint": "^8.59.2",
|
|
126
126
|
"vite": "^6.3.5",
|
|
127
127
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
128
128
|
"webpack": "^5.98.0"
|
|
@@ -130,5 +130,9 @@
|
|
|
130
130
|
"volta": {
|
|
131
131
|
"node": "22.18.0",
|
|
132
132
|
"npm": "10.9.3"
|
|
133
|
+
},
|
|
134
|
+
"dependencies": {
|
|
135
|
+
"dompurify": "^3.4.2",
|
|
136
|
+
"marked": "^15.0.12"
|
|
133
137
|
}
|
|
134
138
|
}
|