Initial commit: unified dashboard suite state with Khira and Image Manipulator 3-file setup
This commit is contained in:
@@ -0,0 +1,663 @@
|
||||
// ── Per-Field Toggle Bulk Edit Modal ──
|
||||
function showBulkEditFieldModal(path, colsStr) {
|
||||
const cols = colsStr.split(",");
|
||||
const modes = [
|
||||
{ v: "set", l: "Set Value" }, { v: "pattern", l: "Pattern {i}" },
|
||||
{ v: "sequence", l: "Sequence" }, { v: "find_replace", l: "Find & Replace" },
|
||||
{ v: "regex", l: "Regex" }, { v: "increment", l: "Increment" },
|
||||
{ v: "prefix_suffix", l: "Prefix/Suffix" }, { v: "conditional", l: "Conditional" }
|
||||
];
|
||||
const modeOpts = modes.map(m => `<option value="${m.v}">${m.l}</option>`).join("");
|
||||
const colOpts = cols.map(c => `<option value="${c}">${c}</option>`).join("");
|
||||
|
||||
let fieldsHtml = cols.map(c => `
|
||||
<div class="field-config" id="fc_${c}" data-field="${c}">
|
||||
<div class="field-config-header">
|
||||
<label class="toggle-switch">
|
||||
<input type="checkbox" onchange="toggleFieldConfig('${c}',this.checked)"/>
|
||||
<span class="toggle-slider"></span>
|
||||
</label>
|
||||
<span class="field-name">${c}</span>
|
||||
<span class="field-badge">unchanged</span>
|
||||
</div>
|
||||
<div class="field-config-body">
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr;gap:8px">
|
||||
<div><label class="label-sm">Mode</label><select class="input input-sm" id="fc_mode_${c}" onchange="updateFieldModeUI('${c}')">${modeOpts}</select></div>
|
||||
<div><label class="label-sm">Type</label><select class="input input-sm" id="fc_type_${c}"><option value="string">String</option><option value="number">Number</option></select></div>
|
||||
</div>
|
||||
<div id="fc_opts_${c}" class="mt-sm">
|
||||
<div id="fc_set_${c}"><label class="label-sm mt-sm">Value</label><input class="input input-sm" id="fc_val_${c}" placeholder="Enter value..."></div>
|
||||
<div id="fc_pattern_${c}" style="display:none"><label class="label-sm mt-sm">Pattern</label><input class="input input-sm" id="fc_pat_${c}" placeholder="e.g. image_{i}.webp">
|
||||
<label class="label-sm mt-sm">Start {i} at</label><input class="input input-sm" id="fc_patstart_${c}" type="number" value="1"></div>
|
||||
<div id="fc_sequence_${c}" style="display:none"><label class="label-sm mt-sm">Start #</label><input class="input input-sm" id="fc_seqstart_${c}" type="number" value="1"></div>
|
||||
<div id="fc_find_replace_${c}" style="display:none"><label class="label-sm mt-sm">Find</label><input class="input input-sm" id="fc_find_${c}"><label class="label-sm mt-sm">Replace</label><input class="input input-sm" id="fc_repl_${c}"></div>
|
||||
<div id="fc_regex_${c}" style="display:none"><label class="label-sm mt-sm">Regex</label><input class="input input-sm font-mono" id="fc_rxfind_${c}"><label class="label-sm mt-sm">Replace</label><input class="input input-sm font-mono" id="fc_rxrepl_${c}"><label class="label-sm mt-sm">Start {i}</label><input class="input input-sm" id="fc_rxstart_${c}" type="number" value="1"></div>
|
||||
<div id="fc_increment_${c}" style="display:none"><label class="label-sm mt-sm">Increment By</label><input class="input input-sm" id="fc_inc_${c}" type="number" value="1"></div>
|
||||
<div id="fc_prefix_suffix_${c}" style="display:none"><label class="label-sm mt-sm">Prefix</label><input class="input input-sm" id="fc_pfx_${c}"><label class="label-sm mt-sm">Suffix</label><input class="input input-sm" id="fc_sfx_${c}"></div>
|
||||
<div id="fc_conditional_${c}" style="display:none">
|
||||
<div style="padding:8px;background:var(--bg-input);border-radius:6px;margin-top:6px">
|
||||
<label class="label-sm" style="color:var(--warning)">IF condition:</label>
|
||||
<div style="display:grid;grid-template-columns:1fr auto 1fr;gap:4px;margin-top:4px">
|
||||
<select class="input input-sm" id="fc_condfield_${c}">${colOpts}</select>
|
||||
<select class="input input-sm" id="fc_condop_${c}"><option value="equals">equals</option><option value="not_equals">≠</option><option value="contains">contains</option><option value="starts_with">starts</option><option value="ends_with">ends</option></select>
|
||||
<input class="input input-sm" id="fc_condval_${c}" placeholder="value">
|
||||
</div>
|
||||
</div>
|
||||
<label class="label-sm mt-sm">THEN set to</label><input class="input input-sm" id="fc_condnew_${c}" placeholder="e.g. premium_{i}">
|
||||
<label class="label-sm mt-sm">Start {i}</label><input class="input input-sm" id="fc_condstart_${c}" type="number" value="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`).join("");
|
||||
|
||||
const overlay = document.createElement("div");
|
||||
overlay.className = "modal-overlay";
|
||||
overlay.innerHTML = `<div class="modal-box modal-wide"><h3><i class="fa-solid fa-bolt" style="color:var(--accent)"></i> Per-Field Bulk Edit</h3>
|
||||
<div style="padding:8px 12px;background:var(--bg-card);border-radius:var(--radius-sm);margin-bottom:12px;font-size:11px;color:var(--text-muted)">
|
||||
<i class="fa-solid fa-info-circle text-info"></i> Toggle switches ON for fields you want to edit. Each field gets its own mode and settings.
|
||||
<br><strong class="text-accent">Placeholders:</strong> <code class="font-mono text-accent">{i}</code> counter · <code class="font-mono text-accent">{idx}</code> index · <code class="font-mono text-accent">{total}</code> total · <code class="font-mono text-accent">{value}</code> current · <code class="font-mono text-accent">{field_name}</code> other field
|
||||
</div>
|
||||
<div id="fieldConfigList">${fieldsHtml}</div>
|
||||
<div class="modal-actions"><button class="btn btn-ghost" id="mdCancel">Cancel</button><button class="btn btn-primary" id="mdConfirm"><i class="fa-solid fa-check"></i> Apply Changes</button></div></div>`;
|
||||
document.body.appendChild(overlay);
|
||||
overlay.querySelector("#mdCancel").onclick = () => overlay.remove();
|
||||
overlay.addEventListener("click", e => { if (e.target === overlay) overlay.remove(); });
|
||||
overlay.querySelector("#mdConfirm").onclick = async () => {
|
||||
const fields = {};
|
||||
cols.forEach(c => {
|
||||
const el = document.getElementById("fc_" + c);
|
||||
const chk = el.querySelector("input[type=checkbox]");
|
||||
if (!chk.checked) return;
|
||||
const mode = document.getElementById("fc_mode_" + c).value;
|
||||
const cfg = { enabled: true, mode, value_type: document.getElementById("fc_type_" + c).value };
|
||||
if (mode === "set") cfg.new_value = document.getElementById("fc_val_" + c).value;
|
||||
else if (mode === "pattern") { cfg.new_value = document.getElementById("fc_pat_" + c).value; cfg.start_counter = document.getElementById("fc_patstart_" + c).value; }
|
||||
else if (mode === "sequence") cfg.start_counter = document.getElementById("fc_seqstart_" + c).value;
|
||||
else if (mode === "find_replace") { cfg.find_text = document.getElementById("fc_find_" + c).value; cfg.replace_text = document.getElementById("fc_repl_" + c).value; }
|
||||
else if (mode === "regex") { cfg.find_text = document.getElementById("fc_rxfind_" + c).value; cfg.replace_text = document.getElementById("fc_rxrepl_" + c).value; cfg.start_counter = document.getElementById("fc_rxstart_" + c).value; }
|
||||
else if (mode === "increment") cfg.increment_by = document.getElementById("fc_inc_" + c).value;
|
||||
else if (mode === "prefix_suffix") { cfg.prefix = document.getElementById("fc_pfx_" + c).value; cfg.suffix = document.getElementById("fc_sfx_" + c).value; }
|
||||
else if (mode === "conditional") { cfg.condition_field = document.getElementById("fc_condfield_" + c).value; cfg.condition_op = document.getElementById("fc_condop_" + c).value; cfg.condition_value = document.getElementById("fc_condval_" + c).value; cfg.new_value = document.getElementById("fc_condnew_" + c).value; cfg.start_counter = document.getElementById("fc_condstart_" + c).value; }
|
||||
fields[c] = cfg;
|
||||
});
|
||||
if (Object.keys(fields).length === 0) { toast("Enable at least one field", "error"); return; }
|
||||
const r = await api("/bulk/edit_multi_field", { path, fields });
|
||||
if (r.success) { loadNode(path); toast(`Edited ${r.modified} items`); overlay.remove(); }
|
||||
else toast(r.error, "error");
|
||||
};
|
||||
}
|
||||
|
||||
function toggleFieldConfig(field, checked) {
|
||||
const el = document.getElementById("fc_" + field);
|
||||
if (checked) { el.classList.add("active"); el.querySelector(".field-badge").textContent = "editing"; el.querySelector(".field-badge").style.color = "var(--success)"; }
|
||||
else { el.classList.remove("active"); el.querySelector(".field-badge").textContent = "unchanged"; el.querySelector(".field-badge").style.color = ""; }
|
||||
}
|
||||
|
||||
function updateFieldModeUI(field) {
|
||||
const mode = document.getElementById("fc_mode_" + field).value;
|
||||
const allModes = ["set", "pattern", "sequence", "find_replace", "regex", "increment", "prefix_suffix", "conditional"];
|
||||
allModes.forEach(m => { const el = document.getElementById("fc_" + m + "_" + field); if (el) el.style.display = m === mode ? "block" : "none"; });
|
||||
}
|
||||
|
||||
// ── Edit Item Modal ──
|
||||
function editItemModal(path, idx) {
|
||||
api("/node/get", { path }).then(data => {
|
||||
if (!data.items) return;
|
||||
const item = data.items[idx], cols = data.columns || Object.keys(item);
|
||||
let fields = cols.map(c => `<label class="label mt-sm">${c}</label><input class="input" id="mdEI_${c}" value="${item[c] !== null && item[c] !== undefined ? String(item[c]).replace(/"/g, """) : ""}">`).join("");
|
||||
showModal(`Edit Item #${idx}`, fields, async () => {
|
||||
const newItem = {}; cols.forEach(c => newItem[c] = document.getElementById(`mdEI_${c}`).value);
|
||||
const r = await api("/node/edit_item", { path, index: idx, item: newItem });
|
||||
if (r.success) { loadNode(path); toast("Updated"); } else toast(r.error, "error");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// ── Multi-Category Add Field + Append Modal ──
|
||||
let _mcFieldCounter = 0;
|
||||
async function showMultiCatAddFieldModal() {
|
||||
const discovery = await api("/discover_arrays", {});
|
||||
if (!discovery.success) { toast("No data loaded", "error"); return; }
|
||||
const catTree = discovery.category_tree || [];
|
||||
const allArrays = discovery.arrays || [];
|
||||
if (allArrays.length === 0) { toast("No arrays found in JSON", "error"); return; }
|
||||
_mcFieldCounter = 0;
|
||||
|
||||
function buildCatTreeHtml(nodes, indent) {
|
||||
let h = "";
|
||||
for (const n of nodes) {
|
||||
const isArr = n.is_array === true;
|
||||
const pad = indent * 18;
|
||||
const icon = isArr ? "fa-layer-group text-info" : "fa-folder text-warning";
|
||||
const badge = isArr ? `<span class="cat-count">${n.count}</span>` : "";
|
||||
const fields = (n.sample_fields || []).length ? `<span style="font-size:9px;color:var(--text-dim);margin-left:4px">[${n.sample_fields.slice(0,3).join(", ")}${n.sample_fields.length>3?"...":""}]</span>` : "";
|
||||
|
||||
if (isArr) {
|
||||
h += `<div class="cat-tree-item" style="margin-left:${pad}px">
|
||||
<input type="checkbox" class="mc-target" value="${n.path}" data-fields='${JSON.stringify(n.sample_fields||[])}'>
|
||||
<i class="fa-solid ${icon}" style="font-size:11px;width:14px"></i>
|
||||
<span style="flex:1">${n.key}</span>${badge}${fields}</div>`;
|
||||
} else {
|
||||
h += `<div class="cat-tree-item" style="margin-left:${pad}px;font-weight:700;color:var(--text-primary)">
|
||||
<input type="checkbox" class="mc-cat-toggle" onchange="toggleCatChildren(this)">
|
||||
<i class="fa-solid ${icon}" style="font-size:11px;width:14px"></i>
|
||||
<span style="flex:1">${n.key}</span></div>`;
|
||||
}
|
||||
if (n.children && n.children.length > 0) {
|
||||
h += `<div class="mc-cat-group">${buildCatTreeHtml(n.children, indent + 1)}</div>`;
|
||||
}
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
const treeHtml = buildCatTreeHtml(catTree, 0);
|
||||
|
||||
const overlay = document.createElement("div");
|
||||
overlay.className = "modal-overlay";
|
||||
overlay.innerHTML = `<div class="modal-box modal-wide" style="width:860px;max-width:96vw">
|
||||
<h3><i class="fa-solid fa-wand-magic-sparkles" style="color:var(--accent)"></i> Multi-Category Add Field + Append</h3>
|
||||
<div style="padding:8px 12px;background:var(--bg-card);border-radius:var(--radius-sm);margin-bottom:12px;font-size:11px;color:var(--text-muted)">
|
||||
<i class="fa-solid fa-info-circle text-info"></i> Select <strong>categories/subcategories</strong> to target, define fields to add/modify, then optionally append new items.
|
||||
<br><strong class="text-accent">Placeholders:</strong> <code class="font-mono text-accent">{i}</code> counter · <code class="font-mono text-accent">{idx}</code> index · <code class="font-mono text-accent">{total}</code> total
|
||||
</div>
|
||||
|
||||
<div style="display:grid;grid-template-columns:280px 1fr;gap:14px">
|
||||
<!-- Left: Category Tree -->
|
||||
<div>
|
||||
<div class="section-title"><i class="fa-solid fa-sitemap"></i> TARGET CATEGORIES</div>
|
||||
<div class="card" style="margin:0;max-height:380px;overflow-y:auto;padding:8px">
|
||||
<div class="cat-tree-item" style="border-bottom:1px solid var(--border);padding-bottom:6px;margin-bottom:4px">
|
||||
<input type="checkbox" id="mcSelAll" onchange="document.querySelectorAll('.mc-target,.mc-cat-toggle').forEach(c=>c.checked=this.checked);document.querySelectorAll('.mc-cat-toggle').forEach(c=>toggleCatChildren(c))">
|
||||
<strong>Select All</strong><span class="cat-count">${allArrays.length} arrays</span>
|
||||
</div>
|
||||
${treeHtml}
|
||||
</div>
|
||||
<div style="font-size:10px;color:var(--text-dim);margin-top:4px"><span id="mcSelectedCount">0</span> arrays selected</div>
|
||||
</div>
|
||||
|
||||
<!-- Right: Field Definitions -->
|
||||
<div>
|
||||
<div class="section-title"><i class="fa-solid fa-columns"></i> FIELDS TO ADD/MODIFY</div>
|
||||
<div id="mcFieldList" style="max-height:250px;overflow-y:auto"></div>
|
||||
<button class="btn btn-ghost btn-sm mt-sm" onclick="addMcField()"><i class="fa-solid fa-plus"></i> Add Field</button>
|
||||
|
||||
<div style="margin-top:14px;border-top:1px solid var(--border);padding-top:12px">
|
||||
<div class="section-title"><i class="fa-solid fa-plus-circle"></i> ALSO APPEND NEW ITEMS (optional)</div>
|
||||
<div style="display:flex;gap:10px;align-items:center">
|
||||
<label class="toggle-switch">
|
||||
<input type="checkbox" id="mcAppendToggle">
|
||||
<span class="toggle-slider"></span>
|
||||
</label>
|
||||
<span style="font-size:12px;font-weight:600">Append new items to each target</span>
|
||||
</div>
|
||||
<div id="mcAppendOpts" style="display:none;margin-top:8px">
|
||||
<label class="label-sm">Number of items to append per target</label>
|
||||
<input class="input input-sm" type="number" id="mcAppendCount" value="10" style="width:100px">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-actions">
|
||||
<button class="btn btn-ghost" id="mcCancel">Cancel</button>
|
||||
<button class="btn btn-primary" id="mcApply"><i class="fa-solid fa-check"></i> Apply to Selected Targets</button>
|
||||
</div>
|
||||
</div>`;
|
||||
document.body.appendChild(overlay);
|
||||
|
||||
overlay.querySelector("#mcAppendToggle").onchange = function() {
|
||||
overlay.querySelector("#mcAppendOpts").style.display = this.checked ? "block" : "none";
|
||||
};
|
||||
|
||||
overlay.addEventListener("change", () => {
|
||||
const count = overlay.querySelectorAll(".mc-target:checked").length;
|
||||
overlay.querySelector("#mcSelectedCount").textContent = count;
|
||||
});
|
||||
|
||||
addMcField();
|
||||
|
||||
overlay.querySelector("#mcCancel").onclick = () => overlay.remove();
|
||||
overlay.addEventListener("click", e => { if (e.target === overlay) overlay.remove(); });
|
||||
|
||||
overlay.querySelector("#mcApply").onclick = async () => {
|
||||
const targetPaths = [];
|
||||
overlay.querySelectorAll(".mc-target:checked").forEach(cb => targetPaths.push(cb.value));
|
||||
if (targetPaths.length === 0) { toast("Select at least one target array", "error"); return; }
|
||||
|
||||
const fieldRows = document.querySelectorAll(".mc-field-row");
|
||||
const fieldDefs = [];
|
||||
for (const row of fieldRows) {
|
||||
const name = row.querySelector(".mc-f-name").value.trim();
|
||||
if (!name) continue;
|
||||
const distMode = row.querySelector(".mc-f-dist").value;
|
||||
const def = {
|
||||
name,
|
||||
type: row.querySelector(".mc-f-type").value,
|
||||
value: row.querySelector(".mc-f-val").value,
|
||||
use_pattern: row.querySelector(".mc-f-pattern").checked,
|
||||
start: parseInt(row.querySelector(".mc-f-start").value || 1),
|
||||
dist_mode: distMode
|
||||
};
|
||||
if (distMode === "random") {
|
||||
def.dist_rand_primary = row.querySelector(".mc-f-rand-prim").value;
|
||||
def.dist_rand_secondary = row.querySelector(".mc-f-rand-sec").value;
|
||||
def.dist_rand_pct = parseInt(row.querySelector(".mc-f-rand-pct").value || 50);
|
||||
} else if (distMode === "cyclic") {
|
||||
def.dist_pattern = row.querySelector(".mc-f-cyclic-pat").value;
|
||||
}
|
||||
fieldDefs.push(def);
|
||||
}
|
||||
if (fieldDefs.length === 0) { toast("Add at least one field", "error"); return; }
|
||||
|
||||
const targets = targetPaths.map(p => ({ path: p, fields: fieldDefs }));
|
||||
const body = { targets };
|
||||
if (document.getElementById("mcAppendToggle").checked) {
|
||||
body.append_items = true;
|
||||
body.append_count = parseInt(document.getElementById("mcAppendCount").value || 0);
|
||||
}
|
||||
|
||||
const r = await api("/bulk/add_field_multi", body);
|
||||
if (r.success) {
|
||||
toast(`Modified ${r.modified} fields across ${r.targets} targets` + (r.appended > 0 ? `, appended ${r.appended} items` : ""));
|
||||
refreshTree(r.tree);
|
||||
if (currentPath) loadNode(currentPath);
|
||||
overlay.remove();
|
||||
} else toast(r.error, "error");
|
||||
};
|
||||
}
|
||||
|
||||
function addMcField() {
|
||||
_mcFieldCounter++;
|
||||
const id = _mcFieldCounter;
|
||||
const row = document.createElement("div");
|
||||
row.className = "mc-field-row field-config active";
|
||||
row.style.cssText = "padding:8px 10px;margin-bottom:6px";
|
||||
row.innerHTML = `
|
||||
<div style="display:grid;grid-template-columns:1fr 80px 1fr 40px 60px 90px 28px;gap:6px;align-items:end">
|
||||
<div><label class="label-sm">Field Name</label><input class="input input-sm mc-f-name" placeholder="e.g. thumbnail"></div>
|
||||
<div><label class="label-sm">Type</label><select class="input input-sm mc-f-type"><option value="string">String</option><option value="number">Number</option><option value="boolean">Bool</option></select></div>
|
||||
<div><label class="label-sm">Value / Pattern</label><input class="input input-sm mc-f-val" placeholder="e.g. thumb_{i}.webp"></div>
|
||||
<div style="text-align:center"><label class="label-sm" title="Use pattern placeholders like {i}">{i}?</label><input type="checkbox" class="mc-f-pattern" checked style="margin-top:4px;accent-color:var(--accent)"></div>
|
||||
<div><label class="label-sm">Start #</label><input class="input input-sm mc-f-start" type="number" value="1"></div>
|
||||
<div><label class="label-sm">Dist</label><select class="input input-sm mc-f-dist" onchange="toggleMcFieldDist(this)"><option value="static">Static</option><option value="random">Random %</option><option value="cyclic">Cyclic</option></select></div>
|
||||
<div><button class="btn-icon btn-sm" onclick="this.closest('.mc-field-row').remove()" title="Remove"><i class="fa-solid fa-times" style="color:var(--danger)"></i></button></div>
|
||||
</div>
|
||||
<div class="mc-f-dist-opts" style="display:none;margin-top:6px;padding:6px 8px;background:var(--bg-input);border-radius:6px">
|
||||
<div class="mc-f-random-opts" style="display:none">
|
||||
<div style="display:grid;grid-template-columns:1fr 60px 1fr;gap:6px;align-items:end">
|
||||
<div><label class="label-sm">Primary</label><input class="input input-sm mc-f-rand-prim" value="free" placeholder="e.g. free"></div>
|
||||
<div><label class="label-sm">%</label><input class="input input-sm mc-f-rand-pct" type="number" value="70" style="text-align:center"></div>
|
||||
<div><label class="label-sm">Secondary</label><input class="input input-sm mc-f-rand-sec" value="paid" placeholder="e.g. paid"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mc-f-cyclic-opts" style="display:none">
|
||||
<label class="label-sm">Cyclic Pattern (comma-separated)</label>
|
||||
<input class="input input-sm mc-f-cyclic-pat" placeholder="free, free, paid" value="">
|
||||
</div>
|
||||
</div>`;
|
||||
document.getElementById("mcFieldList").appendChild(row);
|
||||
}
|
||||
|
||||
function toggleMcFieldDist(sel) {
|
||||
const row = sel.closest(".mc-field-row");
|
||||
const mode = sel.value;
|
||||
const optsWrap = row.querySelector(".mc-f-dist-opts");
|
||||
const randomOpts = row.querySelector(".mc-f-random-opts");
|
||||
const cyclicOpts = row.querySelector(".mc-f-cyclic-opts");
|
||||
|
||||
if (mode === "static") {
|
||||
optsWrap.style.display = "none";
|
||||
} else {
|
||||
optsWrap.style.display = "block";
|
||||
randomOpts.style.display = mode === "random" ? "block" : "none";
|
||||
cyclicOpts.style.display = mode === "cyclic" ? "block" : "none";
|
||||
}
|
||||
// When using distribution, disable pattern checkbox and value field
|
||||
const patternCb = row.querySelector(".mc-f-pattern");
|
||||
const valInput = row.querySelector(".mc-f-val");
|
||||
if (mode !== "static") {
|
||||
patternCb.checked = false;
|
||||
patternCb.disabled = true;
|
||||
valInput.disabled = true;
|
||||
valInput.style.opacity = "0.4";
|
||||
} else {
|
||||
patternCb.disabled = false;
|
||||
valInput.disabled = false;
|
||||
valInput.style.opacity = "1";
|
||||
}
|
||||
}
|
||||
|
||||
function toggleCatChildren(checkbox) {
|
||||
const group = checkbox.closest(".cat-tree-item").nextElementSibling;
|
||||
if (group && group.classList.contains("mc-cat-group")) {
|
||||
group.querySelectorAll(".mc-target").forEach(cb => cb.checked = checkbox.checked);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Multi-Category Append Panel ──
|
||||
let _apFieldCounter = 0;
|
||||
async function showAppendPanel(path) {
|
||||
const anal = await api("/analyze_category", { path });
|
||||
if (!anal.success) return;
|
||||
const fields = anal.fields, samples = anal.samples, inappOpts = anal.inapp_options;
|
||||
|
||||
const discovery = await api("/discover_arrays", {});
|
||||
const allArrays = discovery.success ? discovery.arrays : [];
|
||||
const catTree = discovery.success ? (discovery.category_tree || []) : [];
|
||||
_apFieldCounter = 0;
|
||||
|
||||
const wrap = document.getElementById("appendPanelWrap") || document.getElementById("editorArea");
|
||||
|
||||
// Build field rows HTML with per-field distribution
|
||||
let fHtml = "";
|
||||
fields.forEach((f, fi) => {
|
||||
_apFieldCounter++;
|
||||
const fid = _apFieldCounter;
|
||||
let v = samples[f] || "";
|
||||
if (f === "coordinates") v = "{line}";
|
||||
else if (typeof v === "string" && v.includes("http")) v = v.replace(/(\d+)(?=\.\w+$)/, "{i}");
|
||||
fHtml += _buildAppendFieldRow(fid, f, v, false);
|
||||
});
|
||||
|
||||
// Build hierarchical category tree for multi-target
|
||||
let catHtml = "";
|
||||
if (allArrays.length > 1) {
|
||||
function buildAppendTree(nodes, indent) {
|
||||
let h = "";
|
||||
for (const n of nodes) {
|
||||
const pad = indent * 16;
|
||||
if (n.is_array) {
|
||||
h += `<div class="cat-tree-item" style="margin-left:${pad}px">
|
||||
<input type="checkbox" class="ap-target" value="${n.path}" ${n.path === path ? "checked" : ""}>
|
||||
<i class="fa-solid fa-layer-group text-info" style="font-size:10px;width:14px"></i>
|
||||
<span>${n.key}</span><span class="cat-count">${n.count}</span></div>`;
|
||||
} else {
|
||||
h += `<div class="cat-tree-item" style="margin-left:${pad}px;font-weight:700;color:var(--text-primary)">
|
||||
<input type="checkbox" class="ap-cat-toggle" onchange="let g=this.closest('.cat-tree-item').nextElementSibling;if(g)g.querySelectorAll('.ap-target').forEach(c=>c.checked=this.checked)">
|
||||
<i class="fa-solid fa-folder text-warning" style="font-size:10px;width:14px"></i>
|
||||
<span>${n.key}</span></div>`;
|
||||
}
|
||||
if (n.children && n.children.length) {
|
||||
h += `<div class="ap-cat-group">${buildAppendTree(n.children, indent + 1)}</div>`;
|
||||
}
|
||||
}
|
||||
return h;
|
||||
}
|
||||
|
||||
catHtml = `<div class="card" style="margin:0"><div class="section-title"><i class="fa-solid fa-sitemap"></i> TARGET ARRAYS (multi-select)</div>
|
||||
<div class="cat-tree" id="apCatTree">
|
||||
<div class="cat-tree-item" style="border-bottom:1px solid var(--border);padding-bottom:4px;margin-bottom:4px">
|
||||
<input type="checkbox" id="apSelAll" onchange="toggleAllTargets(this.checked)"><strong>Select All</strong><span class="cat-count">${allArrays.length}</span>
|
||||
</div>
|
||||
${buildAppendTree(catTree, 0)}
|
||||
</div></div>`;
|
||||
}
|
||||
|
||||
let panelHtml = `<div class="card slide-up" id="appendCard"><div class="card-header"><span class="card-title"><i class="fa-solid fa-bolt"></i> Bulk Append to ${path.split("/").pop()}</span>
|
||||
<button class="btn-icon btn-sm" onclick="document.getElementById('appendCard').remove()"><i class="fa-solid fa-times"></i></button></div>
|
||||
<div class="append-panel">
|
||||
<div class="card" style="margin:0"><div class="section-title"><i class="fa-solid fa-file-lines"></i> DATA FILE (optional)</div>
|
||||
<input type="file" class="input input-sm" id="apDataFile"><div id="apFileStatus" style="color:var(--success);font-size:11px;margin-top:4px"></div>
|
||||
<div class="section-title mt-md"><i class="fa-solid fa-sliders"></i> COUNT</div>
|
||||
<div style="display:flex;gap:8px"><div><label class="label-sm">Manual Count</label><input class="input input-sm" type="number" id="apManualCount" value="10"></div>
|
||||
<div><label class="label-sm">Limit</label><input class="input input-sm" type="number" id="apLimit" value="0" placeholder="0=all"></div></div>
|
||||
<div style="text-align:center;font-size:12px;margin-top:6px;color:var(--info)">Generating <strong id="apTotal">0</strong> items</div>
|
||||
</div>
|
||||
<div style="display:flex;flex-direction:column;gap:14px">
|
||||
${catHtml}
|
||||
<div class="card" style="margin:0"><div class="section-title"><i class="fa-solid fa-wand-magic-sparkles"></i> FIELD PATTERNS <span style="font-size:9px;color:var(--text-dim);font-weight:400">— per-field distribution supported</span></div>
|
||||
<div style="padding:4px 8px;background:var(--bg-card);border-radius:var(--radius-sm);margin-bottom:8px;font-size:10px;color:var(--text-muted)">
|
||||
Each field can be: <strong>Static</strong> (pattern with {i}), <strong>Random %</strong> (e.g. 70% free / 30% paid), or <strong>Cyclic</strong> (e.g. free, free, paid).
|
||||
</div>
|
||||
<div id="apFieldsContainer">${fHtml}</div>
|
||||
<button class="btn btn-ghost btn-sm mt-sm" onclick="addAppendField()"><i class="fa-solid fa-plus"></i> Add Column</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="full-width" style="display:flex;gap:8px"><button class="btn btn-primary" style="flex:1" onclick="doPreviewAppend('${path}')"><i class="fa-solid fa-eye"></i> Preview</button></div>
|
||||
<div class="full-width" id="apPreviewWrap" style="display:none"><div class="preview-box"><pre id="apPreviewJSON"></pre></div>
|
||||
<div style="display:flex;gap:8px;margin-top:8px"><button class="btn btn-success" style="flex:1" onclick="doCommitAppend('${path}')"><i class="fa-solid fa-check"></i> Append <span id="apPreviewCount"></span> items</button></div></div>
|
||||
</div></div>`;
|
||||
|
||||
if (document.getElementById("appendPanelWrap")) document.getElementById("appendPanelWrap").innerHTML = panelHtml;
|
||||
else wrap.innerHTML += panelHtml;
|
||||
|
||||
// Events
|
||||
document.getElementById("apDataFile").addEventListener("change", e => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = ev => {
|
||||
const lines = ev.target.result.split("\n").filter(l => l.trim() && !l.startsWith("#"));
|
||||
document.getElementById("apFileStatus").textContent = lines.length + " lines found";
|
||||
document.getElementById("apManualCount").value = lines.length;
|
||||
updateAppendTotal();
|
||||
};
|
||||
reader.readAsText(e.target.files[0]);
|
||||
});
|
||||
|
||||
const updateAppendTotal = () => {
|
||||
const mc = parseInt(document.getElementById("apManualCount").value || 0);
|
||||
const lim = parseInt(document.getElementById("apLimit").value || 0);
|
||||
document.getElementById("apTotal").textContent = lim > 0 ? Math.min(mc, lim) : mc;
|
||||
};
|
||||
document.getElementById("apManualCount").oninput = updateAppendTotal;
|
||||
document.getElementById("apLimit").oninput = updateAppendTotal;
|
||||
updateAppendTotal();
|
||||
}
|
||||
|
||||
function _buildAppendFieldRow(fid, fieldName, defaultPattern, isNew) {
|
||||
return `<div class="ap-field-row" data-field="${fieldName}" data-fid="${fid}" style="display:flex;flex-wrap:wrap;gap:6px;align-items:end;padding:6px 0;border-bottom:1px solid var(--border)">
|
||||
<span style="min-width:90px;font-weight:600;font-size:11px;color:var(--accent);font-family:'JetBrains Mono',monospace;align-self:center">${isNew ? `<input class="input input-sm ap-f-name" value="${fieldName}" placeholder="field_name" style="width:80px;font-weight:600;color:var(--accent)">` : fieldName}</span>
|
||||
<input class="input input-sm ap-f-pattern" name="pattern_${fieldName}" value="${defaultPattern}" style="flex:1;min-width:120px" placeholder="Pattern or value...">
|
||||
<input class="input input-sm ap-f-start" name="start_${fieldName}" type="number" value="1" style="width:55px;text-align:center">
|
||||
<select class="input input-sm ap-f-dist" style="width:90px" onchange="toggleApFieldDist(this)">
|
||||
<option value="static">Static</option>
|
||||
<option value="random">Random %</option>
|
||||
<option value="cyclic">Cyclic</option>
|
||||
</select>
|
||||
<button class="btn-icon btn-sm" onclick="this.closest('.ap-field-row').remove()" title="Remove"><i class="fa-solid fa-times" style="color:var(--danger)"></i></button>
|
||||
<div class="ap-f-dist-wrap" style="display:none;width:100%;padding:6px 8px;background:var(--bg-input);border-radius:6px;margin-top:2px">
|
||||
<div class="ap-f-random-opts" style="display:none">
|
||||
<div style="display:grid;grid-template-columns:1fr 55px 1fr;gap:6px;align-items:end">
|
||||
<div><label class="label-sm">Primary</label><input class="input input-sm ap-f-rand-prim" value="free" placeholder="e.g. free"></div>
|
||||
<div><label class="label-sm">%</label><input class="input input-sm ap-f-rand-pct" type="number" value="70" style="text-align:center"></div>
|
||||
<div><label class="label-sm">Secondary</label><input class="input input-sm ap-f-rand-sec" value="paid" placeholder="e.g. paid"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ap-f-cyclic-opts" style="display:none">
|
||||
<label class="label-sm">Cyclic Pattern (comma-separated)</label>
|
||||
<input class="input input-sm ap-f-cyclic-pat" placeholder="free, free, paid" value="">
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
function addAppendField() {
|
||||
_apFieldCounter++;
|
||||
const fid = _apFieldCounter;
|
||||
const container = document.getElementById("apFieldsContainer");
|
||||
const tmp = document.createElement("div");
|
||||
tmp.innerHTML = _buildAppendFieldRow(fid, "new_field", "", true);
|
||||
container.appendChild(tmp.firstElementChild);
|
||||
// Focus the name input
|
||||
const nameInp = container.lastElementChild.querySelector(".ap-f-name");
|
||||
if (nameInp) { nameInp.value = ""; nameInp.focus(); }
|
||||
}
|
||||
|
||||
function toggleApFieldDist(sel) {
|
||||
const row = sel.closest(".ap-field-row");
|
||||
const mode = sel.value;
|
||||
const wrap = row.querySelector(".ap-f-dist-wrap");
|
||||
const randomOpts = row.querySelector(".ap-f-random-opts");
|
||||
const cyclicOpts = row.querySelector(".ap-f-cyclic-opts");
|
||||
const patternInput = row.querySelector(".ap-f-pattern");
|
||||
|
||||
if (mode === "static") {
|
||||
wrap.style.display = "none";
|
||||
patternInput.disabled = false;
|
||||
patternInput.style.opacity = "1";
|
||||
} else {
|
||||
wrap.style.display = "block";
|
||||
randomOpts.style.display = mode === "random" ? "block" : "none";
|
||||
cyclicOpts.style.display = mode === "cyclic" ? "block" : "none";
|
||||
patternInput.disabled = true;
|
||||
patternInput.style.opacity = "0.4";
|
||||
}
|
||||
}
|
||||
|
||||
function toggleAllTargets(checked) {
|
||||
document.querySelectorAll(".ap-target").forEach(cb => cb.checked = checked);
|
||||
}
|
||||
|
||||
async function doPreviewAppend(path) {
|
||||
const fd = new FormData();
|
||||
const cf = document.getElementById("apDataFile").files[0];
|
||||
if (cf) fd.append("data_file", cf);
|
||||
|
||||
const mc = parseInt(document.getElementById("apManualCount").value || 10);
|
||||
const lim = parseInt(document.getElementById("apLimit").value || 0);
|
||||
fd.append("manual_count", mc);
|
||||
fd.append("limit_count", lim > 0 ? Math.min(mc, lim) : mc);
|
||||
|
||||
// Collect field order, patterns, starts, and per-field distributions
|
||||
const fieldRows = document.querySelectorAll("#apFieldsContainer .ap-field-row");
|
||||
const fieldOrder = [];
|
||||
const fieldDistributions = {};
|
||||
|
||||
fieldRows.forEach(row => {
|
||||
const nameEl = row.querySelector(".ap-f-name");
|
||||
const fieldName = nameEl ? nameEl.value.trim() : row.dataset.field;
|
||||
if (!fieldName) return;
|
||||
|
||||
// Update name attributes on dynamic fields
|
||||
const patInput = row.querySelector(".ap-f-pattern");
|
||||
const startInput = row.querySelector(".ap-f-start");
|
||||
if (patInput) patInput.name = `pattern_${fieldName}`;
|
||||
if (startInput) startInput.name = `start_${fieldName}`;
|
||||
|
||||
fieldOrder.push(fieldName);
|
||||
fd.append(`pattern_${fieldName}`, patInput ? patInput.value : "");
|
||||
fd.append(`start_${fieldName}`, startInput ? startInput.value : "1");
|
||||
|
||||
const distMode = row.querySelector(".ap-f-dist").value;
|
||||
if (distMode !== "static") {
|
||||
const distEntry = { mode: distMode };
|
||||
if (distMode === "random") {
|
||||
distEntry.rand_primary = row.querySelector(".ap-f-rand-prim").value;
|
||||
distEntry.rand_secondary = row.querySelector(".ap-f-rand-sec").value;
|
||||
distEntry.rand_pct = parseInt(row.querySelector(".ap-f-rand-pct").value || 50);
|
||||
} else if (distMode === "cyclic") {
|
||||
distEntry.pattern = row.querySelector(".ap-f-cyclic-pat").value;
|
||||
}
|
||||
fieldDistributions[fieldName] = distEntry;
|
||||
}
|
||||
});
|
||||
|
||||
fd.append("field_order", fieldOrder.join(","));
|
||||
fd.append("field_distributions", JSON.stringify(fieldDistributions));
|
||||
|
||||
// No longer need legacy dist fields — per-field handles it all
|
||||
fd.append("dist_field", "");
|
||||
fd.append("dist_mode", "static");
|
||||
|
||||
const r = await api("/preview_append", fd, true);
|
||||
if (r.success) {
|
||||
previewData = r.preview;
|
||||
document.getElementById("apPreviewWrap").style.display = "block";
|
||||
document.getElementById("apPreviewJSON").textContent = JSON.stringify(r.preview.slice(0, 5), null, 2) + (r.total_count > 5 ? "\n..." : "");
|
||||
document.getElementById("apPreviewCount").textContent = r.total_count;
|
||||
if (r.file_lines) document.getElementById("apFileStatus").textContent = r.file_lines + " lines loaded";
|
||||
} else toast(r.error, "error");
|
||||
}
|
||||
|
||||
async function doCommitAppend(path) {
|
||||
const targets = [];
|
||||
document.querySelectorAll(".ap-target:checked").forEach(cb => targets.push(cb.value));
|
||||
if (targets.length === 0) targets.push(path);
|
||||
|
||||
const r = await api("/commit_append", { path, target_paths: targets, items: previewData });
|
||||
if (r.success) {
|
||||
toast(`Appended ${r.count} items to ${r.targets} target(s)!`);
|
||||
refreshTree(r.tree);
|
||||
loadNode(path);
|
||||
const ac = document.getElementById("appendCard");
|
||||
if (ac) ac.remove();
|
||||
} else toast(r.error, "error");
|
||||
}
|
||||
|
||||
// ── Raw Editor ──
|
||||
async function toggleRawEditor() {
|
||||
rawMode = !rawMode;
|
||||
if (rawMode) {
|
||||
const r = await fetch("/raw/get").then(r => r.json());
|
||||
document.getElementById("rawTextarea").value = r.raw;
|
||||
document.getElementById("rawEditorArea").classList.remove("d-none");
|
||||
document.getElementById("editorArea").classList.add("d-none");
|
||||
document.getElementById("emptyState").style.display = "none";
|
||||
} else {
|
||||
const r = await api("/raw/set", { content: document.getElementById("rawTextarea").value });
|
||||
if (r.success) { refreshTree(r.tree); toast("JSON updated"); }
|
||||
else { toast(r.error, "error"); return; }
|
||||
document.getElementById("rawEditorArea").classList.add("d-none");
|
||||
document.getElementById("editorArea").classList.remove("d-none");
|
||||
if (currentPath) loadNode(currentPath);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Search ──
|
||||
let searchTimeout;
|
||||
function handleSearch(q) {
|
||||
clearTimeout(searchTimeout);
|
||||
if (!q.trim()) { renderTree(treeData); return; }
|
||||
searchTimeout = setTimeout(async () => {
|
||||
const r = await api("/search", { query: q });
|
||||
if (r.results && r.results.length) {
|
||||
const area = document.getElementById("editorArea");
|
||||
area.classList.remove("d-none");
|
||||
document.getElementById("emptyState").style.display = "none";
|
||||
let html = `<div class="card slide-up"><div class="card-header"><span class="card-title"><i class="fa-solid fa-search"></i> ${r.results.length} results</span></div>`;
|
||||
r.results.forEach(res => {
|
||||
html += `<div class="field-row" style="cursor:pointer" onclick="loadNode('${res.path.split("/").slice(0, -1).join("/")}')">
|
||||
<span class="field-type-badge type-${res.match_type === "key" ? "string" : "number"}">${res.match_type}</span>
|
||||
<span style="font-weight:600;font-size:11px;color:var(--accent);font-family:'JetBrains Mono',monospace">${res.path}</span>
|
||||
<span style="flex:1;font-size:11px;color:var(--text-muted)">${res.preview}</span></div>`;
|
||||
});
|
||||
html += "</div>";
|
||||
area.innerHTML = html;
|
||||
}
|
||||
}, 300);
|
||||
}
|
||||
|
||||
// ── Modal System ──
|
||||
function showModal(title, bodyHtml, onConfirm) {
|
||||
const overlay = document.createElement("div");
|
||||
overlay.className = "modal-overlay";
|
||||
overlay.innerHTML = `<div class="modal-box"><h3><i class="fa-solid fa-pen-to-square" style="color:var(--accent)"></i> ${title}</h3><div id="mdBody">${bodyHtml}</div>
|
||||
<div class="modal-actions"><button class="btn btn-ghost" id="mdCancel">Cancel</button><button class="btn btn-primary" id="mdConfirm">Confirm</button></div></div>`;
|
||||
document.body.appendChild(overlay);
|
||||
overlay.querySelector("#mdCancel").onclick = () => overlay.remove();
|
||||
overlay.querySelector("#mdConfirm").onclick = async () => { await onConfirm(); overlay.remove(); };
|
||||
overlay.addEventListener("click", e => { if (e.target === overlay) overlay.remove(); });
|
||||
setTimeout(() => { const inp = overlay.querySelector("input:not([type=hidden]):not([type=checkbox])"); if (inp) inp.focus(); }, 50);
|
||||
}
|
||||
|
||||
function renameFieldInline(el, path, key) {
|
||||
const orig = el.textContent;
|
||||
el.contentEditable = true; el.focus();
|
||||
const sel = window.getSelection(); sel.selectAllChildren(el);
|
||||
el.onblur = async () => {
|
||||
el.contentEditable = false;
|
||||
if (el.textContent !== orig) {
|
||||
const r = await api("/node/rename", { path: path + "/" + key, new_name: el.textContent });
|
||||
if (r.success) { refreshTree(r.tree); loadNode(path); toast("Renamed"); }
|
||||
else { el.textContent = orig; toast(r.error, "error"); }
|
||||
}
|
||||
};
|
||||
el.onkeydown = e => { if (e.key === "Enter") { e.preventDefault(); el.blur(); } if (e.key === "Escape") { el.textContent = orig; el.blur(); } };
|
||||
}
|
||||
|
||||
// ── Keyboard Shortcuts ──
|
||||
document.addEventListener("keydown", e => {
|
||||
if ((e.ctrlKey || e.metaKey) && e.key === "z") { e.preventDefault(); doUndo(); }
|
||||
if ((e.ctrlKey || e.metaKey) && e.key === "y") { e.preventDefault(); doRedo(); }
|
||||
if ((e.ctrlKey || e.metaKey) && e.key === "s") { e.preventDefault(); saveSession(); }
|
||||
if ((e.ctrlKey || e.metaKey) && e.key === "f") { e.preventDefault(); document.getElementById("searchInput").focus(); }
|
||||
});
|
||||
@@ -0,0 +1,801 @@
|
||||
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");
|
||||
|
||||
:root {
|
||||
--bg-primary: #0a0e1a;
|
||||
--bg-secondary: #111827;
|
||||
--bg-tertiary: #1a2236;
|
||||
--bg-card: #151d2e;
|
||||
--bg-card-hover: #1c2740;
|
||||
--bg-input: #0d1220;
|
||||
--bg-elevated: #1e293b;
|
||||
--accent: #6366f1;
|
||||
--accent-hover: #4f46e5;
|
||||
--accent-glow: rgba(99, 102, 241, 0.25);
|
||||
--accent-subtle: rgba(99, 102, 241, 0.08);
|
||||
--accent2: #8b5cf6;
|
||||
--accent2-glow: rgba(139, 92, 246, 0.2);
|
||||
--success: #10b981;
|
||||
--success-glow: rgba(16, 185, 129, 0.2);
|
||||
--warning: #f59e0b;
|
||||
--warning-glow: rgba(245, 158, 11, 0.15);
|
||||
--danger: #ef4444;
|
||||
--danger-glow: rgba(239, 68, 68, 0.15);
|
||||
--info: #06b6d4;
|
||||
--info-glow: rgba(6, 182, 212, 0.15);
|
||||
--pink: #ec4899;
|
||||
--orange: #fb923c;
|
||||
--text-primary: #f1f5f9;
|
||||
--text-secondary: #94a3b8;
|
||||
--text-muted: #64748b;
|
||||
--text-dim: #475569;
|
||||
--border: #1e293b;
|
||||
--border-light: #334155;
|
||||
--border-focus: #6366f1;
|
||||
--glass: rgba(21, 29, 46, 0.85);
|
||||
--glass-border: rgba(148, 163, 184, 0.08);
|
||||
--radius: 12px;
|
||||
--radius-sm: 8px;
|
||||
--radius-xs: 6px;
|
||||
--radius-pill: 100px;
|
||||
--shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
|
||||
--shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.25);
|
||||
--shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
|
||||
--transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
--transition-fast: all 0.15s ease;
|
||||
}
|
||||
|
||||
*, *::before, *::after {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Inter", -apple-system, sans-serif;
|
||||
background: var(--bg-primary);
|
||||
color: var(--text-primary);
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
/* Scrollbar */
|
||||
::-webkit-scrollbar { width: 5px; height: 5px; }
|
||||
::-webkit-scrollbar-track { background: transparent; }
|
||||
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
|
||||
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
|
||||
::selection { background: var(--accent); color: white; }
|
||||
|
||||
/* === LAYOUT === */
|
||||
.app-layout {
|
||||
display: grid;
|
||||
grid-template-columns: 272px 1fr;
|
||||
grid-template-rows: 1fr;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
/* === SIDEBAR === */
|
||||
.sidebar {
|
||||
background: var(--bg-secondary);
|
||||
border-right: 1px solid var(--border);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
.sidebar-header {
|
||||
padding: 14px 16px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.sidebar-logo {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: linear-gradient(135deg, var(--accent), var(--accent2));
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 13px;
|
||||
color: white;
|
||||
flex-shrink: 0;
|
||||
box-shadow: 0 2px 8px var(--accent-glow);
|
||||
}
|
||||
.sidebar-header h1 {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.3px;
|
||||
background: linear-gradient(135deg, var(--accent), var(--accent2));
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
.sidebar-actions {
|
||||
padding: 8px 10px;
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.sidebar-search {
|
||||
padding: 8px 10px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
position: relative;
|
||||
}
|
||||
.sidebar-search i {
|
||||
position: absolute;
|
||||
left: 18px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: var(--text-dim);
|
||||
font-size: 11px;
|
||||
pointer-events: none;
|
||||
}
|
||||
.sidebar-search input {
|
||||
width: 100%;
|
||||
background: var(--bg-input);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-xs);
|
||||
padding: 7px 10px 7px 30px;
|
||||
color: var(--text-primary);
|
||||
font-size: 12px;
|
||||
outline: none;
|
||||
transition: var(--transition);
|
||||
font-family: inherit;
|
||||
}
|
||||
.sidebar-search input:focus {
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 0 3px var(--accent-glow);
|
||||
}
|
||||
.sidebar-search input::placeholder { color: var(--text-dim); }
|
||||
|
||||
/* Tree */
|
||||
.tree-container { flex: 1; overflow-y: auto; padding: 6px; }
|
||||
.tree-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 5px 10px;
|
||||
border-radius: var(--radius-xs);
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
color: var(--text-secondary);
|
||||
transition: var(--transition-fast);
|
||||
gap: 7px;
|
||||
user-select: none;
|
||||
}
|
||||
.tree-node:hover { background: var(--bg-card-hover); color: var(--text-primary); }
|
||||
.tree-node.active {
|
||||
background: linear-gradient(135deg, var(--accent), var(--accent2));
|
||||
color: white;
|
||||
box-shadow: 0 2px 8px var(--accent-glow);
|
||||
}
|
||||
.tree-node .node-icon { font-size: 11px; width: 14px; text-align: center; flex-shrink: 0; }
|
||||
.tree-node .node-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
|
||||
.tree-node .node-badge {
|
||||
font-size: 9px;
|
||||
background: rgba(255,255,255,0.07);
|
||||
padding: 1px 6px;
|
||||
border-radius: var(--radius-pill);
|
||||
color: var(--text-dim);
|
||||
font-weight: 600;
|
||||
}
|
||||
.tree-node.active .node-badge { background: rgba(255,255,255,0.2); color: rgba(255,255,255,0.9); }
|
||||
.tree-children { margin-left: 14px; border-left: 1px solid var(--border); padding-left: 2px; }
|
||||
.tree-children.collapsed { display: none; }
|
||||
.tree-toggle { font-size: 9px; width: 14px; text-align: center; transition: transform 0.2s; cursor: pointer; color: var(--text-dim); }
|
||||
.tree-toggle.open { transform: rotate(90deg); }
|
||||
|
||||
/* === MAIN CONTENT === */
|
||||
.main-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
background: var(--bg-primary);
|
||||
}
|
||||
|
||||
/* Top Bar */
|
||||
.top-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 8px 20px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: var(--bg-secondary);
|
||||
min-height: 46px;
|
||||
gap: 12px;
|
||||
}
|
||||
.breadcrumb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 500;
|
||||
}
|
||||
.breadcrumb span { cursor: pointer; transition: var(--transition-fast); }
|
||||
.breadcrumb span:hover { color: var(--accent); }
|
||||
.breadcrumb .sep { color: var(--text-dim); font-size: 10px; }
|
||||
.top-actions { display: flex; gap: 5px; align-items: center; }
|
||||
|
||||
/* Content Area */
|
||||
.content-area { flex: 1; overflow-y: auto; padding: 20px; }
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
color: var(--text-dim);
|
||||
gap: 14px;
|
||||
}
|
||||
.empty-state i { font-size: 52px; opacity: 0.15; }
|
||||
.empty-state p { font-size: 14px; color: var(--text-muted); }
|
||||
|
||||
/* === BUTTONS === */
|
||||
.btn {
|
||||
padding: 6px 14px;
|
||||
border-radius: var(--radius-xs);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: var(--transition);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-family: inherit;
|
||||
letter-spacing: 0.01em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.btn-primary {
|
||||
background: linear-gradient(135deg, var(--accent), var(--accent2));
|
||||
color: white;
|
||||
box-shadow: 0 2px 8px var(--accent-glow);
|
||||
}
|
||||
.btn-primary:hover { filter: brightness(1.15); box-shadow: 0 4px 16px var(--accent-glow); transform: translateY(-1px); }
|
||||
.btn-success { background: var(--success); color: white; }
|
||||
.btn-success:hover { filter: brightness(1.15); box-shadow: 0 2px 12px var(--success-glow); }
|
||||
.btn-danger { background: var(--danger); color: white; }
|
||||
.btn-danger:hover { filter: brightness(1.1); }
|
||||
.btn-ghost {
|
||||
background: transparent;
|
||||
color: var(--text-secondary);
|
||||
border: 1px solid var(--border-light);
|
||||
}
|
||||
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--text-dim); }
|
||||
.btn-sm { padding: 4px 10px; font-size: 11px; }
|
||||
.btn-xs { padding: 3px 8px; font-size: 10px; }
|
||||
.btn-icon {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: var(--radius-xs);
|
||||
background: transparent;
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-secondary);
|
||||
cursor: pointer;
|
||||
transition: var(--transition-fast);
|
||||
}
|
||||
.btn-icon:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-light); }
|
||||
|
||||
/* === CARDS === */
|
||||
.card {
|
||||
background: var(--glass);
|
||||
backdrop-filter: blur(12px);
|
||||
border: 1px solid var(--glass-border);
|
||||
border-radius: var(--radius);
|
||||
padding: 16px;
|
||||
margin-bottom: 16px;
|
||||
box-shadow: var(--shadow-sm);
|
||||
animation: fadeIn 0.2s ease;
|
||||
}
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 14px;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
.card-title {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.8px;
|
||||
color: var(--text-muted);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.card-title i { color: var(--accent); }
|
||||
|
||||
/* === DATA TABLE === */
|
||||
.data-table-wrap {
|
||||
overflow: auto;
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
.data-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 12px;
|
||||
}
|
||||
.data-table th {
|
||||
background: var(--bg-tertiary);
|
||||
padding: 8px 12px;
|
||||
text-align: left;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: 10px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
.data-table td {
|
||||
padding: 6px 12px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
color: var(--text-secondary);
|
||||
max-width: 200px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 11px;
|
||||
}
|
||||
.data-table tr:hover td { background: var(--bg-card-hover); color: var(--text-primary); }
|
||||
.data-table .row-actions { display: flex; gap: 4px; opacity: 0; transition: var(--transition-fast); }
|
||||
.data-table tr:hover .row-actions { opacity: 1; }
|
||||
.cell-editable { cursor: pointer; border-radius: 3px; }
|
||||
.cell-editable:hover { background: var(--accent-subtle); outline: 1px solid var(--accent); }
|
||||
.row-idx { color: var(--text-dim); font-size: 10px; width: 36px; text-align: center; font-family: "JetBrains Mono", monospace; }
|
||||
|
||||
/* === FIELD ROW (Object Editor) === */
|
||||
.field-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.field-row:last-child { border-bottom: none; }
|
||||
.field-key {
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
color: var(--accent);
|
||||
min-width: 120px;
|
||||
cursor: pointer;
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
}
|
||||
.field-value { flex: 1; }
|
||||
.field-type-badge {
|
||||
font-size: 9px;
|
||||
padding: 2px 8px;
|
||||
border-radius: var(--radius-pill);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.3px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.type-string { background: rgba(16, 185, 129, 0.1); color: var(--success); }
|
||||
.type-number { background: rgba(99, 102, 241, 0.1); color: var(--accent); }
|
||||
.type-boolean { background: var(--warning-glow); color: var(--warning); }
|
||||
.type-null { background: rgba(100, 116, 139, 0.1); color: var(--text-dim); }
|
||||
.type-object { background: var(--accent2-glow); color: var(--accent2); }
|
||||
.type-array { background: var(--info-glow); color: var(--info); }
|
||||
.type-url { background: rgba(236, 72, 153, 0.1); color: var(--pink); }
|
||||
.type-coordinate { background: rgba(251, 146, 60, 0.1); color: var(--orange); }
|
||||
.type-color { background: rgba(139, 92, 246, 0.1); color: var(--accent2); }
|
||||
|
||||
/* === INPUTS === */
|
||||
.input {
|
||||
width: 100%;
|
||||
background: var(--bg-input);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-xs);
|
||||
padding: 8px 12px;
|
||||
color: var(--text-primary);
|
||||
font-size: 12px;
|
||||
font-family: inherit;
|
||||
outline: none;
|
||||
transition: var(--transition);
|
||||
}
|
||||
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
|
||||
.input::placeholder { color: var(--text-dim); }
|
||||
.input-sm { padding: 5px 8px; font-size: 11px; }
|
||||
select.input { cursor: pointer; appearance: auto; }
|
||||
textarea.input {
|
||||
resize: vertical;
|
||||
min-height: 60px;
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* === TOGGLE SWITCH === */
|
||||
.toggle-switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 38px;
|
||||
height: 20px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.toggle-switch input { opacity: 0; width: 0; height: 0; }
|
||||
.toggle-slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
inset: 0;
|
||||
background: var(--border-light);
|
||||
border-radius: var(--radius-pill);
|
||||
transition: var(--transition);
|
||||
}
|
||||
.toggle-slider::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
left: 3px;
|
||||
bottom: 3px;
|
||||
background: var(--text-muted);
|
||||
border-radius: 50%;
|
||||
transition: var(--transition);
|
||||
}
|
||||
.toggle-switch input:checked + .toggle-slider {
|
||||
background: linear-gradient(135deg, var(--accent), var(--accent2));
|
||||
box-shadow: 0 0 8px var(--accent-glow);
|
||||
}
|
||||
.toggle-switch input:checked + .toggle-slider::before {
|
||||
transform: translateX(18px);
|
||||
background: white;
|
||||
}
|
||||
|
||||
/* === CONTEXT MENU === */
|
||||
.ctx-menu {
|
||||
position: fixed;
|
||||
background: var(--bg-elevated);
|
||||
border: 1px solid var(--border-light);
|
||||
border-radius: var(--radius);
|
||||
padding: 4px;
|
||||
box-shadow: var(--shadow);
|
||||
z-index: 9999;
|
||||
min-width: 190px;
|
||||
animation: scaleIn 0.12s ease;
|
||||
}
|
||||
.ctx-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 7px 12px;
|
||||
font-size: 12px;
|
||||
color: var(--text-secondary);
|
||||
cursor: pointer;
|
||||
border-radius: var(--radius-xs);
|
||||
transition: var(--transition-fast);
|
||||
font-weight: 500;
|
||||
}
|
||||
.ctx-item:hover { background: var(--accent); color: white; }
|
||||
.ctx-item i { width: 16px; text-align: center; font-size: 11px; }
|
||||
.ctx-sep { height: 1px; background: var(--border); margin: 3px 8px; }
|
||||
.ctx-item.danger { color: var(--danger); }
|
||||
.ctx-item.danger:hover { background: var(--danger); color: white; }
|
||||
|
||||
/* === TOAST === */
|
||||
.toast-container {
|
||||
position: fixed;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
z-index: 99999;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
.toast {
|
||||
padding: 10px 18px;
|
||||
border-radius: var(--radius);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: white;
|
||||
box-shadow: var(--shadow);
|
||||
animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 240px;
|
||||
backdrop-filter: blur(8px);
|
||||
}
|
||||
.toast-success { background: linear-gradient(135deg, #059669, #10b981); }
|
||||
.toast-error { background: linear-gradient(135deg, #dc2626, #ef4444); }
|
||||
.toast-info { background: linear-gradient(135deg, #4f46e5, #6366f1); }
|
||||
|
||||
/* === MODAL === */
|
||||
.modal-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.65);
|
||||
backdrop-filter: blur(6px);
|
||||
z-index: 9998;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
animation: fadeIn 0.15s ease;
|
||||
}
|
||||
.modal-box {
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border-light);
|
||||
border-radius: var(--radius);
|
||||
padding: 24px;
|
||||
width: 620px;
|
||||
max-width: 94vw;
|
||||
max-height: 85vh;
|
||||
overflow-y: auto;
|
||||
box-shadow: var(--shadow);
|
||||
animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
.modal-box h3 {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 18px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
.modal-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
margin-top: 18px;
|
||||
padding-top: 14px;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
|
||||
/* Wide modal for bulk edit */
|
||||
.modal-box.modal-wide {
|
||||
width: 780px;
|
||||
max-width: 96vw;
|
||||
}
|
||||
|
||||
/* === FIELD CONFIG CARD (per-field toggle in bulk edit) === */
|
||||
.field-config {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 10px 14px;
|
||||
margin-bottom: 8px;
|
||||
transition: var(--transition);
|
||||
}
|
||||
.field-config.active {
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 0 2px var(--accent-glow);
|
||||
background: var(--bg-card-hover);
|
||||
}
|
||||
.field-config-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.field-config-header .field-name {
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
color: var(--accent);
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
flex: 1;
|
||||
}
|
||||
.field-config-header .field-badge {
|
||||
font-size: 9px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
padding: 2px 8px;
|
||||
border-radius: var(--radius-pill);
|
||||
background: var(--accent-subtle);
|
||||
color: var(--accent);
|
||||
}
|
||||
.field-config-body {
|
||||
margin-top: 10px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid var(--border);
|
||||
display: none;
|
||||
}
|
||||
.field-config.active .field-config-body { display: block; }
|
||||
|
||||
/* === APPEND PANEL === */
|
||||
.append-panel {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 14px;
|
||||
}
|
||||
.append-panel .full-width { grid-column: 1/-1; }
|
||||
.preview-box {
|
||||
background: var(--bg-input);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 12px;
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
}
|
||||
.preview-box pre {
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
font-size: 11px;
|
||||
color: var(--info);
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* === CATEGORY TREE PICKER === */
|
||||
.cat-tree { max-height: 280px; overflow-y: auto; }
|
||||
.cat-tree-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 5px 8px;
|
||||
border-radius: var(--radius-xs);
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
transition: var(--transition-fast);
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
.cat-tree-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
|
||||
.cat-tree-item input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }
|
||||
.cat-tree-item .cat-count {
|
||||
font-size: 10px;
|
||||
color: var(--text-dim);
|
||||
background: var(--bg-tertiary);
|
||||
padding: 1px 7px;
|
||||
border-radius: var(--radius-pill);
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
font-weight: 600;
|
||||
}
|
||||
.cat-tree-children { margin-left: 20px; }
|
||||
|
||||
/* === STATUS BAR === */
|
||||
.status-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 5px 16px;
|
||||
border-top: 1px solid var(--border);
|
||||
background: var(--bg-secondary);
|
||||
font-size: 10px;
|
||||
color: var(--text-dim);
|
||||
font-weight: 500;
|
||||
}
|
||||
.status-bar .status-left,
|
||||
.status-bar .status-right { display: flex; align-items: center; gap: 12px; }
|
||||
|
||||
/* === TABS === */
|
||||
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 16px; }
|
||||
.tab {
|
||||
padding: 8px 16px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--text-dim);
|
||||
cursor: pointer;
|
||||
border-bottom: 2px solid transparent;
|
||||
transition: var(--transition);
|
||||
}
|
||||
.tab:hover { color: var(--text-primary); }
|
||||
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
|
||||
|
||||
/* === LABEL === */
|
||||
.label {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.4px;
|
||||
}
|
||||
.label-sm { font-size: 10px; margin-bottom: 3px; text-transform: none; letter-spacing: 0; }
|
||||
|
||||
/* === SECTION TITLE IN PANELS === */
|
||||
.section-title {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.8px;
|
||||
color: var(--text-dim);
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.section-title i { color: var(--accent); font-size: 10px; }
|
||||
|
||||
/* === CHIP / TAG === */
|
||||
.chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 11px;
|
||||
padding: 3px 10px;
|
||||
border-radius: var(--radius-pill);
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-secondary);
|
||||
border: 1px solid var(--border);
|
||||
cursor: pointer;
|
||||
transition: var(--transition-fast);
|
||||
font-weight: 500;
|
||||
}
|
||||
.chip:hover { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); }
|
||||
|
||||
/* === ANIMATIONS === */
|
||||
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
||||
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
|
||||
@keyframes slideIn {
|
||||
from { transform: translateX(100px); opacity: 0; }
|
||||
to { transform: translateX(0); opacity: 1; }
|
||||
}
|
||||
@keyframes slideUp {
|
||||
from { transform: translateY(12px); opacity: 0; }
|
||||
to { transform: translateY(0); opacity: 1; }
|
||||
}
|
||||
@keyframes fadeOut { to { opacity: 0; transform: translateX(60px); } }
|
||||
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
|
||||
|
||||
.fade-in { animation: fadeIn 0.2s ease; }
|
||||
.slide-up { animation: slideUp 0.25s ease; }
|
||||
.d-none { display: none !important; }
|
||||
|
||||
/* === HELPER === */
|
||||
.text-accent { color: var(--accent); }
|
||||
.text-muted { color: var(--text-muted); }
|
||||
.text-success { color: var(--success); }
|
||||
.text-warning { color: var(--warning); }
|
||||
.text-danger { color: var(--danger); }
|
||||
.text-info { color: var(--info); }
|
||||
.text-pink { color: var(--pink); }
|
||||
.text-orange { color: var(--orange); }
|
||||
.text-primary { color: var(--text-primary); }
|
||||
.gap-sm { gap: 6px; }
|
||||
.gap-md { gap: 10px; }
|
||||
.mt-sm { margin-top: 6px; }
|
||||
.mt-md { margin-top: 12px; }
|
||||
.mb-sm { margin-bottom: 6px; }
|
||||
.flex { display: flex; }
|
||||
.flex-1 { flex: 1; }
|
||||
.items-center { align-items: center; }
|
||||
.justify-between { justify-content: space-between; }
|
||||
.flex-wrap { flex-wrap: wrap; }
|
||||
.font-mono { font-family: "JetBrains Mono", monospace; }
|
||||
|
||||
/* === SAVE BUTTON & DIRTY INDICATOR === */
|
||||
.btn-save {
|
||||
background: linear-gradient(135deg, #3b82f6, #2563eb);
|
||||
color: #fff;
|
||||
border: 1px solid rgba(59, 130, 246, 0.3);
|
||||
font-weight: 600;
|
||||
}
|
||||
.btn-save:hover {
|
||||
background: linear-gradient(135deg, #2563eb, #1d4ed8);
|
||||
box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
|
||||
}
|
||||
.dirty-dot {
|
||||
color: var(--warning);
|
||||
font-size: 16px;
|
||||
margin-left: 6px;
|
||||
animation: pulse-dot 1.5s ease-in-out infinite;
|
||||
}
|
||||
@keyframes pulse-dot {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.3; }
|
||||
}
|
||||
|
||||
/* === MULTI-CAT GROUPS === */
|
||||
.mc-cat-group, .ap-cat-group { padding-left: 0; }
|
||||
|
||||
/* === TYPE BADGES EXTRA === */
|
||||
.type-coordinate { background: rgba(251, 146, 60, 0.12); color: var(--orange); }
|
||||
.type-url { background: rgba(236, 72, 153, 0.12); color: var(--pink); }
|
||||
.type-unknown { background: rgba(100, 116, 139, 0.12); color: var(--text-muted); }
|
||||
|
||||
/* === SCHEMA SUMMARY === */
|
||||
#schemaSummary {
|
||||
border-top: 1px solid var(--border);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user