@eclipse-docks/extension-canvas 0.8.9 → 0.8.10
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/canvas-catalog.js +5 -5
- package/dist/canvas-catalog.js.map +1 -1
- package/dist/canvas-extension.js +6 -6
- package/dist/canvas-extension.js.map +1 -1
- package/dist/canvases/lounging-cat.canvas.js +6 -0
- package/dist/canvases/lounging-cat.canvas.js.map +1 -0
- package/dist/host.js +1 -1
- package/dist/host.js.map +1 -1
- package/dist/skills/eclipse-docks-canvas/SKILL.js +1 -1
- package/dist/skills/eclipse-docks-core/SKILL.js +1 -1
- package/package.json +1 -1
- package/dist/canvases/player.canvas.js +0 -6
- package/dist/canvases/player.canvas.js.map +0 -1
package/dist/canvas-catalog.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import lounging_cat_canvas_default from "./canvases/lounging-cat.canvas.js";
|
|
1
2
|
import tasks_canvas_default from "./canvases/tasks.canvas.js";
|
|
2
|
-
import player_canvas_default from "./canvases/player.canvas.js";
|
|
3
3
|
import { registerCatalog } from "@eclipse-docks/extension-catalog/api";
|
|
4
4
|
//#region src/canvas-catalog.ts
|
|
5
5
|
function canvasFileUrl(source) {
|
|
@@ -21,11 +21,11 @@ var CANVAS_CATALOG = {
|
|
|
21
21
|
filename: "tasks.canvas.js"
|
|
22
22
|
}
|
|
23
23
|
}, {
|
|
24
|
-
label: "
|
|
25
|
-
icon: "
|
|
24
|
+
label: "Lounging Cat",
|
|
25
|
+
icon: "cat",
|
|
26
26
|
state: {
|
|
27
|
-
url: canvasFileUrl(
|
|
28
|
-
filename: "
|
|
27
|
+
url: canvasFileUrl(lounging_cat_canvas_default),
|
|
28
|
+
filename: "lounging-cat.canvas.js"
|
|
29
29
|
}
|
|
30
30
|
}]
|
|
31
31
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas-catalog.js","names":["tasksSource","
|
|
1
|
+
{"version":3,"file":"canvas-catalog.js","names":["tasksSource","loungingCatSource"],"sources":["../src/canvas-catalog.ts"],"sourcesContent":["import type { CatalogContribution } from '@eclipse-docks/extension-catalog/api';\nimport { registerCatalog } from '@eclipse-docks/extension-catalog/api';\nimport loungingCatSource from './canvases/lounging-cat.canvas.js?raw';\nimport tasksSource from './canvases/tasks.canvas.js?raw';\n\nfunction canvasFileUrl(source: string): string {\n return `data:text/javascript;charset=utf-8,${encodeURIComponent(source)}`;\n}\n\nconst CANVAS_CATALOG: CatalogContribution = {\n label: 'Canvases',\n icon: 'table-columns',\n contributionId: 'catalog.canvases',\n items: [\n {\n label: 'Examples',\n icon: 'file-code',\n contributionId: 'catalog.canvases.examples',\n items: [\n { label: 'Tasks', icon: 'list-check', state: { url: canvasFileUrl(tasksSource), filename: 'tasks.canvas.js' } },\n { label: 'Lounging Cat', icon: 'cat', state: { url: canvasFileUrl(loungingCatSource), filename: 'lounging-cat.canvas.js' } },\n ],\n },\n ],\n};\n\nexport function registerCanvasCatalog(): void {\n registerCatalog(CANVAS_CATALOG);\n}\n"],"mappings":";;;;AAKA,SAAS,cAAc,QAAwB;CAC3C,OAAO,sCAAsC,mBAAmB,MAAM;AAC1E;AAEA,IAAM,iBAAsC;CACxC,OAAO;CACP,MAAM;CACN,gBAAgB;CAChB,OAAO,CACH;EACI,OAAO;EACP,MAAM;EACN,gBAAgB;EAChB,OAAO,CACH;GAAE,OAAO;GAAS,MAAM;GAAc,OAAO;IAAE,KAAK,cAAcA,oBAAW;IAAG,UAAU;GAAkB;EAAE,GAC9G;GAAE,OAAO;GAAgB,MAAM;GAAO,OAAO;IAAE,KAAK,cAAcC,2BAAiB;IAAG,UAAU;GAAyB;EAAE,CAC/H;CACJ,CACJ;AACJ;AAEA,SAAgB,wBAA8B;CAC1C,gBAAgB,cAAc;AAClC"}
|
package/dist/canvas-extension.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SYSTEM_CANVASES, isCanvasContribution } from "./contribution.js";
|
|
2
2
|
import { listRegisteredCanvases } from "./canvases.js";
|
|
3
|
+
import lounging_cat_canvas_default from "./canvases/lounging-cat.canvas.js";
|
|
3
4
|
import tasks_canvas_default from "./canvases/tasks.canvas.js";
|
|
4
|
-
import player_canvas_default from "./canvases/player.canvas.js";
|
|
5
5
|
import { registerCanvasCatalog } from "./canvas-catalog.js";
|
|
6
6
|
import { registerCanvasTools } from "./canvas-tools.js";
|
|
7
7
|
import { registerCanvasCommands } from "./commands.js";
|
|
@@ -72,11 +72,11 @@ contributionRegistry.registerContribution(SYSTEM_CANVASES, {
|
|
|
72
72
|
source: tasks_canvas_default
|
|
73
73
|
});
|
|
74
74
|
contributionRegistry.registerContribution(SYSTEM_CANVASES, {
|
|
75
|
-
name: "
|
|
76
|
-
label: "
|
|
77
|
-
icon: "
|
|
78
|
-
settingsKey: "canvas.docks.demos.
|
|
79
|
-
source:
|
|
75
|
+
name: "lounging-cat",
|
|
76
|
+
label: "Lounging Cat",
|
|
77
|
+
icon: "cat",
|
|
78
|
+
settingsKey: "canvas.docks.demos.lounging-cat",
|
|
79
|
+
source: lounging_cat_canvas_default
|
|
80
80
|
});
|
|
81
81
|
registerCanvasCatalog();
|
|
82
82
|
registerCanvasCommands();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas-extension.js","names":["tasksSource","
|
|
1
|
+
{"version":3,"file":"canvas-extension.js","names":["tasksSource","loungingCatSource"],"sources":["../src/canvas-extension.ts"],"sourcesContent":["import {\n contributionRegistry,\n editorRegistry,\n File,\n subscribe,\n TOOLBAR_MAIN_RIGHT,\n TOPIC_CONTRIBUTEIONS_CHANGED,\n type EditorInput,\n type HTMLContribution,\n} from '@eclipse-docks/core';\nimport { html } from '@eclipse-docks/core/externals/lit';\nimport { SYSTEM_SKILLS, type SkillContribution } from '@eclipse-docks/extension-ai-system/api';\nimport { isCanvasContribution, SYSTEM_CANVASES } from './contribution';\nimport { listRegisteredCanvases } from './canvases';\nimport loungingCatSource from './canvases/lounging-cat.canvas.js?raw';\nimport tasksSource from './canvases/tasks.canvas.js?raw';\nimport { registerCanvasCatalog } from './canvas-catalog';\nimport { registerCanvasTools } from './canvas-tools';\nimport { registerCanvasCommands } from './commands';\nimport './canvas-switcher';\n\neditorRegistry.registerEditorInputHandler({\n editorId: 'system.canvas-editor',\n label: 'Canvas',\n icon: 'table-columns',\n ranking: 1100,\n canHandle: (input: unknown) => input instanceof File && input.getName().toLowerCase().endsWith('.canvas.js'),\n handle: async (input: File) => {\n const editorInput = {\n title: input.getName(),\n data: input,\n key: input.getWorkspacePath(),\n icon: 'table-columns',\n state: { mode: 'preview' },\n component: () => html``,\n } as EditorInput;\n editorInput.component = (id: string) => html`<docks-canvas-editor id=\"${id}\" .input=${editorInput}></docks-canvas-editor>`;\n return editorInput;\n },\n});\n\ncontributionRegistry.registerContribution(TOOLBAR_MAIN_RIGHT, {\n name: 'canvas.switcher',\n label: 'Canvases',\n component: () => html`<docks-canvas-switcher></docks-canvas-switcher>`,\n} as HTMLContribution);\n\nconst canvasSkills = [\n {\n name: 'eclipse-docks-canvas',\n label: 'Eclipse Docks canvas',\n load: () => import('./skills/eclipse-docks-canvas/SKILL.md?raw'),\n ranking: 100,\n },\n {\n name: 'eclipse-docks-lit',\n label: 'Eclipse Docks Lit',\n load: () => import('./skills/eclipse-docks-lit/SKILL.md?raw'),\n ranking: 90,\n },\n {\n name: 'eclipse-docks-webawesome',\n label: 'Eclipse Docks Web Awesome',\n load: () => import('./skills/eclipse-docks-webawesome/SKILL.md?raw'),\n ranking: 90,\n },\n {\n name: 'eclipse-docks-core',\n label: 'Eclipse Docks core',\n load: () => import('./skills/eclipse-docks-core/SKILL.md?raw'),\n ranking: 90,\n },\n] as const satisfies ReadonlyArray<SkillContribution>;\n\nfor (const skill of canvasSkills) {\n contributionRegistry.registerContribution(SYSTEM_SKILLS, skill);\n}\n\nfunction registerListedCanvasTools(): void {\n for (const canvas of listRegisteredCanvases()) registerCanvasTools(canvas);\n}\n\ncontributionRegistry.registerContribution(SYSTEM_CANVASES, {\n name: 'tasks',\n label: 'Tasks',\n icon: 'list-check',\n settingsKey: 'canvas.docks.demos.tasks',\n source: tasksSource,\n});\n\ncontributionRegistry.registerContribution(SYSTEM_CANVASES, {\n name: 'lounging-cat',\n label: 'Lounging Cat',\n icon: 'cat',\n settingsKey: 'canvas.docks.demos.lounging-cat',\n source: loungingCatSource,\n});\n\nregisterCanvasCatalog();\nregisterCanvasCommands();\nregisterListedCanvasTools();\nsubscribe(TOPIC_CONTRIBUTEIONS_CHANGED, (event: { target?: string }) => {\n if (event?.target !== SYSTEM_CANVASES) return;\n for (const contribution of contributionRegistry.getContributions(SYSTEM_CANVASES)) {\n if (isCanvasContribution(contribution)) registerCanvasTools(contribution);\n }\n});\n"],"mappings":";;;;;;;;;;;;AAqBA,eAAe,2BAA2B;CACtC,UAAU;CACV,OAAO;CACP,MAAM;CACN,SAAS;CACT,YAAY,UAAmB,iBAAiB,QAAQ,MAAM,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,YAAY;CAC3G,QAAQ,OAAO,UAAgB;EAC3B,MAAM,cAAc;GAChB,OAAO,MAAM,QAAQ;GACrB,MAAM;GACN,KAAK,MAAM,iBAAiB;GAC5B,MAAM;GACN,OAAO,EAAE,MAAM,UAAU;GACzB,iBAAiB,IAAI;EACzB;EACA,YAAY,aAAa,OAAe,IAAI,4BAA4B,GAAG,WAAW,YAAY;EAClG,OAAO;CACX;AACJ,CAAC;AAED,qBAAqB,qBAAqB,oBAAoB;CAC1D,MAAM;CACN,OAAO;CACP,iBAAiB,IAAI;AACzB,CAAqB;AAErB,IAAM,eAAe;CACjB;EACI,MAAM;EACN,OAAO;EACP,YAAY,OAAO;EACnB,SAAS;CACb;CACA;EACI,MAAM;EACN,OAAO;EACP,YAAY,OAAO;EACnB,SAAS;CACb;CACA;EACI,MAAM;EACN,OAAO;EACP,YAAY,OAAO;EACnB,SAAS;CACb;CACA;EACI,MAAM;EACN,OAAO;EACP,YAAY,OAAO;EACnB,SAAS;CACb;AACJ;AAEA,KAAK,MAAM,SAAS,cAChB,qBAAqB,qBAAqB,eAAe,KAAK;AAGlE,SAAS,4BAAkC;CACvC,KAAK,MAAM,UAAU,uBAAuB,GAAG,oBAAoB,MAAM;AAC7E;AAEA,qBAAqB,qBAAqB,iBAAiB;CACvD,MAAM;CACN,OAAO;CACP,MAAM;CACN,aAAa;CACb,QAAQA;AACZ,CAAC;AAED,qBAAqB,qBAAqB,iBAAiB;CACvD,MAAM;CACN,OAAO;CACP,MAAM;CACN,aAAa;CACb,QAAQC;AACZ,CAAC;AAED,sBAAsB;AACtB,uBAAuB;AACvB,0BAA0B;AAC1B,UAAU,+BAA+B,UAA+B;CACpE,IAAI,OAAO,WAAA,mBAA4B;CACvC,KAAK,MAAM,gBAAgB,qBAAqB,iBAAiB,eAAe,GAC5E,IAAI,qBAAqB,YAAY,GAAG,oBAAoB,YAAY;AAEhF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/canvases/lounging-cat.canvas.js?raw
|
|
2
|
+
var lounging_cat_canvas_default = "import { CanvasView, html, css } from \"docks/canvas\";\n\nexport default class LoungingCat extends CanvasView {\n static properties = {\n gazeX: { state: true },\n gazeY: { state: true },\n blinking: { state: true },\n };\n\n static styles = css`\n :host { display: block; min-height: 100%; color: #493b38; font-family: ui-rounded, \"Trebuchet MS\", system-ui, sans-serif; }\n * { box-sizing: border-box; }\n .scene { position: relative; display: grid; place-items: center; min-height: min(760px, 100vh); overflow: hidden; padding: clamp(1rem, 4vw, 3rem); background: radial-gradient(ellipse at 50% 42%, #fff8e9 0%, #f7e8d2 58%, #ead4bd 100%); user-select: none; }\n .sun { position: absolute; width: clamp(110px, 18vw, 190px); aspect-ratio: 1; top: 8%; right: 12%; border-radius: 50%; background: #f4d99b; opacity: .55; filter: blur(1px); }\n .plant { position: absolute; left: 7%; bottom: 18%; color: #8b9b70; font-size: clamp(3rem, 8vw, 6rem); opacity: .8; transform: rotate(-12deg); }\n .art { position: relative; z-index: 1; width: min(900px, 100%); filter: drop-shadow(0 22px 22px #765b4930); }\n svg { display: block; width: 100%; height: auto; overflow: visible; }\n .pupil { transition: transform 120ms ease-out; }\n .tail { transform-box: view-box; transform-origin: 270px 365px; animation: tail-sway 3.8s ease-in-out infinite; }\n @keyframes tail-sway { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-7deg); } }\n .eyelid { transform: scaleY(0); transform-origin: center 50%; transition: transform 90ms ease-in; }\n .blinking .eyelid { transform: scaleY(1); }\n .blinking .eye-white { transform: scaleY(.08); transform-origin: center; }\n .eye-white { transition: transform 90ms ease-in; }\n @media (max-width: 560px) { .scene { min-height: 100svh; padding: .5rem; } .plant { left: 1%; bottom: 20%; } }\n @media (prefers-reduced-motion: reduce) { .pupil, .eyelid, .eye-white { transition-duration: 0ms; } .tail { animation: none; } }\n `;\n\n constructor() {\n super();\n this.gazeX = 0;\n this.gazeY = 0;\n this.blinking = false;\n this._idleTimer = null;\n this._blinkTimer = null;\n this._blinkEndTimer = null;\n this._onDocumentPointerMove = (event) => this.handleDocumentPointerMove(event);\n }\n\n onConnect() {\n document.addEventListener(\"pointermove\", this._onDocumentPointerMove);\n this.scheduleBlink();\n }\n\n onDisconnect() {\n document.removeEventListener(\"pointermove\", this._onDocumentPointerMove);\n clearTimeout(this._idleTimer);\n clearTimeout(this._blinkTimer);\n clearTimeout(this._blinkEndTimer);\n }\n\n handleDocumentPointerMove(event) {\n this.gazeX = Math.max(-1, Math.min(1, (event.clientX / Math.max(window.innerWidth, 1) - 0.5) * 2));\n this.gazeY = Math.max(-1, Math.min(1, (event.clientY / Math.max(window.innerHeight, 1) - 0.5) * 2));\n clearTimeout(this._idleTimer);\n clearTimeout(this._blinkTimer);\n this._idleTimer = setTimeout(() => this.scheduleBlink(), 900);\n }\n\n scheduleBlink() {\n clearTimeout(this._blinkTimer);\n this._blinkTimer = setTimeout(() => this.blink(), 1800 + Math.random() * 3600);\n }\n\n blink() {\n this.blinking = true;\n clearTimeout(this._blinkEndTimer);\n this._blinkEndTimer = setTimeout(() => {\n this.blinking = false;\n this.scheduleBlink();\n }, 180);\n }\n\n pupilStyle(side) {\n const inward = side === \"left\" ? 1 : -1;\n return `transform: translate(${this.gazeX * 5 + inward * 3}px, ${this.gazeY * 4}px)`;\n }\n\n render() {\n return html`\n <main class=\"scene ${this.blinking ? \"blinking\" : \"\"}\" aria-label=\"A cat lounging on a couch. Its eyes follow your pointer across the page.\">\n <div class=\"sun\" aria-hidden=\"true\"></div><div class=\"plant\" aria-hidden=\"true\">❧</div>\n <div class=\"art\">\n <svg viewBox=\"0 0 900 590\" role=\"img\" aria-label=\"A sleepy ginger-and-cream cat sprawled on a soft green couch\">\n <defs>\n <linearGradient id=\"sofa\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0\" stop-color=\"#91a58a\"/><stop offset=\"1\" stop-color=\"#718873\"/></linearGradient>\n <linearGradient id=\"fur\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"><stop offset=\"0\" stop-color=\"#f4bd78\"/><stop offset=\"1\" stop-color=\"#df9255\"/></linearGradient>\n </defs>\n <path d=\"M112 330 Q112 292 151 292 H749 Q788 292 788 330 V470 H112Z\" fill=\"url(#sofa)\"/>\n <path d=\"M82 365 Q82 337 111 337 H789 Q818 337 818 365 V455 Q818 478 795 478 H105 Q82 478 82 455Z\" fill=\"#829982\"/>\n <path d=\"M105 455 H795 L770 520 H130Z\" fill=\"#657b6b\"/>\n <path d=\"M170 510 L160 550 M730 510 L740 550\" stroke=\"#806b58\" stroke-width=\"17\" stroke-linecap=\"round\"/>\n <path d=\"M130 365 Q130 350 150 350 M770 365 Q770 350 750 350\" fill=\"none\" stroke=\"#a8b49a\" stroke-width=\"5\" opacity=\".65\"/>\n <path d=\"M190 365 Q450 340 710 365 L690 445 Q450 465 210 445Z\" fill=\"#9bad91\" opacity=\".8\"/>\n <g class=\"tail\"><path d=\"M270 365 C190 330 170 390 220 410 C260 426 300 395 330 390\" fill=\"none\" stroke=\"#df985c\" stroke-width=\"34\" stroke-linecap=\"round\"/><path d=\"M205 374 Q218 382 230 389 M235 393 Q248 400 260 402\" fill=\"none\" stroke=\"#bd7547\" stroke-width=\"8\" stroke-linecap=\"round\"/></g>\n <ellipse cx=\"475\" cy=\"365\" rx=\"220\" ry=\"91\" fill=\"url(#fur)\" transform=\"rotate(-4 475 365)\"/>\n <path d=\"M330 310 Q350 340 330 370 M390 286 Q410 320 390 345 M570 286 Q550 320 570 345\" fill=\"none\" stroke=\"#c77d4b\" stroke-width=\"13\" stroke-linecap=\"round\" opacity=\".8\"/>\n <ellipse cx=\"500\" cy=\"405\" rx=\"145\" ry=\"43\" fill=\"#f5dfbd\" transform=\"rotate(-4 500 405)\"/>\n <ellipse cx=\"350\" cy=\"420\" rx=\"54\" ry=\"25\" fill=\"#f5dfbd\" transform=\"rotate(-8 350 420)\"/><path d=\"M330 420v12 M350 418v14 M370 416v12\" stroke=\"#d6b99a\" stroke-width=\"3\" stroke-linecap=\"round\"/>\n <ellipse cx=\"620\" cy=\"414\" rx=\"52\" ry=\"24\" fill=\"#f5dfbd\" transform=\"rotate(8 620 414)\"/><path d=\"M600 412v13 M620 414v13 M640 414v11\" stroke=\"#d6b99a\" stroke-width=\"3\" stroke-linecap=\"round\"/>\n <path d=\"M590 300 L600 220 Q604 205 620 218 L660 250 Q690 240 720 252 L758 218 Q773 207 778 226 L790 305 Q790 365 690 370 Q590 365 590 300Z\" fill=\"url(#fur)\"/>\n <path d=\"M610 245 L615 222 L642 250Z M735 250 L770 222 L773 250Z\" fill=\"#d98768\"/>\n <path d=\"M675 250 Q685 270 680 282 M700 248 Q710 268 705 281\" fill=\"none\" stroke=\"#c77d4b\" stroke-width=\"8\" stroke-linecap=\"round\"/>\n <g class=\"eye-white\"><ellipse cx=\"650\" cy=\"300\" rx=\"17\" ry=\"20\" fill=\"#fff8e9\"/><ellipse cx=\"730\" cy=\"300\" rx=\"17\" ry=\"20\" fill=\"#fff8e9\"/></g>\n <g class=\"pupil\" style=${this.pupilStyle(\"left\")}><ellipse cx=\"650\" cy=\"301\" rx=\"8\" ry=\"12\" fill=\"#4b4038\"/><circle cx=\"653\" cy=\"296\" r=\"3\" fill=\"white\"/></g>\n <g class=\"pupil\" style=${this.pupilStyle(\"right\")}><ellipse cx=\"730\" cy=\"301\" rx=\"8\" ry=\"12\" fill=\"#4b4038\"/><circle cx=\"733\" cy=\"296\" r=\"3\" fill=\"white\"/></g>\n <path class=\"eyelid\" d=\"M630 300 Q650 278 670 300 M710 300 Q730 278 750 300\" fill=\"none\" stroke=\"#b96f48\" stroke-width=\"7\" stroke-linecap=\"round\"/>\n <ellipse cx=\"690\" cy=\"326\" rx=\"28\" ry=\"19\" fill=\"#f5dfbd\"/><path d=\"M684 320 Q690 315 696 320 Q695 327 690 329 Q685 327 684 320Z\" fill=\"#bd7770\"/>\n <path d=\"M690 329 Q690 340 680 341 M690 329 Q690 340 700 341\" fill=\"none\" stroke=\"#76534a\" stroke-width=\"3\" stroke-linecap=\"round\"/>\n <path d=\"M665 328 L630 322 M665 335 L630 340 M715 328 L750 322 M715 335 L750 340\" stroke=\"#8d6b58\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n <path d=\"M570 365 Q600 390 650 380 Q670 376 670 395 Q665 414 625 414 Q580 414 550 390Z\" fill=\"#e9aa6d\"/><path d=\"M620 400v10 M640 397v10\" stroke=\"#c77d4b\" stroke-width=\"3\" stroke-linecap=\"round\"/>\n </svg>\n </div>\n </main>\n `;\n }\n}\n";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { lounging_cat_canvas_default as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=lounging-cat.canvas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lounging-cat.canvas.js","names":[],"sources":[],"mappings":""}
|
package/dist/host.js
CHANGED
|
@@ -28,7 +28,7 @@ async function createContributionHost(contribution) {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
function sidecarName(fileName) {
|
|
31
|
-
return fileName.replace(/\.canvas\.js$/i, ".canvas.
|
|
31
|
+
return fileName.replace(/\.canvas\.js$/i, ".canvas.json");
|
|
32
32
|
}
|
|
33
33
|
async function readSidecar(file) {
|
|
34
34
|
const parent = file.getParent();
|
package/dist/host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","names":[],"sources":["../src/host.ts"],"sourcesContent":["import { appSettings, editorRegistry, File, workspaceService } from '@eclipse-docks/core';\nimport type { CanvasContribution } from './contribution';\n\nexport interface CanvasHost {\n getState(key: string, fallback?: unknown): unknown;\n setState(key: string, value: unknown): void;\n openFile(path: string): void;\n}\n\nexport function createMemoryHost(initial: Record<string, unknown>, persist: (state: Record<string, unknown>) => void): CanvasHost {\n const state = { ...initial };\n return {\n getState(key, fallback) {\n return state[key] === undefined ? fallback : state[key];\n },\n setState(key, value) {\n state[key] = value;\n persist(state);\n },\n openFile(path) {\n void openWorkspaceFile(path);\n },\n };\n}\n\nexport async function createFileHost(file: File): Promise<CanvasHost> {\n const initial = await readSidecar(file);\n return createMemoryHost(initial, state => {\n void writeSidecar(file, state);\n });\n}\n\nexport async function createContributionHost(contribution: CanvasContribution): Promise<CanvasHost> {\n const key = contribution.settingsKey;\n const stored = await appSettings.get(key);\n const initial = stored && typeof stored === 'object' ? stored as Record<string, unknown> : {};\n return createMemoryHost(initial, state => {\n void appSettings.set(key, state);\n });\n}\n\nfunction sidecarName(fileName: string): string {\n return fileName.replace(/\\.canvas\\.js$/i, '.canvas.
|
|
1
|
+
{"version":3,"file":"host.js","names":[],"sources":["../src/host.ts"],"sourcesContent":["import { appSettings, editorRegistry, File, workspaceService } from '@eclipse-docks/core';\nimport type { CanvasContribution } from './contribution';\n\nexport interface CanvasHost {\n getState(key: string, fallback?: unknown): unknown;\n setState(key: string, value: unknown): void;\n openFile(path: string): void;\n}\n\nexport function createMemoryHost(initial: Record<string, unknown>, persist: (state: Record<string, unknown>) => void): CanvasHost {\n const state = { ...initial };\n return {\n getState(key, fallback) {\n return state[key] === undefined ? fallback : state[key];\n },\n setState(key, value) {\n state[key] = value;\n persist(state);\n },\n openFile(path) {\n void openWorkspaceFile(path);\n },\n };\n}\n\nexport async function createFileHost(file: File): Promise<CanvasHost> {\n const initial = await readSidecar(file);\n return createMemoryHost(initial, state => {\n void writeSidecar(file, state);\n });\n}\n\nexport async function createContributionHost(contribution: CanvasContribution): Promise<CanvasHost> {\n const key = contribution.settingsKey;\n const stored = await appSettings.get(key);\n const initial = stored && typeof stored === 'object' ? stored as Record<string, unknown> : {};\n return createMemoryHost(initial, state => {\n void appSettings.set(key, state);\n });\n}\n\nfunction sidecarName(fileName: string): string {\n return fileName.replace(/\\.canvas\\.js$/i, '.canvas.json');\n}\n\nasync function readSidecar(file: File): Promise<Record<string, unknown>> {\n const parent = file.getParent();\n if (!parent) return {};\n const resource = await parent.getResource(sidecarName(file.getName()));\n if (!(resource instanceof File)) return {};\n try {\n const parsed = JSON.parse(await resource.getContents());\n return parsed && typeof parsed === 'object' ? parsed as Record<string, unknown> : {};\n } catch {\n return {};\n }\n}\n\nasync function writeSidecar(file: File, state: Record<string, unknown>): Promise<void> {\n const parent = file.getParent();\n if (!parent) return;\n const name = sidecarName(file.getName());\n let resource = await parent.getResource(name);\n if (!(resource instanceof File)) {\n resource = await parent.getResource(name, { create: true }) as File | null;\n }\n if (!(resource instanceof File)) return;\n await resource.saveContents(JSON.stringify(state));\n}\n\nasync function openWorkspaceFile(path: string): Promise<void> {\n const workspace = workspaceService.getWorkspaceSync() ?? await workspaceService.getWorkspace();\n if (!workspace) return;\n const resource = await workspace.getResource(path.replace(/^\\/+/, ''));\n if (resource instanceof File) await editorRegistry.loadEditor(resource);\n}\n"],"mappings":";;AASA,SAAgB,iBAAiB,SAAkC,SAA+D;CAC9H,MAAM,QAAQ,EAAE,GAAG,QAAQ;CAC3B,OAAO;EACH,SAAS,KAAK,UAAU;GACpB,OAAO,MAAM,SAAS,KAAA,IAAY,WAAW,MAAM;EACvD;EACA,SAAS,KAAK,OAAO;GACjB,MAAM,OAAO;GACb,QAAQ,KAAK;EACjB;EACA,SAAS,MAAM;GACX,kBAAuB,IAAI;EAC/B;CACJ;AACJ;AAEA,eAAsB,eAAe,MAAiC;CAElE,OAAO,iBAAiB,MADF,YAAY,IAAI,IACL,UAAS;EACtC,aAAkB,MAAM,KAAK;CACjC,CAAC;AACL;AAEA,eAAsB,uBAAuB,cAAuD;CAChG,MAAM,MAAM,aAAa;CACzB,MAAM,SAAS,MAAM,YAAY,IAAI,GAAG;CAExC,OAAO,iBADS,UAAU,OAAO,WAAW,WAAW,SAAoC,CAAC,IAC3D,UAAS;EACtC,YAAiB,IAAI,KAAK,KAAK;CACnC,CAAC;AACL;AAEA,SAAS,YAAY,UAA0B;CAC3C,OAAO,SAAS,QAAQ,kBAAkB,cAAc;AAC5D;AAEA,eAAe,YAAY,MAA8C;CACrE,MAAM,SAAS,KAAK,UAAU;CAC9B,IAAI,CAAC,QAAQ,OAAO,CAAC;CACrB,MAAM,WAAW,MAAM,OAAO,YAAY,YAAY,KAAK,QAAQ,CAAC,CAAC;CACrE,IAAI,EAAE,oBAAoB,OAAO,OAAO,CAAC;CACzC,IAAI;EACA,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,YAAY,CAAC;EACtD,OAAO,UAAU,OAAO,WAAW,WAAW,SAAoC,CAAC;CACvF,QAAQ;EACJ,OAAO,CAAC;CACZ;AACJ;AAEA,eAAe,aAAa,MAAY,OAA+C;CACnF,MAAM,SAAS,KAAK,UAAU;CAC9B,IAAI,CAAC,QAAQ;CACb,MAAM,OAAO,YAAY,KAAK,QAAQ,CAAC;CACvC,IAAI,WAAW,MAAM,OAAO,YAAY,IAAI;CAC5C,IAAI,EAAE,oBAAoB,OACtB,WAAW,MAAM,OAAO,YAAY,MAAM,EAAE,QAAQ,KAAK,CAAC;CAE9D,IAAI,EAAE,oBAAoB,OAAO;CACjC,MAAM,SAAS,aAAa,KAAK,UAAU,KAAK,CAAC;AACrD;AAEA,eAAe,kBAAkB,MAA6B;CAC1D,MAAM,YAAY,iBAAiB,iBAAiB,KAAK,MAAM,iBAAiB,aAAa;CAC7F,IAAI,CAAC,WAAW;CAChB,MAAM,WAAW,MAAM,UAAU,YAAY,KAAK,QAAQ,QAAQ,EAAE,CAAC;CACrE,IAAI,oBAAoB,MAAM,MAAM,eAAe,WAAW,QAAQ;AAC1E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/skills/eclipse-docks-canvas/SKILL.md?raw
|
|
2
|
-
var SKILL_default = "---\nname: eclipse-docks-canvas\ndescription: >-\n Create or edit interactive Eclipse Docks canvases (.canvas.js): CanvasView UIs
|
|
2
|
+
var SKILL_default = "---\nname: eclipse-docks-canvas\ndescription: >-\n Create or edit interactive Eclipse Docks canvases (.canvas.js and the matching\n .canvas.md spec): CanvasView UIs, dashboards, todo apps, widgets, maps, and\n previewable tools. Use when the user wants an interactive view, canvas, widget,\n or .canvas.js file, or when a .canvas.md spec is open — even if they do not say\n \"canvas\".\n---\n\n# Eclipse Docks canvas\n\nWrite a workspace file ending in `.canvas.js`. Default-export a `CanvasView` subclass from `docks/canvas`. The host registers the tag.\n\n```js\nimport { CanvasView, html, css, nothing } from \"docks/canvas\";\n```\n\n`docks/canvas` exports `CanvasView`, the Lit module (`html`, `css`, `nothing`, `repeat`, and the rest), and the Web Awesome module (`registerIconLibrary`). `CanvasView` registers the Web Awesome elements. A canvas does not import `docks/lit` or `docks/webawesome`, and it does not extend `LitElement` or `HTMLElement`.\n\n## CanvasView\n\n| Call | Role |\n| --- | --- |\n| `this.getState(key, fallback)` | Read persisted state. Returns `fallback` when the key is missing. |\n| `this.setState(key, value)` | Write persisted state. Creates a sidecar `canvas.json` for this canvas. |\n| `this.openFile(path)` | Open a workspace path in the editor. |\n| `this.subscribe(topic, callback)` | Listen on the app event bus. The subscription ends when this canvas disconnects. |\n| `this.unsubscribe(token)` | End one subscription early. |\n| `this.publish(topic, data)` | Publish on the app event bus. |\n| `onConnect()` | The element is connected and the host is attached. Hydrate state here. |\n| `onDisconnect()` | The element is leaving the document. Release timers, streams, and object URLs. |\n\nThe host attaches after construction and before `onConnect`. From `constructor`, `getState` returns the fallback, and `setState` and `openFile` do nothing. Leave `connectedCallback` and `disconnectedCallback` on `CanvasView`. The subclass still owns `render`, `static properties`, and `static styles`.\n\nA canvas app consists of three files with the same stem: `….canvas.js`, `….canvas.json`, and `….canvas.md`. The `….canvas.md` file is the input that drives generation of the `….canvas.js` app. `setState` creates the `….canvas.json`. The canvas does not import either sidecar.\n\n```md\n# Requirements\n\nWhat the user asked for, in their words.\n\n# Spec\n\nBehavior, the data stored in canvas.json, and the UI.\n```\n\n## Hard rules\n\n1. Pure JavaScript only — no TypeScript, no decorators. Declare reactive fields with `static properties = { … }`. Initialize plain defaults in `constructor`; hydrate with `getState` in `onConnect`.\n2. Build controls and chrome with Web Awesome (`wa-button`, `wa-input`, `wa-checkbox`, `wa-card`, `wa-callout`, `wa-spinner`). A raw `<button>` or `<input>` is not a substitute. Load `eclipse-docks-webawesome` before a non-trivial UI, and use `--wa-color-*` tokens instead of hardcoded colors.\n3. Emit complete, valid JavaScript — no truncated objects or unfinished strings.\n4. The page uses `Cross-Origin-Embedder-Policy: require-corp`. A cross-origin response loads only when the request is CORS and the server sends `Access-Control-Allow-Origin`, or when the server sends `Cross-Origin-Resource-Policy: cross-origin`. An `<iframe srcdoc>` inherits this policy; `sandbox=\"allow-same-origin\"` does not exempt it.\n5. The `….canvas.md` file is the input that drives the `….canvas.js` app. When the request changes, update the markdown, then regenerate the module.\n\n## Code\n\nFollow clean code, DRY, SOLID, KISS, YAGNI, AHA, separation of concerns, fail fast, least astonishment, and the usual design patterns. Make the UI accessible and responsive. Format the file for a person to read: 2-space indentation, semicolons, double quotes, and templates and CSS broken across lines.\n\n## Minimal pattern\n\n```js\nimport { CanvasView, html, css } from \"docks/canvas\";\n\nexport default class extends CanvasView {\n static properties = {\n items: { state: true },\n draft: { state: true },\n };\n\n static styles = css`\n :host { display: block; padding: 1rem; box-sizing: border-box; }\n `;\n\n constructor() {\n super();\n this.items = [];\n this.draft = \"\";\n }\n\n onConnect() {\n const saved = this.getState(\"items\", null);\n if (Array.isArray(saved)) this.items = saved;\n }\n\n persist() {\n this.setState(\"items\", this.items);\n }\n\n addItem() {\n const input = this.renderRoot.querySelector(\"wa-input\");\n const text = String(input?.value ?? \"\").trim();\n if (!text) return;\n this.items = [...this.items, { id: crypto.randomUUID(), text, done: false }];\n this.draft = \"\";\n this.persist();\n }\n\n render() {\n return html`\n <wa-input\n placeholder=\"New item\"\n .value=${this.draft}\n @keydown=${(e) => { if (e.key === \"Enter\") this.addItem(); }}\n ></wa-input>\n <wa-button @click=${() => this.addItem()}>Add</wa-button>\n <ul>\n ${this.items.map((item) => html`<li>${item.text}</li>`)}\n </ul>\n `;\n }\n}\n```\n\n## Cross-origin resources\n\n`<img>`, `<link>`, and `<script>` tags without `crossorigin` are no-cors. A no-cors response that omits `Cross-Origin-Resource-Policy` fails with `not-set cross-origin-resource-policy`, even when it sends `Access-Control-Allow-Origin: *`. Moving that URL into an `<iframe srcdoc>` does not change the check. Subresources inside the frame follow the same rule.\n\nWhen the server only sends `Access-Control-Allow-Origin`, request the resource as CORS. `fetch()` already does. For an element, set `crossorigin=\"anonymous\"`. When a library creates the element, set its equivalent option (often `crossOrigin: \"anonymous\"`). A missing `Access-Control-Allow-Origin` header on that request is a CORS error, not the CORP error.\n\n```html\n<img crossorigin=\"anonymous\" src=\"https://cdn.example/asset.png\" />\n<script crossorigin=\"anonymous\" src=\"https://cdn.example/lib.js\"><\/script>\n```\n\nA host that sends neither header cannot be embedded in this page. Pass the string `\"anonymous\"` to a library option (`crossOrigin: \"anonymous\"`). A boolean `true` is not that option.\n\n## Styles inside the shadow root\n\nThe canvas renders in a shadow root. A `<link>` or `<style>` added to `document.head` does not apply to nodes inside that root. A widget that positions its own DOM with classes will load its images and still draw them in the wrong place until its stylesheet is on the shadow root.\n\nFetch the stylesheet as CORS and adopt it before constructing the widget:\n\n```js\nconst cssText = await (await fetch(stylesheetUrl, { mode: \"cors\" })).text();\nconst sheet = new CSSStyleSheet();\nsheet.replaceSync(cssText);\nthis.shadowRoot.adoptedStyleSheets = [...this.shadowRoot.adoptedStyleSheets, sheet];\n```\n\n`static styles` is for the host. Do not rely on a document-level stylesheet for DOM the library creates inside the shadow root.\n\n## Imports\n\n- `docks/canvas` — `CanvasView`, the Lit exports (`html`, `css`, `nothing`, `repeat`, `when`, `classMap`, and the rest), and the Web Awesome exports (`registerIconLibrary`). The elements are already registered.\n- `docks/core` — workspace files, dialogs, toasts, and commands. `openFile` does not need this import.\n- Relative imports → workspace files (compiler inlines them: JSON → value, text/CSS → string, binaries → data URL)\n\nBefore non-trivial UI or shell integration, load companion skills as needed:\n\n- `skills.load` `eclipse-docks-lit` — reactive properties, templates, directives (pure JS)\n- `skills.load` `eclipse-docks-webawesome` — `wa-*` components and layout utilities\n- `skills.load` `eclipse-docks-core` — workspace, editors, commands, dialogs, events\n\n## Workflow\n\n1. `workspace_write` the `<root>/….canvas.md` input (qualify with a root from `workspace_list`).\n2. `workspace_write` the `<root>/….canvas.js` app that this markdown drives, with the same stem in the same folder.\n3. `canvas.open` with that path — returns `ready` or the compile/runtime error.\n4. Before changing a canvas, `workspace_read` its `….canvas.md`. If the request changed, `workspace_write` that file, then `canvas.apply_source`. If that canvas is open in an editor, the editor marks itself dirty and recompiles the preview and does not save. If it is not open in an editor, the tool writes the file. Do not `workspace_write` a canvas that is already open.\n5. Optional: `canvas.capture_preview` to attach a screenshot (iframe contents may be blank).\n\nExtension-registered canvases live on `system.canvases` and open by name via `canvas.open`. That opens a read-only viewer. Do not edit it: `canvas.apply_source`, `canvas.get_source`, `canvas.set_state`, and any tools declared by that canvas are not available while it is active.\n";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { SKILL_default as default };
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/skills/eclipse-docks-core/SKILL.md?raw
|
|
2
|
-
var SKILL_default = "---\nname: eclipse-docks-core\ndescription: >-\n Eclipse Docks core runtime from docks/core: workspace files, editors, commands,\n contributions, dialogs, toasts, settings, and events. Use when a canvas or\n extension needs to open files, register UI, run commands, or talk to the shell.\n---\n\n# Eclipse Docks core (`docks/core`)\n\n```js\nimport {\n workspaceService,\n File,\n editorRegistry,\n commandRegistry,\n registerAll,\n contributionRegistry,\n publish,\n subscribe,\n unsubscribe,\n appSettings,\n toastInfo,\n toastError,\n confirmDialog,\n promptDialog,\n filebrowserDialog,\n} from \"docks/core\";\n```\n\nAlias: `@eclipse-docks/core`. `publish`, `subscribe`, and `unsubscribe` come from this module.\n\n## Workspace\n\n```js\nconst workspace = workspaceService.getWorkspaceSync() ?? await workspaceService.getWorkspace();\nconst resource = await workspace.getResource(\"folder/note.md\");\nif (resource instanceof File) {\n const text = await resource.getContents();\n await resource.saveContents(text);\n}\n```\n\n- Paths are workspace-relative (root-prefixed in the composite workspace).\n- Create with `getResource(path, { create: true })` when the API allows.\n- A canvas opens a path in the editor with `this.openFile(path)` and does not import core for that call. Reading or writing file bytes still uses `workspaceService` and `File`.\n\n## Editors\n\n```js\nawait editorRegistry.loadEditor(file); // default handler\nawait editorRegistry.loadEditor(file, \"system.canvas-editor\");\n```\n\n`EditorInput` objects carry `title`, `key`, `data`, `component`, optional `state`. Prefer opening a `File` when one exists.\n\n## Commands\n\n```js\nregisterAll({\n command: {\n id: \"demo.ping\",\n name: \"Ping\",\n description: \"Demo command\",\n parameters: [],\n },\n handler: {\n execute: async () => \"pong\",\n },\n});\n\nawait commandRegistry.execute(\"demo.ping\", {});\n```\n\nCommands registered this way can surface as AI tools when the cognitive runtime refreshes command tools.\n\n## Contributions\n\n```js\nimport { SIDEBAR_MAIN, TOOLBAR_MAIN_RIGHT } from \"docks/core\";\n\ncontributionRegistry.registerContribution(SIDEBAR_MAIN, {\n name: \"demo.view\",\n label: \"Demo\",\n icon: \"star\",\n component: (id) => /* Lit html template for the view */ null,\n});\n```\n\nCommon slots: sidebars, panel bottom, toolbars, settings. Canvas modules contributed by extensions use `system.canvases` (`SYSTEM_CANVASES` from `@eclipse-docks/extension-canvas/contribution`). Each contribution sets a unique `settingsKey` for the state behind `getState` / `setState`. `load()` returns `{ default: CustomElementConstructor }`, or `source` is the canvas module text and the preview compiles it. A contributed canvas is not editable and opens without a toolbar.\n\n## Dialogs & toasts\n\n```js\nconst ok = await confirmDialog(\"Replace file?\");\nconst name = await promptDialog(\"Name?\");\ntoastInfo(\"Saved\");\ntoastError(\"Failed\");\n```\n\n`filebrowserDialog` for folder/file picks; `formDialog` for multi-field forms. Prefer these over ad-hoc `window.prompt` in shell-integrated code.\n\n## Settings & events\n\n```js\nawait appSettings.set(\"demo.flag\", true);\nconst flag = await appSettings.get(\"demo.flag\");\n\nconst id = subscribe(\"topic.name\", (event) => { /* … */ });\npublish(\"topic.name\", { detail: 1 });\nunsubscribe(id);\n```\n\n## Logging\n\n```js\nimport { createLogger } from \"docks/core\";\nconst log = createLogger(\"demo\");\nlog.info(\"ready\");\n```\n\n## Canvas notes\n\n- A canvas
|
|
2
|
+
var SKILL_default = "---\nname: eclipse-docks-core\ndescription: >-\n Eclipse Docks core runtime from docks/core: workspace files, editors, commands,\n contributions, dialogs, toasts, settings, and events. Use when a canvas or\n extension needs to open files, register UI, run commands, or talk to the shell.\n---\n\n# Eclipse Docks core (`docks/core`)\n\n```js\nimport {\n workspaceService,\n File,\n editorRegistry,\n commandRegistry,\n registerAll,\n contributionRegistry,\n publish,\n subscribe,\n unsubscribe,\n appSettings,\n toastInfo,\n toastError,\n confirmDialog,\n promptDialog,\n filebrowserDialog,\n} from \"docks/core\";\n```\n\nAlias: `@eclipse-docks/core`. `publish`, `subscribe`, and `unsubscribe` come from this module.\n\n## Workspace\n\n```js\nconst workspace = workspaceService.getWorkspaceSync() ?? await workspaceService.getWorkspace();\nconst resource = await workspace.getResource(\"folder/note.md\");\nif (resource instanceof File) {\n const text = await resource.getContents();\n await resource.saveContents(text);\n}\n```\n\n- Paths are workspace-relative (root-prefixed in the composite workspace).\n- Create with `getResource(path, { create: true })` when the API allows.\n- A canvas opens a path in the editor with `this.openFile(path)` and does not import core for that call. Reading or writing file bytes still uses `workspaceService` and `File`.\n\n## Editors\n\n```js\nawait editorRegistry.loadEditor(file); // default handler\nawait editorRegistry.loadEditor(file, \"system.canvas-editor\");\n```\n\n`EditorInput` objects carry `title`, `key`, `data`, `component`, optional `state`. Prefer opening a `File` when one exists.\n\n## Commands\n\n```js\nregisterAll({\n command: {\n id: \"demo.ping\",\n name: \"Ping\",\n description: \"Demo command\",\n parameters: [],\n },\n handler: {\n execute: async () => \"pong\",\n },\n});\n\nawait commandRegistry.execute(\"demo.ping\", {});\n```\n\nCommands registered this way can surface as AI tools when the cognitive runtime refreshes command tools.\n\n## Contributions\n\n```js\nimport { SIDEBAR_MAIN, TOOLBAR_MAIN_RIGHT } from \"docks/core\";\n\ncontributionRegistry.registerContribution(SIDEBAR_MAIN, {\n name: \"demo.view\",\n label: \"Demo\",\n icon: \"star\",\n component: (id) => /* Lit html template for the view */ null,\n});\n```\n\nCommon slots: sidebars, panel bottom, toolbars, settings. Canvas modules contributed by extensions use `system.canvases` (`SYSTEM_CANVASES` from `@eclipse-docks/extension-canvas/contribution`). Each contribution sets a unique `settingsKey` for the state behind `getState` / `setState`. `load()` returns `{ default: CustomElementConstructor }`, or `source` is the canvas module text and the preview compiles it. A contributed canvas is not editable and opens without a toolbar.\n\n## Dialogs & toasts\n\n```js\nconst ok = await confirmDialog(\"Replace file?\");\nconst name = await promptDialog(\"Name?\");\ntoastInfo(\"Saved\");\ntoastError(\"Failed\");\n```\n\n`filebrowserDialog` for folder/file picks; `formDialog` for multi-field forms. Prefer these over ad-hoc `window.prompt` in shell-integrated code.\n\n## Settings & events\n\n```js\nawait appSettings.set(\"demo.flag\", true);\nconst flag = await appSettings.get(\"demo.flag\");\n\nconst id = subscribe(\"topic.name\", (event) => { /* … */ });\npublish(\"topic.name\", { detail: 1 });\nunsubscribe(id);\n```\n\n## Logging\n\n```js\nimport { createLogger } from \"docks/core\";\nconst log = createLogger(\"demo\");\nlog.info(\"ready\");\n```\n\n## Canvas notes\n\n- A canvas app consists of three files with the same stem: `….canvas.js`, `….canvas.json`, and `….canvas.md`. The `….canvas.md` file is the input that drives generation of the `….canvas.js` app. Persist with `this.getState` / `this.setState` inside `onConnect` and later. `setState` creates the `….canvas.json`. Use `appSettings` only to share app-wide settings. A contributed canvas stores that state under its `settingsKey` and has no `….canvas.md`.\n- `this.openFile(path)` opens a workspace path. Dialogs, toasts, and file contents stay on `docks/core`.\n- A canvas listens and publishes with `this.subscribe`, `this.unsubscribe`, and `this.publish`. It does not import those functions.\n- Cross-origin loads follow the canvas skill: CORS plus `Access-Control-Allow-Origin`, or `Cross-Origin-Resource-Policy: cross-origin`. An iframe `srcdoc` does not opt out.\n\n## Anti-patterns\n\n- Bare filenames at the composite workspace root when a durable root prefix is required\n- Calling `getState`, `setState`, or `openFile` before `onConnect`\n- Re-implementing toast/dialog with `alert` when core helpers are available\n";
|
|
3
3
|
//#endregion
|
|
4
4
|
export { SKILL_default as default };
|
|
5
5
|
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
//#region src/canvases/player.canvas.js?raw
|
|
2
|
-
var player_canvas_default = "import { CanvasView, html, css, nothing, repeat } from \"docks/canvas\";\nimport { Directory, File, filebrowserDialog, workspaceService } from \"docks/core\";\n\nconst AUDIO = new Set([\"mp3\", \"wav\", \"ogg\", \"oga\", \"flac\", \"m4a\", \"aac\", \"opus\", \"weba\"]);\nconst VIDEO = new Set([\"mp4\", \"webm\", \"ogv\", \"mov\", \"mkv\", \"m4v\"]);\nconst SOURCES = [\"youtube\", \"workspace\", \"link\"];\nconst PLACEHOLDER = {\n youtube: \"Search YouTube or paste a link\",\n workspace: \"Search file names\",\n link: \"https://…\",\n};\nconst MATCH_LIMIT = 24;\nconst DIRECTORY_LIMIT = 200;\n\nfunction extensionOf(name) {\n const base = String(name).split(\"?\")[0].split(\"#\")[0];\n const dot = base.lastIndexOf(\".\");\n return dot >= 0 ? base.slice(dot + 1).toLowerCase() : \"\";\n}\n\nfunction mediaOf(name) {\n const ext = extensionOf(name);\n if (AUDIO.has(ext)) return \"audio\";\n if (VIDEO.has(ext)) return \"video\";\n return null;\n}\n\nfunction fileTitle(path) {\n return decodeURIComponent(String(path).split(\"/\").filter(Boolean).pop() || path);\n}\n\nfunction youtubeId(url) {\n const host = url.hostname.replace(/^www\\./, \"\");\n if (host === \"youtu.be\") return url.pathname.split(\"/\").filter(Boolean)[0] || null;\n const youtubeHost = host === \"youtube.com\"\n || host === \"m.youtube.com\"\n || host === \"music.youtube.com\"\n || host === \"youtube-nocookie.com\";\n if (!youtubeHost) return null;\n if (url.pathname.startsWith(\"/embed/\") || url.pathname.startsWith(\"/shorts/\") || url.pathname.startsWith(\"/live/\")) {\n return url.pathname.split(\"/\")[2] || null;\n }\n return url.searchParams.get(\"v\");\n}\n\nfunction describeAddress(raw) {\n const url = new URL(raw);\n const youtube = youtubeId(url);\n if (youtube) {\n return {\n title: \"YouTube\",\n href: raw,\n source: \"youtube\",\n media: \"embed\",\n embed: `https://www.youtube-nocookie.com/embed/${encodeURIComponent(youtube)}`,\n };\n }\n return {\n title: fileTitle(url.pathname) || url.hostname,\n href: url.href,\n source: \"stream\",\n media: mediaOf(url.pathname) ?? \"video\",\n };\n}\n\nfunction sourceLabel(item) {\n if (item.source === \"youtube\") return \"YouTube\";\n if (item.source === \"file\") return item.media === \"audio\" ? \"Audio file\" : \"Video file\";\n return item.media === \"audio\" ? \"Audio\" : \"Video\";\n}\n\nfunction namedVideo(query, source) {\n const trimmed = query.trim();\n try {\n const described = describeAddress(trimmed);\n if (source !== \"link\" && described.source !== source) return null;\n return {\n title: described.title,\n href: described.href,\n source: described.source,\n media: described.media,\n direct: true,\n };\n } catch {\n return null;\n }\n}\n\nlet youtubeApis;\n\nasync function youtubeApiBases() {\n if (youtubeApis?.length) return youtubeApis;\n try {\n const response = await fetch(\"https://api.invidious.io/instances.json?sort_by=health\");\n if (!response.ok) throw new Error(\"status\");\n const rows = await response.json();\n const bases = rows\n .map(row => Array.isArray(row) ? row[1] : null)\n .filter(meta => meta?.type === \"https\" && meta.api && meta.cors !== false && meta.uri)\n .map(meta => String(meta.uri).replace(/\\/$/, \"\"))\n .slice(0, 4);\n if (bases.length) {\n youtubeApis = bases;\n return bases;\n }\n } catch {\n // The instance list is optional. A known API remains as a fallback.\n }\n youtubeApis = [\"https://yt.chocolatemoo53.com\"];\n return youtubeApis;\n}\n\nasync function searchYoutube(query) {\n const direct = namedVideo(query, \"youtube\");\n if (direct) return [direct];\n const bases = await youtubeApiBases();\n for (const base of bases) {\n try {\n const response = await fetch(`${base}/api/v1/search?q=${encodeURIComponent(query)}&type=video`);\n if (!response.ok) continue;\n const data = await response.json();\n if (!Array.isArray(data)) continue;\n return data.filter(item => item?.videoId).slice(0, 12).map(item => ({\n title: item.title || \"YouTube\",\n href: `https://www.youtube.com/watch?v=${item.videoId}`,\n source: \"youtube\",\n media: \"embed\",\n detail: item.author || \"\",\n }));\n } catch {\n continue;\n }\n }\n youtubeApis = null;\n throw new Error(\"YouTube search could not be reached.\");\n}\n\nasync function collectMedia(dir, query, matches, budget) {\n if (matches.length >= MATCH_LIMIT || budget.dirs > DIRECTORY_LIMIT) return;\n budget.dirs += 1;\n let children = [];\n try {\n children = await dir.listChildren(false);\n } catch {\n return;\n }\n for (const child of children) {\n if (matches.length >= MATCH_LIMIT) return;\n if (child instanceof File) {\n const name = child.getName();\n const media = mediaOf(name);\n const path = child.getWorkspacePath();\n if (!media || !path) continue;\n const haystack = `${name}\\n${path}`.toLowerCase();\n if (query && !haystack.includes(query)) continue;\n matches.push({ title: name, href: path, source: \"file\", media, detail: path });\n continue;\n }\n if (child instanceof Directory) await collectMedia(child, query, matches, budget);\n }\n}\n\nasync function searchWorkspace(query) {\n const workspace = workspaceService.getWorkspaceSync() ?? await workspaceService.getWorkspace();\n if (!workspace) throw new Error(\"No workspace is open.\");\n const matches = [];\n await collectMedia(workspace, query.toLowerCase(), matches, { dirs: 0 });\n return matches;\n}\n\nfunction searchLink(query) {\n const direct = namedVideo(query, \"link\");\n if (!direct) throw new Error(\"Enter a full link, starting with https://\");\n return [direct];\n}\n\nconst SEARCH = {\n youtube: searchYoutube,\n workspace: searchWorkspace,\n link: searchLink,\n};\n\nasync function objectUrlFor(path) {\n const workspace = workspaceService.getWorkspaceSync() ?? await workspaceService.getWorkspace();\n if (!workspace) throw new Error(\"No workspace is open.\");\n const resource = await workspace.getResource(path);\n if (!(resource instanceof File)) throw new Error(\"Cannot find that file.\");\n const contents = await resource.getContents({ blob: true });\n if (contents instanceof Blob) return URL.createObjectURL(contents);\n if (typeof contents === \"string\" && contents) return contents;\n throw new Error(\"This file cannot be played.\");\n}\n\nfunction messageOf(err) {\n return err instanceof Error ? err.message : String(err);\n}\n\nexport default class extends CanvasView {\n static properties = {\n queue: { state: true },\n currentId: { state: true },\n selection: { state: true },\n stage: { state: true },\n loading: { state: true },\n searching: { state: true },\n source: { state: true },\n results: { state: true },\n error: { state: true },\n };\n\n static styles = css`\n :host {\n display: block;\n min-height: 100%;\n box-sizing: border-box;\n padding: clamp(18px, 4vw, 48px);\n color: var(--wa-color-text-normal);\n background: var(--wa-color-surface-default);\n font-family: var(--wa-font-family-body, system-ui, sans-serif);\n }\n\n * {\n box-sizing: border-box;\n }\n\n .app {\n max-width: 1200px;\n margin: 0 auto;\n }\n\n .layout {\n display: grid;\n grid-template-columns: minmax(16rem, 1fr) minmax(0, 2fr);\n gap: 22px;\n margin-top: 22px;\n align-items: stretch;\n }\n\n .browser,\n .player {\n min-width: 0;\n }\n\n .player {\n display: flex;\n flex-direction: column;\n align-self: stretch;\n }\n\n .playlist {\n flex: 1;\n min-height: 8rem;\n display: flex;\n flex-direction: column;\n }\n\n .playlist .empty {\n flex: 1;\n display: grid;\n place-items: center;\n }\n\n .eyebrow {\n color: var(--wa-color-brand-600);\n text-transform: uppercase;\n letter-spacing: 0.12em;\n font-size: 11px;\n font-weight: 750;\n margin: 0 0 8px;\n }\n\n h1 {\n font-size: clamp(30px, 5vw, 44px);\n line-height: 1.05;\n letter-spacing: -0.04em;\n margin: 0;\n }\n\n .sub {\n color: var(--wa-color-text-quiet);\n margin: 9px 0 0;\n }\n\n .composer {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 10px;\n }\n\n wa-select.source,\n wa-input {\n width: 100%;\n }\n\n .list-title {\n margin: 18px 0 8px;\n font-size: 12px;\n font-weight: 750;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: var(--wa-color-text-quiet);\n }\n\n .stage {\n border: 1px solid var(--wa-color-neutral-200);\n border-radius: 16px;\n background: var(--wa-color-surface-raised);\n overflow: hidden;\n min-height: 180px;\n }\n\n .frame {\n position: relative;\n width: 100%;\n aspect-ratio: 16 / 9;\n background: #000;\n }\n\n iframe,\n video {\n width: 100%;\n height: 100%;\n border: 0;\n display: block;\n background: #000;\n }\n\n .audio {\n display: grid;\n gap: 12px;\n padding: 22px;\n }\n\n audio {\n width: 100%;\n }\n\n .now {\n font-weight: 700;\n }\n\n .empty,\n .loading {\n padding: 36px 18px;\n text-align: center;\n color: var(--wa-color-text-quiet);\n }\n\n .browser .empty {\n padding: 14px 12px;\n font-size: 13px;\n }\n\n .transport {\n display: flex;\n gap: 8px;\n align-items: center;\n margin-top: 12px;\n }\n\n .queue {\n display: grid;\n gap: 8px;\n overflow: auto;\n align-content: start;\n list-style: none;\n margin: 0;\n padding: 0;\n }\n\n .browser .queue {\n max-height: calc(100vh - 320px);\n }\n\n .playlist .queue {\n flex: 1;\n }\n\n .row {\n display: flex;\n align-items: center;\n gap: 12px;\n width: 100%;\n padding: 12px 14px;\n border: 1px solid var(--wa-color-neutral-200);\n background: var(--wa-color-surface-raised);\n border-radius: 13px;\n }\n\n .row.current {\n border-color: var(--wa-color-brand-600);\n }\n\n wa-button.play-item {\n flex: 1;\n min-width: 0;\n }\n\n wa-button.play-item::part(button) {\n height: auto;\n white-space: normal;\n justify-content: flex-start;\n text-align: left;\n }\n\n wa-button.play-item::part(label) {\n min-width: 0;\n }\n\n .title {\n display: block;\n font-weight: 650;\n white-space: normal;\n overflow-wrap: anywhere;\n text-align: left;\n }\n\n .meta {\n display: block;\n color: var(--wa-color-text-quiet);\n font-size: 12px;\n margin-top: 3px;\n text-align: left;\n }\n\n wa-callout {\n margin-bottom: 12px;\n }\n\n @media (max-width: 800px) {\n .layout {\n grid-template-columns: 1fr;\n }\n\n .player {\n order: -1;\n }\n }\n `;\n\n constructor() {\n super();\n this.queue = [];\n this.currentId = \"\";\n this.selection = null;\n this.stage = null;\n this.loading = false;\n this.searching = false;\n this.source = \"youtube\";\n this.results = [];\n this.error = \"\";\n this.blobUrl = \"\";\n this.ignoringMediaError = false;\n this.playGeneration = 0;\n this.searchGeneration = 0;\n }\n\n onConnect() {\n const saved = this.getState(\"queue\", null);\n if (Array.isArray(saved)) this.queue = saved.filter(item => item?.href && item?.id);\n const currentId = this.getState(\"currentId\", \"\");\n if (typeof currentId === \"string\" && this.queue.some(item => item.id === currentId)) {\n this.currentId = currentId;\n }\n const source = this.getState(\"source\", \"youtube\");\n if (SOURCES.includes(source)) this.source = source;\n }\n\n onDisconnect() {\n this.stopMedia();\n }\n\n persist() {\n this.setState(\"queue\", this.queue);\n this.setState(\"currentId\", this.currentId);\n this.setState(\"source\", this.source);\n }\n\n stopMedia() {\n this.ignoringMediaError = true;\n const media = this.renderRoot?.querySelector(\"audio, video\");\n if (media) {\n media.pause();\n media.removeAttribute(\"src\");\n media.load();\n }\n if (this.blobUrl) URL.revokeObjectURL(this.blobUrl);\n this.blobUrl = \"\";\n queueMicrotask(() => {\n this.ignoringMediaError = false;\n });\n }\n\n favorite() {\n if (!this.selection?.href) return;\n if (this.queue.some(item => item.href === this.selection.href)) return;\n const entry = {\n id: crypto.randomUUID(),\n title: this.selection.title,\n href: this.selection.href,\n source: this.selection.source,\n media: this.selection.media,\n };\n this.queue = [...this.queue, entry];\n this.currentId = entry.id;\n this.selection = entry;\n this.persist();\n }\n\n setSource(value) {\n if (!SOURCES.includes(value) || value === this.source) return;\n this.source = value;\n this.results = [];\n this.error = \"\";\n this.persist();\n }\n\n async search() {\n const input = this.renderRoot.querySelector(\"#query\");\n const query = String(input?.value ?? \"\").trim();\n if (!query) return;\n const search = SEARCH[this.source];\n if (!search) return;\n const generation = ++this.searchGeneration;\n this.searching = true;\n this.error = \"\";\n this.results = [];\n try {\n const results = await search(query);\n if (generation !== this.searchGeneration) return;\n if (results.length === 1 && results[0].direct) {\n void this.play(results[0]);\n return;\n }\n this.results = results;\n if (!results.length) this.error = \"No matches.\";\n } catch (err) {\n if (generation !== this.searchGeneration) return;\n this.error = messageOf(err);\n } finally {\n if (generation === this.searchGeneration) this.searching = false;\n }\n }\n\n async browseWorkspace() {\n const path = await filebrowserDialog(\"file\");\n if (!path) return;\n const media = mediaOf(path);\n if (!media) {\n this.error = \"Choose an audio or video file.\";\n return;\n }\n this.error = \"\";\n void this.play({ title: fileTitle(path), href: path, source: \"file\", media });\n }\n\n async play(item) {\n const generation = ++this.playGeneration;\n this.stopMedia();\n this.selection = {\n id: item.id || \"\",\n title: item.title,\n href: item.href,\n source: item.source,\n media: item.media,\n };\n this.currentId = this.queue.some(entry => entry.id && entry.id === item.id) ? item.id : \"\";\n this.error = \"\";\n this.stage = null;\n this.persist();\n if (item.media === \"embed\") {\n const described = describeAddress(item.href);\n if (!described.embed) {\n this.error = \"This address cannot be embedded.\";\n return;\n }\n this.stage = { kind: \"embed\", src: described.embed, title: item.title };\n return;\n }\n if (item.source === \"file\") {\n await this.playFile(item, generation);\n return;\n }\n this.stage = { kind: item.media, src: item.href, title: item.title, remote: true };\n await this.startMedia(item.media);\n }\n\n async playFile(item, generation) {\n this.loading = true;\n try {\n const url = await objectUrlFor(item.href);\n if (generation !== this.playGeneration) {\n if (url.startsWith(\"blob:\")) URL.revokeObjectURL(url);\n return;\n }\n if (url.startsWith(\"blob:\")) this.blobUrl = url;\n this.stage = { kind: item.media, src: url, title: item.title, remote: false };\n await this.startMedia(item.media);\n } catch (err) {\n if (generation !== this.playGeneration) return;\n this.stage = null;\n this.error = messageOf(err);\n } finally {\n if (generation === this.playGeneration) this.loading = false;\n }\n }\n\n async startMedia(kind) {\n await this.updateComplete;\n const el = this.renderRoot.querySelector(kind === \"audio\" ? \"audio\" : \"video\");\n if (!el) return;\n try {\n await el.play();\n } catch (err) {\n if (err?.name === \"AbortError\") return;\n this.error = \"Press play on the player to start.\";\n }\n }\n\n onMediaError(event) {\n if (this.ignoringMediaError || !event.target?.currentSrc) return;\n this.error = \"The player could not load this address. A remote file plays only when that server allows this page to read it.\";\n }\n\n playCurrent() {\n if (this.selection) {\n void this.play(this.selection);\n return;\n }\n const item = this.queue.find(entry => entry.id === this.currentId) ?? this.queue[0];\n if (item) void this.play(item);\n }\n\n step(offset) {\n const index = this.queue.findIndex(entry => entry.id === this.currentId);\n const next = this.queue[index + offset];\n if (!next) return;\n void this.play(next);\n }\n\n remove(id) {\n const removingCurrent = id === this.currentId;\n this.queue = this.queue.filter(item => item.id !== id);\n if (removingCurrent) {\n this.stopMedia();\n this.currentId = \"\";\n this.stage = null;\n if (this.selection?.id === id) this.selection = null;\n }\n this.persist();\n }\n\n renderStage() {\n if (this.loading) return html`<div class=\"loading\" role=\"status\"><wa-spinner></wa-spinner></div>`;\n if (!this.stage) {\n return html`<div class=\"empty\">Choose a source, then search. Fav adds the playing item to the playlist.</div>`;\n }\n if (this.stage.kind === \"embed\") {\n return html`\n <div class=\"frame\">\n <iframe\n credentialless\n title=${this.stage.title}\n src=${this.stage.src}\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n allowfullscreen\n ></iframe>\n </div>\n `;\n }\n if (this.stage.kind === \"audio\") {\n return html`\n <div class=\"audio\">\n <div class=\"now\">${this.stage.title}</div>\n <audio\n controls\n src=${this.stage.src}\n crossorigin=${this.stage.remote ? \"anonymous\" : nothing}\n @error=${(event) => this.onMediaError(event)}\n @ended=${() => this.step(1)}\n ></audio>\n </div>\n `;\n }\n return html`\n <div class=\"frame\">\n <video\n controls\n playsinline\n src=${this.stage.src}\n crossorigin=${this.stage.remote ? \"anonymous\" : nothing}\n @error=${(event) => this.onMediaError(event)}\n @ended=${() => this.step(1)}\n ></video>\n </div>\n `;\n }\n\n renderItems(items, keyOf, isCurrent, trailing) {\n return html`\n <ul class=\"queue\">\n ${repeat(items, keyOf, (item) => html`\n <li class=\"row ${isCurrent(item) ? \"current\" : \"\"}\" aria-current=${isCurrent(item) ? \"true\" : nothing}>\n <wa-button class=\"play-item\" appearance=\"plain\" @click=${() => this.play(item)}>\n <span class=\"title\">${item.title}</span>\n <span class=\"meta\">${item.detail || sourceLabel(item)}</span>\n </wa-button>\n ${trailing ? trailing(item) : nothing}\n </li>\n `)}\n </ul>\n `;\n }\n\n renderBrowser() {\n return html`\n <aside class=\"browser\">\n <div class=\"composer\">\n <wa-select\n class=\"source\"\n label=\"Source\"\n .value=${this.source}\n @change=${(event) => this.setSource(event.currentTarget.value)}\n >\n <wa-option value=\"youtube\">YouTube</wa-option>\n <wa-option value=\"workspace\">Workspace</wa-option>\n <wa-option value=\"link\">Link</wa-option>\n </wa-select>\n <wa-input\n id=\"query\"\n label=\"Search\"\n placeholder=${PLACEHOLDER[this.source]}\n @keydown=${(event) => { if (event.key === \"Enter\") void this.search(); }}\n ></wa-input>\n <wa-button variant=\"brand\" ?loading=${this.searching} @click=${() => this.search()}>Search</wa-button>\n ${this.source === \"workspace\"\n ? html`<wa-button appearance=\"outlined\" @click=${() => this.browseWorkspace()}>Browse</wa-button>`\n : nothing}\n </div>\n ${this.error ? html`<wa-callout variant=\"warning\" role=\"alert\">${this.error}</wa-callout>` : nothing}\n <h2 class=\"list-title\">Results</h2>\n ${this.results.length\n ? this.renderItems(\n this.results,\n (item) => item.href,\n (item) => this.selection?.href === item.href,\n )\n : html`<div class=\"empty\">Search results appear here.</div>`}\n </aside>\n `;\n }\n\n renderTransport(index) {\n const queued = this.selection && this.queue.some(item => item.href === this.selection.href);\n return html`\n <div class=\"transport\">\n <wa-button size=\"small\" appearance=\"plain\" aria-label=\"Previous\" ?disabled=${index <= 0} @click=${() => this.step(-1)}>\n <wa-icon name=\"backward-step\" label=\"Previous\"></wa-icon>\n </wa-button>\n <wa-button size=\"small\" appearance=\"plain\" aria-label=\"Play\" ?disabled=${!this.selection && !this.queue.length} @click=${() => this.playCurrent()}>\n <wa-icon name=\"play\" label=\"Play\"></wa-icon>\n </wa-button>\n <wa-button size=\"small\" appearance=\"plain\" aria-label=\"Next\" ?disabled=${index < 0 || index >= this.queue.length - 1} @click=${() => this.step(1)}>\n <wa-icon name=\"forward-step\" label=\"Next\"></wa-icon>\n </wa-button>\n <wa-button size=\"small\" appearance=\"plain\" aria-label=\"Add to playlist\" ?disabled=${!this.selection || queued} @click=${() => this.favorite()}>\n <wa-icon name=\"heart\" label=\"Add to playlist\"></wa-icon>\n </wa-button>\n </div>\n `;\n }\n\n renderPlaylist() {\n if (!this.queue.length) return html`<div class=\"empty\">The playlist is empty.</div>`;\n return this.renderItems(\n this.queue,\n (item) => item.id,\n (item) => item.id === this.currentId,\n (item) => html`\n <wa-button\n appearance=\"plain\"\n variant=\"danger\"\n size=\"small\"\n aria-label=${`Remove ${item.title}`}\n @click=${() => this.remove(item.id)}\n >Remove</wa-button>\n `,\n );\n }\n\n render() {\n const index = this.queue.findIndex(item => item.id === this.currentId);\n return html`\n <main class=\"app\">\n <header>\n <p class=\"eyebrow\">Player</p>\n <h1>Watch and listen.</h1>\n <p class=\"sub\">Search YouTube, paste a link, or find an audio or video file in the workspace.</p>\n </header>\n <div class=\"layout\">\n ${this.renderBrowser()}\n <section class=\"player\" aria-label=\"Player\">\n <section class=\"stage\">${this.renderStage()}</section>\n ${this.renderTransport(index)}\n <h2 class=\"list-title\">Playlist</h2>\n <div class=\"playlist\">${this.renderPlaylist()}</div>\n </section>\n </div>\n </main>\n `;\n }\n}\n";
|
|
3
|
-
//#endregion
|
|
4
|
-
export { player_canvas_default as default };
|
|
5
|
-
|
|
6
|
-
//# sourceMappingURL=player.canvas.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"player.canvas.js","names":[],"sources":[],"mappings":""}
|