superdesk-ui-framework 2.4.16 → 2.4.17

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.
@@ -158,7 +158,6 @@ export const Dropdown = ({
158
158
  if (toggleRef && menuRef) {
159
159
  createPopper(toggleRef, menuRef, {
160
160
  placement: checkAlign() ? 'bottom-end' : 'bottom-start',
161
- strategy: 'fixed',
162
161
  });
163
162
  menuRef.style.display = 'block';
164
163
  }
@@ -38576,13 +38576,21 @@ function mapToStyles(_ref2) {
38576
38576
  adaptive = _ref2.adaptive,
38577
38577
  roundOffsets = _ref2.roundOffsets,
38578
38578
  isFixed = _ref2.isFixed;
38579
+ var _offsets$x = offsets.x,
38580
+ x = _offsets$x === void 0 ? 0 : _offsets$x,
38581
+ _offsets$y = offsets.y,
38582
+ y = _offsets$y === void 0 ? 0 : _offsets$y;
38579
38583
 
38580
- var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
38581
- _ref3$x = _ref3.x,
38582
- x = _ref3$x === void 0 ? 0 : _ref3$x,
38583
- _ref3$y = _ref3.y,
38584
- y = _ref3$y === void 0 ? 0 : _ref3$y;
38584
+ var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
38585
+ x: x,
38586
+ y: y
38587
+ }) : {
38588
+ x: x,
38589
+ y: y
38590
+ };
38585
38591
 
38592
+ x = _ref3.x;
38593
+ y = _ref3.y;
38586
38594
  var hasX = offsets.hasOwnProperty('x');
38587
38595
  var hasY = offsets.hasOwnProperty('y');
38588
38596
  var sideX = __WEBPACK_IMPORTED_MODULE_0__enums_js__["l" /* left */];
@@ -38627,6 +38635,17 @@ function mapToStyles(_ref2) {
38627
38635
  position: position
38628
38636
  }, adaptive && unsetSides);
38629
38637
 
38638
+ var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
38639
+ x: x,
38640
+ y: y
38641
+ }) : {
38642
+ x: x,
38643
+ y: y
38644
+ };
38645
+
38646
+ x = _ref4.x;
38647
+ y = _ref4.y;
38648
+
38630
38649
  if (gpuAcceleration) {
38631
38650
  var _Object$assign;
38632
38651
 
@@ -38636,9 +38655,9 @@ function mapToStyles(_ref2) {
38636
38655
  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
38637
38656
  }
38638
38657
 
38639
- function computeStyles(_ref4) {
38640
- var state = _ref4.state,
38641
- options = _ref4.options;
38658
+ function computeStyles(_ref5) {
38659
+ var state = _ref5.state,
38660
+ options = _ref5.options;
38642
38661
  var _options$gpuAccelerat = options.gpuAcceleration,
38643
38662
  gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
38644
38663
  _options$adaptive = options.adaptive,
@@ -60369,7 +60388,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
60369
60388
  if (checkerResult == null) {
60370
60389
  return null;
60371
60390
  }
60372
- if (checkerResult.data.hasOwnProperty('expectedType')) {
60391
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
60373
60392
  expectedTypes.push(checkerResult.data.expectedType);
60374
60393
  }
60375
60394
  }
@@ -71953,7 +71972,6 @@ exports.Dropdown = function (_a) {
71953
71972
  if (toggleRef && menuRef) {
71954
71973
  core_1.createPopper(toggleRef, menuRef, {
71955
71974
  placement: checkAlign() ? 'bottom-end' : 'bottom-start',
71956
- strategy: 'fixed',
71957
71975
  });
71958
71976
  menuRef.style.display = 'block';
71959
71977
  }
@@ -72186,7 +72204,7 @@ function getClippingParents(element) {
72186
72204
 
72187
72205
 
72188
72206
  return clippingParents.filter(function (clippingParent) {
72189
- return Object(__WEBPACK_IMPORTED_MODULE_7__instanceOf_js__["a" /* isElement */])(clippingParent) && Object(__WEBPACK_IMPORTED_MODULE_10__contains_js__["a" /* default */])(clippingParent, clipperElement) && Object(__WEBPACK_IMPORTED_MODULE_11__getNodeName_js__["a" /* default */])(clippingParent) !== 'body' && (canEscapeClipping ? Object(__WEBPACK_IMPORTED_MODULE_6__getComputedStyle_js__["a" /* default */])(clippingParent).position !== 'static' : true);
72207
+ return Object(__WEBPACK_IMPORTED_MODULE_7__instanceOf_js__["a" /* isElement */])(clippingParent) && Object(__WEBPACK_IMPORTED_MODULE_10__contains_js__["a" /* default */])(clippingParent, clipperElement) && Object(__WEBPACK_IMPORTED_MODULE_11__getNodeName_js__["a" /* default */])(clippingParent) !== 'body';
72190
72208
  });
72191
72209
  } // Gets the maximum area that the element is visible in due to any number of
72192
72210
  // clipping parents
@@ -100678,7 +100696,7 @@ var _self = (typeof window !== 'undefined')
100678
100696
  var Prism = (function (_self) {
100679
100697
 
100680
100698
  // Private helper vars
100681
- var lang = /\blang(?:uage)?-([\w-]+)\b/i;
100699
+ var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
100682
100700
  var uniqueId = 0;
100683
100701
 
100684
100702
  // The grammar object for plaintext
@@ -100708,6 +100726,27 @@ var Prism = (function (_self) {
100708
100726
  * @public
100709
100727
  */
100710
100728
  manual: _self.Prism && _self.Prism.manual,
100729
+ /**
100730
+ * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
100731
+ * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
100732
+ * own worker, you don't want it to do this.
100733
+ *
100734
+ * By setting this value to `true`, Prism will not add its own listeners to the worker.
100735
+ *
100736
+ * You obviously have to change this value before Prism executes. To do this, you can add an
100737
+ * empty Prism object into the global scope before loading the Prism script like this:
100738
+ *
100739
+ * ```js
100740
+ * window.Prism = window.Prism || {};
100741
+ * Prism.disableWorkerMessageHandler = true;
100742
+ * // Load Prism's script
100743
+ * ```
100744
+ *
100745
+ * @default false
100746
+ * @type {boolean}
100747
+ * @memberof Prism
100748
+ * @public
100749
+ */
100711
100750
  disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
100712
100751
 
100713
100752
  /**
@@ -100822,15 +100861,33 @@ var Prism = (function (_self) {
100822
100861
  * @returns {string}
100823
100862
  */
100824
100863
  getLanguage: function (element) {
100825
- while (element && !lang.test(element.className)) {
100864
+ while (element) {
100865
+ var m = lang.exec(element.className);
100866
+ if (m) {
100867
+ return m[1].toLowerCase();
100868
+ }
100826
100869
  element = element.parentElement;
100827
100870
  }
100828
- if (element) {
100829
- return (element.className.match(lang) || [, 'none'])[1].toLowerCase();
100830
- }
100831
100871
  return 'none';
100832
100872
  },
100833
100873
 
100874
+ /**
100875
+ * Sets the Prism `language-xxxx` class of the given element.
100876
+ *
100877
+ * @param {Element} element
100878
+ * @param {string} language
100879
+ * @returns {void}
100880
+ */
100881
+ setLanguage: function (element, language) {
100882
+ // remove all `language-xxxx` classes
100883
+ // (this might leave behind a leading space)
100884
+ element.className = element.className.replace(RegExp(lang, 'gi'), '');
100885
+
100886
+ // add the new `language-xxxx` class
100887
+ // (using `classList` will automatically clean up spaces for us)
100888
+ element.classList.add('language-' + language);
100889
+ },
100890
+
100834
100891
  /**
100835
100892
  * Returns the script element that is currently executing.
100836
100893
  *
@@ -101185,12 +101242,12 @@ var Prism = (function (_self) {
101185
101242
  var grammar = _.languages[language];
101186
101243
 
101187
101244
  // Set language on the element, if not present
101188
- element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
101245
+ _.util.setLanguage(element, language);
101189
101246
 
101190
101247
  // Set language on the parent, for styling
101191
101248
  var parent = element.parentElement;
101192
101249
  if (parent && parent.nodeName.toLowerCase() === 'pre') {
101193
- parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
101250
+ _.util.setLanguage(parent, language);
101194
101251
  }
101195
101252
 
101196
101253
  var code = element.textContent;
@@ -101585,7 +101642,7 @@ var Prism = (function (_self) {
101585
101642
 
101586
101643
  if (greedy) {
101587
101644
  match = matchPattern(pattern, pos, text, lookbehind);
101588
- if (!match) {
101645
+ if (!match || match.index >= text.length) {
101589
101646
  break;
101590
101647
  }
101591
101648
 
@@ -102161,14 +102218,14 @@ Prism.languages.clike = {
102161
102218
  greedy: true
102162
102219
  },
102163
102220
  'class-name': {
102164
- pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
102221
+ pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
102165
102222
  lookbehind: true,
102166
102223
  inside: {
102167
102224
  'punctuation': /[.\\]/
102168
102225
  }
102169
102226
  },
102170
- 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
102171
- 'boolean': /\b(?:true|false)\b/,
102227
+ 'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
102228
+ 'boolean': /\b(?:false|true)\b/,
102172
102229
  'function': /\b\w+(?=\()/,
102173
102230
  'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
102174
102231
  'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
@@ -102184,7 +102241,7 @@ Prism.languages.javascript = Prism.languages.extend('clike', {
102184
102241
  'class-name': [
102185
102242
  Prism.languages.clike['class-name'],
102186
102243
  {
102187
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,
102244
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
102188
102245
  lookbehind: true
102189
102246
  }
102190
102247
  ],
@@ -102200,11 +102257,38 @@ Prism.languages.javascript = Prism.languages.extend('clike', {
102200
102257
  ],
102201
102258
  // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
102202
102259
  'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
102203
- 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,
102260
+ 'number': {
102261
+ pattern: RegExp(
102262
+ /(^|[^\w$])/.source +
102263
+ '(?:' +
102264
+ (
102265
+ // constant
102266
+ /NaN|Infinity/.source +
102267
+ '|' +
102268
+ // binary integer
102269
+ /0[bB][01]+(?:_[01]+)*n?/.source +
102270
+ '|' +
102271
+ // octal integer
102272
+ /0[oO][0-7]+(?:_[0-7]+)*n?/.source +
102273
+ '|' +
102274
+ // hexadecimal integer
102275
+ /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source +
102276
+ '|' +
102277
+ // decimal bigint
102278
+ /\d+(?:_\d+)*n/.source +
102279
+ '|' +
102280
+ // decimal number (integer or float) but no bigint
102281
+ /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source
102282
+ ) +
102283
+ ')' +
102284
+ /(?![\w$])/.source
102285
+ ),
102286
+ lookbehind: true
102287
+ },
102204
102288
  'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
102205
102289
  });
102206
102290
 
102207
- Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
102291
+ Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
102208
102292
 
102209
102293
  Prism.languages.insertBefore('javascript', 'keyword', {
102210
102294
  'regex': {
@@ -102280,9 +102364,23 @@ Prism.languages.insertBefore('javascript', 'string', {
102280
102364
  },
102281
102365
  'string': /[\s\S]+/
102282
102366
  }
102367
+ },
102368
+ 'string-property': {
102369
+ pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
102370
+ lookbehind: true,
102371
+ greedy: true,
102372
+ alias: 'property'
102283
102373
  }
102284
102374
  });
102285
102375
 
102376
+ Prism.languages.insertBefore('javascript', 'operator', {
102377
+ 'literal-property': {
102378
+ pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
102379
+ lookbehind: true,
102380
+ alias: 'property'
102381
+ },
102382
+ });
102383
+
102286
102384
  if (Prism.languages.markup) {
102287
102385
  Prism.languages.markup.tag.addInlined('script', 'javascript');
102288
102386
 
@@ -102338,21 +102436,57 @@ Prism.languages.js = Prism.languages.javascript;
102338
102436
  var SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '="' + STATUS_LOADED + '"])'
102339
102437
  + ':not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
102340
102438
 
102341
- var lang = /\blang(?:uage)?-([\w-]+)\b/i;
102342
-
102343
102439
  /**
102344
- * Sets the Prism `language-xxxx` or `lang-xxxx` class to the given language.
102440
+ * Loads the given file.
102345
102441
  *
102346
- * @param {HTMLElement} element
102347
- * @param {string} language
102348
- * @returns {void}
102442
+ * @param {string} src The URL or path of the source file to load.
102443
+ * @param {(result: string) => void} success
102444
+ * @param {(reason: string) => void} error
102349
102445
  */
102350
- function setLanguageClass(element, language) {
102351
- var className = element.className;
102352
- className = className.replace(lang, ' ') + ' language-' + language;
102353
- element.className = className.replace(/\s+/g, ' ').trim();
102446
+ function loadFile(src, success, error) {
102447
+ var xhr = new XMLHttpRequest();
102448
+ xhr.open('GET', src, true);
102449
+ xhr.onreadystatechange = function () {
102450
+ if (xhr.readyState == 4) {
102451
+ if (xhr.status < 400 && xhr.responseText) {
102452
+ success(xhr.responseText);
102453
+ } else {
102454
+ if (xhr.status >= 400) {
102455
+ error(FAILURE_MESSAGE(xhr.status, xhr.statusText));
102456
+ } else {
102457
+ error(FAILURE_EMPTY_MESSAGE);
102458
+ }
102459
+ }
102460
+ }
102461
+ };
102462
+ xhr.send(null);
102354
102463
  }
102355
102464
 
102465
+ /**
102466
+ * Parses the given range.
102467
+ *
102468
+ * This returns a range with inclusive ends.
102469
+ *
102470
+ * @param {string | null | undefined} range
102471
+ * @returns {[number, number | undefined] | undefined}
102472
+ */
102473
+ function parseRange(range) {
102474
+ var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || '');
102475
+ if (m) {
102476
+ var start = Number(m[1]);
102477
+ var comma = m[2];
102478
+ var end = m[3];
102479
+
102480
+ if (!comma) {
102481
+ return [start, start];
102482
+ }
102483
+ if (!end) {
102484
+ return [start, undefined];
102485
+ }
102486
+ return [start, Number(end)];
102487
+ }
102488
+ return undefined;
102489
+ }
102356
102490
 
102357
102491
  Prism.hooks.add('before-highlightall', function (env) {
102358
102492
  env.selector += ', ' + SELECTOR;
@@ -102380,8 +102514,8 @@ Prism.languages.js = Prism.languages.javascript;
102380
102514
  }
102381
102515
 
102382
102516
  // set language classes
102383
- setLanguageClass(code, language);
102384
- setLanguageClass(pre, language);
102517
+ Prism.util.setLanguage(code, language);
102518
+ Prism.util.setLanguage(pre, language);
102385
102519
 
102386
102520
  // preload the language
102387
102521
  var autoloader = Prism.plugins.autoloader;
@@ -102390,31 +102524,45 @@ Prism.languages.js = Prism.languages.javascript;
102390
102524
  }
102391
102525
 
102392
102526
  // load file
102393
- var xhr = new XMLHttpRequest();
102394
- xhr.open('GET', src, true);
102395
- xhr.onreadystatechange = function () {
102396
- if (xhr.readyState == 4) {
102397
- if (xhr.status < 400 && xhr.responseText) {
102398
- // mark as loaded
102399
- pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
102400
-
102401
- // highlight code
102402
- code.textContent = xhr.responseText;
102403
- Prism.highlightElement(code);
102404
-
102405
- } else {
102406
- // mark as failed
102407
- pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
102408
-
102409
- if (xhr.status >= 400) {
102410
- code.textContent = FAILURE_MESSAGE(xhr.status, xhr.statusText);
102411
- } else {
102412
- code.textContent = FAILURE_EMPTY_MESSAGE;
102527
+ loadFile(
102528
+ src,
102529
+ function (text) {
102530
+ // mark as loaded
102531
+ pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
102532
+
102533
+ // handle data-range
102534
+ var range = parseRange(pre.getAttribute('data-range'));
102535
+ if (range) {
102536
+ var lines = text.split(/\r\n?|\n/g);
102537
+
102538
+ // the range is one-based and inclusive on both ends
102539
+ var start = range[0];
102540
+ var end = range[1] == null ? lines.length : range[1];
102541
+
102542
+ if (start < 0) { start += lines.length; }
102543
+ start = Math.max(0, Math.min(start - 1, lines.length));
102544
+ if (end < 0) { end += lines.length; }
102545
+ end = Math.max(0, Math.min(end, lines.length));
102546
+
102547
+ text = lines.slice(start, end).join('\n');
102548
+
102549
+ // add data-start for line numbers
102550
+ if (!pre.hasAttribute('data-start')) {
102551
+ pre.setAttribute('data-start', String(start + 1));
102413
102552
  }
102414
102553
  }
102554
+
102555
+ // highlight code
102556
+ code.textContent = text;
102557
+ Prism.highlightElement(code);
102558
+ },
102559
+ function (error) {
102560
+ // mark as failed
102561
+ pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
102562
+
102563
+ code.textContent = error;
102415
102564
  }
102416
- };
102417
- xhr.send(null);
102565
+ );
102418
102566
  }
102419
102567
  });
102420
102568
 
@@ -102949,7 +103097,7 @@ Prism.languages.js = Prism.languages.javascript;
102949
103097
  greedy: true,
102950
103098
  inside: {
102951
103099
  'punctuation': /^---|---$/,
102952
- 'font-matter': {
103100
+ 'front-matter': {
102953
103101
  pattern: /\S+(?:\s+\S+)*/,
102954
103102
  alias: ['yaml', 'language-yaml'],
102955
103103
  inside: Prism.languages.yaml
@@ -103364,8 +103512,8 @@ Prism.languages.js = Prism.languages.javascript;
103364
103512
  /<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source
103365
103513
  );
103366
103514
 
103367
- Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/i;
103368
- Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/i;
103515
+ Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/;
103516
+ Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/;
103369
103517
  Prism.languages.jsx.tag.inside['tag'].inside['class-name'] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/;
103370
103518
  Prism.languages.jsx.tag.inside['comment'] = javascript['comment'];
103371
103519
 
@@ -103380,6 +103528,7 @@ Prism.languages.js = Prism.languages.javascript;
103380
103528
  'script': {
103381
103529
  // Allow for two levels of nesting
103382
103530
  pattern: re(/=<BRACES>/.source),
103531
+ alias: 'language-javascript',
103383
103532
  inside: {
103384
103533
  'script-punctuation': {
103385
103534
  pattern: /^=(?=\{)/,
@@ -103387,7 +103536,6 @@ Prism.languages.js = Prism.languages.javascript;
103387
103536
  },
103388
103537
  rest: Prism.languages.jsx
103389
103538
  },
103390
- 'alias': 'language-javascript'
103391
103539
  }
103392
103540
  }, Prism.languages.jsx.tag);
103393
103541
 
@@ -110746,7 +110894,18 @@ var SamsPlayground = /** @class */ (function (_super) {
110746
110894
  React.createElement(index_1.Badge, { text: item.urgency, color: item.urgencyColor }),
110747
110895
  React.createElement(index_1.Badge, { text: item.priority, shape: 'square', color: item.priorityColor })),
110748
110896
  React.createElement(GridElements.GridItemFooterActions, null,
110749
- React.createElement(index_1.IconButton, { icon: 'dots-vertical', ariaValue: 'More actions', onClick: function () { return _this.changeStatus(item, 'archived'); } }))));
110897
+ React.createElement(index_1.Dropdown, { align: 'right', append: true, items: [
110898
+ {
110899
+ type: 'group', label: 'Actions',
110900
+ items: [
110901
+ 'divider',
110902
+ { label: 'Edit', icon: 'pencil', onSelect: function () { return _this.setState({ dropDownState: 'Edit ' }); } },
110903
+ { label: 'Download', icon: 'download', onSelect: function () { return _this.setState({ dropDownState: 'Download' }); } },
110904
+ { label: 'Delete', icon: 'trash', onSelect: function () { return _this.setState({ dropDownState: 'Delete' }); } },
110905
+ ]
110906
+ }
110907
+ ] },
110908
+ React.createElement(index_1.IconButton, { ariaValue: 'dropdown-more-options', icon: 'dots-vertical', onClick: function () { return false; } })))));
110750
110909
  }))),
110751
110910
  React.createElement(Components.RightPanel, { open: this.state.openPreview },
110752
110911
  React.createElement(Components.Panel, { side: 'right' },
@@ -111365,7 +111524,7 @@ exports.MenuDocs = MenuDocs;
111365
111524
  /* 480 */
111366
111525
  /***/ (function(module, exports) {
111367
111526
 
111368
- module.exports = {"name":"superdesk-ui-framework","version":"2.4.16","license":"AGPL-3.0","repository":{"type":"git","url":"https://github.com/superdesk/superdesk-ui-framework.git"},"main":"dist/superdesk-ui.bundle.js","types":"react/index.d.ts","contributors":["Nemanja Pavlovic","Vladimir Stefanovic","Darko Tomic","Aleksandar Jelicic","Tomas Kikutis","Dragana Zivkovic"],"scripts":{"start":"webpack-dev-server --config tasks/webpack.dev.js","server":"webpack --watch --config tasks/webpack.prod.js && tsc-watch","build":"webpack --config tasks/webpack.prod.js && tsc && npm run lint","build-ui":"webpack && tsc && npm run lint","lint":"eslint app && tslint -c tslint.json 'app-typescript/**/*.{ts,tsx}'","prepublishOnly":"npm run build","prepublish":"patch-package"},"devDependencies":{"@types/chart.js":"^2.9.24","@types/classnames":"^2.2.9","@types/lodash":"^4.14.161","@types/react":"16.8.23","@types/react-dom":"16.8.0","@types/react-router-dom":"^5.1.2","angular":"^1.7.9","angular-animate":"^1.7.9","angular-route":"^1.7.9","babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","classnames":"^2.2.5","clean-webpack-plugin":"^1.0.0","code-prettify":"^0.1.0","copy-webpack-plugin":"^4.6.0","css-loader":"^2.1.1","eslint":"^4.6.1","eslint-loader":"^1.9.0","eslint-plugin-angular":"^3.1.1","eslint-plugin-react":"^7.3.0","extract-text-webpack-plugin":"^3.0.2","file-loader":"^0.11.2","html-loader":"^0.5.1","html-webpack-plugin":"^2.30.1","jquery":"^3.1.1","jquery-ui":"^1.12.1","lodash":"4.17.21","node-sass":"^4.5.3","patch-package":"6.2.0","prismjs":"^1.17.1","prop-types":"^15.6.0","react":"16.8.6","react-bootstrap":"^0.31.2","react-dom":"16.8.6","react-redux":"^5.0.6","react-router-dom":"^5.1.2","redux":"^3.7.2","redux-form":"^7.0.4","sass-loader":"^6.0.6","style-loader":"^0.18.2","superdesk-code-style":"^1.1.2","ts-loader":"^6.0.2","tslint":"^5.18.0","typescript":"^3.5.1","url-loader":"^1.1.2","webpack":"^3.5.5","webpack-cli":"3.3.10","webpack-dev-server":"2.11.1","webpack-merge":"^4.2.1"},"dependencies":{"@material-ui/lab":"^4.0.0-alpha.56","@popperjs/core":"^2.4.0","@superdesk/primereact":"^5.0.2-4","@types/node":"^14.10.2","chart.js":"^2.9.3","date-fns":"2.7.0","popper.js":"1.14.4","primeicons":"2.0.0","react-id-generator":"^3.0.0","react-popper":"^2.2.3"}}
111527
+ module.exports = {"name":"superdesk-ui-framework","version":"2.4.17","license":"AGPL-3.0","repository":{"type":"git","url":"https://github.com/superdesk/superdesk-ui-framework.git"},"main":"dist/superdesk-ui.bundle.js","types":"react/index.d.ts","contributors":["Nemanja Pavlovic","Vladimir Stefanovic","Darko Tomic","Aleksandar Jelicic","Tomas Kikutis","Dragana Zivkovic"],"scripts":{"start":"webpack-dev-server --config tasks/webpack.dev.js","server":"webpack --watch --config tasks/webpack.prod.js && tsc-watch","build":"webpack --config tasks/webpack.prod.js && tsc && npm run lint","build-ui":"webpack && tsc && npm run lint","lint":"eslint app && tslint -c tslint.json 'app-typescript/**/*.{ts,tsx}'","prepublishOnly":"npm run build","prepublish":"patch-package"},"devDependencies":{"@types/chart.js":"^2.9.24","@types/classnames":"^2.2.9","@types/lodash":"^4.14.161","@types/react":"16.8.23","@types/react-dom":"16.8.0","@types/react-router-dom":"^5.1.2","angular":"^1.7.9","angular-animate":"^1.7.9","angular-route":"^1.7.9","babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","classnames":"^2.2.5","clean-webpack-plugin":"^1.0.0","code-prettify":"^0.1.0","copy-webpack-plugin":"^4.6.0","css-loader":"^2.1.1","eslint":"^4.6.1","eslint-loader":"^1.9.0","eslint-plugin-angular":"^3.1.1","eslint-plugin-react":"^7.3.0","extract-text-webpack-plugin":"^3.0.2","file-loader":"^0.11.2","html-loader":"^0.5.1","html-webpack-plugin":"^2.30.1","jquery":"^3.1.1","jquery-ui":"^1.12.1","lodash":"4.17.21","node-sass":"^4.5.3","patch-package":"6.2.0","prismjs":"^1.17.1","prop-types":"^15.6.0","react":"16.8.6","react-bootstrap":"^0.31.2","react-dom":"16.8.6","react-redux":"^5.0.6","react-router-dom":"^5.1.2","redux":"^3.7.2","redux-form":"^7.0.4","sass-loader":"^6.0.6","style-loader":"^0.18.2","superdesk-code-style":"^1.1.2","ts-loader":"^6.0.2","tslint":"^5.18.0","typescript":"^3.5.1","url-loader":"^1.1.2","webpack":"^3.5.5","webpack-cli":"3.3.10","webpack-dev-server":"2.11.1","webpack-merge":"^4.2.1"},"dependencies":{"@material-ui/lab":"^4.0.0-alpha.56","@popperjs/core":"^2.4.0","@superdesk/primereact":"^5.0.2-4","@types/node":"^14.10.2","chart.js":"^2.9.3","date-fns":"2.7.0","popper.js":"1.14.4","primeicons":"2.0.0","react-id-generator":"^3.0.0","react-popper":"^2.2.3"}}
111369
111528
 
111370
111529
  /***/ }),
111371
111530
  /* 481 */
@@ -228,7 +228,20 @@ export class SamsPlayground extends React.Component<IProps, IState> {
228
228
  <Badge text={item.priority} shape='square' color={item.priorityColor} />
229
229
  </GridElements.GridItemFooterBlock>
230
230
  <GridElements.GridItemFooterActions>
231
- <IconButton icon='dots-vertical' ariaValue='More actions' onClick={()=> this.changeStatus(item, 'archived')} />
231
+ <Dropdown
232
+ align = 'right'
233
+ append = {true}
234
+ items={[
235
+ {
236
+ type: 'group', label: 'Actions', items: [
237
+ 'divider',
238
+ { label: 'Edit', icon: 'pencil', onSelect: () => this.setState({ dropDownState: 'Edit ' }) },
239
+ { label: 'Download', icon: 'download', onSelect: () => this.setState({ dropDownState: 'Download' }) },
240
+ { label: 'Delete', icon: 'trash', onSelect: () => this.setState({ dropDownState: 'Delete' }) },
241
+ ]
242
+ }]}>
243
+ <IconButton ariaValue='dropdown-more-options' icon='dots-vertical' onClick={() => false} />
244
+ </Dropdown>
232
245
  </GridElements.GridItemFooterActions>
233
246
  </GridElements.GridItemFooter>
234
247
  </GridElements.GridItem>
@@ -38267,13 +38267,21 @@ function mapToStyles(_ref2) {
38267
38267
  adaptive = _ref2.adaptive,
38268
38268
  roundOffsets = _ref2.roundOffsets,
38269
38269
  isFixed = _ref2.isFixed;
38270
+ var _offsets$x = offsets.x,
38271
+ x = _offsets$x === void 0 ? 0 : _offsets$x,
38272
+ _offsets$y = offsets.y,
38273
+ y = _offsets$y === void 0 ? 0 : _offsets$y;
38270
38274
 
38271
- var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
38272
- _ref3$x = _ref3.x,
38273
- x = _ref3$x === void 0 ? 0 : _ref3$x,
38274
- _ref3$y = _ref3.y,
38275
- y = _ref3$y === void 0 ? 0 : _ref3$y;
38275
+ var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({
38276
+ x: x,
38277
+ y: y
38278
+ }) : {
38279
+ x: x,
38280
+ y: y
38281
+ };
38276
38282
 
38283
+ x = _ref3.x;
38284
+ y = _ref3.y;
38277
38285
  var hasX = offsets.hasOwnProperty('x');
38278
38286
  var hasY = offsets.hasOwnProperty('y');
38279
38287
  var sideX = __WEBPACK_IMPORTED_MODULE_0__enums_js__["l" /* left */];
@@ -38318,6 +38326,17 @@ function mapToStyles(_ref2) {
38318
38326
  position: position
38319
38327
  }, adaptive && unsetSides);
38320
38328
 
38329
+ var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
38330
+ x: x,
38331
+ y: y
38332
+ }) : {
38333
+ x: x,
38334
+ y: y
38335
+ };
38336
+
38337
+ x = _ref4.x;
38338
+ y = _ref4.y;
38339
+
38321
38340
  if (gpuAcceleration) {
38322
38341
  var _Object$assign;
38323
38342
 
@@ -38327,9 +38346,9 @@ function mapToStyles(_ref2) {
38327
38346
  return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
38328
38347
  }
38329
38348
 
38330
- function computeStyles(_ref4) {
38331
- var state = _ref4.state,
38332
- options = _ref4.options;
38349
+ function computeStyles(_ref5) {
38350
+ var state = _ref5.state,
38351
+ options = _ref5.options;
38333
38352
  var _options$gpuAccelerat = options.gpuAcceleration,
38334
38353
  gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
38335
38354
  _options$adaptive = options.adaptive,
@@ -59635,7 +59654,7 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
59635
59654
  if (checkerResult == null) {
59636
59655
  return null;
59637
59656
  }
59638
- if (checkerResult.data.hasOwnProperty('expectedType')) {
59657
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
59639
59658
  expectedTypes.push(checkerResult.data.expectedType);
59640
59659
  }
59641
59660
  }
@@ -71196,7 +71215,6 @@ exports.Dropdown = function (_a) {
71196
71215
  if (toggleRef && menuRef) {
71197
71216
  core_1.createPopper(toggleRef, menuRef, {
71198
71217
  placement: checkAlign() ? 'bottom-end' : 'bottom-start',
71199
- strategy: 'fixed',
71200
71218
  });
71201
71219
  menuRef.style.display = 'block';
71202
71220
  }
@@ -71429,7 +71447,7 @@ function getClippingParents(element) {
71429
71447
 
71430
71448
 
71431
71449
  return clippingParents.filter(function (clippingParent) {
71432
- return Object(__WEBPACK_IMPORTED_MODULE_7__instanceOf_js__["a" /* isElement */])(clippingParent) && Object(__WEBPACK_IMPORTED_MODULE_10__contains_js__["a" /* default */])(clippingParent, clipperElement) && Object(__WEBPACK_IMPORTED_MODULE_11__getNodeName_js__["a" /* default */])(clippingParent) !== 'body' && (canEscapeClipping ? Object(__WEBPACK_IMPORTED_MODULE_6__getComputedStyle_js__["a" /* default */])(clippingParent).position !== 'static' : true);
71450
+ return Object(__WEBPACK_IMPORTED_MODULE_7__instanceOf_js__["a" /* isElement */])(clippingParent) && Object(__WEBPACK_IMPORTED_MODULE_10__contains_js__["a" /* default */])(clippingParent, clipperElement) && Object(__WEBPACK_IMPORTED_MODULE_11__getNodeName_js__["a" /* default */])(clippingParent) !== 'body';
71433
71451
  });
71434
71452
  } // Gets the maximum area that the element is visible in due to any number of
71435
71453
  // clipping parents
@@ -28243,7 +28243,7 @@ __webpack_require__(7);
28243
28243
  /***/ (function(module, exports, __webpack_require__) {
28244
28244
 
28245
28245
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
28246
- * jQuery UI Widget 1.13.0
28246
+ * jQuery UI Widget 1.13.1
28247
28247
  * http://jqueryui.com
28248
28248
  *
28249
28249
  * Copyright jQuery Foundation and other contributors
@@ -28324,7 +28324,7 @@ $.widget = function( name, base, prototype ) {
28324
28324
  constructor = $[ namespace ][ name ] = function( options, element ) {
28325
28325
 
28326
28326
  // Allow instantiation without "new" keyword
28327
- if ( !this._createWidget ) {
28327
+ if ( !this || !this._createWidget ) {
28328
28328
  return new constructor( options, element );
28329
28329
  }
28330
28330
 
@@ -28746,6 +28746,8 @@ $.Widget.prototype = {
28746
28746
  }, options );
28747
28747
 
28748
28748
  function bindRemoveEvent() {
28749
+ var nodesToBind = [];
28750
+
28749
28751
  options.element.each( function( _, element ) {
28750
28752
  var isTracked = $.map( that.classesElementLookup, function( elements ) {
28751
28753
  return elements;
@@ -28755,11 +28757,13 @@ $.Widget.prototype = {
28755
28757
  } );
28756
28758
 
28757
28759
  if ( !isTracked ) {
28758
- that._on( $( element ), {
28759
- remove: "_untrackClassesElement"
28760
- } );
28760
+ nodesToBind.push( element );
28761
28761
  }
28762
28762
  } );
28763
+
28764
+ that._on( $( nodesToBind ), {
28765
+ remove: "_untrackClassesElement"
28766
+ } );
28763
28767
  }
28764
28768
 
28765
28769
  function processClassString( classes, checkOption ) {
@@ -29024,7 +29028,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
29024
29028
 
29025
29029
  $.ui = $.ui || {};
29026
29030
 
29027
- return $.ui.version = "1.13.0";
29031
+ return $.ui.version = "1.13.1";
29028
29032
 
29029
29033
  } );
29030
29034
 
@@ -228,7 +228,20 @@ export class SamsPlayground extends React.Component<IProps, IState> {
228
228
  <Badge text={item.priority} shape='square' color={item.priorityColor} />
229
229
  </GridElements.GridItemFooterBlock>
230
230
  <GridElements.GridItemFooterActions>
231
- <IconButton icon='dots-vertical' ariaValue='More actions' onClick={()=> this.changeStatus(item, 'archived')} />
231
+ <Dropdown
232
+ align = 'right'
233
+ append = {true}
234
+ items={[
235
+ {
236
+ type: 'group', label: 'Actions', items: [
237
+ 'divider',
238
+ { label: 'Edit', icon: 'pencil', onSelect: () => this.setState({ dropDownState: 'Edit ' }) },
239
+ { label: 'Download', icon: 'download', onSelect: () => this.setState({ dropDownState: 'Download' }) },
240
+ { label: 'Delete', icon: 'trash', onSelect: () => this.setState({ dropDownState: 'Delete' }) },
241
+ ]
242
+ }]}>
243
+ <IconButton ariaValue='dropdown-more-options' icon='dots-vertical' onClick={() => false} />
244
+ </Dropdown>
232
245
  </GridElements.GridItemFooterActions>
233
246
  </GridElements.GridItemFooter>
234
247
  </GridElements.GridItem>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superdesk-ui-framework",
3
- "version": "2.4.16",
3
+ "version": "2.4.17",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -105,7 +105,6 @@ exports.Dropdown = function (_a) {
105
105
  if (toggleRef && menuRef) {
106
106
  core_1.createPopper(toggleRef, menuRef, {
107
107
  placement: checkAlign() ? 'bottom-end' : 'bottom-start',
108
- strategy: 'fixed',
109
108
  });
110
109
  menuRef.style.display = 'block';
111
110
  }