@a83/orbiter-admin 0.3.41 → 0.3.42
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 +1 -1
- package/public/style.css +21 -26
- package/public/xfce.js +35 -84
package/package.json
CHANGED
package/public/style.css
CHANGED
|
@@ -2063,12 +2063,17 @@ html[data-dock-pos="left"] .xfce-col-preview.visible {
|
|
|
2063
2063
|
.xfce-preview-date { font-size: 9px; color: var(--muted); flex-shrink: 0; }
|
|
2064
2064
|
.xfce-preview-empty { padding: 6px 12px; font-size: 10px; color: var(--muted); }
|
|
2065
2065
|
.xfce-preview-loading { padding: 10px 12px; font-size: 10px; color: var(--muted); }
|
|
2066
|
-
.xfce-preview-
|
|
2067
|
-
display:
|
|
2068
|
-
|
|
2069
|
-
|
|
2066
|
+
.xfce-preview-actions {
|
|
2067
|
+
display: flex; border-top: 1px solid var(--line);
|
|
2068
|
+
}
|
|
2069
|
+
.xfce-preview-action {
|
|
2070
|
+
flex: 1; padding: 6px 8px; font-size: 10px; font-family: var(--mono);
|
|
2071
|
+
color: var(--accent); text-decoration: none; text-align: center;
|
|
2072
|
+
background: none; border: none; cursor: pointer;
|
|
2073
|
+
transition: background .1s; white-space: nowrap;
|
|
2070
2074
|
}
|
|
2071
|
-
.xfce-preview-
|
|
2075
|
+
.xfce-preview-action + .xfce-preview-action { border-left: 1px solid var(--line); }
|
|
2076
|
+
.xfce-preview-action:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
|
|
2072
2077
|
|
|
2073
2078
|
/* ── Command Palette ─────────────────────────────────────── */
|
|
2074
2079
|
.xfce-palette {
|
|
@@ -2147,8 +2152,13 @@ html[data-dock-pos="left"] .xfce-col-preview.visible {
|
|
|
2147
2152
|
|
|
2148
2153
|
/* ── Status bar build indicator ──────────────────────────── */
|
|
2149
2154
|
.xfce-sb-build { font-size: 9px; font-family: var(--mono); color: var(--muted); white-space: nowrap; }
|
|
2150
|
-
.xfce-sb-g-ind {
|
|
2151
|
-
|
|
2155
|
+
.xfce-sb-g-ind {
|
|
2156
|
+
font-size: 10px; font-family: var(--mono); font-weight: 700; white-space: nowrap;
|
|
2157
|
+
color: var(--bg1); background: var(--accent);
|
|
2158
|
+
border-radius: 4px; padding: 1px 6px; letter-spacing: .04em;
|
|
2159
|
+
animation: xfce-blink .6s step-end infinite;
|
|
2160
|
+
}
|
|
2161
|
+
@keyframes xfce-blink { 0%,100% { opacity:1; } 50% { opacity:.4; } }
|
|
2152
2162
|
|
|
2153
2163
|
/* ── Left dock mode ───────────────────────────────────────── */
|
|
2154
2164
|
html[data-style="xfce"][data-dock-pos="left"] .main {
|
|
@@ -2179,27 +2189,12 @@ html[data-style="xfce"][data-dock-pos="left"] .xfce-toast-host {
|
|
|
2179
2189
|
html[data-style="xfce"][data-dock-pos="left"] .xfce-palette {
|
|
2180
2190
|
padding-bottom: 20px; padding-left: 100px; align-items: center;
|
|
2181
2191
|
}
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
.xfce-ctx-menu {
|
|
2185
|
-
display: none; position: fixed; z-index: 100000;
|
|
2186
|
-
background: var(--bg1); border: 1px solid var(--line);
|
|
2187
|
-
border-top: 2px solid var(--accent);
|
|
2188
|
-
border-radius: 8px; padding: 4px 0;
|
|
2189
|
-
box-shadow: 0 4px 24px rgba(0,0,0,.25);
|
|
2190
|
-
min-width: 160px;
|
|
2191
|
-
opacity: 0; transform: scale(.96); transform-origin: top left;
|
|
2192
|
-
transition: opacity .1s, transform .1s;
|
|
2192
|
+
html[data-style="xfce"][data-dock-pos="left"] .xfce-tools-popup {
|
|
2193
|
+
bottom: auto;
|
|
2193
2194
|
}
|
|
2194
|
-
.xfce-
|
|
2195
|
-
|
|
2196
|
-
display: flex; align-items: center; gap: 10px;
|
|
2197
|
-
width: 100%; background: none; border: none; cursor: pointer;
|
|
2198
|
-
padding: 7px 14px; font-size: 12px; font-family: var(--mono);
|
|
2199
|
-
color: var(--body); text-align: left; transition: background .1s;
|
|
2195
|
+
html[data-style="xfce"][data-dock-pos="left"] .xfce-ws-overlay {
|
|
2196
|
+
bottom: auto; left: 110px; top: 50%; transform: translateY(-50%);
|
|
2200
2197
|
}
|
|
2201
|
-
.xfce-ctx-item:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--heading); }
|
|
2202
|
-
.xfce-ctx-icon { width: 16px; text-align: center; color: var(--accent); flex-shrink: 0; }
|
|
2203
2198
|
|
|
2204
2199
|
/* ── Toast host (above dock) ─────────────────────────────── */
|
|
2205
2200
|
.xfce-toast-host {
|
package/public/xfce.js
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
'</div>',
|
|
64
64
|
'<div class="xfce-sb-center" id="xfce-sb-title"></div>',
|
|
65
65
|
'<div class="xfce-sb-right">',
|
|
66
|
-
'<span id="xfce-sb-g-ind" class="xfce-sb-g-ind" style="display:none" title="g
|
|
66
|
+
'<span id="xfce-sb-g-ind" class="xfce-sb-g-ind" style="display:none" title="g mode: d=dashboard m=media s=settings u=users b=build i=import h=schema a=account">g ›</span>',
|
|
67
67
|
'<button id="xfce-sb-palette-btn" class="xfce-sb-palette-btn" title="Command palette (⌘K)">⌘</button>',
|
|
68
68
|
'<span class="xfce-sb-div">·</span>',
|
|
69
69
|
'<span id="xfce-sb-build" class="xfce-sb-build" title="Last build"></span>',
|
|
@@ -204,10 +204,23 @@
|
|
|
204
204
|
|
|
205
205
|
function toggleToolsPopup() {
|
|
206
206
|
if (!toolsPopup) buildToolsPopup();
|
|
207
|
-
var btn
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
var btn = document.getElementById('xfce-tools-btn');
|
|
208
|
+
var dock = document.getElementById('xfce-dock');
|
|
209
|
+
var isLeft = document.documentElement.dataset.dockPos === 'left';
|
|
210
|
+
if (btn && dock) {
|
|
211
|
+
var bRect = btn.getBoundingClientRect();
|
|
212
|
+
var dRect = dock.getBoundingClientRect();
|
|
213
|
+
if (isLeft) {
|
|
214
|
+
toolsPopup.style.left = Math.round(dRect.right + 10) + 'px';
|
|
215
|
+
toolsPopup.style.top = Math.round(bRect.top + bRect.height / 2) + 'px';
|
|
216
|
+
toolsPopup.style.bottom = 'auto';
|
|
217
|
+
toolsPopup.style.transform = 'translateY(-50%)';
|
|
218
|
+
} else {
|
|
219
|
+
toolsPopup.style.left = Math.round(bRect.left + bRect.width / 2) + 'px';
|
|
220
|
+
toolsPopup.style.top = '';
|
|
221
|
+
toolsPopup.style.bottom = '';
|
|
222
|
+
toolsPopup.style.transform = '';
|
|
223
|
+
}
|
|
211
224
|
}
|
|
212
225
|
toolsPopup.classList.toggle('open');
|
|
213
226
|
}
|
|
@@ -268,7 +281,23 @@
|
|
|
268
281
|
_previewEl.innerHTML =
|
|
269
282
|
'<div class="xfce-preview-head"><a href="' + entriesHref + '">' + escHtml(col.label) + '</a></div>'
|
|
270
283
|
+ '<div class="xfce-preview-entries">' + rows + '</div>'
|
|
271
|
-
+ '<
|
|
284
|
+
+ '<div class="xfce-preview-actions">'
|
|
285
|
+
+ '<a class="xfce-preview-action" href="' + newHref + '">+ new entry</a>'
|
|
286
|
+
+ '<a class="xfce-preview-action" href="' + entriesHref + '">◫ view all</a>'
|
|
287
|
+
+ '<button class="xfce-preview-action xfce-preview-export" data-col="' + escHtml(col.id) + '">↓ export</button>'
|
|
288
|
+
+ '</div>';
|
|
289
|
+
var expBtn = _previewEl.querySelector('.xfce-preview-export');
|
|
290
|
+
if (expBtn) expBtn.addEventListener('click', function (ev) {
|
|
291
|
+
ev.preventDefault();
|
|
292
|
+
fetch('/api/terminal/export?col=' + encodeURIComponent(col.id) + '&format=json&drafts=0', { credentials: 'include' })
|
|
293
|
+
.then(function (r) { return r.blob(); })
|
|
294
|
+
.then(function (blob) {
|
|
295
|
+
var a = document.createElement('a');
|
|
296
|
+
a.href = URL.createObjectURL(blob); a.download = col.id + '.json';
|
|
297
|
+
document.body.appendChild(a); a.click(); a.remove();
|
|
298
|
+
});
|
|
299
|
+
hideColPreview();
|
|
300
|
+
});
|
|
272
301
|
_previewEl.classList.add('visible');
|
|
273
302
|
place();
|
|
274
303
|
}
|
|
@@ -1145,9 +1174,6 @@
|
|
|
1145
1174
|
item.addEventListener('mouseenter', function () { showColPreview(col, item); });
|
|
1146
1175
|
item.addEventListener('mouseleave', function () { _previewTimer = setTimeout(hideColPreview, 150); });
|
|
1147
1176
|
|
|
1148
|
-
// Right-click context menu
|
|
1149
|
-
addDockCtxMenu(item, col);
|
|
1150
|
-
|
|
1151
1177
|
colGroup.appendChild(item);
|
|
1152
1178
|
|
|
1153
1179
|
// Add to palette fuzzy search and command list
|
|
@@ -1314,81 +1340,6 @@
|
|
|
1314
1340
|
});
|
|
1315
1341
|
}
|
|
1316
1342
|
|
|
1317
|
-
// ── Dock right-click context menu ─────────────────────────────────────
|
|
1318
|
-
var _ctxMenu = null;
|
|
1319
|
-
|
|
1320
|
-
function buildCtxMenu() {
|
|
1321
|
-
_ctxMenu = document.createElement('div');
|
|
1322
|
-
_ctxMenu.className = 'xfce-ctx-menu';
|
|
1323
|
-
_ctxMenu.id = 'xfce-ctx-menu';
|
|
1324
|
-
document.body.appendChild(_ctxMenu);
|
|
1325
|
-
document.addEventListener('click', function (e) {
|
|
1326
|
-
if (_ctxMenu && !_ctxMenu.contains(e.target)) closeCtxMenu();
|
|
1327
|
-
}, true);
|
|
1328
|
-
document.addEventListener('keydown', function (e) {
|
|
1329
|
-
if (e.key === 'Escape') closeCtxMenu();
|
|
1330
|
-
});
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
function openCtxMenu(x, y, items) {
|
|
1334
|
-
if (!_ctxMenu) buildCtxMenu();
|
|
1335
|
-
_ctxMenu.innerHTML = items.map(function (it) {
|
|
1336
|
-
return '<button class="xfce-ctx-item" data-href="' + (it.href || '') + '">'
|
|
1337
|
-
+ '<span class="xfce-ctx-icon">' + it.icon + '</span>'
|
|
1338
|
-
+ '<span>' + it.label + '</span>'
|
|
1339
|
-
+ '</button>';
|
|
1340
|
-
}).join('');
|
|
1341
|
-
_ctxMenu.querySelectorAll('.xfce-ctx-item').forEach(function (btn) {
|
|
1342
|
-
btn.addEventListener('click', function () {
|
|
1343
|
-
var href = btn.dataset.href;
|
|
1344
|
-
closeCtxMenu();
|
|
1345
|
-
if (href) location.href = href;
|
|
1346
|
-
});
|
|
1347
|
-
});
|
|
1348
|
-
var vw = window.innerWidth, vh = window.innerHeight;
|
|
1349
|
-
_ctxMenu.style.display = 'block';
|
|
1350
|
-
var w = _ctxMenu.offsetWidth, h = _ctxMenu.offsetHeight;
|
|
1351
|
-
_ctxMenu.style.left = Math.min(x, vw - w - 8) + 'px';
|
|
1352
|
-
_ctxMenu.style.top = Math.min(y, vh - h - 8) + 'px';
|
|
1353
|
-
_ctxMenu.classList.add('open');
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
function closeCtxMenu() {
|
|
1357
|
-
if (!_ctxMenu) return;
|
|
1358
|
-
_ctxMenu.classList.remove('open');
|
|
1359
|
-
setTimeout(function () { if (_ctxMenu) _ctxMenu.style.display = 'none'; }, 120);
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
|
-
function addDockCtxMenu(item, col) {
|
|
1363
|
-
item.addEventListener('contextmenu', function (e) {
|
|
1364
|
-
e.preventDefault();
|
|
1365
|
-
var entriesHref = col.singleton
|
|
1366
|
-
? '/editor.html?collection=' + encodeURIComponent(col.id) + '&singleton=1'
|
|
1367
|
-
: '/entries.html?col=' + encodeURIComponent(col.id) + '&label=' + encodeURIComponent(col.label);
|
|
1368
|
-
var newHref = '/editor.html?collection=' + encodeURIComponent(col.id);
|
|
1369
|
-
openCtxMenu(e.clientX, e.clientY, [
|
|
1370
|
-
{ icon: '◫', label: 'View entries', href: entriesHref },
|
|
1371
|
-
{ icon: '+', label: 'New entry', href: newHref },
|
|
1372
|
-
{ icon: '↓', label: 'Export JSON', href: '' },
|
|
1373
|
-
]);
|
|
1374
|
-
// Wire export separately (needs fetch, not href)
|
|
1375
|
-
var exportBtn = _ctxMenu.querySelectorAll('.xfce-ctx-item')[2];
|
|
1376
|
-
if (exportBtn) {
|
|
1377
|
-
exportBtn.addEventListener('click', function (ev) {
|
|
1378
|
-
ev.stopImmediatePropagation();
|
|
1379
|
-
closeCtxMenu();
|
|
1380
|
-
fetch('/api/terminal/export?col=' + encodeURIComponent(col.id) + '&format=json&drafts=0', { credentials: 'include' })
|
|
1381
|
-
.then(function (r) { return r.blob(); })
|
|
1382
|
-
.then(function (blob) {
|
|
1383
|
-
var a = document.createElement('a');
|
|
1384
|
-
a.href = URL.createObjectURL(blob);
|
|
1385
|
-
a.download = col.id + '.json';
|
|
1386
|
-
document.body.appendChild(a); a.click(); a.remove();
|
|
1387
|
-
});
|
|
1388
|
-
}, { once: true });
|
|
1389
|
-
}
|
|
1390
|
-
});
|
|
1391
|
-
}
|
|
1392
1343
|
|
|
1393
1344
|
// ── Init ──────────────────────────────────────────────────────────────
|
|
1394
1345
|
function init() {
|