@vunk/plus 1.2.0 → 1.3.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/components/SendOutlined.mjs +43 -25
- package/components/agent-chat-provider/index.mjs +789 -0
- package/components/avatar/index.mjs +2 -2
- package/components/broadcasting-markdown/index.css +3 -0
- package/components/broadcasting-markdown/index.mjs +637 -0
- package/components/bubble-list/index.css +18 -0
- package/components/bubble-list/index.mjs +386 -0
- package/components/bubble-templates/index.css +18 -0
- package/components/bubble-templates/index.mjs +258 -0
- package/components/chat-independent/index.css +47 -0
- package/components/chat-independent/index.mjs +184 -0
- package/components/index.mjs +35980 -0
- package/components/lottie-animation/index.mjs +2 -2
- package/components/monaco-editor/index.mjs +2 -2
- package/components/monaco-environment/index.mjs +11 -11
- package/components/recorder-button/index.css +7 -10
- package/components/recorder-button/index.mjs +115 -83
- package/components/routes-menu-content/index.mjs +5 -5
- package/components/sender/index.css +6 -5
- package/components/sender/index.mjs +174 -26
- package/components/speech-button/index.mjs +40 -14
- package/components/table-columns/index.mjs +3 -6
- package/components/tables-v1/index.mjs +9 -10
- package/components/tables-v1-checkbox/index.mjs +269 -33
- package/components/typing-markdown/index.mjs +128 -33
- package/components/vditor/index.mjs +5 -9
- package/composables/el-breakpoints/index.d.ts +1 -1
- package/composables/recorder/index.mjs +752 -182
- package/icons/_plugin-vue_export-helper.mjs +9 -0
- package/icons/end/index.d.ts +4 -0
- package/icons/end/index.mjs +36 -0
- package/icons/end/src/avatar.d.ts +12 -0
- package/icons/end/src/icon.d.ts +57 -0
- package/icons/keyboard/index.d.ts +4 -0
- package/icons/keyboard/index.mjs +36 -0
- package/icons/keyboard/src/avatar.d.ts +12 -0
- package/icons/keyboard/src/icon.d.ts +57 -0
- package/icons/start/index.d.ts +4 -0
- package/icons/start/index.mjs +36 -0
- package/icons/start/src/avatar.d.ts +12 -0
- package/icons/start/src/icon.d.ts +57 -0
- package/icons/voice/index.d.ts +4 -0
- package/icons/voice/index.mjs +51 -0
- package/icons/voice/src/avatar.d.ts +12 -0
- package/icons/voice/src/icon.d.ts +57 -0
- package/icons/voice/src/index.vue.d.ts +4 -0
- package/index.css +103 -15
- package/package.json +51 -7
- package/components/avatar/index.d.ts +0 -4
- package/components/avatar/src/ctx.d.ts +0 -18
- package/components/avatar/src/index.vue.d.ts +0 -180
- package/components/avatar/src/types.d.ts +0 -1
- package/components/lottie-animation/index.d.ts +0 -4
- package/components/lottie-animation/src/ctx.d.ts +0 -10
- package/components/lottie-animation/src/index.vue.d.ts +0 -21
- package/components/lottie-animation/src/types.d.ts +0 -4
- package/components/monaco-editor/index.d.ts +0 -5
- package/components/monaco-editor/src/ctx.d.ts +0 -23
- package/components/monaco-editor/src/index.vue.d.ts +0 -40
- package/components/monaco-editor/src/types.d.ts +0 -1
- package/components/monaco-environment/index.d.ts +0 -4
- package/components/monaco-environment/src/ctx.d.ts +0 -8
- package/components/monaco-environment/src/index.vue.d.ts +0 -2
- package/components/monaco-environment/src/types.d.ts +0 -1
- package/components/recorder-button/index.d.ts +0 -4
- package/components/recorder-button/src/ctx.d.ts +0 -19
- package/components/recorder-button/src/index.vue.d.ts +0 -309
- package/components/recorder-button/src/speech-to-text.d.ts +0 -1
- package/components/recorder-button/src/types.d.ts +0 -6
- package/components/routes-menu-content/index.d.ts +0 -4
- package/components/routes-menu-content/src/ctx.d.ts +0 -17
- package/components/routes-menu-content/src/index.vue.d.ts +0 -350
- package/components/routes-menu-content/src/item/core/ctx.d.ts +0 -18
- package/components/routes-menu-content/src/item/core/index.vue.d.ts +0 -185
- package/components/routes-menu-content/src/item/ctx.d.ts +0 -14
- package/components/routes-menu-content/src/item/index.vue.d.ts +0 -316
- package/components/routes-menu-content/src/types.d.ts +0 -1
- package/components/sender/index.d.ts +0 -4
- package/components/sender/src/ctx.d.ts +0 -21
- package/components/sender/src/index.vue.d.ts +0 -484
- package/components/sender/src/types.d.ts +0 -1
- package/components/speech-button/index.d.ts +0 -4
- package/components/speech-button/src/RecordingIcon.vue.d.ts +0 -2
- package/components/speech-button/src/ctx.d.ts +0 -10
- package/components/speech-button/src/index.vue.d.ts +0 -22
- package/components/speech-button/src/types.d.ts +0 -1
- package/components/table-columns/index.d.ts +0 -5
- package/components/table-columns/src/ctx.d.ts +0 -66
- package/components/table-columns/src/el-ctx.d.ts +0 -63
- package/components/table-columns/src/index.vue.d.ts +0 -280
- package/components/table-columns/src/types.d.ts +0 -21
- package/components/tables-v1/index.d.ts +0 -5
- package/components/tables-v1/src/ctx.d.ts +0 -283
- package/components/tables-v1/src/el-ctx.d.ts +0 -272
- package/components/tables-v1/src/index.vue.d.ts +0 -2997
- package/components/tables-v1/src/types.d.ts +0 -4
- package/components/tables-v1-checkbox/index.d.ts +0 -5
- package/components/tables-v1-checkbox/src/ctx.d.ts +0 -322
- package/components/tables-v1-checkbox/src/index.vue.d.ts +0 -3788
- package/components/tables-v1-checkbox/src/types.d.ts +0 -1
- package/components/typing-markdown/index.d.ts +0 -4
- package/components/typing-markdown/src/core.d.ts +0 -3
- package/components/typing-markdown/src/ctx.d.ts +0 -33
- package/components/typing-markdown/src/index.vue.d.ts +0 -57
- package/components/typing-markdown/src/types.d.ts +0 -1
- package/components/vditor/index.d.ts +0 -5
- package/components/vditor/src/ctx.d.ts +0 -37
- package/components/vditor/src/handle-fullscreen.vue.d.ts +0 -18
- package/components/vditor/src/handle-value.vue.d.ts +0 -18
- package/components/vditor/src/index.vue.d.ts +0 -144
- package/components/vditor/src/types.d.ts +0 -9
- package/components/vditor/src/use.d.ts +0 -4
- package/fetch/PlusFetch/index.d.ts +0 -14
- package/fetch/PlusFetch/index.mjs +0 -638
- package/fetch/PlusFetch/types.d.ts +0 -54
- package/fetch/index.d.ts +0 -1
- package/fetch/index.mjs +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, ref, watch, inject, isVNode, Comment, Fragment, shallowRef, watchEffect, provide, onBeforeUnmount, onBeforeMount, toRef, defineComponent, h, createVNode, resolveComponent,
|
|
1
|
+
import { computed, ref, watch, inject, isVNode, Comment, Fragment, shallowRef, watchEffect, provide, onBeforeUnmount, onBeforeMount, toRef, defineComponent, h, createVNode, resolveComponent, createBlock, openBlock, withCtx, mergeProps, toHandlers } from 'vue';
|
|
2
2
|
import { _VkTabelsV1Ctx, VkTablesV1 } from '@vunk/plus/components/tables-v1';
|
|
3
3
|
import { VkCheckRecordLogicProvider, VkCheckRecordLogic } from '@vunk/core';
|
|
4
4
|
import { noop } from '@vunk/shared/function';
|
|
@@ -617,31 +617,203 @@ function createKey(prefix, suffix) {
|
|
|
617
617
|
return prefix + (suffix === 'default' ? '' : suffix.replace(/^[a-z]/, startChar => startChar.toUpperCase()));
|
|
618
618
|
}
|
|
619
619
|
|
|
620
|
+
// src: https://www.w3schools.com/colors/colors_names.asp
|
|
620
621
|
var colors = {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
622
|
+
aliceblue: "#F0F8FF",
|
|
623
|
+
antiquewhite: "#FAEBD7",
|
|
624
|
+
aqua: "#0FF",
|
|
625
|
+
aquamarine: "#7FFFD4",
|
|
626
|
+
azure: "#F0FFFF",
|
|
627
|
+
beige: "#F5F5DC",
|
|
628
|
+
bisque: "#FFE4C4",
|
|
629
|
+
black: "#000",
|
|
630
|
+
blanchedalmond: "#FFEBCD",
|
|
631
|
+
blue: "#00F",
|
|
632
|
+
blueviolet: "#8A2BE2",
|
|
633
|
+
brown: "#A52A2A",
|
|
634
|
+
burlywood: "#DEB887",
|
|
635
|
+
cadetblue: "#5F9EA0",
|
|
636
|
+
chartreuse: "#7FFF00",
|
|
637
|
+
chocolate: "#D2691E",
|
|
638
|
+
coral: "#FF7F50",
|
|
639
|
+
cornflowerblue: "#6495ED",
|
|
640
|
+
cornsilk: "#FFF8DC",
|
|
641
|
+
crimson: "#DC143C",
|
|
642
|
+
cyan: "#0FF",
|
|
643
|
+
darkblue: "#00008B",
|
|
644
|
+
darkcyan: "#008B8B",
|
|
645
|
+
darkgoldenrod: "#B8860B",
|
|
646
|
+
darkgray: "#A9A9A9",
|
|
647
|
+
darkgrey: "#A9A9A9",
|
|
648
|
+
darkgreen: "#006400",
|
|
649
|
+
darkkhaki: "#BDB76B",
|
|
650
|
+
darkmagenta: "#8B008B",
|
|
651
|
+
darkolivegreen: "#556B2F",
|
|
652
|
+
darkorange: "#FF8C00",
|
|
653
|
+
darkorchid: "#9932CC",
|
|
654
|
+
darkred: "#8B0000",
|
|
655
|
+
darksalmon: "#E9967A",
|
|
656
|
+
darkseagreen: "#8FBC8F",
|
|
657
|
+
darkslateblue: "#483D8B",
|
|
658
|
+
darkslategray: "#2F4F4F",
|
|
659
|
+
darkslategrey: "#2F4F4F",
|
|
660
|
+
darkturquoise: "#00CED1",
|
|
661
|
+
darkviolet: "#9400D3",
|
|
662
|
+
deeppink: "#FF1493",
|
|
663
|
+
deepskyblue: "#00BFFF",
|
|
664
|
+
dimgray: "#696969",
|
|
665
|
+
dimgrey: "#696969",
|
|
666
|
+
dodgerblue: "#1E90FF",
|
|
667
|
+
firebrick: "#B22222",
|
|
668
|
+
floralwhite: "#FFFAF0",
|
|
669
|
+
forestgreen: "#228B22",
|
|
670
|
+
fuchsia: "#F0F",
|
|
671
|
+
gainsboro: "#DCDCDC",
|
|
672
|
+
ghostwhite: "#F8F8FF",
|
|
673
|
+
gold: "#FFD700",
|
|
674
|
+
goldenrod: "#DAA520",
|
|
675
|
+
gray: "#808080",
|
|
676
|
+
grey: "#808080",
|
|
677
|
+
green: "#008000",
|
|
678
|
+
greenyellow: "#ADFF2F",
|
|
679
|
+
honeydew: "#F0FFF0",
|
|
680
|
+
hotpink: "#FF69B4",
|
|
681
|
+
indianred: "#CD5C5C",
|
|
682
|
+
indigo: "#4B0082",
|
|
683
|
+
ivory: "#FFFFF0",
|
|
684
|
+
khaki: "#F0E68C",
|
|
685
|
+
lavender: "#E6E6FA",
|
|
686
|
+
lavenderblush: "#FFF0F5",
|
|
687
|
+
lawngreen: "#7CFC00",
|
|
688
|
+
lemonchiffon: "#FFFACD",
|
|
689
|
+
lightblue: "#ADD8E6",
|
|
690
|
+
lightcoral: "#F08080",
|
|
691
|
+
lightcyan: "#E0FFFF",
|
|
692
|
+
lightgoldenrodyellow: "#FAFAD2",
|
|
693
|
+
lightgray: "#D3D3D3",
|
|
694
|
+
lightgrey: "#D3D3D3",
|
|
695
|
+
lightgreen: "#90EE90",
|
|
696
|
+
lightpink: "#FFB6C1",
|
|
697
|
+
lightsalmon: "#FFA07A",
|
|
698
|
+
lightseagreen: "#20B2AA",
|
|
699
|
+
lightskyblue: "#87CEFA",
|
|
700
|
+
lightslategray: "#778899",
|
|
701
|
+
lightslategrey: "#778899",
|
|
702
|
+
lightsteelblue: "#B0C4DE",
|
|
703
|
+
lightyellow: "#FFFFE0",
|
|
704
|
+
lime: "#0F0",
|
|
705
|
+
limegreen: "#32CD32",
|
|
706
|
+
linen: "#FAF0E6",
|
|
707
|
+
magenta: "#F0F",
|
|
708
|
+
maroon: "#800000",
|
|
709
|
+
mediumaquamarine: "#66CDAA",
|
|
710
|
+
mediumblue: "#0000CD",
|
|
711
|
+
mediumorchid: "#BA55D3",
|
|
712
|
+
mediumpurple: "#9370DB",
|
|
713
|
+
mediumseagreen: "#3CB371",
|
|
714
|
+
mediumslateblue: "#7B68EE",
|
|
715
|
+
mediumspringgreen: "#00FA9A",
|
|
716
|
+
mediumturquoise: "#48D1CC",
|
|
717
|
+
mediumvioletred: "#C71585",
|
|
718
|
+
midnightblue: "#191970",
|
|
719
|
+
mintcream: "#F5FFFA",
|
|
720
|
+
mistyrose: "#FFE4E1",
|
|
721
|
+
moccasin: "#FFE4B5",
|
|
722
|
+
navajowhite: "#FFDEAD",
|
|
723
|
+
navy: "#000080",
|
|
724
|
+
oldlace: "#FDF5E6",
|
|
725
|
+
olive: "#808000",
|
|
726
|
+
olivedrab: "#6B8E23",
|
|
727
|
+
orange: "#FFA500",
|
|
728
|
+
orangered: "#FF4500",
|
|
729
|
+
orchid: "#DA70D6",
|
|
730
|
+
palegoldenrod: "#EEE8AA",
|
|
731
|
+
palegreen: "#98FB98",
|
|
732
|
+
paleturquoise: "#AFEEEE",
|
|
733
|
+
palevioletred: "#DB7093",
|
|
734
|
+
papayawhip: "#FFEFD5",
|
|
735
|
+
peachpuff: "#FFDAB9",
|
|
736
|
+
peru: "#CD853F",
|
|
737
|
+
pink: "#FFC0CB",
|
|
738
|
+
plum: "#DDA0DD",
|
|
739
|
+
powderblue: "#B0E0E6",
|
|
740
|
+
purple: "#800080",
|
|
741
|
+
rebeccapurple: "#663399",
|
|
742
|
+
red: "#F00",
|
|
743
|
+
rosybrown: "#BC8F8F",
|
|
744
|
+
royalblue: "#4169E1",
|
|
745
|
+
saddlebrown: "#8B4513",
|
|
746
|
+
salmon: "#FA8072",
|
|
747
|
+
sandybrown: "#F4A460",
|
|
748
|
+
seagreen: "#2E8B57",
|
|
749
|
+
seashell: "#FFF5EE",
|
|
750
|
+
sienna: "#A0522D",
|
|
751
|
+
silver: "#C0C0C0",
|
|
752
|
+
skyblue: "#87CEEB",
|
|
753
|
+
slateblue: "#6A5ACD",
|
|
754
|
+
slategray: "#708090",
|
|
755
|
+
slategrey: "#708090",
|
|
756
|
+
snow: "#FFFAFA",
|
|
757
|
+
springgreen: "#00FF7F",
|
|
758
|
+
steelblue: "#4682B4",
|
|
759
|
+
tan: "#D2B48C",
|
|
760
|
+
teal: "#008080",
|
|
761
|
+
thistle: "#D8BFD8",
|
|
762
|
+
tomato: "#FF6347",
|
|
763
|
+
turquoise: "#40E0D0",
|
|
764
|
+
violet: "#EE82EE",
|
|
765
|
+
wheat: "#F5DEB3",
|
|
766
|
+
white: "#FFF",
|
|
767
|
+
whitesmoke: "#F5F5F5",
|
|
768
|
+
yellow: "#FF0",
|
|
769
|
+
yellowgreen: "#9ACD32",
|
|
770
|
+
transparent: "#0000"
|
|
638
771
|
};
|
|
639
772
|
|
|
773
|
+
// All the algorithms credit to https://stackoverflow.com/questions/36721830/convert-hsl-to-rgb-and-hex/54014428#54014428
|
|
774
|
+
// original author: Kamil Kiełczewski
|
|
775
|
+
/**
|
|
776
|
+
* @param h 360
|
|
777
|
+
* @param s 100
|
|
778
|
+
* @param l 100
|
|
779
|
+
* @returns [h, s, v] 360, 100, 100
|
|
780
|
+
*/
|
|
781
|
+
/**
|
|
782
|
+
* @param h 360
|
|
783
|
+
* @param s 100
|
|
784
|
+
* @param v 100
|
|
785
|
+
* @returns [r, g, b] 255, 255, 255
|
|
786
|
+
*/
|
|
787
|
+
function hsv2rgb(h, s, v) {
|
|
788
|
+
s /= 100;
|
|
789
|
+
v /= 100;
|
|
790
|
+
let f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);
|
|
791
|
+
return [f(5) * 255, f(3) * 255, f(1) * 255];
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* @param h 360
|
|
795
|
+
* @param s 100
|
|
796
|
+
* @param l 100
|
|
797
|
+
* @returns [255, 255, 255]
|
|
798
|
+
*/
|
|
799
|
+
function hsl2rgb(h, s, l) {
|
|
800
|
+
s /= 100;
|
|
801
|
+
l /= 100;
|
|
802
|
+
let a = s * Math.min(l, 1 - l);
|
|
803
|
+
let f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
804
|
+
return [f(0) * 255, f(8) * 255, f(4) * 255];
|
|
805
|
+
}
|
|
806
|
+
|
|
640
807
|
const prefix = '^\\s*';
|
|
641
808
|
const suffix = '\\s*$';
|
|
809
|
+
const percent = '\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*'; // 4 offset
|
|
642
810
|
const float = '\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*'; // 4 offset
|
|
643
811
|
const hex = '([0-9A-Fa-f])';
|
|
644
812
|
const dhex = '([0-9A-Fa-f]{2})';
|
|
813
|
+
const hslRegex = new RegExp(`${prefix}hsl\\s*\\(${float},${percent},${percent}\\)${suffix}`);
|
|
814
|
+
const hsvRegex = new RegExp(`${prefix}hsv\\s*\\(${float},${percent},${percent}\\)${suffix}`);
|
|
815
|
+
const hslaRegex = new RegExp(`${prefix}hsla\\s*\\(${float},${percent},${percent},${float}\\)${suffix}`);
|
|
816
|
+
const hsvaRegex = new RegExp(`${prefix}hsva\\s*\\(${float},${percent},${percent},${float}\\)${suffix}`);
|
|
645
817
|
const rgbRegex = new RegExp(`${prefix}rgb\\s*\\(${float},${float},${float}\\)${suffix}`);
|
|
646
818
|
const rgbaRegex = new RegExp(`${prefix}rgba\\s*\\(${float},${float},${float},${float}\\)${suffix}`);
|
|
647
819
|
const sHexRegex = new RegExp(`${prefix}#${hex}${hex}${hex}${suffix}`);
|
|
@@ -651,9 +823,61 @@ const hexaRegex = new RegExp(`${prefix}#${dhex}${dhex}${dhex}${dhex}${suffix}`);
|
|
|
651
823
|
function parseHex(value) {
|
|
652
824
|
return parseInt(value, 16);
|
|
653
825
|
}
|
|
826
|
+
/**
|
|
827
|
+
* Convert color string to hsla array
|
|
828
|
+
* @param color format like hsl(180, 100%, 100%), hsla(180, 100%, 100%, 1)
|
|
829
|
+
* @returns
|
|
830
|
+
*/
|
|
831
|
+
function hsla(color) {
|
|
832
|
+
try {
|
|
833
|
+
let i;
|
|
834
|
+
if ((i = hslaRegex.exec(color))) {
|
|
835
|
+
return [
|
|
836
|
+
roundDeg(i[1]),
|
|
837
|
+
roundPercent(i[5]),
|
|
838
|
+
roundPercent(i[9]),
|
|
839
|
+
roundAlpha(i[13])
|
|
840
|
+
];
|
|
841
|
+
}
|
|
842
|
+
else if ((i = hslRegex.exec(color))) {
|
|
843
|
+
return [roundDeg(i[1]), roundPercent(i[5]), roundPercent(i[9]), 1];
|
|
844
|
+
}
|
|
845
|
+
throw new Error(`[seemly/hsla]: Invalid color value ${color}.`);
|
|
846
|
+
}
|
|
847
|
+
catch (e) {
|
|
848
|
+
throw e;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* Convert color string to hsva array
|
|
853
|
+
* @param color format like hsv(180, 100%, 100%), hsva(180, 100%, 100%, 1)
|
|
854
|
+
* @returns
|
|
855
|
+
*/
|
|
856
|
+
function hsva(color) {
|
|
857
|
+
try {
|
|
858
|
+
let i;
|
|
859
|
+
if ((i = hsvaRegex.exec(color))) {
|
|
860
|
+
return [
|
|
861
|
+
roundDeg(i[1]),
|
|
862
|
+
roundPercent(i[5]),
|
|
863
|
+
roundPercent(i[9]),
|
|
864
|
+
roundAlpha(i[13])
|
|
865
|
+
];
|
|
866
|
+
}
|
|
867
|
+
else if ((i = hsvRegex.exec(color))) {
|
|
868
|
+
return [roundDeg(i[1]), roundPercent(i[5]), roundPercent(i[9]), 1];
|
|
869
|
+
}
|
|
870
|
+
throw new Error(`[seemly/hsva]: Invalid color value ${color}.`);
|
|
871
|
+
}
|
|
872
|
+
catch (e) {
|
|
873
|
+
throw e;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
654
876
|
/**
|
|
655
877
|
* Convert color string to rgba array.
|
|
656
|
-
* @param color format like #000[0], #000000[00], rgb(0, 0, 0),
|
|
878
|
+
* @param color format like #000[0], #000000[00], rgb(0, 0, 0),
|
|
879
|
+
* rgba(0, 0, 0, 0), hsl(a) color, hsv(a) color and color keywords and
|
|
880
|
+
* transparent
|
|
657
881
|
* @returns
|
|
658
882
|
*/
|
|
659
883
|
function rgba(color) {
|
|
@@ -700,6 +924,14 @@ function rgba(color) {
|
|
|
700
924
|
else if (color in colors) {
|
|
701
925
|
return rgba(colors[color]);
|
|
702
926
|
}
|
|
927
|
+
else if (hslRegex.test(color) || hslaRegex.test(color)) {
|
|
928
|
+
const [h, s, l, a] = hsla(color);
|
|
929
|
+
return [...hsl2rgb(h, s, l), a];
|
|
930
|
+
}
|
|
931
|
+
else if (hsvRegex.test(color) || hsvaRegex.test(color)) {
|
|
932
|
+
const [h, s, v, a] = hsva(color);
|
|
933
|
+
return [...hsv2rgb(h, s, v), a];
|
|
934
|
+
}
|
|
703
935
|
throw new Error(`[seemly/rgba]: Invalid color value ${color}.`);
|
|
704
936
|
}
|
|
705
937
|
catch (e) {
|
|
@@ -727,7 +959,7 @@ function composite(background, overlay) {
|
|
|
727
959
|
}
|
|
728
960
|
function changeColor(base, options) {
|
|
729
961
|
const [r, g, b, a = 1] = Array.isArray(base) ? base : rgba(base);
|
|
730
|
-
if (options.alpha) {
|
|
962
|
+
if (typeof options.alpha === 'number') {
|
|
731
963
|
return stringifyRgba(r, g, b, options.alpha);
|
|
732
964
|
}
|
|
733
965
|
return stringifyRgba(r, g, b, a);
|
|
@@ -745,6 +977,14 @@ function roundAlpha(value) {
|
|
|
745
977
|
return 0;
|
|
746
978
|
return v;
|
|
747
979
|
}
|
|
980
|
+
function roundDeg(value) {
|
|
981
|
+
const v = Math.round(Number(value));
|
|
982
|
+
if (v >= 360)
|
|
983
|
+
return 0;
|
|
984
|
+
if (v < 0)
|
|
985
|
+
return 0;
|
|
986
|
+
return v;
|
|
987
|
+
}
|
|
748
988
|
function roundChannel(value) {
|
|
749
989
|
const v = Math.round(Number(value));
|
|
750
990
|
if (v > 255)
|
|
@@ -753,6 +993,14 @@ function roundChannel(value) {
|
|
|
753
993
|
return 0;
|
|
754
994
|
return v;
|
|
755
995
|
}
|
|
996
|
+
function roundPercent(value) {
|
|
997
|
+
const v = Math.round(Number(value));
|
|
998
|
+
if (v > 100)
|
|
999
|
+
return 100;
|
|
1000
|
+
if (v < 0)
|
|
1001
|
+
return 0;
|
|
1002
|
+
return v;
|
|
1003
|
+
}
|
|
756
1004
|
function toRgbaString(base) {
|
|
757
1005
|
const [r, g, b] = base;
|
|
758
1006
|
if (3 in base) {
|
|
@@ -3316,22 +3564,11 @@ const base = {
|
|
|
3316
3564
|
// disabled placeholder
|
|
3317
3565
|
alphaClose: '0.6',
|
|
3318
3566
|
alphaDisabled: '0.5',
|
|
3319
|
-
alphaDisabledInput: '0.02',
|
|
3320
|
-
alphaPending: '0.05',
|
|
3321
|
-
alphaTablePending: '0.02',
|
|
3322
|
-
alphaPressed: '0.07',
|
|
3323
3567
|
alphaAvatar: '0.2',
|
|
3324
|
-
alphaRail: '0.14',
|
|
3325
3568
|
alphaProgressRail: '.08',
|
|
3326
|
-
alphaBorder: '0.12',
|
|
3327
|
-
alphaDivider: '0.06',
|
|
3328
3569
|
alphaInput: '0',
|
|
3329
|
-
alphaAction: '0.02',
|
|
3330
|
-
alphaTab: '0.04',
|
|
3331
3570
|
alphaScrollbar: '0.25',
|
|
3332
3571
|
alphaScrollbarHover: '0.4',
|
|
3333
|
-
alphaCode: '0.05',
|
|
3334
|
-
alphaTag: '0.02',
|
|
3335
3572
|
// primary
|
|
3336
3573
|
primaryHover: '#36ad6a',
|
|
3337
3574
|
primaryDefault: '#18a058',
|
|
@@ -3540,7 +3777,6 @@ function self$1(vars) {
|
|
|
3540
3777
|
});
|
|
3541
3778
|
}
|
|
3542
3779
|
const radioLight = {
|
|
3543
|
-
name: 'Radio',
|
|
3544
3780
|
common: derived,
|
|
3545
3781
|
self: self$1
|
|
3546
3782
|
};
|
|
@@ -4134,7 +4370,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4134
4370
|
/* STABLE */
|
|
4135
4371
|
}, 8, ["model-value", "oid-field"]);
|
|
4136
4372
|
}
|
|
4137
|
-
var VkTablesV1Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]
|
|
4373
|
+
var VkTablesV1Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
4138
4374
|
|
|
4139
4375
|
var types = /*#__PURE__*/Object.freeze({
|
|
4140
4376
|
__proto__: null
|
|
@@ -1,9 +1,133 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass } from 'vue';
|
|
2
1
|
import { noop, computedAsync, debouncedRef } from '@vueuse/core';
|
|
3
|
-
import
|
|
2
|
+
import { noop as noop$1 } from '@vunk/shared/function';
|
|
3
|
+
import { defineComponent, ref, computed, watch, createElementBlock, openBlock, normalizeClass } from 'vue';
|
|
4
4
|
import { highlight } from '@vunk/shared/markdown/shiki';
|
|
5
|
+
import markdownIt from 'markdown-it';
|
|
5
6
|
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
6
7
|
|
|
8
|
+
const placeholder = (id, code) => `<pre><!--::markdown-it-async::${id}::--><code>${code}</code></pre>`;
|
|
9
|
+
const placeholderRe = /<pre><!--::markdown-it-async::(\w+)::--><code>[\s\S]*?<\/code><\/pre>/g;
|
|
10
|
+
function randStr() {
|
|
11
|
+
return Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2);
|
|
12
|
+
}
|
|
13
|
+
class MarkdownItAsync extends markdownIt {
|
|
14
|
+
placeholderMap;
|
|
15
|
+
disableWarn = false;
|
|
16
|
+
constructor(...args) {
|
|
17
|
+
const map = /* @__PURE__ */ new Map();
|
|
18
|
+
const options = args.length === 2 ? args[1] : args[0];
|
|
19
|
+
if (options && "highlight" in options)
|
|
20
|
+
options.highlight = wrapHightlight(options.highlight, map);
|
|
21
|
+
super(...args);
|
|
22
|
+
this.placeholderMap = map;
|
|
23
|
+
}
|
|
24
|
+
// implementation
|
|
25
|
+
use(plugin, ...params) {
|
|
26
|
+
return super.use(plugin, ...params);
|
|
27
|
+
}
|
|
28
|
+
render(src, env) {
|
|
29
|
+
if (this.options.warnOnSyncRender && !this.disableWarn) {
|
|
30
|
+
console.warn("[markdown-it-async] Please use `md.renderAsync` instead of `md.render`");
|
|
31
|
+
}
|
|
32
|
+
return super.render(src, env);
|
|
33
|
+
}
|
|
34
|
+
async renderAsync(src, env) {
|
|
35
|
+
this.options.highlight = wrapHightlight(this.options.highlight, this.placeholderMap);
|
|
36
|
+
this.disableWarn = true;
|
|
37
|
+
const result = this.render(src, env);
|
|
38
|
+
this.disableWarn = false;
|
|
39
|
+
return replaceAsync(result, placeholderRe, async (match, id) => {
|
|
40
|
+
if (!this.placeholderMap.has(id))
|
|
41
|
+
throw new Error(`Unknown highlight placeholder id: ${id}`);
|
|
42
|
+
const [promise, _str, lang, _attrs] = this.placeholderMap.get(id);
|
|
43
|
+
const result2 = await promise || "";
|
|
44
|
+
this.placeholderMap.delete(id);
|
|
45
|
+
if (result2.startsWith("<pre"))
|
|
46
|
+
return result2;
|
|
47
|
+
else
|
|
48
|
+
return `<pre><code class="language-${lang}">${result2}</code></pre>`;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function createMarkdownItAsync(...args) {
|
|
53
|
+
return new MarkdownItAsync(...args);
|
|
54
|
+
}
|
|
55
|
+
function replaceAsync(string, searchValue, replacer) {
|
|
56
|
+
try {
|
|
57
|
+
if (typeof replacer === "function") {
|
|
58
|
+
const values = [];
|
|
59
|
+
String.prototype.replace.call(string, searchValue, (...args) => {
|
|
60
|
+
values.push(replacer(...args));
|
|
61
|
+
return "";
|
|
62
|
+
});
|
|
63
|
+
return Promise.all(values).then((resolvedValues) => {
|
|
64
|
+
return String.prototype.replace.call(string, searchValue, () => {
|
|
65
|
+
return resolvedValues.shift() || "";
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
return Promise.resolve(
|
|
70
|
+
String.prototype.replace.call(string, searchValue, replacer)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
} catch (error) {
|
|
74
|
+
return Promise.reject(error);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const wrappedSet = /* @__PURE__ */ new WeakSet();
|
|
78
|
+
function escapeHtml(unsafe) {
|
|
79
|
+
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
80
|
+
}
|
|
81
|
+
function wrapHightlight(highlight, map) {
|
|
82
|
+
if (!highlight)
|
|
83
|
+
return void 0;
|
|
84
|
+
if (wrappedSet.has(highlight))
|
|
85
|
+
return highlight;
|
|
86
|
+
const wrapped = (str, lang, attrs) => {
|
|
87
|
+
const promise = highlight(str, lang, attrs);
|
|
88
|
+
if (typeof promise === "string")
|
|
89
|
+
return promise;
|
|
90
|
+
const id = randStr();
|
|
91
|
+
map.set(id, [promise, str, lang, attrs]);
|
|
92
|
+
let code = str;
|
|
93
|
+
if (code.endsWith("\n"))
|
|
94
|
+
code = code.slice(0, -1);
|
|
95
|
+
code = escapeHtml(code);
|
|
96
|
+
return placeholder(id, code);
|
|
97
|
+
};
|
|
98
|
+
wrappedSet.add(wrapped);
|
|
99
|
+
return wrapped;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const highlightInfo = highlight({
|
|
103
|
+
dark: "github-dark",
|
|
104
|
+
light: "github-light"
|
|
105
|
+
}, {}, {
|
|
106
|
+
warn: noop
|
|
107
|
+
});
|
|
108
|
+
async function createMarkdownIt() {
|
|
109
|
+
const [highlight] = await highlightInfo;
|
|
110
|
+
const md = createMarkdownItAsync({
|
|
111
|
+
highlight
|
|
112
|
+
});
|
|
113
|
+
md.core.ruler.after("inline", "add-is-last-class", (state) => {
|
|
114
|
+
const tokens = state.tokens;
|
|
115
|
+
let lastTagIndex = -1;
|
|
116
|
+
for (let i = tokens.length - 1; i >= 0; i--) {
|
|
117
|
+
const token = tokens[i];
|
|
118
|
+
if (token.nesting === 1 && !token.hidden) {
|
|
119
|
+
lastTagIndex = i;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (lastTagIndex !== -1) {
|
|
124
|
+
tokens[lastTagIndex].attrSet("class", "is-last");
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
return md;
|
|
128
|
+
}
|
|
129
|
+
const markdownItPromise = createMarkdownIt();
|
|
130
|
+
|
|
7
131
|
const props = {
|
|
8
132
|
source: {
|
|
9
133
|
type: String,
|
|
@@ -37,35 +161,6 @@ const emits = {
|
|
|
37
161
|
typing: null
|
|
38
162
|
};
|
|
39
163
|
|
|
40
|
-
const highlightPromise = highlight({
|
|
41
|
-
dark: "github-dark",
|
|
42
|
-
light: "github-light"
|
|
43
|
-
}, {}, {
|
|
44
|
-
warn: noop
|
|
45
|
-
});
|
|
46
|
-
const createMarkdownIt = async () => {
|
|
47
|
-
const highlight2 = await highlightPromise;
|
|
48
|
-
const md = new MarkdownIt({
|
|
49
|
-
highlight: highlight2
|
|
50
|
-
});
|
|
51
|
-
md.core.ruler.after("inline", "add-is-last-class", (state) => {
|
|
52
|
-
const tokens = state.tokens;
|
|
53
|
-
let lastTagIndex = -1;
|
|
54
|
-
for (let i = tokens.length - 1; i >= 0; i--) {
|
|
55
|
-
const token = tokens[i];
|
|
56
|
-
if (token.nesting === 1 && !token.hidden) {
|
|
57
|
-
lastTagIndex = i;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (lastTagIndex !== -1) {
|
|
62
|
-
tokens[lastTagIndex].attrSet("class", "is-last");
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
return md;
|
|
66
|
-
};
|
|
67
|
-
const markdownItPromise = createMarkdownIt();
|
|
68
|
-
|
|
69
164
|
var _sfc_main = defineComponent({
|
|
70
165
|
name: "VkTypingMarkdown",
|
|
71
166
|
props,
|
|
@@ -83,7 +178,7 @@ var _sfc_main = defineComponent({
|
|
|
83
178
|
return md;
|
|
84
179
|
});
|
|
85
180
|
const htmlText = computedAsync(async () => {
|
|
86
|
-
currentText.value;
|
|
181
|
+
noop$1(currentText.value);
|
|
87
182
|
const md = await theMarkdownIt;
|
|
88
183
|
return md.render(currentText.value);
|
|
89
184
|
}, "");
|
|
@@ -135,7 +230,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
135
230
|
innerHTML: _ctx.htmlText
|
|
136
231
|
}, null, 10, _hoisted_1);
|
|
137
232
|
}
|
|
138
|
-
var VkTypingMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]
|
|
233
|
+
var VkTypingMarkdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
139
234
|
|
|
140
235
|
var types = /*#__PURE__*/Object.freeze({
|
|
141
236
|
__proto__: null
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Vditor from 'vditor';
|
|
2
2
|
import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
|
|
3
|
-
import { inject, unref, defineComponent, nextTick, ref, watch, shallowRef, provide, onMounted, resolveComponent,
|
|
3
|
+
import { inject, unref, defineComponent, nextTick, ref, watch, shallowRef, provide, onMounted, resolveComponent, createElementBlock, openBlock, Fragment, createElementVNode, createBlock, createCommentVNode, renderSlot, withCtx, normalizeClass } from 'vue';
|
|
4
4
|
import { watchPausable, useMutationObserver } from '@vueuse/core';
|
|
5
|
-
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
6
5
|
import { VkAsyncTeleport } from '@vunk/core';
|
|
6
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
7
7
|
|
|
8
8
|
const defaultToolbar = [
|
|
9
9
|
"headings",
|
|
@@ -117,8 +117,6 @@ var _sfc_main$2 = defineComponent({
|
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
|
|
120
|
-
var HandleValue = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/vditor/src/handle-value.vue"]]);
|
|
121
|
-
|
|
122
120
|
var _sfc_main$1 = defineComponent({
|
|
123
121
|
props: {
|
|
124
122
|
fullscreen: {
|
|
@@ -159,13 +157,11 @@ var _sfc_main$1 = defineComponent({
|
|
|
159
157
|
}
|
|
160
158
|
});
|
|
161
159
|
|
|
162
|
-
var HandleFullscreen = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/vditor/src/handle-fullscreen.vue"]]);
|
|
163
|
-
|
|
164
160
|
var _sfc_main = defineComponent({
|
|
165
161
|
name: "VkVditor",
|
|
166
162
|
components: {
|
|
167
|
-
HandleValue,
|
|
168
|
-
HandleFullscreen,
|
|
163
|
+
HandleValue: _sfc_main$2,
|
|
164
|
+
HandleFullscreen: _sfc_main$1,
|
|
169
165
|
VkAsyncTeleport
|
|
170
166
|
},
|
|
171
167
|
props,
|
|
@@ -277,7 +273,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
277
273
|
/* STABLE_FRAGMENT */
|
|
278
274
|
);
|
|
279
275
|
}
|
|
280
|
-
var VkVditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]
|
|
276
|
+
var VkVditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
281
277
|
|
|
282
278
|
var types = /*#__PURE__*/Object.freeze({
|
|
283
279
|
__proto__: null
|
|
@@ -11,7 +11,7 @@ export declare const useElBreakpoints: () => {
|
|
|
11
11
|
isSmallerOrEqual(k: import("@vueuse/shared").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl">): boolean;
|
|
12
12
|
isInBetween(a: import("@vueuse/shared").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl">, b: import("@vueuse/shared").MaybeRefOrGetter<"sm" | "md" | "lg" | "xl">): boolean;
|
|
13
13
|
current: () => import("vue").ComputedRef<string[]>;
|
|
14
|
-
active(): import("vue").ComputedRef<string>;
|
|
14
|
+
active(): import("vue").ComputedRef<string | undefined>;
|
|
15
15
|
};
|
|
16
16
|
isMobile: import("vue").Ref<boolean, boolean>;
|
|
17
17
|
isDesktop: import("vue").Ref<boolean, boolean>;
|