Skip to content

Commit

Permalink
Update JS dependencies, remove space after emoji completion (#25266)
Browse files Browse the repository at this point in the history
- Update all JS dependencies
- Enable stylint
[`media-feature-name-value-no-unknown`](https://stylelint.io/user-guide/rules/media-feature-name-value-no-unknown)
- Make use of new features in webpack and text-expander-element
- Tested Swagger and Mermaid

To explain the `text-expander-element` change: Before this version, the
element added a unavoidable space after emoji completion. Now that
github/text-expander-element#36 is in, we gain
control over this space and I opted to remove it for emoji completion
and retain it for `@` mentions.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
  • Loading branch information
silverwind and GiteaBot authored Jun 18, 2023
1 parent 4e2f1ee commit f47744c
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 196 deletions.
1 change: 1 addition & 0 deletions .stylelintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ rules:
media-feature-name-no-vendor-prefix: true
media-feature-name-unit-allowed-list: null
media-feature-name-value-allowed-list: null
media-feature-name-value-no-unknown: true
media-feature-range-notation: null
named-grid-areas-no-invalid: true
no-descending-specificity: null
Expand Down
364 changes: 183 additions & 181 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"@claviska/jquery-minicolors": "2.3.6",
"@github/markdown-toolbar-element": "2.1.1",
"@github/relative-time-element": "4.3.0",
"@github/text-expander-element": "2.3.0",
"@github/text-expander-element": "2.5.0",
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
"@primer/octicons": "19.1.0",
"@primer/octicons": "19.3.0",
"@webcomponents/custom-elements": "1.6.0",
"add-asset-webpack-plugin": "2.0.1",
"ansi-to-html": "0.7.2",
Expand All @@ -32,15 +32,15 @@
"jquery.are-you-sure": "1.9.0",
"katex": "0.16.7",
"license-checker-webpack-plugin": "0.2.1",
"mermaid": "10.2.2",
"mermaid": "10.2.3",
"mini-css-extract-plugin": "2.7.6",
"minimatch": "9.0.1",
"monaco-editor": "0.39.0",
"monaco-editor-webpack-plugin": "7.0.1",
"pdfobject": "2.2.12",
"pretty-ms": "8.0.0",
"sortablejs": "1.15.0",
"swagger-ui-dist": "4.19.0",
"swagger-ui-dist": "5.0.0",
"throttle-debounce": "5.0.0",
"tippy.js": "6.3.7",
"tributejs": "5.1.3",
Expand All @@ -49,17 +49,17 @@
"vue-bar-graph": "2.0.0",
"vue-loader": "17.2.2",
"vue3-calendar-heatmap": "2.0.5",
"webpack": "5.86.0",
"webpack": "5.87.0",
"webpack-cli": "5.1.4",
"wrap-ansi": "8.1.0"
},
"devDependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "3.2.1",
"@playwright/test": "1.34.3",
"@playwright/test": "1.35.1",
"@rollup/pluginutils": "5.0.2",
"@stoplight/spectral-cli": "6.8.0",
"@vitejs/plugin-vue": "4.2.3",
"eslint": "8.42.0",
"eslint": "8.43.0",
"eslint-plugin-array-func": "3.1.8",
"eslint-plugin-custom-elements": "0.0.8",
"eslint-plugin-import": "2.27.5",
Expand All @@ -72,15 +72,15 @@
"eslint-plugin-vue": "9.14.1",
"eslint-plugin-wc": "1.5.0",
"jsdom": "22.1.0",
"markdownlint-cli": "0.34.0",
"markdownlint-cli": "0.35.0",
"postcss-html": "1.5.0",
"stylelint": "15.7.0",
"stylelint": "15.8.0",
"stylelint-declaration-block-no-ignored-properties": "2.7.0",
"stylelint-declaration-strict-value": "1.9.2",
"stylelint-stylistic": "0.4.2",
"svgo": "3.0.2",
"updates": "14.1.1",
"vitest": "0.32.0"
"updates": "14.2.4",
"vitest": "0.32.2"
},
"browserslist": [
"defaults",
Expand Down
2 changes: 1 addition & 1 deletion public/img/svg/octicon-copilot.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/svg/octicon-pivot-column.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/svg/octicon-redo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/svg/octicon-tracked-by-closed-completed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/svg/octicon-tracked-by-closed-not-planned.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/img/svg/octicon-undo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion templates/shared/combomarkdowneditor.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Template Attributes:
<button class="markdown-toolbar-button markdown-switch-easymde" data-tooltip-content="{{.locale.Tr "editor.buttons.switch_to_legacy.tooltip"}}">{{svg "octicon-arrow-switch"}}</button>
</div>
</markdown-toolbar>
<text-expander keys=": @">
<text-expander keys=": @" suffix="">
<textarea class="markdown-text-editor js-quick-submit"{{if .TextareaName}} name="{{.TextareaName}}"{{end}}{{if .TextareaPlaceholder}} placeholder="{{.TextareaPlaceholder}}"{{end}}{{if .TextareaAriaLabel}} aria-label="{{.TextareaAriaLabel}}"{{end}}>{{.TextareaContent}}</textarea>
</text-expander>
<script>
Expand Down
4 changes: 3 additions & 1 deletion web_src/js/features/comp/TextExpander.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export function initTextExpander(expander) {
});
expander?.addEventListener('text-expander-value', ({detail}) => {
if (detail?.item) {
detail.value = detail.item.getAttribute('data-value');
// add a space after @mentions as it's likely the user wants one
const suffix = detail.key === '@' ? ' ' : '';
detail.value = `${detail.item.getAttribute('data-value')}${suffix}`;
}
});
}
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default {
emitError: true,
allow: '(Apache-2.0 OR BSD-2-Clause OR BSD-3-Clause OR MIT OR ISC OR CPAL-1.0 OR Unlicense OR EPL-1.0 OR EPL-2.0)',
}) : new AddAssetPlugin('js/licenses.txt', `Licenses are disabled during development`),
].filter(Boolean),
],
performance: {
hints: false,
maxEntrypointSize: Infinity,
Expand Down

0 comments on commit f47744c

Please sign in to comment.