diff --git a/_templates/package/new/package.json.ejs.t b/_templates/package/new/package.json.ejs.t index 11d8139f8b5f..5e3461b6c185 100644 --- a/_templates/package/new/package.json.ejs.t +++ b/_templates/package/new/package.json.ejs.t @@ -18,7 +18,7 @@ to: packages/<%= name %>/package.json "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix", "jest": "jest", "build": "rm -rf dist && tsc -p tsconfig.json", - "dev": "tsc -p --watch --preserveWatchOutput tsconfig.json" + "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput" }, "main": "./dist/index.js", "typings": "./dist/index.d.ts", diff --git a/apps/meteor/app/markdown/lib/hljs.js b/apps/meteor/app/markdown/lib/hljs.js index 6a5232ba2f1c..58c486ac3b86 100644 --- a/apps/meteor/app/markdown/lib/hljs.js +++ b/apps/meteor/app/markdown/lib/hljs.js @@ -1,7 +1,7 @@ -import hljs from 'highlight.js/lib/highlight'; -import clean from 'highlight.js/lib/languages/clean'; -import markdown from 'highlight.js/lib/languages/markdown'; -import javascript from 'highlight.js/lib/languages/javascript'; +import hljs from 'hljs9/lib/highlight'; +import clean from 'hljs9/lib/languages/clean'; +import markdown from 'hljs9/lib/languages/markdown'; +import javascript from 'hljs9/lib/languages/javascript'; hljs.registerLanguage('markdown', markdown); hljs.registerLanguage('clean', clean); @@ -10,351 +10,351 @@ hljs.registerLanguage('javascript', javascript); export const register = async (lang) => { switch (lang) { case 'onec': - return hljs.registerLanguage('onec', (await import('highlight.js/lib/languages/1c')).default); + return hljs.registerLanguage('onec', (await import('hljs9/lib/languages/1c')).default); case 'abnf': - return hljs.registerLanguage('abnf', (await import('highlight.js/lib/languages/abnf')).default); + return hljs.registerLanguage('abnf', (await import('hljs9/lib/languages/abnf')).default); case 'accesslog': - return hljs.registerLanguage('accesslog', (await import('highlight.js/lib/languages/accesslog')).default); + return hljs.registerLanguage('accesslog', (await import('hljs9/lib/languages/accesslog')).default); case 'actionscript': - return hljs.registerLanguage('actionscript', (await import('highlight.js/lib/languages/actionscript')).default); + return hljs.registerLanguage('actionscript', (await import('hljs9/lib/languages/actionscript')).default); case 'ada': - return hljs.registerLanguage('ada', (await import('highlight.js/lib/languages/ada')).default); + return hljs.registerLanguage('ada', (await import('hljs9/lib/languages/ada')).default); case 'apache': - return hljs.registerLanguage('apache', (await import('highlight.js/lib/languages/apache')).default); + return hljs.registerLanguage('apache', (await import('hljs9/lib/languages/apache')).default); case 'applescript': - return hljs.registerLanguage('applescript', (await import('highlight.js/lib/languages/applescript')).default); + return hljs.registerLanguage('applescript', (await import('hljs9/lib/languages/applescript')).default); case 'arduino': - return hljs.registerLanguage('arduino', (await import('highlight.js/lib/languages/arduino')).default); + return hljs.registerLanguage('arduino', (await import('hljs9/lib/languages/arduino')).default); case 'armasm': - return hljs.registerLanguage('armasm', (await import('highlight.js/lib/languages/armasm')).default); + return hljs.registerLanguage('armasm', (await import('hljs9/lib/languages/armasm')).default); case 'asciidoc': - return hljs.registerLanguage('asciidoc', (await import('highlight.js/lib/languages/asciidoc')).default); + return hljs.registerLanguage('asciidoc', (await import('hljs9/lib/languages/asciidoc')).default); case 'aspectj': - return hljs.registerLanguage('aspectj', (await import('highlight.js/lib/languages/aspectj')).default); + return hljs.registerLanguage('aspectj', (await import('hljs9/lib/languages/aspectj')).default); case 'autohotkey': - return hljs.registerLanguage('autohotkey', (await import('highlight.js/lib/languages/autohotkey')).default); + return hljs.registerLanguage('autohotkey', (await import('hljs9/lib/languages/autohotkey')).default); case 'autoit': - return hljs.registerLanguage('autoit', (await import('highlight.js/lib/languages/autoit')).default); + return hljs.registerLanguage('autoit', (await import('hljs9/lib/languages/autoit')).default); case 'avrasm': - return hljs.registerLanguage('avrasm', (await import('highlight.js/lib/languages/avrasm')).default); + return hljs.registerLanguage('avrasm', (await import('hljs9/lib/languages/avrasm')).default); case 'awk': - return hljs.registerLanguage('awk', (await import('highlight.js/lib/languages/awk')).default); + return hljs.registerLanguage('awk', (await import('hljs9/lib/languages/awk')).default); case 'axapta': - return hljs.registerLanguage('axapta', (await import('highlight.js/lib/languages/axapta')).default); + return hljs.registerLanguage('axapta', (await import('hljs9/lib/languages/axapta')).default); case 'bash': - return hljs.registerLanguage('bash', (await import('highlight.js/lib/languages/bash')).default); + return hljs.registerLanguage('bash', (await import('hljs9/lib/languages/bash')).default); case 'basic': - return hljs.registerLanguage('basic', (await import('highlight.js/lib/languages/basic')).default); + return hljs.registerLanguage('basic', (await import('hljs9/lib/languages/basic')).default); case 'bnf': - return hljs.registerLanguage('bnf', (await import('highlight.js/lib/languages/bnf')).default); + return hljs.registerLanguage('bnf', (await import('hljs9/lib/languages/bnf')).default); case 'brainfuck': - return hljs.registerLanguage('brainfuck', (await import('highlight.js/lib/languages/brainfuck')).default); + return hljs.registerLanguage('brainfuck', (await import('hljs9/lib/languages/brainfuck')).default); case 'cal': - return hljs.registerLanguage('cal', (await import('highlight.js/lib/languages/cal')).default); + return hljs.registerLanguage('cal', (await import('hljs9/lib/languages/cal')).default); case 'capnproto': - return hljs.registerLanguage('capnproto', (await import('highlight.js/lib/languages/capnproto')).default); + return hljs.registerLanguage('capnproto', (await import('hljs9/lib/languages/capnproto')).default); case 'ceylon': - return hljs.registerLanguage('ceylon', (await import('highlight.js/lib/languages/ceylon')).default); + return hljs.registerLanguage('ceylon', (await import('hljs9/lib/languages/ceylon')).default); case 'clean': - return hljs.registerLanguage('clean', (await import('highlight.js/lib/languages/clean')).default); + return hljs.registerLanguage('clean', (await import('hljs9/lib/languages/clean')).default); case 'clojure': - return hljs.registerLanguage('clojure', (await import('highlight.js/lib/languages/clojure')).default); + return hljs.registerLanguage('clojure', (await import('hljs9/lib/languages/clojure')).default); case 'clojure-repl': - return hljs.registerLanguage('clojure-repl', (await import('highlight.js/lib/languages/clojure-repl')).default); + return hljs.registerLanguage('clojure-repl', (await import('hljs9/lib/languages/clojure-repl')).default); case 'cmake': - return hljs.registerLanguage('cmake', (await import('highlight.js/lib/languages/cmake')).default); + return hljs.registerLanguage('cmake', (await import('hljs9/lib/languages/cmake')).default); case 'coffeescript': - return hljs.registerLanguage('coffeescript', (await import('highlight.js/lib/languages/coffeescript')).default); + return hljs.registerLanguage('coffeescript', (await import('hljs9/lib/languages/coffeescript')).default); case 'coq': - return hljs.registerLanguage('coq', (await import('highlight.js/lib/languages/coq')).default); + return hljs.registerLanguage('coq', (await import('hljs9/lib/languages/coq')).default); case 'cos': - return hljs.registerLanguage('cos', (await import('highlight.js/lib/languages/cos')).default); + return hljs.registerLanguage('cos', (await import('hljs9/lib/languages/cos')).default); case 'cpp': - return hljs.registerLanguage('cpp', (await import('highlight.js/lib/languages/cpp')).default); + return hljs.registerLanguage('cpp', (await import('hljs9/lib/languages/cpp')).default); case 'crmsh': - return hljs.registerLanguage('crmsh', (await import('highlight.js/lib/languages/crmsh')).default); + return hljs.registerLanguage('crmsh', (await import('hljs9/lib/languages/crmsh')).default); case 'crystal': - return hljs.registerLanguage('crystal', (await import('highlight.js/lib/languages/crystal')).default); + return hljs.registerLanguage('crystal', (await import('hljs9/lib/languages/crystal')).default); case 'cs': - return hljs.registerLanguage('cs', (await import('highlight.js/lib/languages/cs')).default); + return hljs.registerLanguage('cs', (await import('hljs9/lib/languages/cs')).default); case 'csp': - return hljs.registerLanguage('csp', (await import('highlight.js/lib/languages/csp')).default); + return hljs.registerLanguage('csp', (await import('hljs9/lib/languages/csp')).default); case 'css': - return hljs.registerLanguage('css', (await import('highlight.js/lib/languages/css')).default); + return hljs.registerLanguage('css', (await import('hljs9/lib/languages/css')).default); case 'd': - return hljs.registerLanguage('d', (await import('highlight.js/lib/languages/d')).default); + return hljs.registerLanguage('d', (await import('hljs9/lib/languages/d')).default); case 'dart': - return hljs.registerLanguage('dart', (await import('highlight.js/lib/languages/dart')).default); + return hljs.registerLanguage('dart', (await import('hljs9/lib/languages/dart')).default); case 'delphi': - return hljs.registerLanguage('delphi', (await import('highlight.js/lib/languages/delphi')).default); + return hljs.registerLanguage('delphi', (await import('hljs9/lib/languages/delphi')).default); case 'diff': - return hljs.registerLanguage('diff', (await import('highlight.js/lib/languages/diff')).default); + return hljs.registerLanguage('diff', (await import('hljs9/lib/languages/diff')).default); case 'django': - return hljs.registerLanguage('django', (await import('highlight.js/lib/languages/django')).default); + return hljs.registerLanguage('django', (await import('hljs9/lib/languages/django')).default); case 'dns': - return hljs.registerLanguage('dns', (await import('highlight.js/lib/languages/dns')).default); + return hljs.registerLanguage('dns', (await import('hljs9/lib/languages/dns')).default); case 'dockerfile': - return hljs.registerLanguage('dockerfile', (await import('highlight.js/lib/languages/dockerfile')).default); + return hljs.registerLanguage('dockerfile', (await import('hljs9/lib/languages/dockerfile')).default); case 'dos': - return hljs.registerLanguage('dos', (await import('highlight.js/lib/languages/dos')).default); + return hljs.registerLanguage('dos', (await import('hljs9/lib/languages/dos')).default); case 'dsconfig': - return hljs.registerLanguage('dsconfig', (await import('highlight.js/lib/languages/dsconfig')).default); + return hljs.registerLanguage('dsconfig', (await import('hljs9/lib/languages/dsconfig')).default); case 'dts': - return hljs.registerLanguage('dts', (await import('highlight.js/lib/languages/dts')).default); + return hljs.registerLanguage('dts', (await import('hljs9/lib/languages/dts')).default); case 'dust': - return hljs.registerLanguage('dust', (await import('highlight.js/lib/languages/dust')).default); + return hljs.registerLanguage('dust', (await import('hljs9/lib/languages/dust')).default); case 'ebnf': - return hljs.registerLanguage('ebnf', (await import('highlight.js/lib/languages/ebnf')).default); + return hljs.registerLanguage('ebnf', (await import('hljs9/lib/languages/ebnf')).default); case 'elixir': - return hljs.registerLanguage('elixir', (await import('highlight.js/lib/languages/elixir')).default); + return hljs.registerLanguage('elixir', (await import('hljs9/lib/languages/elixir')).default); case 'elm': - return hljs.registerLanguage('elm', (await import('highlight.js/lib/languages/elm')).default); + return hljs.registerLanguage('elm', (await import('hljs9/lib/languages/elm')).default); case 'erb': - return hljs.registerLanguage('erb', (await import('highlight.js/lib/languages/erb')).default); + return hljs.registerLanguage('erb', (await import('hljs9/lib/languages/erb')).default); case 'erlang': - return hljs.registerLanguage('erlang', (await import('highlight.js/lib/languages/erlang')).default); + return hljs.registerLanguage('erlang', (await import('hljs9/lib/languages/erlang')).default); case 'excel': - return hljs.registerLanguage('excel', (await import('highlight.js/lib/languages/excel')).default); + return hljs.registerLanguage('excel', (await import('hljs9/lib/languages/excel')).default); case 'fix': - return hljs.registerLanguage('fix', (await import('highlight.js/lib/languages/fix')).default); + return hljs.registerLanguage('fix', (await import('hljs9/lib/languages/fix')).default); case 'flix': - return hljs.registerLanguage('flix', (await import('highlight.js/lib/languages/flix')).default); + return hljs.registerLanguage('flix', (await import('hljs9/lib/languages/flix')).default); case 'fortran': - return hljs.registerLanguage('fortran', (await import('highlight.js/lib/languages/fortran')).default); + return hljs.registerLanguage('fortran', (await import('hljs9/lib/languages/fortran')).default); case 'fsharp': - return hljs.registerLanguage('fsharp', (await import('highlight.js/lib/languages/fsharp')).default); + return hljs.registerLanguage('fsharp', (await import('hljs9/lib/languages/fsharp')).default); case 'gams': - return hljs.registerLanguage('gams', (await import('highlight.js/lib/languages/gams')).default); + return hljs.registerLanguage('gams', (await import('hljs9/lib/languages/gams')).default); case 'gauss': - return hljs.registerLanguage('gauss', (await import('highlight.js/lib/languages/gauss')).default); + return hljs.registerLanguage('gauss', (await import('hljs9/lib/languages/gauss')).default); case 'gcode': - return hljs.registerLanguage('gcode', (await import('highlight.js/lib/languages/gcode')).default); + return hljs.registerLanguage('gcode', (await import('hljs9/lib/languages/gcode')).default); case 'gherkin': - return hljs.registerLanguage('gherkin', (await import('highlight.js/lib/languages/gherkin')).default); + return hljs.registerLanguage('gherkin', (await import('hljs9/lib/languages/gherkin')).default); case 'glsl': - return hljs.registerLanguage('glsl', (await import('highlight.js/lib/languages/glsl')).default); + return hljs.registerLanguage('glsl', (await import('hljs9/lib/languages/glsl')).default); case 'go': - return hljs.registerLanguage('go', (await import('highlight.js/lib/languages/go')).default); + return hljs.registerLanguage('go', (await import('hljs9/lib/languages/go')).default); case 'golo': - return hljs.registerLanguage('golo', (await import('highlight.js/lib/languages/golo')).default); + return hljs.registerLanguage('golo', (await import('hljs9/lib/languages/golo')).default); case 'gradle': - return hljs.registerLanguage('gradle', (await import('highlight.js/lib/languages/gradle')).default); + return hljs.registerLanguage('gradle', (await import('hljs9/lib/languages/gradle')).default); case 'groovy': - return hljs.registerLanguage('groovy', (await import('highlight.js/lib/languages/groovy')).default); + return hljs.registerLanguage('groovy', (await import('hljs9/lib/languages/groovy')).default); case 'haml': - return hljs.registerLanguage('haml', (await import('highlight.js/lib/languages/haml')).default); + return hljs.registerLanguage('haml', (await import('hljs9/lib/languages/haml')).default); case 'handlebars': - return hljs.registerLanguage('handlebars', (await import('highlight.js/lib/languages/handlebars')).default); + return hljs.registerLanguage('handlebars', (await import('hljs9/lib/languages/handlebars')).default); case 'haskell': - return hljs.registerLanguage('haskell', (await import('highlight.js/lib/languages/haskell')).default); + return hljs.registerLanguage('haskell', (await import('hljs9/lib/languages/haskell')).default); case 'haxe': - return hljs.registerLanguage('haxe', (await import('highlight.js/lib/languages/haxe')).default); + return hljs.registerLanguage('haxe', (await import('hljs9/lib/languages/haxe')).default); case 'hsp': - return hljs.registerLanguage('hsp', (await import('highlight.js/lib/languages/hsp')).default); + return hljs.registerLanguage('hsp', (await import('hljs9/lib/languages/hsp')).default); case 'htmlbars': - return hljs.registerLanguage('htmlbars', (await import('highlight.js/lib/languages/htmlbars')).default); + return hljs.registerLanguage('htmlbars', (await import('hljs9/lib/languages/htmlbars')).default); case 'http': - return hljs.registerLanguage('http', (await import('highlight.js/lib/languages/http')).default); + return hljs.registerLanguage('http', (await import('hljs9/lib/languages/http')).default); case 'hy': - return hljs.registerLanguage('hy', (await import('highlight.js/lib/languages/hy')).default); + return hljs.registerLanguage('hy', (await import('hljs9/lib/languages/hy')).default); case 'inform7': - return hljs.registerLanguage('inform7', (await import('highlight.js/lib/languages/inform7')).default); + return hljs.registerLanguage('inform7', (await import('hljs9/lib/languages/inform7')).default); case 'ini': - return hljs.registerLanguage('ini', (await import('highlight.js/lib/languages/ini')).default); + return hljs.registerLanguage('ini', (await import('hljs9/lib/languages/ini')).default); case 'irpf90': - return hljs.registerLanguage('irpf90', (await import('highlight.js/lib/languages/irpf90')).default); + return hljs.registerLanguage('irpf90', (await import('hljs9/lib/languages/irpf90')).default); case 'java': - return hljs.registerLanguage('java', (await import('highlight.js/lib/languages/java')).default); + return hljs.registerLanguage('java', (await import('hljs9/lib/languages/java')).default); case 'javascript': - return hljs.registerLanguage('javascript', (await import('highlight.js/lib/languages/javascript')).default); + return hljs.registerLanguage('javascript', (await import('hljs9/lib/languages/javascript')).default); case 'jboss-cli': - return hljs.registerLanguage('jboss-cli', (await import('highlight.js/lib/languages/jboss-cli')).default); + return hljs.registerLanguage('jboss-cli', (await import('hljs9/lib/languages/jboss-cli')).default); case 'json': - return hljs.registerLanguage('json', (await import('highlight.js/lib/languages/json')).default); + return hljs.registerLanguage('json', (await import('hljs9/lib/languages/json')).default); case 'julia': - return hljs.registerLanguage('julia', (await import('highlight.js/lib/languages/julia')).default); + return hljs.registerLanguage('julia', (await import('hljs9/lib/languages/julia')).default); case 'julia-repl': - return hljs.registerLanguage('julia-repl', (await import('highlight.js/lib/languages/julia-repl')).default); + return hljs.registerLanguage('julia-repl', (await import('hljs9/lib/languages/julia-repl')).default); case 'kotlin': - return hljs.registerLanguage('kotlin', (await import('highlight.js/lib/languages/kotlin')).default); + return hljs.registerLanguage('kotlin', (await import('hljs9/lib/languages/kotlin')).default); case 'lasso': - return hljs.registerLanguage('lasso', (await import('highlight.js/lib/languages/lasso')).default); + return hljs.registerLanguage('lasso', (await import('hljs9/lib/languages/lasso')).default); case 'ldif': - return hljs.registerLanguage('ldif', (await import('highlight.js/lib/languages/ldif')).default); + return hljs.registerLanguage('ldif', (await import('hljs9/lib/languages/ldif')).default); case 'leaf': - return hljs.registerLanguage('leaf', (await import('highlight.js/lib/languages/leaf')).default); + return hljs.registerLanguage('leaf', (await import('hljs9/lib/languages/leaf')).default); case 'less': - return hljs.registerLanguage('less', (await import('highlight.js/lib/languages/less')).default); + return hljs.registerLanguage('less', (await import('hljs9/lib/languages/less')).default); case 'lisp': - return hljs.registerLanguage('lisp', (await import('highlight.js/lib/languages/lisp')).default); + return hljs.registerLanguage('lisp', (await import('hljs9/lib/languages/lisp')).default); case 'livecodeserver': - return hljs.registerLanguage('livecodeserver', (await import('highlight.js/lib/languages/livecodeserver')).default); + return hljs.registerLanguage('livecodeserver', (await import('hljs9/lib/languages/livecodeserver')).default); case 'livescript': - return hljs.registerLanguage('livescript', (await import('highlight.js/lib/languages/livescript')).default); + return hljs.registerLanguage('livescript', (await import('hljs9/lib/languages/livescript')).default); case 'llvm': - return hljs.registerLanguage('llvm', (await import('highlight.js/lib/languages/llvm')).default); + return hljs.registerLanguage('llvm', (await import('hljs9/lib/languages/llvm')).default); case 'lsl': - return hljs.registerLanguage('lsl', (await import('highlight.js/lib/languages/lsl')).default); + return hljs.registerLanguage('lsl', (await import('hljs9/lib/languages/lsl')).default); case 'lua': - return hljs.registerLanguage('lua', (await import('highlight.js/lib/languages/lua')).default); + return hljs.registerLanguage('lua', (await import('hljs9/lib/languages/lua')).default); case 'makefile': - return hljs.registerLanguage('makefile', (await import('highlight.js/lib/languages/makefile')).default); + return hljs.registerLanguage('makefile', (await import('hljs9/lib/languages/makefile')).default); case 'markdown': - return hljs.registerLanguage('markdown', (await import('highlight.js/lib/languages/markdown')).default); + return hljs.registerLanguage('markdown', (await import('hljs9/lib/languages/markdown')).default); case 'mathematica': - return hljs.registerLanguage('mathematica', (await import('highlight.js/lib/languages/mathematica')).default); + return hljs.registerLanguage('mathematica', (await import('hljs9/lib/languages/mathematica')).default); case 'matlab': - return hljs.registerLanguage('matlab', (await import('highlight.js/lib/languages/matlab')).default); + return hljs.registerLanguage('matlab', (await import('hljs9/lib/languages/matlab')).default); case 'maxima': - return hljs.registerLanguage('maxima', (await import('highlight.js/lib/languages/maxima')).default); + return hljs.registerLanguage('maxima', (await import('hljs9/lib/languages/maxima')).default); case 'mel': - return hljs.registerLanguage('mel', (await import('highlight.js/lib/languages/mel')).default); + return hljs.registerLanguage('mel', (await import('hljs9/lib/languages/mel')).default); case 'mercury': - return hljs.registerLanguage('mercury', (await import('highlight.js/lib/languages/mercury')).default); + return hljs.registerLanguage('mercury', (await import('hljs9/lib/languages/mercury')).default); case 'mipsasm': - return hljs.registerLanguage('mipsasm', (await import('highlight.js/lib/languages/mipsasm')).default); + return hljs.registerLanguage('mipsasm', (await import('hljs9/lib/languages/mipsasm')).default); case 'mizar': - return hljs.registerLanguage('mizar', (await import('highlight.js/lib/languages/mizar')).default); + return hljs.registerLanguage('mizar', (await import('hljs9/lib/languages/mizar')).default); case 'perl': - return hljs.registerLanguage('perl', (await import('highlight.js/lib/languages/perl')).default); + return hljs.registerLanguage('perl', (await import('hljs9/lib/languages/perl')).default); case 'mojolicious': - return hljs.registerLanguage('mojolicious', (await import('highlight.js/lib/languages/mojolicious')).default); + return hljs.registerLanguage('mojolicious', (await import('hljs9/lib/languages/mojolicious')).default); case 'monkey': - return hljs.registerLanguage('monkey', (await import('highlight.js/lib/languages/monkey')).default); + return hljs.registerLanguage('monkey', (await import('hljs9/lib/languages/monkey')).default); case 'moonscript': - return hljs.registerLanguage('moonscript', (await import('highlight.js/lib/languages/moonscript')).default); + return hljs.registerLanguage('moonscript', (await import('hljs9/lib/languages/moonscript')).default); case 'n1ql': - return hljs.registerLanguage('n1ql', (await import('highlight.js/lib/languages/n1ql')).default); + return hljs.registerLanguage('n1ql', (await import('hljs9/lib/languages/n1ql')).default); case 'nginx': - return hljs.registerLanguage('nginx', (await import('highlight.js/lib/languages/nginx')).default); + return hljs.registerLanguage('nginx', (await import('hljs9/lib/languages/nginx')).default); case 'nimrod': - return hljs.registerLanguage('nimrod', (await import('highlight.js/lib/languages/nimrod')).default); + return hljs.registerLanguage('nimrod', (await import('hljs9/lib/languages/nimrod')).default); case 'nix': - return hljs.registerLanguage('nix', (await import('highlight.js/lib/languages/nix')).default); + return hljs.registerLanguage('nix', (await import('hljs9/lib/languages/nix')).default); case 'nsis': - return hljs.registerLanguage('nsis', (await import('highlight.js/lib/languages/nsis')).default); + return hljs.registerLanguage('nsis', (await import('hljs9/lib/languages/nsis')).default); case 'objectivec': - return hljs.registerLanguage('objectivec', (await import('highlight.js/lib/languages/objectivec')).default); + return hljs.registerLanguage('objectivec', (await import('hljs9/lib/languages/objectivec')).default); case 'ocaml': - return hljs.registerLanguage('ocaml', (await import('highlight.js/lib/languages/ocaml')).default); + return hljs.registerLanguage('ocaml', (await import('hljs9/lib/languages/ocaml')).default); case 'openscad': - return hljs.registerLanguage('openscad', (await import('highlight.js/lib/languages/openscad')).default); + return hljs.registerLanguage('openscad', (await import('hljs9/lib/languages/openscad')).default); case 'oxygene': - return hljs.registerLanguage('oxygene', (await import('highlight.js/lib/languages/oxygene')).default); + return hljs.registerLanguage('oxygene', (await import('hljs9/lib/languages/oxygene')).default); case 'parser3': - return hljs.registerLanguage('parser3', (await import('highlight.js/lib/languages/parser3')).default); + return hljs.registerLanguage('parser3', (await import('hljs9/lib/languages/parser3')).default); case 'pf': - return hljs.registerLanguage('pf', (await import('highlight.js/lib/languages/pf')).default); + return hljs.registerLanguage('pf', (await import('hljs9/lib/languages/pf')).default); case 'php': - return hljs.registerLanguage('php', (await import('highlight.js/lib/languages/php')).default); + return hljs.registerLanguage('php', (await import('hljs9/lib/languages/php')).default); case 'pony': - return hljs.registerLanguage('pony', (await import('highlight.js/lib/languages/pony')).default); + return hljs.registerLanguage('pony', (await import('hljs9/lib/languages/pony')).default); case 'powershell': - return hljs.registerLanguage('powershell', (await import('highlight.js/lib/languages/powershell')).default); + return hljs.registerLanguage('powershell', (await import('hljs9/lib/languages/powershell')).default); case 'processing': - return hljs.registerLanguage('processing', (await import('highlight.js/lib/languages/processing')).default); + return hljs.registerLanguage('processing', (await import('hljs9/lib/languages/processing')).default); case 'profile': - return hljs.registerLanguage('profile', (await import('highlight.js/lib/languages/profile')).default); + return hljs.registerLanguage('profile', (await import('hljs9/lib/languages/profile')).default); case 'prolog': - return hljs.registerLanguage('prolog', (await import('highlight.js/lib/languages/prolog')).default); + return hljs.registerLanguage('prolog', (await import('hljs9/lib/languages/prolog')).default); case 'protobuf': - return hljs.registerLanguage('protobuf', (await import('highlight.js/lib/languages/protobuf')).default); + return hljs.registerLanguage('protobuf', (await import('hljs9/lib/languages/protobuf')).default); case 'puppet': - return hljs.registerLanguage('puppet', (await import('highlight.js/lib/languages/puppet')).default); + return hljs.registerLanguage('puppet', (await import('hljs9/lib/languages/puppet')).default); case 'purebasic': - return hljs.registerLanguage('purebasic', (await import('highlight.js/lib/languages/purebasic')).default); + return hljs.registerLanguage('purebasic', (await import('hljs9/lib/languages/purebasic')).default); case 'python': - return hljs.registerLanguage('python', (await import('highlight.js/lib/languages/python')).default); + return hljs.registerLanguage('python', (await import('hljs9/lib/languages/python')).default); case 'q': - return hljs.registerLanguage('q', (await import('highlight.js/lib/languages/q')).default); + return hljs.registerLanguage('q', (await import('hljs9/lib/languages/q')).default); case 'qml': - return hljs.registerLanguage('qml', (await import('highlight.js/lib/languages/qml')).default); + return hljs.registerLanguage('qml', (await import('hljs9/lib/languages/qml')).default); case 'r': - return hljs.registerLanguage('r', (await import('highlight.js/lib/languages/r')).default); + return hljs.registerLanguage('r', (await import('hljs9/lib/languages/r')).default); case 'rib': - return hljs.registerLanguage('rib', (await import('highlight.js/lib/languages/rib')).default); + return hljs.registerLanguage('rib', (await import('hljs9/lib/languages/rib')).default); case 'roboconf': - return hljs.registerLanguage('roboconf', (await import('highlight.js/lib/languages/roboconf')).default); + return hljs.registerLanguage('roboconf', (await import('hljs9/lib/languages/roboconf')).default); case 'rsl': - return hljs.registerLanguage('rsl', (await import('highlight.js/lib/languages/rsl')).default); + return hljs.registerLanguage('rsl', (await import('hljs9/lib/languages/rsl')).default); case 'ruleslanguage': - return hljs.registerLanguage('ruleslanguage', (await import('highlight.js/lib/languages/ruleslanguage')).default); + return hljs.registerLanguage('ruleslanguage', (await import('hljs9/lib/languages/ruleslanguage')).default); case 'rust': - return hljs.registerLanguage('rust', (await import('highlight.js/lib/languages/rust')).default); + return hljs.registerLanguage('rust', (await import('hljs9/lib/languages/rust')).default); case 'scala': - return hljs.registerLanguage('scala', (await import('highlight.js/lib/languages/scala')).default); + return hljs.registerLanguage('scala', (await import('hljs9/lib/languages/scala')).default); case 'scheme': - return hljs.registerLanguage('scheme', (await import('highlight.js/lib/languages/scheme')).default); + return hljs.registerLanguage('scheme', (await import('hljs9/lib/languages/scheme')).default); case 'scilab': - return hljs.registerLanguage('scilab', (await import('highlight.js/lib/languages/scilab')).default); + return hljs.registerLanguage('scilab', (await import('hljs9/lib/languages/scilab')).default); case 'scss': - return hljs.registerLanguage('scss', (await import('highlight.js/lib/languages/scss')).default); + return hljs.registerLanguage('scss', (await import('hljs9/lib/languages/scss')).default); case 'shell': - return hljs.registerLanguage('shell', (await import('highlight.js/lib/languages/shell')).default); + return hljs.registerLanguage('shell', (await import('hljs9/lib/languages/shell')).default); case 'smali': - return hljs.registerLanguage('smali', (await import('highlight.js/lib/languages/smali')).default); + return hljs.registerLanguage('smali', (await import('hljs9/lib/languages/smali')).default); case 'smalltalk': - return hljs.registerLanguage('smalltalk', (await import('highlight.js/lib/languages/smalltalk')).default); + return hljs.registerLanguage('smalltalk', (await import('hljs9/lib/languages/smalltalk')).default); case 'sml': - return hljs.registerLanguage('sml', (await import('highlight.js/lib/languages/sml')).default); + return hljs.registerLanguage('sml', (await import('hljs9/lib/languages/sml')).default); case 'sqf': - return hljs.registerLanguage('sqf', (await import('highlight.js/lib/languages/sqf')).default); + return hljs.registerLanguage('sqf', (await import('hljs9/lib/languages/sqf')).default); case 'sql': - return hljs.registerLanguage('sql', (await import('highlight.js/lib/languages/sql')).default); + return hljs.registerLanguage('sql', (await import('hljs9/lib/languages/sql')).default); case 'stan': - return hljs.registerLanguage('stan', (await import('highlight.js/lib/languages/stan')).default); + return hljs.registerLanguage('stan', (await import('hljs9/lib/languages/stan')).default); case 'stata': - return hljs.registerLanguage('stata', (await import('highlight.js/lib/languages/stata')).default); + return hljs.registerLanguage('stata', (await import('hljs9/lib/languages/stata')).default); case 'step21': - return hljs.registerLanguage('step21', (await import('highlight.js/lib/languages/step21')).default); + return hljs.registerLanguage('step21', (await import('hljs9/lib/languages/step21')).default); case 'stylus': - return hljs.registerLanguage('stylus', (await import('highlight.js/lib/languages/stylus')).default); + return hljs.registerLanguage('stylus', (await import('hljs9/lib/languages/stylus')).default); case 'subunit': - return hljs.registerLanguage('subunit', (await import('highlight.js/lib/languages/subunit')).default); + return hljs.registerLanguage('subunit', (await import('hljs9/lib/languages/subunit')).default); case 'swift': - return hljs.registerLanguage('swift', (await import('highlight.js/lib/languages/swift')).default); + return hljs.registerLanguage('swift', (await import('hljs9/lib/languages/swift')).default); case 'taggerscript': - return hljs.registerLanguage('taggerscript', (await import('highlight.js/lib/languages/taggerscript')).default); + return hljs.registerLanguage('taggerscript', (await import('hljs9/lib/languages/taggerscript')).default); case 'yaml': - return hljs.registerLanguage('yaml', (await import('highlight.js/lib/languages/yaml')).default); + return hljs.registerLanguage('yaml', (await import('hljs9/lib/languages/yaml')).default); case 'tap': - return hljs.registerLanguage('tap', (await import('highlight.js/lib/languages/tap')).default); + return hljs.registerLanguage('tap', (await import('hljs9/lib/languages/tap')).default); case 'tcl': - return hljs.registerLanguage('tcl', (await import('highlight.js/lib/languages/tcl')).default); + return hljs.registerLanguage('tcl', (await import('hljs9/lib/languages/tcl')).default); case 'tex': - return hljs.registerLanguage('tex', (await import('highlight.js/lib/languages/tex')).default); + return hljs.registerLanguage('tex', (await import('hljs9/lib/languages/tex')).default); case 'thrift': - return hljs.registerLanguage('thrift', (await import('highlight.js/lib/languages/thrift')).default); + return hljs.registerLanguage('thrift', (await import('hljs9/lib/languages/thrift')).default); case 'tp': - return hljs.registerLanguage('tp', (await import('highlight.js/lib/languages/tp')).default); + return hljs.registerLanguage('tp', (await import('hljs9/lib/languages/tp')).default); case 'twig': - return hljs.registerLanguage('twig', (await import('highlight.js/lib/languages/twig')).default); + return hljs.registerLanguage('twig', (await import('hljs9/lib/languages/twig')).default); case 'typescript': - return hljs.registerLanguage('typescript', (await import('highlight.js/lib/languages/typescript')).default); + return hljs.registerLanguage('typescript', (await import('hljs9/lib/languages/typescript')).default); case 'vala': - return hljs.registerLanguage('vala', (await import('highlight.js/lib/languages/vala')).default); + return hljs.registerLanguage('vala', (await import('hljs9/lib/languages/vala')).default); case 'vbnet': - return hljs.registerLanguage('vbnet', (await import('highlight.js/lib/languages/vbnet')).default); + return hljs.registerLanguage('vbnet', (await import('hljs9/lib/languages/vbnet')).default); case 'vbscript': - return hljs.registerLanguage('vbscript', (await import('highlight.js/lib/languages/vbscript')).default); + return hljs.registerLanguage('vbscript', (await import('hljs9/lib/languages/vbscript')).default); case 'vbscript-html': - return hljs.registerLanguage('vbscript-html(', (await import('highlight.js/lib/languages/vbscript-html')).default); + return hljs.registerLanguage('vbscript-html(', (await import('hljs9/lib/languages/vbscript-html')).default); case 'verilog': - return hljs.registerLanguage('verilog', (await import('highlight.js/lib/languages/verilog')).default); + return hljs.registerLanguage('verilog', (await import('hljs9/lib/languages/verilog')).default); case 'vhdl': - return hljs.registerLanguage('vhdl', (await import('highlight.js/lib/languages/vhdl')).default); + return hljs.registerLanguage('vhdl', (await import('hljs9/lib/languages/vhdl')).default); case 'vim': - return hljs.registerLanguage('vim', (await import('highlight.js/lib/languages/vim')).default); + return hljs.registerLanguage('vim', (await import('hljs9/lib/languages/vim')).default); case 'x86asm': - return hljs.registerLanguage('x86asm', (await import('highlight.js/lib/languages/x86asm')).default); + return hljs.registerLanguage('x86asm', (await import('hljs9/lib/languages/x86asm')).default); case 'xl': - return hljs.registerLanguage('xl', (await import('highlight.js/lib/languages/xl')).default); + return hljs.registerLanguage('xl', (await import('hljs9/lib/languages/xl')).default); case 'xquery': - return hljs.registerLanguage('xquery', (await import('highlight.js/lib/languages/xquery')).default); + return hljs.registerLanguage('xquery', (await import('hljs9/lib/languages/xquery')).default); case 'zephir': - return hljs.registerLanguage('zephir', (await import('highlight.js/lib/languages/zephir')).default); + return hljs.registerLanguage('zephir', (await import('hljs9/lib/languages/zephir')).default); default: - return hljs.registerLanguage('plaintext', (await import('highlight.js/lib/languages/plaintext')).default); + return hljs.registerLanguage('plaintext', (await import('hljs9/lib/languages/plaintext')).default); } }; diff --git a/apps/meteor/app/theme/client/imports/general/base_old.css b/apps/meteor/app/theme/client/imports/general/base_old.css index 5e198fed7f87..6278e661c924 100644 --- a/apps/meteor/app/theme/client/imports/general/base_old.css +++ b/apps/meteor/app/theme/client/imports/general/base_old.css @@ -2934,6 +2934,8 @@ .rc-old .highlight-text { padding: 2px; + color: inherit; + border-radius: 15px; background-color: var(--selection-background); } diff --git a/apps/meteor/client/components/CustomText.tsx b/apps/meteor/client/components/CustomText.tsx deleted file mode 100644 index ee6dadf2a8ed..000000000000 --- a/apps/meteor/client/components/CustomText.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React, { memo, ReactElement } from 'react'; - -import { highlightWords as getHighlightHtml } from '../../app/highlight-words/client/helper'; -import Katex from './Katex'; - -type CustomTextProps = { - text: string; - wordsToHighlight?: { - highlight: string; - regex: RegExp; - urlRegex: RegExp; - }[]; - katex?: { - dollarSyntaxEnabled: boolean; - parenthesisSyntaxEnabled: boolean; - }; -}; - -const CustomText = ({ text, wordsToHighlight, katex }: CustomTextProps): ReactElement => { - // TODO: chapter day frontend: remove dangerouslySetInnerHTML, convert to tokens and do not mix with katex - const html = wordsToHighlight?.length ? getHighlightHtml(text, wordsToHighlight) : text; - if (katex) { - return ; - } - - return ; -}; - -export default memo(CustomText); diff --git a/apps/meteor/client/components/Katex.tsx b/apps/meteor/client/components/Katex.tsx deleted file mode 100644 index a7cb3f279f4b..000000000000 --- a/apps/meteor/client/components/Katex.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import React, { memo, ReactElement } from 'react'; - -import { createKatexMessageRendering } from '../../app/katex/client'; - -type KatexProps = { - text: string; - options: { - dollarSyntax: boolean; - parenthesisSyntax: boolean; - }; -}; - -const Katex = ({ text, options }: KatexProps): ReactElement => ( - -); - -export default memo(Katex); diff --git a/apps/meteor/client/components/gazzodown/MarkupInteractionContext.ts b/apps/meteor/client/components/gazzodown/MarkupInteractionContext.ts deleted file mode 100644 index 70d6cb103d27..000000000000 --- a/apps/meteor/client/components/gazzodown/MarkupInteractionContext.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { IRoom, IUser } from '@rocket.chat/core-typings'; -import { createContext, useContext, MouseEvent } from 'react'; - -type UserMention = Pick; -type ChannelMention = Pick; - -type MarkupInteractionContextValue = { - mentions?: UserMention[]; - channels?: ChannelMention[]; - onUserMentionClick?: (username: string) => (e: MouseEvent) => void; - onChannelMentionClick?: (id: string) => (e: MouseEvent) => void; -}; - -export const MarkupInteractionContext = createContext({ - mentions: [], - channels: [], -}); - -export const useMarkupInteractionContext = (): MarkupInteractionContextValue => useContext(MarkupInteractionContext); - -export const useMessageBodyUserMentions = (): UserMention[] => { - const { mentions = [] } = useMarkupInteractionContext(); - return mentions; -}; - -export const useMessageBodyChannelMentions = (): ChannelMention[] => { - const { channels = [] } = useMarkupInteractionContext(); - return channels; -}; - -export const useMessageBodyMentionClick = (): ((username: string) => (e: MouseEvent) => void) => { - const { onUserMentionClick } = useMarkupInteractionContext(); - if (!onUserMentionClick) { - console.warn('onUserMentionClick is not defined'); - return (username: string) => (): void => { - console.log(`onUserMentionClickDefault: ${username}`); - }; - } - return onUserMentionClick; -}; - -export const useMessageBodyChannelMentionClick = (): ((id: string) => (e: MouseEvent) => void) => { - const { onChannelMentionClick } = useMarkupInteractionContext(); - if (!onChannelMentionClick) { - console.warn('onChannelMentionClick is not defined'); - return (username: string) => (): void => { - console.log(`onChannelMentionClickDefault: ${username}`); - }; - } - return onChannelMentionClick; -}; diff --git a/apps/meteor/client/components/gazzodown/blocks/BigEmojiBlock.tsx b/apps/meteor/client/components/gazzodown/blocks/BigEmojiBlock.tsx deleted file mode 100644 index 4c5262fd4ab4..000000000000 --- a/apps/meteor/client/components/gazzodown/blocks/BigEmojiBlock.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; - -import BigEmojiElement from '../elements/BigEmojiElement'; - -type BigEmojiBlockProps = { - emojis: MessageParser.Emoji[]; -}; - -const BigEmojiBlock = ({ emojis }: BigEmojiBlockProps): ReactElement => ( - <> - {emojis.map((emoji, index) => ( - - ))} - -); - -export default BigEmojiBlock; diff --git a/apps/meteor/client/components/gazzodown/blocks/CodeBlock.tsx b/apps/meteor/client/components/gazzodown/blocks/CodeBlock.tsx deleted file mode 100644 index 886ec71f7188..000000000000 --- a/apps/meteor/client/components/gazzodown/blocks/CodeBlock.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement, useEffect, useState } from 'react'; - -import hljs, { register } from '../../../../app/markdown/lib/hljs'; - -type hljsResult = { - language: string; - code: string; - value: string; -}; - -const isHljsResult = (result: any): result is hljsResult => result?.value; - -type CodeBlockProps = { - language?: string; - lines: MessageParser.CodeLine[]; -}; - -const CodeBlock = ({ lines = [], language }: CodeBlockProps): ReactElement => { - const [code, setCode] = useState<(JSX.Element | null)[] | { language: string; code: string }>(() => - lines.map((block, index) => { - switch (block.type) { - case 'CODE_LINE': - return
{block.value.type === 'PLAIN_TEXT' ? block.value.value : null}
; - - default: - return null; - } - }), - ); - - useEffect(() => { - !language || language === 'none' - ? setCode(hljs.highlightAuto(lines.map((line) => line.value.value).join('\n'))) - : register(language).then(() => { - setCode(hljs.highlight(language, lines.map((line) => line.value.value).join('\n'))); - }); - }, [language, lines]); - - return ( - - - \`\`\` -
-
- {isHljsResult(code) ?
: code} - -
- \`\`\` -
-
- ); -}; - -export default CodeBlock; diff --git a/apps/meteor/client/components/gazzodown/blocks/PreviewBigEmojiBlock.tsx b/apps/meteor/client/components/gazzodown/blocks/PreviewBigEmojiBlock.tsx deleted file mode 100644 index 1ba958fc9aa2..000000000000 --- a/apps/meteor/client/components/gazzodown/blocks/PreviewBigEmojiBlock.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; - -import PreviewEmojiElement from '../elements/PreviewEmojiElement'; - -type PreviewBigEmojiBlockProps = { - emojis: MessageParser.Emoji[]; -}; - -const PreviewBigEmojiBlock = ({ emojis }: PreviewBigEmojiBlockProps): ReactElement => ( - <> - {emojis.map((emoji, index) => ( - - ))} - -); - -export default PreviewBigEmojiBlock; diff --git a/apps/meteor/client/components/gazzodown/blocks/TaskListBlock.tsx b/apps/meteor/client/components/gazzodown/blocks/TaskListBlock.tsx deleted file mode 100644 index 1f0cfe8196fe..000000000000 --- a/apps/meteor/client/components/gazzodown/blocks/TaskListBlock.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { CheckBox } from '@rocket.chat/fuselage'; -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; - -import InlineElements from '../elements/InlineElements'; - -type TaskListBlockProps = { - tasks: MessageParser.Task[]; -}; - -const TaksListBlock = ({ tasks }: TaskListBlockProps): ReactElement => ( -
    - {tasks.map((item, index) => ( -
  • - -
  • - ))} -
-); - -export default TaksListBlock; diff --git a/apps/meteor/client/components/gazzodown/elements/BigEmojiElement.tsx b/apps/meteor/client/components/gazzodown/elements/BigEmojiElement.tsx deleted file mode 100644 index 0387d1532ca8..000000000000 --- a/apps/meteor/client/components/gazzodown/elements/BigEmojiElement.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { MessageEmoji } from '@rocket.chat/fuselage'; -import React, { ReactElement, useMemo } from 'react'; - -import { getEmojiClassNameAndDataTitle } from '../../../lib/utils/renderEmoji'; - -type BigEmojiElementProps = { - handle: string; -}; - -const BigEmojiElement = ({ handle }: BigEmojiElementProps): ReactElement => { - const emojiProps = useMemo(() => { - const props = getEmojiClassNameAndDataTitle(`:${handle}:`); - - if (!props.className && !props.name) { - return undefined; - } - - return props; - }, [handle]); - - if (!emojiProps) { - return <>:${handle}:; - } - - return ( - - :{handle}: - - ); -}; - -export default BigEmojiElement; diff --git a/apps/meteor/client/components/gazzodown/elements/ChannelMentionElement.tsx b/apps/meteor/client/components/gazzodown/elements/ChannelMentionElement.tsx deleted file mode 100644 index 2d17fbddc952..000000000000 --- a/apps/meteor/client/components/gazzodown/elements/ChannelMentionElement.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import React, { memo, ReactElement } from 'react'; - -import { useMessageBodyChannelMentions, useMessageBodyChannelMentionClick } from '../MarkupInteractionContext'; - -type ChannelMentionElementProps = { - mention: string; -}; - -const ChannelMentionElement = ({ mention }: ChannelMentionElementProps): ReactElement => { - const mentions = useMessageBodyChannelMentions(); - const mentioned = mentions.find((mentioned) => mentioned.name === mention); - const onChannelMentionClick = useMessageBodyChannelMentionClick(); - - if (!mentioned) { - return <>#{mention}; - } - - return ( - - #{mention} - - ); -}; - -export default memo(ChannelMentionElement); diff --git a/apps/meteor/client/components/gazzodown/elements/EmojiElement.tsx b/apps/meteor/client/components/gazzodown/elements/EmojiElement.tsx deleted file mode 100644 index a8c5f15db5bf..000000000000 --- a/apps/meteor/client/components/gazzodown/elements/EmojiElement.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { MessageEmoji } from '@rocket.chat/fuselage'; -import React, { ReactElement, useMemo } from 'react'; - -import { getEmojiClassNameAndDataTitle } from '../../../lib/utils/renderEmoji'; - -type EmojiElementProps = { - handle: string; -}; - -const EmojiElement = ({ handle }: EmojiElementProps): ReactElement => { - const emojiProps = useMemo(() => { - const props = getEmojiClassNameAndDataTitle(`:${handle}:`); - - if (!props.className && !props.name) { - return undefined; - } - - return props; - }, [handle]); - - if (!emojiProps) { - return <>:${handle}:; - } - - return :{handle}:; -}; - -export default EmojiElement; diff --git a/apps/meteor/client/components/gazzodown/elements/LinkSpan.tsx b/apps/meteor/client/components/gazzodown/elements/LinkSpan.tsx deleted file mode 100644 index 581ddc9970dc..000000000000 --- a/apps/meteor/client/components/gazzodown/elements/LinkSpan.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; - -import { baseURI } from '../../../lib/baseURI'; -import BoldSpan from './BoldSpan'; -import ItalicSpan from './ItalicSpan'; -import PlainSpan from './PlainSpan'; -import StrikeSpan from './StrikeSpan'; - -type LinkSpanProps = { - href: string; - label: MessageParser.Markup; -}; - -const LinkSpan = ({ href, label }: LinkSpanProps): ReactElement => { - const attrs = href.indexOf(baseURI) !== 0 ? { rel: 'noopener noreferrer', target: '_blank' } : {}; - - return ( - - {((block: MessageParser.Markup): JSX.Element | string | null => { - switch (block.type) { - case 'PLAIN_TEXT': - return ; - - case 'STRIKE': - return ; - - case 'ITALIC': - return ; - - case 'BOLD': - return ; - - default: - return null; - } - })(label)} - - ); -}; - -export default LinkSpan; diff --git a/apps/meteor/client/components/gazzodown/elements/PlainSpan.tsx b/apps/meteor/client/components/gazzodown/elements/PlainSpan.tsx deleted file mode 100644 index a82d13b9cbb6..000000000000 --- a/apps/meteor/client/components/gazzodown/elements/PlainSpan.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React, { memo, ReactElement } from 'react'; - -import { useMessageListHighlights, useMessageListKatex } from '../../../views/room/MessageList/contexts/MessageListContext'; -import CustomText from '../../CustomText'; - -type PlainSpanProps = { - text: string; -}; - -const PlainSpan = ({ text }: PlainSpanProps): ReactElement => { - const highlights = useMessageListHighlights(); - const katex = useMessageListKatex(); - - if (highlights || katex) { - return ; - } - - return <>{text}; -}; - -export default memo(PlainSpan); diff --git a/apps/meteor/client/components/gazzodown/elements/PreviewEmojiElement.tsx b/apps/meteor/client/components/gazzodown/elements/PreviewEmojiElement.tsx deleted file mode 100644 index 4976666f4707..000000000000 --- a/apps/meteor/client/components/gazzodown/elements/PreviewEmojiElement.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { ThreadMessageEmoji } from '@rocket.chat/fuselage'; -import React, { ReactElement, useMemo } from 'react'; - -import { getEmojiClassNameAndDataTitle } from '../../../lib/utils/renderEmoji'; - -type PreviewEmojiElementProps = { - handle: string; -}; - -const PreviewEmojiElement = ({ handle }: PreviewEmojiElementProps): ReactElement => { - const emojiProps = useMemo(() => { - const props = getEmojiClassNameAndDataTitle(`:${handle}:`); - - if (!props.className && !props.name) { - return undefined; - } - - return props; - }, [handle]); - - if (!emojiProps) { - return <>:${handle}:; - } - - return :{handle}:; -}; - -export default PreviewEmojiElement; diff --git a/apps/meteor/client/components/gazzodown/elements/PreviewInlineElements.tsx b/apps/meteor/client/components/gazzodown/elements/PreviewInlineElements.tsx deleted file mode 100644 index 096fa7438de5..000000000000 --- a/apps/meteor/client/components/gazzodown/elements/PreviewInlineElements.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { Fragment, ReactElement } from 'react'; - -import PreviewColorElement from './PreviewColorElement'; -import PreviewEmojiElement from './PreviewEmojiElement'; - -type PreviewInlineElementsProps = { - children: MessageParser.Inlines[]; -}; - -const PreviewInlineElements = ({ children }: PreviewInlineElementsProps): ReactElement => ( - <> - {children.map((child, index) => { - switch (child.type) { - case 'BOLD': - case 'ITALIC': - case 'STRIKE': - return ; - - case 'LINK': - return ; - - case 'PLAIN_TEXT': - return ; - - case 'IMAGE': - return ; - - case 'MENTION_USER': - return @{child.value.value}; - - case 'MENTION_CHANNEL': - return #{child.value.value}; - - case 'INLINE_CODE': - return ; - - case 'EMOJI': - return ; - - case 'COLOR': - return ; - - default: - return null; - } - })} - -); - -export default PreviewInlineElements; diff --git a/apps/meteor/client/components/gazzodown/elements/UserMentionElement.tsx b/apps/meteor/client/components/gazzodown/elements/UserMentionElement.tsx deleted file mode 100644 index 8a0b63033c25..000000000000 --- a/apps/meteor/client/components/gazzodown/elements/UserMentionElement.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { useUserId } from '@rocket.chat/ui-contexts'; -import React, { memo, ReactElement, useMemo } from 'react'; - -import { useMessageBodyUserMentions, useMessageBodyMentionClick } from '../MarkupInteractionContext'; - -type UserMentionElementProps = { - mention: string; -}; - -const UserMentionElement = ({ mention }: UserMentionElementProps): ReactElement => { - const uid = useUserId(); - const mentions = useMessageBodyUserMentions(); - const mentioned = mentions.find((mentioned) => mentioned.username === mention); - const onUserMentionClick = useMessageBodyMentionClick(); - - const classNames = useMemo(() => { - if (mention === 'all') { - return 'mention-link mention-link--all mention-link--group'; - } - - if (mention === 'here') { - return 'mention-link mention-link--here mention-link--group'; - } - - if (mentioned && mentioned._id === uid) { - return 'mention-link mention-link--me mention-link--user'; - } - - return 'mention-link mention-link--user'; - }, [mention, mentioned, uid]); - - if (!mentioned) { - return <>@{mention}; - } - - return ( - - {mentioned.name || mention} - - ); -}; - -export default memo(UserMentionElement); diff --git a/apps/meteor/client/hooks/useHighlightedCode.ts b/apps/meteor/client/hooks/useHighlightedCode.ts index a09680b8bdfe..43c4a5e6ea58 100644 --- a/apps/meteor/client/hooks/useHighlightedCode.ts +++ b/apps/meteor/client/hooks/useHighlightedCode.ts @@ -1,4 +1,3 @@ -// import hljs from 'highlight.js'; import { useMemo } from 'react'; import hljs from '../../app/markdown/lib/hljs'; diff --git a/apps/meteor/client/startup/startup.ts b/apps/meteor/client/startup/startup.ts index ac1d44ede102..00619c968487 100644 --- a/apps/meteor/client/startup/startup.ts +++ b/apps/meteor/client/startup/startup.ts @@ -10,7 +10,7 @@ import { hasPermission } from '../../app/authorization/client'; import { register } from '../../app/markdown/lib/hljs'; import { settings } from '../../app/settings/client'; import { getUserPreference, t } from '../../app/utils/client'; -import 'highlight.js/styles/github.css'; +import 'hljs9/styles/github.css'; import * as banners from '../lib/banners'; import { synchronizeUserData, removeLocalUserData } from '../lib/userData'; import { fireGlobalEvent } from '../lib/utils/fireGlobalEvent'; diff --git a/apps/meteor/client/views/room/MessageList/components/MessageContentBody.tsx b/apps/meteor/client/views/room/MessageList/components/MessageContentBody.tsx index 30e91f803638..0bf591ac6852 100644 --- a/apps/meteor/client/views/room/MessageList/components/MessageContentBody.tsx +++ b/apps/meteor/client/views/room/MessageList/components/MessageContentBody.tsx @@ -2,13 +2,30 @@ import { IMessage } from '@rocket.chat/core-typings'; import { css } from '@rocket.chat/css-in-js'; import { Box } from '@rocket.chat/fuselage'; import colors from '@rocket.chat/fuselage-tokens/colors'; -import React, { ReactElement } from 'react'; +import { MarkupInteractionContext, Markup, UserMention, ChannelMention } from '@rocket.chat/gazzodown'; +import { escapeRegExp } from '@rocket.chat/string-helpers'; +import React, { ReactElement, useCallback, useMemo } from 'react'; -import Markup from '../../../../components/gazzodown/Markup'; -import { MarkupInteractionContext } from '../../../../components/gazzodown/MarkupInteractionContext'; +import { emoji } from '../../../../../app/emoji/client'; import { useMessageActions } from '../../contexts/MessageContext'; +import { useMessageListHighlights } from '../contexts/MessageListContext'; import { useParsedMessage } from '../hooks/useParsedMessage'; +const detectEmoji = (text: string): { name: string; className: string; image?: string; content: string }[] => { + const html = Object.values(emoji.packages) + .reverse() + .reduce((html, { render }) => render(html), text); + + const div = document.createElement('div'); + div.innerHTML = html; + return Array.from(div.querySelectorAll('span')).map((span) => ({ + name: span.title, + className: span.className, + image: span.style.backgroundImage || undefined, + content: span.innerText, + })); +}; + type MessageContentBodyProps = { message: IMessage; }; @@ -16,10 +33,51 @@ type MessageContentBodyProps = { const MessageContentBody = ({ message }: MessageContentBodyProps): ReactElement => { const tokens = useParsedMessage(message); + const highlights = useMessageListHighlights(); + const highlightRegex = useMemo(() => { + if (!highlights || !highlights.length) { + return; + } + + const alternatives = highlights.map(({ highlight }) => escapeRegExp(highlight)).join('|'); + const expression = `(?=^|\\b|[\\s\\n\\r\\t.,،'\\\"\\+!?:-])(${alternatives})(?=$|\\b|[\\s\\n\\r\\t.,،'\\\"\\+!?:-])`; + + return (): RegExp => new RegExp(expression, 'gmi'); + }, [highlights]); + const { actions: { openRoom, openUserCard }, } = useMessageActions(); + const resolveUserMention = useCallback( + (mention: string) => { + if (mention === 'all' || mention === 'here') { + return undefined; + } + + return message.mentions?.find(({ username }) => username === mention); + }, + [message.mentions], + ); + + const onUserMentionClick = useCallback( + ({ username }: UserMention) => { + if (!username) { + return; + } + + return openUserCard(username); + }, + [openUserCard], + ); + + const resolveChannelMention = useCallback( + (mention: string) => message.channels?.find(({ name }) => name === mention), + [message.channels], + ); + + const onChannelMentionClick = useCallback(({ _id: rid }: ChannelMention) => openRoom(rid), [openRoom]); + return ( diff --git a/apps/meteor/client/views/room/MessageList/components/ThreadMessagePreviewBody.tsx b/apps/meteor/client/views/room/MessageList/components/ThreadMessagePreviewBody.tsx index 8909d3a606a4..77424e611189 100644 --- a/apps/meteor/client/views/room/MessageList/components/ThreadMessagePreviewBody.tsx +++ b/apps/meteor/client/views/room/MessageList/components/ThreadMessagePreviewBody.tsx @@ -1,7 +1,7 @@ import { IMessage } from '@rocket.chat/core-typings'; +import { PreviewMarkup } from '@rocket.chat/gazzodown'; import React, { ReactElement } from 'react'; -import PreviewMarkup from '../../../../components/gazzodown/PreviewMarkup'; import { useParsedMessage } from '../hooks/useParsedMessage'; type ThreadMessagePreviewBodyProps = { diff --git a/apps/meteor/client/views/room/MessageList/hooks/useParsedMessage.ts b/apps/meteor/client/views/room/MessageList/hooks/useParsedMessage.ts index cbde9ae437f5..c31368d4ddc5 100644 --- a/apps/meteor/client/views/room/MessageList/hooks/useParsedMessage.ts +++ b/apps/meteor/client/views/room/MessageList/hooks/useParsedMessage.ts @@ -1,15 +1,29 @@ import { IMessage } from '@rocket.chat/core-typings'; -import { MarkdownAST, parser } from '@rocket.chat/message-parser'; +import { Root, parse } from '@rocket.chat/message-parser'; +import { useSetting } from '@rocket.chat/ui-contexts'; import { useMemo } from 'react'; -export function useParsedMessage(message: Pick): MarkdownAST { +export function useParsedMessage(message: Pick): Root { + const colors = useSetting('HexColorPreview_Enabled') as boolean; + const katexDollarSyntax = useSetting('Katex_Dollar_Syntax') as boolean; + const katexParenthesisSyntax = useSetting('Katex_Parenthesis_Syntax') as boolean; + return useMemo(() => { if (message.md) { return message.md; } + if (!message.msg) { return []; } - return parser(message.msg); - }, [message]); + + return parse(message.msg, { + colors, + emoticons: true, + katex: { + dollarSyntax: katexDollarSyntax, + parenthesisSyntax: katexParenthesisSyntax, + }, + }); + }, [colors, katexDollarSyntax, katexParenthesisSyntax, message.md, message.msg]); } diff --git a/apps/meteor/client/views/room/contexts/MessageContext.ts b/apps/meteor/client/views/room/contexts/MessageContext.ts index 28b5aa9644e3..b5edcced81ca 100644 --- a/apps/meteor/client/views/room/contexts/MessageContext.ts +++ b/apps/meteor/client/views/room/contexts/MessageContext.ts @@ -1,9 +1,9 @@ import { IMessage } from '@rocket.chat/core-typings'; -import { createContext, useContext, MouseEvent } from 'react'; +import { createContext, useContext, MouseEvent, UIEvent } from 'react'; const openUserCard = (_username: string) => - (_e: MouseEvent): void => { + (_e: UIEvent): void => { console.log('openUserCard'); }; @@ -21,7 +21,7 @@ export type MessageContextValue = { oembedMaxWidth: `${number}px` | '100%'; oembedEnabled: boolean; actions: { - openUserCard: (username: string) => (e: MouseEvent) => void; + openUserCard: (username: string) => (e: UIEvent) => void; openRoom: (id: string) => () => void; openThread: (tmid: string, jump?: string) => (e: MouseEvent) => void; runActionLink: (message: IMessage) => (action: string) => () => void; diff --git a/apps/meteor/client/views/room/providers/MessageProvider.tsx b/apps/meteor/client/views/room/providers/MessageProvider.tsx index 95b60ceaff33..5281b7b21d0e 100644 --- a/apps/meteor/client/views/room/providers/MessageProvider.tsx +++ b/apps/meteor/client/views/room/providers/MessageProvider.tsx @@ -1,6 +1,6 @@ import { IMessage } from '@rocket.chat/core-typings'; import { useLayout, useCurrentRoute, useRoute, useSetting } from '@rocket.chat/ui-contexts'; -import React, { ReactNode, useMemo, memo, MouseEvent } from 'react'; +import React, { ReactNode, useMemo, memo, MouseEvent, UIEvent } from 'react'; import { actionLinks } from '../../../../app/action-links/client'; import { openUserCard } from '../../../../app/ui/client/lib/UserCard'; @@ -85,7 +85,7 @@ export const MessageProvider = memo(function MessageProvider({ runActionLink, openUserCard: (username: string) => - (e: MouseEvent): void => { + (e: UIEvent): void => { openUserCard({ username, rid, diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 2189172f63b9..3a29cebf63f6 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -26,7 +26,7 @@ "@rocket.chat/apps-engine": "^1.31.0", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/emitter": "~0.31.9", - "@rocket.chat/message-parser": "next", + "@rocket.chat/message-parser": "~0.32.0-dev.5", "@rocket.chat/model-typings": "workspace:^", "@rocket.chat/models": "workspace:^", "@rocket.chat/rest-typings": "workspace:^", diff --git a/apps/meteor/package.json b/apps/meteor/package.json index f9e410b1b9ae..830bf921b93e 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -204,10 +204,11 @@ "@rocket.chat/fuselage-toastbar": "^0.32.0-dev.22", "@rocket.chat/fuselage-tokens": "^0.32.0-dev.9", "@rocket.chat/fuselage-ui-kit": "~0.31.14-dev.1", + "@rocket.chat/gazzodown": "workspace:^", "@rocket.chat/icons": "~0.31.14", "@rocket.chat/logo": "~0.31.12", "@rocket.chat/memo": "~0.31.12", - "@rocket.chat/message-parser": "~0.31.12", + "@rocket.chat/message-parser": "next", "@rocket.chat/model-typings": "workspace:^", "@rocket.chat/models": "workspace:^", "@rocket.chat/mp3-encoder": "^0.24.0", @@ -274,7 +275,7 @@ "grapheme-splitter": "^1.0.4", "gridfs-stream": "^1.1.1", "he": "^1.2.0", - "highlight.js": "^9.18.5", + "hljs9": "npm:highlight.js@^9.18.5", "http-proxy-agent": "^5.0.0", "i18next-http-backend": "^1.4.0", "iconv-lite": "^0.6.3", diff --git a/apps/meteor/server/hooks/messages/markdownParser.ts b/apps/meteor/server/hooks/messages/markdownParser.ts index 384c304e4a7f..8af5d1404645 100644 --- a/apps/meteor/server/hooks/messages/markdownParser.ts +++ b/apps/meteor/server/hooks/messages/markdownParser.ts @@ -1,8 +1,9 @@ -import { parser } from '@rocket.chat/message-parser'; +import { parse } from '@rocket.chat/message-parser'; import { callbacks } from '../../../lib/callbacks'; import { isE2EEMessage } from '../../../lib/isE2EEMessage'; import { SystemLogger } from '../../lib/logger/system'; +import { settings } from '../../../app/settings/server'; if (process.env.DISABLE_MESSAGE_PARSER !== 'true') { callbacks.add( @@ -12,7 +13,14 @@ if (process.env.DISABLE_MESSAGE_PARSER !== 'true') { return message; } try { - message.md = parser(message.msg); + message.md = parse(message.msg, { + colors: settings.get('HexColorPreview_Enabled'), + emoticons: true, + katex: { + dollarSyntax: settings.get('Katex_Dollar_Syntax'), + parenthesisSyntax: settings.get('Katex_Parenthesis_Syntax'), + }, + }); } catch (e) { SystemLogger.error(e); // errors logged while the parser is at experimental stage } diff --git a/apps/meteor/server/modules/listeners/listeners.module.ts b/apps/meteor/server/modules/listeners/listeners.module.ts index 59ad55550341..a0dd79b0edce 100644 --- a/apps/meteor/server/modules/listeners/listeners.module.ts +++ b/apps/meteor/server/modules/listeners/listeners.module.ts @@ -1,9 +1,10 @@ import { UserStatus, isSettingColor } from '@rocket.chat/core-typings'; -import { parser } from '@rocket.chat/message-parser'; +import { parse } from '@rocket.chat/message-parser'; import { IServiceClass } from '../../sdk/types/ServiceClass'; import { NotificationsModule } from '../notifications/notifications.module'; import { EnterpriseSettings } from '../../sdk/index'; +import { settings } from '../../../app/settings/server'; const isMessageParserDisabled = process.env.DISABLE_MESSAGE_PARSER === 'true'; @@ -36,7 +37,14 @@ export class ListenersModule { service.onEvent('notify.ephemeralMessage', (uid, rid, message) => { if (!isMessageParserDisabled && message.msg) { - message.md = parser(message.msg); + message.md = parse(message.msg, { + colors: settings.get('HexColorPreview_Enabled'), + emoticons: true, + katex: { + dollarSyntax: settings.get('Katex_Dollar_Syntax'), + parenthesisSyntax: settings.get('Katex_Parenthesis_Syntax'), + }, + }); } notifications.notifyUserInThisInstance(uid, 'message', { diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 048eb5ca8f99..8a89b54d4856 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -24,7 +24,7 @@ "dependencies": { "@rocket.chat/apps-engine": "^1.31.0", "@rocket.chat/icons": "^0.31.9", - "@rocket.chat/message-parser": "next", + "@rocket.chat/message-parser": "^0.32.0-dev.5", "@rocket.chat/ui-kit": "^0.31.6" } } diff --git a/packages/gazzodown/.eslintrc b/packages/gazzodown/.eslintrc new file mode 100644 index 000000000000..1859ff825f63 --- /dev/null +++ b/packages/gazzodown/.eslintrc @@ -0,0 +1,67 @@ +{ + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/eslint-recommended", + "@rocket.chat/eslint-config/original", + "prettier", + "plugin:anti-trojan-source/recommended", + "plugin:react/jsx-runtime" + ], + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint", "react", "react-hooks", "prettier"], + "rules": { + "@typescript-eslint/ban-ts-ignore": "off", + "@typescript-eslint/explicit-function-return-type": "warn", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-extra-parens": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_" + } + ], + "@typescript-eslint/prefer-optional-chain": "warn", + "func-call-spacing": "off", + "import/named": "error", + "import/order": [ + "error", + { + "newlines-between": "always", + "groups": ["builtin", "external", "internal", ["parent", "sibling", "index"]], + "alphabetize": { + "order": "asc" + } + } + ], + "indent": "off", + "jsx-quotes": ["error", "prefer-single"], + "new-cap": ["error"], + "no-extra-parens": "off", + "no-spaced-func": "off", + "no-undef": "off", + "no-unused-vars": "off", + "no-useless-constructor": "off", + "no-use-before-define": "off", + "prefer-arrow-callback": ["error", { "allowNamedFunctions": true }], + "prettier/prettier": 2, + "react/display-name": "error", + "react/jsx-uses-vars": "error", + "react/jsx-no-undef": "error", + "react/jsx-fragments": ["error", "syntax"], + "react/no-multi-comp": "error", + "react-hooks/rules-of-hooks": "error", + "react-hooks/exhaustive-deps": "warn" + }, + "settings": { + "import/resolver": { + "node": { + "extensions": [".js", ".ts", ".tsx"] + } + }, + "react": { + "version": "detect" + } + }, + "ignorePatterns": ["**/dist"] +} diff --git a/packages/gazzodown/.storybook/main.js b/packages/gazzodown/.storybook/main.js new file mode 100644 index 000000000000..c96c2182558c --- /dev/null +++ b/packages/gazzodown/.storybook/main.js @@ -0,0 +1,12 @@ +module.exports = { + "stories": [ + "../src/**/*.stories.mdx", + "../src/**/*.stories.@(js|jsx|ts|tsx)" + ], + "addons": [ + "@storybook/addon-links", + "@storybook/addon-essentials", + "@storybook/addon-interactions" + ], + "framework": "@storybook/react" +} \ No newline at end of file diff --git a/packages/gazzodown/.storybook/preview.js b/packages/gazzodown/.storybook/preview.js new file mode 100644 index 000000000000..abd704f79510 --- /dev/null +++ b/packages/gazzodown/.storybook/preview.js @@ -0,0 +1,25 @@ +import '../../../apps/meteor/app/theme/client/main.css'; +import 'highlight.js/styles/github.css'; + +export const parameters = { + actions: { argTypesRegex: "^on[A-Z].*" }, + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/, + }, + }, +} + +export const decorators = [ + (Story) => ( +
+ + +
+ ) +]; diff --git a/packages/gazzodown/jest.config.js b/packages/gazzodown/jest.config.js new file mode 100644 index 000000000000..b8dc79efdfcf --- /dev/null +++ b/packages/gazzodown/jest.config.js @@ -0,0 +1,17 @@ +module.exports = { + preset: 'ts-jest', + errorOnDeprecated: true, + testEnvironment: 'jsdom', + modulePathIgnorePatterns: ['/dist/'], + globals: { + 'ts-jest': { + tsconfig: { + noUnusedLocals: false, + noUnusedParameters: false, + }, + }, + }, + moduleNameMapper: { + '\\.css$': 'identity-obj-proxy', + }, +}; diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json new file mode 100644 index 000000000000..c612fb754e6d --- /dev/null +++ b/packages/gazzodown/package.json @@ -0,0 +1,72 @@ +{ + "name": "@rocket.chat/gazzodown", + "version": "0.0.1", + "private": true, + "devDependencies": { + "@babel/core": "^7.18.5", + "@mdx-js/react": "^1.6.22", + "@rocket.chat/core-typings": "workspace:^", + "@rocket.chat/css-in-js": "^0.31.13", + "@rocket.chat/fuselage": "next", + "@rocket.chat/fuselage-tokens": "^0.31.13", + "@rocket.chat/message-parser": "next", + "@rocket.chat/ui-contexts": "workspace:^", + "@storybook/addon-actions": "^6.5.9", + "@storybook/addon-docs": "^6.5.9", + "@storybook/addon-essentials": "^6.5.9", + "@storybook/addon-interactions": "^6.5.9", + "@storybook/addon-links": "^6.5.9", + "@storybook/builder-webpack4": "^6.5.9", + "@storybook/manager-webpack4": "^6.5.9", + "@storybook/react": "^6.5.9", + "@storybook/testing-library": "^0.0.13", + "@testing-library/jest-dom": "^5.16.4", + "@testing-library/react": "~12.1.2", + "@types/babel__core": "^7", + "@types/jest": "^27.4.1", + "@types/katex": "~0", + "@types/react": "^17", + "@types/react-dom": "^18", + "@types/testing-library__jest-dom": "^5", + "@typescript-eslint/eslint-plugin": "^5.29.0", + "@typescript-eslint/parser": "^5.29.0", + "babel-loader": "^8.2.5", + "eslint": "^8.12.0", + "eslint-plugin-anti-trojan-source": "^1.1.0", + "eslint-plugin-react": "^7.30.0", + "eslint-plugin-react-hooks": "^4.6.0", + "identity-obj-proxy": "^3.0.0", + "jest": "^27.5.1", + "katex": "~0.16.0", + "outdent": "^0.8.0", + "react-dom": "~17.0.2", + "ts-jest": "^27.1.4", + "typescript": "~4.3.4" + }, + "scripts": { + "lint": "eslint --ext .js,.jsx,.ts,.tsx .", + "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix", + "test": "jest", + "build": "rm -rf dist && tsc -p tsconfig.json", + "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput", + "typecheck": "tsc -p tsconfig.json --noEmit", + "storybook": "start-storybook -p 6006", + "build-storybook": "build-storybook" + }, + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "files": [ + "/dist" + ], + "peerDependencies": { + "@rocket.chat/core-typings": "workspace:^", + "@rocket.chat/fuselage": "*", + "@rocket.chat/message-parser": "*", + "@rocket.chat/ui-contexts": "workspace:^", + "katex": "*", + "react": "~17.0.2" + }, + "dependencies": { + "highlight.js": "^11.5.1" + } +} diff --git a/packages/gazzodown/src/Markup.spec.tsx b/packages/gazzodown/src/Markup.spec.tsx new file mode 100644 index 000000000000..191b16b4c3b2 --- /dev/null +++ b/packages/gazzodown/src/Markup.spec.tsx @@ -0,0 +1,259 @@ +import { render, screen, cleanup, waitFor } from '@testing-library/react'; +import { Suspense } from 'react'; + +import Markup from './Markup'; + +import '@testing-library/jest-dom'; + +afterEach(cleanup); + +it('renders empty', () => { + const { container } = render(); + expect(container).toBeEmptyDOMElement(); +}); + +it('renders a big emoji block', () => { + render( + , + ); + + expect(screen.getByRole('presentation')).toHaveTextContent(':smile:😀:smile:'); + expect(screen.getAllByRole('img')).toHaveLength(3); + expect(screen.getAllByRole('img', { name: ':smile:' })).toHaveLength(2); +}); + +it('renders a paragraph', () => { + render( + , + ); + + expect(screen.getByText('Hello')).toBeInTheDocument(); + expect(screen.getByText('Hello').matches('p')).toBeTruthy(); +}); + +it('renders a heading', () => { + render( + , + ); + + expect(screen.getByRole('heading', { name: 'Hello' })).toBeInTheDocument(); +}); + +it('renders a unordered list', () => { + render( + , + ); + + expect(screen.getByRole('list')).toBeInTheDocument(); + + const items = screen.getAllByRole('listitem'); + expect(items).toHaveLength(3); + + expect(items[0]).toHaveTextContent('Hello'); + expect(items[1]).toHaveTextContent('Hola'); + expect(items[2]).toHaveTextContent('你好'); +}); + +it('renders an ordered list', () => { + render( + , + ); + + expect(screen.getByRole('list')).toBeInTheDocument(); + + const items = screen.getAllByRole('listitem'); + expect(items).toHaveLength(3); + + expect(items[0]).toHaveTextContent('Hello'); + expect(items[1]).toHaveTextContent('Hola'); + expect(items[2]).toHaveTextContent('你好'); +}); + +it('renders a task list', () => { + render( + , + ); + + expect(screen.getByRole('list')).toBeInTheDocument(); + + const items = screen.getAllByRole('listitem'); + expect(items).toHaveLength(3); + + expect(items[0]).toHaveTextContent('Chores'); + expect(items[1]).toHaveTextContent('Dishes'); + expect(items[2]).toHaveTextContent('Laundry'); + + const checkboxes = screen.getAllByRole('checkbox'); + expect(checkboxes).toHaveLength(3); + + expect(checkboxes[0]).toBeChecked(); + expect(checkboxes[1]).not.toBeChecked(); + expect(checkboxes[2]).toBeChecked(); +}); + +it('renders a blockquote', () => { + render( + , + ); + + expect(screen.getByText('Cogito ergo sum.')).toBeInTheDocument(); + expect(screen.getByText('Sit amet, consectetur adipiscing elit.')).toBeInTheDocument(); + expect(screen.getByText('Donec eget ex euismod, euismod nisi euismod, vulputate nisi.')).toBeInTheDocument(); + expect(screen.getByText('Cogito ergo sum.').matches('blockquote p')).toBeTruthy(); +}); + +it('renders a code block', async () => { + render( + + + , + ); + + await waitFor(() => expect(screen.getByRole('region')).toBeInTheDocument()); + + expect(screen.getByRole('region')).toHaveTextContent('```const foo = bar;```'); +}); + +it('renders a code block with language', async () => { + render( + + + , + ); + + await waitFor(() => expect(screen.getByRole('region')).toBeInTheDocument()); + + expect(screen.getByRole('region')).toHaveTextContent('```const foo = bar;```'); + expect(screen.getByRole('region').querySelector('.language-javascript')).toBeInTheDocument(); +}); + +it('renders a Katex block', async () => { + const { container } = render( + + + , + ); + + // workaround for jest-dom's inability to handle MathML + await waitFor(() => expect(container.querySelector('math')).toBeTruthy()); + container.querySelector('math')?.remove(); + + expect(screen.getByRole('math', { name: 'x^2 + y^2 = z^2' })).toBeInTheDocument(); +}); + +it('renders a line break', () => { + const { container } = render( + , + ); + + expect(container).toContainHTML('
'); +}); diff --git a/packages/gazzodown/src/Markup.stories.tsx b/packages/gazzodown/src/Markup.stories.tsx new file mode 100644 index 000000000000..6a9b2068ef27 --- /dev/null +++ b/packages/gazzodown/src/Markup.stories.tsx @@ -0,0 +1,262 @@ +import { css } from '@rocket.chat/css-in-js'; +import { Box, MessageBody, MessageContainer } from '@rocket.chat/fuselage'; +import colors from '@rocket.chat/fuselage-tokens/colors.json'; +import { parse } from '@rocket.chat/message-parser'; +import type { ComponentMeta, ComponentStoryFn, StoryFn } from '@storybook/react'; +import outdent from 'outdent'; +import { ReactElement, Suspense } from 'react'; + +import Markup from './Markup'; + +export default { + title: 'Markup', + component: Markup, + decorators: [ + (Story): ReactElement => ( + + + + blockquote { + padding-inline: 8px; + border-radius: 2px; + border-width: 2px; + border-style: solid; + background-color: var(--rcx-color-neutral-100, ${colors.n100}); + border-color: var(--rcx-color-neutral-200, ${colors.n200}); + border-inline-start-color: var(--rcx-color-neutral-600, ${colors.n600}); + + &:hover, + &:focus { + background-color: var(--rcx-color-neutral-200, ${colors.n200}); + border-color: var(--rcx-color-neutral-300, ${colors.n300}); + border-inline-start-color: var(--rcx-color-neutral-600, ${colors.n600}); + } + } + + > ul.task-list { + > li::before { + display: none; + } + + > li > .rcx-check-box > .rcx-check-box__input:focus + .rcx-check-box__fake { + z-index: 1; + } + + list-style: none; + margin-inline-start: 0; + padding-inline-start: 0; + } + `} + > + + + + + {/* workaround? */} + + + ), + ], + parameters: { + docs: { + source: { + code: 'Disabled for this story, see https://github.com/storybookjs/storybook/issues/11554', + }, + }, + }, +} as ComponentMeta; + +const Template: ComponentStoryFn = (args) => ; + +export const empty = Template.bind({}); +empty.args = { + tokens: [], +}; + +export const bigEmoji = Template.bind({}); +bigEmoji.args = { + tokens: [ + { + type: 'BIG_EMOJI', + value: [ + { type: 'EMOJI', value: { type: 'PLAIN_TEXT', value: 'smile' }, shortCode: 'smile' }, + { type: 'EMOJI', value: undefined, unicode: '😀' }, + { type: 'EMOJI', value: { type: 'PLAIN_TEXT', value: 'smile' }, shortCode: 'smile' }, + ], + }, + ], +}; + +export const paragraph = Template.bind({}); +paragraph.args = { + tokens: [ + { + type: 'PARAGRAPH', + value: [{ type: 'PLAIN_TEXT', value: 'Hello' }], + }, + ], +}; + +export const heading = Template.bind({}); +heading.args = { + tokens: [ + { + type: 'HEADING', + level: 2, + value: [{ type: 'PLAIN_TEXT', value: 'Hello' }], + }, + ], +}; + +export const unorderedList = Template.bind({}); +unorderedList.args = { + tokens: [ + { + type: 'UNORDERED_LIST', + value: [ + { type: 'LIST_ITEM', value: [{ type: 'PLAIN_TEXT', value: 'Hello' }] }, + { type: 'LIST_ITEM', value: [{ type: 'PLAIN_TEXT', value: 'Hola' }] }, + { type: 'LIST_ITEM', value: [{ type: 'PLAIN_TEXT', value: '你好' }] }, + ], + }, + ], +}; + +export const orderedList = Template.bind({}); +orderedList.args = { + tokens: [ + { + type: 'ORDERED_LIST', + value: [ + { type: 'LIST_ITEM', value: [{ type: 'PLAIN_TEXT', value: 'Hello' }] }, + { type: 'LIST_ITEM', value: [{ type: 'PLAIN_TEXT', value: 'Hola' }] }, + { type: 'LIST_ITEM', value: [{ type: 'PLAIN_TEXT', value: '你好' }] }, + ], + }, + ], +}; + +export const taskList = Template.bind({}); +taskList.args = { + tokens: [ + { + type: 'TASKS', + value: [ + { type: 'TASK', status: true, value: [{ type: 'PLAIN_TEXT', value: 'Chores' }] }, + { type: 'TASK', status: false, value: [{ type: 'PLAIN_TEXT', value: 'Dishes' }] }, + { type: 'TASK', status: true, value: [{ type: 'PLAIN_TEXT', value: 'Laundry' }] }, + ], + }, + ], +}; + +export const blockquote = Template.bind({}); +blockquote.args = { + tokens: [ + { + type: 'QUOTE', + value: [ + { + type: 'PARAGRAPH', + value: [{ type: 'PLAIN_TEXT', value: 'Cogito ergo sum.' }], + }, + { + type: 'PARAGRAPH', + value: [{ type: 'PLAIN_TEXT', value: 'Sit amet, consectetur adipiscing elit.' }], + }, + { + type: 'PARAGRAPH', + value: [{ type: 'PLAIN_TEXT', value: 'Donec eget ex euismod, euismod nisi euismod, vulputate nisi.' }], + }, + ], + }, + ], +}; + +export const code = Template.bind({}); +code.args = { + tokens: [ + { + type: 'CODE', + value: [{ type: 'CODE_LINE', value: { type: 'PLAIN_TEXT', value: 'const foo = bar;' } }], + language: undefined, + }, + ], +}; + +export const codeWithLanguage = Template.bind({}); +codeWithLanguage.args = { + tokens: [ + { + type: 'CODE', + value: [{ type: 'CODE_LINE', value: { type: 'PLAIN_TEXT', value: 'const foo = bar;' } }], + language: 'javascript', + }, + ], +}; + +export const katex = Template.bind({}); +katex.args = { + tokens: [ + { + type: 'KATEX', + value: 'x^2 + y^2 = z^2', + }, + ], +}; + +export const lineBreak = Template.bind({}); +lineBreak.args = { + tokens: [ + { + type: 'LINE_BREAK', + value: undefined, + }, + ], +}; + +export const example: StoryFn<{ msg: string }> = ({ msg }) => ( + +); +example.args = { + msg: outdent` + :smile:😀:smile: + + Hello, world! + + # Heading 1 + ## Heading 2 + ### Heading 3 + #### Heading 4 + + * Bullet point 1 + * Bullet point 2 + * Bullet point 3 + + 1. Numbered point 1 + 2. Numbered point 2 + 3. Numbered point 3 + + - [x] Chores + - [ ] Dishes + - [x] Laundry + + > Cogito ergo sum. + > Sit amet, consectetur adipiscing elit. + > Donec eget ex euismod, euismod nisi euismod, vulputate nisi. + + \`\`\` + const x = 1; + \`\`\` + + \`\`\`js + const x = 1; + \`\`\` + + \`\`\`invalid + const x = 1; + \`\`\` + `, +}; diff --git a/apps/meteor/client/components/gazzodown/Markup.tsx b/packages/gazzodown/src/Markup.tsx similarity index 73% rename from apps/meteor/client/components/gazzodown/Markup.tsx rename to packages/gazzodown/src/Markup.tsx index 1bd557c0ae55..988003a1bd27 100644 --- a/apps/meteor/client/components/gazzodown/Markup.tsx +++ b/packages/gazzodown/src/Markup.tsx @@ -1,17 +1,19 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { memo, ReactElement } from 'react'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import { lazy, memo, ReactElement } from 'react'; -import BigEmojiBlock from './blocks/BigEmojiBlock'; -import CodeBlock from './blocks/CodeBlock'; import HeadingBlock from './blocks/HeadingBlock'; import OrderedListBlock from './blocks/OrderedListBlock'; import ParagraphBlock from './blocks/ParagraphBlock'; import QuoteBlock from './blocks/QuoteBlock'; import TaskList from './blocks/TaskListBlock'; import UnorderedListBlock from './blocks/UnorderedListBlock'; +import BigEmojiBlock from './emoji/BigEmojiBlock'; + +const CodeBlock = lazy(() => import('./code/CodeBlock')); +const KatexBlock = lazy(() => import('./katex/KatexBlock')); type MarkupProps = { - tokens: MessageParser.MarkdownAST; + tokens: MessageParser.Root; }; const Markup = ({ tokens }: MarkupProps): ReactElement => ( @@ -19,7 +21,7 @@ const Markup = ({ tokens }: MarkupProps): ReactElement => ( {tokens.map((block, index) => { switch (block.type) { case 'BIG_EMOJI': - return ; + return ; case 'PARAGRAPH': return ; @@ -42,6 +44,9 @@ const Markup = ({ tokens }: MarkupProps): ReactElement => ( case 'CODE': return ; + case 'KATEX': + return ; + case 'LINE_BREAK': return
; diff --git a/packages/gazzodown/src/MarkupInteractionContext.ts b/packages/gazzodown/src/MarkupInteractionContext.ts new file mode 100644 index 000000000000..f2baaa507259 --- /dev/null +++ b/packages/gazzodown/src/MarkupInteractionContext.ts @@ -0,0 +1,18 @@ +import type { IRoom, IUser } from '@rocket.chat/core-typings'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import { createContext, FormEvent, UIEvent } from 'react'; + +export type UserMention = Pick; +export type ChannelMention = Pick; + +type MarkupInteractionContextValue = { + detectEmoji?: (text: string) => { name: string; className: string; image?: string; content: string }[]; + highlightRegex?: () => RegExp; + onTaskChecked?: (task: MessageParser.Task) => ((e: FormEvent) => void) | undefined; + resolveUserMention?: (mention: string) => UserMention | undefined; + onUserMentionClick?: (mentionedUser: UserMention) => ((e: UIEvent) => void) | undefined; + resolveChannelMention?: (mention: string) => ChannelMention | undefined; + onChannelMentionClick?: (mentionedChannel: ChannelMention) => ((e: UIEvent) => void) | undefined; +}; + +export const MarkupInteractionContext = createContext({}); diff --git a/apps/meteor/client/components/gazzodown/PreviewMarkup.tsx b/packages/gazzodown/src/PreviewMarkup.tsx similarity index 67% rename from apps/meteor/client/components/gazzodown/PreviewMarkup.tsx rename to packages/gazzodown/src/PreviewMarkup.tsx index 0ed7fa7a64f8..29fd803a1689 100644 --- a/apps/meteor/client/components/gazzodown/PreviewMarkup.tsx +++ b/packages/gazzodown/src/PreviewMarkup.tsx @@ -1,19 +1,21 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { memo, ReactElement } from 'react'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import { memo, ReactElement } from 'react'; -import PreviewBigEmojiBlock from './blocks/PreviewBigEmojiBlock'; +import PreviewCodeBlock from './code/PreviewCodeBlock'; import PreviewInlineElements from './elements/PreviewInlineElements'; +import PreviewBigEmojiBlock from './emoji/PreviewBigEmojiBlock'; +import PreviewKatexBlock from './katex/PreviewKatexBlock'; -const isOnlyBigEmojiBlock = (tokens: MessageParser.MarkdownAST): tokens is [MessageParser.BigEmoji] => +const isOnlyBigEmojiBlock = (tokens: MessageParser.Root): tokens is [MessageParser.BigEmoji] => tokens.length === 1 && tokens[0].type === 'BIG_EMOJI'; type PreviewMarkupProps = { - tokens: MessageParser.MarkdownAST; + tokens: MessageParser.Root; }; const PreviewMarkup = ({ tokens }: PreviewMarkupProps): ReactElement | null => { if (isOnlyBigEmojiBlock(tokens)) { - return ; + return ; } const firstBlock = tokens.find((block) => block.type !== 'LINE_BREAK'); @@ -61,11 +63,12 @@ const PreviewMarkup = ({ tokens }: PreviewMarkupProps): ReactElement | null => { } case 'CODE': { - const firstLine = firstBlock.value.find((line) => line.value.value.trim()); - - return firstLine ? <>{firstLine.value.value.trim()} : null; + return ; } + case 'KATEX': + return ; + default: return null; } diff --git a/apps/meteor/client/components/gazzodown/blocks/HeadingBlock.tsx b/packages/gazzodown/src/blocks/HeadingBlock.tsx similarity index 80% rename from apps/meteor/client/components/gazzodown/blocks/HeadingBlock.tsx rename to packages/gazzodown/src/blocks/HeadingBlock.tsx index 1d21893f8a12..ff3cac757e3a 100644 --- a/apps/meteor/client/components/gazzodown/blocks/HeadingBlock.tsx +++ b/packages/gazzodown/src/blocks/HeadingBlock.tsx @@ -1,5 +1,5 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import type { ReactElement } from 'react'; import PlainSpan from '../elements/PlainSpan'; diff --git a/apps/meteor/client/components/gazzodown/blocks/OrderedListBlock.tsx b/packages/gazzodown/src/blocks/OrderedListBlock.tsx similarity index 78% rename from apps/meteor/client/components/gazzodown/blocks/OrderedListBlock.tsx rename to packages/gazzodown/src/blocks/OrderedListBlock.tsx index 2da9078bbcc6..276ab6c2b275 100644 --- a/apps/meteor/client/components/gazzodown/blocks/OrderedListBlock.tsx +++ b/packages/gazzodown/src/blocks/OrderedListBlock.tsx @@ -1,5 +1,5 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import type { ReactElement } from 'react'; import InlineElements from '../elements/InlineElements'; diff --git a/apps/meteor/client/components/gazzodown/blocks/ParagraphBlock.tsx b/packages/gazzodown/src/blocks/ParagraphBlock.tsx similarity index 72% rename from apps/meteor/client/components/gazzodown/blocks/ParagraphBlock.tsx rename to packages/gazzodown/src/blocks/ParagraphBlock.tsx index 084f4808a390..9a4ed57c3213 100644 --- a/apps/meteor/client/components/gazzodown/blocks/ParagraphBlock.tsx +++ b/packages/gazzodown/src/blocks/ParagraphBlock.tsx @@ -1,5 +1,5 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import type { ReactElement } from 'react'; import InlineElements from '../elements/InlineElements'; diff --git a/apps/meteor/client/components/gazzodown/blocks/QuoteBlock.tsx b/packages/gazzodown/src/blocks/QuoteBlock.tsx similarity index 76% rename from apps/meteor/client/components/gazzodown/blocks/QuoteBlock.tsx rename to packages/gazzodown/src/blocks/QuoteBlock.tsx index aa2f4c44fec2..3e4cb15dee73 100644 --- a/apps/meteor/client/components/gazzodown/blocks/QuoteBlock.tsx +++ b/packages/gazzodown/src/blocks/QuoteBlock.tsx @@ -1,5 +1,5 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import type { ReactElement } from 'react'; import ParagraphBlock from './ParagraphBlock'; diff --git a/packages/gazzodown/src/blocks/TaskListBlock.tsx b/packages/gazzodown/src/blocks/TaskListBlock.tsx new file mode 100644 index 000000000000..ac664758291a --- /dev/null +++ b/packages/gazzodown/src/blocks/TaskListBlock.tsx @@ -0,0 +1,26 @@ +import { CheckBox } from '@rocket.chat/fuselage'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import { ReactElement, useContext } from 'react'; + +import { MarkupInteractionContext } from '../MarkupInteractionContext'; +import InlineElements from '../elements/InlineElements'; + +type TaskListBlockProps = { + tasks: MessageParser.Task[]; +}; + +const TaksListBlock = ({ tasks }: TaskListBlockProps): ReactElement => { + const { onTaskChecked } = useContext(MarkupInteractionContext); + + return ( +
    + {tasks.map((item, index) => ( +
  • + +
  • + ))} +
+ ); +}; + +export default TaksListBlock; diff --git a/apps/meteor/client/components/gazzodown/blocks/UnorderedListBlock.tsx b/packages/gazzodown/src/blocks/UnorderedListBlock.tsx similarity index 77% rename from apps/meteor/client/components/gazzodown/blocks/UnorderedListBlock.tsx rename to packages/gazzodown/src/blocks/UnorderedListBlock.tsx index 42ba4425abff..93874fd14010 100644 --- a/apps/meteor/client/components/gazzodown/blocks/UnorderedListBlock.tsx +++ b/packages/gazzodown/src/blocks/UnorderedListBlock.tsx @@ -1,5 +1,5 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import type { ReactElement } from 'react'; import InlineElements from '../elements/InlineElements'; diff --git a/packages/gazzodown/src/code/CodeBlock.tsx b/packages/gazzodown/src/code/CodeBlock.tsx new file mode 100644 index 000000000000..58a86600bb2e --- /dev/null +++ b/packages/gazzodown/src/code/CodeBlock.tsx @@ -0,0 +1,75 @@ +import type * as MessageParser from '@rocket.chat/message-parser'; +import hljs from 'highlight.js'; +import { Fragment, ReactElement, useContext, useLayoutEffect, useMemo, useRef } from 'react'; + +import { MarkupInteractionContext } from '../MarkupInteractionContext'; + +type CodeBlockProps = { + language?: string; + lines: MessageParser.CodeLine[]; +}; + +const CodeBlock = ({ lines = [], language }: CodeBlockProps): ReactElement => { + const ref = useRef(null); + + const { highlightRegex } = useContext(MarkupInteractionContext); + + const code = useMemo(() => lines.map((line) => line.value.value).join('\n'), [lines]); + + const content = useMemo(() => { + const regex = highlightRegex?.(); + + if (regex) { + const chunks = code.split(regex); + const head = chunks.shift() ?? ''; + + return ( + <> + <>{head} + {chunks.map((chunk, i) => { + if (i % 2 === 0) { + return ( + + {chunk} + + ); + } + + return {chunk}; + })} + + ); + } + + return code; + }, [code, highlightRegex]); + + useLayoutEffect(() => { + const element = ref.current; + + if (!element) { + return; + } + + hljs.highlightElement(element); + if (!element.classList.contains('hljs')) { + element.classList.add('hljs'); + } + }, [language, content]); + + return ( +
+			```
+			
+				{content}
+			
+			```
+		
+ ); +}; + +export default CodeBlock; diff --git a/apps/meteor/client/components/gazzodown/elements/CodeElement.tsx b/packages/gazzodown/src/code/CodeElement.tsx similarity index 71% rename from apps/meteor/client/components/gazzodown/elements/CodeElement.tsx rename to packages/gazzodown/src/code/CodeElement.tsx index 3a0b8e5cd1c5..eeaa4b57cfa6 100644 --- a/apps/meteor/client/components/gazzodown/elements/CodeElement.tsx +++ b/packages/gazzodown/src/code/CodeElement.tsx @@ -1,6 +1,6 @@ -import React, { ReactElement } from 'react'; +import type { ReactElement } from 'react'; -import PlainSpan from './PlainSpan'; +import PlainSpan from '../elements/PlainSpan'; type CodeElementProps = { code: string; diff --git a/packages/gazzodown/src/code/PreviewCodeBlock.tsx b/packages/gazzodown/src/code/PreviewCodeBlock.tsx new file mode 100644 index 000000000000..12ea880306e0 --- /dev/null +++ b/packages/gazzodown/src/code/PreviewCodeBlock.tsx @@ -0,0 +1,19 @@ +import type * as MessageParser from '@rocket.chat/message-parser'; +import { ReactElement, useMemo } from 'react'; + +type PreviewCodeBlockProps = { + language?: string; + lines: MessageParser.CodeLine[]; +}; + +export const PreviewCodeBlock = ({ lines }: PreviewCodeBlockProps): ReactElement | null => { + const firstLine = useMemo(() => lines.find((line) => line.value.value.trim())?.value.value.trim(), [lines]); + + if (!firstLine) { + return null; + } + + return <>{firstLine}; +}; + +export default PreviewCodeBlock; diff --git a/packages/gazzodown/src/code/PreviewCodeElement.tsx b/packages/gazzodown/src/code/PreviewCodeElement.tsx new file mode 100644 index 000000000000..84e6e460d27d --- /dev/null +++ b/packages/gazzodown/src/code/PreviewCodeElement.tsx @@ -0,0 +1,9 @@ +import type { ReactElement } from 'react'; + +type PreviewCodeElementProps = { + code: string; +}; + +const PreviewCodeElement = ({ code }: PreviewCodeElementProps): ReactElement => <>{code}; + +export default PreviewCodeElement; diff --git a/apps/meteor/client/components/gazzodown/elements/ColorElement.tsx b/packages/gazzodown/src/colors/ColorElement.tsx similarity index 84% rename from apps/meteor/client/components/gazzodown/elements/ColorElement.tsx rename to packages/gazzodown/src/colors/ColorElement.tsx index 152486b01f7d..3343d496d9f6 100644 --- a/apps/meteor/client/components/gazzodown/elements/ColorElement.tsx +++ b/packages/gazzodown/src/colors/ColorElement.tsx @@ -1,4 +1,4 @@ -import React, { ReactElement } from 'react'; +import { memo, ReactElement } from 'react'; type ColorElementProps = { r: number; @@ -23,4 +23,4 @@ const ColorElement = ({ r, g, b, a }: ColorElementProps): ReactElement => ( ); -export default ColorElement; +export default memo(ColorElement); diff --git a/apps/meteor/client/components/gazzodown/elements/PreviewColorElement.tsx b/packages/gazzodown/src/colors/PreviewColorElement.tsx similarity index 84% rename from apps/meteor/client/components/gazzodown/elements/PreviewColorElement.tsx rename to packages/gazzodown/src/colors/PreviewColorElement.tsx index 10f36d4f2075..25925f2d73b9 100644 --- a/apps/meteor/client/components/gazzodown/elements/PreviewColorElement.tsx +++ b/packages/gazzodown/src/colors/PreviewColorElement.tsx @@ -1,4 +1,4 @@ -import React, { ReactElement } from 'react'; +import { memo, ReactElement } from 'react'; const toHexByte = (value: number): string => value.toString(16).padStart(2, '0'); @@ -30,4 +30,4 @@ const PreviewColorElement = ({ r, g, b, a }: PreviewColorElementProps): ReactEle ); }; -export default PreviewColorElement; +export default memo(PreviewColorElement); diff --git a/apps/meteor/client/components/gazzodown/elements/BoldSpan.tsx b/packages/gazzodown/src/elements/BoldSpan.tsx similarity index 88% rename from apps/meteor/client/components/gazzodown/elements/BoldSpan.tsx rename to packages/gazzodown/src/elements/BoldSpan.tsx index 14e079ebe6b2..b10611aa74df 100644 --- a/apps/meteor/client/components/gazzodown/elements/BoldSpan.tsx +++ b/packages/gazzodown/src/elements/BoldSpan.tsx @@ -1,5 +1,5 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import type { ReactElement } from 'react'; import ItalicSpan from './ItalicSpan'; import LinkSpan from './LinkSpan'; diff --git a/apps/meteor/client/components/gazzodown/elements/ImageElement.tsx b/packages/gazzodown/src/elements/ImageElement.tsx similarity index 88% rename from apps/meteor/client/components/gazzodown/elements/ImageElement.tsx rename to packages/gazzodown/src/elements/ImageElement.tsx index de1c4e501046..ba3f3f2f775b 100644 --- a/apps/meteor/client/components/gazzodown/elements/ImageElement.tsx +++ b/packages/gazzodown/src/elements/ImageElement.tsx @@ -1,5 +1,5 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement, useMemo } from 'react'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import { ReactElement, useMemo } from 'react'; const flattenMarkup = (markup: MessageParser.Markup | MessageParser.Link): string => { switch (markup.type) { diff --git a/apps/meteor/client/components/gazzodown/elements/InlineElements.tsx b/packages/gazzodown/src/elements/InlineElements.tsx similarity index 70% rename from apps/meteor/client/components/gazzodown/elements/InlineElements.tsx rename to packages/gazzodown/src/elements/InlineElements.tsx index c60a3c6c1d57..00b39164e6e7 100644 --- a/apps/meteor/client/components/gazzodown/elements/InlineElements.tsx +++ b/packages/gazzodown/src/elements/InlineElements.tsx @@ -1,17 +1,19 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import { lazy, ReactElement } from 'react'; +import ColorElement from '../colors/ColorElement'; +import EmojiElement from '../emoji/EmojiElement'; +import ChannelMentionElement from '../mentions/ChannelMentionElement'; +import UserMentionElement from '../mentions/UserMentionElement'; import BoldSpan from './BoldSpan'; -import ChannelMentionElement from './ChannelMentionElement'; -import CodeElement from './CodeElement'; -import ColorElement from './ColorElement'; -import EmojiElement from './EmojiElement'; import ImageElement from './ImageElement'; import ItalicSpan from './ItalicSpan'; import LinkSpan from './LinkSpan'; import PlainSpan from './PlainSpan'; import StrikeSpan from './StrikeSpan'; -import UserMentionElement from './UserMentionElement'; + +const CodeElement = lazy(() => import('../code/CodeElement')); +const KatexElement = lazy(() => import('../katex/KatexElement')); type InlineElementsProps = { children: MessageParser.Inlines[]; @@ -49,11 +51,14 @@ const InlineElements = ({ children }: InlineElementsProps): ReactElement => ( return ; case 'EMOJI': - return ; + return ; case 'COLOR': return ; + case 'INLINE_KATEX': + return ; + default: return null; } diff --git a/apps/meteor/client/components/gazzodown/elements/ItalicSpan.tsx b/packages/gazzodown/src/elements/ItalicSpan.tsx similarity index 87% rename from apps/meteor/client/components/gazzodown/elements/ItalicSpan.tsx rename to packages/gazzodown/src/elements/ItalicSpan.tsx index f1e06950ca0b..2addc7b708a8 100644 --- a/apps/meteor/client/components/gazzodown/elements/ItalicSpan.tsx +++ b/packages/gazzodown/src/elements/ItalicSpan.tsx @@ -1,5 +1,5 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import type { ReactElement } from 'react'; import BoldSpan from './BoldSpan'; import LinkSpan from './LinkSpan'; @@ -11,7 +11,7 @@ type ItalicSpanProps = { }; const ItalicSpan = ({ children }: ItalicSpanProps): ReactElement => ( - + {children.map((block, index) => { switch (block.type) { case 'LINK': @@ -30,7 +30,7 @@ const ItalicSpan = ({ children }: ItalicSpanProps): ReactElement => ( return null; } })} - + ); export default ItalicSpan; diff --git a/packages/gazzodown/src/elements/LinkSpan.tsx b/packages/gazzodown/src/elements/LinkSpan.tsx new file mode 100644 index 000000000000..ca326ccd6032 --- /dev/null +++ b/packages/gazzodown/src/elements/LinkSpan.tsx @@ -0,0 +1,70 @@ +import type * as MessageParser from '@rocket.chat/message-parser'; +import { ReactElement, useMemo } from 'react'; + +import BoldSpan from './BoldSpan'; +import ItalicSpan from './ItalicSpan'; +import PlainSpan from './PlainSpan'; +import StrikeSpan from './StrikeSpan'; + +const getBaseURI = (): string => { + if (document.baseURI) { + return document.baseURI; + } + + // Should be exactly one tag: + // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base + const base = document.getElementsByTagName('base'); + + // Return location from BASE tag. + if (base.length > 0) { + return base[0].href; + } + + // Else use implementation of documentURI: + // http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-baseURI + return document.URL; +}; + +const isExternal = (href: string): boolean => href.indexOf(getBaseURI()) !== 0; + +type LinkSpanProps = { + href: string; + label: MessageParser.Markup; +}; + +const LinkSpan = ({ href, label }: LinkSpanProps): ReactElement => { + const children = useMemo(() => { + switch (label.type) { + case 'PLAIN_TEXT': + return ; + + case 'STRIKE': + return ; + + case 'ITALIC': + return ; + + case 'BOLD': + return ; + + default: + return null; + } + }, [label.type, label.value]); + + if (isExternal(href)) { + return ( + + {children} + + ); + } + + return ( + + {children} + + ); +}; + +export default LinkSpan; diff --git a/packages/gazzodown/src/elements/PlainSpan.tsx b/packages/gazzodown/src/elements/PlainSpan.tsx new file mode 100644 index 000000000000..0bb2148058d7 --- /dev/null +++ b/packages/gazzodown/src/elements/PlainSpan.tsx @@ -0,0 +1,43 @@ +import { Fragment, memo, ReactElement, useContext, useMemo } from 'react'; + +import { MarkupInteractionContext } from '../MarkupInteractionContext'; + +type PlainSpanProps = { + text: string; +}; + +const PlainSpan = ({ text }: PlainSpanProps): ReactElement => { + const { highlightRegex } = useContext(MarkupInteractionContext); + + const content = useMemo(() => { + const regex = highlightRegex?.(); + + if (regex) { + const chunks = text.split(regex); + const head = chunks.shift() ?? ''; + + return ( + <> + <>{head} + {chunks.map((chunk, i) => { + if (i % 2 === 0) { + return ( + + {chunk} + + ); + } + + return {chunk}; + })} + + ); + } + + return text; + }, [text, highlightRegex]); + + return <>{content}; +}; + +export default memo(PlainSpan); diff --git a/packages/gazzodown/src/elements/PreviewInlineElements.tsx b/packages/gazzodown/src/elements/PreviewInlineElements.tsx new file mode 100644 index 000000000000..eeda8abecb76 --- /dev/null +++ b/packages/gazzodown/src/elements/PreviewInlineElements.tsx @@ -0,0 +1,58 @@ +import type * as MessageParser from '@rocket.chat/message-parser'; +import { Fragment, ReactElement } from 'react'; + +import PreviewCodeElement from '../code/PreviewCodeElement'; +import PreviewColorElement from '../colors/PreviewColorElement'; +import PreviewEmojiElement from '../emoji/PreviewEmojiElement'; +import PreviewKatexElement from '../katex/PreviewKatexElement'; +import PreviewChannelMentionElement from '../mentions/PreviewChannelMentionElement'; +import PreviewUserMentionElement from '../mentions/PreviewUserMentionElement'; + +type PreviewInlineElementsProps = { + children: MessageParser.Inlines[]; +}; + +const PreviewInlineElements = ({ children }: PreviewInlineElementsProps): ReactElement => ( + <> + {children.map((child, index) => { + switch (child.type) { + case 'BOLD': + case 'ITALIC': + case 'STRIKE': + return ; + + case 'LINK': + return ; + + case 'PLAIN_TEXT': + return ; + + case 'IMAGE': + return ; + + case 'MENTION_USER': + return ; + + case 'MENTION_CHANNEL': + return ; + + case 'INLINE_CODE': + return ; + + case 'EMOJI': + return ; + + case 'COLOR': + return ; + + case 'INLINE_KATEX': + return ; + + default: + return null; + } + })} + +); + +export default PreviewInlineElements; diff --git a/apps/meteor/client/components/gazzodown/elements/StrikeSpan.tsx b/packages/gazzodown/src/elements/StrikeSpan.tsx similarity index 88% rename from apps/meteor/client/components/gazzodown/elements/StrikeSpan.tsx rename to packages/gazzodown/src/elements/StrikeSpan.tsx index b70ad7ec1baa..49a66d4d3395 100644 --- a/apps/meteor/client/components/gazzodown/elements/StrikeSpan.tsx +++ b/packages/gazzodown/src/elements/StrikeSpan.tsx @@ -1,5 +1,5 @@ -import * as MessageParser from '@rocket.chat/message-parser'; -import React, { ReactElement } from 'react'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import type { ReactElement } from 'react'; import BoldSpan from './BoldSpan'; import ItalicSpan from './ItalicSpan'; diff --git a/packages/gazzodown/src/emoji/BigEmojiBlock.tsx b/packages/gazzodown/src/emoji/BigEmojiBlock.tsx new file mode 100644 index 000000000000..d246d983a2c4 --- /dev/null +++ b/packages/gazzodown/src/emoji/BigEmojiBlock.tsx @@ -0,0 +1,18 @@ +import type * as MessageParser from '@rocket.chat/message-parser'; +import type { ReactElement } from 'react'; + +import BigEmojiElement from './BigEmojiElement'; + +type BigEmojiBlockProps = { + emoji: MessageParser.Emoji[]; +}; + +const BigEmojiBlock = ({ emoji }: BigEmojiBlockProps): ReactElement => ( +
+ {emoji.map((emoji, index) => ( + + ))} +
+); + +export default BigEmojiBlock; diff --git a/packages/gazzodown/src/emoji/BigEmojiElement.tsx b/packages/gazzodown/src/emoji/BigEmojiElement.tsx new file mode 100644 index 000000000000..d9ae87bbcb4d --- /dev/null +++ b/packages/gazzodown/src/emoji/BigEmojiElement.tsx @@ -0,0 +1,10 @@ +import type * as MessageParser from '@rocket.chat/message-parser'; +import type { ReactElement } from 'react'; + +import Emoji from './Emoji'; + +type BigEmojiElementProps = MessageParser.Emoji; + +const BigEmojiElement = (emoji: BigEmojiElementProps): ReactElement => ; + +export default BigEmojiElement; diff --git a/packages/gazzodown/src/emoji/Emoji.tsx b/packages/gazzodown/src/emoji/Emoji.tsx new file mode 100644 index 000000000000..2e0a66647799 --- /dev/null +++ b/packages/gazzodown/src/emoji/Emoji.tsx @@ -0,0 +1,45 @@ +import { MessageEmoji, ThreadMessageEmoji } from '@rocket.chat/fuselage'; +import type * as MessageParser from '@rocket.chat/message-parser'; +import { ReactElement, useMemo, useContext, memo } from 'react'; + +import { MarkupInteractionContext } from '../MarkupInteractionContext'; + +type EmojiProps = MessageParser.Emoji & { + big?: boolean; + preview?: boolean; +}; + +const Emoji = ({ big = false, preview = false, ...emoji }: EmojiProps): ReactElement => { + const { detectEmoji } = useContext(MarkupInteractionContext); + + const fallback = useMemo(() => ('unicode' in emoji ? emoji.unicode : `:${emoji.shortCode}:`), [emoji]); + + const descriptors = useMemo(() => { + const detected = detectEmoji?.(fallback); + return detected?.length !== 0 ? detected : undefined; + }, [detectEmoji, fallback]); + + return ( + <> + {descriptors?.map(({ name, className, image, content }, i) => ( + + {preview ? ( + + {content} + + ) : ( + + {content} + + )} + + )) ?? ( + + {fallback} + + )} + + ); +}; + +export default memo(Emoji); diff --git a/packages/gazzodown/src/emoji/EmojiElement.tsx b/packages/gazzodown/src/emoji/EmojiElement.tsx new file mode 100644 index 000000000000..efd7c87d3363 --- /dev/null +++ b/packages/gazzodown/src/emoji/EmojiElement.tsx @@ -0,0 +1,10 @@ +import type * as MessageParser from '@rocket.chat/message-parser'; +import { ReactElement, memo } from 'react'; + +import Emoji from './Emoji'; + +type EmojiElementProps = MessageParser.Emoji; + +const EmojiElement = (emoji: EmojiElementProps): ReactElement => ; + +export default memo(EmojiElement); diff --git a/packages/gazzodown/src/emoji/PreviewBigEmojiBlock.tsx b/packages/gazzodown/src/emoji/PreviewBigEmojiBlock.tsx new file mode 100644 index 000000000000..6a2c8a2358b8 --- /dev/null +++ b/packages/gazzodown/src/emoji/PreviewBigEmojiBlock.tsx @@ -0,0 +1,18 @@ +import type * as MessageParser from '@rocket.chat/message-parser'; +import type { ReactElement } from 'react'; + +import PreviewEmojiElement from './PreviewEmojiElement'; + +type PreviewBigEmojiBlockProps = { + emoji: MessageParser.Emoji[]; +}; + +const PreviewBigEmojiBlock = ({ emoji }: PreviewBigEmojiBlockProps): ReactElement => ( + <> + {emoji.map((emoji, index) => ( + + ))} + +); + +export default PreviewBigEmojiBlock; diff --git a/packages/gazzodown/src/emoji/PreviewEmojiElement.tsx b/packages/gazzodown/src/emoji/PreviewEmojiElement.tsx new file mode 100644 index 000000000000..6da9d7b7e32c --- /dev/null +++ b/packages/gazzodown/src/emoji/PreviewEmojiElement.tsx @@ -0,0 +1,10 @@ +import type * as MessageParser from '@rocket.chat/message-parser'; +import type { ReactElement } from 'react'; + +import Emoji from './Emoji'; + +type PreviewEmojiElementProps = MessageParser.Emoji; + +const PreviewEmojiElement = (emoji: PreviewEmojiElementProps): ReactElement => ; + +export default PreviewEmojiElement; diff --git a/packages/gazzodown/src/index.ts b/packages/gazzodown/src/index.ts new file mode 100644 index 000000000000..ad33ba578786 --- /dev/null +++ b/packages/gazzodown/src/index.ts @@ -0,0 +1,3 @@ +export { MarkupInteractionContext, UserMention, ChannelMention } from './MarkupInteractionContext'; +export { default as Markup } from './Markup'; +export { default as PreviewMarkup } from './PreviewMarkup'; diff --git a/packages/gazzodown/src/katex/KatexBlock.tsx b/packages/gazzodown/src/katex/KatexBlock.tsx new file mode 100644 index 000000000000..25e9c77dc863 --- /dev/null +++ b/packages/gazzodown/src/katex/KatexBlock.tsx @@ -0,0 +1,25 @@ +import katex from 'katex'; +import { ReactElement, useMemo } from 'react'; + +import 'katex/dist/katex.css'; + +type KatexBlockProps = { + code: string; +}; + +const KatexBlock = ({ code }: KatexBlockProps): ReactElement => { + const html = useMemo( + () => + katex.renderToString(code, { + displayMode: true, + macros: { + '\\href': '\\@secondoftwo', + }, + }), + [code], + ); + + return
; +}; + +export default KatexBlock; diff --git a/packages/gazzodown/src/katex/KatexElement.tsx b/packages/gazzodown/src/katex/KatexElement.tsx new file mode 100644 index 000000000000..3595f698f7ae --- /dev/null +++ b/packages/gazzodown/src/katex/KatexElement.tsx @@ -0,0 +1,25 @@ +import katex from 'katex'; +import { ReactElement, useMemo } from 'react'; + +import 'katex/dist/katex.css'; + +type KatexElementProps = { + code: string; +}; + +const KatexElement = ({ code }: KatexElementProps): ReactElement => { + const html = useMemo( + () => + katex.renderToString(code, { + displayMode: false, + macros: { + '\\href': '\\@secondoftwo', + }, + }), + [code], + ); + + return ; +}; + +export default KatexElement; diff --git a/packages/gazzodown/src/katex/PreviewKatexBlock.tsx b/packages/gazzodown/src/katex/PreviewKatexBlock.tsx new file mode 100644 index 000000000000..34caa3c73e8a --- /dev/null +++ b/packages/gazzodown/src/katex/PreviewKatexBlock.tsx @@ -0,0 +1,11 @@ +import type { ReactElement } from 'react'; + +import 'katex/dist/katex.css'; + +type PreviewKatexBlockProps = { + code: string; +}; + +const PreviewKatexBlock = ({ code }: PreviewKatexBlockProps): ReactElement => <>{code}; + +export default PreviewKatexBlock; diff --git a/packages/gazzodown/src/katex/PreviewKatexElement.tsx b/packages/gazzodown/src/katex/PreviewKatexElement.tsx new file mode 100644 index 000000000000..863a768fb907 --- /dev/null +++ b/packages/gazzodown/src/katex/PreviewKatexElement.tsx @@ -0,0 +1,11 @@ +import type { ReactElement } from 'react'; + +import 'katex/dist/katex.css'; + +type PreviewKatexElementProps = { + code: string; +}; + +const PreviewKatexElement = ({ code }: PreviewKatexElementProps): ReactElement => <>{code}; + +export default PreviewKatexElement; diff --git a/packages/gazzodown/src/mentions/ChannelMentionElement.tsx b/packages/gazzodown/src/mentions/ChannelMentionElement.tsx new file mode 100644 index 000000000000..4dc61a43f731 --- /dev/null +++ b/packages/gazzodown/src/mentions/ChannelMentionElement.tsx @@ -0,0 +1,26 @@ +import { memo, ReactElement, useContext, useMemo } from 'react'; + +import { MarkupInteractionContext } from '../MarkupInteractionContext'; + +type ChannelMentionElementProps = { + mention: string; +}; + +const ChannelMentionElement = ({ mention }: ChannelMentionElementProps): ReactElement => { + const { resolveChannelMention, onChannelMentionClick } = useContext(MarkupInteractionContext); + + const resolved = useMemo(() => resolveChannelMention?.(mention), [mention, resolveChannelMention]); + const handleClick = useMemo(() => (resolved ? onChannelMentionClick?.(resolved) : undefined), [resolved, onChannelMentionClick]); + + if (!resolved) { + return <>#{mention}; + } + + return ( + + #{resolved.name ?? mention} + + ); +}; + +export default memo(ChannelMentionElement); diff --git a/packages/gazzodown/src/mentions/PreviewChannelMentionElement.tsx b/packages/gazzodown/src/mentions/PreviewChannelMentionElement.tsx new file mode 100644 index 000000000000..0893c9879e28 --- /dev/null +++ b/packages/gazzodown/src/mentions/PreviewChannelMentionElement.tsx @@ -0,0 +1,9 @@ +import { memo, ReactElement } from 'react'; + +type PreviewChannelMentionElementProps = { + mention: string; +}; + +const PreviewChannelMentionElement = ({ mention }: PreviewChannelMentionElementProps): ReactElement => <>#{mention}; + +export default memo(PreviewChannelMentionElement); diff --git a/packages/gazzodown/src/mentions/PreviewUserMentionElement.tsx b/packages/gazzodown/src/mentions/PreviewUserMentionElement.tsx new file mode 100644 index 000000000000..e8e4442427f7 --- /dev/null +++ b/packages/gazzodown/src/mentions/PreviewUserMentionElement.tsx @@ -0,0 +1,9 @@ +import { memo, ReactElement } from 'react'; + +type PreviewUserMentionElementProps = { + mention: string; +}; + +const PreviewUserMentionElement = ({ mention }: PreviewUserMentionElementProps): ReactElement => <>@{mention}; + +export default memo(PreviewUserMentionElement); diff --git a/packages/gazzodown/src/mentions/UserMentionElement.tsx b/packages/gazzodown/src/mentions/UserMentionElement.tsx new file mode 100644 index 000000000000..78edbcb41078 --- /dev/null +++ b/packages/gazzodown/src/mentions/UserMentionElement.tsx @@ -0,0 +1,44 @@ +import { useLayout, useSetting, useUserId } from '@rocket.chat/ui-contexts'; +import { memo, ReactElement, useContext, useMemo } from 'react'; + +import { MarkupInteractionContext } from '../MarkupInteractionContext'; + +type UserMentionElementProps = { + mention: string; +}; + +const UserMentionElement = ({ mention }: UserMentionElementProps): ReactElement => { + const { resolveUserMention, onUserMentionClick } = useContext(MarkupInteractionContext); + + const resolved = useMemo(() => resolveUserMention?.(mention), [mention, resolveUserMention]); + const handleClick = useMemo(() => (resolved ? onUserMentionClick?.(resolved) : undefined), [resolved, onUserMentionClick]); + + const { isMobile } = useLayout(); + const uid = useUserId(); + const showRealName = Boolean(useSetting('UI_Use_Real_Name')) && !isMobile; + + if (mention === 'all') { + return all; + } + + if (mention === 'here') { + return here; + } + + if (!resolved) { + return <>@{mention}; + } + + return ( + + {(showRealName ? resolved.name : resolved.username) ?? mention} + + ); +}; + +export default memo(UserMentionElement); diff --git a/packages/gazzodown/tsconfig.json b/packages/gazzodown/tsconfig.json new file mode 100644 index 000000000000..455edb8149c4 --- /dev/null +++ b/packages/gazzodown/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./dist" + }, + "include": ["./src/**/*"] +} diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index ebc244110164..f4490e940749 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -26,7 +26,7 @@ "dependencies": { "@rocket.chat/apps-engine": "^1.31.0", "@rocket.chat/core-typings": "workspace:^", - "@rocket.chat/message-parser": "next", + "@rocket.chat/message-parser": "^0.32.0-dev.5", "@rocket.chat/ui-kit": "^0.31.6", "ajv": "^8.11.0" } diff --git a/packages/ui-contexts/.eslintrc b/packages/ui-contexts/.eslintrc index 56a6f6602e33..a83aeda48e66 100644 --- a/packages/ui-contexts/.eslintrc +++ b/packages/ui-contexts/.eslintrc @@ -1,12 +1,4 @@ { "extends": ["@rocket.chat/eslint-config"], - "overrides": [ - { - "files": ["**/*.spec.js", "**/*.spec.jsx"], - "env": { - "jest": true - } - } - ], "ignorePatterns": ["**/dist"] } diff --git a/yarn.lock b/yarn.lock index 63b2eed8cbd1..bdc03340cf82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -93,6 +93,29 @@ __metadata: languageName: node linkType: hard +"@babel/core@npm:^7.18.5": + version: 7.18.5 + resolution: "@babel/core@npm:7.18.5" + dependencies: + "@ampproject/remapping": ^2.1.0 + "@babel/code-frame": ^7.16.7 + "@babel/generator": ^7.18.2 + "@babel/helper-compilation-targets": ^7.18.2 + "@babel/helper-module-transforms": ^7.18.0 + "@babel/helpers": ^7.18.2 + "@babel/parser": ^7.18.5 + "@babel/template": ^7.16.7 + "@babel/traverse": ^7.18.5 + "@babel/types": ^7.18.4 + convert-source-map: ^1.7.0 + debug: ^4.1.0 + gensync: ^1.0.0-beta.2 + json5: ^2.2.1 + semver: ^6.3.0 + checksum: e20c3d69a07eb564408d611b827c2f5db56f05f1ca7cb3046f3823a1cf6b13c032f02d4b8ffe1e4593699e86e0f25ca1aee6228486c1ebea48d21aaeb28e6718 + languageName: node + linkType: hard + "@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.12.5, @babel/generator@npm:^7.18.2, @babel/generator@npm:^7.7.2": version: 7.18.2 resolution: "@babel/generator@npm:7.18.2" @@ -402,6 +425,15 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.18.5": + version: 7.18.5 + resolution: "@babel/parser@npm:7.18.5" + bin: + parser: ./bin/babel-parser.js + checksum: 4976349d8681af215fd5771bd5b74568cc95a2e8bf2afcf354bf46f73f3d6f08d54705f354b1d0012f914dd02a524b7d37c5c1204ccaafccb9db3c37dba96a9b + languageName: node + linkType: hard + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.17.12": version: 7.17.12 resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.17.12" @@ -1527,7 +1559,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.14.5, @babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.17.9, @babel/runtime@npm:^7.2.0, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.4.4, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.2, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7": +"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.14.5, @babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.17.9, @babel/runtime@npm:^7.2.0, @babel/runtime@npm:^7.3.1, @babel/runtime@npm:^7.4.4, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.2, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": version: 7.18.3 resolution: "@babel/runtime@npm:7.18.3" dependencies: @@ -1574,7 +1606,25 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.11, @babel/types@npm:^7.12.7, @babel/types@npm:^7.16.0, @babel/types@npm:^7.16.7, @babel/types@npm:^7.16.8, @babel/types@npm:^7.17.0, @babel/types@npm:^7.17.12, @babel/types@npm:^7.18.0, @babel/types@npm:^7.18.2, @babel/types@npm:^7.2.0, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.7.0, @babel/types@npm:^7.8.3": +"@babel/traverse@npm:^7.18.5": + version: 7.18.5 + resolution: "@babel/traverse@npm:7.18.5" + dependencies: + "@babel/code-frame": ^7.16.7 + "@babel/generator": ^7.18.2 + "@babel/helper-environment-visitor": ^7.18.2 + "@babel/helper-function-name": ^7.17.9 + "@babel/helper-hoist-variables": ^7.16.7 + "@babel/helper-split-export-declaration": ^7.16.7 + "@babel/parser": ^7.18.5 + "@babel/types": ^7.18.4 + debug: ^4.1.0 + globals: ^11.1.0 + checksum: cc0470c880e15a748ca3424665c65836dba450fd0331fb28f9d30aa42acd06387b6321996517ab1761213f781fe8d657e2c3ad67c34afcb766d50653b393810f + languageName: node + linkType: hard + +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.11, @babel/types@npm:^7.12.7, @babel/types@npm:^7.16.0, @babel/types@npm:^7.16.7, @babel/types@npm:^7.16.8, @babel/types@npm:^7.17.0, @babel/types@npm:^7.17.12, @babel/types@npm:^7.18.0, @babel/types@npm:^7.18.2, @babel/types@npm:^7.18.4, @babel/types@npm:^7.2.0, @babel/types@npm:^7.3.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.7.0, @babel/types@npm:^7.8.3": version: 7.18.4 resolution: "@babel/types@npm:7.18.4" dependencies: @@ -2177,6 +2227,15 @@ __metadata: languageName: node linkType: hard +"@jest/schemas@npm:^28.0.2": + version: 28.0.2 + resolution: "@jest/schemas@npm:28.0.2" + dependencies: + "@sinclair/typebox": ^0.23.3 + checksum: 6a177e97b112c99f377697fe803a34f4489b92cd07949876250c69edc9029c7cbda771fcbb03caebd20ffbcfa89b9c22b4dc9d1e9a7fbc9873185459b48ba780 + languageName: node + linkType: hard + "@jest/source-map@npm:^27.5.1": version: 27.5.1 resolution: "@jest/source-map@npm:27.5.1" @@ -3310,7 +3369,7 @@ __metadata: "@rocket.chat/apps-engine": ^1.31.0 "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/icons": ^0.31.9 - "@rocket.chat/message-parser": next + "@rocket.chat/message-parser": ^0.32.0-dev.5 "@rocket.chat/ui-kit": ^0.31.6 "@types/mongodb": ^3.6.10 eslint: ^8.14.0 @@ -3358,6 +3417,19 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/css-in-js@npm:~0.31.14-dev.10": + version: 0.31.14-dev.10 + resolution: "@rocket.chat/css-in-js@npm:0.31.14-dev.10" + dependencies: + "@emotion/hash": ^0.8.0 + "@rocket.chat/css-supports": ~0.31.14-dev.10 + "@rocket.chat/memo": ~0.31.14-dev.10 + "@rocket.chat/stylis-logical-props-middleware": ~0.31.14-dev.10 + stylis: ~4.0.13 + checksum: d0b15a425fdba06c60b618b1186bd4f4d1eac9bc31170f0850b52e06030279db89b679dd903a6e9d4f3ab9e3e9874d05ee7d8fd319f5b4d481b2a751fc4bb17e + languageName: node + linkType: hard + "@rocket.chat/css-supports@npm:^0.31.13": version: 0.31.13 resolution: "@rocket.chat/css-supports@npm:0.31.13" @@ -3385,6 +3457,15 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/css-supports@npm:~0.31.14-dev.10": + version: 0.31.14-dev.10 + resolution: "@rocket.chat/css-supports@npm:0.31.14-dev.10" + dependencies: + "@rocket.chat/memo": ~0.31.14-dev.10 + checksum: 6d6a3cef7c5f388075d0aa1470cbdde9d9ce898e6426663ad55953283402b99b41e4138a10dbde9a6887e7ba841ff57d7f9c844801f549f325bcab60db069cb5 + languageName: node + linkType: hard + "@rocket.chat/ddp-streamer@workspace:ee/apps/ddp-streamer": version: 0.0.0-use.local resolution: "@rocket.chat/ddp-streamer@workspace:ee/apps/ddp-streamer" @@ -3616,6 +3697,13 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/fuselage-tokens@npm:~0.32.0-dev.7": + version: 0.32.0-dev.7 + resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.7" + checksum: cb5e18d545d741e587d83eb038efed5873b586b4c9bf29d29ec01946c50db67e6612c80de440fe597b3b6c2c13aeed6bb60c2490a1e2151a32cf125390d46f07 + languageName: node + linkType: hard + "@rocket.chat/fuselage-ui-kit@npm:~0.31.14-dev.1": version: 0.31.14-dev.1 resolution: "@rocket.chat/fuselage-ui-kit@npm:0.31.14-dev.1" @@ -3678,6 +3766,82 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/fuselage@npm:next": + version: 0.32.0-dev.57 + resolution: "@rocket.chat/fuselage@npm:0.32.0-dev.57" + dependencies: + "@rocket.chat/css-in-js": ~0.31.14-dev.10 + "@rocket.chat/css-supports": ~0.31.14-dev.10 + "@rocket.chat/fuselage-tokens": ~0.32.0-dev.7 + "@rocket.chat/memo": ~0.31.14-dev.10 + "@rocket.chat/styled": ~0.31.14-dev.10 + invariant: ^2.2.4 + react-keyed-flatten-children: ^1.3.0 + peerDependencies: + "@rocket.chat/fuselage-hooks": "*" + "@rocket.chat/fuselage-polyfills": "*" + "@rocket.chat/icons": "*" + react: ^17.0.2 + react-dom: ^17.0.2 + react-virtuoso: 1.2.4 + checksum: d03838c19fc246e7bd435f47dd01be1a937df19d27b499313a8c49d4c908f07c2b8cd89e96f0b9df402c7e920b46264b52137a234f3a2b057415b4a51faace60 + languageName: node + linkType: hard + +"@rocket.chat/gazzodown@workspace:^, @rocket.chat/gazzodown@workspace:packages/gazzodown": + version: 0.0.0-use.local + resolution: "@rocket.chat/gazzodown@workspace:packages/gazzodown" + dependencies: + "@babel/core": ^7.18.5 + "@mdx-js/react": ^1.6.22 + "@rocket.chat/core-typings": "workspace:^" + "@rocket.chat/css-in-js": ^0.31.13 + "@rocket.chat/fuselage": next + "@rocket.chat/fuselage-tokens": ^0.31.13 + "@rocket.chat/message-parser": next + "@rocket.chat/ui-contexts": "workspace:^" + "@storybook/addon-actions": ^6.5.9 + "@storybook/addon-docs": ^6.5.9 + "@storybook/addon-essentials": ^6.5.9 + "@storybook/addon-interactions": ^6.5.9 + "@storybook/addon-links": ^6.5.9 + "@storybook/builder-webpack4": ^6.5.9 + "@storybook/manager-webpack4": ^6.5.9 + "@storybook/react": ^6.5.9 + "@storybook/testing-library": ^0.0.13 + "@testing-library/jest-dom": ^5.16.4 + "@testing-library/react": ~12.1.2 + "@types/babel__core": ^7 + "@types/jest": ^27.4.1 + "@types/katex": ~0 + "@types/react": ^17 + "@types/react-dom": ^18 + "@types/testing-library__jest-dom": ^5 + "@typescript-eslint/eslint-plugin": ^5.29.0 + "@typescript-eslint/parser": ^5.29.0 + babel-loader: ^8.2.5 + eslint: ^8.12.0 + eslint-plugin-anti-trojan-source: ^1.1.0 + eslint-plugin-react: ^7.30.0 + eslint-plugin-react-hooks: ^4.6.0 + highlight.js: ^11.5.1 + identity-obj-proxy: ^3.0.0 + jest: ^27.5.1 + katex: ~0.16.0 + outdent: ^0.8.0 + react-dom: ~17.0.2 + ts-jest: ^27.1.4 + typescript: ~4.3.4 + peerDependencies: + "@rocket.chat/core-typings": "workspace:^" + "@rocket.chat/fuselage": "*" + "@rocket.chat/message-parser": "*" + "@rocket.chat/ui-contexts": "workspace:^" + katex: "*" + react: ~17.0.2 + languageName: unknown + linkType: soft + "@rocket.chat/icons@npm:^0.31.0, @rocket.chat/icons@npm:^0.31.13, @rocket.chat/icons@npm:^0.31.9": version: 0.31.13 resolution: "@rocket.chat/icons@npm:0.31.13" @@ -3805,17 +3969,31 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/memo@npm:~0.31.14-dev.10": + version: 0.31.14-dev.10 + resolution: "@rocket.chat/memo@npm:0.31.14-dev.10" + checksum: 096e6e46f1dd6dc849446b5609f6f2451ec8d5595a483bdaa8432199c1f64b68946ece43199a15870980d9c306d8561d52d357fb8002d9c62b395b7238f28cda + languageName: node + linkType: hard + +"@rocket.chat/message-parser@npm:^0.32.0-dev.5": + version: 0.32.0-dev.5 + resolution: "@rocket.chat/message-parser@npm:0.32.0-dev.5" + checksum: 111948c92c668467043895571f48eb8e4bf0ad9e57d37b2b88fa9084ab75b5d7adc070a69bc2b9d2640883a8011a6c537c6b0c020a91a0c7fba05a6fec0062cc + languageName: node + linkType: hard + "@rocket.chat/message-parser@npm:next": - version: 0.31.14-dev.1 - resolution: "@rocket.chat/message-parser@npm:0.31.14-dev.1" - checksum: c3b7e7da0881e39d980725a3b64f0ab16c01a522d2be82688abc8bf7011900b4dc01e778e0ead4beb5b84abe4e08acf073c97fab5d57cfe6b4eed38cfbf99b01 + version: 0.32.0-dev.11 + resolution: "@rocket.chat/message-parser@npm:0.32.0-dev.11" + checksum: 94418e67f24fccbca5dca89ed909f8d41ca49cc904c50949fbd78ee65dd210bb7d9338ecf11abb4f7b0b6d8c17c3304fe7dac9bb6ada66d1ad5c0b87ea974a6c languageName: node linkType: hard -"@rocket.chat/message-parser@npm:~0.31.12": - version: 0.31.13 - resolution: "@rocket.chat/message-parser@npm:0.31.13" - checksum: f670170464c148eaff2218749b76423c17ffe02d325ca99fab39abe8dae5edb7ba1f36871b4a045e589d2af5fc607681bf45d4a544cb958136c13e83f18dc193 +"@rocket.chat/message-parser@npm:~0.32.0-dev.5": + version: 0.32.0-dev.7 + resolution: "@rocket.chat/message-parser@npm:0.32.0-dev.7" + checksum: a48907ea5db3ce93d77fe3631a657f13b2ddda6dfe9a3376639514ef6ec2938f36d257376789aa67b210b5389b52ee4f04a4b0fda9e4541c2bd16a94c1fa527c languageName: node linkType: hard @@ -3854,11 +4032,12 @@ __metadata: "@rocket.chat/fuselage-toastbar": ^0.32.0-dev.22 "@rocket.chat/fuselage-tokens": ^0.32.0-dev.9 "@rocket.chat/fuselage-ui-kit": ~0.31.14-dev.1 + "@rocket.chat/gazzodown": "workspace:^" "@rocket.chat/icons": ~0.31.14 "@rocket.chat/livechat": "workspace:^" "@rocket.chat/logo": ~0.31.12 "@rocket.chat/memo": ~0.31.12 - "@rocket.chat/message-parser": ~0.31.12 + "@rocket.chat/message-parser": next "@rocket.chat/model-typings": "workspace:^" "@rocket.chat/models": "workspace:^" "@rocket.chat/mp3-encoder": ^0.24.0 @@ -4012,7 +4191,7 @@ __metadata: grapheme-splitter: ^1.0.4 gridfs-stream: ^1.1.1 he: ^1.2.0 - highlight.js: ^9.18.5 + hljs9: "npm:highlight.js@^9.18.5" http-proxy-agent: ^5.0.0 i18next: ^20.6.1 i18next-http-backend: ^1.4.0 @@ -4206,7 +4385,7 @@ __metadata: "@rocket.chat/apps-engine": ^1.31.0 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/message-parser": next + "@rocket.chat/message-parser": ^0.32.0-dev.5 "@rocket.chat/ui-kit": ^0.31.6 "@types/jest": ^27.4.1 "@types/mongodb": ^3.6.10 @@ -4270,6 +4449,16 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/styled@npm:~0.31.14-dev.10": + version: 0.31.14-dev.10 + resolution: "@rocket.chat/styled@npm:0.31.14-dev.10" + dependencies: + "@rocket.chat/css-in-js": ~0.31.14-dev.10 + tslib: ^2.3.1 + checksum: 41e1028ef38bf4536a03fe843377476de7f80f314afb36521e9666b990a5dff1e13bd8564a24799e7f566bef3cc981649552c3221bb9b18288228ae0f1b917af + languageName: node + linkType: hard + "@rocket.chat/stylis-logical-props-middleware@npm:^0.31.13": version: 0.31.13 resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.13" @@ -4306,6 +4495,18 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/stylis-logical-props-middleware@npm:~0.31.14-dev.10": + version: 0.31.14-dev.10 + resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.14-dev.10" + dependencies: + "@rocket.chat/css-supports": ~0.31.14-dev.10 + tslib: ^2.3.1 + peerDependencies: + stylis: 4.0.10 + checksum: 73da39fb53a015c39081e0e24d9a3fe871eee4d8147bb3984c059e73ccba63efb9312c58033be5c34b239a063a123589c844c039e2a37b3611ada72efa2c18c4 + languageName: node + linkType: hard + "@rocket.chat/ui-contexts@workspace:^, @rocket.chat/ui-contexts@workspace:packages/ui-contexts": version: 0.0.0-use.local resolution: "@rocket.chat/ui-contexts@workspace:packages/ui-contexts" @@ -4380,6 +4581,13 @@ __metadata: languageName: node linkType: hard +"@sinclair/typebox@npm:^0.23.3": + version: 0.23.5 + resolution: "@sinclair/typebox@npm:0.23.5" + checksum: c96056d35d9cb862aeb635ff8873e2e7633e668dd544e162aee2690a82c970d0b3f90aa2b3501fe374dfa8e792388559a3e3a86712b23ebaef10061add534f47 + languageName: node + linkType: hard + "@sindresorhus/is@npm:^0.7.0": version: 0.7.0 resolution: "@sindresorhus/is@npm:0.7.0" @@ -4548,6 +4756,41 @@ __metadata: languageName: node linkType: hard +"@storybook/addon-actions@npm:6.5.9, @storybook/addon-actions@npm:^6.5.9": + version: 6.5.9 + resolution: "@storybook/addon-actions@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/api": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/components": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/theming": 6.5.9 + core-js: ^3.8.2 + fast-deep-equal: ^3.1.3 + global: ^4.4.0 + lodash: ^4.17.21 + polished: ^4.2.2 + prop-types: ^15.7.2 + react-inspector: ^5.1.0 + regenerator-runtime: ^0.13.7 + telejson: ^6.0.8 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 + uuid-browser: ^3.1.0 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + checksum: 155b439ba2ab6fc6d367f7e4068bcacbdc8a8438948e99ed71acca84a33a81f3277a406a1378c79f6305b1f85325ede623e0242bdc588b44f97e2c1b2a8b61e3 + languageName: node + linkType: hard + "@storybook/addon-backgrounds@npm:6.5.8, @storybook/addon-backgrounds@npm:^6.5.8": version: 6.5.8 resolution: "@storybook/addon-backgrounds@npm:6.5.8" @@ -4577,6 +4820,35 @@ __metadata: languageName: node linkType: hard +"@storybook/addon-backgrounds@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/addon-backgrounds@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/api": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/components": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/theming": 6.5.9 + core-js: ^3.8.2 + global: ^4.4.0 + memoizerific: ^1.11.3 + regenerator-runtime: ^0.13.7 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + checksum: 1b8d78da701a5aa2d7169818c4cfedc9374acf7f2feb07b6453c4a5362e6184d827e0c41dc11b6d97a35e38fafee721e4aa9d9f7b211fd151c093f9fca05dd5d + languageName: node + linkType: hard + "@storybook/addon-controls@npm:6.5.8": version: 6.5.8 resolution: "@storybook/addon-controls@npm:6.5.8" @@ -4605,6 +4877,34 @@ __metadata: languageName: node linkType: hard +"@storybook/addon-controls@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/addon-controls@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/api": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/components": 6.5.9 + "@storybook/core-common": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/node-logger": 6.5.9 + "@storybook/store": 6.5.9 + "@storybook/theming": 6.5.9 + core-js: ^3.8.2 + lodash: ^4.17.21 + ts-dedent: ^2.0.0 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + checksum: aa5deadb1a670c3ae3c7ca809a03530a58d2b2e37c1e58acbe96122edf80abef9afd4b954477dedaf4f83fad391e737e58c71deaf16990efe51b72992fdf595f + languageName: node + linkType: hard + "@storybook/addon-docs@npm:6.5.8": version: 6.5.8 resolution: "@storybook/addon-docs@npm:6.5.8" @@ -4652,6 +4952,53 @@ __metadata: languageName: node linkType: hard +"@storybook/addon-docs@npm:6.5.9, @storybook/addon-docs@npm:^6.5.9": + version: 6.5.9 + resolution: "@storybook/addon-docs@npm:6.5.9" + dependencies: + "@babel/plugin-transform-react-jsx": ^7.12.12 + "@babel/preset-env": ^7.12.11 + "@jest/transform": ^26.6.2 + "@mdx-js/react": ^1.6.22 + "@storybook/addons": 6.5.9 + "@storybook/api": 6.5.9 + "@storybook/components": 6.5.9 + "@storybook/core-common": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/docs-tools": 6.5.9 + "@storybook/mdx1-csf": ^0.0.1 + "@storybook/node-logger": 6.5.9 + "@storybook/postinstall": 6.5.9 + "@storybook/preview-web": 6.5.9 + "@storybook/source-loader": 6.5.9 + "@storybook/store": 6.5.9 + "@storybook/theming": 6.5.9 + babel-loader: ^8.0.0 + core-js: ^3.8.2 + fast-deep-equal: ^3.1.3 + global: ^4.4.0 + lodash: ^4.17.21 + regenerator-runtime: ^0.13.7 + remark-external-links: ^8.0.0 + remark-slug: ^6.0.0 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 + peerDependencies: + "@storybook/mdx2-csf": ^0.0.3 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + "@storybook/mdx2-csf": + optional: true + react: + optional: true + react-dom: + optional: true + checksum: f1969c8d18c42a783cea2344d4d1d9dd7838a33eba09a8fe1eaff2847b8ccbd3ac284d570fd966703498831fdaef1c00c92a33772ac1a7fd6c29c52af38f9215 + languageName: node + linkType: hard + "@storybook/addon-essentials@npm:^6.5.8, @storybook/addon-essentials@npm:~6.5.8": version: 6.5.8 resolution: "@storybook/addon-essentials@npm:6.5.8" @@ -4712,40 +5059,131 @@ __metadata: languageName: node linkType: hard -"@storybook/addon-interactions@npm:~6.5.8": - version: 6.5.8 - resolution: "@storybook/addon-interactions@npm:6.5.8" +"@storybook/addon-essentials@npm:^6.5.9": + version: 6.5.9 + resolution: "@storybook/addon-essentials@npm:6.5.9" dependencies: - "@devtools-ds/object-inspector": ^1.1.2 - "@storybook/addons": 6.5.8 - "@storybook/api": 6.5.8 - "@storybook/client-logger": 6.5.8 - "@storybook/components": 6.5.8 - "@storybook/core-common": 6.5.8 - "@storybook/core-events": 6.5.8 - "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/instrumenter": 6.5.8 - "@storybook/theming": 6.5.8 + "@storybook/addon-actions": 6.5.9 + "@storybook/addon-backgrounds": 6.5.9 + "@storybook/addon-controls": 6.5.9 + "@storybook/addon-docs": 6.5.9 + "@storybook/addon-measure": 6.5.9 + "@storybook/addon-outline": 6.5.9 + "@storybook/addon-toolbars": 6.5.9 + "@storybook/addon-viewport": 6.5.9 + "@storybook/addons": 6.5.9 + "@storybook/api": 6.5.9 + "@storybook/core-common": 6.5.9 + "@storybook/node-logger": 6.5.9 core-js: ^3.8.2 - global: ^4.4.0 - jest-mock: ^27.0.6 - polished: ^4.2.2 - ts-dedent: ^2.2.0 + regenerator-runtime: ^0.13.7 + ts-dedent: ^2.0.0 peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + "@babel/core": ^7.9.6 peerDependenciesMeta: + "@storybook/angular": + optional: true + "@storybook/builder-manager4": + optional: true + "@storybook/builder-manager5": + optional: true + "@storybook/builder-webpack4": + optional: true + "@storybook/builder-webpack5": + optional: true + "@storybook/html": + optional: true + "@storybook/vue": + optional: true + "@storybook/vue3": + optional: true + "@storybook/web-components": + optional: true + lit: + optional: true + lit-html: + optional: true react: optional: true react-dom: optional: true - checksum: c7754c219f339e1bb18e2ee4ff0286674cbeb58d4ff89881c4ca74475a0722e9c49016c673871fca38fab9ce8f731cc3253b6259480913c6fff6eae880bc362b - languageName: node - linkType: hard - -"@storybook/addon-knobs@npm:^6.4.0": - version: 6.4.0 - resolution: "@storybook/addon-knobs@npm:6.4.0" + svelte: + optional: true + sveltedoc-parser: + optional: true + vue: + optional: true + webpack: + optional: true + checksum: 7af32c041756fcf68eb06ed358580b406f01dc2f9dc703320f1104185af0f18bf61df5d3b8623a115859e876c92e1dc8cacffe9b177a021f302ddf913e511778 + languageName: node + linkType: hard + +"@storybook/addon-interactions@npm:^6.5.9": + version: 6.5.9 + resolution: "@storybook/addon-interactions@npm:6.5.9" + dependencies: + "@devtools-ds/object-inspector": ^1.1.2 + "@storybook/addons": 6.5.9 + "@storybook/api": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/components": 6.5.9 + "@storybook/core-common": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/instrumenter": 6.5.9 + "@storybook/theming": 6.5.9 + core-js: ^3.8.2 + global: ^4.4.0 + jest-mock: ^27.0.6 + polished: ^4.2.2 + ts-dedent: ^2.2.0 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + checksum: a41611b991d32f34b985e4a5bd391e9766fa42f4dd511929cd71fd0fba16384f66a96fc57eb3fd25204625d39d65c35f06ceab8215e6533502f1d255198dffb5 + languageName: node + linkType: hard + +"@storybook/addon-interactions@npm:~6.5.8": + version: 6.5.8 + resolution: "@storybook/addon-interactions@npm:6.5.8" + dependencies: + "@devtools-ds/object-inspector": ^1.1.2 + "@storybook/addons": 6.5.8 + "@storybook/api": 6.5.8 + "@storybook/client-logger": 6.5.8 + "@storybook/components": 6.5.8 + "@storybook/core-common": 6.5.8 + "@storybook/core-events": 6.5.8 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/instrumenter": 6.5.8 + "@storybook/theming": 6.5.8 + core-js: ^3.8.2 + global: ^4.4.0 + jest-mock: ^27.0.6 + polished: ^4.2.2 + ts-dedent: ^2.2.0 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + checksum: c7754c219f339e1bb18e2ee4ff0286674cbeb58d4ff89881c4ca74475a0722e9c49016c673871fca38fab9ce8f731cc3253b6259480913c6fff6eae880bc362b + languageName: node + linkType: hard + +"@storybook/addon-knobs@npm:^6.4.0": + version: 6.4.0 + resolution: "@storybook/addon-knobs@npm:6.4.0" dependencies: copy-to-clipboard: ^3.3.1 core-js: ^3.8.2 @@ -4775,6 +5213,34 @@ __metadata: languageName: node linkType: hard +"@storybook/addon-links@npm:^6.5.9": + version: 6.5.9 + resolution: "@storybook/addon-links@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/router": 6.5.9 + "@types/qs": ^6.9.5 + core-js: ^3.8.2 + global: ^4.4.0 + prop-types: ^15.7.2 + qs: ^6.10.0 + regenerator-runtime: ^0.13.7 + ts-dedent: ^2.0.0 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + checksum: 3bc5901d9446dcf0e806941f374a9681bf9d214b855b4ab470377812b5c03d76a342c1b60a73774604cf1f562de1e0f4e028fe51072a044f11278c153c5f8255 + languageName: node + linkType: hard + "@storybook/addon-measure@npm:6.5.8": version: 6.5.8 resolution: "@storybook/addon-measure@npm:6.5.8" @@ -4799,6 +5265,30 @@ __metadata: languageName: node linkType: hard +"@storybook/addon-measure@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/addon-measure@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/api": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/components": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + core-js: ^3.8.2 + global: ^4.4.0 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + checksum: 257f6f2cef6b7c8fdaa6592fae94cd395c3d0b619f54b902732df11bc3aab2470c1d0e7027e781b48d20328f83f80c80aae1226e86900a63413c756ea9c57b1c + languageName: node + linkType: hard + "@storybook/addon-outline@npm:6.5.8": version: 6.5.8 resolution: "@storybook/addon-outline@npm:6.5.8" @@ -4825,6 +5315,32 @@ __metadata: languageName: node linkType: hard +"@storybook/addon-outline@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/addon-outline@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/api": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/components": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + core-js: ^3.8.2 + global: ^4.4.0 + regenerator-runtime: ^0.13.7 + ts-dedent: ^2.0.0 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + checksum: f4aabb954c1aa5baadb48fbc0348e5a6abef650c71289625bbfa3d0f2885442dda26ca99b0919ca8397c30567b38cd3384f0fe1364178fcf124033faf10bf962 + languageName: node + linkType: hard + "@storybook/addon-postcss@npm:^2.0.0": version: 2.0.0 resolution: "@storybook/addon-postcss@npm:2.0.0" @@ -4861,6 +5377,29 @@ __metadata: languageName: node linkType: hard +"@storybook/addon-toolbars@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/addon-toolbars@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/api": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/components": 6.5.9 + "@storybook/theming": 6.5.9 + core-js: ^3.8.2 + regenerator-runtime: ^0.13.7 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + checksum: a97dd2a7d7f46cfa413298a3b6893366df7f7f15432591c5e224a757e7b57bfde18ba4442dcfe57a37a5e8d595403a2dd2a598ef73eaefa69df91884658fe288 + languageName: node + linkType: hard + "@storybook/addon-viewport@npm:6.5.8, @storybook/addon-viewport@npm:^6.5.8": version: 6.5.8 resolution: "@storybook/addon-viewport@npm:6.5.8" @@ -4888,6 +5427,33 @@ __metadata: languageName: node linkType: hard +"@storybook/addon-viewport@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/addon-viewport@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/api": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/components": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/theming": 6.5.9 + core-js: ^3.8.2 + global: ^4.4.0 + memoizerific: ^1.11.3 + prop-types: ^15.7.2 + regenerator-runtime: ^0.13.7 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + react: + optional: true + react-dom: + optional: true + checksum: 5255319e8089b9ff7bc3bebd0265e83f4cc51c0b7475c5f6729fac6a43c56532697efe6351e2a4b02d35d2b9b587b27fd159a2e3f76bd3d29689c1ec4ee4d799 + languageName: node + linkType: hard + "@storybook/addons@npm:6.5.8, @storybook/addons@npm:~6.5.8": version: 6.5.8 resolution: "@storybook/addons@npm:6.5.8" @@ -4910,6 +5476,28 @@ __metadata: languageName: node linkType: hard +"@storybook/addons@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/addons@npm:6.5.9" + dependencies: + "@storybook/api": 6.5.9 + "@storybook/channels": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/router": 6.5.9 + "@storybook/theming": 6.5.9 + "@types/webpack-env": ^1.16.0 + core-js: ^3.8.2 + global: ^4.4.0 + regenerator-runtime: ^0.13.7 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: 50e0579df27aa7d405e25c0f057e4cd2d37c091ee4b88ab7969238255738ab5eb7f8c5af3100eaeaea74f916288ed862291f517b8a05e30578d7d1fd254d9f8c + languageName: node + linkType: hard + "@storybook/api@npm:6.5.8": version: 6.5.8 resolution: "@storybook/api@npm:6.5.8" @@ -4938,6 +5526,34 @@ __metadata: languageName: node linkType: hard +"@storybook/api@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/api@npm:6.5.9" + dependencies: + "@storybook/channels": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/router": 6.5.9 + "@storybook/semver": ^7.3.2 + "@storybook/theming": 6.5.9 + core-js: ^3.8.2 + fast-deep-equal: ^3.1.3 + global: ^4.4.0 + lodash: ^4.17.21 + memoizerific: ^1.11.3 + regenerator-runtime: ^0.13.7 + store2: ^2.12.0 + telejson: ^6.0.8 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: 72d720eba7a5f6645c92a18884e267b57d4ba145d9aafd891f3a9c7651e8ea1418ada7cf7f6d5d963db100526103d5fceac8fb0a82e8099478b02dc8f33a1fd7 + languageName: node + linkType: hard + "@storybook/builder-webpack4@npm:6.5.8": version: 6.5.8 resolution: "@storybook/builder-webpack4@npm:6.5.8" @@ -4999,6 +5615,67 @@ __metadata: languageName: node linkType: hard +"@storybook/builder-webpack4@npm:6.5.9, @storybook/builder-webpack4@npm:^6.5.9": + version: 6.5.9 + resolution: "@storybook/builder-webpack4@npm:6.5.9" + dependencies: + "@babel/core": ^7.12.10 + "@storybook/addons": 6.5.9 + "@storybook/api": 6.5.9 + "@storybook/channel-postmessage": 6.5.9 + "@storybook/channels": 6.5.9 + "@storybook/client-api": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/components": 6.5.9 + "@storybook/core-common": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/node-logger": 6.5.9 + "@storybook/preview-web": 6.5.9 + "@storybook/router": 6.5.9 + "@storybook/semver": ^7.3.2 + "@storybook/store": 6.5.9 + "@storybook/theming": 6.5.9 + "@storybook/ui": 6.5.9 + "@types/node": ^14.0.10 || ^16.0.0 + "@types/webpack": ^4.41.26 + autoprefixer: ^9.8.6 + babel-loader: ^8.0.0 + case-sensitive-paths-webpack-plugin: ^2.3.0 + core-js: ^3.8.2 + css-loader: ^3.6.0 + file-loader: ^6.2.0 + find-up: ^5.0.0 + fork-ts-checker-webpack-plugin: ^4.1.6 + glob: ^7.1.6 + glob-promise: ^3.4.0 + global: ^4.4.0 + html-webpack-plugin: ^4.0.0 + pnp-webpack-plugin: 1.6.4 + postcss: ^7.0.36 + postcss-flexbugs-fixes: ^4.2.1 + postcss-loader: ^4.2.0 + raw-loader: ^4.0.2 + stable: ^0.1.8 + style-loader: ^1.3.0 + terser-webpack-plugin: ^4.2.3 + ts-dedent: ^2.0.0 + url-loader: ^4.1.1 + util-deprecate: ^1.0.2 + webpack: 4 + webpack-dev-middleware: ^3.7.3 + webpack-filter-warnings-plugin: ^1.2.1 + webpack-hot-middleware: ^2.25.1 + webpack-virtual-modules: ^0.2.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 2ed529188a461ee505b334f555a4ada5817e15811499d26d46106aa6d170f350b925059305cbe26d84c1da655e0e84db4aba8aac3524037f7a961ce805f418a3 + languageName: node + linkType: hard + "@storybook/channel-postmessage@npm:6.5.8": version: 6.5.8 resolution: "@storybook/channel-postmessage@npm:6.5.8" @@ -5014,6 +5691,21 @@ __metadata: languageName: node linkType: hard +"@storybook/channel-postmessage@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/channel-postmessage@npm:6.5.9" + dependencies: + "@storybook/channels": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/core-events": 6.5.9 + core-js: ^3.8.2 + global: ^4.4.0 + qs: ^6.10.0 + telejson: ^6.0.8 + checksum: f54b353ad21faab242d306d65b854c4e9a16dc5b982971b98a55221585de46bcfb9fae5ddc4e7b29589cf892aeea7c3dd4d9aa309bf492d5f889df171a485dc5 + languageName: node + linkType: hard + "@storybook/channel-websocket@npm:6.5.8": version: 6.5.8 resolution: "@storybook/channel-websocket@npm:6.5.8" @@ -5027,6 +5719,19 @@ __metadata: languageName: node linkType: hard +"@storybook/channel-websocket@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/channel-websocket@npm:6.5.9" + dependencies: + "@storybook/channels": 6.5.9 + "@storybook/client-logger": 6.5.9 + core-js: ^3.8.2 + global: ^4.4.0 + telejson: ^6.0.8 + checksum: a07fc343602f2a60ebf958b3dfa6e553fe255de22979795c49b7830843dca741c3ab6811357c4da3d390dae09b893f656623ba7dfcc4a66bb347c641e8d53a9a + languageName: node + linkType: hard + "@storybook/channels@npm:6.5.8": version: 6.5.8 resolution: "@storybook/channels@npm:6.5.8" @@ -5038,6 +5743,17 @@ __metadata: languageName: node linkType: hard +"@storybook/channels@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/channels@npm:6.5.9" + dependencies: + core-js: ^3.8.2 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 + checksum: b51767553a3e00f4da8e9684c798348c230d5553a43886ca560c7e2f249e15ab9e3d7bbeb947d394413505261806c79c629551f9d722f83f00e15d9e19b6617c + languageName: node + linkType: hard + "@storybook/client-api@npm:6.5.8": version: 6.5.8 resolution: "@storybook/client-api@npm:6.5.8" @@ -5069,6 +5785,37 @@ __metadata: languageName: node linkType: hard +"@storybook/client-api@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/client-api@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/channel-postmessage": 6.5.9 + "@storybook/channels": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/store": 6.5.9 + "@types/qs": ^6.9.5 + "@types/webpack-env": ^1.16.0 + core-js: ^3.8.2 + fast-deep-equal: ^3.1.3 + global: ^4.4.0 + lodash: ^4.17.21 + memoizerific: ^1.11.3 + qs: ^6.10.0 + regenerator-runtime: ^0.13.7 + store2: ^2.12.0 + synchronous-promise: ^2.0.15 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: 90c8f84615066ce911517d64c13403d602bdbe2047962c070a96f478b082d119bed01d12c7d602e40264227bd2909757255cd0680cbcda26dc4a22aa1d3dcaae + languageName: node + linkType: hard + "@storybook/client-logger@npm:6.5.8, @storybook/client-logger@npm:^6.4.0 || >=6.5.0-0": version: 6.5.8 resolution: "@storybook/client-logger@npm:6.5.8" @@ -5079,6 +5826,16 @@ __metadata: languageName: node linkType: hard +"@storybook/client-logger@npm:6.5.9, @storybook/client-logger@npm:^6.4.0": + version: 6.5.9 + resolution: "@storybook/client-logger@npm:6.5.9" + dependencies: + core-js: ^3.8.2 + global: ^4.4.0 + checksum: 5b72d93a57fae8d188bb40db0a3af3ce9f3ccc58751e90d38e0786b58f26a5358d10339916455646a8d60e2cc749d761990927fdeb06e5f09e68d48fe50a5de7 + languageName: node + linkType: hard + "@storybook/components@npm:6.5.8": version: 6.5.8 resolution: "@storybook/components@npm:6.5.8" @@ -5099,6 +5856,27 @@ __metadata: languageName: node linkType: hard +"@storybook/components@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/components@npm:6.5.9" + dependencies: + "@storybook/client-logger": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/theming": 6.5.9 + "@types/react-syntax-highlighter": 11.0.5 + core-js: ^3.8.2 + memoizerific: ^1.11.3 + qs: ^6.10.0 + react-syntax-highlighter: ^15.4.5 + regenerator-runtime: ^0.13.7 + util-deprecate: ^1.0.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: f14ee528a44b77c7a362696ef7506678ed656ce53dde3a5207c2391addc5307f9e6f5b21d869e31a864bf8edc8d1a037f3f8793ddf6191a97d92684ef940b6f2 + languageName: node + linkType: hard + "@storybook/core-client@npm:6.5.8": version: 6.5.8 resolution: "@storybook/core-client@npm:6.5.8" @@ -5121,22 +5899,121 @@ __metadata: qs: ^6.10.0 regenerator-runtime: ^0.13.7 ts-dedent: ^2.0.0 - unfetch: ^4.2.0 + unfetch: ^4.2.0 + util-deprecate: ^1.0.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + webpack: "*" + peerDependenciesMeta: + typescript: + optional: true + checksum: 51f83765581f5acd07f6284bf1e883a053d97ab6346ef1c9310fdefbc75b69c60ed709be1859fd120fb2b04c7c8c4d1ee017ede8f4c06e9a1bb8fa381afa9a3b + languageName: node + linkType: hard + +"@storybook/core-client@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/core-client@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/channel-postmessage": 6.5.9 + "@storybook/channel-websocket": 6.5.9 + "@storybook/client-api": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/preview-web": 6.5.9 + "@storybook/store": 6.5.9 + "@storybook/ui": 6.5.9 + airbnb-js-shims: ^2.2.1 + ansi-to-html: ^0.6.11 + core-js: ^3.8.2 + global: ^4.4.0 + lodash: ^4.17.21 + qs: ^6.10.0 + regenerator-runtime: ^0.13.7 + ts-dedent: ^2.0.0 + unfetch: ^4.2.0 + util-deprecate: ^1.0.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + webpack: "*" + peerDependenciesMeta: + typescript: + optional: true + checksum: 1099e83736ae89004d94630ce2a224c87586337c280075cf2ab127fa21dc7325912331301e6e864281559480a7c3324c3b388b4ec568b30efa670356e0c5b88e + languageName: node + linkType: hard + +"@storybook/core-common@npm:6.5.8": + version: 6.5.8 + resolution: "@storybook/core-common@npm:6.5.8" + dependencies: + "@babel/core": ^7.12.10 + "@babel/plugin-proposal-class-properties": ^7.12.1 + "@babel/plugin-proposal-decorators": ^7.12.12 + "@babel/plugin-proposal-export-default-from": ^7.12.1 + "@babel/plugin-proposal-nullish-coalescing-operator": ^7.12.1 + "@babel/plugin-proposal-object-rest-spread": ^7.12.1 + "@babel/plugin-proposal-optional-chaining": ^7.12.7 + "@babel/plugin-proposal-private-methods": ^7.12.1 + "@babel/plugin-proposal-private-property-in-object": ^7.12.1 + "@babel/plugin-syntax-dynamic-import": ^7.8.3 + "@babel/plugin-transform-arrow-functions": ^7.12.1 + "@babel/plugin-transform-block-scoping": ^7.12.12 + "@babel/plugin-transform-classes": ^7.12.1 + "@babel/plugin-transform-destructuring": ^7.12.1 + "@babel/plugin-transform-for-of": ^7.12.1 + "@babel/plugin-transform-parameters": ^7.12.1 + "@babel/plugin-transform-shorthand-properties": ^7.12.1 + "@babel/plugin-transform-spread": ^7.12.1 + "@babel/preset-env": ^7.12.11 + "@babel/preset-react": ^7.12.10 + "@babel/preset-typescript": ^7.12.7 + "@babel/register": ^7.12.1 + "@storybook/node-logger": 6.5.8 + "@storybook/semver": ^7.3.2 + "@types/node": ^14.0.10 || ^16.0.0 + "@types/pretty-hrtime": ^1.0.0 + babel-loader: ^8.0.0 + babel-plugin-macros: ^3.0.1 + babel-plugin-polyfill-corejs3: ^0.1.0 + chalk: ^4.1.0 + core-js: ^3.8.2 + express: ^4.17.1 + file-system-cache: ^1.0.5 + find-up: ^5.0.0 + fork-ts-checker-webpack-plugin: ^6.0.4 + fs-extra: ^9.0.1 + glob: ^7.1.6 + handlebars: ^4.7.7 + interpret: ^2.2.0 + json5: ^2.1.3 + lazy-universal-dotenv: ^3.0.1 + picomatch: ^2.3.0 + pkg-dir: ^5.0.0 + pretty-hrtime: ^1.0.3 + resolve-from: ^5.0.0 + slash: ^3.0.0 + telejson: ^6.0.8 + ts-dedent: ^2.0.0 util-deprecate: ^1.0.2 + webpack: 4 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - webpack: "*" peerDependenciesMeta: typescript: optional: true - checksum: 51f83765581f5acd07f6284bf1e883a053d97ab6346ef1c9310fdefbc75b69c60ed709be1859fd120fb2b04c7c8c4d1ee017ede8f4c06e9a1bb8fa381afa9a3b + checksum: a9dfe67d077a319976ad70b2dabd2e9e2a1de27d04e013e84f0952570f9d1fd0a8244ef4e7ea11626bac375d77c810aed56dd169532b8d14f1042aa9cc7ae7ea languageName: node linkType: hard -"@storybook/core-common@npm:6.5.8": - version: 6.5.8 - resolution: "@storybook/core-common@npm:6.5.8" +"@storybook/core-common@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/core-common@npm:6.5.9" dependencies: "@babel/core": ^7.12.10 "@babel/plugin-proposal-class-properties": ^7.12.1 @@ -5160,7 +6037,7 @@ __metadata: "@babel/preset-react": ^7.12.10 "@babel/preset-typescript": ^7.12.7 "@babel/register": ^7.12.1 - "@storybook/node-logger": 6.5.8 + "@storybook/node-logger": 6.5.9 "@storybook/semver": ^7.3.2 "@types/node": ^14.0.10 || ^16.0.0 "@types/pretty-hrtime": ^1.0.0 @@ -5194,7 +6071,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: a9dfe67d077a319976ad70b2dabd2e9e2a1de27d04e013e84f0952570f9d1fd0a8244ef4e7ea11626bac375d77c810aed56dd169532b8d14f1042aa9cc7ae7ea + checksum: 559499eaf747c532aa211c4d16f8a083fc4373853340b0c70ec72d1122794ece8067b9fed8dc45db892bdf9dac18a5f1d5fbc3905e2528502c8599eb6db635dd languageName: node linkType: hard @@ -5207,6 +6084,15 @@ __metadata: languageName: node linkType: hard +"@storybook/core-events@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/core-events@npm:6.5.9" + dependencies: + core-js: ^3.8.2 + checksum: b28af71de1e7f66a6fdf26c384c976640220ea1a6d807523ec368ecdc1b9dd3c87d5e1fcc5bd443d1059c408c17288afb415f8160e69ebb6cb2f3914a2db5f1d + languageName: node + linkType: hard + "@storybook/core-server@npm:6.5.8": version: 6.5.8 resolution: "@storybook/core-server@npm:6.5.8" @@ -5270,6 +6156,69 @@ __metadata: languageName: node linkType: hard +"@storybook/core-server@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/core-server@npm:6.5.9" + dependencies: + "@discoveryjs/json-ext": ^0.5.3 + "@storybook/builder-webpack4": 6.5.9 + "@storybook/core-client": 6.5.9 + "@storybook/core-common": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/csf-tools": 6.5.9 + "@storybook/manager-webpack4": 6.5.9 + "@storybook/node-logger": 6.5.9 + "@storybook/semver": ^7.3.2 + "@storybook/store": 6.5.9 + "@storybook/telemetry": 6.5.9 + "@types/node": ^14.0.10 || ^16.0.0 + "@types/node-fetch": ^2.5.7 + "@types/pretty-hrtime": ^1.0.0 + "@types/webpack": ^4.41.26 + better-opn: ^2.1.1 + boxen: ^5.1.2 + chalk: ^4.1.0 + cli-table3: ^0.6.1 + commander: ^6.2.1 + compression: ^1.7.4 + core-js: ^3.8.2 + cpy: ^8.1.2 + detect-port: ^1.3.0 + express: ^4.17.1 + fs-extra: ^9.0.1 + global: ^4.4.0 + globby: ^11.0.2 + ip: ^2.0.0 + lodash: ^4.17.21 + node-fetch: ^2.6.7 + open: ^8.4.0 + pretty-hrtime: ^1.0.3 + prompts: ^2.4.0 + regenerator-runtime: ^0.13.7 + serve-favicon: ^2.5.0 + slash: ^3.0.0 + telejson: ^6.0.8 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 + watchpack: ^2.2.0 + webpack: 4 + ws: ^8.2.3 + x-default-browser: ^0.4.0 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + "@storybook/builder-webpack5": + optional: true + "@storybook/manager-webpack5": + optional: true + typescript: + optional: true + checksum: c91a364e37347cb08e27325191bed0a4113f6d002567438321f9cfbcabd3441ec8918ef53205a000c5a5fbb3c7fdca36f1531058039aaf9442ee2040051f5f2e + languageName: node + linkType: hard + "@storybook/core@npm:6.5.8": version: 6.5.8 resolution: "@storybook/core@npm:6.5.8" @@ -5291,6 +6240,27 @@ __metadata: languageName: node linkType: hard +"@storybook/core@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/core@npm:6.5.9" + dependencies: + "@storybook/core-client": 6.5.9 + "@storybook/core-server": 6.5.9 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + webpack: "*" + peerDependenciesMeta: + "@storybook/builder-webpack5": + optional: true + "@storybook/manager-webpack5": + optional: true + typescript: + optional: true + checksum: 6c644bbba0c935661e032cee9dab6de15431b8eb30361d4924a005d063d974baf34011612f0409f36115c2a6f32dcc47ca79b80cb36cf439fb24a6b7a743f393 + languageName: node + linkType: hard + "@storybook/csf-tools@npm:6.5.8": version: 6.5.8 resolution: "@storybook/csf-tools@npm:6.5.8" @@ -5318,6 +6288,33 @@ __metadata: languageName: node linkType: hard +"@storybook/csf-tools@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/csf-tools@npm:6.5.9" + dependencies: + "@babel/core": ^7.12.10 + "@babel/generator": ^7.12.11 + "@babel/parser": ^7.12.11 + "@babel/plugin-transform-react-jsx": ^7.12.12 + "@babel/preset-env": ^7.12.11 + "@babel/traverse": ^7.12.11 + "@babel/types": ^7.12.11 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/mdx1-csf": ^0.0.1 + core-js: ^3.8.2 + fs-extra: ^9.0.1 + global: ^4.4.0 + regenerator-runtime: ^0.13.7 + ts-dedent: ^2.0.0 + peerDependencies: + "@storybook/mdx2-csf": ^0.0.3 + peerDependenciesMeta: + "@storybook/mdx2-csf": + optional: true + checksum: d29ceb995ca850b9655a576b6e92d30c543414ecd82a4ce3a46c567d0f3ad9804fe5732098ca30e3bcf3e70e00f004a84ff3273bc4b90b133855ebe6fdf92426 + languageName: node + linkType: hard + "@storybook/csf@npm:0.0.2--canary.4566f4d.1": version: 0.0.2--canary.4566f4d.1 resolution: "@storybook/csf@npm:0.0.2--canary.4566f4d.1" @@ -5342,6 +6339,21 @@ __metadata: languageName: node linkType: hard +"@storybook/docs-tools@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/docs-tools@npm:6.5.9" + dependencies: + "@babel/core": ^7.12.10 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/store": 6.5.9 + core-js: ^3.8.2 + doctrine: ^3.0.0 + lodash: ^4.17.21 + regenerator-runtime: ^0.13.7 + checksum: 85f56828c22eed1b0e74f011dab042f69be5868b5939a92d068c57ab5e9b6f6390aa3ab7b7a2185e79a8e650ffee8c4a24e641830b3ae18869abade064daa468 + languageName: node + linkType: hard + "@storybook/instrumenter@npm:6.5.8, @storybook/instrumenter@npm:^6.4.0 || >=6.5.0-0": version: 6.5.8 resolution: "@storybook/instrumenter@npm:6.5.8" @@ -5355,6 +6367,19 @@ __metadata: languageName: node linkType: hard +"@storybook/instrumenter@npm:6.5.9, @storybook/instrumenter@npm:^6.4.0": + version: 6.5.9 + resolution: "@storybook/instrumenter@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/core-events": 6.5.9 + core-js: ^3.8.2 + global: ^4.4.0 + checksum: 90b83a30177794cbbd9e388b4ee68ee6c86c28d5bbb4c992607f3e5ed189abdb8191cfa392d912a45b6a42e5eb603e90a853032205a4b9a4388f3af8f49d5064 + languageName: node + linkType: hard + "@storybook/manager-webpack4@npm:6.5.8": version: 6.5.8 resolution: "@storybook/manager-webpack4@npm:6.5.8" @@ -5404,6 +6429,55 @@ __metadata: languageName: node linkType: hard +"@storybook/manager-webpack4@npm:6.5.9, @storybook/manager-webpack4@npm:^6.5.9": + version: 6.5.9 + resolution: "@storybook/manager-webpack4@npm:6.5.9" + dependencies: + "@babel/core": ^7.12.10 + "@babel/plugin-transform-template-literals": ^7.12.1 + "@babel/preset-react": ^7.12.10 + "@storybook/addons": 6.5.9 + "@storybook/core-client": 6.5.9 + "@storybook/core-common": 6.5.9 + "@storybook/node-logger": 6.5.9 + "@storybook/theming": 6.5.9 + "@storybook/ui": 6.5.9 + "@types/node": ^14.0.10 || ^16.0.0 + "@types/webpack": ^4.41.26 + babel-loader: ^8.0.0 + case-sensitive-paths-webpack-plugin: ^2.3.0 + chalk: ^4.1.0 + core-js: ^3.8.2 + css-loader: ^3.6.0 + express: ^4.17.1 + file-loader: ^6.2.0 + find-up: ^5.0.0 + fs-extra: ^9.0.1 + html-webpack-plugin: ^4.0.0 + node-fetch: ^2.6.7 + pnp-webpack-plugin: 1.6.4 + read-pkg-up: ^7.0.1 + regenerator-runtime: ^0.13.7 + resolve-from: ^5.0.0 + style-loader: ^1.3.0 + telejson: ^6.0.8 + terser-webpack-plugin: ^4.2.3 + ts-dedent: ^2.0.0 + url-loader: ^4.1.1 + util-deprecate: ^1.0.2 + webpack: 4 + webpack-dev-middleware: ^3.7.3 + webpack-virtual-modules: ^0.2.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: fd04cfe95efc59cd37b50c47827eec9c600d076e34b990812e6bf68c3e0883b5b148d582a2d8f5d2a5fc76beda187e956c4fd13d4cd30d51008ece2023de7bae + languageName: node + linkType: hard + "@storybook/mdx1-csf@npm:^0.0.1": version: 0.0.1 resolution: "@storybook/mdx1-csf@npm:0.0.1" @@ -5436,6 +6510,19 @@ __metadata: languageName: node linkType: hard +"@storybook/node-logger@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/node-logger@npm:6.5.9" + dependencies: + "@types/npmlog": ^4.1.2 + chalk: ^4.1.0 + core-js: ^3.8.2 + npmlog: ^5.0.1 + pretty-hrtime: ^1.0.3 + checksum: 3f4d236d19f4e99ea75acd405377f7b1a6217964d176c6a3702cfba51ae1ba129d12e66536688457a6c93045f882142a03c87609554f10d8d6c8af4f0ebf9303 + languageName: node + linkType: hard + "@storybook/postinstall@npm:6.5.8": version: 6.5.8 resolution: "@storybook/postinstall@npm:6.5.8" @@ -5445,6 +6532,15 @@ __metadata: languageName: node linkType: hard +"@storybook/postinstall@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/postinstall@npm:6.5.9" + dependencies: + core-js: ^3.8.2 + checksum: 339e7c87c624d180ba80a7bdf1665831ce71ae9d7687f512f5108d41b01d2f630ff3c4f773e3505437039fb5556741c4f0fba6b288bc0991cc5cfdaa09375df3 + languageName: node + linkType: hard + "@storybook/preview-web@npm:6.5.8": version: 6.5.8 resolution: "@storybook/preview-web@npm:6.5.8" @@ -5472,6 +6568,33 @@ __metadata: languageName: node linkType: hard +"@storybook/preview-web@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/preview-web@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/channel-postmessage": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/store": 6.5.9 + ansi-to-html: ^0.6.11 + core-js: ^3.8.2 + global: ^4.4.0 + lodash: ^4.17.21 + qs: ^6.10.0 + regenerator-runtime: ^0.13.7 + synchronous-promise: ^2.0.15 + ts-dedent: ^2.0.0 + unfetch: ^4.2.0 + util-deprecate: ^1.0.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: 858f5901e0f5fc1b52a76e8c5264c044f9f8f16c63e3c861370ed08c046228157dcd828a89b1d7f06da835d5727edf5894018987f4dd45115b46ffc05133ad3d + languageName: node + linkType: hard + "@storybook/react-docgen-typescript-plugin@npm:1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0": version: 1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0 resolution: "@storybook/react-docgen-typescript-plugin@npm:1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0" @@ -5502,11 +6625,76 @@ __metadata: "@storybook/core": 6.5.8 "@storybook/core-common": 6.5.8 "@storybook/csf": 0.0.2--canary.4566f4d.1 - "@storybook/docs-tools": 6.5.8 - "@storybook/node-logger": 6.5.8 + "@storybook/docs-tools": 6.5.8 + "@storybook/node-logger": 6.5.8 + "@storybook/react-docgen-typescript-plugin": 1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0 + "@storybook/semver": ^7.3.2 + "@storybook/store": 6.5.8 + "@types/estree": ^0.0.51 + "@types/node": ^14.14.20 || ^16.0.0 + "@types/webpack-env": ^1.16.0 + acorn: ^7.4.1 + acorn-jsx: ^5.3.1 + acorn-walk: ^7.2.0 + babel-plugin-add-react-displayname: ^0.0.5 + babel-plugin-react-docgen: ^4.2.1 + core-js: ^3.8.2 + escodegen: ^2.0.0 + fs-extra: ^9.0.1 + global: ^4.4.0 + html-tags: ^3.1.0 + lodash: ^4.17.21 + prop-types: ^15.7.2 + react-element-to-jsx-string: ^14.3.4 + react-refresh: ^0.11.0 + read-pkg-up: ^7.0.1 + regenerator-runtime: ^0.13.7 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 + webpack: ">=4.43.0 <6.0.0" + peerDependencies: + "@babel/core": ^7.11.5 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + require-from-string: ^2.0.2 + peerDependenciesMeta: + "@babel/core": + optional: true + "@storybook/builder-webpack4": + optional: true + "@storybook/builder-webpack5": + optional: true + "@storybook/manager-webpack4": + optional: true + "@storybook/manager-webpack5": + optional: true + typescript: + optional: true + bin: + build-storybook: bin/build.js + start-storybook: bin/index.js + storybook-server: bin/index.js + checksum: 66aebd4d1b4744daf368ffb13c390cf3857b664380638f929c273cc6f0c816c02729da6b8f983355af1b8b07dc4c18241bcbe85eddb1a9f17cbb5842ffaba373 + languageName: node + linkType: hard + +"@storybook/react@npm:^6.5.9": + version: 6.5.9 + resolution: "@storybook/react@npm:6.5.9" + dependencies: + "@babel/preset-flow": ^7.12.1 + "@babel/preset-react": ^7.12.10 + "@pmmmwh/react-refresh-webpack-plugin": ^0.5.3 + "@storybook/addons": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/core": 6.5.9 + "@storybook/core-common": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + "@storybook/docs-tools": 6.5.9 + "@storybook/node-logger": 6.5.9 "@storybook/react-docgen-typescript-plugin": 1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0 "@storybook/semver": ^7.3.2 - "@storybook/store": 6.5.8 + "@storybook/store": 6.5.9 "@types/estree": ^0.0.51 "@types/node": ^14.14.20 || ^16.0.0 "@types/webpack-env": ^1.16.0 @@ -5551,7 +6739,7 @@ __metadata: build-storybook: bin/build.js start-storybook: bin/index.js storybook-server: bin/index.js - checksum: 66aebd4d1b4744daf368ffb13c390cf3857b664380638f929c273cc6f0c816c02729da6b8f983355af1b8b07dc4c18241bcbe85eddb1a9f17cbb5842ffaba373 + checksum: 63c72547bb13c754053171121edfff8f3f367283155ae8e967e9e989d58397511d3ed1752c94721a91c7c164e1d09e9e7dafa9176ef28e0ce4fc10de26711934 languageName: node linkType: hard @@ -5569,6 +6757,22 @@ __metadata: languageName: node linkType: hard +"@storybook/router@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/router@npm:6.5.9" + dependencies: + "@storybook/client-logger": 6.5.9 + core-js: ^3.8.2 + memoizerific: ^1.11.3 + qs: ^6.10.0 + regenerator-runtime: ^0.13.7 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: 10acf6d67fa245ca10d8e377d593405ab1505d22b3bb2e7ce7dc45bc5be2074d7bb89f9266b7550b84063c907e2188742b355fc8af05f7cf4554a0770915d12e + languageName: node + linkType: hard + "@storybook/semver@npm:^7.3.2": version: 7.3.2 resolution: "@storybook/semver@npm:7.3.2" @@ -5602,6 +6806,27 @@ __metadata: languageName: node linkType: hard +"@storybook/source-loader@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/source-loader@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + core-js: ^3.8.2 + estraverse: ^5.2.0 + global: ^4.4.0 + loader-utils: ^2.0.0 + lodash: ^4.17.21 + prettier: ">=2.2.1 <=2.3.0" + regenerator-runtime: ^0.13.7 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: dca2fea04159a1455ac92cf6ec80fa2824c1b281ea5d689e32310f2eac77c5314a47df5faf9fd2733ed8e5f0d75f7988aff5f05eebe1af0c15f1359b3e48abb5 + languageName: node + linkType: hard + "@storybook/store@npm:6.5.8": version: 6.5.8 resolution: "@storybook/store@npm:6.5.8" @@ -5628,6 +6853,32 @@ __metadata: languageName: node linkType: hard +"@storybook/store@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/store@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/csf": 0.0.2--canary.4566f4d.1 + core-js: ^3.8.2 + fast-deep-equal: ^3.1.3 + global: ^4.4.0 + lodash: ^4.17.21 + memoizerific: ^1.11.3 + regenerator-runtime: ^0.13.7 + slash: ^3.0.0 + stable: ^0.1.8 + synchronous-promise: ^2.0.15 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: e0d015b760ffd85881d9268df8d19caa1df95cb3c0819f53cd56962f065a8f8c185b5bdc5c96bf6d0cf90632ba02a1585ba9bf4402c6ebd078f644ad8d8cd35b + languageName: node + linkType: hard + "@storybook/telemetry@npm:6.5.8": version: 6.5.8 resolution: "@storybook/telemetry@npm:6.5.8" @@ -5648,6 +6899,26 @@ __metadata: languageName: node linkType: hard +"@storybook/telemetry@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/telemetry@npm:6.5.9" + dependencies: + "@storybook/client-logger": 6.5.9 + "@storybook/core-common": 6.5.9 + chalk: ^4.1.0 + core-js: ^3.8.2 + detect-package-manager: ^2.0.1 + fetch-retry: ^5.0.2 + fs-extra: ^9.0.1 + global: ^4.4.0 + isomorphic-unfetch: ^3.1.0 + nanoid: ^3.3.1 + read-pkg-up: ^7.0.1 + regenerator-runtime: ^0.13.7 + checksum: 0dab27e4d5408af6b8c5a5d6bc2291c6141295277fb7bbd154b6c3d64c1364aa9e37f0d4fc4ebf074e37b43f642baebe33256ce8163407ade01975a56305c343 + languageName: node + linkType: hard + "@storybook/testing-library@npm:0.0.11": version: 0.0.11 resolution: "@storybook/testing-library@npm:0.0.11" @@ -5661,6 +6932,19 @@ __metadata: languageName: node linkType: hard +"@storybook/testing-library@npm:^0.0.13": + version: 0.0.13 + resolution: "@storybook/testing-library@npm:0.0.13" + dependencies: + "@storybook/client-logger": ^6.4.0 + "@storybook/instrumenter": ^6.4.0 + "@testing-library/dom": ^8.3.0 + "@testing-library/user-event": ^13.2.1 + ts-dedent: ^2.2.0 + checksum: 759361ad3fbc89bdfddfa6d5a15eef06ed6fa9110bfa40c08fcf2497e7acd85e8d5c73c26ea4a46934168b21db294256befb55755fee4292d3d277c576284a1c + languageName: node + linkType: hard + "@storybook/theming@npm:6.5.8, @storybook/theming@npm:^6.5.8": version: 6.5.8 resolution: "@storybook/theming@npm:6.5.8" @@ -5675,6 +6959,21 @@ __metadata: languageName: node linkType: hard +"@storybook/theming@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/theming@npm:6.5.9" + dependencies: + "@storybook/client-logger": 6.5.9 + core-js: ^3.8.2 + memoizerific: ^1.11.3 + regenerator-runtime: ^0.13.7 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: 0c0d034864bcf7289778aa549dd9d830c75b90e416cbd2ee8bc9be946f1699141a7b695916aa134c38d156edcfac3a1378e3490ac02b470b89d168625618d073 + languageName: node + linkType: hard + "@storybook/ui@npm:6.5.8": version: 6.5.8 resolution: "@storybook/ui@npm:6.5.8" @@ -5698,6 +6997,31 @@ __metadata: languageName: node linkType: hard +"@storybook/ui@npm:6.5.9": + version: 6.5.9 + resolution: "@storybook/ui@npm:6.5.9" + dependencies: + "@storybook/addons": 6.5.9 + "@storybook/api": 6.5.9 + "@storybook/channels": 6.5.9 + "@storybook/client-logger": 6.5.9 + "@storybook/components": 6.5.9 + "@storybook/core-events": 6.5.9 + "@storybook/router": 6.5.9 + "@storybook/semver": ^7.3.2 + "@storybook/theming": 6.5.9 + core-js: ^3.8.2 + memoizerific: ^1.11.3 + qs: ^6.10.0 + regenerator-runtime: ^0.13.7 + resolve-from: ^5.0.0 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: f0cd17c6e3ff859156bae875722fc877dcd4f6236fc70108b6c0d103ef0e456491b2ea184b68fd29bdbb77466ee1278a52faf6f769745ad31b714e83741e1167 + languageName: node + linkType: hard + "@stylelint/postcss-css-in-js@npm:^0.37.2": version: 0.37.2 resolution: "@stylelint/postcss-css-in-js@npm:0.37.2" @@ -5739,7 +7063,24 @@ __metadata: languageName: node linkType: hard -"@testing-library/react@npm:~12.1.5": +"@testing-library/jest-dom@npm:^5.16.4": + version: 5.16.4 + resolution: "@testing-library/jest-dom@npm:5.16.4" + dependencies: + "@babel/runtime": ^7.9.2 + "@types/testing-library__jest-dom": ^5.9.1 + aria-query: ^5.0.0 + chalk: ^3.0.0 + css: ^3.0.0 + css.escape: ^1.5.1 + dom-accessibility-api: ^0.5.6 + lodash: ^4.17.15 + redent: ^3.0.0 + checksum: 4240501223b72b97a44d4e3c669f39b208c49fb645d11d08d5f178d607265c5dfad07efbe027f41a0e2458178ff1fd5bf437fc05661b9109dcd013b95a37079e + languageName: node + linkType: hard + +"@testing-library/react@npm:~12.1.2, @testing-library/react@npm:~12.1.5": version: 12.1.5 resolution: "@testing-library/react@npm:12.1.5" dependencies: @@ -5839,7 +7180,7 @@ __metadata: languageName: node linkType: hard -"@types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14": +"@types/babel__core@npm:^7, @types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14": version: 7.1.19 resolution: "@types/babel__core@npm:7.1.19" dependencies: @@ -6267,6 +7608,16 @@ __metadata: languageName: node linkType: hard +"@types/jest@npm:*": + version: 28.1.3 + resolution: "@types/jest@npm:28.1.3" + dependencies: + jest-matcher-utils: ^28.0.0 + pretty-format: ^28.0.0 + checksum: 28141f2d5b3bafd063362de9790cb8f219488d9b0ad47524a84bef1142a4f0d9d35be0c56988d9f922205225cc83c986acd4be424bd8653b38dc27ab672455e2 + languageName: node + linkType: hard + "@types/jest@npm:^27.4.1": version: 27.4.1 resolution: "@types/jest@npm:27.4.1" @@ -6334,7 +7685,7 @@ __metadata: languageName: node linkType: hard -"@types/katex@npm:^0.14.0": +"@types/katex@npm:^0.14.0, @types/katex@npm:~0": version: 0.14.0 resolution: "@types/katex@npm:0.14.0" checksum: 330e0d0337ba48c87f5b793965fbad673653789bf6e50dfe8d726a7b0cbefd37195055e31503aae629814aa79447e4f23a4b87ad1ac565c0d9a9d9978836f39b @@ -6723,6 +8074,15 @@ __metadata: languageName: node linkType: hard +"@types/react-dom@npm:^18": + version: 18.0.5 + resolution: "@types/react-dom@npm:18.0.5" + dependencies: + "@types/react": "*" + checksum: cd48b81950f499b52a3f0c08261f00046f9b7c96699fa249c9664e257e820daf6ecac815cd1028cebc9d105094adc39d047d1efd79214394b8b2d515574c0787 + languageName: node + linkType: hard + "@types/react-syntax-highlighter@npm:11.0.5": version: 11.0.5 resolution: "@types/react-syntax-highlighter@npm:11.0.5" @@ -6930,6 +8290,15 @@ __metadata: languageName: node linkType: hard +"@types/testing-library__jest-dom@npm:^5, @types/testing-library__jest-dom@npm:^5.9.1": + version: 5.14.5 + resolution: "@types/testing-library__jest-dom@npm:5.14.5" + dependencies: + "@types/jest": "*" + checksum: dcb05416758fe88c1f4f3aa97b4699fcb46a5ed8f53c6b81721e66155452a48caf12ecb97dfdfd4130678e65efd66b9fca0ac434b3d63affec84842a84a6bf38 + languageName: node + linkType: hard + "@types/tmp@npm:^0.2.2": version: 0.2.3 resolution: "@types/tmp@npm:0.2.3" @@ -7141,6 +8510,29 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/eslint-plugin@npm:^5.29.0": + version: 5.29.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.29.0" + dependencies: + "@typescript-eslint/scope-manager": 5.29.0 + "@typescript-eslint/type-utils": 5.29.0 + "@typescript-eslint/utils": 5.29.0 + debug: ^4.3.4 + functional-red-black-tree: ^1.0.1 + ignore: ^5.2.0 + regexpp: ^3.2.0 + semver: ^7.3.7 + tsutils: ^3.21.0 + peerDependencies: + "@typescript-eslint/parser": ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: b1022a640f80c314ac8b247a2ccdd21f4b523b3cb8906956f5d276008ac964c8a1e951b2b2b16ca9621eb795dc9bbf6447b5b767acfe4866a1bc3e3527d966fc + languageName: node + linkType: hard + "@typescript-eslint/experimental-utils@npm:2.34.0": version: 2.34.0 resolution: "@typescript-eslint/experimental-utils@npm:2.34.0" @@ -7188,6 +8580,23 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/parser@npm:^5.29.0": + version: 5.29.0 + resolution: "@typescript-eslint/parser@npm:5.29.0" + dependencies: + "@typescript-eslint/scope-manager": 5.29.0 + "@typescript-eslint/types": 5.29.0 + "@typescript-eslint/typescript-estree": 5.29.0 + debug: ^4.3.4 + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 7805796638d1ddbe21f2627e9f03493ec17710e22ae81d2345f3e0f5ff9cbf6f0cd1b0e05d8d0b9aa08435bafdb6b5c86f27d7115f0959de43e3322b86c00709 + languageName: node + linkType: hard + "@typescript-eslint/scope-manager@npm:5.21.0": version: 5.21.0 resolution: "@typescript-eslint/scope-manager@npm:5.21.0" @@ -7198,6 +8607,32 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/scope-manager@npm:5.29.0": + version: 5.29.0 + resolution: "@typescript-eslint/scope-manager@npm:5.29.0" + dependencies: + "@typescript-eslint/types": 5.29.0 + "@typescript-eslint/visitor-keys": 5.29.0 + checksum: 540642bef9c55fd7692af98dfb42ab99eeb82553f42ab2a3c4e132e02b5ba492da1c6bf1ca6b02b900a678fc74399ad6c564c0ca20d91032090b6cbcb01a5bde + languageName: node + linkType: hard + +"@typescript-eslint/type-utils@npm:5.29.0": + version: 5.29.0 + resolution: "@typescript-eslint/type-utils@npm:5.29.0" + dependencies: + "@typescript-eslint/utils": 5.29.0 + debug: ^4.3.4 + tsutils: ^3.21.0 + peerDependencies: + eslint: "*" + peerDependenciesMeta: + typescript: + optional: true + checksum: 686b8ff05a7591f76a2a1d3746b988168dcbd59c2f52de095b19e4f8e17063e03dc3d0f7b3d84f7be6880f2df97c3e184877664d0b4275ea9871c31d1e58c7d2 + languageName: node + linkType: hard + "@typescript-eslint/types@npm:3.10.1": version: 3.10.1 resolution: "@typescript-eslint/types@npm:3.10.1" @@ -7212,6 +8647,13 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/types@npm:5.29.0": + version: 5.29.0 + resolution: "@typescript-eslint/types@npm:5.29.0" + checksum: 982ecdd69103105cabff8deac7f82f6002cf909238702ce902133e9af655cd962f977d5adf650c5ddae80d8c0e46abe1612a9141b25c7ed20ba8d662eb7ab871 + languageName: node + linkType: hard + "@typescript-eslint/typescript-estree@npm:2.34.0": version: 2.34.0 resolution: "@typescript-eslint/typescript-estree@npm:2.34.0" @@ -7267,6 +8709,40 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/typescript-estree@npm:5.29.0": + version: 5.29.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.29.0" + dependencies: + "@typescript-eslint/types": 5.29.0 + "@typescript-eslint/visitor-keys": 5.29.0 + debug: ^4.3.4 + globby: ^11.1.0 + is-glob: ^4.0.3 + semver: ^7.3.7 + tsutils: ^3.21.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: b91107a9fc31bf511aaa70f1e6d1d832d3acf08cfe999c870169447a7c223abff54c1d604bbb08d7c069dd98b43fb279bc314d1726097704fe8ad4c6e0969b12 + languageName: node + linkType: hard + +"@typescript-eslint/utils@npm:5.29.0": + version: 5.29.0 + resolution: "@typescript-eslint/utils@npm:5.29.0" + dependencies: + "@types/json-schema": ^7.0.9 + "@typescript-eslint/scope-manager": 5.29.0 + "@typescript-eslint/types": 5.29.0 + "@typescript-eslint/typescript-estree": 5.29.0 + eslint-scope: ^5.1.1 + eslint-utils: ^3.0.0 + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + checksum: 216f51fb9c176437919af55db9ed14db8af7b020611e954c06e69956b9e3248cbfe6a218013d6c17b716116dca6566a4c03710f9b48ce4e94f89312d61c16d07 + languageName: node + linkType: hard + "@typescript-eslint/utils@npm:^5.10.0, @typescript-eslint/utils@npm:^5.13.0": version: 5.21.0 resolution: "@typescript-eslint/utils@npm:5.21.0" @@ -7302,6 +8778,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/visitor-keys@npm:5.29.0": + version: 5.29.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.29.0" + dependencies: + "@typescript-eslint/types": 5.29.0 + eslint-visitor-keys: ^3.3.0 + checksum: 15f228ad9ffaf0e42cc6b2ee4e5095c1e89c4c2dc46a65d19ca0e2296d88c08a1192039d942bd9600b1496176749f6322d636dd307602dbab90404a9501b4d6e + languageName: node + linkType: hard + "@ungap/promise-all-settled@npm:1.1.2": version: 1.1.2 resolution: "@ungap/promise-all-settled@npm:1.1.2" @@ -10375,7 +11861,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:3.0.0, chalk@npm:~3.0.0": +"chalk@npm:3.0.0, chalk@npm:^3.0.0, chalk@npm:~3.0.0": version: 3.0.0 resolution: "chalk@npm:3.0.0" dependencies: @@ -11064,6 +12550,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^8.0.0": + version: 8.3.0 + resolution: "commander@npm:8.3.0" + checksum: 0f82321821fc27b83bd409510bb9deeebcfa799ff0bf5d102128b500b7af22872c0c92cb6a0ebc5a4cf19c6b550fba9cedfa7329d18c6442a625f851377bacf0 + languageName: node + linkType: hard + "common-path-prefix@npm:^3.0.0": version: 3.0.0 resolution: "common-path-prefix@npm:3.0.0" @@ -11861,6 +13354,24 @@ __metadata: languageName: node linkType: hard +"css.escape@npm:^1.5.1": + version: 1.5.1 + resolution: "css.escape@npm:1.5.1" + checksum: f6d38088d870a961794a2580b2b2af1027731bb43261cfdce14f19238a88664b351cc8978abc20f06cc6bbde725699dec8deb6fe9816b139fc3f2af28719e774 + languageName: node + linkType: hard + +"css@npm:^3.0.0": + version: 3.0.0 + resolution: "css@npm:3.0.0" + dependencies: + inherits: ^2.0.4 + source-map: ^0.6.1 + source-map-resolve: ^0.6.0 + checksum: 4273ac816ddf99b99acb9c1d1a27d86d266a533cc01118369d941d8e8a78277a83cad3315e267a398c509d930fbb86504e193ea1ebc620a4a4212e06fe76e8be + languageName: node + linkType: hard + "cssesc@npm:^2.0.0": version: 2.0.0 resolution: "cssesc@npm:2.0.0" @@ -12758,6 +14269,13 @@ __metadata: languageName: node linkType: hard +"diff-sequences@npm:^28.1.1": + version: 28.1.1 + resolution: "diff-sequences@npm:28.1.1" + checksum: e2529036505567c7ca5a2dea86b6bcd1ca0e3ae63bf8ebf529b8a99cfa915bbf194b7021dc1c57361a4017a6d95578d4ceb29fabc3232a4f4cb866a2726c7690 + languageName: node + linkType: hard + "diff@npm:5.0.0": version: 5.0.0 resolution: "diff@npm:5.0.0" @@ -12849,6 +14367,13 @@ __metadata: languageName: node linkType: hard +"dom-accessibility-api@npm:^0.5.6": + version: 0.5.14 + resolution: "dom-accessibility-api@npm:0.5.14" + checksum: 782c813f75a09ba6735ef03b5e1624406a3829444ae49d5bdedd272a49d437ae3354f53e02ffc8c9fd9165880250f41546538f27461f839dd4ea1234e77e8d5e + languageName: node + linkType: hard + "dom-accessibility-api@npm:^0.5.9": version: 0.5.13 resolution: "dom-accessibility-api@npm:0.5.13" @@ -13804,7 +15329,16 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-react@npm:^7.20.5, eslint-plugin-react@npm:^7.29.4": +"eslint-plugin-react-hooks@npm:^4.6.0": + version: 4.6.0 + resolution: "eslint-plugin-react-hooks@npm:4.6.0" + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + checksum: 23001801f14c1d16bf0a837ca7970d9dd94e7b560384b41db378b49b6e32dc43d6e2790de1bd737a652a86f81a08d6a91f402525061b47719328f586a57e86c3 + languageName: node + linkType: hard + +"eslint-plugin-react@npm:^7.20.5, eslint-plugin-react@npm:^7.29.4, eslint-plugin-react@npm:^7.30.0": version: 7.30.0 resolution: "eslint-plugin-react@npm:7.30.0" dependencies: @@ -16179,7 +17713,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:^11.0.2, globby@npm:^11.0.3, globby@npm:^11.0.4": +"globby@npm:^11.0.2, globby@npm:^11.0.3, globby@npm:^11.0.4, globby@npm:^11.1.0": version: 11.1.0 resolution: "globby@npm:11.1.0" dependencies: @@ -16516,6 +18050,13 @@ __metadata: languageName: node linkType: hard +"harmony-reflect@npm:^1.4.6": + version: 1.6.2 + resolution: "harmony-reflect@npm:1.6.2" + checksum: 2e5bae414cd2bfae5476147f9935dc69ee9b9a413206994dcb94c5b3208d4555da3d4313aff6fd14bd9991c1e3ef69cdda5c8fac1eb1d7afc064925839339b8c + languageName: node + linkType: hard + "has-ansi@npm:^2.0.0": version: 2.0.0 resolution: "has-ansi@npm:2.0.0" @@ -16822,7 +18363,14 @@ __metadata: languageName: node linkType: hard -"highlight.js@npm:^9.18.5": +"highlight.js@npm:^11.5.1": + version: 11.5.1 + resolution: "highlight.js@npm:11.5.1" + checksum: bff556101d7691c6275ad19318e368fc971cd0621ef3d86222f5373df7d8191a2fc1ffd47f118138cbcf85e5fe91cfeefaecd6184f49a3ec18090955efc9edef + languageName: node + linkType: hard + +"hljs9@npm:highlight.js@^9.18.5": version: 9.18.5 resolution: "highlight.js@npm:9.18.5" checksum: a8afdb395869bba8a892dd8891b738d3bd48fe2e5b6843ec3181c93d73f52abf2cab863424caa631442a7bbafac222bafdab3f5a536a69aab9c60d4c1b7f8b77 @@ -17381,6 +18929,15 @@ __metadata: languageName: node linkType: hard +"identity-obj-proxy@npm:^3.0.0": + version: 3.0.0 + resolution: "identity-obj-proxy@npm:3.0.0" + dependencies: + harmony-reflect: ^1.4.6 + checksum: 97559f8ea2aeaa1a880d279d8c49550dce01148321e00a2102cda5ddf9ce622fa1d7f3efc7bed63458af78889de888fdaebaf31c816312298bb3fdd0ef8aaf2c + languageName: node + linkType: hard + "ieee754@npm:1.1.13": version: 1.1.13 resolution: "ieee754@npm:1.1.13" @@ -18987,6 +20544,18 @@ __metadata: languageName: node linkType: hard +"jest-diff@npm:^28.1.1": + version: 28.1.1 + resolution: "jest-diff@npm:28.1.1" + dependencies: + chalk: ^4.0.0 + diff-sequences: ^28.1.1 + jest-get-type: ^28.0.2 + pretty-format: ^28.1.1 + checksum: d9e0355880bee8728f7615ac0f03c66dcd4e93113935cca056a5f5a2f20ac2c7812aca6ad68e79bd1b11f2428748bd9123e6b1c7e51c93b4da3dfa5a875339f7 + languageName: node + linkType: hard + "jest-docblock@npm:^27.5.1": version: 27.5.1 resolution: "jest-docblock@npm:27.5.1" @@ -19045,6 +20614,13 @@ __metadata: languageName: node linkType: hard +"jest-get-type@npm:^28.0.2": + version: 28.0.2 + resolution: "jest-get-type@npm:28.0.2" + checksum: 5281d7c89bc8156605f6d15784f45074f4548501195c26e9b188742768f72d40948252d13230ea905b5349038865a1a8eeff0e614cc530ff289dfc41fe843abd + languageName: node + linkType: hard + "jest-haste-map@npm:^26.6.2": version: 26.6.2 resolution: "jest-haste-map@npm:26.6.2" @@ -19141,6 +20717,18 @@ __metadata: languageName: node linkType: hard +"jest-matcher-utils@npm:^28.0.0": + version: 28.1.1 + resolution: "jest-matcher-utils@npm:28.1.1" + dependencies: + chalk: ^4.0.0 + jest-diff: ^28.1.1 + jest-get-type: ^28.0.2 + pretty-format: ^28.1.1 + checksum: cb73ccd347638cd761ef7e0b606fbd71c115bd8febe29413f7b105fff6855d4356b8094c6b72393c5457db253b9c163498f188f25f9b6308c39c510e4c2886ee + languageName: node + linkType: hard + "jest-message-util@npm:^27.5.1": version: 27.5.1 resolution: "jest-message-util@npm:27.5.1" @@ -19868,6 +21456,17 @@ __metadata: languageName: node linkType: hard +"katex@npm:~0.16.0": + version: 0.16.0 + resolution: "katex@npm:0.16.0" + dependencies: + commander: ^8.0.0 + bin: + katex: cli.js + checksum: 0e094523544b3c921e55da8cf1a9ea2718213c621af508af9fc03859b97dc73280f478fbfede5a8b32948210c3596c5a637dd64e0e28e31d6c617b5d50c29762 + languageName: node + linkType: hard + "keyv@npm:3.0.0": version: 3.0.0 resolution: "keyv@npm:3.0.0" @@ -23276,7 +24875,7 @@ __metadata: languageName: node linkType: hard -"outdent@npm:~0.8.0": +"outdent@npm:^0.8.0, outdent@npm:~0.8.0": version: 0.8.0 resolution: "outdent@npm:0.8.0" checksum: 72b7c1a287674317ea477999ec24e73a9eda21de35eb9429218f4a5bab899e964afaee7508265898118fee5cbee1d79397916b66dd8aeee285cd948ea5b1f562 @@ -25261,6 +26860,18 @@ __metadata: languageName: node linkType: hard +"pretty-format@npm:^28.0.0, pretty-format@npm:^28.1.1": + version: 28.1.1 + resolution: "pretty-format@npm:28.1.1" + dependencies: + "@jest/schemas": ^28.0.2 + ansi-regex: ^5.0.1 + ansi-styles: ^5.0.0 + react-is: ^18.0.0 + checksum: 7fde4e2d6fd57cef8cf2fa9d5560cc62126de481f09c65dccfe89a3e6158a04355cff278853ace07fdf7f2f48c3d77877c00c47d7d3c1c028dcff5c322300d79 + languageName: node + linkType: hard + "pretty-hrtime@npm:^1.0.3": version: 1.0.3 resolution: "pretty-hrtime@npm:1.0.3" @@ -26132,6 +27743,13 @@ __metadata: languageName: node linkType: hard +"react-is@npm:^18.0.0": + version: 18.2.0 + resolution: "react-is@npm:18.2.0" + checksum: e72d0ba81b5922759e4aff17e0252bd29988f9642ed817f56b25a3e217e13eea8a7f2322af99a06edb779da12d5d636e9fda473d620df9a3da0df2a74141d53e + languageName: node + linkType: hard + "react-keyed-flatten-children@npm:^1.3.0": version: 1.3.0 resolution: "react-keyed-flatten-children@npm:1.3.0" @@ -27291,7 +28909,7 @@ __metadata: "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/emitter": ~0.31.9 "@rocket.chat/icons": ^0.31.0 - "@rocket.chat/message-parser": next + "@rocket.chat/message-parser": ~0.32.0-dev.5 "@rocket.chat/model-typings": "workspace:^" "@rocket.chat/models": "workspace:^" "@rocket.chat/rest-typings": "workspace:^" @@ -28342,6 +29960,16 @@ __metadata: languageName: node linkType: hard +"source-map-resolve@npm:^0.6.0": + version: 0.6.0 + resolution: "source-map-resolve@npm:0.6.0" + dependencies: + atob: ^2.1.2 + decode-uri-component: ^0.2.0 + checksum: fe503b9e5dac1c54be835282fcfec10879434e7b3ee08a9774f230299c724a8d403484d9531276d1670c87390e0e4d1d3f92b14cca6e4a2445ea3016b786ecd4 + languageName: node + linkType: hard + "source-map-support@npm:0.5.19": version: 0.5.19 resolution: "source-map-support@npm:0.5.19"