qms-angular 1.0.72 → 1.0.76

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.
Files changed (190) hide show
  1. package/bundles/qms-angular.umd.js +826 -467
  2. package/bundles/qms-angular.umd.js.map +1 -1
  3. package/esm2015/lib/components/button/button.js +1 -1
  4. package/esm2015/lib/components/comment/comment.js +2 -2
  5. package/esm2015/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.js +12 -8
  6. package/esm2015/lib/components/qms-navigation-drawer/qms-navigation-drawer.module.js +4 -4
  7. package/esm2015/lib/components/qms-paginator/qms-paginator.component.js +5 -3
  8. package/esm2015/lib/components/qms-stepper/qms-stepper.component.js +1 -1
  9. package/esm2015/lib/components/related/popup/related-popup.component.js +10 -10
  10. package/esm2015/lib/components/select-include-children/select-include-children.component.js +112 -45
  11. package/esm2015/lib/components/select-process-document/select-process-document.component.js +64 -143
  12. package/esm2015/lib/components/side-sheet/directives/drawer-content.directive.js +20 -0
  13. package/esm2015/lib/components/side-sheet/directives/drawer-header-action.directive.js +20 -0
  14. package/esm2015/lib/components/side-sheet/directives/drawer-header.directive.js +20 -0
  15. package/esm2015/lib/components/side-sheet/directives/drawer.directive.js +20 -0
  16. package/esm2015/lib/components/side-sheet/index.js +2 -0
  17. package/esm2015/lib/components/side-sheet/public-api.js +6 -0
  18. package/esm2015/lib/components/side-sheet/side-sheet.module.js +28 -0
  19. package/esm2015/lib/components/tree/tree.component.js +10 -14
  20. package/esm2015/lib/directives/table/table-row.directive.js +50 -0
  21. package/esm2015/lib/directives/table/table.directive.js +18 -61
  22. package/esm2015/lib/model/en.js +19 -2
  23. package/esm2015/lib/model/no.js +19 -2
  24. package/esm2015/lib/qms-angular.module.js +5 -18
  25. package/esm2015/lib/qms-ckeditor-components/common/classes/qmsUploadAdapter.js +89 -0
  26. package/esm2015/lib/qms-ckeditor-components/common/constants/ckeditorEvent.constant.js +3 -1
  27. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.js +1 -1
  28. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-video-tree.model.js +4 -0
  29. package/esm2015/lib/qms-ckeditor-components/common/models/wproofreader-config.model.js +6 -0
  30. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-about/qms-ckeditor-about.component.js +38 -0
  31. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/qms-ckeditor-bpmn.component.js +22 -3
  32. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.js +9 -8
  33. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +4 -1
  34. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.js +3 -4
  35. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +161 -11
  36. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.module.js +7 -3
  37. package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-tree.service.js +4 -1
  38. package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-upload.service.js +20 -0
  39. package/esm2015/public-api.js +4 -5
  40. package/esm2015/qms-angular.js +6 -4
  41. package/fesm2015/qms-angular.js +744 -418
  42. package/fesm2015/qms-angular.js.map +1 -1
  43. package/lib/components/button/button.d.ts +1 -1
  44. package/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.d.ts +2 -2
  45. package/lib/components/select-include-children/select-include-children.component.d.ts +2 -1
  46. package/lib/components/select-process-document/select-process-document.component.d.ts +3 -0
  47. package/lib/{directives/side-sheet → components/side-sheet/directives}/drawer-content.directive.d.ts +0 -0
  48. package/lib/{directives/side-sheet → components/side-sheet/directives}/drawer-header-action.directive.d.ts +0 -0
  49. package/lib/{directives/side-sheet → components/side-sheet/directives}/drawer-header.directive.d.ts +0 -0
  50. package/lib/{directives/side-sheet → components/side-sheet/directives}/drawer.directive.d.ts +0 -0
  51. package/lib/components/side-sheet/index.d.ts +1 -0
  52. package/lib/components/side-sheet/public-api.d.ts +5 -0
  53. package/lib/components/side-sheet/side-sheet.module.d.ts +2 -0
  54. package/lib/directives/table/table-row.directive.d.ts +13 -0
  55. package/lib/directives/table/table.directive.d.ts +2 -11
  56. package/lib/model/en.d.ts +17 -0
  57. package/lib/model/no.d.ts +17 -0
  58. package/lib/qms-ckeditor-components/common/classes/qmsUploadAdapter.d.ts +18 -0
  59. package/lib/qms-ckeditor-components/common/constants/ckeditorEvent.constant.d.ts +2 -0
  60. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.d.ts +4 -0
  61. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-video-tree.model.d.ts +5 -0
  62. package/lib/qms-ckeditor-components/common/models/wproofreader-config.model.d.ts +25 -0
  63. package/lib/qms-ckeditor-components/components/qms-ckeditor-about/qms-ckeditor-about.component.d.ts +15 -0
  64. package/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/qms-ckeditor-bpmn.component.d.ts +4 -1
  65. package/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.d.ts +2 -1
  66. package/lib/qms-ckeditor-components/qms-ckeditor.component.d.ts +15 -1
  67. package/lib/qms-ckeditor-components/services/qms-ckeditor-tree.service.d.ts +2 -0
  68. package/lib/qms-ckeditor-components/services/qms-ckeditor-upload.service.d.ts +5 -0
  69. package/lib.theme.scss +1 -0
  70. package/package.json +1 -1
  71. package/public-api.d.ts +2 -4
  72. package/qms-angular.d.ts +5 -3
  73. package/qms-angular.metadata.json +1 -1
  74. package/src/assets/images/ckeditor5.svg +1 -0
  75. package/src/assets/jointjs/scss/rappid.scss +1 -1
  76. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +1 -1
  77. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
  78. package/src/assets/qms-ckeditor-plugin/build/translations/az.js +1 -1
  79. package/src/assets/qms-ckeditor-plugin/build/translations/cs.js +1 -1
  80. package/src/assets/qms-ckeditor-plugin/build/translations/da.js +1 -1
  81. package/src/assets/qms-ckeditor-plugin/build/translations/de-ch.js +1 -1
  82. package/src/assets/qms-ckeditor-plugin/build/translations/de.js +1 -1
  83. package/src/assets/qms-ckeditor-plugin/build/translations/en-au.js +1 -1
  84. package/src/assets/qms-ckeditor-plugin/build/translations/es.js +1 -1
  85. package/src/assets/qms-ckeditor-plugin/build/translations/et.js +1 -1
  86. package/src/assets/qms-ckeditor-plugin/build/translations/fa.js +1 -1
  87. package/src/assets/qms-ckeditor-plugin/build/translations/fr.js +1 -1
  88. package/src/assets/qms-ckeditor-plugin/build/translations/gl.js +1 -1
  89. package/src/assets/qms-ckeditor-plugin/build/translations/he.js +1 -1
  90. package/src/assets/qms-ckeditor-plugin/build/translations/hi.js +1 -1
  91. package/src/assets/qms-ckeditor-plugin/build/translations/hr.js +1 -1
  92. package/src/assets/qms-ckeditor-plugin/build/translations/hu.js +1 -1
  93. package/src/assets/qms-ckeditor-plugin/build/translations/id.js +1 -1
  94. package/src/assets/qms-ckeditor-plugin/build/translations/it.js +1 -1
  95. package/src/assets/qms-ckeditor-plugin/build/translations/ja.js +1 -1
  96. package/src/assets/qms-ckeditor-plugin/build/translations/ko.js +1 -1
  97. package/src/assets/qms-ckeditor-plugin/build/translations/ku.js +1 -1
  98. package/src/assets/qms-ckeditor-plugin/build/translations/lv.js +1 -1
  99. package/src/assets/qms-ckeditor-plugin/build/translations/nl.js +1 -1
  100. package/src/assets/qms-ckeditor-plugin/build/translations/no.js +1 -1
  101. package/src/assets/qms-ckeditor-plugin/build/translations/pl.js +1 -1
  102. package/src/assets/qms-ckeditor-plugin/build/translations/pt-br.js +1 -1
  103. package/src/assets/qms-ckeditor-plugin/build/translations/ru.js +1 -1
  104. package/src/assets/qms-ckeditor-plugin/build/translations/sk.js +1 -1
  105. package/src/assets/qms-ckeditor-plugin/build/translations/sl.js +1 -1
  106. package/src/assets/qms-ckeditor-plugin/build/translations/sr-latn.js +1 -1
  107. package/src/assets/qms-ckeditor-plugin/build/translations/sr.js +1 -1
  108. package/src/assets/qms-ckeditor-plugin/build/translations/th.js +1 -1
  109. package/src/assets/qms-ckeditor-plugin/build/translations/tk.js +1 -1
  110. package/src/assets/qms-ckeditor-plugin/build/translations/tr.js +1 -1
  111. package/src/assets/qms-ckeditor-plugin/build/translations/uk.js +1 -1
  112. package/src/assets/qms-ckeditor-plugin/build/translations/vi.js +1 -1
  113. package/src/assets/qms-ckeditor-plugin/build/translations/zh-cn.js +1 -1
  114. package/src/assets/qms-ckeditor-plugin/build/translations/zh.js +1 -1
  115. package/src/assets/qms-ckeditor-plugin/package-lock.json +23 -0
  116. package/src/assets/qms-ckeditor-plugin/package.json +2 -0
  117. package/src/assets/qms-ckeditor-plugin/src/ckeditor.js +18 -4
  118. package/src/assets/qms-ckeditor-plugin/src/plugins/aboutckeditor/aboutckeditor.js +28 -0
  119. package/src/assets/qms-ckeditor-plugin/src/plugins/bpmn/bpmndialogcommand.js +74 -0
  120. package/src/assets/qms-ckeditor-plugin/src/plugins/bpmn/qmsCKEditorBpmnPlugin.js +5 -68
  121. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/contexts.json +3 -0
  122. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/de.po +21 -0
  123. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/en.po +21 -0
  124. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/gl.po +21 -0
  125. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/hu.po +21 -0
  126. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/it.po +21 -0
  127. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/ru.po +21 -0
  128. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/zh.po +21 -0
  129. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/src/index.js +10 -0
  130. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/src/sourceediting.js +386 -0
  131. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/src/utils/formathtml.js +142 -0
  132. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/theme/icons/source-editing.svg +1 -0
  133. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/theme/sourceediting.css +48 -0
  134. package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorConstant.js +4 -0
  135. package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorService.js +21 -0
  136. package/src/assets/qms-ckeditor-plugin/src/plugins/fullscreen/qmsCKEditorFullscreenPlugin.js +1 -5
  137. package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/imagemapcommand.js +1 -0
  138. package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/utils.js +1 -1
  139. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkcommand.js +131 -176
  140. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkdialogcommand.js +88 -0
  141. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkediting.js +2 -0
  142. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkui.js +41 -32
  143. package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/tableofcontents.js +14 -0
  144. package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/tableofcontentscommand.js +87 -0
  145. package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/tableofcontentsediting.js +59 -0
  146. package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/tableofcontentsui.js +35 -0
  147. package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/utils.js +62 -0
  148. package/src/assets/qms-ckeditor-plugin/src/plugins/template/loadtemplatedialogcommand.js +14 -0
  149. package/src/assets/qms-ckeditor-plugin/src/plugins/template/qmsCKEditorLoadTemplatePlugin.js +10 -12
  150. package/src/assets/qms-ckeditor-plugin/src/plugins/template/qmsCKEdtiorTemplatePlugin.js +10 -7
  151. package/src/assets/qms-ckeditor-plugin/src/plugins/template/templatedialogcommand.js +9 -0
  152. package/src/assets/qms-ckeditor-plugin/src/plugins/timestamp/timestamp.js +15 -18
  153. package/src/assets/qms-ckeditor-plugin/src/plugins/timestamp/timestampcommand.js +17 -0
  154. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/removetooltipcommand.js +42 -26
  155. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltip.js +3 -3
  156. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipcommand.js +75 -0
  157. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipdialogcommand.js +68 -0
  158. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipediting.js +206 -131
  159. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipui.js +424 -136
  160. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/ui/actionsview.js +67 -12
  161. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/utils.js +17 -55
  162. package/src/assets/qms-ckeditor-plugin/src/plugins/video/autovideo.js +1 -5
  163. package/src/assets/qms-ckeditor-plugin/src/plugins/video/video/videoediting.js +5 -2
  164. package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/browsevideodialogcommand.js +25 -0
  165. package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/uploadvideocommand.js +3 -16
  166. package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/videouploadediting.js +4 -0
  167. package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/videouploadui.js +12 -23
  168. package/src/assets/qms-ckeditor-plugin/src/themes/icons/information.svg +1 -50
  169. package/src/assets/qms-ckeditor-plugin/src/themes/icons/table-excel.svg +44 -0
  170. package/src/assets/qms-ckeditor-plugin/src/themes/icons/timestamp.svg +1 -1
  171. package/src/assets/qms-ckeditor-plugin/src/themes/icons/tooltip.svg +1 -0
  172. package/src/assets/qms-ckeditor-plugin/src/themes/styles/heading.css +54 -0
  173. package/src/assets/qms-ckeditor-plugin/src/themes/styles/tooltip.css +11 -53
  174. package/src/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.scss +47 -23
  175. package/src/lib/components/qms-paginator/qms-paginator.component.scss +40 -3
  176. package/src/lib/components/qms-stepper/qms-stepper.component.scss +2 -1
  177. package/src/lib/components/select-process-document/select-process-document.component.scss +2 -2
  178. package/src/lib/qms-ckeditor-components/components/qms-ckeditor-about/qms-ckeditor-about.component.scss +16 -0
  179. package/src/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.scss +25 -23
  180. package/src/lib/qms-ckeditor-components/qms-ckeditor.component.scss +11 -11
  181. package/src/themes/core/_range-slider.scss +10 -12
  182. package/src/themes/core/_side-sheet.scss +2 -2
  183. package/src/themes/core/_table.scss +176 -37
  184. package/esm2015/lib/directives/side-sheet/drawer-content.directive.js +0 -20
  185. package/esm2015/lib/directives/side-sheet/drawer-header-action.directive.js +0 -20
  186. package/esm2015/lib/directives/side-sheet/drawer-header.directive.js +0 -20
  187. package/esm2015/lib/directives/side-sheet/drawer.directive.js +0 -20
  188. package/esm2015/lib/qms-ckeditor-components/common/classes/uploadAdapter.js +0 -26
  189. package/lib/qms-ckeditor-components/common/classes/uploadAdapter.d.ts +0 -5
  190. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/inserttooltipcommand.js +0 -88
@@ -0,0 +1,142 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ /**
7
+ * @module source-editing/utils/formathtml
8
+ */
9
+
10
+ /**
11
+ * A simple (and naive) HTML code formatter that returns a formatted HTML markup that can be easily
12
+ * parsed by human eyes. It beautifies the HTML code by adding new lines between elements that behave like block elements
13
+ * (https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
14
+ * and a few more like `tr`, `td`, and similar ones) and inserting indents for nested content.
15
+ *
16
+ * WARNING: This function works only on a text that does not contain any indentations or new lines.
17
+ * Calling this function on the already formatted text will damage the formatting.
18
+ *
19
+ * @param {String} input An HTML string to format.
20
+ * @returns {String}
21
+ */
22
+ export function formatHtml( input ) {
23
+ // A list of block-like elements around which the new lines should be inserted, and within which
24
+ // the indentation of their children should be increased.
25
+ // The list is partially based on https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements that contains
26
+ // a full list of HTML block-level elements.
27
+ // A void element is an element that cannot have any child - https://html.spec.whatwg.org/multipage/syntax.html#void-elements.
28
+ const elementsToFormat = [
29
+ { name: 'address', isVoid: false },
30
+ { name: 'article', isVoid: false },
31
+ { name: 'aside', isVoid: false },
32
+ { name: 'blockquote', isVoid: false },
33
+ { name: 'br', isVoid: true },
34
+ { name: 'details', isVoid: false },
35
+ { name: 'dialog', isVoid: false },
36
+ { name: 'dd', isVoid: false },
37
+ { name: 'div', isVoid: false },
38
+ { name: 'dl', isVoid: false },
39
+ { name: 'dt', isVoid: false },
40
+ { name: 'fieldset', isVoid: false },
41
+ { name: 'figcaption', isVoid: false },
42
+ { name: 'figure', isVoid: false },
43
+ { name: 'footer', isVoid: false },
44
+ { name: 'form', isVoid: false },
45
+ { name: 'h1', isVoid: false },
46
+ { name: 'h2', isVoid: false },
47
+ { name: 'h3', isVoid: false },
48
+ { name: 'h4', isVoid: false },
49
+ { name: 'h5', isVoid: false },
50
+ { name: 'h6', isVoid: false },
51
+ { name: 'header', isVoid: false },
52
+ { name: 'hgroup', isVoid: false },
53
+ { name: 'hr', isVoid: true },
54
+ { name: 'input', isVoid: true },
55
+ { name: 'li', isVoid: false },
56
+ { name: 'main', isVoid: false },
57
+ { name: 'nav', isVoid: false },
58
+ { name: 'ol', isVoid: false },
59
+ { name: 'p', isVoid: false },
60
+ { name: 'pre', isVoid: false },
61
+ { name: 'section', isVoid: false },
62
+ { name: 'table', isVoid: false },
63
+ { name: 'tbody', isVoid: false },
64
+ { name: 'td', isVoid: false },
65
+ { name: 'textarea', isVoid: false },
66
+ { name: 'th', isVoid: false },
67
+ { name: 'thead', isVoid: false },
68
+ { name: 'tr', isVoid: false },
69
+ { name: 'ul', isVoid: false }
70
+ ];
71
+
72
+ const elementNamesToFormat = elementsToFormat.map( element => element.name ).join( '|' );
73
+
74
+ // It is not the fastest way to format the HTML markup but the performance should be good enough.
75
+ const lines = input
76
+ // Add new line before and after `<tag>` and `</tag>`.
77
+ // It may separate individual elements with two new lines, but this will be fixed below.
78
+ .replace( new RegExp( `</?(${ elementNamesToFormat })( .*?)?>`, 'g' ), '\n$&\n' )
79
+ // Divide input string into lines, which start with either an opening tag, a closing tag, or just a text.
80
+ .split( '\n' );
81
+
82
+ let indentCount = 0;
83
+
84
+ return lines
85
+ .filter( line => line.length )
86
+ .map( line => {
87
+ if ( isNonVoidOpeningTag( line, elementsToFormat ) ) {
88
+ return indentLine( line, indentCount++ );
89
+ }
90
+
91
+ if ( isClosingTag( line, elementsToFormat ) ) {
92
+ return indentLine( line, --indentCount );
93
+ }
94
+
95
+ return indentLine( line, indentCount );
96
+ } )
97
+ .join( '\n' );
98
+ }
99
+
100
+ // Checks, if an argument is an opening tag of a non-void element to be formatted.
101
+ //
102
+ // @param {String} line String to check.
103
+ // @param {Array} elementsToFormat Elements to be formatted.
104
+ // @param {String} elementsToFormat.name Element name.
105
+ // @param {Boolean} elementsToFormat.isVoid Flag indicating whether element is a void one.
106
+ // @returns {Boolean}
107
+ function isNonVoidOpeningTag( line, elementsToFormat ) {
108
+ return elementsToFormat.some( element => {
109
+ if ( element.isVoid ) {
110
+ return false;
111
+ }
112
+
113
+ if ( !new RegExp( `<${ element.name }( .*?)?>` ).test( line ) ) {
114
+ return false;
115
+ }
116
+
117
+ return true;
118
+ } );
119
+ }
120
+
121
+ // Checks, if an argument is a closing tag.
122
+ //
123
+ // @param {String} line String to check.
124
+ // @param {Array} elementsToFormat Elements to be formatted.
125
+ // @param {String} elementsToFormat.name Element name.
126
+ // @param {Boolean} elementsToFormat.isVoid Flag indicating whether element is a void one.
127
+ // @returns {Boolean}
128
+ function isClosingTag( line, elementsToFormat ) {
129
+ return elementsToFormat.some( element => {
130
+ return new RegExp( `</${ element.name }>` ).test( line );
131
+ } );
132
+ }
133
+
134
+ // Indents a line by a specified number of characters.
135
+ //
136
+ // @param {String} line Line to indent.
137
+ // @param {Number} indentCount Number of characters to use for indentation.
138
+ // @param {String} [indentChar] Indentation character(s). 4 spaces by default.
139
+ // @returns {String}
140
+ function indentLine( line, indentCount, indentChar = ' ' ) {
141
+ return `${ indentChar.repeat( indentCount ) }${ line }`;
142
+ }
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m12.5 0 5 4.5v15.003h-16V0h11zM3 1.5v3.25l-1.497 1-.003 8 1.5 1v3.254L7.685 18l-.001 1.504H17.5V8.002L16 9.428l-.004-4.22-4.222-3.692L3 1.5z"/><path d="M4.06 6.64a.75.75 0 0 1 .958 1.15l-.085.07L2.29 9.75l2.646 1.89c.302.216.4.62.232.951l-.058.095a.75.75 0 0 1-.951.232l-.095-.058-3.5-2.5V9.14l3.496-2.5zm4.194 6.22a.75.75 0 0 1-.958-1.149l.085-.07 2.643-1.89-2.646-1.89a.75.75 0 0 1-.232-.952l.058-.095a.75.75 0 0 1 .95-.232l.096.058 3.5 2.5v1.22l-3.496 2.5zm7.644-.836 2.122 2.122-5.825 5.809-2.125-.005.003-2.116zm2.539-1.847 1.414 1.414a.5.5 0 0 1 0 .707l-1.06 1.06-2.122-2.12 1.061-1.061a.5.5 0 0 1 .707 0z"/></svg>
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ @import "@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css";
7
+ @import "@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css";
8
+ @import "@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css";
9
+
10
+ .ck-source-editing-area {
11
+ display: inline-grid;
12
+ width: 100%;
13
+ font-family: monospace;
14
+ }
15
+
16
+ .ck-source-editing-area::after,
17
+ .ck-source-editing-area textarea {
18
+ grid-area: 1/1;
19
+ padding: var(--ck-spacing-large);
20
+ margin: 0;
21
+ border: 1px solid transparent;
22
+ line-height: var(--ck-line-height-base);
23
+ font-size: var(--ck-font-size-normal);
24
+ white-space: pre-wrap;
25
+ }
26
+
27
+ .ck-source-editing-area::after {
28
+ content: attr(data-value) " ";
29
+ visibility: hidden;
30
+ }
31
+
32
+ .ck-source-editing-area textarea {
33
+ resize: none;
34
+ outline: none;
35
+ overflow: hidden;
36
+
37
+ border-color: var(--ck-color-base-border);
38
+
39
+ @mixin ck-rounded-corners {
40
+ border-top-left-radius: 0;
41
+ border-top-right-radius: 0;
42
+ }
43
+
44
+ &:not([readonly]):focus {
45
+ @mixin ck-focus-ring;
46
+ @mixin ck-box-shadow var(--ck-inner-shadow);
47
+ }
48
+ }
@@ -30,3 +30,7 @@ export const QMSCK_FLOWCHART_PLUGIN_RESP = 'QMSCK_FLOWCHART_PLUGIN_RESP';
30
30
  export const QMSCK_FLOWCHART = 'flowchart';
31
31
  /* Toolbar Toggle */
32
32
  export const QMSCK_TOGGLE_TOOLBAR_MSG = 'QMSCK_TOGGLE_TOOLBAR_MSG';
33
+ /* Browse Video */
34
+ export const QMSCK_BROWSE_VIDEO_MSG = 'QMSCK_BROWSE_VIDEO_MSG';
35
+ export const QMSCK_BROWSE_VIDEO_RESP = 'QMSCK_BROWSE_VIDEO_RESP';
36
+ export const QMSCK_BROWSE_VIDEO_IS_PROCESSING = 'QMSCK_BROWSE_VIDEO_IS_PROCESSING';
@@ -79,3 +79,24 @@ export function bpmnNotify(value) {
79
79
  '*'
80
80
  );
81
81
  }
82
+
83
+
84
+ export function uploadVideoNotify(value) {
85
+ window.postMessage(
86
+ {
87
+ eventName: constant.QMSCK_BROWSE_VIDEO_MSG,
88
+ value
89
+ },
90
+ '*'
91
+ );
92
+ }
93
+
94
+ export function aboutCKEditorNotify(value) {
95
+ window.postMessage(
96
+ {
97
+ eventName: constant.QMSCK_ABOUT_CKEDITOR_PLUGIN_MSG,
98
+ value
99
+ },
100
+ '*'
101
+ );
102
+ }
@@ -8,10 +8,6 @@ import * as constant from '../common/qmsCKEditorConstant';
8
8
  export default class QMSCKEditorFullscreenPlugin extends Plugin {
9
9
  init() {
10
10
  const editor = this.editor;
11
- editor.editing.view.change( writer => {
12
- // writer.setStyle( 'height', 'calc(100vh - 180px)', editor.editing.view.document.getRoot() );
13
- } );
14
-
15
11
  editor.ui.componentFactory.add('qmsFullscreen', locale => {
16
12
  const view = new ButtonView(locale);
17
13
 
@@ -21,7 +17,7 @@ export default class QMSCKEditorFullscreenPlugin extends Plugin {
21
17
  tooltip: true
22
18
  });
23
19
  const fullscreenClass = this.editor.config.get('fullScreenConfig.class') || 'qmsckeditor__fullscreen';
24
-
20
+
25
21
  view.on('execute', () => {
26
22
  const ck = window.document.getElementById('qmsckeditor');
27
23
  const isFullscreen = ck && ck.classList.contains(fullscreenClass);
@@ -90,3 +90,4 @@ export default class ImageMapCommand extends Command {
90
90
  },{ once: true });
91
91
  }
92
92
  }
93
+
@@ -219,7 +219,7 @@ export function drawMap(imageSrc, imageWidth, imageHeight, areas, callback){
219
219
  }, false);
220
220
  }
221
221
  catch(err){
222
-
222
+ console.log(err);
223
223
  }
224
224
  }
225
225
  }
@@ -11,8 +11,6 @@ import { Command } from '@ckeditor/ckeditor5-core';
11
11
  import { findAttributeRange } from '@ckeditor/ckeditor5-typing';
12
12
  import { Collection, first, toMap } from '@ckeditor/ckeditor5-utils';
13
13
  import * as QMSCKEditorConstant from '../common/qmsCKEditorConstant';
14
- import * as QMSCKEditorEnum from '../common/qmsCKEditorEnum';
15
- import * as QMSCKEditorService from '../common/qmsCKEditorService';
16
14
  import { isImageAllowed } from './utils';
17
15
  import AutomaticDecorators from './utils/automaticdecorators';
18
16
 
@@ -150,168 +148,143 @@ export default class LinkCommand extends Command {
150
148
  * @param {String} href Link destination.
151
149
  * @param {Object} [manualDecoratorIds={}] The information about manual decorator attributes to be applied or removed upon execution.
152
150
  */
153
- execute() {
154
-
151
+ execute(options) {
155
152
  const model = this.editor.model;
156
153
  const selection = model.document.selection;
157
- const ranges = selection.getFirstRange();
158
154
  const manualDecoratorIds = {};
159
155
  const linkDecorators = this.editor.config.get( 'link.decorators' );
160
156
  const selectedRange = 'link'+ linkDecorators.length;
157
+
158
+ const url = options.url;
159
+ const href = url.substring(2, url.length);
160
+ const title = options.title ? options.title : url;
161
161
 
162
- let link = QMSCKEditorEnum.hyperLink;
163
- link.typeId = 0;
164
- link.targetId = 0;
165
- link.protocolId = 0;
166
- link.url = '';
167
- link.title = '';
168
- link.editorContent = '';
169
- for (const item of ranges.getItems()) {
170
- if (item.data) {
171
- link.title = item.data;
172
- }
173
- }
174
- QMSCKEditorService.linkNotify(link);
175
- window[QMSCKEditorConstant.QMSCK_LINKED] = false;
176
- window.addEventListener(QMSCKEditorConstant.QMSCK_LINK_PLUGIN_RESP, function(evt) {
177
- if (window[QMSCKEditorConstant.QMSCK_LINKED]){
178
- return;
179
- }
180
- const response = evt.detail;
181
- const target = QMSCKEditorEnum.protocolEnum[response.protocolId];
182
- const url = response.url;
183
- const href = url.substring(2, url.length);
184
- const title = response.title ? response.title : url;
185
-
186
- for(let i= 0; i < linkDecorators.length-2; i++){
187
- manualDecoratorIds['link' + i] = (i === response.targetId)? true : false;
188
- }
189
- // Stores information about manual decorators to turn them on/off when command is applied.
190
- const truthyManualDecorators = [];
191
- const falsyManualDecorators = [];
192
-
193
- for ( const name in manualDecoratorIds ) {
194
- if ( manualDecoratorIds[ name ] ) {
195
- truthyManualDecorators.push( name );
196
- } else {
197
- falsyManualDecorators.push( name );
198
- }
199
- }
200
-
201
- model.change( writer => {
202
- // set link option value
203
- window[QMSCKEditorConstant.QMSCK_LINK_OPTION] = url.substring(0, 2);
204
- // If selection is collapsed then update selected link or insert new one at the place of caret.
205
- if ( selection.isCollapsed ) {
206
- const position = selection.getFirstPosition();
207
-
208
- // When selection is inside text with `linkHref` attribute.
209
- if ( selection.hasAttribute( 'linkHref' ) ) {
210
- // Then update `linkHref` value.
211
- const linkRange = findAttributeRange( position, 'linkHref', selection.getAttribute( 'linkHref' ), model );
212
- if (!selection.hasAttribute(selectedRange)) {
213
- writer.remove(linkRange);
214
- const newPosition = selection.getFirstPosition();
215
- const attributes = toMap( selection.getAttributes() );
216
- attributes.set( 'linkHref', href );
217
- truthyManualDecorators.forEach( item => {
218
- attributes.set( item, true );
219
- } );
220
- const { end: positionAfter } = model.insertContent( writer.createText( title, attributes ), newPosition );
221
- writer.setSelection( positionAfter );
222
- }
223
- else {
224
- writer.setAttribute( 'linkHref', href, linkRange );
225
- truthyManualDecorators.forEach( item => {
226
- writer.setAttribute( item, true, linkRange );
227
- } );
228
- falsyManualDecorators.forEach( item => {
229
- writer.removeAttribute( item, linkRange );
230
- } );
231
- // Put the selection at the end of the updated link.
232
- writer.setSelection( writer.createPositionAfter( linkRange.end.nodeBefore ) );
233
- }
234
- }
235
- // If not then insert text node with `linkHref` attribute in place of caret.
236
- // However, since selection is collapsed, attribute value will be used as data for text node.
237
- // So, if `href` is empty, do not create text node.
238
- else if ( href !== '' ) {
239
- const attributes = toMap( selection.getAttributes() );
240
-
241
- attributes.set( 'linkHref', href );
242
-
243
- truthyManualDecorators.forEach( item => {
244
- attributes.set( item, true );
245
- } );
246
-
247
- const { end: positionAfter } = model.insertContent( writer.createText( title, attributes ), position );
248
-
249
- // Put the selection at the end of the inserted link.
250
- // Using end of range returned from insertContent in case nodes with the same attributes got merged.
251
- writer.setSelection( positionAfter );
252
- }
253
-
254
- // Remove the `linkHref` attribute and all link decorators from the selection.
255
- // It stops adding a new content into the link element.
256
- [ 'linkHref', ...truthyManualDecorators, ...falsyManualDecorators ].forEach( item => {
257
- writer.removeSelectionAttribute( item );
258
- } );
259
- } else {
260
- // If selection has non-collapsed ranges, we change attribute on nodes inside those ranges
261
- // omitting nodes where the `linkHref` attribute is disallowed.
262
- const ranges = model.schema.getValidRanges( selection.getRanges(), 'linkHref' );
263
-
264
- // But for the first, check whether the `linkHref` attribute is allowed on selected blocks (e.g. the "image" element).
265
- const allowedRanges = [];
266
-
267
- for ( const element of selection.getSelectedBlocks() ) {
268
- if ( model.schema.checkAttribute( element, 'linkHref' ) ) {
269
- allowedRanges.push( writer.createRangeOn( element ) );
270
- }
271
- }
272
-
273
- // Ranges that accept the `linkHref` attribute. Since we will iterate over `allowedRanges`, let's clone it.
274
- const rangesToUpdate = allowedRanges.slice();
275
-
276
- // eslint-disable-next-line max-len
277
- // For all selection ranges we want to check whether given range is inside an element that accepts the `linkHref` attribute.
278
- // If so, we don't want to propagate applying the attribute to its children.
279
- // for ( const range of ranges ) {
280
- // if ( this._isRangeToUpdate( range, allowedRanges ) ) {
281
- // rangesToUpdate.push( range );
282
- // }
283
- // }
284
-
285
- for ( const range of ranges ) {
286
- const _isRangeToUpdate = true;
287
- for ( const allowedRange of allowedRanges ) {
288
- if ( allowedRange.containsRange( range ) ) {
289
- _isRangeToUpdate = false;
290
- break;
291
- }
292
- }
293
- if (_isRangeToUpdate) {
294
- rangesToUpdate.push( range );
295
- }
296
- }
297
-
298
- for ( const range of rangesToUpdate ) {
299
- writer.setAttribute('linkHref', href, range);
300
- writer.setAttribute(selectedRange, true, range);
301
-
302
- truthyManualDecorators.forEach( item => {
303
- writer.setAttribute( item, true, range );
304
- } );
305
-
306
- falsyManualDecorators.forEach( item => {
307
- writer.removeAttribute( item, range );
308
- } );
309
- }
310
- }
311
- } );
312
- window[QMSCKEditorConstant.QMSCK_LINKED] = true;
313
- },
314
- { once: true });
162
+ for(let i= 0; i < linkDecorators.length-2; i++){
163
+ manualDecoratorIds['link' + i] = (i === options.targetId)? true : false;
164
+ }
165
+ // Stores information about manual decorators to turn them on/off when command is applied.
166
+ const truthyManualDecorators = [];
167
+ const falsyManualDecorators = [];
168
+
169
+ for ( const name in manualDecoratorIds ) {
170
+ if ( manualDecoratorIds[ name ] ) {
171
+ truthyManualDecorators.push( name );
172
+ } else {
173
+ falsyManualDecorators.push( name );
174
+ }
175
+ }
176
+
177
+ model.change( writer => {
178
+ // set link option value
179
+ window[QMSCKEditorConstant.QMSCK_LINK_OPTION] = url.substring(0, 2);
180
+ // If selection is collapsed then update selected link or insert new one at the place of caret.
181
+ if ( selection.isCollapsed ) {
182
+ const position = selection.getFirstPosition();
183
+
184
+ // When selection is inside text with `linkHref` attribute.
185
+ if ( selection.hasAttribute( 'linkHref' ) ) {
186
+ // Then update `linkHref` value.
187
+ const linkRange = findAttributeRange( position, 'linkHref', selection.getAttribute( 'linkHref' ), model );
188
+ if (!selection.hasAttribute(selectedRange)) {
189
+ writer.remove(linkRange);
190
+ const newPosition = selection.getFirstPosition();
191
+ const attributes = toMap( selection.getAttributes() );
192
+ attributes.set( 'linkHref', href );
193
+ truthyManualDecorators.forEach( item => {
194
+ attributes.set( item, true );
195
+ } );
196
+ const { end: positionAfter } = model.insertContent( writer.createText( title, attributes ), newPosition );
197
+ writer.setSelection( positionAfter );
198
+ }
199
+ else {
200
+ writer.setAttribute( 'linkHref', href, linkRange );
201
+ truthyManualDecorators.forEach( item => {
202
+ writer.setAttribute( item, true, linkRange );
203
+ } );
204
+ falsyManualDecorators.forEach( item => {
205
+ writer.removeAttribute( item, linkRange );
206
+ } );
207
+ // Put the selection at the end of the updated link.
208
+ writer.setSelection( writer.createPositionAfter( linkRange.end.nodeBefore ) );
209
+ }
210
+ }
211
+ // If not then insert text node with `linkHref` attribute in place of caret.
212
+ // However, since selection is collapsed, attribute value will be used as data for text node.
213
+ // So, if `href` is empty, do not create text node.
214
+ else if ( href !== '' ) {
215
+ const attributes = toMap( selection.getAttributes() );
216
+
217
+ attributes.set( 'linkHref', href );
218
+
219
+ truthyManualDecorators.forEach( item => {
220
+ attributes.set( item, true );
221
+ } );
222
+
223
+ const { end: positionAfter } = model.insertContent( writer.createText( title, attributes ), position );
224
+
225
+ // Put the selection at the end of the inserted link.
226
+ // Using end of range returned from insertContent in case nodes with the same attributes got merged.
227
+ writer.setSelection( positionAfter );
228
+ }
229
+
230
+ // Remove the `linkHref` attribute and all link decorators from the selection.
231
+ // It stops adding a new content into the link element.
232
+ [ 'linkHref', ...truthyManualDecorators, ...falsyManualDecorators ].forEach( item => {
233
+ writer.removeSelectionAttribute( item );
234
+ } );
235
+ } else {
236
+ // If selection has non-collapsed ranges, we change attribute on nodes inside those ranges
237
+ // omitting nodes where the `linkHref` attribute is disallowed.
238
+ const ranges = model.schema.getValidRanges( selection.getRanges(), 'linkHref' );
239
+
240
+ // But for the first, check whether the `linkHref` attribute is allowed on selected blocks (e.g. the "image" element).
241
+ const allowedRanges = [];
242
+
243
+ for ( const element of selection.getSelectedBlocks() ) {
244
+ if ( model.schema.checkAttribute( element, 'linkHref' ) ) {
245
+ allowedRanges.push( writer.createRangeOn( element ) );
246
+ }
247
+ }
248
+
249
+ // Ranges that accept the `linkHref` attribute. Since we will iterate over `allowedRanges`, let's clone it.
250
+ const rangesToUpdate = allowedRanges.slice();
251
+
252
+ // eslint-disable-next-line max-len
253
+ // For all selection ranges we want to check whether given range is inside an element that accepts the `linkHref` attribute.
254
+ // If so, we don't want to propagate applying the attribute to its children.
255
+ // for ( const range of ranges ) {
256
+ // if ( this._isRangeToUpdate( range, allowedRanges ) ) {
257
+ // rangesToUpdate.push( range );
258
+ // }
259
+ // }
260
+
261
+ for ( const range of ranges ) {
262
+ const _isRangeToUpdate = true;
263
+ for ( const allowedRange of allowedRanges ) {
264
+ if ( allowedRange.containsRange( range ) ) {
265
+ _isRangeToUpdate = false;
266
+ break;
267
+ }
268
+ }
269
+ if (_isRangeToUpdate) {
270
+ rangesToUpdate.push( range );
271
+ }
272
+ }
273
+
274
+ for ( const range of rangesToUpdate ) {
275
+ writer.setAttribute('linkHref', href, range);
276
+ writer.setAttribute(selectedRange, true, range);
277
+
278
+ truthyManualDecorators.forEach( item => {
279
+ writer.setAttribute( item, true, range );
280
+ } );
281
+
282
+ falsyManualDecorators.forEach( item => {
283
+ writer.removeAttribute( item, range );
284
+ } );
285
+ }
286
+ }
287
+ } );
315
288
  }
316
289
 
317
290
  /**
@@ -336,22 +309,4 @@ export default class LinkCommand extends Command {
336
309
  return doc.selection.getAttribute( decoratorName );
337
310
  }
338
311
 
339
- /**
340
- * Checks whether specified `range` is inside an element that accepts the `linkHref` attribute.
341
- *
342
- * @private
343
- * @param {module:engine/view/range~Range} range A range to check.
344
- * @param {Array.<module:engine/view/range~Range>} allowedRanges An array of ranges created on elements where the attribute is accepted.
345
- * @returns {Boolean}
346
- */
347
- _isRangeToUpdate( range, allowedRanges ) {
348
- for ( const allowedRange of allowedRanges ) {
349
- // A range is inside an element that will have the `linkHref` attribute. Do not modify its nodes.
350
- if ( allowedRange.containsRange( range ) ) {
351
- return false;
352
- }
353
- }
354
-
355
- return true;
356
- }
357
312
  }