markuapad 0.1.7
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.
- checksums.yaml +7 -0
- data/.babelrc +3 -0
- data/.gitignore +30 -0
- data/.jshintrc +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +30 -0
- data/Rakefile +1 -0
- data/app/assets/javascripts/markuapad.js +72 -0
- data/app/assets/stylesheets/markuapad.css +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/bower.json +30 -0
- data/build/app.css +1 -0
- data/build/app.js +72 -0
- data/build/browser-polyfill.min.js +3 -0
- data/build/dist.css +1 -0
- data/build/dist.js +72 -0
- data/build/index.css +1 -0
- data/build/index.html +30 -0
- data/build/index.js +1 -0
- data/build/web.css +1 -0
- data/build/web.js +72 -0
- data/lib/markuapad.rb +5 -0
- data/lib/markuapad/engine.rb +4 -0
- data/lib/markuapad/version.rb +3 -0
- data/markuapad.gemspec +32 -0
- data/package.json +55 -0
- data/prepare_gem.sh +3 -0
- data/src/dist.js +7 -0
- data/src/file_accessor.js +77 -0
- data/src/index.js +180 -0
- data/src/jsx/editor.jsx +122 -0
- data/src/jsx/file_browser.jsx +252 -0
- data/src/jsx/file_browser_list_item.jsx +86 -0
- data/src/jsx/image_modal.jsx +49 -0
- data/src/jsx/live_preview.jsx +36 -0
- data/src/jsx/main.jsx +145 -0
- data/src/jsx/preview.jsx +32 -0
- data/src/jsx/toolbar.jsx +24 -0
- data/src/markuapad.js +39 -0
- data/src/styles/_editor.scss +27 -0
- data/src/styles/_extendables.scss +115 -0
- data/src/styles/_file_browser.scss +160 -0
- data/src/styles/_grid-settings.scss +13 -0
- data/src/styles/_layout.scss +18 -0
- data/src/styles/_modal.scss +145 -0
- data/src/styles/_preview.scss +65 -0
- data/src/styles/_toolbar.scss +99 -0
- data/src/styles/_variables.scss +25 -0
- data/src/styles/_workspace.scss +31 -0
- data/src/styles/app.scss +52 -0
- data/src/styles/index.scss +41 -0
- data/src/util.js +43 -0
- data/src/web.js +4 -0
- data/test/editor.es6 +6 -0
- data/webpack.config.js +48 -0
- metadata +129 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
.markuapad .file-browser {
|
|
2
|
+
@extend %box-shadow;
|
|
3
|
+
|
|
4
|
+
@include flex(0 0 auto);
|
|
5
|
+
@include pad($file-browser-padding 0 $file-browser-padding $file-browser-padding);
|
|
6
|
+
@include user-select(none);
|
|
7
|
+
@include transition(flex-basis $base-transition-duration/2 ease-in-out);
|
|
8
|
+
|
|
9
|
+
background: $files-background;
|
|
10
|
+
min-height: $files-min-height;
|
|
11
|
+
|
|
12
|
+
.file-types-list {
|
|
13
|
+
padding-right: 70px;
|
|
14
|
+
li {
|
|
15
|
+
display: inline-block;
|
|
16
|
+
margin: 0 5px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// The little file-type headers
|
|
21
|
+
.title {
|
|
22
|
+
color: #aaa;
|
|
23
|
+
font-variant: small-caps;
|
|
24
|
+
font-size: 1em;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
color: $light-blue;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.selected {
|
|
32
|
+
color: $blue;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// The new file creation button
|
|
37
|
+
.new-file {
|
|
38
|
+
@include transition(all $base-transition-duration/2 ease-in-out);
|
|
39
|
+
border: thin solid rgba(0, 0, 0, .1);
|
|
40
|
+
border-radius: 15px;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
padding: 6px 8px;
|
|
43
|
+
position: absolute;
|
|
44
|
+
right: 10px;
|
|
45
|
+
top: 10px;
|
|
46
|
+
line-height: 16px;
|
|
47
|
+
|
|
48
|
+
i {
|
|
49
|
+
font-size: 1em;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:hover,
|
|
53
|
+
&:active {
|
|
54
|
+
border-color: rgba(0, 0, 0, .4);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.active {
|
|
58
|
+
@include transform(rotate(45deg));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// The new file creation form
|
|
63
|
+
.file-name {
|
|
64
|
+
@include display(flex);
|
|
65
|
+
margin: 0;
|
|
66
|
+
|
|
67
|
+
button {
|
|
68
|
+
font-size: .75em;
|
|
69
|
+
height: 36px;
|
|
70
|
+
margin: 0 5px;
|
|
71
|
+
width: 80px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Busy indicator
|
|
76
|
+
.busy-indicator {
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: 3em;
|
|
79
|
+
left: 0;
|
|
80
|
+
right: 0;
|
|
81
|
+
text-align: center;
|
|
82
|
+
color: $light-blue;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// A file list item
|
|
86
|
+
.files-list-item {
|
|
87
|
+
position: relative;
|
|
88
|
+
|
|
89
|
+
a {
|
|
90
|
+
@include border-left-radius(3px);
|
|
91
|
+
@include transition(background $base-transition-duration/2 ease-in-out);
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
display: block;
|
|
94
|
+
font-size: .9em;
|
|
95
|
+
padding: .2em 2.5em .2em .5em;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&.current a {
|
|
99
|
+
background: rgba(0, 0, 0, .1);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Hover state
|
|
103
|
+
&:hover {
|
|
104
|
+
a { background: rgba(0, 0, 0, .05); }
|
|
105
|
+
button {
|
|
106
|
+
display: block;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// The delete button
|
|
111
|
+
> button {
|
|
112
|
+
@extend %vanilla-button;
|
|
113
|
+
padding: 5px;
|
|
114
|
+
position: absolute;
|
|
115
|
+
top: 0;
|
|
116
|
+
right: 0;
|
|
117
|
+
display: none;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Close the file browser button
|
|
122
|
+
.close-button {
|
|
123
|
+
@extend %close-button;
|
|
124
|
+
|
|
125
|
+
left: 0;
|
|
126
|
+
padding: 0;
|
|
127
|
+
position: absolute;
|
|
128
|
+
top: 50%;
|
|
129
|
+
|
|
130
|
+
span {
|
|
131
|
+
@include transition(transform $base-transition-duration/2 ease-in-out);
|
|
132
|
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==');
|
|
133
|
+
background-position: center;
|
|
134
|
+
background-repeat: no-repeat;
|
|
135
|
+
display: inline-block;
|
|
136
|
+
height: 16px;
|
|
137
|
+
width: 16px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Open state
|
|
142
|
+
&.open {
|
|
143
|
+
@include flex-basis(auto);
|
|
144
|
+
.new-file { display: block; }
|
|
145
|
+
|
|
146
|
+
.close-button span {
|
|
147
|
+
@include transform(rotate(-90deg));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Closed state
|
|
152
|
+
&.closed {
|
|
153
|
+
@include flex-basis(0);
|
|
154
|
+
.new-file { display: none; }
|
|
155
|
+
.close-button span {
|
|
156
|
+
@include transform(rotate(90deg));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@import "../../bower_components/neat/app/assets/stylesheets/neat-helpers";
|
|
2
|
+
|
|
3
|
+
// Neat Overrides
|
|
4
|
+
$grid-columns: 12;
|
|
5
|
+
$max-width: em(1024);
|
|
6
|
+
|
|
7
|
+
// Neat Breakpoints
|
|
8
|
+
$medium-screen: em(640);
|
|
9
|
+
$large-screen: em(860);
|
|
10
|
+
$small-screen: new-breakpoint(max-width em(860) 4);
|
|
11
|
+
|
|
12
|
+
$medium-screen-up: new-breakpoint(min-width $medium-screen 4);
|
|
13
|
+
$large-screen-up: new-breakpoint(min-width $large-screen 8);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.markuapad {
|
|
2
|
+
&.container,
|
|
3
|
+
.container {
|
|
4
|
+
@include outer-container;
|
|
5
|
+
@include pad(0 1em);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&.large-container,
|
|
9
|
+
.large-container {
|
|
10
|
+
@include outer-container;
|
|
11
|
+
@include pad;
|
|
12
|
+
max-width: em(1280); // Max width from design
|
|
13
|
+
@include media($large-screen) {
|
|
14
|
+
@include pad(0 1em);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
.markuapad {
|
|
2
|
+
.modal {
|
|
3
|
+
$base-border-color: #dcdcdc !default;
|
|
4
|
+
$base-border-radius: 3px !default;
|
|
5
|
+
$base-background-color: #fff !default;
|
|
6
|
+
$base-font-size: 1em !default;
|
|
7
|
+
$base-line-height: 1.5em !default;
|
|
8
|
+
$action-color: #477dca !default;
|
|
9
|
+
$dark-gray: #333 !default;
|
|
10
|
+
$light-gray: #ddd !default;
|
|
11
|
+
$medium-screen: em(640) !default;
|
|
12
|
+
$large-screen: em(860) !default;
|
|
13
|
+
$base-font-color: $dark-gray !default;
|
|
14
|
+
$modal-padding: 3em;
|
|
15
|
+
$modal-background: $base-background-color;
|
|
16
|
+
$modal-close-color: $light-gray;
|
|
17
|
+
$modal-image-height: 135px;
|
|
18
|
+
$modal-image-width: $modal-image-height;
|
|
19
|
+
$modal-trigger-image-width: 300px;
|
|
20
|
+
|
|
21
|
+
label {
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
margin-bottom: 0;
|
|
24
|
+
|
|
25
|
+
img {
|
|
26
|
+
border-radius: $modal-trigger-image-width / 2;
|
|
27
|
+
display: block;
|
|
28
|
+
max-width: $modal-trigger-image-width;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.modal-state {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.modal-trigger {
|
|
37
|
+
padding: .8em 1em;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Overlay
|
|
41
|
+
.modal-fade-screen {
|
|
42
|
+
@include position(fixed, 0 0 0 0);
|
|
43
|
+
background: rgba(0, 0, 0, .85);
|
|
44
|
+
opacity: 1;
|
|
45
|
+
padding-top: .6em;
|
|
46
|
+
text-align: left;
|
|
47
|
+
visibility: visible;
|
|
48
|
+
z-index: 99999999999;
|
|
49
|
+
|
|
50
|
+
@include media($large-screen) {
|
|
51
|
+
padding-top: 10em;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.modal-bg {
|
|
55
|
+
@include position(absolute, 0 0 0 0);
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.modal-close {
|
|
61
|
+
@include position(absolute, ($modal-padding /2) ($modal-padding /2) null null);
|
|
62
|
+
@include size(1.5em);
|
|
63
|
+
background: $modal-background;
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
|
|
66
|
+
&:after,
|
|
67
|
+
&:before {
|
|
68
|
+
@include position(absolute, 3px 3px 0 50%);
|
|
69
|
+
@include transform(rotate(45deg));
|
|
70
|
+
@include size(.15em 1.5em);
|
|
71
|
+
background: $modal-close-color;
|
|
72
|
+
content: '';
|
|
73
|
+
display: block;
|
|
74
|
+
margin: -3px 0 0 -1px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&:hover:after,
|
|
78
|
+
&:hover:before {
|
|
79
|
+
background: darken($modal-close-color, 10%);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:before {
|
|
83
|
+
@include transform(rotate(-45deg));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.modal-inner {
|
|
88
|
+
background: $modal-background;
|
|
89
|
+
border-radius: $base-border-radius;
|
|
90
|
+
margin: auto;
|
|
91
|
+
margin-top: 0;
|
|
92
|
+
max-height: 95%;
|
|
93
|
+
overflow: auto;
|
|
94
|
+
padding: $modal-padding / 2;
|
|
95
|
+
position: relative;
|
|
96
|
+
top: .5em;
|
|
97
|
+
width: 95%;
|
|
98
|
+
|
|
99
|
+
@include media($medium-screen) {
|
|
100
|
+
max-height: 70%;
|
|
101
|
+
padding: $modal-padding;
|
|
102
|
+
width: 60%;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@include media($large-screen) {
|
|
106
|
+
width: 50%;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
h1 {
|
|
110
|
+
color: $base-font-color;
|
|
111
|
+
margin-bottom: 0 0 .6em 0;
|
|
112
|
+
text-align: left;
|
|
113
|
+
text-transform: capitalize;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
p {
|
|
117
|
+
color: $base-font-color;
|
|
118
|
+
line-height: $base-line-height;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.modal-intro {
|
|
122
|
+
font-weight: 800;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.modal-content {
|
|
126
|
+
color: $base-font-color;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.cta {
|
|
130
|
+
color: #fff;
|
|
131
|
+
display: inline-block;
|
|
132
|
+
margin-right: .5em;
|
|
133
|
+
margin-top: 1em;
|
|
134
|
+
|
|
135
|
+
&:last-child {
|
|
136
|
+
padding: 0 2em;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.modal-open {
|
|
143
|
+
overflow: hidden;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
.markuapad .preview {
|
|
2
|
+
@include transition(top $base-transition-duration/2 ease-in-out);
|
|
3
|
+
|
|
4
|
+
background: $white;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
position: absolute;
|
|
8
|
+
right: 0;
|
|
9
|
+
top: 100%;
|
|
10
|
+
z-index: 10;
|
|
11
|
+
overflow: auto;
|
|
12
|
+
|
|
13
|
+
// Preview states
|
|
14
|
+
&.closed {
|
|
15
|
+
top: 100%;
|
|
16
|
+
> * { display: none; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.previewing,
|
|
20
|
+
&.done {
|
|
21
|
+
top: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
> header {
|
|
25
|
+
position: relative;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// The close button
|
|
29
|
+
.close {
|
|
30
|
+
@extend %vanilla-button;
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 10px;
|
|
33
|
+
right: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.content {
|
|
37
|
+
margin-top: 4em;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
// Shared content styles
|
|
43
|
+
.markuapad .live-preview,
|
|
44
|
+
.markuapad .preview {
|
|
45
|
+
// main content
|
|
46
|
+
.content {
|
|
47
|
+
em,
|
|
48
|
+
i,
|
|
49
|
+
{
|
|
50
|
+
font-style: italic;
|
|
51
|
+
}
|
|
52
|
+
ul { @extend %default-ul; }
|
|
53
|
+
ol { @extend %default-ol; }
|
|
54
|
+
|
|
55
|
+
&,
|
|
56
|
+
h1,
|
|
57
|
+
h2,
|
|
58
|
+
h3,
|
|
59
|
+
h4,
|
|
60
|
+
h5,
|
|
61
|
+
h6 {
|
|
62
|
+
font-family: "Roboto Slab", serif;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
%nav-button {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
margin: 0 5px;
|
|
4
|
+
position: relative;
|
|
5
|
+
|
|
6
|
+
&:hover > a {
|
|
7
|
+
background: #fff;
|
|
8
|
+
border-color: rgba(0, 0, 0, .2);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
> a {
|
|
12
|
+
@include transition(all $base-transition-duration/2 ease-in-out);
|
|
13
|
+
border: thin solid rgba(0, 0, 0, .05);
|
|
14
|
+
border-radius: 18px;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
padding: 8px 20px;
|
|
17
|
+
color: #555;
|
|
18
|
+
|
|
19
|
+
&.active {
|
|
20
|
+
background: $blue;
|
|
21
|
+
color: white;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.disabled {
|
|
25
|
+
color: #aaa;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.markuapad .toolbar {
|
|
31
|
+
@include display(flex);
|
|
32
|
+
margin: 20px 0;
|
|
33
|
+
padding: 0 10px;
|
|
34
|
+
|
|
35
|
+
.book-title {
|
|
36
|
+
@include flex(1);
|
|
37
|
+
@include order(1);
|
|
38
|
+
margin: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.menus {
|
|
42
|
+
// For now we don't need this
|
|
43
|
+
display: none;
|
|
44
|
+
|
|
45
|
+
@include flex(1);
|
|
46
|
+
@include order(1);
|
|
47
|
+
z-index: 1;
|
|
48
|
+
|
|
49
|
+
.dropdown {
|
|
50
|
+
@extend %nav-button;
|
|
51
|
+
|
|
52
|
+
.dropdown-menu {
|
|
53
|
+
@include transition(all $base-transition-duration/2 ease-in-out);
|
|
54
|
+
height: 0;
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: 100%;
|
|
57
|
+
left: 0;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
background: #fff;
|
|
60
|
+
margin-top: 0;
|
|
61
|
+
min-width: 150px;
|
|
62
|
+
z-index: -1;
|
|
63
|
+
border-color: rgba(0, 0, 0, 0.1);
|
|
64
|
+
border-radius: 18px;
|
|
65
|
+
|
|
66
|
+
a {
|
|
67
|
+
padding: 8px 20px;
|
|
68
|
+
color: #555;
|
|
69
|
+
display: block;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Hover state
|
|
75
|
+
&:hover {
|
|
76
|
+
> a {
|
|
77
|
+
@include border-bottom-radius(0);
|
|
78
|
+
border-bottom: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.dropdown-menu {
|
|
82
|
+
border-radius: 18px;
|
|
83
|
+
height: auto;
|
|
84
|
+
min-height: 100%;
|
|
85
|
+
border: thin solid rgba(0, 0, 0, .2);
|
|
86
|
+
border-top-left-radius: 0;
|
|
87
|
+
margin-top: 6px;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.actions {
|
|
94
|
+
@include order(2);
|
|
95
|
+
li {
|
|
96
|
+
@extend %nav-button;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|