1
1
phosphor-float-area
2
2
===================
3
3
4
+ Draggable, dockable, resizable, floating, tabbed ` Dialog ` and ` FloatArea ` widgets:
5
+
4
6
![ Screen recording] ( https://raw.githubusercontent.com/charto/phosphor-float-area/gh-pages/demo.gif )
5
7
6
- A ` FloatArea ` widget based on [ PhosphorJS] ( https://github.com/phosphorjs/phosphor ) .
7
- Widgets dropped over it become resizable, floating MDI-style dialogs.
8
- Widgets are also draggable between dialogs and dockable back to a containing ` DockPanel ` if available.
8
+ 100% Virtual DOM, TypeScript, [ PhosphorJS] ( https://github.com/phosphorjs/phosphor )
9
+ based modern JavaScript goodness :cake :
9
10
10
- Demo
11
- ----
11
+ Live demo
12
+ ---------
12
13
13
- [ See it online! ] ( https://charto.github.io/phosphor-float-area/ )
14
+ [ ** Try it now! ** ] ( https://charto.github.io/phosphor-float-area/ )
14
15
15
16
Alternatively, run the following commands and then open [ localhost:8080] ( http://localhost:8080/ ) to see it in action:
16
17
@@ -22,11 +23,32 @@ npm run prepublish
22
23
npm start
23
24
```
24
25
25
- The demo uses [ SystemJS] ( https://github.com/systemjs/systemjs ) , not webpack .
26
- That allows this repository to work directly from the public directory of any HTTP server.
27
- With ` compileOnSave ` (enabled in [ ` atom-typescript ` ] ( https://atom.io/packages/atom-typescript ) or
26
+ The demo uses [ SystemJS] ( https://github.com/systemjs/systemjs ) .
27
+ Works directly from the public directory of any HTTP server.
28
+ With ` compileOnSave ` (eg. [ ` atom-typescript ` ] ( https://atom.io/packages/atom-typescript ) or
28
29
[ TypeScript for VS Code] ( https://github.com/mrcrowl/vscode/releases/tag/13.10.8 ) )
29
- the demo in a browser always stays up to date with the latest TypeScript source.
30
+ the demo page always stays up to date while editing TypeScript source code.
31
+
32
+ Usage
33
+ -----
34
+
35
+ ``` TypeScript
36
+ import ' @phosphor/dragdrop/style/index.css!' ;
37
+ import ' @phosphor/widgets/style/index.css!' ;
38
+ import ' phosphor-float-area/style/index.css!' ;
39
+
40
+ import { Widget , DockPanel } from ' @phosphor/widgets' ;
41
+ import { FloatArea } from ' phosphor-float-area' ;
42
+
43
+ const area = new FloatArea ();
44
+ const dock = new DockPanel ();
45
+
46
+ dock .addWidget (area );
47
+ dock .addWidget (new Widget (), { mode: ' split-left' , ref: area });
48
+ dock .addWidget (new Widget (), { mode: ' split-right' , ref: area });
49
+
50
+ Widget .attach (dock , document .body );
51
+ ```
30
52
31
53
Project structure
32
54
-----------------
0 commit comments