@widgetic/design-system 0.5.42 → 0.5.44

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.
Files changed (31) hide show
  1. package/README.md +55 -3
  2. package/dist/components/chat/Composer.svelte +68 -17
  3. package/dist/components/chat/Composer.svelte.d.ts +22 -2
  4. package/dist/components/chat/ComposerNotice.svelte +56 -0
  5. package/dist/components/chat/ComposerNotice.svelte.d.ts +14 -0
  6. package/dist/components/chat/Message.svelte +50 -41
  7. package/dist/components/chat/MessageRatingActions.svelte +50 -3
  8. package/dist/components/chat/MessageRatingActions.svelte.d.ts +8 -0
  9. package/dist/components/chat/PlanCard.svelte +39 -8
  10. package/dist/components/chat/ScrollToBottom.svelte +13 -2
  11. package/dist/components/chat/ScrollToBottom.svelte.d.ts +1 -0
  12. package/dist/components/chat/composerLogic.d.ts +6 -0
  13. package/dist/components/chat/composerLogic.js +11 -0
  14. package/dist/components/chat/index.d.ts +1 -0
  15. package/dist/components/chat/index.js +2 -0
  16. package/dist/components/chat/planCardLogic.d.ts +24 -0
  17. package/dist/components/chat/planCardLogic.js +20 -0
  18. package/dist/components/index.d.ts +1 -1
  19. package/dist/components/index.js +1 -1
  20. package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +10 -0
  21. package/dist/inline-completion/hintMemory.js +1 -0
  22. package/dist/inline-completion/inlineCompletionAction.js +1 -0
  23. package/dist/prompt-references/ReferenceMenu.svelte +72 -72
  24. package/dist/prompt-references/ReferenceMenu.svelte.d.ts +2 -2
  25. package/dist/prompt-references/promptReferences.js +15 -2
  26. package/dist/prompt-references/referenceMenuPlacement.d.ts +2 -16
  27. package/dist/prompt-references/referenceMenuPlacement.js +2 -25
  28. package/dist/prompt-references/referenceTypes.d.ts +5 -0
  29. package/dist/styles/tokens.css +26 -1
  30. package/dist/textarea-overlay/textareaOverlay.js +4 -1
  31. package/package.json +1 -1
@@ -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.44",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "type": "module",
6
6
  "svelte": "./dist/index.js",