@api-client/ui 0.5.11 → 0.5.13
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/build/src/elements/code-editor/code-editor.d.ts +13 -0
- package/build/src/elements/code-editor/code-editor.d.ts.map +1 -0
- package/build/src/elements/code-editor/code-editor.js +28 -0
- package/build/src/elements/code-editor/code-editor.js.map +1 -0
- package/build/src/elements/code-editor/internals/CodeEditor.d.ts +159 -0
- package/build/src/elements/code-editor/internals/CodeEditor.d.ts.map +1 -0
- package/build/src/elements/code-editor/internals/CodeEditor.js +643 -0
- package/build/src/elements/code-editor/internals/CodeEditor.js.map +1 -0
- package/build/src/elements/code-editor/internals/CodeEditor.styles.d.ts +3 -0
- package/build/src/elements/code-editor/internals/CodeEditor.styles.d.ts.map +1 -0
- package/build/src/elements/code-editor/internals/CodeEditor.styles.js +154 -0
- package/build/src/elements/code-editor/internals/CodeEditor.styles.js.map +1 -0
- package/build/src/elements/code-editor/internals/Linter.d.ts +5 -0
- package/build/src/elements/code-editor/internals/Linter.d.ts.map +1 -0
- package/build/src/elements/code-editor/internals/Linter.js +69 -0
- package/build/src/elements/code-editor/internals/Linter.js.map +1 -0
- package/build/src/elements/code-editor/internals/PlaceholderWidget.d.ts +20 -0
- package/build/src/elements/code-editor/internals/PlaceholderWidget.d.ts.map +1 -0
- package/build/src/elements/code-editor/internals/PlaceholderWidget.js +46 -0
- package/build/src/elements/code-editor/internals/PlaceholderWidget.js.map +1 -0
- package/build/src/elements/code-editor/internals/SuggestionMatchDecorator.d.ts +17 -0
- package/build/src/elements/code-editor/internals/SuggestionMatchDecorator.d.ts.map +1 -0
- package/build/src/elements/code-editor/internals/SuggestionMatchDecorator.js +31 -0
- package/build/src/elements/code-editor/internals/SuggestionMatchDecorator.js.map +1 -0
- package/build/src/elements/code-editor/internals/types.d.ts +51 -0
- package/build/src/elements/code-editor/internals/types.d.ts.map +1 -0
- package/build/src/elements/code-editor/internals/types.js +2 -0
- package/build/src/elements/code-editor/internals/types.js.map +1 -0
- package/build/src/index.d.ts +2 -0
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +2 -0
- package/build/src/index.js.map +1 -1
- package/build/src/md/chip/internals/Chip.styles.d.ts.map +1 -1
- package/build/src/md/chip/internals/Chip.styles.js +1 -0
- package/build/src/md/chip/internals/Chip.styles.js.map +1 -1
- package/demo/elements/code-editor/CodeEditorDemo.ts +212 -0
- package/demo/elements/code-editor/index.html +19 -0
- package/demo/elements/index.html +3 -0
- package/package.json +10 -2
- package/src/elements/code-editor/README.md +204 -0
- package/src/elements/code-editor/code-editor.ts +24 -0
- package/src/elements/code-editor/internals/CodeEditor.styles.ts +154 -0
- package/src/elements/code-editor/internals/CodeEditor.ts +589 -0
- package/src/elements/code-editor/internals/Linter.ts +85 -0
- package/src/elements/code-editor/internals/PlaceholderWidget.ts +50 -0
- package/src/elements/code-editor/internals/SuggestionMatchDecorator.ts +36 -0
- package/src/elements/code-editor/internals/types.ts +54 -0
- package/src/index.ts +10 -0
- package/src/md/chip/internals/Chip.styles.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../../../../src/elements/code-editor/internals/CodeEditor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkC,OAAO,EAAE,MAAM,KAAK,CAAA;AAC/E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAa,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EACL,cAAc,GAKf,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,kBAAkB,EA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C,QAAQ,CAAC;gBACvB,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;gBACnC,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE;aAC1C,CAAC,CAAA;QACJ,CAAC;QAEQ,MAAM;YACb,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAA;YAC7B,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAA;YAE/C,OAAO,IAAI,CAAA;4BACa,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;;YAEtF,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAA,sBAAsB,IAAI,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO;;;;;UAKnE,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAA,gCAAgC,IAAI,CAAC,cAAc,QAAQ,CAAC,CAAC,CAAC,OAAO;;KAElG,CAAA;QACH,CAAC;;;AA7iBH;;;;;;;;;;;;;;GAcG;AACH","sourcesContent":["import { html, LitElement, PropertyValues, TemplateResult, nothing } from 'lit'\nimport { property, query, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { linter } from '@codemirror/lint'\nimport { EditorState, Extension } from '@codemirror/state'\nimport {\n autocompletion,\n CompletionContext,\n type CompletionResult,\n type CompletionSource,\n type Completion,\n} from '@codemirror/autocomplete'\nimport { javascript } from '@codemirror/lang-javascript'\nimport { syntaxHighlighting, defaultHighlightStyle } from '@codemirror/language'\nimport { oneDark } from '@codemirror/theme-one-dark'\nimport { keymap } from '@codemirror/view'\nimport { defaultKeymap } from '@codemirror/commands'\nimport {\n EditorView,\n Decoration,\n DecorationSet,\n ViewPlugin,\n ViewUpdate,\n hoverTooltip,\n type Tooltip,\n} from '@codemirror/view'\nimport { functionLinter } from './Linter.js'\nimport type { FunctionInsertEvent, FunctionSchema, Suggestion, SuggestionInsertEvent } from './types.js'\nimport { SuggestionMatchDecorator } from './SuggestionMatchDecorator.js'\n\n/**\n * A CodeMirror 6 based editor component that supports function autocomplete and suggestion placeholders.\n *\n * Features:\n * - Dynamic function schema loading\n * - Autocomplete for functions and suggestions\n * - Suggestion placeholders with double curly braces ({{suggestion}})\n * - Keyboard navigation\n * - Accessibility support\n *\n * @fires function-insert - When a function is inserted\n * @fires suggestion-insert - When a suggestion is inserted\n * @fires input - When the editor content changes\n * @fires change - When the editor loses focus and content has changed\n */\nexport default class CodeEditor extends LitElement {\n /**\n * Shadow root configuration for the component.\n * Uses 'open' mode for accessibility and delegates focus to enable proper focus management.\n */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n }\n\n /**\n * The label text displayed as placeholder/floating label\n */\n @property({ type: String })\n accessor label = ''\n\n /**\n * Supporting text displayed below the editor\n */\n @property({ type: String, attribute: 'supporting-text' })\n accessor supportingText = ''\n\n /**\n * Whether the component is disabled\n */\n @property({ type: Boolean, reflect: true })\n accessor disabled = false\n\n /**\n * Whether the component is in an invalid state\n */\n @property({ type: Boolean, reflect: true })\n accessor invalid = false\n\n /**\n * The name attribute for form integration\n */\n @property({ type: String })\n accessor name = ''\n\n /**\n * Whether the input is required\n */\n @property({ type: Boolean })\n accessor required = false\n\n /**\n * Placeholder text shown when editor is empty\n */\n @property({ type: String })\n accessor placeholder = ''\n\n /**\n * The editor content value\n */\n @property({ type: String })\n accessor value = ''\n\n /**\n * Available function schemas for autocomplete\n */\n @property({ type: Array, attribute: false })\n accessor functionSchemas: FunctionSchema[] = []\n\n /**\n * Available suggestions for autocomplete\n */\n @property({ type: Array, attribute: false })\n accessor suggestions: Suggestion[] = []\n\n /**\n * Whether to use dark theme\n */\n @property({ type: Boolean, attribute: 'dark-theme' })\n accessor darkTheme = false\n\n /**\n * Programming language for syntax highlighting\n */\n @property({ type: String })\n accessor language = 'javascript'\n\n @query('.editor-container')\n private accessor editorContainer!: HTMLDivElement\n\n @state()\n private accessor hasContent = false\n\n @state()\n private accessor isEditorFocus = false\n\n private editorView?: EditorView\n private _previousValue = ''\n /**\n * Matcher for suggestion placeholders in the editor.\n */\n placeholderMatcher?: SuggestionMatchDecorator\n\n /**\n * Get all suggestions (placeholders) currently in the editor\n */\n get activeSuggestions(): Suggestion[] {\n const suggestions: Suggestion[] = []\n const placeholderPattern = /\\{\\{(\\w+)\\}\\}/g\n let match: RegExpExecArray | null\n while ((match = placeholderPattern.exec(this.value)) !== null) {\n const placeholderText = match[1]\n // Find suggestion by label\n const suggestion = this.suggestions.find((s) => s.label.toLowerCase() === placeholderText.toLowerCase())\n if (suggestion) {\n suggestions.push(suggestion)\n }\n }\n return suggestions\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback()\n this.editorView?.destroy()\n }\n\n override firstUpdated(): void {\n this.initializeCodeMirror()\n this.updateEditorContent()\n }\n\n override willUpdate(changedProperties: PropertyValues): void {\n super.willUpdate(changedProperties)\n\n if (changedProperties.has('suggestions')) {\n if (this.placeholderMatcher) {\n this.placeholderMatcher.suggestions = this.suggestions || []\n }\n }\n\n if (changedProperties.has('value') && this.editorView) {\n this.updateEditorContent()\n }\n\n if (changedProperties.has('disabled')) {\n this.updateEditorState()\n }\n }\n\n /**\n * Initialize CodeMirror editor with extensions\n */\n private initializeCodeMirror(): void {\n const extensions: Extension[] = [\n keymap.of(defaultKeymap),\n syntaxHighlighting(defaultHighlightStyle),\n autocompletion({\n override: [this.createCompletionSource()],\n activateOnTyping: true,\n maxRenderedOptions: 10,\n }),\n EditorView.updateListener.of((update: ViewUpdate) => {\n if (update.docChanged) {\n this.handleEditorChange()\n }\n if (update.focusChanged) {\n this.handleFocusChange(update.view.hasFocus)\n }\n }),\n this.createPlaceholderPlugin(),\n hoverTooltip(this.createHoverTooltipSource),\n linter((view) => functionLinter(view, this.functionSchemas, (e) => this.dispatchEvent(e))),\n ]\n\n // Add language support\n if (this.language === 'javascript') {\n extensions.push(javascript())\n }\n\n // Add theme\n if (this.darkTheme) {\n extensions.push(oneDark)\n }\n\n // Add placeholder\n if (this.placeholder) {\n extensions.push(\n EditorView.contentAttributes.of({\n 'aria-placeholder': this.placeholder,\n })\n )\n }\n\n const state = EditorState.create({\n doc: this.value,\n extensions,\n })\n\n this.editorView = new EditorView({\n state,\n parent: this.editorContainer,\n })\n }\n\n /**\n * Creates the ViewPlugin for rendering suggestion placeholders.\n * This is created as a method to get access to the component's `suggestions`.\n */\n private createPlaceholderPlugin(): Extension {\n const placeholderMatcher = new SuggestionMatchDecorator(/\\{\\{(\\w+)\\}\\}/g, this.suggestions)\n this.placeholderMatcher = placeholderMatcher\n // This class needs to be defined here to have access to the `placeholderMatcher`\n class AtomicDecorationRange {\n placeholders: DecorationSet\n constructor(view: EditorView) {\n this.placeholders = placeholderMatcher.createDeco(view)\n }\n update(update: ViewUpdate) {\n this.placeholders = placeholderMatcher.updateDeco(update, this.placeholders)\n }\n }\n\n return ViewPlugin.fromClass(AtomicDecorationRange, {\n decorations: (instance) => instance.placeholders,\n provide: (plugin) => EditorView.atomicRanges.of((view) => view.plugin(plugin)?.placeholders || Decoration.none),\n })\n }\n\n /**\n * Create completion source for functions and suggestions\n */\n private createCompletionSource(): CompletionSource {\n return (context: CompletionContext): CompletionResult | null => {\n const { pos } = context\n const line = context.state.doc.lineAt(pos)\n const textBefore = line.text.slice(0, pos - line.from)\n\n // Check if we're typing a function name\n const functionMatch = textBefore.match(/(\\w+)$/)\n if (functionMatch) {\n const prefix = functionMatch[1]\n const functions = this.functionSchemas\n .filter((fn) => fn.name.toLowerCase().startsWith(prefix.toLowerCase()))\n .map((fn) => this.createFunctionCompletion(fn))\n\n if (functions.length > 0) {\n return {\n from: pos - prefix.length,\n options: functions,\n }\n }\n }\n\n // Check if we're typing a suggestion trigger (e.g., {{)\n const suggestionMatch = textBefore.match(/\\{\\{(\\w*)$/)\n if (suggestionMatch) {\n const prefix = suggestionMatch[1]\n const suggestions = this.suggestions\n .filter((suggestion) => suggestion.label.toLowerCase().startsWith(prefix.toLowerCase()))\n .map((suggestion) => this.createSuggestionCompletion(suggestion))\n\n if (suggestions.length > 0) {\n return {\n from: pos - prefix.length,\n options: suggestions,\n }\n }\n }\n\n return null\n }\n }\n\n private createFunctionCompletion(schema: FunctionSchema): Completion {\n const result: Completion = {\n label: schema.name,\n detail: schema.description || '',\n info: () => this.createFunctionInfoElement(schema),\n apply: (view: EditorView, completion: unknown, from: number, to: number) => {\n const functionCall = this.formatFunctionCall(schema)\n view.dispatch({\n changes: { from, to, insert: functionCall },\n selection: { anchor: from + functionCall.length },\n })\n this.dispatchFunctionInsert(schema, from)\n },\n }\n\n return result\n }\n\n private createSuggestionCompletion(suggestion: Suggestion): Completion {\n const result: Completion = {\n label: suggestion.label,\n detail: suggestion.description || '',\n info: suggestion.suffix || '',\n apply: (view: EditorView, completion: unknown, from: number, to: number) => {\n const placeholderText = `{{${suggestion.label}}}`\n view.dispatch({\n changes: { from: from - 2, to, insert: placeholderText }, // -2 to include the {{\n selection: { anchor: from - 2 + placeholderText.length },\n })\n this.dispatchSuggestionInsert(suggestion, from - 2)\n },\n }\n\n return result\n }\n\n /**\n * Creates the source for the hover tooltips.\n * This is an arrow function to automatically bind `this`.\n */\n private createHoverTooltipSource = (view: EditorView, pos: number): Tooltip | null => {\n const word = view.state.wordAt(pos)\n if (!word) {\n return null\n }\n\n const functionName = view.state.doc.sliceString(word.from, word.to)\n const fnSchema = this.functionSchemas.find((schema) => schema.name === functionName)\n\n if (!fnSchema) {\n return null\n }\n\n return {\n pos: word.from,\n end: word.to,\n above: true,\n create: () => ({ dom: this.createFunctionInfoElement(fnSchema) }),\n }\n }\n\n /**\n * Creates a styled HTML element to display function documentation.\n * This is used for both hover tooltips and autocomplete info panels.\n */\n private createFunctionInfoElement(fn: FunctionSchema): HTMLElement {\n const container = document.createElement('div')\n container.className = 'function-info' // for styling\n\n if (fn.description) {\n const description = document.createElement('p')\n description.className = 'description'\n description.textContent = fn.description\n container.appendChild(description)\n }\n\n if (fn.parameters && fn.parameters.length > 0) {\n const paramsContainer = document.createElement('div')\n paramsContainer.className = 'parameters'\n\n const paramsHeader = document.createElement('h4')\n paramsHeader.textContent = 'Parameters'\n paramsContainer.appendChild(paramsHeader)\n\n const paramsList = document.createElement('ul')\n fn.parameters.forEach((param) => {\n const listItem = document.createElement('li')\n\n const name = document.createElement('span')\n name.className = 'param-name'\n name.textContent = param.name\n\n const type = document.createElement('span')\n type.className = 'param-type'\n type.textContent = `: ${param.type}`\n\n listItem.appendChild(name)\n listItem.appendChild(type)\n\n if (param.description) {\n const paramDesc = document.createElement('p')\n paramDesc.className = 'param-description'\n paramDesc.textContent = param.description\n listItem.appendChild(paramDesc)\n }\n paramsList.appendChild(listItem)\n })\n paramsContainer.appendChild(paramsList)\n container.appendChild(paramsContainer)\n }\n\n if (fn.returns) {\n const returnsContainer = document.createElement('div')\n returnsContainer.className = 'returns'\n\n const returnsHeader = document.createElement('h4')\n returnsHeader.textContent = 'Returns'\n returnsContainer.appendChild(returnsHeader)\n\n const returnsDesc = document.createElement('p')\n returnsDesc.textContent = fn.returns\n returnsContainer.appendChild(returnsDesc)\n container.appendChild(returnsContainer)\n }\n\n return container\n }\n\n /**\n * Format function call with parameters\n */\n private formatFunctionCall(fn: FunctionSchema): string {\n if (!fn.parameters || fn.parameters.length === 0) {\n return `${fn.name}()`\n }\n\n const params = fn.parameters\n .map((param) => {\n if (param.required) {\n return param.name\n }\n return `${param.name}?`\n })\n .join(', ')\n\n return `${fn.name}(${params})`\n }\n\n /**\n * Update editor content when value changes\n */\n private updateEditorContent(): void {\n if (!this.editorView) return\n\n const currentValue = this.editorView.state.doc.toString()\n if (currentValue !== this.value) {\n this.editorView.dispatch({\n changes: {\n from: 0,\n to: this.editorView.state.doc.length,\n insert: this.value,\n },\n })\n }\n }\n\n /**\n * Update editor state (e.g., disabled state)\n */\n private updateEditorState(): void {\n if (!this.editorView) return\n\n // For now, we'll handle disabled state differently\n // CodeMirror 6 doesn't use reconfigure for editable\n if (this.disabled) {\n this.editorView.contentDOM.setAttribute('contenteditable', 'false')\n } else {\n this.editorView.contentDOM.setAttribute('contenteditable', 'true')\n }\n }\n\n /**\n * Handle editor content change\n */\n private handleEditorChange(): void {\n if (!this.editorView) return\n\n const newValue = this.editorView.state.doc.toString()\n if (newValue !== this._previousValue) {\n this._previousValue = newValue\n this.value = newValue\n this.hasContent = newValue.length > 0\n\n this.dispatchEvent(new Event('input', { bubbles: true }))\n }\n }\n\n /**\n * Handle focus change\n */\n private handleFocusChange(hasFocus: boolean): void {\n this.isEditorFocus = hasFocus\n\n if (!hasFocus && this.value !== this._previousValue) {\n this.dispatchEvent(new Event('change', { bubbles: true }))\n }\n }\n\n /**\n * Dispatch function insert event\n */\n private dispatchFunctionInsert(functionSchema: FunctionSchema, position: number): void {\n const event = new CustomEvent<FunctionInsertEvent>('function-insert', {\n detail: { functionSchema, position },\n bubbles: true,\n })\n this.dispatchEvent(event)\n }\n\n /**\n * Dispatch suggestion insert event\n */\n private dispatchSuggestionInsert(suggestion: Suggestion, position: number): void {\n const event = new CustomEvent<SuggestionInsertEvent>('suggestion-insert', {\n detail: { suggestion, position },\n bubbles: true,\n })\n this.dispatchEvent(event)\n }\n\n /**\n * Focus the editor\n */\n override focus(): void {\n this.editorView?.focus()\n }\n\n /**\n * Get the editor's current selection\n */\n getSelection(): { from: number; to: number } | null {\n if (!this.editorView) return null\n const { from, to } = this.editorView.state.selection.main\n return { from, to }\n }\n\n /**\n * Insert text at the current cursor position\n */\n insertText(text: string): void {\n if (!this.editorView) return\n\n const { from, to } = this.editorView.state.selection.main\n this.editorView.dispatch({\n changes: { from, to, insert: text },\n selection: { anchor: from + text.length },\n })\n }\n\n override render(): TemplateResult {\n const hasLabel = !!this.label\n const hasSupportingText = !!this.supportingText\n\n return html`\n <div class=\"surface ${classMap({ 'has-focus': this.isEditorFocus, 'invalid': this.invalid })}\">\n <div class=\"content\">\n ${hasLabel ? html`<div class=\"label\">${this.label}</div>` : nothing}\n\n <div class=\"editor-container\" part=\"editor\"></div>\n </div>\n\n ${hasSupportingText ? html`<div class=\"supporting-text\">${this.supportingText}</div>` : nothing}\n </div>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../../src/elements/code-editor/internals/CodeEditor.styles.ts"],"names":[],"mappings":";AAEA,wBAuJC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export default css `
|
|
3
|
+
:host {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
outline: none;
|
|
7
|
+
min-width: 200px;
|
|
8
|
+
background-color: transparent;
|
|
9
|
+
color: var(--md-sys-color-on-surface);
|
|
10
|
+
|
|
11
|
+
font-family: var(--md-sys-typescale-body-large-font);
|
|
12
|
+
font-size: var(--md-sys-typescale-body-large-size);
|
|
13
|
+
letter-spacing: var(--md-sys-typescale-body-large-tracking);
|
|
14
|
+
line-height: var(--md-sys-typescale-body-large-height);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.surface {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.content {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
flex: 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.label {
|
|
29
|
+
font-family: var(--md-sys-typescale-label-medium-font);
|
|
30
|
+
font-weight: var(--md-sys-typescale-label-medium-weight);
|
|
31
|
+
font-size: var(--md-sys-typescale-label-medium-size);
|
|
32
|
+
letter-spacing: var(--md-sys-typescale-label-medium-tracking);
|
|
33
|
+
line-height: var(--md-sys-typescale-label-medium-height);
|
|
34
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
35
|
+
|
|
36
|
+
padding: 8px 16px 4px 16px;
|
|
37
|
+
margin: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.has-focus .label {
|
|
41
|
+
color: var(--md-sys-color-primary);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.editor-container {
|
|
45
|
+
position: relative;
|
|
46
|
+
flex: 1;
|
|
47
|
+
|
|
48
|
+
border-radius: var(--md-sys-shape-corner-extra-small);
|
|
49
|
+
border: 1px solid var(--md-sys-color-outline);
|
|
50
|
+
outline: 0px solid var(--md-sys-color-primary);
|
|
51
|
+
outline-offset: -1px;
|
|
52
|
+
transition:
|
|
53
|
+
border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
54
|
+
outline-width 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
55
|
+
outline-offset 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.editor-container:focus-within {
|
|
59
|
+
border-color: var(--md-sys-color-primary);
|
|
60
|
+
outline-width: 2px;
|
|
61
|
+
outline-offset: -2px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.supporting-text {
|
|
65
|
+
margin-top: 4px;
|
|
66
|
+
padding: 0 16px;
|
|
67
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
68
|
+
font-family: var(--md-sys-typescale-body-small-font);
|
|
69
|
+
font-weight: var(--md-sys-typescale-body-small-weight);
|
|
70
|
+
font-size: var(--md-sys-typescale-body-small-size);
|
|
71
|
+
letter-spacing: var(--md-sys-typescale-body-small-tracking);
|
|
72
|
+
line-height: var(--md-sys-typescale-body-small-height);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host([disabled]) {
|
|
76
|
+
pointer-events: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([disabled]) .editor-container {
|
|
80
|
+
border-color: var(--md-sys-color-on-surface);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host([disabled]) .label,
|
|
84
|
+
:host([disabled]) .editor-container {
|
|
85
|
+
color: var(--md-sys-color-on-surface);
|
|
86
|
+
opacity: 0.38;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([invalid]) .label,
|
|
90
|
+
:host([invalid]) .supporting-text {
|
|
91
|
+
color: var(--md-sys-color-error);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([invalid]) .editor-container {
|
|
95
|
+
border-color: var(--md-sys-color-error);
|
|
96
|
+
outline-color: var(--md-sys-color-error);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.mention-chip {
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
margin: 0 2px;
|
|
103
|
+
vertical-align: baseline;
|
|
104
|
+
user-select: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.mention-chip ui-chip {
|
|
108
|
+
margin: 0;
|
|
109
|
+
font-size: inherit;
|
|
110
|
+
line-height: inherit;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.cm-gutters {
|
|
114
|
+
background: var(--md-sys-color-surface-variant);
|
|
115
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
116
|
+
border: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.cm-focused .cm-cursor {
|
|
120
|
+
border-left-color: var(--md-sys-color-primary);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
::selection {
|
|
124
|
+
background: var(--md-sys-color-surface-variant);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ͼ1.cm-focused {
|
|
128
|
+
outline: none;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.function-info {
|
|
132
|
+
padding: 8px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* Responsive */
|
|
136
|
+
@media (max-width: 600px) {
|
|
137
|
+
:host {
|
|
138
|
+
min-width: 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.label {
|
|
142
|
+
padding: 6px 6px 3px 6px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.editor-container {
|
|
146
|
+
padding: 6px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.supporting-text {
|
|
150
|
+
padding: 3px 6px 6px 6px;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
`;
|
|
154
|
+
//# sourceMappingURL=CodeEditor.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.styles.js","sourceRoot":"","sources":["../../../../../src/elements/code-editor/internals/CodeEditor.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuJjB,CAAA","sourcesContent":["import { css } from 'lit'\n\nexport default css`\n :host {\n display: flex;\n flex-direction: column;\n outline: none;\n min-width: 200px;\n background-color: transparent;\n color: var(--md-sys-color-on-surface);\n\n font-family: var(--md-sys-typescale-body-large-font);\n font-size: var(--md-sys-typescale-body-large-size);\n letter-spacing: var(--md-sys-typescale-body-large-tracking);\n line-height: var(--md-sys-typescale-body-large-height);\n }\n\n .surface {\n display: flex;\n flex-direction: column;\n }\n\n .content {\n display: flex;\n flex-direction: column;\n flex: 1;\n }\n\n .label {\n font-family: var(--md-sys-typescale-label-medium-font);\n font-weight: var(--md-sys-typescale-label-medium-weight);\n font-size: var(--md-sys-typescale-label-medium-size);\n letter-spacing: var(--md-sys-typescale-label-medium-tracking);\n line-height: var(--md-sys-typescale-label-medium-height);\n color: var(--md-sys-color-on-surface-variant);\n\n padding: 8px 16px 4px 16px;\n margin: 0;\n }\n\n .has-focus .label {\n color: var(--md-sys-color-primary);\n }\n\n .editor-container {\n position: relative;\n flex: 1;\n\n border-radius: var(--md-sys-shape-corner-extra-small);\n border: 1px solid var(--md-sys-color-outline);\n outline: 0px solid var(--md-sys-color-primary);\n outline-offset: -1px;\n transition:\n border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),\n outline-width 150ms cubic-bezier(0.4, 0, 0.2, 1),\n outline-offset 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n .editor-container:focus-within {\n border-color: var(--md-sys-color-primary);\n outline-width: 2px;\n outline-offset: -2px;\n }\n\n .supporting-text {\n margin-top: 4px;\n padding: 0 16px;\n color: var(--md-sys-color-on-surface-variant);\n font-family: var(--md-sys-typescale-body-small-font);\n font-weight: var(--md-sys-typescale-body-small-weight);\n font-size: var(--md-sys-typescale-body-small-size);\n letter-spacing: var(--md-sys-typescale-body-small-tracking);\n line-height: var(--md-sys-typescale-body-small-height);\n }\n\n :host([disabled]) {\n pointer-events: none;\n }\n\n :host([disabled]) .editor-container {\n border-color: var(--md-sys-color-on-surface);\n }\n\n :host([disabled]) .label,\n :host([disabled]) .editor-container {\n color: var(--md-sys-color-on-surface);\n opacity: 0.38;\n }\n\n :host([invalid]) .label,\n :host([invalid]) .supporting-text {\n color: var(--md-sys-color-error);\n }\n\n :host([invalid]) .editor-container {\n border-color: var(--md-sys-color-error);\n outline-color: var(--md-sys-color-error);\n }\n\n .mention-chip {\n display: inline-flex;\n align-items: center;\n margin: 0 2px;\n vertical-align: baseline;\n user-select: none;\n }\n\n .mention-chip ui-chip {\n margin: 0;\n font-size: inherit;\n line-height: inherit;\n }\n\n .cm-gutters {\n background: var(--md-sys-color-surface-variant);\n color: var(--md-sys-color-on-surface-variant);\n border: none;\n }\n\n .cm-focused .cm-cursor {\n border-left-color: var(--md-sys-color-primary);\n }\n\n ::selection {\n background: var(--md-sys-color-surface-variant);\n }\n\n .ͼ1.cm-focused {\n outline: none;\n }\n\n .function-info {\n padding: 8px;\n }\n\n /* Responsive */\n @media (max-width: 600px) {\n :host {\n min-width: 0;\n }\n\n .label {\n padding: 6px 6px 3px 6px;\n }\n\n .editor-container {\n padding: 6px;\n }\n\n .supporting-text {\n padding: 3px 6px 6px 6px;\n }\n }\n`\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Diagnostic } from '@codemirror/lint';
|
|
2
|
+
import type { EditorView } from '@codemirror/view';
|
|
3
|
+
import type { FunctionSchema } from './types.js';
|
|
4
|
+
export declare function functionLinter(view: EditorView, functionSchemas: readonly FunctionSchema[], dispatchEvent: (e: CustomEvent) => void): readonly Diagnostic[];
|
|
5
|
+
//# sourceMappingURL=Linter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Linter.d.ts","sourceRoot":"","sources":["../../../../../src/elements/code-editor/internals/Linter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,eAAe,EAAE,SAAS,cAAc,EAAE,EAC1C,aAAa,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,GACtC,SAAS,UAAU,EAAE,CA4EvB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export function functionLinter(view, functionSchemas, dispatchEvent) {
|
|
2
|
+
const diagnostics = [];
|
|
3
|
+
const doc = view.state.doc;
|
|
4
|
+
const text = doc.toString();
|
|
5
|
+
const functions = functionSchemas;
|
|
6
|
+
if (!functions || functions.length === 0) {
|
|
7
|
+
return diagnostics;
|
|
8
|
+
}
|
|
9
|
+
// Regular expression to match function calls like functionName(args)
|
|
10
|
+
const functionCallRegex = /(\w+)\s*\(/g;
|
|
11
|
+
let match;
|
|
12
|
+
while ((match = functionCallRegex.exec(text)) !== null) {
|
|
13
|
+
const functionName = match[1];
|
|
14
|
+
const startPos = match.index;
|
|
15
|
+
const endPos = startPos + functionName.length;
|
|
16
|
+
// Check if this function exists in our schemas
|
|
17
|
+
const fn = functions.find((schema) => schema.name === functionName);
|
|
18
|
+
if (!fn) {
|
|
19
|
+
diagnostics.push({
|
|
20
|
+
from: startPos,
|
|
21
|
+
to: endPos,
|
|
22
|
+
severity: 'error',
|
|
23
|
+
message: `Unknown function "${functionName}". Make sure you have the correct syntax for the function call.`,
|
|
24
|
+
actions: [
|
|
25
|
+
{
|
|
26
|
+
name: 'View available functions',
|
|
27
|
+
apply: () => {
|
|
28
|
+
dispatchEvent(new CustomEvent('show-available-functions', {
|
|
29
|
+
detail: { availableFunctions: [...functions] },
|
|
30
|
+
bubbles: true,
|
|
31
|
+
}));
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
// Extract the function call content to validate parameters
|
|
39
|
+
const functionCallMatch = text.substring(startPos).match(/(\w+)\s*\(([^)]*)\)/);
|
|
40
|
+
if (functionCallMatch && fn.parameters && fn.parameters.length > 0) {
|
|
41
|
+
const argsString = functionCallMatch[2].trim();
|
|
42
|
+
const args = argsString ? argsString.split(',').map((arg) => arg.trim()) : [];
|
|
43
|
+
// Check required parameters
|
|
44
|
+
const requiredParams = fn.parameters.filter((p) => p.required);
|
|
45
|
+
if (args.length < requiredParams.length) {
|
|
46
|
+
const functionEndPos = startPos + functionCallMatch[0].length;
|
|
47
|
+
diagnostics.push({
|
|
48
|
+
from: startPos,
|
|
49
|
+
to: functionEndPos,
|
|
50
|
+
severity: 'error',
|
|
51
|
+
message: `Function "${functionName}" requires ${requiredParams.length} parameters but got ${args.length}. Required: ${requiredParams.map((p) => p.name).join(', ')}`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
// Check if too many parameters
|
|
55
|
+
if (fn.parameters && args.length > fn.parameters.length) {
|
|
56
|
+
const functionEndPos = startPos + functionCallMatch[0].length;
|
|
57
|
+
diagnostics.push({
|
|
58
|
+
from: startPos,
|
|
59
|
+
to: functionEndPos,
|
|
60
|
+
severity: 'warning',
|
|
61
|
+
message: `Function "${functionName}" expects at most ${fn.parameters.length} parameters but got ${args.length}`,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return diagnostics;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=Linter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Linter.js","sourceRoot":"","sources":["../../../../../src/elements/code-editor/internals/Linter.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,cAAc,CAC5B,IAAgB,EAChB,eAA0C,EAC1C,aAAuC;IAEvC,MAAM,WAAW,GAAiB,EAAE,CAAA;IACpC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA;IAC1B,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAA;IAE3B,MAAM,SAAS,GAAG,eAAe,CAAA;IACjC,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,qEAAqE;IACrE,MAAM,iBAAiB,GAAG,aAAa,CAAA;IACvC,IAAI,KAA6B,CAAA;IAEjC,OAAO,CAAC,KAAK,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACvD,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QAC7B,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAA;QAC5B,MAAM,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAA;QAE7C,+CAA+C;QAC/C,MAAM,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC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AC,MAAM,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;oBACxC,MAAM,cAAc,GAAG,QAAQ,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;oBAC7D,WAAW,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE,QAAQ;wBACd,EAAE,EAAE,cAAc;wBAClB,QAAQ,EAAE,OAAO;wBACjB,OAAO,EAAE,aAAa,YAAY,cAAc,cAAc,CAAC,MAAM,uBAAuB,IAAI,CAAC,MAAM,eAAe,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;qBACrK,CAAC,CAAA;gBACJ,CAAC;gBAED,+BAA+B;gBAC/B,IAAI,EAAE,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;oBACxD,MAAM,cAAc,GAAG,QAAQ,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;oBAC7D,WAAW,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE,QAAQ;wBACd,EAAE,EAAE,cAAc;wBAClB,QAAQ,EAAE,SAAS;wBACnB,OAAO,EAAE,aAAa,YAAY,qBAAqB,EAAE,CAAC,UAAU,CAAC,MAAM,uBAAuB,IAAI,CAAC,MAAM,EAAE;qBAChH,CAAC,CAAA;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAA;AACpB,CAAC","sourcesContent":["import type { Diagnostic } from '@codemirror/lint'\nimport type { EditorView } from '@codemirror/view'\nimport type { FunctionSchema } from './types.js'\n\nexport function functionLinter(\n view: EditorView,\n functionSchemas: readonly FunctionSchema[],\n dispatchEvent: (e: CustomEvent) => void\n): readonly Diagnostic[] {\n const diagnostics: Diagnostic[] = []\n const doc = view.state.doc\n const text = doc.toString()\n\n const functions = functionSchemas\n if (!functions || functions.length === 0) {\n return diagnostics\n }\n\n // Regular expression to match function calls like functionName(args)\n const functionCallRegex = /(\\w+)\\s*\\(/g\n let match: RegExpExecArray | null\n\n while ((match = functionCallRegex.exec(text)) !== null) {\n const functionName = match[1]\n const startPos = match.index\n const endPos = startPos + functionName.length\n\n // Check if this function exists in our schemas\n const fn = functions.find((schema) => schema.name === functionName)\n\n if (!fn) {\n diagnostics.push({\n from: startPos,\n to: endPos,\n severity: 'error',\n message: `Unknown function \"${functionName}\". Make sure you have the correct syntax for the function call.`,\n actions: [\n {\n name: 'View available functions',\n apply: () => {\n dispatchEvent(\n new CustomEvent('show-available-functions', {\n detail: { availableFunctions: [...functions] },\n bubbles: true,\n })\n )\n },\n },\n ],\n })\n } else {\n // Extract the function call content to validate parameters\n const functionCallMatch = text.substring(startPos).match(/(\\w+)\\s*\\(([^)]*)\\)/)\n if (functionCallMatch && fn.parameters && fn.parameters.length > 0) {\n const argsString = functionCallMatch[2].trim()\n const args = argsString ? argsString.split(',').map((arg) => arg.trim()) : []\n\n // Check required parameters\n const requiredParams = fn.parameters.filter((p) => p.required)\n if (args.length < requiredParams.length) {\n const functionEndPos = startPos + functionCallMatch[0].length\n diagnostics.push({\n from: startPos,\n to: functionEndPos,\n severity: 'error',\n message: `Function \"${functionName}\" requires ${requiredParams.length} parameters but got ${args.length}. Required: ${requiredParams.map((p) => p.name).join(', ')}`,\n })\n }\n\n // Check if too many parameters\n if (fn.parameters && args.length > fn.parameters.length) {\n const functionEndPos = startPos + functionCallMatch[0].length\n diagnostics.push({\n from: startPos,\n to: functionEndPos,\n severity: 'warning',\n message: `Function \"${functionName}\" expects at most ${fn.parameters.length} parameters but got ${args.length}`,\n })\n }\n }\n }\n }\n\n return diagnostics\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EditorView, WidgetType } from '@codemirror/view';
|
|
2
|
+
import type { Suggestion } from './types.js';
|
|
3
|
+
import '../../../md/chip/ui-chip.js';
|
|
4
|
+
/**
|
|
5
|
+
* A widget that represents a placeholder in the code editor,
|
|
6
|
+
* specifically for suggestions that are replaced with chips.
|
|
7
|
+
*
|
|
8
|
+
* This widget is used to create a visual representation of a suggestion
|
|
9
|
+
* in the code editor, allowing users to see and interact with suggestions
|
|
10
|
+
* as chips. When a chip is removed, the corresponding text in the editor
|
|
11
|
+
* is also removed.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ChipWidget extends WidgetType {
|
|
14
|
+
suggestion: Suggestion;
|
|
15
|
+
constructor(suggestion: Suggestion);
|
|
16
|
+
eq(other: WidgetType): boolean;
|
|
17
|
+
toDOM(view: EditorView): HTMLElement;
|
|
18
|
+
ignoreEvent(): boolean;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=PlaceholderWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaceholderWidget.d.ts","sourceRoot":"","sources":["../../../../../src/elements/code-editor/internals/PlaceholderWidget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,6BAA6B,CAAA;AAEpC;;;;;;;;GAQG;AACH,qBAAa,UAAW,SAAQ,UAAU;IACrB,UAAU,EAAE,UAAU;gBAAtB,UAAU,EAAE,UAAU;IAIhC,EAAE,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;IAIvC,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW;IAwB3B,WAAW,IAAI,OAAO;CAGhC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { WidgetType } from '@codemirror/view';
|
|
2
|
+
import '../../../md/chip/ui-chip.js';
|
|
3
|
+
/**
|
|
4
|
+
* A widget that represents a placeholder in the code editor,
|
|
5
|
+
* specifically for suggestions that are replaced with chips.
|
|
6
|
+
*
|
|
7
|
+
* This widget is used to create a visual representation of a suggestion
|
|
8
|
+
* in the code editor, allowing users to see and interact with suggestions
|
|
9
|
+
* as chips. When a chip is removed, the corresponding text in the editor
|
|
10
|
+
* is also removed.
|
|
11
|
+
*/
|
|
12
|
+
export class ChipWidget extends WidgetType {
|
|
13
|
+
suggestion;
|
|
14
|
+
constructor(suggestion) {
|
|
15
|
+
super();
|
|
16
|
+
this.suggestion = suggestion;
|
|
17
|
+
}
|
|
18
|
+
eq(other) {
|
|
19
|
+
return this.suggestion.id == other.suggestion.id;
|
|
20
|
+
}
|
|
21
|
+
toDOM(view) {
|
|
22
|
+
const wrapper = document.createElement('span');
|
|
23
|
+
wrapper.className = 'mention-chip';
|
|
24
|
+
wrapper.setAttribute('data-mention-id', this.suggestion.id);
|
|
25
|
+
const chip = document.createElement('ui-chip');
|
|
26
|
+
chip.setAttribute('type', 'input');
|
|
27
|
+
chip.setAttribute('removable', 'true');
|
|
28
|
+
chip.textContent = this.suggestion.label;
|
|
29
|
+
chip.addEventListener('remove', () => {
|
|
30
|
+
const pos = view.posAtDOM(wrapper);
|
|
31
|
+
if (pos === null)
|
|
32
|
+
return;
|
|
33
|
+
const originalText = `{{${this.suggestion.label}}}`;
|
|
34
|
+
view.dispatch({
|
|
35
|
+
changes: { from: pos, to: pos + originalText.length, insert: '' },
|
|
36
|
+
});
|
|
37
|
+
view.focus();
|
|
38
|
+
});
|
|
39
|
+
wrapper.appendChild(chip);
|
|
40
|
+
return wrapper;
|
|
41
|
+
}
|
|
42
|
+
ignoreEvent() {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=PlaceholderWidget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaceholderWidget.js","sourceRoot":"","sources":["../../../../../src/elements/code-editor/internals/PlaceholderWidget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEzD,OAAO,6BAA6B,CAAA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AAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QACzB,OAAO,OAAO,CAAA;IAChB,CAAC;IAEQ,WAAW;QAClB,OAAO,KAAK,CAAA;IACd,CAAC;CACF","sourcesContent":["import { EditorView, WidgetType } from '@codemirror/view'\nimport type { Suggestion } from './types.js'\nimport '../../../md/chip/ui-chip.js'\n\n/**\n * A widget that represents a placeholder in the code editor,\n * specifically for suggestions that are replaced with chips.\n *\n * This widget is used to create a visual representation of a suggestion\n * in the code editor, allowing users to see and interact with suggestions\n * as chips. When a chip is removed, the corresponding text in the editor\n * is also removed.\n */\nexport class ChipWidget extends WidgetType {\n constructor(public suggestion: Suggestion) {\n super()\n }\n\n override eq(other: WidgetType): boolean {\n return this.suggestion.id == (other as ChipWidget).suggestion.id\n }\n\n toDOM(view: EditorView): HTMLElement {\n const wrapper = document.createElement('span')\n wrapper.className = 'mention-chip'\n wrapper.setAttribute('data-mention-id', this.suggestion.id)\n\n const chip = document.createElement('ui-chip')\n chip.setAttribute('type', 'input')\n chip.setAttribute('removable', 'true')\n chip.textContent = this.suggestion.label\n chip.addEventListener('remove', () => {\n const pos = view.posAtDOM(wrapper)\n if (pos === null) return\n\n const originalText = `{{${this.suggestion.label}}}`\n view.dispatch({\n changes: { from: pos, to: pos + originalText.length, insert: '' },\n })\n view.focus()\n })\n\n wrapper.appendChild(chip)\n return wrapper\n }\n\n override ignoreEvent(): boolean {\n return false\n }\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MatchDecorator } from '@codemirror/view';
|
|
2
|
+
import type { Suggestion } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A class that specializes in creating and managing decorations for suggestion matches in a code editor.
|
|
5
|
+
*/
|
|
6
|
+
export declare class SuggestionMatchDecorator extends MatchDecorator {
|
|
7
|
+
#private;
|
|
8
|
+
suggestions: Suggestion[];
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new instance of SuggestionMatchDecorator.
|
|
11
|
+
* @param regexp - The regular expression used to match suggestions in the code.
|
|
12
|
+
* @param suggestions - An array of suggestions that will be used to create decorations.
|
|
13
|
+
* Each suggestion should have a unique `id` and a `label` that will be displayed in the editor.
|
|
14
|
+
*/
|
|
15
|
+
constructor(regexp: RegExp, suggestions: Suggestion[]);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=SuggestionMatchDecorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuggestionMatchDecorator.d.ts","sourceRoot":"","sources":["../../../../../src/elements/code-editor/internals/SuggestionMatchDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAc,MAAM,kBAAkB,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAG5C;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,cAAc;;IASjD,WAAW,EAAE,UAAU,EAAE;IARlC;;;;;OAKG;gBAED,MAAM,EAAE,MAAM,EACP,WAAW,EAAE,UAAU,EAAE;CAmBnC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { MatchDecorator, Decoration } from '@codemirror/view';
|
|
2
|
+
import { ChipWidget } from './PlaceholderWidget.js';
|
|
3
|
+
/**
|
|
4
|
+
* A class that specializes in creating and managing decorations for suggestion matches in a code editor.
|
|
5
|
+
*/
|
|
6
|
+
export class SuggestionMatchDecorator extends MatchDecorator {
|
|
7
|
+
suggestions;
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new instance of SuggestionMatchDecorator.
|
|
10
|
+
* @param regexp - The regular expression used to match suggestions in the code.
|
|
11
|
+
* @param suggestions - An array of suggestions that will be used to create decorations.
|
|
12
|
+
* Each suggestion should have a unique `id` and a `label` that will be displayed in the editor.
|
|
13
|
+
*/
|
|
14
|
+
constructor(regexp, suggestions) {
|
|
15
|
+
super({
|
|
16
|
+
regexp,
|
|
17
|
+
decoration: (match) => this.#decoration(match),
|
|
18
|
+
});
|
|
19
|
+
this.suggestions = suggestions;
|
|
20
|
+
}
|
|
21
|
+
#decoration(match) {
|
|
22
|
+
const label = match[1];
|
|
23
|
+
const suggestion = this.suggestions.find((s) => s.label === label);
|
|
24
|
+
// If no suggestion is found, create a default one
|
|
25
|
+
const suggestionData = suggestion || { id: label, label };
|
|
26
|
+
return Decoration.replace({
|
|
27
|
+
widget: new ChipWidget(suggestionData),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=SuggestionMatchDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuggestionMatchDecorator.js","sourceRoot":"","sources":["../../../../../src/elements/code-editor/internals/SuggestionMatchDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IASjD;IART;;;;;OAKG;IACH,YACE,MAAc,EACP,WAAyB;QAEhC,KAAK,CAAC;YACJ,MAAM;YACN,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;SAC/C,CAAC,CAAA;QALK,gBAAW,GAAX,WAAW,CAAc;IAMlC,CAAC;IAED,WAAW,CAAC,KAAsB;QAChC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QACtB,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAA;QAElE,kDAAkD;QAClD,MAAM,cAAc,GAAe,UAAU,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;QAErE,OAAO,UAAU,CAAC,OAAO,CAAC;YACxB,MAAM,EAAE,IAAI,UAAU,CAAC,cAAc,CAAC;SACvC,CAAC,CAAA;IACJ,CAAC;CACF","sourcesContent":["import { MatchDecorator, Decoration } from '@codemirror/view'\nimport type { Suggestion } from './types.js'\nimport { ChipWidget } from './PlaceholderWidget.js'\n\n/**\n * A class that specializes in creating and managing decorations for suggestion matches in a code editor.\n */\nexport class SuggestionMatchDecorator extends MatchDecorator {\n /**\n * Creates a new instance of SuggestionMatchDecorator.\n * @param regexp - The regular expression used to match suggestions in the code.\n * @param suggestions - An array of suggestions that will be used to create decorations.\n * Each suggestion should have a unique `id` and a `label` that will be displayed in the editor.\n */\n constructor(\n regexp: RegExp,\n public suggestions: Suggestion[]\n ) {\n super({\n regexp,\n decoration: (match) => this.#decoration(match),\n })\n }\n\n #decoration(match: RegExpExecArray): Decoration {\n const label = match[1]\n const suggestion = this.suggestions.find((s) => s.label === label)\n\n // If no suggestion is found, create a default one\n const suggestionData: Suggestion = suggestion || { id: label, label }\n\n return Decoration.replace({\n widget: new ChipWidget(suggestionData),\n })\n }\n}\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface FunctionSchema {
|
|
2
|
+
/** Unique identifier for the function */
|
|
3
|
+
id: string;
|
|
4
|
+
/** Function name */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Function description */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Function parameters */
|
|
9
|
+
parameters?: FunctionParameter[];
|
|
10
|
+
/** Return type description */
|
|
11
|
+
returns?: string;
|
|
12
|
+
/** Additional metadata */
|
|
13
|
+
metadata?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export interface FunctionParameter {
|
|
16
|
+
/** Parameter name */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Parameter type */
|
|
19
|
+
type: string;
|
|
20
|
+
/** Parameter description */
|
|
21
|
+
description?: string;
|
|
22
|
+
/** Whether parameter is required */
|
|
23
|
+
required?: boolean;
|
|
24
|
+
/** Default value */
|
|
25
|
+
defaultValue?: unknown;
|
|
26
|
+
}
|
|
27
|
+
export interface Suggestion {
|
|
28
|
+
/** Unique identifier for the suggestion */
|
|
29
|
+
id: string;
|
|
30
|
+
/** Main label displayed */
|
|
31
|
+
label: string;
|
|
32
|
+
/** Supporting description text */
|
|
33
|
+
description?: string;
|
|
34
|
+
/** Suffix text (e.g., type, category) */
|
|
35
|
+
suffix?: string;
|
|
36
|
+
/** Additional data associated with the suggestion */
|
|
37
|
+
data?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
export interface FunctionInsertEvent {
|
|
40
|
+
/** The inserted function schema */
|
|
41
|
+
functionSchema: FunctionSchema;
|
|
42
|
+
/** The position where the function was inserted */
|
|
43
|
+
position: number;
|
|
44
|
+
}
|
|
45
|
+
export interface SuggestionInsertEvent {
|
|
46
|
+
/** The inserted suggestion */
|
|
47
|
+
suggestion: Suggestion;
|
|
48
|
+
/** The position where the suggestion was inserted */
|
|
49
|
+
position: number;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/elements/code-editor/internals/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0BAA0B;IAC1B,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAChC,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAED,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oBAAoB;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAA;IACV,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,cAAc,EAAE,cAAc,CAAA;IAC9B,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,8BAA8B;IAC9B,UAAU,EAAE,UAAU,CAAA;IACtB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/elements/code-editor/internals/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface FunctionSchema {\n /** Unique identifier for the function */\n id: string\n /** Function name */\n name: string\n /** Function description */\n description?: string\n /** Function parameters */\n parameters?: FunctionParameter[]\n /** Return type description */\n returns?: string\n /** Additional metadata */\n metadata?: Record<string, unknown>\n}\n\nexport interface FunctionParameter {\n /** Parameter name */\n name: string\n /** Parameter type */\n type: string\n /** Parameter description */\n description?: string\n /** Whether parameter is required */\n required?: boolean\n /** Default value */\n defaultValue?: unknown\n}\n\nexport interface Suggestion {\n /** Unique identifier for the suggestion */\n id: string\n /** Main label displayed */\n label: string\n /** Supporting description text */\n description?: string\n /** Suffix text (e.g., type, category) */\n suffix?: string\n /** Additional data associated with the suggestion */\n data?: Record<string, unknown>\n}\n\nexport interface FunctionInsertEvent {\n /** The inserted function schema */\n functionSchema: FunctionSchema\n /** The position where the function was inserted */\n position: number\n}\n\nexport interface SuggestionInsertEvent {\n /** The inserted suggestion */\n suggestion: Suggestion\n /** The position where the suggestion was inserted */\n position: number\n}\n"]}
|
package/build/src/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { default as MarkedHighlightElement } from './elements/highlight/MarkedHighlight.js';
|
|
2
2
|
export { default as PrismHighlightElement } from './elements/highlight/PrismHighlight.js';
|
|
3
3
|
export { default as HarViewerElement } from './elements/har/HarViewer.js';
|
|
4
|
+
export { default as CodeEditorElement } from './elements/code-editor/code-editor.js';
|
|
5
|
+
export type { FunctionSchema, FunctionParameter, Suggestion, FunctionInsertEvent, SuggestionInsertEvent, } from './elements/code-editor/code-editor.js';
|
|
4
6
|
export { default as Menu } from './md/menu/internal/Menu.js';
|
|
5
7
|
export { default as MenuItem } from './md/menu/internal/MenuItem.js';
|
|
6
8
|
export { default as SubMenu } from './md/menu/internal/SubMenu.js';
|
package/build/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AAC3F,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AACzF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAGzE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,+BAA+B,CAAA;AAGlE,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,iBA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AAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,KAAK,eAAe,MAAM,yCAAyC,CAAA;AAC1E,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAA;AAGpD,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAGhD,cAAc,wBAAwB,CAAA;AAGtC,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAA"}
|
package/build/src/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
export { default as MarkedHighlightElement } from './elements/highlight/MarkedHighlight.js';
|
|
3
3
|
export { default as PrismHighlightElement } from './elements/highlight/PrismHighlight.js';
|
|
4
4
|
export { default as HarViewerElement } from './elements/har/HarViewer.js';
|
|
5
|
+
// Code Editor
|
|
6
|
+
export { default as CodeEditorElement } from './elements/code-editor/code-editor.js';
|
|
5
7
|
// Menu Components
|
|
6
8
|
export { default as Menu } from './md/menu/internal/Menu.js';
|
|
7
9
|
export { default as MenuItem } from './md/menu/internal/MenuItem.js';
|
package/build/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,WAAW;AAEX,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AAC3F,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AACzF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEzE,kBAAkB;AAClB,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,+BAA+B,CAAA;AAElE,yBAAyB;AACzB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,2BAA2B,CAAA;AAWlC,OAAO;AACP,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C,WAAW;AAEX,cAAc,0CAA0C,CAAA;AACxD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qCAAqC,CAAA;AAEnD,SAAS;AAET,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAQnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAEjE,SAAS;AACT,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAA;AAExC,OAAO;AAEP,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,KAAK,eAAe,MAAM,yCAAyC,CAAA;AAC1E,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAA;AAEpD,SAAS;AACT,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAA;AAEhD,SAAS;AACT,cAAc,wBAAwB,CAAA;AAEtC,QAAQ;AACR,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAA","sourcesContent":["// Elements\n\nexport { default as MarkedHighlightElement } from './elements/highlight/MarkedHighlight.js'\nexport { default as PrismHighlightElement } from './elements/highlight/PrismHighlight.js'\nexport { default as HarViewerElement } from './elements/har/HarViewer.js'\n\n// Menu Components\nexport { default as Menu } from './md/menu/internal/Menu.js'\nexport { default as MenuItem } from './md/menu/internal/MenuItem.js'\nexport { default as SubMenu } from './md/menu/internal/SubMenu.js'\n\n// Date Picker Components\nexport {\n UiDatePickerCalendar,\n UiDatePickerInput,\n UiDatePickerModal,\n UiDatePickerModalInput,\n} from './md/date-picker/index.js'\nexport type {\n DateRange,\n CalendarDay,\n CalendarMonth,\n DateSelectEvent,\n DateRangeSelectEvent,\n ModalDatePickerChangeEvent,\n ModalInputDatePickerChangeEvent,\n} from './md/date-picker/index.js'\n\n// Demo\nexport { DemoPage } from './demo/DemoPage.js'\n\n// Bindings\n\nexport * from './bindings/base/ConfigurationBindings.js'\nexport * from './bindings/base/IoThread.js'\nexport * from './bindings/base/PlatformBindings.js'\n\n// Events\n\nexport { Events } from './events/Events.js'\nexport { EventTypes } from './events/EventTypes.js'\nexport type {\n INavDetail,\n INavRunHttpProjectDetail,\n INavRunSchemaDesignerDetail,\n INavRunHttpClient,\n NavRunDetail,\n} from './events/NavigationEvents.js'\nexport { AppNavigationEvent } from './events/NavigationEvents.js'\n\n// Router\nexport * as Router from './lib/route.js'\n\n// libs\n\nexport { PrismHighlighter } from './elements/highlight/PrismHighlighter.js'\nexport { default as PrismStyles } from './elements/highlight/Prism.styles.js'\nexport { default as MarkdownStyles } from './elements/highlight/MarkdownStyles.js'\nexport * as PrismAutoDetect from './elements/highlight/PrismAutoDetect.js'\nexport * as RouteMixin from './mixins/RouteMixin.js'\n\n// Monaco\nexport * as MonacoLoader from './monaco/loader.js'\nexport * as MonacoTheme from './monaco/theme.js'\n\n// Config\nexport * from './lib/config/Config.js'\n\n// Other\nexport * as Decorators from './decorators/index.js'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,WAAW;AAEX,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AAC3F,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AACzF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEzE,cAAc;AACd,OAAO,EA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Content":["// Elements\n\nexport { default as MarkedHighlightElement } from './elements/highlight/MarkedHighlight.js'\nexport { default as PrismHighlightElement } from './elements/highlight/PrismHighlight.js'\nexport { default as HarViewerElement } from './elements/har/HarViewer.js'\n\n// Code Editor\nexport { default as CodeEditorElement } from './elements/code-editor/code-editor.js'\nexport type {\n FunctionSchema,\n FunctionParameter,\n Suggestion,\n FunctionInsertEvent,\n SuggestionInsertEvent,\n} from './elements/code-editor/code-editor.js'\n\n// Menu Components\nexport { default as Menu } from './md/menu/internal/Menu.js'\nexport { default as MenuItem } from './md/menu/internal/MenuItem.js'\nexport { default as SubMenu } from './md/menu/internal/SubMenu.js'\n\n// Date Picker Components\nexport {\n UiDatePickerCalendar,\n UiDatePickerInput,\n UiDatePickerModal,\n UiDatePickerModalInput,\n} from './md/date-picker/index.js'\nexport type {\n DateRange,\n CalendarDay,\n CalendarMonth,\n DateSelectEvent,\n DateRangeSelectEvent,\n ModalDatePickerChangeEvent,\n ModalInputDatePickerChangeEvent,\n} from './md/date-picker/index.js'\n\n// Demo\nexport { DemoPage } from './demo/DemoPage.js'\n\n// Bindings\n\nexport * from './bindings/base/ConfigurationBindings.js'\nexport * from './bindings/base/IoThread.js'\nexport * from './bindings/base/PlatformBindings.js'\n\n// Events\n\nexport { Events } from './events/Events.js'\nexport { EventTypes } from './events/EventTypes.js'\nexport type {\n INavDetail,\n INavRunHttpProjectDetail,\n INavRunSchemaDesignerDetail,\n INavRunHttpClient,\n NavRunDetail,\n} from './events/NavigationEvents.js'\nexport { AppNavigationEvent } from './events/NavigationEvents.js'\n\n// Router\nexport * as Router from './lib/route.js'\n\n// libs\n\nexport { PrismHighlighter } from './elements/highlight/PrismHighlighter.js'\nexport { default as PrismStyles } from './elements/highlight/Prism.styles.js'\nexport { default as MarkdownStyles } from './elements/highlight/MarkdownStyles.js'\nexport * as PrismAutoDetect from './elements/highlight/PrismAutoDetect.js'\nexport * as RouteMixin from './mixins/RouteMixin.js'\n\n// Monaco\nexport * as MonacoLoader from './monaco/loader.js'\nexport * as MonacoTheme from './monaco/theme.js'\n\n// Config\nexport * from './lib/config/Config.js'\n\n// Other\nexport * as Decorators from './decorators/index.js'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.styles.d.ts","sourceRoot":"","sources":["../../../../../src/md/chip/internals/Chip.styles.ts"],"names":[],"mappings":";AAEA,
|
|
1
|
+
{"version":3,"file":"Chip.styles.d.ts","sourceRoot":"","sources":["../../../../../src/md/chip/internals/Chip.styles.ts"],"names":[],"mappings":";AAEA,wBAwLC"}
|