@tectra-ng/code-editor 0.2.6 → 0.3.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/fesm2022/tectra-ng-code-editor-highlight.mjs +22 -2
- package/fesm2022/tectra-ng-code-editor-highlight.mjs.map +1 -1
- package/fesm2022/tectra-ng-code-editor.mjs +27 -2
- package/fesm2022/tectra-ng-code-editor.mjs.map +1 -1
- package/package.json +5 -5
- package/types/tectra-ng-code-editor-highlight.d.ts +2 -0
- package/types/tectra-ng-code-editor-highlight.d.ts.map +1 -1
- package/types/tectra-ng-code-editor.d.ts +2 -0
- package/types/tectra-ng-code-editor.d.ts.map +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { ChangeDetectionStrategy, Component, ViewEncapsulation, booleanAttribute, computed, inject, input, numberAttribute } from "@angular/core";
|
|
3
|
-
import {
|
|
3
|
+
import { provideTxIconDefaults, txIconCode, txIconComment, txIconHeading, txIconKey, txIconLink, txIconTag, txIconText } from "@tectra-ng/icons";
|
|
4
|
+
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
5
|
+
import { codeHighlightTokens, codeSyntaxTokens, toStyleObject } from "@tectra-ng/themes";
|
|
4
6
|
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
5
7
|
import { TxStyleLoader } from "@tectra-ng/core/styles";
|
|
6
8
|
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
7
|
-
import { toStyleObject } from "@tectra-ng/themes";
|
|
8
9
|
const STICKY = /* @__PURE__ */ new WeakMap();
|
|
9
10
|
function sticky(pattern) {
|
|
10
11
|
let compiled = STICKY.get(pattern);
|
|
@@ -871,7 +872,21 @@ function codeLines(code, language, firstLine = 1, tabSize = 4) {
|
|
|
871
872
|
guides: guides[index]
|
|
872
873
|
}));
|
|
873
874
|
}
|
|
875
|
+
const HIGHLIGHT_ICON_DEFAULTS = {
|
|
876
|
+
code: txIconCode,
|
|
877
|
+
comment: txIconComment,
|
|
878
|
+
heading: txIconHeading,
|
|
879
|
+
key: txIconKey,
|
|
880
|
+
link: txIconLink,
|
|
881
|
+
tag: txIconTag,
|
|
882
|
+
text: txIconText
|
|
883
|
+
};
|
|
884
|
+
const HIGHLIGHT_THEME = {
|
|
885
|
+
codeHighlight: codeHighlightTokens,
|
|
886
|
+
codeSyntax: codeSyntaxTokens
|
|
887
|
+
};
|
|
874
888
|
var TxCodeSyntaxStyles = class TxCodeSyntaxStyles {
|
|
889
|
+
highlightTheme = injectTokens(HIGHLIGHT_THEME);
|
|
875
890
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
876
891
|
minVersion: "12.0.0",
|
|
877
892
|
version: "22.2.5",
|
|
@@ -890,6 +905,7 @@ var TxCodeSyntaxStyles = class TxCodeSyntaxStyles {
|
|
|
890
905
|
template: "",
|
|
891
906
|
isInline: true,
|
|
892
907
|
styles: ["[data-styled] .tx-code-tok-comment,[data-styled] .tx-code-tok-quote{color:var(--tx-code-syntax-comment)}[data-styled] .tx-code-tok-quote{color:var(--tx-code-syntax-quote)}[data-styled] .tx-code-tok-keyword{color:var(--tx-code-syntax-keyword)}[data-styled] .tx-code-tok-literal{color:var(--tx-code-syntax-literal)}[data-styled] .tx-code-tok-string{color:var(--tx-code-syntax-string)}[data-styled] .tx-code-tok-number{color:var(--tx-code-syntax-number)}[data-styled] .tx-code-tok-regexp{color:var(--tx-code-syntax-regexp)}[data-styled] .tx-code-tok-type{color:var(--tx-code-syntax-type)}[data-styled] .tx-code-tok-delimiter{color:var(--tx-code-syntax-delimiter)}[data-styled] .tx-code-tok-tag{color:var(--tx-code-syntax-tag)}[data-styled] .tx-code-tok-tag-delimiter{color:var(--tx-code-syntax-tag-delimiter)}[data-styled] .tx-code-tok-meta{color:var(--tx-code-syntax-meta)}[data-styled] .tx-code-tok-attribute{color:var(--tx-code-syntax-attribute)}[data-styled] .tx-code-tok-attribute-value{color:var(--tx-code-syntax-attribute-value)}[data-styled] .tx-code-tok-value{color:var(--tx-code-syntax-value)}[data-styled] .tx-code-tok-key{color:var(--tx-code-syntax-key)}[data-styled] .tx-code-tok-heading{color:var(--tx-code-syntax-heading);font-weight:var(--tx-code-syntax-heading-weight)}[data-styled] .tx-code-tok-strong{font-weight:var(--tx-code-syntax-strong-weight)}[data-styled] .tx-code-tok-emphasis{font-style:italic}[data-styled] .tx-code-tok-link{color:var(--tx-code-syntax-link);text-decoration:underline}[data-styled] .tx-code-tok-code{color:var(--tx-code-syntax-code)}\n"],
|
|
908
|
+
viewProviders: [provideTxIconDefaults(HIGHLIGHT_ICON_DEFAULTS)],
|
|
893
909
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
894
910
|
encapsulation: i0.ViewEncapsulation.None
|
|
895
911
|
});
|
|
@@ -906,11 +922,13 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
906
922
|
template: "",
|
|
907
923
|
encapsulation: ViewEncapsulation.None,
|
|
908
924
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
925
|
+
viewProviders: [provideTxIconDefaults(HIGHLIGHT_ICON_DEFAULTS)],
|
|
909
926
|
styles: ["[data-styled] .tx-code-tok-comment,[data-styled] .tx-code-tok-quote{color:var(--tx-code-syntax-comment)}[data-styled] .tx-code-tok-quote{color:var(--tx-code-syntax-quote)}[data-styled] .tx-code-tok-keyword{color:var(--tx-code-syntax-keyword)}[data-styled] .tx-code-tok-literal{color:var(--tx-code-syntax-literal)}[data-styled] .tx-code-tok-string{color:var(--tx-code-syntax-string)}[data-styled] .tx-code-tok-number{color:var(--tx-code-syntax-number)}[data-styled] .tx-code-tok-regexp{color:var(--tx-code-syntax-regexp)}[data-styled] .tx-code-tok-type{color:var(--tx-code-syntax-type)}[data-styled] .tx-code-tok-delimiter{color:var(--tx-code-syntax-delimiter)}[data-styled] .tx-code-tok-tag{color:var(--tx-code-syntax-tag)}[data-styled] .tx-code-tok-tag-delimiter{color:var(--tx-code-syntax-tag-delimiter)}[data-styled] .tx-code-tok-meta{color:var(--tx-code-syntax-meta)}[data-styled] .tx-code-tok-attribute{color:var(--tx-code-syntax-attribute)}[data-styled] .tx-code-tok-attribute-value{color:var(--tx-code-syntax-attribute-value)}[data-styled] .tx-code-tok-value{color:var(--tx-code-syntax-value)}[data-styled] .tx-code-tok-key{color:var(--tx-code-syntax-key)}[data-styled] .tx-code-tok-heading{color:var(--tx-code-syntax-heading);font-weight:var(--tx-code-syntax-heading-weight)}[data-styled] .tx-code-tok-strong{font-weight:var(--tx-code-syntax-strong-weight)}[data-styled] .tx-code-tok-emphasis{font-style:italic}[data-styled] .tx-code-tok-link{color:var(--tx-code-syntax-link);text-decoration:underline}[data-styled] .tx-code-tok-code{color:var(--tx-code-syntax-code)}\n"]
|
|
910
927
|
}]
|
|
911
928
|
}]
|
|
912
929
|
});
|
|
913
930
|
var TxCodeHighlight = class TxCodeHighlight {
|
|
931
|
+
highlightTheme = injectTokens(HIGHLIGHT_THEME);
|
|
914
932
|
code = input("", ...ngDevMode ? [{ debugName: "code" }] : /* istanbul ignore next */ []);
|
|
915
933
|
language = input("html", ...ngDevMode ? [{ debugName: "language" }] : /* istanbul ignore next */ []);
|
|
916
934
|
lineNumbers = input(true, {
|
|
@@ -1080,6 +1098,7 @@ var TxCodeHighlight = class TxCodeHighlight {
|
|
|
1080
1098
|
ngImport: i0,
|
|
1081
1099
|
template: "<pre\n class=\"tx-code-highlight__code\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"label()\"\n [class]=\"passThrough().content?.class\"\n [style]=\"passThrough().content?.style\"\n><code>@for (line of lines(); track $index) {<span class=\"tx-code-highlight__line\" [class]=\"passThrough().line?.class\" [style]=\"passThrough().line?.style\">@if (lineNumbers()) {<span class=\"tx-code-highlight__number\" aria-hidden=\"true\" [class]=\"passThrough().gutter?.class\" [style]=\"passThrough().gutter?.style\">{{ line.number }}</span>}<span class=\"tx-code-highlight__text\" [class.tx-code-guides]=\"indentGuides() && line.guides > 0\" [style.--tx-code-guides]=\"indentGuides() && line.guides > 0 ? line.guides : null\" [style.--tx-code-guide-step]=\"tabSize() + 'ch'\" [style.--tx-code-wrap-indent]=\"wordWrap() ? line.indent : null\">@for (segment of line.segments; track $index) {<span [class]=\"segment.className\">{{ segment.text }}</span>}{{ '\\n' }}</span></span>}</code></pre>\n",
|
|
1082
1100
|
styles: [":host{display:block;min-width:0}:host([data-styled]){overflow:hidden;border:var(--tx-code-highlight-border-width) solid var(--tx-code-highlight-border-color);border-radius:var(--tx-code-highlight-border-radius);background:var(--tx-code-highlight-background);color:var(--tx-code-highlight-color);font-family:var(--tx-code-highlight-font-family);font-size:var(--tx-code-highlight-font-size);line-height:var(--tx-code-highlight-line-height)}:host([data-styled]) .tx-code-highlight__code{height:100%;margin:0;padding-block:var(--tx-code-highlight-padding-block);overflow:auto;font:inherit;tab-size:var(--tx-code-highlight-tab-size)}:host([data-styled]) .tx-code-highlight__code:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:-2px}:host([data-styled]) code{display:block;width:max-content;min-width:100%;font:inherit}:host([data-styled]) .tx-code-highlight__line{display:flex;min-height:var(--tx-code-highlight-line-height)}:host([data-styled]) .tx-code-highlight__number{position:sticky;left:0;flex:none;box-sizing:content-box;min-width:var(--tx-code-highlight-gutter-min-digits);padding-inline:var(--tx-code-highlight-gutter-padding-start) var(--tx-code-highlight-gutter-gap);background:var(--tx-code-highlight-gutter-background);color:var(--tx-code-highlight-gutter-color);text-align:right;-webkit-user-select:none;user-select:none}:host([data-styled]) .tx-code-highlight__text{flex:1 1 auto;padding-inline-end:var(--tx-code-highlight-padding-inline-end);white-space:pre}:host([data-styled]) .tx-code-highlight__text.tx-code-guides{background-image:repeating-linear-gradient(to right,var(--tx-code-syntax-indent-guide) 0 1px,transparent 1px var(--tx-code-guide-step));background-position:var(--tx-code-line-start, 0) 0;background-repeat:no-repeat;background-size:calc(var(--tx-code-guides) * var(--tx-code-guide-step)) 100%}:host([data-styled]):not(.tx-code-highlight--numbers) .tx-code-highlight__text{--tx-code-line-start: var(--tx-code-highlight-padding-inline-end);padding-inline-start:var(--tx-code-highlight-padding-inline-end)}:host([data-styled]).tx-code-highlight--wrap code{width:auto}:host([data-styled]).tx-code-highlight--wrap .tx-code-highlight__text{min-width:0;white-space:pre-wrap;overflow-wrap:anywhere}:host([data-styled]).tx-code-highlight--wrap .tx-code-highlight__text[style*=--tx-code-wrap-indent]{padding-inline-start:var(--tx-code-wrap-indent);text-indent:calc(-1 * var(--tx-code-wrap-indent))}:host([data-styled]).tx-code-highlight--wrap:not(.tx-code-highlight--numbers) .tx-code-highlight__text[style*=--tx-code-wrap-indent]{padding-inline-start:calc(var(--tx-code-highlight-padding-inline-end) + var(--tx-code-wrap-indent))}\n"],
|
|
1101
|
+
viewProviders: [provideTxIconDefaults(HIGHLIGHT_ICON_DEFAULTS)],
|
|
1083
1102
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1084
1103
|
});
|
|
1085
1104
|
};
|
|
@@ -1102,6 +1121,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1102
1121
|
"[class.tx-code-highlight--wrap]": "wordWrap()",
|
|
1103
1122
|
"[class.tx-code-highlight--numbers]": "lineNumbers()"
|
|
1104
1123
|
},
|
|
1124
|
+
viewProviders: [provideTxIconDefaults(HIGHLIGHT_ICON_DEFAULTS)],
|
|
1105
1125
|
template: "<pre\n class=\"tx-code-highlight__code\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"label()\"\n [class]=\"passThrough().content?.class\"\n [style]=\"passThrough().content?.style\"\n><code>@for (line of lines(); track $index) {<span class=\"tx-code-highlight__line\" [class]=\"passThrough().line?.class\" [style]=\"passThrough().line?.style\">@if (lineNumbers()) {<span class=\"tx-code-highlight__number\" aria-hidden=\"true\" [class]=\"passThrough().gutter?.class\" [style]=\"passThrough().gutter?.style\">{{ line.number }}</span>}<span class=\"tx-code-highlight__text\" [class.tx-code-guides]=\"indentGuides() && line.guides > 0\" [style.--tx-code-guides]=\"indentGuides() && line.guides > 0 ? line.guides : null\" [style.--tx-code-guide-step]=\"tabSize() + 'ch'\" [style.--tx-code-wrap-indent]=\"wordWrap() ? line.indent : null\">@for (segment of line.segments; track $index) {<span [class]=\"segment.className\">{{ segment.text }}</span>}{{ '\\n' }}</span></span>}</code></pre>\n",
|
|
1106
1126
|
styles: [":host{display:block;min-width:0}:host([data-styled]){overflow:hidden;border:var(--tx-code-highlight-border-width) solid var(--tx-code-highlight-border-color);border-radius:var(--tx-code-highlight-border-radius);background:var(--tx-code-highlight-background);color:var(--tx-code-highlight-color);font-family:var(--tx-code-highlight-font-family);font-size:var(--tx-code-highlight-font-size);line-height:var(--tx-code-highlight-line-height)}:host([data-styled]) .tx-code-highlight__code{height:100%;margin:0;padding-block:var(--tx-code-highlight-padding-block);overflow:auto;font:inherit;tab-size:var(--tx-code-highlight-tab-size)}:host([data-styled]) .tx-code-highlight__code:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:-2px}:host([data-styled]) code{display:block;width:max-content;min-width:100%;font:inherit}:host([data-styled]) .tx-code-highlight__line{display:flex;min-height:var(--tx-code-highlight-line-height)}:host([data-styled]) .tx-code-highlight__number{position:sticky;left:0;flex:none;box-sizing:content-box;min-width:var(--tx-code-highlight-gutter-min-digits);padding-inline:var(--tx-code-highlight-gutter-padding-start) var(--tx-code-highlight-gutter-gap);background:var(--tx-code-highlight-gutter-background);color:var(--tx-code-highlight-gutter-color);text-align:right;-webkit-user-select:none;user-select:none}:host([data-styled]) .tx-code-highlight__text{flex:1 1 auto;padding-inline-end:var(--tx-code-highlight-padding-inline-end);white-space:pre}:host([data-styled]) .tx-code-highlight__text.tx-code-guides{background-image:repeating-linear-gradient(to right,var(--tx-code-syntax-indent-guide) 0 1px,transparent 1px var(--tx-code-guide-step));background-position:var(--tx-code-line-start, 0) 0;background-repeat:no-repeat;background-size:calc(var(--tx-code-guides) * var(--tx-code-guide-step)) 100%}:host([data-styled]):not(.tx-code-highlight--numbers) .tx-code-highlight__text{--tx-code-line-start: var(--tx-code-highlight-padding-inline-end);padding-inline-start:var(--tx-code-highlight-padding-inline-end)}:host([data-styled]).tx-code-highlight--wrap code{width:auto}:host([data-styled]).tx-code-highlight--wrap .tx-code-highlight__text{min-width:0;white-space:pre-wrap;overflow-wrap:anywhere}:host([data-styled]).tx-code-highlight--wrap .tx-code-highlight__text[style*=--tx-code-wrap-indent]{padding-inline-start:var(--tx-code-wrap-indent);text-indent:calc(-1 * var(--tx-code-wrap-indent))}:host([data-styled]).tx-code-highlight--wrap:not(.tx-code-highlight--numbers) .tx-code-highlight__text[style*=--tx-code-wrap-indent]{padding-inline-start:calc(var(--tx-code-highlight-padding-inline-end) + var(--tx-code-wrap-indent))}\n"]
|
|
1107
1127
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-code-editor-highlight.mjs","names":["NUMBER","quoted","NUMBER"],"sources":["../../../../packages/code-editor/highlight/src/stream.ts","../../../../packages/code-editor/highlight/src/languages/css.ts","../../../../packages/code-editor/highlight/src/languages/javascript.ts","../../../../packages/code-editor/highlight/src/languages/json.ts","../../../../packages/code-editor/highlight/src/languages/html.ts","../../../../packages/code-editor/highlight/src/languages/markdown.ts","../../../../packages/code-editor/highlight/src/tokenize.ts","../../../../packages/code-editor/highlight/src/code-lines.ts","../../../../packages/code-editor/highlight/src/code-syntax-styles.component.ts","../../../../packages/code-editor/highlight/src/code-highlight.component.ts","../../../../packages/code-editor/highlight/src/code-highlight.component.html"],"sourcesContent":["import { TxCodeStreamLike } from './code-highlight.types';\n\nconst STICKY = new WeakMap<RegExp, RegExp>();\n\nfunction sticky(pattern: RegExp): RegExp {\n let compiled = STICKY.get(pattern);\n if (!compiled) {\n compiled = new RegExp(pattern.source, pattern.flags.replace(/[gy]/g, '') + 'y');\n STICKY.set(pattern, compiled);\n }\n return compiled;\n}\n\nexport class TxCodeStream implements TxCodeStreamLike {\n pos = 0;\n start = 0;\n\n constructor(readonly string: string) {}\n\n eol(): boolean {\n return this.pos >= this.string.length;\n }\n\n sol(): boolean {\n return this.pos === 0;\n }\n\n peek(offset = 0): string {\n return this.string.charAt(this.pos + offset);\n }\n\n next(): string {\n return this.pos < this.string.length ? this.string.charAt(this.pos++) : '';\n }\n\n eat(match: string | RegExp): string {\n const char = this.peek();\n if (char && (typeof match === 'string' ? char === match : match.test(char))) {\n this.pos++;\n return char;\n }\n return '';\n }\n\n eatWhile(match: RegExp): boolean {\n const start = this.pos;\n while (this.eat(match));\n return this.pos > start;\n }\n\n eatSpace(): boolean {\n return this.eatWhile(/\\s/);\n }\n\n skipToEnd(): void {\n this.pos = this.string.length;\n }\n\n skipTo(text: string): boolean {\n const index = this.string.indexOf(text, this.pos);\n if (index < 0) {\n return false;\n }\n this.pos = index;\n return true;\n }\n\n match(pattern: RegExp, consume = true): RegExpExecArray | null {\n const compiled = sticky(pattern);\n compiled.lastIndex = this.pos;\n const found = compiled.exec(this.string);\n if (found && consume) {\n this.pos += found[0].length;\n }\n return found;\n }\n\n matchText(text: string, consume = true, ignoreCase = false): boolean {\n const slice = this.string.substr(this.pos, text.length);\n const same = ignoreCase ? slice.toLowerCase() === text.toLowerCase() : slice === text;\n if (same && consume) {\n this.pos += text.length;\n }\n return same;\n }\n\n current(): string {\n return this.string.slice(this.start, this.pos);\n }\n\n rest(): string {\n return this.string.slice(this.pos);\n }\n\n before(): string {\n return this.string.slice(0, this.start);\n }\n}\n\nexport function tokenInside<S>(\n stream: TxCodeStreamLike,\n end: number,\n run: (inner: TxCodeStreamLike) => S,\n): S {\n const inner = new TxCodeStream(stream.string.slice(0, end));\n inner.pos = stream.pos;\n inner.start = stream.pos;\n const result = run(inner);\n stream.pos = inner.pos;\n return result;\n}\n","import { TxCodeMode, TxCodeStreamLike, TxCodeTokenType } from '../code-highlight.types';\n\nexport interface TxCssState {\n comment: boolean;\n depth: number;\n value: boolean;\n prelude: boolean;\n quote: string;\n}\n\nconst NUMBER = /[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?(?:%|[a-zA-Z]+)?/;\nconst WORD = /-?[A-Za-z_\\u00a0-\\uffff][\\w\\u00a0-\\uffff-]*/;\nconst PROPERTY = /--?[A-Za-z_][\\w-]*(?=\\s*:(?![^;{}]*\\{))|[A-Za-z][\\w-]*(?=\\s*:(?![^;{}]*\\{))/;\n\nfunction quoted(stream: TxCodeStreamLike, state: TxCssState): TxCodeTokenType {\n let escaped = false;\n while (!stream.eol()) {\n const char = stream.next();\n if (char === state.quote && !escaped) {\n state.quote = '';\n return 'string';\n }\n escaped = !escaped && char === '\\\\';\n }\n if (!escaped) {\n state.quote = '';\n }\n return 'string';\n}\n\nfunction cssToken(stream: TxCodeStreamLike, state: TxCssState): TxCodeTokenType | null {\n if (state.comment) {\n if (stream.skipTo('*/')) {\n stream.pos += 2;\n state.comment = false;\n } else {\n stream.skipToEnd();\n }\n return 'comment';\n }\n if (state.quote) {\n return quoted(stream, state);\n }\n if (stream.eatSpace()) {\n return null;\n }\n if (stream.matchText('/*')) {\n state.comment = true;\n return cssToken(stream, state) ?? 'comment';\n }\n const char = stream.peek();\n if (char === '\"' || char === \"'\") {\n stream.next();\n state.quote = char;\n return quoted(stream, state);\n }\n if (char === '{') {\n stream.next();\n state.depth++;\n state.value = false;\n state.prelude = false;\n return 'delimiter';\n }\n if (char === '}') {\n stream.next();\n state.depth = Math.max(0, state.depth - 1);\n state.value = false;\n return 'delimiter';\n }\n if (char === ';') {\n stream.next();\n state.value = false;\n state.prelude = false;\n return 'delimiter';\n }\n if (char === '@' && stream.match(/@[\\w-]+/)) {\n state.prelude = true;\n return 'keyword';\n }\n if (state.value || state.prelude) {\n if (stream.match(/!\\s*important/i)) {\n return 'keyword';\n }\n if (char === '#' && stream.match(/#[\\da-fA-F]{3,8}\\b/)) {\n return 'value';\n }\n if (/[\\d.+-]/.test(char) && stream.match(NUMBER)) {\n return 'number';\n }\n if (state.prelude && stream.match(PROPERTY)) {\n return 'attribute';\n }\n if (stream.match(WORD)) {\n return 'value';\n }\n stream.next();\n return 'delimiter';\n }\n if (state.depth > 0 && stream.match(PROPERTY)) {\n return 'attribute';\n }\n if (char === ':' && state.depth > 0 && stream.match(/:(?![^;{}]*\\{)/)) {\n state.value = true;\n return 'delimiter';\n }\n if (char === ',' || char === '>' || char === '+' || char === '~' || char === '(' || char === ')') {\n stream.next();\n return 'delimiter';\n }\n if (stream.match(/[^\\s{},;/\"'>+~()]+/)) {\n return 'tag';\n }\n stream.next();\n return 'delimiter';\n}\n\nexport const TX_CSS_MODE: TxCodeMode<TxCssState> = {\n language: 'css',\n comments: { block: ['/*', '*/'] },\n start: () => ({ comment: false, depth: 0, value: false, prelude: false, quote: '' }),\n copy: (state) => ({ ...state }),\n token: cssToken,\n};\n","import { TxCodeMode, TxCodeStreamLike, TxCodeTokenType } from '../code-highlight.types';\n\ntype ScriptFrame = 'template' | 'expression' | 'brace';\n\nexport interface TxScriptState {\n comment: boolean;\n stack: ScriptFrame[];\n regexAllowed: boolean;\n afterDot: boolean;\n}\n\nconst SHARED_KEYWORDS = [\n 'async', 'await', 'break', 'case', 'catch', 'class', 'const', 'constructor', 'continue', 'debugger', 'default', 'delete', 'do',\n 'else', 'export', 'extends', 'false', 'finally', 'for', 'from', 'function', 'get', 'if', 'import', 'in', 'instanceof', 'let', 'new',\n 'null', 'of', 'return', 'set', 'static', 'super', 'switch', 'symbol', 'this', 'throw', 'true', 'try', 'typeof', 'undefined', 'var',\n 'void', 'while', 'with', 'yield',\n];\n\nconst TYPESCRIPT_KEYWORDS = [\n 'abstract', 'any', 'as', 'asserts', 'bigint', 'boolean', 'declare', 'enum', 'global', 'implements', 'infer', 'interface', 'is',\n 'keyof', 'module', 'namespace', 'never', 'number', 'object', 'out', 'override', 'package', 'private', 'protected', 'public',\n 'readonly', 'require', 'satisfies', 'string', 'type', 'unique', 'unknown',\n];\n\nconst JAVASCRIPT = new Set(SHARED_KEYWORDS);\nconst TYPESCRIPT = new Set([...SHARED_KEYWORDS, ...TYPESCRIPT_KEYWORDS]);\nconst VALUE_KEYWORDS = new Set(['this', 'super', 'null', 'true', 'false', 'undefined']);\n\nconst NUMBER = /0[xX][\\da-fA-F_]+n?|0[bB][01_]+n?|0[oO][0-7_]+n?|(?:\\d[\\d_]*(?:\\.[\\d_]*)?|\\.\\d[\\d_]*)(?:[eE][+-]?\\d+)?n?/;\nconst IDENTIFIER = /[A-Za-z_$\\u00a0-\\uffff][\\w$\\u00a0-\\uffff]*/;\nconst REGEXP = /\\/(?![*/])(?:\\\\.|\\[(?:\\\\.|[^\\]\\\\])*\\]|[^/\\\\\\n[])+\\/[dgimsuvy]*/;\nconst OPERATOR = /[=><!~?:&|+\\-*/^%]+/;\n\nfunction quoted(stream: TxCodeStreamLike, quote: string): void {\n let escaped = false;\n while (!stream.eol()) {\n const char = stream.next();\n if (char === quote && !escaped) {\n return;\n }\n escaped = !escaped && char === '\\\\';\n }\n}\n\nfunction templateText(stream: TxCodeStreamLike, state: TxScriptState): TxCodeTokenType {\n while (!stream.eol()) {\n if (stream.matchText('`')) {\n state.stack.pop();\n state.regexAllowed = false;\n return 'string';\n }\n if (stream.matchText('${', false)) {\n if (stream.pos === stream.start) {\n stream.pos += 2;\n state.stack.push('expression');\n state.regexAllowed = true;\n return 'delimiter';\n }\n return 'string';\n }\n if (stream.next() === '\\\\') {\n stream.next();\n }\n }\n return 'string';\n}\n\nfunction scriptToken(stream: TxCodeStreamLike, state: TxScriptState, keywords: Set<string>): TxCodeTokenType | null {\n if (state.comment) {\n if (stream.skipTo('*/')) {\n stream.pos += 2;\n state.comment = false;\n } else {\n stream.skipToEnd();\n }\n return 'comment';\n }\n if (state.stack[state.stack.length - 1] === 'template') {\n return templateText(stream, state);\n }\n if (stream.eatSpace()) {\n return null;\n }\n if (stream.matchText('//')) {\n stream.skipToEnd();\n return 'comment';\n }\n if (stream.matchText('/*')) {\n state.comment = true;\n return scriptToken(stream, state, keywords) ?? 'comment';\n }\n const char = stream.peek();\n const afterDot = state.afterDot;\n state.afterDot = false;\n if (char === '\"' || char === \"'\") {\n stream.next();\n quoted(stream, char);\n state.regexAllowed = false;\n return 'string';\n }\n if (char === '`') {\n stream.next();\n state.stack.push('template');\n return templateText(stream, state);\n }\n if (/[\\d.]/.test(char) && stream.match(NUMBER)) {\n state.regexAllowed = false;\n return 'number';\n }\n if (char === '/' && state.regexAllowed && stream.match(REGEXP)) {\n state.regexAllowed = false;\n return 'regexp';\n }\n const word = stream.match(IDENTIFIER);\n if (word) {\n const name = word[0];\n if (!afterDot && keywords.has(name)) {\n state.regexAllowed = !VALUE_KEYWORDS.has(name);\n return 'keyword';\n }\n state.regexAllowed = false;\n return /^[A-Z]/.test(name) ? 'type' : null;\n }\n stream.next();\n if (char === '.') {\n state.afterDot = true;\n state.regexAllowed = false;\n return 'delimiter';\n }\n if (char === '{') {\n state.stack.push('brace');\n state.regexAllowed = true;\n return 'delimiter';\n }\n if (char === '}') {\n const frame = state.stack.pop();\n if (frame === 'expression') {\n state.regexAllowed = false;\n return 'delimiter';\n }\n state.regexAllowed = true;\n return 'delimiter';\n }\n if (char === ')' || char === ']') {\n state.regexAllowed = false;\n return 'delimiter';\n }\n if (char === '@') {\n stream.match(IDENTIFIER);\n return 'type';\n }\n if (OPERATOR.test(char)) {\n stream.match(OPERATOR);\n }\n state.regexAllowed = true;\n return 'delimiter';\n}\n\nfunction scriptMode(language: 'javascript' | 'typescript', keywords: Set<string>): TxCodeMode<TxScriptState> {\n return {\n language,\n comments: { line: '//', block: ['/*', '*/'] },\n start: () => ({ comment: false, stack: [], regexAllowed: true, afterDot: false }),\n copy: (state) => ({ ...state, stack: [...state.stack] }),\n token: (stream, state) => scriptToken(stream, state, keywords),\n };\n}\n\nexport const TX_JAVASCRIPT_MODE = scriptMode('javascript', JAVASCRIPT);\nexport const TX_TYPESCRIPT_MODE = scriptMode('typescript', TYPESCRIPT);\n","import { TxCodeMode, TxCodeStreamLike, TxCodeTokenType } from '../code-highlight.types';\n\nexport interface TxJsonState {\n comment: boolean;\n}\n\nconst NUMBER = /-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?/;\n\nfunction jsonToken(stream: TxCodeStreamLike, state: TxJsonState): TxCodeTokenType | null {\n if (state.comment) {\n if (stream.skipTo('*/')) {\n stream.pos += 2;\n state.comment = false;\n } else {\n stream.skipToEnd();\n }\n return 'comment';\n }\n if (stream.eatSpace()) {\n return null;\n }\n if (stream.matchText('//')) {\n stream.skipToEnd();\n return 'comment';\n }\n if (stream.matchText('/*')) {\n state.comment = true;\n return jsonToken(stream, state) ?? 'comment';\n }\n const char = stream.peek();\n if (char === '\"') {\n stream.next();\n let escaped = false;\n while (!stream.eol()) {\n const next = stream.next();\n if (next === '\"' && !escaped) {\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n return stream.match(/\\s*:/, false) ? 'key' : 'value';\n }\n if (stream.match(NUMBER)) {\n return 'number';\n }\n if (stream.match(/true|false|null/)) {\n return 'literal';\n }\n stream.next();\n return 'delimiter';\n}\n\nexport const TX_JSON_MODE: TxCodeMode<TxJsonState> = {\n language: 'json',\n comments: { line: '//', block: ['/*', '*/'] },\n start: () => ({ comment: false }),\n copy: (state) => ({ ...state }),\n token: jsonToken,\n};\n","import { TxCodeMode, TxCodeStreamLike, TxCodeTokenType } from '../code-highlight.types';\nimport { tokenInside } from '../stream';\nimport { TX_CSS_MODE } from './css';\nimport { TX_JAVASCRIPT_MODE } from './javascript';\nimport { TX_JSON_MODE } from './json';\n\ntype HtmlContext = 'text' | 'tag' | 'comment' | 'doctype' | 'embedded';\n\ninterface HtmlEmbed {\n readonly mode: TxCodeMode | null;\n state: unknown;\n}\n\nexport interface TxHtmlState {\n context: HtmlContext;\n tagName: string;\n closing: boolean;\n expectName: boolean;\n afterEquals: boolean;\n quote: string;\n attribute: string;\n scriptType: string;\n embed: HtmlEmbed | null;\n}\n\nconst RAW_TAGS = new Set(['script', 'style', 'textarea', 'title']);\n\nfunction embedFor(tag: string, scriptType: string): HtmlEmbed {\n let mode: TxCodeMode | null = null;\n if (tag === 'style') {\n mode = TX_CSS_MODE as TxCodeMode;\n } else if (tag === 'script') {\n const type = scriptType.toLowerCase();\n if (type.includes('json')) {\n mode = TX_JSON_MODE as TxCodeMode;\n } else if (!type || type === 'module' || type.includes('javascript') || type.includes('ecmascript')) {\n mode = TX_JAVASCRIPT_MODE as TxCodeMode;\n }\n }\n return { mode, state: mode?.start() ?? null };\n}\n\nfunction embeddedToken(stream: TxCodeStreamLike, state: TxHtmlState): TxCodeTokenType | null {\n const embed = state.embed;\n const close = stream.string.toLowerCase().indexOf(`</${state.tagName}`, stream.pos);\n const end = close < 0 ? stream.string.length : close;\n if (stream.pos >= end) {\n state.context = 'text';\n state.embed = null;\n return htmlToken(stream, state);\n }\n if (!embed?.mode) {\n stream.pos = end;\n return null;\n }\n const mode = embed.mode;\n return tokenInside(stream, end, (inner) => {\n const type = mode.token(inner, embed.state);\n if (inner.pos === inner.start) {\n inner.next();\n }\n return type;\n });\n}\n\nfunction attributeValue(stream: TxCodeStreamLike, state: TxHtmlState): TxCodeTokenType {\n const start = stream.pos;\n if (stream.skipTo(state.quote)) {\n stream.pos++;\n if (state.attribute === 'type') {\n state.scriptType += stream.string.slice(start, stream.pos - 1);\n }\n state.quote = '';\n } else {\n if (state.attribute === 'type') {\n state.scriptType += stream.string.slice(start);\n }\n stream.skipToEnd();\n }\n return 'attribute-value';\n}\n\nfunction tagToken(stream: TxCodeStreamLike, state: TxHtmlState): TxCodeTokenType | null {\n if (state.quote) {\n return attributeValue(stream, state);\n }\n if (stream.eatSpace()) {\n return null;\n }\n if (state.expectName) {\n state.expectName = false;\n const name = stream.match(/[A-Za-z][\\w:.-]*/);\n if (name) {\n state.tagName = name[0].toLowerCase();\n return 'tag';\n }\n }\n if (stream.matchText('/>')) {\n state.context = 'text';\n return 'tag-delimiter';\n }\n if (stream.matchText('>')) {\n const raw = !state.closing && RAW_TAGS.has(state.tagName);\n state.context = raw ? 'embedded' : 'text';\n state.embed = raw ? embedFor(state.tagName, state.scriptType) : null;\n return 'tag-delimiter';\n }\n if (state.afterEquals) {\n state.afterEquals = false;\n const char = stream.peek();\n if (char === '\"' || char === \"'\") {\n stream.next();\n state.quote = char;\n return attributeValue(stream, state);\n }\n const value = stream.match(/[^\\s\"'`=<>]+/);\n if (value) {\n if (state.attribute === 'type') {\n state.scriptType = value[0];\n }\n return 'attribute-value';\n }\n }\n if (stream.eat('=')) {\n state.afterEquals = true;\n return 'delimiter';\n }\n const attribute = stream.match(/[^\\s\"'>/=]+/);\n if (attribute) {\n state.attribute = attribute[0].toLowerCase();\n return 'attribute';\n }\n stream.next();\n return 'tag-delimiter';\n}\n\nfunction htmlToken(stream: TxCodeStreamLike, state: TxHtmlState): TxCodeTokenType | null {\n switch (state.context) {\n case 'comment':\n if (stream.skipTo('-->')) {\n stream.pos += 3;\n state.context = 'text';\n } else {\n stream.skipToEnd();\n }\n return 'comment';\n case 'doctype':\n if (stream.eat('>')) {\n state.context = 'text';\n return 'meta';\n }\n if (stream.eatSpace()) {\n return null;\n }\n stream.match(/[^>\\s]+/);\n return 'attribute';\n case 'embedded':\n return embeddedToken(stream, state);\n case 'tag':\n return tagToken(stream, state);\n }\n if (stream.matchText('<!--')) {\n state.context = 'comment';\n return htmlToken(stream, state);\n }\n if (stream.match(/<!doctype/i)) {\n state.context = 'doctype';\n return 'meta';\n }\n const open = stream.match(/<\\/?(?=[A-Za-z])/);\n if (open) {\n state.context = 'tag';\n state.closing = open[0] === '</';\n state.expectName = true;\n state.afterEquals = false;\n state.attribute = '';\n state.scriptType = state.closing ? state.scriptType : '';\n return 'tag-delimiter';\n }\n if (!stream.match(/[^<]+/)) {\n stream.next();\n }\n return null;\n}\n\nexport const TX_HTML_MODE: TxCodeMode<TxHtmlState> = {\n language: 'html',\n comments: { block: ['<!--', '-->'] },\n start: () => ({\n context: 'text',\n tagName: '',\n closing: false,\n expectName: false,\n afterEquals: false,\n quote: '',\n attribute: '',\n scriptType: '',\n embed: null,\n }),\n copy: (state) => ({\n ...state,\n embed: state.embed ? { mode: state.embed.mode, state: state.embed.mode ? state.embed.mode.copy(state.embed.state) : null } : null,\n }),\n token: htmlToken,\n};\n","import { TxCodeLanguage, TxCodeMode, TxCodeStreamLike, TxCodeTokenType } from '../code-highlight.types';\n\nexport interface TxMarkdownState {\n fence: string;\n inner: TxCodeMode | null;\n innerState: unknown;\n}\n\nexport interface TxMarkdownModes {\n resolve(name: string): TxCodeLanguage | null;\n mode(language: TxCodeLanguage): TxCodeMode;\n}\n\nconst FENCE = /^\\s*(`{3,}|~{3,})\\s*([\\w+#.-]*).*$/;\n\nfunction inline(stream: TxCodeStreamLike): TxCodeTokenType | null {\n const char = stream.peek();\n if (char === '\\\\') {\n stream.next();\n stream.next();\n return null;\n }\n if (char === '`' && stream.match(/(`+)(?:(?!\\1).)+?\\1|`+.*$/)) {\n return 'code';\n }\n if ((char === '*' || char === '_') && (char === '*' || !/\\w/.test(stream.string.charAt(stream.pos - 1)))) {\n if (stream.match(/(\\*\\*|__)(?=\\S)(?:(?!\\1).)+?\\1/)) {\n return 'strong';\n }\n if (stream.match(/(\\*|_)(?=[^\\s*_])(?:(?!\\1).)+?\\1/)) {\n return 'emphasis';\n }\n }\n if ((char === '[' || char === '!') && stream.match(/!?\\[[^\\]]*\\]\\([^)]*\\)/)) {\n return 'link';\n }\n if (char === '<') {\n if (stream.match(/<!--[\\s\\S]*?-->/)) {\n return 'comment';\n }\n if (stream.match(/<https?:[^>\\s]+>/) ) {\n return 'link';\n }\n if (stream.match(/<\\/?[A-Za-z][^>]*>/)) {\n return 'tag';\n }\n }\n if (char === 'h' && stream.match(/https?:\\/\\/[^\\s<>()]+/)) {\n return 'link';\n }\n if (!stream.match(/[^`*_[!<\\\\h]+/)) {\n stream.next();\n }\n return null;\n}\n\nexport function createMarkdownMode(modes: TxMarkdownModes): TxCodeMode<TxMarkdownState> {\n function token(stream: TxCodeStreamLike, state: TxMarkdownState): TxCodeTokenType | null {\n if (stream.sol()) {\n const fence = stream.match(FENCE, false);\n if (state.fence) {\n if (fence && fence[1][0] === state.fence[0] && fence[1].length >= state.fence.length && !fence[2]) {\n stream.skipToEnd();\n state.fence = '';\n state.inner = null;\n state.innerState = null;\n return 'string';\n }\n } else if (fence) {\n stream.skipToEnd();\n state.fence = fence[1];\n const language = modes.resolve(fence[2]);\n state.inner = language && language !== 'plain' ? modes.mode(language) : null;\n state.innerState = state.inner?.start() ?? null;\n return 'string';\n } else {\n if (stream.match(/#{1,6}(?=\\s|$)/, false)) {\n stream.skipToEnd();\n return 'heading';\n }\n if (stream.match(/\\s{0,3}>/, false)) {\n stream.skipToEnd();\n return 'quote';\n }\n if (stream.match(/\\s{0,3}([-*_])(?:\\s*\\1){2,}\\s*$/)) {\n return 'keyword';\n }\n if (stream.match(/\\s*(?:[*+-]|\\d+[.)])(?=\\s)/)) {\n return 'keyword';\n }\n }\n }\n if (state.fence) {\n if (!state.inner) {\n stream.skipToEnd();\n return 'code';\n }\n const type = state.inner.token(stream, state.innerState);\n if (stream.pos === stream.start) {\n stream.next();\n }\n return type;\n }\n return inline(stream);\n }\n\n return {\n language: 'markdown',\n comments: { block: ['<!--', '-->'] },\n start: () => ({ fence: '', inner: null, innerState: null }),\n copy: (state) => ({ ...state, innerState: state.inner ? state.inner.copy(state.innerState) : null }),\n token,\n };\n}\n","import { TxCodeLanguage, TxCodeMode, TxCodeToken, TxCodeTokenType } from './code-highlight.types';\nimport { TX_CSS_MODE } from './languages/css';\nimport { TX_HTML_MODE } from './languages/html';\nimport { TX_JAVASCRIPT_MODE, TX_TYPESCRIPT_MODE } from './languages/javascript';\nimport { TX_JSON_MODE } from './languages/json';\nimport { createMarkdownMode } from './languages/markdown';\nimport { TxCodeStream } from './stream';\n\nconst ALIASES: Record<string, TxCodeLanguage> = {\n html: 'html',\n htm: 'html',\n xhtml: 'html',\n xml: 'html',\n svg: 'html',\n vue: 'html',\n css: 'css',\n javascript: 'javascript',\n js: 'javascript',\n jsx: 'javascript',\n mjs: 'javascript',\n cjs: 'javascript',\n typescript: 'typescript',\n ts: 'typescript',\n tsx: 'typescript',\n json: 'json',\n jsonc: 'json',\n json5: 'json',\n markdown: 'markdown',\n md: 'markdown',\n plain: 'plain',\n plaintext: 'plain',\n text: 'plain',\n txt: 'plain',\n};\n\nexport function resolveCodeLanguage(name: string | null | undefined): TxCodeLanguage | null {\n return name ? (ALIASES[name.trim().toLowerCase()] ?? null) : null;\n}\n\nconst PLAIN_MODE: TxCodeMode<null> = {\n language: 'plain',\n comments: {},\n start: () => null,\n copy: () => null,\n token: (stream) => {\n stream.skipToEnd();\n return null;\n },\n};\n\nconst MARKDOWN_MODE = createMarkdownMode({ resolve: resolveCodeLanguage, mode: getCodeMode });\n\nconst MODES: Record<TxCodeLanguage, TxCodeMode> = {\n html: TX_HTML_MODE as TxCodeMode,\n css: TX_CSS_MODE as TxCodeMode,\n javascript: TX_JAVASCRIPT_MODE as TxCodeMode,\n typescript: TX_TYPESCRIPT_MODE as TxCodeMode,\n json: TX_JSON_MODE as TxCodeMode,\n markdown: MARKDOWN_MODE as TxCodeMode,\n plain: PLAIN_MODE as TxCodeMode,\n};\n\nexport function getCodeMode(language: TxCodeLanguage | string | null | undefined): TxCodeMode {\n return MODES[resolveCodeLanguage(language) ?? 'plain'];\n}\n\nexport function tokenizeLine(mode: TxCodeMode, text: string, state: unknown): TxCodeToken[] {\n const stream = new TxCodeStream(text);\n const tokens: TxCodeToken[] = [];\n while (!stream.eol()) {\n stream.start = stream.pos;\n const type = mode.token(stream, state);\n if (stream.pos <= stream.start) {\n stream.pos = stream.start + 1;\n }\n if (type) {\n pushToken(tokens, stream.start, stream.pos, type);\n }\n }\n return tokens;\n}\n\nfunction pushToken(tokens: TxCodeToken[], from: number, to: number, type: TxCodeTokenType): void {\n const last = tokens[tokens.length - 1];\n if (last && last.type === type && last.to === from) {\n tokens[tokens.length - 1] = { from: last.from, to, type };\n } else {\n tokens.push({ from, to, type });\n }\n}\n\nexport function splitCodeLines(code: string): string[] {\n return code.split(/\\r\\n?|\\n/);\n}\n\nexport function highlightCode(code: string, language: TxCodeLanguage | string = 'plain'): TxCodeToken[][] {\n const mode = getCodeMode(language);\n const state = mode.start();\n return splitCodeLines(code).map((line) => tokenizeLine(mode, line, state));\n}\n\nexport class TxCodeLineStates {\n private readonly states: unknown[];\n\n constructor(private readonly mode: TxCodeMode) {\n this.states = [mode.start()];\n }\n\n get language(): TxCodeLanguage {\n return this.mode.language;\n }\n\n invalidateFrom(line: number): void {\n if (this.states.length > line + 1) {\n this.states.length = Math.max(1, line + 1);\n }\n }\n\n tokens(line: number, lineText: (line: number) => string): TxCodeToken[] {\n while (this.states.length <= line) {\n const index = this.states.length - 1;\n const state = this.mode.copy(this.states[index]);\n tokenizeLine(this.mode, lineText(index), state);\n this.states.push(state);\n }\n return tokenizeLine(this.mode, lineText(line), this.mode.copy(this.states[line]));\n }\n}\n","import { TxCodeLanguage, TxCodeToken } from './code-highlight.types';\nimport { highlightCode, splitCodeLines } from './tokenize';\n\nexport interface TxCodeSegment {\n readonly text: string;\n readonly className: string | null;\n}\n\nexport interface TxCodeLine {\n readonly number: number;\n readonly segments: readonly TxCodeSegment[];\n readonly indent: string | null;\n readonly guides: number;\n}\n\nfunction indentWidth(text: string, tabSize: number): number | null {\n let columns = 0;\n for (const char of text) {\n if (char === ' ') {\n columns++;\n } else if (char === '\\t') {\n columns += tabSize - (columns % tabSize);\n } else {\n return columns;\n }\n }\n return null;\n}\n\nexport function guideLevels(count: number, lineText: (index: number) => string, tabSize = 4, from = 0, to = count, reach = 200): number[] {\n const width = (index: number) => indentWidth(lineText(index), tabSize);\n const nearest = (index: number, step: 1 | -1): number => {\n for (let other = index + step, seen = 0; other >= 0 && other < count && seen < reach; other += step, seen++) {\n const value = width(other);\n if (value !== null) {\n return value;\n }\n }\n return 0;\n };\n const levels: number[] = [];\n for (let index = from; index < to; index++) {\n const own = width(index);\n const columns = own ?? Math.min(nearest(index, -1), nearest(index, 1));\n levels.push(Math.ceil(columns / tabSize));\n }\n return levels;\n}\n\nexport function lineIndent(text: string, tabSize = 4): string | null {\n let columns = 0;\n let index = 0;\n for (; index < text.length; index++) {\n const char = text[index];\n if (char === ' ') {\n columns++;\n } else if (char === '\\t') {\n columns += tabSize - (columns % tabSize);\n } else {\n break;\n }\n }\n return columns > 0 && index < text.length ? `${columns}ch` : null;\n}\n\nexport function tokenClass(type: string): string {\n return `tx-code-tok-${type}`;\n}\n\nexport function lineSegments(text: string, tokens: readonly TxCodeToken[]): TxCodeSegment[] {\n const segments: TxCodeSegment[] = [];\n let position = 0;\n for (const token of tokens) {\n if (token.from > position) {\n segments.push({ text: text.slice(position, token.from), className: null });\n }\n segments.push({ text: text.slice(token.from, token.to), className: tokenClass(token.type) });\n position = token.to;\n }\n if (position < text.length) {\n segments.push({ text: text.slice(position), className: null });\n }\n return segments;\n}\n\nexport function codeLines(code: string, language: TxCodeLanguage | string, firstLine = 1, tabSize = 4): TxCodeLine[] {\n const texts = splitCodeLines(code);\n const guides = guideLevels(texts.length, (index) => texts[index], tabSize);\n return highlightCode(code, language).map((tokens, index) => ({\n number: firstLine + index,\n segments: lineSegments(texts[index], tokens),\n indent: lineIndent(texts[index], tabSize),\n guides: guides[index],\n }));\n}\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'tx-code-syntax-styles',\n template: '',\n styleUrl: './code-syntax.styles.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TxCodeSyntaxStyles {}\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, inject, input, numberAttribute } from '@angular/core';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { TxStyleLoader } from '@tectra-ng/core/styles';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraCodeHighlightTokens, TectraCodeSyntaxTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxCodeHighlightPart, TxCodeLanguage } from './code-highlight.types';\nimport { codeLines } from './code-lines';\nimport { TxCodeSyntaxStyles } from './code-syntax-styles.component';\n\nexport type TxCodeHighlightTokens = TectraCodeHighlightTokens & { syntax: TectraCodeSyntaxTokens };\n\n@Component({\n selector: 'tx-code-highlight',\n templateUrl: './code-highlight.component.html',\n styleUrl: './code-highlight.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-code-highlight',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-language]': 'language()',\n '[class.tx-code-highlight--wrap]': 'wordWrap()',\n '[class.tx-code-highlight--numbers]': 'lineNumbers()',\n },\n})\nexport class TxCodeHighlight {\n readonly code = input<string | null | undefined>('');\n readonly language = input<TxCodeLanguage | string>('html');\n readonly lineNumbers = input(true, { transform: booleanAttribute });\n readonly wordWrap = input(false, { transform: booleanAttribute });\n readonly indentGuides = input(true, { transform: booleanAttribute });\n readonly tabSize = input(4, { transform: numberAttribute });\n readonly firstLine = input(1, { transform: numberAttribute });\n readonly height = input<string | undefined>(undefined);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TxCodeHighlightTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxCodeHighlightPart, TxCodeHighlight> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('codeHighlight', this, this.pt, this.ptOptions);\n protected readonly t = injectTranslations();\n\n protected readonly lines = computed(() => codeLines(this.code() ?? '', this.language(), this.firstLine(), this.tabSize()));\n protected readonly label = computed(() => this.ariaLabel() ?? this.t().codeHighlightLabel);\n\n readonly hostStyle = computed(() => {\n const { syntax, ...own } = this.dt() ?? {};\n return {\n ...toStyleObject(own, '--tx-code-highlight'),\n ...toStyleObject(syntax, '--tx-code-syntax'),\n ...(this.height() ? { height: this.height() } : {}),\n ...this.passThrough().root?.style,\n };\n });\n\n constructor() {\n inject(TxStyleLoader).load(TxCodeSyntaxStyles);\n }\n}\n","<pre\n class=\"tx-code-highlight__code\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"label()\"\n [class]=\"passThrough().content?.class\"\n [style]=\"passThrough().content?.style\"\n><code>@for (line of lines(); track $index) {<span class=\"tx-code-highlight__line\" [class]=\"passThrough().line?.class\" [style]=\"passThrough().line?.style\">@if (lineNumbers()) {<span class=\"tx-code-highlight__number\" aria-hidden=\"true\" [class]=\"passThrough().gutter?.class\" [style]=\"passThrough().gutter?.style\">{{ line.number }}</span>}<span class=\"tx-code-highlight__text\" [class.tx-code-guides]=\"indentGuides() && line.guides > 0\" [style.--tx-code-guides]=\"indentGuides() && line.guides > 0 ? line.guides : null\" [style.--tx-code-guide-step]=\"tabSize() + 'ch'\" [style.--tx-code-wrap-indent]=\"wordWrap() ? line.indent : null\">@for (segment of line.segments; track $index) {<span [class]=\"segment.className\">{{ segment.text }}</span>}{{ '\\n' }}</span></span>}</code></pre>\n"],"mappings":";;;;;;;AAEA,MAAM,yBAAS,IAAI,QAAO;AAE1B,SAAS,OAAO,SAAe;CAC7B,IAAI,WAAW,OAAO,IAAI,OAAO;CACjC,IAAI,CAAC,UAAU;EACb,WAAW,IAAI,OAAO,QAAQ,QAAQ,QAAQ,MAAM,QAAQ,SAAS,EAAE,IAAI,GAAG;EAC9E,OAAO,IAAI,SAAS,QAAQ;CAC9B;CACA,OAAO;AACT;AAEA,IAAa,eAAb,MAAyB;CAIF;CAHrB,MAAM;CACN,QAAQ;CAER,YAAqB,QAAc;EAAd,KAAA,SAAA;CAAiB;CAEtC,MAAG;EACD,OAAO,K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;GAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UC3B5B;EAQA,QAAA,CAAA,ynFAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;ADmBa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAf3B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAmB,iBAGZ,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;IACtB,wBAAwB;IACxB,mCAAmC;IACnC,sCAAsC;GACvC;GAAA,UAAA;GAAA,QAAA,CAAA,ynFAAA;EAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-code-editor-highlight.mjs","names":["NUMBER","quoted","NUMBER"],"sources":["../../../../packages/code-editor/highlight/src/stream.ts","../../../../packages/code-editor/highlight/src/languages/css.ts","../../../../packages/code-editor/highlight/src/languages/javascript.ts","../../../../packages/code-editor/highlight/src/languages/json.ts","../../../../packages/code-editor/highlight/src/languages/html.ts","../../../../packages/code-editor/highlight/src/languages/markdown.ts","../../../../packages/code-editor/highlight/src/tokenize.ts","../../../../packages/code-editor/highlight/src/code-lines.ts","../../../../packages/code-editor/highlight/src/highlight.icons.ts","../../../../packages/code-editor/highlight/src/highlight.theme.ts","../../../../packages/code-editor/highlight/src/code-syntax-styles.component.ts","../../../../packages/code-editor/highlight/src/code-highlight.component.ts","../../../../packages/code-editor/highlight/src/code-highlight.component.html"],"sourcesContent":["import { TxCodeStreamLike } from './code-highlight.types';\n\nconst STICKY = new WeakMap<RegExp, RegExp>();\n\nfunction sticky(pattern: RegExp): RegExp {\n let compiled = STICKY.get(pattern);\n if (!compiled) {\n compiled = new RegExp(pattern.source, pattern.flags.replace(/[gy]/g, '') + 'y');\n STICKY.set(pattern, compiled);\n }\n return compiled;\n}\n\nexport class TxCodeStream implements TxCodeStreamLike {\n pos = 0;\n start = 0;\n\n constructor(readonly string: string) {}\n\n eol(): boolean {\n return this.pos >= this.string.length;\n }\n\n sol(): boolean {\n return this.pos === 0;\n }\n\n peek(offset = 0): string {\n return this.string.charAt(this.pos + offset);\n }\n\n next(): string {\n return this.pos < this.string.length ? this.string.charAt(this.pos++) : '';\n }\n\n eat(match: string | RegExp): string {\n const char = this.peek();\n if (char && (typeof match === 'string' ? char === match : match.test(char))) {\n this.pos++;\n return char;\n }\n return '';\n }\n\n eatWhile(match: RegExp): boolean {\n const start = this.pos;\n while (this.eat(match));\n return this.pos > start;\n }\n\n eatSpace(): boolean {\n return this.eatWhile(/\\s/);\n }\n\n skipToEnd(): void {\n this.pos = this.string.length;\n }\n\n skipTo(text: string): boolean {\n const index = this.string.indexOf(text, this.pos);\n if (index < 0) {\n return false;\n }\n this.pos = index;\n return true;\n }\n\n match(pattern: RegExp, consume = true): RegExpExecArray | null {\n const compiled = sticky(pattern);\n compiled.lastIndex = this.pos;\n const found = compiled.exec(this.string);\n if (found && consume) {\n this.pos += found[0].length;\n }\n return found;\n }\n\n matchText(text: string, consume = true, ignoreCase = false): boolean {\n const slice = this.string.substr(this.pos, text.length);\n const same = ignoreCase ? slice.toLowerCase() === text.toLowerCase() : slice === text;\n if (same && consume) {\n this.pos += text.length;\n }\n return same;\n }\n\n current(): string {\n return this.string.slice(this.start, this.pos);\n }\n\n rest(): string {\n return this.string.slice(this.pos);\n }\n\n before(): string {\n return this.string.slice(0, this.start);\n }\n}\n\nexport function tokenInside<S>(\n stream: TxCodeStreamLike,\n end: number,\n run: (inner: TxCodeStreamLike) => S,\n): S {\n const inner = new TxCodeStream(stream.string.slice(0, end));\n inner.pos = stream.pos;\n inner.start = stream.pos;\n const result = run(inner);\n stream.pos = inner.pos;\n return result;\n}\n","import { TxCodeMode, TxCodeStreamLike, TxCodeTokenType } from '../code-highlight.types';\n\nexport interface TxCssState {\n comment: boolean;\n depth: number;\n value: boolean;\n prelude: boolean;\n quote: string;\n}\n\nconst NUMBER = /[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?(?:%|[a-zA-Z]+)?/;\nconst WORD = /-?[A-Za-z_\\u00a0-\\uffff][\\w\\u00a0-\\uffff-]*/;\nconst PROPERTY = /--?[A-Za-z_][\\w-]*(?=\\s*:(?![^;{}]*\\{))|[A-Za-z][\\w-]*(?=\\s*:(?![^;{}]*\\{))/;\n\nfunction quoted(stream: TxCodeStreamLike, state: TxCssState): TxCodeTokenType {\n let escaped = false;\n while (!stream.eol()) {\n const char = stream.next();\n if (char === state.quote && !escaped) {\n state.quote = '';\n return 'string';\n }\n escaped = !escaped && char === '\\\\';\n }\n if (!escaped) {\n state.quote = '';\n }\n return 'string';\n}\n\nfunction cssToken(stream: TxCodeStreamLike, state: TxCssState): TxCodeTokenType | null {\n if (state.comment) {\n if (stream.skipTo('*/')) {\n stream.pos += 2;\n state.comment = false;\n } else {\n stream.skipToEnd();\n }\n return 'comment';\n }\n if (state.quote) {\n return quoted(stream, state);\n }\n if (stream.eatSpace()) {\n return null;\n }\n if (stream.matchText('/*')) {\n state.comment = true;\n return cssToken(stream, state) ?? 'comment';\n }\n const char = stream.peek();\n if (char === '\"' || char === \"'\") {\n stream.next();\n state.quote = char;\n return quoted(stream, state);\n }\n if (char === '{') {\n stream.next();\n state.depth++;\n state.value = false;\n state.prelude = false;\n return 'delimiter';\n }\n if (char === '}') {\n stream.next();\n state.depth = Math.max(0, state.depth - 1);\n state.value = false;\n return 'delimiter';\n }\n if (char === ';') {\n stream.next();\n state.value = false;\n state.prelude = false;\n return 'delimiter';\n }\n if (char === '@' && stream.match(/@[\\w-]+/)) {\n state.prelude = true;\n return 'keyword';\n }\n if (state.value || state.prelude) {\n if (stream.match(/!\\s*important/i)) {\n return 'keyword';\n }\n if (char === '#' && stream.match(/#[\\da-fA-F]{3,8}\\b/)) {\n return 'value';\n }\n if (/[\\d.+-]/.test(char) && stream.match(NUMBER)) {\n return 'number';\n }\n if (state.prelude && stream.match(PROPERTY)) {\n return 'attribute';\n }\n if (stream.match(WORD)) {\n return 'value';\n }\n stream.next();\n return 'delimiter';\n }\n if (state.depth > 0 && stream.match(PROPERTY)) {\n return 'attribute';\n }\n if (char === ':' && state.depth > 0 && stream.match(/:(?![^;{}]*\\{)/)) {\n state.value = true;\n return 'delimiter';\n }\n if (char === ',' || char === '>' || char === '+' || char === '~' || char === '(' || char === ')') {\n stream.next();\n return 'delimiter';\n }\n if (stream.match(/[^\\s{},;/\"'>+~()]+/)) {\n return 'tag';\n }\n stream.next();\n return 'delimiter';\n}\n\nexport const TX_CSS_MODE: TxCodeMode<TxCssState> = {\n language: 'css',\n comments: { block: ['/*', '*/'] },\n start: () => ({ comment: false, depth: 0, value: false, prelude: false, quote: '' }),\n copy: (state) => ({ ...state }),\n token: cssToken,\n};\n","import { TxCodeMode, TxCodeStreamLike, TxCodeTokenType } from '../code-highlight.types';\n\ntype ScriptFrame = 'template' | 'expression' | 'brace';\n\nexport interface TxScriptState {\n comment: boolean;\n stack: ScriptFrame[];\n regexAllowed: boolean;\n afterDot: boolean;\n}\n\nconst SHARED_KEYWORDS = [\n 'async', 'await', 'break', 'case', 'catch', 'class', 'const', 'constructor', 'continue', 'debugger', 'default', 'delete', 'do',\n 'else', 'export', 'extends', 'false', 'finally', 'for', 'from', 'function', 'get', 'if', 'import', 'in', 'instanceof', 'let', 'new',\n 'null', 'of', 'return', 'set', 'static', 'super', 'switch', 'symbol', 'this', 'throw', 'true', 'try', 'typeof', 'undefined', 'var',\n 'void', 'while', 'with', 'yield',\n];\n\nconst TYPESCRIPT_KEYWORDS = [\n 'abstract', 'any', 'as', 'asserts', 'bigint', 'boolean', 'declare', 'enum', 'global', 'implements', 'infer', 'interface', 'is',\n 'keyof', 'module', 'namespace', 'never', 'number', 'object', 'out', 'override', 'package', 'private', 'protected', 'public',\n 'readonly', 'require', 'satisfies', 'string', 'type', 'unique', 'unknown',\n];\n\nconst JAVASCRIPT = new Set(SHARED_KEYWORDS);\nconst TYPESCRIPT = new Set([...SHARED_KEYWORDS, ...TYPESCRIPT_KEYWORDS]);\nconst VALUE_KEYWORDS = new Set(['this', 'super', 'null', 'true', 'false', 'undefined']);\n\nconst NUMBER = /0[xX][\\da-fA-F_]+n?|0[bB][01_]+n?|0[oO][0-7_]+n?|(?:\\d[\\d_]*(?:\\.[\\d_]*)?|\\.\\d[\\d_]*)(?:[eE][+-]?\\d+)?n?/;\nconst IDENTIFIER = /[A-Za-z_$\\u00a0-\\uffff][\\w$\\u00a0-\\uffff]*/;\nconst REGEXP = /\\/(?![*/])(?:\\\\.|\\[(?:\\\\.|[^\\]\\\\])*\\]|[^/\\\\\\n[])+\\/[dgimsuvy]*/;\nconst OPERATOR = /[=><!~?:&|+\\-*/^%]+/;\n\nfunction quoted(stream: TxCodeStreamLike, quote: string): void {\n let escaped = false;\n while (!stream.eol()) {\n const char = stream.next();\n if (char === quote && !escaped) {\n return;\n }\n escaped = !escaped && char === '\\\\';\n }\n}\n\nfunction templateText(stream: TxCodeStreamLike, state: TxScriptState): TxCodeTokenType {\n while (!stream.eol()) {\n if (stream.matchText('`')) {\n state.stack.pop();\n state.regexAllowed = false;\n return 'string';\n }\n if (stream.matchText('${', false)) {\n if (stream.pos === stream.start) {\n stream.pos += 2;\n state.stack.push('expression');\n state.regexAllowed = true;\n return 'delimiter';\n }\n return 'string';\n }\n if (stream.next() === '\\\\') {\n stream.next();\n }\n }\n return 'string';\n}\n\nfunction scriptToken(stream: TxCodeStreamLike, state: TxScriptState, keywords: Set<string>): TxCodeTokenType | null {\n if (state.comment) {\n if (stream.skipTo('*/')) {\n stream.pos += 2;\n state.comment = false;\n } else {\n stream.skipToEnd();\n }\n return 'comment';\n }\n if (state.stack[state.stack.length - 1] === 'template') {\n return templateText(stream, state);\n }\n if (stream.eatSpace()) {\n return null;\n }\n if (stream.matchText('//')) {\n stream.skipToEnd();\n return 'comment';\n }\n if (stream.matchText('/*')) {\n state.comment = true;\n return scriptToken(stream, state, keywords) ?? 'comment';\n }\n const char = stream.peek();\n const afterDot = state.afterDot;\n state.afterDot = false;\n if (char === '\"' || char === \"'\") {\n stream.next();\n quoted(stream, char);\n state.regexAllowed = false;\n return 'string';\n }\n if (char === '`') {\n stream.next();\n state.stack.push('template');\n return templateText(stream, state);\n }\n if (/[\\d.]/.test(char) && stream.match(NUMBER)) {\n state.regexAllowed = false;\n return 'number';\n }\n if (char === '/' && state.regexAllowed && stream.match(REGEXP)) {\n state.regexAllowed = false;\n return 'regexp';\n }\n const word = stream.match(IDENTIFIER);\n if (word) {\n const name = word[0];\n if (!afterDot && keywords.has(name)) {\n state.regexAllowed = !VALUE_KEYWORDS.has(name);\n return 'keyword';\n }\n state.regexAllowed = false;\n return /^[A-Z]/.test(name) ? 'type' : null;\n }\n stream.next();\n if (char === '.') {\n state.afterDot = true;\n state.regexAllowed = false;\n return 'delimiter';\n }\n if (char === '{') {\n state.stack.push('brace');\n state.regexAllowed = true;\n return 'delimiter';\n }\n if (char === '}') {\n const frame = state.stack.pop();\n if (frame === 'expression') {\n state.regexAllowed = false;\n return 'delimiter';\n }\n state.regexAllowed = true;\n return 'delimiter';\n }\n if (char === ')' || char === ']') {\n state.regexAllowed = false;\n return 'delimiter';\n }\n if (char === '@') {\n stream.match(IDENTIFIER);\n return 'type';\n }\n if (OPERATOR.test(char)) {\n stream.match(OPERATOR);\n }\n state.regexAllowed = true;\n return 'delimiter';\n}\n\nfunction scriptMode(language: 'javascript' | 'typescript', keywords: Set<string>): TxCodeMode<TxScriptState> {\n return {\n language,\n comments: { line: '//', block: ['/*', '*/'] },\n start: () => ({ comment: false, stack: [], regexAllowed: true, afterDot: false }),\n copy: (state) => ({ ...state, stack: [...state.stack] }),\n token: (stream, state) => scriptToken(stream, state, keywords),\n };\n}\n\nexport const TX_JAVASCRIPT_MODE = scriptMode('javascript', JAVASCRIPT);\nexport const TX_TYPESCRIPT_MODE = scriptMode('typescript', TYPESCRIPT);\n","import { TxCodeMode, TxCodeStreamLike, TxCodeTokenType } from '../code-highlight.types';\n\nexport interface TxJsonState {\n comment: boolean;\n}\n\nconst NUMBER = /-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?/;\n\nfunction jsonToken(stream: TxCodeStreamLike, state: TxJsonState): TxCodeTokenType | null {\n if (state.comment) {\n if (stream.skipTo('*/')) {\n stream.pos += 2;\n state.comment = false;\n } else {\n stream.skipToEnd();\n }\n return 'comment';\n }\n if (stream.eatSpace()) {\n return null;\n }\n if (stream.matchText('//')) {\n stream.skipToEnd();\n return 'comment';\n }\n if (stream.matchText('/*')) {\n state.comment = true;\n return jsonToken(stream, state) ?? 'comment';\n }\n const char = stream.peek();\n if (char === '\"') {\n stream.next();\n let escaped = false;\n while (!stream.eol()) {\n const next = stream.next();\n if (next === '\"' && !escaped) {\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n return stream.match(/\\s*:/, false) ? 'key' : 'value';\n }\n if (stream.match(NUMBER)) {\n return 'number';\n }\n if (stream.match(/true|false|null/)) {\n return 'literal';\n }\n stream.next();\n return 'delimiter';\n}\n\nexport const TX_JSON_MODE: TxCodeMode<TxJsonState> = {\n language: 'json',\n comments: { line: '//', block: ['/*', '*/'] },\n start: () => ({ comment: false }),\n copy: (state) => ({ ...state }),\n token: jsonToken,\n};\n","import { TxCodeMode, TxCodeStreamLike, TxCodeTokenType } from '../code-highlight.types';\nimport { tokenInside } from '../stream';\nimport { TX_CSS_MODE } from './css';\nimport { TX_JAVASCRIPT_MODE } from './javascript';\nimport { TX_JSON_MODE } from './json';\n\ntype HtmlContext = 'text' | 'tag' | 'comment' | 'doctype' | 'embedded';\n\ninterface HtmlEmbed {\n readonly mode: TxCodeMode | null;\n state: unknown;\n}\n\nexport interface TxHtmlState {\n context: HtmlContext;\n tagName: string;\n closing: boolean;\n expectName: boolean;\n afterEquals: boolean;\n quote: string;\n attribute: string;\n scriptType: string;\n embed: HtmlEmbed | null;\n}\n\nconst RAW_TAGS = new Set(['script', 'style', 'textarea', 'title']);\n\nfunction embedFor(tag: string, scriptType: string): HtmlEmbed {\n let mode: TxCodeMode | null = null;\n if (tag === 'style') {\n mode = TX_CSS_MODE as TxCodeMode;\n } else if (tag === 'script') {\n const type = scriptType.toLowerCase();\n if (type.includes('json')) {\n mode = TX_JSON_MODE as TxCodeMode;\n } else if (!type || type === 'module' || type.includes('javascript') || type.includes('ecmascript')) {\n mode = TX_JAVASCRIPT_MODE as TxCodeMode;\n }\n }\n return { mode, state: mode?.start() ?? null };\n}\n\nfunction embeddedToken(stream: TxCodeStreamLike, state: TxHtmlState): TxCodeTokenType | null {\n const embed = state.embed;\n const close = stream.string.toLowerCase().indexOf(`</${state.tagName}`, stream.pos);\n const end = close < 0 ? stream.string.length : close;\n if (stream.pos >= end) {\n state.context = 'text';\n state.embed = null;\n return htmlToken(stream, state);\n }\n if (!embed?.mode) {\n stream.pos = end;\n return null;\n }\n const mode = embed.mode;\n return tokenInside(stream, end, (inner) => {\n const type = mode.token(inner, embed.state);\n if (inner.pos === inner.start) {\n inner.next();\n }\n return type;\n });\n}\n\nfunction attributeValue(stream: TxCodeStreamLike, state: TxHtmlState): TxCodeTokenType {\n const start = stream.pos;\n if (stream.skipTo(state.quote)) {\n stream.pos++;\n if (state.attribute === 'type') {\n state.scriptType += stream.string.slice(start, stream.pos - 1);\n }\n state.quote = '';\n } else {\n if (state.attribute === 'type') {\n state.scriptType += stream.string.slice(start);\n }\n stream.skipToEnd();\n }\n return 'attribute-value';\n}\n\nfunction tagToken(stream: TxCodeStreamLike, state: TxHtmlState): TxCodeTokenType | null {\n if (state.quote) {\n return attributeValue(stream, state);\n }\n if (stream.eatSpace()) {\n return null;\n }\n if (state.expectName) {\n state.expectName = false;\n const name = stream.match(/[A-Za-z][\\w:.-]*/);\n if (name) {\n state.tagName = name[0].toLowerCase();\n return 'tag';\n }\n }\n if (stream.matchText('/>')) {\n state.context = 'text';\n return 'tag-delimiter';\n }\n if (stream.matchText('>')) {\n const raw = !state.closing && RAW_TAGS.has(state.tagName);\n state.context = raw ? 'embedded' : 'text';\n state.embed = raw ? embedFor(state.tagName, state.scriptType) : null;\n return 'tag-delimiter';\n }\n if (state.afterEquals) {\n state.afterEquals = false;\n const char = stream.peek();\n if (char === '\"' || char === \"'\") {\n stream.next();\n state.quote = char;\n return attributeValue(stream, state);\n }\n const value = stream.match(/[^\\s\"'`=<>]+/);\n if (value) {\n if (state.attribute === 'type') {\n state.scriptType = value[0];\n }\n return 'attribute-value';\n }\n }\n if (stream.eat('=')) {\n state.afterEquals = true;\n return 'delimiter';\n }\n const attribute = stream.match(/[^\\s\"'>/=]+/);\n if (attribute) {\n state.attribute = attribute[0].toLowerCase();\n return 'attribute';\n }\n stream.next();\n return 'tag-delimiter';\n}\n\nfunction htmlToken(stream: TxCodeStreamLike, state: TxHtmlState): TxCodeTokenType | null {\n switch (state.context) {\n case 'comment':\n if (stream.skipTo('-->')) {\n stream.pos += 3;\n state.context = 'text';\n } else {\n stream.skipToEnd();\n }\n return 'comment';\n case 'doctype':\n if (stream.eat('>')) {\n state.context = 'text';\n return 'meta';\n }\n if (stream.eatSpace()) {\n return null;\n }\n stream.match(/[^>\\s]+/);\n return 'attribute';\n case 'embedded':\n return embeddedToken(stream, state);\n case 'tag':\n return tagToken(stream, state);\n }\n if (stream.matchText('<!--')) {\n state.context = 'comment';\n return htmlToken(stream, state);\n }\n if (stream.match(/<!doctype/i)) {\n state.context = 'doctype';\n return 'meta';\n }\n const open = stream.match(/<\\/?(?=[A-Za-z])/);\n if (open) {\n state.context = 'tag';\n state.closing = open[0] === '</';\n state.expectName = true;\n state.afterEquals = false;\n state.attribute = '';\n state.scriptType = state.closing ? state.scriptType : '';\n return 'tag-delimiter';\n }\n if (!stream.match(/[^<]+/)) {\n stream.next();\n }\n return null;\n}\n\nexport const TX_HTML_MODE: TxCodeMode<TxHtmlState> = {\n language: 'html',\n comments: { block: ['<!--', '-->'] },\n start: () => ({\n context: 'text',\n tagName: '',\n closing: false,\n expectName: false,\n afterEquals: false,\n quote: '',\n attribute: '',\n scriptType: '',\n embed: null,\n }),\n copy: (state) => ({\n ...state,\n embed: state.embed ? { mode: state.embed.mode, state: state.embed.mode ? state.embed.mode.copy(state.embed.state) : null } : null,\n }),\n token: htmlToken,\n};\n","import { TxCodeLanguage, TxCodeMode, TxCodeStreamLike, TxCodeTokenType } from '../code-highlight.types';\n\nexport interface TxMarkdownState {\n fence: string;\n inner: TxCodeMode | null;\n innerState: unknown;\n}\n\nexport interface TxMarkdownModes {\n resolve(name: string): TxCodeLanguage | null;\n mode(language: TxCodeLanguage): TxCodeMode;\n}\n\nconst FENCE = /^\\s*(`{3,}|~{3,})\\s*([\\w+#.-]*).*$/;\n\nfunction inline(stream: TxCodeStreamLike): TxCodeTokenType | null {\n const char = stream.peek();\n if (char === '\\\\') {\n stream.next();\n stream.next();\n return null;\n }\n if (char === '`' && stream.match(/(`+)(?:(?!\\1).)+?\\1|`+.*$/)) {\n return 'code';\n }\n if ((char === '*' || char === '_') && (char === '*' || !/\\w/.test(stream.string.charAt(stream.pos - 1)))) {\n if (stream.match(/(\\*\\*|__)(?=\\S)(?:(?!\\1).)+?\\1/)) {\n return 'strong';\n }\n if (stream.match(/(\\*|_)(?=[^\\s*_])(?:(?!\\1).)+?\\1/)) {\n return 'emphasis';\n }\n }\n if ((char === '[' || char === '!') && stream.match(/!?\\[[^\\]]*\\]\\([^)]*\\)/)) {\n return 'link';\n }\n if (char === '<') {\n if (stream.match(/<!--[\\s\\S]*?-->/)) {\n return 'comment';\n }\n if (stream.match(/<https?:[^>\\s]+>/) ) {\n return 'link';\n }\n if (stream.match(/<\\/?[A-Za-z][^>]*>/)) {\n return 'tag';\n }\n }\n if (char === 'h' && stream.match(/https?:\\/\\/[^\\s<>()]+/)) {\n return 'link';\n }\n if (!stream.match(/[^`*_[!<\\\\h]+/)) {\n stream.next();\n }\n return null;\n}\n\nexport function createMarkdownMode(modes: TxMarkdownModes): TxCodeMode<TxMarkdownState> {\n function token(stream: TxCodeStreamLike, state: TxMarkdownState): TxCodeTokenType | null {\n if (stream.sol()) {\n const fence = stream.match(FENCE, false);\n if (state.fence) {\n if (fence && fence[1][0] === state.fence[0] && fence[1].length >= state.fence.length && !fence[2]) {\n stream.skipToEnd();\n state.fence = '';\n state.inner = null;\n state.innerState = null;\n return 'string';\n }\n } else if (fence) {\n stream.skipToEnd();\n state.fence = fence[1];\n const language = modes.resolve(fence[2]);\n state.inner = language && language !== 'plain' ? modes.mode(language) : null;\n state.innerState = state.inner?.start() ?? null;\n return 'string';\n } else {\n if (stream.match(/#{1,6}(?=\\s|$)/, false)) {\n stream.skipToEnd();\n return 'heading';\n }\n if (stream.match(/\\s{0,3}>/, false)) {\n stream.skipToEnd();\n return 'quote';\n }\n if (stream.match(/\\s{0,3}([-*_])(?:\\s*\\1){2,}\\s*$/)) {\n return 'keyword';\n }\n if (stream.match(/\\s*(?:[*+-]|\\d+[.)])(?=\\s)/)) {\n return 'keyword';\n }\n }\n }\n if (state.fence) {\n if (!state.inner) {\n stream.skipToEnd();\n return 'code';\n }\n const type = state.inner.token(stream, state.innerState);\n if (stream.pos === stream.start) {\n stream.next();\n }\n return type;\n }\n return inline(stream);\n }\n\n return {\n language: 'markdown',\n comments: { block: ['<!--', '-->'] },\n start: () => ({ fence: '', inner: null, innerState: null }),\n copy: (state) => ({ ...state, innerState: state.inner ? state.inner.copy(state.innerState) : null }),\n token,\n };\n}\n","import { TxCodeLanguage, TxCodeMode, TxCodeToken, TxCodeTokenType } from './code-highlight.types';\nimport { TX_CSS_MODE } from './languages/css';\nimport { TX_HTML_MODE } from './languages/html';\nimport { TX_JAVASCRIPT_MODE, TX_TYPESCRIPT_MODE } from './languages/javascript';\nimport { TX_JSON_MODE } from './languages/json';\nimport { createMarkdownMode } from './languages/markdown';\nimport { TxCodeStream } from './stream';\n\nconst ALIASES: Record<string, TxCodeLanguage> = {\n html: 'html',\n htm: 'html',\n xhtml: 'html',\n xml: 'html',\n svg: 'html',\n vue: 'html',\n css: 'css',\n javascript: 'javascript',\n js: 'javascript',\n jsx: 'javascript',\n mjs: 'javascript',\n cjs: 'javascript',\n typescript: 'typescript',\n ts: 'typescript',\n tsx: 'typescript',\n json: 'json',\n jsonc: 'json',\n json5: 'json',\n markdown: 'markdown',\n md: 'markdown',\n plain: 'plain',\n plaintext: 'plain',\n text: 'plain',\n txt: 'plain',\n};\n\nexport function resolveCodeLanguage(name: string | null | undefined): TxCodeLanguage | null {\n return name ? (ALIASES[name.trim().toLowerCase()] ?? null) : null;\n}\n\nconst PLAIN_MODE: TxCodeMode<null> = {\n language: 'plain',\n comments: {},\n start: () => null,\n copy: () => null,\n token: (stream) => {\n stream.skipToEnd();\n return null;\n },\n};\n\nconst MARKDOWN_MODE = createMarkdownMode({ resolve: resolveCodeLanguage, mode: getCodeMode });\n\nconst MODES: Record<TxCodeLanguage, TxCodeMode> = {\n html: TX_HTML_MODE as TxCodeMode,\n css: TX_CSS_MODE as TxCodeMode,\n javascript: TX_JAVASCRIPT_MODE as TxCodeMode,\n typescript: TX_TYPESCRIPT_MODE as TxCodeMode,\n json: TX_JSON_MODE as TxCodeMode,\n markdown: MARKDOWN_MODE as TxCodeMode,\n plain: PLAIN_MODE as TxCodeMode,\n};\n\nexport function getCodeMode(language: TxCodeLanguage | string | null | undefined): TxCodeMode {\n return MODES[resolveCodeLanguage(language) ?? 'plain'];\n}\n\nexport function tokenizeLine(mode: TxCodeMode, text: string, state: unknown): TxCodeToken[] {\n const stream = new TxCodeStream(text);\n const tokens: TxCodeToken[] = [];\n while (!stream.eol()) {\n stream.start = stream.pos;\n const type = mode.token(stream, state);\n if (stream.pos <= stream.start) {\n stream.pos = stream.start + 1;\n }\n if (type) {\n pushToken(tokens, stream.start, stream.pos, type);\n }\n }\n return tokens;\n}\n\nfunction pushToken(tokens: TxCodeToken[], from: number, to: number, type: TxCodeTokenType): void {\n const last = tokens[tokens.length - 1];\n if (last && last.type === type && last.to === from) {\n tokens[tokens.length - 1] = { from: last.from, to, type };\n } else {\n tokens.push({ from, to, type });\n }\n}\n\nexport function splitCodeLines(code: string): string[] {\n return code.split(/\\r\\n?|\\n/);\n}\n\nexport function highlightCode(code: string, language: TxCodeLanguage | string = 'plain'): TxCodeToken[][] {\n const mode = getCodeMode(language);\n const state = mode.start();\n return splitCodeLines(code).map((line) => tokenizeLine(mode, line, state));\n}\n\nexport class TxCodeLineStates {\n private readonly states: unknown[];\n\n constructor(private readonly mode: TxCodeMode) {\n this.states = [mode.start()];\n }\n\n get language(): TxCodeLanguage {\n return this.mode.language;\n }\n\n invalidateFrom(line: number): void {\n if (this.states.length > line + 1) {\n this.states.length = Math.max(1, line + 1);\n }\n }\n\n tokens(line: number, lineText: (line: number) => string): TxCodeToken[] {\n while (this.states.length <= line) {\n const index = this.states.length - 1;\n const state = this.mode.copy(this.states[index]);\n tokenizeLine(this.mode, lineText(index), state);\n this.states.push(state);\n }\n return tokenizeLine(this.mode, lineText(line), this.mode.copy(this.states[line]));\n }\n}\n","import { TxCodeLanguage, TxCodeToken } from './code-highlight.types';\nimport { highlightCode, splitCodeLines } from './tokenize';\n\nexport interface TxCodeSegment {\n readonly text: string;\n readonly className: string | null;\n}\n\nexport interface TxCodeLine {\n readonly number: number;\n readonly segments: readonly TxCodeSegment[];\n readonly indent: string | null;\n readonly guides: number;\n}\n\nfunction indentWidth(text: string, tabSize: number): number | null {\n let columns = 0;\n for (const char of text) {\n if (char === ' ') {\n columns++;\n } else if (char === '\\t') {\n columns += tabSize - (columns % tabSize);\n } else {\n return columns;\n }\n }\n return null;\n}\n\nexport function guideLevels(count: number, lineText: (index: number) => string, tabSize = 4, from = 0, to = count, reach = 200): number[] {\n const width = (index: number) => indentWidth(lineText(index), tabSize);\n const nearest = (index: number, step: 1 | -1): number => {\n for (let other = index + step, seen = 0; other >= 0 && other < count && seen < reach; other += step, seen++) {\n const value = width(other);\n if (value !== null) {\n return value;\n }\n }\n return 0;\n };\n const levels: number[] = [];\n for (let index = from; index < to; index++) {\n const own = width(index);\n const columns = own ?? Math.min(nearest(index, -1), nearest(index, 1));\n levels.push(Math.ceil(columns / tabSize));\n }\n return levels;\n}\n\nexport function lineIndent(text: string, tabSize = 4): string | null {\n let columns = 0;\n let index = 0;\n for (; index < text.length; index++) {\n const char = text[index];\n if (char === ' ') {\n columns++;\n } else if (char === '\\t') {\n columns += tabSize - (columns % tabSize);\n } else {\n break;\n }\n }\n return columns > 0 && index < text.length ? `${columns}ch` : null;\n}\n\nexport function tokenClass(type: string): string {\n return `tx-code-tok-${type}`;\n}\n\nexport function lineSegments(text: string, tokens: readonly TxCodeToken[]): TxCodeSegment[] {\n const segments: TxCodeSegment[] = [];\n let position = 0;\n for (const token of tokens) {\n if (token.from > position) {\n segments.push({ text: text.slice(position, token.from), className: null });\n }\n segments.push({ text: text.slice(token.from, token.to), className: tokenClass(token.type) });\n position = token.to;\n }\n if (position < text.length) {\n segments.push({ text: text.slice(position), className: null });\n }\n return segments;\n}\n\nexport function codeLines(code: string, language: TxCodeLanguage | string, firstLine = 1, tabSize = 4): TxCodeLine[] {\n const texts = splitCodeLines(code);\n const guides = guideLevels(texts.length, (index) => texts[index], tabSize);\n return highlightCode(code, language).map((tokens, index) => ({\n number: firstLine + index,\n segments: lineSegments(texts[index], tokens),\n indent: lineIndent(texts[index], tabSize),\n guides: guides[index],\n }));\n}\n","import { TxIconSet, txIconCode, txIconComment, txIconHeading, txIconKey, txIconLink, txIconTag, txIconText } from '@tectra-ng/icons';\n\nexport const HIGHLIGHT_ICON_DEFAULTS: TxIconSet = {\n code: txIconCode,\n comment: txIconComment,\n heading: txIconHeading,\n key: txIconKey,\n link: txIconLink,\n tag: txIconTag,\n text: txIconText,\n};\n","import { codeHighlightTokens, codeSyntaxTokens } from '@tectra-ng/themes';\n\nexport const HIGHLIGHT_THEME = {\n codeHighlight: codeHighlightTokens,\n codeSyntax: codeSyntaxTokens,\n};\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { HIGHLIGHT_ICON_DEFAULTS } from './highlight.icons';\nimport { injectTokens } from '@tectra-ng/core/config';\nimport { HIGHLIGHT_THEME } from './highlight.theme';\n\n@Component({\n selector: 'tx-code-syntax-styles',\n template: '',\n styleUrl: './code-syntax.styles.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n viewProviders: [provideTxIconDefaults(HIGHLIGHT_ICON_DEFAULTS)],\n})\nexport class TxCodeSyntaxStyles {\n private readonly highlightTheme = injectTokens(HIGHLIGHT_THEME);\n}\n","import { ChangeDetectionStrategy, Component, booleanAttribute, computed, inject, input, numberAttribute } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { TxStyleLoader } from '@tectra-ng/core/styles';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraCodeHighlightTokens, TectraCodeSyntaxTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxCodeHighlightPart, TxCodeLanguage } from './code-highlight.types';\nimport { codeLines } from './code-lines';\nimport { TxCodeSyntaxStyles } from './code-syntax-styles.component';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { HIGHLIGHT_ICON_DEFAULTS } from './highlight.icons';\nimport { HIGHLIGHT_THEME } from './highlight.theme';\n\nexport type TxCodeHighlightTokens = TectraCodeHighlightTokens & { syntax: TectraCodeSyntaxTokens };\n\n@Component({\n selector: 'tx-code-highlight',\n templateUrl: './code-highlight.component.html',\n styleUrl: './code-highlight.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-code-highlight',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-language]': 'language()',\n '[class.tx-code-highlight--wrap]': 'wordWrap()',\n '[class.tx-code-highlight--numbers]': 'lineNumbers()',\n },\n viewProviders: [provideTxIconDefaults(HIGHLIGHT_ICON_DEFAULTS)],\n})\nexport class TxCodeHighlight {\n private readonly highlightTheme = injectTokens(HIGHLIGHT_THEME);\n\n readonly code = input<string | null | undefined>('');\n readonly language = input<TxCodeLanguage | string>('html');\n readonly lineNumbers = input(true, { transform: booleanAttribute });\n readonly wordWrap = input(false, { transform: booleanAttribute });\n readonly indentGuides = input(true, { transform: booleanAttribute });\n readonly tabSize = input(4, { transform: numberAttribute });\n readonly firstLine = input(1, { transform: numberAttribute });\n readonly height = input<string | undefined>(undefined);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TxCodeHighlightTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxCodeHighlightPart, TxCodeHighlight> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('codeHighlight', this, this.pt, this.ptOptions);\n protected readonly t = injectTranslations();\n\n protected readonly lines = computed(() => codeLines(this.code() ?? '', this.language(), this.firstLine(), this.tabSize()));\n protected readonly label = computed(() => this.ariaLabel() ?? this.t().codeHighlightLabel);\n\n readonly hostStyle = computed(() => {\n const { syntax, ...own } = this.dt() ?? {};\n return {\n ...toStyleObject(own, '--tx-code-highlight'),\n ...toStyleObject(syntax, '--tx-code-syntax'),\n ...(this.height() ? { height: this.height() } : {}),\n ...this.passThrough().root?.style,\n };\n });\n\n constructor() {\n inject(TxStyleLoader).load(TxCodeSyntaxStyles);\n }\n}\n","<pre\n class=\"tx-code-highlight__code\"\n tabindex=\"0\"\n role=\"region\"\n [attr.aria-label]=\"label()\"\n [class]=\"passThrough().content?.class\"\n [style]=\"passThrough().content?.style\"\n><code>@for (line of lines(); track $index) {<span class=\"tx-code-highlight__line\" [class]=\"passThrough().line?.class\" [style]=\"passThrough().line?.style\">@if (lineNumbers()) {<span class=\"tx-code-highlight__number\" aria-hidden=\"true\" [class]=\"passThrough().gutter?.class\" [style]=\"passThrough().gutter?.style\">{{ line.number }}</span>}<span class=\"tx-code-highlight__text\" [class.tx-code-guides]=\"indentGuides() && line.guides > 0\" [style.--tx-code-guides]=\"indentGuides() && line.guides > 0 ? line.guides : null\" [style.--tx-code-guide-step]=\"tabSize() + 'ch'\" [style.--tx-code-wrap-indent]=\"wordWrap() ? line.indent : null\">@for (segment of line.segments; track $index) {<span [class]=\"segment.className\">{{ segment.text }}</span>}{{ '\\n' }}</span></span>}</code></pre>\n"],"mappings":";;;;;;;;AAEA,MAAM,yBAAS,IAAI,QAAO;AAE1B,SAAS,OAAO,SAAe;CAC7B,IAAI,WAAW,OAAO,IAAI,OAAO;CACjC,IAAI,CAAC,UAAU;EACb,WAAW,IAAI,OAAO,QAAQ,QAAQ,QAAQ,MAAM,QAAQ,SAAS,EAAE,IAAI,GAAG;EAC9E,OAAO,IAAI,SAAS,QAAQ;CAC9B;CACA,OAAO;AACT;AAEA,IAAa,eAAb,MAAyB;CAIF;CAHrB,MAAM;CACN,QAAQ;CAER,YAAqB,QAAc;EAAd,KAAA,SAAA;CAAiB;CAEtC,MAAG;EACD,OAAO,KAAK,OAAO,KAAK,OAAO;CACjC;CAEA,MAAG;EACD,OAAO,KAAK,QAAQ;CACtB;CAEA,KAAK,SAAS,GAAC;EACb,OAAO,KAAK,OAAO,OAAO,KAAK,MAAM,MAAM;CAC7C;CAEA,OAAI;EACF,OAAO,KAAK,MAAM,KAAK,OAAO,SAAS,KAAK,OAAO,OAAO,KAAK,KAAK,IAAI;CAC1E;CAEA,IAAI,OAAsB;EACxB,MAAM,OAAO,KAAK,KAAI;EACtB,IAAI,SAAS,OAAO,UAAU,WAAW,SAAS,QAAQ,MAAM,KAAK,IAAI,IAAI;GAC3E,KAAK;GACL,OAAO;EACT;EACA,OAAO;CACT;CAEA,SAAS,OAAa;EACpB,MAAM,QAAQ,KAAK;EACnB,OAAO,KAAK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YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAhB3B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAmB,iBAGZ,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;IACtB,wBAAwB;IACxB,mCAAmC;IACnC,sCAAsC;GACvC;GAAA,eACc,CAAC,sBAAsB,uBAAuB,CAAC;GAAC,UAAA;GAAA,QAAA,CAAA,ynFAAA;EAAA,CAAA"}
|
|
@@ -3,12 +3,13 @@ import { Decoration, EditorView, GutterMarker, ViewPlugin, WidgetType, drawSelec
|
|
|
3
3
|
import { NgTemplateOutlet } from "@angular/common";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import { ChangeDetectionStrategy, Component, DestroyRef, Injector, ViewEncapsulation, afterNextRender, afterRenderEffect, booleanAttribute, computed, effect, forwardRef, inject, input, model, output, signal, untracked, viewChild } from "@angular/core";
|
|
6
|
-
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
6
|
+
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
7
7
|
import { TxLocaleService, injectTranslations } from "@tectra-ng/core/i18n";
|
|
8
8
|
import { TxStyleLoader } from "@tectra-ng/core/styles";
|
|
9
9
|
import { optionalBoolean, optionalNumber } from "@tectra-ng/core/utils";
|
|
10
10
|
import { TxCodeLineStates, TxCodeSyntaxStyles, codeLines, getCodeMode, guideLevels, highlightCode, lineIndent, resolveCodeLanguage, tokenClass } from "@tectra-ng/code-editor/highlight";
|
|
11
|
-
import { toStyleObject } from "@tectra-ng/themes";
|
|
11
|
+
import { codeDiffTokens, codeEditorTokens, codeSyntaxTokens, toStyleObject } from "@tectra-ng/themes";
|
|
12
|
+
import { provideTxIconDefaults, txIconArrowDown, txIconArrowUp, txIconChevronDown, txIconChevronRight, txIconLanguage, txIconLink, txIconListCheck, txIconPenLine, txIconSearch, txIconTimes, txIconUndo } from "@tectra-ng/icons";
|
|
12
13
|
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
13
14
|
import { injectFieldInvalid } from "@tectra-ng/core/forms";
|
|
14
15
|
import { TxButton } from "@tectra-ng/ui/button";
|
|
@@ -1470,8 +1471,27 @@ function codeEditorBase() {
|
|
|
1470
1471
|
Prec.high(keymap.of(TX_CODE_EDITING_KEYS))
|
|
1471
1472
|
];
|
|
1472
1473
|
}
|
|
1474
|
+
const CODE_EDITOR_ICON_DEFAULTS = {
|
|
1475
|
+
"arrow-down": txIconArrowDown,
|
|
1476
|
+
"arrow-up": txIconArrowUp,
|
|
1477
|
+
"chevron-down": txIconChevronDown,
|
|
1478
|
+
"chevron-right": txIconChevronRight,
|
|
1479
|
+
language: txIconLanguage,
|
|
1480
|
+
link: txIconLink,
|
|
1481
|
+
"list-check": txIconListCheck,
|
|
1482
|
+
"pen-line": txIconPenLine,
|
|
1483
|
+
search: txIconSearch,
|
|
1484
|
+
times: txIconTimes,
|
|
1485
|
+
undo: txIconUndo
|
|
1486
|
+
};
|
|
1487
|
+
const CODE_EDITOR_THEME = {
|
|
1488
|
+
codeDiff: codeDiffTokens,
|
|
1489
|
+
codeEditor: codeEditorTokens,
|
|
1490
|
+
codeSyntax: codeSyntaxTokens
|
|
1491
|
+
};
|
|
1473
1492
|
const RECOMPUTE_DELAY = 150;
|
|
1474
1493
|
var TxCodeDiff = class TxCodeDiff {
|
|
1494
|
+
codeEditorTheme = injectTokens(CODE_EDITOR_THEME);
|
|
1475
1495
|
original = input("", ...ngDevMode ? [{ debugName: "original" }] : /* istanbul ignore next */ []);
|
|
1476
1496
|
value = model("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
1477
1497
|
language = input("html", ...ngDevMode ? [{ debugName: "language" }] : /* istanbul ignore next */ []);
|
|
@@ -1920,6 +1940,7 @@ var TxCodeDiff = class TxCodeDiff {
|
|
|
1920
1940
|
"ngTemplateOutletInjector"
|
|
1921
1941
|
]
|
|
1922
1942
|
}],
|
|
1943
|
+
viewProviders: [provideTxIconDefaults(CODE_EDITOR_ICON_DEFAULTS)],
|
|
1923
1944
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1924
1945
|
encapsulation: i0.ViewEncapsulation.None
|
|
1925
1946
|
});
|
|
@@ -1948,6 +1969,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1948
1969
|
role: "group",
|
|
1949
1970
|
"[attr.aria-label]": "ariaLabel() ?? t().codeDiffLabel"
|
|
1950
1971
|
},
|
|
1972
|
+
viewProviders: [provideTxIconDefaults(CODE_EDITOR_ICON_DEFAULTS)],
|
|
1951
1973
|
template: "<ng-template #rowsTemplate let-rows>\n <div class=\"tx-code-diff__static\" role=\"presentation\">\n @for (row of rows; track $index) {\n <div\n class=\"tx-code-diff__static-line\"\n [class.tx-code-diff__line--inserted]=\"row.kind === 'inserted'\"\n [class.tx-code-diff__line--removed]=\"row.kind === 'removed'\"\n [class.tx-code-diff__static-line--filler]=\"row.kind === 'filler'\"\n >\n @if (lineNumbers()) {\n <span class=\"tx-code-diff__static-number\" aria-hidden=\"true\">{{ row.number }}</span>\n }\n <span class=\"tx-code-diff__static-sign\" aria-hidden=\"true\">{{ row.kind === 'inserted' ? '+' : row.kind === 'removed' ? '−' : '' }}</span>\n <span\n class=\"tx-code-diff__static-text\"\n [class.tx-code-guides]=\"indentGuides() && row.guides > 0\"\n [style.--tx-code-guides]=\"indentGuides() && row.guides > 0 ? row.guides : null\"\n [style.--tx-code-guide-step]=\"indentGuides() ? guideStep() : null\"\n [style.--tx-code-wrap-indent]=\"wordWrap() && view() === 'inline' ? row.indent : null\"\n >@for (segment of row.segments; track $index) {<span [class]=\"segment.className\">{{ segment.text }}</span>}</span\n >\n </div>\n }\n </div>\n</ng-template>\n\n@if (view() === 'split') {\n <div #originalMount class=\"tx-code-diff__pane tx-code-diff__pane--original\" [class]=\"passThrough().original?.class\" [style]=\"passThrough().original?.style\">\n @if (!ready()) {\n <ng-container *ngTemplateOutlet=\"rowsTemplate; context: { $implicit: staticSplit().original }\" />\n }\n </div>\n <div #modifiedMount class=\"tx-code-diff__pane tx-code-diff__pane--modified\" [class]=\"passThrough().modified?.class\" [style]=\"passThrough().modified?.style\">\n @if (!ready()) {\n <ng-container *ngTemplateOutlet=\"rowsTemplate; context: { $implicit: staticSplit().modified }\" />\n }\n </div>\n} @else {\n <div #modifiedMount class=\"tx-code-diff__pane\" [class]=\"passThrough().modified?.class\" [style]=\"passThrough().modified?.style\">\n @if (!ready()) {\n <ng-container *ngTemplateOutlet=\"rowsTemplate; context: { $implicit: staticInline() }\" />\n }\n </div>\n}\n",
|
|
1952
1974
|
styles: [".tx-code-diff{position:relative;display:flex;min-width:0}.tx-code-diff__pane{flex:1 1 0;min-width:0;height:100%}.tx-code-diff[data-styled]{box-sizing:border-box;overflow:hidden;border:var(--tx-code-diff-border-width) solid var(--tx-code-diff-border-color);border-radius:var(--tx-code-diff-border-radius);background:var(--tx-code-diff-background);color:var(--tx-code-diff-color);font-family:var(--tx-code-diff-font-family);font-size:var(--tx-code-diff-font-size);line-height:var(--tx-code-diff-line-height)}.tx-code-diff[data-styled] .cm-editor{height:100%;background:transparent;color:inherit}.tx-code-diff[data-styled] .cm-editor.cm-focused{outline:none}.tx-code-diff[data-styled] .cm-scroller{font-family:inherit;line-height:inherit}.tx-code-diff[data-styled] .cm-content{padding-block:var(--tx-code-diff-padding-block);caret-color:var(--tx-code-editor-cursor-color);tab-size:var(--tx-code-diff-tab-size)}.tx-code-diff[data-styled]{--tx-code-line-start: 0px}.tx-code-diff[data-styled]:not(.tx-code-diff--numbers){--tx-code-line-start: var(--tx-code-diff-padding-inline-end)}.tx-code-diff[data-styled] .cm-scroller .cm-content .cm-line{padding:0 var(--tx-code-diff-padding-inline-end) 0 var(--tx-code-line-start)}.tx-code-diff[data-styled] .cm-editor .cm-gutters{border:none;background:var(--tx-code-diff-gutter-background);color:var(--tx-code-diff-gutter-color)}.tx-code-diff[data-styled] .cm-editor .cm-lineNumbers .cm-gutterElement{box-sizing:content-box;min-width:var(--tx-code-diff-gutter-min-digits);padding:0 var(--tx-code-diff-gutter-gap) 0 var(--tx-code-diff-gutter-padding-start);text-align:right}.tx-code-diff[data-styled] .cm-editor .cm-activeLineGutter{background:transparent;color:var(--tx-code-diff-gutter-active-color)}.tx-code-diff[data-styled] .cm-editor .cm-content .cm-activeLine{background-color:transparent;box-shadow:inset 0 0 0 var(--tx-code-editor-active-line-border-width) var(--tx-code-editor-active-line-border-color)}.tx-code-diff[data-styled] .cm-editor .cm-cursorLayer .cm-cursor{border-left:var(--tx-code-editor-cursor-width) solid var(--tx-code-editor-cursor-color)}.tx-code-diff[data-styled] .cm-editor .cm-scroller .cm-selectionLayer .cm-selectionBackground{background:var(--tx-code-editor-selection-inactive-background)}.tx-code-diff[data-styled] .cm-editor.cm-focused .cm-scroller .cm-selectionLayer .cm-selectionBackground{background:var(--tx-code-editor-selection-background)}.tx-code-diff[data-styled] .cm-editor .cm-placeholder{color:var(--tx-code-editor-placeholder-color)}.tx-code-diff[data-styled] .cm-scroller .cm-content .cm-line.tx-code-guides{background-image:repeating-linear-gradient(to right,var(--tx-code-syntax-indent-guide) 0 1px,transparent 1px var(--tx-code-guide-step));background-position:var(--tx-code-line-start) 0;background-repeat:no-repeat;background-size:calc(var(--tx-code-guides) * var(--tx-code-guide-step)) 100%}.tx-code-diff[data-styled] .cm-scroller .cm-content .cm-line.tx-code-wrap-indent{padding-inline-start:calc(var(--tx-code-line-start) + var(--tx-code-wrap-indent));text-indent:calc(-1 * var(--tx-code-wrap-indent))}.tx-code-diff[data-styled] .tx-code-editor__bracket{border-radius:1px;background:var(--tx-code-editor-bracket-background);outline:1px solid var(--tx-code-editor-bracket-border-color)}.tx-code-diff[data-styled] .tx-code-diff__static{box-sizing:border-box;min-height:100%;height:100%;padding-block:var(--tx-code-diff-padding-block);overflow:auto;tab-size:var(--tx-code-diff-tab-size)}.tx-code-diff[data-styled] .tx-code-diff__static[hidden]{display:none}.tx-code-diff[data-styled] .tx-code-diff__static-line{display:flex;min-height:var(--tx-code-diff-line-height)}.tx-code-diff[data-styled] .tx-code-diff__static-number{position:sticky;left:0;flex:none;box-sizing:content-box;min-width:var(--tx-code-diff-gutter-min-digits);padding:0 var(--tx-code-diff-gutter-gap) 0 var(--tx-code-diff-gutter-padding-start);background:var(--tx-code-diff-gutter-background);color:var(--tx-code-diff-gutter-color);text-align:right;-webkit-user-select:none;user-select:none}.tx-code-diff[data-styled] .tx-code-diff__static-text{flex:1 1 auto;padding-inline:var(--tx-code-line-start) var(--tx-code-diff-padding-inline-end);white-space:pre}.tx-code-diff[data-styled] .tx-code-diff__static-text.tx-code-guides{background-image:repeating-linear-gradient(to right,var(--tx-code-syntax-indent-guide) 0 1px,transparent 1px var(--tx-code-guide-step));background-position:var(--tx-code-line-start) 0;background-repeat:no-repeat;background-size:calc(var(--tx-code-guides) * var(--tx-code-guide-step)) 100%}.tx-code-diff[data-styled].tx-code-diff--wrap .tx-code-diff__static-text{min-width:0;white-space:pre-wrap;overflow-wrap:anywhere}.tx-code-diff[data-styled].tx-code-diff--wrap .tx-code-diff__static-text[style*=--tx-code-wrap-indent]{padding-inline-start:calc(var(--tx-code-line-start) + var(--tx-code-wrap-indent));text-indent:calc(-1 * var(--tx-code-wrap-indent))}.tx-code-diff[data-styled].tx-code-diff--split .tx-code-diff__pane--original{border-inline-end:1px solid var(--tx-code-diff-split-border-color)}.tx-code-diff[data-styled] .tx-code-diff__signs .cm-gutterElement,.tx-code-diff[data-styled] .tx-code-diff__static-sign{box-sizing:border-box;flex:none;width:var(--tx-code-diff-gutter-marker-width);text-align:center;-webkit-user-select:none;user-select:none}.tx-code-diff[data-styled] .tx-code-diff__static-number,.tx-code-diff[data-styled] .cm-editor .cm-lineNumbers .cm-gutterElement{padding-inline-end:0}.tx-code-diff[data-styled],.tx-code-diff[data-styled]:not(.tx-code-diff--numbers){--tx-code-line-start: calc(var(--tx-code-diff-gutter-gap) - var(--tx-code-diff-gutter-marker-width))}.tx-code-diff[data-styled] .tx-code-diff__row{padding-inline-start:var(--tx-code-line-start)}.tx-code-diff[data-styled] .tx-code-diff__row.tx-code-guides{background-image:repeating-linear-gradient(to right,var(--tx-code-syntax-indent-guide) 0 1px,transparent 1px var(--tx-code-guide-step));background-position:var(--tx-code-line-start) 0;background-repeat:no-repeat;background-size:calc(var(--tx-code-guides) * var(--tx-code-guide-step)) 100%}.tx-code-diff[data-styled].tx-code-diff--wrap .tx-code-diff__row[style*=--tx-code-wrap-indent]{padding-inline-start:calc(var(--tx-code-line-start) + var(--tx-code-wrap-indent));text-indent:calc(-1 * var(--tx-code-wrap-indent))}.tx-code-diff[data-styled] .tx-code-diff__sign--inserted{color:var(--tx-code-diff-inserted-marker-color)}.tx-code-diff[data-styled] .tx-code-diff__sign--removed{color:var(--tx-code-diff-removed-marker-color)}.tx-code-diff[data-styled] .tx-code-diff__static-line.tx-code-diff__line--inserted .tx-code-diff__static-sign{color:var(--tx-code-diff-inserted-marker-color)}.tx-code-diff[data-styled] .tx-code-diff__static-line.tx-code-diff__line--removed .tx-code-diff__static-sign{color:var(--tx-code-diff-removed-marker-color)}.tx-code-diff[data-styled] .cm-scroller .cm-content .tx-code-diff__line--inserted,.tx-code-diff[data-styled] .tx-code-diff__static-line.tx-code-diff__line--inserted .tx-code-diff__static-text{background-color:var(--tx-code-diff-inserted-line-background)}.tx-code-diff[data-styled] .cm-scroller .cm-content .tx-code-diff__line--removed,.tx-code-diff[data-styled] .tx-code-diff__row.tx-code-diff__line--removed,.tx-code-diff[data-styled] .tx-code-diff__static-line.tx-code-diff__line--removed .tx-code-diff__static-text{background-color:var(--tx-code-diff-removed-line-background)}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-comment,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-comment{color:color-mix(in srgb,var(--tx-code-syntax-comment) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-quote,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-quote{color:color-mix(in srgb,var(--tx-code-syntax-quote) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-keyword,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-keyword{color:color-mix(in srgb,var(--tx-code-syntax-keyword) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-literal,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-literal{color:color-mix(in srgb,var(--tx-code-syntax-literal) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-string,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-string{color:color-mix(in srgb,var(--tx-code-syntax-string) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-number,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-number{color:color-mix(in srgb,var(--tx-code-syntax-number) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-regexp,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-regexp{color:color-mix(in srgb,var(--tx-code-syntax-regexp) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-type,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-type{color:color-mix(in srgb,var(--tx-code-syntax-type) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-delimiter,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-delimiter{color:color-mix(in srgb,var(--tx-code-syntax-delimiter) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-tag,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-tag{color:color-mix(in srgb,var(--tx-code-syntax-tag) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-tag-delimiter,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-tag-delimiter{color:color-mix(in srgb,var(--tx-code-syntax-tag-delimiter) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-meta,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-meta{color:color-mix(in srgb,var(--tx-code-syntax-meta) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-attribute,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-attribute{color:color-mix(in srgb,var(--tx-code-syntax-attribute) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-attribute-value,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-attribute-value{color:color-mix(in srgb,var(--tx-code-syntax-attribute-value) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-value,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-value{color:color-mix(in srgb,var(--tx-code-syntax-value) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-key,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-key{color:color-mix(in srgb,var(--tx-code-syntax-key) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-heading,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-heading{color:color-mix(in srgb,var(--tx-code-syntax-heading) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-link,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-link{color:color-mix(in srgb,var(--tx-code-syntax-link) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__line--inserted .tx-code-tok-code,.tx-code-diff[data-styled] .tx-code-diff__line--removed .tx-code-tok-code{color:color-mix(in srgb,var(--tx-code-syntax-code) var(--tx-code-diff-syntax-mix),var(--tx-code-diff-syntax-shade))}.tx-code-diff[data-styled] .tx-code-diff__text--inserted{background:var(--tx-code-diff-inserted-text-background)}.tx-code-diff[data-styled] .tx-code-diff__text--removed{background:var(--tx-code-diff-removed-text-background)}.tx-code-diff[data-styled] .tx-code-diff__row{min-height:var(--tx-code-diff-line-height);padding-inline-end:var(--tx-code-diff-padding-inline-end);white-space:pre}.tx-code-diff[data-styled].tx-code-diff--wrap .tx-code-diff__row{white-space:pre-wrap;overflow-wrap:anywhere}.tx-code-diff[data-styled] .tx-code-diff__filler,.tx-code-diff[data-styled] .tx-code-diff__static-line--filler .tx-code-diff__static-text{background-color:var(--tx-code-diff-filler-background)}.tx-code-diff[data-styled] .tx-code-diff__filler{height:calc(var(--tx-code-diff-line-height) * var(--tx-code-diff-filler-lines, 1))}.tx-code-diff[data-styled] .cm-editor .cm-content .cm-activeLine.tx-code-diff__line--inserted{background-color:var(--tx-code-diff-inserted-line-background)}\n"]
|
|
1953
1975
|
}]
|
|
@@ -2101,6 +2123,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2101
2123
|
});
|
|
2102
2124
|
const isMac = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform);
|
|
2103
2125
|
var TxCodeEditor = class TxCodeEditor {
|
|
2126
|
+
codeEditorTheme = injectTokens(CODE_EDITOR_THEME);
|
|
2104
2127
|
value = model("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
2105
2128
|
language = input("html", ...ngDevMode ? [{ debugName: "language" }] : /* istanbul ignore next */ []);
|
|
2106
2129
|
height = input("600px", ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
|
|
@@ -2829,6 +2852,7 @@ var TxCodeEditor = class TxCodeEditor {
|
|
|
2829
2852
|
outputs: ["valueChange", "changed"]
|
|
2830
2853
|
}
|
|
2831
2854
|
],
|
|
2855
|
+
viewProviders: [provideTxIconDefaults(CODE_EDITOR_ICON_DEFAULTS)],
|
|
2832
2856
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2833
2857
|
encapsulation: i0.ViewEncapsulation.None
|
|
2834
2858
|
});
|
|
@@ -2868,6 +2892,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2868
2892
|
"[class.tx-code-editor--numbers]": "lineNumbers()",
|
|
2869
2893
|
"[class.tx-code-editor--diff]": "diffMode()"
|
|
2870
2894
|
},
|
|
2895
|
+
viewProviders: [provideTxIconDefaults(CODE_EDITOR_ICON_DEFAULTS)],
|
|
2871
2896
|
template: "@if (diffMode()) {\n <tx-code-diff\n class=\"tx-code-editor__diff\"\n [original]=\"originalValue()\"\n [value]=\"value()\"\n [language]=\"language()\"\n [view]=\"diffView()\"\n [readOnly]=\"readOnly() || isDisabled()\"\n [lineNumbers]=\"lineNumbers()\"\n [wordWrap]=\"wordWrap()\"\n [indentGuides]=\"indentGuides()\"\n [ariaLabel]=\"ariaLabel()\"\n [unstyled]=\"isUnstyled()\"\n height=\"100%\"\n (valueChange)=\"onDiffValue($event)\"\n (changed)=\"diffChanged.emit($event)\"\n />\n} @else {\n <div #mount class=\"tx-code-editor__mount\" [class]=\"passThrough().editor?.class\" [style]=\"passThrough().editor?.style\">\n @if (!ready()) {\n <div\n class=\"tx-code-editor__static\"\n role=\"textbox\"\n aria-multiline=\"true\"\n aria-readonly=\"true\"\n [attr.aria-label]=\"ariaLabel() ?? (ariaLabelledBy() ? null : t().codeEditorLabel)\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n >\n @for (line of staticLines(); track $index) {\n <div class=\"tx-code-editor__static-line\">\n @if (lineNumbers()) {\n <span class=\"tx-code-editor__static-number\" aria-hidden=\"true\">{{ line.number }}</span>\n }\n <span\n class=\"tx-code-editor__static-text\"\n [class.tx-code-guides]=\"indentGuides() && line.guides > 0\"\n [style.--tx-code-guides]=\"indentGuides() && line.guides > 0 ? line.guides : null\"\n [style.--tx-code-guide-step]=\"indentGuides() ? staticTabSize() + 'ch' : null\"\n [style.--tx-code-wrap-indent]=\"wordWrap() ? line.indent : null\"\n >@for (segment of line.segments; track $index) {<span [class]=\"segment.className\">{{ segment.text }}</span>}@if (\n staticEmpty() && placeholder()\n ) {<span class=\"tx-code-editor__static-placeholder\">{{ placeholder() }}</span>}</span\n >\n </div>\n }\n </div>\n }\n </div>\n @if (searchOpen()) {\n <div class=\"tx-code-editor__search\" role=\"search\" [class]=\"passThrough().search?.class\" [style]=\"passThrough().search?.style\">\n <button\n txButton\n type=\"button\"\n text\n plain\n size=\"small\"\n class=\"tx-code-editor__search-expand\"\n [icon]=\"replaceOpen() ? 'chevron-down' : 'chevron-right'\"\n [attr.aria-label]=\"t().codeSearchToggleReplace\"\n [attr.aria-expanded]=\"replaceOpen()\"\n (click)=\"toggleReplace()\"\n ></button>\n <div class=\"tx-code-editor__search-rows\">\n <div class=\"tx-code-editor__search-row\">\n <div class=\"tx-code-editor__search-field\">\n <input\n #findInput\n txInput\n size=\"small\"\n class=\"tx-code-editor__search-input\"\n [class]=\"passThrough().searchInput?.class\"\n [invalid]=\"!searchResult().valid\"\n [value]=\"query()\"\n [placeholder]=\"t().codeSearchFind\"\n [attr.aria-label]=\"t().codeSearchFind\"\n (input)=\"onQuery($any($event.target).value)\"\n (keydown)=\"onSearchKeydown($event, 'find')\"\n />\n <div class=\"tx-code-editor__search-options\">\n <button\n type=\"button\"\n class=\"tx-code-editor__search-option\"\n [attr.aria-pressed]=\"matchCase()\"\n [attr.aria-label]=\"t().codeSearchMatchCase\"\n [attr.title]=\"t().codeSearchMatchCase\"\n (click)=\"toggleOption('matchCase')\"\n >\n Aa\n </button>\n <button\n type=\"button\"\n class=\"tx-code-editor__search-option tx-code-editor__search-option--word\"\n [attr.aria-pressed]=\"wholeWord()\"\n [attr.aria-label]=\"t().codeSearchWholeWord\"\n [attr.title]=\"t().codeSearchWholeWord\"\n (click)=\"toggleOption('wholeWord')\"\n >\n ab\n </button>\n <button\n type=\"button\"\n class=\"tx-code-editor__search-option\"\n [attr.aria-pressed]=\"regexp()\"\n [attr.aria-label]=\"t().codeSearchRegexp\"\n [attr.title]=\"t().codeSearchRegexp\"\n (click)=\"toggleOption('regexp')\"\n >\n .*\n </button>\n </div>\n </div>\n <span class=\"tx-code-editor__search-count\" aria-live=\"polite\">{{ countText() }}</span>\n <button\n txButton\n type=\"button\"\n text\n plain\n size=\"small\"\n icon=\"arrow-up\"\n [disabled]=\"!searchResult().matches.length\"\n [attr.aria-label]=\"t().codeSearchPrevious\"\n (click)=\"findPrevious()\"\n ></button>\n <button\n txButton\n type=\"button\"\n text\n plain\n size=\"small\"\n icon=\"arrow-down\"\n [disabled]=\"!searchResult().matches.length\"\n [attr.aria-label]=\"t().codeSearchNext\"\n (click)=\"findNext()\"\n ></button>\n <button txButton type=\"button\" text plain size=\"small\" icon=\"times\" [attr.aria-label]=\"t().codeSearchClose\" (click)=\"closeSearch()\"></button>\n </div>\n @if (replaceOpen()) {\n <div class=\"tx-code-editor__search-row\">\n <div class=\"tx-code-editor__search-field\">\n <input\n #replaceInput\n txInput\n size=\"small\"\n class=\"tx-code-editor__search-input\"\n [value]=\"replacement()\"\n [placeholder]=\"t().codeSearchReplace\"\n [attr.aria-label]=\"t().codeSearchReplace\"\n [readOnly]=\"readOnly() || isDisabled()\"\n (input)=\"replacement.set($any($event.target).value)\"\n (keydown)=\"onSearchKeydown($event, 'replace')\"\n />\n </div>\n <button\n txButton\n type=\"button\"\n text\n plain\n size=\"small\"\n icon=\"pen-line\"\n [disabled]=\"!searchResult().matches.length || readOnly() || isDisabled()\"\n [attr.aria-label]=\"t().codeSearchReplace\"\n (click)=\"replaceCurrent()\"\n ></button>\n <button\n txButton\n type=\"button\"\n text\n plain\n size=\"small\"\n icon=\"list-check\"\n [disabled]=\"!searchResult().matches.length || readOnly() || isDisabled()\"\n [attr.aria-label]=\"t().codeSearchReplaceAll\"\n (click)=\"replaceAll()\"\n ></button>\n </div>\n }\n </div>\n </div>\n }\n}\n",
|
|
2872
2897
|
styles: [".tx-code-editor{position:relative;display:block;min-width:0}.tx-code-editor__mount,.tx-code-editor__diff{height:100%}.tx-code-editor[data-styled]{box-sizing:border-box;overflow:hidden;border:var(--tx-code-editor-border-width) solid var(--tx-code-editor-border-color);border-radius:var(--tx-code-editor-border-radius);background:var(--tx-code-editor-background);color:var(--tx-code-editor-color);font-family:var(--tx-code-editor-font-family);font-size:var(--tx-code-editor-font-size);line-height:var(--tx-code-editor-line-height);transition:border-color var(--tx-motion-duration)}.tx-code-editor[data-styled].tx-code-editor--focused{border-color:var(--tx-code-editor-focus-border-color)}.tx-code-editor[data-styled].tx-code-editor--invalid{border-color:var(--tx-code-editor-invalid-border-color)}.tx-code-editor[data-styled].tx-code-editor--disabled{opacity:var(--tx-code-editor-disabled-opacity)}.tx-code-editor[data-styled].tx-code-editor--diff{border:none;border-radius:0;background:none}.tx-code-editor[data-styled] .cm-editor{height:100%;background:transparent;color:inherit}.tx-code-editor[data-styled] .cm-editor.cm-focused{outline:none}.tx-code-editor[data-styled] .cm-scroller{font-family:inherit;line-height:inherit}.tx-code-editor[data-styled] .cm-content{padding-block:var(--tx-code-editor-padding-block);caret-color:var(--tx-code-editor-cursor-color);tab-size:var(--tx-code-editor-tab-size)}.tx-code-editor[data-styled]{--tx-code-line-start: 0px}.tx-code-editor[data-styled]:not(.tx-code-editor--numbers){--tx-code-line-start: var(--tx-code-editor-padding-inline-end)}.tx-code-editor[data-styled] .cm-scroller .cm-content .cm-line{padding:0 var(--tx-code-editor-padding-inline-end) 0 var(--tx-code-line-start)}.tx-code-editor[data-styled] .cm-editor .cm-gutters{border:none;background:var(--tx-code-editor-gutter-background);color:var(--tx-code-editor-gutter-color)}.tx-code-editor[data-styled] .cm-editor .cm-lineNumbers .cm-gutterElement{box-sizing:content-box;min-width:var(--tx-code-editor-gutter-min-digits);padding:0 var(--tx-code-editor-gutter-gap) 0 var(--tx-code-editor-gutter-padding-start);text-align:right}.tx-code-editor[data-styled] .cm-editor .cm-activeLineGutter{background:transparent;color:var(--tx-code-editor-gutter-active-color)}.tx-code-editor[data-styled] .cm-editor .cm-content .cm-activeLine{background-color:transparent;box-shadow:inset 0 0 0 var(--tx-code-editor-active-line-border-width) var(--tx-code-editor-active-line-border-color)}.tx-code-editor[data-styled] .cm-editor .cm-cursorLayer .cm-cursor{border-left:var(--tx-code-editor-cursor-width) solid var(--tx-code-editor-cursor-color)}.tx-code-editor[data-styled] .cm-editor .cm-scroller .cm-selectionLayer .cm-selectionBackground{background:var(--tx-code-editor-selection-inactive-background)}.tx-code-editor[data-styled] .cm-editor.cm-focused .cm-scroller .cm-selectionLayer .cm-selectionBackground{background:var(--tx-code-editor-selection-background)}.tx-code-editor[data-styled] .cm-editor .cm-placeholder{color:var(--tx-code-editor-placeholder-color)}.tx-code-editor[data-styled] .cm-scroller .cm-content .cm-line.tx-code-guides{background-image:repeating-linear-gradient(to right,var(--tx-code-syntax-indent-guide) 0 1px,transparent 1px var(--tx-code-guide-step));background-position:var(--tx-code-line-start) 0;background-repeat:no-repeat;background-size:calc(var(--tx-code-guides) * var(--tx-code-guide-step)) 100%}.tx-code-editor[data-styled] .cm-scroller .cm-content .cm-line.tx-code-wrap-indent{padding-inline-start:calc(var(--tx-code-line-start) + var(--tx-code-wrap-indent));text-indent:calc(-1 * var(--tx-code-wrap-indent))}.tx-code-editor[data-styled] .tx-code-editor__bracket{border-radius:1px;background:var(--tx-code-editor-bracket-background);outline:1px solid var(--tx-code-editor-bracket-border-color)}.tx-code-editor[data-styled] .tx-code-editor__match{background:var(--tx-code-editor-search-match-background)}.tx-code-editor[data-styled] .tx-code-editor__match--current{background:var(--tx-code-editor-search-current-background)}.tx-code-editor[data-styled] .tx-code-editor__static{box-sizing:border-box;min-height:100%;height:100%;padding-block:var(--tx-code-editor-padding-block);overflow:auto;tab-size:var(--tx-code-editor-tab-size)}.tx-code-editor[data-styled] .tx-code-editor__static[hidden]{display:none}.tx-code-editor[data-styled] .tx-code-editor__static-line{display:flex;min-height:var(--tx-code-editor-line-height)}.tx-code-editor[data-styled] .tx-code-editor__static-number{position:sticky;left:0;flex:none;box-sizing:content-box;min-width:var(--tx-code-editor-gutter-min-digits);padding:0 var(--tx-code-editor-gutter-gap) 0 var(--tx-code-editor-gutter-padding-start);background:var(--tx-code-editor-gutter-background);color:var(--tx-code-editor-gutter-color);text-align:right;-webkit-user-select:none;user-select:none}.tx-code-editor[data-styled] .tx-code-editor__static-text{flex:1 1 auto;padding-inline:var(--tx-code-line-start) var(--tx-code-editor-padding-inline-end);white-space:pre}.tx-code-editor[data-styled] .tx-code-editor__static-text.tx-code-guides{background-image:repeating-linear-gradient(to right,var(--tx-code-syntax-indent-guide) 0 1px,transparent 1px var(--tx-code-guide-step));background-position:var(--tx-code-line-start) 0;background-repeat:no-repeat;background-size:calc(var(--tx-code-guides) * var(--tx-code-guide-step)) 100%}.tx-code-editor[data-styled].tx-code-editor--wrap .tx-code-editor__static-text{min-width:0;white-space:pre-wrap;overflow-wrap:anywhere}.tx-code-editor[data-styled].tx-code-editor--wrap .tx-code-editor__static-text[style*=--tx-code-wrap-indent]{padding-inline-start:calc(var(--tx-code-line-start) + var(--tx-code-wrap-indent));text-indent:calc(-1 * var(--tx-code-wrap-indent))}.tx-code-editor[data-styled] .tx-code-editor__static-line:first-child .tx-code-editor__static-number{color:var(--tx-code-editor-gutter-active-color)}.tx-code-editor[data-styled] .tx-code-editor__static-line:first-child .tx-code-editor__static-text{box-shadow:inset 0 0 0 var(--tx-code-editor-active-line-border-width) var(--tx-code-editor-active-line-border-color)}.tx-code-editor[data-styled] .tx-code-editor__static-placeholder{color:var(--tx-code-editor-placeholder-color)}.tx-code-editor[data-styled] .tx-code-editor__search{position:absolute;z-index:3;top:var(--tx-code-editor-search-widget-top);right:var(--tx-code-editor-search-widget-end);display:flex;align-items:flex-start;gap:var(--tx-code-editor-search-widget-gap);box-sizing:border-box;width:min(var(--tx-code-editor-search-widget-width),100% - 2 * var(--tx-code-editor-search-widget-end));padding:var(--tx-code-editor-search-widget-padding);border-radius:0 0 var(--tx-code-editor-search-widget-border-radius) var(--tx-code-editor-search-widget-border-radius);background:var(--tx-code-editor-search-widget-background);box-shadow:var(--tx-code-editor-search-widget-shadow);color:var(--tx-code-editor-search-widget-color);font-family:var(--tx-font-family);animation:tx-code-editor-search-in var(--tx-motion-duration) ease-out}.tx-code-editor[data-styled] .tx-code-editor__search-rows{display:flex;flex:1 1 auto;flex-direction:column;gap:var(--tx-code-editor-search-widget-gap);min-width:0}.tx-code-editor[data-styled] .tx-code-editor__search-row{display:flex;align-items:center;gap:var(--tx-code-editor-search-widget-gap)}.tx-code-editor[data-styled] .tx-code-editor__search-field{position:relative;flex:1 1 auto;min-width:0}.tx-code-editor[data-styled] .tx-code-editor__search-input{width:100%}.tx-code-editor[data-styled] .tx-code-editor__search-row:first-child .tx-code-editor__search-input{padding-inline-end:72px}.tx-code-editor[data-styled] .tx-code-editor__search-options{position:absolute;top:50%;right:3px;display:flex;gap:1px;transform:translateY(-50%)}.tx-code-editor[data-styled] .tx-code-editor__search-option{display:inline-grid;place-items:center;width:22px;height:22px;padding:0;border:1px solid transparent;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-text-muted);font:var(--tx-font-weight-semibold) 11px/1 var(--tx-font-family);cursor:pointer;transition:background-color var(--tx-motion-duration),color var(--tx-motion-duration),border-color var(--tx-motion-duration)}.tx-code-editor[data-styled] .tx-code-editor__search-option:hover{background:color-mix(in srgb,var(--tx-text-primary) 8%,transparent);color:var(--tx-text-primary)}.tx-code-editor[data-styled] .tx-code-editor__search-option:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:-1px}.tx-code-editor[data-styled] .tx-code-editor__search-option[aria-pressed=true]{border-color:var(--tx-primary-base);background:color-mix(in srgb,var(--tx-primary-base) 14%,transparent);color:var(--tx-primary-base)}.tx-code-editor[data-styled] .tx-code-editor__search-option--word{text-decoration:underline;text-underline-offset:2px}.tx-code-editor[data-styled] .tx-code-editor__search-count{flex:none;min-width:76px;color:var(--tx-code-editor-search-count-color);font-size:var(--tx-code-editor-search-count-font-size);white-space:nowrap}@keyframes tx-code-editor-search-in{0%{transform:translateY(-100%)}}@media(prefers-reduced-motion:reduce){.tx-code-editor[data-styled]{transition:none}.tx-code-editor[data-styled] .tx-code-editor__search{animation:none}}\n"]
|
|
2873
2898
|
}]
|