forked from SolidOS/solid-panes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
62 lines (58 loc) · 2.05 KB
/
index.js
File metadata and controls
62 lines (58 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* SOLID PANES
**
** Panes are regions of the outline view in which a particular subject is
** displayed in a particular way.
** Different panes about the same subject are typically stacked vertically.
** Panes may be used naked or with a pane selection header.
**
** The label() method has two functions: it determines whether the pane is
** relevant to a given subject, returning null if not.
** If it is relevant, then it returns a suitable tooltip for a control which selects the pane
*/
import versionInfo from './versionInfo';
import * as UI from 'solid-ui-jss';
import { solidLogicSingleton, store } from 'solid-logic-jss';
import OutlineManager from './outline/manager.js';
import { registerPanes } from './registerPanes.js';
import { list, paneForIcon, paneForPredicate, register, byName } from 'pane-registry';
import { createContext } from './outline/context';
import initMainPage from './mainPage';
function getOutliner(dom) {
if (!dom.outlineManager) {
const context = createContext(dom, {
list,
paneForIcon,
paneForPredicate,
register,
byName
}, store, solidLogicSingleton);
dom.outlineManager = new OutlineManager(context);
}
return dom.outlineManager;
}
if (typeof window !== 'undefined') {
getOutliner(window.document);
}
registerPanes(cjsOrEsModule => register(cjsOrEsModule.default || cjsOrEsModule));
// This has common outline mode functionality for the default and other other panes
// A separate outline manager is required per DOM in cases like a browser extension
// where there are many occurrences of window and of window.document
// But each DOM should have just one outline manager.
export { OutlineManager, getOutliner, UI, versionInfo, initMainPage, list,
// from paneRegistry
paneForIcon,
// from paneRegistry
paneForPredicate,
// from paneRegistry
register,
// from paneRegistry
byName // from paneRegistry
};
// export for simpler access by non-node scripts
if (typeof window !== 'undefined') {
;
window.panes = {
getOutliner
};
}
//# sourceMappingURL=index.js.map