From 8ac9301c7abc5211edccc2ede40fbbaf42f7e203 Mon Sep 17 00:00:00 2001 From: trean Date: Fri, 5 Dec 2025 19:32:00 +0100 Subject: [PATCH 1/6] sidebar WIP --- package-lock.json | 140 ++++++++--------------------------- src/CreateCollectionForm.jsx | 34 +++++---- src/Sidebar.jsx | 51 +++++++++++++ src/ThemedComponents.jsx | 8 +- src/prepareOutput.js | 9 ++- 5 files changed, 108 insertions(+), 134 deletions(-) create mode 100644 src/Sidebar.jsx diff --git a/package-lock.json b/package-lock.json index e03c5e2..570dacd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,6 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", - "peer": true, "dependencies": { "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", @@ -48,7 +47,6 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.1.tgz", "integrity": "sha512-UnJfnIpc/+JO0/+KRVQNGU+y5taA5vCbwN8+azkX6beii/ZF+enZJSOKo11ZSzGJjlNfJHfQtmQT8H+9TXPG2w==", - "peer": true, "dependencies": { "@babel/parser": "^7.27.1", "@babel/types": "^7.27.1", @@ -64,7 +62,6 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.27.1.tgz", "integrity": "sha512-0gSFWUPNXNopqtIPQvlD5WgXYI5GY2kP2cCvoT8kczjbfcfuIljTbcWrulD1CIPIX2gt1wghbDy08yE1p+/r3w==", - "peer": true, "dependencies": { "@babel/traverse": "^7.27.1", "@babel/types": "^7.27.1" @@ -77,7 +74,6 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", - "peer": true, "engines": { "node": ">=6.9.0" } @@ -86,7 +82,6 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", - "peer": true, "engines": { "node": ">=6.9.0" } @@ -95,7 +90,6 @@ "version": "7.27.2", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.2.tgz", "integrity": "sha512-QYLs8299NA7WM/bZAdp+CviYYkVoYXlDW2rzliy3chxd1PQjej7JORuMJDJXJUb9g0TT+B99EwaVLKmX+sPXWw==", - "peer": true, "dependencies": { "@babel/types": "^7.27.1" }, @@ -110,7 +104,6 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.1.tgz", "integrity": "sha512-1x3D2xEk2fRo3PAhwQwu5UubzgiVWSXTBfWpVd2Mx2AzRqJuDJCsgaDVZ7HB5iGzDW1Hl1sWN2mFyKjmR9uAog==", - "peer": true, "engines": { "node": ">=6.9.0" } @@ -119,7 +112,6 @@ "version": "7.27.2", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz", "integrity": "sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==", - "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/parser": "^7.27.2", @@ -133,7 +125,6 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.1.tgz", "integrity": "sha512-ZCYtZciz1IWJB4U61UPu4KEaqyfj+r5T1Q5mqPo+IBpcG9kHv30Z0aD8LXPgC1trYa6rK0orRyAhqUgk4MjmEg==", - "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.27.1", @@ -151,7 +142,6 @@ "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "peer": true, "engines": { "node": ">=4" } @@ -160,7 +150,6 @@ "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz", "integrity": "sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==", - "peer": true, "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" @@ -173,7 +162,6 @@ "version": "11.13.5", "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.13.5.tgz", "integrity": "sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ==", - "peer": true, "dependencies": { "@babel/helper-module-imports": "^7.16.7", "@babel/runtime": "^7.18.3", @@ -192,7 +180,6 @@ "version": "11.14.0", "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.14.0.tgz", "integrity": "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA==", - "peer": true, "dependencies": { "@emotion/memoize": "^0.9.0", "@emotion/sheet": "^1.4.0", @@ -204,14 +191,12 @@ "node_modules/@emotion/hash": { "version": "0.9.2", "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.2.tgz", - "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==", - "peer": true + "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==" }, "node_modules/@emotion/is-prop-valid": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.3.1.tgz", "integrity": "sha512-/ACwoqx7XQi9knQs/G0qKvv5teDMhD7bXYns9N/wM8ah8iNb8jZ2uNO0YOgiq2o2poIvVtJS2YALasQuMSQ7Kw==", - "peer": true, "dependencies": { "@emotion/memoize": "^0.9.0" } @@ -219,8 +204,7 @@ "node_modules/@emotion/memoize": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", - "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", - "peer": true + "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==" }, "node_modules/@emotion/react": { "version": "11.14.0", @@ -250,7 +234,6 @@ "version": "1.3.3", "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.3.3.tgz", "integrity": "sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA==", - "peer": true, "dependencies": { "@emotion/hash": "^0.9.2", "@emotion/memoize": "^0.9.0", @@ -262,8 +245,7 @@ "node_modules/@emotion/sheet": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.4.0.tgz", - "integrity": "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==", - "peer": true + "integrity": "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==" }, "node_modules/@emotion/styled": { "version": "11.14.0", @@ -291,14 +273,12 @@ "node_modules/@emotion/unitless": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.10.0.tgz", - "integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==", - "peer": true + "integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==" }, "node_modules/@emotion/use-insertion-effect-with-fallbacks": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.2.0.tgz", "integrity": "sha512-yJMtVdH59sxi/aVJBpk9FQq+OR8ll5GT8oWd57UpeaKEVGab41JWaCFA7FRLoMLloOZF/c/wsPoe+bfGmRKgDg==", - "peer": true, "peerDependencies": { "react": ">=16.8.0" } @@ -306,14 +286,12 @@ "node_modules/@emotion/utils": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.4.2.tgz", - "integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==", - "peer": true + "integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==" }, "node_modules/@emotion/weak-memoize": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz", - "integrity": "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==", - "peer": true + "integrity": "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==" }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.4", @@ -918,7 +896,6 @@ "version": "0.3.8", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", - "peer": true, "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -932,7 +909,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "peer": true, "engines": { "node": ">=6.0.0" } @@ -941,7 +917,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "peer": true, "engines": { "node": ">=6.0.0" } @@ -955,7 +930,6 @@ "version": "0.3.25", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -965,7 +939,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-7.1.0.tgz", "integrity": "sha512-E0OqhZv548Qdc0PwWhLVA2zmjJZSTvaL4ZhoswmI8NJEC1tpW2js6LLP827jrW9MEiXYdz3QS6+hask83w74yQ==", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/mui-org" @@ -1050,7 +1023,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-7.1.0.tgz", "integrity": "sha512-4Kck4jxhqF6YxNwJdSae1WgDfXVg0lIH6JVJ7gtuFfuKcQCgomJxPvUEOySTFRPz1IZzwz5OAcToskRdffElDA==", - "peer": true, "dependencies": { "@babel/runtime": "^7.27.1", "@mui/utils": "^7.1.0", @@ -1077,7 +1049,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-7.1.0.tgz", "integrity": "sha512-m0mJ0c6iRC+f9hMeRe0W7zZX1wme3oUX0+XTVHjPG7DJz6OdQ6K/ggEOq7ZdwilcpdsDUwwMfOmvO71qDkYd2w==", - "peer": true, "dependencies": { "@babel/runtime": "^7.27.1", "@emotion/cache": "^11.13.5", @@ -1111,7 +1082,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/@mui/system/-/system-7.1.0.tgz", "integrity": "sha512-iedAWgRJMCxeMHvkEhsDlbvkK+qKf9me6ofsf7twk/jfT4P1ImVf7Rwb5VubEA0sikrVL+1SkoZM41M4+LNAVA==", - "peer": true, "dependencies": { "@babel/runtime": "^7.27.1", "@mui/private-theming": "^7.1.0", @@ -1151,7 +1121,6 @@ "version": "7.4.2", "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.4.2.tgz", "integrity": "sha512-edRc5JcLPsrlNFYyTPxds+d5oUovuUxnnDtpJUbP6WMeV4+6eaX/mqai1ZIWT62lCOe0nlrON0s9HDiv5en5bA==", - "peer": true, "dependencies": { "@babel/runtime": "^7.27.1" }, @@ -1168,7 +1137,6 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-7.1.0.tgz", "integrity": "sha512-/OM3S8kSHHmWNOP+NH9xEtpYSG10upXeQ0wLZnfDgmgadTAk5F4MQfFLyZ5FCRJENB3eRzltMmaNl6UtDnPovw==", - "peer": true, "dependencies": { "@babel/runtime": "^7.27.1", "@mui/types": "^7.4.2", @@ -1198,7 +1166,6 @@ "version": "2.11.8", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -1480,8 +1447,7 @@ "node_modules/@types/parse-json": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", - "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==", - "peer": true + "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==" }, "node_modules/@types/prop-types": { "version": "15.7.14", @@ -1492,6 +1458,7 @@ "version": "18.3.21", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.21.tgz", "integrity": "sha512-gXLBtmlcRJeT09/sI4PxVwyrku6SaNUj/6cMubjE6T6XdY1fDmBL7r0nX0jbSZPU/Xr0KuwLLZh6aOYY5d91Xw==", + "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.0.2" @@ -1501,7 +1468,6 @@ "version": "4.4.12", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.12.tgz", "integrity": "sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==", - "peer": true, "peerDependencies": { "@types/react": "*" } @@ -1592,6 +1558,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1811,7 +1778,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", "integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==", - "peer": true, "dependencies": { "@babel/runtime": "^7.12.5", "cosmiconfig": "^7.0.0", @@ -1947,7 +1913,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "peer": true, "engines": { "node": ">=6" } @@ -1979,14 +1944,12 @@ "node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "peer": true + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" }, "node_modules/cosmiconfig": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", - "peer": true, "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", @@ -2150,7 +2113,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", - "peer": true, "dependencies": { "@babel/runtime": "^7.8.7", "csstype": "^3.0.2" @@ -2174,7 +2136,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "peer": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -2408,6 +2369,7 @@ "integrity": "sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -2715,8 +2677,7 @@ "node_modules/find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", - "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", - "peer": true + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==" }, "node_modules/find-up": { "version": "5.0.0", @@ -3015,7 +2976,6 @@ "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "peer": true, "dependencies": { "react-is": "^16.7.0" } @@ -3023,8 +2983,7 @@ "node_modules/hoist-non-react-statics/node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "peer": true + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/ignore": { "version": "5.3.2", @@ -3093,8 +3052,7 @@ "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "peer": true + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" }, "node_modules/is-async-function": { "version": "2.1.1", @@ -3459,10 +3417,11 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -3474,7 +3433,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", - "peer": true, "bin": { "jsesc": "bin/jsesc" }, @@ -3491,8 +3449,7 @@ "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "peer": true + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" }, "node_modules/json-schema-traverse": { "version": "0.4.1", @@ -3551,8 +3508,7 @@ "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "peer": true + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" }, "node_modules/locate-path": { "version": "6.0.0", @@ -3840,7 +3796,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "peer": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -3882,7 +3837,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "peer": true, "engines": { "node": ">=8" } @@ -4028,14 +3982,12 @@ "node_modules/react-is": { "version": "19.1.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.1.0.tgz", - "integrity": "sha512-Oe56aUPnkHyyDxxkvqtd7KkdQP5uIUfHxd5XTb3wE9d/kRnZLmKbDB0GWk919tdQ+mxxPtG6EAs6RMT6i1qtHg==", - "peer": true + "integrity": "sha512-Oe56aUPnkHyyDxxkvqtd7KkdQP5uIUfHxd5XTb3wE9d/kRnZLmKbDB0GWk919tdQ+mxxPtG6EAs6RMT6i1qtHg==" }, "node_modules/react-transition-group": { "version": "4.4.5", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", - "peer": true, "dependencies": { "@babel/runtime": "^7.5.5", "dom-helpers": "^5.0.1", @@ -4093,7 +4045,6 @@ "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", - "peer": true, "dependencies": { "is-core-module": "^2.16.0", "path-parse": "^1.0.7", @@ -4211,8 +4162,7 @@ "node_modules/scheduler": { "version": "0.26.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", - "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", - "peer": true + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==" }, "node_modules/semver": { "version": "6.3.1", @@ -4374,7 +4324,6 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -4508,8 +4457,7 @@ "node_modules/stylis": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", - "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==", - "peer": true + "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==" }, "node_modules/supports-color": { "version": "7.2.0", @@ -4725,9 +4673,9 @@ } }, "node_modules/vite-node/node_modules/vite": { - "version": "6.3.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.6.tgz", - "integrity": "sha512-0msEVHJEScQbhkbVTb/4iHZdJ6SXp/AvxL2sjwYQFfBqleHtnCqv1J3sa9zbWz/6kW1m9Tfzn92vW+kZ1WV6QA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.1.tgz", + "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==", "dev": true, "license": "MIT", "dependencies": { @@ -4799,20 +4747,6 @@ } } }, - "node_modules/vite-node/node_modules/yaml": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz", - "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==", - "dev": true, - "optional": true, - "peer": true, - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/vitest": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.1.3.tgz", @@ -4910,11 +4844,12 @@ } }, "node_modules/vitest/node_modules/vite": { - "version": "6.3.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.6.tgz", - "integrity": "sha512-0msEVHJEScQbhkbVTb/4iHZdJ6SXp/AvxL2sjwYQFfBqleHtnCqv1J3sa9zbWz/6kW1m9Tfzn92vW+kZ1WV6QA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.1.tgz", + "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", @@ -4984,20 +4919,6 @@ } } }, - "node_modules/vitest/node_modules/yaml": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz", - "integrity": "sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ==", - "dev": true, - "optional": true, - "peer": true, - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -5128,7 +5049,6 @@ "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "peer": true, "engines": { "node": ">= 6" } diff --git a/src/CreateCollectionForm.jsx b/src/CreateCollectionForm.jsx index c939d3a..cbd564b 100644 --- a/src/CreateCollectionForm.jsx +++ b/src/CreateCollectionForm.jsx @@ -6,27 +6,31 @@ import TenantFieldSelectionStep from "./steps/TenantFieldSelectionStep.jsx"; import SimpleDenseEmbeddingStep from "./steps/SimpleDenseEmbeddingStep.jsx"; import SimpleHybridEmbeddingStep from "./steps/SimpleHybridEmbeddingStep.jsx"; import IndexFieldSelectionStep from "./steps/IndexFieldSelectionStep.jsx"; -import { Box, Container, Grid, Typography } from "@mui/material"; -import { CCFormButton, CCFormRoot, CCFormSidebar } from "./ThemedComponents"; +import { Box, Grid } from "@mui/material"; +import { + CCFormButton, + CCFormRoot, +} from './ThemedComponents'; import GenericElementsStep from "./steps/GenericElementsStep.jsx"; -import { prepareOutput } from "./prepareOutput.js"; +import { prepareOutput } from './prepareOutput.js'; import { ScrollableParentContext } from "./context/scrollable-parent-context.jsx"; +import Sidebar from "./Sidebar.jsx"; /** * CreateCollectionForm component * * @param {Object} props - Component props * @param {() => Promise} props.onFinish - Async function called on form finish. Must return a resolved value (not undefined), otherwise the form will not be cleared. - * @param {boolean} [props.hideSidebar=false] - Whether to hide the sidebar * @param {() => Object} [props.scrollableParent] - Function that returns the parent element * @param {Object} [props.sx] - Styles to be applied to the form + * @param {function} [props.onPreviewFormOutput] - Function to process the preview output data. Sidebar is shown only when this prop is provided and is a function. * @returns {JSX.Element} */ export const CreateCollectionForm = function CreateCollectionForm({ onFinish, - hideSidebar = false, scrollableParent, sx, + onPreviewFormOutput, ...props }) { const resolvedScrollableParent = scrollableParent @@ -153,7 +157,8 @@ export const CreateCollectionForm = function CreateCollectionForm({ value={{ scrollableParent: resolvedScrollableParent }} > - + + {renderedSteps} {isFinished && @@ -176,16 +181,13 @@ export const CreateCollectionForm = function CreateCollectionForm({ ) : ( <> )} - - {!hideSidebar && ( - - - Estimated Price: - - {/*todo: Price?*/} - 200$ - + + {onPreviewFormOutput && typeof onPreviewFormOutput === "function" && ( + + + )} + ); @@ -195,9 +197,9 @@ export const CreateCollectionForm = function CreateCollectionForm({ CreateCollectionForm.propTypes = { ref: PropTypes.object, onFinish: PropTypes.func.isRequired, - hideSidebar: PropTypes.bool, scrollableParent: PropTypes.func, sx: PropTypes.object, + onPreviewFormOutput: PropTypes.func, }; export default CreateCollectionForm; diff --git a/src/Sidebar.jsx b/src/Sidebar.jsx new file mode 100644 index 0000000..e551b6e --- /dev/null +++ b/src/Sidebar.jsx @@ -0,0 +1,51 @@ +import { useEffect, useState } from 'react'; +import PropTypes from 'prop-types'; +import { previewOutput } from './prepareOutput.js'; +import { CCFormCard, CCFormSidebar } from './ThemedComponents.jsx'; +import { Box, Typography } from '@mui/material'; + +const Sidebar = ({formData, path, handleOutput}) => { + const [outputData, setOutputData] = useState(null); + + useEffect(() => { + if (formData) { + // todo: should we show output if there is no function to process it? + if (handleOutput && typeof handleOutput === "function") { + setOutputData(handleOutput(previewOutput(formData, path))); + } + } + }, [path, formData, handleOutput]); + + return ( + + + + + Request: + + + {outputData ? ( + outputData + ) : ( + + No data to preview + + )} + + + + + ); +} + +// prop types +Sidebar.propTypes = { + formData: PropTypes.object.isRequired, + path: PropTypes.array.isRequired, + handleOutput: PropTypes.func, +} + +export default Sidebar; diff --git a/src/ThemedComponents.jsx b/src/ThemedComponents.jsx index cd8470d..7249dc5 100644 --- a/src/ThemedComponents.jsx +++ b/src/ThemedComponents.jsx @@ -369,13 +369,7 @@ export const CCFormSidebar = styled( }, )(({ theme }) => ({ borderRadius: 0, - position: "absolute", - bottom: 0, - right: 0, - top: 0, - width: "clamp(12.5rem, 25vw, 18.75rem)", - minWidth: "12.5rem", - padding: "2rem 1.5rem", + padding: "3rem 0 2rem", flexShrink: 0, background: theme.palette.background.default, color: theme.palette.text.primary, diff --git a/src/prepareOutput.js b/src/prepareOutput.js index 6e7985d..a075da8 100644 --- a/src/prepareOutput.js +++ b/src/prepareOutput.js @@ -340,7 +340,7 @@ export const stepExtractors = { "index-field-selection-step": indexFieldSelectionExtractor, }; -export function prepareOutput(formState, path) { +export function preprocessOutput(formState, path) { let output = {}; (path || []).forEach((step) => { @@ -349,6 +349,13 @@ export function prepareOutput(formState, path) { stepExtractors[step](output, stepData); } }); + return output; +} + +export function prepareOutput(formState, path) { + let output = preprocessOutput(formState, path); return validateFormOutput(output); } + +export const previewOutput = preprocessOutput; From 21630b0b0a5bc4859e10be8972923d46c4506aed Mon Sep 17 00:00:00 2001 From: trean Date: Mon, 8 Dec 2025 18:17:45 +0100 Subject: [PATCH 2/6] fixes --- src/CreateCollectionForm.jsx | 73 +++++++++++++++------------- src/Sidebar.jsx | 51 +++++++++---------- src/ThemedComponents.jsx | 14 +++--- src/collection-schema.jtd.json | 6 +-- src/flow.js | 3 +- src/inputs/ButtonGroupWithInputs.jsx | 4 +- src/prepareOutput.js | 66 +++++++++++++------------ 7 files changed, 111 insertions(+), 106 deletions(-) diff --git a/src/CreateCollectionForm.jsx b/src/CreateCollectionForm.jsx index cbd564b..1a09b83 100644 --- a/src/CreateCollectionForm.jsx +++ b/src/CreateCollectionForm.jsx @@ -7,12 +7,9 @@ import SimpleDenseEmbeddingStep from "./steps/SimpleDenseEmbeddingStep.jsx"; import SimpleHybridEmbeddingStep from "./steps/SimpleHybridEmbeddingStep.jsx"; import IndexFieldSelectionStep from "./steps/IndexFieldSelectionStep.jsx"; import { Box, Grid } from "@mui/material"; -import { - CCFormButton, - CCFormRoot, -} from './ThemedComponents'; +import { CCFormButton, CCFormRoot } from "./ThemedComponents"; import GenericElementsStep from "./steps/GenericElementsStep.jsx"; -import { prepareOutput } from './prepareOutput.js'; +import { prepareOutput } from "./prepareOutput.js"; import { ScrollableParentContext } from "./context/scrollable-parent-context.jsx"; import Sidebar from "./Sidebar.jsx"; @@ -157,37 +154,47 @@ export const CreateCollectionForm = function CreateCollectionForm({ value={{ scrollableParent: resolvedScrollableParent }} > - - - {renderedSteps} - - {isFinished && - Object.values(formData).some( - (data) => typeof data === "object" && data?.completed, - ) ? ( - - - Clear - - - Finish - - - ) : ( - <> - )} + + + {renderedSteps} + + {isFinished && + Object.values(formData).some( + (data) => typeof data === "object" && data?.completed, + ) ? ( + + + Clear + + + Finish + + + ) : ( + <> + )} - {onPreviewFormOutput && typeof onPreviewFormOutput === "function" && ( + {onPreviewFormOutput && typeof onPreviewFormOutput === "function" && ( - + - )} - + )} + ); diff --git a/src/Sidebar.jsx b/src/Sidebar.jsx index e551b6e..820928e 100644 --- a/src/Sidebar.jsx +++ b/src/Sidebar.jsx @@ -1,10 +1,10 @@ -import { useEffect, useState } from 'react'; -import PropTypes from 'prop-types'; -import { previewOutput } from './prepareOutput.js'; -import { CCFormCard, CCFormSidebar } from './ThemedComponents.jsx'; -import { Box, Typography } from '@mui/material'; +import { useEffect, useState } from "react"; +import PropTypes from "prop-types"; +import { previewOutput } from "./prepareOutput.js"; +import { CCFormCard, CCFormSidebar } from "./ThemedComponents.jsx"; +import { Typography } from "@mui/material"; -const Sidebar = ({formData, path, handleOutput}) => { +const Sidebar = ({ formData, path, handleOutput }) => { const [outputData, setOutputData] = useState(null); useEffect(() => { @@ -17,35 +17,28 @@ const Sidebar = ({formData, path, handleOutput}) => { }, [path, formData, handleOutput]); return ( - - - - - Request: - - - {outputData ? ( - outputData - ) : ( - - No data to preview - - )} - - - - + + + {outputData ? ( + outputData + ) : ( + + No data to preview + + )} + + ); -} +}; // prop types Sidebar.propTypes = { formData: PropTypes.object.isRequired, path: PropTypes.array.isRequired, handleOutput: PropTypes.func, -} +}; export default Sidebar; diff --git a/src/ThemedComponents.jsx b/src/ThemedComponents.jsx index 7249dc5..590548d 100644 --- a/src/ThemedComponents.jsx +++ b/src/ThemedComponents.jsx @@ -349,13 +349,7 @@ export const CCFormSlider = styled(Slider, { export const CCFormSidebarInner = styled(Box, { name: "MuiCreateCollectionForm", slot: "sidebarStickyInner", -})(({ theme }) => ({ - position: "sticky", - top: "2rem", - [theme.breakpoints.down("md")]: { - position: "static", - }, -})); +})(); export const CCFormSidebar = styled( (props) => ( @@ -368,17 +362,23 @@ export const CCFormSidebar = styled( slot: "sidebar", }, )(({ theme }) => ({ + position: "sticky", + top: "2rem", + alignSelf: "flex-start", borderRadius: 0, padding: "3rem 0 2rem", flexShrink: 0, background: theme.palette.background.default, color: theme.palette.text.primary, zIndex: 2, + maxHeight: "calc(100vh - 4rem)", + overflowY: "auto", [theme.breakpoints.down("md")]: { position: "fixed", width: "100vw", top: "auto", padding: "1.5rem 1.5rem 2rem", boxShadow: "0 0 10px 0 rgba(0,0,0,0.2)", + maxHeight: "none", }, })); diff --git a/src/collection-schema.jtd.json b/src/collection-schema.jtd.json index 04d17a7..0975379 100644 --- a/src/collection-schema.jtd.json +++ b/src/collection-schema.jtd.json @@ -37,8 +37,8 @@ "tokenizer": { "enum": ["prefix", "whitespace", "word", "multilingual"] }, - "min_token_length": { "type": "uint32" }, - "max_token_length": { "type": "uint32" }, + "min_token_len": { "type": "uint32" }, + "max_token_len": { "type": "uint32" }, "range": { "type": "boolean" }, "lookup": { "type": "boolean" }, "phrase_matching": { "type": "boolean" } @@ -46,7 +46,7 @@ } } } - }, + }, "tenant_field": { "properties": { "name": { "type": "string" }, diff --git a/src/flow.js b/src/flow.js index 3e3c5c5..20d44f5 100644 --- a/src/flow.js +++ b/src/flow.js @@ -578,7 +578,8 @@ export const steps = { name: "phrase_matching", type: "checkbox", default: true, - description: "Allows phrase matching at the cost of extra index structure", + description: + "Allows phrase matching at the cost of extra index structure", link: "https://qdrant.tech/documentation/concepts/filtering/#phrase-matching", linkText: "Learn more", size: 6, diff --git a/src/inputs/ButtonGroupWithInputs.jsx b/src/inputs/ButtonGroupWithInputs.jsx index c852387..f5cd53e 100644 --- a/src/inputs/ButtonGroupWithInputs.jsx +++ b/src/inputs/ButtonGroupWithInputs.jsx @@ -53,12 +53,12 @@ Component capable of rendering the following configuration: default: true, }, { - name: "min_token_length", + name: "min_token_len", type: "number", default: null, }, { - name: "max_token_length", + name: "max_token_len", type: "number", default: null, }, diff --git a/src/prepareOutput.js b/src/prepareOutput.js index a075da8..94cf3ed 100644 --- a/src/prepareOutput.js +++ b/src/prepareOutput.js @@ -39,8 +39,8 @@ import { validateFormOutput } from "./validateOutput"; // "params": { // "lowercase": true, // "tokenizer": "whitespace", -// "min_token_length": null, -// "max_token_length": null, +// "min_token_len": null, +// "max_token_len": null, // "phrase_matching": true // } // }, @@ -290,42 +290,46 @@ function indexFieldSelectionExtractor(data, stepData) { return; } - data.payload_indexes = stepData.payload_fields.map((field) => { - let params = {}; - if (field.field_config.field_config_enum === "text") { - params.lowercase = field.field_config?.lowercase ?? true; - params.tokenizer = field.field_config?.tokenizer || "whitespace"; - params.phrase_matching = field.field_config?.phrase_matching ?? true; + data.payload_indexes = stepData.payload_fields + .filter((field) => field?.field_config?.field_config_enum) + .map((field) => { + let params = {}; + if (field?.field_config?.field_config_enum?.toLowerCase() === "text") { + params.lowercase = field.field_config?.lowercase ?? true; + params.tokenizer = field.field_config?.tokenizer || "whitespace"; + params.phrase_matching = field.field_config?.phrase_matching ?? true; - const minLength = field.field_config?.min_token_length; - const maxLength = field.field_config?.max_token_length; + const minLength = field.field_config?.min_token_len; + const maxLength = field.field_config?.max_token_len; - if (minLength !== undefined && minLength !== "") { - const value = - typeof minLength === "number" ? minLength : parseInt(minLength, 10); - if (!isNaN(value) && value >= 0) { - params.min_token_length = value; + if (minLength !== undefined && minLength !== "") { + const value = + typeof minLength === "number" ? minLength : parseInt(minLength, 10); + if (!isNaN(value) && value >= 0) { + params.min_token_len = value; + } } - } - if (maxLength !== undefined && maxLength !== "") { - const value = - typeof maxLength === "number" ? maxLength : parseInt(maxLength, 10); - if (!isNaN(value) && value >= 0) { - params.max_token_length = value; + if (maxLength !== undefined && maxLength !== "") { + const value = + typeof maxLength === "number" ? maxLength : parseInt(maxLength, 10); + if (!isNaN(value) && value >= 0) { + params.max_token_len = value; + } } + } else if ( + field?.field_config?.field_config_enum?.toLowerCase() === "integer" + ) { + params.range = field.field_config?.range ?? true; + params.lookup = field.field_config?.lookup ?? true; } - } else if (field.field_config.field_config_enum === "integer") { - params.range = field.field_config?.range ?? true; - params.lookup = field.field_config?.lookup ?? true; - } - return { - name: field.field_name, - type: field.field_config.field_config_enum, - params: params, - }; - }); + return { + name: field.field_name, + type: field?.field_config?.field_config_enum, + params: params, + }; + }); } export const stepExtractors = { From 547a9c51bb889c88455f55d53756f1df3c649ad7 Mon Sep 17 00:00:00 2001 From: Andrey Vasnetsov Date: Tue, 9 Dec 2025 22:31:25 +0100 Subject: [PATCH 3/6] extra check for tenant field --- example-app/src/App.jsx | 5 ++++- src/prepareOutput.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/example-app/src/App.jsx b/example-app/src/App.jsx index 2b469a9..c435a27 100644 --- a/example-app/src/App.jsx +++ b/example-app/src/App.jsx @@ -103,7 +103,10 @@ function App() { {/*Form Component*/} {/* See above how to adjust styles */} { + console.log(data); + return
Preview
; + }} onFinish={(data) => { alert(JSON.stringify(data, null, 2)); // This is just an example of how to handle the form finish, diff --git a/src/prepareOutput.js b/src/prepareOutput.js index 94cf3ed..97476b1 100644 --- a/src/prepareOutput.js +++ b/src/prepareOutput.js @@ -63,7 +63,7 @@ function collectionNameExtractor(data, stepData) { function tenantFieldExtractor(data, stepData) { data.tenant_field = { - name: stepData.tenant_id, + name: stepData?.tenant_id, type: "keyword", }; } From 32e6029f06ea497c79ee5fafdf7d9f528788d268 Mon Sep 17 00:00:00 2001 From: Andrey Vasnetsov Date: Tue, 9 Dec 2025 23:10:43 +0100 Subject: [PATCH 4/6] do not default to 0 for number inputs --- src/inputs/Inputs.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inputs/Inputs.jsx b/src/inputs/Inputs.jsx index e394da0..0ebd6a1 100644 --- a/src/inputs/Inputs.jsx +++ b/src/inputs/Inputs.jsx @@ -148,7 +148,7 @@ Checkbox.propTypes = { }; export const NumberInput = ({ config, stepData, onChange }) => { - const value = stepData || 0; + const value = stepData || null; const maxValue = config?.max; const minValue = config?.min; @@ -156,7 +156,7 @@ export const NumberInput = ({ config, stepData, onChange }) => { const handleChange = (e) => { let valueNumber = parseInt(e.target.value); if (isNaN(valueNumber)) { - valueNumber = 0; + valueNumber = null; } else { if (maxValue && valueNumber > maxValue) { valueNumber = maxValue; From a449d9d91a91b28be08b989c003cd8dbf5009a41 Mon Sep 17 00:00:00 2001 From: Andrey Vasnetsov Date: Tue, 9 Dec 2025 23:35:37 +0100 Subject: [PATCH 5/6] handle partial custom vectors --- src/prepareOutput.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/prepareOutput.js b/src/prepareOutput.js index 97476b1..4a94536 100644 --- a/src/prepareOutput.js +++ b/src/prepareOutput.js @@ -197,9 +197,9 @@ function customCollectionDenseExtractor(data, stepData) { data.dense_vectors = stepData.custom_dense_vectors.map((vector) => { return { - name: vector.vector_name, - size: vector.vector_config.dimensions, - distance: vector.vector_config.metric || "Cosine", + name: vector?.vector_name, + size: vector.vector_config?.dimensions, + distance: vector.vector_config?.metric || "Cosine", multivector: vector?.advanced_config?.multivector || false, storage_tier: vector?.advanced_config?.storage_tier || "balanced", precision_tier: vector?.advanced_config?.precision_tier || "high", @@ -238,7 +238,7 @@ function customCollectionSparseExtractor(data, stepData) { data.sparse_vectors = stepData.custom_sparse_vectors.map((vector) => { return { - name: vector.vector_name, + name: vector?.vector_name, use_idf: vector?.vector_config?.use_idf ?? false, storage_tier: vector?.advanced_config?.storage_tier || "balanced", precision_tier: vector?.advanced_config?.precision_tier || "high", From 478b71a173be5502622ad6d3094de4211739441c Mon Sep 17 00:00:00 2001 From: Andrey Vasnetsov Date: Tue, 9 Dec 2025 23:47:46 +0100 Subject: [PATCH 6/6] remove commas in the list --- src/flow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/flow.js b/src/flow.js index 20d44f5..ee49f9f 100644 --- a/src/flow.js +++ b/src/flow.js @@ -92,7 +92,7 @@ export const steps = { size: 6, "short-description": "Search across the whole collection", description: - "Search across whole collection of data with optional filters. For example:
  • e-commerce search,
  • website search,
", + "Search across whole collection of data with optional filters. For example:
  • e-commerce search
  • website search
  • documents search
", name: "global-search", "on-select": { "continue-step": "templates-selection-step", @@ -106,7 +106,7 @@ export const steps = { size: 6, "short-description": "Many tenants, isolated data", description: - "Search across multiple isolated tenants. For example:
  • per-user documents,
  • chat history search,
  • organization-based isolation
", + "Search across multiple isolated tenants. For example:
  • per-user documents
  • chat history search
  • organization-based isolation
", name: "multitenancy", "on-select": { "continue-step": "tenant-field-selection-step",