wicked-crew 0.10.2 → 0.12.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/api/capture.d.ts +2 -2
- package/dist/api/delivery-assurance.d.ts +1 -6
- package/dist/api/delivery-assurance.d.ts.map +1 -1
- package/dist/api/delivery-assurance.js +4 -14
- package/dist/api/delivery-assurance.js.map +1 -1
- package/dist/api/governance-steering.d.ts +2 -2
- package/dist/api/mcp.d.ts +4 -4
- package/dist/api/recording.d.ts +29 -3
- package/dist/api/recording.d.ts.map +1 -1
- package/dist/api/recording.js +188 -0
- package/dist/api/recording.js.map +1 -1
- package/dist/api/roster-standing.d.ts +6 -2
- package/dist/api/roster-standing.d.ts.map +1 -1
- package/dist/api/roster-standing.js +62 -13
- package/dist/api/roster-standing.js.map +1 -1
- package/dist/api/routes.d.ts +115 -112
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +227 -6
- package/dist/api/routes.js.map +1 -1
- package/dist/api/seat-container-login.d.ts +60 -0
- package/dist/api/seat-container-login.d.ts.map +1 -0
- package/dist/api/seat-container-login.js +158 -0
- package/dist/api/seat-container-login.js.map +1 -0
- package/dist/api/seat-probe.d.ts +7 -0
- package/dist/api/seat-probe.d.ts.map +1 -1
- package/dist/api/seat-probe.js +27 -5
- package/dist/api/seat-probe.js.map +1 -1
- package/dist/api/seat-version.d.ts +8 -0
- package/dist/api/seat-version.d.ts.map +1 -1
- package/dist/api/seat-version.js +36 -4
- package/dist/api/seat-version.js.map +1 -1
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +4 -0
- package/dist/api/server.js.map +1 -1
- package/dist/api/testing.d.ts +4 -4
- package/dist/appearance/video-palette.d.ts +14 -0
- package/dist/appearance/video-palette.d.ts.map +1 -0
- package/dist/appearance/video-palette.js +75 -0
- package/dist/appearance/video-palette.js.map +1 -0
- package/dist/campaigns/routes.d.ts +2 -2
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +20 -0
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/builtin-catalog.d.ts.map +1 -1
- package/dist/core/builtin-catalog.js +6 -1
- package/dist/core/builtin-catalog.js.map +1 -1
- package/dist/core/engine-roster.d.ts.map +1 -1
- package/dist/core/engine-roster.js +1 -0
- package/dist/core/engine-roster.js.map +1 -1
- package/dist/core/qe-acceptance-setting.d.ts +65 -0
- package/dist/core/qe-acceptance-setting.d.ts.map +1 -0
- package/dist/core/qe-acceptance-setting.js +93 -0
- package/dist/core/qe-acceptance-setting.js.map +1 -0
- package/dist/core/run-identity.d.ts.map +1 -1
- package/dist/core/run-identity.js +3 -2
- package/dist/core/run-identity.js.map +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +3 -0
- package/dist/core/types.js.map +1 -1
- package/dist/editors/pack-install.d.ts +36 -3
- package/dist/editors/pack-install.d.ts.map +1 -1
- package/dist/editors/pack-install.js +71 -6
- package/dist/editors/pack-install.js.map +1 -1
- package/dist/editors/registry.d.ts +153 -14
- package/dist/editors/registry.d.ts.map +1 -1
- package/dist/editors/registry.js +29 -4
- package/dist/editors/registry.js.map +1 -1
- package/dist/editors/surfaces.d.ts +48 -0
- package/dist/editors/surfaces.d.ts.map +1 -0
- package/dist/editors/surfaces.js +294 -0
- package/dist/editors/surfaces.js.map +1 -0
- package/dist/events/terminals.d.ts +42 -2
- package/dist/events/terminals.d.ts.map +1 -1
- package/dist/events/terminals.js +136 -3
- package/dist/events/terminals.js.map +1 -1
- package/dist/interactive/chat-events.d.ts +4 -3
- package/dist/interactive/chat-events.d.ts.map +1 -1
- package/dist/interactive/chat-events.js +7 -6
- package/dist/interactive/chat-events.js.map +1 -1
- package/dist/interactive/doc-grounding.d.ts.map +1 -1
- package/dist/interactive/doc-grounding.js +7 -1
- package/dist/interactive/doc-grounding.js.map +1 -1
- package/dist/interactive/draft-skill.d.ts +11 -4
- package/dist/interactive/draft-skill.d.ts.map +1 -1
- package/dist/interactive/draft-skill.js +42 -9
- package/dist/interactive/draft-skill.js.map +1 -1
- package/dist/projects/state-home-registry.d.ts.map +1 -1
- package/dist/projects/state-home-registry.js +2 -0
- package/dist/projects/state-home-registry.js.map +1 -1
- package/dist/studio/assets/index-1Ucvzihb.js +770 -0
- package/dist/studio/assets/index-B0u_f6HD.css +32 -0
- package/dist/studio/editors/wicked-deck/editor.json +88 -0
- package/dist/studio/editors/wicked-deck/index.html +230 -0
- package/dist/studio/editors/wicked-doc/editor.json +91 -0
- package/dist/studio/editors/wicked-doc/index.html +161 -0
- package/dist/studio/editors/wicked-page/editor.json +42 -4
- package/dist/studio/editors/wicked-page/index.html +25 -8
- package/dist/studio/editors/wicked-video/editor.json +271 -0
- package/dist/studio/editors/wicked-video/index.html +28 -0
- package/dist/studio/index.html +2 -2
- package/dist/studio/testid-inventory.json +3844 -1364
- package/dist/team/routes.d.ts +2 -2
- package/endpoint-manifest.json +56 -1
- package/package.json +3 -3
- package/dist/studio/assets/index-C6DLorst.css +0 -32
- package/dist/studio/assets/index-CAhuFWeA.js +0 -609
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "wicked-deck",
|
|
3
|
+
"title": "Slides",
|
|
4
|
+
"version": "0.9.0",
|
|
5
|
+
"protocol": [
|
|
6
|
+
1,
|
|
7
|
+
2
|
|
8
|
+
],
|
|
9
|
+
"kinds": [
|
|
10
|
+
"deck"
|
|
11
|
+
],
|
|
12
|
+
"entry": "index.html",
|
|
13
|
+
"sizes": [
|
|
14
|
+
"inline",
|
|
15
|
+
"pane",
|
|
16
|
+
"full"
|
|
17
|
+
],
|
|
18
|
+
"permissions": [
|
|
19
|
+
{
|
|
20
|
+
"id": "artifact.read",
|
|
21
|
+
"why": "to show the slides and read their words and speaker notes"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "artifact.write",
|
|
25
|
+
"why": "to add, duplicate, move or delete a slide, change its words or its notes, each as one version with Undo"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "selection.chip",
|
|
29
|
+
"why": "to make the slide or the line you click the subject of your next message"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "ui.fullscreen",
|
|
33
|
+
"why": "to present the deck full screen"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "artifact.export",
|
|
37
|
+
"why": "to offer the deck as PowerPoint or PDF from its card (the host makes the file)"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "artifact.theme",
|
|
41
|
+
"why": "to change the deck’s theme, colours and fonts from its Style tab, as one version with Undo"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"surfaces": {
|
|
45
|
+
"card": {
|
|
46
|
+
"interactive": true,
|
|
47
|
+
"aspect": "16:9",
|
|
48
|
+
"actions": [
|
|
49
|
+
{
|
|
50
|
+
"id": "prev",
|
|
51
|
+
"label": "Previous slide",
|
|
52
|
+
"verb": "plugin"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"id": "next",
|
|
56
|
+
"label": "Next slide",
|
|
57
|
+
"verb": "plugin",
|
|
58
|
+
"primary": true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "ask",
|
|
62
|
+
"label": "Ask about this",
|
|
63
|
+
"verb": "host:ask"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "export",
|
|
67
|
+
"label": "Export",
|
|
68
|
+
"verb": "host:export"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"options": {
|
|
73
|
+
"tabs": [
|
|
74
|
+
{
|
|
75
|
+
"id": "style",
|
|
76
|
+
"label": "Style",
|
|
77
|
+
"render": "plugin"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "notes",
|
|
81
|
+
"label": "Speaker notes",
|
|
82
|
+
"render": "plugin"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"full": {}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="wicked-editor" content="wicked-deck">
|
|
6
|
+
<meta name="wicked-editor-version" content="0.9.0">
|
|
7
|
+
<title>Slides</title>
|
|
8
|
+
<style>
|
|
9
|
+
/* The editor's own chrome takes the host's tokens (`host.hello.theme` / `host.theme`), with plain
|
|
10
|
+
fallbacks for a host that passes none. The DECK inside the nested frames styles itself. */
|
|
11
|
+
:root {
|
|
12
|
+
--surface-base: #ffffff; --surface-card: #f6f7f9; --surface-raised: #ffffff; --ink-high: #0d1117; --ink-body: #2b333d;
|
|
13
|
+
--ink-muted: #5b6673; --border: #d5dae1; --accent: #224a5e; --status-fail: #b4232c;
|
|
14
|
+
--font-sans: system-ui, sans-serif;
|
|
15
|
+
}
|
|
16
|
+
html, body { height: 100%; margin: 0; }
|
|
17
|
+
body { font: 13px var(--font-sans); color: var(--ink-high); background: var(--surface-base); overflow: hidden; }
|
|
18
|
+
[hidden] { display: none !important; }
|
|
19
|
+
.deck { position: relative; display: grid; grid-template-columns: 196px minmax(0, 1fr); width: 100%; height: 100%; outline: none; }
|
|
20
|
+
.deck:focus { box-shadow: inset 0 0 0 2px var(--accent); }
|
|
21
|
+
body[data-size="inline"] .deck, body[data-present="true"] .deck { grid-template-columns: minmax(0, 1fr); }
|
|
22
|
+
body[data-size="inline"]:not([data-protocol="2"]) .deck { pointer-events: none; }
|
|
23
|
+
body[data-size="inline"] .strip, body[data-size="inline"] .tools, body[data-size="inline"] .notes,
|
|
24
|
+
body[data-present="true"] .strip, body[data-present="true"] .tools, body[data-present="true"] .notes { display: none; }
|
|
25
|
+
|
|
26
|
+
/* The filmstrip: the deck's slides in document order. */
|
|
27
|
+
.strip { overflow-y: auto; overflow-x: hidden; padding: 12px 8px 24px; border-right: 1px solid var(--border); background: var(--surface-card); }
|
|
28
|
+
.strip ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
|
|
29
|
+
.thumb { display: grid; grid-template-columns: 16px 128px; gap: 6px; box-sizing: border-box; align-items: start; width: 100%; padding: 4px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink-body); font: inherit; text-align: left; cursor: pointer; }
|
|
30
|
+
.thumb:hover { background: var(--surface-base); }
|
|
31
|
+
.thumb[aria-current="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface-card)); }
|
|
32
|
+
.thumb[aria-current="true"] .t { color: var(--ink-high); }
|
|
33
|
+
.thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
|
34
|
+
.thumb[data-drop="before"] { box-shadow: 0 -3px 0 var(--accent); }
|
|
35
|
+
.thumb[data-drop="after"] { box-shadow: 0 3px 0 var(--accent); }
|
|
36
|
+
.thumb .n { font-size: 11px; color: var(--ink-muted); text-align: right; padding-top: 2px; }
|
|
37
|
+
.thumb .mini { position: relative; display: block; width: 128px; height: 72px; overflow: hidden; border: 1px solid var(--border); border-radius: 3px; background: var(--surface-base); }
|
|
38
|
+
.thumb .mini iframe { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; border: 0; transform: scale(0.1); transform-origin: 0 0; pointer-events: none; }
|
|
39
|
+
.thumb .t { grid-column: 2; display: block; font-size: 11px; line-height: 1.3; color: var(--ink-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 128px; }
|
|
40
|
+
|
|
41
|
+
.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
|
|
42
|
+
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--surface-card); }
|
|
43
|
+
.tools .count { margin-right: auto; font-size: 12px; color: var(--ink-muted); }
|
|
44
|
+
.tools button, .menu button, .notes button { font: inherit; font-size: 12px; line-height: 20px; padding: 1px 9px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-base); color: var(--ink-high); cursor: pointer; }
|
|
45
|
+
.tools button:disabled { opacity: .45; cursor: default; }
|
|
46
|
+
.tools button:focus-visible, .menu button:focus-visible, .notes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
|
47
|
+
.tools .danger { color: var(--status-fail); }
|
|
48
|
+
.menu { position: absolute; z-index: 4; top: 36px; left: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 220px; max-height: 60%; overflow-y: auto; padding: 6px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.14); }
|
|
49
|
+
.menu .word { font-size: 11px; color: var(--ink-muted); padding: 2px 4px 4px; }
|
|
50
|
+
.menu button { text-align: left; border-color: transparent; }
|
|
51
|
+
|
|
52
|
+
.stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: var(--surface-card); }
|
|
53
|
+
.slide-box { position: absolute; overflow: hidden; }
|
|
54
|
+
.stage[data-zoom="100"] { overflow: auto; }
|
|
55
|
+
.stage iframe { position: absolute; left: 0; top: 0; border: 0; background: var(--surface-base); transform-origin: 0 0; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
|
|
56
|
+
body[data-present="true"] .stage { background: #111; }
|
|
57
|
+
.zoom { display: flex; }
|
|
58
|
+
.zoom button[aria-pressed="true"] { border-color: var(--accent); background: var(--surface-raised); }
|
|
59
|
+
.cutoff { position: absolute; z-index: 3; pointer-events: none; color: var(--ink-high); }
|
|
60
|
+
.cutoff[data-edge="bottom"] { border-top: 1px dashed var(--accent); }
|
|
61
|
+
.cutoff[data-edge="right"] { border-left: 1px dashed var(--accent); }
|
|
62
|
+
.cutoff span { position: absolute; font-size: 10px; white-space: nowrap; padding: 2px 5px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface-raised); }
|
|
63
|
+
.cutoff[data-edge="bottom"] span { bottom: 3px; left: 8px; }
|
|
64
|
+
.cutoff[data-edge="right"] span { right: 3px; top: 8px; }
|
|
65
|
+
body[data-surface="options"][data-protocol="2"] .deck { grid-template-columns: minmax(0, 1fr); }
|
|
66
|
+
#style-panel { overflow: auto; height: 100%; }
|
|
67
|
+
body[data-surface="options"][data-protocol="2"] .notes { flex: 1; align-content: start; border-top: 0; }
|
|
68
|
+
body[data-surface="options"][data-protocol="2"] .notes textarea { min-height: 180px; max-height: none; }
|
|
69
|
+
.box { position: absolute; pointer-events: none; border: 2px solid var(--accent); border-radius: 3px; box-sizing: border-box; z-index: 2; }
|
|
70
|
+
.box--hover { border-style: dashed; opacity: .55; }
|
|
71
|
+
.input { position: absolute; z-index: 3; box-sizing: border-box; font: inherit; font-size: 14px; line-height: 1.35; padding: 4px 6px; border: 2px solid var(--accent); border-radius: 3px; background: var(--surface-base); color: var(--ink-high); outline: none; resize: none; overflow: auto; }
|
|
72
|
+
.handle { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; }
|
|
73
|
+
.hint, .note { margin: 0; padding: 4px 10px; font-size: 12px; color: var(--ink-muted); }
|
|
74
|
+
.note { color: var(--status-fail); }
|
|
75
|
+
.badge { position: absolute; right: 10px; bottom: 10px; z-index: 2; padding: 2px 8px; font-size: 12px; color: var(--ink-body); background: var(--surface-base); border: 1px solid var(--border); border-radius: 10px; }
|
|
76
|
+
.present-bar { position: absolute; right: 12px; bottom: 12px; z-index: 3; padding: 3px 10px; font-size: 12px; color: #eee; background: rgba(0,0,0,.55); border-radius: 10px; }
|
|
77
|
+
|
|
78
|
+
.notes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px 10px 10px; border-top: 1px solid var(--border); background: var(--surface-base); }
|
|
79
|
+
.notes label { font-size: 11px; color: var(--ink-muted); }
|
|
80
|
+
.notes textarea { box-sizing: border-box; width: 100%; min-height: 54px; max-height: 120px; resize: vertical; font: inherit; font-size: 13px; line-height: 1.4; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-base); color: var(--ink-high); }
|
|
81
|
+
.notes textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
|
|
82
|
+
body[data-size="pane"] .notes textarea { min-height: 40px; }
|
|
83
|
+
@media (prefers-reduced-motion: no-preference) { .box { transition: left 80ms linear, top 80ms linear; } }
|
|
84
|
+
</style>
|
|
85
|
+
</head>
|
|
86
|
+
<body data-size="pane">
|
|
87
|
+
<script>var wickedEditor=(function(X){"use strict";var Fn=Object.defineProperty;var Kn=(X,Z,Se)=>Z in X?Fn(X,Z,{enumerable:!0,configurable:!0,writable:!0,value:Se}):X[Z]=Se;var _t=(X,Z,Se)=>Kn(X,typeof Z!="symbol"?Z+"":Z,Se);const qt={card:{interactive:!0,aspect:"16:9",actions:[{id:"prev",label:"Previous slide",verb:"plugin"},{id:"next",label:"Next slide",verb:"plugin",primary:!0},{id:"ask",label:"Ask about this",verb:"host:ask"},{id:"export",label:"Export",verb:"host:export"}]},options:{tabs:[{id:"style",label:"Style",render:"plugin"},{id:"notes",label:"Speaker notes",render:"plugin"}]},full:{}},Nt={"Alt+J":{verb:"navigate",what:"next card or row"},"Alt+K":{verb:"navigate",what:"previous card or row"},"Alt+/":{verb:"navigate",what:"the keyboard shortcuts overlay"},"Alt+P":{verb:"navigate",what:"peek at the top item that needs you"},"Alt+G":{verb:"navigate",what:"jump to the top item that needs you"},"Alt+B":{verb:"navigate",what:"back to where you were"},"Alt+T":{verb:"navigate",what:"the run’s evidence timeline"},"Alt+U":{verb:"navigate",what:"the run’s unit list"},"Alt+A":{verb:"approve",what:"approve the open gate"},"Alt+R":{verb:"decide",what:"reject the open gate"},"Alt+X":{verb:"decide",what:"select a gate for batch resolution"},"Alt+N":{verb:"compose",what:"compose a steer note"}},Pt=new Set(["Escape","Mod+K","Tab","Shift+Tab"]);function ct(o){if(Pt.has(o))return!0;const r=Nt[Rt(o)];return r!==void 0&&r.verb==="navigate"}function Rt(o){const r=/^alt\+(.)$/i.exec(o);return r===null?o:`Alt+${r[1].toUpperCase()}`}const $e="wicked.editor",Ce=1,ut=o=>typeof o=="object"&&o!==null&&!Array.isArray(o),It=["card","options","full"];function jt(o){return o==="inline"?"card":o==="pane"?"options":"full"}function ft(o){return o==="card"?"inline":o==="options"?"pane":"full"}function Xt(o){const r=ut(o)?o:{},i=r.size==="inline"||r.size==="full"?r.size:"pane",d=r.protocol===2?2:1,c=d===2&&typeof r.tab=="string"?r.tab:null,u=d===2&&It.includes(r.surface)?r.surface:jt(i),h=u==="options"&&c===null?"full":u,m=d===2&&(r.mode==="simple"||r.mode==="advanced")?r.mode:null;return{protocol:d,surface:h,tab:c,mode:m,size:i}}function Yt(o,r,i){return{editor:o,version:r,protocol:[1,2],surfaces:i}}function Ht(o,r){const i=document.querySelector('meta[name="wicked-editor-version"]')?.getAttribute("content")??"0.0.0";parent.postMessage({p:$e,v:Ce,type:"plugin.ready",payload:Yt(o,i,r)},"*")}function pt(o,r,i){const d=o.metaKey||o.ctrlKey;let c=null;if(o.key==="Escape")c="Escape";else if(d&&!o.altKey&&o.key.toLowerCase()==="k")c="Mod+K";else if(o.altKey&&!d&&/^Key[A-Z]$/.test(o.code)&&ct(`Alt+${o.code.slice(3)}`))c=`Alt+${o.code.slice(3)}`;else if(o.key==="Tab"){const u=Array.from(r.querySelectorAll("button, input, select, textarea, [tabindex]")).filter(m=>m.tabIndex>=0&&!m.matches(":disabled")&&m.closest("[hidden]")===null),h=u.indexOf(o.target);(o.shiftKey?h<=0:h===-1||h===u.length-1)&&(c=o.shiftKey?"Shift+Tab":"Tab")}return c===null?!1:(o.preventDefault(),o.stopPropagation(),i(c),!0)}class Wt{constructor(r,i){_t(this,"revs",new Map);this.port=r,this.h=i}reply(r,i){this.port.postMessage({p:$e,v:Ce,re:r,ok:!0,payload:i})}refuse(r,i,d){this.port.postMessage({p:$e,v:Ce,re:r,ok:!1,error:{code:i,message:d}})}bump(r){const i=(this.revs.get(r)??0)+1;return this.revs.set(r,i),i}values(r,i){this.port.postMessage({p:$e,v:Ce,type:"options.values",payload:{tab:r,rev:this.bump(r),values:i}})}height(r){this.port.postMessage({p:$e,v:Ce,type:"ui.height",payload:{px:Math.round(r)}})}dispatch(r){const i=ut(r.payload)?r.payload:{},d=typeof r.id=="string"?r.id:null;switch(r.type){case"host.surface":{const c=i.surface;return(c==="card"||c==="options"||c==="full")&&this.h.surface?.(c,i.mode==="simple"||i.mode==="advanced"?i.mode:null),!0}case"host.mode":{if(d===null)return!0;const c=i.mode;return c!=="simple"&&c!=="advanced"?(this.refuse(d,"bad_request","mode is simple or advanced"),!0):(this.reply(d,{mode:this.h.mode?.(c)??c}),!0)}case"host.action":{if(d===null)return!0;const c=i.id;return typeof c!="string"||this.h.action===void 0?(this.reply(d,{handled:!1}),!0):(Promise.resolve(this.h.action(c)).then(u=>this.reply(d,{handled:u.handled===!0,...typeof u.status=="string"?{status:u.status.slice(0,120)}:{}}),()=>this.reply(d,{handled:!1})),!0)}case"host.tab":return typeof i.tab=="string"&&this.h.tab?.(i.tab),!0;case"host.selection":return Array.isArray(i.anchors)&&this.h.selection?.(i.anchors),!0;case"options.changed":{if(d===null)return!0;const c=i.tab,u=i.id;return typeof c!="string"||typeof u!="string"||this.h.optionsChanged===void 0?(this.refuse(d,"unsupported","no controls here"),!0):(Promise.resolve(this.h.optionsChanged(c,u,i.value)).then(h=>this.reply(d,{applied:h.applied,rev:this.bump(c),values:h.values,...h.reason!==void 0?{reason:h.reason.slice(0,120)}:{}}),h=>this.refuse(d,"unavailable",h instanceof Error?h.message.slice(0,120):"failed")),!0)}default:return!1}}}const Oe=[{name:"corporate-light",display_name:"Corporate Light",colors:{background:"#FFFFFF",surface:"#F8FAFC",primary:"#1E3A5F",secondary:"#2563EB",accent:"#0891B2",text_primary:"#1E293B",text_secondary:"#64748B",text_muted:"#94A3B8",border:"#E2E8F0"},fonts:{heading:"Calibri",body:"Calibri",mono:"Consolas"}},{name:"midnight-purple",display_name:"Midnight Purple",colors:{background:"#0A0A0F",surface:"#13091D",primary:"#A100FF",secondary:"#6B2FA0",accent:"#F59E0B",text_primary:"#FFFFFF",text_secondary:"#A0A0B0",text_muted:"#6B6B80",border:"#2A2A3D"},fonts:{heading:"Calibri",body:"Calibri",mono:"Consolas"}},{name:"warm-dark",display_name:"Warm Dark",colors:{background:"#1A1A2E",surface:"#16213E",primary:"#FF6B6B",secondary:"#C44569",accent:"#FFD93D",text_primary:"#F8F8F2",text_secondary:"#B0B0C0",text_muted:"#6B6B80",border:"#2D2D44"},fonts:{heading:"Calibri",body:"Calibri",mono:"Consolas"}}],ht=["Inter","Roboto","Source Sans 3","IBM Plex Sans","Calibri","Georgia","system-ui"],Ut=[["background","Background"],["surface","Surface"],["primary","Primary"],["accent","Accent"],["text_primary","Text"]],Be=o=>({name:o.name,colors:{...o.colors},fonts:{...o.fonts}});function Gt(o,r){o.replaceChildren(),o.classList.add("plugin-style"),o.onkeydown=b=>{r.key!==void 0&&pt(b,o,r.key)};const i=document.createElement("style");i.textContent=`.plugin-style{padding:16px;box-sizing:border-box;color:var(--ink-high);background:var(--surface-base);font:13px var(--font-sans,system-ui)}
|
|
88
|
+
.plugin-style h2{font-size:16px;margin:0 0 12px}.plugin-style .theme-cards{display:grid;gap:8px;margin-bottom:18px}
|
|
89
|
+
.plugin-style button,.plugin-style input,.plugin-style select{font:inherit;color:var(--ink-high);background:var(--surface-card);border:1px solid var(--border);border-radius:4px}
|
|
90
|
+
.plugin-style button{padding:8px;text-align:left;cursor:pointer}.plugin-style button:focus-visible,.plugin-style input:focus-visible,.plugin-style select:focus-visible{outline:2px solid var(--accent)}
|
|
91
|
+
.plugin-style .ps-swatches{display:flex;width:100%;height:16px;margin-bottom:6px;border:1px solid var(--border)}.plugin-style .ps-swatches span{flex:1}
|
|
92
|
+
.plugin-style label{display:flex;align-items:center;gap:8px;margin:10px 0}.plugin-style label>span:first-child{flex:1}.plugin-style input[type=color]{width:36px;height:30px;padding:2px}.plugin-style input[type=text]{width:80px;padding:5px}.plugin-style select{max-width:170px;padding:5px}
|
|
93
|
+
.plugin-style p{line-height:1.5;color:var(--ink-body)}.plugin-style [role=status]{min-height:1.5em}.plugin-style :disabled{opacity:.6;cursor:default}`,o.append(i);const d=document.createElement("h2");d.textContent="Style",o.append(d);const c=document.createElement("div");c.className="theme-cards",o.append(c);const u=document.createElement("p");u.setAttribute("role","status"),u.setAttribute("aria-live","polite");let h=!1;const m=[],F=()=>Be(r.tokens()??Oe[0]),U=[],K=[],te=()=>{const b=F();for(const{key:p,picker:C,hex:L}of U)L.value=b.colors[p],C.value=/^#[0-9a-f]{6}$/i.test(b.colors[p])?b.colors[p]:"";for(const{key:p,select:C}of K)C.value=ht.includes(b.fonts[p])?b.fonts[p]:"system-ui";for(const p of Array.from(c.querySelectorAll("button")))p.setAttribute("aria-pressed",String(p.dataset.theme===b.name))},G=async b=>{if(!h){h=!0,m.forEach(p=>{p.disabled=!0}),u.textContent="Applying theme…";try{const p=await r.apply(b);u.textContent=p.ok?"Theme applied.":`Theme was not applied: ${p.reason}`}catch(p){u.textContent=`Theme was not applied: ${p instanceof Error?p.message:"unavailable"}`}finally{h=!1,m.forEach(p=>{p.disabled=!1}),te()}}};for(const b of Oe){const p=document.createElement("button");p.type="button",p.dataset.theme=b.name;const C=document.createElement("span");C.className="ps-swatches",C.setAttribute("aria-hidden","true");for(const S of["background","surface","primary","secondary","accent"]){const M=document.createElement("span");M.style.backgroundColor=b.colors[S],C.append(M)}const L=document.createElement("span");L.textContent=b.display_name,p.append(C,L),p.addEventListener("click",()=>{G(Be(b))}),c.append(p),m.push(p)}for(const[b,p]of Ut){const C=document.createElement("label"),L=document.createElement("span");L.textContent=p;const S=document.createElement("input");S.type="color",S.setAttribute("aria-label",p);const M=document.createElement("input");M.type="text",M.maxLength=7,M.setAttribute("aria-label",`${p} hex`);const Me=ve=>{if(!/^#[0-9a-f]{6}$/i.test(ve)){u.textContent="Enter a six-digit hex colour: a # and six digits or letters a to f.",te();return}const ae=F();ae.name="custom",ae.colors[b]=ve,G(ae)};S.addEventListener("change",()=>Me(S.value)),M.addEventListener("change",()=>Me(M.value)),C.append(L,S,M),o.append(C),m.push(S,M),U.push({key:b,picker:S,hex:M})}for(const b of["heading","body"]){const p=document.createElement("label"),C=document.createElement("span");C.textContent=b==="heading"?"Heading font":"Body font";const L=document.createElement("select");L.setAttribute("aria-label",C.textContent);for(const S of ht){const M=document.createElement("option");M.value=S,M.textContent=S,L.append(M)}L.addEventListener("change",()=>{const S=F();S.name="custom",S.fonts[b]=L.value,G(S)}),p.append(C,L),o.append(p),m.push(L),K.push({key:b,select:L})}const Y=document.createElement("p");return Y.textContent="Match a website or a PDF: the host's Match button under this tab",o.append(Y,u),te(),{refresh:te}}function Jt(o){const r=new DOMParser().parseFromString(o,"text/html"),i=Array.from(r.querySelectorAll("style")).map(m=>m.textContent??"").join(`
|
|
94
|
+
`),d=new Map;for(const m of i.matchAll(/(--wi-[a-z-]+)\s*:\s*([^;}{]+)/gi))d.set(m[1].toLowerCase(),m[2].trim());if(d.size===0)return null;const c=Be(Oe[0]),u={background:"--wi-bg",surface:"--wi-surface",primary:"--wi-primary",secondary:"--wi-secondary",accent:"--wi-accent",text_primary:"--wi-text",text_secondary:"--wi-text-secondary",text_muted:"--wi-muted",border:"--wi-border"};for(const m of Object.keys(u)){const F=d.get(u[m]);F!==void 0&&/^(#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})|(?:rgb|hsl)a?\([0-9.,%\s]+\))$/i.test(F)&&(c.colors[m]=F)}for(const m of["heading","body","mono"]){const F=d.get(`--wi-font-${m}`);F!==void 0&&(c.fonts[m]=F.split(",")[0].trim().replace(/^['"]|['"]$/g,""))}const h=Oe.find(m=>JSON.stringify(m.colors)===JSON.stringify(c.colors)&&JSON.stringify(m.fonts)===JSON.stringify(c.fonts));return c.name=h?.name??"custom",c}const je="section, [data-slide], .slide",Vt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]),Fe="aside[data-notes-for]",yt=80,mt=o=>{const r=o.tagName.toLowerCase();return!Vt.has(r)&&!(r==="aside"&&o.hasAttribute("data-notes-for"))};function vt(o){return Array.from(o.querySelectorAll(je)).filter(r=>{if(!mt(r)||r.closest(Fe)!==null)return!1;for(let i=r.parentElement;i!==null;i=i.parentElement)if(i.matches(je)&&mt(i))return!1;return!0})}const Xe=o=>o.replace(/\s+/g," ").trim(),Zt=o=>o.length>yt?`${o.slice(0,yt-1).trimEnd()}…`:o;function Qt(o){const r=Array.from(o.querySelectorAll(Fe)).find(i=>i.parentElement?.closest(je)===o);return r===void 0?"":(r.textContent??"").trim()}function en(o){const r=o.cloneNode(!0);for(const i of Array.from(r.querySelectorAll(Fe)))i.remove();for(const i of Array.from(r.querySelectorAll("h1,h2,h3,h4,h5,h6,p,li,td,th,div,section,figcaption,blockquote,br")))i.append(" ");return Xe(r.textContent??"")}function tn(o){const r=new DOMParser().parseFromString(o,"text/html");return vt(r).map((i,d)=>{const c=Array.from(i.querySelectorAll("h1,h2,h3,h4,h5,h6")).find(h=>h.closest(Fe)===null&&Xe(h.textContent??"")!==""),u=en(i);return{id:i.getAttribute("data-slide-id"),wid:i.getAttribute("data-wid"),n:d+1,title:Zt(c!==void 0?Xe(c.textContent??""):u),notes:Qt(i),text:u}})}function nn(o,r,i){return{left:o.left-(i.scrollX-r.scrollX),top:o.top-(i.scrollY-r.scrollY),width:o.width,height:o.height}}const on=/^[A-Za-z0-9_.:-]{1,100}$/;function _(o){return typeof o=="number"&&isFinite(o)}function rn(o){if(typeof o!="object"||o===null)return!1;const r=o;return r.section!==void 0&&(typeof r.section!="string"||!on.test(r.section))?!1:typeof r.text=="string"&&typeof r.composite=="boolean"}function sn(o){if(typeof o!="object"||o===null)return!1;const r=o;return _(r.x)&&_(r.y)&&_(r.width)&&_(r.height)&&_(r.top)&&_(r.left)&&_(r.right)&&_(r.bottom)}function ln(o){if(typeof o!="object"||o===null)return null;const r=o;if(r.v!==1)return null;const i=r.type;if(i==="wid-inventory"){const d=r.widMap,c=r.scrollX,u=r.scrollY;if(typeof d!="object"||d===null||!_(c)||!_(u))return null;const h={};for(const[U,K]of Object.entries(d)){if(!sn(K))return null;h[U]=K}const m=r.blocks;if(m===void 0)return{v:1,type:"wid-inventory",widMap:h,scrollX:c,scrollY:u};if(typeof m!="object"||m===null)return null;const F={};for(const[U,K]of Object.entries(m)){if(!rn(K))return null;F[U]={text:K.text,composite:K.composite,...K.cut===!0?{cut:!0}:{},...K.section!==void 0?{section:K.section}:{}}}return{v:1,type:"wid-inventory",widMap:h,scrollX:c,scrollY:u,blocks:F}}if(i==="scroll-state"){const d=r.scrollX,c=r.scrollY;return!_(d)||!_(c)?null:{v:1,type:"scroll-state",scrollX:d,scrollY:c}}if(i==="scroll-ack"){const d=r.wid;if(typeof d!="string"||d==="")return null;const c=r.scrollX,u=r.scrollY,h=r.seq;return{v:1,type:"scroll-ack",wid:d,..._(c)&&_(u)?{scrollX:c,scrollY:u}:{},...typeof h=="number"&&Number.isInteger(h)&&h>0?{seq:h}:{}}}if(i==="wid-click"){const d=r.wid;return typeof d!="string"||d===""?null:{v:1,type:"wid-click",wid:d}}if(i==="wid-hover"){const d=r.wid;return d!==null&&(typeof d!="string"||d==="")?null:{v:1,type:"wid-hover",wid:d}}return null}const an=Object.freeze({v:1,type:"request-inventory"}),dn="request-inventory";function cn(o){return o.includes(dn)}const un=`
|
|
95
|
+
(function () {
|
|
96
|
+
if (window.__wickedInstrumentBridge) return;
|
|
97
|
+
window.__wickedInstrumentBridge = 1;
|
|
98
|
+
function nearest(node) {
|
|
99
|
+
var el = node;
|
|
100
|
+
while (el) {
|
|
101
|
+
if (el.getAttribute && el.getAttribute('data-wid')) return el;
|
|
102
|
+
el = el.parentElement;
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
function inventory() {
|
|
107
|
+
var widMap = {};
|
|
108
|
+
var blocks = {};
|
|
109
|
+
var nodes = document.querySelectorAll('[data-wid]');
|
|
110
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
111
|
+
var el = nodes[i];
|
|
112
|
+
var wid = el.getAttribute('data-wid');
|
|
113
|
+
var r = el.getBoundingClientRect();
|
|
114
|
+
widMap[wid] = { x: r.x, y: r.y, width: r.width, height: r.height,
|
|
115
|
+
top: r.top, left: r.left, right: r.right, bottom: r.bottom };
|
|
116
|
+
var text = (el.textContent || '').replace(/\\s+/g, ' ').trim();
|
|
117
|
+
var composite = el.querySelector('[data-wid]') !== null;
|
|
118
|
+
var cap = composite ? 400 : 20000;
|
|
119
|
+
blocks[wid] = { text: text.length > cap ? text.slice(0, cap) : text, composite: composite };
|
|
120
|
+
if (text.length > cap) blocks[wid].cut = true;
|
|
121
|
+
var sec = el.parentElement ? el.parentElement.closest('section[data-wid], [data-wid^="section-"]') : null;
|
|
122
|
+
var secWid = sec ? sec.getAttribute('data-wid') : null;
|
|
123
|
+
// Only an id the parent's parser accepts: an odd one would invalidate the whole inventory.
|
|
124
|
+
if (secWid && /^[A-Za-z0-9_.:-]{1,100}$/.test(secWid)) blocks[wid].section = secWid;
|
|
125
|
+
}
|
|
126
|
+
return { v: 1, type: 'wid-inventory', widMap: widMap, blocks: blocks,
|
|
127
|
+
scrollX: window.scrollX, scrollY: window.scrollY };
|
|
128
|
+
}
|
|
129
|
+
function post(msg) { parent.postMessage(msg, '*'); }
|
|
130
|
+
window.addEventListener('message', function (e) {
|
|
131
|
+
var m = e.data;
|
|
132
|
+
if (!m || m.v !== 1) return;
|
|
133
|
+
if (m.type === 'request-inventory') {
|
|
134
|
+
post(inventory());
|
|
135
|
+
} else if (m.type === 'scroll-to-wid' && typeof m.wid === 'string') {
|
|
136
|
+
var el = document.querySelector('[data-wid="' + m.wid.replace(/["\\\\]/g, '') + '"]');
|
|
137
|
+
// An instant jump, whatever the document's own scroll-behavior: the position read on the
|
|
138
|
+
// next line is then where it landed.
|
|
139
|
+
if (el && el.scrollIntoView) el.scrollIntoView({ block: 'center', behavior: 'instant' });
|
|
140
|
+
post({ v: 1, type: 'scroll-ack', wid: m.wid, seq: m.seq, scrollX: window.scrollX, scrollY: window.scrollY });
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
document.addEventListener('scroll', function (e) {
|
|
144
|
+
if (e.target === document || e.target === document.documentElement || e.target === document.body) {
|
|
145
|
+
post({ v: 1, type: 'scroll-state', scrollX: window.scrollX, scrollY: window.scrollY });
|
|
146
|
+
} else {
|
|
147
|
+
post(inventory());
|
|
148
|
+
}
|
|
149
|
+
}, { passive: true, capture: true });
|
|
150
|
+
window.addEventListener('resize', function () { post(inventory()); });
|
|
151
|
+
document.addEventListener('click', function (e) {
|
|
152
|
+
var el = nearest(e.target);
|
|
153
|
+
if (!el) return;
|
|
154
|
+
e.preventDefault();
|
|
155
|
+
post({ v: 1, type: 'wid-click', wid: el.getAttribute('data-wid') });
|
|
156
|
+
});
|
|
157
|
+
var lastHover = null;
|
|
158
|
+
document.addEventListener('mousemove', function (e) {
|
|
159
|
+
var el = nearest(e.target);
|
|
160
|
+
var wid = el ? el.getAttribute('data-wid') : null;
|
|
161
|
+
if (wid !== lastHover) {
|
|
162
|
+
lastHover = wid;
|
|
163
|
+
post({ v: 1, type: 'wid-hover', wid: wid });
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
if (document.readyState === 'loading') {
|
|
167
|
+
document.addEventListener('DOMContentLoaded', function () { post(inventory()); });
|
|
168
|
+
} else {
|
|
169
|
+
post(inventory());
|
|
170
|
+
}
|
|
171
|
+
})();
|
|
172
|
+
`;function fn(o){const r=`<script>${un}<\/script>`;return/<\/body>/i.test(o)?o.replace(/<\/body>/i,()=>`${r}</body>`):`${o}${r}`}const Le="wicked.editor",Ke=1,pn="wicked-deck",Q=1280,ee=720,hn=[0,250,750,1500],yn=1500,mn=`
|
|
173
|
+
<div data-testid="deck-editor" id="deck" class="deck" data-kind="deck" data-head="" data-current="" data-count="0" data-size="pane" data-present="false" data-selected="" tabindex="0" role="application" aria-label="The deck">
|
|
174
|
+
<nav id="strip" class="strip" aria-label="Slides" data-testid="deck-strip"><ol id="thumbs"></ol></nav>
|
|
175
|
+
<div class="main">
|
|
176
|
+
<div data-testid="deck-tools" id="tools" class="tools" role="toolbar" aria-label="Slide actions">
|
|
177
|
+
<span id="count" class="count" data-testid="deck-count"></span>
|
|
178
|
+
<button type="button" id="add" data-testid="deck-add" aria-haspopup="menu" aria-expanded="false" title="Add a slide laid out like one of the deck’s own (⌘⇧N: like this one)">Add ▾</button>
|
|
179
|
+
<button type="button" id="dup" data-testid="deck-duplicate" title="Duplicate this slide (⌘D)">Duplicate</button>
|
|
180
|
+
<button type="button" id="up" data-testid="deck-move-up" title="Move this slide up (⌥↑)" aria-label="Move up">↑ Up</button>
|
|
181
|
+
<button type="button" id="down" data-testid="deck-move-down" title="Move this slide down (⌥↓)" aria-label="Move down">↓ Down</button>
|
|
182
|
+
<button type="button" id="del" class="danger" data-testid="deck-delete" title="Delete this slide (⌘⌫) — Undo puts it back">Delete</button>
|
|
183
|
+
<div class="zoom" role="group" aria-label="Slide zoom">
|
|
184
|
+
<button type="button" id="fit" data-testid="deck-fit" aria-pressed="true">Fit</button>
|
|
185
|
+
<button type="button" id="zoom-100" data-testid="deck-zoom-100" aria-pressed="false">100%</button>
|
|
186
|
+
</div>
|
|
187
|
+
<button type="button" id="fullscreen" data-testid="deck-fullscreen">Full screen</button>
|
|
188
|
+
<button type="button" id="notes-toggle" data-testid="deck-notes-toggle" aria-pressed="false" title="Show the speaker notes under the slide">Notes</button>
|
|
189
|
+
<button type="button" id="present" data-testid="deck-present" title="Show the slide on its own; ← → move, Esc leaves">Present</button>
|
|
190
|
+
</div>
|
|
191
|
+
<div data-testid="deck-add-menu" id="menu" class="menu" role="menu" aria-label="Add a slide like" hidden></div>
|
|
192
|
+
<div id="style-panel" data-testid="deck-style" hidden></div>
|
|
193
|
+
<div data-testid="deck-stage" id="stage" class="stage">
|
|
194
|
+
<div id="slide-box" class="slide-box"></div>
|
|
195
|
+
<div data-testid="deck-cutoff" id="cutoff-bottom" class="cutoff" data-edge="bottom" hidden><span>Cut off below</span></div>
|
|
196
|
+
<div data-testid="deck-cutoff" id="cutoff-right" class="cutoff" data-edge="right" hidden><span>Cut off right</span></div>
|
|
197
|
+
<div data-testid="deck-hover-box" id="hover" class="box box--hover" hidden></div>
|
|
198
|
+
<div data-testid="deck-selected-box" id="selected" class="box" data-wid="" hidden></div>
|
|
199
|
+
<textarea data-testid="deck-edit-input" id="input" class="input" rows="1" aria-label="New text" hidden></textarea>
|
|
200
|
+
<span data-testid="deck-inline-count" id="badge" class="badge" hidden></span>
|
|
201
|
+
<span data-testid="deck-present-bar" id="present-bar" class="present-bar" hidden></span>
|
|
202
|
+
</div>
|
|
203
|
+
<p data-testid="deck-hint" id="hint" class="hint" hidden></p>
|
|
204
|
+
<p data-testid="deck-note" id="note" class="note" hidden></p>
|
|
205
|
+
<div id="notes-box" data-testid="deck-notes-tab" class="notes">
|
|
206
|
+
<label for="notes" id="notes-label" data-testid="deck-notes-label">Speaker notes</label>
|
|
207
|
+
<textarea id="notes" data-testid="deck-notes" placeholder="What to say on this slide. Saved when you leave the field; Undo puts the old notes back."></textarea>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
<div data-testid="deck-handle" id="handle" class="handle" tabindex="-1"></div>
|
|
211
|
+
</div>`;function v(o){const r=document.getElementById(o);if(r===null)throw new Error(`wicked-deck: no #${o}`);return r}const x=o=>o.id??`#${o.n}`;function Ye(o,r,i){const d=new DOMParser().parseFromString(o,"text/html");vt(d).forEach((u,h)=>{h!==r?u.setAttribute("data-wi-deck-off",""):u.setAttribute("data-wi-deck-current","")});const c=d.createElement("style");if(c.textContent="[data-wi-deck-off]{display:none!important}html,body{margin:0!important;padding:0!important;width:1280px!important;height:720px!important;overflow:hidden!important}[data-wi-deck-current]{position:absolute!important;left:0!important;top:0!important;width:1280px!important;height:720px!important;min-height:0!important;max-width:none!important;margin:0!important;box-sizing:border-box!important;overflow:hidden!important}",d.head.append(c),i.thumbnail)for(const u of Array.from(d.querySelectorAll("script")))u.remove();else{const u=d.createElement("script");u.textContent=`(function(){
|
|
212
|
+
function report(){
|
|
213
|
+
var slide=document.querySelector('[data-wi-deck-current]');
|
|
214
|
+
if(!slide)return;
|
|
215
|
+
parent.postMessage({v:1,type:'deck-extents',width:slide.scrollWidth,height:slide.scrollHeight},'*');
|
|
216
|
+
}
|
|
217
|
+
window.addEventListener('message',function(e){if(e.source===parent&&e.data&&e.data.v===1&&e.data.type==='request-inventory')report();});
|
|
218
|
+
window.addEventListener('resize',report);
|
|
219
|
+
window.addEventListener('load',function(){
|
|
220
|
+
report();
|
|
221
|
+
var slide=document.querySelector('[data-wi-deck-current]');
|
|
222
|
+
if(slide&&typeof ResizeObserver==='function')new ResizeObserver(report).observe(slide);
|
|
223
|
+
if(slide&&typeof MutationObserver==='function')new MutationObserver(report).observe(slide,{childList:true,subtree:true,characterData:true,attributes:true});
|
|
224
|
+
if(document.fonts)document.fonts.ready.then(report);
|
|
225
|
+
});
|
|
226
|
+
})();`,d.body.append(u)}return`<!doctype html>${d.documentElement.outerHTML}`}function bt(){document.body.insertAdjacentHTML("afterbegin",mn);const o=v("deck"),r=v("strip"),i=v("thumbs"),d=v("count"),c=v("tools"),u=v("add"),h=v("dup"),m=v("up"),F=v("down"),U=v("del"),K=v("present"),te=v("notes-toggle");let G=!1;const Y=v("menu"),b=v("stage"),p=v("slide-box"),C=v("cutoff-bottom"),L=v("cutoff-right"),S=v("fit"),M=v("zoom-100"),Me=v("fullscreen"),ve=v("style-panel"),ae=v("notes-box"),vn=v("hover"),gt=v("selected"),q=v("input"),wt=v("badge"),kt=v("present-bar"),be=v("hint"),He=v("note"),B=v("notes"),bn=v("notes-label"),ne=v("handle");let oe=null,de=[],k="pane",D=1,T="options",De="style",xt=null,ze="fit",_e=null,ge=null,gn=0;const We=new Map,N=(e,t)=>{oe?.postMessage({p:Le,v:Ke,type:e,payload:t})},we=(e,t)=>new Promise(n=>{if(oe===null){n({ok:!1,error:{code:"unavailable",message:"no host yet"}});return}const s=`wd-${++gn}`;We.set(s,n),oe.postMessage({p:Le,v:Ke,type:e,id:s,payload:t})}),ce=e=>N("ui.status",{line:e.slice(0,120)}),Ue=()=>de.includes("artifact.write");let O=null,re="",f=[],P=null,ue=null,g=!1,fe=!1,Ge=!1,ke=null,J=!1,pe="",Je=null,he=null,R=null,Ve=0,Et=-1,Ze=[],z=null,qe=null,xe={scrollX:0,scrollY:0},Ne=null,$=null,H=null;const I=()=>{const e=f.findIndex(t=>x(t)===P);return e<0?0:e},j=()=>f[I()]??null,Qe=()=>{const e=b.clientWidth,t=b.clientHeight;if(e===0||t===0)return{x:0,y:0,s:1};const n=ze==="100"&&k!=="inline"&&!g?1:Math.min(e/Q,t/ee);return{x:Math.max(0,(e-Q*n)/2),y:Math.max(0,(t-ee*n)/2),s:n}},W=()=>{const e=ze==="fit"||k==="inline"||g;if(b.dataset.zoom=e?"fit":"100",S.setAttribute("aria-pressed",String(e)),M.setAttribute("aria-pressed",String(!e)),e&&(b.scrollLeft=0,b.scrollTop=0),R===null)return;const t=Qe();p.style.cssText=`left:${t.x}px;top:${t.y}px;width:${Q*t.s}px;height:${ee*t.s}px`,R.style.cssText=`width:${Q}px;height:${ee}px;transform:scale(${t.s})`,At()},At=()=>{const e=Object.values(z?.widMap??{}).filter(a=>a.width>0&&a.height>0),t=e.reduce((a,y)=>Math.max(a,y.bottom+(z?.measured.scrollY??0)),Math.max(ee+xe.scrollY,qe?.height??0)),n=e.reduce((a,y)=>Math.max(a,y.right+(z?.measured.scrollX??0)),Math.max(Q+xe.scrollX,qe?.width??0)),s=Qe(),l=D===2&&T==="full"&&!g;C.hidden=!l||t<=ee,L.hidden=!l||n<=Q,C.style.cssText=`left:${s.x}px;top:${s.y+ee*s.s-1}px;width:${Q*s.s}px`,L.style.cssText=`left:${s.x+Q*s.s-1}px;top:${s.y}px;height:${ee*s.s}px`},et=e=>{if(e===null||z===null)return null;const t=z.widMap[e];if(t===void 0||t.width===0&&t.height===0)return null;const n=nn(t,z.measured,xe),s=Qe();return{left:s.x+n.left*s.s,top:s.y+n.top*s.s,width:n.width*s.s,height:n.height*s.s}},tt=(e,t,n=0,s=0)=>{if(t===null){e.hidden=!0;return}e.hidden=!1,e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${Math.max(t.width,n)}px`,e.style.height=`${Math.max(t.height,s)}px`},St=e=>{const t=z?.blocks[e];return z===null||t===void 0||z.widMap[e]===void 0?"unmeasured":t.composite?"container":t.cut===!0?"cut":"yes"},w=()=>{const e=j(),t=f.length;o.dataset.head=O===null?"":String(O),o.dataset.current=e?.id??"",o.dataset.currentN=e===null?"":String(e.n),o.dataset.count=String(t),o.dataset.size=k,o.dataset.surface=T,o.dataset.tab=De;const n=D===2&&T==="options";r.hidden=k==="inline"||g||n,b.hidden=n,ve.hidden=!n||De!=="style";const s=D===2&&T==="full"&&!G&&!g;ae.hidden=k==="inline"||g||n&&De!=="notes"||s,te.hidden=!(D===2&&T==="full"),te.setAttribute("aria-pressed",String(G)),At(),o.dataset.present=String(g),o.dataset.selected=$??"",document.body.dataset.present=String(g),d.textContent=t===0?"No slides yet":`${e?.n??1} of ${t}`,d.title=t===0?"":`Slide ${e?.n??1} of ${t}`;const l=Ue()&&!fe&&e!==null;for(const E of[u,h,U])E.disabled=!l||e?.id===null;m.disabled=!l||I()===0||e?.id===null,F.disabled=!l||I()>=t-1||e?.id===null,K.disabled=t===0,u.setAttribute("aria-expanded",String(J)),Y.hidden=!J||k==="inline",wt.hidden=D===2||k!=="inline"||t===0,wt.textContent=`${t} slide${t===1?"":"s"}`,kt.hidden=!g,kt.textContent=`${e?.n??0} / ${t} · ← → · Esc leaves`;for(const E of Array.from(i.children)){const V=E.querySelector("button");V!==null&&V.setAttribute("aria-current",String(V.dataset.key===P))}bn.textContent=e===null?"Speaker notes":`Speaker notes · slide ${e.n}`,document.activeElement!==B&&(B.value=ie!==null&&ie.key===P?ie.text:e?.notes??""),B.readOnly=!l;const a=k!=="inline"&&!g&&z!==null;if(tt(vn,a&&Ne!==$&&H===null?et(Ne):null),gt.dataset.wid=$??"",tt(gt,a&&H===null?et($):null),H!==null?tt(q,et(H.wid),160,30):q.hidden=!0,c.hidden=k==="inline"||g||n,Me.hidden=!de.includes("ui.fullscreen"),k==="inline"||g||n||H!==null||D===2&&T==="full"){be.hidden=!0;return}if(be.hidden=!1,$===null){be.removeAttribute("data-editable"),be.textContent=t===0?"":"← → to move between slides · click a line to point at it · type on it to change it";return}const y=St($);be.dataset.editable=String(y==="yes"),be.textContent=y==="yes"?"Type to change it · Enter to edit its text · Esc to let go":y==="container"?"This part holds other parts: click a line inside it to change the words · Esc to let go":"This can’t be changed by typing: say what to change in the message box · Esc to let go"},Pe=new Map,wn=()=>{const e=new Set,t=[];f.forEach((n,s)=>{const l=x(n);e.add(l);const a=Ye(re,s,{thumbnail:!0});let y=Pe.get(l);if(y===void 0){const V=document.createElement("li"),A=document.createElement("button");A.type="button",A.className="thumb";for(const[le,me]of Object.entries({"data-testid":"deck-thumb"}))A.setAttribute(le,me);A.innerHTML='<span class="n"></span><span class="mini"><iframe sandbox="" tabindex="-1" aria-hidden="true"></iframe></span><span class="t"></span>',A.addEventListener("click",()=>{Ee(A.dataset.key??null,!1),ot(),ne.focus()}),A.draggable=!0,A.addEventListener("dragstart",le=>{he=A.dataset.key??null,le.dataTransfer?.setData("text/plain",he??"")}),A.addEventListener("dragover",le=>{if(he===null||he===A.dataset.key)return;le.preventDefault();const me=A.getBoundingClientRect();A.dataset.drop=le.clientY<me.top+me.height/2?"before":"after"}),A.addEventListener("dragleave",()=>{delete A.dataset.drop}),A.addEventListener("drop",le=>{le.preventDefault();const me=A.dataset.drop;delete A.dataset.drop;const Ft=he;if(he=null,Ft===null||me===void 0)return;const Kt=f.findIndex(Bn=>x(Bn)===A.dataset.key),zt=f[Kt];if(zt?.id==null)return;const On=me==="after"?zt.id:f[Kt-1]?.id??null;rt(Ft,On)}),A.addEventListener("dragend",()=>{he=null}),V.appendChild(A),y={li:V,srcdoc:""},Pe.set(l,y)}const E=y.li.querySelector("button");E.dataset.key=l,E.dataset.slideId=n.id??"",E.dataset.n=String(n.n),E.setAttribute("aria-label",n.title===""?`Slide ${n.n}`:`Slide ${n.n}: ${n.title}`),E.querySelector(".n").textContent=String(n.n),E.querySelector(".t").textContent=n.title===""?`Slide ${n.n}`:n.title,y.srcdoc!==a&&(y.srcdoc=a,E.querySelector("iframe").srcdoc=a),t.push(y.li)});for(const[n,s]of Pe)e.has(n)||(s.li.remove(),Pe.delete(n));i.replaceChildren(...t)},kn=e=>{if(e===R){Et=Ve;for(const t of Ze)clearTimeout(t);Ze=hn.map(t=>setTimeout(()=>R?.contentWindow?.postMessage(an,"*"),t))}},nt=()=>{Ve+=1,z=null,qe=null,xe={scrollX:0,scrollY:0},Ne=null,$=null,se();const e=D===1&&k==="inline"?0:I();if(f.length===0){p.replaceChildren(),R=null,W(),w();return}const t=Ye(re,e,{thumbnail:!1}),n=document.createElement("iframe");for(const[l,a]of Object.entries({"data-testid":"deck-frame",sandbox:"allow-scripts",title:`Slide ${e+1}`}))n.setAttribute(l,a);R=n;const s=()=>{for(const l of Array.from(p.querySelectorAll("iframe")))l!==R&&l.remove()};n.addEventListener("load",()=>{kn(n),R===n&&s()}),n.srcdoc=cn(re)?t:fn(t),p.prepend(n),W(),setTimeout(()=>{R===n&&s()},2e3),w()},Ee=(e,t=!0)=>{if(e===null||e===P||!f.some(n=>x(n)===e)){w();return}lt(),P=e,nt(),t&&D===2&&T!=="options"&&ot()},Te=e=>{const t=Math.max(0,Math.min(f.length-1,I()+e)),n=f[t];n!==void 0&&Ee(x(n))},ot=()=>{const e=j()?.wid;e!=null&&de.includes("selection.chip")&&N("selection.set",{anchors:[{kind:"element",id:e}]})},xn=(e,t)=>e.version===void 0||t.version===void 0?{}:e.version>=t.version?e:t,$t=e=>{const t=e.version;if(typeof t=="number"&&O!==null&&t<O)return;He.hidden=!0;const n=e.content;if(re=typeof n?.html=="string"?n.html:"",O=typeof t=="number"?t:O,En(re),Lt.refresh(),f=tn(re),ue!==null){const l=f[Math.max(0,Math.min(f.length-1,ue))];P=l===void 0?null:x(l),ue=null}else f.some(l=>x(l)===P)||(P=f[0]===void 0?null:x(f[0]));const s=ge===null?void 0:f.find(l=>l.id===ge||l.wid===ge)??Ct(ge);T==="options"&&s!==void 0&&(ge=x(s),P=x(s)),wn(),nt()},Ae=async e=>{if(!(e!==void 0&&O!==null&&e<=O)){if(Ge){const t=e===void 0?{}:{version:e};ke=ke===null?t:xn(ke,t);return}Ge=!0;try{const t=await we("artifact.read",e===void 0?{}:{version:e});if(!t.ok){He.hidden=!1,He.textContent=t.error.code==="not_granted"?"This editor may not read the deck here.":`The deck could not be read (${t.error.code}).`;return}$t(t.payload)}finally{if(Ge=!1,ke!==null){const t=ke;ke=null,(t.version===void 0||O===null||t.version>O)&&Ae(t.version)}}}},Ct=e=>{if(re===""||!/^[A-Za-z0-9_.:-]{1,100}$/.test(e))return;const s=new DOMParser().parseFromString(re,"text/html").querySelector(`[data-wid="${e}"]`)?.closest("[data-slide-id]")?.getAttribute("data-slide-id")??null;return s===null?void 0:f.find(l=>l.id===s)},En=e=>{_e=Jt(e)??_e},Lt=Gt(ve,{tokens:()=>_e,key:e=>N("ui.key",{key:e}),apply:async e=>{if(D!==2||!de.includes("artifact.theme"))return{ok:!1,reason:"Theme changes are not granted here."};if(O===null)return{ok:!1,reason:"The deck has not loaded yet."};for(let t=0;t<2;t+=1){const n=await we("theme.set",{base:O,tokens:e});if(n.ok)return _e=Be(e),await Ae(typeof n.payload.version=="number"?n.payload.version:void 0),{ok:!0};if(n.error.code!=="head_moved")return{ok:!1,reason:n.error.message||n.error.code};const s=await we("artifact.read",{});if(!s.ok)return{ok:!1,reason:s.error.message||s.error.code};const l=s.payload.version;if(typeof l!="number"||O!==null&&l<O)return{ok:!1,reason:"The current deck version could not be read."};if($t(s.payload),t===1)return{ok:!1,reason:n.error.message||n.error.code}}return{ok:!1,reason:"The deck changed meanwhile."}}});window.addEventListener("message",e=>{if(R===null||R.contentWindow===null||e.source!==R.contentWindow||Et!==Ve)return;const t=e.data;if(t!==null&&typeof t=="object"&&t.v===1&&t.type==="deck-extents"){typeof t.width=="number"&&Number.isFinite(t.width)&&t.width>=0&&typeof t.height=="number"&&Number.isFinite(t.height)&&t.height>=0&&(qe={width:t.width,height:t.height},w());return}const n=ln(e.data);if(n!==null){if(n.type==="wid-inventory"){for(const s of Ze)clearTimeout(s);z={widMap:n.widMap,blocks:n.blocks??{},measured:{scrollX:n.scrollX,scrollY:n.scrollY}},xe={scrollX:n.scrollX,scrollY:n.scrollY},w()}else if(n.type==="scroll-state"||n.type==="scroll-ack")n.scrollX!==void 0&&n.scrollY!==void 0&&(xe={scrollX:n.scrollX,scrollY:n.scrollY},w());else if(n.type==="wid-hover")Ne=n.wid,w();else if(n.type==="wid-click"){if(k==="inline"){D===2&&Re(n.wid);return}if(g){Te(1);return}Re(n.wid===j()?.wid?null:n.wid),n.wid===j()?.wid&&ot()}}});const Re=e=>{$=e,se(),w(),e!==null&&(de.includes("selection.chip")&&N("selection.set",{anchors:[{kind:"element",id:e}]}),ne.focus())},ye=async(e,t,n,s=O,l)=>{if(s===null||fe||!Ue())return!1;fe=!0,J=!1,w(),ce(n);try{const a=await we("version.write",{base:s,ops:e,summary:t});if(a.ok)return await Ae(typeof a.payload.version=="number"?a.payload.version:void 0),!0;if(ue=null,a.error.code==="stale"||a.error.code==="head_moved"){l!==void 0?l():ce(a.error.code==="stale"&&a.error.message?a.error.message:"Not changed: the deck changed meanwhile");const y=a.payload?.head;typeof y=="number"&&y!==O&&await Ae(y)}else a.error.code==="timeout"||ce(a.error.message?a.error.code==="refused"||a.error.message.startsWith("Not changed")?a.error.message:`Not changed: ${a.error.message}`:"Nothing changed");return!1}finally{fe=!1,w()}},rt=async(e,t)=>{if(k==="inline"||g)return;const n=f.find(a=>x(a)===e);if(n?.id==null)return;const s=f.indexOf(n),l=t===null?-1:f.findIndex(a=>a.id===t);t===n.id||l===s-1||(P=x(n),await ye([{op:"slide-move",slide:n.id,after:t}],`slide ${n.n}`,`Moving slide ${n.n}…`))},it=e=>{const t=I(),n=f[t];n?.id!=null&&(e===-1&&t>0&&rt(x(n),f[t-2]?.id??null),e===1&&t<f.length-1&&rt(x(n),f[t+1]?.id??null))},Mt=()=>{if(k==="inline"||g)return;const e=j();e?.id!=null&&(ue=I()+1,ye([{op:"slide-duplicate",slide:e.id}],`slide ${e.n}`,`Duplicating slide ${e.n}…`))},Dt=e=>{if(k==="inline"||g)return;const t=j();e.id===null||t?.id==null||(ue=I()+1,ye([{op:"slide-insert",slide:e.id,after:t.id}],`a slide after slide ${t.n}`,`Adding a slide after slide ${t.n}…`))},Tt=()=>{if(k==="inline"||g)return;const e=j();e?.wid==null||f.length===0||(ue=Math.max(0,I()-(I()===f.length-1?1:0)),ye([{op:"remove",anchor:e.wid}],`slide ${e.n}`,`Deleting slide ${e.n}…`))},An=e=>{k==="inline"||g||z?.widMap[e]!==void 0&&ye([{op:"remove",anchor:e}],"part of the slide","Removing it…")};let Ie=null,st=null,ie=null;const lt=()=>{const e=f.find(y=>x(y)===Ie),t=st;if(Ie=null,st=null,e?.id==null||B.readOnly)return;const n=B.value.replace(/\r\n/g,`
|
|
227
|
+
`),s=e.notes,l=x(e),a=()=>{ie?.key===l&&(ie=null)};if(n.trim()===s.trim()){a();return}ye([{op:"notes-set",slide:e.id,text:n}],`slide ${e.n}’s notes`,`Saving slide ${e.n}’s notes…`,t,()=>{ie={key:l,text:n},ce(`Not saved: the deck changed while you typed slide ${e.n}’s notes. They are still in the field; leave it again to save them over the change.`),w()}).then(y=>{y&&a()})};B.addEventListener("focus",()=>{Ie=P,st=O}),B.addEventListener("blur",()=>lt()),B.addEventListener("keydown",e=>{if(e.stopPropagation(),!(D===2&&T==="options"&&pt(e,ae,t=>{(t==="Tab"||t==="Shift+Tab")&&B.blur(),N("ui.key",{key:t})}))){if(e.altKey&&!e.metaKey&&!e.ctrlKey&&/^Key[A-Z]$/.test(e.code)&&ct(`Alt+${e.code.slice(3)}`)){e.preventDefault(),N("ui.key",{key:`Alt+${e.code.slice(3)}`});return}if(e.key==="Escape"){e.preventDefault(),ie?.key===P&&(ie=null),B.value=j()?.notes??"",Ie=null,ne.focus();return}if(e.key==="Enter"&&(e.metaKey||e.ctrlKey)){e.preventDefault(),D===2&&T==="options"?B.blur():ne.focus();return}if((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()==="k"){e.preventDefault(),N("ui.key",{key:"Mod+K"});return}if(e.key==="Tab"&&!e.shiftKey){e.preventDefault(),B.blur(),N("ui.key",{key:"Tab"});return}e.key==="Tab"&&e.shiftKey&&(e.preventDefault(),ne.focus())}});const se=()=>{H!==null&&(H=null,q.hidden=!0,q.value="",w())},Ot=(e,t)=>{if(k==="inline"||g||fe||!Ue()||z===null||St(e)!=="yes")return;const n=z.blocks[e]?.text??"";H={wid:e,before:n},q.value=t??n,w(),q.focus(),t===null?q.select():q.setSelectionRange(q.value.length,q.value.length)},Sn=async()=>{if(H===null)return;const{wid:e,before:t}=H,n=q.value.replace(/\s*\n\s*/g," ");se(),ne.focus(),n!==t&&await ye([{op:"text",anchor:e,value:n,before:t}],`slide ${j()?.n??""}`,"Changing the text…")};q.addEventListener("keydown",e=>{if(e.stopPropagation(),(e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()==="k"){e.preventDefault(),se(),N("ui.key",{key:"Mod+K"});return}e.key==="Enter"?(e.preventDefault(),Sn()):e.key==="Escape"&&(e.preventDefault(),se(),ne.focus())}),q.addEventListener("blur",()=>se());const $n=()=>{Y.replaceChildren();const e=document.createElement("span");e.className="word",e.textContent="A blank slide laid out like",Y.appendChild(e);for(const t of f){if(t.id===null)continue;const n=document.createElement("button");n.type="button";for(const[s,l]of Object.entries({role:"menuitem","data-testid":"deck-add-like"}))n.setAttribute(s,l);n.dataset.slideId=t.id,n.textContent=t.title===""?`Slide ${t.n}`:`Slide ${t.n} — ${t.title}`,n.addEventListener("click",()=>Dt(t)),Y.appendChild(n)}J=!0,w(),Y.querySelector("button")?.focus()},at=()=>{J&&(J=!1,w(),u.focus())};Y.addEventListener("keydown",e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),at();return}if(e.key!=="ArrowDown"&&e.key!=="ArrowUp")return;e.preventDefault(),e.stopPropagation();const t=Array.from(Y.querySelectorAll("button")),n=t.indexOf(document.activeElement);t[(n+(e.key==="ArrowDown"?1:t.length-1)+t.length)%t.length]?.focus()}),u.addEventListener("click",()=>J?at():$n()),h.addEventListener("click",()=>Mt()),m.addEventListener("click",()=>it(-1)),F.addEventListener("click",()=>it(1)),U.addEventListener("click",()=>Tt()),K.addEventListener("click",()=>void Cn()),te.addEventListener("click",()=>{G=!G,w(),W(),G&&B.focus()}),Me.addEventListener("click",()=>{we("ui.fullscreen",{}).then(e=>{e.ok||ce(e.error.message)})}),S.addEventListener("click",()=>{ze="fit",W(),w()}),M.addEventListener("click",()=>{ze="100",W(),w()});const Cn=async()=>{f.length!==0&&(lt(),g=!0,Re(null),de.includes("ui.fullscreen")&&await we("ui.fullscreen",{}),w(),W(),o.focus())},Ln=()=>{g=!1,w(),W(),o.focus()};window.addEventListener("resize",()=>{W(),w()}),typeof ResizeObserver=="function"&&new ResizeObserver(()=>{W(),w()}).observe(b);const Mn=()=>[...Array.from(i.querySelectorAll("button")).filter(()=>k!=="inline"&&!g),...Array.from(c.querySelectorAll("button")).filter(e=>!c.hidden&&!e.hidden&&!e.disabled),ne,...k==="inline"||g||ae.hidden?[]:[B]],Dn=e=>{pe=`${pe}${e}`.slice(-3),Je!==null&&clearTimeout(Je),Je=setTimeout(()=>{pe=""},yn),ce(`Go to slide ${pe} — Enter`)};o.addEventListener("keydown",e=>{if(e.target===q||e.target===B||ve.contains(e.target)||D===2&&T==="options")return;const t=e.target?.tagName==="BUTTON",n=e.target?.dataset?.testid==="deck-thumb",s=e.key==="Enter"&&n&&pe!=="";if(t&&!s&&(e.key==="Enter"||e.key===" "))return;const l=e.metaKey||e.ctrlKey;if(e.key==="Escape"){if(e.preventDefault(),J){at();return}if(g){Ln();return}if($!==null){Re(null);return}N("ui.key",{key:"Escape"});return}if(l&&!e.altKey&&e.key.toLowerCase()==="k"){e.preventDefault(),N("ui.key",{key:"Mod+K"});return}if(l&&e.shiftKey&&!e.altKey&&e.key.toLowerCase()==="n"){e.preventDefault();const a=j();a!==null&&Dt(a);return}if(l&&!e.shiftKey&&!e.altKey&&e.key.toLowerCase()==="d"){e.preventDefault(),Mt();return}if(l&&!e.altKey&&(e.key==="Backspace"||e.key==="Delete")){e.preventDefault(),$!==null&&$!==j()?.wid?An($):Tt();return}if(e.altKey&&!l&&(e.key==="ArrowUp"||e.key==="ArrowDown")){e.preventDefault(),it(e.key==="ArrowUp"?-1:1);return}if(e.altKey&&!l&&/^Key[A-Z]$/.test(e.code)){e.preventDefault(),N("ui.key",{key:`Alt+${e.code.slice(3)}`});return}if(e.key==="Tab"){e.preventDefault();const a=Mn(),y=a.indexOf(document.activeElement),E=y===-1&&document.activeElement===o&&!e.shiftKey?0:y+(e.shiftKey?-1:1);if(y===-1&&E!==0||E<0||E>=a.length){N("ui.key",{key:e.shiftKey?"Shift+Tab":"Tab"});return}a[E].focus();return}if(!(l||e.altKey)){if(e.key==="ArrowRight"||e.key==="PageDown"||e.key==="ArrowDown"&&!t){e.preventDefault(),Te(1);return}if(e.key==="ArrowLeft"||e.key==="PageUp"||e.key==="ArrowUp"&&!t){e.preventDefault(),Te(-1);return}if(e.key==="Home"){e.preventDefault();const a=f[0];a!==void 0&&Ee(x(a));return}if(e.key==="End"){e.preventDefault();const a=f[f.length-1];a!==void 0&&Ee(x(a));return}if(g&&e.key===" "){e.preventDefault(),Te(1);return}if(s){e.preventDefault();const a=f[Number(pe)-1];pe="",a!==void 0&&(Ee(x(a)),i.querySelector(`[data-key="${CSS.escape(x(a))}"]`)?.focus()),ce(a===void 0?"There is no such slide":`Slide ${a.n}`);return}if(!(t&&e.key.length!==1)){if(e.key==="Enter"){$!==null&&!fe&&(e.preventDefault(),Ot($,null));return}if(e.key.length===1){if(e.preventDefault(),k!=="inline"&&!g&&$!==null&&!fe){Ot($,e.key);return}if(/^[0-9]$/.test(e.key)&&n){Dn(e.key);return}N("ui.typed",{grapheme:e.key})}}}});const dt=e=>{const t=k;k=e,document.body.dataset.size=e,e==="inline"&&(g=!1,se(),$=null,J=!1,document.activeElement?.blur?.()),e!=="full"&&g&&(g=!1),D===1&&t==="inline"!=(e==="inline")&&f.length>0&&nt(),W(),w()},Bt=e=>{if(!(typeof e!="object"||e===null))for(const[t,n]of Object.entries(e))/^--[a-z0-9-]+$/.test(t)&&typeof n=="string"&&n.length<=200&&!/url\(/i.test(n)&&document.documentElement.style.setProperty(t,n)},Tn=e=>{const t=e.data;try{if(t===null||typeof t!="object"||t.p!==Le||t.v!==Ke)return;if(typeof t.re=="string"){const s=We.get(t.re);if(s===void 0)return;We.delete(t.re);const l=typeof t.payload=="object"&&t.payload!==null?t.payload:{};t.ok===!0?s({ok:!0,payload:l}):s({ok:!1,error:t.error??{code:"unavailable",message:"no answer"},payload:l});return}if(D===2&&xt?.dispatch(t))return;const n=typeof t.payload=="object"&&t.payload!==null?t.payload:{};switch(t.type){case"host.ping":typeof t.id=="string"&&oe?.postMessage({p:Le,v:Ke,re:t.id,ok:!0,payload:{}});return;case"host.size":(n.size==="inline"||n.size==="pane"||n.size==="full")&&dt(n.size);return;case"host.theme":Bt(n.theme);return;case"artifact.changed":{const s=n.version;typeof s=="number"&&s!==O&&Ae(s);return}case"selection.cleared":$!==null&&($=null,se(),w());return;default:return}}catch{}};window.addEventListener("message",e=>{const t=e.data;if(oe!==null||t===null||typeof t!="object"||t.p!==Le||t.type!=="host.hello"||e.ports[0]===void 0)return;oe=e.ports[0],oe.onmessage=Tn;const n=typeof t.payload=="object"&&t.payload!==null?t.payload:{};de=Array.isArray(n.grants)?n.grants.filter(l=>typeof l=="string"):[];const s=Xt(n);D=s.protocol,T=s.surface,De=s.tab??"style",document.body.dataset.protocol=String(D),document.body.dataset.surface=T,xt=new Wt(oe,{surface:l=>{l!=="options"&&(T=l,document.body.dataset.surface=l,dt(ft(l)))},action:l=>{if(T==="options"||l!=="prev"&&l!=="next")return{handled:!1};const a=I()+(l==="next"?1:-1);return a<0||a>=f.length?{handled:!1}:(Te(l==="next"?1:-1),{handled:!0,status:`Slide ${I()+1} of ${f.length}`})},tab:l=>{T!=="options"||l!=="style"&&l!=="notes"||(B.blur(),De=l,Lt.refresh(),w())},selection:l=>{if(T==="options")for(const a of l){if(typeof a!="object"||a===null)continue;const y=a;if(y.kind!=="element"||typeof y.id!="string")continue;const E=f.find(V=>V.id===y.id||V.wid===y.id)??Ct(y.id);if((f.length===0||E!==void 0)&&(ge=E===void 0?y.id:x(E)),E!==void 0){B.blur(),Ee(x(E),!1);break}}}}),Bt(n.theme),dt(D===2?ft(T):s.size),Ae()}),Ht(pn,qt)}return bt(),X.oneSlideHtml=Ye,X.start=bt,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"}),X})({});
|
|
228
|
+
</script>
|
|
229
|
+
</body>
|
|
230
|
+
</html>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "wicked-doc",
|
|
3
|
+
"title": "Document",
|
|
4
|
+
"version": "0.9.0",
|
|
5
|
+
"protocol": [
|
|
6
|
+
1,
|
|
7
|
+
2
|
|
8
|
+
],
|
|
9
|
+
"kinds": [
|
|
10
|
+
"document"
|
|
11
|
+
],
|
|
12
|
+
"entry": "index.html",
|
|
13
|
+
"sizes": [
|
|
14
|
+
"inline",
|
|
15
|
+
"pane",
|
|
16
|
+
"full"
|
|
17
|
+
],
|
|
18
|
+
"permissions": [
|
|
19
|
+
{
|
|
20
|
+
"id": "artifact.read",
|
|
21
|
+
"why": "to show the document and read its words"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "artifact.write",
|
|
25
|
+
"why": "to land what you type on an element as one version, with Undo"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "selection.chip",
|
|
29
|
+
"why": "to make the element you click the subject of your next message"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "network.media",
|
|
33
|
+
"why": "to show the document’s web images and fonts"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "checks.read",
|
|
37
|
+
"why": "to show which requirements this document names"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "artifact.export",
|
|
41
|
+
"why": "to offer the document as a PDF or a web page from its card (the host makes the file)"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "artifact.theme",
|
|
45
|
+
"why": "to change the document’s theme, colours and fonts from its Style tab, as one version with Undo"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "ui.fullscreen",
|
|
49
|
+
"why": "to show the document full screen"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"surfaces": {
|
|
53
|
+
"card": {
|
|
54
|
+
"interactive": true,
|
|
55
|
+
"aspect": "16:9",
|
|
56
|
+
"actions": [
|
|
57
|
+
{
|
|
58
|
+
"id": "ask",
|
|
59
|
+
"label": "Ask about this",
|
|
60
|
+
"verb": "host:ask"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": "export",
|
|
64
|
+
"label": "Export",
|
|
65
|
+
"verb": "host:export"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"options": {
|
|
70
|
+
"tabs": [
|
|
71
|
+
{
|
|
72
|
+
"id": "style",
|
|
73
|
+
"label": "Style",
|
|
74
|
+
"render": "plugin"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": "coverage",
|
|
78
|
+
"label": "Coverage",
|
|
79
|
+
"render": "plugin"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
"full": {
|
|
84
|
+
"modes": [
|
|
85
|
+
"simple",
|
|
86
|
+
"advanced"
|
|
87
|
+
],
|
|
88
|
+
"default": "simple"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|