From 0448cd108bc24f2608bd6be417f9015f7ad69ea6 Mon Sep 17 00:00:00 2001 From: Madani Badaoui Date: Wed, 17 Jul 2024 09:27:41 +0100 Subject: [PATCH 01/14] fix(issue 256): upload issue with images fix --- dev/server.js | 14 ++++++++------ src/index.ts | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dev/server.js b/dev/server.js index 3309e308..1477e3ec 100644 --- a/dev/server.js +++ b/dev/server.js @@ -86,12 +86,12 @@ class ServerExample { this.getForm(request) .then(({files}) => { - let image = files[this.fieldName] || {}; + let image = files[this.fieldName][0] || {}; responseJson.success = 1; responseJson.file = { - url: image.path, - name: image.name, + url: image.filepath, + name: image.newFilename, size: image.size }; }) @@ -147,10 +147,12 @@ class ServerExample { */ getForm(request) { return new Promise((resolve, reject) => { - const form = new formidable.IncomingForm(); + const form = new formidable.IncomingForm({ + uploadDir: this.uploadDir, + keepExtensions: true + }); - form.uploadDir = this.uploadDir; - form.keepExtensions = true; + console.error('the form info:', form); form.parse(request, (err, fields, files) => { if (err) { diff --git a/src/index.ts b/src/index.ts index 0c367629..c42162a1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -99,8 +99,8 @@ export default class ImageTool implements BlockTool { endpoints: config.endpoints, additionalRequestData: config.additionalRequestData, additionalRequestHeaders: config.additionalRequestHeaders, - field: config.field, - types: config.types, + field: config.field || 'image', + types: config.types || 'image/*', captionPlaceholder: this.api.i18n.t(config.captionPlaceholder ? config.captionPlaceholder: 'Caption'), buttonContent: config.buttonContent, uploader: config.uploader, From 30294cca2660924739f20cbe2d33c1c6a7de6e40 Mon Sep 17 00:00:00 2001 From: Madani Badaoui Date: Wed, 17 Jul 2024 13:20:57 +0100 Subject: [PATCH 02/14] update: few changes in providing data --- dev/server.js | 2 +- src/types/types.ts | 4 ++-- src/uploader.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/server.js b/dev/server.js index 1477e3ec..7ec1e065 100644 --- a/dev/server.js +++ b/dev/server.js @@ -90,7 +90,7 @@ class ServerExample { responseJson.success = 1; responseJson.file = { - url: image.filepath, + url: 'file://' + image.filepath, name: image.newFilename, size: image.size }; diff --git a/src/types/types.ts b/src/types/types.ts index f4b564f6..53945d7c 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -117,12 +117,12 @@ export interface ImageConfig { /** * Field name for the uploaded image. */ - field?: string; + field: string; /** * Allowed mime-types for the uploaded image. */ - types?: string; + types: string; /** * Placeholder text for the caption field. diff --git a/src/uploader.ts b/src/uploader.ts index 3f456ba9..006b4690 100644 --- a/src/uploader.ts +++ b/src/uploader.ts @@ -72,7 +72,7 @@ export default class Uploader { // custom uploading if (this.config.uploader && typeof this.config.uploader.uploadByFile === 'function') { const uploadByFile = this.config.uploader.uploadByFile; - upload = ajax.selectFiles({ accept: this.config.types || 'image/*'}).then((files: File[]) => { + upload = ajax.selectFiles({ accept: this.config.types}).then((files: File[]) => { preparePreview(files[0]); const customUpload = uploadByFile(files[0]); @@ -181,7 +181,7 @@ export default class Uploader { */ const formData = new FormData(); - formData.append(this.config.field || 'image', file); + formData.append(this.config.field, file); if (this.config.additionalRequestData && Object.keys(this.config.additionalRequestData).length) { Object.entries(this.config.additionalRequestData).forEach(([name, value]: [string, any]) => { From f491ecde0e8719717979a9853a210a918f70ddf8 Mon Sep 17 00:00:00 2001 From: dependentmadani Date: Wed, 17 Jul 2024 14:00:11 +0100 Subject: [PATCH 03/14] update: some parameters are optional --- src/index.ts | 4 ++-- src/types/types.ts | 4 ++-- src/uploader.ts | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/index.ts b/src/index.ts index c42162a1..0c367629 100644 --- a/src/index.ts +++ b/src/index.ts @@ -99,8 +99,8 @@ export default class ImageTool implements BlockTool { endpoints: config.endpoints, additionalRequestData: config.additionalRequestData, additionalRequestHeaders: config.additionalRequestHeaders, - field: config.field || 'image', - types: config.types || 'image/*', + field: config.field, + types: config.types, captionPlaceholder: this.api.i18n.t(config.captionPlaceholder ? config.captionPlaceholder: 'Caption'), buttonContent: config.buttonContent, uploader: config.uploader, diff --git a/src/types/types.ts b/src/types/types.ts index 53945d7c..f4b564f6 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -117,12 +117,12 @@ export interface ImageConfig { /** * Field name for the uploaded image. */ - field: string; + field?: string; /** * Allowed mime-types for the uploaded image. */ - types: string; + types?: string; /** * Placeholder text for the caption field. diff --git a/src/uploader.ts b/src/uploader.ts index 006b4690..d7348078 100644 --- a/src/uploader.ts +++ b/src/uploader.ts @@ -72,7 +72,7 @@ export default class Uploader { // custom uploading if (this.config.uploader && typeof this.config.uploader.uploadByFile === 'function') { const uploadByFile = this.config.uploader.uploadByFile; - upload = ajax.selectFiles({ accept: this.config.types}).then((files: File[]) => { + upload = ajax.selectFiles({ accept: this.config.types || 'image/*'}).then((files: File[]) => { preparePreview(files[0]); const customUpload = uploadByFile(files[0]); @@ -89,12 +89,12 @@ export default class Uploader { upload = ajax.transport({ url: this.config.endpoints.byFile, data: this.config.additionalRequestData, - accept: this.config.types, + accept: this.config.types || 'image/*', headers: new Headers(this.config.additionalRequestHeaders as Record), beforeSend: (files: File[]) => { preparePreview(files[0]); }, - fieldName: this.config.field, + fieldName: this.config.field || 'image', }).then((response: any) => response.body); } @@ -181,7 +181,7 @@ export default class Uploader { */ const formData = new FormData(); - formData.append(this.config.field, file); + formData.append(this.config.field || 'image', file); if (this.config.additionalRequestData && Object.keys(this.config.additionalRequestData).length) { Object.entries(this.config.additionalRequestData).forEach(([name, value]: [string, any]) => { From 3180915c4015836d5dd8232cdbf93308e689706c Mon Sep 17 00:00:00 2001 From: dependentmadani Date: Wed, 17 Jul 2024 14:53:55 +0100 Subject: [PATCH 04/14] update(version): increase the patch version --- package.json | 2 +- src/types/codexteam__ajax.d.ts | 2 +- src/uploader.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4666afa9..147e0954 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@editorjs/image", - "version": "2.9.1", + "version": "2.9.2", "keywords": [ "codex editor", "image", diff --git a/src/types/codexteam__ajax.d.ts b/src/types/codexteam__ajax.d.ts index 63c45a52..f7101558 100644 --- a/src/types/codexteam__ajax.d.ts +++ b/src/types/codexteam__ajax.d.ts @@ -3,7 +3,7 @@ declare module '@codexteam/ajax' { url?: string; data?: any; accept?: string; - headers?: Headers; + headers?: object; beforeSend?: (files: File[]) => void; fieldName?: string; type?: string; diff --git a/src/uploader.ts b/src/uploader.ts index d7348078..32d7b39f 100644 --- a/src/uploader.ts +++ b/src/uploader.ts @@ -90,7 +90,7 @@ export default class Uploader { url: this.config.endpoints.byFile, data: this.config.additionalRequestData, accept: this.config.types || 'image/*', - headers: new Headers(this.config.additionalRequestHeaders as Record), + headers: this.config.additionalRequestHeaders as Record, beforeSend: (files: File[]) => { preparePreview(files[0]); }, @@ -133,7 +133,7 @@ export default class Uploader { url: url, }, this.config.additionalRequestData), type: ajax.contentType.JSON, - headers: new Headers(this.config.additionalRequestHeaders as Record), + headers: this.config.additionalRequestHeaders as Record, }).then((response: any) => response.body); } @@ -193,7 +193,7 @@ export default class Uploader { url: this.config.endpoints.byFile, data: formData, type: ajax.contentType.JSON, - headers: new Headers(this.config.additionalRequestHeaders as Record), + headers: this.config.additionalRequestHeaders as Record, }).then((response: any) => response.body); } From 83606cfa7f42b428dd4fbdde3b36e91b1457630d Mon Sep 17 00:00:00 2001 From: dependentmadani Date: Sun, 21 Jul 2024 00:00:46 +0100 Subject: [PATCH 05/14] fix(eslint): work on load to fix eslint issues --- .eslintrc | 8 - eslint.config.mjs | 36 ++ package.json | 15 +- src/index.ts | 137 +++---- src/types/codexteam__ajax.d.ts | 47 ++- src/types/types.ts | 22 +- src/ui.ts | 115 +++--- src/uploader.ts | 35 +- src/utils/dom.ts | 9 +- src/utils/isPromise.ts | 5 +- tsconfig.json | 3 +- yarn.lock | 646 ++++++++++++--------------------- 12 files changed, 444 insertions(+), 634 deletions(-) delete mode 100644 .eslintrc create mode 100644 eslint.config.mjs diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index b919c0ee..00000000 --- a/.eslintrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "globals": {}, - "parserOptions": { - "sourceType": "module", - "ecmaVersion": 2020 - }, - "parser": "@typescript-eslint/parser" -} \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..7a183521 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,36 @@ +import Codex from "eslint-config-codex"; +import { plugin as TsPlugin, parser as TsParser } from 'typescript-eslint'; + +export default [ + ...Codex, + { + files: ['src/**/*.ts'], + languageOptions: { + parser: TsParser, + parserOptions: { + project: './tsconfig.json', + tsconfigRootDir: './', + sourceType: 'module', + }, + }, + rules: { + 'n/no-missing-import': ['off'], + 'n/no-unsupported-features/node-builtins': ['off'], + 'jsdoc/no-types': ['off'], + 'jsdoc/require-returns-description': ['off'], + 'jsdoc/check-tag-names': ['off'], + '@typescript-eslint/no-unsafe-member-access': ['off'], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "variable", + "format": ["camelCase"], + "leadingUnderscore": "allow" + }, + ] + } + }, + { + ignores: ['dev/**', 'eslint.config.mjs', 'vite.config.js', 'postcss.config.js'] + } +]; diff --git a/package.json b/package.json index 147e0954..305ac8ae 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,9 @@ "scripts": { "dev": "vite", "build": "vite build", - "lint": "eslint src/ --ext .ts", - "lint:errors": "eslint src/ --quiet", - "lint:fix": "eslint src/ --fix" + "lint": "eslint", + "lint:errors": "eslint --quiet", + "lint:fix": "eslint --fix" }, "author": { "name": "CodeX", @@ -37,9 +37,9 @@ "devDependencies": { "@codexteam/ajax": "^4.2.0", "@editorjs/editorjs": "2.30.0-rc.12", - "@typescript-eslint/eslint-plugin": "^7.13.1", - "@typescript-eslint/parser": "^7.13.1", - "eslint": "^7.22.0", + "@typescript-eslint/eslint-plugin": "^7.16.1", + "@typescript-eslint/parser": "^7.16.1", + "eslint": "^9.7.0", "eslint-config-codex": "^2.0.1", "eslint-loader": "^4.0.2", "formidable": "^3.5.1", @@ -52,6 +52,7 @@ "vite-plugin-dts": "^3.9.1" }, "dependencies": { - "@codexteam/icons": "^0.3.0" + "@codexteam/icons": "^0.3.0", + "typescript-eslint": "^7.16.1" } } diff --git a/src/index.ts b/src/index.ts index 0c367629..6a3d6ec1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,5 @@ /** * Image Tool for the Editor.js - * * @author CodeX * @license MIT * @see {@link https://github.com/editor-js/image} @@ -30,7 +29,7 @@ * }, */ -import type { TunesMenuConfig } from "@editorjs/editorjs/types/tools"; +import type { TunesMenuConfig } from '@editorjs/editorjs/types/tools'; import type { API, ToolboxConfig, PasteConfig, BlockToolConstructorOptions, BlockTool, BlockAPI } from '@editorjs/editorjs'; import './index.css'; @@ -38,54 +37,56 @@ import Ui from './ui'; import Uploader from './uploader'; import { IconAddBorder, IconStretch, IconAddBackground, IconPicture } from '@codexteam/icons'; -import { ActionConfig, UploadResponseFormat, ImageToolData, ImageConfig } from './types/types'; - +import type { ActionConfig, UploadResponseFormat, ImageToolData, ImageConfig } from './types/types'; -type ImageToolConstructorOptions = BlockToolConstructorOptions +type ImageToolConstructorOptions = BlockToolConstructorOptions; +/** + * Implementation of ImageTool class + */ export default class ImageTool implements BlockTool { - /** - * Editor.js API instance + /** + * Editor.js API instance */ private api: API; - /** - * Flag indicating read-only mode + /** + * Flag indicating read-only mode */ private readOnly: boolean; - /** + /** * Current Block API instance */ private block: BlockAPI; - /** + /** * Configuration for the ImageTool */ private config: ImageConfig; - /** - * Uploader module instance + /** + * Uploader module instance */ private uploader: Uploader; - /** + /** * UI module instance */ private ui: Ui; - /** + /** * Stores current block data internally */ private _data: ImageToolData; /** - * @param {object} tool - tool properties got from editor.js - * @param {ImageToolData} tool.data - previously saved data - * @param {ImageConfig} tool.config - user config for Tool - * @param {object} tool.api - Editor.js API - * @param {boolean} tool.readOnly - read-only mode flag - * @param {BlockAPI|{}} tool.block - current Block API + * @param tool - tool properties got from editor.js + * @param tool.data - previously saved data + * @param tool.config - user config for Tool + * @param tool.api - Editor.js API + * @param tool.readOnly - read-only mode flag + * @param tool.block - current Block API */ constructor({ data, config, api, readOnly, block }: ImageToolConstructorOptions) { this.api = api; @@ -101,7 +102,7 @@ export default class ImageTool implements BlockTool { additionalRequestHeaders: config.additionalRequestHeaders, field: config.field, types: config.types, - captionPlaceholder: this.api.i18n.t(config.captionPlaceholder ? config.captionPlaceholder: 'Caption'), + captionPlaceholder: this.api.i18n.t(config.captionPlaceholder != undefined ? config.captionPlaceholder : 'Caption'), buttonContent: config.buttonContent, uploader: config.uploader, actions: config.actions, @@ -112,8 +113,8 @@ export default class ImageTool implements BlockTool { */ this.uploader = new Uploader({ config: this.config, - onUpload: (response) => this.onUpload(response), - onError: (error) => this.uploadingFailed(error), + onUpload: (response: UploadResponseFormat) => this.onUpload(response), + onError: (error: string) => this.uploadingFailed(error), }); /** @@ -146,12 +147,12 @@ export default class ImageTool implements BlockTool { }; this.data = data; } + /** * Notify core that read-only mode is supported - * - * @returns {boolean} + * @returns { boolean } */ - static get isReadOnlySupported(): boolean { + public static get isReadOnlySupported(): boolean { return true; } @@ -159,10 +160,9 @@ export default class ImageTool implements BlockTool { * Get Tool toolbox settings * icon - Tool icon's SVG * title - title to show in toolbox - * * @returns {{icon: string, title: string}} */ - static get toolbox(): ToolboxConfig { + public static get toolbox(): ToolboxConfig { return { icon: IconPicture, title: 'Image', @@ -171,10 +171,9 @@ export default class ImageTool implements BlockTool { /** * Available image tools - * * @returns {Array} */ - static get tunes(): Array { + public static get tunes(): Array { return [ { name: 'withBorder', @@ -199,34 +198,29 @@ export default class ImageTool implements BlockTool { /** * Renders Block content - * * @public - * * @returns {HTMLDivElement} */ - render(): HTMLDivElement { + public render(): HTMLDivElement { return this.ui.render(this.data) as HTMLDivElement; } /** * Validate data: check if Image exists - * * @param {ImageToolData} savedData — data received after saving * @returns {boolean} false if saved data is not correct, otherwise true * @public */ - validate(savedData: ImageToolData): boolean { + public validate(savedData: ImageToolData): boolean { return !!savedData.file.url; } /** * Return Block data - * * @public - * * @returns {ImageToolData} */ - save(): ImageToolData { + public save(): ImageToolData { const caption = this.ui.nodes.caption; this._data.caption = caption.innerHTML; @@ -236,12 +230,10 @@ export default class ImageTool implements BlockTool { /** * Returns configuration for block tunes: add background, add border, stretch image - * * @public - * * @returns TunesMenuConfig */ - renderSettings(): TunesMenuConfig { + public renderSettings(): TunesMenuConfig { // Merge default tunes with the ones that might be added by user // @see https://github.com/editor-js/image/pull/49 const tunes = ImageTool.tunes.concat(this.config.actions || []); @@ -253,7 +245,7 @@ export default class ImageTool implements BlockTool { toggle: tune.toggle, isActive: this.data[tune.name as keyof ImageToolData] as boolean, onActivate: () => { - /**If it'a user defined tune, execute it's callback stored in action property */ + /** If it'a user defined tune, execute it's callback stored in action property */ if (typeof tune.action === 'function') { tune.action(tune.name); @@ -267,20 +259,18 @@ export default class ImageTool implements BlockTool { /** * Fires after clicks on the Toolbox Image Icon * Initiates click on the Select File button - * * @public */ - appendCallback() { + public appendCallback(): void { this.ui.nodes.fileButton.click(); } /** * Specify paste substitutes - * * @see {@link https://github.com/codex-team/editor.js/blob/master/docs/tools.md#paste-handling} - * @returns {{tags: string[], patterns: object, files: {extensions: string[], mimeTypes: string[]}}} + * @returns { PasteConfig } */ - static get pasteConfig(): PasteConfig { + public static get pasteConfig(): PasteConfig { return { /** * Paste HTML into Editor @@ -301,24 +291,23 @@ export default class ImageTool implements BlockTool { * Drag n drop file from into the Editor */ files: { - mimeTypes: [ 'image/*' ], + mimeTypes: ['image/*'], }, }; } /** * Specify paste handlers - * * @public * @see {@link https://github.com/codex-team/editor.js/blob/master/docs/tools.md#paste-handling} - * @param {CustomEvent} event - editor.js custom paste event + * @param event - editor.js custom paste event * {@link https://github.com/codex-team/editor.js/blob/master/types/tools/paste-events.d.ts} * @returns {void} */ - async onPaste(event: CustomEvent): Promise { + public async onPaste(event: CustomEvent): Promise { switch (event.type) { case 'tag': { - const image = event.detail.data; + const image: { src: string } = event.detail.data; /** Images from PDF */ if (/^blob:/.test(image.src)) { @@ -334,13 +323,13 @@ export default class ImageTool implements BlockTool { break; } case 'pattern': { - const url = event.detail.data; + const url: string = event.detail.data; this.uploadUrl(url); break; } case 'file': { - const file = event.detail.file; + const file: Blob = event.detail.file; this.uploadFile(file); break; @@ -355,12 +344,10 @@ export default class ImageTool implements BlockTool { /** * Stores all Tool's data - * * @private - * * @param {ImageToolData} data - data in Image Tool format */ - set data(data: ImageToolData) { + private set data(data: ImageToolData) { this.image = data.file; this._data.caption = data.caption || ''; @@ -375,24 +362,20 @@ export default class ImageTool implements BlockTool { /** * Return Tool data - * * @private - * * @returns {ImageToolData} */ - get data(): ImageToolData { + private get data(): ImageToolData { return this._data; } /** * Set new image file - * * @private - * * @param {object} file - uploaded file data */ - set image(file: { url: string } | undefined) { - this._data.file = file || {url: ''}; + private set image(file: { url: string } | undefined) { + this._data.file = file || { url: '' }; if (file && file.url) { this.ui.fillImage(file.url); @@ -401,13 +384,11 @@ export default class ImageTool implements BlockTool { /** * File uploading callback - * * @private - * * @param {UploadResponseFormat} response - uploading server response * @returns {void} */ - onUpload(response: UploadResponseFormat): void { + private onUpload(response: UploadResponseFormat): void { if (response.success && response.file) { this.image = response.file; } else { @@ -417,12 +398,11 @@ export default class ImageTool implements BlockTool { /** * Handle uploader errors - * * @private * @param {string} errorText - uploading error text * @returns {void} */ - uploadingFailed(errorText: string): void { + private uploadingFailed(errorText: string): void { console.log('Image Tool: uploading failed because of', errorText); this.api.notifier.show({ @@ -434,25 +414,22 @@ export default class ImageTool implements BlockTool { /** * Callback fired when Block Tune is activated - * * @private - * * @param {string} tuneName - tune that has been clicked * @returns {void} */ - tuneToggled(tuneName: keyof ImageToolData): void { + private tuneToggled(tuneName: keyof ImageToolData): void { // inverse tune state - this.setTune(tuneName, !this._data[tuneName as keyof ImageToolData]); + this.setTune(tuneName, !this._data[tuneName]); } /** * Set one tune - * * @param {string} tuneName - {@link Tunes.tunes} * @param {boolean} value - tune state * @returns {void} */ - setTune(tuneName: keyof ImageToolData, value: boolean): void { + private setTune(tuneName: keyof ImageToolData, value: boolean): void { (this._data[tuneName] as boolean) = value; this.ui.applyTune(tuneName, value); @@ -463,7 +440,7 @@ export default class ImageTool implements BlockTool { Promise.resolve().then(() => { this.block.stretched = value; }) - .catch(err => { + .catch((err) => { console.error(err); }); } @@ -471,11 +448,10 @@ export default class ImageTool implements BlockTool { /** * Show preloader and upload image file - * * @param {File} file - file that is currently uploading (from paste) * @returns {void} */ - uploadFile(file: Blob): void { + private uploadFile(file: Blob): void { this.uploader.uploadByFile(file, { onPreview: (src: string) => { this.ui.showPreloader(src); @@ -485,11 +461,10 @@ export default class ImageTool implements BlockTool { /** * Show preloader and upload image by target url - * * @param {string} url - url pasted * @returns {void} */ - uploadUrl(url: string): void { + private uploadUrl(url: string): void { this.ui.showPreloader(url); this.uploader.uploadByUrl(url); } diff --git a/src/types/codexteam__ajax.d.ts b/src/types/codexteam__ajax.d.ts index f7101558..347900f6 100644 --- a/src/types/codexteam__ajax.d.ts +++ b/src/types/codexteam__ajax.d.ts @@ -1,26 +1,25 @@ declare module '@codexteam/ajax' { - export interface AjaxOptions { - url?: string; - data?: any; - accept?: string; - headers?: object; - beforeSend?: (files: File[]) => void; - fieldName?: string; - type?: string; - } - - export interface AjaxResponse { - body: T; - } - - export function selectFiles(options: { accept: string }): Promise; - - export function transport(options: AjaxOptions): Promise; - - export function post(options: AjaxOptions): Promise; - - export const contentType: { - JSON: string; - }; + export interface AjaxOptions { + url?: string; + data?: any; + accept?: string; + headers?: object; + beforeSend?: (files: File[]) => void; + fieldName?: string; + type?: string; } - \ No newline at end of file + + export interface AjaxResponse { + body: T; + } + + export function selectFiles(options: { accept: string }): Promise; + + export function transport(options: AjaxOptions): Promise; + + export function post(options: AjaxOptions): Promise; + + export const contentType: { + JSON: string; + }; +} diff --git a/src/types/types.ts b/src/types/types.ts index f4b564f6..0a139bd1 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -1,34 +1,34 @@ /** * Represents options for uploading, including a function to handle previewing. */ -export interface UploadOptions { - onPreview: (src: string) => void +export interface UploadOptions { + onPreview: (src: string) => void; }; -/** +/** * User configuration of Image block tunes. Allows to add custom tunes through the config -*/ -export interface ActionConfig { + */ +export interface ActionConfig { /** * The name of the tune. */ name: string; - + /** * The icon for the tune. Should be an SVG string. */ icon: string; - + /** * The title of the tune. This will be displayed in the UI. */ title: string; - + /** * An optional flag indicating whether the tune is a toggle (true) or not (false). */ toggle?: boolean; - + /** * An optional action function to be executed when the tune is activated. */ @@ -40,7 +40,7 @@ export interface ActionConfig { */ export interface UploadResponseFormat { /** - * success - 1 for successful uploading, 0 for failure + * success - 1 for successful uploading, 0 for failure */ success: number; @@ -164,4 +164,4 @@ export interface ImageConfig { * Additional actions for the tool. */ actions?: ActionConfig[]; -} \ No newline at end of file +} diff --git a/src/ui.ts b/src/ui.ts index 402e622c..c6e0a610 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -1,7 +1,7 @@ import { IconPicture } from '@codexteam/icons'; import { make } from './utils/dom'; import type { API } from '@editorjs/editorjs'; -import { ImageToolData, ImageConfig } from './types/types'; +import type { ImageToolData, ImageConfig } from './types/types'; /** * Enumeration representing the different states of the UI. @@ -10,17 +10,17 @@ enum UiState { /** * The UI is in an empty state, with no image loaded or being uploaded. */ - Empty = "empty", + Empty = 'empty', /** * The UI is in an uploading state, indicating an image is currently being uploaded. */ - Uploading = "uploading", + Uploading = 'uploading', /** * The UI is in a filled state, with an image successfully loaded. */ - Filled = "filled" + Filled = 'filled' }; /** @@ -51,7 +51,7 @@ interface Nodes { * Preloader element for the image. */ imagePreloader: HTMLElement; - + /** * Caption element for the image. */ @@ -90,33 +90,33 @@ export default class Ui { /** * API instance for Editor.js. */ -private api: API; + private api: API; -/** - * Configuration for the image tool. - */ -private config: ImageConfig; + /** + * Configuration for the image tool. + */ + private config: ImageConfig; -/** - * Callback function for selecting a file. - */ -private onSelectFile: () => void; + /** + * Callback function for selecting a file. + */ + private onSelectFile: () => void; -/** - * Flag indicating if the UI is in read-only mode. - */ -private readOnly: boolean; + /** + * Flag indicating if the UI is in read-only mode. + */ + private readOnly: boolean; -/** - * Nodes representing various elements in the UI. - */ -public nodes: Nodes; /** - * @param {object} ui - image tool Ui module - * @param {object} ui.api - Editor.js API - * @param {ImageConfig} ui.config - user config - * @param {Function} ui.onSelectFile - callback for clicks on Select file button - * @param {boolean} ui.readOnly - read-only mode flag + * Nodes representing various elements in the UI. + */ + public nodes: Nodes; + /** + * @param ui - image tool Ui module + * @param ui.api - Editor.js API + * @param ui.config - user config + * @param ui.onSelectFile - callback for clicks on Select file button + * @param ui.readOnly - read-only mode flag */ constructor({ api, config, onSelectFile, readOnly }: ConstructorParams) { this.api = api; @@ -125,7 +125,7 @@ public nodes: Nodes; this.readOnly = readOnly; this.nodes = { wrapper: make('div', [this.CSS.baseClass, this.CSS.wrapper]), - imageContainer: make('div', [ this.CSS.imageContainer ]), + imageContainer: make('div', [this.CSS.imageContainer]), fileButton: this.createFileButton(), imageEl: undefined, imagePreloader: make('div', this.CSS.imagePreloader), @@ -153,8 +153,7 @@ public nodes: Nodes; /** * CSS classes - * - * @returns {object} + * @returns */ get CSS(): Record { return { @@ -176,26 +175,25 @@ public nodes: Nodes; /** * Renders tool UI - * - * @param {ImageToolData} toolData - saved tool data - * @returns {Element} + * @param toolData - saved tool data + * @returns */ - render(toolData: ImageToolData): HTMLElement { + render(toolData: ImageToolData): HTMLElement { if (!toolData.file || Object.keys(toolData.file).length === 0) { this.toggleStatus(UiState.Empty); } else { this.toggleStatus(UiState.Uploading); } + return this.nodes.wrapper; } /** * Creates upload-file button - * - * @returns {Element} + * @returns */ createFileButton(): HTMLElement { - const button = make('div', [ this.CSS.button ]); + const button = make('div', [this.CSS.button]); button.innerHTML = this.config.buttonContent || `${IconPicture} ${this.api.i18n.t('Select an Image')}`; @@ -208,9 +206,8 @@ public nodes: Nodes; /** * Shows uploading preloader - * - * @param {string} src - preview source - * @returns {void} + * @param src - preview source + * @returns */ showPreloader(src: string): void { this.nodes.imagePreloader.style.backgroundImage = `url(${src})`; @@ -220,8 +217,7 @@ public nodes: Nodes; /** * Hide uploading preloader - * - * @returns {void} + * @returns */ hidePreloader(): void { this.nodes.imagePreloader.style.backgroundImage = ''; @@ -230,9 +226,8 @@ public nodes: Nodes; /** * Shows an image - * - * @param {string} url - image source - * @returns {void} + * @param url - image source + * @returns */ fillImage(url: string): void { /** @@ -240,7 +235,7 @@ public nodes: Nodes; */ const tag = /\.mp4$/.test(url) ? 'VIDEO' : 'IMG'; - const attributes: { [key: string]: any} = { + const attributes: { [key: string]: any } = { src: url, }; @@ -248,8 +243,6 @@ public nodes: Nodes; * We use eventName variable because IMG and VIDEO tags have different event to be called on source load * - IMG: load * - VIDEO: loadeddata - * - * @type {string} */ let eventName = 'load'; @@ -259,8 +252,6 @@ public nodes: Nodes; if (tag === 'VIDEO') { /** * Add attributes for playing muted mp4 as a gif - * - * @type {boolean} */ attributes.autoplay = true; attributes.loop = true; @@ -269,16 +260,12 @@ public nodes: Nodes; /** * Change event to be listened - * - * @type {string} */ eventName = 'loadeddata'; } /** * Compose tag with defined attributes - * - * @type {Element} */ this.nodes.imageEl = make(tag, this.CSS.imageEl, attributes); @@ -301,9 +288,8 @@ public nodes: Nodes; /** * Shows caption input - * - * @param {string} text - caption text - * @returns {void} + * @param text - caption text + * @returns */ fillCaption(text: string): void { if (this.nodes.caption) { @@ -313,27 +299,24 @@ public nodes: Nodes; /** * Changes UI status - * - * @param {string} status - see {@link Ui.status} constants - * @returns {void} + * @param status - see {@link Ui.status} constants + * @returns */ toggleStatus(status: UiState): void { for (const statusType in UiState) { if (Object.prototype.hasOwnProperty.call(UiState, statusType)) { - this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${UiState[statusType as keyof typeof UiState]}`, status === UiState[statusType as keyof typeof UiState]); + this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${UiState[statusType as keyof typeof UiState]}`, status === UiState[statusType as keyof typeof UiState]); } } } /** * Apply visual representation of activated tune - * - * @param {string} tuneName - one of available tunes {@link Tunes.tunes} - * @param {boolean} status - true for enable, false for disable - * @returns {void} + * @param tuneName - one of available tunes {@link Tunes.tunes} + * @param status - true for enable, false for disable + * @returns */ applyTune(tuneName: string, status: boolean): void { this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${tuneName}`, status); } } - diff --git a/src/uploader.ts b/src/uploader.ts index 32d7b39f..73b6c417 100644 --- a/src/uploader.ts +++ b/src/uploader.ts @@ -1,7 +1,7 @@ import ajax from '@codexteam/ajax'; import isPromise from './utils/isPromise'; -import { UploadOptions } from './types/types'; -import { UploadResponseFormat, ImageConfig } from './types/types'; +import type { UploadOptions } from './types/types'; +import type { UploadResponseFormat, ImageConfig } from './types/types'; /** * Params interface for Uploader constructor @@ -12,13 +12,13 @@ interface UploaderParams { */ config: ImageConfig; /** - * + * * @param response: Callback function for successful upload * @returns void */ onUpload: (response: UploadResponseFormat) => void; /** - * + * * @param error : error type * @returns void */ @@ -36,10 +36,10 @@ export default class Uploader { private onUpload: (response: UploadResponseFormat) => void; private onError: (error: any) => void; /** - * @param {object} params - uploader module params - * @param {ImageConfig} params.config - image tool config - * @param {Function} params.onUpload - one callback for all uploading (file, url, d-n-d, pasting) - * @param {Function} params.onError - callback for uploading errors + * @param params - uploader module params + * @param params.config - image tool config + * @param params.onUpload - one callback for all uploading (file, url, d-n-d, pasting) + * @param params.onError - callback for uploading errors */ constructor({ config, onUpload, onError }: UploaderParams) { this.config = config; @@ -50,8 +50,7 @@ export default class Uploader { /** * Handle clicks on the upload file button * Fires ajax.transport() - * - * @param {Function} onPreview - callback fired when preview is ready + * @param onPreview - callback fired when preview is ready */ uploadSelectedFile({ onPreview }: UploadOptions) { const preparePreview = function (file: File) { @@ -72,7 +71,8 @@ export default class Uploader { // custom uploading if (this.config.uploader && typeof this.config.uploader.uploadByFile === 'function') { const uploadByFile = this.config.uploader.uploadByFile; - upload = ajax.selectFiles({ accept: this.config.types || 'image/*'}).then((files: File[]) => { + + upload = ajax.selectFiles({ accept: this.config.types || 'image/*' }).then((files: File[]) => { preparePreview(files[0]); const customUpload = uploadByFile(files[0]); @@ -81,7 +81,7 @@ export default class Uploader { console.warn('Custom uploader method uploadByFile should return a Promise'); } - return customUpload as Promise; + return customUpload; }); // default uploading @@ -108,8 +108,7 @@ export default class Uploader { /** * Handle clicks on the upload file button * Fires ajax.post() - * - * @param {string} url - image source url + * @param url - image source url */ uploadByUrl(url: string) { let upload; @@ -147,15 +146,12 @@ export default class Uploader { /** * Handle clicks on the upload file button * Fires ajax.post() - * - * @param {File} file - file pasted by drag-n-drop - * @param {Function} onPreview - file pasted by drag-n-drop + * @param file - file pasted by drag-n-drop + * @param onPreview - file pasted by drag-n-drop */ uploadByFile(file: Blob, { onPreview }: UploadOptions) { /** * Load file for preview - * - * @type {FileReader} */ const reader = new FileReader(); @@ -204,4 +200,3 @@ export default class Uploader { }); } } - diff --git a/src/utils/dom.ts b/src/utils/dom.ts index 99721bf9..a45aa0cd 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -1,10 +1,9 @@ /** * Helper for making Elements with attributes - * - * @param {string} tagName - new Element tag name - * @param {Array|string} classNames - list or name of CSS class - * @param {object} attributes - any attributes - * @returns {Element} + * @param tagName - new Element tag name + * @param classNames - list or name of CSS class + * @param attributes - any attributes + * @returns */ export function make(tagName: string, classNames: string[] | string | null = null, attributes: { [key: string]: any } = {}): HTMLElement { const el = document.createElement(tagName); diff --git a/src/utils/isPromise.ts b/src/utils/isPromise.ts index d19929f8..e7421256 100644 --- a/src/utils/isPromise.ts +++ b/src/utils/isPromise.ts @@ -1,8 +1,7 @@ /** * Check if passed object is a Promise - * - * @param {*} object - object to check - * @returns {boolean} + * @param object - object to check + * @returns */ export default function isPromise(object: any): object is Promise { return object && typeof object.then === 'function'; diff --git a/tsconfig.json b/tsconfig.json index 4330a4a3..3454236b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,6 +11,5 @@ /* Type Checking */ "strict": true, /* Enable all strict type-checking options. */ }, - "include": ["src/*", - "src/types/**/*"] + "include": ["src/**/*.ts"] } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 3f2a27c5..42a3be0b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,28 +2,6 @@ # yarn lockfile v1 -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" - -"@babel/helper-validator-identifier@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" - integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== - -"@babel/highlight@^7.10.4": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d" - integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw== - dependencies: - "@babel/helper-validator-identifier" "^7.24.7" - chalk "^2.4.2" - js-tokens "^4.0.0" - picocolors "^1.0.0" - "@babel/parser@^7.24.7": version "7.24.7" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.7.tgz#9a5226f92f0c5c8ead550b750f5608e766c8ce85" @@ -171,7 +149,7 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz#acad351d582d157bb145535db2a6ff53dd514b5c" integrity sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw== -"@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.4.0": +"@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== @@ -183,39 +161,59 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.1.tgz#361461e5cb3845d874e61731c11cfedd664d83a0" integrity sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA== -"@eslint/eslintrc@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" - integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== +"@eslint-community/regexpp@^4.11.0": + version "4.11.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae" + integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A== + +"@eslint/config-array@^0.17.0": + version "0.17.0" + resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.17.0.tgz#ff305e1ee618a00e6e5d0485454c8d92d94a860d" + integrity sha512-A68TBu6/1mHHuc5YJL0U0VVeGNiklLAL6rRmhTCP2B5XjWLMnrX+HkO+IAXyHvks5cyyY1jjK5ITPQ1HGS2EVA== + dependencies: + "@eslint/object-schema" "^2.1.4" + debug "^4.3.1" + minimatch "^3.1.2" + +"@eslint/eslintrc@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.1.0.tgz#dbd3482bfd91efa663cbe7aa1f506839868207b6" + integrity sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ== dependencies: ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" - globals "^13.9.0" - ignore "^4.0.6" + debug "^4.3.2" + espree "^10.0.1" + globals "^14.0.0" + ignore "^5.2.0" import-fresh "^3.2.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" + js-yaml "^4.1.0" + minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@eslint/js@9.7.0": + version "9.7.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.7.0.tgz#b712d802582f02b11cfdf83a85040a296afec3f0" + integrity sha512-ChuWDQenef8OSFnvuxv0TCVxEwmu3+hPNKvM9B34qpM0rDRbjL8t5QkQeHHeAfsKQjuH9wS82WeCi1J/owatng== + "@eslint/js@^9.1.1": version "9.5.0" resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.5.0.tgz#0e9c24a670b8a5c86bff97b40be13d8d8f238045" integrity sha512-A7+AOT2ICkodvtsWnxZP4Xxk3NbZ3VMHd8oihydLRGrJgqqdEz1qSeEgXYyT/Cu8h1TWWsQRejIx48mtjZ5y1w== -"@humanwhocodes/config-array@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" - integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== - dependencies: - "@humanwhocodes/object-schema" "^1.2.0" - debug "^4.1.1" - minimatch "^3.0.4" +"@eslint/object-schema@^2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.4.tgz#9e69f8bb4031e11df79e03db09f9dbbae1740843" + integrity sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ== -"@humanwhocodes/object-schema@^1.2.0": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" - integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/retry@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.0.tgz#6d86b8cb322660f03d3f0aa94b99bdd8e172d570" + integrity sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew== "@jridgewell/sourcemap-codec@^1.4.15": version "1.4.15" @@ -278,7 +276,7 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== -"@nodelib/fs.walk@^1.2.3": +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== @@ -495,30 +493,30 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== -"@typescript-eslint/eslint-plugin@^7.13.1": - version "7.13.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.13.1.tgz#cdc521c8bca38b55585cf30db787fb2abad3f9fd" - integrity sha512-kZqi+WZQaZfPKnsflLJQCz6Ze9FFSMfXrrIOcyargekQxG37ES7DJNpJUE9Q/X5n3yTIP/WPutVNzgknQ7biLg== +"@typescript-eslint/eslint-plugin@7.16.1", "@typescript-eslint/eslint-plugin@^7.16.1": + version "7.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.16.1.tgz#f5f5da52db674b1f2cdb9d5f3644e5b2ec750465" + integrity sha512-SxdPak/5bO0EnGktV05+Hq8oatjAYVY3Zh2bye9pGZy6+jwyR3LG3YKkV4YatlsgqXP28BTeVm9pqwJM96vf2A== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "7.13.1" - "@typescript-eslint/type-utils" "7.13.1" - "@typescript-eslint/utils" "7.13.1" - "@typescript-eslint/visitor-keys" "7.13.1" + "@typescript-eslint/scope-manager" "7.16.1" + "@typescript-eslint/type-utils" "7.16.1" + "@typescript-eslint/utils" "7.16.1" + "@typescript-eslint/visitor-keys" "7.16.1" graphemer "^1.4.0" ignore "^5.3.1" natural-compare "^1.4.0" ts-api-utils "^1.3.0" -"@typescript-eslint/parser@^7.13.1": - version "7.13.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.13.1.tgz#fac57811b3e519185f7259bac312291f7b9c4e72" - integrity sha512-1ELDPlnLvDQ5ybTSrMhRTFDfOQEOXNM+eP+3HT/Yq7ruWpciQw+Avi73pdEbA4SooCawEWo3dtYbF68gN7Ed1A== +"@typescript-eslint/parser@7.16.1", "@typescript-eslint/parser@^7.16.1": + version "7.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.16.1.tgz#84c581cf86c8b2becd48d33ddc41a6303d57b274" + integrity sha512-u+1Qx86jfGQ5i4JjK33/FnawZRpsLxRnKzGE6EABZ40KxVT/vWsiZFEBBHjFOljmmV3MBYOHEKi0Jm9hbAOClA== dependencies: - "@typescript-eslint/scope-manager" "7.13.1" - "@typescript-eslint/types" "7.13.1" - "@typescript-eslint/typescript-estree" "7.13.1" - "@typescript-eslint/visitor-keys" "7.13.1" + "@typescript-eslint/scope-manager" "7.16.1" + "@typescript-eslint/types" "7.16.1" + "@typescript-eslint/typescript-estree" "7.16.1" + "@typescript-eslint/visitor-keys" "7.16.1" debug "^4.3.4" "@typescript-eslint/scope-manager@6.21.0": @@ -529,21 +527,21 @@ "@typescript-eslint/types" "6.21.0" "@typescript-eslint/visitor-keys" "6.21.0" -"@typescript-eslint/scope-manager@7.13.1": - version "7.13.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.13.1.tgz#c08041206904bf36f0e6997efdb0ca775e0c452e" - integrity sha512-adbXNVEs6GmbzaCpymHQ0MB6E4TqoiVbC0iqG3uijR8ZYfpAXMGttouQzF4Oat3P2GxDVIrg7bMI/P65LiQZdg== +"@typescript-eslint/scope-manager@7.16.1": + version "7.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.16.1.tgz#2b43041caabf8ddd74512b8b550b9fc53ca3afa1" + integrity sha512-nYpyv6ALte18gbMz323RM+vpFpTjfNdyakbf3nsLvF43uF9KeNC289SUEW3QLZ1xPtyINJ1dIsZOuWuSRIWygw== dependencies: - "@typescript-eslint/types" "7.13.1" - "@typescript-eslint/visitor-keys" "7.13.1" + "@typescript-eslint/types" "7.16.1" + "@typescript-eslint/visitor-keys" "7.16.1" -"@typescript-eslint/type-utils@7.13.1": - version "7.13.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.13.1.tgz#63bec3f1fb43cf0bc409cbdb88ef96d118ca8632" - integrity sha512-aWDbLu1s9bmgPGXSzNCxELu+0+HQOapV/y+60gPXafR8e2g1Bifxzevaa+4L2ytCWm+CHqpELq4CSoN9ELiwCg== +"@typescript-eslint/type-utils@7.16.1": + version "7.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.16.1.tgz#4d7ae4f3d9e3c8cbdabae91609b1a431de6aa6ca" + integrity sha512-rbu/H2MWXN4SkjIIyWcmYBjlp55VT+1G3duFOIukTNFxr9PI35pLc2ydwAfejCEitCv4uztA07q0QWanOHC7dA== dependencies: - "@typescript-eslint/typescript-estree" "7.13.1" - "@typescript-eslint/utils" "7.13.1" + "@typescript-eslint/typescript-estree" "7.16.1" + "@typescript-eslint/utils" "7.16.1" debug "^4.3.4" ts-api-utils "^1.3.0" @@ -552,7 +550,12 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== -"@typescript-eslint/types@7.13.1", "@typescript-eslint/types@^7.2.0": +"@typescript-eslint/types@7.16.1": + version "7.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.16.1.tgz#bbab066276d18e398bc64067b23f1ce84dfc6d8c" + integrity sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ== + +"@typescript-eslint/types@^7.2.0": version "7.13.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.13.1.tgz#787db283bd0b58751094c90d5b58bbf5e9fc9bd8" integrity sha512-7K7HMcSQIAND6RBL4kDl24sG/xKM13cA85dc7JnmQXw2cBDngg7c19B++JzvJHRG3zG36n9j1i451GBzRuHchw== @@ -571,13 +574,13 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/typescript-estree@7.13.1": - version "7.13.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.13.1.tgz#3412841b130e070db2f675e3d9b8cb1ae49e1c3f" - integrity sha512-uxNr51CMV7npU1BxZzYjoVz9iyjckBduFBP0S5sLlh1tXYzHzgZ3BR9SVsNed+LmwKrmnqN3Kdl5t7eZ5TS1Yw== +"@typescript-eslint/typescript-estree@7.16.1": + version "7.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.16.1.tgz#9b145ba4fd1dde1986697e1ce57dc501a1736dd3" + integrity sha512-0vFPk8tMjj6apaAZ1HlwM8w7jbghC8jc1aRNJG5vN8Ym5miyhTQGMqU++kuBFDNKe9NcPeZ6x0zfSzV8xC1UlQ== dependencies: - "@typescript-eslint/types" "7.13.1" - "@typescript-eslint/visitor-keys" "7.13.1" + "@typescript-eslint/types" "7.16.1" + "@typescript-eslint/visitor-keys" "7.16.1" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" @@ -585,15 +588,15 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/utils@7.13.1": - version "7.13.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.13.1.tgz#611083379caa0d3a2c09d126c65065a3e4337ba2" - integrity sha512-h5MzFBD5a/Gh/fvNdp9pTfqJAbuQC4sCN2WzuXme71lqFJsZtLbjxfSk4r3p02WIArOF9N94pdsLiGutpDbrXQ== +"@typescript-eslint/utils@7.16.1": + version "7.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.16.1.tgz#df42dc8ca5a4603016fd102db0346cdab415cdb7" + integrity sha512-WrFM8nzCowV0he0RlkotGDujx78xudsxnGMBHI88l5J8wEhED6yBwaSLP99ygfrzAjsQvcYQ94quDwI0d7E1fA== dependencies: "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "7.13.1" - "@typescript-eslint/types" "7.13.1" - "@typescript-eslint/typescript-estree" "7.13.1" + "@typescript-eslint/scope-manager" "7.16.1" + "@typescript-eslint/types" "7.16.1" + "@typescript-eslint/typescript-estree" "7.16.1" "@typescript-eslint/utils@^6.21.0": version "6.21.0" @@ -616,12 +619,12 @@ "@typescript-eslint/types" "6.21.0" eslint-visitor-keys "^3.4.1" -"@typescript-eslint/visitor-keys@7.13.1": - version "7.13.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.13.1.tgz#9c229a795a919db61f2d7f2337ef584ac05fbe96" - integrity sha512-k/Bfne7lrP7hcb7m9zSsgcBmo+8eicqqfNAJ7uUY+jkTFpKeH2FSkWpFRtimBxgkyvqfu9jTPRbYOvud6isdXA== +"@typescript-eslint/visitor-keys@7.16.1": + version "7.16.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.16.1.tgz#4287bcf44c34df811ff3bb4d269be6cfc7d8c74b" + integrity sha512-Qlzzx4sE4u3FsHTPQAAQFJFNOuqtuY0LFrZHwQ8IHK705XxBiWOFkfKRWu6niB7hwfgnwIpO4jTC75ozW1PHWg== dependencies: - "@typescript-eslint/types" "7.13.1" + "@typescript-eslint/types" "7.16.1" eslint-visitor-keys "^3.4.3" "@volar/language-core@1.11.1", "@volar/language-core@~1.11.1": @@ -685,27 +688,27 @@ resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.4.29.tgz#84908c284e88a269f8bceee59707b14eb4b2d284" integrity sha512-hQ2gAQcBO/CDpC82DCrinJNgOHI2v+FA7BDW4lMSPeBpQ7sRe2OLHWe5cph1s7D8DUQAwRt18dBDfJJ220APEA== -acorn-jsx@^5.3.1, acorn-jsx@^5.3.2: +acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^7.4.0: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - acorn@^8.11.3, acorn@^8.9.0: version "8.12.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.0.tgz#1627bfa2e058148036133b8d9b51a700663c294c" integrity sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw== +acorn@^8.12.0: + version "8.12.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" + integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== + ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4, ajv@~6.12.6: +ajv@^6.12.3, ajv@^6.12.4, ajv@~6.12.6: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -715,34 +718,12 @@ ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4, ajv@~6.12.6: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.1: - version "8.16.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.16.0.tgz#22e2a92b94f005f7e0f9c9d39652ef0b8f6f0cb4" - integrity sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw== - dependencies: - fast-deep-equal "^3.1.3" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.4.1" - -ansi-colors@^4.1.1: - version "4.1.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" - integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== - ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: +ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -754,7 +735,12 @@ are-docs-informative@^0.0.2: resolved "https://registry.yarnpkg.com/are-docs-informative/-/are-docs-informative-0.0.2.tgz#387f0e93f5d45280373d387a59d34c96db321963" integrity sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig== -argparse@^1.0.7, argparse@~1.0.9: +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +argparse@~1.0.9: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== @@ -849,11 +835,6 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== -astral-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" - integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -941,15 +922,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - chalk@^4.0.0: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" @@ -958,13 +930,6 @@ chalk@^4.0.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -972,11 +937,6 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -1079,7 +1039,7 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.0.1, debug@^4.1.1, debug@^4.3.4: +debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.5" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== @@ -1136,13 +1096,6 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -1151,11 +1104,6 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - emojis-list@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" @@ -1169,14 +1117,6 @@ enhanced-resolve@^5.17.0: graceful-fs "^4.2.4" tapable "^2.2.0" -enquirer@^2.3.5: - version "2.4.1" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" - integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== - dependencies: - ansi-colors "^4.1.1" - strip-ansi "^6.0.1" - entities@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" @@ -1307,11 +1247,6 @@ esbuild@^0.21.3: "@esbuild/win32-ia32" "0.21.5" "@esbuild/win32-x64" "0.21.5" -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - escape-string-regexp@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" @@ -1475,14 +1410,6 @@ eslint-plugin-vue@^9.25.0: vue-eslint-parser "^9.4.2" xml-name-validator "^4.0.0" -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - eslint-scope@^7.1.1: version "7.2.2" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" @@ -1491,82 +1418,72 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== +eslint-scope@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.0.2.tgz#5cbb33d4384c9136083a71190d548158fe128f94" + integrity sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA== dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - -eslint-visitor-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" - integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + esrecurse "^4.3.0" + estraverse "^5.2.0" eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint@^7.22.0: - version "7.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" - integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== - dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.3" - "@humanwhocodes/config-array" "^0.5.0" - ajv "^6.10.0" +eslint-visitor-keys@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz#e3adc021aa038a2a8e0b2f8b0ce8f66b9483b1fb" + integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== + +eslint@^9.7.0: + version "9.7.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.7.0.tgz#bedb48e1cdc2362a0caaa106a4c6ed943e8b09e4" + integrity sha512-FzJ9D/0nGiCGBf8UXO/IGLTgLVzIxze1zpfA8Ton2mjLovXdAPlYDv+MQDcqj3TmrhAGYfOpz9RfR+ent0AgAw== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.11.0" + "@eslint/config-array" "^0.17.0" + "@eslint/eslintrc" "^3.1.0" + "@eslint/js" "9.7.0" + "@humanwhocodes/module-importer" "^1.0.1" + "@humanwhocodes/retry" "^0.3.0" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" - debug "^4.0.1" - doctrine "^3.0.0" - enquirer "^2.3.5" + debug "^4.3.2" escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" - esquery "^1.4.0" + eslint-scope "^8.0.2" + eslint-visitor-keys "^4.0.0" + espree "^10.1.0" + esquery "^1.5.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" - globals "^13.6.0" - ignore "^4.0.6" - import-fresh "^3.0.0" + file-entry-cache "^8.0.0" + find-up "^5.0.0" + glob-parent "^6.0.2" + ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - js-yaml "^3.13.1" + is-path-inside "^3.0.3" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" - minimatch "^3.0.4" + minimatch "^3.1.2" natural-compare "^1.4.0" - optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" - strip-json-comments "^3.1.0" - table "^6.0.9" + optionator "^0.9.3" + strip-ansi "^6.0.1" text-table "^0.2.0" - v8-compile-cache "^2.0.3" -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== +espree@^10.0.1, espree@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.1.0.tgz#8788dae611574c0f070691f522e4116c5a11fc56" + integrity sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA== dependencies: - acorn "^7.4.0" - acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" + acorn "^8.12.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^4.0.0" espree@^9.3.1, espree@^9.6.1: version "9.6.1" @@ -1577,11 +1494,6 @@ espree@^9.3.1, espree@^9.6.1: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.4.1" -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - esquery@^1.4.0, esquery@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" @@ -1596,11 +1508,6 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" @@ -1664,12 +1571,12 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== +file-entry-cache@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" + integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== dependencies: - flat-cache "^3.0.4" + flat-cache "^4.0.0" fill-range@^7.1.1: version "7.1.1" @@ -1695,6 +1602,14 @@ find-up@^4.0.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + find-up@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-7.0.0.tgz#e8dec1455f74f78d888ad65bf7ca13dd2b4e66fb" @@ -1704,14 +1619,13 @@ find-up@^7.0.0: path-exists "^5.0.0" unicorn-magic "^0.1.0" -flat-cache@^3.0.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" - integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== +flat-cache@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c" + integrity sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw== dependencies: flatted "^3.2.9" - keyv "^4.5.3" - rimraf "^3.0.2" + keyv "^4.5.4" flatted@^3.2.9: version "3.3.1" @@ -1766,11 +1680,6 @@ fs-extra@~7.0.1: jsonfile "^4.0.0" universalify "^0.1.0" -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - fsevents@~2.3.2, fsevents@~2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" @@ -1791,11 +1700,6 @@ function.prototype.name@^1.1.6: es-abstract "^1.22.1" functions-have-names "^1.2.3" -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== - functions-have-names@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" @@ -1842,25 +1746,25 @@ glob-parent@^5.1.2: dependencies: is-glob "^4.0.1" -glob@^7.1.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" + is-glob "^4.0.3" -globals@^13.24.0, globals@^13.6.0, globals@^13.9.0: +globals@^13.24.0: version "13.24.0" resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== dependencies: type-fest "^0.20.2" +globals@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" + integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== + globals@^15.0.0: version "15.6.0" resolved "https://registry.yarnpkg.com/globals/-/globals-15.6.0.tgz#3872d3ab4427e1df4718efd3f7d2c721c503f65f" @@ -1921,11 +1825,6 @@ has-bigints@^1.0.1, has-bigints@^1.0.2: resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -1981,17 +1880,12 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - ignore@^5.2.0, ignore@^5.2.4, ignore@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== -import-fresh@^3.0.0, import-fresh@^3.2.1: +import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -2009,19 +1903,6 @@ imurmurhash@^0.1.4: resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - internal-slot@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.7.tgz#c06dcca3ed874249881007b0a5523b172a190802" @@ -2085,11 +1966,6 @@ is-extglob@^2.1.1: resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -2114,6 +1990,11 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -2182,18 +2063,12 @@ jju@~1.4.0: resolved "https://registry.yarnpkg.com/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a" integrity sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA== -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: - argparse "^1.0.7" - esprima "^4.0.0" + argparse "^2.0.1" jsbn@~0.1.0: version "0.1.1" @@ -2215,11 +2090,6 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - json-schema@0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" @@ -2264,7 +2134,7 @@ jsprim@^1.2.2: json-schema "0.4.0" verror "1.10.0" -keyv@^4.5.3: +keyv@^4.5.4: version "4.5.4" resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== @@ -2300,6 +2170,13 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + locate-path@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a" @@ -2322,11 +2199,6 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.truncate@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" - integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== - lodash@^4.17.21, lodash@~4.17.15: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -2385,7 +2257,7 @@ minimatch@9.0.3: dependencies: brace-expansion "^2.0.1" -minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: +minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -2501,14 +2373,14 @@ object.values@^1.1.7: define-properties "^1.2.1" es-object-atoms "^1.0.0" -once@^1.3.0, once@^1.4.0: +once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" -optionator@^0.9.1: +optionator@^0.9.3: version "0.9.4" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== @@ -2527,6 +2399,13 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + p-limit@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" @@ -2541,6 +2420,13 @@ p-locate@^4.1.0: dependencies: p-limit "^2.2.0" +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + p-locate@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f" @@ -2580,11 +2466,6 @@ path-exists@^5.0.0: resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7" integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ== -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" @@ -2679,11 +2560,6 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - psl@^1.1.28: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" @@ -2714,11 +2590,6 @@ regexp.prototype.flags@^1.5.2: es-errors "^1.3.0" set-function-name "^2.0.1" -regexpp@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" - integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== - request@^2.88.0: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" @@ -2745,11 +2616,6 @@ request@^2.88.0: tunnel-agent "^0.6.0" uuid "^3.3.2" -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -2782,13 +2648,6 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - rollup@^4.13.0: version "4.18.0" resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.18.0.tgz#497f60f0c5308e4602cf41136339fbf87d5f5dda" @@ -2864,7 +2723,7 @@ semver@^6.0.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.2.1, semver@^7.3.6, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.2: +semver@^7.3.6, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.6.2: version "7.6.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== @@ -2925,15 +2784,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - source-map-js@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" @@ -2987,15 +2837,6 @@ string-argv@~0.3.1: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== -string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string.prototype.trim@^1.2.9: version "1.2.9" resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz#b6fa326d72d2c78b6df02f7759c73f8f6274faa4" @@ -3024,7 +2865,7 @@ string.prototype.trimstart@^1.0.8: define-properties "^1.2.1" es-object-atoms "^1.0.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -3036,18 +2877,11 @@ strip-bom@^3.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== -strip-json-comments@^3.1.0, strip-json-comments@^3.1.1, strip-json-comments@~3.1.1: +strip-json-comments@^3.1.1, strip-json-comments@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -3067,17 +2901,6 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -table@^6.0.9: - version "6.8.2" - resolved "https://registry.yarnpkg.com/table/-/table-6.8.2.tgz#c5504ccf201213fa227248bdc8c5569716ac6c58" - integrity sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA== - dependencies: - ajv "^8.0.1" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - tapable@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" @@ -3186,6 +3009,15 @@ typed-array-length@^1.0.6: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" +typescript-eslint@^7.16.1: + version "7.16.1" + resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-7.16.1.tgz#4855e11985b3dbd13a94b4e7e6523b2ec5d1c759" + integrity sha512-889oE5qELj65q/tGeOSvlreNKhimitFwZqQ0o7PcWC7/lgRkAMknznsCsV8J8mZGTP/Z+cIbX8accf2DE33hrA== + dependencies: + "@typescript-eslint/eslint-plugin" "7.16.1" + "@typescript-eslint/parser" "7.16.1" + "@typescript-eslint/utils" "7.16.1" + typescript@5.4.2: version "5.4.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.2.tgz#0ae9cebcfae970718474fe0da2c090cad6577372" @@ -3216,7 +3048,7 @@ universalify@^0.1.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -uri-js@^4.2.2, uri-js@^4.4.1: +uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== @@ -3233,11 +3065,6 @@ uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== -v8-compile-cache@^2.0.3: - version "2.4.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128" - integrity sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw== - validator@^13.7.0: version "13.12.0" resolved "https://registry.yarnpkg.com/validator/-/validator-13.12.0.tgz#7d78e76ba85504da3fee4fd1922b385914d4b35f" @@ -3360,6 +3187,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + yocto-queue@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" From 1d0321552721030ae5ca15ec91204ab82f1a7ef6 Mon Sep 17 00:00:00 2001 From: dependentmadani Date: Sun, 21 Jul 2024 02:47:07 +0100 Subject: [PATCH 06/14] update(eslint): eslint now is working fine --- eslint.config.mjs | 18 +++++++++ src/index.ts | 12 +++--- src/ui.ts | 87 ++++++++++++++++++++++-------------------- src/uploader.ts | 49 +++++++++++++----------- src/utils/dom.ts | 2 +- src/utils/isPromise.ts | 2 +- 6 files changed, 98 insertions(+), 72 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 7a183521..193d8c62 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -19,7 +19,10 @@ export default [ 'jsdoc/no-types': ['off'], 'jsdoc/require-returns-description': ['off'], 'jsdoc/check-tag-names': ['off'], + 'jsdoc/require-jsdoc': ['off'], + '@typescript-eslint/no-unsafe-assignment': ['off'], '@typescript-eslint/no-unsafe-member-access': ['off'], + '@typescript-eslint/no-explicit-any': ['off'], "@typescript-eslint/naming-convention": [ "error", { @@ -27,6 +30,21 @@ export default [ "format": ["camelCase"], "leadingUnderscore": "allow" }, + ], + "@typescript-eslint/ban-types": ["error", + { + "types": { + "String": true, + "Boolean": true, + "Number": true, + "Symbol": true, + "{}": false, + "Object": true, + "object": false, + "Function": false, + }, + "extendDefaults": true + } ] } }, diff --git a/src/index.ts b/src/index.ts index 6a3d6ec1..11b30e15 100644 --- a/src/index.ts +++ b/src/index.ts @@ -307,7 +307,7 @@ export default class ImageTool implements BlockTool { public async onPaste(event: CustomEvent): Promise { switch (event.type) { case 'tag': { - const image: { src: string } = event.detail.data; + const image = event.detail.data as { src: string }; /** Images from PDF */ if (/^blob:/.test(image.src)) { @@ -323,13 +323,13 @@ export default class ImageTool implements BlockTool { break; } case 'pattern': { - const url: string = event.detail.data; + const url = event.detail.data as string; this.uploadUrl(url); break; } case 'file': { - const file: Blob = event.detail.file; + const file = event.detail.file as Blob; this.uploadFile(file); break; @@ -389,7 +389,7 @@ export default class ImageTool implements BlockTool { * @returns {void} */ private onUpload(response: UploadResponseFormat): void { - if (response.success && response.file) { + if (response.success && response.file.url) { this.image = response.file; } else { this.uploadingFailed('incorrect response: ' + JSON.stringify(response)); @@ -399,7 +399,7 @@ export default class ImageTool implements BlockTool { /** * Handle uploader errors * @private - * @param {string} errorText - uploading error text + * @param {string} errorText - uploading error info * @returns {void} */ private uploadingFailed(errorText: string): void { @@ -420,7 +420,7 @@ export default class ImageTool implements BlockTool { */ private tuneToggled(tuneName: keyof ImageToolData): void { // inverse tune state - this.setTune(tuneName, !this._data[tuneName]); + this.setTune(tuneName, this._data[tuneName] != undefined ? false : true); } /** diff --git a/src/ui.ts b/src/ui.ts index c6e0a610..5eb9c18b 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -87,9 +87,14 @@ interface ConstructorParams { * - apply tune view */ export default class Ui { -/** - * API instance for Editor.js. - */ + /** + * Nodes representing various elements in the UI. + */ + public nodes: Nodes; + + /** + * API instance for Editor.js. + */ private api: API; /** @@ -108,15 +113,11 @@ export default class Ui { private readOnly: boolean; /** - * Nodes representing various elements in the UI. - */ - public nodes: Nodes; - /** - * @param ui - image tool Ui module - * @param ui.api - Editor.js API - * @param ui.config - user config - * @param ui.onSelectFile - callback for clicks on Select file button - * @param ui.readOnly - read-only mode flag + * @param {object} ui - image tool Ui module + * @param {object} ui.api - Editor.js API + * @param {ImageConfig} ui.config - user config + * @param {Function} ui.onSelectFile - callback for clicks on Select file button + * @param {boolean} ui.readOnly - read-only mode flag */ constructor({ api, config, onSelectFile, readOnly }: ConstructorParams) { this.api = api; @@ -153,9 +154,9 @@ export default class Ui { /** * CSS classes - * @returns + * @returns {object} */ - get CSS(): Record { + public get CSS(): Record { return { baseClass: this.api.styles.block, loading: this.api.styles.loader, @@ -175,11 +176,11 @@ export default class Ui { /** * Renders tool UI - * @param toolData - saved tool data - * @returns + * @param {ImageToolData} toolData - saved tool data + * @returns {Element} */ - render(toolData: ImageToolData): HTMLElement { - if (!toolData.file || Object.keys(toolData.file).length === 0) { + public render(toolData: ImageToolData): HTMLElement { + if (toolData.file == undefined || Object.keys(toolData.file).length === 0) { this.toggleStatus(UiState.Empty); } else { this.toggleStatus(UiState.Uploading); @@ -190,12 +191,12 @@ export default class Ui { /** * Creates upload-file button - * @returns + * @returns {Element} */ - createFileButton(): HTMLElement { + public createFileButton(): HTMLElement { const button = make('div', [this.CSS.button]); - button.innerHTML = this.config.buttonContent || `${IconPicture} ${this.api.i18n.t('Select an Image')}`; + button.innerHTML = this.config.buttonContent != undefined ? this.config.buttonContent : `${IconPicture} ${this.api.i18n.t('Select an Image')}`; button.addEventListener('click', () => { this.onSelectFile(); @@ -206,10 +207,10 @@ export default class Ui { /** * Shows uploading preloader - * @param src - preview source - * @returns + * @param {string} src - preview source + * @returns {void} */ - showPreloader(src: string): void { + public showPreloader(src: string): void { this.nodes.imagePreloader.style.backgroundImage = `url(${src})`; this.toggleStatus(UiState.Uploading); @@ -217,19 +218,19 @@ export default class Ui { /** * Hide uploading preloader - * @returns + * @returns {void} */ - hidePreloader(): void { + public hidePreloader(): void { this.nodes.imagePreloader.style.backgroundImage = ''; this.toggleStatus(UiState.Empty); } /** * Shows an image - * @param url - image source - * @returns + * @param {string} url - image source + * @returns {void} */ - fillImage(url: string): void { + public fillImage(url: string): void { /** * Check for a source extension to compose element correctly: video tag for mp4, img — for others */ @@ -243,6 +244,7 @@ export default class Ui { * We use eventName variable because IMG and VIDEO tags have different event to be called on source load * - IMG: load * - VIDEO: loadeddata + * @type {string} */ let eventName = 'load'; @@ -252,6 +254,7 @@ export default class Ui { if (tag === 'VIDEO') { /** * Add attributes for playing muted mp4 as a gif + * @type {boolean} */ attributes.autoplay = true; attributes.loop = true; @@ -260,12 +263,14 @@ export default class Ui { /** * Change event to be listened + * @type {string} */ eventName = 'loadeddata'; } /** * Compose tag with defined attributes + * @type {Element} */ this.nodes.imageEl = make(tag, this.CSS.imageEl, attributes); @@ -278,7 +283,7 @@ export default class Ui { /** * Preloader does not exists on first rendering with presaved data */ - if (this.nodes.imagePreloader) { + if (this.nodes.imagePreloader != undefined) { this.nodes.imagePreloader.style.backgroundImage = ''; } }); @@ -288,21 +293,21 @@ export default class Ui { /** * Shows caption input - * @param text - caption text - * @returns + * @param {string} text - caption content text + * @returns {void} */ - fillCaption(text: string): void { - if (this.nodes.caption) { + public fillCaption(text: string): void { + if (this.nodes.caption != undefined) { this.nodes.caption.innerHTML = text; } } /** * Changes UI status - * @param status - see {@link Ui.status} constants - * @returns + * @param {string} status - see {@link Ui.status} constants + * @returns {void} */ - toggleStatus(status: UiState): void { + public toggleStatus(status: UiState): void { for (const statusType in UiState) { if (Object.prototype.hasOwnProperty.call(UiState, statusType)) { this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${UiState[statusType as keyof typeof UiState]}`, status === UiState[statusType as keyof typeof UiState]); @@ -312,11 +317,11 @@ export default class Ui { /** * Apply visual representation of activated tune - * @param tuneName - one of available tunes {@link Tunes.tunes} - * @param status - true for enable, false for disable - * @returns + * @param {string} tuneName - one of available tunes {@link Tunes.tunes} + * @param {boolean} status - true for enable, false for disable + * @returns {void} */ - applyTune(tuneName: string, status: boolean): void { + public applyTune(tuneName: string, status: boolean): void { this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${tuneName}`, status); } } diff --git a/src/uploader.ts b/src/uploader.ts index 73b6c417..9d904c0d 100644 --- a/src/uploader.ts +++ b/src/uploader.ts @@ -11,12 +11,14 @@ interface UploaderParams { * Configuration for the uploader */ config: ImageConfig; + /** - * - * @param response: Callback function for successful upload - * @returns void + * Handles the upload response. + * @param {UploadResponseFormat} response - Response format expected from the backend on file uploading. + * @returns {void} */ onUpload: (response: UploadResponseFormat) => void; + /** * * @param error : error type @@ -36,10 +38,10 @@ export default class Uploader { private onUpload: (response: UploadResponseFormat) => void; private onError: (error: any) => void; /** - * @param params - uploader module params - * @param params.config - image tool config - * @param params.onUpload - one callback for all uploading (file, url, d-n-d, pasting) - * @param params.onError - callback for uploading errors + * @param {object} params - uploader module params + * @param {ImageConfig} params.config - image tool config + * @param {Function} params.onUpload - one callback for all uploading (file, url, d-n-d, pasting) + * @param {Function} params.onError - callback for uploading errors */ constructor({ config, onUpload, onError }: UploaderParams) { this.config = config; @@ -50,10 +52,10 @@ export default class Uploader { /** * Handle clicks on the upload file button * Fires ajax.transport() - * @param onPreview - callback fired when preview is ready + * @param {Function} onPreview - callback fired when preview is ready */ - uploadSelectedFile({ onPreview }: UploadOptions) { - const preparePreview = function (file: File) { + public uploadSelectedFile({ onPreview }: UploadOptions): void { + const preparePreview = function (file: File): void { const reader = new FileReader(); reader.readAsDataURL(file); @@ -72,7 +74,7 @@ export default class Uploader { if (this.config.uploader && typeof this.config.uploader.uploadByFile === 'function') { const uploadByFile = this.config.uploader.uploadByFile; - upload = ajax.selectFiles({ accept: this.config.types || 'image/*' }).then((files: File[]) => { + upload = ajax.selectFiles({ accept: this.config.types != undefined ? this.config.types : 'image/*' }).then((files: File[]) => { preparePreview(files[0]); const customUpload = uploadByFile(files[0]); @@ -89,13 +91,13 @@ export default class Uploader { upload = ajax.transport({ url: this.config.endpoints.byFile, data: this.config.additionalRequestData, - accept: this.config.types || 'image/*', + accept: this.config.types != undefined ? this.config.types : 'image/*', headers: this.config.additionalRequestHeaders as Record, beforeSend: (files: File[]) => { preparePreview(files[0]); }, - fieldName: this.config.field || 'image', - }).then((response: any) => response.body); + fieldName: this.config.field != undefined ? this.config.field : 'image', + }).then((response: any) => response.body as UploadResponseFormat); } upload.then((response) => { @@ -108,9 +110,9 @@ export default class Uploader { /** * Handle clicks on the upload file button * Fires ajax.post() - * @param url - image source url + * @param {string} url - image source url */ - uploadByUrl(url: string) { + public uploadByUrl(url: string): void { let upload; /** @@ -133,7 +135,7 @@ export default class Uploader { }, this.config.additionalRequestData), type: ajax.contentType.JSON, headers: this.config.additionalRequestHeaders as Record, - }).then((response: any) => response.body); + }).then((response: any) => response.body as UploadResponseFormat); } upload.then((response: UploadResponseFormat) => { @@ -146,12 +148,13 @@ export default class Uploader { /** * Handle clicks on the upload file button * Fires ajax.post() - * @param file - file pasted by drag-n-drop - * @param onPreview - file pasted by drag-n-drop + * @param {File} file - file pasted by drag-n-drop + * @param {Function} onPreview - file pasted by drag-n-drop */ - uploadByFile(file: Blob, { onPreview }: UploadOptions) { + public uploadByFile(file: Blob, { onPreview }: UploadOptions): void { /** * Load file for preview + * @type {FileReader} */ const reader = new FileReader(); @@ -177,10 +180,10 @@ export default class Uploader { */ const formData = new FormData(); - formData.append(this.config.field || 'image', file); + formData.append(this.config.field != undefined ? this.config.field : 'image', file); if (this.config.additionalRequestData && Object.keys(this.config.additionalRequestData).length) { - Object.entries(this.config.additionalRequestData).forEach(([name, value]: [string, any]) => { + Object.entries(this.config.additionalRequestData).forEach(([name, value]: [string, string | Blob]) => { formData.append(name, value); }); } @@ -190,7 +193,7 @@ export default class Uploader { data: formData, type: ajax.contentType.JSON, headers: this.config.additionalRequestHeaders as Record, - }).then((response: any) => response.body); + }).then((response: any) => response.body as UploadResponseFormat); } upload.then((response) => { diff --git a/src/utils/dom.ts b/src/utils/dom.ts index a45aa0cd..7cb6deb8 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -10,7 +10,7 @@ export function make(tagName: string, classNames: string[] | string | null = nul if (Array.isArray(classNames)) { el.classList.add(...classNames); - } else if (classNames) { + } else if (classNames != null) { el.classList.add(classNames); } diff --git a/src/utils/isPromise.ts b/src/utils/isPromise.ts index e7421256..fc04ce3b 100644 --- a/src/utils/isPromise.ts +++ b/src/utils/isPromise.ts @@ -4,5 +4,5 @@ * @returns */ export default function isPromise(object: any): object is Promise { - return object && typeof object.then === 'function'; + return object != undefined && typeof object.then === 'function'; } From 24aef36ac6e4d19282e2116e1822d676eb1f782c Mon Sep 17 00:00:00 2001 From: dependentmadani Date: Sun, 21 Jul 2024 17:45:09 +0100 Subject: [PATCH 07/14] update(eslint): modification based last review --- eslint.config.mjs | 3 -- src/index.ts | 14 ++--- src/types/codexteam__ajax.d.ts | 4 +- src/types/types.ts | 18 +++++++ src/ui.ts | 94 +++++++++++++++++----------------- src/uploader.ts | 25 ++++----- src/utils/dom.ts | 4 +- src/utils/isPromise.ts | 4 +- 8 files changed, 92 insertions(+), 74 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 193d8c62..4a1567df 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -20,9 +20,6 @@ export default [ 'jsdoc/require-returns-description': ['off'], 'jsdoc/check-tag-names': ['off'], 'jsdoc/require-jsdoc': ['off'], - '@typescript-eslint/no-unsafe-assignment': ['off'], - '@typescript-eslint/no-unsafe-member-access': ['off'], - '@typescript-eslint/no-explicit-any': ['off'], "@typescript-eslint/naming-convention": [ "error", { diff --git a/src/index.ts b/src/index.ts index 11b30e15..9208da01 100644 --- a/src/index.ts +++ b/src/index.ts @@ -30,14 +30,14 @@ */ import type { TunesMenuConfig } from '@editorjs/editorjs/types/tools'; -import type { API, ToolboxConfig, PasteConfig, BlockToolConstructorOptions, BlockTool, BlockAPI } from '@editorjs/editorjs'; +import type { API, ToolboxConfig, PasteConfig, BlockToolConstructorOptions, BlockTool, BlockAPI, PasteEvent, PatternPasteEventDetail, FilePasteEventDetail } from '@editorjs/editorjs'; import './index.css'; import Ui from './ui'; import Uploader from './uploader'; import { IconAddBorder, IconStretch, IconAddBackground, IconPicture } from '@codexteam/icons'; -import type { ActionConfig, UploadResponseFormat, ImageToolData, ImageConfig } from './types/types'; +import type { ActionConfig, UploadResponseFormat, ImageToolData, ImageConfig, HTMLPasteEventDetailExtended } from './types/types'; type ImageToolConstructorOptions = BlockToolConstructorOptions; @@ -102,7 +102,7 @@ export default class ImageTool implements BlockTool { additionalRequestHeaders: config.additionalRequestHeaders, field: config.field, types: config.types, - captionPlaceholder: this.api.i18n.t(config.captionPlaceholder != undefined ? config.captionPlaceholder : 'Caption'), + captionPlaceholder: this.api.i18n.t(config.captionPlaceholder ?? 'Caption'), buttonContent: config.buttonContent, uploader: config.uploader, actions: config.actions, @@ -304,10 +304,10 @@ export default class ImageTool implements BlockTool { * {@link https://github.com/codex-team/editor.js/blob/master/types/tools/paste-events.d.ts} * @returns {void} */ - public async onPaste(event: CustomEvent): Promise { + public async onPaste(event: PasteEvent): Promise { switch (event.type) { case 'tag': { - const image = event.detail.data as { src: string }; + const image = (event.detail as HTMLPasteEventDetailExtended).data; /** Images from PDF */ if (/^blob:/.test(image.src)) { @@ -323,13 +323,13 @@ export default class ImageTool implements BlockTool { break; } case 'pattern': { - const url = event.detail.data as string; + const url = (event.detail as PatternPasteEventDetail).data; this.uploadUrl(url); break; } case 'file': { - const file = event.detail.file as Blob; + const file = (event.detail as FilePasteEventDetail).file; this.uploadFile(file); break; diff --git a/src/types/codexteam__ajax.d.ts b/src/types/codexteam__ajax.d.ts index 347900f6..063fc395 100644 --- a/src/types/codexteam__ajax.d.ts +++ b/src/types/codexteam__ajax.d.ts @@ -1,7 +1,7 @@ declare module '@codexteam/ajax' { export interface AjaxOptions { url?: string; - data?: any; + data?: object; accept?: string; headers?: object; beforeSend?: (files: File[]) => void; @@ -9,7 +9,7 @@ declare module '@codexteam/ajax' { type?: string; } - export interface AjaxResponse { + export interface AjaxResponse { body: T; } diff --git a/src/types/types.ts b/src/types/types.ts index 0a139bd1..f162b428 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -1,3 +1,5 @@ +import type { HTMLPasteEventDetail } from '@editorjs/editorjs'; + /** * Represents options for uploading, including a function to handle previewing. */ @@ -165,3 +167,19 @@ export interface ImageConfig { */ actions?: ActionConfig[]; } + +/** + * Interface representing the details of a paste event for HTML elements. + * Extends the `HTMLPasteEventDetail` interface to include additional data properties. + */ +export interface HTMLPasteEventDetailExtended extends HTMLPasteEventDetail { + /** + * The data property containing the source of the image and HTML element details. + */ + data: { + /** + * The source URL of the pasted image. + */ + src: string; + } & HTMLElement; +} diff --git a/src/ui.ts b/src/ui.ts index 5eb9c18b..5096d025 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -153,26 +153,14 @@ export default class Ui { } /** - * CSS classes - * @returns {object} + * Apply visual representation of activated tune + * @param {string} tuneName - one of available tunes {@link Tunes.tunes} + * @param {boolean} status - true for enable, false for disable + * @returns {void} */ - public get CSS(): Record { - return { - baseClass: this.api.styles.block, - loading: this.api.styles.loader, - input: this.api.styles.input, - button: this.api.styles.button, - - /** - * Tool's classes - */ - wrapper: 'image-tool', - imageContainer: 'image-tool__image', - imagePreloader: 'image-tool__image-preloader', - imageEl: 'image-tool__image-picture', - caption: 'image-tool__caption', - }; - }; + public applyTune(tuneName: string, status: boolean): void { + this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${tuneName}`, status); + } /** * Renders tool UI @@ -189,22 +177,6 @@ export default class Ui { return this.nodes.wrapper; } - /** - * Creates upload-file button - * @returns {Element} - */ - public createFileButton(): HTMLElement { - const button = make('div', [this.CSS.button]); - - button.innerHTML = this.config.buttonContent != undefined ? this.config.buttonContent : `${IconPicture} ${this.api.i18n.t('Select an Image')}`; - - button.addEventListener('click', () => { - this.onSelectFile(); - }); - - return button; - } - /** * Shows uploading preloader * @param {string} src - preview source @@ -236,7 +208,7 @@ export default class Ui { */ const tag = /\.mp4$/.test(url) ? 'VIDEO' : 'IMG'; - const attributes: { [key: string]: any } = { + const attributes: { [key: string]: string | boolean } = { src: url, }; @@ -302,26 +274,54 @@ export default class Ui { } } + /** + * CSS classes + * @returns {object} + */ + private get CSS(): Record { + return { + baseClass: this.api.styles.block, + loading: this.api.styles.loader, + input: this.api.styles.input, + button: this.api.styles.button, + + /** + * Tool's classes + */ + wrapper: 'image-tool', + imageContainer: 'image-tool__image', + imagePreloader: 'image-tool__image-preloader', + imageEl: 'image-tool__image-picture', + caption: 'image-tool__caption', + }; + }; + + /** + * Creates upload-file button + * @returns {Element} + */ + private createFileButton(): HTMLElement { + const button = make('div', [this.CSS.button]); + + button.innerHTML = this.config.buttonContent ?? `${IconPicture} ${this.api.i18n.t('Select an Image')}`; + + button.addEventListener('click', () => { + this.onSelectFile(); + }); + + return button; + } + /** * Changes UI status * @param {string} status - see {@link Ui.status} constants * @returns {void} */ - public toggleStatus(status: UiState): void { + private toggleStatus(status: UiState): void { for (const statusType in UiState) { if (Object.prototype.hasOwnProperty.call(UiState, statusType)) { this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${UiState[statusType as keyof typeof UiState]}`, status === UiState[statusType as keyof typeof UiState]); } } } - - /** - * Apply visual representation of activated tune - * @param {string} tuneName - one of available tunes {@link Tunes.tunes} - * @param {boolean} status - true for enable, false for disable - * @returns {void} - */ - public applyTune(tuneName: string, status: boolean): void { - this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${tuneName}`, status); - } } diff --git a/src/uploader.ts b/src/uploader.ts index 9d904c0d..ecc0ceaa 100644 --- a/src/uploader.ts +++ b/src/uploader.ts @@ -1,4 +1,5 @@ import ajax from '@codexteam/ajax'; +import type { AjaxResponse } from '@codexteam/ajax'; import isPromise from './utils/isPromise'; import type { UploadOptions } from './types/types'; import type { UploadResponseFormat, ImageConfig } from './types/types'; @@ -24,7 +25,7 @@ interface UploaderParams { * @param error : error type * @returns void */ - onError: (error: any) => void; + onError: (error: string) => void; } /** @@ -36,7 +37,7 @@ interface UploaderParams { export default class Uploader { private config: ImageConfig; private onUpload: (response: UploadResponseFormat) => void; - private onError: (error: any) => void; + private onError: (error: string) => void; /** * @param {object} params - uploader module params * @param {ImageConfig} params.config - image tool config @@ -74,7 +75,7 @@ export default class Uploader { if (this.config.uploader && typeof this.config.uploader.uploadByFile === 'function') { const uploadByFile = this.config.uploader.uploadByFile; - upload = ajax.selectFiles({ accept: this.config.types != undefined ? this.config.types : 'image/*' }).then((files: File[]) => { + upload = ajax.selectFiles({ accept: this.config.types ?? 'image/*' }).then((files: File[]) => { preparePreview(files[0]); const customUpload = uploadByFile(files[0]); @@ -91,18 +92,18 @@ export default class Uploader { upload = ajax.transport({ url: this.config.endpoints.byFile, data: this.config.additionalRequestData, - accept: this.config.types != undefined ? this.config.types : 'image/*', + accept: this.config.types ?? 'image/*', headers: this.config.additionalRequestHeaders as Record, beforeSend: (files: File[]) => { preparePreview(files[0]); }, - fieldName: this.config.field != undefined ? this.config.field : 'image', - }).then((response: any) => response.body as UploadResponseFormat); + fieldName: this.config.field ?? 'image', + }).then((response: AjaxResponse) => response.body as UploadResponseFormat); } upload.then((response) => { this.onUpload(response); - }).catch((error) => { + }).catch((error: string) => { this.onError(error); }); } @@ -135,12 +136,12 @@ export default class Uploader { }, this.config.additionalRequestData), type: ajax.contentType.JSON, headers: this.config.additionalRequestHeaders as Record, - }).then((response: any) => response.body as UploadResponseFormat); + }).then((response: AjaxResponse) => response.body as UploadResponseFormat); } upload.then((response: UploadResponseFormat) => { this.onUpload(response); - }).catch((error: any) => { + }).catch((error: string) => { this.onError(error); }); } @@ -180,7 +181,7 @@ export default class Uploader { */ const formData = new FormData(); - formData.append(this.config.field != undefined ? this.config.field : 'image', file); + formData.append(this.config.field ?? 'image', file); if (this.config.additionalRequestData && Object.keys(this.config.additionalRequestData).length) { Object.entries(this.config.additionalRequestData).forEach(([name, value]: [string, string | Blob]) => { @@ -193,12 +194,12 @@ export default class Uploader { data: formData, type: ajax.contentType.JSON, headers: this.config.additionalRequestHeaders as Record, - }).then((response: any) => response.body as UploadResponseFormat); + }).then((response: AjaxResponse) => response.body as UploadResponseFormat); } upload.then((response) => { this.onUpload(response); - }).catch((error) => { + }).catch((error: string) => { this.onError(error); }); } diff --git a/src/utils/dom.ts b/src/utils/dom.ts index 7cb6deb8..6e3b959f 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -5,7 +5,7 @@ * @param attributes - any attributes * @returns */ -export function make(tagName: string, classNames: string[] | string | null = null, attributes: { [key: string]: any } = {}): HTMLElement { +export function make(tagName: string, classNames: string[] | string | null = null, attributes: { [key: string]: string | boolean } = {}): HTMLElement { const el = document.createElement(tagName); if (Array.isArray(classNames)) { @@ -16,7 +16,7 @@ export function make(tagName: string, classNames: string[] | string | null = nul for (const attrName in attributes) { if (attributes.hasOwnProperty(attrName)) { - (el as any)[attrName] = attributes[attrName]; + (el as unknown as { [key: string]: string | boolean })[attrName] = attributes[attrName]; } } diff --git a/src/utils/isPromise.ts b/src/utils/isPromise.ts index fc04ce3b..3e198bb0 100644 --- a/src/utils/isPromise.ts +++ b/src/utils/isPromise.ts @@ -1,8 +1,10 @@ +import type { UploadResponseFormat } from '../types/types'; + /** * Check if passed object is a Promise * @param object - object to check * @returns */ -export default function isPromise(object: any): object is Promise { +export default function isPromise(object: Promise): object is Promise { return object != undefined && typeof object.then === 'function'; } From 067c736bd3a4249d70788f6abcad3e5d6057a2aa Mon Sep 17 00:00:00 2001 From: dependentmadani Date: Mon, 22 Jul 2024 17:56:34 +0100 Subject: [PATCH 08/14] update(eslint): remove some rules from eslint configuration, and fix them --- eslint.config.mjs | 3 -- src/index.ts | 60 +++++++++++-------------------- src/types/codexteam__ajax.d.ts | 66 +++++++++++++++++++++++++++++++++- src/types/types.ts | 17 ++++++++- src/ui.ts | 39 ++++++++------------ src/uploader.ts | 17 +++++---- 6 files changed, 124 insertions(+), 78 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 4a1567df..eb2dbf69 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -16,10 +16,7 @@ export default [ rules: { 'n/no-missing-import': ['off'], 'n/no-unsupported-features/node-builtins': ['off'], - 'jsdoc/no-types': ['off'], 'jsdoc/require-returns-description': ['off'], - 'jsdoc/check-tag-names': ['off'], - 'jsdoc/require-jsdoc': ['off'], "@typescript-eslint/naming-convention": [ "error", { diff --git a/src/index.ts b/src/index.ts index 9208da01..68313000 100644 --- a/src/index.ts +++ b/src/index.ts @@ -37,7 +37,7 @@ import Ui from './ui'; import Uploader from './uploader'; import { IconAddBorder, IconStretch, IconAddBackground, IconPicture } from '@codexteam/icons'; -import type { ActionConfig, UploadResponseFormat, ImageToolData, ImageConfig, HTMLPasteEventDetailExtended } from './types/types'; +import type { ActionConfig, UploadResponseFormat, ImageToolData, ImageConfig, HTMLPasteEventDetailExtended, ImageSetterParam } from './types/types'; type ImageToolConstructorOptions = BlockToolConstructorOptions; @@ -150,7 +150,7 @@ export default class ImageTool implements BlockTool { /** * Notify core that read-only mode is supported - * @returns { boolean } + * @returns */ public static get isReadOnlySupported(): boolean { return true; @@ -160,7 +160,7 @@ export default class ImageTool implements BlockTool { * Get Tool toolbox settings * icon - Tool icon's SVG * title - title to show in toolbox - * @returns {{icon: string, title: string}} + * @returns */ public static get toolbox(): ToolboxConfig { return { @@ -171,7 +171,7 @@ export default class ImageTool implements BlockTool { /** * Available image tools - * @returns {Array} + * @returns */ public static get tunes(): Array { return [ @@ -198,8 +198,7 @@ export default class ImageTool implements BlockTool { /** * Renders Block content - * @public - * @returns {HTMLDivElement} + * @returns */ public render(): HTMLDivElement { return this.ui.render(this.data) as HTMLDivElement; @@ -207,9 +206,8 @@ export default class ImageTool implements BlockTool { /** * Validate data: check if Image exists - * @param {ImageToolData} savedData — data received after saving - * @returns {boolean} false if saved data is not correct, otherwise true - * @public + * @param savedData — data received after saving + * @returns false if saved data is not correct, otherwise true */ public validate(savedData: ImageToolData): boolean { return !!savedData.file.url; @@ -217,8 +215,7 @@ export default class ImageTool implements BlockTool { /** * Return Block data - * @public - * @returns {ImageToolData} + * @returns */ public save(): ImageToolData { const caption = this.ui.nodes.caption; @@ -230,7 +227,6 @@ export default class ImageTool implements BlockTool { /** * Returns configuration for block tunes: add background, add border, stretch image - * @public * @returns TunesMenuConfig */ public renderSettings(): TunesMenuConfig { @@ -259,7 +255,6 @@ export default class ImageTool implements BlockTool { /** * Fires after clicks on the Toolbox Image Icon * Initiates click on the Select File button - * @public */ public appendCallback(): void { this.ui.nodes.fileButton.click(); @@ -268,7 +263,7 @@ export default class ImageTool implements BlockTool { /** * Specify paste substitutes * @see {@link https://github.com/codex-team/editor.js/blob/master/docs/tools.md#paste-handling} - * @returns { PasteConfig } + * @returns */ public static get pasteConfig(): PasteConfig { return { @@ -298,11 +293,10 @@ export default class ImageTool implements BlockTool { /** * Specify paste handlers - * @public * @see {@link https://github.com/codex-team/editor.js/blob/master/docs/tools.md#paste-handling} * @param event - editor.js custom paste event * {@link https://github.com/codex-team/editor.js/blob/master/types/tools/paste-events.d.ts} - * @returns {void} + * @returns */ public async onPaste(event: PasteEvent): Promise { switch (event.type) { @@ -344,8 +338,7 @@ export default class ImageTool implements BlockTool { /** * Stores all Tool's data - * @private - * @param {ImageToolData} data - data in Image Tool format + * @param data - data in Image Tool format */ private set data(data: ImageToolData) { this.image = data.file; @@ -362,8 +355,7 @@ export default class ImageTool implements BlockTool { /** * Return Tool data - * @private - * @returns {ImageToolData} + * @returns */ private get data(): ImageToolData { return this._data; @@ -371,10 +363,9 @@ export default class ImageTool implements BlockTool { /** * Set new image file - * @private - * @param {object} file - uploaded file data + * @param file - uploaded file data */ - private set image(file: { url: string } | undefined) { + private set image(file: ImageSetterParam | undefined) { this._data.file = file || { url: '' }; if (file && file.url) { @@ -384,9 +375,7 @@ export default class ImageTool implements BlockTool { /** * File uploading callback - * @private - * @param {UploadResponseFormat} response - uploading server response - * @returns {void} + * @param response - uploading server response */ private onUpload(response: UploadResponseFormat): void { if (response.success && response.file.url) { @@ -398,9 +387,7 @@ export default class ImageTool implements BlockTool { /** * Handle uploader errors - * @private - * @param {string} errorText - uploading error info - * @returns {void} + * @param errorText - uploading error info */ private uploadingFailed(errorText: string): void { console.log('Image Tool: uploading failed because of', errorText); @@ -414,9 +401,7 @@ export default class ImageTool implements BlockTool { /** * Callback fired when Block Tune is activated - * @private - * @param {string} tuneName - tune that has been clicked - * @returns {void} + * @param tuneName - tune that has been clicked */ private tuneToggled(tuneName: keyof ImageToolData): void { // inverse tune state @@ -425,9 +410,8 @@ export default class ImageTool implements BlockTool { /** * Set one tune - * @param {string} tuneName - {@link Tunes.tunes} - * @param {boolean} value - tune state - * @returns {void} + * @param tuneName - {@link Tunes.tunes} + * @param value - tune state */ private setTune(tuneName: keyof ImageToolData, value: boolean): void { (this._data[tuneName] as boolean) = value; @@ -448,8 +432,7 @@ export default class ImageTool implements BlockTool { /** * Show preloader and upload image file - * @param {File} file - file that is currently uploading (from paste) - * @returns {void} + * @param file - file that is currently uploading (from paste) */ private uploadFile(file: Blob): void { this.uploader.uploadByFile(file, { @@ -461,8 +444,7 @@ export default class ImageTool implements BlockTool { /** * Show preloader and upload image by target url - * @param {string} url - url pasted - * @returns {void} + * @param url - url pasted */ private uploadUrl(url: string): void { this.ui.showPreloader(url); diff --git a/src/types/codexteam__ajax.d.ts b/src/types/codexteam__ajax.d.ts index 063fc395..49e1e38b 100644 --- a/src/types/codexteam__ajax.d.ts +++ b/src/types/codexteam__ajax.d.ts @@ -1,25 +1,89 @@ +/** + * Module declaration for '@codexteam/ajax'. + */ declare module '@codexteam/ajax' { + /** + * Options for configuring an Ajax request. + */ export interface AjaxOptions { + /** + * The URL to which the request is sent. + */ url?: string; + /** + * The data to send with the request. + */ data?: object; + /** + * The MIME type of the request. + */ accept?: string; + /** + * The headers to send with the request. + */ headers?: object; + /** + * A function to call before the request is sent, with the files to be sent. + */ beforeSend?: (files: File[]) => void; + /** + * The name of the field in the form data to which the file should be assigned. + */ fieldName?: string; + /** + * The type of the request (e.g., 'POST', 'GET'). + */ type?: string; } + /** + * Parameter type of selectFiles function in AjaxOptions interface + */ + export type AjaxFileOptionsParam = { + /** + * the accepted file types. + */ + accept: string; + }; + + /** + * Represents the response from an Ajax request. + * @template T - The type of the response body. + */ export interface AjaxResponse { + /** The body of the response. */ body: T; } - export function selectFiles(options: { accept: string }): Promise; + /** + * Prompts the user to select files and returns a promise that resolves with the selected files. + * @param options - Options for file selection. + * @param options.accept - The accepted file types. + * @returns A promise that resolves with the selected files. + */ + export function selectFiles(options: AjaxFileOptionsParam): Promise; + /** + * Sends an Ajax request with the specified options. + * @param options - Options for the Ajax request. + * @returns A promise that resolves with the Ajax response. + */ export function transport(options: AjaxOptions): Promise; + /** + * Sends a POST request with the specified options. + * @param options - Options for the POST request. + * @returns A promise that resolves with the Ajax response. + */ export function post(options: AjaxOptions): Promise; + /** + * Represents common content types. + */ export const contentType: { + /** + * The MIME type for JSON content. + */ JSON: string; }; } diff --git a/src/types/types.ts b/src/types/types.ts index f162b428..6b4da7e7 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -4,8 +4,13 @@ import type { HTMLPasteEventDetail } from '@editorjs/editorjs'; * Represents options for uploading, including a function to handle previewing. */ export interface UploadOptions { + /** + * Callback function to be called when the preview is ready. + * @param src - The source of the preview as a string. + * @returns void + */ onPreview: (src: string) => void; -}; +} /** * User configuration of Image block tunes. Allows to add custom tunes through the config @@ -183,3 +188,13 @@ export interface HTMLPasteEventDetailExtended extends HTMLPasteEventDetail { src: string; } & HTMLElement; } + +/** + * Parameter type of Image setter function in ImageTool + */ +export type ImageSetterParam = { + /** + * url path of the image + */ + url: string; +}; diff --git a/src/ui.ts b/src/ui.ts index 5096d025..38763311 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -113,11 +113,11 @@ export default class Ui { private readOnly: boolean; /** - * @param {object} ui - image tool Ui module - * @param {object} ui.api - Editor.js API - * @param {ImageConfig} ui.config - user config - * @param {Function} ui.onSelectFile - callback for clicks on Select file button - * @param {boolean} ui.readOnly - read-only mode flag + * @param ui - image tool Ui module + * @param ui.api - Editor.js API + * @param ui.config - user config + * @param ui.onSelectFile - callback for clicks on Select file button + * @param ui.readOnly - read-only mode flag */ constructor({ api, config, onSelectFile, readOnly }: ConstructorParams) { this.api = api; @@ -154,9 +154,8 @@ export default class Ui { /** * Apply visual representation of activated tune - * @param {string} tuneName - one of available tunes {@link Tunes.tunes} - * @param {boolean} status - true for enable, false for disable - * @returns {void} + * @param tuneName - one of available tunes {@link Tunes.tunes} + * @param status - true for enable, false for disable */ public applyTune(tuneName: string, status: boolean): void { this.nodes.wrapper.classList.toggle(`${this.CSS.wrapper}--${tuneName}`, status); @@ -164,8 +163,8 @@ export default class Ui { /** * Renders tool UI - * @param {ImageToolData} toolData - saved tool data - * @returns {Element} + * @param toolData - saved tool data + * @returns */ public render(toolData: ImageToolData): HTMLElement { if (toolData.file == undefined || Object.keys(toolData.file).length === 0) { @@ -179,8 +178,7 @@ export default class Ui { /** * Shows uploading preloader - * @param {string} src - preview source - * @returns {void} + * @param src - preview source */ public showPreloader(src: string): void { this.nodes.imagePreloader.style.backgroundImage = `url(${src})`; @@ -190,7 +188,6 @@ export default class Ui { /** * Hide uploading preloader - * @returns {void} */ public hidePreloader(): void { this.nodes.imagePreloader.style.backgroundImage = ''; @@ -199,8 +196,7 @@ export default class Ui { /** * Shows an image - * @param {string} url - image source - * @returns {void} + * @param url - image source */ public fillImage(url: string): void { /** @@ -216,7 +212,6 @@ export default class Ui { * We use eventName variable because IMG and VIDEO tags have different event to be called on source load * - IMG: load * - VIDEO: loadeddata - * @type {string} */ let eventName = 'load'; @@ -226,7 +221,6 @@ export default class Ui { if (tag === 'VIDEO') { /** * Add attributes for playing muted mp4 as a gif - * @type {boolean} */ attributes.autoplay = true; attributes.loop = true; @@ -235,14 +229,12 @@ export default class Ui { /** * Change event to be listened - * @type {string} */ eventName = 'loadeddata'; } /** * Compose tag with defined attributes - * @type {Element} */ this.nodes.imageEl = make(tag, this.CSS.imageEl, attributes); @@ -265,8 +257,7 @@ export default class Ui { /** * Shows caption input - * @param {string} text - caption content text - * @returns {void} + * @param text - caption content text */ public fillCaption(text: string): void { if (this.nodes.caption != undefined) { @@ -276,7 +267,6 @@ export default class Ui { /** * CSS classes - * @returns {object} */ private get CSS(): Record { return { @@ -298,7 +288,7 @@ export default class Ui { /** * Creates upload-file button - * @returns {Element} + * @returns */ private createFileButton(): HTMLElement { const button = make('div', [this.CSS.button]); @@ -314,8 +304,7 @@ export default class Ui { /** * Changes UI status - * @param {string} status - see {@link Ui.status} constants - * @returns {void} + * @param status - see {@link Ui.status} constants */ private toggleStatus(status: UiState): void { for (const statusType in UiState) { diff --git a/src/uploader.ts b/src/uploader.ts index ecc0ceaa..19dabb29 100644 --- a/src/uploader.ts +++ b/src/uploader.ts @@ -39,10 +39,10 @@ export default class Uploader { private onUpload: (response: UploadResponseFormat) => void; private onError: (error: string) => void; /** - * @param {object} params - uploader module params - * @param {ImageConfig} params.config - image tool config - * @param {Function} params.onUpload - one callback for all uploading (file, url, d-n-d, pasting) - * @param {Function} params.onError - callback for uploading errors + * @param params - uploader module params + * @param params.config - image tool config + * @param params.onUpload - one callback for all uploading (file, url, d-n-d, pasting) + * @param params.onError - callback for uploading errors */ constructor({ config, onUpload, onError }: UploaderParams) { this.config = config; @@ -53,7 +53,7 @@ export default class Uploader { /** * Handle clicks on the upload file button * Fires ajax.transport() - * @param {Function} onPreview - callback fired when preview is ready + * @param onPreview - callback fired when preview is ready */ public uploadSelectedFile({ onPreview }: UploadOptions): void { const preparePreview = function (file: File): void { @@ -111,7 +111,7 @@ export default class Uploader { /** * Handle clicks on the upload file button * Fires ajax.post() - * @param {string} url - image source url + * @param url - image source url */ public uploadByUrl(url: string): void { let upload; @@ -149,13 +149,12 @@ export default class Uploader { /** * Handle clicks on the upload file button * Fires ajax.post() - * @param {File} file - file pasted by drag-n-drop - * @param {Function} onPreview - file pasted by drag-n-drop + * @param file - file pasted by drag-n-drop + * @param onPreview - file pasted by drag-n-drop */ public uploadByFile(file: Blob, { onPreview }: UploadOptions): void { /** * Load file for preview - * @type {FileReader} */ const reader = new FileReader(); From 9ce343d6d47e1a4f57317bedede5b29717dc0dfd Mon Sep 17 00:00:00 2001 From: dependentmadani Date: Wed, 24 Jul 2024 00:20:48 +0100 Subject: [PATCH 09/14] fix(issues): based on review provided --- package.json | 6 +-- src/index.ts | 10 +---- src/ui.ts | 8 ++-- src/utils/dom.ts | 2 +- src/utils/isPromise.ts | 2 +- yarn.lock | 99 ++++++++++++++++++++++++++++++++++++++---- 6 files changed, 100 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 305ac8ae..7b27d495 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@editorjs/image", - "version": "2.9.2", + "version": "2.9.3", "keywords": [ "codex editor", "image", @@ -47,12 +47,12 @@ "postcss-nested-ancestors": "^3.0.0", "request": "^2.88.0", "typescript": "^5.4.5", + "typescript-eslint": "^7.17.0", "vite": "^5.3.1", "vite-plugin-css-injected-by-js": "^3.5.1", "vite-plugin-dts": "^3.9.1" }, "dependencies": { - "@codexteam/icons": "^0.3.0", - "typescript-eslint": "^7.16.1" + "@codexteam/icons": "^0.3.0" } } diff --git a/src/index.ts b/src/index.ts index 68313000..b65b247c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -113,7 +113,7 @@ export default class ImageTool implements BlockTool { */ this.uploader = new Uploader({ config: this.config, - onUpload: (response: UploadResponseFormat) => this.onUpload(response), + onUpload: (response: UploadResponseFormat) => this.onUpload(response), onError: (error: string) => this.uploadingFailed(error), }); @@ -150,7 +150,6 @@ export default class ImageTool implements BlockTool { /** * Notify core that read-only mode is supported - * @returns */ public static get isReadOnlySupported(): boolean { return true; @@ -160,7 +159,6 @@ export default class ImageTool implements BlockTool { * Get Tool toolbox settings * icon - Tool icon's SVG * title - title to show in toolbox - * @returns */ public static get toolbox(): ToolboxConfig { return { @@ -171,7 +169,6 @@ export default class ImageTool implements BlockTool { /** * Available image tools - * @returns */ public static get tunes(): Array { return [ @@ -215,7 +212,6 @@ export default class ImageTool implements BlockTool { /** * Return Block data - * @returns */ public save(): ImageToolData { const caption = this.ui.nodes.caption; @@ -263,7 +259,6 @@ export default class ImageTool implements BlockTool { /** * Specify paste substitutes * @see {@link https://github.com/codex-team/editor.js/blob/master/docs/tools.md#paste-handling} - * @returns */ public static get pasteConfig(): PasteConfig { return { @@ -296,7 +291,6 @@ export default class ImageTool implements BlockTool { * @see {@link https://github.com/codex-team/editor.js/blob/master/docs/tools.md#paste-handling} * @param event - editor.js custom paste event * {@link https://github.com/codex-team/editor.js/blob/master/types/tools/paste-events.d.ts} - * @returns */ public async onPaste(event: PasteEvent): Promise { switch (event.type) { @@ -405,7 +399,7 @@ export default class ImageTool implements BlockTool { */ private tuneToggled(tuneName: keyof ImageToolData): void { // inverse tune state - this.setTune(tuneName, this._data[tuneName] != undefined ? false : true); + this.setTune(tuneName, this._data[tuneName] !== undefined ? false : true); } /** diff --git a/src/ui.ts b/src/ui.ts index 38763311..931bca72 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -164,10 +164,9 @@ export default class Ui { /** * Renders tool UI * @param toolData - saved tool data - * @returns */ public render(toolData: ImageToolData): HTMLElement { - if (toolData.file == undefined || Object.keys(toolData.file).length === 0) { + if (toolData.file === undefined || Object.keys(toolData.file).length === 0) { this.toggleStatus(UiState.Empty); } else { this.toggleStatus(UiState.Uploading); @@ -247,7 +246,7 @@ export default class Ui { /** * Preloader does not exists on first rendering with presaved data */ - if (this.nodes.imagePreloader != undefined) { + if (this.nodes.imagePreloader !== undefined) { this.nodes.imagePreloader.style.backgroundImage = ''; } }); @@ -260,7 +259,7 @@ export default class Ui { * @param text - caption content text */ public fillCaption(text: string): void { - if (this.nodes.caption != undefined) { + if (this.nodes.caption !== undefined) { this.nodes.caption.innerHTML = text; } } @@ -288,7 +287,6 @@ export default class Ui { /** * Creates upload-file button - * @returns */ private createFileButton(): HTMLElement { const button = make('div', [this.CSS.button]); diff --git a/src/utils/dom.ts b/src/utils/dom.ts index 6e3b959f..70bf38a2 100644 --- a/src/utils/dom.ts +++ b/src/utils/dom.ts @@ -10,7 +10,7 @@ export function make(tagName: string, classNames: string[] | string | null = nul if (Array.isArray(classNames)) { el.classList.add(...classNames); - } else if (classNames != null) { + } else if (classNames !== null) { el.classList.add(classNames); } diff --git a/src/utils/isPromise.ts b/src/utils/isPromise.ts index 3e198bb0..70de7c6e 100644 --- a/src/utils/isPromise.ts +++ b/src/utils/isPromise.ts @@ -6,5 +6,5 @@ import type { UploadResponseFormat } from '../types/types'; * @returns */ export default function isPromise(object: Promise): object is Promise { - return object != undefined && typeof object.then === 'function'; + return object !== undefined && typeof object.then === 'function'; } diff --git a/yarn.lock b/yarn.lock index 42a3be0b..b1b136d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -493,7 +493,22 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== -"@typescript-eslint/eslint-plugin@7.16.1", "@typescript-eslint/eslint-plugin@^7.16.1": +"@typescript-eslint/eslint-plugin@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.17.0.tgz#c8ed1af1ad2928ede5cdd207f7e3090499e1f77b" + integrity sha512-pyiDhEuLM3PuANxH7uNYan1AaFs5XE0zw1hq69JBvGvE7gSuEoQl1ydtEe/XQeoC3GQxLXyOVa5kNOATgM638A== + dependencies: + "@eslint-community/regexpp" "^4.10.0" + "@typescript-eslint/scope-manager" "7.17.0" + "@typescript-eslint/type-utils" "7.17.0" + "@typescript-eslint/utils" "7.17.0" + "@typescript-eslint/visitor-keys" "7.17.0" + graphemer "^1.4.0" + ignore "^5.3.1" + natural-compare "^1.4.0" + ts-api-utils "^1.3.0" + +"@typescript-eslint/eslint-plugin@^7.16.1": version "7.16.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.16.1.tgz#f5f5da52db674b1f2cdb9d5f3644e5b2ec750465" integrity sha512-SxdPak/5bO0EnGktV05+Hq8oatjAYVY3Zh2bye9pGZy6+jwyR3LG3YKkV4YatlsgqXP28BTeVm9pqwJM96vf2A== @@ -508,7 +523,18 @@ natural-compare "^1.4.0" ts-api-utils "^1.3.0" -"@typescript-eslint/parser@7.16.1", "@typescript-eslint/parser@^7.16.1": +"@typescript-eslint/parser@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.17.0.tgz#be8e32c159190cd40a305a2121220eadea5a88e7" + integrity sha512-puiYfGeg5Ydop8eusb/Hy1k7QmOU6X3nvsqCgzrB2K4qMavK//21+PzNE8qeECgNOIoertJPUC1SpegHDI515A== + dependencies: + "@typescript-eslint/scope-manager" "7.17.0" + "@typescript-eslint/types" "7.17.0" + "@typescript-eslint/typescript-estree" "7.17.0" + "@typescript-eslint/visitor-keys" "7.17.0" + debug "^4.3.4" + +"@typescript-eslint/parser@^7.16.1": version "7.16.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.16.1.tgz#84c581cf86c8b2becd48d33ddc41a6303d57b274" integrity sha512-u+1Qx86jfGQ5i4JjK33/FnawZRpsLxRnKzGE6EABZ40KxVT/vWsiZFEBBHjFOljmmV3MBYOHEKi0Jm9hbAOClA== @@ -535,6 +561,14 @@ "@typescript-eslint/types" "7.16.1" "@typescript-eslint/visitor-keys" "7.16.1" +"@typescript-eslint/scope-manager@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz#e072d0f914662a7bfd6c058165e3c2b35ea26b9d" + integrity sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA== + dependencies: + "@typescript-eslint/types" "7.17.0" + "@typescript-eslint/visitor-keys" "7.17.0" + "@typescript-eslint/type-utils@7.16.1": version "7.16.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.16.1.tgz#4d7ae4f3d9e3c8cbdabae91609b1a431de6aa6ca" @@ -545,6 +579,16 @@ debug "^4.3.4" ts-api-utils "^1.3.0" +"@typescript-eslint/type-utils@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.17.0.tgz#c5da78feb134c9c9978cbe89e2b1a589ed22091a" + integrity sha512-XD3aaBt+orgkM/7Cei0XNEm1vwUxQ958AOLALzPlbPqb8C1G8PZK85tND7Jpe69Wualri81PLU+Zc48GVKIMMA== + dependencies: + "@typescript-eslint/typescript-estree" "7.17.0" + "@typescript-eslint/utils" "7.17.0" + debug "^4.3.4" + ts-api-utils "^1.3.0" + "@typescript-eslint/types@6.21.0": version "6.21.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" @@ -555,6 +599,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.16.1.tgz#bbab066276d18e398bc64067b23f1ce84dfc6d8c" integrity sha512-AQn9XqCzUXd4bAVEsAXM/Izk11Wx2u4H3BAfQVhSfzfDOm/wAON9nP7J5rpkCxts7E5TELmN845xTUCQrD1xIQ== +"@typescript-eslint/types@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.17.0.tgz#7ce8185bdf06bc3494e73d143dbf3293111b9cff" + integrity sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A== + "@typescript-eslint/types@^7.2.0": version "7.13.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.13.1.tgz#787db283bd0b58751094c90d5b58bbf5e9fc9bd8" @@ -588,6 +637,20 @@ semver "^7.6.0" ts-api-utils "^1.3.0" +"@typescript-eslint/typescript-estree@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz#dcab3fea4c07482329dd6107d3c6480e228e4130" + integrity sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw== + dependencies: + "@typescript-eslint/types" "7.17.0" + "@typescript-eslint/visitor-keys" "7.17.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^1.3.0" + "@typescript-eslint/utils@7.16.1": version "7.16.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.16.1.tgz#df42dc8ca5a4603016fd102db0346cdab415cdb7" @@ -598,6 +661,16 @@ "@typescript-eslint/types" "7.16.1" "@typescript-eslint/typescript-estree" "7.16.1" +"@typescript-eslint/utils@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.17.0.tgz#815cd85b9001845d41b699b0ce4f92d6dfb84902" + integrity sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@typescript-eslint/scope-manager" "7.17.0" + "@typescript-eslint/types" "7.17.0" + "@typescript-eslint/typescript-estree" "7.17.0" + "@typescript-eslint/utils@^6.21.0": version "6.21.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134" @@ -627,6 +700,14 @@ "@typescript-eslint/types" "7.16.1" eslint-visitor-keys "^3.4.3" +"@typescript-eslint/visitor-keys@7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz#680465c734be30969e564b4647f38d6cdf49bfb0" + integrity sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A== + dependencies: + "@typescript-eslint/types" "7.17.0" + eslint-visitor-keys "^3.4.3" + "@volar/language-core@1.11.1", "@volar/language-core@~1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@volar/language-core/-/language-core-1.11.1.tgz#ecdf12ea8dc35fb8549e517991abcbf449a5ad4f" @@ -3009,14 +3090,14 @@ typed-array-length@^1.0.6: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" -typescript-eslint@^7.16.1: - version "7.16.1" - resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-7.16.1.tgz#4855e11985b3dbd13a94b4e7e6523b2ec5d1c759" - integrity sha512-889oE5qELj65q/tGeOSvlreNKhimitFwZqQ0o7PcWC7/lgRkAMknznsCsV8J8mZGTP/Z+cIbX8accf2DE33hrA== +typescript-eslint@^7.17.0: + version "7.17.0" + resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-7.17.0.tgz#cc5eddafd38b3c1fe8a52826469d5c78700b7aa7" + integrity sha512-spQxsQvPguduCUfyUvLItvKqK3l8KJ/kqs5Pb/URtzQ5AC53Z6us32St37rpmlt2uESG23lOFpV4UErrmy4dZQ== dependencies: - "@typescript-eslint/eslint-plugin" "7.16.1" - "@typescript-eslint/parser" "7.16.1" - "@typescript-eslint/utils" "7.16.1" + "@typescript-eslint/eslint-plugin" "7.17.0" + "@typescript-eslint/parser" "7.17.0" + "@typescript-eslint/utils" "7.17.0" typescript@5.4.2: version "5.4.2" From 3626da1147e67e300543854cc07cb39c90ab82ae Mon Sep 17 00:00:00 2001 From: dependentmadani Date: Wed, 24 Jul 2024 03:13:13 +0100 Subject: [PATCH 10/14] update: remove an unnecessary return --- src/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index b65b247c..aaea9fc3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -195,7 +195,6 @@ export default class ImageTool implements BlockTool { /** * Renders Block content - * @returns */ public render(): HTMLDivElement { return this.ui.render(this.data) as HTMLDivElement; @@ -349,7 +348,6 @@ export default class ImageTool implements BlockTool { /** * Return Tool data - * @returns */ private get data(): ImageToolData { return this._data; From 5ce4814259af1c2b9046eb4a03fdd17a0cb0fe98 Mon Sep 17 00:00:00 2001 From: dependentmadani Date: Wed, 24 Jul 2024 20:10:13 +0100 Subject: [PATCH 11/14] fix(tune): the tune toggle working now --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index aaea9fc3..3278b4da 100644 --- a/src/index.ts +++ b/src/index.ts @@ -397,7 +397,7 @@ export default class ImageTool implements BlockTool { */ private tuneToggled(tuneName: keyof ImageToolData): void { // inverse tune state - this.setTune(tuneName, this._data[tuneName] !== undefined ? false : true); + this.setTune(tuneName, this._data[tuneName] !== undefined ? true : false); } /** From 6699206032e88157fe3755f5a7813692b83f2261 Mon Sep 17 00:00:00 2001 From: dependentmadani Date: Wed, 24 Jul 2024 20:26:59 +0100 Subject: [PATCH 12/14] update(tune): cast it into boolean instead --- index.html | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/index.ts | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 00000000..e00fefe3 --- /dev/null +++ b/index.html @@ -0,0 +1,66 @@ + + + + + + Editor.js with ImageTool + + + +
+ + + + + + diff --git a/src/index.ts b/src/index.ts index 3278b4da..7932cf38 100644 --- a/src/index.ts +++ b/src/index.ts @@ -397,7 +397,7 @@ export default class ImageTool implements BlockTool { */ private tuneToggled(tuneName: keyof ImageToolData): void { // inverse tune state - this.setTune(tuneName, this._data[tuneName] !== undefined ? true : false); + this.setTune(tuneName, !(this._data[tuneName] as boolean)); } /** From 30f13f90d5b0f5ad92fa83e1ca8a7f55fde8b1b8 Mon Sep 17 00:00:00 2001 From: dependentmadani Date: Wed, 24 Jul 2024 20:27:44 +0100 Subject: [PATCH 13/14] remove unnecessary file --- index.html | 66 ------------------------------------------------------ 1 file changed, 66 deletions(-) delete mode 100644 index.html diff --git a/index.html b/index.html deleted file mode 100644 index e00fefe3..00000000 --- a/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - Editor.js with ImageTool - - - -
- - - - - - From f4b8bc6b8f40722e1b62af97f7746d23becae249 Mon Sep 17 00:00:00 2001 From: dependentmadani Date: Tue, 30 Jul 2024 17:21:11 +0100 Subject: [PATCH 14/14] fix: fix the way of verifying the response file disponibility --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 7932cf38..7c7145aa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -370,7 +370,7 @@ export default class ImageTool implements BlockTool { * @param response - uploading server response */ private onUpload(response: UploadResponseFormat): void { - if (response.success && response.file.url) { + if (response.success && Boolean(response.file)) { this.image = response.file; } else { this.uploadingFailed('incorrect response: ' + JSON.stringify(response));