@storybook/components 6.5.0-alpha.44 → 6.5.0-alpha.45

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,4 +1,4 @@
1
- import { _ as _objectWithoutPropertiesLoose, a as _extends, c as commonjsGlobal, m as memoize, d as dedent, b as __awaiter, S as ScrollArea, e as __rest, A as ActionBar, w as window_1 } from './index-1368aba1.js';
1
+ import { _ as _objectWithoutPropertiesLoose, a as _extends, c as commonjsGlobal, m as memoize, d as dedent, b as __awaiter, S as ScrollArea, e as __rest, A as ActionBar, w as window_1 } from './index-8859409f.js';
2
2
  import React__default, { useState } from 'react';
3
3
  import { logger } from '@storybook/client-logger';
4
4
  import { styled } from '@storybook/theming';
@@ -32,8 +32,8 @@ function jsx(Prism) {
32
32
  spread = re(spread).source;
33
33
  Prism.languages.jsx = Prism.languages.extend('markup', javascript);
34
34
  Prism.languages.jsx.tag.pattern = re(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source);
35
- Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/i;
36
- Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/i;
35
+ Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/;
36
+ Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/;
37
37
  Prism.languages.jsx.tag.inside['tag'].inside['class-name'] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/;
38
38
  Prism.languages.jsx.tag.inside['comment'] = javascript['comment'];
39
39
  Prism.languages.insertBefore('inside', 'attr-name', {
@@ -46,14 +46,14 @@ function jsx(Prism) {
46
46
  script: {
47
47
  // Allow for two levels of nesting
48
48
  pattern: re(/=<BRACES>/.source),
49
+ alias: 'language-javascript',
49
50
  inside: {
50
51
  'script-punctuation': {
51
52
  pattern: /^=(?=\{)/,
52
53
  alias: 'punctuation'
53
54
  },
54
55
  rest: Prism.languages.jsx
55
- },
56
- alias: 'language-javascript'
56
+ }
57
57
  }
58
58
  }, Prism.languages.jsx.tag); // The following will handle plain text inside tags
59
59
 
@@ -210,7 +210,7 @@ function bash(Prism) {
210
210
  }
211
211
  }, /\$(?:\w+|[#?*!@$])/],
212
212
  // Escape sequences from echo and printf's manuals, and escaped quotes.
213
- entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/
213
+ entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
214
214
  };
215
215
  Prism.languages.bash = {
216
216
  shebang: {
@@ -296,22 +296,22 @@ function bash(Prism) {
296
296
  },
297
297
  variable: insideString.variable,
298
298
  function: {
299
- pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
299
+ pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
300
300
  lookbehind: true
301
301
  },
302
302
  keyword: {
303
- pattern: /(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,
303
+ pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
304
304
  lookbehind: true
305
305
  },
306
306
  // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
307
307
  builtin: {
308
- pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/,
308
+ pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
309
309
  lookbehind: true,
310
310
  // Alias added to make those easier to distinguish from strings.
311
311
  alias: 'class-name'
312
312
  },
313
313
  boolean: {
314
- pattern: /(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/,
314
+ pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
315
315
  lookbehind: true
316
316
  },
317
317
  'file-descriptor': {
@@ -441,7 +441,7 @@ function jsExtras(Prism) {
441
441
  'known-class-name': [{
442
442
  // standard built-ins
443
443
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
444
- pattern: /\b(?:(?:(?:Uint|Int)(?:8|16|32)|Uint8Clamped|Float(?:32|64))?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|(?:Weak)?(?:Set|Map)|WebAssembly)\b/,
444
+ pattern: /\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,
445
445
  alias: 'class-name'
446
446
  }, {
447
447
  // errors
@@ -481,7 +481,7 @@ function jsExtras(Prism) {
481
481
  pattern: /\b(?:as|default|export|from|import)\b/,
482
482
  alias: 'module'
483
483
  }, {
484
- pattern: /\b(?:await|break|catch|continue|do|else|for|finally|if|return|switch|throw|try|while|yield)\b/,
484
+ pattern: /\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,
485
485
  alias: 'control-flow'
486
486
  }, {
487
487
  pattern: /\bnull\b/,
@@ -511,7 +511,7 @@ function jsExtras(Prism) {
511
511
  },
512
512
  dom: {
513
513
  // this contains only a few commonly used DOM variables
514
- pattern: /\b(?:document|location|navigator|performance|(?:local|session)Storage|window)\b/,
514
+ pattern: /\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,
515
515
  alias: 'variable'
516
516
  },
517
517
  console: {
@@ -565,7 +565,7 @@ function json(Prism) {
565
565
  number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
566
566
  punctuation: /[{}[\],]/,
567
567
  operator: /:/,
568
- boolean: /\b(?:true|false)\b/,
568
+ boolean: /\b(?:false|true)\b/,
569
569
  null: {
570
570
  pattern: /\bnull\b/,
571
571
  alias: 'keyword'
@@ -599,18 +599,18 @@ function graphql(Prism) {
599
599
  greedy: true
600
600
  },
601
601
  number: /(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
602
- boolean: /\b(?:true|false)\b/,
602
+ boolean: /\b(?:false|true)\b/,
603
603
  variable: /\$[a-z_]\w*/i,
604
604
  directive: {
605
605
  pattern: /@[a-z_]\w*/i,
606
606
  alias: 'function'
607
607
  },
608
608
  'attr-name': {
609
- pattern: /[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,
609
+ pattern: /\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,
610
610
  greedy: true
611
611
  },
612
612
  'atom-input': {
613
- pattern: /[A-Z]\w*Input(?=!?.*$)/m,
613
+ pattern: /\b[A-Z]\w*Input\b/,
614
614
  alias: 'class-name'
615
615
  },
616
616
  scalar: /\b(?:Boolean|Float|ID|Int|String)\b/,
@@ -1013,7 +1013,7 @@ function markdown(Prism) {
1013
1013
  greedy: true,
1014
1014
  inside: {
1015
1015
  punctuation: /^---|---$/,
1016
- 'font-matter': {
1016
+ 'front-matter': {
1017
1017
  pattern: /\S+(?:\s+\S+)*/,
1018
1018
  alias: ['yaml', 'language-yaml'],
1019
1019
  inside: Prism.languages.yaml
@@ -1451,7 +1451,7 @@ function yaml(Prism) {
1451
1451
  alias: 'number'
1452
1452
  },
1453
1453
  boolean: {
1454
- pattern: createValuePattern(/true|false/.source, 'i'),
1454
+ pattern: createValuePattern(/false|true/.source, 'i'),
1455
1455
  lookbehind: true,
1456
1456
  alias: 'important'
1457
1457
  },
@@ -1492,14 +1492,15 @@ function typescript(Prism) {
1492
1492
  inside: null // see below
1493
1493
 
1494
1494
  },
1495
- builtin: /\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/
1495
+ builtin: /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/
1496
1496
  }); // The keywords TypeScript adds to JavaScript
1497
1497
 
1498
- Prism.languages.typescript.keyword.push(/\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/, // keywords that have to be followed by an identifier
1498
+ Prism.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/, // keywords that have to be followed by an identifier
1499
1499
  /\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/, // This is for `import type *, {}`
1500
1500
  /\btype\b(?=\s*(?:[\{*]|$))/); // doesn't work with TS because TS is too complex
1501
1501
 
1502
- delete Prism.languages.typescript['parameter']; // a version of typescript specifically for highlighting types
1502
+ delete Prism.languages.typescript['parameter'];
1503
+ delete Prism.languages.typescript['literal-property']; // a version of typescript specifically for highlighting types
1503
1504
 
1504
1505
  var typeInside = Prism.languages.extend('typescript', {});
1505
1506
  delete typeInside['class-name'];
@@ -1547,7 +1548,10 @@ function tsx(Prism) {
1547
1548
 
1548
1549
  (function (Prism) {
1549
1550
  var typescript = Prism.util.clone(Prism.languages.typescript);
1550
- Prism.languages.tsx = Prism.languages.extend('jsx', typescript); // This will prevent collisions between TSX tags and TS generic types.
1551
+ Prism.languages.tsx = Prism.languages.extend('jsx', typescript); // doesn't work with TS because TS is too complex
1552
+
1553
+ delete Prism.languages.tsx['parameter'];
1554
+ delete Prism.languages.tsx['literal-property']; // This will prevent collisions between TSX tags and TS generic types.
1551
1555
  // Idea by https://github.com/karlhorky
1552
1556
  // Discussion: https://github.com/PrismJS/prism/issues/2594#issuecomment-710666928
1553
1557
 
@@ -3941,7 +3945,7 @@ var prismCore = {
3941
3945
 
3942
3946
  var Prism = function (_self) {
3943
3947
  // Private helper vars
3944
- var lang = /\blang(?:uage)?-([\w-]+)\b/i;
3948
+ var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
3945
3949
  var uniqueId = 0; // The grammar object for plaintext
3946
3950
 
3947
3951
  var plainTextGrammar = {};
@@ -3968,6 +3972,28 @@ var prismCore = {
3968
3972
  * @public
3969
3973
  */
3970
3974
  manual: _self.Prism && _self.Prism.manual,
3975
+
3976
+ /**
3977
+ * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
3978
+ * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
3979
+ * own worker, you don't want it to do this.
3980
+ *
3981
+ * By setting this value to `true`, Prism will not add its own listeners to the worker.
3982
+ *
3983
+ * You obviously have to change this value before Prism executes. To do this, you can add an
3984
+ * empty Prism object into the global scope before loading the Prism script like this:
3985
+ *
3986
+ * ```js
3987
+ * window.Prism = window.Prism || {};
3988
+ * Prism.disableWorkerMessageHandler = true;
3989
+ * // Load Prism's script
3990
+ * ```
3991
+ *
3992
+ * @default false
3993
+ * @type {boolean}
3994
+ * @memberof Prism
3995
+ * @public
3996
+ */
3971
3997
  disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
3972
3998
 
3973
3999
  /**
@@ -4100,17 +4126,35 @@ var prismCore = {
4100
4126
  * @returns {string}
4101
4127
  */
4102
4128
  getLanguage: function (element) {
4103
- while (element && !lang.test(element.className)) {
4104
- element = element.parentElement;
4105
- }
4129
+ while (element) {
4130
+ var m = lang.exec(element.className);
4131
+
4132
+ if (m) {
4133
+ return m[1].toLowerCase();
4134
+ }
4106
4135
 
4107
- if (element) {
4108
- return (element.className.match(lang) || [, 'none'])[1].toLowerCase();
4136
+ element = element.parentElement;
4109
4137
  }
4110
4138
 
4111
4139
  return 'none';
4112
4140
  },
4113
4141
 
4142
+ /**
4143
+ * Sets the Prism `language-xxxx` class of the given element.
4144
+ *
4145
+ * @param {Element} element
4146
+ * @param {string} language
4147
+ * @returns {void}
4148
+ */
4149
+ setLanguage: function (element, language) {
4150
+ // remove all `language-xxxx` classes
4151
+ // (this might leave behind a leading space)
4152
+ element.className = element.className.replace(RegExp(lang, 'gi'), ''); // add the new `language-xxxx` class
4153
+ // (using `classList` will automatically clean up spaces for us)
4154
+
4155
+ element.classList.add('language-' + language);
4156
+ },
4157
+
4114
4158
  /**
4115
4159
  * Returns the script element that is currently executing.
4116
4160
  *
@@ -4474,12 +4518,13 @@ var prismCore = {
4474
4518
 
4475
4519
  var grammar = _.languages[language]; // Set language on the element, if not present
4476
4520
 
4477
- element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; // Set language on the parent, for styling
4521
+ _.util.setLanguage(element, language); // Set language on the parent, for styling
4522
+
4478
4523
 
4479
4524
  var parent = element.parentElement;
4480
4525
 
4481
4526
  if (parent && parent.nodeName.toLowerCase() === 'pre') {
4482
- parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
4527
+ _.util.setLanguage(parent, language);
4483
4528
  }
4484
4529
 
4485
4530
  var code = element.textContent;
@@ -4573,6 +4618,10 @@ var prismCore = {
4573
4618
 
4574
4619
  _.hooks.run('before-tokenize', env);
4575
4620
 
4621
+ if (!env.grammar) {
4622
+ throw new Error('The language "' + env.language + '" has no grammar.');
4623
+ }
4624
+
4576
4625
  env.tokens = _.tokenize(env.code, env.grammar);
4577
4626
 
4578
4627
  _.hooks.run('after-tokenize', env);
@@ -4883,7 +4932,7 @@ var prismCore = {
4883
4932
  if (greedy) {
4884
4933
  match = matchPattern(pattern, pos, text, lookbehind);
4885
4934
 
4886
- if (!match) {
4935
+ if (!match || match.index >= text.length) {
4887
4936
  break;
4888
4937
  }
4889
4938
 
@@ -5214,14 +5263,14 @@ function clike$1(Prism) {
5214
5263
  greedy: true
5215
5264
  },
5216
5265
  'class-name': {
5217
- pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
5266
+ pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
5218
5267
  lookbehind: true,
5219
5268
  inside: {
5220
5269
  punctuation: /[.\\]/
5221
5270
  }
5222
5271
  },
5223
- keyword: /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
5224
- boolean: /\b(?:true|false)\b/,
5272
+ keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
5273
+ boolean: /\b(?:false|true)\b/,
5225
5274
  function: /\b\w+(?=\()/,
5226
5275
  number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
5227
5276
  operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
@@ -5236,7 +5285,7 @@ javascript.aliases = ['js'];
5236
5285
  function javascript(Prism) {
5237
5286
  Prism.languages.javascript = Prism.languages.extend('clike', {
5238
5287
  'class-name': [Prism.languages.clike['class-name'], {
5239
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,
5288
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
5240
5289
  lookbehind: true
5241
5290
  }],
5242
5291
  keyword: [{
@@ -5248,10 +5297,19 @@ function javascript(Prism) {
5248
5297
  }],
5249
5298
  // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
5250
5299
  function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
5251
- 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)?)+)?/,
5300
+ number: {
5301
+ pattern: RegExp(/(^|[^\w$])/.source + '(?:' + ( // constant
5302
+ /NaN|Infinity/.source + '|' + // binary integer
5303
+ /0[bB][01]+(?:_[01]+)*n?/.source + '|' + // octal integer
5304
+ /0[oO][0-7]+(?:_[0-7]+)*n?/.source + '|' + // hexadecimal integer
5305
+ /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + '|' + // decimal bigint
5306
+ /\d+(?:_\d+)*n/.source + '|' + // decimal number (integer or float) but no bigint
5307
+ /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ')' + /(?![\w$])/.source),
5308
+ lookbehind: true
5309
+ },
5252
5310
  operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
5253
5311
  });
5254
- Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
5312
+ Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
5255
5313
  Prism.languages.insertBefore('javascript', 'keyword', {
5256
5314
  regex: {
5257
5315
  // eslint-disable-next-line regexp/no-dupe-characters-character-class
@@ -5320,6 +5378,19 @@ function javascript(Prism) {
5320
5378
  },
5321
5379
  string: /[\s\S]+/
5322
5380
  }
5381
+ },
5382
+ 'string-property': {
5383
+ pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
5384
+ lookbehind: true,
5385
+ greedy: true,
5386
+ alias: 'property'
5387
+ }
5388
+ });
5389
+ Prism.languages.insertBefore('javascript', 'operator', {
5390
+ 'literal-property': {
5391
+ pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
5392
+ lookbehind: true,
5393
+ alias: 'property'
5323
5394
  }
5324
5395
  });
5325
5396
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/components",
3
- "version": "6.5.0-alpha.44",
3
+ "version": "6.5.0-alpha.45",
4
4
  "description": "Core Storybook Components",
5
5
  "keywords": [
6
6
  "storybook"
@@ -40,9 +40,9 @@
40
40
  "prepare": "ts-node ../../scripts/prebundle.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@storybook/client-logger": "6.5.0-alpha.44",
43
+ "@storybook/client-logger": "6.5.0-alpha.45",
44
44
  "@storybook/csf": "0.0.2--canary.87bc651.0",
45
- "@storybook/theming": "6.5.0-alpha.44",
45
+ "@storybook/theming": "6.5.0-alpha.45",
46
46
  "core-js": "^3.8.2",
47
47
  "regenerator-runtime": "^0.13.7"
48
48
  },
@@ -79,6 +79,6 @@
79
79
  "access": "public"
80
80
  },
81
81
  "bundlerEntrypoint": "./src/index.ts",
82
- "gitHead": "0125cb2b688dc1acca71a7fbf2795466fd55c0e3",
82
+ "gitHead": "af457c20c773f57bea0504bf525a2f74852fe94a",
83
83
  "sbmodern": "dist/modern/index.js"
84
84
  }