fix: add missing exports to regenerated ui.js and search.js
This commit is contained in:
@@ -4,7 +4,7 @@ import { safeCreateIcons } from './utils.js';
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Search History Service (localStorage, LIFO, max 50, dedup)
|
// Search History Service (localStorage, LIFO, max 50, dedup)
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
const SearchHistory = {
|
export const SearchHistory = {
|
||||||
_load() {
|
_load() {
|
||||||
try {
|
try {
|
||||||
const raw = localStorage.getItem(SEARCH_HISTORY_KEY);
|
const raw = localStorage.getItem(SEARCH_HISTORY_KEY);
|
||||||
@@ -49,7 +49,7 @@ const SearchHistory = {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Query Parser — extracts operators (tag:, #, vault:, title:, path:, ext:)
|
// Query Parser — extracts operators (tag:, #, vault:, title:, path:, ext:)
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
const QueryParser = {
|
export const QueryParser = {
|
||||||
parse(raw) {
|
parse(raw) {
|
||||||
const result = { tags: [], vault: null, title: null, path: null, ext: null, freeText: "" };
|
const result = { tags: [], vault: null, title: null, path: null, ext: null, freeText: "" };
|
||||||
if (!raw) return result;
|
if (!raw) return result;
|
||||||
@@ -125,7 +125,7 @@ const QueryParser = {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Autocomplete Dropdown Controller
|
// Autocomplete Dropdown Controller
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
const AutocompleteDropdown = {
|
export const AutocompleteDropdown = {
|
||||||
_dropdown: null,
|
_dropdown: null,
|
||||||
_historySection: null,
|
_historySection: null,
|
||||||
_titlesSection: null,
|
_titlesSection: null,
|
||||||
@@ -400,7 +400,7 @@ const AutocompleteDropdown = {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Search Chips Controller — renders active filter chips from parsed query
|
// Search Chips Controller — renders active filter chips from parsed query
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
const SearchChips = {
|
export const SearchChips = {
|
||||||
_container: null,
|
_container: null,
|
||||||
init() {
|
init() {
|
||||||
this._container = document.getElementById("search-chips");
|
this._container = document.getElementById("search-chips");
|
||||||
@@ -482,7 +482,7 @@ function _triggerAdvancedSearch(rawQuery) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// ── Search toggle state ──
|
// ── Search toggle state ──
|
||||||
|
|
||||||
function initSearch() {
|
export function initSearch() {
|
||||||
const input = document.getElementById("search-input");
|
const input = document.getElementById("search-input");
|
||||||
if (!input) return;
|
if (!input) return;
|
||||||
const caseBtn = document.getElementById("search-case-btn");
|
const caseBtn = document.getElementById("search-case-btn");
|
||||||
@@ -711,7 +711,7 @@ function _isInputFocused() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- Backward-compatible search (existing /api/search endpoint) ---
|
// --- Backward-compatible search (existing /api/search endpoint) ---
|
||||||
async function performSearch(query, vaultFilter, tagFilter) {
|
export async function performSearch(query, vaultFilter, tagFilter) {
|
||||||
if (searchAbortController) state.searchAbortController.abort();
|
if (searchAbortController) state.searchAbortController.abort();
|
||||||
state.searchAbortController = new AbortController();
|
state.searchAbortController = new AbortController();
|
||||||
const searchId = ++state.currentSearchId;
|
const searchId = ++state.currentSearchId;
|
||||||
@@ -733,7 +733,7 @@ async function performSearch(query, vaultFilter, tagFilter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- Advanced search with TF-IDF, facets, pagination ---
|
// --- Advanced search with TF-IDF, facets, pagination ---
|
||||||
async function performAdvancedSearch(query, vaultFilter, tagFilter, offset, sort) {
|
export async function performAdvancedSearch(query, vaultFilter, tagFilter, offset, sort) {
|
||||||
if (searchAbortController) state.searchAbortController.abort();
|
if (searchAbortController) state.searchAbortController.abort();
|
||||||
state.searchAbortController = new AbortController();
|
state.searchAbortController = new AbortController();
|
||||||
const searchId = ++state.currentSearchId;
|
const searchId = ++state.currentSearchId;
|
||||||
@@ -785,7 +785,7 @@ async function performAdvancedSearch(query, vaultFilter, tagFilter, offset, sort
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- Legacy search results renderer (kept for backward compat) ---
|
// --- Legacy search results renderer (kept for backward compat) ---
|
||||||
function renderSearchResults(data, query, tagFilter) {
|
export function renderSearchResults(data, query, tagFilter) {
|
||||||
const area = document.getElementById("content-area");
|
const area = document.getElementById("content-area");
|
||||||
area.innerHTML = "";
|
area.innerHTML = "";
|
||||||
const header = buildSearchResultsHeader(data, query, tagFilter);
|
const header = buildSearchResultsHeader(data, query, tagFilter);
|
||||||
@@ -843,7 +843,7 @@ function renderSearchResults(data, query, tagFilter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- Advanced search results renderer (facets, highlighted snippets, pagination, sort) ---
|
// --- Advanced search results renderer (facets, highlighted snippets, pagination, sort) ---
|
||||||
function renderAdvancedSearchResults(data, query, tagFilter) {
|
export function renderAdvancedSearchResults(data, query, tagFilter) {
|
||||||
const area = document.getElementById("content-area");
|
const area = document.getElementById("content-area");
|
||||||
area.innerHTML = "";
|
area.innerHTML = "";
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -131,12 +131,12 @@ export const RightSidebarManager = {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Theme
|
// Theme
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
function initTheme() {
|
export function initTheme() {
|
||||||
const saved = localStorage.getItem("obsigate-theme") || "dark";
|
const saved = localStorage.getItem("obsigate-theme") || "dark";
|
||||||
applyTheme(saved);
|
applyTheme(saved);
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyTheme(theme) {
|
export function applyTheme(theme) {
|
||||||
document.documentElement.setAttribute("data-theme", theme);
|
document.documentElement.setAttribute("data-theme", theme);
|
||||||
localStorage.setItem("obsigate-theme", theme);
|
localStorage.setItem("obsigate-theme", theme);
|
||||||
|
|
||||||
@@ -161,12 +161,12 @@ function applyTheme(theme) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleTheme() {
|
export function toggleTheme() {
|
||||||
const current = document.documentElement.getAttribute("data-theme");
|
const current = document.documentElement.getAttribute("data-theme");
|
||||||
applyTheme(current === "dark" ? "light" : "dark");
|
applyTheme(current === "dark" ? "light" : "dark");
|
||||||
}
|
}
|
||||||
|
|
||||||
function initHeaderMenu() {
|
export function initHeaderMenu() {
|
||||||
const menuBtn = document.getElementById("header-menu-btn");
|
const menuBtn = document.getElementById("header-menu-btn");
|
||||||
const menuDropdown = document.getElementById("header-menu-dropdown");
|
const menuDropdown = document.getElementById("header-menu-dropdown");
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ function closeHeaderMenu() {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Custom Dropdowns
|
// Custom Dropdowns
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
function initCustomDropdowns() {
|
export function initCustomDropdowns() {
|
||||||
document.querySelectorAll(".custom-dropdown").forEach((dropdown) => {
|
document.querySelectorAll(".custom-dropdown").forEach((dropdown) => {
|
||||||
const trigger = dropdown.querySelector(".custom-dropdown-trigger");
|
const trigger = dropdown.querySelector(".custom-dropdown-trigger");
|
||||||
const options = dropdown.querySelectorAll(".custom-dropdown-option");
|
const options = dropdown.querySelectorAll(".custom-dropdown-option");
|
||||||
@@ -337,7 +337,7 @@ function populateCustomDropdown(dropdownId, optionsList, defaultValue) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
/** Display a brief toast message at the bottom of the viewport. */
|
/** Display a brief toast message at the bottom of the viewport. */
|
||||||
function showToast(message, type) {
|
export function showToast(message, type) {
|
||||||
console.log("showToast called with:", message, type);
|
console.log("showToast called with:", message, type);
|
||||||
type = type || "info";
|
type = type || "info";
|
||||||
let container = document.getElementById("toast-container");
|
let container = document.getElementById("toast-container");
|
||||||
@@ -368,7 +368,7 @@ function showToast(message, type) {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Sidebar toggle (desktop)
|
// Sidebar toggle (desktop)
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
function initSidebarToggle() {
|
export function initSidebarToggle() {
|
||||||
const toggleBtn = document.getElementById("sidebar-toggle-btn");
|
const toggleBtn = document.getElementById("sidebar-toggle-btn");
|
||||||
const sidebar = document.getElementById("sidebar");
|
const sidebar = document.getElementById("sidebar");
|
||||||
const resizeHandle = document.getElementById("sidebar-resize-handle");
|
const resizeHandle = document.getElementById("sidebar-resize-handle");
|
||||||
@@ -395,7 +395,7 @@ function initSidebarToggle() {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Mobile sidebar
|
// Mobile sidebar
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
function initMobile() {
|
export function initMobile() {
|
||||||
const hamburger = document.getElementById("hamburger-btn");
|
const hamburger = document.getElementById("hamburger-btn");
|
||||||
const overlay = document.getElementById("sidebar-overlay");
|
const overlay = document.getElementById("sidebar-overlay");
|
||||||
const sidebar = document.getElementById("sidebar");
|
const sidebar = document.getElementById("sidebar");
|
||||||
@@ -422,7 +422,7 @@ function closeMobileSidebar() {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Resizable sidebar (horizontal)
|
// Resizable sidebar (horizontal)
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
function initSidebarResize() {
|
export function initSidebarResize() {
|
||||||
const handle = document.getElementById("sidebar-resize-handle");
|
const handle = document.getElementById("sidebar-resize-handle");
|
||||||
const sidebar = document.getElementById("sidebar");
|
const sidebar = document.getElementById("sidebar");
|
||||||
if (!handle || !sidebar) return;
|
if (!handle || !sidebar) return;
|
||||||
@@ -464,7 +464,7 @@ function initSidebarResize() {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Resizable tag section (vertical)
|
// Resizable tag section (vertical)
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
function initTagResize() {
|
export function initTagResize() {
|
||||||
const handle = document.getElementById("tag-resize-handle");
|
const handle = document.getElementById("tag-resize-handle");
|
||||||
const tagSection = document.getElementById("tag-cloud-section");
|
const tagSection = document.getElementById("tag-cloud-section");
|
||||||
if (!handle || !tagSection) return;
|
if (!handle || !tagSection) return;
|
||||||
@@ -1089,7 +1089,7 @@ const FileOperations = {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Find in Page Manager
|
// Find in Page Manager
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
const FindInPageManager = {
|
export const FindInPageManager = {
|
||||||
isOpen: false,
|
isOpen: false,
|
||||||
searchTerm: "",
|
searchTerm: "",
|
||||||
matches: [],
|
matches: [],
|
||||||
|
|||||||
Reference in New Issue
Block a user