@xano/xanoscript-monaco-editor 0.1.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/README.md +181 -0
- package/dist/.vite/manifest.json +300 -0
- package/dist/assets/_.contribution-BThlLkzn.js +1 -0
- package/dist/assets/_commonjsHelpers-CqkleIqs.js +1 -0
- package/dist/assets/codicon-MLkmQ__h.ttf +0 -0
- package/dist/assets/dark_modern-0rclP-7t.json +1 -0
- package/dist/assets/dark_vs-BL-mUvcK.json +1 -0
- package/dist/assets/editor-BivTGeL1.js +1 -0
- package/dist/assets/editor.worker-BF3gnKDz.js +28 -0
- package/dist/assets/extensionHost.worker-bYZXB0kM.js +144 -0
- package/dist/assets/fake-DXkbmQ09.html +10 -0
- package/dist/assets/files.contribution._fileEditorFactory-vS4ZLYi1.js +4 -0
- package/dist/assets/hc_black-BX9MT4w9.json +1 -0
- package/dist/assets/hc_light-Bzw0ew6e.json +1 -0
- package/dist/assets/iconv-lite-umd-DQaTktu2.js +11 -0
- package/dist/assets/iconv-lite-umd-DYWd8cEa.js +11 -0
- package/dist/assets/index-51WpeTZl.js +11 -0
- package/dist/assets/index-B0wc3Rza.css +1 -0
- package/dist/assets/index-B132pG6E.js +11 -0
- package/dist/assets/index-BGwiFEyd.js +1 -0
- package/dist/assets/index-BPOe4Pu5.css +1 -0
- package/dist/assets/index-BwfWF2CI.js +1433 -0
- package/dist/assets/index-C25FTAfE.js +15 -0
- package/dist/assets/index-C3pnKX8a.js +1 -0
- package/dist/assets/index-CEhqlLL9.css +1 -0
- package/dist/assets/index-Cg3XqiaZ.html +1284 -0
- package/dist/assets/index-CrbRjSB_.js +1 -0
- package/dist/assets/index-D1zNXs16.css +1 -0
- package/dist/assets/index-DgK2LcnW.js +2 -0
- package/dist/assets/index-VRHnXpb2.js +18 -0
- package/dist/assets/index-no-csp-DMfG5HRS.html +1251 -0
- package/dist/assets/index-yPQeQvu7.js +1 -0
- package/dist/assets/layout.contribution.darwin-gdaUfoJf.js +1 -0
- package/dist/assets/layout.contribution.linux-xMjRz7iy.js +1 -0
- package/dist/assets/layout.contribution.win-DZRWibbm.js +1 -0
- package/dist/assets/light_modern-Bbk8M7yq.json +1 -0
- package/dist/assets/light_vs-DwwM7VRG.json +1 -0
- package/dist/assets/main-D6ceXGB_.js +4 -0
- package/dist/assets/main-DNugpDp4.js +4 -0
- package/dist/assets/main-FP17jmvp.js +1 -0
- package/dist/assets/main-b5eBH2vx.js +1 -0
- package/dist/assets/onig-Du5pRr7Y.wasm +0 -0
- package/dist/assets/service-worker-Ce0epi43.js +371 -0
- package/dist/assets/tokenClassificationRegistry-DcBtqg2t.js +2 -0
- package/dist/assets/views-C4cPu3oQ.css +1 -0
- package/dist/assets/views-hUfpm9tT.js +55 -0
- package/dist/assets/webWorkerExtensionHostIframe-636UTAtK.html +156 -0
- package/dist/assets/workbenchThemeService.service-qBFVnuYD.js +1 -0
- package/dist/assets/worker-BIMDXoFp.js +8 -0
- package/dist/index.html +14 -0
- package/dist/logic-assistant-script.js +21798 -0
- package/dist/logic-assistant-script.js.map +7 -0
- package/dist/worker.js +32433 -0
- package/dist/worker.js.map +7 -0
- package/package.json +46 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Content-Security-Policy" content="
|
|
5
|
+
default-src 'none';
|
|
6
|
+
child-src 'self' data: blob:;
|
|
7
|
+
script-src 'self' 'unsafe-eval' 'sha256-O8NK++6jfjVooqQN8mkcEKUM19Yc4nx5RZXws6U2sao=' data: extension-file: https: http://localhost:* blob:;
|
|
8
|
+
connect-src 'self' data: extension-file: https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<script>
|
|
12
|
+
(function () {
|
|
13
|
+
const searchParams = new URL(document.location.href).searchParams;
|
|
14
|
+
const vscodeWebWorkerExtHostId = searchParams.get('vscodeWebWorkerExtHostId') || '';
|
|
15
|
+
const name = searchParams.get('debugged') ? 'DebugExtensionHostWorker' : 'ExtensionHostWorker';
|
|
16
|
+
const parentOrigin = searchParams.get('parentOrigin') || window.origin;
|
|
17
|
+
const salt = searchParams.get('salt');
|
|
18
|
+
|
|
19
|
+
(async function () {
|
|
20
|
+
const hostnameValidationMarker = 'v--';
|
|
21
|
+
const hostname = location.hostname;
|
|
22
|
+
if (!hostname.startsWith(hostnameValidationMarker)) {
|
|
23
|
+
// validation not requested
|
|
24
|
+
return start();
|
|
25
|
+
}
|
|
26
|
+
if (!crypto.subtle) {
|
|
27
|
+
// cannot validate, not running in a secure context
|
|
28
|
+
return sendError(new Error(`Cannot validate in current context!`));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Here the `parentOriginHash()` function from `src/vs/base/browser/iframe.ts` is inlined
|
|
32
|
+
// compute a sha-256 composed of `parentOrigin` and `salt` converted to base 32
|
|
33
|
+
/** @type {string} */
|
|
34
|
+
let parentOriginHash;
|
|
35
|
+
try {
|
|
36
|
+
const strData = JSON.stringify({ parentOrigin, salt });
|
|
37
|
+
const encoder = new TextEncoder();
|
|
38
|
+
const arrData = encoder.encode(strData);
|
|
39
|
+
const hash = await crypto.subtle.digest('sha-256', arrData);
|
|
40
|
+
const hashArray = Array.from(new Uint8Array(hash));
|
|
41
|
+
const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
|
|
42
|
+
// sha256 has 256 bits, so we need at most ceil(lg(2^256-1)/lg(32)) = 52 chars to represent it in base 32
|
|
43
|
+
parentOriginHash = BigInt(`0x${hashHex}`).toString(32).padStart(52, '0');
|
|
44
|
+
} catch (err) {
|
|
45
|
+
return sendError(err instanceof Error ? err : new Error(String(err)));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const requiredSubdomain = `${hostnameValidationMarker}${parentOriginHash}.`;
|
|
49
|
+
if (hostname.substring(0, requiredSubdomain.length) === requiredSubdomain) {
|
|
50
|
+
// validation succeeded!
|
|
51
|
+
return start();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return sendError(new Error(`Expected '${requiredSubdomain}' as subdomain!`));
|
|
55
|
+
})();
|
|
56
|
+
|
|
57
|
+
function sendError(error) {
|
|
58
|
+
window.parent.postMessage({
|
|
59
|
+
vscodeWebWorkerExtHostId,
|
|
60
|
+
error: {
|
|
61
|
+
name: error ? error.name : '',
|
|
62
|
+
message: error ? error.message : '',
|
|
63
|
+
stack: error ? error.stack : []
|
|
64
|
+
}
|
|
65
|
+
}, '*');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function start() {
|
|
69
|
+
|
|
70
|
+
// Before we can load the worker, we need to get the current set of NLS
|
|
71
|
+
// configuration into this iframe. We ask the parent window to send it
|
|
72
|
+
// together with the necessary information to load the worker via Blob.
|
|
73
|
+
|
|
74
|
+
const bootstrapNlsType = 'vscode.bootstrap.nls';
|
|
75
|
+
|
|
76
|
+
self.onmessage = (event) => {
|
|
77
|
+
if (event.origin !== parentOrigin || event.data.type !== bootstrapNlsType) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const { data } = event.data;
|
|
81
|
+
createWorker(data.workerUrl, data.workerOptions, data.fileRoot, data.nls.messages, data.nls.language);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
window.parent.postMessage({
|
|
85
|
+
vscodeWebWorkerExtHostId,
|
|
86
|
+
type: bootstrapNlsType
|
|
87
|
+
}, '*');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function createWorker(workerUrl, workerOptions, fileRoot, nlsMessages, nlsLanguage) {
|
|
91
|
+
try {
|
|
92
|
+
if (globalThis.crossOriginIsolated) {
|
|
93
|
+
workerUrl += '?vscode-coi=2'; // COEP
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// In below blob code, we are using JSON.stringify to ensure the passed
|
|
97
|
+
// in values are not breaking our script. The values may contain string
|
|
98
|
+
// terminating characters (such as ' or ").
|
|
99
|
+
|
|
100
|
+
const blob = new Blob([[
|
|
101
|
+
`/*extensionHostWorker*/`,
|
|
102
|
+
`globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify(nlsMessages)};`,
|
|
103
|
+
`globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify(nlsLanguage)};`,
|
|
104
|
+
`globalThis._VSCODE_FILE_ROOT = ${JSON.stringify(fileRoot)};`,
|
|
105
|
+
(workerOptions.type === 'module') ? `await import('${workerUrl}');` : `importScripts('${workerUrl}');`,
|
|
106
|
+
`/*extensionHostWorker*/`
|
|
107
|
+
].join('')], { type: 'application/javascript' });
|
|
108
|
+
|
|
109
|
+
const worker = new Worker(URL.createObjectURL(blob), { name, ...workerOptions });
|
|
110
|
+
const nestedWorkers = new Map();
|
|
111
|
+
|
|
112
|
+
worker.onmessage = (event) => {
|
|
113
|
+
const { data } = event;
|
|
114
|
+
|
|
115
|
+
if (data?.type === '_newWorker') {
|
|
116
|
+
const { id, port, url, options } = data;
|
|
117
|
+
const newWorker = new Worker(url, options);
|
|
118
|
+
newWorker.postMessage(port, [port]);
|
|
119
|
+
newWorker.onerror = console.error.bind(console);
|
|
120
|
+
nestedWorkers.set(id, newWorker);
|
|
121
|
+
|
|
122
|
+
} else if (data?.type === '_terminateWorker') {
|
|
123
|
+
const { id } = data;
|
|
124
|
+
if (nestedWorkers.has(id)) {
|
|
125
|
+
nestedWorkers.get(id).terminate();
|
|
126
|
+
nestedWorkers.delete(id);
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
worker.onerror = console.error.bind(console);
|
|
130
|
+
window.parent.postMessage({
|
|
131
|
+
vscodeWebWorkerExtHostId,
|
|
132
|
+
data
|
|
133
|
+
}, parentOrigin, [data]);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
worker.onerror = (event) => {
|
|
138
|
+
console.error(event.message, event.error);
|
|
139
|
+
sendError(event.error);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
self.onmessage = (event) => {
|
|
143
|
+
if (event.origin !== parentOrigin) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
worker.postMessage(event.data, event.ports);
|
|
147
|
+
};
|
|
148
|
+
} catch (err) {
|
|
149
|
+
console.error(err);
|
|
150
|
+
sendError(err);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
})();
|
|
154
|
+
</script>
|
|
155
|
+
</body>
|
|
156
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{tz as e,c0 as r}from"./index-BwfWF2CI.js";const o=e(r);export{o as I};
|