@a83/orbiter-admin 0.3.25 → 0.3.27

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a83/orbiter-admin",
3
- "version": "0.3.25",
3
+ "version": "0.3.27",
4
4
  "description": "Standalone admin server for Orbiter CMS",
5
5
  "type": "module",
6
6
  "main": "./src/server.js",
package/public/style.css CHANGED
@@ -2018,33 +2018,42 @@ a.xfce-sb-logo:hover { opacity: .8; }
2018
2018
  }
2019
2019
  .xfce-dock-item { position: relative; }
2020
2020
 
2021
- /* Quick-create button */
2022
- .xfce-dock-create {
2023
- background: color-mix(in srgb, var(--accent) 12%, transparent);
2024
- border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent) !important;
2025
- }
2026
- .xfce-dock-create .xfce-dock-icon {
2027
- font-size: 20px !important; font-family: inherit !important;
2028
- color: var(--accent) !important; font-weight: 400; opacity: 1 !important;
2021
+ /* Hover + badge above collection dock items */
2022
+ .xfce-col-create {
2023
+ position: fixed;
2024
+ z-index: 99990;
2025
+ width: 22px; height: 22px;
2026
+ border-radius: 50%;
2027
+ background: var(--accent);
2028
+ color: color-mix(in srgb, var(--bg1) 15%, #000);
2029
+ font-size: 17px; line-height: 22px; font-weight: 300;
2030
+ text-align: center; text-decoration: none;
2031
+ transform: translateX(-50%) translateY(6px);
2032
+ opacity: 0; pointer-events: none;
2033
+ transition: opacity .13s, transform .13s cubic-bezier(.34,1.5,.64,1);
2034
+ box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 55%, transparent);
2035
+ user-select: none;
2029
2036
  }
2030
-
2031
- /* Create popup header row */
2032
- .xfce-create-hdr {
2033
- display: flex; align-items: center; gap: 10px;
2034
- padding: 6px 12px 4px;
2035
- font-family: var(--mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
2036
- color: var(--muted); cursor: default; pointer-events: none;
2037
- border-bottom: 1px solid var(--line); margin-bottom: 2px;
2037
+ .xfce-col-create.visible {
2038
+ opacity: 1;
2039
+ transform: translateX(-50%) translateY(0);
2040
+ pointer-events: auto;
2038
2041
  }
2039
2042
 
2040
2043
  /* ── Command Palette ─────────────────────────────────────── */
2041
2044
  .xfce-palette {
2042
2045
  display: none; position: fixed; inset: 0; z-index: 10000;
2043
- background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
2044
- align-items: flex-start; justify-content: center;
2045
- padding-top: 12vh;
2046
+ background: rgba(0,0,0,0);
2047
+ align-items: flex-end; justify-content: center;
2048
+ padding-bottom: calc(var(--dock-h, 76px) + 28px);
2049
+ transition: background .2s;
2050
+ }
2051
+ .xfce-palette.open {
2052
+ display: flex;
2053
+ background: rgba(0,0,0,.55);
2054
+ backdrop-filter: blur(3px);
2055
+ -webkit-backdrop-filter: blur(3px);
2046
2056
  }
2047
- .xfce-palette.open { display: flex; }
2048
2057
 
2049
2058
  .xfce-palette-inner {
2050
2059
  width: min(560px, 92vw);
@@ -2053,8 +2062,15 @@ a.xfce-sb-logo:hover { opacity: .8; }
2053
2062
  -webkit-backdrop-filter: blur(8px) saturate(160%);
2054
2063
  border: 1px solid var(--line);
2055
2064
  border-radius: 12px;
2056
- box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 0 1px color-mix(in srgb,var(--accent) 20%,transparent);
2065
+ box-shadow: 0 -4px 40px rgba(0,0,0,.35), 0 0 0 1px color-mix(in srgb,var(--accent) 20%,transparent);
2057
2066
  overflow: hidden;
2067
+ transform: translateY(16px);
2068
+ opacity: 0;
2069
+ transition: transform .22s cubic-bezier(.34,1.15,.64,1), opacity .16s;
2070
+ }
2071
+ .xfce-palette.open .xfce-palette-inner {
2072
+ transform: translateY(0);
2073
+ opacity: 1;
2058
2074
  }
2059
2075
 
2060
2076
  .xfce-palette-bar {
package/public/xfce.js CHANGED
@@ -136,8 +136,6 @@
136
136
 
137
137
  // ── Tools popup ───────────────────────────────────────────────────────
138
138
  var toolsPopup;
139
- var createPopup;
140
- var _createCols = [];
141
139
 
142
140
  function buildToolsPopup() {
143
141
  toolsPopup = el('div', 'xfce-tools-popup');
@@ -167,40 +165,36 @@
167
165
  toolsPopup.classList.toggle('open');
168
166
  }
169
167
 
170
- // ── Create popup (+ button) ───────────────────────────────────────────
171
- function buildCreatePopup() {
172
- createPopup = el('div', 'xfce-tools-popup');
173
- createPopup.id = 'xfce-create-popup';
174
-
175
- var hdr = el('div', 'xfce-create-hdr');
176
- hdr.innerHTML = '<span class="xfce-tools-icon" style="font-family:var(--mono);font-size:13px">+</span><span>New entry in…</span>';
177
- createPopup.appendChild(hdr);
178
-
179
- _createCols.forEach(function (col) {
180
- var abbr = col.label.substring(0, 2);
181
- var isCurrent = (page === 'entries' && activeCol === col.id) || (page === 'editor' && activeCol === col.id);
182
- var href = col.singleton
183
- ? '/editor.html?collection=' + encodeURIComponent(col.id) + '&singleton=1'
184
- : '/editor.html?collection=' + encodeURIComponent(col.id);
185
- var a = el('a', 'xfce-tools-item' + (isCurrent ? ' active' : ''));
186
- a.href = href;
187
- a.innerHTML = '<span class="xfce-tools-icon" style="font-family:var(--mono);font-size:11px">' + abbr + '</span><span>' + col.label + '</span>';
188
- createPopup.appendChild(a);
168
+ // ── Hover + badge above collection items ─────────────────────────────
169
+ var colCreateEl, colCreateTimer;
170
+
171
+ function buildColCreate() {
172
+ colCreateEl = el('a', 'xfce-col-create');
173
+ colCreateEl.id = 'xfce-col-create';
174
+ colCreateEl.textContent = '+';
175
+ colCreateEl.addEventListener('mouseenter', function () {
176
+ clearTimeout(colCreateTimer);
177
+ });
178
+ colCreateEl.addEventListener('mouseleave', function () {
179
+ colCreateTimer = setTimeout(hideColCreate, 120);
189
180
  });
181
+ document.body.appendChild(colCreateEl);
182
+ }
190
183
 
191
- document.body.appendChild(createPopup);
192
- document.addEventListener('click', function () { createPopup.classList.remove('open'); });
193
- document.addEventListener('keydown', function (e) { if (e.key === 'Escape') createPopup.classList.remove('open'); });
184
+ function showColCreate(href, itemEl) {
185
+ if (!colCreateEl) buildColCreate();
186
+ clearTimeout(colCreateTimer);
187
+ var dock = document.getElementById('xfce-dock');
188
+ var dockTop = dock ? dock.getBoundingClientRect().top : 0;
189
+ var itemRect = itemEl.getBoundingClientRect();
190
+ colCreateEl.href = href;
191
+ colCreateEl.style.left = Math.round(itemRect.left + itemRect.width / 2) + 'px';
192
+ colCreateEl.style.top = Math.round(dockTop - 34) + 'px';
193
+ colCreateEl.classList.add('visible');
194
194
  }
195
195
 
196
- function toggleCreatePopup() {
197
- if (!createPopup) buildCreatePopup();
198
- var btn = document.getElementById('xfce-create-btn');
199
- if (btn) {
200
- var rect = btn.getBoundingClientRect();
201
- createPopup.style.left = Math.round(rect.left + rect.width / 2) + 'px';
202
- }
203
- createPopup.classList.toggle('open');
196
+ function hideColCreate() {
197
+ if (colCreateEl) colCreateEl.classList.remove('visible');
204
198
  }
205
199
 
206
200
  // ── Command Palette ───────────────────────────────────────────────────
@@ -308,15 +302,25 @@
308
302
 
309
303
  function openPalette() {
310
304
  if (!palette) buildPalette();
311
- palette.classList.add('open');
305
+ palette.style.display = 'flex';
312
306
  paletteInp.value = '';
313
307
  palActive = -1;
314
308
  renderPalette('');
315
- setTimeout(function () { paletteInp.focus(); }, 30);
309
+ // double rAF so display:flex has rendered before the transition fires
310
+ requestAnimationFrame(function () {
311
+ requestAnimationFrame(function () {
312
+ palette.classList.add('open');
313
+ setTimeout(function () { paletteInp.focus(); }, 40);
314
+ });
315
+ });
316
316
  }
317
317
 
318
318
  function closePalette() {
319
- if (palette) palette.classList.remove('open');
319
+ if (!palette) return;
320
+ palette.classList.remove('open');
321
+ setTimeout(function () {
322
+ if (!palette.classList.contains('open')) palette.style.display = 'none';
323
+ }, 220);
320
324
  }
321
325
 
322
326
  // ── Toast system ──────────────────────────────────────────────────────
@@ -794,24 +798,20 @@
794
798
  item.appendChild(badge);
795
799
  }
796
800
 
801
+ // Hover shows + badge above this item
802
+ var createHref = col.singleton
803
+ ? '/editor.html?collection=' + encodeURIComponent(col.id) + '&singleton=1'
804
+ : '/editor.html?collection=' + encodeURIComponent(col.id);
805
+ item.addEventListener('mouseenter', function () { showColCreate(createHref, item); });
806
+ item.addEventListener('mouseleave', function () {
807
+ colCreateTimer = setTimeout(hideColCreate, 120);
808
+ });
809
+
797
810
  colGroup.appendChild(item);
798
811
 
799
812
  // Add to palette
800
813
  _palItems.push({ icon: abbr, label: col.label, href: href, group: 'Collections' });
801
814
  });
802
-
803
- // Store for create popup
804
- _createCols = topLevel;
805
-
806
- // Always-visible + button opens the create popup
807
- var createBtn = makeDockItem('+', 'New', null, false, true);
808
- createBtn.id = 'xfce-create-btn';
809
- createBtn.classList.add('xfce-dock-create');
810
- createBtn.addEventListener('click', function (e) {
811
- e.stopPropagation();
812
- toggleCreatePopup();
813
- });
814
- colGroup.appendChild(createBtn);
815
815
  }
816
816
 
817
817
  // HUD pod section