Merge branch 'develop' into fix/postform-footer-button-overflow
This commit is contained in:
commit
bc66732e07
13 changed files with 343 additions and 302 deletions
|
|
@ -177,6 +177,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "29.7.0",
|
||||
"@misskey-dev/eslint-plugin": "^1.0.0",
|
||||
"@simplewebauthn/typescript-types": "8.3.4",
|
||||
"@swc/jest": "0.2.29",
|
||||
"@types/accepts": "1.3.7",
|
||||
|
|
|
|||
|
|
@ -71,8 +71,11 @@ export default class Logger {
|
|||
let log = `${l} ${worker}\t[${contexts.join(' ')}]\t${m}`;
|
||||
if (envOption.withLogTime) log = chalk.gray(time) + ' ' + log;
|
||||
|
||||
console.log(important ? chalk.bold(log) : log);
|
||||
if (level === 'error' && data) console.log(data);
|
||||
const args: unknown[] = [important ? chalk.bold(log) : log];
|
||||
if (data != null) {
|
||||
args.push(data);
|
||||
}
|
||||
console.log(...args);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@
|
|||
"@syuilo/aiscript": "0.16.0",
|
||||
"@tabler/icons-webfont": "2.44.0",
|
||||
"@twemoji/parser": "15.0.0",
|
||||
"@vitejs/plugin-vue": "4.5.2",
|
||||
"@vue/compiler-sfc": "3.3.12",
|
||||
"@vitejs/plugin-vue": "5.0.2",
|
||||
"@vue/compiler-sfc": "3.4.3",
|
||||
"aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.0.6",
|
||||
"astring": "1.8.6",
|
||||
"broadcast-channel": "7.0.0",
|
||||
|
|
@ -45,7 +45,6 @@
|
|||
"escape-regexp": "0.0.1",
|
||||
"estree-walker": "3.0.3",
|
||||
"eventemitter3": "5.0.1",
|
||||
"gsap": "3.12.4",
|
||||
"idb-keyval": "6.2.1",
|
||||
"insert-text-at-cursor": "0.3.0",
|
||||
"is-file-animated": "1.0.2",
|
||||
|
|
@ -70,10 +69,11 @@
|
|||
"uuid": "9.0.1",
|
||||
"v-code-diff": "1.7.2",
|
||||
"vite": "5.0.10",
|
||||
"vue": "3.3.12",
|
||||
"vue": "3.4.3",
|
||||
"vuedraggable": "next"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@misskey-dev/eslint-plugin": "^1.0.0",
|
||||
"@misskey-dev/summaly": "^5.0.3",
|
||||
"@storybook/addon-actions": "7.6.5",
|
||||
"@storybook/addon-essentials": "7.6.5",
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
"@typescript-eslint/eslint-plugin": "6.14.0",
|
||||
"@typescript-eslint/parser": "6.14.0",
|
||||
"@vitest/coverage-v8": "0.34.6",
|
||||
"@vue/runtime-core": "3.3.12",
|
||||
"@vue/runtime-core": "3.4.3",
|
||||
"acorn": "8.11.2",
|
||||
"cross-env": "7.0.3",
|
||||
"cypress": "13.6.1",
|
||||
|
|
@ -132,6 +132,6 @@
|
|||
"vitest": "0.34.6",
|
||||
"vitest-fetch-mock": "0.2.2",
|
||||
"vue-eslint-parser": "9.3.2",
|
||||
"vue-tsc": "1.8.25"
|
||||
"vue-tsc": "1.8.27"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,6 +131,10 @@ function onMousedown(evt: MouseEvent): void {
|
|||
box-sizing: border-box;
|
||||
transition: background 0.1s ease;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&:not(:disabled):hover {
|
||||
background: var(--buttonHoverBg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div :class="$style.codeEditorScroller">
|
||||
<textarea
|
||||
ref="inputEl"
|
||||
v-model="vModel"
|
||||
v-model="v"
|
||||
:class="[$style.textarea]"
|
||||
:disabled="disabled"
|
||||
:required="required"
|
||||
|
|
@ -58,7 +58,6 @@ const emit = defineEmits<{
|
|||
}>();
|
||||
|
||||
const { modelValue } = toRefs(props);
|
||||
const vModel = ref<string>(modelValue.value ?? '');
|
||||
const v = ref<string>(modelValue.value ?? '');
|
||||
const focused = ref(false);
|
||||
const changed = ref(false);
|
||||
|
|
@ -79,15 +78,14 @@ const onKeydown = (ev: KeyboardEvent) => {
|
|||
|
||||
if (ev.code === 'Enter') {
|
||||
const pos = inputEl.value?.selectionStart ?? 0;
|
||||
const posEnd = inputEl.value?.selectionEnd ?? vModel.value.length;
|
||||
const posEnd = inputEl.value?.selectionEnd ?? v.value.length;
|
||||
if (pos === posEnd) {
|
||||
const lines = vModel.value.slice(0, pos).split('\n');
|
||||
const lines = v.value.slice(0, pos).split('\n');
|
||||
const currentLine = lines[lines.length - 1];
|
||||
const currentLineSpaces = currentLine.match(/^\s+/);
|
||||
const posDelta = currentLineSpaces ? currentLineSpaces[0].length : 0;
|
||||
ev.preventDefault();
|
||||
vModel.value = vModel.value.slice(0, pos) + '\n' + (currentLineSpaces ? currentLineSpaces[0] : '') + vModel.value.slice(pos);
|
||||
v.value = vModel.value;
|
||||
v.value = v.value.slice(0, pos) + '\n' + (currentLineSpaces ? currentLineSpaces[0] : '') + v.value.slice(pos);
|
||||
nextTick(() => {
|
||||
inputEl.value?.setSelectionRange(pos + 1 + posDelta, pos + 1 + posDelta);
|
||||
});
|
||||
|
|
@ -97,9 +95,8 @@ const onKeydown = (ev: KeyboardEvent) => {
|
|||
|
||||
if (ev.key === 'Tab') {
|
||||
const pos = inputEl.value?.selectionStart ?? 0;
|
||||
const posEnd = inputEl.value?.selectionEnd ?? vModel.value.length;
|
||||
vModel.value = vModel.value.slice(0, pos) + '\t' + vModel.value.slice(posEnd);
|
||||
v.value = vModel.value;
|
||||
const posEnd = inputEl.value?.selectionEnd ?? v.value.length;
|
||||
v.value = v.value.slice(0, pos) + '\t' + v.value.slice(posEnd);
|
||||
nextTick(() => {
|
||||
inputEl.value?.setSelectionRange(pos + 1, pos + 1);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, watch } from 'vue';
|
||||
import gsap from 'gsap';
|
||||
import number from '@/filters/number.js';
|
||||
|
||||
const props = defineProps<{
|
||||
|
|
@ -20,8 +19,24 @@ const tweened = reactive({
|
|||
number: 0,
|
||||
});
|
||||
|
||||
watch(() => props.value, (n) => {
|
||||
gsap.to(tweened, { duration: 1, number: Number(n) || 0 });
|
||||
watch(() => props.value, (to, from) => {
|
||||
// requestAnimationFrameを利用して、500msでfromからtoまでを1次関数的に変化させる
|
||||
let start: number | null = null;
|
||||
|
||||
function step(timestamp: number) {
|
||||
if (start === null) {
|
||||
start = timestamp;
|
||||
}
|
||||
const elapsed = timestamp - start;
|
||||
tweened.number = (from ?? 0) + (to - (from ?? 0)) * elapsed / 500;
|
||||
if (elapsed < 500) {
|
||||
window.requestAnimationFrame(step);
|
||||
} else {
|
||||
tweened.number = to;
|
||||
}
|
||||
}
|
||||
|
||||
window.requestAnimationFrame(step);
|
||||
}, {
|
||||
immediate: true,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -8,15 +8,16 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@apidevtools/swagger-parser": "10.1.0",
|
||||
"@misskey-dev/eslint-plugin": "^1.0.0",
|
||||
"@types/node": "20.9.1",
|
||||
"@typescript-eslint/eslint-plugin": "6.11.0",
|
||||
"@typescript-eslint/parser": "6.11.0",
|
||||
"eslint": "8.53.0",
|
||||
"typescript": "5.3.3",
|
||||
"tsx": "4.4.0",
|
||||
"ts-case-convert": "2.0.2",
|
||||
"openapi-types": "12.1.3",
|
||||
"openapi-typescript": "6.7.1"
|
||||
"openapi-typescript": "6.7.1",
|
||||
"ts-case-convert": "2.0.2",
|
||||
"tsx": "4.4.0",
|
||||
"typescript": "5.3.3"
|
||||
},
|
||||
"files": [
|
||||
"built"
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "7.38.5",
|
||||
"@misskey-dev/eslint-plugin": "^1.0.0",
|
||||
"@swc/jest": "0.2.29",
|
||||
"@types/jest": "29.5.11",
|
||||
"@types/node": "20.10.5",
|
||||
|
|
|
|||
|
|
@ -1,118 +1,7 @@
|
|||
module.exports = {
|
||||
root: true,
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: [
|
||||
'@typescript-eslint',
|
||||
'import'
|
||||
],
|
||||
ignorePatterns: ['**/.eslintrc.cjs'],
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:import/recommended',
|
||||
'plugin:import/typescript'
|
||||
'plugin:@misskey-dev/recommended',
|
||||
],
|
||||
rules: {
|
||||
'indent': ['warn', 'tab', {
|
||||
'SwitchCase': 1,
|
||||
'MemberExpression': 1,
|
||||
'flatTernaryExpressions': true,
|
||||
'ArrayExpression': 'first',
|
||||
'ObjectExpression': 'first',
|
||||
}],
|
||||
'eol-last': ['error', 'always'],
|
||||
'semi': ['error', 'always'],
|
||||
'semi-spacing': ['error', { 'before': false, 'after': true }],
|
||||
'quotes': ['warn', 'single'],
|
||||
'comma-dangle': ['warn', 'always-multiline'],
|
||||
'comma-spacing': ['error', { 'before': false, 'after': true }],
|
||||
'array-bracket-spacing': ['error', 'never'],
|
||||
'keyword-spacing': ['error', {
|
||||
'before': true,
|
||||
'after': true,
|
||||
}],
|
||||
'key-spacing': ['error', {
|
||||
'beforeColon': false,
|
||||
'afterColon': true,
|
||||
}],
|
||||
'arrow-spacing': ['error', {
|
||||
'before': true,
|
||||
'after': true,
|
||||
}],
|
||||
'brace-style': ['error', '1tbs', {
|
||||
'allowSingleLine': true,
|
||||
}],
|
||||
'padded-blocks': ['error', 'never'],
|
||||
/* TODO: path aliasを使わないとwarnする
|
||||
'no-restricted-imports': ['warn', {
|
||||
'patterns': [
|
||||
]
|
||||
}],
|
||||
*/
|
||||
'eqeqeq': ['error', 'always', { 'null': 'ignore' }],
|
||||
'no-multi-spaces': ['error'],
|
||||
'no-var': ['error'],
|
||||
'prefer-arrow-callback': ['error'],
|
||||
'no-throw-literal': ['error'],
|
||||
'no-param-reassign': ['warn'],
|
||||
'no-constant-condition': ['warn'],
|
||||
'no-empty-pattern': ['warn'],
|
||||
'no-async-promise-executor': ['off'],
|
||||
'no-useless-escape': ['off'],
|
||||
'no-multiple-empty-lines': ['error', { 'max': 1 }],
|
||||
'no-control-regex': ['warn'],
|
||||
'no-empty': ['warn'],
|
||||
'no-inner-declarations': ['off'],
|
||||
'no-sparse-arrays': ['off'],
|
||||
'nonblock-statement-body-position': ['error', 'beside'],
|
||||
'object-curly-spacing': ['error', 'always'],
|
||||
'space-infix-ops': ['error'],
|
||||
'space-before-blocks': ['error', 'always'],
|
||||
'padding-line-between-statements': [
|
||||
'error',
|
||||
{ 'blankLine': 'always', 'prev': 'function', 'next': '*' },
|
||||
{ 'blankLine': 'always', 'prev': '*', 'next': 'function' },
|
||||
],
|
||||
"lines-between-class-members": "off",
|
||||
/* typescript-eslint では enforce に対応してないっぽい
|
||||
'@typescript-eslint/lines-between-class-members': ['error', {
|
||||
enforce: [{
|
||||
blankLine: 'always',
|
||||
prev: 'method',
|
||||
next: '*',
|
||||
}]
|
||||
}],
|
||||
*/
|
||||
'@typescript-eslint/func-call-spacing': ['error', 'never'],
|
||||
'@typescript-eslint/no-explicit-any': ['warn'],
|
||||
'@typescript-eslint/no-unused-vars': ['warn'],
|
||||
'@typescript-eslint/no-unnecessary-condition': ['warn'],
|
||||
'@typescript-eslint/no-var-requires': ['warn'],
|
||||
'@typescript-eslint/no-inferrable-types': ['warn'],
|
||||
'@typescript-eslint/no-empty-function': ['off'],
|
||||
'@typescript-eslint/no-non-null-assertion': ['warn'],
|
||||
'@typescript-eslint/explicit-function-return-type': ['off'],
|
||||
'@typescript-eslint/no-misused-promises': ['error', {
|
||||
'checksVoidReturn': false,
|
||||
}],
|
||||
'@typescript-eslint/consistent-type-imports': 'off',
|
||||
'@typescript-eslint/prefer-nullish-coalescing': [
|
||||
'warn',
|
||||
],
|
||||
'@typescript-eslint/naming-convention': [
|
||||
'error',
|
||||
{
|
||||
"selector": "typeLike",
|
||||
"format": ["PascalCase"]
|
||||
},
|
||||
{
|
||||
"selector": "typeParameter",
|
||||
"format": []
|
||||
}
|
||||
],
|
||||
'import/no-unresolved': ['off'],
|
||||
'import/no-default-export': ['warn'],
|
||||
'import/order': ['warn', {
|
||||
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
|
||||
}]
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
"misskey-js": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@misskey-dev/eslint-plugin": "^1.0.0",
|
||||
"@typescript-eslint/parser": "6.14.0",
|
||||
"@typescript/lib-webworker": "npm:@types/serviceworker@0.0.67",
|
||||
"eslint": "8.56.0",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue