@equinor/fusion-framework-module-bookmark 4.1.0 → 4.1.2

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 (48) hide show
  1. package/dist/esm/BookmarkProvider.js +10 -5
  2. package/dist/esm/BookmarkProvider.js.map +1 -1
  3. package/dist/esm/__tests__/BookmarkProvider.test.js +34 -0
  4. package/dist/esm/__tests__/BookmarkProvider.test.js.map +1 -0
  5. package/dist/esm/version.js +1 -1
  6. package/dist/tsconfig.tsbuildinfo +1 -1
  7. package/dist/types/BookmarkProvider.d.ts +5 -2
  8. package/dist/types/__tests__/BookmarkProvider.test.d.ts +1 -0
  9. package/dist/types/version.d.ts +1 -1
  10. package/package.json +13 -10
  11. package/CHANGELOG.md +0 -821
  12. package/src/BookmarkClient.interface.ts +0 -157
  13. package/src/BookmarkClient.ts +0 -290
  14. package/src/BookmarkFlowError.ts +0 -38
  15. package/src/BookmarkModuleConfigurator.ts +0 -412
  16. package/src/BookmarkProvider.events.ts +0 -87
  17. package/src/BookmarkProvider.interface.ts +0 -180
  18. package/src/BookmarkProvider.selectors.ts +0 -69
  19. package/src/BookmarkProvider.ts +0 -1549
  20. package/src/BookmarkProviderError.ts +0 -19
  21. package/src/__tests__/mock/bookmark-mock.test.ts +0 -199
  22. package/src/bookmark-actions.ts +0 -132
  23. package/src/bookmark-config.schema.ts +0 -55
  24. package/src/bookmark-flows/bookmark-api-flows.ts +0 -45
  25. package/src/bookmark-flows/handle-add-bookmark-as-favorite.ts +0 -49
  26. package/src/bookmark-flows/handle-create-bookmark.ts +0 -47
  27. package/src/bookmark-flows/handle-delete-bookmark.ts +0 -47
  28. package/src/bookmark-flows/handle-fetch-all-bookmark.ts +0 -53
  29. package/src/bookmark-flows/handle-fetch-bookmark-data.ts +0 -58
  30. package/src/bookmark-flows/handle-fetch-bookmark.ts +0 -64
  31. package/src/bookmark-flows/handle-remove-bookmark-from-favorites.ts +0 -49
  32. package/src/bookmark-flows/handle-remove-bookmark.ts +0 -76
  33. package/src/bookmark-flows/handle-update-bookmark.ts +0 -48
  34. package/src/bookmark-flows/index.ts +0 -10
  35. package/src/bookmark-module.ts +0 -98
  36. package/src/bookmark.schemas.ts +0 -81
  37. package/src/create-bookmark-reducer.ts +0 -149
  38. package/src/create-bookmark-store.ts +0 -61
  39. package/src/enable-bookmark.ts +0 -44
  40. package/src/index.ts +0 -43
  41. package/src/mock/BookmarkMockClient.ts +0 -310
  42. package/src/mock/BookmarkMockConfigurator.ts +0 -159
  43. package/src/mock/index.ts +0 -25
  44. package/src/mock/module.ts +0 -64
  45. package/src/types.ts +0 -121
  46. package/src/version.ts +0 -2
  47. package/tsconfig.json +0 -30
  48. 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
- };