@a83/orbiter-admin 0.3.24 → 0.3.25
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 +9 -0
- package/public/xfce.js +50 -7
package/package.json
CHANGED
package/public/style.css
CHANGED
|
@@ -2028,6 +2028,15 @@ a.xfce-sb-logo:hover { opacity: .8; }
|
|
|
2028
2028
|
color: var(--accent) !important; font-weight: 400; opacity: 1 !important;
|
|
2029
2029
|
}
|
|
2030
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;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2031
2040
|
/* ── Command Palette ─────────────────────────────────────── */
|
|
2032
2041
|
.xfce-palette {
|
|
2033
2042
|
display: none; position: fixed; inset: 0; z-index: 10000;
|
package/public/xfce.js
CHANGED
|
@@ -136,6 +136,8 @@
|
|
|
136
136
|
|
|
137
137
|
// ── Tools popup ───────────────────────────────────────────────────────
|
|
138
138
|
var toolsPopup;
|
|
139
|
+
var createPopup;
|
|
140
|
+
var _createCols = [];
|
|
139
141
|
|
|
140
142
|
function buildToolsPopup() {
|
|
141
143
|
toolsPopup = el('div', 'xfce-tools-popup');
|
|
@@ -165,6 +167,42 @@
|
|
|
165
167
|
toolsPopup.classList.toggle('open');
|
|
166
168
|
}
|
|
167
169
|
|
|
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);
|
|
189
|
+
});
|
|
190
|
+
|
|
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'); });
|
|
194
|
+
}
|
|
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');
|
|
204
|
+
}
|
|
205
|
+
|
|
168
206
|
// ── Command Palette ───────────────────────────────────────────────────
|
|
169
207
|
var palette, paletteInp, paletteResults, palActive = -1;
|
|
170
208
|
|
|
@@ -762,13 +800,18 @@
|
|
|
762
800
|
_palItems.push({ icon: abbr, label: col.label, href: href, group: 'Collections' });
|
|
763
801
|
});
|
|
764
802
|
|
|
765
|
-
//
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
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);
|
|
772
815
|
}
|
|
773
816
|
|
|
774
817
|
// HUD pod section
|