dante2-editor 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +33 -0
  3. data/Gemfile +25 -0
  4. data/Gemfile.lock +42 -0
  5. data/README.md +107 -0
  6. data/app/assets/index.html +55 -0
  7. data/app/assets/license.html +52 -0
  8. data/app/assets/options.html +57 -0
  9. data/app/assets/store.json +1 -0
  10. data/app/components/App.cjsx +1083 -0
  11. data/app/components/blocks/embed.cjsx +109 -0
  12. data/app/components/blocks/image.cjsx +316 -0
  13. data/app/components/blocks/placeholder.cjsx +60 -0
  14. data/app/components/blocks/video.cjsx +75 -0
  15. data/app/components/debug.cjsx +96 -0
  16. data/app/components/decorators/link.cjsx +61 -0
  17. data/app/components/popovers/addButton.cjsx +247 -0
  18. data/app/components/popovers/image.cjsx +160 -0
  19. data/app/components/popovers/link.cjsx +87 -0
  20. data/app/components/popovers/toolTip.cjsx +326 -0
  21. data/app/data/poc.js +15 -0
  22. data/app/demo.js +7 -0
  23. data/app/images/dante/media-loading-placeholder.png +0 -0
  24. data/app/images/site/dante-demo.png +0 -0
  25. data/app/images/site/dante-editor-logo.png +0 -0
  26. data/app/images/site/github-logo.png +0 -0
  27. data/app/initialize.js +4 -0
  28. data/app/model/index.js +194 -0
  29. data/app/styles/dante.scss +22 -0
  30. data/app/styles/dante/_animations.scss +54 -0
  31. data/app/styles/dante/_caption.scss +61 -0
  32. data/app/styles/dante/_debug.scss +124 -0
  33. data/app/styles/dante/_fonts.scss +17 -0
  34. data/app/styles/dante/_graf.scss +242 -0
  35. data/app/styles/dante/_icons.scss +62 -0
  36. data/app/styles/dante/_media.scss +39 -0
  37. data/app/styles/dante/_menu.scss +201 -0
  38. data/app/styles/dante/_needsorder.scss +209 -0
  39. data/app/styles/dante/_popover.scss +212 -0
  40. data/app/styles/dante/_post.scss +67 -0
  41. data/app/styles/dante/_scaffold.scss +24 -0
  42. data/app/styles/dante/_tooltip.scss +130 -0
  43. data/app/styles/dante/_utilities.scss +59 -0
  44. data/app/styles/dante/_variables.scss +96 -0
  45. data/app/styles/dante/blame.scss +246 -0
  46. data/app/styles/draft.css +297 -0
  47. data/app/styles/fonts/dante/dante.eot +0 -0
  48. data/app/styles/fonts/dante/dante.svg +18 -0
  49. data/app/styles/fonts/dante/dante.ttf +0 -0
  50. data/app/styles/fonts/dante/dante.woff +0 -0
  51. data/app/styles/fonts/dante/fontello.eot +0 -0
  52. data/app/styles/fonts/dante/fontello.svg +36 -0
  53. data/app/styles/fonts/dante/fontello.ttf +0 -0
  54. data/app/styles/fonts/dante/fontello.woff +0 -0
  55. data/app/styles/layout/layout.scss +64 -0
  56. data/app/styles/layout/normalize.css +375 -0
  57. data/app/styles/layout/scaffold.scss +8 -0
  58. data/app/styles/layout/tooltips.scss +216 -0
  59. data/app/utils/find_entities.coffee +20 -0
  60. data/app/utils/html2content.coffee +120 -0
  61. data/app/utils/logger.coffee +0 -0
  62. data/app/utils/save_content.coffee +63 -0
  63. data/app/utils/selection.js +53 -0
  64. data/config.ru +64 -0
  65. data/dante2.gemspec +19 -0
  66. data/docs/app.css +2 -0
  67. data/docs/app.css.map +1 -0
  68. data/docs/app.js +3 -0
  69. data/docs/app.js.map +1 -0
  70. data/docs/dante-vendors.js +28 -0
  71. data/docs/dante-vendors.js.map +1 -0
  72. data/docs/dante.css +2 -0
  73. data/docs/dante.css.map +1 -0
  74. data/docs/dante.js +4 -0
  75. data/docs/dante.js.map +1 -0
  76. data/docs/doc.html +57 -0
  77. data/docs/fonts/dante.eot +0 -0
  78. data/docs/fonts/dante.svg +18 -0
  79. data/docs/fonts/dante.ttf +0 -0
  80. data/docs/fonts/dante.woff +0 -0
  81. data/docs/fonts/fontello.eot +0 -0
  82. data/docs/fonts/fontello.svg +36 -0
  83. data/docs/fonts/fontello.ttf +0 -0
  84. data/docs/fonts/fontello.woff +0 -0
  85. data/docs/images/dante-editor-logo.png +0 -0
  86. data/docs/images/github-logo.png +0 -0
  87. data/docs/index.html +55 -0
  88. data/docs/license.html +52 -0
  89. data/lib/dante2-editor.rb +5 -0
  90. data/lib/dante2-editor/rails.rb +16 -0
  91. data/lib/dante2-editor/version.rb +5 -0
  92. data/package.json +61 -0
  93. data/rakefile +1 -0
  94. data/webpack.config.js +148 -0
  95. data/yarn.lock +4704 -0
  96. metadata +139 -0
@@ -0,0 +1,17 @@
1
+ @mixin dante-font-face($font-family, $file-name, $font-weight: normal, $font-style: normal) {
2
+ @font-face {
3
+ font-family: '#{$font-family}';
4
+ src: url('./fonts/dante/#{$file-name}.eot');
5
+ src: url('./fonts/dante/#{$file-name}.eot?#iefix') format('embedded-opentype'),
6
+ url('./fonts/dante/#{$file-name}.woff') format('woff'),
7
+ url('./fonts/dante/#{$file-name}.ttf') format('truetype'),
8
+ url('./fonts/dante/#{$file-name}.svg##{$file-name}') format('svg');
9
+ font-weight: $font-weight;
10
+ font-style: $font-style;
11
+ }
12
+ }
13
+
14
+ @include dante-font-face(dante, fontello);
15
+ @include dante-font-face(dante-tooltip, dante);
16
+
17
+ @import url('//fonts.googleapis.com/css?family=Merriweather:400,700,400italic,700italic|Open+Sans:400,300,800');
@@ -0,0 +1,242 @@
1
+ .graf--h2,
2
+ .graf--h3,
3
+ .graf--h4,
4
+ .graf--h5,
5
+ .graf--h6,
6
+ .graf--h7,
7
+ .postList,
8
+ .graf--figure,
9
+ .graf--blockquote,
10
+ .graf--pullquote,
11
+ .graf--p,
12
+ .graf--pre {
13
+ margin: 0;
14
+ //position:relative;
15
+ }
16
+
17
+ .postList {
18
+ margin-bottom: 30px;
19
+ }
20
+
21
+ .graf--p,
22
+ .graf--blockquote,
23
+ .graf--pullquote {
24
+ margin-bottom: 30px;
25
+ }
26
+
27
+ .graf--code {
28
+ line-height: 1em;
29
+ }
30
+
31
+ .graf--p.dante--spinner{
32
+ position:relative;
33
+ }
34
+
35
+ .graf--h2 {
36
+ font-family: $dante-font-family-sans;
37
+ font-size: 60px;
38
+ font-style: normal;
39
+ font-weight: 700;
40
+ letter-spacing: -0.04em;
41
+ line-height: 1;
42
+ margin-bottom: 8px;
43
+ margin-left: -3px;
44
+ margin-top: 40px;
45
+ padding-top: 0;
46
+ }
47
+ .graf--h3 {
48
+ font-family: $dante-font-family-sans;
49
+ letter-spacing: -0.02em;
50
+ font-weight: 700;
51
+ font-style: normal;
52
+ font-size: 36px;
53
+ margin-left: -1.8px;
54
+ line-height: 1.2;
55
+ margin-top: 40px;
56
+ margin-bottom: 4px;
57
+ }
58
+ .graf--h4 {
59
+ font-family: $dante-font-family-sans;
60
+ letter-spacing: -0.02em;
61
+ font-weight: 300;
62
+ font-style: normal;
63
+ font-size: 30px;
64
+ margin-left: -1.5px;
65
+ line-height: 1.2;
66
+ color: rgba(0,0,0,0.44);
67
+ margin-top: 40px;
68
+ margin-bottom: 2px;
69
+ }
70
+
71
+ .section--first .graf--h2.graf--first,
72
+ .section--first .graf--h3.graf--first,
73
+ .section--first .graf--h4.graf--first {
74
+ margin-top: 0;
75
+ padding-top: 0;
76
+ }
77
+
78
+ .graf--h2 + .graf--h2 {
79
+ margin-top: -8px;
80
+ }
81
+
82
+ .graf--h2 + .graf--h3,
83
+ .graf--h2 + .graf--h4 {
84
+ margin-top: -6px;
85
+ }
86
+
87
+ .graf--h3 + .graf--h2,
88
+ .graf--h4 + .graf--h2 {
89
+ margin-top: 2px;
90
+ }
91
+
92
+ .graf--h3 + .graf--h4,
93
+ .graf--h4 + .graf--h3 {
94
+ margin-top: -2px;
95
+ }
96
+
97
+ .graf--h2 + .postList,
98
+ .graf--h3 + .postList,
99
+ .graf--h4 + .postList {
100
+ margin-top: 10px;
101
+ }
102
+
103
+ .graf--h2 + .graf--p.graf--empty,
104
+ .graf--h3 + .graf--p.graf--empty,
105
+ .graf--h4 + .graf--p.graf--empty {
106
+ margin-bottom: -7px;
107
+ margin-top: -7px;
108
+ }
109
+
110
+ .graf--h2 + .graf--p.graf--empty + .graf--h2,
111
+ .graf--h3 + .graf--p.graf--empty + .graf--h2,
112
+ .graf--h4 + .graf--p.graf--empty + .graf--h2 {
113
+ margin-top: -5px;
114
+ }
115
+
116
+ .graf--h2 + .graf--p.graf--empty + .graf--h3,
117
+ .graf--h3 + .graf--p.graf--empty + .graf--h3,
118
+ .graf--h4 + .graf--p.graf--empty + .graf--h3,
119
+ .graf--h2 + .graf--p.graf--empty + .graf--h4,
120
+ .graf--h3 + .graf--p.graf--empty + .graf--h4,
121
+ .graf--h4 + .graf--p.graf--empty + .graf--h4 {
122
+ margin-top: -8px;
123
+ }
124
+
125
+
126
+ .graf--blockquote, blockquote {
127
+ font-family: $dante-font-family-serif;
128
+ border-left: 3px solid rgba(0, 0, 0, 0.8);
129
+ font-style: italic;
130
+ font-weight: 400;
131
+ letter-spacing: 0.01rem;
132
+ margin-left: -23px;
133
+ padding-bottom: 3px;
134
+ padding-left: 20px;
135
+ }
136
+ .graf--blockquote + .graf--blockquote, blockquote + blockquote {
137
+ margin-top: -30px;
138
+ padding-top: 30px;
139
+ }
140
+
141
+ .graf--pullquote {
142
+ line-height: 1.4;
143
+ text-align: center;
144
+ font-size: 32px;
145
+ margin: 48px -160px;
146
+ border: none;
147
+ padding: 0;
148
+ font-family: $dante-font-family-serif;
149
+ letter-spacing: 0.01rem;
150
+ font-weight: 400;
151
+ font-style: italic;
152
+ -webkit-transition: margin 100ms;
153
+ transition: margin 100ms;
154
+ }
155
+
156
+ .graf--pre, .public-DraftStyleDefault-pre {
157
+ background: none repeat scroll 0 0 rgba(0, 0, 0, 0.05);
158
+ font-family: $dante-font-family-mono;
159
+ font-size: 16px;
160
+ margin-bottom: 20px;
161
+ padding: 20px;
162
+ white-space: pre-wrap;
163
+ }
164
+ .graf--pre + .graf--pre {
165
+ margin-top: -20px;
166
+ }
167
+
168
+ .graf--figure {
169
+ & {
170
+ box-sizing: border-box;
171
+ clear: both;
172
+ margin-bottom: 30px;
173
+ outline: medium none;
174
+ position: relative;
175
+ }
176
+ &.is-mediaFocused .graf-image,
177
+ &.is-mediaFocused iframe {
178
+ box-shadow: 0 0 0 3px #57ad68;
179
+ }
180
+ }
181
+
182
+ .graf--mixtapeEmbed {
183
+ a {
184
+ text-decoration: none;
185
+ }
186
+ }
187
+
188
+ .graf--h4 + .graf--figure,
189
+ .graf--h3 + .graf--figure,
190
+ .graf--h2 + .graf--figure {
191
+ margin-top: 15px;
192
+ }
193
+
194
+ .graf--first {
195
+ margin-top: 0;
196
+ padding-top: 0;
197
+ }
198
+
199
+ /*.graf--empty {
200
+ margin-bottom: -7px;
201
+ margin-top: -7px;
202
+ }*/
203
+
204
+ p[data-align="center"],
205
+ .graf--h2[data-align="center"],
206
+ .graf--h3[data-align="center"],
207
+ .graf--h4[data-align="center"],
208
+ .graf--blockquote[data-align="center"] {
209
+ text-align: center;
210
+ }
211
+
212
+ .markup--anchor,
213
+ .graf--sectionCaption {
214
+ cursor: text;
215
+ }
216
+ .markup--anchor {
217
+ text-decoration: underline;
218
+ color: inherit;
219
+ }
220
+
221
+ @media (max-width: 500px) {
222
+
223
+ .graf--h2 {
224
+ font-size: 36px;
225
+ line-height: 1.1;
226
+ padding-top: 12px;
227
+ margin-bottom: 6px;
228
+ }
229
+ .graf--h3 {
230
+ font-size: 26px;
231
+ line-height: 1.2;
232
+ margin-top: 18px;
233
+ margin-bottom: 4px;
234
+ }
235
+ .graf--h4 {
236
+ font-size: 24px;
237
+ line-height: 1.2;
238
+ margin-top: 18px;
239
+ margin-bottom: 2px;
240
+ }
241
+
242
+ }
@@ -0,0 +1,62 @@
1
+ .dante-icon {
2
+ &:before {
3
+ display: inline-block;
4
+ font-family: "dante";
5
+ font-style: normal;
6
+ font-variant: normal;
7
+ font-weight: normal;
8
+ line-height: 1em;
9
+ text-align: center;
10
+ text-decoration: inherit;
11
+ text-transform: none;
12
+ }
13
+ }
14
+
15
+ .dante-icon-h2:before { content: "H1"; }
16
+ .dante-icon-h3:before { content: "H2"; }
17
+ .dante-icon-h4:before { content: "H3"; }
18
+ .dante-icon-p:before { content: "P"; }
19
+ .dante-icon-code:before { content: ""; }
20
+ .dante-icon-insertorderedlist:before { content: ""; }
21
+ .dante-icon-insertunorderedlist:before { content: ""; }
22
+ .dante-icon-inserthorizontalrule:before { content: ""; }
23
+ .dante-icon-indent:before { content: ""; }
24
+ .dante-icon-outdent:before { content: ""; }
25
+ .dante-icon-bold:before { content: ""; }
26
+ .dante-icon-italic:before { content: ""; }
27
+ .dante-icon-underline:before { content: ""; }
28
+ .dante-icon-createlink:before { content: ""; }
29
+ .dante-icon-blockquote:before { content: ""; }
30
+
31
+ .dante-icon-h2:before,
32
+ .dante-icon-h3:before,
33
+ .dante-icon-h4:before {
34
+ font-weight: bold;
35
+ }
36
+
37
+ .tooltip-icon {
38
+ &:before {
39
+ font-family: 'dante-tooltip';
40
+ speak: none;
41
+ font-style: normal;
42
+ font-weight: normal;
43
+ font-variant: normal;
44
+ text-transform: none;
45
+ line-height: 1;
46
+
47
+ // Better Font Rendering
48
+ -webkit-font-smoothing: antialiased;
49
+ -moz-osx-font-smoothing: grayscale;
50
+ }
51
+ }
52
+
53
+ .dante-icon-image-center:before { content: "\e900"; }
54
+ .dante-icon-image-fill:before { content: "\e901"; }
55
+ .dante-icon-image-left:before { content: "\e902"; }
56
+ .dante-icon-image-wide:before { content: "\e903"; }
57
+
58
+ .dante-icon-video:before { content: "\e600"; }
59
+ .dante-icon-image:before { content: "\e601"; }
60
+ .dante-icon-plus:before { content: "\e602"; }
61
+ .dante-icon-embed:before { content: "\e603"; }
62
+
@@ -0,0 +1,39 @@
1
+ .aspectRatioPlaceholder {
2
+ margin: 0 auto;
3
+ position: relative;
4
+ width: 100%;
5
+ }
6
+
7
+ .graf-image:before,
8
+ .iframeContainer:before {
9
+ .is-postEditMode & {
10
+ bottom: 0;
11
+ content: "";
12
+ left: 0;
13
+ position: absolute;
14
+ right: 0;
15
+ top: 0;
16
+ z-index: 500;
17
+ }
18
+ }
19
+
20
+ .graf-image,
21
+ .graf-imageAnchor {
22
+ .aspectRatioPlaceholder.is-locked & {
23
+ height: 100%;
24
+ left: 0;
25
+ position: absolute;
26
+ top: 0;
27
+ width: 100%;
28
+ }
29
+ }
30
+
31
+ .graf-image,
32
+ .graf-imageAnchor,
33
+ .iframeContainer > iframe,
34
+ .iframeContainer {
35
+ box-sizing: border-box;
36
+ display: block;
37
+ margin: auto;
38
+ max-width: 100%;
39
+ }
@@ -0,0 +1,201 @@
1
+ // Base styles
2
+
3
+ .dante-menu {
4
+
5
+ // MENU
6
+ position: absolute;
7
+ visibility: hidden;
8
+ z-index: 1000;
9
+ -webkit-transition: none;
10
+ transition: none;
11
+ display: none;
12
+ top: 0;
13
+ left: 0;
14
+ display:block;
15
+ white-space: nowrap;
16
+
17
+ height: $dante-menu-height;
18
+ background: $dante-menu-background;
19
+ color: $dante-menu-color;
20
+
21
+ @if $dante-menu-border-width {
22
+ border: $dante-menu-border-width;
23
+ }
24
+ @if $dante-menu-border-radius {
25
+ border-radius: $dante-menu-border-radius;
26
+ }
27
+ @if $dante-menu-box-shadow {
28
+ box-shadow: $dante-menu-box-shadow;
29
+ }
30
+
31
+
32
+ // CARET
33
+ // &:before -> Borde
34
+ // &:after -> Triangulo
35
+ @if $dante-menu-caret-size {
36
+ //&:before,
37
+ &:after {
38
+ content: "";
39
+ height: 0;
40
+ width: 0;
41
+ position: absolute;
42
+ left: 50%;
43
+ pointer-events: none;
44
+ border: $dante-menu-caret-size solid transparent;
45
+ margin-left: -($dante-menu-caret-size/2);
46
+ }
47
+ //&:before {
48
+ // border-top-color: $menu-border-color;
49
+ // bottom: -($dante-menu-caret-size*2);
50
+ //}
51
+ &:after {
52
+ border-top-color: $dante-menu-background;
53
+ bottom: -(($dante-menu-caret-size*2)-1);
54
+ }
55
+ }
56
+
57
+ }
58
+
59
+
60
+ // Visible
61
+
62
+ .dante-menu--active {
63
+ display: inline-block;
64
+ visibility: visible;
65
+ -webkit-animation: pop-upwards 180ms forwards linear;
66
+ animation: pop-upwards 180ms forwards linear;
67
+ }
68
+
69
+
70
+ // Link mode
71
+
72
+ .dante-menu--linkmode {
73
+ .dante-menu-buttons {
74
+ visibility: hidden;
75
+ }
76
+ .dante-menu-linkinput {
77
+ display: block;
78
+ }
79
+ .dante-menu-input {
80
+ -webkit-animation: pop-upwards 180ms forwards linear;
81
+ animation: pop-upwards 180ms forwards linear;
82
+ }
83
+ }
84
+
85
+
86
+ // BUTONS
87
+
88
+ .dante-menu-buttons {
89
+ list-style: none;
90
+ margin: 0;
91
+ padding: 0;
92
+ line-height: 0;
93
+ }
94
+ .dante-menu-divider {
95
+ width: 1px;
96
+ height: $dante-menu-height - 18px;
97
+ margin: 9px 2px;
98
+ background: rgba($dante-menu-color,.2);
99
+ display: inline-block;
100
+ overflow: hidden;
101
+ cursor: default;
102
+ line-height: $dante-menu-height;
103
+ -webkit-user-select: none;
104
+ -moz-user-select: none;
105
+ -ms-user-select: none;
106
+ user-select: none;
107
+ }
108
+ .dante-menu-button {
109
+ & {
110
+ min-width: 20px;
111
+ display: inline-block;
112
+ padding-left: 10px;
113
+ padding-right: 10px;
114
+ overflow: hidden;
115
+ text-align: center;
116
+ color: $dante-menu-icon-color;
117
+ cursor: pointer;
118
+ font-size: $dante-menu-icon-size;
119
+ line-height: $dante-menu-height;
120
+ //height: $menu-button-height;
121
+ -webkit-user-select: none;
122
+ -moz-user-select: none;
123
+ -ms-user-select: none;
124
+ user-select: none;
125
+ }
126
+ &:hover{
127
+ // nada
128
+ }
129
+ &.active{
130
+ color: $dante-menu-icon-accent;
131
+ }
132
+
133
+ @if $dante-menu-border-radius {
134
+ &:first-child {
135
+ border-top-left-radius: $dante-menu-border-radius;
136
+ border-bottom-left-radius: $dante-menu-border-radius;
137
+ padding-left: 18px;
138
+ }
139
+ &:last-child {
140
+ border-top-right-radius: $dante-menu-border-radius;
141
+ border-bottom-right-radius: $dante-menu-border-radius;
142
+ padding-right: 18px;
143
+ }
144
+ }
145
+ }
146
+
147
+ .dante-menu-button--disabled {
148
+ -webkit-user-select: none !important;
149
+ -moz-user-select: none !important;
150
+ -ms-user-select: none !important;
151
+ user-select: none !important;
152
+ opacity: .3;
153
+ }
154
+
155
+
156
+ // LINK
157
+
158
+ .dante-menu-linkinput {
159
+ & {
160
+ display: none;
161
+ position: absolute;
162
+ top: 0;
163
+ left: 0;
164
+ right: 0;
165
+ bottom: 0;
166
+ }
167
+ .dante-menu-button {
168
+ position: absolute;
169
+ top: 0;
170
+ right: 0;
171
+ }
172
+ }
173
+
174
+ .dante-menu-input {
175
+ //height: $menu-height - 2;
176
+ //line-height: 20px;
177
+ position: absolute;
178
+ top: 0;
179
+ left: 0;
180
+ background: rgba(0,0,0,0);
181
+ width: 100%;
182
+ padding: 13px 40px 13px 10px;
183
+ color: $menu-color;
184
+ border: none;
185
+ outline: none;
186
+ font-size: 14px;
187
+ box-sizing: border-box;
188
+ border-radius: $menu-border-radius;
189
+ appearance: none;
190
+ text-align: left;
191
+ font-family: $dante-font-family-sans;
192
+ letter-spacing: 0.01rem;
193
+ font-weight: 400;
194
+ font-style: normal;
195
+ text-rendering: optimizeLegibility;
196
+ -webkit-font-smoothing: antialiased;
197
+ -moz-osx-font-smoothing: grayscale;
198
+ -moz-font-feature-settings: "liga" on;
199
+ }
200
+
201
+