qms-angular 1.0.70 → 1.0.74

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 (250) hide show
  1. package/bundles/qms-angular.umd.js +2010 -606
  2. package/bundles/qms-angular.umd.js.map +1 -1
  3. package/esm2015/lib/components/button/button.js +2 -2
  4. package/esm2015/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.js +5 -3
  5. package/esm2015/lib/components/qms-navigation-drawer/qms-navigation-drawer.module.js +4 -4
  6. package/esm2015/lib/components/qms-paginator/index.js +2 -0
  7. package/esm2015/lib/components/qms-paginator/public_api.js +3 -0
  8. package/esm2015/lib/components/qms-paginator/qms-paginator.component.js +173 -0
  9. package/esm2015/lib/components/qms-paginator/qms-paginator.module.js +34 -0
  10. package/esm2015/lib/components/qms-status-dropdown/qms-status-dropdown.component.js +2 -2
  11. package/esm2015/lib/components/range-slider/directives/range-slider-lockup.directive.js +20 -0
  12. package/esm2015/lib/components/range-slider/directives/range-slider.directive.js +34 -0
  13. package/esm2015/lib/components/range-slider/index.js +2 -0
  14. package/esm2015/lib/components/range-slider/public-api.js +4 -0
  15. package/esm2015/lib/components/range-slider/range-slider.module.js +22 -0
  16. package/esm2015/lib/components/related/popup/related-popup.component.js +1 -1
  17. package/esm2015/lib/components/select-include-children/select-include-children.component.js +112 -45
  18. package/esm2015/lib/components/select-one/select-one.component.js +50 -3
  19. package/esm2015/lib/components/side-sheet/directives/drawer-content.directive.js +20 -0
  20. package/esm2015/lib/components/side-sheet/directives/drawer-header-action.directive.js +20 -0
  21. package/esm2015/lib/components/side-sheet/directives/drawer-header.directive.js +20 -0
  22. package/esm2015/lib/components/side-sheet/directives/drawer.directive.js +20 -0
  23. package/esm2015/lib/components/side-sheet/index.js +2 -0
  24. package/esm2015/lib/components/side-sheet/public-api.js +6 -0
  25. package/esm2015/lib/components/side-sheet/side-sheet.module.js +28 -0
  26. package/esm2015/lib/components/tree/tree.component.js +15 -19
  27. package/esm2015/lib/components/treeNew/tree.component.js +6 -3
  28. package/esm2015/lib/directives/table/table-row.directive.js +42 -0
  29. package/esm2015/lib/directives/table/table.directive.js +13 -60
  30. package/esm2015/lib/model/en.js +38 -3
  31. package/esm2015/lib/model/no.js +37 -2
  32. package/esm2015/lib/qms-angular.module.js +5 -24
  33. package/esm2015/lib/qms-ckeditor-components/common/bpmn/inspector.function.js +68 -16
  34. package/esm2015/lib/qms-ckeditor-components/common/classes/qmsUploadAdapter.js +89 -0
  35. package/esm2015/lib/qms-ckeditor-components/common/constants/ckeditorEvent.constant.js +7 -1
  36. package/esm2015/lib/qms-ckeditor-components/common/constants/ckeditorFlowchart.const.js +10 -1
  37. package/esm2015/lib/qms-ckeditor-components/common/constants/ckeditorLink.constant.js +7 -0
  38. package/esm2015/lib/qms-ckeditor-components/common/enums/document-type.enum.js +2 -1
  39. package/esm2015/lib/qms-ckeditor-components/common/enums/shape-flow-chart-connection-type.js +8 -0
  40. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.js +1 -1
  41. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-flowchart-template.model.js +9 -0
  42. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-flowchart.model.js +9 -0
  43. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-save-as-template.model.js +3 -0
  44. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-video-tree.model.js +4 -0
  45. package/esm2015/lib/qms-ckeditor-components/common/models/wproofreader-config.model.js +6 -0
  46. package/esm2015/lib/qms-ckeditor-components/common/module/confirm/qms-ckeditor-confirm.component.js +1 -1
  47. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-about/qms-ckeditor-about.component.js +38 -0
  48. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/qms-ckeditor-bpmn.component.js +564 -34
  49. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/save-template/save-template.component.js +46 -18
  50. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-fullscreen/qms-ckeditor-fullscreen.component.js +1 -46
  51. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.js +9 -8
  52. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/attachments/link-attachment.component.js +1 -1
  53. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +5 -2
  54. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-load-template/qms-ckeditor-load-template.component.js +1 -1
  55. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-relation/qmsckeditor-related.component.js +1 -1
  56. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-template/qms-ckeditor-template.component.js +1 -1
  57. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.js +4 -5
  58. package/esm2015/lib/qms-ckeditor-components/models/qms-ckeditor-bpmn-data.model.js +8 -0
  59. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +184 -28
  60. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.module.js +8 -2
  61. package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-bpmn.service.js +58 -20
  62. package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-flowchart.service.js +26 -0
  63. package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-tree.service.js +4 -1
  64. package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-upload.service.js +20 -0
  65. package/esm2015/public-api.js +10 -7
  66. package/esm2015/qms-angular.js +12 -8
  67. package/fesm2015/qms-angular.js +1900 -572
  68. package/fesm2015/qms-angular.js.map +1 -1
  69. package/lib/components/button/button.d.ts +1 -1
  70. package/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.d.ts +1 -0
  71. package/lib/components/qms-paginator/index.d.ts +1 -0
  72. package/lib/components/qms-paginator/public_api.d.ts +2 -0
  73. package/lib/components/qms-paginator/qms-paginator.component.d.ts +51 -0
  74. package/lib/components/qms-paginator/qms-paginator.module.d.ts +2 -0
  75. package/lib/{directives/range-slider → components/range-slider/directives}/range-slider-lockup.directive.d.ts +0 -0
  76. package/lib/{directives/range-slider → components/range-slider/directives}/range-slider.directive.d.ts +0 -0
  77. package/lib/components/range-slider/index.d.ts +1 -0
  78. package/lib/components/range-slider/public-api.d.ts +3 -0
  79. package/lib/components/range-slider/range-slider.module.d.ts +2 -0
  80. package/lib/components/select-include-children/select-include-children.component.d.ts +2 -1
  81. package/lib/components/select-one/select-one.component.d.ts +4 -0
  82. package/lib/{directives/side-sheet → components/side-sheet/directives}/drawer-content.directive.d.ts +0 -0
  83. package/lib/{directives/side-sheet → components/side-sheet/directives}/drawer-header-action.directive.d.ts +0 -0
  84. package/lib/{directives/side-sheet → components/side-sheet/directives}/drawer-header.directive.d.ts +0 -0
  85. package/lib/{directives/side-sheet → components/side-sheet/directives}/drawer.directive.d.ts +0 -0
  86. package/lib/components/side-sheet/index.d.ts +1 -0
  87. package/lib/components/side-sheet/public-api.d.ts +5 -0
  88. package/lib/components/side-sheet/side-sheet.module.d.ts +2 -0
  89. package/lib/directives/table/table-row.directive.d.ts +13 -0
  90. package/lib/directives/table/table.directive.d.ts +1 -11
  91. package/lib/model/en.d.ts +35 -0
  92. package/lib/model/no.d.ts +35 -0
  93. package/lib/qms-ckeditor-components/common/bpmn/inspector.function.d.ts +28 -0
  94. package/lib/qms-ckeditor-components/common/classes/qmsUploadAdapter.d.ts +18 -0
  95. package/lib/qms-ckeditor-components/common/constants/ckeditorEvent.constant.d.ts +6 -0
  96. package/lib/qms-ckeditor-components/common/constants/ckeditorFlowchart.const.d.ts +9 -0
  97. package/lib/qms-ckeditor-components/common/constants/ckeditorLink.constant.d.ts +6 -0
  98. package/lib/qms-ckeditor-components/common/enums/document-type.enum.d.ts +1 -0
  99. package/lib/qms-ckeditor-components/common/enums/shape-flow-chart-connection-type.d.ts +6 -0
  100. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.d.ts +5 -0
  101. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-flowchart-template.model.d.ts +7 -0
  102. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-flowchart.model.d.ts +7 -0
  103. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-save-as-template.model.d.ts +5 -0
  104. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-video-tree.model.d.ts +5 -0
  105. package/lib/qms-ckeditor-components/common/models/wproofreader-config.model.d.ts +25 -0
  106. package/lib/qms-ckeditor-components/components/qms-ckeditor-about/qms-ckeditor-about.component.d.ts +15 -0
  107. package/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/qms-ckeditor-bpmn.component.d.ts +88 -4
  108. package/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/save-template/save-template.component.d.ts +8 -2
  109. package/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.d.ts +2 -1
  110. package/lib/qms-ckeditor-components/models/qms-ckeditor-bpmn-data.model.d.ts +7 -0
  111. package/lib/qms-ckeditor-components/qms-ckeditor.component.d.ts +17 -5
  112. package/lib/qms-ckeditor-components/services/qms-ckeditor-bpmn.service.d.ts +1 -0
  113. package/lib/qms-ckeditor-components/services/qms-ckeditor-flowchart.service.d.ts +10 -0
  114. package/lib/qms-ckeditor-components/services/qms-ckeditor-tree.service.d.ts +2 -0
  115. package/lib/qms-ckeditor-components/services/qms-ckeditor-upload.service.d.ts +5 -0
  116. package/lib.theme.scss +1 -0
  117. package/package.json +1 -1
  118. package/public-api.d.ts +6 -6
  119. package/qms-angular.d.ts +11 -7
  120. package/qms-angular.metadata.json +1 -1
  121. package/src/assets/images/ckeditor5.svg +1 -0
  122. package/src/assets/jointjs/js/rappid.js +55919 -55836
  123. package/src/assets/jointjs/scss/bpmn.scss +2 -1
  124. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +1 -1
  125. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
  126. package/src/assets/qms-ckeditor-plugin/build/translations/az.js +1 -1
  127. package/src/assets/qms-ckeditor-plugin/build/translations/cs.js +1 -1
  128. package/src/assets/qms-ckeditor-plugin/build/translations/da.js +1 -1
  129. package/src/assets/qms-ckeditor-plugin/build/translations/de-ch.js +1 -1
  130. package/src/assets/qms-ckeditor-plugin/build/translations/de.js +1 -1
  131. package/src/assets/qms-ckeditor-plugin/build/translations/en-au.js +1 -1
  132. package/src/assets/qms-ckeditor-plugin/build/translations/es.js +1 -1
  133. package/src/assets/qms-ckeditor-plugin/build/translations/et.js +1 -1
  134. package/src/assets/qms-ckeditor-plugin/build/translations/fa.js +1 -1
  135. package/src/assets/qms-ckeditor-plugin/build/translations/fr.js +1 -1
  136. package/src/assets/qms-ckeditor-plugin/build/translations/gl.js +1 -1
  137. package/src/assets/qms-ckeditor-plugin/build/translations/he.js +1 -1
  138. package/src/assets/qms-ckeditor-plugin/build/translations/hi.js +1 -1
  139. package/src/assets/qms-ckeditor-plugin/build/translations/hr.js +1 -1
  140. package/src/assets/qms-ckeditor-plugin/build/translations/hu.js +1 -1
  141. package/src/assets/qms-ckeditor-plugin/build/translations/id.js +1 -1
  142. package/src/assets/qms-ckeditor-plugin/build/translations/it.js +1 -1
  143. package/src/assets/qms-ckeditor-plugin/build/translations/ja.js +1 -1
  144. package/src/assets/qms-ckeditor-plugin/build/translations/ko.js +1 -1
  145. package/src/assets/qms-ckeditor-plugin/build/translations/ku.js +1 -1
  146. package/src/assets/qms-ckeditor-plugin/build/translations/lv.js +1 -1
  147. package/src/assets/qms-ckeditor-plugin/build/translations/nl.js +1 -1
  148. package/src/assets/qms-ckeditor-plugin/build/translations/no.js +1 -1
  149. package/src/assets/qms-ckeditor-plugin/build/translations/pl.js +1 -1
  150. package/src/assets/qms-ckeditor-plugin/build/translations/pt-br.js +1 -1
  151. package/src/assets/qms-ckeditor-plugin/build/translations/ru.js +1 -1
  152. package/src/assets/qms-ckeditor-plugin/build/translations/sk.js +1 -1
  153. package/src/assets/qms-ckeditor-plugin/build/translations/sl.js +1 -1
  154. package/src/assets/qms-ckeditor-plugin/build/translations/sr-latn.js +1 -1
  155. package/src/assets/qms-ckeditor-plugin/build/translations/sr.js +1 -1
  156. package/src/assets/qms-ckeditor-plugin/build/translations/th.js +1 -1
  157. package/src/assets/qms-ckeditor-plugin/build/translations/tk.js +1 -1
  158. package/src/assets/qms-ckeditor-plugin/build/translations/tr.js +1 -1
  159. package/src/assets/qms-ckeditor-plugin/build/translations/uk.js +1 -1
  160. package/src/assets/qms-ckeditor-plugin/build/translations/vi.js +1 -1
  161. package/src/assets/qms-ckeditor-plugin/build/translations/zh-cn.js +1 -1
  162. package/src/assets/qms-ckeditor-plugin/build/translations/zh.js +1 -1
  163. package/src/assets/qms-ckeditor-plugin/package-lock.json +23 -0
  164. package/src/assets/qms-ckeditor-plugin/package.json +2 -0
  165. package/src/assets/qms-ckeditor-plugin/src/ckeditor.js +18 -4
  166. package/src/assets/qms-ckeditor-plugin/src/plugins/aboutckeditor/aboutckeditor.js +28 -0
  167. package/src/assets/qms-ckeditor-plugin/src/plugins/bpmn/bpmndialogcommand.js +74 -0
  168. package/src/assets/qms-ckeditor-plugin/src/plugins/bpmn/qmsCKEditorBpmnPlugin.js +6 -44
  169. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/contexts.json +3 -0
  170. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/de.po +21 -0
  171. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/en.po +21 -0
  172. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/gl.po +21 -0
  173. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/hu.po +21 -0
  174. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/it.po +21 -0
  175. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/ru.po +21 -0
  176. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/zh.po +21 -0
  177. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/src/index.js +10 -0
  178. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/src/sourceediting.js +386 -0
  179. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/src/utils/formathtml.js +142 -0
  180. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/theme/icons/source-editing.svg +1 -0
  181. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/theme/sourceediting.css +48 -0
  182. package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorConstant.js +11 -1
  183. package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorService.js +21 -0
  184. package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorUtil.js +29 -7
  185. package/src/assets/qms-ckeditor-plugin/src/plugins/fullscreen/qmsCKEditorFullscreenPlugin.js +22 -15
  186. package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/converters.js +93 -92
  187. package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/imagemap.js +4 -4
  188. package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/imagemapcommand.js +93 -0
  189. package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/imagemapdialogcommand.js +59 -0
  190. package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/imagemapediting.js +92 -87
  191. package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/imagemapui.js +13 -14
  192. package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/resizeimagemapcommand.js +25 -24
  193. package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/utils.js +40 -49
  194. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkcommand.js +131 -176
  195. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkdialogcommand.js +88 -0
  196. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkediting.js +2 -0
  197. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkui.js +41 -32
  198. package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/tableofcontents.js +14 -0
  199. package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/tableofcontentscommand.js +87 -0
  200. package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/tableofcontentsediting.js +59 -0
  201. package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/tableofcontentsui.js +35 -0
  202. package/src/assets/qms-ckeditor-plugin/src/plugins/tableofcontents/utils.js +62 -0
  203. package/src/assets/qms-ckeditor-plugin/src/plugins/template/loadtemplatedialogcommand.js +14 -0
  204. package/src/assets/qms-ckeditor-plugin/src/plugins/template/qmsCKEditorLoadTemplatePlugin.js +10 -12
  205. package/src/assets/qms-ckeditor-plugin/src/plugins/template/qmsCKEdtiorTemplatePlugin.js +10 -7
  206. package/src/assets/qms-ckeditor-plugin/src/plugins/template/templatedialogcommand.js +9 -0
  207. package/src/assets/qms-ckeditor-plugin/src/plugins/timestamp/timestamp.js +15 -18
  208. package/src/assets/qms-ckeditor-plugin/src/plugins/timestamp/timestampcommand.js +17 -0
  209. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/removetooltipcommand.js +42 -26
  210. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltip.js +3 -3
  211. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipcommand.js +75 -0
  212. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipdialogcommand.js +68 -0
  213. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipediting.js +206 -131
  214. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipui.js +424 -136
  215. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/ui/actionsview.js +67 -12
  216. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/utils.js +17 -55
  217. package/src/assets/qms-ckeditor-plugin/src/plugins/video/autovideo.js +1 -5
  218. package/src/assets/qms-ckeditor-plugin/src/plugins/video/video/videoediting.js +5 -2
  219. package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/browsevideodialogcommand.js +25 -0
  220. package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/uploadvideocommand.js +3 -16
  221. package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/videouploadediting.js +4 -0
  222. package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/videouploadui.js +12 -23
  223. package/src/assets/qms-ckeditor-plugin/src/themes/icons/fullscreen_exit.svg +1 -0
  224. package/src/assets/qms-ckeditor-plugin/src/themes/icons/information.svg +1 -50
  225. package/src/assets/qms-ckeditor-plugin/src/themes/icons/table-excel.svg +44 -0
  226. package/src/assets/qms-ckeditor-plugin/src/themes/icons/timestamp.svg +1 -1
  227. package/src/assets/qms-ckeditor-plugin/src/themes/icons/tooltip.svg +1 -0
  228. package/src/assets/qms-ckeditor-plugin/src/themes/styles/heading.css +54 -0
  229. package/src/assets/qms-ckeditor-plugin/src/themes/styles/tooltip.css +11 -53
  230. package/src/lib/components/button/button-icon.scss +5 -1
  231. package/src/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.scss +36 -22
  232. package/src/lib/components/qms-paginator/qms-paginator.component.scss +143 -0
  233. package/src/lib/qms-ckeditor-components/components/qms-ckeditor-about/qms-ckeditor-about.component.scss +16 -0
  234. package/src/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/qms-ckeditor-bpmn.component.scss +69 -17
  235. package/src/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.scss +26 -23
  236. package/src/lib/qms-ckeditor-components/qms-ckeditor.component.scss +24 -0
  237. package/src/lib/qms-ckeditor-components/styles/_modules.scss +9 -1
  238. package/src/themes/core/_range-slider.scss +61 -42
  239. package/src/themes/core/_side-sheet.scss +2 -2
  240. package/src/themes/core/_table.scss +158 -37
  241. package/esm2015/lib/directives/range-slider/range-slider-lockup.directive.js +0 -20
  242. package/esm2015/lib/directives/range-slider/range-slider.directive.js +0 -36
  243. package/esm2015/lib/directives/side-sheet/drawer-content.directive.js +0 -20
  244. package/esm2015/lib/directives/side-sheet/drawer-header-action.directive.js +0 -20
  245. package/esm2015/lib/directives/side-sheet/drawer-header.directive.js +0 -20
  246. package/esm2015/lib/directives/side-sheet/drawer.directive.js +0 -20
  247. package/esm2015/lib/qms-ckeditor-components/common/classes/uploadAdapter.js +0 -26
  248. package/lib/qms-ckeditor-components/common/classes/uploadAdapter.d.ts +0 -5
  249. package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/insertimagemapcommand.js +0 -128
  250. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/inserttooltipcommand.js +0 -88
@@ -1,13 +1,15 @@
1
1
  import { Plugin } from '@ckeditor/ckeditor5-core';
2
- import InsertImageMapCommand from './insertimagemapcommand';
3
- import ResizeImageMapCommand from './resizeimagemapcommand';
4
- import { ImageMapAttributes, ImageMapElements, debounced, trimStart, drawMap, ImageMapCommands, HtmlAttributes, HtmlElements, findMapNodes } from './utils';
2
+ import ImageMapCommand from './imagemapcommand';
3
+ import ResizeImageMapCommand from './resizeimagemapcommand';
4
+ import ImageMapDialogCommand from './imagemapdialogcommand';
5
+ import { IMAGEMAP_ATTRIBUTES, IMAGEMAP_ELEMENTS, drawMap, IMAGEMAP_COMMANDS, HTML_ATTRIBUTES, HTML_ELEMENTS, findMapNodes } from './utils';
5
6
  import ImageLoadObserver from '@ckeditor/ckeditor5-image/src/image/imageloadobserver';
6
- import { downcastImageWidthAttribute, downcastImageHeightAttribute, downcastImageSavedSrcAttribute, downcastImageMapAttribute,
7
- upcastImageSavedSrcAttribute, upcastMapElement, dowcastMapNameAttribute, dowcastMapWidthAttribute, dowcastMapHeightAttribute,
7
+ import { downcastImageWidthAttribute, downcastImageHeightAttribute, downcastImageSavedSrcAttribute, downcastImageMapAttribute,
8
+ upcastImageSavedSrcAttribute, upcastMapElement, dowcastMapNameAttribute, dowcastMapWidthAttribute, dowcastMapHeightAttribute,
8
9
  dowcastMapAreaAttribute, upcastImageMapAttribute, upcastImageHeightAttribute, upcastImageWidthAttribute, downcastMapElement
9
10
  } from './converters';
10
11
  import { isWidget } from '@ckeditor/ckeditor5-widget/src/utils';
12
+ import { trimStart, debounced } from '../common/qmsCKEditorUtil';
11
13
 
12
14
  export default class ImageMapEditing extends Plugin {
13
15
  static get requires() {
@@ -17,33 +19,33 @@ import { isWidget } from '@ckeditor/ckeditor5-widget/src/utils';
17
19
  static get pluginName() {
18
20
  return 'ImageMapEditing';
19
21
  }
20
-
22
+
21
23
  init() {
22
24
  const editor = this.editor;
23
25
  const model = editor.model;
24
26
  const schema = model.schema;
25
27
  const conversion = editor.conversion;
26
28
  const editingView = editor.editing.view;
27
-
29
+
28
30
  editingView.addObserver(ImageLoadObserver);
29
31
 
30
- schema.extend(ImageMapElements.IMAGE, {
31
- allowAttributes: [
32
- ImageMapAttributes.IMAGE_USE_MAP,
33
- ImageMapAttributes.IMAGE_WIDTH,
34
- ImageMapAttributes.IMAGE_HEIGHT,
35
- ImageMapAttributes.IMAGE_SAVED_SRC
36
- ]
32
+ schema.extend(IMAGEMAP_ELEMENTS.IMAGE, {
33
+ allowAttributes: [
34
+ IMAGEMAP_ATTRIBUTES.IMAGE_USE_MAP,
35
+ IMAGEMAP_ATTRIBUTES.IMAGE_WIDTH,
36
+ IMAGEMAP_ATTRIBUTES.IMAGE_HEIGHT,
37
+ IMAGEMAP_ATTRIBUTES.IMAGE_SAVED_SRC
38
+ ]
37
39
  });
38
40
 
39
- schema.register(ImageMapElements.MAP, {
41
+ schema.register(IMAGEMAP_ELEMENTS.MAP, {
40
42
  isObject: true,
41
43
  allowWhere: '$block',
42
- allowAttributes: [
43
- ImageMapAttributes.MAP_NAME,
44
- ImageMapAttributes.MAP_AREAS,
45
- ImageMapAttributes.MAP_WIDTH,
46
- ImageMapAttributes.MAP_HEIGHT
44
+ allowAttributes: [
45
+ IMAGEMAP_ATTRIBUTES.MAP_NAME,
46
+ IMAGEMAP_ATTRIBUTES.MAP_AREAS,
47
+ IMAGEMAP_ATTRIBUTES.MAP_WIDTH,
48
+ IMAGEMAP_ATTRIBUTES.MAP_HEIGHT
47
49
  ]
48
50
  });
49
51
 
@@ -51,48 +53,52 @@ import { isWidget } from '@ckeditor/ckeditor5-widget/src/utils';
51
53
  conversion.for('dataDowncast').add(downcastImageHeightAttribute());
52
54
  conversion.for('dataDowncast').add(downcastImageSavedSrcAttribute(true));
53
55
  conversion.for('editingDowncast').add(downcastImageSavedSrcAttribute(false));
54
-
56
+
55
57
  conversion.for('downcast').add(downcastImageMapAttribute());
56
58
  conversion.for('downcast').add(downcastMapElement());
57
-
59
+
58
60
  conversion.for('downcast')
59
61
  .add(dowcastMapNameAttribute())
60
62
  .add(dowcastMapWidthAttribute())
61
63
  .add(dowcastMapHeightAttribute())
62
64
  .add(dowcastMapAreaAttribute());
63
-
65
+
64
66
  conversion.for('upcast').add(upcastImageMapAttribute());
65
67
  conversion.for('upcast').add(upcastImageHeightAttribute());
66
68
  conversion.for('upcast').add(upcastImageWidthAttribute());
67
69
  conversion.for('upcast').add(upcastImageSavedSrcAttribute());
68
70
  conversion.for('upcast').add(upcastMapElement());
69
-
71
+
70
72
  editor.commands.get('resizeImage').on('execute', debounced(() => {
71
- editor.execute(ImageMapCommands.RESIZE);
73
+ editor.execute(IMAGEMAP_COMMANDS.RESIZE_IMAGEMAP);
72
74
  }, 100));
73
75
 
74
- // this.listenTo(editingView.document, 'delete', ( evt, data ) => {
75
- // this.allowDeleteMap = true;
76
- // }, { context: [isWidget] });
77
-
78
- // this.listenTo(model.document, 'change:data', (event) => {
79
- // if(this.allowDeleteMap == true){
80
- // this.allowDeleteMap == false;
81
- // OnImageDeleted(model, event);
82
- // }
83
- // });
84
-
76
+ this.listenTo(editingView.document, 'delete', ( evt, data ) => {
77
+ this.allowDeleteMap = true;
78
+ }, { context: [isWidget] });
79
+
85
80
  this.listenTo(editingView.document, 'imageLoaded', (evt, domEvent) => {
86
81
  onImageLoaded(domEvent);
87
82
  });
88
-
89
- editor.commands.add(ImageMapCommands.INSERT, new InsertImageMapCommand(editor));
90
- editor.commands.add(ImageMapCommands.RESIZE, new ResizeImageMapCommand(editor));
91
- }
92
- }
93
-
94
- function OnImageDeleted(model, event){
95
- const differ = event.source.differ;
83
+
84
+ model.document.on('change:data', (evt, batch) => {
85
+ if(this.allowDeleteMap == true){
86
+ this.allowDeleteMap = false;
87
+ OnImageDeleted(model, batch);
88
+ }
89
+ } );
90
+
91
+ editor.commands.add(IMAGEMAP_COMMANDS.IMAGEMAP_DIALOG, new ImageMapDialogCommand(editor));
92
+ editor.commands.add(IMAGEMAP_COMMANDS.IMAGEMAP, new ImageMapCommand(editor));
93
+ editor.commands.add(IMAGEMAP_COMMANDS.RESIZE_IMAGEMAP, new ResizeImageMapCommand(editor));
94
+ }
95
+ }
96
+
97
+ function OnImageDeleted(model, batch){
98
+ if( batch.type == 'transparent'){
99
+ return;
100
+ }
101
+ const differ = model.document.differ;
96
102
  // if no difference
97
103
  if (differ.isEmpty) { return; }
98
104
  const changes = differ.getChanges({ includeChangesInGraveyard: true });
@@ -103,24 +109,24 @@ function OnImageDeleted(model, event){
103
109
  for (let i = 0; i < changes.length; i++){
104
110
  const change = changes[i]
105
111
  // if image remove exists
106
- if (change && change.type === 'remove' && change.name === 'image') {
112
+ if (change && change.type === 'remove' && change.name === IMAGEMAP_ELEMENTS.IMAGE) {
107
113
  hasNoImageRemoved = false
108
114
  break
109
115
  }
110
116
  }
111
-
117
+
112
118
  // if not image remove stop execution
113
119
  if (hasNoImageRemoved) { return; }
114
120
  // get removed nodes
115
- const removedNodes = changes.filter(change => (change.type === 'insert' && change.name === 'image'))
116
-
121
+ const removedNodes = changes.filter(change => (change.type === 'insert' && change.name === IMAGEMAP_ELEMENTS.IMAGE))
122
+
117
123
  // removed image nodes
118
124
  const removedMapNames = []
119
125
  removedNodes.forEach(node => {
120
126
  let nodeAfter = node.position.nodeAfter;
121
- if(nodeAfter && nodeAfter.hasAttribute(ImageMapAttributes.IMAGE_USE_MAP)){
122
- let mapname = nodeAfter.getAttribute(ImageMapAttributes.IMAGE_USE_MAP) || '';
123
- removedMapNames.push(trimStart(mapname, '#'));
127
+ if(nodeAfter && nodeAfter.hasAttribute(IMAGEMAP_ATTRIBUTES.IMAGE_USE_MAP)){
128
+ let mapname = nodeAfter.getAttribute(IMAGEMAP_ATTRIBUTES.IMAGE_USE_MAP) || '';
129
+ removedMapNames.push(trimStart(mapname, '#'));
124
130
  }
125
131
  });
126
132
 
@@ -129,8 +135,7 @@ function OnImageDeleted(model, event){
129
135
  const existingMapElements = findMapNodes(removedMapNames, range);
130
136
 
131
137
  if(existingMapElements && existingMapElements.length > 0){
132
- const redoingBatch = model.createBatch( 'transparent' );
133
- model.enqueueChange(redoingBatch, writer => {
138
+ model.enqueueChange(batch, writer => {
134
139
  existingMapElements.forEach(element => {
135
140
  writer.remove(element);
136
141
  });
@@ -144,40 +149,40 @@ function onImageLoaded(domEvent){
144
149
  if (!domEvent.target.matches('figure.image.ck-widget > img, figure.image.ck-widget > a > img')) {
145
150
  return;
146
151
  }
147
- if(domEvent.target.hasAttribute(HtmlAttributes.USE_MAP)
148
- && domEvent.target.getAttribute(HtmlAttributes.USE_MAP)
149
- && !domEvent.target.hasAttribute(HtmlAttributes.SAVED_SRC)){
150
-
151
- const originalSrc = domEvent.target.getAttribute(HtmlAttributes.SRC);
152
- const mapName = trimStart(domEvent.target.getAttribute(HtmlAttributes.USE_MAP), '#');
153
- const selector = `${HtmlElements.MAP}[${HtmlAttributes.NAME}='${mapName}']`;
154
- const map = document.querySelector(selector);
155
- if(map && map.childNodes){
156
- const areas = [];
157
- map.childNodes.forEach((child) =>{
158
- if(child.nodeName && child.nodeName.toLowerCase() === HtmlElements.AREA){
159
- let area = {};
160
- area[HtmlAttributes.COORDS] = child.getAttribute(HtmlAttributes.COORDS);
161
- area[HtmlAttributes.SHAPE] = child.getAttribute(HtmlAttributes.SHAPE) || '';
162
- areas.push(area);
163
- }
164
- });
165
- if(areas.length > 0){
166
- const width = map.getAttribute(HtmlAttributes.WIDTH) || domEvent.target.width;
167
- const height = map.getAttribute(HtmlAttributes.HEIGHT) || domEvent.target.height;
168
- const target = domEvent.target;
169
- drawMap(originalSrc, width, height, areas, (oldsrc, newsrc) => {
170
- if(target){
171
- target.setAttribute(HtmlAttributes.SRC, newsrc);
172
- target.setAttribute(HtmlAttributes.SAVED_SRC, oldsrc);
173
- }
174
-
175
- if(map){
176
- map.setAttribute(HtmlAttributes.WIDTH, width);
177
- map.setAttribute(HtmlAttributes.HEIGHT, height);
178
- }
179
- })
152
+ if(domEvent.target.hasAttribute(HTML_ATTRIBUTES.USE_MAP)
153
+ && domEvent.target.getAttribute(HTML_ATTRIBUTES.USE_MAP)
154
+ && !domEvent.target.hasAttribute(HTML_ATTRIBUTES.SAVED_SRC)){
155
+
156
+ const originalSrc = domEvent.target.getAttribute(HTML_ATTRIBUTES.SRC);
157
+ const mapName = trimStart(domEvent.target.getAttribute(HTML_ATTRIBUTES.USE_MAP), '#');
158
+ const selector = `${HTML_ELEMENTS.MAP}[${HTML_ATTRIBUTES.NAME}='${mapName}']`;
159
+ const map = document.querySelector(selector);
160
+ if(map && map.childNodes){
161
+ const areas = [];
162
+ map.childNodes.forEach((child) =>{
163
+ if(child.nodeName && child.nodeName.toLowerCase() === HTML_ELEMENTS.AREA){
164
+ let area = {};
165
+ area[HTML_ATTRIBUTES.COORDS] = child.getAttribute(HTML_ATTRIBUTES.COORDS);
166
+ area[HTML_ATTRIBUTES.SHAPE] = child.getAttribute(HTML_ATTRIBUTES.SHAPE) || '';
167
+ areas.push(area);
180
168
  }
169
+ });
170
+ if(areas.length > 0){
171
+ const width = map.getAttribute(HTML_ATTRIBUTES.WIDTH) || domEvent.target.width;
172
+ const height = map.getAttribute(HTML_ATTRIBUTES.HEIGHT) || domEvent.target.height;
173
+ const target = domEvent.target;
174
+ drawMap(originalSrc, width, height, areas, (oldsrc, newsrc) => {
175
+ if(target){
176
+ target.setAttribute(HTML_ATTRIBUTES.SRC, newsrc);
177
+ target.setAttribute(HTML_ATTRIBUTES.SAVED_SRC, oldsrc);
178
+ }
179
+
180
+ if(map){
181
+ map.setAttribute(HTML_ATTRIBUTES.WIDTH, width);
182
+ map.setAttribute(HTML_ATTRIBUTES.HEIGHT, height);
183
+ }
184
+ })
181
185
  }
186
+ }
182
187
  }
183
- }
188
+ }
@@ -1,49 +1,48 @@
1
1
  import { Plugin } from '@ckeditor/ckeditor5-core';
2
2
  import { ButtonView, ContextualBalloon } from '@ckeditor/ckeditor5-ui';
3
3
  import imageMapIcon from '../../themes/icons/imagemap.svg';
4
- import { ImageMapCommands } from './utils';
4
+ import { IMAGEMAP_COMMANDS } from './utils';
5
5
 
6
6
  export default class ImageMapUI extends Plugin {
7
-
7
+
8
8
  static get requires() {
9
9
  return [ ContextualBalloon];
10
10
  }
11
-
11
+
12
12
  static get pluginName() {
13
13
  return 'ImageMapUI';
14
14
  }
15
-
15
+
16
16
  init() {
17
17
  this._createButton();
18
18
 
19
19
  }
20
-
20
+
21
21
  destroy() {
22
22
  super.destroy();
23
23
  }
24
-
24
+
25
25
  _createButton() {
26
26
  const editor = this.editor;
27
27
  const t = editor.t;
28
-
28
+
29
29
  editor.ui.componentFactory.add('imageMap', locale => {
30
- const command = editor.commands.get(ImageMapCommands.INSERT);
30
+ const command = editor.commands.get(IMAGEMAP_COMMANDS.IMAGEMAP_DIALOG);
31
31
  const view = new ButtonView(locale);
32
-
32
+
33
33
  view.set({
34
34
  label: t('Image Map'),
35
35
  icon: imageMapIcon,
36
36
  tooltip: true
37
37
  });
38
-
38
+
39
39
  view.bind('isEnabled').to(command, 'isEnabled');
40
-
40
+
41
41
  this.listenTo(view, 'execute', () => {
42
- editor.execute(ImageMapCommands.INSERT, {});
42
+ editor.execute(IMAGEMAP_COMMANDS.IMAGEMAP_DIALOG);
43
43
  });
44
-
44
+
45
45
  return view;
46
46
  });
47
47
  }
48
48
  }
49
-
@@ -1,22 +1,23 @@
1
1
 
2
2
  import { Command } from '@ckeditor/ckeditor5-core';
3
3
  import { isImage } from '@ckeditor/ckeditor5-image/src/image/utils';
4
- import { ImageMapAttributes, trimStart, parsePixelToFloat, findFirstMapNode, drawMap, resizeAreaWidth, resizeAreaHeight } from './utils';
4
+ import { IMAGEMAP_ATTRIBUTES, parsePixelToFloat, findFirstMapNode, drawMap, resizeAreaWidth, resizeAreaHeight, createResizedEvent } from './utils';
5
5
  import { getSelectedImageWidget} from '@ckeditor/ckeditor5-image/src/image/utils';
6
+ import { trimStart } from '../common/qmsCKEditorUtil';
6
7
 
7
8
  export default class ResizeImageMapCommand extends Command {
8
-
9
+
9
10
  refresh() {
10
11
  const element = this.editor.model.document.selection.getSelectedElement();
11
- this.isEnabled = isImage(element) && element.hasAttribute(ImageMapAttributes.IMAGE_USE_MAP);
12
+ this.isEnabled = isImage(element) && element.hasAttribute(IMAGEMAP_ATTRIBUTES.IMAGE_USE_MAP);
12
13
  }
13
-
14
- execute() {
14
+
15
+ execute( options = {}) {
15
16
  const editor = this.editor;
16
17
  const model = editor.model;
17
18
  const view = this.editor.editing.view;
18
19
  const imageElement = model.document.selection.getSelectedElement();
19
- const mapName = imageElement.getAttribute(ImageMapAttributes.IMAGE_USE_MAP);
20
+ const mapName = imageElement.getAttribute(IMAGEMAP_ATTRIBUTES.IMAGE_USE_MAP);
20
21
  if(mapName){
21
22
  const imageWidget = getSelectedImageWidget( view.document.selection);
22
23
  const widgetResizePlugin = editor.plugins.get('WidgetResize');
@@ -25,14 +26,14 @@ export default class ResizeImageMapCommand extends Command {
25
26
  const resizerWrapper = resizer._viewResizerWrapper;
26
27
  const newWidth = parsePixelToFloat(resizerWrapper.getStyle('width', 0));
27
28
  const newHeight = parsePixelToFloat(resizerWrapper.getStyle('height', 0));
28
-
29
+
29
30
  const range = model.createRangeIn(model.document.getRoot());
30
31
  const existingMapElement = findFirstMapNode(trimStart(mapName, '#'), range);
31
32
  if(existingMapElement){
32
- const areas = JSON.parse(existingMapElement.getAttribute(ImageMapAttributes.MAP_AREAS) || []);
33
- const width = parsePixelToFloat(existingMapElement.getAttribute(ImageMapAttributes.MAP_WIDTH, 0));
34
- const height = parsePixelToFloat(existingMapElement.getAttribute(ImageMapAttributes.MAP_HEIGHT, 0));
35
-
33
+ const areas = JSON.parse(existingMapElement.getAttribute(IMAGEMAP_ATTRIBUTES.MAP_AREAS) || []);
34
+ const width = parsePixelToFloat(existingMapElement.getAttribute(IMAGEMAP_ATTRIBUTES.MAP_WIDTH, 0));
35
+ const height = parsePixelToFloat(existingMapElement.getAttribute(IMAGEMAP_ATTRIBUTES.MAP_HEIGHT, 0));
36
+
36
37
  const widthChanged = newWidth != width && width != 0 ;
37
38
  const heightChanged = newHeight != height && height != 0 ;
38
39
 
@@ -53,23 +54,24 @@ export default class ResizeImageMapCommand extends Command {
53
54
 
54
55
  const areasAsString = JSON.stringify(areas);
55
56
  model.change(writer => {
56
- let originalImageSrc = imageElement.getAttribute(ImageMapAttributes.IMAGE_SRC);
57
- if(!imageElement.hasAttribute(ImageMapAttributes.IMAGE_SAVED_SRC) || !imageElement.getAttribute(ImageMapAttributes.IMAGE_SAVED_SRC)){
58
- writer.setAttribute(ImageMapAttributes.IMAGE_SAVED_SRC, originalImageSrc, imageElement);
57
+ let originalImageSrc = imageElement.getAttribute(IMAGEMAP_ATTRIBUTES.IMAGE_SRC);
58
+ if(!imageElement.hasAttribute(IMAGEMAP_ATTRIBUTES.IMAGE_SAVED_SRC) || !imageElement.getAttribute(IMAGEMAP_ATTRIBUTES.IMAGE_SAVED_SRC)){
59
+ writer.setAttribute(IMAGEMAP_ATTRIBUTES.IMAGE_SAVED_SRC, originalImageSrc, imageElement);
59
60
  }
60
61
  else{
61
- originalImageSrc = imageElement.getAttribute(ImageMapAttributes.IMAGE_SAVED_SRC);
62
+ originalImageSrc = imageElement.getAttribute(IMAGEMAP_ATTRIBUTES.IMAGE_SAVED_SRC);
62
63
  }
63
64
 
64
- writer.setAttribute(ImageMapAttributes.MAP_AREAS, areasAsString, existingMapElement);
65
- writer.setAttribute(ImageMapAttributes.MAP_WIDTH, newWidth, existingMapElement);
66
- writer.setAttribute(ImageMapAttributes.MAP_HEIGHT, newHeight, existingMapElement);
67
- writer.setAttribute(ImageMapAttributes.IMAGE_WIDTH, newWidth, imageElement);
68
- writer.setAttribute(ImageMapAttributes.IMAGE_HEIGHT, newHeight, imageElement);
65
+ writer.setAttribute(IMAGEMAP_ATTRIBUTES.MAP_AREAS, areasAsString, existingMapElement);
66
+ writer.setAttribute(IMAGEMAP_ATTRIBUTES.MAP_WIDTH, newWidth, existingMapElement);
67
+ writer.setAttribute(IMAGEMAP_ATTRIBUTES.MAP_HEIGHT, newHeight, existingMapElement);
68
+ writer.setAttribute(IMAGEMAP_ATTRIBUTES.IMAGE_WIDTH, newWidth, imageElement);
69
+ writer.setAttribute(IMAGEMAP_ATTRIBUTES.IMAGE_HEIGHT, newHeight, imageElement);
69
70
 
70
71
  drawMap(originalImageSrc, newWidth, newHeight, areas, (oldsrc, newsrc) =>{
71
- model.enqueueChange(writer => {
72
- writer.setAttribute(ImageMapAttributes.IMAGE_SRC, newsrc, imageElement);
72
+ model.enqueueChange(writer.batch, writer => {
73
+ writer.setAttribute(IMAGEMAP_ATTRIBUTES.IMAGE_SRC, newsrc, imageElement);
74
+ this.fire(createResizedEvent(mapName));
73
75
  });
74
76
  });
75
77
  });
@@ -77,6 +79,5 @@ export default class ResizeImageMapCommand extends Command {
77
79
  }
78
80
  }
79
81
  }
80
- }
82
+ }
81
83
  }
82
-
@@ -1,4 +1,6 @@
1
- export const HtmlAttributes = {
1
+ import { trimStart } from '../common/qmsCKEditorUtil';
2
+
3
+ export const HTML_ATTRIBUTES = {
2
4
  COORDS: 'coords',
3
5
  HREF: 'href',
4
6
  SHAPE: 'shape',
@@ -6,7 +8,7 @@ export const HtmlAttributes = {
6
8
  TARGET: 'target',
7
9
  USE_MAP: 'usemap',
8
10
  ALT: 'alt',
9
- WIDTH: 'width',
11
+ WIDTH: 'width',
10
12
  HEIGHT: 'height',
11
13
  SRC: 'src',
12
14
  ID: 'id',
@@ -14,44 +16,48 @@ export const HtmlAttributes = {
14
16
  }
15
17
 
16
18
 
17
- export const HtmlElements = {
19
+ export const HTML_ELEMENTS = {
18
20
  MAP: 'map',
19
21
  IMAGE: 'img',
20
22
  AREA: 'area'
21
23
  }
22
24
 
23
25
 
24
- export const ImageMapAttributes = {
26
+ export const IMAGEMAP_ATTRIBUTES = {
25
27
  MAP_AREAS: 'mapareas',
26
28
  MAP_NAME: 'mapname' ,
27
- MAP_WIDTH: 'mapwidth',
29
+ MAP_WIDTH: 'mapwidth',
28
30
  MAP_HEIGHT: 'mapheight',
29
31
  IMAGE_USE_MAP: 'imageusemap',
30
32
  IMAGE_SAVED_SRC: 'imagesavedsrc',
31
33
  IMAGE_SRC: 'src',//It is already defined by the image plugin
32
- IMAGE_WIDTH: 'imagewidth',
34
+ IMAGE_WIDTH: 'imagewidth',
33
35
  IMAGE_HEIGHT: 'imageheight',
34
36
  }
35
37
 
36
- export const ImageMapCommands = {
37
- INSERT: 'insertImageMap',
38
- RESIZE: 'resizeImageMap'
38
+ export const IMAGEMAP_COMMANDS = {
39
+ IMAGEMAP_DIALOG: 'imagemapdialog',
40
+ IMAGEMAP: 'imagemap',
41
+ RESIZE_IMAGEMAP: 'resizeimagemap'
39
42
  }
40
43
 
41
- export const ImageMapElements = {
42
- MAP: 'npmap',
44
+ export const IMAGEMAP_ELEMENTS = {
45
+ MAP: 'qmsmap',
43
46
  IMAGE: 'image'//It is already defined by the image plugin
44
47
  }
45
48
 
46
- export function trimStart(text, charToRemove){
47
- if(text && text.length > 0){
48
- if(text.charAt(0) == charToRemove){
49
- return text.substring(1);
50
- }
51
- }
52
- return text;
49
+ export function createInsertedEvent(mapname){
50
+ return trimStart(mapname, '#') + '_inserted';
51
+ }
52
+
53
+ export function createRemovedEvent(mapname){
54
+ return trimStart(mapname, '#') + '_removed';
53
55
  }
54
-
56
+
57
+ export function createResizedEvent(mapname){
58
+ return trimStart(mapname, '#') + '_resized';
59
+ }
60
+
55
61
  export function parsePixelToFloat(pixel, fractionDigits){
56
62
  if(pixel){
57
63
  pixel = pixel.toString().replaceAll('px', '');
@@ -67,13 +73,13 @@ export function parsePixelToFloat(pixel, fractionDigits){
67
73
  }
68
74
 
69
75
  function isMapNode(lowerCaseNameObject, node){
70
- return node.is('element', ImageMapElements.MAP)
71
- && node.hasAttribute(ImageMapAttributes.MAP_NAME)
72
- && lowerCaseNameObject[getLowerCaseMapName(node)];
76
+ return node.is('element', IMAGEMAP_ELEMENTS.MAP)
77
+ && node.hasAttribute(IMAGEMAP_ATTRIBUTES.MAP_NAME)
78
+ && lowerCaseNameObject[getLowerCaseMapName(node)];
73
79
  }
74
80
 
75
81
  function getLowerCaseMapName(node){
76
- return node.getAttribute(ImageMapAttributes.MAP_NAME).toLowerCase();
82
+ return node.getAttribute(IMAGEMAP_ATTRIBUTES.MAP_NAME).toLowerCase();
77
83
  }
78
84
 
79
85
  export function findMapNodes(names, range) {
@@ -95,7 +101,7 @@ export function findMapNodes(names, range) {
95
101
  }
96
102
  return Object.keys(nodes).map(key => nodes[key]);
97
103
  };
98
-
104
+
99
105
 
100
106
  export function findFirstMapNode(name, range) {
101
107
  if(!name) { return null; }
@@ -112,8 +118,6 @@ export function findFirstMapNode(name, range) {
112
118
  }
113
119
  return null;
114
120
  };
115
-
116
-
117
121
 
118
122
  export function resizeAreaWidth(area, ratio) {
119
123
  var coords = area.coords.split(',');
@@ -156,22 +160,9 @@ export function resizeAreaHeight(area, ratio, widthChanged) {
156
160
  return area;
157
161
  }
158
162
  };
159
-
160
- export function debounced(fn, delay) {
161
- let timerId;
162
- return function (...args) {
163
- if (timerId) {
164
- clearTimeout(timerId);
165
- }
166
- timerId = setTimeout(() => {
167
- fn(...args);
168
- timerId = null;
169
- }, delay);
170
- }
171
- }
172
163
 
173
164
  export function drawMap(imageSrc, imageWidth, imageHeight, areas, callback){
174
- if(areas && areas.length > 0){
165
+ if(areas && areas.length > 0){
175
166
  try
176
167
  {
177
168
  var tempImage = new Image(imageWidth, imageHeight);
@@ -179,13 +170,13 @@ export function drawMap(imageSrc, imageWidth, imageHeight, areas, callback){
179
170
  tempImage.addEventListener("load", () =>{
180
171
  var canvas = document.createElement('canvas');
181
172
  var context = canvas.getContext('2d');
182
-
173
+
183
174
  canvas.width = imageWidth;
184
175
  canvas.height = imageHeight;
185
176
  context.drawImage(tempImage, 0, 0, imageWidth, imageHeight);
186
177
  context.strokeStyle = "#FF0000";
187
178
  context.lineWidth = 1;
188
-
179
+
189
180
  for (var i = 0; i < areas.length; i++) {
190
181
  const area = areas[i];
191
182
  const coords = area.coords.split(',');
@@ -196,7 +187,7 @@ export function drawMap(imageSrc, imageWidth, imageHeight, areas, callback){
196
187
  context.closePath();
197
188
  context.stroke();
198
189
  break;
199
-
190
+
200
191
  case 'poly':
201
192
  context.beginPath();
202
193
  context.moveTo(coords[0], coords[1]);
@@ -206,7 +197,7 @@ export function drawMap(imageSrc, imageWidth, imageHeight, areas, callback){
206
197
  context.closePath();
207
198
  context.stroke();
208
199
  break;
209
-
200
+
210
201
  default:
211
202
  context.strokeRect(coords[0], coords[1], coords[2] - coords[0], coords[3] - coords[1]);
212
203
  break;
@@ -219,16 +210,16 @@ export function drawMap(imageSrc, imageWidth, imageHeight, areas, callback){
219
210
  newSrc = canvas.toDataURL();
220
211
  }
221
212
  catch(err){
222
-
213
+
223
214
  }
224
215
  if(callback){
225
216
  callback(oldSrc, newSrc);
226
217
  }
227
-
218
+
228
219
  }, false);
229
220
  }
230
221
  catch(err){
231
-
232
- }
222
+ console.log(err);
223
+ }
233
224
  }
234
- }
225
+ }