stagecraft 0.1.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/AGENT.md +792 -0
- package/LICENSE +21 -0
- package/README.md +210 -0
- package/bin/cli.js +51 -0
- package/bin/export.js +137 -0
- package/bin/init.js +52 -0
- package/bin/lib/edit-ops.js +405 -0
- package/bin/serve.js +278 -0
- package/dist/stagecraft.bundle.css +4443 -0
- package/dist/stagecraft.bundle.js +7621 -0
- package/dist/themes/brand.bundle.css +5262 -0
- package/dist/themes/neon.bundle.css +5289 -0
- package/dist/themes/paper.bundle.css +5276 -0
- package/dist/themes/phosphor.bundle.css +4443 -0
- package/dist/themes/shopware.bundle.css +5850 -0
- package/examples/closing-card.js +74 -0
- package/examples/orchestration-graph.js +156 -0
- package/examples/terminal-log.js +109 -0
- package/examples/token-stream.js +96 -0
- package/examples/whoami.js +90 -0
- package/package.json +41 -0
- package/src/components/activity-list.js +75 -0
- package/src/components/agenda.js +79 -0
- package/src/components/bar-chart.js +162 -0
- package/src/components/before-after.js +135 -0
- package/src/components/bento.js +73 -0
- package/src/components/big-number.js +87 -0
- package/src/components/callout.js +75 -0
- package/src/components/checklist.js +81 -0
- package/src/components/code-block.js +141 -0
- package/src/components/code-diff.js +98 -0
- package/src/components/compare.js +85 -0
- package/src/components/counter.js +80 -0
- package/src/components/cta.js +69 -0
- package/src/components/cycle.js +146 -0
- package/src/components/definition.js +96 -0
- package/src/components/donut-chart.js +179 -0
- package/src/components/full-image.js +82 -0
- package/src/components/funnel.js +111 -0
- package/src/components/gauge.js +147 -0
- package/src/components/heatmap.js +141 -0
- package/src/components/image-grid.js +80 -0
- package/src/components/image-text.js +96 -0
- package/src/components/kinetic-text.js +72 -0
- package/src/components/kpi.js +106 -0
- package/src/components/line-chart.js +215 -0
- package/src/components/manifesto.js +104 -0
- package/src/components/marquee.js +63 -0
- package/src/components/matrix2x2.js +151 -0
- package/src/components/pillars.js +80 -0
- package/src/components/pricing.js +90 -0
- package/src/components/process-flow.js +133 -0
- package/src/components/progress.js +136 -0
- package/src/components/punchline.js +82 -0
- package/src/components/pyramid.js +107 -0
- package/src/components/qanda.js +60 -0
- package/src/components/quote.js +70 -0
- package/src/components/roadmap.js +130 -0
- package/src/components/section-card.js +45 -0
- package/src/components/shift-arrow.js +41 -0
- package/src/components/spark-line.js +147 -0
- package/src/components/spotlight.js +85 -0
- package/src/components/statement.js +106 -0
- package/src/components/stats.js +91 -0
- package/src/components/steps.js +83 -0
- package/src/components/swot.js +110 -0
- package/src/components/team-grid.js +87 -0
- package/src/components/testimonial.js +99 -0
- package/src/components/timeline.js +91 -0
- package/src/components/tip.js +63 -0
- package/src/components/venn.js +198 -0
- package/src/edit-mode.js +1256 -0
- package/src/engine.js +823 -0
- package/src/helpers.js +169 -0
- package/src/transitions.js +101 -0
- package/starter/index.html +40 -0
- package/starter/slides/00-title.js +12 -0
- package/starter/stagecraft.config.js +8 -0
- package/themes/brand/base.css +4 -0
- package/themes/brand/components-business.css +173 -0
- package/themes/brand/components-chart.css +65 -0
- package/themes/brand/components-content.css +126 -0
- package/themes/brand/components-data.css +162 -0
- package/themes/brand/components-diagram.css +115 -0
- package/themes/brand/components-layout.css +112 -0
- package/themes/brand/components.css +46 -0
- package/themes/brand/manifest.json +20 -0
- package/themes/brand/tokens.css +20 -0
- package/themes/brand/transitions.css +4 -0
- package/themes/neon/base.css +10 -0
- package/themes/neon/components-business.css +189 -0
- package/themes/neon/components-chart.css +70 -0
- package/themes/neon/components-content.css +112 -0
- package/themes/neon/components-data.css +160 -0
- package/themes/neon/components-diagram.css +109 -0
- package/themes/neon/components-layout.css +87 -0
- package/themes/neon/components.css +87 -0
- package/themes/neon/manifest.json +21 -0
- package/themes/neon/tokens.css +17 -0
- package/themes/neon/transitions.css +13 -0
- package/themes/paper/base.css +9 -0
- package/themes/paper/components-business.css +196 -0
- package/themes/paper/components-chart.css +74 -0
- package/themes/paper/components-content.css +108 -0
- package/themes/paper/components-data.css +168 -0
- package/themes/paper/components-diagram.css +89 -0
- package/themes/paper/components-layout.css +105 -0
- package/themes/paper/components.css +60 -0
- package/themes/paper/manifest.json +10 -0
- package/themes/paper/tokens.css +21 -0
- package/themes/paper/transitions.css +11 -0
- package/themes/phosphor/base.css +511 -0
- package/themes/phosphor/components-business.css +818 -0
- package/themes/phosphor/components-chart.css +415 -0
- package/themes/phosphor/components-content.css +530 -0
- package/themes/phosphor/components-data.css +824 -0
- package/themes/phosphor/components-diagram.css +427 -0
- package/themes/phosphor/components-layout.css +450 -0
- package/themes/phosphor/components.css +223 -0
- package/themes/phosphor/manifest.json +11 -0
- package/themes/phosphor/tokens.css +17 -0
- package/themes/phosphor/transitions.css +213 -0
- package/themes/shopware/base.css +94 -0
- package/themes/shopware/components-business.css +344 -0
- package/themes/shopware/components-chart.css +121 -0
- package/themes/shopware/components-content.css +169 -0
- package/themes/shopware/components-data.css +219 -0
- package/themes/shopware/components-diagram.css +129 -0
- package/themes/shopware/components-layout.css +166 -0
- package/themes/shopware/components.css +83 -0
- package/themes/shopware/manifest.json +21 -0
- package/themes/shopware/tokens.css +68 -0
- package/themes/shopware/transitions.css +22 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Stage.Venn — 2- or 3-circle Venn diagram with labeled regions.
|
|
5
|
+
*
|
|
6
|
+
* Usage (2 sets):
|
|
7
|
+
* Stage.register(Stage.Venn({
|
|
8
|
+
* section: 7,
|
|
9
|
+
* title: '07 · the overlap',
|
|
10
|
+
* sets: [
|
|
11
|
+
* { label: 'Taste', color: 'accent' },
|
|
12
|
+
* { label: 'Throughput', color: 'blue' }
|
|
13
|
+
* ],
|
|
14
|
+
* overlaps: [{ ids: [0,1], label: 'shipping value' }],
|
|
15
|
+
* reveal: 'staggered' // 'instant' | 'staggered'
|
|
16
|
+
* }));
|
|
17
|
+
*
|
|
18
|
+
* Usage (3 sets):
|
|
19
|
+
* Stage.register(Stage.Venn({
|
|
20
|
+
* sets: [
|
|
21
|
+
* { label: 'Knows', color: 'accent' },
|
|
22
|
+
* { label: 'Cares', color: 'amber' },
|
|
23
|
+
* { label: 'Does', color: 'blue' }
|
|
24
|
+
* ],
|
|
25
|
+
* overlaps: [
|
|
26
|
+
* { ids: [0,1], label: 'opinions' },
|
|
27
|
+
* { ids: [0,2], label: 'execution' },
|
|
28
|
+
* { ids: [1,2], label: 'effort' },
|
|
29
|
+
* { ids: [0,1,2], label: 'the work' }
|
|
30
|
+
* ]
|
|
31
|
+
* }));
|
|
32
|
+
*
|
|
33
|
+
* Layer-3 (inline edit):
|
|
34
|
+
* sets[i].label, overlaps[j].label.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
(function (root) {
|
|
38
|
+
const Stage = root.Stage = root.Stage || {};
|
|
39
|
+
|
|
40
|
+
const COLOR_MAP = {
|
|
41
|
+
accent: 'var(--accent)',
|
|
42
|
+
amber: 'var(--amber)',
|
|
43
|
+
blue: 'var(--blue)',
|
|
44
|
+
red: 'var(--red)',
|
|
45
|
+
dim: 'var(--dim)',
|
|
46
|
+
fg: 'var(--fg)'
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// viewBox is 100 x 78 (matches container aspect).
|
|
50
|
+
const VB_W = 100;
|
|
51
|
+
const VB_H = 78;
|
|
52
|
+
|
|
53
|
+
function colorFor(name) {
|
|
54
|
+
return COLOR_MAP[name] || COLOR_MAP.accent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Geometry presets — ALL coordinates in SVG viewBox units (100 × 78).
|
|
58
|
+
// The render function converts to container-% for CSS positioning, so labels
|
|
59
|
+
// align exactly with the circles regardless of the container's aspect ratio.
|
|
60
|
+
// Each set label is placed in that set's *exclusive* region (the horn that
|
|
61
|
+
// doesn't overlap any other set), and each overlap label sits in the
|
|
62
|
+
// overlap region it names.
|
|
63
|
+
const GEOMETRY = {
|
|
64
|
+
2: {
|
|
65
|
+
circles: [
|
|
66
|
+
{ cx: 38, cy: 39, r: 22 },
|
|
67
|
+
{ cx: 62, cy: 39, r: 22 }
|
|
68
|
+
],
|
|
69
|
+
setLabels: [
|
|
70
|
+
{ x: 25, y: 39 }, // Knows-only horn (left)
|
|
71
|
+
{ x: 75, y: 39 } // Cares-only horn (right)
|
|
72
|
+
],
|
|
73
|
+
overlapLabels: {
|
|
74
|
+
'0-1': { x: 50, y: 39 }
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
3: {
|
|
78
|
+
circles: [
|
|
79
|
+
{ cx: 38, cy: 32, r: 22 },
|
|
80
|
+
{ cx: 62, cy: 32, r: 22 },
|
|
81
|
+
{ cx: 50, cy: 53, r: 22 }
|
|
82
|
+
],
|
|
83
|
+
setLabels: [
|
|
84
|
+
{ x: 28, y: 22 }, // Knows-only horn (upper-left)
|
|
85
|
+
{ x: 72, y: 22 }, // Cares-only horn (upper-right)
|
|
86
|
+
{ x: 50, y: 70 } // Does-only horn (bottom)
|
|
87
|
+
],
|
|
88
|
+
overlapLabels: {
|
|
89
|
+
'0-1': { x: 50, y: 23 }, // Knows ∩ Cares (top center)
|
|
90
|
+
'0-2': { x: 31, y: 50 }, // Knows ∩ Does (lower-left)
|
|
91
|
+
'1-2': { x: 69, y: 50 }, // Cares ∩ Does (lower-right)
|
|
92
|
+
'0-1-2': { x: 50, y: 40 } // all three (center)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// Convert viewBox-units position to container-% (which is what CSS uses).
|
|
98
|
+
function toCSS(p) {
|
|
99
|
+
return { left: (p.x / VB_W) * 100, top: (p.y / VB_H) * 100 };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
Stage.Venn = function (opts) {
|
|
103
|
+
const sets = (opts.sets || []).slice(0, 3);
|
|
104
|
+
const overlaps = opts.overlaps || [];
|
|
105
|
+
const reveal = opts.reveal || 'instant';
|
|
106
|
+
const n = sets.length;
|
|
107
|
+
const geo = GEOMETRY[n] || GEOMETRY[2];
|
|
108
|
+
|
|
109
|
+
function keyFor(ids) {
|
|
110
|
+
return ids.slice().sort((a, b) => a - b).join('-');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const slide = {
|
|
114
|
+
section: opts.section,
|
|
115
|
+
title: opts.title,
|
|
116
|
+
transition: opts.transition,
|
|
117
|
+
render(el) {
|
|
118
|
+
const svgCircles = sets.map((s, i) => {
|
|
119
|
+
const c = geo.circles[i] || geo.circles[0];
|
|
120
|
+
return `<circle class="v-circle"
|
|
121
|
+
data-set="${i}"
|
|
122
|
+
data-stage-key="Venn/circle[${i}]"
|
|
123
|
+
cx="${c.cx}" cy="${c.cy}" r="${c.r}"
|
|
124
|
+
fill="${colorFor(s.color)}"
|
|
125
|
+
stroke="${colorFor(s.color)}"/>`;
|
|
126
|
+
}).join('');
|
|
127
|
+
|
|
128
|
+
const setLabels = sets.map((s, i) => {
|
|
129
|
+
const pos = toCSS(geo.setLabels[i] || { x: 50, y: 39 });
|
|
130
|
+
return `<div class="v-label set"
|
|
131
|
+
data-set="${i}"
|
|
132
|
+
data-stage-key="Venn/set-label[${i}]"
|
|
133
|
+
style="left:${pos.left}%; top:${pos.top}%; --vl-color:${colorFor(s.color)};">
|
|
134
|
+
<span class="name" data-stage-edit="sets[${i}].label">${escape(s.label || '')}</span>
|
|
135
|
+
</div>`;
|
|
136
|
+
}).join('');
|
|
137
|
+
|
|
138
|
+
const overlapLabels = overlaps.map((o, j) => {
|
|
139
|
+
const key = keyFor(o.ids || []);
|
|
140
|
+
const rawPos = geo.overlapLabels[key];
|
|
141
|
+
if (!rawPos) return '';
|
|
142
|
+
const pos = toCSS(rawPos);
|
|
143
|
+
return `<div class="v-label overlap"
|
|
144
|
+
data-overlap="${j}"
|
|
145
|
+
data-stage-key="Venn/overlap-label[${j}]"
|
|
146
|
+
style="left:${pos.left}%; top:${pos.top}%;">
|
|
147
|
+
<span data-stage-edit="overlaps[${j}].label">${escape(o.label || '')}</span>
|
|
148
|
+
</div>`;
|
|
149
|
+
}).join('');
|
|
150
|
+
|
|
151
|
+
el.innerHTML = `
|
|
152
|
+
<div class="venn" data-stage-key="Venn">
|
|
153
|
+
<svg viewBox="0 0 ${VB_W} ${VB_H}" preserveAspectRatio="xMidYMid meet">
|
|
154
|
+
${svgCircles}
|
|
155
|
+
</svg>
|
|
156
|
+
${setLabels}
|
|
157
|
+
${overlapLabels}
|
|
158
|
+
</div>
|
|
159
|
+
`;
|
|
160
|
+
|
|
161
|
+
if (reveal === 'instant') {
|
|
162
|
+
el.querySelectorAll('.v-circle, .v-label').forEach(n => n.classList.add('in'));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
if (reveal === 'staggered') {
|
|
168
|
+
slide.init = function (el) {
|
|
169
|
+
const circles = Array.from(el.querySelectorAll('.v-circle'));
|
|
170
|
+
const setLbls = Array.from(el.querySelectorAll('.v-label.set'));
|
|
171
|
+
const overLbls = Array.from(el.querySelectorAll('.v-label.overlap'));
|
|
172
|
+
const timers = [];
|
|
173
|
+
circles.forEach((c, i) => {
|
|
174
|
+
timers.push(setTimeout(() => c.classList.add('in'), 200 + i * 260));
|
|
175
|
+
});
|
|
176
|
+
const setStart = 200 + circles.length * 260;
|
|
177
|
+
setLbls.forEach((l, i) => {
|
|
178
|
+
timers.push(setTimeout(() => l.classList.add('in'), setStart + i * 160));
|
|
179
|
+
});
|
|
180
|
+
const overStart = setStart + setLbls.length * 160 + 200;
|
|
181
|
+
overLbls.forEach((l, i) => {
|
|
182
|
+
timers.push(setTimeout(() => l.classList.add('in'), overStart + i * 200));
|
|
183
|
+
});
|
|
184
|
+
return () => timers.forEach(clearTimeout);
|
|
185
|
+
};
|
|
186
|
+
slide.replay = function (el) {
|
|
187
|
+
el.querySelectorAll('.v-circle, .v-label').forEach(n => n.classList.remove('in'));
|
|
188
|
+
return this.init(el);
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return slide;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
function escape(s) {
|
|
196
|
+
return String(s).replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
|
197
|
+
}
|
|
198
|
+
})(typeof window !== 'undefined' ? window : globalThis);
|