@health-samurai/react-components 0.0.0-alpha.2 → 0.0.0-alpha.21
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/LICENSE +21 -0
- package/README.md +102 -1
- package/dist/bundle.css +2349 -754
- package/dist/src/components/button-dropdown.d.ts +10 -0
- package/dist/src/components/button-dropdown.d.ts.map +1 -0
- package/dist/src/components/button-dropdown.js +70 -0
- package/dist/src/components/button-dropdown.js.map +1 -0
- package/dist/src/components/button-dropdown.stories.js +48 -0
- package/dist/src/components/button-dropdown.stories.js.map +1 -0
- package/dist/src/components/code-editor/fhir-autocomplete.d.ts +70 -0
- package/dist/src/components/code-editor/fhir-autocomplete.d.ts.map +1 -0
- package/dist/src/components/code-editor/fhir-autocomplete.js +1850 -0
- package/dist/src/components/code-editor/fhir-autocomplete.js.map +1 -0
- package/dist/src/components/code-editor/fhir-autocomplete.test.js +1099 -0
- package/dist/src/components/code-editor/fhir-autocomplete.test.js.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.d.ts +3 -0
- package/dist/src/components/code-editor/http/grammar/http.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.grammar +74 -0
- package/dist/src/components/code-editor/http/grammar/http.js +38 -0
- package/dist/src/components/code-editor/http/grammar/http.js.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.d.ts +2 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.js +4 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.js.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.test.js +80 -0
- package/dist/src/components/code-editor/http/grammar/http.test.js.map +1 -0
- package/dist/src/components/code-editor/http/index.d.ts +12 -0
- package/dist/src/components/code-editor/http/index.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/index.js +486 -0
- package/dist/src/components/code-editor/http/index.js.map +1 -0
- package/dist/src/components/code-editor/index.d.ts +39 -1
- package/dist/src/components/code-editor/index.d.ts.map +1 -1
- package/dist/src/components/code-editor/index.js +1792 -45
- package/dist/src/components/code-editor/index.js.map +1 -1
- package/dist/src/components/code-editor/json-ast.d.ts +46 -0
- package/dist/src/components/code-editor/json-ast.d.ts.map +1 -0
- package/dist/src/components/code-editor/json-ast.js +465 -0
- package/dist/src/components/code-editor/json-ast.js.map +1 -0
- package/dist/src/components/code-editor/json-ast.test.js +206 -0
- package/dist/src/components/code-editor/json-ast.test.js.map +1 -0
- package/dist/src/components/code-editor/sql-completion.d.ts +22 -0
- package/dist/src/components/code-editor/sql-completion.d.ts.map +1 -0
- package/dist/src/components/code-editor/sql-completion.js +897 -0
- package/dist/src/components/code-editor/sql-completion.js.map +1 -0
- package/dist/src/components/code-editor.stories.js +280 -3
- package/dist/src/components/code-editor.stories.js.map +1 -1
- package/dist/src/components/copy-icon.d.ts +5 -1
- package/dist/src/components/copy-icon.d.ts.map +1 -1
- package/dist/src/components/copy-icon.js +41 -3
- package/dist/src/components/copy-icon.js.map +1 -1
- package/dist/src/components/data-table.d.ts +9 -0
- package/dist/src/components/data-table.d.ts.map +1 -0
- package/dist/src/components/data-table.js +66 -0
- package/dist/src/components/data-table.js.map +1 -0
- package/dist/src/components/data-table.stories.js +240 -0
- package/dist/src/components/data-table.stories.js.map +1 -0
- package/dist/src/components/date-picker-input.d.ts +10 -0
- package/dist/src/components/date-picker-input.d.ts.map +1 -0
- package/dist/src/components/date-picker-input.js +90 -0
- package/dist/src/components/date-picker-input.js.map +1 -0
- package/dist/src/components/date-picker-input.stories.js +76 -0
- package/dist/src/components/date-picker-input.stories.js.map +1 -0
- package/dist/src/components/fhir-structure-view.d.ts +34 -0
- package/dist/src/components/fhir-structure-view.d.ts.map +1 -0
- package/dist/src/components/fhir-structure-view.js +230 -0
- package/dist/src/components/fhir-structure-view.js.map +1 -0
- package/dist/src/components/fhir-structure-view.stories.js +447 -0
- package/dist/src/components/fhir-structure-view.stories.js.map +1 -0
- package/dist/src/components/icon-button.d.ts +12 -0
- package/dist/src/components/icon-button.d.ts.map +1 -0
- package/dist/src/components/icon-button.js +41 -0
- package/dist/src/components/icon-button.js.map +1 -0
- package/dist/src/components/icon-button.stories.js +157 -0
- package/dist/src/components/icon-button.stories.js.map +1 -0
- package/dist/src/components/operation-outcome-view.d.ts +27 -0
- package/dist/src/components/operation-outcome-view.d.ts.map +1 -0
- package/dist/src/components/operation-outcome-view.js +198 -0
- package/dist/src/components/operation-outcome-view.js.map +1 -0
- package/dist/src/components/operation-outcome-view.stories.js +207 -0
- package/dist/src/components/operation-outcome-view.stories.js.map +1 -0
- package/dist/src/components/request-line-editor.d.ts +13 -35
- package/dist/src/components/request-line-editor.d.ts.map +1 -1
- package/dist/src/components/request-line-editor.js +73 -49
- package/dist/src/components/request-line-editor.js.map +1 -1
- package/dist/src/components/request-line-editor.stories.js +17 -53
- package/dist/src/components/request-line-editor.stories.js.map +1 -1
- package/dist/src/components/sandbox.d.ts +13 -0
- package/dist/src/components/sandbox.d.ts.map +1 -0
- package/dist/src/components/sandbox.js +107 -0
- package/dist/src/components/sandbox.js.map +1 -0
- package/dist/src/components/sandbox.stories.js +126 -0
- package/dist/src/components/sandbox.stories.js.map +1 -0
- package/dist/src/components/segment-control.d.ts +13 -0
- package/dist/src/components/segment-control.d.ts.map +1 -0
- package/dist/src/components/segment-control.js +33 -0
- package/dist/src/components/segment-control.js.map +1 -0
- package/dist/src/components/segment-control.stories.js +68 -0
- package/dist/src/components/segment-control.stories.js.map +1 -0
- package/dist/src/components/split-button.d.ts +12 -0
- package/dist/src/components/split-button.d.ts.map +1 -0
- package/dist/src/components/split-button.js +33 -0
- package/dist/src/components/split-button.js.map +1 -0
- package/dist/src/components/split-button.stories.js +84 -0
- package/dist/src/components/split-button.stories.js.map +1 -0
- package/dist/src/components/tag.d.ts +16 -0
- package/dist/src/components/tag.d.ts.map +1 -0
- package/dist/src/components/tag.js +198 -0
- package/dist/src/components/tag.js.map +1 -0
- package/dist/src/components/tag.stories.js +459 -0
- package/dist/src/components/tag.stories.js.map +1 -0
- package/dist/src/components/tile.d.ts +15 -0
- package/dist/src/components/tile.d.ts.map +1 -0
- package/dist/src/components/tile.js +76 -0
- package/dist/src/components/tile.js.map +1 -0
- package/dist/src/components/tile.stories.js +167 -0
- package/dist/src/components/tile.stories.js.map +1 -0
- package/dist/src/components/toolbar.d.ts +18 -0
- package/dist/src/components/toolbar.d.ts.map +1 -0
- package/dist/src/components/toolbar.js +61 -0
- package/dist/src/components/toolbar.js.map +1 -0
- package/dist/src/components/toolbar.stories.js +69 -0
- package/dist/src/components/toolbar.stories.js.map +1 -0
- package/dist/src/components/tree-view.d.ts +47 -0
- package/dist/src/components/tree-view.d.ts.map +1 -0
- package/dist/src/components/tree-view.js +122 -0
- package/dist/src/components/tree-view.js.map +1 -0
- package/dist/src/components/tree-view.stories.js +283 -0
- package/dist/src/components/tree-view.stories.js.map +1 -0
- package/dist/src/icons.d.ts +11 -0
- package/dist/src/icons.d.ts.map +1 -0
- package/dist/src/icons.js +328 -0
- package/dist/src/icons.js.map +1 -0
- package/dist/src/index.css +358 -74
- package/dist/src/index.d.ts +17 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +17 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/shadcn/components/ui/accordion.d.ts +2 -2
- package/dist/src/shadcn/components/ui/accordion.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/accordion.js +35 -9
- package/dist/src/shadcn/components/ui/accordion.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.d.ts +12 -4
- package/dist/src/shadcn/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.js +128 -18
- package/dist/src/shadcn/components/ui/alert-dialog.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert-dialog.stories.js +269 -19
- package/dist/src/shadcn/components/ui/alert-dialog.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert.d.ts +29 -6
- package/dist/src/shadcn/components/ui/alert.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/alert.js +50 -19
- package/dist/src/shadcn/components/ui/alert.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert.stories.js +140 -36
- package/dist/src/shadcn/components/ui/alert.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.js +1 -0
- package/dist/src/shadcn/components/ui/aspect-ratio.js.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.js +4 -3
- package/dist/src/shadcn/components/ui/avatar.js.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.stories.js +68 -2
- package/dist/src/shadcn/components/ui/avatar.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/badge.d.ts +1 -1
- package/dist/src/shadcn/components/ui/badge.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/badge.js +16 -5
- package/dist/src/shadcn/components/ui/badge.js.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.d.ts +5 -2
- package/dist/src/shadcn/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.js +98 -13
- package/dist/src/shadcn/components/ui/breadcrumb.js.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.stories.js +205 -45
- package/dist/src/shadcn/components/ui/breadcrumb.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/button.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/button.js +65 -11
- package/dist/src/shadcn/components/ui/button.js.map +1 -1
- package/dist/src/shadcn/components/ui/button.stories.js +99 -17
- package/dist/src/shadcn/components/ui/button.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/calendar.d.ts +1 -1
- package/dist/src/shadcn/components/ui/calendar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/calendar.js +1 -0
- package/dist/src/shadcn/components/ui/calendar.js.map +1 -1
- package/dist/src/shadcn/components/ui/card.d.ts +5 -1
- package/dist/src/shadcn/components/ui/card.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/card.js +28 -7
- package/dist/src/shadcn/components/ui/card.js.map +1 -1
- package/dist/src/shadcn/components/ui/card.stories.js +23 -2
- package/dist/src/shadcn/components/ui/card.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/carousel.d.ts +1 -1
- package/dist/src/shadcn/components/ui/carousel.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/carousel.js +1 -0
- package/dist/src/shadcn/components/ui/carousel.js.map +1 -1
- package/dist/src/shadcn/components/ui/chart.d.ts +5 -5
- package/dist/src/shadcn/components/ui/chart.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/chart.js +4 -3
- package/dist/src/shadcn/components/ui/chart.js.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.d.ts +5 -1
- package/dist/src/shadcn/components/ui/checkbox.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.js +46 -6
- package/dist/src/shadcn/components/ui/checkbox.js.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.stories.js +156 -46
- package/dist/src/shadcn/components/ui/checkbox.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/combobox.d.ts +29 -0
- package/dist/src/shadcn/components/ui/combobox.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/combobox.js +226 -0
- package/dist/src/shadcn/components/ui/combobox.js.map +1 -0
- package/dist/src/shadcn/components/ui/combobox.stories.js +167 -0
- package/dist/src/shadcn/components/ui/combobox.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/command.d.ts +4 -2
- package/dist/src/shadcn/components/ui/command.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/command.js +75 -13
- package/dist/src/shadcn/components/ui/command.js.map +1 -1
- package/dist/src/shadcn/components/ui/command.stories.js +277 -57
- package/dist/src/shadcn/components/ui/command.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/context-menu.d.ts +7 -3
- package/dist/src/shadcn/components/ui/context-menu.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/context-menu.js +120 -13
- package/dist/src/shadcn/components/ui/context-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/dialog.js +35 -7
- package/dist/src/shadcn/components/ui/dialog.js.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.js +27 -5
- package/dist/src/shadcn/components/ui/drawer.js.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.d.ts +7 -3
- package/dist/src/shadcn/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.js +122 -14
- package/dist/src/shadcn/components/ui/dropdown-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.js +22 -5
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/form.d.ts +2 -2
- package/dist/src/shadcn/components/ui/form.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/form.js +17 -8
- package/dist/src/shadcn/components/ui/form.js.map +1 -1
- package/dist/src/shadcn/components/ui/hover-card.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/hover-card.js +2 -1
- package/dist/src/shadcn/components/ui/hover-card.js.map +1 -1
- package/dist/src/shadcn/components/ui/input-otp.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/input-otp.js +1 -0
- package/dist/src/shadcn/components/ui/input-otp.js.map +1 -1
- package/dist/src/shadcn/components/ui/input.d.ts +3 -1
- package/dist/src/shadcn/components/ui/input.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/input.js +126 -17
- package/dist/src/shadcn/components/ui/input.js.map +1 -1
- package/dist/src/shadcn/components/ui/input.stories.js +218 -29
- package/dist/src/shadcn/components/ui/input.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/label.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/label.js +9 -1
- package/dist/src/shadcn/components/ui/label.js.map +1 -1
- package/dist/src/shadcn/components/ui/menubar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/menubar.js +35 -13
- package/dist/src/shadcn/components/ui/menubar.js.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.d.ts +9 -2
- package/dist/src/shadcn/components/ui/pagination.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.js +41 -24
- package/dist/src/shadcn/components/ui/pagination.js.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.stories.js +44 -37
- package/dist/src/shadcn/components/ui/pagination.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/popover.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/popover.js +13 -1
- package/dist/src/shadcn/components/ui/popover.js.map +1 -1
- package/dist/src/shadcn/components/ui/progress.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/progress.js +6 -2
- package/dist/src/shadcn/components/ui/progress.js.map +1 -1
- package/dist/src/shadcn/components/ui/radio-button-group.d.ts +21 -0
- package/dist/src/shadcn/components/ui/radio-button-group.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/radio-button-group.js +148 -0
- package/dist/src/shadcn/components/ui/radio-button-group.js.map +1 -0
- package/dist/src/shadcn/components/ui/radio-button-group.stories.js +283 -0
- package/dist/src/shadcn/components/ui/radio-button-group.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/radio-group.d.ts +5 -1
- package/dist/src/shadcn/components/ui/radio-group.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.js +40 -7
- package/dist/src/shadcn/components/ui/radio-group.js.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.stories.js +107 -32
- package/dist/src/shadcn/components/ui/radio-group.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.js +2 -1
- package/dist/src/shadcn/components/ui/resizable.js.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.stories.js +2 -2
- package/dist/src/shadcn/components/ui/resizable.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/scroll-area.js +10 -3
- package/dist/src/shadcn/components/ui/scroll-area.js.map +1 -1
- package/dist/src/shadcn/components/ui/select.d.ts +1 -2
- package/dist/src/shadcn/components/ui/select.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/select.js +49 -19
- package/dist/src/shadcn/components/ui/select.js.map +1 -1
- package/dist/src/shadcn/components/ui/select.stories.js +193 -70
- package/dist/src/shadcn/components/ui/select.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/separator.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/separator.js +8 -1
- package/dist/src/shadcn/components/ui/separator.js.map +1 -1
- package/dist/src/shadcn/components/ui/sheet.js +1 -1
- package/dist/src/shadcn/components/ui/sheet.js.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.d.ts +4 -4
- package/dist/src/shadcn/components/ui/sidebar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.js +21 -6
- package/dist/src/shadcn/components/ui/sidebar.js.map +1 -1
- package/dist/src/shadcn/components/ui/skeleton.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/skeleton.js +3 -1
- package/dist/src/shadcn/components/ui/skeleton.js.map +1 -1
- package/dist/src/shadcn/components/ui/slider.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/slider.js +35 -4
- package/dist/src/shadcn/components/ui/slider.js.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.d.ts +24 -2
- package/dist/src/shadcn/components/ui/sonner.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.js +127 -9
- package/dist/src/shadcn/components/ui/sonner.js.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.stories.js +251 -12
- package/dist/src/shadcn/components/ui/sonner.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/switch.d.ts +7 -1
- package/dist/src/shadcn/components/ui/switch.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/switch.js +55 -3
- package/dist/src/shadcn/components/ui/switch.js.map +1 -1
- package/dist/src/shadcn/components/ui/switch.stories.js +84 -9
- package/dist/src/shadcn/components/ui/switch.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/table.d.ts +23 -6
- package/dist/src/shadcn/components/ui/table.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/table.js +65 -20
- package/dist/src/shadcn/components/ui/table.js.map +1 -1
- package/dist/src/shadcn/components/ui/table.stories.js +217 -97
- package/dist/src/shadcn/components/ui/table.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.d.ts +30 -5
- package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.js +470 -23
- package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.stories.js +405 -181
- package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.d.ts +8 -1
- package/dist/src/shadcn/components/ui/textarea.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.js +30 -2
- package/dist/src/shadcn/components/ui/textarea.js.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.stories.js +85 -4
- package/dist/src/shadcn/components/ui/textarea.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle-group.d.ts +3 -3
- package/dist/src/shadcn/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/toggle-group.js +14 -12
- package/dist/src/shadcn/components/ui/toggle-group.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.d.ts +3 -4
- package/dist/src/shadcn/components/ui/toggle.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.js +44 -16
- package/dist/src/shadcn/components/ui/toggle.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.stories.js +130 -7
- package/dist/src/shadcn/components/ui/toggle.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.js +12 -1
- package/dist/src/shadcn/components/ui/tooltip.js.map +1 -1
- package/dist/src/shadcn/components/ui/tree.d.ts +29 -0
- package/dist/src/shadcn/components/ui/tree.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/tree.js +135 -0
- package/dist/src/shadcn/components/ui/tree.js.map +1 -0
- package/dist/src/shadcn/shadcn.css +4 -4
- package/dist/src/tokens.css +50 -20
- package/dist/src/typography.css +78 -15
- package/package.json +84 -64
- package/src/components/button-dropdown.stories.tsx +41 -0
- package/src/components/button-dropdown.tsx +97 -0
- package/src/components/code-editor/fhir-autocomplete.test.ts +993 -0
- package/src/components/code-editor/fhir-autocomplete.ts +2322 -0
- package/src/components/code-editor/http/grammar/http.grammar +74 -0
- package/src/components/code-editor/http/grammar/http.terms.ts +9 -0
- package/src/components/code-editor/http/grammar/http.test.ts +110 -0
- package/src/components/code-editor/http/grammar/http.ts +21 -0
- package/src/components/code-editor/http/index.ts +424 -0
- package/src/components/code-editor/index.tsx +1944 -42
- package/src/components/code-editor/json-ast.test.ts +230 -0
- package/src/components/code-editor/json-ast.ts +590 -0
- package/src/components/code-editor/sql-completion.ts +1112 -0
- package/src/components/code-editor.stories.tsx +325 -2
- package/src/components/copy-icon.tsx +57 -3
- package/src/components/data-table.stories.tsx +91 -0
- package/src/components/data-table.tsx +126 -0
- package/src/components/date-picker-input.stories.tsx +79 -0
- package/src/components/date-picker-input.tsx +104 -0
- package/src/components/fhir-structure-view.stories.tsx +439 -0
- package/src/components/fhir-structure-view.tsx +233 -0
- package/src/components/icon-button.stories.tsx +86 -0
- package/src/components/icon-button.tsx +57 -0
- package/src/components/operation-outcome-view.stories.tsx +163 -0
- package/src/components/operation-outcome-view.tsx +254 -0
- package/src/components/request-line-editor.stories.tsx +17 -27
- package/src/components/request-line-editor.tsx +103 -61
- package/src/components/sandbox.stories.tsx +131 -0
- package/src/components/sandbox.tsx +191 -0
- package/src/components/segment-control.stories.tsx +61 -0
- package/src/components/segment-control.tsx +83 -0
- package/src/components/split-button.stories.tsx +68 -0
- package/src/components/split-button.tsx +74 -0
- package/src/components/tag.stories.tsx +371 -0
- package/src/components/tag.tsx +236 -0
- package/src/components/tile.stories.tsx +149 -0
- package/src/components/tile.tsx +105 -0
- package/src/components/toolbar.stories.tsx +64 -0
- package/src/components/toolbar.tsx +98 -0
- package/src/components/tree-view.stories.tsx +265 -0
- package/src/components/tree-view.tsx +246 -0
- package/src/icons.tsx +331 -0
- package/src/index.css +358 -74
- package/src/index.tsx +17 -3
- package/src/shadcn/components/ui/accordion.tsx +91 -10
- package/src/shadcn/components/ui/alert-dialog.stories.tsx +209 -15
- package/src/shadcn/components/ui/alert-dialog.tsx +236 -26
- package/src/shadcn/components/ui/alert.stories.tsx +120 -21
- package/src/shadcn/components/ui/alert.tsx +125 -28
- package/src/shadcn/components/ui/aspect-ratio.tsx +1 -0
- package/src/shadcn/components/ui/avatar.stories.tsx +74 -1
- package/src/shadcn/components/ui/avatar.tsx +22 -6
- package/src/shadcn/components/ui/badge.tsx +67 -18
- package/src/shadcn/components/ui/breadcrumb.stories.tsx +161 -41
- package/src/shadcn/components/ui/breadcrumb.tsx +172 -23
- package/src/shadcn/components/ui/button.stories.tsx +106 -18
- package/src/shadcn/components/ui/button.tsx +151 -55
- package/src/shadcn/components/ui/calendar.tsx +1 -0
- package/src/shadcn/components/ui/card.stories.tsx +17 -3
- package/src/shadcn/components/ui/card.tsx +89 -14
- package/src/shadcn/components/ui/carousel.tsx +1 -0
- package/src/shadcn/components/ui/chart.tsx +9 -5
- package/src/shadcn/components/ui/checkbox.stories.tsx +78 -30
- package/src/shadcn/components/ui/checkbox.tsx +91 -8
- package/src/shadcn/components/ui/combobox.stories.tsx +148 -0
- package/src/shadcn/components/ui/combobox.tsx +324 -0
- package/src/shadcn/components/ui/command.stories.tsx +184 -39
- package/src/shadcn/components/ui/command.tsx +218 -37
- package/src/shadcn/components/ui/context-menu.tsx +333 -40
- package/src/shadcn/components/ui/dialog.tsx +101 -13
- package/src/shadcn/components/ui/drawer.tsx +94 -18
- package/src/shadcn/components/ui/dropdown-menu.stories.tsx +18 -2
- package/src/shadcn/components/ui/dropdown-menu.tsx +334 -68
- package/src/shadcn/components/ui/form.tsx +22 -11
- package/src/shadcn/components/ui/hover-card.tsx +2 -1
- package/src/shadcn/components/ui/input-otp.tsx +1 -0
- package/src/shadcn/components/ui/input.stories.tsx +235 -27
- package/src/shadcn/components/ui/input.tsx +400 -29
- package/src/shadcn/components/ui/label.tsx +22 -4
- package/src/shadcn/components/ui/menubar.tsx +188 -43
- package/src/shadcn/components/ui/pagination.stories.tsx +8 -2
- package/src/shadcn/components/ui/pagination.tsx +65 -8
- package/src/shadcn/components/ui/popover.tsx +36 -4
- package/src/shadcn/components/ui/progress.tsx +21 -5
- package/src/shadcn/components/ui/radio-button-group.stories.tsx +247 -0
- package/src/shadcn/components/ui/radio-button-group.tsx +188 -0
- package/src/shadcn/components/ui/radio-group.stories.tsx +70 -14
- package/src/shadcn/components/ui/radio-group.tsx +85 -9
- package/src/shadcn/components/ui/resizable.stories.tsx +2 -2
- package/src/shadcn/components/ui/resizable.tsx +2 -1
- package/src/shadcn/components/ui/scroll-area.tsx +34 -5
- package/src/shadcn/components/ui/select.stories.tsx +108 -32
- package/src/shadcn/components/ui/select.tsx +182 -36
- package/src/shadcn/components/ui/separator.tsx +16 -5
- package/src/shadcn/components/ui/sheet.tsx +1 -1
- package/src/shadcn/components/ui/sidebar.tsx +69 -26
- package/src/shadcn/components/ui/skeleton.tsx +4 -1
- package/src/shadcn/components/ui/slider.tsx +83 -11
- package/src/shadcn/components/ui/sonner.stories.tsx +238 -17
- package/src/shadcn/components/ui/sonner.tsx +254 -11
- package/src/shadcn/components/ui/switch.stories.tsx +52 -5
- package/src/shadcn/components/ui/switch.tsx +92 -7
- package/src/shadcn/components/ui/table.stories.tsx +252 -72
- package/src/shadcn/components/ui/table.tsx +204 -26
- package/src/shadcn/components/ui/tabs.stories.tsx +235 -123
- package/src/shadcn/components/ui/tabs.tsx +694 -36
- package/src/shadcn/components/ui/textarea.stories.tsx +94 -2
- package/src/shadcn/components/ui/textarea.tsx +70 -5
- package/src/shadcn/components/ui/toggle-group.tsx +35 -13
- package/src/shadcn/components/ui/toggle.stories.tsx +92 -5
- package/src/shadcn/components/ui/toggle.tsx +96 -23
- package/src/shadcn/components/ui/tooltip.tsx +34 -8
- package/src/shadcn/components/ui/tree.tsx +257 -0
- package/src/shadcn/shadcn.css +4 -4
- package/src/tokens.css +50 -20
- package/src/typography.css +78 -15
- package/dist/src/components/code-editor.stories.d.ts +0 -7
- package/dist/src/components/code-editor.stories.d.ts.map +0 -1
- package/dist/src/components/request-line-editor.stories.d.ts +0 -11
- package/dist/src/components/request-line-editor.stories.d.ts.map +0 -1
- package/dist/src/index.stories.d.ts +0 -14
- package/dist/src/index.stories.d.ts.map +0 -1
- package/dist/src/index.stories.js +0 -19
- package/dist/src/index.stories.js.map +0 -1
- package/dist/src/shadcn/components/ui/accordion.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/accordion.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/alert-dialog.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/alert-dialog.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/alert.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/alert.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/aspect-ratio.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/aspect-ratio.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/avatar.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/avatar.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/badge.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/badge.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/breadcrumb.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/breadcrumb.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/button.stories.d.ts +0 -23
- package/dist/src/shadcn/components/ui/button.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/calendar.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/calendar.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/card.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/card.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/carousel.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/carousel.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/chart.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/chart.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/checkbox.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/checkbox.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/collapsible.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/collapsible.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/command.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/command.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/context-menu.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/context-menu.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/dialog.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/dialog.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/drawer.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/drawer.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/dropdown-menu.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/form.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/form.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/hover-card.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/hover-card.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/input-otp.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/input-otp.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/input.stories.d.ts +0 -18
- package/dist/src/shadcn/components/ui/input.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/label.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/label.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/menubar.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/menubar.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/navigation-menu.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/navigation-menu.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/pagination.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/pagination.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/popover.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/popover.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/progress.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/progress.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/radio-group.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/radio-group.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/resizable.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/resizable.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/scroll-area.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/scroll-area.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/select.stories.d.ts +0 -11
- package/dist/src/shadcn/components/ui/select.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/separator.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/separator.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/sheet.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/sheet.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/sidebar.stories.d.ts +0 -11
- package/dist/src/shadcn/components/ui/sidebar.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/skeleton.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/skeleton.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/slider.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/slider.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/sonner.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/sonner.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/switch.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/switch.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/table.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/table.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/tabs.stories.d.ts +0 -32
- package/dist/src/shadcn/components/ui/tabs.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/textarea.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/textarea.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/toggle-group.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/toggle-group.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/toggle.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/toggle.stories.d.ts.map +0 -1
- package/dist/src/shadcn/components/ui/tooltip.stories.d.ts +0 -8
- package/dist/src/shadcn/components/ui/tooltip.stories.d.ts.map +0 -1
- package/src/index.stories.tsx +0 -21
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
// ── HTTP mode helper ───────────────────────────────────────────────────
|
|
2
|
+
const HTTP_METHOD_RE = /^(GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD)\s/;
|
|
3
|
+
function detectJsonStart(doc) {
|
|
4
|
+
const firstLine = doc.slice(0, doc.indexOf("\n") >>> 0).trimStart();
|
|
5
|
+
if (HTTP_METHOD_RE.test(firstLine)) {
|
|
6
|
+
const bodyStart = doc.indexOf("\n\n");
|
|
7
|
+
if (bodyStart === -1) return 0;
|
|
8
|
+
return bodyStart + 2;
|
|
9
|
+
}
|
|
10
|
+
return 0;
|
|
11
|
+
}
|
|
12
|
+
// ── JSON path at cursor ────────────────────────────────────────────────
|
|
13
|
+
function getJsonPathAtCursor(doc, pos) {
|
|
14
|
+
const path = [];
|
|
15
|
+
const arrayKeyStack = [];
|
|
16
|
+
let inString = false;
|
|
17
|
+
let isEscaped = false;
|
|
18
|
+
let currentKey = "";
|
|
19
|
+
let collectingKey = false;
|
|
20
|
+
let lastKey = "";
|
|
21
|
+
for(let i = 0; i < pos; i++){
|
|
22
|
+
const ch = doc[i];
|
|
23
|
+
if (isEscaped) {
|
|
24
|
+
if (collectingKey) currentKey += ch;
|
|
25
|
+
isEscaped = false;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (ch === "\\") {
|
|
29
|
+
isEscaped = true;
|
|
30
|
+
if (collectingKey) currentKey += ch;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (ch === '"') {
|
|
34
|
+
if (!inString) {
|
|
35
|
+
inString = true;
|
|
36
|
+
collectingKey = true;
|
|
37
|
+
currentKey = "";
|
|
38
|
+
} else {
|
|
39
|
+
inString = false;
|
|
40
|
+
if (collectingKey) {
|
|
41
|
+
lastKey = currentKey;
|
|
42
|
+
collectingKey = false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (inString) {
|
|
48
|
+
if (collectingKey) currentKey += ch;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (ch === "[") {
|
|
52
|
+
arrayKeyStack.push(lastKey);
|
|
53
|
+
lastKey = "";
|
|
54
|
+
} else if (ch === "]") {
|
|
55
|
+
arrayKeyStack.pop();
|
|
56
|
+
lastKey = "";
|
|
57
|
+
} else if (ch === "{") {
|
|
58
|
+
const key = lastKey || (arrayKeyStack.length > 0 ? arrayKeyStack[arrayKeyStack.length - 1] ?? "" : "");
|
|
59
|
+
if (key) path.push(key);
|
|
60
|
+
lastKey = "";
|
|
61
|
+
} else if (ch === "}") {
|
|
62
|
+
path.pop();
|
|
63
|
+
lastKey = "";
|
|
64
|
+
} else if (ch === ",") {
|
|
65
|
+
lastKey = "";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return path;
|
|
69
|
+
}
|
|
70
|
+
// ── Cursor position detection ──────────────────────────────────────────
|
|
71
|
+
function isJsonValuePosition(beforeCursor) {
|
|
72
|
+
// Don't match if a comma follows the value (value is complete)
|
|
73
|
+
if (/,\s*$/.test(beforeCursor)) return null;
|
|
74
|
+
const match = beforeCursor.match(/"?(\w+)"?\s*:\s*"?([^"]*)?$/);
|
|
75
|
+
if (match) return match[1] ?? null;
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
function isJsonPropertyPosition(beforeCursor) {
|
|
79
|
+
if (beforeCursor === "" || beforeCursor === '"') return true;
|
|
80
|
+
if (/^"?[\w]*$/.test(beforeCursor)) return true;
|
|
81
|
+
if (/[{,]\s*"?[\w]*$/.test(beforeCursor)) return true;
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
function isInsideJsonArray(doc, pos) {
|
|
85
|
+
let depth = 0;
|
|
86
|
+
let inStr = false;
|
|
87
|
+
let escaped = false;
|
|
88
|
+
for(let i = pos - 1; i >= 0; i--){
|
|
89
|
+
const ch = doc[i];
|
|
90
|
+
if (escaped) {
|
|
91
|
+
escaped = false;
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (ch === "\\") {
|
|
95
|
+
escaped = true;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (ch === '"') {
|
|
99
|
+
inStr = !inStr;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (inStr) continue;
|
|
103
|
+
if (ch === "}" || ch === "]") {
|
|
104
|
+
depth++;
|
|
105
|
+
} else if (ch === "{") {
|
|
106
|
+
if (depth === 0) return false;
|
|
107
|
+
depth--;
|
|
108
|
+
} else if (ch === "[") {
|
|
109
|
+
if (depth === 0) return true;
|
|
110
|
+
depth--;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
// ── Array-item detection ───────────────────────────────────────────────
|
|
116
|
+
function detectArrayItemContext(doc, pos) {
|
|
117
|
+
const textBefore = doc.slice(0, pos);
|
|
118
|
+
const arrayMatch = textBefore.match(/"(\w+)"\s*:\s*\[\s*(?:"[^"]*"\s*,\s*)*"?([^"]*)$/s);
|
|
119
|
+
if (!arrayMatch) return null;
|
|
120
|
+
// If there are unmatched { after [, cursor is inside a nested object, not directly in array
|
|
121
|
+
const afterBracket = arrayMatch[2] ?? "";
|
|
122
|
+
let braceDepth = 0;
|
|
123
|
+
for (const ch of afterBracket){
|
|
124
|
+
if (ch === "{") braceDepth++;
|
|
125
|
+
else if (ch === "}") braceDepth--;
|
|
126
|
+
}
|
|
127
|
+
if (braceDepth > 0) return null;
|
|
128
|
+
return {
|
|
129
|
+
parentKey: arrayMatch[1],
|
|
130
|
+
prefix: afterBracket
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
// ── Scope view (find values in ancestor objects) ───────────────────────
|
|
134
|
+
function findStringValueInObject(doc, objStart, limit, targetKey) {
|
|
135
|
+
let fd = 0;
|
|
136
|
+
let fs = false;
|
|
137
|
+
let fe = false;
|
|
138
|
+
let lastKey = "";
|
|
139
|
+
let collecting = false;
|
|
140
|
+
let current = "";
|
|
141
|
+
let afterColon = false;
|
|
142
|
+
for(let i = objStart + 1; i < limit; i++){
|
|
143
|
+
const ch = doc[i];
|
|
144
|
+
if (fe) {
|
|
145
|
+
if (collecting) current += ch;
|
|
146
|
+
fe = false;
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
if (ch === "\\") {
|
|
150
|
+
fe = true;
|
|
151
|
+
if (collecting) current += ch;
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
if (ch === '"') {
|
|
155
|
+
if (!fs) {
|
|
156
|
+
fs = true;
|
|
157
|
+
if (fd === 0) {
|
|
158
|
+
collecting = true;
|
|
159
|
+
current = "";
|
|
160
|
+
}
|
|
161
|
+
} else {
|
|
162
|
+
fs = false;
|
|
163
|
+
if (collecting) {
|
|
164
|
+
if (afterColon) {
|
|
165
|
+
if (lastKey === targetKey) return current;
|
|
166
|
+
afterColon = false;
|
|
167
|
+
} else {
|
|
168
|
+
lastKey = current;
|
|
169
|
+
}
|
|
170
|
+
collecting = false;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (fs) {
|
|
176
|
+
if (collecting) current += ch;
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
if (ch === "{" || ch === "[") fd++;
|
|
180
|
+
else if (ch === "}" || ch === "]") fd--;
|
|
181
|
+
else if (ch === ":" && fd === 0) afterColon = true;
|
|
182
|
+
else if (ch === "," && fd === 0) {
|
|
183
|
+
afterColon = false;
|
|
184
|
+
lastKey = "";
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
function findStringArrayInObject(doc, objStart, limit, parentKey, arrayKey) {
|
|
190
|
+
// Find "parentKey": { ... "arrayKey": ["v1", "v2"] ... }
|
|
191
|
+
// or if parentKey is empty, find "arrayKey": [...] at top level
|
|
192
|
+
const searchDoc = doc.slice(objStart, limit);
|
|
193
|
+
let pattern;
|
|
194
|
+
if (parentKey) {
|
|
195
|
+
pattern = new RegExp(`"${parentKey}"\\s*:\\s*\\{[\\s\\S]*?"${arrayKey}"\\s*:\\s*\\[([\\s\\S]*?)\\]`);
|
|
196
|
+
} else {
|
|
197
|
+
pattern = new RegExp(`"${arrayKey}"\\s*:\\s*\\[([\\s\\S]*?)\\]`);
|
|
198
|
+
}
|
|
199
|
+
const match = searchDoc.match(pattern);
|
|
200
|
+
if (!match?.[1]) return [];
|
|
201
|
+
const urls = [];
|
|
202
|
+
const re = /"([^"]+)"/g;
|
|
203
|
+
let m;
|
|
204
|
+
// biome-ignore lint/suspicious/noAssignInExpressions: standard regex exec loop
|
|
205
|
+
while((m = re.exec(match[1])) !== null){
|
|
206
|
+
if (m[1]) urls.push(m[1]);
|
|
207
|
+
}
|
|
208
|
+
return urls;
|
|
209
|
+
}
|
|
210
|
+
function findKeysInObject(doc, objStart, limit) {
|
|
211
|
+
const keys = [];
|
|
212
|
+
let fd = 0;
|
|
213
|
+
let fs = false;
|
|
214
|
+
let fe = false;
|
|
215
|
+
let collecting = false;
|
|
216
|
+
let current = "";
|
|
217
|
+
let afterColon = false;
|
|
218
|
+
for(let i = objStart + 1; i < limit; i++){
|
|
219
|
+
const ch = doc[i];
|
|
220
|
+
if (fe) {
|
|
221
|
+
if (collecting) current += ch;
|
|
222
|
+
fe = false;
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
if (ch === "\\") {
|
|
226
|
+
fe = true;
|
|
227
|
+
if (collecting) current += ch;
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
if (ch === '"') {
|
|
231
|
+
if (!fs) {
|
|
232
|
+
fs = true;
|
|
233
|
+
if (fd === 0) {
|
|
234
|
+
collecting = true;
|
|
235
|
+
current = "";
|
|
236
|
+
}
|
|
237
|
+
} else {
|
|
238
|
+
fs = false;
|
|
239
|
+
if (collecting) {
|
|
240
|
+
if (!afterColon) {
|
|
241
|
+
keys.push(current);
|
|
242
|
+
}
|
|
243
|
+
collecting = false;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
if (fs) {
|
|
249
|
+
if (collecting) current += ch;
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
if (ch === "{" || ch === "[") fd++;
|
|
253
|
+
else if (ch === "}" || ch === "]") fd--;
|
|
254
|
+
else if (ch === ":" && fd === 0) afterColon = true;
|
|
255
|
+
else if (ch === "," && fd === 0) {
|
|
256
|
+
afterColon = false;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return keys;
|
|
260
|
+
}
|
|
261
|
+
function buildScopeView(doc, pos, levelsUp) {
|
|
262
|
+
// Forward scan to find enclosing objects — avoids string-tracking bugs
|
|
263
|
+
// from backward scanning when cursor is inside an unclosed string.
|
|
264
|
+
const objectStack = [];
|
|
265
|
+
let inString = false;
|
|
266
|
+
let isEscaped = false;
|
|
267
|
+
for(let i = 0; i < pos; i++){
|
|
268
|
+
const ch = doc[i];
|
|
269
|
+
if (isEscaped) {
|
|
270
|
+
isEscaped = false;
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
if (ch === "\\") {
|
|
274
|
+
isEscaped = true;
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
if (ch === '"') {
|
|
278
|
+
inString = !inString;
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
if (inString) continue;
|
|
282
|
+
if (ch === "{") {
|
|
283
|
+
objectStack.push(i);
|
|
284
|
+
} else if (ch === "}") {
|
|
285
|
+
objectStack.pop();
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
// objectStack[last] is innermost, objectStack[last - levelsUp] is target
|
|
289
|
+
const targetIdx = objectStack.length - 1 - levelsUp;
|
|
290
|
+
if (targetIdx < 0) {
|
|
291
|
+
return {
|
|
292
|
+
getString () {
|
|
293
|
+
return null;
|
|
294
|
+
},
|
|
295
|
+
getStringArray () {
|
|
296
|
+
return [];
|
|
297
|
+
},
|
|
298
|
+
getKeys () {
|
|
299
|
+
return [];
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
const objStart = objectStack[targetIdx];
|
|
304
|
+
const scopeEnd = doc.length;
|
|
305
|
+
return {
|
|
306
|
+
getString (key) {
|
|
307
|
+
return findStringValueInObject(doc, objStart, scopeEnd, key);
|
|
308
|
+
},
|
|
309
|
+
getStringArray (parentKey, arrayKey) {
|
|
310
|
+
return findStringArrayInObject(doc, objStart, scopeEnd, parentKey, arrayKey);
|
|
311
|
+
},
|
|
312
|
+
getKeys () {
|
|
313
|
+
return findKeysInObject(doc, objStart, scopeEnd);
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
// ── buildJsonDocumentContext ────────────────────────────────────────────
|
|
318
|
+
export function buildJsonDocumentContext(doc, pos) {
|
|
319
|
+
const jsonStart = detectJsonStart(doc);
|
|
320
|
+
const jsonBody = doc.slice(jsonStart);
|
|
321
|
+
const posInBody = pos - jsonStart;
|
|
322
|
+
const fullPath = getJsonPathAtCursor(jsonBody, posInBody);
|
|
323
|
+
// Determine cursor position kind
|
|
324
|
+
const lineStart = doc.lastIndexOf("\n", pos - 1) + 1;
|
|
325
|
+
const beforeCursor = doc.slice(lineStart, pos).trimStart();
|
|
326
|
+
let cursorPosition;
|
|
327
|
+
const valueKey = isJsonValuePosition(beforeCursor);
|
|
328
|
+
if (valueKey) {
|
|
329
|
+
cursorPosition = {
|
|
330
|
+
kind: "value",
|
|
331
|
+
key: valueKey,
|
|
332
|
+
prefix: ""
|
|
333
|
+
};
|
|
334
|
+
const wordMatch = beforeCursor.match(/"?(\w+)"?\s*:\s*"?([^"]*)?$/);
|
|
335
|
+
if (wordMatch?.[2] != null) {
|
|
336
|
+
cursorPosition.prefix = wordMatch[2];
|
|
337
|
+
}
|
|
338
|
+
} else {
|
|
339
|
+
const arrayItem = detectArrayItemContext(doc.slice(jsonStart), posInBody);
|
|
340
|
+
if (arrayItem) {
|
|
341
|
+
cursorPosition = {
|
|
342
|
+
kind: "array-item",
|
|
343
|
+
parentKey: arrayItem.parentKey,
|
|
344
|
+
prefix: arrayItem.prefix
|
|
345
|
+
};
|
|
346
|
+
} else if (isJsonPropertyPosition(beforeCursor)) {
|
|
347
|
+
const wordMatch = beforeCursor.match(/"?(\w*)$/);
|
|
348
|
+
cursorPosition = {
|
|
349
|
+
kind: "property",
|
|
350
|
+
prefix: wordMatch?.[1] ?? ""
|
|
351
|
+
};
|
|
352
|
+
} else {
|
|
353
|
+
cursorPosition = {
|
|
354
|
+
kind: "none"
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return {
|
|
359
|
+
fullPath,
|
|
360
|
+
pos,
|
|
361
|
+
doc,
|
|
362
|
+
cursorPosition,
|
|
363
|
+
getScope (levelsUp) {
|
|
364
|
+
return buildScopeView(jsonBody, posInBody, levelsUp);
|
|
365
|
+
},
|
|
366
|
+
isInsideArray () {
|
|
367
|
+
return isInsideJsonArray(jsonBody, posInBody);
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
// ── Validation helpers ─────────────────────────────────────────────────
|
|
372
|
+
export function walkJsonProperties(doc, tree, resourceTypeHint) {
|
|
373
|
+
const properties = [];
|
|
374
|
+
const emptyStrings = [];
|
|
375
|
+
const rootObj = findRootJsonObject(doc, tree);
|
|
376
|
+
if (rootObj) {
|
|
377
|
+
walkJsonObject(rootObj, [], resourceTypeHint, doc, properties, emptyStrings);
|
|
378
|
+
}
|
|
379
|
+
return {
|
|
380
|
+
properties,
|
|
381
|
+
emptyStrings
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
export function findRootJsonObject(doc, tree) {
|
|
385
|
+
const direct = tree.topNode.getChild("Object");
|
|
386
|
+
if (direct) return direct;
|
|
387
|
+
const bodyStart = doc.indexOf("\n\n");
|
|
388
|
+
if (bodyStart === -1) return null;
|
|
389
|
+
const jsonStart = bodyStart + 2;
|
|
390
|
+
if (jsonStart >= doc.length) return null;
|
|
391
|
+
const innerNode = tree.resolveInner(jsonStart, 1);
|
|
392
|
+
if (!innerNode) return null;
|
|
393
|
+
let node = innerNode;
|
|
394
|
+
while(node){
|
|
395
|
+
if (node.name === "Object") return node;
|
|
396
|
+
if (node.name === "JsonText") {
|
|
397
|
+
return node.getChild("Object");
|
|
398
|
+
}
|
|
399
|
+
node = node.parent;
|
|
400
|
+
}
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
function walkJsonObject(node, parentPath, parentResourceType, doc, result, emptyStrings) {
|
|
404
|
+
let ownResourceType = null;
|
|
405
|
+
for(let child = node.firstChild; child; child = child.nextSibling){
|
|
406
|
+
if (child.name !== "Property") continue;
|
|
407
|
+
const nameNode = child.getChild("PropertyName");
|
|
408
|
+
if (!nameNode) continue;
|
|
409
|
+
const keyName = doc.slice(nameNode.from, nameNode.to).replace(/^"|"$/g, "");
|
|
410
|
+
if (keyName === "resourceType") {
|
|
411
|
+
for(let v = child.firstChild; v; v = v.nextSibling){
|
|
412
|
+
if (v.name === "String") {
|
|
413
|
+
ownResourceType = doc.slice(v.from, v.to).replace(/^"|"$/g, "");
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
const resourceType = ownResourceType ?? parentResourceType;
|
|
421
|
+
const path = ownResourceType ? [] : parentPath;
|
|
422
|
+
if (!resourceType) return;
|
|
423
|
+
for(let child = node.firstChild; child; child = child.nextSibling){
|
|
424
|
+
if (child.name !== "Property") continue;
|
|
425
|
+
const nameNode = child.getChild("PropertyName");
|
|
426
|
+
if (!nameNode) continue;
|
|
427
|
+
const name = doc.slice(nameNode.from, nameNode.to).replace(/^"|"$/g, "");
|
|
428
|
+
result.push({
|
|
429
|
+
name,
|
|
430
|
+
path: [
|
|
431
|
+
...path
|
|
432
|
+
],
|
|
433
|
+
resourceType,
|
|
434
|
+
from: nameNode.from,
|
|
435
|
+
to: nameNode.to
|
|
436
|
+
});
|
|
437
|
+
for(let v = child.firstChild; v; v = v.nextSibling){
|
|
438
|
+
if (v.name === "Object") {
|
|
439
|
+
walkJsonObject(v, [
|
|
440
|
+
...path,
|
|
441
|
+
name
|
|
442
|
+
], resourceType, doc, result, emptyStrings);
|
|
443
|
+
} else if (v.name === "Array") {
|
|
444
|
+
for(let item = v.firstChild; item; item = item.nextSibling){
|
|
445
|
+
if (item.name === "Object") {
|
|
446
|
+
walkJsonObject(item, [
|
|
447
|
+
...path,
|
|
448
|
+
name
|
|
449
|
+
], resourceType, doc, result, emptyStrings);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
} else if (v.name === "String" && emptyStrings) {
|
|
453
|
+
const raw = doc.slice(v.from, v.to);
|
|
454
|
+
if (raw === '""') {
|
|
455
|
+
emptyStrings.push({
|
|
456
|
+
from: v.from,
|
|
457
|
+
to: v.to
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
//# sourceMappingURL=json-ast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/code-editor/json-ast.ts"],"sourcesContent":["import type { syntaxTree } from \"@codemirror/language\";\nimport type { SyntaxNode } from \"@lezer/common\";\n\n// ── Types ──────────────────────────────────────────────────────────────\n\nexport interface ScopeView {\n\tgetString(key: string): string | null;\n\tgetStringArray(parentKey: string, arrayKey: string): string[];\n\tgetKeys(): string[];\n}\n\nexport interface DocumentContext {\n\tfullPath: string[];\n\tpos: number;\n\tdoc: string;\n\tcursorPosition:\n\t\t| { kind: \"property\"; prefix: string }\n\t\t| { kind: \"value\"; key: string; prefix: string }\n\t\t| { kind: \"array-item\"; parentKey: string; prefix: string }\n\t\t| { kind: \"none\" };\n\tgetScope(levelsUp: number): ScopeView;\n\tisInsideArray(): boolean;\n}\n\nexport interface PropertyInfo {\n\tname: string;\n\tpath: string[];\n\tresourceType: string;\n\tfrom: number;\n\tto: number;\n}\n\nexport interface EmptyStringInfo {\n\tfrom: number;\n\tto: number;\n}\n\n// ── HTTP mode helper ───────────────────────────────────────────────────\n\nconst HTTP_METHOD_RE = /^(GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD)\\s/;\n\nfunction detectJsonStart(doc: string): number {\n\tconst firstLine = doc.slice(0, doc.indexOf(\"\\n\") >>> 0).trimStart();\n\tif (HTTP_METHOD_RE.test(firstLine)) {\n\t\tconst bodyStart = doc.indexOf(\"\\n\\n\");\n\t\tif (bodyStart === -1) return 0;\n\t\treturn bodyStart + 2;\n\t}\n\treturn 0;\n}\n\n// ── JSON path at cursor ────────────────────────────────────────────────\n\nfunction getJsonPathAtCursor(doc: string, pos: number): string[] {\n\tconst path: string[] = [];\n\tconst arrayKeyStack: string[] = [];\n\tlet inString = false;\n\tlet isEscaped = false;\n\tlet currentKey = \"\";\n\tlet collectingKey = false;\n\tlet lastKey = \"\";\n\n\tfor (let i = 0; i < pos; i++) {\n\t\tconst ch = doc[i];\n\n\t\tif (isEscaped) {\n\t\t\tif (collectingKey) currentKey += ch;\n\t\t\tisEscaped = false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \"\\\\\") {\n\t\t\tisEscaped = true;\n\t\t\tif (collectingKey) currentKey += ch;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === '\"') {\n\t\t\tif (!inString) {\n\t\t\t\tinString = true;\n\t\t\t\tcollectingKey = true;\n\t\t\t\tcurrentKey = \"\";\n\t\t\t} else {\n\t\t\t\tinString = false;\n\t\t\t\tif (collectingKey) {\n\t\t\t\t\tlastKey = currentKey;\n\t\t\t\t\tcollectingKey = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tif (inString) {\n\t\t\tif (collectingKey) currentKey += ch;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \"[\") {\n\t\t\tarrayKeyStack.push(lastKey);\n\t\t\tlastKey = \"\";\n\t\t} else if (ch === \"]\") {\n\t\t\tarrayKeyStack.pop();\n\t\t\tlastKey = \"\";\n\t\t} else if (ch === \"{\") {\n\t\t\tconst key =\n\t\t\t\tlastKey ||\n\t\t\t\t(arrayKeyStack.length > 0\n\t\t\t\t\t? (arrayKeyStack[arrayKeyStack.length - 1] ?? \"\")\n\t\t\t\t\t: \"\");\n\t\t\tif (key) path.push(key);\n\t\t\tlastKey = \"\";\n\t\t} else if (ch === \"}\") {\n\t\t\tpath.pop();\n\t\t\tlastKey = \"\";\n\t\t} else if (ch === \",\") {\n\t\t\tlastKey = \"\";\n\t\t}\n\t}\n\treturn path;\n}\n\n// ── Cursor position detection ──────────────────────────────────────────\n\nfunction isJsonValuePosition(beforeCursor: string): string | null {\n\t// Don't match if a comma follows the value (value is complete)\n\tif (/,\\s*$/.test(beforeCursor)) return null;\n\tconst match = beforeCursor.match(/\"?(\\w+)\"?\\s*:\\s*\"?([^\"]*)?$/);\n\tif (match) return match[1] ?? null;\n\treturn null;\n}\n\nfunction isJsonPropertyPosition(beforeCursor: string): boolean {\n\tif (beforeCursor === \"\" || beforeCursor === '\"') return true;\n\tif (/^\"?[\\w]*$/.test(beforeCursor)) return true;\n\tif (/[{,]\\s*\"?[\\w]*$/.test(beforeCursor)) return true;\n\treturn false;\n}\n\nfunction isInsideJsonArray(doc: string, pos: number): boolean {\n\tlet depth = 0;\n\tlet inStr = false;\n\tlet escaped = false;\n\tfor (let i = pos - 1; i >= 0; i--) {\n\t\tconst ch = doc[i];\n\t\tif (escaped) {\n\t\t\tescaped = false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \"\\\\\") {\n\t\t\tescaped = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === '\"') {\n\t\t\tinStr = !inStr;\n\t\t\tcontinue;\n\t\t}\n\t\tif (inStr) continue;\n\t\tif (ch === \"}\" || ch === \"]\") {\n\t\t\tdepth++;\n\t\t} else if (ch === \"{\") {\n\t\t\tif (depth === 0) return false;\n\t\t\tdepth--;\n\t\t} else if (ch === \"[\") {\n\t\t\tif (depth === 0) return true;\n\t\t\tdepth--;\n\t\t}\n\t}\n\treturn false;\n}\n\n// ── Array-item detection ───────────────────────────────────────────────\n\nfunction detectArrayItemContext(\n\tdoc: string,\n\tpos: number,\n): { parentKey: string; prefix: string } | null {\n\tconst textBefore = doc.slice(0, pos);\n\tconst arrayMatch = textBefore.match(\n\t\t/\"(\\w+)\"\\s*:\\s*\\[\\s*(?:\"[^\"]*\"\\s*,\\s*)*\"?([^\"]*)$/s,\n\t);\n\tif (!arrayMatch) return null;\n\t// If there are unmatched { after [, cursor is inside a nested object, not directly in array\n\tconst afterBracket = arrayMatch[2] ?? \"\";\n\tlet braceDepth = 0;\n\tfor (const ch of afterBracket) {\n\t\tif (ch === \"{\") braceDepth++;\n\t\telse if (ch === \"}\") braceDepth--;\n\t}\n\tif (braceDepth > 0) return null;\n\treturn { parentKey: arrayMatch[1]!, prefix: afterBracket };\n}\n\n// ── Scope view (find values in ancestor objects) ───────────────────────\n\nfunction findStringValueInObject(\n\tdoc: string,\n\tobjStart: number,\n\tlimit: number,\n\ttargetKey: string,\n): string | null {\n\tlet fd = 0;\n\tlet fs = false;\n\tlet fe = false;\n\tlet lastKey = \"\";\n\tlet collecting = false;\n\tlet current = \"\";\n\tlet afterColon = false;\n\n\tfor (let i = objStart + 1; i < limit; i++) {\n\t\tconst ch = doc[i];\n\t\tif (fe) {\n\t\t\tif (collecting) current += ch;\n\t\t\tfe = false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \"\\\\\") {\n\t\t\tfe = true;\n\t\t\tif (collecting) current += ch;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === '\"') {\n\t\t\tif (!fs) {\n\t\t\t\tfs = true;\n\t\t\t\tif (fd === 0) {\n\t\t\t\t\tcollecting = true;\n\t\t\t\t\tcurrent = \"\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfs = false;\n\t\t\t\tif (collecting) {\n\t\t\t\t\tif (afterColon) {\n\t\t\t\t\t\tif (lastKey === targetKey) return current;\n\t\t\t\t\t\tafterColon = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlastKey = current;\n\t\t\t\t\t}\n\t\t\t\t\tcollecting = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tif (fs) {\n\t\t\tif (collecting) current += ch;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \"{\" || ch === \"[\") fd++;\n\t\telse if (ch === \"}\" || ch === \"]\") fd--;\n\t\telse if (ch === \":\" && fd === 0) afterColon = true;\n\t\telse if (ch === \",\" && fd === 0) {\n\t\t\tafterColon = false;\n\t\t\tlastKey = \"\";\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction findStringArrayInObject(\n\tdoc: string,\n\tobjStart: number,\n\tlimit: number,\n\tparentKey: string,\n\tarrayKey: string,\n): string[] {\n\t// Find \"parentKey\": { ... \"arrayKey\": [\"v1\", \"v2\"] ... }\n\t// or if parentKey is empty, find \"arrayKey\": [...] at top level\n\tconst searchDoc = doc.slice(objStart, limit);\n\tlet pattern: RegExp;\n\tif (parentKey) {\n\t\tpattern = new RegExp(\n\t\t\t`\"${parentKey}\"\\\\s*:\\\\s*\\\\{[\\\\s\\\\S]*?\"${arrayKey}\"\\\\s*:\\\\s*\\\\[([\\\\s\\\\S]*?)\\\\]`,\n\t\t);\n\t} else {\n\t\tpattern = new RegExp(`\"${arrayKey}\"\\\\s*:\\\\s*\\\\[([\\\\s\\\\S]*?)\\\\]`);\n\t}\n\tconst match = searchDoc.match(pattern);\n\tif (!match?.[1]) return [];\n\tconst urls: string[] = [];\n\tconst re = /\"([^\"]+)\"/g;\n\tlet m: RegExpExecArray | null;\n\t// biome-ignore lint/suspicious/noAssignInExpressions: standard regex exec loop\n\twhile ((m = re.exec(match[1])) !== null) {\n\t\tif (m[1]) urls.push(m[1]);\n\t}\n\treturn urls;\n}\n\nfunction findKeysInObject(\n\tdoc: string,\n\tobjStart: number,\n\tlimit: number,\n): string[] {\n\tconst keys: string[] = [];\n\tlet fd = 0;\n\tlet fs = false;\n\tlet fe = false;\n\tlet collecting = false;\n\tlet current = \"\";\n\tlet afterColon = false;\n\n\tfor (let i = objStart + 1; i < limit; i++) {\n\t\tconst ch = doc[i];\n\t\tif (fe) {\n\t\t\tif (collecting) current += ch;\n\t\t\tfe = false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \"\\\\\") {\n\t\t\tfe = true;\n\t\t\tif (collecting) current += ch;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === '\"') {\n\t\t\tif (!fs) {\n\t\t\t\tfs = true;\n\t\t\t\tif (fd === 0) {\n\t\t\t\t\tcollecting = true;\n\t\t\t\t\tcurrent = \"\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfs = false;\n\t\t\t\tif (collecting) {\n\t\t\t\t\tif (!afterColon) {\n\t\t\t\t\t\tkeys.push(current);\n\t\t\t\t\t}\n\t\t\t\t\tcollecting = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tif (fs) {\n\t\t\tif (collecting) current += ch;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \"{\" || ch === \"[\") fd++;\n\t\telse if (ch === \"}\" || ch === \"]\") fd--;\n\t\telse if (ch === \":\" && fd === 0) afterColon = true;\n\t\telse if (ch === \",\" && fd === 0) {\n\t\t\tafterColon = false;\n\t\t}\n\t}\n\treturn keys;\n}\n\nfunction buildScopeView(doc: string, pos: number, levelsUp: number): ScopeView {\n\t// Forward scan to find enclosing objects — avoids string-tracking bugs\n\t// from backward scanning when cursor is inside an unclosed string.\n\tconst objectStack: number[] = [];\n\tlet inString = false;\n\tlet isEscaped = false;\n\n\tfor (let i = 0; i < pos; i++) {\n\t\tconst ch = doc[i];\n\t\tif (isEscaped) {\n\t\t\tisEscaped = false;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === \"\\\\\") {\n\t\t\tisEscaped = true;\n\t\t\tcontinue;\n\t\t}\n\t\tif (ch === '\"') {\n\t\t\tinString = !inString;\n\t\t\tcontinue;\n\t\t}\n\t\tif (inString) continue;\n\t\tif (ch === \"{\") {\n\t\t\tobjectStack.push(i);\n\t\t} else if (ch === \"}\") {\n\t\t\tobjectStack.pop();\n\t\t}\n\t}\n\n\t// objectStack[last] is innermost, objectStack[last - levelsUp] is target\n\tconst targetIdx = objectStack.length - 1 - levelsUp;\n\tif (targetIdx < 0) {\n\t\treturn {\n\t\t\tgetString() {\n\t\t\t\treturn null;\n\t\t\t},\n\t\t\tgetStringArray() {\n\t\t\t\treturn [];\n\t\t\t},\n\t\t\tgetKeys() {\n\t\t\t\treturn [];\n\t\t\t},\n\t\t};\n\t}\n\n\tconst objStart = objectStack[targetIdx]!;\n\tconst scopeEnd = doc.length;\n\n\treturn {\n\t\tgetString(key: string): string | null {\n\t\t\treturn findStringValueInObject(doc, objStart, scopeEnd, key);\n\t\t},\n\t\tgetStringArray(parentKey: string, arrayKey: string): string[] {\n\t\t\treturn findStringArrayInObject(\n\t\t\t\tdoc,\n\t\t\t\tobjStart,\n\t\t\t\tscopeEnd,\n\t\t\t\tparentKey,\n\t\t\t\tarrayKey,\n\t\t\t);\n\t\t},\n\t\tgetKeys(): string[] {\n\t\t\treturn findKeysInObject(doc, objStart, scopeEnd);\n\t\t},\n\t};\n}\n\n// ── buildJsonDocumentContext ────────────────────────────────────────────\n\nexport function buildJsonDocumentContext(\n\tdoc: string,\n\tpos: number,\n): DocumentContext {\n\tconst jsonStart = detectJsonStart(doc);\n\tconst jsonBody = doc.slice(jsonStart);\n\tconst posInBody = pos - jsonStart;\n\n\tconst fullPath = getJsonPathAtCursor(jsonBody, posInBody);\n\n\t// Determine cursor position kind\n\tconst lineStart = doc.lastIndexOf(\"\\n\", pos - 1) + 1;\n\tconst beforeCursor = doc.slice(lineStart, pos).trimStart();\n\n\tlet cursorPosition: DocumentContext[\"cursorPosition\"];\n\n\tconst valueKey = isJsonValuePosition(beforeCursor);\n\tif (valueKey) {\n\t\tcursorPosition = { kind: \"value\", key: valueKey, prefix: \"\" };\n\t\tconst wordMatch = beforeCursor.match(/\"?(\\w+)\"?\\s*:\\s*\"?([^\"]*)?$/);\n\t\tif (wordMatch?.[2] != null) {\n\t\t\tcursorPosition.prefix = wordMatch[2];\n\t\t}\n\t} else {\n\t\tconst arrayItem = detectArrayItemContext(doc.slice(jsonStart), posInBody);\n\t\tif (arrayItem) {\n\t\t\tcursorPosition = {\n\t\t\t\tkind: \"array-item\",\n\t\t\t\tparentKey: arrayItem.parentKey,\n\t\t\t\tprefix: arrayItem.prefix,\n\t\t\t};\n\t\t} else if (isJsonPropertyPosition(beforeCursor)) {\n\t\t\tconst wordMatch = beforeCursor.match(/\"?(\\w*)$/);\n\t\t\tcursorPosition = { kind: \"property\", prefix: wordMatch?.[1] ?? \"\" };\n\t\t} else {\n\t\t\tcursorPosition = { kind: \"none\" };\n\t\t}\n\t}\n\n\treturn {\n\t\tfullPath,\n\t\tpos,\n\t\tdoc,\n\t\tcursorPosition,\n\t\tgetScope(levelsUp: number): ScopeView {\n\t\t\treturn buildScopeView(jsonBody, posInBody, levelsUp);\n\t\t},\n\t\tisInsideArray(): boolean {\n\t\t\treturn isInsideJsonArray(jsonBody, posInBody);\n\t\t},\n\t};\n}\n\n// ── Validation helpers ─────────────────────────────────────────────────\n\nexport function walkJsonProperties(\n\tdoc: string,\n\ttree: ReturnType<typeof syntaxTree>,\n\tresourceTypeHint: string | null,\n): { properties: PropertyInfo[]; emptyStrings: EmptyStringInfo[] } {\n\tconst properties: PropertyInfo[] = [];\n\tconst emptyStrings: EmptyStringInfo[] = [];\n\n\tconst rootObj = findRootJsonObject(doc, tree);\n\tif (rootObj) {\n\t\twalkJsonObject(\n\t\t\trootObj,\n\t\t\t[],\n\t\t\tresourceTypeHint,\n\t\t\tdoc,\n\t\t\tproperties,\n\t\t\temptyStrings,\n\t\t);\n\t}\n\n\treturn { properties, emptyStrings };\n}\n\nexport function findRootJsonObject(\n\tdoc: string,\n\ttree: ReturnType<typeof syntaxTree>,\n): SyntaxNode | null {\n\tconst direct = tree.topNode.getChild(\"Object\");\n\tif (direct) return direct;\n\n\tconst bodyStart = doc.indexOf(\"\\n\\n\");\n\tif (bodyStart === -1) return null;\n\n\tconst jsonStart = bodyStart + 2;\n\tif (jsonStart >= doc.length) return null;\n\n\tconst innerNode = tree.resolveInner(jsonStart, 1);\n\tif (!innerNode) return null;\n\n\tlet node: SyntaxNode | null = innerNode;\n\twhile (node) {\n\t\tif (node.name === \"Object\") return node;\n\t\tif (node.name === \"JsonText\") {\n\t\t\treturn node.getChild(\"Object\");\n\t\t}\n\t\tnode = node.parent;\n\t}\n\n\treturn null;\n}\n\nfunction walkJsonObject(\n\tnode: SyntaxNode,\n\tparentPath: string[],\n\tparentResourceType: string | null,\n\tdoc: string,\n\tresult: PropertyInfo[],\n\temptyStrings?: EmptyStringInfo[],\n): void {\n\tlet ownResourceType: string | null = null;\n\tfor (let child = node.firstChild; child; child = child.nextSibling) {\n\t\tif (child.name !== \"Property\") continue;\n\t\tconst nameNode = child.getChild(\"PropertyName\");\n\t\tif (!nameNode) continue;\n\t\tconst keyName = doc.slice(nameNode.from, nameNode.to).replace(/^\"|\"$/g, \"\");\n\t\tif (keyName === \"resourceType\") {\n\t\t\tfor (let v = child.firstChild; v; v = v.nextSibling) {\n\t\t\t\tif (v.name === \"String\") {\n\t\t\t\t\townResourceType = doc.slice(v.from, v.to).replace(/^\"|\"$/g, \"\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tconst resourceType = ownResourceType ?? parentResourceType;\n\tconst path = ownResourceType ? [] : parentPath;\n\n\tif (!resourceType) return;\n\n\tfor (let child = node.firstChild; child; child = child.nextSibling) {\n\t\tif (child.name !== \"Property\") continue;\n\t\tconst nameNode = child.getChild(\"PropertyName\");\n\t\tif (!nameNode) continue;\n\t\tconst name = doc.slice(nameNode.from, nameNode.to).replace(/^\"|\"$/g, \"\");\n\n\t\tresult.push({\n\t\t\tname,\n\t\t\tpath: [...path],\n\t\t\tresourceType,\n\t\t\tfrom: nameNode.from,\n\t\t\tto: nameNode.to,\n\t\t});\n\n\t\tfor (let v = child.firstChild; v; v = v.nextSibling) {\n\t\t\tif (v.name === \"Object\") {\n\t\t\t\twalkJsonObject(\n\t\t\t\t\tv,\n\t\t\t\t\t[...path, name],\n\t\t\t\t\tresourceType,\n\t\t\t\t\tdoc,\n\t\t\t\t\tresult,\n\t\t\t\t\temptyStrings,\n\t\t\t\t);\n\t\t\t} else if (v.name === \"Array\") {\n\t\t\t\tfor (let item = v.firstChild; item; item = item.nextSibling) {\n\t\t\t\t\tif (item.name === \"Object\") {\n\t\t\t\t\t\twalkJsonObject(\n\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\t[...path, name],\n\t\t\t\t\t\t\tresourceType,\n\t\t\t\t\t\t\tdoc,\n\t\t\t\t\t\t\tresult,\n\t\t\t\t\t\t\temptyStrings,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (v.name === \"String\" && emptyStrings) {\n\t\t\t\tconst raw = doc.slice(v.from, v.to);\n\t\t\t\tif (raw === '\"\"') {\n\t\t\t\t\temptyStrings.push({ from: v.from, to: v.to });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["HTTP_METHOD_RE","detectJsonStart","doc","firstLine","slice","indexOf","trimStart","test","bodyStart","getJsonPathAtCursor","pos","path","arrayKeyStack","inString","isEscaped","currentKey","collectingKey","lastKey","i","ch","push","pop","key","length","isJsonValuePosition","beforeCursor","match","isJsonPropertyPosition","isInsideJsonArray","depth","inStr","escaped","detectArrayItemContext","textBefore","arrayMatch","afterBracket","braceDepth","parentKey","prefix","findStringValueInObject","objStart","limit","targetKey","fd","fs","fe","collecting","current","afterColon","findStringArrayInObject","arrayKey","searchDoc","pattern","RegExp","urls","re","m","exec","findKeysInObject","keys","buildScopeView","levelsUp","objectStack","targetIdx","getString","getStringArray","getKeys","scopeEnd","buildJsonDocumentContext","jsonStart","jsonBody","posInBody","fullPath","lineStart","lastIndexOf","cursorPosition","valueKey","kind","wordMatch","arrayItem","getScope","isInsideArray","walkJsonProperties","tree","resourceTypeHint","properties","emptyStrings","rootObj","findRootJsonObject","walkJsonObject","direct","topNode","getChild","innerNode","resolveInner","node","name","parent","parentPath","parentResourceType","result","ownResourceType","child","firstChild","nextSibling","nameNode","keyName","from","to","replace","v","resourceType","item","raw"],"mappings":"AAqCA,0EAA0E;AAE1E,MAAMA,iBAAiB;AAEvB,SAASC,gBAAgBC,GAAW;IACnC,MAAMC,YAAYD,IAAIE,KAAK,CAAC,GAAGF,IAAIG,OAAO,CAAC,UAAU,GAAGC,SAAS;IACjE,IAAIN,eAAeO,IAAI,CAACJ,YAAY;QACnC,MAAMK,YAAYN,IAAIG,OAAO,CAAC;QAC9B,IAAIG,cAAc,CAAC,GAAG,OAAO;QAC7B,OAAOA,YAAY;IACpB;IACA,OAAO;AACR;AAEA,0EAA0E;AAE1E,SAASC,oBAAoBP,GAAW,EAAEQ,GAAW;IACpD,MAAMC,OAAiB,EAAE;IACzB,MAAMC,gBAA0B,EAAE;IAClC,IAAIC,WAAW;IACf,IAAIC,YAAY;IAChB,IAAIC,aAAa;IACjB,IAAIC,gBAAgB;IACpB,IAAIC,UAAU;IAEd,IAAK,IAAIC,IAAI,GAAGA,IAAIR,KAAKQ,IAAK;QAC7B,MAAMC,KAAKjB,GAAG,CAACgB,EAAE;QAEjB,IAAIJ,WAAW;YACd,IAAIE,eAAeD,cAAcI;YACjCL,YAAY;YACZ;QACD;QACA,IAAIK,OAAO,MAAM;YAChBL,YAAY;YACZ,IAAIE,eAAeD,cAAcI;YACjC;QACD;QACA,IAAIA,OAAO,KAAK;YACf,IAAI,CAACN,UAAU;gBACdA,WAAW;gBACXG,gBAAgB;gBAChBD,aAAa;YACd,OAAO;gBACNF,WAAW;gBACX,IAAIG,eAAe;oBAClBC,UAAUF;oBACVC,gBAAgB;gBACjB;YACD;YACA;QACD;QACA,IAAIH,UAAU;YACb,IAAIG,eAAe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