sheel-deer 1.0.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.
Files changed (90) hide show
  1. package/.vscode/launch.json +51 -0
  2. package/.vscode/settings.json +94 -0
  3. package/.vscode/tasks.json +57 -0
  4. package/App.elen +70 -0
  5. package/README.MD +0 -0
  6. package/Test.elen +24 -0
  7. package/compile-all-ts.js +76 -0
  8. package/dist/index.es.js +1 -0
  9. package/dist/index.umd.js +1 -0
  10. package/elen/App.elen +7 -0
  11. package/elen/LICENSE +15 -0
  12. package/elen/dist/extension.js +130 -0
  13. package/elen/dist/init.js +28 -0
  14. package/elen/elen-1.0.0.vsix +0 -0
  15. package/elen/extension.ts +122 -0
  16. package/elen/icon-theme.json +2423 -0
  17. package/elen/icon.svg +1 -0
  18. package/elen/images/icon.svg +1 -0
  19. package/elen/init.ts +28 -0
  20. package/elen/language-configuration.json +26 -0
  21. package/elen/package-lock.json +549 -0
  22. package/elen/package.json +52 -0
  23. package/elen/seti.woff +0 -0
  24. package/elen/src/App.elen +0 -0
  25. package/elen/syntaxes/elen.tmLanguage.json +312 -0
  26. package/elen/tsconfig.json +14 -0
  27. package/elen-icon-theme/LICENSE +15 -0
  28. package/elen-icon-theme/README.md +18 -0
  29. package/elen-icon-theme/elen-icon-theme-1.0.0.vsix +0 -0
  30. package/elen-icon-theme/elen-icon-theme-1.0.1.vsix +0 -0
  31. package/elen-icon-theme/elen-icon-theme-1.0.13.vsix +0 -0
  32. package/elen-icon-theme/elen-icon-theme-1.0.15.vsix +0 -0
  33. package/elen-icon-theme/elen-icon-theme-1.0.16.vsix +0 -0
  34. package/elen-icon-theme/elen-icon-theme-1.0.17.vsix +0 -0
  35. package/elen-icon-theme/elen-icon-theme-1.0.18.vsix +0 -0
  36. package/elen-icon-theme/elen-icon-theme-1.0.19.vsix +0 -0
  37. package/elen-icon-theme/elen-icon-theme-1.0.2.vsix +0 -0
  38. package/elen-icon-theme/elen-icon-theme-1.0.20.vsix +0 -0
  39. package/elen-icon-theme/elen-icon-theme-1.0.3.vsix +0 -0
  40. package/elen-icon-theme/elen-icon-theme-1.0.4.vsix +0 -0
  41. package/elen-icon-theme/elen-icon-theme-1.0.5.vsix +0 -0
  42. package/elen-icon-theme/elen-icon-theme-1.0.6.vsix +0 -0
  43. package/elen-icon-theme/elen-icon-theme-1.0.7.vsix +0 -0
  44. package/elen-icon-theme/elen-icon-theme-1.0.8.vsix +0 -0
  45. package/elen-icon-theme/elen-icon-theme-1.0.9.vsix +0 -0
  46. package/elen-icon-theme/extension.js +226 -0
  47. package/elen-icon-theme/icon-theme.json +2425 -0
  48. package/elen-icon-theme/icon.svg +1 -0
  49. package/elen-icon-theme/images/icon.svg +1 -0
  50. package/elen-icon-theme/package.json +36 -0
  51. package/elen-icon-theme/seti.woff +0 -0
  52. package/icon.svg +8 -0
  53. package/index.html +11 -0
  54. package/init-start-page.ts +59 -0
  55. package/logo.html +15 -0
  56. package/package.json +42 -0
  57. package/server.ts +31 -0
  58. package/shells/data-page/Elen.ts +23 -0
  59. package/squarings/.json +132 -0
  60. package/squarings/App.json +59 -0
  61. package/squarings/Test.json +27 -0
  62. package/src/base/Component.ts +113 -0
  63. package/src/classes/BinaryData.ts +81 -0
  64. package/src/classes/DataModel.ts +386 -0
  65. package/src/classes/DataTypes.ts +116 -0
  66. package/src/components/squaring.ts +226 -0
  67. package/src/components/vtm.ts +231 -0
  68. package/src/data/ascii.ts +134 -0
  69. package/src/data/binary-resources.ts +209 -0
  70. package/src/events/event-handler.js +34 -0
  71. package/src/index.ts +1 -0
  72. package/src/methods/app-template.ts +7 -0
  73. package/src/methods/array-helpers.ts +176 -0
  74. package/src/methods/css-template.ts +5 -0
  75. package/src/methods/errors-helpers.ts +26 -0
  76. package/src/methods/html-template.ts +22 -0
  77. package/src/methods/parsers.ts +1012 -0
  78. package/src/methods/square.ts +80 -0
  79. package/src/methods/ts-template.ts +36 -0
  80. package/src/methods/using-template.ts +3 -0
  81. package/src/models/ascii.ts +26 -0
  82. package/src/models/data-stream.ts +5 -0
  83. package/src/models/data-type-model.ts +22 -0
  84. package/src/models/template-binary-model.ts +5 -0
  85. package/src/routes.ts +9 -0
  86. package/syntaxes/enel.tmLanguage.json +28 -0
  87. package/tsconfig.json +68 -0
  88. package/viewController/Inital.elen +8 -0
  89. package/vite.config.ts +25 -0
  90. package/vue.config.js +30 -0
@@ -0,0 +1,122 @@
1
+ import * as path from 'path';
2
+ import * as vscode from 'vscode';
3
+
4
+ const hoverDocs: Record<string, string> = {
5
+ "shell": "<shell> contains Elen component code and is highlighted as TypeScript inside .elen files.",
6
+ "routes": "<routes> defines route-aware components and navigation targets in index.html.",
7
+ "Component": "Component is the base Elen component class used by all shell components.",
8
+ "@input": "@input declares a data input property for the component.",
9
+ "@output": "@output declares an event output emitted by the component.",
10
+ "@component": "@component imports a component into the current shell component as a directive.",
11
+ "@components": "@components imports multiple component directives into the current shell component.",
12
+ "override": "override marks lifecycle hooks and methods that replace a parent implementation.",
13
+ "void": "void is the Elen/TypeScript return type for functions without a value.",
14
+ "string": "string is a primitive Elen/TypeScript type for text.",
15
+ "boolean": "boolean is a primitive Elen/TypeScript type for true/false values.",
16
+ "number": "number is a primitive Elen/TypeScript type for numeric values."
17
+ };
18
+
19
+ const decoratorCompletions = [
20
+ "@input",
21
+ "@output",
22
+ "@component",
23
+ "@components"
24
+ ].map((label) => {
25
+ const item = new vscode.CompletionItem(label, vscode.CompletionItemKind.Keyword);
26
+ item.detail = "Elen decorator";
27
+ item.insertText = label;
28
+ return item;
29
+ });
30
+
31
+ export function activate(context: vscode.ExtensionContext) {
32
+ context.subscriptions.push(
33
+ vscode.languages.registerHoverProvider({ language: 'elen' }, {
34
+ provideHover(document, position) {
35
+ const wordRange = document.getWordRangeAtPosition(position, /[@A-Za-z0-9_]+/);
36
+ if (!wordRange) {
37
+ return;
38
+ }
39
+ const word = document.getText(wordRange);
40
+ const text = hoverDocs[word];
41
+ if (text) {
42
+ return new vscode.Hover(text);
43
+ }
44
+ return undefined;
45
+ }
46
+ })
47
+ );
48
+
49
+ const extractComponentClasses = async (files: vscode.Uri[]): Promise<string[]> => {
50
+ const names = new Set<string>();
51
+ for (const uri of files) {
52
+ const doc = await vscode.workspace.openTextDocument(uri);
53
+ const text = doc.getText();
54
+ for (const match of text.matchAll(/\bclass\s+([A-Z][a-zA-Z0-9_]*)\s+extends\s+Component\b/g)) {
55
+ names.add(match[1]);
56
+ }
57
+ }
58
+ return Array.from(names).sort();
59
+ };
60
+
61
+ const importFileCompletionItems = async (currentPrefix: string, currentDir: string): Promise<vscode.CompletionItem[]> => {
62
+ const items: vscode.CompletionItem[] = [];
63
+ const files = await vscode.workspace.findFiles('**/*.elen', '**/{dist,node_modules}/**', 100);
64
+ for (const uri of files) {
65
+ const relativePath = path.relative(currentDir, uri.fsPath).replace(/\\/g, '/');
66
+ const candidate = relativePath.startsWith('.') ? relativePath : `./${relativePath}`;
67
+ if (candidate.startsWith(currentPrefix)) {
68
+ const completionItem = new vscode.CompletionItem(candidate, vscode.CompletionItemKind.File);
69
+ completionItem.detail = 'Elen component file';
70
+ completionItem.insertText = candidate;
71
+ items.push(completionItem);
72
+ }
73
+ }
74
+ return items;
75
+ };
76
+
77
+ context.subscriptions.push(
78
+ vscode.languages.registerCompletionItemProvider(
79
+ { language: 'elen' },
80
+ {
81
+ async provideCompletionItems(document, position) {
82
+ const items: vscode.CompletionItem[] = [];
83
+ const line = document.lineAt(position).text.substring(0, position.character);
84
+ const currentDir = path.dirname(document.uri.fsPath);
85
+
86
+ if (/\bimport\s+[A-Za-z0-9_]*$/.test(line)) {
87
+ ['Component', 'string', 'boolean', 'number', 'void'].forEach((label) => {
88
+ const item = new vscode.CompletionItem(label, vscode.CompletionItemKind.Keyword);
89
+ item.detail = 'Elen type or keyword';
90
+ items.push(item);
91
+ });
92
+ }
93
+
94
+ if (/@(?:input|output|component|components)?$/.test(line)) {
95
+ items.push(...decoratorCompletions);
96
+ }
97
+
98
+ if (/\b@components?\s+[A-Za-z0-9_]*$/.test(line)) {
99
+ const files = await vscode.workspace.findFiles('**/*.elen', '**/{dist,node_modules}/**', 100);
100
+ const names = await extractComponentClasses(files);
101
+ names.forEach((name) => {
102
+ const completionItem = new vscode.CompletionItem(name, vscode.CompletionItemKind.Class);
103
+ completionItem.detail = 'Elen component class';
104
+ items.push(completionItem);
105
+ });
106
+ }
107
+
108
+ const importPathMatch = /from\s+["']([^"']*)$/.exec(line);
109
+ if (importPathMatch) {
110
+ items.push(...await importFileCompletionItems(importPathMatch[1], currentDir));
111
+ }
112
+
113
+ return items.length ? items : undefined;
114
+ }
115
+ },
116
+ '.', '/', '@'
117
+ )
118
+ );
119
+ }
120
+
121
+ export function deactivate() {
122
+ }