monowind 0.2.5 → 0.2.6

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/dist/paint.d.ts CHANGED
@@ -3,4 +3,5 @@ import type { LayoutNode } from "./types.ts";
3
3
  * structural rebuilds (a primary press is down) and a selection
4
4
  * anchor is in the grid — repeat the paint on release. */
5
5
  export declare function paintGrid(root: LayoutNode, target: HTMLElement, holdStructural?: boolean): boolean;
6
+ export declare function nodeAtOffset(target: HTMLElement, offset: number): [Text, number] | null;
6
7
  //# sourceMappingURL=paint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paint.d.ts","sourceRoot":"","sources":["../src/paint.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AA+B7C;;0DAE0D;AAC1D,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,UAAQ,GAAG,OAAO,CAmDhG"}
1
+ {"version":3,"file":"paint.d.ts","sourceRoot":"","sources":["../src/paint.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AA+B7C;;0DAE0D;AAC1D,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,UAAQ,GAAG,OAAO,CAmDhG;AA0FD,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,IAAI,CAUvF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monowind",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Text-based user interfaces (TUI) on the web, from ordinary HTML and Tailwind utility classes",
5
5
  "keywords": [
6
6
  "ascii",
package/src/styles.css CHANGED
@@ -149,6 +149,14 @@
149
149
  color: var(--mw-bg);
150
150
  caret-color: var(--mw-bg);
151
151
  }
152
+ /* Grid-mode light elements carry the grid's text cursor: Firefox
153
+ * hit-tests a multicol spanner's anonymous wrapper as its container
154
+ * despite `pointer-events: none`, and would show an arrow there.
155
+ * Interactives keep their own (UA and authored cursors win). */
156
+ mono-wind[select="grid"]
157
+ [data-mw-laid-out]:not(a, button, input, select, textarea, label, [tabindex], [role="button"]) {
158
+ cursor: text;
159
+ }
152
160
  }
153
161
 
154
162
  /* === Modes and selection (engine-owned from here down) =============== */
@@ -156,7 +164,9 @@
156
164
  /* select="grid": pass pointer events through non-interactive light-DOM
157
165
  * elements so drag lands on the grid <pre> (native drag-selection of
158
166
  * the ASCII); interactives opt back into `auto` so clicks still work.
159
- * (The slot itself is pointer-events: none in the shadow CSS.) */
167
+ * (The slot itself is pointer-events: none in the shadow CSS.) The
168
+ * interactive list is mirrored by INTERACTIVE in element.ts and by the
169
+ * two rules below — change all of them together. */
160
170
  mono-wind[select="grid"] * {
161
171
  pointer-events: none !important;
162
172
  }
@@ -164,15 +174,40 @@ mono-wind[select="grid"]
164
174
  :is(a, button, input, select, textarea, label, [tabindex], [role="button"]) {
165
175
  pointer-events: auto !important;
166
176
  }
177
+ /* While a drag that began on the grid is in flight, interactives drop
178
+ * their pointer events too, so the native selection sweeps through
179
+ * their cells instead of stalling at their edge (a click is a press and
180
+ * release in place — unaffected). */
181
+ mono-wind[select="grid"][data-mw-dragging]
182
+ :is(a, button, input, select, textarea, label, [tabindex], [role="button"]) {
183
+ pointer-events: none !important;
184
+ }
185
+ /* The grid-mode selection lock, explicit on the light DOM: the shadow
186
+ * slot's `user-select: none` reaches slotted content in Chromium and
187
+ * WebKit but not Firefox, where a drag that strays onto a light element
188
+ * would select it. Lifted with a semantic selection
189
+ * (specs/semantic-selection.md). Editable controls keep their own
190
+ * selection (Firefox honors an explicit `none` on a text field's
191
+ * value; the slot's inherited value never reached it). */
192
+ mono-wind[select="grid"]:not([data-mw-semantic-selection])
193
+ :not(input, textarea, [contenteditable], [contenteditable] *) {
194
+ user-select: none;
195
+ -webkit-user-select: none;
196
+ }
167
197
  /* Touch panning (specs/scrolling.md): where the primary pointer is a
168
198
  * finger, scroll containers take pointer events in grid mode so a
169
199
  * drag pans them NATIVELY (physics, momentum, chaining) — their
170
200
  * children stay inert, so the touch lands on the container itself.
171
- * The trade: no grid selection starts inside one on those devices. */
201
+ * A long-press there selects the element's text (an element
202
+ * selection, copied by the engine like a semantic one). */
172
203
  @media (pointer: coarse) {
173
204
  mono-wind[select="grid"] [data-mw-scroll] {
174
205
  pointer-events: auto !important;
175
206
  }
207
+ mono-wind[select="grid"] :is([data-mw-scroll], [data-mw-scroll] *) {
208
+ user-select: text;
209
+ -webkit-user-select: text;
210
+ }
176
211
  }
177
212
 
178
213
  /* Scroll containers (specs/scrolling.md): the gutter ink IS the