@adia-ai/web-components 0.2.5 → 0.3.0

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/README.md CHANGED
@@ -64,12 +64,12 @@ web-components/
64
64
  │ pages. Full contract in docs/specs/traits.md.
65
65
 
66
66
  ├── a2ui/ — deprecation shim for one release
67
- │ └── index.js Re-exports @adia-ai/a2ui-utils with a
67
+ │ └── index.js Re-exports @adia-ai/a2ui-runtime with a
68
68
  │ one-time console.warn. Removed in 0.1.0.
69
69
  │ All actual A2UI runtime code (renderer,
70
70
  │ registry, streams, surface manifest,
71
71
  │ wiring, dockables, controllers) lives in
72
- │ `@adia-ai/a2ui-utils` at packages/a2ui/utils/.
72
+ │ `@adia-ai/a2ui-runtime` at packages/a2ui/runtime/.
73
73
 
74
74
  └── styles/ — Global tokens and CSS layering
75
75
  ├── tokens.css all --a-* design tokens
@@ -139,7 +139,7 @@ examples.
139
139
  ## A2UI runtime
140
140
 
141
141
  ```javascript
142
- import { A2UIRenderer } from '@adia-ai/a2ui-utils';
142
+ import { A2UIRenderer } from '@adia-ai/a2ui-runtime';
143
143
  // (The old `@adia-ai/web-components/a2ui` subpath still resolves in 0.0.4
144
144
  // via a deprecation shim that prints a console.warn; removed in 0.1.0.)
145
145
 
@@ -198,7 +198,7 @@ the `streams` registry export from `core/data-stream.js`.
198
198
 
199
199
  Implementation: `core/data-stream.js` (~360 lines). Full
200
200
  attribute table + live demos:
201
- [`/site/components/chart#data-stream`](../../site/pages/components/chart/index.html).
201
+ [`/site/components/chart#data-stream`](./components/chart/chart.html).
202
202
 
203
203
  ## Build
204
204
 
@@ -1,5 +1,5 @@
1
1
  import { UIElement } from '../../core/element.js';
2
- import { registry } from '@adia-ai/a2ui-utils';
2
+ import { registry } from '@adia-ai/a2ui-runtime';
3
3
  import '../tabs/tabs.js';
4
4
  import '../tabs/tab.js';
5
5
  import '../code/code.js';
@@ -12,7 +12,7 @@
12
12
  * the dependency direction is web-components → a2ui-utils, not the
13
13
  * reverse. The bridge duck-types the renderer (it needs `.process()`,
14
14
  * nothing else), so it works with any A2UI-protocol consumer — the
15
- * actual `A2UIRenderer` from `@adia-ai/a2ui-utils`, a custom renderer,
15
+ * actual `A2UIRenderer` from `@adia-ai/a2ui-runtime`, a custom renderer,
16
16
  * or a test stub.
17
17
  *
18
18
  * Contract:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adia-ai/web-components",
3
- "version": "0.2.5",
4
- "description": "AdiaUI web components \u2014 vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-utils.",
3
+ "version": "0.3.0",
4
+ "description": "AdiaUI web components \u2014 vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-runtime.",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./index.js",
@@ -18,8 +18,15 @@
18
18
  "files": [
19
19
  "core/",
20
20
  "components/",
21
+ "!components/**/*.html",
22
+ "!components/**/*.examples.js",
21
23
  "styles/",
24
+ "!styles/**/*.html",
25
+ "!styles/**/*.examples.js",
22
26
  "traits/",
27
+ "!traits/**/*.html",
28
+ "!traits/**/*.examples.js",
29
+ "!traits/_api-table.js",
23
30
  "index.js",
24
31
  "index.css"
25
32
  ],
@@ -30,7 +37,7 @@
30
37
  "./core/provider.js"
31
38
  ],
32
39
  "dependencies": {
33
- "@adia-ai/a2ui-utils": "^0.2.0"
40
+ "@adia-ai/a2ui-runtime": "^0.3.0"
34
41
  },
35
42
  "publishConfig": {
36
43
  "access": "public",
@@ -256,7 +256,7 @@
256
256
 
257
257
  /* section — h2/h3, major division within content */
258
258
  --a-section-family: var(--a-font-family-heading);
259
- --a-section-weight: var(--a-weight-normal);
259
+ --a-section-weight: var(--a-weight-semibold);
260
260
  --a-section-sm: 16px;
261
261
  --a-section-md: 17px;
262
262
  --a-section-lg: 19px;
@@ -3,7 +3,7 @@ import { defineTrait } from './define.js';
3
3
  /**
4
4
  * `draggable-list-item` — pointer-driven list-reorder lifter.
5
5
  *
6
- * Authored for the Tasks UI playground (docs/projects/tasks-playground/spec/).
6
+ * Authored for the Tasks UI playground (apps/tasks/spec/).
7
7
  * Per SPEC §6.2 + ARCHITECTURE-REVIEW H2 (category: 'motion-positioning').
8
8
  *
9
9
  * Different mental model than the existing `draggable` trait:
@@ -126,13 +126,26 @@ function dropTargetFromPoint(x, y) {
126
126
  * @returns {number} insertion index in [0, count_after_removal]
127
127
  */
128
128
  function indexWithinTarget(target, _x, y, sourceId) {
129
- // Direct children only. ChildList is small (usually < 50); filter is O(n).
130
- // Pre-filter to source-skipped, layout-having items so we know which is
131
- // truly last in post-removal coordinates.
129
+ // Find all `[data-draggable-list-item-id]` descendants whose nearest
130
+ // `[data-droppable-id]` ancestor IS the target. This supports both
131
+ // structural patterns:
132
+ // • Items as DIRECT children of the droppable host
133
+ // (e.g. `<list-section data-droppable-id> <task-row-ui>...`).
134
+ // • Items nested inside an intermediate container
135
+ // (e.g. `<task-column-ui data-droppable-id> <div class="col-list">
136
+ // <task-card-ui>...` — the column's CSS owns chrome on the host
137
+ // while cards live in a flow-styled inner list).
138
+ //
139
+ // The closest-ancestor filter keeps nested droppables from poisoning
140
+ // the count: a child droppable's items have a different closest
141
+ // `[data-droppable-id]`, so they're skipped here.
142
+ //
143
+ // Pre-filter to source-skipped, layout-having items so we know which
144
+ // is truly last in post-removal coordinates.
132
145
  const visible = [];
133
- for (const child of target.children) {
134
- if (!(child instanceof Element)) continue;
135
- if (!child.hasAttribute('data-draggable-list-item-id')) continue;
146
+ const candidates = target.querySelectorAll('[data-draggable-list-item-id]');
147
+ for (const child of candidates) {
148
+ if (child.closest('[data-droppable-id]') !== target) continue;
136
149
  if (sourceId && child.getAttribute('data-draggable-list-item-id') === sourceId) continue;
137
150
  const r = child.getBoundingClientRect();
138
151
  if (r.height === 0 && r.width === 0) continue;
@@ -142,20 +155,21 @@ function indexWithinTarget(target, _x, y, sourceId) {
142
155
 
143
156
  for (let i = 0; i < visible.length; i++) {
144
157
  const r = visible[i];
145
- const isLast = i === visible.length - 1;
146
- if (isLast && y >= r.top) {
147
- // Last item: cursor anywhere ON (or below) the last item's box
148
- // drop AFTER the last. Without this rule, dropping in the upper
149
- // half of the last item resolves to "before last" = no-op for
150
- // 3-item-list "move item 2 to item 3 slot" (the lifted source's
151
- // DOM still occupies its old space, so cursor above last's mid
152
- // is the only reachable target without leaving the section). The
153
- // generous last-item zone matches user intuition: dragging onto
154
- // the last item sends it to the bottom.
155
- return visible.length;
156
- }
157
- // Standard midline test for non-last items (and for cursor above the
158
- // last item's top edge): above midline insert before this item.
158
+ // Standard midline test (Pragmatic-DnD / Linear / Notion convention):
159
+ // cursor above this item's mid-line → insert before it; below → fall
160
+ // through to the next item. After the loop, if no hit, drop after
161
+ // all items (cursor was below every mid-line).
162
+ //
163
+ // History: v0.2.5 introduced a "last-item generous zone" that
164
+ // returned `visible.length` whenever the cursor was anywhere ON the
165
+ // last item meant to make the 3-item-list "drop on last to send
166
+ // it to the bottom" gesture more permissive. Reverted: it broke the
167
+ // common "drop between second-to-last and last" path (hovering the
168
+ // last item's upper-half no longer resolved to "before last"). With
169
+ // the v0.2.6 indicator-visibility upgrade (3 px stroke + terminal
170
+ // caps + accent glow) the lower-half-targets-end behavior is now
171
+ // visually obvious, so the standard midline test reads cleanly
172
+ // without the carve-out.
159
173
  if (y < r.top + r.height / 2) return i;
160
174
  }
161
175
  // Cursor is below every item's midline (and below last's top — only
@@ -3,7 +3,7 @@ import { draggableListItem } from './draggable-list-item.js';
3
3
  import { mountHost, connectTrait, resetDOM } from './test-helpers.js';
4
4
 
5
5
  // Minimal smoke coverage. The draggable-list-item trait is the pointer
6
- // driver for the docs/projects/tasks-playground/ DnD model. The cases
6
+ // driver for the apps/tasks/ DnD model. The cases
7
7
  // below exercise only its own surface (schema, attribute lifecycle,
8
8
  // id assignment, idempotent disconnect). Full pointer-flow tests need a
9
9
  // laid-out DOM with sibling droppables and live elementFromPoint —
@@ -3,7 +3,7 @@ import { defineTrait } from './define.js';
3
3
  /**
4
4
  * `droppable-collection` — coordinator over a tree of `droppable` children.
5
5
  *
6
- * Authored for the Tasks UI playground (docs/projects/tasks-playground/spec/).
6
+ * Authored for the Tasks UI playground (apps/tasks/spec/).
7
7
  * Per SPEC §6.2 + ARCHITECTURE-REVIEW H2 (category: 'input-interaction').
8
8
  *
9
9
  * Pairs with `droppable` (per-target) and `draggable-list-item` (motion-
@@ -3,7 +3,7 @@ import { droppableCollection } from './droppable-collection.js';
3
3
  import { mountHost, connectTrait, spyEvent, resetDOM } from './test-helpers.js';
4
4
 
5
5
  // Minimal smoke coverage. The droppable-collection trait coordinates
6
- // child droppables of the docs/projects/tasks-playground/ DnD model;
6
+ // child droppables of the apps/tasks/ DnD model;
7
7
  // the cases below verify only the trait's own surface (schema, attribute
8
8
  // lifecycle, child-drop re-emission) so the verify:traits gate stays
9
9
  // green. End-to-end multi-column behavior belongs in the playground tests.
@@ -3,7 +3,7 @@ import { defineTrait } from './define.js';
3
3
  /**
4
4
  * `droppable` — marks an element as a drop target for `draggable-list-item`.
5
5
  *
6
- * Authored for the Tasks UI playground (docs/projects/tasks-playground/spec/).
6
+ * Authored for the Tasks UI playground (apps/tasks/spec/).
7
7
  * Per SPEC §6.2 + ARCHITECTURE-REVIEW H2 (category: 'input-interaction').
8
8
  *
9
9
  * Pairs with `draggable-list-item` (motion-positioning) which lifts a list
@@ -3,7 +3,7 @@ import { droppable } from './droppable.js';
3
3
  import { mountHost, connectTrait, resetDOM } from './test-helpers.js';
4
4
 
5
5
  // Minimal smoke coverage. The droppable trait is authored against the
6
- // docs/projects/tasks-playground/ DnD coordinator and assumes a sibling
6
+ // apps/tasks/ DnD coordinator and assumes a sibling
7
7
  // `draggable-list-item` trait dispatches `dnd:drop-target-change` /
8
8
  // `dnd:drop` on the document. The cases below only exercise the trait's
9
9
  // own surface (schema, attribute lifecycle, registry entry, cleanup) so
@@ -3,7 +3,7 @@ import { defineTrait } from './define.js';
3
3
  /**
4
4
  * `keyboard-reorderable` — keyboard alternative to `draggable-list-item`.
5
5
  *
6
- * Authored for the Tasks UI playground (docs/projects/tasks-playground/spec/).
6
+ * Authored for the Tasks UI playground (apps/tasks/spec/).
7
7
  * Per SPEC §6.2 + ARCHITECTURE-REVIEW H2 (category: 'keyboard-navigation').
8
8
  *
9
9
  * Implements the WCAG 2.5.7 single-pointer alternative + ARIA 1.1
@@ -4,7 +4,7 @@ import { mountHost, connectTrait, resetDOM } from './test-helpers.js';
4
4
 
5
5
  // Minimal smoke coverage. Keyboard-reorderable is the WCAG 2.5.7 +
6
6
  // ARIA 1.1 alternative to draggable-list-item for the
7
- // docs/projects/tasks-playground/ DnD model. Cases below verify
7
+ // apps/tasks/ DnD model. Cases below verify
8
8
  // only the trait's own surface (schema, attribute lifecycle, id
9
9
  // assignment, tabindex injection). Multi-container keyboard flow
10
10
  // belongs in the playground integration suite.