hyperbook 0.57.2 → 0.57.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/directive-webide/client.js +11 -3
- package/dist/index.js +18 -10
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ hyperbook.webide = (function () {
|
|
|
4
4
|
codeInput.templates.prism(window.Prism, [
|
|
5
5
|
new codeInput.plugins.AutoCloseBrackets(),
|
|
6
6
|
new codeInput.plugins.Indent(true, 2),
|
|
7
|
-
])
|
|
7
|
+
]),
|
|
8
8
|
);
|
|
9
9
|
|
|
10
10
|
const elems = document.getElementsByClassName("directive-webide");
|
|
@@ -71,7 +71,9 @@ hyperbook.webide = (function () {
|
|
|
71
71
|
|
|
72
72
|
const load = async () => {
|
|
73
73
|
const result = await store.webide.get(id);
|
|
74
|
-
if (!result)
|
|
74
|
+
if (!result) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
75
77
|
const website = template
|
|
76
78
|
.replace("###HTML###", result.html)
|
|
77
79
|
.replace("###CSS###", result.css)
|
|
@@ -94,7 +96,7 @@ hyperbook.webide = (function () {
|
|
|
94
96
|
.replace("###JS###", editorJS?.value);
|
|
95
97
|
frame.srcdoc = website;
|
|
96
98
|
};
|
|
97
|
-
|
|
99
|
+
|
|
98
100
|
frame.addEventListener("load", () => {
|
|
99
101
|
title.textContent = frame.contentDocument.title;
|
|
100
102
|
});
|
|
@@ -105,6 +107,8 @@ hyperbook.webide = (function () {
|
|
|
105
107
|
editorHTML.value = result.html;
|
|
106
108
|
}
|
|
107
109
|
|
|
110
|
+
update();
|
|
111
|
+
|
|
108
112
|
editorHTML.addEventListener("input", () => {
|
|
109
113
|
update();
|
|
110
114
|
});
|
|
@@ -116,6 +120,8 @@ hyperbook.webide = (function () {
|
|
|
116
120
|
editorCSS.value = result.css;
|
|
117
121
|
}
|
|
118
122
|
|
|
123
|
+
update();
|
|
124
|
+
|
|
119
125
|
editorCSS.addEventListener("input", () => {
|
|
120
126
|
update();
|
|
121
127
|
});
|
|
@@ -127,6 +133,8 @@ hyperbook.webide = (function () {
|
|
|
127
133
|
editorJS.value = result.js;
|
|
128
134
|
}
|
|
129
135
|
|
|
136
|
+
update();
|
|
137
|
+
|
|
130
138
|
editorJS.addEventListener("input", () => {
|
|
131
139
|
update();
|
|
132
140
|
});
|
package/dist/index.js
CHANGED
|
@@ -180369,6 +180369,9 @@ function node2(value) {
|
|
|
180369
180369
|
}
|
|
180370
180370
|
|
|
180371
180371
|
// src/rehypeDirectiveP5.ts
|
|
180372
|
+
function htmlEntities(str) {
|
|
180373
|
+
return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
180374
|
+
}
|
|
180372
180375
|
var rehypeDirectiveP5_default = (ctx) => () => {
|
|
180373
180376
|
const name = "p5";
|
|
180374
180377
|
const cdnLibraryUrl = ctx.makeUrl(
|
|
@@ -180511,7 +180514,7 @@ ${(code4.scripts ? [cdnLibraryUrl, ...code4.scripts] : []).map((src) => `<script
|
|
|
180511
180514
|
children: [
|
|
180512
180515
|
{
|
|
180513
180516
|
type: "raw",
|
|
180514
|
-
value: srcFile
|
|
180517
|
+
value: htmlEntities(srcFile)
|
|
180515
180518
|
}
|
|
180516
180519
|
]
|
|
180517
180520
|
},
|
|
@@ -180800,6 +180803,9 @@ var remarkDirectiveAbcMusic_default = (ctx) => () => {
|
|
|
180800
180803
|
// src/remarkDirectivePyide.ts
|
|
180801
180804
|
|
|
180802
180805
|
|
|
180806
|
+
function htmlEntities2(str) {
|
|
180807
|
+
return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
180808
|
+
}
|
|
180803
180809
|
var remarkDirectivePyide_default = (ctx) => () => {
|
|
180804
180810
|
const name = "pyide";
|
|
180805
180811
|
return (tree, file) => {
|
|
@@ -180965,7 +180971,7 @@ var remarkDirectivePyide_default = (ctx) => () => {
|
|
|
180965
180971
|
children: [
|
|
180966
180972
|
{
|
|
180967
180973
|
type: "raw",
|
|
180968
|
-
value: srcFile
|
|
180974
|
+
value: htmlEntities2(srcFile)
|
|
180969
180975
|
}
|
|
180970
180976
|
]
|
|
180971
180977
|
},
|
|
@@ -181026,6 +181032,9 @@ var remarkDirectivePyide_default = (ctx) => () => {
|
|
|
181026
181032
|
};
|
|
181027
181033
|
|
|
181028
181034
|
// src/remarkDirectiveWebide.ts
|
|
181035
|
+
function htmlEntities3(str) {
|
|
181036
|
+
return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
181037
|
+
}
|
|
181029
181038
|
var remarkDirectiveWebide_default = (ctx) => () => {
|
|
181030
181039
|
const name = "webide";
|
|
181031
181040
|
const makeWrapInMarkupTemplate = () => `<!DOCTYPE html>
|
|
@@ -181074,7 +181083,6 @@ html, body {
|
|
|
181074
181083
|
const buttons = [];
|
|
181075
181084
|
const editors = [];
|
|
181076
181085
|
if (htmlNode) {
|
|
181077
|
-
html13 = htmlNode.value;
|
|
181078
181086
|
buttons.push({
|
|
181079
181087
|
type: "element",
|
|
181080
181088
|
tagName: "button",
|
|
@@ -181099,7 +181107,7 @@ html, body {
|
|
|
181099
181107
|
children: [
|
|
181100
181108
|
{
|
|
181101
181109
|
type: "raw",
|
|
181102
|
-
value:
|
|
181110
|
+
value: htmlEntities3(htmlNode.value)
|
|
181103
181111
|
}
|
|
181104
181112
|
]
|
|
181105
181113
|
});
|
|
@@ -181130,7 +181138,7 @@ html, body {
|
|
|
181130
181138
|
children: [
|
|
181131
181139
|
{
|
|
181132
181140
|
type: "raw",
|
|
181133
|
-
value: css
|
|
181141
|
+
value: htmlEntities3(css)
|
|
181134
181142
|
}
|
|
181135
181143
|
]
|
|
181136
181144
|
});
|
|
@@ -181161,7 +181169,7 @@ html, body {
|
|
|
181161
181169
|
children: [
|
|
181162
181170
|
{
|
|
181163
181171
|
type: "raw",
|
|
181164
|
-
value: js
|
|
181172
|
+
value: htmlEntities3(js)
|
|
181165
181173
|
}
|
|
181166
181174
|
]
|
|
181167
181175
|
});
|
|
@@ -187991,6 +187999,9 @@ var remark = (ctx) => {
|
|
|
187991
187999
|
remarkRemoveComments,
|
|
187992
188000
|
remarkDirective,
|
|
187993
188001
|
dist_default,
|
|
188002
|
+
remarkDirectivePyide_default(ctx),
|
|
188003
|
+
remarkDirectiveWebide_default(ctx),
|
|
188004
|
+
remarkDirectiveOnlineIde_default(ctx),
|
|
187994
188005
|
remarkDirectivePagelist_default(ctx),
|
|
187995
188006
|
remarkLink_default(ctx),
|
|
187996
188007
|
remarkImageAttrs_default(ctx),
|
|
@@ -188011,8 +188022,6 @@ var remark = (ctx) => {
|
|
|
188011
188022
|
remarkDirectiveTiles_default(ctx),
|
|
188012
188023
|
remarkDirectiveTabs_default(ctx),
|
|
188013
188024
|
remarkDirectiveSqlIde_default(ctx),
|
|
188014
|
-
remarkDirectivePyide_default(ctx),
|
|
188015
|
-
remarkDirectiveOnlineIde_default(ctx),
|
|
188016
188025
|
remarkDirectivePlantuml_default(ctx),
|
|
188017
188026
|
remarkDirectiveSlideshow_default(ctx),
|
|
188018
188027
|
remarkDirectiveScratchblock_default(ctx),
|
|
@@ -188021,7 +188030,6 @@ var remark = (ctx) => {
|
|
|
188021
188030
|
remarkDirectiveExcalidraw_default(ctx),
|
|
188022
188031
|
remarkDirectiveStruktog_default(ctx),
|
|
188023
188032
|
remarkDirectiveGeogebra_default(ctx),
|
|
188024
|
-
remarkDirectiveWebide_default(ctx),
|
|
188025
188033
|
remarkDirectiveH5P_default(ctx),
|
|
188026
188034
|
remarkDirectiveJSXGraph_default(ctx),
|
|
188027
188035
|
remarkDirectiveMultievent_default(ctx),
|
|
@@ -188092,7 +188100,7 @@ pako/dist/pako.esm.mjs:
|
|
|
188092
188100
|
//# sourceMappingURL=index.js.map
|
|
188093
188101
|
|
|
188094
188102
|
;// CONCATENATED MODULE: ./package.json
|
|
188095
|
-
const package_namespaceObject = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.57.
|
|
188103
|
+
const package_namespaceObject = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.57.3","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":">=12.22.0"},"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 && node postbuild.mjs"},"devDependencies":{"@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"}}');
|
|
188096
188104
|
;// CONCATENATED MODULE: ./build.ts
|
|
188097
188105
|
|
|
188098
188106
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hyperbook",
|
|
3
|
-
"version": "0.57.
|
|
3
|
+
"version": "0.57.3",
|
|
4
4
|
"author": "Mike Barkmin",
|
|
5
5
|
"homepage": "https://github.com/openpatch/hyperbook#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"update-check": "1.5.4",
|
|
55
55
|
"ws": "^8.18.0",
|
|
56
56
|
"@hyperbook/fs": "0.19.0",
|
|
57
|
-
"@hyperbook/markdown": "0.33.
|
|
57
|
+
"@hyperbook/markdown": "0.33.3",
|
|
58
58
|
"@hyperbook/types": "0.15.2"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|