@actualwave/react-native-codeditor 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +67 -7
- package/SKILL.md +504 -0
- package/THIRD_PARTY_NOTICES +120 -0
- package/app.plugin.js +1 -1
- package/lib/module/CodeEditor.js +69 -2
- package/lib/typescript/src/CodeEditor.d.ts +20 -2
- package/lib/typescript/src/EditorAPI.d.ts +42 -1
- package/lib/typescript/src/WebViewAPI.d.ts +4 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/package.json +12 -4
- package/src/assets/codemirror/@actualwave_codemirror-lang-embed-core.js +39 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-embed-css.js +19 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-embed-glsl.js +1 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-embed-graphql.js +50 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-embed-icu-messageformat.js +1 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-embed-react-native.js +6 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-embed-sksl.js +7 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-embed-sql.js +5 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-embed-tailwind.js +63 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-glsl.js +20 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-icu-messageformat.js +11 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-js-completion.js +72 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-react-native.js +71 -0
- package/src/assets/codemirror/@actualwave_codemirror-lang-sksl.js +7 -2
- package/src/assets/codemirror/@codemirror_autocomplete.js +9 -9
- package/src/assets/codemirror/@codemirror_commands.js +86 -86
- package/src/assets/codemirror/@codemirror_lang-css.js +2 -2
- package/src/assets/codemirror/@codemirror_lang-go.js +1 -1
- package/src/assets/codemirror/@codemirror_lang-html.js +1 -1
- package/src/assets/codemirror/@codemirror_lang-javascript.js +4 -4
- package/src/assets/codemirror/@codemirror_lang-jinja.js +1 -1
- package/src/assets/codemirror/@codemirror_lang-json.js +1 -1
- package/src/assets/codemirror/@codemirror_lang-less.js +1 -1
- package/src/assets/codemirror/@codemirror_lang-liquid.js +1 -1
- package/src/assets/codemirror/@codemirror_lang-markdown.js +2 -2
- package/src/assets/codemirror/@codemirror_lang-python.js +1 -1
- package/src/assets/codemirror/@codemirror_lang-sql.js +4 -4
- package/src/assets/codemirror/@codemirror_lang-xml.js +1 -1
- package/src/assets/codemirror/@codemirror_language.js +11 -11
- package/src/assets/codemirror/@codemirror_legacy-modes_mode_clike.js +1 -1
- package/src/assets/codemirror/@codemirror_legacy-modes_mode_mathematica.js +1 -1
- package/src/assets/codemirror/@codemirror_legacy-modes_mode_oz.js +1 -1
- package/src/assets/codemirror/@codemirror_legacy-modes_mode_verilog.js +1 -1
- package/src/assets/codemirror/@codemirror_lint.js +5 -5
- package/src/assets/codemirror/@codemirror_merge.js +4 -4
- package/src/assets/codemirror/@codemirror_search.js +8 -8
- package/src/assets/codemirror/@codemirror_state.js +1 -1
- package/src/assets/codemirror/@codemirror_theme-one-dark.js +3 -3
- package/src/assets/codemirror/@codemirror_view.js +6 -6
- package/src/assets/codemirror/@lezer_common.js +2 -2
- package/src/assets/codemirror/@lezer_css.js +1 -1
- package/src/assets/codemirror/@lezer_javascript.js +1 -1
- package/src/assets/codemirror/@lezer_lr.js +1 -1
- package/src/assets/codemirror/@lezer_markdown.js +4 -4
- package/src/assets/codemirror/@lezer_sass.js +1 -1
- package/src/assets/codemirror/_core.js +129 -129
- package/src/assets/codemirror-editor.umd.js +130 -17
- package/src/assets/editor.html +37 -2
- package/lib/typescript/app.plugin.d.ts +0 -3
- package/lib/typescript/babel.config.d.ts +0 -10
- package/lib/typescript/react-native.config.d.ts +0 -2
- package/lib/typescript/scripts/copy-assets.d.ts +0 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
async function moduleInitFunction(requireAsyncModule,exports={}){function requireCodemirrorLangEmbedSksl(){// @actualwave/codemirror-lang-sksl exports a ready-to-use LRLanguage
|
|
2
|
+
// (skslLanguage) directly, same shape as cm6-graphql's graphqlLanguage — no
|
|
3
|
+
// factory call needed for the grammar itself. This is the same grammar the
|
|
4
|
+
// `.sksl` file mode uses; see SINGLE_FILE_PROTOTYPES.md's "Relationship to
|
|
5
|
+
// .sksl files" section. The sksl() factory's `.support` carries the
|
|
6
|
+
// completion source, so it's still called for that.
|
|
7
|
+
function createEmbedding(){return{matcher:matchTagName("sksl"),language:skslLanguage,extension:sksl().support}}if(hasRequiredCodemirrorLangEmbedSksl)return codemirrorLangEmbedSksl;hasRequiredCodemirrorLangEmbedSksl=1;const{skslLanguage,sksl}=require$$0,{matchTagName}=require$$1;return codemirrorLangEmbedSksl={createEmbedding},codemirrorLangEmbedSksl}const module={exports:exports};var codemirrorLangEmbedSksl,hasRequiredCodemirrorLangEmbedSksl,require$$0=await requireAsyncModule("@actualwave/codemirror-lang-sksl"),require$$1=await requireAsyncModule("@actualwave/codemirror-lang-embed-core"),codemirrorLangEmbedSkslExports=requireCodemirrorLangEmbedSksl(),index=/*@__PURE__*/function getDefaultExportFromCjs(x){return x}(codemirrorLangEmbedSkslExports);return module.exports=index,module.exports}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
async function moduleInitFunction(requireAsyncModule,exports={}){function requireCodemirrorLangEmbedSql(){// config is passed through to @codemirror/lang-sql's sql() (dialect, schema,
|
|
2
|
+
// etc.) — see that package's SQLConfig type. sql()'s `.support` always
|
|
3
|
+
// includes keyword completion (schema completion is additive on top, only if
|
|
4
|
+
// config.schema is given) — see SQLConfig in @codemirror/lang-sql source.
|
|
5
|
+
function createEmbedding(config){const support=sql(config);return{matcher:matchTagName("sql"),language:support.language,extension:support.support}}if(hasRequiredCodemirrorLangEmbedSql)return codemirrorLangEmbedSql;hasRequiredCodemirrorLangEmbedSql=1;const{sql}=require$$0,{matchTagName}=require$$1;return codemirrorLangEmbedSql={createEmbedding},codemirrorLangEmbedSql}const module={exports:exports};var codemirrorLangEmbedSql,hasRequiredCodemirrorLangEmbedSql,require$$0=await requireAsyncModule("@codemirror/lang-sql"),require$$1=await requireAsyncModule("@actualwave/codemirror-lang-embed-core"),codemirrorLangEmbedSqlExports=requireCodemirrorLangEmbedSql(),index=/*@__PURE__*/function getDefaultExportFromCjs(x){return x}(codemirrorLangEmbedSqlExports);return module.exports=index,module.exports}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
async function moduleInitFunction(requireAsyncModule,exports={}){function requireData(){function add(category,...names){for(const name of names)name&&CLASSES.set(name,category)}function addScaled(category,prefixes,scales){for(const prefix of prefixes)for(const scale of scales)add(category,`${prefix}-${scale}`)}// --- Spacing: padding, margin (+ negative), gap, space-between ---
|
|
2
|
+
if(hasRequiredData)return data;hasRequiredData=1;// Categorized Tailwind/twrnc utility class list, generated from small scale
|
|
3
|
+
// tables rather than hand-listed one by one — see TODO.md item 6: "Category
|
|
4
|
+
// must be data-driven per class, not prefix-derived. Tailwind overloads
|
|
5
|
+
// prefixes across categories (`text-lg` is typography, `text-red-500` is
|
|
6
|
+
// color, `text-center` is alignment/layout, all starting with `text-`)."
|
|
7
|
+
// Web-only categories (grid, filters, tables, SVG) are intentionally omitted
|
|
8
|
+
// — this targets the RN-relevant subset twrnc actually implements.
|
|
9
|
+
const SPACING_SCALE=["0","px","0.5","1","1.5","2","2.5","3","3.5","4","5","6","7","8","9","10","11","12","14","16","20","24","28","32","36","40","44","48","52","56","60","64","72","80","96"],FRACTIONS=["1/2","1/3","2/3","1/4","2/4","3/4","1/5","2/5","3/5","4/5","1/6","2/6","3/6","4/6","5/6","1/12","2/12","3/12","4/12","5/12","6/12","7/12","8/12","9/12","10/12","11/12","full"],COLOR_NAMES=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],COLOR_SHADES=["50","100","200","300","400","500","600","700","800","900","950"],OPACITY_SCALE=["0","5","10","20","25","30","40","50","60","70","75","80","90","95","100"],ROUNDED_SIZES=["none","sm","","md","lg","xl","2xl","3xl","full"],ROUNDED_CORNERS=["t","r","b","l","tl","tr","br","bl"],CLASSES=new Map;// class -> category, built up by the add() calls below.
|
|
10
|
+
addScaled("spacing",["p","pt","pr","pb","pl","px","py"],SPACING_SCALE),addScaled("spacing",["m","mt","mr","mb","ml","mx","my"],SPACING_SCALE);for(const prefix of["m","mt","mr","mb","ml","mx","my"])for(const scale of SPACING_SCALE)add("spacing",`-${prefix}-${scale}`);addScaled("spacing",["gap","gap-x","gap-y"],SPACING_SCALE),addScaled("spacing",["space-x","space-y"],SPACING_SCALE),add("spacing","space-x-reverse","space-y-reverse");// --- Sizing: width/height (+ min/max), fractions, full/screen/auto ---
|
|
11
|
+
const SIZING_PREFIXES=["w","h","min-w","min-h","max-w","max-h"];addScaled("sizing",SIZING_PREFIXES,SPACING_SCALE),addScaled("sizing",SIZING_PREFIXES,FRACTIONS);for(const prefix of SIZING_PREFIXES)add("sizing",`${prefix}-auto`,`${prefix}-screen`,`${prefix}-min`,`${prefix}-max`,`${prefix}-fit`);// --- Layout: display, flexbox container/item, alignment, order ---
|
|
12
|
+
add("layout","flex","hidden","inline","inline-block","block"),add("layout","flex-row","flex-row-reverse","flex-col","flex-col-reverse"),add("layout","flex-wrap","flex-wrap-reverse","flex-nowrap"),add("layout","flex-1","flex-auto","flex-initial","flex-none"),add("layout","grow","grow-0","shrink","shrink-0"),addScaled("layout",["basis"],SPACING_SCALE),addScaled("layout",["basis"],FRACTIONS),add("layout","basis-auto"),add("layout","items-start","items-end","items-center","items-baseline","items-stretch"),add("layout","content-start","content-end","content-center","content-between","content-around","content-evenly"),add("layout","self-auto","self-start","self-end","self-center","self-stretch","self-baseline"),add("layout","justify-start","justify-end","justify-center","justify-between","justify-around","justify-evenly");for(let i=1;12>=i;i++)add("layout",`order-${i}`);add("layout","order-first","order-last","order-none"),add("positioning","absolute","relative","static"),addScaled("positioning",["inset","inset-x","inset-y","top","right","bottom","left"],SPACING_SCALE),add("positioning","z-0","z-10","z-20","z-30","z-40","z-50","z-auto"),add("typography","text-xs","text-sm","text-base","text-lg","text-xl","text-2xl","text-3xl","text-4xl","text-5xl","text-6xl"),add("typography","font-thin","font-extralight","font-light","font-normal","font-medium","font-semibold","font-bold","font-extrabold","font-black"),add("typography","italic","not-italic"),add("typography","text-left","text-center","text-right","text-justify"),add("typography","underline","line-through","no-underline"),add("typography","uppercase","lowercase","capitalize","normal-case"),add("typography","tracking-tighter","tracking-tight","tracking-normal","tracking-wide","tracking-wider","tracking-widest"),add("typography","leading-none","leading-tight","leading-snug","leading-normal","leading-relaxed","leading-loose"),addScaled("typography",["leading"],["3","4","5","6","7","8","9","10"]);// --- Colors: background/text/border color scales (distinct strings from the
|
|
13
|
+
// typography/border families above — e.g. `text-red-500` vs `text-lg`) ---
|
|
14
|
+
for(const prefix of["bg","text","border"]){for(const color of COLOR_NAMES)for(const shade of COLOR_SHADES)add("colors",`${prefix}-${color}-${shade}`);add("colors",`${prefix}-black`,`${prefix}-white`,`${prefix}-transparent`,`${prefix}-current`)}// --- Borders: width/side/style/radius (border *color* lives in "colors") ---
|
|
15
|
+
add("borders","border","border-0","border-2","border-4","border-8");for(const side of["t","r","b","l"])add("borders",`border-${side}`,`border-${side}-0`,`border-${side}-2`,`border-${side}-4`,`border-${side}-8`);add("borders","border-solid","border-dashed","border-dotted");for(const size of ROUNDED_SIZES)add("borders",size?`rounded-${size}`:"rounded");for(const corner of ROUNDED_CORNERS)for(const size of ROUNDED_SIZES)add("borders",size?`rounded-${corner}-${size}`:`rounded-${corner}`);// --- Effects: opacity, shadow ---
|
|
16
|
+
for(const value of OPACITY_SCALE)add("effects",`opacity-${value}`);add("effects","shadow","shadow-sm","shadow-md","shadow-lg","shadow-xl","shadow-2xl","shadow-none");/** @type {ReadonlyMap<string, string>} className -> category */const TAILWIND_CLASSES=CLASSES,TAILWIND_CLASS_NAMES=Array.from(CLASSES.keys()).sort(),TAILWIND_CATEGORIES=["layout","spacing","sizing","typography","colors","borders","effects","positioning"];/** Sorted array of all known class names, for completion filtering. *//** All category names, in the order documented by TODO.md item 6. */return data={TAILWIND_CLASSES,TAILWIND_CLASS_NAMES,TAILWIND_CATEGORIES},data}function requireCompletion(){// Finds the innermost TemplateString node at `pos` (if any) whose tag is `tw`.
|
|
17
|
+
// Mirrors embed-core's getTaggedTemplateTagPath usage in parseMixed, but
|
|
18
|
+
// driving a CompletionSource instead of a nested parser — see TODO.md item 6:
|
|
19
|
+
// "same tag-name-matching primitive used for parseMixed, just driving
|
|
20
|
+
// completions instead of a sub-parser."
|
|
21
|
+
function findTwTemplateAt(state,pos){const tree=syntaxTree(state),node=tree.resolveInner(pos,-1);for(let cur=node;cur;cur=cur.parent){if("TemplateString"!==cur.name)continue;const tagPath=getTaggedTemplateTagPath(cur,docAsInput(state.doc));if(tagPath&&1===tagPath.length&&"tw"===tagPath[0])return cur}return null}function isInsideContentRanges(pos,ranges){return ranges.some(r=>pos>=r.from&&pos<=r.to)}/**
|
|
22
|
+
* A `CompletionSource` (see @codemirror/autocomplete) that suggests Tailwind
|
|
23
|
+
* (twrnc) class names while the cursor is inside a `` tw`...` `` tagged
|
|
24
|
+
* template's literal content, and declines (returns null) everywhere else so
|
|
25
|
+
* normal JS/TSX completions are unaffected.
|
|
26
|
+
*/function tailwindCompletionSource(context){const templateNode=findTwTemplateAt(context.state,context.pos);if(!templateNode)return null;const ranges=templateContentRanges(templateNode);if(!isInsideContentRanges(context.pos,ranges))return null;const word=context.matchBefore(/[^\s`]*/);if(!word)return null;if(word.from===word.to&&!context.explicit)return null;const query=word.text,from=word.from;// Arbitrary-value bracket syntax (bg-[#123456], p-[13px]) — don't try to
|
|
27
|
+
// complete inside the brackets, just don't offer suggestions there (stretch
|
|
28
|
+
// goal per TODO.md item 6; v1 just avoids breaking on it).
|
|
29
|
+
if(query.includes("["))return null;const options=TAILWIND_CLASS_NAMES.filter(name=>name.startsWith(query)).map(label=>({label,type:"class"}));return options.length?{from,options,validFor:/^[^\s`]*$/}:null}if(hasRequiredCompletion)return completion;hasRequiredCompletion=1;const{syntaxTree}=require$$0,{getTaggedTemplateTagPath,templateContentRanges,docAsInput}=require$$1,{TAILWIND_CLASS_NAMES}=requireData();return completion={tailwindCompletionSource,findTwTemplateAt,isInsideContentRanges},completion}function requireDecoration(){// Collects every `tw`-tagged TemplateString's content ranges that intersect
|
|
30
|
+
// [from, to) — same tag-matching primitive embed-core uses for parseMixed and
|
|
31
|
+
// completion.js uses for the CompletionSource, just driving decoration this
|
|
32
|
+
// time (see TODO.md item 6).
|
|
33
|
+
function twContentRangesIn(state,from,to){const ranges=[];return syntaxTree(state).iterate({from,to,enter(node){if("TemplateString"===node.name){const tagPath=getTaggedTemplateTagPath(node.node,docAsInput(state.doc));if(tagPath&&1===tagPath.length&&"tw"===tagPath[0])for(const range of templateContentRanges(node.node))ranges.push(range)}}}),ranges}function buildDecorations(view){const builder=new RangeSetBuilder,seen=[];for(const{from,to}of view.visibleRanges)for(const range of twContentRangesIn(view.state,from,to))seen.push(range);// Visible ranges can overlap at chunk boundaries — dedupe by range identity
|
|
34
|
+
// (same node can't produce the same [from,to) twice from disjoint queries,
|
|
35
|
+
// but a template spanning multiple visible chunks could; sort+merge is
|
|
36
|
+
// unnecessary for correctness here since Decoration ranges just need
|
|
37
|
+
// ascending, non-overlapping input, and token matches within one template
|
|
38
|
+
// range never repeat).
|
|
39
|
+
seen.sort((a,b)=>a.from-b.from||a.to-b.to);const text=view.state.doc;for(const{from,to}of seen){const chunk=text.sliceString(from,to);TOKEN_RE.lastIndex=0;for(let match;match=TOKEN_RE.exec(chunk);){const token=match[0],category=TAILWIND_CLASSES.get(token);if(!category)continue;// unknown/arbitrary-value token — leave undecorated (v1)
|
|
40
|
+
const start=from+match.index;builder.add(start,start+token.length,decorationByCategory.get(category))}}return builder.finish()}// Mark decorations nest by facet precedence — the higher-precedence one
|
|
41
|
+
// becomes the *inner* DOM element (see @codemirror/view's Decoration.mark
|
|
42
|
+
// doc comment). @codemirror/language's syntaxHighlighting() wraps its
|
|
43
|
+
// treeHighlighter in Prec.high(...), so it paints `.tok-string` as the
|
|
44
|
+
// innermost span around the whole `tw`-tagged template content. Without
|
|
45
|
+
// out-precedencing that, our per-category `.cm-tw-*` span ends up as the
|
|
46
|
+
// *outer* element and `.tok-string`'s own color always wins (an element's
|
|
47
|
+
// own matching rule beats an ancestor's color regardless of specificity).
|
|
48
|
+
// Prec.highest here makes ours the inner span instead, so it wins.
|
|
49
|
+
if(hasRequiredDecoration)return decoration;hasRequiredDecoration=1;const{syntaxTree}=require$$0,{Decoration,ViewPlugin,EditorView}=require$$1$1,{RangeSetBuilder,Prec}=require$$2,{getTaggedTemplateTagPath,templateContentRanges,docAsInput}=require$$1,{TAILWIND_CLASSES,TAILWIND_CATEGORIES}=requireData(),TOKEN_RE=/[^\s`]+/g,decorationByCategory=new Map(TAILWIND_CATEGORIES.map(category=>[category,Decoration.mark({class:`cm-tw-${category}`})])),tailwindHighlightPlugin=Prec.highest(ViewPlugin.fromClass(class{constructor(view){this.decorations=buildDecorations(view)}update(update){(update.docChanged||update.viewportChanged)&&(this.decorations=buildDecorations(update.view))}},{decorations:v=>v.decorations})),tailwindHighlightTheme=EditorView.baseTheme({".cm-tw-layout":{color:"#569cd6"},".cm-tw-spacing":{color:"#9cdcfe"},".cm-tw-sizing":{color:"#4ec9b0"},".cm-tw-typography":{color:"#c586c0"},".cm-tw-colors":{color:"#ce9178"},".cm-tw-borders":{color:"#d7ba7d"},".cm-tw-effects":{color:"#b5cea8"},".cm-tw-positioning":{color:"#dcdcaa"}});// Default category colors. Downstream (react-native-codeditor's editor.html)
|
|
50
|
+
// overrides these per active editor theme, the same way _themePackageMap
|
|
51
|
+
// remaps @uiw theme exports — see TODO.md item 6's "Category colors need to
|
|
52
|
+
// be defined per editor theme... not hardcoded" note. These are just the
|
|
53
|
+
// standalone/demo defaults so the plugin isn't inert without that wiring.
|
|
54
|
+
return decoration={tailwindHighlightPlugin,tailwindHighlightTheme},decoration}function requireCodemirrorLangEmbedTailwind(){// Unlike the other embed-* packages (embed-sql/embed-graphql/embed-css/
|
|
55
|
+
// embed-sksl), Tailwind has no grammar to parse — `` tw`...` `` content is a
|
|
56
|
+
// flat space-separated list of utility class names (see TODO.md item 6: "no
|
|
57
|
+
// language structure inside `tw`...` ` to parse... this isn't a parseMixed
|
|
58
|
+
// grammar problem like the other DSLs"). So instead of `createEmbedding()`
|
|
59
|
+
// (matcher + nested Language for the tag registry), this package exports
|
|
60
|
+
// `createSupportExtension(jsLanguageSupport)`, returning plain CM extensions
|
|
61
|
+
// (a completion source + a decoration ViewPlugin) to merge into the JS/TSX
|
|
62
|
+
// language's `support` array.
|
|
63
|
+
function createSupportExtension(jsLanguageSupport){return[jsLanguageSupport.language.data.of({autocomplete:tailwindCompletionSource}),tailwindHighlightPlugin,tailwindHighlightTheme]}if(hasRequiredCodemirrorLangEmbedTailwind)return codemirrorLangEmbedTailwind;hasRequiredCodemirrorLangEmbedTailwind=1;const{tailwindCompletionSource}=requireCompletion(),{tailwindHighlightPlugin,tailwindHighlightTheme}=requireDecoration();return codemirrorLangEmbedTailwind={createSupportExtension},codemirrorLangEmbedTailwind}const module={exports:exports};var data,hasRequiredData,completion,hasRequiredCompletion,decoration,hasRequiredDecoration,codemirrorLangEmbedTailwind,hasRequiredCodemirrorLangEmbedTailwind,require$$0=await requireAsyncModule("@codemirror/language"),require$$1=await requireAsyncModule("@actualwave/codemirror-lang-embed-core"),require$$1$1=await requireAsyncModule("@codemirror/view"),require$$2=await requireAsyncModule("@codemirror/state"),codemirrorLangEmbedTailwindExports=requireCodemirrorLangEmbedTailwind(),index=/*@__PURE__*/function getDefaultExportFromCjs(x){return x}(codemirrorLangEmbedTailwindExports);return module.exports=index,module.exports}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
async function moduleInitFunction(requireAsyncModule,exports={}){const module={exports:exports};var hasRequiredCodemirrorLangGlsl,require$$0=await requireAsyncModule("@lezer/lr"),require$$1=await requireAsyncModule("@lezer/highlight"),require$$2=await requireAsyncModule("@codemirror/language"),require$$3=await requireAsyncModule("@codemirror/autocomplete"),codemirrorLangGlsl={},codemirrorLangGlslExports=function requireCodemirrorLangGlsl(){function glsl(){return new language.LanguageSupport(glslLanguage,glslLanguage.data.of({autocomplete:glslCompletionSource}))}if(hasRequiredCodemirrorLangGlsl)return codemirrorLangGlsl;hasRequiredCodemirrorLangGlsl=1;var lr=require$$0,highlight=require$$1,language=require$$2,autocomplete=require$$3;const glslHighlighting=highlight.styleTags({// Keywords
|
|
2
|
+
"if else for while do switch case default return discard break continue":highlight.tags.controlKeyword,struct:highlight.tags.definitionKeyword,precision:highlight.tags.definitionKeyword,layout:highlight.tags.definitionKeyword,"const in out inout attribute varying uniform centroid flat smooth noperspective invariant precise":highlight.tags.modifier,"highp mediump lowp":highlight.tags.modifier,// Type names (built-in types only — identifier fallback handled separately)
|
|
3
|
+
"void bool int uint float":highlight.tags.typeName,"vec2 vec3 vec4 bvec2 bvec3 bvec4 ivec2 ivec3 ivec4 uvec2 uvec3 uvec4":highlight.tags.typeName,"mat2 mat3 mat4":highlight.tags.typeName,"mat2x2 mat2x3 mat2x4 mat3x2 mat3x3 mat3x4 mat4x2 mat4x3 mat4x4":highlight.tags.typeName,"sampler2D samplerCube sampler3D sampler2DArray":highlight.tags.typeName,"sampler2DShadow samplerCubeShadow sampler2DArrayShadow":highlight.tags.typeName,"isampler2D isampler3D isamplerCube isampler2DArray":highlight.tags.typeName,"usampler2D usampler3D usamplerCube usampler2DArray":highlight.tags.typeName,// Boolean literals
|
|
4
|
+
BoolLiteral:highlight.tags.bool,// Identifiers
|
|
5
|
+
identifier:highlight.tags.variableName,// Function definition / prototype name
|
|
6
|
+
"FunctionDef/identifier":highlight.tags.function(highlight.tags.definition(highlight.tags.variableName)),"FunctionProto/identifier":highlight.tags.function(highlight.tags.definition(highlight.tags.variableName)),// Struct name
|
|
7
|
+
"StructDef/identifier":highlight.tags.definition(highlight.tags.typeName),// Variable declarator name
|
|
8
|
+
"declarator/identifier":highlight.tags.definition(highlight.tags.variableName),// layout(...) item names
|
|
9
|
+
"layoutItem/identifier":highlight.tags.propertyName,// Literals
|
|
10
|
+
Literal:highlight.tags.number,// Comments
|
|
11
|
+
LineComment:highlight.tags.lineComment,BlockComment:highlight.tags.blockComment,// Preprocessor
|
|
12
|
+
PreprocessorDirective:highlight.tags.processingInstruction,// Delimiters
|
|
13
|
+
"{ }":highlight.tags.brace,"( )":highlight.tags.paren,"[ ]":highlight.tags.squareBracket,"; ,":highlight.tags.separator,". ? :":highlight.tags.punctuation,// Operators
|
|
14
|
+
"logicalOr logicalAnd":highlight.tags.logicOperator,"eqOp relOp":highlight.tags.compareOperator,shiftOp:highlight.tags.bitwiseOperator,addOp:highlight.tags.arithmeticOperator,mulOp:highlight.tags.arithmeticOperator,unaryOp:highlight.tags.operator,assignOp:highlight.tags.definitionOperator,"| ^ &":highlight.tags.bitwiseOperator,// Field access dot
|
|
15
|
+
'FieldAccess/"."':highlight.tags.derefOperator}),spec_identifier={__proto__:null,void:12,bool:14,int:16,uint:18,float:20,vec2:22,vec3:24,vec4:26,bvec2:28,bvec3:30,bvec4:32,ivec2:34,ivec3:36,ivec4:38,uvec2:40,uvec3:42,uvec4:44,mat2:46,mat3:48,mat4:50,mat2x2:52,mat2x3:54,mat2x4:56,mat3x2:58,mat3x3:60,mat3x4:62,mat4x2:64,mat4x3:66,mat4x4:68,sampler2D:70,samplerCube:72,sampler3D:74,sampler2DArray:76,sampler2DShadow:78,samplerCubeShadow:80,sampler2DArrayShadow:82,isampler2D:84,isampler3D:86,isamplerCube:88,isampler2DArray:90,usampler2D:92,usampler3D:94,usamplerCube:96,usampler2DArray:98,const:102,in:104,out:106,inout:108,highp:110,mediump:112,lowp:114,true:136,false:138,return:164,if:168,else:170,for:174,layout:180,attribute:182,varying:184,uniform:186,centroid:188,flat:190,smooth:192,noperspective:194,invariant:196,precise:198,while:204,do:208,switch:212,case:214,default:216,discard:220,break:224,continue:228,struct:234,precision:238},parser=lr.LRParser.deserialize({version:14,states:"BbQ]QPOOOOQO'#Fo'#FoOOQO'#FP'#FPO%jQPO'#EWO)kQPO'#EWOOQO'#FX'#FXO)sQPO'#FXOOQO'#Ey'#EyQ]QPOOOOQO'#Ca'#CaOOQO'#F^'#F^O)xQPO'#EXOOQO'#Fs'#FsO)}QPO'#EtO*SQPO'#EvOOQO-E8}-E8}O*_QPO,5:rO-uQPO'#DjO-|QPO,5;_O._QPO'#FtOOQO,5:r,5:rO*bQPO,5:rOOQO,5;s,5;sOOQO-E8w-E8wO.gQPO,5:sO.oQPO,5;`O.tQPO,5;bO.PQPO'#FuOOQO1G0^1G0^O*bQPO1G0^OOQO'#Do'#DoO*gQPO'#DoO1pQQO'#DnOOQO'#Dm'#DmO*gQPO'#DmO3{QQO,5:UOOQO'#F_'#F_OOQO,5:U,5:UOOQO'#Dq'#DqO*gQPO,5<aO4SQPO,5<aO4_QPO1G0yO*bQPO'#FRO4{QPO,5<`O5TQPO'#FqO5`QPO'#FpOOQO1G0_1G0_O5hQPO1G0_O5mQPO1G0zO6QQPO1G0|OOQO7+%x7+%xO6VQQO,5:ZO6^QPO'#DuO*gQPO'#DwO6cQPO'#DxOOQO'#E{'#E{O6jQQO,5:YOOQO,5:X,5:XO*gQPO,5;yO*gQPO,5;yO*gQPO,5;yO*gQPO,5;yO*gQPO,5;yO*gQPO,5;yO*gQPO,5;yO*gQPO,5;yO*gQPO,5;yO*gQPO,5;yO*gQPO,5;yO*gQPO,5;yOOQO1G/p1G/pO7}QQO1G1{O*gQPO1G1{OOQO'#F]'#F]OOQO'#Ez'#EzO8XQPO'#F[O8rQPO'#F[O9QQPO'#FZO9YQPO7+&eO9bQPO7+&eOOQO,5;m,5;mOOQO-E9P-E9PO9gQPO,5<]O.jQPO'#F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$W#jU$q$W&R&SQ&R&OR&S&Q!OROW#j$W$^$v%^%b%i%m%o%x&O&Q&R&S&U&Y&Z&[&]&^&hR_RQ!v}R#o!vQ{cR!s{Q%s%lR%{%sQ!{!QR#s!{TVOWR!qyQ!oyR$P#hV!ly!m#h!QPORW#j$W$^$v%^%b%i%m%o%x&O&Q&R&S&U&Y&Z&[&]&^&hQj^U!ky!m#hT!y!Q!{QsaQ!ToQ!iwQ#Q!VQ#R!WQ#V![Q#W!]Q#X!^Q#Y!_Q#Z!`Q#[!aQ#]!bQ#^!cQ#_!dQ#`!eQ#a!fQ#b!gQ#c!jz$S#j$W$^$v%^%b%i%m%o%x&O&Q&R&S&U&Y&Z&[&]&^&hQ$j#xQ$l#{Q$s$YQ%T$uQ%X$wQ%Z$yQ%`%WQ%h%aQ%k%cQ%n%gQ%}%tQ&V&WQ&_&dQ&b&`Q&c&aR&f&eR#T!W[$V#j$W&O&Q&R&SQ$x$^Q%f%^S%j%b&YS%p%i&ZS%w%m&[S%y%o&]S&P%x&^R&T&UQ%W$vR&e&h!RQORW#j$W$^$v%^%b%i%m%o%x&O&Q&R&S&U&Y&Z&[&]&^&hR!PhQ}hR#n!uSdS$RSl`eQ!SmQ#v!|R$i#t^cS`em!|#t$RR!rzT%r%l%sT!z!Q!{",nodeNames:"\u26A0 LineComment BlockComment Program FunctionDef TypeName void bool int uint float vec2 vec3 vec4 bvec2 bvec3 bvec4 ivec2 ivec3 ivec4 uvec2 uvec3 uvec4 mat2 mat3 mat4 mat2x2 mat2x3 mat2x4 mat3x2 mat3x3 mat3x4 mat4x2 mat4x3 mat4x4 sampler2D samplerCube sampler3D sampler2DArray sampler2DShadow samplerCubeShadow sampler2DArrayShadow isampler2D isampler3D isamplerCube isampler2DArray usampler2D usampler3D usamplerCube usampler2DArray ( const in out inout highp mediump lowp ] [ ArraySuffix ? : UnaryExpr PostfixExpr PrimaryExpr Literal BoolLiteral true false ) FieldAccess . IndexAccess CallArgs , PostfixOp } { Block ; ReturnStmt return IfStmt if else ForStmt for VarDecl LayoutQualifier layout attribute varying uniform centroid flat smooth noperspective invariant precise ExprStmt WhileStmt while DoWhileStmt do SwitchStmt switch case default DiscardStmt discard BreakStmt break ContinueStmt continue FunctionProto StructDef struct PrecisionStmt precision PreprocessorDirective",maxTerm:165,nodeProps:[["closedBy",50,")",59,"]",78,"}"],["openedBy",58,"[",70,"(",77,"{"]],propSources:[glslHighlighting],skippedNodes:[0,1,2],repeatNodeCount:11,tokenData:".Z~RrXY#]YZ#]]^#]pq#]qr#nst#{uv$jvw$wxy%Xyz%^z{$j{|%c|}%w}!O%|!O!P&Z!P!Q'n!Q!R)r!R![*^![!]+g!]!^+l!^!_+q!_!`,Z!`!a,e!a!b,p!c!},u!}#O-W#P#Q-]#Q#R-b#R#S,u#T#o,u#o#p-j#p#q-o#q#r.P#r#s.U~#bS#z~XY#]YZ#]]^#]pq#]R#sP$`P!_!`#vQ#{O$WQ~$QU#l~OY#{Z#O#{#O#P#{#P;'S#{;'S;=`$d<%lO#{~$gP;=`<%l#{~$oP$S~!_!`$rQ$wO$^Q~$|Q$X~vw%S!_!`$r~%XO$[~~%^O!S~~%cO!h~~%jQ$`P$T~{|%p!_!`$r~%wO!n~$`P~%|O!m~~&TQ$`P$T~}!O%p!_!`$rR&`P!jQ!Q![&cP&hT!dP!Q![&c!g!h&w!h!i'i#X#Y&w#Y#Z'iP&zR{|'T}!O'T!Q!['ZP'WP!Q!['ZP'`R!dP!Q!['Z!h!i'i#Y#Z'iP'nO!dP~'sR$S~z{'|!P!Q)T!_!`$r~(PTOz'|z{(`{;'S'|;'S;=`(}<%lO'|~(cVOz'|z{(`{!P'|!P!Q(x!Q;'S'|;'S;=`(}<%lO'|~(}OQ~~)QP;=`<%l'|~)YUP~OY)TZ#O)T#O#P)T#P;'S)T;'S;=`)l<%lO)T~)oP;=`<%l)TP)wV!dP!O!P&c!Q![*^!g!h&w!w!x'i#X#Y&w#i#j'i#l#m*uP*cU!dP!O!P&c!Q![*^!g!h&w!w!x'i#X#Y&w#i#j'iP*xR!Q![+R!c!i+R#T#Z+RP+WT!dP!Q![+R!c!i+R!w!x'i#T#Z+R#i#j'i~+lO!`~~+qO!r~~+vQ$V~!^!_+|!_!`,U~,RP$U~!_!`$r~,ZO$V~R,bP$fP$^Q!_!`#v~,jQ$V~!_!`,U!`!a+|~,uO!_~~,zS#|~!Q![,u!c!},u#R#S,u#T#o,u~-]O!]~~-bO![~~-gP$Y~!_!`$r~-oO!p~~-tQ$Z~!_!`$r#p#q-z~.PO$]~~.UO!o~P.ZO$`P",tokenizers:[0,1],topRules:{Program:[0,3]},specialized:[{term:136,get:value=>spec_identifier[value]||-1}],tokenPrec:2799}),TYPES=["void","bool","int","uint","float","double","vec2","vec3","vec4","ivec2","ivec3","ivec4","uvec2","uvec3","uvec4","bvec2","bvec3","bvec4","mat2","mat3","mat4","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","sampler2D","sampler3D","samplerCube","sampler2DArray","sampler2DShadow","samplerCubeShadow","isampler2D","usampler2D"],QUALIFIERS=["attribute","varying","uniform","in","out","inout","const","precision","highp","mediump","lowp","invariant","flat","noperspective","smooth","layout","struct","return","if","else","for","while","do","break","continue","discard","true","false"],FUNCTIONS=["radians","degrees","sin","cos","tan","asin","acos","atan","sinh","cosh","tanh","asinh","acosh","atanh","pow","exp","log","exp2","log2","sqrt","inversesqrt","abs","sign","floor","trunc","round","roundEven","ceil","fract","mod","modf","min","max","clamp","mix","step","smoothstep","isnan","isinf","length","distance","dot","cross","normalize","faceforward","reflect","refract","matrixCompMult","outerProduct","transpose","inverse","determinant","lessThan","lessThanEqual","greaterThan","greaterThanEqual","equal","notEqual","any","all","not","texture","texture2D","textureCube","textureProj","textureLod","texelFetch","textureSize","textureGrad","dFdx","dFdy","fwidth"],VARIABLES=["gl_Position","gl_PointSize","gl_FragColor","gl_FragCoord","gl_FrontFacing","gl_PointCoord","gl_FragDepth","gl_VertexID","gl_InstanceID"],completions=[...TYPES.map(label=>({label,type:"type"})),...QUALIFIERS.map(label=>({label,type:"keyword"})),...FUNCTIONS.map(label=>({label,type:"function",boost:-1})),...VARIABLES.map(label=>({label,type:"variable"}))],glslCompletionSource=autocomplete.completeFromList(completions),glslLanguage=language.LRLanguage.define({parser:parser.configure({props:[language.indentNodeProp.add({Block:language.delimitedIndent({closing:"}",align:!1})}),language.foldNodeProp.add({Block:language.foldInside,StructDef:language.foldInside})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/}});// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
16
|
+
// Built-in GLSL ES / desktop GLSL vocabulary — types, qualifiers/keywords,
|
|
17
|
+
// standard-library functions, and the handful of predeclared gl_* variables.
|
|
18
|
+
// Not exhaustive of every dialect variant (e.g. GLSL ES 3.00's image/atomic
|
|
19
|
+
// builtins), just the common surface a shader author actually types.
|
|
20
|
+
return codemirrorLangGlsl.glsl=glsl,codemirrorLangGlsl.glslLanguage=glslLanguage,codemirrorLangGlsl}(),index=/*@__PURE__*/function getDefaultExportFromCjs(x){return x}(codemirrorLangGlslExports);return module.exports=index,module.exports}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
async function moduleInitFunction(requireAsyncModule,exports={}){const module={exports:exports};var hasRequiredCodemirrorLangIcuMessageformat,require$$0=await requireAsyncModule("@lezer/lr"),require$$1=await requireAsyncModule("@lezer/highlight"),require$$2=await requireAsyncModule("@codemirror/language"),require$$3=await requireAsyncModule("@codemirror/autocomplete"),codemirrorLangIcuMessageformat={},codemirrorLangIcuMessageformatExports=function requireCodemirrorLangIcuMessageformat(){function icuMessageFormat(){return new language.LanguageSupport(icuMessageFormatLanguage,icuMessageFormatLanguage.data.of({autocomplete:icuCompletionSource}))}if(hasRequiredCodemirrorLangIcuMessageformat)return codemirrorLangIcuMessageformat;hasRequiredCodemirrorLangIcuMessageformat=1;var lr=require$$0,highlight=require$$1,language=require$$2,autocomplete=require$$3;const icuHighlighting=highlight.styleTags({Text:highlight.tags.content,PoundSign:highlight.tags.special(highlight.tags.number),EscapedApos:highlight.tags.escape,QuotedLiteral:highlight.tags.string,ArgName:highlight.tags.variableName,ArgType:highlight.tags.typeName,ArgStyle:highlight.tags.string,"plural selectordinal select":highlight.tags.keyword,offset:highlight.tags.keyword,"zero one two few many other":highlight.tags.atom,ExactValue:highlight.tags.number,number:highlight.tags.number,"{ }":highlight.tags.brace,"= : ,":highlight.tags.separator}),spec_identifier={__proto__:null,plural:27,selectordinal:29,offset:33,zero:43,one:45,two:47,few:49,many:51,other:53,select:57,number:65,date:67,time:69,duration:71,spellout:73,ordinal:75},parser=lr.LRParser.deserialize({version:14,states:"'zOhOPOOOoQQO'#CeOOOO'#DZ'#DZOOOO'#DT'#DTOwOPO'#C^QOOOOOOOQO'#Cf'#CfO!RQQO,59POOOO-E7R-E7RO!ZQQO'#D^OOOO1G.k1G.kO!xQQO1G.kO!}QQO'#CzOOQO,59x,59xO#VQQO'#ChO#[QQO'#CwOOQO'#C{'#C{OOOO7+$V7+$VO#aQSO,59fO#}QQO,59SO$UQQO,59cOOQO'#DS'#DSOOQO1G/Q1G/QO$aQQO'#CoO$fOQO'#CnOOQO'#DU'#DUO$nQQO1G.nO$uQQO'#CkOOOO'#D_'#D_O#fQQO1G.nO$zOQO'#CyOOQO'#DV'#DVO%SQQO1G.}OOOO,59Z,59ZO%bOPO,59YO%iOPO,59YOOQO-E7S-E7SO%nQQO,59VO%sQQO7+$YO%bOPO,59eO%zOPO,59eOOQO-E7T-E7TO&POPO1G.tO%bOPO1G.tOOQO1G.q1G.qO&UOPO1G/PO%bOPO1G/POOQO7+$`7+$`O&ZOPO7+$`OOQO7+$k7+$kO&`OPO7+$kOOQO<<Gz<<GzOOQO<<HV<<HV",stateData:"&h~O|OS~ORQOSQOTQOUQOWPO~OzQP~PVO!OUO!PUO~OzQXVQX~PVOVYOZXO~O]^O^^Ol_Op`Oq`Or`Os`Ot`Ou`O~OVaO~OZbOVnX~OZcO~OZdO~O!SeO~OdgOelOflOglOhlOilOjlO~O`kO~P#fOdgOjnO!PnO~O!OqO~OWrO|sO~OV[i~P#fOauO~OWwO|xO~OdgOjnO!PnOVki~OVQP~PVOW{O~O!O|O~OV[q~P#fOW!OO~OV!PO~OV!RO~OV!TO~OV!UO~O|!S~",goto:"$^!SPP!TPPPPPP!d!lP!oPP!rPP!u!{PPPPPPP!oP#V!o#ZPPPPPP#^#a#k#uPPP#{PP$T$WQTOQzrQ}wQ!Q{R!S!O]QOSrw{!ORVPR]XRmcXicjmvWhcjmvTndpTodpR[XRfbYSOrw{!ORWSQjcStjvRvmQpdRyp]ROSrw{!ORZVXhcjmv",nodeNames:"\u26A0 Program Message Text PoundSign EscapedApos QuotedLiteral } { Argument ArgName , PluralArg plural selectordinal OffsetClause offset : PluralCase ExactValue = zero one two few many other SelectArg select SelectCase SimpleArg ArgType number date time duration spellout ordinal ArgStyle",maxTerm:50,nodeProps:[["openedBy",7,"{"],["closedBy",8,"}"]],propSources:[icuHighlighting],skippedNodes:[0],repeatNodeCount:3,tokenData:"._~RnOX#PXY$eYZ$eZ]#P]^$e^p#Ppq$eqs#Pst%ptw#Pwx&Wx|#P|})l}!Q#P!Q![*b![!]+^!]!_#P!_!`,S!`!c#P!c!},x!}#R#P#R#S,x#S#T#P#T#o,x#o#p.T#p#q#P#q#r.Y#r;'S#P;'S;=`$_<%lO#PT#WXRP!SSOs#Pst#stw#Pwx#sx#o#P#p#q#P#r;'S#P;'S;=`$_<%lO#PS#xT!SSO#o#s#p#q#s#r;'S#s;'S;=`$X<%lO#sS$[P;=`<%l#sT$bP;=`<%l#PV$n`RP|U!SSOX#PXY$eYZ$eZ]#P]^$e^p#Ppq$eqs#Pst#stw#Pwx#sx#o#P#p#q#P#r;'S#P;'S;=`$_<%lO#PT%wTSP!SSO#o#s#p#q#s#r;'S#s;'S;=`$X<%lO#sT&]X!SSOw&xwx)Ox#o&x#o#p(W#p#q&x#q#r(W#r;'S&x;'S;=`(x<%lO&xT&}X!SSOw&xwx'jx#o&x#o#p(W#p#q&x#q#r(W#r;'S&x;'S;=`(x<%lO&xT'qVUP!SSOw#swx&xx#o#s#p#q#s#r;'S#s;'S;=`$X<%lO#sP(ZTOw(Wwx(jx;'S(W;'S;=`(r<%lO(WP(oPUPwx(WP(uP;=`<%l(WT({P;=`<%l&xT)VVTP!SSOw#swx&xx#o#s#p#q#s#r;'S#s;'S;=`$X<%lO#sV)uXZQRP!SSOs#Pst#stw#Pwx#sx#o#P#p#q#P#r;'S#P;'S;=`$_<%lO#PV*kZRP!OQ!SSOs#Pst#stw#Pwx#sx!Q#P!Q![*b![#o#P#p#q#P#r;'S#P;'S;=`$_<%lO#PV+gXaQRP!SSOs#Pst#stw#Pwx#sx#o#P#p#q#P#r;'S#P;'S;=`$_<%lO#PV,]XdQRP!SSOs#Pst#stw#Pwx#sx#o#P#p#q#P#r;'S#P;'S;=`$_<%lO#PV-R`RP!PQ!SSOs#Pst#stw#Pwx#sx!Q#P!Q![,x![!c#P!c!},x!}#R#P#R#S,x#S#T#P#T#o,x#p#q#P#r;'S#P;'S;=`$_<%lO#P~.YOW~~._OV~",tokenizers:[0,1,2],topRules:{Program:[0,1]},specialized:[{term:47,get:value=>spec_identifier[value]||-1}],tokenPrec:251}),pluralCategoryComplete=autocomplete.completeFromList([{label:"zero",type:"keyword"},{label:"one",type:"keyword"},{label:"two",type:"keyword"},{label:"few",type:"keyword"},{label:"many",type:"keyword"},{label:"other",type:"keyword"}]),selectCategoryComplete=autocomplete.completeFromList([{label:"other",type:"keyword"}]),argTypeComplete=autocomplete.completeFromList([{label:"plural",type:"keyword"},{label:"selectordinal",type:"keyword"},{label:"select",type:"keyword"},{label:"number",type:"keyword"},{label:"date",type:"keyword"},{label:"time",type:"keyword"},{label:"duration",type:"keyword"},{label:"spellout",type:"keyword"},{label:"ordinal",type:"keyword"}]),messageSnippetComplete=autocomplete.completeFromList([autocomplete.snippetCompletion("{${name}, plural, one {# item} other {# items}}",{label:"plural",type:"keyword",detail:"plural argument"}),autocomplete.snippetCompletion("{${name}, selectordinal, one {#st} two {#nd} few {#rd} other {#th}}",{label:"selectordinal",type:"keyword",detail:"ordinal argument"}),autocomplete.snippetCompletion("{${name}, select, ${key} {${value}} other {${other}}}",{label:"select",type:"keyword",detail:"select argument"})]),icuCompletionSource=context=>{const node=language.syntaxTree(context.state).resolveInner(context.pos,-1);for(let n=node;n;n=n.parent)switch(n.name){// Already inside a case branch's own message text — its content is
|
|
2
|
+
// plain text (or nested arguments), not a selector keyword position.
|
|
3
|
+
case"PluralCase":case"SelectCase":return null;case"PluralArg":return pluralCategoryComplete(context);case"SelectArg":return selectCategoryComplete(context);// Still naming the argument (`{na|`) — nothing to suggest until past
|
|
4
|
+
// the comma that follows ArgName.
|
|
5
|
+
case"ArgName":return null;case"Argument":return n.getChild("ArgName")?argTypeComplete(context):null;case"Message":return messageSnippetComplete(context)}return null},icuMessageFormatLanguage=language.LRLanguage.define({parser:parser.configure({props:[language.indentNodeProp.add({Argument:language.delimitedIndent({closing:"}",align:!1})}),language.foldNodeProp.add({PluralCase:language.foldInside,SelectCase:language.foldInside})]}),languageData:{}});// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
6
|
+
// ICU MessageFormat completion is context-sensitive rather than a flat
|
|
7
|
+
// keyword list: `plural`/`select`/`other`/etc are only valid at specific
|
|
8
|
+
// grammar positions (see syntax.grammar's `kw<term>` comment — they share
|
|
9
|
+
// the open `identifier` namespace, so what's offered depends on where the
|
|
10
|
+
// cursor actually is).
|
|
11
|
+
return codemirrorLangIcuMessageformat.icuMessageFormat=icuMessageFormat,codemirrorLangIcuMessageformat.icuMessageFormatLanguage=icuMessageFormatLanguage,codemirrorLangIcuMessageformat}(),index=/*@__PURE__*/function getDefaultExportFromCjs(x){return x}(codemirrorLangIcuMessageformatExports);return module.exports=index,module.exports}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
async function moduleInitFunction(requireAsyncModule,exports={}){function requireTypes(){function invert(byType){const out={};for(const[type,names]of Object.entries(byType))for(const name of names)out[name]=type;return out}// type -> { methodName: returnType }
|
|
2
|
+
// Date has dozens of accessors that follow a naming pattern.
|
|
3
|
+
function dateMethodReturn(name){return /^(get|set)/.test(name)||"valueOf"===name?"Number":/^to.*String$|^toJSON$/.test(name)?"String":null}// type -> { propertyName: type } for non-method members.
|
|
4
|
+
if(hasRequiredTypes)return types;hasRequiredTypes=1;// Static knowledge the inference pass needs and that runtime reflection
|
|
5
|
+
// can't provide: what a method *returns*. Member *names* are never listed
|
|
6
|
+
// here — they come from reflecting the real prototype (see members.js), so they
|
|
7
|
+
// always match the JS engine the editor runs in.
|
|
8
|
+
//
|
|
9
|
+
// Return values are type names, i.e. the name of a global constructor
|
|
10
|
+
// ('String', 'Array', ...), or the marker '@this' (returns the receiver's own
|
|
11
|
+
// type) / '@arg0' (returns the type of the first argument).
|
|
12
|
+
const STRING_RETURNS={String:["at","charAt","concat","normalize","padEnd","padStart","repeat","replace","replaceAll","slice","substr","substring","toLocaleLowerCase","toLocaleUpperCase","toLowerCase","toString","toUpperCase","toWellFormed","trim","trimEnd","trimLeft","trimRight","trimStart","valueOf"],Number:["charCodeAt","codePointAt","indexOf","lastIndexOf","localeCompare","search"],Boolean:["endsWith","includes","isWellFormed","startsWith"],Array:["match","split"]},ARRAY_RETURNS={Array:["concat","copyWithin","fill","filter","flat","flatMap","map","reverse","slice","sort","splice","toReversed","toSorted","toSpliced","with"],String:["join","toLocaleString","toString"],Number:["findIndex","findLastIndex","indexOf","lastIndexOf","push","unshift"],Boolean:["every","includes","some"]},METHOD_RETURNS={String:invert(STRING_RETURNS),Array:invert(ARRAY_RETURNS),Number:invert({String:["toExponential","toFixed","toLocaleString","toPrecision","toString"],Number:["valueOf"]}),BigInt:invert({String:["toLocaleString","toString"],BigInt:["valueOf"]}),Boolean:invert({String:["toString"],Boolean:["valueOf"]}),Map:invert({Map:["set"],Boolean:["delete","has"]}),Set:invert({Set:["add"],Boolean:["delete","has"]}),WeakMap:invert({WeakMap:["set"],Boolean:["delete","has"]}),WeakSet:invert({WeakSet:["add"],Boolean:["delete","has"]}),RegExp:invert({Boolean:["test"],Array:["exec"],String:["toString"]}),Promise:invert({Promise:["catch","finally","then"]}),Function:invert({Function:["bind"],String:["toString"]}),Error:invert({String:["toString"]}),URL:invert({String:["toJSON","toString"]}),URLSearchParams:invert({Boolean:["has"],String:["get","toString"],Array:["getAll"]}),Object:invert({Boolean:["hasOwnProperty","isPrototypeOf","propertyIsEnumerable"],String:["toLocaleString","toString"]})},PROPERTY_TYPES={String:{length:"Number"},Array:{length:"Number"},Function:{length:"Number",name:"String"},Map:{size:"Number"},Set:{size:"Number"},RegExp:{source:"String",flags:"String",lastIndex:"Number",global:"Boolean",ignoreCase:"Boolean",multiline:"Boolean",sticky:"Boolean"},Error:{message:"String",name:"String",stack:"String"},URL:{hash:"String",host:"String",hostname:"String",href:"String",origin:"String",password:"String",pathname:"String",port:"String",protocol:"String",search:"String",searchParams:"URLSearchParams",username:"String"}},STATIC_RETURNS={Array:{from:"Array",of:"Array",isArray:"Boolean"},Object:{assign:"@arg0",create:"Object",entries:"Array",freeze:"@arg0",fromEntries:"Object",getOwnPropertyNames:"Array",getOwnPropertySymbols:"Array",hasOwn:"Boolean",is:"Boolean",isExtensible:"Boolean",isFrozen:"Boolean",isSealed:"Boolean",keys:"Array",preventExtensions:"@arg0",seal:"@arg0",values:"Array"},JSON:{stringify:"String"},Math:{"*":"Number"},Number:{isFinite:"Boolean",isInteger:"Boolean",isNaN:"Boolean",isSafeInteger:"Boolean","*":"Number"},String:{fromCharCode:"String",fromCodePoint:"String",raw:"String"},Date:{now:"Number",parse:"Number",UTC:"Number"},Promise:{all:"Promise",allSettled:"Promise",any:"Promise",race:"Promise",reject:"Promise",resolve:"Promise",withResolvers:"Object"},BigInt:{asIntN:"BigInt",asUintN:"BigInt"}},GLOBAL_CALL_RETURNS={Array:"Array",BigInt:"BigInt",Boolean:"Boolean",Number:"Number",Object:"Object",String:"String",decodeURI:"String",decodeURIComponent:"String",encodeURI:"String",encodeURIComponent:"String",fetch:"Promise",isFinite:"Boolean",isNaN:"Boolean",parseFloat:"Number",parseInt:"Number"},TS_KEYWORD_TYPES={bigint:"BigInt",boolean:"Boolean",number:"Number",object:"Object",string:"String"},HIDDEN_MEMBERS=new Set(["constructor","caller","callee","arguments","toSource","unwatch","watch"]),HIDDEN_STATICS=new Set(["prototype","length","name","caller","arguments"]),DEFAULT_GLOBALS=["Object","Array","String","Number","Boolean","Symbol","BigInt","Math","JSON","Date","RegExp","Map","Set","WeakMap","WeakSet","Promise","Proxy","Reflect","Intl","Error","TypeError","RangeError","SyntaxError","ReferenceError","parseInt","parseFloat","isNaN","isFinite","NaN","Infinity","undefined","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","setTimeout","clearTimeout","setInterval","clearInterval","queueMicrotask","structuredClone","console","fetch","URL","URLSearchParams"];// Same lookup for members of global namespaces/constructors (`Math.`, `Object.`).
|
|
13
|
+
// A '*' key is the fallback for every other member.
|
|
14
|
+
// Global functions called without `new`.
|
|
15
|
+
// TypeScript keyword types -> runtime type names (for annotations).
|
|
16
|
+
// Members that exist on prototypes for historical reasons and are noise.
|
|
17
|
+
// Own properties of a constructor that aren't useful as `Ctor.` suggestions.
|
|
18
|
+
// Globals suggested (and usable as `Math.`-style receivers) by default.
|
|
19
|
+
// Deliberately excludes `window`, `document` and the rest of the browser's
|
|
20
|
+
// global surface; pass `globals` to the source to change this.
|
|
21
|
+
return types={METHOD_RETURNS,PROPERTY_TYPES,STATIC_RETURNS,GLOBAL_CALL_RETURNS,TS_KEYWORD_TYPES,HIDDEN_MEMBERS,HIDDEN_STATICS,DEFAULT_GLOBALS,dateMethodReturn},types}function requireInfer(){function createContext(state,scope){return{scope:scope||{},read:node=>state.sliceDoc(node.from,node.to),depth:0,active:new Set}}function instance(type){return type?{kind:"instance",type}:null}// `Map`, `Date`, `Promise`... — a built-in that can be both annotated and constructed.
|
|
22
|
+
function isBuiltinType(name){if(!/^[A-Z]/.test(name))return!1;const ctor=globalThis[name];return"function"==typeof ctor&&null!=ctor.prototype}function hasOwn(object,key){return Object.prototype.hasOwnProperty.call(object,key)}function childNamed(node,name){for(let child=node.firstChild;child;child=child.nextSibling)if(child.name===name)return child;return null}// The expression inside `( ... )`.
|
|
23
|
+
function innerOf(parenthesized){for(let child=parenthesized.firstChild;child;child=child.nextSibling)if("("!==child.name&&")"!==child.name)return child;return null}function propertyNameOf(memberExpression,ctx){const last=memberExpression.lastChild;return last&&"PropertyName"===last.name?ctx.read(last):null}function firstArgument(callExpression){const args=childNamed(callExpression,"ArgList");if(!args)return null;for(let child=args.firstChild;child;child=child.nextSibling)if("("!==child.name&&")"!==child.name&&","!==child.name)return child;return null}// ---- declarations -----------------------------------------------------------
|
|
24
|
+
// Reads `name [: Type] [= init]` starting at a VariableDefinition.
|
|
25
|
+
function readDefinition(definition){let next=definition.nextSibling,annotation=null,init=null;return next&&"TypeAnnotation"===next.name&&(annotation=next,next=next.nextSibling),next&&"Equals"===next.name&&(init=next.nextSibling),{kind:"variable",annotation,init,at:definition.from}}function collectDefinitions(parent,name,ctx,found){for(let child=parent.firstChild;child;child=child.nextSibling)"VariableDefinition"===child.name&&ctx.read(child)===name&&found.push(readDefinition(child))}function collectDeclarations(container,name,ctx,found){for(let child=container.firstChild;child;child=child.nextSibling)switch(child.name){case"VariableDeclaration":collectDefinitions(child,name,ctx,found);break;case"ExportDeclaration":case"ForSpec":collectDeclarations(child,name,ctx,found);break;case"FunctionDeclaration":case"ClassDeclaration":{const id=childNamed(child,"VariableDefinition");id&&ctx.read(id)===name&&found.push({kind:"FunctionDeclaration"===child.name?"function":"class",node:child,at:child.from});break}case"ParamList":collectDefinitions(child,name,ctx,found);break;case"ForInSpec":case"ForOfSpec":{const before=found.length;collectDefinitions(child,name,ctx,found),found.length>before&&(found[found.length-1]={kind:"ForInSpec"===child.name?"forIn":"unknown",at:child.from});break}case"VariableDefinition":"CatchClause"===container.name&&ctx.read(child)===name&&found.push({kind:"catch",at:child.from})}}// Finds the nearest enclosing declaration of `name` visible from `fromNode`.
|
|
26
|
+
function findDeclaration(name,fromNode,ctx){for(let container=fromNode.parent;container;container=container.parent){const found=[];if(collectDeclarations(container,name,ctx,found),!found.length)continue;// Prefer the closest declaration written before the usage (handles redeclared `var`s).
|
|
27
|
+
let best=null;for(const candidate of found)candidate.at<=fromNode.from&&(!best||candidate.at>best.at)&&(best=candidate);return best||found[0]}return null}// ---- TypeScript annotations ---------------------------------------------------
|
|
28
|
+
function typeNodeToDescriptor(typeNode,ctx){if(!typeNode)return null;switch(typeNode.name){case"TypeName":{const text=ctx.read(typeNode);if(hasOwn(TS_KEYWORD_TYPES,text))return instance(TS_KEYWORD_TYPES[text]);const declaration=findDeclaration(text,typeNode,ctx);return declaration?"class"===declaration.kind?{kind:"class",node:declaration.node}:null:isBuiltinType(text)?instance(text):null}case"ArrayType":return instance("Array");case"ParameterizedType":return typeNodeToDescriptor(typeNode.firstChild,ctx);default:return null}}function annotationToDescriptor(annotation,ctx){return annotation?typeNodeToDescriptor(annotation.lastChild,ctx):null}// ---- values -------------------------------------------------------------------
|
|
29
|
+
function descriptorFromValue(value,globalName){switch(typeof value){case"string":return instance("String");case"number":return instance("Number");case"boolean":return instance("Boolean");case"bigint":return instance("BigInt");case"symbol":return instance("Symbol");case"function":return{kind:"value",value,globalName};case"object":return null===value?null:Array.isArray(value)?instance("Array"):{kind:"value",value,globalName};default:return null}}function descriptorFromDeclaration(declaration,ctx){switch(declaration.kind){case"variable":return annotationToDescriptor(declaration.annotation,ctx)||(declaration.init?inferNode(declaration.init,ctx):null);case"function":return instance("Function");case"class":return{kind:"classStatic",node:declaration.node};case"forIn":return instance("String");case"catch":return instance("Error");default:return null}}// ---- expressions ----------------------------------------------------------------
|
|
30
|
+
function inferVariable(node,ctx){const name=ctx.read(node),declaration=findDeclaration(name,node,ctx);return declaration?descriptorFromDeclaration(declaration,ctx):hasOwn(ctx.scope,name)?descriptorFromValue(ctx.scope[name],name):null}function inferThis(node){let member=null;for(let current=node.parent;current;current=current.parent)if("MethodDeclaration"===current.name||"PropertyDeclaration"===current.name)member=current;else{if("ClassBody"===current.name){const isStatic=member&&childNamed(member,"static");return{kind:isStatic?"classStatic":"class",node:current.parent}}if("ObjectExpression"===current.name)return{kind:"object",node:current}}return null}function inferNew(node,ctx){const callee=childNamed(node,"VariableName");if(!callee)return null;const name=ctx.read(callee),declaration=findDeclaration(name,callee,ctx);return declaration?"class"===declaration.kind?{kind:"class",node:declaration.node}:null:hasOwn(ctx.scope,name)&&isBuiltinType(name)?instance(name):null}function inferCall(node,ctx){const callee=node.firstChild;if(!callee)return null;if("VariableName"===callee.name){const name=ctx.read(callee),declaration=findDeclaration(name,callee,ctx);return declaration?"function"===declaration.kind?annotationToDescriptor(childNamed(declaration.node,"TypeAnnotation"),ctx):null:hasOwn(ctx.scope,name)&&hasOwn(GLOBAL_CALL_RETURNS,name)?instance(GLOBAL_CALL_RETURNS[name]):null}if("MemberExpression"!==callee.name||!callee.firstChild)return null;const property=propertyNameOf(callee,ctx);if(!property)return null;const receiver=inferNode(callee.firstChild,ctx);if(!receiver)return null;if("instance"===receiver.kind){const{type}=receiver,returns="Date"===type?dateMethodReturn(property):METHOD_RETURNS[type]&&METHOD_RETURNS[type][property]||METHOD_RETURNS.Object&&METHOD_RETURNS.Object[property];return instance(returns)}if("value"===receiver.kind&&receiver.globalName&&hasOwn(STATIC_RETURNS,receiver.globalName)){const table=STATIC_RETURNS[receiver.globalName],returns=hasOwn(table,property)?table[property]:table["*"];if("@arg0"===returns){const argument=firstArgument(node);return argument?inferNode(argument,ctx):null}return instance(returns)}return null}function inferObjectKey(objectNode,key,ctx){for(let property=objectNode.firstChild;property;property=property.nextSibling){if("Property"!==property.name)continue;const id=property.firstChild;if(!id||"PropertyDefinition"!==id.name||ctx.read(id)!==key)continue;if(childNamed(property,"ParamList"))return instance("Function");const colon=id.nextSibling;if(colon&&":"===colon.name)return inferNode(colon.nextSibling,ctx);// shorthand `{ key }` refers to the variable of the same name
|
|
31
|
+
const declaration=findDeclaration(key,id,ctx);return declaration?descriptorFromDeclaration(declaration,ctx):null}return null}function inferClassField(classNode,key,wantStatic,ctx){const body=childNamed(classNode,"ClassBody");if(!body)return null;for(let member=body.firstChild;member;member=member.nextSibling){if("PropertyDeclaration"!==member.name&&"MethodDeclaration"!==member.name)continue;if(!!childNamed(member,"static")!==wantStatic)continue;const id=childNamed(member,"PropertyDefinition");if(!id||ctx.read(id)!==key)continue;if("MethodDeclaration"===member.name)return instance("Function");const field=readDefinition(id);return annotationToDescriptor(field.annotation,ctx)||(field.init?inferNode(field.init,ctx):null)}return null}function inferMember(node,ctx){const property=propertyNameOf(node,ctx);if(!property||!node.firstChild)return null;const receiver=inferNode(node.firstChild,ctx);if(!receiver)return null;switch(receiver.kind){case"instance":return instance(PROPERTY_TYPES[receiver.type]&&PROPERTY_TYPES[receiver.type][property]);case"object":return inferObjectKey(receiver.node,property,ctx);case"class":return inferClassField(receiver.node,property,!1,ctx);case"classStatic":return inferClassField(receiver.node,property,!0,ctx);case"value":{const descriptor=Object.getOwnPropertyDescriptor(receiver.value,property);return descriptor&&"value"in descriptor?descriptorFromValue(descriptor.value):null}default:return null}}function infer(node,ctx){switch(node.name){case"String":case"TemplateString":return instance("String");case"Number":return instance("Number");case"BooleanLiteral":return instance("Boolean");case"RegExp":return instance("RegExp");case"ArrayExpression":return instance("Array");case"ArrowFunction":case"FunctionExpression":return instance("Function");case"ObjectExpression":return{kind:"object",node};case"ParenthesizedExpression":return inferNode(innerOf(node),ctx);case"UnaryExpression":return node.firstChild&&"typeof"===node.firstChild.name?instance("String"):null;case"AwaitExpression":{const awaited=inferNode(node.lastChild,ctx);// The resolved type of a Promise isn't tracked.
|
|
32
|
+
return awaited&&"instance"===awaited.kind&&"Promise"===awaited.type?null:awaited}case"this":return inferThis(node);case"VariableName":return inferVariable(node,ctx);case"NewExpression":return inferNew(node,ctx);case"CallExpression":return inferCall(node,ctx);case"MemberExpression":return inferMember(node,ctx);default:return null}}// Guards against runaway recursion and self-referencing declarations
|
|
33
|
+
// (`const a = a.b`).
|
|
34
|
+
function inferNode(node,ctx){if(!node||ctx.depth>=MAX_DEPTH)return null;const key=`${node.name}:${node.from}:${node.to}`;if(ctx.active.has(key))return null;ctx.active.add(key),ctx.depth+=1;try{return infer(node,ctx)}finally{ctx.active.delete(key),ctx.depth-=1}}if(hasRequiredInfer)return infer_1;hasRequiredInfer=1;const{METHOD_RETURNS,PROPERTY_TYPES,STATIC_RETURNS,GLOBAL_CALL_RETURNS,TS_KEYWORD_TYPES,dateMethodReturn}=requireTypes(),MAX_DEPTH=16;// A deliberately small, heuristic type inference over the Lezer JS syntax tree.
|
|
35
|
+
// It answers one question: "what is the thing to the left of this `.`?" — and
|
|
36
|
+
// answers it only when that is cheap and certain (literals, constructors,
|
|
37
|
+
// simple declarations, annotated TS types, a table of well-known method return
|
|
38
|
+
// types). Anything else resolves to null and produces no suggestions, so a
|
|
39
|
+
// wrong guess never reaches the user.
|
|
40
|
+
//
|
|
41
|
+
// Results are descriptors:
|
|
42
|
+
// { kind: 'instance', type } an instance of a built-in ('String', 'Map', ...)
|
|
43
|
+
// { kind: 'object', node } an object literal (its keys are suggested)
|
|
44
|
+
// { kind: 'class', node } an instance of a class declared in this file
|
|
45
|
+
// { kind: 'classStatic', node } that class itself (`Foo.`)
|
|
46
|
+
// { kind: 'value', value, globalName? } a live value from the globals scope (`Math`, `console`, ...)
|
|
47
|
+
return infer_1={createContext,inferNode,findDeclaration,isBuiltinType,childNamed},infer_1}function requireMembers(){function propertyKind(object,name){let descriptor;try{descriptor=Object.getOwnPropertyDescriptor(object,name)}catch(_){return null}return descriptor?"function"==typeof descriptor.value?"method":"property":null;// Accessors are never invoked (`Map.prototype.size` throws off an instance).
|
|
48
|
+
}// Every member of `new Type()`, found by walking the real prototype chain, so the
|
|
49
|
+
// list always matches the engine the editor runs in. Members of deeper prototypes
|
|
50
|
+
// (Object.prototype's) rank lower.
|
|
51
|
+
function instanceOptions(type){if(instanceCache.has(type))return instanceCache.get(type);const options=[],ctor=globalThis[type];if("function"==typeof ctor&&ctor.prototype){const seen=new Set;let depth=0;for(let object=ctor.prototype;object;object=Object.getPrototypeOf(object)){for(const name of Object.getOwnPropertyNames(object)){if(seen.has(name)||!IDENT.test(name)||name.startsWith("__")||HIDDEN_MEMBERS.has(name))continue;const kind=propertyKind(object,name);kind&&(seen.add(name),options.push({label:name,type:kind,boost:-depth}))}depth+=1}}return instanceCache.set(type,options),options}// Own members of a namespace/constructor/custom API object (`Math.`, `Object.`).
|
|
52
|
+
function staticOptions(value){if(staticCache.has(value))return staticCache.get(value);const isFunction="function"==typeof value,options=[];for(const name of Object.getOwnPropertyNames(value)){if(!IDENT.test(name)||isFunction&&HIDDEN_STATICS.has(name))continue;const kind=propertyKind(value,name);kind&&options.push({label:name,type:"method"===kind&&/^[A-Z]/.test(name)?"class":kind})}return staticCache.set(value,options),options}function literalOptions(objectNode,ctx){const options=[];for(let property=objectNode.firstChild;property;property=property.nextSibling){if("Property"!==property.name)continue;const id=property.firstChild;if(!id||"PropertyDefinition"!==id.name)continue;const colon=id.nextSibling,value=colon&&":"===colon.name?colon.nextSibling:null,isMethod=!!childNamed(property,"ParamList")||!!(value&&("ArrowFunction"===value.name||"FunctionExpression"===value.name));options.push({label:ctx.read(id),type:isMethod?"method":"property",boost:2})}return options}function classOptions(classNode,ctx,wantStatic,visited){if(visited.has(classNode.from))return[];visited.add(classNode.from);const options=[],body=childNamed(classNode,"ClassBody");if(body)for(let member=body.firstChild;member;member=member.nextSibling){if("PropertyDeclaration"!==member.name&&"MethodDeclaration"!==member.name)continue;if(!!childNamed(member,"static")!==wantStatic)continue;const id=childNamed(member,"PropertyDefinition");if(!id)continue;const label=ctx.read(id);if("constructor"===label)continue;const accessor=childNamed(member,"get")||childNamed(member,"set");options.push({label,type:"MethodDeclaration"!==member.name||accessor?"property":"method",boost:2})}if(!wantStatic){let parent=null;for(let child=classNode.firstChild;child;child=child.nextSibling)"extends"===child.name&&(parent=child.nextSibling);if(parent&&"VariableName"===parent.name){const name=ctx.read(parent),declaration=findDeclaration(name,parent,ctx);declaration&&"class"===declaration.kind?options.push(...classOptions(declaration.node,ctx,!1,visited).map(option=>({...option,boost:1}))):!declaration&&isBuiltinType(name)&&options.push(...instanceOptions(name))}}return options}function dedupe(options){const seen=new Set;return options.filter(option=>!seen.has(option.label)&&(seen.add(option.label),!0))}// Turns an inference descriptor into completion options.
|
|
53
|
+
function membersOf(descriptor,ctx){switch(descriptor.kind){case"instance":return instanceOptions(descriptor.type);case"object":return dedupe([...literalOptions(descriptor.node,ctx),...instanceOptions("Object")]);case"class":return dedupe([...classOptions(descriptor.node,ctx,!1,new Set),...instanceOptions("Object")]);case"classStatic":return dedupe(classOptions(descriptor.node,ctx,!0,new Set));case"value":return staticOptions(descriptor.value);default:return[]}}if(hasRequiredMembers)return members;hasRequiredMembers=1;const{HIDDEN_MEMBERS,HIDDEN_STATICS}=requireTypes(),{findDeclaration,isBuiltinType,childNamed}=requireInfer(),IDENT=/^[A-Za-z_$][\w$]*$/,instanceCache=new Map,staticCache=new WeakMap;return members={membersOf,instanceOptions,staticOptions},members}function requireCompletion(){// `globals` is either a list of global names to expose (read off globalThis, absent
|
|
54
|
+
// ones are skipped) or a ready-made scope object ({ name: value }).
|
|
55
|
+
function resolveScope(globals){const source=null==globals?DEFAULT_GLOBALS:globals;if(!Array.isArray(source))return source;const scope={};for(const name of source)name in globalThis&&(scope[name]=globalThis[name]);return scope}function globalOptions(scope){return Object.keys(scope).map(label=>{const value=scope[label];let type="variable";return"function"==typeof value&&(type=/^[A-Z]/.test(label)?"class":"function"),{label,type}})}// Finds the MemberExpression whose property is being typed, and where the typed
|
|
56
|
+
// name starts. Handles `a.|`, `a.b|`, and `a?.b|`.
|
|
57
|
+
function memberContext(inner,pos){return"PropertyName"===inner.name&&inner.parent&&"MemberExpression"===inner.parent.name?{member:inner.parent,from:inner.from}:("."===inner.name||"?."===inner.name)&&inner.parent&&"MemberExpression"===inner.parent.name?{member:inner.parent,from:pos}:"MemberExpression"===inner.name?{member:inner,from:pos}:null}/**
|
|
58
|
+
* A `CompletionSource` for plain JavaScript that suggests:
|
|
59
|
+
* - after a `.`, the members of whatever the receiver is inferred to be
|
|
60
|
+
* (strings, arrays, numbers, Map/Set/Date/Promise/..., object literals, classes
|
|
61
|
+
* declared in the file, `this`, `Math`/`JSON`/`Object`/... and custom globals);
|
|
62
|
+
* - elsewhere, the configured globals (`setTimeout`, `Math`, `fetch`, ...).
|
|
63
|
+
* It declines (returns null) whenever the receiver's type isn't known.
|
|
64
|
+
*
|
|
65
|
+
* @param {{ globals?: string[] | object }} [config]
|
|
66
|
+
*/function jsCompletionSource(config={}){const scope=resolveScope(config.globals),globals=globalOptions(scope);return context=>{const{state,pos}=context,inner=syntaxTree(state).resolveInner(pos,-1),access=memberContext(inner,pos);if(access){const receiver=access.member.firstChild;if(!receiver||receiver===inner)return null;const descriptor=inferNode(receiver,createContext(state,scope));if(!descriptor)return null;const options=membersOf(descriptor,createContext(state,scope));return options.length?{from:access.from,options,validFor:IDENT}:null}if(DONT_COMPLETE.has(inner.name))return null;const isWord="VariableName"===inner.name||20>inner.to-inner.from&&IDENT.test(state.sliceDoc(inner.from,inner.to));return isWord||context.explicit?{from:isWord?inner.from:pos,options:globals,validFor:IDENT}:null}}if(hasRequiredCompletion)return completion;hasRequiredCompletion=1;const{syntaxTree}=require$$0,{DEFAULT_GLOBALS}=requireTypes(),{createContext,inferNode}=requireInfer(),{membersOf}=requireMembers(),IDENT=/^[\w$\xa1-][\w$\d\xa1-]*$/,DONT_COMPLETE=new Set(["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."]);// Nodes in which neither names nor members are completed. Mirrors the list
|
|
67
|
+
// @codemirror/lang-javascript uses for its own sources.
|
|
68
|
+
return completion={jsCompletionSource,resolveScope},completion}function requireCodemirrorLangJsCompletion(){// Like embed-tailwind and embed-react-native, there is no grammar here: the
|
|
69
|
+
// completions are layered on the existing JS parser. The source is attached to
|
|
70
|
+
// `jsLanguageSupport.language`, so pass the same support whose `language` the
|
|
71
|
+
// editor uses (the one returned by embedTaggedTemplates, when embedding).
|
|
72
|
+
function createSupportExtension(jsLanguageSupport,config){return jsLanguageSupport.language.data.of({autocomplete:jsCompletionSource(config)})}if(hasRequiredCodemirrorLangJsCompletion)return codemirrorLangJsCompletion;hasRequiredCodemirrorLangJsCompletion=1;const{jsCompletionSource,resolveScope}=requireCompletion(),{DEFAULT_GLOBALS}=requireTypes();return codemirrorLangJsCompletion={createSupportExtension,jsCompletionSource,resolveScope,DEFAULT_GLOBALS},codemirrorLangJsCompletion}const module={exports:exports};var types,hasRequiredTypes,infer_1,hasRequiredInfer,members,hasRequiredMembers,completion,hasRequiredCompletion,codemirrorLangJsCompletion,hasRequiredCodemirrorLangJsCompletion,require$$0=await requireAsyncModule("@codemirror/language"),codemirrorLangJsCompletionExports=requireCodemirrorLangJsCompletion(),index=/*@__PURE__*/function getDefaultExportFromCjs(x){return x}(codemirrorLangJsCompletionExports);return module.exports=index,module.exports}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
async function moduleInitFunction(requireAsyncModule,exports={}){const module={exports:exports};var hasRequiredCodemirrorLangReactNative,require$$0=await requireAsyncModule("@codemirror/language"),codemirrorLangReactNative={},codemirrorLangReactNativeExports=function requireCodemirrorLangReactNative(){// Walks every ImportDeclaration in the document and builds
|
|
2
|
+
// Map<localName, ImportInfo>. This is the scoping mechanism completion.ts
|
|
3
|
+
// relies on: nothing curated is ever suggested unless its local name is
|
|
4
|
+
// actually present here for the current document.
|
|
5
|
+
function collectImports(state){const imports=new Map,doc=state.doc,tree=language.syntaxTree(state);return tree.iterate({enter(node){if("ImportDeclaration"!==node.name)return;const stringNode=node.node.getChild("String");if(!stringNode)return;const raw=doc.sliceString(stringNode.from,stringNode.to),source=raw.slice(1,-1);// Default import: `import Foo from '...'` — a VariableDefinition
|
|
6
|
+
// directly under ImportDeclaration (not nested in an ImportGroup).
|
|
7
|
+
for(const child of node.node.getChildren("VariableDefinition"))imports.set(doc.sliceString(child.from,child.to),{source,imported:"default"});// Namespace import: `import * as Foo from '...'`.
|
|
8
|
+
if(node.node.getChild("Star")){const varDef=node.node.getChild("VariableDefinition");varDef&&imports.set(doc.sliceString(varDef.from,varDef.to),{source,imported:"*"})}// Named imports: `import { a, b as c } from '...'`, nested inside an
|
|
9
|
+
// ImportGroup child.
|
|
10
|
+
const group=node.node.getChild("ImportGroup");if(group){for(const child of group.getChildren("VariableDefinition")){// A VariableDefinition directly inside ImportGroup with no sibling
|
|
11
|
+
// VariableName means no alias — local name === imported name.
|
|
12
|
+
const name=doc.sliceString(child.from,child.to);imports.set(name,{source,imported:name})}for(const varName of group.getChildren("VariableName")){// `VariableName as VariableDefinition` — the alias pair.
|
|
13
|
+
const parent=varName.parent;if(!parent)continue;const aliasDef=parent.getChildren("VariableDefinition").find(d=>d.from>varName.to);aliasDef&&imports.set(doc.sliceString(aliasDef.from,aliasDef.to),{source,imported:doc.sliceString(varName.from,varName.to)})}}}}),imports}// Finds the nearest enclosing ImportDeclaration, if any — used by the import
|
|
14
|
+
// module-specifier and named-symbol completions, which both need the
|
|
15
|
+
// declaration's own source string regardless of where inside it the cursor
|
|
16
|
+
// currently sits.
|
|
17
|
+
function findImportDeclaration(node){for(let cur=node;cur;cur=cur.parent)if("ImportDeclaration"===cur.name)return cur;return null}function getImportSource(state,importDecl){const stringNode=importDecl.getChild("String");if(!stringNode)return null;const raw=state.doc.sliceString(stringNode.from,stringNode.to);return raw.slice(1,-1)}// Local/imported names already listed in this ImportDeclaration's own
|
|
18
|
+
// ImportGroup, so the named-symbol completion doesn't re-suggest something
|
|
19
|
+
// the statement already imports.
|
|
20
|
+
function getImportGroupNames(state,importDecl){const names=new Set,group=importDecl.getChild("ImportGroup");if(!group)return names;for(const child of group.getChildren("VariableDefinition"))names.add(state.doc.sliceString(child.from,child.to));for(const varName of group.getChildren("VariableName"))names.add(state.doc.sliceString(varName.from,varName.to));return names}// Classifies the cursor position relative to the nearest enclosing JSX tag,
|
|
21
|
+
// if any: 'tag-name' when completing the element name itself (right after
|
|
22
|
+
// `<` or `</`), 'attribute-name' when inside an open tag's attribute list,
|
|
23
|
+
// otherwise null (plain expression/statement context).
|
|
24
|
+
function classifyJsxContext(state,pos){const tree=language.syntaxTree(state),node=tree.resolveInner(pos,-1);for(let cur=node;cur;cur=cur.parent){if("JSXOpenTag"===cur.name||"JSXSelfClosingTag"===cur.name||"JSXStartTag"===cur.name){const openTag="JSXStartTag"===cur.name?cur.parent:cur;if(!openTag)break;const tagIdentifier=openTag.getChild("JSXIdentifier");// Inside the tag name itself (cursor within/immediately after it, and
|
|
25
|
+
// no attribute has started yet).
|
|
26
|
+
return tagIdentifier&&pos<=tagIdentifier.to&&pos>=tagIdentifier.from?{kind:"tag-name",openTag}:tagIdentifier&&pos<tagIdentifier.from?{kind:"tag-name",openTag}:{kind:"attribute-name",openTag}}if("JSXAttribute"===cur.name){const openTag=cur.parent;if(openTag)return{kind:"attribute-name",openTag}}// Anything further out than the element itself is a normal
|
|
27
|
+
// expression/statement context, not a tag we're inside.
|
|
28
|
+
if("JSXElement"===cur.name||"JSXFragment"===cur.name)break}return null}function getTagName(state,openTag){const identifier=openTag.getChild("JSXIdentifier");return identifier?state.doc.sliceString(identifier.from,identifier.to):null}function calleeText(state,call){const callee=call.firstChild;return callee?state.doc.sliceString(callee.from,callee.to):null}// Detects whether the cursor sits inside a React Native style dictionary:
|
|
29
|
+
// either a JSX `style={{ ... }}` attribute value, or one of the per-key
|
|
30
|
+
// objects passed to `StyleSheet.create({ ... })` (or an equivalent factory
|
|
31
|
+
// name supplied via `styleFactories`). Only the *nearest* enclosing
|
|
32
|
+
// ObjectExpression is considered — the outer object passed to
|
|
33
|
+
// StyleSheet.create has arbitrary developer-chosen keys (its values are the
|
|
34
|
+
// actual style dicts), not style property names itself.
|
|
35
|
+
function findStyleObjectContext(state,pos,styleFactories=DEFAULT_STYLE_FACTORIES){const tree=language.syntaxTree(state);for(let cur=tree.resolveInner(pos,-1);cur;cur=cur.parent){if("ObjectExpression"!==cur.name)continue;const parent=cur.parent;if(parent&&"JSXEscape"===parent.name){const attr=parent.parent;if(attr&&"JSXAttribute"===attr.name){const idNode=attr.getChild("JSXIdentifier");if(idNode&&"style"===state.doc.sliceString(idNode.from,idNode.to))return cur}}// Nested inside `<factory>({ key: { ← here } })`.
|
|
36
|
+
if(parent&&"Property"===parent.name){const outerObject=parent.parent;if(outerObject&&"ObjectExpression"===outerObject.name){const argList=outerObject.parent;if(argList&&"ArgList"===argList.name){const call=argList.parent;if(call&&"CallExpression"===call.name){const text=calleeText(state,call);if(text&&styleFactories.includes(text))return cur}}}}// Only the nearest enclosing ObjectExpression is ever a candidate.
|
|
37
|
+
break}return null}function classifyStylePosition(state,pos,objectExpression){for(const property of objectExpression.getChildren("Property")){if(pos<property.from||pos>property.to)continue;const colon=property.getChild(":"),propDef=property.getChild("PropertyDefinition"),propertyName=propDef?state.doc.sliceString(propDef.from,propDef.to):void 0;return colon&&pos>colon.to?{kind:"value",objectExpression,property,propertyName}:{kind:"name",objectExpression,property}}return{kind:"name",objectExpression}}function getExistingStyleKeys(state,objectExpression){const keys=new Set;for(const property of objectExpression.getChildren("Property")){const propDef=property.getChild("PropertyDefinition");propDef&&keys.add(state.doc.sliceString(propDef.from,propDef.to))}return keys}function mergeModules(config){return null!==config&&void 0!==config&&config.modules?Object.assign(Object.assign({},BUILTIN_MODULES),config.modules):BUILTIN_MODULES}function resolveEntry(modules,source,localName,imported){const moduleExports=modules[source];if(!moduleExports)return null;const exportedName="default"===imported||"*"===imported?localName:imported,entry=moduleExports[exportedName];return entry?{entry,exportedName}:null}function completeImportModuleSpecifier(context,modules){const word=context.matchBefore(MODULE_SPECIFIER_WORD),from=word?word.from:context.pos,options=Object.keys(modules).map(name=>({label:name,type:"namespace"}));return{from,options,validFor:MODULE_SPECIFIER_WORD}}function completeImportSymbols(context,importDecl,modules){const source=getImportSource(context.state,importDecl);if(!source)return null;const moduleExports=modules[source];if(!moduleExports)return null;const alreadyImported=getImportGroupNames(context.state,importDecl),word=context.matchBefore(IDENTIFIER_WORD),from=word?word.from:context.pos,options=Object.entries(moduleExports).filter(([name])=>!alreadyImported.has(name)).map(([name,entry])=>({label:name,type:"function"===entry.type?"function":"type"===entry.type?"class":"variable",detail:entry.detail||source}));return options.length?{from,options,validFor:/^[\w$]*$/}:null}function completeStyleProperty(context,styleFactories){var _a;const objectExpression=findStyleObjectContext(context.state,context.pos,styleFactories);if(!objectExpression)return null;const position=classifyStylePosition(context.state,context.pos,objectExpression);if("value"===position.kind){const values=position.propertyName?STYLE_PROPERTIES[position.propertyName]:void 0;if(!values)return null;const valueNode=null===(_a=position.property)||void 0===_a?void 0:_a.getChild("String"),insideString=!!valueNode&&context.pos>valueNode.from&&context.pos<=valueNode.to,word=context.matchBefore(STYLE_VALUE_WORD),from=word?word.from:context.pos,options=insideString?values.map(v=>({label:v,type:"constant"})):values.map(v=>({label:v,type:"constant",apply:`'${v}'`}));return{from,options,validFor:STYLE_VALUE_WORD}}const existing=getExistingStyleKeys(context.state,objectExpression),word=context.matchBefore(IDENTIFIER_WORD),from=word?word.from:context.pos,options=Object.keys(STYLE_PROPERTIES).filter(name=>!existing.has(name)).map(name=>({label:name,type:"property"}));return{from,options,validFor:/^[\w$]*$/}}/**
|
|
38
|
+
* Builds the React/React Native contextual CompletionSource: import-scoped
|
|
39
|
+
* hook/component/prop suggestions, JSX tag-name and attribute-name
|
|
40
|
+
* completion, RN style dictionary property/value completion (inside
|
|
41
|
+
* `style={{ }}` or `StyleSheet.create({ ... })`), and import statement
|
|
42
|
+
* completion (module specifiers, then that module's exports).
|
|
43
|
+
*
|
|
44
|
+
* Nothing from `modules` is ever suggested as a hook/component/prop unless
|
|
45
|
+
* its local name is actually present in the current document's own import
|
|
46
|
+
* statements — this is the scoping rule the completion source is built
|
|
47
|
+
* around, not an incidental detail.
|
|
48
|
+
*/function reactNativeCompletionSource(config){var _a;const modules=mergeModules(config),styleFactories=(null===(_a=null===config||void 0===config?void 0:config.styleFactories)||void 0===_a?void 0:_a.length)?[...new Set([...config.styleFactories,"StyleSheet.create"])]:["StyleSheet.create"];return context=>{const{state,pos}=context,tree=language.syntaxTree(state),node=tree.resolveInner(pos,-1),importDecl=findImportDeclaration(node);if(importDecl){const stringNode=importDecl.getChild("String");if(stringNode&&pos>=stringNode.from&&pos<=stringNode.to)return completeImportModuleSpecifier(context,modules);if(importDecl.getChild("ImportGroup"))return completeImportSymbols(context,importDecl,modules)}const styleResult=completeStyleProperty(context,styleFactories);if(styleResult)return styleResult;const imports=collectImports(state);if(0===imports.size)return null;const jsxContext=classifyJsxContext(state,pos);if(jsxContext&&"tag-name"===jsxContext.kind){const word=context.matchBefore(IDENTIFIER_WORD),from=word?word.from:pos,options=[];for(const[localName,importInfo]of imports){const found=resolveEntry(modules,importInfo.source,localName,importInfo.imported);found&&"type"===found.entry.type&&options.push({label:localName,type:"class",detail:found.entry.detail||importInfo.source})}return options.length?{from,options,validFor:/^[\w$]*$/}:null}if(jsxContext&&"attribute-name"===jsxContext.kind){const tagName=getTagName(state,jsxContext.openTag);if(!tagName)return null;const importInfo=imports.get(tagName);if(!importInfo)return null;const found=resolveEntry(modules,importInfo.source,tagName,importInfo.imported);if(!found||!found.entry.props)return null;const word=context.matchBefore(IDENTIFIER_WORD),from=word?word.from:pos,options=found.entry.props.map(prop=>({label:prop,type:"property"}));return{from,options,validFor:/^[\w$]*$/}}// General scope: offer every imported hook/variable/component by name,
|
|
49
|
+
// e.g. `useSta|` outside any JSX.
|
|
50
|
+
const word=context.matchBefore(IDENTIFIER_WORD);if(!word||word.from===word.to&&!context.explicit)return null;const options=[];for(const[localName,importInfo]of imports){const found=resolveEntry(modules,importInfo.source,localName,importInfo.imported);found&&options.push({label:localName,type:"function"===found.entry.type?"function":"type"===found.entry.type?"class":"variable",detail:found.entry.detail||importInfo.source})}return options.length?{from:word.from,options,validFor:/^[\w$]*$/}:null}}if(hasRequiredCodemirrorLangReactNative)return codemirrorLangReactNative;hasRequiredCodemirrorLangReactNative=1;var language=require$$0;// Curated completion data. Only `react` and `react-native` are baked in here
|
|
51
|
+
// since every React Native project has them; anything else (expo-image,
|
|
52
|
+
// react-native-safe-area-context, @shopify/react-native-skia, ...) is
|
|
53
|
+
// supplied by the consumer via ReactNativeCompletionConfig.modules and merged
|
|
54
|
+
// on top of these built-ins (see completion.ts's mergeModules).
|
|
55
|
+
//
|
|
56
|
+
// This is a hand-curated subset, not derived from the packages' own .d.ts
|
|
57
|
+
// files — JSX prop types involve unions/generics/extends chains that aren't
|
|
58
|
+
// worth fully modeling for editor completion, and CodeMirror can't validate
|
|
59
|
+
// TypeScript anyway, so a maintained list of the props people actually reach
|
|
60
|
+
// for carries the value at a fraction of the fragility.
|
|
61
|
+
const COMMON_VIEW_PROPS=["style","children","testID","pointerEvents","onLayout","accessible","accessibilityLabel","accessibilityRole","hitSlop"],react={useState:{type:"function",detail:"useState(initialState)"},useEffect:{type:"function",detail:"useEffect(setup, deps?)"},useLayoutEffect:{type:"function",detail:"useLayoutEffect(setup, deps?)"},useMemo:{type:"function",detail:"useMemo(factory, deps)"},useCallback:{type:"function",detail:"useCallback(fn, deps)"},useRef:{type:"function",detail:"useRef(initialValue)"},useContext:{type:"function",detail:"useContext(Context)"},useReducer:{type:"function",detail:"useReducer(reducer, initialState)"},useId:{type:"function",detail:"useId()"},useTransition:{type:"function",detail:"useTransition()"},useDeferredValue:{type:"function",detail:"useDeferredValue(value)"},useImperativeHandle:{type:"function",detail:"useImperativeHandle(ref, createHandle, deps?)"},createContext:{type:"function",detail:"createContext(defaultValue)"},memo:{type:"function",detail:"memo(Component)"},forwardRef:{type:"function",detail:"forwardRef(render)"},Fragment:{type:"type"},StrictMode:{type:"type"}},reactNative={View:{type:"type",props:[...COMMON_VIEW_PROPS]},Text:{type:"type",props:["style","children","numberOfLines","ellipsizeMode","onPress","selectable","testID"]},ScrollView:{type:"type",props:[...COMMON_VIEW_PROPS,"contentContainerStyle","horizontal","showsVerticalScrollIndicator","showsHorizontalScrollIndicator","onScroll","scrollEventThrottle","refreshControl","keyboardShouldPersistTaps"]},FlatList:{type:"type",props:["data","renderItem","keyExtractor","style","contentContainerStyle","horizontal","numColumns","onEndReached","onEndReachedThreshold","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","ItemSeparatorComponent","refreshing","onRefresh","getItemLayout"]},SectionList:{type:"type",props:["sections","renderItem","renderSectionHeader","keyExtractor","style","stickySectionHeadersEnabled"]},Image:{type:"type",props:["source","style","resizeMode","onLoad","onError","defaultSource","blurRadius"]},ImageBackground:{type:"type",props:["source","style","imageStyle","resizeMode","children"]},Pressable:{type:"type",props:["onPress","onLongPress","onPressIn","onPressOut","style","disabled","hitSlop","android_ripple","children"]},TouchableOpacity:{type:"type",props:["onPress","onLongPress","style","activeOpacity","disabled","hitSlop","children"]},TouchableHighlight:{type:"type",props:["onPress","onLongPress","style","underlayColor","disabled","children"]},TouchableWithoutFeedback:{type:"type",props:["onPress","onLongPress","children"]},TextInput:{type:"type",props:["value","defaultValue","onChangeText","onSubmitEditing","onFocus","onBlur","placeholder","placeholderTextColor","style","secureTextEntry","keyboardType","autoCapitalize","autoCorrect","multiline","numberOfLines","editable","maxLength"]},Switch:{type:"type",props:["value","onValueChange","disabled","trackColor","thumbColor","style"]},Button:{type:"type",props:["title","onPress","color","disabled","accessibilityLabel"]},ActivityIndicator:{type:"type",props:["animating","color","size","style","hidesWhenStopped"]},Modal:{type:"type",props:["visible","animationType","transparent","onRequestClose","presentationStyle","children"]},SafeAreaView:{type:"type",props:[...COMMON_VIEW_PROPS]},KeyboardAvoidingView:{type:"type",props:[...COMMON_VIEW_PROPS,"behavior","keyboardVerticalOffset","enabled"]},StatusBar:{type:"type",props:["barStyle","backgroundColor","hidden","translucent","animated"]},Animated:{type:"variable"},StyleSheet:{type:"variable",detail:"StyleSheet.create({...})"},Dimensions:{type:"variable",detail:"Dimensions.get(\"window\")"},Platform:{type:"variable",detail:"Platform.OS / Platform.select({...})"},Alert:{type:"variable",detail:"Alert.alert(title, message)"},Keyboard:{type:"variable"},Linking:{type:"variable"},Vibration:{type:"variable"},PanResponder:{type:"variable",detail:"PanResponder.create({...})"},LayoutAnimation:{type:"variable"},useColorScheme:{type:"function",detail:"useColorScheme()"},useWindowDimensions:{type:"function",detail:"useWindowDimensions()"}},BUILTIN_MODULES={react,"react-native":reactNative},STYLE_PROPERTIES={// Flexbox / layout
|
|
62
|
+
alignContent:["flex-start","flex-end","center","stretch","space-between","space-around"],alignItems:["flex-start","flex-end","center","stretch","baseline"],alignSelf:["auto","flex-start","flex-end","center","stretch","baseline"],aspectRatio:void 0,borderBottomWidth:void 0,borderEndWidth:void 0,borderLeftWidth:void 0,borderRightWidth:void 0,borderStartWidth:void 0,borderTopWidth:void 0,borderWidth:void 0,bottom:void 0,columnGap:void 0,direction:["inherit","ltr","rtl"],display:["flex","none"],end:void 0,flex:void 0,flexBasis:void 0,flexDirection:["row","row-reverse","column","column-reverse"],flexGrow:void 0,flexShrink:void 0,flexWrap:["wrap","nowrap","wrap-reverse"],gap:void 0,height:void 0,justifyContent:["flex-start","flex-end","center","space-between","space-around","space-evenly"],left:void 0,margin:void 0,marginBottom:void 0,marginEnd:void 0,marginHorizontal:void 0,marginLeft:void 0,marginRight:void 0,marginStart:void 0,marginTop:void 0,marginVertical:void 0,maxHeight:void 0,maxWidth:void 0,minHeight:void 0,minWidth:void 0,overflow:["visible","hidden","scroll"],padding:void 0,paddingBottom:void 0,paddingEnd:void 0,paddingHorizontal:void 0,paddingLeft:void 0,paddingRight:void 0,paddingStart:void 0,paddingTop:void 0,paddingVertical:void 0,position:["absolute","relative","static"],right:void 0,rowGap:void 0,start:void 0,top:void 0,width:void 0,zIndex:void 0,// Border / background / shadow
|
|
63
|
+
backgroundColor:void 0,borderColor:void 0,borderTopColor:void 0,borderBottomColor:void 0,borderLeftColor:void 0,borderRightColor:void 0,borderRadius:void 0,borderTopLeftRadius:void 0,borderTopRightRadius:void 0,borderBottomLeftRadius:void 0,borderBottomRightRadius:void 0,borderStyle:["solid","dotted","dashed"],opacity:void 0,elevation:void 0,shadowColor:void 0,shadowOffset:void 0,shadowOpacity:void 0,shadowRadius:void 0,transform:void 0,// Text
|
|
64
|
+
color:void 0,fontFamily:void 0,fontSize:void 0,fontStyle:["normal","italic"],fontWeight:["normal","bold","100","200","300","400","500","600","700","800","900"],letterSpacing:void 0,lineHeight:void 0,textAlign:["auto","left","right","center","justify"],textAlignVertical:["auto","top","bottom","center"],textDecorationLine:["none","underline","line-through","underline line-through"],textDecorationColor:void 0,textDecorationStyle:["solid","double","dotted","dashed"],textShadowColor:void 0,textShadowOffset:void 0,textShadowRadius:void 0,textTransform:["none","uppercase","lowercase","capitalize"],writingDirection:["auto","ltr","rtl"],// Image
|
|
65
|
+
resizeMode:["cover","contain","stretch","repeat","center"],overlayColor:void 0,tintColor:void 0},DEFAULT_STYLE_FACTORIES=["StyleSheet.create"],IDENTIFIER_WORD=/[A-Za-z_$][\w$]*$/,MODULE_SPECIFIER_WORD=/[\w@/.-]*$/,STYLE_VALUE_WORD=/[\w-]*$/;// RN StyleSheet property names → curated enum values (undefined means the
|
|
66
|
+
// value is free-form — a color, number, or dimension — and isn't worth a
|
|
67
|
+
// suggestion list). Deliberately not split by View/Text/Image since a JSX
|
|
68
|
+
// element's own component type isn't cross-referenced when completing inside
|
|
69
|
+
// its style object — a handful of Text-only properties showing up for a View
|
|
70
|
+
// style dict is an acceptable false positive for the simplicity it buys.
|
|
71
|
+
return codemirrorLangReactNative.BUILTIN_MODULES=BUILTIN_MODULES,codemirrorLangReactNative.STYLE_PROPERTIES=STYLE_PROPERTIES,codemirrorLangReactNative.classifyJsxContext=classifyJsxContext,codemirrorLangReactNative.classifyStylePosition=classifyStylePosition,codemirrorLangReactNative.collectImports=collectImports,codemirrorLangReactNative.findImportDeclaration=findImportDeclaration,codemirrorLangReactNative.findStyleObjectContext=findStyleObjectContext,codemirrorLangReactNative.getExistingStyleKeys=getExistingStyleKeys,codemirrorLangReactNative.getImportGroupNames=getImportGroupNames,codemirrorLangReactNative.getImportSource=getImportSource,codemirrorLangReactNative.getTagName=getTagName,codemirrorLangReactNative.reactNativeCompletionSource=reactNativeCompletionSource,codemirrorLangReactNative}(),index=/*@__PURE__*/function getDefaultExportFromCjs(x){return x}(codemirrorLangReactNativeExports);return module.exports=index,module.exports}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
async function moduleInitFunction(requireAsyncModule,exports={}){const module={exports:exports};var hasRequiredCodemirrorLangSksl,require$$0=await requireAsyncModule("@lezer/lr"),require$$1=await requireAsyncModule("@lezer/highlight"),require$$2=await requireAsyncModule("@codemirror/language"),codemirrorLangSksl={},codemirrorLangSkslExports=function requireCodemirrorLangSksl(){function sksl(){return new language.LanguageSupport(skslLanguage)}if(hasRequiredCodemirrorLangSksl)return codemirrorLangSksl;hasRequiredCodemirrorLangSksl=1;var lr=require$$0,highlight=require$$1,language=require$$2;const skslHighlighting=highlight.styleTags({// Keywords
|
|
1
|
+
async function moduleInitFunction(requireAsyncModule,exports={}){const module={exports:exports};var hasRequiredCodemirrorLangSksl,require$$0=await requireAsyncModule("@lezer/lr"),require$$1=await requireAsyncModule("@lezer/highlight"),require$$2=await requireAsyncModule("@codemirror/language"),require$$3=await requireAsyncModule("@codemirror/autocomplete"),codemirrorLangSksl={},codemirrorLangSkslExports=function requireCodemirrorLangSksl(){function sksl(){return new language.LanguageSupport(skslLanguage,skslLanguage.data.of({autocomplete:skslCompletionSource}))}if(hasRequiredCodemirrorLangSksl)return codemirrorLangSksl;hasRequiredCodemirrorLangSksl=1;var lr=require$$0,highlight=require$$1,language=require$$2,autocomplete=require$$3;const skslHighlighting=highlight.styleTags({// Keywords
|
|
2
2
|
"if else for while do return discard break continue":highlight.tags.controlKeyword,struct:highlight.tags.definitionKeyword,"uniform const in out inout flat noperspective":highlight.tags.modifier,// Type names (built-in types only — identifier fallback handled separately)
|
|
3
3
|
"void bool int uint float double half":highlight.tags.typeName,"bool2 bool3 bool4 bvec2 bvec3 bvec4":highlight.tags.typeName,"int2 int3 int4 ivec2 ivec3 ivec4":highlight.tags.typeName,"uint2 uint3 uint4 uvec2 uvec3 uvec4":highlight.tags.typeName,"float2 float3 float4 vec2 vec3 vec4":highlight.tags.typeName,"half2 half3 half4":highlight.tags.typeName,"double2 double3 double4 dvec2 dvec3 dvec4":highlight.tags.typeName,"float2x2 float3x3 float4x4":highlight.tags.typeName,"float2x3 float2x4 float3x2 float3x4 float4x2 float4x3":highlight.tags.typeName,"mat2 mat3 mat4":highlight.tags.typeName,"mat2x2 mat2x3 mat2x4 mat3x2 mat3x3 mat3x4 mat4x2 mat4x3 mat4x4":highlight.tags.typeName,"half2x2 half3x3 half4x4":highlight.tags.typeName,"shader colorFilter blender sampler2D samplerCube":highlight.tags.typeName,// Identifiers
|
|
4
4
|
identifier:highlight.tags.variableName,// Function definition name
|
|
@@ -11,5 +11,10 @@ LineComment:highlight.tags.lineComment,BlockComment:highlight.tags.blockComment,
|
|
|
11
11
|
PreprocessorDirective:highlight.tags.processingInstruction,// Delimiters
|
|
12
12
|
"{ }":highlight.tags.brace,"( )":highlight.tags.paren,"[ ]":highlight.tags.squareBracket,"; ,":highlight.tags.separator,". ? :":highlight.tags.punctuation,// Operators
|
|
13
13
|
"logicalOr logicalAnd":highlight.tags.logicOperator,"eqOp relOp":highlight.tags.compareOperator,shiftOp:highlight.tags.bitwiseOperator,addOp:highlight.tags.arithmeticOperator,mulOp:highlight.tags.arithmeticOperator,unaryOp:highlight.tags.operator,assignOp:highlight.tags.definitionOperator,"| ^ &":highlight.tags.bitwiseOperator,// Field access dot
|
|
14
|
-
'FieldAccess/"."':highlight.tags.derefOperator}),spec_identifier={__proto__:null,uniform:12,void:16,bool:18,int:20,uint:22,float:24,double:26,half:28,bool2:30,bool3:32,bool4:34,bvec2:36,bvec3:38,bvec4:40,int2:42,int3:44,int4:46,ivec2:48,ivec3:50,ivec4:52,uint2:54,uint3:56,uint4:58,uvec2:60,uvec3:62,uvec4:64,float2:66,float3:68,float4:70,vec2:72,vec3:74,vec4:76,half2:78,half3:80,half4:82,double2:84,double3:86,double4:88,dvec2:90,dvec3:92,dvec4:94,float2x2:96,float3x3:98,float4x4:100,float2x3:102,float2x4:104,float3x2:106,float3x4:108,float4x2:110,float4x3:112,mat2:114,mat3:116,mat4:118,mat2x2:120,mat2x3:122,mat2x4:124,mat3x2:126,mat3x3:128,mat3x4:130,mat4x2:132,mat4x3:134,mat4x4:136,half2x2:138,half3x3:140,half4x4:142,shader:144,colorFilter:146,blender:148,sampler2D:150,samplerCube:152,return:198,if:202,else:204,for:208,const:212,in:214,out:216,inout:218,flat:220,noperspective:222,while:228,do:232,discard:236,break:240,continue:244,struct:248},parser=lr.LRParser.deserialize({version:14,states:";lQ]QPOOOOQO'#FT'#FTO&cQPO'#EiO+`QPO'#EiOOQO'#FZ'#FZO+hQPO'#FZOOQO'#FO'#FOQ]QPOOOOQO'#Cc'#CcO+mQPO'#CaOOQO'#Fo'#FoO0WQPO'#E{OOQO-E9R-E9RO0]QPO,5;TO0eQPO'#D}O0xQPO,5:xO1ZQPO'#FpOOQO,5;T,5;TO0`QPO,5;TOOQO,5;u,5;uOOQO-E8|-E8|O1cQPO,58{O1kQPO,5;gO1pQPO'#FqOOQO1G0o1G0oO0`QPO1G0oOOQO'#ES'#ESO0hQPO'#ESO2OQQO'#EROOQO'#EQ'#EQO0hQPO'#EQO4ZQQO,5:iOOQO'#F]'#F]OOQO,5:i,5:iO0hQPO,5<]O4bQPO,5<]O4mQPO1G0dO0`QPO'#FUO4tQPO,5<[O4|QPO1G.gO5RQPO1G.gO5WQPO1G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#fQ$U#qQ$a$WQ$e$YQ$i$dQ$o$jQ$r$lQ$t$nQ%P%QQ%X%^Q%[%YQ%]%ZR%`%_R!t!OR!ftQ!dtR#h#VS#n#X#oQ$Z#uQ$m$gS$q$k%SS$v$p%TS$x$s%US$z$u%VS$|$y%WR$}%OQ$d$XR%_%byPOQV#X#o#u$X$g$k$p$s$u$y%O%S%T%U%V%W%bSaR#jSh]bRziY`R]bi#jR!guT!ly!m",nodeNames:"\u26A0 LineComment BlockComment Program ; UniformDecl uniform TypeName void bool int uint float double half bool2 bool3 bool4 bvec2 bvec3 bvec4 int2 int3 int4 ivec2 ivec3 ivec4 uint2 uint3 uint4 uvec2 uvec3 uvec4 float2 float3 float4 vec2 vec3 vec4 half2 half3 half4 double2 double3 double4 dvec2 dvec3 dvec4 float2x2 float3x3 float4x4 float2x3 float2x4 float3x2 float3x4 float4x2 float4x3 mat2 mat3 mat4 mat2x2 mat2x3 mat2x4 mat3x2 mat3x3 mat3x4 mat4x2 mat4x3 mat4x4 half2x2 half3x3 half4x4 shader colorFilter blender sampler2D samplerCube ] [ ArraySuffix ? : UnaryExpr PostfixExpr PrimaryExpr Literal ( ) FieldAccess . IndexAccess CallArgs , PostfixOp FunctionDef } { Block ReturnStmt return IfStmt if else ForStmt for VarDecl const in out inout flat noperspective ExprStmt WhileStmt while DoWhileStmt do DiscardStmt discard BreakStmt break ContinueStmt continue StructDef struct PreprocessorDirective",maxTerm:161,nodeProps:[["openedBy",77,"[",87,"(",95,"{"],["closedBy",78,"]",86,")",96,"}"]],propSources:[skslHighlighting],skippedNodes:[0,1,2],repeatNodeCount:8,tokenData:"-t~RrXY#]YZ#]]^#]pq#]qr#nst#{uv$dvw$qxy%Ryz%Wz{$d{|%]|}%q}!O%v!O!P&T!P!Q'h!Q!R)f!R![)}![!]+Q!]!^+V!^!_+[!_!`+t!`!a,O!a!b,Z!c!},`!}#O,q#P#Q,v#Q#R,{#R#S,`#T#o,`#o#p-T#p#q-Y#q#r-j#r#s-o~#bS#|~XY#]YZ#]]^#]pq#]R#sP$^P!_!`#vQ#{O$UQ~$QS#q~OY#{Z;'S#{;'S;=`$^<%lO#{~$aP;=`<%l#{~$iP$Q~!_!`$lQ$qO$[Q~$vQ$V~vw$|!_!`$l~%RO$Y~~%WO!x~~%]O!y~~%dQ$^P$R~{|%j!_!`$l~%qO#P~$^P~%vO#O~~%}Q$^P$R~}!O%j!_!`$lR&YP!{Q!Q![&]P&bT!wP!Q![&]!g!h&q!h!i'c#X#Y&q#Y#Z'cP&tR{|&}}!O&}!Q!['TP'QP!Q!['TP'YR!wP!Q!['T!h!i'c#Y#Z'cP'hO!wP~'mR$Q~z{'v!P!Q(}!_!`$l~'yTOz'vz{(Y{;'S'v;'S;=`(w<%lO'v~(]VOz'vz{(Y{!P'v!P!Q(r!Q;'S'v;'S;=`(w<%lO'v~(wOQ~~(zP;=`<%l'v~)SSP~OY(}Z;'S(};'S;=`)`<%lO(}~)cP;=`<%l(}P)kU!wP!O!P&]!Q![)}!g!h&q#X#Y&q#i#j'c#l#m*cP*ST!wP!O!P&]!Q![)}!g!h&q#X#Y&q#i#j'cP*fR!Q![*o!c!i*o#T#Z*oP*tS!wP!Q![*o!c!i*o#T#Z*o#i#j'c~+VO!s~~+[OS~~+aQ$T~!^!_+g!_!`+o~+lP$S~!_!`$l~+tO$T~R+{P$fP$[Q!_!`#v~,TQ$T~!_!`+o!`!a+g~,`O!r~~,eS$O~!Q![,`!c!},`#R#S,`#T#o,`~,vO!p~~,{O!o~~-QP$W~!_!`$l~-YO#S~~-_Q$X~!_!`$l#p#q-e~-jO$Z~~-oO#R~P-tO$^P",tokenizers:[0,1],topRules:{Program:[0,3]},specialized:[{term:138,get:value=>spec_identifier[value]||-1}],tokenPrec:2893}),skslLanguage=language.LRLanguage.define({parser:parser.configure({props:[language.indentNodeProp.add({Block:language.delimitedIndent({closing:"}",align:!1})}),language.foldNodeProp.add({Block:language.foldInside,StructDef:language.foldInside})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/}});// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
14
|
+
'FieldAccess/"."':highlight.tags.derefOperator}),spec_identifier={__proto__:null,uniform:12,void:16,bool:18,int:20,uint:22,float:24,double:26,half:28,bool2:30,bool3:32,bool4:34,bvec2:36,bvec3:38,bvec4:40,int2:42,int3:44,int4:46,ivec2:48,ivec3:50,ivec4:52,uint2:54,uint3:56,uint4:58,uvec2:60,uvec3:62,uvec4:64,float2:66,float3:68,float4:70,vec2:72,vec3:74,vec4:76,half2:78,half3:80,half4:82,double2:84,double3:86,double4:88,dvec2:90,dvec3:92,dvec4:94,float2x2:96,float3x3:98,float4x4:100,float2x3:102,float2x4:104,float3x2:106,float3x4:108,float4x2:110,float4x3:112,mat2:114,mat3:116,mat4:118,mat2x2:120,mat2x3:122,mat2x4:124,mat3x2:126,mat3x3:128,mat3x4:130,mat4x2:132,mat4x3:134,mat4x4:136,half2x2:138,half3x3:140,half4x4:142,shader:144,colorFilter:146,blender:148,sampler2D:150,samplerCube:152,return:198,if:202,else:204,for:208,const:212,in:214,out:216,inout:218,flat:220,noperspective:222,while:228,do:232,discard:236,break:240,continue:244,struct:248},parser=lr.LRParser.deserialize({version:14,states:";lQ]QPOOOOQO'#FT'#FTO&cQPO'#EiO+`QPO'#EiOOQO'#FZ'#FZO+hQPO'#FZOOQO'#FO'#FOQ]QPOOOOQO'#Cc'#CcO+mQPO'#CaOOQO'#Fo'#FoO0WQPO'#E{OOQO-E9R-E9RO0]QPO,5;TO0eQPO'#D}O0xQPO,5:xO1ZQPO'#FpOOQO,5;T,5;TO0`QPO,5;TOOQO,5;u,5;uOOQO-E8|-E8|O1cQPO,58{O1kQPO,5;gO1pQPO'#FqOOQO1G0o1G0oO0`QPO1G0oOOQO'#ES'#ESO0hQPO'#ESO2OQQO'#EROOQO'#EQ'#EQO0hQPO'#EQO4ZQQO,5:iOOQO'#F]'#F]OOQO,5:i,5:iO0hQPO,5<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P!]Q#Q!^Q#R!_Q#S!br#k#X#o#u$X$g$k$p$s$u$y%O%S%T%U%V%W%bQ#}#cQ$P#fQ$U#qQ$a$WQ$e$YQ$i$dQ$o$jQ$r$lQ$t$nQ%P%QQ%X%^Q%[%YQ%]%ZR%`%_R!t!OR!ftQ!dtR#h#VS#n#X#oQ$Z#uQ$m$gS$q$k%SS$v$p%TS$x$s%US$z$u%VS$|$y%WR$}%OQ$d$XR%_%byPOQV#X#o#u$X$g$k$p$s$u$y%O%S%T%U%V%W%bSaR#jSh]bRziY`R]bi#jR!guT!ly!m",nodeNames:"\u26A0 LineComment BlockComment Program ; UniformDecl uniform TypeName void bool int uint float double half bool2 bool3 bool4 bvec2 bvec3 bvec4 int2 int3 int4 ivec2 ivec3 ivec4 uint2 uint3 uint4 uvec2 uvec3 uvec4 float2 float3 float4 vec2 vec3 vec4 half2 half3 half4 double2 double3 double4 dvec2 dvec3 dvec4 float2x2 float3x3 float4x4 float2x3 float2x4 float3x2 float3x4 float4x2 float4x3 mat2 mat3 mat4 mat2x2 mat2x3 mat2x4 mat3x2 mat3x3 mat3x4 mat4x2 mat4x3 mat4x4 half2x2 half3x3 half4x4 shader colorFilter blender sampler2D samplerCube ] [ ArraySuffix ? : UnaryExpr PostfixExpr PrimaryExpr Literal ( ) FieldAccess . IndexAccess CallArgs , PostfixOp FunctionDef } { Block ReturnStmt return IfStmt if else ForStmt for VarDecl const in out inout flat noperspective ExprStmt WhileStmt while DoWhileStmt do DiscardStmt discard BreakStmt break ContinueStmt continue StructDef struct PreprocessorDirective",maxTerm:161,nodeProps:[["openedBy",77,"[",87,"(",95,"{"],["closedBy",78,"]",86,")",96,"}"]],propSources:[skslHighlighting],skippedNodes:[0,1,2],repeatNodeCount:8,tokenData:"-t~RrXY#]YZ#]]^#]pq#]qr#nst#{uv$dvw$qxy%Ryz%Wz{$d{|%]|}%q}!O%v!O!P&T!P!Q'h!Q!R)f!R![)}![!]+Q!]!^+V!^!_+[!_!`+t!`!a,O!a!b,Z!c!},`!}#O,q#P#Q,v#Q#R,{#R#S,`#T#o,`#o#p-T#p#q-Y#q#r-j#r#s-o~#bS#|~XY#]YZ#]]^#]pq#]R#sP$^P!_!`#vQ#{O$UQ~$QS#q~OY#{Z;'S#{;'S;=`$^<%lO#{~$aP;=`<%l#{~$iP$Q~!_!`$lQ$qO$[Q~$vQ$V~vw$|!_!`$l~%RO$Y~~%WO!x~~%]O!y~~%dQ$^P$R~{|%j!_!`$l~%qO#P~$^P~%vO#O~~%}Q$^P$R~}!O%j!_!`$lR&YP!{Q!Q![&]P&bT!wP!Q![&]!g!h&q!h!i'c#X#Y&q#Y#Z'cP&tR{|&}}!O&}!Q!['TP'QP!Q!['TP'YR!wP!Q!['T!h!i'c#Y#Z'cP'hO!wP~'mR$Q~z{'v!P!Q(}!_!`$l~'yTOz'vz{(Y{;'S'v;'S;=`(w<%lO'v~(]VOz'vz{(Y{!P'v!P!Q(r!Q;'S'v;'S;=`(w<%lO'v~(wOQ~~(zP;=`<%l'v~)SSP~OY(}Z;'S(};'S;=`)`<%lO(}~)cP;=`<%l(}P)kU!wP!O!P&]!Q![)}!g!h&q#X#Y&q#i#j'c#l#m*cP*ST!wP!O!P&]!Q![)}!g!h&q#X#Y&q#i#j'cP*fR!Q![*o!c!i*o#T#Z*oP*tS!wP!Q![*o!c!i*o#T#Z*o#i#j'c~+VO!s~~+[OS~~+aQ$T~!^!_+g!_!`+o~+lP$S~!_!`$l~+tO$T~R+{P$fP$[Q!_!`#v~,TQ$T~!_!`+o!`!a+g~,`O!r~~,eS$O~!Q![,`!c!},`#R#S,`#T#o,`~,vO!p~~,{O!o~~-QP$W~!_!`$l~-YO#S~~-_Q$X~!_!`$l#p#q-e~-jO$Z~~-oO#R~P-tO$^P",tokenizers:[0,1],topRules:{Program:[0,3]},specialized:[{term:138,get:value=>spec_identifier[value]||-1}],tokenPrec:2893}),TYPES=["void","bool","int","float","half","bool2","bool3","bool4","int2","int3","int4","float2","float3","float4","half2","half3","half4","float2x2","float3x3","float4x4","half2x2","half3x3","half4x4","shader","colorFilter","blender"],QUALIFIERS=["in","out","inout","uniform","const","layout","struct","return","if","else","for","while","do","break","continue","discard","true","false"],FUNCTIONS=["sample","unpremul","premul","saturate","radians","degrees","sin","cos","tan","asin","acos","atan","pow","exp","log","exp2","log2","sqrt","inversesqrt","abs","sign","floor","ceil","fract","mod","min","max","clamp","mix","step","smoothstep","length","distance","dot","cross","normalize","reflect","refract","inverse","transpose","lessThan","lessThanEqual","greaterThan","greaterThanEqual","equal","notEqual","any","all","not"],VARIABLES=["sk_FragCoord"],completions=[...TYPES.map(label=>({label,type:"type"})),...QUALIFIERS.map(label=>({label,type:"keyword"})),...FUNCTIONS.map(label=>({label,type:"function",boost:-1})),...VARIABLES.map(label=>({label,type:"variable"}))],skslCompletionSource=autocomplete.completeFromList(completions),skslLanguage=language.LRLanguage.define({parser:parser.configure({props:[language.indentNodeProp.add({Block:language.delimitedIndent({closing:"}",align:!1})}),language.foldNodeProp.add({Block:language.foldInside,StructDef:language.foldInside})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/}});// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
15
|
+
// Built-in SkSL vocabulary. SkSL (Skia's shading language) is GLSL-derived
|
|
16
|
+
// but diverges in its scalar/vector naming (half*/float* instead of a single
|
|
17
|
+
// float* family) and its runtime-effect-specific types/functions — not
|
|
18
|
+
// exhaustive of every Skia version's additions, just the common surface a
|
|
19
|
+
// runtime-effect author actually types.
|
|
15
20
|
return codemirrorLangSksl.sksl=sksl,codemirrorLangSksl.skslLanguage=skslLanguage,codemirrorLangSksl}(),index=/*@__PURE__*/function getDefaultExportFromCjs(x){return x}(codemirrorLangSkslExports);return module.exports=index,module.exports}
|