solarite 0.2.0 → 0.2.2

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 (38) hide show
  1. package/package.json +6 -5
  2. package/benchmarks/naive/Solarite.min.js +0 -4
  3. package/benchmarks/naive/index.html +0 -14
  4. package/benchmarks/naive/main.js +0 -339
  5. package/benchmarks/naive/package-lock.json +0 -13
  6. package/benchmarks/naive/package.json +0 -23
  7. package/benchmarks/readme.md +0 -48
  8. package/build/build.bat +0 -4
  9. package/build/build.js +0 -139
  10. package/build/lib/rollup.min.js +0 -11
  11. package/build/lib/source-map.min.js +0 -1
  12. package/build/lib/terser.min.js +0 -1
  13. package/docs/index.md +0 -883
  14. package/docs/js/Playground.js +0 -184
  15. package/docs/js/codemirror/codemirror6.js +0 -32513
  16. package/docs/js/codemirror/themeSolarIce.js +0 -312
  17. package/docs/js/documentation.js +0 -32
  18. package/docs/js/ui/CodeEditor.js +0 -978
  19. package/docs/js/ui/DarkToggle.js +0 -52
  20. package/docs/js/ui/FlexResizer.js +0 -152
  21. package/docs/js/util/Draggable2.js +0 -151
  22. package/docs/js/util/Errors.js +0 -20
  23. package/docs/js/util/Html.js +0 -147
  24. package/docs/js/util/Icons.js +0 -623
  25. package/docs/js/util/Input.js +0 -253
  26. package/docs/js/util/Util.js +0 -88
  27. package/docs/js/util/delve.js +0 -43
  28. package/docs/media/FiraCode400.woff2 +0 -0
  29. package/docs/media/cabin-latin-700.woff2 +0 -0
  30. package/docs/media/documentation.css +0 -96
  31. package/docs/media/eternium.css +0 -1123
  32. package/docs/media/solarite-machine.webp +0 -0
  33. package/index.html +0 -761
  34. package/tests/Benchmark.test.js +0 -319
  35. package/tests/Solarite.test.js +0 -3838
  36. package/tests/Testimony.js +0 -809
  37. package/tests/index.html +0 -46
  38. package/tests/run.bat +0 -2
@@ -1,312 +0,0 @@
1
- import {EditorView, HighlightStyle, syntaxHighlighting, tags as t} from './codemirror6.js';
2
-
3
-
4
- /**
5
- * Use warm colors for xml-like languages, cool colors for other languages.
6
- * @param lang {string} Can be 'js', 'md', 'htaccess', etc. The file extension.
7
- * @param isDark
8
- * @returns {*[]} */
9
- function themeSolarIce(lang, isDark=false) {
10
-
11
- // Re-used colors
12
- const
13
- stone = "#7d8799",
14
- text = isDark ? "#aaa" : 'black',
15
- darkBackground = "#21252b",
16
- highlightBackground = isDark ? "#2c313a" : '#ddd',
17
- background = isDark ? "transparent" : 'white',
18
- tooltipBackground = "#353a42",
19
- selection = isDark ? "#234" : '#ccc',
20
- cursor = "#528bff"
21
-
22
-
23
- // Editor theme styles.
24
- const solarIceTheme = EditorView.theme({
25
- "&": { // parent selector
26
- color: text,
27
- backgroundColor: background,
28
- },
29
-
30
- ".cm-content": {
31
- caretColor: cursor,
32
- //fontFamily: 'Hack',
33
- fontSize: window.outerWidth > 512 ? '13px' : '12px',
34
- //lineHeight: 1
35
- },
36
-
37
- ".cm-cursor, .cm-dropCursor": {borderLeftColor: cursor},
38
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: selection },
39
-
40
- ".cm-panels": {backgroundColor: darkBackground, color: text},
41
- ".cm-panels.cm-panels-top": {borderBottom: "2px solid black"},
42
- ".cm-panels.cm-panels-bottom": {borderTop: "2px solid black"},
43
-
44
- ".cm-searchMatch": {
45
- backgroundColor: "#72a1ff59",
46
- outline: "1px solid #457dff"
47
- },
48
- ".cm-searchMatch.cm-searchMatch-selected": {
49
- backgroundColor: "#6199ff2f"
50
- },
51
-
52
- ".cm-activeLine": {backgroundColor: "transparent"}, // Transparent b/c it's drawn on top of selection. CodeMirror bug.
53
- ".cm-selectionMatch": {backgroundColor: isDark ? "#aafe661a" : '#eee'}, // Mark occurances
54
-
55
- "&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket": {
56
- backgroundColor: "#bad0f847"
57
- },
58
-
59
- ".cm-gutters": {
60
- backgroundColor: background,
61
- color: stone,
62
- border: "none"
63
- },
64
-
65
- ":focus-within .cm-activeLineGutter": {
66
- backgroundColor: highlightBackground
67
- },
68
-
69
- ".cm-foldPlaceholder": {
70
- backgroundColor: "transparent",
71
- border: "none",
72
- color: "#ddd"
73
- },
74
-
75
- ".cm-tooltip": {
76
- border: "none",
77
- backgroundColor: tooltipBackground
78
- },
79
- ".cm-tooltip .cm-tooltip-arrow:before": {
80
- borderTopColor: "transparent",
81
- borderBottomColor: "transparent"
82
- },
83
- ".cm-tooltip .cm-tooltip-arrow:after": {
84
- borderTopColor: tooltipBackground,
85
- borderBottomColor: tooltipBackground
86
- },
87
- ".cm-tooltip-autocomplete": {
88
- "& > ul > li[aria-selected]": {
89
- backgroundColor: highlightBackground,
90
- color: text
91
- }
92
- }
93
- }, {dark: true})
94
-
95
- // Code styles
96
- let styles = [
97
-
98
- // Universal
99
- {
100
- tag: [t.comment],
101
- color: isDark ? '#0c0' : '#060'
102
- },
103
- {
104
- tag: [t.docComment], // doesn't work?
105
- color: '#49c',
106
- fontWeight: 'bold'
107
- },
108
- {
109
- tag: [t.docString], // doesn't work?
110
- color: '#49c'
111
- },
112
-
113
- // Html
114
- {
115
- tag: [t.angleBracket, t.documentMeta], // t.meta is the doctype
116
- color: isDark ? '#b32' : '#e00'
117
- },
118
- {
119
- tag: [t.attributeValue],
120
- color: isDark ? '#d60' : '#f50'
121
- },
122
- {
123
- tag: [t.character], // html entity
124
- color: isDark ? '#880' : '#880'
125
- },
126
- {
127
- tag: [t.content], // Text in html
128
- color: isDark ? '#987' : '#210'
129
- },
130
- // Html and css
131
- {
132
- tag: [t.tagName], // Tag name selector
133
- color: lang === 'css'
134
- ? (isDark ? '#26f' : '#00f')
135
- : (isDark ? '#b32' : '#e00') // html/php
136
- },
137
- {
138
- tag: [t.attributeName],
139
- color: lang === 'css'
140
- ? (isDark ? '#469' : '#469')
141
- : (isDark ? '#885b22' : '#600')
142
- },
143
-
144
- // CSS
145
- {
146
- tag: [t.atom], // Css value like 'Arial' or 'none'. Keyword 'super' in javascript
147
- color: lang === 'js'
148
- ? (isDark ? '#26f' : '#00f')
149
- : (isDark ? '#26f' : '')
150
- },
151
- {
152
- tag: [t.unit],
153
- color: isDark ? '#95a' : ''
154
- },
155
- {
156
- tag: [t.color],
157
- color: isDark ? '#95a' : '#60b'
158
- },
159
- {
160
- tag: [t.constant(t.name)], // pseudo-selector
161
- color: isDark ? '#598' : '#18a'
162
- },
163
-
164
- // C-like
165
- {
166
- tag: [t.keyword, t.modifier, t.self], // public/private/protected, css selector. self=this keyword.
167
- color: isDark ? '#26f' : '#00f',
168
- fontWeight: 'bold'
169
- },
170
- {
171
- tag: [t.bool, t.typeName],
172
- color: isDark ? '#26f' : '#00f'
173
- },
174
- {
175
- tag: [t.function(t.name)],
176
- color: isDark ? '#598' : '#18a'
177
- },
178
- {
179
- tag: [t.name, t.propertyName],
180
- color: isDark ? '#469' : '#038'
181
- },
182
- {
183
- tag: [t.constant],
184
- color: isDark ? '#598' : '#598'
185
- },
186
- {
187
- tag: [t.labelName],
188
- color: isDark ? '#469' : '#057'
189
- },
190
-
191
-
192
- {
193
- tag: [t.number],
194
- color: isDark ? '#95a' : '#60b'
195
- },
196
- {
197
- tag: [t.string, t.regexp], // t.string also colors html entities
198
- color: isDark ? '#75f' : '#60b'
199
- },
200
- {
201
- tag: [t.separator], // '::' or '->' in php
202
- color: text
203
- },
204
- {
205
- tag: t.invalid,
206
- color: 'red',
207
- textDecoration: 'underline'
208
- },
209
-
210
-
211
- // Unused
212
- {
213
- tag: [],
214
- color: '#ff0'
215
- },
216
-
217
- // Unknown
218
- // These will show up as yellow so i can figure ot what they are.
219
- {
220
- tag: [t.standard(t.name), t.annotation, t.macroName],
221
- color: '#ff0'
222
- },
223
-
224
-
225
- // Markdown:
226
- {
227
- tag: t.meta,
228
- fontWeight: "bold",
229
- color: '#abc'
230
- },
231
- {
232
- tag: t.strong,
233
- fontWeight: "bold",
234
- color: "#ccc"
235
- },
236
- {
237
- tag: t.emphasis,
238
- fontStyle: "italic",
239
- },
240
- {
241
- tag: t.strikethrough,
242
- textDecoration: "line-through",
243
- },
244
- {
245
- tag: t.link,
246
- color: '#469',
247
- textDecoration: "underline"
248
- },
249
- {
250
- tag: t.heading1,
251
- fontWeight: "900",
252
- fontSize: '250%',
253
- color: 'white',
254
- backgroundColor: '#08f'
255
- },
256
- {
257
- tag: t.heading2,
258
- fontWeight: "bold",
259
- fontSize: '180%',
260
- color: isDark ? 'white' : 'black',
261
- textDecoration: 'underline'
262
- },
263
- {
264
- tag: t.heading3,
265
- fontWeight: "bold",
266
- color: isDark ? 'white' : 'black',
267
- fontSize: '120%',
268
- textDecoration: 'underline'
269
- },
270
- {
271
- tag: t.heading4,
272
- fontWeight: "bold",
273
- color: isDark ? 'white' : '#102',
274
- textDecoration: 'underline'
275
- },
276
- {
277
- tag: t.heading5,
278
- color: isDark ? '#acf' : '#035',
279
- textDecoration: 'underline'
280
- },
281
- {
282
- tag: t.heading6,
283
- color: isDark ? '#acf' : '#035',
284
- },
285
- {
286
- tag: t.quote,
287
- backgroundColor: isDark ? '#2b313b' : '#def',
288
- },
289
- {
290
- tag: t.monospace,
291
- backgroundColor: isDark ? '#1b1e22' : '#def',
292
- }
293
- ];
294
-
295
- if (lang==='html' || lang==='php')
296
- styles.push({
297
- tag: t.processingInstruction, // php tags
298
- color: isDark ? '#f0f' : '#f0b',
299
- fontWeight: 'bold'
300
- });
301
-
302
- /// The highlighting style for code.
303
- // List of things that can be syntax colored at:
304
- // https://lezer.codemirror.net/docs/ref/#highlight.tags
305
- // codemirror\node_modules\@lezer\highlight\dist\highlight.d.ts
306
- var solarIceHighlightStyle = HighlightStyle.define(styles)
307
-
308
- return [solarIceTheme, syntaxHighlighting(solarIceHighlightStyle)]
309
- }
310
-
311
-
312
- export default themeSolarIce;
@@ -1,32 +0,0 @@
1
- import Playground from "./Playground.js";
2
-
3
-
4
-
5
- // We have to import like this b/c we're not a module.
6
-
7
-
8
- document.addEventListener('DOMContentLoaded', () => {
9
-
10
- let dt = new DarkToggle();
11
- dt.setAttribute('style', 'position: fixed; top: 15px; right: 15px; cursor: pointer; transform: scale(2)');
12
- document.body.append(dt);
13
-
14
-
15
-
16
- // Convert all code blocks to use Playground.js
17
- for (let pre of document.querySelectorAll('pre.ty-contain-cm')) {
18
- let lines = [];
19
- for (let preLine of pre.querySelectorAll('pre.CodeMirror-line > span'))
20
- lines.push(preLine.textContent.replace(/\xa0/g, ' ').replace(/\n$/g, '').replace(/ /g, '\t'))
21
-
22
- let prefix = `
23
- <style>
24
- html[dark] { background: #0f1318; color: white }
25
- body { font: 12px Arial; background: transparent !important }
26
- </style>`;
27
- let value = lines.join('\n');
28
-
29
- let pg = new Playground({value, language: pre.getAttribute('lang'), width: 75, maxHeight: 1000, prefix, limitCodeEditorHeight: true})
30
- pre.replaceWith(pg);
31
- }
32
- })