@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 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/code-editor/sql-completion.ts"],"sourcesContent":["import {\n\tautocompletion,\n\ttype Completion,\n\ttype CompletionContext,\n\ttype CompletionResult,\n\ttype CompletionSource,\n\tstartCompletion,\n} from \"@codemirror/autocomplete\";\nimport { EditorState, type Extension } from \"@codemirror/state\";\nimport { EditorView } from \"@codemirror/view\";\n\n// ── Public types ──\n\nexport type SqlQueryType =\n\t| \"tables\"\n\t| \"columns\"\n\t| \"functions\"\n\t| \"jsonb_columns\"\n\t| \"structure_definition\";\n\ninterface StructureDefinitionElementType {\n\tcode: string;\n}\n\ninterface StructureDefinitionElement {\n\tpath?: string;\n\ttype?: StructureDefinitionElementType[];\n\tmax?: string;\n\tshort?: string;\n\tdefinition?: string;\n}\n\ninterface StructureDefinition {\n\tname?: string;\n\tsnapshot?: {\n\t\telement: StructureDefinitionElement[];\n\t};\n}\n\nexport interface SqlConfig {\n\texecuteSql: (\n\t\tquery: string,\n\t\ttype: SqlQueryType,\n\t) => Promise<Record<string, unknown>[]>;\n}\n\n// ── Internal types ──\n\ntype SchemaMap = Record<string, string[]>;\ntype JsonbColumnMap = Record<string, string[]>;\ntype ColumnInfo = { name: string; dataType: string };\ntype ColumnMap = Record<string, ColumnInfo[]>;\n\ntype FhirFieldInfo = {\n\tname: string;\n\tdatatype: string;\n\tisArray: boolean;\n\tdescription: string | undefined;\n};\n\ntype FhirPathChildren = Record<string, FhirFieldInfo[]>;\n\ntype JsonbChain = {\n\ttableOrAlias: string | null;\n\tcolumn: string;\n\tpath: string[];\n\tisPathOp: boolean;\n\tpartialInput: string;\n\tinsideQuote: boolean;\n\tlastRawSegment: string | null;\n};\n\ntype AliasEntry = { schema: string; table: string };\n\nexport interface SqlMetadata {\n\tschemas: SchemaMap;\n\tjsonbColumns: JsonbColumnMap;\n\tfunctions: string[];\n\tcolumns: ColumnMap;\n}\n\n// ── SQL queries ──\n\nconst TABLES_QUERY = `SELECT table_schema, table_name FROM information_schema.tables WHERE table_schema NOT IN ('pg_catalog', 'information_schema', 'pgagent') AND table_type = 'BASE TABLE' ORDER BY table_schema, table_name`;\n\nconst JSONB_COLUMNS_QUERY = `SELECT c.table_schema, c.table_name, c.column_name FROM information_schema.columns c JOIN information_schema.tables t ON c.table_schema = t.table_schema AND c.table_name = t.table_name WHERE t.table_type = 'BASE TABLE' AND c.table_schema NOT IN ('pg_catalog', 'information_schema', 'pgagent') AND c.udt_name = 'jsonb'`;\n\nconst FUNCTIONS_QUERY = `SELECT DISTINCT p.proname AS name FROM pg_proc p JOIN pg_namespace n ON p.pronamespace = n.oid LEFT JOIN pg_depend d ON d.objid = p.oid AND d.deptype = 'e' WHERE n.nspname NOT IN ('pg_catalog', 'information_schema') AND d.objid IS NULL ORDER BY p.proname`;\n\nconst COLUMNS_QUERY = `SELECT c.table_schema, c.table_name, c.column_name, c.data_type FROM information_schema.columns c JOIN information_schema.tables t ON c.table_schema = t.table_schema AND c.table_name = t.table_name WHERE t.table_type = 'BASE TABLE' AND c.table_schema NOT IN ('pg_catalog', 'information_schema', 'pgagent') ORDER BY c.table_schema, c.table_name, c.ordinal_position`;\n\n// ── FHIR StructureDefinition processing ──\n\nfunction isExpandedVariant(path: string, unionBases: Set<string>): boolean {\n\tconst parts = path.split(\".\");\n\tif (parts.length < 2) return false;\n\tconst parentPath = parts.slice(0, -1).join(\".\");\n\tconst name = parts[parts.length - 1]!;\n\n\tfor (const base of unionBases) {\n\t\tconst baseParts = base.split(\".\");\n\t\tconst baseName = baseParts[baseParts.length - 1]!;\n\t\tconst baseParent = baseParts.slice(0, -1).join(\".\");\n\n\t\tif (\n\t\t\tparentPath === baseParent &&\n\t\t\tname.startsWith(baseName) &&\n\t\t\tname.length > baseName.length &&\n\t\t\t/^[A-Z]/.test(name.slice(baseName.length))\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction buildFromStructureDefinition(\n\tsd: StructureDefinition,\n): FhirPathChildren {\n\tconst elements = sd.snapshot?.element ?? [];\n\tconst result: FhirPathChildren = {};\n\n\tconst unionBases = new Set<string>();\n\tfor (const el of elements) {\n\t\tif (!el.path) continue;\n\t\tconst name = el.path.split(\".\").pop() ?? \"\";\n\t\tif (name.endsWith(\"[x]\")) {\n\t\t\tunionBases.add(el.path.replace(/\\[x\\]$/, \"\"));\n\t\t}\n\t}\n\n\tfor (const el of elements) {\n\t\tif (!el.path) continue;\n\t\tconst parts = el.path.split(\".\");\n\t\tif (parts.length < 2) continue;\n\n\t\tif (isExpandedVariant(el.path, unionBases)) continue;\n\n\t\tconst parentPath = parts.slice(0, -1).join(\".\");\n\t\tconst rawName = parts[parts.length - 1]!;\n\n\t\tif (!result[parentPath]) result[parentPath] = [];\n\n\t\tif (rawName.endsWith(\"[x]\")) {\n\t\t\tconst name = rawName.slice(0, -3);\n\t\t\tif (result[parentPath].some((f) => f.name === name)) continue;\n\n\t\t\tresult[parentPath].push({\n\t\t\t\tname,\n\t\t\t\tdatatype: \"union\",\n\t\t\t\tisArray: el.max === \"*\",\n\t\t\t\tdescription: el.short ?? el.definition,\n\t\t\t});\n\n\t\t\tconst unionPath = `${parentPath}.${name}`;\n\t\t\tif (!result[unionPath]) result[unionPath] = [];\n\t\t\tfor (const t of el.type ?? []) {\n\t\t\t\tif (!result[unionPath].some((f) => f.name === t.code)) {\n\t\t\t\t\tresult[unionPath].push({\n\t\t\t\t\t\tname: t.code,\n\t\t\t\t\t\tdatatype: t.code,\n\t\t\t\t\t\tisArray: false,\n\t\t\t\t\t\tdescription: el.short ?? el.definition,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (result[parentPath].some((f) => f.name === rawName)) continue;\n\n\t\t\tresult[parentPath].push({\n\t\t\t\tname: rawName,\n\t\t\t\tdatatype: el.type?.[0]?.code ?? \"\",\n\t\t\t\tisArray: el.max === \"*\",\n\t\t\t\tdescription: el.short ?? el.definition,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn result;\n}\n\nfunction transformReferenceFields(result: FhirPathChildren): void {\n\tfor (const [path, children] of Object.entries(result)) {\n\t\tconst hasReferenceField = children.some((c) => c.name === \"reference\");\n\t\tif (!hasReferenceField) continue;\n\n\t\tresult[path] = children.flatMap((child) => {\n\t\t\tif (child.name === \"reference\") {\n\t\t\t\treturn [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"id\",\n\t\t\t\t\t\tdatatype: \"string\",\n\t\t\t\t\t\tisArray: false,\n\t\t\t\t\t\tdescription: \"Resource ID\" as string | undefined,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"resourceType\",\n\t\t\t\t\t\tdatatype: \"string\",\n\t\t\t\t\t\tisArray: false,\n\t\t\t\t\t\tdescription: \"Resource type\" as string | undefined,\n\t\t\t\t\t},\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn [child];\n\t\t});\n\t}\n}\n\n// ── SQL parsing utilities ──\n\nconst SQL_TABLE_KEYWORDS =\n\t/\\b(?:from|join|inner\\s+join|left\\s+join|right\\s+join|full\\s+join|cross\\s+join|into|update|table)\\s+$/i;\n\nfunction isInsideString(textBefore: string): boolean {\n\tlet count = 0;\n\tfor (let i = 0; i < textBefore.length; i++) {\n\t\tif (textBefore[i] === \"'\") {\n\t\t\tif (i + 1 < textBefore.length && textBefore[i + 1] === \"'\") {\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t}\n\treturn count % 2 !== 0;\n}\n\nfunction isInJsonbContext(textBefore: string): boolean {\n\treturn parseJsonbChain(textBefore) !== null;\n}\n\nfunction parseJsonbChain(textBefore: string): JsonbChain | null {\n\tconst pathOpMatch = textBefore.match(/((?:\\w+\\.)?\\w+)\\s*#>>?\\s*'\\{([^}]*)$/);\n\tif (pathOpMatch) {\n\t\tconst ref = pathOpMatch[1]!;\n\t\tconst pathContent = pathOpMatch[2]!;\n\t\tconst segments = pathContent ? pathContent.split(\",\") : [];\n\t\tconst partialInput = segments.length > 0 ? (segments.pop() ?? \"\") : \"\";\n\t\tconst lastRawSegment =\n\t\t\tsegments.length > 0 ? (segments[segments.length - 1] ?? null) : null;\n\t\tconst path = segments.filter((s) => !/^\\d+$/.test(s));\n\n\t\tconst dotParts = ref.split(\".\");\n\t\tif (dotParts.length === 2) {\n\t\t\treturn {\n\t\t\t\ttableOrAlias: dotParts[0]!,\n\t\t\t\tcolumn: dotParts[1]!,\n\t\t\t\tpath,\n\t\t\t\tisPathOp: true,\n\t\t\t\tpartialInput,\n\t\t\t\tinsideQuote: false,\n\t\t\t\tlastRawSegment,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\ttableOrAlias: null,\n\t\t\tcolumn: dotParts[0]!,\n\t\t\tpath,\n\t\t\tisPathOp: true,\n\t\t\tpartialInput,\n\t\t\tinsideQuote: false,\n\t\t\tlastRawSegment,\n\t\t};\n\t}\n\n\tconst arrowPattern =\n\t\t/(?:((?:\\w+\\.)?\\w+)((?:\\s*->>?\\s*(?:'[^']*'|\\d+))*)\\s*->>?\\s*)('?)([^']*)?$/;\n\tconst arrowMatch = textBefore.match(arrowPattern);\n\tif (!arrowMatch) return null;\n\n\tconst ref = arrowMatch[1]!;\n\tconst chainPart = arrowMatch[2] || \"\";\n\tconst insideQuote = arrowMatch[3] === \"'\";\n\tconst partialInput = arrowMatch[4] ?? \"\";\n\n\tconst chainSegments: string[] = [];\n\tlet lastRawSeg: string | null = null;\n\tconst segmentRegex = /->>?\\s*(?:'([^']*)'|(\\d+))/g;\n\tfor (\n\t\tlet m = segmentRegex.exec(chainPart);\n\t\tm !== null;\n\t\tm = segmentRegex.exec(chainPart)\n\t) {\n\t\tconst seg = m[1] ?? m[2] ?? \"\";\n\t\tlastRawSeg = seg;\n\t\tif (!/^\\d+$/.test(seg)) {\n\t\t\tchainSegments.push(seg);\n\t\t}\n\t}\n\n\tconst dotParts = ref.split(\".\");\n\tif (dotParts.length === 2) {\n\t\treturn {\n\t\t\ttableOrAlias: dotParts[0]!,\n\t\t\tcolumn: dotParts[1]!,\n\t\t\tpath: chainSegments,\n\t\t\tisPathOp: false,\n\t\t\tpartialInput,\n\t\t\tinsideQuote,\n\t\t\tlastRawSegment: lastRawSeg,\n\t\t};\n\t}\n\treturn {\n\t\ttableOrAlias: null,\n\t\tcolumn: dotParts[0]!,\n\t\tpath: chainSegments,\n\t\tisPathOp: false,\n\t\tpartialInput,\n\t\tinsideQuote,\n\t\tlastRawSegment: lastRawSeg,\n\t};\n}\n\nfunction buildAliasMap(\n\tsql: string,\n\tschemas: SchemaMap,\n): Record<string, AliasEntry> {\n\tconst aliases: Record<string, AliasEntry> = {};\n\tconst regex = /\\b(?:FROM|JOIN)\\s+((?:\\w+\\.)?\\w+)(?:\\s+(?:AS\\s+)?(\\w+))?/gi;\n\n\tfor (let match = regex.exec(sql); match !== null; match = regex.exec(sql)) {\n\t\tconst fullTable = match[1]!;\n\t\tconst alias = match[2];\n\n\t\tlet schema: string;\n\t\tlet table: string;\n\t\tif (fullTable.includes(\".\")) {\n\t\t\tconst parts = fullTable.split(\".\");\n\t\t\tschema = parts[0]!;\n\t\t\ttable = parts[1]!;\n\t\t} else {\n\t\t\ttable = fullTable;\n\t\t\tlet found: string | null = null;\n\t\t\tfor (const [s, tables] of Object.entries(schemas)) {\n\t\t\t\tif (tables.includes(table)) {\n\t\t\t\t\tfound = s;\n\t\t\t\t\tif (s === \"public\") break;\n\t\t\t\t}\n\t\t\t}\n\t\t\tschema = found ?? \"public\";\n\t\t}\n\n\t\tif (alias) {\n\t\t\taliases[alias.toLowerCase()] = { schema, table };\n\t\t}\n\t\taliases[table.toLowerCase()] = { schema, table };\n\t}\n\n\treturn aliases;\n}\n\nfunction tableToResourceType(table: string): string {\n\treturn table\n\t\t.split(\"_\")\n\t\t.map((s) => s.charAt(0).toUpperCase() + s.slice(1))\n\t\t.join(\"\");\n}\n\nfunction getCurrentStatement(doc: string, pos: number): string {\n\tlet start = 0;\n\tlet end = doc.length;\n\n\tconst before = doc.lastIndexOf(\";\", pos - 1);\n\tif (before !== -1) start = before + 1;\n\n\tconst after = doc.indexOf(\";\", pos);\n\tif (after !== -1) end = after;\n\n\treturn doc.slice(start, end);\n}\n\n// ── Completion result builders ──\n\nfunction buildJsonbResult(\n\tchain: JsonbChain,\n\tpathChildren: FhirPathChildren,\n\tresourceType: string,\n\tcontext: CompletionContext,\n): CompletionResult | null {\n\tconst lookupPath =\n\t\tchain.path.length > 0\n\t\t\t? `${resourceType}.${chain.path.join(\".\")}`\n\t\t\t: resourceType;\n\n\tconst children = pathChildren[lookupPath];\n\tif (!children || children.length === 0) return null;\n\n\tconst partial = chain.partialInput.toLowerCase();\n\tconst filtered = partial\n\t\t? children.filter((f) => f.name.toLowerCase().startsWith(partial))\n\t\t: children;\n\n\tif (filtered.length === 0) return null;\n\n\tif (chain.isPathOp) {\n\t\treturn {\n\t\t\tfrom: context.pos - chain.partialInput.length,\n\t\t\tvalidFor: /^\\w*$/,\n\t\t\toptions: filtered.map(\n\t\t\t\t(f): Completion => ({\n\t\t\t\t\tlabel: f.name,\n\t\t\t\t\ttype: \"property\",\n\t\t\t\t\tdetail: f.datatype + (f.isArray ? \"[]\" : \"\"),\n\t\t\t\t\t...(f.description != null ? { info: f.description } : {}),\n\t\t\t\t}),\n\t\t\t),\n\t\t};\n\t}\n\n\tif (chain.insideQuote) {\n\t\treturn {\n\t\t\tfrom: context.pos - chain.partialInput.length,\n\t\t\tvalidFor: /^\\w*$/,\n\t\t\toptions: filtered.map(\n\t\t\t\t(f): Completion => ({\n\t\t\t\t\tlabel: f.name,\n\t\t\t\t\ttype: \"property\",\n\t\t\t\t\tdetail: f.datatype + (f.isArray ? \"[]\" : \"\"),\n\t\t\t\t\t...(f.description != null ? { info: f.description } : {}),\n\t\t\t\t\tapply: (\n\t\t\t\t\t\tview: EditorView,\n\t\t\t\t\t\t_completion: Completion,\n\t\t\t\t\t\tfrom: number,\n\t\t\t\t\t\tto: number,\n\t\t\t\t\t) => {\n\t\t\t\t\t\tconst after = view.state.sliceDoc(to, to + 1);\n\t\t\t\t\t\tconst end = after === \"'\" ? to + 1 : to;\n\t\t\t\t\t\tconst insert = `${f.name}'`;\n\t\t\t\t\t\tview.dispatch({\n\t\t\t\t\t\t\tchanges: { from, to: end, insert },\n\t\t\t\t\t\t\tselection: { anchor: from + insert.length },\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t),\n\t\t};\n\t}\n\n\treturn {\n\t\tfrom: context.pos - chain.partialInput.length,\n\t\tvalidFor: /^'?\\w*'?$/,\n\t\toptions: filtered.map(\n\t\t\t(f): Completion => ({\n\t\t\t\tlabel: `'${f.name}'`,\n\t\t\t\ttype: \"property\",\n\t\t\t\tdetail: f.datatype + (f.isArray ? \"[]\" : \"\"),\n\t\t\t\t...(f.description != null ? { info: f.description } : {}),\n\t\t\t\tapply: `'${f.name}'`,\n\t\t\t}),\n\t\t),\n\t};\n}\n\nfunction isArrayPosition(\n\tchain: JsonbChain,\n\tpathChildren: FhirPathChildren,\n\tresourceType: string,\n): boolean {\n\tif (!chain.lastRawSegment || /^\\d+$/.test(chain.lastRawSegment)) return false;\n\tif (!chain.isPathOp && chain.insideQuote) return false;\n\n\tconst fieldName = chain.lastRawSegment;\n\tconst parentPath =\n\t\tchain.path.length > 1\n\t\t\t? `${resourceType}.${chain.path.slice(0, -1).join(\".\")}`\n\t\t\t: resourceType;\n\tconst parentChildren = pathChildren[parentPath];\n\tif (!parentChildren) return false;\n\n\tconst element = parentChildren.find((f) => f.name === fieldName);\n\treturn !!element?.isArray;\n}\n\nfunction buildArrayIndexResult(\n\tchain: JsonbChain,\n\tcontext: CompletionContext,\n): CompletionResult {\n\treturn {\n\t\tfrom: context.pos - chain.partialInput.length,\n\t\toptions: [\n\t\t\t{\n\t\t\t\tlabel: \"0\",\n\t\t\t\ttype: \"enum\",\n\t\t\t\tdetail: \"array index\",\n\t\t\t},\n\t\t],\n\t};\n}\n\nasync function resolveNestedTypes(\n\tpathChildren: FhirPathChildren,\n\tresourceType: string,\n\tpath: string[],\n\tfetchSchema: (type: string) => Promise<FhirPathChildren | null>,\n): Promise<void> {\n\tfor (let i = 0; i < path.length; i++) {\n\t\tconst currentPath = `${resourceType}.${path.slice(0, i + 1).join(\".\")}`;\n\n\t\tif (pathChildren[currentPath]) continue;\n\n\t\tconst parentPath =\n\t\t\ti === 0 ? resourceType : `${resourceType}.${path.slice(0, i).join(\".\")}`;\n\t\tconst parentChildren = pathChildren[parentPath];\n\t\tif (!parentChildren) return;\n\n\t\tconst segmentName = path[i]!;\n\t\tconst element = parentChildren.find((f) => f.name === segmentName);\n\t\tif (!element?.datatype) return;\n\n\t\tif (element.datatype === \"union\") continue;\n\n\t\tconst firstChar = element.datatype[0]!;\n\t\tif (firstChar !== firstChar.toUpperCase()) return;\n\n\t\tconst typeChildren = await fetchSchema(element.datatype);\n\t\tif (!typeChildren) return;\n\n\t\tconst typeName = element.datatype;\n\t\tfor (const [key, children] of Object.entries(typeChildren)) {\n\t\t\tconst suffix = key === typeName ? \"\" : key.slice(typeName.length);\n\t\t\tpathChildren[currentPath + suffix] = children;\n\t\t}\n\t}\n}\n\n// ── Completion extensions ──\n\nfunction tableCompletionExtension(schemas: SchemaMap): Extension {\n\tconst source = (context: CompletionContext): CompletionResult | null => {\n\t\tconst line = context.state.doc.lineAt(context.pos);\n\t\tconst textBefore = line.text.slice(0, context.pos - line.from);\n\n\t\tif (isInsideString(textBefore)) return null;\n\n\t\tconst schemaDot = textBefore.match(/(\\w+)\\.(\\w*)$/);\n\t\tif (schemaDot) {\n\t\t\tconst schemaName = schemaDot[1]!;\n\t\t\tconst tables = schemas[schemaName];\n\t\t\tif (!tables) return null;\n\t\t\treturn {\n\t\t\t\tfrom: context.pos - (schemaDot[2] ?? \"\").length,\n\t\t\t\toptions: tables.map((t) => ({ label: t, type: \"table\" })),\n\t\t\t};\n\t\t}\n\n\t\tconst word = context.matchBefore(/\\w*/);\n\t\tif (!word) return null;\n\n\t\tconst beforeWord = textBefore.slice(0, word.from - line.from);\n\t\tif (!SQL_TABLE_KEYWORDS.test(beforeWord) && !context.explicit) return null;\n\n\t\tconst options: { label: string; type: string; detail?: string }[] = [];\n\n\t\tfor (const [schema, tables] of Object.entries(schemas)) {\n\t\t\toptions.push({ label: `${schema}.`, type: \"keyword\", detail: \"schema\" });\n\t\t\tfor (const table of tables) {\n\t\t\t\tif (schema === \"public\") {\n\t\t\t\t\toptions.push({ label: table, type: \"table\" });\n\t\t\t\t} else {\n\t\t\t\t\toptions.push({\n\t\t\t\t\t\tlabel: `${schema}.${table}`,\n\t\t\t\t\t\ttype: \"table\",\n\t\t\t\t\t\tdetail: schema,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { from: word.from, options };\n\t};\n\n\treturn EditorState.languageData.of(() => [{ autocomplete: source }]);\n}\n\nfunction columnCompletionExtension(ctx: {\n\tschemas: SchemaMap;\n\tcolumns: ColumnMap;\n}): Extension {\n\tconst source = (context: CompletionContext): CompletionResult | null => {\n\t\tconst line = context.state.doc.lineAt(context.pos);\n\t\tconst textBefore = line.text.slice(0, context.pos - line.from);\n\n\t\tif (isInsideString(textBefore)) return null;\n\n\t\tconst fullDoc = context.state.doc.toString();\n\t\tconst statement = getCurrentStatement(fullDoc, context.pos);\n\t\tconst aliases = buildAliasMap(statement, ctx.schemas);\n\n\t\tif (Object.keys(aliases).length === 0) return null;\n\n\t\tconst aliasDot = textBefore.match(/(\\w+)\\.(\\w*)$/);\n\t\tif (aliasDot) {\n\t\t\tconst beforeAlias = textBefore.slice(\n\t\t\t\t0,\n\t\t\t\ttextBefore.length - aliasDot[0].length,\n\t\t\t);\n\t\t\tif (SQL_TABLE_KEYWORDS.test(beforeAlias)) return null;\n\n\t\t\tconst aliasName = aliasDot[1]!;\n\t\t\tconst entry = aliases[aliasName.toLowerCase()];\n\t\t\tif (!entry) return null;\n\t\t\tconst key = `${entry.schema}.${entry.table}`;\n\t\t\tconst cols = ctx.columns[key];\n\t\t\tif (!cols || cols.length === 0) return null;\n\n\t\t\treturn {\n\t\t\t\tfrom: context.pos - (aliasDot[2] ?? \"\").length,\n\t\t\t\toptions: cols.map((c) => ({\n\t\t\t\t\tlabel: c.name,\n\t\t\t\t\ttype: \"variable\",\n\t\t\t\t\tdetail: c.dataType,\n\t\t\t\t})),\n\t\t\t};\n\t\t}\n\n\t\tconst word = context.matchBefore(/\\w*/);\n\t\tif (!word) return null;\n\t\tif (word.from === word.to && !context.explicit) return null;\n\n\t\tconst textBeforeWord = textBefore.slice(0, word.from - line.from);\n\t\tif (SQL_TABLE_KEYWORDS.test(textBeforeWord)) return null;\n\n\t\tconst seen = new Set<string>();\n\t\tconst options: { label: string; type: string; detail: string }[] = [];\n\t\tfor (const entry of Object.values(aliases)) {\n\t\t\tconst key = `${entry.schema}.${entry.table}`;\n\t\t\tconst cols = ctx.columns[key];\n\t\t\tif (!cols) continue;\n\t\t\tfor (const c of cols) {\n\t\t\t\tconst dedup = `${c.name}::${entry.table}`;\n\t\t\t\tif (seen.has(dedup)) continue;\n\t\t\t\tseen.add(dedup);\n\t\t\t\toptions.push({\n\t\t\t\t\tlabel: c.name,\n\t\t\t\t\ttype: \"variable\",\n\t\t\t\t\tdetail: `${c.dataType} · ${entry.table}`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (options.length === 0) return null;\n\t\treturn { from: word.from, options };\n\t};\n\n\treturn EditorState.languageData.of(() => [{ autocomplete: source }]);\n}\n\nfunction triggerCompletionAfter(view: EditorView) {\n\trequestAnimationFrame(() => startCompletion(view));\n}\n\nfunction jsonbOperatorExtension(): Extension {\n\tconst source = (context: CompletionContext): CompletionResult | null => {\n\t\tconst line = context.state.doc.lineAt(context.pos);\n\t\tconst textBefore = line.text.slice(0, context.pos - line.from);\n\n\t\tif (/\\w\\s*#$/.test(textBefore)) {\n\t\t\treturn {\n\t\t\t\tfrom: context.pos - 1,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"#>> '{}'\",\n\t\t\t\t\t\ttype: \"operator\",\n\t\t\t\t\t\tapply: (view, _completion, from, to) => {\n\t\t\t\t\t\t\tconst insert = \"#>> '{\";\n\t\t\t\t\t\t\tview.dispatch({\n\t\t\t\t\t\t\t\tchanges: { from, to, insert: `${insert}}' ` },\n\t\t\t\t\t\t\t\tselection: { anchor: from + insert.length },\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttriggerCompletionAfter(view);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"#> '{}'\",\n\t\t\t\t\t\ttype: \"operator\",\n\t\t\t\t\t\tapply: (view, _completion, from, to) => {\n\t\t\t\t\t\t\tconst insert = \"#> '{\";\n\t\t\t\t\t\t\tview.dispatch({\n\t\t\t\t\t\t\t\tchanges: { from, to, insert: `${insert}}' ` },\n\t\t\t\t\t\t\t\tselection: { anchor: from + insert.length },\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttriggerCompletionAfter(view);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\n\t\tif (/\\w\\s*->$/.test(textBefore) && !/\\w\\s*->>$/.test(textBefore)) {\n\t\t\treturn {\n\t\t\t\tfrom: context.pos - 2,\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"->> ''\",\n\t\t\t\t\t\ttype: \"operator\",\n\t\t\t\t\t\tapply: (view, _completion, from, to) => {\n\t\t\t\t\t\t\tconst insert = \"->> '\";\n\t\t\t\t\t\t\tview.dispatch({\n\t\t\t\t\t\t\t\tchanges: { from, to, insert: `${insert}' ` },\n\t\t\t\t\t\t\t\tselection: { anchor: from + insert.length },\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttriggerCompletionAfter(view);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"-> ''\",\n\t\t\t\t\t\ttype: \"operator\",\n\t\t\t\t\t\tapply: (view, _completion, from, to) => {\n\t\t\t\t\t\t\tconst insert = \"-> '\";\n\t\t\t\t\t\t\tview.dispatch({\n\t\t\t\t\t\t\t\tchanges: { from, to, insert: `${insert}' ` },\n\t\t\t\t\t\t\t\tselection: { anchor: from + insert.length },\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\ttriggerCompletionAfter(view);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"->> 0\",\n\t\t\t\t\t\ttype: \"operator\",\n\t\t\t\t\t\tapply: (view, _completion, from, to) => {\n\t\t\t\t\t\t\tconst insert = \"->> \";\n\t\t\t\t\t\t\tview.dispatch({\n\t\t\t\t\t\t\t\tchanges: { from, to, insert: `${insert}0 ` },\n\t\t\t\t\t\t\t\tselection: {\n\t\t\t\t\t\t\t\t\tanchor: from + insert.length,\n\t\t\t\t\t\t\t\t\thead: from + insert.length + 1,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"-> 0\",\n\t\t\t\t\t\ttype: \"operator\",\n\t\t\t\t\t\tapply: (view, _completion, from, to) => {\n\t\t\t\t\t\t\tconst insert = \"-> \";\n\t\t\t\t\t\t\tview.dispatch({\n\t\t\t\t\t\t\t\tchanges: { from, to, insert: `${insert}0 ` },\n\t\t\t\t\t\t\t\tselection: {\n\t\t\t\t\t\t\t\t\tanchor: from + insert.length,\n\t\t\t\t\t\t\t\t\thead: from + insert.length + 1,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn EditorState.languageData.of(() => [{ autocomplete: source }]);\n}\n\nfunction jsonbCompletionExtension(ctx: {\n\tschemas: SchemaMap;\n\tjsonbColumns: JsonbColumnMap;\n\tsdCache: Record<string, FhirPathChildren>;\n\tsdNotFound: Set<string>;\n\tfetchSchema: (type: string) => Promise<FhirPathChildren | null>;\n}): Extension {\n\tconst resolveChain = (\n\t\tcontext: CompletionContext,\n\t): { chain: JsonbChain; resourceType: string } | null => {\n\t\tconst line = context.state.doc.lineAt(context.pos);\n\t\tconst textBefore = line.text.slice(0, context.pos - line.from);\n\n\t\tconst chain = parseJsonbChain(textBefore);\n\t\tif (!chain) return null;\n\n\t\tconst fullDoc = context.state.doc.toString();\n\t\tconst statement = getCurrentStatement(fullDoc, context.pos);\n\t\tconst aliases = buildAliasMap(statement, ctx.schemas);\n\n\t\tlet resolved: AliasEntry | null = null;\n\n\t\tif (chain.tableOrAlias) {\n\t\t\tresolved = aliases[chain.tableOrAlias.toLowerCase()] ?? null;\n\t\t} else {\n\t\t\tfor (const entry of Object.values(aliases)) {\n\t\t\t\tconst key = `${entry.schema}.${entry.table}`;\n\t\t\t\tconst cols = ctx.jsonbColumns[key];\n\t\t\t\tif (cols?.includes(chain.column)) {\n\t\t\t\t\tresolved = entry;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!resolved) return null;\n\n\t\tconst jsonbKey = `${resolved.schema}.${resolved.table}`;\n\t\tconst jsonbCols = ctx.jsonbColumns[jsonbKey];\n\t\tif (!jsonbCols?.includes(chain.column)) return null;\n\n\t\tif (chain.column !== \"resource\") return null;\n\n\t\tconst resourceType = tableToResourceType(resolved.table);\n\t\tif (ctx.sdNotFound.has(resourceType)) return null;\n\n\t\treturn { chain, resourceType };\n\t};\n\n\tconst complete = async (\n\t\tchain: JsonbChain,\n\t\tresourceType: string,\n\t\tpathChildren: FhirPathChildren,\n\t\tcontext: CompletionContext,\n\t): Promise<CompletionResult | null> => {\n\t\tif (chain.path.length > 0) {\n\t\t\tawait resolveNestedTypes(\n\t\t\t\tpathChildren,\n\t\t\t\tresourceType,\n\t\t\t\tchain.path,\n\t\t\t\tctx.fetchSchema,\n\t\t\t);\n\t\t}\n\n\t\tif (isArrayPosition(chain, pathChildren, resourceType)) {\n\t\t\treturn buildArrayIndexResult(chain, context);\n\t\t}\n\n\t\treturn buildJsonbResult(chain, pathChildren, resourceType, context);\n\t};\n\n\tconst source = (\n\t\tcontext: CompletionContext,\n\t): CompletionResult | null | Promise<CompletionResult | null> => {\n\t\tconst info = resolveChain(context);\n\t\tif (!info) return null;\n\n\t\tconst { chain, resourceType } = info;\n\n\t\tconst cached = ctx.sdCache[resourceType];\n\t\tif (cached) {\n\t\t\tif (chain.path.length === 0) {\n\t\t\t\treturn buildJsonbResult(chain, cached, resourceType, context);\n\t\t\t}\n\t\t\treturn complete(chain, resourceType, cached, context);\n\t\t}\n\n\t\treturn ctx.fetchSchema(resourceType).then((fetched) => {\n\t\t\tif (!fetched) return null;\n\t\t\treturn complete(chain, resourceType, fetched, context);\n\t\t});\n\t};\n\n\treturn EditorState.languageData.of(() => [{ autocomplete: source }]);\n}\n\nfunction sqlCompletionOverride(): Extension {\n\treturn autocompletion({\n\t\toverride: [\n\t\t\tasync (context: CompletionContext): Promise<CompletionResult | null> => {\n\t\t\t\tconst line = context.state.doc.lineAt(context.pos);\n\t\t\t\tconst textBefore = line.text.slice(0, context.pos - line.from);\n\t\t\t\tconst inJsonb = isInJsonbContext(textBefore);\n\n\t\t\t\tconst langSources = context.state.languageDataAt<CompletionSource>(\n\t\t\t\t\t\"autocomplete\",\n\t\t\t\t\tcontext.pos,\n\t\t\t\t);\n\n\t\t\t\tconst results = (\n\t\t\t\t\tawait Promise.all(\n\t\t\t\t\t\tlangSources.map((src) => Promise.resolve(src(context))),\n\t\t\t\t\t)\n\t\t\t\t).filter((r): r is CompletionResult => r !== null);\n\n\t\t\t\tif (results.length === 0) return null;\n\n\t\t\t\tif (inJsonb) {\n\t\t\t\t\tconst jsonbTypes = new Set([\"property\", \"enum\", \"operator\"]);\n\t\t\t\t\tconst jsonbResult = results.find((r) =>\n\t\t\t\t\t\tr.options.some((o) => jsonbTypes.has(o.type ?? \"\")),\n\t\t\t\t\t);\n\t\t\t\t\tif (!jsonbResult) return null;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...jsonbResult,\n\t\t\t\t\t\toptions: jsonbResult.options.filter((o) =>\n\t\t\t\t\t\t\tjsonbTypes.has(o.type ?? \"\"),\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst aliasColumnResult = results.find(\n\t\t\t\t\t(r) =>\n\t\t\t\t\t\tr.options.length > 0 &&\n\t\t\t\t\t\tr.options.every((o) => o.type === \"variable\"),\n\t\t\t\t);\n\t\t\t\tif (aliasColumnResult) return aliasColumnResult;\n\n\t\t\t\tconst hasTableResults = results.some((r) =>\n\t\t\t\t\tr.options.some((o) => o.type === \"table\"),\n\t\t\t\t);\n\n\t\t\t\tif (hasTableResults) {\n\t\t\t\t\tconst tableOptions = results.flatMap((r) =>\n\t\t\t\t\t\tr.options.filter((o) => o.type === \"table\" || o.type === \"keyword\"),\n\t\t\t\t\t);\n\t\t\t\t\tconst from = results.find((r) =>\n\t\t\t\t\t\tr.options.some((o) => o.type === \"table\"),\n\t\t\t\t\t)?.from;\n\t\t\t\t\tif (from == null) return null;\n\t\t\t\t\treturn { from, options: tableOptions };\n\t\t\t\t}\n\n\t\t\t\tif (results.length === 1) return results[0]!;\n\n\t\t\t\tconst groups = new Map<\n\t\t\t\t\tnumber,\n\t\t\t\t\t{ from: number; options: Completion[] }\n\t\t\t\t>();\n\t\t\t\tfor (const r of results) {\n\t\t\t\t\tconst existing = groups.get(r.from);\n\t\t\t\t\tif (existing) {\n\t\t\t\t\t\texisting.options.push(...r.options);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgroups.set(r.from, {\n\t\t\t\t\t\t\tfrom: r.from,\n\t\t\t\t\t\t\toptions: [...r.options],\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet best: { from: number; options: Completion[] } | null = null;\n\t\t\t\tfor (const g of groups.values()) {\n\t\t\t\t\tif (!best || g.options.length > best.options.length) best = g;\n\t\t\t\t}\n\t\t\t\tif (best) {\n\t\t\t\t\tbest.options = best.options.map((o) => {\n\t\t\t\t\t\tif (o.type === \"keyword\") return { ...o, boost: 2 };\n\t\t\t\t\t\tif (o.type === \"type\") return { ...o, boost: 1 };\n\t\t\t\t\t\tif (o.type === \"variable\") return { ...o, boost: -1 };\n\t\t\t\t\t\treturn o;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn best;\n\t\t\t},\n\t\t],\n\t});\n}\n\n// ── Public API ──\n\nexport async function fetchSqlMetadata(\n\texecuteSql: SqlConfig[\"executeSql\"],\n): Promise<SqlMetadata> {\n\tconst [tablesRows, jsonbRows, functionsRows, columnsRows] = await Promise.all(\n\t\t[\n\t\t\texecuteSql(TABLES_QUERY, \"tables\"),\n\t\t\texecuteSql(JSONB_COLUMNS_QUERY, \"jsonb_columns\"),\n\t\t\texecuteSql(FUNCTIONS_QUERY, \"functions\"),\n\t\t\texecuteSql(COLUMNS_QUERY, \"columns\"),\n\t\t],\n\t);\n\n\tconst schemas: SchemaMap = {};\n\tfor (const row of tablesRows) {\n\t\tconst s = String(row.table_schema);\n\t\tif (!schemas[s]) schemas[s] = [];\n\t\tschemas[s].push(String(row.table_name));\n\t}\n\n\tconst jsonbColumns: JsonbColumnMap = {};\n\tfor (const row of jsonbRows) {\n\t\tconst key = `${row.table_schema}.${row.table_name}`;\n\t\tif (!jsonbColumns[key]) jsonbColumns[key] = [];\n\t\tjsonbColumns[key].push(String(row.column_name));\n\t}\n\n\tconst functions = functionsRows.map((r) => String(r.name));\n\n\tconst columns: ColumnMap = {};\n\tfor (const row of columnsRows) {\n\t\tconst key = `${row.table_schema}.${row.table_name}`;\n\t\tif (!columns[key]) columns[key] = [];\n\t\tcolumns[key].push({\n\t\t\tname: String(row.column_name),\n\t\t\tdataType: String(row.data_type),\n\t\t});\n\t}\n\n\treturn { schemas, jsonbColumns, functions, columns };\n}\n\nexport function buildSqlCompletionExtensions(\n\tmetadata: SqlMetadata,\n\texecuteSql: SqlConfig[\"executeSql\"],\n): Extension[] {\n\tconst sdCache: Record<string, FhirPathChildren> = {};\n\tconst sdNotFound = new Set<string>();\n\n\tconst fetchSchema = async (\n\t\tresourceType: string,\n\t): Promise<FhirPathChildren | null> => {\n\t\tif (sdCache[resourceType]) return sdCache[resourceType];\n\t\tif (sdNotFound.has(resourceType)) return null;\n\n\t\ttry {\n\t\t\tconst name = resourceType.replace(/'/g, \"''\");\n\t\t\tconst rows = await executeSql(\n\t\t\t\t`SELECT resource FROM far.canonicalresource WHERE rt = 'StructureDefinition' AND resource->>'name' = '${name}' LIMIT 1`,\n\t\t\t\t\"structure_definition\",\n\t\t\t);\n\t\t\tconst sd = (rows[0]?.resource ?? null) as StructureDefinition | null;\n\t\t\tif (!sd) {\n\t\t\t\tsdNotFound.add(resourceType);\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst pathChildren = buildFromStructureDefinition(sd);\n\t\t\ttransformReferenceFields(pathChildren);\n\t\t\tsdCache[resourceType] = pathChildren;\n\t\t\treturn pathChildren;\n\t\t} catch {\n\t\t\tsdNotFound.add(resourceType);\n\t\t\treturn null;\n\t\t}\n\t};\n\n\treturn [\n\t\tEditorView.theme({\n\t\t\t\".cm-tooltip.cm-tooltip-autocomplete\": {\n\t\t\t\tbackground: \"var(--color-bg-primary)\",\n\t\t\t\tborder: \"1px solid var(--color-border-primary)\",\n\t\t\t\tborderRadius: \"var(--radius-md)\",\n\t\t\t\tpadding: \"4px\",\n\t\t\t\tboxShadow: \"0 4px 12px rgba(0, 0, 0, 0.1)\",\n\t\t\t\tfontFamily: \"var(--font-family-sans)\",\n\t\t\t\tfontSize: \"14px\",\n\t\t\t},\n\t\t\t\".cm-tooltip.cm-tooltip-autocomplete > ul\": {\n\t\t\t\tmaxHeight: \"300px\",\n\t\t\t},\n\t\t\t\".cm-tooltip-autocomplete ul li\": {\n\t\t\t\tpadding: \"4px 8px\",\n\t\t\t\tborderRadius: \"4px\",\n\t\t\t},\n\t\t\t\".cm-tooltip-autocomplete ul li[aria-selected]\": {\n\t\t\t\tbackground: \"var(--color-bg-quaternary)\",\n\t\t\t\tcolor: \"var(--color-text-primary)\",\n\t\t\t},\n\t\t\t\".cm-completionLabel\": {\n\t\t\t\tcolor: \"var(--color-text-primary)\",\n\t\t\t\tfontSize: \"14px\",\n\t\t\t},\n\t\t\t\".cm-completionDetail\": {\n\t\t\t\tcolor: \"var(--color-text-tertiary)\",\n\t\t\t\tfontSize: \"12px\",\n\t\t\t\tfontStyle: \"normal\",\n\t\t\t\tmarginLeft: \"8px\",\n\t\t\t},\n\t\t\t\".cm-completionIcon\": {\n\t\t\t\tpadding: \"0\",\n\t\t\t\tmarginRight: \"6px\",\n\t\t\t\twidth: \"18px\",\n\t\t\t\theight: \"18px\",\n\t\t\t\tdisplay: \"inline-flex\",\n\t\t\t\talignItems: \"center\",\n\t\t\t\tjustifyContent: \"center\",\n\t\t\t\tborderRadius: \"4px\",\n\t\t\t\tfontSize: \"11px\",\n\t\t\t\tfontWeight: \"600\",\n\t\t\t\tlineHeight: \"1\",\n\t\t\t\tboxSizing: \"border-box\",\n\t\t\t},\n\t\t\t\".cm-completionIcon-table\": {\n\t\t\t\tbackground: \"var(--color-blue-100)\",\n\t\t\t\tcolor: \"var(--color-blue-600)\",\n\t\t\t},\n\t\t\t\".cm-completionIcon-table::after\": {\n\t\t\t\tcontent: \"'T'\",\n\t\t\t},\n\t\t\t\".cm-completionIcon-keyword\": {\n\t\t\t\tbackground: \"var(--color-green-200)\",\n\t\t\t\tcolor: \"var(--color-green-700)\",\n\t\t\t},\n\t\t\t\".cm-completionIcon-keyword::after\": {\n\t\t\t\tcontent: \"'S'\",\n\t\t\t},\n\t\t\t\".cm-completionIcon-property\": {\n\t\t\t\tbackground: \"var(--color-purple-100)\",\n\t\t\t\tcolor: \"var(--color-purple-600)\",\n\t\t\t},\n\t\t\t\".cm-completionIcon-property::after\": {\n\t\t\t\tcontent: \"'F'\",\n\t\t\t},\n\t\t\t\".cm-completionIcon-variable\": {\n\t\t\t\tbackground: \"var(--color-yellow-200)\",\n\t\t\t\tcolor: \"var(--color-yellow-700)\",\n\t\t\t},\n\t\t\t\".cm-completionIcon-variable::after\": {\n\t\t\t\tcontent: \"'C'\",\n\t\t\t},\n\t\t}),\n\t\ttableCompletionExtension(metadata.schemas),\n\t\tcolumnCompletionExtension({\n\t\t\tschemas: metadata.schemas,\n\t\t\tcolumns: metadata.columns,\n\t\t}),\n\t\tjsonbCompletionExtension({\n\t\t\tschemas: metadata.schemas,\n\t\t\tjsonbColumns: metadata.jsonbColumns,\n\t\t\tsdCache,\n\t\t\tsdNotFound,\n\t\t\tfetchSchema,\n\t\t}),\n\t\tjsonbOperatorExtension(),\n\t\tsqlCompletionOverride(),\n\t];\n}\n"],"names":["autocompletion","startCompletion","EditorState","EditorView","TABLES_QUERY","JSONB_COLUMNS_QUERY","FUNCTIONS_QUERY","COLUMNS_QUERY","isExpandedVariant","path","unionBases","parts","split","length","parentPath","slice","join","name","base","baseParts","baseName","baseParent","startsWith","test","buildFromStructureDefinition","sd","elements","snapshot","element","result","Set","el","pop","endsWith","add","replace","rawName","some","f","push","datatype","isArray","max","description","short","definition","unionPath","t","type","code","transformReferenceFields","children","Object","entries","hasReferenceField","c","flatMap","child","SQL_TABLE_KEYWORDS","isInsideString","textBefore","count","i","isInJsonbContext","parseJsonbChain","pathOpMatch","match","ref","pathContent","segments","partialInput","lastRawSegment","filter","s","dotParts","tableOrAlias","column","isPathOp","insideQuote","arrowPattern","arrowMatch","chainPart","chainSegments","lastRawSeg","segmentRegex","m","exec","seg","buildAliasMap","sql","schemas","aliases","regex","fullTable","alias","schema","table","includes","found","tables","toLowerCase","tableToResourceType","map","charAt","toUpperCase","getCurrentStatement","doc","pos","start","end","before","lastIndexOf","after","indexOf","buildJsonbResult","chain","pathChildren","resourceType","context","lookupPath","partial","filtered","from","validFor","options","label","detail","info","apply","view","_completion","to","state","sliceDoc","insert","dispatch","changes","selection","anchor","isArrayPosition","fieldName","parentChildren","find","buildArrayIndexResult","resolveNestedTypes","fetchSchema","currentPath","segmentName","firstChar","typeChildren","typeName","key","suffix","tableCompletionExtension","source","line","lineAt","text","schemaDot","schemaName","word","matchBefore","beforeWord","explicit","languageData","of","autocomplete","columnCompletionExtension","ctx","fullDoc","toString","statement","keys","aliasDot","beforeAlias","aliasName","entry","cols","columns","dataType","textBeforeWord","seen","values","dedup","has","triggerCompletionAfter","requestAnimationFrame","jsonbOperatorExtension","head","jsonbCompletionExtension","resolveChain","resolved","jsonbColumns","jsonbKey","jsonbCols","sdNotFound","complete","cached","sdCache","then","fetched","sqlCompletionOverride","override","inJsonb","langSources","languageDataAt","results","Promise","all","src","resolve","r","jsonbTypes","jsonbResult","o","aliasColumnResult","every","hasTableResults","tableOptions","groups","Map","existing","get","set","best","g","boost","fetchSqlMetadata","executeSql","tablesRows","jsonbRows","functionsRows","columnsRows","row","String","table_schema","table_name","column_name","functions","data_type","buildSqlCompletionExtensions","metadata","rows","resource","theme","background","border","borderRadius","padding","boxShadow","fontFamily","fontSize","maxHeight","color","fontStyle","marginLeft","marginRight","width","height","display","alignItems","justifyContent","fontWeight","lineHeight","boxSizing","content"],"mappings":"AAAA,SACCA,cAAc,EAKdC,eAAe,QACT,2BAA2B;AAClC,SAASC,WAAW,QAAwB,oBAAoB;AAChE,SAASC,UAAU,QAAQ,mBAAmB;AAwE9C,oBAAoB;AAEpB,MAAMC,eAAe,CAAC,wMAAwM,CAAC;AAE/N,MAAMC,sBAAsB,CAAC,6TAA6T,CAAC;AAE3V,MAAMC,kBAAkB,CAAC,8PAA8P,CAAC;AAExR,MAAMC,gBAAgB,CAAC,2WAA2W,CAAC;AAEnY,4CAA4C;AAE5C,SAASC,kBAAkBC,IAAY,EAAEC,UAAuB;IAC/D,MAAMC,QAAQF,KAAKG,KAAK,CAAC;IACzB,IAAID,MAAME,MAAM,GAAG,GAAG,OAAO;IAC7B,MAAMC,aAAaH,MAAMI,KAAK,CAAC,GAAG,CAAC,GAAGC,IAAI,CAAC;IAC3C,MAAMC,OAAON,KAAK,CAACA,MAA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Ac;YACf;YACA,iDAAiD;gBAChDF,YAAY;gBACZQ,OAAO;YACR;YACA,uBAAuB;gBACtBA,OAAO;gBACPF,UAAU;YACX;YACA,wBAAwB;gBACvBE,OAAO;gBACPF,UAAU;gBACVG,WAAW;gBACXC,YAAY;YACb;YACA,sBAAsB;gBACrBP,SAAS;gBACTQ,aAAa;gBACbC,OAAO;gBACPC,QAAQ;gBACRC,SAAS;gBACTC,YAAY;gBACZC,gBAAgB;gBAChBd,cAAc;gBACdI,UAAU;gBACVW,YAAY;gBACZC,YAAY;gBACZC,WAAW;YACZ;YACA,4BAA4B;gBAC3BnB,YAAY;gBACZQ,OAAO;YACR;YACA,mCAAmC;gBAClCY,SAAS;YACV;YACA,8BAA8B;gBAC7BpB,YAAY;gBACZQ,OAAO;YACR;YACA,qCAAqC;gBACpCY,SAAS;YACV;YACA,+BAA+B;gBAC9BpB,YAAY;gBACZQ,OAAO;YACR;YACA,sCAAsC;gBACrCY,SAAS;YACV;YACA,+BAA+B;gBAC9BpB,YAAY;gBACZQ,OAAO;YACR;YACA,sCAAsC;gBACrCY,SAAS;YACV;QACD;QACAhH,yBAAyBwF,SAASvJ,OAAO;QACzC6E,0BAA0B;YACzB7E,SAASuJ,SAASvJ,OAAO;YACzBwF,SAAS+D,SAAS/D,OAAO;QAC1B;QACAW,yBAAyB;YACxBnG,SAASuJ,SAASvJ,OAAO;YACzBsG,cAAciD,SAASjD,YAAY;YACnCM;YACAH;YACAlD;QACD;QACA0C;QACAc;KACA;AACF"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { AidboxClient, BrowserAuthProvider } from "@health-samurai/aidbox-client";
|
|
3
|
+
import { createCodeMirrorLsp } from "@health-samurai/aidbox-fhirpath-lsp";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Input } from "../shadcn/components/ui/input.js";
|
|
6
|
+
import { CodeEditor, EditorInput } from "./code-editor/index.js";
|
|
3
7
|
const meta = {
|
|
4
8
|
title: "Component/Editor",
|
|
5
9
|
component: CodeEditor,
|
|
@@ -31,8 +35,281 @@ export const Default = {
|
|
|
31
35
|
},
|
|
32
36
|
render: ()=>/*#__PURE__*/ _jsx("div", {
|
|
33
37
|
className: "h-[500px] w-[500px]",
|
|
34
|
-
children: /*#__PURE__*/ _jsx(CodeEditor, {
|
|
38
|
+
children: /*#__PURE__*/ _jsx(CodeEditor, {
|
|
39
|
+
mode: "http"
|
|
40
|
+
})
|
|
35
41
|
})
|
|
36
42
|
};
|
|
43
|
+
function parse(query) {
|
|
44
|
+
let hi = 0;
|
|
45
|
+
let lo = 0;
|
|
46
|
+
const res = {
|
|
47
|
+
method: "",
|
|
48
|
+
methodTrivia: "",
|
|
49
|
+
path: "",
|
|
50
|
+
pathTrivia: "",
|
|
51
|
+
headers: [],
|
|
52
|
+
headersTrivia: ""
|
|
53
|
+
};
|
|
54
|
+
// Note that we iterate by code units, but it doesn't change correctness.
|
|
55
|
+
// method
|
|
56
|
+
for(hi = 0; hi < query.length; ++hi){
|
|
57
|
+
const c = query[hi];
|
|
58
|
+
if (c === " " || c === "\t" || c === "\n") {
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
res.method = query.substring(lo, hi);
|
|
63
|
+
lo = hi;
|
|
64
|
+
if (lo >= query.length) {
|
|
65
|
+
return res;
|
|
66
|
+
}
|
|
67
|
+
// method trivia
|
|
68
|
+
for(hi = lo; hi < query.length; ++hi){
|
|
69
|
+
const c = query[hi];
|
|
70
|
+
if (!(c === " " || c === "\t")) {
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
res.methodTrivia = query.substring(lo, hi);
|
|
75
|
+
lo = hi;
|
|
76
|
+
if (lo >= query.length) {
|
|
77
|
+
return res;
|
|
78
|
+
}
|
|
79
|
+
// path
|
|
80
|
+
for(hi = lo; hi < query.length; ++hi){
|
|
81
|
+
const c = query[hi];
|
|
82
|
+
if (c === "\n") {
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
res.path = query.substring(lo, hi);
|
|
87
|
+
lo = hi;
|
|
88
|
+
if (lo >= query.length) {
|
|
89
|
+
return res;
|
|
90
|
+
}
|
|
91
|
+
// path trivia
|
|
92
|
+
if (query[hi] === "\n") {
|
|
93
|
+
hi += 1;
|
|
94
|
+
res.pathTrivia = query.substring(lo, hi);
|
|
95
|
+
}
|
|
96
|
+
lo = hi;
|
|
97
|
+
if (lo >= query.length) {
|
|
98
|
+
return res;
|
|
99
|
+
}
|
|
100
|
+
// headers
|
|
101
|
+
let header = {
|
|
102
|
+
name: "",
|
|
103
|
+
nameTrivia: "",
|
|
104
|
+
value: "",
|
|
105
|
+
valueTrivia: ""
|
|
106
|
+
};
|
|
107
|
+
let headerReady = false;
|
|
108
|
+
// SAFETY: don't decrease hi inside this loop.
|
|
109
|
+
for(hi = lo; hi < query.length; ++hi){
|
|
110
|
+
if (headerReady) {
|
|
111
|
+
res.headers.push(header);
|
|
112
|
+
}
|
|
113
|
+
header = {
|
|
114
|
+
name: "",
|
|
115
|
+
nameTrivia: "",
|
|
116
|
+
value: "",
|
|
117
|
+
valueTrivia: ""
|
|
118
|
+
};
|
|
119
|
+
headerReady = false;
|
|
120
|
+
if (query[hi] === "\n") {
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
// header name
|
|
124
|
+
for(lo = hi; hi < query.length; ++hi){
|
|
125
|
+
const c = query[hi];
|
|
126
|
+
if (c === " " || c === "\t" || c === "\n" || c === ":") {
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
headerReady = true;
|
|
131
|
+
header.name = query.substring(lo, hi);
|
|
132
|
+
lo = hi;
|
|
133
|
+
if (lo >= query.length) {
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
// header name trivia
|
|
137
|
+
let colonFound = false;
|
|
138
|
+
for(lo = hi; hi < query.length; ++hi){
|
|
139
|
+
const c = query[hi];
|
|
140
|
+
if (c === ":" && !colonFound) {
|
|
141
|
+
colonFound = true;
|
|
142
|
+
} else if (!(c === " " || c === "\t")) {
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
header.nameTrivia = query.substring(lo, hi);
|
|
147
|
+
lo = hi;
|
|
148
|
+
if (lo >= query.length) {
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
// header value
|
|
152
|
+
for(hi = lo; hi < query.length; ++hi){
|
|
153
|
+
const c = query[hi];
|
|
154
|
+
if (c === "\n") {
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
header.value = query.substring(lo, hi);
|
|
159
|
+
lo = hi;
|
|
160
|
+
if (lo >= query.length) {
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
// header value trivia
|
|
164
|
+
if (query[hi] === "\n") {
|
|
165
|
+
header.valueTrivia = query.substring(lo, hi + 1);
|
|
166
|
+
}
|
|
167
|
+
lo = hi + 1;
|
|
168
|
+
if (lo >= query.length) {
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (headerReady) {
|
|
173
|
+
res.headers.push(header);
|
|
174
|
+
}
|
|
175
|
+
if (query[hi] === "\n") {
|
|
176
|
+
res.headersTrivia = query.substring(lo, hi + 1);
|
|
177
|
+
}
|
|
178
|
+
return res;
|
|
179
|
+
}
|
|
180
|
+
const MethodInput = /*#__PURE__*/ React.memo(function MethodInput({ method, onMethodChange }) {
|
|
181
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
182
|
+
className: "flex justify-center items-baseline",
|
|
183
|
+
children: [
|
|
184
|
+
"Method:",
|
|
185
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
186
|
+
type: "text",
|
|
187
|
+
className: "inline",
|
|
188
|
+
value: method,
|
|
189
|
+
onChange: onMethodChange
|
|
190
|
+
})
|
|
191
|
+
]
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
const PathInput = /*#__PURE__*/ React.memo(function PathInput({ path, onPathChange }) {
|
|
195
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
196
|
+
className: "flex justify-center items-baseline",
|
|
197
|
+
children: [
|
|
198
|
+
"Path: ",
|
|
199
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
200
|
+
type: "text",
|
|
201
|
+
className: "inline",
|
|
202
|
+
value: path,
|
|
203
|
+
onChange: onPathChange
|
|
204
|
+
})
|
|
205
|
+
]
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
function ComplexComp() {
|
|
209
|
+
const [rawQuery, setRawQuery] = React.useState("");
|
|
210
|
+
const parsed = React.useMemo(()=>parse(rawQuery), [
|
|
211
|
+
rawQuery
|
|
212
|
+
]);
|
|
213
|
+
const parsedRef = React.useRef(parsed);
|
|
214
|
+
React.useEffect(()=>{
|
|
215
|
+
parsedRef.current = parsed;
|
|
216
|
+
}, [
|
|
217
|
+
parsed
|
|
218
|
+
]);
|
|
219
|
+
const method = React.useMemo(()=>parsed.method, [
|
|
220
|
+
parsed.method
|
|
221
|
+
]);
|
|
222
|
+
const path = React.useMemo(()=>parsed.path, [
|
|
223
|
+
parsed.path
|
|
224
|
+
]);
|
|
225
|
+
const viewRef = React.useRef(null);
|
|
226
|
+
const onMethodChange = React.useCallback((ev)=>{
|
|
227
|
+
let newVal = ev.target.value;
|
|
228
|
+
if (newVal.indexOf(" ") !== -1) {
|
|
229
|
+
newVal = newVal.replaceAll(" ", "").replaceAll("\t", "");
|
|
230
|
+
}
|
|
231
|
+
const view = viewRef.current;
|
|
232
|
+
if (view === null) {
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
const from = 0;
|
|
236
|
+
const to = parsedRef.current.method.length;
|
|
237
|
+
view.dispatch({
|
|
238
|
+
changes: {
|
|
239
|
+
from: from,
|
|
240
|
+
to: to,
|
|
241
|
+
insert: newVal
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}, []);
|
|
245
|
+
const onPathChange = React.useCallback((ev)=>{
|
|
246
|
+
const newVal = ev.target.value;
|
|
247
|
+
const view = viewRef.current;
|
|
248
|
+
if (view === null) {
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
const from = parsedRef.current.method.length + parsedRef.current.methodTrivia.length;
|
|
252
|
+
const to = from + parsedRef.current.path.length;
|
|
253
|
+
view.dispatch({
|
|
254
|
+
changes: {
|
|
255
|
+
from: from,
|
|
256
|
+
to: to,
|
|
257
|
+
insert: newVal
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
}, []);
|
|
261
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
262
|
+
children: [
|
|
263
|
+
/*#__PURE__*/ _jsx(MethodInput, {
|
|
264
|
+
method: method,
|
|
265
|
+
onMethodChange: onMethodChange
|
|
266
|
+
}),
|
|
267
|
+
/*#__PURE__*/ _jsx(PathInput, {
|
|
268
|
+
path: path,
|
|
269
|
+
onPathChange: onPathChange
|
|
270
|
+
}),
|
|
271
|
+
/*#__PURE__*/ _jsx("div", {
|
|
272
|
+
className: "h-[500px] w-[500px] border-black border-2",
|
|
273
|
+
children: /*#__PURE__*/ _jsx(CodeEditor, {
|
|
274
|
+
mode: "http",
|
|
275
|
+
onUpdate: (update)=>{
|
|
276
|
+
if (update.docChanged) {
|
|
277
|
+
setRawQuery(update.state.doc.toString());
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
viewCallback: (view)=>{
|
|
281
|
+
viewRef.current = view;
|
|
282
|
+
}
|
|
283
|
+
})
|
|
284
|
+
})
|
|
285
|
+
]
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
export const Complex = {
|
|
289
|
+
render: ()=>ComplexComp()
|
|
290
|
+
};
|
|
291
|
+
function FhirpathComp() {
|
|
292
|
+
const { extension, worker } = React.useMemo(()=>{
|
|
293
|
+
const client = new AidboxClient("http://localhost:8765", new BrowserAuthProvider("http://localhost:8765"));
|
|
294
|
+
return createCodeMirrorLsp(client, {
|
|
295
|
+
debug: true
|
|
296
|
+
});
|
|
297
|
+
}, []);
|
|
298
|
+
React.useEffect(()=>()=>worker.terminate(), [
|
|
299
|
+
worker
|
|
300
|
+
]);
|
|
301
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
302
|
+
className: "h-[500px] w-[500px]",
|
|
303
|
+
children: /*#__PURE__*/ _jsx(EditorInput, {
|
|
304
|
+
id: "fhirpath-editor-input",
|
|
305
|
+
additionalExtensions: [
|
|
306
|
+
extension
|
|
307
|
+
]
|
|
308
|
+
})
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
export const FhirpathExtension = {
|
|
312
|
+
render: ()=>/*#__PURE__*/ _jsx(FhirpathComp, {})
|
|
313
|
+
};
|
|
37
314
|
|
|
38
315
|
//# sourceMappingURL=code-editor.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/code-editor.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport { CodeEditor } from \"./code-editor\";\n\nconst meta: Meta<typeof CodeEditor> = {\n\ttitle: \"Component/Editor\",\n\tcomponent: CodeEditor,\n\tparameters: {\n\t\tlayout: \"centered\",\n\t},\n\ttags: [\"autodocs\"],\n};\n\nexport default meta;\ntype Story = StoryObj<typeof CodeEditor>;\n\nexport const Default: Story = {\n\targs: {\n\t\tdefaultValue: JSON.stringify(\n\t\t\t{\n\t\t\t\tresourceType: \"Patient\",\n\t\t\t\tmeta: { versionId: 10 },\n\t\t\t\tgender: \"male\",\n\t\t\t\tname: [{ family: \"Doe\", given: [\"John\"] }],\n\t\t\t},\n\t\t\tnull,\n\t\t\t2,\n\t\t),\n\t},\n\trender: () => (\n\t\t<div className=\"h-[500px] w-[500px]\">\n\t\t\t<CodeEditor />\n\t\t</div>\n\t),\n};\n"],"names":["CodeEditor","meta","title","component","parameters","layout","tags","Default","args","defaultValue","JSON","stringify","resourceType","versionId","gender","name","family","given","render","div","className"],"mappings":";AACA,SAASA,UAAU,QAAQ,yBAAgB;AAE3C,MAAMC,OAAgC;IACrCC,OAAO;IACPC,WAAWH;IACXI,YAAY;QACXC,QAAQ;IACT;IACAC,MAAM;QAAC;KAAW;AACnB;AAEA,eAAeL,KAAK;AAGpB,OAAO,MAAMM,UAAiB;IAC7BC,MAAM;QACLC,cAAcC,KAAKC,SAAS,CAC3B;YACCC,cAAc;YACdX,MAAM;gBAAEY,WAAW;YAAG;YACtBC,QAAQ;YACRC,MAAM;gBAAC;oBAAEC,QAAQ;oBAAOC,OAAO;wBAAC;qBAAO;gBAAC;aAAE;QAC3C,GACA,MACA;IAEF;IACAC,QAAQ,kBACP,KAACC;YAAIC,WAAU;sBACd,cAAA,KAACpB;;AAGJ,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/code-editor.stories.tsx"],"sourcesContent":["import type { EditorView } from \"@codemirror/view\";\nimport {\n\tAidboxClient,\n\tBrowserAuthProvider,\n} from \"@health-samurai/aidbox-client\";\nimport { createCodeMirrorLsp } from \"@health-samurai/aidbox-fhirpath-lsp\";\nimport type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport React from \"react\";\nimport { Input } from \"#shadcn/components/ui/input.js\";\nimport { CodeEditor, EditorInput } from \"./code-editor\";\n\nconst meta: Meta<typeof CodeEditor> = {\n\ttitle: \"Component/Editor\",\n\tcomponent: CodeEditor,\n\tparameters: {\n\t\tlayout: \"centered\",\n\t},\n\ttags: [\"autodocs\"],\n};\n\nexport default meta;\ntype Story = StoryObj<typeof CodeEditor>;\n\nexport const Default: Story = {\n\targs: {\n\t\tdefaultValue: JSON.stringify(\n\t\t\t{\n\t\t\t\tresourceType: \"Patient\",\n\t\t\t\tmeta: { versionId: 10 },\n\t\t\t\tgender: \"male\",\n\t\t\t\tname: [{ family: \"Doe\", given: [\"John\"] }],\n\t\t\t},\n\t\t\tnull,\n\t\t\t2,\n\t\t),\n\t},\n\trender: () => (\n\t\t<div className=\"h-[500px] w-[500px]\">\n\t\t\t<CodeEditor mode=\"http\" />\n\t\t</div>\n\t),\n};\n\ntype ParsedHeader = {\n\tname: string;\n\tnameTrivia: string;\n\tvalue: string;\n\tvalueTrivia: string;\n};\n\ntype Parsed = {\n\tmethod: string;\n\tmethodTrivia: string;\n\tpath: string;\n\tpathTrivia: string;\n\theaders: ParsedHeader[];\n\theadersTrivia: string;\n};\n\nfunction parse(query: string): Parsed {\n\tlet hi = 0;\n\tlet lo = 0;\n\tconst res: Parsed = {\n\t\tmethod: \"\",\n\t\tmethodTrivia: \"\",\n\t\tpath: \"\",\n\t\tpathTrivia: \"\",\n\t\theaders: [],\n\t\theadersTrivia: \"\",\n\t};\n\n\t// Note that we iterate by code units, but it doesn't change correctness.\n\t// method\n\tfor (hi = 0; hi < query.length; ++hi) {\n\t\tconst c = query[hi];\n\t\tif (c === \" \" || c === \"\\t\" || c === \"\\n\") {\n\t\t\tbreak;\n\t\t}\n\t}\n\tres.method = query.substring(lo, hi);\n\tlo = hi;\n\tif (lo >= query.length) {\n\t\treturn res;\n\t}\n\n\t// method trivia\n\tfor (hi = lo; hi < query.length; ++hi) {\n\t\tconst c = query[hi];\n\t\tif (!(c === \" \" || c === \"\\t\")) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tres.methodTrivia = query.substring(lo, hi);\n\tlo = hi;\n\tif (lo >= query.length) {\n\t\treturn res;\n\t}\n\n\t// path\n\tfor (hi = lo; hi < query.length; ++hi) {\n\t\tconst c = query[hi];\n\t\tif (c === \"\\n\") {\n\t\t\tbreak;\n\t\t}\n\t}\n\tres.path = query.substring(lo, hi);\n\tlo = hi;\n\tif (lo >= query.length) {\n\t\treturn res;\n\t}\n\n\t// path trivia\n\tif (query[hi] === \"\\n\") {\n\t\thi += 1;\n\t\tres.pathTrivia = query.substring(lo, hi);\n\t}\n\tlo = hi;\n\tif (lo >= query.length) {\n\t\treturn res;\n\t}\n\n\t// headers\n\tlet header: ParsedHeader = {\n\t\tname: \"\",\n\t\tnameTrivia: \"\",\n\t\tvalue: \"\",\n\t\tvalueTrivia: \"\",\n\t};\n\tlet headerReady = false;\n\t// SAFETY: don't decrease hi inside this loop.\n\tfor (hi = lo; hi < query.length; ++hi) {\n\t\tif (headerReady) {\n\t\t\tres.headers.push(header);\n\t\t}\n\t\theader = { name: \"\", nameTrivia: \"\", value: \"\", valueTrivia: \"\" };\n\t\theaderReady = false;\n\n\t\tif (query[hi] === \"\\n\") {\n\t\t\t// end of headers\n\t\t\tbreak;\n\t\t}\n\n\t\t// header name\n\t\tfor (lo = hi; hi < query.length; ++hi) {\n\t\t\tconst c = query[hi];\n\t\t\tif (c === \" \" || c === \"\\t\" || c === \"\\n\" || c === \":\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\theaderReady = true;\n\t\theader.name = query.substring(lo, hi);\n\t\tlo = hi;\n\t\tif (lo >= query.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// header name trivia\n\t\tlet colonFound = false;\n\t\tfor (lo = hi; hi < query.length; ++hi) {\n\t\t\tconst c = query[hi];\n\t\t\tif (c === \":\" && !colonFound) {\n\t\t\t\tcolonFound = true;\n\t\t\t} else if (!(c === \" \" || c === \"\\t\")) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\theader.nameTrivia = query.substring(lo, hi);\n\t\tlo = hi;\n\t\tif (lo >= query.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// header value\n\t\tfor (hi = lo; hi < query.length; ++hi) {\n\t\t\tconst c = query[hi];\n\t\t\tif (c === \"\\n\") {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\theader.value = query.substring(lo, hi);\n\t\tlo = hi;\n\t\tif (lo >= query.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// header value trivia\n\t\tif (query[hi] === \"\\n\") {\n\t\t\theader.valueTrivia = query.substring(lo, hi + 1);\n\t\t}\n\t\tlo = hi + 1;\n\t\tif (lo >= query.length) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (headerReady) {\n\t\tres.headers.push(header);\n\t}\n\n\tif (query[hi] === \"\\n\") {\n\t\tres.headersTrivia = query.substring(lo, hi + 1);\n\t}\n\n\treturn res;\n}\n\nconst MethodInput = React.memo(function MethodInput({\n\tmethod,\n\tonMethodChange,\n}: {\n\tmethod: string;\n\tonMethodChange: (ev: React.ChangeEvent<HTMLInputElement>) => void;\n}) {\n\treturn (\n\t\t<div className=\"flex justify-center items-baseline\">\n\t\t\tMethod:\n\t\t\t<Input\n\t\t\t\ttype=\"text\"\n\t\t\t\tclassName=\"inline\"\n\t\t\t\tvalue={method}\n\t\t\t\tonChange={onMethodChange}\n\t\t\t/>\n\t\t</div>\n\t);\n});\n\nconst PathInput = React.memo(function PathInput({\n\tpath,\n\tonPathChange,\n}: {\n\tpath: string;\n\tonPathChange: (ev: React.ChangeEvent<HTMLInputElement>) => void;\n}) {\n\treturn (\n\t\t<div className=\"flex justify-center items-baseline\">\n\t\t\t{\"Path: \"}\n\t\t\t<Input\n\t\t\t\ttype=\"text\"\n\t\t\t\tclassName=\"inline\"\n\t\t\t\tvalue={path}\n\t\t\t\tonChange={onPathChange}\n\t\t\t/>\n\t\t</div>\n\t);\n});\n\nfunction ComplexComp() {\n\tconst [rawQuery, setRawQuery] = React.useState(\"\");\n\tconst parsed = React.useMemo(() => parse(rawQuery), [rawQuery]);\n\tconst parsedRef = React.useRef(parsed);\n\tReact.useEffect(() => {\n\t\tparsedRef.current = parsed;\n\t}, [parsed]);\n\tconst method = React.useMemo(() => parsed.method, [parsed.method]);\n\tconst path = React.useMemo(() => parsed.path, [parsed.path]);\n\n\tconst viewRef = React.useRef<EditorView | null>(null);\n\n\tconst onMethodChange = React.useCallback(\n\t\t(ev: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tlet newVal = ev.target.value;\n\n\t\t\tif (newVal.indexOf(\" \") !== -1) {\n\t\t\t\tnewVal = newVal.replaceAll(\" \", \"\").replaceAll(\"\\t\", \"\");\n\t\t\t}\n\n\t\t\tconst view = viewRef.current;\n\t\t\tif (view === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst from = 0;\n\t\t\tconst to = parsedRef.current.method.length;\n\n\t\t\tview.dispatch({\n\t\t\t\tchanges: {\n\t\t\t\t\tfrom: from,\n\t\t\t\t\tto: to,\n\t\t\t\t\tinsert: newVal,\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst onPathChange = React.useCallback(\n\t\t(ev: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst newVal = ev.target.value;\n\n\t\t\tconst view = viewRef.current;\n\t\t\tif (view === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst from =\n\t\t\t\tparsedRef.current.method.length + parsedRef.current.methodTrivia.length;\n\t\t\tconst to = from + parsedRef.current.path.length;\n\n\t\t\tview.dispatch({\n\t\t\t\tchanges: {\n\t\t\t\t\tfrom: from,\n\t\t\t\t\tto: to,\n\t\t\t\t\tinsert: newVal,\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<MethodInput method={method} onMethodChange={onMethodChange} />\n\t\t\t<PathInput path={path} onPathChange={onPathChange} />\n\t\t\t<div className=\"h-[500px] w-[500px] border-black border-2\">\n\t\t\t\t<CodeEditor\n\t\t\t\t\tmode=\"http\"\n\t\t\t\t\tonUpdate={(update) => {\n\t\t\t\t\t\tif (update.docChanged) {\n\t\t\t\t\t\t\tsetRawQuery(update.state.doc.toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tviewCallback={(view) => {\n\t\t\t\t\t\tviewRef.current = view;\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport const Complex: Story = {\n\trender: () => ComplexComp(),\n};\n\nfunction FhirpathComp() {\n\tconst { extension, worker } = React.useMemo(() => {\n\t\tconst client = new AidboxClient(\n\t\t\t\"http://localhost:8765\",\n\t\t\tnew BrowserAuthProvider(\"http://localhost:8765\"),\n\t\t);\n\t\treturn createCodeMirrorLsp(client, { debug: true });\n\t}, []);\n\n\tReact.useEffect(() => () => worker.terminate(), [worker]);\n\n\treturn (\n\t\t<div className=\"h-[500px] w-[500px]\">\n\t\t\t<EditorInput\n\t\t\t\tid=\"fhirpath-editor-input\"\n\t\t\t\tadditionalExtensions={[extension]}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport const FhirpathExtension: Story = {\n\trender: () => <FhirpathComp />,\n};\n"],"names":["AidboxClient","BrowserAuthProvider","createCodeMirrorLsp","React","Input","CodeEditor","EditorInput","meta","title","component","parameters","layout","tags","Default","args","defaultValue","JSON","stringify","resourceType","versionId","gender","name","family","given","render","div","className","mode","parse","query","hi","lo","res","method","methodTrivia","path","pathTrivia","headers","headersTrivia","length","c","substring","header","nameTrivia","value","valueTrivia","headerReady","push","colonFound","MethodInput","memo","onMethodChange","type","onChange","PathInput","onPathChange","ComplexComp","rawQuery","setRawQuery","useState","parsed","useMemo","parsedRef","useRef","useEffect","current","viewRef","useCallback","ev","newVal","target","indexOf","replaceAll","view","from","to","dispatch","changes","insert","onUpdate","update","docChanged","state","doc","toString","viewCallback","Complex","FhirpathComp","extension","worker","client","debug","terminate","id","additionalExtensions","FhirpathExtension"],"mappings":";AACA,SACCA,YAAY,EACZC,mBAAmB,QACb,gCAAgC;AACvC,SAASC,mBAAmB,QAAQ,sCAAsC;AAE1E,OAAOC,WAAW,QAAQ;AAC1B,SAASC,KAAK,QAAQ,mCAAiC;AACvD,SAASC,UAAU,EAAEC,WAAW,QAAQ,yBAAgB;AAExD,MAAMC,OAAgC;IACrCC,OAAO;IACPC,WAAWJ;IACXK,YAAY;QACXC,QAAQ;IACT;IACAC,MAAM;QAAC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AM,KAAC+D;AAChB,EAAE"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
interface CopyIconProps {
|
|
2
2
|
text: string;
|
|
3
|
+
showTooltip?: boolean;
|
|
4
|
+
tooltipText?: string;
|
|
5
|
+
showToast?: boolean;
|
|
6
|
+
onCopy?: (text: string) => void;
|
|
3
7
|
}
|
|
4
|
-
declare function CopyIcon({ text }: CopyIconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function CopyIcon({ text, showTooltip, tooltipText, showToast, onCopy, ...props }: CopyIconProps): import("react/jsx-runtime").JSX.Element;
|
|
5
9
|
export { CopyIcon };
|
|
6
10
|
//# sourceMappingURL=copy-icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-icon.d.ts","sourceRoot":"","sources":["../../../src/components/copy-icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-icon.d.ts","sourceRoot":"","sources":["../../../src/components/copy-icon.tsx"],"names":[],"mappings":"AASA,UAAU,aAAa;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,iBAAS,QAAQ,CAAC,EACjB,IAAI,EACJ,WAAkB,EAClB,WAAoB,EACpB,SAAgB,EAChB,MAAM,EACN,GAAG,KAAK,EACR,EAAE,aAAa,2CAyDf;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,12 +1,33 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Check, Copy } from "lucide-react";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
|
|
4
|
+
import { toast } from "sonner";
|
|
5
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../shadcn/components/ui/tooltip.js";
|
|
6
|
+
function CopyIcon({ text, showTooltip = true, tooltipText = "Copy", showToast = true, onCopy, ...props }) {
|
|
5
7
|
const [isActive, setIsActive] = React.useState(false);
|
|
6
8
|
async function handleClick() {
|
|
7
9
|
try {
|
|
8
10
|
await navigator.clipboard.writeText(text);
|
|
9
11
|
setIsActive(true);
|
|
12
|
+
if (showToast) {
|
|
13
|
+
const truncatedText = text.length > 30 ? `${text.slice(0, 30)}...` : text;
|
|
14
|
+
toast(/*#__PURE__*/ _jsxs("div", {
|
|
15
|
+
className: "flex flex-col gap-1",
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ _jsx("span", {
|
|
18
|
+
className: "typo-body",
|
|
19
|
+
children: "Successfully copied"
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ _jsx("span", {
|
|
22
|
+
className: "typo-code text-text-secondary",
|
|
23
|
+
children: truncatedText
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
}), {
|
|
27
|
+
duration: 2000
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
onCopy?.(text);
|
|
10
31
|
setTimeout(()=>{
|
|
11
32
|
setIsActive(false);
|
|
12
33
|
}, 1000);
|
|
@@ -14,7 +35,8 @@ function CopyIcon({ text }) {
|
|
|
14
35
|
console.error("Failed to copy to clipboard:", error);
|
|
15
36
|
}
|
|
16
37
|
}
|
|
17
|
-
|
|
38
|
+
const button = /*#__PURE__*/ _jsx("button", {
|
|
39
|
+
...props,
|
|
18
40
|
type: "button",
|
|
19
41
|
onClick: handleClick,
|
|
20
42
|
style: {
|
|
@@ -22,6 +44,22 @@ function CopyIcon({ text }) {
|
|
|
22
44
|
},
|
|
23
45
|
children: isActive ? /*#__PURE__*/ _jsx(Check, {}) : /*#__PURE__*/ _jsx(Copy, {})
|
|
24
46
|
});
|
|
47
|
+
if (!showTooltip) {
|
|
48
|
+
return button;
|
|
49
|
+
}
|
|
50
|
+
return /*#__PURE__*/ _jsxs(Tooltip, {
|
|
51
|
+
children: [
|
|
52
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
53
|
+
asChild: true,
|
|
54
|
+
children: button
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
57
|
+
children: /*#__PURE__*/ _jsx("p", {
|
|
58
|
+
children: tooltipText
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
});
|
|
25
63
|
}
|
|
26
64
|
export { CopyIcon };
|
|
27
65
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/copy-icon.tsx"],"sourcesContent":["import { Check, Copy } from \"lucide-react\";\nimport * as React from \"react\";\n\ninterface CopyIconProps {\n\ttext: string;\n}\n\nfunction CopyIcon({
|
|
1
|
+
{"version":3,"sources":["../../../src/components/copy-icon.tsx"],"sourcesContent":["import { Check, Copy } from \"lucide-react\";\nimport * as React from \"react\";\nimport { toast } from \"sonner\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"#shadcn/components/ui/tooltip\";\n\ninterface CopyIconProps {\n\ttext: string;\n\tshowTooltip?: boolean;\n\ttooltipText?: string;\n\tshowToast?: boolean;\n\tonCopy?: (text: string) => void;\n}\n\nfunction CopyIcon({\n\ttext,\n\tshowTooltip = true,\n\ttooltipText = \"Copy\",\n\tshowToast = true,\n\tonCopy,\n\t...props\n}: CopyIconProps) {\n\tconst [isActive, setIsActive] = React.useState(false);\n\n\tasync function handleClick() {\n\t\ttry {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t\tsetIsActive(true);\n\n\t\t\tif (showToast) {\n\t\t\t\tconst truncatedText =\n\t\t\t\t\ttext.length > 30 ? `${text.slice(0, 30)}...` : text;\n\t\t\t\ttoast(\n\t\t\t\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t\t\t\t<span className=\"typo-body\">Successfully copied</span>\n\t\t\t\t\t\t<span className=\"typo-code text-text-secondary\">\n\t\t\t\t\t\t\t{truncatedText}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>,\n\t\t\t\t\t{\n\t\t\t\t\t\tduration: 2000,\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tonCopy?.(text);\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tsetIsActive(false);\n\t\t\t}, 1000);\n\t\t} catch (error) {\n\t\t\tconsole.error(\"Failed to copy to clipboard:\", error);\n\t\t}\n\t}\n\n\tconst button = (\n\t\t<button\n\t\t\t{...props}\n\t\t\ttype=\"button\"\n\t\t\tonClick={handleClick}\n\t\t\tstyle={{ cursor: \"pointer\" }}\n\t\t>\n\t\t\t{isActive ? <Check /> : <Copy />}\n\t\t</button>\n\t);\n\n\tif (!showTooltip) {\n\t\treturn button;\n\t}\n\n\treturn (\n\t\t<Tooltip>\n\t\t\t<TooltipTrigger asChild>{button}</TooltipTrigger>\n\t\t\t<TooltipContent>\n\t\t\t\t<p>{tooltipText}</p>\n\t\t\t</TooltipContent>\n\t\t</Tooltip>\n\t);\n}\n\nexport { CopyIcon };\n"],"names":["Check","Copy","React","toast","Tooltip","TooltipContent","TooltipTrigger","CopyIcon","text","showTooltip","tooltipText","showToast","onCopy","props","isActive","setIsActive","useState","handleClick","navigator","clipboard","writeText","truncatedText","length","slice","div","className","span","duration","setTimeout","error","console","button","type","onClick","style","cursor","asChild","p"],"mappings":";AAAA,SAASA,KAAK,EAAEC,IAAI,QAAQ,eAAe;AAC3C,YAAYC,WAAW,QAAQ;AAC/B,SAASC,KAAK,QAAQ,SAAS;AAC/B,SACCC,OAAO,EACPC,cAAc,EACdC,cAAc,QACR,qCAAgC;AAUvC,SAASC,SAAS,EACjBC,IAAI,EACJC,cAAc,IAAI,EAClBC,cAAc,MAAM,EACpBC,YAAY,IAAI,EAChBC,MAAM,EACN,GAAGC,OACY;IACf,MAAM,CAACC,UAAUC,YAAY,GAAGb,MAAMc,QAAQ,CAAC;IAE/C,eAAeC;QACd,IAAI;YACH,MAAMC,UAAUC,SAAS,CAACC,SAAS,CAACZ;YACpCO,YAAY;YAEZ,IAAIJ,WAAW;gBACd,MAAMU,gBACLb,KAAKc,MAAM,GAAG,KAAK,GAAGd,KAAKe,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,GAAGf;gBAChDL,oBACC,MAACqB;oBAAIC,WAAU;;sCACd,KAACC;4BAAKD,WAAU;sCAAY;;sCAC5B,KAACC;4BAAKD,WAAU;sCACdJ;;;oBAGH;oBACCM,UAAU;gBACX;YAEF;YAEAf,SAASJ;YAEToB,WAAW;gBACVb,YAAY;YACb,GAAG;QACJ,EAAE,OAAOc,OAAO;YACfC,QAAQD,KAAK,CAAC,gCAAgCA;QAC/C;IACD;IAEA,MAAME,uBACL,KAACA;QACC,GAAGlB,KAAK;QACTmB,MAAK;QACLC,SAAShB;QACTiB,OAAO;YAAEC,QAAQ;QAAU;kBAE1BrB,yBAAW,KAACd,2BAAW,KAACC;;IAI3B,IAAI,CAACQ,aAAa;QACjB,OAAOsB;IACR;IAEA,qBACC,MAAC3B;;0BACA,KAACE;gBAAe8B,OAAO;0BAAEL;;0BACzB,KAAC1B;0BACA,cAAA,KAACgC;8BAAG3B;;;;;AAIR;AAEA,SAASH,QAAQ,GAAG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type AccessorKeyColumnDef, type ColumnDef } from "@tanstack/react-table";
|
|
2
|
+
export interface DataTableProps<TData> {
|
|
3
|
+
columns: ColumnDef<TData, any>[];
|
|
4
|
+
data: TData[];
|
|
5
|
+
stickyHeader?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function DataTable<TData>({ columns, data, stickyHeader, }: DataTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export type { ColumnDef, AccessorKeyColumnDef };
|
|
9
|
+
//# sourceMappingURL=data-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../../src/components/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,SAAS,EAId,MAAM,uBAAuB,CAAC;AAW/B,MAAM,WAAW,cAAc,CAAC,KAAK;IAMpC,OAAO,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;IACjC,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,EAChC,OAAO,EACP,IAAI,EACJ,YAAoB,GACpB,EAAE,cAAc,CAAC,KAAK,CAAC,2CAyFvB;AAED,YAAY,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC"}
|