hyperbook 0.89.3 → 0.91.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/dist/assets/code-input/auto-close-brackets.min.js +1 -1
- package/dist/assets/code-input/code-input.min.css +1 -1
- package/dist/assets/code-input/code-input.min.js +12 -1
- package/dist/assets/code-input/indent.min.js +1 -1
- package/dist/assets/directive-excalidraw/hyperbook-excalidraw.umd.js +1 -1
- package/dist/assets/directive-onlineide/style.css +8 -0
- package/dist/assets/directive-p5/client.js +113 -0
- package/dist/assets/directive-p5/style.css +67 -3
- package/dist/assets/directive-pyide/client.js +1215 -144
- package/dist/assets/directive-pyide/style.css +183 -6
- package/dist/assets/directive-sqlide/style.css +8 -0
- package/dist/assets/directive-typst/client.js +154 -14
- package/dist/assets/directive-typst/style.css +65 -4
- package/dist/assets/directive-webide/client.js +114 -0
- package/dist/assets/directive-webide/style.css +61 -3
- package/dist/index.js +432 -56
- package/dist/locales/de.json +12 -0
- package/dist/locales/en.json +12 -0
- package/package.json +4 -4
- package/dist/assets/directive-pyide/webworker.js +0 -86
package/dist/index.js
CHANGED
|
@@ -55420,7 +55420,13 @@ async function buildSingleBookPage(file, baseCtx, pageList, pagesAndSections, ro
|
|
|
55420
55420
|
const permaOut = path_1.default.join(rootOut, "@");
|
|
55421
55421
|
await (0, make_dir_1.makeDir)(permaOut, { recursive: true });
|
|
55422
55422
|
const permaFileOut = path_1.default.join(permaOut, file.markdown.data.permaid + ".html");
|
|
55423
|
-
|
|
55423
|
+
const redirectUrl = path_1.posix.join("/", hyperbookJson.basePath || "", file.path.href || "");
|
|
55424
|
+
const redirectHtml = `<!DOCTYPE html>
|
|
55425
|
+
<meta charset="utf-8">
|
|
55426
|
+
<meta http-equiv="refresh" content="0; url=${redirectUrl}">
|
|
55427
|
+
<link rel="canonical" href="${redirectUrl}">
|
|
55428
|
+
`;
|
|
55429
|
+
await promises_1.default.writeFile(permaFileOut, redirectHtml);
|
|
55424
55430
|
}
|
|
55425
55431
|
await promises_1.default.writeFile(fileOut, result.value);
|
|
55426
55432
|
return { searchDocuments, directives };
|
|
@@ -171310,6 +171316,166 @@ function remarkGfm(options2) {
|
|
|
171310
171316
|
toMarkdownExtensions.push(gfmToMarkdown(settings));
|
|
171311
171317
|
}
|
|
171312
171318
|
|
|
171319
|
+
// src/langs/hyperbook.tmLanguage.json
|
|
171320
|
+
var hyperbook_tmLanguage_default = {
|
|
171321
|
+
$schema: "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
171322
|
+
name: "hyperbook",
|
|
171323
|
+
scopeName: "source.hyperbook",
|
|
171324
|
+
patterns: [
|
|
171325
|
+
{ include: "#frontmatter" },
|
|
171326
|
+
{ include: "#container-directive" },
|
|
171327
|
+
{ include: "#leaf-directive" },
|
|
171328
|
+
{ include: "#inline-directive" },
|
|
171329
|
+
{ include: "text.html.markdown" }
|
|
171330
|
+
],
|
|
171331
|
+
repository: {
|
|
171332
|
+
frontmatter: {
|
|
171333
|
+
name: "markup.raw.yaml.front-matter.hyperbook",
|
|
171334
|
+
begin: "\\A(-{3})\\s*$",
|
|
171335
|
+
beginCaptures: {
|
|
171336
|
+
"1": {
|
|
171337
|
+
name: "punctuation.definition.frontmatter.hyperbook"
|
|
171338
|
+
}
|
|
171339
|
+
},
|
|
171340
|
+
end: "^(-{3})\\s*$",
|
|
171341
|
+
endCaptures: {
|
|
171342
|
+
"1": {
|
|
171343
|
+
name: "punctuation.definition.frontmatter.hyperbook"
|
|
171344
|
+
}
|
|
171345
|
+
},
|
|
171346
|
+
patterns: [{ include: "source.yaml" }]
|
|
171347
|
+
},
|
|
171348
|
+
"container-directive": {
|
|
171349
|
+
name: "meta.directive.container.hyperbook",
|
|
171350
|
+
begin: "(^|\\G)(:{3,})([a-zA-Z][\\w-]*)(\\{[^}]*\\})?\\s*$",
|
|
171351
|
+
end: "(^|\\G)(\\2)\\s*$",
|
|
171352
|
+
beginCaptures: {
|
|
171353
|
+
"2": {
|
|
171354
|
+
name: "punctuation.definition.directive.hyperbook"
|
|
171355
|
+
},
|
|
171356
|
+
"3": {
|
|
171357
|
+
name: "entity.name.function.directive.hyperbook"
|
|
171358
|
+
},
|
|
171359
|
+
"4": {
|
|
171360
|
+
patterns: [{ include: "#directive-attributes" }]
|
|
171361
|
+
}
|
|
171362
|
+
},
|
|
171363
|
+
endCaptures: {
|
|
171364
|
+
"2": {
|
|
171365
|
+
name: "punctuation.definition.directive.hyperbook"
|
|
171366
|
+
}
|
|
171367
|
+
},
|
|
171368
|
+
patterns: [{ include: "$self" }]
|
|
171369
|
+
},
|
|
171370
|
+
"leaf-directive": {
|
|
171371
|
+
name: "meta.directive.leaf.hyperbook",
|
|
171372
|
+
match: "(^|\\G)(:{2})([a-zA-Z][\\w-]*)(\\[[^\\]]*\\])?(\\{[^}]*\\})?\\s*$",
|
|
171373
|
+
captures: {
|
|
171374
|
+
"2": {
|
|
171375
|
+
name: "punctuation.definition.directive.hyperbook"
|
|
171376
|
+
},
|
|
171377
|
+
"3": {
|
|
171378
|
+
name: "entity.name.function.directive.hyperbook"
|
|
171379
|
+
},
|
|
171380
|
+
"4": {
|
|
171381
|
+
patterns: [{ include: "#directive-label" }]
|
|
171382
|
+
},
|
|
171383
|
+
"5": {
|
|
171384
|
+
patterns: [{ include: "#directive-attributes" }]
|
|
171385
|
+
}
|
|
171386
|
+
}
|
|
171387
|
+
},
|
|
171388
|
+
"inline-directive": {
|
|
171389
|
+
name: "meta.directive.inline.hyperbook",
|
|
171390
|
+
match: "(?<!:)(:)([a-zA-Z][\\w-]*)(\\[[^\\]]*\\])?(\\{[^}]*\\})?",
|
|
171391
|
+
captures: {
|
|
171392
|
+
"1": {
|
|
171393
|
+
name: "punctuation.definition.directive.hyperbook"
|
|
171394
|
+
},
|
|
171395
|
+
"2": {
|
|
171396
|
+
name: "entity.name.function.directive.hyperbook"
|
|
171397
|
+
},
|
|
171398
|
+
"3": {
|
|
171399
|
+
patterns: [{ include: "#directive-label" }]
|
|
171400
|
+
},
|
|
171401
|
+
"4": {
|
|
171402
|
+
patterns: [{ include: "#directive-attributes" }]
|
|
171403
|
+
}
|
|
171404
|
+
}
|
|
171405
|
+
},
|
|
171406
|
+
"directive-attributes": {
|
|
171407
|
+
match: "\\{([^}]*)\\}",
|
|
171408
|
+
captures: {
|
|
171409
|
+
"0": {
|
|
171410
|
+
name: "meta.directive.attributes.hyperbook"
|
|
171411
|
+
},
|
|
171412
|
+
"1": {
|
|
171413
|
+
patterns: [
|
|
171414
|
+
{
|
|
171415
|
+
name: "variable.other.directive.id.hyperbook",
|
|
171416
|
+
match: "#[a-zA-Z][\\w-]*"
|
|
171417
|
+
},
|
|
171418
|
+
{
|
|
171419
|
+
name: "entity.other.attribute-name.class.hyperbook",
|
|
171420
|
+
match: "\\.[a-zA-Z][\\w-]*"
|
|
171421
|
+
},
|
|
171422
|
+
{
|
|
171423
|
+
match: '([a-zA-Z][\\w-]*)\\s*=\\s*"([^"]*)"',
|
|
171424
|
+
captures: {
|
|
171425
|
+
"1": {
|
|
171426
|
+
name: "entity.other.attribute-name.hyperbook"
|
|
171427
|
+
},
|
|
171428
|
+
"2": {
|
|
171429
|
+
name: "string.quoted.double.hyperbook"
|
|
171430
|
+
}
|
|
171431
|
+
}
|
|
171432
|
+
},
|
|
171433
|
+
{
|
|
171434
|
+
match: "([a-zA-Z][\\w-]*)\\s*=\\s*(?:(true|false)|([0-9]+))",
|
|
171435
|
+
captures: {
|
|
171436
|
+
"1": {
|
|
171437
|
+
name: "entity.other.attribute-name.hyperbook"
|
|
171438
|
+
},
|
|
171439
|
+
"2": {
|
|
171440
|
+
name: "constant.language.boolean.hyperbook"
|
|
171441
|
+
},
|
|
171442
|
+
"3": {
|
|
171443
|
+
name: "constant.numeric.hyperbook"
|
|
171444
|
+
}
|
|
171445
|
+
}
|
|
171446
|
+
},
|
|
171447
|
+
{
|
|
171448
|
+
match: '([a-zA-Z][\\w-]*)\\s*=\\s*([^\\s}"]+)',
|
|
171449
|
+
captures: {
|
|
171450
|
+
"1": {
|
|
171451
|
+
name: "entity.other.attribute-name.hyperbook"
|
|
171452
|
+
},
|
|
171453
|
+
"2": {
|
|
171454
|
+
name: "string.unquoted.hyperbook"
|
|
171455
|
+
}
|
|
171456
|
+
}
|
|
171457
|
+
}
|
|
171458
|
+
]
|
|
171459
|
+
}
|
|
171460
|
+
}
|
|
171461
|
+
},
|
|
171462
|
+
"directive-label": {
|
|
171463
|
+
match: "(\\[)([^\\]]*)(\\])",
|
|
171464
|
+
captures: {
|
|
171465
|
+
"1": {
|
|
171466
|
+
name: "punctuation.definition.label.begin.hyperbook"
|
|
171467
|
+
},
|
|
171468
|
+
"2": {
|
|
171469
|
+
name: "string.other.directive.label.hyperbook"
|
|
171470
|
+
},
|
|
171471
|
+
"3": {
|
|
171472
|
+
name: "punctuation.definition.label.end.hyperbook"
|
|
171473
|
+
}
|
|
171474
|
+
}
|
|
171475
|
+
}
|
|
171476
|
+
}
|
|
171477
|
+
};
|
|
171478
|
+
|
|
171313
171479
|
// ../../node_modules/.pnpm/character-reference-invalid@2.0.1/node_modules/character-reference-invalid/index.js
|
|
171314
171480
|
var characterReferenceInvalid = {
|
|
171315
171481
|
0: "\uFFFD",
|
|
@@ -174752,14 +174918,26 @@ var en_default = {
|
|
|
174752
174918
|
"audio-play": "Play/Pause",
|
|
174753
174919
|
"archive-offline": "Offline",
|
|
174754
174920
|
"download-offline": "Offline",
|
|
174921
|
+
"ide-fullscreen-enter": "Fullscreen",
|
|
174922
|
+
"ide-fullscreen-exit": "Exit Fullscreen",
|
|
174755
174923
|
"pyide-run": "Run",
|
|
174924
|
+
"pyide-running": "Running ...",
|
|
174756
174925
|
"pyide-running-click-to-stop": "Running (Click to stop) ...",
|
|
174757
174926
|
"pyide-running-refresh-to-stop": "Running (Refresh to stop) ...",
|
|
174758
174927
|
"pyide-test": "Test",
|
|
174928
|
+
"pyide-testing": "Test running ...",
|
|
174759
174929
|
"pyide-test-running-click-to-stop": "Test running (Click to stop) ...",
|
|
174760
174930
|
"pyide-test-running-refresh-to-stop": "Test running (Refresh to stop) ...",
|
|
174931
|
+
"pyide-stop": "Stop",
|
|
174932
|
+
"pyide-stop-refresh": "Stop (refresh)",
|
|
174933
|
+
"pyide-locked-other-instance-running": "Another PyIDE instance is running",
|
|
174934
|
+
"pyide-stopping": "Stopping ...",
|
|
174935
|
+
"pyide-stop-reloading": "Stopping requires a refresh on this page. Reloading now...",
|
|
174936
|
+
"pyide-stop-refresh-required": "Stop requested. If execution does not stop, refresh the page or enable COOP/COEP headers.",
|
|
174761
174937
|
"pyide-output": "Output",
|
|
174938
|
+
"pyide-canvas": "Canvas",
|
|
174762
174939
|
"pyide-input": "Input",
|
|
174940
|
+
"pyide-input-prompt": "Input required:",
|
|
174763
174941
|
"pyide-reset": "Reset",
|
|
174764
174942
|
"pyide-copy": "Copy",
|
|
174765
174943
|
"pyide-download": "Download",
|
|
@@ -174861,14 +175039,26 @@ var de_default = {
|
|
|
174861
175039
|
"audio-play": "Abspielen/Pause",
|
|
174862
175040
|
"archive-offline": "Offline",
|
|
174863
175041
|
"download-offline": "Offline",
|
|
175042
|
+
"ide-fullscreen-enter": "Vollbild",
|
|
175043
|
+
"ide-fullscreen-exit": "Vollbild beenden",
|
|
174864
175044
|
"pyide-run": "Ausf\xFChren",
|
|
175045
|
+
"pyide-running": "Wird ausgef\xFChrt ...",
|
|
174865
175046
|
"pyide-running-click-to-stop": "Wird ausgef\xFChrt (Klicken zum Stoppen) ...",
|
|
174866
175047
|
"pyide-running-refresh-to-stop": "Wird ausgef\xFChrt (Aktualisieren zum Stoppen) ...",
|
|
174867
175048
|
"pyide-test": "Testen",
|
|
175049
|
+
"pyide-testing": "Test l\xE4uft ...",
|
|
174868
175050
|
"pyide-test-running-click-to-stop": "Test l\xE4uft (Klicken zum Stoppen) ...",
|
|
174869
175051
|
"pyide-test-running-refresh-to-stop": "Test l\xE4uft (Aktualisieren zum Stoppen) ...",
|
|
175052
|
+
"pyide-stop": "Stoppen",
|
|
175053
|
+
"pyide-stop-refresh": "Stoppen (Neuladen)",
|
|
175054
|
+
"pyide-locked-other-instance-running": "Eine andere PyIDE-Instanz l\xE4uft",
|
|
175055
|
+
"pyide-stopping": "Wird gestoppt ...",
|
|
175056
|
+
"pyide-stop-reloading": "Zum Stoppen ist auf dieser Seite ein Neuladen n\xF6tig. Seite wird neu geladen...",
|
|
175057
|
+
"pyide-stop-refresh-required": "Stopp angefordert. Wenn die Ausf\xFChrung nicht stoppt, Seite neu laden oder COOP/COEP-Header aktivieren.",
|
|
174870
175058
|
"pyide-output": "Ausgabe",
|
|
175059
|
+
"pyide-canvas": "Canvas",
|
|
174871
175060
|
"pyide-input": "Eingabe",
|
|
175061
|
+
"pyide-input-prompt": "Eingabe erforderlich:",
|
|
174872
175062
|
"pyide-reset": "Zur\xFCcksetzen",
|
|
174873
175063
|
"pyide-copy": "Kopieren",
|
|
174874
175064
|
"pyide-download": "Herunterladen",
|
|
@@ -177380,7 +177570,7 @@ var remarkDirectiveSqlIde_default = (ctx) => () => {
|
|
|
177380
177570
|
let {
|
|
177381
177571
|
id = hash(node3),
|
|
177382
177572
|
db,
|
|
177383
|
-
height = ctx.config.elements?.sqlide?.height || "
|
|
177573
|
+
height = ctx.config.elements?.sqlide?.height || "calc(100dvh - 80px)"
|
|
177384
177574
|
} = attributes4;
|
|
177385
177575
|
if (!db) {
|
|
177386
177576
|
db = ctx.config.elements?.sqlide?.db ? ctx.makeUrl(ctx.config.elements?.sqlide?.db, "public") : ctx.makeUrl(
|
|
@@ -177432,7 +177622,8 @@ var remarkDirectiveSqlIde_default = (ctx) => () => {
|
|
|
177432
177622
|
}));
|
|
177433
177623
|
data.hName = "div";
|
|
177434
177624
|
data.hProperties = {
|
|
177435
|
-
class: "directive-sqlide"
|
|
177625
|
+
class: "directive-sqlide",
|
|
177626
|
+
style: `--sqlide-height: ${height}`
|
|
177436
177627
|
};
|
|
177437
177628
|
data.hChildren = [
|
|
177438
177629
|
{
|
|
@@ -177440,7 +177631,7 @@ var remarkDirectiveSqlIde_default = (ctx) => () => {
|
|
|
177440
177631
|
tagName: "div",
|
|
177441
177632
|
properties: {
|
|
177442
177633
|
class: "sql-online",
|
|
177443
|
-
style: `
|
|
177634
|
+
style: `padding: 0; margin: 0;`,
|
|
177444
177635
|
"data-sql-online": `{'id': '${id}', "databaseURL": "${db}"}`
|
|
177445
177636
|
},
|
|
177446
177637
|
children: [...codes]
|
|
@@ -185732,7 +185923,7 @@ var remarkDirectiveOnlineIde_default = (ctx) => () => {
|
|
|
185732
185923
|
const data = node3.data || (node3.data = {});
|
|
185733
185924
|
const attributes4 = node3.attributes || {};
|
|
185734
185925
|
const {
|
|
185735
|
-
height = ctx.config.elements?.onlineide?.height || "
|
|
185926
|
+
height = ctx.config.elements?.onlineide?.height || "calc(100dvh - 80px)",
|
|
185736
185927
|
fileList = true,
|
|
185737
185928
|
console: con = true,
|
|
185738
185929
|
pCode = false,
|
|
@@ -185776,7 +185967,8 @@ var remarkDirectiveOnlineIde_default = (ctx) => () => {
|
|
|
185776
185967
|
}));
|
|
185777
185968
|
data.hName = "div";
|
|
185778
185969
|
data.hProperties = {
|
|
185779
|
-
class: "directive-onlineide"
|
|
185970
|
+
class: "directive-onlineide",
|
|
185971
|
+
style: `--onlineide-height: ${height}`
|
|
185780
185972
|
};
|
|
185781
185973
|
data.hChildren = [
|
|
185782
185974
|
{
|
|
@@ -185784,7 +185976,7 @@ var remarkDirectiveOnlineIde_default = (ctx) => () => {
|
|
|
185784
185976
|
tagName: "div",
|
|
185785
185977
|
properties: {
|
|
185786
185978
|
class: "java-online",
|
|
185787
|
-
style: `
|
|
185979
|
+
style: `padding: 0; margin: 0;`,
|
|
185788
185980
|
"data-java-online": `{'id': '${id}', 'speed': ${speed}, 'withBottomPanel': ${bottomPanel},'withPCode': ${pCode},'withConsole': ${con},'withFileList': ${fileList},'withErrorList': ${errorList}, 'libraries': [${libraries?.split(",").map((lib) => `'${lib.trim()}'`)}]}`
|
|
185789
185981
|
},
|
|
185790
185982
|
children: [...codes]
|
|
@@ -195012,10 +195204,11 @@ ${(code4.scripts ? [cdnLibraryUrl, ...code4.scripts] : []).map((src) => `<script
|
|
|
195012
195204
|
if (node3.type === "element" && node3.tagName === "p5") {
|
|
195013
195205
|
const {
|
|
195014
195206
|
src = "",
|
|
195015
|
-
height
|
|
195207
|
+
height,
|
|
195016
195208
|
editor = false,
|
|
195017
195209
|
id = hash(node3)
|
|
195018
195210
|
} = node3.properties || {};
|
|
195211
|
+
const resolvedHeight = height !== void 0 ? typeof height === "number" ? `${height}px` : `${height}` : "calc(100dvh - 80px)";
|
|
195019
195212
|
let bEditor = editor === "true";
|
|
195020
195213
|
expectContainerDirective(node3, file, name);
|
|
195021
195214
|
registerDirective(file, name, ["client.js"], ["style.css"]);
|
|
@@ -195042,9 +195235,10 @@ ${(code4.scripts ? [cdnLibraryUrl, ...code4.scripts] : []).map((src) => `<script
|
|
|
195042
195235
|
const srcdoc = template.replace("###SLOT###", wrapSketch(srcFile)).replace(/\u00A0/g, " ");
|
|
195043
195236
|
node3.tagName = "div";
|
|
195044
195237
|
node3.properties = {
|
|
195045
|
-
class: ["directive-p5", bEditor ? "" : "standalone"].join(" "),
|
|
195238
|
+
class: ["directive-p5", bEditor ? "" : "standalone"].join(" ").trim(),
|
|
195046
195239
|
"data-template": template.replace(/\u00A0/g, " "),
|
|
195047
|
-
"data-id": id
|
|
195240
|
+
"data-id": id,
|
|
195241
|
+
...bEditor && height !== void 0 ? { style: `--p5-height: ${resolvedHeight}` } : {}
|
|
195048
195242
|
};
|
|
195049
195243
|
node3.children = [
|
|
195050
195244
|
{
|
|
@@ -195052,7 +195246,7 @@ ${(code4.scripts ? [cdnLibraryUrl, ...code4.scripts] : []).map((src) => `<script
|
|
|
195052
195246
|
tagName: "div",
|
|
195053
195247
|
properties: {
|
|
195054
195248
|
class: "container",
|
|
195055
|
-
style: `height: ${
|
|
195249
|
+
...!bEditor ? { style: `height: ${resolvedHeight};` } : {}
|
|
195056
195250
|
},
|
|
195057
195251
|
children: [
|
|
195058
195252
|
{
|
|
@@ -195070,6 +195264,16 @@ ${(code4.scripts ? [cdnLibraryUrl, ...code4.scripts] : []).map((src) => `<script
|
|
|
195070
195264
|
]
|
|
195071
195265
|
},
|
|
195072
195266
|
...bEditor ? [
|
|
195267
|
+
{
|
|
195268
|
+
type: "element",
|
|
195269
|
+
tagName: "div",
|
|
195270
|
+
properties: {
|
|
195271
|
+
class: "splitter",
|
|
195272
|
+
role: "separator",
|
|
195273
|
+
"aria-label": "Resize panels"
|
|
195274
|
+
},
|
|
195275
|
+
children: []
|
|
195276
|
+
},
|
|
195073
195277
|
{
|
|
195074
195278
|
type: "element",
|
|
195075
195279
|
tagName: "div",
|
|
@@ -195158,6 +195362,21 @@ ${(code4.scripts ? [cdnLibraryUrl, ...code4.scripts] : []).map((src) => `<script
|
|
|
195158
195362
|
value: i18n.get("p5-download")
|
|
195159
195363
|
}
|
|
195160
195364
|
]
|
|
195365
|
+
},
|
|
195366
|
+
{
|
|
195367
|
+
type: "element",
|
|
195368
|
+
tagName: "button",
|
|
195369
|
+
properties: {
|
|
195370
|
+
class: "fullscreen",
|
|
195371
|
+
title: i18n.get("ide-fullscreen-enter"),
|
|
195372
|
+
"aria-label": i18n.get("ide-fullscreen-enter")
|
|
195373
|
+
},
|
|
195374
|
+
children: [
|
|
195375
|
+
{
|
|
195376
|
+
type: "text",
|
|
195377
|
+
value: "\u26F6"
|
|
195378
|
+
}
|
|
195379
|
+
]
|
|
195161
195380
|
}
|
|
195162
195381
|
]
|
|
195163
195382
|
}
|
|
@@ -195407,6 +195626,14 @@ var remarkDirectiveAbcMusic_default = (ctx) => () => {
|
|
|
195407
195626
|
function htmlEntities2(str2) {
|
|
195408
195627
|
return String(str2).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
195409
195628
|
}
|
|
195629
|
+
function parsePackagesAttribute(value) {
|
|
195630
|
+
if (typeof value !== "string") return [];
|
|
195631
|
+
return Array.from(
|
|
195632
|
+
new Set(
|
|
195633
|
+
value.split(",").map((pkg) => pkg.trim()).filter((pkg) => pkg.length > 0)
|
|
195634
|
+
)
|
|
195635
|
+
);
|
|
195636
|
+
}
|
|
195410
195637
|
var remarkDirectivePyide_default = (ctx) => () => {
|
|
195411
195638
|
const name = "pyide";
|
|
195412
195639
|
return (tree, file) => {
|
|
@@ -195414,7 +195641,9 @@ var remarkDirectivePyide_default = (ctx) => () => {
|
|
|
195414
195641
|
if (isDirective(node3)) {
|
|
195415
195642
|
if (node3.name !== name) return;
|
|
195416
195643
|
const data = node3.data || (node3.data = {});
|
|
195417
|
-
const { src = "", id = hash(node3) } = node3.attributes || {};
|
|
195644
|
+
const { src = "", id = hash(node3), packages, height } = node3.attributes || {};
|
|
195645
|
+
const hasCanvas = "canvas" in (node3.attributes || {});
|
|
195646
|
+
const packageList = parsePackagesAttribute(packages);
|
|
195418
195647
|
expectContainerDirective(node3, file, name);
|
|
195419
195648
|
registerDirective(file, name, ["client.js"], ["style.css"], []);
|
|
195420
195649
|
requestJS(file, ["code-input", "code-input.min.js"]);
|
|
@@ -195423,7 +195652,6 @@ var remarkDirectivePyide_default = (ctx) => () => {
|
|
|
195423
195652
|
requestJS(file, ["code-input", "indent.min.js"]);
|
|
195424
195653
|
let srcFile = "";
|
|
195425
195654
|
let tests = [];
|
|
195426
|
-
let input = "";
|
|
195427
195655
|
if (src) {
|
|
195428
195656
|
srcFile = readFile(src, ctx) || "";
|
|
195429
195657
|
} else if (node3.children?.length > 0) {
|
|
@@ -195431,11 +195659,6 @@ var remarkDirectivePyide_default = (ctx) => () => {
|
|
|
195431
195659
|
code: c.value,
|
|
195432
195660
|
name: `${i}`
|
|
195433
195661
|
}));
|
|
195434
|
-
input = toText2(
|
|
195435
|
-
node3.children.find(
|
|
195436
|
-
(c) => c.type === "code" && c.lang === "input"
|
|
195437
|
-
)
|
|
195438
|
-
);
|
|
195439
195662
|
srcFile = toText2(
|
|
195440
195663
|
node3.children.find(
|
|
195441
195664
|
(c) => c.type === "code" && c.lang === "python" && !c.meta?.includes("test")
|
|
@@ -195446,7 +195669,10 @@ var remarkDirectivePyide_default = (ctx) => () => {
|
|
|
195446
195669
|
data.hProperties = {
|
|
195447
195670
|
class: "directive-pyide",
|
|
195448
195671
|
id,
|
|
195449
|
-
"data-tests": Buffer.from(JSON.stringify(tests)).toString("base64")
|
|
195672
|
+
"data-tests": Buffer.from(JSON.stringify(tests)).toString("base64"),
|
|
195673
|
+
...hasCanvas ? { "data-canvas": "true" } : {},
|
|
195674
|
+
...packageList.length > 0 ? { "data-packages": packageList.join(",") } : {},
|
|
195675
|
+
...height ? { style: `--pyide-height: ${height}` } : {}
|
|
195450
195676
|
};
|
|
195451
195677
|
data.hChildren = [
|
|
195452
195678
|
{
|
|
@@ -195476,21 +195702,79 @@ var remarkDirectivePyide_default = (ctx) => () => {
|
|
|
195476
195702
|
}
|
|
195477
195703
|
]
|
|
195478
195704
|
},
|
|
195479
|
-
|
|
195480
|
-
|
|
195481
|
-
|
|
195482
|
-
|
|
195483
|
-
|
|
195484
|
-
|
|
195485
|
-
|
|
195486
|
-
|
|
195487
|
-
|
|
195488
|
-
|
|
195489
|
-
|
|
195490
|
-
|
|
195491
|
-
|
|
195705
|
+
...hasCanvas ? [
|
|
195706
|
+
{
|
|
195707
|
+
type: "element",
|
|
195708
|
+
tagName: "button",
|
|
195709
|
+
properties: {
|
|
195710
|
+
class: "canvas-btn"
|
|
195711
|
+
},
|
|
195712
|
+
children: [
|
|
195713
|
+
{
|
|
195714
|
+
type: "text",
|
|
195715
|
+
value: i18n.get("pyide-canvas")
|
|
195716
|
+
}
|
|
195717
|
+
]
|
|
195718
|
+
}
|
|
195719
|
+
] : []
|
|
195492
195720
|
]
|
|
195493
195721
|
},
|
|
195722
|
+
...hasCanvas ? [
|
|
195723
|
+
{
|
|
195724
|
+
type: "element",
|
|
195725
|
+
tagName: "div",
|
|
195726
|
+
properties: {
|
|
195727
|
+
class: "canvas-header hidden"
|
|
195728
|
+
},
|
|
195729
|
+
children: [
|
|
195730
|
+
{
|
|
195731
|
+
type: "text",
|
|
195732
|
+
value: i18n.get("pyide-canvas")
|
|
195733
|
+
}
|
|
195734
|
+
]
|
|
195735
|
+
},
|
|
195736
|
+
{
|
|
195737
|
+
type: "element",
|
|
195738
|
+
tagName: "div",
|
|
195739
|
+
properties: {
|
|
195740
|
+
class: "canvas-wrapper hidden"
|
|
195741
|
+
},
|
|
195742
|
+
children: [
|
|
195743
|
+
{
|
|
195744
|
+
type: "element",
|
|
195745
|
+
tagName: "canvas",
|
|
195746
|
+
properties: {
|
|
195747
|
+
class: "canvas",
|
|
195748
|
+
id: "canvas"
|
|
195749
|
+
},
|
|
195750
|
+
children: []
|
|
195751
|
+
}
|
|
195752
|
+
]
|
|
195753
|
+
},
|
|
195754
|
+
{
|
|
195755
|
+
type: "element",
|
|
195756
|
+
tagName: "div",
|
|
195757
|
+
properties: {
|
|
195758
|
+
class: "canvas-output-splitter hidden",
|
|
195759
|
+
role: "separator",
|
|
195760
|
+
"aria-label": "Resize canvas and output"
|
|
195761
|
+
},
|
|
195762
|
+
children: []
|
|
195763
|
+
},
|
|
195764
|
+
{
|
|
195765
|
+
type: "element",
|
|
195766
|
+
tagName: "div",
|
|
195767
|
+
properties: {
|
|
195768
|
+
class: "output-header hidden"
|
|
195769
|
+
},
|
|
195770
|
+
children: [
|
|
195771
|
+
{
|
|
195772
|
+
type: "text",
|
|
195773
|
+
value: i18n.get("pyide-output")
|
|
195774
|
+
}
|
|
195775
|
+
]
|
|
195776
|
+
}
|
|
195777
|
+
] : [],
|
|
195494
195778
|
{
|
|
195495
195779
|
type: "element",
|
|
195496
195780
|
tagName: "pre",
|
|
@@ -195498,22 +195782,19 @@ var remarkDirectivePyide_default = (ctx) => () => {
|
|
|
195498
195782
|
class: "output"
|
|
195499
195783
|
},
|
|
195500
195784
|
children: []
|
|
195501
|
-
},
|
|
195502
|
-
{
|
|
195503
|
-
type: "element",
|
|
195504
|
-
tagName: "code-input",
|
|
195505
|
-
properties: {
|
|
195506
|
-
class: "input hidden"
|
|
195507
|
-
},
|
|
195508
|
-
children: [
|
|
195509
|
-
{
|
|
195510
|
-
type: "raw",
|
|
195511
|
-
value: input || ""
|
|
195512
|
-
}
|
|
195513
|
-
]
|
|
195514
195785
|
}
|
|
195515
195786
|
]
|
|
195516
195787
|
},
|
|
195788
|
+
{
|
|
195789
|
+
type: "element",
|
|
195790
|
+
tagName: "div",
|
|
195791
|
+
properties: {
|
|
195792
|
+
class: "splitter",
|
|
195793
|
+
role: "separator",
|
|
195794
|
+
"aria-label": "Resize panels"
|
|
195795
|
+
},
|
|
195796
|
+
children: []
|
|
195797
|
+
},
|
|
195517
195798
|
{
|
|
195518
195799
|
type: "element",
|
|
195519
195800
|
tagName: "div",
|
|
@@ -195555,7 +195836,21 @@ var remarkDirectivePyide_default = (ctx) => () => {
|
|
|
195555
195836
|
}
|
|
195556
195837
|
]
|
|
195557
195838
|
}
|
|
195558
|
-
] : []
|
|
195839
|
+
] : [],
|
|
195840
|
+
{
|
|
195841
|
+
type: "element",
|
|
195842
|
+
tagName: "button",
|
|
195843
|
+
properties: {
|
|
195844
|
+
class: "stop",
|
|
195845
|
+
disabled: true
|
|
195846
|
+
},
|
|
195847
|
+
children: [
|
|
195848
|
+
{
|
|
195849
|
+
type: "text",
|
|
195850
|
+
value: i18n.get("pyide-stop")
|
|
195851
|
+
}
|
|
195852
|
+
]
|
|
195853
|
+
}
|
|
195559
195854
|
]
|
|
195560
195855
|
},
|
|
195561
195856
|
{
|
|
@@ -195618,6 +195913,21 @@ var remarkDirectivePyide_default = (ctx) => () => {
|
|
|
195618
195913
|
value: i18n.get("pyide-download")
|
|
195619
195914
|
}
|
|
195620
195915
|
]
|
|
195916
|
+
},
|
|
195917
|
+
{
|
|
195918
|
+
type: "element",
|
|
195919
|
+
tagName: "button",
|
|
195920
|
+
properties: {
|
|
195921
|
+
class: "fullscreen",
|
|
195922
|
+
title: i18n.get("ide-fullscreen-enter"),
|
|
195923
|
+
"aria-label": i18n.get("ide-fullscreen-enter")
|
|
195924
|
+
},
|
|
195925
|
+
children: [
|
|
195926
|
+
{
|
|
195927
|
+
type: "text",
|
|
195928
|
+
value: "\u26F6"
|
|
195929
|
+
}
|
|
195930
|
+
]
|
|
195621
195931
|
}
|
|
195622
195932
|
]
|
|
195623
195933
|
}
|
|
@@ -195654,8 +195964,9 @@ html, body {
|
|
|
195654
195964
|
return (tree, file) => {
|
|
195655
195965
|
visit(tree, function(node3) {
|
|
195656
195966
|
if (isDirective(node3) && node3.name === name) {
|
|
195657
|
-
const { height
|
|
195967
|
+
const { height, id = hash(node3) } = node3.attributes || {};
|
|
195658
195968
|
const data = node3.data || (node3.data = {});
|
|
195969
|
+
const resolvedHeight = height !== void 0 ? typeof height === "number" ? `${height}px` : `${height}` : "calc(100dvh - 80px)";
|
|
195659
195970
|
expectContainerDirective(node3, file, name);
|
|
195660
195971
|
registerDirective(file, name, ["client.js"], ["style.css"], []);
|
|
195661
195972
|
requestJS(file, ["code-input", "code-input.min.js"]);
|
|
@@ -195784,15 +196095,15 @@ html, body {
|
|
|
195784
196095
|
data.hProperties = {
|
|
195785
196096
|
class: "directive-webide",
|
|
195786
196097
|
"data-template": template.replace(/\u00A0/g, " "),
|
|
195787
|
-
"data-id": id
|
|
196098
|
+
"data-id": id,
|
|
196099
|
+
...height !== void 0 ? { style: `--webide-height: ${resolvedHeight}` } : {}
|
|
195788
196100
|
};
|
|
195789
196101
|
data.hChildren = [
|
|
195790
196102
|
{
|
|
195791
196103
|
type: "element",
|
|
195792
196104
|
tagName: "div",
|
|
195793
196105
|
properties: {
|
|
195794
|
-
class: "container"
|
|
195795
|
-
style: `height: ${height}px;`
|
|
196106
|
+
class: "container"
|
|
195796
196107
|
},
|
|
195797
196108
|
children: [
|
|
195798
196109
|
{
|
|
@@ -195822,6 +196133,16 @@ html, body {
|
|
|
195822
196133
|
}
|
|
195823
196134
|
]
|
|
195824
196135
|
},
|
|
196136
|
+
{
|
|
196137
|
+
type: "element",
|
|
196138
|
+
tagName: "div",
|
|
196139
|
+
properties: {
|
|
196140
|
+
class: "splitter",
|
|
196141
|
+
role: "separator",
|
|
196142
|
+
"aria-label": "Resize panels"
|
|
196143
|
+
},
|
|
196144
|
+
children: []
|
|
196145
|
+
},
|
|
195825
196146
|
{
|
|
195826
196147
|
type: "element",
|
|
195827
196148
|
tagName: "div",
|
|
@@ -195870,6 +196191,21 @@ html, body {
|
|
|
195870
196191
|
value: i18n.get("webide-download")
|
|
195871
196192
|
}
|
|
195872
196193
|
]
|
|
196194
|
+
},
|
|
196195
|
+
{
|
|
196196
|
+
type: "element",
|
|
196197
|
+
tagName: "button",
|
|
196198
|
+
properties: {
|
|
196199
|
+
class: "fullscreen",
|
|
196200
|
+
title: i18n.get("ide-fullscreen-enter"),
|
|
196201
|
+
"aria-label": i18n.get("ide-fullscreen-enter")
|
|
196202
|
+
},
|
|
196203
|
+
children: [
|
|
196204
|
+
{
|
|
196205
|
+
type: "text",
|
|
196206
|
+
value: "\u26F6"
|
|
196207
|
+
}
|
|
196208
|
+
]
|
|
195873
196209
|
}
|
|
195874
196210
|
]
|
|
195875
196211
|
}
|
|
@@ -200782,11 +201118,12 @@ var remarkDirectiveTypst_default = (ctx) => () => {
|
|
|
200782
201118
|
visit(tree, function(node3) {
|
|
200783
201119
|
if (isDirective(node3) && node3.name === name) {
|
|
200784
201120
|
const {
|
|
200785
|
-
height
|
|
201121
|
+
height,
|
|
200786
201122
|
id = hash(node3),
|
|
200787
201123
|
mode = "preview"
|
|
200788
201124
|
} = node3.attributes || {};
|
|
200789
201125
|
const data = node3.data || (node3.data = {});
|
|
201126
|
+
const resolvedHeight = height !== void 0 ? `${height}` : "calc(100dvh - 80px)";
|
|
200790
201127
|
expectContainerDirective(node3, file, name);
|
|
200791
201128
|
registerDirective(file, name, ["client.js"], ["style.css"], []);
|
|
200792
201129
|
requestJS(file, ["code-input", "code-input.min.js"]);
|
|
@@ -200922,14 +201259,15 @@ var remarkDirectiveTypst_default = (ctx) => () => {
|
|
|
200922
201259
|
JSON.stringify(fontFiles)
|
|
200923
201260
|
).toString("base64"),
|
|
200924
201261
|
"data-base-path": basePath,
|
|
200925
|
-
"data-page-path": pagePath
|
|
201262
|
+
"data-page-path": pagePath,
|
|
201263
|
+
...height !== void 0 && !isPreviewMode ? { style: `--typst-height: ${height}` } : {}
|
|
200926
201264
|
};
|
|
200927
201265
|
const previewContainer = {
|
|
200928
201266
|
type: "element",
|
|
200929
201267
|
tagName: "div",
|
|
200930
201268
|
properties: {
|
|
200931
201269
|
class: "preview-container",
|
|
200932
|
-
style: `height: ${
|
|
201270
|
+
...isPreviewMode ? { style: `height: ${resolvedHeight};` } : {}
|
|
200933
201271
|
},
|
|
200934
201272
|
children: [
|
|
200935
201273
|
{
|
|
@@ -200996,9 +201334,34 @@ var remarkDirectiveTypst_default = (ctx) => () => {
|
|
|
200996
201334
|
}
|
|
200997
201335
|
]
|
|
200998
201336
|
};
|
|
201337
|
+
const createFullscreenButton = () => ({
|
|
201338
|
+
type: "element",
|
|
201339
|
+
tagName: "button",
|
|
201340
|
+
properties: {
|
|
201341
|
+
class: "fullscreen",
|
|
201342
|
+
title: i18n.get("ide-fullscreen-enter"),
|
|
201343
|
+
"aria-label": i18n.get("ide-fullscreen-enter")
|
|
201344
|
+
},
|
|
201345
|
+
children: [
|
|
201346
|
+
{
|
|
201347
|
+
type: "text",
|
|
201348
|
+
value: "\u26F6"
|
|
201349
|
+
}
|
|
201350
|
+
]
|
|
201351
|
+
});
|
|
200999
201352
|
if (isEditMode) {
|
|
201000
201353
|
data.hChildren = [
|
|
201001
201354
|
previewContainer,
|
|
201355
|
+
{
|
|
201356
|
+
type: "element",
|
|
201357
|
+
tagName: "div",
|
|
201358
|
+
properties: {
|
|
201359
|
+
class: "splitter",
|
|
201360
|
+
role: "separator",
|
|
201361
|
+
"aria-label": "Resize panels"
|
|
201362
|
+
},
|
|
201363
|
+
children: []
|
|
201364
|
+
},
|
|
201002
201365
|
{
|
|
201003
201366
|
type: "element",
|
|
201004
201367
|
tagName: "div",
|
|
@@ -201146,7 +201509,8 @@ var remarkDirectiveTypst_default = (ctx) => () => {
|
|
|
201146
201509
|
]
|
|
201147
201510
|
},
|
|
201148
201511
|
downloadProjectButton,
|
|
201149
|
-
downloadButton
|
|
201512
|
+
downloadButton,
|
|
201513
|
+
createFullscreenButton()
|
|
201150
201514
|
]
|
|
201151
201515
|
}
|
|
201152
201516
|
]
|
|
@@ -201488,7 +201852,19 @@ var process3 = (md, ctx) => {
|
|
|
201488
201852
|
theme: ctx.config.elements?.code?.theme || {
|
|
201489
201853
|
dark: `github-dark`,
|
|
201490
201854
|
light: `github-light`
|
|
201491
|
-
}
|
|
201855
|
+
},
|
|
201856
|
+
getHighlighter: (options2) => getSingletonHighlighter({
|
|
201857
|
+
...options2,
|
|
201858
|
+
langs: [
|
|
201859
|
+
...options2?.langs || [],
|
|
201860
|
+
"markdown",
|
|
201861
|
+
"yaml",
|
|
201862
|
+
{
|
|
201863
|
+
...hyperbook_tmLanguage_default,
|
|
201864
|
+
embeddedLangsLazy: ["markdown", "yaml"]
|
|
201865
|
+
}
|
|
201866
|
+
]
|
|
201867
|
+
})
|
|
201492
201868
|
}
|
|
201493
201869
|
],
|
|
201494
201870
|
rehypeFormat
|
|
@@ -201553,7 +201929,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"application/1d-interleaved-parityfec
|
|
|
201553
201929
|
/***/ ((module) => {
|
|
201554
201930
|
|
|
201555
201931
|
"use strict";
|
|
201556
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.
|
|
201932
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.91.0","author":"Mike Barkmin","homepage":"https://github.com/openpatch/hyperbook#readme","license":"MIT","bin":{"hyperbook":"./dist/index.js"},"files":["dist"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/openpatch/hyperbook.git","directory":"packages/hyperbook"},"bugs":{"url":"https://github.com/openpatch/hyperbook/issues"},"engines":{"node":">=18"},"scripts":{"version":"pnpm build","lint":"tsc --noEmit","dev":"ncc build ./index.ts -w -o dist/","build":"rimraf dist && ncc build ./index.ts -o ./dist/ --no-cache --no-source-map-register --external favicons --external sharp && node postbuild.mjs"},"dependencies":{"favicons":"^7.2.0"},"devDependencies":{"create-hyperbook":"workspace:*","@hyperbook/fs":"workspace:*","@hyperbook/markdown":"workspace:*","@hyperbook/types":"workspace:*","@pnpm/exportable-manifest":"1000.0.6","@types/archiver":"6.0.3","@types/async-retry":"1.4.9","@types/cross-spawn":"6.0.6","@types/lunr":"^2.3.7","@types/prompts":"2.4.9","@types/tar":"6.1.13","@types/ws":"^8.5.14","@vercel/ncc":"0.38.3","archiver":"7.0.1","async-retry":"1.3.3","chalk":"5.4.1","chokidar":"4.0.3","commander":"12.1.0","cpy":"11.1.0","cross-spawn":"7.0.6","domutils":"^3.2.2","extract-zip":"^2.0.1","got":"12.6.0","htmlparser2":"^10.0.0","lunr":"^2.3.9","lunr-languages":"^1.14.0","mime":"^4.0.6","prompts":"2.4.2","rimraf":"6.0.1","tar":"7.4.3","update-check":"1.5.4","ws":"^8.18.0"}}');
|
|
201557
201933
|
|
|
201558
201934
|
/***/ })
|
|
201559
201935
|
|