hyperbook 0.94.0 → 0.95.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.
@@ -88,21 +88,6 @@ hyperbook.typst = (function () {
88
88
  // INITIALIZATION
89
89
  // ============================================================================
90
90
 
91
- /**
92
- * Initialize code-input template for Typst syntax highlighting
93
- */
94
- const initializeCodeInput = () => {
95
- if (!window.codeInput) return;
96
-
97
- window.codeInput.registerTemplate(
98
- "typst-highlighted",
99
- window.codeInput.templates.prism(window.Prism, [
100
- new window.codeInput.plugins.AutoCloseBrackets(),
101
- new window.codeInput.plugins.Indent(true, 2),
102
- ])
103
- );
104
- };
105
-
106
91
  // ============================================================================
107
92
  // TYPST LOADER
108
93
  // ============================================================================
@@ -1269,6 +1254,7 @@ hyperbook.typst = (function () {
1269
1254
  this.sourceTextarea = elem.querySelector('.typst-source');
1270
1255
  this.fullscreenBtn = elem.querySelector('.fullscreen');
1271
1256
  this.editorInitialized = false;
1257
+ this.cm = null;
1272
1258
 
1273
1259
  setupSplitter(this.elem, this.previewContainer, this.editorContainer, this.splitter);
1274
1260
 
@@ -1320,28 +1306,26 @@ hyperbook.typst = (function () {
1320
1306
  */
1321
1307
  async initialize() {
1322
1308
  if (this.editor) {
1323
- const initializeEditor = async () => {
1324
- if (this.editorInitialized) return;
1325
- this.editorInitialized = true;
1326
- await this.restoreState();
1327
- this.uiManager.updateTabs();
1328
- this.uiManager.updateBinaryFilesList();
1329
- this.rerender();
1330
-
1331
- // Create debounced rerender for input events
1332
- const debouncedRerender = debounce(() => this.rerender(), CONFIG.DEBOUNCE_DELAY);
1333
-
1334
- this.editor.addEventListener('input', () => {
1309
+ if (this.editorInitialized) return;
1310
+ this.editorInitialized = true;
1311
+
1312
+ // Create CodeMirror editor
1313
+ const initialSource = this.editor.textContent;
1314
+ this.editor.textContent = "";
1315
+ const debouncedRerender = debounce(() => this.rerender(), CONFIG.DEBOUNCE_DELAY);
1316
+ this.cm = HyperbookCM.create(this.editor, {
1317
+ lang: "typst",
1318
+ value: initialSource,
1319
+ onChange: () => {
1335
1320
  this.saveState();
1336
1321
  debouncedRerender();
1337
- });
1338
- };
1322
+ },
1323
+ });
1339
1324
 
1340
- // Edit mode - wait for code-input to load (or initialize immediately if already ready)
1341
- this.editor.addEventListener('code-input_load', initializeEditor);
1342
- if (this.editor.querySelector('textarea')) {
1343
- await initializeEditor();
1344
- }
1325
+ await this.restoreState();
1326
+ this.uiManager.updateTabs();
1327
+ this.uiManager.updateBinaryFilesList();
1328
+ this.rerender();
1345
1329
  } else if (this.sourceTextarea) {
1346
1330
  // Preview mode
1347
1331
  const initialCode = this.sourceTextarea.value;
@@ -1606,28 +1590,12 @@ hyperbook.typst = (function () {
1606
1590
 
1607
1591
  getEditorValue() {
1608
1592
  if (!this.editor) return '';
1609
- const textarea = this.editor.querySelector('textarea');
1610
- if (textarea) return textarea.value;
1611
- try {
1612
- if (typeof this.editor.value === 'string') {
1613
- return this.editor.value;
1614
- }
1615
- } catch (e) {}
1616
- return this.editor.textContent || '';
1593
+ return this.cm?.getValue() ?? '';
1617
1594
  }
1618
1595
 
1619
1596
  setEditorValue(value) {
1620
1597
  if (!this.editor) return;
1621
- const normalizedValue = value ?? '';
1622
- const textarea = this.editor.querySelector('textarea');
1623
- if (textarea) {
1624
- textarea.value = normalizedValue;
1625
- }
1626
- try {
1627
- this.editor.value = normalizedValue;
1628
- } catch (e) {
1629
- this.editor.textContent = normalizedValue;
1630
- }
1598
+ this.cm?.setValue(value ?? '');
1631
1599
  }
1632
1600
  }
1633
1601
 
@@ -1635,9 +1603,6 @@ hyperbook.typst = (function () {
1635
1603
  // MAIN INITIALIZATION
1636
1604
  // ============================================================================
1637
1605
 
1638
- // Initialize code-input
1639
- initializeCodeInput();
1640
-
1641
1606
  // Get all Typst directive elements
1642
1607
  const elements = document.getElementsByClassName('directive-typst');
1643
1608
 
@@ -12,6 +12,18 @@ code-input {
12
12
  margin: 0;
13
13
  }
14
14
 
15
+ .directive-typst .editor {
16
+ width: 100%;
17
+ border: 1px solid var(--color-spacer);
18
+ flex: 1;
19
+ min-height: 0;
20
+ overflow: hidden;
21
+ }
22
+
23
+ .directive-typst .editor .cm-editor {
24
+ height: 100%;
25
+ }
26
+
15
27
  .directive-typst .preview-container {
16
28
  width: 100%;
17
29
  min-height: 120px;
@@ -419,12 +431,6 @@ code-input {
419
431
  color: #dc2626;
420
432
  }
421
433
 
422
- .directive-typst .editor {
423
- width: 100%;
424
- border: 1px solid var(--color-spacer);
425
- flex: 1;
426
- }
427
-
428
434
  .directive-typst .editor:not(.active) {
429
435
  display: none;
430
436
  }
@@ -8,14 +8,6 @@
8
8
  * @see hyperbook.i18n
9
9
  */
10
10
  hyperbook.webide = (function () {
11
- window.codeInput?.registerTemplate(
12
- "webide-highlighted",
13
- codeInput.templates.prism(window.Prism, [
14
- new codeInput.plugins.AutoCloseBrackets(),
15
- new codeInput.plugins.Indent(true, 2),
16
- ]),
17
- );
18
-
19
11
  function setupSplitter(elem, container, editorContainer, splitter) {
20
12
  if (!container || !editorContainer || !splitter) return;
21
13
 
@@ -118,12 +110,9 @@ hyperbook.webide = (function () {
118
110
  const editorContainer = elem.querySelector(".editor-container");
119
111
  const splitter = elem.querySelector(".splitter");
120
112
  const title = elem.getElementsByClassName("container-title")[0];
121
- /** @type {HTMLTextAreaElement | null} */
122
- const editorHTML = elem.querySelector(".editor.html");
123
- /** @type {HTMLTextAreaElement | null} */
124
- const editorCSS = elem.querySelector(".editor.css");
125
- /** @type {HTMLTextAreaElement | null} */
126
- const editorJS = elem.querySelector(".editor.js");
113
+ const editorHTMLDiv = elem.querySelector(".editor.html");
114
+ const editorCSSDiv = elem.querySelector(".editor.css");
115
+ const editorJSDiv = elem.querySelector(".editor.js");
127
116
  /** @type {HTMLButtonElement | null} */
128
117
  const btnHTML = elem.querySelector("button.html");
129
118
  /** @type {HTMLButtonElement | null} */
@@ -131,6 +120,23 @@ hyperbook.webide = (function () {
131
120
  /** @type {HTMLButtonElement | null} */
132
121
  const btnJS = elem.querySelector("button.js");
133
122
 
123
+ // Initialize CodeMirror instances
124
+ const cmHTML = editorHTMLDiv ? (() => {
125
+ const src = editorHTMLDiv.textContent;
126
+ editorHTMLDiv.textContent = "";
127
+ return HyperbookCM.create(editorHTMLDiv, { lang: "html", value: src, onChange: () => update() });
128
+ })() : null;
129
+ const cmCSS = editorCSSDiv ? (() => {
130
+ const src = editorCSSDiv.textContent;
131
+ editorCSSDiv.textContent = "";
132
+ return HyperbookCM.create(editorCSSDiv, { lang: "css", value: src, onChange: () => update() });
133
+ })() : null;
134
+ const cmJS = editorJSDiv ? (() => {
135
+ const src = editorJSDiv.textContent;
136
+ editorJSDiv.textContent = "";
137
+ return HyperbookCM.create(editorJSDiv, { lang: "javascript", value: src, onChange: () => update() });
138
+ })() : null;
139
+
134
140
  const frame = elem.getElementsByTagName("iframe")[0];
135
141
  const template = elem.getAttribute("data-template");
136
142
  const id = elem.getAttribute("data-id");
@@ -164,9 +170,9 @@ hyperbook.webide = (function () {
164
170
  btnCSS?.classList.remove("active");
165
171
  btnJS?.classList.remove("active");
166
172
 
167
- editorHTML?.classList.add("active");
168
- editorCSS?.classList.remove("active");
169
- editorJS?.classList.remove("active");
173
+ editorHTMLDiv?.classList.add("active");
174
+ editorCSSDiv?.classList.remove("active");
175
+ editorJSDiv?.classList.remove("active");
170
176
  });
171
177
 
172
178
  btnCSS?.addEventListener("click", () => {
@@ -174,9 +180,9 @@ hyperbook.webide = (function () {
174
180
  btnCSS?.classList.add("active");
175
181
  btnJS?.classList.remove("active");
176
182
 
177
- editorHTML?.classList.remove("active");
178
- editorCSS?.classList.add("active");
179
- editorJS?.classList.remove("active");
183
+ editorHTMLDiv?.classList.remove("active");
184
+ editorCSSDiv?.classList.add("active");
185
+ editorJSDiv?.classList.remove("active");
180
186
  });
181
187
 
182
188
  btnJS?.addEventListener("click", () => {
@@ -184,80 +190,40 @@ hyperbook.webide = (function () {
184
190
  btnCSS?.classList.remove("active");
185
191
  btnJS?.classList.add("active");
186
192
 
187
- editorHTML?.classList.remove("active");
188
- editorCSS?.classList.remove("active");
189
- editorJS?.classList.add("active");
193
+ editorHTMLDiv?.classList.remove("active");
194
+ editorCSSDiv?.classList.remove("active");
195
+ editorJSDiv?.classList.add("active");
190
196
  });
191
197
 
192
- const load = async () => {
193
- const result = await hyperbook.store.db.webide.get(id);
194
- if (!result) {
195
- return;
196
- }
197
- const website = template
198
- .replace("###HTML###", result.html)
199
- .replace("###CSS###", result.css)
200
- .replace("###JS###", result.js);
201
- frame.srcdoc = website;
202
- };
203
-
204
- load();
205
-
206
198
  const update = () => {
199
+ const htmlVal = cmHTML?.getValue() ?? "";
200
+ const cssVal = cmCSS?.getValue() ?? "";
201
+ const jsVal = cmJS?.getValue() ?? "";
207
202
  hyperbook.store.db.webide.put({
208
203
  id,
209
- html: editorHTML?.value,
210
- css: editorCSS?.value,
211
- js: editorJS?.value,
204
+ html: htmlVal,
205
+ css: cssVal,
206
+ js: jsVal,
212
207
  });
213
208
  const website = template
214
- .replace("###HTML###", editorHTML?.value)
215
- .replace("###CSS###", editorCSS?.value)
216
- .replace("###JS###", editorJS?.value);
209
+ .replace("###HTML###", htmlVal)
210
+ .replace("###CSS###", cssVal)
211
+ .replace("###JS###", jsVal);
217
212
  frame.srcdoc = website;
218
213
  };
219
214
 
220
- frame.addEventListener("load", () => {
221
- title.textContent = frame.contentDocument.title;
222
- });
223
-
224
- editorHTML?.addEventListener("code-input_load", async () => {
225
- const result = await hyperbook.store.db.webide.get(id);
226
- if (result) {
227
- editorHTML.value = result.html;
228
- }
229
-
230
- update();
231
-
232
- editorHTML.addEventListener("input", () => {
233
- update();
234
- });
235
- });
236
-
237
- editorCSS?.addEventListener("code-input_load", async () => {
238
- const result = await hyperbook.store.db.webide.get(id);
215
+ // Restore saved state on init
216
+ hyperbook.store.db.webide.get(id).then((result) => {
239
217
  if (result) {
240
- editorCSS.value = result.css;
218
+ if (cmHTML && result.html != null) cmHTML.setValue(result.html);
219
+ if (cmCSS && result.css != null) cmCSS.setValue(result.css);
220
+ if (cmJS && result.js != null) cmJS.setValue(result.js);
241
221
  }
242
-
243
222
  update();
244
-
245
- editorCSS.addEventListener("input", () => {
246
- update();
247
- });
248
223
  });
249
224
 
250
- editorJS?.addEventListener("code-input_load", async () => {
251
- const result = await hyperbook.store.db.webide.get(id);
252
- if (result) {
253
- editorJS.value = result.js;
254
- }
255
-
256
- update();
257
-
258
- editorJS.addEventListener("input", () => {
259
- update();
260
- });
225
+ frame.addEventListener("load", () => {
226
+ title.textContent = frame.contentDocument.title;
261
227
  });
262
228
 
263
229
  downloadEl?.addEventListener("click", async () => {
@@ -12,6 +12,18 @@ code-input {
12
12
  margin: 0;
13
13
  }
14
14
 
15
+ .directive-webide .editor {
16
+ width: 100%;
17
+ border: 1px solid var(--color-spacer);
18
+ flex: 1;
19
+ min-height: 0;
20
+ overflow: hidden;
21
+ }
22
+
23
+ .directive-webide .editor .cm-editor {
24
+ height: 100%;
25
+ }
26
+
15
27
  .directive-webide .container {
16
28
  width: 100%;
17
29
  min-height: 120px;
@@ -89,12 +101,6 @@ code-input {
89
101
  opacity: 0.75;
90
102
  }
91
103
 
92
- .directive-webide .editor {
93
- width: 100%;
94
- border: 1px solid var(--color-spacer);
95
- flex: 1;
96
- }
97
-
98
104
  .directive-webide .editor:not(.active) {
99
105
  display: none;
100
106
  }
package/dist/index.js CHANGED
@@ -174721,14 +174721,6 @@ var requestJS = (file, js) => {
174721
174721
  file.data.js.push(js);
174722
174722
  }
174723
174723
  };
174724
- var requestCSS = (file, css) => {
174725
- if (!file.data.css) {
174726
- file.data.css = [];
174727
- }
174728
- if (!file.data.css.find((s3) => JSON.stringify(s3) === JSON.stringify(css))) {
174729
- file.data.css.push(css);
174730
- }
174731
- };
174732
174724
  var isImage = (node3) => {
174733
174725
  return node3.type === "image";
174734
174726
  };
@@ -174994,6 +174986,7 @@ var en_default = {
174994
174986
  "openscad-render-failed": "OpenSCAD render failed",
174995
174987
  "openscad-params-object": "Parameters must be a JSON object",
174996
174988
  "openscad-params-loading": "Loading parameters...",
174989
+ "openscad-params-none": "No parameters",
174997
174990
  "openscad-parameters": "Parameters",
174998
174991
  "user-login-title": "Login",
174999
174992
  "user-username": "Username",
@@ -175131,6 +175124,7 @@ var de_default = {
175131
175124
  "openscad-render-failed": "OpenSCAD-Rendern fehlgeschlagen",
175132
175125
  "openscad-params-object": "Parameter m\xFCssen ein JSON-Objekt sein",
175133
175126
  "openscad-params-loading": "Parameter werden geladen...",
175127
+ "openscad-params-none": "Keine Parameter",
175134
175128
  "openscad-parameters": "Parameter",
175135
175129
  "user-login-title": "Anmelden",
175136
175130
  "user-username": "Benutzername",
@@ -195244,10 +195238,9 @@ ${(code4.scripts ? [cdnLibraryUrl, ...code4.scripts] : []).map((src) => `<script
195244
195238
  let bEditor = editor === "true";
195245
195239
  expectContainerDirective(node3, file, name);
195246
195240
  registerDirective(file, name, ["client.js"], ["style.css"]);
195247
- requestJS(file, ["code-input", "code-input.min.js"]);
195248
- requestCSS(file, ["code-input", "code-input.min.css"]);
195249
- requestJS(file, ["code-input", "auto-close-brackets.min.js"]);
195250
- requestJS(file, ["code-input", "indent.min.js"]);
195241
+ if (bEditor) {
195242
+ requestJS(file, ["codemirror", "codemirror.bundle.js"]);
195243
+ }
195251
195244
  let srcFile = "";
195252
195245
  if (src) {
195253
195246
  srcFile = readFile(src, ctx) || "";
@@ -195337,10 +195330,10 @@ ${(code4.scripts ? [cdnLibraryUrl, ...code4.scripts] : []).map((src) => `<script
195337
195330
  },
195338
195331
  {
195339
195332
  type: "element",
195340
- tagName: "code-input",
195333
+ tagName: "div",
195341
195334
  properties: {
195342
- class: "editor line-numbers",
195343
- language: "javascript"
195335
+ class: "editor",
195336
+ "data-lang": "javascript"
195344
195337
  },
195345
195338
  children: [
195346
195339
  {
@@ -195546,9 +195539,7 @@ var remarkDirectiveAbcMusic_default = (ctx) => () => {
195546
195539
  ["style.css"],
195547
195540
  []
195548
195541
  );
195549
- requestJS(file, ["code-input", "code-input.min.js"]);
195550
- requestCSS(file, ["code-input", "code-input.min.css"]);
195551
- requestJS(file, ["code-input", "indent.min.js"]);
195542
+ requestJS(file, ["codemirror", "codemirror.bundle.js"]);
195552
195543
  const value = node3.value || toString3(node3.children);
195553
195544
  const editor = node3.meta?.includes("editor");
195554
195545
  data.hName = "div";
@@ -195576,19 +195567,12 @@ var remarkDirectiveAbcMusic_default = (ctx) => () => {
195576
195567
  children: [
195577
195568
  {
195578
195569
  type: "element",
195579
- tagName: "code-input",
195570
+ tagName: "div",
195580
195571
  properties: {
195581
195572
  class: "editor",
195582
- id: hash(node3),
195583
- template: "abc-highlighted",
195584
- language: "javascript"
195573
+ "data-lang": "default"
195585
195574
  },
195586
- children: [
195587
- {
195588
- type: "raw",
195589
- value
195590
- }
195591
- ]
195575
+ children: []
195592
195576
  },
195593
195577
  {
195594
195578
  type: "element",
@@ -195678,10 +195662,7 @@ var remarkDirectivePyide_default = (ctx) => () => {
195678
195662
  const packageList = parsePackagesAttribute(packages);
195679
195663
  expectContainerDirective(node3, file, name);
195680
195664
  registerDirective(file, name, ["client.js"], ["style.css"], []);
195681
- requestJS(file, ["code-input", "code-input.min.js"]);
195682
- requestCSS(file, ["code-input", "code-input.min.css"]);
195683
- requestJS(file, ["code-input", "auto-close-brackets.min.js"]);
195684
- requestJS(file, ["code-input", "indent.min.js"]);
195665
+ requestJS(file, ["codemirror", "codemirror.bundle.js"]);
195685
195666
  let srcFile = "";
195686
195667
  let tests = [];
195687
195668
  if (src) {
@@ -195887,11 +195868,10 @@ var remarkDirectivePyide_default = (ctx) => () => {
195887
195868
  },
195888
195869
  {
195889
195870
  type: "element",
195890
- tagName: "code-input",
195871
+ tagName: "div",
195891
195872
  properties: {
195892
- class: "editor line-numbers",
195893
- language: "python",
195894
- template: "pyide-highlighted"
195873
+ class: "editor",
195874
+ "data-lang": "python"
195895
195875
  },
195896
195876
  children: [
195897
195877
  {
@@ -196001,10 +195981,7 @@ html, body {
196001
195981
  const resolvedHeight = height !== void 0 ? typeof height === "number" ? `${height}px` : `${height}` : "calc(100dvh - 80px)";
196002
195982
  expectContainerDirective(node3, file, name);
196003
195983
  registerDirective(file, name, ["client.js"], ["style.css"], []);
196004
- requestJS(file, ["code-input", "code-input.min.js"]);
196005
- requestCSS(file, ["code-input", "code-input.min.css"]);
196006
- requestJS(file, ["code-input", "auto-close-brackets.min.js"]);
196007
- requestJS(file, ["code-input", "indent.min.js"]);
195984
+ requestJS(file, ["codemirror", "codemirror.bundle.js"]);
196008
195985
  let js = "";
196009
195986
  let css = "";
196010
195987
  let html13 = "";
@@ -196039,11 +196016,10 @@ html, body {
196039
196016
  });
196040
196017
  editors.push({
196041
196018
  type: "element",
196042
- tagName: "code-input",
196019
+ tagName: "div",
196043
196020
  properties: {
196044
- class: "editor html line-numbers",
196045
- language: "html",
196046
- template: "webide-highlighted"
196021
+ class: "editor html",
196022
+ "data-lang": "html"
196047
196023
  },
196048
196024
  children: [
196049
196025
  {
@@ -196070,11 +196046,10 @@ html, body {
196070
196046
  });
196071
196047
  editors.push({
196072
196048
  type: "element",
196073
- tagName: "code-input",
196049
+ tagName: "div",
196074
196050
  properties: {
196075
- class: "editor css line-numbers",
196076
- language: "css",
196077
- template: "webide-highlighted"
196051
+ class: "editor css",
196052
+ "data-lang": "css"
196078
196053
  },
196079
196054
  children: [
196080
196055
  {
@@ -196101,11 +196076,10 @@ html, body {
196101
196076
  });
196102
196077
  editors.push({
196103
196078
  type: "element",
196104
- tagName: "code-input",
196079
+ tagName: "div",
196105
196080
  properties: {
196106
- class: "editor js line-numbers",
196107
- language: "javascript",
196108
- template: "webide-highlighted"
196081
+ class: "editor js",
196082
+ "data-lang": "javascript"
196109
196083
  },
196110
196084
  children: [
196111
196085
  {
@@ -201158,10 +201132,7 @@ var remarkDirectiveTypst_default = (ctx) => () => {
201158
201132
  const resolvedHeight = height !== void 0 ? `${height}` : "calc(100dvh - 80px)";
201159
201133
  expectContainerDirective(node3, file, name);
201160
201134
  registerDirective(file, name, ["client.js"], ["style.css"], []);
201161
- requestJS(file, ["code-input", "code-input.min.js"]);
201162
- requestCSS(file, ["code-input", "code-input.min.css"]);
201163
- requestJS(file, ["code-input", "auto-close-brackets.min.js"]);
201164
- requestJS(file, ["code-input", "indent.min.js"]);
201135
+ requestJS(file, ["codemirror", "codemirror.bundle.js"]);
201165
201136
  requestJS(file, ["uzip", "uzip.js"]);
201166
201137
  const sourceFiles = [];
201167
201138
  const binaryFiles = [];
@@ -201507,11 +201478,10 @@ var remarkDirectiveTypst_default = (ctx) => () => {
201507
201478
  },
201508
201479
  {
201509
201480
  type: "element",
201510
- tagName: "code-input",
201481
+ tagName: "div",
201511
201482
  properties: {
201512
- class: "editor typst active line-numbers",
201513
- language: "typst",
201514
- template: "typst-highlighted"
201483
+ class: "editor typst active",
201484
+ "data-lang": "typst"
201515
201485
  },
201516
201486
  children: [
201517
201487
  {
@@ -201593,10 +201563,7 @@ var remarkDirectiveOpenscad_default = (ctx) => () => {
201593
201563
  const data = node3.data || (node3.data = {});
201594
201564
  expectContainerDirective(node3, file, name);
201595
201565
  registerDirective(file, name, ["client.js"], ["style.css"], []);
201596
- requestJS(file, ["code-input", "code-input.min.js"]);
201597
- requestCSS(file, ["code-input", "code-input.min.css"]);
201598
- requestJS(file, ["code-input", "auto-close-brackets.min.js"]);
201599
- requestJS(file, ["code-input", "indent.min.js"]);
201566
+ requestJS(file, ["codemirror", "codemirror.bundle.js"]);
201600
201567
  let source = "";
201601
201568
  if (src) {
201602
201569
  source = readFile(src, ctx) || "";
@@ -201654,7 +201621,7 @@ var remarkDirectiveOpenscad_default = (ctx) => () => {
201654
201621
  type: "element",
201655
201622
  tagName: "div",
201656
201623
  properties: {
201657
- class: "canvas-params-splitter hidden",
201624
+ class: "canvas-params-splitter",
201658
201625
  role: "separator",
201659
201626
  "aria-label": "Resize canvas and parameters"
201660
201627
  },
@@ -201663,7 +201630,7 @@ var remarkDirectiveOpenscad_default = (ctx) => () => {
201663
201630
  {
201664
201631
  type: "element",
201665
201632
  tagName: "div",
201666
- properties: { class: "parameters-panel hidden" },
201633
+ properties: { class: "parameters-panel" },
201667
201634
  children: [
201668
201635
  {
201669
201636
  type: "element",
@@ -201711,11 +201678,10 @@ var remarkDirectiveOpenscad_default = (ctx) => () => {
201711
201678
  },
201712
201679
  {
201713
201680
  type: "element",
201714
- tagName: "code-input",
201681
+ tagName: "div",
201715
201682
  properties: {
201716
- class: "editor line-numbers",
201717
- language: "clike",
201718
- template: "openscad-highlighted"
201683
+ class: "editor",
201684
+ "data-lang": "clike"
201719
201685
  },
201720
201686
  children: [{ type: "raw", value: htmlEntities5(source) }]
201721
201687
  },
@@ -202153,7 +202119,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"application/1d-interleaved-parityfec
202153
202119
  /***/ ((module) => {
202154
202120
 
202155
202121
  "use strict";
202156
- module.exports = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.94.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"}}');
202122
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.95.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"}}');
202157
202123
 
202158
202124
  /***/ })
202159
202125
 
@@ -103,6 +103,7 @@
103
103
  "openscad-render-failed": "OpenSCAD-Rendern fehlgeschlagen",
104
104
  "openscad-params-object": "Parameter müssen ein JSON-Objekt sein",
105
105
  "openscad-params-loading": "Parameter werden geladen...",
106
+ "openscad-params-none": "Keine Parameter",
106
107
  "openscad-parameters": "Parameter",
107
108
  "user-login-title": "Anmelden",
108
109
  "user-username": "Benutzername",
@@ -103,6 +103,7 @@
103
103
  "openscad-render-failed": "OpenSCAD render failed",
104
104
  "openscad-params-object": "Parameters must be a JSON object",
105
105
  "openscad-params-loading": "Loading parameters...",
106
+ "openscad-params-none": "No parameters",
106
107
  "openscad-parameters": "Parameters",
107
108
  "user-login-title": "Login",
108
109
  "user-username": "Username",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperbook",
3
- "version": "0.94.0",
3
+ "version": "0.95.0",
4
4
  "author": "Mike Barkmin",
5
5
  "homepage": "https://github.com/openpatch/hyperbook#readme",
6
6
  "license": "MIT",
@@ -57,9 +57,9 @@
57
57
  "update-check": "1.5.4",
58
58
  "ws": "^8.18.0",
59
59
  "create-hyperbook": "0.3.6",
60
- "@hyperbook/markdown": "0.65.0",
60
+ "@hyperbook/fs": "0.25.0",
61
61
  "@hyperbook/types": "0.23.0",
62
- "@hyperbook/fs": "0.25.0"
62
+ "@hyperbook/markdown": "0.66.0"
63
63
  },
64
64
  "scripts": {
65
65
  "version": "pnpm build",
@@ -1 +0,0 @@
1
- "use strict";codeInput.plugins.AutoCloseBrackets=class extends codeInput.Plugin{bracketPairs=[];bracketsOpenedStack=[];constructor(a={"(":")","[":"]","{":"}",'"':"\""}){super([]),this.bracketPairs=a}afterElementsAdded(a){a.pluginData.autoCloseBrackets={automatedKeypresses:!1},a.textareaElement.addEventListener("keydown",b=>{this.checkBackspace(a,b)}),a.textareaElement.addEventListener("beforeinput",b=>{this.checkClosingBracket(a,b)}),a.textareaElement.addEventListener("input",b=>{this.checkOpeningBracket(a,b)})}checkClosingBracket(a,b){if(!a.pluginData.autoCloseBrackets.automatedKeypresses&&b.data==a.textareaElement.value[a.textareaElement.selectionStart])for(let c in this.bracketPairs){let d=this.bracketPairs[c];if(b.data==d){a.textareaElement.selectionStart=a.textareaElement.selectionEnd+=1,b.preventDefault();break}}}checkOpeningBracket(a,b){if(!a.pluginData.autoCloseBrackets.automatedKeypresses&&b.data in this.bracketPairs){let c=this.bracketPairs[b.data];a.pluginData.autoCloseBrackets.automatedKeypresses=!0,document.execCommand("insertText",!1,c),a.pluginData.autoCloseBrackets.automatedKeypresses=!1,a.textareaElement.selectionStart=a.textareaElement.selectionEnd-=1}}checkBackspace(a,b){if(!a.pluginData.autoCloseBrackets.automatedKeypresses&&"Backspace"==b.key&&a.textareaElement.selectionStart==a.textareaElement.selectionEnd){let b=this.bracketPairs[a.textareaElement.value[a.textareaElement.selectionStart-1]];null!=b&&a.textareaElement.value[a.textareaElement.selectionStart]==b&&(a.textareaElement.selectionEnd=a.textareaElement.selectionStart+1,a.textareaElement.selectionStart-=1)}}};