From 193eaf61769a0012022e0b89f8453f03dbac0cd6 Mon Sep 17 00:00:00 2001 From: why520crazy Date: Wed, 13 Sep 2023 15:03:53 +0800 Subject: [PATCH 1/2] feat: bump is-hotkey and direction to 0.2.0 and 2.0.1, add dependencies of package.json --- package-lock.json | 36 +++++++++++++------ package.json | 6 ++-- packages/package.json | 9 +++-- .../components/editable/editable.component.ts | 4 +-- 4 files changed, 38 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index b31ed846..ce525ccd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,12 +8,17 @@ "version": "16.0.0", "license": "MIT", "dependencies": { + "direction": "^2.0.1", + "is-hotkey": "^0.2.0", + "scroll-into-view-if-needed": "^2.2.20", + "slate": "^0.72.8", + "slate-history": "^0.66.0", "tslib": "^2.5.0" }, "peerDependencies": { "debug": "^4.1.1", - "direction": "^1.0.3", - "is-hotkey": "^0.1.6", + "direction": ">= 1.0.3", + "is-hotkey": "^0.2.0", "scroll-into-view-if-needed": "^2.2.20", "slate": ">= 0.63.0", "slate-history": "^0.66.0" @@ -34,8 +39,8 @@ "@angular/platform-browser-dynamic": "~16.2.1", "@angular/router": "^16.2.1", "core-js": "3.28.0", - "direction": "^1.0.3", - "is-hotkey": "^0.1.6", + "direction": "^2.0.1", + "is-hotkey": "^0.2.0", "rxjs": "~6.6.0", "scroll-into-view-if-needed": "^2.2.20", "slate": "0.72.8", @@ -9238,8 +9243,9 @@ } }, "node_modules/direction": { - "version": "1.0.4", - "license": "MIT", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/direction/-/direction-2.0.1.tgz", + "integrity": "sha512-9S6m9Sukh1cZNknO1CWAr2QAWsbKLafQiyM5gZ7VgXHeuaoUwffKN4q6NC4A/Mf9iiPlOXQEKW/Mv/mh9/3YFA==", "bin": { "direction": "cli.js" }, @@ -12853,8 +12859,9 @@ } }, "node_modules/is-hotkey": { - "version": "0.1.8", - "license": "MIT" + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/is-hotkey/-/is-hotkey-0.2.0.tgz", + "integrity": "sha512-UknnZK4RakDmTgz4PI1wIph5yxSs/mvChWs9ifnlXsKuXgWmOkY/hAE0H/k2MIqH0RlRye0i1oC07MCRSD28Mw==" }, "node_modules/is-interactive": { "version": "1.0.0", @@ -28572,7 +28579,9 @@ } }, "direction": { - "version": "1.0.4" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/direction/-/direction-2.0.1.tgz", + "integrity": "sha512-9S6m9Sukh1cZNknO1CWAr2QAWsbKLafQiyM5gZ7VgXHeuaoUwffKN4q6NC4A/Mf9iiPlOXQEKW/Mv/mh9/3YFA==" }, "dns-equal": { "version": "1.0.0", @@ -31114,7 +31123,9 @@ } }, "is-hotkey": { - "version": "0.1.8" + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/is-hotkey/-/is-hotkey-0.2.0.tgz", + "integrity": "sha512-UknnZK4RakDmTgz4PI1wIph5yxSs/mvChWs9ifnlXsKuXgWmOkY/hAE0H/k2MIqH0RlRye0i1oC07MCRSD28Mw==" }, "is-interactive": { "version": "1.0.0", @@ -35425,6 +35436,11 @@ "slate-angular": { "version": "file:packages", "requires": { + "direction": "^2.0.1", + "is-hotkey": "^0.2.0", + "scroll-into-view-if-needed": "^2.2.20", + "slate": "^0.72.8", + "slate-history": "^0.66.0", "tslib": "^2.5.0" } }, diff --git a/package.json b/package.json index e9777c55..598665a1 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,8 @@ "@angular/platform-browser-dynamic": "~16.2.1", "@angular/router": "^16.2.1", "core-js": "3.28.0", - "direction": "^1.0.3", - "is-hotkey": "^0.1.6", + "direction": "^2.0.1", + "is-hotkey": "^0.2.0", "rxjs": "~6.6.0", "slate": "0.72.8", "slate-history": "0.66.0", @@ -96,4 +96,4 @@ "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "^2.26.0" } -} \ No newline at end of file +} diff --git a/packages/package.json b/packages/package.json index ea4497d7..8df9be32 100644 --- a/packages/package.json +++ b/packages/package.json @@ -9,11 +9,16 @@ "slate": ">= 0.63.0", "slate-history": "^0.66.0", "debug": "^4.1.1", - "direction": "^1.0.3", - "is-hotkey": "^0.1.6", + "direction": ">= 1.0.3", + "is-hotkey": "^0.2.0", "scroll-into-view-if-needed": "^2.2.20" }, "dependencies": { + "slate": "^0.72.8", + "slate-history": "^0.66.0", + "direction": "^2.0.1", + "is-hotkey": "^0.2.0", + "scroll-into-view-if-needed": "^2.2.20", "tslib": "^2.5.0" }, "exports": { diff --git a/packages/src/components/editable/editable.component.ts b/packages/src/components/editable/editable.component.ts index 8fa9d6cb..28d024e2 100644 --- a/packages/src/components/editable/editable.component.ts +++ b/packages/src/components/editable/editable.component.ts @@ -27,7 +27,7 @@ import { EDITOR_TO_WINDOW } from '../../utils/weak-maps'; import { Text as SlateText, Element, Transforms, Editor, Range, Path, NodeEntry, Node } from 'slate'; -import getDirection from 'direction'; +import { direction } from 'direction'; import scrollIntoView from 'scroll-into-view-if-needed'; import { AngularEditor } from '../../plugins/angular-editor'; import { @@ -981,7 +981,7 @@ export class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewChe const { selection } = editor; const element = editor.children[selection !== null ? selection.focus.path[0] : 0]; - const isRTL = getDirection(Node.string(element)) === 'rtl'; + const isRTL = direction(Node.string(element)) === 'rtl'; try { // COMPAT: Since we prevent the default behavior on From 1724efa0c3420ebd467773a610d35c7431d9b078 Mon Sep 17 00:00:00 2001 From: why520crazy Date: Wed, 13 Sep 2023 15:05:27 +0800 Subject: [PATCH 2/2] build: update direction of peerDependencies to "^2.0.1", --- packages/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/package.json b/packages/package.json index 8df9be32..416a7296 100644 --- a/packages/package.json +++ b/packages/package.json @@ -9,7 +9,7 @@ "slate": ">= 0.63.0", "slate-history": "^0.66.0", "debug": "^4.1.1", - "direction": ">= 1.0.3", + "direction": "^2.0.1", "is-hotkey": "^0.2.0", "scroll-into-view-if-needed": "^2.2.20" },