cladogram 0.6.0-beta.3 → 0.6.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -44
- package/docs/agent-context.md +62 -0
- package/docs/agent-reference.md +126 -0
- package/docs/release.md +18 -0
- package/package.json +3 -1
- package/plugins/agent/index.js +266 -134
- package/plugins/agent/style.css +54 -45
- package/plugins/view-controls/index.js +0 -11
- package/plugins/view-controls/style.css +0 -7
- package/skills/clado/SKILL.md +1 -1
- package/src/agent/pi-bridge.js +92 -8
- package/src/agent/pi-config.js +97 -57
- package/src/html/app-css.js +69 -1
- package/src/html/canvas-chain.js +6 -4
- package/src/html/canvas-live-diff.js +329 -0
- package/src/html/canvas-ui.css +146 -2
- package/src/html/page.js +4 -2
- package/src/html/runtime-api.js +6 -0
- package/src/html/runtime.js +453 -11
- package/src/server/agent.js +15 -0
- package/src/server/assets/library-canvas.js +12 -4
- package/src/server/assets/library.css +139 -0
- package/src/server/assets/library.js +90 -18
- package/src/server/workspace.js +6 -1
package/src/html/app-css.js
CHANGED
|
@@ -296,9 +296,77 @@ body.dragging, body.dragging *{user-select:none; -webkit-user-select:none}
|
|
|
296
296
|
.zoomable foreignObject{overflow:visible; text-align:center}
|
|
297
297
|
.zoomable foreignObject > div{text-align:center}
|
|
298
298
|
/* 代码块也点得开 —— 代码可能写得很长,塞在卡片里只能看个开头 */
|
|
299
|
-
.zoomable.zcode{padding:0; border:0; background:transparent; overflow:visible}
|
|
299
|
+
.zoomable.zcode{position:relative; padding:0; border:0; background:transparent; overflow:visible}
|
|
300
300
|
.zoomable.zcode pre{margin:0 !important}
|
|
301
301
|
.zoomable.zcode:hover pre{border-color:var(--accent)}
|
|
302
|
+
.zcode-preview-btn{
|
|
303
|
+
position:absolute; top:6px; right:6px; z-index:3;
|
|
304
|
+
appearance:none; border:1px solid var(--line-2); border-radius:6px;
|
|
305
|
+
background:color-mix(in srgb, var(--panel) 88%, transparent);
|
|
306
|
+
color:var(--fg-2); font:inherit; font-size:10.5px; font-weight:560;
|
|
307
|
+
padding:2px 7px; cursor:pointer; opacity:.82;
|
|
308
|
+
transition:opacity .12s, color .12s, border-color .12s, background-color .12s;
|
|
309
|
+
}
|
|
310
|
+
.zcode-preview-btn:hover{opacity:1; color:var(--accent); border-color:var(--accent); background:var(--panel)}
|
|
311
|
+
|
|
312
|
+
/* 富媒体块统一工具栏(SVG 矢量/动画、UI 原型沙盒、视频/音频交付件) */
|
|
313
|
+
.zblock-bar{
|
|
314
|
+
display:flex; align-items:center; justify-content:space-between; gap:8px;
|
|
315
|
+
padding:5px 8px; border-bottom:1px solid var(--line-2);
|
|
316
|
+
background:color-mix(in srgb, var(--panel) 84%, var(--bg));
|
|
317
|
+
font-size:10.5px; color:var(--fg-2); user-select:none;
|
|
318
|
+
}
|
|
319
|
+
.zblock-title{font-weight:600; letter-spacing:.01em; display:inline-flex; align-items:center; gap:5px}
|
|
320
|
+
.zblock-actions{display:inline-flex; align-items:center; gap:4px}
|
|
321
|
+
.zblock-btn{
|
|
322
|
+
appearance:none; border:1px solid transparent; border-radius:5px;
|
|
323
|
+
background:transparent; color:var(--fg-2); font:inherit; font-size:10.5px; font-weight:540;
|
|
324
|
+
padding:2px 6px; cursor:pointer; line-height:1.35;
|
|
325
|
+
transition:background-color .12s, color .12s, border-color .12s;
|
|
326
|
+
}
|
|
327
|
+
.zblock-btn:hover{background:var(--panel); color:var(--fg); border-color:var(--line-2)}
|
|
328
|
+
.zblock-btn.active{background:var(--accent-soft); color:var(--accent); border-color:color-mix(in srgb, var(--accent) 32%, transparent)}
|
|
329
|
+
|
|
330
|
+
.zoomable.zsvg{padding:0; background:var(--bg); cursor:default}
|
|
331
|
+
.zoomable.zsvg .zsvg-stage{padding:10px; cursor:zoom-in; background:var(--panel)}
|
|
332
|
+
.zoomable.zsvg .zsvg-stage svg{display:block; width:100%; height:auto; max-width:100%; margin:0 auto}
|
|
333
|
+
.zoomable.zsvg .zsvg-code{display:none; margin:0 !important; border:0 !important; border-radius:0 !important}
|
|
334
|
+
.zoomable.zsvg.is-code .zsvg-stage{display:none}
|
|
335
|
+
.zoomable.zsvg.is-code .zsvg-code{display:block}
|
|
336
|
+
|
|
337
|
+
.zoomable.zui{padding:0; background:var(--bg); cursor:default}
|
|
338
|
+
.zui-stage{padding:8px; background:var(--bg); display:flex; justify-content:center}
|
|
339
|
+
.zui-frame{
|
|
340
|
+
display:block; width:100%; height:260px; border:1px solid var(--line-2);
|
|
341
|
+
border-radius:7px; background:#fff; transition:width .18s ease, height .16s ease;
|
|
342
|
+
}
|
|
343
|
+
[data-theme="dark"] .zui-frame{background:#0f172a}
|
|
344
|
+
.zoomable.zui.is-mobile .zui-frame{width:375px; max-width:100%}
|
|
345
|
+
.zoomable.zui .zui-code{display:none; margin:0 !important; border:0 !important; border-radius:0 !important}
|
|
346
|
+
.zoomable.zui.is-code .zui-stage{display:none}
|
|
347
|
+
.zoomable.zui.is-code .zui-code{display:block}
|
|
348
|
+
#lensInner .zui-lens-frame{
|
|
349
|
+
display:block; width:min(960px, 84vw); height:min(640px, 76vh);
|
|
350
|
+
border:1px solid var(--line); border-radius:10px; background:#fff;
|
|
351
|
+
}
|
|
352
|
+
[data-theme="dark"] #lensInner .zui-lens-frame{background:#0f172a}
|
|
353
|
+
|
|
354
|
+
.zoomable.zimg{padding:0; background:var(--panel); cursor:zoom-in}
|
|
355
|
+
.zoomable.zimg img{display:block; width:100%; height:auto; max-width:100%; margin:0 auto}
|
|
356
|
+
.zoomable.zimg:hover{border-color:var(--accent)}
|
|
357
|
+
|
|
358
|
+
.zvideo,.zaudio{
|
|
359
|
+
margin-top:8px; border:1px solid var(--line-2); border-radius:8px;
|
|
360
|
+
overflow:hidden; background:var(--bg);
|
|
361
|
+
}
|
|
362
|
+
.zvideo video{display:block; width:100%; max-height:360px; background:#000}
|
|
363
|
+
.zaudio{padding:8px 10px}
|
|
364
|
+
.zaudio audio{display:block; width:100%; height:34px}
|
|
365
|
+
.zmedia-cap{
|
|
366
|
+
padding:5px 9px; font-size:11px; color:var(--fg-2);
|
|
367
|
+
border-top:1px solid var(--line-2); background:var(--panel);
|
|
368
|
+
}
|
|
369
|
+
.zaudio .zmedia-cap{border-top:0; padding:0 0 6px; background:transparent}
|
|
302
370
|
#lensInner .markdown-body{background:transparent}
|
|
303
371
|
#lensInner .markdown-body pre{
|
|
304
372
|
margin:0 !important; padding:2px 4px !important;
|
package/src/html/canvas-chain.js
CHANGED
|
@@ -63,7 +63,8 @@ function canvasChainDocument(subset, selected) {
|
|
|
63
63
|
var data = child.createElement('script');
|
|
64
64
|
var values = { __CLADO__: subset, __CLADO_CHAIN__: { id: selected, mode: mode }, __CLADO_LIVE__: true,
|
|
65
65
|
__CLADO_DIAGNOSTICS__: [], __CLADO_FILE__: window.__CLADO_FILE__ || '',
|
|
66
|
-
__CLADO_FILE_PATH__: window.__CLADO_FILE_PATH__ || '',
|
|
66
|
+
__CLADO_FILE_PATH__: window.__CLADO_FILE_PATH__ || '', __CLADO_WORKSPACE_ID__: window.__CLADO_WORKSPACE_ID__ || '',
|
|
67
|
+
__CLADO_RESOURCES__: window.__CLADO_RESOURCES__ || {}, __CLADO_OFFLINE__: !!window.__CLADO_OFFLINE__ };
|
|
67
68
|
data.textContent = Object.keys(values).map(function (key) { return 'window.' + key + '=' + JSON.stringify(values[key]).replace(/</g, '\\u003c').replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029') + ';'; }).join('\n');
|
|
68
69
|
child.body.appendChild(data);
|
|
69
70
|
[runtime, ui].forEach(function (source) { var script = child.createElement('script'); script.id = source.id; script.textContent = source.textContent; child.body.appendChild(script); });
|
|
@@ -201,6 +202,7 @@ if (window.__CLADO_CHAIN__) {
|
|
|
201
202
|
if (canvasRecords[id]) { flash(canvasRecords[id].card); canvasChainCenter(id); if (link.dataset.mediaPoint) canvasRevealMediaTarget(link, id); }
|
|
202
203
|
return;
|
|
203
204
|
}
|
|
205
|
+
if (event.target.closest('.zblock-btn:not([data-svg-zoom]):not([data-ui-zoom]),.zcode-preview-btn')) return;
|
|
204
206
|
if (event.target.closest('.zoomable,a')) { event.preventDefault(); event.stopImmediatePropagation(); }
|
|
205
207
|
}, true);
|
|
206
208
|
function chainCenter() { canvasSetFocus(canvasChainInitialId); canvasChainCenter(canvasChainInitialId); }
|
|
@@ -220,14 +222,14 @@ if (window.__CLADO_CHAIN__) {
|
|
|
220
222
|
tx = mx - (mx - tx) * next / scale; ty = my - (my - ty) * next / scale; scale = next; apply(); if (document.body.dataset.mode === 'mindmap') drawMindWires(); else drawWires();
|
|
221
223
|
}
|
|
222
224
|
function chainResources() {
|
|
223
|
-
$$('img[src]:not([data-chain-resource])').forEach(function (
|
|
224
|
-
var href =
|
|
225
|
+
$$('img[src]:not([data-chain-resource]),video[src]:not([data-chain-resource]),audio[src]:not([data-chain-resource])').forEach(function (el) {
|
|
226
|
+
var href = el.getAttribute('src'); if (!href || /^(?:[a-z][a-z0-9+.-]*:|\/\/|\/)/i.test(href) || !window.__CLADO_FILE_PATH__) return;
|
|
225
227
|
try {
|
|
226
228
|
var url = new URL(href, 'https://clado.local/documents/' + window.__CLADO_FILE_PATH__);
|
|
227
229
|
if (!url.pathname.startsWith('/documents/')) return;
|
|
228
230
|
var path = decodeURIComponent(url.pathname.slice('/documents/'.length)), resource = (window.__CLADO_RESOURCES__ || {})[path];
|
|
229
231
|
var workspace = window.__CLADO_WORKSPACE_ID__ ? '&workspace=' + encodeURIComponent(window.__CLADO_WORKSPACE_ID__) : '';
|
|
230
|
-
if (resource || !window.__CLADO_OFFLINE__) {
|
|
232
|
+
if (resource || !window.__CLADO_OFFLINE__) { el.src = resource || '/library/resource?file=' + encodeURIComponent(path) + workspace; el.dataset.chainResource = '1'; }
|
|
231
233
|
} catch (_) {}
|
|
232
234
|
});
|
|
233
235
|
}
|
|
@@ -719,6 +719,7 @@ function hotPatchCanvasDoc(nextDoc, diagnostics, nextVersion, touch, follow) {
|
|
|
719
719
|
|
|
720
720
|
playCanvasLiveDiff(prevSnap, touch, follow);
|
|
721
721
|
animateNewCanvasWires(prevEdgeKeys);
|
|
722
|
+
if (typeof cladoSyncAllCardPresenceDom === 'function') cladoSyncAllCardPresenceDom();
|
|
722
723
|
if (typeof CustomEvent === 'function') document.dispatchEvent(new CustomEvent('clado:view-state'));
|
|
723
724
|
return true;
|
|
724
725
|
}
|
|
@@ -925,3 +926,331 @@ function startCanvasLinkPick(sourceSpec) {
|
|
|
925
926
|
document.addEventListener('click', onClick, true);
|
|
926
927
|
cladoLinkPickState = { source: sourceSpec, banner: banner, onClick: onClick, onKey: onKey };
|
|
927
928
|
}
|
|
929
|
+
|
|
930
|
+
/* ── 多角色卡片空间协同(方案 1 · 底部一体状态栏 + 1px 发丝光 + 向下垂落呼吸柔光) ── */
|
|
931
|
+
var cladoPresenceStore = new Map(); // cardId -> Map<sessionId, entry>
|
|
932
|
+
var cladoPresenceAfterglowMs = 15000;
|
|
933
|
+
var CLADO_PRESENCE_MAX_ACTIVE_MS = 30 * 60 * 1000;
|
|
934
|
+
var cladoPresenceRotTick = 0;
|
|
935
|
+
var cladoPresenceRotTimer = 0;
|
|
936
|
+
var cladoPresenceSweepTimer = 0;
|
|
937
|
+
|
|
938
|
+
function cladoNormalizeTone(tone) {
|
|
939
|
+
return (tone === 'sky' || tone === 'emerald' || tone === 'violet' || tone === 'amber') ? tone : 'sky';
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
function cladoResolvePresenceCardIds(cards) {
|
|
943
|
+
var list = Array.isArray(cards) ? cards : [];
|
|
944
|
+
if (!list.length) return [];
|
|
945
|
+
var records = Object.values(canvasRecords || {});
|
|
946
|
+
var ids = [];
|
|
947
|
+
var seen = new Set();
|
|
948
|
+
list.forEach(function (raw) {
|
|
949
|
+
var path = Array.isArray(raw) ? raw : (typeof raw === 'string' && raw.trim() ? [raw.trim()] : []);
|
|
950
|
+
if (!path.length) return;
|
|
951
|
+
var rootTitle = String(path[0] || '').trim();
|
|
952
|
+
var match = records.find(function (r) {
|
|
953
|
+
return !r.parent && (r.title === rootTitle || r.id === rootTitle || r.fullPath === rootTitle);
|
|
954
|
+
});
|
|
955
|
+
if (!match) {
|
|
956
|
+
match = records.find(function (r) {
|
|
957
|
+
return r.titlePath.length === path.length && path.every(function (p, i) { return p === r.titlePath[i]; });
|
|
958
|
+
}) || records.find(function (r) { return r.title === path[path.length - 1]; });
|
|
959
|
+
}
|
|
960
|
+
var cid = match ? (match.card || match.id) : '';
|
|
961
|
+
if (cid && !seen.has(cid)) {
|
|
962
|
+
seen.add(cid);
|
|
963
|
+
ids.push(cid);
|
|
964
|
+
}
|
|
965
|
+
});
|
|
966
|
+
return ids;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
function cladoEnsurePresenceTimers() {
|
|
970
|
+
var hasAny = cladoPresenceStore.size > 0;
|
|
971
|
+
var hasMulti = false;
|
|
972
|
+
cladoPresenceStore.forEach(function (map) {
|
|
973
|
+
if (map && map.size >= 2) hasMulti = true;
|
|
974
|
+
});
|
|
975
|
+
if (hasAny && !cladoPresenceSweepTimer) {
|
|
976
|
+
cladoPresenceSweepTimer = setInterval(cladoSweepExpiredPresence, 1000);
|
|
977
|
+
} else if (!hasAny && cladoPresenceSweepTimer) {
|
|
978
|
+
clearInterval(cladoPresenceSweepTimer);
|
|
979
|
+
cladoPresenceSweepTimer = 0;
|
|
980
|
+
}
|
|
981
|
+
if (hasMulti && !cladoPresenceRotTimer) {
|
|
982
|
+
cladoPresenceRotTimer = setInterval(function () {
|
|
983
|
+
cladoPresenceRotTick++;
|
|
984
|
+
cladoSyncAllCardPresenceDom();
|
|
985
|
+
}, 2800);
|
|
986
|
+
} else if (!hasMulti && cladoPresenceRotTimer) {
|
|
987
|
+
clearInterval(cladoPresenceRotTimer);
|
|
988
|
+
cladoPresenceRotTimer = 0;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
function cladoSweepExpiredPresence() {
|
|
993
|
+
var now = Date.now();
|
|
994
|
+
var changed = false;
|
|
995
|
+
cladoPresenceStore.forEach(function (map, cardId) {
|
|
996
|
+
map.forEach(function (entry, sid) {
|
|
997
|
+
if (entry.phase === 'active' && (now - (entry.ts || now)) > CLADO_PRESENCE_MAX_ACTIVE_MS) {
|
|
998
|
+
if (cladoPresenceAfterglowMs <= 0) {
|
|
999
|
+
map.delete(sid);
|
|
1000
|
+
} else {
|
|
1001
|
+
entry.phase = 'afterglow';
|
|
1002
|
+
entry.label = '超时自动释放';
|
|
1003
|
+
entry.expiresAt = now + cladoPresenceAfterglowMs;
|
|
1004
|
+
}
|
|
1005
|
+
changed = true;
|
|
1006
|
+
} else if (entry.phase === 'afterglow' && entry.expiresAt && now >= entry.expiresAt) {
|
|
1007
|
+
map.delete(sid);
|
|
1008
|
+
changed = true;
|
|
1009
|
+
}
|
|
1010
|
+
});
|
|
1011
|
+
if (!map.size) {
|
|
1012
|
+
cladoPresenceStore.delete(cardId);
|
|
1013
|
+
changed = true;
|
|
1014
|
+
}
|
|
1015
|
+
});
|
|
1016
|
+
cladoEnsurePresenceTimers();
|
|
1017
|
+
if (changed) cladoSyncAllCardPresenceDom();
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
function cladoClearCardPresenceByCardId(cardId) {
|
|
1021
|
+
if (!cardId || !cladoPresenceStore.has(cardId)) return;
|
|
1022
|
+
cladoPresenceStore.delete(cardId);
|
|
1023
|
+
cladoEnsurePresenceTimers();
|
|
1024
|
+
cladoSyncAllCardPresenceDom();
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
function cladoRenderCardPresenceDom(cardId, cardEl, entries) {
|
|
1028
|
+
if (!cardEl) return;
|
|
1029
|
+
if (!entries || !entries.length) {
|
|
1030
|
+
var had = cardEl.classList.contains('clado-has-presence');
|
|
1031
|
+
cardEl.classList.remove('clado-has-presence', 'is-afterglow');
|
|
1032
|
+
cardEl.removeAttribute('data-presence-tone');
|
|
1033
|
+
var oldBar = cardEl.querySelector(':scope > .clado-presence-bar');
|
|
1034
|
+
var oldLine = cardEl.querySelector(':scope > .clado-presence-line');
|
|
1035
|
+
var oldGlow = cardEl.querySelector(':scope > .clado-presence-glow');
|
|
1036
|
+
if (oldBar) oldBar.remove();
|
|
1037
|
+
if (oldLine) oldLine.remove();
|
|
1038
|
+
if (oldGlow) oldGlow.remove();
|
|
1039
|
+
return had;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
var sorted = entries.slice().sort(function (a, b) {
|
|
1043
|
+
if (a.phase !== b.phase) return a.phase === 'active' ? -1 : 1;
|
|
1044
|
+
return (b.ts || 0) - (a.ts || 0);
|
|
1045
|
+
});
|
|
1046
|
+
var activeOnly = sorted.filter(function (e) { return e.phase === 'active'; });
|
|
1047
|
+
var cyclePool = activeOnly.length ? activeOnly : sorted;
|
|
1048
|
+
var cur = cyclePool[cladoPresenceRotTick % cyclePool.length];
|
|
1049
|
+
var tone = cladoNormalizeTone(cur.tone);
|
|
1050
|
+
var allAfterglow = activeOnly.length === 0;
|
|
1051
|
+
|
|
1052
|
+
var heightChanged = !cardEl.classList.contains('clado-has-presence');
|
|
1053
|
+
cardEl.classList.add('clado-has-presence');
|
|
1054
|
+
cardEl.classList.toggle('is-afterglow', allAfterglow);
|
|
1055
|
+
cardEl.dataset.presenceTone = tone;
|
|
1056
|
+
|
|
1057
|
+
var bar = cardEl.querySelector(':scope > .clado-presence-bar');
|
|
1058
|
+
if (!bar) {
|
|
1059
|
+
bar = document.createElement('div');
|
|
1060
|
+
bar.className = 'clado-presence-bar';
|
|
1061
|
+
var rz = cardEl.querySelector(':scope > .rz');
|
|
1062
|
+
if (rz) cardEl.insertBefore(bar, rz);
|
|
1063
|
+
else cardEl.appendChild(bar);
|
|
1064
|
+
bar.addEventListener('click', function (ev) {
|
|
1065
|
+
if (ev.target.closest('.clado-presence-dismiss')) {
|
|
1066
|
+
ev.preventDefault();
|
|
1067
|
+
ev.stopPropagation();
|
|
1068
|
+
cladoClearCardPresenceByCardId(cardId);
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1071
|
+
ev.preventDefault();
|
|
1072
|
+
ev.stopPropagation();
|
|
1073
|
+
var targetRow = ev.target.closest('.clado-presence-tip-row');
|
|
1074
|
+
var sid = (targetRow && targetRow.dataset.sid) || bar.dataset.sid || '';
|
|
1075
|
+
var rid = (targetRow && targetRow.dataset.rid) || bar.dataset.rid || '';
|
|
1076
|
+
var cpath = (targetRow && targetRow.dataset.codePath) || bar.dataset.codePath || '';
|
|
1077
|
+
try {
|
|
1078
|
+
window.parent.postMessage({
|
|
1079
|
+
type: 'clado-library:presence-click',
|
|
1080
|
+
sessionId: sid,
|
|
1081
|
+
roleId: rid,
|
|
1082
|
+
codePath: cpath,
|
|
1083
|
+
}, '*');
|
|
1084
|
+
} catch (e) {}
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
bar.dataset.sid = cur.sessionId || '';
|
|
1088
|
+
bar.dataset.rid = cur.roleId || '';
|
|
1089
|
+
bar.dataset.codePath = cur.codePath || '';
|
|
1090
|
+
|
|
1091
|
+
var actionText = cur.label
|
|
1092
|
+
? (cur.roleName + ' · ' + cur.label)
|
|
1093
|
+
: (cur.roleName + (cur.phase === 'active' ? ' · 正在协作' : ' · 刚刚完成'));
|
|
1094
|
+
var multiHtml = '';
|
|
1095
|
+
if (sorted.length >= 2) {
|
|
1096
|
+
var dots = sorted.map(function (item) {
|
|
1097
|
+
var isCur = item.sessionId === cur.sessionId;
|
|
1098
|
+
return '<i class="clado-presence-mdot' + (isCur ? ' is-cur' : '') + '" data-tone="' + esc(cladoNormalizeTone(item.tone)) + '"></i>';
|
|
1099
|
+
}).join('');
|
|
1100
|
+
multiHtml = '<span class="clado-presence-dots">' + dots + '</span><span class="clado-presence-count">' + sorted.length + ' 角色</span>';
|
|
1101
|
+
}
|
|
1102
|
+
var tipRows = sorted.map(function (item) {
|
|
1103
|
+
var itemTone = cladoNormalizeTone(item.tone);
|
|
1104
|
+
var statusLabel = item.phase === 'active' ? '进行中' : '余韵';
|
|
1105
|
+
return '<div class="clado-presence-tip-row" data-sid="' + esc(item.sessionId || '') + '" data-rid="' + esc(item.roleId || '') + '" data-code-path="' + esc(item.codePath || '') + '">'
|
|
1106
|
+
+ '<span class="clado-presence-tip-main"><i class="clado-presence-mdot is-cur" data-tone="' + esc(itemTone) + '"></i><strong>' + esc(item.roleName || '角色') + '</strong>' + (item.label ? ' · ' + esc(item.label) : '') + '</span>'
|
|
1107
|
+
+ '<span class="clado-presence-tip-phase">' + statusLabel + '</span>'
|
|
1108
|
+
+ '</div>';
|
|
1109
|
+
}).join('');
|
|
1110
|
+
|
|
1111
|
+
bar.innerHTML =
|
|
1112
|
+
'<div class="clado-presence-left">'
|
|
1113
|
+
+ '<i class="clado-presence-dot" aria-hidden="true"></i>'
|
|
1114
|
+
+ '<span class="clado-presence-text">' + esc(actionText) + '</span>'
|
|
1115
|
+
+ '</div>'
|
|
1116
|
+
+ '<div class="clado-presence-right">'
|
|
1117
|
+
+ multiHtml
|
|
1118
|
+
+ '<button type="button" class="clado-presence-dismiss" title="清除此卡协同提示">×</button>'
|
|
1119
|
+
+ '</div>'
|
|
1120
|
+
+ '<div class="clado-presence-tip">' + tipRows + '</div>';
|
|
1121
|
+
|
|
1122
|
+
if (!cardEl.querySelector(':scope > .clado-presence-line')) {
|
|
1123
|
+
var line = document.createElement('span');
|
|
1124
|
+
line.className = 'clado-presence-line';
|
|
1125
|
+
line.setAttribute('aria-hidden', 'true');
|
|
1126
|
+
cardEl.appendChild(line);
|
|
1127
|
+
}
|
|
1128
|
+
if (!cardEl.querySelector(':scope > .clado-presence-glow')) {
|
|
1129
|
+
var glow = document.createElement('span');
|
|
1130
|
+
glow.className = 'clado-presence-glow';
|
|
1131
|
+
glow.setAttribute('aria-hidden', 'true');
|
|
1132
|
+
cardEl.appendChild(glow);
|
|
1133
|
+
}
|
|
1134
|
+
return heightChanged;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
function cladoSyncAllCardPresenceDom() {
|
|
1138
|
+
var anyLayoutDelta = false;
|
|
1139
|
+
Object.keys(render.card || {}).forEach(function (cardId) {
|
|
1140
|
+
var cardEl = render.card[cardId];
|
|
1141
|
+
if (!cardEl) return;
|
|
1142
|
+
var map = cladoPresenceStore.get(cardId);
|
|
1143
|
+
var entries = map ? Array.from(map.values()) : [];
|
|
1144
|
+
if (cladoRenderCardPresenceDom(cardId, cardEl, entries)) anyLayoutDelta = true;
|
|
1145
|
+
});
|
|
1146
|
+
if (anyLayoutDelta && document.body.dataset.mode === 'cards') {
|
|
1147
|
+
try { repinPorts(); drawWires(); } catch (e) {}
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
function cladoSetPresenceConfig(cfg) {
|
|
1152
|
+
if (!cfg || typeof cfg !== 'object') return;
|
|
1153
|
+
if (typeof cfg.afterglowMs === 'number' && isFinite(cfg.afterglowMs) && cfg.afterglowMs >= 0) {
|
|
1154
|
+
cladoPresenceAfterglowMs = Math.min(300000, Math.round(cfg.afterglowMs));
|
|
1155
|
+
var now = Date.now();
|
|
1156
|
+
cladoPresenceStore.forEach(function (map, cardId) {
|
|
1157
|
+
map.forEach(function (entry, sid) {
|
|
1158
|
+
if (entry.phase === 'afterglow') {
|
|
1159
|
+
if (cladoPresenceAfterglowMs <= 0) map.delete(sid);
|
|
1160
|
+
else entry.expiresAt = Math.min(entry.expiresAt || (now + cladoPresenceAfterglowMs), now + cladoPresenceAfterglowMs);
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
if (!map.size) cladoPresenceStore.delete(cardId);
|
|
1164
|
+
});
|
|
1165
|
+
cladoEnsurePresenceTimers();
|
|
1166
|
+
cladoSyncAllCardPresenceDom();
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
function cladoSetCardPresence(ev) {
|
|
1171
|
+
if (!ev || typeof ev !== 'object') return;
|
|
1172
|
+
var sid = String(ev.sessionId || ev.roleId || 'agent');
|
|
1173
|
+
var phase = ev.phase || 'active';
|
|
1174
|
+
var now = Date.now();
|
|
1175
|
+
|
|
1176
|
+
if (phase === 'clear') {
|
|
1177
|
+
var clearIds = cladoResolvePresenceCardIds(ev.cards);
|
|
1178
|
+
if (clearIds.length) {
|
|
1179
|
+
clearIds.forEach(function (cid) {
|
|
1180
|
+
var m = cladoPresenceStore.get(cid);
|
|
1181
|
+
if (m) {
|
|
1182
|
+
m.delete(sid);
|
|
1183
|
+
if (!m.size) cladoPresenceStore.delete(cid);
|
|
1184
|
+
}
|
|
1185
|
+
});
|
|
1186
|
+
} else {
|
|
1187
|
+
cladoPresenceStore.forEach(function (m, cid) {
|
|
1188
|
+
m.delete(sid);
|
|
1189
|
+
if (!m.size) cladoPresenceStore.delete(cid);
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
cladoEnsurePresenceTimers();
|
|
1193
|
+
cladoSyncAllCardPresenceDom();
|
|
1194
|
+
return;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
if (phase === 'afterglow') {
|
|
1198
|
+
cladoPresenceStore.forEach(function (m, cid) {
|
|
1199
|
+
var existing = m.get(sid);
|
|
1200
|
+
if (!existing) return;
|
|
1201
|
+
if (cladoPresenceAfterglowMs <= 0) {
|
|
1202
|
+
m.delete(sid);
|
|
1203
|
+
if (!m.size) cladoPresenceStore.delete(cid);
|
|
1204
|
+
} else {
|
|
1205
|
+
existing.phase = 'afterglow';
|
|
1206
|
+
existing.expiresAt = now + cladoPresenceAfterglowMs;
|
|
1207
|
+
if (ev.label && !existing.label) existing.label = ev.label;
|
|
1208
|
+
}
|
|
1209
|
+
});
|
|
1210
|
+
cladoEnsurePresenceTimers();
|
|
1211
|
+
cladoSyncAllCardPresenceDom();
|
|
1212
|
+
return;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
// phase === 'active'
|
|
1216
|
+
var targetIds = cladoResolvePresenceCardIds(ev.cards);
|
|
1217
|
+
if (!targetIds.length) return;
|
|
1218
|
+
var targetSet = new Set(targetIds);
|
|
1219
|
+
|
|
1220
|
+
// Transition any previously active cards of this same session that are no longer targeted into afterglow
|
|
1221
|
+
cladoPresenceStore.forEach(function (m, cid) {
|
|
1222
|
+
if (targetSet.has(cid)) return;
|
|
1223
|
+
var existing = m.get(sid);
|
|
1224
|
+
if (existing && existing.phase === 'active') {
|
|
1225
|
+
if (cladoPresenceAfterglowMs <= 0) {
|
|
1226
|
+
m.delete(sid);
|
|
1227
|
+
if (!m.size) cladoPresenceStore.delete(cid);
|
|
1228
|
+
} else {
|
|
1229
|
+
existing.phase = 'afterglow';
|
|
1230
|
+
existing.expiresAt = now + cladoPresenceAfterglowMs;
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
});
|
|
1234
|
+
|
|
1235
|
+
targetIds.forEach(function (cid) {
|
|
1236
|
+
var m = cladoPresenceStore.get(cid);
|
|
1237
|
+
if (!m) {
|
|
1238
|
+
m = new Map();
|
|
1239
|
+
cladoPresenceStore.set(cid, m);
|
|
1240
|
+
}
|
|
1241
|
+
m.set(sid, {
|
|
1242
|
+
sessionId: sid,
|
|
1243
|
+
roleId: String(ev.roleId || ''),
|
|
1244
|
+
roleName: String(ev.roleName || 'AI 角色'),
|
|
1245
|
+
tone: cladoNormalizeTone(ev.tone),
|
|
1246
|
+
label: String(ev.label || ''),
|
|
1247
|
+
codePath: String(ev.codePath || ''),
|
|
1248
|
+
phase: 'active',
|
|
1249
|
+
ts: now,
|
|
1250
|
+
expiresAt: 0,
|
|
1251
|
+
});
|
|
1252
|
+
});
|
|
1253
|
+
|
|
1254
|
+
cladoEnsurePresenceTimers();
|
|
1255
|
+
cladoSyncAllCardPresenceDom();
|
|
1256
|
+
}
|
package/src/html/canvas-ui.css
CHANGED
|
@@ -27,8 +27,9 @@
|
|
|
27
27
|
/* 长按标题提取关联链路,主画布和子画布分别保存各自的取景。 */
|
|
28
28
|
.card-title h1,.slice-head,#toc a{touch-action:none;cursor:text;user-select:text;-webkit-user-select:text}
|
|
29
29
|
.card-title h1:focus-visible,.slice-head:focus-visible,#toc a:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:3px}
|
|
30
|
-
.canvas-chain-dialog{position:fixed;inset:0;width:min(1440px,calc(100vw - 48px));height:calc(100dvh - 64px);max-width:none;max-height:none;margin:auto;padding:0;overflow:hidden}
|
|
31
|
-
.canvas-chain-bar{height:61px;display:flex;align-items:center;gap:14px;padding:0 17px;background
|
|
30
|
+
.canvas-chain-dialog{position:fixed;inset:0;width:min(1440px,calc(100vw - 48px));height:calc(100dvh - 64px);max-width:none;max-height:none;margin:auto;padding:0;overflow:hidden;background:var(--bg);color:var(--fg)}
|
|
31
|
+
.canvas-chain-bar{height:61px;display:flex;align-items:center;gap:14px;padding:0 17px;background:var(--panel);color:var(--fg);border-bottom:1px solid var(--line);--clado-ui-muted:var(--fg-2);--clado-ui-accent:var(--accent);--clado-ui-edge:var(--line);--clado-ui-active:var(--bg)}
|
|
32
|
+
[data-theme="dark"] .canvas-chain-bar{background:#161b22;color:#e6edf3;border-bottom-color:rgba(148,163,184,.2);--clado-ui-muted:#94a3b8;--clado-ui-accent:#60a5fa;--clado-ui-edge:rgba(148,163,184,.24);--clado-ui-active:rgba(255,255,255,.08)}
|
|
32
33
|
.canvas-chain-heading{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.canvas-chain-heading strong{font-size:14px;font-weight:600;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.canvas-chain-meta{font-size:11px;color:var(--clado-ui-muted)}
|
|
33
34
|
.canvas-chain-controls{display:flex;align-items:center;gap:6px}.canvas-chain-controls button{width:30px;min-height:30px;padding:0;display:grid;place-items:center;border-radius:7px;font-size:17px}.canvas-chain-dialog iframe{display:block;width:100%;height:calc(100% - 62px);border:0;background:var(--bg)}
|
|
34
35
|
@media(max-width:650px){.canvas-chain-dialog{width:calc(100vw - 16px);height:calc(100dvh - 24px);border-radius:10px}.canvas-chain-bar{padding-inline:10px;gap:8px}.canvas-chain-meta{font-size:10px}}
|
|
@@ -642,3 +643,146 @@ body.clado-link-picking .clado-tag:hover{
|
|
|
642
643
|
.clado-sel-quickbar .sep{
|
|
643
644
|
width:1px;height:14px;background:var(--line);margin:0 1px;
|
|
644
645
|
}
|
|
646
|
+
|
|
647
|
+
/* ── 多角色卡片空间协同(方案 1 · 底部一体状态栏 + 1px 羽化光丝 + 向下垂落呼吸柔光) ── */
|
|
648
|
+
@keyframes clado-presence-breathe{
|
|
649
|
+
0%,100%{opacity:.52;transform:scaleX(.95) scaleY(.88)}
|
|
650
|
+
50%{opacity:1;transform:scaleX(1.03) scaleY(1.16)}
|
|
651
|
+
}
|
|
652
|
+
@keyframes clado-presence-dot-pulse{
|
|
653
|
+
0%,100%{opacity:.55;transform:scale(.88)}
|
|
654
|
+
50%{opacity:1;transform:scale(1.18)}
|
|
655
|
+
}
|
|
656
|
+
.card.clado-has-presence{
|
|
657
|
+
--p-rgb:56,189,248;
|
|
658
|
+
--p-rgb2:129,140,248;
|
|
659
|
+
--p-fg:#0369a1;
|
|
660
|
+
--p-fg-dark:#7dd3fc;
|
|
661
|
+
}
|
|
662
|
+
.card.clado-has-presence[data-presence-tone="sky"]{
|
|
663
|
+
--p-rgb:56,189,248;--p-rgb2:129,140,248;--p-fg:#0369a1;--p-fg-dark:#7dd3fc;
|
|
664
|
+
}
|
|
665
|
+
.card.clado-has-presence[data-presence-tone="emerald"]{
|
|
666
|
+
--p-rgb:16,185,129;--p-rgb2:45,212,191;--p-fg:#047857;--p-fg-dark:#6ee7b7;
|
|
667
|
+
}
|
|
668
|
+
.card.clado-has-presence[data-presence-tone="violet"]{
|
|
669
|
+
--p-rgb:139,92,246;--p-rgb2:244,114,182;--p-fg:#6d28d9;--p-fg-dark:#c4b5fd;
|
|
670
|
+
}
|
|
671
|
+
.card.clado-has-presence[data-presence-tone="amber"]{
|
|
672
|
+
--p-rgb:245,158,11;--p-rgb2:251,146,60;--p-fg:#b45309;--p-fg-dark:#fcd34d;
|
|
673
|
+
}
|
|
674
|
+
.card.clado-has-presence .clado-presence-bar{
|
|
675
|
+
flex:0 0 auto;
|
|
676
|
+
position:relative;
|
|
677
|
+
display:flex;align-items:center;justify-content:space-between;gap:8px;
|
|
678
|
+
padding:6px 12px 7px;
|
|
679
|
+
border-top:1px solid rgba(var(--p-rgb),.15);
|
|
680
|
+
border-radius:0 0 calc(var(--proto-radius, 11px) - 1px) calc(var(--proto-radius, 11px) - 1px);
|
|
681
|
+
background:linear-gradient(180deg,rgba(var(--p-rgb),.04),rgba(var(--p-rgb),.095));
|
|
682
|
+
color:var(--p-fg);
|
|
683
|
+
font-size:11px;font-weight:560;line-height:1.3;
|
|
684
|
+
cursor:pointer;user-select:none;
|
|
685
|
+
transition:background .35s ease,border-color .35s ease,color .35s ease,opacity .35s ease;
|
|
686
|
+
}
|
|
687
|
+
[data-theme="dark"] .card.clado-has-presence .clado-presence-bar{
|
|
688
|
+
color:var(--p-fg-dark);
|
|
689
|
+
border-top-color:rgba(var(--p-rgb),.22);
|
|
690
|
+
background:linear-gradient(180deg,rgba(var(--p-rgb),.06),rgba(var(--p-rgb),.13));
|
|
691
|
+
}
|
|
692
|
+
.card.clado-has-presence.is-afterglow .clado-presence-bar{
|
|
693
|
+
opacity:.72;
|
|
694
|
+
}
|
|
695
|
+
.clado-presence-left{
|
|
696
|
+
display:flex;align-items:center;gap:6px;min-width:0;flex:1;
|
|
697
|
+
}
|
|
698
|
+
.clado-presence-dot{
|
|
699
|
+
width:6px;height:6px;border-radius:50%;flex:none;
|
|
700
|
+
background:rgb(var(--p-rgb));
|
|
701
|
+
box-shadow:0 0 8px rgba(var(--p-rgb),.75);
|
|
702
|
+
animation:clado-presence-dot-pulse 2.2s ease-in-out infinite;
|
|
703
|
+
}
|
|
704
|
+
.card.clado-has-presence.is-afterglow .clado-presence-dot{
|
|
705
|
+
animation:none;opacity:.65;box-shadow:0 0 4px rgba(var(--p-rgb),.4);
|
|
706
|
+
}
|
|
707
|
+
.clado-presence-text{
|
|
708
|
+
overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
|
|
709
|
+
}
|
|
710
|
+
.clado-presence-right{
|
|
711
|
+
display:flex;align-items:center;gap:6px;flex:none;
|
|
712
|
+
}
|
|
713
|
+
.clado-presence-dots{
|
|
714
|
+
display:inline-flex;align-items:center;gap:4px;
|
|
715
|
+
}
|
|
716
|
+
.clado-presence-mdot{
|
|
717
|
+
width:6px;height:6px;border-radius:50%;opacity:.38;
|
|
718
|
+
transition:opacity .25s ease,transform .25s ease;
|
|
719
|
+
}
|
|
720
|
+
.clado-presence-mdot.is-cur{opacity:1;transform:scale(1.22)}
|
|
721
|
+
.clado-presence-mdot[data-tone="sky"]{background:#38bdf8}
|
|
722
|
+
.clado-presence-mdot[data-tone="emerald"]{background:#10b981}
|
|
723
|
+
.clado-presence-mdot[data-tone="violet"]{background:#8b5cf6}
|
|
724
|
+
.clado-presence-mdot[data-tone="amber"]{background:#f59e0b}
|
|
725
|
+
.clado-presence-count{
|
|
726
|
+
font-size:10px;opacity:.72;font-weight:520;
|
|
727
|
+
}
|
|
728
|
+
.clado-presence-dismiss{
|
|
729
|
+
appearance:none;border:0;background:transparent;color:currentColor;
|
|
730
|
+
width:16px;height:16px;padding:0;border-radius:50%;
|
|
731
|
+
display:grid;place-items:center;font-size:12px;line-height:1;
|
|
732
|
+
opacity:0;cursor:pointer;transition:opacity 140ms ease,background-color 140ms ease;
|
|
733
|
+
}
|
|
734
|
+
.clado-presence-bar:hover .clado-presence-dismiss{opacity:.65}
|
|
735
|
+
.clado-presence-dismiss:hover{opacity:1!important;background:rgba(var(--p-rgb),.18)}
|
|
736
|
+
.clado-presence-tip{
|
|
737
|
+
position:absolute;left:10px;right:10px;bottom:calc(100% + 6px);z-index:12;
|
|
738
|
+
padding:8px 10px;border-radius:10px;
|
|
739
|
+
background:color-mix(in srgb,var(--panel) 94%,transparent);
|
|
740
|
+
backdrop-filter:blur(16px) saturate(160%);
|
|
741
|
+
-webkit-backdrop-filter:blur(16px) saturate(160%);
|
|
742
|
+
border:1px solid var(--line);
|
|
743
|
+
box-shadow:0 12px 28px -10px rgba(15,23,42,.24);
|
|
744
|
+
color:var(--fg);font-size:11px;font-weight:480;
|
|
745
|
+
display:flex;flex-direction:column;gap:5px;
|
|
746
|
+
opacity:0;visibility:hidden;pointer-events:none;
|
|
747
|
+
transform:translateY(4px);
|
|
748
|
+
transition:opacity 150ms ease,transform 150ms ease,visibility 0s linear 150ms;
|
|
749
|
+
}
|
|
750
|
+
.clado-presence-bar:hover .clado-presence-tip{
|
|
751
|
+
opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);
|
|
752
|
+
transition:opacity 150ms ease,transform 150ms ease,visibility 0s;
|
|
753
|
+
}
|
|
754
|
+
.clado-presence-tip-row{
|
|
755
|
+
display:flex;align-items:center;justify-content:space-between;gap:8px;
|
|
756
|
+
}
|
|
757
|
+
.clado-presence-tip-main{
|
|
758
|
+
display:flex;align-items:center;gap:6px;min-width:0;
|
|
759
|
+
overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
|
|
760
|
+
}
|
|
761
|
+
.clado-presence-tip-phase{
|
|
762
|
+
font-size:10px;color:var(--fg-2);flex:none;
|
|
763
|
+
}
|
|
764
|
+
.card.clado-has-presence .clado-presence-line{
|
|
765
|
+
position:absolute;left:7%;right:7%;bottom:-.5px;height:1px;
|
|
766
|
+
pointer-events:none;z-index:4;
|
|
767
|
+
background:linear-gradient(90deg,transparent 0%,rgba(var(--p-rgb),.8) 26%,rgba(var(--p-rgb2),.8) 74%,transparent 100%);
|
|
768
|
+
transition:background .45s ease,opacity .45s ease;
|
|
769
|
+
}
|
|
770
|
+
.card.clado-has-presence.is-afterglow .clado-presence-line{opacity:.42}
|
|
771
|
+
.card.clado-has-presence .clado-presence-glow{
|
|
772
|
+
position:absolute;left:8%;right:8%;top:calc(100% - 1px);height:22px;
|
|
773
|
+
pointer-events:none;z-index:-1;transform-origin:50% 0%;
|
|
774
|
+
background:radial-gradient(ellipse 56% 92% at 50% 0%,rgba(var(--p-rgb),.32) 0%,rgba(var(--p-rgb2),.14) 50%,transparent 80%);
|
|
775
|
+
filter:blur(8px);
|
|
776
|
+
animation:clado-presence-breathe 2.8s ease-in-out infinite;
|
|
777
|
+
transition:background .45s ease,opacity .45s ease;
|
|
778
|
+
}
|
|
779
|
+
[data-theme="dark"] .card.clado-has-presence .clado-presence-glow{
|
|
780
|
+
background:radial-gradient(ellipse 56% 92% at 50% 0%,rgba(var(--p-rgb),.42) 0%,rgba(var(--p-rgb2),.18) 50%,transparent 80%);
|
|
781
|
+
}
|
|
782
|
+
.card.clado-has-presence.is-afterglow .clado-presence-glow{
|
|
783
|
+
animation:none;opacity:.34;
|
|
784
|
+
}
|
|
785
|
+
@media(prefers-reduced-motion:reduce){
|
|
786
|
+
.card.clado-has-presence .clado-presence-glow,
|
|
787
|
+
.clado-presence-dot{animation:none}
|
|
788
|
+
}
|
package/src/html/page.js
CHANGED
|
@@ -93,8 +93,10 @@ export function renderHtml(doc, diagnostics = [], options = {}) {
|
|
|
93
93
|
.replace('/*__MERMAID__*/', () => (doc.hasMermaid ? read('mermaid.min.js') : ''));
|
|
94
94
|
|
|
95
95
|
runtime = fixCanvasRuntime(runtime);
|
|
96
|
-
const
|
|
97
|
-
|
|
96
|
+
const helperFiles = ['canvas-wires.js','mindmap-connectors.js','mindmap-media.js','canvas-focus.js','canvas-chain.js'];
|
|
97
|
+
if (options.library || options.workspaceChrome) helperFiles.push('canvas-live-diff.js');
|
|
98
|
+
helperFiles.push('runtime-api.js');
|
|
99
|
+
const helpers = helperFiles.map(name => readFileSync(join(HERE, name), 'utf8')).join('\n');
|
|
98
100
|
const end = runtime.lastIndexOf('})();');
|
|
99
101
|
runtime = runtime.slice(0, end) + helpers + runtime.slice(end);
|
|
100
102
|
runtime = runtime.replace(/<(?:!--|\/?script\b)/gi, match => '\\x3c' + match.slice(1));
|
package/src/html/runtime-api.js
CHANGED
|
@@ -291,6 +291,12 @@
|
|
|
291
291
|
setDraftCard: function (draft) {
|
|
292
292
|
if (typeof renderCanvasDraftGhost === 'function') renderCanvasDraftGhost(draft);
|
|
293
293
|
},
|
|
294
|
+
setCardPresence: function (ev) {
|
|
295
|
+
if (typeof cladoSetCardPresence === 'function') cladoSetCardPresence(ev);
|
|
296
|
+
},
|
|
297
|
+
setPresenceConfig: function (cfg) {
|
|
298
|
+
if (typeof cladoSetPresenceConfig === 'function') cladoSetPresenceConfig(cfg);
|
|
299
|
+
},
|
|
294
300
|
startLinkPick: function (sourceSpec) {
|
|
295
301
|
if (typeof startCanvasLinkPick === 'function') startCanvasLinkPick(sourceSpec);
|
|
296
302
|
},
|