@standardnotes/markdown-hybrid 1.7.6

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/src/main.scss ADDED
@@ -0,0 +1,339 @@
1
+ @import 'font-awesome/css/font-awesome.css';
2
+
3
+ body, html {
4
+ font-family: sans-serif;
5
+ font-size: var(--sn-stylekit-base-font-size);
6
+ background-color: transparent;
7
+ }
8
+
9
+ * {
10
+ // To prevent gray flash when focusing input on mobile Safari
11
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
12
+ }
13
+
14
+ .editor-toolbar.fullscreen, .CodeMirror-fullscreen {
15
+ // On Mobile, resizing the webview to avoid keyboard causes the option bar to be offset because its position is fixed.
16
+ position: absolute !important
17
+ }
18
+
19
+ .CodeMirror {
20
+ border-left: 0;
21
+ border-right: 0;
22
+ border-bottom: 0;
23
+ background-color: transparent;
24
+ border: none;
25
+ font-size: var(--sn-stylekit-font-size-editor) !important;
26
+ // For momentum scrolling on mobile
27
+ -webkit-overflow-scrolling: touch;
28
+ }
29
+
30
+ .editor-toolbar, .editor-toolbar.fullscreen {
31
+ background-color: var(--sn-stylekit-contrast-background-color);
32
+ border-bottom: 1px solid var(--sn-stylekit-border-color);
33
+ overflow: visible; // on windows, if window is too small, horizontal scrollbar will appear fixed without this
34
+
35
+ &::before, &::after {
36
+ background: none !important;
37
+ }
38
+ }
39
+
40
+ .editor-toolbar i.separator {
41
+ border-left-color: var(--sn-stylekit-contrast-border-color);
42
+ border-right-color: var(--sn-stylekit-contrast-background-color);
43
+ }
44
+
45
+ .editor-toolbar button {
46
+ color: var(--sn-stylekit-info-color) !important;
47
+ outline: none;
48
+ border-radius: 0;
49
+ font-size: var(--sn-stylekit-base-font-size);
50
+ }
51
+
52
+ .editor-toolbar button.active, .editor-toolbar button:hover {
53
+ border-color: transparent;
54
+ background: var(--sn-stylekit-background-color);
55
+ }
56
+
57
+ .editor-toolbar.disabled-for-preview button:not(.no-disable) {
58
+ background: inherit;
59
+ }
60
+
61
+ .editor-toolbar.fullscreen {
62
+ @media screen and (max-width: 525px) {
63
+ height: 80px !important;
64
+ }
65
+ @media screen and (min-width: 526px) {
66
+ height: 50px !important;
67
+ }
68
+ }
69
+
70
+ .EasyMDEContainer {
71
+ .CodeMirror-fullscreen {
72
+ @media screen and (max-width: 525px) {
73
+ top: 80px !important;
74
+
75
+ .CodeMirror-scroll {
76
+ min-height: unset !important;
77
+ }
78
+ }
79
+ @media screen and (min-width: 526px) {
80
+ top: 50px !important;
81
+ }
82
+ }
83
+ .editor-preview-side {
84
+ @media screen and (max-width: 525px) {
85
+ top: 80px !important;
86
+ }
87
+ @media screen and (min-width: 526px) {
88
+ top: 50px !important;
89
+ }
90
+ }
91
+ }
92
+
93
+ .editor-preview-active, .editor-preview-active-side {
94
+ background-color: var(--sn-stylekit-contrast-background-color);
95
+ border: 0;
96
+ border-left: 1px solid var(--sn-stylekit-border-color);
97
+ color: var(--sn-stylekit-contrast-foreground-color);
98
+ font-size: var(--sn-stylekit-font-size-editor);
99
+ padding: 10px 15px;
100
+
101
+ a {
102
+ color: var(--sn-stylekit-info-color);
103
+ }
104
+
105
+ img {
106
+ max-width: 100%;
107
+ }
108
+
109
+ pre {
110
+ background: var(--sn-stylekit-background-color);
111
+ color: var(--sn-stylekit-foreground-color);
112
+ border: 1px solid var(--sn-stylekit-border-color);
113
+ padding: 20px;
114
+ border-radius: 3px;
115
+ overflow-x: auto;
116
+ }
117
+
118
+ table {
119
+ display: block;
120
+ margin-bottom: 12px;
121
+ width: 100%;
122
+ overflow: auto;
123
+ border-collapse: collapse;
124
+ border-spacing: 0px;
125
+ border-color: var(--sn-stylekit-border-color);
126
+
127
+ th, td {
128
+ padding: 6px 13px;
129
+ border: 1px solid var(--sn-stylekit-border-color);
130
+ }
131
+
132
+ tr:nth-child(2n) {
133
+ background-color: var(--sn-stylekit-background-color);
134
+ }
135
+ }
136
+
137
+ p code, ul li code {
138
+ padding: 3px 6px;
139
+ background-color: var(--sn-stylekit-background-color);
140
+ color: var(--sn-stylekit-info-color);
141
+ border: 1px solid var(--sn-stylekit-border-color);
142
+ border-radius: 3px;
143
+ }
144
+
145
+ code {
146
+ font-family: var(--sn-stylekit-monospace-font);
147
+ }
148
+
149
+ blockquote {
150
+ padding: 0 0.5rem;
151
+ margin-left: 0;
152
+ color: var(--sn-stylekit-neutral-color);
153
+ border-left: 0.3rem solid var(--sn-stylekit-background-color);
154
+ }
155
+
156
+ blockquote > :first-child {
157
+ margin-top: 0;
158
+ }
159
+
160
+ blockquote > :last-child {
161
+ margin-bottom: 0;
162
+ }
163
+ }
164
+
165
+ .editor-preview-active {
166
+ border: 0;
167
+ }
168
+
169
+ .CodeMirror {
170
+ background-color: var(--sn-stylekit-editor-background-color) !important;
171
+ color: var(--sn-stylekit-editor-foreground-color) !important;
172
+ border: 0 !important;
173
+
174
+ .CodeMirror-code .cm-comment {
175
+ background: var(--sn-stylekit-contrast-background-color);
176
+ color: var(--sn-stylekit-info-color);
177
+ font-family: Consolas,monaco,"Ubuntu Mono",courier,monospace!important;
178
+ font-size: 90%; // font-family makes font look a bit big
179
+
180
+ &.CodeMirror-selectedtext {
181
+ color: var(--sn-stylekit-info-contrast-color) !important;
182
+ background: var(--sn-stylekit-info-color) !important;
183
+ }
184
+ }
185
+
186
+ .cm-header {
187
+ color: var(--sn-stylekit-editor-foreground-color);
188
+ &.CodeMirror-selectedtext {
189
+ color: var(--sn-stylekit-info-contrast-color) !important;
190
+ background: var(--sn-stylekit-info-color) !important;;
191
+ }
192
+ }
193
+
194
+ // Faded Markdown syntax
195
+ .cm-formatting-header, .cm-formatting-strong, .cm-formatting-em {
196
+ opacity: 0.2;
197
+ }
198
+
199
+ .cm-link, .cm-url {
200
+ &.cm-variable-2 {
201
+ color: var(--sn-stylekit-info-color) !important;
202
+
203
+ &.CodeMirror-selectedtext {
204
+ color: var(--sn-stylekit-info-contrast-color) !important;
205
+ background: var(--sn-stylekit-info-color) !important;;
206
+ }
207
+ }
208
+ }
209
+
210
+ .cm-formatting-list-ol {
211
+ font-weight: bold;
212
+ }
213
+
214
+ .cm-link, .cm-string {
215
+ color: var(--sn-stylekit-info-color) !important;
216
+
217
+ &.CodeMirror-selectedtext {
218
+ color: var(--sn-stylekit-info-contrast-color) !important;
219
+ background: var(--sn-stylekit-info-color) !important;;
220
+ }
221
+ }
222
+
223
+ .CodeMirror-linenumber {
224
+ color: gray !important;
225
+ }
226
+
227
+ }
228
+
229
+ .CodeMirror-cursor {
230
+ border-color: var(--sn-stylekit-editor-foreground-color);
231
+ }
232
+
233
+ .CodeMirror-selected {
234
+ background: var(--sn-stylekit-info-color) !important;
235
+ }
236
+
237
+ .CodeMirror-selectedtext {
238
+ color: var(--sn-stylekit-info-contrast-color);
239
+ background: var(--sn-stylekit-info-color) !important;
240
+ }
241
+
242
+ .CodeMirror-gutters {
243
+ background-color: var(--sn-stylekit-background-color) !important;
244
+ color: var(--sn-stylekit-editor-foreground-color) !important;
245
+ border-color: var(--sn-stylekit-border-color) !important;
246
+ }
247
+
248
+ // remove built in simplemde rule
249
+ @media only screen and (max-width: 700px) {
250
+ .editor-toolbar a.no-mobile {
251
+ display: inline-block;
252
+ }
253
+ }
254
+
255
+ /*
256
+ Highlight JS theming
257
+ */
258
+ .hljs-comment,
259
+ .hljs-quote {
260
+ font-style: italic;
261
+ color: var(--sn-stylekit-neutral-color);
262
+ }
263
+
264
+ .hljs-keyword,
265
+ .hljs-selector-tag,
266
+ .hljs-subst {
267
+ font-weight: bold;
268
+ }
269
+
270
+ .hljs-attribute {
271
+ color: var(--sn-stylekit-warning-color);
272
+ }
273
+
274
+ .hljs-number,
275
+ .hljs-literal {
276
+ color: var(--sn-stylekit-info-color);
277
+ }
278
+
279
+ .hljs-string,
280
+ .hljs-doctag,
281
+ .hljs-formula {
282
+ color: var(--sn-stylekit-success-color);
283
+ }
284
+
285
+ .hljs-title,
286
+ .hljs-section,
287
+ .hljs-selector-id {
288
+ font-weight: bold;
289
+ }
290
+
291
+ .hljs-subst {
292
+ font-weight: normal;
293
+ }
294
+
295
+ .hljs-class .hljs-title,
296
+ .hljs-type,
297
+ .hljs-name {
298
+ color: var(--sn-stylekit-danger-color);
299
+ font-weight: bold;
300
+ }
301
+
302
+ .hljs-tag {
303
+ color: var(--sn-stylekit-neutral-color);
304
+ }
305
+
306
+ .hljs-regexp {
307
+ color: var(--sn-stylekit-success-color);
308
+ }
309
+
310
+ .hljs-symbol,
311
+ .hljs-bullet,
312
+ .hljs-link {
313
+ color: var(--sn-stylekit-info-color);
314
+ }
315
+
316
+ .hljs-built_in,
317
+ .hljs-builtin-name {
318
+ text-decoration: underline;
319
+ }
320
+
321
+ .hljs-meta {
322
+ font-weight: bold;
323
+ }
324
+
325
+ .hljs-deletion {
326
+ color: var(--sn-stylekit-danger-color);
327
+ }
328
+
329
+ .hljs-addition {
330
+ color: var(--sn-stylekit-success-color);
331
+ }
332
+
333
+ .hljs-emphasis {
334
+ font-style: italic;
335
+ }
336
+
337
+ .hljs-strong {
338
+ font-weight: bold;
339
+ }
@@ -0,0 +1,73 @@
1
+ const path = require('path')
2
+ const CopyPlugin = require('copy-webpack-plugin')
3
+ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
4
+ const HtmlWebpackPlugin = require('html-webpack-plugin')
5
+
6
+ module.exports = {
7
+ entry: [path.resolve(__dirname, 'src', 'main.js'), path.resolve(__dirname, 'src', 'main.scss')],
8
+ output: {
9
+ path: path.join(__dirname, 'dist'),
10
+ filename: 'dist.js',
11
+ },
12
+ module: {
13
+ rules: [
14
+ {
15
+ test: /\.s[ac]ss$/i,
16
+ use: [
17
+ MiniCssExtractPlugin.loader,
18
+ 'css-loader',
19
+ {
20
+ loader: 'sass-loader',
21
+ options: {
22
+ sassOptions: {
23
+ includePaths: ['src/main.scss'],
24
+ },
25
+ },
26
+ },
27
+ ],
28
+ },
29
+ {
30
+ test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
31
+ use: [
32
+ {
33
+ loader: 'file-loader',
34
+ options: {
35
+ name: '[name].[ext]',
36
+ outputPath: 'fonts/',
37
+ },
38
+ },
39
+ ],
40
+ },
41
+ ],
42
+ },
43
+ plugins: [
44
+ new CopyPlugin({
45
+ patterns: [
46
+ {
47
+ from: require.resolve('easymde/dist/easymde.min.js'),
48
+ to: path.resolve(__dirname, 'dist/vendor/easymd/easymd.js'),
49
+ },
50
+ {
51
+ from: require.resolve('easymde/dist/easymde.min.css'),
52
+ to: path.resolve(__dirname, 'dist/vendor/easymd/easymde.css'),
53
+ },
54
+ {
55
+ from: require.resolve('highlightjs/highlight.pack.min.js'),
56
+ to: path.resolve(__dirname, 'dist/vendor/highlightjs/highlightjs.js'),
57
+ },
58
+ {
59
+ from: require.resolve('@standardnotes/component-relay/dist/dist.js'),
60
+ to: path.resolve(__dirname, 'dist/lib/component-relay.js'),
61
+ },
62
+ { from: require.resolve('sn-stylekit/dist/stylekit.css'), to: path.resolve(__dirname, 'dist/stylekit.css') },
63
+ ],
64
+ }),
65
+ new MiniCssExtractPlugin({
66
+ filename: 'dist.css',
67
+ }),
68
+ new HtmlWebpackPlugin({
69
+ title: 'Markdown Pro',
70
+ template: 'editor.index.ejs',
71
+ }),
72
+ ],
73
+ }
package/webpack.dev.js ADDED
@@ -0,0 +1,23 @@
1
+ const { merge } = require('webpack-merge');
2
+ const config = require('./webpack.config.js');
3
+ const path = require("path");
4
+
5
+ module.exports = merge(config, {
6
+ mode: 'development',
7
+ devtool: 'eval-cheap-module-source-map',
8
+ stats: {
9
+ colors: true
10
+ },
11
+ devServer: {
12
+ port: 8001,
13
+ contentBase: path.join(__dirname, 'dist'),
14
+ disableHostCheck: true,
15
+ historyApiFallback: true,
16
+ watchOptions: { aggregateTimeout: 300, poll: 1000 },
17
+ headers: {
18
+ 'Access-Control-Allow-Origin': '*',
19
+ 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
20
+ 'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization'
21
+ }
22
+ }
23
+ });
@@ -0,0 +1,7 @@
1
+ const { merge } = require('webpack-merge');
2
+ const config = require('./webpack.config.js');
3
+
4
+ module.exports = merge(config, {
5
+ mode: 'production',
6
+ devtool: 'source-map'
7
+ });