@mediafly/js-ui 47.2.0 → 47.3.1-0

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 (53) hide show
  1. package/CHANGELOG.md +2 -14
  2. package/lib/auto-complete/auto-complete.component.html +2 -1
  3. package/lib/font-selector/font-selector.d.ts +37 -8
  4. package/lib/font-selector/font-selector.html +58 -13
  5. package/lib/font-selector/font-selector.js +174 -17
  6. package/lib/font-selector/font-selector.js.map +1 -1
  7. package/lib/font-selector/google-webfonts-api.service.d.ts +1 -1
  8. package/lib/font-selector/google-webfonts-api.service.js +10 -2
  9. package/lib/font-selector/google-webfonts-api.service.js.map +1 -1
  10. package/lib/font-selector/webfont-loader.service.d.ts +1 -2
  11. package/lib/font-selector/webfont-loader.service.js +2 -2
  12. package/lib/font-selector/webfont-loader.service.js.map +1 -1
  13. package/lib/jsui.module.css +13 -2
  14. package/lib/rich-text/index.d.ts +0 -1
  15. package/lib/rich-text/index.js +0 -1
  16. package/lib/rich-text/index.js.map +1 -1
  17. package/lib/rich-text/rich-text.component.d.ts +2 -2
  18. package/lib/rich-text/rich-text.component.html +6 -14
  19. package/lib/rich-text/rich-text.component.js +6 -5
  20. package/lib/rich-text/rich-text.component.js.map +1 -1
  21. package/lib/styles.css +25 -16
  22. package/lib/tsconfig.deploy.tsbuildinfo +17 -29
  23. package/package.json +2 -2
  24. package/src/components/auto-complete/auto-complete.component.html +2 -1
  25. package/src/components/auto-complete/auto-complete.component.less +2 -1
  26. package/src/components/font-selector/font-selector.html +58 -13
  27. package/src/components/font-selector/font-selector.less +100 -0
  28. package/src/components/font-selector/font-selector.ts +191 -17
  29. package/src/components/font-selector/google-webfonts-api.backend.ts +1 -1
  30. package/src/components/font-selector/google-webfonts-api.service.ts +10 -2
  31. package/src/components/font-selector/webfont-loader.service.ts +2 -2
  32. package/src/components/index.less +1 -1
  33. package/src/components/less/objects/buttons.less +8 -0
  34. package/src/components/less/objects/buttons.module.css +11 -0
  35. package/src/components/less/variables/colors.less +2 -2
  36. package/src/components/less/variables.module.css +2 -2
  37. package/src/components/rich-text/index.ts +0 -1
  38. package/src/components/rich-text/rich-text.component.html +6 -14
  39. package/src/components/rich-text/rich-text.component.less +5 -1
  40. package/src/components/rich-text/rich-text.component.ts +7 -5
  41. package/tsconfig.tsbuildinfo +46 -63
  42. package/.idea/inspectionProfiles/Project_Default.xml +0 -7
  43. package/.idea/jsLinters/jshint.xml +0 -16
  44. package/.idea/mediafly-js-ui.iml +0 -12
  45. package/.idea/modules.xml +0 -8
  46. package/.idea/vcs.xml +0 -6
  47. package/lib/rich-text/rich-text-toolbar-container.component.d.ts +0 -16
  48. package/lib/rich-text/rich-text-toolbar-container.component.html +0 -12
  49. package/lib/rich-text/rich-text-toolbar-container.component.js +0 -75
  50. package/lib/rich-text/rich-text-toolbar-container.component.js.map +0 -1
  51. package/src/components/rich-text/rich-text-toolbar-container.component.html +0 -12
  52. package/src/components/rich-text/rich-text-toolbar-container.component.ts +0 -66
  53. package/src/components/rich-text/rich-text-toolbar-container.less +0 -21
package/CHANGELOG.md CHANGED
@@ -1,17 +1,5 @@
1
1
  ## @mediafly/js-ui changelog
2
2
 
3
- **47.2.0**
4
-
5
- * Buttons: Added small sizing to primary buttons
6
-
7
- **47.1.0**
8
-
9
- * Colors: Tweaked color-danger and color-danger-light values
10
-
11
- **47.0.0**
12
-
13
- * **Breaking:** Update AngularJS to 1.8
14
-
15
3
  **46.3.0**
16
4
 
17
5
  * CSS Modules: Added button module styles
@@ -69,11 +57,11 @@
69
57
 
70
58
  **45.0.1**
71
59
 
72
- * **Breaking:** Add an `o-hero` header typography class and update the font-size for `o-h1` class
60
+ * Add a `o-hero` header typography class and update the font-size for `o-h1` class
73
61
 
74
62
  **44.0.0**
75
63
 
76
- * **Breaking:** Errors: Start handling 400 api errors.
64
+ * Errors: Start handling 400 api errors.
77
65
 
78
66
  **43.4.2**
79
67
 
@@ -27,7 +27,8 @@
27
27
  test-value="$ctrl.inputValue">
28
28
  </auto-complete-match-renderer>
29
29
 
30
- <span ng-class="{ 'is-visible': $ctrl.isFetching }" class="c-auto-complete__spinner fal fa-spin fa-spinner"></span>
30
+ <span ng-class="{ 'is-visible': $ctrl.isFetching }"
31
+ class="far fa-spin fa-spinner c-auto-complete__spinner"></span>
31
32
 
32
33
  <span ng-if="$ctrl.displayClose"
33
34
  ng-click="$ctrl.clear()"
@@ -1,25 +1,54 @@
1
- /// <reference types="google.fonts" />
2
1
  /// <reference types="angular" />
2
+ /// <reference types="angular-mocks" />
3
3
  import GoogleWebfontsApiService from './google-webfonts-api.service';
4
- import { AutoCompleteMatchObject } from '../auto-complete/auto-complete-match-renderer.component';
5
4
  import WebfontLoaderService from './webfont-loader.service';
6
5
  import { TranslateFactory } from '../translate/translate-factory';
7
6
  export interface FontFamilyStyle {
8
7
  'font-family': string;
9
8
  }
10
9
  export default class FontSelectorController implements ng.IComponentController {
10
+ private $document;
11
+ private $element;
12
+ private $timeout;
13
+ private $q;
11
14
  private googleWebfontsApiService;
12
15
  private translateFactory;
13
16
  private webfontLoaderService;
17
+ inputId: string;
14
18
  isDisabled?: boolean;
15
19
  isRequired?: boolean;
16
- onFontSelect: (param: {
17
- font: google.fonts.WebfontFamily;
20
+ fontFamily?: string;
21
+ onFontSelect?: (param: {
22
+ fontFamily: string;
18
23
  }) => void;
24
+ protected delay: number;
25
+ protected googleFonts: string[];
26
+ protected inputValue?: string;
27
+ protected interactionMode: 'mouse' | 'keyboard';
28
+ protected isDropdownVisible: boolean;
29
+ protected isFetching: boolean;
30
+ protected kbSelectedIndex: number;
31
+ protected keyEventElement: HTMLInputElement | null;
32
+ protected loadingFonts: boolean;
19
33
  protected placeholderText: string;
20
- constructor(googleWebfontsApiService: GoogleWebfontsApiService, translateFactory: TranslateFactory, webfontLoaderService: WebfontLoaderService);
21
- protected googleFonts: google.fonts.WebfontFamily[];
34
+ protected matches: string[];
35
+ protected minLength: number;
36
+ protected requiredText: string;
37
+ private debouncedFetchAndSetMatches;
38
+ private inputElement;
39
+ private observer;
40
+ constructor($document: ng.IDocumentService, $element: ng.IAugmentedJQuery, $timeout: ng.ITimeoutService, $q: ng.IQService, googleWebfontsApiService: GoogleWebfontsApiService, translateFactory: TranslateFactory, webfontLoaderService: WebfontLoaderService);
41
+ $onDestroy(): void;
22
42
  $onInit(): void;
23
- protected onFontLookup(value: string): AutoCompleteMatchObject<google.fonts.WebfontFamily>[];
24
- protected onSelect(font: google.fonts.WebfontFamily): void;
43
+ protected clearInput($event: any): void;
44
+ protected clickSelect($event: any): void;
45
+ dropdownWasMousedOver(): void;
46
+ protected inputClick($event: any): void;
47
+ protected inputValueWasChanged(): void;
48
+ protected matchWasSelected(match: string): void;
49
+ protected onFontLookup(value: string): ng.IPromise<string[]>;
50
+ private fetchAndSetMatches;
51
+ private onClickElsewhere;
52
+ private onKeyDown;
53
+ private scrollToMatch;
25
54
  }
@@ -1,13 +1,58 @@
1
- <auto-complete
2
- class="c-font-selector__input"
3
- clear-after-selection="true"
4
- delay="500"
5
- display-close="true"
6
- get-matches="$ctrl.onFontLookup(input)"
7
- input-id="fontLookup"
8
- is-disabled="$ctrl.isDisabled"
9
- is-required="$ctrl.isRequired"
10
- placeholder-text="{{ $ctrl.placeholderText }}"
11
- min-length="2"
12
- on-select="$ctrl.onSelect(value)">
13
- </auto-complete>
1
+ <ng-form class="o-form c-font-selector" novalidate>
2
+
3
+ <div ng-click="$ctrl.clickSelect($event)"
4
+ ng-class="{'is-disabled': $ctrl.isDisabled}"
5
+ class="c-font-selector__select">
6
+
7
+ <div>{{ $ctrl.fontFamily }}</div>
8
+
9
+ <div class="fas fa-sort c-font-selector__select__icon"></div>
10
+ </div>
11
+
12
+ <div
13
+ ng-if="!$ctrl.fontFamily && $ctrl.isRequired"
14
+ class="c-font-selector__warning">{{ $ctrl.requiredText }}
15
+ </div>
16
+
17
+ <div ng-class="{'is-visible': $ctrl.isDropdownVisible }"
18
+ class="c-font-selector__dropdown">
19
+
20
+ <input
21
+ autocapitalize="off"
22
+ autocomplete="off"
23
+ autocorrect="off"
24
+ class="o-form-control c-font-selector__input"
25
+ id="{{ $ctrl.inputId }}"
26
+ name="autocomplete"
27
+ ng-click="$ctrl.inputClick($event)"
28
+ ng-model="$ctrl.inputValue"
29
+ placeholder="{{ $ctrl.placeholderText }}"
30
+ type="text">
31
+
32
+ <span ng-class="{ 'is-visible': $ctrl.isFetching && $ctrl.inputValue.length >= $ctrl.minLength }"
33
+ class="far fa-spin fa-spinner c-font-selector__dropdown__spinner">
34
+ </span>
35
+
36
+ <span ng-if="!$ctrl.isFetching && $ctrl.inputValue.length >= $ctrl.minLength"
37
+ ng-click="$ctrl.clearInput($event)"
38
+ class="c-font-selector__dropdown__close fal fa-times-circle">
39
+ </span>
40
+
41
+ <div ng-mousemove="$ctrl.dropdownWasMousedOver($event)"
42
+ class="c-font-selector__dropdown__matches">
43
+ <div
44
+ class="c-font-selector__match-row"
45
+ data-test="auto-complete-match"
46
+ ng-class="[
47
+ ($ctrl.interactionMode === 'mouse') ? 'with-mouse' : 'with-keyboard',
48
+ { 'is-selected': ($ctrl.kbSelectedIndex === $index) },
49
+ ]"
50
+ ng-style="{'font-family': match}"
51
+ ng-click="$ctrl.matchWasSelected(match)"
52
+ ng-repeat="match in $ctrl.matches">
53
+ <span>{{ match }}</span>
54
+ </div>
55
+ </div>
56
+ </div>
57
+
58
+ </ng-form>
@@ -13,45 +13,198 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
13
  import { Component, Inject, Input, Output } from '../decorators';
14
14
  import GoogleWebfontsApiService from './google-webfonts-api.service';
15
15
  import WebfontLoaderService from './webfont-loader.service';
16
+ import _ from 'lodash';
16
17
  let FontSelectorController = class FontSelectorController {
17
- constructor(googleWebfontsApiService, translateFactory, webfontLoaderService) {
18
+ constructor($document, $element, $timeout, $q, googleWebfontsApiService, translateFactory, webfontLoaderService) {
19
+ this.$document = $document;
20
+ this.$element = $element;
21
+ this.$timeout = $timeout;
22
+ this.$q = $q;
18
23
  this.googleWebfontsApiService = googleWebfontsApiService;
19
24
  this.translateFactory = translateFactory;
20
25
  this.webfontLoaderService = webfontLoaderService;
26
+ this.delay = 500;
27
+ this.interactionMode = 'mouse';
28
+ this.kbSelectedIndex = -1;
29
+ this.keyEventElement = null;
30
+ this.loadingFonts = true;
31
+ this.matches = [];
32
+ this.minLength = 2;
33
+ this.debouncedFetchAndSetMatches = _.debounce(() => this.fetchAndSetMatches(), this.delay);
34
+ this.onClickElsewhere = ($event) => {
35
+ this.$timeout(() => {
36
+ this.isDropdownVisible = false;
37
+ });
38
+ };
39
+ this.onKeyDown = ($event) => this.$timeout(() => {
40
+ this.interactionMode = 'keyboard';
41
+ // Enter with no selection: let the $event through
42
+ if ($event.key === 'Enter' && this.kbSelectedIndex === -1) {
43
+ return;
44
+ }
45
+ // If the dropdown is closed, all we can do is arrow down to open the thing
46
+ if (this.matches.length === 0 && $event.key !== 'ArrowDown') {
47
+ return;
48
+ }
49
+ // Escape: close the dropdown
50
+ if ($event.key === 'Escape') {
51
+ this.matches = [];
52
+ }
53
+ // Arrow down with dropdown closed: fetch matches
54
+ if ($event.key === 'ArrowDown' && this.matches.length === 0) {
55
+ this.fetchAndSetMatches();
56
+ }
57
+ // Arrow keys with dropdown open: move the selection highlight
58
+ if ($event.key === 'ArrowDown' && this.matches.length > 0) {
59
+ const idx = Math.min(this.kbSelectedIndex + 1, this.matches.length - 1);
60
+ this.kbSelectedIndex = idx;
61
+ this.scrollToMatch(idx);
62
+ }
63
+ if ($event.key === 'ArrowUp') {
64
+ const idx = Math.max(this.kbSelectedIndex - 1, 0);
65
+ this.kbSelectedIndex = idx;
66
+ this.scrollToMatch(idx);
67
+ }
68
+ // Enter with a selection: set the selection to the currently highlighted match
69
+ if ($event.key === 'Enter' && this.kbSelectedIndex > -1) {
70
+ const match = this.matches[this.kbSelectedIndex];
71
+ this.matchWasSelected(match);
72
+ $event.preventDefault();
73
+ }
74
+ $event.stopPropagation();
75
+ });
76
+ }
77
+ $onDestroy() {
78
+ if (this.keyEventElement) {
79
+ this.keyEventElement.removeEventListener('input', this.debouncedFetchAndSetMatches);
80
+ this.keyEventElement.removeEventListener('keydown', this.onKeyDown);
81
+ }
82
+ const body = this.$document[0].body;
83
+ body.removeEventListener('click', this.onClickElsewhere);
84
+ this.observer.disconnect();
21
85
  }
22
86
  $onInit() {
87
+ if (!this.inputId) {
88
+ throw new Error(`You must provide a string to key-event-element-id on the AutoCompleteMatchRenderer.`);
89
+ }
23
90
  // set label text
24
91
  this.placeholderText = this.translateFactory.instant('JSUI.SEARCH_FONTS');
92
+ this.requiredText = this.translateFactory.instant('JSUI.REQUIRED');
25
93
  // init list of google fonts
26
94
  this.googleWebfontsApiService.getFontList()
27
- .then(fontList => { this.googleFonts = fontList; });
95
+ .then(fontList => {
96
+ this.googleFonts = fontList.map(f => f.family);
97
+ this.loadingFonts = false;
98
+ });
99
+ const body = this.$document[0].body;
100
+ body.addEventListener('click', this.onClickElsewhere);
101
+ // Set up an observer that will find the input element and attach events when it is present.
102
+ this.observer = new MutationObserver(() => {
103
+ // expect the tag-input component to be defined in a div with the id autocomplete-tag-lookup
104
+ // this allows us to more reliably find the input to listen to when there are multiple instances of this combination
105
+ this.inputElement = this.$element.parent().find(`#${this.inputId}`)[0];
106
+ if (this.inputElement) {
107
+ this.keyEventElement = this.inputElement;
108
+ this.keyEventElement.addEventListener('input', this.debouncedFetchAndSetMatches);
109
+ this.keyEventElement.addEventListener('keydown', this.onKeyDown);
110
+ this.observer.disconnect();
111
+ }
112
+ });
113
+ this.observer.observe(body, { attributes: true, childList: true, characterData: false, subtree: true });
114
+ }
115
+ clearInput($event) {
116
+ this.inputValue = '';
117
+ $event.stopPropagation();
118
+ }
119
+ clickSelect($event) {
120
+ if (this.isDisabled) {
121
+ return;
122
+ }
123
+ this.isDropdownVisible = !this.isDropdownVisible;
124
+ if (this.isDropdownVisible) {
125
+ this.$timeout(() => {
126
+ this.inputElement.focus();
127
+ }, 250);
128
+ }
129
+ $event.stopPropagation();
130
+ }
131
+ // When the user mouses over the dropdown, we should remove any keyboard
132
+ // highlighting, since the mouse hover provides it too.
133
+ dropdownWasMousedOver() {
134
+ this.interactionMode = 'mouse';
135
+ this.kbSelectedIndex = -1;
136
+ }
137
+ inputClick($event) {
138
+ $event.stopPropagation();
139
+ }
140
+ inputValueWasChanged() {
141
+ this.debouncedFetchAndSetMatches();
142
+ }
143
+ matchWasSelected(match) {
144
+ this.matches = [];
145
+ this.kbSelectedIndex = -1;
146
+ this.inputValue = '';
147
+ this.fontFamily = match;
148
+ this.isDropdownVisible = false;
149
+ if (this.onFontSelect) {
150
+ this.onFontSelect({ fontFamily: this.fontFamily });
151
+ }
28
152
  }
29
153
  onFontLookup(value) {
154
+ value = value.toLocaleLowerCase();
155
+ // const fonts: google.fonts.WebfontFamily[] = []
30
156
  const fonts = this.googleFonts.filter(font => {
31
- return font.family.toLowerCase().includes(value.toLowerCase());
157
+ return font.toLowerCase().includes(value);
32
158
  });
33
159
  // load this set with the api service
34
160
  this.webfontLoaderService.loadFonts(fonts);
35
- return fonts.map(font => ({
36
- cssStyle: { 'font-family': font.family },
37
- displayValue: font.family,
38
- value: font
39
- }));
161
+ return this.$q.resolve(fonts);
40
162
  }
41
- onSelect(font) {
42
- this.onFontSelect({ font });
163
+ fetchAndSetMatches() {
164
+ this.isFetching = true;
165
+ const input = this.inputValue || (this.keyEventElement ? this.keyEventElement.value : '');
166
+ if (input.length < this.minLength) {
167
+ this.$timeout(() => {
168
+ this.matches = [];
169
+ });
170
+ return;
171
+ }
172
+ this.isFetching = true;
173
+ // Wrap the entire fetch in a timeout so that fetching callbacks will
174
+ // be called correctly while the async part happens.
175
+ this.$timeout(() => {
176
+ this.$q.when(this.onFontLookup(input))
177
+ .then(matches => {
178
+ this.matches = matches;
179
+ this.isFetching = false;
180
+ });
181
+ });
182
+ }
183
+ scrollToMatch(index) {
184
+ const row = this.$element.find('.c-font-selector__match-row')[index];
185
+ if (row) {
186
+ row.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
187
+ }
43
188
  }
44
189
  };
45
190
  __decorate([
46
- Input(),
191
+ Input('<'),
192
+ __metadata("design:type", String)
193
+ ], FontSelectorController.prototype, "inputId", void 0);
194
+ __decorate([
195
+ Input('<'),
47
196
  __metadata("design:type", Boolean)
48
197
  ], FontSelectorController.prototype, "isDisabled", void 0);
49
198
  __decorate([
50
- Input(),
199
+ Input('<'),
51
200
  __metadata("design:type", Boolean)
52
201
  ], FontSelectorController.prototype, "isRequired", void 0);
53
202
  __decorate([
54
- Output(),
203
+ Input('=?'),
204
+ __metadata("design:type", String)
205
+ ], FontSelectorController.prototype, "fontFamily", void 0);
206
+ __decorate([
207
+ Output('&?'),
55
208
  __metadata("design:type", Function)
56
209
  ], FontSelectorController.prototype, "onFontSelect", void 0);
57
210
  FontSelectorController = __decorate([
@@ -59,10 +212,14 @@ FontSelectorController = __decorate([
59
212
  selector: 'mflyFontSelector',
60
213
  template: require('./font-selector.html')
61
214
  }),
62
- __param(0, Inject('googleWebfontsApiService')),
63
- __param(1, Inject('translateFactory')),
64
- __param(2, Inject('webfontLoaderService')),
65
- __metadata("design:paramtypes", [GoogleWebfontsApiService, Object, WebfontLoaderService])
215
+ __param(0, Inject('$document')),
216
+ __param(1, Inject('$element')),
217
+ __param(2, Inject('$timeout')),
218
+ __param(3, Inject('$q')),
219
+ __param(4, Inject('googleWebfontsApiService')),
220
+ __param(5, Inject('translateFactory')),
221
+ __param(6, Inject('webfontLoaderService')),
222
+ __metadata("design:paramtypes", [Object, Object, Function, Function, GoogleWebfontsApiService, Object, WebfontLoaderService])
66
223
  ], FontSelectorController);
67
224
  export default FontSelectorController;
68
225
  //# sourceMappingURL=font-selector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"font-selector.js","sourceRoot":"","sources":["../../src/components/font-selector/font-selector.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE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/D,sBAAsB,CA6N1C;eA7NoB,sBAAsB"}
@@ -5,5 +5,5 @@ export default class GoogleWebfontsApiService {
5
5
  private $http;
6
6
  private apiSuccessHandler;
7
7
  constructor($http: ng.IHttpService, apiSuccessHandler: ApiSuccessHandler);
8
- getFontList(): ng.IPromise<google.fonts.WebfontFamily[]>;
8
+ getFontList(sort?: string): ng.IPromise<google.fonts.WebfontFamily[]>;
9
9
  }
@@ -17,8 +17,16 @@ let GoogleWebfontsApiService = class GoogleWebfontsApiService {
17
17
  this.$http = $http;
18
18
  this.apiSuccessHandler = apiSuccessHandler;
19
19
  }
20
- getFontList() {
21
- return this.$http.get('https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyB-3EKXiPv1rjJ0Ab3u4s9iUaTqHXMLVOI')
20
+ getFontList(sort) {
21
+ const call = 'https://www.googleapis.com/webfonts/v1/webfonts';
22
+ if (!sort) {
23
+ sort = 'alpha';
24
+ }
25
+ const params = {
26
+ key: 'AIzaSyB-3EKXiPv1rjJ0Ab3u4s9iUaTqHXMLVOI',
27
+ sort,
28
+ };
29
+ return this.$http.get(call, { params })
22
30
  .then((response) => {
23
31
  return this.apiSuccessHandler.response(response).items;
24
32
  });
@@ -1 +1 @@
1
- {"version":3,"file":"google-webfonts-api.service.js","sourceRoot":"","sources":["../../src/components/font-selector/google-webfonts-api.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,iBAAiB,MAAM,2CAA2C,CAAA;AAGzE,IAAqB,wBAAwB,GAA7C,MAAqB,wBAAwB;IAE5C,YAC0B,KAAsB,EACV,iBAAoC;QADhD,UAAK,GAAL,KAAK,CAAiB;QACV,sBAAiB,GAAjB,iBAAiB,CAAmB;IACtE,CAAC;IAGL,WAAW;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAA2B,6FAA6F,CAAC;aAC5I,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YAClB,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAA;QACvD,CAAC,CAAC,CAAA;IACJ,CAAC;CAED,CAAA;AAfoB,wBAAwB;IAD5C,UAAU,CAAC,0BAA0B,CAAC;IAIpC,WAAA,MAAM,CAAC,OAAO,CAAC,CAAA;IACf,WAAA,MAAM,CAAC,mBAAmB,CAAC,CAAA;+CAA4B,iBAAiB;GAJtD,wBAAwB,CAe5C;eAfoB,wBAAwB"}
1
+ {"version":3,"file":"google-webfonts-api.service.js","sourceRoot":"","sources":["../../src/components/font-selector/google-webfonts-api.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,iBAAiB,MAAM,2CAA2C,CAAA;AAGzE,IAAqB,wBAAwB,GAA7C,MAAqB,wBAAwB;IAE5C,YAC0B,KAAsB,EACV,iBAAoC;QADhD,UAAK,GAAL,KAAK,CAAiB;QACV,sBAAiB,GAAjB,iBAAiB,CAAmB;IACtE,CAAC;IAGL,WAAW,CAAC,IAAa;QACxB,MAAM,IAAI,GAAG,iDAAiD,CAAA;QAE9D,IAAI,CAAC,IAAI,EAAE;YAAE,IAAI,GAAG,OAAO,CAAA;SAAE;QAE7B,MAAM,MAAM,GAAG;YACd,GAAG,EAAE,yCAAyC;YAC9C,IAAI;SACJ,CAAA;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAA2B,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC;aAC/D,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YAClB,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAA;QACvD,CAAC,CAAC,CAAA;IACJ,CAAC;CAED,CAAA;AAvBoB,wBAAwB;IAD5C,UAAU,CAAC,0BAA0B,CAAC;IAIpC,WAAA,MAAM,CAAC,OAAO,CAAC,CAAA;IACf,WAAA,MAAM,CAAC,mBAAmB,CAAC,CAAA;+CAA4B,iBAAiB;GAJtD,wBAAwB,CAuB5C;eAvBoB,wBAAwB"}
@@ -1,4 +1,3 @@
1
- /// <reference types="google.fonts" />
2
1
  export default class WebfontLoaderService {
3
- loadFonts(fontList: google.fonts.WebfontFamily[]): void;
2
+ loadFonts(families: string[]): void;
4
3
  }
@@ -7,8 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { Injectable } from '../decorators';
8
8
  import WebFont from 'webfontloader';
9
9
  let WebfontLoaderService = class WebfontLoaderService {
10
- loadFonts(fontList) {
11
- const families = fontList.map(f => f.family);
10
+ loadFonts(families) {
11
+ // const families = fontList.map(f => f.family)
12
12
  let hasFonts = true;
13
13
  try {
14
14
  WebFont.load({
@@ -1 +1 @@
1
- {"version":3,"file":"webfont-loader.service.js","sourceRoot":"","sources":["../../src/components/font-selector/webfont-loader.service.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,OAAO,MAAM,eAAe,CAAA;AAGnC,IAAqB,oBAAoB,GAAzC,MAAqB,oBAAoB;IAGxC,SAAS,CAAC,QAAsC;QAE/C,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;QAC5C,IAAI,QAAQ,GAAG,IAAI,CAAA;QAEnB,IAAI;YACH,OAAO,CAAC,IAAI,CAAC;gBACZ,MAAM,EAAE;oBACP,QAAQ;iBACR;gBACD,OAAO,EAAE,IAAI;aACb,CAAC,CAAA;SACF;QACD,OAAO,GAAG,EAAE;YACX,QAAQ,GAAG,KAAK,CAAA;SAChB;gBACO;YACP,IAAI,QAAQ,EAAE;gBACb,OAAO,CAAC,IAAI,CAAC;oBACZ,MAAM,EAAE;wBACP,QAAQ;qBACR;oBACD,OAAO,EAAE,IAAI;iBACb,CAAC,CAAA;aACF;SACD;IACF,CAAC;CACD,CAAA;AA9BoB,oBAAoB;IADxC,UAAU,CAAC,sBAAsB,CAAC;GACd,oBAAoB,CA8BxC;eA9BoB,oBAAoB"}
1
+ {"version":3,"file":"webfont-loader.service.js","sourceRoot":"","sources":["../../src/components/font-selector/webfont-loader.service.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,OAAO,MAAM,eAAe,CAAA;AAGnC,IAAqB,oBAAoB,GAAzC,MAAqB,oBAAoB;IAGxC,SAAS,CAAC,QAAkB;QAE3B,+CAA+C;QAC/C,IAAI,QAAQ,GAAG,IAAI,CAAA;QAEnB,IAAI;YACH,OAAO,CAAC,IAAI,CAAC;gBACZ,MAAM,EAAE;oBACP,QAAQ;iBACR;gBACD,OAAO,EAAE,IAAI;aACb,CAAC,CAAA;SACF;QACD,OAAO,GAAG,EAAE;YACX,QAAQ,GAAG,KAAK,CAAA;SAChB;gBACO;YACP,IAAI,QAAQ,EAAE;gBACb,OAAO,CAAC,IAAI,CAAC;oBACZ,MAAM,EAAE;wBACP,QAAQ;qBACR;oBACD,OAAO,EAAE,IAAI;iBACb,CAAC,CAAA;aACF;SACD;IACF,CAAC;CACD,CAAA;AA9BoB,oBAAoB;IADxC,UAAU,CAAC,sBAAsB,CAAC;GACd,oBAAoB,CA8BxC;eA9BoB,oBAAoB"}
@@ -32,8 +32,8 @@
32
32
  /* UI colors */
33
33
  --color-success-light: #d8f2e6;
34
34
  --color-success: #008c48;
35
- --color-danger-light: #f7dfe4;
36
- --color-danger: #d90d36;
35
+ --color-danger-light: #f9ebee;
36
+ --color-danger: #89142e;
37
37
  --color-warning-light: #f9e4de;
38
38
  --color-warning: #de6a44;
39
39
  --color-info-light: #d8edf5;
@@ -222,12 +222,23 @@
222
222
  }
223
223
 
224
224
  .button.isSmall {
225
+ background: #fff;
226
+ border: 1px solid var(--color-gray-x-light);
225
227
  border-radius: 16px;
226
228
  font-size: 13px;
227
229
  font-weight: var(--font-weight-regular);
228
230
  height: auto; /* Match the non-module large button height instead of using fixed height of flex button */
229
231
  line-height: 1;
230
232
  padding: 6px 12px;
233
+
234
+ /* We set an explicit background on this button so we need more specificity on the hover style: */
235
+ @media (hover: hover) {
236
+ &:hover {
237
+ background-color: var(--color-button-default-hover-background);
238
+ border-color: var(--color-button-default-hover-border);
239
+ color: var(--color-button-default-text);
240
+ }
241
+ }
231
242
  }
232
243
 
233
244
  .button.isRoundRect {
@@ -1,2 +1 @@
1
1
  import './rich-text.component';
2
- import './rich-text-toolbar-container.component';
@@ -1,3 +1,2 @@
1
1
  import './rich-text.component';
2
- import './rich-text-toolbar-container.component';
3
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/rich-text/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAC9B,OAAO,yCAAyC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/rich-text/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA"}
@@ -1,6 +1,5 @@
1
1
  /// <reference types="angular-sanitize" />
2
2
  /// <reference types="angular-mocks" />
3
- /// <reference types="google.fonts" />
4
3
  import { sanitize } from 'angular';
5
4
  import { FontFamilyStyle } from '../font-selector/font-selector';
6
5
  export default class RichTextComponentController implements ng.IComponentController {
@@ -12,6 +11,7 @@ export default class RichTextComponentController implements ng.IComponentControl
12
11
  protected allowColorSelection?: boolean;
13
12
  protected allowFontSelection?: boolean;
14
13
  protected fontStyle?: FontFamilyStyle;
14
+ protected fontSelectorId: string;
15
15
  protected isRequired: boolean;
16
16
  protected requiredText: string;
17
17
  protected selectedColor: string;
@@ -32,7 +32,7 @@ export default class RichTextComponentController implements ng.IComponentControl
32
32
  $onInit(): void;
33
33
  $postLink(): void;
34
34
  protected colorChanged(): void;
35
- protected fontSelected(font: google.fonts.WebfontFamily): void;
35
+ protected fontSelected(fontFamily: string): void;
36
36
  protected manageValidity(): void;
37
37
  protected onTextChange(_delta: any, _oldContents: any, source: any): void;
38
38
  protected selectionChange(range: any, oldRange: any, source: any): void;
@@ -1,19 +1,11 @@
1
1
  <div id="toolbar" class="c-rich-text">
2
2
 
3
- <span ng-if="$ctrl.allowFontSelection" class="ql-formats">
4
- <mfly:rich-text-toolbar-container>
5
- <mfly:toolbar-icon>
6
- <span ng-style="$ctrl.fontStyle">{{ $ctrl.selectedFont }}</span>
7
- <span class="c-rich-text-sort fas fa-sort"></span>
8
- </mfly:toolbar-icon>
9
- <mfly:toolbar-container>
10
- <mfly:font-selector
11
- label-text="{{ $ctrl.fontLabelText }}"
12
- on-font-select="$ctrl.fontSelected(font)">
13
- </mfly:font-selector>
14
- </mfly:toolbar-container>
15
- </mfly:rich-text-toolbar-container>
16
-
3
+ <span ng-if="$ctrl.allowFontSelection" class="ql-formats c-rich-text-font-container">
4
+ <mfly:font-selector
5
+ input-id="$ctrl.fontSelectorId"
6
+ font-family="$ctrl.selectedFont"
7
+ on-font-select="$ctrl.fontSelected(fontFamily)">
8
+ </mfly:font-selector>
17
9
  </span>
18
10
 
19
11
  <span class="ql-formats">
@@ -43,6 +43,7 @@ export default class RichTextComponentController {
43
43
  this.requiredText = this.translateFactory.instant('JSUI.REQUIRED');
44
44
  this.selectedColor = this.DEFAULT_COLOR;
45
45
  this.selectedFont = this.DEFAULT_FONT;
46
+ this.fontSelectorId = 'rteFontSelector' + Math.floor(Math.random() * 1000 + 1);
46
47
  this.colorPicker = document.getElementById('rteColorInput');
47
48
  this.colorPicker.addEventListener('change', this.colorChanged.bind(this));
48
49
  // programatically reset size
@@ -80,14 +81,14 @@ export default class RichTextComponentController {
80
81
  colorChanged() {
81
82
  this.applyColor();
82
83
  }
83
- fontSelected(font) {
84
- if (font.family) {
84
+ fontSelected(fontFamily) {
85
+ if (fontFamily) {
85
86
  this.$rootScope.$broadcast('richTextToolbarContainer:closeContainer');
86
87
  const fontAtributor = Quill.import('attributors/style/font');
87
- fontAtributor.whitelist = [font.family];
88
- this.updateFontDisplay(font.family);
88
+ fontAtributor.whitelist = [fontFamily];
89
+ this.updateFontDisplay(fontFamily);
89
90
  Quill.register(fontAtributor, true);
90
- this.editor.format('font', font.family);
91
+ this.editor.format('font', fontFamily);
91
92
  this.sanitizeContents();
92
93
  }
93
94
  }