superdesk-ui-framework 2.4.16 → 2.4.19

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.
@@ -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
  }
@@ -61022,8 +61041,11 @@ var Input = /** @class */ (function (_super) {
61022
61041
  'sd-input--disabled': this.props.disabled,
61023
61042
  'sd-input--invalid': this.props.invalid || this.state.invalid,
61024
61043
  });
61044
+ var labelClasses = classnames_1.default('sd-input__label', {
61045
+ 'a11y-only': this.props.labelHidden,
61046
+ });
61025
61047
  return (React.createElement("div", { className: classes },
61026
- this.props.label ? React.createElement("label", { className: 'sd-input__label', htmlFor: this.htmlId, id: this.htmlId + 'label' }, this.props.label) : null,
61048
+ React.createElement("label", { className: labelClasses, htmlFor: this.htmlId, id: this.htmlId + 'label' }, this.props.label),
61027
61049
  React.createElement("input", { className: 'sd-input__input', type: 'text', id: this.htmlId, value: this.state.value, "aria-label": this.props.label, "aria-describedby": this.htmlId + 'label', onChange: this.handleChange, disabled: this.props.disabled }),
61028
61050
  this.props.maxLength ?
61029
61051
  React.createElement("div", { className: 'sd-input__char-count' },
@@ -61106,6 +61128,13 @@ var Select = /** @class */ (function (_super) {
61106
61128
  this.setState({ value: event.target.value });
61107
61129
  this.props.onChange(event.target.value);
61108
61130
  };
61131
+ Select.prototype.componentDidUpdate = function (prevProps) {
61132
+ var _a, _b;
61133
+ if (this.props.value !== prevProps.value) {
61134
+ this.setState({ value: (_a = this.props.value) !== null && _a !== void 0 ? _a : '' });
61135
+ this.props.onChange((_b = this.props.value) !== null && _b !== void 0 ? _b : '');
61136
+ }
61137
+ };
61109
61138
  Select.prototype.render = function () {
61110
61139
  var classes = classnames_1.default('sd-input sd-input--is-select', {
61111
61140
  'sd-input--inline-label': this.props.inlineLabel,
@@ -61113,9 +61142,11 @@ var Select = /** @class */ (function (_super) {
61113
61142
  'sd-input--disabled': this.props.disabled,
61114
61143
  'sd-input--invalid': this.props.invalid || this.state.invalid,
61115
61144
  });
61145
+ var labelClasses = classnames_1.default('sd-input__label', {
61146
+ 'a11y-only': this.props.labelHidden,
61147
+ });
61116
61148
  return (React.createElement("div", { className: classes },
61117
- this.props.label ?
61118
- React.createElement("label", { className: 'sd-input__label', htmlFor: this.htmlId }, this.props.label) : null,
61149
+ React.createElement("label", { className: labelClasses, htmlFor: this.htmlId }, this.props.label),
61119
61150
  React.createElement("select", { className: 'sd-input__select', id: this.htmlId, value: this.state.value, "aria-label": this.props.label, "aria-describedby": this.htmlId, onChange: this.handleChange, disabled: this.props.disabled }, this.props.children),
61120
61151
  React.createElement("div", { className: 'sd-input__message-box' },
61121
61152
  this.props.info && !this.props.invalid && !this.state.invalid ?
@@ -71953,7 +71984,6 @@ exports.Dropdown = function (_a) {
71953
71984
  if (toggleRef && menuRef) {
71954
71985
  core_1.createPopper(toggleRef, menuRef, {
71955
71986
  placement: checkAlign() ? 'bottom-end' : 'bottom-start',
71956
- strategy: 'fixed',
71957
71987
  });
71958
71988
  menuRef.style.display = 'block';
71959
71989
  }
@@ -72186,7 +72216,7 @@ function getClippingParents(element) {
72186
72216
 
72187
72217
 
72188
72218
  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);
72219
+ 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
72220
  });
72191
72221
  } // Gets the maximum area that the element is visible in due to any number of
72192
72222
  // clipping parents
@@ -72808,7 +72838,7 @@ exports.Tag = function (_a) {
72808
72838
  _b["tag-label--" + shade] = shade && shade !== 'light',
72809
72839
  _b['tag-label--square'] = shape === 'square',
72810
72840
  _b));
72811
- return (React.createElement("div", { className: classes, key: keyValue },
72841
+ return (React.createElement("span", { className: classes, key: keyValue },
72812
72842
  text,
72813
72843
  !readOnly ? React.createElement("button", { className: 'tag-label__remove', onClick: onClick },
72814
72844
  React.createElement("i", { className: 'icon-close-small' })) : null));
@@ -100678,7 +100708,7 @@ var _self = (typeof window !== 'undefined')
100678
100708
  var Prism = (function (_self) {
100679
100709
 
100680
100710
  // Private helper vars
100681
- var lang = /\blang(?:uage)?-([\w-]+)\b/i;
100711
+ var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
100682
100712
  var uniqueId = 0;
100683
100713
 
100684
100714
  // The grammar object for plaintext
@@ -100708,6 +100738,27 @@ var Prism = (function (_self) {
100708
100738
  * @public
100709
100739
  */
100710
100740
  manual: _self.Prism && _self.Prism.manual,
100741
+ /**
100742
+ * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
100743
+ * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
100744
+ * own worker, you don't want it to do this.
100745
+ *
100746
+ * By setting this value to `true`, Prism will not add its own listeners to the worker.
100747
+ *
100748
+ * You obviously have to change this value before Prism executes. To do this, you can add an
100749
+ * empty Prism object into the global scope before loading the Prism script like this:
100750
+ *
100751
+ * ```js
100752
+ * window.Prism = window.Prism || {};
100753
+ * Prism.disableWorkerMessageHandler = true;
100754
+ * // Load Prism's script
100755
+ * ```
100756
+ *
100757
+ * @default false
100758
+ * @type {boolean}
100759
+ * @memberof Prism
100760
+ * @public
100761
+ */
100711
100762
  disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
100712
100763
 
100713
100764
  /**
@@ -100822,15 +100873,33 @@ var Prism = (function (_self) {
100822
100873
  * @returns {string}
100823
100874
  */
100824
100875
  getLanguage: function (element) {
100825
- while (element && !lang.test(element.className)) {
100876
+ while (element) {
100877
+ var m = lang.exec(element.className);
100878
+ if (m) {
100879
+ return m[1].toLowerCase();
100880
+ }
100826
100881
  element = element.parentElement;
100827
100882
  }
100828
- if (element) {
100829
- return (element.className.match(lang) || [, 'none'])[1].toLowerCase();
100830
- }
100831
100883
  return 'none';
100832
100884
  },
100833
100885
 
100886
+ /**
100887
+ * Sets the Prism `language-xxxx` class of the given element.
100888
+ *
100889
+ * @param {Element} element
100890
+ * @param {string} language
100891
+ * @returns {void}
100892
+ */
100893
+ setLanguage: function (element, language) {
100894
+ // remove all `language-xxxx` classes
100895
+ // (this might leave behind a leading space)
100896
+ element.className = element.className.replace(RegExp(lang, 'gi'), '');
100897
+
100898
+ // add the new `language-xxxx` class
100899
+ // (using `classList` will automatically clean up spaces for us)
100900
+ element.classList.add('language-' + language);
100901
+ },
100902
+
100834
100903
  /**
100835
100904
  * Returns the script element that is currently executing.
100836
100905
  *
@@ -101185,12 +101254,12 @@ var Prism = (function (_self) {
101185
101254
  var grammar = _.languages[language];
101186
101255
 
101187
101256
  // Set language on the element, if not present
101188
- element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
101257
+ _.util.setLanguage(element, language);
101189
101258
 
101190
101259
  // Set language on the parent, for styling
101191
101260
  var parent = element.parentElement;
101192
101261
  if (parent && parent.nodeName.toLowerCase() === 'pre') {
101193
- parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
101262
+ _.util.setLanguage(parent, language);
101194
101263
  }
101195
101264
 
101196
101265
  var code = element.textContent;
@@ -101279,6 +101348,9 @@ var Prism = (function (_self) {
101279
101348
  language: language
101280
101349
  };
101281
101350
  _.hooks.run('before-tokenize', env);
101351
+ if (!env.grammar) {
101352
+ throw new Error('The language "' + env.language + '" has no grammar.');
101353
+ }
101282
101354
  env.tokens = _.tokenize(env.code, env.grammar);
101283
101355
  _.hooks.run('after-tokenize', env);
101284
101356
  return Token.stringify(_.util.encode(env.tokens), env.language);
@@ -101585,7 +101657,7 @@ var Prism = (function (_self) {
101585
101657
 
101586
101658
  if (greedy) {
101587
101659
  match = matchPattern(pattern, pos, text, lookbehind);
101588
- if (!match) {
101660
+ if (!match || match.index >= text.length) {
101589
101661
  break;
101590
101662
  }
101591
101663
 
@@ -102161,14 +102233,14 @@ Prism.languages.clike = {
102161
102233
  greedy: true
102162
102234
  },
102163
102235
  'class-name': {
102164
- pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
102236
+ pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
102165
102237
  lookbehind: true,
102166
102238
  inside: {
102167
102239
  'punctuation': /[.\\]/
102168
102240
  }
102169
102241
  },
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/,
102242
+ 'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
102243
+ 'boolean': /\b(?:false|true)\b/,
102172
102244
  'function': /\b\w+(?=\()/,
102173
102245
  'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
102174
102246
  'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
@@ -102184,7 +102256,7 @@ Prism.languages.javascript = Prism.languages.extend('clike', {
102184
102256
  'class-name': [
102185
102257
  Prism.languages.clike['class-name'],
102186
102258
  {
102187
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,
102259
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
102188
102260
  lookbehind: true
102189
102261
  }
102190
102262
  ],
@@ -102200,11 +102272,38 @@ Prism.languages.javascript = Prism.languages.extend('clike', {
102200
102272
  ],
102201
102273
  // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
102202
102274
  '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)?)+)?/,
102275
+ 'number': {
102276
+ pattern: RegExp(
102277
+ /(^|[^\w$])/.source +
102278
+ '(?:' +
102279
+ (
102280
+ // constant
102281
+ /NaN|Infinity/.source +
102282
+ '|' +
102283
+ // binary integer
102284
+ /0[bB][01]+(?:_[01]+)*n?/.source +
102285
+ '|' +
102286
+ // octal integer
102287
+ /0[oO][0-7]+(?:_[0-7]+)*n?/.source +
102288
+ '|' +
102289
+ // hexadecimal integer
102290
+ /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source +
102291
+ '|' +
102292
+ // decimal bigint
102293
+ /\d+(?:_\d+)*n/.source +
102294
+ '|' +
102295
+ // decimal number (integer or float) but no bigint
102296
+ /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source
102297
+ ) +
102298
+ ')' +
102299
+ /(?![\w$])/.source
102300
+ ),
102301
+ lookbehind: true
102302
+ },
102204
102303
  'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
102205
102304
  });
102206
102305
 
102207
- Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
102306
+ Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
102208
102307
 
102209
102308
  Prism.languages.insertBefore('javascript', 'keyword', {
102210
102309
  'regex': {
@@ -102280,9 +102379,23 @@ Prism.languages.insertBefore('javascript', 'string', {
102280
102379
  },
102281
102380
  'string': /[\s\S]+/
102282
102381
  }
102382
+ },
102383
+ 'string-property': {
102384
+ pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
102385
+ lookbehind: true,
102386
+ greedy: true,
102387
+ alias: 'property'
102283
102388
  }
102284
102389
  });
102285
102390
 
102391
+ Prism.languages.insertBefore('javascript', 'operator', {
102392
+ 'literal-property': {
102393
+ pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
102394
+ lookbehind: true,
102395
+ alias: 'property'
102396
+ },
102397
+ });
102398
+
102286
102399
  if (Prism.languages.markup) {
102287
102400
  Prism.languages.markup.tag.addInlined('script', 'javascript');
102288
102401
 
@@ -102338,21 +102451,57 @@ Prism.languages.js = Prism.languages.javascript;
102338
102451
  var SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '="' + STATUS_LOADED + '"])'
102339
102452
  + ':not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
102340
102453
 
102341
- var lang = /\blang(?:uage)?-([\w-]+)\b/i;
102342
-
102343
102454
  /**
102344
- * Sets the Prism `language-xxxx` or `lang-xxxx` class to the given language.
102455
+ * Loads the given file.
102345
102456
  *
102346
- * @param {HTMLElement} element
102347
- * @param {string} language
102348
- * @returns {void}
102457
+ * @param {string} src The URL or path of the source file to load.
102458
+ * @param {(result: string) => void} success
102459
+ * @param {(reason: string) => void} error
102349
102460
  */
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();
102461
+ function loadFile(src, success, error) {
102462
+ var xhr = new XMLHttpRequest();
102463
+ xhr.open('GET', src, true);
102464
+ xhr.onreadystatechange = function () {
102465
+ if (xhr.readyState == 4) {
102466
+ if (xhr.status < 400 && xhr.responseText) {
102467
+ success(xhr.responseText);
102468
+ } else {
102469
+ if (xhr.status >= 400) {
102470
+ error(FAILURE_MESSAGE(xhr.status, xhr.statusText));
102471
+ } else {
102472
+ error(FAILURE_EMPTY_MESSAGE);
102473
+ }
102474
+ }
102475
+ }
102476
+ };
102477
+ xhr.send(null);
102354
102478
  }
102355
102479
 
102480
+ /**
102481
+ * Parses the given range.
102482
+ *
102483
+ * This returns a range with inclusive ends.
102484
+ *
102485
+ * @param {string | null | undefined} range
102486
+ * @returns {[number, number | undefined] | undefined}
102487
+ */
102488
+ function parseRange(range) {
102489
+ var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || '');
102490
+ if (m) {
102491
+ var start = Number(m[1]);
102492
+ var comma = m[2];
102493
+ var end = m[3];
102494
+
102495
+ if (!comma) {
102496
+ return [start, start];
102497
+ }
102498
+ if (!end) {
102499
+ return [start, undefined];
102500
+ }
102501
+ return [start, Number(end)];
102502
+ }
102503
+ return undefined;
102504
+ }
102356
102505
 
102357
102506
  Prism.hooks.add('before-highlightall', function (env) {
102358
102507
  env.selector += ', ' + SELECTOR;
@@ -102380,8 +102529,8 @@ Prism.languages.js = Prism.languages.javascript;
102380
102529
  }
102381
102530
 
102382
102531
  // set language classes
102383
- setLanguageClass(code, language);
102384
- setLanguageClass(pre, language);
102532
+ Prism.util.setLanguage(code, language);
102533
+ Prism.util.setLanguage(pre, language);
102385
102534
 
102386
102535
  // preload the language
102387
102536
  var autoloader = Prism.plugins.autoloader;
@@ -102390,31 +102539,45 @@ Prism.languages.js = Prism.languages.javascript;
102390
102539
  }
102391
102540
 
102392
102541
  // 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;
102542
+ loadFile(
102543
+ src,
102544
+ function (text) {
102545
+ // mark as loaded
102546
+ pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
102547
+
102548
+ // handle data-range
102549
+ var range = parseRange(pre.getAttribute('data-range'));
102550
+ if (range) {
102551
+ var lines = text.split(/\r\n?|\n/g);
102552
+
102553
+ // the range is one-based and inclusive on both ends
102554
+ var start = range[0];
102555
+ var end = range[1] == null ? lines.length : range[1];
102556
+
102557
+ if (start < 0) { start += lines.length; }
102558
+ start = Math.max(0, Math.min(start - 1, lines.length));
102559
+ if (end < 0) { end += lines.length; }
102560
+ end = Math.max(0, Math.min(end, lines.length));
102561
+
102562
+ text = lines.slice(start, end).join('\n');
102563
+
102564
+ // add data-start for line numbers
102565
+ if (!pre.hasAttribute('data-start')) {
102566
+ pre.setAttribute('data-start', String(start + 1));
102413
102567
  }
102414
102568
  }
102569
+
102570
+ // highlight code
102571
+ code.textContent = text;
102572
+ Prism.highlightElement(code);
102573
+ },
102574
+ function (error) {
102575
+ // mark as failed
102576
+ pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
102577
+
102578
+ code.textContent = error;
102415
102579
  }
102416
- };
102417
- xhr.send(null);
102580
+ );
102418
102581
  }
102419
102582
  });
102420
102583
 
@@ -102949,7 +103112,7 @@ Prism.languages.js = Prism.languages.javascript;
102949
103112
  greedy: true,
102950
103113
  inside: {
102951
103114
  'punctuation': /^---|---$/,
102952
- 'font-matter': {
103115
+ 'front-matter': {
102953
103116
  pattern: /\S+(?:\s+\S+)*/,
102954
103117
  alias: ['yaml', 'language-yaml'],
102955
103118
  inside: Prism.languages.yaml
@@ -103364,8 +103527,8 @@ Prism.languages.js = Prism.languages.javascript;
103364
103527
  /<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source
103365
103528
  );
103366
103529
 
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;
103530
+ Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/;
103531
+ Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/;
103369
103532
  Prism.languages.jsx.tag.inside['tag'].inside['class-name'] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/;
103370
103533
  Prism.languages.jsx.tag.inside['comment'] = javascript['comment'];
103371
103534
 
@@ -103380,6 +103543,7 @@ Prism.languages.js = Prism.languages.javascript;
103380
103543
  'script': {
103381
103544
  // Allow for two levels of nesting
103382
103545
  pattern: re(/=<BRACES>/.source),
103546
+ alias: 'language-javascript',
103383
103547
  inside: {
103384
103548
  'script-punctuation': {
103385
103549
  pattern: /^=(?=\{)/,
@@ -103387,7 +103551,6 @@ Prism.languages.js = Prism.languages.javascript;
103387
103551
  },
103388
103552
  rest: Prism.languages.jsx
103389
103553
  },
103390
- 'alias': 'language-javascript'
103391
103554
  }
103392
103555
  }, Prism.languages.jsx.tag);
103393
103556
 
@@ -104863,7 +105026,7 @@ var InputsDoc = /** @class */ (function (_super) {
104863
105026
  React.createElement("p", { className: 'docs-page__paragraph' }),
104864
105027
  React.createElement(Markup.ReactMarkup, null,
104865
105028
  React.createElement(Markup.ReactMarkupPreview, null,
104866
- React.createElement("div", { className: 'docs-page__content-row docs-page__content-row--no-margin' },
105029
+ React.createElement("div", { className: 'docs-page__content-row' },
104867
105030
  React.createElement("div", { className: 'form__row' },
104868
105031
  React.createElement(app_typescript_1.CheckGroup, null,
104869
105032
  React.createElement(app_typescript_1.Checkbox, { checked: this.state.required, label: { text: 'Required input' }, onChange: function (value) { _this.setState({ required: value }); } }),
@@ -104871,7 +105034,11 @@ var InputsDoc = /** @class */ (function (_super) {
104871
105034
  React.createElement(app_typescript_1.Checkbox, { checked: this.state.invalid, label: { text: 'Invalid input' }, onChange: function (value) { _this.setState({ invalid: value }); } }),
104872
105035
  React.createElement(app_typescript_1.Checkbox, { checked: this.state.inlineLabel, label: { text: 'Label positioned inline' }, onChange: function (value) { _this.setState({ inlineLabel: value }); } }))),
104873
105036
  React.createElement("div", { className: 'form__row' },
104874
- React.createElement(app_typescript_1.Input, { label: 'Input label', value: 'This is some value', maxLength: 30, error: 'This is error message', info: 'This is some hint message', inlineLabel: this.state.inlineLabel, required: this.state.required, disabled: this.state.disabled, invalid: this.state.invalid, onChange: function (value) { } })))),
105037
+ React.createElement(app_typescript_1.Input, { label: 'Input label', value: 'This is the value', maxLength: 30, error: 'This is error message', info: 'This is some hint message', inlineLabel: this.state.inlineLabel, required: this.state.required, disabled: this.state.disabled, invalid: this.state.invalid, onChange: function (value) { } }))),
105038
+ React.createElement("div", { className: 'docs-page__content-row docs-page__content-row--no-margin' },
105039
+ React.createElement("p", { className: "docs-page__paragraph" }, "// Hidden label"),
105040
+ React.createElement("div", { className: 'form__row' },
105041
+ React.createElement(app_typescript_1.Input, { label: 'Hidden input label', value: 'Lorem ipsum input', maxLength: 30, error: 'This is an error message', info: 'This is a hint message', inlineLabel: true, labelHidden: true, required: false, disabled: false, invalid: false, onChange: function (value) { } })))),
104875
105042
  React.createElement(Markup.ReactMarkupCode, null, "\n <Input label='Input label'\n value='This is some value'\n maxLength={30}\n error='This is error message'\n info='This is some hint message'\n inlineLabel={false}\n required={true}\n disabled={false}\n invalid={false}\n onChange={(value) => {}} />\n ")),
104876
105043
  React.createElement("h3", { className: 'docs-page__h3' }, "Props"),
104877
105044
  React.createElement(app_typescript_1.PropsList, null,
@@ -104881,6 +105048,7 @@ var InputsDoc = /** @class */ (function (_super) {
104881
105048
  React.createElement(app_typescript_1.Prop, { name: 'info', isRequired: false, type: 'string', default: '/', description: 'Hint text' }),
104882
105049
  React.createElement(app_typescript_1.Prop, { name: 'error', isRequired: false, type: 'string', default: '/', description: 'Error text' }),
104883
105050
  React.createElement(app_typescript_1.Prop, { name: 'inlineLabel', isRequired: false, type: 'boolean', default: 'false', description: 'Position labels as inline' }),
105051
+ React.createElement(app_typescript_1.Prop, { name: 'labelHidden', isRequired: false, type: 'boolean', default: 'false', description: 'Hide the label. The label will still be accessible to screen-readers.' }),
104884
105052
  React.createElement(app_typescript_1.Prop, { name: 'required', isRequired: false, type: 'boolean', default: 'false', description: 'Mark field as required' }),
104885
105053
  React.createElement(app_typescript_1.Prop, { name: 'disabled', isRequired: false, type: 'boolean', default: 'false', description: 'Mark field as disabled' }),
104886
105054
  React.createElement(app_typescript_1.Prop, { name: 'invalid', isRequired: false, type: 'boolean', default: 'false', description: 'Mark field as invalid' }))));
@@ -105131,7 +105299,7 @@ var InputsDoc = /** @class */ (function (_super) {
105131
105299
  React.createElement("p", { className: 'docs-page__paragraph' }),
105132
105300
  React.createElement(Markup.ReactMarkup, null,
105133
105301
  React.createElement(Markup.ReactMarkupPreview, null,
105134
- React.createElement("div", { className: 'docs-page__content-row docs-page__content-row--no-margin' },
105302
+ React.createElement("div", { className: 'docs-page__content-row' },
105135
105303
  React.createElement("div", { className: 'form__row' },
105136
105304
  React.createElement(app_typescript_1.CheckGroup, null,
105137
105305
  React.createElement(app_typescript_1.Checkbox, { checked: this.state.required, label: { text: 'Required input' }, onChange: function (value) { _this.setState({ required: value }); } }),
@@ -105141,7 +105309,15 @@ var InputsDoc = /** @class */ (function (_super) {
105141
105309
  React.createElement("div", { className: 'form__row' },
105142
105310
  React.createElement(app_typescript_1.Select, { label: 'Select label', value: 'Option 2', error: 'This is error message', info: 'This is some hint message', inlineLabel: this.state.inlineLabel, required: this.state.required, disabled: this.state.disabled, invalid: this.state.invalid, onChange: function (value) { console.log(value); } },
105143
105311
  React.createElement(app_typescript_1.Option, null, "Option 1"),
105144
- React.createElement(app_typescript_1.Option, null, "Option 2"))))),
105312
+ React.createElement(app_typescript_1.Option, null, "Option 2")))),
105313
+ React.createElement("div", { className: 'docs-page__content-row docs-page__content-row--no-margin' },
105314
+ React.createElement("p", { className: "docs-page__paragraph" }, "// Hidden label"),
105315
+ React.createElement("div", { className: 'form__row' },
105316
+ React.createElement(app_typescript_1.Select, { label: 'Hidden select label', value: 'Option 1', error: 'Error message', info: 'This is a hint message', inlineLabel: true, labelHidden: true, required: false, disabled: false, invalid: this.state.invalid, onChange: function (value) { console.log(value); } },
105317
+ React.createElement(app_typescript_1.Option, null, "Option 1"),
105318
+ React.createElement(app_typescript_1.Option, null, "Option 2"),
105319
+ React.createElement(app_typescript_1.Option, null, "Option 3"),
105320
+ React.createElement(app_typescript_1.Option, null, "Option 4"))))),
105145
105321
  React.createElement(Markup.ReactMarkupCode, null, "\n <Select label='Select label'\n value='Option 2'\n error='This is error message'\n info='This is some hint message'\n inlineLabel={false}\n required={true}\n disabled={false}\n invalid={false}\n onChange={(value) => {}}>\n <Option value=\"option-1\">Option 1</option>\n <Option value=\"option-2\">Option 2</option>\n </Select>\n ")),
105146
105322
  React.createElement("h3", { className: 'docs-page__h3' }, "Props"),
105147
105323
  React.createElement(app_typescript_1.PropsList, null,
@@ -105150,6 +105326,7 @@ var InputsDoc = /** @class */ (function (_super) {
105150
105326
  React.createElement(app_typescript_1.Prop, { name: 'info', isRequired: false, type: 'string', default: '/', description: 'Hint text' }),
105151
105327
  React.createElement(app_typescript_1.Prop, { name: 'error', isRequired: false, type: 'string', default: '/', description: 'Error text' }),
105152
105328
  React.createElement(app_typescript_1.Prop, { name: 'inlineLabel', isRequired: false, type: 'boolean', default: 'false', description: 'Position labels as inline' }),
105329
+ React.createElement(app_typescript_1.Prop, { name: 'labelHidden', isRequired: false, type: 'boolean', default: 'false', description: 'Hide the label. The label will still be accessible to screen-readers.' }),
105153
105330
  React.createElement(app_typescript_1.Prop, { name: 'required', isRequired: false, type: 'boolean', default: 'false', description: 'Mark field as required' }),
105154
105331
  React.createElement(app_typescript_1.Prop, { name: 'disabled', isRequired: false, type: 'boolean', default: 'false', description: 'Mark field as disabled' }),
105155
105332
  React.createElement(app_typescript_1.Prop, { name: 'invalid', isRequired: false, type: 'boolean', default: 'false', description: 'Mark field as invalid' }))));
@@ -110746,7 +110923,18 @@ var SamsPlayground = /** @class */ (function (_super) {
110746
110923
  React.createElement(index_1.Badge, { text: item.urgency, color: item.urgencyColor }),
110747
110924
  React.createElement(index_1.Badge, { text: item.priority, shape: 'square', color: item.priorityColor })),
110748
110925
  React.createElement(GridElements.GridItemFooterActions, null,
110749
- React.createElement(index_1.IconButton, { icon: 'dots-vertical', ariaValue: 'More actions', onClick: function () { return _this.changeStatus(item, 'archived'); } }))));
110926
+ React.createElement(index_1.Dropdown, { align: 'right', append: true, items: [
110927
+ {
110928
+ type: 'group', label: 'Actions',
110929
+ items: [
110930
+ 'divider',
110931
+ { label: 'Edit', icon: 'pencil', onSelect: function () { return _this.setState({ dropDownState: 'Edit ' }); } },
110932
+ { label: 'Download', icon: 'download', onSelect: function () { return _this.setState({ dropDownState: 'Download' }); } },
110933
+ { label: 'Delete', icon: 'trash', onSelect: function () { return _this.setState({ dropDownState: 'Delete' }); } },
110934
+ ]
110935
+ }
110936
+ ] },
110937
+ React.createElement(index_1.IconButton, { ariaValue: 'dropdown-more-options', icon: 'dots-vertical', onClick: function () { return false; } })))));
110750
110938
  }))),
110751
110939
  React.createElement(Components.RightPanel, { open: this.state.openPreview },
110752
110940
  React.createElement(Components.Panel, { side: 'right' },
@@ -111365,7 +111553,7 @@ exports.MenuDocs = MenuDocs;
111365
111553
  /* 480 */
111366
111554
  /***/ (function(module, exports) {
111367
111555
 
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"}}
111556
+ module.exports = {"name":"superdesk-ui-framework","version":"2.4.19","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
111557
 
111370
111558
  /***/ }),
111371
111559
  /* 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>