@widgetic/design-system 0.5.42 → 0.5.43

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
@@ -380,10 +380,10 @@ The pieces are exported for a page that draws its own box: `createCompletionCont
380
380
 
381
381
  A person who attaches three pictures can say what happens with each: type `#` after a space and the attached files are listed with their thumbnails (as `@` lists the compositions of the workflows assistant); pick one and it stands in the sentence as a badge (thumbnail, name, an X): "Put **▣ #hero_banner** behind **▣ #logo**". The box stays the native textarea. Underneath, a badge is plain text, `#hero_banner`, between two runs of figure spaces that reserve room for the thumbnail and the X; a layer laid over the box (`textarea-overlay`) paints the badge there. So selection, undo, paste, input methods and the caret keep working natively, and what is sent is only text.
382
382
 
383
- - **The chat's `Composer`** takes a `references` prop (`ComposerReferences`): `{ items, messages: { hint, menuLabel, remove }, onHover?, triggerCharacter?, maxReferences?, log? }`. `onSend` then gets a second argument, `{ references }`: the attached files the text names, once each and in order (`{ id, label }`, `id` being the one the host gave the item). Without `references` the box is as it was: no menu, no badges, no listeners, and `onSend` gets the text alone. The text is what a person reads ("Put #hero_banner behind #logo"): the room of a badge is not sent, and is not counted by `maxLength`. While a file is attached the box says how to refer to it under the text (`messages.hint`, "Type # to reference an attached file"). The design system holds no English: the host passes all three words.
383
+ - **The chat's `Composer`** takes a `references` prop (`ComposerReferences`): `{ items, messages: { menuLabel, remove, hint? }, onHover?, triggerCharacter?, maxReferences?, log? }`. `onSend` then gets a second argument, `{ references }`: the attached files the text names, once each and in order (`{ id, label }`, `id` being the one the host gave the item). Without `references` the box is as it was: no menu, no badges, no listeners, and `onSend` gets the text alone. The text is what a person reads ("Put #hero_banner behind #logo"): the room of a badge is not sent, and is not counted by `maxLength`. The box draws no line of help for `#` under the text: a person who sees the box is not shown one. A host that wants a screen reader told how to refer to a file may pass the optional `messages.hint` (it is said while a file is attached, it is `sr-only`, and the box points to it); without it the box says nothing and points at nothing, as in the chat. The design system holds no English: the host passes the words (`menuLabel` and `remove`, and `hint` when it wants one).
384
384
  - **The files** are `items: ReferenceItem[]`, in tray order: `{ id, label, number, fileName, previewUrl?, sizeLabel? }`. `number` is the file's number in the tray (`#2` offers the second file), `previewUrl` any address a picture can be drawn from (without one the badge shows a file glyph). The host gives a file its `label` **once, when the file joins**, and keeps it: `assignReferenceLabel(fileName, { takenLabels, genericNumberFloor })`. A name that says something gives its label (`hero-banner-final.png` is `hero_banner_final`; a name taken gets `_2`), a name that says nothing (`IMG_4021.jpg`, `Screenshot 2026-11-17 at 7.55.01 AM.png`) is `Image_N`, with N above every generic number the draft has handed out so far (`genericLabelNumber` reads it back), so `#Image_2` typed for a file that has gone can never quietly mean the next one. A label is one to 24 letters, digits and underscores, in any script.
385
385
  - **When a file leaves** the tray, `removeTokensOfLabel(text, label)` takes its badges out of the text (each with one adjacent space; a `#label` the person typed by hand stays: it is their own word). A text restored from a draft goes through `unbadgeTokensWithoutFiles(text, labels)`: a badge whose file is not there any more is plain `#label` again. Both are exported from `components/chat` as well, where the chat imports them.
386
- - **`#` opens the menu** after the start of the text, a blank, an opening bracket or a quote, or a badge. It does not open in `a#b`, after a hyphen, in a hex colour (`#fff`) or a link. The menu is a list of the files whose label, file name or tray number matches what follows the `#` (`#2`, `#her`), with a picture of the highlighted one beside it; Up and Down move, **Enter** or **Tab** choose, **Esc** closes, a click chooses, and a key with a modifier is left to the box. It is drawn in the top layer, so no panel of the page clips it, and it opens upwards when there is no room below. While it is open the ghost text of the same box is off, and Enter does not send.
386
+ - **`#` opens the menu** after the start of the text, a blank, an opening bracket or a quote, or a badge. It does not open in `a#b`, after a hyphen, in a hex colour (`#fff`) or a link. The menu is a list of the files whose label, file name or tray number matches what follows the `#` (`#2`, `#her`): each row is the file's small picture, its name (two lines at most; the whole name and the size show in the row's `title`) and its tray number, and no larger card opens beside the list (the picture is the preview; a larger one shows only over a badge the pointer is on); Up and Down move, **Enter** or **Tab** choose, **Esc** closes, a click chooses, and a key with a modifier is left to the box. It is drawn in the top layer, so no panel of the page clips it, and it opens upwards when there is no room below. While it is open the ghost text of the same box is off, and Enter does not send.
387
387
  - **Editing around a badge**: the caret never rests inside one (arrows jump over it, a click next to it snaps), Backspace or Delete next to one takes the whole badge, the X takes it out, pasted text loses any figure space it carries, and Undo brings back the `#he` that was typed (the edit goes through the browser's own edit command). A badge that would not fit where the text puts its characters (the box wraps differently from the layer, for instance at a fractional width) is **not drawn**: the plain `#label` shows until the text or the width changes, and it is logged once.
388
388
  - **A badge is a file**: a pointer on a badge, or the keys on a menu row, tell the host (`onHover({ label, source })`) so its tray rings the same file. A change to the tray (a file removed, a name changed) repaints the badges on the spot.
389
389
  - **What a suggestion service sees**: with `references`, the ghost text of the box asks its source with every reference (a badge, and a hand-typed `#label` that names an attached file) as the neutral word `#file`: `neutralizeReferences(text, { knownLabels })`. A person's file names never reach a service through a suggestion. A text that cannot be made neutral asks nothing.
@@ -409,7 +409,7 @@ A person who attaches three pictures can say what happens with each: type `#` af
409
409
 
410
410
  <Composer
411
411
  bind:value
412
- references={{ items, messages: { hint: 'Type # to reference an attached file', menuLabel: 'Attached files', remove: 'Remove {name}' } }}
412
+ references={{ items, messages: { menuLabel: 'Attached files', remove: 'Remove {name}' } }}
413
413
  onSend={(text, options) => send(text, options?.references ?? [])}
414
414
  />
415
415
  ```
@@ -46,8 +46,13 @@
46
46
 
47
47
  /** The words the box says about files a message may refer to. The design system holds no English: the host passes them. */
48
48
  export type ComposerReferenceMessages = {
49
- /** The line under the box while a file is attached: how to refer to it ("Type # to reference an attached file"). */
50
- hint: string;
49
+ /**
50
+ * Optional. What a screen reader is told about the box while a file is attached: how to refer to it. Nothing is drawn for it:
51
+ * a person who sees the box is not shown a line of help under the text. Left out (or empty), nothing is said and nothing is
52
+ * drawn for it at all, and the box does not point at a hint: the chat leaves it out, since a person who has attached a file
53
+ * needs no line of help for it.
54
+ */
55
+ hint?: string;
51
56
  /** What a screen reader calls the list of files the `#` menu opens ("Attached files"). */
52
57
  menuLabel: string;
53
58
  /** What the X of a badge is called, with `{name}` for the file's name ("Remove {name}"). */
@@ -249,8 +254,9 @@
249
254
  const referencesOn = $derived(references !== undefined);
250
255
  const sendableValue = $derived(messageText(value, referencesOn));
251
256
  const referenceHintId = nextReferenceHintId();
257
+ // A hint is said only when the host gave one (the message is optional): without it the box points at nothing.
252
258
  const referenceHintShown = $derived(
253
- references !== undefined && references.items.length > 0 && references.messages.hint !== ''
259
+ references !== undefined && references.items.length > 0 && (references.messages.hint ?? '') !== ''
254
260
  );
255
261
  // Whether the `#` menu is open: the grey suggestion of the same box goes while it is.
256
262
  let referenceMenuOpen = $state(false);
@@ -520,12 +526,8 @@
520
526
  <p class="text-caption text-destructive mt-1" role="status">{messages.characterLimit}</p>
521
527
  {/if}
522
528
  {#if referenceHintShown && references}
523
- <!-- How to refer to an attached file: shown while a file is attached, so the way in is not a secret. -->
524
- <p
525
- id={referenceHintId}
526
- class="text-caption text-muted-foreground mt-1"
527
- data-testid="composer-reference-hint"
528
- >
529
+ <!-- How to refer to an attached file, said to a screen reader only (the box points at it): a person who sees the box is not shown a line of help for it. -->
530
+ <p id={referenceHintId} class="sr-only" data-testid="composer-reference-hint">
529
531
  {references.messages.hint}
530
532
  </p>
531
533
  {/if}
@@ -596,7 +598,13 @@
596
598
  variant={primaryAction === 'stop' ? 'inverse' : 'primary'}
597
599
  data-testid="composer-send"
598
600
  data-action={primaryAction}
599
- class={sendAttention?.bounce ? 'wc-composer-send-bounce' : undefined}
601
+ class={cn(
602
+ // Enabled and disabled are two looks the control fades between, very quickly. A fade that is under way turns
603
+ // around by itself when the look changes back (see `press-feedback-fade`), so a text that is typed, erased and
604
+ // typed again never leaves the control half way or makes it jump.
605
+ 'press-feedback-fade',
606
+ sendAttention?.bounce && 'wc-composer-send-bounce'
607
+ )}
600
608
  label={primaryLabel}
601
609
  disabled={!sendEnabled}
602
610
  onclick={() => handleSend('control')}
@@ -30,8 +30,13 @@ export type ComposerCompletion = {
30
30
  };
31
31
  /** The words the box says about files a message may refer to. The design system holds no English: the host passes them. */
32
32
  export type ComposerReferenceMessages = {
33
- /** The line under the box while a file is attached: how to refer to it ("Type # to reference an attached file"). */
34
- hint: string;
33
+ /**
34
+ * Optional. What a screen reader is told about the box while a file is attached: how to refer to it. Nothing is drawn for it:
35
+ * a person who sees the box is not shown a line of help under the text. Left out (or empty), nothing is said and nothing is
36
+ * drawn for it at all, and the box does not point at a hint: the chat leaves it out, since a person who has attached a file
37
+ * needs no line of help for it.
38
+ */
39
+ hint?: string;
35
40
  /** What a screen reader calls the list of files the `#` menu opens ("Attached files"). */
36
41
  menuLabel: string;
37
42
  /** What the X of a badge is called, with `{name}` for the file's name ("Remove {name}"). */
@@ -67,6 +67,11 @@
67
67
 
68
68
  const messages = $derived({ ...defaultMessages, ...messagesProp });
69
69
  const isUser = $derived(role === 'user');
70
+ // The row of actions under a message is drawn only when there is an action to put in it. A row with nothing in it still took its
71
+ // 32 px (and the 4 px gap above it): the space between a message and the next one grew by 36 px for no reason, and the chat had to
72
+ // hide the empty row with a rule of its own. Where there are actions the row keeps its place while hidden, so showing it never moves anything.
73
+ const hasUserActions = $derived(Boolean(onRestoreCheckpoint || onCopy || actions));
74
+ const hasAssistantActions = $derived(Boolean(onCopy || onRegenerate || actions));
70
75
  </script>
71
76
 
72
77
  <div
@@ -89,27 +94,29 @@
89
94
  {@render children()}
90
95
  {/if}
91
96
  </div>
92
- <div
93
- class={cn(
94
- 'duration-fast flex min-h-8 items-center gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none',
95
- showActions && 'opacity-100'
96
- )}
97
- >
98
- {#if onRestoreCheckpoint}
99
- <Button variant="ghost" size="sm" onclick={onRestoreCheckpoint}>
100
- <IconRestore class="size-4 stroke-2" aria-hidden="true" />
101
- {messages.restoreCheckpoint}
102
- </Button>
103
- {/if}
104
- {#if onCopy}
105
- <IconButton variant="ghost" label={messages.copy} onclick={onCopy}>
106
- <IconCopy class="size-4 stroke-2" aria-hidden="true" />
107
- </IconButton>
108
- {/if}
109
- {#if actions}
110
- {@render actions()}
111
- {/if}
112
- </div>
97
+ {#if hasUserActions}
98
+ <div
99
+ class={cn(
100
+ 'duration-fast flex min-h-8 items-center gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none',
101
+ showActions && 'opacity-100'
102
+ )}
103
+ >
104
+ {#if onRestoreCheckpoint}
105
+ <Button variant="ghost" size="sm" onclick={onRestoreCheckpoint}>
106
+ <IconRestore class="size-4 stroke-2" aria-hidden="true" />
107
+ {messages.restoreCheckpoint}
108
+ </Button>
109
+ {/if}
110
+ {#if onCopy}
111
+ <IconButton variant="ghost" label={messages.copy} onclick={onCopy}>
112
+ <IconCopy class="size-4 stroke-2" aria-hidden="true" />
113
+ </IconButton>
114
+ {/if}
115
+ {#if actions}
116
+ {@render actions()}
117
+ {/if}
118
+ </div>
119
+ {/if}
113
120
  {:else}
114
121
  <div
115
122
  class={cn('text-body text-foreground w-full', error && 'text-destructive')}
@@ -134,25 +141,27 @@
134
141
  </span>
135
142
  {/if}
136
143
  </div>
137
- <div
138
- class={cn(
139
- 'duration-fast flex min-h-8 items-center gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none',
140
- showActions && 'opacity-100'
141
- )}
142
- >
143
- {#if onCopy}
144
- <IconButton variant="ghost" label={messages.copy} onclick={onCopy}>
145
- <IconCopy class="size-4 stroke-2" aria-hidden="true" />
146
- </IconButton>
147
- {/if}
148
- {#if onRegenerate}
149
- <IconButton variant="ghost" label={messages.regenerate} onclick={onRegenerate}>
150
- <IconRefresh class="size-4 stroke-2" aria-hidden="true" />
151
- </IconButton>
152
- {/if}
153
- {#if actions}
154
- {@render actions()}
155
- {/if}
156
- </div>
144
+ {#if hasAssistantActions}
145
+ <div
146
+ class={cn(
147
+ 'duration-fast flex min-h-8 items-center gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none',
148
+ showActions && 'opacity-100'
149
+ )}
150
+ >
151
+ {#if onCopy}
152
+ <IconButton variant="ghost" label={messages.copy} onclick={onCopy}>
153
+ <IconCopy class="size-4 stroke-2" aria-hidden="true" />
154
+ </IconButton>
155
+ {/if}
156
+ {#if onRegenerate}
157
+ <IconButton variant="ghost" label={messages.regenerate} onclick={onRegenerate}>
158
+ <IconRefresh class="size-4 stroke-2" aria-hidden="true" />
159
+ </IconButton>
160
+ {/if}
161
+ {#if actions}
162
+ {@render actions()}
163
+ {/if}
164
+ </div>
165
+ {/if}
157
166
  {/if}
158
167
  </div>
@@ -68,6 +68,14 @@
68
68
  ...restProps
69
69
  }: MessageRatingActionsProps = $props();
70
70
 
71
+ /**
72
+ * The row is not what the eyes should go to, so its buttons rest in the placeholder grey (`text-muted-foreground`, the colour of the
73
+ * placeholder in the composer) and take the full text colour under the pointer and under the keyboard focus (the ghost button's own
74
+ * hover). A thumb that was pressed keeps the full colour, so a vote that was given stays easy to see.
75
+ */
76
+ const quietButtonClass = 'text-muted-foreground';
77
+ const quietThumbClass = 'text-muted-foreground aria-pressed:text-foreground';
78
+
71
79
  const messages = $derived({ ...defaultMessages, ...messagesProp });
72
80
  const visible = $derived(
73
81
  shouldRenderMessageRatingBar({ copyText, canRegenerate, ratedMessageId })
@@ -108,7 +116,7 @@
108
116
  {...restProps}
109
117
  >
110
118
  {#if shouldShowCopyAction(copyText) && onCopy}
111
- <IconButton variant="ghost" label={copied ? messages.copied : messages.copy} onclick={handleCopy}>
119
+ <IconButton variant="ghost" class={quietButtonClass} label={copied ? messages.copied : messages.copy} onclick={handleCopy}>
112
120
  {#if copied}
113
121
  <IconCheck class="size-4 stroke-2" aria-hidden="true" />
114
122
  {:else}
@@ -118,7 +126,7 @@
118
126
  {/if}
119
127
 
120
128
  {#if shouldShowRegenerateAction(canRegenerate) && onRegenerate}
121
- <IconButton variant="ghost" label={messages.regenerate} onclick={onRegenerate}>
129
+ <IconButton variant="ghost" class={quietButtonClass} label={messages.regenerate} onclick={onRegenerate}>
122
130
  <IconRefresh class="size-4 stroke-2" aria-hidden="true" />
123
131
  </IconButton>
124
132
  {/if}
@@ -127,6 +135,7 @@
127
135
  <span class="inline-flex items-center gap-0.5" role="group" aria-label={messages.rateGroup}>
128
136
  <IconButton
129
137
  variant="ghost"
138
+ class={quietThumbClass}
130
139
  label={messages.rateUp}
131
140
  aria-pressed={thumbIsPressed(rating, 'up')}
132
141
  onclick={() => onRate(ratedMessageId, 'up')}
@@ -139,6 +148,7 @@
139
148
  </IconButton>
140
149
  <IconButton
141
150
  variant="ghost"
151
+ class={quietThumbClass}
142
152
  label={messages.rateDown}
143
153
  aria-pressed={thumbIsPressed(rating, 'down')}
144
154
  onclick={() => onRate(ratedMessageId, 'down')}
@@ -20,6 +20,7 @@
20
20
  import { TextFlip } from '../ui/text-flip';
21
21
  import { cn } from '../../utils.js';
22
22
  import { prefersReducedMotion } from '../../utils/reducedMotion.js';
23
+ import { shouldOpenCollapsedPlanCard } from './planCardLogic.js';
23
24
 
24
25
  export type PlanTask = {
25
26
  id: string;
@@ -112,6 +113,7 @@
112
113
  headerIcon,
113
114
  primaryAction,
114
115
  secondaryAction,
116
+ onclick: onclickProp = undefined,
115
117
  ...restProps
116
118
  }: Props = $props();
117
119
 
@@ -145,6 +147,28 @@
145
147
  : messages.showMoreTasks.replace('{count}', String(hiddenCount))
146
148
  );
147
149
 
150
+ // A collapsed card (tasks still folded away) is a surface that opens: the whole of it answers the pointer like a chip does (grey on hover),
151
+ // and a press on it, outside its buttons and links, shows the rest of the tasks, as the toggle at the end of the list does.
152
+ const opensOnPress = $derived(!planning && hiddenCount > 0 && !expanded);
153
+
154
+ function handleCardClick(event: Parameters<NonNullable<Props['onclick']>>[0]): void {
155
+ try {
156
+ // The page's own handler goes first, and may answer the press itself (`preventDefault`)
157
+ onclickProp?.(event);
158
+ const shouldOpen = shouldOpenCollapsedPlanCard({
159
+ collapsed: opensOnPress,
160
+ defaultPrevented: event.defaultPrevented,
161
+ pressedElement: event.target instanceof Element ? event.target : null,
162
+ selectedText: window.getSelection()?.toString() ?? ''
163
+ });
164
+ if (!shouldOpen) return;
165
+ // console.debug('[PlanCard] the collapsed card was pressed: its folded tasks are shown');
166
+ expanded = true;
167
+ } catch (error) {
168
+ console.error('[PlanCard] could not open the collapsed card:', error);
169
+ }
170
+ }
171
+
148
172
  // The three screens of the responsive view, in the order of the plan: small to large. A screen without text is left out.
149
173
  const responsiveRows = $derived(
150
174
  responsive
@@ -243,14 +267,18 @@
243
267
  </div>
244
268
  {/snippet}
245
269
 
270
+ <!-- The press on the card is a pointer shortcut: a keyboard and a screen reader have the toggle at the end of the list, a button -->
246
271
  <div
247
272
  bind:this={ref}
248
273
  class={cn(
249
- 'rounded-card border-border bg-background flex w-full max-w-full flex-col border p-4',
274
+ 'rounded-card border-border bg-background duration-fast flex w-full max-w-full flex-col border p-4 transition-colors',
275
+ opensOnPress && 'hover:bg-accent cursor-pointer',
250
276
  className
251
277
  )}
252
278
  data-plan-state={planning ? 'planning' : 'ready'}
279
+ data-plan-collapsed={opensOnPress ? true : undefined}
253
280
  aria-busy={planning ? true : undefined}
281
+ onclick={handleCardClick}
254
282
  {...restProps}
255
283
  >
256
284
  <header class="flex min-w-0 items-center gap-2">
@@ -311,6 +339,16 @@
311
339
 
312
340
  {#if hiddenCount > 0}
313
341
  <Collapsible.Root bind:open={expanded}>
342
+ <!-- The tasks that were hidden come first, so that opening them lists them right after the ones that were already
343
+ visible; the toggle stays the last thing of the list, whether it says "Show more" or "Show fewer". -->
344
+ <Collapsible.Content
345
+ class="flex flex-col overflow-hidden motion-reduce:transition-none"
346
+ data-testid="plan-card-hidden-tasks"
347
+ >
348
+ {#each hiddenTasks as task (task.id)}
349
+ {@render taskRow(task)}
350
+ {/each}
351
+ </Collapsible.Content>
314
352
  <Collapsible.Trigger
315
353
  class="text-label text-foreground duration-fast hover:bg-accent focus-visible:ring-ring focus-visible:ring-offset-background mt-1 inline-flex h-8 items-center gap-1 rounded-lg px-2 transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden"
316
354
  >
@@ -323,13 +361,6 @@
323
361
  aria-hidden="true"
324
362
  />
325
363
  </Collapsible.Trigger>
326
- <Collapsible.Content
327
- class="flex flex-col overflow-hidden motion-reduce:transition-none"
328
- >
329
- {#each hiddenTasks as task (task.id)}
330
- {@render taskRow(task)}
331
- {/each}
332
- </Collapsible.Content>
333
364
  </Collapsible.Root>
334
365
  {/if}
335
366
  </div>
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Whether a press on a plan card is the press that opens it.
3
+ *
4
+ * A collapsed card (it has tasks folded away behind its toggle) is a surface that opens: a press anywhere on it shows the rest of the
5
+ * tasks, as the toggle at the end of the list does. Three presses are not that one:
6
+ * - one a handler of the page already answered (it called `preventDefault`);
7
+ * - one on a button or a link of the card (it does its own work, and the toggle, which is a button, must not be counted twice);
8
+ * - the end of a drag over the text of the card (the person was selecting words, not pressing the card).
9
+ */
10
+ /** What counts as a control of its own inside the card: a press on one of these (or on something inside one) is theirs. */
11
+ export declare const PLAN_CARD_CONTROLS_SELECTOR = "button, a, [role=\"button\"]";
12
+ export type PlanCardPress = {
13
+ /** The card is collapsed: it has tasks folded away, it is not being planned and it is not open. */
14
+ collapsed: boolean;
15
+ /** A handler of the page already answered the press. */
16
+ defaultPrevented: boolean;
17
+ /** What was pressed, or `null` when it is no element. */
18
+ pressedElement: {
19
+ closest(selectors: string): unknown;
20
+ } | null;
21
+ /** The text the person has selected on the page ('' for none). */
22
+ selectedText: string;
23
+ };
24
+ export declare function shouldOpenCollapsedPlanCard(press: PlanCardPress): boolean;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Whether a press on a plan card is the press that opens it.
3
+ *
4
+ * A collapsed card (it has tasks folded away behind its toggle) is a surface that opens: a press anywhere on it shows the rest of the
5
+ * tasks, as the toggle at the end of the list does. Three presses are not that one:
6
+ * - one a handler of the page already answered (it called `preventDefault`);
7
+ * - one on a button or a link of the card (it does its own work, and the toggle, which is a button, must not be counted twice);
8
+ * - the end of a drag over the text of the card (the person was selecting words, not pressing the card).
9
+ */
10
+ /** What counts as a control of its own inside the card: a press on one of these (or on something inside one) is theirs. */
11
+ export const PLAN_CARD_CONTROLS_SELECTOR = 'button, a, [role="button"]';
12
+ export function shouldOpenCollapsedPlanCard(press) {
13
+ if (!press.collapsed || press.defaultPrevented)
14
+ return false;
15
+ if (press.pressedElement?.closest(PLAN_CARD_CONTROLS_SELECTOR))
16
+ return false;
17
+ if (press.selectedText !== '')
18
+ return false;
19
+ return true;
20
+ }
@@ -12,15 +12,25 @@
12
12
  // alignment inside a menu of a right to left screen.
13
13
  const textDirection = useTextDirection();
14
14
 
15
+ // The sub-menu hangs from its row: the top of its first entry is level with the row that opened it. The library centres a
16
+ // floating element on its anchor unless told otherwise, so a sub-menu of three entries sat a third of its height above the
17
+ // row and did not look as if it came out of it. The offset is the 1px border plus the 4px padding (`border p-1` below) that
18
+ // stand between the top edge of the box and its first entry.
19
+ const SUB_MENU_ALIGN_OFFSET_PX = -5;
20
+
15
21
  let {
16
22
  ref = $bindable(null),
17
23
  class: className,
24
+ align = "start",
25
+ alignOffset = SUB_MENU_ALIGN_OFFSET_PX,
18
26
  ...restProps
19
27
  }: DropdownMenuSubContentProps = $props();
20
28
  </script>
21
29
 
22
30
  <DropdownMenuPrimitive.SubContent
23
31
  bind:ref
32
+ {align}
33
+ {alignOffset}
24
34
  dir={$textDirection}
25
35
  class={cn(
26
36
  // floating-motion: the sub-menu slides in like the menu it opens from (it had no motion before)
@@ -3,6 +3,7 @@ export const COMPLETION_HINT_STORAGE_KEY = 'widgetic:completion-hint-learned:v1'
3
3
  /** What is stored once a suggestion was taken. */
4
4
  const LEARNED_VALUE = '1';
5
5
  const defaultLog = (message, detail) => {
6
+ // Kept on: this is the documented default of the `log` option (a test pins it), and it writes at debug level only.
6
7
  console.debug('[inline-completion]', message, detail ?? '');
7
8
  };
8
9
  /** The page's own storage, or null when there is none (a server render) or the browser refuses to hand it out (it throws). */
@@ -8,6 +8,7 @@ export const GHOST_OVERLAY_OWNER = 'ghost';
8
8
  /** The ghost's colour: the muted text colour of the design system. A host may pass its own classes. */
9
9
  export const DEFAULT_GHOST_CLASS = 'text-muted-foreground';
10
10
  const defaultLog = (message, detail) => {
11
+ // Kept on: this is the documented default of the `log` option (the same line as the hint memory's), and it writes at debug level only.
11
12
  console.debug('[inline-completion]', message, detail ?? '');
12
13
  };
13
14
  /** Text for assistive technology only: out of sight, still read. */
@@ -1,7 +1,8 @@
1
1
  <script lang="ts">
2
2
  /**
3
- * The `#` menu: the files a person may refer to, each with its thumbnail, label, file name and size, and a larger preview of the
4
- * highlighted one. It can also show the preview alone, over a badge the pointer is on.
3
+ * The `#` menu: the files a person may refer to, each row with its small thumbnail and the file's name, and nothing else (the
4
+ * thumbnail IS the preview: no larger card opens beside the list). It can also show a larger preview alone, over a badge the pointer
5
+ * is on.
5
6
  *
6
7
  * It does not own any state: the action (`promptReferences`) tells it what to show and where, and hears back which row was chosen or
7
8
  * hovered. The focus never leaves the text box (this is a combobox popup: the action sets `aria-activedescendant` on the box), so the
@@ -12,12 +13,7 @@
12
13
  * Where the top layer is not available they are `fixed` with a high z-index instead.
13
14
  */
14
15
  import { FILE_GLYPH_PATHS } from './referenceBadge.js';
15
- import {
16
- placeMenu,
17
- placePreview,
18
- type Box,
19
- type MenuDirection
20
- } from './referenceMenuPlacement.js';
16
+ import { placeMenu, type Box, type MenuDirection } from './referenceMenuPlacement.js';
21
17
  import type { ReferenceItem } from './referenceTypes.js';
22
18
 
23
19
  type Props = {
@@ -27,9 +23,9 @@
27
23
  activeIndex: number;
28
24
  /** The `#` the list hangs from, in viewport pixels. */
29
25
  anchor: Box | null;
30
- /** The file the preview shows (the highlighted row's, or the badge the pointer is on). */
26
+ /** The file the preview shows: the badge the pointer is on. Never a row of the list, which carries its own small picture. */
31
27
  previewItem: ReferenceItem | null;
32
- /** What the preview hangs from when there is no list: the badge, in viewport pixels. */
28
+ /** What the preview hangs from: the badge, in viewport pixels. Without it there is no preview. */
33
29
  previewAnchor: Box | null;
34
30
  /** The id of the list, for the box's `aria-controls`. The rows are `{menuId}-option-{index}`. */
35
31
  menuId: string;
@@ -71,15 +67,15 @@
71
67
  let previewPosition = $state<{ left: number; top: number } | null>(null);
72
68
  /**
73
69
  * The distance of the list and of the picture from the left edge of the page. Both are put by pixel at a place measured from the
74
- * rectangles of the text box and of the page (the placement code picks the side the text box leaves room on), so a left-to-right
75
- * and a right-to-left page put them alike.
70
+ * rectangles of the text box (or of the badge) and of the page (the placement code picks the side there is room on), so a
71
+ * left-to-right and a right-to-left page put them alike.
76
72
  */
77
73
  const listOffsetStyle = $derived(
78
74
  // rtl-ok: measured from the left edge of the page, at a place the placement code chose
79
75
  `left: ${listBox?.left ?? 0}px;`
80
76
  );
81
77
  const previewOffsetStyle = $derived(
82
- // rtl-ok: measured from the left edge of the page, at a place the placement code chose next to the list
78
+ // rtl-ok: measured from the left edge of the page, at a place the placement code chose over the badge
83
79
  `left: ${previewPosition?.left ?? 0}px;`
84
80
  );
85
81
  /** The window's size, kept by Svelte: a resize or a zoom places both again. */
@@ -94,10 +90,10 @@
94
90
  function reportProblemOnce(error: unknown): void {
95
91
  if (reportedProblem) return;
96
92
  reportedProblem = true;
97
- console.debug(
98
- '[prompt-references] could not place the menu',
99
- error instanceof Error ? error.message : error
100
- );
93
+ // console.debug(
94
+ // '[prompt-references] could not place the menu',
95
+ // error instanceof Error ? error.message : error
96
+ // );
101
97
  }
102
98
 
103
99
  /** The space the page can show, in the same pixels as the anchors: the visual viewport when there is one (a keyboard shrinks it). */
@@ -161,37 +157,21 @@
161
157
  }
162
158
  });
163
159
 
164
- // The preview: beside the list when there is one, otherwise above (or below) the badge it belongs to.
160
+ // The preview: above (or below) the badge it belongs to. The list has no card of its own beside it (its rows carry a small picture).
165
161
  $effect(() => {
166
162
  void windowWidth;
167
163
  void windowHeight;
168
164
  const element = previewElement;
169
165
  const shown = previewItem;
170
- if (!element || !shown) {
166
+ const hangFrom = previewAnchor;
167
+ if (!element || !shown || !hangFrom) {
171
168
  previewPosition = null;
172
169
  return;
173
170
  }
174
171
  try {
175
172
  const size = { width: element.offsetWidth, height: element.offsetHeight };
176
- const viewport = viewportSize();
177
- if (items.length > 0 && listBox) {
178
- previewPosition = placePreview({
179
- beside: {
180
- left: listBox.left,
181
- top: listBox.top,
182
- right: listBox.left + listBox.width,
183
- bottom: listBox.top + listBox.height
184
- },
185
- preview: size,
186
- viewport,
187
- direction
188
- });
189
- } else if (previewAnchor) {
190
- const placed = placeMenu({ anchor: previewAnchor, menu: size, viewport, direction });
191
- previewPosition = { left: placed.left, top: placed.top };
192
- } else {
193
- previewPosition = null;
194
- }
173
+ const placed = placeMenu({ anchor: hangFrom, menu: size, viewport: viewportSize(), direction });
174
+ previewPosition = { left: placed.left, top: placed.top };
195
175
  } catch (error) {
196
176
  reportProblemOnce(error);
197
177
  }
@@ -215,6 +195,11 @@
215
195
  failedPictures[url] = true;
216
196
  }
217
197
 
198
+ /** What the pointer shows when it rests on a row: the whole name (a long one is cut short), and the size when the host knows it. */
199
+ function rowTitle(item: ReferenceItem): string {
200
+ return item.sizeLabel ? `${item.fileName} · ${item.sizeLabel}` : item.fileName;
201
+ }
202
+
218
203
  /** A move over a row highlights it, unless the pointer has not really moved (the rows scrolled under it). */
219
204
  function handleRowPointerMove(event: MouseEvent, index: number): void {
220
205
  if (event.clientX === lastPointerPosition.x && event.clientY === lastPointerPosition.y) return;
@@ -282,6 +267,7 @@
282
267
  id="{menuId}-option-{index}"
283
268
  role="option"
284
269
  aria-selected={index === activeIndex}
270
+ aria-label={item.fileName}
285
271
  data-prompt-reference-option={index}
286
272
  data-label={item.label}
287
273
  class="aria-selected:bg-accent aria-selected:text-accent-foreground flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm"
@@ -289,56 +275,70 @@
289
275
  onclick={() => onChoose(item)}
290
276
  >
291
277
  {@render picture(item, 'size-8 rounded-lg', 'size-4')}
292
- <span class="flex min-w-0 flex-1 flex-col">
293
- <span class="truncate font-medium">#{item.label}</span>
294
- <span class="text-muted-foreground truncate text-xs">
295
- {item.fileName}{item.sizeLabel ? ` · ${item.sizeLabel}` : ''}
296
- </span>
297
- </span>
278
+ <!-- The name and nothing else. It may take a second line before it is cut with an ellipsis: files from a camera or an
279
+ export often share a long beginning and differ at the end, so one line cut at the end would show two rows alike. -->
280
+ <span
281
+ class="line-clamp-2 min-w-0 flex-1 [overflow-wrap:anywhere]"
282
+ data-prompt-reference-name
283
+ title={rowTitle(item)}>{item.fileName}</span
284
+ >
298
285
  <span class="text-muted-foreground text-xs tabular-nums">{item.number}</span>
299
286
  </div>
300
287
  {/each}
301
288
  </div>
302
289
  {/if}
303
290
 
304
- {#if previewItem}
291
+ {#if previewItem && previewAnchor}
292
+ <!-- Over a badge the pointer is on. A row of the list never gets one: its small picture is the preview. -->
305
293
  <div
306
294
  bind:this={previewElement}
307
295
  use:showInTopLayer
308
296
  popover="manual"
309
297
  aria-hidden="true"
310
298
  data-prompt-reference-preview
311
- class="border-border bg-popover text-popover-foreground pointer-events-none fixed inset-auto z-[1100] m-0 box-content flex w-40 flex-col gap-1 overflow-hidden rounded-xl border p-1"
299
+ class="border-border bg-popover text-popover-foreground pointer-events-none fixed inset-auto z-[1100] m-0 box-content flex flex-col gap-1 overflow-hidden rounded-xl border p-1 {previewItem.excerpt
300
+ ? 'w-64'
301
+ : 'w-40'}"
312
302
  style={previewOffsetStyle}
313
303
  style:top="{previewPosition?.top ?? 0}px"
314
304
  style:visibility={previewPosition ? 'visible' : 'hidden'}
315
305
  >
316
- <div class="bg-background flex size-40 items-center justify-center overflow-hidden rounded-lg">
317
- {#if previewItem.previewUrl && !failedPictures[previewItem.previewUrl]}
318
- <img
319
- src={previewItem.previewUrl}
320
- alt=""
321
- draggable="false"
322
- class="size-full object-contain"
323
- onerror={() => markPictureFailed(previewItem?.previewUrl ?? '')}
324
- />
325
- {:else}
326
- <svg
327
- viewBox="0 0 24 24"
328
- fill="none"
329
- stroke="currentColor"
330
- stroke-width="1.5"
331
- stroke-linecap="round"
332
- stroke-linejoin="round"
333
- aria-hidden="true"
334
- class="text-muted-foreground size-10"
335
- >
336
- {#each FILE_GLYPH_PATHS as pathData (pathData)}
337
- <path d={pathData} />
338
- {/each}
339
- </svg>
340
- {/if}
341
- </div>
306
+ {#if previewItem.excerpt}
307
+ <!-- A text: what it says, from its beginning, cut short with an ellipsis (a long text is far more than the card can hold).
308
+ The padding sits on the wrapper: a clamped box with padding of its own lets a tenth line show through the padding. -->
309
+ <div class="bg-background w-full overflow-hidden rounded-lg p-2">
310
+ <p
311
+ class="text-muted-foreground line-clamp-9 w-full text-xs leading-4 break-words whitespace-pre-wrap"
312
+ data-prompt-reference-excerpt>{previewItem.excerpt}</p>
313
+ </div>
314
+ {:else}
315
+ <div class="bg-background flex size-40 items-center justify-center overflow-hidden rounded-lg">
316
+ {#if previewItem.previewUrl && !failedPictures[previewItem.previewUrl]}
317
+ <img
318
+ src={previewItem.previewUrl}
319
+ alt=""
320
+ draggable="false"
321
+ class="size-full object-contain"
322
+ onerror={() => markPictureFailed(previewItem?.previewUrl ?? '')}
323
+ />
324
+ {:else}
325
+ <svg
326
+ viewBox="0 0 24 24"
327
+ fill="none"
328
+ stroke="currentColor"
329
+ stroke-width="1.5"
330
+ stroke-linecap="round"
331
+ stroke-linejoin="round"
332
+ aria-hidden="true"
333
+ class="text-muted-foreground size-10"
334
+ >
335
+ {#each FILE_GLYPH_PATHS as pathData (pathData)}
336
+ <path d={pathData} />
337
+ {/each}
338
+ </svg>
339
+ {/if}
340
+ </div>
341
+ {/if}
342
342
  <span class="truncate px-1 text-xs">{previewItem.fileName}</span>
343
343
  </div>
344
344
  {/if}
@@ -7,9 +7,9 @@ type Props = {
7
7
  activeIndex: number;
8
8
  /** The `#` the list hangs from, in viewport pixels. */
9
9
  anchor: Box | null;
10
- /** The file the preview shows (the highlighted row's, or the badge the pointer is on). */
10
+ /** The file the preview shows: the badge the pointer is on. Never a row of the list, which carries its own small picture. */
11
11
  previewItem: ReferenceItem | null;
12
- /** What the preview hangs from when there is no list: the badge, in viewport pixels. */
12
+ /** What the preview hangs from: the badge, in viewport pixels. Without it there is no preview. */
13
13
  previewAnchor: Box | null;
14
14
  /** The id of the list, for the box's `aria-controls`. The rows are `{menuId}-option-{index}`. */
15
15
  menuId: string;
@@ -82,6 +82,7 @@ export function promptReferences(field, initialParams) {
82
82
  const reportedKinds = new Set();
83
83
  function log(message, detail) {
84
84
  try {
85
+ // Kept on: the console at debug level is the documented default of the `logger` option.
85
86
  if (params.logger)
86
87
  params.logger(message, detail);
87
88
  else
@@ -196,8 +197,15 @@ export function promptReferences(field, initialParams) {
196
197
  const selection = currentSelection();
197
198
  const decorations = [];
198
199
  let badgeCount = 0;
200
+ const tokens = badgesFellBack ? [] : readTokens();
201
+ // The badge under the pointer can be gone with no pointer move (the message was sent, or the text cleared, while the pointer rested
202
+ // on it): its preview goes with it, instead of hanging over the box until the pointer moves.
203
+ const hoveredBadgeIsGone = badgeHover !== null &&
204
+ !tokens.some((token) => itemOfToken(token)?.label.toLowerCase() === hoveredLabel());
205
+ if (hoveredBadgeIsGone)
206
+ badgeHover = null;
199
207
  if (!badgesFellBack) {
200
- for (const token of readTokens()) {
208
+ for (const token of tokens) {
201
209
  const item = itemOfToken(token);
202
210
  if (!item)
203
211
  continue;
@@ -230,6 +238,10 @@ export function promptReferences(field, initialParams) {
230
238
  });
231
239
  }
232
240
  overlay.setDecorations(decorations);
241
+ if (hoveredBadgeIsGone) {
242
+ syncMenuView();
243
+ tellHover(null, 'badge');
244
+ }
233
245
  if (badgeCount > 0 && !layoutCheckQueued) {
234
246
  layoutCheckQueued = true;
235
247
  // After the layer's own paint, which is queued first.
@@ -383,12 +395,13 @@ export function promptReferences(field, initialParams) {
383
395
  const host = ensureMenuHost();
384
396
  const base = { menuLabel: params.messages.menuLabel, direction: fieldDirection() };
385
397
  if (openMenu) {
398
+ // The list alone: each row has its own small picture, so no larger card opens beside it for the highlighted row.
386
399
  host.update({
387
400
  ...base,
388
401
  items: openMenu.matches,
389
402
  activeIndex: openMenu.activeIndex,
390
403
  anchor: measureAnchor(),
391
- previewItem: openMenu.matches[openMenu.activeIndex] ?? null,
404
+ previewItem: null,
392
405
  previewAnchor: null
393
406
  });
394
407
  }
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Where the `#` menu and the preview of a file go. Pure functions, no DOM: rectangles in, rectangles out, all in viewport pixels.
2
+ * Where the `#` menu goes, and the preview of a file over a badge (it hangs from its anchor the way the menu does). Pure functions, no
3
+ * DOM: rectangles in, rectangles out, all in viewport pixels.
3
4
  *
4
5
  * The composer sits at the bottom edge of a page, so the menu opens ABOVE the `#` when there is no room below, and it never leaves the
5
6
  * viewport. The side it hangs from follows the field's direction: a right-to-left field has its menu start at the `#`'s right edge.
@@ -46,18 +47,3 @@ export interface PlaceMenuInput {
46
47
  * right-to-left field), moved in if it would leave the viewport.
47
48
  */
48
49
  export declare function placeMenu(input: PlaceMenuInput): MenuPlacement;
49
- export interface PlacePreviewInput {
50
- /** The menu (or the badge) the preview goes beside. */
51
- beside: Box;
52
- preview: Size;
53
- viewport: Size;
54
- direction?: MenuDirection;
55
- }
56
- /**
57
- * The preview card's place: beside the menu on its end side (right in a left-to-right page) when it fits, otherwise on the other side,
58
- * otherwise over the menu's top edge. Aligned with the menu's top, and kept inside the viewport.
59
- */
60
- export declare function placePreview(input: PlacePreviewInput): {
61
- left: number;
62
- top: number;
63
- };
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Where the `#` menu and the preview of a file go. Pure functions, no DOM: rectangles in, rectangles out, all in viewport pixels.
2
+ * Where the `#` menu goes, and the preview of a file over a badge (it hangs from its anchor the way the menu does). Pure functions, no
3
+ * DOM: rectangles in, rectangles out, all in viewport pixels.
3
4
  *
4
5
  * The composer sits at the bottom edge of a page, so the menu opens ABOVE the `#` when there is no room below, and it never leaves the
5
6
  * viewport. The side it hangs from follows the field's direction: a right-to-left field has its menu start at the `#`'s right edge.
@@ -40,27 +41,3 @@ export function placeMenu(input) {
40
41
  const left = clamp(preferredLeft, margin, viewport.width - menu.width - margin);
41
42
  return { left, top: Math.max(margin, top), placement, maxHeight };
42
43
  }
43
- /**
44
- * The preview card's place: beside the menu on its end side (right in a left-to-right page) when it fits, otherwise on the other side,
45
- * otherwise over the menu's top edge. Aligned with the menu's top, and kept inside the viewport.
46
- */
47
- export function placePreview(input) {
48
- const { beside, preview, viewport } = input;
49
- const margin = MENU_VIEWPORT_MARGIN;
50
- const gap = MENU_ANCHOR_GAP;
51
- const endSideLeft = input.direction === 'rtl' ? beside.left - gap - preview.width : beside.right + gap;
52
- const startSideLeft = input.direction === 'rtl' ? beside.right + gap : beside.left - gap - preview.width;
53
- const fits = (left) => left >= margin && left + preview.width <= viewport.width - margin;
54
- let left;
55
- let top = beside.top;
56
- if (fits(endSideLeft))
57
- left = endSideLeft;
58
- else if (fits(startSideLeft))
59
- left = startSideLeft;
60
- else {
61
- // No room at either side: the card sits above the box instead of over it.
62
- left = clamp(beside.left, margin, viewport.width - preview.width - margin);
63
- top = beside.top - gap - preview.height;
64
- }
65
- return { left, top: clamp(top, margin, viewport.height - preview.height - margin) };
66
- }
@@ -15,6 +15,11 @@ export interface ReferenceItem {
15
15
  previewUrl?: string | null;
16
16
  /** The size, already written for people ("1.2 MB"). */
17
17
  sizeLabel?: string;
18
+ /**
19
+ * For a file that is a text (a long text that was pasted): the beginning of the text. The card that opens over its badge shows
20
+ * it, cut short with an ellipsis, in place of a picture: what the badge stands for is what it holds, not the name of a file.
21
+ */
22
+ excerpt?: string;
18
23
  }
19
24
  /** The words the action shows or speaks. The host passes them from its own messages, so the design system holds no English. */
20
25
  export interface ReferenceMessages {
@@ -322,6 +322,9 @@
322
322
  * stylesheet won, and when that was `transition-colors` the press had no transition at all: the control snapped in and
323
323
  * snapped back. `:not([data-no-press])` raises the specificity above `transition-colors` and `duration-*`, so they compose
324
324
  * in any order, and `data-no-press` is the way to opt one control out.
325
+ *
326
+ * The opacity of the control is in the list too, but with no time of its own (`--press-feedback-opacity-duration`, 0s): a
327
+ * change of opacity (the half-opacity of `disabled:`) still snaps, as it always did. `press-feedback-fade` gives it a time.
325
328
  */
326
329
  @utility press-feedback {
327
330
  &:not([data-no-press]) {
@@ -333,7 +336,8 @@
333
336
  text-decoration-color var(--duration-fast) cubic-bezier(0.4, 0, 0.2, 1),
334
337
  fill var(--duration-fast) cubic-bezier(0.4, 0, 0.2, 1),
335
338
  stroke var(--duration-fast) cubic-bezier(0.4, 0, 0.2, 1),
336
- transform var(--duration-base) var(--ease-out);
339
+ transform var(--duration-base) var(--ease-out),
340
+ opacity var(--press-feedback-opacity-duration, 0s) cubic-bezier(0.4, 0, 0.2, 1);
337
341
  }
338
342
 
339
343
  &:active:not(:disabled):not([aria-disabled='true']),
@@ -349,6 +353,18 @@
349
353
  }
350
354
  }
351
355
 
356
+ /*
357
+ * A pressable control that fades between two looks that differ in opacity (the send button of the composer: half opacity while
358
+ * there is nothing to send): put `press-feedback-fade` beside `press-feedback`, and the change takes `--duration-fast` instead of
359
+ * snapping. A transition can be turned around by itself: when the look changes back while the fade is under way (the box goes
360
+ * empty and is typed in again within the fade), the browser fades on from the opacity it has reached, towards the look it is
361
+ * asked for now, so nothing is started over and nothing jumps to either end. It is a fade, not a movement, so it stays for
362
+ * people who ask for less motion.
363
+ */
364
+ @utility press-feedback-fade {
365
+ --press-feedback-opacity-duration: var(--duration-fast);
366
+ }
367
+
352
368
  /*
353
369
  * The motion of a floating surface that opens from a trigger (the dropdown and its sub-menus, the popover, the select list, the
354
370
  * hover card; the account and workspace menus of the sidebar are dropdowns): it fades in while it slides `--floating-slide` (8px)
@@ -381,6 +397,15 @@
381
397
  }
382
398
  }
383
399
  @utility floating-motion {
400
+ /*
401
+ * Both axes are written on the surface itself, 0 unless its side says otherwise. A custom property is inherited and a sub-menu is
402
+ * a DOM child of the menu it opens from, so a sub-menu that opens to the right used to pick up the -8px of its parent's `bottom`
403
+ * side as well and slid in from the top left corner, diagonally, instead of out of its row (owner, 20 Nov 2026: "the submenu
404
+ * doesn't slide in from that button").
405
+ */
406
+ --floating-slide-x: 0px;
407
+ --floating-slide-y: 0px;
408
+
384
409
  &[data-side='bottom'] {
385
410
  --floating-slide-y: calc(var(--floating-slide) * -1);
386
411
  }
@@ -58,7 +58,10 @@ function reportProblemOnce(kind, error) {
58
58
  if (reportedProblems.has(kind))
59
59
  return;
60
60
  reportedProblems.add(kind);
61
- console.debug(`[textarea-overlay] ${kind}`, error instanceof Error ? error.message : (error ?? ''));
61
+ // console.debug(
62
+ // `[textarea-overlay] ${kind}`,
63
+ // error instanceof Error ? error.message : (error ?? '')
64
+ // );
62
65
  }
63
66
  function createOverlayCore(field) {
64
67
  const doc = field.ownerDocument;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/design-system",
3
- "version": "0.5.42",
3
+ "version": "0.5.43",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "svelte": "./dist/index.js",