@gui-chat-plugin/edit-html 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/core.cjs +1 -3
- package/dist/core.js +2 -83
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -10
- package/dist/plugin-D2zLuVfr.cjs +3 -0
- package/dist/plugin-JwcwFlt2.js +70 -0
- package/dist/style.css +3 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +64 -91
- package/package.json +17 -16
package/dist/core.cjs
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
no HTML data`,e),{message:e.error||"HTML editing failed",instructions:"Acknowledge that the HTML editing failed."})}catch(e){return console.error(`ERR: exception
|
|
3
|
-
HTML editing failed`,e),{message:"HTML editing failed",jsonData:e,instructions:"Acknowledge that the HTML editing failed."}}},g={toolDefinition:s,execute:d,generatingMessage:"Editing HTML...",isEnabled:t=>!!t?.hasAnthropicApiKey||!!t?.hasGoogleApiKey,systemPrompt:o,backends:["textLLM"]};exports.HTML_LIBRARIES=l;exports.LIBRARY_DESCRIPTIONS=u;exports.SYSTEM_PROMPT=o;exports.TOOL_DEFINITION=s;exports.TOOL_NAME=r;exports.executeEditHtml=d;exports.pluginCore=g;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./plugin-D2zLuVfr.cjs`);exports.HTML_LIBRARIES=e.o,exports.LIBRARY_DESCRIPTIONS=e.s,exports.SYSTEM_PROMPT=e.r,exports.TOOL_DEFINITION=e.i,exports.TOOL_NAME=e.a,exports.executeEditHtml=e.t,exports.pluginCore=e.n;
|
package/dist/core.js
CHANGED
|
@@ -1,83 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
"d3.js",
|
|
4
|
-
"three.js",
|
|
5
|
-
"p5.js",
|
|
6
|
-
"mermaid"
|
|
7
|
-
], p = {
|
|
8
|
-
tailwind: "Tailwind CSS for utility-first styling",
|
|
9
|
-
"d3.js": "D3.js for data-driven visualizations and interactive charts",
|
|
10
|
-
"three.js": "Three.js for 3D graphics and WebGL rendering",
|
|
11
|
-
"p5.js": "p5.js for creative coding, animations, and generative art",
|
|
12
|
-
mermaid: "Mermaid for diagrams and flowcharts from text definitions"
|
|
13
|
-
}, s = "editHtml", o = {
|
|
14
|
-
type: "function",
|
|
15
|
-
name: s,
|
|
16
|
-
description: "Edit the currently selected HTML page by sending a detailed modification prompt to another LLM (Claude). This tool modifies the existing HTML based on your description while preserving the existing structure and functionality where possible.",
|
|
17
|
-
parameters: {
|
|
18
|
-
type: "object",
|
|
19
|
-
properties: {
|
|
20
|
-
prompt: {
|
|
21
|
-
type: "string",
|
|
22
|
-
description: "Detailed description of the modifications to make to the HTML page. Be specific about what changes are needed - layout adjustments, style updates, new functionality, content changes, etc. The more detailed your prompt, the better the modifications will match your requirements."
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
required: ["prompt"]
|
|
26
|
-
}
|
|
27
|
-
}, d = "", c = async (t, r) => {
|
|
28
|
-
const { prompt: i } = r, n = t.currentResult?.data, a = n?.html;
|
|
29
|
-
if (!a)
|
|
30
|
-
return {
|
|
31
|
-
message: "No HTML page is currently selected to edit",
|
|
32
|
-
instructions: "Tell the user that they need to select an HTML page first before editing it."
|
|
33
|
-
};
|
|
34
|
-
if (!t.app?.generateHtml)
|
|
35
|
-
return {
|
|
36
|
-
message: "generateHtml function not available",
|
|
37
|
-
instructions: "Acknowledge that the HTML editing failed."
|
|
38
|
-
};
|
|
39
|
-
try {
|
|
40
|
-
const e = await t.app.generateHtml({
|
|
41
|
-
prompt: i,
|
|
42
|
-
html: a
|
|
43
|
-
});
|
|
44
|
-
return e.success && e.html ? {
|
|
45
|
-
data: {
|
|
46
|
-
html: e.html,
|
|
47
|
-
type: n?.type || "tailwind"
|
|
48
|
-
},
|
|
49
|
-
title: i.slice(0, 50),
|
|
50
|
-
message: "HTML editing succeeded",
|
|
51
|
-
instructions: "Acknowledge that the HTML was modified and has been already presented to the user.",
|
|
52
|
-
updating: !0
|
|
53
|
-
// Update the existing result instead of creating a new one
|
|
54
|
-
} : (console.error(`ERR:1
|
|
55
|
-
no HTML data`, e), {
|
|
56
|
-
message: e.error || "HTML editing failed",
|
|
57
|
-
instructions: "Acknowledge that the HTML editing failed."
|
|
58
|
-
});
|
|
59
|
-
} catch (e) {
|
|
60
|
-
return console.error(`ERR: exception
|
|
61
|
-
HTML editing failed`, e), {
|
|
62
|
-
message: "HTML editing failed",
|
|
63
|
-
jsonData: e,
|
|
64
|
-
instructions: "Acknowledge that the HTML editing failed."
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}, g = {
|
|
68
|
-
toolDefinition: o,
|
|
69
|
-
execute: c,
|
|
70
|
-
generatingMessage: "Editing HTML...",
|
|
71
|
-
isEnabled: (t) => !!t?.hasAnthropicApiKey || !!t?.hasGoogleApiKey,
|
|
72
|
-
systemPrompt: d,
|
|
73
|
-
backends: ["textLLM"]
|
|
74
|
-
};
|
|
75
|
-
export {
|
|
76
|
-
l as HTML_LIBRARIES,
|
|
77
|
-
p as LIBRARY_DESCRIPTIONS,
|
|
78
|
-
d as SYSTEM_PROMPT,
|
|
79
|
-
o as TOOL_DEFINITION,
|
|
80
|
-
s as TOOL_NAME,
|
|
81
|
-
c as executeEditHtml,
|
|
82
|
-
g as pluginCore
|
|
83
|
-
};
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./plugin-JwcwFlt2.js";
|
|
2
|
+
export { r as HTML_LIBRARIES, a as LIBRARY_DESCRIPTIONS, i as SYSTEM_PROMPT, t as TOOL_DEFINITION, e as TOOL_NAME, o as executeEditHtml, n as pluginCore };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./plugin-D2zLuVfr.cjs`);require(`./core.cjs`),exports.HTML_LIBRARIES=e.o,exports.LIBRARY_DESCRIPTIONS=e.s,exports.SYSTEM_PROMPT=e.r,exports.TOOL_DEFINITION=e.i,exports.TOOL_NAME=e.a,exports.executeEditHtml=e.t,exports.pluginCore=e.n;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
E as LIBRARY_DESCRIPTIONS,
|
|
5
|
-
R as SYSTEM_PROMPT,
|
|
6
|
-
e as TOOL_DEFINITION,
|
|
7
|
-
L as TOOL_NAME,
|
|
8
|
-
S as executeEditHtml,
|
|
9
|
-
_ as pluginCore
|
|
10
|
-
};
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./plugin-JwcwFlt2.js";
|
|
2
|
+
import "./core.js";
|
|
3
|
+
export { r as HTML_LIBRARIES, a as LIBRARY_DESCRIPTIONS, i as SYSTEM_PROMPT, t as TOOL_DEFINITION, e as TOOL_NAME, o as executeEditHtml, n as pluginCore };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var e=[`tailwind`,`d3.js`,`three.js`,`p5.js`,`mermaid`],t={tailwind:`Tailwind CSS for utility-first styling`,"d3.js":`D3.js for data-driven visualizations and interactive charts`,"three.js":`Three.js for 3D graphics and WebGL rendering`,"p5.js":`p5.js for creative coding, animations, and generative art`,mermaid:`Mermaid for diagrams and flowcharts from text definitions`},n=`editHtml`,r={type:`function`,name:n,description:`Edit the currently selected HTML page by sending a detailed modification prompt to another LLM (Claude). This tool modifies the existing HTML based on your description while preserving the existing structure and functionality where possible.`,parameters:{type:`object`,properties:{prompt:{type:`string`,description:`Detailed description of the modifications to make to the HTML page. Be specific about what changes are needed - layout adjustments, style updates, new functionality, content changes, etc. The more detailed your prompt, the better the modifications will match your requirements.`}},required:[`prompt`]}},i=``,a=async(e,t)=>{let{prompt:n}=t,r=e.currentResult?.data,i=r?.html;if(!i)return{message:`No HTML page is currently selected to edit`,instructions:`Tell the user that they need to select an HTML page first before editing it.`};if(!e.app?.generateHtml)return{message:`generateHtml function not available`,instructions:`Acknowledge that the HTML editing failed.`};try{let t=await e.app.generateHtml({prompt:n,html:i});return t.success&&t.html?{data:{html:t.html,type:r?.type||`tailwind`},title:n.slice(0,50),message:`HTML editing succeeded`,instructions:`Acknowledge that the HTML was modified and has been already presented to the user.`,updating:!0}:(console.error(`ERR:1
|
|
2
|
+
no HTML data`,t),{message:t.error||`HTML editing failed`,instructions:`Acknowledge that the HTML editing failed.`})}catch(e){return console.error(`ERR: exception
|
|
3
|
+
HTML editing failed`,e),{message:`HTML editing failed`,jsonData:e,instructions:`Acknowledge that the HTML editing failed.`}}},o={toolDefinition:r,execute:a,generatingMessage:`Editing HTML...`,isEnabled:e=>!!e?.hasAnthropicApiKey||!!e?.hasGoogleApiKey,systemPrompt:``,backends:[`textLLM`]};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region src/core/types.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"tailwind",
|
|
4
|
+
"d3.js",
|
|
5
|
+
"three.js",
|
|
6
|
+
"p5.js",
|
|
7
|
+
"mermaid"
|
|
8
|
+
], t = {
|
|
9
|
+
tailwind: "Tailwind CSS for utility-first styling",
|
|
10
|
+
"d3.js": "D3.js for data-driven visualizations and interactive charts",
|
|
11
|
+
"three.js": "Three.js for 3D graphics and WebGL rendering",
|
|
12
|
+
"p5.js": "p5.js for creative coding, animations, and generative art",
|
|
13
|
+
mermaid: "Mermaid for diagrams and flowcharts from text definitions"
|
|
14
|
+
}, n = "editHtml", r = {
|
|
15
|
+
type: "function",
|
|
16
|
+
name: n,
|
|
17
|
+
description: "Edit the currently selected HTML page by sending a detailed modification prompt to another LLM (Claude). This tool modifies the existing HTML based on your description while preserving the existing structure and functionality where possible.",
|
|
18
|
+
parameters: {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: { prompt: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Detailed description of the modifications to make to the HTML page. Be specific about what changes are needed - layout adjustments, style updates, new functionality, content changes, etc. The more detailed your prompt, the better the modifications will match your requirements."
|
|
23
|
+
} },
|
|
24
|
+
required: ["prompt"]
|
|
25
|
+
}
|
|
26
|
+
}, i = "", a = async (e, t) => {
|
|
27
|
+
let { prompt: n } = t, r = e.currentResult?.data, i = r?.html;
|
|
28
|
+
if (!i) return {
|
|
29
|
+
message: "No HTML page is currently selected to edit",
|
|
30
|
+
instructions: "Tell the user that they need to select an HTML page first before editing it."
|
|
31
|
+
};
|
|
32
|
+
if (!e.app?.generateHtml) return {
|
|
33
|
+
message: "generateHtml function not available",
|
|
34
|
+
instructions: "Acknowledge that the HTML editing failed."
|
|
35
|
+
};
|
|
36
|
+
try {
|
|
37
|
+
let t = await e.app.generateHtml({
|
|
38
|
+
prompt: n,
|
|
39
|
+
html: i
|
|
40
|
+
});
|
|
41
|
+
return t.success && t.html ? {
|
|
42
|
+
data: {
|
|
43
|
+
html: t.html,
|
|
44
|
+
type: r?.type || "tailwind"
|
|
45
|
+
},
|
|
46
|
+
title: n.slice(0, 50),
|
|
47
|
+
message: "HTML editing succeeded",
|
|
48
|
+
instructions: "Acknowledge that the HTML was modified and has been already presented to the user.",
|
|
49
|
+
updating: !0
|
|
50
|
+
} : (console.error("ERR:1\n no HTML data", t), {
|
|
51
|
+
message: t.error || "HTML editing failed",
|
|
52
|
+
instructions: "Acknowledge that the HTML editing failed."
|
|
53
|
+
});
|
|
54
|
+
} catch (e) {
|
|
55
|
+
return console.error("ERR: exception\n HTML editing failed", e), {
|
|
56
|
+
message: "HTML editing failed",
|
|
57
|
+
jsonData: e,
|
|
58
|
+
instructions: "Acknowledge that the HTML editing failed."
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}, o = {
|
|
62
|
+
toolDefinition: r,
|
|
63
|
+
execute: a,
|
|
64
|
+
generatingMessage: "Editing HTML...",
|
|
65
|
+
isEnabled: (e) => !!e?.hasAnthropicApiKey || !!e?.hasGoogleApiKey,
|
|
66
|
+
systemPrompt: "",
|
|
67
|
+
backends: ["textLLM"]
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
export { n as a, r as i, o as n, e as o, i as r, t as s, a as t };
|
package/dist/style.css
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-blue-50:oklch(97% .014 254.604);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-900:oklch(37.9% .146 265.522);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-white:#fff;--spacing:.25rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.mt-1{margin-top:calc(var(--spacing) * 1)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.contents{display:contents}.flex{display:flex}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.flex-1{flex:1}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing) * 2)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.border-0{border-style:var(--tw-border-style);border-width:0}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-gray-200{border-color:var(--color-gray-200)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-white{background-color:var(--color-white)}.p-4{padding:calc(var(--spacing) * 4)}.p-8{padding:calc(var(--spacing) * 8)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-blue-600{color:var(--color-blue-600)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-white{color:var(--color-white)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (hover:hover){.hover\:bg-blue-600:hover{background-color:var(--color-blue-600)}}@media (prefers-color-scheme:dark){.dark\:bg-blue-900{background-color:var(--color-blue-900)}.dark\:bg-gray-800{background-color:var(--color-gray-800)}.dark\:bg-gray-900{background-color:var(--color-gray-900)}.dark\:text-blue-300{color:var(--color-blue-300)}.dark\:text-gray-200{color:var(--color-gray-200)}.dark\:text-gray-400{color:var(--color-gray-400)}.dark\:text-white{color:var(--color-white)}}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
|
|
3
|
+
/*$vite$:1*/
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./plugin-D2zLuVfr.cjs`);let t=require(`vue`);var n={class:`w-full h-full overflow-hidden bg-white flex flex-col`},r={key:0,class:`flex-1 flex items-center justify-center`},i={class:`flex items-center justify-between px-4 py-3 border-b border-gray-200 bg-gray-50`},a={class:`text-xl font-semibold text-gray-800`},o=[`srcdoc`],s=(0,t.defineComponent)({__name:`View`,props:{selectedResult:{}},setup(e){let s=e,c=()=>{console.log(`HTML iframe loaded successfully`)},l=()=>{let e=s.selectedResult.data?.html;if(!e)return;let t=new Blob([e],{type:`text/html`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=s.selectedResult.title?`${s.selectedResult.title.replace(/[^a-z0-9]/gi,`_`).toLowerCase()}.html`:`page.html`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)};return(s,u)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,n,[e.selectedResult.data?.html?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,i,[(0,t.createElementVNode)(`h1`,a,(0,t.toDisplayString)(e.selectedResult.title||`HTML Page`),1),(0,t.createElementVNode)(`button`,{onClick:l,class:`flex items-center gap-2 px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white rounded text-sm transition-colors`},` ⬇ HTML `)]),(0,t.createElementVNode)(`iframe`,{srcdoc:e.selectedResult.data.html,class:`flex-1 w-full border-0`,sandbox:`allow-scripts allow-same-origin`,onLoad:c},null,40,o)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,r,[...u[0]||=[(0,t.createElementVNode)(`div`,{class:`text-gray-500`},`No HTML content available`,-1)]]))]))}}),c={class:`text-center p-4 bg-blue-50 dark:bg-blue-900 rounded`},l={class:`text-blue-600 dark:text-blue-300 font-medium`},u={class:`text-sm text-gray-800 dark:text-gray-200 mt-1 font-medium truncate`},d={class:`text-xs text-gray-600 dark:text-gray-400 mt-1`},f=(0,t.defineComponent)({__name:`Preview`,props:{result:{}},setup(e){let n=e,r=(0,t.computed)(()=>n.result.title||`HTML Page`),i=(0,t.computed)(()=>{let e=n.result.data?.type;return e?{tailwind:`Tailwind CSS`,"d3.js":`D3.js`,"three.js":`Three.js`,mermaid:`Mermaid`,"p5.js":`p5.js`}[e]:``}),a=(0,t.computed)(()=>{let e=n.result.data?.type;return e?{tailwind:`🎨`,"d3.js":`📊`,"three.js":`🎮`,mermaid:`📋`,"p5.js":`🎨`}[e]:`🌐`});return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,c,[(0,t.createElementVNode)(`div`,l,(0,t.toDisplayString)(a.value)+` HTML `,1),(0,t.createElementVNode)(`div`,u,(0,t.toDisplayString)(r.value),1),(0,t.createElementVNode)(`div`,d,(0,t.toDisplayString)(i.value),1)]))}}),p={...e.n,viewComponent:s,previewComponent:f},m={plugin:p};exports.HTML_LIBRARIES=e.o,exports.LIBRARY_DESCRIPTIONS=e.s,exports.Preview=f,exports.SYSTEM_PROMPT=e.r,exports.TOOL_DEFINITION=e.i,exports.TOOL_NAME=e.a,exports.View=s,exports.default=m,exports.executeEditHtml=e.t,exports.plugin=p,exports.pluginCore=e.n;
|
package/dist/vue.js
CHANGED
|
@@ -1,91 +1,64 @@
|
|
|
1
|
-
import {
|
|
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
|
-
"p5.js": "🎨"
|
|
66
|
-
}[e] : "🌐";
|
|
67
|
-
});
|
|
68
|
-
return (e, n) => (c(), a("div", L, [
|
|
69
|
-
t("div", R, i(o.value) + " HTML ", 1),
|
|
70
|
-
t("div", T, i(d.value), 1),
|
|
71
|
-
t("div", j, i(u.value), 1)
|
|
72
|
-
]));
|
|
73
|
-
}
|
|
74
|
-
}), M = {
|
|
75
|
-
...x,
|
|
76
|
-
viewComponent: v,
|
|
77
|
-
previewComponent: k
|
|
78
|
-
}, E = { plugin: M };
|
|
79
|
-
export {
|
|
80
|
-
S as HTML_LIBRARIES,
|
|
81
|
-
P as LIBRARY_DESCRIPTIONS,
|
|
82
|
-
k as Preview,
|
|
83
|
-
N as SYSTEM_PROMPT,
|
|
84
|
-
$ as TOOL_DEFINITION,
|
|
85
|
-
B as TOOL_NAME,
|
|
86
|
-
v as View,
|
|
87
|
-
E as default,
|
|
88
|
-
D as executeEditHtml,
|
|
89
|
-
M as plugin,
|
|
90
|
-
x as pluginCore
|
|
91
|
-
};
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./plugin-JwcwFlt2.js";
|
|
2
|
+
import { Fragment as s, computed as c, createElementBlock as l, createElementVNode as u, defineComponent as d, openBlock as f, toDisplayString as p } from "vue";
|
|
3
|
+
//#region src/vue/View.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var m = { class: "w-full h-full overflow-hidden bg-white flex flex-col" }, h = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "flex-1 flex items-center justify-center"
|
|
7
|
+
}, g = { class: "flex items-center justify-between px-4 py-3 border-b border-gray-200 bg-gray-50" }, _ = { class: "text-xl font-semibold text-gray-800" }, v = ["srcdoc"], y = /* @__PURE__ */ d({
|
|
8
|
+
__name: "View",
|
|
9
|
+
props: { selectedResult: {} },
|
|
10
|
+
setup(e) {
|
|
11
|
+
let t = e, n = () => {
|
|
12
|
+
console.log("HTML iframe loaded successfully");
|
|
13
|
+
}, r = () => {
|
|
14
|
+
let e = t.selectedResult.data?.html;
|
|
15
|
+
if (!e) return;
|
|
16
|
+
let n = new Blob([e], { type: "text/html" }), r = URL.createObjectURL(n), i = document.createElement("a");
|
|
17
|
+
i.href = r, i.download = t.selectedResult.title ? `${t.selectedResult.title.replace(/[^a-z0-9]/gi, "_").toLowerCase()}.html` : "page.html", document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
|
|
18
|
+
};
|
|
19
|
+
return (t, i) => (f(), l("div", m, [e.selectedResult.data?.html ? (f(), l(s, { key: 1 }, [u("div", g, [u("h1", _, p(e.selectedResult.title || "HTML Page"), 1), u("button", {
|
|
20
|
+
onClick: r,
|
|
21
|
+
class: "flex items-center gap-2 px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white rounded text-sm transition-colors"
|
|
22
|
+
}, " ⬇ HTML ")]), u("iframe", {
|
|
23
|
+
srcdoc: e.selectedResult.data.html,
|
|
24
|
+
class: "flex-1 w-full border-0",
|
|
25
|
+
sandbox: "allow-scripts allow-same-origin",
|
|
26
|
+
onLoad: n
|
|
27
|
+
}, null, 40, v)], 64)) : (f(), l("div", h, [...i[0] ||= [u("div", { class: "text-gray-500" }, "No HTML content available", -1)]]))]));
|
|
28
|
+
}
|
|
29
|
+
}), b = { class: "text-center p-4 bg-blue-50 dark:bg-blue-900 rounded" }, x = { class: "text-blue-600 dark:text-blue-300 font-medium" }, S = { class: "text-sm text-gray-800 dark:text-gray-200 mt-1 font-medium truncate" }, C = { class: "text-xs text-gray-600 dark:text-gray-400 mt-1" }, w = /* @__PURE__ */ d({
|
|
30
|
+
__name: "Preview",
|
|
31
|
+
props: { result: {} },
|
|
32
|
+
setup(e) {
|
|
33
|
+
let t = e, n = c(() => t.result.title || "HTML Page"), r = c(() => {
|
|
34
|
+
let e = t.result.data?.type;
|
|
35
|
+
return e ? {
|
|
36
|
+
tailwind: "Tailwind CSS",
|
|
37
|
+
"d3.js": "D3.js",
|
|
38
|
+
"three.js": "Three.js",
|
|
39
|
+
mermaid: "Mermaid",
|
|
40
|
+
"p5.js": "p5.js"
|
|
41
|
+
}[e] : "";
|
|
42
|
+
}), i = c(() => {
|
|
43
|
+
let e = t.result.data?.type;
|
|
44
|
+
return e ? {
|
|
45
|
+
tailwind: "🎨",
|
|
46
|
+
"d3.js": "📊",
|
|
47
|
+
"three.js": "🎮",
|
|
48
|
+
mermaid: "📋",
|
|
49
|
+
"p5.js": "🎨"
|
|
50
|
+
}[e] : "🌐";
|
|
51
|
+
});
|
|
52
|
+
return (e, t) => (f(), l("div", b, [
|
|
53
|
+
u("div", x, p(i.value) + " HTML ", 1),
|
|
54
|
+
u("div", S, p(n.value), 1),
|
|
55
|
+
u("div", C, p(r.value), 1)
|
|
56
|
+
]));
|
|
57
|
+
}
|
|
58
|
+
}), T = {
|
|
59
|
+
...n,
|
|
60
|
+
viewComponent: y,
|
|
61
|
+
previewComponent: w
|
|
62
|
+
}, E = { plugin: T };
|
|
63
|
+
//#endregion
|
|
64
|
+
export { r as HTML_LIBRARIES, a as LIBRARY_DESCRIPTIONS, w as Preview, i as SYSTEM_PROMPT, t as TOOL_DEFINITION, e as TOOL_NAME, y as View, E as default, o as executeEditHtml, T as plugin, n as pluginCore };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gui-chat-plugin/edit-html",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Edit HTML plugin for GUIChat",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -34,24 +34,25 @@
|
|
|
34
34
|
"lint": "eslint src demo"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"gui-chat-protocol": "^0.0
|
|
37
|
+
"gui-chat-protocol": "^0.1.0",
|
|
38
38
|
"vue": "^3.5.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@typescript-eslint/
|
|
44
|
-
"@
|
|
45
|
-
"
|
|
46
|
-
"eslint
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"vue
|
|
54
|
-
"vue-
|
|
41
|
+
"@eslint/js": "^10.0.1",
|
|
42
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^8.58.0",
|
|
44
|
+
"@typescript-eslint/parser": "^8.58.0",
|
|
45
|
+
"@vitejs/plugin-vue": "^6.0.5",
|
|
46
|
+
"eslint": "^10.1.0",
|
|
47
|
+
"eslint-plugin-vue": "^10.8.0",
|
|
48
|
+
"globals": "^17.4.0",
|
|
49
|
+
"gui-chat-protocol": "^0.1.0",
|
|
50
|
+
"tailwindcss": "^4.2.2",
|
|
51
|
+
"typescript": "~6.0.2",
|
|
52
|
+
"vite": "^8.0.3",
|
|
53
|
+
"vue": "^3.5.31",
|
|
54
|
+
"vue-eslint-parser": "^10.4.0",
|
|
55
|
+
"vue-tsc": "^3.2.6"
|
|
55
56
|
},
|
|
56
57
|
"keywords": [
|
|
57
58
|
"guichat",
|