hyperbook 0.57.2 → 0.58.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-learningmap/client.js +73 -0
- package/dist/assets/directive-learningmap/hyperbook-learningmap.umd.js +161 -0
- package/dist/assets/directive-learningmap/style.css +6 -0
- package/dist/assets/directive-learningmap/web-component-learningmap.css +1 -0
- package/dist/assets/directive-webide/client.js +11 -3
- package/dist/assets/store.js +1 -0
- package/dist/index.js +61 -10
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}.learningmap-footer{width:100%;background:var(--color-nav);border-top:1px solid var(--color-nav-border);padding:8px 32px 16px;z-index:10;position:relative;box-sizing:border-box}@media (max-width: 600px){.learningmap-footer{padding-left:8px;padding-right:8px}}.hyperbook-learningmap-container{width:100%;height:100%;display:flex;flex-direction:column}.learningmap-header{width:100%;background:var(--color-nav);border-bottom:1px solid var(--color-nav-border);padding:24px 32px 16px;z-index:10;position:relative;box-sizing:border-box;overflow-x:auto}@media (max-width: 600px){.learningmap-header{padding-left:8px;padding-right:8px}}.learningmap-roadmap{flex:1;min-height:0;position:relative;width:100%;background:transparent}.learning-node{padding:16px 24px;display:flex;align-items:center;justify-content:center;border-radius:8px;border:2px solid;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;transition:all .3s ease;background:#fff}.react-flow__node-background img{max-width:none}.react-flow__node-task .learning-node{background:#f0f7ff;border-color:#3b82f6;border-radius:16px}.react-flow__node-topic .learning-node{background:#fffbe6;border-color:#f59e42;border-radius:8px;font-size:16px;font-weight:700;box-shadow:0 2px 8px #f59e4214;padding-left:18px}.learning-node.optional{border:2px dashed #38bdf8}.react-flow__node-topic .learning-node{border-left:12px solid #f59e42}.learning-node.locked{background:#f3f4f6;border-color:#d1d5db}.learning-node.completed{background:#f0fdf4;border-color:#22c55e}.learning-node.available{background:#fff;border-color:#60a5fa;cursor:pointer}.learning-node.available:hover{border-color:#2563eb;transform:translateY(-2px);box-shadow:0 10px 15px -3px #0000001a,0 4px 6px -2px #0000000d}.node-header{display:flex;align-items:center;gap:8px}.node-icon{width:20px;height:20px;flex-shrink:0}.learning-node.completed .node-icon{color:#16a34a}.learning-node.available .node-icon{color:#3b82f6}.learning-node.started .node-icon{color:#f59e42}.learning-node.locked .node-icon{color:#a1a1aa}.node-label{font-weight:600;font-size:14px;color:#1f2937}.star-counter{font-weight:600;color:#f59e42;font-size:14px}.progress-panel{padding:16px;margin:16px}.progress-section{margin-bottom:8px}.progress-header{display:flex;justify-content:space-between;font-size:14px;margin-bottom:4px}.progress-label{color:var(--color-text)}.progress-value{font-weight:600;color:var(--color-text)}.progress-bar-container{width:100%;background-color:var(--color-spacer);border:1px solid var(--color-nav-border);border-radius:9999px;height:8px;overflow:hidden}.progress-bar-fill{background-color:var(--color-brand);height:100%;border-radius:9999px;transition:width .3s ease}.progress-text{font-size:12px;margin-top:4px}.legend-panel{border-radius:0;box-shadow:none;padding:12px 0 0;margin:0;font-size:12px;color:var(--color-text);display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:24px;justify-content:center}.legend-item{display:flex;align-items:center;gap:8px}.legend-icon-available{color:#3b82f6}.legend-icon-locked{color:#9ca3af}.drawer-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#000000b3;z-index:1002;animation:fadeIn .2s ease}.drawer-password-input{background:none;color:var(--color-text);border:1px solid var(--color-nav-border);border-radius:6px;padding:10px 36px 10px 12px;font-size:16px;width:100%;box-sizing:border-box}.react-flow__handle{opacity:0!important}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideIn{0%{transform:translate(100%)}to{transform:translate(0)}}.drawer{position:fixed;top:0;right:0;bottom:0;width:500px;max-width:90vw;background:var(--color-nav);box-shadow:-4px 0 12px #0000001a;z-index:1003;display:flex;flex-direction:column;animation:slideIn .3s ease}.drawer iframe{border:none}.drawer-header{padding:24px;border-bottom:1px solid var(--color-nav-border)}.drawer-header h2{border:none;margin:0}.drawer-title{font-size:24px;font-weight:700;margin:0 0 4px}.drawer-duration{font-size:14px;color:#6b7280}.drawer-content{flex:1;overflow-y:auto;padding:24px}.drawer-footer{padding:24px;border-top:1px solid var(--color-nav-border)}.complete-button{width:100%;padding:14px;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;transition:all .2s}.complete-button .legend-icon-completed{color:#16a34a!important}.complete-button:not(.locked):not(.completed){background:#3b82f6;color:#fff}.complete-button:not(.locked):not(.completed):hover{background:#2563eb}.complete-button.completed{background:#22c55e;color:#fff}.complete-button.completed:hover{background:#16a34a}.complete-button.locked{background:#f3f4f6;color:#9ca3af;cursor:not-allowed}.react-flow__controls-button{color:#000!important}
|
|
@@ -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/assets/store.js
CHANGED
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
|
});
|
|
@@ -187983,6 +187991,48 @@ var remarkImageAttrs = (ctx) => () => {
|
|
|
187983
187991
|
};
|
|
187984
187992
|
var remarkImageAttrs_default = remarkImageAttrs;
|
|
187985
187993
|
|
|
187994
|
+
// src/remarkDirectiveLearningmap.ts
|
|
187995
|
+
var remarkDirectiveLearningmap_default = (ctx) => () => {
|
|
187996
|
+
const name = "learningmap";
|
|
187997
|
+
return (tree, file) => {
|
|
187998
|
+
visit(tree, function(node3) {
|
|
187999
|
+
if (isDirective(node3)) {
|
|
188000
|
+
if (node3.name !== name) return;
|
|
188001
|
+
const data = node3.data || (node3.data = {});
|
|
188002
|
+
expectLeafDirective(node3, file, name);
|
|
188003
|
+
registerDirective(
|
|
188004
|
+
file,
|
|
188005
|
+
name,
|
|
188006
|
+
["client.js", "hyperbook-learningmap.umd.js"],
|
|
188007
|
+
["style.css", "web-component-learningmap.css"],
|
|
188008
|
+
[]
|
|
188009
|
+
);
|
|
188010
|
+
const { height = "calc(100vh - 80px)", id = hash(node3) } = node3.attributes || {};
|
|
188011
|
+
const roadmapData = toText2(
|
|
188012
|
+
node3.children.find((c) => c.type === "code" && c.lang === "yaml")
|
|
188013
|
+
);
|
|
188014
|
+
data.hName = "div";
|
|
188015
|
+
data.hProperties = {
|
|
188016
|
+
class: "directive-learningmap",
|
|
188017
|
+
id: `learningmap-${id}`,
|
|
188018
|
+
style: `height: ${height}`
|
|
188019
|
+
};
|
|
188020
|
+
data.hChildren = [
|
|
188021
|
+
{
|
|
188022
|
+
type: "element",
|
|
188023
|
+
tagName: "hyperbook-learningmap",
|
|
188024
|
+
properties: {
|
|
188025
|
+
"roadmap-data": roadmapData,
|
|
188026
|
+
language: ctx.config.language || "en"
|
|
188027
|
+
},
|
|
188028
|
+
children: []
|
|
188029
|
+
}
|
|
188030
|
+
];
|
|
188031
|
+
}
|
|
188032
|
+
});
|
|
188033
|
+
};
|
|
188034
|
+
};
|
|
188035
|
+
|
|
187986
188036
|
// src/process.ts
|
|
187987
188037
|
var remark = (ctx) => {
|
|
187988
188038
|
i18n.init(ctx.config.language || "en");
|
|
@@ -187991,6 +188041,9 @@ var remark = (ctx) => {
|
|
|
187991
188041
|
remarkRemoveComments,
|
|
187992
188042
|
remarkDirective,
|
|
187993
188043
|
dist_default,
|
|
188044
|
+
remarkDirectivePyide_default(ctx),
|
|
188045
|
+
remarkDirectiveWebide_default(ctx),
|
|
188046
|
+
remarkDirectiveOnlineIde_default(ctx),
|
|
187994
188047
|
remarkDirectivePagelist_default(ctx),
|
|
187995
188048
|
remarkLink_default(ctx),
|
|
187996
188049
|
remarkImageAttrs_default(ctx),
|
|
@@ -188011,8 +188064,6 @@ var remark = (ctx) => {
|
|
|
188011
188064
|
remarkDirectiveTiles_default(ctx),
|
|
188012
188065
|
remarkDirectiveTabs_default(ctx),
|
|
188013
188066
|
remarkDirectiveSqlIde_default(ctx),
|
|
188014
|
-
remarkDirectivePyide_default(ctx),
|
|
188015
|
-
remarkDirectiveOnlineIde_default(ctx),
|
|
188016
188067
|
remarkDirectivePlantuml_default(ctx),
|
|
188017
188068
|
remarkDirectiveSlideshow_default(ctx),
|
|
188018
188069
|
remarkDirectiveScratchblock_default(ctx),
|
|
@@ -188021,10 +188072,10 @@ var remark = (ctx) => {
|
|
|
188021
188072
|
remarkDirectiveExcalidraw_default(ctx),
|
|
188022
188073
|
remarkDirectiveStruktog_default(ctx),
|
|
188023
188074
|
remarkDirectiveGeogebra_default(ctx),
|
|
188024
|
-
remarkDirectiveWebide_default(ctx),
|
|
188025
188075
|
remarkDirectiveH5P_default(ctx),
|
|
188026
188076
|
remarkDirectiveJSXGraph_default(ctx),
|
|
188027
188077
|
remarkDirectiveMultievent_default(ctx),
|
|
188078
|
+
remarkDirectiveLearningmap_default(ctx),
|
|
188028
188079
|
remarkCode_default(ctx),
|
|
188029
188080
|
remarkMath,
|
|
188030
188081
|
/* needs to be last directive */
|
|
@@ -188092,7 +188143,7 @@ pako/dist/pako.esm.mjs:
|
|
|
188092
188143
|
//# sourceMappingURL=index.js.map
|
|
188093
188144
|
|
|
188094
188145
|
;// CONCATENATED MODULE: ./package.json
|
|
188095
|
-
const package_namespaceObject = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.
|
|
188146
|
+
const package_namespaceObject = /*#__PURE__*/JSON.parse('{"name":"hyperbook","version":"0.58.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":">=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
188147
|
;// CONCATENATED MODULE: ./build.ts
|
|
188097
188148
|
|
|
188098
188149
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hyperbook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0",
|
|
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.
|
|
57
|
+
"@hyperbook/markdown": "0.34.0",
|
|
58
58
|
"@hyperbook/types": "0.15.2"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|