@metabase/custom-viz 0.0.1-alpha.7 → 0.0.1-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +34 -31
- package/dist/column-types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -17
- package/dist/lib/createDefineSetting.d.ts +23 -0
- package/dist/lib/createDefineSetting.d.ts.map +1 -0
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/templates/index.tsx +84 -78
- package/dist/templates/vite.config.ts +26 -16
- package/dist/types/date-time.d.ts +1 -1
- package/dist/types/date-time.d.ts.map +1 -1
- package/dist/types/viz-settings.d.ts +1 -1
- package/dist/types/viz-settings.d.ts.map +1 -1
- package/dist/types/viz.d.ts +3 -12
- package/dist/types/viz.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/lib/defineSetting.d.ts +0 -22
- package/dist/lib/defineSetting.d.ts.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -6,39 +6,42 @@ import { createInterface as o } from "node:readline";
|
|
|
6
6
|
import { Command as s } from "commander";
|
|
7
7
|
import { fileURLToPath as c } from "node:url";
|
|
8
8
|
//#region package.json
|
|
9
|
-
var l = "0.0.1-alpha.7", u = "node_modules/\n.DS_Store\n# dist must be committed\n", d = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M1.79978 6.86661C1.65041 7.01583 1.53192 7.19302 1.45107 7.38806C1.37023 7.58309 1.32861 7.79215 1.32861 8.00328C1.32861 8.21441 1.37023 8.42347 1.45107 8.61851C1.53192 8.81354 1.65041 8.99073 1.79978 9.13995L6.85978 14.1999C7.00899 14.3493 7.18618 14.4678 7.38122 14.5487C7.57626 14.6295 7.78531 14.6711 7.99644 14.6711C8.20757 14.6711 8.41663 14.6295 8.61167 14.5487C8.80671 14.4678 8.9839 14.3493 9.13311 14.1999L14.1931 9.13995C14.3425 8.99073 14.461 8.81354 14.5418 8.61851C14.6227 8.42347 14.6643 8.21441 14.6643 8.00328C14.6643 7.79215 14.6227 7.58309 14.5418 7.38806C14.461 7.19302 14.3425 7.01583 14.1931 6.86661L9.13311 1.80661C8.9839 1.65725 8.80671 1.53875 8.61167 1.45791C8.41663 1.37706 8.20757 1.33545 7.99644 1.33545C7.78531 1.33545 7.57626 1.37706 7.38122 1.45791C7.18618 1.53875 7.00899 1.65725 6.85978 1.80661L1.79978 6.86661Z\" stroke=\"white\" stroke-width=\"1.33333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n", f = "import type {\n CreateCustomVisualization,\n CustomStaticVisualizationProps,\n CustomVisualizationProps,\n} from \"@metabase/custom-viz\";\n\ntype Settings = {\n threshold?: number;\n};\n\nconst createVisualization: CreateCustomVisualization<Settings> = ({\n getAssetUrl,\n}) => {\n return {\n id: \"__CUSTOM_VIZ_NAME__\",\n getName: () => \"__CUSTOM_VIZ_NAME__\",\n minSize: { width: 1, height: 1 },\n defaultSize: { width: 2, height: 2 },\n isSensible({ cols, rows }) {\n return cols.length === 1 && rows.length === 1 && typeof rows[0][0] === \"number\";\n },\n checkRenderable(series, settings) {\n if (series.length !== 1) {\n throw new Error(\"Only 1 series is supported\");\n }\n\n const [\n {\n data: { cols, rows },\n },\n ] = series;\n\n if (cols.length !== 1) {\n throw new Error(\"Query results should only have 1 column\");\n }\n\n if (rows.length !== 1) {\n throw new Error(\"Query results should only have 1 row\");\n }\n\n if (typeof rows[0][0] !== \"number\") {\n throw new Error(\"Result is not a number\");\n }\n\n if (typeof settings.threshold !== \"number\") {\n throw new Error(\"Threshold setting is not set\");\n }\n },\n settings: {\n threshold: {\n id: \"1\",\n title: \"Threshold\",\n widget: \"number\",\n getDefault() {\n return 0;\n },\n getProps() {\n return {\n options: {\n isInteger: false,\n isNonNegative: false,\n },\n placeholder: \"Set threshold\",\n };\n },\n },\n },\n VisualizationComponent: makeVisualizationComponent(getAssetUrl),\n StaticVisualizationComponent: makeStaticVisualizationComponent(getAssetUrl),\n };\n};\n\nconst makeVisualizationComponent = (getAssetUrl: (path: string) => string) => (props: CustomVisualizationProps<Settings>) => {\n const { height, series, settings, width } = props;\n const { threshold } = settings;\n const value = series[0].data.rows[0][0];\n\n if (typeof value !== \"number\" || typeof threshold !== \"number\") {\n throw new Error(\"Value and threshold need to be numbers\");\n }\n\n const emoji = value >= threshold ? \"👍\" : \"👎\";\n\n return (\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n width,\n height,\n fontSize: \"10rem\",\n }}\n >\n {emoji}\n </div>\n );\n};\n\nconst makeStaticVisualizationComponent = (getAssetUrl: (path: string) => string) => (\n props: CustomStaticVisualizationProps<Settings>,\n) => {\n const width = 540;\n const height = 360;\n const { series, settings } = props;\n const { threshold } = settings;\n const value = series[0].data.rows[0][0];\n\n if (typeof value !== \"number\" || typeof threshold !== \"number\") {\n throw new Error(\"Value and threshold need to be numbers\");\n }\n\n const emoji =\n value >= threshold ? (\n <img src={getAssetUrl(\"thumbs-up.png\")} />\n ) : (\n <img src={getAssetUrl(\"thumbs-down.png\")} />\n );\n\n return (\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n width,\n height,\n fontSize: \"10rem\",\n }}\n >\n {emoji}\n </div>\n );\n};\n\nexport default createVisualization;\n", p = "{\n \"name\": \"__CUSTOM_VIZ_NAME__\",\n \"icon\": \"icon.svg\",\n \"assets\": [\"icon.svg\", \"thumbs-up.png\", \"thumbs-down.png\"],\n \"metabase\": {\n \"version\": \">=59\"\n }\n}\n", m = "{\n \"name\": \"__CUSTOM_VIZ_NAME__\",\n \"version\": \"0.0.1\",\n \"lockfileVersion\": 3,\n \"requires\": true,\n \"packages\": {\n \"\": {\n \"name\": \"__CUSTOM_VIZ_NAME__\",\n \"version\": \"0.0.1\",\n \"devDependencies\": {\n \"@metabase/custom-viz\": \"__CUSTOM_VIZ_VERSION__\",\n \"@types/react\": \"^19.2.14\",\n \"react\": \"^19.1.0\",\n \"typescript\": \"^5.9.3\",\n \"vite\": \"^8.0.0\"\n }\n },\n \"node_modules/@emnapi/core\": {\n \"version\": \"1.9.1\",\n \"resolved\": \"https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz\",\n \"integrity\": \"sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"peer\": true,\n \"dependencies\": {\n \"@emnapi/wasi-threads\": \"1.2.0\",\n \"tslib\": \"^2.4.0\"\n }\n },\n \"node_modules/@emnapi/runtime\": {\n \"version\": \"1.9.1\",\n \"resolved\": \"https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz\",\n \"integrity\": \"sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"peer\": true,\n \"dependencies\": {\n \"tslib\": \"^2.4.0\"\n }\n },\n \"node_modules/@emnapi/wasi-threads\": {\n \"version\": \"1.2.0\",\n \"resolved\": \"https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz\",\n \"integrity\": \"sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"peer\": true,\n \"dependencies\": {\n \"tslib\": \"^2.4.0\"\n }\n },\n \"node_modules/@metabase/custom-viz\": {\n \"version\": \"__CUSTOM_VIZ_VERSION__\",\n \"resolved\": \"https://registry.npmjs.org/@metabase/custom-viz/-/custom-viz-__CUSTOM_VIZ_VERSION__.tgz\",\n \"dev\": true,\n \"dependencies\": {\n \"commander\": \"^13.1.0\"\n },\n \"bin\": {\n \"metabase-custom-viz\": \"dist/cli.js\"\n }\n },\n \"node_modules/@napi-rs/wasm-runtime\": {\n \"version\": \"1.1.2\",\n \"resolved\": \"https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.2.tgz\",\n \"integrity\": \"sha512-sNXv5oLJ7ob93xkZ1XnxisYhGYXfaG9f65/ZgYuAu3qt7b3NadcOEhLvx28hv31PgX8SZJRYrAIPQilQmFpLVw==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"dependencies\": {\n \"@tybys/wasm-util\": \"^0.10.1\"\n },\n \"funding\": {\n \"type\": \"github\",\n \"url\": \"https://github.com/sponsors/Brooooooklyn\"\n },\n \"peerDependencies\": {\n \"@emnapi/core\": \"^1.7.1\",\n \"@emnapi/runtime\": \"^1.7.1\"\n }\n },\n \"node_modules/@oxc-project/types\": {\n \"version\": \"0.122.0\",\n \"resolved\": \"https://registry.npmjs.org/@oxc-project/types/-/types-0.122.0.tgz\",\n \"integrity\": \"sha512-oLAl5kBpV4w69UtFZ9xqcmTi+GENWOcPF7FCrczTiBbmC0ibXxCwyvZGbO39rCVEuLGAZM84DH0pUIyyv/YJzA==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"funding\": {\n \"url\": \"https://github.com/sponsors/Boshen\"\n }\n },\n \"node_modules/@rolldown/binding-android-arm64\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-pv1y2Fv0JybcykuiiD3qBOBdz6RteYojRFY1d+b95WVuzx211CRh+ytI/+9iVyWQ6koTh5dawe4S/yRfOFjgaA==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"android\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-darwin-arm64\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-cFYr6zTG/3PXXF3pUO+umXxt1wkRK/0AYT8lDwuqvRC+LuKYWSAQAQZjCWDQpAH172ZV6ieYrNnFzVVcnSflAg==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"darwin\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-darwin-x64\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-ZCsYknnHzeXYps0lGBz8JrF37GpE9bFVefrlmDrAQhOEi4IOIlcoU1+FwHEtyXGx2VkYAvhu7dyBf75EJQffBw==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"darwin\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-freebsd-x64\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-dMLeprcVsyJsKolRXyoTH3NL6qtsT0Y2xeuEA8WQJquWFXkEC4bcu1rLZZSnZRMtAqwtrF/Ib9Ddtpa/Gkge9Q==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"freebsd\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-arm-gnueabihf\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-YqWjAgGC/9M1lz3GR1r1rP79nMgo3mQiiA+Hfo+pvKFK1fAJ1bCi0ZQVh8noOqNacuY1qIcfyVfP6HoyBRZ85Q==\",\n \"cpu\": [\n \"arm\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-arm64-gnu\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-/I5AS4cIroLpslsmzXfwbe5OmWvSsrFuEw3mwvbQ1kDxJ822hFHIx+vsN/TAzNVyepI/j/GSzrtCIwQPeKCLIg==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-arm64-musl\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-V6/wZztnBqlx5hJQqNWwFdxIKN0m38p8Jas+VoSfgH54HSj9tKTt1dZvG6JRHcjh6D7TvrJPWFGaY9UBVOaWPw==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-ppc64-gnu\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-AP3E9BpcUYliZCxa3w5Kwj9OtEVDYK6sVoUzy4vTOJsjPOgdaJZKFmN4oOlX0Wp0RPV2ETfmIra9x1xuayFB7g==\",\n \"cpu\": [\n \"ppc64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-s390x-gnu\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-nWwpvUSPkoFmZo0kQazZYOrT7J5DGOJ/+QHHzjvNlooDZED8oH82Yg67HvehPPLAg5fUff7TfWFHQS8IV1n3og==\",\n \"cpu\": [\n \"s390x\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-x64-gnu\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-RNrafz5bcwRy+O9e6P8Z/OCAJW/A+qtBczIqVYwTs14pf4iV1/+eKEjdOUta93q2TsT/FI0XYDP3TCky38LMAg==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-x64-musl\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-Jpw/0iwoKWx3LJ2rc1yjFrj+T7iHZn2JDg1Yny1ma0luviFS4mhAIcd1LFNxK3EYu3DHWCps0ydXQ5i/rrJ2ig==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-openharmony-arm64\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-vRugONE4yMfVn0+7lUKdKvN4D5YusEiPilaoO2sgUWpCvrncvWgPMzK00ZFFJuiPgLwgFNP5eSiUlv2tfc+lpA==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"openharmony\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-wasm32-wasi\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-ykGiLr/6kkiHc0XnBfmFJuCjr5ZYKKofkx+chJWDjitX+KsJuAmrzWhwyOMSHzPhzOHOy7u9HlFoa5MoAOJ/Zg==\",\n \"cpu\": [\n \"wasm32\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"dependencies\": {\n \"@napi-rs/wasm-runtime\": \"^1.1.1\"\n },\n \"engines\": {\n \"node\": \">=14.0.0\"\n }\n },\n \"node_modules/@rolldown/binding-win32-arm64-msvc\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-5eOND4duWkwx1AzCxadcOrNeighiLwMInEADT0YM7xeEOOFcovWZCq8dadXgcRHSf3Ulh1kFo/qvzoFiCLOL1Q==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"win32\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-win32-x64-msvc\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-PyqoipaswDLAZtot351MLhrlrh6lcZPo2LSYE+VDxbVk24LVKAGOuE4hb8xZQmrPAuEtTZW8E6D2zc5EUZX4Lw==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"win32\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/pluginutils\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-HHMwmarRKvoFsJorqYlFeFRzXZqCt2ETQlEDOb9aqssrnVBB1/+xgTGtuTrIk5vzLNX1MjMtTf7W9z3tsSbrxw==\",\n \"dev\": true,\n \"license\": \"MIT\"\n },\n \"node_modules/@tybys/wasm-util\": {\n \"version\": \"0.10.1\",\n \"resolved\": \"https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz\",\n \"integrity\": \"sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"dependencies\": {\n \"tslib\": \"^2.4.0\"\n }\n },\n \"node_modules/@types/react\": {\n \"version\": \"19.2.14\",\n \"resolved\": \"https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz\",\n \"integrity\": \"sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"dependencies\": {\n \"csstype\": \"^3.2.2\"\n }\n },\n \"node_modules/commander\": {\n \"version\": \"13.1.0\",\n \"resolved\": \"https://registry.npmjs.org/commander/-/commander-13.1.0.tgz\",\n \"integrity\": \"sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=18\"\n }\n },\n \"node_modules/csstype\": {\n \"version\": \"3.2.3\",\n \"resolved\": \"https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz\",\n \"integrity\": \"sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==\",\n \"dev\": true,\n \"license\": \"MIT\"\n },\n \"node_modules/detect-libc\": {\n \"version\": \"2.1.2\",\n \"resolved\": \"https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz\",\n \"integrity\": \"sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==\",\n \"dev\": true,\n \"license\": \"Apache-2.0\",\n \"engines\": {\n \"node\": \">=8\"\n }\n },\n \"node_modules/fdir\": {\n \"version\": \"6.5.0\",\n \"resolved\": \"https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz\",\n \"integrity\": \"sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=12.0.0\"\n },\n \"peerDependencies\": {\n \"picomatch\": \"^3 || ^4\"\n },\n \"peerDependenciesMeta\": {\n \"picomatch\": {\n \"optional\": true\n }\n }\n },\n \"node_modules/fsevents\": {\n \"version\": \"2.3.3\",\n \"resolved\": \"https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz\",\n \"integrity\": \"sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==\",\n \"dev\": true,\n \"hasInstallScript\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"darwin\"\n ],\n \"engines\": {\n \"node\": \"^8.16.0 || ^10.6.0 || >=11.0.0\"\n }\n },\n \"node_modules/lightningcss\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz\",\n \"integrity\": \"sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==\",\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"dependencies\": {\n \"detect-libc\": \"^2.0.3\"\n },\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n },\n \"optionalDependencies\": {\n \"lightningcss-android-arm64\": \"1.32.0\",\n \"lightningcss-darwin-arm64\": \"1.32.0\",\n \"lightningcss-darwin-x64\": \"1.32.0\",\n \"lightningcss-freebsd-x64\": \"1.32.0\",\n \"lightningcss-linux-arm-gnueabihf\": \"1.32.0\",\n \"lightningcss-linux-arm64-gnu\": \"1.32.0\",\n \"lightningcss-linux-arm64-musl\": \"1.32.0\",\n \"lightningcss-linux-x64-gnu\": \"1.32.0\",\n \"lightningcss-linux-x64-musl\": \"1.32.0\",\n \"lightningcss-win32-arm64-msvc\": \"1.32.0\",\n \"lightningcss-win32-x64-msvc\": \"1.32.0\"\n }\n },\n \"node_modules/lightningcss-android-arm64\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz\",\n \"integrity\": \"sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"android\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-darwin-arm64\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz\",\n \"integrity\": \"sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"darwin\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-darwin-x64\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz\",\n \"integrity\": \"sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"darwin\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-freebsd-x64\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz\",\n \"integrity\": \"sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"freebsd\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-linux-arm-gnueabihf\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz\",\n \"integrity\": \"sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==\",\n \"cpu\": [\n \"arm\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-linux-arm64-gnu\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz\",\n \"integrity\": \"sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-linux-arm64-musl\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz\",\n \"integrity\": \"sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-linux-x64-gnu\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz\",\n \"integrity\": \"sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-linux-x64-musl\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz\",\n \"integrity\": \"sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-win32-arm64-msvc\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz\",\n \"integrity\": \"sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"win32\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-win32-x64-msvc\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz\",\n \"integrity\": \"sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"win32\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/nanoid\": {\n \"version\": \"3.3.11\",\n \"resolved\": \"https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz\",\n \"integrity\": \"sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==\",\n \"dev\": true,\n \"funding\": [\n {\n \"type\": \"github\",\n \"url\": \"https://github.com/sponsors/ai\"\n }\n ],\n \"license\": \"MIT\",\n \"bin\": {\n \"nanoid\": \"bin/nanoid.cjs\"\n },\n \"engines\": {\n \"node\": \"^10 || ^12 || ^13.7 || ^14 || >=15.0.1\"\n }\n },\n \"node_modules/picocolors\": {\n \"version\": \"1.1.1\",\n \"resolved\": \"https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz\",\n \"integrity\": \"sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==\",\n \"dev\": true,\n \"license\": \"ISC\"\n },\n \"node_modules/picomatch\": {\n \"version\": \"4.0.4\",\n \"resolved\": \"https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz\",\n \"integrity\": \"sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=12\"\n },\n \"funding\": {\n \"url\": \"https://github.com/sponsors/jonschlinkert\"\n }\n },\n \"node_modules/postcss\": {\n \"version\": \"8.5.8\",\n \"resolved\": \"https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz\",\n \"integrity\": \"sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==\",\n \"dev\": true,\n \"funding\": [\n {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/postcss/\"\n },\n {\n \"type\": \"tidelift\",\n \"url\": \"https://tidelift.com/funding/github/npm/postcss\"\n },\n {\n \"type\": \"github\",\n \"url\": \"https://github.com/sponsors/ai\"\n }\n ],\n \"license\": \"MIT\",\n \"dependencies\": {\n \"nanoid\": \"^3.3.11\",\n \"picocolors\": \"^1.1.1\",\n \"source-map-js\": \"^1.2.1\"\n },\n \"engines\": {\n \"node\": \"^10 || ^12 || >=14\"\n }\n },\n \"node_modules/react\": {\n \"version\": \"19.2.4\",\n \"resolved\": \"https://registry.npmjs.org/react/-/react-19.2.4.tgz\",\n \"integrity\": \"sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=0.10.0\"\n }\n },\n \"node_modules/rolldown\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-yP4USLIMYrwpPHEFB5JGH1uxhcslv6/hL0OyvTuY+3qlOSJvZ7ntYnoWpehBxufkgN0cvXxppuTu5hHa/zPh+A==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"dependencies\": {\n \"@oxc-project/types\": \"=0.122.0\",\n \"@rolldown/pluginutils\": \"1.0.0-rc.12\"\n },\n \"bin\": {\n \"rolldown\": \"bin/cli.mjs\"\n },\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n },\n \"optionalDependencies\": {\n \"@rolldown/binding-android-arm64\": \"1.0.0-rc.12\",\n \"@rolldown/binding-darwin-arm64\": \"1.0.0-rc.12\",\n \"@rolldown/binding-darwin-x64\": \"1.0.0-rc.12\",\n \"@rolldown/binding-freebsd-x64\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-arm-gnueabihf\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-arm64-gnu\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-arm64-musl\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-ppc64-gnu\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-s390x-gnu\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-x64-gnu\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-x64-musl\": \"1.0.0-rc.12\",\n \"@rolldown/binding-openharmony-arm64\": \"1.0.0-rc.12\",\n \"@rolldown/binding-wasm32-wasi\": \"1.0.0-rc.12\",\n \"@rolldown/binding-win32-arm64-msvc\": \"1.0.0-rc.12\",\n \"@rolldown/binding-win32-x64-msvc\": \"1.0.0-rc.12\"\n }\n },\n \"node_modules/source-map-js\": {\n \"version\": \"1.2.1\",\n \"resolved\": \"https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz\",\n \"integrity\": \"sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==\",\n \"dev\": true,\n \"license\": \"BSD-3-Clause\",\n \"engines\": {\n \"node\": \">=0.10.0\"\n }\n },\n \"node_modules/tinyglobby\": {\n \"version\": \"0.2.15\",\n \"resolved\": \"https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz\",\n \"integrity\": \"sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"dependencies\": {\n \"fdir\": \"^6.5.0\",\n \"picomatch\": \"^4.0.3\"\n },\n \"engines\": {\n \"node\": \">=12.0.0\"\n },\n \"funding\": {\n \"url\": \"https://github.com/sponsors/SuperchupuDev\"\n }\n },\n \"node_modules/tslib\": {\n \"version\": \"2.8.1\",\n \"resolved\": \"https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz\",\n \"integrity\": \"sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==\",\n \"dev\": true,\n \"license\": \"0BSD\",\n \"optional\": true\n },\n \"node_modules/typescript\": {\n \"version\": \"5.9.3\",\n \"resolved\": \"https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz\",\n \"integrity\": \"sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==\",\n \"dev\": true,\n \"license\": \"Apache-2.0\",\n \"bin\": {\n \"tsc\": \"bin/tsc\",\n \"tsserver\": \"bin/tsserver\"\n },\n \"engines\": {\n \"node\": \">=14.17\"\n }\n },\n \"node_modules/vite\": {\n \"version\": \"8.0.3\",\n \"resolved\": \"https://registry.npmjs.org/vite/-/vite-8.0.3.tgz\",\n \"integrity\": \"sha512-B9ifbFudT1TFhfltfaIPgjo9Z3mDynBTJSUYxTjOQruf/zHH+ezCQKcoqO+h7a9Pw9Nm/OtlXAiGT1axBgwqrQ==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"dependencies\": {\n \"lightningcss\": \"^1.32.0\",\n \"picomatch\": \"^4.0.4\",\n \"postcss\": \"^8.5.8\",\n \"rolldown\": \"1.0.0-rc.12\",\n \"tinyglobby\": \"^0.2.15\"\n },\n \"bin\": {\n \"vite\": \"bin/vite.js\"\n },\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n },\n \"funding\": {\n \"url\": \"https://github.com/vitejs/vite?sponsor=1\"\n },\n \"optionalDependencies\": {\n \"fsevents\": \"~2.3.3\"\n },\n \"peerDependencies\": {\n \"@types/node\": \"^20.19.0 || >=22.12.0\",\n \"@vitejs/devtools\": \"^0.1.0\",\n \"esbuild\": \"^0.27.0\",\n \"jiti\": \">=1.21.0\",\n \"less\": \"^4.0.0\",\n \"sass\": \"^1.70.0\",\n \"sass-embedded\": \"^1.70.0\",\n \"stylus\": \">=0.54.8\",\n \"sugarss\": \"^5.0.0\",\n \"terser\": \"^5.16.0\",\n \"tsx\": \"^4.8.1\",\n \"yaml\": \"^2.4.2\"\n },\n \"peerDependenciesMeta\": {\n \"@types/node\": {\n \"optional\": true\n },\n \"@vitejs/devtools\": {\n \"optional\": true\n },\n \"esbuild\": {\n \"optional\": true\n },\n \"jiti\": {\n \"optional\": true\n },\n \"less\": {\n \"optional\": true\n },\n \"sass\": {\n \"optional\": true\n },\n \"sass-embedded\": {\n \"optional\": true\n },\n \"stylus\": {\n \"optional\": true\n },\n \"sugarss\": {\n \"optional\": true\n },\n \"terser\": {\n \"optional\": true\n },\n \"tsx\": {\n \"optional\": true\n },\n \"yaml\": {\n \"optional\": true\n }\n }\n }\n }\n}\n", h = "{\n \"name\": \"__CUSTOM_VIZ_NAME__\",\n \"version\": \"0.0.1\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"build\": \"vite build\",\n \"dev\": \"vite build --watch\",\n \"type-check\": \"tsc --noEmit\"\n },\n \"devDependencies\": {\n \"@metabase/custom-viz\": \"__CUSTOM_VIZ_VERSION__\",\n \"@types/react\": \"^19.2.14\",\n \"react\": \"^19.1.0\",\n \"typescript\": \"^5.9.3\",\n \"vite\": \"^8.0.0\"\n }\n}\n", g = "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"jsx\": \"react-jsx\",\n \"strict\": true,\n \"esModuleInterop\": true,\n \"skipLibCheck\": true,\n \"outDir\": \"dist\",\n \"declaration\": true\n },\n \"include\": [\"src\"]\n}\n", _ = "import { resolve } from \"path\";\nimport { createServer } from \"http\";\nimport { watch, cpSync, existsSync } from \"fs\";\nimport { defineConfig } from \"vite\";\n\n/**\n * Vite plugin that replaces `react` and `react/jsx-runtime` imports with\n * virtual modules that read from Metabase's `window.__METABASE_VIZ_API__`.\n *\n * This is necessary because the ES module output format cannot use\n * `output.globals`, and bare `import 'react'` would fail in the browser.\n */\nfunction metabaseVizExternals() {\n const VIRTUAL_REACT = \"\\0virtual:react\";\n const VIRTUAL_JSX_RUNTIME = \"\\0virtual:react/jsx-runtime\";\n return {\n name: \"metabase-viz-externals\",\n enforce: \"pre\" as const,\n\n resolveId(source) {\n if (source === \"react\") {\n return VIRTUAL_REACT;\n }\n if (source === \"react/jsx-runtime\") {\n return VIRTUAL_JSX_RUNTIME;\n }\n return null;\n },\n\n load(id) {\n if (id === VIRTUAL_REACT) {\n return [\n \"const React = window.__METABASE_VIZ_API__.React;\",\n \"export default React;\",\n \"export const { useState, useEffect, useRef, useCallback, useMemo, useReducer, useContext, createElement, Fragment } = React;\",\n ].join(\"\\n\");\n }\n if (id === VIRTUAL_JSX_RUNTIME) {\n return [\n \"const jsxRuntime = window.__METABASE_VIZ_API__.jsxRuntime;\",\n \"export const { jsx, jsxs, Fragment } = jsxRuntime;\",\n ].join(\"\\n\");\n }\n return null;\n },\n };\n}\n\nconst DEV_PORT = 5174;\n\n/**\n * Vite plugin that starts a dev server serving both static files from dist/\n * and an SSE endpoint at /__sse for hot-reload notifications.\n * Metabase's frontend connects to /__sse on the same origin as dev_bundle_url.\n */\nfunction metabaseDevServer() {\n const clients = new Set<import(\"http\").ServerResponse>();\n let server: ReturnType<typeof createServer> | null = null;\n\n return {\n name: \"metabase-dev-server\",\n\n buildStart() {\n if (server) {\n return;\n }\n\n const distDir = resolve(__dirname, \"dist\");\n\n server = createServer((req, res) => {\n const url = req.url ?? \"/\";\n\n // SSE endpoint for hot-reload\n if (url === \"/__sse\") {\n res.writeHead(200, {\n \"Content-Type\": \"text/event-stream\",\n \"Cache-Control\": \"no-cache\",\n Connection: \"keep-alive\",\n \"Access-Control-Allow-Origin\": \"*\",\n });\n clients.add(res);\n req.on(\"close\", () => clients.delete(res));\n return;\n }\n\n // CORS headers for all static responses\n res.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n\n // Serve static files from dist/\n const { readFile, stat } = require(\"fs\");\n const { join, extname } = require(\"path\");\n\n const filePath = url === \"/\" ? join(distDir, \"index.html\") : join(distDir, url);\n\n // Prevent directory traversal\n if (!filePath.startsWith(distDir)) {\n res.writeHead(403);\n res.end(\"Forbidden\");\n return;\n }\n\n stat(filePath, (err: NodeJS.ErrnoException | null) => {\n if (err) {\n res.writeHead(404);\n res.end(\"Not found\");\n return;\n }\n\n const mimeTypes: Record<string, string> = {\n \".html\": \"text/html\",\n \".js\": \"application/javascript\",\n \".css\": \"text/css\",\n \".json\": \"application/json\",\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".svg\": \"image/svg+xml\",\n \".ico\": \"image/x-icon\",\n };\n const contentType = mimeTypes[extname(filePath)] ?? \"application/octet-stream\";\n\n readFile(filePath, (readErr: NodeJS.ErrnoException | null, data: Buffer) => {\n if (readErr) {\n res.writeHead(500);\n res.end(\"Internal server error\");\n return;\n }\n res.writeHead(200, { \"Content-Type\": contentType });\n res.end(data);\n });\n });\n });\n\n server.listen(DEV_PORT, () => {\n console.log(\n `[custom-viz] Dev server listening on http://localhost:${DEV_PORT}`,\n );\n });\n\n // Watch public/assets/ for changes — copy to dist/assets/ and notify\n const assetsDir = resolve(__dirname, \"public/assets\");\n if (existsSync(assetsDir)) {\n watch(assetsDir, { recursive: true }, (_event, filename) => {\n if (!filename) {\n return;\n }\n cpSync(resolve(assetsDir, filename), resolve(__dirname, \"dist/assets\", filename));\n for (const client of clients) {\n client.write(\"data: reload\\n\\n\");\n }\n console.log(`[custom-viz] Asset changed: ${filename}, notified ${clients.size} client(s)`);\n });\n }\n },\n\n closeBundle() {\n for (const client of clients) {\n client.write(\"data: reload\\n\\n\");\n }\n console.log(\n `[custom-viz] Build complete, notified ${clients.size} client(s)`,\n );\n },\n };\n}\n\nconst isWatch = process.argv.includes(\"--watch\");\n\nexport default defineConfig({\n plugins: [metabaseVizExternals(), ...(isWatch ? [metabaseDevServer()] : [])],\n publicDir: \"public\",\n define: {\n \"process.env.NODE_ENV\": JSON.stringify(\"production\"),\n \"process.env\": JSON.stringify({}),\n },\n build: {\n outDir: \"dist\",\n lib: {\n entry: resolve(__dirname, \"src/index.tsx\"),\n formats: [\"iife\"],\n fileName: () => \"index.js\",\n name: \"__customVizPlugin__\",\n },\n },\n});\n", v = "__CUSTOM_VIZ_NAME__", y = "__CUSTOM_VIZ_VERSION__";
|
|
9
|
+
var l = "0.0.1-alpha.9", u = "node_modules/\n.DS_Store\n# dist must be committed\n", d = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M1.79978 6.86661C1.65041 7.01583 1.53192 7.19302 1.45107 7.38806C1.37023 7.58309 1.32861 7.79215 1.32861 8.00328C1.32861 8.21441 1.37023 8.42347 1.45107 8.61851C1.53192 8.81354 1.65041 8.99073 1.79978 9.13995L6.85978 14.1999C7.00899 14.3493 7.18618 14.4678 7.38122 14.5487C7.57626 14.6295 7.78531 14.6711 7.99644 14.6711C8.20757 14.6711 8.41663 14.6295 8.61167 14.5487C8.80671 14.4678 8.9839 14.3493 9.13311 14.1999L14.1931 9.13995C14.3425 8.99073 14.461 8.81354 14.5418 8.61851C14.6227 8.42347 14.6643 8.21441 14.6643 8.00328C14.6643 7.79215 14.6227 7.58309 14.5418 7.38806C14.461 7.19302 14.3425 7.01583 14.1931 6.86661L9.13311 1.80661C8.9839 1.65725 8.80671 1.53875 8.61167 1.45791C8.41663 1.37706 8.20757 1.33545 7.99644 1.33545C7.78531 1.33545 7.57626 1.37706 7.38122 1.45791C7.18618 1.53875 7.00899 1.65725 6.85978 1.80661L1.79978 6.86661Z\" stroke=\"white\" stroke-width=\"1.33333\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n", f = "import {\n type CreateCustomVisualization,\n type CustomStaticVisualizationProps,\n type CustomVisualizationProps,\n createDefineSetting,\n} from \"../\";\n\ntype Settings = {\n threshold?: number;\n};\n\nconst createVisualization: CreateCustomVisualization<Settings> = ({\n getAssetUrl,\n}) => {\n const defineSetting = createDefineSetting<Settings>();\n\n const VisualizationComponent = (\n props: CustomVisualizationProps<Settings>,\n ) => {\n const { height, series, settings, width } = props;\n const { threshold } = settings;\n const value = series[0].data.rows[0][0];\n\n if (!height || !width) {\n return null;\n }\n\n if (typeof value !== \"number\" || typeof threshold !== \"number\") {\n throw new Error(\"Value and threshold need to be numbers\");\n }\n\n const emoji = value >= threshold ? \"👍\" : \"👎\";\n\n return (\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n width,\n height,\n fontSize: \"10rem\",\n }}\n >\n {emoji}\n </div>\n );\n };\n\n const StaticVisualizationComponent = (\n props: CustomStaticVisualizationProps<Settings>,\n ) => {\n const width = 540;\n const height = 360;\n const { series, settings } = props;\n const { threshold } = settings;\n const value = series[0].data.rows[0][0];\n\n if (typeof value !== \"number\" || typeof threshold !== \"number\") {\n throw new Error(\"Value and threshold need to be numbers\");\n }\n\n const emoji =\n value >= threshold ? (\n <img src={getAssetUrl(\"thumbs-up.png\")} />\n ) : (\n <img src={getAssetUrl(\"thumbs-down.png\")} />\n );\n\n return (\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n width,\n height,\n fontSize: \"10rem\",\n }}\n >\n {emoji}\n </div>\n );\n };\n\n return {\n id: \"__CUSTOM_VIZ_NAME__\",\n getName: () => \"__CUSTOM_VIZ_NAME__\",\n minSize: { width: 4, height: 4 },\n defaultSize: { width: 4, height: 4 },\n checkRenderable(series, settings) {\n if (series.length !== 1) {\n throw new Error(\"Only 1 series is supported\");\n }\n\n const [\n {\n data: { cols, rows },\n },\n ] = series;\n\n if (cols.length !== 1) {\n throw new Error(\"Query results should only have 1 column\");\n }\n\n if (rows.length !== 1) {\n throw new Error(\"Query results should only have 1 row\");\n }\n\n if (typeof rows[0][0] !== \"number\") {\n throw new Error(\"Result is not a number\");\n }\n\n if (typeof settings.threshold !== \"number\") {\n throw new Error(\"Threshold setting is not set\");\n }\n },\n settings: {\n threshold: defineSetting({\n id: \"threshold\",\n title: \"Threshold\",\n widget: \"number\",\n getDefault() {\n return 0;\n },\n getProps() {\n return {\n options: {\n isInteger: false,\n isNonNegative: false,\n },\n placeholder: \"Set threshold\",\n };\n },\n }),\n },\n VisualizationComponent,\n StaticVisualizationComponent,\n };\n};\n\nexport default createVisualization;\n", p = "{\n \"name\": \"__CUSTOM_VIZ_NAME__\",\n \"icon\": \"icon.svg\",\n \"assets\": [\"icon.svg\", \"thumbs-up.png\", \"thumbs-down.png\"],\n \"metabase\": {\n \"version\": \">=59\"\n }\n}\n", m = "{\n \"name\": \"__CUSTOM_VIZ_NAME__\",\n \"version\": \"0.0.1\",\n \"lockfileVersion\": 3,\n \"requires\": true,\n \"packages\": {\n \"\": {\n \"name\": \"__CUSTOM_VIZ_NAME__\",\n \"version\": \"0.0.1\",\n \"devDependencies\": {\n \"@metabase/custom-viz\": \"__CUSTOM_VIZ_VERSION__\",\n \"@types/react\": \"^19.2.14\",\n \"react\": \"^19.1.0\",\n \"typescript\": \"^5.9.3\",\n \"vite\": \"^8.0.0\"\n }\n },\n \"node_modules/@emnapi/core\": {\n \"version\": \"1.9.1\",\n \"resolved\": \"https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz\",\n \"integrity\": \"sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"peer\": true,\n \"dependencies\": {\n \"@emnapi/wasi-threads\": \"1.2.0\",\n \"tslib\": \"^2.4.0\"\n }\n },\n \"node_modules/@emnapi/runtime\": {\n \"version\": \"1.9.1\",\n \"resolved\": \"https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz\",\n \"integrity\": \"sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"peer\": true,\n \"dependencies\": {\n \"tslib\": \"^2.4.0\"\n }\n },\n \"node_modules/@emnapi/wasi-threads\": {\n \"version\": \"1.2.0\",\n \"resolved\": \"https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz\",\n \"integrity\": \"sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"peer\": true,\n \"dependencies\": {\n \"tslib\": \"^2.4.0\"\n }\n },\n \"node_modules/@metabase/custom-viz\": {\n \"version\": \"__CUSTOM_VIZ_VERSION__\",\n \"resolved\": \"https://registry.npmjs.org/@metabase/custom-viz/-/custom-viz-__CUSTOM_VIZ_VERSION__.tgz\",\n \"dev\": true,\n \"dependencies\": {\n \"commander\": \"^13.1.0\"\n },\n \"bin\": {\n \"metabase-custom-viz\": \"dist/cli.js\"\n }\n },\n \"node_modules/@napi-rs/wasm-runtime\": {\n \"version\": \"1.1.2\",\n \"resolved\": \"https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.2.tgz\",\n \"integrity\": \"sha512-sNXv5oLJ7ob93xkZ1XnxisYhGYXfaG9f65/ZgYuAu3qt7b3NadcOEhLvx28hv31PgX8SZJRYrAIPQilQmFpLVw==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"dependencies\": {\n \"@tybys/wasm-util\": \"^0.10.1\"\n },\n \"funding\": {\n \"type\": \"github\",\n \"url\": \"https://github.com/sponsors/Brooooooklyn\"\n },\n \"peerDependencies\": {\n \"@emnapi/core\": \"^1.7.1\",\n \"@emnapi/runtime\": \"^1.7.1\"\n }\n },\n \"node_modules/@oxc-project/types\": {\n \"version\": \"0.122.0\",\n \"resolved\": \"https://registry.npmjs.org/@oxc-project/types/-/types-0.122.0.tgz\",\n \"integrity\": \"sha512-oLAl5kBpV4w69UtFZ9xqcmTi+GENWOcPF7FCrczTiBbmC0ibXxCwyvZGbO39rCVEuLGAZM84DH0pUIyyv/YJzA==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"funding\": {\n \"url\": \"https://github.com/sponsors/Boshen\"\n }\n },\n \"node_modules/@rolldown/binding-android-arm64\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-pv1y2Fv0JybcykuiiD3qBOBdz6RteYojRFY1d+b95WVuzx211CRh+ytI/+9iVyWQ6koTh5dawe4S/yRfOFjgaA==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"android\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-darwin-arm64\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-cFYr6zTG/3PXXF3pUO+umXxt1wkRK/0AYT8lDwuqvRC+LuKYWSAQAQZjCWDQpAH172ZV6ieYrNnFzVVcnSflAg==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"darwin\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-darwin-x64\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-ZCsYknnHzeXYps0lGBz8JrF37GpE9bFVefrlmDrAQhOEi4IOIlcoU1+FwHEtyXGx2VkYAvhu7dyBf75EJQffBw==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"darwin\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-freebsd-x64\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-dMLeprcVsyJsKolRXyoTH3NL6qtsT0Y2xeuEA8WQJquWFXkEC4bcu1rLZZSnZRMtAqwtrF/Ib9Ddtpa/Gkge9Q==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"freebsd\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-arm-gnueabihf\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-YqWjAgGC/9M1lz3GR1r1rP79nMgo3mQiiA+Hfo+pvKFK1fAJ1bCi0ZQVh8noOqNacuY1qIcfyVfP6HoyBRZ85Q==\",\n \"cpu\": [\n \"arm\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-arm64-gnu\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-/I5AS4cIroLpslsmzXfwbe5OmWvSsrFuEw3mwvbQ1kDxJ822hFHIx+vsN/TAzNVyepI/j/GSzrtCIwQPeKCLIg==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-arm64-musl\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-V6/wZztnBqlx5hJQqNWwFdxIKN0m38p8Jas+VoSfgH54HSj9tKTt1dZvG6JRHcjh6D7TvrJPWFGaY9UBVOaWPw==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-ppc64-gnu\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-AP3E9BpcUYliZCxa3w5Kwj9OtEVDYK6sVoUzy4vTOJsjPOgdaJZKFmN4oOlX0Wp0RPV2ETfmIra9x1xuayFB7g==\",\n \"cpu\": [\n \"ppc64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-s390x-gnu\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-nWwpvUSPkoFmZo0kQazZYOrT7J5DGOJ/+QHHzjvNlooDZED8oH82Yg67HvehPPLAg5fUff7TfWFHQS8IV1n3og==\",\n \"cpu\": [\n \"s390x\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-x64-gnu\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-RNrafz5bcwRy+O9e6P8Z/OCAJW/A+qtBczIqVYwTs14pf4iV1/+eKEjdOUta93q2TsT/FI0XYDP3TCky38LMAg==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-linux-x64-musl\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-Jpw/0iwoKWx3LJ2rc1yjFrj+T7iHZn2JDg1Yny1ma0luviFS4mhAIcd1LFNxK3EYu3DHWCps0ydXQ5i/rrJ2ig==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-openharmony-arm64\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-vRugONE4yMfVn0+7lUKdKvN4D5YusEiPilaoO2sgUWpCvrncvWgPMzK00ZFFJuiPgLwgFNP5eSiUlv2tfc+lpA==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"openharmony\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-wasm32-wasi\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-ykGiLr/6kkiHc0XnBfmFJuCjr5ZYKKofkx+chJWDjitX+KsJuAmrzWhwyOMSHzPhzOHOy7u9HlFoa5MoAOJ/Zg==\",\n \"cpu\": [\n \"wasm32\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"dependencies\": {\n \"@napi-rs/wasm-runtime\": \"^1.1.1\"\n },\n \"engines\": {\n \"node\": \">=14.0.0\"\n }\n },\n \"node_modules/@rolldown/binding-win32-arm64-msvc\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-5eOND4duWkwx1AzCxadcOrNeighiLwMInEADT0YM7xeEOOFcovWZCq8dadXgcRHSf3Ulh1kFo/qvzoFiCLOL1Q==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"win32\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/binding-win32-x64-msvc\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-PyqoipaswDLAZtot351MLhrlrh6lcZPo2LSYE+VDxbVk24LVKAGOuE4hb8xZQmrPAuEtTZW8E6D2zc5EUZX4Lw==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"win32\"\n ],\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n }\n },\n \"node_modules/@rolldown/pluginutils\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-HHMwmarRKvoFsJorqYlFeFRzXZqCt2ETQlEDOb9aqssrnVBB1/+xgTGtuTrIk5vzLNX1MjMtTf7W9z3tsSbrxw==\",\n \"dev\": true,\n \"license\": \"MIT\"\n },\n \"node_modules/@tybys/wasm-util\": {\n \"version\": \"0.10.1\",\n \"resolved\": \"https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz\",\n \"integrity\": \"sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"dependencies\": {\n \"tslib\": \"^2.4.0\"\n }\n },\n \"node_modules/@types/react\": {\n \"version\": \"19.2.14\",\n \"resolved\": \"https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz\",\n \"integrity\": \"sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"dependencies\": {\n \"csstype\": \"^3.2.2\"\n }\n },\n \"node_modules/commander\": {\n \"version\": \"13.1.0\",\n \"resolved\": \"https://registry.npmjs.org/commander/-/commander-13.1.0.tgz\",\n \"integrity\": \"sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=18\"\n }\n },\n \"node_modules/csstype\": {\n \"version\": \"3.2.3\",\n \"resolved\": \"https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz\",\n \"integrity\": \"sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==\",\n \"dev\": true,\n \"license\": \"MIT\"\n },\n \"node_modules/detect-libc\": {\n \"version\": \"2.1.2\",\n \"resolved\": \"https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz\",\n \"integrity\": \"sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==\",\n \"dev\": true,\n \"license\": \"Apache-2.0\",\n \"engines\": {\n \"node\": \">=8\"\n }\n },\n \"node_modules/fdir\": {\n \"version\": \"6.5.0\",\n \"resolved\": \"https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz\",\n \"integrity\": \"sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=12.0.0\"\n },\n \"peerDependencies\": {\n \"picomatch\": \"^3 || ^4\"\n },\n \"peerDependenciesMeta\": {\n \"picomatch\": {\n \"optional\": true\n }\n }\n },\n \"node_modules/fsevents\": {\n \"version\": \"2.3.3\",\n \"resolved\": \"https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz\",\n \"integrity\": \"sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==\",\n \"dev\": true,\n \"hasInstallScript\": true,\n \"license\": \"MIT\",\n \"optional\": true,\n \"os\": [\n \"darwin\"\n ],\n \"engines\": {\n \"node\": \"^8.16.0 || ^10.6.0 || >=11.0.0\"\n }\n },\n \"node_modules/lightningcss\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz\",\n \"integrity\": \"sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==\",\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"dependencies\": {\n \"detect-libc\": \"^2.0.3\"\n },\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n },\n \"optionalDependencies\": {\n \"lightningcss-android-arm64\": \"1.32.0\",\n \"lightningcss-darwin-arm64\": \"1.32.0\",\n \"lightningcss-darwin-x64\": \"1.32.0\",\n \"lightningcss-freebsd-x64\": \"1.32.0\",\n \"lightningcss-linux-arm-gnueabihf\": \"1.32.0\",\n \"lightningcss-linux-arm64-gnu\": \"1.32.0\",\n \"lightningcss-linux-arm64-musl\": \"1.32.0\",\n \"lightningcss-linux-x64-gnu\": \"1.32.0\",\n \"lightningcss-linux-x64-musl\": \"1.32.0\",\n \"lightningcss-win32-arm64-msvc\": \"1.32.0\",\n \"lightningcss-win32-x64-msvc\": \"1.32.0\"\n }\n },\n \"node_modules/lightningcss-android-arm64\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz\",\n \"integrity\": \"sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"android\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-darwin-arm64\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz\",\n \"integrity\": \"sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"darwin\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-darwin-x64\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz\",\n \"integrity\": \"sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"darwin\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-freebsd-x64\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz\",\n \"integrity\": \"sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"freebsd\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-linux-arm-gnueabihf\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz\",\n \"integrity\": \"sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==\",\n \"cpu\": [\n \"arm\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-linux-arm64-gnu\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz\",\n \"integrity\": \"sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-linux-arm64-musl\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz\",\n \"integrity\": \"sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-linux-x64-gnu\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz\",\n \"integrity\": \"sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-linux-x64-musl\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz\",\n \"integrity\": \"sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"linux\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-win32-arm64-msvc\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz\",\n \"integrity\": \"sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==\",\n \"cpu\": [\n \"arm64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"win32\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/lightningcss-win32-x64-msvc\": {\n \"version\": \"1.32.0\",\n \"resolved\": \"https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz\",\n \"integrity\": \"sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==\",\n \"cpu\": [\n \"x64\"\n ],\n \"dev\": true,\n \"license\": \"MPL-2.0\",\n \"optional\": true,\n \"os\": [\n \"win32\"\n ],\n \"engines\": {\n \"node\": \">= 12.0.0\"\n },\n \"funding\": {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/parcel\"\n }\n },\n \"node_modules/nanoid\": {\n \"version\": \"3.3.11\",\n \"resolved\": \"https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz\",\n \"integrity\": \"sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==\",\n \"dev\": true,\n \"funding\": [\n {\n \"type\": \"github\",\n \"url\": \"https://github.com/sponsors/ai\"\n }\n ],\n \"license\": \"MIT\",\n \"bin\": {\n \"nanoid\": \"bin/nanoid.cjs\"\n },\n \"engines\": {\n \"node\": \"^10 || ^12 || ^13.7 || ^14 || >=15.0.1\"\n }\n },\n \"node_modules/picocolors\": {\n \"version\": \"1.1.1\",\n \"resolved\": \"https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz\",\n \"integrity\": \"sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==\",\n \"dev\": true,\n \"license\": \"ISC\"\n },\n \"node_modules/picomatch\": {\n \"version\": \"4.0.4\",\n \"resolved\": \"https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz\",\n \"integrity\": \"sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=12\"\n },\n \"funding\": {\n \"url\": \"https://github.com/sponsors/jonschlinkert\"\n }\n },\n \"node_modules/postcss\": {\n \"version\": \"8.5.8\",\n \"resolved\": \"https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz\",\n \"integrity\": \"sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==\",\n \"dev\": true,\n \"funding\": [\n {\n \"type\": \"opencollective\",\n \"url\": \"https://opencollective.com/postcss/\"\n },\n {\n \"type\": \"tidelift\",\n \"url\": \"https://tidelift.com/funding/github/npm/postcss\"\n },\n {\n \"type\": \"github\",\n \"url\": \"https://github.com/sponsors/ai\"\n }\n ],\n \"license\": \"MIT\",\n \"dependencies\": {\n \"nanoid\": \"^3.3.11\",\n \"picocolors\": \"^1.1.1\",\n \"source-map-js\": \"^1.2.1\"\n },\n \"engines\": {\n \"node\": \"^10 || ^12 || >=14\"\n }\n },\n \"node_modules/react\": {\n \"version\": \"19.2.4\",\n \"resolved\": \"https://registry.npmjs.org/react/-/react-19.2.4.tgz\",\n \"integrity\": \"sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=0.10.0\"\n }\n },\n \"node_modules/rolldown\": {\n \"version\": \"1.0.0-rc.12\",\n \"resolved\": \"https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.12.tgz\",\n \"integrity\": \"sha512-yP4USLIMYrwpPHEFB5JGH1uxhcslv6/hL0OyvTuY+3qlOSJvZ7ntYnoWpehBxufkgN0cvXxppuTu5hHa/zPh+A==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"dependencies\": {\n \"@oxc-project/types\": \"=0.122.0\",\n \"@rolldown/pluginutils\": \"1.0.0-rc.12\"\n },\n \"bin\": {\n \"rolldown\": \"bin/cli.mjs\"\n },\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n },\n \"optionalDependencies\": {\n \"@rolldown/binding-android-arm64\": \"1.0.0-rc.12\",\n \"@rolldown/binding-darwin-arm64\": \"1.0.0-rc.12\",\n \"@rolldown/binding-darwin-x64\": \"1.0.0-rc.12\",\n \"@rolldown/binding-freebsd-x64\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-arm-gnueabihf\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-arm64-gnu\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-arm64-musl\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-ppc64-gnu\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-s390x-gnu\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-x64-gnu\": \"1.0.0-rc.12\",\n \"@rolldown/binding-linux-x64-musl\": \"1.0.0-rc.12\",\n \"@rolldown/binding-openharmony-arm64\": \"1.0.0-rc.12\",\n \"@rolldown/binding-wasm32-wasi\": \"1.0.0-rc.12\",\n \"@rolldown/binding-win32-arm64-msvc\": \"1.0.0-rc.12\",\n \"@rolldown/binding-win32-x64-msvc\": \"1.0.0-rc.12\"\n }\n },\n \"node_modules/source-map-js\": {\n \"version\": \"1.2.1\",\n \"resolved\": \"https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz\",\n \"integrity\": \"sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==\",\n \"dev\": true,\n \"license\": \"BSD-3-Clause\",\n \"engines\": {\n \"node\": \">=0.10.0\"\n }\n },\n \"node_modules/tinyglobby\": {\n \"version\": \"0.2.15\",\n \"resolved\": \"https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz\",\n \"integrity\": \"sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"dependencies\": {\n \"fdir\": \"^6.5.0\",\n \"picomatch\": \"^4.0.3\"\n },\n \"engines\": {\n \"node\": \">=12.0.0\"\n },\n \"funding\": {\n \"url\": \"https://github.com/sponsors/SuperchupuDev\"\n }\n },\n \"node_modules/tslib\": {\n \"version\": \"2.8.1\",\n \"resolved\": \"https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz\",\n \"integrity\": \"sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==\",\n \"dev\": true,\n \"license\": \"0BSD\",\n \"optional\": true\n },\n \"node_modules/typescript\": {\n \"version\": \"5.9.3\",\n \"resolved\": \"https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz\",\n \"integrity\": \"sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==\",\n \"dev\": true,\n \"license\": \"Apache-2.0\",\n \"bin\": {\n \"tsc\": \"bin/tsc\",\n \"tsserver\": \"bin/tsserver\"\n },\n \"engines\": {\n \"node\": \">=14.17\"\n }\n },\n \"node_modules/vite\": {\n \"version\": \"8.0.3\",\n \"resolved\": \"https://registry.npmjs.org/vite/-/vite-8.0.3.tgz\",\n \"integrity\": \"sha512-B9ifbFudT1TFhfltfaIPgjo9Z3mDynBTJSUYxTjOQruf/zHH+ezCQKcoqO+h7a9Pw9Nm/OtlXAiGT1axBgwqrQ==\",\n \"dev\": true,\n \"license\": \"MIT\",\n \"dependencies\": {\n \"lightningcss\": \"^1.32.0\",\n \"picomatch\": \"^4.0.4\",\n \"postcss\": \"^8.5.8\",\n \"rolldown\": \"1.0.0-rc.12\",\n \"tinyglobby\": \"^0.2.15\"\n },\n \"bin\": {\n \"vite\": \"bin/vite.js\"\n },\n \"engines\": {\n \"node\": \"^20.19.0 || >=22.12.0\"\n },\n \"funding\": {\n \"url\": \"https://github.com/vitejs/vite?sponsor=1\"\n },\n \"optionalDependencies\": {\n \"fsevents\": \"~2.3.3\"\n },\n \"peerDependencies\": {\n \"@types/node\": \"^20.19.0 || >=22.12.0\",\n \"@vitejs/devtools\": \"^0.1.0\",\n \"esbuild\": \"^0.27.0\",\n \"jiti\": \">=1.21.0\",\n \"less\": \"^4.0.0\",\n \"sass\": \"^1.70.0\",\n \"sass-embedded\": \"^1.70.0\",\n \"stylus\": \">=0.54.8\",\n \"sugarss\": \"^5.0.0\",\n \"terser\": \"^5.16.0\",\n \"tsx\": \"^4.8.1\",\n \"yaml\": \"^2.4.2\"\n },\n \"peerDependenciesMeta\": {\n \"@types/node\": {\n \"optional\": true\n },\n \"@vitejs/devtools\": {\n \"optional\": true\n },\n \"esbuild\": {\n \"optional\": true\n },\n \"jiti\": {\n \"optional\": true\n },\n \"less\": {\n \"optional\": true\n },\n \"sass\": {\n \"optional\": true\n },\n \"sass-embedded\": {\n \"optional\": true\n },\n \"stylus\": {\n \"optional\": true\n },\n \"sugarss\": {\n \"optional\": true\n },\n \"terser\": {\n \"optional\": true\n },\n \"tsx\": {\n \"optional\": true\n },\n \"yaml\": {\n \"optional\": true\n }\n }\n }\n }\n}\n", h = "{\n \"name\": \"__CUSTOM_VIZ_NAME__\",\n \"version\": \"0.0.1\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"build\": \"vite build\",\n \"dev\": \"vite build --watch\",\n \"type-check\": \"tsc --noEmit\"\n },\n \"devDependencies\": {\n \"@metabase/custom-viz\": \"__CUSTOM_VIZ_VERSION__\",\n \"@types/react\": \"^19.2.14\",\n \"react\": \"^19.1.0\",\n \"typescript\": \"^5.9.3\",\n \"vite\": \"^8.0.0\"\n }\n}\n", g = "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"jsx\": \"react-jsx\",\n \"strict\": true,\n \"esModuleInterop\": true,\n \"skipLibCheck\": true,\n \"outDir\": \"dist\",\n \"declaration\": true\n },\n \"include\": [\"src\"]\n}\n", _ = "import { cpSync, existsSync, watch } from \"fs\";\nimport { createServer } from \"http\";\nimport { resolve } from \"path\";\nimport { defineConfig } from \"vite\";\n\n/**\n * Vite plugin that replaces `react` and `react/jsx-runtime` imports with\n * virtual modules that read from Metabase's `window.__METABASE_VIZ_API__`.\n *\n * This is necessary because the ES module output format cannot use\n * `output.globals`, and bare `import 'react'` would fail in the browser.\n */\nfunction metabaseVizExternals() {\n const VIRTUAL_REACT = \"\\0virtual:react\";\n const VIRTUAL_JSX_RUNTIME = \"\\0virtual:react/jsx-runtime\";\n return {\n name: \"metabase-viz-externals\",\n enforce: \"pre\" as const,\n\n resolveId(source) {\n if (source === \"react\") {\n return VIRTUAL_REACT;\n }\n if (source === \"react/jsx-runtime\") {\n return VIRTUAL_JSX_RUNTIME;\n }\n return null;\n },\n\n load(id) {\n if (id === VIRTUAL_REACT) {\n return [\n \"const React = window.__METABASE_VIZ_API__.React;\",\n \"export default React;\",\n \"export const { useState, useEffect, useRef, useCallback, useMemo, useReducer, useContext, createElement, Fragment } = React;\",\n ].join(\"\\n\");\n }\n if (id === VIRTUAL_JSX_RUNTIME) {\n return [\n \"const jsxRuntime = window.__METABASE_VIZ_API__.jsxRuntime;\",\n \"export const { jsx, jsxs, Fragment } = jsxRuntime;\",\n ].join(\"\\n\");\n }\n return null;\n },\n };\n}\n\nconst DEV_PORT = 5174;\n\n/**\n * Vite plugin that starts a dev server serving both static files from dist/\n * and an SSE endpoint at /__sse for hot-reload notifications.\n * Metabase's frontend connects to /__sse on the same origin as dev_bundle_url.\n */\nfunction metabaseDevServer() {\n const clients = new Set<import(\"http\").ServerResponse>();\n let server: ReturnType<typeof createServer> | null = null;\n\n return {\n name: \"metabase-dev-server\",\n\n buildStart() {\n if (server) {\n return;\n }\n\n const distDir = resolve(__dirname, \"dist\");\n\n server = createServer((req, res) => {\n const url = req.url ?? \"/\";\n\n // SSE endpoint for hot-reload\n if (url === \"/__sse\") {\n res.writeHead(200, {\n \"Content-Type\": \"text/event-stream\",\n \"Cache-Control\": \"no-cache\",\n Connection: \"keep-alive\",\n \"Access-Control-Allow-Origin\": \"*\",\n });\n clients.add(res);\n req.on(\"close\", () => clients.delete(res));\n return;\n }\n\n // CORS headers for all static responses\n res.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n\n // Serve static files from dist/\n const { readFile, stat } = require(\"fs\");\n const { join, extname } = require(\"path\");\n\n const filePath =\n url === \"/\" ? join(distDir, \"index.html\") : join(distDir, url);\n\n // Prevent directory traversal\n if (!filePath.startsWith(distDir)) {\n res.writeHead(403);\n res.end(\"Forbidden\");\n return;\n }\n\n stat(filePath, (err: NodeJS.ErrnoException | null) => {\n if (err) {\n res.writeHead(404);\n res.end(\"Not found\");\n return;\n }\n\n const mimeTypes: Record<string, string> = {\n \".html\": \"text/html\",\n \".js\": \"application/javascript\",\n \".css\": \"text/css\",\n \".json\": \"application/json\",\n \".png\": \"image/png\",\n \".jpg\": \"image/jpeg\",\n \".svg\": \"image/svg+xml\",\n \".ico\": \"image/x-icon\",\n };\n const contentType =\n mimeTypes[extname(filePath)] ?? \"application/octet-stream\";\n\n readFile(\n filePath,\n (readErr: NodeJS.ErrnoException | null, data: Buffer) => {\n if (readErr) {\n res.writeHead(500);\n res.end(\"Internal server error\");\n return;\n }\n res.writeHead(200, { \"Content-Type\": contentType });\n res.end(data);\n },\n );\n });\n });\n\n server.listen(DEV_PORT, () => {\n console.log(\n `[custom-viz] Dev server listening on http://localhost:${DEV_PORT}`,\n );\n });\n\n // Watch public/assets/ for changes — copy to dist/assets/ and notify\n const assetsDir = resolve(__dirname, \"public/assets\");\n if (existsSync(assetsDir)) {\n watch(assetsDir, { recursive: true }, (_event, filename) => {\n if (!filename) {\n return;\n }\n cpSync(\n resolve(assetsDir, filename),\n resolve(__dirname, \"dist/assets\", filename),\n );\n for (const client of clients) {\n client.write(\"data: reload\\n\\n\");\n }\n console.log(\n `[custom-viz] Asset changed: ${filename}, notified ${clients.size} client(s)`,\n );\n });\n }\n },\n\n closeBundle() {\n for (const client of clients) {\n client.write(\"data: reload\\n\\n\");\n }\n console.log(\n `[custom-viz] Build complete, notified ${clients.size} client(s)`,\n );\n },\n };\n}\n\nconst isWatch = process.argv.includes(\"--watch\");\n\nexport default defineConfig({\n plugins: [metabaseVizExternals(), ...(isWatch ? [metabaseDevServer()] : [])],\n publicDir: \"public\",\n define: {\n \"process.env.NODE_ENV\": JSON.stringify(\"production\"),\n \"process.env\": JSON.stringify({}),\n },\n build: {\n outDir: \"dist\",\n lib: {\n entry: resolve(__dirname, \"src/index.tsx\"),\n formats: [\"iife\"],\n fileName: () => \"index.js\",\n name: \"__customVizPlugin__\",\n },\n },\n});\n", v = "__CUSTOM_VIZ_NAME__", y = "__CUSTOM_VIZ_VERSION__";
|
|
10
10
|
function b(e, t) {
|
|
11
11
|
return e.split(v).join(t);
|
|
12
12
|
}
|
|
13
13
|
function x(e) {
|
|
14
|
-
return
|
|
14
|
+
return e.replace("../", "@metabase/custom-viz");
|
|
15
15
|
}
|
|
16
16
|
function S(e) {
|
|
17
|
+
return b(h, e).split(y).join(l);
|
|
18
|
+
}
|
|
19
|
+
function C(e) {
|
|
17
20
|
return b(m, e).split(y).join(l);
|
|
18
21
|
}
|
|
19
|
-
function
|
|
22
|
+
function w() {
|
|
20
23
|
return _;
|
|
21
24
|
}
|
|
22
|
-
function
|
|
25
|
+
function T() {
|
|
23
26
|
return g;
|
|
24
27
|
}
|
|
25
|
-
function T(e) {
|
|
26
|
-
return b(f, e);
|
|
27
|
-
}
|
|
28
28
|
function E(e) {
|
|
29
|
+
return b(x(f), e);
|
|
30
|
+
}
|
|
31
|
+
function D(e) {
|
|
29
32
|
return b(p, e);
|
|
30
33
|
}
|
|
31
|
-
function
|
|
34
|
+
function O() {
|
|
32
35
|
return d;
|
|
33
36
|
}
|
|
34
|
-
var
|
|
35
|
-
function
|
|
36
|
-
return t(a(
|
|
37
|
+
var k = a(i(c(import.meta.url)), "templates");
|
|
38
|
+
function A(e) {
|
|
39
|
+
return t(a(k, e));
|
|
37
40
|
}
|
|
38
|
-
function
|
|
41
|
+
function j() {
|
|
39
42
|
return u;
|
|
40
43
|
}
|
|
41
|
-
function
|
|
44
|
+
function M(e) {
|
|
42
45
|
let t = JSON.parse(e), n = JSON.parse(h.split(v).join("__placeholder__").split(y).join(l));
|
|
43
46
|
return t.devDependencies = {
|
|
44
47
|
...t.devDependencies,
|
|
@@ -50,22 +53,22 @@ function j(e) {
|
|
|
50
53
|
}
|
|
51
54
|
//#endregion
|
|
52
55
|
//#region src/cli.ts
|
|
53
|
-
var
|
|
54
|
-
|
|
56
|
+
var N = new s();
|
|
57
|
+
N.name("metabase-custom-viz").description("CLI for creating custom visualizations for Metabase").version(l), N.command("init").description("Scaffold a new custom visualization").argument("<name>", "Name of the custom visualization").action(async (t) => {
|
|
55
58
|
let i = t.trim().replace(/\s+/g, "-").toLowerCase();
|
|
56
59
|
(!i || !/^[a-z0-9@][a-z0-9._\-/]*$/.test(i)) && (console.error(`Error: "${t}" is not a valid project name. Use letters, numbers, hyphens, and dots.`), process.exit(1)), e(i) && (console.error(`Error: Directory "${i}" already exists.`), process.exit(1)), console.log(`Scaffolding custom visualization: ${i}\n`), await Promise.all([n(a(i, "src"), { recursive: !0 }), n(a(i, "public", "assets"), { recursive: !0 })]), await Promise.all([
|
|
57
|
-
r(a(i, "package.json"),
|
|
58
|
-
r(a(i, "package-lock.json"),
|
|
59
|
-
r(a(i, "vite.config.ts"),
|
|
60
|
-
r(a(i, "tsconfig.json"),
|
|
61
|
-
r(a(i, "src", "index.tsx"),
|
|
62
|
-
r(a(i, "metabase-plugin.json"),
|
|
63
|
-
r(a(i, "public", "assets", "icon.svg"),
|
|
64
|
-
r(a(i, "public", "assets", "thumbs-up.png"),
|
|
65
|
-
r(a(i, "public", "assets", "thumbs-down.png"),
|
|
66
|
-
r(a(i, ".gitignore"),
|
|
60
|
+
r(a(i, "package.json"), S(i)),
|
|
61
|
+
r(a(i, "package-lock.json"), C(i)),
|
|
62
|
+
r(a(i, "vite.config.ts"), w()),
|
|
63
|
+
r(a(i, "tsconfig.json"), T()),
|
|
64
|
+
r(a(i, "src", "index.tsx"), E(i)),
|
|
65
|
+
r(a(i, "metabase-plugin.json"), D(i)),
|
|
66
|
+
r(a(i, "public", "assets", "icon.svg"), O()),
|
|
67
|
+
r(a(i, "public", "assets", "thumbs-up.png"), A("thumbs-up.png")),
|
|
68
|
+
r(a(i, "public", "assets", "thumbs-down.png"), A("thumbs-down.png")),
|
|
69
|
+
r(a(i, ".gitignore"), j())
|
|
67
70
|
]), console.log("Created files:"), console.log(` ${i}/package.json`), console.log(` ${i}/package-lock.json`), console.log(` ${i}/vite.config.ts`), console.log(` ${i}/tsconfig.json`), console.log(` ${i}/src/index.tsx`), console.log(` ${i}/metabase-plugin.json`), console.log(` ${i}/public/assets/icon.svg`), console.log(` ${i}/public/assets/thumbs-up.png`), console.log(` ${i}/public/assets/thumbs-down.png`), console.log(` ${i}/.gitignore`), console.log(), console.log("Next steps:"), console.log(` cd ${i}`), console.log(" npm install"), console.log(" npm run dev # Watch mode"), console.log(" npm run build # Production build");
|
|
68
|
-
}),
|
|
71
|
+
}), N.command("upgrade").description("Upgrade an existing custom visualization to the latest template version").action(async () => {
|
|
69
72
|
let n = process.cwd(), i = a(n, "package.json");
|
|
70
73
|
e(i) || (console.error("Error: No package.json found. Run this command from the root of a custom visualization project."), process.exit(1));
|
|
71
74
|
let o;
|
|
@@ -75,21 +78,21 @@ M.name("metabase-custom-viz").description("CLI for creating custom visualization
|
|
|
75
78
|
console.error("Error: Could not parse package.json."), process.exit(1);
|
|
76
79
|
}
|
|
77
80
|
let s = o.devDependencies?.["@metabase/custom-viz"];
|
|
78
|
-
if (s || (console.error("Error: @metabase/custom-viz not found in devDependencies. Is this a custom visualization project?"), process.exit(1)), s === "0.0.1-alpha.
|
|
81
|
+
if (s || (console.error("Error: @metabase/custom-viz not found in devDependencies. Is this a custom visualization project?"), process.exit(1)), s === "0.0.1-alpha.9") {
|
|
79
82
|
console.log(`Already up to date (v${l}). No changes needed.`);
|
|
80
83
|
return;
|
|
81
84
|
}
|
|
82
|
-
if (console.log(`Upgrading from @metabase/custom-viz ${s} → ${l}\n`), console.log("The following changes will be made:\n"), console.log(" vite.config.ts — Replace with the latest build configuration"), console.log(" tsconfig.json — Replace with the latest TypeScript configuration"), console.log(" .gitignore — Replace with the latest gitignore rules"), console.log(" package.json — Update devDependencies and scripts to latest versions"), console.log(), console.log("Your source code (src/), assets (public/), and metabase-plugin.json will NOT be modified.\n"), !await
|
|
85
|
+
if (console.log(`Upgrading from @metabase/custom-viz ${s} → ${l}\n`), console.log("The following changes will be made:\n"), console.log(" vite.config.ts — Replace with the latest build configuration"), console.log(" tsconfig.json — Replace with the latest TypeScript configuration"), console.log(" .gitignore — Replace with the latest gitignore rules"), console.log(" package.json — Update devDependencies and scripts to latest versions"), console.log(), console.log("Your source code (src/), assets (public/), and metabase-plugin.json will NOT be modified.\n"), !await P("Proceed with upgrade?")) {
|
|
83
86
|
console.log("Upgrade cancelled.");
|
|
84
87
|
return;
|
|
85
88
|
}
|
|
86
89
|
console.log();
|
|
87
90
|
let c = [];
|
|
88
|
-
await r(a(n, "vite.config.ts"),
|
|
91
|
+
await r(a(n, "vite.config.ts"), w()), c.push("vite.config.ts"), await r(a(n, "tsconfig.json"), T()), c.push("tsconfig.json"), await r(a(n, ".gitignore"), j()), c.push(".gitignore"), await r(i, M(t(i, "utf-8"))), c.push("package.json"), console.log("Updated files:");
|
|
89
92
|
for (let e of c) console.log(` ${e}`);
|
|
90
93
|
console.log(), console.log("Next steps:"), console.log(" npm install # Install updated dependencies");
|
|
91
94
|
});
|
|
92
|
-
function
|
|
95
|
+
function P(e) {
|
|
93
96
|
let t = o({
|
|
94
97
|
input: process.stdin,
|
|
95
98
|
output: process.stdout
|
|
@@ -100,5 +103,5 @@ function N(e) {
|
|
|
100
103
|
});
|
|
101
104
|
});
|
|
102
105
|
}
|
|
103
|
-
|
|
106
|
+
N.parse();
|
|
104
107
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-types.d.ts","sourceRoot":"","sources":["../src/column-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAQ3C,eAAO,MAAM,MAAM,EAAE,eAA2C,CAAC;AACjE,eAAO,MAAM,SAAS,EAAE,eAA8C,CAAC;AACvE,eAAO,MAAM,SAAS,EAAE,eAA8C,CAAC;AACvE,eAAO,MAAM,SAAS,EAAE,eAA8C,CAAC;AACvE,eAAO,MAAM,QAAQ,EAAE,eAA6C,CAAC;AACrE,eAAO,MAAM,YAAY,EAAE,eAAiD,CAAC;AAC7E,eAAO,MAAM,UAAU,EAAE,eAA+C,CAAC;AACzE,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"column-types.d.ts","sourceRoot":"","sources":["../src/column-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAQ3C,eAAO,MAAM,MAAM,EAAE,eAA2C,CAAC;AACjE,eAAO,MAAM,SAAS,EAAE,eAA8C,CAAC;AACvE,eAAO,MAAM,SAAS,EAAE,eAA8C,CAAC;AACvE,eAAO,MAAM,SAAS,EAAE,eAA8C,CAAC;AACvE,eAAO,MAAM,QAAQ,EAAE,eAA6C,CAAC;AACrE,eAAO,MAAM,YAAY,EAAE,eAAiD,CAAC;AAC7E,eAA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MAAM,UAAU,EAAE,eAA+C,CAAC;AACzE,eAAO,MAAM,8BAA8B,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAEnB,CAAC;AAE/C,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
//#region src/
|
|
2
|
-
function e(
|
|
3
|
-
return
|
|
1
|
+
//#region src/column-types.ts
|
|
2
|
+
function e() {
|
|
3
|
+
return window.__METABASE_VIZ_API__.columnTypes;
|
|
4
|
+
}
|
|
5
|
+
var t = (t) => e().isDate(t), n = (t) => e().isNumeric(t), r = (t) => e().isInteger(t), i = (t) => e().isBoolean(t), a = (t) => e().isString(t), o = (t) => e().isStringLike(t), s = (t) => e().isSummable(t), c = (t) => e().isNumericBaseType(t), l = (t) => e().isDateWithoutTime(t), u = (t) => e().isNumber(t), d = (t) => e().isFloat(t), f = (t) => e().isTime(t), p = (t) => e().isFK(t), m = (t) => e().isPK(t), h = (t) => e().isEntityName(t), g = (t) => e().isTitle(t), _ = (t) => e().isProduct(t), v = (t) => e().isSource(t), y = (t) => e().isAddress(t), b = (t) => e().isScore(t), x = (t) => e().isQuantity(t), S = (t) => e().isCategory(t), C = (t) => e().isAny(t), w = (t) => e().isState(t), T = (t) => e().isCountry(t), E = (t) => e().isCoordinate(t), D = (t) => e().isLatitude(t), O = (t) => e().isLongitude(t), k = (t) => e().isCurrency(t), A = (t) => e().isPercentage(t), j = (t) => e().isID(t), M = (t) => e().isURL(t), N = (t) => e().isEmail(t), P = (t) => e().isAvatarURL(t), F = (t) => e().isImageURL(t), I = (t) => e().hasLatitudeAndLongitudeColumns(t), L = (e, t) => window.__METABASE_VIZ_API__.formatValue(e, t);
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/lib/createDefineSetting.ts
|
|
8
|
+
function R() {
|
|
9
|
+
return function(e) {
|
|
10
|
+
return e;
|
|
11
|
+
};
|
|
4
12
|
}
|
|
5
13
|
//#endregion
|
|
6
|
-
//#region src/
|
|
7
|
-
var
|
|
14
|
+
//#region src/measure-text.ts
|
|
15
|
+
var z = () => ({
|
|
16
|
+
width: 0,
|
|
17
|
+
height: 0
|
|
18
|
+
}), B = () => 0, V = () => 0, H = [
|
|
8
19
|
"minute",
|
|
9
20
|
"hour",
|
|
10
21
|
"day",
|
|
@@ -12,7 +23,7 @@ var t = [
|
|
|
12
23
|
"month",
|
|
13
24
|
"quarter",
|
|
14
25
|
"year"
|
|
15
|
-
],
|
|
26
|
+
], U = [
|
|
16
27
|
"minute-of-hour",
|
|
17
28
|
"hour-of-day",
|
|
18
29
|
"day-of-week",
|
|
@@ -21,15 +32,6 @@ var t = [
|
|
|
21
32
|
"week-of-year",
|
|
22
33
|
"month-of-year",
|
|
23
34
|
"quarter-of-year"
|
|
24
|
-
],
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region src/column-types.ts
|
|
27
|
-
function i() {
|
|
28
|
-
return window.__METABASE_VIZ_API__.columnTypes;
|
|
29
|
-
}
|
|
30
|
-
var a = (e) => i().isDate(e), o = (e) => i().isNumeric(e), s = (e) => i().isInteger(e), c = (e) => i().isBoolean(e), l = (e) => i().isString(e), u = (e) => i().isStringLike(e), d = (e) => i().isSummable(e), f = (e) => i().isNumericBaseType(e), p = (e) => i().isDateWithoutTime(e), m = (e) => i().isNumber(e), h = (e) => i().isFloat(e), g = (e) => i().isTime(e), _ = (e) => i().isFK(e), v = (e) => i().isPK(e), y = (e) => i().isEntityName(e), b = (e) => i().isTitle(e), x = (e) => i().isProduct(e), S = (e) => i().isSource(e), C = (e) => i().isAddress(e), w = (e) => i().isScore(e), T = (e) => i().isQuantity(e), E = (e) => i().isCategory(e), D = (e) => i().isAny(e), O = (e) => i().isState(e), k = (e) => i().isCountry(e), A = (e) => i().isCoordinate(e), j = (e) => i().isLatitude(e), M = (e) => i().isLongitude(e), N = (e) => i().isCurrency(e), P = (e) => i().isPercentage(e), F = (e) => i().isID(e), I = (e) => i().isURL(e), L = (e) => i().isEmail(e), R = (e) => i().isAvatarURL(e), z = (e) => i().isImageURL(e), B = (e) => i().hasLatitudeAndLongitudeColumns(e), V = (e, t) => window.__METABASE_VIZ_API__.formatValue(e, t), H = () => ({
|
|
31
|
-
width: 0,
|
|
32
|
-
height: 0
|
|
33
|
-
}), U = () => 0, W = () => 0;
|
|
35
|
+
], W = [...H, ...U];
|
|
34
36
|
//#endregion
|
|
35
|
-
export {
|
|
37
|
+
export { R as createDefineSetting, H as dateTimeAbsoluteUnits, U as dateTimeRelativeUnits, W as dateTimeUnits, L as formatValue, I as hasLatitudeAndLongitudeColumns, y as isAddress, C as isAny, P as isAvatarURL, i as isBoolean, S as isCategory, E as isCoordinate, T as isCountry, k as isCurrency, t as isDate, l as isDateWithoutTime, N as isEmail, h as isEntityName, p as isFK, d as isFloat, j as isID, F as isImageURL, r as isInteger, D as isLatitude, O as isLongitude, u as isNumber, n as isNumeric, c as isNumericBaseType, m as isPK, A as isPercentage, _ as isProduct, x as isQuantity, b as isScore, v as isSource, w as isState, a as isString, o as isStringLike, s as isSummable, f as isTime, g as isTitle, M as isURL, z as measureText, V as measureTextHeight, B as measureTextWidth };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseWidgetProps, CustomVisualizationSettingDefinition, Series, WidgetName, Widgets } from '../types';
|
|
2
|
+
type OmitBaseWidgetProps<P> = keyof BaseWidgetProps<unknown, unknown> extends keyof P ? Omit<P, keyof BaseWidgetProps<unknown, unknown>> : P;
|
|
3
|
+
type PropsFromWidget<W> = W extends WidgetName ? Widgets[W] : W extends (props: infer P) => any ? OmitBaseWidgetProps<P> : never;
|
|
4
|
+
export declare function createDefineSetting<CustomVisualizationSettings extends Record<string, unknown>>(): <W extends WidgetName | ((props: any) => any), Key extends keyof CustomVisualizationSettings>(settingDefinition: {
|
|
5
|
+
id: Key;
|
|
6
|
+
section?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
group?: string;
|
|
9
|
+
index?: number;
|
|
10
|
+
inline?: boolean;
|
|
11
|
+
persistDefault?: boolean;
|
|
12
|
+
set?: boolean;
|
|
13
|
+
readDependencies?: string[];
|
|
14
|
+
writeDependencies?: string[];
|
|
15
|
+
eraseDependencies?: string[];
|
|
16
|
+
widget: W;
|
|
17
|
+
isValid?: (series: Series, settings: CustomVisualizationSettings) => boolean;
|
|
18
|
+
getDefault?: (series: Series, settings: CustomVisualizationSettings) => CustomVisualizationSettings[Key];
|
|
19
|
+
getProps?: PropsFromWidget<W> extends never ? never : (object: Series, vizSettings: CustomVisualizationSettings) => PropsFromWidget<W>;
|
|
20
|
+
getValue?: (series: Series, settings: CustomVisualizationSettings) => CustomVisualizationSettings[Key];
|
|
21
|
+
}) => CustomVisualizationSettingDefinition<CustomVisualizationSettings>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=createDefineSetting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDefineSetting.d.ts","sourceRoot":"","sources":["../../src/lib/createDefineSetting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,oCAAoC,EACpC,MAAM,EACN,UAAU,EACV,OAAO,EACR,MAAM,UAAU,CAAC;AAElB,KAAK,mBAAmB,CAAC,CAAC,IAAI,MAAM,eAAe,CACjD,OAAO,EACP,OAAO,CACR,SAAS,MAAM,CAAC,GACb,IAAI,CA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AAM,EACd,WAAW,EAAE,2BAA2B,KACrC,eAAe,CAAC,CAAC,CAAC,CAAC;IAC5B,QAAQ,CAAC,EAAE,CACT,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,2BAA2B,KAClC,2BAA2B,CAAC,GAAG,CAAC,CAAC;CACvC,KAAG,oCAAoC,CAAC,2BAA2B,CAAC,CAGtE"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './createDefineSetting';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
package/dist/templates/index.tsx
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
CreateCustomVisualization,
|
|
3
|
-
CustomStaticVisualizationProps,
|
|
4
|
-
CustomVisualizationProps,
|
|
5
|
-
|
|
1
|
+
import {
|
|
2
|
+
type CreateCustomVisualization,
|
|
3
|
+
type CustomStaticVisualizationProps,
|
|
4
|
+
type CustomVisualizationProps,
|
|
5
|
+
createDefineSetting,
|
|
6
|
+
} from "../";
|
|
6
7
|
|
|
7
8
|
type Settings = {
|
|
8
9
|
threshold?: number;
|
|
@@ -11,14 +12,82 @@ type Settings = {
|
|
|
11
12
|
const createVisualization: CreateCustomVisualization<Settings> = ({
|
|
12
13
|
getAssetUrl,
|
|
13
14
|
}) => {
|
|
15
|
+
const defineSetting = createDefineSetting<Settings>();
|
|
16
|
+
|
|
17
|
+
const VisualizationComponent = (
|
|
18
|
+
props: CustomVisualizationProps<Settings>,
|
|
19
|
+
) => {
|
|
20
|
+
const { height, series, settings, width } = props;
|
|
21
|
+
const { threshold } = settings;
|
|
22
|
+
const value = series[0].data.rows[0][0];
|
|
23
|
+
|
|
24
|
+
if (!height || !width) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (typeof value !== "number" || typeof threshold !== "number") {
|
|
29
|
+
throw new Error("Value and threshold need to be numbers");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const emoji = value >= threshold ? "👍" : "👎";
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div
|
|
36
|
+
style={{
|
|
37
|
+
display: "flex",
|
|
38
|
+
justifyContent: "center",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
width,
|
|
41
|
+
height,
|
|
42
|
+
fontSize: "10rem",
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
{emoji}
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const StaticVisualizationComponent = (
|
|
51
|
+
props: CustomStaticVisualizationProps<Settings>,
|
|
52
|
+
) => {
|
|
53
|
+
const width = 540;
|
|
54
|
+
const height = 360;
|
|
55
|
+
const { series, settings } = props;
|
|
56
|
+
const { threshold } = settings;
|
|
57
|
+
const value = series[0].data.rows[0][0];
|
|
58
|
+
|
|
59
|
+
if (typeof value !== "number" || typeof threshold !== "number") {
|
|
60
|
+
throw new Error("Value and threshold need to be numbers");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const emoji =
|
|
64
|
+
value >= threshold ? (
|
|
65
|
+
<img src={getAssetUrl("thumbs-up.png")} />
|
|
66
|
+
) : (
|
|
67
|
+
<img src={getAssetUrl("thumbs-down.png")} />
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div
|
|
72
|
+
style={{
|
|
73
|
+
display: "flex",
|
|
74
|
+
justifyContent: "center",
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
width,
|
|
77
|
+
height,
|
|
78
|
+
fontSize: "10rem",
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
{emoji}
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
14
86
|
return {
|
|
15
87
|
id: "__CUSTOM_VIZ_NAME__",
|
|
16
88
|
getName: () => "__CUSTOM_VIZ_NAME__",
|
|
17
|
-
minSize: { width:
|
|
18
|
-
defaultSize: { width:
|
|
19
|
-
isSensible({ cols, rows }) {
|
|
20
|
-
return cols.length === 1 && rows.length === 1 && typeof rows[0][0] === "number";
|
|
21
|
-
},
|
|
89
|
+
minSize: { width: 4, height: 4 },
|
|
90
|
+
defaultSize: { width: 4, height: 4 },
|
|
22
91
|
checkRenderable(series, settings) {
|
|
23
92
|
if (series.length !== 1) {
|
|
24
93
|
throw new Error("Only 1 series is supported");
|
|
@@ -47,8 +116,8 @@ const createVisualization: CreateCustomVisualization<Settings> = ({
|
|
|
47
116
|
}
|
|
48
117
|
},
|
|
49
118
|
settings: {
|
|
50
|
-
threshold: {
|
|
51
|
-
id: "
|
|
119
|
+
threshold: defineSetting({
|
|
120
|
+
id: "threshold",
|
|
52
121
|
title: "Threshold",
|
|
53
122
|
widget: "number",
|
|
54
123
|
getDefault() {
|
|
@@ -63,74 +132,11 @@ const createVisualization: CreateCustomVisualization<Settings> = ({
|
|
|
63
132
|
placeholder: "Set threshold",
|
|
64
133
|
};
|
|
65
134
|
},
|
|
66
|
-
},
|
|
135
|
+
}),
|
|
67
136
|
},
|
|
68
|
-
VisualizationComponent
|
|
69
|
-
StaticVisualizationComponent
|
|
137
|
+
VisualizationComponent,
|
|
138
|
+
StaticVisualizationComponent,
|
|
70
139
|
};
|
|
71
140
|
};
|
|
72
141
|
|
|
73
|
-
const makeVisualizationComponent = (getAssetUrl: (path: string) => string) => (props: CustomVisualizationProps<Settings>) => {
|
|
74
|
-
const { height, series, settings, width } = props;
|
|
75
|
-
const { threshold } = settings;
|
|
76
|
-
const value = series[0].data.rows[0][0];
|
|
77
|
-
|
|
78
|
-
if (typeof value !== "number" || typeof threshold !== "number") {
|
|
79
|
-
throw new Error("Value and threshold need to be numbers");
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const emoji = value >= threshold ? "👍" : "👎";
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<div
|
|
86
|
-
style={{
|
|
87
|
-
display: "flex",
|
|
88
|
-
justifyContent: "center",
|
|
89
|
-
alignItems: "center",
|
|
90
|
-
width,
|
|
91
|
-
height,
|
|
92
|
-
fontSize: "10rem",
|
|
93
|
-
}}
|
|
94
|
-
>
|
|
95
|
-
{emoji}
|
|
96
|
-
</div>
|
|
97
|
-
);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const makeStaticVisualizationComponent = (getAssetUrl: (path: string) => string) => (
|
|
101
|
-
props: CustomStaticVisualizationProps<Settings>,
|
|
102
|
-
) => {
|
|
103
|
-
const width = 540;
|
|
104
|
-
const height = 360;
|
|
105
|
-
const { series, settings } = props;
|
|
106
|
-
const { threshold } = settings;
|
|
107
|
-
const value = series[0].data.rows[0][0];
|
|
108
|
-
|
|
109
|
-
if (typeof value !== "number" || typeof threshold !== "number") {
|
|
110
|
-
throw new Error("Value and threshold need to be numbers");
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const emoji =
|
|
114
|
-
value >= threshold ? (
|
|
115
|
-
<img src={getAssetUrl("thumbs-up.png")} />
|
|
116
|
-
) : (
|
|
117
|
-
<img src={getAssetUrl("thumbs-down.png")} />
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
return (
|
|
121
|
-
<div
|
|
122
|
-
style={{
|
|
123
|
-
display: "flex",
|
|
124
|
-
justifyContent: "center",
|
|
125
|
-
alignItems: "center",
|
|
126
|
-
width,
|
|
127
|
-
height,
|
|
128
|
-
fontSize: "10rem",
|
|
129
|
-
}}
|
|
130
|
-
>
|
|
131
|
-
{emoji}
|
|
132
|
-
</div>
|
|
133
|
-
);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
142
|
export default createVisualization;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cpSync, existsSync, watch } from "fs";
|
|
2
2
|
import { createServer } from "http";
|
|
3
|
-
import {
|
|
3
|
+
import { resolve } from "path";
|
|
4
4
|
import { defineConfig } from "vite";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -90,7 +90,8 @@ function metabaseDevServer() {
|
|
|
90
90
|
const { readFile, stat } = require("fs");
|
|
91
91
|
const { join, extname } = require("path");
|
|
92
92
|
|
|
93
|
-
const filePath =
|
|
93
|
+
const filePath =
|
|
94
|
+
url === "/" ? join(distDir, "index.html") : join(distDir, url);
|
|
94
95
|
|
|
95
96
|
// Prevent directory traversal
|
|
96
97
|
if (!filePath.startsWith(distDir)) {
|
|
@@ -116,17 +117,21 @@ function metabaseDevServer() {
|
|
|
116
117
|
".svg": "image/svg+xml",
|
|
117
118
|
".ico": "image/x-icon",
|
|
118
119
|
};
|
|
119
|
-
const contentType =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
120
|
+
const contentType =
|
|
121
|
+
mimeTypes[extname(filePath)] ?? "application/octet-stream";
|
|
122
|
+
|
|
123
|
+
readFile(
|
|
124
|
+
filePath,
|
|
125
|
+
(readErr: NodeJS.ErrnoException | null, data: Buffer) => {
|
|
126
|
+
if (readErr) {
|
|
127
|
+
res.writeHead(500);
|
|
128
|
+
res.end("Internal server error");
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
res.writeHead(200, { "Content-Type": contentType });
|
|
132
|
+
res.end(data);
|
|
133
|
+
},
|
|
134
|
+
);
|
|
130
135
|
});
|
|
131
136
|
});
|
|
132
137
|
|
|
@@ -143,11 +148,16 @@ function metabaseDevServer() {
|
|
|
143
148
|
if (!filename) {
|
|
144
149
|
return;
|
|
145
150
|
}
|
|
146
|
-
cpSync(
|
|
151
|
+
cpSync(
|
|
152
|
+
resolve(assetsDir, filename),
|
|
153
|
+
resolve(__dirname, "dist/assets", filename),
|
|
154
|
+
);
|
|
147
155
|
for (const client of clients) {
|
|
148
156
|
client.write("data: reload\n\n");
|
|
149
157
|
}
|
|
150
|
-
console.log(
|
|
158
|
+
console.log(
|
|
159
|
+
`[custom-viz] Asset changed: ${filename}, notified ${clients.size} client(s)`,
|
|
160
|
+
);
|
|
151
161
|
});
|
|
152
162
|
}
|
|
153
163
|
},
|
|
@@ -3,5 +3,5 @@ export declare const dateTimeRelativeUnits: readonly ["minute-of-hour", "hour-of
|
|
|
3
3
|
export declare const dateTimeUnits: readonly ["minute", "hour", "day", "week", "month", "quarter", "year", "minute-of-hour", "hour-of-day", "day-of-week", "day-of-month", "day-of-year", "week-of-year", "month-of-year", "quarter-of-year"];
|
|
4
4
|
export type DateTimeAbsoluteUnit = (typeof dateTimeAbsoluteUnits)[number];
|
|
5
5
|
export type DateTimeRelativeUnit = (typeof dateTimeRelativeUnits)[number];
|
|
6
|
-
export type DateTimeUnit =
|
|
6
|
+
export type DateTimeUnit = "default" | DateTimeAbsoluteUnit | DateTimeRelativeUnit;
|
|
7
7
|
//# sourceMappingURL=date-time.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time.d.ts","sourceRoot":"","sources":["../../src/types/date-time.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,wEAQxB,CAAC;AAEX,eAAO,MAAM,qBAAqB,8IASxB,CAAC;AAEX,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"date-time.d.ts","sourceRoot":"","sources":["../../src/types/date-time.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,wEAQxB,CAAC;AAEX,eAAO,MAAM,qBAAqB,8IASxB,CAAC;AAEX,eAAO,MAAM,aAAa,2MAGhB,CAAC;AAEX,MAAM,MAAM,oBA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AAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC"}
|
package/dist/types/viz.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { Column,
|
|
2
|
+
import { Column, RowValue, Series } from './data';
|
|
3
3
|
import { TextHeightMeasurer, TextWidthMeasurer } from './measure-text';
|
|
4
4
|
/**
|
|
5
5
|
* Export this function to define a custom visualization.
|
|
@@ -10,10 +10,6 @@ export type CreateCustomVisualizationProps = {
|
|
|
10
10
|
* Current user's locale (e.g., "de", "ja", "en").
|
|
11
11
|
*/
|
|
12
12
|
locale: string;
|
|
13
|
-
/**
|
|
14
|
-
* Translates text using ttag function used in Metabase.
|
|
15
|
-
*/
|
|
16
|
-
translate: (text: string) => string;
|
|
17
13
|
/**
|
|
18
14
|
* Returns a URL for a static asset declared in the plugin manifest.
|
|
19
15
|
* Use this to reference images and other static files from your plugin.
|
|
@@ -54,11 +50,6 @@ export type CustomVisualization<CustomVisualizationSettings> = {
|
|
|
54
50
|
* Visualization settings definitions.
|
|
55
51
|
*/
|
|
56
52
|
settings?: Record<keyof CustomVisualizationSettings, CustomVisualizationSettingDefinition<CustomVisualizationSettings>>;
|
|
57
|
-
/**
|
|
58
|
-
* This function should return true if the data shape makes sense for this visualization.
|
|
59
|
-
* TODO: should it get series: Series instead?
|
|
60
|
-
*/
|
|
61
|
-
isSensible: (data: DatasetData) => boolean;
|
|
62
53
|
/**
|
|
63
54
|
* This function should throw if the visualization cannot be rendered with given data and settings.
|
|
64
55
|
*/
|
|
@@ -89,8 +80,8 @@ export type VisualizationGridSize = {
|
|
|
89
80
|
height: number;
|
|
90
81
|
};
|
|
91
82
|
export type CustomVisualizationProps<CustomVisualizationSettings> = {
|
|
92
|
-
width: number;
|
|
93
|
-
height: number;
|
|
83
|
+
width: number | null;
|
|
84
|
+
height: number | null;
|
|
94
85
|
series: Series;
|
|
95
86
|
settings: CustomVisualizationSettings;
|
|
96
87
|
onVisualizationClick: (clickObject: ClickObject<CustomVisualizationSettings> | null) => void;
|
package/dist/types/viz.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viz.d.ts","sourceRoot":"","sources":["../../src/types/viz.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"viz.d.ts","sourceRoot":"","sources":["../../src/types/viz.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,yBAAyB,CAAC,2BAA2B,IAAI,CACnE,KAAK,EAAE,8BAA8B,KAClC,mBAAmB,CAAC,2BAA2B,CAAC,CAAC;AAEtD,MAAM,MAAM,8BAA8B,GAAG;IAC3C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5C,CAAC;AAEF,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,MAAM,CAAC;AAErD,MAAM,MAAM,oCAAoC,CAAC,4BAA4B,IAC3E;IACE,QAAQ,CAAC,CAAC,uBAAuB,CAAC,EAAE,KAAK,CAAC;CAC3C,CAAC;AAEJ,MAAM,MAAM,mBAAmB,CAAC,2BAA2B,IAAI;IAC7D;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,IAAI,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,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AAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CustomVisualizationSettingDefinition, Series, WidgetName, Widgets } from '../types';
|
|
2
|
-
type PropsFromWidget<W> = W extends WidgetName ? Widgets[W] : W extends (props: infer P) => any ? P : never;
|
|
3
|
-
export declare function defineSetting<CustomVisualizationSettings extends Record<string, unknown>, TValue, W extends WidgetName | ((props: any) => any)>(settingDefinition: {
|
|
4
|
-
id: string;
|
|
5
|
-
section?: string;
|
|
6
|
-
title?: string;
|
|
7
|
-
group?: string;
|
|
8
|
-
index?: number;
|
|
9
|
-
inline?: boolean;
|
|
10
|
-
persistDefault?: boolean;
|
|
11
|
-
set?: boolean;
|
|
12
|
-
readDependencies?: string[];
|
|
13
|
-
writeDependencies?: string[];
|
|
14
|
-
eraseDependencies?: string[];
|
|
15
|
-
widget: W;
|
|
16
|
-
isValid?: (series: Series, settings: CustomVisualizationSettings) => boolean;
|
|
17
|
-
getDefault?: (series: Series, settings: CustomVisualizationSettings) => TValue;
|
|
18
|
-
getProps(object: Series, vizSettings: CustomVisualizationSettings): PropsFromWidget<W>;
|
|
19
|
-
getValue?: (series: Series, settings: CustomVisualizationSettings) => TValue;
|
|
20
|
-
}): CustomVisualizationSettingDefinition<CustomVisualizationSettings>;
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=defineSetting.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defineSetting.d.ts","sourceRoot":"","sources":["../../src/lib/defineSetting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oCAAoC,EACpC,MAAM,EACN,UAAU,EACV,OAAO,EACR,MAAM,UAAU,CAAC;AAElB,KAAK,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,GAC1C,OAAO,CAAC,CAAC,CAAC,GACV,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAG,GAC/B,CAAC,GACD,KAAK,CAAC;AAEZ,wBAAgB,aAAa,CAC3B,2BAA2B,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,MAAM,EACN,CAAC,SAAS,UAAU,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC,EAC5C,iBAAiB,EAAE;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE7B,MAAM,EAAE,CAAC,CAAC;IAEV,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,2BAA2B,KAAK,OAAO,CAAC;IAC7E,UAAU,CAAC,EAAE,CACX,MAAM,EAAE,MAAM,EACd,QAAQ,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