Skip to content

Commit e1b5ad9

Browse files
committed
Initial setup
1 parent bc3341b commit e1b5ad9

File tree

10 files changed

+23875
-127
lines changed

10 files changed

+23875
-127
lines changed

dist/codex-editor.js

Lines changed: 23676 additions & 16 deletions
Large diffs are not rendered by default.

dist/codex-editor.licenses.txt

Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
1-
core-js
1+
@babel/polyfill
22
MIT
3-
Copyright (c) 2014-2018 Denis Pushkarev
3+
MIT License
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
116

12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
7+
Permission is hereby granted, free of charge, to any person obtaining
8+
a copy of this software and associated documentation files (the
9+
"Software"), to deal in the Software without restriction, including
10+
without limitation the rights to use, copy, modify, merge, publish,
11+
distribute, sublicense, and/or sell copies of the Software, and to
12+
permit persons to whom the Software is furnished to do so, subject to
13+
the following conditions:
1414

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
15+
The above copyright notice and this permission notice shall be
16+
included in all copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2225

2326

24-
@babel/runtime
27+
@babel/register
2528
MIT
2629
MIT License
2730

28-
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
31+
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
2932

3033
Permission is hereby granted, free of charge, to any person obtaining
3134
a copy of this software and associated documentation files (the
@@ -47,11 +50,11 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
4750
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4851

4952

50-
@babel/polyfill
53+
@babel/runtime
5154
MIT
5255
MIT License
5356

54-
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
57+
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
5558

5659
Permission is hereby granted, free of charge, to any person obtaining
5760
a copy of this software and associated documentation files (the
@@ -76,6 +79,30 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7679
regenerator-runtime
7780
MIT
7881

82+
@codexteam/shortcuts
83+
MIT
84+
MIT License
85+
86+
Copyright (c) 2018 CodeX
87+
88+
Permission is hereby granted, free of charge, to any person obtaining a copy
89+
of this software and associated documentation files (the "Software"), to deal
90+
in the Software without restriction, including without limitation the rights
91+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
92+
copies of the Software, and to permit persons to whom the Software is
93+
furnished to do so, subject to the following conditions:
94+
95+
The above copyright notice and this permission notice shall be included in all
96+
copies or substantial portions of the Software.
97+
98+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
99+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
100+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
101+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
102+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
103+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
104+
SOFTWARE.
105+
79106
codex-notifier
80107
MIT
81108
MIT License
@@ -101,6 +128,53 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
101128
SOFTWARE.
102129

103130

131+
core-js
132+
MIT
133+
Copyright (c) 2014-2018 Denis Pushkarev
134+
135+
Permission is hereby granted, free of charge, to any person obtaining a copy
136+
of this software and associated documentation files (the "Software"), to deal
137+
in the Software without restriction, including without limitation the rights
138+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
139+
copies of the Software, and to permit persons to whom the Software is
140+
furnished to do so, subject to the following conditions:
141+
142+
The above copyright notice and this permission notice shall be included in
143+
all copies or substantial portions of the Software.
144+
145+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
146+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
147+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
148+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
149+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
150+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
151+
THE SOFTWARE.
152+
153+
154+
css-loader
155+
MIT
156+
Copyright JS Foundation and other contributors
157+
158+
Permission is hereby granted, free of charge, to any person obtaining
159+
a copy of this software and associated documentation files (the
160+
'Software'), to deal in the Software without restriction, including
161+
without limitation the rights to use, copy, modify, merge, publish,
162+
distribute, sublicense, and/or sell copies of the Software, and to
163+
permit persons to whom the Software is furnished to do so, subject to
164+
the following conditions:
165+
166+
The above copyright notice and this permission notice shall be
167+
included in all copies or substantial portions of the Software.
168+
169+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
170+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
171+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
172+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
173+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
174+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
175+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
176+
177+
104178
html-janitor
105179
Apache License
106180
Version 2.0, January 2004
@@ -305,30 +379,6 @@ Apache License
305379
limitations under the License.
306380

307381

308-
@codexteam/shortcuts
309-
MIT
310-
MIT License
311-
312-
Copyright (c) 2018 CodeX
313-
314-
Permission is hereby granted, free of charge, to any person obtaining a copy
315-
of this software and associated documentation files (the "Software"), to deal
316-
in the Software without restriction, including without limitation the rights
317-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
318-
copies of the Software, and to permit persons to whom the Software is
319-
furnished to do so, subject to the following conditions:
320-
321-
The above copyright notice and this permission notice shall be included in all
322-
copies or substantial portions of the Software.
323-
324-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
325-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
326-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
327-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
328-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
329-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
330-
SOFTWARE.
331-
332382
codex.editor.paragraph
333383
MIT
334384
MIT License
@@ -352,53 +402,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
352402
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
353403
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
354404
SOFTWARE.
355-
356-
357-
css-loader
358-
MIT
359-
Copyright JS Foundation and other contributors
360-
361-
Permission is hereby granted, free of charge, to any person obtaining
362-
a copy of this software and associated documentation files (the
363-
'Software'), to deal in the Software without restriction, including
364-
without limitation the rights to use, copy, modify, merge, publish,
365-
distribute, sublicense, and/or sell copies of the Software, and to
366-
permit persons to whom the Software is furnished to do so, subject to
367-
the following conditions:
368-
369-
The above copyright notice and this permission notice shall be
370-
included in all copies or substantial portions of the Software.
371-
372-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
373-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
374-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
375-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
376-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
377-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
378-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
379-
380-
381-
@babel/register
382-
MIT
383-
MIT License
384-
385-
Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
386-
387-
Permission is hereby granted, free of charge, to any person obtaining
388-
a copy of this software and associated documentation files (the
389-
"Software"), to deal in the Software without restriction, including
390-
without limitation the rights to use, copy, modify, merge, publish,
391-
distribute, sublicense, and/or sell copies of the Software, and to
392-
permit persons to whom the Software is furnished to do so, subject to
393-
the following conditions:
394-
395-
The above copyright notice and this permission notice shall be
396-
included in all copies or substantial portions of the Software.
397-
398-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
399-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
400-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
401-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
402-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
403-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
404-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

src/components/inline-tools/inline-tool-link.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import SelectionUtils from '../selection';
33
import $ from '../dom';
44
import _ from '../utils';
55
import {API, InlineTool, SanitizerConfig} from '../../../types';
6-
import {Notifier, Toolbar} from '../../../types/api';
6+
import {InlineToolbar, Notifier, Toolbar} from '../../../types/api';
77

88
/**
99
* Link Tool
@@ -81,9 +81,14 @@ export default class LinkInlineTool implements InlineTool {
8181
private inputOpened: boolean = false;
8282

8383
/**
84-
* Available Inline Toolbar methods (open/close)
84+
* Available Toolbar methods (open/close)
8585
*/
86-
private inlineToolbar: Toolbar;
86+
private toolbar: Toolbar;
87+
88+
/**
89+
* Available Inline Toolbar methods
90+
*/
91+
private inlineToolbar: InlineToolbar;
8792

8893
/**
8994
* Notifier API methods
@@ -94,7 +99,8 @@ export default class LinkInlineTool implements InlineTool {
9499
* @param {{api: API}} - CodeX Editor API
95100
*/
96101
constructor({api}) {
97-
this.inlineToolbar = api.toolbar;
102+
this.inlineToolbar = api.inlineToolbar;
103+
this.toolbar = api.toolbar;
98104
this.notifier = api.notifier;
99105
this.selection = new SelectionUtils();
100106
}
@@ -156,7 +162,7 @@ export default class LinkInlineTool implements InlineTool {
156162
this.unlink();
157163
this.closeActions();
158164
this.checkState();
159-
this.inlineToolbar.close();
165+
this.toolbar.close();
160166
return;
161167
}
162168
}
@@ -206,6 +212,8 @@ export default class LinkInlineTool implements InlineTool {
206212
}
207213

208214
private toggleActions(): void {
215+
this.inlineToolbar.toggleActions('link');
216+
209217
if (!this.inputOpened) {
210218
this.openActions(true);
211219
} else {
@@ -290,7 +298,7 @@ export default class LinkInlineTool implements InlineTool {
290298
event.stopImmediatePropagation();
291299

292300
this.closeActions();
293-
this.inlineToolbar.close();
301+
this.toolbar.close();
294302
this.checkState();
295303
}
296304

src/components/modules/api/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default class API extends Module {
2424
selection: this.Editor.SelectionAPI.methods,
2525
styles: this.Editor.StylesAPI.classes,
2626
toolbar: this.Editor.ToolbarAPI.methods,
27+
inlineToolbar: this.Editor.InlineToolbarAPI.methods,
2728
} as APIInterfaces;
2829
}
2930
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import Module from '../../__module';
2+
import {InlineToolbar} from '../../../../types/api';
3+
4+
/**
5+
* @class ToolbarAPI
6+
* provides with methods working with Toolbar
7+
*/
8+
export default class InlineToolbarAPI extends Module {
9+
/**
10+
* Available methods
11+
* @return {InlineToolbar}
12+
*/
13+
get methods(): InlineToolbar {
14+
return {
15+
toggleActions: (toolName: string) => this.toggleActions(toolName),
16+
};
17+
}
18+
19+
/**
20+
* Toggles actions
21+
*/
22+
public toggleActions(toolName: string): void {
23+
this.Editor.InlineToolbar.toggleActions(toolName);
24+
}
25+
}

src/components/modules/api/toolbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class ToolbarAPI extends Module {
1414
return {
1515
close: () => this.close(),
1616
open: () => this.open(),
17-
};
17+
} as Toolbar;
1818
}
1919

2020
/**

0 commit comments

Comments
 (0)