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,209 @@
1
+
2
+ .editable .markup--anchor,
3
+ .editable .graf--sectionCaption {
4
+ cursor: text;
5
+ }
6
+
7
+ /*
8
+ .markup--anchor {
9
+ background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.6) 50%);
10
+ //background-position: 0 24px;
11
+ background-position: 0 19px;
12
+ background-repeat: repeat-x;
13
+ background-size: 2px 2px;
14
+ text-decoration: none;
15
+ color: rgba(0, 0, 0, 1);
16
+ //border-bottom: 1px solid rgba(0,0,0,.4);
17
+ }
18
+
19
+ h4 .markup--anchor {
20
+ background-position: 0 34px;
21
+ }
22
+ */
23
+
24
+
25
+ // .aspectRatioPlaceholder {
26
+ // margin: 0 auto;
27
+ // position: relative;
28
+ // width: 100%;
29
+ // }
30
+
31
+ // .is-postEditMode .graf-image:before,
32
+ // .is-postEditMode .iframeContainer:before {
33
+ // bottom: 0;
34
+ // content: "";
35
+ // left: 0;
36
+ // position: absolute;
37
+ // right: 0;
38
+ // top: 0;
39
+ // z-index: 500;
40
+ // }
41
+
42
+ // .graf--figure.is-mediaFocused .graf-image,
43
+ // .graf--figure.is-mediaFocused iframe {
44
+ // box-shadow: 0 0 0 3px #57ad68;
45
+ // }
46
+
47
+ // .aspectRatioPlaceholder.is-locked .graf-image,
48
+ // .aspectRatioPlaceholder.is-locked .graf-imageAnchor {
49
+ // height: 100%;
50
+ // left: 0;
51
+ // position: absolute;
52
+ // top: 0;
53
+ // width: 100%;
54
+ // }
55
+
56
+ // .graf-image,
57
+ // .graf-imageAnchor,
58
+ // .iframeContainer > iframe,
59
+ // .iframeContainer {
60
+ // box-sizing: border-box;
61
+ // display: block;
62
+ // margin: auto;
63
+ // max-width: 100%;
64
+ // }
65
+
66
+ .is-postEditMode iframe {
67
+ border: 3px solid rgba(255, 255, 255, 0);
68
+ }
69
+
70
+ .graf--mixtapeEmbed {
71
+ border-color: rgba(0, 0, 0, 0.15);
72
+ border-radius: 5px;
73
+ border-style: solid;
74
+ border-width: 1px;
75
+ box-sizing: border-box;
76
+ color: rgba(0, 0, 0, 0.6);
77
+ font-family: $dante-font-family-sans;
78
+ font-size: 12px;
79
+ font-style: normal;
80
+ font-weight: 300;
81
+ letter-spacing: -0.02em;
82
+ margin-bottom: 40px;
83
+ margin-top: 40px;
84
+ max-height: 310px;
85
+ max-width: 700px;
86
+ overflow: hidden;
87
+ padding: 30px;
88
+ position: relative;
89
+ }
90
+
91
+ .mixtapeImage {
92
+ background-position: center center;
93
+ background-repeat: no-repeat;
94
+ background-size: cover;
95
+ float: right;
96
+ height: 310px;
97
+ margin: -30px -30px 0 25px;
98
+ width: 310px;
99
+ }
100
+
101
+ .mixtapeImage--empty {
102
+ height: 0;
103
+ width: 0;
104
+ }
105
+
106
+ .graf--mixtapeEmbed {
107
+ color: rgba(0, 0, 0, 0.6);
108
+ font-family: $dante-font-family-sans;
109
+ font-size: 12px;
110
+ font-style: normal;
111
+ font-weight: 300;
112
+ letter-spacing: -0.02em;
113
+ }
114
+
115
+ .markup--mixtapeEmbed-strong {
116
+ color: #000;
117
+ display: block;
118
+ font-family: $dante-font-family-sans;
119
+ font-size: 30px;
120
+ font-style: normal;
121
+ font-weight: 300;
122
+ letter-spacing: -0.02em;
123
+ line-height: 1.2;
124
+ margin-bottom: 0px;
125
+ }
126
+
127
+ .markup--mixtapeEmbed-em {
128
+ display: block;
129
+ font-size: 16px;
130
+ font-style: normal;
131
+ margin-bottom: 10px;
132
+ max-height: 120px;
133
+ overflow: hidden;
134
+ }
135
+
136
+ /*CAPTION*/
137
+
138
+
139
+ // .imageCaption:before {
140
+ // border-top: 1px solid rgba(0, 0, 0, 0.15);
141
+ // content: "";
142
+ // display: block;
143
+ // margin-bottom: 10px;
144
+ // margin-left: 75%;
145
+ // width: 25%;
146
+ // }
147
+
148
+ // .imageCaption {
149
+ // color: rgba(0, 0, 0, 0.6);
150
+ // font-family: $dante-font-family-serif;
151
+ // font-size: 14px;
152
+ // font-style: italic;
153
+ // font-weight: 400;
154
+ // left: -172px;
155
+ // letter-spacing: 0.01rem;
156
+ // line-height: 1.4;
157
+ // margin-top: 0;
158
+ // outline: 0 none;
159
+ // position: absolute;
160
+ // text-align: right;
161
+ // top: 0;
162
+ // width: 150px;
163
+ // z-index: 300;
164
+ // }
165
+
166
+ // .graf--figure.is-mediaFocused .imageCaption,
167
+ // .graf--figure.is-defaultValue.is-selected .imageCaption,
168
+ // section.is-mediaFocused .graf--sectionCaption,
169
+ // .graf--sectionCaption.is-defaultValue.is-selected {
170
+ // display: block;
171
+ // }
172
+
173
+ // figure.is-defaultValue .imageCaption,
174
+ // .graf--sectionCaption.is-defaultValue {
175
+ // display: none;
176
+ // }
177
+
178
+ .editor a {
179
+ a {
180
+ color: inherit;
181
+ text-decoration: none;
182
+ }
183
+ }
184
+
185
+ .defaultValue {
186
+ color: rgba(0,0,0,0.3);
187
+ }
188
+
189
+ section:first-child > .section-divider,
190
+ section.is-backgrounded + section > .section-divider {
191
+ display: none;
192
+ }
193
+ // .postArticle .layoutSingleColumn,
194
+ // .postFooter--loggedOut .layoutSingleColumn {
195
+ // width: 700px;
196
+ // }
197
+
198
+ // .layoutSingleColumn {
199
+ // margin: 0 auto;
200
+ // width: 640px;
201
+ // }
202
+
203
+ .defaultValue--prompt {
204
+ font-family: $dante-font-family-sans;
205
+ font-size: 18px;
206
+ font-style: normal;
207
+ font-weight: 400;
208
+ letter-spacing: -0.02em;
209
+ }
@@ -0,0 +1,212 @@
1
+ // Base popover styles
2
+
3
+ .dante-popover {
4
+ & {
5
+ overflow: hidden;
6
+ position: absolute;
7
+ z-index: 900;
8
+ visibility: visible;
9
+ font-size: 12px;
10
+ text-align: center;
11
+ pointer-events: auto;
12
+ padding: 15px;
13
+ font-family: "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;
14
+ letter-spacing: -0.02em;
15
+ font-weight: 400;
16
+ font-style: normal;
17
+ line-height: 1.4;
18
+
19
+ opacity: 0;
20
+ }
21
+ &.is-active {
22
+ opacity: 1;
23
+ }
24
+ .popover-inner {
25
+ background: #fff;
26
+ box-shadow: 0 1px 2px rgba(0,0,0,.25),0 0 1px rgba(0,0,0,.35);
27
+ }
28
+ }
29
+
30
+ .popover.is-active {
31
+ visibility: visible;
32
+ }
33
+
34
+ .popover-inner {
35
+ & {
36
+ position: relative;
37
+ max-width: 300px;
38
+ border-radius: $menu-border-radius;
39
+ padding: 8px;
40
+ }
41
+ a {
42
+ color: inherit;
43
+ text-decoration: none;
44
+ }
45
+ }
46
+
47
+
48
+
49
+ // Defatul tooltip
50
+
51
+ .popover--tooltip {
52
+ & {
53
+ pointer-events: none;
54
+ }
55
+
56
+ .popover-inner {
57
+ // background-color: $menu-tone;
58
+ background: $menu-tone;
59
+ border-radius: 4px;
60
+ color: #fff;
61
+ }
62
+ }
63
+
64
+
65
+
66
+ // LINK tooltip
67
+
68
+ .popover--Linktooltip {
69
+ & {
70
+ pointer-events: auto;
71
+ z-index: 300;
72
+ word-break: break-word;
73
+ word-wrap: break-word;
74
+ }
75
+ .popover-inner {
76
+ padding: 8px 10px;
77
+ font-size: 12px;
78
+ }
79
+ }
80
+
81
+
82
+
83
+ // Align tooltip
84
+
85
+ .popover--Aligntooltip {
86
+ .popover-inner {
87
+ padding: 0;
88
+ background: $menu-tone;
89
+ color: #fff;
90
+ }
91
+ }
92
+
93
+
94
+ // Align tooltip
95
+ .popover--typeahead {
96
+ .popover-inner {
97
+ & {
98
+ position: relative;
99
+ padding: 14px;
100
+ border-radius: 4px;
101
+ }
102
+
103
+ ul{
104
+ padding-left: 0px;
105
+ }
106
+ }
107
+ }
108
+
109
+
110
+ // popover--typeahead
111
+ // typeahead
112
+ // typeahead--mention
113
+ // popover--maxWidth360
114
+ // popover--bottom
115
+
116
+ .popover.popover--maxWidth360 .popover-inner {
117
+ max-width: 360px;
118
+ }
119
+
120
+ .popover:not(.popover--flexible) .popover-inner {
121
+ max-width: 280px;
122
+ }
123
+
124
+
125
+
126
+
127
+ /*
128
+ .popover.is-withTransition {
129
+ -webkit-transition:opacity 100ms ease;
130
+ transition:opacity 100ms ease;
131
+ }
132
+
133
+ .is-resizing .popover {
134
+ opacity:0;
135
+ -webkit-transition:opacity 0 ease;
136
+ transition:opacity 0 ease;
137
+ }
138
+ */
139
+
140
+ .popover-arrow {
141
+ position: absolute;
142
+ }
143
+ .popover-arrow:after {
144
+ background-color: $menu-tone;
145
+ }
146
+
147
+ .popover--top .popover-arrow,
148
+ .popover--bottom .popover-arrow {
149
+ left: 50%;
150
+ margin-left: -$tooltip-caret-size/2;
151
+ }
152
+
153
+ .popover--left .popover-arrow,
154
+ .popover--right .popover-arrow {
155
+ top: 50%;
156
+ margin-top: -$tooltip-caret-size/2;
157
+ }
158
+
159
+ .popover--top .popover-arrow {
160
+ // bottom: 1px;
161
+ // clip: rect(0 18px 18px 4px);
162
+ }
163
+
164
+ .popover--right .popover-arrow {
165
+ left: 1px;
166
+ // clip: rect(-4px 14px 18px 0);
167
+ }
168
+
169
+ .popover--bottom .popover-arrow {
170
+ top: 1px;
171
+ // clip: rect(0 18px 14px -1px);
172
+ }
173
+
174
+ .popover--left .popover-arrow {
175
+ right: 1px;
176
+ // clip: rect(-4px 14px 18px 0);
177
+ }
178
+
179
+ .popover-arrow:after {
180
+ content: '';
181
+ display: block;
182
+ width: $tooltip-caret-size;
183
+ height: $tooltip-caret-size;
184
+ }
185
+
186
+ .popover--top .popover-arrow:after {
187
+ -webkit-transform: rotate(45deg) translate(-5px,-5px);
188
+ -ms-transform: rotate(45deg) translate(-5px,-5px);
189
+ transform: rotate(45deg) translate(-5px,-5px);
190
+ box-shadow: 1px 1px 1px -1px $menu-tone;
191
+ }
192
+
193
+ .popover--right .popover-arrow:after {
194
+ -webkit-transform: rotate(45deg) translate(6px,-6px);
195
+ -ms-transform: rotate(45deg) translate(6px,-6px);
196
+ transform: rotate(45deg) translate(6px,-6px);
197
+ box-shadow: -1px 1px 1px -1px $menu-tone;
198
+ }
199
+
200
+ .popover--bottom .popover-arrow:after {
201
+ -webkit-transform: rotate(45deg) translate(6px,6px);
202
+ -ms-transform: rotate(45deg) translate(6px,6px);
203
+ transform: rotate(45deg) translate(6px,6px);
204
+ box-shadow: -1px -1px 1px -1px $menu-tone;
205
+ }
206
+
207
+ .popover--left .popover-arrow:after {
208
+ -webkit-transform: rotate(45deg) translate(-6px,6px);
209
+ -ms-transform: rotate(45deg) translate(-6px,6px);
210
+ transform: rotate(45deg) translate(-6px,6px);
211
+ box-shadow: 1px -1px 1px -1px $menu-tone;
212
+ }
@@ -0,0 +1,67 @@
1
+ .postArticle {
2
+ position: relative;
3
+ -webkit-transform: translateZ(0);
4
+ transform: translateZ(0);
5
+ .layoutSingleColumn {
6
+ & {
7
+ width: 700px;
8
+ margin-left: auto;
9
+ margin-right: auto;
10
+ }
11
+ @media (max-width: 800px) {
12
+ width: 640px;
13
+ }
14
+ @media (max-width: 680px) {
15
+ width: auto;
16
+ margin-left: 20px;
17
+ margin-right: 20px;
18
+ }
19
+ }
20
+ }
21
+
22
+ .postWrapper,
23
+ .postWrapper-inner {
24
+ position: relative;
25
+ @include clearfix;
26
+ }
27
+
28
+ .postWrapper {
29
+ overflow: hidden;
30
+
31
+ .is-postEditMode & { display: none; }
32
+ .is-postEditModeInitialized & { display: block; }
33
+ }
34
+
35
+ .postContent {
36
+ font-family: $dante-font-family-serif;
37
+ letter-spacing: 0.01rem;
38
+ font-weight: 400;
39
+ font-style: normal;
40
+ font-size: $dante-editor-font-size;
41
+ line-height: $dante-editor-line-height;
42
+ }
43
+
44
+ .postField {
45
+ &, &:focus {
46
+ outline: 0;
47
+ word-break: break-word;
48
+ word-wrap: break-word;
49
+ }
50
+ }
51
+
52
+ .postField--body {
53
+ @include clearfix;
54
+ margin-bottom: 30px;
55
+ }
56
+
57
+ .section--last {
58
+ padding-bottom: 5px;
59
+ }
60
+
61
+ .section-content {
62
+ @include clearfix;
63
+ }
64
+
65
+ .section-inner {
66
+ position: relative;
67
+ }