diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 000000000000..6b58375a7e2b --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,40 @@ +name-template: 'v$NEXT_PATCH_VERSION' +tag-template: 'v$NEXT_PATCH_VERSION' +prerelease: true +exclude-labels: + - 'skip-changelog' +categories: + - title: '🚀 Features' + labels: + - 'new-feature' + - 'feature' + - 'enhancement' + - title: '🐛 Bug fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🎨 CSS' + labels: + - 'css' + - title: '☕️ JavaScript' + labels: + - 'js' + - title: '📖 Docs' + labels: + - 'docs' + - title: '🌎 Accessibility' + labels: + - 'accessibility' + - title: '🧰 Misc' + labels: + - 'build' + - 'meta' + - 'chore' + - title: '📦 Dependencies' + labels: + - 'dependencies' +change-template: '- #$NUMBER: $TITLE' +template: | + ## Changes + $CHANGES diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000000..8cc48e587d63 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,28 @@ +name: "Code Scanning - Action" + +on: + push: + pull_request: + schedule: + - cron: "0 0 * * 0" + +jobs: + CodeQL-Build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: javascript + + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml new file mode 100644 index 000000000000..9f0f4f8c1227 --- /dev/null +++ b/.github/workflows/release-notes.yml @@ -0,0 +1,14 @@ +name: Release notes + +on: + push: + branches: + - v4-dev + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/_config.yml b/_config.yml index fb914011143b..c0fdfab4731e 100644 --- a/_config.yml +++ b/_config.yml @@ -51,6 +51,7 @@ icons: "https://icons.getbootstrap.com" download: source: "https://github.com/twbs/bootstrap/archive/v4.4.1.zip" dist: "https://github.com/twbs/bootstrap/releases/download/v4.4.1/bootstrap-4.4.1-dist.zip" + dist_examples: "https://github.com/twbs/bootstrap/releases/download/v4.4.1/bootstrap-4.4.1-examples.zip" cdn: # See https://www.srihash.org for info on how to generate the hashes diff --git a/build/zip-examples.js b/build/zip-examples.js new file mode 100644 index 000000000000..884044fd8862 --- /dev/null +++ b/build/zip-examples.js @@ -0,0 +1,55 @@ +#!/usr/bin/env node + +/*! + * Script to create the built examples zip archive; + * requires the `zip` command to be present! + * Copyright 2020 The Bootstrap Authors + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +'use strict' + +const path = require('path') +const sh = require('shelljs') + +const { + version, version_short: versionShort +} = require('../package.json') + +const folderName = `bootstrap-${version}-examples` + +sh.config.fatal = true + +if (!sh.test('-d', '_gh_pages')) { + throw new Error('The _gh_pages folder does not exist, did you forget building the docs?') +} + +// switch to the root dir +sh.cd(path.join(__dirname, '..')) + +// remove any previously created folder with the same name +sh.rm('-rf', folderName) +sh.mkdir('-p', folderName) + +// copy the examples and dist folders; for the examples we use `*` +// so that its content are copied to the root dist dir +sh.cp('-Rf', [ + `_gh_pages/docs/${versionShort}/examples/*`, + `_gh_pages/docs/${versionShort}/dist/` +], folderName) +sh.rm(`${folderName}/index.html`) + +// sed-fu +sh.find(`${folderName}/**/*.html`).forEach((file) => { + sh.sed('-i', new RegExp(`"/docs/${versionShort}/`, 'g'), '"../', file) + sh.sed('-i', /(/g, '$1>', file) + sh.sed('-i', /(', file) +}) + +// create the zip file +sh.exec(`zip -r9 "${folderName}.zip" "${folderName}"`, { + fatal: true +}) + +// remove the folder we created +sh.rm('-rf', folderName) diff --git a/js/src/modal.js b/js/src/modal.js index 6b80bb2f0dfd..8e505eda9674 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -455,8 +455,11 @@ class Modal { } _checkScrollbar() { - const rect = document.body.getBoundingClientRect() - this._isBodyOverflowing = rect.left + rect.right < window.innerWidth + const { + left, right + } = document.body.getBoundingClientRect() + + this._isBodyOverflowing = Math.floor(left + right) < window.innerWidth this._scrollbarWidth = this._getScrollbarWidth() } diff --git a/package.json b/package.json index 1d851d453fe9..8e58ee375450 100644 --- a/package.json +++ b/package.json @@ -73,10 +73,11 @@ "docs-serve-only": "npm run docs-serve -- --skip-initial-build --no-watch", "lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json", "update-deps": "ncu -u -x \"jquery,karma-browserstack-launcher,popper.js,qunit,sinon\" && npm update && bundle update && cross-env-shell echo Manually update \\\"site/docs/$npm_package_version_short/assets/js/vendor/\\\"", - "release": "npm-run-all dist release-sri release-zip docs-production", + "release": "npm-run-all dist release-sri docs-build release-zip*", "release-sri": "node build/generate-sri.js", "release-version": "node build/change-version.js", "release-zip": "cross-env-shell \"shx rm -rf bootstrap-$npm_package_version-dist && shx cp -r dist/ bootstrap-$npm_package_version-dist && zip -r9 bootstrap-$npm_package_version-dist.zip bootstrap-$npm_package_version-dist && shx rm -rf bootstrap-$npm_package_version-dist\"", + "release-zip-examples": "node build/zip-examples.js", "dist": "npm-run-all --parallel css js", "test": "npm-run-all lint dist js-test docs-compile docs-lint", "netlify": "npm-run-all dist release-sri docs-netlify", @@ -88,7 +89,7 @@ }, "style": "dist/css/bootstrap.css", "sass": "scss/bootstrap.scss", - "main": "dist/js/bootstrap", + "main": "dist/js/bootstrap.js", "repository": { "type": "git", "url": "git+https://github.com/twbs/bootstrap.git" diff --git a/scss/_reboot.scss b/scss/_reboot.scss index e9b5a7edddd9..5a9cef886270 100644 --- a/scss/_reboot.scss +++ b/scss/_reboot.scss @@ -229,6 +229,9 @@ pre { margin-bottom: 1rem; // Don't allow content to break outside overflow: auto; + // Disable auto-hiding scrollbar in IE & legacy Edge to avoid overlap, + // making it impossible to interact with the content + -ms-overflow-style: scrollbar; } diff --git a/site/_data/browser-features.yml b/site/_data/browser-features.yml index 303113da8a8e..8f75cb3af576 100644 --- a/site/_data/browser-features.yml +++ b/site/_data/browser-features.yml @@ -82,7 +82,7 @@ browser: > Chrome summary: > - Fire a [`transitioncancel` event](https://developer.mozilla.org/en-US/docs/Web/Events/transitioncancel) when a CSS transition is canceled + Fire a [`transitioncancel` event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/transitioncancel_event) when a CSS transition is canceled upstream_bug: > Chromium#642487 origin: > @@ -112,7 +112,7 @@ browser: > Safari summary: > - Fire a [`transitioncancel` event](https://developer.mozilla.org/en-US/docs/Web/Events/transitioncancel) when a CSS transition is canceled + Fire a [`transitioncancel` event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/transitioncancel_event) when a CSS transition is canceled upstream_bug: > WebKit#161535 origin: > diff --git a/site/_includes/social.html b/site/_includes/social.html index 277ee2313d37..cf5be127053a 100644 --- a/site/_includes/social.html +++ b/site/_includes/social.html @@ -11,8 +11,7 @@ - - + diff --git a/site/_layouts/simple.html b/site/_layouts/simple.html index bbf808df3363..9d869be51424 100644 --- a/site/_layouts/simple.html +++ b/site/_layouts/simple.html @@ -8,6 +8,7 @@

{{ page.title | smartify }}

{{ page.description | smartify }}

{%- if page.title == "Examples" -%} Download source code + Download Examples {%- endif -%} {% include ads.html %} diff --git a/site/docs/4.4/assets/js/src/search.js b/site/docs/4.4/assets/js/src/search.js index dd2a90e58779..e372d155374f 100644 --- a/site/docs/4.4/assets/js/src/search.js +++ b/site/docs/4.4/assets/js/src/search.js @@ -35,14 +35,14 @@ transformData: function (hits) { return hits.map(function (hit) { var currentUrl = getOrigin() - var liveUrl = 'https://getbootstrap.com' + var liveUrl = 'https://getbootstrap.com/' - // When in production, return the result as is, - // otherwise remove our url from it. - // eslint-disable-next-line no-negated-condition - hit.url = currentUrl.indexOf(liveUrl) !== -1 + hit.url = currentUrl.lastIndexOf(liveUrl, 0) === 0 + // On production, return the result as is ? hit.url - : hit.url.replace(liveUrl, '') + // On development or Netlify, replace `hit.url` with a trailing slash, + // so that the result link is relative to the server root + : hit.url.replace(liveUrl, '/') // Prevent jumping to first header if (hit.anchor === 'content') { diff --git a/site/docs/4.4/getting-started/download.md b/site/docs/4.4/getting-started/download.md index aed9be5bebad..79d8d175220f 100644 --- a/site/docs/4.4/getting-started/download.md +++ b/site/docs/4.4/getting-started/download.md @@ -28,6 +28,12 @@ Should you require [build tools]({{ site.baseurl }}/docs/{{ site.docs_version }} Download source +## Examples + +If you want to download and examine our [examples]({{ site.baseurl }}/docs/{{ site.docs_version }}/examples/), you can grab the already built examples: + +Download Examples + ## BootstrapCDN Skip the download with [BootstrapCDN](https://www.bootstrapcdn.com/) to deliver cached version of Bootstrap's compiled CSS and JS to your project.