hyperbook 0.91.0 → 0.92.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/directive-openscad/OrbitControls.js +1523 -0
- package/dist/assets/directive-openscad/STLLoader.js +411 -0
- package/dist/assets/directive-openscad/client.js +983 -0
- package/dist/assets/directive-openscad/openscad.js +16 -0
- package/dist/assets/directive-openscad/openscad.wasm +0 -0
- package/dist/assets/directive-openscad/style.css +371 -0
- package/dist/assets/directive-openscad/three.module.js +54571 -0
- package/dist/assets/directive-pyide/client.js +11 -2
- package/dist/assets/store.js +2 -1
- package/dist/index.js +221 -1
- package/dist/locales/de.json +14 -0
- package/dist/locales/en.json +14 -0
- package/package.json +4 -4
|
@@ -1197,7 +1197,11 @@ if _pg:
|
|
|
1197
1197
|
},
|
|
1198
1198
|
);
|
|
1199
1199
|
|
|
1200
|
-
|
|
1200
|
+
let editorStateRestored = false;
|
|
1201
|
+
const restoreEditorState = async () => {
|
|
1202
|
+
if (editorStateRestored) return;
|
|
1203
|
+
editorStateRestored = true;
|
|
1204
|
+
|
|
1201
1205
|
const result = await hyperbook.store.db.pyide.get(id);
|
|
1202
1206
|
if (result) {
|
|
1203
1207
|
pyideState = { ...pyideState, ...result };
|
|
@@ -1227,7 +1231,12 @@ if _pg:
|
|
|
1227
1231
|
applyStoredSplitSize?.();
|
|
1228
1232
|
applyCanvasOutputLayout();
|
|
1229
1233
|
}
|
|
1230
|
-
}
|
|
1234
|
+
};
|
|
1235
|
+
|
|
1236
|
+
editor.addEventListener("code-input_load", restoreEditorState);
|
|
1237
|
+
if (editor.querySelector("textarea")) {
|
|
1238
|
+
void restoreEditorState();
|
|
1239
|
+
}
|
|
1231
1240
|
|
|
1232
1241
|
window.addEventListener("resize", applyCanvasOutputLayout);
|
|
1233
1242
|
applyCanvasOutputLayout();
|
package/dist/assets/store.js
CHANGED
|
@@ -12,7 +12,7 @@ var hyperbook = window.hyperbook = window.hyperbook || {};
|
|
|
12
12
|
hyperbook.store = (function () {
|
|
13
13
|
/** @type {import("dexie").Dexie} */
|
|
14
14
|
var db = new Dexie("Hyperbook");
|
|
15
|
-
db.version(
|
|
15
|
+
db.version(5).stores({
|
|
16
16
|
consent: `id`,
|
|
17
17
|
currentState: `
|
|
18
18
|
id,
|
|
@@ -46,6 +46,7 @@ hyperbook.store = (function () {
|
|
|
46
46
|
struktolab: `id,tree`,
|
|
47
47
|
multievent: `id,state`,
|
|
48
48
|
typst: `id,code`,
|
|
49
|
+
openscad: `id,code,params`,
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
/** @returns {Promise<void>} */
|
package/dist/index.js
CHANGED
|
@@ -174979,6 +174979,20 @@ var en_default = {
|
|
|
174979
174979
|
"typst-file-replace": "Replace existing file?",
|
|
174980
174980
|
"typst-binary-files": "Binary Files",
|
|
174981
174981
|
"typst-no-binary-files": "No binary files",
|
|
174982
|
+
"openscad-preview": "Preview",
|
|
174983
|
+
"openscad-render": "Render",
|
|
174984
|
+
"openscad-copy": "Copy",
|
|
174985
|
+
"openscad-copy-done": "Code copied",
|
|
174986
|
+
"openscad-download-stl": "Download STL",
|
|
174987
|
+
"openscad-download-ready": "Download ready",
|
|
174988
|
+
"openscad-reset": "Reset",
|
|
174989
|
+
"openscad-reset-prompt": "Are you sure you want to reset the code?",
|
|
174990
|
+
"openscad-rendering": "Rendering ...",
|
|
174991
|
+
"openscad-render-success": "Render complete",
|
|
174992
|
+
"openscad-render-failed": "OpenSCAD render failed",
|
|
174993
|
+
"openscad-params-object": "Parameters must be a JSON object",
|
|
174994
|
+
"openscad-params-loading": "Loading parameters...",
|
|
174995
|
+
"openscad-parameters": "Parameters",
|
|
174982
174996
|
"user-login-title": "Login",
|
|
174983
174997
|
"user-username": "Username",
|
|
174984
174998
|
"user-password": "Password",
|
|
@@ -175100,6 +175114,20 @@ var de_default = {
|
|
|
175100
175114
|
"typst-file-replace": "Existierende Datei ersetzen?",
|
|
175101
175115
|
"typst-binary-files": "Bin\xE4rdateien",
|
|
175102
175116
|
"typst-no-binary-files": "Keine Bin\xE4rdateien",
|
|
175117
|
+
"openscad-preview": "Vorschau",
|
|
175118
|
+
"openscad-render": "Rendern",
|
|
175119
|
+
"openscad-copy": "Kopieren",
|
|
175120
|
+
"openscad-copy-done": "Code kopiert",
|
|
175121
|
+
"openscad-download-stl": "STL herunterladen",
|
|
175122
|
+
"openscad-download-ready": "Download bereit",
|
|
175123
|
+
"openscad-reset": "Zur\xFCcksetzen",
|
|
175124
|
+
"openscad-reset-prompt": "Sind Sie sicher, dass Sie den Code zur\xFCcksetzen m\xF6chten?",
|
|
175125
|
+
"openscad-rendering": "Rendern ...",
|
|
175126
|
+
"openscad-render-success": "Rendern abgeschlossen",
|
|
175127
|
+
"openscad-render-failed": "OpenSCAD-Rendern fehlgeschlagen",
|
|
175128
|
+
"openscad-params-object": "Parameter m\xFCssen ein JSON-Objekt sein",
|
|
175129
|
+
"openscad-params-loading": "Parameter werden geladen...",
|
|
175130
|
+
"openscad-parameters": "Parameter",
|
|
175103
175131
|
"user-login-title": "Anmelden",
|
|
175104
175132
|
"user-username": "Benutzername",
|
|
175105
175133
|
"user-password": "Passwort",
|
|
@@ -201548,6 +201576,197 @@ var remarkDirectiveTypst_default = (ctx) => () => {
|
|
|
201548
201576
|
};
|
|
201549
201577
|
};
|
|
201550
201578
|
|
|
201579
|
+
// src/remarkDirectiveOpenscad.ts
|
|
201580
|
+
function htmlEntities5(str2) {
|
|
201581
|
+
return String(str2).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
201582
|
+
}
|
|
201583
|
+
var remarkDirectiveOpenscad_default = (ctx) => () => {
|
|
201584
|
+
const name = "openscad";
|
|
201585
|
+
return (tree, file) => {
|
|
201586
|
+
visit(tree, function(node3) {
|
|
201587
|
+
if (isDirective(node3) && node3.name === name) {
|
|
201588
|
+
const { src = "", id = hash(node3), height, library } = node3.attributes || {};
|
|
201589
|
+
const data = node3.data || (node3.data = {});
|
|
201590
|
+
expectContainerDirective(node3, file, name);
|
|
201591
|
+
registerDirective(file, name, ["client.js"], ["style.css"], []);
|
|
201592
|
+
requestJS(file, ["code-input", "code-input.min.js"]);
|
|
201593
|
+
requestCSS(file, ["code-input", "code-input.min.css"]);
|
|
201594
|
+
requestJS(file, ["code-input", "auto-close-brackets.min.js"]);
|
|
201595
|
+
requestJS(file, ["code-input", "indent.min.js"]);
|
|
201596
|
+
let source = "";
|
|
201597
|
+
if (src) {
|
|
201598
|
+
source = readFile(src, ctx) || "";
|
|
201599
|
+
} else {
|
|
201600
|
+
source = node3.children.find(
|
|
201601
|
+
(c) => c.type === "code" && (c.lang === "scad" || c.lang === "openscad")
|
|
201602
|
+
)?.value || "";
|
|
201603
|
+
}
|
|
201604
|
+
data.hName = "div";
|
|
201605
|
+
data.hProperties = {
|
|
201606
|
+
class: "directive-openscad",
|
|
201607
|
+
"data-id": id,
|
|
201608
|
+
...height ? { style: `--openscad-height: ${height}` } : {},
|
|
201609
|
+
...library ? { "data-library": library } : {}
|
|
201610
|
+
};
|
|
201611
|
+
data.hChildren = [
|
|
201612
|
+
{
|
|
201613
|
+
type: "element",
|
|
201614
|
+
tagName: "div",
|
|
201615
|
+
properties: { class: "left-side" },
|
|
201616
|
+
children: [
|
|
201617
|
+
{
|
|
201618
|
+
type: "element",
|
|
201619
|
+
tagName: "div",
|
|
201620
|
+
properties: { class: "preview-container" },
|
|
201621
|
+
children: [
|
|
201622
|
+
{
|
|
201623
|
+
type: "element",
|
|
201624
|
+
tagName: "div",
|
|
201625
|
+
properties: { class: "preview-header" },
|
|
201626
|
+
children: [{ type: "text", value: i18n.get("openscad-preview") }]
|
|
201627
|
+
},
|
|
201628
|
+
{
|
|
201629
|
+
type: "element",
|
|
201630
|
+
tagName: "div",
|
|
201631
|
+
properties: { class: "canvas-wrapper" },
|
|
201632
|
+
children: [
|
|
201633
|
+
{
|
|
201634
|
+
type: "element",
|
|
201635
|
+
tagName: "canvas",
|
|
201636
|
+
properties: { class: "preview-canvas" },
|
|
201637
|
+
children: []
|
|
201638
|
+
},
|
|
201639
|
+
{
|
|
201640
|
+
type: "element",
|
|
201641
|
+
tagName: "div",
|
|
201642
|
+
properties: { class: "canvas-overlay hidden" },
|
|
201643
|
+
children: []
|
|
201644
|
+
}
|
|
201645
|
+
]
|
|
201646
|
+
}
|
|
201647
|
+
]
|
|
201648
|
+
},
|
|
201649
|
+
{
|
|
201650
|
+
type: "element",
|
|
201651
|
+
tagName: "div",
|
|
201652
|
+
properties: {
|
|
201653
|
+
class: "canvas-params-splitter hidden",
|
|
201654
|
+
role: "separator",
|
|
201655
|
+
"aria-label": "Resize canvas and parameters"
|
|
201656
|
+
},
|
|
201657
|
+
children: []
|
|
201658
|
+
},
|
|
201659
|
+
{
|
|
201660
|
+
type: "element",
|
|
201661
|
+
tagName: "div",
|
|
201662
|
+
properties: { class: "parameters-panel hidden" },
|
|
201663
|
+
children: [
|
|
201664
|
+
{
|
|
201665
|
+
type: "element",
|
|
201666
|
+
tagName: "div",
|
|
201667
|
+
properties: { class: "parameters-header" },
|
|
201668
|
+
children: [{ type: "text", value: i18n.get("openscad-parameters") }]
|
|
201669
|
+
},
|
|
201670
|
+
{
|
|
201671
|
+
type: "element",
|
|
201672
|
+
tagName: "div",
|
|
201673
|
+
properties: { class: "parameters-body" },
|
|
201674
|
+
children: []
|
|
201675
|
+
}
|
|
201676
|
+
]
|
|
201677
|
+
}
|
|
201678
|
+
]
|
|
201679
|
+
},
|
|
201680
|
+
{
|
|
201681
|
+
type: "element",
|
|
201682
|
+
tagName: "div",
|
|
201683
|
+
properties: {
|
|
201684
|
+
class: "splitter",
|
|
201685
|
+
role: "separator",
|
|
201686
|
+
"aria-label": "Resize panels"
|
|
201687
|
+
},
|
|
201688
|
+
children: []
|
|
201689
|
+
},
|
|
201690
|
+
{
|
|
201691
|
+
type: "element",
|
|
201692
|
+
tagName: "div",
|
|
201693
|
+
properties: { class: "editor-container" },
|
|
201694
|
+
children: [
|
|
201695
|
+
{
|
|
201696
|
+
type: "element",
|
|
201697
|
+
tagName: "div",
|
|
201698
|
+
properties: { class: "buttons" },
|
|
201699
|
+
children: [
|
|
201700
|
+
{
|
|
201701
|
+
type: "element",
|
|
201702
|
+
tagName: "button",
|
|
201703
|
+
properties: { class: "render" },
|
|
201704
|
+
children: [{ type: "text", value: i18n.get("openscad-render") }]
|
|
201705
|
+
}
|
|
201706
|
+
]
|
|
201707
|
+
},
|
|
201708
|
+
{
|
|
201709
|
+
type: "element",
|
|
201710
|
+
tagName: "code-input",
|
|
201711
|
+
properties: {
|
|
201712
|
+
class: "editor line-numbers",
|
|
201713
|
+
language: "clike",
|
|
201714
|
+
template: "openscad-highlighted"
|
|
201715
|
+
},
|
|
201716
|
+
children: [{ type: "raw", value: htmlEntities5(source) }]
|
|
201717
|
+
},
|
|
201718
|
+
{
|
|
201719
|
+
type: "element",
|
|
201720
|
+
tagName: "textarea",
|
|
201721
|
+
properties: {
|
|
201722
|
+
class: "parameters",
|
|
201723
|
+
placeholder: '{"size": 20, "height": 10}'
|
|
201724
|
+
},
|
|
201725
|
+
children: [{ type: "text", value: "{}" }]
|
|
201726
|
+
},
|
|
201727
|
+
{
|
|
201728
|
+
type: "element",
|
|
201729
|
+
tagName: "div",
|
|
201730
|
+
properties: { class: "buttons bottom" },
|
|
201731
|
+
children: [
|
|
201732
|
+
{
|
|
201733
|
+
type: "element",
|
|
201734
|
+
tagName: "button",
|
|
201735
|
+
properties: { class: "copy" },
|
|
201736
|
+
children: [{ type: "text", value: i18n.get("openscad-copy") }]
|
|
201737
|
+
},
|
|
201738
|
+
{
|
|
201739
|
+
type: "element",
|
|
201740
|
+
tagName: "button",
|
|
201741
|
+
properties: { class: "download-stl" },
|
|
201742
|
+
children: [{ type: "text", value: i18n.get("openscad-download-stl") }]
|
|
201743
|
+
},
|
|
201744
|
+
{
|
|
201745
|
+
type: "element",
|
|
201746
|
+
tagName: "button",
|
|
201747
|
+
properties: { class: "reset" },
|
|
201748
|
+
children: [{ type: "text", value: i18n.get("openscad-reset") }]
|
|
201749
|
+
},
|
|
201750
|
+
{
|
|
201751
|
+
type: "element",
|
|
201752
|
+
tagName: "button",
|
|
201753
|
+
properties: {
|
|
201754
|
+
class: "fullscreen",
|
|
201755
|
+
title: i18n.get("ide-fullscreen-enter"),
|
|
201756
|
+
"aria-label": i18n.get("ide-fullscreen-enter")
|
|
201757
|
+
},
|
|
201758
|
+
children: [{ type: "text", value: "\u26F6" }]
|
|
201759
|
+
}
|
|
201760
|
+
]
|
|
201761
|
+
}
|
|
201762
|
+
]
|
|
201763
|
+
}
|
|
201764
|
+
];
|
|
201765
|
+
}
|
|
201766
|
+
});
|
|
201767
|
+
};
|
|
201768
|
+
};
|
|
201769
|
+
|
|
201551
201770
|
// src/remarkDirectiveStruktolab.ts
|
|
201552
201771
|
var remarkDirectiveStruktolab_default = (ctx) => () => {
|
|
201553
201772
|
const name = "struktolab";
|
|
@@ -201802,6 +202021,7 @@ var remark = (ctx) => {
|
|
|
201802
202021
|
remarkDirectiveLearningmap_default(ctx),
|
|
201803
202022
|
remarkDirectiveTextinput_default(ctx),
|
|
201804
202023
|
remarkDirectiveTypst_default(ctx),
|
|
202024
|
+
remarkDirectiveOpenscad_default(ctx),
|
|
201805
202025
|
remarkCode_default(ctx),
|
|
201806
202026
|
remarkMath,
|
|
201807
202027
|
remarkGithubEmoji,
|
|
@@ -201929,7 +202149,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"application/1d-interleaved-parityfec
|
|
|
201929
202149
|
/***/ ((module) => {
|
|
201930
202150
|
|
|
201931
202151
|
"use strict";
|
|
201932
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.
|
|
202152
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.92.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"}}');
|
|
201933
202153
|
|
|
201934
202154
|
/***/ })
|
|
201935
202155
|
|
package/dist/locales/de.json
CHANGED
|
@@ -88,6 +88,20 @@
|
|
|
88
88
|
"typst-file-replace": "Existierende Datei ersetzen?",
|
|
89
89
|
"typst-binary-files": "Binärdateien",
|
|
90
90
|
"typst-no-binary-files": "Keine Binärdateien",
|
|
91
|
+
"openscad-preview": "Vorschau",
|
|
92
|
+
"openscad-render": "Rendern",
|
|
93
|
+
"openscad-copy": "Kopieren",
|
|
94
|
+
"openscad-copy-done": "Code kopiert",
|
|
95
|
+
"openscad-download-stl": "STL herunterladen",
|
|
96
|
+
"openscad-download-ready": "Download bereit",
|
|
97
|
+
"openscad-reset": "Zurücksetzen",
|
|
98
|
+
"openscad-reset-prompt": "Sind Sie sicher, dass Sie den Code zurücksetzen möchten?",
|
|
99
|
+
"openscad-rendering": "Rendern ...",
|
|
100
|
+
"openscad-render-success": "Rendern abgeschlossen",
|
|
101
|
+
"openscad-render-failed": "OpenSCAD-Rendern fehlgeschlagen",
|
|
102
|
+
"openscad-params-object": "Parameter müssen ein JSON-Objekt sein",
|
|
103
|
+
"openscad-params-loading": "Parameter werden geladen...",
|
|
104
|
+
"openscad-parameters": "Parameter",
|
|
91
105
|
"user-login-title": "Anmelden",
|
|
92
106
|
"user-username": "Benutzername",
|
|
93
107
|
"user-password": "Passwort",
|
package/dist/locales/en.json
CHANGED
|
@@ -88,6 +88,20 @@
|
|
|
88
88
|
"typst-file-replace": "Replace existing file?",
|
|
89
89
|
"typst-binary-files": "Binary Files",
|
|
90
90
|
"typst-no-binary-files": "No binary files",
|
|
91
|
+
"openscad-preview": "Preview",
|
|
92
|
+
"openscad-render": "Render",
|
|
93
|
+
"openscad-copy": "Copy",
|
|
94
|
+
"openscad-copy-done": "Code copied",
|
|
95
|
+
"openscad-download-stl": "Download STL",
|
|
96
|
+
"openscad-download-ready": "Download ready",
|
|
97
|
+
"openscad-reset": "Reset",
|
|
98
|
+
"openscad-reset-prompt": "Are you sure you want to reset the code?",
|
|
99
|
+
"openscad-rendering": "Rendering ...",
|
|
100
|
+
"openscad-render-success": "Render complete",
|
|
101
|
+
"openscad-render-failed": "OpenSCAD render failed",
|
|
102
|
+
"openscad-params-object": "Parameters must be a JSON object",
|
|
103
|
+
"openscad-params-loading": "Loading parameters...",
|
|
104
|
+
"openscad-parameters": "Parameters",
|
|
91
105
|
"user-login-title": "Login",
|
|
92
106
|
"user-username": "Username",
|
|
93
107
|
"user-password": "Password",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hyperbook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.92.0",
|
|
4
4
|
"author": "Mike Barkmin",
|
|
5
5
|
"homepage": "https://github.com/openpatch/hyperbook#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"tar": "7.4.3",
|
|
57
57
|
"update-check": "1.5.4",
|
|
58
58
|
"ws": "^8.18.0",
|
|
59
|
-
"@hyperbook/fs": "0.25.0",
|
|
60
59
|
"create-hyperbook": "0.3.6",
|
|
61
|
-
"@hyperbook/
|
|
62
|
-
"@hyperbook/types": "0.23.0"
|
|
60
|
+
"@hyperbook/fs": "0.25.0",
|
|
61
|
+
"@hyperbook/types": "0.23.0",
|
|
62
|
+
"@hyperbook/markdown": "0.63.0"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"version": "pnpm build",
|