@a83/orbiter-admin 0.3.41 → 0.3.43
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 +42 -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>',
|
|
@@ -158,6 +158,13 @@
|
|
|
158
158
|
a.innerHTML = '<span class="xfce-tools-icon">' + t.icon + '</span><span>' + t.label + '</span>';
|
|
159
159
|
toolsPopup.appendChild(a);
|
|
160
160
|
});
|
|
161
|
+
var settingsSep = document.createElement('div');
|
|
162
|
+
settingsSep.className = 'xfce-tools-sep';
|
|
163
|
+
toolsPopup.appendChild(settingsSep);
|
|
164
|
+
var settingsLink = el('a', 'xfce-tools-item' + (page === 'settings' ? ' active' : ''));
|
|
165
|
+
settingsLink.href = '/settings.html';
|
|
166
|
+
settingsLink.innerHTML = '<span class="xfce-tools-icon">⚙</span><span>Settings</span>';
|
|
167
|
+
toolsPopup.appendChild(settingsLink);
|
|
161
168
|
var sep = document.createElement('div');
|
|
162
169
|
sep.className = 'xfce-tools-sep';
|
|
163
170
|
toolsPopup.appendChild(sep);
|
|
@@ -204,10 +211,23 @@
|
|
|
204
211
|
|
|
205
212
|
function toggleToolsPopup() {
|
|
206
213
|
if (!toolsPopup) buildToolsPopup();
|
|
207
|
-
var btn
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
214
|
+
var btn = document.getElementById('xfce-tools-btn');
|
|
215
|
+
var dock = document.getElementById('xfce-dock');
|
|
216
|
+
var isLeft = document.documentElement.dataset.dockPos === 'left';
|
|
217
|
+
if (btn && dock) {
|
|
218
|
+
var bRect = btn.getBoundingClientRect();
|
|
219
|
+
var dRect = dock.getBoundingClientRect();
|
|
220
|
+
if (isLeft) {
|
|
221
|
+
toolsPopup.style.left = Math.round(dRect.right + 10) + 'px';
|
|
222
|
+
toolsPopup.style.top = Math.round(bRect.top + bRect.height / 2) + 'px';
|
|
223
|
+
toolsPopup.style.bottom = 'auto';
|
|
224
|
+
toolsPopup.style.transform = 'translateY(-50%)';
|
|
225
|
+
} else {
|
|
226
|
+
toolsPopup.style.left = Math.round(bRect.left + bRect.width / 2) + 'px';
|
|
227
|
+
toolsPopup.style.top = '';
|
|
228
|
+
toolsPopup.style.bottom = '';
|
|
229
|
+
toolsPopup.style.transform = '';
|
|
230
|
+
}
|
|
211
231
|
}
|
|
212
232
|
toolsPopup.classList.toggle('open');
|
|
213
233
|
}
|
|
@@ -268,7 +288,23 @@
|
|
|
268
288
|
_previewEl.innerHTML =
|
|
269
289
|
'<div class="xfce-preview-head"><a href="' + entriesHref + '">' + escHtml(col.label) + '</a></div>'
|
|
270
290
|
+ '<div class="xfce-preview-entries">' + rows + '</div>'
|
|
271
|
-
+ '<
|
|
291
|
+
+ '<div class="xfce-preview-actions">'
|
|
292
|
+
+ '<a class="xfce-preview-action" href="' + newHref + '">+ new entry</a>'
|
|
293
|
+
+ '<a class="xfce-preview-action" href="' + entriesHref + '">◫ view all</a>'
|
|
294
|
+
+ '<button class="xfce-preview-action xfce-preview-export" data-col="' + escHtml(col.id) + '">↓ export</button>'
|
|
295
|
+
+ '</div>';
|
|
296
|
+
var expBtn = _previewEl.querySelector('.xfce-preview-export');
|
|
297
|
+
if (expBtn) expBtn.addEventListener('click', function (ev) {
|
|
298
|
+
ev.preventDefault();
|
|
299
|
+
fetch('/api/terminal/export?col=' + encodeURIComponent(col.id) + '&format=json&drafts=0', { credentials: 'include' })
|
|
300
|
+
.then(function (r) { return r.blob(); })
|
|
301
|
+
.then(function (blob) {
|
|
302
|
+
var a = document.createElement('a');
|
|
303
|
+
a.href = URL.createObjectURL(blob); a.download = col.id + '.json';
|
|
304
|
+
document.body.appendChild(a); a.click(); a.remove();
|
|
305
|
+
});
|
|
306
|
+
hideColPreview();
|
|
307
|
+
});
|
|
272
308
|
_previewEl.classList.add('visible');
|
|
273
309
|
place();
|
|
274
310
|
}
|
|
@@ -1145,9 +1181,6 @@
|
|
|
1145
1181
|
item.addEventListener('mouseenter', function () { showColPreview(col, item); });
|
|
1146
1182
|
item.addEventListener('mouseleave', function () { _previewTimer = setTimeout(hideColPreview, 150); });
|
|
1147
1183
|
|
|
1148
|
-
// Right-click context menu
|
|
1149
|
-
addDockCtxMenu(item, col);
|
|
1150
|
-
|
|
1151
1184
|
colGroup.appendChild(item);
|
|
1152
1185
|
|
|
1153
1186
|
// Add to palette fuzzy search and command list
|
|
@@ -1314,81 +1347,6 @@
|
|
|
1314
1347
|
});
|
|
1315
1348
|
}
|
|
1316
1349
|
|
|
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
1350
|
|
|
1393
1351
|
// ── Init ──────────────────────────────────────────────────────────────
|
|
1394
1352
|
function init() {
|