From 270f7ba269928d1433fd41fe290e5a6a90bcf348 Mon Sep 17 00:00:00 2001 From: Ahmet Bora Date: Thu, 3 Aug 2023 21:27:15 +0300 Subject: [PATCH 01/58] Fix structure field sortBy issue #5448 --- panel/src/components/Forms/Field/StructureField.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/panel/src/components/Forms/Field/StructureField.vue b/panel/src/components/Forms/Field/StructureField.vue index 2a77e8b972..2efcdabb75 100644 --- a/panel/src/components/Forms/Field/StructureField.vue +++ b/panel/src/components/Forms/Field/StructureField.vue @@ -304,7 +304,9 @@ export default { }, watch: { value(value) { - this.items = this.toItems(value); + if (value !== this.items) { + this.items = this.toItems(value); + } } }, methods: { From 2935071973ae2156193cb652d1493dc096902442 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Sat, 5 Aug 2023 12:39:44 +0200 Subject: [PATCH 02/58] Fix dropdown positioning Fixes #5444 --- panel/src/components/Dropdowns/DropdownContent.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/src/components/Dropdowns/DropdownContent.vue b/panel/src/components/Dropdowns/DropdownContent.vue index 8853581125..b0124468e2 100644 --- a/panel/src/components/Dropdowns/DropdownContent.vue +++ b/panel/src/components/Dropdowns/DropdownContent.vue @@ -245,7 +245,7 @@ export default { // and adapt alignment if necessary if (this.axis.x === "end") { if (rect.left - rect.width < safeSpace) { - this.axis.x === "start"; + this.axis.x = "start"; } } else if ( rect.left + rect.width > window.innerWidth - safeSpace && @@ -263,7 +263,7 @@ export default { // and adapt alignment if necessary if (this.axis.y === "top") { if (rect.height + safeSpace > rect.top) { - this.axis.y === "bottom"; + this.axis.y = "bottom"; } } else if ( rect.top + rect.height > window.innerHeight - safeSpace && From 4856c08f872c0e077f9ae779951943731cadb56e Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Sun, 6 Aug 2023 12:30:01 +0200 Subject: [PATCH 03/58] Upgrade npm packages --- panel/package-lock.json | 287 +++++++++++++++++++--------------------- panel/package.json | 26 ++-- 2 files changed, 151 insertions(+), 162 deletions(-) diff --git a/panel/package-lock.json b/panel/package-lock.json index bb0ad42036..735ceae34f 100644 --- a/panel/package-lock.json +++ b/panel/package-lock.json @@ -14,9 +14,9 @@ "prosemirror-history": "^1.3.2", "prosemirror-inputrules": "^1.2.1", "prosemirror-keymap": "^1.2.2", - "prosemirror-model": "^1.19.2", + "prosemirror-model": "^1.19.3", "prosemirror-schema-list": "^1.3.0", - "prosemirror-view": "^1.31.5", + "prosemirror-view": "^1.31.7", "vue": "^2.7.14", "vuedraggable": "^2.24.3", "vuelidate": "^0.7.7", @@ -24,22 +24,22 @@ }, "devDependencies": { "@vitejs/plugin-vue2": "^2.2.0", - "@vitest/coverage-v8": "^0.33.0", - "@vitest/ui": "^0.33.0", + "@vitest/coverage-v8": "^0.34.1", + "@vitest/ui": "^0.34.1", "@vue/test-utils": "^1.3.0", "autoprefixer": "^10.4.14", "cssnano": "^6.0.1", - "eslint": "^8.44.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-vue": "^9.15.1", + "eslint": "^8.46.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-vue": "^9.16.1", "jsdom": "^22.1.0", - "prettier": "^3.0.0", + "prettier": "^3.0.1", "rollup-plugin-external-globals": "^0.8.0", - "terser": "^5.19.0", - "vite": "^4.4.3", - "vite-plugin-static-copy": "^0.16.0", - "vitest": "^0.33.0", - "vue-docgen-api": "^4.73.0", + "terser": "^5.19.2", + "vite": "^4.4.8", + "vite-plugin-static-copy": "^0.17.0", + "vitest": "^0.34.1", + "vue-docgen-api": "^4.74.0", "vue-template-compiler": "^2.7.14" } }, @@ -146,18 +146,18 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.0.tgz", - "integrity": "sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", + "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", - "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.1.tgz", + "integrity": "sha512-9t7ZA7NGGK8ckelF0PQCfcxIUzs1Md5rrO6U/c+FIQNanea5UZC0wqKXH4vHBccmu4ZJgZ2idtPeW7+Q2npOEA==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -178,9 +178,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", - "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.46.0.tgz", + "integrity": "sha512-a8TLtmPi8xzPkCbp/OGFUo5yhRkHM2Ko9kOWP4znJr0WAhWyThaw3PnwX4vOTWOAMsV2uRt32PPDcEz63esSaA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -432,15 +432,15 @@ } }, "node_modules/@vitest/coverage-v8": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-0.33.0.tgz", - "integrity": "sha512-Rj5IzoLF7FLj6yR7TmqsfRDSeaFki6NAJ/cQexqhbWkHEV2htlVGrmuOde3xzvFsCbLCagf4omhcIaVmfU8Okg==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-0.34.1.tgz", + "integrity": "sha512-lRgUwjTMr8idXEbUPSNH4jjRZJXJCVY3BqUa+LDXyJVe3pldxYMn/r0HMqatKUGTp0Kyf1j5LfFoY6kRqRp7jw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", "@bcoe/v8-coverage": "^0.2.3", "istanbul-lib-coverage": "^3.2.0", - "istanbul-lib-report": "^3.0.0", + "istanbul-lib-report": "^3.0.1", "istanbul-lib-source-maps": "^4.0.1", "istanbul-reports": "^3.1.5", "magic-string": "^0.30.1", @@ -475,13 +475,13 @@ } }, "node_modules/@vitest/expect": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.33.0.tgz", - "integrity": "sha512-sVNf+Gla3mhTCxNJx+wJLDPp/WcstOe0Ksqz4Vec51MmgMth/ia0MGFEkIZmVGeTL5HtjYR4Wl/ZxBxBXZJTzQ==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.1.tgz", + "integrity": "sha512-q2CD8+XIsQ+tHwypnoCk8Mnv5e6afLFvinVGCq3/BOT4kQdVQmY6rRfyKkwcg635lbliLPqbunXZr+L1ssUWiQ==", "dev": true, "dependencies": { - "@vitest/spy": "0.33.0", - "@vitest/utils": "0.33.0", + "@vitest/spy": "0.34.1", + "@vitest/utils": "0.34.1", "chai": "^4.3.7" }, "funding": { @@ -489,12 +489,12 @@ } }, "node_modules/@vitest/runner": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.33.0.tgz", - "integrity": "sha512-UPfACnmCB6HKRHTlcgCoBh6ppl6fDn+J/xR8dTufWiKt/74Y9bHci5CKB8tESSV82zKYtkBJo9whU3mNvfaisg==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.1.tgz", + "integrity": "sha512-YfQMpYzDsYB7yqgmlxZ06NI4LurHWfrH7Wy3Pvf/z/vwUSgq1zLAb1lWcItCzQG+NVox+VvzlKQrYEXb47645g==", "dev": true, "dependencies": { - "@vitest/utils": "0.33.0", + "@vitest/utils": "0.34.1", "p-limit": "^4.0.0", "pathe": "^1.1.1" }, @@ -530,9 +530,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.33.0.tgz", - "integrity": "sha512-tJjrl//qAHbyHajpFvr8Wsk8DIOODEebTu7pgBrP07iOepR5jYkLFiqLq2Ltxv+r0uptUb4izv1J8XBOwKkVYA==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.1.tgz", + "integrity": "sha512-0O9LfLU0114OqdF8lENlrLsnn024Tb1CsS9UwG0YMWY2oGTQfPtkW+B/7ieyv0X9R2Oijhi3caB1xgGgEgclSQ==", "dev": true, "dependencies": { "magic-string": "^0.30.1", @@ -550,9 +550,9 @@ "dev": true }, "node_modules/@vitest/snapshot/node_modules/magic-string": { - "version": "0.30.1", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.1.tgz", - "integrity": "sha512-mbVKXPmS0z0G4XqFDCTllmDQ6coZzn94aMlb0o/A4HEHJCKcanlDZwYJgwnkmgD3jyWhUgj9VsPrfd972yPffA==", + "version": "0.30.2", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.2.tgz", + "integrity": "sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" @@ -562,9 +562,9 @@ } }, "node_modules/@vitest/spy": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.33.0.tgz", - "integrity": "sha512-Kv+yZ4hnH1WdiAkPUQTpRxW8kGtH8VRTnus7ZTGovFYM1ZezJpvGtb9nPIjPnptHbsyIAxYZsEpVPYgtpjGnrg==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.1.tgz", + "integrity": "sha512-UT4WcI3EAPUNO8n6y9QoEqynGGEPmmRxC+cLzneFFXpmacivjHZsNbiKD88KUScv5DCHVDgdBsLD7O7s1enFcQ==", "dev": true, "dependencies": { "tinyspy": "^2.1.1" @@ -574,12 +574,12 @@ } }, "node_modules/@vitest/ui": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.33.0.tgz", - "integrity": "sha512-7gbAjLqt30R4bodkJAutdpy4ncv+u5IKTHYTow1c2q+FOxZUC9cKOSqMUxjwaaTwLN+EnDnmXYPtg3CoahaUzQ==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.34.1.tgz", + "integrity": "sha512-bwmkgMjDcMr3pg0UXLwfwZ/WI1fq2N+5DUisqHkY9bvnNRnpT6QiewtSS/VhmN61ixgNpSKbEGVboml2GLuxfA==", "dev": true, "dependencies": { - "@vitest/utils": "0.33.0", + "@vitest/utils": "0.34.1", "fast-glob": "^3.3.0", "fflate": "^0.8.0", "flatted": "^3.2.7", @@ -595,9 +595,9 @@ } }, "node_modules/@vitest/utils": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.33.0.tgz", - "integrity": "sha512-pF1w22ic965sv+EN6uoePkAOTkAPWM03Ri/jXNyMIKBb/XHLDPfhLvf/Fa9g0YECevAIz56oVYXhodLvLQ/awA==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.1.tgz", + "integrity": "sha512-/ql9dsFi4iuEbiNcjNHQWXBum7aL8pyhxvfnD9gNtbjR9fUKAjxhj4AA3yfLXg6gJpMGGecvtF8Au2G9y3q47Q==", "dev": true, "dependencies": { "diff-sequences": "^29.4.3", @@ -1730,27 +1730,27 @@ } }, "node_modules/eslint": { - "version": "8.44.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.44.0.tgz", - "integrity": "sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A==", + "version": "8.46.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.46.0.tgz", + "integrity": "sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.1.0", - "@eslint/js": "8.44.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.1", + "@eslint/js": "^8.46.0", "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.0", - "eslint-visitor-keys": "^3.4.1", - "espree": "^9.6.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.2", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -1760,7 +1760,6 @@ "globals": "^13.19.0", "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", @@ -1772,7 +1771,6 @@ "natural-compare": "^1.4.0", "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "bin": { @@ -1786,9 +1784,9 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz", - "integrity": "sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -1798,17 +1796,17 @@ } }, "node_modules/eslint-plugin-vue": { - "version": "9.15.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.15.1.tgz", - "integrity": "sha512-CJE/oZOslvmAR9hf8SClTdQ9JLweghT6JCBQNrT2Iel1uVw0W0OLJxzvPd6CxmABKCvLrtyDnqGV37O7KQv6+A==", + "version": "9.16.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.16.1.tgz", + "integrity": "sha512-2FtnTqazA6aYONfDuOZTk0QzwhAwi7Z4+uJ7+GHeGxcKapjqWlDsRWDenvyG/utyOfAS5bVRmAG3cEWiYEz2bA==", "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.3.0", + "@eslint-community/eslint-utils": "^4.4.0", "natural-compare": "^1.4.0", - "nth-check": "^2.0.1", - "postcss-selector-parser": "^6.0.9", - "semver": "^7.3.5", - "vue-eslint-parser": "^9.3.0", + "nth-check": "^2.1.1", + "postcss-selector-parser": "^6.0.13", + "semver": "^7.5.4", + "vue-eslint-parser": "^9.3.1", "xml-name-validator": "^4.0.0" }, "engines": { @@ -1819,9 +1817,9 @@ } }, "node_modules/eslint-scope": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", - "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", @@ -1835,9 +1833,9 @@ } }, "node_modules/eslint-visitor-keys": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz", + "integrity": "sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1847,9 +1845,9 @@ } }, "node_modules/espree": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz", - "integrity": "sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { "acorn": "^8.9.0", @@ -2640,17 +2638,17 @@ } }, "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "dependencies": { "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", + "make-dir": "^4.0.0", "supports-color": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" } }, "node_modules/istanbul-lib-report/node_modules/supports-color": { @@ -2964,29 +2962,20 @@ } }, "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "dependencies": { - "semver": "^6.0.0" + "semver": "^7.5.3" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/mdn-data": { "version": "2.0.28", "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", @@ -3826,9 +3815,9 @@ } }, "node_modules/prettier": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", - "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.1.tgz", + "integrity": "sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -3855,9 +3844,9 @@ } }, "node_modules/pretty-format": { - "version": "29.6.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.1.tgz", - "integrity": "sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==", + "version": "29.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.2.tgz", + "integrity": "sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg==", "dev": true, "dependencies": { "@jest/schemas": "^29.6.0", @@ -3929,9 +3918,9 @@ } }, "node_modules/prosemirror-model": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.19.2.tgz", - "integrity": "sha512-RXl0Waiss4YtJAUY3NzKH0xkJmsZupCIccqcIFoLTIKFlKNbIvFDRl27/kQy1FP8iUAxrjRRfIVvOebnnXJgqQ==", + "version": "1.19.3", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.19.3.tgz", + "integrity": "sha512-tgSnwN7BS7/UM0sSARcW+IQryx2vODKX4MI7xpqY2X+iaepJdKBPc7I4aACIsDV/LTaTjt12Z56MhDr9LsyuZQ==", "dependencies": { "orderedmap": "^2.0.0" } @@ -3965,9 +3954,9 @@ } }, "node_modules/prosemirror-view": { - "version": "1.31.5", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.31.5.tgz", - "integrity": "sha512-tobRCDeCp61elR1d97XE/JTL9FDIfswZpWeNs7GKJjAJvWyMGHWYFCq29850p6bbG2bckP+i9n1vT56RifosbA==", + "version": "1.31.7", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.31.7.tgz", + "integrity": "sha512-Pr7w93yOYmxQwzGIRSaNLZ/1uM6YjnenASzN2H6fO6kGekuzRbgZ/4bHbBTd1u4sIQmL33/TcGmzxxidyPwCjg==", "dependencies": { "prosemirror-model": "^1.16.0", "prosemirror-state": "^1.0.0", @@ -4600,9 +4589,9 @@ "dev": true }, "node_modules/terser": { - "version": "5.19.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.0.tgz", - "integrity": "sha512-JpcpGOQLOXm2jsomozdMDpd5f8ZHh1rR48OFgWUH3QsyZcfPgv2qDCYbcDEAYNd4OZRj2bWYKpwdll/udZCk/Q==", + "version": "5.19.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", + "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -4670,9 +4659,9 @@ "dev": true }, "node_modules/tinypool": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.6.0.tgz", - "integrity": "sha512-FdswUUo5SxRizcBc6b1GSuLpLjisa8N8qMyYoP3rl+bym+QauhtJP5bvZY1ytt8krKGmMLYIRl36HBZfeAoqhQ==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.7.0.tgz", + "integrity": "sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==", "dev": true, "engines": { "node": ">=14.0.0" @@ -4781,9 +4770,9 @@ } }, "node_modules/ufo": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.1.2.tgz", - "integrity": "sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.2.0.tgz", + "integrity": "sha512-RsPyTbqORDNDxqAdQPQBpgqhWle1VcTSou/FraClYlHf6TZnQcGslpLcAphNR+sQW4q5lLWLbOsRlh9j24baQg==", "dev": true }, "node_modules/universalify": { @@ -4878,13 +4867,13 @@ } }, "node_modules/vite": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.4.tgz", - "integrity": "sha512-4mvsTxjkveWrKDJI70QmelfVqTm+ihFAb6+xf4sjEU2TmUCTlVX87tmg/QooPEMQb/lM9qGHT99ebqPziEd3wg==", + "version": "4.4.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.8.tgz", + "integrity": "sha512-LONawOUUjxQridNWGQlNizfKH89qPigK36XhMI7COMGztz8KNY0JHim7/xDd71CZwGT4HtSRgI7Hy+RlhG0Gvg==", "dev": true, "dependencies": { "esbuild": "^0.18.10", - "postcss": "^8.4.25", + "postcss": "^8.4.26", "rollup": "^3.25.2" }, "bin": { @@ -4933,9 +4922,9 @@ } }, "node_modules/vite-node": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.33.0.tgz", - "integrity": "sha512-19FpHYbwWWxDr73ruNahC+vtEdza52kA90Qb3La98yZ0xULqV8A5JLNPUff0f5zID4984tW7l3DH2przTJUZSw==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.1.tgz", + "integrity": "sha512-odAZAL9xFMuAg8aWd7nSPT+hU8u2r9gU3LRm9QKjxBEF2rRdWpMuqkrkjvyVQEdNFiBctqr2Gg4uJYizm5Le6w==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -4956,9 +4945,9 @@ } }, "node_modules/vite-plugin-static-copy": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-0.16.0.tgz", - "integrity": "sha512-dMVEg5Z2SwYRgQnHZaeokvSKB4p/TOTf65JU4sP3U6ccSBsukqdtDOjpmT+xzTFHAA8WJjcS31RMLjUdWQCBzw==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/vite-plugin-static-copy/-/vite-plugin-static-copy-0.17.0.tgz", + "integrity": "sha512-2HpNbHfDt8SDy393AGXh9llHkc8FJMQkI8s3T5WsH3SWLMO+f5cFIyPErl4yGKU9Uh3Vaqsd4lHZYTf042fQ2A==", "dev": true, "dependencies": { "chokidar": "^3.5.3", @@ -4988,19 +4977,19 @@ } }, "node_modules/vitest": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.33.0.tgz", - "integrity": "sha512-1CxaugJ50xskkQ0e969R/hW47za4YXDUfWJDxip1hwbnhUjYolpfUn2AMOulqG/Dtd9WYAtkHmM/m3yKVrEejQ==", + "version": "0.34.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.1.tgz", + "integrity": "sha512-G1PzuBEq9A75XSU88yO5G4vPT20UovbC/2osB2KEuV/FisSIIsw7m5y2xMdB7RsAGHAfg2lPmp2qKr3KWliVlQ==", "dev": true, "dependencies": { "@types/chai": "^4.3.5", "@types/chai-subset": "^1.3.3", "@types/node": "*", - "@vitest/expect": "0.33.0", - "@vitest/runner": "0.33.0", - "@vitest/snapshot": "0.33.0", - "@vitest/spy": "0.33.0", - "@vitest/utils": "0.33.0", + "@vitest/expect": "0.34.1", + "@vitest/runner": "0.34.1", + "@vitest/snapshot": "0.34.1", + "@vitest/spy": "0.34.1", + "@vitest/utils": "0.34.1", "acorn": "^8.9.0", "acorn-walk": "^8.2.0", "cac": "^6.7.14", @@ -5013,9 +5002,9 @@ "std-env": "^3.3.3", "strip-literal": "^1.0.1", "tinybench": "^2.5.0", - "tinypool": "^0.6.0", + "tinypool": "^0.7.0", "vite": "^3.0.0 || ^4.0.0", - "vite-node": "0.33.0", + "vite-node": "0.34.1", "why-is-node-running": "^2.2.2" }, "bin": { @@ -5101,9 +5090,9 @@ } }, "node_modules/vue-docgen-api": { - "version": "4.73.0", - "resolved": "https://registry.npmjs.org/vue-docgen-api/-/vue-docgen-api-4.73.0.tgz", - "integrity": "sha512-Hx3VZNi630q/JRhHsVo7qeLJdIDkz3JEp/LBITUZQoZBruGyQa7m80uxbEo4JGBpHMxWWHFO9AXrVy7jH4vzFA==", + "version": "4.74.0", + "resolved": "https://registry.npmjs.org/vue-docgen-api/-/vue-docgen-api-4.74.0.tgz", + "integrity": "sha512-NNYYt0cZzr1E5MeJX1sQEYlZ3QN2QIiZaxuBgqpnidICcLgtGxFtU9PDpsWKMNKIUgH++lWnNW+R1r7vP/WAAQ==", "dev": true, "dependencies": { "@babel/parser": "^7.21.4", @@ -5147,9 +5136,9 @@ } }, "node_modules/vue-eslint-parser": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.3.0.tgz", - "integrity": "sha512-48IxT9d0+wArT1+3wNIy0tascRoywqSUe2E1YalIC1L8jsUGe5aJQItWfRok7DVFGz3UYvzEI7n5wiTXsCMAcQ==", + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.3.1.tgz", + "integrity": "sha512-Clr85iD2XFZ3lJ52/ppmUDG/spxQu6+MAeHXjjyI4I1NUYZ9xmenQp4N0oaHJhrA8OOxltCVxMRfANGa70vU0g==", "dev": true, "dependencies": { "debug": "^4.3.4", diff --git a/panel/package.json b/panel/package.json index 9f721ae7dd..f6661a3215 100644 --- a/panel/package.json +++ b/panel/package.json @@ -23,9 +23,9 @@ "prosemirror-history": "^1.3.2", "prosemirror-inputrules": "^1.2.1", "prosemirror-keymap": "^1.2.2", - "prosemirror-model": "^1.19.2", + "prosemirror-model": "^1.19.3", "prosemirror-schema-list": "^1.3.0", - "prosemirror-view": "^1.31.5", + "prosemirror-view": "^1.31.7", "vue": "^2.7.14", "vuedraggable": "^2.24.3", "vuelidate": "^0.7.7", @@ -33,22 +33,22 @@ }, "devDependencies": { "@vitejs/plugin-vue2": "^2.2.0", - "@vitest/coverage-v8": "^0.33.0", - "@vitest/ui": "^0.33.0", + "@vitest/coverage-v8": "^0.34.1", + "@vitest/ui": "^0.34.1", "@vue/test-utils": "^1.3.0", "autoprefixer": "^10.4.14", "cssnano": "^6.0.1", - "eslint": "^8.44.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-vue": "^9.15.1", + "eslint": "^8.46.0", + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-vue": "^9.16.1", "jsdom": "^22.1.0", - "prettier": "^3.0.0", + "prettier": "^3.0.1", "rollup-plugin-external-globals": "^0.8.0", - "terser": "^5.19.0", - "vite": "^4.4.3", - "vite-plugin-static-copy": "^0.16.0", - "vitest": "^0.33.0", - "vue-docgen-api": "^4.73.0", + "terser": "^5.19.2", + "vite": "^4.4.8", + "vite-plugin-static-copy": "^0.17.0", + "vitest": "^0.34.1", + "vue-docgen-api": "^4.74.0", "vue-template-compiler": "^2.7.14" }, "browserslist": [ From 78cab0dd6a5da59498a76d9b47f20670ea43c99a Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Sun, 6 Aug 2023 13:31:25 +0200 Subject: [PATCH 04/58] Fix cs --- config/api/models/File.php | 2 +- config/api/models/FileBlueprint.php | 5 ++--- config/api/models/FileVersion.php | 2 +- config/api/models/Language.php | 2 +- config/api/models/Page.php | 2 +- config/api/models/PageBlueprint.php | 5 ++--- config/api/models/Role.php | 2 +- config/api/models/Site.php | 2 +- config/api/models/SiteBlueprint.php | 2 +- config/api/models/System.php | 2 +- config/api/models/Translation.php | 2 +- config/api/models/User.php | 2 +- config/api/models/UserBlueprint.php | 5 ++--- src/Cms/Items.php | 1 + 14 files changed, 17 insertions(+), 19 deletions(-) diff --git a/config/api/models/File.php b/config/api/models/File.php index 4e9a3a0486..b70919a891 100644 --- a/config/api/models/File.php +++ b/config/api/models/File.php @@ -59,7 +59,7 @@ 'url' => fn (File $file) => $file->url(), 'uuid' => fn (File $file) => $file->uuid()?->toString() ], - 'type' => 'Kirby\Cms\File', + 'type' => File::class, 'views' => [ 'default' => [ 'content', diff --git a/config/api/models/FileBlueprint.php b/config/api/models/FileBlueprint.php index e781e45e8f..f255c14ecf 100644 --- a/config/api/models/FileBlueprint.php +++ b/config/api/models/FileBlueprint.php @@ -12,7 +12,6 @@ 'tabs' => fn (FileBlueprint $blueprint) => $blueprint->tabs(), 'title' => fn (FileBlueprint $blueprint) => $blueprint->title(), ], - 'type' => 'Kirby\Cms\FileBlueprint', - 'views' => [ - ], + 'type' => FileBlueprint::class, + 'views' => [], ]; diff --git a/config/api/models/FileVersion.php b/config/api/models/FileVersion.php index df2aac018c..063e10b081 100644 --- a/config/api/models/FileVersion.php +++ b/config/api/models/FileVersion.php @@ -20,7 +20,7 @@ 'type' => fn (FileVersion $file) => $file->type(), 'url' => fn (FileVersion $file) => $file->url(), ], - 'type' => 'Kirby\Cms\FileVersion', + 'type' => FileVersion::class, 'views' => [ 'default' => [ 'dimensions', diff --git a/config/api/models/Language.php b/config/api/models/Language.php index 362d6f5efd..fcebad155d 100644 --- a/config/api/models/Language.php +++ b/config/api/models/Language.php @@ -15,7 +15,7 @@ 'rules' => fn (Language $language) => $language->rules(), 'url' => fn (Language $language) => $language->url(), ], - 'type' => 'Kirby\Cms\Language', + 'type' => Language::class, 'views' => [ 'default' => [ 'code', diff --git a/config/api/models/Page.php b/config/api/models/Page.php index 8941c00429..4ff6dbce83 100644 --- a/config/api/models/Page.php +++ b/config/api/models/Page.php @@ -40,7 +40,7 @@ 'url' => fn (Page $page) => $page->url(), 'uuid' => fn (Page $page) => $page->uuid()?->toString() ], - 'type' => 'Kirby\Cms\Page', + 'type' => Page::class, 'views' => [ 'compact' => [ 'id', diff --git a/config/api/models/PageBlueprint.php b/config/api/models/PageBlueprint.php index dc240ed894..e993b91ef2 100644 --- a/config/api/models/PageBlueprint.php +++ b/config/api/models/PageBlueprint.php @@ -15,7 +15,6 @@ 'tabs' => fn (PageBlueprint $blueprint) => $blueprint->tabs(), 'title' => fn (PageBlueprint $blueprint) => $blueprint->title(), ], - 'type' => 'Kirby\Cms\PageBlueprint', - 'views' => [ - ], + 'type' => PageBlueprint::class, + 'views' => [], ]; diff --git a/config/api/models/Role.php b/config/api/models/Role.php index e1d27c3507..3c2b468edf 100644 --- a/config/api/models/Role.php +++ b/config/api/models/Role.php @@ -12,7 +12,7 @@ 'permissions' => fn (Role $role) => $role->permissions()->toArray(), 'title' => fn (Role $role) => $role->title(), ], - 'type' => 'Kirby\Cms\Role', + 'type' => Role::class, 'views' => [ 'compact' => [ 'description', diff --git a/config/api/models/Site.php b/config/api/models/Site.php index c312ef420c..81cab62471 100644 --- a/config/api/models/Site.php +++ b/config/api/models/Site.php @@ -19,7 +19,7 @@ 'title' => fn (Site $site) => $site->title()->value(), 'url' => fn (Site $site) => $site->url(), ], - 'type' => 'Kirby\Cms\Site', + 'type' => Site::class, 'views' => [ 'compact' => [ 'title', diff --git a/config/api/models/SiteBlueprint.php b/config/api/models/SiteBlueprint.php index 7841841b65..69aad5ba90 100644 --- a/config/api/models/SiteBlueprint.php +++ b/config/api/models/SiteBlueprint.php @@ -12,6 +12,6 @@ 'tabs' => fn (SiteBlueprint $blueprint) => $blueprint->tabs(), 'title' => fn (SiteBlueprint $blueprint) => $blueprint->title(), ], - 'type' => 'Kirby\Cms\SiteBlueprint', + 'type' => SiteBlueprint::class, 'views' => [], ]; diff --git a/config/api/models/System.php b/config/api/models/System.php index 725d3ed286..4627226495 100644 --- a/config/api/models/System.php +++ b/config/api/models/System.php @@ -49,7 +49,7 @@ return null; } ], - 'type' => 'Kirby\Cms\System', + 'type' => System::class, 'views' => [ 'login' => [ 'authStatus', diff --git a/config/api/models/Translation.php b/config/api/models/Translation.php index faf51e7f5d..94f9c02962 100644 --- a/config/api/models/Translation.php +++ b/config/api/models/Translation.php @@ -13,7 +13,7 @@ 'id' => fn (Translation $translation) => $translation->id(), 'name' => fn (Translation $translation) => $translation->name(), ], - 'type' => 'Kirby\Cms\Translation', + 'type' => Translation::class, 'views' => [ 'compact' => [ 'direction', diff --git a/config/api/models/User.php b/config/api/models/User.php index 89e20ddf21..0da32e9100 100644 --- a/config/api/models/User.php +++ b/config/api/models/User.php @@ -27,7 +27,7 @@ 'username' => fn (User $user) => $user->username(), 'uuid' => fn (User $user) => $user->uuid()?->toString() ], - 'type' => 'Kirby\Cms\User', + 'type' => User::class, 'views' => [ 'default' => [ 'avatar', diff --git a/config/api/models/UserBlueprint.php b/config/api/models/UserBlueprint.php index 099a177f84..2fa83e9898 100644 --- a/config/api/models/UserBlueprint.php +++ b/config/api/models/UserBlueprint.php @@ -12,7 +12,6 @@ 'tabs' => fn (UserBlueprint $blueprint) => $blueprint->tabs(), 'title' => fn (UserBlueprint $blueprint) => $blueprint->title(), ], - 'type' => 'Kirby\Cms\UserBlueprint', - 'views' => [ - ], + 'type' => UserBlueprint::class, + 'views' => [], ]; diff --git a/src/Cms/Items.php b/src/Cms/Items.php index 4f29114344..97f8104590 100644 --- a/src/Cms/Items.php +++ b/src/Cms/Items.php @@ -3,6 +3,7 @@ namespace Kirby\Cms; use Closure; +use Kirby\Content\Field; use Kirby\Exception\InvalidArgumentException; /** From 7b931596a1ea8d95068a1da45155ea75cd15a471 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Sun, 6 Aug 2023 14:56:11 +0200 Subject: [PATCH 05/58] Tabs: fix more btn/icon --- panel/src/components/Layout/Tabs.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panel/src/components/Layout/Tabs.vue b/panel/src/components/Layout/Tabs.vue index 57a0980ea0..1dcb289935 100644 --- a/panel/src/components/Layout/Tabs.vue +++ b/panel/src/components/Layout/Tabs.vue @@ -20,9 +20,10 @@ Date: Sun, 6 Aug 2023 14:57:09 +0200 Subject: [PATCH 06/58] Grid: keep columns for longer --- panel/src/components/Layout/Grid.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/src/components/Layout/Grid.vue b/panel/src/components/Layout/Grid.vue index 97dc7524e9..eb531f0f62 100644 --- a/panel/src/components/Layout/Grid.vue +++ b/panel/src/components/Layout/Grid.vue @@ -47,7 +47,7 @@ export default { --span: calc(var(--columns) * var(--width)); } -@container (min-width: 50rem) { +@container (min-width: 40rem) { .k-grid { grid-template-columns: repeat(var(--columns), 1fr); } From e9b3b81a4008ce1e974cf08fc73901eca1e67eed Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Tue, 8 Aug 2023 16:20:53 +0200 Subject: [PATCH 07/58] Fix js unit test --- panel/src/helpers/url.base.test.js | 4 ++-- panel/src/helpers/url.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/panel/src/helpers/url.base.test.js b/panel/src/helpers/url.base.test.js index 10f7fdbf03..440a3909c2 100644 --- a/panel/src/helpers/url.base.test.js +++ b/panel/src/helpers/url.base.test.js @@ -9,9 +9,9 @@ describe("$helper.url.base", () => { it("should return the base href", () => { const base = document.createElement("base"); - base.href = "https://getkirby.com"; + base.href = "http://localhost:3000"; const result = url.base(); - expect(result).toStrictEqual(new URL("https://getkirby.com")); + expect(result).toStrictEqual(new URL("http://localhost:3000")); }); }); diff --git a/panel/src/helpers/url.js b/panel/src/helpers/url.js index 3e7cae2557..e7e62f6d7e 100644 --- a/panel/src/helpers/url.js +++ b/panel/src/helpers/url.js @@ -4,7 +4,7 @@ */ export function base() { return new URL( - document.querySelector("base")?.href || window.location.origin + document.querySelector("base")?.href ?? window.location.origin ); } From 8a256887a1974abe2c71f9d05534433632caa715 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 3 Aug 2023 14:34:02 +0200 Subject: [PATCH 08/58] Remix icons --- panel/public/img/icons.svg | 87 ++++++++++------------ panel/src/components/Misc/Icon.vue | 2 +- panel/src/components/Navigation/Button.vue | 1 - 3 files changed, 39 insertions(+), 51 deletions(-) diff --git a/panel/public/img/icons.svg b/panel/public/img/icons.svg index 4a3f838d3a..e023d20d43 100644 --- a/panel/public/img/icons.svg +++ b/panel/public/img/icons.svg @@ -1,12 +1,10 @@ From a277736d2904e2dc1f9401017b24db639682904c Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 3 Aug 2023 19:02:03 +0200 Subject: [PATCH 11/58] More icons --- panel/public/img/icons.svg | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/panel/public/img/icons.svg b/panel/public/img/icons.svg index ea25a09fab..41373355ea 100644 --- a/panel/public/img/icons.svg +++ b/panel/public/img/icons.svg @@ -89,11 +89,8 @@ - - - - - + + @@ -163,8 +160,8 @@ - - + + From c14d54d43338c3af976dde5228cd18dba475d77e Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 3 Aug 2023 19:06:24 +0200 Subject: [PATCH 12/58] and some more --- panel/public/img/icons.svg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panel/public/img/icons.svg b/panel/public/img/icons.svg index 41373355ea..035a1ef4f3 100644 --- a/panel/public/img/icons.svg +++ b/panel/public/img/icons.svg @@ -596,8 +596,8 @@ - - + + @@ -620,8 +620,8 @@ - - + + From 8fba63aa9ec74b81a4cfcfa48ba92d6bc93a59e3 Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 3 Aug 2023 19:12:40 +0200 Subject: [PATCH 13/58] Use smaller dots to fit the draggable icon --- panel/public/img/icons.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/public/img/icons.svg b/panel/public/img/icons.svg index 035a1ef4f3..49fe465166 100644 --- a/panel/public/img/icons.svg +++ b/panel/public/img/icons.svg @@ -151,7 +151,7 @@ - + From 2e17551e3019a3229b8740dc8eb9d7cdd756c69a Mon Sep 17 00:00:00 2001 From: Bastian Allgeier Date: Thu, 3 Aug 2023 19:18:21 +0200 Subject: [PATCH 14/58] New menu icon --- panel/public/img/icons.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panel/public/img/icons.svg b/panel/public/img/icons.svg index 49fe465166..7418d81d5a 100644 --- a/panel/public/img/icons.svg +++ b/panel/public/img/icons.svg @@ -36,8 +36,8 @@ - - + + From a07acf75695fb7050b23fe92352990d7a3a70522 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 3 Aug 2023 19:44:38 +0200 Subject: [PATCH 15/58] Icon for info field and info section --- config/fields/info.php | 1 - config/sections/info.php | 4 ++++ panel/src/components/Forms/Field/InfoField.vue | 6 +++++- panel/src/components/Sections/InfoSection.vue | 4 +++- tests/Cms/Sections/InfoSectionTest.php | 2 ++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/config/fields/info.php b/config/fields/info.php index 4df8ed341b..e65dc83065 100644 --- a/config/fields/info.php +++ b/config/fields/info.php @@ -12,7 +12,6 @@ 'before' => null, 'default' => null, 'disabled' => null, - 'icon' => null, 'placeholder' => null, 'required' => null, 'translate' => null, diff --git a/config/sections/info.php b/config/sections/info.php index bc390c71a4..7999aac542 100644 --- a/config/sections/info.php +++ b/config/sections/info.php @@ -7,6 +7,9 @@ 'headline', ], 'props' => [ + 'icon' => function (string $icon = null) { + return $icon; + }, 'text' => function ($text = null) { return I18n::translate($text, $text); }, @@ -25,6 +28,7 @@ ], 'toArray' => function () { return [ + 'icon' => $this->icon, 'label' => $this->headline, 'text' => $this->text, 'theme' => $this->theme diff --git a/panel/src/components/Forms/Field/InfoField.vue b/panel/src/components/Forms/Field/InfoField.vue index f7218958e3..f728df98d6 100644 --- a/panel/src/components/Forms/Field/InfoField.vue +++ b/panel/src/components/Forms/Field/InfoField.vue @@ -1,7 +1,7 @@ From 915ac5f26fce62e61d89ad021da361222c6da877 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 3 Aug 2023 23:57:50 +0200 Subject: [PATCH 26/58] Better title icon --- panel/public/img/icons.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/public/img/icons.svg b/panel/public/img/icons.svg index 79cdd50f8f..cf03981127 100644 --- a/panel/public/img/icons.svg +++ b/panel/public/img/icons.svg @@ -577,7 +577,7 @@ - + From b993a8f50289027a7242b84f89fd0ed11bb51acd Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 3 Aug 2023 23:58:57 +0200 Subject: [PATCH 27/58] Better layers icon --- panel/public/img/icons.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/public/img/icons.svg b/panel/public/img/icons.svg index cf03981127..1948db4775 100644 --- a/panel/public/img/icons.svg +++ b/panel/public/img/icons.svg @@ -342,7 +342,7 @@ - + From 4762d39c1beec6add7d3ab65e1e65f03bf7271d2 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Fri, 4 Aug 2023 16:33:10 +0200 Subject: [PATCH 28/58] Add license info --- panel/public/img/icons.svg | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/panel/public/img/icons.svg b/panel/public/img/icons.svg index 1948db4775..5f4238e39e 100644 --- a/panel/public/img/icons.svg +++ b/panel/public/img/icons.svg @@ -1,3 +1,7 @@ +
+  
+    This is some code
+  
+
+`; From ef7b34bd4c0cc87368685ea0042480a5883deb24 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Sun, 6 Aug 2023 14:02:10 +0200 Subject: [PATCH 45/58] Clean up `Api` package --- config/api/collections.php | 22 ++++++--- config/api/routes.php | 5 +- src/Api/Api.php | 95 +++++++++++++++++++++++--------------- src/Api/Collection.php | 22 ++++----- src/Api/Model.php | 17 ++++--- src/Cms/Api.php | 25 ++++++---- 6 files changed, 113 insertions(+), 73 deletions(-) diff --git a/config/api/collections.php b/config/api/collections.php index 3a34927e02..97b2180fbc 100644 --- a/config/api/collections.php +++ b/config/api/collections.php @@ -3,6 +3,14 @@ /** * Api Collection Definitions */ + +use Kirby\Cms\Files; +use Kirby\Cms\Languages; +use Kirby\Cms\Pages; +use Kirby\Cms\Roles; +use Kirby\Cms\Translations; +use Kirby\Cms\Users; + return [ /** @@ -10,7 +18,7 @@ */ 'children' => [ 'model' => 'page', - 'type' => 'Kirby\Cms\Pages', + 'type' => Pages::class, 'view' => 'compact' ], @@ -19,7 +27,7 @@ */ 'files' => [ 'model' => 'file', - 'type' => 'Kirby\Cms\Files' + 'type' => Files::class, ], /** @@ -27,7 +35,7 @@ */ 'languages' => [ 'model' => 'language', - 'type' => 'Kirby\Cms\Languages' + 'type' => Languages::class, ], /** @@ -35,7 +43,7 @@ */ 'pages' => [ 'model' => 'page', - 'type' => 'Kirby\Cms\Pages', + 'type' => Pages::class, 'view' => 'compact' ], @@ -44,7 +52,7 @@ */ 'roles' => [ 'model' => 'role', - 'type' => 'Kirby\Cms\Roles', + 'type' => Roles::class, 'view' => 'compact' ], @@ -53,7 +61,7 @@ */ 'translations' => [ 'model' => 'translation', - 'type' => 'Kirby\Cms\Translations', + 'type' => Translations::class, 'view' => 'compact' ], @@ -63,7 +71,7 @@ 'users' => [ 'default' => fn () => $this->users(), 'model' => 'user', - 'type' => 'Kirby\Cms\Users', + 'type' => Users::class, 'view' => 'compact' ] diff --git a/config/api/routes.php b/config/api/routes.php index 749fbad9d1..aca9e7905f 100644 --- a/config/api/routes.php +++ b/config/api/routes.php @@ -19,7 +19,10 @@ // only add the language routes if the // multi language setup is activated if ($kirby->option('languages', false) !== false) { - $routes = array_merge($routes, include __DIR__ . '/routes/languages.php'); + $routes = array_merge( + $routes, + include __DIR__ . '/routes/languages.php' + ); } return $routes; diff --git a/src/Api/Api.php b/src/Api/Api.php index e805bd6257..76306e4abe 100644 --- a/src/Api/Api.php +++ b/src/Api/Api.php @@ -126,8 +126,6 @@ public function authenticate() /** * Returns the authentication callback - * - * @return \Closure|null */ public function authentication(): Closure|null { @@ -141,8 +139,11 @@ public function authentication(): Closure|null * @throws \Kirby\Exception\NotFoundException * @throws \Exception */ - public function call(string|null $path = null, string $method = 'GET', array $requestData = []) - { + public function call( + string|null $path = null, + string $method = 'GET', + array $requestData = [] + ): mixed { $path = rtrim($path ?? '', '/'); $this->setRequestMethod($method); @@ -229,8 +230,10 @@ public function clone(array $props = []): static * @throws \Kirby\Exception\NotFoundException If no collection for `$name` exists * @throws \Exception */ - public function collection(string $name, array|BaseCollection|null $collection = null): Collection - { + public function collection( + string $name, + array|BaseCollection|null $collection = null + ): Collection { if (isset($this->collections[$name]) === false) { throw new NotFoundException(sprintf('The collection "%s" does not exist', $name)); } @@ -252,7 +255,7 @@ public function collections(): array * * @throws \Kirby\Exception\NotFoundException If no data for `$key` exists */ - public function data(string|null $key = null, ...$args) + public function data(string|null $key = null, ...$args): mixed { if ($key === null) { return $this->data; @@ -293,8 +296,10 @@ public function hasData(string $key): bool * @param array models or collections * @return string|null key of match */ - protected function match(array $array, $object = null): string|null - { + protected function match( + array $array, + $object = null + ): string|null { foreach ($array as $definition => $model) { if ($object instanceof $model['type']) { return $definition; @@ -309,8 +314,10 @@ protected function match(array $array, $object = null): string|null * * @throws \Kirby\Exception\NotFoundException If no model for `$name` exists */ - public function model(string|null $name = null, $object = null): Model - { + public function model( + string|null $name = null, + $object = null + ): Model { // Try to auto-match object with API models $name ??= $this->match($this->models, $object); @@ -333,17 +340,12 @@ public function models(): array * Getter for request data * Can either get all the data * or certain parts of it. - * - * @param string|null $type - * @param string|null $key - * @param mixed $default - * @return mixed */ public function requestData( string|null $type = null, string|null $key = null, - $default = null - ) { + mixed $default = null + ): mixed { if ($type === null) { return $this->requestData; } @@ -361,24 +363,30 @@ public function requestData( /** * Returns the request body if available */ - public function requestBody(string|null $key = null, $default = null) - { + public function requestBody( + string|null $key = null, + mixed $default = null + ): mixed { return $this->requestData('body', $key, $default); } /** * Returns the files from the request if available */ - public function requestFiles(string|null $key = null, $default = null) - { + public function requestFiles( + string|null $key = null, + mixed $default = null + ): mixed { return $this->requestData('files', $key, $default); } /** * Returns all headers from the request if available */ - public function requestHeaders(string|null $key = null, $default = null) - { + public function requestHeaders( + string|null $key = null, + mixed $default = null + ): mixed { return $this->requestData('headers', $key, $default); } @@ -393,8 +401,10 @@ public function requestMethod(): string|null /** * Returns the request query if available */ - public function requestQuery(string|null $key = null, $default = null) - { + public function requestQuery( + string|null $key = null, + mixed $default = null + ): mixed { return $this->requestData('query', $key, $default); } @@ -435,8 +445,11 @@ public function routes(): array /** * Renders the API call */ - public function render(string $path, string $method = 'GET', array $requestData = []) - { + public function render( + string $path, + string $method = 'GET', + array $requestData = [] + ): mixed { try { $result = $this->call($path, $method, $requestData); } catch (Throwable $e) { @@ -561,8 +574,9 @@ public function responseForException(Throwable $e): array * Setter for the request data * @return $this */ - protected function setRequestData(array|null $requestData = []): static - { + protected function setRequestData( + array|null $requestData = [] + ): static { $defaults = [ 'query' => [], 'body' => [], @@ -577,8 +591,9 @@ protected function setRequestData(array|null $requestData = []): static * Setter for the request method * @return $this */ - protected function setRequestMethod(string $requestMethod = null): static - { + protected function setRequestMethod( + string $requestMethod = null + ): static { $this->requestMethod = $requestMethod ?? 'GET'; return $this; } @@ -591,8 +606,11 @@ protected function setRequestMethod(string $requestMethod = null): static * * @throws \Exception If request has no files or there was an error with the upload */ - public function upload(Closure $callback, bool $single = false, bool $debug = false): array - { + public function upload( + Closure $callback, + bool $single = false, + bool $debug = false + ): array { $trials = 0; $uploads = []; $errors = []; @@ -632,8 +650,9 @@ public function upload(Closure $callback, bool $single = false, bool $debug = fa try { if ($upload['error'] !== 0) { - $errorMessage = $errorMessages[$upload['error']] ?? I18n::translate('upload.error.default'); - throw new Exception($errorMessage); + throw new Exception( + $errorMessages[$upload['error']] ?? I18n::translate('upload.error.default') + ); } // get the extension of the uploaded file @@ -660,7 +679,9 @@ public function upload(Closure $callback, bool $single = false, bool $debug = fa $debug === false && move_uploaded_file($upload['tmp_name'], $source) === false ) { - throw new Exception(I18n::translate('upload.error.cantMove')); + throw new Exception( + I18n::translate('upload.error.cantMove') + ); } $data = $callback($source, $filename); diff --git a/src/Api/Collection.php b/src/Api/Collection.php index cc71b2410d..af66235297 100644 --- a/src/Api/Collection.php +++ b/src/Api/Collection.php @@ -4,6 +4,7 @@ use Closure; use Exception; +use Kirby\Toolkit\Collection as BaseCollection; use Kirby\Toolkit\Str; /** @@ -20,23 +21,22 @@ */ class Collection { - protected Api $api; - protected $data; - protected $model; - protected $select = null; - protected $view; + protected string|null $model; + protected array|null $select = null; + protected string|null $view; /** * Collection constructor * * @throws \Exception */ - public function __construct(Api $api, $data, array $schema) - { - $this->api = $api; - $this->data = $data; - $this->model = $schema['model'] ?? null; - $this->view = $schema['view'] ?? null; + public function __construct( + protected Api $api, + protected BaseCollection|array|null $data, + array $schema + ) { + $this->model = $schema['model'] ?? null; + $this->view = $schema['view'] ?? null; if ($data === null) { if (($schema['default'] ?? null) instanceof Closure === false) { diff --git a/src/Api/Model.php b/src/Api/Model.php index ba14cb28ad..0c78f93b91 100644 --- a/src/Api/Model.php +++ b/src/Api/Model.php @@ -22,21 +22,20 @@ */ class Model { - protected Api $api; - protected $data; - protected $fields; - protected $select; - protected $views; + protected array $fields; + protected array|null $select; + protected array $views; /** * Model constructor * * @throws \Exception */ - public function __construct(Api $api, $data, array $schema) - { - $this->api = $api; - $this->data = $data; + public function __construct( + protected Api $api, + protected object|array|string|null $data, + array $schema + ) { $this->fields = $schema['fields'] ?? []; $this->select = $schema['select'] ?? null; $this->views = $schema['views'] ?? []; diff --git a/src/Cms/Api.php b/src/Cms/Api.php index 17c510f6f9..103cc61e47 100644 --- a/src/Cms/Api.php +++ b/src/Cms/Api.php @@ -34,7 +34,7 @@ public function call( string|null $path = null, string $method = 'GET', array $requestData = [] - ) { + ): mixed { $this->setRequestMethod($method); $this->setRequestData($requestData); @@ -63,8 +63,11 @@ public function clone(array $props = []): static /** * @throws \Kirby\Exception\NotFoundException if the field type cannot be found or the field cannot be loaded */ - public function fieldApi($model, string $name, string|null $path = null) - { + public function fieldApi( + ModelWithContent $model, + string $name, + string|null $path = null + ): mixed { $field = Form::for($model)->field($name); $fieldApi = $this->clone([ @@ -86,8 +89,10 @@ public function fieldApi($model, string $name, string|null $path = null) * @param string|null $path Path to file's parent model * @throws \Kirby\Exception\NotFoundException if the file cannot be found */ - public function file(string|null $path = null, string $filename): File|null - { + public function file( + string|null $path = null, + string $filename + ): File|null { return Find::file($path, $filename); } @@ -127,7 +132,9 @@ public function kirby(): App */ public function language(): string|null { - return $this->requestQuery('language') ?? $this->requestHeaders('x-language'); + return + $this->requestQuery('language') ?? + $this->requestHeaders('x-language'); } /** @@ -146,8 +153,10 @@ public function page(string $id): Page|null * parent. The subpages can be filtered * by status (draft, listed, unlisted, published, all) */ - public function pages(string|null $parentId = null, string|null $status = null): Pages - { + public function pages( + string|null $parentId = null, + string|null $status = null + ): Pages { $parent = $parentId === null ? $this->site() : $this->page($parentId); $pages = match ($status) { 'all' => $parent->childrenAndDrafts(), From abf3611bfcfcb9e8705f8db3bfd470128b0bc822 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Thu, 10 Aug 2023 23:58:32 +0200 Subject: [PATCH 46/58] Fix cs using `??` --- panel/src/api/auth.js | 2 +- panel/src/api/pages.js | 4 ++-- panel/src/components/Collection/Items.vue | 2 +- panel/src/components/Forms/Blocks/Blocks.vue | 2 +- panel/src/components/Forms/Blocks/Types/Image.vue | 4 ++-- panel/src/components/Forms/Field/ObjectField.vue | 4 ++-- panel/src/components/Forms/Field/PagesField.vue | 2 +- panel/src/components/Forms/Field/StructureField.vue | 2 +- panel/src/components/Forms/Field/TimeField.vue | 4 ++-- panel/src/components/Forms/Field/UsersField.vue | 2 +- panel/src/components/Forms/Input/DateInput.vue | 6 +++--- panel/src/components/Forms/Input/NumberInput.vue | 4 ++-- panel/src/components/Forms/Input/RangeInput.vue | 2 +- panel/src/components/Forms/Input/SelectInput.vue | 2 +- panel/src/components/Forms/Input/ToggleInput.vue | 2 +- panel/src/components/Forms/Input/TogglesInput.vue | 2 +- panel/src/components/Forms/Layouts/Layouts.vue | 2 +- .../Forms/Previews/BubblesFieldPreview.vue | 2 +- .../components/Forms/Previews/DateFieldPreview.vue | 4 ++-- .../components/Forms/Previews/TimeFieldPreview.vue | 2 +- panel/src/components/Forms/Writer/Emitter.js | 6 +++--- panel/src/components/Forms/Writer/Extensions.js | 2 +- panel/src/components/Layout/Table.vue | 6 +++--- panel/src/components/Layout/TableCell.vue | 2 +- panel/src/components/Layout/Tabs.vue | 4 ++-- panel/src/components/Misc/ErrorBoundary.vue | 2 +- panel/src/components/Navigation/Breadcrumb.vue | 4 ++-- panel/src/components/Navigation/Navigate.js | 2 +- panel/src/components/Sections/ModelsSection.vue | 4 ++-- panel/src/components/Sections/PagesSection.vue | 4 ++-- panel/src/components/Views/Login/LoginView.vue | 2 +- panel/src/components/Views/System/SystemSecurity.vue | 4 ++-- panel/src/errors/RequestError.js | 2 +- panel/src/helpers/object.js | 4 ++-- panel/src/helpers/sort.js | 4 +--- panel/src/helpers/url.js | 2 +- panel/src/libraries/colors.js | 4 ++-- panel/src/libraries/dayjs-interpret.test.js | 4 ++-- panel/src/panel/upload.js | 2 +- panel/src/store/modules/content.js | 12 ++++++------ panel/vite.config.js | 2 +- 41 files changed, 66 insertions(+), 68 deletions(-) diff --git a/panel/src/api/auth.js b/panel/src/api/auth.js index 07afb4a9c9..bf2a796606 100644 --- a/panel/src/api/auth.js +++ b/panel/src/api/auth.js @@ -1,7 +1,7 @@ export default (api) => ({ async login(user) { const data = { - long: user.remember || false, + long: user.remember ?? false, email: user.email, password: user.password }; diff --git a/panel/src/api/pages.js b/panel/src/api/pages.js index 674cad2179..e52ad1034b 100644 --- a/panel/src/api/pages.js +++ b/panel/src/api/pages.js @@ -40,8 +40,8 @@ export default (api) => ({ async duplicate(id, slug, options) { return api.post("pages/" + this.id(id) + "/duplicate", { slug: slug, - children: options.children || false, - files: options.files || false + children: options.children ?? false, + files: options.files ?? false }); }, async get(id, query) { diff --git a/panel/src/components/Collection/Items.vue b/panel/src/components/Collection/Items.vue index 4f42729fc1..46cf02441a 100644 --- a/panel/src/components/Collection/Items.vue +++ b/panel/src/components/Collection/Items.vue @@ -24,7 +24,7 @@