@gui-chat-plugin/moodboard 0.1.1 → 0.2.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/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 { TOOL_NAME as y, samples as w, pluginCore as k } from "./core.js";
3
- import { SYSTEM_PROMPT as U, TOOL_DEFINITION as X, executeMoodBoard as Z } from "./core.js";
4
- import { defineComponent as _, ref as m, watch as b, openBlock as o, createElementBlock as s, normalizeStyle as f, createElementVNode as n, toDisplayString as a, createCommentVNode as g, Fragment as v, renderList as $, computed as u } from "vue";
5
- const C = {
6
- key: 0,
7
- class: "size-full relative"
8
- }, M = { class: "absolute top-4 left-4 z-10" }, T = { class: "text-xl font-bold text-gray-800 bg-white/80 px-3 py-1 rounded-lg shadow" }, B = {
9
- key: 0,
10
- class: "text-xs text-gray-500 bg-white/60 px-2 py-0.5 rounded mt-1 inline-block"
11
- }, z = ["viewBox"], N = { class: "items" }, E = ["transform", "onClick"], F = ["x", "y", "width", "height", "fill"], O = ["x", "y", "width", "height"], A = {
12
- "text-anchor": "middle",
13
- "dominant-baseline": "middle",
14
- fill: "#374151",
15
- class: "text-sm font-medium select-none pointer-events-none"
16
- }, S = {
17
- key: 1,
18
- class: "size-full flex items-center justify-center"
19
- }, I = 800, P = 600, V = /* @__PURE__ */ _({
20
- __name: "View",
21
- props: {
22
- selectedResult: {},
23
- sendTextMessage: { type: Function }
24
- },
25
- setup(h) {
26
- const i = h, c = m(null), l = m(null);
27
- b(
28
- () => i.selectedResult,
29
- (e) => {
30
- (e == null ? void 0 : e.toolName) === y && e.data && (l.value = e.data);
31
- },
32
- { immediate: !0 }
33
- );
34
- function p(e, d) {
35
- return e.length <= d ? e : e.slice(0, d - 3) + "...";
36
- }
37
- function r(e) {
38
- i.sendTextMessage && (e.type === "color" ? i.sendTextMessage(
39
- `Add more elements that complement the color ${e.content}`
40
- ) : e.type === "text" ? i.sendTextMessage(
41
- `Expand on the concept "${e.content}" - add related moods and colors`
42
- ) : e.type === "emoji" && i.sendTextMessage(
43
- `Add more elements that match the mood of ${e.content}`
44
- ));
45
- }
46
- return (e, d) => {
47
- var x;
48
- return o(), s("div", {
49
- class: "size-full overflow-hidden",
50
- style: f({ backgroundColor: ((x = l.value) == null ? void 0 : x.backgroundColor) || "#F9FAFB" })
51
- }, [
52
- l.value ? (o(), s("div", C, [
53
- n("div", M, [
54
- n("h2", T, a(l.value.title), 1),
55
- l.value.theme ? (o(), s("span", B, a(l.value.theme), 1)) : g("", !0)
56
- ]),
57
- (o(), s("svg", {
58
- ref_key: "svgRef",
59
- ref: c,
60
- class: "size-full",
61
- viewBox: `0 0 ${I} ${P}`,
62
- preserveAspectRatio: "xMidYMid meet"
63
- }, [
64
- n("g", N, [
65
- (o(!0), s(v, null, $(l.value.items, (t) => (o(), s("g", {
66
- key: t.id,
67
- transform: `translate(${t.x}, ${t.y}) rotate(${t.rotation || 0})`,
68
- class: "cursor-pointer transition-transform duration-200 hover:scale-110",
69
- onClick: (W) => r(t)
70
- }, [
71
- t.type === "color" ? (o(), s("rect", {
72
- key: 0,
73
- x: -t.width / 2,
74
- y: -t.height / 2,
75
- width: t.width,
76
- height: t.height,
77
- fill: t.content,
78
- rx: "8",
79
- class: "drop-shadow-lg",
80
- stroke: "white",
81
- "stroke-width": "3"
82
- }, null, 8, F)) : t.type === "emoji" ? (o(), s("text", {
83
- key: 1,
84
- "text-anchor": "middle",
85
- "dominant-baseline": "middle",
86
- class: "select-none pointer-events-none",
87
- style: f({ fontSize: `${t.width}px` })
88
- }, a(t.content), 5)) : t.type === "text" ? (o(), s(v, { key: 2 }, [
89
- n("rect", {
90
- x: -t.width / 2,
91
- y: -t.height / 2,
92
- width: t.width,
93
- height: t.height,
94
- fill: "white",
95
- rx: "4",
96
- class: "drop-shadow-md"
97
- }, null, 8, O),
98
- n("text", A, a(p(t.content, 15)), 1)
99
- ], 64)) : g("", !0)
100
- ], 8, E))), 128))
101
- ])
102
- ], 8, z)),
103
- d[0] || (d[0] = n("div", { class: "absolute bottom-4 left-4 right-4 text-center" }, [
104
- n("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 ")
105
- ], -1))
106
- ])) : (o(), s("div", S, [...d[1] || (d[1] = [
107
- n("p", { class: "text-gray-400" }, "No mood board data", -1)
108
- ])]))
109
- ], 4);
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.1",
3
+ "version": "0.2.0",
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": ["dist"],
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.3",
42
- "vue": "^3.5.0",
43
+ "gui-chat-protocol": "^0.1.0",
43
44
  "react": "^18.0.0 || ^19.0.0",
44
- "react-dom": "^18.0.0 || ^19.0.0"
45
+ "react-dom": "^18.0.0 || ^19.0.0",
46
+ "vue": "^3.5.0"
45
47
  },
46
48
  "peerDependenciesMeta": {
47
- "vue": { "optional": true },
48
- "react": { "optional": true },
49
- "react-dom": { "optional": true }
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
- "@tailwindcss/vite": "^4.1.18",
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.32.1",
56
- "@typescript-eslint/parser": "^8.32.1",
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.0",
59
- "eslint": "^9.27.0",
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.0.0",
63
- "globals": "^16.1.0",
64
- "gui-chat-protocol": "^0.0.3",
71
+ "eslint-plugin-vue": "^10.8.0",
72
+ "globals": "^17.4.0",
73
+ "gui-chat-protocol": "^0.1.0",
65
74
  "react": "^19.1.0",
66
75
  "react-dom": "^19.1.0",
67
- "tailwindcss": "^4.1.7",
68
- "typescript": "~5.8.3",
69
- "vite": "^6.3.5",
70
- "vue": "^3.5.13",
71
- "vue-eslint-parser": "^10.1.3",
72
- "vue-tsc": "^2.2.10"
76
+ "tailwindcss": "^4.2.2",
77
+ "typescript": "~6.0.2",
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": ["guichat", "plugin", "moodboard", "inspiration", "visual", "brainstorming"],
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.3",
93
+ "gui-chat-protocol": "^0.1.0",
78
94
  "openai": "^4.77.0"
79
95
  }
80
96
  }