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,24 @@
1
+ .notesSource {
2
+
3
+ & {
4
+ padding: 0;
5
+ margin: 0;
6
+ position: relative;
7
+ color: rgba(0,0,0,0.8);
8
+ text-rendering: optimizeLegibility;
9
+ -webkit-font-smoothing: antialiased;
10
+ -moz-osx-font-smoothing: grayscale;
11
+ -moz-font-feature-settings: liga on;
12
+ }
13
+
14
+ *,
15
+ *:before,
16
+ *:after {
17
+ box-sizing: border-box;
18
+ }
19
+
20
+ }
21
+
22
+ .dante-paste{
23
+ display:none;
24
+ }
@@ -0,0 +1,130 @@
1
+ .inlineTooltip {
2
+
3
+ // BASE
4
+ position: absolute;
5
+ z-index: 900;
6
+ width: $tooltip-size;
7
+ height: $tooltip-size;
8
+ -webkit-transition: opacity 100ms, width 0 linear 250ms;
9
+ transition: opacity 100ms, width 0 linear 250ms;
10
+ padding: 0;
11
+ font-size: 0;
12
+
13
+ opacity: 0;
14
+ pointer-events: none;
15
+
16
+ &.is-active {
17
+ opacity: 1;
18
+ pointer-events: auto;
19
+ }
20
+ &.is-scaled {
21
+ -webkit-transition-delay: 0;
22
+ transition-delay: 0;
23
+ width: auto;
24
+ }
25
+ }
26
+
27
+ // MENU
28
+ .inlineTooltip-menu {
29
+ display: inline-block;
30
+ margin-left: $tooltip-size + $tooltip-menu-spacing;
31
+ }
32
+
33
+ // BUTTON
34
+ .inlineTooltip-button {
35
+
36
+ // BASE
37
+ & {
38
+ background-color: white;
39
+ float: left;
40
+ margin-right: $tooltip-button-spacing;
41
+ display: inline-block;
42
+ position: relative;
43
+ outline: 0;
44
+ padding: 0;
45
+ vertical-align: bottom;
46
+ box-sizing: border-box;
47
+ border-radius: $tooltip-border-radius;
48
+ cursor: pointer;
49
+ font-size: 14px;
50
+ text-decoration: none;
51
+ font-family: $dante-font-family-sans;
52
+ letter-spacing: -0.02em;
53
+ font-weight: 400;
54
+ font-style: normal;
55
+ white-space: nowrap;
56
+ text-rendering: auto;
57
+ text-align: center;
58
+ text-rendering: optimizeLegibility;
59
+ -webkit-font-smoothing: antialiased;
60
+ -moz-osx-font-smoothing: grayscale;
61
+ -moz-font-feature-settings: "liga" on;
62
+ width: $tooltip-size;
63
+ height: $tooltip-size;
64
+ line-height: $tooltip-line-height;
65
+ -webkit-transition: 100ms border-color, 100ms color;
66
+ transition: 100ms border-color, 100ms color;
67
+ //background: rgba($tooltip-color, $tooltip-background-opacity);
68
+ border: $tooltip-border-width solid;
69
+ border-color: rgba($tooltip-color, $tooltip-color-opacity);
70
+ color: rgba($tooltip-color, $tooltip-color-opacity);
71
+ }
72
+
73
+ &:hover {
74
+ border-color: rgba($tooltip-color, $tooltip-color-opacity-hover);
75
+ color: rgba($tooltip-color, $tooltip-color-opacity-hover);
76
+ }
77
+
78
+ // SCALE
79
+ &.scale {
80
+ & {
81
+ -webkit-transform: scale(0);
82
+ -ms-transform: scale(0);
83
+ transform: scale(0);
84
+ -webkit-transition: -webkit-#{$tooltip-forward-transition}, $tooltip-default-transition;
85
+ transition: $tooltip-forward-transition, $tooltip-default-transition;
86
+ }
87
+ .is-scaled & {
88
+ -webkit-transform: scale(1);
89
+ -ms-transform: scale(1);
90
+ transform: scale(1);
91
+ -webkit-transition: -webkit-#{$tooltip-backward-transition}, $tooltip-default-transition;
92
+ transition: $tooltip-backward-transition, $tooltip-default-transition;
93
+ }
94
+
95
+ @while $tooltip-items > 0 {
96
+ &:nth-child(#{$tooltip-items + 1}) {
97
+ -webkit-transition-delay: #{$tooltip-item-delay * $tooltip-items + "ms"};
98
+ transition-delay: #{$tooltip-item-delay * $tooltip-items + "ms"};
99
+ }
100
+ $tooltip-items: $tooltip-items - 1;
101
+ }
102
+ }
103
+
104
+ // CONTROL
105
+ &.control {
106
+ & {
107
+ display: block;
108
+ position: absolute;
109
+ margin-right: $tooltip-menu-spacing;
110
+ }
111
+ & {
112
+ -webkit-transition: -webkit-#{$tooltip-forward-transition}, $tooltip-default-transition;
113
+ transition: $tooltip-forward-transition, $tooltip-default-transition;
114
+ -webkit-transform: rotate(0);
115
+ -ms-transform: rotate(0);
116
+ transform: rotate(0);
117
+ }
118
+ .is-scaled & {
119
+ -webkit-transition: -webkit-#{$tooltip-backward-transition}, $tooltip-default-transition;
120
+ transition: $tooltip-backward-transition, $tooltip-default-transition;
121
+ -webkit-transform: rotate(45deg);
122
+ -ms-transform: rotate(45deg);
123
+ transform: rotate(45deg);
124
+ border-color: rgba($tooltip-color, $tooltip-color-opacity-hover);
125
+ color: rgba($tooltip-color, $tooltip-color-opacity-hover);
126
+ }
127
+ }
128
+
129
+ }
130
+
@@ -0,0 +1,59 @@
1
+ @mixin clearfix {
2
+ &:before, &:after {
3
+ content: " ";
4
+ display: table;
5
+ }
6
+ &:after {
7
+ clear: both;
8
+ }
9
+
10
+ *zoom: 1;
11
+ }
12
+
13
+
14
+ @mixin box-sizing {
15
+ *,
16
+ *:before,
17
+ *:after {
18
+ box-sizing: border-box;
19
+ }
20
+ }
21
+
22
+
23
+
24
+ @keyframes spinner {
25
+ to {transform: rotate(360deg);}
26
+ }
27
+
28
+ @-webkit-keyframes spinner {
29
+ to {-webkit-transform: rotate(360deg);}
30
+ }
31
+
32
+ .dante--spinner {
33
+ min-width: 24px;
34
+ min-height: 24px;
35
+ }
36
+
37
+ .dante--spinner:before {
38
+ content: 'Loading…';
39
+ position: absolute;
40
+ top: 50%;
41
+ left: 50%;
42
+ width: 16px;
43
+ height: 16px;
44
+ margin-top: -10px;
45
+ margin-left: -10px;
46
+ }
47
+
48
+ .dante--spinner:not(:required):before {
49
+ content: '';
50
+ border-radius: 50%;
51
+ border: 2px solid rgba(0, 0, 0, .3);
52
+ border-top-color: rgba(0, 0, 0, .6);
53
+ animation: spinner .6s linear infinite;
54
+ -webkit-animation: spinner .6s linear infinite;
55
+ }
56
+
57
+ .hidden {
58
+ display: none !important;
59
+ }
@@ -0,0 +1,96 @@
1
+ // NEW VARIABLES
2
+
3
+ // General
4
+
5
+ $dante-font-family-sans-serif: 'comic-sans';
6
+
7
+ $dante-visual-debugger: false !default;
8
+
9
+ $dante-text-color: #000000 !default;
10
+ $dante-inversed-color: #FFFFFF !default;
11
+ $dante-accent-color: #5BD974 !default;
12
+ $dante-control-color: #333333 !default;
13
+ $dante-popover-color: #FFFFFF !default;
14
+
15
+ // Editor
16
+ $dante-editor-font-size: 18px !default;
17
+ $dante-editor-line-height: 1.9 !default;
18
+
19
+ // Menu
20
+ $dante-menu-height: 42px !default;
21
+ $dante-menu-background: $dante-control-color !default;
22
+ $dante-menu-color: $dante-inversed-color !default;
23
+
24
+ $dante-menu-border-radius: 5px !default;
25
+ $dante-menu-box-shadow: 1px 2px 3px -2px #222 !default;
26
+
27
+ $dante-menu-icon-size: 16px !default;
28
+ $dante-menu-icon-color: $dante-inversed-color !default;
29
+ $dante-menu-icon-accent: $dante-accent-color !default;
30
+
31
+ $dante-menu-border-width: 0px !default;
32
+ $dante-menu-border-color: none !default;
33
+
34
+ $dante-menu-caret-size: 8px !default;
35
+
36
+
37
+ // Tooltip
38
+
39
+ // Popover
40
+
41
+
42
+
43
+ // OLD VARIABLES
44
+
45
+ $dante-font-family-sans: 'jaf-bernino-sans', 'Open Sans', "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
46
+ $dante-font-family-serif: 'freight-text-pro', 'Merriweather', Georgia,Cambria, "Times New Roman", Times,serif;
47
+ $dante-font-family-mono: Menlo, Monaco, Consolas, "Courier New", "Courier", monospace;
48
+
49
+ $dante-font-family-base: $dante-font-family-sans;
50
+ $dante-font-size-base: 14px;
51
+ $line-height-base: 1.428571429; // 20/14
52
+
53
+ /* DEPRECATED */ $active-color: $dante-accent-color;
54
+
55
+ /* DEPRECATED */ $menu-tone: $dante-menu-background;
56
+ /* DEPRECATED */ $menu-factor: 5%;
57
+ /* DEPRECATED */ $menu-background: $dante-menu-background;
58
+ /* DEPRECATED */ $menu-shadow: $dante-menu-box-shadow;
59
+ /* DEPRECATED */ $menu-border-width: $dante-menu-border-width;
60
+ /* DEPRECATED */ $menu-border-color: $dante-menu-border-color;
61
+ /* DEPRECATED */ $menu-border-radius: $dante-menu-border-radius;
62
+
63
+ /* DEPRECATED */ $menu-border: $menu-border-width solid $menu-border-color;
64
+ /* DEPRECATED */ $menu-color: $dante-menu-icon-color;
65
+ /* DEPRECATED */ $menu-color-active: $dante-menu-icon-accent;
66
+
67
+ /* DEPRECATED */ $menu-caret-size: $dante-menu-caret-size;
68
+ /* DEPRECATED */ $menu-caret-color: darken($menu-tone,$menu-factor);
69
+
70
+
71
+
72
+ /* DEPRECATED */ $menu-height: $dante-menu-height;
73
+ $menu-button-height: $menu-height - ($menu-border-width * 2);
74
+
75
+ $tooltip-color: black;
76
+ $tooltip-color-opacity: 0.44;
77
+ $tooltip-color-opacity-hover: 0.9;
78
+ $tooltip-background-opacity: 0;
79
+ $tooltip-border-width: 1px;
80
+ $tooltip-border-radius: 999em;
81
+
82
+ $tooltip-button-spacing: 9px;
83
+ $tooltip-menu-spacing: 22px;
84
+
85
+ $tooltip-items: 10; // Fix this and remove it
86
+ $tooltip-item-delay: 30;
87
+ $tooltip-size: 32px;
88
+ $tooltip-line-height: $tooltip-size;
89
+
90
+ $tooltip-caret-size: 12px;
91
+
92
+ $tooltip-default-transition: 100ms border-color, 100ms color;
93
+ $tooltip-forward-transition: transform 100ms;
94
+ $tooltip-backward-transition: transform 250ms;
95
+
96
+ /* DEPRECATED */ $debugger: $dante-visual-debugger;
@@ -0,0 +1,246 @@
1
+ div[contenteditable="false"] {
2
+ a.markup--anchor {
3
+ cursor: pointer;
4
+ }
5
+ }
6
+
7
+ figure figcaption .public-DraftStyleDefault-block {
8
+ text-align: center;
9
+ }
10
+
11
+ .aspectRatioPlaceholder {
12
+ .image-upoader-loader{
13
+ position: absolute;
14
+ bottom: 0px;
15
+ left: 0%;
16
+ background-color: #fff;
17
+ width: 100%;
18
+ /* height: 3px; */
19
+ text-align: center;
20
+ top: 0px;
21
+ vertical-align: text-bottom;
22
+ opacity: 0.7;
23
+ p{
24
+ line-height: 5px;
25
+ /* font-weight: 700; */
26
+ /* text-transform: uppercase; */
27
+ font-size: 14px;
28
+ margin-top: 49%;
29
+ }
30
+ }
31
+ }
32
+
33
+ a[rel=token], .markup--query {
34
+ color: #00ab6b;
35
+ text-decoration: none;
36
+ background-image: none!important;
37
+ }
38
+
39
+
40
+ .typeahead--mention {
41
+ padding-top: 10px;
42
+ }
43
+ .typeahead .popover-inner {
44
+ padding: 0;
45
+ overflow: hidden;
46
+ min-width: 100px;
47
+ }
48
+
49
+ .typeahead .typeahead-item:first-child {
50
+ padding-top: 7px;
51
+ }
52
+
53
+ .typeahead--mention .typeahead-item {
54
+ padding: 6px 15px;
55
+ font-size: 13px;
56
+ }
57
+
58
+ .typeahead-item.is-active, .typeahead-item:hover {
59
+ background: #02b875;
60
+ color: #fff;
61
+ }
62
+ .typeahead .typeahead-item {
63
+ cursor: pointer;
64
+ padding: 5px 10px;
65
+ line-height: 2;
66
+ font-size: 12px;
67
+ text-align: left;
68
+ white-space: nowrap;
69
+ text-overflow: ellipsis;
70
+ overflow: hidden;
71
+ }
72
+
73
+ .typeahead .dante-avatar {
74
+ //float: left;
75
+ margin: 0 6px 0 -2px;
76
+ }
77
+
78
+ .avatar-image--icon {
79
+ width: 32px;
80
+ height: 32px;
81
+ }
82
+ .avatar-image {
83
+ display: inline-block;
84
+ vertical-align: middle;
85
+ border-radius: 100%;
86
+ }
87
+
88
+ .typeahead-item .avatar-image {
89
+ width: 32px;
90
+ height: 32px;
91
+ }
92
+
93
+ .typeahead--mention .popover-arrow {
94
+ display: none;
95
+ }
96
+
97
+ .markup--user {
98
+ color: #00ab6b;
99
+ text-decoration: none;
100
+ }
101
+
102
+
103
+
104
+ //popover card styles
105
+
106
+ .popover--card {
107
+ .popover-arrow{
108
+ top: -14px;
109
+ }
110
+
111
+ .popover--bottom .popover-arrow:after {
112
+ transform: rotate(45deg) translate(6px,6px);
113
+ box-shadow: -1px -1px 1px -1px rgba(0,0,0,.44);
114
+ }
115
+
116
+ .popover-arrow:after {
117
+ content: '';
118
+ display: block;
119
+ width: 14px;
120
+ height: 14px;
121
+ background: #fff;
122
+ }
123
+ }
124
+
125
+ .popover--animated.is-active {
126
+ visibility: visible;
127
+ opacity: 1;
128
+ transition: visibility 0s linear 0s,opacity .2s 0s;
129
+ }
130
+
131
+ .popover.is-active {
132
+ visibility: visible;
133
+ }
134
+
135
+ .popover--animated {
136
+ visibility: hidden;
137
+ opacity: 0;
138
+ transition: visibility 0s linear .2s,opacity .2s 0s;
139
+ }
140
+
141
+ .popoverCard {
142
+ text-align: left;
143
+ }
144
+
145
+ .popoverCard-meta {
146
+ width: 192px;
147
+ }
148
+ .u-floatLeft {
149
+ float: left!important;
150
+ }
151
+
152
+ .u-floatRight {
153
+ float: right!important;
154
+ }
155
+
156
+ .popoverCard-title {
157
+ font-size: 18px;
158
+ margin-bottom: 5px;
159
+ margin-top: 0px;
160
+ }
161
+
162
+ .link {
163
+ color: inherit;
164
+ text-decoration: none;
165
+ cursor: pointer;
166
+ }
167
+
168
+ .popoverCard-description {
169
+ overflow: hidden;
170
+ color: rgba(0,0,0,.44);
171
+ }
172
+
173
+ .u-clearfix:after {
174
+ clear: both;
175
+ }
176
+ .u-clearfix:after, .u-clearfix:before {
177
+ display: table;
178
+ content: " ";
179
+ }
180
+
181
+ .dante-avatar {
182
+ display: block;
183
+ white-space: nowrap;
184
+ overflow: hidden;
185
+ text-overflow: ellipsis;
186
+ line-height: normal;
187
+ }
188
+
189
+ .avatar-image--small {
190
+ width: 60px;
191
+ height: 60px;
192
+ }
193
+ .avatar-image {
194
+ display: inline-block;
195
+ vertical-align: middle;
196
+ border-radius: 100%;
197
+ }
198
+
199
+ .popoverCard-actions {
200
+ border-top: solid 1px rgba(0,0,0,.15);
201
+ margin-top: 10px;
202
+ padding-top: 10px;
203
+ }
204
+
205
+ .popoverCard-stats {
206
+ font-size: 14px;
207
+ line-height: 36px;
208
+ }
209
+
210
+ .popoverCard-stat {
211
+ margin-right: 10px;
212
+ color: rgba(0,0,0,.44);
213
+ }
214
+
215
+ .popoverCard-count {
216
+ padding-left: 5px;
217
+ color: rgba(0,0,0,.6);
218
+ }
219
+
220
+ // popover-align
221
+
222
+
223
+
224
+
225
+ // uploader tooltip
226
+
227
+ .graf--layoutOutsetLeft {
228
+ margin-left: -160px;
229
+ }
230
+
231
+ .graf--layoutFillWidth {
232
+ margin-left: -200px;
233
+ margin-right: -200px;
234
+ }
235
+
236
+ .graf--layoutOutsetLeft {
237
+ width: 75%;
238
+ }
239
+ .graf--layoutInsetLeft, .graf--layoutOutsetLeft {
240
+ float: left;
241
+ margin-right: 30px;
242
+ padding-top: 10px;
243
+ padding-bottom: 10px;
244
+ }
245
+
246
+ // .graf--layoutOutsetLeft