qms-angular 1.0.27 → 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 (139) hide show
  1. package/bundles/qms-angular.umd.js +888 -240
  2. package/bundles/qms-angular.umd.js.map +1 -1
  3. package/esm2015/lib/common/qms-icon.const.js +6 -0
  4. package/esm2015/lib/components/breadcrumb/breadcrumb-direction-icon.directive.js +20 -0
  5. package/esm2015/lib/components/breadcrumb/breadcrumb-item.directive.js +40 -0
  6. package/esm2015/lib/components/breadcrumb/breadcrumb.js +129 -0
  7. package/esm2015/lib/components/breadcrumb/breadcrumb.module.js +38 -0
  8. package/esm2015/lib/components/breadcrumb/enum/dropdown-node-width.enum.js +6 -0
  9. package/esm2015/lib/components/breadcrumb/model/breadcrumb-node.model.js +3 -0
  10. package/esm2015/lib/components/button/button-toggle.js +1 -1
  11. package/esm2015/lib/components/dialog/constant.js +4 -2
  12. package/esm2015/lib/components/dialog/dialog.js +4 -4
  13. package/esm2015/lib/components/related/common/data-type.enum.js +2 -2
  14. package/esm2015/lib/components/related/common/qms-icon.const.js +21 -1
  15. package/esm2015/lib/components/related/common/tree.function.js +10 -5
  16. package/esm2015/lib/components/related/list-other-related/list-related.component.js +10 -2
  17. package/esm2015/lib/components/related/model/popup-data.model.js +2 -1
  18. package/esm2015/lib/components/related/model/related-data.model.js +1 -1
  19. package/esm2015/lib/components/related/model/tree-config.model.js +1 -1
  20. package/esm2015/lib/components/related/model/tree-node.model.js +1 -1
  21. package/esm2015/lib/components/related/popup/related-popup.component.js +179 -12
  22. package/esm2015/lib/components/related/related.module.js +7 -5
  23. package/esm2015/lib/components/related/risk/analysis/analysis.component.js +1 -1
  24. package/esm2015/lib/components/related/service/related-global.service.js +5 -1
  25. package/esm2015/lib/components/related/tree/tree.component.js +37 -9
  26. package/esm2015/lib/components/table/table-action.js +2 -2
  27. package/esm2015/lib/directives/scrollbar/scrollbar.directive.js +8 -2
  28. package/esm2015/lib/directives/tooltip/tooltip-renderer.directive.js +4 -4
  29. package/esm2015/lib/model/en.js +7 -2
  30. package/esm2015/lib/model/no.js +7 -2
  31. package/esm2015/lib/qms-ckeditor-components/common/constants/ckeditorEvent.constant.js +3 -1
  32. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.js +1 -1
  33. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-input.model.js +2 -1
  34. package/esm2015/lib/qms-ckeditor-components/common/module/confirm/qms-ckeditor-confirm.component.js +1 -1
  35. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/attachments/link-attachment.component.js +1 -1
  36. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +3 -3
  37. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-load-template/qms-ckeditor-load-template.component.js +1 -1
  38. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-relation/qmsckeditor-related.component.js +1 -1
  39. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-template/qms-ckeditor-template.component.js +1 -1
  40. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.js +76 -0
  41. package/esm2015/lib/qms-ckeditor-components/models/qms-ckeditor-tooltip.model.js +7 -0
  42. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +51 -2
  43. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.module.js +4 -2
  44. package/esm2015/public-api.js +7 -1
  45. package/esm2015/qms-angular.js +3 -1
  46. package/fesm2015/qms-angular.js +910 -292
  47. package/fesm2015/qms-angular.js.map +1 -1
  48. package/lib/common/qms-icon.const.d.ts +1 -0
  49. package/lib/components/breadcrumb/breadcrumb-direction-icon.directive.d.ts +6 -0
  50. package/lib/components/breadcrumb/breadcrumb-item.directive.d.ts +12 -0
  51. package/lib/components/breadcrumb/breadcrumb.d.ts +32 -0
  52. package/lib/components/breadcrumb/breadcrumb.module.d.ts +2 -0
  53. package/lib/components/breadcrumb/enum/dropdown-node-width.enum.d.ts +4 -0
  54. package/lib/components/breadcrumb/model/breadcrumb-node.model.d.ts +13 -0
  55. package/lib/components/related/common/data-type.enum.d.ts +1 -1
  56. package/lib/components/related/common/qms-icon.const.d.ts +4 -0
  57. package/lib/components/related/list-other-related/list-related.component.d.ts +3 -0
  58. package/lib/components/related/model/popup-data.model.d.ts +1 -0
  59. package/lib/components/related/model/related-data.model.d.ts +4 -0
  60. package/lib/components/related/model/tree-config.model.d.ts +1 -0
  61. package/lib/components/related/model/tree-node.model.d.ts +1 -0
  62. package/lib/components/related/popup/related-popup.component.d.ts +18 -0
  63. package/lib/components/related/service/related-global.service.d.ts +2 -0
  64. package/lib/components/related/tree/tree.component.d.ts +7 -1
  65. package/lib/directives/scrollbar/scrollbar.directive.d.ts +1 -0
  66. package/lib/model/en.d.ts +6 -1
  67. package/lib/model/no.d.ts +6 -1
  68. package/lib/qms-ckeditor-components/common/constants/ckeditorEvent.constant.d.ts +2 -0
  69. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.d.ts +1 -0
  70. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-input.model.d.ts +1 -0
  71. package/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.d.ts +36 -0
  72. package/lib/qms-ckeditor-components/models/qms-ckeditor-tooltip.model.d.ts +6 -0
  73. package/lib/qms-ckeditor-components/qms-ckeditor.component.d.ts +6 -0
  74. package/package.json +1 -1
  75. package/public-api.d.ts +6 -0
  76. package/qms-angular.d.ts +2 -0
  77. package/qms-angular.metadata.json +1 -1
  78. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +2 -1
  79. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
  80. package/src/assets/qms-ckeditor-plugin/package-lock.json +1224 -2042
  81. package/src/assets/qms-ckeditor-plugin/package.json +26 -19
  82. package/src/assets/qms-ckeditor-plugin/src/ckeditor.js +23 -1
  83. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findandreplace.js +132 -0
  84. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findandreplaceediting.js +315 -0
  85. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findandreplaceui.js +223 -0
  86. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findcommand.js +90 -0
  87. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findnextcommand.js +62 -0
  88. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findpreviouscommand.js +28 -0
  89. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/index.js +10 -0
  90. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/replaceallcommand.js +54 -0
  91. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/replacecommand.js +66 -0
  92. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/ui/checkboxview.js +212 -0
  93. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/ui/findandreplaceformview.js +546 -0
  94. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/utils.js +158 -0
  95. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/theme/findandreplace.css +13 -0
  96. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/theme/findandreplaceform.css +226 -0
  97. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/theme/icons/find-replace.svg +1 -0
  98. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/index.js +16 -0
  99. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharacters.js +254 -0
  100. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharactersarrows.js +60 -0
  101. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharacterscurrency.js +78 -0
  102. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharactersessentials.js +43 -0
  103. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharacterslatin.js +170 -0
  104. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharactersmathematical.js +86 -0
  105. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharacterstext.js +69 -0
  106. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/ui/charactergridview.js +116 -0
  107. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/ui/characterinfoview.js +111 -0
  108. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/ui/specialcharactersnavigationview.js +127 -0
  109. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/theme/charactergrid.css +12 -0
  110. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/theme/characterinfo.css +9 -0
  111. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/theme/icons/specialcharacters.svg +1 -0
  112. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/theme/specialcharacters.css +10 -0
  113. package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorConstant.js +4 -0
  114. package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorService.js +10 -0
  115. package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorUtil.js +63 -0
  116. package/src/assets/qms-ckeditor-plugin/src/plugins/timestamp/timestamp.js +34 -0
  117. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/inserttooltipcommand.js +98 -0
  118. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/removetooltipcommand.js +41 -0
  119. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltip.js +14 -0
  120. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipediting.js +280 -0
  121. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipui.js +203 -0
  122. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/ui/actionsview.js +95 -0
  123. package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/utils.js +70 -0
  124. package/src/assets/qms-ckeditor-plugin/src/themes/icons/information.svg +50 -0
  125. package/src/assets/qms-ckeditor-plugin/src/themes/icons/timestamp.svg +1 -0
  126. package/src/assets/qms-ckeditor-plugin/src/themes/tyles/tooltip.css +74 -0
  127. package/src/lib/components/breadcrumb/breadcrumb.scss +100 -0
  128. package/src/lib/components/button/button-toggle.scss +25 -1
  129. package/src/lib/components/dialog/dialog.scss +9 -0
  130. package/src/lib/components/related/popup/related-popup.component.scss +46 -0
  131. package/src/lib/components/table/table.scss +5 -27
  132. package/src/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.scss +11 -0
  133. package/src/lib/qms-ckeditor-components/qms-ckeditor.component.scss +29 -1
  134. package/src/lib/qms-ckeditor-components/styles/_modules.scss +6 -0
  135. package/src/themes/core/_form.scss +4 -0
  136. package/src/themes/core/_input.scss +8 -0
  137. package/src/themes/core/_scrollbar.scss +9 -2
  138. package/src/themes/core/_styles.scss +5 -0
  139. 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>
@@ -0,0 +1,16 @@
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 special-characters
8
+ */
9
+
10
+ export { default as SpecialCharacters } from './specialcharacters';
11
+ export { default as SpecialCharactersArrows } from './specialcharactersarrows';
12
+ export { default as SpecialCharactersText } from './specialcharacterstext';
13
+ export { default as SpecialCharactersMathematical } from './specialcharactersmathematical';
14
+ export { default as SpecialCharactersLatin } from './specialcharacterslatin';
15
+ export { default as SpecialCharactersEssentials } from './specialcharactersessentials';
16
+ export { default as SpecialCharactersCurrency } from './specialcharacterscurrency';
@@ -0,0 +1,254 @@
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 special-characters/specialcharacters
8
+ */
9
+
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
+ import SpecialCharactersNavigationView from './ui/specialcharactersnavigationview';
15
+ import CharacterGridView from './ui/charactergridview';
16
+ import CharacterInfoView from './ui/characterinfoview';
17
+
18
+ import specialCharactersIcon from '../theme/icons/specialcharacters.svg';
19
+ import '../theme/specialcharacters.css';
20
+
21
+ const ALL_SPECIAL_CHARACTERS_GROUP = 'All';
22
+
23
+ /**
24
+ * The special characters feature.
25
+ *
26
+ * Introduces the `'specialCharacters'` dropdown.
27
+ *
28
+ * @extends module:core/plugin~Plugin
29
+ */
30
+ export default class SpecialCharacters extends Plugin {
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ static get requires() {
35
+ return [ Typing ];
36
+ }
37
+
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ static get pluginName() {
42
+ return 'SpecialCharacters';
43
+ }
44
+
45
+ /**
46
+ * @inheritDoc
47
+ */
48
+ constructor( editor ) {
49
+ super( editor );
50
+
51
+ /**
52
+ * Registered characters. A pair of a character name and its symbol.
53
+ *
54
+ * @private
55
+ * @member {Map.<String, String>} #_characters
56
+ */
57
+ this._characters = new Map();
58
+
59
+ /**
60
+ * Registered groups. Each group contains a collection with symbol names.
61
+ *
62
+ * @private
63
+ * @member {Map.<String, Set.<String>>} #_groups
64
+ */
65
+ this._groups = new Map();
66
+ }
67
+
68
+ /**
69
+ * @inheritDoc
70
+ */
71
+ init() {
72
+ const editor = this.editor;
73
+ const t = editor.t;
74
+
75
+ const inputCommand = editor.commands.get( 'input' );
76
+
77
+ // Add the `specialCharacters` dropdown button to feature components.
78
+ editor.ui.componentFactory.add( 'specialCharacters', locale => {
79
+ const dropdownView = createDropdown( locale );
80
+ let dropdownPanelContent;
81
+
82
+ dropdownView.buttonView.set( {
83
+ label: t( 'Special characters' ),
84
+ icon: specialCharactersIcon,
85
+ tooltip: true
86
+ } );
87
+
88
+ dropdownView.bind( 'isEnabled' ).to( inputCommand );
89
+
90
+ // Insert a special character when a tile was clicked.
91
+ dropdownView.on( 'execute', ( evt, data ) => {
92
+ editor.execute( 'input', { text: data.character } );
93
+ editor.editing.view.focus();
94
+ } );
95
+
96
+ dropdownView.on( 'change:isOpen', () => {
97
+ if ( !dropdownPanelContent ) {
98
+ dropdownPanelContent = this._createDropdownPanelContent( locale, dropdownView );
99
+
100
+ dropdownView.panelView.children.add( dropdownPanelContent.navigationView );
101
+ dropdownView.panelView.children.add( dropdownPanelContent.gridView );
102
+ dropdownView.panelView.children.add( dropdownPanelContent.infoView );
103
+ }
104
+
105
+ dropdownPanelContent.infoView.set( {
106
+ character: null,
107
+ name: null
108
+ } );
109
+ } );
110
+
111
+ return dropdownView;
112
+ } );
113
+ }
114
+
115
+ /**
116
+ * Adds a collection of special characters to the specified group. The title of a special character must be unique.
117
+ *
118
+ * **Note:** The "All" category name is reserved by the plugin and cannot be used as a new name for a special
119
+ * characters category.
120
+ *
121
+ * @param {String} groupName
122
+ * @param {Array.<module:special-characters/specialcharacters~SpecialCharacterDefinition>} items
123
+ */
124
+ addItems( groupName, items ) {
125
+ if ( groupName === ALL_SPECIAL_CHARACTERS_GROUP ) {
126
+ /**
127
+ * The name "All" for a special category group cannot be used because it is a special category that displays all
128
+ * available special characters.
129
+ *
130
+ * @error special-character-invalid-group-name
131
+ */
132
+ throw new CKEditorError(
133
+ `special-character-invalid-group-name: The name "${ ALL_SPECIAL_CHARACTERS_GROUP }" is reserved and cannot be used.`
134
+ );
135
+ }
136
+
137
+ const group = this._getGroup( groupName );
138
+
139
+ for ( const item of items ) {
140
+ group.add( item.title );
141
+ this._characters.set( item.title, item.character );
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Returns an iterator of special characters groups.
147
+ *
148
+ * @returns {Iterable.<String>}
149
+ */
150
+ getGroups() {
151
+ return this._groups.keys();
152
+ }
153
+
154
+ /**
155
+ * Returns a collection of special characters symbol names (titles).
156
+ *
157
+ * @param {String} groupName
158
+ * @returns {Set.<String>|undefined}
159
+ */
160
+ getCharactersForGroup( groupName ) {
161
+ if ( groupName === ALL_SPECIAL_CHARACTERS_GROUP ) {
162
+ return new Set( this._characters.keys() );
163
+ }
164
+
165
+ return this._groups.get( groupName );
166
+ }
167
+
168
+ /**
169
+ * Returns the symbol of a special character for the specified name. If the special character could not be found, `undefined`
170
+ * is returned.
171
+ *
172
+ * @param {String} title The title of a special character.
173
+ * @returns {String|undefined}
174
+ */
175
+ getCharacter( title ) {
176
+ return this._characters.get( title );
177
+ }
178
+
179
+ /**
180
+ * Returns a group of special characters. If the group with the specified name does not exist, it will be created.
181
+ *
182
+ * @private
183
+ * @param {String} groupName The name of the group to create.
184
+ */
185
+ _getGroup( groupName ) {
186
+ if ( !this._groups.has( groupName ) ) {
187
+ this._groups.set( groupName, new Set() );
188
+ }
189
+
190
+ return this._groups.get( groupName );
191
+ }
192
+
193
+ /**
194
+ * Updates the symbol grid depending on the currently selected character group.
195
+ *
196
+ * @private
197
+ * @param {String} currentGroupName
198
+ * @param {module:special-characters/ui/charactergridview~CharacterGridView} gridView
199
+ */
200
+ _updateGrid( currentGroupName, gridView ) {
201
+ // Updating the grid starts with removing all tiles belonging to the old group.
202
+ gridView.tiles.clear();
203
+
204
+ const characterTitles = this.getCharactersForGroup( currentGroupName );
205
+
206
+ for ( const title of characterTitles ) {
207
+ const character = this.getCharacter( title );
208
+
209
+ gridView.tiles.add( gridView.createTile( character, title ) );
210
+ }
211
+ }
212
+
213
+ /**
214
+ * Initializes the dropdown, used for lazy loading.
215
+ *
216
+ * @private
217
+ * @param {module:utils/locale~Locale} locale
218
+ * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
219
+ * @returns {Object} Returns an object with `navigationView`, `gridView` and `infoView` properties, containing UI parts.
220
+ */
221
+ _createDropdownPanelContent( locale, dropdownView ) {
222
+ const specialCharsGroups = [ ...this.getGroups() ];
223
+
224
+ // Add a special group that shows all available special characters.
225
+ specialCharsGroups.unshift( ALL_SPECIAL_CHARACTERS_GROUP );
226
+
227
+ const navigationView = new SpecialCharactersNavigationView( locale, specialCharsGroups );
228
+ const gridView = new CharacterGridView( locale );
229
+ const infoView = new CharacterInfoView( locale );
230
+
231
+ gridView.delegate( 'execute' ).to( dropdownView );
232
+
233
+ gridView.on( 'tileHover', ( evt, data ) => {
234
+ infoView.set( data );
235
+ } );
236
+
237
+ // Update the grid of special characters when a user changed the character group.
238
+ navigationView.on( 'execute', () => {
239
+ this._updateGrid( navigationView.currentGroupName, gridView );
240
+ } );
241
+
242
+ // Set the initial content of the special characters grid.
243
+ this._updateGrid( navigationView.currentGroupName, gridView );
244
+
245
+ return { navigationView, gridView, infoView };
246
+ }
247
+ }
248
+
249
+ /**
250
+ * @typedef {Object} module:special-characters/specialcharacters~SpecialCharacterDefinition
251
+ *
252
+ * @property {String} title A unique name of the character (e.g. "greek small letter epsilon").
253
+ * @property {String} character A human-readable character displayed as the label (e.g. "ε").
254
+ */
@@ -0,0 +1,60 @@
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 special-characters/specialcharactersarrows
8
+ */
9
+
10
+ import { Plugin } from '@ckeditor/ckeditor5-core';
11
+
12
+ /**
13
+ * A plugin that provides special characters for the "Arrows" category.
14
+ *
15
+ * ClassicEditor
16
+ * .create( {
17
+ * plugins: [ ..., SpecialCharacters, SpecialCharactersArrows ],
18
+ * } )
19
+ * .then( ... )
20
+ * .catch( ... );
21
+ *
22
+ * @extends module:core/plugin~Plugin
23
+ */
24
+ export default class SpecialCharactersArrows extends Plugin {
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static get pluginName() {
29
+ return 'SpecialCharactersArrows';
30
+ }
31
+
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ init() {
36
+ const editor = this.editor;
37
+ const t = editor.t;
38
+
39
+ editor.plugins.get( 'SpecialCharacters' ).addItems( 'Arrows', [
40
+ { title: t( 'leftwards double arrow' ), character: '⇐' },
41
+ { title: t( 'rightwards double arrow' ), character: '⇒' },
42
+ { title: t( 'upwards double arrow' ), character: '⇑' },
43
+ { title: t( 'downwards double arrow' ), character: '⇓' },
44
+ { title: t( 'leftwards dashed arrow' ), character: '⇠' },
45
+ { title: t( 'rightwards dashed arrow' ), character: '⇢' },
46
+ { title: t( 'upwards dashed arrow' ), character: '⇡' },
47
+ { title: t( 'downwards dashed arrow' ), character: '⇣' },
48
+ { title: t( 'leftwards arrow to bar' ), character: '⇤' },
49
+ { title: t( 'rightwards arrow to bar' ), character: '⇥' },
50
+ { title: t( 'upwards arrow to bar' ), character: '⤒' },
51
+ { title: t( 'downwards arrow to bar' ), character: '⤓' },
52
+ { title: t( 'up down arrow with base' ), character: '↨' },
53
+ { title: t( 'back with leftwards arrow above' ), character: '🔙' },
54
+ { title: t( 'end with leftwards arrow above' ), character: '🔚' },
55
+ { title: t( 'on with exclamation mark with left right arrow above' ), character: '🔛' },
56
+ { title: t( 'soon with rightwards arrow above' ), character: '🔜' },
57
+ { title: t( 'top with upwards arrow above' ), character: '🔝' }
58
+ ] );
59
+ }
60
+ }
@@ -0,0 +1,78 @@
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 special-characters/specialcharacterscurrency
8
+ */
9
+
10
+ import { Plugin } from '@ckeditor/ckeditor5-core';
11
+
12
+ /**
13
+ * A plugin that provides special characters for the "Currency" category.
14
+ *
15
+ * ClassicEditor
16
+ * .create( {
17
+ * plugins: [ ..., SpecialCharacters, SpecialCharactersCurrency ],
18
+ * } )
19
+ * .then( ... )
20
+ * .catch( ... );
21
+ *
22
+ * @extends module:core/plugin~Plugin
23
+ */
24
+ export default class SpecialCharactersCurrency extends Plugin {
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static get pluginName() {
29
+ return 'SpecialCharactersCurrency';
30
+ }
31
+
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ init() {
36
+ const editor = this.editor;
37
+ const t = editor.t;
38
+
39
+ editor.plugins.get( 'SpecialCharacters' ).addItems( 'Currency', [
40
+ { character: '$', title: t( 'Dollar sign' ) },
41
+ { character: '€', title: t( 'Euro sign' ) },
42
+ { character: '¥', title: t( 'Yen sign' ) },
43
+ { character: '£', title: t( 'Pound sign' ) },
44
+ { character: '¢', title: t( 'Cent sign' ) },
45
+ { character: '₠', title: t( 'Euro-currency sign' ) },
46
+ { character: '₡', title: t( 'Colon sign' ) },
47
+ { character: '₢', title: t( 'Cruzeiro sign' ) },
48
+ { character: '₣', title: t( 'French franc sign' ) },
49
+ { character: '₤', title: t( 'Lira sign' ) },
50
+ { character: '¤', title: t( 'Currency sign' ) },
51
+ { character: '₿', title: t( 'Bitcoin sign' ) },
52
+ { character: '₥', title: t( 'Mill sign' ) },
53
+ { character: '₦', title: t( 'Naira sign' ) },
54
+ { character: '₧', title: t( 'Peseta sign' ) },
55
+ { character: '₨', title: t( 'Rupee sign' ) },
56
+ { character: '₩', title: t( 'Won sign' ) },
57
+ { character: '₪', title: t( 'New sheqel sign' ) },
58
+ { character: '₫', title: t( 'Dong sign' ) },
59
+ { character: '₭', title: t( 'Kip sign' ) },
60
+ { character: '₮', title: t( 'Tugrik sign' ) },
61
+ { character: '₯', title: t( 'Drachma sign' ) },
62
+ { character: '₰', title: t( 'German penny sign' ) },
63
+ { character: '₱', title: t( 'Peso sign' ) },
64
+ { character: '₲', title: t( 'Guarani sign' ) },
65
+ { character: '₳', title: t( 'Austral sign' ) },
66
+ { character: '₴', title: t( 'Hryvnia sign' ) },
67
+ { character: '₵', title: t( 'Cedi sign' ) },
68
+ { character: '₶', title: t( 'Livre tournois sign' ) },
69
+ { character: '₷', title: t( 'Spesmilo sign' ) },
70
+ { character: '₸', title: t( 'Tenge sign' ) },
71
+ { character: '₹', title: t( 'Indian rupee sign' ) },
72
+ { character: '₺', title: t( 'Turkish lira sign' ) },
73
+ { character: '₻', title: t( 'Nordic mark sign' ) },
74
+ { character: '₼', title: t( 'Manat sign' ) },
75
+ { character: '₽', title: t( 'Ruble sign' ) }
76
+ ] );
77
+ }
78
+ }
@@ -0,0 +1,43 @@
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 special-characters/specialcharactersessentials
8
+ */
9
+
10
+ import { Plugin } from '@ckeditor/ckeditor5-core';
11
+
12
+ import SpecialCharactersCurrency from './specialcharacterscurrency';
13
+ import SpecialCharactersMathematical from './specialcharactersmathematical';
14
+ import SpecialCharactersArrows from './specialcharactersarrows';
15
+ import SpecialCharactersLatin from './specialcharacterslatin';
16
+ import SpecialCharactersText from './specialcharacterstext';
17
+
18
+ /**
19
+ * A plugin combining a basic set of characters for the special characters plugin.
20
+ *
21
+ * ClassicEditor
22
+ * .create( {
23
+ * plugins: [ ..., SpecialCharacters, SpecialCharactersEssentials ],
24
+ * } )
25
+ * .then( ... )
26
+ * .catch( ... );
27
+ *
28
+ * @extends module:core/plugin~Plugin
29
+ */
30
+ export default class SpecialCharactersEssentials extends Plugin {
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ static get requires() {
35
+ return [
36
+ SpecialCharactersCurrency,
37
+ SpecialCharactersText,
38
+ SpecialCharactersMathematical,
39
+ SpecialCharactersArrows,
40
+ SpecialCharactersLatin
41
+ ];
42
+ }
43
+ }