@kg-ui/kg-ui-plus 0.0.2 → 0.0.4

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.
Files changed (57) hide show
  1. package/README.md +3 -3
  2. package/dist/es/KgCopilot/CopiContent/AnswerHead.vue.mjs +2 -2
  3. package/dist/es/KgCopilot/CopiContent/AnswerHead.vue2.mjs +2 -2
  4. package/dist/es/KgCopilot/CopiContent/UserHead.vue.mjs +2 -2
  5. package/dist/es/KgCopilot/CopiContent/UserHead.vue2.mjs +2 -2
  6. package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue.mjs +1 -1
  7. package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue2.mjs +1 -1
  8. package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue3.mjs +2 -2
  9. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue.mjs +1 -1
  10. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue3.mjs +2 -2
  11. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue.mjs +1 -1
  12. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue3.mjs +2 -2
  13. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue.mjs +1 -1
  14. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue2.mjs +1 -1
  15. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue3.mjs +2 -2
  16. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue.mjs +1 -1
  17. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue2.mjs +1 -1
  18. package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue3.mjs +2 -2
  19. package/dist/es/KgCopilot/CopiFooter/index.vue.mjs +1 -1
  20. package/dist/es/KgCopilot/CopiFooter/index.vue3.mjs +2 -2
  21. package/dist/es/KgCopilot/dialogue/index.vue.mjs +7 -0
  22. package/dist/es/KgCopilot/{dialogue.vue2.mjs → dialogue/index.vue2.mjs} +11 -11
  23. package/dist/es/KgCopilot/dialogue/index.vue3.mjs +4 -0
  24. package/dist/es/KgCopilot/{readMd.vue.mjs → dialogue/readMd.vue.mjs} +2 -2
  25. package/dist/es/KgCopilot/{readMd.vue2.mjs → dialogue/readMd.vue2.mjs} +3 -3
  26. package/dist/es/KgCopilot/dialogue/readMd.vue3.mjs +4 -0
  27. package/dist/es/KgCopilot/index.vue.mjs +1 -1
  28. package/dist/es/KgCopilot/index.vue2.mjs +1 -1
  29. package/dist/es/KgCopilot/index.vue3.mjs +2 -2
  30. package/dist/es/api/copilot.mjs +11 -0
  31. package/dist/es/home/LFilter/FilterArea.vue.mjs +1 -1
  32. package/dist/es/home/LFilter/FilterArea.vue2.mjs +1 -1
  33. package/dist/es/home/LFilter/FilterArea.vue3.mjs +2 -2
  34. package/dist/es/home/LFilter/FilterItem.vue.mjs +1 -1
  35. package/dist/es/home/LFilter/FilterItem.vue2.mjs +1 -1
  36. package/dist/es/home/LFilter/FilterItem.vue3.mjs +2 -2
  37. package/dist/es/home/LFilter/FilterItemIcon.vue.mjs +1 -1
  38. package/dist/es/home/LFilter/FilterItemIcon.vue2.mjs +1 -1
  39. package/dist/es/home/LFilter/FilterItemIcon.vue3.mjs +2 -2
  40. package/dist/es/home/LProject/index.vue.mjs +1 -1
  41. package/dist/es/home/LProject/index.vue3.mjs +2 -2
  42. package/dist/es/home/index.vue.mjs +1 -1
  43. package/dist/es/home/index.vue3.mjs +2 -2
  44. package/dist/es/index.mjs +1 -11
  45. package/dist/es/store/modules/copilot.mjs +25 -39
  46. package/dist/es/style.css +1 -1
  47. package/package.json +23 -32
  48. package/dist/es/KgCopilot/dialogue.vue.mjs +0 -7
  49. package/dist/es/KgCopilot/dialogue.vue3.mjs +0 -4
  50. package/dist/es/KgCopilot/readMd.vue3.mjs +0 -4
  51. package/dist/es/ReIcon/index.mjs +0 -11
  52. package/dist/es/ReIcon/src/iconfont.mjs +0 -46
  53. package/dist/es/ReIcon/src/iconifyIconOffline.mjs +0 -30
  54. package/dist/es/ReIcon/src/iconifyIconOnline.mjs +0 -29
  55. package/dist/es/node_modules/.pnpm/@iconify_vue@4.0.0_vue@3.2.45/node_modules/@iconify/vue/dist/iconify.mjs +0 -1702
  56. package/dist/es/node_modules/.pnpm/@iconify_vue@4.0.0_vue@3.2.45/node_modules/@iconify/vue/dist/offline.mjs +0 -436
  57. /package/dist/es/KgCopilot/{mdInCode.mjs → dialogue/mdInCode.mjs} +0 -0
@@ -1,436 +0,0 @@
1
- import { defineComponent, h } from "vue";
2
- const defaultIconDimensions = Object.freeze(
3
- {
4
- left: 0,
5
- top: 0,
6
- width: 16,
7
- height: 16
8
- }
9
- );
10
- const defaultIconTransformations = Object.freeze({
11
- rotate: 0,
12
- vFlip: false,
13
- hFlip: false
14
- });
15
- const defaultIconProps = Object.freeze({
16
- ...defaultIconDimensions,
17
- ...defaultIconTransformations
18
- });
19
- Object.freeze({
20
- ...defaultIconProps,
21
- body: "",
22
- hidden: false
23
- });
24
- ({
25
- provider: "",
26
- aliases: {},
27
- not_found: {},
28
- ...defaultIconDimensions
29
- });
30
- const defaultIconSizeCustomisations = Object.freeze({
31
- width: null,
32
- height: null
33
- });
34
- const defaultIconCustomisations = Object.freeze({
35
- ...defaultIconSizeCustomisations,
36
- ...defaultIconTransformations
37
- });
38
- function mergeCustomisations(defaults, item) {
39
- const result = {
40
- ...defaults
41
- };
42
- for (const key in item) {
43
- const value = item[key];
44
- const valueType = typeof value;
45
- if (key in defaultIconSizeCustomisations) {
46
- if (value === null || value && (valueType === "string" || valueType === "number")) {
47
- result[key] = value;
48
- }
49
- } else if (valueType === typeof result[key]) {
50
- result[key] = key === "rotate" ? value % 4 : value;
51
- }
52
- }
53
- return result;
54
- }
55
- const separator = /[\s,]+/;
56
- function flipFromString(custom, flip) {
57
- flip.split(separator).forEach((str) => {
58
- const value = str.trim();
59
- switch (value) {
60
- case "horizontal":
61
- custom.hFlip = true;
62
- break;
63
- case "vertical":
64
- custom.vFlip = true;
65
- break;
66
- }
67
- });
68
- }
69
- function rotateFromString(value, defaultValue = 0) {
70
- const units = value.replace(/^-?[0-9.]*/, "");
71
- function cleanup(value2) {
72
- while (value2 < 0) {
73
- value2 += 4;
74
- }
75
- return value2 % 4;
76
- }
77
- if (units === "") {
78
- const num = parseInt(value);
79
- return isNaN(num) ? 0 : cleanup(num);
80
- } else if (units !== value) {
81
- let split = 0;
82
- switch (units) {
83
- case "%":
84
- split = 25;
85
- break;
86
- case "deg":
87
- split = 90;
88
- }
89
- if (split) {
90
- let num = parseFloat(value.slice(0, value.length - units.length));
91
- if (isNaN(num)) {
92
- return 0;
93
- }
94
- num = num / split;
95
- return num % 1 === 0 ? cleanup(num) : 0;
96
- }
97
- }
98
- return defaultValue;
99
- }
100
- const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
101
- const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
102
- function calculateSize(size, ratio, precision) {
103
- if (ratio === 1) {
104
- return size;
105
- }
106
- precision = precision || 100;
107
- if (typeof size === "number") {
108
- return Math.ceil(size * ratio * precision) / precision;
109
- }
110
- if (typeof size !== "string") {
111
- return size;
112
- }
113
- const oldParts = size.split(unitsSplit);
114
- if (oldParts === null || !oldParts.length) {
115
- return size;
116
- }
117
- const newParts = [];
118
- let code = oldParts.shift();
119
- let isNumber = unitsTest.test(code);
120
- while (true) {
121
- if (isNumber) {
122
- const num = parseFloat(code);
123
- if (isNaN(num)) {
124
- newParts.push(code);
125
- } else {
126
- newParts.push(Math.ceil(num * ratio * precision) / precision);
127
- }
128
- } else {
129
- newParts.push(code);
130
- }
131
- code = oldParts.shift();
132
- if (code === void 0) {
133
- return newParts.join("");
134
- }
135
- isNumber = !isNumber;
136
- }
137
- }
138
- function iconToSVG(icon, customisations) {
139
- const fullIcon = {
140
- ...defaultIconProps,
141
- ...icon
142
- };
143
- const fullCustomisations = {
144
- ...defaultIconCustomisations,
145
- ...customisations
146
- };
147
- const box = {
148
- left: fullIcon.left,
149
- top: fullIcon.top,
150
- width: fullIcon.width,
151
- height: fullIcon.height
152
- };
153
- let body = fullIcon.body;
154
- [fullIcon, fullCustomisations].forEach((props) => {
155
- const transformations = [];
156
- const hFlip = props.hFlip;
157
- const vFlip = props.vFlip;
158
- let rotation = props.rotate;
159
- if (hFlip) {
160
- if (vFlip) {
161
- rotation += 2;
162
- } else {
163
- transformations.push(
164
- "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
165
- );
166
- transformations.push("scale(-1 1)");
167
- box.top = box.left = 0;
168
- }
169
- } else if (vFlip) {
170
- transformations.push(
171
- "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
172
- );
173
- transformations.push("scale(1 -1)");
174
- box.top = box.left = 0;
175
- }
176
- let tempValue;
177
- if (rotation < 0) {
178
- rotation -= Math.floor(rotation / 4) * 4;
179
- }
180
- rotation = rotation % 4;
181
- switch (rotation) {
182
- case 1:
183
- tempValue = box.height / 2 + box.top;
184
- transformations.unshift(
185
- "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
186
- );
187
- break;
188
- case 2:
189
- transformations.unshift(
190
- "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
191
- );
192
- break;
193
- case 3:
194
- tempValue = box.width / 2 + box.left;
195
- transformations.unshift(
196
- "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
197
- );
198
- break;
199
- }
200
- if (rotation % 2 === 1) {
201
- if (box.left !== box.top) {
202
- tempValue = box.left;
203
- box.left = box.top;
204
- box.top = tempValue;
205
- }
206
- if (box.width !== box.height) {
207
- tempValue = box.width;
208
- box.width = box.height;
209
- box.height = tempValue;
210
- }
211
- }
212
- if (transformations.length) {
213
- body = '<g transform="' + transformations.join(" ") + '">' + body + "</g>";
214
- }
215
- });
216
- const customisationsWidth = fullCustomisations.width;
217
- const customisationsHeight = fullCustomisations.height;
218
- const boxWidth = box.width;
219
- const boxHeight = box.height;
220
- let width;
221
- let height;
222
- if (customisationsWidth === null) {
223
- height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
224
- width = calculateSize(height, boxWidth / boxHeight);
225
- } else {
226
- width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
227
- height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
228
- }
229
- const result = {
230
- attributes: {
231
- width: width.toString(),
232
- height: height.toString(),
233
- viewBox: box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString()
234
- },
235
- body
236
- };
237
- return result;
238
- }
239
- const regex = /\sid="(\S+)"/g;
240
- const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
241
- let counter = 0;
242
- function replaceIDs(body, prefix = randomPrefix) {
243
- const ids = [];
244
- let match;
245
- while (match = regex.exec(body)) {
246
- ids.push(match[1]);
247
- }
248
- if (!ids.length) {
249
- return body;
250
- }
251
- ids.forEach((id) => {
252
- const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
253
- const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
254
- body = body.replace(
255
- new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"),
256
- "$1" + newID + "$3"
257
- );
258
- });
259
- return body;
260
- }
261
- function iconToHTML(body, attributes) {
262
- let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
263
- for (const attr in attributes) {
264
- renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
265
- }
266
- return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
267
- }
268
- function encodeSVGforURL(svg) {
269
- return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
270
- }
271
- function svgToURL(svg) {
272
- return 'url("data:image/svg+xml,' + encodeSVGforURL(svg) + '")';
273
- }
274
- const defaultExtendedIconCustomisations = {
275
- ...defaultIconCustomisations,
276
- inline: false
277
- };
278
- const svgDefaults = {
279
- "xmlns": "http://www.w3.org/2000/svg",
280
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
281
- "aria-hidden": true,
282
- "role": "img"
283
- };
284
- const commonProps = {
285
- display: "inline-block"
286
- };
287
- const monotoneProps = {
288
- backgroundColor: "currentColor"
289
- };
290
- const coloredProps = {
291
- backgroundColor: "transparent"
292
- };
293
- const propsToAdd = {
294
- Image: "var(--svg)",
295
- Repeat: "no-repeat",
296
- Size: "100% 100%"
297
- };
298
- const propsToAddTo = {
299
- webkitMask: monotoneProps,
300
- mask: monotoneProps,
301
- background: coloredProps
302
- };
303
- for (const prefix in propsToAddTo) {
304
- const list = propsToAddTo[prefix];
305
- for (const prop in propsToAdd) {
306
- list[prefix + prop] = propsToAdd[prop];
307
- }
308
- }
309
- const customisationAliases = {};
310
- ["horizontal", "vertical"].forEach((prefix) => {
311
- const attr = prefix.slice(0, 1) + "Flip";
312
- customisationAliases[prefix + "-flip"] = attr;
313
- customisationAliases[prefix.slice(0, 1) + "-flip"] = attr;
314
- customisationAliases[prefix + "Flip"] = attr;
315
- });
316
- function fixSize(value) {
317
- return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
318
- }
319
- const render = (icon, props) => {
320
- const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
321
- const componentProps = { ...svgDefaults };
322
- const mode = props.mode || "svg";
323
- const style = {};
324
- const propsStyle = props.style;
325
- const customStyle = typeof propsStyle === "object" && !(propsStyle instanceof Array) ? propsStyle : {};
326
- for (let key in props) {
327
- const value = props[key];
328
- if (value === void 0) {
329
- continue;
330
- }
331
- switch (key) {
332
- case "icon":
333
- case "style":
334
- case "onLoad":
335
- case "mode":
336
- break;
337
- case "inline":
338
- case "hFlip":
339
- case "vFlip":
340
- customisations[key] = value === true || value === "true" || value === 1;
341
- break;
342
- case "flip":
343
- if (typeof value === "string") {
344
- flipFromString(customisations, value);
345
- }
346
- break;
347
- case "color":
348
- style.color = value;
349
- break;
350
- case "rotate":
351
- if (typeof value === "string") {
352
- customisations[key] = rotateFromString(value);
353
- } else if (typeof value === "number") {
354
- customisations[key] = value;
355
- }
356
- break;
357
- case "ariaHidden":
358
- case "aria-hidden":
359
- if (value !== true && value !== "true") {
360
- delete componentProps["aria-hidden"];
361
- }
362
- break;
363
- default: {
364
- const alias = customisationAliases[key];
365
- if (alias) {
366
- if (value === true || value === "true" || value === 1) {
367
- customisations[alias] = true;
368
- }
369
- } else if (defaultExtendedIconCustomisations[key] === void 0) {
370
- componentProps[key] = value;
371
- }
372
- }
373
- }
374
- }
375
- const item = iconToSVG(icon, customisations);
376
- const renderAttribs = item.attributes;
377
- if (customisations.inline) {
378
- style.verticalAlign = "-0.125em";
379
- }
380
- if (mode === "svg") {
381
- componentProps.style = {
382
- ...style,
383
- ...customStyle
384
- };
385
- Object.assign(componentProps, renderAttribs);
386
- let localCounter = 0;
387
- let id = props.id;
388
- if (typeof id === "string") {
389
- id = id.replace(/-/g, "_");
390
- }
391
- componentProps["innerHTML"] = replaceIDs(item.body, id ? () => id + "ID" + localCounter++ : "iconifyVue");
392
- return h("svg", componentProps);
393
- }
394
- const { body, width, height } = icon;
395
- const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
396
- const html = iconToHTML(body, {
397
- ...renderAttribs,
398
- width: width + "",
399
- height: height + ""
400
- });
401
- componentProps.style = {
402
- ...style,
403
- "--svg": svgToURL(html),
404
- "width": fixSize(renderAttribs.width),
405
- "height": fixSize(renderAttribs.height),
406
- ...commonProps,
407
- ...useMask ? monotoneProps : coloredProps,
408
- ...customStyle
409
- };
410
- return h("span", componentProps);
411
- };
412
- const storage = /* @__PURE__ */ Object.create(null);
413
- function addIcon(name, data) {
414
- storage[name] = data;
415
- }
416
- const Icon = defineComponent({
417
- // Do not inherit other attributes: it is handled by render()
418
- inheritAttrs: false,
419
- // Render icon
420
- render() {
421
- const props = this.$attrs;
422
- const propsIcon = props.icon;
423
- const icon = typeof propsIcon === "string" ? storage[propsIcon] : typeof propsIcon === "object" ? propsIcon : null;
424
- if (icon === null || typeof icon !== "object" || typeof icon.body !== "string") {
425
- return this.$slots.default ? this.$slots.default() : null;
426
- }
427
- return render({
428
- ...defaultIconProps,
429
- ...icon
430
- }, props);
431
- }
432
- });
433
- export {
434
- Icon,
435
- addIcon
436
- };