@adia-ai/web-modules 0.8.41 → 0.8.42

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.
@@ -29,8 +29,10 @@
29
29
  * sidebar-toggle — bubbles. detail: { name, expanded }
30
30
  * sidebar-resize — bubbles. detail: { name, width }
31
31
  *
32
- * The drag handle is conventional: a child `[data-resize]` element.
33
- * Authors may provide a custom one, or omit (no resize affordance).
32
+ * The drag handle is conventional: a child `[data-sidebar-resize]` element
33
+ * (`[data-resize]` still works deprecated, dual-read compat shim, removed
34
+ * in 0.9.0: docs/ops/plan/plan-090-rename-wave.md). Authors may provide a
35
+ * custom one, or omit (no resize affordance).
34
36
  *
35
37
  * Backwards compat: <admin-shell> still recognizes the legacy
36
38
  * `<aside data-sidebar="leading">` shape via :is() selector. New
@@ -59,6 +61,11 @@ class AdminSidebar extends UIElement {
59
61
  // handle — one-shot per element so re-renders stay quiet. GC-friendly.
60
62
  static #warnedNoHandle = new WeakSet();
61
63
 
64
+ // Rename-wave compat (docs/ops/plan/plan-090-rename-wave.md W1): one-shot
65
+ // deprecation warn per element when the legacy `[data-resize]` name is the
66
+ // one that resolved the handle. Same GC-friendly WeakSet pattern as above.
67
+ static #warnedOldResizeName = new WeakSet();
68
+
62
69
  // The width the sidebar had before being collapsed — used for restore.
63
70
  // Map keyed by sidebar name allows multiple sidebars on one host.
64
71
  #previousExpandedWidth = '';
@@ -166,19 +173,34 @@ class AdminSidebar extends UIElement {
166
173
  // ── Resize drag handle ──
167
174
 
168
175
  #setupResizeHandle() {
169
- const handle = this.querySelector(':scope > [data-resize]');
176
+ // Rename-wave compat (plan-090 W1): `[data-sidebar-resize]` is the
177
+ // current name; `[data-resize]` still dual-reads until the 0.9.0 cut
178
+ // (W3), warning once per element when it's the name that resolved.
179
+ let handle = this.querySelector(':scope > [data-sidebar-resize]');
180
+ if (!handle) {
181
+ handle = this.querySelector(':scope > [data-resize]');
182
+ if (handle && !AdminSidebar.#warnedOldResizeName.has(this)) {
183
+ AdminSidebar.#warnedOldResizeName.add(this);
184
+ // eslint-disable-next-line no-console
185
+ console.warn(
186
+ '[admin-sidebar] `[data-resize]` is deprecated and removed in ' +
187
+ '0.9.0 — rename the drag-handle child to `[data-sidebar-resize]`.',
188
+ this,
189
+ );
190
+ }
191
+ }
170
192
  if (!handle) {
171
193
  // FEEDBACK-17: `resizable` opts in to drag-resize but relies on an
172
- // author-supplied `[data-resize]` child. A silent return left authors
173
- // with a no-op `resizable` attribute and zero diagnostic signal.
194
+ // author-supplied `[data-sidebar-resize]` child. A silent return left
195
+ // authors with a no-op `resizable` attribute and zero diagnostic signal.
174
196
  if (!AdminSidebar.#warnedNoHandle.has(this)) {
175
197
  AdminSidebar.#warnedNoHandle.add(this);
176
198
  // eslint-disable-next-line no-console
177
199
  console.warn(
178
- '[admin-sidebar] `resizable` is set but no `[data-resize]` child ' +
179
- 'was found. Add `<div data-resize></div>` as a direct child to ' +
180
- 'enable drag-to-resize. (Unlike `collapsible`, `resizable` requires ' +
181
- 'this author-supplied handle.)',
200
+ '[admin-sidebar] `resizable` is set but no `[data-sidebar-resize]` ' +
201
+ 'child was found. Add `<div data-sidebar-resize></div>` as a direct ' +
202
+ 'child to enable drag-to-resize. (Unlike `collapsible`, `resizable` ' +
203
+ 'requires this author-supplied handle.)',
182
204
  this,
183
205
  );
184
206
  }
@@ -37,7 +37,7 @@ props:
37
37
  resizable:
38
38
  description: |
39
39
  Opts in to drag-to-resize behavior. Author supplies a child
40
- [data-resize] element as the drag handle.
40
+ [data-sidebar-resize] element as the drag handle.
41
41
  type: boolean
42
42
  default: false
43
43
  reflect: true