Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 66 additions & 62 deletions packages/typo3-docs-theme/.stylelintrc
Original file line number Diff line number Diff line change
@@ -1,97 +1,101 @@
{
"customSyntax": "postcss-scss",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you change this file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please look at the commit message of 63bc152
It was necessary to be compatible with v16 of stylelint.
In v16 stylistic rules were removed and reloacted into another npm package → https://github.com/stylelint-stylistic/stylelint-stylistic#about-and-purpose
https://stylelint.io/migration-guide/to-16/

"plugins": [
"@stylistic/stylelint-plugin"
],
"rules": {
"@stylistic/at-rule-name-case": "lower",
"@stylistic/at-rule-name-space-after": "always-single-line",
"@stylistic/at-rule-semicolon-newline-after": "always",
"@stylistic/block-closing-brace-empty-line-before": "never",
"@stylistic/block-closing-brace-newline-after": "always",
"@stylistic/block-closing-brace-newline-before": "always-multi-line",
"@stylistic/block-closing-brace-space-before": "always-single-line",
"@stylistic/block-opening-brace-newline-after": "always-multi-line",
"@stylistic/block-opening-brace-space-after": "always-single-line",
"@stylistic/block-opening-brace-space-before": "always",
"@stylistic/color-hex-case": "lower",
"@stylistic/declaration-bang-space-after": "never",
"@stylistic/declaration-bang-space-before": "always",
"@stylistic/declaration-block-semicolon-newline-after": "always-multi-line",
"@stylistic/declaration-block-semicolon-space-after": "always-single-line",
"@stylistic/declaration-block-semicolon-space-before": "never",
"@stylistic/declaration-block-trailing-semicolon": "always",
"@stylistic/declaration-colon-newline-after": "always-multi-line",
"@stylistic/declaration-colon-space-after": "always-single-line",
"@stylistic/declaration-colon-space-before": "never",
"@stylistic/function-comma-newline-after": "always-multi-line",
"@stylistic/function-comma-space-after": "always-single-line",
"@stylistic/function-comma-space-before": "never",
"@stylistic/function-max-empty-lines": 0,
"@stylistic/function-parentheses-newline-inside": "always-multi-line",
"@stylistic/function-parentheses-space-inside": "never-single-line",
"@stylistic/function-whitespace-after": "always",
"@stylistic/indentation": 4,
"@stylistic/max-empty-lines": 1,
"@stylistic/media-feature-colon-space-after": "always",
"@stylistic/media-feature-colon-space-before": "never",
"@stylistic/media-feature-name-case": "lower",
"@stylistic/media-feature-parentheses-space-inside": "never",
"@stylistic/media-feature-range-operator-space-after": "always",
"@stylistic/media-feature-range-operator-space-before": "always",
"@stylistic/media-query-list-comma-newline-after": "always-multi-line",
"@stylistic/media-query-list-comma-space-after": "always-single-line",
"@stylistic/media-query-list-comma-space-before": "never",
"@stylistic/no-eol-whitespace": true,
"@stylistic/no-extra-semicolons": true,
"@stylistic/no-missing-end-of-source-newline": true,
"@stylistic/number-leading-zero": "never",
"@stylistic/number-no-trailing-zeros": true,
"@stylistic/property-case": "lower",
"@stylistic/selector-attribute-brackets-space-inside": "never",
"@stylistic/selector-attribute-operator-space-after": "never",
"@stylistic/selector-attribute-operator-space-before": "never",
"@stylistic/selector-combinator-space-after": "always",
"@stylistic/selector-combinator-space-before": "always",
"@stylistic/selector-descendant-combinator-no-non-space": true,
"@stylistic/selector-list-comma-newline-after": "always",
"@stylistic/selector-list-comma-space-before": "never",
"@stylistic/selector-max-empty-lines": 0,
"@stylistic/selector-pseudo-class-case": "lower",
"@stylistic/selector-pseudo-class-parentheses-space-inside": "never",
"@stylistic/selector-pseudo-element-case": "lower",
"@stylistic/unit-case": "lower",
"@stylistic/value-list-comma-newline-after": "always-multi-line",
"@stylistic/value-list-comma-space-after": "always-single-line",
"@stylistic/value-list-comma-space-before": "never",
"@stylistic/value-list-max-empty-lines": 0,
"at-rule-empty-line-before": "never",
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always-single-line",
"at-rule-semicolon-newline-after": "always",
"block-closing-brace-empty-line-before": "never",
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always-multi-line",
"block-closing-brace-space-before": "always-single-line",
"block-no-empty": true,
"block-opening-brace-newline-after": "always-multi-line",
"block-opening-brace-space-after": "always-single-line",
"block-opening-brace-space-before": "always",
"color-hex-case": "lower",
"color-hex-length": "long",
"color-no-invalid-hex": true,
"comment-empty-line-before": "always",
"comment-no-empty": true,
"comment-whitespace-inside": "always",
"custom-property-empty-line-before": "never",
"declaration-bang-space-after": "never",
"declaration-bang-space-before": "always",
"declaration-block-no-duplicate-properties": true,
"declaration-block-no-redundant-longhand-properties": true,
"declaration-block-no-shorthand-property-overrides": true,
"declaration-block-semicolon-newline-after": "always-multi-line",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-block-semicolon-space-before": "never",
"declaration-block-single-line-max-declarations": 1,
"declaration-block-trailing-semicolon": "always",
"declaration-colon-newline-after": "always-multi-line",
"declaration-colon-space-after": "always-single-line",
"declaration-colon-space-before": "never",
"declaration-empty-line-before": "never",
"font-family-no-duplicate-names": true,
"function-calc-no-unspaced-operator": true,
"function-comma-newline-after": "always-multi-line",
"function-comma-space-after": "always-single-line",
"function-comma-space-before": "never",
"function-linear-gradient-no-nonstandard-direction": true,
"function-max-empty-lines": 0,
"function-name-case": "lower",
"function-parentheses-newline-inside": "always-multi-line",
"function-parentheses-space-inside": "never-single-line",
"function-whitespace-after": "always",
"indentation": 4,
"keyframe-declaration-no-important": true,
"length-zero-no-unit": true,
"max-empty-lines": 1,
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
"media-feature-name-case": "lower",
"media-feature-name-no-unknown": true,
"media-feature-parentheses-space-inside": "never",
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "always",
"media-query-list-comma-newline-after": "always-multi-line",
"media-query-list-comma-space-after": "always-single-line",
"media-query-list-comma-space-before": "never",
"no-empty-source": true,
"no-eol-whitespace": true,
"no-extra-semicolons": true,
"no-invalid-double-slash-comments": true,
"no-missing-end-of-source-newline": true,
"number-leading-zero": "never",
"number-no-trailing-zeros": true,
"property-case": "lower",
"property-no-unknown": true,
"rule-empty-line-before": "never",
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-operator-space-before": "never",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-descendant-combinator-no-non-space": true,
"selector-list-comma-newline-after": "always",
"selector-list-comma-space-before": "never",
"selector-max-empty-lines": 0,
"selector-pseudo-class-case": "lower",
"selector-pseudo-class-no-unknown": true,
"selector-pseudo-class-parentheses-space-inside": "never",
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-colon-notation": "single",
"selector-pseudo-element-no-unknown": true,
"selector-type-case": "lower",
"selector-type-no-unknown": true,
"shorthand-property-no-redundant-values": true,
"string-no-newline": true,
"unit-case": "lower",
"unit-no-unknown": true,
"value-list-comma-newline-after": "always-multi-line",
"value-list-comma-space-after": "always-single-line",
"value-list-comma-space-before": "never",
"value-list-max-empty-lines": 0
"unit-no-unknown": true
}
}
9 changes: 2 additions & 7 deletions packages/typo3-docs-theme/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ module.exports = function (grunt) {
},
libs: {
files: [
{
src: 'node_modules/@popperjs/core/dist/umd/popper.min.js',
dest: '<%= paths.output %>js/popper.min.js'
},
{
src: 'node_modules/bootstrap/dist/js/bootstrap.min.js',
dest: '<%= paths.output %>js/bootstrap.min.js'
Expand All @@ -93,7 +89,7 @@ module.exports = function (grunt) {
configFile: '.stylelintrc',
fix: true,
},
sass: ['sass/**/*.scss']
sass: ['assets/sass/**/*.scss']
},

// sass :: compact, compressed, expanded, nested
Expand Down Expand Up @@ -145,8 +141,7 @@ module.exports = function (grunt) {
removesourcemap: {
contrib: {
files: {
'<%= paths.output %>js/bootstrap.min.js': '<%= paths.output %>js/bootstrap.min.js',
'<%= paths.output %>js/popper.min.js': '<%= paths.output %>js/popper.min.js'
'<%= paths.output %>js/bootstrap.min.js': '<%= paths.output %>js/bootstrap.min.js'
}
}
},
Expand Down
57 changes: 3 additions & 54 deletions packages/typo3-docs-theme/assets/js/all-documentations-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,8 @@ class AllDocumentationsMenu extends AllDocumentationsMenuBase {

setupComponent() {
this.classList.add('all-documentations-menu')

this.tooltip = this.createTooltip();
this.appendChild(this.tooltip);

this.popperInstance = null;

this.mainButton.addEventListener('click', (event) => {
event.stopPropagation();
this.toggleTooltip();
});

// hide popup on outside click
document.addEventListener('click', (event) => {
if (!this.tooltip.hasAttribute('data-show')) {
return;
}

if (event.target?.closest('.all-documentations-menu-tooltip')) {
return
}

this.hideTooltip();
})
}

createClassName(name) {
Expand All @@ -51,6 +30,7 @@ class AllDocumentationsMenu extends AllDocumentationsMenuBase {
'btn', 'btn-light', 'd-lg-flex', 'd-none',
this.createClassName('button'),
);
element.setAttribute('popovertarget', 'all-docs-tooltip');
element.innerHTML = text;

const icon = document.createElement('i');
Expand Down Expand Up @@ -133,14 +113,11 @@ class AllDocumentationsMenu extends AllDocumentationsMenuBase {

createTooltip() {
const element = document.createElement('div');
element.id = 'all-docs-tooltip';
element.setAttribute('popover', '');
element.classList.add(this.createClassName('tooltip'));
element.setAttribute('role', 'tooltip');
Comment thread
ineswillenbrock marked this conversation as resolved.

const arrowElement = document.createElement('div');
arrowElement.classList.add(this.createClassName('tooltip-arrow'));
arrowElement.setAttribute('data-popper-arrow', '')
element.appendChild(arrowElement);

const categoriesElement = document.createElement('div');
categoriesElement.classList.add(this.createClassName('categories'));

Expand All @@ -152,34 +129,6 @@ class AllDocumentationsMenu extends AllDocumentationsMenuBase {

return element;
}

toggleTooltip() {
if (this.tooltip.hasAttribute('data-show')) {
this.hideTooltip();
} else {
this.showTooltip();
}
}

showTooltip() {
this.tooltip.setAttribute('data-show', '');

this.popperInstance = Popper.createPopper(this.mainButton, this.tooltip, {
placement: 'bottom',
modifiers: [
{ name: 'arrow' },
{ name: 'offset', options: { offset: [0, 10] } }
],
});
}

hideTooltip() {
this.tooltip.removeAttribute('data-show');
if (this.popperInstance) {
this.popperInstance.destroy();
this.popperInstance = null;
}
}
}

customElements.define('all-documentations-menu', AllDocumentationsMenu)
4 changes: 2 additions & 2 deletions packages/typo3-docs-theme/assets/js/search.js

Large diffs are not rendered by default.

Loading
Loading