From 97dba4b3cc25f10fda8cf8bccf055fa43e352053 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 21 Apr 2026 14:48:03 +0400 Subject: [PATCH] Cleanup old matches usage --- packages/core/package.json | 4 ++-- packages/core/src/utils/mixins.ts | 5 ----- packages/core/src/utils/sorter/SorterUtils.ts | 3 +-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 89b46cbf9..9ba59da90 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -69,8 +69,8 @@ "scripts": { "build": "npm run build-all", "build-all": "run-s build:*", - "build:js": "node node_modules/grapesjs-cli/dist/cli.js build --patch=false --targets=\"> 1%, ie 11, safari 8, not dead\" --statsOutput=\"stats.json\" --localePath=\"src/i18n/locale\"", - "build:mjs": "cross-env BUILD_MODULE=true node node_modules/grapesjs-cli/dist/cli.js build --dts='skip' --patch=false --targets=\"> 1%, ie 11, safari 8, not dead\"", + "build:js": "node node_modules/grapesjs-cli/dist/cli.js build --patch=false --targets=\"defaults\" --statsOutput=\"stats.json\" --localePath=\"src/i18n/locale\"", + "build:mjs": "cross-env BUILD_MODULE=true node node_modules/grapesjs-cli/dist/cli.js build --dts='skip' --patch=false --targets=\"defaults\"", "build:css": "sass src/styles/scss/main.scss dist/css/grapes.min.css --no-source-map --style=compressed --load-path=node_modules", "ts:build": "node node_modules/grapesjs-cli/dist/cli.js build --dts='only' --patch=false", "ts:check": "tsc --noEmit --esModuleInterop dist/index.d.ts", diff --git a/packages/core/src/utils/mixins.ts b/packages/core/src/utils/mixins.ts index 00cdf8380..e6946d730 100644 --- a/packages/core/src/utils/mixins.ts +++ b/packages/core/src/utils/mixins.ts @@ -85,10 +85,6 @@ export const getGlobal = () => export const toLowerCase = (str: string) => (str || '').toLowerCase(); -const elProt = hasWin() ? window.Element.prototype : {}; -// @ts-ignore -const matches = elProt.matches || elProt.webkitMatchesSelector || elProt.mozMatchesSelector || elProt.msMatchesSelector; - export const getUiClass = (em: EditorModel, defCls: string) => { const { stylePrefix, customUI } = em.getConfig(); return [customUI && `${stylePrefix}cui`, defCls].filter((i) => i).join(' '); @@ -315,7 +311,6 @@ export const buildBase64UrlFromSvg = (svg: string) => { export { hasDnd, upFirst, - matches, getModel, camelCase, getElement, diff --git a/packages/core/src/utils/sorter/SorterUtils.ts b/packages/core/src/utils/sorter/SorterUtils.ts index 4f1029683..92bf67bb2 100644 --- a/packages/core/src/utils/sorter/SorterUtils.ts +++ b/packages/core/src/utils/sorter/SorterUtils.ts @@ -1,7 +1,6 @@ import { $, Model, SetOptions } from '../../common'; import EditorModel from '../../editor/model/Editor'; import { isTextNode } from '../dom'; -import { matches as matchesMixin } from '../mixins'; import { SortableTreeNode } from './SortableTreeNode'; import { Placement, DragDirection, SorterOptions } from './types'; import Dimension from './Dimension'; @@ -86,7 +85,7 @@ export function offset(el: HTMLElement) { * @return {Boolean} */ export function matches(el: HTMLElement, selector: string): boolean { - return matchesMixin.call(el, selector); + return el.matches(selector); } /**