@dxos/react-ui-attention 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/chunk-ViewStateProvider.mjs +308 -0
- package/dist/lib/chunk-ViewStateProvider.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +351 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/index.mjs +149 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/testing.mjs +20 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/types.mjs +2 -0
- package/dist/types/src/components/AttentionProvider/AttentionProvider.d.ts +2 -15
- package/dist/types/src/components/AttentionProvider/AttentionProvider.d.ts.map +1 -1
- package/dist/types/src/components/AttentionProvider/attention-context.d.ts +20 -0
- package/dist/types/src/components/AttentionProvider/attention-context.d.ts.map +1 -0
- package/dist/types/src/components/AttentionProvider/index.d.ts +1 -0
- package/dist/types/src/components/AttentionProvider/index.d.ts.map +1 -1
- package/dist/types/src/components/ViewStateProvider/ViewStateProvider.d.ts +2 -26
- package/dist/types/src/components/ViewStateProvider/ViewStateProvider.d.ts.map +1 -1
- package/dist/types/src/components/ViewStateProvider/index.d.ts +1 -0
- package/dist/types/src/components/ViewStateProvider/index.d.ts.map +1 -1
- package/dist/types/src/components/ViewStateProvider/view-state-hooks.d.ts +32 -0
- package/dist/types/src/components/ViewStateProvider/view-state-hooks.d.ts.map +1 -0
- package/dist/types/src/core/backends.d.ts +24 -0
- package/dist/types/src/core/backends.d.ts.map +1 -0
- package/dist/types/src/core/backends.test.d.ts.map +1 -0
- package/dist/types/src/core/index.d.ts +2 -0
- package/dist/types/src/core/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useArticleKeyboardNavigation.d.ts.map +1 -0
- package/dist/types/src/hooks/useArticleKeyboardNavigation.test.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/{attention.d.ts → types/Attention.d.ts} +13 -2
- package/dist/types/src/types/Attention.d.ts.map +1 -0
- package/dist/types/src/types/Attention.test.d.ts +2 -0
- package/dist/types/src/types/Attention.test.d.ts.map +1 -0
- package/dist/types/src/{selection.d.ts → types/Selection.d.ts} +12 -10
- package/dist/types/src/types/Selection.d.ts.map +1 -0
- package/dist/types/src/types/Selection.test.d.ts +2 -0
- package/dist/types/src/types/Selection.test.d.ts.map +1 -0
- package/dist/types/src/types/ViewState.d.ts +66 -0
- package/dist/types/src/types/ViewState.d.ts.map +1 -0
- package/dist/types/src/types/ViewState.test.d.ts +2 -0
- package/dist/types/src/types/ViewState.test.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -20
- package/src/components/AttentionProvider/AttentionProvider.stories.tsx +1 -1
- package/src/components/AttentionProvider/AttentionProvider.tsx +4 -86
- package/src/components/AttentionProvider/attention-context.ts +81 -0
- package/src/components/AttentionProvider/index.ts +2 -0
- package/src/components/ViewStateProvider/ViewStateProvider.test.tsx +7 -5
- package/src/components/ViewStateProvider/ViewStateProvider.tsx +6 -110
- package/src/components/ViewStateProvider/index.ts +9 -0
- package/src/components/ViewStateProvider/view-state-hooks.ts +115 -0
- package/src/{view-state → core}/backends.test.ts +5 -5
- package/src/{view-state → core}/backends.ts +24 -17
- package/src/{view-state → core}/index.ts +0 -1
- package/src/hooks/index.ts +5 -0
- package/src/{useArticleKeyboardNavigation.ts → hooks/useArticleKeyboardNavigation.ts} +1 -1
- package/src/index.ts +3 -4
- package/src/testing/decorators/withAttention.ts +2 -2
- package/src/{attention.test.ts → types/Attention.test.ts} +2 -2
- package/src/{attention.ts → types/Attention.ts} +17 -2
- package/src/types/Selection.test.ts +100 -0
- package/src/{selection.ts → types/Selection.ts} +27 -17
- package/src/{view-state/view-state.test.ts → types/ViewState.test.ts} +6 -6
- package/src/types/ViewState.ts +101 -0
- package/src/types/index.ts +8 -7
- package/dist/lib/browser/chunk-4HYAJ4IO.mjs +0 -434
- package/dist/lib/browser/chunk-4HYAJ4IO.mjs.map +0 -7
- package/dist/lib/browser/chunk-I4FDY4AZ.mjs +0 -236
- package/dist/lib/browser/chunk-I4FDY4AZ.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -218
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/testing/index.mjs +0 -30
- package/dist/lib/browser/testing/index.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -43
- package/dist/lib/browser/types/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DLBZMHST.mjs +0 -237
- package/dist/lib/node-esm/chunk-DLBZMHST.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HWN7KJDX.mjs +0 -436
- package/dist/lib/node-esm/chunk-HWN7KJDX.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -219
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/testing/index.mjs +0 -31
- package/dist/lib/node-esm/testing/index.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -44
- package/dist/lib/node-esm/types/index.mjs.map +0 -7
- package/dist/types/src/attention.d.ts.map +0 -1
- package/dist/types/src/attention.test.d.ts +0 -2
- package/dist/types/src/attention.test.d.ts.map +0 -1
- package/dist/types/src/selection.d.ts.map +0 -1
- package/dist/types/src/selection.test.d.ts +0 -2
- package/dist/types/src/selection.test.d.ts.map +0 -1
- package/dist/types/src/useArticleKeyboardNavigation.d.ts.map +0 -1
- package/dist/types/src/useArticleKeyboardNavigation.test.d.ts.map +0 -1
- package/dist/types/src/view-state/backends.d.ts +0 -24
- package/dist/types/src/view-state/backends.d.ts.map +0 -1
- package/dist/types/src/view-state/backends.test.d.ts.map +0 -1
- package/dist/types/src/view-state/index.d.ts +0 -3
- package/dist/types/src/view-state/index.d.ts.map +0 -1
- package/dist/types/src/view-state/view-state.d.ts +0 -54
- package/dist/types/src/view-state/view-state.d.ts.map +0 -1
- package/dist/types/src/view-state/view-state.test.d.ts +0 -2
- package/dist/types/src/view-state/view-state.test.d.ts.map +0 -1
- package/src/selection.test.ts +0 -67
- package/src/view-state/view-state.ts +0 -91
- /package/dist/types/src/{view-state → core}/backends.test.d.ts +0 -0
- /package/dist/types/src/{useArticleKeyboardNavigation.d.ts → hooks/useArticleKeyboardNavigation.d.ts} +0 -0
- /package/dist/types/src/{useArticleKeyboardNavigation.test.d.ts → hooks/useArticleKeyboardNavigation.test.d.ts} +0 -0
- /package/src/{useArticleKeyboardNavigation.test.ts → hooks/useArticleKeyboardNavigation.test.ts} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Attention, AttentionManager } from '../../types/Attention';
|
|
2
|
+
export declare const ATTENTION_NAME = "Attention";
|
|
3
|
+
export declare const ATTENTION_SOURCE_ATTRIBUTE = "data-w-attention-source";
|
|
4
|
+
export type AttentionContextValue = {
|
|
5
|
+
attention: AttentionManager;
|
|
6
|
+
};
|
|
7
|
+
export declare const AttentionContextProvider: import("react").FC<AttentionContextValue & {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}>, useAttentionContext: (consumerName: string) => AttentionContextValue;
|
|
10
|
+
export declare const UNKNOWN_ATTENDABLE: Attention;
|
|
11
|
+
/**
|
|
12
|
+
* Subscribe to the attention state for a qualified graph ID.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useAttention: (attendableId?: string) => Attention;
|
|
15
|
+
export declare const useAttended: () => readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* Computes HTML element attributes to apply so the attention system can detect changes.
|
|
18
|
+
*/
|
|
19
|
+
export declare const useAttentionAttributes: (attendableId?: string) => Record<string, string | undefined>;
|
|
20
|
+
//# sourceMappingURL=attention-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attention-context.d.ts","sourceRoot":"","sources":["../../../../../src/components/AttentionProvider/attention-context.ts"],"names":[],"mappings":"AAOA,OAAO,EAAwB,KAAK,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK/F,eAAO,MAAM,cAAc,cAAc,CAAC;AAC1C,eAAO,MAAM,0BAA0B,4BAA4B,CAAC;AAEpE,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAO,wBAAwB;;IAAE,mBAAmB,iDAEzD,CAAC;AAEH,eAAO,MAAM,kBAAkB,EAAmE,SAAS,CAAC;AAE5G;;GAEG;AAEH,eAAO,MAAM,YAAY,kBAAmB,MAAM,KAAG,SAkBpD,CAAC;AAEF,eAAO,MAAM,WAAW,yBAgBvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,kBAAmB,MAAM,uCAU3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/AttentionProvider/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/AttentionProvider/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE7G,cAAc,qBAAqB,CAAC"}
|
|
@@ -1,31 +1,7 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { type AspectDef, ViewStateManager } from '../../view-state';
|
|
2
|
+
import { ViewState } from '../../types';
|
|
4
3
|
/** Provides the per-context UI state manager. Replaces the former `SelectionProvider`. */
|
|
5
4
|
export declare const ViewStateProvider: ({ children, manager: managerProp, }: PropsWithChildren<{
|
|
6
|
-
manager?:
|
|
5
|
+
manager?: ViewState.Manager;
|
|
7
6
|
}>) => React.JSX.Element;
|
|
8
|
-
/** Access the underlying ViewStateManager from context. Throws when used outside a `ViewStateProvider`. */
|
|
9
|
-
export declare const useViewStateManager: () => ViewStateManager;
|
|
10
|
-
/** Access the ViewStateManager if a provider is present; `undefined` otherwise (e.g. isolated stories/tests). */
|
|
11
|
-
export declare const useViewStateManagerOptional: () => ViewStateManager | undefined;
|
|
12
|
-
/** Reactive read of an aspect value for a context; yields the aspect default when unset or unprovided. */
|
|
13
|
-
export declare const useViewState: <T>(aspect: AspectDef<T>, contextId?: string) => T;
|
|
14
|
-
export type UseViewStateActions<T> = {
|
|
15
|
-
set: (value: T) => void;
|
|
16
|
-
update: (fn: (prev: T) => T) => void;
|
|
17
|
-
clear: () => void;
|
|
18
|
-
};
|
|
19
|
-
export declare const useViewStateActions: <T>(aspect: AspectDef<T>, contextId?: string) => UseViewStateActions<T>;
|
|
20
|
-
/** Resolved selection value for `contextId` in the requested `mode` (default `multi`). */
|
|
21
|
-
export declare const useSelection: <T extends SelectionMode>(contextId?: string, mode?: T) => SelectionResult<T>;
|
|
22
|
-
export type UseSelectionActions = {
|
|
23
|
-
single: (id: string) => void;
|
|
24
|
-
multi: (ids: string[]) => void;
|
|
25
|
-
range: (from: string, to: string) => void;
|
|
26
|
-
toggle: (id: string) => void;
|
|
27
|
-
clear: () => void;
|
|
28
|
-
};
|
|
29
|
-
/** Selection mutators for a single context, built on the generic ViewState actions. */
|
|
30
|
-
export declare const useSelectionActions: (contextId?: string) => UseSelectionActions;
|
|
31
7
|
//# sourceMappingURL=ViewStateProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewStateProvider.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewStateProvider/ViewStateProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewStateProvider.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewStateProvider/ViewStateProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAKlE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,0FAA0F;AAC1F,eAAO,MAAM,iBAAiB,wCAG3B,iBAAiB,CAAC;IAAE,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO,CAAA;CAAE,CAAC,sBAOpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewStateProvider/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewStateProvider/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Selection, ViewState } from '../../types';
|
|
2
|
+
export declare const VIEW_STATE_NAME = "ViewState";
|
|
3
|
+
export type ViewStateContextValue = {
|
|
4
|
+
manager?: ViewState.Manager;
|
|
5
|
+
};
|
|
6
|
+
export declare const ViewStateContextProvider: import("react").FC<ViewStateContextValue & {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}>, useViewStateContext: (consumerName: string) => ViewStateContextValue;
|
|
9
|
+
/** Access the underlying Manager from context. Throws when used outside a `ViewStateProvider`. */
|
|
10
|
+
export declare const useManager: () => ViewState.Manager;
|
|
11
|
+
/** Access the Manager if a provider is present; `undefined` otherwise (e.g. isolated stories/tests). */
|
|
12
|
+
export declare const useManagerOptional: () => ViewState.Manager | undefined;
|
|
13
|
+
/** Reactive read of an aspect value for a context; yields the aspect default when unset or unprovided. */
|
|
14
|
+
export declare const useViewState: <T, Encoded = T>(aspect: ViewState.Aspect<T, Encoded>, contextId?: string) => T;
|
|
15
|
+
export type UseViewStateActions<T> = {
|
|
16
|
+
set: (value: T) => void;
|
|
17
|
+
update: (fn: (prev: T) => T) => void;
|
|
18
|
+
clear: () => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const useViewStateActions: <T, Encoded = T>(aspect: ViewState.Aspect<T, Encoded>, contextId?: string) => UseViewStateActions<T>;
|
|
21
|
+
/** Resolved selection value for `contextId` in the requested `mode` (default `multi`). */
|
|
22
|
+
export declare const useSelection: <T extends Selection.SelectionMode>(contextId?: string, mode?: T) => Selection.Result<T>;
|
|
23
|
+
export type UseSelectionActions = {
|
|
24
|
+
single: (id: string) => void;
|
|
25
|
+
multi: (ids: string[]) => void;
|
|
26
|
+
range: (from: string, to: string) => void;
|
|
27
|
+
toggle: (id: string) => void;
|
|
28
|
+
clear: () => void;
|
|
29
|
+
};
|
|
30
|
+
/** Selection mutators for a single context, built on the generic ViewState actions. */
|
|
31
|
+
export declare const useSelectionActions: (contextId?: string) => UseSelectionActions;
|
|
32
|
+
//# sourceMappingURL=view-state-hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-state-hooks.d.ts","sourceRoot":"","sources":["../../../../../src/components/ViewStateProvider/view-state-hooks.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAKnD,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,MAAM,MAAM,qBAAqB,GAAG;IAAE,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO,CAAA;CAAE,CAAC;AAIpE,eAAO,MAAO,wBAAwB;;IAAE,mBAAmB,iDAEzD,CAAC;AAEH,kGAAkG;AAClG,eAAO,MAAM,UAAU,QAAO,SAAS,CAAC,OAIvC,CAAC;AAEF,wGA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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Atom, type Registry } from '@effect-atom/atom';
|
|
2
|
+
import { ViewState } from '../types';
|
|
3
|
+
/** In-memory backend: state is ephemeral and scoped to the session (never persisted). */
|
|
4
|
+
export declare class MemoryBackend implements ViewState.Backend {
|
|
5
|
+
#private;
|
|
6
|
+
atom<T, Encoded>(aspect: ViewState.Aspect<T, Encoded>, contextId: string): Atom.Writable<T>;
|
|
7
|
+
contexts<T, Encoded>(aspect: ViewState.Aspect<T, Encoded>): string[];
|
|
8
|
+
}
|
|
9
|
+
export interface LocalBackendOptions {
|
|
10
|
+
readonly registry: Registry.Registry;
|
|
11
|
+
/** Injectable for tests; defaults to `window.localStorage`. */
|
|
12
|
+
readonly storage?: Storage;
|
|
13
|
+
}
|
|
14
|
+
/** localStorage-backed backend: seeds atoms from storage, persists on set, syncs across tabs. */
|
|
15
|
+
export declare class LocalBackend implements ViewState.Backend {
|
|
16
|
+
#private;
|
|
17
|
+
constructor({ registry, storage }: LocalBackendOptions);
|
|
18
|
+
atom<T, Encoded>(aspect: ViewState.Aspect<T, Encoded>, contextId: string): Atom.Writable<T>;
|
|
19
|
+
persist<T, Encoded>(aspect: ViewState.Aspect<T, Encoded>, contextId: string, value: T): void;
|
|
20
|
+
contexts<T, Encoded>(aspect: ViewState.Aspect<T, Encoded>): string[];
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
23
|
+
export declare const createDefaultBackends: (registry: Registry.Registry) => Record<ViewState.BackendName, ViewState.Backend>;
|
|
24
|
+
//# sourceMappingURL=backends.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backends.d.ts","sourceRoot":"","sources":["../../../../src/core/backends.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAKrC,yFAAyF;AACzF,qBA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AS,CAAC,OAAO,CAGhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backends.test.d.ts","sourceRoot":"","sources":["../../../../src/core/backends.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useArticleKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useArticleKeyboardNavigation.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,+BAIjB;IACD,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACf,KAAG,MAAM,GAAG,SAYZ,CAAC;AAEF,MAAM,MAAM,mCAAmC,CAAC,CAAC,IAAI;IACnD,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IACpB,qCAAqC;IACrC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,EAAE;IACzC,CAAC,CAAC,SAAS;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,EAAE,mCAAmC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAClF,CAAC,CAAC,EAAE,OAAO,EAAE,mCAAmC,CAAC,CAAC,CAAC,GAAG;QAAE,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAqD7F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useArticleKeyboardNavigation.test.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useArticleKeyboardNavigation.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export * from './attention';
|
|
2
1
|
export * from './components';
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
2
|
+
export * from './core';
|
|
3
|
+
export * from './hooks';
|
|
4
|
+
export * from './types';
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Atom, type Registry } from '@effect-atom/atom
|
|
1
|
+
import { Atom, type Registry } from '@effect-atom/atom';
|
|
2
2
|
export type Attention = {
|
|
3
3
|
hasAttention: boolean;
|
|
4
4
|
isAncestor: boolean;
|
|
@@ -40,11 +40,22 @@ export declare class AttentionManager {
|
|
|
40
40
|
private _getAtom;
|
|
41
41
|
private _set;
|
|
42
42
|
}
|
|
43
|
+
/** The attribute marking an element as attendable, carrying its qualified id. */
|
|
44
|
+
export declare const ATTENDABLE_ATTRIBUTE = "data-attendable-id";
|
|
45
|
+
/** Selector matching any attendable element. */
|
|
46
|
+
export declare const ATTENDABLE_SELECTOR = "[data-attendable-id]";
|
|
43
47
|
/**
|
|
44
48
|
* Accumulates all attendable IDs between the element provided and the root, inclusive.
|
|
45
49
|
* Each `data-attendable-id` value is treated as a single qualified ID (no splitting).
|
|
46
50
|
*/
|
|
47
51
|
export declare const getAttendables: (selector: string, cursor: Element, acc?: string[]) => string[];
|
|
52
|
+
/**
|
|
53
|
+
* The outermost attendable ancestor of `element` — the root of any nested attendables (e.g. a section
|
|
54
|
+
* within a stack). Structural (real DOM ancestry), so it is independent of what currently has attention.
|
|
55
|
+
* Resolve it from an in-DOM element: a portaled subtree (a menu, a popover) is not under its own
|
|
56
|
+
* attendable, so walk from the trigger or anchor instead.
|
|
57
|
+
*/
|
|
58
|
+
export declare const getRootAttendableId: (element: Element) => string | undefined;
|
|
48
59
|
export type AttendableId = {
|
|
49
60
|
attendableId?: string;
|
|
50
61
|
};
|
|
@@ -80,4 +91,4 @@ export declare const getParentId: (qualifiedId: string | undefined) => string |
|
|
|
80
91
|
* Extract the segment ID (last segment) of a qualified ID.
|
|
81
92
|
*/
|
|
82
93
|
export declare const getSegmentId: (qualifiedId: string) => string;
|
|
83
|
-
//# sourceMappingURL=
|
|
94
|
+
//# sourceMappingURL=Attention.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Attention.d.ts","sourceRoot":"","sources":["../../../../src/types/Attention.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,MAAM,SAAS,GAAG;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,qBAAa,gBAAgB;IAKzB,OAAO,CAAC,QAAQ,CAAC,SAAS;I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iB,MAAM,KAAG,MAAM,EAG9D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,gBAAiB,MAAM,KAAG,OAGrD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,YAAa,MAAM,KAAG,MAAsC,CAAC;AAEvF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,gBAAiB,MAAM,KAAG,MAGtD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,gBAAiB,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,SAOtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,gBAAiB,MAAM,KAAG,MAElD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Attention.test.d.ts","sourceRoot":"","sources":["../../../../src/types/Attention.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Schema from 'effect/Schema';
|
|
2
|
-
import { type
|
|
2
|
+
import { type Aspect, type Manager } from './ViewState';
|
|
3
3
|
export type SelectionMode = 'single' | 'multi' | 'range' | 'multi-range';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const Selection: Schema.mutable<Schema.Union<[Schema.mutable<Schema.Struct<{
|
|
5
5
|
mode: Schema.Literal<["single"]>;
|
|
6
6
|
id: Schema.optional<typeof Schema.String>;
|
|
7
7
|
}>>, Schema.mutable<Schema.Struct<{
|
|
@@ -18,8 +18,8 @@ export declare const SelectionSchema: Schema.mutable<Schema.Union<[Schema.mutabl
|
|
|
18
18
|
to: typeof Schema.String;
|
|
19
19
|
}>>>;
|
|
20
20
|
}>>]>>;
|
|
21
|
-
export type Selection = Schema.Schema.Type<typeof
|
|
22
|
-
export declare const
|
|
21
|
+
export type Selection = Schema.Schema.Type<typeof Selection>;
|
|
22
|
+
export declare const defaultValue: (u: SelectionMode) => {
|
|
23
23
|
mode: "single";
|
|
24
24
|
} | {
|
|
25
25
|
mode: "multi";
|
|
@@ -30,7 +30,7 @@ export declare const defaultSelection: (u: SelectionMode) => {
|
|
|
30
30
|
mode: "multi-range";
|
|
31
31
|
ranges: never[];
|
|
32
32
|
};
|
|
33
|
-
export type
|
|
33
|
+
export type Result<T extends SelectionMode> = T extends 'single' ? string | undefined : T extends 'multi' ? string[] : T extends 'range' ? {
|
|
34
34
|
from: string;
|
|
35
35
|
to: string;
|
|
36
36
|
} | undefined : T extends 'multi-range' ? {
|
|
@@ -38,14 +38,16 @@ export type SelectionResult<T extends SelectionMode> = T extends 'single' ? stri
|
|
|
38
38
|
to: string;
|
|
39
39
|
}[] : never;
|
|
40
40
|
/** Selection state for a context, stored in memory (ephemeral, per-device session). */
|
|
41
|
-
export declare const
|
|
41
|
+
export declare const aspect: Aspect<Selection>;
|
|
42
42
|
/**
|
|
43
43
|
* Extract the typed result for `mode` from a stored selection value, returning the requested
|
|
44
44
|
* mode's default when the stored value is absent or holds a different mode.
|
|
45
45
|
*/
|
|
46
|
-
export declare const
|
|
46
|
+
export declare const resolve: <T extends SelectionMode>(selection: Selection | undefined, mode: T) => Result<T>;
|
|
47
47
|
/** Toggle `id` within a multi selection; resets to a multi selection if the current value differs. */
|
|
48
|
-
export declare const
|
|
48
|
+
export declare const toggle: (selection: Selection | undefined, id: string) => Selection;
|
|
49
|
+
/** Anchor strings for a selection: ids for single/multi modes, `"${from}:${to}"` cursor pairs for range modes. */
|
|
50
|
+
export declare const toAnchors: (selection: Selection | undefined) => string[];
|
|
49
51
|
/** Union of all multi-selected ids across every selection context, plus an optional explicit id. */
|
|
50
|
-
export declare const
|
|
51
|
-
//# sourceMappingURL=
|
|
52
|
+
export declare const getValue: (manager: Manager, contextId?: string) => Set<string>;
|
|
53
|
+
//# sourceMappingURL=Selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Selection.d.ts","sourceRoot":"","sources":["../../../../src/types/Selection.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;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 @@
|
|
|
1
|
+
{"version":3,"file":"Selection.test.d.ts","sourceRoot":"","sources":["../../../../src/types/Selection.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type Atom, type Registry } from '@effect-atom/atom';
|
|
2
|
+
import type * as Schema from 'effect/Schema';
|
|
3
|
+
/**
|
|
4
|
+
* Persistence backend identifier. `personal` (ECHO/personal-space) is reserved for a future backend.
|
|
5
|
+
*/
|
|
6
|
+
export type BackendName = 'memory' | 'local';
|
|
7
|
+
/**
|
|
8
|
+
* Declares a kind of per-context UI state. The value type `T` and its persisted wire type `Encoded`
|
|
9
|
+
* are inferred from the schema; `Encoded` defaults to `T` for the common no-transform case.
|
|
10
|
+
*/
|
|
11
|
+
export interface Aspect<T, Encoded = T> {
|
|
12
|
+
readonly key: string;
|
|
13
|
+
readonly backend: BackendName;
|
|
14
|
+
readonly schema: Schema.Schema<T, Encoded>;
|
|
15
|
+
readonly defaultValue: () => T;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Identity helper that pins the value type from the schema while keeping the literal `key`/`backend`.
|
|
19
|
+
* Declares an aspect of per-context UI state (selection, scroll, view mode, split) read/written via
|
|
20
|
+
* {@link Manager} — through `useViewState`/`useViewStateActions` in React or the
|
|
21
|
+
* `AttentionCapabilities.ViewState` capability in operations. Durability is the `backend`'s: `local`
|
|
22
|
+
* survives reloads (best-effort — degrades to in-memory when storage is blocked), `memory` is
|
|
23
|
+
* session-only.
|
|
24
|
+
*
|
|
25
|
+
* @idiom org.dxos.react-ui-attention.viewState
|
|
26
|
+
* applies: Holding per-context UI state (selection, view mode, scroll, split) that survives navigation (and reloads with the `local` backend)
|
|
27
|
+
* instead-of: ad-hoc `useState` that resets on remount, or stuffing per-context state into the plugin Settings store
|
|
28
|
+
* uses: {@link define}, {@link Manager}
|
|
29
|
+
* related: org.dxos.effect.kvsStore
|
|
30
|
+
*/
|
|
31
|
+
export declare const define: <T, Encoded = T>(def: Aspect<T, Encoded>) => Aspect<T, Encoded>;
|
|
32
|
+
/**
|
|
33
|
+
* A backend produces a reactive, writable atom for each `(aspect, contextId)` pair. Backends may
|
|
34
|
+
* hydrate asynchronously (an ECHO backend would), yielding `aspect.defaultValue()` until loaded;
|
|
35
|
+
* the memory and local backends resolve synchronously.
|
|
36
|
+
*/
|
|
37
|
+
export interface Backend {
|
|
38
|
+
/** Stable atom for the pair; created (and seeded) on first access, cached thereafter. */
|
|
39
|
+
atom: <T, Encoded>(aspect: Aspect<T, Encoded>, contextId: string) => Atom.Writable<T>;
|
|
40
|
+
/** Persist a value after the atom is updated. No-op for in-memory backends. */
|
|
41
|
+
persist?: <T, Encoded>(aspect: Aspect<T, Encoded>, contextId: string, value: T) => void;
|
|
42
|
+
/** Context ids that currently hold a value for the aspect. */
|
|
43
|
+
contexts: <T, Encoded>(aspect: Aspect<T, Encoded>) => string[];
|
|
44
|
+
/** Release listeners/timers (used by tests; app-lifetime managers do not call this). */
|
|
45
|
+
dispose?: () => void;
|
|
46
|
+
}
|
|
47
|
+
export interface ManagerOptions {
|
|
48
|
+
readonly registry: Registry.Registry;
|
|
49
|
+
readonly backends: Record<BackendName, Backend>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Routes per-context UI state to the backend declared by each aspect. Reads/writes go through the
|
|
53
|
+
* effect-atom registry so React hooks and graph atoms observe changes uniformly.
|
|
54
|
+
*/
|
|
55
|
+
export declare class Manager {
|
|
56
|
+
#private;
|
|
57
|
+
constructor({ registry, backends }: ManagerOptions);
|
|
58
|
+
/** Reactive atom for `(aspect, contextId)`; pass to `registry.get` inside derived atoms/hooks. */
|
|
59
|
+
atom<T, Encoded>(aspect: Aspect<T, Encoded>, contextId: string): Atom.Writable<T>;
|
|
60
|
+
get<T, Encoded>(aspect: Aspect<T, Encoded>, contextId: string): T;
|
|
61
|
+
set<T, Encoded>(aspect: Aspect<T, Encoded>, contextId: string, value: T): void;
|
|
62
|
+
update<T, Encoded>(aspect: Aspect<T, Encoded>, contextId: string, fn: (prev: T) => T): void;
|
|
63
|
+
subscribe<T, Encoded>(aspect: Aspect<T, Encoded>, contextId: string, cb: (value: T) => void): () => void;
|
|
64
|
+
contexts<T, Encoded>(aspect: Aspect<T, Encoded>): string[];
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=ViewState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewState.d.ts","sourceRoot":"","sources":["../../../../src/types/ViewState.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC;IACpC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;CAChC;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,OAAO,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,KAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAQ,CAAC;AAE3F;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,yFAAyF;IACzF,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC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AE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,CAE1F;IAED,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAGvG;IAED,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAEzD;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewState.test.d.ts","sourceRoot":"","sources":["../../../../src/types/ViewState.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
1
|
+
export * as Attention from './Attention';
|
|
2
|
+
export * as Selection from './Selection';
|
|
3
|
+
export * as ViewState from './ViewState';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC"}
|