Merge remote-tracking branch 'origin/fix/31602' into fix/31602

This commit is contained in:
charles 2024-07-12 09:33:59 +08:00
commit dddac21302
14 changed files with 1962 additions and 867 deletions

View File

@ -47,7 +47,6 @@ overrides:
- files: ["web_src/**/*"] - files: ["web_src/**/*"]
globals: globals:
__webpack_public_path__: true __webpack_public_path__: true
htmx: true
process: false # https://github.com/webpack/webpack/issues/15833 process: false # https://github.com/webpack/webpack/issues/15833
- files: ["web_src/**/*", "docs/**/*"] - files: ["web_src/**/*", "docs/**/*"]
env: env:
@ -58,7 +57,15 @@ overrides:
worker: true worker: true
rules: rules:
no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, status, statusbar, stop, toolbar, top] no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, status, statusbar, stop, toolbar, top]
- files: ["*.config.*", "**/*.d.ts"] - files: ["*.config.*"]
rules:
i/no-unused-modules: [0]
- files: ["**/*.d.ts"]
rules:
i/no-unused-modules: [0]
"@typescript-eslint/consistent-type-definitions": [0]
"@typescript-eslint/consistent-type-imports": [0]
- files: ["web_src/js/types.ts"]
rules: rules:
i/no-unused-modules: [0] i/no-unused-modules: [0]
- files: ["**/*.test.*", "web_src/js/test/setup.ts"] - files: ["**/*.test.*", "web_src/js/test/setup.ts"]

View File

@ -14,7 +14,7 @@ Please **DO NOT** file a public issue, instead send your report privately to `se
Due to the sensitive nature of security information, you can use the below GPG public key to encrypt your mail body. Due to the sensitive nature of security information, you can use the below GPG public key to encrypt your mail body.
The PGP key is valid until June 24, 2024. The PGP key is valid until July 9, 2025.
``` ```
Key ID: 6FCD2D5B Key ID: 6FCD2D5B

2727
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@
"@github/relative-time-element": "4.4.2", "@github/relative-time-element": "4.4.2",
"@github/text-expander-element": "2.7.1", "@github/text-expander-element": "2.7.1",
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3", "@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
"@primer/octicons": "19.9.0", "@primer/octicons": "19.11.0",
"@silverwind/vue3-calendar-heatmap": "2.0.6", "@silverwind/vue3-calendar-heatmap": "2.0.6",
"add-asset-webpack-plugin": "3.0.0", "add-asset-webpack-plugin": "3.0.0",
"ansi_up": "6.0.2", "ansi_up": "6.0.2",
@ -20,7 +20,7 @@
"chart.js": "4.4.3", "chart.js": "4.4.3",
"chartjs-adapter-dayjs-4": "1.0.4", "chartjs-adapter-dayjs-4": "1.0.4",
"chartjs-plugin-zoom": "2.0.1", "chartjs-plugin-zoom": "2.0.1",
"clippie": "4.1.1", "clippie": "4.1.3",
"css-loader": "7.1.2", "css-loader": "7.1.2",
"dayjs": "1.11.11", "dayjs": "1.11.11",
"dropzone": "6.0.0-beta.2", "dropzone": "6.0.0-beta.2",
@ -31,42 +31,42 @@
"htmx.org": "2.0.0", "htmx.org": "2.0.0",
"idiomorph": "0.3.0", "idiomorph": "0.3.0",
"jquery": "3.7.1", "jquery": "3.7.1",
"katex": "0.16.10", "katex": "0.16.11",
"license-checker-webpack-plugin": "0.2.1", "license-checker-webpack-plugin": "0.2.1",
"mermaid": "10.9.1", "mermaid": "10.9.1",
"mini-css-extract-plugin": "2.9.0", "mini-css-extract-plugin": "2.9.0",
"minimatch": "9.0.4", "minimatch": "10.0.1",
"monaco-editor": "0.49.0", "monaco-editor": "0.50.0",
"monaco-editor-webpack-plugin": "7.1.0", "monaco-editor-webpack-plugin": "7.1.0",
"pdfobject": "2.3.0", "pdfobject": "2.3.0",
"postcss": "8.4.38", "postcss": "8.4.39",
"postcss-loader": "8.1.1", "postcss-loader": "8.1.1",
"postcss-nesting": "12.1.5", "postcss-nesting": "12.1.5",
"sortablejs": "1.15.2", "sortablejs": "1.15.2",
"swagger-ui-dist": "5.17.14", "swagger-ui-dist": "5.17.14",
"tailwindcss": "3.4.4", "tailwindcss": "3.4.4",
"temporal-polyfill": "0.2.5", "temporal-polyfill": "0.2.5",
"throttle-debounce": "5.0.0", "throttle-debounce": "5.0.2",
"tinycolor2": "1.6.0", "tinycolor2": "1.6.0",
"tippy.js": "6.3.7", "tippy.js": "6.3.7",
"toastify-js": "1.12.0", "toastify-js": "1.12.0",
"tributejs": "5.1.3", "tributejs": "5.1.3",
"typescript": "5.5.2", "typescript": "5.5.3",
"uint8-to-base64": "0.2.0", "uint8-to-base64": "0.2.0",
"vanilla-colorful": "0.7.2", "vanilla-colorful": "0.7.2",
"vue": "3.4.29", "vue": "3.4.31",
"vue-bar-graph": "2.0.0", "vue-bar-graph": "2.0.0",
"vue-chartjs": "5.3.1", "vue-chartjs": "5.3.1",
"vue-loader": "17.4.2", "vue-loader": "17.4.2",
"webpack": "5.92.0", "webpack": "5.92.1",
"webpack-cli": "5.1.4", "webpack-cli": "5.1.4",
"wrap-ansi": "9.0.0" "wrap-ansi": "9.0.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "4.3.0", "@eslint-community/eslint-plugin-eslint-comments": "4.3.0",
"@playwright/test": "1.44.1", "@playwright/test": "1.45.1",
"@stoplight/spectral-cli": "6.11.1", "@stoplight/spectral-cli": "6.11.1",
"@stylistic/eslint-plugin-js": "2.2.1", "@stylistic/eslint-plugin-js": "2.3.0",
"@stylistic/stylelint-plugin": "2.1.2", "@stylistic/stylelint-plugin": "2.1.2",
"@types/dropzone": "5.7.8", "@types/dropzone": "5.7.8",
"@types/jquery": "3.5.30", "@types/jquery": "3.5.30",
@ -78,8 +78,8 @@
"@types/throttle-debounce": "5.0.2", "@types/throttle-debounce": "5.0.2",
"@types/tinycolor2": "1.4.6", "@types/tinycolor2": "1.4.6",
"@types/toastify-js": "1.12.3", "@types/toastify-js": "1.12.3",
"@typescript-eslint/eslint-plugin": "7.14.1", "@typescript-eslint/eslint-plugin": "7.16.0",
"@typescript-eslint/parser": "7.14.1", "@typescript-eslint/parser": "7.16.0",
"@vitejs/plugin-vue": "5.0.5", "@vitejs/plugin-vue": "5.0.5",
"eslint": "8.57.0", "eslint": "8.57.0",
"eslint-import-resolver-typescript": "3.6.1", "eslint-import-resolver-typescript": "3.6.1",
@ -87,7 +87,7 @@
"eslint-plugin-deprecation": "3.0.0", "eslint-plugin-deprecation": "3.0.0",
"eslint-plugin-github": "5.0.1", "eslint-plugin-github": "5.0.1",
"eslint-plugin-i": "2.29.1", "eslint-plugin-i": "2.29.1",
"eslint-plugin-no-jquery": "3.0.1", "eslint-plugin-no-jquery": "3.0.2",
"eslint-plugin-no-use-extend-native": "0.5.0", "eslint-plugin-no-use-extend-native": "0.5.0",
"eslint-plugin-playwright": "1.6.2", "eslint-plugin-playwright": "1.6.2",
"eslint-plugin-regexp": "2.6.0", "eslint-plugin-regexp": "2.6.0",
@ -95,10 +95,10 @@
"eslint-plugin-unicorn": "54.0.0", "eslint-plugin-unicorn": "54.0.0",
"eslint-plugin-vitest": "0.4.1", "eslint-plugin-vitest": "0.4.1",
"eslint-plugin-vitest-globals": "1.5.0", "eslint-plugin-vitest-globals": "1.5.0",
"eslint-plugin-vue": "9.26.0", "eslint-plugin-vue": "9.27.0",
"eslint-plugin-vue-scoped-css": "2.8.0", "eslint-plugin-vue-scoped-css": "2.8.1",
"eslint-plugin-wc": "2.1.0", "eslint-plugin-wc": "2.1.0",
"happy-dom": "14.12.0", "happy-dom": "14.12.3",
"markdownlint-cli": "0.41.0", "markdownlint-cli": "0.41.0",
"postcss-html": "1.7.0", "postcss-html": "1.7.0",
"stylelint": "16.6.1", "stylelint": "16.6.1",
@ -106,9 +106,9 @@
"stylelint-declaration-strict-value": "1.10.4", "stylelint-declaration-strict-value": "1.10.4",
"stylelint-value-no-unknown-custom-properties": "6.0.1", "stylelint-value-no-unknown-custom-properties": "6.0.1",
"svgo": "3.3.2", "svgo": "3.3.2",
"updates": "16.2.0", "updates": "16.2.1",
"vite-string-plugin": "1.3.4", "vite-string-plugin": "1.3.4",
"vitest": "1.6.0" "vitest": "2.0.2"
}, },
"browserslist": [ "browserslist": [
"defaults" "defaults"

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-accessibility-inset" width="16" height="16" aria-hidden="true"><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0m2 4a2 2 0 1 0-2.95 1.76 2 2 0 0 0-.32.24H3.75a.75.75 0 0 0 0 1.5h2.363l-.607 5.67a.75.75 0 1 0 1.49.16l.25-2.33h1.508l.25 2.33a.75.75 0 0 0 1.492-.16L9.888 7.5h2.362a.75.75 0 0 0 0-1.5H9.27a2 2 0 0 0-.32-.24A2 2 0 0 0 10 4"/></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-accessibility-inset" width="16" height="16" aria-hidden="true"><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M3.75 6a.75.75 0 0 0 0 1.5h2.409a2 2 0 0 0-.025.151l-.307 2.508-.323 3.011a.75.75 0 0 0 1.492.16l.25-2.33h1.509l.25 2.33a.748.748 0 0 0 1.199.552.75.75 0 0 0 .291-.712l-.32-3-.309-2.519a2 2 0 0 0-.025-.151h2.409a.75.75 0 0 0 0-1.5zM8 6a2 2 0 1 0 .001-3.999A2 2 0 0 0 8 6"/></svg>

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 463 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-ai-model" width="16" height="16" aria-hidden="true"><path d="M10.628 7.25a2.25 2.25 0 1 1 0 1.5H8.622a2.25 2.25 0 0 1-2.513 1.466L5.03 12.124a2.25 2.25 0 1 1-1.262-.814l1.035-1.832A2.25 2.25 0 0 1 4.25 8c0-.566.209-1.082.553-1.478L3.768 4.69a2.25 2.25 0 1 1 1.262-.814l1.079 1.908A2.25 2.25 0 0 1 8.622 7.25ZM2.5 2.5a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0m4 4.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5m6.25 0a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5m-9.5 5.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5"/></svg>

After

Width:  |  Height:  |  Size: 576 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-bookmark-filled" width="16" height="16" aria-hidden="true"><path d="M3 2.75C3 1.784 3.784 1 4.75 1h6.5c.966 0 1.75.784 1.75 1.75v11.5a.75.75 0 0 1-1.227.579L8 11.722l-3.773 3.107A.75.75 0 0 1 3 14.25z"/></svg>

After

Width:  |  Height:  |  Size: 288 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-bookmark-slash-fill" width="16" height="16" aria-hidden="true"><path d="M1.19 1.143a.75.75 0 1 0-.88 1.215L3 4.305v9.945a.75.75 0 0 0 1.206.596L8 11.944l3.794 2.902A.75.75 0 0 0 13 14.25v-2.703l1.81 1.31a.75.75 0 1 0 .88-1.214l-2.994-2.168-.014-.01L4.196 3.32l-.014-.01zm2.934.203A.5.5 0 0 1 4.6 1h7.233C12.478 1 13 1.522 13 2.167v5.05a.5.5 0 0 1-.793.405l-7.9-5.717a.5.5 0 0 1-.183-.559"/></svg>

After

Width:  |  Height:  |  Size: 475 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-file-media" width="16" height="16" aria-hidden="true"><path d="M16 13.25A1.75 1.75 0 0 1 14.25 15H1.75A1.75 1.75 0 0 1 0 13.25V2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75ZM1.75 2.5a.25.25 0 0 0-.25.25v10.5c0 .138.112.25.25.25h.94l.03-.03 6.077-6.078a1.75 1.75 0 0 1 2.412-.06L14.5 10.31V2.75a.25.25 0 0 0-.25-.25Zm12.5 11a.25.25 0 0 0 .25-.25v-.917l-4.298-3.889a.25.25 0 0 0-.344.009L4.81 13.5ZM7 6a2 2 0 1 1-3.999.001A2 2 0 0 1 7 6M5.5 6a.5.5 0 1 0-1 0 .5.5 0 0 0 1 0"/></svg>

After

Width:  |  Height:  |  Size: 569 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-home-fill" width="16" height="16" aria-hidden="true"><path d="M6.906.384a1.75 1.75 0 0 1 2.187 0l5.25 4.2c.415.332.657.835.657 1.367v7.019a1.75 1.75 0 0 1-1.75 1.75h-2.5a.75.75 0 0 1-.75-.75V8.72H6v5.25a.75.75 0 0 1-.75.75h-2.5A1.75 1.75 0 0 1 1 12.97V5.95c0-.531.242-1.034.657-1.366z"/></svg>

After

Width:  |  Height:  |  Size: 372 B

1
public/assets/img/svg/octicon-tab.svg generated Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="svg octicon-tab" width="16" height="16" aria-hidden="true"><path d="m10.78 8.53-3.75 3.75a.749.749 0 1 1-1.06-1.06l2.469-2.47H1.75a.75.75 0 0 1 0-1.5h6.689L5.97 4.78a.749.749 0 1 1 1.06-1.06l3.75 3.75a.75.75 0 0 1 0 1.06M13 12.25v-8.5a.75.75 0 0 1 1.5 0v8.5a.75.75 0 0 1-1.5 0"/></svg>

After

Width:  |  Height:  |  Size: 352 B

14
types.d.ts vendored
View File

@ -2,3 +2,17 @@ declare module '*.svg' {
const value: string; const value: string;
export default value; export default value;
} }
declare let __webpack_public_path__: string;
interface Window {
config: import('./web_src/js/types.ts').Config;
$: typeof import('@types/jquery'),
jQuery: typeof import('@types/jquery'),
htmx: typeof import('htmx.org'),
}
declare module 'htmx.org/dist/htmx.esm.js' {
const value = await import('htmx.org');
export default value;
}

View File

@ -4,8 +4,8 @@ import {showErrorToast} from './modules/toast.ts';
import 'idiomorph/dist/idiomorph-ext.js'; import 'idiomorph/dist/idiomorph-ext.js';
// https://htmx.org/reference/#config // https://htmx.org/reference/#config
htmx.config.requestClass = 'is-loading'; window.htmx.config.requestClass = 'is-loading';
htmx.config.scrollIntoViewOnBoost = false; window.htmx.config.scrollIntoViewOnBoost = false;
// https://htmx.org/events/#htmx:sendError // https://htmx.org/events/#htmx:sendError
document.body.addEventListener('htmx:sendError', (event) => { document.body.addEventListener('htmx:sendError', (event) => {

23
web_src/js/types.ts Normal file
View File

@ -0,0 +1,23 @@
export type MentionValue = {
key: string,
value: string,
name: string,
fullname: string,
avatar: string,
}
export type Config = {
appUrl: string,
appSubUrl: string,
assetVersionEncoded: string,
assetUrlPrefix: string,
runModeIsProd: boolean,
customEmojis: Record<string, string>,
csrfToken: string,
pageData: Record<string, any>,
notificationSettings: Record<string, any>,
enableTimeTracking: boolean,
mentionValues?: MentionValue[],
mermaidMaxSourceCharacters: number,
i18n: Record<string, string>,
}