8
0
Просмотр исходного кода

Merge branch 'master' into t/ckeditor5/1554

# Conflicts:
#	tests/converters/tablecell-post-fixer.js
Maciej Gołaszewski 6 лет назад
Родитель
Сommit
417980195b
66 измененных файлов с 393 добавлено и 209 удалено
  1. 1 1
      packages/ckeditor5-table/.eslintrc.js
  2. 6 5
      packages/ckeditor5-table/.travis.yml
  3. 12 0
      packages/ckeditor5-table/CHANGELOG.md
  4. 1 1
      packages/ckeditor5-table/docs/_snippets/features/build-table-source.js
  5. 1 1
      packages/ckeditor5-table/docs/_snippets/features/table.js
  6. 17 15
      packages/ckeditor5-table/docs/features/table.md
  7. 89 0
      packages/ckeditor5-table/lang/translations/es.po
  8. 89 0
      packages/ckeditor5-table/lang/translations/id.po
  9. 1 1
      packages/ckeditor5-table/lang/translations/sr-latn.po
  10. 16 16
      packages/ckeditor5-table/package.json
  11. 1 1
      packages/ckeditor5-table/src/commands/insertcolumncommand.js
  12. 1 1
      packages/ckeditor5-table/src/commands/insertrowcommand.js
  13. 1 1
      packages/ckeditor5-table/src/commands/inserttablecommand.js
  14. 1 1
      packages/ckeditor5-table/src/commands/mergecellcommand.js
  15. 1 1
      packages/ckeditor5-table/src/commands/removecolumncommand.js
  16. 1 1
      packages/ckeditor5-table/src/commands/removerowcommand.js
  17. 1 1
      packages/ckeditor5-table/src/commands/setheadercolumncommand.js
  18. 1 1
      packages/ckeditor5-table/src/commands/setheaderrowcommand.js
  19. 1 1
      packages/ckeditor5-table/src/commands/splitcellcommand.js
  20. 1 1
      packages/ckeditor5-table/src/commands/utils.js
  21. 13 6
      packages/ckeditor5-table/src/converters/downcast.js
  22. 1 1
      packages/ckeditor5-table/src/converters/table-cell-content-post-fixer.js
  23. 1 1
      packages/ckeditor5-table/src/converters/table-layout-post-fixer.js
  24. 7 1
      packages/ckeditor5-table/src/converters/tablecell-post-fixer.js
  25. 1 1
      packages/ckeditor5-table/src/converters/upcasttable.js
  26. 9 1
      packages/ckeditor5-table/src/table.js
  27. 8 2
      packages/ckeditor5-table/src/tableediting.js
  28. 4 27
      packages/ckeditor5-table/src/tabletoolbar.js
  29. 1 1
      packages/ckeditor5-table/src/tableui.js
  30. 1 1
      packages/ckeditor5-table/src/tableutils.js
  31. 1 1
      packages/ckeditor5-table/src/tablewalker.js
  32. 1 1
      packages/ckeditor5-table/src/ui/inserttableview.js
  33. 1 1
      packages/ckeditor5-table/src/utils.js
  34. 1 1
      packages/ckeditor5-table/tests/_utils/utils.js
  35. 1 1
      packages/ckeditor5-table/tests/commands/insertcolumncommand.js
  36. 1 1
      packages/ckeditor5-table/tests/commands/insertrowcommand.js
  37. 1 1
      packages/ckeditor5-table/tests/commands/inserttablecommand.js
  38. 1 1
      packages/ckeditor5-table/tests/commands/mergecellcommand.js
  39. 1 1
      packages/ckeditor5-table/tests/commands/removecolumncommand.js
  40. 1 1
      packages/ckeditor5-table/tests/commands/removerowcommand.js
  41. 1 1
      packages/ckeditor5-table/tests/commands/setheadercolumncommand.js
  42. 1 1
      packages/ckeditor5-table/tests/commands/setheaderrowcommand.js
  43. 1 1
      packages/ckeditor5-table/tests/commands/splitcellcommand.js
  44. 1 1
      packages/ckeditor5-table/tests/commands/utils.js
  45. 30 1
      packages/ckeditor5-table/tests/converters/downcast.js
  46. 1 1
      packages/ckeditor5-table/tests/converters/table-cell-content-post-fixer.js
  47. 1 1
      packages/ckeditor5-table/tests/converters/table-layout-post-fixer.js
  48. 22 2
      packages/ckeditor5-table/tests/converters/tablecell-post-fixer.js
  49. 1 1
      packages/ckeditor5-table/tests/converters/upcasttable.js
  50. 1 1
      packages/ckeditor5-table/tests/integration.js
  51. 1 1
      packages/ckeditor5-table/tests/manual/table.js
  52. 1 1
      packages/ckeditor5-table/tests/manual/tableblockcontent.js
  53. 1 1
      packages/ckeditor5-table/tests/table-integration.js
  54. 1 1
      packages/ckeditor5-table/tests/table.js
  55. 17 1
      packages/ckeditor5-table/tests/tableediting.js
  56. 3 81
      packages/ckeditor5-table/tests/tabletoolbar.js
  57. 1 1
      packages/ckeditor5-table/tests/tableui.js
  58. 1 1
      packages/ckeditor5-table/tests/tableutils.js
  59. 1 1
      packages/ckeditor5-table/tests/tablewalker.js
  60. 1 1
      packages/ckeditor5-table/tests/ui/inserttableview.js
  61. 1 1
      packages/ckeditor5-table/theme/icons/table-column.svg
  62. 1 1
      packages/ckeditor5-table/theme/icons/table-merge-cell.svg
  63. 1 1
      packages/ckeditor5-table/theme/icons/table-row.svg
  64. 1 1
      packages/ckeditor5-table/theme/inserttable.css
  65. 1 1
      packages/ckeditor5-table/theme/table.css
  66. 1 1
      packages/ckeditor5-table/theme/tableediting.css

+ 1 - 1
packages/ckeditor5-table/.eslintrc.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /* eslint-env node */

+ 6 - 5
packages/ckeditor5-table/.travis.yml

@@ -1,12 +1,8 @@
 sudo: required
 dist: trusty
 addons:
+  chrome: stable
   firefox: latest
-  apt:
-    sources:
-    - google-chrome
-    packages:
-    - google-chrome-stable
 language: node_js
 cache:
   yarn: true
@@ -16,6 +12,7 @@ branches:
   except:
   - stable
 before_install:
+- export START_TIME=$( date +%s )
 - export DISPLAY=:99.0
 - sh -e /etc/init.d/xvfb start
 - npm i -g yarn
@@ -26,7 +23,11 @@ script:
 - ckeditor5-dev-tests-travis
 after_success:
 - ckeditor5-dev-tests-save-revision
+after_script:
+- export END_TIME=$( date +%s )
+- ckeditor5-dev-tests-notify-travis-status
 env:
   global:
   - secure: BKC/208PtT8ya6P0gNbEczGvd5UCtvIljxjQokFrFESOAUmqtlmdUjES/MRCEyGn3hEi9cYLPFaiAH68qjl+F1uLSwcqvalTnXMPpUPUjGODHKze+P1BGyP6KjvsTO+Lw0exwisYLChkhkQhXN7uUehxg6pdZ85r4uS3XKeCkVdObC/OPnlEgB2IDULDHnR3EApOR+4vqU1+ci8+12/ct62EPgq8bbxirvk6xoelNJeLVBBgySdC2ltPNVmERq9OqWJfl6zv9y+NbgFcbYNNdvMFgm1WSlf1HzATTNYbpmXz3pf2kSRjy4ikoIlq7qZ3igLJpGrWPQFttmnpxh/kuapSEHX74LqlUi9ctHX4/gO9+NdCriXSERYQXkVO4beHfqfR5S1dADBXHfBJGGxEmDjkAdrWA9ATG4sOD8sX/qZOFI86NsVYnglbAbHfdjLhQVPjqQ+596nSi/C2sZEOtvnNFT6ZkEeQ10aLp1lWJOn79226sVkC6eAIlVlypME9M+C1DLyGIdXzxcc0+nunVF7cMwTXhwW0psToLASuHJjYJ0/X4uzpxLIaGVFQ0PJE5ALtO1HDZqUrPrJSOkYXcZnbDk8FYpkeAvqNbHKUOUWUtVfmtrzvBDGoZrSfgnLI7WfNYUtfuZ0FcCaB5RV4H3iHBcjqhbkBJrcUe7TNPdo=
   - secure: XbRykrpv5bv7Pu7NNRtAvAJr+MZRTBC+/aHGzW06gzu4msi+yifK3AnE0FvOfMsBaiLMXSoxVyUJwRZmSPa7wXt4ZgUna9Ntbx1I7JxjjbbB3K+lUHY+9r+kGFHDpEYQIMqkrSSUeP2kE/rHn6aLAd+bFsrs1/FyxMefSOE4egYAmYYe7V2LfTFX2/M2QfyYa5lJopJYgil/OzTd5kHr3rqQF4h/2Ld2MuVNsjuob0tJLBlIgdAuOm4mKEnPwyIMRWrQDwPs3DBTIiPBtLJO+/Cd/e7i97M8SscFBtFwg+hisUhzj57ixwJb0IANtOZewsqqmtCNt6JJyWFYH4rvqUWQkeCqOI+Gbi0LI/+RLaTBHVzSFIJFdt/zujNiEUDMzR5pCgNqc9ckmmqriwaURw4EuSUqnYoFc0xp95GKOTbAd6+UZOBfub3aNJBmMCuC2VpGv7RYxrzvOmWljWd5S2E0ZePafYFAiPK5rB5725ah1SohgOr6iQh/7yFSEwqLpXIZSBjkKLd2sLyILjywXxk11aUMPlKgLULVoN5jSpiVbw+j+bDZuNuf7AVSHymPGxBzpkkHu6wsXAqzKUZ0XHVpFSxCmAY74vj+3khRgweO8MQYG61GxWV8lWJK5COFUVfHcHeT5sRZCgq06hHQE5NKKHzukBO3cCeola2D6wU=
+  - secure: MTHJ5n94Ussk/u/YmIdBHsIDRan64VCbZRTklkx9hgtqwXcj+j6jV6S8makAZSCR55iBrscX1nrjROxSM4fbUsy4Owcu2Fik17IgA+xkYk2HgT2aupzLbpBD3DB538tHBxOb7me6m0GiO9Q9T3a2M8wBA4opxFfJX5O5qIy7lkKRnohy/ekGq2Av5cSU54tu0advGLA0okicE8qpkbpkV+DyZsPKYuHtOccJU/KJjX0dAH4/SWRqOeaXqRaOR6i8RcKEn4yEvKvZgqncv6hrzW4rJk1eXHFQCWlMnjIAQvIcpq0cplu5ktHjQ1W7/pTOELTnRLA4j+Oiu5+jZZqWKqTtNiZpATIp/fiDUTODrSIPovPbXZK0PepJhP3inWp2FtXTTj2/NrRtS2fL+U0jsI0wYBBx2WTDbj537BXFHAIRqKUDaEVxSzUGelA4H9STBNWbDXmyTeYzchWpimj/6TwG/VRYjhNQZ1rcwaGKpxNd8VDmDf2QxHcnfAu6+irsJb/0+B8zOj6hzw2ouLSlgEjfv9U5x997jeIUiStQBpdKrNiRw878tOuE0yOGbjIhfkKdo4gmcvDi20RioOs8qiO/tfYjgV/43sMBasrkNVkvv+RITTxUNf5kpWq6UnI8X5VjzWUDAKwELj6kPZl1C6MG0p8Fl8du2F77rnJS2wI=

+ 12 - 0
packages/ckeditor5-table/CHANGELOG.md

@@ -1,6 +1,18 @@
 Changelog
 =========
 
+## [12.0.1](https://github.com/ckeditor/ckeditor5-table/compare/v12.0.0...v12.0.1) (2019-04-10)
+
+### Bug fixes
+
+* Single paragraphs with attributes inside `<tableCell>` will be properly converted in the data pipeline. Closes [ckeditor/ckeditor5#1620](https://github.com/ckeditor/ckeditor5/issues/1620). ([67ec89f](https://github.com/ckeditor/ckeditor5-table/commit/67ec89f))
+
+### Other changes
+
+* Optimized icons. ([c042369](https://github.com/ckeditor/ckeditor5-table/commit/c042369))
+* Updated translations. ([cd204c3](https://github.com/ckeditor/ckeditor5-table/commit/cd204c3))
+
+
 ## [12.0.0](https://github.com/ckeditor/ckeditor5-table/compare/v11.0.1...v12.0.0) (2019-02-28)
 
 ### Features

+ 1 - 1
packages/ckeditor5-table/docs/_snippets/features/build-table-source.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /* globals window */

+ 1 - 1
packages/ckeditor5-table/docs/_snippets/features/table.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /* globals ClassicEditor, console, window, document */

+ 17 - 15
packages/ckeditor5-table/docs/features/table.md

@@ -159,21 +159,23 @@ The {@link module:table/table~Table} plugin registers the following UI component
 
 And the following commands:
 
-* The `'insertTable'` command implemented by {@link module:table/commands/inserttablecommand~InsertTableCommand}.
-* The `'insertTableColumnLeft'` command implemented by {@link module:table/commands/insertcolumncommand~InsertColumnCommand}.
-* The `'insertTableColumnRight'` command implemented by {@link module:table/commands/insertcolumncommand~InsertColumnCommand}.
-* The `'insertTableRowAbove'` command implemented by {@link module:table/commands/insertrowcommand~InsertRowCommand}.
-* The `'insertTableRowBelow'` command implemented by {@link module:table/commands/insertrowcommand~InsertRowCommand}.
-* The `'removeTableColumn'` command implemented by {@link module:table/commands/removecolumncommand~RemoveColumnCommand}.
-* The `'removeTableRow'` command implemented by {@link module:table/commands/removerowcommand~RemoveRowCommand}.
-* The `'setTableColumnHeader'` command implemented by {@link module:table/commands/setheadercolumncommand~SetHeaderColumnCommand}.
-* The `'setTableRowHeader'` command implemented by {@link module:table/commands/setheaderrowcommand~SetHeaderRowCommand}.
-* The `'mergeTableCellRight'` command implemented by {@link module:table/commands/mergecellcommand~MergeCellCommand}.
-* The `'mergeTableCellLeft'` command implemented by {@link module:table/commands/mergecellcommand~MergeCellCommand}.
-* The `'mergeTableCellUp'` command implemented by {@link module:table/commands/mergecellcommand~MergeCellCommand}.
-* The `'mergeTableCellDown'` command implemented by {@link module:table/commands/mergecellcommand~MergeCellCommand}.
-* The `'splitTableCellVertically'` command implemented by {@link module:table/commands/splitcellcommand~SplitCellCommand}.
-* The `'splitTableCellHorizontally'` command implemented by {@link module:table/commands/splitcellcommand~SplitCellCommand}.
+| {@link framework/guides/architecture/core-editor-architecture#commands Command} name | Implemented by |
+|----------------------------------|-----------------------------------------------------------------------------|
+| `'insertTable'`                  | {@link module:table/commands/inserttablecommand~InsertTableCommand}         |
+| `'insertTableColumnLeft'`        | {@link module:table/commands/insertcolumncommand~InsertColumnCommand}       |
+| `'insertTableColumnRight'`       | {@link module:table/commands/insertcolumncommand~InsertColumnCommand}       |
+| `'insertTableRowAbove'`          | {@link module:table/commands/insertrowcommand~InsertRowCommand}             |
+| `'insertTableRowBelow'`          | {@link module:table/commands/insertrowcommand~InsertRowCommand}             |
+| `'removeTableColumn'`            | {@link module:table/commands/removecolumncommand~RemoveColumnCommand}       |
+| `'removeTableRow'`               | {@link module:table/commands/removerowcommand~RemoveRowCommand}             |
+| `'setTableColumnHeader'`         | {@link module:table/commands/setheadercolumncommand~SetHeaderColumnCommand} |
+| `'setTableRowHeader'`            | {@link module:table/commands/setheaderrowcommand~SetHeaderRowCommand}       |
+| `'mergeTableCellRight'`          | {@link module:table/commands/mergecellcommand~MergeCellCommand}             |
+| `'mergeTableCellLeft'`           | {@link module:table/commands/mergecellcommand~MergeCellCommand}             |
+| `'mergeTableCellUp'`             | {@link module:table/commands/mergecellcommand~MergeCellCommand}             |
+| `'mergeTableCellDown'`           | {@link module:table/commands/mergecellcommand~MergeCellCommand}             |
+| `'splitTableCellVertically'`     | {@link module:table/commands/splitcellcommand~SplitCellCommand}             |
+| `'splitTableCellHorizontally'`   | {@link module:table/commands/splitcellcommand~SplitCellCommand}             |
 
 The {@link module:table/tabletoolbar~TableToolbar} plugin introduces two balloon toolbars for tables.
 * The content toolbar shows up when table cell is selected and is anchored to the table. It is possible to {@link module:table/table~TableConfig#contentToolbar configure} its content. Normally, it contains the table-related tools such as `'tableColumn'`, `'tableRow'`, and `'mergeTableCells'` dropdowns.

+ 89 - 0
packages/ckeditor5-table/lang/translations/es.po

@@ -0,0 +1,89 @@
+# Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+#
+#                                     !!! IMPORTANT !!!
+#
+#         Before you edit this file, please keep in mind that contributing to the project
+#                translations is possible ONLY via the Transifex online service.
+#
+#         To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
+#
+#                   To learn more, check out the official contributor's guide:
+#     https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
+#
+msgid ""
+msgstr ""
+"Language-Team: Spanish (https://www.transifex.com/ckeditor/teams/11143/es/)\n"
+"Language: es\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "Label for the insert table toolbar button."
+msgid "Insert table"
+msgstr "Insertar tabla"
+
+msgctxt "Label for the set/unset table header column button."
+msgid "Header column"
+msgstr "Columna de encabezado"
+
+msgctxt "Label for the insert table column to the left of the current one button."
+msgid "Insert column left"
+msgstr "Insertar columna izquierda"
+
+msgctxt "Label for the insert table column to the right of the current one button."
+msgid "Insert column right"
+msgstr "Insertar columna derecha"
+
+msgctxt "Label for the delete table column button."
+msgid "Delete column"
+msgstr "Eliminar columna"
+
+msgctxt "Label for the table column dropdown button."
+msgid "Column"
+msgstr "Columna"
+
+msgctxt "Label for the set/unset table header row button."
+msgid "Header row"
+msgstr "Fila de encabezado"
+
+msgctxt "Label for the insert row below button."
+msgid "Insert row below"
+msgstr "Insertar fila debajo"
+
+msgctxt "Label for the insert row above button."
+msgid "Insert row above"
+msgstr "Insertar fila encima"
+
+msgctxt "Label for the delete table row button."
+msgid "Delete row"
+msgstr "Eliminar fila"
+
+msgctxt "Label for the table row dropdown button."
+msgid "Row"
+msgstr "Fila"
+
+msgctxt "Label for the merge table cell up button."
+msgid "Merge cell up"
+msgstr "Combinar celda superior"
+
+msgctxt "Label for the merge table cell right button."
+msgid "Merge cell right"
+msgstr "Combinar celda derecha"
+
+msgctxt "Label for the merge table cell down button."
+msgid "Merge cell down"
+msgstr "Combinar celda inferior"
+
+msgctxt "Label for the merge table cell left button."
+msgid "Merge cell left"
+msgstr "Combinar celda izquierda"
+
+msgctxt "Label for the split table cell vertically button."
+msgid "Split cell vertically"
+msgstr "Dividir celdas verticalmente"
+
+msgctxt "Label for the split table cell horizontally button."
+msgid "Split cell horizontally"
+msgstr "Dividir celdas horizontalmente"
+
+msgctxt "Label for the merge table cells button."
+msgid "Merge cells"
+msgstr "Combinar celdas"

+ 89 - 0
packages/ckeditor5-table/lang/translations/id.po

@@ -0,0 +1,89 @@
+# Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+#
+#                                     !!! IMPORTANT !!!
+#
+#         Before you edit this file, please keep in mind that contributing to the project
+#                translations is possible ONLY via the Transifex online service.
+#
+#         To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
+#
+#                   To learn more, check out the official contributor's guide:
+#     https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
+#
+msgid ""
+msgstr ""
+"Language-Team: Indonesian (https://www.transifex.com/ckeditor/teams/11143/id/)\n"
+"Language: id\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+msgctxt "Label for the insert table toolbar button."
+msgid "Insert table"
+msgstr "Sisipkan tabel"
+
+msgctxt "Label for the set/unset table header column button."
+msgid "Header column"
+msgstr "Kolom tajuk"
+
+msgctxt "Label for the insert table column to the left of the current one button."
+msgid "Insert column left"
+msgstr "Sisipkan kolom ke kiri"
+
+msgctxt "Label for the insert table column to the right of the current one button."
+msgid "Insert column right"
+msgstr "Sisipkan kolom ke kanan"
+
+msgctxt "Label for the delete table column button."
+msgid "Delete column"
+msgstr "Hapus kolom"
+
+msgctxt "Label for the table column dropdown button."
+msgid "Column"
+msgstr "Kolom"
+
+msgctxt "Label for the set/unset table header row button."
+msgid "Header row"
+msgstr "Baris tajuk"
+
+msgctxt "Label for the insert row below button."
+msgid "Insert row below"
+msgstr "Sisipkan baris ke bawah"
+
+msgctxt "Label for the insert row above button."
+msgid "Insert row above"
+msgstr "Sisipkan baris ke atas"
+
+msgctxt "Label for the delete table row button."
+msgid "Delete row"
+msgstr "Hapus baris"
+
+msgctxt "Label for the table row dropdown button."
+msgid "Row"
+msgstr "Baris"
+
+msgctxt "Label for the merge table cell up button."
+msgid "Merge cell up"
+msgstr "Gabungkan sel ke atas"
+
+msgctxt "Label for the merge table cell right button."
+msgid "Merge cell right"
+msgstr "Gabungkan sel ke kanan"
+
+msgctxt "Label for the merge table cell down button."
+msgid "Merge cell down"
+msgstr "Gabungkan sel ke bawah"
+
+msgctxt "Label for the merge table cell left button."
+msgid "Merge cell left"
+msgstr "Gabungkan sel ke kiri"
+
+msgctxt "Label for the split table cell vertically button."
+msgid "Split cell vertically"
+msgstr "Bagikan sel secara vertikal"
+
+msgctxt "Label for the split table cell horizontally button."
+msgid "Split cell horizontally"
+msgstr "Bagikan sel secara horizontal"
+
+msgctxt "Label for the merge table cells button."
+msgid "Merge cells"
+msgstr "Gabungkan sel"

+ 1 - 1
packages/ckeditor5-table/lang/translations/sr-latn.po

@@ -12,7 +12,7 @@
 #
 msgid ""
 msgstr ""
-"Language-Team: Serbian (Latin) (https://www.transifex.com/ckeditor/teams/11143/sr%40latin/)\n"
+"Language-Team: Serbian (Latin) (https://www.transifex.com/ckeditor/teams/11143/sr@latin/)\n"
 "Language: sr@latin\n"
 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
 

+ 16 - 16
packages/ckeditor5-table/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@ckeditor/ckeditor5-table",
-  "version": "12.0.0",
+  "version": "12.0.1",
   "description": "Table feature for CKEditor 5.",
   "keywords": [
     "ckeditor",
@@ -10,23 +10,23 @@
     "ckeditor5-plugin"
   ],
   "dependencies": {
-    "@ckeditor/ckeditor5-core": "^12.0.0",
-    "@ckeditor/ckeditor5-ui": "^12.0.0",
-    "@ckeditor/ckeditor5-widget": "^11.0.0"
+    "@ckeditor/ckeditor5-core": "^12.1.0",
+    "@ckeditor/ckeditor5-ui": "^12.1.0",
+    "@ckeditor/ckeditor5-widget": "^11.0.1"
   },
   "devDependencies": {
-    "@ckeditor/ckeditor5-alignment": "^11.0.0",
-    "@ckeditor/ckeditor5-block-quote": "^11.0.0",
-    "@ckeditor/ckeditor5-clipboard": "^11.0.0",
-    "@ckeditor/ckeditor5-editor-classic": "^12.0.0",
-    "@ckeditor/ckeditor5-engine": "^13.0.0",
-    "@ckeditor/ckeditor5-image": "^13.0.0",
-    "@ckeditor/ckeditor5-list": "^12.0.0",
-    "@ckeditor/ckeditor5-media-embed": "^11.0.0",
-    "@ckeditor/ckeditor5-paragraph": "^11.0.0",
-    "@ckeditor/ckeditor5-typing": "^12.0.0",
-    "@ckeditor/ckeditor5-undo": "^11.0.0",
-    "@ckeditor/ckeditor5-utils": "^12.0.0",
+    "@ckeditor/ckeditor5-alignment": "^11.1.0",
+    "@ckeditor/ckeditor5-block-quote": "^11.0.1",
+    "@ckeditor/ckeditor5-clipboard": "^11.0.1",
+    "@ckeditor/ckeditor5-editor-classic": "^12.1.0",
+    "@ckeditor/ckeditor5-engine": "^13.1.0",
+    "@ckeditor/ckeditor5-image": "^13.0.1",
+    "@ckeditor/ckeditor5-list": "^12.0.1",
+    "@ckeditor/ckeditor5-media-embed": "^11.1.0",
+    "@ckeditor/ckeditor5-paragraph": "^11.0.1",
+    "@ckeditor/ckeditor5-typing": "^12.0.1",
+    "@ckeditor/ckeditor5-undo": "^11.0.1",
+    "@ckeditor/ckeditor5-utils": "^12.1.0",
     "eslint": "^5.5.0",
     "eslint-config-ckeditor5": "^1.0.11",
     "husky": "^1.3.1",

+ 1 - 1
packages/ckeditor5-table/src/commands/insertcolumncommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/commands/insertrowcommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/commands/inserttablecommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/commands/mergecellcommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/commands/removecolumncommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/commands/removerowcommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/commands/setheadercolumncommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/commands/setheaderrowcommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/commands/splitcellcommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/commands/utils.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 13 - 6
packages/ckeditor5-table/src/converters/downcast.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**
@@ -384,20 +384,19 @@ function createViewTableCellElement( tableWalkerValue, tableAttributes, insertPo
 
 	const tableCell = tableWalkerValue.cell;
 
-	const isSingleParagraph = tableCell.childCount === 1 && tableCell.getChild( 0 ).name === 'paragraph';
+	const firstChild = tableCell.getChild( 0 );
+	const isSingleParagraph = tableCell.childCount === 1 && firstChild.name === 'paragraph';
 
 	conversionApi.writer.insert( insertPosition, cellElement );
 
-	if ( isSingleParagraph ) {
+	if ( isSingleParagraph && !hasAnyAttribute( firstChild ) ) {
 		const innerParagraph = tableCell.getChild( 0 );
 		const paragraphInsertPosition = conversionApi.writer.createPositionAt( cellElement, 'end' );
 
 		conversionApi.consumable.consume( innerParagraph, 'insert' );
 
 		if ( options.asWidget ) {
-			const containerName = [ ...innerParagraph.getAttributeKeys() ].length ? 'p' : 'span';
-
-			const fakeParagraph = conversionApi.writer.createContainerElement( containerName );
+			const fakeParagraph = conversionApi.writer.createContainerElement( 'span' );
 
 			conversionApi.mapper.bindElements( innerParagraph, fakeParagraph );
 			conversionApi.writer.insert( paragraphInsertPosition, fakeParagraph );
@@ -554,3 +553,11 @@ function getViewTable( viewFigure ) {
 		}
 	}
 }
+
+// Checks if element has any attribute set.
+//
+// @param {module:engine/model/element~Element element
+// @returns {Boolean}
+function hasAnyAttribute( element ) {
+	return !![ ...element.getAttributeKeys() ].length;
+}

+ 1 - 1
packages/ckeditor5-table/src/converters/table-cell-content-post-fixer.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/converters/table-layout-post-fixer.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 7 - 1
packages/ckeditor5-table/src/converters/tablecell-post-fixer.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**
@@ -126,6 +126,12 @@ function getElementsToCheck( view ) {
 // - span: for single paragraph with no attributes.
 // - p   : in other cases.
 function ensureProperElementName( currentViewElement, mapper, writer ) {
+	// This situation may happen if a view element was changed and removed at the same time.
+	// In this case, the view element is already unbound so the post-fixer would crash.
+	if ( !currentViewElement.root.is( 'rootElement' ) ) {
+		return false;
+	}
+
 	const modelParagraph = mapper.toModelElement( currentViewElement );
 	const expectedViewElementName = getExpectedElementName( modelParagraph.parent, modelParagraph );
 

+ 1 - 1
packages/ckeditor5-table/src/converters/upcasttable.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 9 - 1
packages/ckeditor5-table/src/table.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**
@@ -55,3 +55,11 @@ export default class Table extends Plugin {
  *
  * @interface TableConfig
  */
+
+/**
+ * The configuration of the {@link module:table/table~Table} feature.
+ *
+ * Read more in {@link module:table/table~TableConfig}.
+ *
+ * @member {module:table/table~TableConfig} module:core/editor/editorconfig~EditorConfig#table
+ */

+ 8 - 2
packages/ckeditor5-table/src/tableediting.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**
@@ -217,7 +217,13 @@ export default class TableEditing extends Plugin {
 			const isLastRow = currentRowIndex === table.childCount - 1;
 
 			if ( isForward && isLastRow && isLastCellInRow ) {
-				editor.plugins.get( 'TableUtils' ).insertRows( table, { at: table.childCount } );
+				editor.execute( 'insertTableRowBelow' );
+
+				// Check if the command actually added a row. If `insertTableRowBelow` execution didn't add a row (because it was disabled
+				// or it got overwritten) do not change the selection.
+				if ( currentRowIndex === table.childCount - 1 ) {
+					return;
+				}
 			}
 
 			let cellToFocus;

+ 4 - 27
packages/ckeditor5-table/src/tabletoolbar.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**
@@ -15,14 +15,11 @@ import WidgetToolbarRepository from '@ckeditor/ckeditor5-widget/src/widgettoolba
  * The table toolbar class. It creates toolbars for the table feature and its content (for now only for a table cell content).
  *
  * Table toolbar shows up when a table widget is selected. Its components (e.g. buttons) are created based on the
- * {@link module:table/table~TableConfig#toolbar `table.tableToolbar` configuration option}.
+ * {@link module:table/table~TableConfig#tableToolbar `table.tableToolbar` configuration option}.
  *
  * Table content toolbar shows up when the selection is inside the content of a table. It creates its component based on the
  * {@link module:table/table~TableConfig#contentToolbar `table.contentToolbar` configuration option}.
  *
- * Note that the old {@link module:table/table~TableConfig#toolbar `table.toolbar` configuration option} is deprecated
- * and will be removed in the next major release.
- *
  * @extends module:core/plugin~Plugin
  */
 export default class TableToolbar extends Plugin {
@@ -48,21 +45,12 @@ export default class TableToolbar extends Plugin {
 		const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
 
 		const tableContentToolbarItems = editor.config.get( 'table.contentToolbar' );
-		const deprecatedTableContentToolbarItems = editor.config.get( 'table.toolbar' );
 
 		const tableToolbarItems = editor.config.get( 'table.tableToolbar' );
 
-		if ( deprecatedTableContentToolbarItems ) {
-			// eslint-disable-next-line
-			console.warn(
-				'`config.table.toolbar` is deprecated and will be removed in the next major release.' +
-				' Use `config.table.contentToolbar` instead.'
-			);
-		}
-
-		if ( tableContentToolbarItems || deprecatedTableContentToolbarItems ) {
+		if ( tableContentToolbarItems ) {
 			widgetToolbarRepository.register( 'tableContent', {
-				items: tableContentToolbarItems || deprecatedTableContentToolbarItems,
+				items: tableContentToolbarItems,
 				getRelatedElement: getTableWidgetAncestor
 			} );
 		}
@@ -76,17 +64,6 @@ export default class TableToolbar extends Plugin {
 	}
 }
 
-/**
- * Items to be placed in the table content toolbar.
- *
- * **Note:** This configuration option is deprecated! Use {@link module:table/table~TableConfig#contentToolbar} instead.
- *
- * Read more about configuring toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
- *
- * @deprecated
- * @member {Array.<String>} module:table/table~TableConfig#toolbar
- */
-
 /**
  * Items to be placed in the table content toolbar.
  * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar working.

+ 1 - 1
packages/ckeditor5-table/src/tableui.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/tableutils.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/tablewalker.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/ui/inserttableview.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/src/utils.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /**

+ 1 - 1
packages/ckeditor5-table/tests/_utils/utils.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import {

+ 1 - 1
packages/ckeditor5-table/tests/commands/insertcolumncommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';

+ 1 - 1
packages/ckeditor5-table/tests/commands/insertrowcommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';

+ 1 - 1
packages/ckeditor5-table/tests/commands/inserttablecommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';

+ 1 - 1
packages/ckeditor5-table/tests/commands/mergecellcommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';

+ 1 - 1
packages/ckeditor5-table/tests/commands/removecolumncommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';

+ 1 - 1
packages/ckeditor5-table/tests/commands/removerowcommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';

+ 1 - 1
packages/ckeditor5-table/tests/commands/setheadercolumncommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';

+ 1 - 1
packages/ckeditor5-table/tests/commands/setheaderrowcommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';

+ 1 - 1
packages/ckeditor5-table/tests/commands/splitcellcommand.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';

+ 1 - 1
packages/ckeditor5-table/tests/commands/utils.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';

+ 30 - 1
packages/ckeditor5-table/tests/converters/downcast.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
@@ -147,6 +147,35 @@ describe( 'downcast converters', () => {
 			) );
 		} );
 
+		it( 'should create table with block content (attribute on paragraph)', () => {
+			editor.conversion.attributeToAttribute(
+				{
+					model: { key: 'alignment', values: [ 'right', 'center', 'justify' ] },
+					view: {
+						right: { key: 'style', value: { 'text-align': 'right' } },
+						center: { key: 'style', value: { 'text-align': 'center' } },
+						justify: { key: 'style', value: { 'text-align': 'justify' } }
+					}
+				}
+			);
+
+			setModelData( model, modelTable( [
+				[ '<paragraph alignment="right">00</paragraph>' ]
+			] ) );
+
+			expect( formatTable( getViewData( viewDocument, { withoutSelection: true } ) ) ).to.equal( formatTable(
+				'<figure class="table">' +
+					'<table>' +
+						'<tbody>' +
+							'<tr>' +
+								'<td><p style="text-align:right">00</p></td>' +
+							'</tr>' +
+						'</tbody>' +
+					'</table>' +
+				'</figure>'
+			) );
+		} );
+
 		it( 'should be possible to overwrite', () => {
 			editor.conversion.elementToElement( { model: 'tableRow', view: 'tr', converterPriority: 'high' } );
 			editor.conversion.elementToElement( { model: 'tableCell', view: 'td', converterPriority: 'high' } );

+ 1 - 1
packages/ckeditor5-table/tests/converters/table-cell-content-post-fixer.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';

+ 1 - 1
packages/ckeditor5-table/tests/converters/table-layout-post-fixer.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';

+ 22 - 2
packages/ckeditor5-table/tests/converters/tablecell-post-fixer.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /* globals document */
@@ -14,6 +14,8 @@ import env from '@ckeditor/ckeditor5-utils/src/env';
 import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
 import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
 
+import Delete from '@ckeditor/ckeditor5-typing/src/delete';
+
 describe( 'TableCell post-fixer', () => {
 	let editor, model, doc, root, view;
 
@@ -26,7 +28,7 @@ describe( 'TableCell post-fixer', () => {
 		// Most tests assume non-edge environment but we do not set `contenteditable=false` on Edge so stub `env.isEdge`.
 		testUtils.sinon.stub( env, 'isEdge' ).get( () => false );
 
-		return ClassicTestEditor.create( element )
+		return ClassicTestEditor.create( element, { extraPlugins: [ Delete ] } )
 			.then( newEditor => {
 				editor = newEditor;
 				model = editor.model;
@@ -309,4 +311,22 @@ describe( 'TableCell post-fixer', () => {
 		// If called thrice the selection post fixer for table cell was also called.
 		sinon.assert.calledTwice( spy );
 	} );
+
+	// https://github.com/ckeditor/ckeditor5-table/issues/191.
+	it( 'should not fire (and crash) for removed view elements', () => {
+		editor.setData( viewTable( [ [ '<p>foo</p>' ] ] ) );
+
+		const p = root.getNodeByPath( [ 0, 0, 0, 0 ] );
+
+		// Replace table cell contents with paragraph - as model.deleteContent() does.
+		model.change( writer => {
+			writer.setSelection( writer.createRangeIn( root ) );
+			editor.execute( 'delete' ); // For some reason it didn't crash with `writer.remove()`.
+
+			writer.setAttribute( 'foo', 'bar', p );
+		} );
+
+		// Trying to map view selection to DOM range shouldn't throw after post-fixer will fix inserted <p> to <span>.
+		expect( editor.getData() ).to.equal( '' );
+	} );
 } );

+ 1 - 1
packages/ckeditor5-table/tests/converters/upcasttable.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';

+ 1 - 1
packages/ckeditor5-table/tests/integration.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';

+ 1 - 1
packages/ckeditor5-table/tests/manual/table.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /* globals console, window, document */

+ 1 - 1
packages/ckeditor5-table/tests/manual/tableblockcontent.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /* globals console, window, document */

+ 1 - 1
packages/ckeditor5-table/tests/table-integration.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import Widget from '@ckeditor/ckeditor5-widget/src/widget';

+ 1 - 1
packages/ckeditor5-table/tests/table.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import Table from '../src/table';

+ 17 - 1
packages/ckeditor5-table/tests/tableediting.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
@@ -294,6 +294,22 @@ describe( 'TableEditing', () => {
 				] ) );
 			} );
 
+			it( 'should not create another row and not move the caret if insertTableRowBelow command is disabled', () => {
+				setModelData( model, modelTable( [
+					[ '11', '12[]' ]
+				] ) );
+
+				const insertTableRowBelowCommand = editor.commands.get( 'insertTableRowBelow' );
+
+				insertTableRowBelowCommand.forceDisabled( 'test' );
+
+				editor.editing.view.document.fire( 'keydown', domEvtDataStub );
+
+				expect( formatTable( getModelData( model ) ) ).to.equal( formattedModelTable( [
+					[ '11', '12[]' ]
+				] ) );
+			} );
+
 			it( 'should move to the first cell of next row if on end of a row', () => {
 				setModelData( model, modelTable( [
 					[ '11', '12[]' ],

+ 3 - 81
packages/ckeditor5-table/tests/tabletoolbar.js

@@ -1,9 +1,9 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
-/* global document, window */
+/* global document */
 
 import ClassicTestEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
 import TableToolbar from '../src/tabletoolbar';
@@ -77,7 +77,7 @@ describe( 'TableToolbar', () => {
 		} );
 
 		describe( 'toolbar', () => {
-			it( 'should use the config.table.toolbar to create items', () => {
+			it( 'should use the config.table.contenToolbar to create items', () => {
 				expect( toolbar.items ).to.have.length( 1 );
 				expect( toolbar.items.get( 0 ).label ).to.equal( 'fake button' );
 			} );
@@ -238,69 +238,6 @@ describe( 'TableToolbar', () => {
 		} );
 	} );
 
-	describe( 'deprecated toolbar', () => {
-		let editor, editorElement, warnMock;
-
-		it( 'table.toolbar should work as table.contentToolbar', () => {
-			editorElement = global.document.createElement( 'div' );
-			global.document.body.appendChild( editorElement );
-			warnMock = sinon.stub( window.console, 'warn' );
-
-			return ClassicTestEditor
-				.create( editorElement, {
-					plugins: [ Paragraph, Table, TableToolbar, FakeButton ],
-					table: {
-						toolbar: [ 'fake_button' ]
-					}
-				} )
-				.then( newEditor => {
-					editor = newEditor;
-
-					const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
-					const toolbarView = widgetToolbarRepository._toolbarDefinitions.get( 'tableContent' ).view;
-
-					expect( toolbarView.items ).to.have.length( 1 );
-					expect( toolbarView.items.get( 0 ).label ).to.equal( 'fake button' );
-
-					sinon.assert.calledWith(
-						warnMock,
-						'`config.table.toolbar` is deprecated and will be removed in the next major release.' +
-						' Use `config.table.contentToolbar` instead.'
-					);
-				} );
-		} );
-
-		it( 'table.contentToolbar should be used if both toolbars options are provided', () => {
-			editorElement = global.document.createElement( 'div' );
-			global.document.body.appendChild( editorElement );
-			warnMock = sinon.stub( window.console, 'warn' );
-
-			return ClassicTestEditor
-				.create( editorElement, {
-					plugins: [ Paragraph, Table, TableToolbar, FakeButton, FooButton ],
-					table: {
-						toolbar: [ 'fake_button' ],
-						contentToolbar: [ 'foo_button' ],
-					}
-				} )
-				.then( newEditor => {
-					editor = newEditor;
-
-					const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
-					const toolbarView = widgetToolbarRepository._toolbarDefinitions.get( 'tableContent' ).view;
-
-					expect( toolbarView.items ).to.have.length( 1 );
-					expect( toolbarView.items.get( 0 ).label ).to.equal( 'foo button' );
-				} );
-		} );
-
-		afterEach( () => {
-			editorElement.remove();
-
-			return editor.destroy();
-		} );
-	} );
-
 	describe( 'tableToolbar', () => {
 		let editor, element, widgetToolbarRepository, balloon, toolbar, model;
 
@@ -482,18 +419,3 @@ class FakeButton extends Plugin {
 		} );
 	}
 }
-
-// Plugin that adds foo_button to editor's component factory.
-class FooButton extends Plugin {
-	init() {
-		this.editor.ui.componentFactory.add( 'foo_button', locale => {
-			const view = new ButtonView( locale );
-
-			view.set( {
-				label: 'foo button'
-			} );
-
-			return view;
-		} );
-	}
-}

+ 1 - 1
packages/ckeditor5-table/tests/tableui.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /* global document */

+ 1 - 1
packages/ckeditor5-table/tests/tableutils.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';

+ 1 - 1
packages/ckeditor5-table/tests/tablewalker.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 import { setData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';

+ 1 - 1
packages/ckeditor5-table/tests/ui/inserttableview.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /* globals document, Event */

+ 1 - 1
packages/ckeditor5-table/theme/icons/table-column.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></g></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>

+ 1 - 1
packages/ckeditor5-table/theme/icons/table-merge-cell.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></g></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>

+ 1 - 1
packages/ckeditor5-table/theme/icons/table-row.svg

@@ -1 +1 @@
-<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></g></svg>
+<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></svg>

+ 1 - 1
packages/ckeditor5-table/theme/inserttable.css

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 :root {

+ 1 - 1
packages/ckeditor5-table/theme/table.css

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 .ck-content .table {

+ 1 - 1
packages/ckeditor5-table/theme/tableediting.css

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  */
 
 /*