@dirwell/theme-ledger 0.0.1 → 0.0.2

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/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as ThemeAction, c as ThemeLabels, i as ThemePage, o as ThemeColumn, s as ThemeCustomization, t as FrameworkRenderer } from "./model-B0qQsjRT.mjs";
1
+ import { a as ThemeAction, c as ThemeLabels, i as ThemePage, o as ThemeColumn, s as ThemeCustomization, t as FrameworkRenderer } from "./model-BgCmoksr.mjs";
2
2
  import { ExplorerTheme } from "@dirwell/core";
3
3
  //#region src/index.d.ts
4
4
  export interface LedgerThemeOptions extends ThemeCustomization {
package/dist/index.mjs CHANGED
@@ -67,6 +67,10 @@ function createThemePage(context, theme, title) {
67
67
  manifestHref: context.listing?.manifestHref ?? null,
68
68
  ...context.listing ? { listingRevision: context.listing.revision } : {},
69
69
  updatesHref: context.updatesHref ?? null,
70
+ ...context.searchQueryHref ? {
71
+ searchQueryHref: context.searchQueryHref,
72
+ searchRefreshIntervalMs: context.searchRefreshIntervalMs
73
+ } : {},
70
74
  total: context.listing?.page.total ?? entries.length,
71
75
  entries,
72
76
  sort: context.sort,
@@ -530,6 +534,7 @@ async function fetchThemePage(dataHref, pageHref, theme, signal, fresh = false,
530
534
  if (data.ui !== void 0) resolveCustomization(data.ui);
531
535
  const result = {
532
536
  ...data,
537
+ searchQueryHref: link(data.searchQueryHref ?? null),
533
538
  updatesHref: link(data.updatesHref ?? null),
534
539
  entries,
535
540
  dataHref: source.href,
@@ -969,7 +974,7 @@ function Ledger($$renderer, $$props) {
969
974
  });
970
975
  });
971
976
  $$renderer.push(`</label> `);
972
- if (model.searchIndexHref) $$renderer.push(`<!--[0--><button${$.attr("disabled", !ready || !model.searchIndexHref, true)}>${$.escape(ui().labels.searchArchive)}</button>`);
977
+ if (model.searchIndexHref || model.searchQueryHref) $$renderer.push(`<!--[0--><button${$.attr("disabled", !ready, true)}>${$.escape(ui().labels.searchArchive)}</button>`);
973
978
  else $$renderer.push("<!--[-1-->");
974
979
  $$renderer.push(`<!--]--></div> <section class="listing-card"><div class="listing-summary">${$.escape(countParts()[0])}<span data-visible-count="">${$.escape(complete() ? rows().length : entries.length)}</span>${$.escape(countParts().slice(1).join("__COUNT__"))}<span role="status" aria-live="polite">${$.escape(busy ? ui().labels.loading : error)}</span></div> `);
975
980
  if (failure && failure !== "copy") $$renderer.push(`<!--[0--><button${$.attr("disabled", busy, true)}>${$.escape(ui().labels.retry)}</button>`);
@@ -1121,7 +1126,8 @@ function createLedgerTheme(options = {}, renderer) {
1121
1126
  const model = {
1122
1127
  ...createThemePage(context, theme, options.title ?? ui.brand.name ?? "Dirwell"),
1123
1128
  ...publishedUi === void 0 ? {} : { ui: publishedUi },
1124
- searchIndexHref: theme.searchIndex === false ? null : context.searchIndexHref
1129
+ searchIndexHref: theme.searchIndex === false ? null : context.searchIndexHref,
1130
+ searchQueryHref: theme.searchIndex === false ? null : context.searchQueryHref ?? null
1125
1131
  };
1126
1132
  const { script, scriptName, styles } = await loadResources();
1127
1133
  const json = JSON.stringify(model).replaceAll("<", "\\u003c");