@atlassian/aui 8.7.0 → 8.7.4

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.0",
4
+ "version": "8.7.4",
5
5
  "author": "Atlassian Pty Ltd.",
6
6
  "homepage": "https://aui.atlassian.com",
7
7
  "license": "Apache-2.0",
@@ -28,21 +28,22 @@
28
28
  "README.md",
29
29
  "yarn.lock"
30
30
  ],
31
+ "//": "AUI's publishConfig is managed by its build scripts.",
31
32
  "peerDependencies": {
32
33
  "jquery": "^2 || ^3"
33
34
  },
34
35
  "dependencies": {
35
- "@atlassian/brand-logos": "^1.2.0",
36
- "@atlassian/tipsy": "^1.3.1",
37
- "backbone": "^1.3.3",
36
+ "@atlassian/brand-logos": "1.2.0",
37
+ "@atlassian/tipsy": "1.3.3",
38
+ "backbone": "1.4.0",
38
39
  "css.escape": "1.5.0",
39
- "fancy-file-input": "~2.0.4",
40
- "jquery-ui": "^1.12.1",
41
- "popper.js": "^1.14.5",
40
+ "fancy-file-input": "2.0.4",
41
+ "jquery-ui": "1.12.1",
42
+ "popper.js": "1.16.1",
42
43
  "skatejs": "0.13.17",
43
44
  "skatejs-template-html": "0.0.0",
44
45
  "trim-extra-html-whitespace": "1.3.0",
45
- "underscore": "^1.9.1"
46
+ "underscore": "1.13.1"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@atlassian/adg-server-iconfont": "3.1.0",
@@ -50,11 +51,11 @@
50
51
  "babel-core": "^6.26.0",
51
52
  "babel-plugin-add-module-exports": "0.2.1",
52
53
  "babel-preset-es2015": "6.24.1",
53
- "cross-env": "^5.1.3",
54
+ "cross-env": "7.0.3",
54
55
  "eslint": "^4.10.0",
55
56
  "glob": "7.1.2",
56
- "jquery": "^3",
57
- "jquery-migrate": "^3",
57
+ "jquery": "3.5.1",
58
+ "jquery-migrate": "3.3.2",
58
59
  "less": "^3.10.3",
59
60
  "webpack-bundle-size-limit-plugin": "^1.1.0"
60
61
  },
@@ -12,6 +12,7 @@ import keyCode from './key-code';
12
12
  import layer from './layer';
13
13
  import state from './internal/state';
14
14
  import skate from './internal/skate';
15
+ import escapeHtml from './escape-html';
15
16
  import {ifGone} from './internal/elements';
16
17
  import {doIfTrigger, setTrigger} from './trigger';
17
18
 
@@ -55,7 +56,7 @@ function makeAsyncDropdownContents (json) {
55
56
  var itemHtml = `
56
57
  <${tagName} ${makeAttribute('for')} ${makeAttribute('href')} ${makeBooleanAttribute('interactive')}
57
58
  ${makeBooleanAttribute('checked')} ${makeBooleanAttribute('disabled')} ${makeBooleanAttribute('hidden')}>
58
- ${itemData.content}
59
+ ${escapeHtml(itemData.content)}
59
60
  </${tagName}>`;
60
61
 
61
62
  return itemHtml;
@@ -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
@@ -207,7 +207,7 @@ $.fn.closeMessage = function () {
207
207
  var $message = $(this);
208
208
  if ($message.hasClass('aui-message') && $message.hasClass('closeable')) {
209
209
  $message.stop(true); //Stop any running animation
210
- $message.trigger('messageClose', [this]); //messageClose event Deprecated as of 5.3
210
+ $message.trigger('messageClose', [this]); //messageClose event Deprecated as of 5.3
211
211
  $message.remove();
212
212
  $(document).trigger('aui-message-close', [this]); //must trigger on document since the element has been removed
213
213
  }
@@ -251,7 +251,9 @@ var RestfulTable = Backbone.View.extend({
251
251
  this._applyFocusCoordinator(this._createRow);
252
252
 
253
253
  // focus create row
254
- this._createRow.trigger(this._event.FOCUS);
254
+ if (this.options.autoFocus) {
255
+ this._createRow.trigger(this._event.FOCUS);
256
+ }
255
257
  }
256
258
 
257
259
  // when a model is removed from the collection, remove it from the viewport also
@@ -204,6 +204,7 @@ function initialiseProgressiveDataSet (element) {
204
204
  // 2. Async fetching and matching
205
205
  /* eslint-disable complexity */
206
206
  element._progressiveDataSet.on('respond', function (data) {
207
+ /*eslint complexity: ["error", 17]*/
207
208
  var optionToHighlight;
208
209
 
209
210
  // This means that a query was made before the input was cleared and
@@ -442,7 +442,8 @@ var tabs = {
442
442
  },
443
443
 
444
444
  change: function (a) {
445
- var $a = $(a);
445
+ var collection = a instanceof HTMLElement || a instanceof $ ? a : document.querySelector(a);
446
+ var $a = $(collection).first();
446
447
  var $tabGroup = $a.closest('.aui-tabs');
447
448
 
448
449
  switchToTab($a);
@@ -3,6 +3,7 @@ import keyCode from './key-code';
3
3
  import amdify from './internal/amdify';
4
4
  import skate from './internal/skate';
5
5
  import state from './internal/state';
6
+ import { warn } from './internal/log'
6
7
 
7
8
  export function getTrigger (element) {
8
9
  return state(element).get('last-trigger') || findControllers(element)[0];
@@ -39,12 +40,28 @@ function findControllers(element) {
39
40
  const selector = `[aria-controls="${element.id}"]`;
40
41
 
41
42
  let controllers = [];
43
+ let someFramesAreCrossOrigin = false;
42
44
  for (let i = 0 ; i < frames.length; i++) {
43
- let nodeList = frames[i].document.querySelectorAll(selector);
44
- controllers = controllers.concat(Array.prototype.slice.apply(nodeList));
45
+ try {
46
+ let nodeList = frames[i].document.querySelectorAll(selector);
47
+ controllers = controllers.concat(Array.prototype.slice.apply(nodeList));
48
+ } catch (e) {
49
+ // Silently catch DOM exceptions related to accessing cross-origin frames
50
+ someFramesAreCrossOrigin = true;
51
+ }
45
52
  }
46
53
  const currentDocumentControllers = document.querySelectorAll(selector);
47
- return Array.prototype.slice.apply(currentDocumentControllers).concat(controllers);
54
+ const allControllers = Array.prototype.slice.apply(currentDocumentControllers).concat(controllers);
55
+ if (allControllers.length === 0 && someFramesAreCrossOrigin === true) {
56
+ warn(
57
+ [
58
+ `No triggers found for element (${element.id}) in iframes from the same origin.`,
59
+ 'However some iframes in this document are cross-origin.',
60
+ 'The trigger-element relations crossing the origin boundary are not supported.'
61
+ ].join(' ')
62
+ )
63
+ }
64
+ return allControllers;
48
65
  }
49
66
 
50
67
  function findControlled(trigger) {