modern-monaco 0.3.2 → 0.3.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/core.mjs +1 -2
- package/dist/editor-core.mjs +1 -3
- package/dist/workspace.mjs +12 -17
- package/package.json +1 -1
package/dist/core.mjs
CHANGED
|
@@ -40,7 +40,7 @@ function isObject(v) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// package.json
|
|
43
|
-
var version = "0.3.
|
|
43
|
+
var version = "0.3.3";
|
|
44
44
|
|
|
45
45
|
// src/core.ts
|
|
46
46
|
import { getExtnameFromLanguageId, getLanguageIdFromPath, grammars, initShiki, setDefaultWasmLoader, themes } from "./shiki.mjs";
|
|
@@ -216,7 +216,6 @@ function lazy(options) {
|
|
|
216
216
|
theme = theme.toLowerCase().replace(/ +/g, "-");
|
|
217
217
|
}
|
|
218
218
|
const highlighter = await initShiki({ ...options, theme, langs });
|
|
219
|
-
renderOptions.theme = highlighter.getLoadedThemes()[0];
|
|
220
219
|
let prerenderEl;
|
|
221
220
|
for (const el of this.children) {
|
|
222
221
|
if (el.className === "monaco-editor-prerender") {
|
package/dist/editor-core.mjs
CHANGED
|
@@ -200145,9 +200145,7 @@ var defaultEditorOptions = {
|
|
|
200145
200145
|
automaticLayout: true,
|
|
200146
200146
|
minimap: { enabled: false },
|
|
200147
200147
|
stickyScroll: { enabled: false },
|
|
200148
|
-
scrollBeyondLastLine: false
|
|
200149
|
-
matchBrackets: "never",
|
|
200150
|
-
theme: "vitesse-dark"
|
|
200148
|
+
scrollBeyondLastLine: false
|
|
200151
200149
|
};
|
|
200152
200150
|
var { create: create3, createModel: createModel2, getModel: getModel2 } = editor;
|
|
200153
200151
|
Object.assign(editor, {
|
package/dist/workspace.mjs
CHANGED
|
@@ -173,32 +173,27 @@ var IndexedDBFileSystem = class {
|
|
|
173
173
|
return stat;
|
|
174
174
|
}
|
|
175
175
|
async createDirectory(name) {
|
|
176
|
-
const now = Date.now();
|
|
177
176
|
const { pathname, href: url } = filenameToURL(name);
|
|
178
177
|
const metaStore = await this._getIdbObjectStore("fs-meta", true);
|
|
178
|
+
const exists = (url2) => promisifyIDBRequest(metaStore.get(url2)).then(Boolean);
|
|
179
|
+
if (await exists(url)) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const now = Date.now();
|
|
179
183
|
const promises = [];
|
|
180
184
|
const newDirs = [];
|
|
181
185
|
let parent = pathname.slice(0, pathname.lastIndexOf("/"));
|
|
182
186
|
while (parent) {
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
})
|
|
190
|
-
);
|
|
191
|
-
newDirs.push(parent);
|
|
187
|
+
const parentUrl = filenameToURL(parent).href;
|
|
188
|
+
if (!await exists(parentUrl)) {
|
|
189
|
+
const stat2 = { type: 2, version: 1, ctime: now, mtime: now, size: 0 };
|
|
190
|
+
promises.push(promisifyIDBRequest(metaStore.add({ url: parentUrl, ...stat2 })));
|
|
191
|
+
newDirs.push(parent);
|
|
192
|
+
}
|
|
192
193
|
parent = parent.slice(0, parent.lastIndexOf("/"));
|
|
193
194
|
}
|
|
194
195
|
const stat = { type: 2, version: 1, ctime: now, mtime: now, size: 0 };
|
|
195
|
-
promises.push(
|
|
196
|
-
promisifyIDBRequest(metaStore.add({ url, ...stat })).catch((error) => {
|
|
197
|
-
if (error.name !== "ConstraintError") {
|
|
198
|
-
throw error;
|
|
199
|
-
}
|
|
200
|
-
})
|
|
201
|
-
);
|
|
196
|
+
promises.push(promisifyIDBRequest(metaStore.add({ url, ...stat })));
|
|
202
197
|
newDirs.push(pathname);
|
|
203
198
|
await Promise.all(promises);
|
|
204
199
|
for (const dir of newDirs) {
|