@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/react.js CHANGED
@@ -1,415 +1,309 @@
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 ee, samples as re, pluginCore as te } from "./core.js";
3
- import { SYSTEM_PROMPT as Te, TOOL_DEFINITION as Re, executeMoodBoard as ge } from "./core.js";
4
- import ne, { useState as oe, useEffect as ae } from "react";
5
- var v = { exports: {} }, h = {};
6
- /**
7
- * @license React
8
- * react-jsx-runtime.production.js
9
- *
10
- * Copyright (c) Meta Platforms, Inc. and affiliates.
11
- *
12
- * This source code is licensed under the MIT license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- */
15
- var Y;
16
- function se() {
17
- if (Y) return h;
18
- Y = 1;
19
- var a = Symbol.for("react.transitional.element"), i = Symbol.for("react.fragment");
20
- function u(d, c, r) {
21
- var m = null;
22
- if (r !== void 0 && (m = "" + r), c.key !== void 0 && (m = "" + c.key), "key" in c) {
23
- r = {};
24
- for (var p in c)
25
- p !== "key" && (r[p] = c[p]);
26
- } else r = c;
27
- return c = r.ref, {
28
- $$typeof: a,
29
- type: d,
30
- key: m,
31
- ref: c !== void 0 ? c : null,
32
- props: r
33
- };
34
- }
35
- return h.Fragment = i, h.jsx = u, h.jsxs = u, h;
3
+ import { useEffect as o, useState as s } from "react";
4
+ //#region \0rolldown/runtime.js
5
+ var c = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), l = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
6
+ if (typeof require < "u") return require.apply(this, arguments);
7
+ throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
8
+ }), u = /* @__PURE__ */ c(((e) => {
9
+ var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
10
+ function r(e, n, r) {
11
+ var i = null;
12
+ if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
13
+ else r = n;
14
+ return n = r.ref, {
15
+ $$typeof: t,
16
+ type: e,
17
+ key: i,
18
+ ref: n === void 0 ? null : n,
19
+ props: r
20
+ };
21
+ }
22
+ e.Fragment = n, e.jsx = r, e.jsxs = r;
23
+ })), d = /* @__PURE__ */ c(((e) => {
24
+ process.env.NODE_ENV !== "production" && (function() {
25
+ function t(e) {
26
+ if (e == null) return null;
27
+ if (typeof e == "function") return e.$$typeof === k ? null : e.displayName || e.name || null;
28
+ if (typeof e == "string") return e;
29
+ switch (e) {
30
+ case v: return "Fragment";
31
+ case b: return "Profiler";
32
+ case y: return "StrictMode";
33
+ case w: return "Suspense";
34
+ case T: return "SuspenseList";
35
+ case O: return "Activity";
36
+ }
37
+ if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
38
+ case _: return "Portal";
39
+ case S: return e.displayName || "Context";
40
+ case x: return (e._context.displayName || "Context") + ".Consumer";
41
+ case C:
42
+ var n = e.render;
43
+ return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
44
+ case E: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
45
+ case D:
46
+ n = e._payload, e = e._init;
47
+ try {
48
+ return t(e(n));
49
+ } catch {}
50
+ }
51
+ return null;
52
+ }
53
+ function n(e) {
54
+ return "" + e;
55
+ }
56
+ function r(e) {
57
+ try {
58
+ n(e);
59
+ var t = !1;
60
+ } catch {
61
+ t = !0;
62
+ }
63
+ if (t) {
64
+ t = console;
65
+ var r = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
66
+ return r.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), n(e);
67
+ }
68
+ }
69
+ function i(e) {
70
+ if (e === v) return "<>";
71
+ if (typeof e == "object" && e && e.$$typeof === D) return "<...>";
72
+ try {
73
+ var n = t(e);
74
+ return n ? "<" + n + ">" : "<...>";
75
+ } catch {
76
+ return "<...>";
77
+ }
78
+ }
79
+ function a() {
80
+ var e = A.A;
81
+ return e === null ? null : e.getOwner();
82
+ }
83
+ function o() {
84
+ return Error("react-stack-top-frame");
85
+ }
86
+ function s(e) {
87
+ if (j.call(e, "key")) {
88
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
89
+ if (t && t.isReactWarning) return !1;
90
+ }
91
+ return e.key !== void 0;
92
+ }
93
+ function c(e, t) {
94
+ function n() {
95
+ P || (P = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
96
+ }
97
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
98
+ get: n,
99
+ configurable: !0
100
+ });
101
+ }
102
+ function u() {
103
+ var e = t(this.type);
104
+ return F[e] || (F[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
105
+ }
106
+ function d(e, t, n, r, i, a) {
107
+ var o = n.ref;
108
+ return e = {
109
+ $$typeof: g,
110
+ type: e,
111
+ key: t,
112
+ props: n,
113
+ _owner: r
114
+ }, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
115
+ enumerable: !1,
116
+ value: null
117
+ }) : Object.defineProperty(e, "ref", {
118
+ enumerable: !1,
119
+ get: u
120
+ }), e._store = {}, Object.defineProperty(e._store, "validated", {
121
+ configurable: !1,
122
+ enumerable: !1,
123
+ writable: !0,
124
+ value: 0
125
+ }), Object.defineProperty(e, "_debugInfo", {
126
+ configurable: !1,
127
+ enumerable: !1,
128
+ writable: !0,
129
+ value: null
130
+ }), Object.defineProperty(e, "_debugStack", {
131
+ configurable: !1,
132
+ enumerable: !1,
133
+ writable: !0,
134
+ value: i
135
+ }), Object.defineProperty(e, "_debugTask", {
136
+ configurable: !1,
137
+ enumerable: !1,
138
+ writable: !0,
139
+ value: a
140
+ }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
141
+ }
142
+ function f(e, n, i, o, l, u) {
143
+ var f = n.children;
144
+ if (f !== void 0) if (o) if (M(f)) {
145
+ for (o = 0; o < f.length; o++) p(f[o]);
146
+ Object.freeze && Object.freeze(f);
147
+ } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
148
+ else p(f);
149
+ if (j.call(n, "key")) {
150
+ f = t(e);
151
+ var m = Object.keys(n).filter(function(e) {
152
+ return e !== "key";
153
+ });
154
+ o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", R[f + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, f, m, f), R[f + o] = !0);
155
+ }
156
+ if (f = null, i !== void 0 && (r(i), f = "" + i), s(n) && (r(n.key), f = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
157
+ else i = n;
158
+ return f && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), d(e, f, i, a(), l, u);
159
+ }
160
+ function p(e) {
161
+ m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === D && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
162
+ }
163
+ function m(e) {
164
+ return typeof e == "object" && !!e && e.$$typeof === g;
165
+ }
166
+ var h = l("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), A = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, M = Array.isArray, N = console.createTask ? console.createTask : function() {
167
+ return null;
168
+ };
169
+ h = { react_stack_bottom_frame: function(e) {
170
+ return e();
171
+ } };
172
+ var P, F = {}, I = h.react_stack_bottom_frame.bind(h, o)(), L = N(i(o)), R = {};
173
+ e.Fragment = v, e.jsx = function(e, t, n) {
174
+ var r = 1e4 > A.recentlyCreatedOwnerStacks++;
175
+ return f(e, t, n, !1, r ? Error("react-stack-top-frame") : I, r ? N(i(e)) : L);
176
+ }, e.jsxs = function(e, t, n) {
177
+ var r = 1e4 > A.recentlyCreatedOwnerStacks++;
178
+ return f(e, t, n, !0, r ? Error("react-stack-top-frame") : I, r ? N(i(e)) : L);
179
+ };
180
+ })();
181
+ })), f = (/* @__PURE__ */ c(((e, t) => {
182
+ process.env.NODE_ENV === "production" ? t.exports = u() : t.exports = d();
183
+ })))(), p = 800, m = 600;
184
+ function h(e, t) {
185
+ return e.length <= t ? e : e.slice(0, t - 3) + "...";
36
186
  }
37
- var x = {};
38
- /**
39
- * @license React
40
- * react-jsx-runtime.development.js
41
- *
42
- * Copyright (c) Meta Platforms, Inc. and affiliates.
43
- *
44
- * This source code is licensed under the MIT license found in the
45
- * LICENSE file in the root directory of this source tree.
46
- */
47
- var F;
48
- function le() {
49
- return F || (F = 1, process.env.NODE_ENV !== "production" && (function() {
50
- function a(e) {
51
- if (e == null) return null;
52
- if (typeof e == "function")
53
- return e.$$typeof === Z ? null : e.displayName || e.name || null;
54
- if (typeof e == "string") return e;
55
- switch (e) {
56
- case b:
57
- return "Fragment";
58
- case V:
59
- return "Profiler";
60
- case L:
61
- return "StrictMode";
62
- case J:
63
- return "Suspense";
64
- case G:
65
- return "SuspenseList";
66
- case H:
67
- return "Activity";
68
- }
69
- if (typeof e == "object")
70
- switch (typeof e.tag == "number" && console.error(
71
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
72
- ), e.$$typeof) {
73
- case z:
74
- return "Portal";
75
- case U:
76
- return e.displayName || "Context";
77
- case B:
78
- return (e._context.displayName || "Context") + ".Consumer";
79
- case q:
80
- var t = e.render;
81
- return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
82
- case X:
83
- return t = e.displayName || null, t !== null ? t : a(e.type) || "Memo";
84
- case T:
85
- t = e._payload, e = e._init;
86
- try {
87
- return a(e(t));
88
- } catch {
89
- }
90
- }
91
- return null;
92
- }
93
- function i(e) {
94
- return "" + e;
95
- }
96
- function u(e) {
97
- try {
98
- i(e);
99
- var t = !1;
100
- } catch {
101
- t = !0;
102
- }
103
- if (t) {
104
- t = console;
105
- var n = t.error, s = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
106
- return n.call(
107
- t,
108
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
- s
110
- ), i(e);
111
- }
112
- }
113
- function d(e) {
114
- if (e === b) return "<>";
115
- if (typeof e == "object" && e !== null && e.$$typeof === T)
116
- return "<...>";
117
- try {
118
- var t = a(e);
119
- return t ? "<" + t + ">" : "<...>";
120
- } catch {
121
- return "<...>";
122
- }
123
- }
124
- function c() {
125
- var e = R.A;
126
- return e === null ? null : e.getOwner();
127
- }
128
- function r() {
129
- return Error("react-stack-top-frame");
130
- }
131
- function m(e) {
132
- if (A.call(e, "key")) {
133
- var t = Object.getOwnPropertyDescriptor(e, "key").get;
134
- if (t && t.isReactWarning) return !1;
135
- }
136
- return e.key !== void 0;
137
- }
138
- function p(e, t) {
139
- function n() {
140
- S || (S = !0, console.error(
141
- "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
142
- t
143
- ));
144
- }
145
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
146
- get: n,
147
- configurable: !0
148
- });
149
- }
150
- function M() {
151
- var e = a(this.type);
152
- return P[e] || (P[e] = !0, console.error(
153
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
154
- )), e = this.props.ref, e !== void 0 ? e : null;
155
- }
156
- function W(e, t, n, s, _, j) {
157
- var l = n.ref;
158
- return e = {
159
- $$typeof: O,
160
- type: e,
161
- key: t,
162
- props: n,
163
- _owner: s
164
- }, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
165
- enumerable: !1,
166
- get: M
167
- }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
168
- configurable: !1,
169
- enumerable: !1,
170
- writable: !0,
171
- value: 0
172
- }), Object.defineProperty(e, "_debugInfo", {
173
- configurable: !1,
174
- enumerable: !1,
175
- writable: !0,
176
- value: null
177
- }), Object.defineProperty(e, "_debugStack", {
178
- configurable: !1,
179
- enumerable: !1,
180
- writable: !0,
181
- value: _
182
- }), Object.defineProperty(e, "_debugTask", {
183
- configurable: !1,
184
- enumerable: !1,
185
- writable: !0,
186
- value: j
187
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
188
- }
189
- function k(e, t, n, s, _, j) {
190
- var l = t.children;
191
- if (l !== void 0)
192
- if (s)
193
- if (Q(l)) {
194
- for (s = 0; s < l.length; s++)
195
- y(l[s]);
196
- Object.freeze && Object.freeze(l);
197
- } else
198
- console.error(
199
- "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
200
- );
201
- else y(l);
202
- if (A.call(t, "key")) {
203
- l = a(e);
204
- var f = Object.keys(t).filter(function(K) {
205
- return K !== "key";
206
- });
207
- s = 0 < f.length ? "{key: someKey, " + f.join(": ..., ") + ": ...}" : "{key: someKey}", I[l + s] || (f = 0 < f.length ? "{" + f.join(": ..., ") + ": ...}" : "{}", console.error(
208
- `A props object containing a "key" prop is being spread into JSX:
209
- let props = %s;
210
- <%s {...props} />
211
- React keys must be passed directly to JSX without using spread:
212
- let props = %s;
213
- <%s key={someKey} {...props} />`,
214
- s,
215
- l,
216
- f,
217
- l
218
- ), I[l + s] = !0);
219
- }
220
- if (l = null, n !== void 0 && (u(n), l = "" + n), m(t) && (u(t.key), l = "" + t.key), "key" in t) {
221
- n = {};
222
- for (var w in t)
223
- w !== "key" && (n[w] = t[w]);
224
- } else n = t;
225
- return l && p(
226
- n,
227
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
228
- ), W(
229
- e,
230
- l,
231
- n,
232
- c(),
233
- _,
234
- j
235
- );
236
- }
237
- function y(e) {
238
- N(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === T && (e._payload.status === "fulfilled" ? N(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
239
- }
240
- function N(e) {
241
- return typeof e == "object" && e !== null && e.$$typeof === O;
242
- }
243
- var E = ne, O = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), L = Symbol.for("react.strict_mode"), V = Symbol.for("react.profiler"), B = Symbol.for("react.consumer"), U = Symbol.for("react.context"), q = Symbol.for("react.forward_ref"), J = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), X = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), R = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, Q = Array.isArray, g = console.createTask ? console.createTask : function() {
244
- return null;
245
- };
246
- E = {
247
- react_stack_bottom_frame: function(e) {
248
- return e();
249
- }
250
- };
251
- var S, P = {}, C = E.react_stack_bottom_frame.bind(
252
- E,
253
- r
254
- )(), $ = g(d(r)), I = {};
255
- x.Fragment = b, x.jsx = function(e, t, n) {
256
- var s = 1e4 > R.recentlyCreatedOwnerStacks++;
257
- return k(
258
- e,
259
- t,
260
- n,
261
- !1,
262
- s ? Error("react-stack-top-frame") : C,
263
- s ? g(d(e)) : $
264
- );
265
- }, x.jsxs = function(e, t, n) {
266
- var s = 1e4 > R.recentlyCreatedOwnerStacks++;
267
- return k(
268
- e,
269
- t,
270
- n,
271
- !0,
272
- s ? Error("react-stack-top-frame") : C,
273
- s ? g(d(e)) : $
274
- );
275
- };
276
- })()), x;
187
+ function g({ selectedResult: e, sendTextMessage: t }) {
188
+ let [n, r] = s(null);
189
+ o(() => {
190
+ e?.toolName === "createMoodBoard" && e.data && r(e.data);
191
+ }, [e]);
192
+ let i = (e) => {
193
+ t && (e.type === "color" ? t(`Add more elements that complement the color ${e.content}`) : e.type === "text" ? t(`Expand on the concept "${e.content}" - add related moods and colors`) : e.type === "emoji" && t(`Add more elements that match the mood of ${e.content}`));
194
+ };
195
+ return n ? /* @__PURE__ */ (0, f.jsx)("div", {
196
+ className: "size-full overflow-hidden",
197
+ style: { backgroundColor: n.backgroundColor || "#F9FAFB" },
198
+ children: /* @__PURE__ */ (0, f.jsxs)("div", {
199
+ className: "size-full relative",
200
+ children: [
201
+ /* @__PURE__ */ (0, f.jsxs)("div", {
202
+ className: "absolute top-4 left-4 z-10",
203
+ children: [/* @__PURE__ */ (0, f.jsx)("h2", {
204
+ className: "text-xl font-bold text-gray-800 bg-white/80 px-3 py-1 rounded-lg shadow",
205
+ children: n.title
206
+ }), n.theme && /* @__PURE__ */ (0, f.jsx)("span", {
207
+ className: "text-xs text-gray-500 bg-white/60 px-2 py-0.5 rounded mt-1 inline-block",
208
+ children: n.theme
209
+ })]
210
+ }),
211
+ /* @__PURE__ */ (0, f.jsx)("svg", {
212
+ className: "size-full",
213
+ viewBox: `0 0 ${p} ${m}`,
214
+ preserveAspectRatio: "xMidYMid meet",
215
+ children: /* @__PURE__ */ (0, f.jsx)("g", {
216
+ className: "items",
217
+ children: n.items.map((e) => /* @__PURE__ */ (0, f.jsxs)("g", {
218
+ transform: `translate(${e.x}, ${e.y}) rotate(${e.rotation || 0})`,
219
+ className: "cursor-pointer transition-transform duration-200 hover:scale-110",
220
+ onClick: () => i(e),
221
+ children: [
222
+ e.type === "color" && /* @__PURE__ */ (0, f.jsx)("rect", {
223
+ x: -e.width / 2,
224
+ y: -e.height / 2,
225
+ width: e.width,
226
+ height: e.height,
227
+ fill: e.content,
228
+ rx: 8,
229
+ className: "drop-shadow-lg",
230
+ stroke: "white",
231
+ strokeWidth: 3
232
+ }),
233
+ e.type === "emoji" && /* @__PURE__ */ (0, f.jsx)("text", {
234
+ textAnchor: "middle",
235
+ dominantBaseline: "middle",
236
+ className: "select-none pointer-events-none",
237
+ style: { fontSize: `${e.width}px` },
238
+ children: e.content
239
+ }),
240
+ e.type === "text" && /* @__PURE__ */ (0, f.jsxs)(f.Fragment, { children: [/* @__PURE__ */ (0, f.jsx)("rect", {
241
+ x: -e.width / 2,
242
+ y: -e.height / 2,
243
+ width: e.width,
244
+ height: e.height,
245
+ fill: "white",
246
+ rx: 4,
247
+ className: "drop-shadow-md"
248
+ }), /* @__PURE__ */ (0, f.jsx)("text", {
249
+ textAnchor: "middle",
250
+ dominantBaseline: "middle",
251
+ fill: "#374151",
252
+ className: "text-sm font-medium select-none pointer-events-none",
253
+ children: h(e.content, 15)
254
+ })] })
255
+ ]
256
+ }, e.id))
257
+ })
258
+ }),
259
+ /* @__PURE__ */ (0, f.jsx)("div", {
260
+ className: "absolute bottom-4 left-4 right-4 text-center",
261
+ children: /* @__PURE__ */ (0, f.jsx)("p", {
262
+ className: "text-sm text-gray-500 bg-white/80 px-3 py-2 rounded-lg inline-block",
263
+ children: "Click an item to explore related concepts"
264
+ })
265
+ })
266
+ ]
267
+ })
268
+ }) : /* @__PURE__ */ (0, f.jsx)("div", {
269
+ className: "size-full flex items-center justify-center",
270
+ children: /* @__PURE__ */ (0, f.jsx)("p", {
271
+ className: "text-gray-400",
272
+ children: "No mood board data"
273
+ })
274
+ });
277
275
  }
278
- var D;
279
- function ie() {
280
- return D || (D = 1, process.env.NODE_ENV === "production" ? v.exports = se() : v.exports = le()), v.exports;
276
+ //#endregion
277
+ //#region src/react/Preview.tsx
278
+ function _({ result: e }) {
279
+ let t = e.data;
280
+ if (!t) return null;
281
+ let n = t.title || "Mood Board", r = t.items?.length || 0;
282
+ return /* @__PURE__ */ (0, f.jsxs)("div", {
283
+ className: "p-3 bg-gradient-to-br from-purple-50 to-pink-50 rounded-lg text-center",
284
+ children: [
285
+ /* @__PURE__ */ (0, f.jsx)("div", {
286
+ className: "text-2xl mb-1",
287
+ children: "🎨"
288
+ }),
289
+ /* @__PURE__ */ (0, f.jsx)("div", {
290
+ className: "text-purple-700 font-medium text-sm truncate",
291
+ children: n
292
+ }),
293
+ /* @__PURE__ */ (0, f.jsxs)("div", {
294
+ className: "text-xs text-gray-500 mt-1",
295
+ children: [r, " elements"]
296
+ })
297
+ ]
298
+ });
281
299
  }
282
- var o = ie();
283
- const ce = 800, ue = 600;
284
- function de(a, i) {
285
- return a.length <= i ? a : a.slice(0, i - 3) + "...";
286
- }
287
- function fe({ selectedResult: a, sendTextMessage: i }) {
288
- const [u, d] = oe(null);
289
- ae(() => {
290
- (a == null ? void 0 : a.toolName) === ee && a.data && d(a.data);
291
- }, [a]);
292
- const c = (r) => {
293
- i && (r.type === "color" ? i(
294
- `Add more elements that complement the color ${r.content}`
295
- ) : r.type === "text" ? i(
296
- `Expand on the concept "${r.content}" - add related moods and colors`
297
- ) : r.type === "emoji" && i(
298
- `Add more elements that match the mood of ${r.content}`
299
- ));
300
- };
301
- return u ? /* @__PURE__ */ o.jsx(
302
- "div",
303
- {
304
- className: "size-full overflow-hidden",
305
- style: { backgroundColor: u.backgroundColor || "#F9FAFB" },
306
- children: /* @__PURE__ */ o.jsxs("div", { className: "size-full relative", children: [
307
- /* @__PURE__ */ o.jsxs("div", { className: "absolute top-4 left-4 z-10", children: [
308
- /* @__PURE__ */ o.jsx("h2", { className: "text-xl font-bold text-gray-800 bg-white/80 px-3 py-1 rounded-lg shadow", children: u.title }),
309
- u.theme && /* @__PURE__ */ o.jsx("span", { className: "text-xs text-gray-500 bg-white/60 px-2 py-0.5 rounded mt-1 inline-block", children: u.theme })
310
- ] }),
311
- /* @__PURE__ */ o.jsx(
312
- "svg",
313
- {
314
- className: "size-full",
315
- viewBox: `0 0 ${ce} ${ue}`,
316
- preserveAspectRatio: "xMidYMid meet",
317
- children: /* @__PURE__ */ o.jsx("g", { className: "items", children: u.items.map((r) => /* @__PURE__ */ o.jsxs(
318
- "g",
319
- {
320
- transform: `translate(${r.x}, ${r.y}) rotate(${r.rotation || 0})`,
321
- className: "cursor-pointer transition-transform duration-200 hover:scale-110",
322
- onClick: () => c(r),
323
- children: [
324
- r.type === "color" && /* @__PURE__ */ o.jsx(
325
- "rect",
326
- {
327
- x: -r.width / 2,
328
- y: -r.height / 2,
329
- width: r.width,
330
- height: r.height,
331
- fill: r.content,
332
- rx: 8,
333
- className: "drop-shadow-lg",
334
- stroke: "white",
335
- strokeWidth: 3
336
- }
337
- ),
338
- r.type === "emoji" && /* @__PURE__ */ o.jsx(
339
- "text",
340
- {
341
- textAnchor: "middle",
342
- dominantBaseline: "middle",
343
- className: "select-none pointer-events-none",
344
- style: { fontSize: `${r.width}px` },
345
- children: r.content
346
- }
347
- ),
348
- r.type === "text" && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
349
- /* @__PURE__ */ o.jsx(
350
- "rect",
351
- {
352
- x: -r.width / 2,
353
- y: -r.height / 2,
354
- width: r.width,
355
- height: r.height,
356
- fill: "white",
357
- rx: 4,
358
- className: "drop-shadow-md"
359
- }
360
- ),
361
- /* @__PURE__ */ o.jsx(
362
- "text",
363
- {
364
- textAnchor: "middle",
365
- dominantBaseline: "middle",
366
- fill: "#374151",
367
- className: "text-sm font-medium select-none pointer-events-none",
368
- children: de(r.content, 15)
369
- }
370
- )
371
- ] })
372
- ]
373
- },
374
- r.id
375
- )) })
376
- }
377
- ),
378
- /* @__PURE__ */ o.jsx("div", { className: "absolute bottom-4 left-4 right-4 text-center", children: /* @__PURE__ */ o.jsx("p", { className: "text-sm text-gray-500 bg-white/80 px-3 py-2 rounded-lg inline-block", children: "Click an item to explore related concepts" }) })
379
- ] })
380
- }
381
- ) : /* @__PURE__ */ o.jsx("div", { className: "size-full flex items-center justify-center", children: /* @__PURE__ */ o.jsx("p", { className: "text-gray-400", children: "No mood board data" }) });
382
- }
383
- function me({ result: a }) {
384
- var c;
385
- const i = a.data;
386
- if (!i)
387
- return null;
388
- const u = i.title || "Mood Board", d = ((c = i.items) == null ? void 0 : c.length) || 0;
389
- return /* @__PURE__ */ o.jsxs("div", { className: "p-3 bg-gradient-to-br from-purple-50 to-pink-50 rounded-lg text-center", children: [
390
- /* @__PURE__ */ o.jsx("div", { className: "text-2xl mb-1", children: "🎨" }),
391
- /* @__PURE__ */ o.jsx("div", { className: "text-purple-700 font-medium text-sm truncate", children: u }),
392
- /* @__PURE__ */ o.jsxs("div", { className: "text-xs text-gray-500 mt-1", children: [
393
- d,
394
- " elements"
395
- ] })
396
- ] });
397
- }
398
- const pe = {
399
- ...te,
400
- ViewComponent: fe,
401
- PreviewComponent: me,
402
- samples: re
403
- }, _e = { plugin: pe };
404
- export {
405
- me as Preview,
406
- Te as SYSTEM_PROMPT,
407
- Re as TOOL_DEFINITION,
408
- ee as TOOL_NAME,
409
- fe as View,
410
- _e as default,
411
- ge as executeMoodBoard,
412
- pe as plugin,
413
- te as pluginCore,
414
- re as samples
415
- };
300
+ //#endregion
301
+ //#region src/react/index.ts
302
+ var v = {
303
+ ...i,
304
+ ViewComponent: g,
305
+ PreviewComponent: _,
306
+ samples: a
307
+ }, y = { plugin: v };
308
+ //#endregion
309
+ export { _ as Preview, t as SYSTEM_PROMPT, e as TOOL_DEFINITION, r as TOOL_NAME, g as View, y as default, n as executeMoodBoard, v as plugin, i as pluginCore, a as samples };