From 2f8a64a93eff837e1b487d32f35263451f6b6896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sat, 5 Aug 2023 09:37:08 +0200 Subject: [PATCH] fix: Use resize observer to calculate menubar icon limit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- package-lock.json | 93 +++++++++++++++++++++++++++------ package.json | 2 + src/components/Menu/MenuBar.vue | 77 ++++++--------------------- 3 files changed, 96 insertions(+), 76 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc98f955f64..3bffe92093b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,6 +59,7 @@ "@tiptap/pm": "^2.0.4", "@tiptap/suggestion": "^2.0.4", "@tiptap/vue-2": "^2.0.4", + "@vueuse/shared": "^10.3.0", "debounce": "^1.2.1", "escape-html": "^1.0.3", "highlight.js": "^11.8.0", @@ -93,6 +94,7 @@ "@vitejs/plugin-vue2": "^2.2.0", "@vue/test-utils": "^1.3.0 <2", "@vue/vue2-jest": "^29.2.4", + "@vueuse/core": "^10.3.0", "cypress": "^12.17.3", "eslint-plugin-cypress": "^2.13.3", "identity-obj-proxy": "^3.0.0", @@ -5683,7 +5685,7 @@ "vue-demi": ">=0.14.0" } }, - "node_modules/@vueuse/core": { + "node_modules/@vueuse/components/node_modules/@vueuse/core": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.1.2.tgz", "integrity": "sha512-roNn8WuerI56A5uiTyF/TEYX0Y+VKlhZAF94unUfdhbDUI+NfwQMn4FUnUscIRUhv3344qvAghopU4bzLPNFlA==", @@ -5697,7 +5699,7 @@ "url": "https://github.com/sponsors/antfu" } }, - "node_modules/@vueuse/metadata": { + "node_modules/@vueuse/components/node_modules/@vueuse/metadata": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.1.2.tgz", "integrity": "sha512-3mc5BqN9aU2SqBeBuWE7ne4OtXHoHKggNgxZR2K+zIW4YLsy6xoZ4/9vErQs6tvoKDX6QAqm3lvsrv0mczAwIQ==", @@ -5705,7 +5707,7 @@ "url": "https://github.com/sponsors/antfu" } }, - "node_modules/@vueuse/shared": { + "node_modules/@vueuse/components/node_modules/@vueuse/shared": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.1.2.tgz", "integrity": "sha512-1uoUTPBlgyscK9v6ScGeVYDDzlPSFXBlxuK7SfrDGyUTBiznb3mNceqhwvZHjtDRELZEN79V5uWPTF1VDV8svA==", @@ -5716,6 +5718,39 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/@vueuse/core": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.3.0.tgz", + "integrity": "sha512-BEM5yxcFKb5btFjTSAFjTu5jmwoW66fyV9uJIP4wUXXU8aR5Hl44gndaaXp7dC5HSObmgbnR2RN+Un1p68Mf5Q==", + "dependencies": { + "@types/web-bluetooth": "^0.0.17", + "@vueuse/metadata": "10.3.0", + "@vueuse/shared": "10.3.0", + "vue-demi": ">=0.14.5" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/metadata": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.3.0.tgz", + "integrity": "sha512-Ema3YhNOa4swDsV0V7CEY5JXvK19JI/o1szFO1iWxdFg3vhdFtCtSTP26PCvbUpnUtNHBY2wx5y3WDXND5Pvnw==", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.3.0.tgz", + "integrity": "sha512-kGqCTEuFPMK4+fNWy6dUOiYmxGcUbtznMwBZLC1PubidF4VZY05B+Oht7Jh7/6x4VOWGpvu3R37WHi81cKpiqg==", + "dependencies": { + "vue-demi": ">=0.14.5" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/@webassemblyjs/ast": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", @@ -26493,30 +26528,56 @@ "@vueuse/core": "10.1.2", "@vueuse/shared": "10.1.2", "vue-demi": ">=0.14.0" + }, + "dependencies": { + "@vueuse/core": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.1.2.tgz", + "integrity": "sha512-roNn8WuerI56A5uiTyF/TEYX0Y+VKlhZAF94unUfdhbDUI+NfwQMn4FUnUscIRUhv3344qvAghopU4bzLPNFlA==", + "requires": { + "@types/web-bluetooth": "^0.0.17", + "@vueuse/metadata": "10.1.2", + "@vueuse/shared": "10.1.2", + "vue-demi": ">=0.14.0" + } + }, + "@vueuse/metadata": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.1.2.tgz", + "integrity": "sha512-3mc5BqN9aU2SqBeBuWE7ne4OtXHoHKggNgxZR2K+zIW4YLsy6xoZ4/9vErQs6tvoKDX6QAqm3lvsrv0mczAwIQ==" + }, + "@vueuse/shared": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.1.2.tgz", + "integrity": "sha512-1uoUTPBlgyscK9v6ScGeVYDDzlPSFXBlxuK7SfrDGyUTBiznb3mNceqhwvZHjtDRELZEN79V5uWPTF1VDV8svA==", + "requires": { + "vue-demi": ">=0.14.0" + } + } } }, "@vueuse/core": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.1.2.tgz", - "integrity": "sha512-roNn8WuerI56A5uiTyF/TEYX0Y+VKlhZAF94unUfdhbDUI+NfwQMn4FUnUscIRUhv3344qvAghopU4bzLPNFlA==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-10.3.0.tgz", + "integrity": "sha512-BEM5yxcFKb5btFjTSAFjTu5jmwoW66fyV9uJIP4wUXXU8aR5Hl44gndaaXp7dC5HSObmgbnR2RN+Un1p68Mf5Q==", "requires": { "@types/web-bluetooth": "^0.0.17", - "@vueuse/metadata": "10.1.2", - "@vueuse/shared": "10.1.2", - "vue-demi": ">=0.14.0" + "@vueuse/metadata": "10.3.0", + "@vueuse/shared": "10.3.0", + "vue-demi": ">=0.14.5" } }, "@vueuse/metadata": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.1.2.tgz", - "integrity": "sha512-3mc5BqN9aU2SqBeBuWE7ne4OtXHoHKggNgxZR2K+zIW4YLsy6xoZ4/9vErQs6tvoKDX6QAqm3lvsrv0mczAwIQ==" + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-10.3.0.tgz", + "integrity": "sha512-Ema3YhNOa4swDsV0V7CEY5JXvK19JI/o1szFO1iWxdFg3vhdFtCtSTP26PCvbUpnUtNHBY2wx5y3WDXND5Pvnw==" }, "@vueuse/shared": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.1.2.tgz", - "integrity": "sha512-1uoUTPBlgyscK9v6ScGeVYDDzlPSFXBlxuK7SfrDGyUTBiznb3mNceqhwvZHjtDRELZEN79V5uWPTF1VDV8svA==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-10.3.0.tgz", + "integrity": "sha512-kGqCTEuFPMK4+fNWy6dUOiYmxGcUbtznMwBZLC1PubidF4VZY05B+Oht7Jh7/6x4VOWGpvu3R37WHi81cKpiqg==", "requires": { - "vue-demi": ">=0.14.0" + "vue-demi": ">=0.14.5" } }, "@webassemblyjs/ast": { diff --git a/package.json b/package.json index b256463bddc..78fe9b9fcdd 100644 --- a/package.json +++ b/package.json @@ -85,6 +85,7 @@ "@tiptap/pm": "^2.0.4", "@tiptap/suggestion": "^2.0.4", "@tiptap/vue-2": "^2.0.4", + "@vueuse/shared": "^10.3.0", "debounce": "^1.2.1", "escape-html": "^1.0.3", "highlight.js": "^11.8.0", @@ -123,6 +124,7 @@ "@vitejs/plugin-vue2": "^2.2.0", "@vue/test-utils": "^1.3.0 <2", "@vue/vue2-jest": "^29.2.4", + "@vueuse/core": "^10.3.0", "cypress": "^12.17.3", "eslint-plugin-cypress": "^2.13.3", "identity-obj-proxy": "^3.0.0", diff --git a/src/components/Menu/MenuBar.vue b/src/components/Menu/MenuBar.vue index a510a935747..16ebcea7cba 100644 --- a/src/components/Menu/MenuBar.vue +++ b/src/components/Menu/MenuBar.vue @@ -71,9 +71,9 @@