@mediafly/js-ui 49.0.3 → 50.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediafly/js-ui",
3
- "version": "49.0.3",
3
+ "version": "50.0.0",
4
4
  "license": "UNLICENSED",
5
5
  "description": "UI components for Mediafly Angular applications",
6
6
  "repository": {
@@ -35,6 +35,7 @@
35
35
  "webfontloader": "1.6.28"
36
36
  },
37
37
  "devDependencies": {
38
+ "@bahmutov/cypress-esbuild-preprocessor": "2.2.0",
38
39
  "@mediafly/angularjs-test-utils": "1.1.0",
39
40
  "@mediafly/stylelint-config": "1.1.0",
40
41
  "@mediafly/tslint-config": "2.0.0",
@@ -54,45 +55,46 @@
54
55
  "babel-loader": "7.1.3",
55
56
  "babel-plugin-angularjs-annotate": "0.10.0",
56
57
  "babel-preset-env": "1.6.1",
57
- "clean-webpack-plugin": "3.0.0",
58
- "copy-webpack-plugin": "6.3.2",
58
+ "copy-webpack-plugin": "11.0.0",
59
59
  "cpx": "1.5.0",
60
- "css-loader": "5.2.6",
61
- "cypress": "5.6.0",
60
+ "css-loader": "6.7.3",
61
+ "css-minimizer-webpack-plugin": "5.0.1",
62
+ "cypress": "12.12.0",
63
+ "esbuild": "0.18.15",
62
64
  "file-loader": "6.2.0",
63
- "fork-ts-checker-webpack-plugin": "6.2.1",
64
- "html-webpack-plugin": "4.5.1",
65
+ "fork-ts-checker-webpack-plugin": "8.0.0",
66
+ "html-webpack-plugin": "5.5.0",
65
67
  "import-glob-loader": "1.1.0",
66
- "is-ci": "2.0.0",
67
68
  "jasmine-core": "3.6.0",
68
- "karma": "5.2.3",
69
- "karma-chrome-launcher": "3.1.0",
70
- "karma-jasmine": "4.0.1",
69
+ "karma": "6.3.4",
70
+ "karma-chrome-launcher": "2.2.0",
71
+ "karma-jasmine": "1.1.0",
71
72
  "karma-junit-reporter": "2.0.1",
72
- "karma-webpack": "4.0.2",
73
- "less": "3.12.2",
74
- "less-loader": "6.2.0",
75
- "mini-css-extract-plugin": "0.9.0",
73
+ "karma-mocha-reporter": "2.2.3",
74
+ "karma-webpack": "5.0.0",
75
+ "less": "4.1.3",
76
+ "less-loader": "11.1.3",
77
+ "mini-css-extract-plugin": "2.7.5",
76
78
  "portfinder-sync": "0.0.2",
77
- "postcss-import": "12.0.0",
78
- "postcss-loader": "3.0.0",
79
- "postcss-modules-values": "3.0.0",
79
+ "postcss": "8.4.21",
80
+ "postcss-loader": "7.1.0",
81
+ "postcss-modules-values": "4.0.0",
82
+ "postcss-nested": "6.0.1",
80
83
  "raw-loader": "4.0.1",
81
84
  "release-it": "14.11.8",
82
85
  "rimraf": "3.0.2",
83
86
  "stylelint": "13.13.1",
84
87
  "stylelint-webpack-plugin": "2.2.2",
85
- "ts-loader": "8.0.11",
88
+ "ts-loader": "9.4.2",
86
89
  "tsconfig-paths-webpack-plugin": "3.3.0",
87
90
  "tslint": "6.1.2",
88
91
  "tslint-loader": "3.5.4",
89
92
  "typescript": "4.2.4",
90
- "wait-on": "5.3.0",
91
- "webpack": "4.46.0",
92
- "webpack-cli": "3.3.12",
93
+ "wait-on": "7.0.1",
94
+ "webpack": "5.88.2",
95
+ "webpack-cli": "5.1.4",
93
96
  "webpack-concat-files-plugin": "0.5.2",
94
- "webpack-dev-server": "3.11.2",
95
- "webpack-fix-style-only-entries": "0.6.0",
97
+ "webpack-dev-server": "4.15.1",
96
98
  "webpack-merge": "5.4.0",
97
99
  "write-file-webpack-plugin": "4.5.1"
98
100
  },
@@ -100,24 +102,19 @@
100
102
  "fsevents": "2.1.2"
101
103
  },
102
104
  "scripts": {
103
- "build": "webpack --config webpack.config.js",
105
+ "build": "webpack",
104
106
  "build-for-release": "npm run clean:lib && npm run ts:deploy && npm run build && node ./tasks/copy-standalone-files",
105
107
  "clean:lib": "rimraf lib",
106
108
  "cypress": "cypress open",
107
109
  "cypress:run": "cypress run",
108
- "cypress:ci": "node tasks/cypress-ci",
110
+ "cypress:ci": "node tasks/cypress-ci.js",
109
111
  "karma": "karma start",
110
- "postinstall": "npm install --no-save @mediafly/frontend-certs",
111
- "pree2e": "webdriver-manager update",
112
- "prestart": "frontend-certs trust",
112
+ "prestart": "npx --yes @mediafly/frontend-certs@latest copy .certs && npx @mediafly/frontend-certs@latest trust",
113
113
  "release": "release-it --verbose",
114
114
  "release:beta": "release-it --preRelease=beta --verbose",
115
- "start": "webpack-dev-server",
115
+ "start": "webpack serve",
116
116
  "test": "karma start --single-run",
117
117
  "test:watch": "karma start",
118
118
  "ts:deploy": "tsc --project tsconfig.deploy.json"
119
- },
120
- "cypress-cucumber-preprocessor": {
121
- "nonGlobalStepDefinitions": true
122
119
  }
123
120
  }
@@ -2,7 +2,7 @@ import angular from 'angular'
2
2
  import moment from 'moment'
3
3
  import Pikaday from 'pikaday'
4
4
  import { recursivelySetPristine } from '../form-validation-utils/form-validation-utils'
5
- import { TranslateFactory } from '../translate/translate-factory'
5
+ import type { TranslateFactory } from '../translate/translate-factory'
6
6
 
7
7
  interface PikadayInstance {
8
8
  hide: () => void
@@ -1,6 +1,6 @@
1
1
  import _ from 'lodash'
2
2
  import { Component, Inject, Input, Output } from '../decorators'
3
- import { TranslateFactory } from '../translate/translate-factory'
3
+ import type { TranslateFactory } from '../translate/translate-factory'
4
4
 
5
5
  export type MFDropdownInputEnumOption = { id: MFDropdownInputOptionValue, label: string } | string
6
6
  export type MFDropdownInputOption = { id: MFDropdownInputOptionValue, label: string }
@@ -1,7 +1,7 @@
1
1
  import { Component, Inject, Input, Output } from '../decorators'
2
2
  import GoogleWebfontsApiService from './google-webfonts-api.service'
3
3
  import WebfontLoaderService from './webfont-loader.service'
4
- import { TranslateFactory } from '../translate/translate-factory'
4
+ import type { TranslateFactory } from '../translate/translate-factory'
5
5
  import _ from 'lodash'
6
6
 
7
7
  export interface FontFamilyStyle {
@@ -5,7 +5,7 @@ import $ from 'jquery'
5
5
  import { FontFamilyStyle } from '../font-selector/font-selector'
6
6
 
7
7
  // text editor requires sanitization but also needs to allow for style attributes which are removed by default
8
- angular.module('app').config(($sanitizeProvider: ng.sanitize.ISanitizeProvider ) => {
8
+ angular.module('app').config(($sanitizeProvider: ng.sanitize.ISanitizeProvider) => {
9
9
  $sanitizeProvider.addValidAttrs(['style'])
10
10
  })
11
11
 
@@ -74,7 +74,7 @@ export default class RichTextComponentController implements ng.IComponentControl
74
74
  Quill.register(Quill.import('attributors/style/color'), true)
75
75
 
76
76
  const fontStyle = Quill.import('attributors/style/font')
77
- fontStyle.whitelist = [ this.DEFAULT_FONT, 'Poppins']
77
+ fontStyle.whitelist = null // fonts not in the allow-list get dropped on other edits (CE-6314)
78
78
  Quill.register(fontStyle, true)
79
79
 
80
80
  const fontSizeArr = ['10px','12px','14px','16px','20px','24px','32px','42px','54px','68px','84px','98px']
@@ -82,8 +82,6 @@ export default class RichTextComponentController implements ng.IComponentControl
82
82
  Size.whitelist = fontSizeArr
83
83
  Quill.register(Size, true)
84
84
 
85
-
86
-
87
85
  const options = {
88
86
  modules: {
89
87
  toolbar: '#toolbar'
@@ -121,30 +119,29 @@ export default class RichTextComponentController implements ng.IComponentControl
121
119
  }
122
120
 
123
121
  protected fontSelected(fontFamily: string): void {
124
- if (fontFamily) {
125
122
 
126
- this.$rootScope.$broadcast('richTextToolbarContainer:closeContainer')
127
- const fontAtributor = Quill.import('attributors/style/font')
128
- fontAtributor.whitelist = [fontFamily]
129
- this.updateFontDisplay(fontFamily)
130
- Quill.register(fontAtributor, true)
131
- this.editor.format('font', fontFamily)
123
+ if (!fontFamily) { return }
132
124
 
133
- this.sanitizeContents()
134
- }
135
- }
125
+ this.$rootScope.$broadcast('richTextToolbarContainer:closeContainer')
126
+ const fontAtributor = Quill.import('attributors/style/font')
127
+ fontAtributor.whitelist = [fontFamily]
128
+ this.updateFontDisplay(fontFamily)
129
+ Quill.register(fontAtributor, true)
130
+ this.editor.format('font', fontFamily)
136
131
 
132
+ this.sanitizeContents()
133
+ }
137
134
 
138
135
  protected manageValidity(): void {
136
+
139
137
  const isValid = !this.isRequired || !!this.ngModelCtrl.$viewValue
140
138
 
141
139
  this.ngModelCtrl.$setValidity('required', isValid)
142
140
  }
143
141
 
144
142
  protected onTextChange(_delta, _oldContents, source): void {
145
- if (source !== 'user') { return }
146
143
 
147
- const selection = this.editor.getSelection()
144
+ if (source !== 'user') { return }
148
145
 
149
146
  const userClearedEditor = (this.editor.root.innerHTML === `<p><br></p>`)
150
147
  if (userClearedEditor) {
@@ -159,7 +156,9 @@ export default class RichTextComponentController implements ng.IComponentControl
159
156
 
160
157
  this.sanitizeContents()
161
158
 
159
+ const selection = this.editor.getSelection()
162
160
  if (!selection) { return }
161
+
163
162
  const format = this.editor.getFormat(selection.index, 0)
164
163
  // the following checks for an empty formatting
165
164
  if (_.isEmpty(format)) {
@@ -219,12 +218,14 @@ export default class RichTextComponentController implements ng.IComponentControl
219
218
  }
220
219
 
221
220
  private sanitizeContents(): void {
221
+
222
222
  const html = this.$sanitize(this.editor.root.innerHTML)
223
223
  this.ngModelCtrl.$setViewValue(html)
224
224
  this.manageValidity()
225
225
  }
226
226
 
227
227
  private formatToDefaults() {
228
+
228
229
  this.updateFontDisplay(this.DEFAULT_FONT)
229
230
  this.editor.format('color', this.DEFAULT_COLOR)
230
231
  this.editor.format('size', this.DEFAULT_SIZE)
@@ -239,6 +240,7 @@ export default class RichTextComponentController implements ng.IComponentControl
239
240
  }
240
241
 
241
242
  private updateFontDisplay(fontFamily: string): void {
243
+
242
244
  this.selectedFont = fontFamily
243
245
  this.fontStyle = {
244
246
  'font-family': fontFamily
package/src/index.js CHANGED
@@ -20,6 +20,4 @@ angular.module('app', angularModules)
20
20
  require('./app')
21
21
  require('./components')
22
22
 
23
- if (!process.env.isProd) {
24
- require('angular-mocks')
25
- }
23
+ require('angular-mocks')
package/tsconfig.json CHANGED
@@ -23,7 +23,6 @@
23
23
  },
24
24
  "include": [
25
25
  "src/**/*.ts",
26
- "src/**/*.tsx",
27
26
  "typings/**/*.ts"
28
27
  ],
29
28
  "exclude": [