@streamoid/catalogix-chat 0.1.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/index.d.ts +71 -0
- package/dist/index.js +86 -0
- package/package.json +37 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Props interface matching ChatComponentProps from @streamoid/chat-component-types.
|
|
5
|
+
* Declared locally to avoid a build-time dependency on the types package at
|
|
6
|
+
* runtime (types are erased anyway).
|
|
7
|
+
*/
|
|
8
|
+
interface CatalogixChatProps {
|
|
9
|
+
workspaceId: string;
|
|
10
|
+
userId: string;
|
|
11
|
+
email: string;
|
|
12
|
+
conversationId: string;
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
submitted?: boolean;
|
|
15
|
+
submittedValues?: Record<string, unknown>;
|
|
16
|
+
uiProps: Record<string, unknown>;
|
|
17
|
+
meta?: Record<string, unknown>;
|
|
18
|
+
onSubmit: (values: Record<string, unknown>, message?: string) => void;
|
|
19
|
+
onCancel?: () => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Placeholder component exported for use in the dashboard registry.
|
|
23
|
+
*
|
|
24
|
+
* The actual CreateStore, AddProductsOptions, SelectProducts and Automations
|
|
25
|
+
* components from the catalogix app tree will be wired in by the catalogix
|
|
26
|
+
* team once this package is fully integrated. For now this renders a shell
|
|
27
|
+
* that shows which section was requested.
|
|
28
|
+
*/
|
|
29
|
+
declare function CatalogixChat(props: CatalogixChatProps): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
declare const catalogixManifest: readonly [{
|
|
32
|
+
readonly name: "catalogix:create-store";
|
|
33
|
+
readonly aliases: readonly ["create_or_select_store"];
|
|
34
|
+
readonly service: "catalogix";
|
|
35
|
+
readonly description: "Create or select a Catalogix store";
|
|
36
|
+
readonly containerStyle: {
|
|
37
|
+
readonly overflow: "auto";
|
|
38
|
+
readonly marginTop: "8px";
|
|
39
|
+
readonly paddingBottom: "16px";
|
|
40
|
+
readonly height: "600px";
|
|
41
|
+
readonly position: "relative";
|
|
42
|
+
readonly width: "100%";
|
|
43
|
+
};
|
|
44
|
+
}, {
|
|
45
|
+
readonly name: "catalogix:select-products";
|
|
46
|
+
readonly aliases: readonly ["select_products"];
|
|
47
|
+
readonly service: "catalogix";
|
|
48
|
+
readonly description: "Select products from a Catalogix store";
|
|
49
|
+
readonly containerStyle: {
|
|
50
|
+
readonly overflow: "auto";
|
|
51
|
+
readonly marginTop: "8px";
|
|
52
|
+
readonly paddingBottom: "16px";
|
|
53
|
+
readonly height: "600px";
|
|
54
|
+
readonly position: "relative";
|
|
55
|
+
readonly width: "100%";
|
|
56
|
+
};
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "catalogix:automations";
|
|
59
|
+
readonly aliases: readonly ["trigger_automation"];
|
|
60
|
+
readonly service: "catalogix";
|
|
61
|
+
readonly description: "Trigger Catalogix automations";
|
|
62
|
+
readonly containerStyle: {
|
|
63
|
+
readonly overflow: "auto";
|
|
64
|
+
readonly marginTop: "8px";
|
|
65
|
+
readonly height: "600px";
|
|
66
|
+
readonly position: "relative";
|
|
67
|
+
readonly width: "100%";
|
|
68
|
+
};
|
|
69
|
+
}];
|
|
70
|
+
|
|
71
|
+
export { CatalogixChat, catalogixManifest };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// src/CatalogixChat.tsx
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
function CatalogixChat(props) {
|
|
5
|
+
const { uiProps, meta } = props;
|
|
6
|
+
const componentName = uiProps?._componentName;
|
|
7
|
+
const initialSection = meta?.step || componentName || null;
|
|
8
|
+
const [section, setSection] = useState(initialSection);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const metaStep = meta?.step;
|
|
11
|
+
if (metaStep && metaStep !== section) {
|
|
12
|
+
setSection(metaStep);
|
|
13
|
+
}
|
|
14
|
+
}, [meta?.step]);
|
|
15
|
+
return /* @__PURE__ */ jsxs(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
style: {
|
|
19
|
+
padding: "16px",
|
|
20
|
+
fontFamily: "system-ui, sans-serif",
|
|
21
|
+
color: "#333"
|
|
22
|
+
},
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsxs("p", { style: { fontSize: "14px", color: "#666" }, children: [
|
|
25
|
+
/* @__PURE__ */ jsx("strong", { children: "Catalogix" }),
|
|
26
|
+
" \u2014 section: ",
|
|
27
|
+
/* @__PURE__ */ jsx("code", { children: section })
|
|
28
|
+
] }),
|
|
29
|
+
/* @__PURE__ */ jsxs("p", { style: { fontSize: "12px", color: "#999", marginTop: "4px" }, children: [
|
|
30
|
+
"This is a placeholder from ",
|
|
31
|
+
/* @__PURE__ */ jsx("code", { children: "@streamoid/catalogix-chat" }),
|
|
32
|
+
". Replace with actual catalogix components (CreateStore, SelectProducts, Automations) by importing from the catalogix app source tree."
|
|
33
|
+
] })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// src/manifest.ts
|
|
40
|
+
var catalogixManifest = [
|
|
41
|
+
{
|
|
42
|
+
name: "catalogix:create-store",
|
|
43
|
+
aliases: ["create_or_select_store"],
|
|
44
|
+
service: "catalogix",
|
|
45
|
+
description: "Create or select a Catalogix store",
|
|
46
|
+
containerStyle: {
|
|
47
|
+
overflow: "auto",
|
|
48
|
+
marginTop: "8px",
|
|
49
|
+
paddingBottom: "16px",
|
|
50
|
+
height: "600px",
|
|
51
|
+
position: "relative",
|
|
52
|
+
width: "100%"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "catalogix:select-products",
|
|
57
|
+
aliases: ["select_products"],
|
|
58
|
+
service: "catalogix",
|
|
59
|
+
description: "Select products from a Catalogix store",
|
|
60
|
+
containerStyle: {
|
|
61
|
+
overflow: "auto",
|
|
62
|
+
marginTop: "8px",
|
|
63
|
+
paddingBottom: "16px",
|
|
64
|
+
height: "600px",
|
|
65
|
+
position: "relative",
|
|
66
|
+
width: "100%"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "catalogix:automations",
|
|
71
|
+
aliases: ["trigger_automation"],
|
|
72
|
+
service: "catalogix",
|
|
73
|
+
description: "Trigger Catalogix automations",
|
|
74
|
+
containerStyle: {
|
|
75
|
+
overflow: "auto",
|
|
76
|
+
marginTop: "8px",
|
|
77
|
+
height: "600px",
|
|
78
|
+
position: "relative",
|
|
79
|
+
width: "100%"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
export {
|
|
84
|
+
CatalogixChat,
|
|
85
|
+
catalogixManifest
|
|
86
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@streamoid/catalogix-chat",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Catalogix chat components for the Streamoid chat host — store creation, product selection, automations",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup",
|
|
20
|
+
"prepublishOnly": "npm run build"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"react": "^18.0.0",
|
|
24
|
+
"react-dom": "^18.0.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@streamoid/chat-component-types": "^0.1.0",
|
|
28
|
+
"@types/react": "^18.0.0",
|
|
29
|
+
"@types/react-dom": "^18.0.0",
|
|
30
|
+
"tsup": "^8.0.0",
|
|
31
|
+
"typescript": "^5.0.0"
|
|
32
|
+
},
|
|
33
|
+
"license": "ISC",
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
}
|
|
37
|
+
}
|