@hortonstudio/main 1.9.0 → 1.9.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.
@@ -12,6 +12,27 @@ export function init() {
12
12
  cleanup.handlers.push({ element, event, handler, options });
13
13
  };
14
14
 
15
+ function setupBlogListCleanup() {
16
+ const wrappers = document.querySelectorAll('[data-site-blog="wrapper"]');
17
+
18
+ wrappers.forEach(wrapper => {
19
+ // Check if wrapper has the delete-if-no-list config
20
+ const shouldDelete = wrapper.getAttribute('data-site-blog-config') === 'delete-if-no-list';
21
+
22
+ if (!shouldDelete) {
23
+ return;
24
+ }
25
+
26
+ // Check if there's a descendant with data-site-blog="list"
27
+ const hasList = wrapper.querySelector('[data-site-blog="list"]') !== null;
28
+
29
+ // Delete wrapper if it doesn't have a list
30
+ if (!hasList) {
31
+ wrapper.remove();
32
+ }
33
+ });
34
+ }
35
+
15
36
  function setupGeneralAccessibility() {
16
37
  setupListAccessibility();
17
38
  setupRemoveListAccessibility();
@@ -24,6 +45,7 @@ export function init() {
24
45
  setupCustomValuesReplacement();
25
46
  setupClickForwarding(addHandler);
26
47
  setupTextSynchronization(addObserver);
48
+ setupBlogListCleanup();
27
49
  }
28
50
 
29
51
  function setupListAccessibility() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Animation and utility library for client websites",
5
5
  "main": "index.js",
6
6
  "type": "module",