qms-angular 1.1.41 → 1.1.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. package/bundles/qms-angular.umd.js +1569 -441
  2. package/bundles/qms-angular.umd.js.map +1 -1
  3. package/esm2015/lib/common/enum/data-type.enum.js +2 -1
  4. package/esm2015/lib/common/enum/process-classification.enum.js +6 -0
  5. package/esm2015/lib/common/qms-icon.const.js +116 -111
  6. package/esm2015/lib/common/themes.const.js +2 -2
  7. package/esm2015/lib/components/app-icon/icon-registry.service.js +5 -2
  8. package/esm2015/lib/components/related/common/video.const.js +3 -1
  9. package/esm2015/lib/components/related/content/related-content.component.js +2 -2
  10. package/esm2015/lib/components/related/list-other-related/list-related.component.js +5 -2
  11. package/esm2015/lib/components/related/model/popup-data.model.js +3 -1
  12. package/esm2015/lib/components/related/model/related-data.model.js +1 -1
  13. package/esm2015/lib/components/related/popup/related-popup.component.js +48 -32
  14. package/esm2015/lib/components/related/related.module.js +3 -2
  15. package/esm2015/lib/components/related/risk/analysis/analysis.component.js +2 -2
  16. package/esm2015/lib/components/select-access-dialog/select-access-dialog.component.js +24 -4
  17. package/esm2015/lib/components/select-department-tree/select-department-tree.component.js +5 -4
  18. package/esm2015/lib/components/select-one/select-one.component.js +2 -2
  19. package/esm2015/lib/components/select-process-document/select-process-document.component.js +15 -11
  20. package/esm2015/lib/components/tree/model/tree-config.model.js +1 -1
  21. package/esm2015/lib/components/tree/tree.component.js +12 -4
  22. package/esm2015/lib/components/treeNew/model/tree-node.model.js +1 -1
  23. package/esm2015/lib/components/treeNew/model/tree.model.js +1 -1
  24. package/esm2015/lib/components/treeNew/tree.component.js +8 -4
  25. package/esm2015/lib/components/treeNew/tree.function.js +8 -4
  26. package/esm2015/lib/model/en.js +86 -2
  27. package/esm2015/lib/model/no.js +87 -3
  28. package/esm2015/lib/model/sv.js +437 -0
  29. package/esm2015/lib/qms-ckeditor-components/common/functions/common.function.js +15 -14
  30. package/esm2015/lib/qms-ckeditor-components/common/functions/resource.function.js +207 -0
  31. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.js +1 -1
  32. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-url.model.js +1 -1
  33. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.js +262 -29
  34. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +102 -36
  35. package/esm2015/lib/qms-ckeditor-components/models/qms-ckeditor-imagemap.model.js +1 -1
  36. package/esm2015/lib/qms-ckeditor-components/models/qms-ckeditor-video.model.js +16 -0
  37. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +39 -118
  38. package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-bpmn.service.js +10 -3
  39. package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-tree.service.js +7 -3
  40. package/esm2015/lib/services/translation-registry.service.js +7 -5
  41. package/fesm2015/qms-angular.js +1603 -503
  42. package/fesm2015/qms-angular.js.map +1 -1
  43. package/lib/common/enum/data-type.enum.d.ts +2 -1
  44. package/lib/common/enum/process-classification.enum.d.ts +4 -0
  45. package/lib/common/qms-icon.const.d.ts +1 -0
  46. package/lib/components/app-icon/icon-registry.service.d.ts +1 -0
  47. package/lib/components/related/common/video.const.d.ts +2 -0
  48. package/lib/components/related/content/related-content.component.d.ts +1 -1
  49. package/lib/components/related/list-other-related/list-related.component.d.ts +2 -2
  50. package/lib/components/related/model/popup-data.model.d.ts +3 -0
  51. package/lib/components/related/model/related-data.model.d.ts +1 -0
  52. package/lib/components/related/popup/related-popup.component.d.ts +7 -3
  53. package/lib/components/select-access-dialog/select-access-dialog.component.d.ts +3 -2
  54. package/lib/components/select-one/select-one.component.d.ts +1 -1
  55. package/lib/components/select-process-document/select-process-document.component.d.ts +5 -6
  56. package/lib/components/tree/model/tree-config.model.d.ts +1 -1
  57. package/lib/components/tree/tree.component.d.ts +1 -1
  58. package/lib/components/treeNew/model/tree-node.model.d.ts +1 -0
  59. package/lib/components/treeNew/model/tree.model.d.ts +1 -0
  60. package/lib/components/treeNew/tree.component.d.ts +5 -2
  61. package/lib/model/en.d.ts +84 -0
  62. package/lib/model/no.d.ts +84 -0
  63. package/lib/model/sv.d.ts +436 -0
  64. package/lib/qms-ckeditor-components/common/functions/common.function.d.ts +29 -10
  65. package/lib/qms-ckeditor-components/common/functions/resource.function.d.ts +194 -0
  66. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.d.ts +3 -0
  67. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-url.model.d.ts +2 -0
  68. package/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.d.ts +13 -2
  69. package/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.d.ts +1 -0
  70. package/lib/qms-ckeditor-components/models/qms-ckeditor-imagemap.model.d.ts +1 -0
  71. package/lib/qms-ckeditor-components/models/qms-ckeditor-video.model.d.ts +10 -0
  72. package/lib/qms-ckeditor-components/qms-ckeditor.component.d.ts +1 -2
  73. package/lib/qms-ckeditor-components/services/qms-ckeditor-tree.service.d.ts +2 -1
  74. package/lib/services/translation-registry.service.d.ts +1 -0
  75. package/package.json +1 -1
  76. package/qms-angular.metadata.json +1 -1
  77. package/src/assets/jointjs/scss/bpmn.scss +914 -906
  78. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +1 -1
  79. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
  80. package/src/assets/qms-ckeditor-plugin/build/translations/no.js +1 -1
  81. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findandreplaceui.js +223 -223
  82. package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/no.po +21 -0
  83. package/src/assets/qms-ckeditor-plugin/src/plugins/fullscreen/qmsCKEditorFullscreenPlugin.js +52 -50
  84. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingui.js +115 -115
  85. package/src/assets/qms-ckeditor-plugin/src/plugins/heading/utils.js +42 -42
  86. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkcommand.js +1 -1
  87. package/src/assets/qms-ckeditor-plugin/src/plugins/media/mediaembedediting.js +281 -283
  88. package/src/assets/qms-ckeditor-plugin/src/plugins/media/theme/mediaembed.css +30 -30
  89. package/src/assets/qms-ckeditor-plugin/src/plugins/media/theme/mediaembedediting.css +57 -57
  90. package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/snippet.css +3877 -3876
  91. package/src/assets/qms-ckeditor-plugin/src/plugins/video/theme/video.css +17 -17
  92. package/src/assets/qms-ckeditor-plugin/src/plugins/video/theme/videoresize.css +33 -32
  93. package/src/assets/qms-ckeditor-plugin/src/plugins/video/video/videoediting.js +81 -75
  94. package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoresize/resizevideocommand.js +35 -35
  95. package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoresize/videoresizeediting.js +104 -92
  96. package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/browsevideodialogcommand.js +69 -25
  97. package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/uploadvideocommand.js +21 -21
  98. package/src/lib/components/related/popup/related-popup.component.scss +374 -350
  99. package/esm2015/lib/components/related/common/data-type.enum.js +0 -14
  100. package/esm2015/lib/components/select-one/common/data-type.enum.js +0 -14
  101. package/lib/components/related/common/data-type.enum.d.ts +0 -12
  102. package/lib/components/select-one/common/data-type.enum.d.ts +0 -12
@@ -1 +1 @@
1
- !function(e){const t=e.no=e.no||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 av %1","Align center":"Midtstill","Align left":"Venstrejuster","Align right":"Høyrejuster",Aquamarine:"Akvamarin",Big:"Stor",Black:"Svart","Block quote":"Blokksitat",Blue:"Blå",Bold:"Fet","Bulleted List":"Punktliste",Cancel:"Avbryt","Cannot upload file:":"Kan ikke laste opp fil:","Centered image":"Midtstilt bilde","Change image text alternative":"Endre tekstalternativ til bildet","Characters: %0":"Tegn: %0","Could not insert image at the current position.":"Kunne ikke sette inn bilde på gjeldende posisjon.","Could not obtain resized image URL.":"Kunne ikke finne URL for bilde med endret størrelse.","Decrease indent":"Reduser innrykk",Default:"Standard","Dim grey":"Svak grå","Document colors":"Dokumentfarger","Dropdown toolbar":"Verktøylinje for nedtrekksliste","Edit block":"Rediger blokk","Editor toolbar":"Verktøylinje for redigeringsverktøy","Enter image caption":"Skriv inn bildetekst","Font Background Color":"Uthevingsfarge for tekst","Font Color":"Skriftfarge","Font Family":"Skrifttypefamilie","Font Size":"Skriftstørrelse","Full size image":"Bilde i full størrelse",Green:"Grønn",Grey:"Grå","Horizontal line":"Horisontal linje",Huge:"Veldig stor","Image resize list":"","Image toolbar":"Verktøylinje for bilde","image widget":"Bilde-widget","Increase indent":"Øk innrykk","Insert image":"Sett inn bilde","Insert image or file":"Sett inn bilde eller fil","Insert paragraph after block":"","Insert paragraph before block":"","Inserting image failed":"Innsetting av bilde mislyktes",Italic:"Kursiv",Justify:"Blokkjuster","Left aligned image":"Venstrejustert bilde","Light blue":"Lyseblå","Light green":"Lysegrønn","Light grey":"Lysegrå",Next:"Neste","Numbered List":"Nummerert liste",Orange:"Oransje",Original:"","Page break":"Sideskift ",Previous:"Forrige",Purple:"Lilla",Red:"Rød",Redo:"Gjør om","Remove color":"Fjern farge","Remove Format":"Fjern formatering","Resize image":"","Resize image to %0":"","Resize image to the original size":"","Rich Text Editor":"Tekstredigeringsverktøy for rik tekst","Rich Text Editor, %0":"Tekstredigeringsverktøy for rik tekst, %0","Right aligned image":"Høyrejustert bilde",Save:"Lagre","Select all":"Velg alt ","Selecting resized image failed":"Kunne ikke velge bilde med endret størrelse","Show more items":"Vis flere elementer","Side image":"Sidestilt bilde",Small:"Liten",Strikethrough:"Gjennomstreket",Subscript:"Senket skrift",Superscript:"Hevet skrift","Text alignment":"Tekstjustering","Text alignment toolbar":"Verktøylinje for tekstjustering","Text alternative":"Tekstalternativ",Tiny:"Veldig liten",Turquoise:"Turkis",Underline:"Understreket",Undo:"Angre","Upload failed":"Kunne ikke laste opp","Upload in progress":"Laster opp fil",White:"Hvit","Widget toolbar":"Widget verktøylinje ","Words: %0":"Ord: %0",Yellow:"Gul"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
1
+ !function(e){const t=e.no=e.no||{};t.dictionary=Object.assign(t.dictionary||{},{"%0 of %1":"%0 av %1","Align center":"Midtstill","Align left":"Venstrejuster","Align right":"Høyrejuster",Aquamarine:"Akvamarin",Big:"Stor",Black:"Svart","Block quote":"Blokksitat",Blue:"Blå",Bold:"Fet","Bulleted List":"Punktliste",Cancel:"Avbryt","Cannot upload file:":"Kan ikke laste opp fil:","Centered image":"Midtstilt bilde","Change image text alternative":"Endre tekstalternativ til bildet","Characters: %0":"Tegn: %0","Could not insert image at the current position.":"Kunne ikke sette inn bilde på gjeldende posisjon.","Could not obtain resized image URL.":"Kunne ikke finne URL for bilde med endret størrelse.","Decrease indent":"Reduser innrykk",Default:"Standard","Dim grey":"Svak grå","Document colors":"Dokumentfarger","Dropdown toolbar":"Verktøylinje for nedtrekksliste","Edit block":"Rediger blokk","Editor toolbar":"Verktøylinje for redigeringsverktøy","Enter image caption":"Skriv inn bildetekst","Font Background Color":"Uthevingsfarge for tekst","Font Color":"Skriftfarge","Font Family":"Skrifttypefamilie","Font Size":"Skriftstørrelse","Full size image":"Bilde i full størrelse",Green:"Grønn",Grey:"Grå","Horizontal line":"Horisontal linje",Huge:"Veldig stor","Image resize list":"","Image toolbar":"Verktøylinje for bilde","image widget":"Bilde-widget","Increase indent":"Øk innrykk","Insert image":"Sett inn bilde","Insert image or file":"Sett inn bilde eller fil","Insert paragraph after block":"","Insert paragraph before block":"","Inserting image failed":"Innsetting av bilde mislyktes",Italic:"Kursiv",Justify:"Blokkjuster","Left aligned image":"Venstrejustert bilde","Light blue":"Lyseblå","Light green":"Lysegrønn","Light grey":"Lysegrå",Next:"Neste","Numbered List":"Nummerert liste",Orange:"Oransje",Original:"","Page break":"Sideskift ",Previous:"Forrige",Purple:"Lilla",Red:"Rød",Redo:"Gjør om","Remove color":"Fjern farge","Remove Format":"Fjern formatering","Resize image":"","Resize image to %0":"","Resize image to the original size":"","Rich Text Editor":"Tekstredigeringsverktøy for rik tekst","Rich Text Editor, %0":"Tekstredigeringsverktøy for rik tekst, %0","Right aligned image":"Høyrejustert bilde",Save:"Lagre","Select all":"Velg alt ","Selecting resized image failed":"Kunne ikke velge bilde med endret størrelse","Show more items":"Vis flere elementer","Side image":"Sidestilt bilde",Small:"Liten",Source:"Kilde",Strikethrough:"Gjennomstreket",Subscript:"Senket skrift",Superscript:"Hevet skrift","Text alignment":"Tekstjustering","Text alignment toolbar":"Verktøylinje for tekstjustering","Text alternative":"Tekstalternativ",Tiny:"Veldig liten",Turquoise:"Turkis",Underline:"Understreket",Undo:"Angre","Upload failed":"Kunne ikke laste opp","Upload in progress":"Laster opp fil",White:"Hvit","Widget toolbar":"Widget verktøylinje ","Words: %0":"Ord: %0",Yellow:"Gul"}),t.getPluralForm=function(e){return 1!=e}}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -1,223 +1,223 @@
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 find-and-replace/findandreplaceui
8
- */
9
-
10
- import { Plugin } from '@ckeditor/ckeditor5-core';
11
- import { createDropdown, SplitButtonView } from '@ckeditor/ckeditor5-ui';
12
- import FindAndReplaceFormView from './ui/findandreplaceformview';
13
- // See: #8833.
14
- // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
15
- import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
16
- import '../theme/findandreplaceform.css';
17
-
18
- import loupeIcon from '../theme/icons/find-replace.svg';
19
-
20
- /**
21
- * The default find and replace UI. It introduces:
22
- *
23
- * * The `'Find and replace'` dropdown button.
24
- *
25
- * It registers the `'findAndReplace'` UI button in the editor's {@link module:ui/componentfactory~ComponentFactory component factory}.
26
- * that uses the {@link module:find-and-replace/findandreplace~FindAndReplace FindAndReplace} plugin API.
27
- *
28
- * It emits events depending on user search/replace intents.
29
- *
30
- * @extends module:core/plugin~Plugin
31
- */
32
- export default class FindAndReplaceUI extends Plugin {
33
- /**
34
- * @inheritDoc
35
- */
36
- static get pluginName() {
37
- return 'FindAndReplaceUI';
38
- }
39
-
40
- constructor( editor ) {
41
- super( editor );
42
-
43
- this.set( 'searchText' );
44
- this.set( 'replaceText' );
45
-
46
- this.set( 'isSearching', false );
47
-
48
- this.set( 'matchCount', null );
49
- this.set( 'highlightOffset', null );
50
-
51
- this.bind( 'isSearching' ).to( this, 'matchCount', count => count > 0 );
52
-
53
- /**
54
- * The form view will only be assigned if the find and replace toolbar button was added.
55
- *
56
- * @member {module:find-and-replace/ui/findandreplaceformview~FindAndReplaceFormView|null} #formView
57
- */
58
- this.formView = null;
59
- }
60
-
61
- /**
62
- * @inheritDoc
63
- */
64
- init() {
65
- this.findAndReplacePlugin = this.editor.plugins.get( 'FindAndReplace' );
66
-
67
- const editor = this.editor;
68
-
69
- editor.ui.componentFactory.add( 'findAndReplace', locale => {
70
- const dropdown = createDropdown( locale, SplitButtonView );
71
-
72
- const formView = new FindAndReplaceFormView( editor.locale );
73
-
74
- formView.delegate( 'findNext' ).to( this );
75
- formView.delegate( 'findPrevious' ).to( this );
76
- formView.delegate( 'replace' ).to( this );
77
- formView.delegate( 'replaceAll' ).to( this );
78
-
79
- formView.bind( 'matchCount' ).to( this );
80
- formView.bind( 'highlightOffset' ).to( this );
81
-
82
- formView.bind( 'isSearching' ).to( this );
83
-
84
- this._createToolbarDropdown( dropdown, loupeIcon, formView );
85
-
86
- dropdown.panelView.children.add( formView );
87
-
88
- dropdown.on( 'change:isOpen', ( event, name, value ) => {
89
- if ( !value ) {
90
- this.fire( 'dropdown:closed' );
91
- }
92
- } );
93
-
94
- this.formView = formView;
95
-
96
- if ( this._state ) {
97
- this.unbind( 'isSearching' );
98
-
99
- const findTextInputView = formView.findInputView.fieldView;
100
-
101
- // Searching should only be active if there's more than 1 result matched and
102
- // the user has not changed any search criteria.
103
- this.bind( 'isSearching' ).to( this, 'matchCount',
104
- findTextInputView, 'value', this._state, 'searchText',
105
- formView.matchCaseView, 'isChecked', this._state, 'matchCase',
106
- formView.matchWholeWordsView, 'isChecked', this._state, 'matchWholeWords',
107
- ( count,
108
- viewSearchText, modelSearchText,
109
- viewMatchCase, modelMatchCase,
110
- viewWholeWords, modelWholeWords
111
- ) => {
112
- return count > 0 &&
113
- viewSearchText == modelSearchText &&
114
- viewMatchCase == modelMatchCase &&
115
- viewWholeWords == modelWholeWords;
116
- } );
117
- }
118
-
119
- editor.keystrokes.set( 'Ctrl+F', ( data, cancelEvent ) => {
120
- dropdown.buttonView.actionView.fire( 'execute' );
121
-
122
- cancelEvent();
123
- } );
124
-
125
- return dropdown;
126
- } );
127
- }
128
-
129
- /**
130
- * Sets the observed state object. It is used to display search result count etc.
131
- *
132
- * @protected
133
- * @param {module:find-and-replace/findandreplaceediting~FindAndReplaceState} state State object to be tracked.
134
- */
135
- _setState( state ) {
136
- this._state = state;
137
-
138
- this.listenTo( state.results, 'change', () => {
139
- this.set( 'matchCount', state.results.length );
140
- } );
141
-
142
- this.bind( 'highlightOffset' ).to( state, 'highlightedResult', highlightedResult => {
143
- if ( !highlightedResult ) {
144
- return null;
145
- }
146
-
147
- const sortedResults = Array.from( state.results ).sort( ( a, b ) => {
148
- const mapping = {
149
- before: -1,
150
- same: 0,
151
- after: 1
152
- };
153
-
154
- return mapping[ a.marker.getStart().compareWith( b.marker.getStart() ) ];
155
- } );
156
-
157
- const index = sortedResults.indexOf( highlightedResult );
158
-
159
- return index === -1 ?
160
- null : index + 1;
161
- } );
162
- }
163
-
164
- /**
165
- * @private
166
- * @param {module:ui/dropdown/dropdownview~DropdownView} dropdown
167
- * @param {String} icon An icon to be assigned to the button.
168
- * @param {module:find-and-replace/ui/findandreplaceformview~FindAndReplaceFormView} formView A related form view.
169
- */
170
- _createToolbarDropdown( dropdown, icon, formView ) {
171
- const t = this.editor.locale.t;
172
- const buttonView = dropdown.buttonView;
173
-
174
- // Configure the dropdown's button properties:
175
- buttonView.set( {
176
- icon,
177
- tooltip: this.editor.config._config.getTranslateLabel('FIND_AND_REPLACE', t( 'Find and replace' ))
178
- } );
179
-
180
- // Clicking the main button has the same effect as clicking the dropdown arrow.
181
- buttonView.actionView.delegate( 'execute' ).to( buttonView.arrowView );
182
-
183
- // Each time a dropdown is opened, the search text field should get focused.
184
- buttonView.on( 'open', () => {
185
- formView.findInputView.fieldView.select();
186
- formView.focus();
187
- }, { priority: 'low' } );
188
- }
189
- }
190
-
191
- /**
192
- * Fired when the find next button is triggered.
193
- *
194
- * @event findNext
195
- * @param {String} searchText Search text.
196
- */
197
-
198
- /**
199
- * Fired when the find previous button is triggered.
200
- *
201
- * @event findPrevious
202
- * @param {String} searchText Search text.
203
- */
204
-
205
- /**
206
- * Fired when the replace button is triggered.
207
- *
208
- * @event replace
209
- * @param {String} replaceText Replacement text.
210
- */
211
-
212
- /**
213
- * Fired when the replaceAll button is triggered.
214
- *
215
- * @event replaceAll
216
- * @param {String} replaceText Replacement text.
217
- */
218
-
219
- /**
220
- * Fired when the toolbar dropdown gets closed.
221
- *
222
- * @event dropdown:closed
223
- */
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 find-and-replace/findandreplaceui
8
+ */
9
+
10
+ import { Plugin } from '@ckeditor/ckeditor5-core';
11
+ import { createDropdown, SplitButtonView } from '@ckeditor/ckeditor5-ui';
12
+ import FindAndReplaceFormView from './ui/findandreplaceformview';
13
+ // See: #8833.
14
+ // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
15
+ import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
16
+ import '../theme/findandreplaceform.css';
17
+
18
+ import loupeIcon from '../theme/icons/find-replace.svg';
19
+
20
+ /**
21
+ * The default find and replace UI. It introduces:
22
+ *
23
+ * * The `'Find and replace'` dropdown button.
24
+ *
25
+ * It registers the `'findAndReplace'` UI button in the editor's {@link module:ui/componentfactory~ComponentFactory component factory}.
26
+ * that uses the {@link module:find-and-replace/findandreplace~FindAndReplace FindAndReplace} plugin API.
27
+ *
28
+ * It emits events depending on user search/replace intents.
29
+ *
30
+ * @extends module:core/plugin~Plugin
31
+ */
32
+ export default class FindAndReplaceUI extends Plugin {
33
+ /**
34
+ * @inheritDoc
35
+ */
36
+ static get pluginName() {
37
+ return 'FindAndReplaceUI';
38
+ }
39
+
40
+ constructor( editor ) {
41
+ super( editor );
42
+
43
+ this.set( 'searchText' );
44
+ this.set( 'replaceText' );
45
+
46
+ this.set( 'isSearching', false );
47
+
48
+ this.set( 'matchCount', null );
49
+ this.set( 'highlightOffset', null );
50
+
51
+ this.bind( 'isSearching' ).to( this, 'matchCount', count => count > 0 );
52
+
53
+ /**
54
+ * The form view will only be assigned if the find and replace toolbar button was added.
55
+ *
56
+ * @member {module:find-and-replace/ui/findandreplaceformview~FindAndReplaceFormView|null} #formView
57
+ */
58
+ this.formView = null;
59
+ }
60
+
61
+ /**
62
+ * @inheritDoc
63
+ */
64
+ init() {
65
+ this.findAndReplacePlugin = this.editor.plugins.get( 'FindAndReplace' );
66
+
67
+ const editor = this.editor;
68
+
69
+ editor.ui.componentFactory.add( 'findAndReplace', locale => {
70
+ const dropdown = createDropdown( locale, SplitButtonView );
71
+
72
+ const formView = new FindAndReplaceFormView( editor.locale );
73
+
74
+ formView.delegate( 'findNext' ).to( this );
75
+ formView.delegate( 'findPrevious' ).to( this );
76
+ formView.delegate( 'replace' ).to( this );
77
+ formView.delegate( 'replaceAll' ).to( this );
78
+
79
+ formView.bind( 'matchCount' ).to( this );
80
+ formView.bind( 'highlightOffset' ).to( this );
81
+
82
+ formView.bind( 'isSearching' ).to( this );
83
+
84
+ this._createToolbarDropdown( dropdown, loupeIcon, formView );
85
+
86
+ dropdown.panelView.children.add( formView );
87
+
88
+ dropdown.on( 'change:isOpen', ( event, name, value ) => {
89
+ if ( !value ) {
90
+ this.fire( 'dropdown:closed' );
91
+ }
92
+ } );
93
+
94
+ this.formView = formView;
95
+
96
+ if ( this._state ) {
97
+ this.unbind( 'isSearching' );
98
+
99
+ const findTextInputView = formView.findInputView.fieldView;
100
+
101
+ // Searching should only be active if there's more than 1 result matched and
102
+ // the user has not changed any search criteria.
103
+ this.bind( 'isSearching' ).to( this, 'matchCount',
104
+ findTextInputView, 'value', this._state, 'searchText',
105
+ formView.matchCaseView, 'isChecked', this._state, 'matchCase',
106
+ formView.matchWholeWordsView, 'isChecked', this._state, 'matchWholeWords',
107
+ ( count,
108
+ viewSearchText, modelSearchText,
109
+ viewMatchCase, modelMatchCase,
110
+ viewWholeWords, modelWholeWords
111
+ ) => {
112
+ return count > 0 &&
113
+ viewSearchText == modelSearchText &&
114
+ viewMatchCase == modelMatchCase &&
115
+ viewWholeWords == modelWholeWords;
116
+ } );
117
+ }
118
+
119
+ editor.keystrokes.set( 'Ctrl+F', ( data, cancelEvent ) => {
120
+ dropdown.buttonView.actionView.fire( 'execute' );
121
+
122
+ cancelEvent();
123
+ } );
124
+
125
+ return dropdown;
126
+ } );
127
+ }
128
+
129
+ /**
130
+ * Sets the observed state object. It is used to display search result count etc.
131
+ *
132
+ * @protected
133
+ * @param {module:find-and-replace/findandreplaceediting~FindAndReplaceState} state State object to be tracked.
134
+ */
135
+ _setState( state ) {
136
+ this._state = state;
137
+
138
+ this.listenTo( state.results, 'change', () => {
139
+ this.set( 'matchCount', state.results.length );
140
+ } );
141
+
142
+ this.bind( 'highlightOffset' ).to( state, 'highlightedResult', highlightedResult => {
143
+ if ( !highlightedResult ) {
144
+ return null;
145
+ }
146
+
147
+ const sortedResults = Array.from( state.results ).sort( ( a, b ) => {
148
+ const mapping = {
149
+ before: -1,
150
+ same: 0,
151
+ after: 1
152
+ };
153
+
154
+ return mapping[ a.marker.getStart().compareWith( b.marker.getStart() ) ];
155
+ } );
156
+
157
+ const index = sortedResults.indexOf( highlightedResult );
158
+
159
+ return index === -1 ?
160
+ null : index + 1;
161
+ } );
162
+ }
163
+
164
+ /**
165
+ * @private
166
+ * @param {module:ui/dropdown/dropdownview~DropdownView} dropdown
167
+ * @param {String} icon An icon to be assigned to the button.
168
+ * @param {module:find-and-replace/ui/findandreplaceformview~FindAndReplaceFormView} formView A related form view.
169
+ */
170
+ _createToolbarDropdown( dropdown, icon, formView ) {
171
+ const t = this.editor.locale.t;
172
+ const buttonView = dropdown.buttonView;
173
+
174
+ // Configure the dropdown's button properties:
175
+ buttonView.set( {
176
+ icon,
177
+ tooltip: t( 'Find and replace' )
178
+ } );
179
+
180
+ // Clicking the main button has the same effect as clicking the dropdown arrow.
181
+ buttonView.actionView.delegate( 'execute' ).to( buttonView.arrowView );
182
+
183
+ // Each time a dropdown is opened, the search text field should get focused.
184
+ buttonView.on( 'open', () => {
185
+ formView.findInputView.fieldView.select();
186
+ formView.focus();
187
+ }, { priority: 'low' } );
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Fired when the find next button is triggered.
193
+ *
194
+ * @event findNext
195
+ * @param {String} searchText Search text.
196
+ */
197
+
198
+ /**
199
+ * Fired when the find previous button is triggered.
200
+ *
201
+ * @event findPrevious
202
+ * @param {String} searchText Search text.
203
+ */
204
+
205
+ /**
206
+ * Fired when the replace button is triggered.
207
+ *
208
+ * @event replace
209
+ * @param {String} replaceText Replacement text.
210
+ */
211
+
212
+ /**
213
+ * Fired when the replaceAll button is triggered.
214
+ *
215
+ * @event replaceAll
216
+ * @param {String} replaceText Replacement text.
217
+ */
218
+
219
+ /**
220
+ * Fired when the toolbar dropdown gets closed.
221
+ *
222
+ * @event dropdown:closed
223
+ */
@@ -0,0 +1,21 @@
1
+ # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ #
3
+ # !!! IMPORTANT !!!
4
+ #
5
+ # Before you edit this file, please keep in mind that contributing to the project
6
+ # translations is possible ONLY via the Transifex online service.
7
+ #
8
+ # To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
9
+ #
10
+ # To learn more, check out the official contributor's guide:
11
+ # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
12
+ #
13
+ msgid ""
14
+ msgstr ""
15
+ "Language-Team: Norwegian (https://www.transifex.com/ckeditor/teams/11143/no/)\n"
16
+ "Language: no\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+
19
+ msgctxt "The label of the source editing feature toolbar button."
20
+ msgid "Source"
21
+ msgstr "Kilde"
@@ -1,50 +1,52 @@
1
- import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
2
- import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
3
- import fullscreenIcon from '../../themes/icons/fullscreen.svg';
4
- import fullscreenExitIcon from '../../themes/icons/fullscreen_exit.svg'
5
- import * as QMSCKEditorService from '../common/qmsCKEditorService';
6
- import * as constant from '../common/qmsCKEditorConstant';
7
-
8
- export default class QMSCKEditorFullscreenPlugin extends Plugin {
9
- init() {
10
- const editor = this.editor;
11
- editor.ui.componentFactory.add('qmsFullscreen', locale => {
12
- const view = new ButtonView(locale);
13
-
14
- view.set({
15
- label: editor.config._config.getTranslateLabel('MAXIMIZE', 'Maximize'),
16
- icon: fullscreenIcon,
17
- tooltip: true
18
- });
19
- const fullscreenClass = this.editor.config.get('fullScreenConfig.class') || 'qmsckeditor__fullscreen';
20
-
21
- view.on('execute', () => {
22
-
23
- const containerId = editor.config._config.containerId;
24
- const ck = window.document.getElementById(containerId);
25
- const isFullscreen = ck && ck.classList.contains(fullscreenClass);
26
- if (!isFullscreen) {
27
- view.set({
28
- label: editor.config._config.getTranslateLabel('MINIMIZE', 'Minimize'),
29
- icon: fullscreenExitIcon,
30
- tooltip: true
31
- });
32
- ck.classList.add(fullscreenClass);
33
- }
34
- else {
35
- view.set({
36
- label: editor.config._config.getTranslateLabel('MAXIMIZE', 'Maximize'),
37
- icon: fullscreenIcon,
38
- tooltip: true
39
- });
40
- if (ck.classList.contains(fullscreenClass)) {
41
- ck.classList.remove(fullscreenClass);
42
- }
43
- }
44
- QMSCKEditorService.fullscreenNotify(isFullscreen);
45
- })
46
-
47
- return view;
48
- })
49
- }
50
- }
1
+ import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
2
+ import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
3
+ import fullscreenIcon from '../../themes/icons/fullscreen.svg';
4
+ import fullscreenExitIcon from '../../themes/icons/fullscreen_exit.svg'
5
+ import * as QMSCKEditorService from '../common/qmsCKEditorService';
6
+ import * as constant from '../common/qmsCKEditorConstant';
7
+
8
+ export default class QMSCKEditorFullscreenPlugin extends Plugin {
9
+ init() {
10
+ const editor = this.editor;
11
+ const t = this.editor.locale.t;
12
+
13
+ editor.ui.componentFactory.add('qmsFullscreen', locale => {
14
+ const view = new ButtonView(locale);
15
+
16
+ view.set({
17
+ label: t('Maximize'),
18
+ icon: fullscreenIcon,
19
+ tooltip: true
20
+ });
21
+ const fullscreenClass = this.editor.config.get('fullScreenConfig.class') || 'qmsckeditor__fullscreen';
22
+
23
+ view.on('execute', () => {
24
+
25
+ const containerId = editor.config._config.containerId;
26
+ const ck = window.document.getElementById(containerId);
27
+ const isFullscreen = ck && ck.classList.contains(fullscreenClass);
28
+ if (!isFullscreen) {
29
+ view.set({
30
+ label: t('Minimize'),
31
+ icon: fullscreenExitIcon,
32
+ tooltip: true
33
+ });
34
+ ck.classList.add(fullscreenClass);
35
+ }
36
+ else {
37
+ view.set({
38
+ label: t('Maximize'),
39
+ icon: fullscreenIcon,
40
+ tooltip: true
41
+ });
42
+ if (ck.classList.contains(fullscreenClass)) {
43
+ ck.classList.remove(fullscreenClass);
44
+ }
45
+ }
46
+ QMSCKEditorService.fullscreenNotify(isFullscreen);
47
+ })
48
+
49
+ return view;
50
+ })
51
+ }
52
+ }