matterviz 0.3.4 → 0.3.6
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/.vscode/launch.json +13 -0
- package/.vscodeignore +7 -0
- package/dist/assets/STLExporter-BpTH3YHE.js +8 -0
- package/dist/assets/browser-DdDecX_W.js +1 -0
- package/dist/assets/export-qgn-H9y6.js +2 -0
- package/dist/assets/main-DiKYzti2.css +1 -0
- package/dist/assets/moyo_wasm_bg-0ocwg7xY.wasm +0 -0
- package/dist/extension.js +31293 -0
- package/dist/src/lib/FilePicker.svelte +360 -0
- package/dist/src/lib/MillerIndexInput.svelte +66 -0
- package/dist/src/lib/api/mp.ts +26 -0
- package/dist/src/lib/api/optimade.ts +204 -0
- package/dist/src/lib/app.css +247 -0
- package/dist/src/lib/brillouin/BrillouinZone.svelte +549 -0
- package/dist/src/lib/brillouin/BrillouinZoneControls.svelte +144 -0
- package/dist/src/lib/brillouin/BrillouinZoneExportPane.svelte +146 -0
- package/dist/src/lib/brillouin/BrillouinZoneInfoPane.svelte +146 -0
- package/dist/src/lib/brillouin/BrillouinZoneScene.svelte +476 -0
- package/dist/src/lib/brillouin/BrillouinZoneTooltip.svelte +92 -0
- package/dist/src/lib/brillouin/compute.ts +529 -0
- package/dist/src/lib/brillouin/index.ts +8 -0
- package/dist/src/lib/brillouin/types.ts +51 -0
- package/dist/src/lib/chempot-diagram/ChemPotDiagram.svelte +327 -0
- package/dist/src/lib/chempot-diagram/ChemPotDiagram2D.svelte +846 -0
- package/dist/src/lib/chempot-diagram/ChemPotDiagram3D.svelte +3193 -0
- package/dist/src/lib/chempot-diagram/async-compute.svelte.ts +94 -0
- package/dist/src/lib/chempot-diagram/chempot-worker.ts +11 -0
- package/dist/src/lib/chempot-diagram/color.ts +42 -0
- package/dist/src/lib/chempot-diagram/compute.ts +1014 -0
- package/dist/src/lib/chempot-diagram/index.ts +6 -0
- package/dist/src/lib/chempot-diagram/pointer.ts +56 -0
- package/dist/src/lib/chempot-diagram/temperature.ts +77 -0
- package/dist/src/lib/chempot-diagram/types.ts +130 -0
- package/dist/src/lib/colors/index.ts +249 -0
- package/dist/src/lib/composition/BarChart.svelte +297 -0
- package/dist/src/lib/composition/BubbleChart.svelte +218 -0
- package/dist/src/lib/composition/Composition.svelte +165 -0
- package/dist/src/lib/composition/Formula.svelte +268 -0
- package/dist/src/lib/composition/FormulaFilter.svelte +1257 -0
- package/dist/src/lib/composition/PieChart.svelte +323 -0
- package/dist/src/lib/composition/format.ts +155 -0
- package/dist/src/lib/composition/index.ts +37 -0
- package/dist/src/lib/composition/parse.ts +605 -0
- package/dist/src/lib/constants.ts +134 -0
- package/dist/src/lib/controls.ts +42 -0
- package/dist/src/lib/convex-hull/ConvexHull.svelte +157 -0
- package/dist/src/lib/convex-hull/ConvexHull2D.svelte +825 -0
- package/dist/src/lib/convex-hull/ConvexHull3D.svelte +1801 -0
- package/dist/src/lib/convex-hull/ConvexHull4D.svelte +1398 -0
- package/dist/src/lib/convex-hull/ConvexHullControls.svelte +535 -0
- package/dist/src/lib/convex-hull/ConvexHullInfoPane.svelte +125 -0
- package/dist/src/lib/convex-hull/ConvexHullStats.svelte +929 -0
- package/dist/src/lib/convex-hull/ConvexHullTooltip.svelte +131 -0
- package/dist/src/lib/convex-hull/GasPressureControls.svelte +247 -0
- package/dist/src/lib/convex-hull/StructurePopup.svelte +151 -0
- package/dist/src/lib/convex-hull/TemperatureSlider.svelte +140 -0
- package/dist/src/lib/convex-hull/barycentric-coords.ts +246 -0
- package/dist/src/lib/convex-hull/demo-temperature.ts +63 -0
- package/dist/src/lib/convex-hull/gas-thermodynamics.ts +405 -0
- package/dist/src/lib/convex-hull/helpers.ts +932 -0
- package/dist/src/lib/convex-hull/index.ts +202 -0
- package/dist/src/lib/convex-hull/thermodynamics.ts +2192 -0
- package/dist/src/lib/convex-hull/types.ts +267 -0
- package/dist/src/lib/coordination/CoordinationBarPlot.svelte +311 -0
- package/dist/src/lib/coordination/calc-coordination.ts +93 -0
- package/dist/src/lib/coordination/index.ts +9 -0
- package/dist/src/lib/effects.svelte.ts +48 -0
- package/dist/src/lib/element/BohrAtom.svelte +147 -0
- package/dist/src/lib/element/ElementHeading.svelte +26 -0
- package/dist/src/lib/element/ElementPhoto.svelte +57 -0
- package/dist/src/lib/element/ElementStats.svelte +80 -0
- package/dist/src/lib/element/ElementTile.svelte +484 -0
- package/dist/src/lib/element/data.json.gz.d.ts +4 -0
- package/dist/src/lib/element/data.ts +14 -0
- package/dist/src/lib/element/index.ts +8 -0
- package/dist/src/lib/element/types.ts +62 -0
- package/dist/src/lib/feedback/ClickFeedback.svelte +58 -0
- package/dist/src/lib/feedback/DragOverlay.svelte +42 -0
- package/dist/src/lib/feedback/index.ts +4 -0
- package/dist/src/lib/fermi-surface/FermiSlice.svelte +189 -0
- package/dist/src/lib/fermi-surface/FermiSurface.svelte +600 -0
- package/dist/src/lib/fermi-surface/FermiSurfaceControls.svelte +448 -0
- package/dist/src/lib/fermi-surface/FermiSurfaceScene.svelte +794 -0
- package/dist/src/lib/fermi-surface/FermiSurfaceTooltip.svelte +111 -0
- package/dist/src/lib/fermi-surface/compute.ts +728 -0
- package/dist/src/lib/fermi-surface/constants.ts +32 -0
- package/dist/src/lib/fermi-surface/export.ts +64 -0
- package/dist/src/lib/fermi-surface/index.ts +14 -0
- package/dist/src/lib/fermi-surface/marching-cubes.ts +3 -0
- package/dist/src/lib/fermi-surface/parse.ts +574 -0
- package/dist/src/lib/fermi-surface/symmetry.ts +56 -0
- package/dist/src/lib/fermi-surface/types.ts +159 -0
- package/dist/src/lib/heatmap-matrix/HeatmapMatrix.svelte +1545 -0
- package/dist/src/lib/heatmap-matrix/HeatmapMatrixControls.svelte +225 -0
- package/dist/src/lib/heatmap-matrix/index.ts +167 -0
- package/dist/src/lib/heatmap-matrix/shared.ts +7 -0
- package/dist/src/lib/icons.ts +650 -0
- package/dist/src/lib/index.ts +61 -0
- package/dist/src/lib/io/decompress.ts +92 -0
- package/dist/src/lib/io/export.ts +385 -0
- package/dist/src/lib/io/fetch.ts +46 -0
- package/dist/src/lib/io/file-drop.ts +51 -0
- package/dist/src/lib/io/index.ts +7 -0
- package/dist/src/lib/io/is-binary.ts +24 -0
- package/dist/src/lib/io/types.ts +8 -0
- package/dist/src/lib/io/url-drop.ts +141 -0
- package/dist/src/lib/isosurface/Isosurface.svelte +285 -0
- package/dist/src/lib/isosurface/IsosurfaceControls.svelte +277 -0
- package/dist/src/lib/isosurface/index.ts +7 -0
- package/dist/src/lib/isosurface/parse.ts +656 -0
- package/dist/src/lib/isosurface/slice.ts +175 -0
- package/dist/src/lib/isosurface/types.ts +309 -0
- package/dist/src/lib/labels.ts +320 -0
- package/dist/src/lib/layout/FullscreenToggle.svelte +50 -0
- package/dist/src/lib/layout/InfoCard.svelte +120 -0
- package/dist/src/lib/layout/InfoTag.svelte +185 -0
- package/dist/src/lib/layout/PropertyFilter.svelte +246 -0
- package/dist/src/lib/layout/SettingsSection.svelte +148 -0
- package/dist/src/lib/layout/SubpageGrid.svelte +82 -0
- package/dist/src/lib/layout/fullscreen.ts +65 -0
- package/dist/src/lib/layout/index.ts +11 -0
- package/dist/src/lib/layout/json-tree/JsonNode.svelte +548 -0
- package/dist/src/lib/layout/json-tree/JsonTree.svelte +1230 -0
- package/dist/src/lib/layout/json-tree/JsonValue.svelte +334 -0
- package/dist/src/lib/layout/json-tree/index.ts +3 -0
- package/dist/src/lib/layout/json-tree/types.ts +126 -0
- package/dist/src/lib/layout/json-tree/utils.ts +682 -0
- package/dist/src/lib/marching-cubes.ts +614 -0
- package/dist/src/lib/math.ts +1081 -0
- package/dist/src/lib/overlays/ContextMenu.svelte +162 -0
- package/dist/src/lib/overlays/CopyButton.svelte +45 -0
- package/dist/src/lib/overlays/DragControlTab.svelte +98 -0
- package/dist/src/lib/overlays/DraggablePane.svelte +487 -0
- package/dist/src/lib/overlays/InfoPaneCards.svelte +149 -0
- package/dist/src/lib/overlays/index.ts +3 -0
- package/dist/src/lib/periodic-table/PeriodicTable.svelte +469 -0
- package/dist/src/lib/periodic-table/PeriodicTableControls.svelte +557 -0
- package/dist/src/lib/periodic-table/PropertySelect.svelte +37 -0
- package/dist/src/lib/periodic-table/index.ts +12 -0
- package/dist/src/lib/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +1086 -0
- package/dist/src/lib/phase-diagram/PhaseDiagramControls.svelte +444 -0
- package/dist/src/lib/phase-diagram/PhaseDiagramEditorPane.svelte +126 -0
- package/dist/src/lib/phase-diagram/PhaseDiagramExportPane.svelte +184 -0
- package/dist/src/lib/phase-diagram/PhaseDiagramTooltip.svelte +391 -0
- package/dist/src/lib/phase-diagram/TdbInfoPanel.svelte +203 -0
- package/dist/src/lib/phase-diagram/build-diagram.ts +186 -0
- package/dist/src/lib/phase-diagram/colors.ts +58 -0
- package/dist/src/lib/phase-diagram/diagram-input.ts +40 -0
- package/dist/src/lib/phase-diagram/index.ts +13 -0
- package/dist/src/lib/phase-diagram/parse.ts +348 -0
- package/dist/src/lib/phase-diagram/svg-to-diagram.ts +1023 -0
- package/dist/src/lib/phase-diagram/types.ts +144 -0
- package/dist/src/lib/phase-diagram/utils.ts +775 -0
- package/dist/src/lib/plot/AxisLabel.svelte +51 -0
- package/dist/src/lib/plot/BarPlot.svelte +2113 -0
- package/dist/src/lib/plot/BarPlotControls.svelte +66 -0
- package/dist/src/lib/plot/BinnedScatterPlot.svelte +1114 -0
- package/dist/src/lib/plot/ColorBar.svelte +721 -0
- package/dist/src/lib/plot/ColorScaleSelect.svelte +54 -0
- package/dist/src/lib/plot/ElementScatter.svelte +63 -0
- package/dist/src/lib/plot/FillArea.svelte +223 -0
- package/dist/src/lib/plot/Histogram.svelte +1558 -0
- package/dist/src/lib/plot/HistogramControls.svelte +212 -0
- package/dist/src/lib/plot/InteractiveAxisLabel.svelte +96 -0
- package/dist/src/lib/plot/Line.svelte +84 -0
- package/dist/src/lib/plot/PlotAxis.svelte +169 -0
- package/dist/src/lib/plot/PlotControls.svelte +537 -0
- package/dist/src/lib/plot/PlotLegend.svelte +569 -0
- package/dist/src/lib/plot/PlotTooltip.svelte +67 -0
- package/dist/src/lib/plot/PortalSelect.svelte +253 -0
- package/dist/src/lib/plot/ReferenceLine3D.svelte +156 -0
- package/dist/src/lib/plot/ReferencePlane.svelte +175 -0
- package/dist/src/lib/plot/ScatterPlot.svelte +2778 -0
- package/dist/src/lib/plot/ScatterPlot3D.svelte +529 -0
- package/dist/src/lib/plot/ScatterPlot3DControls.svelte +437 -0
- package/dist/src/lib/plot/ScatterPlot3DScene.svelte +912 -0
- package/dist/src/lib/plot/ScatterPlotControls.svelte +306 -0
- package/dist/src/lib/plot/ScatterPoint.svelte +182 -0
- package/dist/src/lib/plot/SpacegroupBarPlot.svelte +293 -0
- package/dist/src/lib/plot/Surface3D.svelte +197 -0
- package/dist/src/lib/plot/ZeroLines.svelte +97 -0
- package/dist/src/lib/plot/ZoomRect.svelte +23 -0
- package/dist/src/lib/plot/adaptive-density.ts +316 -0
- package/dist/src/lib/plot/auto-place.ts +184 -0
- package/dist/src/lib/plot/axis-utils.ts +122 -0
- package/dist/src/lib/plot/binned-scatter-types.ts +83 -0
- package/dist/src/lib/plot/data-cleaning.ts +1069 -0
- package/dist/src/lib/plot/data-transform.ts +69 -0
- package/dist/src/lib/plot/defaults.ts +9 -0
- package/dist/src/lib/plot/fill-utils.ts +494 -0
- package/dist/src/lib/plot/hover-lock.svelte.ts +60 -0
- package/dist/src/lib/plot/index.ts +53 -0
- package/dist/src/lib/plot/interactions.ts +119 -0
- package/dist/src/lib/plot/layout.ts +425 -0
- package/dist/src/lib/plot/reference-line.ts +426 -0
- package/dist/src/lib/plot/scales.ts +654 -0
- package/dist/src/lib/plot/svg.ts +23 -0
- package/dist/src/lib/plot/types.ts +1144 -0
- package/dist/src/lib/plot/utils/label-placement.ts +541 -0
- package/dist/src/lib/plot/utils/series-visibility.ts +140 -0
- package/dist/src/lib/plot/utils.ts +11 -0
- package/dist/src/lib/rdf/RdfPlot.svelte +247 -0
- package/dist/src/lib/rdf/calc-rdf.ts +167 -0
- package/dist/src/lib/rdf/index.ts +27 -0
- package/dist/src/lib/sanitize.ts +126 -0
- package/dist/src/lib/settings.ts +1479 -0
- package/dist/src/lib/spectral/Bands.svelte +1040 -0
- package/dist/src/lib/spectral/BandsAndDos.svelte +134 -0
- package/dist/src/lib/spectral/BrillouinBandsDos.svelte +252 -0
- package/dist/src/lib/spectral/Dos.svelte +697 -0
- package/dist/src/lib/spectral/helpers.ts +1381 -0
- package/dist/src/lib/spectral/index.ts +8 -0
- package/dist/src/lib/spectral/types.ts +112 -0
- package/dist/src/lib/state.svelte.ts +64 -0
- package/dist/src/lib/structure/Arrow.svelte +72 -0
- package/dist/src/lib/structure/AtomLegend.svelte +815 -0
- package/dist/src/lib/structure/Bond.svelte +140 -0
- package/dist/src/lib/structure/CanvasTooltip.svelte +33 -0
- package/dist/src/lib/structure/CellSelect.svelte +349 -0
- package/dist/src/lib/structure/Cylinder.svelte +45 -0
- package/dist/src/lib/structure/Lattice.svelte +196 -0
- package/dist/src/lib/structure/Structure.svelte +2248 -0
- package/dist/src/lib/structure/StructureControls.svelte +1273 -0
- package/dist/src/lib/structure/StructureExportPane.svelte +252 -0
- package/dist/src/lib/structure/StructureInfoPane.svelte +737 -0
- package/dist/src/lib/structure/StructureScene.svelte +2255 -0
- package/dist/src/lib/structure/atom-properties.ts +316 -0
- package/dist/src/lib/structure/bond-order-perception.ts +447 -0
- package/dist/src/lib/structure/bonding.ts +944 -0
- package/dist/src/lib/structure/export.ts +861 -0
- package/dist/src/lib/structure/index.ts +291 -0
- package/dist/src/lib/structure/label-placement.ts +130 -0
- package/dist/src/lib/structure/measure.ts +45 -0
- package/dist/src/lib/structure/parse.ts +1705 -0
- package/dist/src/lib/structure/partial-occupancy.ts +183 -0
- package/dist/src/lib/structure/pbc.ts +164 -0
- package/dist/src/lib/structure/supercell.ts +226 -0
- package/dist/src/lib/structure/validation.ts +11 -0
- package/dist/src/lib/symmetry/SymmetryStats.svelte +226 -0
- package/dist/src/lib/symmetry/WyckoffTable.svelte +120 -0
- package/dist/src/lib/symmetry/cell-transform.ts +118 -0
- package/dist/src/lib/symmetry/index.ts +348 -0
- package/dist/src/lib/symmetry/spacegroups.ts +404 -0
- package/dist/src/lib/table/HeatmapTable.svelte +1833 -0
- package/dist/src/lib/table/ToggleMenu.svelte +385 -0
- package/dist/src/lib/table/index.ts +139 -0
- package/dist/src/lib/theme/ThemeControl.svelte +53 -0
- package/dist/src/lib/theme/index.ts +107 -0
- package/dist/src/lib/theme/themes.mjs +297 -0
- package/dist/src/lib/time.ts +71 -0
- package/dist/src/lib/tooltip/TooltipContent.svelte +58 -0
- package/dist/src/lib/tooltip/index.ts +2 -0
- package/dist/src/lib/tooltip/types.ts +13 -0
- package/dist/src/lib/trajectory/Trajectory.svelte +1545 -0
- package/dist/src/lib/trajectory/TrajectoryError.svelte +128 -0
- package/dist/src/lib/trajectory/TrajectoryExportPane.svelte +357 -0
- package/dist/src/lib/trajectory/TrajectoryInfoPane.svelte +313 -0
- package/dist/src/lib/trajectory/constants.ts +7 -0
- package/dist/src/lib/trajectory/extract.ts +196 -0
- package/dist/src/lib/trajectory/format-detect.ts +96 -0
- package/dist/src/lib/trajectory/frame-reader.ts +456 -0
- package/dist/src/lib/trajectory/helpers.ts +217 -0
- package/dist/src/lib/trajectory/index.ts +218 -0
- package/dist/src/lib/trajectory/parse/ase.ts +109 -0
- package/dist/src/lib/trajectory/parse/hdf5.ts +173 -0
- package/dist/src/lib/trajectory/parse/index.ts +411 -0
- package/dist/src/lib/trajectory/parse/lammps.ts +215 -0
- package/dist/src/lib/trajectory/parse/vasp.ts +102 -0
- package/dist/src/lib/trajectory/parse/xyz.ts +143 -0
- package/dist/src/lib/trajectory/plotting.ts +599 -0
- package/dist/src/lib/trajectory/types.ts +13 -0
- package/dist/src/lib/utils.ts +56 -0
- package/dist/src/lib/xrd/XrdPlot.svelte +615 -0
- package/dist/src/lib/xrd/broadening.ts +130 -0
- package/dist/src/lib/xrd/calc-xrd.ts +397 -0
- package/dist/src/lib/xrd/index.ts +38 -0
- package/dist/src/lib/xrd/parse.ts +858 -0
- package/dist/webview.js +29421 -0
- package/icon.png +0 -0
- package/license +1 -1
- package/matterviz-0.3.2.vsix +0 -0
- package/matterviz-0.3.4.vsix +0 -0
- package/matterviz-0.3.5.vsix +0 -0
- package/package.json +1461 -231
- package/readme.md +171 -98
- package/scripts/sync-config.ts +101 -0
- package/src/declarations.d.ts +2 -0
- package/src/extension.ts +972 -0
- package/src/node-io.ts +65 -0
- package/src/types.ts +17 -0
- package/src/webview/JsonBrowser.svelte +1079 -0
- package/src/webview/PlotPanel.svelte +346 -0
- package/src/webview/detect.ts +444 -0
- package/src/webview/main.ts +764 -0
- package/src/webview/plot-utils.ts +250 -0
- package/test-fixtures/all-viz-types.json.gz +0 -0
- package/test-fixtures/plot-demo-data.json.gz +0 -0
- package/tests/detect.test.ts +604 -0
- package/tests/extension.test.ts +2041 -0
- package/tests/node-io.test.ts +39 -0
- package/tests/plot-utils.test.ts +302 -0
- package/tests/vite-plugin-json-gz.test.ts +114 -0
- package/tests/vscode-mock.ts +18 -0
- package/tests/webview.test.ts +231 -0
- package/tsconfig.json +20 -0
- package/vite-plugin-json-gz.ts +29 -0
- package/vite.config.ts +34 -0
- package/vite.extension.config.ts +34 -0
- package/dist/EmptyState.svelte.d.ts +0 -9
- package/dist/FilePicker.svelte +0 -360
- package/dist/FilePicker.svelte.d.ts +0 -17
- package/dist/Icon.svelte.d.ts +0 -13
- package/dist/MillerIndexInput.svelte +0 -66
- package/dist/MillerIndexInput.svelte.d.ts +0 -7
- package/dist/api/mp.d.ts +0 -6
- package/dist/api/mp.js +0 -22
- package/dist/api/optimade.d.ts +0 -45
- package/dist/api/optimade.js +0 -135
- package/dist/app.css +0 -240
- package/dist/brillouin/BrillouinZone.svelte +0 -543
- package/dist/brillouin/BrillouinZone.svelte.d.ts +0 -83
- package/dist/brillouin/BrillouinZoneControls.svelte +0 -144
- package/dist/brillouin/BrillouinZoneControls.svelte.d.ts +0 -17
- package/dist/brillouin/BrillouinZoneExportPane.svelte +0 -148
- package/dist/brillouin/BrillouinZoneExportPane.svelte.d.ts +0 -15
- package/dist/brillouin/BrillouinZoneInfoPane.svelte +0 -146
- package/dist/brillouin/BrillouinZoneInfoPane.svelte.d.ts +0 -13
- package/dist/brillouin/BrillouinZoneScene.svelte +0 -476
- package/dist/brillouin/BrillouinZoneScene.svelte.d.ts +0 -48
- package/dist/brillouin/BrillouinZoneTooltip.svelte +0 -92
- package/dist/brillouin/BrillouinZoneTooltip.svelte.d.ts +0 -8
- package/dist/brillouin/compute.d.ts +0 -17
- package/dist/brillouin/compute.js +0 -422
- package/dist/brillouin/index.d.ts +0 -8
- package/dist/brillouin/index.js +0 -8
- package/dist/brillouin/types.d.ts +0 -48
- package/dist/brillouin/types.js +0 -1
- package/dist/chempot-diagram/ChemPotDiagram.svelte +0 -327
- package/dist/chempot-diagram/ChemPotDiagram.svelte.d.ts +0 -13
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte +0 -847
- package/dist/chempot-diagram/ChemPotDiagram2D.svelte.d.ts +0 -16
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte +0 -3194
- package/dist/chempot-diagram/ChemPotDiagram3D.svelte.d.ts +0 -16
- package/dist/chempot-diagram/ChemPotScene3D.svelte.d.ts +0 -7
- package/dist/chempot-diagram/async-compute.svelte.d.ts +0 -3
- package/dist/chempot-diagram/async-compute.svelte.js +0 -77
- package/dist/chempot-diagram/chempot-worker.d.ts +0 -1
- package/dist/chempot-diagram/chempot-worker.js +0 -11
- package/dist/chempot-diagram/color.d.ts +0 -10
- package/dist/chempot-diagram/color.js +0 -32
- package/dist/chempot-diagram/compute.d.ts +0 -48
- package/dist/chempot-diagram/compute.js +0 -812
- package/dist/chempot-diagram/index.d.ts +0 -6
- package/dist/chempot-diagram/index.js +0 -6
- package/dist/chempot-diagram/pointer.d.ts +0 -16
- package/dist/chempot-diagram/pointer.js +0 -40
- package/dist/chempot-diagram/temperature.d.ts +0 -15
- package/dist/chempot-diagram/temperature.js +0 -36
- package/dist/chempot-diagram/types.d.ts +0 -86
- package/dist/chempot-diagram/types.js +0 -28
- package/dist/colors/index.d.ts +0 -47
- package/dist/colors/index.js +0 -203
- package/dist/composition/BarChart.svelte +0 -297
- package/dist/composition/BarChart.svelte.d.ts +0 -39
- package/dist/composition/BubbleChart.svelte +0 -218
- package/dist/composition/BubbleChart.svelte.d.ts +0 -28
- package/dist/composition/Composition.svelte +0 -164
- package/dist/composition/Composition.svelte.d.ts +0 -15
- package/dist/composition/Formula.svelte +0 -265
- package/dist/composition/Formula.svelte.d.ts +0 -19
- package/dist/composition/FormulaFilter.svelte +0 -1259
- package/dist/composition/FormulaFilter.svelte.d.ts +0 -51
- package/dist/composition/PieChart.svelte +0 -323
- package/dist/composition/PieChart.svelte.d.ts +0 -37
- package/dist/composition/format.d.ts +0 -15
- package/dist/composition/format.js +0 -109
- package/dist/composition/index.d.ts +0 -20
- package/dist/composition/index.js +0 -14
- package/dist/composition/parse.d.ts +0 -55
- package/dist/composition/parse.js +0 -459
- package/dist/constants.d.ts +0 -29
- package/dist/constants.js +0 -105
- package/dist/controls.d.ts +0 -14
- package/dist/controls.js +0 -30
- package/dist/convex-hull/ConvexHull.svelte +0 -157
- package/dist/convex-hull/ConvexHull.svelte.d.ts +0 -13
- package/dist/convex-hull/ConvexHull2D.svelte +0 -813
- package/dist/convex-hull/ConvexHull2D.svelte.d.ts +0 -11
- package/dist/convex-hull/ConvexHull3D.svelte +0 -1788
- package/dist/convex-hull/ConvexHull3D.svelte.d.ts +0 -8
- package/dist/convex-hull/ConvexHull4D.svelte +0 -1374
- package/dist/convex-hull/ConvexHull4D.svelte.d.ts +0 -8
- package/dist/convex-hull/ConvexHullControls.svelte +0 -546
- package/dist/convex-hull/ConvexHullControls.svelte.d.ts +0 -48
- package/dist/convex-hull/ConvexHullInfoPane.svelte +0 -115
- package/dist/convex-hull/ConvexHullInfoPane.svelte.d.ts +0 -18
- package/dist/convex-hull/ConvexHullStats.svelte +0 -905
- package/dist/convex-hull/ConvexHullStats.svelte.d.ts +0 -15
- package/dist/convex-hull/ConvexHullTooltip.svelte +0 -131
- package/dist/convex-hull/ConvexHullTooltip.svelte.d.ts +0 -33
- package/dist/convex-hull/GasPressureControls.svelte +0 -247
- package/dist/convex-hull/GasPressureControls.svelte.d.ts +0 -11
- package/dist/convex-hull/StructurePopup.svelte +0 -116
- package/dist/convex-hull/StructurePopup.svelte.d.ts +0 -18
- package/dist/convex-hull/TemperatureSlider.svelte +0 -137
- package/dist/convex-hull/TemperatureSlider.svelte.d.ts +0 -8
- package/dist/convex-hull/barycentric-coords.d.ts +0 -18
- package/dist/convex-hull/barycentric-coords.js +0 -182
- package/dist/convex-hull/demo-temperature.d.ts +0 -6
- package/dist/convex-hull/demo-temperature.js +0 -40
- package/dist/convex-hull/gas-thermodynamics.d.ts +0 -16
- package/dist/convex-hull/gas-thermodynamics.js +0 -316
- package/dist/convex-hull/helpers.d.ts +0 -103
- package/dist/convex-hull/helpers.js +0 -671
- package/dist/convex-hull/index.d.ts +0 -118
- package/dist/convex-hull/index.js +0 -57
- package/dist/convex-hull/thermodynamics.d.ts +0 -66
- package/dist/convex-hull/thermodynamics.js +0 -1752
- package/dist/convex-hull/types.d.ts +0 -162
- package/dist/convex-hull/types.js +0 -36
- package/dist/coordination/CoordinationBarPlot.svelte +0 -311
- package/dist/coordination/CoordinationBarPlot.svelte.d.ts +0 -30
- package/dist/coordination/calc-coordination.d.ts +0 -15
- package/dist/coordination/calc-coordination.js +0 -63
- package/dist/coordination/index.d.ts +0 -8
- package/dist/coordination/index.js +0 -7
- package/dist/element/BohrAtom.svelte +0 -149
- package/dist/element/BohrAtom.svelte.d.ts +0 -20
- package/dist/element/ElementHeading.svelte +0 -26
- package/dist/element/ElementHeading.svelte.d.ts +0 -8
- package/dist/element/ElementPhoto.svelte +0 -57
- package/dist/element/ElementPhoto.svelte.d.ts +0 -9
- package/dist/element/ElementStats.svelte +0 -80
- package/dist/element/ElementStats.svelte.d.ts +0 -8
- package/dist/element/ElementTile.svelte +0 -484
- package/dist/element/ElementTile.svelte.d.ts +0 -29
- package/dist/element/Nucleus.svelte.d.ts +0 -17
- package/dist/element/data.d.ts +0 -3
- package/dist/element/data.js +0 -2
- package/dist/element/data.json.gz.d.ts +0 -2
- package/dist/element/index.d.ts +0 -8
- package/dist/element/index.js +0 -8
- package/dist/element/types.d.ts +0 -57
- package/dist/element/types.js +0 -1
- package/dist/feedback/ClickFeedback.svelte +0 -58
- package/dist/feedback/ClickFeedback.svelte.d.ts +0 -12
- package/dist/feedback/DragOverlay.svelte +0 -42
- package/dist/feedback/DragOverlay.svelte.d.ts +0 -7
- package/dist/feedback/Spinner.svelte.d.ts +0 -7
- package/dist/feedback/StatusMessage.svelte.d.ts +0 -9
- package/dist/feedback/index.d.ts +0 -4
- package/dist/feedback/index.js +0 -4
- package/dist/fermi-surface/FermiSlice.svelte +0 -189
- package/dist/fermi-surface/FermiSlice.svelte.d.ts +0 -24
- package/dist/fermi-surface/FermiSurface.svelte +0 -597
- package/dist/fermi-surface/FermiSurface.svelte.d.ts +0 -83
- package/dist/fermi-surface/FermiSurfaceControls.svelte +0 -452
- package/dist/fermi-surface/FermiSurfaceControls.svelte.d.ts +0 -35
- package/dist/fermi-surface/FermiSurfaceScene.svelte +0 -792
- package/dist/fermi-surface/FermiSurfaceScene.svelte.d.ts +0 -50
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte +0 -111
- package/dist/fermi-surface/FermiSurfaceTooltip.svelte.d.ts +0 -8
- package/dist/fermi-surface/compute.d.ts +0 -5
- package/dist/fermi-surface/compute.js +0 -538
- package/dist/fermi-surface/constants.d.ts +0 -9
- package/dist/fermi-surface/constants.js +0 -27
- package/dist/fermi-surface/export.d.ts +0 -5
- package/dist/fermi-surface/export.js +0 -63
- package/dist/fermi-surface/index.d.ts +0 -12
- package/dist/fermi-surface/index.js +0 -13
- package/dist/fermi-surface/marching-cubes.d.ts +0 -2
- package/dist/fermi-surface/marching-cubes.js +0 -2
- package/dist/fermi-surface/parse.d.ts +0 -2
- package/dist/fermi-surface/parse.js +0 -495
- package/dist/fermi-surface/symmetry.d.ts +0 -3
- package/dist/fermi-surface/symmetry.js +0 -46
- package/dist/fermi-surface/types.d.ts +0 -113
- package/dist/fermi-surface/types.js +0 -4
- package/dist/heatmap-matrix/HeatmapMatrix.svelte +0 -1527
- package/dist/heatmap-matrix/HeatmapMatrix.svelte.d.ts +0 -110
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte +0 -225
- package/dist/heatmap-matrix/HeatmapMatrixControls.svelte.d.ts +0 -30
- package/dist/heatmap-matrix/index.d.ts +0 -53
- package/dist/heatmap-matrix/index.js +0 -100
- package/dist/heatmap-matrix/shared.d.ts +0 -2
- package/dist/heatmap-matrix/shared.js +0 -4
- package/dist/icons.d.ts +0 -569
- package/dist/icons.js +0 -648
- package/dist/index.d.ts +0 -39
- package/dist/index.js +0 -39
- package/dist/io/decompress.d.ts +0 -10
- package/dist/io/decompress.js +0 -69
- package/dist/io/export.d.ts +0 -16
- package/dist/io/export.js +0 -312
- package/dist/io/fetch.d.ts +0 -5
- package/dist/io/fetch.js +0 -39
- package/dist/io/file-drop.d.ts +0 -7
- package/dist/io/file-drop.js +0 -43
- package/dist/io/index.d.ts +0 -7
- package/dist/io/index.js +0 -7
- package/dist/io/is-binary.d.ts +0 -1
- package/dist/io/is-binary.js +0 -5
- package/dist/io/types.d.ts +0 -8
- package/dist/io/types.js +0 -1
- package/dist/io/url-drop.d.ts +0 -2
- package/dist/io/url-drop.js +0 -117
- package/dist/isosurface/Isosurface.svelte +0 -285
- package/dist/isosurface/Isosurface.svelte.d.ts +0 -8
- package/dist/isosurface/IsosurfaceControls.svelte +0 -291
- package/dist/isosurface/IsosurfaceControls.svelte.d.ts +0 -9
- package/dist/isosurface/index.d.ts +0 -5
- package/dist/isosurface/index.js +0 -6
- package/dist/isosurface/parse.d.ts +0 -6
- package/dist/isosurface/parse.js +0 -553
- package/dist/isosurface/slice.d.ts +0 -11
- package/dist/isosurface/slice.js +0 -140
- package/dist/isosurface/types.d.ts +0 -56
- package/dist/isosurface/types.js +0 -227
- package/dist/labels.d.ts +0 -53
- package/dist/labels.js +0 -274
- package/dist/layout/FullscreenToggle.svelte +0 -50
- package/dist/layout/FullscreenToggle.svelte.d.ts +0 -7
- package/dist/layout/InfoCard.svelte +0 -120
- package/dist/layout/InfoCard.svelte.d.ts +0 -21
- package/dist/layout/InfoTag.svelte +0 -183
- package/dist/layout/InfoTag.svelte.d.ts +0 -19
- package/dist/layout/PropertyFilter.svelte +0 -244
- package/dist/layout/PropertyFilter.svelte.d.ts +0 -24
- package/dist/layout/SettingsSection.svelte +0 -148
- package/dist/layout/SettingsSection.svelte.d.ts +0 -17
- package/dist/layout/SubpageGrid.svelte +0 -82
- package/dist/layout/SubpageGrid.svelte.d.ts +0 -14
- package/dist/layout/fullscreen.d.ts +0 -9
- package/dist/layout/fullscreen.js +0 -53
- package/dist/layout/index.d.ts +0 -10
- package/dist/layout/index.js +0 -8
- package/dist/layout/json-tree/JsonNode.svelte +0 -547
- package/dist/layout/json-tree/JsonNode.svelte.d.ts +0 -11
- package/dist/layout/json-tree/JsonTree.svelte +0 -1222
- package/dist/layout/json-tree/JsonTree.svelte.d.ts +0 -6
- package/dist/layout/json-tree/JsonValue.svelte +0 -334
- package/dist/layout/json-tree/JsonValue.svelte.d.ts +0 -9
- package/dist/layout/json-tree/index.d.ts +0 -3
- package/dist/layout/json-tree/index.js +0 -3
- package/dist/layout/json-tree/types.d.ts +0 -73
- package/dist/layout/json-tree/types.js +0 -3
- package/dist/layout/json-tree/utils.d.ts +0 -29
- package/dist/layout/json-tree/utils.js +0 -648
- package/dist/marching-cubes.d.ts +0 -14
- package/dist/marching-cubes.js +0 -542
- package/dist/math.d.ts +0 -91
- package/dist/math.js +0 -896
- package/dist/overlays/ContextMenu.svelte +0 -162
- package/dist/overlays/ContextMenu.svelte.d.ts +0 -25
- package/dist/overlays/DraggablePane.svelte +0 -564
- package/dist/overlays/DraggablePane.svelte.d.ts +0 -36
- package/dist/overlays/index.d.ts +0 -2
- package/dist/overlays/index.js +0 -2
- package/dist/periodic-table/PeriodicTable.svelte +0 -469
- package/dist/periodic-table/PeriodicTable.svelte.d.ts +0 -55
- package/dist/periodic-table/PeriodicTableControls.svelte +0 -557
- package/dist/periodic-table/PeriodicTableControls.svelte.d.ts +0 -24
- package/dist/periodic-table/PropertySelect.svelte +0 -37
- package/dist/periodic-table/PropertySelect.svelte.d.ts +0 -13
- package/dist/periodic-table/TableInset.svelte.d.ts +0 -9
- package/dist/periodic-table/index.d.ts +0 -10
- package/dist/periodic-table/index.js +0 -4
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte +0 -1086
- package/dist/phase-diagram/IsobaricBinaryPhaseDiagram.svelte.d.ts +0 -44
- package/dist/phase-diagram/PhaseDiagramControls.svelte +0 -451
- package/dist/phase-diagram/PhaseDiagramControls.svelte.d.ts +0 -30
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte +0 -126
- package/dist/phase-diagram/PhaseDiagramEditorPane.svelte.d.ts +0 -15
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte +0 -192
- package/dist/phase-diagram/PhaseDiagramExportPane.svelte.d.ts +0 -19
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte +0 -392
- package/dist/phase-diagram/PhaseDiagramTooltip.svelte.d.ts +0 -16
- package/dist/phase-diagram/TdbInfoPanel.svelte +0 -203
- package/dist/phase-diagram/TdbInfoPanel.svelte.d.ts +0 -12
- package/dist/phase-diagram/build-diagram.d.ts +0 -11
- package/dist/phase-diagram/build-diagram.js +0 -167
- package/dist/phase-diagram/colors.d.ts +0 -35
- package/dist/phase-diagram/colors.js +0 -51
- package/dist/phase-diagram/diagram-input.d.ts +0 -33
- package/dist/phase-diagram/diagram-input.js +0 -3
- package/dist/phase-diagram/index.d.ts +0 -13
- package/dist/phase-diagram/index.js +0 -13
- package/dist/phase-diagram/parse.d.ts +0 -55
- package/dist/phase-diagram/parse.js +0 -276
- package/dist/phase-diagram/svg-to-diagram.d.ts +0 -2
- package/dist/phase-diagram/svg-to-diagram.js +0 -869
- package/dist/phase-diagram/types.d.ts +0 -99
- package/dist/phase-diagram/types.js +0 -1
- package/dist/phase-diagram/utils.d.ts +0 -118
- package/dist/phase-diagram/utils.js +0 -606
- package/dist/plot/AxisLabel.svelte +0 -51
- package/dist/plot/AxisLabel.svelte.d.ts +0 -16
- package/dist/plot/BarPlot.svelte +0 -2256
- package/dist/plot/BarPlot.svelte.d.ts +0 -82
- package/dist/plot/BarPlotControls.svelte +0 -66
- package/dist/plot/BarPlotControls.svelte.d.ts +0 -18
- package/dist/plot/ColorBar.svelte +0 -719
- package/dist/plot/ColorBar.svelte.d.ts +0 -31
- package/dist/plot/ColorScaleSelect.svelte +0 -54
- package/dist/plot/ColorScaleSelect.svelte.d.ts +0 -15
- package/dist/plot/ElementScatter.svelte +0 -63
- package/dist/plot/ElementScatter.svelte.d.ts +0 -14
- package/dist/plot/FillArea.svelte +0 -226
- package/dist/plot/FillArea.svelte.d.ts +0 -20
- package/dist/plot/Histogram.svelte +0 -1654
- package/dist/plot/Histogram.svelte.d.ts +0 -50
- package/dist/plot/HistogramControls.svelte +0 -212
- package/dist/plot/HistogramControls.svelte.d.ts +0 -22
- package/dist/plot/InteractiveAxisLabel.svelte +0 -94
- package/dist/plot/InteractiveAxisLabel.svelte.d.ts +0 -14
- package/dist/plot/Line.svelte +0 -85
- package/dist/plot/Line.svelte.d.ts +0 -15
- package/dist/plot/PlotControls.svelte +0 -537
- package/dist/plot/PlotControls.svelte.d.ts +0 -4
- package/dist/plot/PlotLegend.svelte +0 -498
- package/dist/plot/PlotLegend.svelte.d.ts +0 -25
- package/dist/plot/PlotTooltip.svelte +0 -67
- package/dist/plot/PlotTooltip.svelte.d.ts +0 -17
- package/dist/plot/PortalSelect.svelte +0 -253
- package/dist/plot/PortalSelect.svelte.d.ts +0 -16
- package/dist/plot/ReferenceLine.svelte.d.ts +0 -20
- package/dist/plot/ReferenceLine3D.svelte +0 -154
- package/dist/plot/ReferenceLine3D.svelte.d.ts +0 -14
- package/dist/plot/ReferencePlane.svelte +0 -178
- package/dist/plot/ReferencePlane.svelte.d.ts +0 -14
- package/dist/plot/ScatterPlot.svelte +0 -2831
- package/dist/plot/ScatterPlot.svelte.d.ts +0 -92
- package/dist/plot/ScatterPlot3D.svelte +0 -499
- package/dist/plot/ScatterPlot3D.svelte.d.ts +0 -94
- package/dist/plot/ScatterPlot3DControls.svelte +0 -437
- package/dist/plot/ScatterPlot3DControls.svelte.d.ts +0 -20
- package/dist/plot/ScatterPlot3DScene.svelte +0 -912
- package/dist/plot/ScatterPlot3DScene.svelte.d.ts +0 -74
- package/dist/plot/ScatterPlotControls.svelte +0 -307
- package/dist/plot/ScatterPlotControls.svelte.d.ts +0 -17
- package/dist/plot/ScatterPoint.svelte +0 -185
- package/dist/plot/ScatterPoint.svelte.d.ts +0 -19
- package/dist/plot/SpacegroupBarPlot.svelte +0 -292
- package/dist/plot/SpacegroupBarPlot.svelte.d.ts +0 -9
- package/dist/plot/Surface3D.svelte +0 -200
- package/dist/plot/Surface3D.svelte.d.ts +0 -13
- package/dist/plot/ZeroLines.svelte +0 -96
- package/dist/plot/ZeroLines.svelte.d.ts +0 -32
- package/dist/plot/ZoomRect.svelte +0 -23
- package/dist/plot/ZoomRect.svelte.d.ts +0 -8
- package/dist/plot/axis-utils.d.ts +0 -19
- package/dist/plot/axis-utils.js +0 -80
- package/dist/plot/data-cleaning.d.ts +0 -37
- package/dist/plot/data-cleaning.js +0 -855
- package/dist/plot/data-transform.d.ts +0 -16
- package/dist/plot/data-transform.js +0 -45
- package/dist/plot/defaults.d.ts +0 -19
- package/dist/plot/defaults.js +0 -9
- package/dist/plot/fill-utils.d.ts +0 -51
- package/dist/plot/fill-utils.js +0 -337
- package/dist/plot/hover-lock.svelte.d.ts +0 -14
- package/dist/plot/hover-lock.svelte.js +0 -46
- package/dist/plot/index.d.ts +0 -43
- package/dist/plot/index.js +0 -37
- package/dist/plot/interactions.d.ts +0 -12
- package/dist/plot/interactions.js +0 -100
- package/dist/plot/layout.d.ts +0 -60
- package/dist/plot/layout.js +0 -230
- package/dist/plot/reference-line.d.ts +0 -60
- package/dist/plot/reference-line.js +0 -316
- package/dist/plot/scales.d.ts +0 -48
- package/dist/plot/scales.js +0 -484
- package/dist/plot/svg.d.ts +0 -1
- package/dist/plot/svg.js +0 -11
- package/dist/plot/types.d.ts +0 -863
- package/dist/plot/types.js +0 -103
- package/dist/plot/utils/label-placement.d.ts +0 -47
- package/dist/plot/utils/label-placement.js +0 -256
- package/dist/plot/utils/series-visibility.d.ts +0 -9
- package/dist/plot/utils/series-visibility.js +0 -67
- package/dist/plot/utils.d.ts +0 -1
- package/dist/plot/utils.js +0 -14
- package/dist/rdf/RdfPlot.svelte +0 -247
- package/dist/rdf/RdfPlot.svelte.d.ts +0 -27
- package/dist/rdf/calc-rdf.d.ts +0 -4
- package/dist/rdf/calc-rdf.js +0 -111
- package/dist/rdf/index.d.ts +0 -23
- package/dist/rdf/index.js +0 -2
- package/dist/sanitize.d.ts +0 -4
- package/dist/sanitize.js +0 -107
- package/dist/settings.d.ts +0 -253
- package/dist/settings.js +0 -1123
- package/dist/spectral/Bands.svelte +0 -1040
- package/dist/spectral/Bands.svelte.d.ts +0 -40
- package/dist/spectral/BandsAndDos.svelte +0 -128
- package/dist/spectral/BandsAndDos.svelte.d.ts +0 -18
- package/dist/spectral/BrillouinBandsDos.svelte +0 -248
- package/dist/spectral/BrillouinBandsDos.svelte.d.ts +0 -20
- package/dist/spectral/Dos.svelte +0 -697
- package/dist/spectral/Dos.svelte.d.ts +0 -29
- package/dist/spectral/helpers.d.ts +0 -117
- package/dist/spectral/helpers.js +0 -1023
- package/dist/spectral/index.d.ts +0 -6
- package/dist/spectral/index.js +0 -7
- package/dist/spectral/types.d.ts +0 -84
- package/dist/spectral/types.js +0 -2
- package/dist/state.svelte.d.ts +0 -25
- package/dist/state.svelte.js +0 -45
- package/dist/structure/Arrow.svelte +0 -72
- package/dist/structure/Arrow.svelte.d.ts +0 -15
- package/dist/structure/AtomLegend.svelte +0 -798
- package/dist/structure/AtomLegend.svelte.d.ts +0 -34
- package/dist/structure/Bond.svelte +0 -140
- package/dist/structure/Bond.svelte.d.ts +0 -9
- package/dist/structure/CanvasTooltip.svelte +0 -33
- package/dist/structure/CanvasTooltip.svelte.d.ts +0 -12
- package/dist/structure/CellSelect.svelte +0 -351
- package/dist/structure/CellSelect.svelte.d.ts +0 -13
- package/dist/structure/Cylinder.svelte +0 -45
- package/dist/structure/Cylinder.svelte.d.ts +0 -10
- package/dist/structure/Lattice.svelte +0 -196
- package/dist/structure/Lattice.svelte.d.ts +0 -17
- package/dist/structure/Structure.svelte +0 -1857
- package/dist/structure/Structure.svelte.d.ts +0 -83
- package/dist/structure/StructureControls.svelte +0 -1184
- package/dist/structure/StructureControls.svelte.d.ts +0 -31
- package/dist/structure/StructureExportPane.svelte +0 -251
- package/dist/structure/StructureExportPane.svelte.d.ts +0 -17
- package/dist/structure/StructureInfoPane.svelte +0 -434
- package/dist/structure/StructureInfoPane.svelte.d.ts +0 -18
- package/dist/structure/StructureScene.svelte +0 -1574
- package/dist/structure/StructureScene.svelte.d.ts +0 -104
- package/dist/structure/atom-properties.d.ts +0 -37
- package/dist/structure/atom-properties.js +0 -198
- package/dist/structure/bonding.d.ts +0 -33
- package/dist/structure/bonding.js +0 -304
- package/dist/structure/export.d.ts +0 -20
- package/dist/structure/export.js +0 -725
- package/dist/structure/ferrox-wasm-types.d.ts +0 -46
- package/dist/structure/ferrox-wasm-types.js +0 -18
- package/dist/structure/ferrox-wasm.d.ts +0 -94
- package/dist/structure/ferrox-wasm.js +0 -249
- package/dist/structure/index.d.ts +0 -110
- package/dist/structure/index.js +0 -168
- package/dist/structure/measure.d.ts +0 -6
- package/dist/structure/measure.js +0 -29
- package/dist/structure/parse.d.ts +0 -65
- package/dist/structure/parse.js +0 -1374
- package/dist/structure/partial-occupancy.d.ts +0 -25
- package/dist/structure/partial-occupancy.js +0 -99
- package/dist/structure/pbc.d.ts +0 -9
- package/dist/structure/pbc.js +0 -123
- package/dist/structure/supercell.d.ts +0 -8
- package/dist/structure/supercell.js +0 -137
- package/dist/structure/validation.d.ts +0 -2
- package/dist/structure/validation.js +0 -10
- package/dist/symmetry/SymmetryStats.svelte +0 -226
- package/dist/symmetry/SymmetryStats.svelte.d.ts +0 -21
- package/dist/symmetry/WyckoffTable.svelte +0 -113
- package/dist/symmetry/WyckoffTable.svelte.d.ts +0 -11
- package/dist/symmetry/cell-transform.d.ts +0 -12
- package/dist/symmetry/cell-transform.js +0 -77
- package/dist/symmetry/index.d.ts +0 -43
- package/dist/symmetry/index.js +0 -229
- package/dist/symmetry/spacegroups.d.ts +0 -9
- package/dist/symmetry/spacegroups.js +0 -394
- package/dist/table/HeatmapTable.svelte +0 -1854
- package/dist/table/HeatmapTable.svelte.d.ts +0 -49
- package/dist/table/ToggleMenu.svelte +0 -376
- package/dist/table/ToggleMenu.svelte.d.ts +0 -11
- package/dist/table/index.d.ts +0 -74
- package/dist/table/index.js +0 -38
- package/dist/theme/ThemeControl.svelte +0 -53
- package/dist/theme/ThemeControl.svelte.d.ts +0 -9
- package/dist/theme/index.d.ts +0 -29
- package/dist/theme/index.js +0 -79
- package/dist/theme/themes.mjs +0 -285
- package/dist/time.d.ts +0 -4
- package/dist/time.js +0 -70
- package/dist/tooltip/TooltipContent.svelte +0 -58
- package/dist/tooltip/TooltipContent.svelte.d.ts +0 -31
- package/dist/tooltip/index.d.ts +0 -2
- package/dist/tooltip/index.js +0 -2
- package/dist/tooltip/types.d.ts +0 -8
- package/dist/tooltip/types.js +0 -1
- package/dist/trajectory/Trajectory.svelte +0 -1517
- package/dist/trajectory/Trajectory.svelte.d.ts +0 -77
- package/dist/trajectory/TrajectoryError.svelte +0 -128
- package/dist/trajectory/TrajectoryError.svelte.d.ts +0 -13
- package/dist/trajectory/TrajectoryExportPane.svelte +0 -357
- package/dist/trajectory/TrajectoryExportPane.svelte.d.ts +0 -17
- package/dist/trajectory/TrajectoryInfoPane.svelte +0 -387
- package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +0 -17
- package/dist/trajectory/constants.d.ts +0 -6
- package/dist/trajectory/constants.js +0 -7
- package/dist/trajectory/extract.d.ts +0 -5
- package/dist/trajectory/extract.js +0 -162
- package/dist/trajectory/format-detect.d.ts +0 -9
- package/dist/trajectory/format-detect.js +0 -76
- package/dist/trajectory/frame-reader.d.ts +0 -17
- package/dist/trajectory/frame-reader.js +0 -332
- package/dist/trajectory/helpers.d.ts +0 -14
- package/dist/trajectory/helpers.js +0 -172
- package/dist/trajectory/index.d.ts +0 -63
- package/dist/trajectory/index.js +0 -126
- package/dist/trajectory/parse/ase.d.ts +0 -2
- package/dist/trajectory/parse/ase.js +0 -77
- package/dist/trajectory/parse/hdf5.d.ts +0 -2
- package/dist/trajectory/parse/hdf5.js +0 -129
- package/dist/trajectory/parse/index.d.ts +0 -12
- package/dist/trajectory/parse/index.js +0 -299
- package/dist/trajectory/parse/lammps.d.ts +0 -5
- package/dist/trajectory/parse/lammps.js +0 -179
- package/dist/trajectory/parse/vasp.d.ts +0 -2
- package/dist/trajectory/parse/vasp.js +0 -68
- package/dist/trajectory/parse/xyz.d.ts +0 -2
- package/dist/trajectory/parse/xyz.js +0 -110
- package/dist/trajectory/plotting.d.ts +0 -28
- package/dist/trajectory/plotting.js +0 -423
- package/dist/trajectory/types.d.ts +0 -11
- package/dist/trajectory/types.js +0 -1
- package/dist/utils.d.ts +0 -5
- package/dist/utils.js +0 -36
- package/dist/xrd/XrdPlot.svelte +0 -615
- package/dist/xrd/XrdPlot.svelte.d.ts +0 -28
- package/dist/xrd/broadening.d.ts +0 -20
- package/dist/xrd/broadening.js +0 -97
- package/dist/xrd/calc-xrd.d.ts +0 -37
- package/dist/xrd/calc-xrd.js +0 -337
- package/dist/xrd/index.d.ts +0 -37
- package/dist/xrd/index.js +0 -4
- package/dist/xrd/parse.d.ts +0 -13
- package/dist/xrd/parse.js +0 -749
- /package/dist/{EmptyState.svelte → src/lib/EmptyState.svelte} +0 -0
- /package/dist/{Icon.svelte → src/lib/Icon.svelte} +0 -0
- /package/dist/{chempot-diagram → src/lib/chempot-diagram}/ChemPotScene3D.svelte +0 -0
- /package/dist/{colors → src/lib/colors}/alloy-colors.json +0 -0
- /package/dist/{colors → src/lib/colors}/dark-mode-colors.json +0 -0
- /package/dist/{colors → src/lib/colors}/jmol-colors.json +0 -0
- /package/dist/{colors → src/lib/colors}/muted-colors.json +0 -0
- /package/dist/{colors → src/lib/colors}/pastel-colors.json +0 -0
- /package/dist/{colors → src/lib/colors}/vesta-colors.json +0 -0
- /package/dist/{element → src/lib/element}/Nucleus.svelte +0 -0
- /package/dist/{element → src/lib/element}/data.json +0 -0
- /package/dist/{element → src/lib/element}/data.json.gz +0 -0
- /package/dist/{element → src/lib/element}/data.schema.json +0 -0
- /package/dist/{element-image-urls.json → src/lib/element-image-urls.json} +0 -0
- /package/dist/{feedback → src/lib/feedback}/Spinner.svelte +0 -0
- /package/dist/{feedback → src/lib/feedback}/StatusMessage.svelte +0 -0
- /package/dist/{periodic-table → src/lib/periodic-table}/TableInset.svelte +0 -0
- /package/dist/{plot → src/lib/plot}/ReferenceLine.svelte +0 -0
- /package/dist/{xrd → src/lib/xrd}/atomic_scattering_params.json +0 -0
|
@@ -0,0 +1,1230 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Icon from '$lib/Icon.svelte'
|
|
3
|
+
import { download } from '$lib/io/fetch'
|
|
4
|
+
import { make_change_detector } from '$lib/utils'
|
|
5
|
+
import { setContext, tick } from 'svelte'
|
|
6
|
+
import { highlight_matches, tooltip } from 'svelte-multiselect/attachments'
|
|
7
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
8
|
+
import { SvelteSet } from 'svelte/reactivity'
|
|
9
|
+
import JsonNode from './JsonNode.svelte'
|
|
10
|
+
import type {
|
|
11
|
+
CopyEventPosition,
|
|
12
|
+
DiffEntry,
|
|
13
|
+
JsonTreeContext,
|
|
14
|
+
JsonTreeProps,
|
|
15
|
+
} from './types'
|
|
16
|
+
import { JSON_TREE_CONTEXT_KEY } from './types'
|
|
17
|
+
import {
|
|
18
|
+
build_ghost_map,
|
|
19
|
+
collect_all_paths,
|
|
20
|
+
compute_diff,
|
|
21
|
+
find_matching_paths,
|
|
22
|
+
format_preview,
|
|
23
|
+
get_ancestor_paths,
|
|
24
|
+
parse_path,
|
|
25
|
+
serialize_for_copy,
|
|
26
|
+
} from './utils'
|
|
27
|
+
|
|
28
|
+
// Constant set for arrow key detection (avoid allocating on every keydown)
|
|
29
|
+
const ARROW_KEYS = new Set([`ArrowDown`, `ArrowUp`, `ArrowLeft`, `ArrowRight`])
|
|
30
|
+
// Shared empty set for when there's no search query (avoid allocation on every derivation)
|
|
31
|
+
const EMPTY_MATCHES = new SvelteSet<string>()
|
|
32
|
+
|
|
33
|
+
let {
|
|
34
|
+
value,
|
|
35
|
+
root_label,
|
|
36
|
+
default_fold_level = 2,
|
|
37
|
+
auto_fold_arrays = 10,
|
|
38
|
+
auto_fold_objects = 20,
|
|
39
|
+
collapsed_paths = $bindable(new SvelteSet<string>()),
|
|
40
|
+
show_header = true,
|
|
41
|
+
show_data_types = $bindable(false),
|
|
42
|
+
show_array_indices = $bindable(true),
|
|
43
|
+
sort_keys = false,
|
|
44
|
+
max_string_length = 200,
|
|
45
|
+
highlight_changes = true,
|
|
46
|
+
onselect,
|
|
47
|
+
oncopy,
|
|
48
|
+
download_filename,
|
|
49
|
+
compare_value,
|
|
50
|
+
editable = false,
|
|
51
|
+
onchange,
|
|
52
|
+
...rest
|
|
53
|
+
}: JsonTreeProps & Omit<HTMLAttributes<HTMLDivElement>, `onselect` | `onchange`> =
|
|
54
|
+
$props()
|
|
55
|
+
|
|
56
|
+
// Internal state
|
|
57
|
+
let search_query = $state(``)
|
|
58
|
+
let search_input_value = $state(``)
|
|
59
|
+
let focused_path = $state<string | null>(null)
|
|
60
|
+
// Use Set for O(1) lookup/add/delete instead of O(n) array operations
|
|
61
|
+
let registered_paths_set = $state(new Set<string>())
|
|
62
|
+
let registered_paths_list = $state<string[]>([]) // ordered list for keyboard nav
|
|
63
|
+
let copy_feedback_path = $state<string | null>(null)
|
|
64
|
+
let copy_feedback_error = $state(false)
|
|
65
|
+
let copy_feedback_timeout: ReturnType<typeof setTimeout> | undefined
|
|
66
|
+
// Track paths explicitly expanded (overrides auto-fold thresholds)
|
|
67
|
+
let force_expanded = $state(new SvelteSet<string>())
|
|
68
|
+
// Current match index for navigation (0-based, -1 means no selection)
|
|
69
|
+
let current_match_index = $state(-1)
|
|
70
|
+
// Reference to the content container for scrolling
|
|
71
|
+
let content_element: HTMLDivElement | undefined = $state()
|
|
72
|
+
// Reference to the search input for focus management
|
|
73
|
+
let search_input_element: HTMLInputElement | undefined = $state()
|
|
74
|
+
// Context menu state (null when closed)
|
|
75
|
+
let context_menu_state = $state<
|
|
76
|
+
{
|
|
77
|
+
x: number
|
|
78
|
+
y: number
|
|
79
|
+
path: string
|
|
80
|
+
value: unknown
|
|
81
|
+
expandable: boolean
|
|
82
|
+
is_collapsed: boolean
|
|
83
|
+
} | null
|
|
84
|
+
>(null)
|
|
85
|
+
// Pinned paths for quick reference
|
|
86
|
+
let pinned_paths = $state(new SvelteSet<string>())
|
|
87
|
+
// Selection state for bulk operations
|
|
88
|
+
let selected_paths = $state(new SvelteSet<string>())
|
|
89
|
+
let last_selected_path = $state<string | null>(null)
|
|
90
|
+
// Copy feedback positioning (null = use default corner position)
|
|
91
|
+
let copy_feedback_pos = $state<{ x: number; y: number } | null>(null)
|
|
92
|
+
|
|
93
|
+
const value_changed = make_change_detector()
|
|
94
|
+
$effect.pre(() => {
|
|
95
|
+
if (!value_changed(value)) return
|
|
96
|
+
focused_path = null
|
|
97
|
+
registered_paths_set = new Set()
|
|
98
|
+
registered_paths_list = []
|
|
99
|
+
copy_feedback_path = null
|
|
100
|
+
copy_feedback_error = false
|
|
101
|
+
context_menu_state = null
|
|
102
|
+
force_expanded = new SvelteSet()
|
|
103
|
+
const valid_paths = new SvelteSet(collect_all_paths(value, root_label ?? ``))
|
|
104
|
+
collapsed_paths = new SvelteSet([...collapsed_paths].filter((path) => valid_paths.has(path)))
|
|
105
|
+
pinned_paths = new SvelteSet()
|
|
106
|
+
selected_paths = new SvelteSet()
|
|
107
|
+
last_selected_path = null
|
|
108
|
+
current_match_index = -1
|
|
109
|
+
prev_values.clear()
|
|
110
|
+
if (search_query) queueMicrotask(() => expand_to_matches())
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
// Debounce search input
|
|
114
|
+
let search_debounce_timeout: ReturnType<typeof setTimeout> | undefined
|
|
115
|
+
|
|
116
|
+
function handle_search_input(event: Event & { currentTarget: HTMLInputElement }) {
|
|
117
|
+
search_input_value = event.currentTarget.value
|
|
118
|
+
|
|
119
|
+
if (search_debounce_timeout) clearTimeout(search_debounce_timeout)
|
|
120
|
+
search_debounce_timeout = setTimeout(() => {
|
|
121
|
+
search_query = search_input_value
|
|
122
|
+
// queueMicrotask lets derived search_matches update before expand_to_matches runs
|
|
123
|
+
queueMicrotask(() => expand_to_matches())
|
|
124
|
+
}, 150)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Root path used everywhere - avoids repeating `root_label ?? ''`
|
|
128
|
+
let root_path = $derived(root_label ?? ``)
|
|
129
|
+
|
|
130
|
+
// Compute search matches
|
|
131
|
+
let search_matches = $derived.by(() => {
|
|
132
|
+
if (!search_query) return EMPTY_MATCHES
|
|
133
|
+
return new SvelteSet(find_matching_paths(value, search_query, root_path))
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
// Sorted matches list for navigation (maintains DOM order via registered_paths_list)
|
|
137
|
+
let sorted_matches = $derived.by(() => {
|
|
138
|
+
if (search_matches.size === 0) return []
|
|
139
|
+
// Filter registered paths to only include matches, preserving DOM order
|
|
140
|
+
return registered_paths_list.filter((path) => search_matches.has(path))
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
// Current match path (the one being navigated to)
|
|
144
|
+
let current_match_path = $derived.by(() => {
|
|
145
|
+
if (sorted_matches.length === 0 || current_match_index < 0) return null
|
|
146
|
+
return sorted_matches[current_match_index] ?? null
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
// Auto-expand ancestors of search matches when search query changes
|
|
150
|
+
// This is called manually from the search input handler to avoid reactivity issues
|
|
151
|
+
async function expand_to_matches(): Promise<void> {
|
|
152
|
+
if (search_matches.size === 0) {
|
|
153
|
+
current_match_index = -1
|
|
154
|
+
return
|
|
155
|
+
}
|
|
156
|
+
const paths_to_expand = new Set<string>()
|
|
157
|
+
for (const match of search_matches) {
|
|
158
|
+
for (const ancestor of get_ancestor_paths(match)) {
|
|
159
|
+
paths_to_expand.add(ancestor)
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
let collapsed_changed = false
|
|
163
|
+
let force_expanded_changed = false
|
|
164
|
+
for (const path_to_expand of paths_to_expand) {
|
|
165
|
+
if (collapsed_paths.has(path_to_expand)) {
|
|
166
|
+
collapsed_paths.delete(path_to_expand)
|
|
167
|
+
collapsed_changed = true
|
|
168
|
+
}
|
|
169
|
+
// Also add to force_expanded to override auto-fold thresholds (depth/size)
|
|
170
|
+
if (!force_expanded.has(path_to_expand)) {
|
|
171
|
+
force_expanded.add(path_to_expand)
|
|
172
|
+
force_expanded_changed = true
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (collapsed_changed) {
|
|
176
|
+
collapsed_paths = new SvelteSet(collapsed_paths)
|
|
177
|
+
}
|
|
178
|
+
if (force_expanded_changed) {
|
|
179
|
+
force_expanded = new SvelteSet(force_expanded)
|
|
180
|
+
}
|
|
181
|
+
// Wait for DOM to update before scrolling to match
|
|
182
|
+
await tick()
|
|
183
|
+
if (sorted_matches.length > 0) {
|
|
184
|
+
// Reset to first match if no selection or index is out of bounds
|
|
185
|
+
if (current_match_index < 0 || current_match_index >= sorted_matches.length) {
|
|
186
|
+
current_match_index = 0
|
|
187
|
+
}
|
|
188
|
+
scroll_to_current_match()
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Scroll the current match into view
|
|
193
|
+
function scroll_to_current_match(): void {
|
|
194
|
+
if (!current_match_path || !content_element) return
|
|
195
|
+
// Find the element with the matching path using data attribute
|
|
196
|
+
const match_element = content_element.querySelector(
|
|
197
|
+
`[data-path="${CSS.escape(current_match_path)}"]`,
|
|
198
|
+
)
|
|
199
|
+
if (match_element) {
|
|
200
|
+
match_element.scrollIntoView({ behavior: `smooth`, block: `center` })
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Navigate to next match
|
|
205
|
+
function go_to_next_match(): void {
|
|
206
|
+
if (sorted_matches.length === 0) return
|
|
207
|
+
current_match_index = (current_match_index + 1) % sorted_matches.length
|
|
208
|
+
scroll_to_current_match()
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Navigate to previous match
|
|
212
|
+
function go_to_prev_match(): void {
|
|
213
|
+
if (sorted_matches.length === 0) return
|
|
214
|
+
current_match_index = (current_match_index - 1 + sorted_matches.length) %
|
|
215
|
+
sorted_matches.length
|
|
216
|
+
scroll_to_current_match()
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Previous values map for change detection
|
|
220
|
+
const prev_values = new Map<string, unknown>()
|
|
221
|
+
|
|
222
|
+
// Toggle collapse - tracks force_expanded to override auto-fold thresholds
|
|
223
|
+
function toggle_collapse(path: string, is_currently_collapsed: boolean): void {
|
|
224
|
+
if (is_currently_collapsed) {
|
|
225
|
+
collapsed_paths.delete(path)
|
|
226
|
+
force_expanded.add(path)
|
|
227
|
+
} else {
|
|
228
|
+
force_expanded.delete(path)
|
|
229
|
+
collapsed_paths.add(path)
|
|
230
|
+
}
|
|
231
|
+
collapsed_paths = new SvelteSet(collapsed_paths)
|
|
232
|
+
force_expanded = new SvelteSet(force_expanded)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Toggle collapse recursively for all descendants
|
|
236
|
+
function toggle_collapse_recursive(path: string, collapse: boolean): void {
|
|
237
|
+
for (const desc of get_descendants(path)) {
|
|
238
|
+
if (collapse) {
|
|
239
|
+
force_expanded.delete(desc)
|
|
240
|
+
collapsed_paths.add(desc)
|
|
241
|
+
} else {
|
|
242
|
+
collapsed_paths.delete(desc)
|
|
243
|
+
force_expanded.add(desc)
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
collapsed_paths = new SvelteSet(collapsed_paths)
|
|
247
|
+
force_expanded = new SvelteSet(force_expanded)
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Get all descendant paths of a given path (including the path itself)
|
|
251
|
+
function get_descendants(target_path: string): string[] {
|
|
252
|
+
const all_paths = collect_all_paths(value, root_path)
|
|
253
|
+
const descendants = target_path === `` ? all_paths : all_paths.filter(
|
|
254
|
+
(entry) =>
|
|
255
|
+
entry === target_path || entry.startsWith(target_path + `.`) ||
|
|
256
|
+
entry.startsWith(target_path + `[`),
|
|
257
|
+
)
|
|
258
|
+
return descendants.includes(target_path)
|
|
259
|
+
? descendants
|
|
260
|
+
: [target_path, ...descendants]
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
function expand_all(): void {
|
|
264
|
+
force_expanded = new SvelteSet(collect_all_paths(value, root_path))
|
|
265
|
+
collapsed_paths = new SvelteSet()
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function collapse_all(): void {
|
|
269
|
+
force_expanded = new SvelteSet()
|
|
270
|
+
collapsed_paths = new SvelteSet(collect_all_paths(value, root_path))
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function collapse_to_level(level: number): void {
|
|
274
|
+
const all_paths = collect_all_paths(value, root_path)
|
|
275
|
+
const new_collapsed = new SvelteSet<string>()
|
|
276
|
+
const new_expanded = new SvelteSet<string>()
|
|
277
|
+
|
|
278
|
+
for (const path of all_paths) {
|
|
279
|
+
const segments = parse_path(path)
|
|
280
|
+
const depth = root_label && segments[0] === root_label
|
|
281
|
+
? segments.length - 1
|
|
282
|
+
: segments.length
|
|
283
|
+
;(depth >= level ? new_collapsed : new_expanded).add(path)
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
collapsed_paths = new_collapsed
|
|
287
|
+
force_expanded = new_expanded
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function set_focused(path: string | null): void {
|
|
291
|
+
focused_path = path
|
|
292
|
+
if (path) onselect?.(path, get_value_at_path(path))
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Shared clipboard copy with feedback (event used for inline positioning)
|
|
296
|
+
async function copy_to_clipboard(
|
|
297
|
+
path: string,
|
|
298
|
+
text: string,
|
|
299
|
+
event?: CopyEventPosition,
|
|
300
|
+
): Promise<void> {
|
|
301
|
+
copy_feedback_pos = event ? { x: event.clientX, y: event.clientY } : null
|
|
302
|
+
try {
|
|
303
|
+
await navigator.clipboard.writeText(text)
|
|
304
|
+
copy_feedback_error = false
|
|
305
|
+
oncopy?.(path, text)
|
|
306
|
+
} catch { // Clipboard API failed - still show feedback but as error
|
|
307
|
+
copy_feedback_error = true
|
|
308
|
+
}
|
|
309
|
+
copy_feedback_path = path // Show feedback regardless of success/failure
|
|
310
|
+
if (copy_feedback_timeout) clearTimeout(copy_feedback_timeout)
|
|
311
|
+
copy_feedback_timeout = setTimeout(() => {
|
|
312
|
+
copy_feedback_path = null
|
|
313
|
+
}, 1000)
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function register_path(path: string): void {
|
|
317
|
+
if (!registered_paths_set.has(path)) {
|
|
318
|
+
registered_paths_set.add(path)
|
|
319
|
+
registered_paths_list = [...registered_paths_list, path]
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function unregister_path(path: string): void {
|
|
324
|
+
if (registered_paths_set.has(path)) {
|
|
325
|
+
registered_paths_set.delete(path)
|
|
326
|
+
registered_paths_list = registered_paths_list.filter((entry) => entry !== path)
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Helper to get value at a path (for onselect callback)
|
|
331
|
+
function get_value_at_path(path: string): unknown {
|
|
332
|
+
if (!path || path === root_label) return value
|
|
333
|
+
|
|
334
|
+
const segments = parse_path(path)
|
|
335
|
+
let current: unknown = value
|
|
336
|
+
const start_idx = segments[0] === root_label ? 1 : 0
|
|
337
|
+
|
|
338
|
+
for (let idx = start_idx; idx < segments.length; idx++) {
|
|
339
|
+
const segment = segments[idx]
|
|
340
|
+
if (current == null) return undefined
|
|
341
|
+
|
|
342
|
+
// Map/Set use numeric indexing
|
|
343
|
+
if (current instanceof Map || current instanceof Set) {
|
|
344
|
+
const index = typeof segment === `number` ? segment : Number(segment)
|
|
345
|
+
if (Number.isNaN(index)) return undefined
|
|
346
|
+
current = Array.from(current.values())[index]
|
|
347
|
+
} else if (typeof current === `object`) {
|
|
348
|
+
current = (current as Record<string | number, unknown>)[segment]
|
|
349
|
+
} else {
|
|
350
|
+
return undefined
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return current
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Compute diff map when compare_value is provided
|
|
357
|
+
let diff_map = $derived.by((): Map<string, DiffEntry> | null => {
|
|
358
|
+
if (compare_value === undefined) return null
|
|
359
|
+
return compute_diff(compare_value, value, root_path)
|
|
360
|
+
})
|
|
361
|
+
|
|
362
|
+
// Pre-compute ghost children map for O(1) lookup per node
|
|
363
|
+
let ghost_map = $derived(diff_map ? build_ghost_map(diff_map) : new Map())
|
|
364
|
+
|
|
365
|
+
// Collapse all descendants but keep the given node expanded (single batch)
|
|
366
|
+
function collapse_children_only(target_path: string): void {
|
|
367
|
+
for (const desc of get_descendants(target_path)) {
|
|
368
|
+
if (desc === target_path) {
|
|
369
|
+
collapsed_paths.delete(desc)
|
|
370
|
+
force_expanded.add(desc)
|
|
371
|
+
} else {
|
|
372
|
+
force_expanded.delete(desc)
|
|
373
|
+
collapsed_paths.add(desc)
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
collapsed_paths = new SvelteSet(collapsed_paths)
|
|
377
|
+
force_expanded = new SvelteSet(force_expanded)
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// Context menu handlers
|
|
381
|
+
function show_context_menu(
|
|
382
|
+
event: MouseEvent,
|
|
383
|
+
ctx_path: string,
|
|
384
|
+
ctx_value: unknown,
|
|
385
|
+
expandable: boolean,
|
|
386
|
+
is_collapsed: boolean,
|
|
387
|
+
): void {
|
|
388
|
+
event.preventDefault()
|
|
389
|
+
context_menu_state = {
|
|
390
|
+
x: event.clientX,
|
|
391
|
+
y: event.clientY,
|
|
392
|
+
path: ctx_path,
|
|
393
|
+
value: ctx_value,
|
|
394
|
+
expandable,
|
|
395
|
+
is_collapsed,
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
function close_context_menu(): void {
|
|
400
|
+
context_menu_state = null
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// Run action with current context menu state, then close
|
|
404
|
+
function ctx_menu_action(
|
|
405
|
+
action: (state: NonNullable<typeof context_menu_state>) => void,
|
|
406
|
+
): void {
|
|
407
|
+
if (context_menu_state) action(context_menu_state)
|
|
408
|
+
close_context_menu()
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// Pin/unpin a path for quick reference
|
|
412
|
+
function toggle_pin(pin_path: string): void {
|
|
413
|
+
if (pinned_paths.has(pin_path)) pinned_paths.delete(pin_path)
|
|
414
|
+
else pinned_paths.add(pin_path)
|
|
415
|
+
pinned_paths = new SvelteSet(pinned_paths)
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// Toggle selection of a path (with shift for range select)
|
|
419
|
+
function toggle_select(select_path: string, shift: boolean): void {
|
|
420
|
+
if (shift && last_selected_path) {
|
|
421
|
+
const start_idx = registered_paths_list.indexOf(last_selected_path)
|
|
422
|
+
const end_idx = registered_paths_list.indexOf(select_path)
|
|
423
|
+
if (start_idx !== -1 && end_idx !== -1) {
|
|
424
|
+
const [from, to] = start_idx < end_idx
|
|
425
|
+
? [start_idx, end_idx]
|
|
426
|
+
: [end_idx, start_idx]
|
|
427
|
+
for (let idx = from; idx <= to; idx++) {
|
|
428
|
+
selected_paths.add(registered_paths_list[idx])
|
|
429
|
+
}
|
|
430
|
+
selected_paths = new SvelteSet(selected_paths)
|
|
431
|
+
}
|
|
432
|
+
} else {
|
|
433
|
+
if (selected_paths.has(select_path)) selected_paths.delete(select_path)
|
|
434
|
+
else selected_paths.add(select_path)
|
|
435
|
+
selected_paths = new SvelteSet(selected_paths)
|
|
436
|
+
}
|
|
437
|
+
last_selected_path = select_path
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// Copy all selected node values to clipboard
|
|
441
|
+
function copy_selected(): void {
|
|
442
|
+
if (selected_paths.size === 0) return
|
|
443
|
+
const text = [...selected_paths]
|
|
444
|
+
.map((sel_path) => serialize_for_copy(get_value_at_path(sel_path)))
|
|
445
|
+
.join(`\n`)
|
|
446
|
+
copy_to_clipboard(`[selection]`, text)
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// Create context
|
|
450
|
+
const context: JsonTreeContext = {
|
|
451
|
+
get settings() {
|
|
452
|
+
return {
|
|
453
|
+
default_fold_level,
|
|
454
|
+
auto_fold_arrays,
|
|
455
|
+
auto_fold_objects,
|
|
456
|
+
show_data_types,
|
|
457
|
+
show_array_indices,
|
|
458
|
+
sort_keys,
|
|
459
|
+
max_string_length,
|
|
460
|
+
highlight_changes,
|
|
461
|
+
editable,
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
get collapsed() {
|
|
465
|
+
return collapsed_paths
|
|
466
|
+
},
|
|
467
|
+
get force_expanded() {
|
|
468
|
+
return force_expanded
|
|
469
|
+
},
|
|
470
|
+
get search_query() {
|
|
471
|
+
return search_query
|
|
472
|
+
},
|
|
473
|
+
get search_matches() {
|
|
474
|
+
return search_matches
|
|
475
|
+
},
|
|
476
|
+
get current_match_path() {
|
|
477
|
+
return current_match_path
|
|
478
|
+
},
|
|
479
|
+
get focused_path() {
|
|
480
|
+
return focused_path
|
|
481
|
+
},
|
|
482
|
+
prev_values,
|
|
483
|
+
toggle_collapse,
|
|
484
|
+
toggle_collapse_recursive,
|
|
485
|
+
expand_all,
|
|
486
|
+
collapse_all,
|
|
487
|
+
collapse_to_level,
|
|
488
|
+
set_focused,
|
|
489
|
+
copy_value: (val_path: string, val: unknown, event?: CopyEventPosition) =>
|
|
490
|
+
copy_to_clipboard(val_path, serialize_for_copy(val), event),
|
|
491
|
+
copy_path: (cp_path: string, event?: CopyEventPosition) =>
|
|
492
|
+
copy_to_clipboard(cp_path, cp_path, event),
|
|
493
|
+
register_path,
|
|
494
|
+
unregister_path,
|
|
495
|
+
show_context_menu,
|
|
496
|
+
get pinned_paths() {
|
|
497
|
+
return pinned_paths
|
|
498
|
+
},
|
|
499
|
+
toggle_pin,
|
|
500
|
+
get selected_paths() {
|
|
501
|
+
return selected_paths
|
|
502
|
+
},
|
|
503
|
+
toggle_select,
|
|
504
|
+
copy_selected,
|
|
505
|
+
get diff_map() {
|
|
506
|
+
return diff_map
|
|
507
|
+
},
|
|
508
|
+
get ghost_map() {
|
|
509
|
+
return ghost_map
|
|
510
|
+
},
|
|
511
|
+
collapse_children_only,
|
|
512
|
+
get onchange() {
|
|
513
|
+
return onchange
|
|
514
|
+
},
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
setContext(JSON_TREE_CONTEXT_KEY, context)
|
|
518
|
+
|
|
519
|
+
// Keyboard navigation at tree level
|
|
520
|
+
function handle_tree_keydown(event: KeyboardEvent) {
|
|
521
|
+
// Escape closes context menu first, then clears selection
|
|
522
|
+
if (event.key === `Escape`) {
|
|
523
|
+
if (context_menu_state) {
|
|
524
|
+
close_context_menu()
|
|
525
|
+
return
|
|
526
|
+
}
|
|
527
|
+
if (selected_paths.size > 0) {
|
|
528
|
+
selected_paths = new SvelteSet()
|
|
529
|
+
return
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
// Ctrl/Cmd+C with selection copies all selected
|
|
533
|
+
if (
|
|
534
|
+
(event.key === `c` || event.key === `C`) &&
|
|
535
|
+
(event.ctrlKey || event.metaKey) &&
|
|
536
|
+
selected_paths.size > 0
|
|
537
|
+
) {
|
|
538
|
+
event.preventDefault()
|
|
539
|
+
copy_selected()
|
|
540
|
+
return
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
if (!focused_path) {
|
|
544
|
+
// Focus first node on any arrow key
|
|
545
|
+
if (ARROW_KEYS.has(event.key)) {
|
|
546
|
+
event.preventDefault()
|
|
547
|
+
if (registered_paths_list.length > 0) {
|
|
548
|
+
set_focused(registered_paths_list[0])
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
return
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
const current_index = registered_paths_list.indexOf(focused_path)
|
|
555
|
+
if (current_index === -1) return
|
|
556
|
+
|
|
557
|
+
if (event.key === `ArrowDown`) {
|
|
558
|
+
event.preventDefault()
|
|
559
|
+
const next_index = Math.min(current_index + 1, registered_paths_list.length - 1)
|
|
560
|
+
set_focused(registered_paths_list[next_index])
|
|
561
|
+
} else if (event.key === `ArrowUp`) {
|
|
562
|
+
event.preventDefault()
|
|
563
|
+
const prev_index = Math.max(current_index - 1, 0)
|
|
564
|
+
set_focused(registered_paths_list[prev_index])
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
// Clear search
|
|
569
|
+
function clear_search() {
|
|
570
|
+
if (search_debounce_timeout) clearTimeout(search_debounce_timeout)
|
|
571
|
+
search_input_value = ``
|
|
572
|
+
search_query = ``
|
|
573
|
+
current_match_index = -1
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
// Copy entire JSON to clipboard
|
|
577
|
+
function copy_all(): void {
|
|
578
|
+
copy_to_clipboard(`[root]`, serialize_for_copy(value))
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// Download JSON as file
|
|
582
|
+
function download_json(): void {
|
|
583
|
+
const json_str = serialize_for_copy(value)
|
|
584
|
+
const date_str = new Date().toISOString().slice(0, 10)
|
|
585
|
+
const filename = download_filename ?? `data-${date_str}.json`
|
|
586
|
+
download(json_str, filename, `application/json`)
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
// Handle keyboard events on search input
|
|
590
|
+
function handle_search_keydown(event: KeyboardEvent) {
|
|
591
|
+
if (event.key === `Escape`) {
|
|
592
|
+
event.preventDefault()
|
|
593
|
+
clear_search()
|
|
594
|
+
search_input_element?.blur()
|
|
595
|
+
} else if (event.key === `Enter` || event.key === `F3`) {
|
|
596
|
+
event.stopPropagation() // Prevent bubbling to tree-level F3 handler
|
|
597
|
+
event.preventDefault()
|
|
598
|
+
if (event.shiftKey) go_to_prev_match()
|
|
599
|
+
else go_to_next_match()
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
</script>
|
|
603
|
+
|
|
604
|
+
<div
|
|
605
|
+
class="json-tree"
|
|
606
|
+
role="tree"
|
|
607
|
+
aria-label="JSON tree viewer"
|
|
608
|
+
{...rest}
|
|
609
|
+
onkeydown={(event) => {
|
|
610
|
+
handle_tree_keydown(event)
|
|
611
|
+
// F3 at tree level for match navigation
|
|
612
|
+
if (event.key === `F3`) {
|
|
613
|
+
event.preventDefault()
|
|
614
|
+
if (event.shiftKey) go_to_prev_match()
|
|
615
|
+
else go_to_next_match()
|
|
616
|
+
}
|
|
617
|
+
}}
|
|
618
|
+
>
|
|
619
|
+
{#if show_header}
|
|
620
|
+
<header class="json-tree-header">
|
|
621
|
+
<div class="search-wrapper">
|
|
622
|
+
<Icon icon="Search" style="width: 14px; height: 14px; opacity: 0.6" />
|
|
623
|
+
<input
|
|
624
|
+
bind:this={search_input_element}
|
|
625
|
+
type="search"
|
|
626
|
+
placeholder="Search keys and values..."
|
|
627
|
+
value={search_input_value}
|
|
628
|
+
oninput={handle_search_input}
|
|
629
|
+
onkeydown={handle_search_keydown}
|
|
630
|
+
class="search-input"
|
|
631
|
+
/>
|
|
632
|
+
{#if search_input_value}
|
|
633
|
+
<button
|
|
634
|
+
type="button"
|
|
635
|
+
class="clear-search"
|
|
636
|
+
onclick={clear_search}
|
|
637
|
+
title="Clear search (Esc)"
|
|
638
|
+
{@attach tooltip()}
|
|
639
|
+
>
|
|
640
|
+
<Icon icon="Cross" style="width: 12px; height: 12px" />
|
|
641
|
+
</button>
|
|
642
|
+
{/if}
|
|
643
|
+
</div>
|
|
644
|
+
{#if search_query && sorted_matches.length > 0}
|
|
645
|
+
<div class="match-nav">
|
|
646
|
+
<button
|
|
647
|
+
type="button"
|
|
648
|
+
class="nav-btn"
|
|
649
|
+
onclick={go_to_prev_match}
|
|
650
|
+
title="Previous match (Shift+F3)"
|
|
651
|
+
{@attach tooltip()}
|
|
652
|
+
>
|
|
653
|
+
<Icon icon="ArrowUp" style="width: 12px; height: 12px" />
|
|
654
|
+
</button>
|
|
655
|
+
<button
|
|
656
|
+
type="button"
|
|
657
|
+
class="nav-btn"
|
|
658
|
+
onclick={go_to_next_match}
|
|
659
|
+
title="Next match (F3)"
|
|
660
|
+
{@attach tooltip()}
|
|
661
|
+
>
|
|
662
|
+
<Icon icon="ArrowDown" style="width: 12px; height: 12px" />
|
|
663
|
+
</button>
|
|
664
|
+
<span class="match-count">{current_match_index + 1} of {
|
|
665
|
+
sorted_matches.length
|
|
666
|
+
}</span>
|
|
667
|
+
</div>
|
|
668
|
+
{/if}
|
|
669
|
+
<div class="controls">
|
|
670
|
+
<button
|
|
671
|
+
type="button"
|
|
672
|
+
onclick={() => (show_data_types = !show_data_types)}
|
|
673
|
+
title={show_data_types ? `Hide data types` : `Show data types`}
|
|
674
|
+
class:active={show_data_types}
|
|
675
|
+
{@attach tooltip()}
|
|
676
|
+
>
|
|
677
|
+
T
|
|
678
|
+
</button>
|
|
679
|
+
<button
|
|
680
|
+
type="button"
|
|
681
|
+
onclick={() => (show_array_indices = !show_array_indices)}
|
|
682
|
+
title={show_array_indices ? `Hide array indices` : `Show array indices`}
|
|
683
|
+
class:active={show_array_indices}
|
|
684
|
+
{@attach tooltip()}
|
|
685
|
+
>
|
|
686
|
+
#
|
|
687
|
+
</button>
|
|
688
|
+
</div>
|
|
689
|
+
<div class="divider"></div>
|
|
690
|
+
<div class="controls">
|
|
691
|
+
<button type="button" onclick={expand_all} title="Expand all" {@attach tooltip()}>
|
|
692
|
+
<Icon icon="Expand" style="width: 14px; height: 14px" />
|
|
693
|
+
</button>
|
|
694
|
+
<button
|
|
695
|
+
type="button"
|
|
696
|
+
onclick={collapse_all}
|
|
697
|
+
title="Collapse all"
|
|
698
|
+
{@attach tooltip()}
|
|
699
|
+
>
|
|
700
|
+
<Icon icon="Collapse" style="width: 14px; height: 14px" />
|
|
701
|
+
</button>
|
|
702
|
+
<button
|
|
703
|
+
type="button"
|
|
704
|
+
onclick={() => collapse_to_level(1)}
|
|
705
|
+
title="Collapse to level 1"
|
|
706
|
+
{@attach tooltip()}
|
|
707
|
+
>
|
|
708
|
+
1
|
|
709
|
+
</button>
|
|
710
|
+
<button
|
|
711
|
+
type="button"
|
|
712
|
+
onclick={() => collapse_to_level(2)}
|
|
713
|
+
title="Collapse to level 2"
|
|
714
|
+
{@attach tooltip()}
|
|
715
|
+
>
|
|
716
|
+
2
|
|
717
|
+
</button>
|
|
718
|
+
<button
|
|
719
|
+
type="button"
|
|
720
|
+
onclick={() => collapse_to_level(3)}
|
|
721
|
+
title="Collapse to level 3"
|
|
722
|
+
{@attach tooltip()}
|
|
723
|
+
>
|
|
724
|
+
3
|
|
725
|
+
</button>
|
|
726
|
+
</div>
|
|
727
|
+
<div class="divider"></div>
|
|
728
|
+
<div class="controls">
|
|
729
|
+
<button
|
|
730
|
+
type="button"
|
|
731
|
+
onclick={copy_all}
|
|
732
|
+
title="Copy JSON to clipboard"
|
|
733
|
+
{@attach tooltip()}
|
|
734
|
+
>
|
|
735
|
+
<Icon icon="Copy" style="width: 14px; height: 14px" />
|
|
736
|
+
</button>
|
|
737
|
+
<button
|
|
738
|
+
type="button"
|
|
739
|
+
onclick={download_json}
|
|
740
|
+
title="Download as JSON file"
|
|
741
|
+
{@attach tooltip()}
|
|
742
|
+
>
|
|
743
|
+
<Icon icon="Download" style="width: 14px; height: 14px" />
|
|
744
|
+
</button>
|
|
745
|
+
</div>
|
|
746
|
+
</header>
|
|
747
|
+
{/if}
|
|
748
|
+
|
|
749
|
+
{#if focused_path}
|
|
750
|
+
<div class="path-breadcrumb">
|
|
751
|
+
<button
|
|
752
|
+
type="button"
|
|
753
|
+
class="copy-path-btn"
|
|
754
|
+
onclick={() => copy_to_clipboard(focused_path!, focused_path!)}
|
|
755
|
+
title="Click to copy path"
|
|
756
|
+
{@attach tooltip()}
|
|
757
|
+
>
|
|
758
|
+
{focused_path}
|
|
759
|
+
</button>
|
|
760
|
+
</div>
|
|
761
|
+
{/if}
|
|
762
|
+
|
|
763
|
+
{#if pinned_paths.size > 0}
|
|
764
|
+
<div class="pinned-panel">
|
|
765
|
+
<div class="pinned-header">
|
|
766
|
+
<span>Pinned ({pinned_paths.size})</span>
|
|
767
|
+
<button
|
|
768
|
+
type="button"
|
|
769
|
+
class="pinned-clear-btn"
|
|
770
|
+
onclick={() => {
|
|
771
|
+
pinned_paths = new SvelteSet()
|
|
772
|
+
}}
|
|
773
|
+
>
|
|
774
|
+
Clear
|
|
775
|
+
</button>
|
|
776
|
+
</div>
|
|
777
|
+
{#each [...pinned_paths] as pinned_path (pinned_path)}
|
|
778
|
+
<div class="pinned-item">
|
|
779
|
+
<button
|
|
780
|
+
type="button"
|
|
781
|
+
class="pinned-path"
|
|
782
|
+
onclick={() =>
|
|
783
|
+
copy_to_clipboard(
|
|
784
|
+
pinned_path,
|
|
785
|
+
serialize_for_copy(get_value_at_path(pinned_path)),
|
|
786
|
+
)}
|
|
787
|
+
title="Click to copy value"
|
|
788
|
+
{@attach tooltip()}
|
|
789
|
+
>
|
|
790
|
+
{pinned_path}
|
|
791
|
+
</button>
|
|
792
|
+
<span class="pinned-value">{
|
|
793
|
+
format_preview(get_value_at_path(pinned_path))
|
|
794
|
+
}</span>
|
|
795
|
+
<button
|
|
796
|
+
type="button"
|
|
797
|
+
class="unpin-btn"
|
|
798
|
+
onclick={() => toggle_pin(pinned_path)}
|
|
799
|
+
title="Unpin"
|
|
800
|
+
>
|
|
801
|
+
✕
|
|
802
|
+
</button>
|
|
803
|
+
</div>
|
|
804
|
+
{/each}
|
|
805
|
+
</div>
|
|
806
|
+
{/if}
|
|
807
|
+
|
|
808
|
+
<div
|
|
809
|
+
bind:this={content_element}
|
|
810
|
+
class="json-tree-content"
|
|
811
|
+
{@attach highlight_matches({
|
|
812
|
+
query: search_query,
|
|
813
|
+
css_class: `json-tree-search-match`,
|
|
814
|
+
})}
|
|
815
|
+
>
|
|
816
|
+
<JsonNode node_key={root_label ?? null} {value} path={root_path} depth={0} />
|
|
817
|
+
</div>
|
|
818
|
+
|
|
819
|
+
{#if copy_feedback_path !== null}
|
|
820
|
+
<div
|
|
821
|
+
class="copy-feedback"
|
|
822
|
+
class:error={copy_feedback_error}
|
|
823
|
+
style={copy_feedback_pos
|
|
824
|
+
? `left: ${copy_feedback_pos.x}px; top: ${copy_feedback_pos.y - 24}px`
|
|
825
|
+
: `right: 8px; top: 8px`}
|
|
826
|
+
>
|
|
827
|
+
{copy_feedback_error ? `Copy failed` : `Copied!`}
|
|
828
|
+
</div>
|
|
829
|
+
{/if}
|
|
830
|
+
|
|
831
|
+
{#if context_menu_state}
|
|
832
|
+
<button
|
|
833
|
+
type="button"
|
|
834
|
+
class="context-menu-backdrop"
|
|
835
|
+
onclick={close_context_menu}
|
|
836
|
+
oncontextmenu={(ev) => {
|
|
837
|
+
ev.preventDefault()
|
|
838
|
+
close_context_menu()
|
|
839
|
+
}}
|
|
840
|
+
aria-label="Close context menu"
|
|
841
|
+
tabindex="-1"
|
|
842
|
+
>
|
|
843
|
+
</button>
|
|
844
|
+
<menu
|
|
845
|
+
class="context-menu"
|
|
846
|
+
style:left="{Math.min(context_menu_state.x, window.innerWidth - 180)}px"
|
|
847
|
+
style:top="{Math.min(context_menu_state.y, window.innerHeight - 200)}px"
|
|
848
|
+
>
|
|
849
|
+
<li>
|
|
850
|
+
<button
|
|
851
|
+
type="button"
|
|
852
|
+
onclick={() =>
|
|
853
|
+
ctx_menu_action((st) =>
|
|
854
|
+
copy_to_clipboard(st.path, serialize_for_copy(st.value))
|
|
855
|
+
)}
|
|
856
|
+
>
|
|
857
|
+
<Icon icon="Copy" style="width: 12px; height: 12px" /> Copy value
|
|
858
|
+
</button>
|
|
859
|
+
</li>
|
|
860
|
+
<li>
|
|
861
|
+
<button
|
|
862
|
+
type="button"
|
|
863
|
+
onclick={() => ctx_menu_action((st) => copy_to_clipboard(st.path, st.path))}
|
|
864
|
+
>
|
|
865
|
+
Copy path
|
|
866
|
+
</button>
|
|
867
|
+
</li>
|
|
868
|
+
<li class="separator"></li>
|
|
869
|
+
{#if context_menu_state.expandable}
|
|
870
|
+
<li>
|
|
871
|
+
<button
|
|
872
|
+
type="button"
|
|
873
|
+
onclick={() =>
|
|
874
|
+
ctx_menu_action((st) =>
|
|
875
|
+
st.is_collapsed
|
|
876
|
+
? toggle_collapse_recursive(st.path, false)
|
|
877
|
+
: collapse_children_only(st.path)
|
|
878
|
+
)}
|
|
879
|
+
>
|
|
880
|
+
{context_menu_state.is_collapsed ? `Expand` : `Collapse`} all children
|
|
881
|
+
</button>
|
|
882
|
+
</li>
|
|
883
|
+
<li class="separator"></li>
|
|
884
|
+
{/if}
|
|
885
|
+
<li>
|
|
886
|
+
<button
|
|
887
|
+
type="button"
|
|
888
|
+
onclick={() => ctx_menu_action((st) => toggle_pin(st.path))}
|
|
889
|
+
>
|
|
890
|
+
{pinned_paths.has(context_menu_state.path) ? `Unpin` : `Pin`} this path
|
|
891
|
+
</button>
|
|
892
|
+
</li>
|
|
893
|
+
</menu>
|
|
894
|
+
{/if}
|
|
895
|
+
</div>
|
|
896
|
+
|
|
897
|
+
<style>
|
|
898
|
+
::highlight(json-tree-search-match) {
|
|
899
|
+
background: var(--jt-search-match-bg, light-dark(#fff59d, #614d00));
|
|
900
|
+
color: inherit;
|
|
901
|
+
}
|
|
902
|
+
.json-tree {
|
|
903
|
+
/* Color variables with light-dark() for automatic theme support */
|
|
904
|
+
--jt-string: light-dark(#a31515, #ce9178);
|
|
905
|
+
--jt-number: light-dark(#098658, #b5cea8);
|
|
906
|
+
--jt-boolean: light-dark(#0000ff, #569cd6);
|
|
907
|
+
--jt-null: light-dark(#808080, #808080);
|
|
908
|
+
--jt-key: light-dark(#001080, #9cdcfe);
|
|
909
|
+
--jt-punctuation: light-dark(#000000, #d4d4d4);
|
|
910
|
+
--jt-arrow: light-dark(#6e6e6e, #858585);
|
|
911
|
+
--jt-preview: light-dark(#808080, #808080);
|
|
912
|
+
--jt-search-match-bg: light-dark(#fff59d, #614d00);
|
|
913
|
+
--jt-current-match-bg: light-dark(#ffcc80, #8a5600);
|
|
914
|
+
--jt-change-flash: light-dark(#c8e6c9, #1b5e20);
|
|
915
|
+
--jt-focus-bg: light-dark(#e3f2fd, #0d3a58);
|
|
916
|
+
--jt-hover-bg: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.08));
|
|
917
|
+
--jt-indent-guide: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));
|
|
918
|
+
--jt-header-bg: light-dark(rgba(0, 0, 0, 0.03), rgba(255, 255, 255, 0.05));
|
|
919
|
+
--jt-header-border: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));
|
|
920
|
+
/* Layout variables */
|
|
921
|
+
--jt-indent: 1.2em;
|
|
922
|
+
--jt-line-height: 1.5;
|
|
923
|
+
--jt-font-size: 13px;
|
|
924
|
+
--jt-font-family: 'SF Mono', Monaco, 'Courier New', monospace;
|
|
925
|
+
font-family: var(--jt-font-family);
|
|
926
|
+
font-size: var(--jt-font-size);
|
|
927
|
+
line-height: var(--jt-line-height);
|
|
928
|
+
position: relative;
|
|
929
|
+
background: var(--jt-bg, transparent);
|
|
930
|
+
border-radius: var(--jt-border-radius, 4px);
|
|
931
|
+
overflow: hidden;
|
|
932
|
+
}
|
|
933
|
+
/* --jt-header-bg, --jt-header-border, --jt-btn-bg, --jt-btn-hover-bg, --jt-btn-active-bg
|
|
934
|
+
intentionally removed in favor of transparent/opacity-based button styling.
|
|
935
|
+
Use --jt-hover-bg to customize the button hover background. */
|
|
936
|
+
.json-tree-header {
|
|
937
|
+
display: flex;
|
|
938
|
+
align-items: center;
|
|
939
|
+
gap: 8px;
|
|
940
|
+
padding: 6px 8px;
|
|
941
|
+
flex-wrap: wrap;
|
|
942
|
+
}
|
|
943
|
+
.search-wrapper {
|
|
944
|
+
display: flex;
|
|
945
|
+
align-items: center;
|
|
946
|
+
gap: 4px;
|
|
947
|
+
flex: 1;
|
|
948
|
+
min-width: 150px;
|
|
949
|
+
max-width: 300px;
|
|
950
|
+
background: var(--jt-search-bg, light-dark(white, rgba(0, 0, 0, 0.2)));
|
|
951
|
+
border: 1px solid
|
|
952
|
+
var(--jt-search-border, light-dark(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.15)));
|
|
953
|
+
border-radius: 4px;
|
|
954
|
+
padding: 2px 6px;
|
|
955
|
+
}
|
|
956
|
+
.search-input {
|
|
957
|
+
flex: 1;
|
|
958
|
+
border: none;
|
|
959
|
+
background: transparent;
|
|
960
|
+
font-size: 12px;
|
|
961
|
+
padding: 2px;
|
|
962
|
+
outline: none;
|
|
963
|
+
color: inherit;
|
|
964
|
+
}
|
|
965
|
+
.search-input::placeholder {
|
|
966
|
+
color: var(--jt-placeholder, light-dark(#999, #666));
|
|
967
|
+
}
|
|
968
|
+
.clear-search {
|
|
969
|
+
display: flex;
|
|
970
|
+
align-items: center;
|
|
971
|
+
justify-content: center;
|
|
972
|
+
padding: 2px;
|
|
973
|
+
border: none;
|
|
974
|
+
background: none;
|
|
975
|
+
cursor: pointer;
|
|
976
|
+
opacity: 0.6;
|
|
977
|
+
border-radius: 2px;
|
|
978
|
+
}
|
|
979
|
+
.clear-search:hover {
|
|
980
|
+
opacity: 1;
|
|
981
|
+
background: var(--jt-hover-bg);
|
|
982
|
+
}
|
|
983
|
+
.controls {
|
|
984
|
+
display: flex;
|
|
985
|
+
gap: 2px;
|
|
986
|
+
}
|
|
987
|
+
.divider {
|
|
988
|
+
width: 1px;
|
|
989
|
+
height: 16px;
|
|
990
|
+
background: var(--jt-header-border);
|
|
991
|
+
margin: 0 4px;
|
|
992
|
+
align-self: center;
|
|
993
|
+
}
|
|
994
|
+
.controls button {
|
|
995
|
+
display: flex;
|
|
996
|
+
align-items: center;
|
|
997
|
+
justify-content: center;
|
|
998
|
+
min-width: 24px;
|
|
999
|
+
height: 24px;
|
|
1000
|
+
padding: 2px 6px;
|
|
1001
|
+
border: none;
|
|
1002
|
+
background: transparent;
|
|
1003
|
+
border-radius: 3px;
|
|
1004
|
+
cursor: pointer;
|
|
1005
|
+
font-size: 11px;
|
|
1006
|
+
font-weight: 500;
|
|
1007
|
+
color: inherit;
|
|
1008
|
+
opacity: 0.6;
|
|
1009
|
+
transition: opacity 0.15s, background 0.15s;
|
|
1010
|
+
}
|
|
1011
|
+
.controls button:hover {
|
|
1012
|
+
opacity: 1;
|
|
1013
|
+
background: var(--jt-hover-bg);
|
|
1014
|
+
}
|
|
1015
|
+
.controls button.active {
|
|
1016
|
+
opacity: 1;
|
|
1017
|
+
}
|
|
1018
|
+
.match-nav {
|
|
1019
|
+
display: flex;
|
|
1020
|
+
align-items: center;
|
|
1021
|
+
gap: 2px;
|
|
1022
|
+
}
|
|
1023
|
+
.nav-btn {
|
|
1024
|
+
display: flex;
|
|
1025
|
+
align-items: center;
|
|
1026
|
+
justify-content: center;
|
|
1027
|
+
width: 20px;
|
|
1028
|
+
height: 20px;
|
|
1029
|
+
padding: 0;
|
|
1030
|
+
border: none;
|
|
1031
|
+
background: transparent;
|
|
1032
|
+
border-radius: 3px;
|
|
1033
|
+
cursor: pointer;
|
|
1034
|
+
color: inherit;
|
|
1035
|
+
opacity: 0.6;
|
|
1036
|
+
}
|
|
1037
|
+
.nav-btn:hover {
|
|
1038
|
+
opacity: 1;
|
|
1039
|
+
background: var(--jt-hover-bg);
|
|
1040
|
+
}
|
|
1041
|
+
.match-count {
|
|
1042
|
+
font-size: 11px;
|
|
1043
|
+
color: var(--jt-match-count-color, light-dark(#666, #aaa));
|
|
1044
|
+
white-space: nowrap;
|
|
1045
|
+
margin-left: 4px;
|
|
1046
|
+
}
|
|
1047
|
+
.path-breadcrumb {
|
|
1048
|
+
padding: 4px 8px;
|
|
1049
|
+
background: var(--jt-header-bg);
|
|
1050
|
+
border-bottom: 1px solid var(--jt-header-border);
|
|
1051
|
+
font-size: 11px;
|
|
1052
|
+
overflow: hidden;
|
|
1053
|
+
}
|
|
1054
|
+
.copy-path-btn {
|
|
1055
|
+
background: none;
|
|
1056
|
+
border: none;
|
|
1057
|
+
padding: 2px 4px;
|
|
1058
|
+
font: inherit;
|
|
1059
|
+
font-family: var(--jt-font-family);
|
|
1060
|
+
color: var(--jt-key, light-dark(#001080, #9cdcfe));
|
|
1061
|
+
cursor: pointer;
|
|
1062
|
+
border-radius: 2px;
|
|
1063
|
+
max-width: 100%;
|
|
1064
|
+
overflow: hidden;
|
|
1065
|
+
text-overflow: ellipsis;
|
|
1066
|
+
white-space: nowrap;
|
|
1067
|
+
display: block;
|
|
1068
|
+
}
|
|
1069
|
+
.copy-path-btn:hover {
|
|
1070
|
+
background: var(--jt-hover-bg);
|
|
1071
|
+
text-decoration: underline;
|
|
1072
|
+
}
|
|
1073
|
+
.json-tree-content {
|
|
1074
|
+
padding: var(--jt-content-padding, 8px);
|
|
1075
|
+
overflow: auto;
|
|
1076
|
+
max-height: var(--jt-max-height, none);
|
|
1077
|
+
}
|
|
1078
|
+
.copy-feedback {
|
|
1079
|
+
position: fixed;
|
|
1080
|
+
background: var(--success-color, #10b981);
|
|
1081
|
+
color: white;
|
|
1082
|
+
padding: 4px 8px;
|
|
1083
|
+
border-radius: 4px;
|
|
1084
|
+
font-size: 11px;
|
|
1085
|
+
animation: fade-in-out 1s ease-out forwards;
|
|
1086
|
+
pointer-events: none;
|
|
1087
|
+
z-index: 1002;
|
|
1088
|
+
white-space: nowrap;
|
|
1089
|
+
}
|
|
1090
|
+
.copy-feedback.error {
|
|
1091
|
+
background: var(--error-color, #ef4444);
|
|
1092
|
+
}
|
|
1093
|
+
@keyframes fade-in-out {
|
|
1094
|
+
0% {
|
|
1095
|
+
opacity: 0;
|
|
1096
|
+
transform: translateY(-4px);
|
|
1097
|
+
}
|
|
1098
|
+
15% {
|
|
1099
|
+
opacity: 1;
|
|
1100
|
+
transform: translateY(0);
|
|
1101
|
+
}
|
|
1102
|
+
85% {
|
|
1103
|
+
opacity: 1;
|
|
1104
|
+
}
|
|
1105
|
+
100% {
|
|
1106
|
+
opacity: 0;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
.context-menu-backdrop {
|
|
1110
|
+
position: fixed;
|
|
1111
|
+
inset: 0;
|
|
1112
|
+
z-index: 1000;
|
|
1113
|
+
background: none;
|
|
1114
|
+
border: none;
|
|
1115
|
+
padding: 0;
|
|
1116
|
+
margin: 0;
|
|
1117
|
+
cursor: default;
|
|
1118
|
+
}
|
|
1119
|
+
.context-menu {
|
|
1120
|
+
position: fixed;
|
|
1121
|
+
z-index: 1001;
|
|
1122
|
+
background: var(--jt-ctx-bg, light-dark(white, #2d2d2d));
|
|
1123
|
+
border: 1px solid
|
|
1124
|
+
var(--jt-ctx-border, light-dark(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.15)));
|
|
1125
|
+
border-radius: 6px;
|
|
1126
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
1127
|
+
padding: 4px 0;
|
|
1128
|
+
min-width: 160px;
|
|
1129
|
+
font-size: 12px;
|
|
1130
|
+
list-style: none;
|
|
1131
|
+
margin: 0;
|
|
1132
|
+
}
|
|
1133
|
+
.context-menu button {
|
|
1134
|
+
display: flex;
|
|
1135
|
+
align-items: center;
|
|
1136
|
+
gap: 8px;
|
|
1137
|
+
width: 100%;
|
|
1138
|
+
padding: 6px 12px;
|
|
1139
|
+
border: none;
|
|
1140
|
+
background: none;
|
|
1141
|
+
color: inherit;
|
|
1142
|
+
cursor: pointer;
|
|
1143
|
+
text-align: left;
|
|
1144
|
+
font: inherit;
|
|
1145
|
+
}
|
|
1146
|
+
.context-menu button:hover {
|
|
1147
|
+
background: var(
|
|
1148
|
+
--jt-ctx-hover,
|
|
1149
|
+
light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.1))
|
|
1150
|
+
);
|
|
1151
|
+
}
|
|
1152
|
+
.context-menu .separator {
|
|
1153
|
+
height: 1px;
|
|
1154
|
+
margin: 4px 8px;
|
|
1155
|
+
background: var(
|
|
1156
|
+
--jt-ctx-border,
|
|
1157
|
+
light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1))
|
|
1158
|
+
);
|
|
1159
|
+
}
|
|
1160
|
+
.pinned-panel :where(button) {
|
|
1161
|
+
background: none;
|
|
1162
|
+
border: none;
|
|
1163
|
+
cursor: pointer;
|
|
1164
|
+
padding: 0;
|
|
1165
|
+
font: inherit;
|
|
1166
|
+
color: inherit;
|
|
1167
|
+
}
|
|
1168
|
+
.pinned-panel {
|
|
1169
|
+
border-bottom: 1px solid var(--jt-header-border);
|
|
1170
|
+
padding: 4px 8px;
|
|
1171
|
+
background: var(--jt-header-bg);
|
|
1172
|
+
font-size: 11px;
|
|
1173
|
+
max-height: 120px;
|
|
1174
|
+
overflow-y: auto;
|
|
1175
|
+
}
|
|
1176
|
+
.pinned-header {
|
|
1177
|
+
display: flex;
|
|
1178
|
+
align-items: center;
|
|
1179
|
+
justify-content: space-between;
|
|
1180
|
+
padding: 2px 0;
|
|
1181
|
+
font-weight: 500;
|
|
1182
|
+
opacity: 0.7;
|
|
1183
|
+
}
|
|
1184
|
+
.pinned-clear-btn {
|
|
1185
|
+
font-size: 10px;
|
|
1186
|
+
opacity: 0.6;
|
|
1187
|
+
padding: 1px 4px;
|
|
1188
|
+
}
|
|
1189
|
+
.pinned-clear-btn:hover {
|
|
1190
|
+
opacity: 1;
|
|
1191
|
+
text-decoration: underline;
|
|
1192
|
+
}
|
|
1193
|
+
.pinned-item {
|
|
1194
|
+
display: flex;
|
|
1195
|
+
align-items: center;
|
|
1196
|
+
gap: 4px;
|
|
1197
|
+
padding: 2px 4px;
|
|
1198
|
+
border-radius: 2px;
|
|
1199
|
+
}
|
|
1200
|
+
.pinned-item:hover {
|
|
1201
|
+
background: var(--jt-hover-bg);
|
|
1202
|
+
}
|
|
1203
|
+
.pinned-path {
|
|
1204
|
+
color: var(--jt-key, light-dark(#001080, #9cdcfe));
|
|
1205
|
+
font-family: var(--jt-font-family);
|
|
1206
|
+
white-space: nowrap;
|
|
1207
|
+
overflow: hidden;
|
|
1208
|
+
text-overflow: ellipsis;
|
|
1209
|
+
max-width: 200px;
|
|
1210
|
+
}
|
|
1211
|
+
.pinned-path:hover {
|
|
1212
|
+
text-decoration: underline;
|
|
1213
|
+
}
|
|
1214
|
+
.pinned-value {
|
|
1215
|
+
color: var(--jt-preview, light-dark(#808080, #808080));
|
|
1216
|
+
font-style: italic;
|
|
1217
|
+
white-space: nowrap;
|
|
1218
|
+
overflow: hidden;
|
|
1219
|
+
text-overflow: ellipsis;
|
|
1220
|
+
flex: 1;
|
|
1221
|
+
}
|
|
1222
|
+
.unpin-btn {
|
|
1223
|
+
padding: 0 2px;
|
|
1224
|
+
opacity: 0.5;
|
|
1225
|
+
font-size: 10px;
|
|
1226
|
+
}
|
|
1227
|
+
.unpin-btn:hover {
|
|
1228
|
+
opacity: 1;
|
|
1229
|
+
}
|
|
1230
|
+
</style>
|