@scalar/api-client 3.13.5 → 3.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/style.css +73 -57
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/vue-styles.css +26 -27
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeInputLite.vue.script.js","names":["$attrs","$slots"],"sources":["../../../../src/v2/components/code-input/CodeInputLite.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * CodeInputLite\n *\n * Single-line `contenteditable` editor that renders `{{varname}}` as atomic\n * pill spans (`contenteditable=\"false\"`) and offers an env-variable\n * autocomplete on `{{`. The value is still exposed as a `{{name}}`-bearing\n * string via `update:modelValue`; DOM ↔ model conversion lives in\n * `renderModel` and `serializeEditor`.\n */\nexport default {\n inheritAttrs: false,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { REGEX } from '@scalar/helpers/regex/regex-helpers'\nimport {\n CONTEXT_FUNCTION_NAMES,\n getContextFunctionComment,\n isContextFunctionName,\n type ContextFunctionName,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { nanoid } from 'nanoid'\nimport {\n computed,\n createApp,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n useAttrs,\n useTemplateRef,\n watch,\n type App,\n} from 'vue'\n\nimport DataTableInputSelect from '@/v2/components/data-table/DataTableInputSelect.vue'\nimport EnvironmentVariableDropdown from '@/v2/features/environments/components/EnvironmentVariablesDropdown.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport type { CodeInputModelValue } from './CodeInput.vue'\nimport { buildPillContext } from './helpers/build-pill-context'\nimport { lookupVariableValue } from './helpers/lookup-variable-value'\nimport { pillSignature } from './helpers/pill-signature'\nimport { serializeValue } from './helpers/serialize-value'\nimport PillTooltipHost from './PillTooltipHost.vue'\n\ntype Props = {\n modelValue: CodeInputModelValue\n /** Environment for variable substitution. Pass undefined to disable env vars */\n environment: XScalarEnvironment | undefined\n /** Render as a non-interactive read-only label */\n disabled?: boolean\n /** Render the input with the native `readonly` attribute (still focusable, no edits) */\n readOnly?: boolean\n /** Show error styling */\n error?: boolean\n /** Layout context affects styling and dropdown visibility */\n layout?: ClientLayout\n /** Placeholder text for an empty input */\n placeholder?: string\n /** Show required indicator */\n required?: boolean\n /** Emit submit on blur */\n emitOnBlur?: boolean\n /** Render variable pills + show the autocomplete dropdown */\n withVariables?: boolean\n /** Include `{{$guid}}` etc. in the autocomplete dropdown */\n withFakeData?: boolean\n /** Always emit change events even if the value is unchanged */\n alwaysEmitChange?: boolean\n /** Strike-through styling for the input text (e.g. overridden values) */\n linethrough?: boolean\n /** Schema type — drives boolean select mode when `boolean` is included */\n type?: string | string[]\n /** Predefined enum values; when set the input is replaced by a select */\n enum?: string[]\n /** Example values; when set (and no enum/boolean) the input is replaced by a select */\n examples?: string[]\n /** Default value to suggest in select modes */\n default?: CodeInputModelValue\n /** Whether the boolean select includes a `null` option */\n nullable?: boolean\n}\n\nconst {\n modelValue,\n environment,\n disabled = false,\n readOnly = false,\n error = false,\n layout = 'desktop',\n placeholder,\n required = false,\n emitOnBlur = true,\n alwaysEmitChange = false,\n withVariables = true,\n withFakeData = false,\n linethrough = false,\n type,\n enum: enumProp,\n examples,\n default: defaultProp,\n nullable = false,\n} = defineProps<Props>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'submit': [value: string, event: KeyboardEvent | FocusEvent]\n 'blur': [value: string, event: FocusEvent]\n 'navigate': [route: { page: 'document'; path: 'environment' }]\n}>()\n\nconst attrs = useAttrs() as { 'id'?: string; 'aria-label'?: string }\n\n/**\n * The id only matters once the dropdown opens (`aria-controls` /\n * `aria-activedescendant`), so we defer `nanoid()` until first focus to\n * keep idle instances cheap. A consumer-supplied `id` attr is preserved.\n */\nconst generatedComponentId = ref<string | null>(null)\nconst componentId = computed(\n (): string | undefined => attrs.id ?? generatedComponentId.value ?? undefined,\n)\nconst ensureComponentId = (): void => {\n if (!attrs.id && generatedComponentId.value === null) {\n generatedComponentId.value = `id-${nanoid()}`\n }\n}\n\nconst editorRef = useTemplateRef<HTMLDivElement>('editorRef')\nconst dropdownRef = ref<InstanceType<\n typeof EnvironmentVariableDropdown\n> | null>(null)\n\n/** Id of the dropdown's `role=\"listbox\"` element, for the combobox wiring. */\nconst listboxId = computed((): string | undefined =>\n componentId.value ? `${componentId.value}-listbox` : undefined,\n)\n\n/**\n * Id of the option the dropdown currently highlights. Mirrors the dropdown's\n * own selection so the editor can expose it via `aria-activedescendant`.\n */\nconst activeOptionId = computed(\n (): string | undefined => dropdownRef.value?.activeOptionId,\n)\n\nconst isFocused = ref(false)\nconst isEmpty = ref(true)\n\n/**\n * True while an IME composition is in progress. Rebuilding the editor DOM\n * mid-composition (e.g. when `{{` forms a pill) cancels the composition, so we\n * defer those rebuilds until `compositionend`.\n */\nconst isComposing = ref(false)\n\n/**\n * Whether the serialized value should count as empty for placeholder display.\n *\n * `contenteditable` can leave behind invisible residue after some delete\n * sequences — most commonly a non-breaking space (` `) — which makes a\n * visually empty field report a non-zero length and silently drop its\n * placeholder. Trimming covers that case; ` ` counts as whitespace, so a\n * field that only holds editor residue is treated as empty. This affects the\n * placeholder flag only, never the value emitted via `serializeEditor`.\n */\nconst isBlankValue = (text: string): boolean => text.trim().length === 0\n\n// ───────────────────────────────────────────────────────────────────\n// Rendering-mode detection (parity with CodeInput's select dispatch)\n// ───────────────────────────────────────────────────────────────────\n\n/** True when the schema type is exactly `boolean` (or includes it in a tuple type). */\nconst isBooleanMode = computed((): boolean => {\n if (enumProp?.length) {\n return false\n }\n return type === 'boolean' || (Array.isArray(type) && type.includes('boolean'))\n})\n\nconst booleanOptions = computed((): string[] =>\n nullable ? ['true', 'false', 'null'] : ['true', 'false'],\n)\n\n/** Default type when the schema is a tuple — picks the first non-null entry. */\nconst defaultType = computed((): string | undefined => {\n if (Array.isArray(type)) {\n return type.find((t) => t !== 'null') ?? 'string'\n }\n return type\n})\n\nconst handleSelectChange = (value: string): void =>\n emit('update:modelValue', value)\n\n// ───────────────────────────────────────────────────────────────────\n// Per-pill tooltip apps\n// ───────────────────────────────────────────────────────────────────\n\nlet pillTooltipApps: App[] = []\n\n/**\n * Per-pill tooltips are the heaviest part of the render (a Vue app +\n * `useTooltip` watch + listeners each), so we defer mounting them until\n * the first interaction (focus, pointerover, or dropdown open). Once on,\n * subsequent rebuilds remount tooltips for the new pills.\n */\nlet tooltipsActive = false\n\nconst teardownPillTooltips = (): void => {\n for (const app of pillTooltipApps) {\n app.unmount()\n }\n pillTooltipApps = []\n}\n\nconst mountPillTooltips = (): void => {\n if (!editorRef.value || layout === 'modal') {\n return\n }\n const pills = editorRef.value.querySelectorAll<HTMLElement>('.scalar-pill')\n for (const pillEl of pills) {\n const variableName = pillEl.dataset.variable ?? ''\n const context = buildPillContext(variableName, environment)\n const app = createApp(PillTooltipHost, { context, target: pillEl })\n // PillTooltipHost is renderless; useTooltip attaches to `target` directly.\n app.mount(document.createElement('div'))\n pillTooltipApps.push(app)\n }\n}\n\n// ───────────────────────────────────────────────────────────────────\n// DOM ↔ model conversion\n// ───────────────────────────────────────────────────────────────────\n\n/**\n * Build a pill `<span>` for the given variable. `contentEditable = 'false'`\n * makes the browser treat it as a single atom (arrow keys jump over it,\n * Backspace deletes it whole); `{{` / `}}` only live in the model string.\n */\nconst createPillElement = (\n name: string,\n start: number,\n end: number,\n): HTMLSpanElement => {\n const isCtx = isContextFunctionName(name)\n const span = document.createElement('span')\n span.className = isCtx ? 'scalar-pill scalar-pill--context-fn' : 'scalar-pill'\n span.contentEditable = 'false'\n span.dataset.variable = name\n // Model-coordinate offsets (the pill stands in for the full `{{name}}`).\n // Used by click forwarding and tests to map a pill back to the value.\n span.dataset.pillStart = String(start)\n span.dataset.pillEnd = String(end)\n\n const color = isCtx\n ? 'var(--scalar-color-3)'\n : environment?.color || 'var(--scalar-color-1)'\n span.style.setProperty('--tw-bg-base', color)\n\n // Fade env pills with no usable value. A falsy check (not just\n // `=== undefined`) matches the tooltip path's `Boolean(value)`, so a\n // variable declared with an empty string fades here too.\n const isUndefinedEnv = !isCtx && !lookupVariableValue(environment, name)\n if (isUndefinedEnv) {\n span.style.opacity = '0.5'\n }\n\n span.textContent = name\n return span\n}\n\n/** Render a model string into the editor as a mix of text nodes + pills. */\nconst renderModel = (text: string): void => {\n const editor = editorRef.value\n if (!editor) {\n return\n }\n\n teardownPillTooltips()\n editor.replaceChildren()\n\n if (!withVariables || !text.includes('{{')) {\n if (text) {\n editor.appendChild(document.createTextNode(text))\n }\n isEmpty.value = isBlankValue(text)\n return\n }\n\n const regex = new RegExp(REGEX.VARIABLES.source, REGEX.VARIABLES.flags)\n let lastIndex = 0\n let match: RegExpExecArray | null\n\n while ((match = regex.exec(text)) !== null) {\n const start = match.index\n const end = start + match[0].length\n if (start > lastIndex) {\n editor.appendChild(document.createTextNode(text.slice(lastIndex, start)))\n }\n editor.appendChild(createPillElement(match[1] ?? '', start, end))\n lastIndex = end\n }\n\n if (lastIndex < text.length) {\n editor.appendChild(document.createTextNode(text.slice(lastIndex)))\n }\n\n isEmpty.value = false\n if (tooltipsActive) {\n mountPillTooltips()\n }\n}\n\n/** Length the given child contributes to the serialized model string. */\nconst modelLengthOf = (node: Node): number => {\n if (node.nodeType === Node.TEXT_NODE) {\n return (node.textContent ?? '').length\n }\n if (node instanceof HTMLElement && node.classList.contains('scalar-pill')) {\n return `{{${node.dataset.variable ?? ''}}}`.length\n }\n // Defensive: a stray element (e.g. browser-inserted <br>) — use its text.\n return (node.textContent ?? '').length\n}\n\n/** Read the editor DOM back into a `{{name}}`-bearing model string. */\nconst serializeEditor = (): string => {\n const editor = editorRef.value\n if (!editor) {\n return ''\n }\n let out = ''\n for (const node of Array.from(editor.childNodes)) {\n if (node.nodeType === Node.TEXT_NODE) {\n out += node.textContent ?? ''\n } else if (\n node instanceof HTMLElement &&\n node.classList.contains('scalar-pill')\n ) {\n out += `{{${node.dataset.variable ?? ''}}}`\n } else if (node instanceof HTMLElement) {\n // Flatten any stray <br> / <div> the browser may inject on paste/Enter.\n out += node.textContent ?? ''\n }\n }\n return out\n}\n\nlet lastPillSignature: string | null = null\nlet lastEnvKey = ''\n\n/**\n * Cache key for the env + `withVariables` state. Includes variable\n * name/value pairs so the watcher notices adds/removes/edits even when\n * `environment.color` is unchanged — without that, pills keep stale\n * `isDefined` opacity and tooltip values until the input itself changes.\n */\nconst computeEnvKey = (): string => {\n const color = environment?.color ?? ''\n const flag = withVariables ? '1' : '0'\n const variables = environment?.variables ?? []\n let vars = ''\n for (const v of variables) {\n const value =\n typeof v.value === 'string' ? v.value : (v.value?.default ?? '')\n // Unit separators (\\x1f / \\x1e) so values can safely contain `|` or `=`.\n vars += `\\x1f${v.name}\\x1e${value}`\n }\n return `${color}|${flag}|${vars}`\n}\n\n/** Idempotent: first call flips `tooltipsActive` and mounts pill tooltips. */\nconst ensureTooltipsActive = (): void => {\n if (tooltipsActive) {\n return\n }\n tooltipsActive = true\n mountPillTooltips()\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Caret ↔ model offset\n// ───────────────────────────────────────────────────────────────────\n\n/** Selection start as a model-string offset, or `null` if not inside the editor. */\nconst getModelCaret = (): number | null => {\n const editor = editorRef.value\n if (!editor) {\n return null\n }\n const selection = window.getSelection()\n if (!selection || selection.rangeCount === 0) {\n return null\n }\n const range = selection.getRangeAt(0)\n if (\n range.startContainer !== editor &&\n !editor.contains(range.startContainer)\n ) {\n return null\n }\n\n // Anchored on the editor itself: `startOffset` is a child index.\n if (range.startContainer === editor) {\n let pos = 0\n for (\n let i = 0;\n i < range.startOffset && i < editor.childNodes.length;\n i++\n ) {\n pos += modelLengthOf(editor.childNodes[i] as Node)\n }\n return pos\n }\n\n let pos = 0\n for (const child of Array.from(editor.childNodes)) {\n if (child === range.startContainer) {\n return pos + range.startOffset\n }\n // Pills are non-editable; if a browser quirk still lands a selection\n // inside one, snap to the nearest boundary instead of getting stuck.\n if (child.contains(range.startContainer)) {\n return range.startOffset === 0 ? pos : pos + modelLengthOf(child)\n }\n pos += modelLengthOf(child)\n }\n return pos\n}\n\n/** Place the caret at the given model offset, walking the DOM to find it. */\nconst setModelCaret = (target: number): void => {\n const editor = editorRef.value\n if (!editor) {\n return\n }\n const range = document.createRange()\n let pos = 0\n let placed = false\n\n for (const child of Array.from(editor.childNodes)) {\n const len = modelLengthOf(child)\n if (pos + len >= target) {\n if (child.nodeType === Node.TEXT_NODE) {\n const into = Math.max(\n 0,\n Math.min(target - pos, (child.textContent ?? '').length),\n )\n range.setStart(child, into)\n } else if (target - pos <= 0) {\n range.setStartBefore(child)\n } else {\n range.setStartAfter(child)\n }\n placed = true\n break\n }\n pos += len\n }\n\n if (!placed) {\n range.selectNodeContents(editor)\n range.collapse(false)\n } else {\n range.collapse(true)\n }\n\n const selection = window.getSelection()\n if (!selection) {\n return\n }\n selection.removeAllRanges()\n selection.addRange(range)\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Environment variable dropdown\n// ───────────────────────────────────────────────────────────────────\n\nconst showDropdown = ref(false)\nconst dropdownQuery = ref('')\nconst dropdownPosition = ref({ left: 0, top: 0 })\n\nconst contextFunctionDropdownItems = computed(() =>\n withFakeData\n ? CONTEXT_FUNCTION_NAMES.map((key) => ({\n key,\n description: getContextFunctionComment(key as ContextFunctionName),\n }))\n : [],\n)\n\nconst displayVariablesDropdown = computed(\n (): boolean =>\n showDropdown.value &&\n withVariables &&\n layout !== 'modal' &&\n (Boolean(environment) || withFakeData),\n)\n\nconst updateDropdownVisibility = (): void => {\n const editor = editorRef.value\n if (!editor) {\n return\n }\n const caret = getModelCaret()\n if (caret === null) {\n showDropdown.value = false\n return\n }\n const text = serializeEditor().slice(0, caret)\n const lastOpen = text.lastIndexOf('{{')\n const lastClose = text.lastIndexOf('}}')\n\n if (lastOpen <= lastClose) {\n showDropdown.value = false\n return\n }\n\n dropdownQuery.value = text.slice(lastOpen + 2)\n // Make sure the combobox has an id before it advertises `aria-expanded`, so\n // `aria-controls` always resolves to the listbox we are about to render.\n ensureComponentId()\n showDropdown.value = true\n\n // Anchor under the caret; `getBoundingClientRect` gives the caret rect in one read.\n nextTick(() => {\n const selection = window.getSelection()\n if (!selection || selection.rangeCount === 0 || !editorRef.value) {\n return\n }\n const r = selection.getRangeAt(0).cloneRange()\n r.collapse(true)\n const rect = r.getBoundingClientRect()\n const editorRect = editorRef.value.getBoundingClientRect()\n // Some browsers collapse empty ranges to a zero rect — fall back to the editor edge.\n dropdownPosition.value = {\n left: rect.left || editorRect.left,\n top: rect.bottom || editorRect.bottom,\n }\n })\n}\n\nconst handleDropdownSelect = (item: string): void => {\n if (readOnly) {\n return\n }\n const caret = getModelCaret() ?? 0\n const value = serializeEditor()\n const from = Math.max(0, caret - dropdownQuery.value.length - 2)\n const to = caret\n const next = `${value.slice(0, from)}{{${item}}}${value.slice(to)}`\n const nextCursor = from + `{{${item}}}`.length\n\n // Pill set changed — force a re-render and reposition the caret.\n lastPillSignature = pillSignature(next, withVariables)\n renderModel(next)\n setModelCaret(nextCursor)\n\n showDropdown.value = false\n emitChange(next, { skipDropdownCheck: true })\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Change / focus / blur\n// ───────────────────────────────────────────────────────────────────\n\nconst emitChange = (\n value: string,\n opts: { skipDropdownCheck?: boolean } = {},\n): void => {\n const same = value === serializeValue(modelValue)\n if (alwaysEmitChange || !same) {\n emit('update:modelValue', value)\n }\n if (!opts.skipDropdownCheck) {\n updateDropdownVisibility()\n }\n}\n\nconst handleInput = (): void => {\n const text = serializeEditor()\n isEmpty.value = isBlankValue(text)\n\n // Only rebuild when the pill set changes (e.g. `}}` closed a pattern, or\n // a value was pasted). Skipping it for plain-text edits preserves the\n // live selection — important for IME composition and double-click select.\n // Also defer while composing; `handleCompositionEnd` re-runs this path so the\n // rebuild happens once the IME has committed its text.\n const sig = pillSignature(text, withVariables)\n if (!isComposing.value && sig !== lastPillSignature) {\n const caret = getModelCaret()\n lastPillSignature = sig\n renderModel(text)\n if (caret !== null) {\n setModelCaret(caret)\n }\n }\n\n emitChange(text)\n}\n\nconst handleCompositionStart = (): void => {\n isComposing.value = true\n}\n\nconst handleCompositionEnd = (): void => {\n isComposing.value = false\n // Run the deferred input path now that the composition has committed, so any\n // pill that formed during composition is rendered.\n handleInput()\n}\n\nconst handleFocus = (): void => {\n isFocused.value = true\n ensureComponentId()\n ensureTooltipsActive()\n}\n\nconst handleBlur = (event: FocusEvent): void => {\n isFocused.value = false\n showDropdown.value = false\n const value = serializeEditor()\n // Check the serialized `value`, not `modelValue` — a `0` or `false` model is\n // a valid non-empty entry that should still submit on blur.\n if (emitOnBlur && value) {\n emit('submit', value, event)\n }\n emit('blur', value, event)\n}\n\n/**\n * Strip rich content on paste; `contenteditable=\"plaintext-only\"` is not\n * reliable cross-browser, so we intercept and use `insertText` to keep undo.\n */\nconst handlePaste = (event: ClipboardEvent): void => {\n event.preventDefault()\n const text = event.clipboardData?.getData('text/plain') ?? ''\n if (!text) {\n return\n }\n document.execCommand('insertText', false, text.replace(/\\r?\\n/g, ' '))\n // `insertText` normally fires an `input` event, but that is not guaranteed\n // across browsers. Run the same path explicitly so pill rendering, emptiness,\n // `update:modelValue`, and the dropdown never lag behind the pasted DOM.\n handleInput()\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Keyboard handling\n// ───────────────────────────────────────────────────────────────────\n\nconst handleKeyDown = (event: KeyboardEvent): void => {\n if (showDropdown.value) {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault()\n event.stopPropagation()\n dropdownRef.value?.handleArrowKey(\n event.key === 'ArrowDown' ? 'down' : 'up',\n )\n return\n }\n if (event.key === 'Enter') {\n event.preventDefault()\n event.stopPropagation()\n dropdownRef.value?.handleSelect()\n return\n }\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n showDropdown.value = false\n return\n }\n }\n\n if (event.key === 'Enter') {\n // Block the browser default so a contenteditable div does not insert\n // <br> / <div> and break single-line semantics, then emit submit\n // (used by the table editors).\n event.preventDefault()\n emit('submit', serializeEditor(), event)\n return\n }\n\n // Backspace / Delete: pill atomicity is handled by the browser via\n // `contenteditable=\"false\"` on pills — no manual `}}`-pair handling needed.\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Click forwarding & lifecycle\n// ───────────────────────────────────────────────────────────────────\n\n/**\n * Clicking a pill selects it whole, so a subsequent Backspace deletes it\n * in one keystroke and typing replaces it — the usual chip/mention model.\n */\nconst handleEditorClick = (event: MouseEvent): void => {\n const target = (event.target as HTMLElement | null)?.closest<HTMLElement>(\n '.scalar-pill',\n )\n if (!target) {\n return\n }\n const editor = editorRef.value\n if (!editor) {\n return\n }\n editor.focus()\n const range = document.createRange()\n range.selectNode(target)\n const selection = window.getSelection()\n selection?.removeAllRanges()\n selection?.addRange(range)\n updateDropdownVisibility()\n}\n\nonMounted(() => {\n const initial = serializeValue(modelValue)\n lastPillSignature = pillSignature(initial, withVariables)\n lastEnvKey = computeEnvKey()\n renderModel(initial)\n isEmpty.value = isBlankValue(initial)\n\n // `autofocus` on a contenteditable div is not honoured natively, so focus\n // the editor ourselves when the consumer passes the attribute.\n if (Object.hasOwn(attrs, 'autofocus')) {\n editorRef.value?.focus()\n }\n})\n\nwatch(\n () => modelValue,\n (next) => {\n const serialized = serializeValue(next)\n // Always sync the placeholder flag, even when the DOM already matches and we\n // skip the rebuild below. Otherwise a value cell that switches from select\n // mode (no editor element) into the empty editor keeps a stale `isEmpty`,\n // and the placeholder silently disappears.\n isEmpty.value = isBlankValue(serialized)\n if (serializeEditor() === serialized) {\n return\n }\n lastPillSignature = pillSignature(serialized, withVariables)\n renderModel(serialized)\n },\n)\n\nwatch(\n [() => environment, () => withVariables],\n () => {\n // Env changes affect pill colour and `isDefined` opacity — rebuild.\n const envKey = computeEnvKey()\n if (envKey === lastEnvKey) {\n return\n }\n lastEnvKey = envKey\n // Most rows are plain text; skip the DOM walk when there are no pills.\n // Pills introduced later flow through `handleInput` / the modelValue\n // watcher, which update `lastPillSignature`.\n if (lastPillSignature === '') {\n return\n }\n lastPillSignature = pillSignature(serializeEditor(), withVariables)\n // Preserve the caret across the rebuild so editing does not jump to the\n // start when the environment changes mid-edit (mirrors `handleInput`).\n const caret = getModelCaret()\n renderModel(serializeEditor())\n if (caret !== null) {\n setModelCaret(caret)\n }\n },\n // Variables are often mutated in place (e.g. editing a value in the env\n // editor) without the object reference changing — deep watch catches it.\n { deep: true },\n)\n\nonBeforeUnmount(() => {\n teardownPillTooltips()\n})\n\n// ───────────────────────────────────────────────────────────────────\n// Public API\n// ───────────────────────────────────────────────────────────────────\n\ndefineExpose({\n /** Focus the editor. `position` controls caret placement. */\n focus: (position?: 'start' | 'end' | number): void => {\n const editor = editorRef.value\n if (!editor) {\n return\n }\n editor.focus()\n if (!isDefined(position)) {\n return\n }\n const length = serializeEditor().length\n const pos =\n position === 'start' ? 0 : position === 'end' ? length : position\n setModelCaret(pos)\n },\n /** Replace the current value programmatically and re-render the pills. */\n setContent: (next = ''): void => {\n if (serializeEditor() === next) {\n return\n }\n lastPillSignature = pillSignature(next, withVariables)\n renderModel(next)\n isEmpty.value = isBlankValue(next)\n },\n /** Read the current value as a `{{name}}`-bearing string. */\n getValue: (): string => serializeEditor(),\n /** Caret offset in the model string. */\n cursorPosition: (): number | undefined => {\n const c = getModelCaret()\n return c === null ? undefined : c\n },\n isFocused,\n editorRef,\n})\n</script>\n\n<template>\n <!-- Disabled mode: read-only label -->\n <div\n v-if=\"disabled\"\n class=\"text-c-2 flex cursor-default items-center justify-center\"\n :class=\"{\n 'font-code pr-2 pl-1 text-base': layout === 'modal',\n 'px-2': layout !== 'modal',\n 'line-through': linethrough,\n }\"\n data-testid=\"code-input-lite-disabled\">\n <span class=\"whitespace-nowrap\">{{ modelValue }}</span>\n </div>\n\n <!-- Enum mode: select dropdown with predefined values -->\n <DataTableInputSelect\n v-else-if=\"enumProp?.length\"\n :default=\"defaultProp\"\n :modelValue=\"modelValue\"\n :type=\"defaultType\"\n :value=\"enumProp\"\n @update:modelValue=\"handleSelectChange\" />\n\n <!-- Boolean mode: select dropdown with true/false (and optionally null) -->\n <DataTableInputSelect\n v-else-if=\"isBooleanMode\"\n :default=\"defaultProp\"\n :modelValue=\"modelValue\"\n :value=\"booleanOptions\"\n @update:modelValue=\"handleSelectChange\" />\n\n <!-- Examples mode: select dropdown with example values -->\n <DataTableInputSelect\n v-else-if=\"examples?.length\"\n :default=\"defaultProp\"\n :modelValue=\"modelValue\"\n :value=\"examples\"\n @update:modelValue=\"handleSelectChange\" />\n\n <!-- Editor mode -->\n <div\n v-else\n :id=\"componentId\"\n v-bind=\"$attrs\"\n class=\"code-input-lite group/code-input-lite peer relative w-full leading-[1.44] -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline\"\n :class=\"{\n 'code-input-lite--error': error,\n 'code-input-lite--empty': isEmpty,\n 'line-through': linethrough,\n }\">\n <!-- The single editable surface; see the file header for how pills work. -->\n <div\n ref=\"editorRef\"\n :aria-activedescendant=\"\n displayVariablesDropdown ? activeOptionId : undefined\n \"\n :aria-autocomplete=\"withVariables ? 'list' : undefined\"\n :aria-controls=\"displayVariablesDropdown ? listboxId : undefined\"\n :aria-expanded=\"displayVariablesDropdown ? 'true' : undefined\"\n :aria-invalid=\"error ? 'true' : undefined\"\n :aria-label=\"attrs['aria-label']\"\n :aria-readonly=\"readOnly ? 'true' : undefined\"\n :aria-required=\"required ? 'true' : undefined\"\n class=\"code-input-lite__editor\"\n :contenteditable=\"readOnly ? 'false' : 'true'\"\n :data-placeholder=\"placeholder\"\n :role=\"withVariables ? 'combobox' : 'textbox'\"\n spellcheck=\"false\"\n @blur=\"handleBlur\"\n @click=\"handleEditorClick\"\n @compositionend=\"handleCompositionEnd\"\n @compositionstart=\"handleCompositionStart\"\n @focus=\"handleFocus\"\n @input=\"handleInput\"\n @keydown=\"handleKeyDown\"\n @paste=\"handlePaste\"\n @pointerover=\"ensureTooltipsActive\" />\n </div>\n\n <!--\n Slots and the required indicator are siblings of the mode templates so\n they render in every mode and so `absolute right-0` anchors to the\n surrounding (relative) cell rather than the shrink-wrapped mode wrapper.\n -->\n <div\n v-if=\"$slots.warning\"\n class=\"centered-y text-orange absolute right-7 text-xs\">\n <slot name=\"warning\" />\n </div>\n <div\n v-if=\"$slots.icon\"\n class=\"centered-y absolute right-0 flex h-full items-center p-1.5 group-has-[.code-input-lite__editor:focus]:z-1\">\n <slot name=\"icon\" />\n </div>\n <div\n v-if=\"required\"\n class=\"required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 mr-0.5 pt-px pr-2 opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 peer-has-[.code-input-lite__editor:focus]:opacity-0\">\n Required\n </div>\n\n <EnvironmentVariableDropdown\n v-if=\"displayVariablesDropdown\"\n ref=\"dropdownRef\"\n :contextFunctionItems=\"contextFunctionDropdownItems\"\n :dropdownPosition=\"dropdownPosition\"\n :environment=\"environment\"\n :listboxId=\"listboxId\"\n :query=\"dropdownQuery\"\n @close=\"showDropdown = false\"\n @redirect=\"emit('navigate', { page: 'document', path: 'environment' })\"\n @select=\"handleDropdownSelect\" />\n</template>\n\n<style scoped>\n.code-input-lite {\n /* Flex so the editor centres vertically in whatever height the cell gives us.\n Font properties inherit so we adopt the surrounding typography. */\n display: flex;\n align-items: center;\n}\n\n.code-input-lite__editor {\n /* Everything font-related inherits from the surrounding context. */\n font: inherit;\n letter-spacing: inherit;\n flex: 1;\n min-width: 0;\n background: transparent;\n outline: none;\n color: var(--scalar-color-1);\n caret-color: var(--scalar-color-1);\n /* Single-line: horizontal scroll keeps the caret visible for long values;\n the scrollbar itself is hidden (would be noisy inside a table cell). */\n white-space: pre;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n padding: 0 0.5em;\n box-sizing: border-box;\n line-height: 1.44;\n /* Positioning context for the absolutely positioned placeholder. */\n position: relative;\n}\n\n.code-input-lite__editor::-webkit-scrollbar {\n display: none;\n}\n\n/* Absolute so the placeholder does not occupy flow space inside the\n contenteditable; otherwise the caret would land after it on focus.\n `pointer-events: none` lets clicks fall through to focus the editor.\n Hidden on focus so it never renders on top of the text caret. */\n.code-input-lite--empty .code-input-lite__editor:not(:focus)::before {\n content: attr(data-placeholder);\n color: var(--scalar-color-3);\n pointer-events: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0.5em;\n display: flex;\n align-items: center;\n}\n\n.code-input-lite--error .code-input-lite__editor {\n outline: 1px solid var(--scalar-color-red);\n}\n</style>\n\n<style>\n/* Pill styling. Each pill is `<span contenteditable=\"false\">name</span>` —\n an atomic widget; the caret lands before or after it, never inside. */\n.scalar-pill {\n color: var(--scalar-color-2);\n border-radius: 30px;\n display: inline-block;\n font-family: var(--scalar-font-code);\n font-size: 0.9em;\n line-height: 1.4;\n vertical-align: baseline;\n background: var(--scalar-background-3);\n padding: 0.125em 0.6em;\n margin-right: 0.35em;\n cursor: text;\n /* Single click selects the whole pill — chip/mention model, deletes in one go. */\n user-select: all;\n -webkit-user-select: all;\n}\n\n.dark-mode .scalar-pill {\n background: color-mix(\n in srgb,\n var(--tw-bg-base, var(--scalar-color-1)),\n transparent 90%\n );\n}\n\n.light-mode .scalar-pill {\n background: var(--scalar-background-3);\n}\n\n.scalar-pill--context-fn {\n /* Inset box-shadow as a border so the layout box stays identical to plain pills. */\n box-shadow: 0 0 0 1px\n color-mix(in srgb, var(--scalar-color-3), transparent 35%) inset;\n}\n\n.dark-mode .scalar-pill--context-fn {\n background: color-mix(in srgb, var(--scalar-background-3), transparent 55%);\n}\n\n.light-mode .scalar-pill--context-fn {\n background: color-mix(in srgb, var(--scalar-background-3), transparent 40%);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkGhB,MAAM,OAAO;EAOb,MAAM,QAAQ,UAAU;;;;;;EAOxB,MAAM,uBAAuB,IAAmB,KAAI;EACpD,MAAM,cAAc,eACQ,MAAM,MAAM,qBAAqB,SAAS,KAAA,EACtE;EACA,MAAM,0BAAgC;AACpC,OAAI,CAAC,MAAM,MAAM,qBAAqB,UAAU,KAC9C,sBAAqB,QAAQ,MAAM,QAAQ;;EAI/C,MAAM,YAAY,eAA+B,YAAW;EAC5D,MAAM,cAAc,IAEV,KAAI;;EAGd,MAAM,YAAY,eAChB,YAAY,QAAQ,GAAG,YAAY,MAAM,YAAY,KAAA,EACvD;;;;;EAMA,MAAM,iBAAiB,eACK,YAAY,OAAO,eAC/C;EAEA,MAAM,YAAY,IAAI,MAAK;EAC3B,MAAM,UAAU,IAAI,KAAI;;;;;;EAOxB,MAAM,cAAc,IAAI,MAAK;;;;;;;;;;;EAY7B,MAAM,gBAAgB,SAA0B,KAAK,MAAM,CAAC,WAAW;;EAOvE,MAAM,gBAAgB,eAAwB;AAC5C,OAAI,QAAA,MAAU,OACZ,QAAO;AAET,UAAO,QAAA,SAAS,aAAc,MAAM,QAAQ,QAAA,KAAK,IAAI,QAAA,KAAK,S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A,MAAA;MAAA,MAAA;MAAA,CAAA;KACd,UAAQ"}
|
|
1
|
+
{"version":3,"file":"CodeInputLite.vue.script.js","names":["$attrs","$slots"],"sources":["../../../../src/v2/components/code-input/CodeInputLite.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * CodeInputLite\n *\n * Single-line `contenteditable` editor that renders `{{varname}}` as atomic\n * pill spans (`contenteditable=\"false\"`) and offers an env-variable\n * autocomplete on `{{`. The value is still exposed as a `{{name}}`-bearing\n * string via `update:modelValue`; DOM ↔ model conversion lives in\n * `renderModel` and `serializeEditor`.\n */\nexport default {\n inheritAttrs: false,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { isDefined } from '@scalar/helpers/array/is-defined'\nimport { REGEX } from '@scalar/helpers/regex/regex-helpers'\nimport {\n CONTEXT_FUNCTION_NAMES,\n getContextFunctionComment,\n isContextFunctionName,\n type ContextFunctionName,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { nanoid } from 'nanoid'\nimport {\n computed,\n createApp,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n useAttrs,\n useTemplateRef,\n watch,\n type App,\n} from 'vue'\n\nimport DataTableInputSelect from '@/v2/components/data-table/DataTableInputSelect.vue'\nimport EnvironmentVariableDropdown from '@/v2/features/environments/components/EnvironmentVariablesDropdown.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport type { CodeInputModelValue } from './CodeInput.vue'\nimport { buildPillContext } from './helpers/build-pill-context'\nimport { lookupVariableValue } from './helpers/lookup-variable-value'\nimport { pillSignature } from './helpers/pill-signature'\nimport { serializeValue } from './helpers/serialize-value'\nimport PillTooltipHost from './PillTooltipHost.vue'\n\ntype Props = {\n modelValue: CodeInputModelValue\n /** Environment for variable substitution. Pass undefined to disable env vars */\n environment: XScalarEnvironment | undefined\n /** Render as a non-interactive read-only label */\n disabled?: boolean\n /** Render the input with the native `readonly` attribute (still focusable, no edits) */\n readOnly?: boolean\n /** Show error styling */\n error?: boolean\n /** Layout context affects styling and dropdown visibility */\n layout?: ClientLayout\n /** Placeholder text for an empty input */\n placeholder?: string\n /** Show required indicator */\n required?: boolean\n /** Emit submit on blur */\n emitOnBlur?: boolean\n /** Render variable pills + show the autocomplete dropdown */\n withVariables?: boolean\n /** Include `{{$guid}}` etc. in the autocomplete dropdown */\n withFakeData?: boolean\n /** Always emit change events even if the value is unchanged */\n alwaysEmitChange?: boolean\n /** Strike-through styling for the input text (e.g. overridden values) */\n linethrough?: boolean\n /** Schema type — drives boolean select mode when `boolean` is included */\n type?: string | string[]\n /** Predefined enum values; when set the input is replaced by a select */\n enum?: string[]\n /** Example values; when set (and no enum/boolean) the input is replaced by a select */\n examples?: string[]\n /** Default value to suggest in select modes */\n default?: CodeInputModelValue\n /** Whether the boolean select includes a `null` option */\n nullable?: boolean\n}\n\nconst {\n modelValue,\n environment,\n disabled = false,\n readOnly = false,\n error = false,\n layout = 'desktop',\n placeholder,\n required = false,\n emitOnBlur = true,\n alwaysEmitChange = false,\n withVariables = true,\n withFakeData = false,\n linethrough = false,\n type,\n enum: enumProp,\n examples,\n default: defaultProp,\n nullable = false,\n} = defineProps<Props>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n 'submit': [value: string, event: KeyboardEvent | FocusEvent]\n 'blur': [value: string, event: FocusEvent]\n 'navigate': [route: { page: 'document'; path: 'environment' }]\n}>()\n\nconst attrs = useAttrs() as { 'id'?: string; 'aria-label'?: string }\n\n/**\n * The id only matters once the dropdown opens (`aria-controls` /\n * `aria-activedescendant`), so we defer `nanoid()` until first focus to\n * keep idle instances cheap. A consumer-supplied `id` attr is preserved.\n */\nconst generatedComponentId = ref<string | null>(null)\nconst componentId = computed(\n (): string | undefined => attrs.id ?? generatedComponentId.value ?? undefined,\n)\nconst ensureComponentId = (): void => {\n if (!attrs.id && generatedComponentId.value === null) {\n generatedComponentId.value = `id-${nanoid()}`\n }\n}\n\nconst editorRef = useTemplateRef<HTMLDivElement>('editorRef')\nconst dropdownRef = ref<InstanceType<\n typeof EnvironmentVariableDropdown\n> | null>(null)\n\n/** Id of the dropdown's `role=\"listbox\"` element, for the combobox wiring. */\nconst listboxId = computed((): string | undefined =>\n componentId.value ? `${componentId.value}-listbox` : undefined,\n)\n\n/**\n * Id of the option the dropdown currently highlights. Mirrors the dropdown's\n * own selection so the editor can expose it via `aria-activedescendant`.\n */\nconst activeOptionId = computed(\n (): string | undefined => dropdownRef.value?.activeOptionId,\n)\n\nconst isFocused = ref(false)\nconst isEmpty = ref(true)\n\n/**\n * True while an IME composition is in progress. Rebuilding the editor DOM\n * mid-composition (e.g. when `{{` forms a pill) cancels the composition, so we\n * defer those rebuilds until `compositionend`.\n */\nconst isComposing = ref(false)\n\n/**\n * Whether the serialized value should count as empty for placeholder display.\n *\n * `contenteditable` can leave behind invisible residue after some delete\n * sequences — most commonly a non-breaking space (` `) — which makes a\n * visually empty field report a non-zero length and silently drop its\n * placeholder. Trimming covers that case; ` ` counts as whitespace, so a\n * field that only holds editor residue is treated as empty. This affects the\n * placeholder flag only, never the value emitted via `serializeEditor`.\n */\nconst isBlankValue = (text: string): boolean => text.trim().length === 0\n\n// ───────────────────────────────────────────────────────────────────\n// Rendering-mode detection (parity with CodeInput's select dispatch)\n// ───────────────────────────────────────────────────────────────────\n\n/** True when the schema type is exactly `boolean` (or includes it in a tuple type). */\nconst isBooleanMode = computed((): boolean => {\n if (enumProp?.length) {\n return false\n }\n return type === 'boolean' || (Array.isArray(type) && type.includes('boolean'))\n})\n\nconst booleanOptions = computed((): string[] =>\n nullable ? ['true', 'false', 'null'] : ['true', 'false'],\n)\n\n/** Default type when the schema is a tuple — picks the first non-null entry. */\nconst defaultType = computed((): string | undefined => {\n if (Array.isArray(type)) {\n return type.find((t) => t !== 'null') ?? 'string'\n }\n return type\n})\n\nconst handleSelectChange = (value: string): void =>\n emit('update:modelValue', value)\n\n// ───────────────────────────────────────────────────────────────────\n// Per-pill tooltip apps\n// ───────────────────────────────────────────────────────────────────\n\nlet pillTooltipApps: App[] = []\n\n/**\n * Per-pill tooltips are the heaviest part of the render (a Vue app +\n * `useTooltip` watch + listeners each), so we defer mounting them until\n * the first interaction (focus, pointerover, or dropdown open). Once on,\n * subsequent rebuilds remount tooltips for the new pills.\n */\nlet tooltipsActive = false\n\nconst teardownPillTooltips = (): void => {\n for (const app of pillTooltipApps) {\n app.unmount()\n }\n pillTooltipApps = []\n}\n\nconst mountPillTooltips = (): void => {\n if (!editorRef.value || layout === 'modal') {\n return\n }\n const pills = editorRef.value.querySelectorAll<HTMLElement>('.scalar-pill')\n for (const pillEl of pills) {\n const variableName = pillEl.dataset.variable ?? ''\n const context = buildPillContext(variableName, environment)\n const app = createApp(PillTooltipHost, { context, target: pillEl })\n // PillTooltipHost is renderless; useTooltip attaches to `target` directly.\n app.mount(document.createElement('div'))\n pillTooltipApps.push(app)\n }\n}\n\n// ───────────────────────────────────────────────────────────────────\n// DOM ↔ model conversion\n// ───────────────────────────────────────────────────────────────────\n\n/**\n * Build a pill `<span>` for the given variable. `contentEditable = 'false'`\n * makes the browser treat it as a single atom (arrow keys jump over it,\n * Backspace deletes it whole); `{{` / `}}` only live in the model string.\n */\nconst createPillElement = (\n name: string,\n start: number,\n end: number,\n): HTMLSpanElement => {\n const isCtx = isContextFunctionName(name)\n const span = document.createElement('span')\n span.className = isCtx ? 'scalar-pill scalar-pill--context-fn' : 'scalar-pill'\n span.contentEditable = 'false'\n span.dataset.variable = name\n // Model-coordinate offsets (the pill stands in for the full `{{name}}`).\n // Used by click forwarding and tests to map a pill back to the value.\n span.dataset.pillStart = String(start)\n span.dataset.pillEnd = String(end)\n\n const color = isCtx\n ? 'var(--scalar-color-3)'\n : environment?.color || 'var(--scalar-color-1)'\n span.style.setProperty('--tw-bg-base', color)\n\n // Fade env pills with no usable value. A falsy check (not just\n // `=== undefined`) matches the tooltip path's `Boolean(value)`, so a\n // variable declared with an empty string fades here too.\n const isUndefinedEnv = !isCtx && !lookupVariableValue(environment, name)\n if (isUndefinedEnv) {\n span.style.opacity = '0.5'\n }\n\n span.textContent = name\n return span\n}\n\n/** Render a model string into the editor as a mix of text nodes + pills. */\nconst renderModel = (text: string): void => {\n const editor = editorRef.value\n if (!editor) {\n return\n }\n\n teardownPillTooltips()\n editor.replaceChildren()\n\n if (!withVariables || !text.includes('{{')) {\n if (text) {\n editor.appendChild(document.createTextNode(text))\n }\n isEmpty.value = isBlankValue(text)\n return\n }\n\n const regex = new RegExp(REGEX.VARIABLES.source, REGEX.VARIABLES.flags)\n let lastIndex = 0\n let match: RegExpExecArray | null\n\n while ((match = regex.exec(text)) !== null) {\n const start = match.index\n const end = start + match[0].length\n if (start > lastIndex) {\n editor.appendChild(document.createTextNode(text.slice(lastIndex, start)))\n }\n editor.appendChild(createPillElement(match[1] ?? '', start, end))\n lastIndex = end\n }\n\n if (lastIndex < text.length) {\n editor.appendChild(document.createTextNode(text.slice(lastIndex)))\n }\n\n isEmpty.value = false\n if (tooltipsActive) {\n mountPillTooltips()\n }\n}\n\n/** Length the given child contributes to the serialized model string. */\nconst modelLengthOf = (node: Node): number => {\n if (node.nodeType === Node.TEXT_NODE) {\n return (node.textContent ?? '').length\n }\n if (node instanceof HTMLElement && node.classList.contains('scalar-pill')) {\n return `{{${node.dataset.variable ?? ''}}}`.length\n }\n // Defensive: a stray element (e.g. browser-inserted <br>) — use its text.\n return (node.textContent ?? '').length\n}\n\n/** Read the editor DOM back into a `{{name}}`-bearing model string. */\nconst serializeEditor = (): string => {\n const editor = editorRef.value\n if (!editor) {\n return ''\n }\n let out = ''\n for (const node of Array.from(editor.childNodes)) {\n if (node.nodeType === Node.TEXT_NODE) {\n out += node.textContent ?? ''\n } else if (\n node instanceof HTMLElement &&\n node.classList.contains('scalar-pill')\n ) {\n out += `{{${node.dataset.variable ?? ''}}}`\n } else if (node instanceof HTMLElement) {\n // Flatten any stray <br> / <div> the browser may inject on paste/Enter.\n out += node.textContent ?? ''\n }\n }\n return out\n}\n\nlet lastPillSignature: string | null = null\nlet lastEnvKey = ''\n\n/**\n * Cache key for the env + `withVariables` state. Includes variable\n * name/value pairs so the watcher notices adds/removes/edits even when\n * `environment.color` is unchanged — without that, pills keep stale\n * `isDefined` opacity and tooltip values until the input itself changes.\n */\nconst computeEnvKey = (): string => {\n const color = environment?.color ?? ''\n const flag = withVariables ? '1' : '0'\n const variables = environment?.variables ?? []\n let vars = ''\n for (const v of variables) {\n const value =\n typeof v.value === 'string' ? v.value : (v.value?.default ?? '')\n // Unit separators (\\x1f / \\x1e) so values can safely contain `|` or `=`.\n vars += `\\x1f${v.name}\\x1e${value}`\n }\n return `${color}|${flag}|${vars}`\n}\n\n/** Idempotent: first call flips `tooltipsActive` and mounts pill tooltips. */\nconst ensureTooltipsActive = (): void => {\n if (tooltipsActive) {\n return\n }\n tooltipsActive = true\n mountPillTooltips()\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Caret ↔ model offset\n// ───────────────────────────────────────────────────────────────────\n\n/** Selection start as a model-string offset, or `null` if not inside the editor. */\nconst getModelCaret = (): number | null => {\n const editor = editorRef.value\n if (!editor) {\n return null\n }\n const selection = window.getSelection()\n if (!selection || selection.rangeCount === 0) {\n return null\n }\n const range = selection.getRangeAt(0)\n if (\n range.startContainer !== editor &&\n !editor.contains(range.startContainer)\n ) {\n return null\n }\n\n // Anchored on the editor itself: `startOffset` is a child index.\n if (range.startContainer === editor) {\n let pos = 0\n for (\n let i = 0;\n i < range.startOffset && i < editor.childNodes.length;\n i++\n ) {\n pos += modelLengthOf(editor.childNodes[i] as Node)\n }\n return pos\n }\n\n let pos = 0\n for (const child of Array.from(editor.childNodes)) {\n if (child === range.startContainer) {\n return pos + range.startOffset\n }\n // Pills are non-editable; if a browser quirk still lands a selection\n // inside one, snap to the nearest boundary instead of getting stuck.\n if (child.contains(range.startContainer)) {\n return range.startOffset === 0 ? pos : pos + modelLengthOf(child)\n }\n pos += modelLengthOf(child)\n }\n return pos\n}\n\n/** Place the caret at the given model offset, walking the DOM to find it. */\nconst setModelCaret = (target: number): void => {\n const editor = editorRef.value\n if (!editor) {\n return\n }\n const range = document.createRange()\n let pos = 0\n let placed = false\n\n for (const child of Array.from(editor.childNodes)) {\n const len = modelLengthOf(child)\n if (pos + len >= target) {\n if (child.nodeType === Node.TEXT_NODE) {\n const into = Math.max(\n 0,\n Math.min(target - pos, (child.textContent ?? '').length),\n )\n range.setStart(child, into)\n } else if (target - pos <= 0) {\n range.setStartBefore(child)\n } else {\n range.setStartAfter(child)\n }\n placed = true\n break\n }\n pos += len\n }\n\n if (!placed) {\n range.selectNodeContents(editor)\n range.collapse(false)\n } else {\n range.collapse(true)\n }\n\n const selection = window.getSelection()\n if (!selection) {\n return\n }\n selection.removeAllRanges()\n selection.addRange(range)\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Environment variable dropdown\n// ───────────────────────────────────────────────────────────────────\n\nconst showDropdown = ref(false)\nconst dropdownQuery = ref('')\nconst dropdownPosition = ref({ left: 0, top: 0 })\n\nconst contextFunctionDropdownItems = computed(() =>\n withFakeData\n ? CONTEXT_FUNCTION_NAMES.map((key) => ({\n key,\n description: getContextFunctionComment(key as ContextFunctionName),\n }))\n : [],\n)\n\nconst displayVariablesDropdown = computed(\n (): boolean =>\n showDropdown.value &&\n withVariables &&\n layout !== 'modal' &&\n (Boolean(environment) || withFakeData),\n)\n\nconst updateDropdownVisibility = (): void => {\n const editor = editorRef.value\n if (!editor) {\n return\n }\n const caret = getModelCaret()\n if (caret === null) {\n showDropdown.value = false\n return\n }\n const text = serializeEditor().slice(0, caret)\n const lastOpen = text.lastIndexOf('{{')\n const lastClose = text.lastIndexOf('}}')\n\n if (lastOpen <= lastClose) {\n showDropdown.value = false\n return\n }\n\n dropdownQuery.value = text.slice(lastOpen + 2)\n // Make sure the combobox has an id before it advertises `aria-expanded`, so\n // `aria-controls` always resolves to the listbox we are about to render.\n ensureComponentId()\n showDropdown.value = true\n\n // Anchor under the caret; `getBoundingClientRect` gives the caret rect in one read.\n nextTick(() => {\n const selection = window.getSelection()\n if (!selection || selection.rangeCount === 0 || !editorRef.value) {\n return\n }\n const r = selection.getRangeAt(0).cloneRange()\n r.collapse(true)\n const rect = r.getBoundingClientRect()\n const editorRect = editorRef.value.getBoundingClientRect()\n // Some browsers collapse empty ranges to a zero rect — fall back to the editor edge.\n dropdownPosition.value = {\n left: rect.left || editorRect.left,\n top: rect.bottom || editorRect.bottom,\n }\n })\n}\n\nconst handleDropdownSelect = (item: string): void => {\n if (readOnly) {\n return\n }\n const caret = getModelCaret() ?? 0\n const value = serializeEditor()\n const from = Math.max(0, caret - dropdownQuery.value.length - 2)\n const to = caret\n const next = `${value.slice(0, from)}{{${item}}}${value.slice(to)}`\n const nextCursor = from + `{{${item}}}`.length\n\n // Pill set changed — force a re-render and reposition the caret.\n lastPillSignature = pillSignature(next, withVariables)\n renderModel(next)\n setModelCaret(nextCursor)\n\n showDropdown.value = false\n emitChange(next, { skipDropdownCheck: true })\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Change / focus / blur\n// ───────────────────────────────────────────────────────────────────\n\nconst emitChange = (\n value: string,\n opts: { skipDropdownCheck?: boolean } = {},\n): void => {\n const same = value === serializeValue(modelValue)\n if (alwaysEmitChange || !same) {\n emit('update:modelValue', value)\n }\n if (!opts.skipDropdownCheck) {\n updateDropdownVisibility()\n }\n}\n\nconst handleInput = (): void => {\n const text = serializeEditor()\n isEmpty.value = isBlankValue(text)\n\n // Only rebuild when the pill set changes (e.g. `}}` closed a pattern, or\n // a value was pasted). Skipping it for plain-text edits preserves the\n // live selection — important for IME composition and double-click select.\n // Also defer while composing; `handleCompositionEnd` re-runs this path so the\n // rebuild happens once the IME has committed its text.\n const sig = pillSignature(text, withVariables)\n if (!isComposing.value && sig !== lastPillSignature) {\n const caret = getModelCaret()\n lastPillSignature = sig\n renderModel(text)\n if (caret !== null) {\n setModelCaret(caret)\n }\n }\n\n emitChange(text)\n}\n\nconst handleCompositionStart = (): void => {\n isComposing.value = true\n}\n\nconst handleCompositionEnd = (): void => {\n isComposing.value = false\n // Run the deferred input path now that the composition has committed, so any\n // pill that formed during composition is rendered.\n handleInput()\n}\n\nconst handleFocus = (): void => {\n isFocused.value = true\n ensureComponentId()\n ensureTooltipsActive()\n}\n\nconst handleBlur = (event: FocusEvent): void => {\n isFocused.value = false\n showDropdown.value = false\n const value = serializeEditor()\n // Check the serialized `value`, not `modelValue` — a `0` or `false` model is\n // a valid non-empty entry that should still submit on blur.\n if (emitOnBlur && value) {\n emit('submit', value, event)\n }\n emit('blur', value, event)\n}\n\n/**\n * Strip rich content on paste; `contenteditable=\"plaintext-only\"` is not\n * reliable cross-browser, so we intercept and use `insertText` to keep undo.\n */\nconst handlePaste = (event: ClipboardEvent): void => {\n event.preventDefault()\n const text = event.clipboardData?.getData('text/plain') ?? ''\n if (!text) {\n return\n }\n document.execCommand('insertText', false, text.replace(/\\r?\\n/g, ' '))\n // `insertText` normally fires an `input` event, but that is not guaranteed\n // across browsers. Run the same path explicitly so pill rendering, emptiness,\n // `update:modelValue`, and the dropdown never lag behind the pasted DOM.\n handleInput()\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Keyboard handling\n// ───────────────────────────────────────────────────────────────────\n\nconst handleKeyDown = (event: KeyboardEvent): void => {\n if (showDropdown.value) {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault()\n event.stopPropagation()\n dropdownRef.value?.handleArrowKey(\n event.key === 'ArrowDown' ? 'down' : 'up',\n )\n return\n }\n if (event.key === 'Enter') {\n event.preventDefault()\n event.stopPropagation()\n dropdownRef.value?.handleSelect()\n return\n }\n if (event.key === 'Escape') {\n event.preventDefault()\n event.stopPropagation()\n showDropdown.value = false\n return\n }\n }\n\n if (event.key === 'Enter') {\n // Block the browser default so a contenteditable div does not insert\n // <br> / <div> and break single-line semantics, then emit submit\n // (used by the table editors).\n event.preventDefault()\n emit('submit', serializeEditor(), event)\n return\n }\n\n // Backspace / Delete: pill atomicity is handled by the browser via\n // `contenteditable=\"false\"` on pills — no manual `}}`-pair handling needed.\n}\n\n// ───────────────────────────────────────────────────────────────────\n// Click forwarding & lifecycle\n// ───────────────────────────────────────────────────────────────────\n\n/**\n * Clicking a pill selects it whole, so a subsequent Backspace deletes it\n * in one keystroke and typing replaces it — the usual chip/mention model.\n */\nconst handleEditorClick = (event: MouseEvent): void => {\n const target = (event.target as HTMLElement | null)?.closest<HTMLElement>(\n '.scalar-pill',\n )\n if (!target) {\n return\n }\n const editor = editorRef.value\n if (!editor) {\n return\n }\n editor.focus()\n const range = document.createRange()\n range.selectNode(target)\n const selection = window.getSelection()\n selection?.removeAllRanges()\n selection?.addRange(range)\n updateDropdownVisibility()\n}\n\nonMounted(() => {\n const initial = serializeValue(modelValue)\n lastPillSignature = pillSignature(initial, withVariables)\n lastEnvKey = computeEnvKey()\n renderModel(initial)\n isEmpty.value = isBlankValue(initial)\n\n // `autofocus` on a contenteditable div is not honoured natively, so focus\n // the editor ourselves when the consumer passes the attribute.\n if (Object.hasOwn(attrs, 'autofocus')) {\n editorRef.value?.focus()\n }\n})\n\nwatch(\n () => modelValue,\n (next) => {\n const serialized = serializeValue(next)\n // Always sync the placeholder flag, even when the DOM already matches and we\n // skip the rebuild below. Otherwise a value cell that switches from select\n // mode (no editor element) into the empty editor keeps a stale `isEmpty`,\n // and the placeholder silently disappears.\n isEmpty.value = isBlankValue(serialized)\n if (serializeEditor() === serialized) {\n return\n }\n lastPillSignature = pillSignature(serialized, withVariables)\n renderModel(serialized)\n },\n)\n\nwatch(\n [() => environment, () => withVariables],\n () => {\n // Env changes affect pill colour and `isDefined` opacity — rebuild.\n const envKey = computeEnvKey()\n if (envKey === lastEnvKey) {\n return\n }\n lastEnvKey = envKey\n // Most rows are plain text; skip the DOM walk when there are no pills.\n // Pills introduced later flow through `handleInput` / the modelValue\n // watcher, which update `lastPillSignature`.\n if (lastPillSignature === '') {\n return\n }\n lastPillSignature = pillSignature(serializeEditor(), withVariables)\n // Preserve the caret across the rebuild so editing does not jump to the\n // start when the environment changes mid-edit (mirrors `handleInput`).\n const caret = getModelCaret()\n renderModel(serializeEditor())\n if (caret !== null) {\n setModelCaret(caret)\n }\n },\n // Variables are often mutated in place (e.g. editing a value in the env\n // editor) without the object reference changing — deep watch catches it.\n { deep: true },\n)\n\nonBeforeUnmount(() => {\n teardownPillTooltips()\n})\n\n// ───────────────────────────────────────────────────────────────────\n// Public API\n// ───────────────────────────────────────────────────────────────────\n\ndefineExpose({\n /** Focus the editor. `position` controls caret placement. */\n focus: (position?: 'start' | 'end' | number): void => {\n const editor = editorRef.value\n if (!editor) {\n return\n }\n editor.focus()\n if (!isDefined(position)) {\n return\n }\n const length = serializeEditor().length\n const pos =\n position === 'start' ? 0 : position === 'end' ? length : position\n setModelCaret(pos)\n },\n /** Replace the current value programmatically and re-render the pills. */\n setContent: (next = ''): void => {\n if (serializeEditor() === next) {\n return\n }\n lastPillSignature = pillSignature(next, withVariables)\n renderModel(next)\n isEmpty.value = isBlankValue(next)\n },\n /** Read the current value as a `{{name}}`-bearing string. */\n getValue: (): string => serializeEditor(),\n /** Caret offset in the model string. */\n cursorPosition: (): number | undefined => {\n const c = getModelCaret()\n return c === null ? undefined : c\n },\n isFocused,\n editorRef,\n})\n</script>\n\n<template>\n <!-- Disabled mode: read-only label -->\n <div\n v-if=\"disabled\"\n class=\"text-c-2 flex cursor-default items-center justify-center\"\n :class=\"{\n 'font-code pr-2 pl-1 text-base': layout === 'modal',\n 'px-2': layout !== 'modal',\n 'line-through': linethrough,\n }\"\n data-testid=\"code-input-lite-disabled\">\n <span class=\"whitespace-nowrap\">{{ modelValue }}</span>\n </div>\n\n <!-- Enum mode: select dropdown with predefined values -->\n <DataTableInputSelect\n v-else-if=\"enumProp?.length\"\n :default=\"defaultProp\"\n :modelValue=\"modelValue\"\n :type=\"defaultType\"\n :value=\"enumProp\"\n @update:modelValue=\"handleSelectChange\" />\n\n <!-- Boolean mode: select dropdown with true/false (and optionally null) -->\n <DataTableInputSelect\n v-else-if=\"isBooleanMode\"\n :default=\"defaultProp\"\n :modelValue=\"modelValue\"\n :value=\"booleanOptions\"\n @update:modelValue=\"handleSelectChange\" />\n\n <!-- Examples mode: select dropdown with example values -->\n <DataTableInputSelect\n v-else-if=\"examples?.length\"\n :default=\"defaultProp\"\n :modelValue=\"modelValue\"\n :value=\"examples\"\n @update:modelValue=\"handleSelectChange\" />\n\n <!-- Editor mode -->\n <div\n v-else\n :id=\"componentId\"\n v-bind=\"$attrs\"\n class=\"code-input-lite group/code-input-lite peer relative w-full leading-[1.44] -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline\"\n :class=\"{\n 'code-input-lite--error': error,\n 'code-input-lite--empty': isEmpty,\n 'line-through': linethrough,\n }\">\n <!-- The single editable surface; see the file header for how pills work. -->\n <div\n ref=\"editorRef\"\n :aria-activedescendant=\"\n displayVariablesDropdown ? activeOptionId : undefined\n \"\n :aria-autocomplete=\"withVariables ? 'list' : undefined\"\n :aria-controls=\"displayVariablesDropdown ? listboxId : undefined\"\n :aria-expanded=\"displayVariablesDropdown ? 'true' : undefined\"\n :aria-invalid=\"error ? 'true' : undefined\"\n :aria-label=\"attrs['aria-label']\"\n :aria-readonly=\"readOnly ? 'true' : undefined\"\n :aria-required=\"required ? 'true' : undefined\"\n class=\"code-input-lite__editor\"\n :contenteditable=\"readOnly ? 'false' : 'true'\"\n :data-placeholder=\"placeholder\"\n :role=\"withVariables ? 'combobox' : 'textbox'\"\n spellcheck=\"false\"\n @blur=\"handleBlur\"\n @click=\"handleEditorClick\"\n @compositionend=\"handleCompositionEnd\"\n @compositionstart=\"handleCompositionStart\"\n @focus=\"handleFocus\"\n @input=\"handleInput\"\n @keydown=\"handleKeyDown\"\n @paste=\"handlePaste\"\n @pointerover=\"ensureTooltipsActive\" />\n </div>\n\n <!--\n Slots and the required indicator are siblings of the mode templates so\n they render in every mode and so `absolute right-0` anchors to the\n surrounding (relative) cell rather than the shrink-wrapped mode wrapper.\n -->\n <div\n v-if=\"$slots.warning\"\n class=\"centered-y text-orange absolute right-7 text-xs\">\n <slot name=\"warning\" />\n </div>\n <div\n v-if=\"$slots.icon\"\n class=\"centered-y absolute right-0 flex h-full items-center p-1.5 group-has-[.code-input-lite__editor:focus]:z-1\">\n <slot name=\"icon\" />\n </div>\n <div\n v-if=\"required\"\n class=\"required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 mr-0.5 pt-px pr-2 opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 peer-has-[.code-input-lite__editor:focus]:opacity-0\">\n Required\n </div>\n\n <EnvironmentVariableDropdown\n v-if=\"displayVariablesDropdown\"\n ref=\"dropdownRef\"\n :contextFunctionItems=\"contextFunctionDropdownItems\"\n :dropdownPosition=\"dropdownPosition\"\n :environment=\"environment\"\n :listboxId=\"listboxId\"\n :query=\"dropdownQuery\"\n @close=\"showDropdown = false\"\n @redirect=\"emit('navigate', { page: 'document', path: 'environment' })\"\n @select=\"handleDropdownSelect\" />\n</template>\n\n<style scoped>\n.code-input-lite {\n /* Flex so the editor centres vertically in whatever height the cell gives us.\n Font properties inherit so we adopt the surrounding typography. */\n display: flex;\n align-items: center;\n}\n\n.code-input-lite__editor {\n /* Everything font-related inherits from the surrounding context. */\n font: inherit;\n letter-spacing: inherit;\n flex: 1;\n min-width: 0;\n background: transparent;\n outline: none;\n color: var(--scalar-color-1);\n caret-color: var(--scalar-color-1);\n /* Single-line: horizontal scroll keeps the caret visible for long values;\n the scrollbar itself is hidden (would be noisy inside a table cell). */\n white-space: pre;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none;\n padding: 0 0.5em;\n box-sizing: border-box;\n line-height: 1.44;\n /* Positioning context for the absolutely positioned placeholder. */\n position: relative;\n}\n\n.code-input-lite__editor::-webkit-scrollbar {\n display: none;\n}\n\n/* Absolute so the placeholder does not occupy flow space inside the\n contenteditable; otherwise the caret would land after it on focus.\n `pointer-events: none` lets clicks fall through to focus the editor.\n Hidden on focus so it never renders on top of the text caret. */\n.code-input-lite--empty .code-input-lite__editor:not(:focus)::before {\n content: attr(data-placeholder);\n color: var(--scalar-color-3);\n pointer-events: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0.5em;\n display: flex;\n align-items: center;\n}\n\n.code-input-lite--error .code-input-lite__editor {\n outline: 1px solid var(--scalar-color-red);\n}\n</style>\n\n<style>\n/* Pill styling. Each pill is `<span contenteditable=\"false\">name</span>` —\n an atomic widget; the caret lands before or after it, never inside. */\n.scalar-pill {\n color: var(--scalar-color-2);\n border-radius: var(--scalar-radius-full);\n display: inline-block;\n font-family: var(--scalar-font-code);\n font-size: 0.9em;\n line-height: 1.4;\n vertical-align: baseline;\n background: var(--scalar-background-3);\n padding: 0.125em 0.6em;\n margin-right: 0.35em;\n cursor: text;\n /* Single click selects the whole pill — chip/mention model, deletes in one go. */\n user-select: all;\n -webkit-user-select: all;\n}\n\n.dark-mode .scalar-pill {\n background: color-mix(\n in srgb,\n var(--tw-bg-base, var(--scalar-color-1)),\n transparent 90%\n );\n}\n\n.light-mode .scalar-pill {\n background: var(--scalar-background-3);\n}\n\n.scalar-pill--context-fn {\n /* Inset box-shadow as a border so the layout box stays identical to plain pills. */\n box-shadow: 0 0 0 1px\n color-mix(in srgb, var(--scalar-color-3), transparent 35%) inset;\n}\n\n.dark-mode .scalar-pill--context-fn {\n background: color-mix(in srgb, var(--scalar-background-3), transparent 55%);\n}\n\n.light-mode .scalar-pill--context-fn {\n background: color-mix(in srgb, var(--scalar-background-3), transparent 40%);\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkGhB,MAAM,OAAO;EAOb,MAAM,QAAQ,UAAU;;;;;;EAOxB,MAAM,uBAAuB,IA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;;IASVC,KAAAA,OAAO,WAAA,WAAA,EADf,mBAIM,OAJN,YAIM,CADJ,WAAuB,KAAA,QAAA,WAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA;IAGjBA,KAAAA,OAAO,QAAA,WAAA,EADf,mBAIM,OAJN,YAIM,CADJ,WAAoB,KAAA,QAAA,QAAA,EAAA,EAAA,KAAA,GAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA;IAGd,QAAA,YAAA,WAAA,EADR,mBAIM,OAJN,YAEqR,aAErR,IAAA,mBAAA,IAAA,KAAA;IAGQ,yBAAA,SAAA,WAAA,EADR,YAUmC,sCAAA;;cAR7B;KAAJ,KAAI;KACH,sBAAsB,6BAAA;KACtB,kBAAkB,iBAAA;KAClB,aAAa,QAAA;KACb,WAAW,UAAA;KACX,OAAO,cAAA;KACP,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,aAAA,QAAY;KACnB,YAAQ,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,YAAA;MAAA,MAAA;MAAA,MAAA;MAAA,CAAA;KACd,UAAQ"}
|
package/dist/v2/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/v2/constants.ts
|
|
2
2
|
/** The version number taken from the package.json. Consumers can override at build time via define (e.g. OVERRIDE_PACKAGE_VERSION: JSON.stringify('1.2.3')). */
|
|
3
|
-
var APP_VERSION = typeof OVERRIDE_PACKAGE_VERSION !== "undefined" ? OVERRIDE_PACKAGE_VERSION : "3.13.
|
|
3
|
+
var APP_VERSION = typeof OVERRIDE_PACKAGE_VERSION !== "undefined" ? OVERRIDE_PACKAGE_VERSION : "3.13.6";
|
|
4
4
|
//#endregion
|
|
5
5
|
export { APP_VERSION };
|
|
6
6
|
|
package/dist/vue-styles.css
CHANGED
|
@@ -70,23 +70,23 @@ to {
|
|
|
70
70
|
/*
|
|
71
71
|
Deep styling for customizing Codemirror
|
|
72
72
|
*/
|
|
73
|
-
[data-v-
|
|
73
|
+
[data-v-dfc591f4] .cm-editor {
|
|
74
74
|
height: 100%;
|
|
75
75
|
outline: none;
|
|
76
76
|
padding: 0;
|
|
77
77
|
background: transparent;
|
|
78
78
|
}
|
|
79
|
-
[data-v-
|
|
79
|
+
[data-v-dfc591f4] .cm-placeholder {
|
|
80
80
|
color: var(--scalar-color-3);
|
|
81
81
|
}
|
|
82
|
-
[data-v-
|
|
82
|
+
[data-v-dfc591f4] .cm-content {
|
|
83
83
|
font-family: var(--scalar-font-code);
|
|
84
84
|
font-size: var(--scalar-small);
|
|
85
85
|
max-height: 20px;
|
|
86
86
|
padding: 8px 0;
|
|
87
87
|
}
|
|
88
88
|
/* Tooltip helper */
|
|
89
|
-
[data-v-
|
|
89
|
+
[data-v-dfc591f4] .cm-tooltip {
|
|
90
90
|
background: transparent !important;
|
|
91
91
|
filter: brightness(var(--scalar-lifted-brightness));
|
|
92
92
|
border-radius: var(--scalar-radius);
|
|
@@ -95,43 +95,43 @@ to {
|
|
|
95
95
|
outline: none !important;
|
|
96
96
|
overflow: hidden !important;
|
|
97
97
|
}
|
|
98
|
-
[data-v-
|
|
98
|
+
[data-v-dfc591f4] .cm-tooltip-autocomplete ul li {
|
|
99
99
|
padding: 3px 6px !important;
|
|
100
100
|
}
|
|
101
|
-
[data-v-
|
|
101
|
+
[data-v-dfc591f4] .cm-completionIcon-type:after {
|
|
102
102
|
color: var(--scalar-color-3) !important;
|
|
103
103
|
}
|
|
104
|
-
[data-v-
|
|
104
|
+
[data-v-dfc591f4] .cm-tooltip-autocomplete ul li[aria-selected] {
|
|
105
105
|
background: var(--scalar-background-2) !important;
|
|
106
106
|
color: var(--scalar-color-1) !important;
|
|
107
107
|
}
|
|
108
|
-
[data-v-
|
|
108
|
+
[data-v-dfc591f4] .cm-tooltip-autocomplete ul {
|
|
109
109
|
padding: 6px !important;
|
|
110
110
|
position: relative;
|
|
111
111
|
}
|
|
112
|
-
[data-v-
|
|
112
|
+
[data-v-dfc591f4] .cm-tooltip-autocomplete ul li:hover {
|
|
113
113
|
border-radius: 3px;
|
|
114
114
|
color: var(--scalar-color-1) !important;
|
|
115
115
|
background: var(--scalar-background-3) !important;
|
|
116
116
|
}
|
|
117
117
|
/* Disable active line highlighting */
|
|
118
|
-
[data-v-
|
|
118
|
+
[data-v-dfc591f4] .cm-activeLine,[data-v-dfc591f4] .cm-activeLineGutter {
|
|
119
119
|
background-color: transparent;
|
|
120
120
|
}
|
|
121
121
|
/* Color selection matching */
|
|
122
|
-
[data-v-
|
|
122
|
+
[data-v-dfc591f4] .cm-selectionMatch,[data-v-dfc591f4] .cm-matchingBracket {
|
|
123
123
|
border-radius: var(--scalar-radius);
|
|
124
124
|
background: var(--scalar-background-4) !important;
|
|
125
125
|
}
|
|
126
126
|
/* Color Picker Swatches */
|
|
127
|
-
[data-v-
|
|
127
|
+
[data-v-dfc591f4] .cm-css-color-picker-wrapper {
|
|
128
128
|
display: inline-flex;
|
|
129
129
|
outline: 1px solid var(--scalar-background-3);
|
|
130
130
|
border-radius: 3px;
|
|
131
131
|
overflow: hidden;
|
|
132
132
|
}
|
|
133
133
|
/* Number gutter */
|
|
134
|
-
[data-v-
|
|
134
|
+
[data-v-dfc591f4] .cm-gutters {
|
|
135
135
|
background-color: transparent;
|
|
136
136
|
border-right: none;
|
|
137
137
|
color: var(--scalar-color-3);
|
|
@@ -139,7 +139,7 @@ to {
|
|
|
139
139
|
line-height: 22px;
|
|
140
140
|
border-radius: 0 0 0 3px;
|
|
141
141
|
}
|
|
142
|
-
[data-v-
|
|
142
|
+
[data-v-dfc591f4] .cm-gutters:before {
|
|
143
143
|
content: '';
|
|
144
144
|
position: absolute;
|
|
145
145
|
top: 2px;
|
|
@@ -149,7 +149,7 @@ to {
|
|
|
149
149
|
border-radius: var(--scalar-radius) 0 0 var(--scalar-radius);
|
|
150
150
|
background-color: var(--scalar-background-1);
|
|
151
151
|
}
|
|
152
|
-
[data-v-
|
|
152
|
+
[data-v-dfc591f4] .cm-gutterElement {
|
|
153
153
|
font-family: var(--scalar-font-code) !important;
|
|
154
154
|
padding-left: 0px !important;
|
|
155
155
|
padding-right: 6px !important;
|
|
@@ -158,16 +158,16 @@ to {
|
|
|
158
158
|
justify-content: flex-end;
|
|
159
159
|
position: relative;
|
|
160
160
|
}
|
|
161
|
-
[data-v-
|
|
161
|
+
[data-v-dfc591f4] .cm-lineNumbers .cm-gutterElement {
|
|
162
162
|
min-width: fit-content;
|
|
163
163
|
}
|
|
164
|
-
[data-v-
|
|
164
|
+
[data-v-dfc591f4] .cm-gutter + .cm-gutter :not(.cm-foldGutter) .cm-gutterElement {
|
|
165
165
|
padding-left: 0 !important;
|
|
166
166
|
}
|
|
167
|
-
[data-v-
|
|
167
|
+
[data-v-dfc591f4] .cm-scroller {
|
|
168
168
|
overflow: auto;
|
|
169
169
|
}
|
|
170
|
-
.line-wrapping[data-v-
|
|
170
|
+
.line-wrapping[data-v-dfc591f4]:focus-within .cm-content {
|
|
171
171
|
display: inline-table;
|
|
172
172
|
min-height: fit-content;
|
|
173
173
|
padding: 3px 6px;
|
|
@@ -178,9 +178,8 @@ to {
|
|
|
178
178
|
.cm-pill {
|
|
179
179
|
color: var(--scalar-color-1) !important;
|
|
180
180
|
padding: 0px 9px;
|
|
181
|
-
border-radius: 3px;
|
|
182
181
|
display: inline-block;
|
|
183
|
-
border-radius:
|
|
182
|
+
border-radius: var(--scalar-radius-full);
|
|
184
183
|
font-size: var(--scalar-small);
|
|
185
184
|
}
|
|
186
185
|
.light-mode .cm-pill {
|
|
@@ -423,13 +422,13 @@ to {
|
|
|
423
422
|
display: none;
|
|
424
423
|
}
|
|
425
424
|
|
|
426
|
-
.code-input-lite[data-v-
|
|
425
|
+
.code-input-lite[data-v-f03d0c9d] {
|
|
427
426
|
/* Flex so the editor centres vertically in whatever height the cell gives us.
|
|
428
427
|
Font properties inherit so we adopt the surrounding typography. */
|
|
429
428
|
display: flex;
|
|
430
429
|
align-items: center;
|
|
431
430
|
}
|
|
432
|
-
.code-input-lite__editor[data-v-
|
|
431
|
+
.code-input-lite__editor[data-v-f03d0c9d] {
|
|
433
432
|
/* Everything font-related inherits from the surrounding context. */
|
|
434
433
|
font: inherit;
|
|
435
434
|
letter-spacing: inherit;
|
|
@@ -451,7 +450,7 @@ to {
|
|
|
451
450
|
/* Positioning context for the absolutely positioned placeholder. */
|
|
452
451
|
position: relative;
|
|
453
452
|
}
|
|
454
|
-
.code-input-lite__editor[data-v-
|
|
453
|
+
.code-input-lite__editor[data-v-f03d0c9d]::-webkit-scrollbar {
|
|
455
454
|
display: none;
|
|
456
455
|
}
|
|
457
456
|
|
|
@@ -459,7 +458,7 @@ to {
|
|
|
459
458
|
contenteditable; otherwise the caret would land after it on focus.
|
|
460
459
|
`pointer-events: none` lets clicks fall through to focus the editor.
|
|
461
460
|
Hidden on focus so it never renders on top of the text caret. */
|
|
462
|
-
.code-input-lite--empty .code-input-lite__editor[data-v-
|
|
461
|
+
.code-input-lite--empty .code-input-lite__editor[data-v-f03d0c9d]:not(:focus)::before {
|
|
463
462
|
content: attr(data-placeholder);
|
|
464
463
|
color: var(--scalar-color-3);
|
|
465
464
|
pointer-events: none;
|
|
@@ -470,7 +469,7 @@ to {
|
|
|
470
469
|
display: flex;
|
|
471
470
|
align-items: center;
|
|
472
471
|
}
|
|
473
|
-
.code-input-lite--error .code-input-lite__editor[data-v-
|
|
472
|
+
.code-input-lite--error .code-input-lite__editor[data-v-f03d0c9d] {
|
|
474
473
|
outline: 1px solid var(--scalar-color-red);
|
|
475
474
|
}
|
|
476
475
|
|
|
@@ -478,7 +477,7 @@ to {
|
|
|
478
477
|
an atomic widget; the caret lands before or after it, never inside. */
|
|
479
478
|
.scalar-pill {
|
|
480
479
|
color: var(--scalar-color-2);
|
|
481
|
-
border-radius:
|
|
480
|
+
border-radius: var(--scalar-radius-full);
|
|
482
481
|
display: inline-block;
|
|
483
482
|
font-family: var(--scalar-font-code);
|
|
484
483
|
font-size: 0.9em;
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "3.13.
|
|
21
|
+
"version": "3.13.6",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=22"
|
|
24
24
|
},
|
|
@@ -309,15 +309,15 @@
|
|
|
309
309
|
"vue": "^3.5.30",
|
|
310
310
|
"yaml": "^2.8.3",
|
|
311
311
|
"zod": "^4.3.5",
|
|
312
|
-
"@scalar/blocks": "0.1.
|
|
312
|
+
"@scalar/blocks": "0.1.7",
|
|
313
|
+
"@scalar/components": "0.27.8",
|
|
313
314
|
"@scalar/helpers": "0.9.1",
|
|
314
|
-
"@scalar/
|
|
315
|
-
"@scalar/components": "0.27.7",
|
|
316
|
-
"@scalar/oas-utils": "0.19.6",
|
|
317
|
-
"@scalar/sidebar": "0.9.31",
|
|
318
|
-
"@scalar/snippetz": "0.9.22",
|
|
315
|
+
"@scalar/oas-utils": "0.19.7",
|
|
319
316
|
"@scalar/openapi-types": "0.9.2",
|
|
320
|
-
"@scalar/
|
|
317
|
+
"@scalar/sidebar": "0.9.32",
|
|
318
|
+
"@scalar/snippetz": "0.9.22",
|
|
319
|
+
"@scalar/icons": "0.7.4",
|
|
320
|
+
"@scalar/themes": "0.17.0",
|
|
321
321
|
"@scalar/types": "0.16.3",
|
|
322
322
|
"@scalar/use-codemirror": "0.14.13",
|
|
323
323
|
"@scalar/use-hooks": "0.4.8",
|