qms-angular 1.0.30 → 1.0.31

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 (118) hide show
  1. package/bundles/qms-angular.umd.js +902 -496
  2. package/bundles/qms-angular.umd.js.map +1 -1
  3. package/esm2015/lib/components/breadcrumb/breadcrumb.js +39 -41
  4. package/esm2015/lib/components/breadcrumb/enum/dropdown-node-width.enum.js +6 -0
  5. package/esm2015/lib/components/button/button-toggle.js +1 -1
  6. package/esm2015/lib/components/dialog/constant.js +4 -2
  7. package/esm2015/lib/components/dialog/dialog.js +4 -4
  8. package/esm2015/lib/components/related/common/data-type.enum.js +2 -2
  9. package/esm2015/lib/components/related/common/qms-icon.const.js +21 -1
  10. package/esm2015/lib/components/related/common/tree.function.js +10 -5
  11. package/esm2015/lib/components/related/list-other-related/list-related.component.js +6 -2
  12. package/esm2015/lib/components/related/model/popup-data.model.js +2 -1
  13. package/esm2015/lib/components/related/model/related-data.model.js +1 -1
  14. package/esm2015/lib/components/related/model/tree-config.model.js +1 -1
  15. package/esm2015/lib/components/related/model/tree-node.model.js +1 -1
  16. package/esm2015/lib/components/related/popup/related-popup.component.js +179 -12
  17. package/esm2015/lib/components/related/related.module.js +7 -5
  18. package/esm2015/lib/components/related/risk/analysis/analysis.component.js +1 -1
  19. package/esm2015/lib/components/related/service/related-global.service.js +5 -1
  20. package/esm2015/lib/components/related/tree/tree.component.js +30 -7
  21. package/esm2015/lib/components/table/table-action.js +2 -2
  22. package/esm2015/lib/directives/scrollbar/scrollbar.directive.js +8 -2
  23. package/esm2015/lib/model/en.js +7 -2
  24. package/esm2015/lib/model/no.js +7 -2
  25. package/esm2015/lib/qms-ckeditor-components/common/constants/ckeditorEvent.constant.js +3 -1
  26. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.js +1 -1
  27. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-input.model.js +2 -1
  28. package/esm2015/lib/qms-ckeditor-components/common/module/confirm/qms-ckeditor-confirm.component.js +1 -1
  29. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/attachments/link-attachment.component.js +1 -1
  30. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +1 -1
  31. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-load-template/qms-ckeditor-load-template.component.js +1 -1
  32. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-relation/qmsckeditor-related.component.js +1 -1
  33. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-template/qms-ckeditor-template.component.js +1 -1
  34. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.js +76 -0
  35. package/esm2015/lib/qms-ckeditor-components/models/qms-ckeditor-tooltip.model.js +7 -0
  36. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +51 -2
  37. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.module.js +4 -2
  38. package/esm2015/qms-angular.js +3 -1
  39. package/fesm2015/qms-angular.js +864 -476
  40. package/fesm2015/qms-angular.js.map +1 -1
  41. package/lib/components/breadcrumb/breadcrumb.d.ts +1 -0
  42. package/lib/components/breadcrumb/enum/dropdown-node-width.enum.d.ts +4 -0
  43. package/lib/components/related/common/data-type.enum.d.ts +1 -1
  44. package/lib/components/related/common/qms-icon.const.d.ts +4 -0
  45. package/lib/components/related/list-other-related/list-related.component.d.ts +1 -0
  46. package/lib/components/related/model/popup-data.model.d.ts +1 -0
  47. package/lib/components/related/model/related-data.model.d.ts +4 -0
  48. package/lib/components/related/model/tree-config.model.d.ts +1 -0
  49. package/lib/components/related/model/tree-node.model.d.ts +1 -0
  50. package/lib/components/related/popup/related-popup.component.d.ts +18 -0
  51. package/lib/components/related/service/related-global.service.d.ts +2 -0
  52. package/lib/components/related/tree/tree.component.d.ts +7 -1
  53. package/lib/directives/scrollbar/scrollbar.directive.d.ts +1 -0
  54. package/lib/model/en.d.ts +6 -1
  55. package/lib/model/no.d.ts +6 -1
  56. package/lib/qms-ckeditor-components/common/constants/ckeditorEvent.constant.d.ts +2 -0
  57. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.d.ts +1 -0
  58. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-input.model.d.ts +1 -0
  59. package/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.d.ts +36 -0
  60. package/lib/qms-ckeditor-components/models/qms-ckeditor-tooltip.model.d.ts +6 -0
  61. package/lib/qms-ckeditor-components/qms-ckeditor.component.d.ts +6 -0
  62. package/package.json +1 -1
  63. package/qms-angular.d.ts +2 -0
  64. package/qms-angular.metadata.json +1 -1
  65. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +2 -1
  66. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
  67. package/src/assets/qms-ckeditor-plugin/package-lock.json +852 -2063
  68. package/src/assets/qms-ckeditor-plugin/package.json +25 -19
  69. package/src/assets/qms-ckeditor-plugin/src/ckeditor.js +10 -2
  70. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findandreplace.js +132 -0
  71. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findandreplaceediting.js +315 -0
  72. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findandreplaceui.js +223 -0
  73. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findcommand.js +90 -0
  74. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findnextcommand.js +62 -0
  75. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findpreviouscommand.js +28 -0
  76. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/index.js +10 -0
  77. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/replaceallcommand.js +54 -0
  78. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/replacecommand.js +66 -0
  79. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/ui/checkboxview.js +212 -0
  80. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/ui/findandreplaceformview.js +546 -0
  81. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/utils.js +158 -0
  82. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/theme/findandreplace.css +13 -0
  83. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/theme/findandreplaceform.css +226 -0
  84. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/theme/icons/find-replace.svg +1 -0
  85. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharacters.js +4 -4
  86. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharactersarrows.js +1 -1
  87. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharacterscurrency.js +1 -1
  88. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharactersessentials.js +1 -1
  89. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharacterslatin.js +1 -1
  90. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharactersmathematical.js +1 -1
  91. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharacterstext.js +1 -1
  92. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/ui/charactergridview.js +1 -1
  93. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/ui/characterinfoview.js +1 -1
  94. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/ui/specialcharactersnavigationview.js +2 -2
  95. package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorConstant.js +4 -0
  96. package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorService.js +10 -0
  97. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/inserttooltipcommand.js +98 -0
  98. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/removetooltipcommand.js +41 -0
  99. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltip.js +14 -0
  100. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipediting.js +280 -0
  101. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipui.js +203 -0
  102. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/ui/actionsview.js +95 -0
  103. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/utils.js +70 -0
  104. package/src/assets/qms-ckeditor-plugin/src/themes/icons/information.svg +50 -0
  105. package/src/assets/qms-ckeditor-plugin/src/themes/tyles/tooltip.css +74 -0
  106. package/src/lib/components/breadcrumb/breadcrumb.scss +9 -0
  107. package/src/lib/components/button/button-toggle.scss +25 -1
  108. package/src/lib/components/dialog/dialog.scss +9 -0
  109. package/src/lib/components/related/popup/related-popup.component.scss +46 -0
  110. package/src/lib/components/table/table.scss +5 -27
  111. package/src/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.scss +11 -0
  112. package/src/lib/qms-ckeditor-components/qms-ckeditor.component.scss +29 -1
  113. package/src/lib/qms-ckeditor-components/styles/_modules.scss +6 -0
  114. package/src/themes/core/_form.scss +4 -0
  115. package/src/themes/core/_input.scss +8 -0
  116. package/src/themes/core/_scrollbar.scss +9 -2
  117. package/src/themes/core/_styles.scss +5 -0
  118. package/src/themes/core/_tab.scss +272 -6
@@ -0,0 +1,226 @@
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
+ /* stylelint-disable no-descending-specificity */
7
+
8
+ /* disabled buttons bg color: #C3C3C3 */
9
+ /* button color #4E8AE4 */
10
+
11
+ @import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";
12
+
13
+ .ck .ck-find-and-replace-form .ck-find-form__wrapper,
14
+ .ck .ck-find-and-replace-form .ck-replace-form__wrapper {
15
+ display: flex;
16
+ align-items: flex-start;
17
+ flex-direction: row;
18
+ flex-wrap: wrap;
19
+
20
+ & .ck-button {
21
+ margin-top: var(--ck-spacing-standard);
22
+ background-color: var(--ck-color-base-active);
23
+ padding: 5px 10px;
24
+ text-transform: uppercase;
25
+
26
+ &.ck-disabled {
27
+ background-color: var(--ck-color-switch-button-off-background);
28
+ }
29
+
30
+ &:not(.ck-disabled) {
31
+ color: var(--ck-color-base-background);
32
+
33
+ &:hover {
34
+ background-color: var(--ck-color-base-focus);
35
+ cursor: pointer;
36
+ }
37
+ }
38
+ }
39
+
40
+ & .ck-labeled-field-view__input-wrapper .ck.ck-input-text{
41
+ padding: var(--ck-spacing-extra-tiny) calc(var(--ck-spacing-medium) * 8) var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);
42
+ }
43
+
44
+ @mixin ck-media-phone {
45
+ flex-wrap: wrap;
46
+
47
+ & .ck-labeled-field-view {
48
+ flex-basis: 100%;
49
+ }
50
+
51
+ & .ck-button {
52
+ flex-basis: 50%;
53
+ }
54
+ }
55
+ }
56
+
57
+ .ck .ck-find-and-replace-form .ck-replace-form__wrapper {
58
+ justify-content: flex-end;
59
+ border-top: 1px solid var(--ck-color-base-border);
60
+
61
+ & .ck-labeled-field-view__input-wrapper .ck.ck-input-text{
62
+ padding: var(--ck-spacing-extra-tiny) var(--ck-spacing-medium) var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);
63
+ }
64
+
65
+ & .ck-button {
66
+ border-radius: 5px;
67
+ font-size: calc(var(--ck-font-size-normal) * 0.9);
68
+
69
+ &:last-child {
70
+ margin-left: var(--ck-spacing-standard)
71
+ }
72
+
73
+ & .ck.ck-button__label {
74
+ line-height: 20px;
75
+ }
76
+ }
77
+ }
78
+
79
+ .ck .ck-find-and-replace-form .ck-find-form__wrapper {
80
+ justify-content: space-between;
81
+
82
+ & .ck-button.ck-button-prev,
83
+ & .ck-button.ck-button-next {
84
+ margin-left: 1px;
85
+ }
86
+
87
+ & span.ck-results-counter {
88
+ position: absolute;
89
+ top: calc(var(--ck-spacing-standard) * 2);
90
+ right: calc(var(--ck-spacing-standard) * 3);
91
+ color: var(--ck-color-base-border)
92
+ }
93
+
94
+ & .ck-find-buttons {
95
+ display: flex;
96
+ align-items: center;
97
+
98
+ & .ck-button {
99
+ border-radius: 5px;
100
+ padding: 5px;
101
+
102
+ & svg.ck-button__icon {
103
+ margin: 0;
104
+ }
105
+
106
+ &.ck-button-find {
107
+ padding: 4px 16px;
108
+ }
109
+
110
+ &.ck-button-prev {
111
+ border-radius: 5px 0 0 5px;
112
+
113
+ & svg {
114
+ transform: rotate(180deg) translateY(-2px);
115
+ }
116
+ }
117
+
118
+ &.ck-button-next {
119
+ border-radius: 0 5px 5px 0;
120
+
121
+ & svg {
122
+ transform: translateY(-1px);
123
+ }
124
+ }
125
+ }
126
+ }
127
+
128
+ &.ck-is-searching {
129
+ & .ck-button.ck-button-find {
130
+ display: none;
131
+ }
132
+ }
133
+
134
+ &:not(.ck-is-searching) {
135
+ & .ck-button.ck-button-prev,
136
+ & .ck-button.ck-button-next {
137
+ display: none;
138
+ }
139
+
140
+ & .ck-button.ck-button-find {
141
+ display: flex;
142
+ }
143
+ }
144
+
145
+ &.ck-responsive-form .ck-find-checkboxes {
146
+ margin: 0;
147
+
148
+ & .ck-find-checkboxes__box {
149
+ display: flex;
150
+ align-items: center;
151
+ max-width: 150px;
152
+ overflow: hidden;
153
+
154
+ & label {
155
+ margin-left: 5px;
156
+ line-height: calc(var(--ck-spacing-standard) * 2.2);
157
+ overflow: hidden;
158
+ text-overflow: ellipsis;
159
+ }
160
+
161
+ & label:hover,
162
+ & input[type=checkbox]:hover
163
+ {
164
+ cursor: pointer;
165
+ }
166
+
167
+ &:first-child {
168
+ margin-top: var(--ck-spacing-medium);
169
+ }
170
+
171
+ & input[type=checkbox]:disabled+label {
172
+ color: var(--ck-color-switch-button-off-background);
173
+ }
174
+ }
175
+ }
176
+ }
177
+
178
+ .ck[dir='rtl'] {
179
+ & .ck .ck-find-and-replace-form .ck-find-form__wrapper .ck-labeled-field-view__input-wrapper .ck.ck-input-text {
180
+ padding: var(--ck-spacing-extra-tiny) var(--ck-spacing-medium) var(--ck-spacing-extra-tiny) calc(var(--ck-spacing-medium) * 8);
181
+ }
182
+
183
+ & .ck .ck-find-and-replace-form .ck-replace-form__wrapper {
184
+ & .ck-replace-buttons {
185
+ display: flex;
186
+ flex-flow: row-reverse;
187
+
188
+ & .ck-button:last-child {
189
+ margin-left: var(--ck-spacing-standard);
190
+ }
191
+ }
192
+ & .ck-labeled-field-view__input-wrapper .ck.ck-input-text{
193
+ padding: var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);
194
+ }
195
+ }
196
+
197
+ & .ck.ck-responsive-form > :not(:last-child) {
198
+ margin-left: 0;
199
+ }
200
+
201
+ & .ck .ck-find-and-replace-form .ck-find-form__wrapper {
202
+ & .ck-button.ck-button-prev,
203
+ & .ck-button.ck-button-next {
204
+ margin-right: 1px;
205
+ margin-left: 0;
206
+ }
207
+
208
+ & span.ck-results-counter {
209
+ left: calc(var(--ck-spacing-standard) * 3);
210
+ }
211
+
212
+ & .ck-find-buttons {
213
+ flex-flow: row-reverse;
214
+ }
215
+
216
+ &.ck-responsive-form .ck-find-checkboxes {
217
+ margin: 0;
218
+
219
+ & .ck-find-checkboxes__box label {
220
+ margin-right: 5px;
221
+ }
222
+ }
223
+ }
224
+ }
225
+
226
+ /* stylelint-enable no-descending-specificity */
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m12.87 13.786 1.532-1.286 3.857 4.596a1 1 0 1 1-1.532 1.286l-3.857-4.596z"/><path d="M16.004 8.5a6.5 6.5 0 0 1-9.216 5.905c-1.154-.53-.863-1.415-.663-1.615.194-.194.564-.592 1.635-.141a4.5 4.5 0 0 0 5.89-5.904l-.104-.227 1.332-1.331c.045-.046.196-.041.224.007a6.47 6.47 0 0 1 .902 3.306zm-3.4-5.715c.562.305.742 1.106.354 1.494-.388.388-.995.414-1.476.178a4.5 4.5 0 0 0-6.086 5.882l.114.236-1.348 1.349c-.038.037-.17.022-.198-.023a6.5 6.5 0 0 1 5.54-9.9 6.469 6.469 0 0 1 3.1.784z"/><path d="M4.001 11.93.948 8.877a.2.2 0 0 1 .141-.341h6.106a.2.2 0 0 1 .141.341L4.283 11.93a.2.2 0 0 1-.282 0zm11.083-6.789 3.053 3.053a.2.2 0 0 1-.14.342H11.89a.2.2 0 0 1-.14-.342l3.052-3.053a.2.2 0 0 1 .282 0z"/></svg>
@@ -7,10 +7,10 @@
7
7
  * @module special-characters/specialcharacters
8
8
  */
9
9
 
10
- import { Plugin } from 'ckeditor5/src/core';
11
- import { Typing } from 'ckeditor5/src/typing';
12
- import { createDropdown } from 'ckeditor5/src/ui';
13
- import { CKEditorError } from 'ckeditor5/src/utils';
10
+ import { Plugin } from '@ckeditor/ckeditor5-core';
11
+ import { Typing } from '@ckeditor/ckeditor5-typing';
12
+ import { createDropdown } from '@ckeditor/ckeditor5-ui';
13
+ import { CKEditorError } from '@ckeditor/ckeditor5-utils';
14
14
  import SpecialCharactersNavigationView from './ui/specialcharactersnavigationview';
15
15
  import CharacterGridView from './ui/charactergridview';
16
16
  import CharacterInfoView from './ui/characterinfoview';
@@ -7,7 +7,7 @@
7
7
  * @module special-characters/specialcharactersarrows
8
8
  */
9
9
 
10
- import { Plugin } from 'ckeditor5/src/core';
10
+ import { Plugin } from '@ckeditor/ckeditor5-core';
11
11
 
12
12
  /**
13
13
  * A plugin that provides special characters for the "Arrows" category.
@@ -7,7 +7,7 @@
7
7
  * @module special-characters/specialcharacterscurrency
8
8
  */
9
9
 
10
- import { Plugin } from 'ckeditor5/src/core';
10
+ import { Plugin } from '@ckeditor/ckeditor5-core';
11
11
 
12
12
  /**
13
13
  * A plugin that provides special characters for the "Currency" category.
@@ -7,7 +7,7 @@
7
7
  * @module special-characters/specialcharactersessentials
8
8
  */
9
9
 
10
- import { Plugin } from 'ckeditor5/src/core';
10
+ import { Plugin } from '@ckeditor/ckeditor5-core';
11
11
 
12
12
  import SpecialCharactersCurrency from './specialcharacterscurrency';
13
13
  import SpecialCharactersMathematical from './specialcharactersmathematical';
@@ -7,7 +7,7 @@
7
7
  * @module special-characters/specialcharacterslatin
8
8
  */
9
9
 
10
- import { Plugin } from 'ckeditor5/src/core';
10
+ import { Plugin } from '@ckeditor/ckeditor5-core';
11
11
 
12
12
  /**
13
13
  * A plugin that provides special characters for the "Latin" category.
@@ -7,7 +7,7 @@
7
7
  * @module special-characters/specialcharactersmathematical
8
8
  */
9
9
 
10
- import { Plugin } from 'ckeditor5/src/core';
10
+ import { Plugin } from '@ckeditor/ckeditor5-core';
11
11
 
12
12
  /**
13
13
  * A plugin that provides special characters for the "Mathematical" category.
@@ -7,7 +7,7 @@
7
7
  * @module special-characters/specialcharacterstext
8
8
  */
9
9
 
10
- import { Plugin } from 'ckeditor5/src/core';
10
+ import { Plugin } from '@ckeditor/ckeditor5-core';
11
11
 
12
12
  /**
13
13
  * A plugin that provides special characters for the "Text" category.
@@ -7,7 +7,7 @@
7
7
  * @module special-characters/ui/charactergridview
8
8
  */
9
9
 
10
- import { View, ButtonView } from 'ckeditor5/src/ui';
10
+ import { View, ButtonView } from '@ckeditor/ckeditor5-ui';
11
11
 
12
12
  import '../../theme/charactergrid.css';
13
13
 
@@ -7,7 +7,7 @@
7
7
  * @module special-characters/ui/characterinfoview
8
8
  */
9
9
 
10
- import { View } from 'ckeditor5/src/ui';
10
+ import { View } from '@ckeditor/ckeditor5-ui';
11
11
 
12
12
  import '../../theme/characterinfo.css';
13
13
 
@@ -7,8 +7,8 @@
7
7
  * @module special-characters/ui/specialcharactersnavigationview
8
8
  */
9
9
 
10
- import { Collection } from 'ckeditor5/src/utils';
11
- import { Model, FormHeaderView, createDropdown, addListToDropdown } from 'ckeditor5/src/ui';
10
+ import { Collection } from '@ckeditor/ckeditor5-utils';
11
+ import { Model, FormHeaderView, createDropdown, addListToDropdown } from '@ckeditor/ckeditor5-ui';
12
12
 
13
13
  /**
14
14
  * A class representing the navigation part of the special characters UI. It is responsible
@@ -9,3 +9,7 @@ export const QMSCK_LINKED = 'LINKED'
9
9
  export const QMSCK_LINK_PLUGIN_MSG = 'QMSCK_LINK_PLUGIN_MSG';
10
10
  export const QMSCK_LINK_PLUGIN_RESP = 'QMSCK_LINK_PLUGIN_RESP';
11
11
  export const QMSCK_LINK_OPTION = 'LINK_OPTION'
12
+ /* Tooltip */
13
+ export const QMSCK_TOOLTIP_PLUGIN_MSG = 'QMSCK_TOOLTIP_PLUGIN_MSG';
14
+ export const QMSCK_TOOLTIP_PLUGIN_RESP = 'QMSCK_TOOLTIP_PLUGIN_RESP';
15
+ export const QMSCK_TOOLTIP_IS_PROCESSING = 'QMSCK_TOOLTIP_IS_PROCESSING';
@@ -39,3 +39,13 @@ export function linkNotify(value){
39
39
  '*'
40
40
  );
41
41
  }
42
+
43
+ export function tooltipNotify(value) {
44
+ window.postMessage(
45
+ {
46
+ eventName: constant.QMSCK_TOOLTIP_PLUGIN_MSG,
47
+ value
48
+ },
49
+ '*'
50
+ );
51
+ }
@@ -0,0 +1,98 @@
1
+ import { Command } from '@ckeditor/ckeditor5-core';
2
+ import { findAttributeRange } from '@ckeditor/ckeditor5-typing';
3
+ import { first, toMap } from '@ckeditor/ckeditor5-utils';
4
+ import * as QMSCKEditorConstant from '../common/qmsCKEditorConstant';
5
+ import * as QMSCKEditorService from '../common/qmsCKEditorService';
6
+ import { isTooltipAllowed, TOOLTIP_ATTRIBUTE, findTooltipElementAncestor } from './utils';
7
+
8
+ export default class InsertTooltipCommand extends Command {
9
+ refresh() {
10
+ const model = this.editor.model;
11
+ const doc = model.document;
12
+ const selectedElement = first(doc.selection.getSelectedBlocks() );
13
+
14
+ // A check for the `LinkImage` plugin. If the selection contains an element, get values from the element.
15
+ // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
16
+ if (isTooltipAllowed(selectedElement, model.schema ) ) {
17
+ this.value = selectedElement.getAttribute(TOOLTIP_ATTRIBUTE);
18
+ this.isEnabled = model.schema.checkAttribute(selectedElement, TOOLTIP_ATTRIBUTE);
19
+ } else {
20
+ this.value = doc.selection.getAttribute(TOOLTIP_ATTRIBUTE);
21
+ this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, TOOLTIP_ATTRIBUTE);
22
+ }
23
+ }
24
+
25
+ execute() {
26
+ const model = this.editor.model;
27
+ const selection = model.document.selection;
28
+ let text= '';
29
+ let content = '';
30
+ if(selection.isCollapsed){
31
+ if(selection.hasAttribute(TOOLTIP_ATTRIBUTE)){
32
+ const view = this.editor.editing.view;
33
+ const viewSelection = view.document.selection;
34
+ const selectedElement = findTooltipElementAncestor(viewSelection.getFirstPosition());
35
+ if(selectedElement){
36
+ text = selectedElement.getChild(0).data;
37
+ content = selectedElement.getAttribute(TOOLTIP_ATTRIBUTE);
38
+ }
39
+ }
40
+ }
41
+ else
42
+ {
43
+ const ranges = selection.getFirstRange();
44
+ if(ranges)
45
+ {
46
+ for (const item of ranges.getItems()) {
47
+ if (item.data) {
48
+ text = text + item.data;
49
+ }
50
+ }
51
+ }
52
+ }
53
+
54
+ QMSCKEditorService.tooltipNotify({'text': text, 'content': content});
55
+ window[QMSCKEditorConstant.QMSCK_TOOLTIP_IS_PROCESSING] = false;
56
+ window.addEventListener(QMSCKEditorConstant.QMSCK_TOOLTIP_PLUGIN_RESP, function (evt) {
57
+ if (window[QMSCKEditorConstant.QMSCK_TOOLTIP_IS_PROCESSING]) {
58
+ return;
59
+ }
60
+ window[QMSCKEditorConstant.QMSCK_TOOLTIP_IS_PROCESSING] = true;
61
+ console.log(evt.detail);
62
+ model.change(writer => {
63
+ const position = selection.getFirstPosition();
64
+ const attributes = toMap(selection.getAttributes());
65
+ attributes.set(TOOLTIP_ATTRIBUTE, evt.detail.content);
66
+
67
+ if (selection.isCollapsed) {
68
+ // When selection is inside text with `data-tooltip` attribute.
69
+ if (selection.hasAttribute(TOOLTIP_ATTRIBUTE)) {
70
+ // Then update `data-tooltip` value.
71
+ const linkRange = findAttributeRange(position, TOOLTIP_ATTRIBUTE, selection.getAttribute(TOOLTIP_ATTRIBUTE), model);
72
+ writer.remove(linkRange);
73
+ const newPosition = selection.getFirstPosition();
74
+ const { end: positionAfter } = model.insertContent(writer.createText(evt.detail.text, attributes), newPosition);
75
+ writer.setSelection(positionAfter);
76
+ }
77
+ // If not then insert text node with `data-tooltip` attribute in place of caret.
78
+ // However, since selection is collapsed, attribute value will be used as data for text node.
79
+ // So, if `evt.detail.content` is empty, do not create text node.
80
+ else if (!!evt.detail.content && evt.detail.content !== '') {
81
+ const { end: positionAfter } = model.insertContent(writer.createText(evt.detail.text, attributes), position);
82
+ // Put the selection at the end of the inserted link.
83
+ // Using end of range returned from insertContent in case nodes with the same attributes got merged.
84
+ writer.setSelection(positionAfter);
85
+ }
86
+ } else {
87
+
88
+ const { end: positionAfter } = model.insertContent(writer.createText(evt.detail.text, attributes), selection);
89
+ // Put the selection at the end of the inserted link.
90
+ writer.setSelection(positionAfter);
91
+ }
92
+ // Remove the `data-tooltip` attribute from the selection.
93
+ // It stops adding a new content into the link element.
94
+ writer.removeSelectionAttribute(TOOLTIP_ATTRIBUTE);
95
+ });
96
+ });
97
+ }
98
+ }
@@ -0,0 +1,41 @@
1
+ import { Command } from 'ckeditor5/src/core';
2
+ import { findAttributeRange } from 'ckeditor5/src/typing';
3
+ import { first } from 'ckeditor5/src/utils';
4
+ import { isTooltipAllowed, TOOLTIP_ATTRIBUTE } from './utils';
5
+
6
+ export default class RemoveTooltipCommand extends Command {
7
+ refresh() {
8
+ const model = this.editor.model;
9
+ const doc = model.document;
10
+ const selectedElement = first(doc.selection.getSelectedBlocks());
11
+
12
+ // A check for the `LinkImage` plugin. If the selection contains an image element, get values from the element.
13
+ // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
14
+ if (isTooltipAllowed(selectedElement, model.schema)) {
15
+ this.isEnabled = model.schema.checkAttribute(selectedElement, TOOLTIP_ATTRIBUTE);
16
+ } else {
17
+ this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, TOOLTIP_ATTRIBUTE);
18
+ }
19
+ }
20
+
21
+ execute() {
22
+ const editor = this.editor;
23
+ const model = editor.model;
24
+ const selection = model.document.selection;
25
+
26
+ model.change(writer => {
27
+ const selectedRanges = selection.isCollapsed ?
28
+ [findAttributeRange(
29
+ selection.getFirstPosition(),
30
+ TOOLTIP_ATTRIBUTE,
31
+ selection.getAttribute(TOOLTIP_ATTRIBUTE),
32
+ model
33
+ )] :
34
+ model.schema.getValidRanges(selection.getRanges(), TOOLTIP_ATTRIBUTE);
35
+
36
+ for (const range of selectedRanges) {
37
+ writer.removeAttribute(TOOLTIP_ATTRIBUTE, range);
38
+ }
39
+ });
40
+ }
41
+ }
@@ -0,0 +1,14 @@
1
+
2
+ import { Plugin } from '@ckeditor/ckeditor5-core';
3
+ import TooltipEditing from './tooltipediting';
4
+ import TooltipUI from './tooltipui';
5
+
6
+ export default class Tooltip extends Plugin {
7
+ static get requires() {
8
+ return [TooltipEditing, TooltipUI];
9
+ }
10
+
11
+ static get pluginName() {
12
+ return 'Tooltip';
13
+ }
14
+ }