@veltra/desktop 1.10.0 → 1.11.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/components/ai-button/ai-button.js +117 -0
- package/dist/components/ai-button/ai-button.js.map +1 -0
- package/dist/components/ai-button/style.d.ts +1 -0
- package/dist/components/ai-button/style.js +3 -0
- package/dist/components/ai-button/style2.css +29 -0
- package/dist/components/code-editor/basic-setup.js +5 -5
- package/dist/components/code-editor/code-editor.js +2 -2
- package/dist/components/code-editor/langs/bash/index.js +2 -2
- package/dist/components/code-editor/langs/powershell/index.js +2 -2
- package/dist/components/code-editor/langs/spel/index.js +1 -1
- package/dist/components/code-editor/langs/spel/language.js +1 -1
- package/dist/components/code-editor/shell-extension.js +2 -2
- package/dist/components/file-viewer/previewers/pdf-worker-wrapper.js.map +1 -1
- package/dist/components/file-viewer/previewers/sheet-previewer.js +5 -5
- package/dist/components/file-viewer/previewers/sheet-previewer.js.map +1 -1
- package/dist/components/file-viewer/style2.css +42 -176
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +3 -1
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +108 -106
- package/dist/index.js +107 -106
- package/dist/node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_commands@6.11.0 → @codemirror_commands@6.11.1}/node_modules/@codemirror/commands/dist/index.js +6 -6
- package/dist/node_modules/.bun/@codemirror_commands@6.11.1/node_modules/@codemirror/commands/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-css@6.3.1/node_modules/@codemirror/lang-css/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-html@6.4.12/node_modules/@codemirror/lang-html/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_lang-html@6.4.12/node_modules/@codemirror/lang-html/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-java@6.0.2/node_modules/@codemirror/lang-java/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_lang-javascript@6.2.5/node_modules/@codemirror/lang-javascript/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-json@6.0.2/node_modules/@codemirror/lang-json/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-markdown@6.5.2/node_modules/@codemirror/lang-markdown/dist/index.js +3 -3
- package/dist/node_modules/.bun/@codemirror_lang-markdown@6.5.2/node_modules/@codemirror/lang-markdown/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js +1 -1
- package/dist/node_modules/.bun/@codemirror_lang-sql@6.10.0/node_modules/@codemirror/lang-sql/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_language@6.12.4 → @codemirror_language@6.13.1}/node_modules/@codemirror/language/dist/index.js +5 -168
- package/dist/node_modules/.bun/@codemirror_language@6.13.1/node_modules/@codemirror/language/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/{@codemirror_legacy-modes@6.5.4 → @codemirror_legacy-modes@6.5.5}/node_modules/@codemirror/legacy-modes/mode/powershell.js +1 -1
- package/dist/node_modules/.bun/{@codemirror_legacy-modes@6.5.4 → @codemirror_legacy-modes@6.5.5}/node_modules/@codemirror/legacy-modes/mode/powershell.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_legacy-modes@6.5.4 → @codemirror_legacy-modes@6.5.5}/node_modules/@codemirror/legacy-modes/mode/shell.js +1 -1
- package/dist/node_modules/.bun/{@codemirror_legacy-modes@6.5.4 → @codemirror_legacy-modes@6.5.5}/node_modules/@codemirror/legacy-modes/mode/shell.js.map +1 -1
- package/dist/node_modules/.bun/@codemirror_lint@6.9.7/node_modules/@codemirror/lint/dist/index.js +2 -2
- package/dist/node_modules/.bun/@codemirror_lint@6.9.7/node_modules/@codemirror/lint/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_search@6.7.1 → @codemirror_search@6.7.2}/node_modules/@codemirror/search/dist/index.js +10 -3
- package/dist/node_modules/.bun/@codemirror_search@6.7.2/node_modules/@codemirror/search/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/{@codemirror_state@6.7.1 → @codemirror_state@6.7.6}/node_modules/@codemirror/state/dist/index.js +50 -16
- package/dist/node_modules/.bun/@codemirror_state@6.7.6/node_modules/@codemirror/state/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/@codemirror_streamparser@6.0.0/node_modules/@codemirror/streamparser/dist/index.js +169 -0
- package/dist/node_modules/.bun/@codemirror_streamparser@6.0.0/node_modules/@codemirror/streamparser/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/@codemirror_theme-one-dark@6.1.3/node_modules/@codemirror/theme-one-dark/dist/index.js +2 -2
- package/dist/node_modules/.bun/@codemirror_theme-one-dark@6.1.3/node_modules/@codemirror/theme-one-dark/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/{@codemirror_view@6.43.9 → @codemirror_view@6.43.14}/node_modules/@codemirror/view/dist/index.js +159 -93
- package/dist/node_modules/.bun/@codemirror_view@6.43.14/node_modules/@codemirror/view/dist/index.js.map +1 -0
- package/dist/node_modules/.bun/@lezer_common@1.5.3/node_modules/@lezer/common/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_css@1.3.9/node_modules/@lezer/css/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_highlight@1.2.5/node_modules/@lezer/highlight/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_html@1.3.13/node_modules/@lezer/html/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_java@1.1.5/node_modules/@lezer/java/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_javascript@1.5.6/node_modules/@lezer/javascript/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_json@1.0.3/node_modules/@lezer/json/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_lr@1.4.11/node_modules/@lezer/lr/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@lezer_markdown@1.8.0/node_modules/@lezer/markdown/dist/index.js.map +1 -1
- package/dist/node_modules/.bun/@marijn_find-cluster-break@1.0.4/node_modules/@marijn/find-cluster-break/src/index.js.map +1 -1
- package/dist/node_modules/.bun/crelt@1.0.7/node_modules/crelt/index.js.map +1 -1
- package/dist/node_modules/.bun/style-mod@4.1.4/node_modules/style-mod/src/style-mod.js.map +1 -1
- package/dist/node_modules/.bun/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.js.map +1 -1
- package/dist/types/ai-button.d.ts +42 -0
- package/dist/types/index.d.ts +2 -1
- package/package.json +16 -16
- package/src/components/ai-button/__test__/ai-button.test.ts +375 -0
- package/src/components/ai-button/ai-button.vue +87 -0
- package/src/components/ai-button/index.ts +1 -0
- package/src/components/ai-button/style.scss +19 -0
- package/src/components/ai-button/style.ts +3 -0
- package/src/components/file-viewer/previewers/sheet-previewer.vue +1 -1
- package/src/components/file-viewer/style.scss +52 -233
- package/src/components/index.ts +2 -0
- package/src/types/ai-button.ts +44 -0
- package/src/types/index.ts +2 -0
- package/dist/node_modules/.bun/@codemirror_commands@6.11.0/node_modules/@codemirror/commands/dist/index.js.map +0 -1
- package/dist/node_modules/.bun/@codemirror_language@6.12.4/node_modules/@codemirror/language/dist/index.js.map +0 -1
- package/dist/node_modules/.bun/@codemirror_search@6.7.1/node_modules/@codemirror/search/dist/index.js.map +0 -1
- package/dist/node_modules/.bun/@codemirror_state@6.7.1/node_modules/@codemirror/state/dist/index.js.map +0 -1
- package/dist/node_modules/.bun/@codemirror_view@6.43.9/node_modules/@codemirror/view/dist/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../../../node_modules/.bun/@marijn+find-cluster-break@1.0.4/node_modules/@marijn/find-cluster-break/src/index.js"],"sourcesContent":["// These are filled with ranges (rangeFrom[i] up to but not including\n// rangeTo[i]) of code points that count as extending characters.\nlet rangeFrom = [], rangeTo = []\n\n;(() => {\n // Compressed representation of the Grapheme_Cluster_Break=Extend\n // information from\n // http://www.unicode.org/Public/17.0.0/ucd/auxiliary/GraphemeBreakProperty.txt.\n // Each pair of elements represents a range, as an offet from the\n // previous range and a length. Numbers are in base-36, with the empty\n // string being a shorthand for 1. See bin/build-extenders.js.\n let numbers = \"lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5\".split(\",\").map(s => s ? parseInt(s, 36) : 1)\n for (let i = 0, n = 0; i < numbers.length; i++)\n (i % 2 ? rangeTo : rangeFrom).push(n = n + numbers[i])\n})()\n\nexport function isExtendingChar(code) {\n if (code < 768) return false\n for (let from = 0, to = rangeFrom.length;;) {\n let mid = (from + to) >> 1\n if (code < rangeFrom[mid]) to = mid\n else if (code >= rangeTo[mid]) from = mid + 1\n else return true\n if (from == to) return false\n }\n}\n\nfunction isRegionalIndicator(code) {\n return code >= 0x1F1E6 && code <= 0x1F1FF\n}\n\nfunction check(code) {\n for (let i = 0; i < rangeFrom.length; i++) {\n if (rangeTo[i] > code) return rangeFrom[i] <= code\n }\n return false\n}\n\nconst ZWJ = 0x200d\n\nexport function findClusterBreak(str, pos, forward = true, includeExtending = true) {\n return (forward ? nextClusterBreak : prevClusterBreak)(str, pos, includeExtending)\n}\n\nfunction nextClusterBreak(str, pos, includeExtending) {\n if (pos == str.length) return pos\n // If pos is in the middle of a surrogate pair, move to its start\n if (pos && surrogateLow(str.charCodeAt(pos)) && surrogateHigh(str.charCodeAt(pos - 1))) pos--\n let prev = codePointAt(str, pos)\n pos += codePointSize(prev)\n while (pos < str.length) {\n let next = codePointAt(str, pos)\n if (prev == ZWJ || next == ZWJ || includeExtending && isExtendingChar(next)) {\n pos += codePointSize(next)\n prev = next\n } else if (isRegionalIndicator(next)) {\n let countBefore = 0, i = pos - 2\n while (i >= 0 && isRegionalIndicator(codePointAt(str, i))) { countBefore++; i -= 2 }\n if (countBefore % 2 == 0) break\n else pos += 2\n } else {\n break\n }\n }\n return pos\n}\n\nfunction prevClusterBreak(str, pos, includeExtending) {\n while (pos > 1) {\n let found = nextClusterBreak(str, pos - 2, includeExtending)\n if (found < pos) return found\n pos--\n }\n return 0\n}\n\nfunction codePointAt(str, pos) {\n let code0 = str.charCodeAt(pos)\n if (!surrogateHigh(code0) || pos + 1 == str.length) return code0\n let code1 = str.charCodeAt(pos + 1)\n if (!surrogateLow(code1)) return code0\n return ((code0 - 0xd800) << 10) + (code1 - 0xdc00) + 0x10000\n}\n\nfunction surrogateLow(ch) { return ch >= 0xDC00 && ch < 0xE000 }\nfunction surrogateHigh(ch) { return ch >= 0xD800 && ch < 0xDC00 }\nfunction codePointSize(code) { return code < 0x10000 ? 1 : 2 }\n"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../../../node_modules/.bun/@marijn+find-cluster-break@1.0.4/node_modules/@marijn/find-cluster-break/src/index.js"],"sourcesContent":["// These are filled with ranges (rangeFrom[i] up to but not including\n// rangeTo[i]) of code points that count as extending characters.\nlet rangeFrom = [], rangeTo = []\n\n;(() => {\n // Compressed representation of the Grapheme_Cluster_Break=Extend\n // information from\n // http://www.unicode.org/Public/17.0.0/ucd/auxiliary/GraphemeBreakProperty.txt.\n // Each pair of elements represents a range, as an offet from the\n // previous range and a length. Numbers are in base-36, with the empty\n // string being a shorthand for 1. See bin/build-extenders.js.\n let numbers = \"lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5\".split(\",\").map(s => s ? parseInt(s, 36) : 1)\n for (let i = 0, n = 0; i < numbers.length; i++)\n (i % 2 ? rangeTo : rangeFrom).push(n = n + numbers[i])\n})()\n\nexport function isExtendingChar(code) {\n if (code < 768) return false\n for (let from = 0, to = rangeFrom.length;;) {\n let mid = (from + to) >> 1\n if (code < rangeFrom[mid]) to = mid\n else if (code >= rangeTo[mid]) from = mid + 1\n else return true\n if (from == to) return false\n }\n}\n\nfunction isRegionalIndicator(code) {\n return code >= 0x1F1E6 && code <= 0x1F1FF\n}\n\nfunction check(code) {\n for (let i = 0; i < rangeFrom.length; i++) {\n if (rangeTo[i] > code) return rangeFrom[i] <= code\n }\n return false\n}\n\nconst ZWJ = 0x200d\n\nexport function findClusterBreak(str, pos, forward = true, includeExtending = true) {\n return (forward ? nextClusterBreak : prevClusterBreak)(str, pos, includeExtending)\n}\n\nfunction nextClusterBreak(str, pos, includeExtending) {\n if (pos == str.length) return pos\n // If pos is in the middle of a surrogate pair, move to its start\n if (pos && surrogateLow(str.charCodeAt(pos)) && surrogateHigh(str.charCodeAt(pos - 1))) pos--\n let prev = codePointAt(str, pos)\n pos += codePointSize(prev)\n while (pos < str.length) {\n let next = codePointAt(str, pos)\n if (prev == ZWJ || next == ZWJ || includeExtending && isExtendingChar(next)) {\n pos += codePointSize(next)\n prev = next\n } else if (isRegionalIndicator(next)) {\n let countBefore = 0, i = pos - 2\n while (i >= 0 && isRegionalIndicator(codePointAt(str, i))) { countBefore++; i -= 2 }\n if (countBefore % 2 == 0) break\n else pos += 2\n } else {\n break\n }\n }\n return pos\n}\n\nfunction prevClusterBreak(str, pos, includeExtending) {\n while (pos > 1) {\n let found = nextClusterBreak(str, pos - 2, includeExtending)\n if (found < pos) return found\n pos--\n }\n return 0\n}\n\nfunction codePointAt(str, pos) {\n let code0 = str.charCodeAt(pos)\n if (!surrogateHigh(code0) || pos + 1 == str.length) return code0\n let code1 = str.charCodeAt(pos + 1)\n if (!surrogateLow(code1)) return code0\n return ((code0 - 0xd800) << 10) + (code1 - 0xdc00) + 0x10000\n}\n\nfunction surrogateLow(ch) { return ch >= 0xDC00 && ch < 0xE000 }\nfunction surrogateHigh(ch) { return ch >= 0xD800 && ch < 0xDC00 }\nfunction codePointSize(code) { return code < 0x10000 ? 1 : 2 }\n"],"ignoreList":[0],"mappings":";AAEA,IAAI,YAAY,CAAC;AAAG,IAAA,UAAU,CAAC;OAEvB;CAON,IAAI,UAAU,kzCAAkzC,MAAM,GAAG,CAAC,CAAC,KAAI,MAAK,IAAI,SAAS,GAAG,EAAE,IAAI,CAAC;CAC32C,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,QAAQ,QAAQ,KACzC,CAAC,IAAI,IAAI,UAAU,UAAA,CAAW,KAAK,IAAI,IAAI,QAAQ,EAAE;AACzD,EAAA,CAAG;AAEH,SAAgB,gBAAgB,MAAM;CACpC,IAAI,OAAO,KAAK,OAAO;CACvB,KAAK,IAAI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;AAEA,SAAS,YAAY,KAAK,KAAK;CAC7B,IAAI,QAAQ,IAAI,WAAW,GAAG;CAC9B,IAAI,CAAC,cAAc,KAAK,KAAK,MAAM,KAAK,IAAI,QAAQ,OAAO;CAC3D,IAAI,QAAQ,IAAI,WAAW,MAAM,CAAC;CAClC,IAAI,CAAC,aAAa,KAAK,GAAG,OAAO;CACjC,QAAS,QAAQ,SAAW,OAAO,QAAQ,SAAU;AACvD;AAEA,SAAS,aAAa,IAAI;CAAE,OAAO,MAAM,SAAU,KAAK;AAAO;AAC/D,SAAS,cAAc,IAAI;CAAE,OAAO,MAAM,SAAU,KAAK;AAAO;AAChE,SAAS,cAAc,MAAM;CAAE,OAAO,OAAO,QAAU,IAAI;AAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../node_modules/.bun/crelt@1.0.7/node_modules/crelt/index.js"],"sourcesContent":["export default function crelt() {\n var elt = arguments[0]\n if (typeof elt == \"string\") elt = document.createElement(elt)\n var i = 1, next = arguments[1]\n if (next && typeof next == \"object\" && next.nodeType == null && !Array.isArray(next)) {\n for (var name in next) if (Object.prototype.hasOwnProperty.call(next, name)) {\n var value = next[name]\n if (typeof value == \"string\") elt.setAttribute(name, value)\n else if (value != null) elt[name] = value\n }\n i++\n }\n for (; i < arguments.length; i++) add(elt, arguments[i])\n return elt\n}\n\nfunction add(elt, child) {\n if (typeof child == \"string\") {\n elt.appendChild(document.createTextNode(child))\n } else if (child == null) {\n } else if (child.nodeType != null) {\n elt.appendChild(child)\n } else if (Array.isArray(child)) {\n for (var i = 0; i < child.length; i++) add(elt, child[i])\n } else {\n throw new RangeError(\"Unsupported child node: \" + child)\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../node_modules/.bun/crelt@1.0.7/node_modules/crelt/index.js"],"sourcesContent":["export default function crelt() {\n var elt = arguments[0]\n if (typeof elt == \"string\") elt = document.createElement(elt)\n var i = 1, next = arguments[1]\n if (next && typeof next == \"object\" && next.nodeType == null && !Array.isArray(next)) {\n for (var name in next) if (Object.prototype.hasOwnProperty.call(next, name)) {\n var value = next[name]\n if (typeof value == \"string\") elt.setAttribute(name, value)\n else if (value != null) elt[name] = value\n }\n i++\n }\n for (; i < arguments.length; i++) add(elt, arguments[i])\n return elt\n}\n\nfunction add(elt, child) {\n if (typeof child == \"string\") {\n elt.appendChild(document.createTextNode(child))\n } else if (child == null) {\n } else if (child.nodeType != null) {\n elt.appendChild(child)\n } else if (Array.isArray(child)) {\n for (var i = 0; i < child.length; i++) add(elt, child[i])\n } else {\n throw new RangeError(\"Unsupported child node: \" + child)\n }\n}\n"],"ignoreList":[0],"mappings":";AAAA,SAAwB,QAAQ;CAC9B,IAAI,MAAM,UAAU;CACpB,IAAI,OAAO,OAAO,UAAU,MAAM,SAAS,cAAc,GAAG;CAC5D,IAAI,IAAI,GAAG,OAAO,UAAU;CAC5B,IAAI,QAAQ,OAAO,QAAQ,YAAY,KAAK,YAAY,QAAQ,CAAC,MAAM,QAAQ,IAAI,GAAG;EACpF,KAAK,IAAI,QAAQ,MAAM,IAAI,OAAO,UAAU,eAAe,KAAK,MAAM,IAAI,GAAG;GAC3E,IAAI,QAAQ,KAAK;GACjB,IAAI,OAAO,SAAS,UAAU,IAAI,aAAa,MAAM,KAAK;QACrD,IAAI,SAAS,MAAM,IAAI,QAAQ;EACtC;EACA;CACF;CACA,OAAO,IAAI,UAAU,QAAQ,KAAK,IAAI,KAAK,UAAU,EAAE;CACvD,OAAO;AACT;AAEA,SAAS,IAAI,KAAK,OAAO;CACvB,IAAI,OAAO,SAAS,UAClB,IAAI,YAAY,SAAS,eAAe,KAAK,CAAC;MACzC,IAAI,SAAS,MAAM,CAC1B,OAAO,IAAI,MAAM,YAAY,MAC3B,IAAI,YAAY,KAAK;MAChB,IAAI,MAAM,QAAQ,KAAK,GAC5B,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,IAAI,KAAK,MAAM,EAAE;MAExD,MAAM,IAAI,WAAW,6BAA6B,KAAK;AAE3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-mod.js","names":[],"sources":["../../../../../../../../../node_modules/.bun/style-mod@4.1.4/node_modules/style-mod/src/style-mod.js"],"sourcesContent":["const C = \"\\u037c\"\nconst COUNT = typeof Symbol == \"undefined\" ? \"__\" + C : Symbol.for(C)\nconst SET = typeof Symbol == \"undefined\" ? \"__styleSet\" + Math.floor(Math.random() * 1e8) : Symbol(\"styleSet\")\nconst top = typeof globalThis != \"undefined\" ? globalThis : typeof window != \"undefined\" ? window : {}\n\n// :: - Style modules encapsulate a set of CSS rules defined from\n// JavaScript. Their definitions are only available in a given DOM\n// root after it has been _mounted_ there with `StyleModule.mount`.\n//\n// Style modules should be created once and stored somewhere, as\n// opposed to re-creating them every time you need them. The amount of\n// CSS rules generated for a given DOM root is bounded by the amount\n// of style modules that were used. So to avoid leaking rules, don't\n// create these dynamically, but treat them as one-time allocations.\nexport class StyleModule {\n // :: (Object<Style>, ?{finish: ?(string) → string})\n // Create a style module from the given spec.\n //\n // When `finish` is given, it is called on regular (non-`@`)\n // selectors (after `&` expansion) to compute the final selector.\n constructor(spec, options) {\n this.rules = []\n let {finish} = options || {}\n\n function splitSelector(selector) {\n return /^@/.test(selector) ? [selector] : selector.split(/,\\s*/)\n }\n\n function render(selectors, spec, target, isKeyframes) {\n let local = [], isAt = /^@(\\w+)\\b/.exec(selectors[0]), keyframes = isAt && isAt[1] == \"keyframes\"\n if (isAt && spec == null) return target.push(selectors[0] + \";\")\n for (let prop in spec) {\n let value = spec[prop]\n if (/&/.test(prop)) {\n render(prop.split(/,\\s*/).map(part => selectors.map(sel => part.replace(/&/, sel))).reduce((a, b) => a.concat(b)),\n value, target)\n } else if (value && typeof value == \"object\") {\n if (!isAt) throw new RangeError(\"The value of a property (\" + prop + \") should be a primitive value.\")\n render(splitSelector(prop), value, local, keyframes)\n } else if (value != null) {\n local.push(prop.replace(/_.*/, \"\").replace(/[A-Z]/g, l => \"-\" + l.toLowerCase()) + \": \" + value + \";\")\n }\n }\n if (local.length || keyframes) {\n target.push((finish && !isAt && !isKeyframes ? selectors.map(finish) : selectors).join(\", \") +\n \" {\" + local.join(\" \") + \"}\")\n }\n }\n\n for (let prop in spec) render(splitSelector(prop), spec[prop], this.rules)\n }\n\n // :: () → string\n // Returns a string containing the module's CSS rules.\n getRules() { return this.rules.join(\"\\n\") }\n\n // :: () → string\n // Generate a new unique CSS class name.\n static newName() {\n let id = top[COUNT] || 1\n top[COUNT] = id + 1\n return C + id.toString(36)\n }\n\n // :: (union<Document, ShadowRoot>, union<[StyleModule], StyleModule>, ?{nonce: ?string})\n //\n // Mount the given set of modules in the given DOM root, which ensures\n // that the CSS rules defined by the module are available in that\n // context.\n //\n // Rules are only added to the document once per root.\n //\n // Rule order will follow the order of the modules, so that rules from\n // modules later in the array take precedence of those from earlier\n // modules. If you call this function multiple times for the same root\n // in a way that changes the order of already mounted modules, the old\n // order will be changed.\n //\n // If a Content Security Policy nonce is provided, it is added to\n // the `<style>` tag generated by the library.\n static mount(root, modules, options) {\n let set = root[SET], nonce = options && options.nonce\n if (!set) set = new StyleSet(root, nonce)\n else if (nonce) set.setNonce(nonce)\n set.mount(Array.isArray(modules) ? modules : [modules], root)\n }\n}\n\nlet adoptedSet = new Map //<Document, StyleSet>\n\nclass StyleSet {\n constructor(root, nonce) {\n let doc = root.ownerDocument || root, win = doc.defaultView\n if (!root.head && root.adoptedStyleSheets && win.CSSStyleSheet) {\n let adopted = adoptedSet.get(doc)\n if (adopted) return root[SET] = adopted\n this.sheet = new win.CSSStyleSheet\n adoptedSet.set(doc, this)\n } else {\n this.styleTag = doc.createElement(\"style\")\n if (nonce) this.styleTag.setAttribute(\"nonce\", nonce)\n }\n this.modules = []\n root[SET] = this\n }\n\n mount(modules, root) {\n let sheet = this.sheet\n let pos = 0 /* Current rule offset */, j = 0 /* Index into this.modules */\n let changed = false\n for (let i = 0; i < modules.length; i++) {\n let mod = modules[i], index = this.modules.indexOf(mod)\n if (index < j && index > -1) { // Ordering conflict\n this.modules.splice(index, 1)\n changed = true\n j--\n index = -1\n }\n if (index == -1) {\n this.modules.splice(j++, 0, mod)\n changed = true\n if (sheet) for (let k = 0; k < mod.rules.length; k++)\n sheet.insertRule(mod.rules[k], pos++)\n } else {\n while (j < index) pos += this.modules[j++].rules.length\n pos += mod.rules.length\n j++\n }\n }\n\n if (sheet) {\n if (root.adoptedStyleSheets.indexOf(this.sheet) < 0)\n root.adoptedStyleSheets = [this.sheet, ...root.adoptedStyleSheets]\n } else {\n if (changed) {\n let text = \"\"\n for (let i = 0; i < this.modules.length; i++)\n text += this.modules[i].getRules() + \"\\n\"\n this.styleTag.textContent = text\n }\n let target = root.head || root\n if (this.styleTag.parentNode != target)\n target.insertBefore(this.styleTag, target.firstChild)\n }\n }\n\n setNonce(nonce) {\n if (this.styleTag && this.styleTag.getAttribute(\"nonce\") != nonce)\n this.styleTag.setAttribute(\"nonce\", nonce)\n }\n}\n\n// Style::Object<union<Style,string>>\n//\n// A style is an object that, in the simple case, maps CSS property\n// names to strings holding their values, as in `{color: \"red\",\n// fontWeight: \"bold\"}`. The property names can be given in\n// camel-case—the library will insert a dash before capital letters\n// when converting them to CSS.\n//\n// If you include an underscore in a property name, it and everything\n// after it will be removed from the output, which can be useful when\n// providing a property multiple times, for browser compatibility\n// reasons.\n//\n// A property in a style object can also be a sub-selector, which\n// extends the current context to add a pseudo-selector or a child\n// selector. Such a property should contain a `&` character, which\n// will be replaced by the current selector. For example `{\"&:before\":\n// {content: '\"hi\"'}}`. Sub-selectors and regular properties can\n// freely be mixed in a given object. Any property containing a `&` is\n// assumed to be a sub-selector.\n//\n// Finally, a property can specify an @-block to be wrapped around the\n// styles defined inside the object that's the property's value. For\n// example to create a media query you can do `{\"@media screen and\n// (min-width: 400px)\": {...}}`.\n"],"x_google_ignoreList":[0],"mappings":";AAAA,MAAM,IAAI;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AA6B,IAAI;EAC3C,IAAI,UAAU;EACd,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;GACvC,IAAI,MAAM,QAAQ,IAAI,QAAQ,KAAK,QAAQ,QAAQ,GAAG;GACtD,IAAI,QAAQ,KAAK,QAAQ,IAAI;IAC3B,KAAK,QAAQ,OAAO,OAAO,CAAC;IAC5B,UAAU;IACV;IACA,QAAQ;GACV;GACA,IAAI,SAAS,IAAI;IACf,KAAK,QAAQ,OAAO,KAAK,GAAG,GAAG;IAC/B,UAAU;IACV,IAAI,OAAO,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,MAAM,QAAQ,KAC/C,MAAM,WAAW,IAAI,MAAM,IAAI,KAAK;GACxC,OAAO;IACL,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,MAAM;IACjD,OAAO,IAAI,MAAM;IACjB;GACF;EACF;EAEA,IAAI,OACE;OAAA,KAAK,mBAAmB,QAAQ,KAAK,KAAK,IAAI,GAChD,KAAK,qBAAqB,CAAC,KAAK,OAAO,GAAG,KAAK,kBAAkB;EAAA,OAC9D;GACL,IAAI,SAAS;IACX,IAAI,OAAO;IACX,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,QAAQ,KACvC,QAAQ,KAAK,QAAQ,EAAE,CAAC,SAAS,IAAI;IACvC,KAAK,SAAS,cAAc;GAC9B;GACA,IAAI,SAAS,KAAK,QAAQ;GAC1B,IAAI,KAAK,SAAS,cAAc,QAC9B,OAAO,aAAa,KAAK,UAAU,OAAO,UAAU;EACxD;CACF;CAEA,SAAS,OAAO;EACd,IAAI,KAAK,YAAY,KAAK,SAAS,aAAa,OAAO,KAAK,OAC1D,KAAK,SAAS,aAAa,SAAS,KAAK;CAC7C;AACF"}
|
|
1
|
+
{"version":3,"file":"style-mod.js","names":[],"sources":["../../../../../../../../../node_modules/.bun/style-mod@4.1.4/node_modules/style-mod/src/style-mod.js"],"sourcesContent":["const C = \"\\u037c\"\nconst COUNT = typeof Symbol == \"undefined\" ? \"__\" + C : Symbol.for(C)\nconst SET = typeof Symbol == \"undefined\" ? \"__styleSet\" + Math.floor(Math.random() * 1e8) : Symbol(\"styleSet\")\nconst top = typeof globalThis != \"undefined\" ? globalThis : typeof window != \"undefined\" ? window : {}\n\n// :: - Style modules encapsulate a set of CSS rules defined from\n// JavaScript. Their definitions are only available in a given DOM\n// root after it has been _mounted_ there with `StyleModule.mount`.\n//\n// Style modules should be created once and stored somewhere, as\n// opposed to re-creating them every time you need them. The amount of\n// CSS rules generated for a given DOM root is bounded by the amount\n// of style modules that were used. So to avoid leaking rules, don't\n// create these dynamically, but treat them as one-time allocations.\nexport class StyleModule {\n // :: (Object<Style>, ?{finish: ?(string) → string})\n // Create a style module from the given spec.\n //\n // When `finish` is given, it is called on regular (non-`@`)\n // selectors (after `&` expansion) to compute the final selector.\n constructor(spec, options) {\n this.rules = []\n let {finish} = options || {}\n\n function splitSelector(selector) {\n return /^@/.test(selector) ? [selector] : selector.split(/,\\s*/)\n }\n\n function render(selectors, spec, target, isKeyframes) {\n let local = [], isAt = /^@(\\w+)\\b/.exec(selectors[0]), keyframes = isAt && isAt[1] == \"keyframes\"\n if (isAt && spec == null) return target.push(selectors[0] + \";\")\n for (let prop in spec) {\n let value = spec[prop]\n if (/&/.test(prop)) {\n render(prop.split(/,\\s*/).map(part => selectors.map(sel => part.replace(/&/, sel))).reduce((a, b) => a.concat(b)),\n value, target)\n } else if (value && typeof value == \"object\") {\n if (!isAt) throw new RangeError(\"The value of a property (\" + prop + \") should be a primitive value.\")\n render(splitSelector(prop), value, local, keyframes)\n } else if (value != null) {\n local.push(prop.replace(/_.*/, \"\").replace(/[A-Z]/g, l => \"-\" + l.toLowerCase()) + \": \" + value + \";\")\n }\n }\n if (local.length || keyframes) {\n target.push((finish && !isAt && !isKeyframes ? selectors.map(finish) : selectors).join(\", \") +\n \" {\" + local.join(\" \") + \"}\")\n }\n }\n\n for (let prop in spec) render(splitSelector(prop), spec[prop], this.rules)\n }\n\n // :: () → string\n // Returns a string containing the module's CSS rules.\n getRules() { return this.rules.join(\"\\n\") }\n\n // :: () → string\n // Generate a new unique CSS class name.\n static newName() {\n let id = top[COUNT] || 1\n top[COUNT] = id + 1\n return C + id.toString(36)\n }\n\n // :: (union<Document, ShadowRoot>, union<[StyleModule], StyleModule>, ?{nonce: ?string})\n //\n // Mount the given set of modules in the given DOM root, which ensures\n // that the CSS rules defined by the module are available in that\n // context.\n //\n // Rules are only added to the document once per root.\n //\n // Rule order will follow the order of the modules, so that rules from\n // modules later in the array take precedence of those from earlier\n // modules. If you call this function multiple times for the same root\n // in a way that changes the order of already mounted modules, the old\n // order will be changed.\n //\n // If a Content Security Policy nonce is provided, it is added to\n // the `<style>` tag generated by the library.\n static mount(root, modules, options) {\n let set = root[SET], nonce = options && options.nonce\n if (!set) set = new StyleSet(root, nonce)\n else if (nonce) set.setNonce(nonce)\n set.mount(Array.isArray(modules) ? modules : [modules], root)\n }\n}\n\nlet adoptedSet = new Map //<Document, StyleSet>\n\nclass StyleSet {\n constructor(root, nonce) {\n let doc = root.ownerDocument || root, win = doc.defaultView\n if (!root.head && root.adoptedStyleSheets && win.CSSStyleSheet) {\n let adopted = adoptedSet.get(doc)\n if (adopted) return root[SET] = adopted\n this.sheet = new win.CSSStyleSheet\n adoptedSet.set(doc, this)\n } else {\n this.styleTag = doc.createElement(\"style\")\n if (nonce) this.styleTag.setAttribute(\"nonce\", nonce)\n }\n this.modules = []\n root[SET] = this\n }\n\n mount(modules, root) {\n let sheet = this.sheet\n let pos = 0 /* Current rule offset */, j = 0 /* Index into this.modules */\n let changed = false\n for (let i = 0; i < modules.length; i++) {\n let mod = modules[i], index = this.modules.indexOf(mod)\n if (index < j && index > -1) { // Ordering conflict\n this.modules.splice(index, 1)\n changed = true\n j--\n index = -1\n }\n if (index == -1) {\n this.modules.splice(j++, 0, mod)\n changed = true\n if (sheet) for (let k = 0; k < mod.rules.length; k++)\n sheet.insertRule(mod.rules[k], pos++)\n } else {\n while (j < index) pos += this.modules[j++].rules.length\n pos += mod.rules.length\n j++\n }\n }\n\n if (sheet) {\n if (root.adoptedStyleSheets.indexOf(this.sheet) < 0)\n root.adoptedStyleSheets = [this.sheet, ...root.adoptedStyleSheets]\n } else {\n if (changed) {\n let text = \"\"\n for (let i = 0; i < this.modules.length; i++)\n text += this.modules[i].getRules() + \"\\n\"\n this.styleTag.textContent = text\n }\n let target = root.head || root\n if (this.styleTag.parentNode != target)\n target.insertBefore(this.styleTag, target.firstChild)\n }\n }\n\n setNonce(nonce) {\n if (this.styleTag && this.styleTag.getAttribute(\"nonce\") != nonce)\n this.styleTag.setAttribute(\"nonce\", nonce)\n }\n}\n\n// Style::Object<union<Style,string>>\n//\n// A style is an object that, in the simple case, maps CSS property\n// names to strings holding their values, as in `{color: \"red\",\n// fontWeight: \"bold\"}`. The property names can be given in\n// camel-case—the library will insert a dash before capital letters\n// when converting them to CSS.\n//\n// If you include an underscore in a property name, it and everything\n// after it will be removed from the output, which can be useful when\n// providing a property multiple times, for browser compatibility\n// reasons.\n//\n// A property in a style object can also be a sub-selector, which\n// extends the current context to add a pseudo-selector or a child\n// selector. Such a property should contain a `&` character, which\n// will be replaced by the current selector. For example `{\"&:before\":\n// {content: '\"hi\"'}}`. Sub-selectors and regular properties can\n// freely be mixed in a given object. Any property containing a `&` is\n// assumed to be a sub-selector.\n//\n// Finally, a property can specify an @-block to be wrapped around the\n// styles defined inside the object that's the property's value. For\n// example to create a media query you can do `{\"@media screen and\n// (min-width: 400px)\": {...}}`.\n"],"ignoreList":[0],"mappings":";AAAA,MAAM,IAAI;AACV,MAAM,QAAQ,OAAO,UAAU,cAAc,QAAW,OAAO,IAAI,CAAC;AACpE,MAAM,MAAM,OAAO,UAAU,cAAc,eAAe,KAAK,MAAM,KAAK,OAAO,IAAI,GAAG,IAAI,OAAO,UAAU;AAC7G,MAAM,MAAM,OAAO,cAAc,cAAc,aAAa,OAAO,UAAU,cAAc,SAAS,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AAC;IAC5B,UAAU;IACV;IACA,QAAQ;GACV;GACA,IAAI,SAAS,IAAI;IACf,KAAK,QAAQ,OAAO,KAAK,GAAG,GAAG;IAC/B,UAAU;IACV,IAAI,OAAO,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,MAAM,QAAQ,KAC/C,MAAM,WAAW,IAAI,MAAM,IAAI,KAAK;GACxC,OAAO;IACL,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,MAAM;IACjD,OAAO,IAAI,MAAM;IACjB;GACF;EACF;EAEA,IAAI,OACE;OAAA,KAAK,mBAAmB,QAAQ,KAAK,KAAK,IAAI,GAChD,KAAK,qBAAqB,CAAC,KAAK,OAAO,GAAG,KAAK,kBAAkB;EAAA,OAC9D;GACL,IAAI,SAAS;IACX,IAAI,OAAO;IACX,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,QAAQ,KACvC,QAAQ,KAAK,QAAQ,EAAE,CAAC,SAAS,IAAI;IACvC,KAAK,SAAS,cAAc;GAC9B;GACA,IAAI,SAAS,KAAK,QAAQ;GAC1B,IAAI,KAAK,SAAS,cAAc,QAC9B,OAAO,aAAa,KAAK,UAAU,OAAO,UAAU;EACxD;CACF;CAEA,SAAS,OAAO;EACd,IAAI,KAAK,YAAY,KAAK,SAAS,aAAa,OAAO,KAAK,OAC1D,KAAK,SAAS,aAAa,SAAS,KAAK;CAC7C;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../node_modules/.bun/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.js"],"sourcesContent":["export var base = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 10: \"Enter\",\n 12: \"NumLock\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 44: \"PrintScreen\",\n 45: \"Insert\",\n 46: \"Delete\",\n 59: \";\",\n 61: \"=\",\n 91: \"Meta\",\n 92: \"Meta\",\n 106: \"*\",\n 107: \"+\",\n 108: \",\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 160: \"Shift\",\n 161: \"Shift\",\n 162: \"Control\",\n 163: \"Control\",\n 164: \"Alt\",\n 165: \"Alt\",\n 173: \"-\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\"\n}\n\nexport var shift = {\n 48: \")\",\n 49: \"!\",\n 50: \"@\",\n 51: \"#\",\n 52: \"$\",\n 53: \"%\",\n 54: \"^\",\n 55: \"&\",\n 56: \"*\",\n 57: \"(\",\n 59: \":\",\n 61: \"+\",\n 173: \"_\",\n 186: \":\",\n 187: \"+\",\n 188: \"<\",\n 189: \"_\",\n 190: \">\",\n 191: \"?\",\n 192: \"~\",\n 219: \"{\",\n 220: \"|\",\n 221: \"}\",\n 222: \"\\\"\"\n}\n\nvar mac = typeof navigator != \"undefined\" && /Mac/.test(navigator.platform)\nvar ie = typeof navigator != \"undefined\" && /MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent)\n\n// Fill in the digit keys\nfor (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i)\n\n// The function keys\nfor (var i = 1; i <= 24; i++) base[i + 111] = \"F\" + i\n\n// And the alphabetic keys\nfor (var i = 65; i <= 90; i++) {\n base[i] = String.fromCharCode(i + 32)\n shift[i] = String.fromCharCode(i)\n}\n\n// For each code that doesn't have a shift-equivalent, copy the base name\nfor (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code]\n\nexport function keyName(event) {\n // On macOS, keys held with Shift and Cmd don't reflect the effect of Shift in `.key`.\n // On IE, shift effect is never included in `.key`.\n var ignoreKey = mac && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey ||\n ie && event.shiftKey && event.key && event.key.length == 1 ||\n event.key == \"Unidentified\"\n var name = (!ignoreKey && event.key) ||\n (event.shiftKey ? shift : base)[event.keyCode] ||\n event.key || \"Unidentified\"\n // Edge sometimes produces wrong names (Issue #3)\n if (name == \"Esc\") name = \"Escape\"\n if (name == \"Del\") name = \"Delete\"\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/\n if (name == \"Left\") name = \"ArrowLeft\"\n if (name == \"Up\") name = \"ArrowUp\"\n if (name == \"Right\") name = \"ArrowRight\"\n if (name == \"Down\") name = \"ArrowDown\"\n return name\n}\n"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../node_modules/.bun/w3c-keyname@2.2.8/node_modules/w3c-keyname/index.js"],"sourcesContent":["export var base = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 10: \"Enter\",\n 12: \"NumLock\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 44: \"PrintScreen\",\n 45: \"Insert\",\n 46: \"Delete\",\n 59: \";\",\n 61: \"=\",\n 91: \"Meta\",\n 92: \"Meta\",\n 106: \"*\",\n 107: \"+\",\n 108: \",\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 160: \"Shift\",\n 161: \"Shift\",\n 162: \"Control\",\n 163: \"Control\",\n 164: \"Alt\",\n 165: \"Alt\",\n 173: \"-\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\"\n}\n\nexport var shift = {\n 48: \")\",\n 49: \"!\",\n 50: \"@\",\n 51: \"#\",\n 52: \"$\",\n 53: \"%\",\n 54: \"^\",\n 55: \"&\",\n 56: \"*\",\n 57: \"(\",\n 59: \":\",\n 61: \"+\",\n 173: \"_\",\n 186: \":\",\n 187: \"+\",\n 188: \"<\",\n 189: \"_\",\n 190: \">\",\n 191: \"?\",\n 192: \"~\",\n 219: \"{\",\n 220: \"|\",\n 221: \"}\",\n 222: \"\\\"\"\n}\n\nvar mac = typeof navigator != \"undefined\" && /Mac/.test(navigator.platform)\nvar ie = typeof navigator != \"undefined\" && /MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent)\n\n// Fill in the digit keys\nfor (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i)\n\n// The function keys\nfor (var i = 1; i <= 24; i++) base[i + 111] = \"F\" + i\n\n// And the alphabetic keys\nfor (var i = 65; i <= 90; i++) {\n base[i] = String.fromCharCode(i + 32)\n shift[i] = String.fromCharCode(i)\n}\n\n// For each code that doesn't have a shift-equivalent, copy the base name\nfor (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code]\n\nexport function keyName(event) {\n // On macOS, keys held with Shift and Cmd don't reflect the effect of Shift in `.key`.\n // On IE, shift effect is never included in `.key`.\n var ignoreKey = mac && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey ||\n ie && event.shiftKey && event.key && event.key.length == 1 ||\n event.key == \"Unidentified\"\n var name = (!ignoreKey && event.key) ||\n (event.shiftKey ? shift : base)[event.keyCode] ||\n event.key || \"Unidentified\"\n // Edge sometimes produces wrong names (Issue #3)\n if (name == \"Esc\") name = \"Escape\"\n if (name == \"Del\") name = \"Delete\"\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/\n if (name == \"Left\") name = \"ArrowLeft\"\n if (name == \"Up\") name = \"ArrowUp\"\n if (name == \"Right\") name = \"ArrowRight\"\n if (name == \"Down\") name = \"ArrowDown\"\n return name\n}\n"],"ignoreList":[0],"mappings":";AAAA,IAAW,OAAO;CAChB,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;AACP;AAEA,IAAW,QAAQ;CACjB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;AACP;AAEA,IAAI,MAAM,OAAO,aAAa,eAAe,MAAM,KAAK,UAAU,QAAQ;AAC1E,IAAI,KAAK,OAAO,aAAa,eAAe,gDAAgD,KAAK,UAAU,SAAS;AAGpH,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,OAAO,CAAC;AAGnE,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,IAAI,OAAO,MAAM;AAGpD,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,KAAK;CAC7B,KAAK,KAAK,OAAO,aAAa,IAAI,EAAE;CACpC,MAAM,KAAK,OAAO,aAAa,CAAC;AAClC;AAGA,KAAK,IAAI,QAAQ,MAAM,IAAI,CAAC,MAAM,eAAe,IAAI,GAAG,MAAM,QAAQ,KAAK;AAE3E,SAAgB,QAAQ,OAAO;CAM7B,IAAI,OAAQ,EAHI,OAAO,MAAM,WAAW,MAAM,YAAY,CAAC,MAAM,WAAW,CAAC,MAAM,UAC/E,MAAM,MAAM,YAAY,MAAM,OAAO,MAAM,IAAI,UAAU,KACzD,MAAM,OAAO,mBACS,MAAM,QAC7B,MAAM,WAAW,QAAQ,KAAA,CAAM,MAAM,YACtC,MAAM,OAAO;CAEf,IAAI,QAAQ,OAAO,OAAO;CAC1B,IAAI,QAAQ,OAAO,OAAO;CAE1B,IAAI,QAAQ,QAAQ,OAAO;CAC3B,IAAI,QAAQ,MAAM,OAAO;CACzB,IAAI,QAAQ,SAAS,OAAO;CAC5B,IAAI,QAAQ,QAAQ,OAAO;CAC3B,OAAO;AACT"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AiProviderConfig, ComponentProps, DeconstructValue } from "@veltra/utils";
|
|
2
|
+
//#region src/types/ai-button.d.ts
|
|
3
|
+
/** AI 按钮变体 */
|
|
4
|
+
export type AiButtonVariant = 'default' | 'pre-input';
|
|
5
|
+
/** AI 图标按钮组件属性 */
|
|
6
|
+
export interface AiButtonProps extends ComponentProps {
|
|
7
|
+
/**
|
|
8
|
+
* 服务商配置:字段级覆盖 `useConfig` 全局 `ai` 配置
|
|
9
|
+
* (实例字段 > 全局字段 > 默认值,`stream` 缺省 false)
|
|
10
|
+
*/
|
|
11
|
+
provider?: Partial<AiProviderConfig>;
|
|
12
|
+
/** 系统提示词,存在时作为首条 system 消息 */
|
|
13
|
+
systemPrompt?: string;
|
|
14
|
+
/** 用户提示词,作为 user 消息 */
|
|
15
|
+
prompt?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 变体
|
|
18
|
+
* - `default`:点击即发起请求
|
|
19
|
+
* - `pre-input`:点击展开气泡,经 `#pre-input` 插槽收集补充输入,确认后才发起请求
|
|
20
|
+
* @default 'default'
|
|
21
|
+
*/
|
|
22
|
+
variant?: AiButtonVariant;
|
|
23
|
+
}
|
|
24
|
+
/** AI 图标按钮组件定义的事件 */
|
|
25
|
+
export interface AiButtonEmits {
|
|
26
|
+
/** 生成成功:一次性为完整文本,流式为全部增量拼接的完整文本 */
|
|
27
|
+
(event: 'success', text: string): void;
|
|
28
|
+
/** 生成失败:网络错误、非 2xx 响应、流中断(组件不自动提示) */
|
|
29
|
+
(event: 'error', error: Error): void;
|
|
30
|
+
/** 流式文本增量 */
|
|
31
|
+
(event: 'delta', chunk: string): void;
|
|
32
|
+
/** pre-input 变体确认(随后发起请求) */
|
|
33
|
+
(event: 'confirm'): void;
|
|
34
|
+
/** pre-input 变体取消(不发起请求) */
|
|
35
|
+
(event: 'cancel'): void;
|
|
36
|
+
}
|
|
37
|
+
/** AI 图标按钮组件暴露的属性和方法(组件内部使用) */
|
|
38
|
+
export interface _AiButtonExposed {}
|
|
39
|
+
/** AI 图标按钮组件暴露的属性和方法(组件外部使用, 引用的值会被自动解构) */
|
|
40
|
+
export type AiButtonExposed = DeconstructValue<_AiButtonExposed>;
|
|
41
|
+
//#endregion
|
|
42
|
+
//# sourceMappingURL=ai-button.d.ts.map
|
package/dist/types/index.d.ts
CHANGED
|
@@ -95,5 +95,6 @@ import { TimePickerDataType, TimePickerEmits, TimePickerExposed, TimePickerProps
|
|
|
95
95
|
import { DescriptionsItemProps, DescriptionsLayout, DescriptionsProps } from "./descriptions.js";
|
|
96
96
|
import { TimelineItemColor, TimelineItemProps, TimelineProps } from "./timeline.js";
|
|
97
97
|
import { CarouselEmits, CarouselItemProps, CarouselProps } from "./carousel.js";
|
|
98
|
+
import { AiButtonEmits, AiButtonExposed, AiButtonProps, AiButtonVariant, _AiButtonExposed } from "./ai-button.js";
|
|
98
99
|
export type * from "@veltra/utils";
|
|
99
|
-
export { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, AlertEmits, AlertExposed, AlertProps, AlertType, AnchorEmits, AnchorExposed, AnchorItemProps, AnchorProps, AnimationEmits, AnimationExposed, AnimationProps, AutoCompleteEmits, AutoCompleteExposed, AutoCompleteProps, AvatarEmits, AvatarExposed, AvatarGroupProps, AvatarProps, AvatarShape, BackTopEmits, BackTopExposed, BackTopProps, BadgeEmits, BadgeExposed, BadgeProps, BarType, BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditProps, BatchEditSlots, BatchEditStates, BreadcrumbEmits, BreadcrumbExposed, BreadcrumbItem, BreadcrumbProps, BreadcrumbSlotScope, BreakCols, Breakpoint, ButtonEmits, ButtonExposed, ButtonProps, ButtonType, CalendarDay, CalendarEmits, CalendarExposed, CalendarMonth, CalendarProps, CalendarYear, CardActionProps, CardContentProps, CardCoverProps, CardEmits, CardExposed, CardProps, CarouselEmits, CarouselItemProps, CarouselProps, CascadeEmits, CascadeExposed, CascadeNode, CascadeProps, CheckTagEmits, CheckTagExposed, CheckTagProps, CheckboxButtonEmits, CheckboxButtonProps, CheckboxEmits, CheckboxExposed, CheckboxGroupEmits, CheckboxGroupExposed, CheckboxGroupProps, CheckboxProps, CodeEditorEmits, CodeEditorExposed, CodeEditorLang, CodeEditorProps, CollapseEmits, CollapseItemEmits, CollapseItemProps, CollapseModelValue, CollapseProps, CollapseValue, ConditionConnector, ConditionEditorEmits, ConditionEditorExposed, ConditionEditorProps, ConditionExpression, ConditionField, ConditionGroup, ConditionLeaf, ConditionNode, ConditionValue, ContextmenuEmits, ContextmenuExposed, ContextmenuItem, ContextmenuProps, CssTransitionEmits, CssTransitionExposed, CssTransitionProps, DatePanelEmits, DatePanelProps, DatePickerDataType, DatePickerEmits, DatePickerExposed, DatePickerProps, DateRangePickerDataType, DateRangePickerEmits, DateRangePickerExposed, DateRangePickerProps, DateRangeValue, DescriptionsItemProps, DescriptionsLayout, DescriptionsProps, DialogEmits, DialogExposed, DialogProps, DialogTransition, DividerEmits, DividerProps, DrawerDirection, DrawerEmits, DrawerExposed, DrawerMode, DrawerProps, DropdownEmits, DropdownExposed, DropdownProps, DualNavEmits, DualNavExposed, DualNavProps, DualNavRailVariant, DualNavRootItem, EmptyEmits, EmptyExposed, EmptyProps, ExpressionEditorEmits, ExpressionEditorExposed, ExpressionEditorProps, ExpressionSelectableLevels, FileViewerEmits, FileViewerExposed, FileViewerItem, FileViewerKind, FileViewerNormalizedItem, FileViewerProps, FloatButtonEmits, FloatButtonExposed, FloatButtonItem, FloatButtonProps, FormEmits, FormExposed, FormItemEmits, FormItemExposed, FormItemProps, FormProps, GanttChartEmits, GanttChartExposed, GanttChartProps, GridEmits, GridExposed, GridInputEmits, GridInputExposed, GridInputProps, GridItemProps, GridProps, GroupInputEmits, GroupInputExposed, GroupInputProps, GroupNavEmits, GroupNavGroup, GroupNavProps, IconEmits, IconExposed, IconProps, ImageCropperChangePayload, ImageCropperCropTransform, ImageCropperEmits, ImageCropperExposed, ImageCropperProps, ImageCropperResult, ImageCropperResultOptions, ImageCropperSelection, InputEmits, InputExposed, InputProps, KanbanColumnItem, KanbanEmits, KanbanExposed, KanbanProps, KanbanSlots, LayoutEmits, LayoutExposed, LayoutProps, ListEmits, ListExposed, ListProps, LoadingEmits, LoadingExposed, LoadingProps, LoadingType, Message, MessageConfirm, MessageConfirmAction, MessageConfirmEmits, MessageConfirmExposed, MessageConfirmInstance, MessageConfirmOptions, MessageConfirmProps, MessageEmits, MessageExposed, MessageInstance, MessageOptions, MessageProps, MessageType, MultiAutoCompleteEmits, MultiAutoCompleteExposed, MultiAutoCompleteProps, MultiSelectEmits, MultiSelectExposed, MultiSelectProps, MultiTreeSelectEmits, MultiTreeSelectExposed, MultiTreeSelectProps, NavEmits, NavExposed, NavItem, NavProps, NodeRenderExposed, NodeRenderProps, Notification, NotificationEmits, NotificationExposed, NotificationInstance, NotificationOptions, NotificationPosition, NotificationProps, NumberEmits, NumberExposed, NumberInputEmits, NumberInputExposed, NumberInputProps, NumberProps, NumberRangeInputEmits, NumberRangeInputExposed, NumberRangeInputProps, NumberRangeTuple, PaginatorEmits, PaginatorExposed, PaginatorProps, PaletteColorType, PaletteEmits, PaletteExposed, PaletteHSV, PaletteProps, PaletteRGB, PanelItem, PanelType, PasswordInputEmits, PasswordInputExposed, PasswordInputProps, PopConfirmEmits, PopConfirmExposed, PopConfirmProps, PopEmits, PopExposed, PopProps, ProgressEmits, ProgressExposed, ProgressNodesEmits, ProgressNodesExposed, ProgressNodesProps, ProgressProps, QuickBatchEditEmits, QuickBatchEditExposed, QuickBatchEditProps, RadioEmits, RadioExposed, RadioGroupEmits, RadioGroupExposed, RadioGroupProps, RadioProps, RateEmits, RateExposed, RateProps, RichTextEditorEmits, RichTextEditorExposed, RichTextEditorProps, RichTextFormat, RichTextImageUploader, ScrollEmits, ScrollExposed, ScrollPosition, ScrollProps, SegmentEmits, SegmentExposed, SegmentItem, SegmentProps, SelectEmits, SelectExposed, SelectProps, SkeletonEmits, SkeletonProps, SliderEmits, SliderExposed, SliderProps, SpaceEmits, SpaceProps, StepsEmits, StepsExposed, StepsProps, StepsSlotScope, SwitchEmits, SwitchExposed, SwitchProps, TabItem, TableColumn, TableColumnAlign, TableColumnNode, TableColumnRenderContext, TableColumnSlotsScope, TableColumnStyle, TableEditorColumn, TableEditorEmits, TableEditorExposed, TableEditorProps, TableEmits, TableExposed, TableProps, TableRow, TableRowSlotsScope, TableSummaryContext, TabsEmits, TabsExposed, TabsHorizontalEmits, TabsHorizontalExposed, TabsHorizontalProps, TabsProps, TabsVerticalEmits, TabsVerticalExposed, TabsVerticalProps, TagEmits, TagExposed, TagProps, TextEditorEmits, TextEditorExposed, TextEditorProps, TextEmits, TextExposed, TextProps, TextareaEmits, TextareaExposed, TextareaProps, ThemeExposed, ThemeProps, TimePickerDataType, TimePickerEmits, TimePickerExposed, TimePickerProps, TimelineItemColor, TimelineItemProps, TimelineProps, TipAlign, TipDirection, TipEmits, TipExposed, TipProps, TipType, ToolbarItem, TransferDirection, TransferEmits, TransferExposed, TransferOption, TransferProps, TreeEmit, TreeExposed, TreeNode, TreeNodeProps, TreeProps, TreeSelectEmits, TreeSelectExposed, TreeSelectProps, UploaderEmits, UploaderExposed, UploaderProps, VariableItem, WatermarkEmits, WatermarkExposed, WatermarkProps, _ActionExposed, _ActionGroupExposed, _AlertExposed, _AnchorExposed, _AnimationExposed, _AutoCompleteExposed, _AvatarExposed, _BackTopExposed, _BadgeExposed, _BatchEditExposed, _BreadcrumbExposed, _ButtonExposed, _CalendarExposed, _CardExposed, _CascadeExposed, _CheckTagExposed, _CodeEditorExposed, _ConditionEditorExposed, _ContextmenuExposed, _CssTransitionExposed, _DatePickerExposed, _DateRangePickerExposed, _DialogExposed, _DrawerExposed, _DropdownExposed, _DualNavExposed, _EmptyExposed, _ExpressionEditorExposed, _FileViewerExposed, _FloatButtonExposed, _FormExposed, _GanttChartExposed, _GridExposed, _GridInputExposed, _GroupInputExposed, _ImageCropperExposed, _InputExposed, _KanbanExposed, _LayoutExposed, _ListExposed, _LoadingExposed, _MessageConfirmExposed, _MessageExposed, _MultiAutoCompleteExposed, _MultiSelectExposed, _MultiTreeSelectExposed, _NavExposed, _NotificationExposed, _PaginatorExposed, _PaletteExposed, _PasswordInputExposed, _PopConfirmExposed, _PopExposed, _ProgressExposed, _ProgressNodesExposed, _QuickBatchEditExposed, _RadioExposed, _RadioGroupExposed, _RateExposed, _RichTextEditorExposed, _ScrollExposed, _SegmentExposed, _SelectExposed, _SliderExposed, _StepsExposed, _SwitchExposed, _TableEditorExposed, _TableExposed, _TabsExposed, _TabsHorizontalExposed, _TabsVerticalExposed, _TextEditorExposed, _TextExposed, _TextareaExposed, _ThemeExposed, _TimePickerExposed, _TipExposed, _TransferExposed, _TreeExposed, _TreeSelectExposed, _UploaderExposed, _WatermarkExposed };
|
|
100
|
+
export { ActionEmits, ActionExposed, ActionGroupExposed, ActionGroupProps, ActionProps, AiButtonEmits, AiButtonExposed, AiButtonProps, AiButtonVariant, AlertEmits, AlertExposed, AlertProps, AlertType, AnchorEmits, AnchorExposed, AnchorItemProps, AnchorProps, AnimationEmits, AnimationExposed, AnimationProps, AutoCompleteEmits, AutoCompleteExposed, AutoCompleteProps, AvatarEmits, AvatarExposed, AvatarGroupProps, AvatarProps, AvatarShape, BackTopEmits, BackTopExposed, BackTopProps, BadgeEmits, BadgeExposed, BadgeProps, BarType, BatchEditColumn, BatchEditEmits, BatchEditExposed, BatchEditFeature, BatchEditProps, BatchEditSlots, BatchEditStates, BreadcrumbEmits, BreadcrumbExposed, BreadcrumbItem, BreadcrumbProps, BreadcrumbSlotScope, BreakCols, Breakpoint, ButtonEmits, ButtonExposed, ButtonProps, ButtonType, CalendarDay, CalendarEmits, CalendarExposed, CalendarMonth, CalendarProps, CalendarYear, CardActionProps, CardContentProps, CardCoverProps, CardEmits, CardExposed, CardProps, CarouselEmits, CarouselItemProps, CarouselProps, CascadeEmits, CascadeExposed, CascadeNode, CascadeProps, CheckTagEmits, CheckTagExposed, CheckTagProps, CheckboxButtonEmits, CheckboxButtonProps, CheckboxEmits, CheckboxExposed, CheckboxGroupEmits, CheckboxGroupExposed, CheckboxGroupProps, CheckboxProps, CodeEditorEmits, CodeEditorExposed, CodeEditorLang, CodeEditorProps, CollapseEmits, CollapseItemEmits, CollapseItemProps, CollapseModelValue, CollapseProps, CollapseValue, ConditionConnector, ConditionEditorEmits, ConditionEditorExposed, ConditionEditorProps, ConditionExpression, ConditionField, ConditionGroup, ConditionLeaf, ConditionNode, ConditionValue, ContextmenuEmits, ContextmenuExposed, ContextmenuItem, ContextmenuProps, CssTransitionEmits, CssTransitionExposed, CssTransitionProps, DatePanelEmits, DatePanelProps, DatePickerDataType, DatePickerEmits, DatePickerExposed, DatePickerProps, DateRangePickerDataType, DateRangePickerEmits, DateRangePickerExposed, DateRangePickerProps, DateRangeValue, DescriptionsItemProps, DescriptionsLayout, DescriptionsProps, DialogEmits, DialogExposed, DialogProps, DialogTransition, DividerEmits, DividerProps, DrawerDirection, DrawerEmits, DrawerExposed, DrawerMode, DrawerProps, DropdownEmits, DropdownExposed, DropdownProps, DualNavEmits, DualNavExposed, DualNavProps, DualNavRailVariant, DualNavRootItem, EmptyEmits, EmptyExposed, EmptyProps, ExpressionEditorEmits, ExpressionEditorExposed, ExpressionEditorProps, ExpressionSelectableLevels, FileViewerEmits, FileViewerExposed, FileViewerItem, FileViewerKind, FileViewerNormalizedItem, FileViewerProps, FloatButtonEmits, FloatButtonExposed, FloatButtonItem, FloatButtonProps, FormEmits, FormExposed, FormItemEmits, FormItemExposed, FormItemProps, FormProps, GanttChartEmits, GanttChartExposed, GanttChartProps, GridEmits, GridExposed, GridInputEmits, GridInputExposed, GridInputProps, GridItemProps, GridProps, GroupInputEmits, GroupInputExposed, GroupInputProps, GroupNavEmits, GroupNavGroup, GroupNavProps, IconEmits, IconExposed, IconProps, ImageCropperChangePayload, ImageCropperCropTransform, ImageCropperEmits, ImageCropperExposed, ImageCropperProps, ImageCropperResult, ImageCropperResultOptions, ImageCropperSelection, InputEmits, InputExposed, InputProps, KanbanColumnItem, KanbanEmits, KanbanExposed, KanbanProps, KanbanSlots, LayoutEmits, LayoutExposed, LayoutProps, ListEmits, ListExposed, ListProps, LoadingEmits, LoadingExposed, LoadingProps, LoadingType, Message, MessageConfirm, MessageConfirmAction, MessageConfirmEmits, MessageConfirmExposed, MessageConfirmInstance, MessageConfirmOptions, MessageConfirmProps, MessageEmits, MessageExposed, MessageInstance, MessageOptions, MessageProps, MessageType, MultiAutoCompleteEmits, MultiAutoCompleteExposed, MultiAutoCompleteProps, MultiSelectEmits, MultiSelectExposed, MultiSelectProps, MultiTreeSelectEmits, MultiTreeSelectExposed, MultiTreeSelectProps, NavEmits, NavExposed, NavItem, NavProps, NodeRenderExposed, NodeRenderProps, Notification, NotificationEmits, NotificationExposed, NotificationInstance, NotificationOptions, NotificationPosition, NotificationProps, NumberEmits, NumberExposed, NumberInputEmits, NumberInputExposed, NumberInputProps, NumberProps, NumberRangeInputEmits, NumberRangeInputExposed, NumberRangeInputProps, NumberRangeTuple, PaginatorEmits, PaginatorExposed, PaginatorProps, PaletteColorType, PaletteEmits, PaletteExposed, PaletteHSV, PaletteProps, PaletteRGB, PanelItem, PanelType, PasswordInputEmits, PasswordInputExposed, PasswordInputProps, PopConfirmEmits, PopConfirmExposed, PopConfirmProps, PopEmits, PopExposed, PopProps, ProgressEmits, ProgressExposed, ProgressNodesEmits, ProgressNodesExposed, ProgressNodesProps, ProgressProps, QuickBatchEditEmits, QuickBatchEditExposed, QuickBatchEditProps, RadioEmits, RadioExposed, RadioGroupEmits, RadioGroupExposed, RadioGroupProps, RadioProps, RateEmits, RateExposed, RateProps, RichTextEditorEmits, RichTextEditorExposed, RichTextEditorProps, RichTextFormat, RichTextImageUploader, ScrollEmits, ScrollExposed, ScrollPosition, ScrollProps, SegmentEmits, SegmentExposed, SegmentItem, SegmentProps, SelectEmits, SelectExposed, SelectProps, SkeletonEmits, SkeletonProps, SliderEmits, SliderExposed, SliderProps, SpaceEmits, SpaceProps, StepsEmits, StepsExposed, StepsProps, StepsSlotScope, SwitchEmits, SwitchExposed, SwitchProps, TabItem, TableColumn, TableColumnAlign, TableColumnNode, TableColumnRenderContext, TableColumnSlotsScope, TableColumnStyle, TableEditorColumn, TableEditorEmits, TableEditorExposed, TableEditorProps, TableEmits, TableExposed, TableProps, TableRow, TableRowSlotsScope, TableSummaryContext, TabsEmits, TabsExposed, TabsHorizontalEmits, TabsHorizontalExposed, TabsHorizontalProps, TabsProps, TabsVerticalEmits, TabsVerticalExposed, TabsVerticalProps, TagEmits, TagExposed, TagProps, TextEditorEmits, TextEditorExposed, TextEditorProps, TextEmits, TextExposed, TextProps, TextareaEmits, TextareaExposed, TextareaProps, ThemeExposed, ThemeProps, TimePickerDataType, TimePickerEmits, TimePickerExposed, TimePickerProps, TimelineItemColor, TimelineItemProps, TimelineProps, TipAlign, TipDirection, TipEmits, TipExposed, TipProps, TipType, ToolbarItem, TransferDirection, TransferEmits, TransferExposed, TransferOption, TransferProps, TreeEmit, TreeExposed, TreeNode, TreeNodeProps, TreeProps, TreeSelectEmits, TreeSelectExposed, TreeSelectProps, UploaderEmits, UploaderExposed, UploaderProps, VariableItem, WatermarkEmits, WatermarkExposed, WatermarkProps, _ActionExposed, _ActionGroupExposed, _AiButtonExposed, _AlertExposed, _AnchorExposed, _AnimationExposed, _AutoCompleteExposed, _AvatarExposed, _BackTopExposed, _BadgeExposed, _BatchEditExposed, _BreadcrumbExposed, _ButtonExposed, _CalendarExposed, _CardExposed, _CascadeExposed, _CheckTagExposed, _CodeEditorExposed, _ConditionEditorExposed, _ContextmenuExposed, _CssTransitionExposed, _DatePickerExposed, _DateRangePickerExposed, _DialogExposed, _DrawerExposed, _DropdownExposed, _DualNavExposed, _EmptyExposed, _ExpressionEditorExposed, _FileViewerExposed, _FloatButtonExposed, _FormExposed, _GanttChartExposed, _GridExposed, _GridInputExposed, _GroupInputExposed, _ImageCropperExposed, _InputExposed, _KanbanExposed, _LayoutExposed, _ListExposed, _LoadingExposed, _MessageConfirmExposed, _MessageExposed, _MultiAutoCompleteExposed, _MultiSelectExposed, _MultiTreeSelectExposed, _NavExposed, _NotificationExposed, _PaginatorExposed, _PaletteExposed, _PasswordInputExposed, _PopConfirmExposed, _PopExposed, _ProgressExposed, _ProgressNodesExposed, _QuickBatchEditExposed, _RadioExposed, _RadioGroupExposed, _RateExposed, _RichTextEditorExposed, _ScrollExposed, _SegmentExposed, _SelectExposed, _SliderExposed, _StepsExposed, _SwitchExposed, _TableEditorExposed, _TableExposed, _TabsExposed, _TabsHorizontalExposed, _TabsVerticalExposed, _TextEditorExposed, _TextExposed, _TextareaExposed, _ThemeExposed, _TimePickerExposed, _TipExposed, _TransferExposed, _TreeExposed, _TreeSelectExposed, _UploaderExposed, _WatermarkExposed };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltra/desktop",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"homepage": "https://github.com/cabinet-fe/ultra-ui#readme",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/cabinet-fe/ultra-ui/issues"
|
|
@@ -48,33 +48,33 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@lexical/history": "^0.
|
|
52
|
-
"@lexical/html": "^0.
|
|
53
|
-
"@lexical/link": "^0.
|
|
54
|
-
"@lexical/list": "^0.
|
|
55
|
-
"@lexical/rich-text": "^0.
|
|
56
|
-
"@lexical/selection": "^0.
|
|
57
|
-
"@lexical/utils": "^0.
|
|
51
|
+
"@lexical/history": "^0.52.0",
|
|
52
|
+
"@lexical/html": "^0.52.0",
|
|
53
|
+
"@lexical/link": "^0.52.0",
|
|
54
|
+
"@lexical/list": "^0.52.0",
|
|
55
|
+
"@lexical/rich-text": "^0.52.0",
|
|
56
|
+
"@lexical/selection": "^0.52.0",
|
|
57
|
+
"@lexical/utils": "^0.52.0",
|
|
58
58
|
"docx-preview": "^0.4.1",
|
|
59
|
-
"infinitable": "^0.1.
|
|
60
|
-
"lexical": "^0.
|
|
59
|
+
"infinitable": "^0.1.7",
|
|
60
|
+
"lexical": "^0.52.0",
|
|
61
61
|
"pdfjs-dist": "6.4.299"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@codemirror/autocomplete": "6.20.3",
|
|
65
|
-
"@codemirror/commands": "6.11.
|
|
65
|
+
"@codemirror/commands": "6.11.1",
|
|
66
66
|
"@codemirror/lang-java": "6.0.2",
|
|
67
67
|
"@codemirror/lang-javascript": "6.2.5",
|
|
68
68
|
"@codemirror/lang-json": "6.0.2",
|
|
69
69
|
"@codemirror/lang-markdown": "6.5.2",
|
|
70
70
|
"@codemirror/lang-sql": "6.10.0",
|
|
71
|
-
"@codemirror/language": "6.
|
|
72
|
-
"@codemirror/legacy-modes": "6.5.
|
|
71
|
+
"@codemirror/language": "6.13.1",
|
|
72
|
+
"@codemirror/legacy-modes": "6.5.5",
|
|
73
73
|
"@codemirror/lint": "6.9.7",
|
|
74
|
-
"@codemirror/search": "6.7.
|
|
75
|
-
"@codemirror/state": "6.7.
|
|
74
|
+
"@codemirror/search": "6.7.2",
|
|
75
|
+
"@codemirror/state": "6.7.6",
|
|
76
76
|
"@codemirror/theme-one-dark": "6.1.3",
|
|
77
|
-
"@codemirror/view": "6.43.
|
|
77
|
+
"@codemirror/view": "6.43.14",
|
|
78
78
|
"@veltra/ofd-core": "1.0.1"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { useConfig } from '@veltra/compositions'
|
|
2
|
+
import type { AiProviderConfig } from '@veltra/utils'
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vite-plus/test'
|
|
4
|
+
import { createApp, h, nextTick } from 'vue'
|
|
5
|
+
|
|
6
|
+
import UAiButton from '../ai-button.vue'
|
|
7
|
+
|
|
8
|
+
const { setConfig } = useConfig()
|
|
9
|
+
|
|
10
|
+
/** useConfig 的 ai 是模块级全局状态,测后复位避免污染其它用例 */
|
|
11
|
+
function resetAiConfig() {
|
|
12
|
+
setConfig({
|
|
13
|
+
ai: {
|
|
14
|
+
url: undefined,
|
|
15
|
+
apiKey: undefined,
|
|
16
|
+
model: undefined,
|
|
17
|
+
reasoningLevel: undefined,
|
|
18
|
+
stream: undefined
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function provider(overrides: Partial<AiProviderConfig> = {}): Partial<AiProviderConfig> {
|
|
24
|
+
return {
|
|
25
|
+
url: 'https://api.example.com/v1/chat/completions',
|
|
26
|
+
apiKey: 'sk-test',
|
|
27
|
+
model: 'gpt-x',
|
|
28
|
+
...overrides
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function jsonResponse(text: string): Response {
|
|
33
|
+
return new Response(
|
|
34
|
+
JSON.stringify({ choices: [{ message: { role: 'assistant', content: text } }] }),
|
|
35
|
+
{ status: 200, headers: { 'Content-Type': 'application/json' } }
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function sseResponse(sse: string): Response {
|
|
40
|
+
return new Response(sse, { status: 200, headers: { 'Content-Type': 'text/event-stream' } })
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function deferred<T>() {
|
|
44
|
+
let resolve!: (value: T) => void
|
|
45
|
+
const promise = new Promise<T>((r) => {
|
|
46
|
+
resolve = r
|
|
47
|
+
})
|
|
48
|
+
return { promise, resolve }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function mountAiButton(
|
|
52
|
+
props: Record<string, unknown> = {},
|
|
53
|
+
slots: Record<string, () => unknown> = {}
|
|
54
|
+
) {
|
|
55
|
+
const host = document.createElement('div')
|
|
56
|
+
document.body.appendChild(host)
|
|
57
|
+
|
|
58
|
+
const app = createApp({ render: () => h(UAiButton, props, slots) })
|
|
59
|
+
app.mount(host)
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
host,
|
|
63
|
+
button: host.querySelector('button')!,
|
|
64
|
+
unmount() {
|
|
65
|
+
app.unmount()
|
|
66
|
+
host.remove()
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function click(el: Element) {
|
|
72
|
+
el.dispatchEvent(new MouseEvent('click', { bubbles: true }))
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function requestBody(fetchMock: ReturnType<typeof vi.fn>, nth = 1): Record<string, any> {
|
|
76
|
+
return JSON.parse(String(fetchMock.mock.calls[nth - 1]![1]!.body))
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
beforeEach(() => {
|
|
80
|
+
// happy-dom 中 offsetWidth/offsetHeight 恒为 0,模拟尺寸供 usePop 定位
|
|
81
|
+
vi.spyOn(HTMLElement.prototype, 'offsetWidth', 'get').mockReturnValue(200)
|
|
82
|
+
vi.spyOn(HTMLElement.prototype, 'offsetHeight', 'get').mockReturnValue(200)
|
|
83
|
+
|
|
84
|
+
// usePop 的浮层容器是模块级单例,上一个用例清空 body 后需补回 teleport 目标
|
|
85
|
+
if (!document.getElementById('pop-container')) {
|
|
86
|
+
const popContainer = document.createElement('div')
|
|
87
|
+
popContainer.id = 'pop-container'
|
|
88
|
+
document.body.appendChild(popContainer)
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
afterEach(() => {
|
|
93
|
+
vi.unstubAllGlobals()
|
|
94
|
+
vi.restoreAllMocks()
|
|
95
|
+
resetAiConfig()
|
|
96
|
+
document.body.innerHTML = ''
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
describe('UAiButton 普通变体', () => {
|
|
100
|
+
it('点击按 OpenAI 兼容协议 POST 配置 url,请求体组装 model/stream/messages,成功触发 success 完整文本', async () => {
|
|
101
|
+
const fetchMock = vi.fn(async () => jsonResponse('完整答案'))
|
|
102
|
+
vi.stubGlobal('fetch', fetchMock)
|
|
103
|
+
const onSuccess = vi.fn()
|
|
104
|
+
const onError = vi.fn()
|
|
105
|
+
|
|
106
|
+
const { button, unmount } = mountAiButton({
|
|
107
|
+
provider: provider({ model: 'gpt-x' }),
|
|
108
|
+
systemPrompt: 'sys',
|
|
109
|
+
prompt: 'hi',
|
|
110
|
+
onSuccess,
|
|
111
|
+
onError
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
try {
|
|
115
|
+
click(button)
|
|
116
|
+
await vi.waitFor(() => expect(onSuccess).toHaveBeenCalledWith('完整答案'))
|
|
117
|
+
expect(onError).not.toHaveBeenCalled()
|
|
118
|
+
|
|
119
|
+
expect(fetchMock).toHaveBeenCalledTimes(1)
|
|
120
|
+
expect(fetchMock.mock.calls[0]![0]).toBe('https://api.example.com/v1/chat/completions')
|
|
121
|
+
expect(requestBody(fetchMock)).toMatchObject({
|
|
122
|
+
model: 'gpt-x',
|
|
123
|
+
stream: false,
|
|
124
|
+
messages: [
|
|
125
|
+
{ role: 'system', content: 'sys' },
|
|
126
|
+
{ role: 'user', content: 'hi' }
|
|
127
|
+
]
|
|
128
|
+
})
|
|
129
|
+
} finally {
|
|
130
|
+
unmount()
|
|
131
|
+
}
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
it('流式:增量逐段触发 delta,结束后 success 为拼接完整文本', async () => {
|
|
135
|
+
const sse =
|
|
136
|
+
'data: {"choices":[{"delta":{"content":"He"}}]}\n\n' +
|
|
137
|
+
'data: {"choices":[{"delta":{"content":"llo"}}]}\n\n' +
|
|
138
|
+
'data: [DONE]\n\n'
|
|
139
|
+
const fetchMock = vi.fn(async () => sseResponse(sse))
|
|
140
|
+
vi.stubGlobal('fetch', fetchMock)
|
|
141
|
+
const onDelta = vi.fn()
|
|
142
|
+
const onSuccess = vi.fn()
|
|
143
|
+
|
|
144
|
+
const { button, unmount } = mountAiButton({
|
|
145
|
+
provider: provider({ stream: true }),
|
|
146
|
+
prompt: 'hi',
|
|
147
|
+
onDelta,
|
|
148
|
+
onSuccess
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
try {
|
|
152
|
+
click(button)
|
|
153
|
+
await vi.waitFor(() => expect(onSuccess).toHaveBeenCalled())
|
|
154
|
+
|
|
155
|
+
expect(onDelta).toHaveBeenNthCalledWith(1, 'He')
|
|
156
|
+
expect(onDelta).toHaveBeenNthCalledWith(2, 'llo')
|
|
157
|
+
expect(onSuccess).toHaveBeenCalledWith('Hello')
|
|
158
|
+
expect(requestBody(fetchMock).stream).toBe(true)
|
|
159
|
+
} finally {
|
|
160
|
+
unmount()
|
|
161
|
+
}
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
it('失败触发 error(Error 载荷),不触发 success', async () => {
|
|
165
|
+
vi.stubGlobal(
|
|
166
|
+
'fetch',
|
|
167
|
+
vi
|
|
168
|
+
.fn()
|
|
169
|
+
.mockRejectedValueOnce(new TypeError('network down'))
|
|
170
|
+
.mockResolvedValueOnce(new Response('boom', { status: 500 }))
|
|
171
|
+
)
|
|
172
|
+
const onSuccess = vi.fn()
|
|
173
|
+
const onError = vi.fn()
|
|
174
|
+
|
|
175
|
+
const { button, unmount } = mountAiButton({
|
|
176
|
+
provider: provider(),
|
|
177
|
+
prompt: 'hi',
|
|
178
|
+
onSuccess,
|
|
179
|
+
onError
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
try {
|
|
183
|
+
click(button)
|
|
184
|
+
await vi.waitFor(() => expect(onError).toHaveBeenCalledTimes(1))
|
|
185
|
+
expect(onError).toHaveBeenNthCalledWith(1, expect.any(Error))
|
|
186
|
+
|
|
187
|
+
click(button)
|
|
188
|
+
await vi.waitFor(() => expect(onError).toHaveBeenCalledTimes(2))
|
|
189
|
+
expect(onSuccess).not.toHaveBeenCalled()
|
|
190
|
+
} finally {
|
|
191
|
+
unmount()
|
|
192
|
+
}
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
it('生成中按钮 loading 并忽略重复点击,结束后恢复可点', async () => {
|
|
196
|
+
const pending = deferred<Response>()
|
|
197
|
+
const fetchMock = vi.fn(() => pending.promise)
|
|
198
|
+
vi.stubGlobal('fetch', fetchMock)
|
|
199
|
+
const onSuccess = vi.fn()
|
|
200
|
+
|
|
201
|
+
const { button, unmount } = mountAiButton({ provider: provider(), prompt: 'hi', onSuccess })
|
|
202
|
+
|
|
203
|
+
try {
|
|
204
|
+
click(button)
|
|
205
|
+
await nextTick()
|
|
206
|
+
expect(fetchMock).toHaveBeenCalledTimes(1)
|
|
207
|
+
expect(button.classList.contains('is-loading')).toBe(true)
|
|
208
|
+
|
|
209
|
+
click(button)
|
|
210
|
+
click(button)
|
|
211
|
+
expect(fetchMock).toHaveBeenCalledTimes(1)
|
|
212
|
+
|
|
213
|
+
pending.resolve(jsonResponse('ok'))
|
|
214
|
+
await vi.waitFor(() => expect(onSuccess).toHaveBeenCalledWith('ok'))
|
|
215
|
+
await nextTick()
|
|
216
|
+
expect(button.classList.contains('is-loading')).toBe(false)
|
|
217
|
+
|
|
218
|
+
click(button)
|
|
219
|
+
expect(fetchMock).toHaveBeenCalledTimes(2)
|
|
220
|
+
} finally {
|
|
221
|
+
unmount()
|
|
222
|
+
}
|
|
223
|
+
})
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
describe('UAiButton 配置优先级', () => {
|
|
227
|
+
it('实例 provider 字段 > 全局 ai 字段 > 默认值(stream 缺省 false)', async () => {
|
|
228
|
+
setConfig({
|
|
229
|
+
ai: {
|
|
230
|
+
url: 'https://global.example.com/v1/chat/completions',
|
|
231
|
+
apiKey: 'sk-global',
|
|
232
|
+
model: 'g-global'
|
|
233
|
+
}
|
|
234
|
+
})
|
|
235
|
+
const fetchMock = vi.fn(async () => jsonResponse('ok'))
|
|
236
|
+
vi.stubGlobal('fetch', fetchMock)
|
|
237
|
+
const onSuccess = vi.fn()
|
|
238
|
+
|
|
239
|
+
// 组件 A:无 provider,全量走全局配置
|
|
240
|
+
const a = mountAiButton({ prompt: 'a', onSuccess })
|
|
241
|
+
// 组件 B:共用全局配置,仅实例覆盖 model 并开流式
|
|
242
|
+
const sse = 'data: {"choices":[{"delta":{"content":"B"}}]}\n\ndata: [DONE]\n\n'
|
|
243
|
+
fetchMock.mockResolvedValueOnce(jsonResponse('ok')).mockResolvedValueOnce(sseResponse(sse))
|
|
244
|
+
const onDelta = vi.fn()
|
|
245
|
+
const b = mountAiButton({
|
|
246
|
+
prompt: 'b',
|
|
247
|
+
provider: { model: 'g-instance', stream: true },
|
|
248
|
+
onDelta,
|
|
249
|
+
onSuccess
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
try {
|
|
253
|
+
click(a.button)
|
|
254
|
+
await vi.waitFor(() => expect(onSuccess).toHaveBeenCalledTimes(1))
|
|
255
|
+
click(b.button)
|
|
256
|
+
await vi.waitFor(() => expect(onSuccess).toHaveBeenCalledTimes(2))
|
|
257
|
+
|
|
258
|
+
const bodyA = requestBody(fetchMock, 1)
|
|
259
|
+
expect(fetchMock.mock.calls[0]![0]).toBe('https://global.example.com/v1/chat/completions')
|
|
260
|
+
expect(bodyA.model).toBe('g-global')
|
|
261
|
+
expect(bodyA.stream).toBe(false)
|
|
262
|
+
expect(fetchMock.mock.calls[0]![1]!.headers).toMatchObject({
|
|
263
|
+
Authorization: 'Bearer sk-global'
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
const bodyB = requestBody(fetchMock, 2)
|
|
267
|
+
expect(bodyB.model).toBe('g-instance')
|
|
268
|
+
expect(bodyB.stream).toBe(true)
|
|
269
|
+
expect(onDelta).toHaveBeenCalledWith('B')
|
|
270
|
+
} finally {
|
|
271
|
+
a.unmount()
|
|
272
|
+
b.unmount()
|
|
273
|
+
}
|
|
274
|
+
})
|
|
275
|
+
|
|
276
|
+
it('无全局配置时仅实例 provider 也可用,stream 默认 false', async () => {
|
|
277
|
+
const fetchMock = vi.fn(async () => jsonResponse('ok'))
|
|
278
|
+
vi.stubGlobal('fetch', fetchMock)
|
|
279
|
+
const onSuccess = vi.fn()
|
|
280
|
+
|
|
281
|
+
const { button, unmount } = mountAiButton({ prompt: 'hi', provider: provider(), onSuccess })
|
|
282
|
+
|
|
283
|
+
try {
|
|
284
|
+
click(button)
|
|
285
|
+
await vi.waitFor(() => expect(onSuccess).toHaveBeenCalled())
|
|
286
|
+
expect(requestBody(fetchMock).stream).toBe(false)
|
|
287
|
+
} finally {
|
|
288
|
+
unmount()
|
|
289
|
+
}
|
|
290
|
+
})
|
|
291
|
+
})
|
|
292
|
+
|
|
293
|
+
describe('UAiButton pre-input 变体', () => {
|
|
294
|
+
function findBubble() {
|
|
295
|
+
return document.body.querySelector<HTMLElement>('.u-ai-button__main')
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function findActionButtons(): HTMLButtonElement[] {
|
|
299
|
+
return Array.from(
|
|
300
|
+
document.body.querySelectorAll<HTMLButtonElement>('.u-ai-button__action button')
|
|
301
|
+
)
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function mountPreInput(extra: Record<string, unknown> = {}) {
|
|
305
|
+
return mountAiButton(
|
|
306
|
+
{ variant: 'pre-input', prompt: 'hi', provider: provider(), ...extra },
|
|
307
|
+
{ 'pre-input': () => h('div', { class: 'pre-slot' }, '补充输入') }
|
|
308
|
+
)
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** 等待 usePop 打开气泡时的异步定位(含 resize 触发的一轮)落地,避免关闭后回调访问已销毁元素 */
|
|
312
|
+
async function openBubble(button: HTMLButtonElement) {
|
|
313
|
+
click(button)
|
|
314
|
+
await nextTick()
|
|
315
|
+
await nextTick()
|
|
316
|
+
await new Promise((resolve) => setTimeout(resolve, 20))
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
it('点击展开气泡:#pre-input 插槽与内置确认/取消按钮', async () => {
|
|
320
|
+
const { button, unmount } = mountPreInput()
|
|
321
|
+
|
|
322
|
+
try {
|
|
323
|
+
await openBubble(button)
|
|
324
|
+
|
|
325
|
+
expect(findBubble()).not.toBeNull()
|
|
326
|
+
expect(document.body.querySelector('.pre-slot')?.textContent).toBe('补充输入')
|
|
327
|
+
expect(findActionButtons().map((b) => b.textContent?.trim())).toEqual(['取消', '确认'])
|
|
328
|
+
} finally {
|
|
329
|
+
unmount()
|
|
330
|
+
}
|
|
331
|
+
})
|
|
332
|
+
|
|
333
|
+
it('点击按钮本身不发请求,确认后关闭气泡并发起请求', async () => {
|
|
334
|
+
const fetchMock = vi.fn(async () => jsonResponse('ok'))
|
|
335
|
+
vi.stubGlobal('fetch', fetchMock)
|
|
336
|
+
const onConfirm = vi.fn()
|
|
337
|
+
const onSuccess = vi.fn()
|
|
338
|
+
|
|
339
|
+
const { button, unmount } = mountPreInput({ onConfirm, onSuccess })
|
|
340
|
+
|
|
341
|
+
try {
|
|
342
|
+
await openBubble(button)
|
|
343
|
+
expect(fetchMock).not.toHaveBeenCalled()
|
|
344
|
+
|
|
345
|
+
click(findActionButtons()[1]!)
|
|
346
|
+
expect(onConfirm).toHaveBeenCalledTimes(1)
|
|
347
|
+
await vi.waitFor(() => expect(findBubble()).toBeNull())
|
|
348
|
+
await vi.waitFor(() => expect(onSuccess).toHaveBeenCalledWith('ok'))
|
|
349
|
+
expect(fetchMock).toHaveBeenCalledTimes(1)
|
|
350
|
+
} finally {
|
|
351
|
+
unmount()
|
|
352
|
+
}
|
|
353
|
+
})
|
|
354
|
+
|
|
355
|
+
it('取消后关闭气泡且不发请求', async () => {
|
|
356
|
+
const fetchMock = vi.fn(async () => jsonResponse('ok'))
|
|
357
|
+
vi.stubGlobal('fetch', fetchMock)
|
|
358
|
+
const onCancel = vi.fn()
|
|
359
|
+
const onSuccess = vi.fn()
|
|
360
|
+
|
|
361
|
+
const { button, unmount } = mountPreInput({ onCancel, onSuccess })
|
|
362
|
+
|
|
363
|
+
try {
|
|
364
|
+
await openBubble(button)
|
|
365
|
+
|
|
366
|
+
click(findActionButtons()[0]!)
|
|
367
|
+
expect(onCancel).toHaveBeenCalledTimes(1)
|
|
368
|
+
await vi.waitFor(() => expect(findBubble()).toBeNull())
|
|
369
|
+
expect(fetchMock).not.toHaveBeenCalled()
|
|
370
|
+
expect(onSuccess).not.toHaveBeenCalled()
|
|
371
|
+
} finally {
|
|
372
|
+
unmount()
|
|
373
|
+
}
|
|
374
|
+
})
|
|
375
|
+
})
|