@redpanda-data/docs-extensions-and-macros 3.3.0 → 3.3.1

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.
@@ -153,20 +153,43 @@ module.exports.register = function (registry, context) {
153
153
  }
154
154
  }
155
155
  }
156
+ function getQueryParams() {
157
+ const params = {};
158
+ const searchParams = new URLSearchParams(window.location.search);
159
+ searchParams.forEach((value, key) => {
160
+ params[key] = value;
161
+ });
162
+ return params;
163
+ }
156
164
 
157
- function updateComponentUrl(select, redirect) {
158
- const anchor = select.closest('tr').querySelector('a');
159
- anchor.href = select.value;
160
- if (redirect) {
161
- window.location.href = select.value; // Redirect to the new URL
165
+ function capitalizeFirstLetter(string) {
166
+ return string.charAt(0).toUpperCase() + string.slice(1);
162
167
  }
168
+
169
+ function updateComponentUrl(select, redirect) {
170
+ const anchor = select.closest('tr').querySelector('a');
171
+ anchor.href = select.value;
172
+ if (redirect) {
173
+ window.location.href = select.value; // Redirect to the new URL
174
+ }
163
175
  }
164
176
  // Initialize Choices.js for type dropdowns
165
177
  document.addEventListener('DOMContentLoaded', function() {
166
- const typeDropdowns = document.querySelectorAll('.type-dropdown');
167
- typeDropdowns.forEach(dropdown => {
168
- new Choices(dropdown, { searchEnabled: false, allowHTML: true});
169
- });
178
+ const params = getQueryParams();
179
+ if (params.search) {
180
+ document.getElementById('componentTableSearch').value = params.search;
181
+ }
182
+ if (params.support) {
183
+ document.getElementById('supportFilter').value = capitalizeFirstLetter(params.support);
184
+ }
185
+ if (params.type) {
186
+ document.getElementById('typeFilter').value = params.type;
187
+ }
188
+ filterComponentTable();
189
+ const typeDropdowns = document.querySelectorAll('.type-dropdown');
190
+ typeDropdowns.forEach(dropdown => {
191
+ new Choices(dropdown, { searchEnabled: false, allowHTML: true});
192
+ });
170
193
  });
171
194
  </script>`;
172
195
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redpanda-data/docs-extensions-and-macros",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Antora extensions and macros developed for Redpanda documentation.",
5
5
  "keywords": [
6
6
  "antora",