@atlassian/aui 8.7.2 → 8.7.5

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.
@@ -1,6 +1,6 @@
1
1
  export * from './aui.side-effects';
2
2
  export { log, error, warn } from './behaviours/aui.behaviour.logger';
3
- import {i18n as I18n} from './behaviours/aui.behaviour.i18n';
3
+ import { I18n } from './behaviours/aui.behaviour.i18n';
4
4
  import './aui.batch.page';
5
5
  import './aui.batch.patterns';
6
6
  import './aui.batch.iconography';
@@ -1 +1 @@
1
- export {default as i18n} from '@atlassian/aui/src/js/aui/i18n';
1
+ export { I18n } from '@atlassian/aui/src/js/aui/i18n';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@atlassian/aui",
3
3
  "description": "Atlassian User Interface library",
4
- "version": "8.7.2",
4
+ "version": "8.7.5",
5
5
  "author": "Atlassian Pty Ltd.",
6
6
  "homepage": "https://aui.atlassian.com",
7
7
  "license": "Apache-2.0",
@@ -38,12 +38,12 @@
38
38
  "backbone": "1.4.0",
39
39
  "css.escape": "1.5.0",
40
40
  "fancy-file-input": "2.0.4",
41
- "jquery-ui": "1.12.1",
41
+ "jquery-ui": "1.13.0",
42
42
  "popper.js": "1.16.1",
43
43
  "skatejs": "0.13.17",
44
44
  "skatejs-template-html": "0.0.0",
45
45
  "trim-extra-html-whitespace": "1.3.0",
46
- "underscore": "1.9.2"
46
+ "underscore": "1.13.1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@atlassian/adg-server-iconfont": "3.1.0",
@@ -51,12 +51,12 @@
51
51
  "babel-core": "^6.26.0",
52
52
  "babel-plugin-add-module-exports": "0.2.1",
53
53
  "babel-preset-es2015": "6.24.1",
54
- "cross-env": "7.0.3",
55
- "eslint": "^4.10.0",
54
+ "cross-env": "^7.0.3",
55
+ "eslint": "^7.32.0",
56
56
  "glob": "7.1.2",
57
- "jquery": "3.5.1",
58
- "jquery-migrate": "3.3.2",
59
- "less": "^3.10.3",
57
+ "jquery": "^3.5.1",
58
+ "jquery-migrate": "^3.3.2",
59
+ "less": "^4.1.2",
60
60
  "webpack-bundle-size-limit-plugin": "^1.1.0"
61
61
  },
62
62
  "scripts": {
@@ -7,7 +7,7 @@ import keys from './internal/i18n/aui';
7
7
  * the key is returned - this could occur in plugin mode if the I18n transform is not performed;
8
8
  * or in flatpack mode if the i18n JS file is not loaded.
9
9
  */
10
- export var I18n = {
10
+ const I18n = {
11
11
  keys: keys,
12
12
  getText: function (key, ...params) {
13
13
  if (Object.prototype.hasOwnProperty.call(this.keys, key)) {
@@ -18,6 +18,11 @@ export var I18n = {
18
18
  }
19
19
  };
20
20
 
21
+ export {
22
+ I18n,
23
+ format
24
+ }
25
+
21
26
  /**
22
27
  * Deprecated - do not use AJS.I18n.getText from global scope within AUI code. Use import { I18n } from '../i18n'
23
28
  * Also keep in mind that WRM is looking for patterns like "I18n.getText" so do not create
@@ -1,9 +1,26 @@
1
1
  const NAMESPACE = 'AJS';
2
+ const I18N_OBJECT_NAME = 'I18n';
2
3
 
3
- export default function globalize (name, value) {
4
+ function initNamespace() {
4
5
  if (typeof window[NAMESPACE] !== 'object') {
5
6
  window[NAMESPACE] = {};
6
7
  }
8
+ }
9
+
10
+ export default function globalize (name, value) {
11
+ initNamespace();
7
12
 
8
13
  return window[NAMESPACE][name] = value;
9
14
  }
15
+
16
+ export function putOnI18nIfAbsent (name, value) {
17
+ initNamespace();
18
+
19
+ if (typeof window[NAMESPACE][I18N_OBJECT_NAME] !== 'object') {
20
+ window[NAMESPACE][I18N_OBJECT_NAME] = {};
21
+ }
22
+
23
+ if (typeof window[NAMESPACE][I18N_OBJECT_NAME][name] === 'undefined') {
24
+ window[NAMESPACE][I18N_OBJECT_NAME][name] = value;
25
+ }
26
+ }
@@ -136,6 +136,9 @@ $.fn.ajaxSubmit = function(options) {
136
136
  var oldSuccess = options.success || function(){};
137
137
  callbacks.push(function(data) {
138
138
  var fn = options.replaceTarget ? 'replaceWith' : 'html';
139
+ // Validate `data` through `HTML encoding` when passed `data` is passed
140
+ // to `html()`, as suggested in https://github.com/jquery-form/form/issues/464
141
+ fn == 'html' ? data = $.parseHTML($("<div>").text(data).html()) : '';
139
142
  $(options.target)[fn](data).each(oldSuccess, arguments);
140
143
  });
141
144
  }
@@ -428,7 +431,10 @@ $.fn.ajaxSubmit = function(options) {
428
431
  return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
429
432
  };
430
433
  var parseJSON = $.parseJSON || function(s) {
431
- return window['eval']('(' + s + ')');
434
+ // Arise an error resolvable including jquery instead of
435
+ // making a new function using unsanitized inputs
436
+ window.console.error('jquery.parseJSON is undefined');
437
+ return null;
432
438
  };
433
439
 
434
440
  var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4