@kg-ui/kg-ui-plus 0.0.1 → 0.0.3
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/README.md +3 -3
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue.mjs +16 -0
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue2.mjs +4 -0
- package/dist/es/KgCopilot/CopiContent/UserHead.vue.mjs +26 -0
- package/dist/es/KgCopilot/CopiContent/UserHead.vue2.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue2.mjs +49 -0
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue2.mjs +94 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue2.mjs +33 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue2.mjs +140 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue2.mjs +131 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue2.mjs +21 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/dialogue/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/dialogue/index.vue2.mjs +131 -0
- package/dist/es/KgCopilot/dialogue/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/dialogue/mdInCode.mjs +56 -0
- package/dist/es/KgCopilot/dialogue/readMd.vue.mjs +7 -0
- package/dist/es/KgCopilot/dialogue/readMd.vue2.mjs +87 -0
- package/dist/es/KgCopilot/dialogue/readMd.vue3.mjs +4 -0
- package/dist/es/KgCopilot/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/index.vue2.mjs +49 -0
- package/dist/es/KgCopilot/index.vue3.mjs +4 -0
- package/dist/es/_virtual/___vite-browser-external.mjs +6 -0
- package/dist/es/_virtual/__vite-browser-external.mjs +4 -0
- package/dist/es/_virtual/_commonjsHelpers.mjs +34 -0
- package/dist/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
- package/dist/es/_virtual/index.mjs +13 -0
- package/dist/es/api/project.mjs +51 -0
- package/dist/es/directives/heighlight/index.mjs +69 -0
- package/dist/es/directives/index.mjs +4 -0
- package/dist/es/home/LFilter/FilterArea.vue.mjs +7 -0
- package/dist/es/home/LFilter/FilterArea.vue2.mjs +507 -0
- package/dist/es/home/LFilter/FilterArea.vue3.mjs +4 -0
- package/dist/es/home/LFilter/FilterHead.vue.mjs +129 -0
- package/dist/es/home/LFilter/FilterHead.vue2.mjs +4 -0
- package/dist/es/home/LFilter/FilterItem.vue.mjs +7 -0
- package/dist/es/home/LFilter/FilterItem.vue2.mjs +114 -0
- package/dist/es/home/LFilter/FilterItem.vue3.mjs +4 -0
- package/dist/es/home/LFilter/FilterItemIcon.vue.mjs +7 -0
- package/dist/es/home/LFilter/FilterItemIcon.vue2.mjs +171 -0
- package/dist/es/home/LFilter/FilterItemIcon.vue3.mjs +4 -0
- package/dist/es/home/LFilter/index.vue.mjs +17 -0
- package/dist/es/home/LFilter/index.vue2.mjs +4 -0
- package/dist/es/home/LProject/index.vue.mjs +7 -0
- package/dist/es/home/LProject/index.vue2.mjs +70 -0
- package/dist/es/home/LProject/index.vue3.mjs +4 -0
- package/dist/es/home/index.vue.mjs +7 -0
- package/dist/es/home/index.vue2.mjs +80 -0
- package/dist/es/home/index.vue3.mjs +4 -0
- package/dist/es/index.mjs +26 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/check.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/circle-plus.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/close.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/microphone.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/paperclip.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/promotion.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/upload.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/copy-simple.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/speaker-high-light.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-down-thin.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-up-thin.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/warning-bold.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/add-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-down-s-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-up-s-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/check-fill.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/download-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/more-2-fill.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@pureadmin_utils@1.8.5_vue@3.2.45/node_modules/@pureadmin/utils/dist/index.mjs +70 -0
- package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/callBound.mjs +16 -0
- package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/index.mjs +36 -0
- package/dist/es/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.mjs +48 -0
- package/dist/es/node_modules/.pnpm/dompurify@3.0.10/node_modules/dompurify/dist/purify.es.mjs +949 -0
- package/dist/es/node_modules/.pnpm/es-define-property@1.0.0/node_modules/es-define-property/index.mjs +22 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.mjs +4 -0
- package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.mjs +72 -0
- package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.mjs +6 -0
- package/dist/es/node_modules/.pnpm/get-intrinsic@1.2.4/node_modules/get-intrinsic/index.mjs +320 -0
- package/dist/es/node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.mjs +14 -0
- package/dist/es/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.mjs +19 -0
- package/dist/es/node_modules/.pnpm/has-proto@1.0.3/node_modules/has-proto/index.mjs +11 -0
- package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.mjs +21 -0
- package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.mjs +48 -0
- package/dist/es/node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.mjs +8 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/core.mjs +5 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/apache.mjs +91 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/bash.mjs +377 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/basic.mjs +221 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/c.mjs +280 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/css.mjs +732 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dart.mjs +247 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/django.mjs +47 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dns.mjs +71 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dos.mjs +160 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dust.mjs +38 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/erlang.mjs +176 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/go.mjs +135 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/http.mjs +89 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/java.mjs +254 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/javascript.mjs +698 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/json.mjs +40 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/markdown.mjs +227 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/nginx.mjs +144 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/php.mjs +589 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/python.mjs +414 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/ruby.mjs +414 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/stylus.mjs +766 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/swift.mjs +832 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/typescript.mjs +788 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/xml.mjs +227 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/lib/core.mjs +1580 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/styles/paraiso-light.css.mjs +4 -0
- package/dist/es/node_modules/.pnpm/marked@12.0.1/node_modules/marked/lib/marked.esm.mjs +2045 -0
- package/dist/es/node_modules/.pnpm/object-inspect@1.13.1/node_modules/object-inspect/index.mjs +514 -0
- package/dist/es/node_modules/.pnpm/pinyin-match@1.2.4/node_modules/pinyin-match/es/main.mjs +124 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/formats.mjs +22 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/index.mjs +14 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/parse.mjs +199 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/stringify.mjs +262 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/utils.mjs +196 -0
- package/dist/es/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.mjs +54 -0
- package/dist/es/node_modules/.pnpm/side-channel@1.0.6/node_modules/side-channel/index.mjs +115 -0
- package/dist/es/store/index.mjs +8 -0
- package/dist/es/store/modules/copilot.mjs +111 -0
- package/dist/es/store/modules/filters.mjs +346 -0
- package/dist/es/store/modules/types.mjs +19 -0
- package/dist/es/style/index.scss.mjs +4 -0
- package/dist/es/style/tailwind.css.mjs +4 -0
- package/dist/es/style.css +1 -0
- package/dist/es/utils/home.mjs +129 -0
- package/dist/es/utils/http/index.mjs +90 -0
- package/dist/es/utils/message.mjs +42 -0
- package/package.json +23 -32
@@ -0,0 +1,732 @@
|
|
1
|
+
const MODES = (hljs) => {
|
2
|
+
return {
|
3
|
+
IMPORTANT: {
|
4
|
+
scope: "meta",
|
5
|
+
begin: "!important"
|
6
|
+
},
|
7
|
+
BLOCK_COMMENT: hljs.C_BLOCK_COMMENT_MODE,
|
8
|
+
HEXCOLOR: {
|
9
|
+
scope: "number",
|
10
|
+
begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/
|
11
|
+
},
|
12
|
+
FUNCTION_DISPATCH: {
|
13
|
+
className: "built_in",
|
14
|
+
begin: /[\w-]+(?=\()/
|
15
|
+
},
|
16
|
+
ATTRIBUTE_SELECTOR_MODE: {
|
17
|
+
scope: "selector-attr",
|
18
|
+
begin: /\[/,
|
19
|
+
end: /\]/,
|
20
|
+
illegal: "$",
|
21
|
+
contains: [
|
22
|
+
hljs.APOS_STRING_MODE,
|
23
|
+
hljs.QUOTE_STRING_MODE
|
24
|
+
]
|
25
|
+
},
|
26
|
+
CSS_NUMBER_MODE: {
|
27
|
+
scope: "number",
|
28
|
+
begin: hljs.NUMBER_RE + "(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
|
29
|
+
relevance: 0
|
30
|
+
},
|
31
|
+
CSS_VARIABLE: {
|
32
|
+
className: "attr",
|
33
|
+
begin: /--[A-Za-z_][A-Za-z0-9_-]*/
|
34
|
+
}
|
35
|
+
};
|
36
|
+
};
|
37
|
+
const TAGS = [
|
38
|
+
"a",
|
39
|
+
"abbr",
|
40
|
+
"address",
|
41
|
+
"article",
|
42
|
+
"aside",
|
43
|
+
"audio",
|
44
|
+
"b",
|
45
|
+
"blockquote",
|
46
|
+
"body",
|
47
|
+
"button",
|
48
|
+
"canvas",
|
49
|
+
"caption",
|
50
|
+
"cite",
|
51
|
+
"code",
|
52
|
+
"dd",
|
53
|
+
"del",
|
54
|
+
"details",
|
55
|
+
"dfn",
|
56
|
+
"div",
|
57
|
+
"dl",
|
58
|
+
"dt",
|
59
|
+
"em",
|
60
|
+
"fieldset",
|
61
|
+
"figcaption",
|
62
|
+
"figure",
|
63
|
+
"footer",
|
64
|
+
"form",
|
65
|
+
"h1",
|
66
|
+
"h2",
|
67
|
+
"h3",
|
68
|
+
"h4",
|
69
|
+
"h5",
|
70
|
+
"h6",
|
71
|
+
"header",
|
72
|
+
"hgroup",
|
73
|
+
"html",
|
74
|
+
"i",
|
75
|
+
"iframe",
|
76
|
+
"img",
|
77
|
+
"input",
|
78
|
+
"ins",
|
79
|
+
"kbd",
|
80
|
+
"label",
|
81
|
+
"legend",
|
82
|
+
"li",
|
83
|
+
"main",
|
84
|
+
"mark",
|
85
|
+
"menu",
|
86
|
+
"nav",
|
87
|
+
"object",
|
88
|
+
"ol",
|
89
|
+
"p",
|
90
|
+
"q",
|
91
|
+
"quote",
|
92
|
+
"samp",
|
93
|
+
"section",
|
94
|
+
"span",
|
95
|
+
"strong",
|
96
|
+
"summary",
|
97
|
+
"sup",
|
98
|
+
"table",
|
99
|
+
"tbody",
|
100
|
+
"td",
|
101
|
+
"textarea",
|
102
|
+
"tfoot",
|
103
|
+
"th",
|
104
|
+
"thead",
|
105
|
+
"time",
|
106
|
+
"tr",
|
107
|
+
"ul",
|
108
|
+
"var",
|
109
|
+
"video"
|
110
|
+
];
|
111
|
+
const MEDIA_FEATURES = [
|
112
|
+
"any-hover",
|
113
|
+
"any-pointer",
|
114
|
+
"aspect-ratio",
|
115
|
+
"color",
|
116
|
+
"color-gamut",
|
117
|
+
"color-index",
|
118
|
+
"device-aspect-ratio",
|
119
|
+
"device-height",
|
120
|
+
"device-width",
|
121
|
+
"display-mode",
|
122
|
+
"forced-colors",
|
123
|
+
"grid",
|
124
|
+
"height",
|
125
|
+
"hover",
|
126
|
+
"inverted-colors",
|
127
|
+
"monochrome",
|
128
|
+
"orientation",
|
129
|
+
"overflow-block",
|
130
|
+
"overflow-inline",
|
131
|
+
"pointer",
|
132
|
+
"prefers-color-scheme",
|
133
|
+
"prefers-contrast",
|
134
|
+
"prefers-reduced-motion",
|
135
|
+
"prefers-reduced-transparency",
|
136
|
+
"resolution",
|
137
|
+
"scan",
|
138
|
+
"scripting",
|
139
|
+
"update",
|
140
|
+
"width",
|
141
|
+
// TODO: find a better solution?
|
142
|
+
"min-width",
|
143
|
+
"max-width",
|
144
|
+
"min-height",
|
145
|
+
"max-height"
|
146
|
+
];
|
147
|
+
const PSEUDO_CLASSES = [
|
148
|
+
"active",
|
149
|
+
"any-link",
|
150
|
+
"blank",
|
151
|
+
"checked",
|
152
|
+
"current",
|
153
|
+
"default",
|
154
|
+
"defined",
|
155
|
+
"dir",
|
156
|
+
// dir()
|
157
|
+
"disabled",
|
158
|
+
"drop",
|
159
|
+
"empty",
|
160
|
+
"enabled",
|
161
|
+
"first",
|
162
|
+
"first-child",
|
163
|
+
"first-of-type",
|
164
|
+
"fullscreen",
|
165
|
+
"future",
|
166
|
+
"focus",
|
167
|
+
"focus-visible",
|
168
|
+
"focus-within",
|
169
|
+
"has",
|
170
|
+
// has()
|
171
|
+
"host",
|
172
|
+
// host or host()
|
173
|
+
"host-context",
|
174
|
+
// host-context()
|
175
|
+
"hover",
|
176
|
+
"indeterminate",
|
177
|
+
"in-range",
|
178
|
+
"invalid",
|
179
|
+
"is",
|
180
|
+
// is()
|
181
|
+
"lang",
|
182
|
+
// lang()
|
183
|
+
"last-child",
|
184
|
+
"last-of-type",
|
185
|
+
"left",
|
186
|
+
"link",
|
187
|
+
"local-link",
|
188
|
+
"not",
|
189
|
+
// not()
|
190
|
+
"nth-child",
|
191
|
+
// nth-child()
|
192
|
+
"nth-col",
|
193
|
+
// nth-col()
|
194
|
+
"nth-last-child",
|
195
|
+
// nth-last-child()
|
196
|
+
"nth-last-col",
|
197
|
+
// nth-last-col()
|
198
|
+
"nth-last-of-type",
|
199
|
+
//nth-last-of-type()
|
200
|
+
"nth-of-type",
|
201
|
+
//nth-of-type()
|
202
|
+
"only-child",
|
203
|
+
"only-of-type",
|
204
|
+
"optional",
|
205
|
+
"out-of-range",
|
206
|
+
"past",
|
207
|
+
"placeholder-shown",
|
208
|
+
"read-only",
|
209
|
+
"read-write",
|
210
|
+
"required",
|
211
|
+
"right",
|
212
|
+
"root",
|
213
|
+
"scope",
|
214
|
+
"target",
|
215
|
+
"target-within",
|
216
|
+
"user-invalid",
|
217
|
+
"valid",
|
218
|
+
"visited",
|
219
|
+
"where"
|
220
|
+
// where()
|
221
|
+
];
|
222
|
+
const PSEUDO_ELEMENTS = [
|
223
|
+
"after",
|
224
|
+
"backdrop",
|
225
|
+
"before",
|
226
|
+
"cue",
|
227
|
+
"cue-region",
|
228
|
+
"first-letter",
|
229
|
+
"first-line",
|
230
|
+
"grammar-error",
|
231
|
+
"marker",
|
232
|
+
"part",
|
233
|
+
"placeholder",
|
234
|
+
"selection",
|
235
|
+
"slotted",
|
236
|
+
"spelling-error"
|
237
|
+
];
|
238
|
+
const ATTRIBUTES = [
|
239
|
+
"align-content",
|
240
|
+
"align-items",
|
241
|
+
"align-self",
|
242
|
+
"all",
|
243
|
+
"animation",
|
244
|
+
"animation-delay",
|
245
|
+
"animation-direction",
|
246
|
+
"animation-duration",
|
247
|
+
"animation-fill-mode",
|
248
|
+
"animation-iteration-count",
|
249
|
+
"animation-name",
|
250
|
+
"animation-play-state",
|
251
|
+
"animation-timing-function",
|
252
|
+
"backface-visibility",
|
253
|
+
"background",
|
254
|
+
"background-attachment",
|
255
|
+
"background-blend-mode",
|
256
|
+
"background-clip",
|
257
|
+
"background-color",
|
258
|
+
"background-image",
|
259
|
+
"background-origin",
|
260
|
+
"background-position",
|
261
|
+
"background-repeat",
|
262
|
+
"background-size",
|
263
|
+
"block-size",
|
264
|
+
"border",
|
265
|
+
"border-block",
|
266
|
+
"border-block-color",
|
267
|
+
"border-block-end",
|
268
|
+
"border-block-end-color",
|
269
|
+
"border-block-end-style",
|
270
|
+
"border-block-end-width",
|
271
|
+
"border-block-start",
|
272
|
+
"border-block-start-color",
|
273
|
+
"border-block-start-style",
|
274
|
+
"border-block-start-width",
|
275
|
+
"border-block-style",
|
276
|
+
"border-block-width",
|
277
|
+
"border-bottom",
|
278
|
+
"border-bottom-color",
|
279
|
+
"border-bottom-left-radius",
|
280
|
+
"border-bottom-right-radius",
|
281
|
+
"border-bottom-style",
|
282
|
+
"border-bottom-width",
|
283
|
+
"border-collapse",
|
284
|
+
"border-color",
|
285
|
+
"border-image",
|
286
|
+
"border-image-outset",
|
287
|
+
"border-image-repeat",
|
288
|
+
"border-image-slice",
|
289
|
+
"border-image-source",
|
290
|
+
"border-image-width",
|
291
|
+
"border-inline",
|
292
|
+
"border-inline-color",
|
293
|
+
"border-inline-end",
|
294
|
+
"border-inline-end-color",
|
295
|
+
"border-inline-end-style",
|
296
|
+
"border-inline-end-width",
|
297
|
+
"border-inline-start",
|
298
|
+
"border-inline-start-color",
|
299
|
+
"border-inline-start-style",
|
300
|
+
"border-inline-start-width",
|
301
|
+
"border-inline-style",
|
302
|
+
"border-inline-width",
|
303
|
+
"border-left",
|
304
|
+
"border-left-color",
|
305
|
+
"border-left-style",
|
306
|
+
"border-left-width",
|
307
|
+
"border-radius",
|
308
|
+
"border-right",
|
309
|
+
"border-right-color",
|
310
|
+
"border-right-style",
|
311
|
+
"border-right-width",
|
312
|
+
"border-spacing",
|
313
|
+
"border-style",
|
314
|
+
"border-top",
|
315
|
+
"border-top-color",
|
316
|
+
"border-top-left-radius",
|
317
|
+
"border-top-right-radius",
|
318
|
+
"border-top-style",
|
319
|
+
"border-top-width",
|
320
|
+
"border-width",
|
321
|
+
"bottom",
|
322
|
+
"box-decoration-break",
|
323
|
+
"box-shadow",
|
324
|
+
"box-sizing",
|
325
|
+
"break-after",
|
326
|
+
"break-before",
|
327
|
+
"break-inside",
|
328
|
+
"caption-side",
|
329
|
+
"caret-color",
|
330
|
+
"clear",
|
331
|
+
"clip",
|
332
|
+
"clip-path",
|
333
|
+
"clip-rule",
|
334
|
+
"color",
|
335
|
+
"column-count",
|
336
|
+
"column-fill",
|
337
|
+
"column-gap",
|
338
|
+
"column-rule",
|
339
|
+
"column-rule-color",
|
340
|
+
"column-rule-style",
|
341
|
+
"column-rule-width",
|
342
|
+
"column-span",
|
343
|
+
"column-width",
|
344
|
+
"columns",
|
345
|
+
"contain",
|
346
|
+
"content",
|
347
|
+
"content-visibility",
|
348
|
+
"counter-increment",
|
349
|
+
"counter-reset",
|
350
|
+
"cue",
|
351
|
+
"cue-after",
|
352
|
+
"cue-before",
|
353
|
+
"cursor",
|
354
|
+
"direction",
|
355
|
+
"display",
|
356
|
+
"empty-cells",
|
357
|
+
"filter",
|
358
|
+
"flex",
|
359
|
+
"flex-basis",
|
360
|
+
"flex-direction",
|
361
|
+
"flex-flow",
|
362
|
+
"flex-grow",
|
363
|
+
"flex-shrink",
|
364
|
+
"flex-wrap",
|
365
|
+
"float",
|
366
|
+
"flow",
|
367
|
+
"font",
|
368
|
+
"font-display",
|
369
|
+
"font-family",
|
370
|
+
"font-feature-settings",
|
371
|
+
"font-kerning",
|
372
|
+
"font-language-override",
|
373
|
+
"font-size",
|
374
|
+
"font-size-adjust",
|
375
|
+
"font-smoothing",
|
376
|
+
"font-stretch",
|
377
|
+
"font-style",
|
378
|
+
"font-synthesis",
|
379
|
+
"font-variant",
|
380
|
+
"font-variant-caps",
|
381
|
+
"font-variant-east-asian",
|
382
|
+
"font-variant-ligatures",
|
383
|
+
"font-variant-numeric",
|
384
|
+
"font-variant-position",
|
385
|
+
"font-variation-settings",
|
386
|
+
"font-weight",
|
387
|
+
"gap",
|
388
|
+
"glyph-orientation-vertical",
|
389
|
+
"grid",
|
390
|
+
"grid-area",
|
391
|
+
"grid-auto-columns",
|
392
|
+
"grid-auto-flow",
|
393
|
+
"grid-auto-rows",
|
394
|
+
"grid-column",
|
395
|
+
"grid-column-end",
|
396
|
+
"grid-column-start",
|
397
|
+
"grid-gap",
|
398
|
+
"grid-row",
|
399
|
+
"grid-row-end",
|
400
|
+
"grid-row-start",
|
401
|
+
"grid-template",
|
402
|
+
"grid-template-areas",
|
403
|
+
"grid-template-columns",
|
404
|
+
"grid-template-rows",
|
405
|
+
"hanging-punctuation",
|
406
|
+
"height",
|
407
|
+
"hyphens",
|
408
|
+
"icon",
|
409
|
+
"image-orientation",
|
410
|
+
"image-rendering",
|
411
|
+
"image-resolution",
|
412
|
+
"ime-mode",
|
413
|
+
"inline-size",
|
414
|
+
"isolation",
|
415
|
+
"justify-content",
|
416
|
+
"left",
|
417
|
+
"letter-spacing",
|
418
|
+
"line-break",
|
419
|
+
"line-height",
|
420
|
+
"list-style",
|
421
|
+
"list-style-image",
|
422
|
+
"list-style-position",
|
423
|
+
"list-style-type",
|
424
|
+
"margin",
|
425
|
+
"margin-block",
|
426
|
+
"margin-block-end",
|
427
|
+
"margin-block-start",
|
428
|
+
"margin-bottom",
|
429
|
+
"margin-inline",
|
430
|
+
"margin-inline-end",
|
431
|
+
"margin-inline-start",
|
432
|
+
"margin-left",
|
433
|
+
"margin-right",
|
434
|
+
"margin-top",
|
435
|
+
"marks",
|
436
|
+
"mask",
|
437
|
+
"mask-border",
|
438
|
+
"mask-border-mode",
|
439
|
+
"mask-border-outset",
|
440
|
+
"mask-border-repeat",
|
441
|
+
"mask-border-slice",
|
442
|
+
"mask-border-source",
|
443
|
+
"mask-border-width",
|
444
|
+
"mask-clip",
|
445
|
+
"mask-composite",
|
446
|
+
"mask-image",
|
447
|
+
"mask-mode",
|
448
|
+
"mask-origin",
|
449
|
+
"mask-position",
|
450
|
+
"mask-repeat",
|
451
|
+
"mask-size",
|
452
|
+
"mask-type",
|
453
|
+
"max-block-size",
|
454
|
+
"max-height",
|
455
|
+
"max-inline-size",
|
456
|
+
"max-width",
|
457
|
+
"min-block-size",
|
458
|
+
"min-height",
|
459
|
+
"min-inline-size",
|
460
|
+
"min-width",
|
461
|
+
"mix-blend-mode",
|
462
|
+
"nav-down",
|
463
|
+
"nav-index",
|
464
|
+
"nav-left",
|
465
|
+
"nav-right",
|
466
|
+
"nav-up",
|
467
|
+
"none",
|
468
|
+
"normal",
|
469
|
+
"object-fit",
|
470
|
+
"object-position",
|
471
|
+
"opacity",
|
472
|
+
"order",
|
473
|
+
"orphans",
|
474
|
+
"outline",
|
475
|
+
"outline-color",
|
476
|
+
"outline-offset",
|
477
|
+
"outline-style",
|
478
|
+
"outline-width",
|
479
|
+
"overflow",
|
480
|
+
"overflow-wrap",
|
481
|
+
"overflow-x",
|
482
|
+
"overflow-y",
|
483
|
+
"padding",
|
484
|
+
"padding-block",
|
485
|
+
"padding-block-end",
|
486
|
+
"padding-block-start",
|
487
|
+
"padding-bottom",
|
488
|
+
"padding-inline",
|
489
|
+
"padding-inline-end",
|
490
|
+
"padding-inline-start",
|
491
|
+
"padding-left",
|
492
|
+
"padding-right",
|
493
|
+
"padding-top",
|
494
|
+
"page-break-after",
|
495
|
+
"page-break-before",
|
496
|
+
"page-break-inside",
|
497
|
+
"pause",
|
498
|
+
"pause-after",
|
499
|
+
"pause-before",
|
500
|
+
"perspective",
|
501
|
+
"perspective-origin",
|
502
|
+
"pointer-events",
|
503
|
+
"position",
|
504
|
+
"quotes",
|
505
|
+
"resize",
|
506
|
+
"rest",
|
507
|
+
"rest-after",
|
508
|
+
"rest-before",
|
509
|
+
"right",
|
510
|
+
"row-gap",
|
511
|
+
"scroll-margin",
|
512
|
+
"scroll-margin-block",
|
513
|
+
"scroll-margin-block-end",
|
514
|
+
"scroll-margin-block-start",
|
515
|
+
"scroll-margin-bottom",
|
516
|
+
"scroll-margin-inline",
|
517
|
+
"scroll-margin-inline-end",
|
518
|
+
"scroll-margin-inline-start",
|
519
|
+
"scroll-margin-left",
|
520
|
+
"scroll-margin-right",
|
521
|
+
"scroll-margin-top",
|
522
|
+
"scroll-padding",
|
523
|
+
"scroll-padding-block",
|
524
|
+
"scroll-padding-block-end",
|
525
|
+
"scroll-padding-block-start",
|
526
|
+
"scroll-padding-bottom",
|
527
|
+
"scroll-padding-inline",
|
528
|
+
"scroll-padding-inline-end",
|
529
|
+
"scroll-padding-inline-start",
|
530
|
+
"scroll-padding-left",
|
531
|
+
"scroll-padding-right",
|
532
|
+
"scroll-padding-top",
|
533
|
+
"scroll-snap-align",
|
534
|
+
"scroll-snap-stop",
|
535
|
+
"scroll-snap-type",
|
536
|
+
"scrollbar-color",
|
537
|
+
"scrollbar-gutter",
|
538
|
+
"scrollbar-width",
|
539
|
+
"shape-image-threshold",
|
540
|
+
"shape-margin",
|
541
|
+
"shape-outside",
|
542
|
+
"speak",
|
543
|
+
"speak-as",
|
544
|
+
"src",
|
545
|
+
// @font-face
|
546
|
+
"tab-size",
|
547
|
+
"table-layout",
|
548
|
+
"text-align",
|
549
|
+
"text-align-all",
|
550
|
+
"text-align-last",
|
551
|
+
"text-combine-upright",
|
552
|
+
"text-decoration",
|
553
|
+
"text-decoration-color",
|
554
|
+
"text-decoration-line",
|
555
|
+
"text-decoration-style",
|
556
|
+
"text-emphasis",
|
557
|
+
"text-emphasis-color",
|
558
|
+
"text-emphasis-position",
|
559
|
+
"text-emphasis-style",
|
560
|
+
"text-indent",
|
561
|
+
"text-justify",
|
562
|
+
"text-orientation",
|
563
|
+
"text-overflow",
|
564
|
+
"text-rendering",
|
565
|
+
"text-shadow",
|
566
|
+
"text-transform",
|
567
|
+
"text-underline-position",
|
568
|
+
"top",
|
569
|
+
"transform",
|
570
|
+
"transform-box",
|
571
|
+
"transform-origin",
|
572
|
+
"transform-style",
|
573
|
+
"transition",
|
574
|
+
"transition-delay",
|
575
|
+
"transition-duration",
|
576
|
+
"transition-property",
|
577
|
+
"transition-timing-function",
|
578
|
+
"unicode-bidi",
|
579
|
+
"vertical-align",
|
580
|
+
"visibility",
|
581
|
+
"voice-balance",
|
582
|
+
"voice-duration",
|
583
|
+
"voice-family",
|
584
|
+
"voice-pitch",
|
585
|
+
"voice-range",
|
586
|
+
"voice-rate",
|
587
|
+
"voice-stress",
|
588
|
+
"voice-volume",
|
589
|
+
"white-space",
|
590
|
+
"widows",
|
591
|
+
"width",
|
592
|
+
"will-change",
|
593
|
+
"word-break",
|
594
|
+
"word-spacing",
|
595
|
+
"word-wrap",
|
596
|
+
"writing-mode",
|
597
|
+
"z-index"
|
598
|
+
// reverse makes sure longer attributes `font-weight` are matched fully
|
599
|
+
// instead of getting false positives on say `font`
|
600
|
+
].reverse();
|
601
|
+
function css(hljs) {
|
602
|
+
const regex = hljs.regex;
|
603
|
+
const modes = MODES(hljs);
|
604
|
+
const VENDOR_PREFIX = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ };
|
605
|
+
const AT_MODIFIERS = "and or not only";
|
606
|
+
const AT_PROPERTY_RE = /@-?\w[\w]*(-\w+)*/;
|
607
|
+
const IDENT_RE = "[a-zA-Z-][a-zA-Z0-9_-]*";
|
608
|
+
const STRINGS = [
|
609
|
+
hljs.APOS_STRING_MODE,
|
610
|
+
hljs.QUOTE_STRING_MODE
|
611
|
+
];
|
612
|
+
return {
|
613
|
+
name: "CSS",
|
614
|
+
case_insensitive: true,
|
615
|
+
illegal: /[=|'\$]/,
|
616
|
+
keywords: { keyframePosition: "from to" },
|
617
|
+
classNameAliases: {
|
618
|
+
// for visual continuity with `tag {}` and because we
|
619
|
+
// don't have a great class for this?
|
620
|
+
keyframePosition: "selector-tag"
|
621
|
+
},
|
622
|
+
contains: [
|
623
|
+
modes.BLOCK_COMMENT,
|
624
|
+
VENDOR_PREFIX,
|
625
|
+
// to recognize keyframe 40% etc which are outside the scope of our
|
626
|
+
// attribute value mode
|
627
|
+
modes.CSS_NUMBER_MODE,
|
628
|
+
{
|
629
|
+
className: "selector-id",
|
630
|
+
begin: /#[A-Za-z0-9_-]+/,
|
631
|
+
relevance: 0
|
632
|
+
},
|
633
|
+
{
|
634
|
+
className: "selector-class",
|
635
|
+
begin: "\\." + IDENT_RE,
|
636
|
+
relevance: 0
|
637
|
+
},
|
638
|
+
modes.ATTRIBUTE_SELECTOR_MODE,
|
639
|
+
{
|
640
|
+
className: "selector-pseudo",
|
641
|
+
variants: [
|
642
|
+
{ begin: ":(" + PSEUDO_CLASSES.join("|") + ")" },
|
643
|
+
{ begin: ":(:)?(" + PSEUDO_ELEMENTS.join("|") + ")" }
|
644
|
+
]
|
645
|
+
},
|
646
|
+
// we may actually need this (12/2020)
|
647
|
+
// { // pseudo-selector params
|
648
|
+
// begin: /\(/,
|
649
|
+
// end: /\)/,
|
650
|
+
// contains: [ hljs.CSS_NUMBER_MODE ]
|
651
|
+
// },
|
652
|
+
modes.CSS_VARIABLE,
|
653
|
+
{
|
654
|
+
className: "attribute",
|
655
|
+
begin: "\\b(" + ATTRIBUTES.join("|") + ")\\b"
|
656
|
+
},
|
657
|
+
// attribute values
|
658
|
+
{
|
659
|
+
begin: /:/,
|
660
|
+
end: /[;}{]/,
|
661
|
+
contains: [
|
662
|
+
modes.BLOCK_COMMENT,
|
663
|
+
modes.HEXCOLOR,
|
664
|
+
modes.IMPORTANT,
|
665
|
+
modes.CSS_NUMBER_MODE,
|
666
|
+
...STRINGS,
|
667
|
+
// needed to highlight these as strings and to avoid issues with
|
668
|
+
// illegal characters that might be inside urls that would tigger the
|
669
|
+
// languages illegal stack
|
670
|
+
{
|
671
|
+
begin: /(url|data-uri)\(/,
|
672
|
+
end: /\)/,
|
673
|
+
relevance: 0,
|
674
|
+
// from keywords
|
675
|
+
keywords: { built_in: "url data-uri" },
|
676
|
+
contains: [
|
677
|
+
...STRINGS,
|
678
|
+
{
|
679
|
+
className: "string",
|
680
|
+
// any character other than `)` as in `url()` will be the start
|
681
|
+
// of a string, which ends with `)` (from the parent mode)
|
682
|
+
begin: /[^)]/,
|
683
|
+
endsWithParent: true,
|
684
|
+
excludeEnd: true
|
685
|
+
}
|
686
|
+
]
|
687
|
+
},
|
688
|
+
modes.FUNCTION_DISPATCH
|
689
|
+
]
|
690
|
+
},
|
691
|
+
{
|
692
|
+
begin: regex.lookahead(/@/),
|
693
|
+
end: "[{;]",
|
694
|
+
relevance: 0,
|
695
|
+
illegal: /:/,
|
696
|
+
// break on Less variables @var: ...
|
697
|
+
contains: [
|
698
|
+
{
|
699
|
+
className: "keyword",
|
700
|
+
begin: AT_PROPERTY_RE
|
701
|
+
},
|
702
|
+
{
|
703
|
+
begin: /\s/,
|
704
|
+
endsWithParent: true,
|
705
|
+
excludeEnd: true,
|
706
|
+
relevance: 0,
|
707
|
+
keywords: {
|
708
|
+
$pattern: /[a-z-]+/,
|
709
|
+
keyword: AT_MODIFIERS,
|
710
|
+
attribute: MEDIA_FEATURES.join(" ")
|
711
|
+
},
|
712
|
+
contains: [
|
713
|
+
{
|
714
|
+
begin: /[a-z-]+(?=:)/,
|
715
|
+
className: "attribute"
|
716
|
+
},
|
717
|
+
...STRINGS,
|
718
|
+
modes.CSS_NUMBER_MODE
|
719
|
+
]
|
720
|
+
}
|
721
|
+
]
|
722
|
+
},
|
723
|
+
{
|
724
|
+
className: "selector-tag",
|
725
|
+
begin: "\\b(" + TAGS.join("|") + ")\\b"
|
726
|
+
}
|
727
|
+
]
|
728
|
+
};
|
729
|
+
}
|
730
|
+
export {
|
731
|
+
css as default
|
732
|
+
};
|