Merge branch 'main' of github.com:silverbulletmd/silverbullet into main
This commit is contained in:
commit
2ae91d0c5d
162
package-lock.json
generated
162
package-lock.json
generated
@ -9680,14 +9680,6 @@
|
||||
"integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/data-uri-to-buffer": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz",
|
||||
"integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==",
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/data-urls": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz",
|
||||
@ -10662,28 +10654,6 @@
|
||||
"bser": "2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/fetch-blob": {
|
||||
"version": "3.1.5",
|
||||
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.5.tgz",
|
||||
"integrity": "sha512-N64ZpKqoLejlrwkIAnb9iLSA3Vx/kjgzpcDhygcqJ2KKjky8nCgUQ+dzXtbrLaWZGZNmNfQTsiQ0weZ1svglHg==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/jimmywarting"
|
||||
},
|
||||
{
|
||||
"type": "paypal",
|
||||
"url": "https://paypal.me/jimmywarting"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"node-domexception": "^1.0.0",
|
||||
"web-streams-polyfill": "^3.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20 || >= 14.13"
|
||||
}
|
||||
},
|
||||
"node_modules/file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
@ -10751,17 +10721,6 @@
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/formdata-polyfill": {
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
|
||||
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
|
||||
"dependencies": {
|
||||
"fetch-blob": "^3.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.20.0"
|
||||
}
|
||||
},
|
||||
"node_modules/formidable": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/formidable/-/formidable-2.0.1.tgz",
|
||||
@ -13453,24 +13412,6 @@
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-domexception": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
|
||||
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/jimmywarting"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://paypal.me/jimmywarting"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
@ -16315,14 +16256,6 @@
|
||||
"integrity": "sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/web-streams-polyfill": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
|
||||
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==",
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
|
||||
@ -16566,7 +16499,7 @@
|
||||
},
|
||||
"packages/common": {
|
||||
"name": "@silverbulletmd/common",
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": "6.0.1",
|
||||
@ -16590,7 +16523,7 @@
|
||||
},
|
||||
"packages/plugos": {
|
||||
"name": "@plugos/plugos",
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jest/globals": "^27.5.1",
|
||||
@ -16604,6 +16537,7 @@
|
||||
"esbuild": "^0.14.27",
|
||||
"express": "^4.17.3",
|
||||
"fake-indexeddb": "^3.1.7",
|
||||
"form-data": "^4.0.0",
|
||||
"jest": "^27.5.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"knex": "^1.0.4",
|
||||
@ -16645,12 +16579,12 @@
|
||||
},
|
||||
"packages/plugos-silverbullet-syscall": {
|
||||
"name": "@silverbulletmd/plugos-silverbullet-syscall",
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT"
|
||||
},
|
||||
"packages/plugos-syscall": {
|
||||
"name": "@plugos/plugos-syscall",
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT"
|
||||
},
|
||||
"packages/plugos/node_modules/@lezer/common": {
|
||||
@ -18013,13 +17947,13 @@
|
||||
},
|
||||
"packages/plugs": {
|
||||
"name": "@silverbulletmd/plugs",
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jest/globals": "^27.5.1",
|
||||
"@lezer/generator": "1.0.0",
|
||||
"@lezer/lr": "1.0.0",
|
||||
"@silverbulletmd/common": "^0.0.22",
|
||||
"@silverbulletmd/common": "^0.0.25",
|
||||
"@types/yaml": "^1.9.7",
|
||||
"handlebars": "^4.7.7",
|
||||
"markdown-it": "^12.3.2",
|
||||
@ -18052,7 +17986,7 @@
|
||||
},
|
||||
"packages/server": {
|
||||
"name": "@silverbulletmd/server",
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/lang-javascript": "6.0.0",
|
||||
@ -18060,9 +17994,9 @@
|
||||
"@codemirror/legacy-modes": "6.0.0",
|
||||
"@jest/globals": "^27.5.1",
|
||||
"@lezer/markdown": "1.0.1",
|
||||
"@silverbulletmd/common": "^0.0.22",
|
||||
"@silverbulletmd/plugs": "^0.0.22",
|
||||
"@silverbulletmd/web": "^0.0.22",
|
||||
"@silverbulletmd/common": "^0.0.25",
|
||||
"@silverbulletmd/plugs": "^0.0.25",
|
||||
"@silverbulletmd/web": "^0.0.25",
|
||||
"better-sqlite3": "^7.5.0",
|
||||
"body-parser": "^1.19.2",
|
||||
"buffer": "^6.0.3",
|
||||
@ -18072,6 +18006,7 @@
|
||||
"events": "^3.3.0",
|
||||
"express": "^4.17.3",
|
||||
"fake-indexeddb": "^3.1.7",
|
||||
"form-data": "^4.0.0",
|
||||
"jest": "^27.5.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"knex": "^1.0.4",
|
||||
@ -19157,7 +19092,7 @@
|
||||
},
|
||||
"packages/web": {
|
||||
"name": "@silverbulletmd/web",
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": "6.0.1",
|
||||
@ -19179,7 +19114,6 @@
|
||||
"fuzzysort": "^1.9.0",
|
||||
"jest": "^27.5.1",
|
||||
"knex": "^1.0.4",
|
||||
"node-fetch": "^3.2.6",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2"
|
||||
},
|
||||
@ -20209,23 +20143,6 @@
|
||||
"integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==",
|
||||
"dev": true
|
||||
},
|
||||
"packages/web/node_modules/node-fetch": {
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.6.tgz",
|
||||
"integrity": "sha512-LAy/HZnLADOVkVPubaxHDft29booGglPFDr2Hw0J1AercRh01UiVFm++KMDnJeH9sHgNB4hsXPii7Sgym/sTbw==",
|
||||
"dependencies": {
|
||||
"data-uri-to-buffer": "^4.0.0",
|
||||
"fetch-blob": "^3.1.4",
|
||||
"formdata-polyfill": "^4.0.10"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/node-fetch"
|
||||
}
|
||||
},
|
||||
"packages/web/node_modules/node-gyp-build-optional-packages": {
|
||||
"version": "4.3.5",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-4.3.5.tgz",
|
||||
@ -25644,6 +25561,7 @@
|
||||
"events": "^3.3.0",
|
||||
"express": "^4.17.3",
|
||||
"fake-indexeddb": "^3.1.7",
|
||||
"form-data": "^4.0.0",
|
||||
"jest": "^27.5.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"knex": "^1.0.4",
|
||||
@ -26544,7 +26462,7 @@
|
||||
"@jest/globals": "^27.5.1",
|
||||
"@lezer/generator": "1.0.0",
|
||||
"@lezer/lr": "1.0.0",
|
||||
"@silverbulletmd/common": "^0.0.22",
|
||||
"@silverbulletmd/common": "^0.0.25",
|
||||
"@types/markdown-it": "^12.2.3",
|
||||
"@types/yaml": "^1.9.7",
|
||||
"handlebars": "^4.7.7",
|
||||
@ -26585,9 +26503,9 @@
|
||||
"@parcel/transformer-sass": "2.5.0",
|
||||
"@parcel/transformer-webmanifest": "2.5.0",
|
||||
"@parcel/validator-typescript": "2.5.0",
|
||||
"@silverbulletmd/common": "^0.0.22",
|
||||
"@silverbulletmd/plugs": "^0.0.22",
|
||||
"@silverbulletmd/web": "^0.0.22",
|
||||
"@silverbulletmd/common": "^0.0.25",
|
||||
"@silverbulletmd/plugs": "^0.0.25",
|
||||
"@silverbulletmd/web": "^0.0.25",
|
||||
"@types/cors": "^2.8.12",
|
||||
"@types/events": "^3.0.0",
|
||||
"@types/express": "^4.17.13",
|
||||
@ -26603,6 +26521,7 @@
|
||||
"events": "^3.3.0",
|
||||
"express": "^4.17.3",
|
||||
"fake-indexeddb": "^3.1.7",
|
||||
"form-data": "^4.0.0",
|
||||
"jest": "^27.5.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"knex": "^1.0.4",
|
||||
@ -27303,7 +27222,6 @@
|
||||
"fuzzysort": "^1.9.0",
|
||||
"jest": "^27.5.1",
|
||||
"knex": "^1.0.4",
|
||||
"node-fetch": "^3.2.6",
|
||||
"nodemon": "^2.0.18",
|
||||
"parcel": "2.5.0",
|
||||
"prettier": "^2.5.1",
|
||||
@ -27933,16 +27851,6 @@
|
||||
"integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.6.tgz",
|
||||
"integrity": "sha512-LAy/HZnLADOVkVPubaxHDft29booGglPFDr2Hw0J1AercRh01UiVFm++KMDnJeH9sHgNB4hsXPii7Sgym/sTbw==",
|
||||
"requires": {
|
||||
"data-uri-to-buffer": "^4.0.0",
|
||||
"fetch-blob": "^3.1.4",
|
||||
"formdata-polyfill": "^4.0.10"
|
||||
}
|
||||
},
|
||||
"node-gyp-build-optional-packages": {
|
||||
"version": "4.3.5",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-4.3.5.tgz",
|
||||
@ -29249,11 +29157,6 @@
|
||||
"integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==",
|
||||
"dev": true
|
||||
},
|
||||
"data-uri-to-buffer": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz",
|
||||
"integrity": "sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA=="
|
||||
},
|
||||
"data-urls": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz",
|
||||
@ -29878,15 +29781,6 @@
|
||||
"bser": "2.1.1"
|
||||
}
|
||||
},
|
||||
"fetch-blob": {
|
||||
"version": "3.1.5",
|
||||
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.1.5.tgz",
|
||||
"integrity": "sha512-N64ZpKqoLejlrwkIAnb9iLSA3Vx/kjgzpcDhygcqJ2KKjky8nCgUQ+dzXtbrLaWZGZNmNfQTsiQ0weZ1svglHg==",
|
||||
"requires": {
|
||||
"node-domexception": "^1.0.0",
|
||||
"web-streams-polyfill": "^3.0.3"
|
||||
}
|
||||
},
|
||||
"file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
@ -29942,14 +29836,6 @@
|
||||
"mime-types": "^2.1.12"
|
||||
}
|
||||
},
|
||||
"formdata-polyfill": {
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
|
||||
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
|
||||
"requires": {
|
||||
"fetch-blob": "^3.1.2"
|
||||
}
|
||||
},
|
||||
"formidable": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/formidable/-/formidable-2.0.1.tgz",
|
||||
@ -31884,11 +31770,6 @@
|
||||
"resolved": "https://registry.npmjs.org/node-cron/-/node-cron-3.0.1.tgz",
|
||||
"integrity": "sha512-RAWZTNn2M5KDIUV/389UX0EXsqvdFAwc9QwHQceh0Ga56dygqSRthqIjwpgZsoDspHGt2rkHdk9Z4RgfPMdALw=="
|
||||
},
|
||||
"node-domexception": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
|
||||
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
@ -33923,11 +33804,6 @@
|
||||
"integrity": "sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw==",
|
||||
"dev": true
|
||||
},
|
||||
"web-streams-polyfill": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz",
|
||||
"integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q=="
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
|
||||
|
@ -4,7 +4,7 @@
|
||||
"name": "Zef Hemel",
|
||||
"email": "zef@zef.me"
|
||||
},
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": "6.0.1",
|
||||
|
@ -4,6 +4,6 @@
|
||||
"name": "Zef Hemel",
|
||||
"email": "zef@zef.me"
|
||||
},
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
@ -4,6 +4,6 @@
|
||||
"name": "Zef Hemel",
|
||||
"email": "zef@zef.me"
|
||||
},
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
@ -120,6 +120,10 @@ async function run() {
|
||||
if (
|
||||
filename.endsWith(".plug.yaml") ||
|
||||
filename.endsWith(".js") ||
|
||||
filename.endsWith(".css") ||
|
||||
filename.endsWith(".png") ||
|
||||
filename.endsWith(".jpg") ||
|
||||
filename.endsWith(".gif") ||
|
||||
(filename.endsWith(".ts") && !filename.endsWith("_in.ts"))
|
||||
) {
|
||||
console.log("Change detected", eventType, filename);
|
||||
|
@ -41,6 +41,12 @@ export async function compile(
|
||||
outfile: outFile,
|
||||
metafile: true,
|
||||
external: excludeModules,
|
||||
loader: {
|
||||
".css": "text",
|
||||
".png": "dataurl",
|
||||
".gif": "dataurl",
|
||||
".jpg": "dataurl",
|
||||
},
|
||||
absWorkingDir: path.resolve(path.dirname(inFile)),
|
||||
});
|
||||
|
||||
|
@ -28,6 +28,9 @@ let consoleLogger = new ConsoleLogger((level, message) => {
|
||||
|
||||
let loadedModules = new Map<string, any>();
|
||||
|
||||
// HACK to make Mattermost client work...
|
||||
loadedModules.set("form-data", require(`${nodeModulesPath}/form-data`));
|
||||
|
||||
let vm = new VM({
|
||||
sandbox: {
|
||||
// Exposing some "safe" APIs
|
||||
|
@ -4,7 +4,7 @@
|
||||
"name": "Zef Hemel",
|
||||
"email": "zef@zef.me"
|
||||
},
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"plugos-bundle": "./dist/plugos/plugos-bundle.js",
|
||||
@ -50,6 +50,7 @@
|
||||
"esbuild": "^0.14.27",
|
||||
"express": "^4.17.3",
|
||||
"fake-indexeddb": "^3.1.7",
|
||||
"form-data": "^4.0.0",
|
||||
"jest": "^27.5.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"knex": "^1.0.4",
|
||||
|
@ -14,6 +14,20 @@ syntax:
|
||||
color: "#0330cb"
|
||||
textDecoration: underline
|
||||
cursor: pointer
|
||||
CommandLink:
|
||||
firstCharacters:
|
||||
- "{"
|
||||
regex: "\\{\\[[^\\]]+\\]\\}"
|
||||
styles:
|
||||
#color: "#1e62a0"
|
||||
backgroundColor: "#e3dfdf"
|
||||
cursor: pointer
|
||||
borderTop: 1px solid silver
|
||||
borderLeft: 1px solid silver
|
||||
borderBottom: 1px solid gray
|
||||
borderRight: 1px solid gray
|
||||
borderRadius: 4px
|
||||
padding: 0 4px
|
||||
functions:
|
||||
clearPageIndex:
|
||||
path: "./page.ts:clearPageIndex"
|
||||
|
@ -7,6 +7,7 @@ import {
|
||||
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
|
||||
import { nodeAtPos, ParseTree } from "@silverbulletmd/common/tree";
|
||||
import { invokeCommand } from "@silverbulletmd/plugos-silverbullet-syscall/system";
|
||||
|
||||
async function actionClickOrActionEnter(mdTree: ParseTree | null) {
|
||||
if (!mdTree) {
|
||||
@ -29,6 +30,13 @@ async function actionClickOrActionEnter(mdTree: ParseTree | null) {
|
||||
case "Link":
|
||||
await openUrl(mdTree.children![4].children![0].text!);
|
||||
break;
|
||||
case "CommandLink":
|
||||
let command = mdTree
|
||||
.children![0].text!.substring(2, mdTree.children![0].text!.length - 2)
|
||||
.trim();
|
||||
console.log("Got command link", command);
|
||||
await invokeCommand(command);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,15 @@
|
||||
import { readYamlPage } from "./yaml_page";
|
||||
|
||||
/**
|
||||
* Convenience function to read a specific set of settings from the `SETTINGS` page as well as default values
|
||||
* in case they are not specified.
|
||||
* Example: `await readSettings({showPreview: false})` will return an object like `{showPreview: false}` (or `true`)
|
||||
* in case this setting is specifically set in the `SETTINGS` page.
|
||||
*
|
||||
* @param settings object with settings to fetch and their default values
|
||||
* @returns an object with the same shape as `settings` but with non-default values override based on `SETTINGS`
|
||||
*/
|
||||
|
||||
export async function readSettings<T extends object>(settings: T): Promise<T> {
|
||||
try {
|
||||
let allSettings = (await readYamlPage("SETTINGS", ["yaml"])) || {};
|
||||
|
@ -12,4 +12,5 @@ functions:
|
||||
events:
|
||||
- plug:load
|
||||
- editor:updated
|
||||
- editor:pageSwitched
|
||||
- editor:pageLoaded
|
||||
- editor:pageReloaded
|
||||
|
@ -4,7 +4,7 @@
|
||||
"name": "Zef Hemel",
|
||||
"email": "zef@zef.me"
|
||||
},
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"generate": "lezer-generator query/query.grammar -o query/parse-query.js",
|
||||
@ -34,7 +34,7 @@
|
||||
"@jest/globals": "^27.5.1",
|
||||
"@lezer/generator": "1.0.0",
|
||||
"@lezer/lr": "1.0.0",
|
||||
"@silverbulletmd/common": "^0.0.22",
|
||||
"@silverbulletmd/common": "^0.0.25",
|
||||
"@types/yaml": "^1.9.7",
|
||||
"handlebars": "^4.7.7",
|
||||
"markdown-it": "^12.3.2",
|
||||
|
@ -144,6 +144,17 @@ export async function renderQuery(
|
||||
if (parsedQuery.render) {
|
||||
Handlebars.registerHelper("json", (v) => JSON.stringify(v));
|
||||
Handlebars.registerHelper("niceDate", (ts) => niceDate(new Date(ts)));
|
||||
Handlebars.registerHelper("prefixLines", (v: string, prefix) =>
|
||||
v
|
||||
.split("\n")
|
||||
.map((l) => prefix + l)
|
||||
.join("\n")
|
||||
);
|
||||
|
||||
Handlebars.registerHelper("substring", (s, from, to, elipsis = "") =>
|
||||
s.length > to - from ? s.substring(from, to) + elipsis : s
|
||||
);
|
||||
|
||||
Handlebars.registerHelper("yaml", (v, prefix) => {
|
||||
if (typeof prefix === "string") {
|
||||
let yaml = YAML.stringify(v)
|
||||
|
@ -4,7 +4,7 @@
|
||||
"name": "Zef Hemel",
|
||||
"email": "zef@zef.me"
|
||||
},
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"silverbullet": "./dist/server/server.js"
|
||||
@ -39,9 +39,9 @@
|
||||
"@codemirror/legacy-modes": "6.0.0",
|
||||
"@jest/globals": "^27.5.1",
|
||||
"@lezer/markdown": "1.0.1",
|
||||
"@silverbulletmd/common": "^0.0.22",
|
||||
"@silverbulletmd/plugs": "^0.0.22",
|
||||
"@silverbulletmd/web": "^0.0.22",
|
||||
"@silverbulletmd/common": "^0.0.25",
|
||||
"@silverbulletmd/plugs": "^0.0.25",
|
||||
"@silverbulletmd/web": "^0.0.25",
|
||||
"better-sqlite3": "^7.5.0",
|
||||
"body-parser": "^1.19.2",
|
||||
"buffer": "^6.0.3",
|
||||
@ -51,6 +51,7 @@
|
||||
"events": "^3.3.0",
|
||||
"express": "^4.17.3",
|
||||
"fake-indexeddb": "^3.1.7",
|
||||
"form-data": "^4.0.0",
|
||||
"jest": "^27.5.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"knex": "^1.0.4",
|
||||
|
@ -582,6 +582,8 @@ export class Editor {
|
||||
|
||||
if (loadingDifferentPage) {
|
||||
await this.eventHook.dispatchEvent("editor:pageLoaded", pageName);
|
||||
} else {
|
||||
await this.eventHook.dispatchEvent("editor:pageReloaded", pageName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -598,11 +600,13 @@ export class Editor {
|
||||
if (pageState) {
|
||||
// Restore state
|
||||
// console.log("Restoring selection state", pageState);
|
||||
editorView.scrollDOM.scrollTop = pageState!.scrollTop;
|
||||
editorView.dispatch({
|
||||
selection: pageState.selection,
|
||||
scrollIntoView: true,
|
||||
});
|
||||
editorView.scrollDOM.scrollTop = pageState!.scrollTop;
|
||||
} else {
|
||||
editorView.scrollDOM.scrollTop = 0;
|
||||
}
|
||||
editorView.focus();
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
"name": "Zef Hemel",
|
||||
"email": "zef@zef.me"
|
||||
},
|
||||
"version": "0.0.22",
|
||||
"version": "0.0.25",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"watch": "rm -rf .parcel-cache && parcel watch",
|
||||
@ -45,7 +45,6 @@
|
||||
"fuzzysort": "^1.9.0",
|
||||
"jest": "^27.5.1",
|
||||
"knex": "^1.0.4",
|
||||
"node-fetch": "^3.2.6",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user