@podlite/editor-react 0.0.17 → 0.0.19

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.
package/lib/index.css CHANGED
@@ -1 +1,311 @@
1
- .EditorApp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.App-logo{height:40vmin;pointer-events:none}@media (prefers-reduced-motion: no-preference){.App-logo{animation:App-logo-spin infinite 20s linear}}.App-header{background-color:#282c34;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:calc(10px + 2vmin);color:#fff}.App-link{color:#61dafb}.layout{position:absolute;width:100%}.Editor{text-align:left;white-space:pre-wrap;word-break:break-word;word-wrap:break-word}[contenteditable]:focus{outline:0px solid transparent}.layout__panel{position:relative;width:100%;height:100%;flex:none;overflow:hidden}.flex--row{flex-direction:row}.flex{display:flex}.CodeMirror{height:auto;font-family:inherit}pre{overflow-x:auto;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}.title{margin:0}.Editorleft{border-right:1px dotted lightgrey;white-space:pre-wrap;word-break:break-word;word-wrap:break-word;width:50%;font-size:15px;text-align:left}body{margin:0;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}pre{padding:9.5px;display:block;word-break:break-all;word-wrap:break-word;background-color:#f8f8f8;border-radius:4px}code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}img{max-width:1024px}table{word-break:normal;min-width:70%;max-width:100%;margin:2em auto 1em;border-spacing:0;border-collapse:collapse;text-align:center}table caption{margin-bottom:.8em}table tbody tr:hover{background-color:#eee;-webkit-transition:.5s;transition:.5s}tr th{vertical-align:bottom;border-bottom:2px solid #eee}td{padding:8px;border:1px solid #eee}.footnote a{text-decoration:none}.footnotes{border-top-style:solid;border-top-width:1px;border-top-color:#eee}img{display:block;margin:0 auto;max-width:100%}.shadow{-webkit-box-shadow:3px 3px 5px 6px #ccc;-moz-box-shadow:3px 3px 5px 6px #ccc;box-shadow:3px 3px 5px 6px #ccc}.box{box-shadow:0 2.8px 2.2px #00000009,0 6.7px 5.3px #0000000c,0 12.5px 10px #0000000f,0 22.3px 17.9px #00000012,0 41.8px 33.4px #00000016,0 100px 80px #0000001f;margin:100px auto;background:white;border-radius:5px}.image_block video{max-width:100%;margin-bottom:1em}.image_block video{width:100%;outline:none;border:none}.mermaid svg{display:block;margin:auto}.toc{padding:1rem}.toc-list{list-style:none;font-size:.8rem}.caption{text-align:center;font-size:.9rem}.CodeMirror{height:auto;font-family:inherit}.title{margin:0}.Editorleft{border-right:1px dotted lightgrey;white-space:pre-wrap;word-break:break-word;word-wrap:break-word;width:50%;font-size:15px;text-align:left;float:left;height:100%;padding-left:10px;visibility:visible;opacity:1;transition:all .2s ease-out}.editorApp,.CodeMirror{height:100%}.Editorright{text-align:left;word-break:break-word;word-wrap:break-word;margin-right:0;height:100%;font-size:15px;padding-left:10px;overflow-y:scroll;overflow-x:hidden;background-color:#fff}.Editorright .error{opacity:.5}.Editorright img{display:block;margin:0 auto;max-width:100%}.content{height:100%}.layoutPreview .Editorright{position:absolute;width:48%;float:right;top:0;right:0;width:100%;background-color:#fff}.layoutPreview .Editorleft{visibility:hidden;opacity:0}.layoutPreview .content{width:50%;margin:0 auto;height:100%;overflow-y:initial}@keyframes App-logo-spin{0%{transform:rotate(0deg)}to{transform:rotate(360deg)}}.CodeMirror-vscrollbar{user-select:none;outline:none!important}::-webkit-scrollbar-thumb{background-color:#0000001a}::-webkit-scrollbar{background-color:(0,0,0,.05)}::-webkit-scrollbar-thumb:active{background-color:#0000001a}::-webkit-scrollbar{width:10px;height:10px;-webkit-border-radius:100px}::-webkit-scrollbar-thumb{-webkit-border-radius:100px}::-webkit-scrollbar-thumb:active{-webkit-border-radius:100px}::-webkit-scrollbar-corner{background:transparent}.CodeMirror-hints{z-index:1000;border:none}
1
+ /* src/Editor.css */
2
+ .EditorApp {
3
+ font-family:
4
+ Menlo,
5
+ Monaco,
6
+ Consolas,
7
+ "Courier New",
8
+ monospace;
9
+ -webkit-font-smoothing: antialiased;
10
+ -moz-osx-font-smoothing: grayscale;
11
+ }
12
+ .App-logo {
13
+ height: 40vmin;
14
+ pointer-events: none;
15
+ }
16
+ @media (prefers-reduced-motion: no-preference) {
17
+ .App-logo {
18
+ animation: App-logo-spin infinite 20s linear;
19
+ }
20
+ }
21
+ .App-header {
22
+ background-color: #282c34;
23
+ min-height: 100vh;
24
+ display: flex;
25
+ flex-direction: column;
26
+ align-items: center;
27
+ justify-content: center;
28
+ font-size: calc(10px + 2vmin);
29
+ color: white;
30
+ }
31
+ .App-link {
32
+ color: #61dafb;
33
+ }
34
+ .layout {
35
+ position: absolute;
36
+ width: 100%;
37
+ }
38
+ .Editor {
39
+ text-align: left;
40
+ white-space: pre-wrap;
41
+ word-break: break-word;
42
+ word-wrap: break-word;
43
+ }
44
+ [contenteditable]:focus {
45
+ outline: 0px solid transparent;
46
+ }
47
+ .layout__panel {
48
+ position: relative;
49
+ width: 100%;
50
+ height: 100%;
51
+ flex: none;
52
+ overflow: hidden;
53
+ }
54
+ .flex--row {
55
+ flex-direction: row;
56
+ }
57
+ .flex {
58
+ display: flex;
59
+ }
60
+ .CodeMirror {
61
+ height: auto;
62
+ font-family: inherit;
63
+ }
64
+ pre {
65
+ overflow-x: auto;
66
+ white-space: pre-wrap;
67
+ white-space: -moz-pre-wrap;
68
+ white-space: -pre-wrap;
69
+ white-space: -o-pre-wrap;
70
+ word-wrap: break-word;
71
+ }
72
+ .title {
73
+ margin: 0em;
74
+ }
75
+ .Editorleft {
76
+ border-right: 1px dotted lightgrey;
77
+ white-space: pre-wrap;
78
+ word-break: break-word;
79
+ word-wrap: break-word;
80
+ width: 50%;
81
+ font-size: 15px;
82
+ text-align: left;
83
+ }
84
+ body {
85
+ margin: 0;
86
+ font-family:
87
+ Menlo,
88
+ Monaco,
89
+ Consolas,
90
+ "Courier New",
91
+ monospace;
92
+ -webkit-font-smoothing: antialiased;
93
+ -moz-osx-font-smoothing: grayscale;
94
+ }
95
+ code {
96
+ font-family:
97
+ source-code-pro,
98
+ Menlo,
99
+ Monaco,
100
+ Consolas,
101
+ "Courier New",
102
+ monospace;
103
+ }
104
+ pre {
105
+ padding: 9.5px;
106
+ display: block;
107
+ word-break: break-all;
108
+ word-wrap: break-word;
109
+ background-color: #f8f8f8;
110
+ border-radius: 4px;
111
+ }
112
+ code {
113
+ padding: 0;
114
+ font-size: inherit;
115
+ color: inherit;
116
+ white-space: pre-wrap;
117
+ background-color: transparent;
118
+ border-radius: 0;
119
+ }
120
+ img {
121
+ max-width: 1024px;
122
+ }
123
+ table {
124
+ word-break: normal;
125
+ min-width: 70%;
126
+ max-width: 100%;
127
+ margin: 1em auto;
128
+ border-spacing: 0;
129
+ border-collapse: collapse;
130
+ text-align: center;
131
+ margin-top: 2em;
132
+ }
133
+ table caption {
134
+ margin-bottom: 0.8em;
135
+ }
136
+ table tbody tr:hover {
137
+ background-color: #eee;
138
+ -webkit-transition: .5s;
139
+ transition: .5s;
140
+ }
141
+ tr th {
142
+ vertical-align: bottom;
143
+ border-bottom: 2px solid #eee;
144
+ }
145
+ td {
146
+ padding: 8px;
147
+ border: 1px solid #eee;
148
+ }
149
+ .footnote a {
150
+ text-decoration: none;
151
+ }
152
+ .footnotes {
153
+ border-top-style: solid;
154
+ border-top-width: 1px;
155
+ border-top-color: #eee;
156
+ }
157
+ img {
158
+ display: block;
159
+ margin: 0 auto;
160
+ max-width: 100%;
161
+ }
162
+ .shadow {
163
+ -webkit-box-shadow: 3px 3px 5px 6px #ccc;
164
+ -moz-box-shadow: 3px 3px 5px 6px #ccc;
165
+ box-shadow: 3px 3px 5px 6px #ccc;
166
+ }
167
+ .box {
168
+ box-shadow:
169
+ 0 2.8px 2.2px rgba(0, 0, 0, 0.034),
170
+ 0 6.7px 5.3px rgba(0, 0, 0, 0.048),
171
+ 0 12.5px 10px rgba(0, 0, 0, 0.06),
172
+ 0 22.3px 17.9px rgba(0, 0, 0, 0.072),
173
+ 0 41.8px 33.4px rgba(0, 0, 0, 0.086),
174
+ 0 100px 80px rgba(0, 0, 0, 0.12);
175
+ margin: 100px auto;
176
+ background: white;
177
+ border-radius: 5px;
178
+ }
179
+ .image_block video {
180
+ max-width: 100%;
181
+ margin-bottom: 1em;
182
+ }
183
+ .image_block video {
184
+ width: 100%;
185
+ outline: none;
186
+ border: none;
187
+ }
188
+ .mermaid svg {
189
+ display: block;
190
+ margin: auto;
191
+ }
192
+ .toc {
193
+ padding: 1rem;
194
+ }
195
+ .toc-list {
196
+ list-style: none;
197
+ font-size: .8rem;
198
+ }
199
+ .caption {
200
+ text-align: center;
201
+ font-size: 0.9rem;
202
+ }
203
+ .CodeMirror {
204
+ height: auto;
205
+ font-family: inherit;
206
+ }
207
+ .title {
208
+ margin: 0em;
209
+ }
210
+ .Editorleft {
211
+ border-right: 1px dotted lightgrey;
212
+ white-space: pre-wrap;
213
+ word-break: break-word;
214
+ word-wrap: break-word;
215
+ width: 50%;
216
+ font-size: 15px;
217
+ text-align: left;
218
+ float: left;
219
+ height: 100%;
220
+ padding-left: 10px;
221
+ visibility: visible;
222
+ opacity: 1;
223
+ transition: all 0.2s ease-out;
224
+ }
225
+ .editorApp,
226
+ .CodeMirror {
227
+ height: 100%;
228
+ }
229
+ .Editorright {
230
+ text-align: left;
231
+ word-break: break-word;
232
+ word-wrap: break-word;
233
+ margin-right: 0;
234
+ height: 100%;
235
+ font-size: 15px;
236
+ padding-left: 10px;
237
+ overflow-y: scroll;
238
+ overflow-x: hidden;
239
+ background-color: white;
240
+ }
241
+ .Editorright .error {
242
+ opacity: 0.5;
243
+ }
244
+ .Editorright * {
245
+ }
246
+ .Editorright img {
247
+ display: block;
248
+ margin: 0 auto;
249
+ max-width: 100%;
250
+ }
251
+ .content {
252
+ height: 100%;
253
+ }
254
+ .layoutPreview .Editorright {
255
+ position: absolute;
256
+ width: 48%;
257
+ float: right;
258
+ top: 0;
259
+ right: 0;
260
+ width: 100%;
261
+ background-color: white;
262
+ }
263
+ .layoutPreview .Editorleft {
264
+ visibility: hidden;
265
+ opacity: 0;
266
+ }
267
+ .layoutPreview .content {
268
+ width: 50%;
269
+ margin: 0 auto;
270
+ height: 100%;
271
+ overflow-y: initial;
272
+ }
273
+ @keyframes App-logo-spin {
274
+ from {
275
+ transform: rotate(0deg);
276
+ }
277
+ to {
278
+ transform: rotate(360deg);
279
+ }
280
+ }
281
+ .CodeMirror-vscrollbar {
282
+ user-select: none;
283
+ outline: none !important;
284
+ }
285
+ ::-webkit-scrollbar-thumb {
286
+ background-color: rgba(0, 0, 0, 0.1);
287
+ }
288
+ ::-webkit-scrollbar {
289
+ background-color: (0, 0, 0, 0.05);
290
+ }
291
+ ::-webkit-scrollbar-thumb:active {
292
+ background-color: rgba(0, 0, 0, 0.1);
293
+ }
294
+ ::-webkit-scrollbar {
295
+ width: 10px;
296
+ height: 10px;
297
+ -webkit-border-radius: 100px;
298
+ }
299
+ ::-webkit-scrollbar-thumb {
300
+ -webkit-border-radius: 100px;
301
+ }
302
+ ::-webkit-scrollbar-thumb:active {
303
+ -webkit-border-radius: 100px;
304
+ }
305
+ ::-webkit-scrollbar-corner {
306
+ background: transparent;
307
+ }
308
+ .CodeMirror-hints {
309
+ z-index: 1000;
310
+ border: none;
311
+ }
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import 'codemirror/mode/gfm/gfm';
3
- import "codemirror/addon/hint/show-hint";
3
+ import 'codemirror/addon/hint/show-hint';
4
4
  import 'codemirror/addon/hint/show-hint.css';
5
5
  import './Editor.css';
6
6
  export interface ConverterResult {
@@ -19,5 +19,5 @@ declare type Props = {
19
19
  isPreviewModeEnabled?: boolean;
20
20
  isControlled?: boolean;
21
21
  };
22
- declare const _default: ({ onChangeSource, content, isDarkTheme, isLineNumbers, isPreviewModeEnabled, onConvertSource, onSavePressed, sourceType, isControlled, isAutoComplete, }: Props) => JSX.Element;
23
- export default _default;
22
+ export declare const Editor: ({ onChangeSource, content, isDarkTheme, isLineNumbers, isPreviewModeEnabled, onConvertSource, onSavePressed, sourceType, isControlled, isAutoComplete, }: Props) => React.JSX.Element;
23
+ export default Editor;
@@ -0,0 +1,311 @@
1
+ /* src/Editor.css */
2
+ .EditorApp {
3
+ font-family:
4
+ Menlo,
5
+ Monaco,
6
+ Consolas,
7
+ "Courier New",
8
+ monospace;
9
+ -webkit-font-smoothing: antialiased;
10
+ -moz-osx-font-smoothing: grayscale;
11
+ }
12
+ .App-logo {
13
+ height: 40vmin;
14
+ pointer-events: none;
15
+ }
16
+ @media (prefers-reduced-motion: no-preference) {
17
+ .App-logo {
18
+ animation: App-logo-spin infinite 20s linear;
19
+ }
20
+ }
21
+ .App-header {
22
+ background-color: #282c34;
23
+ min-height: 100vh;
24
+ display: flex;
25
+ flex-direction: column;
26
+ align-items: center;
27
+ justify-content: center;
28
+ font-size: calc(10px + 2vmin);
29
+ color: white;
30
+ }
31
+ .App-link {
32
+ color: #61dafb;
33
+ }
34
+ .layout {
35
+ position: absolute;
36
+ width: 100%;
37
+ }
38
+ .Editor {
39
+ text-align: left;
40
+ white-space: pre-wrap;
41
+ word-break: break-word;
42
+ word-wrap: break-word;
43
+ }
44
+ [contenteditable]:focus {
45
+ outline: 0px solid transparent;
46
+ }
47
+ .layout__panel {
48
+ position: relative;
49
+ width: 100%;
50
+ height: 100%;
51
+ flex: none;
52
+ overflow: hidden;
53
+ }
54
+ .flex--row {
55
+ flex-direction: row;
56
+ }
57
+ .flex {
58
+ display: flex;
59
+ }
60
+ .CodeMirror {
61
+ height: auto;
62
+ font-family: inherit;
63
+ }
64
+ pre {
65
+ overflow-x: auto;
66
+ white-space: pre-wrap;
67
+ white-space: -moz-pre-wrap;
68
+ white-space: -pre-wrap;
69
+ white-space: -o-pre-wrap;
70
+ word-wrap: break-word;
71
+ }
72
+ .title {
73
+ margin: 0em;
74
+ }
75
+ .Editorleft {
76
+ border-right: 1px dotted lightgrey;
77
+ white-space: pre-wrap;
78
+ word-break: break-word;
79
+ word-wrap: break-word;
80
+ width: 50%;
81
+ font-size: 15px;
82
+ text-align: left;
83
+ }
84
+ body {
85
+ margin: 0;
86
+ font-family:
87
+ Menlo,
88
+ Monaco,
89
+ Consolas,
90
+ "Courier New",
91
+ monospace;
92
+ -webkit-font-smoothing: antialiased;
93
+ -moz-osx-font-smoothing: grayscale;
94
+ }
95
+ code {
96
+ font-family:
97
+ source-code-pro,
98
+ Menlo,
99
+ Monaco,
100
+ Consolas,
101
+ "Courier New",
102
+ monospace;
103
+ }
104
+ pre {
105
+ padding: 9.5px;
106
+ display: block;
107
+ word-break: break-all;
108
+ word-wrap: break-word;
109
+ background-color: #f8f8f8;
110
+ border-radius: 4px;
111
+ }
112
+ code {
113
+ padding: 0;
114
+ font-size: inherit;
115
+ color: inherit;
116
+ white-space: pre-wrap;
117
+ background-color: transparent;
118
+ border-radius: 0;
119
+ }
120
+ img {
121
+ max-width: 1024px;
122
+ }
123
+ table {
124
+ word-break: normal;
125
+ min-width: 70%;
126
+ max-width: 100%;
127
+ margin: 1em auto;
128
+ border-spacing: 0;
129
+ border-collapse: collapse;
130
+ text-align: center;
131
+ margin-top: 2em;
132
+ }
133
+ table caption {
134
+ margin-bottom: 0.8em;
135
+ }
136
+ table tbody tr:hover {
137
+ background-color: #eee;
138
+ -webkit-transition: .5s;
139
+ transition: .5s;
140
+ }
141
+ tr th {
142
+ vertical-align: bottom;
143
+ border-bottom: 2px solid #eee;
144
+ }
145
+ td {
146
+ padding: 8px;
147
+ border: 1px solid #eee;
148
+ }
149
+ .footnote a {
150
+ text-decoration: none;
151
+ }
152
+ .footnotes {
153
+ border-top-style: solid;
154
+ border-top-width: 1px;
155
+ border-top-color: #eee;
156
+ }
157
+ img {
158
+ display: block;
159
+ margin: 0 auto;
160
+ max-width: 100%;
161
+ }
162
+ .shadow {
163
+ -webkit-box-shadow: 3px 3px 5px 6px #ccc;
164
+ -moz-box-shadow: 3px 3px 5px 6px #ccc;
165
+ box-shadow: 3px 3px 5px 6px #ccc;
166
+ }
167
+ .box {
168
+ box-shadow:
169
+ 0 2.8px 2.2px rgba(0, 0, 0, 0.034),
170
+ 0 6.7px 5.3px rgba(0, 0, 0, 0.048),
171
+ 0 12.5px 10px rgba(0, 0, 0, 0.06),
172
+ 0 22.3px 17.9px rgba(0, 0, 0, 0.072),
173
+ 0 41.8px 33.4px rgba(0, 0, 0, 0.086),
174
+ 0 100px 80px rgba(0, 0, 0, 0.12);
175
+ margin: 100px auto;
176
+ background: white;
177
+ border-radius: 5px;
178
+ }
179
+ .image_block video {
180
+ max-width: 100%;
181
+ margin-bottom: 1em;
182
+ }
183
+ .image_block video {
184
+ width: 100%;
185
+ outline: none;
186
+ border: none;
187
+ }
188
+ .mermaid svg {
189
+ display: block;
190
+ margin: auto;
191
+ }
192
+ .toc {
193
+ padding: 1rem;
194
+ }
195
+ .toc-list {
196
+ list-style: none;
197
+ font-size: .8rem;
198
+ }
199
+ .caption {
200
+ text-align: center;
201
+ font-size: 0.9rem;
202
+ }
203
+ .CodeMirror {
204
+ height: auto;
205
+ font-family: inherit;
206
+ }
207
+ .title {
208
+ margin: 0em;
209
+ }
210
+ .Editorleft {
211
+ border-right: 1px dotted lightgrey;
212
+ white-space: pre-wrap;
213
+ word-break: break-word;
214
+ word-wrap: break-word;
215
+ width: 50%;
216
+ font-size: 15px;
217
+ text-align: left;
218
+ float: left;
219
+ height: 100%;
220
+ padding-left: 10px;
221
+ visibility: visible;
222
+ opacity: 1;
223
+ transition: all 0.2s ease-out;
224
+ }
225
+ .editorApp,
226
+ .CodeMirror {
227
+ height: 100%;
228
+ }
229
+ .Editorright {
230
+ text-align: left;
231
+ word-break: break-word;
232
+ word-wrap: break-word;
233
+ margin-right: 0;
234
+ height: 100%;
235
+ font-size: 15px;
236
+ padding-left: 10px;
237
+ overflow-y: scroll;
238
+ overflow-x: hidden;
239
+ background-color: white;
240
+ }
241
+ .Editorright .error {
242
+ opacity: 0.5;
243
+ }
244
+ .Editorright * {
245
+ }
246
+ .Editorright img {
247
+ display: block;
248
+ margin: 0 auto;
249
+ max-width: 100%;
250
+ }
251
+ .content {
252
+ height: 100%;
253
+ }
254
+ .layoutPreview .Editorright {
255
+ position: absolute;
256
+ width: 48%;
257
+ float: right;
258
+ top: 0;
259
+ right: 0;
260
+ width: 100%;
261
+ background-color: white;
262
+ }
263
+ .layoutPreview .Editorleft {
264
+ visibility: hidden;
265
+ opacity: 0;
266
+ }
267
+ .layoutPreview .content {
268
+ width: 50%;
269
+ margin: 0 auto;
270
+ height: 100%;
271
+ overflow-y: initial;
272
+ }
273
+ @keyframes App-logo-spin {
274
+ from {
275
+ transform: rotate(0deg);
276
+ }
277
+ to {
278
+ transform: rotate(360deg);
279
+ }
280
+ }
281
+ .CodeMirror-vscrollbar {
282
+ user-select: none;
283
+ outline: none !important;
284
+ }
285
+ ::-webkit-scrollbar-thumb {
286
+ background-color: rgba(0, 0, 0, 0.1);
287
+ }
288
+ ::-webkit-scrollbar {
289
+ background-color: (0, 0, 0, 0.05);
290
+ }
291
+ ::-webkit-scrollbar-thumb:active {
292
+ background-color: rgba(0, 0, 0, 0.1);
293
+ }
294
+ ::-webkit-scrollbar {
295
+ width: 10px;
296
+ height: 10px;
297
+ -webkit-border-radius: 100px;
298
+ }
299
+ ::-webkit-scrollbar-thumb {
300
+ -webkit-border-radius: 100px;
301
+ }
302
+ ::-webkit-scrollbar-thumb:active {
303
+ -webkit-border-radius: 100px;
304
+ }
305
+ ::-webkit-scrollbar-corner {
306
+ background: transparent;
307
+ }
308
+ .CodeMirror-hints {
309
+ z-index: 1000;
310
+ border: none;
311
+ }