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.
- package/.vscode/launch.json +51 -0
- package/.vscode/settings.json +94 -0
- package/.vscode/tasks.json +57 -0
- package/App.elen +70 -0
- package/README.MD +0 -0
- package/Test.elen +24 -0
- package/compile-all-ts.js +76 -0
- package/dist/index.es.js +1 -0
- package/dist/index.umd.js +1 -0
- package/elen/App.elen +7 -0
- package/elen/LICENSE +15 -0
- package/elen/dist/extension.js +130 -0
- package/elen/dist/init.js +28 -0
- package/elen/elen-1.0.0.vsix +0 -0
- package/elen/extension.ts +122 -0
- package/elen/icon-theme.json +2423 -0
- package/elen/icon.svg +1 -0
- package/elen/images/icon.svg +1 -0
- package/elen/init.ts +28 -0
- package/elen/language-configuration.json +26 -0
- package/elen/package-lock.json +549 -0
- package/elen/package.json +52 -0
- package/elen/seti.woff +0 -0
- package/elen/src/App.elen +0 -0
- package/elen/syntaxes/elen.tmLanguage.json +312 -0
- package/elen/tsconfig.json +14 -0
- package/elen-icon-theme/LICENSE +15 -0
- package/elen-icon-theme/README.md +18 -0
- package/elen-icon-theme/elen-icon-theme-1.0.0.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.1.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.13.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.15.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.16.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.17.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.18.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.19.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.2.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.20.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.3.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.4.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.5.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.6.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.7.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.8.vsix +0 -0
- package/elen-icon-theme/elen-icon-theme-1.0.9.vsix +0 -0
- package/elen-icon-theme/extension.js +226 -0
- package/elen-icon-theme/icon-theme.json +2425 -0
- package/elen-icon-theme/icon.svg +1 -0
- package/elen-icon-theme/images/icon.svg +1 -0
- package/elen-icon-theme/package.json +36 -0
- package/elen-icon-theme/seti.woff +0 -0
- package/icon.svg +8 -0
- package/index.html +11 -0
- package/init-start-page.ts +59 -0
- package/logo.html +15 -0
- package/package.json +42 -0
- package/server.ts +31 -0
- package/shells/data-page/Elen.ts +23 -0
- package/squarings/.json +132 -0
- package/squarings/App.json +59 -0
- package/squarings/Test.json +27 -0
- package/src/base/Component.ts +113 -0
- package/src/classes/BinaryData.ts +81 -0
- package/src/classes/DataModel.ts +386 -0
- package/src/classes/DataTypes.ts +116 -0
- package/src/components/squaring.ts +226 -0
- package/src/components/vtm.ts +231 -0
- package/src/data/ascii.ts +134 -0
- package/src/data/binary-resources.ts +209 -0
- package/src/events/event-handler.js +34 -0
- package/src/index.ts +1 -0
- package/src/methods/app-template.ts +7 -0
- package/src/methods/array-helpers.ts +176 -0
- package/src/methods/css-template.ts +5 -0
- package/src/methods/errors-helpers.ts +26 -0
- package/src/methods/html-template.ts +22 -0
- package/src/methods/parsers.ts +1012 -0
- package/src/methods/square.ts +80 -0
- package/src/methods/ts-template.ts +36 -0
- package/src/methods/using-template.ts +3 -0
- package/src/models/ascii.ts +26 -0
- package/src/models/data-stream.ts +5 -0
- package/src/models/data-type-model.ts +22 -0
- package/src/models/template-binary-model.ts +5 -0
- package/src/routes.ts +9 -0
- package/syntaxes/enel.tmLanguage.json +28 -0
- package/tsconfig.json +68 -0
- package/viewController/Inital.elen +8 -0
- package/vite.config.ts +25 -0
- package/vue.config.js +30 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { TemplateBinary } from '../models/template-binary-model';
|
|
2
|
+
|
|
3
|
+
export const pageStart = {
|
|
4
|
+
name: '<template>',
|
|
5
|
+
code: 10,
|
|
6
|
+
bitMap: [60, 116, 101, 109, 112, 108, 97, 116, 101, 62]
|
|
7
|
+
} as TemplateBinary;
|
|
8
|
+
|
|
9
|
+
export const pageEnd = {
|
|
10
|
+
name: '</template>',
|
|
11
|
+
code: 11,
|
|
12
|
+
bitMap: [60, 47, 116, 101, 109, 112, 108, 97, 116, 101, 62]
|
|
13
|
+
} as TemplateBinary;
|
|
14
|
+
|
|
15
|
+
export const dataCodeStart = {
|
|
16
|
+
name: '<shell>',
|
|
17
|
+
code: 7,
|
|
18
|
+
bitMap: [60, 115, 104, 101, 108, 108, 62]
|
|
19
|
+
} as TemplateBinary;
|
|
20
|
+
|
|
21
|
+
export const dataCodeEnd = {
|
|
22
|
+
name: '</shell>',
|
|
23
|
+
code: 8,
|
|
24
|
+
bitMap: [60, 47, 115, 104, 101, 108, 108, 62]
|
|
25
|
+
} as TemplateBinary;
|
|
26
|
+
|
|
27
|
+
export const dataVisualStart = {
|
|
28
|
+
name: '<visual>',
|
|
29
|
+
code: 8,
|
|
30
|
+
bitMap: [60, 118, 105, 115, 117, 97, 108, 62]
|
|
31
|
+
} as TemplateBinary;
|
|
32
|
+
|
|
33
|
+
export const dataVisualEnd = {
|
|
34
|
+
name: '</visual>',
|
|
35
|
+
code: 9,
|
|
36
|
+
bitMap: [60, 47, 118, 105, 115, 117, 97, 108, 62]
|
|
37
|
+
} as TemplateBinary;
|
|
38
|
+
|
|
39
|
+
export const dataBodyStart = {
|
|
40
|
+
name: '<body>',
|
|
41
|
+
code: 6,
|
|
42
|
+
bitMap: [60, 98, 111, 100, 121, 62]
|
|
43
|
+
} as TemplateBinary;
|
|
44
|
+
|
|
45
|
+
export const dataBodyEnd = {
|
|
46
|
+
name: '</body>',
|
|
47
|
+
code: 7,
|
|
48
|
+
bitMap: [60, 47, 98, 111, 100, 121, 62]
|
|
49
|
+
} as TemplateBinary;
|
|
50
|
+
|
|
51
|
+
export const dataHeadStart = {
|
|
52
|
+
name: '<head>',
|
|
53
|
+
code: 6,
|
|
54
|
+
bitMap: [60, 104, 101, 97, 100, 62]
|
|
55
|
+
} as TemplateBinary;
|
|
56
|
+
|
|
57
|
+
export const dataHeadEnd = {
|
|
58
|
+
name: '</head>',
|
|
59
|
+
code: 7,
|
|
60
|
+
bitMap: [60, 47, 104, 101, 97, 100, 62]
|
|
61
|
+
} as TemplateBinary;
|
|
62
|
+
|
|
63
|
+
export const endAttribute = {
|
|
64
|
+
name: '/>',
|
|
65
|
+
code: 2,
|
|
66
|
+
command: '\n \t',
|
|
67
|
+
bitMap: [60, 47]
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const startAttribute = {
|
|
71
|
+
name: '<',
|
|
72
|
+
code: 1,
|
|
73
|
+
command: '\n \t',
|
|
74
|
+
bitMap: [60]
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const voidAttribute = {
|
|
78
|
+
name: 'void',
|
|
79
|
+
code: 1,
|
|
80
|
+
command: '\n \t',
|
|
81
|
+
bitMap: [118, 111, 105, 100]
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const methodTypeSeparator = {
|
|
85
|
+
name: "){",
|
|
86
|
+
code: 2,
|
|
87
|
+
command: '\n \t',
|
|
88
|
+
bitMap: [41, 123]
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const dataTypeSeparator = {
|
|
92
|
+
name: "Data<",
|
|
93
|
+
code: 5,
|
|
94
|
+
bitMap: [68, 97, 116, 97, 60]
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const NotationTypeSeparator = {
|
|
98
|
+
name: "Notation<",
|
|
99
|
+
code: 9,
|
|
100
|
+
bitMap: [78, 111, 116, 97, 116, 105, 111, 110, 60]
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export const componentTypeSeparator = {
|
|
104
|
+
name: "Component<",
|
|
105
|
+
code: 11,
|
|
106
|
+
bitMap: [67, 111, 109, 112, 111, 110, 101, 110, 116, 60]
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const eventTypeSeparator = {
|
|
110
|
+
name: "Event<",
|
|
111
|
+
code: 6,
|
|
112
|
+
bitMap: [69, 118, 101, 110, 116, 60]
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const rowSeparation = {
|
|
116
|
+
name: ";o|}o|;[s|b|n|D]",
|
|
117
|
+
bitMap: [[59, 111],[125, 111],[59, 115],[59, 98],[59, 68],[59, 110]]
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const typeBitMap: { symbol: number, code: number[] }[] = [
|
|
121
|
+
{ symbol: 1, code: [115, 116, 114, 105, 110, 103] }, // string
|
|
122
|
+
{ symbol: 10, code: [110, 117, 109, 98, 101, 114] }, // number
|
|
123
|
+
{ symbol: 11, code: [98, 111, 111, 108, 101, 97, 110] }, // boolean
|
|
124
|
+
{ symbol: 12, code: [110, 117, 108, 108, 97, 98, 108, 101] } // nullable
|
|
125
|
+
|
|
126
|
+
];
|
|
127
|
+
|
|
128
|
+
export const methodReturnTypeBitMap: { code: number[] }[] = [
|
|
129
|
+
{ code: [111, 118, 101, 114, 114, 105, 100, 101, 32, 115, 116, 114, 105, 110, 103] }, // override string
|
|
130
|
+
{ code: [111, 118, 101, 114, 114, 105, 100, 101, 32, 110, 117, 109, 98, 101, 114] }, // override number
|
|
131
|
+
{ code: [111, 118, 101, 114, 114, 105, 100, 101, 32, 98, 111, 111, 108, 101, 97, 110] }, // override boolean
|
|
132
|
+
{ code: [111, 118, 101, 114, 114, 105, 100, 101, 32, 118, 111, 105, 100] }, // override void
|
|
133
|
+
]
|
|
134
|
+
|
|
135
|
+
export const initTypeBitMap: {type: number[], code: number[] }[] = [
|
|
136
|
+
{ type: [115, 116, 114, 105, 110, 103], code: [32, 61, 32, 34, 34] }, // = ""
|
|
137
|
+
{ type: [110, 117, 109, 98, 101, 114], code: [32, 61, 32, 48] }, // = 0
|
|
138
|
+
{ type: [98, 111, 111, 108, 101, 97, 110], code: [32, 61, 32, 102, 97, 108, 115, 101] }, // = false
|
|
139
|
+
{ type: [110, 117, 108, 108, 97, 98, 108, 101], code: [32, 61, 32, 117, 110, 100, 101, 102, 105, 110, 101, 100] } // = undefined
|
|
140
|
+
]
|
|
141
|
+
|
|
142
|
+
export const nullable = {
|
|
143
|
+
name: "?",
|
|
144
|
+
code: 1,
|
|
145
|
+
bitMap: [63]
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export const empty = {
|
|
149
|
+
name: "",
|
|
150
|
+
code: 0,
|
|
151
|
+
bitMap: [0]
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
//nullable
|
|
155
|
+
|
|
156
|
+
export const commentSeparation =
|
|
157
|
+
{
|
|
158
|
+
name: "//",
|
|
159
|
+
code: 2,
|
|
160
|
+
bitMap: [47, 47]
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export const importTypeSeparator = {
|
|
164
|
+
name: "import",
|
|
165
|
+
code: 6,
|
|
166
|
+
bitMap: [105, 109, 112, 111, 114, 116]
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export const classDeclartionSeparator = {
|
|
170
|
+
name: "public class",
|
|
171
|
+
code: 5,
|
|
172
|
+
bitMap: [112, 117, 98, 108, 105, 99, 32, 99, 108, 97, 115, 115]
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export const propertyCloseSeparator = {
|
|
176
|
+
name: ";",
|
|
177
|
+
code: 1,
|
|
178
|
+
bitMap: [59]
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export const newRow = {
|
|
182
|
+
name: "'\n'",
|
|
183
|
+
code: 2,
|
|
184
|
+
bitMap: [39, 92, 110, 39]
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export const newTab = {
|
|
188
|
+
name: "'\t'",
|
|
189
|
+
code: 2,
|
|
190
|
+
bitMap: [39, 92, 116, 39]
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export const using = {
|
|
194
|
+
name: "using",
|
|
195
|
+
code: 5,
|
|
196
|
+
bitMap: [117, 115, 105, 110, 103]
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export const bracketStart = {
|
|
200
|
+
name: "{",
|
|
201
|
+
code: 1,
|
|
202
|
+
bitMap: [123]
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export const bracketEnd = {
|
|
206
|
+
name: "}",
|
|
207
|
+
code: 1,
|
|
208
|
+
bitMap: [125]
|
|
209
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Squaring } from "../components/squaring";
|
|
2
|
+
|
|
3
|
+
const squaring = new Squaring();
|
|
4
|
+
|
|
5
|
+
export function handleClick() {
|
|
6
|
+
const component = squaring.data.components.find(cmp => cmp.name === "GeneratedComponent");
|
|
7
|
+
if (component) {
|
|
8
|
+
console.log("Button clicked, updating component:", component);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function updateProperty(event) {
|
|
13
|
+
const property = squaring.data.components[0]?.properties?.find(prop => prop.name === "GeneratedProperty");
|
|
14
|
+
if (property) {
|
|
15
|
+
property.value = event.target.value;
|
|
16
|
+
console.log("Property updated:", property);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function handleBlur(event) {
|
|
21
|
+
console.log("Input blurred:", event.target.value);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function handleFocus(event) {
|
|
25
|
+
console.log("Input focused:", event.target.value);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function handleMouseEnter(event) {
|
|
29
|
+
console.log("Mouse entered:", event.target);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function handleMouseLeave(event) {
|
|
33
|
+
console.log("Mouse left:", event.target);
|
|
34
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { start } from "repl";
|
|
2
|
+
import { fromAscii } from "./parsers";
|
|
3
|
+
import { DataProperty } from "../components/squaring";
|
|
4
|
+
import { ContentFile } from "../models/ascii";
|
|
5
|
+
import { initTypeBitMap, typeBitMap } from "../data/binary-resources";
|
|
6
|
+
import { array } from "node:stream/iter";
|
|
7
|
+
import { Extension } from "typescript";
|
|
8
|
+
|
|
9
|
+
export const byteMapStartWith = (number: number[], pattern: number[]) => {
|
|
10
|
+
for(let i = 0; i < pattern.length; i++){
|
|
11
|
+
if(number[i] != pattern[i]){
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const trimWhiteSpaceFromLeft = (number: number[]) => {
|
|
20
|
+
let result = [] as number[];
|
|
21
|
+
let findLeftNumber = false;
|
|
22
|
+
|
|
23
|
+
for(let num of number){
|
|
24
|
+
if(num !== 32){
|
|
25
|
+
result = [...result, num];
|
|
26
|
+
findLeftNumber = true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if(findLeftNumber)
|
|
30
|
+
if(num == 32){
|
|
31
|
+
result = [...result, num];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const findLast = (array: any[]) => {
|
|
39
|
+
return array[array.length - 1];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const isArrayEqual = (arr1: number[], arr2: number[]) => {
|
|
43
|
+
if(arr1.length != arr2.length){
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
for(let i = 0; i < arr1.length; i++){
|
|
47
|
+
if(arr1[i] != arr2[i]){
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const isListEqual = (list1: string[], list2: string[]) => {
|
|
55
|
+
if(list1.length != list2.length){
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
for(let i = 0; i < list1.length; i++){
|
|
59
|
+
if(list1[i] != list2[i]){
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const splitArray = (array: number[], separator: number) => {
|
|
67
|
+
let result: number[][] = [];
|
|
68
|
+
let current: number[] = [];
|
|
69
|
+
|
|
70
|
+
for (let i = 0; i < array.length; i++) {
|
|
71
|
+
|
|
72
|
+
if (array[i] === separator) {
|
|
73
|
+
|
|
74
|
+
if (current.length > 0) {
|
|
75
|
+
result.push(current);
|
|
76
|
+
current = [];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
current.push(array[i]);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (current.length > 0) {
|
|
86
|
+
result.push(current);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return result;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
export const indexOf = (array: number[], separator: number) => {
|
|
94
|
+
for(let i = 0; i < array.length; i++){
|
|
95
|
+
if(array[i] == separator){
|
|
96
|
+
return i;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return -1;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
export const equalToMultiple = (arr1: number[], arrays: {
|
|
105
|
+
code: number[];
|
|
106
|
+
}[]) => {
|
|
107
|
+
for (const arr2 of arrays) {
|
|
108
|
+
if(isArrayEqual(arr1, arr2.code)){
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const startsWithMultipleByteMap = (arr1: number[], arr2: {
|
|
116
|
+
code: number[];
|
|
117
|
+
}[]) => {
|
|
118
|
+
for (let i = 0; i < arr2.length; i++) {
|
|
119
|
+
if (byteMapStartWith(trimWhiteSpaceFromLeft(arr1),
|
|
120
|
+
trimWhiteSpaceFromLeft(arr2[i].code))) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return false;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const flatList = (list: { arrays: number[] }[]) => {
|
|
128
|
+
let result: number[] = [];
|
|
129
|
+
|
|
130
|
+
for(let item of list){
|
|
131
|
+
result = [...result, ...item.arrays];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export const removeArrayExclamationMark = (array: number[], remove: number[]) => {
|
|
138
|
+
let result: number[] = [];
|
|
139
|
+
|
|
140
|
+
for(let num of array){
|
|
141
|
+
for(let removeNum of remove){
|
|
142
|
+
if(num != removeNum){
|
|
143
|
+
result = [...result, num];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export const setProperty = (property: DataProperty, contentFile: ContentFile): ContentFile => {
|
|
151
|
+
|
|
152
|
+
if(property.nullable){
|
|
153
|
+
let nullableType = typeBitMap.find(x=> x.symbol == 12);
|
|
154
|
+
if(nullableType)
|
|
155
|
+
{
|
|
156
|
+
let type = initTypeBitMap.find(x=> isArrayEqual(x.type, nullableType.code));
|
|
157
|
+
if(type)
|
|
158
|
+
contentFile.contentFile.push(`${fromAscii(type.code)}`)
|
|
159
|
+
}
|
|
160
|
+
}else{
|
|
161
|
+
let type = initTypeBitMap.find(x=> equalToMultiple(x.type!, typeBitMap));
|
|
162
|
+
contentFile.contentFile.push(` = ${property.value}`);
|
|
163
|
+
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return contentFile;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export const atPosition = (array: number[][], position: number) => {
|
|
170
|
+
return array[position];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
export class ArrayHelper {
|
|
175
|
+
|
|
176
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { bracketStart, propertyCloseSeparator, bracketEnd, nullable } from '../data/binary-resources';
|
|
2
|
+
import { indexOf } from './array-helpers';
|
|
3
|
+
|
|
4
|
+
export const closingSeparatorNotFound = (dataRow: number[]) => {
|
|
5
|
+
if(indexOf(dataRow, propertyCloseSeparator.bitMap[0]) != -1){
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const propertyIsNull = (dataRow: number[]) => {
|
|
13
|
+
if(indexOf(dataRow, nullable.bitMap[0]) != -1){
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const bracketsStartNotFound = (dataRow: number[]) => {
|
|
21
|
+
return indexOf(dataRow, bracketStart.bitMap[0]) != -1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const bracketsEndNotFound = (dataRow: number[]) => {
|
|
25
|
+
return indexOf(dataRow, bracketEnd.bitMap[0]) != -1;
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class HtmlTemplate {
|
|
2
|
+
/**
|
|
3
|
+
* Generates a standard HTML page string.
|
|
4
|
+
* @param title The title of the page
|
|
5
|
+
* @param bodyContent The HTML content to place inside <body>
|
|
6
|
+
* @param cssPath Path to the CSS file (default: './App.css')
|
|
7
|
+
* @param jsPath Path to the JS file (default: 'index.js')
|
|
8
|
+
*/
|
|
9
|
+
createHtmlTemplate({
|
|
10
|
+
title = 'Test Page',
|
|
11
|
+
bodyContent = '',
|
|
12
|
+
cssPath = './App.css',
|
|
13
|
+
jsPath = './index.js',
|
|
14
|
+
}: {
|
|
15
|
+
title?: string;
|
|
16
|
+
bodyContent?: string;
|
|
17
|
+
cssPath?: string;
|
|
18
|
+
jsPath?: string;
|
|
19
|
+
} = {}): string {
|
|
20
|
+
return `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>${title}</title>\n <link rel=\"stylesheet\" href=\"${cssPath}\">\n <script src=\"${jsPath}\"></script>\n</head>\n<body>\n${bodyContent}\n</body>\n</html>`;
|
|
21
|
+
}
|
|
22
|
+
}
|