@nocturnium/svelte-ide 1.0.0-rc.1
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/LICENSE +21 -0
- package/README.md +251 -0
- package/dist/components/agents/AgentActivityPanel.svelte +565 -0
- package/dist/components/agents/AgentActivityPanel.svelte.d.ts +24 -0
- package/dist/components/agents/AgentAvatar.svelte +417 -0
- package/dist/components/agents/AgentAvatar.svelte.d.ts +23 -0
- package/dist/components/agents/AgentCursor.svelte +224 -0
- package/dist/components/agents/AgentCursor.svelte.d.ts +35 -0
- package/dist/components/agents/AgentPresenceBar.svelte +261 -0
- package/dist/components/agents/AgentPresenceBar.svelte.d.ts +20 -0
- package/dist/components/agents/index.d.ts +4 -0
- package/dist/components/agents/index.js +5 -0
- package/dist/components/ai/AIConversationList.svelte +524 -0
- package/dist/components/ai/AIConversationList.svelte.d.ts +17 -0
- package/dist/components/ai/AIEditPreview.svelte +132 -0
- package/dist/components/ai/AIEditPreview.svelte.d.ts +8 -0
- package/dist/components/ai/AIInlineEdit.svelte +155 -0
- package/dist/components/ai/AIInlineEdit.svelte.d.ts +10 -0
- package/dist/components/ai/AIMessage.svelte +239 -0
- package/dist/components/ai/AIMessage.svelte.d.ts +13 -0
- package/dist/components/ai/AIMessageActions.svelte +176 -0
- package/dist/components/ai/AIMessageActions.svelte.d.ts +12 -0
- package/dist/components/ai/AIMessageContent.svelte +355 -0
- package/dist/components/ai/AIMessageContent.svelte.d.ts +7 -0
- package/dist/components/ai/AIPanel.svelte +561 -0
- package/dist/components/ai/AIPanel.svelte.d.ts +7 -0
- package/dist/components/ai/AISuggestionWidget.svelte +132 -0
- package/dist/components/ai/AISuggestionWidget.svelte.d.ts +10 -0
- package/dist/components/ai/AIToolCallDisplay.svelte +317 -0
- package/dist/components/ai/AIToolCallDisplay.svelte.d.ts +12 -0
- package/dist/components/ai/index.d.ts +9 -0
- package/dist/components/ai/index.js +10 -0
- package/dist/components/core/Avatar.svelte +110 -0
- package/dist/components/core/Avatar.svelte.d.ts +12 -0
- package/dist/components/core/Badge.svelte +98 -0
- package/dist/components/core/Badge.svelte.d.ts +11 -0
- package/dist/components/core/Button.svelte +175 -0
- package/dist/components/core/Button.svelte.d.ts +18 -0
- package/dist/components/core/ConnectionStatus.svelte +294 -0
- package/dist/components/core/ConnectionStatus.svelte.d.ts +20 -0
- package/dist/components/core/ContextMenu.svelte +176 -0
- package/dist/components/core/ContextMenu.svelte.d.ts +19 -0
- package/dist/components/core/ErrorBoundary.svelte +277 -0
- package/dist/components/core/ErrorBoundary.svelte.d.ts +23 -0
- package/dist/components/core/Icon.svelte +107 -0
- package/dist/components/core/Icon.svelte.d.ts +8 -0
- package/dist/components/core/Input.svelte +138 -0
- package/dist/components/core/Input.svelte.d.ts +20 -0
- package/dist/components/core/Kbd.svelte +34 -0
- package/dist/components/core/Kbd.svelte.d.ts +7 -0
- package/dist/components/core/ResizeHandle.svelte +200 -0
- package/dist/components/core/ResizeHandle.svelte.d.ts +23 -0
- package/dist/components/core/Spinner.svelte +35 -0
- package/dist/components/core/Spinner.svelte.d.ts +7 -0
- package/dist/components/core/Textarea.svelte +112 -0
- package/dist/components/core/Textarea.svelte.d.ts +18 -0
- package/dist/components/core/Tooltip.svelte +103 -0
- package/dist/components/core/Tooltip.svelte.d.ts +11 -0
- package/dist/components/core/index.d.ts +13 -0
- package/dist/components/core/index.js +14 -0
- package/dist/components/editor/AIFocusLayer.svelte +430 -0
- package/dist/components/editor/AIFocusLayer.svelte.d.ts +32 -0
- package/dist/components/editor/Breadcrumbs.svelte +435 -0
- package/dist/components/editor/Breadcrumbs.svelte.d.ts +33 -0
- package/dist/components/editor/BreakpointLayer.svelte +642 -0
- package/dist/components/editor/BreakpointLayer.svelte.d.ts +20 -0
- package/dist/components/editor/CognitiveLoadMeter.svelte +324 -0
- package/dist/components/editor/CognitiveLoadMeter.svelte.d.ts +18 -0
- package/dist/components/editor/CollaborativeEditor.svelte +218 -0
- package/dist/components/editor/CollaborativeEditor.svelte.d.ts +32 -0
- package/dist/components/editor/CommandPalette.svelte +434 -0
- package/dist/components/editor/CommandPalette.svelte.d.ts +11 -0
- package/dist/components/editor/ComplexityLayer.svelte +293 -0
- package/dist/components/editor/ComplexityLayer.svelte.d.ts +23 -0
- package/dist/components/editor/ConflictZoneLayer.svelte +441 -0
- package/dist/components/editor/ConflictZoneLayer.svelte.d.ts +25 -0
- package/dist/components/editor/ContextLens.svelte +262 -0
- package/dist/components/editor/ContextLens.svelte.d.ts +27 -0
- package/dist/components/editor/CustomEditor.svelte +1242 -0
- package/dist/components/editor/CustomEditor.svelte.d.ts +37 -0
- package/dist/components/editor/DebugConsole.svelte +646 -0
- package/dist/components/editor/DebugConsole.svelte.d.ts +41 -0
- package/dist/components/editor/EchoCursorLayer.svelte +363 -0
- package/dist/components/editor/EchoCursorLayer.svelte.d.ts +24 -0
- package/dist/components/editor/Editor.svelte +61 -0
- package/dist/components/editor/Editor.svelte.d.ts +22 -0
- package/dist/components/editor/EditorGutter.svelte +119 -0
- package/dist/components/editor/EditorGutter.svelte.d.ts +19 -0
- package/dist/components/editor/EditorLines.svelte +182 -0
- package/dist/components/editor/EditorLines.svelte.d.ts +43 -0
- package/dist/components/editor/EditorPane.svelte +134 -0
- package/dist/components/editor/EditorPane.svelte.d.ts +9 -0
- package/dist/components/editor/EditorSelections.svelte +186 -0
- package/dist/components/editor/EditorSelections.svelte.d.ts +25 -0
- package/dist/components/editor/EditorTabs.svelte +170 -0
- package/dist/components/editor/EditorTabs.svelte.d.ts +12 -0
- package/dist/components/editor/FileExplorer.svelte +811 -0
- package/dist/components/editor/FileExplorer.svelte.d.ts +67 -0
- package/dist/components/editor/FileIcon.svelte +110 -0
- package/dist/components/editor/FileIcon.svelte.d.ts +10 -0
- package/dist/components/editor/FindReplace.svelte +448 -0
- package/dist/components/editor/FindReplace.svelte.d.ts +40 -0
- package/dist/components/editor/GhostBracketLayer.svelte +391 -0
- package/dist/components/editor/GhostBracketLayer.svelte.d.ts +24 -0
- package/dist/components/editor/GitBlameLayer.svelte +436 -0
- package/dist/components/editor/GitBlameLayer.svelte.d.ts +18 -0
- package/dist/components/editor/InlineDiagnosticsLayer.svelte +540 -0
- package/dist/components/editor/InlineDiagnosticsLayer.svelte.d.ts +35 -0
- package/dist/components/editor/InlineDiffLayer.svelte +337 -0
- package/dist/components/editor/InlineDiffLayer.svelte.d.ts +31 -0
- package/dist/components/editor/MinimalEditor.svelte +75 -0
- package/dist/components/editor/MinimalEditor.svelte.d.ts +6 -0
- package/dist/components/editor/MinimalEditor2.svelte +84 -0
- package/dist/components/editor/MinimalEditor2.svelte.d.ts +6 -0
- package/dist/components/editor/Minimap.svelte +327 -0
- package/dist/components/editor/Minimap.svelte.d.ts +34 -0
- package/dist/components/editor/PluginPreviewSandbox.svelte +793 -0
- package/dist/components/editor/PluginPreviewSandbox.svelte.d.ts +49 -0
- package/dist/components/editor/ProblemsPanel.svelte +628 -0
- package/dist/components/editor/ProblemsPanel.svelte.d.ts +25 -0
- package/dist/components/editor/QuickActionsMenu.svelte +403 -0
- package/dist/components/editor/QuickActionsMenu.svelte.d.ts +18 -0
- package/dist/components/editor/SnippetPalette.svelte +530 -0
- package/dist/components/editor/SnippetPalette.svelte.d.ts +16 -0
- package/dist/components/editor/StructureMap.svelte +431 -0
- package/dist/components/editor/StructureMap.svelte.d.ts +37 -0
- package/dist/components/editor/SymbolOutline.svelte +722 -0
- package/dist/components/editor/SymbolOutline.svelte.d.ts +44 -0
- package/dist/components/editor/TimelineScrubber.svelte +470 -0
- package/dist/components/editor/TimelineScrubber.svelte.d.ts +40 -0
- package/dist/components/editor/TokenRenderer.svelte +69 -0
- package/dist/components/editor/TokenRenderer.svelte.d.ts +15 -0
- package/dist/components/editor/constants.d.ts +32 -0
- package/dist/components/editor/constants.js +36 -0
- package/dist/components/editor/core/ai-awareness.d.ts +176 -0
- package/dist/components/editor/core/ai-awareness.js +210 -0
- package/dist/components/editor/core/bracket-healer.d.ts +189 -0
- package/dist/components/editor/core/bracket-healer.js +406 -0
- package/dist/components/editor/core/breakpoints.d.ts +203 -0
- package/dist/components/editor/core/breakpoints.js +414 -0
- package/dist/components/editor/core/commands.d.ts +108 -0
- package/dist/components/editor/core/commands.js +246 -0
- package/dist/components/editor/core/complexity-analyzer.d.ts +123 -0
- package/dist/components/editor/core/complexity-analyzer.js +376 -0
- package/dist/components/editor/core/conflict-predictor.d.ts +135 -0
- package/dist/components/editor/core/conflict-predictor.js +316 -0
- package/dist/components/editor/core/crdt-binding.d.ts +118 -0
- package/dist/components/editor/core/crdt-binding.js +286 -0
- package/dist/components/editor/core/diagnostics.d.ts +210 -0
- package/dist/components/editor/core/diagnostics.js +335 -0
- package/dist/components/editor/core/echo-cursor.d.ts +201 -0
- package/dist/components/editor/core/echo-cursor.js +267 -0
- package/dist/components/editor/core/folding.d.ts +124 -0
- package/dist/components/editor/core/folding.js +672 -0
- package/dist/components/editor/core/ghost-pair.d.ts +122 -0
- package/dist/components/editor/core/ghost-pair.js +221 -0
- package/dist/components/editor/core/git-blame.d.ts +170 -0
- package/dist/components/editor/core/git-blame.js +324 -0
- package/dist/components/editor/core/index.d.ts +26 -0
- package/dist/components/editor/core/index.js +24 -0
- package/dist/components/editor/core/keybindings.d.ts +79 -0
- package/dist/components/editor/core/keybindings.js +357 -0
- package/dist/components/editor/core/multi-cursor.d.ts +196 -0
- package/dist/components/editor/core/multi-cursor.js +521 -0
- package/dist/components/editor/core/navigation.d.ts +107 -0
- package/dist/components/editor/core/navigation.js +408 -0
- package/dist/components/editor/core/quick-actions.d.ts +189 -0
- package/dist/components/editor/core/quick-actions.js +427 -0
- package/dist/components/editor/core/search.d.ts +88 -0
- package/dist/components/editor/core/search.js +192 -0
- package/dist/components/editor/core/semantic-analyzer.d.ts +77 -0
- package/dist/components/editor/core/semantic-analyzer.js +424 -0
- package/dist/components/editor/core/snippet-manager.d.ts +202 -0
- package/dist/components/editor/core/snippet-manager.js +565 -0
- package/dist/components/editor/core/state.d.ts +367 -0
- package/dist/components/editor/core/state.js +900 -0
- package/dist/components/editor/core/timeline.d.ts +204 -0
- package/dist/components/editor/core/timeline.js +349 -0
- package/dist/components/editor/editor-find.d.ts +56 -0
- package/dist/components/editor/editor-find.js +148 -0
- package/dist/components/editor/editor-input.d.ts +77 -0
- package/dist/components/editor/editor-input.js +445 -0
- package/dist/components/editor/editor-multicursor.d.ts +21 -0
- package/dist/components/editor/editor-multicursor.js +196 -0
- package/dist/components/editor/editor-scroll.d.ts +14 -0
- package/dist/components/editor/editor-scroll.js +34 -0
- package/dist/components/editor/index.d.ts +15 -0
- package/dist/components/editor/index.js +21 -0
- package/dist/components/editor/languages.d.ts +62 -0
- package/dist/components/editor/languages.js +285 -0
- package/dist/components/editor/theme.d.ts +88 -0
- package/dist/components/editor/theme.js +139 -0
- package/dist/components/editor/tokenizer/base.d.ts +40 -0
- package/dist/components/editor/tokenizer/base.js +203 -0
- package/dist/components/editor/tokenizer/index.d.ts +56 -0
- package/dist/components/editor/tokenizer/index.js +215 -0
- package/dist/components/editor/tokenizer/languages/css.d.ts +17 -0
- package/dist/components/editor/tokenizer/languages/css.js +194 -0
- package/dist/components/editor/tokenizer/languages/go.d.ts +17 -0
- package/dist/components/editor/tokenizer/languages/go.js +220 -0
- package/dist/components/editor/tokenizer/languages/html.d.ts +24 -0
- package/dist/components/editor/tokenizer/languages/html.js +145 -0
- package/dist/components/editor/tokenizer/languages/javascript.d.ts +56 -0
- package/dist/components/editor/tokenizer/languages/javascript.js +452 -0
- package/dist/components/editor/tokenizer/languages/json.d.ts +12 -0
- package/dist/components/editor/tokenizer/languages/json.js +91 -0
- package/dist/components/editor/tokenizer/languages/markdown.d.ts +16 -0
- package/dist/components/editor/tokenizer/languages/markdown.js +156 -0
- package/dist/components/editor/tokenizer/languages/python.d.ts +20 -0
- package/dist/components/editor/tokenizer/languages/python.js +227 -0
- package/dist/components/editor/tokenizer/languages/svelte.d.ts +40 -0
- package/dist/components/editor/tokenizer/languages/svelte.js +326 -0
- package/dist/components/editor/tokenizer/types.d.ts +86 -0
- package/dist/components/editor/tokenizer/types.js +4 -0
- package/dist/components/layout/IDELayout.svelte +274 -0
- package/dist/components/layout/IDELayout.svelte.d.ts +29 -0
- package/dist/components/layout/StatusBar.svelte +511 -0
- package/dist/components/layout/StatusBar.svelte.d.ts +47 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.js +3 -0
- package/dist/components/lsp/AutocompleteWidget.svelte +364 -0
- package/dist/components/lsp/AutocompleteWidget.svelte.d.ts +33 -0
- package/dist/components/lsp/DiagnosticMarker.svelte +166 -0
- package/dist/components/lsp/DiagnosticMarker.svelte.d.ts +19 -0
- package/dist/components/lsp/DiagnosticsPanel.svelte +388 -0
- package/dist/components/lsp/DiagnosticsPanel.svelte.d.ts +21 -0
- package/dist/components/lsp/HoverTooltip.svelte +274 -0
- package/dist/components/lsp/HoverTooltip.svelte.d.ts +24 -0
- package/dist/components/lsp/LSPEditor.svelte +486 -0
- package/dist/components/lsp/LSPEditor.svelte.d.ts +39 -0
- package/dist/components/lsp/SignatureHelpWidget.svelte +216 -0
- package/dist/components/lsp/SignatureHelpWidget.svelte.d.ts +22 -0
- package/dist/components/lsp/index.d.ts +6 -0
- package/dist/components/lsp/index.js +7 -0
- package/dist/components/plugins/PluginCard.svelte +153 -0
- package/dist/components/plugins/PluginCard.svelte.d.ts +19 -0
- package/dist/components/plugins/PluginPanel.svelte +280 -0
- package/dist/components/plugins/PluginPanel.svelte.d.ts +8 -0
- package/dist/components/plugins/PluginProposalForm.svelte +250 -0
- package/dist/components/plugins/PluginProposalForm.svelte.d.ts +6 -0
- package/dist/components/plugins/PluginStatusBadge.svelte +14 -0
- package/dist/components/plugins/PluginStatusBadge.svelte.d.ts +8 -0
- package/dist/components/plugins/index.d.ts +4 -0
- package/dist/components/plugins/index.js +5 -0
- package/dist/components/vfs/LockConflictDialog.svelte +705 -0
- package/dist/components/vfs/LockConflictDialog.svelte.d.ts +21 -0
- package/dist/components/vfs/LockIndicator.svelte +194 -0
- package/dist/components/vfs/LockIndicator.svelte.d.ts +29 -0
- package/dist/components/vfs/LockOverlay.svelte +344 -0
- package/dist/components/vfs/LockOverlay.svelte.d.ts +17 -0
- package/dist/components/vfs/VersionConflictDialog.svelte +549 -0
- package/dist/components/vfs/VersionConflictDialog.svelte.d.ts +24 -0
- package/dist/components/vfs/index.d.ts +4 -0
- package/dist/components/vfs/index.js +5 -0
- package/dist/crdt/awareness.d.ts +42 -0
- package/dist/crdt/awareness.js +109 -0
- package/dist/crdt/document.d.ts +101 -0
- package/dist/crdt/document.js +187 -0
- package/dist/crdt/index.d.ts +9 -0
- package/dist/crdt/index.js +8 -0
- package/dist/crdt/provider.d.ts +85 -0
- package/dist/crdt/provider.js +150 -0
- package/dist/crdt/types.d.ts +61 -0
- package/dist/crdt/types.js +4 -0
- package/dist/crdt/undo.d.ts +34 -0
- package/dist/crdt/undo.js +70 -0
- package/dist/index.d.ts +277 -0
- package/dist/index.js +280 -0
- package/dist/plugins/index.d.ts +103 -0
- package/dist/plugins/index.js +153 -0
- package/dist/services/error-handling.d.ts +95 -0
- package/dist/services/error-handling.js +413 -0
- package/dist/services/ide-integration.d.ts +83 -0
- package/dist/services/ide-integration.js +367 -0
- package/dist/services/lsp-client.d.ts +69 -0
- package/dist/services/lsp-client.js +667 -0
- package/dist/services/mock-ai.d.ts +37 -0
- package/dist/services/mock-ai.js +318 -0
- package/dist/services/optimistic.d.ts +141 -0
- package/dist/services/optimistic.js +367 -0
- package/dist/services/vfs-client.d.ts +81 -0
- package/dist/services/vfs-client.js +348 -0
- package/dist/stores/agents.svelte.d.ts +85 -0
- package/dist/stores/agents.svelte.js +459 -0
- package/dist/stores/ai-persistence.svelte.d.ts +76 -0
- package/dist/stores/ai-persistence.svelte.js +334 -0
- package/dist/stores/ai.svelte.d.ts +140 -0
- package/dist/stores/ai.svelte.js +383 -0
- package/dist/stores/collaboration.svelte.d.ts +164 -0
- package/dist/stores/collaboration.svelte.js +334 -0
- package/dist/stores/editor.svelte.d.ts +131 -0
- package/dist/stores/editor.svelte.js +250 -0
- package/dist/stores/index.d.ts +10 -0
- package/dist/stores/index.js +29 -0
- package/dist/stores/layout.svelte.d.ts +171 -0
- package/dist/stores/layout.svelte.js +351 -0
- package/dist/stores/plugin.svelte.d.ts +121 -0
- package/dist/stores/plugin.svelte.js +410 -0
- package/dist/stores/vfs.svelte.d.ts +123 -0
- package/dist/stores/vfs.svelte.js +680 -0
- package/dist/styles/theme.css +623 -0
- package/dist/types/agents.d.ts +127 -0
- package/dist/types/agents.js +5 -0
- package/dist/types/ai.d.ts +137 -0
- package/dist/types/ai.js +4 -0
- package/dist/types/crdt.d.ts +222 -0
- package/dist/types/crdt.js +5 -0
- package/dist/types/editor.d.ts +52 -0
- package/dist/types/editor.js +18 -0
- package/dist/types/events.d.ts +133 -0
- package/dist/types/events.js +4 -0
- package/dist/types/filesystem.d.ts +77 -0
- package/dist/types/filesystem.js +4 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.js +12 -0
- package/dist/types/lsp.d.ts +691 -0
- package/dist/types/lsp.js +108 -0
- package/dist/types/plugin.d.ts +239 -0
- package/dist/types/plugin.js +5 -0
- package/dist/types/vfs.d.ts +191 -0
- package/dist/types/vfs.js +18 -0
- package/dist/utils/format.d.ts +55 -0
- package/dist/utils/format.js +152 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/keybindings.d.ts +33 -0
- package/dist/utils/keybindings.js +171 -0
- package/dist/utils/language.d.ts +27 -0
- package/dist/utils/language.js +222 -0
- package/package.json +178 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nocturnium theme configuration for the custom editor
|
|
3
|
+
*
|
|
4
|
+
* This module exports theme tokens and CSS variable names used by the editor.
|
|
5
|
+
* The actual styling is applied via CSS variables and token classes.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Token color mappings for syntax highlighting
|
|
9
|
+
*/
|
|
10
|
+
export declare const tokenColors: {
|
|
11
|
+
readonly comment: "var(--ide-text-muted)";
|
|
12
|
+
readonly string: "var(--color-nocturnium-aurora-green)";
|
|
13
|
+
readonly stringTemplate: "var(--color-nocturnium-aurora-green)";
|
|
14
|
+
readonly stringRegex: "var(--color-nocturnium-aurora-pink)";
|
|
15
|
+
readonly stringEscape: "var(--color-nocturnium-aurora-yellow)";
|
|
16
|
+
readonly number: "var(--color-nocturnium-aurora-yellow)";
|
|
17
|
+
readonly keyword: "var(--color-nocturnium-aurora-purple)";
|
|
18
|
+
readonly keywordControl: "var(--color-nocturnium-aurora-purple)";
|
|
19
|
+
readonly keywordDefinition: "var(--color-nocturnium-aurora-purple)";
|
|
20
|
+
readonly keywordModule: "var(--color-nocturnium-aurora-purple)";
|
|
21
|
+
readonly operator: "var(--ide-text-primary)";
|
|
22
|
+
readonly variable: "var(--ide-text-primary)";
|
|
23
|
+
readonly variableDefinition: "var(--color-nocturnium-wave)";
|
|
24
|
+
readonly variableParameter: "color-mix(in srgb, var(--color-nocturnium-wave) 80%, var(--ide-text-muted))";
|
|
25
|
+
readonly function: "var(--color-nocturnium-aurora-blue)";
|
|
26
|
+
readonly functionCall: "var(--color-nocturnium-aurora-blue)";
|
|
27
|
+
readonly functionDefinition: "var(--color-nocturnium-aurora-blue)";
|
|
28
|
+
readonly property: "var(--color-nocturnium-wave)";
|
|
29
|
+
readonly type: "var(--color-nocturnium-teal)";
|
|
30
|
+
readonly typeClass: "var(--color-nocturnium-teal)";
|
|
31
|
+
readonly typeBuiltin: "var(--color-nocturnium-teal)";
|
|
32
|
+
readonly constant: "var(--color-nocturnium-aurora-yellow)";
|
|
33
|
+
readonly constantBoolean: "var(--color-nocturnium-aurora-yellow)";
|
|
34
|
+
readonly constantNull: "var(--color-nocturnium-aurora-yellow)";
|
|
35
|
+
readonly punctuation: "var(--ide-text-secondary)";
|
|
36
|
+
readonly tag: "var(--color-nocturnium-aurora-pink)";
|
|
37
|
+
readonly tagAttribute: "var(--color-nocturnium-aurora-yellow)";
|
|
38
|
+
readonly tagAttributeValue: "var(--color-nocturnium-aurora-green)";
|
|
39
|
+
readonly markupHeading: "var(--color-nocturnium-aurora-blue)";
|
|
40
|
+
readonly markupLink: "var(--color-nocturnium-wave)";
|
|
41
|
+
readonly markupCode: "var(--color-nocturnium-aurora-green)";
|
|
42
|
+
readonly markupQuote: "var(--ide-text-secondary)";
|
|
43
|
+
readonly markupList: "var(--color-nocturnium-ember)";
|
|
44
|
+
readonly invalid: "var(--ide-error)";
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Editor UI colors
|
|
48
|
+
*/
|
|
49
|
+
export declare const editorColors: {
|
|
50
|
+
readonly background: "var(--ide-bg-primary)";
|
|
51
|
+
readonly backgroundSecondary: "var(--ide-bg-secondary)";
|
|
52
|
+
readonly backgroundElevated: "var(--ide-bg-elevated)";
|
|
53
|
+
readonly backgroundTertiary: "var(--ide-bg-tertiary)";
|
|
54
|
+
readonly text: "var(--ide-text-primary)";
|
|
55
|
+
readonly textSecondary: "var(--ide-text-secondary)";
|
|
56
|
+
readonly textMuted: "var(--ide-text-muted)";
|
|
57
|
+
readonly cursor: "var(--ide-interactive)";
|
|
58
|
+
readonly selection: "var(--ide-bg-tertiary)";
|
|
59
|
+
readonly selectionMatch: "color-mix(in srgb, var(--ide-interactive) 20%, transparent)";
|
|
60
|
+
readonly searchMatch: "color-mix(in srgb, var(--ide-warning) 30%, transparent)";
|
|
61
|
+
readonly searchMatchSelected: "color-mix(in srgb, var(--ide-interactive) 30%, transparent)";
|
|
62
|
+
readonly bracketMatch: "color-mix(in srgb, var(--ide-interactive) 30%, transparent)";
|
|
63
|
+
readonly bracketMatchOutline: "var(--ide-interactive)";
|
|
64
|
+
readonly gutter: "var(--ide-bg-secondary)";
|
|
65
|
+
readonly gutterBorder: "var(--ide-border)";
|
|
66
|
+
readonly lineNumber: "var(--ide-text-muted)";
|
|
67
|
+
readonly lineNumberActive: "var(--ide-text-secondary)";
|
|
68
|
+
readonly activeLine: "var(--ide-bg-elevated)";
|
|
69
|
+
readonly border: "var(--ide-border)";
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Editor theme configuration
|
|
73
|
+
*/
|
|
74
|
+
export interface EditorTheme {
|
|
75
|
+
name: string;
|
|
76
|
+
isDark: boolean;
|
|
77
|
+
tokenColors: typeof tokenColors;
|
|
78
|
+
editorColors: typeof editorColors;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Default Nocturnium theme
|
|
82
|
+
*/
|
|
83
|
+
export declare const nocturniumTheme: EditorTheme;
|
|
84
|
+
/**
|
|
85
|
+
* Get CSS custom properties for the theme
|
|
86
|
+
*/
|
|
87
|
+
export declare function getThemeCSS(theme?: EditorTheme): string;
|
|
88
|
+
export default nocturniumTheme;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nocturnium theme configuration for the custom editor
|
|
3
|
+
*
|
|
4
|
+
* This module exports theme tokens and CSS variable names used by the editor.
|
|
5
|
+
* The actual styling is applied via CSS variables and token classes.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Token color mappings for syntax highlighting
|
|
9
|
+
*/
|
|
10
|
+
export const tokenColors = {
|
|
11
|
+
// Comments
|
|
12
|
+
comment: 'var(--ide-text-muted)',
|
|
13
|
+
// Strings
|
|
14
|
+
string: 'var(--color-nocturnium-aurora-green)',
|
|
15
|
+
stringTemplate: 'var(--color-nocturnium-aurora-green)',
|
|
16
|
+
stringRegex: 'var(--color-nocturnium-aurora-pink)',
|
|
17
|
+
stringEscape: 'var(--color-nocturnium-aurora-yellow)',
|
|
18
|
+
// Numbers
|
|
19
|
+
number: 'var(--color-nocturnium-aurora-yellow)',
|
|
20
|
+
// Keywords
|
|
21
|
+
keyword: 'var(--color-nocturnium-aurora-purple)',
|
|
22
|
+
keywordControl: 'var(--color-nocturnium-aurora-purple)',
|
|
23
|
+
keywordDefinition: 'var(--color-nocturnium-aurora-purple)',
|
|
24
|
+
keywordModule: 'var(--color-nocturnium-aurora-purple)',
|
|
25
|
+
// Operators
|
|
26
|
+
operator: 'var(--ide-text-primary)',
|
|
27
|
+
// Variables
|
|
28
|
+
variable: 'var(--ide-text-primary)',
|
|
29
|
+
variableDefinition: 'var(--color-nocturnium-wave)',
|
|
30
|
+
variableParameter: 'color-mix(in srgb, var(--color-nocturnium-wave) 80%, var(--ide-text-muted))',
|
|
31
|
+
// Functions
|
|
32
|
+
function: 'var(--color-nocturnium-aurora-blue)',
|
|
33
|
+
functionCall: 'var(--color-nocturnium-aurora-blue)',
|
|
34
|
+
functionDefinition: 'var(--color-nocturnium-aurora-blue)',
|
|
35
|
+
// Properties
|
|
36
|
+
property: 'var(--color-nocturnium-wave)',
|
|
37
|
+
// Types (distinct teal hue so types read differently from numbers/constants)
|
|
38
|
+
type: 'var(--color-nocturnium-teal)',
|
|
39
|
+
typeClass: 'var(--color-nocturnium-teal)',
|
|
40
|
+
typeBuiltin: 'var(--color-nocturnium-teal)',
|
|
41
|
+
// Constants
|
|
42
|
+
constant: 'var(--color-nocturnium-aurora-yellow)',
|
|
43
|
+
constantBoolean: 'var(--color-nocturnium-aurora-yellow)',
|
|
44
|
+
constantNull: 'var(--color-nocturnium-aurora-yellow)',
|
|
45
|
+
// Punctuation
|
|
46
|
+
punctuation: 'var(--ide-text-secondary)',
|
|
47
|
+
// Tags (HTML/XML)
|
|
48
|
+
tag: 'var(--color-nocturnium-aurora-pink)',
|
|
49
|
+
tagAttribute: 'var(--color-nocturnium-aurora-yellow)',
|
|
50
|
+
tagAttributeValue: 'var(--color-nocturnium-aurora-green)',
|
|
51
|
+
// Markup (Markdown)
|
|
52
|
+
markupHeading: 'var(--color-nocturnium-aurora-blue)',
|
|
53
|
+
markupLink: 'var(--color-nocturnium-wave)',
|
|
54
|
+
markupCode: 'var(--color-nocturnium-aurora-green)',
|
|
55
|
+
markupQuote: 'var(--ide-text-secondary)',
|
|
56
|
+
markupList: 'var(--color-nocturnium-ember)',
|
|
57
|
+
// Invalid
|
|
58
|
+
invalid: 'var(--ide-error)'
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Editor UI colors
|
|
62
|
+
*/
|
|
63
|
+
export const editorColors = {
|
|
64
|
+
// Backgrounds
|
|
65
|
+
background: 'var(--ide-bg-primary)',
|
|
66
|
+
backgroundSecondary: 'var(--ide-bg-secondary)',
|
|
67
|
+
backgroundElevated: 'var(--ide-bg-elevated)',
|
|
68
|
+
backgroundTertiary: 'var(--ide-bg-tertiary)',
|
|
69
|
+
// Text
|
|
70
|
+
text: 'var(--ide-text-primary)',
|
|
71
|
+
textSecondary: 'var(--ide-text-secondary)',
|
|
72
|
+
textMuted: 'var(--ide-text-muted)',
|
|
73
|
+
// Interactive
|
|
74
|
+
cursor: 'var(--ide-interactive)',
|
|
75
|
+
selection: 'var(--ide-bg-tertiary)',
|
|
76
|
+
selectionMatch: 'color-mix(in srgb, var(--ide-interactive) 20%, transparent)',
|
|
77
|
+
// Search
|
|
78
|
+
searchMatch: 'color-mix(in srgb, var(--ide-warning) 30%, transparent)',
|
|
79
|
+
searchMatchSelected: 'color-mix(in srgb, var(--ide-interactive) 30%, transparent)',
|
|
80
|
+
// Brackets
|
|
81
|
+
bracketMatch: 'color-mix(in srgb, var(--ide-interactive) 30%, transparent)',
|
|
82
|
+
bracketMatchOutline: 'var(--ide-interactive)',
|
|
83
|
+
// Gutter
|
|
84
|
+
gutter: 'var(--ide-bg-secondary)',
|
|
85
|
+
gutterBorder: 'var(--ide-border)',
|
|
86
|
+
lineNumber: 'var(--ide-text-muted)',
|
|
87
|
+
lineNumberActive: 'var(--ide-text-secondary)',
|
|
88
|
+
// Active line
|
|
89
|
+
activeLine: 'var(--ide-bg-elevated)',
|
|
90
|
+
// Borders
|
|
91
|
+
border: 'var(--ide-border)'
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Default Nocturnium theme
|
|
95
|
+
*/
|
|
96
|
+
export const nocturniumTheme = {
|
|
97
|
+
name: 'nocturnium',
|
|
98
|
+
isDark: true,
|
|
99
|
+
tokenColors,
|
|
100
|
+
editorColors
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Get CSS custom properties for the theme
|
|
104
|
+
*/
|
|
105
|
+
export function getThemeCSS(theme = nocturniumTheme) {
|
|
106
|
+
return `
|
|
107
|
+
/* Token Colors */
|
|
108
|
+
--editor-token-comment: ${theme.tokenColors.comment};
|
|
109
|
+
--editor-token-string: ${theme.tokenColors.string};
|
|
110
|
+
--editor-token-number: ${theme.tokenColors.number};
|
|
111
|
+
--editor-token-keyword: ${theme.tokenColors.keyword};
|
|
112
|
+
--editor-token-operator: ${theme.tokenColors.operator};
|
|
113
|
+
--editor-token-variable: ${theme.tokenColors.variable};
|
|
114
|
+
--editor-token-function: ${theme.tokenColors.function};
|
|
115
|
+
--editor-token-property: ${theme.tokenColors.property};
|
|
116
|
+
--editor-token-type: ${theme.tokenColors.type};
|
|
117
|
+
--editor-token-constant: ${theme.tokenColors.constant};
|
|
118
|
+
--editor-token-punctuation: ${theme.tokenColors.punctuation};
|
|
119
|
+
--editor-token-tag: ${theme.tokenColors.tag};
|
|
120
|
+
--editor-token-invalid: ${theme.tokenColors.invalid};
|
|
121
|
+
|
|
122
|
+
/* Editor Colors */
|
|
123
|
+
--editor-bg: ${theme.editorColors.background};
|
|
124
|
+
--editor-bg-secondary: ${theme.editorColors.backgroundSecondary};
|
|
125
|
+
--editor-bg-elevated: ${theme.editorColors.backgroundElevated};
|
|
126
|
+
--editor-text: ${theme.editorColors.text};
|
|
127
|
+
--editor-text-secondary: ${theme.editorColors.textSecondary};
|
|
128
|
+
--editor-text-muted: ${theme.editorColors.textMuted};
|
|
129
|
+
--editor-cursor: ${theme.editorColors.cursor};
|
|
130
|
+
--editor-selection: ${theme.editorColors.selection};
|
|
131
|
+
--editor-gutter: ${theme.editorColors.gutter};
|
|
132
|
+
--editor-gutter-border: ${theme.editorColors.gutterBorder};
|
|
133
|
+
--editor-line-number: ${theme.editorColors.lineNumber};
|
|
134
|
+
--editor-line-number-active: ${theme.editorColors.lineNumberActive};
|
|
135
|
+
--editor-active-line: ${theme.editorColors.activeLine};
|
|
136
|
+
--editor-border: ${theme.editorColors.border};
|
|
137
|
+
`;
|
|
138
|
+
}
|
|
139
|
+
export default nocturniumTheme;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base tokenizer with common functionality
|
|
3
|
+
*/
|
|
4
|
+
import type { Token, TokenizedLine, TokenizerState, TokenType, LanguageGrammar, LanguageTokenizer } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Create a token
|
|
7
|
+
*/
|
|
8
|
+
export declare function createToken(type: TokenType, text: string, start: number): Token;
|
|
9
|
+
/**
|
|
10
|
+
* Base tokenizer class using grammar rules
|
|
11
|
+
*/
|
|
12
|
+
export declare class GrammarTokenizer implements LanguageTokenizer {
|
|
13
|
+
language: string;
|
|
14
|
+
private grammar;
|
|
15
|
+
constructor(grammar: LanguageGrammar);
|
|
16
|
+
getInitialState(): TokenizerState;
|
|
17
|
+
tokenizeLine(line: string, lineNumber: number, prevState?: TokenizerState): TokenizedLine;
|
|
18
|
+
private updateState;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Simple regex-based tokenizer for basic languages
|
|
22
|
+
*/
|
|
23
|
+
export declare class SimpleTokenizer implements LanguageTokenizer {
|
|
24
|
+
language: string;
|
|
25
|
+
private patterns;
|
|
26
|
+
constructor(language: string, patterns: Array<{
|
|
27
|
+
type: TokenType;
|
|
28
|
+
regex: RegExp;
|
|
29
|
+
}>);
|
|
30
|
+
getInitialState(): TokenizerState;
|
|
31
|
+
tokenizeLine(line: string, lineNumber: number, prevState?: TokenizerState): TokenizedLine;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Plaintext tokenizer - no highlighting
|
|
35
|
+
*/
|
|
36
|
+
export declare class PlaintextTokenizer implements LanguageTokenizer {
|
|
37
|
+
language: string;
|
|
38
|
+
getInitialState(): TokenizerState;
|
|
39
|
+
tokenizeLine(line: string, lineNumber: number): TokenizedLine;
|
|
40
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base tokenizer with common functionality
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Create a token
|
|
6
|
+
*/
|
|
7
|
+
export function createToken(type, text, start) {
|
|
8
|
+
return {
|
|
9
|
+
type,
|
|
10
|
+
text,
|
|
11
|
+
start,
|
|
12
|
+
end: start + text.length
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Base tokenizer class using grammar rules
|
|
17
|
+
*/
|
|
18
|
+
export class GrammarTokenizer {
|
|
19
|
+
language;
|
|
20
|
+
grammar;
|
|
21
|
+
constructor(grammar) {
|
|
22
|
+
this.language = grammar.language;
|
|
23
|
+
this.grammar = grammar;
|
|
24
|
+
}
|
|
25
|
+
getInitialState() {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
tokenizeLine(line, lineNumber, prevState) {
|
|
29
|
+
const tokens = [];
|
|
30
|
+
let pos = 0;
|
|
31
|
+
const state = { ...prevState };
|
|
32
|
+
let currentRuleSet = 'root';
|
|
33
|
+
// Determine starting rule set based on state
|
|
34
|
+
if (state.inBlockComment) {
|
|
35
|
+
currentRuleSet = 'blockComment';
|
|
36
|
+
}
|
|
37
|
+
else if (state.inTemplateLiteral) {
|
|
38
|
+
currentRuleSet = 'templateLiteral';
|
|
39
|
+
}
|
|
40
|
+
else if (state.inMultilineString) {
|
|
41
|
+
currentRuleSet = 'multilineString';
|
|
42
|
+
}
|
|
43
|
+
while (pos < line.length) {
|
|
44
|
+
const remaining = line.slice(pos);
|
|
45
|
+
let matched = false;
|
|
46
|
+
// Try to match rules in current rule set
|
|
47
|
+
const rules = this.grammar.rules[currentRuleSet] || this.grammar.rules['root'] || [];
|
|
48
|
+
for (const rule of rules) {
|
|
49
|
+
const match = remaining.match(rule.pattern);
|
|
50
|
+
if (match && match.index === 0) {
|
|
51
|
+
const text = match[0];
|
|
52
|
+
tokens.push(createToken(rule.type, text, pos));
|
|
53
|
+
pos += text.length;
|
|
54
|
+
matched = true;
|
|
55
|
+
// Handle state transitions
|
|
56
|
+
if (rule.nextState) {
|
|
57
|
+
currentRuleSet = rule.nextState;
|
|
58
|
+
this.updateState(state, rule.nextState, true);
|
|
59
|
+
}
|
|
60
|
+
if (rule.popState) {
|
|
61
|
+
currentRuleSet = 'root';
|
|
62
|
+
this.updateState(state, currentRuleSet, false);
|
|
63
|
+
}
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// No match - consume single character as text
|
|
68
|
+
if (!matched) {
|
|
69
|
+
const char = line[pos];
|
|
70
|
+
// Try to merge with previous text token
|
|
71
|
+
const lastToken = tokens[tokens.length - 1];
|
|
72
|
+
if (lastToken && lastToken.type === 'text' && lastToken.end === pos) {
|
|
73
|
+
lastToken.text += char;
|
|
74
|
+
lastToken.end += 1;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
tokens.push(createToken('text', char, pos));
|
|
78
|
+
}
|
|
79
|
+
pos += 1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// Handle empty lines
|
|
83
|
+
if (tokens.length === 0) {
|
|
84
|
+
tokens.push(createToken('text', '', 0));
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
lineNumber,
|
|
88
|
+
tokens,
|
|
89
|
+
text: line,
|
|
90
|
+
state: { ...state }
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
updateState(state, ruleSet, entering) {
|
|
94
|
+
switch (ruleSet) {
|
|
95
|
+
case 'blockComment':
|
|
96
|
+
state.inBlockComment = entering;
|
|
97
|
+
break;
|
|
98
|
+
case 'templateLiteral':
|
|
99
|
+
state.inTemplateLiteral = entering;
|
|
100
|
+
break;
|
|
101
|
+
case 'multilineString':
|
|
102
|
+
state.inMultilineString = entering;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Simple regex-based tokenizer for basic languages
|
|
109
|
+
*/
|
|
110
|
+
export class SimpleTokenizer {
|
|
111
|
+
language;
|
|
112
|
+
patterns;
|
|
113
|
+
constructor(language, patterns) {
|
|
114
|
+
this.language = language;
|
|
115
|
+
this.patterns = patterns;
|
|
116
|
+
}
|
|
117
|
+
getInitialState() {
|
|
118
|
+
return {};
|
|
119
|
+
}
|
|
120
|
+
tokenizeLine(line, lineNumber, prevState) {
|
|
121
|
+
const tokens = [];
|
|
122
|
+
let pos = 0;
|
|
123
|
+
const state = { ...prevState };
|
|
124
|
+
// Handle block comment continuation
|
|
125
|
+
if (state.inBlockComment) {
|
|
126
|
+
const endMatch = line.indexOf('*/');
|
|
127
|
+
if (endMatch !== -1) {
|
|
128
|
+
tokens.push(createToken('comment.block', line.slice(0, endMatch + 2), 0));
|
|
129
|
+
pos = endMatch + 2;
|
|
130
|
+
state.inBlockComment = false;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
tokens.push(createToken('comment.block', line, 0));
|
|
134
|
+
return { lineNumber, tokens, text: line, state };
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
while (pos < line.length) {
|
|
138
|
+
const remaining = line.slice(pos);
|
|
139
|
+
let matched = false;
|
|
140
|
+
// Check for block comment start
|
|
141
|
+
if (remaining.startsWith('/*')) {
|
|
142
|
+
const endMatch = remaining.indexOf('*/', 2);
|
|
143
|
+
if (endMatch !== -1) {
|
|
144
|
+
const text = remaining.slice(0, endMatch + 2);
|
|
145
|
+
tokens.push(createToken('comment.block', text, pos));
|
|
146
|
+
pos += text.length;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
tokens.push(createToken('comment.block', remaining, pos));
|
|
150
|
+
state.inBlockComment = true;
|
|
151
|
+
pos = line.length;
|
|
152
|
+
}
|
|
153
|
+
matched = true;
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
// Try each pattern
|
|
157
|
+
for (const { type, regex } of this.patterns) {
|
|
158
|
+
const match = remaining.match(regex);
|
|
159
|
+
if (match && match.index === 0) {
|
|
160
|
+
const text = match[0];
|
|
161
|
+
tokens.push(createToken(type, text, pos));
|
|
162
|
+
pos += text.length;
|
|
163
|
+
matched = true;
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
// No match - consume character
|
|
168
|
+
if (!matched) {
|
|
169
|
+
const char = remaining[0];
|
|
170
|
+
const lastToken = tokens[tokens.length - 1];
|
|
171
|
+
if (lastToken && lastToken.type === 'text' && lastToken.end === pos) {
|
|
172
|
+
lastToken.text += char;
|
|
173
|
+
lastToken.end += 1;
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
tokens.push(createToken('text', char, pos));
|
|
177
|
+
}
|
|
178
|
+
pos += 1;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (tokens.length === 0) {
|
|
182
|
+
tokens.push(createToken('text', '', 0));
|
|
183
|
+
}
|
|
184
|
+
return { lineNumber, tokens, text: line, state };
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Plaintext tokenizer - no highlighting
|
|
189
|
+
*/
|
|
190
|
+
export class PlaintextTokenizer {
|
|
191
|
+
language = 'plaintext';
|
|
192
|
+
getInitialState() {
|
|
193
|
+
return {};
|
|
194
|
+
}
|
|
195
|
+
tokenizeLine(line, lineNumber) {
|
|
196
|
+
return {
|
|
197
|
+
lineNumber,
|
|
198
|
+
tokens: [createToken('text', line, 0)],
|
|
199
|
+
text: line,
|
|
200
|
+
state: {}
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tokenizer module for syntax highlighting
|
|
3
|
+
*
|
|
4
|
+
* This module provides zero-dependency syntax highlighting through custom tokenizers.
|
|
5
|
+
* Each language has its own tokenizer that produces tokens for styling.
|
|
6
|
+
*/
|
|
7
|
+
export * from './types';
|
|
8
|
+
export * from './base';
|
|
9
|
+
export { JavaScriptTokenizer, createJavaScriptTokenizer, createTypeScriptTokenizer, createJSXTokenizer, createTSXTokenizer } from './languages/javascript';
|
|
10
|
+
export { HTMLTokenizer, createHTMLTokenizer, createXMLTokenizer } from './languages/html';
|
|
11
|
+
export { CSSTokenizer, createCSSTokenizer } from './languages/css';
|
|
12
|
+
export { JSONTokenizer, createJSONTokenizer } from './languages/json';
|
|
13
|
+
export { PythonTokenizer, createPythonTokenizer } from './languages/python';
|
|
14
|
+
export { GoTokenizer, createGoTokenizer } from './languages/go';
|
|
15
|
+
export { MarkdownTokenizer, createMarkdownTokenizer } from './languages/markdown';
|
|
16
|
+
export { SvelteTokenizer, createSvelteTokenizer } from './languages/svelte';
|
|
17
|
+
import type { LanguageTokenizer, Token, TokenizedLine, TokenizerState, TokenType } from './types';
|
|
18
|
+
/**
|
|
19
|
+
* Get the canonical language name from an alias or extension
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolveLanguage(language: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get a tokenizer for a language (with LRU cache eviction)
|
|
24
|
+
*/
|
|
25
|
+
export declare function getTokenizer(language: string): LanguageTokenizer;
|
|
26
|
+
/**
|
|
27
|
+
* Clear the tokenizer cache (useful for testing or memory management)
|
|
28
|
+
*/
|
|
29
|
+
export declare function clearTokenizerCache(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Check if a language is supported
|
|
32
|
+
*/
|
|
33
|
+
export declare function isLanguageSupported(language: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Get list of supported languages
|
|
36
|
+
*/
|
|
37
|
+
export declare function getSupportedLanguages(): string[];
|
|
38
|
+
/**
|
|
39
|
+
* Tokenize content for a given language
|
|
40
|
+
*/
|
|
41
|
+
export declare function tokenize(content: string, language: string): TokenizedLine[];
|
|
42
|
+
/**
|
|
43
|
+
* Get CSS class for a token type
|
|
44
|
+
* Sanitizes input to prevent XSS through class name injection
|
|
45
|
+
*/
|
|
46
|
+
export declare function getTokenClass(type: TokenType): string;
|
|
47
|
+
/**
|
|
48
|
+
* Convert tokens to HTML spans for rendering
|
|
49
|
+
*/
|
|
50
|
+
export declare function tokensToHTML(tokens: Token[]): string;
|
|
51
|
+
/**
|
|
52
|
+
* Escape HTML special characters
|
|
53
|
+
* Unified HTML escaping function for all editor components
|
|
54
|
+
*/
|
|
55
|
+
export declare function escapeHTML(text: string): string;
|
|
56
|
+
export type { Token, TokenizedLine, TokenizerState, TokenType, LanguageTokenizer };
|