@gui-chat-plugin/moodboard 0.1.1 → 0.1.2
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/core.cjs +1 -17
- package/dist/core.js +2 -325
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -9
- package/dist/react.cjs +2 -18
- package/dist/react.js +305 -411
- package/dist/samples-B2-ZKxci.js +413 -0
- package/dist/samples-CQDcSeUn.cjs +17 -0
- package/dist/style.css +3 -1
- package/dist/vue/Preview.vue.d.ts +2 -1
- package/dist/vue/View.vue.d.ts +4 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +111 -147
- package/package.json +37 -21
package/dist/vue.js
CHANGED
|
@@ -1,148 +1,112 @@
|
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "./samples-B2-ZKxci.js";
|
|
1
2
|
/* empty css */
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}), j = { class: "p-3 bg-gradient-to-br from-purple-50 to-pink-50 rounded-lg text-center" }, D = { class: "text-purple-700 font-medium text-sm truncate" }, L = { class: "text-xs text-gray-500 mt-1" }, Y = /* @__PURE__ */ _({
|
|
113
|
-
__name: "Preview",
|
|
114
|
-
props: {
|
|
115
|
-
result: {}
|
|
116
|
-
},
|
|
117
|
-
setup(h) {
|
|
118
|
-
const i = h, c = u(() => i.result.data), l = u(() => {
|
|
119
|
-
var r;
|
|
120
|
-
return ((r = c.value) == null ? void 0 : r.title) || "Mood Board";
|
|
121
|
-
}), p = u(() => {
|
|
122
|
-
var r, e;
|
|
123
|
-
return ((e = (r = c.value) == null ? void 0 : r.items) == null ? void 0 : e.length) || 0;
|
|
124
|
-
});
|
|
125
|
-
return (r, e) => (o(), s("div", j, [
|
|
126
|
-
e[0] || (e[0] = n("div", { class: "text-2xl mb-1" }, "🎨", -1)),
|
|
127
|
-
n("div", D, a(l.value), 1),
|
|
128
|
-
n("div", L, a(p.value) + " elements ", 1)
|
|
129
|
-
]));
|
|
130
|
-
}
|
|
131
|
-
}), H = {
|
|
132
|
-
...k,
|
|
133
|
-
viewComponent: V,
|
|
134
|
-
previewComponent: Y,
|
|
135
|
-
samples: w
|
|
136
|
-
}, K = { plugin: H };
|
|
137
|
-
export {
|
|
138
|
-
Y as Preview,
|
|
139
|
-
U as SYSTEM_PROMPT,
|
|
140
|
-
X as TOOL_DEFINITION,
|
|
141
|
-
y as TOOL_NAME,
|
|
142
|
-
V as View,
|
|
143
|
-
K as default,
|
|
144
|
-
Z as executeMoodBoard,
|
|
145
|
-
H as plugin,
|
|
146
|
-
k as pluginCore,
|
|
147
|
-
w as samples
|
|
148
|
-
};
|
|
3
|
+
import { Fragment as o, computed as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, defineComponent as d, normalizeStyle as f, openBlock as p, ref as m, renderList as h, toDisplayString as g, watch as _ } from "vue";
|
|
4
|
+
//#region src/vue/View.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var v = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "size-full relative"
|
|
8
|
+
}, y = { class: "absolute top-4 left-4 z-10" }, b = { class: "text-xl font-bold text-gray-800 bg-white/80 px-3 py-1 rounded-lg shadow" }, x = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "text-xs text-gray-500 bg-white/60 px-2 py-0.5 rounded mt-1 inline-block"
|
|
11
|
+
}, S = ["viewBox"], C = { class: "items" }, w = ["transform", "onClick"], T = [
|
|
12
|
+
"x",
|
|
13
|
+
"y",
|
|
14
|
+
"width",
|
|
15
|
+
"height",
|
|
16
|
+
"fill"
|
|
17
|
+
], E = [
|
|
18
|
+
"x",
|
|
19
|
+
"y",
|
|
20
|
+
"width",
|
|
21
|
+
"height"
|
|
22
|
+
], D = {
|
|
23
|
+
"text-anchor": "middle",
|
|
24
|
+
"dominant-baseline": "middle",
|
|
25
|
+
fill: "#374151",
|
|
26
|
+
class: "text-sm font-medium select-none pointer-events-none"
|
|
27
|
+
}, O = {
|
|
28
|
+
key: 1,
|
|
29
|
+
class: "size-full flex items-center justify-center"
|
|
30
|
+
}, k = 800, A = 600, j = /* @__PURE__ */ d({
|
|
31
|
+
__name: "View",
|
|
32
|
+
props: {
|
|
33
|
+
selectedResult: {},
|
|
34
|
+
sendTextMessage: { type: Function }
|
|
35
|
+
},
|
|
36
|
+
setup(e, { expose: t }) {
|
|
37
|
+
let n = e, r = m(null);
|
|
38
|
+
t({ svgRef: r });
|
|
39
|
+
let i = m(null);
|
|
40
|
+
_(() => n.selectedResult, (e) => {
|
|
41
|
+
e?.toolName === "createMoodBoard" && e.data && (i.value = e.data);
|
|
42
|
+
}, { immediate: !0 });
|
|
43
|
+
function a(e, t) {
|
|
44
|
+
return e.length <= t ? e : e.slice(0, t - 3) + "...";
|
|
45
|
+
}
|
|
46
|
+
function s(e) {
|
|
47
|
+
n.sendTextMessage && (e.type === "color" ? n.sendTextMessage(`Add more elements that complement the color ${e.content}`) : e.type === "text" ? n.sendTextMessage(`Expand on the concept "${e.content}" - add related moods and colors`) : e.type === "emoji" && n.sendTextMessage(`Add more elements that match the mood of ${e.content}`));
|
|
48
|
+
}
|
|
49
|
+
return (e, t) => (p(), l("div", {
|
|
50
|
+
class: "size-full overflow-hidden",
|
|
51
|
+
style: f({ backgroundColor: i.value?.backgroundColor || "#F9FAFB" })
|
|
52
|
+
}, [i.value ? (p(), l("div", v, [
|
|
53
|
+
u("div", y, [u("h2", b, g(i.value.title), 1), i.value.theme ? (p(), l("span", x, g(i.value.theme), 1)) : c("", !0)]),
|
|
54
|
+
(p(), l("svg", {
|
|
55
|
+
ref_key: "svgRef",
|
|
56
|
+
ref: r,
|
|
57
|
+
class: "size-full",
|
|
58
|
+
viewBox: `0 0 ${k} ${A}`,
|
|
59
|
+
preserveAspectRatio: "xMidYMid meet"
|
|
60
|
+
}, [u("g", C, [(p(!0), l(o, null, h(i.value.items, (e) => (p(), l("g", {
|
|
61
|
+
key: e.id,
|
|
62
|
+
transform: `translate(${e.x}, ${e.y}) rotate(${e.rotation || 0})`,
|
|
63
|
+
class: "cursor-pointer transition-transform duration-200 hover:scale-110",
|
|
64
|
+
onClick: (t) => s(e)
|
|
65
|
+
}, [e.type === "color" ? (p(), l("rect", {
|
|
66
|
+
key: 0,
|
|
67
|
+
x: -e.width / 2,
|
|
68
|
+
y: -e.height / 2,
|
|
69
|
+
width: e.width,
|
|
70
|
+
height: e.height,
|
|
71
|
+
fill: e.content,
|
|
72
|
+
rx: "8",
|
|
73
|
+
class: "drop-shadow-lg",
|
|
74
|
+
stroke: "white",
|
|
75
|
+
"stroke-width": "3"
|
|
76
|
+
}, null, 8, T)) : e.type === "emoji" ? (p(), l("text", {
|
|
77
|
+
key: 1,
|
|
78
|
+
"text-anchor": "middle",
|
|
79
|
+
"dominant-baseline": "middle",
|
|
80
|
+
class: "select-none pointer-events-none",
|
|
81
|
+
style: f({ fontSize: `${e.width}px` })
|
|
82
|
+
}, g(e.content), 5)) : e.type === "text" ? (p(), l(o, { key: 2 }, [u("rect", {
|
|
83
|
+
x: -e.width / 2,
|
|
84
|
+
y: -e.height / 2,
|
|
85
|
+
width: e.width,
|
|
86
|
+
height: e.height,
|
|
87
|
+
fill: "white",
|
|
88
|
+
rx: "4",
|
|
89
|
+
class: "drop-shadow-md"
|
|
90
|
+
}, null, 8, E), u("text", D, g(a(e.content, 15)), 1)], 64)) : c("", !0)], 8, w))), 128))])], 8, S)),
|
|
91
|
+
t[0] ||= u("div", { class: "absolute bottom-4 left-4 right-4 text-center" }, [u("p", { class: "text-sm text-gray-500 bg-white/80 px-3 py-2 rounded-lg inline-block" }, " Click an item to explore related concepts ")], -1)
|
|
92
|
+
])) : (p(), l("div", O, [...t[1] ||= [u("p", { class: "text-gray-400" }, "No mood board data", -1)]]))], 4));
|
|
93
|
+
}
|
|
94
|
+
}), M = { class: "p-3 bg-gradient-to-br from-purple-50 to-pink-50 rounded-lg text-center" }, N = { class: "text-purple-700 font-medium text-sm truncate" }, P = { class: "text-xs text-gray-500 mt-1" }, F = /* @__PURE__ */ d({
|
|
95
|
+
__name: "Preview",
|
|
96
|
+
props: { result: {} },
|
|
97
|
+
setup(e) {
|
|
98
|
+
let t = e, n = s(() => t.result.data), r = s(() => n.value?.title || "Mood Board"), i = s(() => n.value?.items?.length || 0);
|
|
99
|
+
return (e, t) => (p(), l("div", M, [
|
|
100
|
+
t[0] ||= u("div", { class: "text-2xl mb-1" }, "🎨", -1),
|
|
101
|
+
u("div", N, g(r.value), 1),
|
|
102
|
+
u("div", P, g(i.value) + " elements ", 1)
|
|
103
|
+
]));
|
|
104
|
+
}
|
|
105
|
+
}), I = {
|
|
106
|
+
...i,
|
|
107
|
+
viewComponent: j,
|
|
108
|
+
previewComponent: F,
|
|
109
|
+
samples: a
|
|
110
|
+
}, L = { plugin: I };
|
|
111
|
+
//#endregion
|
|
112
|
+
export { F as Preview, t as SYSTEM_PROMPT, e as TOOL_DEFINITION, r as TOOL_NAME, j as View, L as default, n as executeMoodBoard, I as plugin, i as pluginCore, a as samples };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gui-chat-plugin/moodboard",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Interactive mood board plugin for visual inspiration and brainstorming",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
},
|
|
30
30
|
"./style.css": "./dist/style.css"
|
|
31
31
|
},
|
|
32
|
-
"files": [
|
|
32
|
+
"files": [
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
33
35
|
"scripts": {
|
|
34
36
|
"dev": "vite",
|
|
35
37
|
"dev:react": "vite --config vite.config.react.ts",
|
|
@@ -38,43 +40,57 @@
|
|
|
38
40
|
"lint": "eslint src demo"
|
|
39
41
|
},
|
|
40
42
|
"peerDependencies": {
|
|
41
|
-
"gui-chat-protocol": "^0.0.
|
|
43
|
+
"gui-chat-protocol": "^0.0.4",
|
|
42
44
|
"vue": "^3.5.0",
|
|
43
45
|
"react": "^18.0.0 || ^19.0.0",
|
|
44
46
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
45
47
|
},
|
|
46
48
|
"peerDependenciesMeta": {
|
|
47
|
-
"vue": {
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
"vue": {
|
|
50
|
+
"optional": true
|
|
51
|
+
},
|
|
52
|
+
"react": {
|
|
53
|
+
"optional": true
|
|
54
|
+
},
|
|
55
|
+
"react-dom": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
50
58
|
},
|
|
51
59
|
"devDependencies": {
|
|
52
|
-
"@
|
|
60
|
+
"@eslint/js": "^10.0.1",
|
|
61
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
53
62
|
"@types/react": "^19.1.8",
|
|
54
63
|
"@types/react-dom": "^19.1.6",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
56
|
-
"@typescript-eslint/parser": "^8.
|
|
64
|
+
"@typescript-eslint/eslint-plugin": "^8.58.0",
|
|
65
|
+
"@typescript-eslint/parser": "^8.58.0",
|
|
57
66
|
"@vitejs/plugin-react": "^4.5.2",
|
|
58
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
59
|
-
"eslint": "^
|
|
67
|
+
"@vitejs/plugin-vue": "^6.0.5",
|
|
68
|
+
"eslint": "^10.1.0",
|
|
60
69
|
"eslint-plugin-react": "^7.37.5",
|
|
61
70
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
62
|
-
"eslint-plugin-vue": "^10.
|
|
63
|
-
"globals": "^
|
|
64
|
-
"gui-chat-protocol": "^0.0.
|
|
71
|
+
"eslint-plugin-vue": "^10.8.0",
|
|
72
|
+
"globals": "^17.4.0",
|
|
73
|
+
"gui-chat-protocol": "^0.0.4",
|
|
65
74
|
"react": "^19.1.0",
|
|
66
75
|
"react-dom": "^19.1.0",
|
|
67
|
-
"tailwindcss": "^4.
|
|
76
|
+
"tailwindcss": "^4.2.2",
|
|
68
77
|
"typescript": "~5.8.3",
|
|
69
|
-
"vite": "^
|
|
70
|
-
"vue": "^3.5.
|
|
71
|
-
"vue-eslint-parser": "^10.
|
|
72
|
-
"vue-tsc": "^
|
|
78
|
+
"vite": "^8.0.3",
|
|
79
|
+
"vue": "^3.5.31",
|
|
80
|
+
"vue-eslint-parser": "^10.4.0",
|
|
81
|
+
"vue-tsc": "^3.2.6"
|
|
73
82
|
},
|
|
74
|
-
"keywords": [
|
|
83
|
+
"keywords": [
|
|
84
|
+
"guichat",
|
|
85
|
+
"plugin",
|
|
86
|
+
"moodboard",
|
|
87
|
+
"inspiration",
|
|
88
|
+
"visual",
|
|
89
|
+
"brainstorming"
|
|
90
|
+
],
|
|
75
91
|
"license": "MIT",
|
|
76
92
|
"dependencies": {
|
|
77
|
-
"gui-chat-protocol": "^0.0.
|
|
93
|
+
"gui-chat-protocol": "^0.0.4",
|
|
78
94
|
"openai": "^4.77.0"
|
|
79
95
|
}
|
|
80
96
|
}
|