diff --git a/angular.json b/angular.json
index f056620..45f07c3 100644
--- a/angular.json
+++ b/angular.json
@@ -40,6 +40,14 @@
},
"configurations": {
"production": {
+ "optimization": {
+ "scripts": true,
+ "styles": {
+ "minify": true,
+ "inlineCritical": false
+ },
+ "fonts": true
+ },
"budgets": [
{
"type": "initial",
@@ -49,7 +57,7 @@
{
"type": "anyComponentStyle",
"maximumWarning": "2kB",
- "maximumError": "4kB"
+ "maximumError": "10kB"
}
],
"outputHashing": "all"
@@ -100,4 +108,4 @@
}
}
}
-}
+}
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index deba0cf..cf0a823 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -21,7 +21,7 @@
"bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3",
"express": "^4.18.2",
- "prismjs": "^1.29.0",
+ "prism-code-editor": "^4.0.0-beta.1",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.10"
@@ -33,7 +33,6 @@
"@types/express": "^4.17.17",
"@types/jasmine": "~5.1.0",
"@types/node": "^18.18.0",
- "@types/prismjs": "^1.26.4",
"jasmine-core": "~5.2.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
@@ -4577,12 +4576,6 @@
"@types/node": "*"
}
},
- "node_modules/@types/prismjs": {
- "version": "1.26.4",
- "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.4.tgz",
- "integrity": "sha512-rlAnzkW2sZOjbqZ743IHUhFcvzaGbqijwOu8QZnZCjfQzBqFE3s4lOTJEsxikImav9uzz/42I+O7YUs1mWgMlg==",
- "dev": true
- },
"node_modules/@types/qs": {
"version": "6.9.16",
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.16.tgz",
@@ -11263,14 +11256,11 @@
"dev": true,
"license": "MIT"
},
- "node_modules/prismjs": {
- "version": "1.29.0",
- "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz",
- "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==",
- "license": "MIT",
- "engines": {
- "node": ">=6"
- }
+ "node_modules/prism-code-editor": {
+ "version": "4.0.0-beta.1",
+ "resolved": "https://registry.npmjs.org/prism-code-editor/-/prism-code-editor-4.0.0-beta.1.tgz",
+ "integrity": "sha512-4coLI0t7P5+ICyoF5IUqatNbN0N5zj2trwpwSDHsg/q9/D3K5GKh3RxbM7U5lehFQiZqyfXE/RZTKacPZrUSlA==",
+ "license": "MIT"
},
"node_modules/proc-log": {
"version": "4.2.0",
diff --git a/package.json b/package.json
index 5286b2f..7214979 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
"bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3",
"express": "^4.18.2",
- "prismjs": "^1.29.0",
+ "prism-code-editor": "^4.0.0-beta.1",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.10"
@@ -37,7 +37,6 @@
"@types/express": "^4.17.17",
"@types/jasmine": "~5.1.0",
"@types/node": "^18.18.0",
- "@types/prismjs": "^1.26.4",
"jasmine-core": "~5.2.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
diff --git a/src/app/code-area/code-area.component.css b/src/app/code-area/code-area.component.css
index 575206d..38fefc6 100644
--- a/src/app/code-area/code-area.component.css
+++ b/src/app/code-area/code-area.component.css
@@ -1,6 +1,4 @@
-@import "../../../node_modules/prismjs/themes/prism-dark.min.css";
-
-:host.dark {
- background: #333;
- color: #FFF;
-}
\ No newline at end of file
+@import '../../../node_modules/prism-code-editor/dist/layout.css';
+@import '../../../node_modules/prism-code-editor/dist/themes/prism.css';
+@import '../../../node_modules/prism-code-editor/dist/themes/github-dark.css';
+@import '../../../node_modules/prism-code-editor/dist/copy.css';
diff --git a/src/app/code-area/code-area.component.ts b/src/app/code-area/code-area.component.ts
index a98bd86..bf76a66 100644
--- a/src/app/code-area/code-area.component.ts
+++ b/src/app/code-area/code-area.component.ts
@@ -1,44 +1,94 @@
-import { AfterViewInit, Component, ElementRef, HostListener, input, Input } from '@angular/core';
-import Prism from 'prismjs';
-import { debounceTime, Subject, takeLast, tap } from 'rxjs';
+import {
+ AfterViewInit,
+ Component,
+ ElementRef,
+ Inject,
+ Input,
+ input,
+ model,
+ OnChanges,
+ PLATFORM_ID,
+ SimpleChanges,
+ ViewChild,
+ ViewEncapsulation,
+} from "@angular/core";
+import { isPlatformBrowser } from "@angular/common";
+import { createEditor, PrismEditor } from "prism-code-editor";
+import { matchBrackets } from "prism-code-editor/match-brackets";
+import { highlightBracketPairs } from "prism-code-editor/highlight-brackets";
+import { editHistory } from "prism-code-editor/commands";
+import { copyButton } from "prism-code-editor/copy-button";
+import "prism-code-editor/prism/languages/json";
+import "prism-code-editor/prism/languages/yaml";
+import "prism-code-editor/prism/languages/toml";
+import "prism-code-editor/prism/languages/java";
+import "prism-code-editor/prism/languages/xml";
+import "prism-code-editor/prism/languages/csharp";
+import "prism-code-editor/prism/languages/typescript";
@Component({
- selector: 'code-area, [code-area]',
+ selector: 'code-area',
standalone: true,
imports: [],
- template: '
-
-
+
-
-
+