@powerhousedao/common 3.2.0-dev.8 → 3.2.0-staging.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/drive-analytics/index.d.ts +0 -1
- package/dist/drive-analytics/index.d.ts.map +1 -1
- package/dist/drive-analytics/index.js +0 -1
- package/dist/drive-analytics/index.js.map +1 -1
- package/dist/drive-analytics/processor/document-processor.js +3 -3
- package/dist/drive-analytics/processor/document-processor.js.map +1 -1
- package/dist/drive-analytics/processor/drive-processor.js +4 -4
- package/dist/drive-analytics/processor/drive-processor.js.map +1 -1
- package/dist/drive-analytics/useDriveAnalytics.js +5 -5
- package/dist/drive-analytics/useDriveAnalytics.js.map +1 -1
- package/dist/editors/generic-drive-explorer/components/file-content-view.d.ts.map +1 -1
- package/dist/editors/generic-drive-explorer/components/file-content-view.js.map +1 -1
- package/dist/editors/generic-drive-explorer/editor.d.ts.map +1 -1
- package/dist/editors/generic-drive-explorer/editor.js +1 -19
- package/dist/editors/generic-drive-explorer/editor.js.map +1 -1
- package/dist/editors/styles.css +1 -1
- package/dist/editors/utils/storybook.d.ts.map +1 -1
- package/dist/editors/utils/storybook.js +14 -13
- package/dist/editors/utils/storybook.js.map +1 -1
- package/dist/editors/utils/uiNodes.d.ts +2 -2
- package/dist/editors/utils/uiNodes.d.ts.map +1 -1
- package/dist/editors/utils/uiNodes.js +3 -2
- package/dist/editors/utils/uiNodes.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/package.json +2 -3
- package/dist/state/apps.d.ts +5 -0
- package/dist/state/apps.d.ts.map +1 -0
- package/dist/state/apps.js +56 -0
- package/dist/state/apps.js.map +1 -0
- package/dist/state/atoms.d.ts +93 -99
- package/dist/state/atoms.d.ts.map +1 -1
- package/dist/state/atoms.js +52 -123
- package/dist/state/atoms.js.map +1 -1
- package/dist/state/config.d.ts +5 -0
- package/dist/state/config.d.ts.map +1 -0
- package/dist/state/config.js +20 -0
- package/dist/state/config.js.map +1 -0
- package/dist/state/cookies.d.ts +21 -0
- package/dist/state/cookies.d.ts.map +1 -0
- package/dist/state/cookies.js +7 -0
- package/dist/state/cookies.js.map +1 -0
- package/dist/state/document-model-modules.d.ts +1 -1
- package/dist/state/document-model-modules.d.ts.map +1 -1
- package/dist/state/document-model-modules.js.map +1 -1
- package/dist/state/documents.d.ts +35 -14
- package/dist/state/documents.d.ts.map +1 -1
- package/dist/state/documents.js +7 -14
- package/dist/state/documents.js.map +1 -1
- package/dist/state/drives.d.ts +6 -25
- package/dist/state/drives.d.ts.map +1 -1
- package/dist/state/drives.js +9 -29
- package/dist/state/drives.js.map +1 -1
- package/dist/state/editor-modules.d.ts +4 -1
- package/dist/state/editor-modules.d.ts.map +1 -1
- package/dist/state/editor-modules.js +10 -2
- package/dist/state/editor-modules.js.map +1 -1
- package/dist/state/folders.d.ts +0 -2
- package/dist/state/folders.d.ts.map +1 -1
- package/dist/state/folders.js +0 -2
- package/dist/state/folders.js.map +1 -1
- package/dist/state/index.d.ts +6 -0
- package/dist/state/index.d.ts.map +1 -1
- package/dist/state/index.js +6 -0
- package/dist/state/index.js.map +1 -1
- package/dist/state/modals.d.ts.map +1 -1
- package/dist/state/modals.js.map +1 -1
- package/dist/state/nodes.d.ts +4 -18
- package/dist/state/nodes.d.ts.map +1 -1
- package/dist/state/nodes.js +17 -31
- package/dist/state/nodes.js.map +1 -1
- package/dist/state/permissions.d.ts +17 -0
- package/dist/state/permissions.d.ts.map +1 -0
- package/dist/state/permissions.js +18 -0
- package/dist/state/permissions.js.map +1 -0
- package/dist/state/ph-packages.d.ts +2 -1
- package/dist/state/ph-packages.d.ts.map +1 -1
- package/dist/state/ph-packages.js.map +1 -1
- package/dist/state/processors.js +1 -1
- package/dist/state/processors.js.map +1 -1
- package/dist/state/reactor.d.ts +1 -10
- package/dist/state/reactor.d.ts.map +1 -1
- package/dist/state/reactor.js +17 -24
- package/dist/state/reactor.js.map +1 -1
- package/dist/state/storage.d.ts +2 -0
- package/dist/state/storage.d.ts.map +1 -0
- package/dist/state/storage.js +37 -0
- package/dist/state/storage.js.map +1 -0
- package/dist/state/store-provider.d.ts +0 -11
- package/dist/state/store-provider.d.ts.map +1 -1
- package/dist/state/store-provider.js +0 -11
- package/dist/state/store-provider.js.map +1 -1
- package/dist/state/store.d.ts +0 -4
- package/dist/state/store.d.ts.map +1 -1
- package/dist/state/store.js +0 -4
- package/dist/state/store.js.map +1 -1
- package/dist/state/syncing.d.ts +0 -1
- package/dist/state/syncing.d.ts.map +1 -1
- package/dist/state/syncing.js +0 -1
- package/dist/state/syncing.js.map +1 -1
- package/dist/state/theme.d.ts +3 -0
- package/dist/state/theme.d.ts.map +1 -0
- package/dist/state/theme.js +5 -0
- package/dist/state/theme.js.map +1 -0
- package/dist/state/types.d.ts +1 -13
- package/dist/state/types.d.ts.map +1 -1
- package/dist/state/utils.d.ts +20 -24
- package/dist/state/utils.d.ts.map +1 -1
- package/dist/state/utils.js +54 -65
- package/dist/state/utils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -10
- package/dist/drive-analytics/useDocumentAnalytics.d.ts +0 -22
- package/dist/drive-analytics/useDocumentAnalytics.d.ts.map +0 -1
- package/dist/drive-analytics/useDocumentAnalytics.js +0 -59
- package/dist/drive-analytics/useDocumentAnalytics.js.map +0 -1
package/dist/state/atoms.d.ts
CHANGED
|
@@ -1,136 +1,130 @@
|
|
|
1
1
|
import { type DocumentDriveDocument, type FolderNode, type IDocumentDriveServer, type Node } from "document-drive";
|
|
2
2
|
import { type ProcessorManager } from "document-drive/processors/processor-manager";
|
|
3
3
|
import { type DocumentModelModule, type EditorModule, type PHDocument } from "document-model";
|
|
4
|
-
import { type WritableAtom } from "jotai";
|
|
5
4
|
import type { PHPackage } from "./ph-packages.js";
|
|
6
|
-
import { type ConnectConfig } from "./types.js";
|
|
7
|
-
/** Returns a promise of the reactor instance if it is set, otherwise suspends until it is set. */
|
|
5
|
+
import { type ConnectConfig, type Theme } from "./types.js";
|
|
8
6
|
export declare const reactorAtom: import("jotai").Atom<Promise<IDocumentDriveServer | undefined>>;
|
|
9
|
-
|
|
10
|
-
export declare const initializeReactorAtom: WritableAtom<null, [reactor: IDocumentDriveServer | undefined], void> & {
|
|
7
|
+
export declare const setReactorAtom: import("jotai").WritableAtom<null, [reactor: IDocumentDriveServer | undefined], void> & {
|
|
11
8
|
init: null;
|
|
12
9
|
};
|
|
13
|
-
/** Returns a Loadable of the reactor instance. */
|
|
14
10
|
export declare const loadableReactorAtom: import("jotai").Atom<import("jotai/vanilla/utils/loadable").Loadable<Promise<IDocumentDriveServer | undefined>>>;
|
|
15
|
-
/** Returns a resolved promise of the reactor instance. */
|
|
16
11
|
export declare const unwrappedReactorAtom: import("jotai").Atom<IDocumentDriveServer | undefined>;
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
* Suspends until the reactor is set.
|
|
20
|
-
*
|
|
21
|
-
* Does not provide a direct setter, isnstead it uses `atomWithRefresh` which will refetch the drives from the reactor when called.
|
|
22
|
-
* See https://jotai.org/docs/utilities/resettable#atomwithrefresh for more details.
|
|
23
|
-
*/
|
|
24
|
-
export declare const drivesAtom: WritableAtom<Promise<DocumentDriveDocument[]>, [
|
|
25
|
-
void
|
|
26
|
-
], void>;
|
|
27
|
-
/** Returns a Loadable of the drives for a given reactor. */
|
|
12
|
+
export declare const drivesAtom: import("jotai").WritableAtom<Promise<DocumentDriveDocument[]>, [], void>;
|
|
28
13
|
export declare const loadableDrivesAtom: import("jotai").Atom<import("jotai/vanilla/utils/loadable").Loadable<Promise<DocumentDriveDocument[]>>>;
|
|
29
|
-
|
|
30
|
-
export declare const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*
|
|
35
|
-
* Suspends until the reactor's drives are set and the selected drive id is set.
|
|
36
|
-
* If the selected drive id is set as undefined, returns a resolved promise of undefined.
|
|
37
|
-
*
|
|
38
|
-
* When the selected drive is set, the selected node id is also set to undefined, since by definition selecting a new drive means navigating to the root of the new drive.
|
|
39
|
-
*/
|
|
40
|
-
export declare const selectedDriveAtom: WritableAtom<DocumentDriveDocument | Promise<DocumentDriveDocument | undefined> | undefined, [driveId: string | undefined], void>;
|
|
41
|
-
/** Returns a Loadable of the selected drive. */
|
|
14
|
+
export declare const unwrappedDrivesAtom: import("jotai").WritableAtom<DocumentDriveDocument[] | undefined, [], void>;
|
|
15
|
+
export declare const selectedDriveIdAtom: import("jotai").PrimitiveAtom<string | undefined> & {
|
|
16
|
+
init: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
export declare const selectedDriveAtom: import("jotai").WritableAtom<DocumentDriveDocument | Promise<DocumentDriveDocument | undefined> | undefined, [driveId: string | undefined], void>;
|
|
42
19
|
export declare const loadableSelectedDriveAtom: import("jotai").Atom<import("jotai/vanilla/utils/loadable").Loadable<DocumentDriveDocument | Promise<DocumentDriveDocument | undefined> | undefined>>;
|
|
43
|
-
|
|
44
|
-
export declare const unwrappedSelectedDriveAtom: WritableAtom<DocumentDriveDocument | undefined, [driveId: string | undefined], void>;
|
|
45
|
-
/** Holds a promise of the nodes for the selected drive.
|
|
46
|
-
*
|
|
47
|
-
* Derived from selectedDrive.state.global.nodes.
|
|
48
|
-
*
|
|
49
|
-
* Suspends until the selected drive is set.
|
|
50
|
-
*
|
|
51
|
-
* If the selected drive is set as undefined, returns a resolved promise of undefined.
|
|
52
|
-
*
|
|
53
|
-
* Does not provide a setter, since it is derived from the selected drive.
|
|
54
|
-
*/
|
|
20
|
+
export declare const unwrappedSelectedDriveAtom: import("jotai").WritableAtom<DocumentDriveDocument | undefined, [driveId: string | undefined], void>;
|
|
55
21
|
export declare const nodesAtom: import("jotai").Atom<Promise<Node[] | undefined>>;
|
|
56
22
|
export declare const loadableNodesAtom: import("jotai").Atom<import("jotai/vanilla/utils/loadable").Loadable<Promise<Node[] | undefined>>>;
|
|
57
23
|
export declare const unwrappedNodesAtom: import("jotai").Atom<Node[] | undefined>;
|
|
58
|
-
/** Holds the selected node id.
|
|
59
|
-
*
|
|
60
|
-
* This id comes from the drive's nodes, which can be the id for a document or for a meta item such as a folder.
|
|
61
|
-
*
|
|
62
|
-
* Like all base atoms, it is not meant to be accessed or updated directly.
|
|
63
|
-
* Starts off with the sentinel value NOT_SET.
|
|
64
|
-
*
|
|
65
|
-
* When this value changes, the data for the selected node is re-fetched from the nodes atom.
|
|
66
|
-
*/
|
|
67
24
|
export declare const selectedNodeIdAtom: import("jotai").PrimitiveAtom<string | undefined> & {
|
|
68
25
|
init: string | undefined;
|
|
69
26
|
};
|
|
70
|
-
|
|
71
|
-
export declare const setSelectedNodeAtom: WritableAtom<null, [nodeId: string | undefined], void> & {
|
|
27
|
+
export declare const setSelectedNodeAtom: import("jotai").WritableAtom<null, [nodeId: string | undefined], void> & {
|
|
72
28
|
init: null;
|
|
73
29
|
};
|
|
74
|
-
/** Returns a promise of the selected folder.
|
|
75
|
-
*
|
|
76
|
-
* A "folder" is a meta item that contains other nodes. It is not a document itself. Folder nodes have a `kind` of `folder` or `FOLDER`.
|
|
77
|
-
*
|
|
78
|
-
* Suspends until the nodes are set and the selected node id is set.
|
|
79
|
-
* If the selected node id is set as undefined, returns a resolved promise of undefined.
|
|
80
|
-
*
|
|
81
|
-
* Does not provide a setter, since it is derived from the selected node id.
|
|
82
|
-
*/
|
|
83
30
|
export declare const selectedFolderAtom: import("jotai").Atom<FolderNode | Promise<FolderNode | undefined> | undefined>;
|
|
84
|
-
/** Returns a Loadable of the selected folder. */
|
|
85
31
|
export declare const loadableSelectedFolderAtom: import("jotai").Atom<import("jotai/vanilla/utils/loadable").Loadable<FolderNode | Promise<FolderNode | undefined> | undefined>>;
|
|
86
|
-
/** Returns a resolved promise of the selected folder. */
|
|
87
32
|
export declare const unwrappedSelectedFolderAtom: import("jotai").Atom<FolderNode | undefined>;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
33
|
+
export declare const documentsAtom: import("jotai").WritableAtom<Promise<(import("document-model").DocumentHeader & {
|
|
34
|
+
state: import("document-model").BaseState<unknown, unknown>;
|
|
35
|
+
attachments?: import("document-model").FileRegistry;
|
|
36
|
+
} & {
|
|
37
|
+
operations: import("document-model").DocumentOperations<import("document-model").Action<string, unknown, import("document-model").OperationScope>>;
|
|
38
|
+
initialState: import("document-model").ExtendedState<unknown, unknown>;
|
|
39
|
+
clipboard: import("document-model").Operation<import("document-model").Action<string, unknown, import("document-model").OperationScope>>[];
|
|
40
|
+
})[]>, [], void>;
|
|
41
|
+
export declare const loadableDocumentsAtom: import("jotai").Atom<import("jotai/vanilla/utils/loadable").Loadable<Promise<(import("document-model").DocumentHeader & {
|
|
42
|
+
state: import("document-model").BaseState<unknown, unknown>;
|
|
43
|
+
attachments?: import("document-model").FileRegistry;
|
|
44
|
+
} & {
|
|
45
|
+
operations: import("document-model").DocumentOperations<import("document-model").Action<string, unknown, import("document-model").OperationScope>>;
|
|
46
|
+
initialState: import("document-model").ExtendedState<unknown, unknown>;
|
|
47
|
+
clipboard: import("document-model").Operation<import("document-model").Action<string, unknown, import("document-model").OperationScope>>[];
|
|
48
|
+
})[]>>>;
|
|
49
|
+
export declare const unwrappedDocumentsAtom: import("jotai").WritableAtom<(import("document-model").DocumentHeader & {
|
|
50
|
+
state: import("document-model").BaseState<unknown, unknown>;
|
|
51
|
+
attachments?: import("document-model").FileRegistry;
|
|
52
|
+
} & {
|
|
53
|
+
operations: import("document-model").DocumentOperations<import("document-model").Action<string, unknown, import("document-model").OperationScope>>;
|
|
54
|
+
initialState: import("document-model").ExtendedState<unknown, unknown>;
|
|
55
|
+
clipboard: import("document-model").Operation<import("document-model").Action<string, unknown, import("document-model").OperationScope>>[];
|
|
56
|
+
})[] | undefined, [], void>;
|
|
57
|
+
export declare const selectedDocumentAtom: import("jotai").Atom<(import("document-model").DocumentHeader & {
|
|
58
|
+
state: import("document-model").BaseState<unknown, unknown>;
|
|
59
|
+
attachments?: import("document-model").FileRegistry;
|
|
60
|
+
} & {
|
|
61
|
+
operations: import("document-model").DocumentOperations<import("document-model").Action<string, unknown, import("document-model").OperationScope>>;
|
|
62
|
+
initialState: import("document-model").ExtendedState<unknown, unknown>;
|
|
63
|
+
clipboard: import("document-model").Operation<import("document-model").Action<string, unknown, import("document-model").OperationScope>>[];
|
|
64
|
+
}) | Promise<PHDocument | undefined> | undefined>;
|
|
65
|
+
export declare const loadableSelectedDocumentAtom: import("jotai").Atom<import("jotai/vanilla/utils/loadable").Loadable<(import("document-model").DocumentHeader & {
|
|
66
|
+
state: import("document-model").BaseState<unknown, unknown>;
|
|
67
|
+
attachments?: import("document-model").FileRegistry;
|
|
68
|
+
} & {
|
|
69
|
+
operations: import("document-model").DocumentOperations<import("document-model").Action<string, unknown, import("document-model").OperationScope>>;
|
|
70
|
+
initialState: import("document-model").ExtendedState<unknown, unknown>;
|
|
71
|
+
clipboard: import("document-model").Operation<import("document-model").Action<string, unknown, import("document-model").OperationScope>>[];
|
|
72
|
+
}) | Promise<PHDocument | undefined> | undefined>>;
|
|
73
|
+
export declare const unwrappedSelectedDocumentAtom: import("jotai").Atom<PHDocument | (import("document-model").DocumentHeader & {
|
|
74
|
+
state: import("document-model").BaseState<unknown, unknown>;
|
|
75
|
+
attachments?: import("document-model").FileRegistry;
|
|
76
|
+
} & {
|
|
77
|
+
operations: import("document-model").DocumentOperations<import("document-model").Action<string, unknown, import("document-model").OperationScope>>;
|
|
78
|
+
initialState: import("document-model").ExtendedState<unknown, unknown>;
|
|
79
|
+
clipboard: import("document-model").Operation<import("document-model").Action<string, unknown, import("document-model").OperationScope>>[];
|
|
80
|
+
}) | undefined>;
|
|
116
81
|
export declare const phPackagesAtom: import("jotai").PrimitiveAtom<Promise<PHPackage[] | undefined>> & {
|
|
117
82
|
init: Promise<PHPackage[] | undefined>;
|
|
118
83
|
};
|
|
119
|
-
export declare const setPhPackagesAtom: WritableAtom<null, [phPackages: PHPackage[] | Promise<PHPackage[] | undefined> | undefined], void> & {
|
|
84
|
+
export declare const setPhPackagesAtom: import("jotai").WritableAtom<null, [phPackages: PHPackage[] | Promise<PHPackage[] | undefined> | undefined], void> & {
|
|
120
85
|
init: null;
|
|
121
86
|
};
|
|
122
87
|
export declare const loadablePhPackagesAtom: import("jotai").Atom<import("jotai/vanilla/utils/loadable").Loadable<Promise<PHPackage[] | undefined>>>;
|
|
123
|
-
export declare const unwrappedPhPackagesAtom: WritableAtom<PHPackage[] | undefined, [Promise<PHPackage[] | undefined> | ((prev: Promise<PHPackage[] | undefined>) => Promise<PHPackage[] | undefined>)], void>;
|
|
124
|
-
export declare const documentModelModulesAtom: WritableAtom<Promise<DocumentModelModule[] | undefined>, [], void>;
|
|
88
|
+
export declare const unwrappedPhPackagesAtom: import("jotai").WritableAtom<PHPackage[] | undefined, [Promise<PHPackage[] | undefined> | ((prev: Promise<PHPackage[] | undefined>) => Promise<PHPackage[] | undefined>)], void>;
|
|
89
|
+
export declare const documentModelModulesAtom: import("jotai").WritableAtom<Promise<DocumentModelModule[] | undefined>, [], void>;
|
|
125
90
|
export declare const loadableDocumentModelModulesAtom: import("jotai").Atom<import("jotai/vanilla/utils/loadable").Loadable<Promise<DocumentModelModule[] | undefined>>>;
|
|
126
|
-
export declare const unwrappedDocumentModelModulesAtom: WritableAtom<DocumentModelModule[] | undefined, [], void>;
|
|
127
|
-
export declare const editorModulesAtom: WritableAtom<Promise<EditorModule<PHDocument<unknown, unknown, import("document-model").Action<string, unknown, import("document-model").OperationScope>>, unknown, Record<string, unknown>>[] | undefined>, [], void>;
|
|
91
|
+
export declare const unwrappedDocumentModelModulesAtom: import("jotai").WritableAtom<DocumentModelModule[] | undefined, [], void>;
|
|
92
|
+
export declare const editorModulesAtom: import("jotai").WritableAtom<Promise<EditorModule<PHDocument<unknown, unknown, import("document-model").Action<string, unknown, import("document-model").OperationScope>>, unknown, Record<string, unknown>>[] | undefined>, [], void>;
|
|
128
93
|
export declare const loadableEditorModulesAtom: import("jotai").Atom<import("jotai/vanilla/utils/loadable").Loadable<Promise<EditorModule<PHDocument<unknown, unknown, import("document-model").Action<string, unknown, import("document-model").OperationScope>>, unknown, Record<string, unknown>>[] | undefined>>>;
|
|
129
|
-
export declare const unwrappedEditorModulesAtom: WritableAtom<EditorModule<PHDocument<unknown, unknown, import("document-model").Action<string, unknown, import("document-model").OperationScope>>, unknown, Record<string, unknown>>[] | undefined, [], void>;
|
|
94
|
+
export declare const unwrappedEditorModulesAtom: import("jotai").WritableAtom<EditorModule<PHDocument<unknown, unknown, import("document-model").Action<string, unknown, import("document-model").OperationScope>>, unknown, Record<string, unknown>>[] | undefined, [], void>;
|
|
95
|
+
export declare const preferredDocumentModelEditorIdAtom: import("jotai").WritableAtom<string, [string | typeof import("jotai/utils").RESET | ((prev: string) => string | typeof import("jotai/utils").RESET)], void>;
|
|
130
96
|
export declare const processorManagerAtom: import("jotai").PrimitiveAtom<ProcessorManager | undefined> & {
|
|
131
97
|
init: ProcessorManager | undefined;
|
|
132
98
|
};
|
|
133
99
|
export declare const configAtom: import("jotai").PrimitiveAtom<ConnectConfig> & {
|
|
134
100
|
init: ConnectConfig;
|
|
135
101
|
};
|
|
102
|
+
export declare const acceptedCookiesAtom: import("jotai").WritableAtom<{
|
|
103
|
+
analytics: boolean;
|
|
104
|
+
marketing: boolean;
|
|
105
|
+
functional: boolean;
|
|
106
|
+
}, [typeof import("jotai/utils").RESET | {
|
|
107
|
+
analytics: boolean;
|
|
108
|
+
marketing: boolean;
|
|
109
|
+
functional: boolean;
|
|
110
|
+
} | ((prev: {
|
|
111
|
+
analytics: boolean;
|
|
112
|
+
marketing: boolean;
|
|
113
|
+
functional: boolean;
|
|
114
|
+
}) => typeof import("jotai/utils").RESET | {
|
|
115
|
+
analytics: boolean;
|
|
116
|
+
marketing: boolean;
|
|
117
|
+
functional: boolean;
|
|
118
|
+
})], void>;
|
|
119
|
+
export declare const displayCookieBannerAtom: import("jotai").WritableAtom<boolean, [boolean | typeof import("jotai/utils").RESET | ((prev: boolean) => boolean | typeof import("jotai/utils").RESET)], void>;
|
|
120
|
+
export declare const themeAtom: import("jotai").WritableAtom<Theme, [Theme | typeof import("jotai/utils").RESET | ((prev: Theme) => Theme | typeof import("jotai/utils").RESET)], void>;
|
|
121
|
+
export declare const permissionsAtom: import("jotai").PrimitiveAtom<{
|
|
122
|
+
isAllowedToCreateDocuments: boolean;
|
|
123
|
+
isAllowedToEditDocuments: boolean;
|
|
124
|
+
}> & {
|
|
125
|
+
init: {
|
|
126
|
+
isAllowedToCreateDocuments: boolean;
|
|
127
|
+
isAllowedToEditDocuments: boolean;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
136
130
|
//# sourceMappingURL=atoms.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.d.ts","sourceRoot":"","sources":["../../state/atoms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,IAAI,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"atoms.d.ts","sourceRoot":"","sources":["../../state/atoms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EA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AAC;AAE7D,eAAO,MAAM,sBAAsB;;;;;;;2BAAwB,CAAC;AAK5D,eAAO,MAAM,oBAAoB;;;;;;;iDAO/B,CAAC;AAGH,eAAO,MAAM,4BAA4B;;;;;;;kDAAiC,CAAC;AAE3E,eAAO,MAAM,6BAA6B;;;;;;;eAA+B,CAAC;AAK1E,eAAO,MAAM,cAAc;;CAE1B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;CAS7B,CAAC;AAEF,eAAO,MAAM,sBAAsB,yGAA2B,CAAC;AAE/D,eAAO,MAAM,uBAAuB,kLAAyB,CAAC;AAK9D,eAAO,MAAM,wBAAwB,oFAMnC,CAAC;AAEH,eAAO,MAAM,gCAAgC,mHAE5C,CAAC;AAGF,eAAO,MAAM,iCAAiC,2EAE7C,CAAC;AAMF,eAAO,MAAM,iBAAiB,wOAM5B,CAAC;AAGH,eAAO,MAAM,yBAAyB,uQAA8B,CAAC;AAErE,eAAO,MAAM,0BAA0B,+NAA4B,CAAC;AAGpE,eAAO,MAAM,kCAAkC,6JAG9C,CAAC;AAMF,eAAO,MAAM,oBAAoB;;CAEhC,CAAC;AAKF,eAAO,MAAM,UAAU;;CAqCrB,CAAC;AAGH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;UAI9B,CAAC;AAGH,eAAO,MAAM,uBAAuB,iKAGnC,CAAC;AAGF,eAAO,MAAM,SAAS,yJAA2C,CAAC;AAGlE,eAAO,MAAM,eAAe;;;;;;;;CAG1B,CAAC"}
|
package/dist/state/atoms.js
CHANGED
|
@@ -1,120 +1,71 @@
|
|
|
1
1
|
import { atom } from "jotai";
|
|
2
|
-
import { atomWithRefresh, loadable, unwrap } from "jotai/utils";
|
|
2
|
+
import { atomWithRefresh, atomWithStorage, loadable, unwrap, } from "jotai/utils";
|
|
3
3
|
import { isFolderNodeKind } from "./nodes.js";
|
|
4
|
-
import {
|
|
4
|
+
import { extractNodeFromPath } from "./utils.js";
|
|
5
|
+
const INITIAL = "INITIAL";
|
|
6
|
+
/* Will suspend until the atom is set elsewhere */
|
|
7
|
+
function suspendUntilSet() {
|
|
8
|
+
return new Promise(() => { });
|
|
9
|
+
}
|
|
5
10
|
/* Reactor */
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* Like all base atoms, it is not meant to be accessed or updated directly.
|
|
9
|
-
* Starts off with the sentinel value NOT_SET.
|
|
10
|
-
*/
|
|
11
|
-
const baseReactorAtom = atom(NOT_SET);
|
|
11
|
+
const baseReactorAtom = atom(INITIAL);
|
|
12
12
|
baseReactorAtom.debugLabel = "baseReactorAtom";
|
|
13
|
-
/** Returns a promise of the reactor instance if it is set, otherwise suspends until it is set. */
|
|
14
13
|
export const reactorAtom = atom(async (get) => {
|
|
15
14
|
const reactor = get(baseReactorAtom);
|
|
16
|
-
|
|
17
|
-
if (reactor === NOT_SET)
|
|
15
|
+
if (reactor === INITIAL)
|
|
18
16
|
return suspendUntilSet();
|
|
19
17
|
return reactor;
|
|
20
18
|
});
|
|
21
19
|
reactorAtom.debugLabel = "reactorAtom";
|
|
22
|
-
|
|
23
|
-
export const initializeReactorAtom = atom(null, (get, set, reactor) => {
|
|
20
|
+
export const setReactorAtom = atom(null, (get, set, reactor) => {
|
|
24
21
|
const baseReactor = get(baseReactorAtom);
|
|
25
|
-
|
|
26
|
-
if (baseReactor === NOT_SET) {
|
|
22
|
+
if (baseReactor === INITIAL) {
|
|
27
23
|
set(baseReactorAtom, reactor);
|
|
28
24
|
}
|
|
29
25
|
});
|
|
30
|
-
|
|
31
|
-
/** Returns a Loadable of the reactor instance. */
|
|
26
|
+
setReactorAtom.debugLabel = "setReactorAtom";
|
|
32
27
|
export const loadableReactorAtom = loadable(reactorAtom);
|
|
33
28
|
loadableReactorAtom.debugLabel = "loadableReactorAtom";
|
|
34
|
-
/** Returns a resolved promise of the reactor instance. */
|
|
35
29
|
export const unwrappedReactorAtom = unwrap(reactorAtom);
|
|
36
30
|
unwrappedReactorAtom.debugLabel = "unwrappedReactorAtom";
|
|
37
31
|
/* Drives */
|
|
38
|
-
/** Holds a promise of the drives for a given reactor.
|
|
39
|
-
*
|
|
40
|
-
* Suspends until the reactor is set.
|
|
41
|
-
*
|
|
42
|
-
* Does not provide a direct setter, isnstead it uses `atomWithRefresh` which will refetch the drives from the reactor when called.
|
|
43
|
-
* See https://jotai.org/docs/utilities/resettable#atomwithrefresh for more details.
|
|
44
|
-
*/
|
|
45
32
|
export const drivesAtom = atomWithRefresh(async (get) => {
|
|
46
33
|
const loadableReactor = get(loadableReactorAtom);
|
|
47
|
-
// Suspends until the reactor is set.
|
|
48
34
|
if (loadableReactor.state !== "hasData")
|
|
49
35
|
return suspendUntilSet();
|
|
50
36
|
const reactor = loadableReactor.data;
|
|
51
|
-
// If the reactor is not set, returns an empty array.
|
|
52
37
|
if (!reactor)
|
|
53
38
|
return [];
|
|
54
39
|
const driveIds = await reactor.getDrives();
|
|
55
|
-
const drives =
|
|
40
|
+
const drives = await Promise.all(driveIds.map((id) => reactor.getDrive(id)));
|
|
56
41
|
return drives;
|
|
57
42
|
});
|
|
58
43
|
drivesAtom.debugLabel = "drivesAtom";
|
|
59
|
-
/** Returns a Loadable of the drives for a given reactor. */
|
|
60
44
|
export const loadableDrivesAtom = loadable(drivesAtom);
|
|
61
45
|
loadableDrivesAtom.debugLabel = "loadableDrivesAtom";
|
|
62
|
-
/** Returns a resolved promise of the drives for a given reactor. */
|
|
63
46
|
export const unwrappedDrivesAtom = unwrap(drivesAtom);
|
|
64
47
|
unwrappedDrivesAtom.debugLabel = "unwrappedDrivesAtom";
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
* Like all base atoms, it is not meant to be accessed or updated directly.
|
|
68
|
-
* Starts off with the sentinel value NOT_SET.
|
|
69
|
-
*
|
|
70
|
-
* When this value changes, the data for the selected drive is re-fetched from the drives atom.
|
|
71
|
-
*/
|
|
72
|
-
const baseSelectedDriveIdAtom = atom(NOT_SET);
|
|
73
|
-
baseSelectedDriveIdAtom.debugLabel = "baseSelectedDriveIdAtom";
|
|
74
|
-
/** Returns a promise of the selected drive.
|
|
75
|
-
*
|
|
76
|
-
* Provides a setter which receives a drive id and updates the baseSelectedDriveIdAtom.
|
|
77
|
-
*
|
|
78
|
-
* Suspends until the reactor's drives are set and the selected drive id is set.
|
|
79
|
-
* If the selected drive id is set as undefined, returns a resolved promise of undefined.
|
|
80
|
-
*
|
|
81
|
-
* When the selected drive is set, the selected node id is also set to undefined, since by definition selecting a new drive means navigating to the root of the new drive.
|
|
82
|
-
*/
|
|
48
|
+
export const selectedDriveIdAtom = atom(INITIAL);
|
|
49
|
+
selectedDriveIdAtom.debugLabel = "selectedDriveIdAtom";
|
|
83
50
|
export const selectedDriveAtom = atom((get) => {
|
|
84
|
-
const driveId = get(
|
|
51
|
+
const driveId = get(selectedDriveIdAtom);
|
|
85
52
|
const loadableDrives = get(loadableDrivesAtom);
|
|
86
|
-
|
|
87
|
-
if (driveId === NOT_SET || loadableDrives.state !== "hasData")
|
|
53
|
+
if (driveId === INITIAL || loadableDrives.state !== "hasData")
|
|
88
54
|
return suspendUntilSet();
|
|
89
55
|
const drives = loadableDrives.data;
|
|
90
|
-
return drives.find((drive) => drive.
|
|
56
|
+
return drives.find((drive) => drive.id === driveId);
|
|
91
57
|
}, (_get, set, driveId) => {
|
|
92
|
-
|
|
93
|
-
set(baseSelectedDriveIdAtom, driveId);
|
|
94
|
-
// Resets the selected node id.
|
|
58
|
+
set(selectedDriveIdAtom, driveId);
|
|
95
59
|
set(selectedNodeIdAtom, undefined);
|
|
96
60
|
});
|
|
97
61
|
selectedDriveAtom.debugLabel = "selectedDriveAtom";
|
|
98
|
-
/** Returns a Loadable of the selected drive. */
|
|
99
62
|
export const loadableSelectedDriveAtom = loadable(selectedDriveAtom);
|
|
100
63
|
loadableSelectedDriveAtom.debugLabel = "loadableSelectedDriveAtom";
|
|
101
|
-
/** Returns a resolved promise of the selected drive. */
|
|
102
64
|
export const unwrappedSelectedDriveAtom = unwrap(selectedDriveAtom);
|
|
103
65
|
unwrappedSelectedDriveAtom.debugLabel = "unwrappedSelectedDriveAtom";
|
|
104
66
|
/* Nodes */
|
|
105
|
-
/** Holds a promise of the nodes for the selected drive.
|
|
106
|
-
*
|
|
107
|
-
* Derived from selectedDrive.state.global.nodes.
|
|
108
|
-
*
|
|
109
|
-
* Suspends until the selected drive is set.
|
|
110
|
-
*
|
|
111
|
-
* If the selected drive is set as undefined, returns a resolved promise of undefined.
|
|
112
|
-
*
|
|
113
|
-
* Does not provide a setter, since it is derived from the selected drive.
|
|
114
|
-
*/
|
|
115
67
|
export const nodesAtom = atom(async (get) => {
|
|
116
68
|
const loadableSelectedDrive = get(loadableSelectedDriveAtom);
|
|
117
|
-
// Suspends until the selected drive is set.
|
|
118
69
|
if (loadableSelectedDrive.state !== "hasData")
|
|
119
70
|
return suspendUntilSet();
|
|
120
71
|
const drive = loadableSelectedDrive.data;
|
|
@@ -125,105 +76,65 @@ export const loadableNodesAtom = loadable(nodesAtom);
|
|
|
125
76
|
loadableNodesAtom.debugLabel = "loadableNodesAtom";
|
|
126
77
|
export const unwrappedNodesAtom = unwrap(nodesAtom);
|
|
127
78
|
unwrappedNodesAtom.debugLabel = "unwrappedNodesAtom";
|
|
128
|
-
|
|
129
|
-
*
|
|
130
|
-
* This id comes from the drive's nodes, which can be the id for a document or for a meta item such as a folder.
|
|
131
|
-
*
|
|
132
|
-
* Like all base atoms, it is not meant to be accessed or updated directly.
|
|
133
|
-
* Starts off with the sentinel value NOT_SET.
|
|
134
|
-
*
|
|
135
|
-
* When this value changes, the data for the selected node is re-fetched from the nodes atom.
|
|
136
|
-
*/
|
|
137
|
-
export const selectedNodeIdAtom = atom(NOT_SET);
|
|
79
|
+
export const selectedNodeIdAtom = atom(INITIAL);
|
|
138
80
|
selectedNodeIdAtom.debugLabel = "selectedNodeIdAtom";
|
|
139
|
-
|
|
81
|
+
selectedNodeIdAtom.onMount = (setAtom) => {
|
|
82
|
+
if (typeof window === "undefined")
|
|
83
|
+
return;
|
|
84
|
+
const nodeId = extractNodeFromPath(window.location.pathname);
|
|
85
|
+
setAtom(nodeId);
|
|
86
|
+
};
|
|
140
87
|
export const setSelectedNodeAtom = atom(null, (_get, set, nodeId) => {
|
|
141
88
|
set(selectedNodeIdAtom, nodeId);
|
|
142
89
|
});
|
|
143
90
|
setSelectedNodeAtom.debugLabel = "setSelectedNodeAtom";
|
|
144
|
-
/** Returns a promise of the selected folder.
|
|
145
|
-
*
|
|
146
|
-
* A "folder" is a meta item that contains other nodes. It is not a document itself. Folder nodes have a `kind` of `folder` or `FOLDER`.
|
|
147
|
-
*
|
|
148
|
-
* Suspends until the nodes are set and the selected node id is set.
|
|
149
|
-
* If the selected node id is set as undefined, returns a resolved promise of undefined.
|
|
150
|
-
*
|
|
151
|
-
* Does not provide a setter, since it is derived from the selected node id.
|
|
152
|
-
*/
|
|
153
91
|
export const selectedFolderAtom = atom((get) => {
|
|
154
92
|
const loadableNodes = get(loadableNodesAtom);
|
|
155
93
|
const nodeId = get(selectedNodeIdAtom);
|
|
156
|
-
|
|
157
|
-
if (nodeId === NOT_SET || loadableNodes.state !== "hasData")
|
|
94
|
+
if (nodeId === INITIAL || loadableNodes.state !== "hasData")
|
|
158
95
|
return suspendUntilSet();
|
|
159
96
|
const nodes = loadableNodes.data;
|
|
160
|
-
// Filters the nodes to only include folder nodes.
|
|
161
97
|
const folderNodes = nodes?.filter(isFolderNodeKind);
|
|
162
|
-
// Returns the folder node with the selected node id.
|
|
163
98
|
return folderNodes?.find((node) => node.id === nodeId);
|
|
164
99
|
});
|
|
165
100
|
selectedFolderAtom.debugLabel = "selectedFolderAtom";
|
|
166
|
-
/** Returns a Loadable of the selected folder. */
|
|
167
101
|
export const loadableSelectedFolderAtom = loadable(selectedFolderAtom);
|
|
168
102
|
loadableSelectedFolderAtom.debugLabel = "loadableSelectedFolderAtom";
|
|
169
|
-
/** Returns a resolved promise of the selected folder. */
|
|
170
103
|
export const unwrappedSelectedFolderAtom = unwrap(selectedFolderAtom);
|
|
171
104
|
unwrappedSelectedFolderAtom.debugLabel = "unwrappedSelectedFolderAtom";
|
|
172
105
|
/* Documents */
|
|
173
|
-
/** Holds a promise of the documents for the selected drive.
|
|
174
|
-
*
|
|
175
|
-
* Suspends until the selected drive is set.
|
|
176
|
-
*
|
|
177
|
-
* If the selected drive is set as undefined, returns a resolved promise of undefined.
|
|
178
|
-
*
|
|
179
|
-
* Does not provide a setter, instead it uses `atomWithRefresh` which will refetch the documents from the reactor when called.
|
|
180
|
-
* See https://jotai.org/docs/utilities/resettable#atomwithrefresh for more details.
|
|
181
|
-
*/
|
|
182
106
|
export const documentsAtom = atomWithRefresh(async (get) => {
|
|
183
107
|
const loadableReactor = get(loadableReactorAtom);
|
|
184
108
|
const loadableDrive = get(loadableSelectedDriveAtom);
|
|
185
|
-
// Suspends until the selected drive is set.
|
|
186
109
|
if (loadableReactor.state !== "hasData" || loadableDrive.state !== "hasData")
|
|
187
110
|
return suspendUntilSet();
|
|
188
111
|
const reactor = loadableReactor.data;
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
112
|
+
if (!reactor)
|
|
113
|
+
return [];
|
|
114
|
+
const driveId = loadableDrive.data?.id;
|
|
115
|
+
if (!driveId)
|
|
192
116
|
return [];
|
|
193
117
|
const documentIds = await reactor.getDocuments(driveId);
|
|
194
118
|
const documents = await Promise.all(documentIds.map((id) => reactor.getDocument(driveId, id)));
|
|
195
119
|
return documents;
|
|
196
120
|
});
|
|
197
121
|
documentsAtom.debugLabel = "documentsAtom";
|
|
198
|
-
/** Returns a Loadable of the documents for the selected drive. */
|
|
199
122
|
export const loadableDocumentsAtom = loadable(documentsAtom);
|
|
200
123
|
loadableDocumentsAtom.debugLabel = "loadableDocumentsAtom";
|
|
201
|
-
/** Returns a resolved promise of the documents for the selected drive. */
|
|
202
124
|
export const unwrappedDocumentsAtom = unwrap(documentsAtom);
|
|
203
125
|
unwrappedDocumentsAtom.debugLabel = "unwrappedDocumentsAtom";
|
|
204
|
-
|
|
205
|
-
*
|
|
206
|
-
* A "document" is a PHDocument. This id is the document's id, and this id will also be found in the drive's nodes. We use the same id for finding a node in a drive and for identifying a document in the reactor.
|
|
207
|
-
*
|
|
208
|
-
* Suspends until the documents are set and the selected node id is set.
|
|
209
|
-
* If the selected node id is set as undefined, returns a resolved promise of undefined.
|
|
210
|
-
*
|
|
211
|
-
* Does not provide a setter, since it is derived from the selected node id.
|
|
212
|
-
*/
|
|
126
|
+
/* Selected Document */
|
|
213
127
|
export const selectedDocumentAtom = atom((get) => {
|
|
214
128
|
const loadableDocuments = get(loadableDocumentsAtom);
|
|
215
129
|
const nodeId = get(selectedNodeIdAtom);
|
|
216
|
-
|
|
217
|
-
if (nodeId === NOT_SET || loadableDocuments.state !== "hasData")
|
|
130
|
+
if (nodeId === INITIAL || loadableDocuments.state !== "hasData")
|
|
218
131
|
return suspendUntilSet();
|
|
219
132
|
const documents = loadableDocuments.data;
|
|
220
|
-
return documents.find((document) => document.
|
|
133
|
+
return documents.find((document) => document.id === nodeId);
|
|
221
134
|
});
|
|
222
135
|
selectedDocumentAtom.debugLabel = "selectedDocumentAtom";
|
|
223
|
-
/** Returns a Loadable of the selected document. */
|
|
224
136
|
export const loadableSelectedDocumentAtom = loadable(selectedDocumentAtom);
|
|
225
137
|
loadableSelectedDocumentAtom.debugLabel = "loadableSelectedDocumentAtom";
|
|
226
|
-
/** Returns a resolved promise of the selected document. */
|
|
227
138
|
export const unwrappedSelectedDocumentAtom = unwrap(selectedDocumentAtom);
|
|
228
139
|
unwrappedSelectedDocumentAtom.debugLabel = "unwrappedSelectedDocumentAtom";
|
|
229
140
|
/* PH Packages */
|
|
@@ -265,6 +176,9 @@ export const loadableEditorModulesAtom = loadable(editorModulesAtom);
|
|
|
265
176
|
loadableEditorModulesAtom.debugLabel = "loadableEditorModulesAtom";
|
|
266
177
|
export const unwrappedEditorModulesAtom = unwrap(editorModulesAtom);
|
|
267
178
|
unwrappedEditorModulesAtom.debugLabel = "unwrappedEditorModulesAtom";
|
|
179
|
+
export const preferredDocumentModelEditorIdAtom = atomWithStorage("preferredEditorId", "document-model-editor-v2");
|
|
180
|
+
preferredDocumentModelEditorIdAtom.debugLabel =
|
|
181
|
+
"preferredDocumentModelEditorIdAtom";
|
|
268
182
|
/* Processor Manager */
|
|
269
183
|
export const processorManagerAtom = atom(undefined);
|
|
270
184
|
processorManagerAtom.debugLabel = "processorManagerAtom";
|
|
@@ -308,4 +222,19 @@ export const configAtom = atom({
|
|
|
308
222
|
phCliVersion: undefined,
|
|
309
223
|
});
|
|
310
224
|
configAtom.debugLabel = "configAtom";
|
|
225
|
+
export const acceptedCookiesAtom = atomWithStorage("acceptedCookies", {
|
|
226
|
+
analytics: false,
|
|
227
|
+
marketing: false,
|
|
228
|
+
functional: false,
|
|
229
|
+
});
|
|
230
|
+
acceptedCookiesAtom.debugLabel = "acceptedCookiesAtom";
|
|
231
|
+
export const displayCookieBannerAtom = atomWithStorage("display-cookie-banner", true);
|
|
232
|
+
displayCookieBannerAtom.debugLabel = "displayCookieBannerAtom";
|
|
233
|
+
export const themeAtom = atomWithStorage("theme", "light");
|
|
234
|
+
themeAtom.debugLabel = "themeAtom";
|
|
235
|
+
export const permissionsAtom = atom({
|
|
236
|
+
isAllowedToCreateDocuments: true,
|
|
237
|
+
isAllowedToEditDocuments: true,
|
|
238
|
+
});
|
|
239
|
+
permissionsAtom.debugLabel = "permissionsAtom";
|
|
311
240
|
//# sourceMappingURL=atoms.js.map
|
package/dist/state/atoms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atoms.js","sourceRoot":"","sources":["../../state/atoms.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"atoms.js","sourceRoot":"","sources":["../../state/atoms.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EACL,eAAe,EACf,eAAe,EACf,QAAQ,EACR,MAAM,GACP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gBACd,WAAW,EAAE,IAAI;aAClB;YACD,KAAK,EAAE;gBACL,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,IAAI;aAClB;YACD,MAAM,EAAE;gBACN,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,IAAI;aAClB;SACF;KACF;IACD,YAAY,EAAE,SAAS;IACvB,YAAY,EAAE,SAAS;CACxB,CAAC,CAAC;AACH,UAAU,CAAC,UAAU,GAAG,YAAY,CAAC;AAErC,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAC,iBAAiB,EAAE;IACpE,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,KAAK;CAClB,CAAC,CAAC;AACH,mBAAmB,CAAC,UAAU,GAAG,qBAAqB,CAAC;AAEvD,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CACpD,uBAAuB,EACvB,IAAI,CACL,CAAC;AACF,uBAAuB,CAAC,UAAU,GAAG,yBAAyB,CAAC;AAE/D,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAQ,OAAO,EAAE,OAAO,CAAC,CAAC;AAClE,SAAS,CAAC,UAAU,GAAG,WAAW,CAAC;AAEnC,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;IAClC,0BAA0B,EAAE,IAAI;IAChC,wBAAwB,EAAE,IAAI;CAC/B,CAAC,CAAC;AACH,eAAe,CAAC,UAAU,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ConnectConfig } from "./types.js";
|
|
2
|
+
export declare function useConfig(): ConnectConfig;
|
|
3
|
+
export declare function useInitializeConfig(config: ConnectConfig): void;
|
|
4
|
+
export declare function useShouldShowSearchBar(): boolean;
|
|
5
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../state/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,wBAAgB,SAAS,kBAExB;AAMD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,QAKxD;AAED,wBAAgB,sBAAsB,YAGrC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useAtomValue, useSetAtom } from "jotai";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { configAtom } from "./atoms.js";
|
|
4
|
+
export function useConfig() {
|
|
5
|
+
return useAtomValue(configAtom);
|
|
6
|
+
}
|
|
7
|
+
function useSetConfig() {
|
|
8
|
+
return useSetAtom(configAtom);
|
|
9
|
+
}
|
|
10
|
+
export function useInitializeConfig(config) {
|
|
11
|
+
const setConfig = useSetConfig();
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setConfig(config);
|
|
14
|
+
}, [config, setConfig]);
|
|
15
|
+
}
|
|
16
|
+
export function useShouldShowSearchBar() {
|
|
17
|
+
const config = useConfig();
|
|
18
|
+
return config.content.showSearchBar;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../state/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,MAAM,UAAU,SAAS;IACvB,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,YAAY;IACnB,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,MAAqB;IACvD,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,OAAO,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC;AACtC,CAAC"}
|