Skip to content

Commit a1b81b8

Browse files
committed
build via webpack is working
1 parent fbd75a7 commit a1b81b8

File tree

125 files changed

+191
-535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+191
-535
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

_develop/gulpfile.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
var gulp = require('gulp');
2+
var babel = require('gulp-babel');
3+
var sourcemaps = require('gulp-sourcemaps');
4+
5+
gulp.task('source', function() {
6+
return gulp.src('../src/**/*.js')
7+
.pipe(sourcemaps.init())
8+
.pipe(babel({
9+
presets: ['es2015']
10+
}))
11+
.pipe(sourcemaps.write())
12+
.pipe(gulp.dest('../.build/'));
13+
});

_develop/procfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
jekyll: jekyll serve -s ../../quilljs.github.io -d ../../quilljs.github.io/_site -w
2+
webpack: webpack-dev-server --config webpack.config.js --port 9000
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
var path = require('path');
22
var pkg = require('../package.json');
33
var webpack = require('webpack');
4+
var ExtractTextPlugin = require('extract-text-webpack-plugin');
45

56
var constantPack = new webpack.DefinePlugin({
67
QUILL_VERSION: JSON.stringify(pkg.version)
78
});
89

910
module.exports = {
11+
context: path.resolve(__dirname, '..'),
1012
entry: {
11-
quill: path.resolve(__dirname, '../src/index.js')
13+
'quill.js': './quill.js',
14+
'quill.css': './assets/core.styl',
15+
'quill.snow.css': './assets/snow.styl'
1216
},
1317
output: {
14-
filename: 'quill.js',
18+
filename: '[name]',
1519
library: 'Quill',
1620
libraryTarget: 'umd',
17-
path: path.resolve(__dirname, '..', 'dist/')
21+
path: 'dist/'
1822
},
1923
resolve: {
2024
alias: {
2125
'parchment': path.resolve(__dirname, '..', 'node_modules/parchment/src/parchment')
2226
},
2327
extensions: ['', '.js', '.styl', '.ts']
2428
},
25-
resolveLoader: {
26-
root: path.resolve(__dirname, '..', 'node_modules')
27-
},
2829
babel: {
2930
// for isparta
3031
presets: ['es2015']
3132
},
3233
module: {
3334
loaders: [
3435
{ test: /parchment\/src\/.*\.ts$/, loader: 'ts' },
35-
{ test: /\.styl$/, loader: 'css!stylus' }, {
36-
test: /(src|test)\/.*\.js$/, loader: 'babel?presets[]=es2015&plugins[]=transform-runtime'
37-
},
36+
{ test: /\.styl$/, loader: ExtractTextPlugin.extract('style', 'css!stylus') },
37+
{ test: /\.js$/, loader: 'babel?presets[]=es2015&plugins[]=transform-runtime' },
3838
],
3939
noParse: [
4040
/\/node_modules\/clone\/clone\.js$/,
@@ -50,6 +50,15 @@ module.exports = {
5050
},
5151
silent: true
5252
},
53-
plugins: [ constantPack ],
54-
devtool: 'source-map'
53+
plugins: [ constantPack, new ExtractTextPlugin('[name]', { allChunks: true }) ],
54+
devtool: 'source-map',
55+
devServer: {
56+
hot: false,
57+
noInfo: true,
58+
assets: false,
59+
errorDetails: true,
60+
hash: false,
61+
timings: false,
62+
version: false
63+
}
5564
};

src/assets/list.styl assets/core.styl

+42
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,48 @@ MAX_INDENT = 8
44
resets(arr)
55
unquote('list-' + join(' list-', arr))
66

7+
.ql-container
8+
box-sizing: border-box
9+
cursor: text
10+
font-family: Helvetica, 'Arial', sans-serif
11+
font-size: 13px
12+
height: 100%
13+
line-height: 1.42
14+
margin: 0px
15+
overflow-x: hidden
16+
overflow-y: auto
17+
padding: 12px 15px
18+
position: relative
19+
20+
.ql-clipboard
21+
left: -100000px
22+
position: absolute
23+
top: 50%
24+
725
.ql-editor
26+
box-sizing: border-box
27+
min-height: 100%
28+
outline: none
29+
tab-size: 4
30+
white-space: pre-wrap
31+
img
32+
max-width: 100%
33+
p
34+
margin: 0
35+
padding: 0
36+
37+
.ql-font-serif
38+
font-family: Times New Roman, serif;
39+
.ql-font-monospace
40+
font-family: Monaco, Courier New, monospace;
41+
42+
.ql-size-small
43+
font-size: 10px;
44+
.ql-size-large
45+
font-size: 18px;
46+
.ql-size-huge
47+
font-size: 32px;
48+
849
p, ol, ul, pre, blockquote
950
counter-reset: resets(1..MAX_INDENT)
1051
ol
@@ -28,3 +69,4 @@ resets(arr)
2869
for num in (1..MAX_INDENT)
2970
.ql-indent-{num}
3071
padding-left: (40 * num)px
72+
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

assets/snow.styl

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@import './core'
2+
@import './snow/*'
3+
4+
.ql-snow
5+
a
6+
color: #06c
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/assets/snow/toolbar.styl assets/snow/toolbar.styl

-37
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ formatInput =
2929
line-height: inputSize
3030
vertical-align: middle
3131

32-
formats = ('bold' 'italic' 'underline' 'strike' 'link' 'image' 'list' 'bullet' 'authorship' 'color' 'background' 'left' 'right' 'center' 'justify')
33-
34-
3532
.ql-snow.ql-toolbar
3633
box-sizing: border-box
3734
padding: toolbarPadding
@@ -152,37 +149,3 @@ formats = ('bold' 'italic' 'underline' 'strike' 'link' 'image' 'list' 'bullet' '
152149
.ql-picker-options
153150
padding: 4px 0px
154151

155-
156-
imageRules(retina)
157-
suffix = retina ? '@2x' : ''
158-
.ql-snow.ql-toolbar
159-
.ql-picker .ql-picker-label
160-
background-image: url('assets/dropdown' + suffix + '.png')
161-
.ql-picker.ql-expanded .ql-picker-label
162-
background-image: url('assets/inactive/dropdown' + suffix + '.png')
163-
.ql-snow.ql-toolbar .ql-picker.ql-active:not(.ql-expanded) .ql-picker-label,
164-
.ql-snow.ql-toolbar:not(.ios) .ql-picker:not(.ql-expanded) .ql-picker-label:hover
165-
background-image: url('assets/active/dropdown' + suffix + '.png')
166-
167-
for format in formats
168-
.ql-snow.ql-toolbar
169-
.ql-format-button.ql-{format},
170-
.ql-picker.ql-{format} .ql-picker-label,
171-
.ql-picker .ql-picker-label[data-value={format}],
172-
.ql-picker .ql-picker-item[data-value={format}]
173-
background-image: url('assets/' + format + suffix + '.png')
174-
175-
.ql-snow.ql-toolbar .ql-format-button.ql-{format}.ql-active,
176-
.ql-snow.ql-toolbar .ql-picker.ql-{format} .ql-picker-label.ql-active,
177-
.ql-snow.ql-toolbar .ql-picker .ql-picker-label[data-value={format}].ql-active,
178-
.ql-snow.ql-toolbar .ql-picker .ql-picker-item[data-value={format}].ql-selected,
179-
.ql-snow.ql-toolbar:not(.ios) .ql-format-button.ql-{format}:hover,
180-
.ql-snow.ql-toolbar:not(.ios) .ql-picker.ql-{format} .ql-picker-label:hover,
181-
.ql-snow.ql-toolbar:not(.ios) .ql-picker .ql-picker-label[data-value={format}]:hover,
182-
.ql-snow.ql-toolbar:not(.ios) .ql-picker .ql-picker-item[data-value={format}]:hover
183-
background-image: url('assets/active/' + format + suffix + '.png')
184-
185-
imageRules(false)
186-
187-
@media (-webkit-min-device-pixel-ratio: 2)
188-
imageRules(true)
File renamed without changes.

src/blots/block.js blots/block.js

File renamed without changes.

src/blots/break.js blots/break.js

File renamed without changes.
File renamed without changes.

src/blots/embed.js blots/embed.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Parchment from 'parchment';
2-
import logger from '../logger';
2+
import logger from '../core/logger';
33

44

55
let debug = logger('quill:embed');
File renamed without changes.

src/blots/scroll.js blots/scroll.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Block from './block';
2-
import Emitter from '../emitter';
2+
import Emitter from '../core/emitter';
33
import Parchment from 'parchment';
44

55

src/paste-manager.js core/clipboard.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import Emitter from './emitter';
44
import Module from './module';
55

66

7-
class PasteManager extends Module {
7+
class Clipboard extends Module {
88
constructor(quill, options) {
99
super(quill, options);
1010
this.quill.root.addEventListener('paste', this.onPaste.bind(this));
11-
this.container = this.quill.addContainer('ql-paste-manager');
11+
this.container = this.quill.addContainer('ql-clipboard');
1212
}
1313

1414
onPaste() {
@@ -29,11 +29,11 @@ class PasteManager extends Module {
2929
}, 0);
3030
}
3131
}
32-
PasteManager.DEFAULTS = {
32+
Clipboard.DEFAULTS = {
3333
sanitize: function(container) {
3434
return new Delta().insert(container.innerText);
3535
}
3636
};
3737

3838

39-
export default PasteManager;
39+
export default Clipboard;

src/editor.js core/editor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Delta from 'rich-text/lib/delta';
22
import Emitter from './emitter';
33
import Parchment from 'parchment';
4-
import Block from './blots/block';
4+
import Block from '../blots/block';
55
import extend from 'extend';
66

77

src/emitter.js core/emitter.js

File renamed without changes.

src/keyboard.js core/keyboard.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Delta from 'rich-text/lib/delta';
55
import Emitter from './emitter';
66
import logger from './logger';
77
import { Range } from './selection';
8-
import Block from './blots/block';
8+
import Block from '../blots/block';
99

1010
let debug = logger('quill:keyboard');
1111

src/logger.js core/logger.js

File renamed without changes.

src/module.js core/module.js

File renamed without changes.

src/core.js core/quill.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import Delta from 'rich-text/lib/delta';
22
import Editor from './editor';
33
import Emitter from './emitter';
44
import Parchment from 'parchment';
5-
import Scroll from './blots/scroll';
5+
import Scroll from '../blots/scroll';
66
import Selection, { Range } from './selection';
77
import extend from 'extend';
88
import logger from './logger';
9+
import Keyboard from './keyboard';
10+
import Clipboard from './clipboard';
11+
import UndoManager from './undo-manager';
912

1013

1114
let debug = logger('quill');
@@ -62,12 +65,10 @@ class Quill {
6265
}
6366
this.theme = new themeClass(this, options);
6467
this.keyboard = new Keyboard(this, options.modules['keyboard']);
65-
this.pasteManager = new PasteManager(this, options.modules['paste-manager']);
68+
this.clipboard = new Clipboard(this, options.modules['clipboard']);
6669
this.undoManager = new UndoManager(this, options.modules['undo-manager']);
67-
delete options.modules['keyboard'];
68-
delete options.modules['paste-manager'];
69-
delete options.modules['undo-manager'];
7070
Object.keys(this.options.modules).forEach((name) => {
71+
if (['clipboard', 'keybard', 'undo-manager'].indexOf(name) > -1) return;
7172
this.addModule(name, options.modules[name]);
7273
});
7374
if (options.readOnly) {

src/selection.js core/selection.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Parchment from 'parchment';
22
import Emitter from './emitter';
3-
import CursorBlot from './blots/cursor';
4-
import EmbedBlot from './blots/embed';
3+
import CursorBlot from '../blots/cursor';
4+
import EmbedBlot from '../blots/embed';
55
import equal from 'deep-equal';
66
import extend from 'extend';
77

src/theme.js core/theme.js

File renamed without changes.
File renamed without changes.

develop/gulpfile.js

-14
This file was deleted.

develop/procfile

-3
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/formats/code.js formats/code.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Delta from 'rich-text/lib/delta';
22
import Parchment from 'parchment';
3-
import logger from '../logger';
3+
import logger from '../core/logger';
44
import Block from '../blots/block';
55
import Inline from '../blots/inline';
66

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/modules/image.js modules/image.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import Quill from '../core';
21
import extend from 'extend';
32
import Delta from 'rich-text/lib/delta';
4-
import { Range } from '../selection';
3+
import { Range } from '../core/selection';
54
import Tooltip from '../ui/tooltip';
65

76

@@ -89,6 +88,4 @@ ImageTooltip.DEFAULTS = {
8988
};
9089

9190

92-
Quill.registerModule('image-tooltip', ImageTooltip);
93-
9491
export { ImageTooltip as default };

src/modules/link.js modules/link.js

+20-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
1-
import Quill from '../core';
21
import extend from 'extend';
2+
import Inline from '../blots/inline';
33
import Tooltip from '../ui/tooltip';
44

55

6+
class Link extends Inline {
7+
static create(value) {
8+
let node = super.create(value);
9+
if (typeof value === 'string') {
10+
this.domNode.setAttribute('href', value);
11+
}
12+
return node;
13+
}
14+
15+
formats() {
16+
let format = super.formats();
17+
format.link = this.domNode.getAttribute('href') || true;
18+
return format;
19+
}
20+
}
21+
Link.blotName = 'link';
22+
Link.tagName = 'A';
23+
24+
625
class LinkTooltip extends Tooltip {
726
constructor(quill, options = {}) {
827
options = extend({}, LinkTooltip.DEFAULTS, options);
@@ -155,6 +174,4 @@ LinkTooltip.hotkeys = {
155174
};
156175

157176

158-
Quill.registerModule('link-tooltip', LinkTooltip);
159-
160177
export { LinkTooltip as default };

src/modules/toolbar.js modules/toolbar.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import Quill from '../core';
21
import extend from 'extend';
3-
import logger from '../logger';
2+
import logger from '../core/logger';
43

54
let debug = logger('quill:toolbar');
65

0 commit comments

Comments
 (0)