From 74b2c6c4a4ec058236646b25569bb863a1e9ae59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Wed, 14 Nov 2018 12:09:10 +0100 Subject: [PATCH 1/8] Fix duplicate key warnings --- src/components/tabs/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/tabs/README.md b/src/components/tabs/README.md index 96183ebf2b4..35b9282f005 100755 --- a/src/components/tabs/README.md +++ b/src/components/tabs/README.md @@ -10,7 +10,7 @@
I'm the first fading tab
- +
I'm the second tab content
@@ -66,7 +66,7 @@ To disable the `card-body` class, set the `no-body` prop on `` sub compon Picture 3 footer - +
This tab does not have the no-body prop set
Quis magna Lorem anim amet ipsum do mollit sit cillum voluptate ex nulla tempor. Laborum consequat non elit enim exercitation cillum aliqua consequat @@ -114,7 +114,7 @@ Visually move the tab controls to the bottom by setting the prop `end` Tab Contents 1 - + Tab Contents 2 @@ -124,7 +124,7 @@ Visually move the tab controls to the bottom by setting the prop `end` ``` **Caveats:** -- Bottom placement visually works best with the `pills` variant. When using the default +- Bottom placement visually works best with the `pills` variant. When using the default `tabs` vairiant, you may want to provided your own custom styling classes, as Bootstrap V4 CSS assumes the tabs will always be placed on the top of the tabs content. - To provide a better user experience with bottom palced controls, ensure that the @@ -200,7 +200,7 @@ or column classes such as `col-2`, `col-3`, etc. ``` -Vertical placement visually works best with the `pills` variant. When using the default +Vertical placement visually works best with the `pills` variant. When using the default `tabs` vairiant, you may want to provided your own custom styling classes, as Bootstrap V4 CSS assumes the tab controls will always be placed on the top of the tabs content. @@ -232,7 +232,7 @@ If you want to add extra tabs that do not have any content, you can put them in ## Add custom content to tab title -If you want to add custom content to tab title, like HTML code, icons, or another Vue component, this possible by using +If you want to add custom content to tab title, like HTML code, icons, or another Vue component, this possible by using `title` slot ```html @@ -247,7 +247,7 @@ If you want to add custom content to tab title, like HTML code, icons, or anothe -``` +``` ## Apply custom classes to the generated nav-tabs or pills @@ -311,7 +311,7 @@ Keyboard navigation is enabled by default. | TAB | Move to the next control on the page | SHIFT+TAB | Move to the previous control on the page -Disable it by setting the prop `no-key-nav`. Behavior will now default to standard browser navigation with TAB key. +Disable it by setting the prop `no-key-nav`. Behavior will now default to standard browser navigation with TAB key. | Keypress | Action | -------- | ------ From 14c1fa8511a96142f7e286f1679d04a93f160afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Wed, 14 Nov 2018 12:09:27 +0100 Subject: [PATCH 2/8] Fix closing `

` tag --- src/components/form-file/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/form-file/README.md b/src/components/form-file/README.md index ae908660fc3..ab73e00c1b9 100755 --- a/src/components/form-file/README.md +++ b/src/components/form-file/README.md @@ -146,7 +146,7 @@ assitive technologies. ## Clearing the file selection With inputs of type file, normally the `v-model` is uni-directional (meaning -you cannot pre-set the selected files). However, you can clear the file input's +you cannot pre-set the selected files). However, you can clear the file input's selected files by setting the `v-model` to either `null`, an empty string, or an empty array). @@ -160,7 +160,7 @@ to obtain a reference to the `` component. Reset via method Reset via v-model -

Selected file: {{ file ? file.name : ''}}

+

Selected file: {{ file ? file.name : ''}}

From acfce0a50b65717cd8e22729753f56cb6d3f81fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Wed, 14 Nov 2018 12:10:10 +0100 Subject: [PATCH 3/8] Imrove `play` directive --- docs/plugins/play.js | 204 +++++++++++++++++++++++-------------------- 1 file changed, 110 insertions(+), 94 deletions(-) diff --git a/docs/plugins/play.js b/docs/plugins/play.js index f543aba670f..0cc09095277 100644 --- a/docs/plugins/play.js +++ b/docs/plugins/play.js @@ -1,108 +1,124 @@ import Vue from 'vue' +import hljs from 'highlightjs' import debounce from 'lodash/debounce' -const VUE_REGEX = // +const NAME_REGEX = // +const NAME_DEFINITION_REGEX = // const TEMPLATE_REGEX = / - - ``` From bae856240178e55e93f961990da08ae6068a1750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Wed, 14 Nov 2018 14:11:06 +0100 Subject: [PATCH 5/8] Improve `highlightjs` usage --- docs/nuxt.config.js | 12 ++++- docs/plugins/play.js | 2 +- package.json | 1 - yarn.lock | 107 +++++-------------------------------------- 4 files changed, 23 insertions(+), 99 deletions(-) diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js index 98c6f2e9ebd..71b5f7fc9dc 100644 --- a/docs/nuxt.config.js +++ b/docs/nuxt.config.js @@ -1,8 +1,17 @@ const fs = require('fs') +const hljs = require('highlightjs') const marked = require('marked') -// Markdown renderer with BS4 tables support const renderer = new marked.Renderer() + +// Custom "highlightjs" implementation for markdown renderer +renderer.code = (code, language) => { + const validLang = !!(language && hljs.getLanguage(language)) + const highlighted = validLang ? hljs.highlight(language, code).value : code + return `
${highlighted}
` +} + +// BS4 table support for markdown renderer const originalTable = renderer.table renderer.table = function renderTable (header, body) { let r = originalTable.apply(this, arguments) @@ -25,7 +34,6 @@ module.exports = { test: /\.md$/, use: [ { loader: 'html-loader' }, - { loader: 'highlight-loader' }, { loader: 'markdown-loader', options: { renderer } } ] }) diff --git a/docs/plugins/play.js b/docs/plugins/play.js index 0cc09095277..b8a2dba19ff 100644 --- a/docs/plugins/play.js +++ b/docs/plugins/play.js @@ -1,6 +1,6 @@ import Vue from 'vue' -import hljs from 'highlightjs' import debounce from 'lodash/debounce' +import hljs from 'highlightjs' const NAME_REGEX = // const NAME_DEFINITION_REGEX = // diff --git a/package.json b/package.json index 71a0b1fc805..2eeddb4c927 100755 --- a/package.json +++ b/package.json @@ -92,7 +92,6 @@ "eslint-plugin-standard": "^3.1.0", "eslint-plugin-vue": "^4.5.0", "gh-pages": "^1.1.0", - "highlight-loader": "^0.7.2", "highlightjs": "^9.8.0", "html-loader": "^0.5.4", "jest": "^22.0.6", diff --git a/yarn.lock b/yarn.lock index 291cce7caa6..ad527a2e53e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -122,9 +122,10 @@ hash-sum "^1.0.2" postcss-modules-sync "^1.0.0" -"@vue/test-utils@^1.0.0-beta.16": - version "1.0.0-beta.16" - resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.0.0-beta.16.tgz#dcf7a30304391422e382b5f97db6eb9508112906" +"@vue/test-utils@^1.0.0-beta.24": + version "1.0.0-beta.25" + resolved "https://registry.yarnpkg.com/@vue/test-utils/-/test-utils-1.0.0-beta.25.tgz#4703076de3076bac42cdd242cd53e6fb8752ed8c" + integrity sha512-mfvguEmEpAn0BuT4u+qm+0J1NTKgQS+ffUyWHY1QeSovIkJcy98fj1rO+PJgiZSEvGjjnDNX+qmofYFPLrofbA== dependencies: lodash "^4.17.4" @@ -1316,9 +1317,10 @@ boolbase@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" -bootstrap@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.1.tgz#3aec85000fa619085da8d2e4983dfd67cf2114cb" +bootstrap@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.3.tgz#0eb371af2c8448e8c210411d0cb824a6409a12be" + integrity sha512-rDFIzgXcof0jDyjNosjv4Sno77X4KuPeFxG2XZZv1/Kc8DRVGVADdoQyyOVDwPqL36DDmtCQbrpMCqvpPLJQ0w== brace-expansion@^1.1.7: version "1.1.11" @@ -1621,16 +1623,6 @@ check-types@^7.3.0: version "7.3.0" resolved "https://registry.yarnpkg.com/check-types/-/check-types-7.3.0.tgz#468f571a4435c24248f5fd0cb0e8d87c3c341e7d" -cheerio@^0.19.0: - version "0.19.0" - resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.19.0.tgz#772e7015f2ee29965096d71ea4175b75ab354925" - dependencies: - css-select "~1.0.0" - dom-serializer "~0.1.0" - entities "~1.1.1" - htmlparser2 "~3.8.1" - lodash "^3.2.0" - chokidar@^1.6.1, chokidar@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" @@ -2245,15 +2237,6 @@ css-select@^1.1.0: domutils "1.5.1" nth-check "~1.0.1" -css-select@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.0.0.tgz#b1121ca51848dd264e2244d058cee254deeb44b0" - dependencies: - boolbase "~1.0.0" - css-what "1.0" - domutils "1.4" - nth-check "~1.0.0" - css-selector-tokenizer@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/css-selector-tokenizer/-/css-selector-tokenizer-0.7.0.tgz#e6988474ae8c953477bf5e7efecfceccd9cf4c86" @@ -2262,10 +2245,6 @@ css-selector-tokenizer@^0.7.0: fastparse "^1.1.1" regexpu-core "^1.0.0" -css-what@1.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-1.0.0.tgz#d7cc2df45180666f99d2b14462639469e00f736c" - css-what@2.1: version "2.1.0" resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.0.tgz#9467d032c38cfaefb9f2d79501253062f87fa1bd" @@ -2556,7 +2535,7 @@ dom-converter@~0.1: dependencies: utila "~0.3" -dom-serializer@0, dom-serializer@~0.1.0: +dom-serializer@0: version "0.1.0" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" dependencies: @@ -2591,25 +2570,13 @@ domhandler@2.1: dependencies: domelementtype "1" -domhandler@2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738" - dependencies: - domelementtype "1" - domutils@1.1: version "1.1.6" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.1.6.tgz#bddc3de099b9a2efacc51c623f28f416ecc57485" dependencies: domelementtype "1" -domutils@1.4: - version "1.4.3" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.4.3.tgz#0865513796c6b306031850e175516baf80b72a6f" - dependencies: - domelementtype "1" - -domutils@1.5, domutils@1.5.1: +domutils@1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" dependencies: @@ -2725,10 +2692,6 @@ enhanced-resolve@^4.0.0: memory-fs "^0.4.0" tapable "^1.0.0" -entities@1.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-1.0.0.tgz#b2987aa3821347fcde642b24fdfc9e4fb712bf26" - entities@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" @@ -3757,23 +3720,6 @@ he@1.1.x, he@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" -he@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/he/-/he-0.5.0.tgz#2c05ffaef90b68e860f3fd2b54ef580989277ee2" - -highlight-loader@^0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/highlight-loader/-/highlight-loader-0.7.2.tgz#6271a5617cf0dc3e1d01774167ea975d7ace5a9d" - dependencies: - cheerio "^0.19.0" - he "^0.5.0" - highlight.js "^9.1.0" - loader-utils "^0.2.12" - -highlight.js@^9.1.0: - version "9.12.0" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.12.0.tgz#e6d9dbe57cbefe60751f02af336195870c90c01e" - highlightjs@^9.8.0: version "9.10.0" resolved "https://registry.yarnpkg.com/highlightjs/-/highlightjs-9.10.0.tgz#fca9b78ddaa3b1abca89d6c3ee105ad270a80190" @@ -3858,16 +3804,6 @@ htmlparser2@~3.3.0: domutils "1.1" readable-stream "1.0" -htmlparser2@~3.8.1: - version "3.8.3" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.8.3.tgz#996c28b191516a8be86501a7d79757e5c70c1068" - dependencies: - domelementtype "1" - domhandler "2.3" - domutils "1.5" - entities "1.0" - readable-stream "1.1" - http-errors@1.6.2: version "1.6.2" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" @@ -4961,7 +4897,7 @@ loader-runner@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2" -loader-utils@^0.2.12, loader-utils@^0.2.16: +loader-utils@^0.2.16: version "0.2.17" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" dependencies: @@ -5034,10 +4970,6 @@ lodash@4.x, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.3, lodash@^4.17.4, lod version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" -lodash@^3.2.0: - version "3.10.1" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" - log-symbols@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" @@ -5620,7 +5552,7 @@ npmlog@^4.0.2: gauge "~2.7.3" set-blocking "~2.0.0" -nth-check@~1.0.0, nth-check@~1.0.1: +nth-check@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4" dependencies: @@ -6945,15 +6877,6 @@ readable-stream@1.0: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@1.1: - version "1.1.13" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.13.tgz#f6eef764f514c89e2b9e23146a75ba106756d23e" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - readdirp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" @@ -8449,12 +8372,6 @@ vue-template-es2015-compiler@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.6.0.tgz#dc42697133302ce3017524356a6c61b7b69b4a18" -vue-test-utils@1.0.0-beta.11: - version "1.0.0-beta.11" - resolved "https://registry.yarnpkg.com/vue-test-utils/-/vue-test-utils-1.0.0-beta.11.tgz#41b7fa53e0061d16ecbe18cfeea197c909d4ab8a" - dependencies: - lodash "^4.17.4" - vuex@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.0.1.tgz#e761352ebe0af537d4bb755a9b9dc4be3df7efd2" From 3c17236b74f65a5e236c9a0b0676af29ae9d5105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Thu, 15 Nov 2018 11:09:18 +0100 Subject: [PATCH 6/8] Add "JavaScript compile error!" indication --- docs/assets/css/styles.css | 10 ++++++++++ docs/plugins/play.js | 2 ++ 2 files changed, 12 insertions(+) diff --git a/docs/assets/css/styles.css b/docs/assets/css/styles.css index d9011478f53..0ee72c5929c 100644 --- a/docs/assets/css/styles.css +++ b/docs/assets/css/styles.css @@ -77,6 +77,16 @@ pre.editable.live:after { content: 'Live'; } +pre.editable.error { + border: 1px solid #dc3545; + box-shadow: 0 1px 1px rgba(220, 53, 69, 0.5); +} + +pre.editable.error:after { + content: 'JavaScript compile error!'; + color: #dc3545; +} + .bd-footer { padding: 4rem 0; margin-top: 4rem; diff --git a/docs/plugins/play.js b/docs/plugins/play.js index b8a2dba19ff..aebebb5c251 100644 --- a/docs/plugins/play.js +++ b/docs/plugins/play.js @@ -118,6 +118,8 @@ Vue.directive('play', (el, binding, vnode, oldVnode) => { // Recreate VM destroyVM(name, vm) vm = createVM(name, pre, vnode) + + pre.classList.toggle('error', vm === null) }, 250) } }) From 718996d4ef90f4784f8d5d7b2f25e55da0034130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Thu, 15 Nov 2018 11:10:02 +0100 Subject: [PATCH 7/8] Fix comment --- docs/plugins/play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins/play.js b/docs/plugins/play.js index aebebb5c251..a679632b9d7 100644 --- a/docs/plugins/play.js +++ b/docs/plugins/play.js @@ -78,7 +78,7 @@ Vue.directive('play', (el, binding, vnode, oldVnode) => { // Store example name globally const name = match(NAME_REGEX, pre.textContent) - // Exit early when name is given + // Exit early when no name is given if (!name) { return } From f5f3f7e80d592c95647989607ca9021ed1db2377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Thu, 15 Nov 2018 14:46:22 +0100 Subject: [PATCH 8/8] Make IE11 happy --- docs/plugins/play.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/plugins/play.js b/docs/plugins/play.js index a679632b9d7..e2cde58c825 100644 --- a/docs/plugins/play.js +++ b/docs/plugins/play.js @@ -7,6 +7,12 @@ const NAME_DEFINITION_REGEX = // const TEMPLATE_REGEX = /