@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
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CodeInput = exports.markdownCodeLineStartReg = exports.defaultCodeLineStartReg = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const at_dot_css_1 = require("@iyio/at-dot-css");
|
|
7
|
+
const common_1 = require("@iyio/common");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const lib_design_tokens_1 = require("../lib/lib-design-tokens");
|
|
10
|
+
const LineNumbers_1 = require("./LineNumbers");
|
|
11
|
+
const shiki_1 = require("./shiki");
|
|
12
|
+
exports.defaultCodeLineStartReg = /^(\s*)/;
|
|
13
|
+
exports.markdownCodeLineStartReg = /^(\s*-?\s*)/;
|
|
14
|
+
function CodeInput(_a) {
|
|
15
|
+
var { tab = ' ', language = 'auto', value, readOnly, valueOverride, disabled, onChange, onSubmit, onElem, onTextarea, onBlur, onNewLine, tall, lineStartReg = exports.defaultCodeLineStartReg, lineStartRegIndex = 1, lineNumbers, errors, parser, logParsed, parsingDelayMs = 700, debugParser, bottomPadding = 500 } = _a, props = tslib_1.__rest(_a, ["tab", "language", "value", "readOnly", "valueOverride", "disabled", "onChange", "onSubmit", "onElem", "onTextarea", "onBlur", "onNewLine", "tall", "lineStartReg", "lineStartRegIndex", "lineNumbers", "errors", "parser", "logParsed", "parsingDelayMs", "debugParser", "bottomPadding"]);
|
|
16
|
+
style.root();
|
|
17
|
+
const sh = (0, shiki_1.useShiki)(language);
|
|
18
|
+
const [parsingErrors, setParsingErrors] = (0, react_1.useState)(undefined);
|
|
19
|
+
const [code, setCode] = (0, react_1.useState)(null);
|
|
20
|
+
const [textArea, setTextArea] = (0, react_1.useState)(null);
|
|
21
|
+
(0, react_1.useEffect)(() => {
|
|
22
|
+
setParsingErrors(undefined);
|
|
23
|
+
if (!code || !sh || !textArea) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
code.innerHTML = sh.codeToHtml(value, { lang: language });
|
|
27
|
+
let minWidth = 0;
|
|
28
|
+
const codeElem = code.querySelector('code');
|
|
29
|
+
if (codeElem) {
|
|
30
|
+
for (let i = 0; i < codeElem.children.length; i++) {
|
|
31
|
+
const item = codeElem.children.item(i);
|
|
32
|
+
if (!item) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const w = item.offsetWidth;
|
|
36
|
+
if (w && w > minWidth) {
|
|
37
|
+
minWidth = w;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
textArea.style.minWidth = minWidth + 'px';
|
|
42
|
+
if (parser) {
|
|
43
|
+
const iv = setTimeout(() => {
|
|
44
|
+
try {
|
|
45
|
+
const r = parser(value, debugParser === true ? console.info : (debugParser || undefined));
|
|
46
|
+
if (logParsed) {
|
|
47
|
+
console.info('CodeInput parsing result', r);
|
|
48
|
+
}
|
|
49
|
+
setParsingErrors(r.error ? [r.error] : undefined);
|
|
50
|
+
if (r.error) {
|
|
51
|
+
console.info('⛔️ CodeInput parsing error', r.error);
|
|
52
|
+
console.info(r.error.near);
|
|
53
|
+
code.innerHTML = sh.codeToHtml(value, { lang: language, lineOptions: [
|
|
54
|
+
{
|
|
55
|
+
line: r.error.lineNumber,
|
|
56
|
+
classes: ['CodeInput-errorLine']
|
|
57
|
+
}
|
|
58
|
+
] }).replace(/class="[^"]*CodeInput-errorLine[^"]*"[^>]*>/g, v => {
|
|
59
|
+
var _a, _b, _c, _d;
|
|
60
|
+
return `${v}<div class="CodeInput-error">${(0, common_1.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>`;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (ex) {
|
|
65
|
+
setParsingErrors([0]);
|
|
66
|
+
}
|
|
67
|
+
}, parsingDelayMs);
|
|
68
|
+
return () => {
|
|
69
|
+
clearTimeout(iv);
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
setParsingErrors(undefined);
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
}, [code, textArea, valueOverride, value, language, sh, parser, parsingDelayMs, logParsed, debugParser]);
|
|
77
|
+
(0, react_1.useEffect)(() => {
|
|
78
|
+
onElem === null || onElem === void 0 ? void 0 : onElem(code);
|
|
79
|
+
}, [onElem, code]);
|
|
80
|
+
(0, react_1.useEffect)(() => {
|
|
81
|
+
onTextarea === null || onTextarea === void 0 ? void 0 : onTextarea(textArea);
|
|
82
|
+
}, [onTextarea, textArea]);
|
|
83
|
+
const onKeyDown = (0, react_1.useCallback)((e) => {
|
|
84
|
+
var _a;
|
|
85
|
+
if (disabled) {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (!textArea) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
switch (e.key) {
|
|
93
|
+
case "Tab": {
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
const value = (textArea.value.substring(0, textArea.selectionStart) +
|
|
96
|
+
tab +
|
|
97
|
+
textArea.value.substring(textArea.selectionStart));
|
|
98
|
+
const s = textArea.selectionStart + tab.length;
|
|
99
|
+
textArea.value = value;
|
|
100
|
+
textArea.selectionStart = s;
|
|
101
|
+
textArea.selectionEnd = s;
|
|
102
|
+
textArea.focus();
|
|
103
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
case "Enter": {
|
|
107
|
+
const value = (textArea.value.substring(0, textArea.selectionStart) +
|
|
108
|
+
textArea.value.substring(textArea.selectionStart));
|
|
109
|
+
if (e.metaKey || e.ctrlKey) {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
const s = textArea.selectionStart;
|
|
112
|
+
textArea.value = value;
|
|
113
|
+
if (s >= 0) {
|
|
114
|
+
textArea.selectionStart = s;
|
|
115
|
+
textArea.selectionEnd = s;
|
|
116
|
+
textArea.focus();
|
|
117
|
+
}
|
|
118
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(value);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
const s = textArea.selectionStart;
|
|
122
|
+
if (lineStartReg && s > 0 && s === textArea.selectionEnd) {
|
|
123
|
+
const i = textArea.value.lastIndexOf('\n', s - 1);
|
|
124
|
+
if (i != -1) {
|
|
125
|
+
const prevLine = textArea.value.substring(i + 1, s);
|
|
126
|
+
const lineStart = (_a = lineStartReg.exec(prevLine)) === null || _a === void 0 ? void 0 : _a[lineStartRegIndex];
|
|
127
|
+
if (lineStart) {
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
textArea.value = textArea.value.substring(0, s) + '\n' + lineStart + textArea.value.substring(s);
|
|
130
|
+
textArea.selectionStart = s + lineStart.length + 1;
|
|
131
|
+
textArea.selectionEnd = s + lineStart.length + 1;
|
|
132
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(textArea.value);
|
|
133
|
+
textArea.focus();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
onNewLine === null || onNewLine === void 0 ? void 0 : onNewLine(value);
|
|
138
|
+
}
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}, [textArea, tab, onChange, onSubmit, onNewLine, disabled, lineStartReg, lineStartRegIndex]);
|
|
143
|
+
const pad = (0, jsx_runtime_1.jsx)("div", { className: "CodeInput-bottomMargin", style: { height: bottomPadding } });
|
|
144
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, common_1.cn)("CodeInput", { tall, disabled, readOnly, lineNumbers: lineNumbers !== undefined }, (0, common_1.baseLayoutCn)(props)), children: [lineNumbers && (0, jsx_runtime_1.jsx)(LineNumbers_1.LineNumbers, { count: (0, common_1.strLineCount)(value), errors: errors !== null && errors !== void 0 ? errors : parsingErrors, pad: pad }), (0, jsx_runtime_1.jsx)("div", { className: "CodeInput-content", children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { ref: setCode, className: (0, common_1.cn)("no-select", language === 'auto' ? undefined : `language-${language}`) }, language), (0, jsx_runtime_1.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] }) })] }));
|
|
145
|
+
}
|
|
146
|
+
exports.CodeInput = CodeInput;
|
|
147
|
+
const style = (0, at_dot_css_1.atDotCss)({ name: 'CodeInput', css: `
|
|
148
|
+
.CodeInput{
|
|
149
|
+
display:flex;
|
|
150
|
+
border-radius:8px;
|
|
151
|
+
transition:opacity 0.1s ease-in-out;
|
|
152
|
+
background:#1E1E1E;
|
|
153
|
+
}
|
|
154
|
+
.CodeInput textarea{
|
|
155
|
+
all:unset;
|
|
156
|
+
}
|
|
157
|
+
.CodeInput.tall{
|
|
158
|
+
min-height:200px;
|
|
159
|
+
}
|
|
160
|
+
.CodeInput.disabled{
|
|
161
|
+
opacity:0.4;
|
|
162
|
+
}
|
|
163
|
+
.CodeInput.disabled textarea{
|
|
164
|
+
opacity:0;
|
|
165
|
+
}
|
|
166
|
+
.CodeInput code, .CodeInput textarea{
|
|
167
|
+
margin:0 !important;
|
|
168
|
+
padding: 0 !important;
|
|
169
|
+
display:block;
|
|
170
|
+
white-space:pre;
|
|
171
|
+
font-family:Courier !important;
|
|
172
|
+
font-size:${(0, lib_design_tokens_1.dt)().codeFontSize}px !important;
|
|
173
|
+
line-height:${(0, lib_design_tokens_1.dt)().codeLineHeight}px !important;
|
|
174
|
+
min-height:${(0, lib_design_tokens_1.dt)().codeLineHeight}px;
|
|
175
|
+
}
|
|
176
|
+
.CodeInput code *{
|
|
177
|
+
font-size:${(0, lib_design_tokens_1.dt)().codeFontSize}px !important;
|
|
178
|
+
line-height:${(0, lib_design_tokens_1.dt)().codeLineHeight}px !important;
|
|
179
|
+
}
|
|
180
|
+
.CodeInput pre{
|
|
181
|
+
margin:0 !important;
|
|
182
|
+
padding:0 !important;
|
|
183
|
+
display:block;
|
|
184
|
+
}
|
|
185
|
+
.CodeInput pre,.CodeInput code{
|
|
186
|
+
background: none !important;
|
|
187
|
+
}
|
|
188
|
+
.CodeInput textarea{
|
|
189
|
+
position:absolute;
|
|
190
|
+
left:0;
|
|
191
|
+
top:0;
|
|
192
|
+
width:100%;
|
|
193
|
+
height:100%;
|
|
194
|
+
overflow:hidden;
|
|
195
|
+
overflow:clip;
|
|
196
|
+
border:none;
|
|
197
|
+
background:none;
|
|
198
|
+
resize:none;
|
|
199
|
+
color:transparent;
|
|
200
|
+
caret-color: #ffffffcc;
|
|
201
|
+
outline:none;
|
|
202
|
+
outline-width:0;
|
|
203
|
+
cursor:text;
|
|
204
|
+
}
|
|
205
|
+
.CodeInput.readOnly textarea{
|
|
206
|
+
pointer-events:none;
|
|
207
|
+
}
|
|
208
|
+
.CodeInput .no-select{
|
|
209
|
+
pointer-events:none;
|
|
210
|
+
}
|
|
211
|
+
.CodeInput.readOnly .no-select{
|
|
212
|
+
pointer-events:auto;
|
|
213
|
+
}
|
|
214
|
+
.CodeInput-content{
|
|
215
|
+
display:flex;
|
|
216
|
+
flex-direction:column;
|
|
217
|
+
overflow-x:auto;
|
|
218
|
+
flex:1;
|
|
219
|
+
}
|
|
220
|
+
.CodeInput-content > div{
|
|
221
|
+
position:relative;
|
|
222
|
+
}
|
|
223
|
+
.CodeInput.lineNumbers .CodeInput-content > div{
|
|
224
|
+
margin-left:0.5rem !important;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.CodeInput-errorLine{
|
|
228
|
+
position:relative;
|
|
229
|
+
}
|
|
230
|
+
.CodeInput-errorLine > .CodeInput-error{
|
|
231
|
+
position:absolute;
|
|
232
|
+
left:calc( 100% + 1rem);
|
|
233
|
+
font-size:12px !important;
|
|
234
|
+
line-height:12px !important;
|
|
235
|
+
display:flex;
|
|
236
|
+
align-items:center;
|
|
237
|
+
background-color:#ff000033;
|
|
238
|
+
top:-0.2rem;
|
|
239
|
+
bottom:-0.2rem;
|
|
240
|
+
padding:0 0.4rem;
|
|
241
|
+
border-radius:4px;
|
|
242
|
+
}
|
|
243
|
+
.CodeInput-errorCol{
|
|
244
|
+
position:absolute;
|
|
245
|
+
left:0;
|
|
246
|
+
top:0;
|
|
247
|
+
color:#ff000088;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
` });
|
|
251
|
+
//# 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,iDAA4C;AAC5C,yCAA8H;AAC9H,iCAAwE;AACxE,gEAA8C;AAC9C,+CAA4C;AAC5C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A,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;AA5MD,8BA4MC;AAGD,MAAM,KAAK,GAAC,IAAA,qBAAQ,EAAC,EAAC,IAAI,EAAC,WAAW,EAAC,GAAG,EAAC;;;;;;;;;;;;;;;;;;;;;;;;;oBAyBvB,IAAA,sBAAE,GAAE,CAAC,YAAY;sBACf,IAAA,sBAAE,GAAE,CAAC,cAAc;qBACpB,IAAA,sBAAE,GAAE,CAAC,cAAc;;;oBAGpB,IAAA,sBAAE,GAAE,CAAC,YAAY;sBACf,IAAA,sBAAE,GAAE,CAAC,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwExC,EAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CodeView = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const at_dot_css_1 = require("@iyio/at-dot-css");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const shiki_1 = require("./shiki");
|
|
8
|
+
function CodeView({ value, wrap, children, language, }) {
|
|
9
|
+
style.root();
|
|
10
|
+
const code = value || children || '';
|
|
11
|
+
const sh = (0, shiki_1.useShiki)(language);
|
|
12
|
+
const [elem, setElem] = (0, react_1.useState)(null);
|
|
13
|
+
(0, react_1.useEffect)(() => {
|
|
14
|
+
if (!elem || !sh) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
elem.innerHTML = sh.codeToHtml(code, { lang: language });
|
|
18
|
+
}, [sh, code, elem, language]);
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)("pre", { className: "CodeView", style: style.vars({ wrap: wrap ? 'pre-wrap' : 'pre' }), children: (0, jsx_runtime_1.jsx)("code", { ref: setElem }) }));
|
|
20
|
+
}
|
|
21
|
+
exports.CodeView = CodeView;
|
|
22
|
+
const style = (0, at_dot_css_1.atDotCss)({ name: 'CodeView', css: `
|
|
23
|
+
.CodeView.pre, .CodeView > code{
|
|
24
|
+
margin:0 !important;
|
|
25
|
+
padding:0 !important;
|
|
26
|
+
display:block !important;
|
|
27
|
+
overflow-x:hidden !important;
|
|
28
|
+
overflow-y:hidden !important;
|
|
29
|
+
white-space:@@wrap !important;
|
|
30
|
+
font-family:Courier !important;
|
|
31
|
+
font-size:14px !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
` });
|
|
35
|
+
//# 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,iDAA4C;AAC5C,iCAA4C;AAC5C,mCAAmC;AAUnC,SAAgB,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,IAAA,gBAAQ,EAAC,QAAQ,CAAC,CAAC;IAE5B,MAAM,CAAC,IAAI,EAAC,OAAO,CAAC,GAAC,IAAA,gBAAQ,EAAmB,IAAI,CAAC,CAAC;IAEtD,IAAA,iBAAS,EAAC,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,gCAAK,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,iCAAM,GAAG,EAAE,OAAO,GAAG,GAAM,CACzG,CAAA;AAEL,CAAC;AA1BD,4BA0BC;AAED,MAAM,KAAK,GAAC,IAAA,qBAAQ,EAAC,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,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LazyCodeInput = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const CodeInput = (0, react_1.lazy)(() => Promise.resolve().then(() => require('./CodeInput')).then(v => ({ default: v.CodeInput })));
|
|
8
|
+
function LazyCodeInput(_a) {
|
|
9
|
+
var { lazyFallback } = _a, props = tslib_1.__rest(_a, ["lazyFallback"]);
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: lazyFallback, children: (0, jsx_runtime_1.jsx)(CodeInput, Object.assign({}, props)) }));
|
|
11
|
+
}
|
|
12
|
+
exports.LazyCodeInput = LazyCodeInput;
|
|
13
|
+
//# 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,iCAAuC;AAEvC,MAAM,SAAS,GAAC,IAAA,YAAI,EAAC,GAAE,EAAE,CAAA,qCAAO,aAAa,GAAE,IAAI,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC,SAAS,EAAC,CAAC,CAAC,CAAC,CAAC;AAEjF,SAAgB,aAAa,CAAC,EAGoB;QAHpB,EAC1B,YAAY,OAEkC,EAD3C,KAAK,sBAFkB,gBAG7B,CADW;IAER,OAAO,CACH,uBAAC,gBAAQ,IAAC,QAAQ,EAAE,YAAY,YAC5B,uBAAC,SAAS,oBAAK,KAAK,EAAG,GAChB,CACd,CAAA;AACL,CAAC;AATD,sCASC"}
|
|
@@ -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,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LazyCodeView = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const CodeView = (0, react_1.lazy)(() => Promise.resolve().then(() => require('./CodeView')).then(v => ({ default: v.CodeView })));
|
|
8
|
+
function LazyCodeView(_a) {
|
|
9
|
+
var { lazyFallback } = _a, props = tslib_1.__rest(_a, ["lazyFallback"]);
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: lazyFallback, children: (0, jsx_runtime_1.jsx)(CodeView, Object.assign({}, props)) }));
|
|
11
|
+
}
|
|
12
|
+
exports.LazyCodeView = LazyCodeView;
|
|
13
|
+
//# 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,iCAAuC;AAEvC,MAAM,QAAQ,GAAC,IAAA,YAAI,EAAC,GAAE,EAAE,CAAA,qCAAO,YAAY,GAAE,IAAI,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC,QAAQ,EAAC,CAAC,CAAC,CAAC,CAAC;AAE9E,SAAgB,YAAY,CAAC,EAGmB;QAHnB,EACzB,YAAY,OAEgC,EADzC,KAAK,sBAFiB,gBAG5B,CADW;IAER,OAAO,CACH,uBAAC,gBAAQ,IAAC,QAAQ,EAAE,YAAY,YAC5B,uBAAC,QAAQ,oBAAK,KAAK,EAAG,GACf,CACd,CAAA;AACL,CAAC;AATD,oCASC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LineNumbers = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const at_dot_css_1 = require("@iyio/at-dot-css");
|
|
6
|
+
const lib_design_tokens_1 = require("./lib-design-tokens");
|
|
7
|
+
const isLineError = (line, errors) => {
|
|
8
|
+
for (let i = 0; i < errors.length; i++) {
|
|
9
|
+
const e = errors[i];
|
|
10
|
+
if (e && e === line || e.lineNumber === line) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
};
|
|
16
|
+
function LineNumbers({ count = 1, errors, pad }) {
|
|
17
|
+
const lines = [];
|
|
18
|
+
for (let i = 1; i <= count; i++) {
|
|
19
|
+
lines.push((0, jsx_runtime_1.jsx)("span", { className: (errors && isLineError(i, errors)) ? style.error() : undefined, children: i }, i));
|
|
20
|
+
}
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: style.root(), children: [(0, jsx_runtime_1.jsx)("span", { className: style.first(), children: "\u00A0\u00A0\u00A0" }), lines, pad] }));
|
|
22
|
+
}
|
|
23
|
+
exports.LineNumbers = LineNumbers;
|
|
24
|
+
const style = (0, at_dot_css_1.atDotCss)({ name: 'LineNumbers', css: `
|
|
25
|
+
@.root{
|
|
26
|
+
display:flex;
|
|
27
|
+
flex-direction:column;
|
|
28
|
+
align-items:flex-end;
|
|
29
|
+
font-size:${(0, lib_design_tokens_1.dt)().codeFontSize}px !important;
|
|
30
|
+
line-height:${(0, lib_design_tokens_1.dt)().codeLineHeight}px !important;
|
|
31
|
+
border-right:${(0, lib_design_tokens_1.dt)().foreground}18 1px solid;
|
|
32
|
+
padding:0 0.5rem;
|
|
33
|
+
font-family:Courier !important;
|
|
34
|
+
}
|
|
35
|
+
@.root > *{
|
|
36
|
+
opacity:0.5;
|
|
37
|
+
}
|
|
38
|
+
@.first{
|
|
39
|
+
height:0;
|
|
40
|
+
max-height:0;
|
|
41
|
+
}
|
|
42
|
+
@.error{
|
|
43
|
+
color:${(0, lib_design_tokens_1.dt)().dangerColor};
|
|
44
|
+
opacity:1;
|
|
45
|
+
}
|
|
46
|
+
` });
|
|
47
|
+
//# 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,iDAA4C;AAE5C,2DAAyC;AAEz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;;;CAG/B,EAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dt = exports.designVariationSubject = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const tokens_1 = require("./tokens");
|
|
6
|
+
exports.designVariationSubject = new rxjs_1.BehaviorSubject(tokens_1.defaultDesignTokenVariation);
|
|
7
|
+
const dt = () => {
|
|
8
|
+
return tokens_1.designTokenValues[exports.designVariationSubject.value];
|
|
9
|
+
};
|
|
10
|
+
exports.dt = dt;
|
|
11
|
+
//# 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,+BAAuC;AACvC,qCAA8G;AAGjG,QAAA,sBAAsB,GAAC,IAAI,sBAAe,CAAuB,oCAA2B,CAAC,CAAC;AAEpG,MAAM,EAAE,GAAC,GAAe,EAAE;IAC7B,OAAO,0BAAiB,CAAC,8BAAsB,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC,CAAA;AAFY,QAAA,EAAE,MAEd"}
|