@dxos/react-ui-attention 0.8.4-main.84f28bd → 0.8.4-main.a4bbb77

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 (37) hide show
  1. package/dist/lib/browser/{chunk-QPEFFJ4E.mjs → chunk-IEH7T3ZP.mjs} +94 -36
  2. package/dist/lib/browser/chunk-IEH7T3ZP.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +3 -1
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/browser/testing/index.mjs +2 -4
  6. package/dist/lib/browser/testing/index.mjs.map +3 -3
  7. package/dist/lib/node-esm/{chunk-F2JRKDYV.mjs → chunk-NFTXIHW4.mjs} +94 -36
  8. package/dist/lib/node-esm/chunk-NFTXIHW4.mjs.map +7 -0
  9. package/dist/lib/node-esm/index.mjs +3 -1
  10. package/dist/lib/node-esm/meta.json +1 -1
  11. package/dist/lib/node-esm/testing/index.mjs +2 -4
  12. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  13. package/dist/types/src/attention.d.ts.map +1 -1
  14. package/dist/types/src/components/AttentionGlyph.d.ts.map +1 -1
  15. package/dist/types/src/components/AttentionGlyph.stories.d.ts +9 -20
  16. package/dist/types/src/components/AttentionGlyph.stories.d.ts.map +1 -1
  17. package/dist/types/src/components/AttentionProvider.d.ts +2 -2
  18. package/dist/types/src/components/AttentionProvider.d.ts.map +1 -1
  19. package/dist/types/src/components/AttentionProvider.stories.d.ts +6 -4
  20. package/dist/types/src/components/AttentionProvider.stories.d.ts.map +1 -1
  21. package/dist/types/src/components/SelectionProvider.d.ts +1 -1
  22. package/dist/types/src/components/SelectionProvider.d.ts.map +1 -1
  23. package/dist/types/src/selection.d.ts +26 -14
  24. package/dist/types/src/selection.d.ts.map +1 -1
  25. package/dist/types/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +23 -21
  27. package/src/attention.test.ts +1 -1
  28. package/src/attention.ts +1 -1
  29. package/src/components/AttentionGlyph.stories.tsx +15 -12
  30. package/src/components/AttentionGlyph.tsx +1 -1
  31. package/src/components/AttentionProvider.stories.tsx +11 -7
  32. package/src/components/AttentionProvider.tsx +4 -4
  33. package/src/components/SelectionProvider.tsx +4 -4
  34. package/src/selection.ts +45 -16
  35. package/src/testing/decorators/withAttention.ts +1 -1
  36. package/dist/lib/browser/chunk-QPEFFJ4E.mjs.map +0 -7
  37. package/dist/lib/node-esm/chunk-F2JRKDYV.mjs.map +0 -7
@@ -5,6 +5,19 @@ import { untracked } from "@preact/signals-core";
5
5
  import { Schema } from "effect";
6
6
  import { live } from "@dxos/live-object";
7
7
  import { ComplexMap } from "@dxos/util";
8
+ function _define_property(obj, key, value) {
9
+ if (key in obj) {
10
+ Object.defineProperty(obj, key, {
11
+ value,
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true
15
+ });
16
+ } else {
17
+ obj[key] = value;
18
+ }
19
+ return obj;
20
+ }
8
21
  var ATTENDABLE_PATH_SEPARATOR = "~";
9
22
  var AttentionSchema = Schema.mutable(Schema.Struct({
10
23
  hasAttention: Schema.Boolean,
@@ -13,17 +26,6 @@ var AttentionSchema = Schema.mutable(Schema.Struct({
13
26
  }));
14
27
  var stringKey = (key) => key.join(",");
15
28
  var AttentionManager = class {
16
- constructor(initial = []) {
17
- // Each attention path is associated with an attention object.
18
- // The lookup is not a reactive object to ensure that attention for each path is subscribable independently.
19
- this._map = new ComplexMap(stringKey);
20
- this._state = live({
21
- current: []
22
- });
23
- if (initial.length > 0) {
24
- this.update(initial);
25
- }
26
- }
27
29
  /**
28
30
  * Currently attended element.
29
31
  *
@@ -91,6 +93,15 @@ var AttentionManager = class {
91
93
  object.isAncestor = attention.isAncestor ?? false;
92
94
  object.isRelated = attention.isRelated ?? false;
93
95
  }
96
+ constructor(initial = []) {
97
+ _define_property(this, "_map", new ComplexMap(stringKey));
98
+ _define_property(this, "_state", live({
99
+ current: []
100
+ }));
101
+ if (initial.length > 0) {
102
+ this.update(initial);
103
+ }
104
+ }
94
105
  };
95
106
  var getAttendables = (selector, cursor, acc = []) => {
96
107
  const closestAttendable = cursor.closest(selector);
@@ -208,7 +219,7 @@ import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking"
208
219
  import { createContext } from "@radix-ui/react-context";
209
220
  import { Primitive } from "@radix-ui/react-primitive";
210
221
  import { Slot } from "@radix-ui/react-slot";
211
- import React2, { useMemo as useMemo2, forwardRef as forwardRef2 } from "react";
222
+ import React2, { forwardRef as forwardRef2, useMemo as useMemo2 } from "react";
212
223
  import { useDefaultValue } from "@dxos/react-ui";
213
224
  import { mx as mx2 } from "@dxos/react-ui-theme";
214
225
  var ATTENTION_NAME = "Attention";
@@ -323,11 +334,41 @@ var AttendableContainer = /* @__PURE__ */ forwardRef2(({ id, classNames, childre
323
334
 
324
335
  // src/selection.ts
325
336
  import { untracked as untracked2 } from "@preact/signals-core";
326
- import { Match } from "effect";
337
+ import { Match, Schema as Schema2 } from "effect";
327
338
  import { invariant } from "@dxos/invariant";
328
339
  import { live as live2 } from "@dxos/live-object";
340
+ function _define_property2(obj, key, value) {
341
+ if (key in obj) {
342
+ Object.defineProperty(obj, key, {
343
+ value,
344
+ enumerable: true,
345
+ configurable: true,
346
+ writable: true
347
+ });
348
+ } else {
349
+ obj[key] = value;
350
+ }
351
+ return obj;
352
+ }
329
353
  var __dxlog_file = "/__w/dxos/dxos/packages/ui/react-ui-attention/src/selection.ts";
330
- var defaultSelection = Match.type().pipe(Match.when("single", () => ({
354
+ var SelectionSchema = Schema2.Union(Schema2.Struct({
355
+ mode: Schema2.Literal("single"),
356
+ id: Schema2.optional(Schema2.String)
357
+ }).pipe(Schema2.mutable), Schema2.Struct({
358
+ mode: Schema2.Literal("multi"),
359
+ ids: Schema2.Array(Schema2.String).pipe(Schema2.mutable)
360
+ }).pipe(Schema2.mutable), Schema2.Struct({
361
+ mode: Schema2.Literal("range"),
362
+ from: Schema2.optional(Schema2.String),
363
+ to: Schema2.optional(Schema2.String)
364
+ }).pipe(Schema2.mutable), Schema2.Struct({
365
+ mode: Schema2.Literal("multi-range"),
366
+ ranges: Schema2.Array(Schema2.Struct({
367
+ from: Schema2.String,
368
+ to: Schema2.String
369
+ })).pipe(Schema2.mutable)
370
+ }).pipe(Schema2.mutable)).pipe(Schema2.mutable);
371
+ var defaultSelection = Match.type().pipe(Match.withReturnType(), Match.when("single", () => ({
331
372
  mode: "single"
332
373
  })), Match.when("multi", () => ({
333
374
  mode: "multi",
@@ -353,16 +394,6 @@ var getSelectionSet = (selectionManager, contextId) => {
353
394
  return ids;
354
395
  };
355
396
  var SelectionManager = class {
356
- constructor(initial = {}) {
357
- this._state = live2({
358
- selections: {}
359
- });
360
- if (Object.keys(initial).length > 0) {
361
- untracked2(() => {
362
- this._state.selections = initial;
363
- });
364
- }
365
- }
366
397
  getSelectionContexts() {
367
398
  return Object.keys(this._state.selections);
368
399
  }
@@ -381,7 +412,7 @@ var SelectionManager = class {
381
412
  const selection = this.getSelection(contextId, mode);
382
413
  invariant(selection?.mode === mode, "Selection mode mismatch", {
383
414
  F: __dxlog_file,
384
- L: 91,
415
+ L: 104,
385
416
  S: this,
386
417
  A: [
387
418
  "selection?.mode === mode",
@@ -406,7 +437,7 @@ var SelectionManager = class {
406
437
  const selection = this.getSelection(contextId, "single");
407
438
  invariant(selection?.mode === "single", "Selection mode is not single", {
408
439
  F: __dxlog_file,
409
- L: 104,
440
+ L: 117,
410
441
  S: this,
411
442
  A: [
412
443
  "selection?.mode === 'single'",
@@ -421,14 +452,14 @@ var SelectionManager = class {
421
452
  const selection = this.getSelection(contextId, "multi");
422
453
  invariant(selection?.mode === "multi", "Selection mode is not multi", {
423
454
  F: __dxlog_file,
424
- L: 112,
455
+ L: 125,
425
456
  S: this,
426
457
  A: [
427
458
  "selection?.mode === 'multi'",
428
459
  "'Selection mode is not multi'"
429
460
  ]
430
461
  });
431
- selection.ids = ids;
462
+ selection.ids.splice(0, selection.ids.length, ...ids);
432
463
  });
433
464
  }
434
465
  updateRange(contextId, from, to) {
@@ -436,7 +467,7 @@ var SelectionManager = class {
436
467
  const selection = this.getSelection(contextId, "range");
437
468
  invariant(selection?.mode === "range", "Selection mode is not range", {
438
469
  F: __dxlog_file,
439
- L: 120,
470
+ L: 133,
440
471
  S: this,
441
472
  A: [
442
473
  "selection?.mode === 'range'",
@@ -452,22 +483,38 @@ var SelectionManager = class {
452
483
  const selection = this.getSelection(contextId, "multi-range");
453
484
  invariant(selection?.mode === "multi-range", "Selection mode is not multi-range", {
454
485
  F: __dxlog_file,
455
- L: 129,
486
+ L: 142,
456
487
  S: this,
457
488
  A: [
458
489
  "selection?.mode === 'multi-range'",
459
490
  "'Selection mode is not multi-range'"
460
491
  ]
461
492
  });
462
- selection.ranges = ranges;
493
+ selection.ranges.splice(0, selection.ranges.length, ...ranges);
463
494
  });
464
495
  }
465
496
  clearSelection(contextId) {
466
497
  untracked2(() => {
467
498
  const selection = this.getSelection(contextId);
468
- if (selection) {
469
- this._state.selections[contextId] = defaultSelection(selection.mode);
470
- }
499
+ Match.type().pipe(Match.when(void 0, () => {
500
+ }), Match.when({
501
+ mode: "single"
502
+ }, (s) => {
503
+ s.id = void 0;
504
+ }), Match.when({
505
+ mode: "multi"
506
+ }, (s) => {
507
+ s.ids.splice(0, s.ids.length);
508
+ }), Match.when({
509
+ mode: "range"
510
+ }, (s) => {
511
+ s.from = void 0;
512
+ s.to = void 0;
513
+ }), Match.when({
514
+ mode: "multi-range"
515
+ }, (s) => {
516
+ s.ranges.splice(0, s.ranges.length);
517
+ }), Match.exhaustive)(selection);
471
518
  });
472
519
  }
473
520
  toggleSelection(contextId, id) {
@@ -475,7 +522,7 @@ var SelectionManager = class {
475
522
  const selection = this.getSelection(contextId, "multi");
476
523
  invariant(selection?.mode === "multi", "Selection mode is not multi", {
477
524
  F: __dxlog_file,
478
- L: 146,
525
+ L: 175,
479
526
  S: this,
480
527
  A: [
481
528
  "selection?.mode === 'multi'",
@@ -490,6 +537,16 @@ var SelectionManager = class {
490
537
  }
491
538
  });
492
539
  }
540
+ constructor(initial = {}) {
541
+ _define_property2(this, "_state", live2({
542
+ selections: {}
543
+ }));
544
+ if (Object.keys(initial).length > 0) {
545
+ untracked2(() => {
546
+ this._state.selections = initial;
547
+ });
548
+ }
549
+ }
493
550
  };
494
551
 
495
552
  // src/components/SelectionProvider.tsx
@@ -607,6 +664,7 @@ export {
607
664
  RootAttentionProvider,
608
665
  AttentionProvider,
609
666
  AttendableContainer,
667
+ SelectionSchema,
610
668
  defaultSelection,
611
669
  getSelectionSet,
612
670
  SelectionManager,
@@ -615,4 +673,4 @@ export {
615
673
  useSelected,
616
674
  useSelectionActions
617
675
  };
618
- //# sourceMappingURL=chunk-F2JRKDYV.mjs.map
676
+ //# sourceMappingURL=chunk-NFTXIHW4.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/attention.ts", "../../../src/components/AttentionGlyph.tsx", "../../../src/components/AttentionProvider.tsx", "../../../src/selection.ts", "../../../src/components/SelectionProvider.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { untracked } from '@preact/signals-core';\nimport { Schema } from 'effect';\n\nimport { type Live, live } from '@dxos/live-object';\nimport { ComplexMap } from '@dxos/util';\n\n// NOTE: Chosen from RFC 1738’s `safe` characters: http://www.faqs.org/rfcs/rfc1738.html\nexport const ATTENDABLE_PATH_SEPARATOR = '~';\n\nexport const AttentionSchema = Schema.mutable(\n Schema.Struct({\n hasAttention: Schema.Boolean,\n isAncestor: Schema.Boolean,\n isRelated: Schema.Boolean,\n }),\n);\n\nexport type Attention = Schema.Schema.Type<typeof AttentionSchema>;\n\n// TODO(wittjosiah): Use mosaic path utility?\nconst stringKey = (key: string[]) => key.join(',');\n\n/**\n * Manages attention state for an application.\n */\n// TODO(wittjosiah): Write unit tests.\nexport class AttentionManager {\n // Each attention path is associated with an attention object.\n // The lookup is not a reactive object to ensure that attention for each path is subscribable independently.\n private readonly _map = new ComplexMap<string[], Live<Attention>>(stringKey);\n private readonly _state = live<{ current: string[] }>({ current: [] });\n\n constructor(initial: string[] = []) {\n if (initial.length > 0) {\n this.update(initial);\n }\n }\n\n /**\n * Currently attended element.\n *\n * @reactive\n */\n get current(): Live<readonly string[]> {\n return this._state.current;\n }\n\n /**\n * All attention paths.\n */\n keys(): string[][] {\n return Array.from(this._map.keys());\n }\n\n /**\n * Get the attention state for a given path.\n */\n get(key: string[]): Live<Attention> {\n const object = this._map.get(key);\n if (object) {\n return object;\n }\n\n const newObject = live(AttentionSchema, { hasAttention: false, isAncestor: false, isRelated: false });\n this._map.set(key, newObject);\n return newObject;\n }\n\n /**\n * Update the currently attended element.\n *\n * @internal\n */\n update(nextKey: string[]): void {\n const currentKey = untracked(() => this.current);\n const currentRelatedTo = currentKey[0];\n const nextRelatedTo = nextKey[0];\n\n // Ensure related attention object is initialized.\n this.get([nextRelatedTo]);\n\n const currentRelatedKeys = this.keys().filter((key) => key[0] === currentRelatedTo);\n const nextRelatedKeys = this.keys().filter(\n (key) => key[0] === nextRelatedTo && stringKey(key) !== stringKey(nextKey),\n );\n const prevRelatedKeys = currentRelatedKeys.filter(\n (curr) => !nextRelatedKeys.find((next) => stringKey(curr) === stringKey(next)),\n );\n\n const currentAncestorKeys = currentKey.slice(1).map((_, i) => currentKey.slice(i + 1, currentKey.length));\n const nextAncestorKeys = nextKey.slice(1).map((_, i) => nextKey.slice(i + 1, nextKey.length));\n const prevAncestorKeys = currentAncestorKeys.filter(\n (curr) => !nextAncestorKeys.find((next) => stringKey(curr) === stringKey(next)),\n );\n\n this._state.current = nextKey;\n prevRelatedKeys.forEach((key) => this._set(key, {}));\n prevAncestorKeys.forEach((key) => this._set(key, {}));\n nextRelatedKeys.forEach((key) => this._set(key, { isRelated: true }));\n nextAncestorKeys.forEach((key) => this._set(key, { isAncestor: true }));\n this._set(nextKey, { hasAttention: true });\n }\n\n private _set(key: string[], attention: Partial<Attention>): void {\n const object = this.get(key);\n object.hasAttention = attention.hasAttention ?? false;\n object.isAncestor = attention.isAncestor ?? false;\n object.isRelated = attention.isRelated ?? false;\n }\n}\n\n/**\n * Accumulates all attendable id’s between the element provided and the root, inclusive.\n */\nexport const getAttendables = (selector: string, cursor: Element, acc: string[] = []): string[] => {\n // Find the closest element with `data-attendable-id`, if any; start from cursor and move up the DOM tree.\n const closestAttendable = cursor.closest(selector);\n if (closestAttendable) {\n const attendableId = closestAttendable.getAttribute('data-attendable-id');\n if (!attendableId) {\n // This has an id of an aria-controls elsewhere on the page, move cursor to that trigger.\n const trigger = document.querySelector(`[aria-controls=\"${closestAttendable.getAttribute('id')}\"]`);\n if (!trigger) {\n return acc;\n } else {\n return getAttendables(selector, trigger, acc);\n }\n } else {\n acc.push(...attendableId.split(ATTENDABLE_PATH_SEPARATOR));\n // TODO: Attempt tail recursion.\n return !closestAttendable.parentElement ? acc : getAttendables(selector, closestAttendable.parentElement, acc);\n }\n }\n\n return [...new Set(acc)];\n};\n\nexport type AttendableId = { attendableId?: string };\n\nexport type Related = { related?: boolean };\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Primitive } from '@radix-ui/react-primitive';\nimport React, { type CSSProperties, type ComponentPropsWithRef, forwardRef, useMemo } from 'react';\n\nimport { Icon, type ThemedClassName } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\nconst attentionGlyphStyles =\n 'inline-block rounded-sm is-3 bs-3 bg-transparent text-accentText transition-colors [[data-contains-attended=true]_&]:bg-attentionRelated [[data-attention=true]_&]:bg-accentSurface [[data-attention=true]_&]:text-accentSurfaceText [[aria-current][data-attention=true]_&]:bg-accentSurface [[aria-current][data-attention=true]_&]:text-accentSurfaceText';\n\nconst presenceIconStyles =\n 'is-3 bs-3 group-[[aria-current]_&:hover]/attentionGlyphButton:hidden group-[[aria-current]_&:focus]/attentionGlyphButton:hidden group-[[data-attention=true]_&:hover]/attentionGlyphButton:hidden group-[[data-attention=true]_&:focus]/attentionGlyphButton:hidden group-[[aria-current][data-attention=true]_&:hover]/attentionGlyphButton:hidden group-[[aria-current][data-attention=true]_&:focus]/attentionGlyphButton:hidden';\n\nconst PresenceOne = () => {\n return (\n <svg\n width='12'\n height='12'\n viewBox='0 0 12 12'\n className={presenceIconStyles}\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <circle cx='6' cy='6' r='2.5' fill='currentColor' />\n </svg>\n );\n};\n\nconst PresenceMany = () => {\n return (\n <svg\n width='12'\n height='12'\n viewBox='0 0 12 12'\n className={presenceIconStyles}\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <path\n d='M6.75 8.27311C7.38815 7.72296 7.79212 6.90866 7.79212 6C7.79212 5.09134 7.38815 4.27704 6.75 3.72689C7.06722 3.58122 7.42019 3.5 7.79212 3.5C9.17283 3.5 10.2921 4.61929 10.2921 6C10.2921 7.38071 9.17283 8.5 7.79212 8.5C7.42019 8.5 7.06723 8.41878 6.75 8.27311Z'\n fill='currentColor'\n />\n <circle cx='4.25' cy='6' r='2.5' fill='currentColor' />\n </svg>\n );\n};\n\nexport const Syncing = () => {\n const animationProps = useMemo<CSSProperties>(\n () => ({\n // Synchronize animations.\n animationDelay: `-${Date.now() % 2_000}ms`,\n }),\n [],\n );\n\n return (\n <div role='status' className='flex items-center'>\n <Icon\n icon='ph--circle-notch--bold'\n size={3}\n style={animationProps}\n classNames='text-subdued animate-[spin_2s_linear_infinite]'\n />\n </div>\n );\n};\n\nexport type AttentionGlyphProps = {\n attended?: boolean;\n containsAttended?: boolean;\n syncing?: boolean;\n presence?: 'none' | 'one' | 'many';\n} & ThemedClassName<Omit<ComponentPropsWithRef<typeof Primitive.span>, 'children'>>;\n\nexport const AttentionGlyph = forwardRef<HTMLSpanElement, AttentionGlyphProps>(\n ({ presence, attended, syncing, containsAttended, classNames, ...props }, forwardedRef) => {\n const icon = syncing ? (\n <Syncing />\n ) : presence === 'many' ? (\n <PresenceMany />\n ) : presence === 'one' ? (\n <PresenceOne />\n ) : null;\n\n return (\n <div role='none' className='flex' data-attention={attended} data-contains-attended={containsAttended}>\n <span role='none' {...props} className={mx(attentionGlyphStyles, classNames)} ref={forwardedRef}>\n {icon}\n </span>\n </div>\n );\n },\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\n// NOTE(thure): The following unused imports quell TS2742 (“likely not portable”).\n\n// eslint-disable-next-line unused-imports/no-unused-imports\nimport { type CreateScope, type Scope, createContext } from '@radix-ui/react-context';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { Slot } from '@radix-ui/react-slot';\nimport React, { type ComponentPropsWithRef, type FocusEvent, type PropsWithChildren, forwardRef, useMemo } from 'react';\n\nimport { type ThemedClassName, useDefaultValue } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { ATTENDABLE_PATH_SEPARATOR, type Attention, AttentionManager, getAttendables } from '../attention';\n\nconst ATTENTION_NAME = 'Attention';\nconst ATTENABLE_ATTRIBUTE = 'data-attendable-id';\nconst ATTENTION_SOURCE_ATTRIBUTE = 'data-is-attention-source';\n\ntype AttentionContextValue = {\n attention: AttentionManager;\n path: string[];\n};\n\nconst [AttentionContextProvider, useAttentionContext] = createContext<AttentionContextValue>(ATTENTION_NAME, {\n attention: new AttentionManager(),\n path: [],\n});\n\nconst UNKNOWN_ATTENDABLE = { hasAttention: false, isAncestor: false, isRelated: false };\n\nconst useAttention = (attendableId?: string): Attention => {\n const { attention, path } = useAttentionContext(ATTENTION_NAME);\n if (!attendableId) {\n return UNKNOWN_ATTENDABLE;\n }\n\n const current = [...attendableId.split(ATTENDABLE_PATH_SEPARATOR), ...path];\n return attention.get(current);\n};\n\nconst useAttended = () => {\n const { attention } = useAttentionContext(ATTENTION_NAME);\n return attention.current;\n};\n\n/**\n * Computes HTML element attributes to apply so the attention system can detect changes.\n * @param attendableId\n */\nconst useAttentionAttributes = (attendableId?: string) => {\n const { hasAttention } = useAttention(attendableId);\n return useMemo(() => {\n const attributes: Record<string, string | undefined> = { [ATTENABLE_ATTRIBUTE]: attendableId };\n if (hasAttention) {\n attributes[ATTENTION_SOURCE_ATTRIBUTE] = 'true';\n }\n\n return attributes;\n }, [attendableId, hasAttention]);\n};\n\nconst useAttentionPath = () => {\n const { path } = useAttentionContext(ATTENTION_NAME);\n return path;\n};\n\nconst RootAttentionProvider = ({\n children,\n attention: propsAttention,\n onChange,\n}: PropsWithChildren<\n Partial<{\n attention: AttentionManager;\n onChange: (nextAttended: string[]) => void;\n }>\n>) => {\n const attention = useDefaultValue(propsAttention, () => new AttentionManager());\n const handleFocus = (event: FocusEvent) => {\n const selector = [\n '[data-attendable-id]',\n ...Array.from(document.querySelectorAll('[aria-controls]')).map(\n (el) => `[id=\"${el.getAttribute('aria-controls')}\"]`,\n ),\n ].join(',');\n const prev = attention.current;\n const next = getAttendables(selector, event.target);\n // TODO(wittjosiah): Not allowing empty state means that the attended item is not strictly guaranteed to be in the DOM.\n // Currently this depends on the deck in order to ensure that when the attended item is removed something else is attended.\n // Only update state if the result is different and not empty.\n if (next.length > 0 && (prev.length !== next.length || !!prev.find((id, index) => next[index] !== id))) {\n attention.update(next);\n onChange?.(next);\n }\n };\n\n // NOTE(thure): Use the following to debug the macOS package issue #8540\n\n // const [startEl, setStartEl] = useState<HTMLElement | null>(null);\n // const [endEl, setEndEl] = useState<HTMLElement | null>(null);\n //\n // const handleEventDebug = useCallback((event: any) => {\n // console.log(`[${event.type}]`, event.target, event.currentTarget, [event.clientX, event.clientY]);\n // }, []);\n //\n // const handleStartDebug = useCallback(\n // (event: any) => {\n // setStartEl(event.target);\n // handleEventDebug(event);\n // },\n // [handleEventDebug],\n // );\n //\n // const handleEndDebug = useCallback(\n // (event: any) => {\n // setEndEl(event.target);\n // handleEventDebug(event);\n // },\n // [handleEventDebug],\n // );\n //\n // const handleClickDebug = useCallback(\n // (event: any) => {\n // console.log('[click compare]', startEl, endEl, startEl === endEl);\n // handleEventDebug(event);\n // },\n // [startEl, endEl, handleEventDebug],\n // );\n\n return (\n <AttentionContextProvider attention={attention} path={[]}>\n <div\n role='none'\n className='contents'\n onFocusCapture={handleFocus}\n // onClick={handleClickDebug}\n // onMouseDown={handleStartDebug}\n // onMouseUp={handleEndDebug}\n >\n {children}\n </div>\n </AttentionContextProvider>\n );\n};\n\nconst AttentionProvider = ({ id, children }: PropsWithChildren<{ id: string }>) => {\n const { attention, path } = useAttentionContext(ATTENTION_NAME);\n const nextPath = useMemo(() => [id, ...path], [id, path]);\n\n return (\n <AttentionContextProvider attention={attention} path={nextPath}>\n {children}\n </AttentionContextProvider>\n );\n};\n\nexport type AttendableContainerProps = ThemedClassName<\n ComponentPropsWithRef<'div'> & { id: string; asChild?: boolean }\n>;\n\n/**\n * Note that DeckPlugin and StackPlugin both handle attention on their own, and when rendering content in those cases it\n * is not necessary to also render an `AttendableContainer`. This component is primarily for Storybook stories and other\n * testing scenarios, or the rare cases where an attendable entity is rendered outside of either of those plugins.\n */\nconst AttendableContainer = forwardRef<HTMLDivElement, AttendableContainerProps>(\n ({ id, classNames, children, asChild, ...props }, forwardedRef) => {\n const attentionAttrs = useAttentionAttributes(id);\n const Root = asChild ? Slot : Primitive.div;\n return (\n <Root\n role='none'\n {...attentionAttrs}\n {...props}\n className={mx('attention-surface', props.tabIndex === 0 && 'dx-focus-ring-inset-over-all', classNames)}\n ref={forwardedRef}\n >\n {children}\n </Root>\n );\n },\n);\n\nexport {\n RootAttentionProvider,\n AttentionProvider,\n AttendableContainer,\n useAttentionContext,\n useAttention,\n useAttended,\n useAttentionAttributes,\n useAttentionPath,\n ATTENTION_NAME,\n ATTENABLE_ATTRIBUTE,\n ATTENTION_SOURCE_ATTRIBUTE,\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { untracked } from '@preact/signals-core';\nimport { Match, Schema } from 'effect';\n\nimport { invariant } from '@dxos/invariant';\nimport { type Live, live } from '@dxos/live-object';\n\n// TODO(burdon): Reconcile with @dxos/graph.\n\nexport type SelectionMode = 'single' | 'multi' | 'range' | 'multi-range';\n\nexport const SelectionSchema = Schema.Union(\n Schema.Struct({ mode: Schema.Literal('single'), id: Schema.optional(Schema.String) }).pipe(Schema.mutable),\n Schema.Struct({ mode: Schema.Literal('multi'), ids: Schema.Array(Schema.String).pipe(Schema.mutable) }).pipe(\n Schema.mutable,\n ),\n Schema.Struct({\n mode: Schema.Literal('range'),\n from: Schema.optional(Schema.String),\n to: Schema.optional(Schema.String),\n }).pipe(Schema.mutable),\n Schema.Struct({\n mode: Schema.Literal('multi-range'),\n ranges: Schema.Array(Schema.Struct({ from: Schema.String, to: Schema.String })).pipe(Schema.mutable),\n }).pipe(Schema.mutable),\n).pipe(Schema.mutable);\n\nexport type Selection = Schema.Schema.Type<typeof SelectionSchema>;\n\nexport const defaultSelection = Match.type<SelectionMode>().pipe(\n Match.withReturnType<Selection>(),\n Match.when('single', () => ({ mode: 'single' })),\n Match.when('multi', () => ({ mode: 'multi', ids: [] })),\n Match.when('range', () => ({ mode: 'range' })),\n Match.when('multi-range', () => ({ mode: 'multi-range', ranges: [] })),\n Match.exhaustive,\n);\n\nexport type SelectionResult<T extends SelectionMode> = T extends 'single'\n ? string | undefined\n : T extends 'multi'\n ? string[]\n : T extends 'range'\n ? { from: string; to: string } | undefined\n : T extends 'multi-range'\n ? { from: string; to: string }[]\n : never;\n\n// TODO(burdon): Refactor.\nexport const getSelectionSet = (selectionManager: SelectionManager, contextId?: string) => {\n const ids = new Set<string>(contextId ? [contextId] : []);\n for (const context of selectionManager.getSelectionContexts()) {\n const selection = selectionManager.getSelection(context);\n if (selection?.mode === 'multi') {\n for (const id of selection.ids) {\n ids.add(id);\n }\n }\n }\n\n return ids;\n};\n\n/**\n * Manages selection state for different contexts.\n * Each context maintains its own selection mode and state.\n */\nexport class SelectionManager {\n private readonly _state = live<{ selections: Record<string, Selection> }>({ selections: {} });\n\n constructor(initial: Record<string, Selection> = {}) {\n if (Object.keys(initial).length > 0) {\n untracked(() => {\n this._state.selections = initial;\n });\n }\n }\n\n getSelectionContexts(): string[] {\n return Object.keys(this._state.selections);\n }\n\n getSelection<T extends SelectionMode | undefined>(\n contextId: string,\n mode: T = undefined as T,\n ): T extends undefined ? Live<Selection> | undefined : Live<Selection> {\n const selection = untracked(() => this._state.selections[contextId]);\n if (!mode || selection) {\n return selection;\n }\n\n return untracked(() => {\n this._state.selections[contextId] = defaultSelection(mode);\n return this._state.selections[contextId];\n });\n }\n\n // TODO(burdon): Disambiguate with getSelection?\n getSelected<T extends SelectionMode>(contextId: string, mode: T = 'multi' as T): SelectionResult<T> {\n const selection = this.getSelection(contextId, mode);\n invariant(selection?.mode === mode, 'Selection mode mismatch');\n return Match.type<Selection>().pipe(\n Match.when({ mode: 'single' }, (s) => s.id),\n Match.when({ mode: 'multi' }, (s) => s.ids),\n Match.when({ mode: 'range' }, (s) => (s.from && s.to ? { from: s.from, to: s.to } : undefined)),\n Match.when({ mode: 'multi-range' }, (s) => s.ranges),\n Match.exhaustive,\n )(selection) as any;\n }\n\n updateSingle(contextId: string, id: string): void {\n untracked(() => {\n const selection = this.getSelection(contextId, 'single');\n invariant(selection?.mode === 'single', 'Selection mode is not single');\n selection.id = id;\n });\n }\n\n updateMulti(contextId: string, ids: string[]) {\n untracked(() => {\n const selection = this.getSelection(contextId, 'multi');\n invariant(selection?.mode === 'multi', 'Selection mode is not multi');\n selection.ids.splice(0, selection.ids.length, ...ids);\n });\n }\n\n updateRange(contextId: string, from: string, to: string) {\n untracked(() => {\n const selection = this.getSelection(contextId, 'range');\n invariant(selection?.mode === 'range', 'Selection mode is not range');\n selection.from = from;\n selection.to = to;\n });\n }\n\n updateMultiRange(contextId: string, ranges: { from: string; to: string }[]) {\n untracked(() => {\n const selection = this.getSelection(contextId, 'multi-range');\n invariant(selection?.mode === 'multi-range', 'Selection mode is not multi-range');\n selection.ranges.splice(0, selection.ranges.length, ...ranges);\n });\n }\n\n clearSelection(contextId: string): void {\n untracked(() => {\n const selection = this.getSelection(contextId);\n Match.type<Selection | undefined>().pipe(\n Match.when(undefined, () => {\n // No-op.\n }),\n Match.when({ mode: 'single' }, (s) => {\n s.id = undefined;\n }),\n Match.when({ mode: 'multi' }, (s) => {\n s.ids.splice(0, s.ids.length);\n }),\n Match.when({ mode: 'range' }, (s) => {\n s.from = undefined;\n s.to = undefined;\n }),\n Match.when({ mode: 'multi-range' }, (s) => {\n s.ranges.splice(0, s.ranges.length);\n }),\n Match.exhaustive,\n )(selection);\n });\n }\n\n toggleSelection(contextId: string, id: string): void {\n untracked(() => {\n const selection = this.getSelection(contextId, 'multi');\n invariant(selection?.mode === 'multi', 'Selection mode is not multi');\n\n if (selection.ids.includes(id)) {\n const index = selection.ids.indexOf(id);\n selection.ids.splice(index, 1);\n } else {\n selection.ids.push(id);\n }\n });\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport { Match } from 'effect';\nimport React, { type PropsWithChildren, useCallback, useMemo } from 'react';\n\nimport { useDefaultValue } from '@dxos/react-ui';\n\nimport {\n type Selection,\n SelectionManager,\n type SelectionMode,\n type SelectionResult,\n defaultSelection,\n} from '../selection';\n\nconst SELECTION_NAME = 'Selection';\n\ntype SelectionContextValue = {\n selection: SelectionManager;\n};\n\nconst [SelectionContextProvider, useSelectionContext] = createContext<SelectionContextValue>(SELECTION_NAME, {\n selection: new SelectionManager(),\n});\n\n/**\n * Manages selection state across the app for multiple contexts.\n */\n// TODO(burdon): When is the selection removed?\nexport const SelectionProvider = ({\n children,\n selection: propsSelection,\n}: PropsWithChildren<{ selection?: SelectionManager }>) => {\n const selection = useDefaultValue(propsSelection, () => new SelectionManager());\n return <SelectionContextProvider selection={selection}>{children}</SelectionContextProvider>;\n};\n\n/**\n * Get the selection contexts.\n */\nexport const useSelectionManager = () => {\n const { selection } = useSelectionContext(SELECTION_NAME);\n return selection;\n};\n\n/**\n * Get the selected objects for a given context.\n */\nexport const useSelected = <T extends SelectionMode>(\n contextId?: string,\n mode: T = 'multi' as T,\n): SelectionResult<T> => {\n const { selection } = useSelectionContext(SELECTION_NAME);\n if (contextId) {\n return selection.getSelected(contextId, mode);\n }\n\n return Match.type<Selection>().pipe(\n Match.when({ mode: 'single' }, (s) => s.id),\n Match.when({ mode: 'multi' }, (s) => s.ids),\n Match.when({ mode: 'range' }, (s) => (s.from && s.to ? { from: s.from, to: s.to } : undefined)),\n Match.when({ mode: 'multi-range' }, (s) => s.ranges),\n Match.exhaustive,\n )(defaultSelection(mode)) as any;\n};\n\n/**\n * Provides functions to manage the selection state for multiple contexts.\n */\nexport const useSelectionActions = (contextIds: string[], mode: SelectionMode = 'multi') => {\n const stableContextIds = useMemo(() => contextIds, [JSON.stringify(contextIds)]); // TODO(burdon): Avoid stringify.\n const { selection } = useSelectionContext(SELECTION_NAME);\n\n const singleSelect = useCallback(\n (id: string) => {\n for (const contextId of stableContextIds) {\n selection.updateSingle(contextId, id);\n }\n },\n [selection, stableContextIds],\n );\n\n const multiSelect = useCallback(\n (ids: string[]) => {\n for (const contextId of stableContextIds) {\n selection.updateMulti(contextId, ids);\n }\n },\n [selection, stableContextIds],\n );\n\n const rangeSelect = useCallback(\n (from: string, to: string) => {\n for (const contextId of stableContextIds) {\n selection.updateRange(contextId, from, to);\n }\n },\n [selection, stableContextIds],\n );\n\n const toggle = useCallback(\n (id: string) => {\n for (const contextId of stableContextIds) {\n selection.toggleSelection(contextId, id);\n }\n },\n [selection, stableContextIds],\n );\n\n const clear = useCallback(() => {\n for (const contextId of stableContextIds) {\n selection.clearSelection(contextId);\n }\n }, [selection, stableContextIds]);\n\n return { singleSelect, multiSelect, rangeSelect, toggle, clear };\n};\n"],
5
+ "mappings": ";;;AAIA,SAASA,iBAAiB;AAC1B,SAASC,cAAc;AAEvB,SAAoBC,YAAY;AAChC,SAASC,kBAAkB;;;;;;;;;;;;;;AAGpB,IAAMC,4BAA4B;AAElC,IAAMC,kBAAkBC,OAAOC,QACpCD,OAAOE,OAAO;EACZC,cAAcH,OAAOI;EACrBC,YAAYL,OAAOI;EACnBE,WAAWN,OAAOI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AAY1B,WAAWS,GAAAA;IACnC;EACF,GACA;IAAClB;IAAW2B;GAAiB;AAG/B,QAAMS,cAAcJ,YAClB,CAACb,MAAcC,OAAAA;AACb,eAAWX,aAAakB,kBAAkB;AACxC3B,gBAAUqC,YAAY5B,WAAWU,MAAMC,EAAAA;IACzC;EACF,GACA;IAACpB;IAAW2B;GAAiB;AAG/B,QAAMW,SAASN,YACb,CAACf,OAAAA;AACC,eAAWR,aAAakB,kBAAkB;AACxC3B,gBAAUuC,gBAAgB9B,WAAWQ,EAAAA;IACvC;EACF,GACA;IAACjB;IAAW2B;GAAiB;AAG/B,QAAMa,QAAQR,YAAY,MAAA;AACxB,eAAWvB,aAAakB,kBAAkB;AACxC3B,gBAAUyC,eAAehC,SAAAA;IAC3B;EACF,GAAG;IAACT;IAAW2B;GAAiB;AAEhC,SAAO;IAAEI;IAAcG;IAAaE;IAAaE;IAAQE;EAAM;AACjE;",
6
+ "names": ["untracked", "Schema", "live", "ComplexMap", "ATTENDABLE_PATH_SEPARATOR", "AttentionSchema", "Schema", "mutable", "Struct", "hasAttention", "Boolean", "isAncestor", "isRelated", "stringKey", "key", "join", "AttentionManager", "current", "_state", "keys", "Array", "from", "_map", "get", "object", "newObject", "live", "set", "update", "nextKey", "currentKey", "untracked", "currentRelatedTo", "nextRelatedTo", "currentRelatedKeys", "filter", "nextRelatedKeys", "prevRelatedKeys", "curr", "find", "next", "currentAncestorKeys", "slice", "map", "_", "i", "length", "nextAncestorKeys", "prevAncestorKeys", "forEach", "_set", "attention", "initial", "ComplexMap", "getAttendables", "selector", "cursor", "acc", "closestAttendable", "closest", "attendableId", "getAttribute", "trigger", "document", "querySelector", "push", "split", "parentElement", "Set", "React", "forwardRef", "useMemo", "Icon", "mx", "attentionGlyphStyles", "presenceIconStyles", "PresenceOne", "svg", "width", "height", "viewBox", "className", "fill", "xmlns", "circle", "cx", "cy", "r", "PresenceMany", "path", "d", "Syncing", "animationProps", "useMemo", "animationDelay", "Date", "now", "div", "role", "Icon", "icon", "size", "style", "classNames", "AttentionGlyph", "forwardRef", "presence", "attended", "syncing", "containsAttended", "props", "forwardedRef", "data-attention", "data-contains-attended", "span", "mx", "ref", "createContext", "Primitive", "Slot", "React", "forwardRef", "useMemo", "useDefaultValue", "mx", "ATTENTION_NAME", "ATTENABLE_ATTRIBUTE", "ATTENTION_SOURCE_ATTRIBUTE", "AttentionContextProvider", "useAttentionContext", "createContext", "attention", "AttentionManager", "path", "UNKNOWN_ATTENDABLE", "hasAttention", "isAncestor", "isRelated", "useAttention", "attendableId", "current", "split", "ATTENDABLE_PATH_SEPARATOR", "get", "useAttended", "useAttentionAttributes", "useMemo", "attributes", "useAttentionPath", "RootAttentionProvider", "children", "propsAttention", "onChange", "useDefaultValue", "handleFocus", "event", "selector", "Array", "from", "document", "querySelectorAll", "map", "el", "getAttribute", "join", "prev", "next", "getAttendables", "target", "length", "find", "id", "index", "update", "React", "div", "role", "className", "onFocusCapture", "AttentionProvider", "nextPath", "AttendableContainer", "forwardRef", "classNames", "asChild", "props", "forwardedRef", "attentionAttrs", "Root", "Slot", "Primitive", "mx", "tabIndex", "ref", "untracked", "Match", "Schema", "invariant", "live", "SelectionSchema", "Union", "Struct", "mode", "Literal", "id", "optional", "String", "pipe", "mutable", "ids", "Array", "from", "to", "ranges", "defaultSelection", "type", "withReturnType", "when", "exhaustive", "getSelectionSet", "selectionManager", "contextId", "Set", "context", "getSelectionContexts", "selection", "getSelection", "add", "SelectionManager", "Object", "keys", "_state", "selections", "undefined", "getSelected", "s", "updateSingle", "updateMulti", "splice", "length", "updateRange", "updateMultiRange", "clearSelection", "toggleSelection", "includes", "index", "indexOf", "push", "initial", "_define_property", "createContext", "Match", "React", "useCallback", "useMemo", "useDefaultValue", "SELECTION_NAME", "SelectionContextProvider", "useSelectionContext", "createContext", "selection", "SelectionManager", "SelectionProvider", "children", "propsSelection", "useDefaultValue", "React", "useSelectionManager", "useSelected", "contextId", "mode", "getSelected", "Match", "type", "pipe", "when", "s", "id", "ids", "from", "to", "undefined", "ranges", "exhaustive", "defaultSelection", "useSelectionActions", "contextIds", "stableContextIds", "useMemo", "JSON", "stringify", "singleSelect", "useCallback", "updateSingle", "multiSelect", "updateMulti", "rangeSelect", "updateRange", "toggle", "toggleSelection", "clear", "clearSelection"]
7
+ }
@@ -12,6 +12,7 @@ import {
12
12
  RootAttentionProvider,
13
13
  SelectionManager,
14
14
  SelectionProvider,
15
+ SelectionSchema,
15
16
  Syncing,
16
17
  defaultSelection,
17
18
  getAttendables,
@@ -24,7 +25,7 @@ import {
24
25
  useSelected,
25
26
  useSelectionActions,
26
27
  useSelectionManager
27
- } from "./chunk-F2JRKDYV.mjs";
28
+ } from "./chunk-NFTXIHW4.mjs";
28
29
  export {
29
30
  ATTENABLE_ATTRIBUTE,
30
31
  ATTENDABLE_PATH_SEPARATOR,
@@ -38,6 +39,7 @@ export {
38
39
  RootAttentionProvider,
39
40
  SelectionManager,
40
41
  SelectionProvider,
42
+ SelectionSchema,
41
43
  Syncing,
42
44
  defaultSelection,
43
45
  getAttendables,
@@ -1 +1 @@
1
- {"inputs":{"src/attention.ts":{"bytes":16516,"imports":[{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/AttentionGlyph.tsx":{"bytes":11200,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/AttentionProvider.tsx":{"bytes":20795,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/attention.ts","kind":"import-statement","original":"../attention"}],"format":"esm"},"src/selection.ts":{"bytes":17905,"imports":[{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"format":"esm"},"src/components/SelectionProvider.tsx":{"bytes":11919,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"src/selection.ts","kind":"import-statement","original":"../selection"}],"format":"esm"},"src/components/index.ts":{"bytes":708,"imports":[{"path":"src/components/AttentionGlyph.tsx","kind":"import-statement","original":"./AttentionGlyph"},{"path":"src/components/AttentionProvider.tsx","kind":"import-statement","original":"./AttentionProvider"},{"path":"src/components/SelectionProvider.tsx","kind":"import-statement","original":"./SelectionProvider"}],"format":"esm"},"src/index.ts":{"bytes":645,"imports":[{"path":"src/attention.ts","kind":"import-statement","original":"./attention"},{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/selection.ts","kind":"import-statement","original":"./selection"}],"format":"esm"},"src/testing/decorators/withAttention.ts":{"bytes":1337,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../../components"}],"format":"esm"},"src/testing/decorators/index.ts":{"bytes":493,"imports":[{"path":"src/testing/decorators/withAttention.ts","kind":"import-statement","original":"./withAttention"}],"format":"esm"},"src/testing/index.ts":{"bytes":471,"imports":[{"path":"src/testing/decorators/index.ts","kind":"import-statement","original":"./decorators"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-F2JRKDYV.mjs","kind":"import-statement"}],"exports":["ATTENABLE_ATTRIBUTE","ATTENDABLE_PATH_SEPARATOR","ATTENTION_NAME","ATTENTION_SOURCE_ATTRIBUTE","AttendableContainer","AttentionGlyph","AttentionManager","AttentionProvider","AttentionSchema","RootAttentionProvider","SelectionManager","SelectionProvider","Syncing","defaultSelection","getAttendables","getSelectionSet","useAttended","useAttention","useAttentionAttributes","useAttentionContext","useAttentionPath","useSelected","useSelectionActions","useSelectionManager"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":1169},"dist/lib/node-esm/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":698},"dist/lib/node-esm/testing/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-F2JRKDYV.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true}],"exports":["withAttention"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/decorators/withAttention.ts":{"bytesInOutput":164},"src/testing/decorators/index.ts":{"bytesInOutput":0},"src/testing/index.ts":{"bytesInOutput":0}},"bytes":428},"dist/lib/node-esm/chunk-F2JRKDYV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":38662},"dist/lib/node-esm/chunk-F2JRKDYV.mjs":{"imports":[{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["ATTENABLE_ATTRIBUTE","ATTENDABLE_PATH_SEPARATOR","ATTENTION_NAME","ATTENTION_SOURCE_ATTRIBUTE","AttendableContainer","AttentionGlyph","AttentionManager","AttentionProvider","AttentionSchema","RootAttentionProvider","SelectionManager","SelectionProvider","Syncing","defaultSelection","getAttendables","getSelectionSet","useAttended","useAttention","useAttentionAttributes","useAttentionContext","useAttentionPath","useSelected","useSelectionActions","useSelectionManager"],"inputs":{"src/attention.ts":{"bytesInOutput":3644},"src/components/AttentionGlyph.tsx":{"bytesInOutput":3714},"src/components/AttentionProvider.tsx":{"bytesInOutput":3705},"src/selection.ts":{"bytesInOutput":4858},"src/components/SelectionProvider.tsx":{"bytesInOutput":2762},"src/components/index.ts":{"bytesInOutput":0}},"bytes":19489}}}
1
+ {"inputs":{"src/attention.ts":{"bytes":16909,"imports":[{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/components/AttentionGlyph.tsx":{"bytes":11199,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/components/AttentionProvider.tsx":{"bytes":20796,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/attention.ts","kind":"import-statement","original":"../attention"}],"format":"esm"},"src/selection.ts":{"bytes":23013,"imports":[{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"format":"esm"},"src/components/SelectionProvider.tsx":{"bytes":11919,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"src/selection.ts","kind":"import-statement","original":"../selection"}],"format":"esm"},"src/components/index.ts":{"bytes":708,"imports":[{"path":"src/components/AttentionGlyph.tsx","kind":"import-statement","original":"./AttentionGlyph"},{"path":"src/components/AttentionProvider.tsx","kind":"import-statement","original":"./AttentionProvider"},{"path":"src/components/SelectionProvider.tsx","kind":"import-statement","original":"./SelectionProvider"}],"format":"esm"},"src/index.ts":{"bytes":645,"imports":[{"path":"src/attention.ts","kind":"import-statement","original":"./attention"},{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/selection.ts","kind":"import-statement","original":"./selection"}],"format":"esm"},"src/testing/decorators/withAttention.ts":{"bytes":1279,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../../components"}],"format":"esm"},"src/testing/decorators/index.ts":{"bytes":493,"imports":[{"path":"src/testing/decorators/withAttention.ts","kind":"import-statement","original":"./withAttention"}],"format":"esm"},"src/testing/index.ts":{"bytes":471,"imports":[{"path":"src/testing/decorators/index.ts","kind":"import-statement","original":"./decorators"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-NFTXIHW4.mjs","kind":"import-statement"}],"exports":["ATTENABLE_ATTRIBUTE","ATTENDABLE_PATH_SEPARATOR","ATTENTION_NAME","ATTENTION_SOURCE_ATTRIBUTE","AttendableContainer","AttentionGlyph","AttentionManager","AttentionProvider","AttentionSchema","RootAttentionProvider","SelectionManager","SelectionProvider","SelectionSchema","Syncing","defaultSelection","getAttendables","getSelectionSet","useAttended","useAttention","useAttentionAttributes","useAttentionContext","useAttentionPath","useSelected","useSelectionActions","useSelectionManager"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":1207},"dist/lib/node-esm/testing/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":671},"dist/lib/node-esm/testing/index.mjs":{"imports":[{"path":"dist/lib/node-esm/chunk-NFTXIHW4.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true}],"exports":["withAttention"],"entryPoint":"src/testing/index.ts","inputs":{"src/testing/decorators/withAttention.ts":{"bytesInOutput":148},"src/testing/decorators/index.ts":{"bytesInOutput":0},"src/testing/index.ts":{"bytesInOutput":0}},"bytes":412},"dist/lib/node-esm/chunk-NFTXIHW4.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":41250},"dist/lib/node-esm/chunk-NFTXIHW4.mjs":{"imports":[{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@radix-ui/react-primitive","kind":"import-statement","external":true},{"path":"@radix-ui/react-slot","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact/signals-core","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["ATTENABLE_ATTRIBUTE","ATTENDABLE_PATH_SEPARATOR","ATTENTION_NAME","ATTENTION_SOURCE_ATTRIBUTE","AttendableContainer","AttentionGlyph","AttentionManager","AttentionProvider","AttentionSchema","RootAttentionProvider","SelectionManager","SelectionProvider","SelectionSchema","Syncing","defaultSelection","getAttendables","getSelectionSet","useAttended","useAttention","useAttentionAttributes","useAttentionContext","useAttentionPath","useSelected","useSelectionActions","useSelectionManager"],"inputs":{"src/attention.ts":{"bytesInOutput":3752},"src/components/AttentionGlyph.tsx":{"bytesInOutput":3714},"src/components/AttentionProvider.tsx":{"bytesInOutput":3705},"src/selection.ts":{"bytesInOutput":6310},"src/components/SelectionProvider.tsx":{"bytesInOutput":2762},"src/components/index.ts":{"bytesInOutput":0}},"bytes":21068}}}
@@ -1,14 +1,12 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  RootAttentionProvider
4
- } from "../chunk-F2JRKDYV.mjs";
4
+ } from "../chunk-NFTXIHW4.mjs";
5
5
 
6
6
  // src/testing/decorators/withAttention.ts
7
7
  import { createElement } from "react";
8
8
  var withAttention = (Story) => {
9
- return createElement(RootAttentionProvider, {
10
- children: createElement(Story)
11
- });
9
+ return createElement(RootAttentionProvider, {}, createElement(Story));
12
10
  };
13
11
  export {
14
12
  withAttention
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/testing/decorators/withAttention.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport { createElement } from 'react';\n\nimport { RootAttentionProvider } from '../../components';\n\nexport const withAttention: Decorator = (Story) => {\n return createElement(RootAttentionProvider, { children: createElement(Story) });\n};\n"],
5
- "mappings": ";;;;;;AAKA,SAASA,qBAAqB;AAIvB,IAAMC,gBAA2B,CAACC,UAAAA;AACvC,SAAOC,cAAcC,uBAAuB;IAAEC,UAAUF,cAAcD,KAAAA;EAAO,CAAA;AAC/E;",
6
- "names": ["createElement", "withAttention", "Story", "createElement", "RootAttentionProvider", "children"]
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Decorator } from '@storybook/react';\nimport { createElement } from 'react';\n\nimport { RootAttentionProvider } from '../../components';\n\nexport const withAttention: Decorator = (Story) => {\n return createElement(RootAttentionProvider, {}, createElement(Story));\n};\n"],
5
+ "mappings": ";;;;;;AAKA,SAASA,qBAAqB;AAIvB,IAAMC,gBAA2B,CAACC,UAAAA;AACvC,SAAOC,cAAcC,uBAAuB,CAAC,GAAGD,cAAcD,KAAAA,CAAAA;AAChE;",
6
+ "names": ["createElement", "withAttention", "Story", "createElement", "RootAttentionProvider"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"attention.d.ts","sourceRoot":"","sources":["../../../src/attention.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAQ,KAAK,IAAI,EAAE,MAAM,mBAAm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AAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;AAEpF,eAAO,MAAM,cAAc,0GAkB1B,CAAC"}
1
+ {"version":3,"file":"AttentionGlyph.d.ts","sourceRoot":"","sources":["../../../../src/components/AttentionGlyph.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,EAAsB,KAAK,qBAAqB,EAAuB,MAAM,OAAO,CAAC;AAEnG,OAAO,EAAQ,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AA2C5D,eAAO,MAAM,OAAO,yBAmBnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;CACpC,GAAG,eAAe,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;AAEpF,eAAO,MAAM,cAAc,0GAkB1B,CAAC"}
@@ -1,27 +1,16 @@
1
- import '@dxos-theme';
1
+ import { type StoryObj } from '@storybook/react-vite';
2
2
  import React from 'react';
3
3
  import { type AttentionGlyphProps } from './AttentionGlyph';
4
- declare const _default: {
4
+ declare const meta: {
5
5
  title: string;
6
- component: React.ForwardRefExoticComponent<Omit<AttentionGlyphProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
6
+ component: any;
7
7
  render: (props: AttentionGlyphProps) => React.JSX.Element;
8
8
  decorators: import("@storybook/react").Decorator[];
9
9
  };
10
- export default _default;
11
- export declare const Default: {
12
- args: {};
13
- };
14
- export declare const Attention: {
15
- args: {
16
- attended: boolean;
17
- };
18
- };
19
- export declare const Contains: {
20
- args: {
21
- containsAttended: boolean;
22
- };
23
- };
24
- export declare const Syncing: {
25
- render: () => React.JSX.Element;
26
- };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Default: Story;
13
+ export declare const Attention: Story;
14
+ export declare const Contains: Story;
15
+ export declare const Syncing: Story;
27
16
  //# sourceMappingURL=AttentionGlyph.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttentionGlyph.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/AttentionGlyph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAA2C,MAAM,OAAO,CAAC;AAMhE,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;;;;oBAEtD,mBAAmB;;;AAgBzC,wBAKE;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;CAErB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAEpB,CAAC;AAEF,eAAO,MAAM,OAAO;;CAqCnB,CAAC"}
1
+ {"version":3,"file":"AttentionGlyph.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/AttentionGlyph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA2C,MAAM,OAAO,CAAC;AAMhE,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAkB5E,QAAA,MAAM,IAAI;;eAEqB,GAAG;oBAlBL,mBAAmB;;CAqBX,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAEvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAqCrB,CAAC"}
@@ -1,4 +1,4 @@
1
- import React, { type PropsWithChildren, type ComponentPropsWithRef } from 'react';
1
+ import React, { type ComponentPropsWithRef, type PropsWithChildren } from 'react';
2
2
  import { type ThemedClassName } from '@dxos/react-ui';
3
3
  import { type Attention, AttentionManager } from '../attention';
4
4
  declare const ATTENTION_NAME = "Attention";
@@ -12,7 +12,7 @@ declare const useAttentionContext: (consumerName: string) => AttentionContextVal
12
12
  declare const useAttention: (attendableId?: string) => Attention;
13
13
  declare const useAttended: () => import("@dxos/live-object").Live<readonly string[]>;
14
14
  /**
15
- * Computes HTML element attributes to apply so the attention system can detect changes
15
+ * Computes HTML element attributes to apply so the attention system can detect changes.
16
16
  * @param attendableId
17
17
  */
18
18
  declare const useAttentionAttributes: (attendableId?: string) => Record<string, string | undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"AttentionProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/AttentionProvider.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,EAA4B,KAAK,iBAAiB,EAAE,KAAK,qBAAqB,EAAc,MAAM,OAAO,CAAC;AAExH,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGvE,OAAO,EAA6B,KAAK,SAAS,EAAE,gBAAgB,EAAkB,MAAM,cAAc,CAAC;AAE3G,QAAA,MAAM,cAAc,cAAc,CAAC;AACnC,QAAA,MAAM,mBAAmB,uBAAuB,CAAC;AACjD,QAAA,MAAM,0BAA0B,6BAA6B,CAAC;AAE9D,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,QAAA,MAAiC,mBAAmB,iDAGlD,CAAC;AAIH,QAAA,MAAM,YAAY,GAAI,eAAe,MAAM,KAAG,SAQ7C,CAAC;AAEF,QAAA,MAAM,WAAW,2DAGhB,CAAC;AAEF;;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CAAC;AAE9D,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,QAAA,MAAiC,mBAAmB,iDAGlD,CAAC;AAIH,QAAA,MAAM,YAAY,GAAI,eAAe,MAAM,KAAG,SAQ7C,CAAC;AAEF,QAAA,MAAM,WAAW,2DAGhB,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,sBAAsB,GAAI,eAAe,MAAM,uCAUpD,CAAC;AAEF,QAAA,MAAM,gBAAgB,gBAGrB,CAAC;AAEF,QAAA,MAAM,qBAAqB,GAAI,oDAI5B,iBAAiB,CAClB,OAAO,CAAC;IACN,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC5C,CAAC,CACH,sBAmEA,CAAC;AAEF,QAAA,MAAM,iBAAiB,GAAI,kBAAkB,iBAAiB,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,sBAS7E,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,eAAe,CACpD,qBAAqB,CAAC,KAAK,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CACjE,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,mBAAmB,8GAgBxB,CAAC;AAEF,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,0BAA0B,GAC3B,CAAC"}
@@ -1,10 +1,12 @@
1
- import '@dxos-theme';
1
+ import { type StoryObj } from '@storybook/react-vite';
2
2
  import React from 'react';
3
- declare const _default: {
3
+ declare const Story: () => React.JSX.Element;
4
+ declare const meta: {
4
5
  title: string;
5
6
  render: () => React.JSX.Element;
6
7
  decorators: import("@storybook/react").Decorator[];
7
8
  };
8
- export default _default;
9
- export declare const Default: {};
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const Default: Story;
10
12
  //# sourceMappingURL=AttentionProvider.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttentionProvider.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/AttentionProvider.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;AA4B1B,wBAIE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
1
+ {"version":3,"file":"AttentionProvider.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/AttentionProvider.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B,QAAA,MAAM,KAAK,yBASV,CAAC;AAEF,QAAA,MAAM,IAAI;;;;CAIM,CAAC;AAEjB,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React, { type PropsWithChildren } from 'react';
2
- import { SelectionManager, type SelectionResult, type SelectionMode } from '../selection';
2
+ import { SelectionManager, type SelectionMode, type SelectionResult } from '../selection';
3
3
  /**
4
4
  * Manages selection state across the app for multiple contexts.
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/SelectionProvider.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAwB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI5E,OAAO,EAEL,gBAAgB,EAChB,KAAK,eAAe,EAEpB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAYtB;;GAEG;AAEH,eAAO,MAAM,iBAAiB,GAAI,0CAG/B,iBAAiB,CAAC;IAAE,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAC,sBAGrD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,wBAG/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,aAAa,EACjD,YAAY,MAAM,EAClB,OAAM,CAAgB,KACrB,eAAe,CAAC,CAAC,CAanB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,YAAY,MAAM,EAAE,EAAE,OAAM,aAAuB;uBAK9E,MAAM;uBASL,MAAM,EAAE;wBASP,MAAM,MAAM,MAAM;iBASpB,MAAM;;CAed,CAAC"}
1
+ {"version":3,"file":"SelectionProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/SelectionProvider.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAwB,MAAM,OAAO,CAAC;AAI5E,OAAO,EAEL,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,eAAe,EAErB,MAAM,cAAc,CAAC;AAYtB;;GAEG;AAEH,eAAO,MAAM,iBAAiB,GAAI,0CAG/B,iBAAiB,CAAC;IAAE,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAC,sBAGrD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,wBAG/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,aAAa,EACjD,YAAY,MAAM,EAClB,OAAM,CAAgB,KACrB,eAAe,CAAC,CAAC,CAanB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,YAAY,MAAM,EAAE,EAAE,OAAM,aAAuB;uBAK9E,MAAM;uBASL,MAAM,EAAE;wBASP,MAAM,MAAM,MAAM;iBASpB,MAAM;;CAed,CAAC"}