@health-samurai/react-components 0.0.0-alpha.18 → 0.0.0-alpha.20

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.
Files changed (74) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bundle.css +51 -33
  3. package/dist/src/components/code-editor/fhir-autocomplete.d.ts +70 -0
  4. package/dist/src/components/code-editor/fhir-autocomplete.d.ts.map +1 -0
  5. package/dist/src/components/code-editor/fhir-autocomplete.js +1849 -0
  6. package/dist/src/components/code-editor/fhir-autocomplete.js.map +1 -0
  7. package/dist/src/components/code-editor/fhir-autocomplete.test.js +1099 -0
  8. package/dist/src/components/code-editor/fhir-autocomplete.test.js.map +1 -0
  9. package/dist/src/components/code-editor/http/index.d.ts +9 -1
  10. package/dist/src/components/code-editor/http/index.d.ts.map +1 -1
  11. package/dist/src/components/code-editor/http/index.js +423 -3
  12. package/dist/src/components/code-editor/http/index.js.map +1 -1
  13. package/dist/src/components/code-editor/index.d.ts +13 -4
  14. package/dist/src/components/code-editor/index.d.ts.map +1 -1
  15. package/dist/src/components/code-editor/index.js +505 -96
  16. package/dist/src/components/code-editor/index.js.map +1 -1
  17. package/dist/src/components/code-editor/json-ast.d.ts +46 -0
  18. package/dist/src/components/code-editor/json-ast.d.ts.map +1 -0
  19. package/dist/src/components/code-editor/json-ast.js +465 -0
  20. package/dist/src/components/code-editor/json-ast.js.map +1 -0
  21. package/dist/src/components/code-editor/json-ast.test.js +206 -0
  22. package/dist/src/components/code-editor/json-ast.test.js.map +1 -0
  23. package/dist/src/components/code-editor/sql-completion.d.ts +22 -0
  24. package/dist/src/components/code-editor/sql-completion.d.ts.map +1 -0
  25. package/dist/src/components/code-editor/sql-completion.js +895 -0
  26. package/dist/src/components/code-editor/sql-completion.js.map +1 -0
  27. package/dist/src/components/date-picker-input.d.ts +10 -0
  28. package/dist/src/components/date-picker-input.d.ts.map +1 -0
  29. package/dist/src/components/date-picker-input.js +90 -0
  30. package/dist/src/components/date-picker-input.js.map +1 -0
  31. package/dist/src/components/date-picker-input.stories.js +76 -0
  32. package/dist/src/components/date-picker-input.stories.js.map +1 -0
  33. package/dist/src/index.d.ts +1 -0
  34. package/dist/src/index.d.ts.map +1 -1
  35. package/dist/src/index.js +1 -0
  36. package/dist/src/index.js.map +1 -1
  37. package/dist/src/shadcn/components/ui/alert-dialog.d.ts +1 -1
  38. package/dist/src/shadcn/components/ui/calendar.d.ts +1 -1
  39. package/dist/src/shadcn/components/ui/carousel.d.ts +1 -1
  40. package/dist/src/shadcn/components/ui/chart.d.ts +3 -3
  41. package/dist/src/shadcn/components/ui/chart.d.ts.map +1 -1
  42. package/dist/src/shadcn/components/ui/chart.js +1 -1
  43. package/dist/src/shadcn/components/ui/chart.js.map +1 -1
  44. package/dist/src/shadcn/components/ui/command.d.ts +1 -1
  45. package/dist/src/shadcn/components/ui/pagination.d.ts +1 -1
  46. package/dist/src/shadcn/components/ui/resizable.stories.js +2 -2
  47. package/dist/src/shadcn/components/ui/resizable.stories.js.map +1 -1
  48. package/dist/src/shadcn/components/ui/sidebar.d.ts +4 -4
  49. package/dist/src/shadcn/components/ui/tabs.d.ts +3 -1
  50. package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
  51. package/dist/src/shadcn/components/ui/tabs.js +129 -2
  52. package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
  53. package/dist/src/shadcn/components/ui/tabs.stories.js +1 -1
  54. package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -1
  55. package/dist/src/shadcn/components/ui/toggle-group.d.ts +1 -1
  56. package/dist/src/typography.css +1 -1
  57. package/package.json +24 -19
  58. package/src/components/code-editor/fhir-autocomplete.test.ts +993 -0
  59. package/src/components/code-editor/fhir-autocomplete.ts +2321 -0
  60. package/src/components/code-editor/http/index.ts +339 -2
  61. package/src/components/code-editor/index.tsx +593 -102
  62. package/src/components/code-editor/json-ast.test.ts +230 -0
  63. package/src/components/code-editor/json-ast.ts +590 -0
  64. package/src/components/code-editor/sql-completion.ts +1105 -0
  65. package/src/components/date-picker-input.stories.tsx +79 -0
  66. package/src/components/date-picker-input.tsx +104 -0
  67. package/src/index.tsx +1 -0
  68. package/src/shadcn/components/ui/chart.tsx +6 -3
  69. package/src/shadcn/components/ui/resizable.stories.tsx +2 -2
  70. package/src/shadcn/components/ui/tabs.stories.tsx +1 -1
  71. package/src/shadcn/components/ui/tabs.tsx +160 -2
  72. package/src/typography.css +1 -1
  73. package/dist/src/components/code-editor/http/grammar/http.test.d.ts +0 -2
  74. package/dist/src/components/code-editor/http/grammar/http.test.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/code-editor/http/index.ts"],"sourcesContent":["import {\n\tfoldInside,\n\tfoldNodeProp,\n\ttype Language,\n\tLanguageSupport,\n\tLRLanguage,\n} from \"@codemirror/language\";\nimport { parseMixed } from \"@lezer/common\";\nimport { styleTags, tags } from \"@lezer/highlight\";\nimport type { LRParser } from \"@lezer/lr\";\nimport { parser } from \"./grammar/http\";\n\nfunction makeParser(\n\tbodyLanguages: (contentType: string) => Language | null,\n): LRParser {\n\treturn parser.configure({\n\t\tprops: [\n\t\t\tstyleTags({\n\t\t\t\tHttpHeaderName: tags.variableName,\n\t\t\t\tHttpHeaderValue: tags.attributeValue,\n\t\t\t}),\n\n\t\t\tfoldNodeProp.add({\n\t\t\t\tHttpHeaders: foldInside,\n\t\t\t}),\n\t\t],\n\t\twrap: parseMixed((node, input) => {\n\t\t\tif (node.name !== \"HttpBody\") {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst headers = node.node.prevSibling;\n\t\t\tif (headers?.name !== \"HttpHeaders\") {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tlet contentType: string | null = null;\n\n\t\t\tfor (\n\t\t\t\tlet child = headers.firstChild;\n\t\t\t\tchild !== null;\n\t\t\t\tchild = child.nextSibling\n\t\t\t) {\n\t\t\t\tconst headerNameNode = child.getChild(\"HttpHeaderName\");\n\t\t\t\tif (headerNameNode === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst headerName = input.read(headerNameNode.from, headerNameNode.to);\n\t\t\t\tif (headerName.toLowerCase() !== \"content-type\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (contentType !== null) {\n\t\t\t\t\t// Disallow multiple content types\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tconst headerValueNode = child.getChild(\"HttpHeaderValue\");\n\t\t\t\tif (headerValueNode === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentType = input.read(headerValueNode.from, headerValueNode.to);\n\t\t\t}\n\n\t\t\tif (contentType === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst language = bodyLanguages(contentType);\n\t\t\tif (language === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn { parser: language.parser };\n\t\t}),\n\t});\n}\n\nfunction http(bodyLanguages: (contentType: string) => Language | null) {\n\tconst parser = makeParser(bodyLanguages);\n\tconst language = LRLanguage.define({ parser: parser });\n\treturn new LanguageSupport(language, []);\n}\n\nexport { http };\n"],"names":["foldInside","foldNodeProp","LanguageSupport","LRLanguage","parseMixed","styleTags","tags","parser","makeParser","bodyLanguages","configure","props","HttpHeaderName","variableName","HttpHeaderValue","attributeValue","add","HttpHeaders","wrap","node","input","name","headers","prevSibling","contentType","child","firstChild","nextSibling","headerNameNode","getChild","headerName","read","from","to","toLowerCase","headerValueNode","language","http","define"],"mappings":"AAAA,SACCA,UAAU,EACVC,YAAY,EAEZC,eAAe,EACfC,UAAU,QACJ,uBAAuB;AAC9B,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,SAAS,EAAEC,IAAI,QAAQ,mBAAmB;AAEnD,SAASC,MAAM,QAAQ,oBAAiB;AAExC,SAASC,WACRC,aAAuD;IAEvD,OAAOF,OAAOG,SAAS,CAAC;QACvBC,OAAO;Y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C,IAAI,GAAG"}
1
+ {"version":3,"sources":["../../../../../src/components/code-editor/http/index.ts"],"sourcesContent":["import {\n\tfoldInside,\n\tfoldNodeProp,\n\ttype Language,\n\tLanguageSupport,\n\tLRLanguage,\n\tsyntaxTree,\n} from \"@codemirror/language\";\nimport { RangeSetBuilder } from \"@codemirror/state\";\nimport {\n\tDecoration,\n\ttype DecorationSet,\n\tEditorView,\n\tViewPlugin,\n\ttype ViewUpdate,\n} from \"@codemirror/view\";\nimport { parseMixed } from \"@lezer/common\";\nimport { styleTags, tags } from \"@lezer/highlight\";\nimport type { LRParser } from \"@lezer/lr\";\nimport { parser } from \"./grammar/http\";\nimport { HttpRequestMethod } from \"./grammar/http.terms\";\n\nfunction makeParser(\n\tbodyLanguages: (contentType: string) => Language | null,\n): LRParser {\n\treturn parser.configure({\n\t\tprops: [\n\t\t\tstyleTags({\n\t\t\t\tHttpHeaderName: tags.variableName,\n\t\t\t\tHttpHeaderValue: tags.attributeValue,\n\t\t\t}),\n\n\t\t\tfoldNodeProp.add({\n\t\t\t\tHttpHeaders: foldInside,\n\t\t\t}),\n\t\t],\n\t\twrap: parseMixed((node, input) => {\n\t\t\tif (node.name !== \"HttpBody\") {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst headers = node.node.prevSibling;\n\t\t\tif (headers?.name !== \"HttpHeaders\") {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tlet contentType: string | null = null;\n\n\t\t\tfor (\n\t\t\t\tlet child = headers.firstChild;\n\t\t\t\tchild !== null;\n\t\t\t\tchild = child.nextSibling\n\t\t\t) {\n\t\t\t\tconst headerNameNode = child.getChild(\"HttpHeaderName\");\n\t\t\t\tif (headerNameNode === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst headerName = input.read(headerNameNode.from, headerNameNode.to);\n\t\t\t\tif (headerName.toLowerCase() !== \"content-type\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (contentType !== null) {\n\t\t\t\t\t// Disallow multiple content types\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tconst headerValueNode = child.getChild(\"HttpHeaderValue\");\n\t\t\t\tif (headerValueNode === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentType = input.read(headerValueNode.from, headerValueNode.to);\n\t\t\t}\n\n\t\t\tif (contentType === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst language = bodyLanguages(contentType);\n\t\t\tif (language === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn { parser: language.parser };\n\t\t}),\n\t});\n}\n\nconst methodDecorations: Record<string, Decoration> = {\n\tGET: Decoration.mark({ class: \"cm-http-method-get\" }),\n\tPOST: Decoration.mark({ class: \"cm-http-method-post\" }),\n\tPUT: Decoration.mark({ class: \"cm-http-method-put\" }),\n\tPATCH: Decoration.mark({ class: \"cm-http-method-patch\" }),\n\tDELETE: Decoration.mark({ class: \"cm-http-method-delete\" }),\n};\n\nfunction buildMethodDecorations(view: EditorView): DecorationSet {\n\tconst builder = new RangeSetBuilder<Decoration>();\n\tconst tree = syntaxTree(view.state);\n\ttree.iterate({\n\t\tenter(node) {\n\t\t\tif (node.type.id === HttpRequestMethod) {\n\t\t\t\tconst text = view.state.sliceDoc(node.from, node.to).toUpperCase();\n\t\t\t\tconst deco = methodDecorations[text];\n\t\t\t\tif (deco) {\n\t\t\t\t\tbuilder.add(node.from, node.to, deco);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n\treturn builder.finish();\n}\n\nconst httpMethodHighlighter = ViewPlugin.fromClass(\n\tclass {\n\t\tdecorations: DecorationSet;\n\t\tconstructor(view: EditorView) {\n\t\t\tthis.decorations = buildMethodDecorations(view);\n\t\t}\n\t\tupdate(update: ViewUpdate) {\n\t\t\tif (update.docChanged || update.viewportChanged) {\n\t\t\t\tthis.decorations = buildMethodDecorations(update.view);\n\t\t\t}\n\t\t}\n\t},\n\t{ decorations: (v) => v.decorations },\n);\n\nconst httpMethodTheme = EditorView.baseTheme({\n\t\".cm-http-method-get\": {\n\t\tcolor: \"var(--color-utility-green)\",\n\t},\n\t\".cm-http-method-post\": {\n\t\tcolor: \"var(--color-utility-yellow)\",\n\t},\n\t\".cm-http-method-put\": {\n\t\tcolor: \"var(--color-utility-blue)\",\n\t},\n\t\".cm-http-method-patch\": {\n\t\tcolor: \"var(--color-utility-violet)\",\n\t},\n\t\".cm-http-method-delete\": {\n\t\tcolor: \"var(--color-utility-red)\",\n\t},\n});\n\n// ── HTTP header autocomplete ────────────────────────────────────────────\n\nimport type {\n\tCompletion,\n\tCompletionContext,\n\tCompletionResult,\n} from \"@codemirror/autocomplete\";\nimport {\n\tHttpHeaderName,\n\tHttpHeaders,\n\tHttpHeaderValue,\n\tHttpRequestPath,\n} from \"./grammar/http.terms\";\n\nconst COMMON_HEADERS: Completion[] = [\n\t// Standard HTTP\n\t{ label: \"Accept\", type: \"header\", apply: \"Accept: \" },\n\t{ label: \"Accept-Encoding\", type: \"header\", apply: \"Accept-Encoding: \" },\n\t{ label: \"Accept-Language\", type: \"header\", apply: \"Accept-Language: \" },\n\t{ label: \"Authorization\", type: \"header\", apply: \"Authorization: \" },\n\t{ label: \"Cache-Control\", type: \"header\", apply: \"Cache-Control: \" },\n\t{ label: \"Content-Type\", type: \"header\", apply: \"Content-Type: \" },\n\t{ label: \"Cookie\", type: \"header\", apply: \"Cookie: \" },\n\t{ label: \"Host\", type: \"header\", apply: \"Host: \" },\n\t{ label: \"If-Match\", type: \"header\", apply: \"If-Match: \" },\n\t{ label: \"If-Modified-Since\", type: \"header\", apply: \"If-Modified-Since: \" },\n\t{ label: \"If-None-Match\", type: \"header\", apply: \"If-None-Match: \" },\n\t{ label: \"Origin\", type: \"header\", apply: \"Origin: \" },\n\t{ label: \"Prefer\", type: \"header\", apply: \"Prefer: \" },\n\t// Aidbox-specific\n\t{ label: \"x-audit\", type: \"header\", apply: \"x-audit: \" },\n\t{ label: \"x-correlation-id\", type: \"header\", apply: \"x-correlation-id: \" },\n\t{ label: \"x-debug\", type: \"header\", apply: \"x-debug: \" },\n\t{\n\t\tlabel: \"x-external-user-id\",\n\t\ttype: \"header\",\n\t\tapply: \"x-external-user-id: \",\n\t},\n\t{\n\t\tlabel: \"x-max-isolation-level\",\n\t\ttype: \"header\",\n\t\tapply: \"x-max-isolation-level: \",\n\t},\n\t{ label: \"x-original-uri\", type: \"header\", apply: \"x-original-uri: \" },\n\t{ label: \"x-request-id\", type: \"header\", apply: \"x-request-id: \" },\n\t{ label: \"x-use-ro-replica\", type: \"header\", apply: \"x-use-ro-replica: \" },\n\t{ label: \"su\", type: \"header\", apply: \"su: \" },\n\t{ label: \"traceparent\", type: \"header\", apply: \"traceparent: \" },\n];\n\n// Header value completions by header name\nconst HEADER_VALUES: Record<string, Completion[]> = {\n\t\"content-type\": [\n\t\t{ label: \"application/json\", type: \"text\" },\n\t\t{ label: \"application/fhir+json\", type: \"text\" },\n\t\t{ label: \"text/yaml\", type: \"text\" },\n\t\t{ label: \"application/ndjson\", type: \"text\" },\n\t\t{ label: \"application/gzip\", type: \"text\" },\n\t\t{ label: \"text/csv\", type: \"text\" },\n\t],\n\taccept: [\n\t\t{ label: \"application/json\", type: \"text\" },\n\t\t{ label: \"application/yaml\", type: \"text\" },\n\t\t{ label: \"text/yaml\", type: \"text\" },\n\t],\n\tprefer: [\n\t\t{ label: \"respond-async\", type: \"text\" },\n\t\t{ label: \"return=minimal\", type: \"text\" },\n\t\t{ label: \"return=representation\", type: \"text\" },\n\t\t{ label: \"return=OperationOutcome\", type: \"text\" },\n\t],\n\t\"x-debug\": [{ label: \"policy\", type: \"text\" }],\n\t\"x-max-isolation-level\": [\n\t\t{ label: \"read-committed\", type: \"text\" },\n\t\t{ label: \"repeatable-read\", type: \"text\" },\n\t\t{ label: \"serializable\", type: \"text\" },\n\t],\n\t\"cache-control\": [\n\t\t{ label: \"no-cache\", type: \"text\" },\n\t\t{ label: \"no-store\", type: \"text\" },\n\t\t{ label: \"max-age=0\", type: \"text\" },\n\t],\n\tauthorization: [\n\t\t{ label: \"Bearer \", type: \"text\" },\n\t\t{ label: \"Basic \", type: \"text\" },\n\t],\n};\n\nconst HTTP_METHODS: Completion[] = [\n\t\"GET\",\n\t\"POST\",\n\t\"PUT\",\n\t\"PATCH\",\n\t\"DELETE\",\n].map((method) => ({\n\tlabel: method,\n\ttype: \"keyword\" as const,\n\tapply: (view: EditorView, _c: Completion, from: number, to: number) => {\n\t\tconst line = view.state.doc.lineAt(from);\n\t\tconst afterTo = line.text.slice(to - line.from);\n\t\t// Skip whitespace after the method word to avoid double spaces\n\t\tconst wsMatch = afterTo.match(/^(\\s*)/);\n\t\tconst actualTo = to + (wsMatch?.[1]?.length ?? 0);\n\t\tconst rest = line.text.slice(actualTo - line.from);\n\t\tconst insert = rest.startsWith(\"/\") ? `${method} ` : `${method} /`;\n\t\tview.dispatch({\n\t\t\tchanges: { from, to: actualTo, insert },\n\t\t\tselection: { anchor: from + insert.length },\n\t\t});\n\t},\n}));\n\nfunction httpCompletionSource(\n\tcontext: CompletionContext,\n): CompletionResult | null {\n\tconst { state, pos } = context;\n\tconst tree = syntaxTree(state);\n\tconst node = tree.resolveInner(pos, -1);\n\n\tconst line = state.doc.lineAt(pos);\n\tconst beforeCursor = line.text.slice(0, pos - line.from);\n\n\t// Request method completion — first line, typing method\n\tif (\n\t\tnode.type.id === HttpRequestMethod ||\n\t\t(line.number === 1 && /^\\s*[a-zA-Z]*$/.test(beforeCursor))\n\t) {\n\t\tconst word = context.matchBefore(/[a-zA-Z]*/);\n\t\treturn {\n\t\t\tfrom: word?.from ?? pos,\n\t\t\toptions: HTTP_METHODS,\n\t\t\tvalidFor: /^[a-zA-Z]*$/i,\n\t\t};\n\t}\n\n\t// Header value completion — after colon\n\tconst colonIdx = beforeCursor.indexOf(\":\");\n\tif (colonIdx >= 0) {\n\t\tconst inHeaderValue = node.type.id === HttpHeaderValue;\n\t\tconst parentIsHeaders = node.parent?.type.id === HttpHeaders;\n\t\tif (\n\t\t\t!inHeaderValue &&\n\t\t\t!parentIsHeaders &&\n\t\t\tnode.parent?.parent?.type.id !== HttpHeaders\n\t\t)\n\t\t\treturn null;\n\n\t\tconst headerName = beforeCursor.slice(0, colonIdx).trim().toLowerCase();\n\t\tconst values = HEADER_VALUES[headerName];\n\t\tif (!values) return null;\n\n\t\tconst word = context.matchBefore(/\\S*/);\n\t\treturn {\n\t\t\tfrom: word?.from ?? pos,\n\t\t\toptions: values,\n\t\t\tvalidFor: /^\\S*$/,\n\t\t};\n\t}\n\n\t// Header name completion — before colon\n\tconst inHeaderName = node.type.id === HttpHeaderName;\n\tconst inHeaders = node.type.id === HttpHeaders;\n\tconst parentIsHeaders = node.parent?.type.id === HttpHeaders;\n\n\tif (!inHeaderName && !inHeaders && !parentIsHeaders) return null;\n\n\tconst word = context.matchBefore(/[\\w-]+/);\n\tif (!word) return null;\n\treturn {\n\t\tfrom: word.from,\n\t\toptions: COMMON_HEADERS,\n\t\tvalidFor: /^[\\w-]+$/,\n\t};\n}\n\nexport interface UrlSuggestion {\n\tlabel: string;\n\tvalue: string;\n\ttype?: string;\n\tdescription?: string;\n\texpression?: string;\n}\n\nexport type GetUrlSuggestions = (\n\tpath: string,\n\tmethod: string,\n) => UrlSuggestion[] | Promise<UrlSuggestion[]>;\n\nfunction httpUrlCompletionSource(\n\tgetUrlSuggestions: GetUrlSuggestions,\n): (context: CompletionContext) => Promise<CompletionResult | null> {\n\treturn async (\n\t\tcontext: CompletionContext,\n\t): Promise<CompletionResult | null> => {\n\t\tconst { state, pos } = context;\n\t\tconst tree = syntaxTree(state);\n\t\tconst node = tree.resolveInner(pos, -1);\n\n\t\tif (node.type.id !== HttpRequestPath) return null;\n\n\t\tconst line = state.doc.lineAt(pos);\n\t\tconst lineText = line.text;\n\t\t// Extract method from the beginning of the line\n\t\tconst methodMatch = lineText.match(/^\\s*(\\w+)\\s+/);\n\t\tif (!methodMatch?.[1]) return null;\n\t\tconst method = methodMatch[1].toUpperCase();\n\n\t\tconst pathStart = line.from + methodMatch[0].length;\n\t\tconst currentPath = state.sliceDoc(pathStart, pos);\n\n\t\tconst suggestions = await getUrlSuggestions(currentPath, method);\n\t\tif (suggestions.length === 0) return null;\n\n\t\tconst options: Completion[] = suggestions.map((s) => {\n\t\t\tconst c: Completion = {\n\t\t\t\tlabel: s.label,\n\t\t\t\ttype:\n\t\t\t\t\ts.type === \"resource-type\"\n\t\t\t\t\t\t? \"type\"\n\t\t\t\t\t\t: s.type === \"operation\"\n\t\t\t\t\t\t\t? \"function\"\n\t\t\t\t\t\t\t: s.type === \"search-param\"\n\t\t\t\t\t\t\t\t? \"search-param\"\n\t\t\t\t\t\t\t\t: \"text\",\n\t\t\t};\n\t\t\tif (s.type === \"search-param\") c.apply = `${s.label}=`;\n\t\t\telse if (s.type === \"path\" && s.label === \"fhir\") c.apply = `${s.label}/`;\n\t\t\tif (s.description) c.detail = s.description.toUpperCase();\n\t\t\tif (s.expression) c.info = s.expression;\n\t\t\treturn c;\n\t\t});\n\n\t\t// Match from the last segment separator (/ or ? or &)\n\t\tconst hasQuery = currentPath.includes(\"?\");\n\t\tlet from: number;\n\t\tif (hasQuery) {\n\t\t\tconst lastSep = Math.max(\n\t\t\t\tcurrentPath.lastIndexOf(\"?\"),\n\t\t\t\tcurrentPath.lastIndexOf(\"&\"),\n\t\t\t);\n\t\t\tfrom = pathStart + lastSep + 1;\n\t\t} else {\n\t\t\tconst lastSlash = currentPath.lastIndexOf(\"/\");\n\t\t\tfrom = pathStart + lastSlash + 1;\n\t\t}\n\n\t\treturn {\n\t\t\tfrom,\n\t\t\toptions,\n\t\t\tvalidFor: /^[^\\s&=]*/,\n\t\t};\n\t};\n}\n\nfunction http(\n\tbodyLanguages: (contentType: string) => Language | null,\n\tgetUrlSuggestions?: GetUrlSuggestions,\n) {\n\tconst parser = makeParser(bodyLanguages);\n\tconst language = LRLanguage.define({ parser: parser });\n\tconst extensions = [\n\t\thttpMethodHighlighter,\n\t\thttpMethodTheme,\n\t\tlanguage.data.of({ autocomplete: httpCompletionSource }),\n\t];\n\tif (getUrlSuggestions) {\n\t\textensions.push(\n\t\t\tlanguage.data.of({\n\t\t\t\tautocomplete: httpUrlCompletionSource(getUrlSuggestions),\n\t\t\t}),\n\t\t);\n\t}\n\treturn new LanguageSupport(language, extensions);\n}\n\nexport { http };\n"],"names":["foldInside","foldNodeProp","LanguageSupport","LRLanguage","syntaxTree","RangeSetBuilder","Decoration","EditorView","ViewPlugin","parseMixed","styleTags","tags","parser","HttpRequestMethod","makeParser","bodyLanguages","configure","props","HttpHeaderName","variableName","HttpHeaderValue","attributeValue","add","HttpHeaders","wrap","node","input","name","headers","prevSibling","contentType","child","firstChild","nextSibling","headerNameNode","getChild","headerName","read","from","to","toLowerCase","headerValueNode","language","methodDecorations","GET","mark","class","POST","PUT","PATCH","DELETE","buildMethodDecorations","view","builder","tree","state","iterate","enter","type","id","text","sliceDoc","toUpperCase","deco","finish","httpMethodHighlighter","fromClass","decorations","update","docChanged","viewportChanged","v","httpMethodTheme","baseTheme","color","HttpRequestPath","COMMON_HEADERS","label","apply","HEADER_VALUES","accept","prefer","authorization","HTTP_METHODS","map","method","_c","line","doc","lineAt","afterTo","slice","wsMatch","match","actualTo","length","rest","insert","startsWith","dispatch","changes","selection","anchor","httpCompletionSource","context","pos","resolveInner","beforeCursor","number","test","word","matchBefore","options","validFor","colonIdx","indexOf","inHeaderValue","parentIsHeaders","parent","trim","values","inHeaderName","inHeaders","httpUrlCompletionSource","getUrlSuggestions","lineText","methodMatch","pathStart","currentPath","suggestions","s","c","description","detail","expression","info","hasQuery","includes","lastSep","Math","max","lastIndexOf","lastSlash","http","define","extensions","data","of","autocomplete","push"],"mappings":"AAAA,SACCA,UAAU,EACVC,YAAY,EAEZC,eAAe,EACfC,UAAU,EACVC,UAAU,QACJ,uBAAuB;AAC9B,SAASC,eAAe,QAAQ,oBAAoB;AACpD,SACCC,UAAU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AGoD,EAAErD,KAAK,CAAC,CAAC,CAAC;YACzE,IAAIqD,EAAEE,WAAW,EAAED,EAAEE,MAAM,GAAGH,EAAEE,WAAW,CAACtE,WAAW;YACvD,IAAIoE,EAAEI,UAAU,EAAEH,EAAEI,IAAI,GAAGL,EAAEI,UAAU;YACvC,OAAOH;QACR;QAEA,sDAAsD;QACtD,MAAMK,WAAWR,YAAYS,QAAQ,CAAC;QACtC,IAAInG;QACJ,IAAIkG,UAAU;YACb,MAAME,UAAUC,KAAKC,GAAG,CACvBZ,YAAYa,WAAW,CAAC,MACxBb,YAAYa,WAAW,CAAC;YAEzBvG,OAAOyF,YAAYW,UAAU;QAC9B,OAAO;YACN,MAAMI,YAAYd,YAAYa,WAAW,CAAC;YAC1CvG,OAAOyF,YAAYe,YAAY;QAChC;QAEA,OAAO;YACNxG;YACA0E;YACAC,UAAU;QACX;IACD;AACD;AAEA,SAAS8B,KACRhI,aAAuD,EACvD6G,iBAAqC;IAErC,MAAMhH,SAASE,WAAWC;IAC1B,MAAM2B,WAAWvC,WAAW6I,MAAM,CAAC;QAAEpI,QAAQA;IAAO;IACpD,MAAMqI,aAAa;QAClBhF;QACAO;QACA9B,SAASwG,IAAI,CAACC,EAAE,CAAC;YAAEC,cAAc7C;QAAqB;KACtD;IACD,IAAIqB,mBAAmB;QACtBqB,WAAWI,IAAI,CACd3G,SAASwG,IAAI,CAACC,EAAE,CAAC;YAChBC,cAAczB,wBAAwBC;QACvC;IAEF;IACA,OAAO,IAAI1H,gBAAgBwC,UAAUuG;AACtC;AAEA,SAASF,IAAI,GAAG"}
@@ -1,5 +1,8 @@
1
1
  import { type Extension } from "@codemirror/state";
2
2
  import { EditorView, type ViewUpdate } from "@codemirror/view";
3
+ import { type ExpandValueSet, type GetStructureDefinitions } from "./fhir-autocomplete";
4
+ import { type GetUrlSuggestions } from "./http";
5
+ import { type SqlConfig } from "./sql-completion";
3
6
  type LanguageMode = "json" | "http" | "sql" | "yaml";
4
7
  type CodeEditorProps = {
5
8
  readOnly?: boolean;
@@ -17,12 +20,19 @@ type CodeEditorProps = {
17
20
  message?: string;
18
21
  }[];
19
22
  foldGutter?: boolean;
20
- lintGutter?: boolean;
21
23
  lineNumbers?: boolean;
22
- sqlExtraBuiltins?: string[];
24
+ sql?: SqlConfig;
25
+ getStructureDefinitions?: GetStructureDefinitions;
26
+ resourceTypeHint?: string;
27
+ expandValueSet?: ExpandValueSet;
28
+ getUrlSuggestions?: GetUrlSuggestions;
29
+ vimMode?: boolean;
23
30
  };
24
31
  export type CodeEditorView = EditorView;
25
- export declare function CodeEditor({ defaultValue, currentValue, onChange, onUpdate, viewCallback, readOnly, id, mode, isReadOnlyTheme, additionalExtensions, issueLineNumbers, foldGutter: enableFoldGutter, lintGutter: enableLintGutter, lineNumbers: enableLineNumbers, sqlExtraBuiltins, }: CodeEditorProps): import("react/jsx-runtime").JSX.Element;
32
+ export type { ExpandValueSet, GetStructureDefinitions, } from "./fhir-autocomplete";
33
+ export type { GetUrlSuggestions } from "./http";
34
+ export type { SqlConfig, SqlMetadata, SqlQueryType, } from "./sql-completion";
35
+ export declare function CodeEditor({ defaultValue, currentValue, onChange, onUpdate, viewCallback, readOnly, id, mode, isReadOnlyTheme, additionalExtensions, issueLineNumbers, foldGutter: enableFoldGutter, lineNumbers: enableLineNumbers, sql, getStructureDefinitions, resourceTypeHint, expandValueSet, getUrlSuggestions, vimMode, }: CodeEditorProps): import("react/jsx-runtime").JSX.Element;
26
36
  export declare function EditorInput({ additionalExtensions, id, defaultValue, currentValue, onChange, }: {
27
37
  additionalExtensions?: Extension[];
28
38
  id: string;
@@ -30,5 +40,4 @@ export declare function EditorInput({ additionalExtensions, id, defaultValue, cu
30
40
  currentValue?: string;
31
41
  onChange?: (value: string) => void;
32
42
  }): import("react/jsx-runtime").JSX.Element;
33
- export {};
34
43
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/code-editor/index.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