@equinor/fusion-framework-module-bookmark 4.1.0 → 4.1.1
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/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +13 -10
- package/CHANGELOG.md +0 -821
- package/src/BookmarkClient.interface.ts +0 -157
- package/src/BookmarkClient.ts +0 -290
- package/src/BookmarkFlowError.ts +0 -38
- package/src/BookmarkModuleConfigurator.ts +0 -412
- package/src/BookmarkProvider.events.ts +0 -87
- package/src/BookmarkProvider.interface.ts +0 -180
- package/src/BookmarkProvider.selectors.ts +0 -69
- package/src/BookmarkProvider.ts +0 -1549
- package/src/BookmarkProviderError.ts +0 -19
- package/src/__tests__/mock/bookmark-mock.test.ts +0 -199
- package/src/bookmark-actions.ts +0 -132
- package/src/bookmark-config.schema.ts +0 -55
- package/src/bookmark-flows/bookmark-api-flows.ts +0 -45
- package/src/bookmark-flows/handle-add-bookmark-as-favorite.ts +0 -49
- package/src/bookmark-flows/handle-create-bookmark.ts +0 -47
- package/src/bookmark-flows/handle-delete-bookmark.ts +0 -47
- package/src/bookmark-flows/handle-fetch-all-bookmark.ts +0 -53
- package/src/bookmark-flows/handle-fetch-bookmark-data.ts +0 -58
- package/src/bookmark-flows/handle-fetch-bookmark.ts +0 -64
- package/src/bookmark-flows/handle-remove-bookmark-from-favorites.ts +0 -49
- package/src/bookmark-flows/handle-remove-bookmark.ts +0 -76
- package/src/bookmark-flows/handle-update-bookmark.ts +0 -48
- package/src/bookmark-flows/index.ts +0 -10
- package/src/bookmark-module.ts +0 -98
- package/src/bookmark.schemas.ts +0 -81
- package/src/create-bookmark-reducer.ts +0 -149
- package/src/create-bookmark-store.ts +0 -61
- package/src/enable-bookmark.ts +0 -44
- package/src/index.ts +0 -43
- package/src/mock/BookmarkMockClient.ts +0 -310
- package/src/mock/BookmarkMockConfigurator.ts +0 -159
- package/src/mock/index.ts +0 -25
- package/src/mock/module.ts +0 -64
- package/src/types.ts +0 -121
- package/src/version.ts +0 -2
- package/tsconfig.json +0 -30
- package/vitest.config.ts +0 -11
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { BookmarkFlowError } from './BookmarkFlowError';
|
|
2
|
-
import type { BookmarkState } from './create-bookmark-store';
|
|
3
|
-
import type { Bookmark, BookmarkData } from './types';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Selects all bookmarks from the store state as an array.
|
|
7
|
-
*
|
|
8
|
-
* @param state - The current bookmark store state.
|
|
9
|
-
* @returns An array of all bookmarks.
|
|
10
|
-
*/
|
|
11
|
-
export const bookmarksSelector = (state: BookmarkState): Bookmark[] => {
|
|
12
|
-
return Object.values(state.bookmarks) as Bookmark[];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Retrieves a single bookmark from the store state by its ID.
|
|
17
|
-
*
|
|
18
|
-
* @template T - The bookmark payload data shape.
|
|
19
|
-
* @param state - The current bookmark store state.
|
|
20
|
-
* @param id - The bookmark identifier to look up.
|
|
21
|
-
* @returns The matching bookmark, or `undefined` if not found.
|
|
22
|
-
*/
|
|
23
|
-
// tightly coupled group of store selectors
|
|
24
|
-
// fusion-lint-disable-next-line single-export-per-file
|
|
25
|
-
export const bookmarkSelector = <T extends BookmarkData>(
|
|
26
|
-
state: BookmarkState,
|
|
27
|
-
id: string,
|
|
28
|
-
): Bookmark<T> | undefined => {
|
|
29
|
-
return state.bookmarks[id] as Bookmark<T>;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Selects the currently active bookmark from the store state.
|
|
34
|
-
*
|
|
35
|
-
* @template T - The bookmark payload data shape.
|
|
36
|
-
* @param state - The current bookmark store state.
|
|
37
|
-
* @returns The active bookmark, `null` if explicitly cleared, or `undefined` if never set.
|
|
38
|
-
*/
|
|
39
|
-
// tightly coupled group of store selectors
|
|
40
|
-
// fusion-lint-disable-next-line single-export-per-file
|
|
41
|
-
export const activeBookmarkSelector = <T extends BookmarkData>(
|
|
42
|
-
state: BookmarkState,
|
|
43
|
-
): Bookmark<T> | null | undefined => {
|
|
44
|
-
return state.currentBookmark as Bookmark<T> | null | undefined;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Selects the status from the bookmark state.
|
|
49
|
-
*
|
|
50
|
-
* @param state - The bookmark state.
|
|
51
|
-
* @returns The status from the bookmark state.
|
|
52
|
-
*/
|
|
53
|
-
// tightly coupled group of store selectors
|
|
54
|
-
// fusion-lint-disable-next-line single-export-per-file
|
|
55
|
-
export const statusSelector = (state: BookmarkState): BookmarkState['status'] => {
|
|
56
|
-
return state.status;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Selects and returns an array of bookmark flow errors from the state.
|
|
61
|
-
*
|
|
62
|
-
* @param state - The bookmark state.
|
|
63
|
-
* @returns An array of bookmark flow errors.
|
|
64
|
-
*/
|
|
65
|
-
// tightly coupled group of store selectors
|
|
66
|
-
// fusion-lint-disable-next-line single-export-per-file
|
|
67
|
-
export const errorsSelector = (state: BookmarkState): Array<BookmarkFlowError> => {
|
|
68
|
-
return Object.values(state.errors);
|
|
69
|
-
};
|