@astryxdesign/core 0.7.2-canary.58d3353 → 0.7.2-canary.5c208f6

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 (36) hide show
  1. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  2. package/dist/HoverCard/useHoverCard.js +10 -2
  3. package/dist/Markdown/plugins/frontmatter.d.ts.map +1 -1
  4. package/dist/Markdown/plugins/frontmatter.js +7 -3
  5. package/dist/Selector/hooks.d.ts.map +1 -1
  6. package/dist/Selector/hooks.js +6 -2
  7. package/dist/Switch/Switch.d.ts +1 -1
  8. package/dist/Switch/Switch.d.ts.map +1 -1
  9. package/dist/Switch/Switch.js +7 -1
  10. package/dist/Text/useTruncation.d.ts +7 -5
  11. package/dist/Text/useTruncation.d.ts.map +1 -1
  12. package/dist/Text/useTruncation.js +16 -5
  13. package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
  14. package/dist/i18n/generated-locales/en.generated.js +29 -1
  15. package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
  16. package/dist/i18n/generated-locales/pseudo.generated.js +29 -1
  17. package/dist/utils/sharedMutationObserver.d.ts +21 -0
  18. package/dist/utils/sharedMutationObserver.d.ts.map +1 -0
  19. package/dist/utils/sharedMutationObserver.js +69 -0
  20. package/locales/en.json +112 -0
  21. package/locales/pseudo.json +84 -0
  22. package/package.json +3 -3
  23. package/src/HoverCard/HoverCard.test.tsx +58 -0
  24. package/src/HoverCard/useHoverCard.tsx +10 -2
  25. package/src/Markdown/plugins/frontmatter.test.tsx +25 -0
  26. package/src/Markdown/plugins/frontmatter.ts +7 -3
  27. package/src/Selector/hooks.ts +6 -2
  28. package/src/Selector/useCombobox.doc.mjs +237 -0
  29. package/src/Switch/Switch.test.tsx +21 -0
  30. package/src/Switch/Switch.tsx +5 -0
  31. package/src/Text/useTruncation.test.tsx +69 -0
  32. package/src/Text/useTruncation.ts +16 -5
  33. package/src/i18n/generated-locales/en.generated.ts +28 -0
  34. package/src/i18n/generated-locales/pseudo.generated.ts +28 -0
  35. package/src/utils/sharedMutationObserver.test.ts +53 -0
  36. package/src/utils/sharedMutationObserver.ts +78 -0
@@ -1 +1 @@
1
- {"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AA6BlC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IAErC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;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,CAAC,KAC5C,SAAS,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAyBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CAyc5E"}
@@ -145,6 +145,14 @@ export function useHoverCard(options = {}) {
145
145
  isHoveringContentRef.current = false;
146
146
  hideLayer();
147
147
  }, [clearTimeouts, hideLayer]);
148
+
149
+ // The imperative hide. A card closed while the pointer rests on it unmounts
150
+ // without a mouseleave, so the content-hover latch is cleared here; left set,
151
+ // it would keep the trigger's next hover-open from closing on leave.
152
+ const hide = useCallback(() => {
153
+ isHoveringContentRef.current = false;
154
+ hideLayer();
155
+ }, [hideLayer]);
148
156
  const {
149
157
  isTouchPointerRef,
150
158
  isTouchInteraction,
@@ -291,7 +299,7 @@ export function useHoverCard(options = {}) {
291
299
  // clear it.
292
300
  const card = typeof document === 'undefined' ? null : document.getElementById(layerId);
293
301
  const hadFocus = card?.contains(document.activeElement) ?? false;
294
- hideLayer();
302
+ hide();
295
303
  if (hadFocus) {
296
304
  isEscapeDismissingRef.current = true;
297
305
  triggerRef.current?.focus();
@@ -448,6 +456,6 @@ export function useHoverCard(options = {}) {
448
456
  isOpen: isLayerOpen,
449
457
  renderHoverCard,
450
458
  show: showLayer,
451
- hide: hideLayer
459
+ hide
452
460
  };
453
461
  }
@@ -1 +1 @@
1
- {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../../src/Markdown/plugins/frontmatter.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAKL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAEzB,MAAM,YAAY,CAAC;AAMpB,KAAK,iBAAiB,GAAG,QAAQ,C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Object.create(null);
38
+ const entries = new Map();
39
39
  for (const line of body.slice(0, close.index).split(/\r?\n/)) {
40
40
  if (line.trim() === '') {
41
41
  continue;
42
42
  }
43
43
  const separator = line.indexOf(':');
44
44
  const key = line.slice(0, separator).trim();
45
- if (separator <= 0 || key === '' || Object.hasOwn(fields, key)) {
45
+ if (separator <= 0 || key === '' || entries.has(key)) {
46
46
  return {
47
47
  status: 'none'
48
48
  };
49
49
  }
50
- fields[key] = line.slice(separator + 1).trim();
50
+ entries.set(key, line.slice(separator + 1).trim());
51
51
  }
52
+ // A plain object, so a parser that returns the record unchanged passes the
53
+ // JSON-like metadata check. `fromEntries` defines every key as an own data
54
+ // property, so a field named `__proto__` stays a field.
55
+ const fields = Object.fromEntries(entries);
52
56
  let end = openingLength + close.index + close[0].length;
53
57
  if (source.startsWith('\r\n', end)) {
54
58
  end += 2;
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/Selector/hooks.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAyBhD,UAAU,4BAA4B;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC7C,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC1C;AAED,UAAU,2BAA2B;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,SAAS,GACV,EAAE,4BAA4B,GAAG,2BAA2B,CAgF5D;AAMD,UAAU,kBAAkB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,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;IAC5C,YAAY,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,gBAAgB,EAAE,CAAC,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACrE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,eAAe,EACf,KAAK,EACL,UAAkB,EAClB,MAAM,EACN,SAAiB,EACjB,MAAM,EACN,OAAO,EACP,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,GACV,EAAE,kBAAkB,GAAG,iBAAiB,CAqOxC"}
@@ -6,8 +6,12 @@
6
6
  * @file hooks.ts
7
7
  * @input Uses untransformed DOM layout geometry from the Selector's outer
8
8
  * anchor, listbox, and selected option
9
- * @output Hooks for Selector
10
- * @position Internal hooks; used by Selector.tsx
9
+ * @output Hooks for Selector: useSelectedItemOffset, and useCombobox (public,
10
+ * exported from the Selector entry point; also used by CommandPalette)
11
+ * @position Selector hooks; used by Selector.tsx and CommandPalette
12
+ *
13
+ * SYNC: When useCombobox's options or return change, update:
14
+ * - /packages/core/src/Selector/useCombobox.doc.mjs
11
15
  */
12
16
  import { useCallback, useState } from 'react';
13
17
  import { useHighlightedOptionScroll } from "../hooks/useHighlightedOptionScroll.js";
@@ -159,7 +159,7 @@ export interface SwitchProps extends Omit<BaseProps, 'onChange'> {
159
159
  * />
160
160
  * ```
161
161
  */
162
- export declare function Switch({ label, isLabelHidden, description, onChange, changeAction, isLoading, value, isDisabled, htmlName, disabledMessage, isOptional, isRequired, onFocus, onBlur, labelIcon, labelTooltip, labelPosition, labelSpacing, status, size, width, xstyle, className, style, ref, 'aria-describedby': ariaDescribedByProp, ...rest }: SwitchProps): import("react").JSX.Element;
162
+ export declare function Switch({ label, isLabelHidden, description, onChange, changeAction, isLoading, value, isDisabled, htmlName, disabledMessage, isOptional, isRequired, onFocus, onBlur, labelIcon, labelTooltip, labelPosition, labelSpacing, status, size, width, xstyle, className, style, ref, 'aria-describedby': ariaDescribedByProp, 'aria-labelledby': ariaLabelledByProp, ...rest }: SwitchProps): import("react").JSX.Element;
163
163
  export declare namespace Switch {
164
164
  var displayName: string;
165
165
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../src/Switch/Switch.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAcf,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAMhD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAkV9C,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,KAAK,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAElD,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC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ACZ,SAAiB,EACjB,KAAK,EACL,UAAkB,EAClB,QAAQ,EACR,eAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,OAAO,EACP,MAAM,EACN,SAAS,EACT,YAAY,EACZ,aAAqB,EACrB,YAAoB,EACpB,MAAM,EACN,IAAW,EACX,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,kBAAkB,EAAE,mBAAmB,EACvC,iBAAiB,EAAE,kBAAkB,EACrC,GAAG,IAAI,EACR,EAAE,WAAW,+BAiOb;yBA9Pe,MAAM"}
@@ -292,6 +292,7 @@ export function Switch({
292
292
  style,
293
293
  ref,
294
294
  'aria-describedby': ariaDescribedByProp,
295
+ 'aria-labelledby': ariaLabelledByProp,
295
296
  ...rest
296
297
  }) {
297
298
  const t = useTranslator();
@@ -388,7 +389,12 @@ export function Switch({
388
389
  }
389
390
  },
390
391
  onFocus: onFocus,
391
- onBlur: onBlur,
392
+ onBlur: onBlur
393
+ // A caller's `aria-labelledby` names the control (a visible title
394
+ // elsewhere in the row, for example), so it reaches the input rather
395
+ // than the field wrapper via `...rest`.
396
+ ,
397
+ "aria-labelledby": ariaLabelledByProp,
392
398
  "aria-describedby": ariaDescribedBy,
393
399
  "aria-invalid": status?.type === 'error' ? true : undefined,
394
400
  "aria-busy": isBusy || undefined,
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @file useTruncation.ts
3
- * @input Uses React hooks, sharedResizeObserver
3
+ * @input Uses React hooks, sharedResizeObserver, sharedMutationObserver
4
4
  * @output Exports useTruncation hook for detecting text overflow
5
5
  * @position Hook; consumed by Text.tsx, Heading.tsx
6
6
  *
@@ -32,10 +32,12 @@ export interface UseTruncationReturn {
32
32
  /**
33
33
  * Hook for detecting text overflow/truncation.
34
34
  *
35
- * Uses a shared ResizeObserver singleton (via observeResize)
36
- * for efficient detection when content or container changes. A single
37
- * ResizeObserver instance is shared across all mounted useTruncation hooks,
38
- * so even hundreds of table cells only create one observer.
35
+ * Uses a shared ResizeObserver singleton (via observeResize) for size
36
+ * changes and a shared MutationObserver singleton (via observeContent) for
37
+ * content changes, so even hundreds of table cells create one observer of
38
+ * each kind. Observing content matters because an element whose text changes
39
+ * without resizing (a fixed-width status line) must still be re-measured for
40
+ * the tooltip text and the truncated state to follow the current content.
39
41
  *
40
42
  * - Single-line: compares scrollWidth > offsetWidth
41
43
  * - Multi-line: uses Range.getBoundingClientRect() to measure actual content
@@ -1 +1 @@
1
- {"version":3,"file":"useTruncation.d.ts","sourceRoot":"","sources":["../../src/Text/useTruncation.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAAgC,KAAK,WAAW,EAAC,MAAM,OAAO,CAAC;AAGtE,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAE9B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,oBAAoB,GAC5B,mBAAmB,CA2ErB"}
1
+ {"version":3,"file":"useTruncation.d.ts","sourceRoot":"","sources":["../../src/Text/useTruncation.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAAgC,KAAK,WAAW,EAAC,MAAM,OAAO,CAAC;AAItE,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAE9B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,oBAAoB,GAC5B,mBAAmB,CAmFrB"}
@@ -4,7 +4,7 @@
4
4
 
5
5
  /**
6
6
  * @file useTruncation.ts
7
- * @input Uses React hooks, sharedResizeObserver
7
+ * @input Uses React hooks, sharedResizeObserver, sharedMutationObserver
8
8
  * @output Exports useTruncation hook for detecting text overflow
9
9
  * @position Hook; consumed by Text.tsx, Heading.tsx
10
10
  *
@@ -13,13 +13,16 @@
13
13
  */
14
14
  import { useCallback, useRef, useState } from 'react';
15
15
  import { observeResize } from "../utils/sharedResizeObserver.js";
16
+ import { observeContent } from "../utils/sharedMutationObserver.js";
16
17
  /**
17
18
  * Hook for detecting text overflow/truncation.
18
19
  *
19
- * Uses a shared ResizeObserver singleton (via observeResize)
20
- * for efficient detection when content or container changes. A single
21
- * ResizeObserver instance is shared across all mounted useTruncation hooks,
22
- * so even hundreds of table cells only create one observer.
20
+ * Uses a shared ResizeObserver singleton (via observeResize) for size
21
+ * changes and a shared MutationObserver singleton (via observeContent) for
22
+ * content changes, so even hundreds of table cells create one observer of
23
+ * each kind. Observing content matters because an element whose text changes
24
+ * without resizing (a fixed-width status line) must still be re-measured for
25
+ * the tooltip text and the truncated state to follow the current content.
23
26
  *
24
27
  * - Single-line: compares scrollWidth > offsetWidth
25
28
  * - Multi-line: uses Range.getBoundingClientRect() to measure actual content
@@ -44,6 +47,7 @@ export function useTruncation(options) {
44
47
  const [fullText, setFullText] = useState('');
45
48
  const elementRef = useRef(null);
46
49
  const unobserveRef = useRef(null);
50
+ const unobserveContentRef = useRef(null);
47
51
  const checkTruncation = useCallback(element => {
48
52
  if (maxLines === 0) {
49
53
  setIsTruncated(false);
@@ -80,6 +84,8 @@ export function useTruncation(options) {
80
84
  // by element leaves any other observer of the same node untouched.
81
85
  unobserveRef.current?.();
82
86
  unobserveRef.current = null;
87
+ unobserveContentRef.current?.();
88
+ unobserveContentRef.current = null;
83
89
  elementRef.current = element;
84
90
  if (element && maxLines > 0) {
85
91
  // Observe via shared singleton (if available).
@@ -92,6 +98,11 @@ export function useTruncation(options) {
92
98
  } else {
93
99
  checkTruncation(element);
94
100
  }
101
+ // New text in a box that keeps its size fires no resize, so the
102
+ // captured text and truncated state would otherwise stay stale.
103
+ unobserveContentRef.current = observeContent(element, () => {
104
+ checkTruncation(element);
105
+ });
95
106
  } else {
96
107
  setIsTruncated(false);
97
108
  setFullText('');
@@ -1 +1 @@
1
- {"version":3,"file":"en.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/en.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0dpD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"en.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/en.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAsfpD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -436,6 +436,34 @@ const runtimeCatalog = {
436
436
  '@astryx.transferList.announceSearchResults': '{count, number} {count, plural, one {item} other {items}} found.',
437
437
  '@astryx.transferListSelector.apply': 'Apply',
438
438
  '@astryx.transferListSelector.cancel': 'Cancel',
439
- '@astryx.transferListSelector.triggerLabel': '{count, number} selected'
439
+ '@astryx.transferListSelector.triggerLabel': '{count, number} selected',
440
+ '@astryx.emojiPicker.label': 'Emoji',
441
+ '@astryx.emojiPicker.searchLabel': 'Search emoji',
442
+ '@astryx.emojiPicker.frequentlyUsed': 'Frequently used',
443
+ '@astryx.emojiPicker.searchResults': 'Search results',
444
+ '@astryx.emojiPicker.noResults': 'No emoji match “{query}”',
445
+ '@astryx.emojiPicker.loading': 'Loading emoji',
446
+ '@astryx.emojiPicker.loadFailed': "More emoji couldn't be loaded.",
447
+ '@astryx.emojiPicker.groupSmileysEmotion': 'Smileys & emotion',
448
+ '@astryx.emojiPicker.groupPeopleBody': 'People & body',
449
+ '@astryx.emojiPicker.groupAnimalsNature': 'Animals & nature',
450
+ '@astryx.emojiPicker.groupFoodDrink': 'Food & drink',
451
+ '@astryx.emojiPicker.groupTravelPlaces': 'Travel & places',
452
+ '@astryx.emojiPicker.groupActivities': 'Activities',
453
+ '@astryx.emojiPicker.groupObjects': 'Objects',
454
+ '@astryx.emojiPicker.groupSymbols': 'Symbols',
455
+ '@astryx.emojiPicker.groupFlags': 'Flags',
456
+ '@astryx.comments.retry': 'Retry',
457
+ '@astryx.commentComposer.placeholder': 'Write a comment…',
458
+ '@astryx.commentComposer.noAgents': 'No agents',
459
+ '@astryx.commentComposer.agents': 'Agents',
460
+ '@astryx.commentComposer.uploadFailed': "Images couldn't be added",
461
+ '@astryx.commentComposer.imagesOnly': 'Only image files can be added',
462
+ '@astryx.commentComposer.chooseImages': 'Choose images',
463
+ '@astryx.commentComposer.imageAlt': 'Image attachment',
464
+ '@astryx.commentComposer.removeQuote': 'Remove quoted text',
465
+ '@astryx.commentComposer.attachImages': 'Attach images',
466
+ '@astryx.commentComposer.addEmoji': 'Add emoji',
467
+ '@astryx.commentComposer.cancel': 'Cancel'
440
468
  };
441
469
  export default runtimeCatalog;
@@ -1 +1 @@
1
- {"version":3,"file":"pseudo.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/pseudo.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmepD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"pseudo.generated.d.ts","sourceRoot":"","sources":["../../../src/i18n/generated-locales/pseudo.generated.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,QAAA,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA+fpD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -436,6 +436,34 @@ const runtimeCatalog = {
436
436
  '@astryx.transferList.announceSearchResults': '⟦{count, number} {count, plural, one {item} other {items}} ƒóúñð.⟧',
437
437
  '@astryx.transferListSelector.apply': '⟦Àþþłý⟧',
438
438
  '@astryx.transferListSelector.cancel': '⟦Çàñçéł⟧',
439
- '@astryx.transferListSelector.triggerLabel': '⟦{count, number} šéłéçţéð⟧'
439
+ '@astryx.transferListSelector.triggerLabel': '⟦{count, number} šéłéçţéð⟧',
440
+ '@astryx.emojiPicker.label': '⟦Éɱóĵí⟧',
441
+ '@astryx.emojiPicker.searchLabel': '⟦Šéàřçĥ éɱóĵí⟧',
442
+ '@astryx.emojiPicker.frequentlyUsed': '⟦Ƒřéɋúéñţłý úšéð⟧',
443
+ '@astryx.emojiPicker.searchResults': '⟦Šéàřçĥ řéšúłţš⟧',
444
+ '@astryx.emojiPicker.noResults': '⟦Ñó éɱóĵí ɱàţçĥ “{query}”⟧',
445
+ '@astryx.emojiPicker.loading': '⟦Łóàðíñĝ éɱóĵí⟧',
446
+ '@astryx.emojiPicker.loadFailed': "⟦Ṁóřé éɱóĵí çóúłðñ'ţ ƀé łóàðéð.⟧",
447
+ '@astryx.emojiPicker.groupSmileysEmotion': '⟦Šɱíłéýš & éɱóţíóñ⟧',
448
+ '@astryx.emojiPicker.groupPeopleBody': '⟦Þéóþłé & ƀóðý⟧',
449
+ '@astryx.emojiPicker.groupAnimalsNature': '⟦Àñíɱàłš & ñàţúřé⟧',
450
+ '@astryx.emojiPicker.groupFoodDrink': '⟦Ƒóóð & ðříñķ⟧',
451
+ '@astryx.emojiPicker.groupTravelPlaces': '⟦Ţřàṽéł & þłàçéš⟧',
452
+ '@astryx.emojiPicker.groupActivities': '⟦Àçţíṽíţíéš⟧',
453
+ '@astryx.emojiPicker.groupObjects': '⟦Óƀĵéçţš⟧',
454
+ '@astryx.emojiPicker.groupSymbols': '⟦Šýɱƀółš⟧',
455
+ '@astryx.emojiPicker.groupFlags': '⟦Ƒłàĝš⟧',
456
+ '@astryx.comments.retry': '⟦Řéţřý⟧',
457
+ '@astryx.commentComposer.placeholder': '⟦Ŵříţé à çóɱɱéñţ…⟧',
458
+ '@astryx.commentComposer.noAgents': '⟦Ñó àĝéñţš⟧',
459
+ '@astryx.commentComposer.agents': '⟦Àĝéñţš⟧',
460
+ '@astryx.commentComposer.uploadFailed': "⟦Íɱàĝéš çóúłðñ'ţ ƀé àððéð⟧",
461
+ '@astryx.commentComposer.imagesOnly': '⟦Óñłý íɱàĝé ƒíłéš çàñ ƀé àððéð⟧',
462
+ '@astryx.commentComposer.chooseImages': '⟦Çĥóóšé íɱàĝéš⟧',
463
+ '@astryx.commentComposer.imageAlt': '⟦Íɱàĝé àţţàçĥɱéñţ⟧',
464
+ '@astryx.commentComposer.removeQuote': '⟦Řéɱóṽé ɋúóţéð ţéẋţ⟧',
465
+ '@astryx.commentComposer.attachImages': '⟦Àţţàçĥ íɱàĝéš⟧',
466
+ '@astryx.commentComposer.addEmoji': '⟦Àðð éɱóĵí⟧',
467
+ '@astryx.commentComposer.cancel': '⟦Çàñçéł⟧'
440
468
  };
441
469
  export default runtimeCatalog;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @file sharedMutationObserver.ts
3
+ * @input MutationObserver API
4
+ * @output Exports observeContent for shared content-change observation
5
+ * @position Internal utility; consumed by useTruncation. The content-change
6
+ * counterpart of sharedResizeObserver: one observer for every element, so a
7
+ * repeated cell or row path does not create one observer per instance.
8
+ */
9
+ type ContentCallback = () => void;
10
+ /**
11
+ * Call `callback` when the element's text or children change (including
12
+ * descendants). Returns an unsubscribe that removes only this registration.
13
+ *
14
+ * MutationObserver has no per-target unobserve, so a released element stays
15
+ * registered with the shared observer until no element remains; its records
16
+ * match no callback and are ignored. The observer disconnects and is released
17
+ * when the last registration goes.
18
+ */
19
+ export declare function observeContent(element: Element, callback: ContentCallback): () => void;
20
+ export {};
21
+ //# sourceMappingURL=sharedMutationObserver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedMutationObserver.d.ts","sourceRoot":"","sources":["../../src/utils/sharedMutationObserver.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,KAAK,eAAe,GAAG,MAAM,IAAI,CAAC;AAuBlC;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,eAAe,GACxB,MAAM,IAAI,CA6BZ"}
@@ -0,0 +1,69 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ /**
6
+ * @file sharedMutationObserver.ts
7
+ * @input MutationObserver API
8
+ * @output Exports observeContent for shared content-change observation
9
+ * @position Internal utility; consumed by useTruncation. The content-change
10
+ * counterpart of sharedResizeObserver: one observer for every element, so a
11
+ * repeated cell or row path does not create one observer per instance.
12
+ */
13
+ const OPTIONS = {
14
+ characterData: true,
15
+ childList: true,
16
+ subtree: true
17
+ };
18
+ let observer = null;
19
+ const callbacks = new Map();
20
+ function dispatch(records) {
21
+ // One call per callback per batch, however many records it received. A
22
+ // record's target can be any descendant, so walk up to the observed roots.
23
+ const pending = new Set();
24
+ for (const record of records) {
25
+ for (let node = record.target; node; node = node.parentNode) {
26
+ callbacks.get(node)?.forEach(callback => pending.add(callback));
27
+ }
28
+ }
29
+ pending.forEach(callback => callback());
30
+ }
31
+
32
+ /**
33
+ * Call `callback` when the element's text or children change (including
34
+ * descendants). Returns an unsubscribe that removes only this registration.
35
+ *
36
+ * MutationObserver has no per-target unobserve, so a released element stays
37
+ * registered with the shared observer until no element remains; its records
38
+ * match no callback and are ignored. The observer disconnects and is released
39
+ * when the last registration goes.
40
+ */
41
+ export function observeContent(element, callback) {
42
+ if (typeof MutationObserver === 'undefined') {
43
+ return () => {};
44
+ }
45
+ observer ??= new MutationObserver(dispatch);
46
+ const existing = callbacks.get(element);
47
+ if (existing) {
48
+ existing.add(callback);
49
+ } else {
50
+ callbacks.set(element, new Set([callback]));
51
+ observer.observe(element, OPTIONS);
52
+ }
53
+ let isSubscribed = true;
54
+ return () => {
55
+ if (!isSubscribed) {
56
+ return;
57
+ }
58
+ isSubscribed = false;
59
+ const targetCallbacks = callbacks.get(element);
60
+ targetCallbacks?.delete(callback);
61
+ if (targetCallbacks?.size === 0) {
62
+ callbacks.delete(element);
63
+ }
64
+ if (callbacks.size === 0 && observer) {
65
+ observer.disconnect();
66
+ observer = null;
67
+ }
68
+ };
69
+ }
package/locales/en.json CHANGED
@@ -1718,5 +1718,117 @@
1718
1718
  "@astryx.transferListSelector.triggerLabel": {
1719
1719
  "defaultMessage": "{count, number} selected",
1720
1720
  "description": "Default summary on the closed trigger of a lab TransferListSelector, stating how many options are currently chosen. Consumers usually override this with a domain phrase (e.g. \"7 columns\")."
1721
+ },
1722
+ "@astryx.emojiPicker.label": {
1723
+ "defaultMessage": "Emoji",
1724
+ "description": "Default accessible name of the scrolling list of emoji in a lab EmojiPicker, and the footer text when no emoji is hovered or focused."
1725
+ },
1726
+ "@astryx.emojiPicker.searchLabel": {
1727
+ "defaultMessage": "Search emoji",
1728
+ "description": "Default placeholder and hidden label of the search field of a lab EmojiPicker."
1729
+ },
1730
+ "@astryx.emojiPicker.frequentlyUsed": {
1731
+ "defaultMessage": "Frequently used",
1732
+ "description": "Heading of the first group in a lab EmojiPicker, the host's frequent or recent emoji."
1733
+ },
1734
+ "@astryx.emojiPicker.searchResults": {
1735
+ "defaultMessage": "Search results",
1736
+ "description": "Heading of the single group a lab EmojiPicker shows while its search field has text."
1737
+ },
1738
+ "@astryx.emojiPicker.noResults": {
1739
+ "defaultMessage": "No emoji match “{query}”",
1740
+ "description": "Shown in a lab EmojiPicker when no emoji name or keyword matches the search. `query` is the search text."
1741
+ },
1742
+ "@astryx.emojiPicker.loading": {
1743
+ "defaultMessage": "Loading emoji",
1744
+ "description": "Accessible name of the spinner a lab EmojiPicker shows while its bundled emoji set loads."
1745
+ },
1746
+ "@astryx.emojiPicker.loadFailed": {
1747
+ "defaultMessage": "More emoji couldn't be loaded.",
1748
+ "description": "Shown in a lab EmojiPicker when its bundled emoji set failed to load; the frequent emoji still show."
1749
+ },
1750
+ "@astryx.emojiPicker.groupSmileysEmotion": {
1751
+ "defaultMessage": "Smileys & emotion",
1752
+ "description": "Heading of the Unicode CLDR emoji group of faces and emotions in a lab EmojiPicker."
1753
+ },
1754
+ "@astryx.emojiPicker.groupPeopleBody": {
1755
+ "defaultMessage": "People & body",
1756
+ "description": "Heading of the Unicode CLDR emoji group of people, gestures, and body parts in a lab EmojiPicker."
1757
+ },
1758
+ "@astryx.emojiPicker.groupAnimalsNature": {
1759
+ "defaultMessage": "Animals & nature",
1760
+ "description": "Heading of the Unicode CLDR emoji group of animals and plants in a lab EmojiPicker."
1761
+ },
1762
+ "@astryx.emojiPicker.groupFoodDrink": {
1763
+ "defaultMessage": "Food & drink",
1764
+ "description": "Heading of the Unicode CLDR emoji group of food and drink in a lab EmojiPicker."
1765
+ },
1766
+ "@astryx.emojiPicker.groupTravelPlaces": {
1767
+ "defaultMessage": "Travel & places",
1768
+ "description": "Heading of the Unicode CLDR emoji group of places, vehicles, and weather in a lab EmojiPicker."
1769
+ },
1770
+ "@astryx.emojiPicker.groupActivities": {
1771
+ "defaultMessage": "Activities",
1772
+ "description": "Heading of the Unicode CLDR emoji group of sports, games, and events in a lab EmojiPicker."
1773
+ },
1774
+ "@astryx.emojiPicker.groupObjects": {
1775
+ "defaultMessage": "Objects",
1776
+ "description": "Heading of the Unicode CLDR emoji group of everyday objects in a lab EmojiPicker."
1777
+ },
1778
+ "@astryx.emojiPicker.groupSymbols": {
1779
+ "defaultMessage": "Symbols",
1780
+ "description": "Heading of the Unicode CLDR emoji group of signs and symbols in a lab EmojiPicker."
1781
+ },
1782
+ "@astryx.emojiPicker.groupFlags": {
1783
+ "defaultMessage": "Flags",
1784
+ "description": "Heading of the Unicode CLDR emoji group of flags in a lab EmojiPicker."
1785
+ },
1786
+ "@astryx.comments.retry": {
1787
+ "defaultMessage": "Retry",
1788
+ "description": "Action on an error Banner in a lab Comments panel or comment composer that repeats the action that failed."
1789
+ },
1790
+ "@astryx.commentComposer.placeholder": {
1791
+ "defaultMessage": "Write a comment…",
1792
+ "description": "Default placeholder of a lab CommentComposer, the input for a new comment in a discussion."
1793
+ },
1794
+ "@astryx.commentComposer.noAgents": {
1795
+ "defaultMessage": "No agents",
1796
+ "description": "Shown in a lab CommentComposer's slash-command menu when no AI agent matches what was typed after `/`."
1797
+ },
1798
+ "@astryx.commentComposer.agents": {
1799
+ "defaultMessage": "Agents",
1800
+ "description": "Accessible name of a lab CommentComposer's slash-command menu, which lists the AI agents a comment can address."
1801
+ },
1802
+ "@astryx.commentComposer.uploadFailed": {
1803
+ "defaultMessage": "Images couldn't be added",
1804
+ "description": "Error Banner title in a lab CommentComposer when uploading attached images failed; a Retry action follows."
1805
+ },
1806
+ "@astryx.commentComposer.imagesOnly": {
1807
+ "defaultMessage": "Only image files can be added",
1808
+ "description": "Error Banner title in a lab CommentComposer when a non-image file was attached, pasted, or dropped."
1809
+ },
1810
+ "@astryx.commentComposer.chooseImages": {
1811
+ "defaultMessage": "Choose images",
1812
+ "description": "Action on a lab CommentComposer's error Banner that opens the file chooser for images."
1813
+ },
1814
+ "@astryx.commentComposer.imageAlt": {
1815
+ "defaultMessage": "Image attachment",
1816
+ "description": "Alt text a lab CommentComposer writes into the comment for an uploaded image that came with none."
1817
+ },
1818
+ "@astryx.commentComposer.removeQuote": {
1819
+ "defaultMessage": "Remove quoted text",
1820
+ "description": "Button beside the quoted passage in a lab CommentComposer that drops the quote from the new inline comment."
1821
+ },
1822
+ "@astryx.commentComposer.attachImages": {
1823
+ "defaultMessage": "Attach images",
1824
+ "description": "Button in a lab CommentComposer that opens the file chooser to add images to the comment."
1825
+ },
1826
+ "@astryx.commentComposer.addEmoji": {
1827
+ "defaultMessage": "Add emoji",
1828
+ "description": "Button in a lab CommentComposer that opens the emoji picker, and the accessible name of that picker's popover."
1829
+ },
1830
+ "@astryx.commentComposer.cancel": {
1831
+ "defaultMessage": "Cancel",
1832
+ "description": "Text button beside the label of a lab CommentComposer that is editing an existing comment; it discards the edit."
1721
1833
  }
1722
1834
  }
@@ -1288,5 +1288,89 @@
1288
1288
  },
1289
1289
  "@astryx.transferListSelector.triggerLabel": {
1290
1290
  "defaultMessage": "⟦{count, number} šéłéçţéð⟧"
1291
+ },
1292
+ "@astryx.emojiPicker.label": {
1293
+ "defaultMessage": "⟦Éɱóĵí⟧"
1294
+ },
1295
+ "@astryx.emojiPicker.searchLabel": {
1296
+ "defaultMessage": "⟦Šéàřçĥ éɱóĵí⟧"
1297
+ },
1298
+ "@astryx.emojiPicker.frequentlyUsed": {
1299
+ "defaultMessage": "⟦Ƒřéɋúéñţłý úšéð⟧"
1300
+ },
1301
+ "@astryx.emojiPicker.searchResults": {
1302
+ "defaultMessage": "⟦Šéàřçĥ řéšúłţš⟧"
1303
+ },
1304
+ "@astryx.emojiPicker.noResults": {
1305
+ "defaultMessage": "⟦Ñó éɱóĵí ɱàţçĥ “{query}”⟧"
1306
+ },
1307
+ "@astryx.emojiPicker.loading": {
1308
+ "defaultMessage": "⟦Łóàðíñĝ éɱóĵí⟧"
1309
+ },
1310
+ "@astryx.emojiPicker.loadFailed": {
1311
+ "defaultMessage": "⟦Ṁóřé éɱóĵí çóúłðñ'ţ ƀé łóàðéð.⟧"
1312
+ },
1313
+ "@astryx.emojiPicker.groupSmileysEmotion": {
1314
+ "defaultMessage": "⟦Šɱíłéýš & éɱóţíóñ⟧"
1315
+ },
1316
+ "@astryx.emojiPicker.groupPeopleBody": {
1317
+ "defaultMessage": "⟦Þéóþłé & ƀóðý⟧"
1318
+ },
1319
+ "@astryx.emojiPicker.groupAnimalsNature": {
1320
+ "defaultMessage": "⟦Àñíɱàłš & ñàţúřé⟧"
1321
+ },
1322
+ "@astryx.emojiPicker.groupFoodDrink": {
1323
+ "defaultMessage": "⟦Ƒóóð & ðříñķ⟧"
1324
+ },
1325
+ "@astryx.emojiPicker.groupTravelPlaces": {
1326
+ "defaultMessage": "⟦Ţřàṽéł & þłàçéš⟧"
1327
+ },
1328
+ "@astryx.emojiPicker.groupActivities": {
1329
+ "defaultMessage": "⟦Àçţíṽíţíéš⟧"
1330
+ },
1331
+ "@astryx.emojiPicker.groupObjects": {
1332
+ "defaultMessage": "⟦Óƀĵéçţš⟧"
1333
+ },
1334
+ "@astryx.emojiPicker.groupSymbols": {
1335
+ "defaultMessage": "⟦Šýɱƀółš⟧"
1336
+ },
1337
+ "@astryx.emojiPicker.groupFlags": {
1338
+ "defaultMessage": "⟦Ƒłàĝš⟧"
1339
+ },
1340
+ "@astryx.comments.retry": {
1341
+ "defaultMessage": "⟦Řéţřý⟧"
1342
+ },
1343
+ "@astryx.commentComposer.placeholder": {
1344
+ "defaultMessage": "⟦Ŵříţé à çóɱɱéñţ…⟧"
1345
+ },
1346
+ "@astryx.commentComposer.noAgents": {
1347
+ "defaultMessage": "⟦Ñó àĝéñţš⟧"
1348
+ },
1349
+ "@astryx.commentComposer.agents": {
1350
+ "defaultMessage": "⟦Àĝéñţš⟧"
1351
+ },
1352
+ "@astryx.commentComposer.uploadFailed": {
1353
+ "defaultMessage": "⟦Íɱàĝéš çóúłðñ'ţ ƀé àððéð⟧"
1354
+ },
1355
+ "@astryx.commentComposer.imagesOnly": {
1356
+ "defaultMessage": "⟦Óñłý íɱàĝé ƒíłéš çàñ ƀé àððéð⟧"
1357
+ },
1358
+ "@astryx.commentComposer.chooseImages": {
1359
+ "defaultMessage": "⟦Çĥóóšé íɱàĝéš⟧"
1360
+ },
1361
+ "@astryx.commentComposer.imageAlt": {
1362
+ "defaultMessage": "⟦Íɱàĝé àţţàçĥɱéñţ⟧"
1363
+ },
1364
+ "@astryx.commentComposer.removeQuote": {
1365
+ "defaultMessage": "⟦Řéɱóṽé ɋúóţéð ţéẋţ⟧"
1366
+ },
1367
+ "@astryx.commentComposer.attachImages": {
1368
+ "defaultMessage": "⟦Àţţàçĥ íɱàĝéš⟧"
1369
+ },
1370
+ "@astryx.commentComposer.addEmoji": {
1371
+ "defaultMessage": "⟦Àðð éɱóĵí⟧"
1372
+ },
1373
+ "@astryx.commentComposer.cancel": {
1374
+ "defaultMessage": "⟦Çàñçéł⟧"
1291
1375
  }
1292
1376
  }