chalk-talk 0.13.0 → 0.14.1
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/README.md +1 -1
- package/assets/player.html +3 -3
- package/embed-mermaid.js +1 -1
- package/embed.js +5 -5
- package/kit/SKILL.template.md +55 -0
- package/kit/browser.mjs +198 -0
- package/kit/format.check.ts +23 -0
- package/kit/format.ts +39 -0
- package/kit/page.mjs +15 -0
- package/kit/tools/audit.mjs +42 -0
- package/kit/tools/checks.mjs +67 -0
- package/kit/tools/eval-metrics.mjs +70 -0
- package/kit/tools/gallery.mjs +31 -0
- package/kit/tools/linux-check.mjs +31 -0
- package/kit/tools/vendor.mjs +24 -0
- package/kit/tools/zip.mjs +14 -0
- package/markdown.js +1 -1
- package/mount.global.js +374 -374
- package/mount.js +1 -1
- package/package.json +4 -2
- package/player.js +4 -4
- package/scripts/browser.mjs +22 -5
- package/scripts/build.mjs +17 -5
- package/scripts/contract.mjs +1 -1
- package/scripts/mermaid.mjs +1 -1
- package/scripts/page.mjs +15 -0
package/mount.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! chalk-talk mount (engine v0.
|
|
1
|
+
/*! chalk-talk mount (engine v0.254.0) — MIT */
|
|
2
2
|
import{ChalkTextError as h,ensureStyles as p,mountLesson as m,readRecipe as f}from"./embed.js";var k="[data-chalk-talk]",r=new Map;function u(){let t=document.body.classList,e=document.documentElement.dataset.theme;return t.contains("vscode-dark")||t.contains("vscode-high-contrast")?"chalkboard":t.contains("vscode-light")||e==="light"?"paper":e==="dark"||matchMedia("(prefers-color-scheme: dark)").matches?"chalkboard":"paper"}async function g(t,e){if(t.dataset.chalkTalk!=="mermaid")return f(e);let{readMermaid:n}=await import("./embed-mermaid.js");return n(e,{locale:navigator.language.toLowerCase().startsWith("pt")?"pt-BR":"en-US"})}function E(t){let e=document.createElement("dialog");e.className="chalk-talk-dialog";let n=document.createElement("button");n.type="button",n.className="chalk-talk-close",n.setAttribute("aria-label","Close"),n.textContent="\xD7";let c=document.createElement("div");e.append(n,c),document.body.append(e);let o;n.addEventListener("click",()=>e.close()),e.addEventListener("close",()=>{o?.destroy(),e.remove()}),e.showModal(),m(c,t,{theme:u()}).then(a=>o=a)}async function y(t){r.set(t,null),p();let e=t.querySelector(".chalk-talk-source"),n=e?.textContent??"",c=document.createElement("div");try{let o=await g(t,n);if(!t.isConnected)return;t.append(c),r.set(t,await m(c,o,{compact:!0,theme:u(),onExpand:()=>E(o)})),e&&(e.hidden=!0)}catch(o){let a=document.createElement("div");a.className="chalk-talk-error";let s=document.createElement("b");if(s.textContent="chalk-talk",a.append(s,` \xB7 ${o.message}`),o instanceof h){let d=n.split(`
|
|
3
3
|
`)[o.line-1];if(d?.trim()){let l=document.createElement("code");l.textContent=d,a.append(l)}}t.prepend(a)}}function i(t=document){for(let[e,n]of r)e.isConnected||(n?.destroy(),r.delete(e));for(let e of t.querySelectorAll(k))r.has(e)||y(e)}function b(){let t=window;if(t.__chalkTalkWatching)return;t.__chalkTalkWatching=!0;let e=()=>{i(),new MutationObserver(()=>i()).observe(document.body,{childList:!0,subtree:!0})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}export{i as mountAll,b as watch};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chalk-talk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Hand-drawn lessons that draw themselves: a player for chalk-talk recipes (one script for the browser or a CDN), a lesson you can mount inside any element, and a command that checks a recipe and builds one HTML file.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"markdown.js",
|
|
42
42
|
"markdown.d.ts",
|
|
43
43
|
"scripts/",
|
|
44
|
+
"kit/",
|
|
44
45
|
"assets/player.html",
|
|
45
46
|
"README.md",
|
|
46
47
|
"LICENSE"
|
|
@@ -68,6 +69,7 @@
|
|
|
68
69
|
"./markdown": {
|
|
69
70
|
"types": "./markdown.d.ts",
|
|
70
71
|
"default": "./markdown.js"
|
|
71
|
-
}
|
|
72
|
+
},
|
|
73
|
+
"./kit/*": "./kit/*"
|
|
72
74
|
}
|
|
73
75
|
}
|