@iyio/syn-taxi 0.4.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/README.md +9 -0
- package/esm/package.json +3 -0
- package/esm/src/index.d.ts +4 -0
- package/esm/src/index.js +5 -0
- package/esm/src/index.js.map +1 -0
- package/esm/src/lib/CodeInput.d.ts +32 -0
- package/esm/src/lib/CodeInput.js +247 -0
- package/esm/src/lib/CodeInput.js.map +1 -0
- package/esm/src/lib/CodeView.d.ts +8 -0
- package/esm/src/lib/CodeView.js +31 -0
- package/esm/src/lib/CodeView.js.map +1 -0
- package/esm/src/lib/LazyCodeInput.d.ts +6 -0
- package/esm/src/lib/LazyCodeInput.js +9 -0
- package/esm/src/lib/LazyCodeInput.js.map +1 -0
- package/esm/src/lib/LazyCodeView.d.ts +6 -0
- package/esm/src/lib/LazyCodeView.js +9 -0
- package/esm/src/lib/LazyCodeView.js.map +1 -0
- package/esm/src/lib/LineNumbers.d.ts +7 -0
- package/esm/src/lib/LineNumbers.js +43 -0
- package/esm/src/lib/LineNumbers.js.map +1 -0
- package/esm/src/lib/lib-design-tokens.d.ts +4 -0
- package/esm/src/lib/lib-design-tokens.js +7 -0
- package/esm/src/lib/lib-design-tokens.js.map +1 -0
- package/esm/src/lib/shiki.d.ts +4 -0
- package/esm/src/lib/shiki.js +444 -0
- package/esm/src/lib/shiki.js.map +1 -0
- package/esm/src/lib/tokens.d.ts +41 -0
- package/esm/src/lib/tokens.js +42 -0
- package/esm/src/lib/tokens.js.map +1 -0
- package/package.json +20 -0
- package/src/index.d.ts +4 -0
- package/src/index.js +8 -0
- package/src/index.js.map +1 -0
- package/src/lib/CodeInput.d.ts +32 -0
- package/src/lib/CodeInput.js +251 -0
- package/src/lib/CodeInput.js.map +1 -0
- package/src/lib/CodeView.d.ts +8 -0
- package/src/lib/CodeView.js +35 -0
- package/src/lib/CodeView.js.map +1 -0
- package/src/lib/LazyCodeInput.d.ts +6 -0
- package/src/lib/LazyCodeInput.js +13 -0
- package/src/lib/LazyCodeInput.js.map +1 -0
- package/src/lib/LazyCodeView.d.ts +6 -0
- package/src/lib/LazyCodeView.js +13 -0
- package/src/lib/LazyCodeView.js.map +1 -0
- package/src/lib/LineNumbers.d.ts +7 -0
- package/src/lib/LineNumbers.js +47 -0
- package/src/lib/LineNumbers.js.map +1 -0
- package/src/lib/lib-design-tokens.d.ts +4 -0
- package/src/lib/lib-design-tokens.js +11 -0
- package/src/lib/lib-design-tokens.js.map +1 -0
- package/src/lib/shiki.d.ts +4 -0
- package/src/lib/shiki.js +450 -0
- package/src/lib/shiki.js.map +1 -0
- package/src/lib/tokens.d.ts +41 -0
- package/src/lib/tokens.js +45 -0
- package/src/lib/tokens.js.map +1 -0
- package/src/package.json +4 -0
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Syn-Taxi
|
|
2
|
+
A set of React components for highlighting and editing code
|
|
3
|
+
|
|
4
|
+
Highlighting is done using (highlighter.js)[https://highlightjs.org/] and adds support for using
|
|
5
|
+
TextMate and VSCode grammars using
|
|
6
|
+
the (foo123/highlightjs-grammar)[https://github.com/foo123/highlightjs-grammar]
|
|
7
|
+
|
|
8
|
+
Use the LazyCodeInput and LazyCodeView to enable code splitting to remove
|
|
9
|
+
highlighter.js from your main bundle
|
package/esm/package.json
ADDED
package/esm/src/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/syn-taxi/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BaseLayoutOuterProps, CodeParser, CodeParsingError } from '@iyio/common';
|
|
2
|
+
export declare const defaultCodeLineStartReg: RegExp;
|
|
3
|
+
export declare const markdownCodeLineStartReg: RegExp;
|
|
4
|
+
interface CodeInputProps<P = any> extends BaseLayoutOuterProps {
|
|
5
|
+
tab?: string;
|
|
6
|
+
language?: string;
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
valueOverride?: string;
|
|
9
|
+
value: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Called when Command enter or Ctrl enter is pressed
|
|
14
|
+
*/
|
|
15
|
+
onSubmit?: (value: string) => void;
|
|
16
|
+
onBlur?: (value: string) => void;
|
|
17
|
+
onNewLine?: (value: string) => void;
|
|
18
|
+
tall?: boolean;
|
|
19
|
+
onElem?: (elem: HTMLElement | null) => void;
|
|
20
|
+
onTextarea?: (elem: HTMLTextAreaElement | null) => void;
|
|
21
|
+
lineStartReg?: RegExp | null;
|
|
22
|
+
lineStartRegIndex?: number;
|
|
23
|
+
lineNumbers?: boolean;
|
|
24
|
+
errors?: (CodeParsingError | number)[];
|
|
25
|
+
parser?: CodeParser<P>;
|
|
26
|
+
parsingDelayMs?: number;
|
|
27
|
+
logParsed?: boolean;
|
|
28
|
+
debugParser?: boolean | ((...args: any[]) => void);
|
|
29
|
+
bottomPadding?: number | string;
|
|
30
|
+
}
|
|
31
|
+
export declare function CodeInput<P = any>({ tab, language, value, readOnly, valueOverride, disabled, onChange, onSubmit, onElem, onTextarea, onBlur, onNewLine, tall, lineStartReg, lineStartRegIndex, lineNumbers, errors, parser, logParsed, parsingDelayMs, debugParser, bottomPadding, ...props }: CodeInputProps<P>): JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { atDotCss } from '@iyio/at-dot-css';
|
|
4
|
+
import { baseLayoutCn, cn, escapeHtml, strLineCount } from '@iyio/common';
|
|
5
|
+
import { useCallback, useEffect, useState } from "react";
|
|
6
|
+
import { dt } from '../lib/lib-design-tokens';
|
|
7
|
+
import { LineNumbers } from './LineNumbers';
|
|
8
|
+
import { useShiki } from './shiki';
|
|
9
|
+
export const defaultCodeLineStartReg = /^(\s*)/;
|
|
10
|
+
export const markdownCodeLineStartReg = /^(\s*-?\s*)/;
|
|
11
|
+
export function CodeInput(_a) {
|
|
12
|
+
var { tab = ' ', language = 'auto', value, readOnly, valueOverride, disabled, onChange, onSubmit, onElem, onTextarea, onBlur, onNewLine, tall, lineStartReg = defaultCodeLineStartReg, lineStartRegIndex = 1, lineNumbers, errors, parser, logParsed, parsingDelayMs = 700, debugParser, bottomPadding = 500 } = _a, props = __rest(_a, ["tab", "language", "value", "readOnly", "valueOverride", "disabled", "onChange", "onSubmit", "onElem", "onTextarea", "onBlur", "onNewLine", "tall", "lineStartReg", "lineStartRegIndex", "lineNumbers", "errors", "parser", "logParsed", "parsingDelayMs", "debugParser", "bottomPadding"]);
|
|
13
|
+
style.root();
|
|
14
|
+
const sh = useShiki(language);
|
|
15
|
+
const [parsingErrors, setParsingErrors] = useState(undefined);
|
|
16
|
+
const [code, setCode] = useState(null);
|
|
17
|
+
const [textArea, setTextArea] = useState(null);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setParsingErrors(undefined);
|
|
20
|
+
if (!code || !sh || !textArea) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
code.innerHTML = sh.codeToHtml(value, { lang: language });
|
|
24
|
+
let minWidth = 0;
|
|
25
|
+
const codeElem = code.querySelector('code');
|
|
26
|
+
if (codeElem) {
|
|
27
|
+
for (let i = 0; i < codeElem.children.length; i++) {
|
|
28
|
+
const item = codeElem.children.item(i);
|
|
29
|
+
if (!item) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const w = item.offsetWidth;
|
|
33
|
+
if (w && w > minWidth) {
|
|
34
|
+
minWidth = w;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
textArea.style.minWidth = minWidth + 'px';
|
|
39
|
+
if (parser) {
|
|
40
|
+
const iv = setTimeout(() => {
|
|
41
|
+
try {
|
|
42
|
+
const r = parser(value, debugParser === true ? console.info : (debugParser || undefined));
|
|
43
|
+
if (logParsed) {
|
|
44
|
+
console.info('CodeInput parsing result', r);
|
|
45
|
+
}
|
|
46
|
+
setParsingErrors(r.error ? [r.error] : undefined);
|
|
47
|
+
if (r.error) {
|
|
48
|
+
console.info('⛔️ CodeInput parsing error', r.error);
|
|
49
|
+
console.info(r.error.near);
|
|
50
|
+
code.innerHTML = sh.codeToHtml(value, { lang: language, lineOptions: [
|
|
51
|
+
{
|
|
52
|
+
line: r.error.lineNumber,
|
|
53
|
+
classes: ['CodeInput-errorLine']
|
|
54
|
+
}
|
|
55
|
+
] }).replace(/class="[^"]*CodeInput-errorLine[^"]*"[^>]*>/g, v => {
|
|
56
|
+
var _a, _b, _c, _d;
|
|
57
|
+
return `${v}<div class="CodeInput-error">${escapeHtml((_b = (_a = r.error) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : '')}</div><div class="CodeInput-errorCol">${' '.repeat(((_d = (_c = r.error) === null || _c === void 0 ? void 0 : _c.col) !== null && _d !== void 0 ? _d : 0) - 1) + '_'}</div>`;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch (ex) {
|
|
62
|
+
setParsingErrors([0]);
|
|
63
|
+
}
|
|
64
|
+
}, parsingDelayMs);
|
|
65
|
+
return () => {
|
|
66
|
+
clearTimeout(iv);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
setParsingErrors(undefined);
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
}, [code, textArea, valueOverride, value, language, sh, parser, parsingDelayMs, logParsed, debugParser]);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
onElem === null || onElem === void 0 ? void 0 : onElem(code);
|
|
76
|
+
}, [onElem, code]);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
onTextarea === null || onTextarea === void 0 ? void 0 : onTextarea(textArea);
|
|
79
|
+
}, [onTextarea, textArea]);
|
|
80
|
+
const onKeyDown = useCallback((e) => {
|
|
81
|
+
var _a;
|
|
82
|
+
if (disabled) {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (!textArea) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
switch (e.key) {
|
|
90
|
+
case "Tab": {
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
const value = (textArea.value.substring(0, textArea.selectionStart) +
|
|
93
|
+
tab +
|
|
94
|
+
textArea.value.substring(textArea.selectionStart));
|
|
95
|
+
const s = textArea.selectionStart + tab.length;
|
|
96
|
+
textArea.value = value;
|
|
97
|
+
textArea.selectionStart = s;
|
|
98
|
+
textArea.selectionEnd = s;
|
|
99
|
+
textArea.focus();
|
|
100
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
case "Enter": {
|
|
104
|
+
const value = (textArea.value.substring(0, textArea.selectionStart) +
|
|
105
|
+
textArea.value.substring(textArea.selectionStart));
|
|
106
|
+
if (e.metaKey || e.ctrlKey) {
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
const s = textArea.selectionStart;
|
|
109
|
+
textArea.value = value;
|
|
110
|
+
if (s >= 0) {
|
|
111
|
+
textArea.selectionStart = s;
|
|
112
|
+
textArea.selectionEnd = s;
|
|
113
|
+
textArea.focus();
|
|
114
|
+
}
|
|
115
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(value);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
const s = textArea.selectionStart;
|
|
119
|
+
if (lineStartReg && s > 0 && s === textArea.selectionEnd) {
|
|
120
|
+
const i = textArea.value.lastIndexOf('\n', s - 1);
|
|
121
|
+
if (i != -1) {
|
|
122
|
+
const prevLine = textArea.value.substring(i + 1, s);
|
|
123
|
+
const lineStart = (_a = lineStartReg.exec(prevLine)) === null || _a === void 0 ? void 0 : _a[lineStartRegIndex];
|
|
124
|
+
if (lineStart) {
|
|
125
|
+
e.preventDefault();
|
|
126
|
+
textArea.value = textArea.value.substring(0, s) + '\n' + lineStart + textArea.value.substring(s);
|
|
127
|
+
textArea.selectionStart = s + lineStart.length + 1;
|
|
128
|
+
textArea.selectionEnd = s + lineStart.length + 1;
|
|
129
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(textArea.value);
|
|
130
|
+
textArea.focus();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
onNewLine === null || onNewLine === void 0 ? void 0 : onNewLine(value);
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}, [textArea, tab, onChange, onSubmit, onNewLine, disabled, lineStartReg, lineStartRegIndex]);
|
|
140
|
+
const pad = _jsx("div", { className: "CodeInput-bottomMargin", style: { height: bottomPadding } });
|
|
141
|
+
return (_jsxs("div", { className: cn("CodeInput", { tall, disabled, readOnly, lineNumbers: lineNumbers !== undefined }, baseLayoutCn(props)), children: [lineNumbers && _jsx(LineNumbers, { count: strLineCount(value), errors: errors !== null && errors !== void 0 ? errors : parsingErrors, pad: pad }), _jsx("div", { className: "CodeInput-content", children: _jsxs("div", { children: [_jsx("div", { ref: setCode, className: cn("no-select", language === 'auto' ? undefined : `language-${language}`) }, language), _jsx("textarea", { spellCheck: false, ref: setTextArea, onKeyDown: onKeyDown, onChange: e => onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value), onBlur: e => onBlur === null || onBlur === void 0 ? void 0 : onBlur(e.target.value), value: value, readOnly: readOnly }), pad] }) })] }));
|
|
142
|
+
}
|
|
143
|
+
const style = atDotCss({ name: 'CodeInput', css: `
|
|
144
|
+
.CodeInput{
|
|
145
|
+
display:flex;
|
|
146
|
+
border-radius:8px;
|
|
147
|
+
transition:opacity 0.1s ease-in-out;
|
|
148
|
+
background:#1E1E1E;
|
|
149
|
+
}
|
|
150
|
+
.CodeInput textarea{
|
|
151
|
+
all:unset;
|
|
152
|
+
}
|
|
153
|
+
.CodeInput.tall{
|
|
154
|
+
min-height:200px;
|
|
155
|
+
}
|
|
156
|
+
.CodeInput.disabled{
|
|
157
|
+
opacity:0.4;
|
|
158
|
+
}
|
|
159
|
+
.CodeInput.disabled textarea{
|
|
160
|
+
opacity:0;
|
|
161
|
+
}
|
|
162
|
+
.CodeInput code, .CodeInput textarea{
|
|
163
|
+
margin:0 !important;
|
|
164
|
+
padding: 0 !important;
|
|
165
|
+
display:block;
|
|
166
|
+
white-space:pre;
|
|
167
|
+
font-family:Courier !important;
|
|
168
|
+
font-size:${dt().codeFontSize}px !important;
|
|
169
|
+
line-height:${dt().codeLineHeight}px !important;
|
|
170
|
+
min-height:${dt().codeLineHeight}px;
|
|
171
|
+
}
|
|
172
|
+
.CodeInput code *{
|
|
173
|
+
font-size:${dt().codeFontSize}px !important;
|
|
174
|
+
line-height:${dt().codeLineHeight}px !important;
|
|
175
|
+
}
|
|
176
|
+
.CodeInput pre{
|
|
177
|
+
margin:0 !important;
|
|
178
|
+
padding:0 !important;
|
|
179
|
+
display:block;
|
|
180
|
+
}
|
|
181
|
+
.CodeInput pre,.CodeInput code{
|
|
182
|
+
background: none !important;
|
|
183
|
+
}
|
|
184
|
+
.CodeInput textarea{
|
|
185
|
+
position:absolute;
|
|
186
|
+
left:0;
|
|
187
|
+
top:0;
|
|
188
|
+
width:100%;
|
|
189
|
+
height:100%;
|
|
190
|
+
overflow:hidden;
|
|
191
|
+
overflow:clip;
|
|
192
|
+
border:none;
|
|
193
|
+
background:none;
|
|
194
|
+
resize:none;
|
|
195
|
+
color:transparent;
|
|
196
|
+
caret-color: #ffffffcc;
|
|
197
|
+
outline:none;
|
|
198
|
+
outline-width:0;
|
|
199
|
+
cursor:text;
|
|
200
|
+
}
|
|
201
|
+
.CodeInput.readOnly textarea{
|
|
202
|
+
pointer-events:none;
|
|
203
|
+
}
|
|
204
|
+
.CodeInput .no-select{
|
|
205
|
+
pointer-events:none;
|
|
206
|
+
}
|
|
207
|
+
.CodeInput.readOnly .no-select{
|
|
208
|
+
pointer-events:auto;
|
|
209
|
+
}
|
|
210
|
+
.CodeInput-content{
|
|
211
|
+
display:flex;
|
|
212
|
+
flex-direction:column;
|
|
213
|
+
overflow-x:auto;
|
|
214
|
+
flex:1;
|
|
215
|
+
}
|
|
216
|
+
.CodeInput-content > div{
|
|
217
|
+
position:relative;
|
|
218
|
+
}
|
|
219
|
+
.CodeInput.lineNumbers .CodeInput-content > div{
|
|
220
|
+
margin-left:0.5rem !important;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.CodeInput-errorLine{
|
|
224
|
+
position:relative;
|
|
225
|
+
}
|
|
226
|
+
.CodeInput-errorLine > .CodeInput-error{
|
|
227
|
+
position:absolute;
|
|
228
|
+
left:calc( 100% + 1rem);
|
|
229
|
+
font-size:12px !important;
|
|
230
|
+
line-height:12px !important;
|
|
231
|
+
display:flex;
|
|
232
|
+
align-items:center;
|
|
233
|
+
background-color:#ff000033;
|
|
234
|
+
top:-0.2rem;
|
|
235
|
+
bottom:-0.2rem;
|
|
236
|
+
padding:0 0.4rem;
|
|
237
|
+
border-radius:4px;
|
|
238
|
+
}
|
|
239
|
+
.CodeInput-errorCol{
|
|
240
|
+
position:absolute;
|
|
241
|
+
left:0;
|
|
242
|
+
top:0;
|
|
243
|
+
color:#ff000088;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
` });
|
|
247
|
+
//# sourceMappingURL=CodeInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeInput.js","sourceRoot":"","sources":["../../../../../../packages/syn-taxi/src/lib/CodeInput.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAwB,E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AAK,EACjB,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,CAAC,CAAA,EAAE,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACvC,MAAM,EAAE,CAAC,CAAA,EAAE,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACnC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,GACpB,EACD,GAAG,IACF,GACJ,IACJ,CACT,CAAA;AAEL,CAAC;AAGD,MAAM,KAAK,GAAC,QAAQ,CAAC,EAAC,IAAI,EAAC,WAAW,EAAC,GAAG,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;oBAyBvB,EAAE,EAAE,CAAC,YAAY;sBACf,EAAE,EAAE,CAAC,cAAc;qBACpB,EAAE,EAAE,CAAC,cAAc;;;oBAGpB,EAAE,EAAE,CAAC,YAAY;sBACf,EAAE,EAAE,CAAC,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwExC,EAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { atDotCss } from '@iyio/at-dot-css';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { useShiki } from './shiki';
|
|
5
|
+
export function CodeView({ value, wrap, children, language, }) {
|
|
6
|
+
style.root();
|
|
7
|
+
const code = value || children || '';
|
|
8
|
+
const sh = useShiki(language);
|
|
9
|
+
const [elem, setElem] = useState(null);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (!elem || !sh) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
elem.innerHTML = sh.codeToHtml(code, { lang: language });
|
|
15
|
+
}, [sh, code, elem, language]);
|
|
16
|
+
return (_jsx("pre", { className: "CodeView", style: style.vars({ wrap: wrap ? 'pre-wrap' : 'pre' }), children: _jsx("code", { ref: setElem }) }));
|
|
17
|
+
}
|
|
18
|
+
const style = atDotCss({ name: 'CodeView', css: `
|
|
19
|
+
.CodeView.pre, .CodeView > code{
|
|
20
|
+
margin:0 !important;
|
|
21
|
+
padding:0 !important;
|
|
22
|
+
display:block !important;
|
|
23
|
+
overflow-x:hidden !important;
|
|
24
|
+
overflow-y:hidden !important;
|
|
25
|
+
white-space:@@wrap !important;
|
|
26
|
+
font-family:Courier !important;
|
|
27
|
+
font-size:14px !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
` });
|
|
31
|
+
//# sourceMappingURL=CodeView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeView.js","sourceRoot":"","sources":["../../../../../../packages/syn-taxi/src/lib/CodeView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAUnC,MAAM,UAAU,QAAQ,CAAC,EACrB,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,GACG;IAEX,KAAK,CAAC,IAAI,EAAE,CAAC;IAEb,MAAM,IAAI,GAAC,KAAK,IAAE,QAAQ,IAAE,EAAE,CAAC;IAC/B,MAAM,EAAE,GAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAE5B,MAAM,CAAC,IAAI,EAAC,OAAO,CAAC,GAAC,QAAQ,CAAmB,IAAI,CAAC,CAAC;IAEtD,SAAS,CAAC,GAAE,EAAE;QACV,IAAG,CAAC,IAAI,IAAI,CAAC,EAAE,EAAC;YACZ,OAAO;SACV;QACD,IAAI,CAAC,SAAS,GAAC,EAAE,CAAC,UAAU,CAAC,IAAI,EAAC,EAAC,IAAI,EAAC,QAAQ,EAAC,CAAC,CAAC;IAEvD,CAAC,EAAC,CAAC,EAAE,EAAC,IAAI,EAAC,IAAI,EAAC,QAAQ,CAAC,CAAC,CAAC;IAE3B,OAAO,CACH,cAAK,SAAS,EAAC,UAAU,EAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAC,IAAI,EAAC,IAAI,CAAA,CAAC,CAAA,UAAU,CAAA,CAAC,CAAA,KAAK,EAAC,CAAC,YAAE,eAAM,GAAG,EAAE,OAAO,GAAG,GAAM,CACzG,CAAA;AAEL,CAAC;AAED,MAAM,KAAK,GAAC,QAAQ,CAAC,EAAC,IAAI,EAAC,UAAU,EAAC,GAAG,EAAC;;;;;;;;;;;;CAYzC,EAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FirstArg } from '@iyio/common';
|
|
2
|
+
declare const CodeInput: import("react").LazyExoticComponent<typeof import("./CodeInput").CodeInput>;
|
|
3
|
+
export declare function LazyCodeInput({ lazyFallback, ...props }: FirstArg<typeof CodeInput> & {
|
|
4
|
+
lazyFallback?: any;
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Suspense, lazy } from 'react';
|
|
4
|
+
const CodeInput = lazy(() => import('./CodeInput').then(v => ({ default: v.CodeInput })));
|
|
5
|
+
export function LazyCodeInput(_a) {
|
|
6
|
+
var { lazyFallback } = _a, props = __rest(_a, ["lazyFallback"]);
|
|
7
|
+
return (_jsx(Suspense, { fallback: lazyFallback, children: _jsx(CodeInput, Object.assign({}, props)) }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=LazyCodeInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LazyCodeInput.js","sourceRoot":"","sources":["../../../../../../packages/syn-taxi/src/lib/LazyCodeInput.tsx"],"names":[],"mappings":";;AACA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,SAAS,GAAC,IAAI,CAAC,GAAE,EAAE,CAAA,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC,SAAS,EAAC,CAAC,CAAC,CAAC,CAAC;AAEjF,MAAM,UAAU,aAAa,CAAC,EAGoB;QAHpB,EAC1B,YAAY,OAEkC,EAD3C,KAAK,cAFkB,gBAG7B,CADW;IAER,OAAO,CACH,KAAC,QAAQ,IAAC,QAAQ,EAAE,YAAY,YAC5B,KAAC,SAAS,oBAAK,KAAK,EAAG,GAChB,CACd,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FirstArg } from '@iyio/common';
|
|
2
|
+
declare const CodeView: import("react").LazyExoticComponent<typeof import("./CodeView").CodeView>;
|
|
3
|
+
export declare function LazyCodeView({ lazyFallback, ...props }: FirstArg<typeof CodeView> & {
|
|
4
|
+
lazyFallback: any;
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Suspense, lazy } from 'react';
|
|
4
|
+
const CodeView = lazy(() => import('./CodeView').then(v => ({ default: v.CodeView })));
|
|
5
|
+
export function LazyCodeView(_a) {
|
|
6
|
+
var { lazyFallback } = _a, props = __rest(_a, ["lazyFallback"]);
|
|
7
|
+
return (_jsx(Suspense, { fallback: lazyFallback, children: _jsx(CodeView, Object.assign({}, props)) }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=LazyCodeView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LazyCodeView.js","sourceRoot":"","sources":["../../../../../../packages/syn-taxi/src/lib/LazyCodeView.tsx"],"names":[],"mappings":";;AACA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,QAAQ,GAAC,IAAI,CAAC,GAAE,EAAE,CAAA,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC,QAAQ,EAAC,CAAC,CAAC,CAAC,CAAC;AAE9E,MAAM,UAAU,YAAY,CAAC,EAGmB;QAHnB,EACzB,YAAY,OAEgC,EADzC,KAAK,cAFiB,gBAG5B,CADW;IAER,OAAO,CACH,KAAC,QAAQ,IAAC,QAAQ,EAAE,YAAY,YAC5B,KAAC,QAAQ,oBAAK,KAAK,EAAG,GACf,CACd,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { atDotCss } from "@iyio/at-dot-css";
|
|
3
|
+
import { dt } from "./lib-design-tokens";
|
|
4
|
+
const isLineError = (line, errors) => {
|
|
5
|
+
for (let i = 0; i < errors.length; i++) {
|
|
6
|
+
const e = errors[i];
|
|
7
|
+
if (e && e === line || e.lineNumber === line) {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
};
|
|
13
|
+
export function LineNumbers({ count = 1, errors, pad }) {
|
|
14
|
+
const lines = [];
|
|
15
|
+
for (let i = 1; i <= count; i++) {
|
|
16
|
+
lines.push(_jsx("span", { className: (errors && isLineError(i, errors)) ? style.error() : undefined, children: i }, i));
|
|
17
|
+
}
|
|
18
|
+
return (_jsxs("div", { className: style.root(), children: [_jsx("span", { className: style.first(), children: "\u00A0\u00A0\u00A0" }), lines, pad] }));
|
|
19
|
+
}
|
|
20
|
+
const style = atDotCss({ name: 'LineNumbers', css: `
|
|
21
|
+
@.root{
|
|
22
|
+
display:flex;
|
|
23
|
+
flex-direction:column;
|
|
24
|
+
align-items:flex-end;
|
|
25
|
+
font-size:${dt().codeFontSize}px !important;
|
|
26
|
+
line-height:${dt().codeLineHeight}px !important;
|
|
27
|
+
border-right:${dt().foreground}18 1px solid;
|
|
28
|
+
padding:0 0.5rem;
|
|
29
|
+
font-family:Courier !important;
|
|
30
|
+
}
|
|
31
|
+
@.root > *{
|
|
32
|
+
opacity:0.5;
|
|
33
|
+
}
|
|
34
|
+
@.first{
|
|
35
|
+
height:0;
|
|
36
|
+
max-height:0;
|
|
37
|
+
}
|
|
38
|
+
@.error{
|
|
39
|
+
color:${dt().dangerColor};
|
|
40
|
+
opacity:1;
|
|
41
|
+
}
|
|
42
|
+
` });
|
|
43
|
+
//# sourceMappingURL=LineNumbers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineNumbers.js","sourceRoot":"","sources":["../../../../../../packages/syn-taxi/src/lib/LineNumbers.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAEzC,MAAM,WAAW,GAAC,CAAC,IAAW,EAAC,MAAkC,EAAS,EAAE;IACxE,KAAI,IAAI,CAAC,GAAC,CAAC,EAAC,CAAC,GAAC,MAAM,CAAC,MAAM,EAAC,CAAC,EAAE,EAAC;QAC5B,MAAM,CAAC,GAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAClB,IAAG,CAAC,IAAI,CAAC,KAAG,IAAI,IAAK,CAAsB,CAAC,UAAU,KAAG,IAAI,EAAC;YAC1D,OAAO,IAAI,CAAC;SACf;KACJ;IACD,OAAO,KAAK,CAAC;AACjB,CAAC,CAAA;AASD,MAAM,UAAU,WAAW,CAAC,EACxB,KAAK,GAAC,CAAC,EACP,MAAM,EACN,GAAG,EACW;IAEd,MAAM,KAAK,GAAO,EAAE,CAAC;IAErB,KAAI,IAAI,CAAC,GAAC,CAAC,EAAC,CAAC,IAAE,KAAK,EAAC,CAAC,EAAE,EAAC;QACrB,KAAK,CAAC,IAAI,CAAC,eAAM,SAAS,EAAE,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC,EAAC,MAAM,CAAC,CAAC,CAAA,CAAC,CAAA,KAAK,CAAC,KAAK,EAAE,CAAA,CAAC,CAAA,SAAS,YAAW,CAAC,IAAL,CAAC,CAAY,CAAC,CAAA;KAC7G;IAGD,OAAO,CACH,eAAK,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE,aACxB,eAAM,SAAS,EAAE,KAAK,CAAC,KAAK,EAAE,mCAA2B,EACxD,KAAK,EACL,GAAG,IACF,CACT,CAAA;AAEL,CAAC;AAED,MAAM,KAAK,GAAC,QAAQ,CAAC,EAAC,IAAI,EAAC,aAAa,EAAC,GAAG,EAAC;;;;;oBAKzB,EAAE,EAAE,CAAC,YAAY;sBACf,EAAE,EAAE,CAAC,cAAc;uBAClB,EAAE,EAAE,CAAC,UAAU;;;;;;;;;;;;gBAYtB,EAAE,EAAE,CAAC,WAAW;;;CAG/B,EAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BehaviorSubject } from "rxjs";
|
|
2
|
+
import { defaultDesignTokenVariation, designTokenValues } from "./tokens";
|
|
3
|
+
export const designVariationSubject = new BehaviorSubject(defaultDesignTokenVariation);
|
|
4
|
+
export const dt = () => {
|
|
5
|
+
return designTokenValues[designVariationSubject.value];
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=lib-design-tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib-design-tokens.js","sourceRoot":"","sources":["../../../../../../packages/syn-taxi/src/lib/lib-design-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAgB,iBAAiB,EAAwB,MAAM,UAAU,CAAC;AAG9G,MAAM,CAAC,MAAM,sBAAsB,GAAC,IAAI,eAAe,CAAuB,2BAA2B,CAAC,CAAC;AAE3G,MAAM,CAAC,MAAM,EAAE,GAAC,GAAe,EAAE;IAC7B,OAAO,iBAAiB,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC,CAAA"}
|