@bagelink/vue 0.0.986 → 0.0.992
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/Btn.vue.d.ts.map +1 -1
- package/dist/components/Loading.vue.d.ts +16 -0
- package/dist/components/Loading.vue.d.ts.map +1 -0
- package/dist/components/form/BglField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/CodeEditor/CodeTypes.d.ts +197 -0
- package/dist/components/form/inputs/CodeEditor/CodeTypes.d.ts.map +1 -0
- package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts +15 -0
- package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/CodeEditor/format.d.ts +2 -0
- package/dist/components/form/inputs/CodeEditor/format.d.ts.map +1 -0
- package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/Toolbar.vue.d.ts +5 -3
- package/dist/components/form/inputs/RichText/Toolbar.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/components/Toolbar.vue.d.ts +14 -0
- package/dist/components/form/inputs/RichText/components/Toolbar.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/RichText/components/gridBox.vue.d.ts +7 -0
- package/dist/components/form/inputs/RichText/components/gridBox.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/RichText/composables/useEditor.d.ts +86 -0
- package/dist/components/form/inputs/RichText/composables/useEditor.d.ts.map +1 -0
- package/dist/components/form/inputs/RichText/composables/useEditorKeyboard.d.ts +2 -0
- package/dist/components/form/inputs/RichText/composables/useEditorKeyboard.d.ts.map +1 -0
- package/dist/components/form/inputs/RichText/config.d.ts +5 -0
- package/dist/components/form/inputs/RichText/config.d.ts.map +1 -0
- package/dist/components/form/inputs/RichText/index.vue.d.ts +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/utils/formatting.d.ts +7 -0
- package/dist/components/form/inputs/RichText/utils/formatting.d.ts.map +1 -0
- package/dist/components/form/inputs/RichText/utils/media.d.ts +4 -0
- package/dist/components/form/inputs/RichText/utils/media.d.ts.map +1 -0
- package/dist/components/form/inputs/RichText/utils/selection.d.ts +4 -0
- package/dist/components/form/inputs/RichText/utils/selection.d.ts.map +1 -0
- package/dist/components/form/inputs/RichText/utils/table.d.ts +7 -0
- package/dist/components/form/inputs/RichText/utils/table.d.ts.map +1 -0
- package/dist/components/form/inputs/index.d.ts +1 -0
- package/dist/components/form/inputs/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/layout/TabsNav.vue.d.ts.map +1 -1
- package/dist/editor-CUDRLdmS.js +4 -0
- package/dist/editor-Cu374vEW.cjs +4 -0
- package/dist/editor-a8DSbb6P.js +4 -0
- package/dist/editor-xBt_vIha.cjs +4 -0
- package/dist/index.cjs +15594 -1103
- package/dist/index.mjs +15595 -1104
- package/dist/style.css +790 -511
- package/package.json +6 -33
- package/src/components/Btn.vue +113 -136
- package/src/components/Loading.vue +177 -0
- package/src/components/form/BglField.vue +2 -0
- package/src/components/form/inputs/CodeEditor/CodeTypes.ts +446 -0
- package/src/components/form/inputs/CodeEditor/Index.vue +117 -0
- package/src/components/form/inputs/CodeEditor/format.ts +98 -0
- package/src/components/form/inputs/FileUpload.vue +2 -1
- package/src/components/form/inputs/RichText/components/Toolbar.vue +51 -0
- package/src/components/form/inputs/RichText/components/gridBox.vue +51 -0
- package/src/components/form/inputs/RichText/composables/useEditor.ts +215 -0
- package/src/components/form/inputs/RichText/composables/useEditorKeyboard.ts +21 -0
- package/src/components/form/inputs/RichText/config.ts +73 -0
- package/src/components/form/inputs/RichText/editor.css +25 -0
- package/src/components/form/inputs/RichText/index.vue +84 -195
- package/src/components/form/inputs/RichText/richTextTypes.d.ts +77 -0
- package/src/components/form/inputs/RichText/utils/formatting.ts +98 -0
- package/src/components/form/inputs/RichText/utils/media.ts +42 -0
- package/src/components/form/inputs/RichText/utils/selection.ts +48 -0
- package/src/components/form/inputs/RichText/utils/table.ts +81 -0
- package/src/components/form/inputs/index.ts +1 -0
- package/src/components/index.ts +2 -2
- package/src/components/layout/TabsNav.vue +1 -0
- package/src/styles/theme.css +256 -256
- package/src/components/form/inputs/RichText/Toolbar.vue +0 -87
- package/src/components/form/inputs/RichText/formatting.ts +0 -246
- package/src/components/form/inputs/RichText/richtext-types.ts +0 -29
- package/src/components/formkit/FileUploader.vue +0 -406
- package/src/components/formkit/MiscFields.vue +0 -74
- package/src/components/formkit/Toggle.vue +0 -149
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
export const codeLanguages = {
|
|
2
|
+
'1c': '1C',
|
|
3
|
+
'abnf': 'ABNF',
|
|
4
|
+
'accesslog': 'Access Log',
|
|
5
|
+
'actionscript': 'ActionScript',
|
|
6
|
+
'ada': 'Ada',
|
|
7
|
+
'angelscript': 'AngelScript',
|
|
8
|
+
'apache': 'Apache',
|
|
9
|
+
'applescript': 'AppleScript',
|
|
10
|
+
'arcade': 'Arcade',
|
|
11
|
+
'arduino': 'Arduino',
|
|
12
|
+
'armasm': 'ARM Assembly',
|
|
13
|
+
'asciidoc': 'AsciiDoc',
|
|
14
|
+
'aspectj': 'AspectJ',
|
|
15
|
+
'autohotkey': 'AutoHotkey',
|
|
16
|
+
'autoit': 'AutoIt',
|
|
17
|
+
'avrasm': 'AVR Assembly',
|
|
18
|
+
'awk': 'AWK',
|
|
19
|
+
'axapta': 'Axapta',
|
|
20
|
+
'bash': 'Bash',
|
|
21
|
+
'basic': 'Basic',
|
|
22
|
+
'bnf': 'BNF',
|
|
23
|
+
'brainfuck': 'Brainfuck',
|
|
24
|
+
'c': 'C',
|
|
25
|
+
'cal': 'C/AL',
|
|
26
|
+
'capnproto': 'Cap’n Proto',
|
|
27
|
+
'ceylon': 'Ceylon',
|
|
28
|
+
'clean': 'Clean',
|
|
29
|
+
'clojure': 'Clojure',
|
|
30
|
+
'clojure-repl': 'Clojure REPL',
|
|
31
|
+
'cmake': 'CMake',
|
|
32
|
+
'coffeescript': 'CoffeeScript',
|
|
33
|
+
'coq': 'Coq',
|
|
34
|
+
'cos': 'Caché ObjectScript',
|
|
35
|
+
'cpp': 'C++',
|
|
36
|
+
'crmsh': 'crmsh',
|
|
37
|
+
'crystal': 'Crystal',
|
|
38
|
+
'csharp': 'C#',
|
|
39
|
+
'csp': 'CSP',
|
|
40
|
+
'css': 'CSS',
|
|
41
|
+
'd': 'D',
|
|
42
|
+
'markdown': 'Markdown',
|
|
43
|
+
'dart': 'Dart',
|
|
44
|
+
'delphi': 'Delphi',
|
|
45
|
+
'diff': 'Diff',
|
|
46
|
+
'django': 'Django',
|
|
47
|
+
'dns': 'DNS Zone',
|
|
48
|
+
'dockerfile': 'Dockerfile',
|
|
49
|
+
'dos': 'DOS',
|
|
50
|
+
'dsconfig': 'dsconfig',
|
|
51
|
+
'dts': 'DTS',
|
|
52
|
+
'dust': 'Dust',
|
|
53
|
+
'ebnf': 'EBNF',
|
|
54
|
+
'elixir': 'Elixir',
|
|
55
|
+
'elm': 'Elm',
|
|
56
|
+
'ruby': 'Ruby',
|
|
57
|
+
'erb': 'ERB',
|
|
58
|
+
'erlang-repl': 'Erlang REPL',
|
|
59
|
+
'erlang': 'Erlang',
|
|
60
|
+
'excel': 'Excel',
|
|
61
|
+
'fix': 'FIX',
|
|
62
|
+
'flix': 'Flix',
|
|
63
|
+
'fortran': 'Fortran',
|
|
64
|
+
'fsharp': 'F#',
|
|
65
|
+
'gams': 'GAMS',
|
|
66
|
+
'gauss': 'GAUSS',
|
|
67
|
+
'gcode': 'G-code',
|
|
68
|
+
'gherkin': 'Gherkin',
|
|
69
|
+
'glsl': 'GLSL',
|
|
70
|
+
'gml': 'GameMaker Language',
|
|
71
|
+
'go': 'GoLang',
|
|
72
|
+
'golo': 'Golo',
|
|
73
|
+
'gradle': 'Gradle',
|
|
74
|
+
'graphql': 'GraphQL',
|
|
75
|
+
'groovy': 'Groovy',
|
|
76
|
+
'haml': 'HAML',
|
|
77
|
+
'handlebars': 'Handlebars',
|
|
78
|
+
'haskell': 'Haskell',
|
|
79
|
+
'haxe': 'Haxe',
|
|
80
|
+
'hsp': 'HSP',
|
|
81
|
+
'http': 'HTTP',
|
|
82
|
+
'hy': 'Hy',
|
|
83
|
+
'inform7': 'Inform 7',
|
|
84
|
+
'ini': 'INI',
|
|
85
|
+
'irpf90': 'IRPF90',
|
|
86
|
+
'isbl': 'ISBL',
|
|
87
|
+
'java': 'Java',
|
|
88
|
+
'javascript': 'JS',
|
|
89
|
+
'jboss-cli': 'JBoss CLI',
|
|
90
|
+
'json': 'JSON',
|
|
91
|
+
'julia': 'Julia',
|
|
92
|
+
'julia-repl': 'Julia REPL',
|
|
93
|
+
'kotlin': 'Kotlin',
|
|
94
|
+
'lasso': 'Lasso',
|
|
95
|
+
'latex': 'LaTeX',
|
|
96
|
+
'ldif': 'LDIF',
|
|
97
|
+
'leaf': 'Leaf',
|
|
98
|
+
'less': 'Less',
|
|
99
|
+
'lisp': 'Lisp',
|
|
100
|
+
'livecodeserver': 'LiveCode Server',
|
|
101
|
+
'livescript': 'LiveScript',
|
|
102
|
+
'llvm': 'LLVM',
|
|
103
|
+
'lsl': 'LSL',
|
|
104
|
+
'lua': 'Lua',
|
|
105
|
+
'makefile': 'Makefile',
|
|
106
|
+
'mathematica': 'Mathematica',
|
|
107
|
+
'matlab': 'MATLAB',
|
|
108
|
+
'maxima': 'Maxima',
|
|
109
|
+
'mel': 'MEL',
|
|
110
|
+
'mercury': 'Mercury',
|
|
111
|
+
'mipsasm': 'MIPS Assembly',
|
|
112
|
+
'mizar': 'Mizar',
|
|
113
|
+
'mojolicious': 'Mojolicious',
|
|
114
|
+
'monkey': 'Monkey',
|
|
115
|
+
'moonscript': 'MoonScript',
|
|
116
|
+
'n1ql': 'N1QL',
|
|
117
|
+
'nestedtext': 'NestedText',
|
|
118
|
+
'nginx': 'Nginx',
|
|
119
|
+
'nim': 'Nim',
|
|
120
|
+
'nix': 'Nix',
|
|
121
|
+
'node-repl': 'Node REPL',
|
|
122
|
+
'nsis': 'NSIS',
|
|
123
|
+
'objectivec': 'Objective-C',
|
|
124
|
+
'ocaml': 'OCaml',
|
|
125
|
+
'openscad': 'OpenSCAD',
|
|
126
|
+
'oxygene': 'Oxygene',
|
|
127
|
+
'parser3': 'Parser3',
|
|
128
|
+
'pf': 'PF',
|
|
129
|
+
'pgsql': 'PostgreSQL',
|
|
130
|
+
'php': 'PHP',
|
|
131
|
+
'php-template': 'PHP Template',
|
|
132
|
+
'plaintext': 'Plain Text',
|
|
133
|
+
'pony': 'Pony',
|
|
134
|
+
'powershell': 'PowerShell',
|
|
135
|
+
'processing': 'Processing',
|
|
136
|
+
'profile': 'Profile',
|
|
137
|
+
'prolog': 'Prolog',
|
|
138
|
+
'properties': 'Properties',
|
|
139
|
+
'protobuf': 'Protocol Buffers',
|
|
140
|
+
'puppet': 'Puppet',
|
|
141
|
+
'purebasic': 'PureBasic',
|
|
142
|
+
'python': 'Python',
|
|
143
|
+
'python-repl': 'Python REPL',
|
|
144
|
+
'q': 'Q',
|
|
145
|
+
'qml': 'QML',
|
|
146
|
+
'r': 'R',
|
|
147
|
+
'reasonml': 'ReasonML',
|
|
148
|
+
'rib': 'RenderMan RIB',
|
|
149
|
+
'roboconf': 'Roboconf',
|
|
150
|
+
'routeros': 'RouterOS',
|
|
151
|
+
'rsl': 'RSL',
|
|
152
|
+
'ruleslanguage': 'RulesLanguage',
|
|
153
|
+
'rust': 'Rust',
|
|
154
|
+
'sas': 'SAS',
|
|
155
|
+
'scala': 'Scala',
|
|
156
|
+
'scheme': 'Scheme',
|
|
157
|
+
'scilab': 'Scilab',
|
|
158
|
+
'scss': 'SCSS',
|
|
159
|
+
'shell': 'Shell',
|
|
160
|
+
'smali': 'Smali',
|
|
161
|
+
'smalltalk': 'Smalltalk',
|
|
162
|
+
'sml': 'SML',
|
|
163
|
+
'sqf': 'SQF',
|
|
164
|
+
'sql': 'SQL',
|
|
165
|
+
'stan': 'Stan',
|
|
166
|
+
'stata': 'Stata',
|
|
167
|
+
'step21': 'STEP Part 21',
|
|
168
|
+
'stylus': 'Stylus',
|
|
169
|
+
'subunit': 'SubUnit',
|
|
170
|
+
'swift': 'Swift',
|
|
171
|
+
'taggerscript': 'TaggerScript',
|
|
172
|
+
'yaml': 'YAML',
|
|
173
|
+
'tap': 'TAP',
|
|
174
|
+
'tcl': 'Tcl',
|
|
175
|
+
'thrift': 'Thrift',
|
|
176
|
+
'tp': 'TP',
|
|
177
|
+
'twig': 'Twig',
|
|
178
|
+
'typescript': 'TS',
|
|
179
|
+
'vala': 'Vala',
|
|
180
|
+
'vbnet': 'VB.NET',
|
|
181
|
+
'vbscript': 'VBScript',
|
|
182
|
+
'vbscript-html': 'VBScript in HTML',
|
|
183
|
+
'verilog': 'Verilog',
|
|
184
|
+
'vhdl': 'VHDL',
|
|
185
|
+
'vim': 'Vim',
|
|
186
|
+
'wasm': 'WebAssembly',
|
|
187
|
+
'wren': 'Wren',
|
|
188
|
+
'x86asm': 'x86 Assembly',
|
|
189
|
+
'xl': 'XL',
|
|
190
|
+
'xquery': 'XQuery',
|
|
191
|
+
'xml': 'XML',
|
|
192
|
+
'zephir': 'Zephir',
|
|
193
|
+
'html': 'HTML',
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export type Language = keyof typeof codeLanguages
|
|
197
|
+
|
|
198
|
+
export type CodeTheme =
|
|
199
|
+
| 'a11y-dark'
|
|
200
|
+
| 'a11y-light'
|
|
201
|
+
| 'agate'
|
|
202
|
+
| 'an-old-hope'
|
|
203
|
+
| 'androidstudio'
|
|
204
|
+
| 'arduino-light'
|
|
205
|
+
| 'arta'
|
|
206
|
+
| 'ascetic'
|
|
207
|
+
| 'atom-one-dark-reasonable'
|
|
208
|
+
| 'atom-one-dark'
|
|
209
|
+
| 'atom-one-light'
|
|
210
|
+
| 'brown-paper'
|
|
211
|
+
| 'codepen-embed'
|
|
212
|
+
| 'color-brewer'
|
|
213
|
+
| 'dark'
|
|
214
|
+
| 'default'
|
|
215
|
+
| 'devibeans'
|
|
216
|
+
| 'docco'
|
|
217
|
+
| 'far'
|
|
218
|
+
| 'felipec'
|
|
219
|
+
| 'foundation'
|
|
220
|
+
| 'github-dark-dimmed'
|
|
221
|
+
| 'github-dark'
|
|
222
|
+
| 'github'
|
|
223
|
+
| 'gml'
|
|
224
|
+
| 'googlecode'
|
|
225
|
+
| 'gradient-dark'
|
|
226
|
+
| 'gradient-light'
|
|
227
|
+
| 'grayscale'
|
|
228
|
+
| 'hybrid'
|
|
229
|
+
| 'idea'
|
|
230
|
+
| 'intellij-light'
|
|
231
|
+
| 'ir-black'
|
|
232
|
+
| 'isbl-editor-dark'
|
|
233
|
+
| 'isbl-editor-light'
|
|
234
|
+
| 'kimbie-dark'
|
|
235
|
+
| 'kimbie-light'
|
|
236
|
+
| 'lightfair'
|
|
237
|
+
| 'lioshi'
|
|
238
|
+
| 'magula'
|
|
239
|
+
| 'mono-blue'
|
|
240
|
+
| 'monokai-sublime'
|
|
241
|
+
| 'monokai'
|
|
242
|
+
| 'night-owl'
|
|
243
|
+
| 'nnfx-dark'
|
|
244
|
+
| 'nnfx-light'
|
|
245
|
+
| 'nord'
|
|
246
|
+
| 'obsidian'
|
|
247
|
+
| 'panda-syntax-dark'
|
|
248
|
+
| 'panda-syntax-light'
|
|
249
|
+
| 'paraiso-dark'
|
|
250
|
+
| 'paraiso-light'
|
|
251
|
+
| 'pojoaque'
|
|
252
|
+
| 'purebasic'
|
|
253
|
+
| 'qtcreator-dark'
|
|
254
|
+
| 'qtcreator-light'
|
|
255
|
+
| 'rainbow'
|
|
256
|
+
| 'routeros'
|
|
257
|
+
| 'school-book'
|
|
258
|
+
| 'shades-of-purple'
|
|
259
|
+
| 'srcery'
|
|
260
|
+
| 'stackoverflow-dark'
|
|
261
|
+
| 'stackoverflow-light'
|
|
262
|
+
| 'sunburst'
|
|
263
|
+
| 'tokyo-night-dark'
|
|
264
|
+
| 'tokyo-night-light'
|
|
265
|
+
| 'tomorrow-night-blue'
|
|
266
|
+
| 'tomorrow-night-bright'
|
|
267
|
+
| 'vs'
|
|
268
|
+
| 'vs2015'
|
|
269
|
+
| 'xcode'
|
|
270
|
+
| 'xt256'
|
|
271
|
+
| 'base16-3024'
|
|
272
|
+
| 'base16-apathy'
|
|
273
|
+
| 'base16-apprentice'
|
|
274
|
+
| 'base16-ashes'
|
|
275
|
+
| 'base16-atelier-cave-light'
|
|
276
|
+
| 'base16-atelier-cave'
|
|
277
|
+
| 'base16-atelier-dune-light'
|
|
278
|
+
| 'base16-atelier-dune'
|
|
279
|
+
| 'base16-atelier-estuary-light'
|
|
280
|
+
| 'base16-atelier-estuary'
|
|
281
|
+
| 'base16-atelier-forest-light'
|
|
282
|
+
| 'base16-atelier-forest'
|
|
283
|
+
| 'base16-atelier-heath-light'
|
|
284
|
+
| 'base16-atelier-heath'
|
|
285
|
+
| 'base16-atelier-lakeside-light'
|
|
286
|
+
| 'base16-atelier-lakeside'
|
|
287
|
+
| 'base16-atelier-plateau-light'
|
|
288
|
+
| 'base16-atelier-plateau'
|
|
289
|
+
| 'base16-atelier-savanna-light'
|
|
290
|
+
| 'base16-atelier-savanna'
|
|
291
|
+
| 'base16-atelier-seaside-light'
|
|
292
|
+
| 'base16-atelier-seaside'
|
|
293
|
+
| 'base16-atelier-sulphurpool-light'
|
|
294
|
+
| 'base16-atelier-sulphurpool'
|
|
295
|
+
| 'base16-atlas'
|
|
296
|
+
| 'base16-bespin'
|
|
297
|
+
| 'base16-black-metal-bathory'
|
|
298
|
+
| 'base16-black-metal-burzum'
|
|
299
|
+
| 'base16-black-metal-dark-funeral'
|
|
300
|
+
| 'base16-black-metal-gorgoroth'
|
|
301
|
+
| 'base16-black-metal-immortal'
|
|
302
|
+
| 'base16-black-metal-khold'
|
|
303
|
+
| 'base16-black-metal-marduk'
|
|
304
|
+
| 'base16-black-metal-mayhem'
|
|
305
|
+
| 'base16-black-metal-nile'
|
|
306
|
+
| 'base16-black-metal-venom'
|
|
307
|
+
| 'base16-black-metal'
|
|
308
|
+
| 'base16-brewer'
|
|
309
|
+
| 'base16-bright'
|
|
310
|
+
| 'base16-brogrammer'
|
|
311
|
+
| 'base16-brush-trees-dark'
|
|
312
|
+
| 'base16-brush-trees'
|
|
313
|
+
| 'base16-chalk'
|
|
314
|
+
| 'base16-circus'
|
|
315
|
+
| 'base16-classic-dark'
|
|
316
|
+
| 'base16-classic-light'
|
|
317
|
+
| 'base16-codeschool'
|
|
318
|
+
| 'base16-colors'
|
|
319
|
+
| 'base16-cupcake'
|
|
320
|
+
| 'base16-cupertino'
|
|
321
|
+
| 'base16-danqing'
|
|
322
|
+
| 'base16-darcula'
|
|
323
|
+
| 'base16-dark-violet'
|
|
324
|
+
| 'base16-darkmoss'
|
|
325
|
+
| 'base16-darktooth'
|
|
326
|
+
| 'base16-decaf'
|
|
327
|
+
| 'base16-default-dark'
|
|
328
|
+
| 'base16-default-light'
|
|
329
|
+
| 'base16-dirtysea'
|
|
330
|
+
| 'base16-dracula'
|
|
331
|
+
| 'base16-edge-dark'
|
|
332
|
+
| 'base16-edge-light'
|
|
333
|
+
| 'base16-eighties'
|
|
334
|
+
| 'base16-embers'
|
|
335
|
+
| 'base16-equilibrium-dark'
|
|
336
|
+
| 'base16-equilibrium-gray-dark'
|
|
337
|
+
| 'base16-equilibrium-gray-light'
|
|
338
|
+
| 'base16-equilibrium-light'
|
|
339
|
+
| 'base16-espresso'
|
|
340
|
+
| 'base16-eva-dim'
|
|
341
|
+
| 'base16-eva'
|
|
342
|
+
| 'base16-flat'
|
|
343
|
+
| 'base16-framer'
|
|
344
|
+
| 'base16-fruit-soda'
|
|
345
|
+
| 'base16-gigavolt'
|
|
346
|
+
| 'base16-github'
|
|
347
|
+
| 'base16-google-dark'
|
|
348
|
+
| 'base16-google-light'
|
|
349
|
+
| 'base16-grayscale-dark'
|
|
350
|
+
| 'base16-grayscale-light'
|
|
351
|
+
| 'base16-green-screen'
|
|
352
|
+
| 'base16-gruvbox-dark-hard'
|
|
353
|
+
| 'base16-gruvbox-dark-medium'
|
|
354
|
+
| 'base16-gruvbox-dark-pale'
|
|
355
|
+
| 'base16-gruvbox-dark-soft'
|
|
356
|
+
| 'base16-gruvbox-light-hard'
|
|
357
|
+
| 'base16-gruvbox-light-medium'
|
|
358
|
+
| 'base16-gruvbox-light-soft'
|
|
359
|
+
| 'base16-hardcore'
|
|
360
|
+
| 'base16-harmonic16-dark'
|
|
361
|
+
| 'base16-harmonic16-light'
|
|
362
|
+
| 'base16-heetch-dark'
|
|
363
|
+
| 'base16-heetch-light'
|
|
364
|
+
| 'base16-helios'
|
|
365
|
+
| 'base16-hopscotch'
|
|
366
|
+
| 'base16-horizon-dark'
|
|
367
|
+
| 'base16-horizon-light'
|
|
368
|
+
| 'base16-humanoid-dark'
|
|
369
|
+
| 'base16-humanoid-light'
|
|
370
|
+
| 'base16-ia-dark'
|
|
371
|
+
| 'base16-ia-light'
|
|
372
|
+
| 'base16-icy-dark'
|
|
373
|
+
| 'base16-ir-black'
|
|
374
|
+
| 'base16-isotope'
|
|
375
|
+
| 'base16-kimber'
|
|
376
|
+
| 'base16-london-tube'
|
|
377
|
+
| 'base16-macintosh'
|
|
378
|
+
| 'base16-marrakesh'
|
|
379
|
+
| 'base16-materia'
|
|
380
|
+
| 'base16-material-darker'
|
|
381
|
+
| 'base16-material-lighter'
|
|
382
|
+
| 'base16-material-palenight'
|
|
383
|
+
| 'base16-material-vivid'
|
|
384
|
+
| 'base16-material'
|
|
385
|
+
| 'base16-mellow-purple'
|
|
386
|
+
| 'base16-mexico-light'
|
|
387
|
+
| 'base16-mocha'
|
|
388
|
+
| 'base16-monokai'
|
|
389
|
+
| 'base16-nebula'
|
|
390
|
+
| 'base16-nord'
|
|
391
|
+
| 'base16-nova'
|
|
392
|
+
| 'base16-ocean'
|
|
393
|
+
| 'base16-oceanicnext'
|
|
394
|
+
| 'base16-one-light'
|
|
395
|
+
| 'base16-onedark'
|
|
396
|
+
| 'base16-outrun-dark'
|
|
397
|
+
| 'base16-papercolor-dark'
|
|
398
|
+
| 'base16-papercolor-light'
|
|
399
|
+
| 'base16-paraiso'
|
|
400
|
+
| 'base16-pasque'
|
|
401
|
+
| 'base16-phd'
|
|
402
|
+
| 'base16-pico'
|
|
403
|
+
| 'base16-pop'
|
|
404
|
+
| 'base16-porple'
|
|
405
|
+
| 'base16-qualia'
|
|
406
|
+
| 'base16-railscasts'
|
|
407
|
+
| 'base16-rebecca'
|
|
408
|
+
| 'base16-ros-pine-dawn'
|
|
409
|
+
| 'base16-ros-pine-moon'
|
|
410
|
+
| 'base16-ros-pine'
|
|
411
|
+
| 'base16-sagelight'
|
|
412
|
+
| 'base16-sandcastle'
|
|
413
|
+
| 'base16-seti-ui'
|
|
414
|
+
| 'base16-shapeshifter'
|
|
415
|
+
| 'base16-silk-dark'
|
|
416
|
+
| 'base16-silk-light'
|
|
417
|
+
| 'base16-snazzy'
|
|
418
|
+
| 'base16-solar-flare-light'
|
|
419
|
+
| 'base16-solar-flare'
|
|
420
|
+
| 'base16-solarized-dark'
|
|
421
|
+
| 'base16-solarized-light'
|
|
422
|
+
| 'base16-spacemacs'
|
|
423
|
+
| 'base16-summercamp'
|
|
424
|
+
| 'base16-summerfruit-dark'
|
|
425
|
+
| 'base16-summerfruit-light'
|
|
426
|
+
| 'base16-synth-midnight-terminal-dark'
|
|
427
|
+
| 'base16-synth-midnight-terminal-light'
|
|
428
|
+
| 'base16-tango'
|
|
429
|
+
| 'base16-tender'
|
|
430
|
+
| 'base16-tomorrow-night'
|
|
431
|
+
| 'base16-tomorrow'
|
|
432
|
+
| 'base16-twilight'
|
|
433
|
+
| 'base16-unikitty-dark'
|
|
434
|
+
| 'base16-unikitty-light'
|
|
435
|
+
| 'base16-vulcan'
|
|
436
|
+
| 'base16-windows-10-light'
|
|
437
|
+
| 'base16-windows-10'
|
|
438
|
+
| 'base16-windows-95-light'
|
|
439
|
+
| 'base16-windows-95'
|
|
440
|
+
| 'base16-windows-high-contrast-light'
|
|
441
|
+
| 'base16-windows-high-contrast'
|
|
442
|
+
| 'base16-windows-nt-light'
|
|
443
|
+
| 'base16-windows-nt'
|
|
444
|
+
| 'base16-woodland'
|
|
445
|
+
| 'base16-xcode-dusk'
|
|
446
|
+
| 'base16-zenburn'
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import hljsVuePlugin from '@highlightjs/vue-plugin'
|
|
3
|
+
import { nextTick } from 'vue'
|
|
4
|
+
import 'highlight.js/lib/common'
|
|
5
|
+
import 'highlight.js/styles/atom-one-dark.css'
|
|
6
|
+
|
|
7
|
+
const { readonly = false, language } = defineProps<{
|
|
8
|
+
language?: string
|
|
9
|
+
readonly?: boolean
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const code = defineModel('modelValue', {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ''
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
function tabKeyDown(event: KeyboardEvent) {
|
|
18
|
+
const target = event.target as HTMLTextAreaElement
|
|
19
|
+
const start = target.selectionStart
|
|
20
|
+
const end = target.selectionEnd
|
|
21
|
+
const tab = ' '
|
|
22
|
+
code.value = code.value.slice(0, start) + tab + code.value.slice(end)
|
|
23
|
+
nextTick(() => {
|
|
24
|
+
target.selectionStart = target.selectionEnd = start + 2
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const Highlightjs = hljsVuePlugin.component
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div style="max-height: 900px; height: 100vh; overflow: scroll;">
|
|
33
|
+
<div class="relative block h-100 ltr code-editor-wrap" style="height: 800px;">
|
|
34
|
+
<div class="numbers absolute inset-0 py-1 px-05 txt16 line-height-15 overflow-hidden z-999 w50px txt-start opacity-3 color-gray">
|
|
35
|
+
<div
|
|
36
|
+
v-for="(_, index) in code.split('\n')"
|
|
37
|
+
:key="index"
|
|
38
|
+
class="number txt-end"
|
|
39
|
+
>
|
|
40
|
+
{{ index + 1 }}
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<Highlightjs
|
|
44
|
+
class="highlighted-code absolute inset-0"
|
|
45
|
+
:autodetect="!language"
|
|
46
|
+
:code="code"
|
|
47
|
+
:wrap="true"
|
|
48
|
+
:language="language"
|
|
49
|
+
/>
|
|
50
|
+
<textarea
|
|
51
|
+
v-if="!readonly"
|
|
52
|
+
v-model="code"
|
|
53
|
+
:spellcheck="false"
|
|
54
|
+
class="code-editor absolute inset-0 overflow-hidden bg-transparent line-height-15 border-none m-0"
|
|
55
|
+
placeholder="Write your code here"
|
|
56
|
+
aria-label="Code Editor"
|
|
57
|
+
data-gramm="false"
|
|
58
|
+
@keydown.tab.prevent="tabKeyDown"
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<style>
|
|
65
|
+
.code-editor-wrap{
|
|
66
|
+
background: #282c34;
|
|
67
|
+
overflow: scroll;
|
|
68
|
+
}
|
|
69
|
+
.numbers {
|
|
70
|
+
font-family: monospace;
|
|
71
|
+
border-inline-end: 1px solid var(--bgl-gray);
|
|
72
|
+
}
|
|
73
|
+
.number{
|
|
74
|
+
scale: 0.9;
|
|
75
|
+
}
|
|
76
|
+
/* Highlight.js styles */
|
|
77
|
+
.highlighted-code {
|
|
78
|
+
white-space: pre-wrap;
|
|
79
|
+
word-wrap: break-word;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
margin: 0;
|
|
82
|
+
padding: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.highlighted-code code {
|
|
86
|
+
padding-left: 70px !important;
|
|
87
|
+
overflow: hidden !important;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Textarea aligned with Highlight.js */
|
|
91
|
+
.code-editor {
|
|
92
|
+
font-family: monospace;
|
|
93
|
+
color: transparent;
|
|
94
|
+
resize: none;
|
|
95
|
+
white-space: pre-wrap;
|
|
96
|
+
word-wrap: break-word;
|
|
97
|
+
caret-color: var(--bgl-white);
|
|
98
|
+
font-size: 16px;
|
|
99
|
+
padding: 1rem;
|
|
100
|
+
padding-left: 70px !important;
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.code-editor::-moz-selection {
|
|
105
|
+
background: #2466bc30;
|
|
106
|
+
color: inherit;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.code-editor::selection {
|
|
110
|
+
background: #2466bc30;
|
|
111
|
+
color: inherit;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.code-editor:focus {
|
|
115
|
+
outline: none;
|
|
116
|
+
}
|
|
117
|
+
</style>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
const format = {
|
|
2
|
+
html: (html: string) => {
|
|
3
|
+
const formatted = []
|
|
4
|
+
const reg = /(>)(<)(\/*)/g
|
|
5
|
+
const tab = ' '
|
|
6
|
+
let level = 0
|
|
7
|
+
|
|
8
|
+
html = html.replace(reg, '$1\n$2$3')
|
|
9
|
+
|
|
10
|
+
const lines = html.split('\n')
|
|
11
|
+
|
|
12
|
+
for (const line of lines) {
|
|
13
|
+
if (line.match(/<\/\w+/) && !line.match(/\/>/)) {
|
|
14
|
+
level--
|
|
15
|
+
}
|
|
16
|
+
formatted.push(tab.repeat(Math.max(level, 0)) + line)
|
|
17
|
+
if (line.match(/<\w[^>]*[^/]>/)) {
|
|
18
|
+
level++
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return formatted.join('\n')
|
|
22
|
+
},
|
|
23
|
+
json: (jsonString: string, indent = 4) => {
|
|
24
|
+
try {
|
|
25
|
+
const jsonObject = JSON.parse(jsonString)
|
|
26
|
+
return JSON.stringify(jsonObject, null, indent)
|
|
27
|
+
} catch (error) {
|
|
28
|
+
return `Invalid JSON: ${(error as Error).message}`
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
javascript: (jsCode: string, indent = 4) => {
|
|
32
|
+
try {
|
|
33
|
+
const tab = ' '.repeat(indent)
|
|
34
|
+
let formatted = ''
|
|
35
|
+
let level = 0
|
|
36
|
+
let inString = ''
|
|
37
|
+
|
|
38
|
+
for (let i = 0; i < jsCode.length; i++) {
|
|
39
|
+
const char = jsCode[i]
|
|
40
|
+
const nextChar = jsCode[i + 1]
|
|
41
|
+
if (char === '"' || char === '\'' || char === '`') {
|
|
42
|
+
formatted += char
|
|
43
|
+
if (inString.length && inString === char) {
|
|
44
|
+
inString = ''
|
|
45
|
+
} else if (!inString.length) {
|
|
46
|
+
inString = char
|
|
47
|
+
}
|
|
48
|
+
continue
|
|
49
|
+
}
|
|
50
|
+
if (inString) {
|
|
51
|
+
formatted += char
|
|
52
|
+
continue
|
|
53
|
+
}
|
|
54
|
+
if (char === '{' || char === '[') {
|
|
55
|
+
formatted += `${char}\n${tab.repeat(++level)}`
|
|
56
|
+
continue
|
|
57
|
+
}
|
|
58
|
+
if (char === '}' || char === ']') {
|
|
59
|
+
formatted += `\n${tab.repeat(--level)}${char}`
|
|
60
|
+
continue
|
|
61
|
+
}
|
|
62
|
+
if (char === ';' || char === ',') {
|
|
63
|
+
formatted += `${char}\n${tab.repeat(level)}`
|
|
64
|
+
continue
|
|
65
|
+
}
|
|
66
|
+
if (char === '\n') {
|
|
67
|
+
formatted += `\n${tab.repeat(level)}`
|
|
68
|
+
continue
|
|
69
|
+
}
|
|
70
|
+
if (
|
|
71
|
+
(char === ')' && nextChar === '{')
|
|
72
|
+
|| (char === ')' && nextChar === ' ')
|
|
73
|
+
) {
|
|
74
|
+
formatted += `${char}\n${tab.repeat(level)}`
|
|
75
|
+
continue
|
|
76
|
+
}
|
|
77
|
+
formatted += char
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return formatted
|
|
81
|
+
} catch (error) {
|
|
82
|
+
return `Error formatting JavaScript: ${(error as Error).message}`
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function formatCode(code: string, language: string) {
|
|
88
|
+
switch (language) {
|
|
89
|
+
case 'html':
|
|
90
|
+
return format.html(code)
|
|
91
|
+
case 'json':
|
|
92
|
+
return format.json(code)
|
|
93
|
+
case 'javascript':
|
|
94
|
+
return format.javascript(code)
|
|
95
|
+
default:
|
|
96
|
+
return code
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -405,7 +405,7 @@ function drop(e: DragEvent) {
|
|
|
405
405
|
class="single-image-item-preview"
|
|
406
406
|
:class="{ 'bgl_fill-image': fill }"
|
|
407
407
|
>
|
|
408
|
-
<div class="position-start m-05 flex opacity-7 z-99">
|
|
408
|
+
<div class="position-start m-05 flex opacity-7 z-99 gap-025">
|
|
409
409
|
<Btn
|
|
410
410
|
v-tooltip="'Delete'"
|
|
411
411
|
color="gray"
|
|
@@ -588,6 +588,7 @@ function drop(e: DragEvent) {
|
|
|
588
588
|
height: calc(100% - 2rem);
|
|
589
589
|
object-fit: cover;
|
|
590
590
|
background: var(--bgl-gray-light);
|
|
591
|
+
width: 90%;
|
|
591
592
|
}
|
|
592
593
|
.single-image-item-preview:hover::after {
|
|
593
594
|
content: 'zoom_in';
|