create-pmos 0.590.0 → 0.592.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/package.json +27 -27
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-initiative-test.js +3 -0
- package/workspace/changelog.json +26 -0
- package/workspace/guide/agent-capabilities.md +23 -12
- package/workspace/guide/cli.md +2 -2
- package/workspace/guide/home.md +1 -0
- package/workspace/home-other-product-test.js +2 -1
- package/workspace/home-railcard-test.js +2 -0
- package/workspace/lib/idle-lab.js +17 -5
- package/workspace/lib/lab-cli.js +5 -5
- package/workspace/lib/live-round.js +320 -66
- package/workspace/lib/proto-runtime.js +104 -0
- package/workspace/lib/routes-briefing-premium.js +26 -14
- package/workspace/lib/routes-lab.js +53 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/panels-test.js +2 -1
- package/workspace/program-order-test.js +2 -1
- package/workspace/public/pm/cozy-home.css +8 -0
- package/workspace/public/pm/cozy-lab.js +15 -7
- package/workspace/public/pm/cozy-proto.css +138 -0
- package/workspace/public/pm/cozy-proto.js +436 -0
- package/workspace/public/pm/home-app.js +2 -0
- package/workspace/public/pm/home-chat.js +39 -5
- package/workspace/public/pm/home-list.js +17 -1
- package/workspace/public/pm/home-today.js +20 -14
- package/workspace/server.js +2 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* proto-runtime.js — the canvas runtime inside a prototype frame (initiative live-round-iterative, design Prototype by chatting, B3).
|
|
3
|
+
* GET /api/lab/specimen?rt=1 (lib/routes-lab.js) adds it to the prototype's HTML, inside the same sandbox CSP (no same origin, no network):
|
|
4
|
+
* the page still cannot reach PMOS. It talks to the canvas (pm/cozy-proto.js) only through postMessage, and only with its parent.
|
|
5
|
+
*
|
|
6
|
+
* What it does, from the data attributes the run writes (lib/live-round.js promptOf):
|
|
7
|
+
* data-screen one screen shows at a time; the first is the start data-go a tap moves to that screen
|
|
8
|
+
* data-el what the PM can point at, comment on or tap in Play data-label its name in plain words
|
|
9
|
+
* data-copy text the Page copy card edits in place :root vars what Tweaks change
|
|
10
|
+
* Parent → frame { pmos: 1, t }: mode (view | point | comment | play), screen, copy, copyAll, vars, hint, sel, pins.
|
|
11
|
+
* Frame → parent { pmos: 1, t }: ready (screens, els, copy), screen, point, pin, tap.
|
|
12
|
+
*
|
|
13
|
+
* withRuntime(html) → html with the runtime's <script> before </body> (or at the end) */
|
|
14
|
+
function runtime() {
|
|
15
|
+
/* eslint-disable no-var */
|
|
16
|
+
var mode = 'view', P = window.parent;
|
|
17
|
+
var css = document.createElement('style');
|
|
18
|
+
css.textContent = '[data-screen]:not(.pmos-on){display:none!important}'
|
|
19
|
+
+ '.pmos-hov{outline:2px solid #4a72d9!important;outline-offset:2px;cursor:pointer!important}'
|
|
20
|
+
+ '.pmos-sel{outline:2px solid #4a72d9!important;outline-offset:2px}'
|
|
21
|
+
+ '.pmos-hint{outline:3px dashed #d99a1e!important;outline-offset:3px}'
|
|
22
|
+
+ '.pmos-pin{position:absolute;z-index:2147483646;width:20px;height:20px;margin:-10px 0 0 -10px;border-radius:50%;background:#c0472e;color:#fff;font:600 11px/20px system-ui,sans-serif;text-align:center;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,.25)}'
|
|
23
|
+
+ 'body.pmos-point *,body.pmos-comment *{cursor:crosshair!important}';
|
|
24
|
+
(document.head || document.documentElement).appendChild(css);
|
|
25
|
+
var post = function (m) { m.pmos = 1; try { P.postMessage(m, '*'); } catch (e) { /* the canvas is gone */ } };
|
|
26
|
+
var screens = function () { return Array.prototype.slice.call(document.querySelectorAll('[data-screen]')); };
|
|
27
|
+
var show = function (id) {
|
|
28
|
+
var all = screens(); if (!all.length) return;
|
|
29
|
+
var on = all.filter(function (s) { return s.getAttribute('data-screen') === id; })[0] || all[0];
|
|
30
|
+
all.forEach(function (s) { s.classList.toggle('pmos-on', s === on); });
|
|
31
|
+
window.scrollTo(0, 0);
|
|
32
|
+
post({ t: 'screen', id: on.getAttribute('data-screen') });
|
|
33
|
+
};
|
|
34
|
+
var elOf = function (n) { return n && n.closest ? n.closest('[data-el]') : null; };
|
|
35
|
+
var info = function (e) { return e ? { el: e.getAttribute('data-el') || '', label: e.getAttribute('data-label') || (e.textContent || '').trim().slice(0, 40) } : { el: '', label: '' }; };
|
|
36
|
+
var hov = null;
|
|
37
|
+
document.addEventListener('mouseover', function (ev) {
|
|
38
|
+
if (mode !== 'point' && mode !== 'comment') return;
|
|
39
|
+
var e = elOf(ev.target); if (hov && hov !== e) hov.classList.remove('pmos-hov');
|
|
40
|
+
hov = e; if (e) e.classList.add('pmos-hov');
|
|
41
|
+
}, true);
|
|
42
|
+
document.addEventListener('click', function (ev) {
|
|
43
|
+
var e = elOf(ev.target), go = ev.target.closest && ev.target.closest('[data-go],a[href^="#"]');
|
|
44
|
+
if (mode === 'point') { ev.preventDefault(); ev.stopPropagation(); if (!e) return; sel(e.getAttribute('data-el')); var i = info(e); i.t = 'point'; post(i); return; }
|
|
45
|
+
if (mode === 'comment') {
|
|
46
|
+
ev.preventDefault(); ev.stopPropagation();
|
|
47
|
+
var h = Math.max(1, document.documentElement.scrollHeight), w = Math.max(1, document.documentElement.clientWidth), c = info(e);
|
|
48
|
+
c.t = 'pin'; c.x = ev.pageX / w; c.y = ev.pageY / h; post(c); return;
|
|
49
|
+
}
|
|
50
|
+
if (mode === 'play') {
|
|
51
|
+
ev.preventDefault(); ev.stopPropagation();
|
|
52
|
+
post({ t: 'tap', el: e ? e.getAttribute('data-el') || '' : '', go: go ? (go.getAttribute('data-go') || (go.getAttribute('href') || '').slice(1)) : '' });
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (go) { ev.preventDefault(); show(go.getAttribute('data-go') || (go.getAttribute('href') || '').slice(1)); }
|
|
56
|
+
}, true);
|
|
57
|
+
var sel = function (id) {
|
|
58
|
+
Array.prototype.forEach.call(document.querySelectorAll('.pmos-sel'), function (x) { x.classList.remove('pmos-sel'); });
|
|
59
|
+
if (!id) return;
|
|
60
|
+
var e = document.querySelector('[data-el="' + String(id).replace(/[^A-Za-z0-9_-]/g, '') + '"]'); if (e) e.classList.add('pmos-sel');
|
|
61
|
+
};
|
|
62
|
+
var pins = function (list) {
|
|
63
|
+
Array.prototype.forEach.call(document.querySelectorAll('.pmos-pin'), function (x) { x.remove(); });
|
|
64
|
+
var h = document.documentElement.scrollHeight, w = document.documentElement.clientWidth;
|
|
65
|
+
(list || []).forEach(function (p) {
|
|
66
|
+
var d = document.createElement('span'); d.className = 'pmos-pin'; d.textContent = String(p.n);
|
|
67
|
+
var e = p.el ? document.querySelector('[data-el="' + String(p.el).replace(/[^A-Za-z0-9_-]/g, '') + '"]') : null;
|
|
68
|
+
if (e && e.offsetParent === null) return; // on another screen
|
|
69
|
+
if (e) { var r = e.getBoundingClientRect(); d.style.left = (r.right + window.scrollX - 4) + 'px'; d.style.top = (r.top + window.scrollY + 4) + 'px'; }
|
|
70
|
+
else if (p.x != null && p.y != null) { d.style.left = (p.x * w) + 'px'; d.style.top = (p.y * h) + 'px'; } else return;
|
|
71
|
+
document.body.appendChild(d);
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
window.addEventListener('message', function (ev) {
|
|
75
|
+
if (ev.source !== P) return;
|
|
76
|
+
var m = ev.data || {}; if (!m || m.pmos !== 1) return;
|
|
77
|
+
if (m.t === 'mode') { mode = m.mode; document.body.classList.toggle('pmos-point', mode === 'point'); document.body.classList.toggle('pmos-comment', mode === 'comment'); if (hov) { hov.classList.remove('pmos-hov'); hov = null; } }
|
|
78
|
+
else if (m.t === 'screen') show(m.id);
|
|
79
|
+
else if (m.t === 'copy' || m.t === 'copyAll') {
|
|
80
|
+
var all = m.t === 'copy' ? (function () { var o = {}; o[m.key] = m.text; return o; })() : (m.copy || {});
|
|
81
|
+
Object.keys(all).forEach(function (k) { Array.prototype.forEach.call(document.querySelectorAll('[data-copy="' + k.replace(/[^A-Za-z0-9_.-]/g, '') + '"]'), function (x) { x.textContent = String(all[k]); }); });
|
|
82
|
+
} else if (m.t === 'vars') Object.keys(m.vars || {}).forEach(function (k) { if (/^--[A-Za-z0-9-]+$/.test(k)) document.documentElement.style.setProperty(k, String(m.vars[k])); });
|
|
83
|
+
else if (m.t === 'hint') {
|
|
84
|
+
Array.prototype.forEach.call(document.querySelectorAll('.pmos-hint'), function (x) { x.classList.remove('pmos-hint'); });
|
|
85
|
+
(m.els || []).forEach(function (id) { var e = document.querySelector('[data-el="' + String(id).replace(/[^A-Za-z0-9_-]/g, '') + '"]'); if (e) e.classList.add('pmos-hint'); });
|
|
86
|
+
setTimeout(function () { Array.prototype.forEach.call(document.querySelectorAll('.pmos-hint'), function (x) { x.classList.remove('pmos-hint'); }); }, 1600);
|
|
87
|
+
} else if (m.t === 'sel') sel(m.el);
|
|
88
|
+
else if (m.t === 'pins') pins(m.pins);
|
|
89
|
+
});
|
|
90
|
+
var start = function () {
|
|
91
|
+
var all = screens(); if (all.length) all[0].classList.add('pmos-on');
|
|
92
|
+
var copy = {}; Array.prototype.forEach.call(document.querySelectorAll('[data-copy]'), function (x) { var k = x.getAttribute('data-copy'); if (!(k in copy)) copy[k] = (x.textContent || '').trim(); });
|
|
93
|
+
post({ t: 'ready', screens: all.map(function (s) { return { id: s.getAttribute('data-screen'), label: s.getAttribute('data-label') || '' }; }),
|
|
94
|
+
els: Array.prototype.map.call(document.querySelectorAll('[data-el]'), function (e) { return info(e); }), copy: copy });
|
|
95
|
+
};
|
|
96
|
+
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();
|
|
97
|
+
}
|
|
98
|
+
const SCRIPT = '<script>(' + runtime.toString() + ')();</script>';
|
|
99
|
+
/** The prototype's HTML with the runtime added before </body> (or at the end). */
|
|
100
|
+
function withRuntime(html) {
|
|
101
|
+
const s = String(html || ''), i = s.toLowerCase().lastIndexOf('</body>');
|
|
102
|
+
return i >= 0 ? s.slice(0, i) + SCRIPT + s.slice(i) : s + SCRIPT;
|
|
103
|
+
}
|
|
104
|
+
module.exports = { withRuntime, SCRIPT };
|
|
@@ -69,11 +69,11 @@ function grillAsk(ctx, key, text, wsId) {
|
|
|
69
69
|
: '[PMOS] The grill run did not start: ' + ((r && r.error) || 'no answer') + '. Say so in one line, and what would let it run.';
|
|
70
70
|
return { text: note + '\n\nThe PM says: ' + q, started: !!(r && r.ok) };
|
|
71
71
|
}
|
|
72
|
-
/** The live round (lib/live-round.js,
|
|
73
|
-
* ("B, but lead with the risk") in an initiative's chat.
|
|
74
|
-
*
|
|
75
|
-
* `pmos lab round --
|
|
76
|
-
function liveAsk(ctx, key, text, wsId) {
|
|
72
|
+
/** The live round (lib/live-round.js, initiatives live-round and live-round-iterative): "prototype this", "show 3 ways", or a change sentence
|
|
73
|
+
* on the version open ("make the alert orange", "B, but lead with the risk") in an initiative's chat. One version starts at once, no ✦ ask;
|
|
74
|
+
* a change sentence starts its next round at once; "N ways" goes to the chat's Claude with one rule: choose N directions and start them with
|
|
75
|
+
* `pmos lab round --dirs`, and build nothing in the chat. → { text, filed, live?: { id, ws, board } } | null */
|
|
76
|
+
function liveAsk(ctx, key, text, wsId, refs = []) {
|
|
77
77
|
const k = String(key || ''), q = String(text == null ? '' : text);
|
|
78
78
|
if (!/^init:/.test(k)) return null;
|
|
79
79
|
const ini = k.replace(/^init:/, '').replace(/:\d+$/, '');
|
|
@@ -82,15 +82,26 @@ function liveAsk(ctx, key, text, wsId) {
|
|
|
82
82
|
const dir = w && ctx.stateDirFor ? ctx.stateDirFor(w) : null;
|
|
83
83
|
const it = LR.intentOf(q, { waiting: dir ? LR.waiting(PR.read(dir), ini) : null });
|
|
84
84
|
if (!it || !w) return null;
|
|
85
|
+
// Wawan 2026-11-17 20:25, "iterative, like Claude Code design work": the round starts at once, no ✦ ask and no ✓. One version unless the
|
|
86
|
+
// PM asked for several; a change sentence while one is open is its next round. The Viewer shows it; the chat says what changed.
|
|
87
|
+
const live = (r) => (r && r.ok && r.round ? { id: r.round.proposal, ws: w.id, board: '' } : null);
|
|
88
|
+
const next = `From now on, when the PM asks to change the prototype, run \`pmos lab round ${ini} --ws ${w.id} --base <its letter> --brief "<the PM's words>"\` and say in one line what will change; a question about it you answer yourself.`;
|
|
85
89
|
if (it.kind === 'feedback') {
|
|
86
|
-
const r = LR.
|
|
87
|
-
const note = r.ok ? `[PMOS]
|
|
88
|
-
: '[PMOS] The
|
|
89
|
-
return { text: note + '\n\nThe PM says: ' + q, filed: !!r.ok };
|
|
90
|
+
const r = LR.startNow({ ws: w.id, ini, brief: q, base: it.base, from: 'chat', refs });
|
|
91
|
+
const note = r.ok ? `[PMOS] PMOS is making the next version of ${it.base} (version ${r.round.n}) now, about a minute${it.point ? ', about the element the PM pointed at (' + (it.point.label || it.point.el) + ')' : ''}; it replaces the one in the Viewer when it renders, and you will be told what changed. Say in one line what will change. Do not build it here.`
|
|
92
|
+
: '[PMOS] The new version did not start: ' + r.error + '. Say so in one line.';
|
|
93
|
+
return { text: note + '\n\nThe PM says: ' + q, filed: !!r.ok, live: live(r) };
|
|
90
94
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
if (it.count === 1) {
|
|
96
|
+
const r = LR.startNow({ ws: w.id, ini, brief: q, from: 'chat', count: 1, refs });
|
|
97
|
+
const note = r.ok ? '[PMOS] PMOS is making one prototype of this now (about a minute). It opens in the Viewer beside this chat as soon as it renders, and you will be told what was made. Say so in one line. Do not write HTML or build anything in this chat. ' + next
|
|
98
|
+
: '[PMOS] The prototype did not start: ' + r.error + '. Say so in one line, and what would let it run.';
|
|
99
|
+
return { text: note + '\n\nThe PM says: ' + q, filed: !!r.ok, live: live(r) };
|
|
100
|
+
}
|
|
101
|
+
const n = it.count === 2 ? 'two' : 'three', dirs = it.count === 2 ? 'A: <direction>|B: <direction>' : 'A: <direction>|B: <direction>|C: <direction>';
|
|
102
|
+
const note = `[PMOS] The PM asked to see ${n} ways. Do not write HTML or build anything in this chat. Choose ${n} clearly different directions, one short line each, then start them with exactly this one command: `
|
|
103
|
+
+ `\`pmos lab round ${ini} --ws ${w.id} --brief "<the PM's sentence>" --dirs "${dirs}"\`. `
|
|
104
|
+
+ `Then say in one line that the ${n} ways show side by side in the Viewer as each one renders, and that the PM picks one by naming it or pressing it. ` + next;
|
|
94
105
|
return { text: note + '\n\nThe PM says: ' + q, filed: false };
|
|
95
106
|
}
|
|
96
107
|
function iniInfoOf(ctx, key, wsId) {
|
|
@@ -166,9 +177,10 @@ async function post(req, res, url, ctx) {
|
|
|
166
177
|
if (!att.ok) { ctx.json(res, { ok: false, error: att.error }, att.status); return true; }
|
|
167
178
|
// batch 20 item 13: the PM can start a grill any time by asking for it in an initiative's chat; it also runs by itself
|
|
168
179
|
// the live round: "show 3 ways" or feedback on a round that waits (lib/live-round.js); a grill ask comes first
|
|
169
|
-
const g2 = grillAsk(ctx, b.key, b.text, wsId) || liveAsk(ctx, b.key, b.text, wsId);
|
|
180
|
+
const g2 = grillAsk(ctx, b.key, b.text, wsId) || liveAsk(ctx, b.key, b.text, wsId, att.paths);
|
|
170
181
|
const a = (ctx.chatSessions ? Ag.chat : Ag.ask)({ runtimeDir, key: b.key, text: Files.withFiles(g2 ? g2.text : b.text, att.paths), context: b.context, sessions: ctx.chatSessions, reportInfo: () => reportInfoOf(ctx, wsId, b.report), model: /^work:/.test(String(b.key || '')) ? WP.peekModel() : /^board:/.test(String(b.key || '')) ? BoardP.peekModel() : /^ins:/.test(String(b.key || '')) ? InsP.peekModel() : /^(init|doc):/.test(String(b.key || '')) ? InitP.peekModel() : sk || (/^src:/.test(String(b.key || '')) && !(b.key === 'src:this-page' && url.searchParams.get('ws'))) ? Prod.peekModel() : BP.peekModel(root), spawnSession: ctx.spawnSession, wsId, iniInfo: () => iniInfoOf(ctx, b.key, wsId) });
|
|
171
|
-
|
|
182
|
+
// a prototype round the sentence started: the page opens it in the Viewer (pm/home-app.js iniTarget onSent)
|
|
183
|
+
ctx.json(res, g2 && g2.live && a.body && a.body.ok ? { ...a.body, live: g2.live } : a.body, a.status);
|
|
172
184
|
return true;
|
|
173
185
|
}
|
|
174
186
|
let r;
|
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
* POST /api/lab/undo { ws, batch } → { ok } Undo of a keep or a drop (a started initiative stays: close it on the Board)
|
|
15
15
|
* POST /api/lab/round { ws?, board?, ini, brief, base?, dirs?, propose? } → the live round (lib/live-round.js): `pmos lab round` starts one,
|
|
16
16
|
* or with propose: true files its ✦ ask. No page press needed (D98); it writes no record.
|
|
17
|
+
* Prototype by chatting (initiative live-round-iterative): the compare view of a live round carries its version's companions as data
|
|
18
|
+
* (data: { flow, lanes, copy, tweaks, edits }, lib/live-round.js partsAt) and the initiative's comments; GET /api/lab/specimen with rt=1
|
|
19
|
+
* adds the canvas runtime (lib/proto-runtime.js) inside the same sandbox, so the canvas can point, pin, play and edit through postMessage.
|
|
20
|
+
* POST /api/lab/edit { ws, file, copy?: { key: text }, vars?: { --var: value } } → { ok } the PM's in-place copy edits and tweaks,
|
|
21
|
+
* kept with the version (edits.json next to it); the next version reads them
|
|
22
|
+
* POST /api/lab/comment { ws, ini, file, el?, label?, text, x?, y?, send? } → { ok, id } a comment pinned to an element (send: it was
|
|
23
|
+
* sent to PMOS as the next change; else it is kept for the team)
|
|
17
24
|
*
|
|
18
25
|
* The week's record lists every background job: the idle lab, the grill runs (lib/grill.js), the AI jobs through lib/ai-guard.js, and
|
|
19
26
|
* whatever the shared queue reports (ctx.bgQueue.record({ ws, since }) → [{ job, title, meta?, at, ini?, board? }], when it is there).
|
|
@@ -114,6 +121,12 @@ const READS = {
|
|
|
114
121
|
const c = LAB.compareOf(PR.read(dir), id, { key: url.searchParams.get('key') || '', titleOf: (ini) => (T.get(ini) || {}).title || '' });
|
|
115
122
|
if (!c) return fail(ctx, res, 404, 'That prototype is no longer here');
|
|
116
123
|
for (const col of c.columns) if (col.file) col.url = LAB.specimenUrl(col.file);
|
|
124
|
+
if (c.live) {
|
|
125
|
+
// the version's companions as data, and the comments on the initiative (Prototype by chatting)
|
|
126
|
+
const abs = c.file ? LAB.specimenPath(ctx.runtimeDir, c.file) : null;
|
|
127
|
+
if (abs) { c.url = LAB.specimenUrl(c.file); c.data = require('./live-round.js').partsAt(abs); }
|
|
128
|
+
c.comments = commentsOf(dir, c.ini);
|
|
129
|
+
}
|
|
117
130
|
ctx.json(res, { ok: true, compare: c });
|
|
118
131
|
return true;
|
|
119
132
|
},
|
|
@@ -141,6 +154,8 @@ const READS = {
|
|
|
141
154
|
let html = null;
|
|
142
155
|
try { html = f ? fs.readFileSync(f) : null; } catch { html = null; }
|
|
143
156
|
if (!html) return fail(ctx, res, 404, 'That specimen is not in the idle lab folder');
|
|
157
|
+
// the canvas runtime (lib/proto-runtime.js): only on rt=1, inside the same sandbox CSP, so the page still cannot reach PMOS
|
|
158
|
+
if (url.searchParams.get('rt') === '1') html = require('./proto-runtime.js').withRuntime(html.toString('utf8'));
|
|
144
159
|
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8', 'Content-Security-Policy': CSP, 'X-Content-Type-Options': 'nosniff', 'Cache-Control': 'private, no-cache', 'Referrer-Policy': 'no-referrer' });
|
|
145
160
|
res.end(html);
|
|
146
161
|
return true;
|
|
@@ -181,14 +196,51 @@ const WRITES = {
|
|
|
181
196
|
ctx.json(res, { ok: true });
|
|
182
197
|
return true;
|
|
183
198
|
},
|
|
199
|
+
'/api/lab/edit': (ctx, res, body, g, w, dir) => {
|
|
200
|
+
const abs = liveFile(ctx, body.file); if (!abs) return fail(ctx, res, 404, 'That version is not in the live round folder');
|
|
201
|
+
const LR = require('./live-round.js'), f = require('path').join(require('path').dirname(abs), 'edits.json');
|
|
202
|
+
let was = {}; try { was = JSON.parse(fs.readFileSync(f, 'utf8')); } catch { was = {}; }
|
|
203
|
+
const add = LR.editsOf({ copy: body.copy, vars: body.vars }), old = LR.editsOf(was);
|
|
204
|
+
const next = { copy: { ...old.copy, ...add.copy }, vars: { ...old.vars, ...add.vars } };
|
|
205
|
+
try { fs.writeFileSync(f, JSON.stringify(next, null, 1)); } catch { return fail(ctx, res, 500, 'The edit was not saved'); }
|
|
206
|
+
ctx.json(res, { ok: true, edits: next });
|
|
207
|
+
return true;
|
|
208
|
+
},
|
|
209
|
+
'/api/lab/comment': (ctx, res, body, g, w, dir) => {
|
|
210
|
+
const ini = String(body.ini || ''), text = typeof body.text === 'string' ? body.text.replace(/\s+/g, ' ').trim().slice(0, 500) : '';
|
|
211
|
+
if (!ID_RE.test(ini) || !text) return fail(ctx, res, 400, 'ini and text name the initiative and the comment');
|
|
212
|
+
if (!liveFile(ctx, body.file)) return fail(ctx, res, 404, 'That version is not in the live round folder');
|
|
213
|
+
const id = 'cm' + Date.now().toString(36) + require('crypto').randomBytes(2).toString('hex');
|
|
214
|
+
const num = (v) => (Number.isFinite(Number(v)) ? Math.max(0, Math.min(1, Number(v))) : null);
|
|
215
|
+
const line = { at: new Date().toISOString(), by: (g.actor && g.actor.by) || null, id, ini, file: String(body.file), el: /^[A-Za-z0-9][A-Za-z0-9_-]{0,59}$/.test(String(body.el || '')) ? body.el : '',
|
|
216
|
+
label: String(body.label || '').replace(/\s+/g, ' ').trim().slice(0, 80), text, x: num(body.x), y: num(body.y), send: body.send === true };
|
|
217
|
+
try { fs.appendFileSync(require('path').join(dir, COMMENTS), JSON.stringify(line) + '\n'); } catch { return fail(ctx, res, 500, 'The comment was not saved'); }
|
|
218
|
+
ctx.json(res, { ok: true, id });
|
|
219
|
+
return true;
|
|
220
|
+
},
|
|
184
221
|
};
|
|
222
|
+
const COMMENTS = 'lab-comments.jsonl';
|
|
223
|
+
/** A live round's version file, by its specimen path (<round>/<key>/<key>.html): the absolute path, or null. */
|
|
224
|
+
function liveFile(ctx, file) {
|
|
225
|
+
const f = String(file || '');
|
|
226
|
+
if (!/^lr[0-9a-z]+\/[A-C]\/[a-c]\.html$/.test(f)) return null;
|
|
227
|
+
const abs = LAB.specimenPath(ctx.runtimeDir, f);
|
|
228
|
+
try { return abs && fs.statSync(abs).isFile() ? abs : null; } catch { return null; }
|
|
229
|
+
}
|
|
230
|
+
/** The comments on an initiative's prototype, oldest first, the last 60. */
|
|
231
|
+
function commentsOf(dir, ini) {
|
|
232
|
+
let lines = []; try { lines = fs.readFileSync(require('path').join(dir, COMMENTS), 'utf8').split('\n'); } catch { return []; }
|
|
233
|
+
const out = [];
|
|
234
|
+
for (const l of lines) { if (!l) continue; try { const c = JSON.parse(l); if (c && c.ini === ini) out.push({ id: c.id, at: c.at, by: c.by, file: c.file, el: c.el, label: c.label, text: c.text, x: c.x, y: c.y, send: !!c.send }); } catch { /* a torn line */ } }
|
|
235
|
+
return out.slice(-60);
|
|
236
|
+
}
|
|
185
237
|
/** POST /api/lab/round { ws?, board?, ini, brief, base?, dirs?, propose?, from?, by? } → { ok, round, runs } | { ok, id, said } (propose) */
|
|
186
238
|
function liveRound(ctx, res, b) {
|
|
187
239
|
const LR = require('./live-round.js');
|
|
188
240
|
const w = wsOf(ctx, typeof b.ws === 'string' && b.ws ? b.ws : null); if (!w) return fail(ctx, res, 404, 'no such workspace');
|
|
189
241
|
const by = /^(pm|agent):[\w.:-]{1,80}$/.test(String(b.by || '')) ? b.by : 'agent:cli';
|
|
190
242
|
const input = { ws: w.id, board: typeof b.board === 'string' ? b.board : '', ini: String(b.ini || ''), brief: String(b.brief || ''), base: /^[A-C]$/i.test(String(b.base || '')) ? String(b.base).toUpperCase() : '',
|
|
191
|
-
dirs: typeof b.dirs === 'string' ? b.dirs : '', from: b.from === 'meeting' ? 'meeting' : b.propose ? 'chat' : 'cli', by };
|
|
243
|
+
dirs: typeof b.dirs === 'string' ? b.dirs : '', from: b.from === 'meeting' ? 'meeting' : b.propose ? 'chat' : 'cli', by, ...(b.one === true ? { count: 1 } : {}) };
|
|
192
244
|
const r = b.propose === true ? LR.proposeNow(input) : LR.startNow(input);
|
|
193
245
|
if (!r.ok) return fail(ctx, res, 409, r.error);
|
|
194
246
|
ctx.json(res, r);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.592.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.592.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
package/workspace/panels-test.js
CHANGED
|
@@ -62,7 +62,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
62
62
|
await T.waitForServer(BASE);
|
|
63
63
|
browser = await chromium.launch({ executablePath: exe });
|
|
64
64
|
|
|
65
|
-
const open = async ({ w = 1440, h = 900, dark = false, ctx = null, q = '', at = '/premium.html', ready = () => !!window.czPanels && document.querySelectorAll('#hmList .hv-r.ini .hm-rm').length > 2 } = {}) => {
|
|
65
|
+
const open = async ({ w = 1440, h = 900, dark = false, ctx = null, q = '', at = '/premium.html', ready = () => { document.querySelectorAll('#hmList .hv-fold[aria-expanded="false"]').forEach((b) => b.click()); return !!window.czPanels && document.querySelectorAll('#hmList .hv-r.ini .hm-rm').length > 2; } } = {}) => {
|
|
66
|
+
// Home shows only the rows with a call (home-nav-rows-with-a-call): the default ready opens every folded group, so the rows this suite drags are there
|
|
66
67
|
ctx = ctx || await browser.newContext({ viewport: { width: w, height: h }, colorScheme: dark ? 'dark' : 'light' });
|
|
67
68
|
const page = await ctx.newPage();
|
|
68
69
|
const errors = [];
|
|
@@ -132,7 +132,8 @@ const routePrograms = async (page) => {
|
|
|
132
132
|
await routePrograms(page);
|
|
133
133
|
const am = new Date(); am.setHours(10, 0, 0, 0); await page.clock.setFixedTime(am);
|
|
134
134
|
await page.goto(BASE + '/premium.html?theme=light');
|
|
135
|
-
|
|
135
|
+
// Home shows only the rows with a call (home-nav-rows-with-a-call): open the program's "N more" so every row of its order shows
|
|
136
|
+
await until(() => page.evaluate(() => { document.querySelectorAll('#hmList .hv-g.prg .hv-fold[aria-expanded="false"]').forEach((b) => b.click()); return !!document.querySelector('#hmList .hv-g.prg [data-po-id]') && document.body.dataset.hmTop === '1'; }), 20000);
|
|
136
137
|
return { ctx, page, errors };
|
|
137
138
|
};
|
|
138
139
|
const hkids = (p) => p.evaluate(() => [...document.querySelectorAll('#hmList .hv-g.prg [data-po-id]')].map((r) => r.dataset.poId));
|
|
@@ -346,6 +346,14 @@ form.hm-box textarea { min-height: 48px; border: 0; background: none; resize: no
|
|
|
346
346
|
.hm-ath { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; margin-left: -6px; }
|
|
347
347
|
.hm-att button { border: 0; background: none; cursor: pointer; width: 28px; height: 28px; border-radius: 999px; color: var(--cz-ink3); }
|
|
348
348
|
@media (pointer: coarse), (max-width: 760px) { .hm-att button { width: 44px; height: 44px; margin: -8px -6px -8px -10px; } .hm-tb .hm-tool { width: 44px; height: 44px; } }
|
|
349
|
+
/* Prototype by chatting (pm/cozy-proto.js): the element pointed at and "From version n" in the box and in a bubble; a reply's Version n tag */
|
|
350
|
+
.hm-markc { color: var(--cz-blueink); background: var(--cz-bluebg); }
|
|
351
|
+
.hm-markc svg { flex: none; }
|
|
352
|
+
.hm-marks { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
|
|
353
|
+
.hm-mark { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--cz-card); color: var(--cz-blueink); font-size: var(--fs-meta); font-weight: var(--fw-strong); line-height: var(--lh-meta); }
|
|
354
|
+
.hm-ver { display: inline-flex; align-items: center; height: 24px; margin: 0 0 4px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink); font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-strong); cursor: pointer; }
|
|
355
|
+
.hm-ver:hover { border-color: var(--cz-blue); color: var(--cz-blueink); }
|
|
356
|
+
.hm-ver:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
349
357
|
.hm-chat.hm-drop { outline: 2px dashed var(--cz-blue); outline-offset: -8px; }
|
|
350
358
|
.hm-scope { display: flex; align-items: center; gap: 8px; }
|
|
351
359
|
.hm-scope .sp { flex: 1; }
|
|
@@ -10,15 +10,18 @@
|
|
|
10
10
|
* why (lib/idle-lab.js PROVEN). A press on a round in History puts it in the Prototype column. ✓ and ✕ in the
|
|
11
11
|
* header keep or drop the round shown; ⤢ presents it on a clean screen in a new tab (GET /pm/present).
|
|
12
12
|
* A live round (lib/live-round.js, data.live): the card shows each version as it lands (working, made, not made); its ask (group live)
|
|
13
|
-
* says the directions, ✓ starts it. Its compare view
|
|
13
|
+
* says the directions, ✓ starts it. Its compare view is the one canvas of Prototype by chatting (pm/cozy-proto.js): the prototype, its
|
|
14
|
+
* flow, its copy and who does what, with A B C in a tray when the PM asked for several; ✓ keeps the one shown.
|
|
14
15
|
* Every specimen loads from GET /api/lab/specimen in a sandboxed frame: it cannot reach PMOS. Nothing is written before the PM's ✓. */
|
|
15
16
|
import { pmGet, pmPost } from './http.js';
|
|
17
|
+
import * as PC from './cozy-proto.js'; // a live round's compare view is the one canvas (Prototype by chatting)
|
|
16
18
|
|
|
17
19
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
18
20
|
const SVG = (d, w = 16, sw = 1.8) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
19
21
|
export const I = {
|
|
20
22
|
proto: 'M3 4h18v14H3zM3 9h18', round: 'M3 12a9 9 0 1 0 3-6.7L3 8M3 3v5h5', scan: 'M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18M12 3a15 15 0 0 1 0 18M3 12h18',
|
|
21
23
|
open: 'M7 17 17 7M8 7h9v9', check: 'M5 12l5 5 9-10', x: 'M6 6l12 12M18 6L6 18', present: 'M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7',
|
|
24
|
+
prev: 'M15 6l-6 6 6 6', next: 'M9 6l6 6-6 6',
|
|
22
25
|
};
|
|
23
26
|
const GROUPS = ['prototyped', 'improved', 'scanned', 'live'];
|
|
24
27
|
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
@@ -102,7 +105,7 @@ export function cardHtml(p, { why = false } = {}) {
|
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
/* ── the compare view (I3) ── */
|
|
105
|
-
const C = { at: null, id: null, key: '', c: null, H: null, timer: null };
|
|
108
|
+
const C = { at: null, id: null, key: '', c: null, H: null, timer: null, wided: false };
|
|
106
109
|
async function read() {
|
|
107
110
|
const at = C.at || {};
|
|
108
111
|
return pmGet('/api/lab/compare?ws=' + encodeURIComponent(at.ws || '') + '&board=' + encodeURIComponent(at.board || '') + '&id=' + encodeURIComponent(C.id) + (C.key ? '&key=' + encodeURIComponent(C.key) : '')).catch(() => null);
|
|
@@ -135,7 +138,9 @@ export const presentUrl = (at, c) => '/pm/present?ws=' + encodeURIComponent((at
|
|
|
135
138
|
function draw() {
|
|
136
139
|
const VW = window.czViewer, b = VW && VW.body(), cur = VW && VW.current();
|
|
137
140
|
if (!b || !cur || cur.id !== 'lab:cmp' || !C.c) return;
|
|
138
|
-
|
|
141
|
+
// a live round: the one canvas (pm/cozy-proto.js) draws and keeps its frame while the view reads again
|
|
142
|
+
if (C.c.live) PC.draw(b, C.c, { at: C.at, H: { ...(C.H || {}), load } });
|
|
143
|
+
else b.innerHTML = bodyHtml(C.c);
|
|
139
144
|
VW.setPresses(cur.id, presses(C.c));
|
|
140
145
|
if (VW.retitle) VW.retitle(cur.id, C.c.title);
|
|
141
146
|
}
|
|
@@ -143,8 +148,8 @@ async function load() {
|
|
|
143
148
|
const r = await read();
|
|
144
149
|
if (!r || r.ok === false) { const b = window.czViewer && window.czViewer.body(); if (b) b.innerHTML = `<p class="pp-none">${esc((r && r.error) || 'The prototype could not be read.')}</p>`; return; }
|
|
145
150
|
C.c = r.compare; C.key = r.compare.key;
|
|
146
|
-
// two or three columns side by side need the room: the Viewer opens wide (one column stays as it is)
|
|
147
|
-
if (C.c.columns.filter((x) => !x.left).length > 1 && window.czViewer.wide) window.czViewer.wide(true);
|
|
151
|
+
// the canvas, or two or three columns side by side, need the room: the Viewer opens wide (one idle-lab column stays as it is)
|
|
152
|
+
if ((C.c.live || C.c.columns.filter((x) => !x.left).length > 1) && window.czViewer.wide && !C.wided) { C.wided = true; window.czViewer.wide(true); }
|
|
148
153
|
draw();
|
|
149
154
|
// a live round: its versions land one by one, so the view reads again while one is made
|
|
150
155
|
clearTimeout(C.timer);
|
|
@@ -168,13 +173,16 @@ async function act(a) {
|
|
|
168
173
|
}
|
|
169
174
|
export function openCompare({ where, id, key = '', H = null } = {}) {
|
|
170
175
|
const VW = window.czViewer; if (!VW || !id) return;
|
|
171
|
-
|
|
176
|
+
// already open (the chat started the next version, or a Version n tag): the canvas switches in place and keeps its frame
|
|
177
|
+
const cur = VW.current();
|
|
178
|
+
if (cur && cur.id === 'lab:cmp' && C.c) { Object.assign(C, { at: where || C.at, id, key, H: H || C.H }); load(); return; }
|
|
179
|
+
Object.assign(C, { at: where || {}, id, key, c: null, H, wided: false });
|
|
172
180
|
VW.drill();
|
|
173
181
|
VW.open({ id: 'lab:cmp', kind: 'Prototype', title: 'Prototype', icon: I.proto, presses: [], onPress: (a) => act(a),
|
|
174
182
|
render: (b) => {
|
|
175
183
|
b.innerHTML = '<p class="pp-none">Reading the prototype.</p>';
|
|
176
184
|
b.onclick = (e) => {
|
|
177
|
-
const r = e.target.closest('[data-lab-round]'); if (r) { C.id = r.dataset.labRound; C.key = ''; load(); return; }
|
|
185
|
+
const r = e.target.closest('[data-lab-round]'); if (r) { if (!r.dataset.labRound) return; C.id = r.dataset.labRound; C.key = ''; load(); return; }
|
|
178
186
|
const k = e.target.closest('[data-lab-key]'); if (k) { C.key = k.dataset.labKey; load(); return; }
|
|
179
187
|
const col = e.target.closest('.lab-col[data-lab-col]'); if (col && C.c && C.c.live) { C.key = col.dataset.labCol; load(); }
|
|
180
188
|
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/* cozy-proto.css — Prototype by chatting, the Viewer as one canvas (pm/cozy-proto.js; initiative live-round-iterative, main canvas boards
|
|
2
|
+
* PbcChat, PbcPoint, PbcLanes, PbcDesk, PbcPlay). The cozy tokens for colour, the agreed type roles (--fs-/--fw-/--lh-), no new look.
|
|
3
|
+
* Loaded once by pm/cozy-proto.js. */
|
|
4
|
+
.cz-vw-w2 .cz-vw-body > .pc, .cz-vw-body > .pc { grid-column: 1 / -1; max-width: none; }
|
|
5
|
+
.pc { position: relative; display: flex; flex-direction: column; gap: 10px; font-family: var(--cz-sans); color: var(--cz-ink); min-height: 0; }
|
|
6
|
+
.pc .pc-ib { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; color: var(--cz-ink2); background: var(--cz-card); border: 1px solid var(--cz-hair); cursor: pointer; }
|
|
7
|
+
.pc .pc-ib:hover { color: var(--cz-ink); }
|
|
8
|
+
.pc .pc-ib[aria-pressed="true"] { background: var(--cz-bluebg); color: var(--cz-blueink); border-color: transparent; }
|
|
9
|
+
.pc .pc-ib.blue { background: var(--cz-blueink); color: var(--cz-onsolid); border-color: transparent; }
|
|
10
|
+
.pc .pc-ib[disabled] { opacity: .35; pointer-events: none; }
|
|
11
|
+
.pc button:focus-visible, .pc [role="button"]:focus-visible, .pc [contenteditable]:focus-visible, .pc textarea:focus-visible, .pc input:focus-visible { outline: 2px solid var(--cz-blue); outline-offset: 2px; }
|
|
12
|
+
|
|
13
|
+
/* the toolbar */
|
|
14
|
+
.pc-bar { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
|
15
|
+
.pc-grp { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: var(--cz-well); }
|
|
16
|
+
.pc-grp .pc-ib { border-color: transparent; background: transparent; }
|
|
17
|
+
.pc-grp .pc-ib[aria-pressed="true"] { background: var(--cz-card); color: var(--cz-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
|
|
18
|
+
.pc-ver { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--cz-ink2); }
|
|
19
|
+
.pc-ver b { font-weight: var(--fw-strong); padding: 0 4px; white-space: nowrap; }
|
|
20
|
+
.pc-sp { flex: 1; }
|
|
21
|
+
.pc-z { min-width: 40px; text-align: center; font-size: var(--fs-meta); color: var(--cz-ink2); }
|
|
22
|
+
|
|
23
|
+
/* the 3-ways tray */
|
|
24
|
+
.pc-tray { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--cz-hair); border-radius: 14px; background: var(--cz-card); overflow-x: auto; }
|
|
25
|
+
.pc-tl { font-size: var(--fs-meta); color: var(--cz-ink3); white-space: nowrap; }
|
|
26
|
+
.pc-th { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--cz-hair); border-radius: 10px; background: var(--cz-card); cursor: pointer; font: inherit; color: var(--cz-ink2); }
|
|
27
|
+
.pc-th[aria-pressed="true"] { border-color: var(--cz-blue); color: var(--cz-blueink); }
|
|
28
|
+
.pc-th b { font-size: var(--fs-meta); font-weight: var(--fw-strong); }
|
|
29
|
+
.pc-th small { font-size: var(--fs-badge); color: var(--cz-ink3); max-width: 90px; text-align: center; }
|
|
30
|
+
.pc-th.wk { cursor: default; }
|
|
31
|
+
.pc-thf { display: block; position: relative; width: 56px; height: 96px; overflow: hidden; border-radius: 6px; background: var(--cz-well); pointer-events: none; }
|
|
32
|
+
.pc-thf iframe { position: absolute; left: 0; top: 0; width: 390px; height: 670px; border: 0; transform: scale(.1436); transform-origin: 0 0; background: var(--cz-c-ffffff); }
|
|
33
|
+
.pc-tacts { margin-left: auto; display: inline-flex; gap: 4px; }
|
|
34
|
+
|
|
35
|
+
/* the canvas */
|
|
36
|
+
.pc-vp { overflow: auto; border-radius: 16px; background-color: var(--cz-well); background-image: radial-gradient(var(--cz-hair) 1px, transparent 1px); background-size: 16px 16px; padding: 14px; min-height: 420px; }
|
|
37
|
+
.pc-board { display: grid; grid-template-columns: auto minmax(520px, 820px); grid-template-areas: "proto col" "lanes lanes"; gap: 16px; align-items: start; width: max-content; min-width: 100%; }
|
|
38
|
+
.pc-proto { grid-area: proto; }
|
|
39
|
+
.pc-col { grid-area: col; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
|
|
40
|
+
.pc-lanesc { grid-area: lanes; }
|
|
41
|
+
.pc-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--cz-hair); border-radius: 16px; background: var(--cz-card); min-width: 0; }
|
|
42
|
+
.pc-card h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: var(--fs-row); font-weight: var(--fw-strong); line-height: var(--lh-row); }
|
|
43
|
+
.pc-upd { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--cz-okbg); color: var(--cz-ok); font-size: var(--fs-badge); font-weight: var(--fw-strong); line-height: var(--lh-badge); }
|
|
44
|
+
.pc-hint { margin: 0; font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--cz-ink3); }
|
|
45
|
+
.pc-none { margin: 0; font-size: var(--fs-body); color: var(--cz-ink3); }
|
|
46
|
+
.pc-making { margin: 0; display: flex; align-items: center; gap: 5px; font-size: var(--fs-meta); color: var(--cz-blueink); }
|
|
47
|
+
.pc-making i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; animation: pcPulse 1.2s ease-in-out infinite; }
|
|
48
|
+
.pc-making i:nth-child(2) { animation-delay: .2s; } .pc-making i:nth-child(3) { animation-delay: .4s; }
|
|
49
|
+
@keyframes pcPulse { 50% { opacity: 1; } }
|
|
50
|
+
@media (prefers-reduced-motion: reduce) { .pc-making i { animation: none; opacity: .7; } }
|
|
51
|
+
|
|
52
|
+
/* the prototype in its frame */
|
|
53
|
+
.pc-dev { position: relative; }
|
|
54
|
+
.pc-dev.phone { width: 300px; padding: 10px; border-radius: 34px; background: var(--cz-ink); }
|
|
55
|
+
.pc-dev.phone .pc-frame { height: 600px; border-radius: 26px; }
|
|
56
|
+
.pc-dev.desktop { width: 760px; padding: 26px 0 0; border-radius: 12px; background: var(--cz-well2, var(--cz-well)); border: 1px solid var(--cz-hair); }
|
|
57
|
+
.pc-dev.desktop::before { content: ''; position: absolute; left: 12px; top: 10px; width: 36px; height: 8px; border-radius: 4px; background: radial-gradient(circle at 4px 4px, var(--cz-hair) 3.5px, transparent 4px) 0 0 / 14px 8px repeat-x; }
|
|
58
|
+
.pc-dev.desktop .pc-frame { height: 480px; border-radius: 0 0 12px 12px; }
|
|
59
|
+
.pc-frame { position: relative; overflow: hidden; background: var(--cz-c-ffffff); }
|
|
60
|
+
.pc-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--cz-c-ffffff); }
|
|
61
|
+
.pc-frame .pc-none { padding: 20px; }
|
|
62
|
+
.pc-ink { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; border-radius: inherit; }
|
|
63
|
+
.pc-inkacts { position: absolute; right: 8px; bottom: 8px; display: inline-flex; gap: 4px; }
|
|
64
|
+
.pc-sel { margin: 0; display: flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--cz-ink2); max-width: 300px; }
|
|
65
|
+
.pc-sel b { color: var(--cz-blueink); font-weight: var(--fw-strong); white-space: nowrap; }
|
|
66
|
+
.pc-sel .pc-ib { width: 26px; height: 26px; margin-left: auto; }
|
|
67
|
+
.pc-tw { display: flex; flex-direction: column; gap: 6px; max-width: 300px; }
|
|
68
|
+
.pc-tw label { display: grid; grid-template-columns: 70px 1fr 52px; align-items: center; gap: 8px; font-size: var(--fs-meta); color: var(--cz-ink2); }
|
|
69
|
+
.pc-tw input { width: 100%; accent-color: var(--cz-blueink); }
|
|
70
|
+
.pc-tw em { font-style: normal; text-align: right; color: var(--cz-ink3); }
|
|
71
|
+
.pc-cdraft { display: flex; flex-direction: column; gap: 6px; max-width: 300px; }
|
|
72
|
+
.pc-cdraft label { font-size: var(--fs-meta); color: var(--cz-ink2); }
|
|
73
|
+
.pc-cdraft textarea { font: inherit; font-size: var(--fs-body); padding: 8px 10px; border-radius: 10px; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink); resize: vertical; }
|
|
74
|
+
.pc-cdraft > span { display: inline-flex; gap: 4px; }
|
|
75
|
+
.pc-cms { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: 300px; }
|
|
76
|
+
.pc-cms li { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-body); line-height: var(--lh-body); }
|
|
77
|
+
.pc-cms .w { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
78
|
+
.pc-cms small { font-size: var(--fs-meta); color: var(--cz-ink3); }
|
|
79
|
+
.pc-pin { width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--cz-risk); color: var(--cz-onsolid); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-badge); font-weight: var(--fw-strong); }
|
|
80
|
+
.pc-sug { display: flex; align-items: flex-start; gap: 8px; max-width: 300px; padding: 10px; border-radius: 14px; background: var(--cz-bluebg); }
|
|
81
|
+
.pc-sug p { margin: 0; flex: 1; font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--cz-ink2); }
|
|
82
|
+
.pc-star { color: var(--cz-blueink); font-weight: var(--fw-strong); }
|
|
83
|
+
|
|
84
|
+
/* the flow and the swimlane (SVG) */
|
|
85
|
+
.pc-svgw { overflow-x: auto; }
|
|
86
|
+
.pc-flow, .pc-lanes { display: block; color: var(--cz-ink3); font-family: var(--cz-sans); }
|
|
87
|
+
.pc-flow text, .pc-lanes text { font-size: 11px; fill: var(--cz-ink); }
|
|
88
|
+
.pc-sn { cursor: pointer; }
|
|
89
|
+
.pc-sn rect { fill: var(--cz-card); stroke: var(--cz-hair); stroke-width: 1.2; }
|
|
90
|
+
.pc-sn.br rect { stroke: var(--cz-ok); stroke-dasharray: 4 3; }
|
|
91
|
+
.pc-sn.on rect, .pc-sn:hover rect, .pc-sn:focus-visible rect { stroke: var(--cz-blue); stroke-width: 2; }
|
|
92
|
+
.pc-sn .k { font-size: 8px; font-weight: var(--fw-strong); letter-spacing: .06em; fill: var(--cz-ink3); }
|
|
93
|
+
.pc-dn path { fill: var(--cz-bluebg); stroke: var(--cz-blueink); stroke-width: 1.2; }
|
|
94
|
+
.pc-dn text { font-size: 10px; }
|
|
95
|
+
.pc-e path { fill: none; stroke: currentColor; stroke-width: 1.3; }
|
|
96
|
+
.pc-e.br path { stroke-dasharray: 4 3; }
|
|
97
|
+
.pc-e .hit { stroke: transparent; stroke-width: 12; stroke-dasharray: none; cursor: pointer; }
|
|
98
|
+
.pc-e[data-pc-scen]:hover path:not(.hit), .pc-e[data-pc-scen]:focus-visible path:not(.hit) { stroke: var(--cz-blue); }
|
|
99
|
+
.pc-e text { font-size: 9px; fill: var(--cz-ink3); }
|
|
100
|
+
.pc-ln rect { fill: var(--cz-card); }
|
|
101
|
+
.pc-ln.alt rect { fill: var(--cz-well); }
|
|
102
|
+
.pc-ln text { font-weight: var(--fw-strong); }
|
|
103
|
+
.pc-ar { fill: none; stroke: currentColor; stroke-width: 1.3; }
|
|
104
|
+
.pc-bx rect { fill: var(--cz-bluebg); stroke: transparent; }
|
|
105
|
+
.pc-bx[data-pc-screen] { cursor: pointer; }
|
|
106
|
+
.pc-bx[data-pc-screen]:hover rect, .pc-bx:focus-visible rect { stroke: var(--cz-blue); stroke-width: 1.5; }
|
|
107
|
+
.pc-bx.ch rect { stroke: var(--cz-ok); stroke-width: 1.5; stroke-dasharray: 4 3; }
|
|
108
|
+
.pc-bx circle { fill: var(--cz-blueink); }
|
|
109
|
+
.pc-bx .n { fill: var(--cz-onsolid); font-size: 10px; font-weight: var(--fw-strong); }
|
|
110
|
+
.pc-scens { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
111
|
+
.pc-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--cz-hair); background: var(--cz-card); color: var(--cz-ink2); font: inherit; font-size: var(--fs-meta); cursor: pointer; }
|
|
112
|
+
.pc-chip[aria-pressed="true"] { background: var(--cz-bluebg); color: var(--cz-blueink); border-color: transparent; }
|
|
113
|
+
|
|
114
|
+
/* the page copy */
|
|
115
|
+
.pc-copy { display: flex; flex-direction: column; border: 1px solid var(--cz-hair); border-radius: 12px; overflow: hidden; }
|
|
116
|
+
.pc-cr { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--cz-hair); font-size: var(--fs-body); line-height: var(--lh-body); }
|
|
117
|
+
.pc-cr:first-child { border-top: 0; }
|
|
118
|
+
.pc-cr > span:first-child { font-size: var(--fs-meta); color: var(--cz-ink3); }
|
|
119
|
+
.pc-cr [contenteditable] { border-radius: 6px; padding: 0 4px; margin: 0 -4px; }
|
|
120
|
+
.pc-cr [contenteditable]:hover { background: var(--cz-well); }
|
|
121
|
+
.pc-cr.ch [contenteditable] { box-shadow: inset 2px 0 0 var(--cz-ok); }
|
|
122
|
+
|
|
123
|
+
/* Play */
|
|
124
|
+
.pc-play { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 16px; background: var(--cz-card); }
|
|
125
|
+
.pc-pbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
|
|
126
|
+
.pc-pstep { margin: 0; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--cz-ink2); }
|
|
127
|
+
.pc-pstep b { color: var(--cz-ink); font-weight: var(--fw-strong); }
|
|
128
|
+
.pc-pframe { flex: 1; min-height: 0; align-self: center; width: 100%; display: flex; justify-content: center; }
|
|
129
|
+
.pc-pframe iframe { border: 0; background: var(--cz-c-ffffff); height: 100%; min-height: 560px; }
|
|
130
|
+
.pc-pframe.phone iframe { width: 390px; border-radius: 26px; box-shadow: 0 0 0 10px var(--cz-ink); margin: 10px; }
|
|
131
|
+
.pc-pframe.desktop iframe { width: 100%; border-radius: 12px; border: 1px solid var(--cz-hair); }
|
|
132
|
+
|
|
133
|
+
@media (max-width: 760px) {
|
|
134
|
+
.pc-board { grid-template-columns: 1fr; grid-template-areas: "proto" "col" "lanes"; width: auto; }
|
|
135
|
+
.pc .pc-ib { width: 44px; height: 44px; }
|
|
136
|
+
.pc-dev.desktop { width: 100%; }
|
|
137
|
+
.pc-pframe.phone iframe { width: 100%; box-shadow: none; margin: 0; }
|
|
138
|
+
}
|