@farming-labs/astro-theme 0.0.7 → 0.0.8

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": "@farming-labs/astro-theme",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Astro UI components for @farming-labs/docs — layout, sidebar, TOC, search, and theme toggle",
5
5
  "keywords": [
6
6
  "astro",
@@ -79,8 +79,8 @@
79
79
  },
80
80
  "dependencies": {
81
81
  "sugar-high": "^0.9.5",
82
- "@farming-labs/docs": "0.0.7",
83
- "@farming-labs/astro": "0.0.7"
82
+ "@farming-labs/docs": "0.0.8",
83
+ "@farming-labs/astro": "0.0.8"
84
84
  },
85
85
  "peerDependencies": {
86
86
  "astro": ">=4.0.0"
@@ -136,8 +136,10 @@ function getIcon(iconKey) {
136
136
  return ICON_MAP[iconKey] || null;
137
137
  }
138
138
 
139
+ const staticExport = !!(config as { staticExport?: boolean }).staticExport;
139
140
  const aiConfig = config?.ai;
140
- const showFloatingAI = aiConfig?.mode === "floating" && aiConfig?.enabled;
141
+ const showFloatingAI = !staticExport && aiConfig?.mode === "floating" && !!aiConfig?.enabled;
142
+ const showSearch = !staticExport;
141
143
  ---
142
144
 
143
145
  <script is:inline set:html={themeInitScript}></script>
@@ -153,12 +155,14 @@ const showFloatingAI = aiConfig?.mode === "floating" && aiConfig?.enabled;
153
155
  </svg>
154
156
  </button>
155
157
  <a href={resolvedTitleUrl} class="fd-header-title">{resolvedTitle}</a>
156
- <button class="fd-search-trigger-mobile" id="fd-search-open-mobile" aria-label="Search">
157
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
158
- <circle cx="11" cy="11" r="8" />
159
- <line x1="21" y1="21" x2="16.65" y2="16.65" />
160
- </svg>
161
- </button>
158
+ {showSearch && (
159
+ <button class="fd-search-trigger-mobile" id="fd-search-open-mobile" aria-label="Search">
160
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
161
+ <circle cx="11" cy="11" r="8" />
162
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
163
+ </svg>
164
+ </button>
165
+ )}
162
166
  </header>
163
167
 
164
168
  <div class="fd-sidebar-overlay" id="fd-sidebar-overlay" style="display:none"></div>
@@ -174,16 +178,18 @@ const showFloatingAI = aiConfig?.mode === "floating" && aiConfig?.enabled;
174
178
  </a>
175
179
  </div>
176
180
 
177
- <div class="fd-sidebar-search">
178
- <button class="fd-sidebar-search-btn" id="fd-search-open">
179
- <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
180
- <circle cx="11" cy="11" r="8" />
181
- <line x1="21" y1="21" x2="16.65" y2="16.65" />
182
- </svg>
183
- <span>Search</span>
184
- <kbd>⌘</kbd><kbd>K</kbd>
185
- </button>
186
- </div>
181
+ {showSearch && (
182
+ <div class="fd-sidebar-search">
183
+ <button class="fd-sidebar-search-btn" id="fd-search-open">
184
+ <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
185
+ <circle cx="11" cy="11" r="8" />
186
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
187
+ </svg>
188
+ <span>Search</span>
189
+ <kbd>⌘</kbd><kbd>K</kbd>
190
+ </button>
191
+ </div>
192
+ )}
187
193
 
188
194
  {Astro.slots.has("sidebar-header") && (
189
195
  <div class="fd-sidebar-banner">