@lumiastream/ui 0.0.5-beta.2 → 0.0.5-beta.3
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/dist/index.d.ts +84 -1
- package/dist/index.js +172 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -33,4 +33,87 @@ declare function variableCompletionOptions(context: CompletionContext, variables
|
|
|
33
33
|
validFor: RegExp;
|
|
34
34
|
} | null;
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
declare const codeMirrorlinterOptions: (type: "overlay" | "code", language?: "js" | "css" | "html" | "json") => {
|
|
37
|
+
js: {
|
|
38
|
+
languageOptions: {
|
|
39
|
+
ecmaVersion: number;
|
|
40
|
+
sourceType: string;
|
|
41
|
+
globals: {
|
|
42
|
+
window: string;
|
|
43
|
+
document: string;
|
|
44
|
+
console: string;
|
|
45
|
+
performance: string;
|
|
46
|
+
navigator: string;
|
|
47
|
+
location: string;
|
|
48
|
+
localStorage: string;
|
|
49
|
+
sessionStorage: string;
|
|
50
|
+
fetch: string;
|
|
51
|
+
setTimeout: string;
|
|
52
|
+
setInterval: string;
|
|
53
|
+
clearTimeout: string;
|
|
54
|
+
clearInterval: string;
|
|
55
|
+
requestAnimationFrame: string;
|
|
56
|
+
cancelAnimationFrame: string;
|
|
57
|
+
alert: string;
|
|
58
|
+
confirm: string;
|
|
59
|
+
prompt: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
rules: {
|
|
63
|
+
"no-unused-vars": string;
|
|
64
|
+
"no-undef": string;
|
|
65
|
+
"no-use-before-define": (string | {
|
|
66
|
+
functions: boolean;
|
|
67
|
+
classes: boolean;
|
|
68
|
+
})[];
|
|
69
|
+
"no-shadow": string;
|
|
70
|
+
"no-redeclare": string;
|
|
71
|
+
eqeqeq: (string | {
|
|
72
|
+
null: string;
|
|
73
|
+
})[];
|
|
74
|
+
"no-eval": string;
|
|
75
|
+
"no-implied-eval": string;
|
|
76
|
+
"no-new-func": string;
|
|
77
|
+
"no-return-await": string;
|
|
78
|
+
"require-await": string;
|
|
79
|
+
"no-throw-literal": string;
|
|
80
|
+
"no-unmodified-loop-condition": string;
|
|
81
|
+
"no-constant-condition": string;
|
|
82
|
+
"no-debugger": string;
|
|
83
|
+
"no-duplicate-case": string;
|
|
84
|
+
"no-empty": (string | {
|
|
85
|
+
allowEmptyCatch: boolean;
|
|
86
|
+
})[];
|
|
87
|
+
"no-empty-pattern": string;
|
|
88
|
+
"no-fallthrough": string;
|
|
89
|
+
"no-sparse-arrays": string;
|
|
90
|
+
"no-unreachable": string;
|
|
91
|
+
"use-isnan": string;
|
|
92
|
+
"valid-typeof": string;
|
|
93
|
+
"no-trailing-spaces": string;
|
|
94
|
+
"no-multi-spaces": string;
|
|
95
|
+
"prefer-const": string;
|
|
96
|
+
"no-var": string;
|
|
97
|
+
"prefer-template": string;
|
|
98
|
+
"no-useless-concat": string;
|
|
99
|
+
"no-cond-assign": string;
|
|
100
|
+
"no-constant-binary-expression": string;
|
|
101
|
+
"no-dupe-args": string;
|
|
102
|
+
"no-dupe-keys": string;
|
|
103
|
+
"no-duplicate-imports": string;
|
|
104
|
+
"no-ex-assign": string;
|
|
105
|
+
"no-func-assign": string;
|
|
106
|
+
"no-import-assign": string;
|
|
107
|
+
"no-irregular-whitespace": string;
|
|
108
|
+
"no-misleading-character-class": string;
|
|
109
|
+
"no-prototype-builtins": string;
|
|
110
|
+
"no-unexpected-multiline": string;
|
|
111
|
+
"no-script-url": string;
|
|
112
|
+
"no-unsafe-optional-chaining": string;
|
|
113
|
+
"no-loop-func": string;
|
|
114
|
+
"no-await-in-loop": string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export { LSButton, type LSButtonProps, codeMirrorlinterOptions, variableCompletionOptions };
|
package/dist/index.js
CHANGED
|
@@ -77,7 +77,179 @@ function variableCompletionOptions(context, variables) {
|
|
|
77
77
|
// keep list open while typing identifiers
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
|
+
|
|
81
|
+
// src/utils/codeMirrorlinterOptions.ts
|
|
82
|
+
var jsOptions = {
|
|
83
|
+
languageOptions: {
|
|
84
|
+
ecmaVersion: 2022,
|
|
85
|
+
sourceType: "module",
|
|
86
|
+
globals: {
|
|
87
|
+
// Browser globals
|
|
88
|
+
window: "readonly",
|
|
89
|
+
document: "readonly",
|
|
90
|
+
console: "readonly",
|
|
91
|
+
performance: "readonly",
|
|
92
|
+
navigator: "readonly",
|
|
93
|
+
location: "readonly",
|
|
94
|
+
localStorage: "readonly",
|
|
95
|
+
sessionStorage: "readonly",
|
|
96
|
+
fetch: "readonly",
|
|
97
|
+
setTimeout: "readonly",
|
|
98
|
+
setInterval: "readonly",
|
|
99
|
+
clearTimeout: "readonly",
|
|
100
|
+
clearInterval: "readonly",
|
|
101
|
+
requestAnimationFrame: "readonly",
|
|
102
|
+
cancelAnimationFrame: "readonly",
|
|
103
|
+
alert: "readonly",
|
|
104
|
+
confirm: "readonly",
|
|
105
|
+
prompt: "readonly"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
rules: {
|
|
109
|
+
// Variables
|
|
110
|
+
"no-unused-vars": "warn",
|
|
111
|
+
"no-undef": "error",
|
|
112
|
+
"no-use-before-define": ["error", { functions: false, classes: true }],
|
|
113
|
+
"no-shadow": "warn",
|
|
114
|
+
"no-redeclare": "error",
|
|
115
|
+
// Best Practices
|
|
116
|
+
eqeqeq: ["warn", "always", { null: "ignore" }],
|
|
117
|
+
"no-eval": "error",
|
|
118
|
+
"no-implied-eval": "error",
|
|
119
|
+
"no-new-func": "error",
|
|
120
|
+
"no-return-await": "warn",
|
|
121
|
+
"require-await": "warn",
|
|
122
|
+
"no-throw-literal": "error",
|
|
123
|
+
"no-unmodified-loop-condition": "error",
|
|
124
|
+
"no-constant-condition": "warn",
|
|
125
|
+
"no-debugger": "error",
|
|
126
|
+
// Code Quality
|
|
127
|
+
"no-duplicate-case": "error",
|
|
128
|
+
"no-empty": ["error", { allowEmptyCatch: true }],
|
|
129
|
+
"no-empty-pattern": "error",
|
|
130
|
+
"no-fallthrough": "error",
|
|
131
|
+
"no-sparse-arrays": "error",
|
|
132
|
+
"no-unreachable": "error",
|
|
133
|
+
"use-isnan": "error",
|
|
134
|
+
"valid-typeof": "error",
|
|
135
|
+
// Style (Optional but recommended)
|
|
136
|
+
"no-trailing-spaces": "warn",
|
|
137
|
+
"no-multi-spaces": "warn",
|
|
138
|
+
// ES6+ Features
|
|
139
|
+
"prefer-const": "warn",
|
|
140
|
+
"no-var": "warn",
|
|
141
|
+
"prefer-template": "warn",
|
|
142
|
+
"no-useless-concat": "warn",
|
|
143
|
+
// Error Prevention
|
|
144
|
+
"no-cond-assign": "error",
|
|
145
|
+
"no-constant-binary-expression": "error",
|
|
146
|
+
"no-dupe-args": "error",
|
|
147
|
+
"no-dupe-keys": "error",
|
|
148
|
+
"no-duplicate-imports": "error",
|
|
149
|
+
"no-ex-assign": "error",
|
|
150
|
+
"no-func-assign": "error",
|
|
151
|
+
"no-import-assign": "error",
|
|
152
|
+
"no-irregular-whitespace": "error",
|
|
153
|
+
"no-misleading-character-class": "error",
|
|
154
|
+
"no-prototype-builtins": "warn",
|
|
155
|
+
"no-unexpected-multiline": "error",
|
|
156
|
+
// Security
|
|
157
|
+
"no-script-url": "error",
|
|
158
|
+
"no-unsafe-optional-chaining": "error",
|
|
159
|
+
// Performance
|
|
160
|
+
"no-loop-func": "warn",
|
|
161
|
+
"no-await-in-loop": "warn"
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
var globalOptions = {
|
|
165
|
+
overlay: {
|
|
166
|
+
Overlay: "readonly",
|
|
167
|
+
toast: "readonly"
|
|
168
|
+
},
|
|
169
|
+
code: {
|
|
170
|
+
done: "readonly",
|
|
171
|
+
log: "readonly",
|
|
172
|
+
addLog: "readonly",
|
|
173
|
+
showToast: "readonly",
|
|
174
|
+
getVariable: "readonly",
|
|
175
|
+
getAllVariables: "readonly",
|
|
176
|
+
setVariable: "readonly",
|
|
177
|
+
deleteVariable: "readonly",
|
|
178
|
+
getStore: "readonly",
|
|
179
|
+
getStoreItem: "readonly",
|
|
180
|
+
setStore: "readonly",
|
|
181
|
+
resetStore: "readonly",
|
|
182
|
+
getLights: "readonly",
|
|
183
|
+
sendColor: "readonly",
|
|
184
|
+
getCommands: "readonly",
|
|
185
|
+
getAllCommands: "readonly",
|
|
186
|
+
getApiOptions: "readonly",
|
|
187
|
+
callAlert: "readonly",
|
|
188
|
+
callCommand: "readonly",
|
|
189
|
+
callTwitchPoint: "readonly",
|
|
190
|
+
callTwitchExtension: "readonly",
|
|
191
|
+
callTrovoSpell: "readonly",
|
|
192
|
+
readFile: "readonly",
|
|
193
|
+
writeFile: "readonly",
|
|
194
|
+
hexToRgb: "readonly",
|
|
195
|
+
tts: "readonly",
|
|
196
|
+
chatbot: "readonly",
|
|
197
|
+
execShellCommand: "readonly",
|
|
198
|
+
playAudio: "readonly",
|
|
199
|
+
sendRawObsJson: "readonly",
|
|
200
|
+
setObsSceneItem: "readonly",
|
|
201
|
+
actions: "readonly",
|
|
202
|
+
delay: "readonly",
|
|
203
|
+
getToken: "readonly",
|
|
204
|
+
getClientId: "readonly",
|
|
205
|
+
overlayAlertTrigger: "readonly",
|
|
206
|
+
overlaySetVisibility: "readonly",
|
|
207
|
+
overlaySetLayerVisibility: "readonly",
|
|
208
|
+
overlaySetLayerPosition: "readonly",
|
|
209
|
+
overlaySetTextContent: "readonly",
|
|
210
|
+
overlaySetImageContent: "readonly",
|
|
211
|
+
overlaySetVideoContent: "readonly",
|
|
212
|
+
overlaySetAudioContent: "readonly",
|
|
213
|
+
overlaySetVolume: "readonly",
|
|
214
|
+
overlayPlayPauseMedia: "readonly",
|
|
215
|
+
overlaySendHfx: "readonly",
|
|
216
|
+
overlayTimer: "readonly",
|
|
217
|
+
overlayShoutout: "readonly",
|
|
218
|
+
overlaySendCustomContent: "readonly"
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
var codeMirrorlinterOptions = (type, language = "js") => {
|
|
222
|
+
if (type === "overlay") {
|
|
223
|
+
return {
|
|
224
|
+
js: {
|
|
225
|
+
...jsOptions,
|
|
226
|
+
languageOptions: {
|
|
227
|
+
...jsOptions.languageOptions,
|
|
228
|
+
globals: {
|
|
229
|
+
...jsOptions.languageOptions.globals,
|
|
230
|
+
...globalOptions.overlay
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
} else if (type === "code") {
|
|
236
|
+
return {
|
|
237
|
+
js: {
|
|
238
|
+
...jsOptions,
|
|
239
|
+
languageOptions: {
|
|
240
|
+
...jsOptions.languageOptions,
|
|
241
|
+
globals: {
|
|
242
|
+
...jsOptions.languageOptions.globals,
|
|
243
|
+
...globalOptions.code
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
return { js: jsOptions };
|
|
250
|
+
};
|
|
80
251
|
export {
|
|
81
252
|
LSButton,
|
|
253
|
+
codeMirrorlinterOptions,
|
|
82
254
|
variableCompletionOptions
|
|
83
255
|
};
|