@sanity/code-input 3.0.0-v3-studio.10 → 3.0.0-v3-studio.11
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/lib/cjs/editorSupport.bbd31eae.js +717 -0
- package/lib/cjs/editorSupport.bbd31eae.js.map +1 -0
- package/lib/cjs/index.js +729 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/esm/editorSupport.739e7d0c.js +714 -0
- package/lib/esm/editorSupport.739e7d0c.js.map +1 -0
- package/lib/esm/index.js +719 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/types/index.d.ts +92 -0
- package/lib/types/index.d.ts.map +1 -0
- package/package.json +10 -15
- package/lib/_editorSupport-6d7655b5.esm.js +0 -2
- package/lib/_editorSupport-6d7655b5.esm.js.map +0 -1
- package/lib/_editorSupport-fc8c2591.js +0 -2
- package/lib/_editorSupport-fc8c2591.js.map +0 -1
- package/lib/index.esm.js +0 -2
- package/lib/index.esm.js.map +0 -1
- package/lib/index.js +0 -2
- package/lib/index.js.map +0 -1
- package/lib/src/index.d.ts +0 -108
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAc,GAAG,AAAC,OAAmB,8CAAmD,CAAC,CAAE,IAAI,CAAC,IAAM,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;;;;ACA9H;ACAA;ACCA;;;;;ACDA;AAGO,MAAM,yCAAmB,GAAG,CAAA,GAAA,UAAG,CAAA,CAAC;;;sBAGjB,EAAE,CAAC,SAAC,KAAK,CAAA,EAAC,GAAK,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;;;;;AAKjF,CAAC;AAEc,kDAAgC,IAAc,EAAa;IACxE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAM,CAAA;YACxB,QAAQ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A;SAAC;KAAC;CAC9B,CAAC","sources":["node_modules/@parcel/runtime-js/lib/runtime-585180c9bcc34854.js","src/index.ts","src/schema.tsx","src/CodeInput.tsx","src/createHighlightMarkers.ts","src/config.ts","src/ace-editor/AceEditorLazy.tsx","src/PreviewCode.tsx","src/getMedia.tsx"],"sourcesContent":["module.exports = (__parcel__import__(\"./\" + \"editorSupport.739e7d0c.js\")).then(() => parcelRequire('f97Qe'));","import {createPlugin} from 'sanity'\n\nimport {codeSchema, codeTypeName, CodeDefinition} from './schema'\nimport PreviewCode, {PreviewCodeProps} from './PreviewCode'\nexport type {CodeInputProps, CodeSchemaType, CodeOptions} from './CodeInput'\n\nexport type {CodeInputLanguage, CodeInputValue} from './types'\n\nexport {PreviewCode, type PreviewCodeProps}\nexport {codeSchema, codeTypeName}\nexport type {CodeDefinition}\n/**\n * @public\n */\nexport const codeInput = createPlugin({\n name: '@sanity/code-input',\n schema: {types: [codeSchema]},\n})\n","import {CodeBlockIcon} from '@sanity/icons'\nimport {CodeInput, CodeOptions} from './CodeInput'\nimport PreviewCode, {PreviewCodeProps} from './PreviewCode'\nimport {getMedia} from './getMedia'\nimport {defineType, ObjectDefinition} from 'sanity'\n\nexport type {CodeInputProps, CodeSchemaType} from './CodeInput'\n\nexport type {CodeInputLanguage, CodeInputValue} from './types'\nexport type {PreviewCode, PreviewCodeProps, CodeInput}\n\n/**\n * @public\n */\nexport const codeTypeName = 'code' as const\n\n/**\n * @public\n */\nexport interface CodeDefinition extends Omit<ObjectDefinition, 'type' | 'fields' | 'options'> {\n type: typeof codeTypeName\n options?: CodeOptions\n}\n\ndeclare module '@sanity/types' {\n // makes type: 'code' narrow correctly when using defineType/defineField/defineArrayMember\n export interface IntrinsicDefinitions {\n code: CodeDefinition\n }\n}\n\n/**\n * @public\n */\nexport const codeSchema = defineType({\n name: 'code',\n type: 'object',\n title: 'Code',\n components: {input: CodeInput, preview: PreviewCode},\n icon: CodeBlockIcon,\n fields: [\n {\n name: 'language',\n title: 'Language',\n type: 'string',\n },\n {\n name: 'filename',\n title: 'Filename',\n type: 'string',\n },\n {\n title: 'Code',\n name: 'code',\n type: 'text',\n },\n {\n title: 'Highlighted lines',\n name: 'highlightedLines',\n type: 'array',\n of: [\n {\n type: 'number',\n title: 'Highlighted line',\n },\n ],\n },\n ],\n preview: {\n select: {\n language: 'language',\n code: 'code',\n filename: 'filename',\n highlightedLines: 'highlightedLines',\n },\n prepare: (value: {\n language?: string\n code?: string\n filename?: string\n highlightedLines?: number[]\n }) => {\n return {\n title: value.filename || (value.language || 'unknown').toUpperCase(),\n media: getMedia(value?.language),\n selection: value,\n }\n },\n },\n})\n","/* eslint-disable react/jsx-handler-names */\nimport React, {Suspense, useCallback, useEffect, useImperativeHandle, useMemo, useRef} from 'react'\nimport {\n InputProps,\n ObjectSchemaType,\n StringInputProps,\n useColorScheme,\n FieldMember,\n MemberField,\n ObjectInputProps,\n set,\n setIfMissing,\n unset,\n} from 'sanity'\nimport {Card, Select, Stack, ThemeColorSchemeKey} from '@sanity/ui'\nimport styled from 'styled-components'\nimport createHighlightMarkers, {highlightMarkersCSS} from './createHighlightMarkers'\nimport {CodeInputLanguage, CodeInputValue} from './types'\nimport {\n ACE_EDITOR_PROPS,\n ACE_SET_OPTIONS,\n DEFAULT_DARK_THEME,\n DEFAULT_THEME,\n LANGUAGE_ALIASES,\n PATH_CODE,\n SUPPORTED_LANGUAGES,\n SUPPORTED_THEMES,\n} from './config'\nimport {useAceEditor} from './ace-editor/AceEditorLazy'\n\nexport type {CodeInputLanguage, CodeInputValue} from './types'\n\nconst EditorContainer = styled(Card)`\n position: relative;\n box-sizing: border-box;\n overflow: hidden;\n z-index: 0;\n\n .ace_editor {\n font-family: ${({theme}) => theme.sanity.fonts.code.family};\n font-size: ${({theme}) => theme.sanity.fonts.code.sizes[1]};\n line-height: inherit;\n }\n\n ${highlightMarkersCSS}\n\n &:not([disabled]):not([readonly]) {\n &:focus,\n &:focus-within {\n box-shadow: 0 0 0 2px ${({theme}) => theme.sanity.color.base.focusRing};\n background-color: ${({theme}) => theme.sanity.color.base.bg};\n border-color: ${({theme}) => theme.sanity.color.base.focusRing};\n }\n }\n`\n\n/**\n * @public\n */\nexport interface CodeOptions {\n theme?: string\n darkTheme?: string\n languageAlternatives?: CodeInputLanguage[]\n language?: string\n withFilename?: boolean\n}\n\n/**\n * @public\n */\nexport type CodeSchemaType = Omit<ObjectSchemaType, 'options'> & {\n options?: CodeOptions\n}\n\n/**\n * @public\n */\nexport type CodeInputProps = ObjectInputProps<CodeInputValue, CodeSchemaType> & {\n /** @internal */\n colorScheme?: ThemeColorSchemeKey\n}\n\n// Returns a string with the mode name if supported (because aliases), otherwise false\nfunction isSupportedLanguage(mode: string) {\n const alias = LANGUAGE_ALIASES[mode]\n\n if (alias) {\n return alias\n }\n\n const isSupported = SUPPORTED_LANGUAGES.find((lang) => lang.value === mode)\n if (isSupported) {\n return mode\n }\n\n return false\n}\n\nexport function CodeInput(props: CodeInputProps) {\n const {\n members,\n elementProps,\n onChange,\n onFocusPath,\n readOnly,\n renderField,\n renderInput,\n renderItem,\n renderPreview,\n schemaType: type,\n value,\n } = props\n\n const aceEditorRef = useRef<any>()\n\n const fieldMembers = useMemo(\n () => members.filter((member) => member.kind === 'field') as FieldMember[],\n [members]\n )\n\n const languageFieldMember = fieldMembers.find((member) => member.name === 'language')\n const filenameMember = fieldMembers.find((member) => member.name === 'filename')\n const codeFieldMember = fieldMembers.find((member) => member.name === 'code')\n\n useImperativeHandle(elementProps.ref, () => ({\n focus: () => {\n aceEditorRef?.current?.editor?.focus()\n },\n }))\n\n const handleCodeFocus = useCallback(() => {\n onFocusPath(PATH_CODE)\n }, [onFocusPath])\n\n const {scheme} = useColorScheme()\n\n const theme = useMemo(() => {\n const isLight = scheme === 'light'\n const preferredTheme = isLight ? type.options?.theme : type.options?.darkTheme\n const defaultTheme = isLight ? DEFAULT_THEME : DEFAULT_DARK_THEME\n return preferredTheme && SUPPORTED_THEMES.find((t) => t === preferredTheme)\n ? preferredTheme\n : defaultTheme\n }, [type, scheme])\n\n const handleToggleSelectLine = useCallback(\n (lineNumber: number) => {\n const editorSession = aceEditorRef.current?.editor?.getSession()\n const backgroundMarkers = editorSession?.getMarkers(true)\n const currentHighlightedLines = Object.keys(backgroundMarkers)\n .filter((key) => backgroundMarkers[key].type === 'screenLine')\n .map((key) => backgroundMarkers[key].range.start.row)\n const currentIndex = currentHighlightedLines.indexOf(lineNumber)\n if (currentIndex > -1) {\n // toggle remove\n currentHighlightedLines.splice(currentIndex, 1)\n } else {\n // toggle add\n currentHighlightedLines.push(lineNumber)\n currentHighlightedLines.sort()\n }\n onChange(\n set(\n currentHighlightedLines.map(\n (line) =>\n // ace starts at line (row) 0, but we store it starting at line 1\n line + 1\n ),\n ['highlightedLines']\n )\n )\n },\n [aceEditorRef, onChange]\n )\n\n const handleGutterMouseDown = useCallback(\n (event: any) => {\n const target = event.domEvent.target\n if (target.classList.contains('ace_gutter-cell')) {\n const row = event.getDocumentPosition().row\n handleToggleSelectLine(row)\n }\n },\n [handleToggleSelectLine]\n )\n\n useEffect(() => {\n const editor = aceEditorRef?.current?.editor\n return () => {\n editor?.session?.removeListener('guttermousedown', handleGutterMouseDown)\n }\n }, [aceEditorRef, handleGutterMouseDown])\n\n const handleEditorLoad = useCallback(\n (editor: any) => {\n editor?.on('guttermousedown', handleGutterMouseDown)\n },\n [handleGutterMouseDown]\n )\n\n const getLanguageAlternatives = useCallback((): {\n title: string\n value: string\n mode?: string\n }[] => {\n const languageAlternatives = type.options?.languageAlternatives\n if (!languageAlternatives) {\n return SUPPORTED_LANGUAGES\n }\n\n if (!Array.isArray(languageAlternatives)) {\n throw new Error(\n `'options.languageAlternatives' should be an array, got ${typeof languageAlternatives}`\n )\n }\n\n return languageAlternatives.reduce((acc: CodeInputLanguage[], {title, value: val, mode}) => {\n const alias = LANGUAGE_ALIASES[val]\n if (alias) {\n // eslint-disable-next-line no-console\n console.warn(\n `'options.languageAlternatives' lists a language with value \"%s\", which is an alias of \"%s\" - please replace the value to read \"%s\"`,\n val,\n alias,\n alias\n )\n\n return acc.concat({title, value: alias, mode: mode})\n }\n\n if (!mode && !SUPPORTED_LANGUAGES.find((lang) => lang.value === val)) {\n // eslint-disable-next-line no-console\n console.warn(\n `'options.languageAlternatives' lists a language which is not supported: \"%s\", syntax highlighting will be disabled.`,\n val\n )\n }\n\n return acc.concat({title, value: val, mode})\n }, [])\n }, [type])\n\n const handleCodeChange = useCallback(\n (code: string) => {\n const path = PATH_CODE\n const fixedLanguage = type.options?.language\n\n onChange([\n setIfMissing({_type: type.name, language: fixedLanguage}),\n code ? set(code, path) : unset(path),\n ])\n },\n [onChange, type]\n )\n\n const languages = getLanguageAlternatives().slice()\n\n const fixedLanguage = type.options?.language\n\n const language = value?.language || fixedLanguage\n\n // the language config from the schema\n const configured = languages.find((entry) => entry.value === language)\n\n // is the language officially supported (e.g. we import the mode by default)\n const supported = language && isSupportedLanguage(language)\n\n const mode = configured?.mode || (supported ? language : 'text')\n\n const renderLanguageInput = useCallback(\n (inputProps: Omit<InputProps, 'renderDefault'>) => {\n return (\n <Select\n {...(inputProps as StringInputProps)}\n onChange={(e) => {\n const newValue = e.currentTarget.value\n inputProps.onChange(newValue ? set(newValue) : unset())\n }}\n >\n {languages.map((lang: {title: string; value: string}) => (\n <option key={lang.value} value={lang.value}>\n {lang.title}\n </option>\n ))}\n </Select>\n )\n },\n [languages]\n )\n\n const AceEditor = useAceEditor()\n\n const renderCodeInput = useCallback(\n (inputProps) => {\n return (\n <EditorContainer radius={1} shadow={1} readOnly={readOnly}>\n {AceEditor && (\n <Suspense fallback={<div>Loading code editor...</div>}>\n <AceEditor\n ref={aceEditorRef}\n mode={mode}\n theme={theme}\n width=\"100%\"\n onChange={handleCodeChange}\n name={inputProps.id}\n value={inputProps.value}\n markers={\n value && value.highlightedLines\n ? createHighlightMarkers(value.highlightedLines)\n : undefined\n }\n onLoad={handleEditorLoad}\n readOnly={readOnly}\n tabSize={2}\n wrapEnabled\n setOptions={ACE_SET_OPTIONS}\n editorProps={ACE_EDITOR_PROPS}\n onFocus={handleCodeFocus}\n onBlur={elementProps.onBlur}\n />\n </Suspense>\n )}\n </EditorContainer>\n )\n },\n [\n AceEditor,\n theme,\n handleCodeChange,\n handleCodeFocus,\n handleEditorLoad,\n mode,\n elementProps.onBlur,\n readOnly,\n value,\n ]\n )\n\n return (\n <Stack space={4}>\n {languageFieldMember && (\n <MemberField\n member={languageFieldMember}\n renderItem={renderItem}\n renderField={renderField}\n renderInput={renderLanguageInput}\n renderPreview={renderPreview}\n />\n )}\n\n {type.options?.withFilename && filenameMember && (\n <MemberField\n member={filenameMember}\n renderItem={renderItem}\n renderField={renderField}\n renderInput={renderInput}\n renderPreview={renderPreview}\n />\n )}\n\n {codeFieldMember && (\n <MemberField\n member={codeFieldMember}\n renderInput={renderCodeInput}\n renderItem={renderItem}\n renderField={renderField}\n renderPreview={renderPreview}\n />\n )}\n </Stack>\n )\n}\n","import type {IMarker} from 'react-ace'\nimport {css} from 'styled-components'\n\nexport const highlightMarkersCSS = css`\n .ace_editor_markers_highlight {\n position: absolute;\n background-color: ${({theme}) => theme.sanity.color.solid.primary.enabled.bg};\n opacity: 0.2;\n width: 100% !important;\n border-radius: 0 !important;\n }\n`\n\nexport default function createHighlightMarkers(rows: number[]): IMarker[] {\n return rows.map((row) => ({\n startRow: Number(row) - 1,\n startCol: 0,\n endRow: Number(row) - 1,\n endCol: +Infinity,\n className: 'ace_editor_markers_highlight',\n type: 'screenLine',\n inFront: true,\n }))\n}\n","import {CodeInputLanguage} from './types'\n\n// NOTE: MAKE SURE THESE ALIGN WITH IMPORTS IN ./ace-editor/editorSupport\nexport const SUPPORTED_LANGUAGES: CodeInputLanguage[] = [\n {title: 'Batch file', value: 'batchfile'},\n {title: 'C#', value: 'csharp'},\n {title: 'CSS', value: 'css'},\n {title: 'Go', value: 'golang'},\n {title: 'GROQ', value: 'groq'},\n {title: 'HTML', value: 'html'},\n {title: 'Java', value: 'java'},\n {title: 'JavaScript', value: 'javascript'},\n {title: 'JSON', value: 'json'},\n {title: 'JSX', value: 'jsx'},\n {title: 'Markdown', value: 'markdown'},\n {title: 'MySQL', value: 'mysql'},\n {title: 'PHP', value: 'php'},\n {title: 'Plain text', value: 'text'},\n {title: 'Python', value: 'python'},\n {title: 'Ruby', value: 'ruby'},\n {title: 'SASS', value: 'sass'},\n {title: 'SCSS', value: 'scss'},\n {title: 'sh', value: 'sh'},\n {title: 'TSX', value: 'tsx'},\n {title: 'TypeScript', value: 'typescript'},\n {title: 'XML', value: 'xml'},\n {title: 'YAML', value: 'yaml'},\n]\n\nexport const LANGUAGE_ALIASES: Record<string, string | undefined> = {js: 'javascript'}\n\nexport const SUPPORTED_THEMES = ['github', 'monokai', 'terminal', 'tomorrow']\n\nexport const DEFAULT_THEME = 'tomorrow'\nexport const DEFAULT_DARK_THEME = 'monokai'\n\nexport const ACE_SET_OPTIONS = {\n useSoftTabs: true,\n navigateWithinSoftTabs: true /* note only supported by ace v1.2.7 or higher */,\n}\n\nexport const ACE_EDITOR_PROPS = {$blockScrolling: true}\n\nexport const PATH_LANGUAGE = ['language']\nexport const PATH_CODE = ['code']\nexport const PATH_FILENAME = ['filename']\n","import React, {useEffect, useState} from 'react'\n\n/**\n * AceEditor loads window global directly when imported, which crashes in node envs.\n * This works around the issue by only importing ace-dependencies when window is defined.\n *\n * We only set the ace lazy component after mounting, to allow us to render null on the server,\n * and use suspense on the client. This will make hydration work correctly.\n */\nexport const AceEditorLazy = React.lazy(() => import('./editorSupport'))\n\nexport function useAceEditor() {\n const [mounted, setMounted] = useState(false)\n useEffect(() => {\n requestAnimationFrame(() => setMounted(true))\n }, [])\n\n return mounted ? AceEditorLazy : null\n}\n","import React, {Suspense, useCallback, useEffect, useRef} from 'react'\nimport styled from 'styled-components'\nimport {Box} from '@sanity/ui'\nimport {ACE_EDITOR_PROPS, ACE_SET_OPTIONS} from './config'\nimport createHighlightMarkers from './createHighlightMarkers'\nimport {CodeInputValue} from './types'\nimport {useAceEditor} from './ace-editor/AceEditorLazy'\nimport {CodeSchemaType} from './CodeInput'\n\nconst PreviewContainer = styled(Box)`\n position: relative;\n`\n\nconst PreviewInner = styled(Box)`\n background-color: #272822;\n\n .ace_editor {\n box-sizing: border-box;\n cursor: default;\n pointer-events: none;\n }\n\n .ace_content {\n box-sizing: border-box;\n overflow: hidden;\n }\n`\n\n/**\n * @public\n */\nexport interface PreviewCodeProps {\n type?: CodeSchemaType\n value?: {selection?: CodeInputValue}\n}\n\n/**\n * @public\n */\nexport default function PreviewCode(props: PreviewCodeProps) {\n const aceEditorRef = useRef<any>()\n\n useEffect(() => {\n if (!aceEditorRef?.current) return\n\n const editor = aceEditorRef.current?.editor\n\n if (editor) {\n // Avoid cursor and focus tracking by Ace\n editor.renderer.$cursorLayer.element.style.opacity = 0\n editor.textInput.getElement().disabled = true\n }\n }, [])\n\n const handleEditorChange = useCallback(() => {\n // do nothing when the editor changes\n }, [])\n\n const {value, type} = props\n const fixedLanguage = type?.options?.language\n\n const selection = value?.selection\n const mode = selection?.language || fixedLanguage || 'text'\n\n const AceEditor = useAceEditor()\n return (\n <PreviewContainer>\n <PreviewInner padding={4}>\n {AceEditor && (\n <Suspense fallback={<div>Loading code preview...</div>}>\n <AceEditor\n ref={aceEditorRef}\n focus={false}\n mode={mode}\n theme=\"monokai\"\n width=\"100%\"\n onChange={handleEditorChange}\n maxLines={200}\n readOnly\n wrapEnabled\n showPrintMargin={false}\n highlightActiveLine={false}\n cursorStart={-1}\n value={selection?.code || ''}\n markers={\n selection?.highlightedLines\n ? createHighlightMarkers(selection.highlightedLines)\n : undefined\n }\n tabSize={2}\n showGutter={false}\n setOptions={ACE_SET_OPTIONS}\n editorProps={ACE_EDITOR_PROPS}\n />\n </Suspense>\n )}\n </PreviewInner>\n </PreviewContainer>\n )\n}\n","import React from 'react'\n\nexport function getMedia(language?: string) {\n if (language === 'jsx') {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewB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5.6 2.3 1 4.5 1.4 6.6zm9-15.6c-2 .8-4.2 1.5-6.4 2.1-1.6-5-3.6-10.3-6-15.6 2.4-5.3 4.5-10.5 6-15.5 13.8 4 22.1 10 22.1 15.6 0 4.7-5.8 9.7-15.7 13.4z\" />\n </g>\n </svg>\n )\n }\n\n if (language === 'javascript') {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128 128\">\n <path fill=\"#F0DB4F\" d=\"M1.408 1.408h125.184v125.185H1.408z\" />\n <path\n fill=\"#323330\"\n d=\"M116.347 96.736c-.917-5.711-4.641-10.508-15.672-14.981-3.832-1.761-8.104-3.022-9.377-5.926-.452-1.69-.512-2.642-.226-3.665.821-3.32 4.784-4.355 7.925-3.403 2.023.678 3.938 2.237 5.093 4.724 5.402-3.498 5.391-3.475 9.163-5.879-1.381-2.141-2.118-3.129-3.022-4.045-3.249-3.629-7.676-5.498-14.756-5.355l-3.688.477c-3.534.893-6.902 2.748-8.877 5.235-5.926 6.724-4.236 18.492 2.975 23.335 7.104 5.332 17.54 6.545 18.873 11.531 1.297 6.104-4.486 8.08-10.234 7.378-4.236-.881-6.592-3.034-9.139-6.949-4.688 2.713-4.688 2.713-9.508 5.485 1.143 2.499 2.344 3.63 4.26 5.795 9.068 9.198 31.76 8.746 35.83-5.176.165-.478 1.261-3.666.38-8.581zM69.462 58.943H57.753l-.048 30.272c0 6.438.333 12.34-.714 14.149-1.713 3.558-6.152 3.117-8.175 2.427-2.059-1.012-3.106-2.451-4.319-4.485-.333-.584-.583-1.036-.667-1.071l-9.52 5.83c1.583 3.249 3.915 6.069 6.902 7.901 4.462 2.678 10.459 3.499 16.731 2.059 4.082-1.189 7.604-3.652 9.448-7.401 2.666-4.915 2.094-10.864 2.07-17.444.06-10.735.001-21.468.001-32.237z\"\n />\n </svg>\n )\n }\n\n if (language === 'php') {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 800 400\">\n <g transform=\"translate(-44.632 -141.55)\">\n <g transform=\"matrix(8.3528 0 0 8.3119 -727.13 -3759.5)\">\n <path d=\"m99.974 479.48h14.204c4.1693 0.0354 7.1903 1.2367 9.063 3.604 1.8726 2.3674 2.491 5.6004 1.855 9.699-0.24737 1.8727-0.79504 3.71-1.643 5.512-0.8127 1.802-1.9434 3.4273-3.392 4.876-1.7667 1.8373-3.657 3.0033-5.671 3.498-2.014 0.49467-4.0987 0.742-6.254 0.742h-6.36l-2.014 10.07h-7.367l7.579-38.001m6.201 6.042-3.18 15.9c0.21198 0.0353 0.42398 0.053 0.636 0.053h0.742c3.392 0.0353 6.2186-0.30033 8.48-1.007 2.2613-0.74199 3.7806-3.3213 4.558-7.738 0.63597-3.71-0.00003-5.8476-1.908-6.413-1.8727-0.56531-4.2224-0.83031-7.049-0.795-0.42402 0.0353-0.83035 0.053-1.219 0.053-0.35335 0.00002-0.72435 0.00002-1.113 0l0.053-0.053\" />\n <path d=\"m133.49 469.36h7.314l-2.067 10.123h6.572c3.604 0.0707 6.2893 0.81269 8.056 2.226 1.802 1.4134 2.332 4.0987 1.59 8.056l-3.551 17.649h-7.42l3.392-16.854c0.35328-1.7666 0.2473-3.021-0.318-3.763-0.56536-0.74198-1.7844-1.113-3.657-1.113l-5.883-0.053-4.346 21.783h-7.314l7.632-38.054\" />\n <path d=\"m162.81 479.48h14.204c4.1693 0.0354 7.1903 1.2367 9.063 3.604 1.8726 2.3674 2.491 5.6004 1.855 9.699-0.24737 1.8727-0.79503 3.71-1.643 5.512-0.8127 1.802-1.9434 3.4273-3.392 4.876-1.7667 1.8373-3.657 3.0033-5.671 3.498-2.014 0.49467-4.0987 0.742-6.254 0.742h-6.36l-2.014 10.07h-7.367l7.579-38.001m6.201 6.042-3.18 15.9c0.21199 0.0353 0.42399 0.053 0.636 0.053h0.742c3.392 0.0353 6.2186-0.30033 8.48-1.007 2.2613-0.74199 3.7806-3.3213 4.558-7.738 0.63597-3.71-0.00003-5.8476-1.908-6.413-1.8727-0.56531-4.2224-0.83031-7.049-0.795-0.42402 0.0353-0.83035 0.053-1.219 0.053-0.35335 0.00002-0.72435 0.00002-1.113 0l0.053-0.053\" />\n </g>\n </g>\n </svg>\n )\n }\n\n if (language === 'json') {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 0 160 160\"\n >\n <defs>\n <linearGradient id=\"a\">\n <stop offset=\"0\" />\n <stop offset=\"1\" stopColor=\"#fff\" />\n </linearGradient>\n <linearGradient\n x1=\"-553.27\"\n y1=\"525.908\"\n x2=\"-666.116\"\n y2=\"413.045\"\n id=\"c\"\n xlinkHref=\"#a\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(.99884 0 0 .9987 689.008 -388.844)\"\n />\n <linearGradient\n x1=\"-666.117\"\n y1=\"413.045\"\n x2=\"-553.27\"\n y2=\"525.908\"\n id=\"b\"\n xlinkHref=\"#a\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(.99884 0 0 .9987 689.008 -388.844)\"\n />\n </defs>\n <path\n d=\"M79.865 119.1c35.397 48.255 70.04-13.469 69.988-50.587-.06-43.886-44.54-68.414-70.017-68.414C38.943.1 0 33.895 0 80.135 0 131.531 44.64 160 79.836 160c-7.965-1.147-34.507-6.834-34.863-67.967-.24-41.346 13.487-57.865 34.805-50.599.477.177 23.514 9.265 23.514 38.95 0 29.56-23.427 38.716-23.427 38.716z\"\n style={{marker: 'none'}}\n color=\"#000\"\n fill=\"url(#b)\"\n fillRule=\"evenodd\"\n overflow=\"visible\"\n />\n <path\n d=\"M79.823 41.4C56.433 33.34 27.78 52.618 27.78 91.23c0 63.048 46.72 68.77 52.384 68.77C121.057 160 160 126.204 160 79.964 160 28.568 115.36.1 80.164.1c9.749-1.35 52.541 10.55 52.541 69.037 0 38.141-31.953 58.905-52.735 50.033-.478-.177-23.514-9.264-23.514-38.95 0-29.56 23.367-38.818 23.367-38.818z\"\n style={{marker: 'none'}}\n color=\"#000\"\n fill=\"url(#c)\"\n fillRule=\"evenodd\"\n overflow=\"visible\"\n />\n </svg>\n )\n }\n\n return undefined\n}\n"],"names":[],"version":3,"file":"index.js.map","sourceRoot":"../../"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ObjectSchemaType, ObjectInputProps, ObjectDefinition } from "sanity";
|
|
2
|
+
import { ThemeColorSchemeKey } from "@sanity/ui";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface CodeInputLanguage {
|
|
7
|
+
title: string;
|
|
8
|
+
value: string;
|
|
9
|
+
mode?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export interface CodeInputValue {
|
|
15
|
+
_type?: 'code';
|
|
16
|
+
code?: string;
|
|
17
|
+
filename?: string;
|
|
18
|
+
language?: string;
|
|
19
|
+
highlightedLines?: number[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export interface CodeOptions {
|
|
25
|
+
theme?: string;
|
|
26
|
+
darkTheme?: string;
|
|
27
|
+
languageAlternatives?: CodeInputLanguage[];
|
|
28
|
+
language?: string;
|
|
29
|
+
withFilename?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export type CodeSchemaType = Omit<ObjectSchemaType, 'options'> & {
|
|
35
|
+
options?: CodeOptions;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export type CodeInputProps = ObjectInputProps<CodeInputValue, CodeSchemaType> & {
|
|
41
|
+
/** @internal */
|
|
42
|
+
colorScheme?: ThemeColorSchemeKey;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
export interface PreviewCodeProps {
|
|
48
|
+
type?: CodeSchemaType;
|
|
49
|
+
value?: {
|
|
50
|
+
selection?: CodeInputValue;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
export function PreviewCode(props: PreviewCodeProps): JSX.Element;
|
|
57
|
+
/**
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
export const codeTypeName: "code";
|
|
61
|
+
/**
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
export interface CodeDefinition extends Omit<ObjectDefinition, 'type' | 'fields' | 'options'> {
|
|
65
|
+
type: typeof codeTypeName;
|
|
66
|
+
options?: CodeOptions;
|
|
67
|
+
}
|
|
68
|
+
declare module '@sanity/types' {
|
|
69
|
+
interface IntrinsicDefinitions {
|
|
70
|
+
code: CodeDefinition;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @public
|
|
75
|
+
*/
|
|
76
|
+
export const codeSchema: {
|
|
77
|
+
type: "object";
|
|
78
|
+
name: "code";
|
|
79
|
+
} & Omit<ObjectDefinition, "preview"> & {
|
|
80
|
+
preview?: import("sanity").PreviewConfig<{
|
|
81
|
+
language: string;
|
|
82
|
+
code: string;
|
|
83
|
+
filename: string;
|
|
84
|
+
highlightedLines: string;
|
|
85
|
+
}, Record<"code" | "language" | "filename" | "highlightedLines", any>> | undefined;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
export const codeInput: import("sanity").Plugin<void>;
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;ACAA;;GAEG;AACH;IACE,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH;IACE,KAAK,CAAC,EAAE,MA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src/createHighlightMarkers.ts","src/src/types.ts","src/src/config.ts","src/src/ace-editor/groq.ts","src/src/ace-editor/editorSupport.ts","src/src/ace-editor/AceEditorLazy.tsx","src/src/CodeInput.tsx","src/src/PreviewCode.tsx","src/src/getMedia.tsx","src/src/schema.tsx","src/src/index.ts","src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,"import {createPlugin} from 'sanity'\n\nimport {codeSchema, codeTypeName, CodeDefinition} from './schema'\nimport PreviewCode, {PreviewCodeProps} from './PreviewCode'\nexport type {CodeInputProps, CodeSchemaType, CodeOptions} from './CodeInput'\n\nexport type {CodeInputLanguage, CodeInputValue} from './types'\n\nexport {PreviewCode, type PreviewCodeProps}\nexport {codeSchema, codeTypeName}\nexport type {CodeDefinition}\n/**\n * @public\n */\nexport const codeInput = createPlugin({\n name: '@sanity/code-input',\n schema: {types: [codeSchema]},\n})\n"],"names":[],"version":3,"file":"index.d.ts.map","sourceRoot":"../../"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/code-input",
|
|
3
|
-
"version": "3.0.0-v3-studio.
|
|
3
|
+
"version": "3.0.0-v3-studio.11",
|
|
4
4
|
"description": "Ace editor for editing code",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"import": "./lib/index.esm.js",
|
|
11
|
-
"require": "./lib/index.js",
|
|
12
|
-
"default": "./lib/index.esm.js"
|
|
8
|
+
"require": "./lib/cjs/index.js",
|
|
9
|
+
"default": "./lib/esm/index.js"
|
|
13
10
|
}
|
|
14
11
|
},
|
|
15
|
-
"main": "./lib/index.js",
|
|
16
|
-
"module": "./lib/index.
|
|
17
|
-
"types": "./lib/
|
|
12
|
+
"main": "./lib/cjs/index.js",
|
|
13
|
+
"module": "./lib/esm/index.js",
|
|
14
|
+
"types": "./lib/types/index.d.ts",
|
|
18
15
|
"files": [
|
|
19
16
|
"src",
|
|
20
17
|
"lib",
|
|
@@ -25,10 +22,10 @@
|
|
|
25
22
|
"license": "MIT",
|
|
26
23
|
"scripts": {
|
|
27
24
|
"clean": "rimraf lib",
|
|
28
|
-
"prebuild": "npm run clean && plugin-kit verify-package --silent
|
|
29
|
-
"build": "
|
|
30
|
-
"watch": "pkg-utils watch",
|
|
25
|
+
"prebuild": "npm run clean && plugin-kit verify-package --silent",
|
|
26
|
+
"build": "parcel build --no-cache",
|
|
31
27
|
"link-watch": "plugin-kit link-watch",
|
|
28
|
+
"watch": "parcel watch",
|
|
32
29
|
"prepublishOnly": "npm run build",
|
|
33
30
|
"compile": "tsc --noEmit",
|
|
34
31
|
"lint": "eslint .",
|
|
@@ -61,7 +58,6 @@
|
|
|
61
58
|
"@parcel/packager-ts": "2.6.2",
|
|
62
59
|
"@parcel/transformer-typescript-types": "2.6.2",
|
|
63
60
|
"@sanity/plugin-kit": "^1.1.0-ecosystem-preset.5",
|
|
64
|
-
"@sanity/pkg-utils": "^1.11.0",
|
|
65
61
|
"@sanity/semantic-release-preset": "^2.0.1",
|
|
66
62
|
"@testing-library/jest-dom": "^5.16.5",
|
|
67
63
|
"@testing-library/react": "^13.4.0",
|
|
@@ -109,8 +105,7 @@
|
|
|
109
105
|
},
|
|
110
106
|
"sanityPlugin": {
|
|
111
107
|
"verifyPackage": {
|
|
112
|
-
"babelConfig": false
|
|
113
|
-
"scripts": false
|
|
108
|
+
"babelConfig": false
|
|
114
109
|
}
|
|
115
110
|
}
|
|
116
111
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import e from"react-ace";export{default}from"react-ace";import"ace-builds/src-noconflict/mode-batchfile";import"ace-builds/src-noconflict/mode-csharp";import"ace-builds/src-noconflict/mode-css";import"ace-builds/src-noconflict/mode-golang";import"ace-builds/src-noconflict/mode-html";import"ace-builds/src-noconflict/mode-java";import"ace-builds/src-noconflict/mode-javascript";import"ace-builds/src-noconflict/mode-json";import"ace-builds/src-noconflict/mode-jsx";import"ace-builds/src-noconflict/mode-markdown";import"ace-builds/src-noconflict/mode-mysql";import"ace-builds/src-noconflict/mode-php";import"ace-builds/src-noconflict/mode-python";import"ace-builds/src-noconflict/mode-ruby";import"ace-builds/src-noconflict/mode-sass";import"ace-builds/src-noconflict/mode-scss";import"ace-builds/src-noconflict/mode-sh";import"ace-builds/src-noconflict/mode-text";import"ace-builds/src-noconflict/mode-tsx";import"ace-builds/src-noconflict/mode-typescript";import"ace-builds/src-noconflict/mode-xml";import"ace-builds/src-noconflict/mode-yaml";import"ace-builds/src-noconflict/theme-github";import"ace-builds/src-noconflict/theme-monokai";import"ace-builds/src-noconflict/theme-terminal";import"ace-builds/src-noconflict/theme-tomorrow";const o={start:[{include:"#query"},{include:"#value"},{include:"#pair"}],"#query":[{include:"#nullary-access-operator"},{include:"#arraylike"},{include:"#pipe"},{include:"#sort-order"},{include:"#filter"}],"#variable":[{token:"variable.other.groq",regex:/\$[_A-Za-z][_0-9A-Za-z]*/}],"#keyword":[{token:"keyword.other.groq",regex:/\b(?:asc|desc|in|match)\b/}],"#comparison":[{token:"keyword.operator.comparison.groq",regex:/==|!=|>=|<=|<!=>|<|>/}],"#operator":[{token:"keyword.operator.arithmetic.groq",regex:/\+|-|\*{1,2}|\/|%/}],"#pipe":[{token:"keyword.operator.pipe.groq",regex:/\|/}],"#logical":[{token:"keyword.operator.logical.groq",regex:/!|&&|\|\|/}],"#reference":[{token:"keyword.operator.reference.groq",regex:/->/}],"#pair":[{include:"#identifier"},{include:"#value"},{include:"#filter"},{token:"keyword.operator.pair.groq",regex:/[=]>/}],"#arraylike":[{token:"punctuation.definition.bracket.begin.groq",regex:/\[/,push:[{token:["text","keyword.operator.descendant.groq"],regex:/(\])((?:\s*\.)?)/,next:"pop"},{include:"#range"},{include:"#filter"},{include:"#array-values"}]}],"#array":[{token:"punctuation.definition.bracket.begin.groq",regex:/\[/,push:[{token:"punctuation.definition.bracket.end.groq",regex:/\]/,next:"pop"},{include:"#array-values"},{defaultToken:"meta.structure.array.groq"}]}],"#range":[{token:["meta.structure.range.groq","constant.numeric.groq","meta.structure.range.groq","keyword.operator.range.groq","meta.structure.range.groq","constant.numeric.groq","meta.structure.range.groq"],regex:/(\s*)(\d+)(\s*)(\.{2,3})(\s*)(\d+)(\s*)/}],"#spread":[{token:"punctuation.definition.spread.begin.groq",regex:/\.\.\./,push:[{include:"#array"},{include:"#function-call"},{include:"#projection"},{token:"punctuation.definition.spread.end.groq",regex:/(?=.)/,next:"pop"},{defaultToken:"meta.structure.spread.groq"}]}],"#array-values":[{include:"#value"},{include:"#spread"},{token:"punctuation.separator.array.groq",regex:/,/},{token:"invalid.illegal.expected-array-separator.groq",regex:/[^\s\]]/}],"#filter":[{include:"#function-call"},{include:"#keyword"},{include:"#constant"},{include:"#identifier"},{include:"#value"},{include:"#comparison"},{include:"#operator"},{include:"#logical"}],"#comments":[{token:["punctuation.definition.comment.groq","comment.line.double-slash.js"],regex:/(\/\/)(.*$)/}],"#nullary-access-operator":[{token:"constant.language.groq",regex:/[*@^]/}],"#constant":[{token:"constant.language.groq",regex:/\b(?:true|false|null)\b/}],"#number":[{token:"constant.numeric.groq",regex:/-?(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:[eE][+-]?\d+)?)?/}],"#named-projection":[{include:"#identifier"},{include:"#objectkey"},{include:"#projection"}],"#projection":[{token:"punctuation.definition.projection.begin.groq",regex:/\{/,push:[{token:"punctuation.definition.projection.end.groq",regex:/\}/,next:"pop"},{include:"#identifier"},{include:"#objectkey"},{include:"#named-projection"},{include:"#comments"},{include:"#spread"},{include:"#pair"},{token:"punctuation.separator.projection.key-value.groq",regex:/:/,push:[{token:"punctuation.separator.projection.pair.groq",regex:/,|(?=\})/,next:"pop"},{include:"#nullary-access-operator"},{include:"#arraylike"},{include:"#value"},{include:"#spread"},{include:"#identifier"},{include:"#operator"},{include:"#comparison"},{include:"#pair"},{token:"invalid.illegal.expected-projection-separator.groq",regex:/[^\s,]/},{defaultToken:"meta.structure.projection.value.groq"}]},{token:"invalid.illegal.expected-projection-separator.groq",regex:/[^\s},]/},{defaultToken:"meta.structure.projection.groq"}]}],"#string":[{include:"#single-string"},{include:"#double-string"}],"#double-string":[{token:"punctuation.definition.string.begin.groq",regex:/"/,push:[{token:"punctuation.definition.string.end.groq",regex:/"/,next:"pop"},{include:"#stringcontent"},{defaultToken:"string.quoted.double.groq"}]}],"#single-string":[{token:"punctuation.definition.string.single.begin.groq",regex:/'/,push:[{token:"punctuation.definition.string.single.end.groq",regex:/'/,next:"pop"},{include:"#stringcontent"},{defaultToken:"string.quoted.single.groq"}]}],"#objectkey":[{include:"#string"}],"#stringcontent":[{token:"constant.character.escape.groq",regex:/\\(?:["\\/bfnrt]|u[0-9a-fA-F]{4})/},{token:"invalid.illegal.unrecognized-string-escape.groq",regex:/\\./}],"#sort-pair":[{token:["variable.other.readwrite.groq","text","keyword.other.groq"],regex:/([_A-Za-z][_0-9A-Za-z]*)(?:(\s*)(asc|desc))?/},{token:["constant.language.groq","punctuation.definition.bracket.begin.groq"],regex:/(@)(\[)/,push:[{token:["punctuation.definition.bracket.begin.groq","text","keyword.other.groq"],regex:/(\])(?:(\s*)(asc|desc))?/,next:"pop"},{include:"#string"}]}],"#sort-order":[{token:"support.function.sortorder.begin.groq",regex:/\border\s*\(/,push:[{token:"support.function.sortorder.end.groq",regex:/\)/,next:"pop"},{include:"#sort-pair"},{token:"punctuation.separator.array.groq",regex:/,/},{token:"invalid.illegal.expected-sort-separator.groq",regex:/[^\s\]]/},{defaultToken:"support.function.sortorder.groq"}]}],"#function-call":[{include:"#function-var-arg"},{include:"#function-single-arg"},{include:"#function-round"}],"#function-var-arg":[{token:"support.function.vararg.begin.groq",regex:/\b(?:coalesce|select)\s*\(/,push:[{token:"support.function.vararg.end.groq",regex:/\)/,next:"pop"},{include:"#value"},{include:"#identifier"},{include:"#filter"},{include:"#pair"},{token:"punctuation.separator.array.groq",regex:/,/},{defaultToken:"support.function.vararg.groq"}]}],"#function-single-arg":[{token:"support.function.singlearg.begin.groq",regex:/\b(?:count|defined|length|path|references)\s*\(/,push:[{token:"support.function.singlearg.end.groq",regex:/\)/,next:"pop"},{include:"#query"},{include:"#identifier"},{include:"#value"},{include:"#pair"},{defaultToken:"support.function.singlearg.groq"}]}],"#identifier":[{token:["variable.other.readwrite.groq","text","punctuation.definition.block.js","text","keyword.operator.reference.groq"],regex:/([_A-Za-z][_0-9A-Za-z]*)(\s*)((?:\[\s*\])?)(\s*)(->)/},{token:["variable.other.readwrite.groq","constant.language.groq","text","punctuation.definition.block.js","text","keyword.operator.descendant.groq"],regex:/(?:([_A-Za-z][_0-9A-Za-z]*)|([@^]))(\s*)((?:\[\s*\])?)(\s*)(\.)/},{token:"variable.other.readwrite.groq",regex:/[_A-Za-z][_0-9A-Za-z]*/}],"#value":[{include:"#constant"},{include:"#number"},{include:"#string"},{include:"#array"},{include:"#variable"},{include:"#projection"},{include:"#comments"},{include:"#function-call"}]};ace.define("ace/mode/groq_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],((e,r,n)=>{const t=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,c=function(){this.$rules=o,this.normalizeRules()};t.inherits(c,i),r.GroqHighlightRules=c})),ace.define("ace/mode/groq",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/groq_highlight_rules","ace/mode/folding/cstyle"],((e,o,r)=>{const n=e("../lib/oop"),t=e("./text").Mode,i=e("../tokenizer").Tokenizer,c=e("./groq_highlight_rules").GroqHighlightRules,a=e("./folding/cstyle").FoldMode,l=function(){const e=new c;this.foldingRules=new a,this.$tokenizer=new i(e.getRules()),this.$keywordList=e.$keywordList};n.inherits(l,t),function(){this.lineCommentStart="'"}.call(l.prototype),o.Mode=l}));
|
|
2
|
-
//# sourceMappingURL=_editorSupport-6d7655b5.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_editorSupport-6d7655b5.esm.js","sources":["../src/ace-editor/groq.ts"],"sourcesContent":["/* eslint-disable no-undef */\n\nexport {}\n\n// Grammar from https://github.com/sanity-io/vscode-sanity\nconst rules = {\n start: [\n {\n include: '#query',\n },\n {\n include: '#value',\n },\n {\n include: '#pair',\n },\n ],\n '#query': [\n {\n include: '#nullary-access-operator',\n },\n {\n include: '#arraylike',\n },\n {\n include: '#pipe',\n },\n {\n include: '#sort-order',\n },\n {\n include: '#filter',\n },\n ],\n '#variable': [\n {\n token: 'variable.other.groq',\n regex: /\\$[_A-Za-z][_0-9A-Za-z]*/,\n },\n ],\n '#keyword': [\n {\n token: 'keyword.other.groq',\n regex: /\\b(?:asc|desc|in|match)\\b/,\n },\n ],\n '#comparison': [\n {\n token: 'keyword.operator.comparison.groq',\n // eslint-disable-next-line no-div-regex\n regex: /==|!=|>=|<=|<!=>|<|>/,\n },\n ],\n '#operator': [\n {\n token: 'keyword.operator.arithmetic.groq',\n regex: /\\+|-|\\*{1,2}|\\/|%/,\n },\n ],\n '#pipe': [\n {\n token: 'keyword.operator.pipe.groq',\n regex: /\\|/,\n },\n ],\n '#logical': [\n {\n token: 'keyword.operator.logical.groq',\n regex: /!|&&|\\|\\|/,\n },\n ],\n '#reference': [\n {\n token: 'keyword.operator.reference.groq',\n regex: /->/,\n },\n ],\n '#pair': [\n {\n include: '#identifier',\n },\n {\n include: '#value',\n },\n {\n include: '#filter',\n },\n {\n token: 'keyword.operator.pair.groq',\n regex: /[=]>/,\n },\n ],\n '#arraylike': [\n {\n token: 'punctuation.definition.bracket.begin.groq',\n regex: /\\[/,\n push: [\n {\n token: ['text', 'keyword.operator.descendant.groq'],\n regex: /(\\])((?:\\s*\\.)?)/,\n next: 'pop',\n },\n {\n include: '#range',\n },\n {\n include: '#filter',\n },\n {\n include: '#array-values',\n },\n ],\n },\n ],\n '#array': [\n {\n token: 'punctuation.definition.bracket.begin.groq',\n regex: /\\[/,\n push: [\n {\n token: 'punctuation.definition.bracket.end.groq',\n regex: /\\]/,\n next: 'pop',\n },\n {\n include: '#array-values',\n },\n {\n defaultToken: 'meta.structure.array.groq',\n },\n ],\n },\n ],\n '#range': [\n {\n token: [\n 'meta.structure.range.groq',\n 'constant.numeric.groq',\n 'meta.structure.range.groq',\n 'keyword.operator.range.groq',\n 'meta.structure.range.groq',\n 'constant.numeric.groq',\n 'meta.structure.range.groq',\n ],\n regex: /(\\s*)(\\d+)(\\s*)(\\.{2,3})(\\s*)(\\d+)(\\s*)/,\n },\n ],\n '#spread': [\n {\n token: 'punctuation.definition.spread.begin.groq',\n regex: /\\.\\.\\./,\n push: [\n {\n include: '#array',\n },\n {\n include: '#function-call',\n },\n {\n include: '#projection',\n },\n {\n token: 'punctuation.definition.spread.end.groq',\n regex: /(?=.)/,\n next: 'pop',\n },\n {\n defaultToken: 'meta.structure.spread.groq',\n },\n ],\n },\n ],\n '#array-values': [\n {\n include: '#value',\n },\n {\n include: '#spread',\n },\n {\n token: 'punctuation.separator.array.groq',\n regex: /,/,\n },\n {\n token: 'invalid.illegal.expected-array-separator.groq',\n regex: /[^\\s\\]]/,\n },\n ],\n '#filter': [\n {\n include: '#function-call',\n },\n {\n include: '#keyword',\n },\n {\n include: '#constant',\n },\n {\n include: '#identifier',\n },\n {\n include: '#value',\n },\n {\n include: '#comparison',\n },\n {\n include: '#operator',\n },\n {\n include: '#logical',\n },\n ],\n '#comments': [\n {\n token: ['punctuation.definition.comment.groq', 'comment.line.double-slash.js'],\n regex: /(\\/\\/)(.*$)/,\n },\n ],\n '#nullary-access-operator': [\n {\n token: 'constant.language.groq',\n regex: /[*@^]/,\n },\n ],\n '#constant': [\n {\n token: 'constant.language.groq',\n regex: /\\b(?:true|false|null)\\b/,\n },\n ],\n '#number': [\n {\n token: 'constant.numeric.groq',\n regex: /-?(?:0|[1-9]\\d*)(?:(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)?/,\n },\n ],\n '#named-projection': [\n {\n include: '#identifier',\n },\n {\n include: '#objectkey',\n },\n {\n include: '#projection',\n },\n ],\n '#projection': [\n {\n token: 'punctuation.definition.projection.begin.groq',\n regex: /\\{/,\n push: [\n {\n token: 'punctuation.definition.projection.end.groq',\n regex: /\\}/,\n next: 'pop',\n },\n {\n include: '#identifier',\n },\n {\n include: '#objectkey',\n },\n {\n include: '#named-projection',\n },\n {\n include: '#comments',\n },\n {\n include: '#spread',\n },\n {\n include: '#pair',\n },\n {\n token: 'punctuation.separator.projection.key-value.groq',\n regex: /:/,\n push: [\n {\n token: 'punctuation.separator.projection.pair.groq',\n regex: /,|(?=\\})/,\n next: 'pop',\n },\n {\n include: '#nullary-access-operator',\n },\n {\n include: '#arraylike',\n },\n {\n include: '#value',\n },\n {\n include: '#spread',\n },\n {\n include: '#identifier',\n },\n {\n include: '#operator',\n },\n {\n include: '#comparison',\n },\n {\n include: '#pair',\n },\n {\n token: 'invalid.illegal.expected-projection-separator.groq',\n regex: /[^\\s,]/,\n },\n {\n defaultToken: 'meta.structure.projection.value.groq',\n },\n ],\n },\n {\n token: 'invalid.illegal.expected-projection-separator.groq',\n regex: /[^\\s},]/,\n },\n {\n defaultToken: 'meta.structure.projection.groq',\n },\n ],\n },\n ],\n '#string': [\n {\n include: '#single-string',\n },\n {\n include: '#double-string',\n },\n ],\n '#double-string': [\n {\n token: 'punctuation.definition.string.begin.groq',\n regex: /\"/,\n push: [\n {\n token: 'punctuation.definition.string.end.groq',\n regex: /\"/,\n next: 'pop',\n },\n {\n include: '#stringcontent',\n },\n {\n defaultToken: 'string.quoted.double.groq',\n },\n ],\n },\n ],\n '#single-string': [\n {\n token: 'punctuation.definition.string.single.begin.groq',\n regex: /'/,\n push: [\n {\n token: 'punctuation.definition.string.single.end.groq',\n regex: /'/,\n next: 'pop',\n },\n {\n include: '#stringcontent',\n },\n {\n defaultToken: 'string.quoted.single.groq',\n },\n ],\n },\n ],\n '#objectkey': [\n {\n include: '#string',\n },\n ],\n '#stringcontent': [\n {\n token: 'constant.character.escape.groq',\n regex: /\\\\(?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4})/,\n },\n {\n token: 'invalid.illegal.unrecognized-string-escape.groq',\n regex: /\\\\./,\n },\n ],\n '#sort-pair': [\n {\n token: ['variable.other.readwrite.groq', 'text', 'keyword.other.groq'],\n regex: /([_A-Za-z][_0-9A-Za-z]*)(?:(\\s*)(asc|desc))?/,\n },\n {\n token: ['constant.language.groq', 'punctuation.definition.bracket.begin.groq'],\n regex: /(@)(\\[)/,\n push: [\n {\n token: ['punctuation.definition.bracket.begin.groq', 'text', 'keyword.other.groq'],\n regex: /(\\])(?:(\\s*)(asc|desc))?/,\n next: 'pop',\n },\n {\n include: '#string',\n },\n ],\n },\n ],\n '#sort-order': [\n {\n token: 'support.function.sortorder.begin.groq',\n regex: /\\border\\s*\\(/,\n push: [\n {\n token: 'support.function.sortorder.end.groq',\n regex: /\\)/,\n next: 'pop',\n },\n {\n include: '#sort-pair',\n },\n {\n token: 'punctuation.separator.array.groq',\n regex: /,/,\n },\n {\n token: 'invalid.illegal.expected-sort-separator.groq',\n regex: /[^\\s\\]]/,\n },\n {\n defaultToken: 'support.function.sortorder.groq',\n },\n ],\n },\n ],\n '#function-call': [\n {\n include: '#function-var-arg',\n },\n {\n include: '#function-single-arg',\n },\n {\n include: '#function-round',\n },\n ],\n '#function-var-arg': [\n {\n token: 'support.function.vararg.begin.groq',\n regex: /\\b(?:coalesce|select)\\s*\\(/,\n push: [\n {\n token: 'support.function.vararg.end.groq',\n regex: /\\)/,\n next: 'pop',\n },\n {\n include: '#value',\n },\n {\n include: '#identifier',\n },\n {\n include: '#filter',\n },\n {\n include: '#pair',\n },\n {\n token: 'punctuation.separator.array.groq',\n regex: /,/,\n },\n {\n defaultToken: 'support.function.vararg.groq',\n },\n ],\n },\n ],\n '#function-single-arg': [\n {\n token: 'support.function.singlearg.begin.groq',\n regex: /\\b(?:count|defined|length|path|references)\\s*\\(/,\n push: [\n {\n token: 'support.function.singlearg.end.groq',\n regex: /\\)/,\n next: 'pop',\n },\n {\n include: '#query',\n },\n {\n include: '#identifier',\n },\n {\n include: '#value',\n },\n {\n include: '#pair',\n },\n {\n defaultToken: 'support.function.singlearg.groq',\n },\n ],\n },\n ],\n '#identifier': [\n {\n token: [\n 'variable.other.readwrite.groq',\n 'text',\n 'punctuation.definition.block.js',\n 'text',\n 'keyword.operator.reference.groq',\n ],\n regex: /([_A-Za-z][_0-9A-Za-z]*)(\\s*)((?:\\[\\s*\\])?)(\\s*)(->)/,\n },\n {\n token: [\n 'variable.other.readwrite.groq',\n 'constant.language.groq',\n 'text',\n 'punctuation.definition.block.js',\n 'text',\n 'keyword.operator.descendant.groq',\n ],\n regex: /(?:([_A-Za-z][_0-9A-Za-z]*)|([@^]))(\\s*)((?:\\[\\s*\\])?)(\\s*)(\\.)/,\n },\n {\n token: 'variable.other.readwrite.groq',\n regex: /[_A-Za-z][_0-9A-Za-z]*/,\n },\n ],\n '#value': [\n {\n include: '#constant',\n },\n {\n include: '#number',\n },\n {\n include: '#string',\n },\n {\n include: '#array',\n },\n {\n include: '#variable',\n },\n {\n include: '#projection',\n },\n {\n include: '#comments',\n },\n {\n include: '#function-call',\n },\n ],\n}\n\ndeclare let ace: any\n\nace.define(\n 'ace/mode/groq_highlight_rules',\n ['require', 'exports', 'module', 'ace/lib/oop', 'ace/mode/text_highlight_rules'],\n (acequire: (id: string) => any, exports: Record<string, unknown>, _module: any) => {\n const oop = acequire('../lib/oop')\n const TextHighlightRules = acequire('./text_highlight_rules').TextHighlightRules\n\n const GroqHighlightRules = function () {\n /* eslint-disable @typescript-eslint/ban-ts-comment */\n // @ts-ignore\n this.$rules = rules\n // @ts-ignore\n this.normalizeRules()\n /* eslint-enable @typescript-eslint/ban-ts-comment */\n }\n\n oop.inherits(GroqHighlightRules, TextHighlightRules)\n\n exports.GroqHighlightRules = GroqHighlightRules\n }\n)\n\nace.define(\n 'ace/mode/groq',\n [\n 'require',\n 'exports',\n 'module',\n 'ace/lib/oop',\n 'ace/mode/text',\n 'ace/tokenizer',\n 'ace/mode/groq_highlight_rules',\n 'ace/mode/folding/cstyle',\n ],\n (acequire: (id: string) => any, exports: Record<string, unknown>, _module: any) => {\n // eslint-disable-next-line strict\n 'use strict'\n const oop = acequire('../lib/oop')\n const TextMode = acequire('./text').Mode\n const Tokenizer = acequire('../tokenizer').Tokenizer\n const GroqHighlightRules = acequire('./groq_highlight_rules').GroqHighlightRules\n const FoldMode = acequire('./folding/cstyle').FoldMode\n\n const Mode = function () {\n /* eslint-disable @typescript-eslint/ban-ts-comment */\n const highlighter = new GroqHighlightRules()\n // @ts-ignore\n this.foldingRules = new FoldMode()\n // @ts-ignore\n this.$tokenizer = new Tokenizer(highlighter.getRules())\n // @ts-ignore\n this.$keywordList = highlighter.$keywordList\n /* eslint-enable @typescript-eslint/ban-ts-comment */\n }\n oop.inherits(Mode, TextMode)\n ;(function () {\n /* eslint-disable @typescript-eslint/ban-ts-comment */\n // @ts-ignore\n this.lineCommentStart = \"'\"\n /* eslint-enable @typescript-eslint/ban-ts-comment */\n }.call(Mode.prototype))\n\n exports.Mode = Mode\n }\n)\n"],"names":["rules","start","include","token","regex","push","next","defaultToken","ace","define","acequire","exports","_module","oop","TextHighlightRules","GroqHighlightRules","this","$rules","normalizeRules","inherits","TextMode","Mode","Tokenizer","FoldMode","highlighter","foldingRules","$tokenizer","getRules","$keywordList","lineCommentStart","call","prototype"],"mappings":"stCAKA,MAAMA,EAAQ,CACZC,MAAO,CACL,CACEC,QAAS,UAEX,CACEA,QAAS,UAEX,CACEA,QAAS,UAGb,SAAU,CACR,CACEA,QAAS,4BAEX,CACEA,QAAS,cAEX,CACEA,QAAS,SAEX,CACEA,QAAS,eAEX,CACEA,QAAS,YAGb,YAAa,CACX,CACEC,MAAO,sBACPC,MAAO,6BAGX,WAAY,CACV,CACED,MAAO,qBACPC,MAAO,8BAGX,cAAe,CACb,CACED,MAAO,mCAEPC,MAAO,yBAGX,YAAa,CACX,CACED,MAAO,mCACPC,MAAO,sBAGX,QAA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KE,gBAEP,EAEIL,EAAAM,SAASJ,EAAoBD,GAEjCH,EAAQI,mBAAqBA,CAA7B,IAIJP,IAAIC,OACF,gBACA,CACE,UACA,UACA,SACA,cACA,gBACA,gBACA,gCACA,4BAEF,CAACC,EAA+BC,EAAkCC,KAG1D,MAAAC,EAAMH,EAAS,cACfU,EAAWV,EAAS,UAAUW,KAC9BC,EAAYZ,EAAS,gBAAgBY,UACrCP,EAAqBL,EAAS,0BAA0BK,mBACxDQ,EAAWb,EAAS,oBAAoBa,SAExCF,EAAO,WAEL,MAAAG,EAAc,IAAIT,EAEnBC,KAAAS,aAAe,IAAIF,EAExBP,KAAKU,WAAa,IAAIJ,EAAUE,EAAYG,YAE5CX,KAAKY,aAAeJ,EAAYI,YAElC,EACIf,EAAAM,SAASE,EAAMD,GAClB,WAGCJ,KAAKa,iBAAmB,GAHzB,EAKCC,KAAKT,EAAKU,WAEZpB,EAAQU,KAAOA,CAAf"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("react-ace");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("ace-builds/src-noconflict/mode-batchfile"),require("ace-builds/src-noconflict/mode-csharp"),require("ace-builds/src-noconflict/mode-css"),require("ace-builds/src-noconflict/mode-golang"),require("ace-builds/src-noconflict/mode-html"),require("ace-builds/src-noconflict/mode-java"),require("ace-builds/src-noconflict/mode-javascript"),require("ace-builds/src-noconflict/mode-json"),require("ace-builds/src-noconflict/mode-jsx"),require("ace-builds/src-noconflict/mode-markdown"),require("ace-builds/src-noconflict/mode-mysql"),require("ace-builds/src-noconflict/mode-php"),require("ace-builds/src-noconflict/mode-python"),require("ace-builds/src-noconflict/mode-ruby"),require("ace-builds/src-noconflict/mode-sass"),require("ace-builds/src-noconflict/mode-scss"),require("ace-builds/src-noconflict/mode-sh"),require("ace-builds/src-noconflict/mode-text"),require("ace-builds/src-noconflict/mode-tsx"),require("ace-builds/src-noconflict/mode-typescript"),require("ace-builds/src-noconflict/mode-xml"),require("ace-builds/src-noconflict/mode-yaml"),require("ace-builds/src-noconflict/theme-github"),require("ace-builds/src-noconflict/theme-monokai"),require("ace-builds/src-noconflict/theme-terminal"),require("ace-builds/src-noconflict/theme-tomorrow");var n=r(e);const o={start:[{include:"#query"},{include:"#value"},{include:"#pair"}],"#query":[{include:"#nullary-access-operator"},{include:"#arraylike"},{include:"#pipe"},{include:"#sort-order"},{include:"#filter"}],"#variable":[{token:"variable.other.groq",regex:/\$[_A-Za-z][_0-9A-Za-z]*/}],"#keyword":[{token:"keyword.other.groq",regex:/\b(?:asc|desc|in|match)\b/}],"#comparison":[{token:"keyword.operator.comparison.groq",regex:/==|!=|>=|<=|<!=>|<|>/}],"#operator":[{token:"keyword.operator.arithmetic.groq",regex:/\+|-|\*{1,2}|\/|%/}],"#pipe":[{token:"keyword.operator.pipe.groq",regex:/\|/}],"#logical":[{token:"keyword.operator.logical.groq",regex:/!|&&|\|\|/}],"#reference":[{token:"keyword.operator.reference.groq",regex:/->/}],"#pair":[{include:"#identifier"},{include:"#value"},{include:"#filter"},{token:"keyword.operator.pair.groq",regex:/[=]>/}],"#arraylike":[{token:"punctuation.definition.bracket.begin.groq",regex:/\[/,push:[{token:["text","keyword.operator.descendant.groq"],regex:/(\])((?:\s*\.)?)/,next:"pop"},{include:"#range"},{include:"#filter"},{include:"#array-values"}]}],"#array":[{token:"punctuation.definition.bracket.begin.groq",regex:/\[/,push:[{token:"punctuation.definition.bracket.end.groq",regex:/\]/,next:"pop"},{include:"#array-values"},{defaultToken:"meta.structure.array.groq"}]}],"#range":[{token:["meta.structure.range.groq","constant.numeric.groq","meta.structure.range.groq","keyword.operator.range.groq","meta.structure.range.groq","constant.numeric.groq","meta.structure.range.groq"],regex:/(\s*)(\d+)(\s*)(\.{2,3})(\s*)(\d+)(\s*)/}],"#spread":[{token:"punctuation.definition.spread.begin.groq",regex:/\.\.\./,push:[{include:"#array"},{include:"#function-call"},{include:"#projection"},{token:"punctuation.definition.spread.end.groq",regex:/(?=.)/,next:"pop"},{defaultToken:"meta.structure.spread.groq"}]}],"#array-values":[{include:"#value"},{include:"#spread"},{token:"punctuation.separator.array.groq",regex:/,/},{token:"invalid.illegal.expected-array-separator.groq",regex:/[^\s\]]/}],"#filter":[{include:"#function-call"},{include:"#keyword"},{include:"#constant"},{include:"#identifier"},{include:"#value"},{include:"#comparison"},{include:"#operator"},{include:"#logical"}],"#comments":[{token:["punctuation.definition.comment.groq","comment.line.double-slash.js"],regex:/(\/\/)(.*$)/}],"#nullary-access-operator":[{token:"constant.language.groq",regex:/[*@^]/}],"#constant":[{token:"constant.language.groq",regex:/\b(?:true|false|null)\b/}],"#number":[{token:"constant.numeric.groq",regex:/-?(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:[eE][+-]?\d+)?)?/}],"#named-projection":[{include:"#identifier"},{include:"#objectkey"},{include:"#projection"}],"#projection":[{token:"punctuation.definition.projection.begin.groq",regex:/\{/,push:[{token:"punctuation.definition.projection.end.groq",regex:/\}/,next:"pop"},{include:"#identifier"},{include:"#objectkey"},{include:"#named-projection"},{include:"#comments"},{include:"#spread"},{include:"#pair"},{token:"punctuation.separator.projection.key-value.groq",regex:/:/,push:[{token:"punctuation.separator.projection.pair.groq",regex:/,|(?=\})/,next:"pop"},{include:"#nullary-access-operator"},{include:"#arraylike"},{include:"#value"},{include:"#spread"},{include:"#identifier"},{include:"#operator"},{include:"#comparison"},{include:"#pair"},{token:"invalid.illegal.expected-projection-separator.groq",regex:/[^\s,]/},{defaultToken:"meta.structure.projection.value.groq"}]},{token:"invalid.illegal.expected-projection-separator.groq",regex:/[^\s},]/},{defaultToken:"meta.structure.projection.groq"}]}],"#string":[{include:"#single-string"},{include:"#double-string"}],"#double-string":[{token:"punctuation.definition.string.begin.groq",regex:/"/,push:[{token:"punctuation.definition.string.end.groq",regex:/"/,next:"pop"},{include:"#stringcontent"},{defaultToken:"string.quoted.double.groq"}]}],"#single-string":[{token:"punctuation.definition.string.single.begin.groq",regex:/'/,push:[{token:"punctuation.definition.string.single.end.groq",regex:/'/,next:"pop"},{include:"#stringcontent"},{defaultToken:"string.quoted.single.groq"}]}],"#objectkey":[{include:"#string"}],"#stringcontent":[{token:"constant.character.escape.groq",regex:/\\(?:["\\/bfnrt]|u[0-9a-fA-F]{4})/},{token:"invalid.illegal.unrecognized-string-escape.groq",regex:/\\./}],"#sort-pair":[{token:["variable.other.readwrite.groq","text","keyword.other.groq"],regex:/([_A-Za-z][_0-9A-Za-z]*)(?:(\s*)(asc|desc))?/},{token:["constant.language.groq","punctuation.definition.bracket.begin.groq"],regex:/(@)(\[)/,push:[{token:["punctuation.definition.bracket.begin.groq","text","keyword.other.groq"],regex:/(\])(?:(\s*)(asc|desc))?/,next:"pop"},{include:"#string"}]}],"#sort-order":[{token:"support.function.sortorder.begin.groq",regex:/\border\s*\(/,push:[{token:"support.function.sortorder.end.groq",regex:/\)/,next:"pop"},{include:"#sort-pair"},{token:"punctuation.separator.array.groq",regex:/,/},{token:"invalid.illegal.expected-sort-separator.groq",regex:/[^\s\]]/},{defaultToken:"support.function.sortorder.groq"}]}],"#function-call":[{include:"#function-var-arg"},{include:"#function-single-arg"},{include:"#function-round"}],"#function-var-arg":[{token:"support.function.vararg.begin.groq",regex:/\b(?:coalesce|select)\s*\(/,push:[{token:"support.function.vararg.end.groq",regex:/\)/,next:"pop"},{include:"#value"},{include:"#identifier"},{include:"#filter"},{include:"#pair"},{token:"punctuation.separator.array.groq",regex:/,/},{defaultToken:"support.function.vararg.groq"}]}],"#function-single-arg":[{token:"support.function.singlearg.begin.groq",regex:/\b(?:count|defined|length|path|references)\s*\(/,push:[{token:"support.function.singlearg.end.groq",regex:/\)/,next:"pop"},{include:"#query"},{include:"#identifier"},{include:"#value"},{include:"#pair"},{defaultToken:"support.function.singlearg.groq"}]}],"#identifier":[{token:["variable.other.readwrite.groq","text","punctuation.definition.block.js","text","keyword.operator.reference.groq"],regex:/([_A-Za-z][_0-9A-Za-z]*)(\s*)((?:\[\s*\])?)(\s*)(->)/},{token:["variable.other.readwrite.groq","constant.language.groq","text","punctuation.definition.block.js","text","keyword.operator.descendant.groq"],regex:/(?:([_A-Za-z][_0-9A-Za-z]*)|([@^]))(\s*)((?:\[\s*\])?)(\s*)(\.)/},{token:"variable.other.readwrite.groq",regex:/[_A-Za-z][_0-9A-Za-z]*/}],"#value":[{include:"#constant"},{include:"#number"},{include:"#string"},{include:"#array"},{include:"#variable"},{include:"#projection"},{include:"#comments"},{include:"#function-call"}]};ace.define("ace/mode/groq_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],((e,r,n)=>{const t=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,c=function(){this.$rules=o,this.normalizeRules()};t.inherits(c,i),r.GroqHighlightRules=c})),ace.define("ace/mode/groq",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/groq_highlight_rules","ace/mode/folding/cstyle"],((e,r,n)=>{const o=e("../lib/oop"),t=e("./text").Mode,i=e("../tokenizer").Tokenizer,c=e("./groq_highlight_rules").GroqHighlightRules,a=e("./folding/cstyle").FoldMode,u=function(){const e=new c;this.foldingRules=new a,this.$tokenizer=new i(e.getRules()),this.$keywordList=e.$keywordList};o.inherits(u,t),function(){this.lineCommentStart="'"}.call(u.prototype),r.Mode=u})),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return n.default}});
|
|
2
|
-
//# sourceMappingURL=_editorSupport-fc8c2591.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_editorSupport-fc8c2591.js","sources":["../src/ace-editor/groq.ts"],"sourcesContent":["/* eslint-disable no-undef */\n\nexport {}\n\n// Grammar from https://github.com/sanity-io/vscode-sanity\nconst rules = {\n start: [\n {\n include: '#query',\n },\n {\n include: '#value',\n },\n {\n include: '#pair',\n },\n ],\n '#query': [\n {\n include: '#nullary-access-operator',\n },\n {\n include: '#arraylike',\n },\n {\n include: '#pipe',\n },\n {\n include: '#sort-order',\n },\n {\n include: '#filter',\n },\n ],\n '#variable': [\n {\n token: 'variable.other.groq',\n regex: /\\$[_A-Za-z][_0-9A-Za-z]*/,\n },\n ],\n '#keyword': [\n {\n token: 'keyword.other.groq',\n regex: /\\b(?:asc|desc|in|match)\\b/,\n },\n ],\n '#comparison': [\n {\n token: 'keyword.operator.comparison.groq',\n // eslint-disable-next-line no-div-regex\n regex: /==|!=|>=|<=|<!=>|<|>/,\n },\n ],\n '#operator': [\n {\n token: 'keyword.operator.arithmetic.groq',\n regex: /\\+|-|\\*{1,2}|\\/|%/,\n },\n ],\n '#pipe': [\n {\n token: 'keyword.operator.pipe.groq',\n regex: /\\|/,\n },\n ],\n '#logical': [\n {\n token: 'keyword.operator.logical.groq',\n regex: /!|&&|\\|\\|/,\n },\n ],\n '#reference': [\n {\n token: 'keyword.operator.reference.groq',\n regex: /->/,\n },\n ],\n '#pair': [\n {\n include: '#identifier',\n },\n {\n include: '#value',\n },\n {\n include: '#filter',\n },\n {\n token: 'keyword.operator.pair.groq',\n regex: /[=]>/,\n },\n ],\n '#arraylike': [\n {\n token: 'punctuation.definition.bracket.begin.groq',\n regex: /\\[/,\n push: [\n {\n token: ['text', 'keyword.operator.descendant.groq'],\n regex: /(\\])((?:\\s*\\.)?)/,\n next: 'pop',\n },\n {\n include: '#range',\n },\n {\n include: '#filter',\n },\n {\n include: '#array-values',\n },\n ],\n },\n ],\n '#array': [\n {\n token: 'punctuation.definition.bracket.begin.groq',\n regex: /\\[/,\n push: [\n {\n token: 'punctuation.definition.bracket.end.groq',\n regex: /\\]/,\n next: 'pop',\n },\n {\n include: '#array-values',\n },\n {\n defaultToken: 'meta.structure.array.groq',\n },\n ],\n },\n ],\n '#range': [\n {\n token: [\n 'meta.structure.range.groq',\n 'constant.numeric.groq',\n 'meta.structure.range.groq',\n 'keyword.operator.range.groq',\n 'meta.structure.range.groq',\n 'constant.numeric.groq',\n 'meta.structure.range.groq',\n ],\n regex: /(\\s*)(\\d+)(\\s*)(\\.{2,3})(\\s*)(\\d+)(\\s*)/,\n },\n ],\n '#spread': [\n {\n token: 'punctuation.definition.spread.begin.groq',\n regex: /\\.\\.\\./,\n push: [\n {\n include: '#array',\n },\n {\n include: '#function-call',\n },\n {\n include: '#projection',\n },\n {\n token: 'punctuation.definition.spread.end.groq',\n regex: /(?=.)/,\n next: 'pop',\n },\n {\n defaultToken: 'meta.structure.spread.groq',\n },\n ],\n },\n ],\n '#array-values': [\n {\n include: '#value',\n },\n {\n include: '#spread',\n },\n {\n token: 'punctuation.separator.array.groq',\n regex: /,/,\n },\n {\n token: 'invalid.illegal.expected-array-separator.groq',\n regex: /[^\\s\\]]/,\n },\n ],\n '#filter': [\n {\n include: '#function-call',\n },\n {\n include: '#keyword',\n },\n {\n include: '#constant',\n },\n {\n include: '#identifier',\n },\n {\n include: '#value',\n },\n {\n include: '#comparison',\n },\n {\n include: '#operator',\n },\n {\n include: '#logical',\n },\n ],\n '#comments': [\n {\n token: ['punctuation.definition.comment.groq', 'comment.line.double-slash.js'],\n regex: /(\\/\\/)(.*$)/,\n },\n ],\n '#nullary-access-operator': [\n {\n token: 'constant.language.groq',\n regex: /[*@^]/,\n },\n ],\n '#constant': [\n {\n token: 'constant.language.groq',\n regex: /\\b(?:true|false|null)\\b/,\n },\n ],\n '#number': [\n {\n token: 'constant.numeric.groq',\n regex: /-?(?:0|[1-9]\\d*)(?:(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)?/,\n },\n ],\n '#named-projection': [\n {\n include: '#identifier',\n },\n {\n include: '#objectkey',\n },\n {\n include: '#projection',\n },\n ],\n '#projection': [\n {\n token: 'punctuation.definition.projection.begin.groq',\n regex: /\\{/,\n push: [\n {\n token: 'punctuation.definition.projection.end.groq',\n regex: /\\}/,\n next: 'pop',\n },\n {\n include: '#identifier',\n },\n {\n include: '#objectkey',\n },\n {\n include: '#named-projection',\n },\n {\n include: '#comments',\n },\n {\n include: '#spread',\n },\n {\n include: '#pair',\n },\n {\n token: 'punctuation.separator.projection.key-value.groq',\n regex: /:/,\n push: [\n {\n token: 'punctuation.separator.projection.pair.groq',\n regex: /,|(?=\\})/,\n next: 'pop',\n },\n {\n include: '#nullary-access-operator',\n },\n {\n include: '#arraylike',\n },\n {\n include: '#value',\n },\n {\n include: '#spread',\n },\n {\n include: '#identifier',\n },\n {\n include: '#operator',\n },\n {\n include: '#comparison',\n },\n {\n include: '#pair',\n },\n {\n token: 'invalid.illegal.expected-projection-separator.groq',\n regex: /[^\\s,]/,\n },\n {\n defaultToken: 'meta.structure.projection.value.groq',\n },\n ],\n },\n {\n token: 'invalid.illegal.expected-projection-separator.groq',\n regex: /[^\\s},]/,\n },\n {\n defaultToken: 'meta.structure.projection.groq',\n },\n ],\n },\n ],\n '#string': [\n {\n include: '#single-string',\n },\n {\n include: '#double-string',\n },\n ],\n '#double-string': [\n {\n token: 'punctuation.definition.string.begin.groq',\n regex: /\"/,\n push: [\n {\n token: 'punctuation.definition.string.end.groq',\n regex: /\"/,\n next: 'pop',\n },\n {\n include: '#stringcontent',\n },\n {\n defaultToken: 'string.quoted.double.groq',\n },\n ],\n },\n ],\n '#single-string': [\n {\n token: 'punctuation.definition.string.single.begin.groq',\n regex: /'/,\n push: [\n {\n token: 'punctuation.definition.string.single.end.groq',\n regex: /'/,\n next: 'pop',\n },\n {\n include: '#stringcontent',\n },\n {\n defaultToken: 'string.quoted.single.groq',\n },\n ],\n },\n ],\n '#objectkey': [\n {\n include: '#string',\n },\n ],\n '#stringcontent': [\n {\n token: 'constant.character.escape.groq',\n regex: /\\\\(?:[\"\\\\/bfnrt]|u[0-9a-fA-F]{4})/,\n },\n {\n token: 'invalid.illegal.unrecognized-string-escape.groq',\n regex: /\\\\./,\n },\n ],\n '#sort-pair': [\n {\n token: ['variable.other.readwrite.groq', 'text', 'keyword.other.groq'],\n regex: /([_A-Za-z][_0-9A-Za-z]*)(?:(\\s*)(asc|desc))?/,\n },\n {\n token: ['constant.language.groq', 'punctuation.definition.bracket.begin.groq'],\n regex: /(@)(\\[)/,\n push: [\n {\n token: ['punctuation.definition.bracket.begin.groq', 'text', 'keyword.other.groq'],\n regex: /(\\])(?:(\\s*)(asc|desc))?/,\n next: 'pop',\n },\n {\n include: '#string',\n },\n ],\n },\n ],\n '#sort-order': [\n {\n token: 'support.function.sortorder.begin.groq',\n regex: /\\border\\s*\\(/,\n push: [\n {\n token: 'support.function.sortorder.end.groq',\n regex: /\\)/,\n next: 'pop',\n },\n {\n include: '#sort-pair',\n },\n {\n token: 'punctuation.separator.array.groq',\n regex: /,/,\n },\n {\n token: 'invalid.illegal.expected-sort-separator.groq',\n regex: /[^\\s\\]]/,\n },\n {\n defaultToken: 'support.function.sortorder.groq',\n },\n ],\n },\n ],\n '#function-call': [\n {\n include: '#function-var-arg',\n },\n {\n include: '#function-single-arg',\n },\n {\n include: '#function-round',\n },\n ],\n '#function-var-arg': [\n {\n token: 'support.function.vararg.begin.groq',\n regex: /\\b(?:coalesce|select)\\s*\\(/,\n push: [\n {\n token: 'support.function.vararg.end.groq',\n regex: /\\)/,\n next: 'pop',\n },\n {\n include: '#value',\n },\n {\n include: '#identifier',\n },\n {\n include: '#filter',\n },\n {\n include: '#pair',\n },\n {\n token: 'punctuation.separator.array.groq',\n regex: /,/,\n },\n {\n defaultToken: 'support.function.vararg.groq',\n },\n ],\n },\n ],\n '#function-single-arg': [\n {\n token: 'support.function.singlearg.begin.groq',\n regex: /\\b(?:count|defined|length|path|references)\\s*\\(/,\n push: [\n {\n token: 'support.function.singlearg.end.groq',\n regex: /\\)/,\n next: 'pop',\n },\n {\n include: '#query',\n },\n {\n include: '#identifier',\n },\n {\n include: '#value',\n },\n {\n include: '#pair',\n },\n {\n defaultToken: 'support.function.singlearg.groq',\n },\n ],\n },\n ],\n '#identifier': [\n {\n token: [\n 'variable.other.readwrite.groq',\n 'text',\n 'punctuation.definition.block.js',\n 'text',\n 'keyword.operator.reference.groq',\n ],\n regex: /([_A-Za-z][_0-9A-Za-z]*)(\\s*)((?:\\[\\s*\\])?)(\\s*)(->)/,\n },\n {\n token: [\n 'variable.other.readwrite.groq',\n 'constant.language.groq',\n 'text',\n 'punctuation.definition.block.js',\n 'text',\n 'keyword.operator.descendant.groq',\n ],\n regex: /(?:([_A-Za-z][_0-9A-Za-z]*)|([@^]))(\\s*)((?:\\[\\s*\\])?)(\\s*)(\\.)/,\n },\n {\n token: 'variable.other.readwrite.groq',\n regex: /[_A-Za-z][_0-9A-Za-z]*/,\n },\n ],\n '#value': [\n {\n include: '#constant',\n },\n {\n include: '#number',\n },\n {\n include: '#string',\n },\n {\n include: '#array',\n },\n {\n include: '#variable',\n },\n {\n include: '#projection',\n },\n {\n include: '#comments',\n },\n {\n include: '#function-call',\n },\n ],\n}\n\ndeclare let ace: any\n\nace.define(\n 'ace/mode/groq_highlight_rules',\n ['require', 'exports', 'module', 'ace/lib/oop', 'ace/mode/text_highlight_rules'],\n (acequire: (id: string) => any, exports: Record<string, unknown>, _module: any) => {\n const oop = acequire('../lib/oop')\n const TextHighlightRules = acequire('./text_highlight_rules').TextHighlightRules\n\n const GroqHighlightRules = function () {\n /* eslint-disable @typescript-eslint/ban-ts-comment */\n // @ts-ignore\n this.$rules = rules\n // @ts-ignore\n this.normalizeRules()\n /* eslint-enable @typescript-eslint/ban-ts-comment */\n }\n\n oop.inherits(GroqHighlightRules, TextHighlightRules)\n\n exports.GroqHighlightRules = GroqHighlightRules\n }\n)\n\nace.define(\n 'ace/mode/groq',\n [\n 'require',\n 'exports',\n 'module',\n 'ace/lib/oop',\n 'ace/mode/text',\n 'ace/tokenizer',\n 'ace/mode/groq_highlight_rules',\n 'ace/mode/folding/cstyle',\n ],\n (acequire: (id: string) => any, exports: Record<string, unknown>, _module: any) => {\n // eslint-disable-next-line strict\n 'use strict'\n const oop = acequire('../lib/oop')\n const TextMode = acequire('./text').Mode\n const Tokenizer = acequire('../tokenizer').Tokenizer\n const GroqHighlightRules = acequire('./groq_highlight_rules').GroqHighlightRules\n const FoldMode = acequire('./folding/cstyle').FoldMode\n\n const Mode = function () {\n /* eslint-disable @typescript-eslint/ban-ts-comment */\n const highlighter = new GroqHighlightRules()\n // @ts-ignore\n this.foldingRules = new FoldMode()\n // @ts-ignore\n this.$tokenizer = new Tokenizer(highlighter.getRules())\n // @ts-ignore\n this.$keywordList = highlighter.$keywordList\n /* eslint-enable @typescript-eslint/ban-ts-comment */\n }\n oop.inherits(Mode, TextMode)\n ;(function () {\n /* eslint-disable @typescript-eslint/ban-ts-comment */\n // @ts-ignore\n this.lineCommentStart = \"'\"\n /* eslint-enable @typescript-eslint/ban-ts-comment */\n }.call(Mode.prototype))\n\n exports.Mode = Mode\n }\n)\n"],"names":["rules","start","include","token","regex","push","next","defaultToken","ace","define","acequire","exports","_module","oop","TextHighlightRules","GroqHighlightRules","this","$rules","normalizeRules","inherits","TextMode","Mode","Tokenizer","FoldMode","highlighter","foldingRules","$tokenizer","getRules","$keywordList","lineCommentStart","call","prototype"],"mappings":"u2CAKA,MAAMA,EAAQ,CACZC,MAAO,CACL,CACEC,QAAS,UAEX,CACEA,QAAS,UAEX,CACEA,QAAS,UAGb,SAAU,CACR,CACEA,QAAS,4BAEX,CACEA,QAAS,cAEX,CACEA,QAAS,SAEX,CACEA,QAAS,eAEX,CACEA,QAAS,YAGb,YAAa,CACX,CACEC,MAAO,sBACPC,MAAO,6BAGX,WAAY,CACV,CACED,MAAO,qBACPC,MAAO,8BAGX,cAAe,CACb,CACED,MAAO,mCAEPC,MAAO,yBAGX,YAAa,CACX,CACED,MAAO,mCACPC,MAAO,sBAGX,QAAS,CACP,CACED,MAAO,6BACPC,MAAO,OAGX,WAAY,CACV,CACED,MAAO,gCACPC,MAAO,cAGX,aAAc,CACZ,CACED,MAAO,kCACPC,MAAO,OAGX,QAAS,CACP,CACEF,QAAS,eAEX,CACEA,QAAS,UAEX,CACEA,QAAS,WAEX,CACEC,MAAO,6BACPC,MAAO,SAGX,aAAc,CACZ,CACED,MAAO,4CACPC,MAAO,KACPC,KAAM,CACJ,CACEF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AS,0BAA0BK,mBACxDQ,EAAWb,EAAS,oBAAoBa,SAExCF,EAAO,WAEL,MAAAG,EAAc,IAAIT,EAEnBC,KAAAS,aAAe,IAAIF,EAExBP,KAAKU,WAAa,IAAIJ,EAAUE,EAAYG,YAE5CX,KAAKY,aAAeJ,EAAYI,YAElC,EACIf,EAAAM,SAASE,EAAMD,GAClB,WAGCJ,KAAKa,iBAAmB,GAHzB,EAKCC,KAAKT,EAAKU,WAEZpB,EAAQU,KAAOA,CAAf"}
|
package/lib/index.esm.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e,n,t,r;function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function l(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){o(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function a(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}import{useColorScheme as s,set as c,setIfMissing as d,unset as u,MemberField as h,defineType as g,createPlugin as m}from"sanity";import{CodeBlockIcon as v}from"@sanity/icons";import{jsx as p,jsxs as f}from"react/jsx-runtime";import b,{useState as w,useEffect as y,useRef as x,useMemo as O,useImperativeHandle as z,useCallback as j,Suspense as k}from"react";import{Card as S,Select as P,Stack as L,Box as M}from"@sanity/ui";import C,{css as F}from"styled-components";const _=F(e||(e=a(["\n .ace_editor_markers_highlight {\n position: absolute;\n background-color: ",";\n opacity: 0.2;\n width: 100% !important;\n border-radius: 0 !important;\n }\n"])),(e=>{let{theme:n}=e;return n.sanity.color.solid.primary.enabled.bg}));function A(e){return e.map((e=>({startRow:Number(e)-1,startCol:0,endRow:Number(e)-1,endCol:1/0,className:"ace_editor_markers_highlight",type:"screenLine",inFront:!0})))}const B=[{title:"Batch file",value:"batchfile"},{title:"C#",value:"csharp"},{title:"CSS",value:"css"},{title:"Go",value:"golang"},{title:"GROQ",value:"groq"},{title:"HTML",value:"html"},{title:"Java",value:"java"},{title:"JavaScript",value:"javascript"},{title:"JSON",value:"json"},{title:"JSX",value:"jsx"},{title:"Markdown",value:"markdown"},{title:"MySQL",value:"mysql"},{title:"PHP",value:"php"},{title:"Plain text",value:"text"},{title:"Python",value:"python"},{title:"Ruby",value:"ruby"},{title:"SASS",value:"sass"},{title:"SCSS",value:"scss"},{title:"sh",value:"sh"},{title:"TSX",value:"tsx"},{title:"TypeScript",value:"typescript"},{title:"XML",value:"xml"},{title:"YAML",value:"yaml"}],T={js:"javascript"},I=["github","monokai","terminal","tomorrow"],H={useSoftTabs:!0,navigateWithinSoftTabs:!0},R={$blockScrolling:!0},D=["code"],E=b.lazy((()=>import("./_editorSupport-6d7655b5.esm.js")));function G(){const[e,n]=w(!1);return y((()=>{requestAnimationFrame((()=>n(!0)))}),[]),e?E:null}const U=C(S)(n||(n=a(["\n position: relative;\n box-sizing: border-box;\n overflow: hidden;\n z-index: 0;\n\n .ace_editor {\n font-family: ",";\n font-size: ",";\n line-height: inherit;\n }\n\n ","\n\n &:not([disabled]):not([readonly]) {\n &:focus,\n &:focus-within {\n box-shadow: 0 0 0 2px ",";\n background-color: ",";\n border-color: ",";\n }\n }\n"])),(e=>{let{theme:n}=e;return n.sanity.fonts.code.family}),(e=>{let{theme:n}=e;return n.sanity.fonts.code.sizes[1]}),_,(e=>{let{theme:n}=e;return n.sanity.color.base.focusRing}),(e=>{let{theme:n}=e;return n.sanity.color.base.bg}),(e=>{let{theme:n}=e;return n.sanity.color.base.focusRing}));const J=C(M)(t||(t=a(["\n position: relative;\n"]))),N=C(M)(r||(r=a(["\n background-color: #272822;\n\n .ace_editor {\n box-sizing: border-box;\n cursor: default;\n pointer-events: none;\n }\n\n .ace_content {\n box-sizing: border-box;\n overflow: hidden;\n }\n"])));function X(e){var n;const t=x();y((()=>{var e;if(!(null==t?void 0:t.current))return;const n=null==(e=t.current)?void 0:e.editor;n&&(n.renderer.$cursorLayer.element.style.opacity=0,n.textInput.getElement().disabled=!0)}),[]);const r=j((()=>{}),[]),{value:i,type:l}=e,o=null==(n=null==l?void 0:l.options)?void 0:n.language,a=null==i?void 0:i.selection,s=(null==a?void 0:a.language)||o||"text",c=G();return p(J,{children:p(N,{padding:4,children:c&&p(k,{fallback:p("div",{children:"Loading code preview..."}),children:p(c,{ref:t,focus:!1,mode:s,theme:"monokai",width:"100%",onChange:r,maxLines:200,readOnly:!0,wrapEnabled:!0,showPrintMargin:!1,highlightActiveLine:!1,cursorStart:-1,value:(null==a?void 0:a.code)||"",markers:(null==a?void 0:a.highlightedLines)?A(a.highlightedLines):void 0,tabSize:2,showGutter:!1,setOptions:H,editorProps:R})})})})}const q="code",Q=g({name:"code",type:"object",title:"Code",components:{input:function(e){var n,t;const{members:r,elementProps:i,onChange:o,onFocusPath:a,readOnly:g,renderField:m,renderInput:v,renderItem:b,renderPreview:w,schemaType:S,value:M}=e,C=x(),F=O((()=>r.filter((e=>"field"===e.kind))),[r]),_=F.find((e=>"language"===e.name)),E=F.find((e=>"filename"===e.name)),J=F.find((e=>"code"===e.name));z(i.ref,(()=>({focus:()=>{var e,n;null==(n=null==(e=null==C?void 0:C.current)?void 0:e.editor)||n.focus()}})));const N=j((()=>{a(D)}),[a]),{scheme:X}=s(),q=O((()=>{var e,n;const t="light"===X,r=t?null==(e=S.options)?void 0:e.theme:null==(n=S.options)?void 0:n.darkTheme,i=t?"tomorrow":"monokai";return r&&I.find((e=>e===r))?r:i}),[S,X]),Q=j((e=>{var n,t;const r=null==(t=null==(n=C.current)?void 0:n.editor)?void 0:t.getSession(),i=null==r?void 0:r.getMarkers(!0),l=Object.keys(i).filter((e=>"screenLine"===i[e].type)).map((e=>i[e].range.start.row)),a=l.indexOf(e);a>-1?l.splice(a,1):(l.push(e),l.sort()),o(c(l.map((e=>e+1)),["highlightedLines"]))}),[C,o]),$=j((e=>{if(e.domEvent.target.classList.contains("ace_gutter-cell")){const n=e.getDocumentPosition().row;Q(n)}}),[Q]);y((()=>{var e;const n=null==(e=null==C?void 0:C.current)?void 0:e.editor;return()=>{var e;null==(e=null==n?void 0:n.session)||e.removeListener("guttermousedown",$)}}),[C,$]);const W=j((e=>{null==e||e.on("guttermousedown",$)}),[$]),Y=j((()=>{var e;const n=null==(e=S.options)?void 0:e.languageAlternatives;if(!n)return B;if(!Array.isArray(n))throw new Error("'options.languageAlternatives' should be an array, got ".concat(typeof n));return n.reduce(((e,n)=>{let{title:t,value:r,mode:i}=n;const l=T[r];return l?(console.warn('\'options.languageAlternatives\' lists a language with value "%s", which is an alias of "%s" - please replace the value to read "%s"',r,l,l),e.concat({title:t,value:l,mode:i})):(i||B.find((e=>e.value===r))||console.warn("'options.languageAlternatives' lists a language which is not supported: \"%s\", syntax highlighting will be disabled.",r),e.concat({title:t,value:r,mode:i}))}),[])}),[S]),K=j((e=>{var n;const t=D,r=null==(n=S.options)?void 0:n.language;o([d({_type:S.name,language:r}),e?c(e,t):u(t)])}),[o,S]),V=Y().slice(),Z=null==(n=S.options)?void 0:n.language,ee=(null==M?void 0:M.language)||Z,ne=V.find((e=>e.value===ee)),te=ee&&function(e){const n=T[e];return n||!!B.find((n=>n.value===e))&&e}(ee),re=(null==ne?void 0:ne.mode)||(te?ee:"text"),ie=j((e=>p(P,l(l({},e),{},{onChange:n=>{const t=n.currentTarget.value;e.onChange(t?c(t):u())},children:V.map((e=>p("option",{value:e.value,children:e.title},e.value)))}))),[V]),le=G(),oe=j((e=>p(U,{radius:1,shadow:1,readOnly:g,children:le&&p(k,{fallback:p("div",{children:"Loading code editor..."}),children:p(le,{ref:C,mode:re,theme:q,width:"100%",onChange:K,name:e.id,value:e.value,markers:M&&M.highlightedLines?A(M.highlightedLines):void 0,onLoad:W,readOnly:g,tabSize:2,wrapEnabled:!0,setOptions:H,editorProps:R,onFocus:N,onBlur:i.onBlur})})})),[le,q,K,N,W,re,i.onBlur,g,M]);return f(L,{space:4,children:[_&&p(h,{member:_,renderItem:b,renderField:m,renderInput:ie,renderPreview:w}),(null==(t=S.options)?void 0:t.withFilename)&&E&&p(h,{member:E,renderItem:b,renderField:m,renderInput:v,renderPreview:w}),J&&p(h,{member:J,renderInput:oe,renderItem:b,renderField:m,renderPreview:w})]})},preview:X},icon:v,fields:[{name:"language",title:"Language",type:"string"},{name:"filename",title:"Filename",type:"string"},{title:"Code",name:"code",type:"text"},{title:"Highlighted lines",name:"highlightedLines",type:"array",of:[{type:"number",title:"Highlighted line"}]}],preview:{select:{language:"language",code:"code",filename:"filename",highlightedLines:"highlightedLines"},prepare:e=>{return{title:e.filename||(e.language||"unknown").toUpperCase(),media:(n=null==e?void 0:e.language,"jsx"===n?p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 128 128",children:f("g",{fill:"#61DAFB",children:[p("circle",{cx:"64",cy:"64",r:"11.4"}),p("path",{d:"M107.3 45.2c-2.2-.8-4.5-1.6-6.9-2.3.6-2.4 1.1-4.8 1.5-7.1 2.1-13.2-.2-22.5-6.6-26.1-1.9-1.1-4-1.6-6.4-1.6-7 0-15.9 5.2-24.9 13.9-9-8.7-17.9-13.9-24.9-13.9-2.4 0-4.5.5-6.4 1.6-6.4 3.7-8.7 13-6.6 26.1.4 2.3.9 4.7 1.5 7.1-2.4.7-4.7 1.4-6.9 2.3C8.2 50 1.4 56.6 1.4 64s6.9 14 19.3 18.8c2.2.8 4.5 1.6 6.9 2.3-.6 2.4-1.1 4.8-1.5 7.1-2.1 13.2.2 22.5 6.6 26.1 1.9 1.1 4 1.6 6.4 1.6 7.1 0 16-5.2 24.9-13.9 9 8.7 17.9 13.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9-8.3zm22.2 21l-3.6-6c3.8.5 7.4 1.1 10.8 1.9-1.1 3.3-2.3 6.8-3.8 10.3-1.1-2.1-2.2-4.2-3.4-6.2zM31.7 35c-1.7-10.5-.3-17.9 3.8-20.3 1-.6 2.2-.9 3.5-.9 6 0 13.5 4.9 21 12.3-3.5 3.8-7 8.2-10.4 13-5.8.5-11.3 1.4-16.5 2.5-.6-2.3-1-4.5-1.4-6.6zM7 64c0-4.7 5.7-9.7 15.7-13.4 2-.8 4.2-1.5 6.4-2.1 1.6 5 3.6 10.3 6 15.6-2.4 5.3-4.5 10.5-6 15.5C15.3 75.6 7 69.6 7 64zm28.5 49.3c-4.1-2.4-5.5-9.8-3.8-20.3.3-2.1.8-4.3 1.4-6.6 5.2 1.2 10.7 2 16.5 2.5 3.4 4.8 6.9 9.1 10.4 13-7.4 7.3-14.9 12.3-21 12.3-1.3 0-2.5-.3-3.5-.9zM96.3 93c1.7 10.5.3 17.9-3.8 20.3-1 .6-2.2.9-3.5.9-6 0-13.5-4.9-21-12.3 3.5-3.8 7-8.2 10.4-13 5.8-.5 11.3-1.4 16.5-2.5.6 2.3 1 4.5 1.4 6.6zm9-15.6c-2 .8-4.2 1.5-6.4 2.1-1.6-5-3.6-10.3-6-15.6 2.4-5.3 4.5-10.5 6-15.5 13.8 4 22.1 10 22.1 15.6 0 4.7-5.8 9.7-15.7 13.4z"})]})}):"javascript"===n?f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 128 128",children:[p("path",{fill:"#F0DB4F",d:"M1.408 1.408h125.184v125.185H1.408z"}),p("path",{fill:"#323330",d:"M116.347 96.736c-.917-5.711-4.641-10.508-15.672-14.981-3.832-1.761-8.104-3.022-9.377-5.926-.452-1.69-.512-2.642-.226-3.665.821-3.32 4.784-4.355 7.925-3.403 2.023.678 3.938 2.237 5.093 4.724 5.402-3.498 5.391-3.475 9.163-5.879-1.381-2.141-2.118-3.129-3.022-4.045-3.249-3.629-7.676-5.498-14.756-5.355l-3.688.477c-3.534.893-6.902 2.748-8.877 5.235-5.926 6.724-4.236 18.492 2.975 23.335 7.104 5.332 17.54 6.545 18.873 11.531 1.297 6.104-4.486 8.08-10.234 7.378-4.236-.881-6.592-3.034-9.139-6.949-4.688 2.713-4.688 2.713-9.508 5.485 1.143 2.499 2.344 3.63 4.26 5.795 9.068 9.198 31.76 8.746 35.83-5.176.165-.478 1.261-3.666.38-8.581zM69.462 58.943H57.753l-.048 30.272c0 6.438.333 12.34-.714 14.149-1.713 3.558-6.152 3.117-8.175 2.427-2.059-1.012-3.106-2.451-4.319-4.485-.333-.584-.583-1.036-.667-1.071l-9.52 5.83c1.583 3.249 3.915 6.069 6.902 7.901 4.462 2.678 10.459 3.499 16.731 2.059 4.082-1.189 7.604-3.652 9.448-7.401 2.666-4.915 2.094-10.864 2.07-17.444.06-10.735.001-21.468.001-32.237z"})]}):"php"===n?p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 800 400",children:p("g",{transform:"translate(-44.632 -141.55)",children:f("g",{transform:"matrix(8.3528 0 0 8.3119 -727.13 -3759.5)",children:[p("path",{d:"m99.974 479.48h14.204c4.1693 0.0354 7.1903 1.2367 9.063 3.604 1.8726 2.3674 2.491 5.6004 1.855 9.699-0.24737 1.8727-0.79504 3.71-1.643 5.512-0.8127 1.802-1.9434 3.4273-3.392 4.876-1.7667 1.8373-3.657 3.0033-5.671 3.498-2.014 0.49467-4.0987 0.742-6.254 0.742h-6.36l-2.014 10.07h-7.367l7.579-38.001m6.201 6.042-3.18 15.9c0.21198 0.0353 0.42398 0.053 0.636 0.053h0.742c3.392 0.0353 6.2186-0.30033 8.48-1.007 2.2613-0.74199 3.7806-3.3213 4.558-7.738 0.63597-3.71-0.00003-5.8476-1.908-6.413-1.8727-0.56531-4.2224-0.83031-7.049-0.795-0.42402 0.0353-0.83035 0.053-1.219 0.053-0.35335 0.00002-0.72435 0.00002-1.113 0l0.053-0.053"}),p("path",{d:"m133.49 469.36h7.314l-2.067 10.123h6.572c3.604 0.0707 6.2893 0.81269 8.056 2.226 1.802 1.4134 2.332 4.0987 1.59 8.056l-3.551 17.649h-7.42l3.392-16.854c0.35328-1.7666 0.2473-3.021-0.318-3.763-0.56536-0.74198-1.7844-1.113-3.657-1.113l-5.883-0.053-4.346 21.783h-7.314l7.632-38.054"}),p("path",{d:"m162.81 479.48h14.204c4.1693 0.0354 7.1903 1.2367 9.063 3.604 1.8726 2.3674 2.491 5.6004 1.855 9.699-0.24737 1.8727-0.79503 3.71-1.643 5.512-0.8127 1.802-1.9434 3.4273-3.392 4.876-1.7667 1.8373-3.657 3.0033-5.671 3.498-2.014 0.49467-4.0987 0.742-6.254 0.742h-6.36l-2.014 10.07h-7.367l7.579-38.001m6.201 6.042-3.18 15.9c0.21199 0.0353 0.42399 0.053 0.636 0.053h0.742c3.392 0.0353 6.2186-0.30033 8.48-1.007 2.2613-0.74199 3.7806-3.3213 4.558-7.738 0.63597-3.71-0.00003-5.8476-1.908-6.413-1.8727-0.56531-4.2224-0.83031-7.049-0.795-0.42402 0.0353-0.83035 0.053-1.219 0.053-0.35335 0.00002-0.72435 0.00002-1.113 0l0.053-0.053"})]})})}):"json"===n?f("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 160 160",children:[f("defs",{children:[f("linearGradient",{id:"a",children:[p("stop",{offset:"0"}),p("stop",{offset:"1",stopColor:"#fff"})]}),p("linearGradient",{x1:"-553.27",y1:"525.908",x2:"-666.116",y2:"413.045",id:"c",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.99884 0 0 .9987 689.008 -388.844)"}),p("linearGradient",{x1:"-666.117",y1:"413.045",x2:"-553.27",y2:"525.908",id:"b",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.99884 0 0 .9987 689.008 -388.844)"})]}),p("path",{d:"M79.865 119.1c35.397 48.255 70.04-13.469 69.988-50.587-.06-43.886-44.54-68.414-70.017-68.414C38.943.1 0 33.895 0 80.135 0 131.531 44.64 160 79.836 160c-7.965-1.147-34.507-6.834-34.863-67.967-.24-41.346 13.487-57.865 34.805-50.599.477.177 23.514 9.265 23.514 38.95 0 29.56-23.427 38.716-23.427 38.716z",style:{marker:"none"},color:"#000",fill:"url(#b)",fillRule:"evenodd",overflow:"visible"}),p("path",{d:"M79.823 41.4C56.433 33.34 27.78 52.618 27.78 91.23c0 63.048 46.72 68.77 52.384 68.77C121.057 160 160 126.204 160 79.964 160 28.568 115.36.1 80.164.1c9.749-1.35 52.541 10.55 52.541 69.037 0 38.141-31.953 58.905-52.735 50.033-.478-.177-23.514-9.264-23.514-38.95 0-29.56 23.367-38.818 23.367-38.818z",style:{marker:"none"},color:"#000",fill:"url(#c)",fillRule:"evenodd",overflow:"visible"})]}):void 0),selection:e};var n}}}),$=m({name:"@sanity/code-input",schema:{types:[Q]}});export{X as PreviewCode,$ as codeInput,Q as codeSchema,q as codeTypeName};
|
|
2
|
-
//# sourceMappingURL=index.esm.js.map
|
package/lib/index.esm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/createHighlightMarkers.ts","../src/config.ts","../src/ace-editor/AceEditorLazy.tsx","../src/CodeInput.tsx","../src/PreviewCode.tsx","../src/schema.tsx","../src/getMedia.tsx","../src/index.ts"],"sourcesContent":["import type {IMarker} from 'react-ace'\nimport {css} from 'styled-components'\n\nexport const highlightMarkersCSS = css`\n .ace_editor_markers_highlight {\n position: absolute;\n background-color: ${({theme}) => theme.sanity.color.solid.primary.enabled.bg};\n opacity: 0.2;\n width: 100% !important;\n border-radius: 0 !important;\n }\n`\n\nexport default function createHighlightMarkers(rows: number[]): IMarker[] {\n return rows.map((row) => ({\n startRow: Number(row) - 1,\n startCol: 0,\n endRow: Number(row) - 1,\n endCol: +Infinity,\n className: 'ace_editor_markers_highlight',\n type: 'screenLine',\n inFront: true,\n }))\n}\n","import {CodeInputLanguage} from './types'\n\n// NOTE: MAKE SURE THESE ALIGN WITH IMPORTS IN ./ace-editor/editorSupport\nexport const SUPPORTED_LANGUAGES: CodeInputLanguage[] = [\n {title: 'Batch file', value: 'batchfile'},\n {title: 'C#', value: 'csharp'},\n {title: 'CSS', value: 'css'},\n {title: 'Go', value: 'golang'},\n {title: 'GROQ', value: 'groq'},\n {title: 'HTML', value: 'html'},\n {title: 'Java', value: 'java'},\n {title: 'JavaScript', value: 'javascript'},\n {title: 'JSON', value: 'json'},\n {title: 'JSX', value: 'jsx'},\n {title: 'Markdown', value: 'markdown'},\n {title: 'MySQL', value: 'mysql'},\n {title: 'PHP', value: 'php'},\n {title: 'Plain text', value: 'text'},\n {title: 'Python', value: 'python'},\n {title: 'Ruby', value: 'ruby'},\n {title: 'SASS', value: 'sass'},\n {title: 'SCSS', value: 'scss'},\n {title: 'sh', value: 'sh'},\n {title: 'TSX', value: 'tsx'},\n {title: 'TypeScript', value: 'typescript'},\n {title: 'XML', value: 'xml'},\n {title: 'YAML', value: 'yaml'},\n]\n\nexport const LANGUAGE_ALIASES: Record<string, string | undefined> = {js: 'javascript'}\n\nexport const SUPPORTED_THEMES = ['github', 'monokai', 'terminal', 'tomorrow']\n\nexport const DEFAULT_THEME = 'tomorrow'\nexport const DEFAULT_DARK_THEME = 'monokai'\n\nexport const ACE_SET_OPTIONS = {\n useSoftTabs: true,\n navigateWithinSoftTabs: true /* note only supported by ace v1.2.7 or higher */,\n}\n\nexport const ACE_EDITOR_PROPS = {$blockScrolling: true}\n\nexport const PATH_LANGUAGE = ['language']\nexport const PATH_CODE = ['code']\nexport const PATH_FILENAME = ['filename']\n","import React, {useEffect, useState} from 'react'\n\n/**\n * AceEditor loads window global directly when imported, which crashes in node envs.\n * This works around the issue by only importing ace-dependencies when window is defined.\n *\n * We only set the ace lazy component after mounting, to allow us to render null on the server,\n * and use suspense on the client. This will make hydration work correctly.\n */\nexport const AceEditorLazy = React.lazy(() => import('./editorSupport'))\n\nexport function useAceEditor() {\n const [mounted, setMounted] = useState(false)\n useEffect(() => {\n requestAnimationFrame(() => setMounted(true))\n }, [])\n\n return mounted ? AceEditorLazy : null\n}\n","/* eslint-disable react/jsx-handler-names */\nimport React, {Suspense, useCallback, useEffect, useImperativeHandle, useMemo, useRef} from 'react'\nimport {\n InputProps,\n ObjectSchemaType,\n StringInputProps,\n useColorScheme,\n FieldMember,\n MemberField,\n ObjectInputProps,\n set,\n setIfMissing,\n unset,\n} from 'sanity'\nimport {Card, Select, Stack, ThemeColorSchemeKey} from '@sanity/ui'\nimport styled from 'styled-components'\nimport createHighlightMarkers, {highlightMarkersCSS} from './createHighlightMarkers'\nimport {CodeInputLanguage, CodeInputValue} from './types'\nimport {\n ACE_EDITOR_PROPS,\n ACE_SET_OPTIONS,\n DEFAULT_DARK_THEME,\n DEFAULT_THEME,\n LANGUAGE_ALIASES,\n PATH_CODE,\n SUPPORTED_LANGUAGES,\n SUPPORTED_THEMES,\n} from './config'\nimport {useAceEditor} from './ace-editor/AceEditorLazy'\n\nexport type {CodeInputLanguage, CodeInputValue} from './types'\n\nconst EditorContainer = styled(Card)`\n position: relative;\n box-sizing: border-box;\n overflow: hidden;\n z-index: 0;\n\n .ace_editor {\n font-family: ${({theme}) => theme.sanity.fonts.code.family};\n font-size: ${({theme}) => theme.sanity.fonts.code.sizes[1]};\n line-height: inherit;\n }\n\n ${highlightMarkersCSS}\n\n &:not([disabled]):not([readonly]) {\n &:focus,\n &:focus-within {\n box-shadow: 0 0 0 2px ${({theme}) => theme.sanity.color.base.focusRing};\n background-color: ${({theme}) => theme.sanity.color.base.bg};\n border-color: ${({theme}) => theme.sanity.color.base.focusRing};\n }\n }\n`\n\n/**\n * @public\n */\nexport interface CodeOptions {\n theme?: string\n darkTheme?: string\n languageAlternatives?: CodeInputLanguage[]\n language?: string\n withFilename?: boolean\n}\n\n/**\n * @public\n */\nexport type CodeSchemaType = Omit<ObjectSchemaType, 'options'> & {\n options?: CodeOptions\n}\n\n/**\n * @public\n */\nexport type CodeInputProps = ObjectInputProps<CodeInputValue, CodeSchemaType> & {\n /** @internal */\n colorScheme?: ThemeColorSchemeKey\n}\n\n// Returns a string with the mode name if supported (because aliases), otherwise false\nfunction isSupportedLanguage(mode: string) {\n const alias = LANGUAGE_ALIASES[mode]\n\n if (alias) {\n return alias\n }\n\n const isSupported = SUPPORTED_LANGUAGES.find((lang) => lang.value === mode)\n if (isSupported) {\n return mode\n }\n\n return false\n}\n\nexport function CodeInput(props: CodeInputProps) {\n const {\n members,\n elementProps,\n onChange,\n onFocusPath,\n readOnly,\n renderField,\n renderInput,\n renderItem,\n renderPreview,\n schemaType: type,\n value,\n } = props\n\n const aceEditorRef = useRef<any>()\n\n const fieldMembers = useMemo(\n () => members.filter((member) => member.kind === 'field') as FieldMember[],\n [members]\n )\n\n const languageFieldMember = fieldMembers.find((member) => member.name === 'language')\n const filenameMember = fieldMembers.find((member) => member.name === 'filename')\n const codeFieldMember = fieldMembers.find((member) => member.name === 'code')\n\n useImperativeHandle(elementProps.ref, () => ({\n focus: () => {\n aceEditorRef?.current?.editor?.focus()\n },\n }))\n\n const handleCodeFocus = useCallback(() => {\n onFocusPath(PATH_CODE)\n }, [onFocusPath])\n\n const {scheme} = useColorScheme()\n\n const theme = useMemo(() => {\n const isLight = scheme === 'light'\n const preferredTheme = isLight ? type.options?.theme : type.options?.darkTheme\n const defaultTheme = isLight ? DEFAULT_THEME : DEFAULT_DARK_THEME\n return preferredTheme && SUPPORTED_THEMES.find((t) => t === preferredTheme)\n ? preferredTheme\n : defaultTheme\n }, [type, scheme])\n\n const handleToggleSelectLine = useCallback(\n (lineNumber: number) => {\n const editorSession = aceEditorRef.current?.editor?.getSession()\n const backgroundMarkers = editorSession?.getMarkers(true)\n const currentHighlightedLines = Object.keys(backgroundMarkers)\n .filter((key) => backgroundMarkers[key].type === 'screenLine')\n .map((key) => backgroundMarkers[key].range.start.row)\n const currentIndex = currentHighlightedLines.indexOf(lineNumber)\n if (currentIndex > -1) {\n // toggle remove\n currentHighlightedLines.splice(currentIndex, 1)\n } else {\n // toggle add\n currentHighlightedLines.push(lineNumber)\n currentHighlightedLines.sort()\n }\n onChange(\n set(\n currentHighlightedLines.map(\n (line) =>\n // ace starts at line (row) 0, but we store it starting at line 1\n line + 1\n ),\n ['highlightedLines']\n )\n )\n },\n [aceEditorRef, onChange]\n )\n\n const handleGutterMouseDown = useCallback(\n (event: any) => {\n const target = event.domEvent.target\n if (target.classList.contains('ace_gutter-cell')) {\n const row = event.getDocumentPosition().row\n handleToggleSelectLine(row)\n }\n },\n [handleToggleSelectLine]\n )\n\n useEffect(() => {\n const editor = aceEditorRef?.current?.editor\n return () => {\n editor?.session?.removeListener('guttermousedown', handleGutterMouseDown)\n }\n }, [aceEditorRef, handleGutterMouseDown])\n\n const handleEditorLoad = useCallback(\n (editor: any) => {\n editor?.on('guttermousedown', handleGutterMouseDown)\n },\n [handleGutterMouseDown]\n )\n\n const getLanguageAlternatives = useCallback((): {\n title: string\n value: string\n mode?: string\n }[] => {\n const languageAlternatives = type.options?.languageAlternatives\n if (!languageAlternatives) {\n return SUPPORTED_LANGUAGES\n }\n\n if (!Array.isArray(languageAlternatives)) {\n throw new Error(\n `'options.languageAlternatives' should be an array, got ${typeof languageAlternatives}`\n )\n }\n\n return languageAlternatives.reduce((acc: CodeInputLanguage[], {title, value: val, mode}) => {\n const alias = LANGUAGE_ALIASES[val]\n if (alias) {\n // eslint-disable-next-line no-console\n console.warn(\n `'options.languageAlternatives' lists a language with value \"%s\", which is an alias of \"%s\" - please replace the value to read \"%s\"`,\n val,\n alias,\n alias\n )\n\n return acc.concat({title, value: alias, mode: mode})\n }\n\n if (!mode && !SUPPORTED_LANGUAGES.find((lang) => lang.value === val)) {\n // eslint-disable-next-line no-console\n console.warn(\n `'options.languageAlternatives' lists a language which is not supported: \"%s\", syntax highlighting will be disabled.`,\n val\n )\n }\n\n return acc.concat({title, value: val, mode})\n }, [])\n }, [type])\n\n const handleCodeChange = useCallback(\n (code: string) => {\n const path = PATH_CODE\n const fixedLanguage = type.options?.language\n\n onChange([\n setIfMissing({_type: type.name, language: fixedLanguage}),\n code ? set(code, path) : unset(path),\n ])\n },\n [onChange, type]\n )\n\n const languages = getLanguageAlternatives().slice()\n\n const fixedLanguage = type.options?.language\n\n const language = value?.language || fixedLanguage\n\n // the language config from the schema\n const configured = languages.find((entry) => entry.value === language)\n\n // is the language officially supported (e.g. we import the mode by default)\n const supported = language && isSupportedLanguage(language)\n\n const mode = configured?.mode || (supported ? language : 'text')\n\n const renderLanguageInput = useCallback(\n (inputProps: Omit<InputProps, 'renderDefault'>) => {\n return (\n <Select\n {...(inputProps as StringInputProps)}\n onChange={(e) => {\n const newValue = e.currentTarget.value\n inputProps.onChange(newValue ? set(newValue) : unset())\n }}\n >\n {languages.map((lang: {title: string; value: string}) => (\n <option key={lang.value} value={lang.value}>\n {lang.title}\n </option>\n ))}\n </Select>\n )\n },\n [languages]\n )\n\n const AceEditor = useAceEditor()\n\n const renderCodeInput = useCallback(\n (inputProps) => {\n return (\n <EditorContainer radius={1} shadow={1} readOnly={readOnly}>\n {AceEditor && (\n <Suspense fallback={<div>Loading code editor...</div>}>\n <AceEditor\n ref={aceEditorRef}\n mode={mode}\n theme={theme}\n width=\"100%\"\n onChange={handleCodeChange}\n name={inputProps.id}\n value={inputProps.value}\n markers={\n value && value.highlightedLines\n ? createHighlightMarkers(value.highlightedLines)\n : undefined\n }\n onLoad={handleEditorLoad}\n readOnly={readOnly}\n tabSize={2}\n wrapEnabled\n setOptions={ACE_SET_OPTIONS}\n editorProps={ACE_EDITOR_PROPS}\n onFocus={handleCodeFocus}\n onBlur={elementProps.onBlur}\n />\n </Suspense>\n )}\n </EditorContainer>\n )\n },\n [\n AceEditor,\n theme,\n handleCodeChange,\n handleCodeFocus,\n handleEditorLoad,\n mode,\n elementProps.onBlur,\n readOnly,\n value,\n ]\n )\n\n return (\n <Stack space={4}>\n {languageFieldMember && (\n <MemberField\n member={languageFieldMember}\n renderItem={renderItem}\n renderField={renderField}\n renderInput={renderLanguageInput}\n renderPreview={renderPreview}\n />\n )}\n\n {type.options?.withFilename && filenameMember && (\n <MemberField\n member={filenameMember}\n renderItem={renderItem}\n renderField={renderField}\n renderInput={renderInput}\n renderPreview={renderPreview}\n />\n )}\n\n {codeFieldMember && (\n <MemberField\n member={codeFieldMember}\n renderInput={renderCodeInput}\n renderItem={renderItem}\n renderField={renderField}\n renderPreview={renderPreview}\n />\n )}\n </Stack>\n )\n}\n","import React, {Suspense, useCallback, useEffect, useRef} from 'react'\nimport styled from 'styled-components'\nimport {Box} from '@sanity/ui'\nimport {ACE_EDITOR_PROPS, ACE_SET_OPTIONS} from './config'\nimport createHighlightMarkers from './createHighlightMarkers'\nimport {CodeInputValue} from './types'\nimport {useAceEditor} from './ace-editor/AceEditorLazy'\nimport {CodeSchemaType} from './CodeInput'\n\nconst PreviewContainer = styled(Box)`\n position: relative;\n`\n\nconst PreviewInner = styled(Box)`\n background-color: #272822;\n\n .ace_editor {\n box-sizing: border-box;\n cursor: default;\n pointer-events: none;\n }\n\n .ace_content {\n box-sizing: border-box;\n overflow: hidden;\n }\n`\n\n/**\n * @public\n */\nexport interface PreviewCodeProps {\n type?: CodeSchemaType\n value?: {selection?: CodeInputValue}\n}\n\n/**\n * @public\n */\nexport default function PreviewCode(props: PreviewCodeProps) {\n const aceEditorRef = useRef<any>()\n\n useEffect(() => {\n if (!aceEditorRef?.current) return\n\n const editor = aceEditorRef.current?.editor\n\n if (editor) {\n // Avoid cursor and focus tracking by Ace\n editor.renderer.$cursorLayer.element.style.opacity = 0\n editor.textInput.getElement().disabled = true\n }\n }, [])\n\n const handleEditorChange = useCallback(() => {\n // do nothing when the editor changes\n }, [])\n\n const {value, type} = props\n const fixedLanguage = type?.options?.language\n\n const selection = value?.selection\n const mode = selection?.language || fixedLanguage || 'text'\n\n const AceEditor = useAceEditor()\n return (\n <PreviewContainer>\n <PreviewInner padding={4}>\n {AceEditor && (\n <Suspense fallback={<div>Loading code preview...</div>}>\n <AceEditor\n ref={aceEditorRef}\n focus={false}\n mode={mode}\n theme=\"monokai\"\n width=\"100%\"\n onChange={handleEditorChange}\n maxLines={200}\n readOnly\n wrapEnabled\n showPrintMargin={false}\n highlightActiveLine={false}\n cursorStart={-1}\n value={selection?.code || ''}\n markers={\n selection?.highlightedLines\n ? createHighlightMarkers(selection.highlightedLines)\n : undefined\n }\n tabSize={2}\n showGutter={false}\n setOptions={ACE_SET_OPTIONS}\n editorProps={ACE_EDITOR_PROPS}\n />\n </Suspense>\n )}\n </PreviewInner>\n </PreviewContainer>\n )\n}\n","import {CodeBlockIcon} from '@sanity/icons'\nimport {CodeInput, CodeOptions} from './CodeInput'\nimport PreviewCode, {PreviewCodeProps} from './PreviewCode'\nimport {getMedia} from './getMedia'\nimport {defineType, ObjectDefinition} from 'sanity'\n\nexport type {CodeInputProps, CodeSchemaType} from './CodeInput'\n\nexport type {CodeInputLanguage, CodeInputValue} from './types'\nexport type {PreviewCode, PreviewCodeProps, CodeInput}\n\n/**\n * @public\n */\nexport const codeTypeName = 'code' as const\n\n/**\n * @public\n */\nexport interface CodeDefinition extends Omit<ObjectDefinition, 'type' | 'fields' | 'options'> {\n type: typeof codeTypeName\n options?: CodeOptions\n}\n\ndeclare module '@sanity/types' {\n // makes type: 'code' narrow correctly when using defineType/defineField/defineArrayMember\n export interface IntrinsicDefinitions {\n code: CodeDefinition\n }\n}\n\n/**\n * @public\n */\nexport const codeSchema = defineType({\n name: 'code',\n type: 'object',\n title: 'Code',\n components: {input: CodeInput, preview: PreviewCode},\n icon: CodeBlockIcon,\n fields: [\n {\n name: 'language',\n title: 'Language',\n type: 'string',\n },\n {\n name: 'filename',\n title: 'Filename',\n type: 'string',\n },\n {\n title: 'Code',\n name: 'code',\n type: 'text',\n },\n {\n title: 'Highlighted lines',\n name: 'highlightedLines',\n type: 'array',\n of: [\n {\n type: 'number',\n title: 'Highlighted line',\n },\n ],\n },\n ],\n preview: {\n select: {\n language: 'language',\n code: 'code',\n filename: 'filename',\n highlightedLines: 'highlightedLines',\n },\n prepare: (value: {\n language?: string\n code?: string\n filename?: string\n highlightedLines?: number[]\n }) => {\n return {\n title: value.filename || (value.language || 'unknown').toUpperCase(),\n media: getMedia(value?.language),\n selection: value,\n }\n },\n },\n})\n","import React from 'react'\n\nexport function getMedia(language?: string) {\n if (language === 'jsx') {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128 128\">\n <g fill=\"#61DAFB\">\n <circle cx=\"64\" cy=\"64\" r=\"11.4\" />\n <path d=\"M107.3 45.2c-2.2-.8-4.5-1.6-6.9-2.3.6-2.4 1.1-4.8 1.5-7.1 2.1-13.2-.2-22.5-6.6-26.1-1.9-1.1-4-1.6-6.4-1.6-7 0-15.9 5.2-24.9 13.9-9-8.7-17.9-13.9-24.9-13.9-2.4 0-4.5.5-6.4 1.6-6.4 3.7-8.7 13-6.6 26.1.4 2.3.9 4.7 1.5 7.1-2.4.7-4.7 1.4-6.9 2.3C8.2 50 1.4 56.6 1.4 64s6.9 14 19.3 18.8c2.2.8 4.5 1.6 6.9 2.3-.6 2.4-1.1 4.8-1.5 7.1-2.1 13.2.2 22.5 6.6 26.1 1.9 1.1 4 1.6 6.4 1.6 7.1 0 16-5.2 24.9-13.9 9 8.7 17.9 13.9 24.9 13.9 2.4 0 4.5-.5 6.4-1.6 6.4-3.7 8.7-13 6.6-26.1-.4-2.3-.9-4.7-1.5-7.1 2.4-.7 4.7-1.4 6.9-2.3 12.5-4.8 19.3-11.4 19.3-18.8s-6.8-14-19.3-18.8zM92.5 14.7c4.1 2.4 5.5 9.8 3.8 20.3-.3 2.1-.8 4.3-1.4 6.6-5.2-1.2-10.7-2-16.5-2.5-3.4-4.8-6.9-9.1-10.4-13 7.4-7.3 14.9-12.3 21-12.3 1.3 0 2.5.3 3.5.9zM81.3 74c-1.8 3.2-3.9 6.4-6.1 9.6-3.7.3-7.4.4-11.2.4-3.9 0-7.6-.1-11.2-.4-2.2-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-9.8-3.8-20.3.3-2.1.8-4.3 1.4-6.6 5.2 1.2 10.7 2 16.5 2.5 3.4 4.8 6.9 9.1 10.4 13-7.4 7.3-14.9 12.3-21 12.3-1.3 0-2.5-.3-3.5-.9zM96.3 93c1.7 10.5.3 17.9-3.8 20.3-1 .6-2.2.9-3.5.9-6 0-13.5-4.9-21-12.3 3.5-3.8 7-8.2 10.4-13 5.8-.5 11.3-1.4 16.5-2.5.6 2.3 1 4.5 1.4 6.6zm9-15.6c-2 .8-4.2 1.5-6.4 2.1-1.6-5-3.6-10.3-6-15.6 2.4-5.3 4.5-10.5 6-15.5 13.8 4 22.1 10 22.1 15.6 0 4.7-5.8 9.7-15.7 13.4z\" />\n </g>\n </svg>\n )\n }\n\n if (language === 'javascript') {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 128 128\">\n <path fill=\"#F0DB4F\" d=\"M1.408 1.408h125.184v125.185H1.408z\" />\n <path\n fill=\"#323330\"\n d=\"M116.347 96.736c-.917-5.711-4.641-10.508-15.672-14.981-3.832-1.761-8.104-3.022-9.377-5.926-.452-1.69-.512-2.642-.226-3.665.821-3.32 4.784-4.355 7.925-3.403 2.023.678 3.938 2.237 5.093 4.724 5.402-3.498 5.391-3.475 9.163-5.879-1.381-2.141-2.118-3.129-3.022-4.045-3.249-3.629-7.676-5.498-14.756-5.355l-3.688.477c-3.534.893-6.902 2.748-8.877 5.235-5.926 6.724-4.236 18.492 2.975 23.335 7.104 5.332 17.54 6.545 18.873 11.531 1.297 6.104-4.486 8.08-10.234 7.378-4.236-.881-6.592-3.034-9.139-6.949-4.688 2.713-4.688 2.713-9.508 5.485 1.143 2.499 2.344 3.63 4.26 5.795 9.068 9.198 31.76 8.746 35.83-5.176.165-.478 1.261-3.666.38-8.581zM69.462 58.943H57.753l-.048 30.272c0 6.438.333 12.34-.714 14.149-1.713 3.558-6.152 3.117-8.175 2.427-2.059-1.012-3.106-2.451-4.319-4.485-.333-.584-.583-1.036-.667-1.071l-9.52 5.83c1.583 3.249 3.915 6.069 6.902 7.901 4.462 2.678 10.459 3.499 16.731 2.059 4.082-1.189 7.604-3.652 9.448-7.401 2.666-4.915 2.094-10.864 2.07-17.444.06-10.735.001-21.468.001-32.237z\"\n />\n </svg>\n )\n }\n\n if (language === 'php') {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 800 400\">\n <g transform=\"translate(-44.632 -141.55)\">\n <g transform=\"matrix(8.3528 0 0 8.3119 -727.13 -3759.5)\">\n <path d=\"m99.974 479.48h14.204c4.1693 0.0354 7.1903 1.2367 9.063 3.604 1.8726 2.3674 2.491 5.6004 1.855 9.699-0.24737 1.8727-0.79504 3.71-1.643 5.512-0.8127 1.802-1.9434 3.4273-3.392 4.876-1.7667 1.8373-3.657 3.0033-5.671 3.498-2.014 0.49467-4.0987 0.742-6.254 0.742h-6.36l-2.014 10.07h-7.367l7.579-38.001m6.201 6.042-3.18 15.9c0.21198 0.0353 0.42398 0.053 0.636 0.053h0.742c3.392 0.0353 6.2186-0.30033 8.48-1.007 2.2613-0.74199 3.7806-3.3213 4.558-7.738 0.63597-3.71-0.00003-5.8476-1.908-6.413-1.8727-0.56531-4.2224-0.83031-7.049-0.795-0.42402 0.0353-0.83035 0.053-1.219 0.053-0.35335 0.00002-0.72435 0.00002-1.113 0l0.053-0.053\" />\n <path d=\"m133.49 469.36h7.314l-2.067 10.123h6.572c3.604 0.0707 6.2893 0.81269 8.056 2.226 1.802 1.4134 2.332 4.0987 1.59 8.056l-3.551 17.649h-7.42l3.392-16.854c0.35328-1.7666 0.2473-3.021-0.318-3.763-0.56536-0.74198-1.7844-1.113-3.657-1.113l-5.883-0.053-4.346 21.783h-7.314l7.632-38.054\" />\n <path d=\"m162.81 479.48h14.204c4.1693 0.0354 7.1903 1.2367 9.063 3.604 1.8726 2.3674 2.491 5.6004 1.855 9.699-0.24737 1.8727-0.79503 3.71-1.643 5.512-0.8127 1.802-1.9434 3.4273-3.392 4.876-1.7667 1.8373-3.657 3.0033-5.671 3.498-2.014 0.49467-4.0987 0.742-6.254 0.742h-6.36l-2.014 10.07h-7.367l7.579-38.001m6.201 6.042-3.18 15.9c0.21199 0.0353 0.42399 0.053 0.636 0.053h0.742c3.392 0.0353 6.2186-0.30033 8.48-1.007 2.2613-0.74199 3.7806-3.3213 4.558-7.738 0.63597-3.71-0.00003-5.8476-1.908-6.413-1.8727-0.56531-4.2224-0.83031-7.049-0.795-0.42402 0.0353-0.83035 0.053-1.219 0.053-0.35335 0.00002-0.72435 0.00002-1.113 0l0.053-0.053\" />\n </g>\n </g>\n </svg>\n )\n }\n\n if (language === 'json') {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 0 160 160\"\n >\n <defs>\n <linearGradient id=\"a\">\n <stop offset=\"0\" />\n <stop offset=\"1\" stopColor=\"#fff\" />\n </linearGradient>\n <linearGradient\n x1=\"-553.27\"\n y1=\"525.908\"\n x2=\"-666.116\"\n y2=\"413.045\"\n id=\"c\"\n xlinkHref=\"#a\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(.99884 0 0 .9987 689.008 -388.844)\"\n />\n <linearGradient\n x1=\"-666.117\"\n y1=\"413.045\"\n x2=\"-553.27\"\n y2=\"525.908\"\n id=\"b\"\n xlinkHref=\"#a\"\n gradientUnits=\"userSpaceOnUse\"\n gradientTransform=\"matrix(.99884 0 0 .9987 689.008 -388.844)\"\n />\n </defs>\n <path\n d=\"M79.865 119.1c35.397 48.255 70.04-13.469 69.988-50.587-.06-43.886-44.54-68.414-70.017-68.414C38.943.1 0 33.895 0 80.135 0 131.531 44.64 160 79.836 160c-7.965-1.147-34.507-6.834-34.863-67.967-.24-41.346 13.487-57.865 34.805-50.599.477.177 23.514 9.265 23.514 38.95 0 29.56-23.427 38.716-23.427 38.716z\"\n style={{marker: 'none'}}\n color=\"#000\"\n fill=\"url(#b)\"\n fillRule=\"evenodd\"\n overflow=\"visible\"\n />\n <path\n d=\"M79.823 41.4C56.433 33.34 27.78 52.618 27.78 91.23c0 63.048 46.72 68.77 52.384 68.77C121.057 160 160 126.204 160 79.964 160 28.568 115.36.1 80.164.1c9.749-1.35 52.541 10.55 52.541 69.037 0 38.141-31.953 58.905-52.735 50.033-.478-.177-23.514-9.264-23.514-38.95 0-29.56 23.367-38.818 23.367-38.818z\"\n style={{marker: 'none'}}\n color=\"#000\"\n fill=\"url(#c)\"\n fillRule=\"evenodd\"\n overflow=\"visible\"\n />\n </svg>\n )\n }\n\n return undefined\n}\n","import {createPlugin} from 'sanity'\n\nimport {codeSchema, codeTypeName, CodeDefinition} from './schema'\nimport PreviewCode, {PreviewCodeProps} from './PreviewCode'\nexport type {CodeInputProps, CodeSchemaType, CodeOptions} from './CodeInput'\n\nexport type {CodeInputLanguage, CodeInputValue} from './types'\n\nexport {PreviewCode, type PreviewCodeProps}\nexport {codeSchema, codeTypeName}\nexport type {CodeDefinition}\n/**\n * @public\n */\nexport const codeInput = createPlugin({\n name: '@sanity/code-input',\n schema: {types: [codeSchema]},\n})\n"],"names":["highlightMarkersCSS","css","_templateObject","_taggedTemplateLiteral","_ref","theme","sanity","color","solid","primary","enabled","bg","createHighlightMarkers","rows","map","row","startRow","Number","startCol","endRow","endCol","Infinity","className","type","inFront","SUPPORTED_LANGUAGES","title","value","LANGUAGE_ALIASES","js","SUPPORTED_THEMES","ACE_SET_OPTIONS","useSoftTabs","navigateWithinSoftTabs","ACE_EDITOR_PROPS","$blockScrolling","PATH_CODE","AceEditorLazy","React","lazy","import","useAceEditor","mounted","setMounted","useState","useEffect","requestAnimationFrame","EditorContainer","styled","Card","_templateObject2","_ref2","fonts","code","family","_ref3","sizes","_ref4","base","focusRing","_ref5","_ref6","PreviewContainer","Box","_templateObject3","PreviewInner","_templateObject4","PreviewCode","props","_a","aceEditorRef","useRef","current","editor","renderer","$cursorLayer","element","style","opacity","textInput","getElement","disabled","handleEditorChange","useCallback","fixedLanguage","options","language","selection","mode","AceEditor","jsx","children","padding","Suspense","fallback","ref","focus","width","onChange","maxLines","readOnly","wrapEnabled","showPrintMargin","highlightActiveLine","cursorStart","markers","highlightedLines","tabSize","showGutter","setOptions","editorProps","codeTypeName","codeSchema","defineType","name","components","input","_b","members","elementProps","onFocusPath","renderField","renderInput","renderItem","renderPreview","schemaType","fieldMembers","useMemo","filter","member","kind","languageFieldMember","find","filenameMember","codeFieldMember","useImperativeHandle","handleCodeFocus","scheme","useColorScheme","isLight","preferredTheme","darkTheme","defaultTheme","t","handleToggleSelectLine","lineNumber","editorSession","getSession","backgroundMarkers","getMarkers","currentHighlightedLines","Object","keys","key","range","start","currentIndex","indexOf","splice","push","sort","set","line","handleGutterMouseDown","event","domEvent","target","classList","contains","getDocumentPosition","session","removeListener","handleEditorLoad","on","getLanguageAlternatives","languageAlternatives","Array","isArray","Error","concat","reduce","acc","_ref7","val","alias","console","warn","lang","handleCodeChange","path","setIfMissing","_type","unset","languages","slice","configured","entry","supported","isSupportedLanguage","renderLanguageInput","inputProps","Select","e","newValue","currentTarget","renderCodeInput","radius","shadow","id","onLoad","onFocus","onBlur","jsxs","Stack","space","MemberField","withFilename","preview","icon","CodeBlockIcon","fields","of","select","filename","prepare","toUpperCase","media","xmlns","viewBox","fill","cx","cy","r","d","transform","xmlnsXlink","offset","stopColor","x1","y1","x2","y2","xlinkHref","gradientUnits","gradientTransform","marker","fillRule","overflow","codeInput","createPlugin","schema","types"],"mappings":"uwCAGO,MAAMA,EAAsBC,EAGXC,IAAAA,EAAAC,EAAA,CAAA,uFAAA,iGAAAC,IAAA,IAACC,MAACA,GAAFD,EAAA,OAAaC,EAAMC,OAAOC,MAAMC,MAAMC,QAAQC,QAAQC,EAAtD,IAOxB,SAAwBC,EAAuBC,GACtC,OAAAA,EAAKC,KAAKC,IAAS,CACxBC,SAAUC,OAAOF,GAAO,EACxBG,SAAU,EACVC,OAAQF,OAAOF,GAAO,EACtBK,OAAQC,IACRC,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