@actualwave/react-native-codeditor 1.1.0 → 1.2.0
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 +28 -0
- package/README.md +16 -6
- package/SKILL.md +469 -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-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 +25 -1
- 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,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'#FQO9lQPO,5<[OOQO7+%y7+%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&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,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,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VORdVQ!QlR!u!QQ#d!rR$O#dQ#W!dR#i#WQ#o#XR$S#ovQOV#X#o#u$X$g$k$p$s$u$y%O%S%T%U%V%W%bR[QQv`R!hvQ!myR#_!mTUOVQo^Q{kQ!arQ!q}Q!r!OQ!v!SQ!w!TQ!x!UQ!y!VQ!z!WQ!{!XQ!|!YQ!}!ZQ#O![Q#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,"{"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{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'#FoO0W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$p$s$u$y%O%S%T%U%V%WT$b$X%bn#l#X#o#u$g$k$p$s$u$y%O%S%T%U%V%WT$c$X%bQVORdVQ!QlR!u!QQ#d!rR$O#dQ#W!dR#i#WQ#o#XR$S#ovQOV#X#o#u$X$g$k$p$s$u$y%O%S%T%U%V%W%bR[QQv`R!hvQ!myR#_!mTUOVQo^Q{kQ!arQ!q}Q!r!OQ!v!SQ!w!TQ!x!UQ!y!VQ!z!WQ!{!XQ!|!YQ!}!ZQ#O![Q#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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#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}
|
|
@@ -12,7 +12,7 @@ async function moduleInitFunction(requireAsyncModule,exports={}){const module={e
|
|
|
12
12
|
function ensureAnchor(expr,start){var _a;let{source}=expr,addStart=start&&"^"!=source[0],addEnd="$"!=source[source.length-1];return addStart||addEnd?new RegExp(`${addStart?"^":""}(?:${source})${addEnd?"$":""}`,null!==(_a=expr.flags)&&void 0!==_a?_a:expr.ignoreCase?"i":""):expr}/**
|
|
13
13
|
This annotation is added to transactions that are produced by
|
|
14
14
|
picking a completion.
|
|
15
|
-
|
|
15
|
+
*//**
|
|
16
16
|
Helper function that returns a transaction spec which inserts a
|
|
17
17
|
completion's text in the main selection range, and any other
|
|
18
18
|
selection range that has the same text in front of it.
|
|
@@ -54,7 +54,7 @@ function score(option){return 100*(option.boost||0)+(option.apply?10:0)+(option.
|
|
|
54
54
|
interpreted as indicating a placeholder.
|
|
55
55
|
*/function snippet(template){let snippet=Snippet.parse(template);return(editor,completion,from,to)=>{let{text,ranges}=snippet.instantiate(editor.state,from),{main}=editor.state.selection,spec={changes:{from,to:to==main.from?main.to:to,insert:state.Text.of(text)},scrollIntoView:!0,annotations:completion?[pickedCompletion.of(completion),state.Transaction.userEvent.of("input.complete")]:void 0};if(ranges.length&&(spec.selection=fieldSelection(ranges,0)),ranges.some(r=>0<r.field)){let active=new ActiveSnippet(ranges,0),effects=spec.effects=[setActive.of(active)];void 0===editor.state.field(snippetState,!1)&&effects.push(state.StateEffect.appendConfig.of([snippetState,addSnippetKeymap,snippetPointerHandler,baseTheme]))}editor.dispatch(editor.state.update(spec))}}function moveField(dir){return({state,dispatch})=>{let active=state.field(snippetState,!1);if(!active||0>dir&&0==active.active)return!1;let next=active.active+dir,last=0<dir&&!active.ranges.some(r=>r.field==next+dir);return dispatch(state.update({selection:fieldSelection(active.ranges,next),effects:setActive.of(last?null:new ActiveSnippet(active.ranges,next)),scrollIntoView:!0})),!0}}/**
|
|
56
56
|
A command that clears the active snippet, if any.
|
|
57
|
-
|
|
57
|
+
*//**
|
|
58
58
|
Check if there is an active snippet with a next field for
|
|
59
59
|
`nextSnippetField` to move to.
|
|
60
60
|
*/function hasNextSnippetField(state){let active=state.field(snippetState,!1);return!!(active&&active.ranges.some(r=>r.field==active.active+1))}/**
|
|
@@ -68,7 +68,7 @@ function score(option){return 100*(option.boost||0)+(option.apply?10:0)+(option.
|
|
|
68
68
|
A completion source that will scan the document for words (using a
|
|
69
69
|
[character categorizer](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer)), and
|
|
70
70
|
return those as completions.
|
|
71
|
-
|
|
71
|
+
*//**
|
|
72
72
|
Extension to enable bracket-closing behavior. When a closeable
|
|
73
73
|
bracket is typed, its closing bracket is immediately inserted
|
|
74
74
|
after the cursor. When closing a bracket directly in front of a
|
|
@@ -98,7 +98,7 @@ function handleSame(state$1,token,allowTriple,config){let stringPrefixes=config.
|
|
|
98
98
|
- PageDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true, "page")`
|
|
99
99
|
- PageUp: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(false, "page")`
|
|
100
100
|
- Enter: [`acceptCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.acceptCompletion)
|
|
101
|
-
|
|
101
|
+
*//**
|
|
102
102
|
Get the current completion status. When completions are available,
|
|
103
103
|
this will return `"active"`. When completions are pending (in the
|
|
104
104
|
process of being queried), this returns `"pending"`. Otherwise, it
|
|
@@ -175,9 +175,9 @@ let preciseTo=0,byWordTo=0,byWordFolded=!1,adjacentTo=0,adjacentStart=-1,adjacen
|
|
|
175
175
|
// a case folded character is encountered in such a match
|
|
176
176
|
// If we've found a partial adjacent match, these track its state
|
|
177
177
|
// Go over the option's text, scanning for the various kinds of matches
|
|
178
|
-
for(let next,i=0,e=Math.min(word.length,200),prevType=0/* Tp.NonWord */;i<e&&byWordTo<len;){next=state.codePointAt(word,i),0>direct&&(preciseTo<len&&next==chars[preciseTo]&&(precise[preciseTo++]=i),adjacentTo<len&&(next==chars[adjacentTo]||next==folded[adjacentTo]?(0==adjacentTo&&(adjacentStart=i),adjacentEnd=i+1,adjacentTo++):adjacentTo=0));let ch,type=255>next?48<=next&&57>=next||97<=next&&122>=next?2/* Tp.Lower */:65<=next&&90>=next?1/* Tp.Upper */:0/* Tp.NonWord */:(ch=state.fromCodePoint(next))==ch.toLowerCase()?ch==ch.toUpperCase()?0:2/* Tp.Lower */:1/* Tp.Upper */ /* Tp.NonWord */;(!i||1==type/* Tp.Upper */&&hasLower||0==prevType/* Tp.NonWord */&&0!=type/* Tp.NonWord */)&&(chars[byWordTo]==next||folded[byWordTo]==next&&(byWordFolded=!0)?byWord[byWordTo++]=i:byWord.length&&(wordAdjacent=!1)),prevType=type,i+=state.codePointSize(next)}return byWordTo==len&&0==byWord[0]&&wordAdjacent?this.result(-100/* Penalty.ByWord */+(byWordFolded?-200/* Penalty.CaseFold */:0),byWord,word):adjacentTo==len&&0==adjacentStart?this.ret(-200/* Penalty.CaseFold */-word.length+(adjacentEnd==word.length?0:-100/* Penalty.NotFull */),[0,adjacentEnd]):-1<direct?this.ret(-700/* Penalty.NotStart */-word.length,[direct,direct+this.pattern.length]):adjacentTo==len?this.ret(-900/* Penalty.NotStart */-word.length,[adjacentStart,adjacentEnd]):byWordTo==len?this.result(-100/* Penalty.ByWord */+(byWordFolded?-200/* Penalty.CaseFold */:0)+-700/* Penalty.NotStart */+(wordAdjacent?0:-1100/* Penalty.Gap */),byWord,word):2==chars.length?null:this.result((any[0]?-700/* Penalty.NotStart */:0)+-200/* Penalty.CaseFold */+-1100/* Penalty.Gap */,any,word)}result(score,positions,word){let result=[],i=0;for(let pos of positions){let to=pos+(this.astral?state.codePointSize(state.codePointAt(word,pos)):1);i&&result[i-1]==pos?result[i-1]=to:(result[i++]=pos,result[i++]=to)}return this.ret(score-word.length,result)}}class StrictMatcher{constructor(pattern){this.pattern=pattern,this.matched=[],this.score=0,this.folded=pattern.toLowerCase()}match(word){if(word.length<this.pattern.length)return null;let start=word.slice(0,this.pattern.length),match=start==this.pattern?0:start.toLowerCase()==this.folded?-200/* Penalty.CaseFold */:null;return null==match?null:(this.matched=[0,start.length],this.score=match+(word.length==this.pattern.length?0:-100/* Penalty.NotFull */),this)}}const completionConfig=state.Facet.define({combine(configs){return state.combineConfig(configs,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:defaultPositionInfo,filterStrict:!1,compareCompletions:(a,b)=>(a.sortText||a.label).localeCompare(b.sortText||b.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(a,b)=>a&&b,closeOnBlur:(a,b)=>a&&b,icons:(a,b)=>a&&b,tooltipClass:(a,b)=>c=>joinClass(a(c),b(c)),optionClass:(a,b)=>c=>joinClass(a(c),b(c)),addToOptions:(a,b)=>a.concat(b),filterStrict:(a,b)=>a||b})}}),setSelectedEffect=state.StateEffect.define();class CompletionTooltip{constructor(view,stateField,applyCompletion){this.view=view,this.stateField=stateField,this.applyCompletion=applyCompletion,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:pos=>this.placeInfo(pos),key:this},this.space=null,this.currentClass="";let cState=view.state.field(stateField),{options,selected}=cState.open,config=view.state.facet(completionConfig);this.optionContent=optionContent(config),this.optionClass=config.optionClass,this.tooltipClass=config.tooltipClass,this.range=rangeAroundSelected(options.length,selected,config.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(view.state),this.dom.addEventListener("mousedown",e=>{let{options}=view.state.field(stateField).open;for(let match,dom=e.target;dom&&dom!=this.dom;dom=dom.parentNode)if("LI"==dom.nodeName&&(match=/-(\d+)$/.exec(dom.id))&&+match[1]<options.length)return this.applyCompletion(view,options[+match[1]]),void e.preventDefault();if(e.target==this.list){let move=this.list.classList.contains("cm-completionListIncompleteTop")&&e.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&e.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=move&&(view.dispatch({effects:setSelectedEffect.of(move)}),e.preventDefault())}}),this.dom.addEventListener("focusout",e=>{let state=view.state.field(this.stateField,!1);state&&state.tooltip&&view.state.facet(completionConfig).closeOnBlur&&e.relatedTarget!=view.contentDOM&&view.dispatch({effects:closeCompletionEffect.of(null)})}),this.showOptions(options,cState.id)}mount(){this.updateSel()}showOptions(options,id){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(options,id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(update){var _a;let cState=update.state.field(this.stateField),prevState=update.startState.field(this.stateField);if(this.updateTooltipClass(update.state),cState!=prevState){let{options,selected,disabled}=cState.open;prevState.open&&prevState.open.options==options||(this.range=rangeAroundSelected(options.length,selected,update.state.facet(completionConfig).maxRenderedOptions),this.showOptions(options,cState.id)),this.updateSel(),disabled!=(null===(_a=prevState.open)||void 0===_a?void 0:_a.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!disabled)}}updateTooltipClass(state){let cls=this.tooltipClass(state);if(cls!=this.currentClass){for(let c of this.currentClass.split(" "))c&&this.dom.classList.remove(c);for(let c of cls.split(" "))c&&this.dom.classList.add(c);this.currentClass=cls}}positioned(space){this.space=space,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let cState=this.view.state.field(this.stateField),open=cState.open;(-1<open.selected&&open.selected<this.range.from||open.selected>=this.range.to)&&(this.range=rangeAroundSelected(open.options.length,open.selected,this.view.state.facet(completionConfig).maxRenderedOptions),this.showOptions(open.options,cState.id));let newSel=this.updateSelectedOption(open.selected);if(newSel){this.destroyInfo();let{completion}=open.options[open.selected],{info}=completion;if(!info)return;let infoResult="string"==typeof info?document.createTextNode(info):info(completion);if(!infoResult)return;"then"in infoResult?infoResult.then(obj=>{obj&&this.view.state.field(this.stateField,!1)==cState&&this.addInfoPane(obj,completion)}).catch(e=>view.logException(this.view.state,e,"completion info")):(this.addInfoPane(infoResult,completion),newSel.setAttribute("aria-describedby",this.info.id))}}addInfoPane(content,completion){this.destroyInfo();let wrap=this.info=document.createElement("div");if(wrap.className="cm-tooltip cm-completionInfo",wrap.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=content.nodeType)wrap.appendChild(content),this.infoDestroy=null;else{let{dom,destroy}=content;wrap.appendChild(dom),this.infoDestroy=destroy||null}this.dom.appendChild(wrap),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(selected){let set=null;for(let opt=this.list.firstChild,i=this.range.from;opt;opt=opt.nextSibling,i++)"LI"==opt.nodeName&&opt.id?i==selected?opt.hasAttribute("aria-selected")||(opt.setAttribute("aria-selected","true"),set=opt):opt.hasAttribute("aria-selected")&&(opt.removeAttribute("aria-selected"),opt.removeAttribute("aria-describedby")):i--;return set&&scrollIntoView(this.list,set),set}measureInfo(){let sel=this.dom.querySelector("[aria-selected]");if(!sel||!this.info)return null;let listRect=this.dom.getBoundingClientRect(),infoRect=this.info.getBoundingClientRect(),selRect=sel.getBoundingClientRect(),space=this.space;if(!space){let docElt=this.dom.ownerDocument.documentElement;space={left:0,top:0,right:docElt.clientWidth,bottom:docElt.clientHeight}}return selRect.top>Math.min(space.bottom,listRect.bottom)-10||selRect.bottom<Math.max(space.top,listRect.top)+10?null:this.view.state.facet(completionConfig).positionInfo(this.view,listRect,selRect,infoRect,space,this.dom)}placeInfo(pos){this.info&&(pos?(pos.style&&(this.info.style.cssText=pos.style),this.info.className="cm-tooltip cm-completionInfo "+(pos.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(options,id,range){const ul=document.createElement("ul");ul.id=id,ul.setAttribute("role","listbox"),ul.setAttribute("aria-expanded","true"),ul.setAttribute("aria-label",this.view.state.phrase("Completions")),ul.addEventListener("mousedown",e=>{e.target==ul&&e.preventDefault()});let curSection=null;for(let i=range.from;i<range.to;i++){let{completion,match}=options[i],{section}=completion;if(section){let name="string"==typeof section?section:section.name;if(name!=curSection&&(i>range.from||0==range.from))if(curSection=name,"string"!=typeof section&§ion.header)ul.appendChild(section.header(section));else{let header=ul.appendChild(document.createElement("completion-section"));header.textContent=name}}const li=ul.appendChild(document.createElement("li"));li.id=id+"-"+i,li.setAttribute("role","option");let cls=this.optionClass(completion);cls&&(li.className=cls);for(let source of this.optionContent){let node=source(completion,this.view.state,this.view,match);node&&li.appendChild(node)}}return range.from&&ul.classList.add("cm-completionListIncompleteTop"),range.to<options.length&&ul.classList.add("cm-completionListIncompleteBottom"),ul}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}class CompletionDialog{constructor(options,attrs,tooltip,timestamp,selected,disabled){this.options=options,this.attrs=attrs,this.tooltip=tooltip,this.timestamp=timestamp,this.selected=selected,this.disabled=disabled}setSelected(selected,id){return selected==this.selected||selected>=this.options.length?this:new CompletionDialog(this.options,makeAttrs(id,selected),this.tooltip,this.timestamp,selected,this.disabled)}static build(active,state,id,prev,conf,didSetActive){if(prev&&!didSetActive&&active.some(s=>s.isPending))return prev.setDisabled();let options=sortOptions(active,state);if(!options.length)return prev&&active.some(a=>a.isPending)?prev.setDisabled():null;let selected=state.facet(completionConfig).selectOnOpen?0:-1;if(prev&&prev.selected!=selected&&-1!=prev.selected){let selectedValue=prev.options[prev.selected].completion;for(let i=0;i<options.length;i++)if(options[i].completion==selectedValue){selected=i;break}}return new CompletionDialog(options,makeAttrs(id,selected),{pos:active.reduce((a,b)=>b.hasResult()?Math.min(a,b.from):a,1e8),create:createTooltip,above:conf.aboveCursor},prev?prev.timestamp:Date.now(),selected,!1)}map(changes){return new CompletionDialog(this.options,this.attrs,{...this.tooltip,pos:changes.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new CompletionDialog(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class CompletionState{constructor(active,id,open){this.active=active,this.id=id,this.open=open}static start(){return new CompletionState(none,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(tr){let{state}=tr,conf=state.facet(completionConfig),sources=conf.override||state.languageDataAt("autocomplete",cur(state)).map(asSource),active=sources.map(source=>{let value=this.active.find(s=>s.source==source)||new ActiveSource(source,this.active.some(a=>0!=a.state/* State.Inactive */)?1/* State.Pending */:0/* State.Inactive */);return value.update(tr,conf)});active.length==this.active.length&&active.every((a,i)=>a==this.active[i])&&(active=this.active);let open=this.open,didSet=tr.effects.some(e=>e.is(setActiveEffect));open&&tr.docChanged&&(open=open.map(tr.changes)),tr.selection||active.some(a=>a.hasResult()&&tr.changes.touchesRange(a.from,a.to))||!sameResults(active,this.active)||didSet?open=CompletionDialog.build(active,state,this.id,open,conf,didSet):open&&open.disabled&&!active.some(a=>a.isPending)&&(open=null),!open&&active.every(a=>!a.isPending)&&active.some(a=>a.hasResult())&&(active=active.map(a=>a.hasResult()?new ActiveSource(a.source,0/* State.Inactive */):a));for(let effect of tr.effects)effect.is(setSelectedEffect)&&(open=open&&open.setSelected(effect.value,this.id));return active==this.active&&open==this.open?this:new CompletionState(active,this.id,open)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?baseAttrs:noAttrs}}const baseAttrs={"aria-autocomplete":"list"},noAttrs={},none=[];class ActiveSource{constructor(source,state,explicit=!1){this.source=source,this.state=state,this.explicit=explicit}hasResult(){return!1}get isPending(){return 1==this.state/* State.Pending */}update(tr,conf){let type=getUpdateType(tr,conf),value=this;(8&type/* UpdateType.Reset */||16&type/* UpdateType.ResetIfTouching */&&this.touches(tr))&&(value=new ActiveSource(value.source,0/* State.Inactive */)),4&type/* UpdateType.Activate */&&0==value.state/* State.Inactive */&&(value=new ActiveSource(this.source,1/* State.Pending */)),value=value.updateFor(tr,type);for(let effect of tr.effects)if(effect.is(startCompletionEffect))value=new ActiveSource(value.source,1/* State.Pending */,effect.value);else if(effect.is(closeCompletionEffect))value=new ActiveSource(value.source,0/* State.Inactive */);else if(effect.is(setActiveEffect))for(let active of effect.value)active.source==value.source&&(value=active);return value}updateFor(tr,type){return this.map(tr.changes)}map(changes){return this}touches(tr){return tr.changes.touchesRange(cur(tr.state))}}class ActiveResult extends ActiveSource{constructor(source,explicit,limit,result,from,to){super(source,3/* State.Result */,explicit),this.limit=limit,this.result=result,this.from=from,this.to=to}hasResult(){return!0}updateFor(tr,type){var _a;if(!(3&type/* UpdateType.SimpleInteraction */))return this.map(tr.changes);let result=this.result;result.map&&!tr.changes.empty&&(result=result.map(result,tr.changes));let from=tr.changes.mapPos(this.from),to=tr.changes.mapPos(this.to,1),pos=cur(tr.state);if(pos>to||!result||2&type/* UpdateType.Backspacing */&&(cur(tr.startState)==this.from||pos<this.limit))return new ActiveSource(this.source,4&type/* UpdateType.Activate */?1/* State.Pending */:0/* State.Inactive */);let limit=tr.changes.mapPos(this.limit);return checkValid(result.validFor,tr.state,from,to)?new ActiveResult(this.source,this.explicit,limit,result,from,to):result.update&&(result=result.update(result,from,to,new CompletionContext(tr.state,pos,!1)))?new ActiveResult(this.source,this.explicit,limit,result,result.from,null!==(_a=result.to)&&void 0!==_a?_a:cur(tr.state)):new ActiveSource(this.source,1/* State.Pending */,this.explicit)}map(mapping){if(mapping.empty)return this;let result=this.result.map?this.result.map(this.result,mapping):this.result;return result?new ActiveResult(this.source,this.explicit,mapping.mapPos(this.limit),this.result,mapping.mapPos(this.from),mapping.mapPos(this.to,1)):new ActiveSource(this.source,0/* State.Inactive */)}touches(tr){return tr.changes.touchesRange(this.from,this.to)}}const setActiveEffect=state.StateEffect.define({map(sources,mapping){return sources.map(s=>s.map(mapping))}}),completionState=state.StateField.define({create(){return CompletionState.start()},update(value,tr){return value.update(tr)},provide:f=>[view.showTooltip.from(f,val=>val.tooltip),view.EditorView.contentAttributes.from(f,state=>state.attrs)]}),createTooltip=completionTooltip(completionState,applyCompletion),acceptCompletion=view=>{let cState=view.state.field(completionState,!1);return!(view.state.readOnly||!cState||!cState.open||0>cState.open.selected||cState.open.disabled||Date.now()-cState.open.timestamp<view.state.facet(completionConfig).interactionDelay)&&applyCompletion(view,cState.open.options[cState.open.selected])},startCompletion=view=>{let cState=view.state.field(completionState,!1);return!!cState&&(view.dispatch({effects:startCompletionEffect.of(!0)}),!0)},closeCompletion=view=>{let cState=view.state.field(completionState,!1);return!!(cState&&cState.active.some(a=>0!=a.state/* State.Inactive */))&&(view.dispatch({effects:closeCompletionEffect.of(null)}),!0)};/**
|
|
178
|
+
for(let next,i=0,e=Math.min(word.length,200),prevType=0/* Tp.NonWord */;i<e&&byWordTo<len;){next=state.codePointAt(word,i),0>direct&&(preciseTo<len&&next==chars[preciseTo]&&(precise[preciseTo++]=i),adjacentTo<len&&(next==chars[adjacentTo]||next==folded[adjacentTo]?(0==adjacentTo&&(adjacentStart=i),adjacentEnd=i+1,adjacentTo++):adjacentTo=0));let ch,type=255>next?48<=next&&57>=next||97<=next&&122>=next?2/* Tp.Lower */:65<=next&&90>=next?1/* Tp.Upper */:0/* Tp.NonWord */:(ch=state.fromCodePoint(next))==ch.toLowerCase()?ch==ch.toUpperCase()?0:2/* Tp.Lower */:1/* Tp.Upper *//* Tp.NonWord */;(!i||1==type/* Tp.Upper */&&hasLower||0==prevType/* Tp.NonWord */&&0!=type/* Tp.NonWord */)&&(chars[byWordTo]==next||folded[byWordTo]==next&&(byWordFolded=!0)?byWord[byWordTo++]=i:byWord.length&&(wordAdjacent=!1)),prevType=type,i+=state.codePointSize(next)}return byWordTo==len&&0==byWord[0]&&wordAdjacent?this.result(-100/* Penalty.ByWord */+(byWordFolded?-200/* Penalty.CaseFold */:0),byWord,word):adjacentTo==len&&0==adjacentStart?this.ret(-200/* Penalty.CaseFold */-word.length+(adjacentEnd==word.length?0:-100/* Penalty.NotFull */),[0,adjacentEnd]):-1<direct?this.ret(-700/* Penalty.NotStart */-word.length,[direct,direct+this.pattern.length]):adjacentTo==len?this.ret(-900/* Penalty.NotStart */-word.length,[adjacentStart,adjacentEnd]):byWordTo==len?this.result(-100/* Penalty.ByWord */+(byWordFolded?-200/* Penalty.CaseFold */:0)+-700/* Penalty.NotStart */+(wordAdjacent?0:-1100/* Penalty.Gap */),byWord,word):2==chars.length?null:this.result((any[0]?-700/* Penalty.NotStart */:0)+-200/* Penalty.CaseFold */+-1100/* Penalty.Gap */,any,word)}result(score,positions,word){let result=[],i=0;for(let pos of positions){let to=pos+(this.astral?state.codePointSize(state.codePointAt(word,pos)):1);i&&result[i-1]==pos?result[i-1]=to:(result[i++]=pos,result[i++]=to)}return this.ret(score-word.length,result)}}class StrictMatcher{constructor(pattern){this.pattern=pattern,this.matched=[],this.score=0,this.folded=pattern.toLowerCase()}match(word){if(word.length<this.pattern.length)return null;let start=word.slice(0,this.pattern.length),match=start==this.pattern?0:start.toLowerCase()==this.folded?-200/* Penalty.CaseFold */:null;return null==match?null:(this.matched=[0,start.length],this.score=match+(word.length==this.pattern.length?0:-100/* Penalty.NotFull */),this)}}const completionConfig=state.Facet.define({combine(configs){return state.combineConfig(configs,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:defaultPositionInfo,filterStrict:!1,compareCompletions:(a,b)=>(a.sortText||a.label).localeCompare(b.sortText||b.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(a,b)=>a&&b,closeOnBlur:(a,b)=>a&&b,icons:(a,b)=>a&&b,tooltipClass:(a,b)=>c=>joinClass(a(c),b(c)),optionClass:(a,b)=>c=>joinClass(a(c),b(c)),addToOptions:(a,b)=>a.concat(b),filterStrict:(a,b)=>a||b})}}),setSelectedEffect=state.StateEffect.define();class CompletionTooltip{constructor(view,stateField,applyCompletion){this.view=view,this.stateField=stateField,this.applyCompletion=applyCompletion,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:pos=>this.placeInfo(pos),key:this},this.space=null,this.currentClass="";let cState=view.state.field(stateField),{options,selected}=cState.open,config=view.state.facet(completionConfig);this.optionContent=optionContent(config),this.optionClass=config.optionClass,this.tooltipClass=config.tooltipClass,this.range=rangeAroundSelected(options.length,selected,config.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(view.state),this.dom.addEventListener("mousedown",e=>{let{options}=view.state.field(stateField).open;for(let match,dom=e.target;dom&&dom!=this.dom;dom=dom.parentNode)if("LI"==dom.nodeName&&(match=/-(\d+)$/.exec(dom.id))&&+match[1]<options.length)return this.applyCompletion(view,options[+match[1]]),void e.preventDefault();if(e.target==this.list){let move=this.list.classList.contains("cm-completionListIncompleteTop")&&e.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&e.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;null!=move&&(view.dispatch({effects:setSelectedEffect.of(move)}),e.preventDefault())}}),this.dom.addEventListener("focusout",e=>{let state=view.state.field(this.stateField,!1);state&&state.tooltip&&view.state.facet(completionConfig).closeOnBlur&&e.relatedTarget!=view.contentDOM&&view.dispatch({effects:closeCompletionEffect.of(null)})}),this.showOptions(options,cState.id)}mount(){this.updateSel()}showOptions(options,id){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(options,id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(update){var _a;let cState=update.state.field(this.stateField),prevState=update.startState.field(this.stateField);if(this.updateTooltipClass(update.state),cState!=prevState){let{options,selected,disabled}=cState.open;prevState.open&&prevState.open.options==options||(this.range=rangeAroundSelected(options.length,selected,update.state.facet(completionConfig).maxRenderedOptions),this.showOptions(options,cState.id)),this.updateSel(),disabled!=(null===(_a=prevState.open)||void 0===_a?void 0:_a.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!disabled)}}updateTooltipClass(state){let cls=this.tooltipClass(state);if(cls!=this.currentClass){for(let c of this.currentClass.split(" "))c&&this.dom.classList.remove(c);for(let c of cls.split(" "))c&&this.dom.classList.add(c);this.currentClass=cls}}positioned(space){this.space=space,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let cState=this.view.state.field(this.stateField),open=cState.open;(-1<open.selected&&open.selected<this.range.from||open.selected>=this.range.to)&&(this.range=rangeAroundSelected(open.options.length,open.selected,this.view.state.facet(completionConfig).maxRenderedOptions),this.showOptions(open.options,cState.id));let newSel=this.updateSelectedOption(open.selected);if(newSel){this.destroyInfo();let{completion}=open.options[open.selected],{info}=completion;if(!info)return;let infoResult="string"==typeof info?document.createTextNode(info):info(completion);if(!infoResult)return;"then"in infoResult?infoResult.then(obj=>{obj&&this.view.state.field(this.stateField,!1)==cState&&this.addInfoPane(obj,completion)}).catch(e=>view.logException(this.view.state,e,"completion info")):(this.addInfoPane(infoResult,completion),newSel.setAttribute("aria-describedby",this.info.id))}}addInfoPane(content,completion){this.destroyInfo();let wrap=this.info=document.createElement("div");if(wrap.className="cm-tooltip cm-completionInfo",wrap.id="cm-completionInfo-"+Math.floor(65535*Math.random()).toString(16),null!=content.nodeType)wrap.appendChild(content),this.infoDestroy=null;else{let{dom,destroy}=content;wrap.appendChild(dom),this.infoDestroy=destroy||null}this.dom.appendChild(wrap),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(selected){let set=null;for(let opt=this.list.firstChild,i=this.range.from;opt;opt=opt.nextSibling,i++)"LI"==opt.nodeName&&opt.id?i==selected?opt.hasAttribute("aria-selected")||(opt.setAttribute("aria-selected","true"),set=opt):opt.hasAttribute("aria-selected")&&(opt.removeAttribute("aria-selected"),opt.removeAttribute("aria-describedby")):i--;return set&&scrollIntoView(this.list,set),set}measureInfo(){let sel=this.dom.querySelector("[aria-selected]");if(!sel||!this.info)return null;let listRect=this.dom.getBoundingClientRect(),infoRect=this.info.getBoundingClientRect(),selRect=sel.getBoundingClientRect(),space=this.space;if(!space){let docElt=this.dom.ownerDocument.documentElement;space={left:0,top:0,right:docElt.clientWidth,bottom:docElt.clientHeight}}return selRect.top>Math.min(space.bottom,listRect.bottom)-10||selRect.bottom<Math.max(space.top,listRect.top)+10?null:this.view.state.facet(completionConfig).positionInfo(this.view,listRect,selRect,infoRect,space,this.dom)}placeInfo(pos){this.info&&(pos?(pos.style&&(this.info.style.cssText=pos.style),this.info.className="cm-tooltip cm-completionInfo "+(pos.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(options,id,range){const ul=document.createElement("ul");ul.id=id,ul.setAttribute("role","listbox"),ul.setAttribute("aria-expanded","true"),ul.setAttribute("aria-label",this.view.state.phrase("Completions")),ul.addEventListener("mousedown",e=>{e.target==ul&&e.preventDefault()});let curSection=null;for(let i=range.from;i<range.to;i++){let{completion,match}=options[i],{section}=completion;if(section){let name="string"==typeof section?section:section.name;if(name!=curSection&&(i>range.from||0==range.from))if(curSection=name,"string"!=typeof section&§ion.header)ul.appendChild(section.header(section));else{let header=ul.appendChild(document.createElement("completion-section"));header.textContent=name}}const li=ul.appendChild(document.createElement("li"));li.id=id+"-"+i,li.setAttribute("role","option");let cls=this.optionClass(completion);cls&&(li.className=cls);for(let source of this.optionContent){let node=source(completion,this.view.state,this.view,match);node&&li.appendChild(node)}}return range.from&&ul.classList.add("cm-completionListIncompleteTop"),range.to<options.length&&ul.classList.add("cm-completionListIncompleteBottom"),ul}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}class CompletionDialog{constructor(options,attrs,tooltip,timestamp,selected,disabled){this.options=options,this.attrs=attrs,this.tooltip=tooltip,this.timestamp=timestamp,this.selected=selected,this.disabled=disabled}setSelected(selected,id){return selected==this.selected||selected>=this.options.length?this:new CompletionDialog(this.options,makeAttrs(id,selected),this.tooltip,this.timestamp,selected,this.disabled)}static build(active,state,id,prev,conf,didSetActive){if(prev&&!didSetActive&&active.some(s=>s.isPending))return prev.setDisabled();let options=sortOptions(active,state);if(!options.length)return prev&&active.some(a=>a.isPending)?prev.setDisabled():null;let selected=state.facet(completionConfig).selectOnOpen?0:-1;if(prev&&prev.selected!=selected&&-1!=prev.selected){let selectedValue=prev.options[prev.selected].completion;for(let i=0;i<options.length;i++)if(options[i].completion==selectedValue){selected=i;break}}return new CompletionDialog(options,makeAttrs(id,selected),{pos:active.reduce((a,b)=>b.hasResult()?Math.min(a,b.from):a,1e8),create:createTooltip,above:conf.aboveCursor},prev?prev.timestamp:Date.now(),selected,!1)}map(changes){return new CompletionDialog(this.options,this.attrs,{...this.tooltip,pos:changes.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new CompletionDialog(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class CompletionState{constructor(active,id,open){this.active=active,this.id=id,this.open=open}static start(){return new CompletionState(none,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(tr){let{state}=tr,conf=state.facet(completionConfig),sources=conf.override||state.languageDataAt("autocomplete",cur(state)).map(asSource),active=sources.map(source=>{let value=this.active.find(s=>s.source==source)||new ActiveSource(source,this.active.some(a=>0!=a.state/* State.Inactive */)?1/* State.Pending */:0/* State.Inactive */);return value.update(tr,conf)});active.length==this.active.length&&active.every((a,i)=>a==this.active[i])&&(active=this.active);let open=this.open,didSet=tr.effects.some(e=>e.is(setActiveEffect));open&&tr.docChanged&&(open=open.map(tr.changes)),tr.selection||active.some(a=>a.hasResult()&&tr.changes.touchesRange(a.from,a.to))||!sameResults(active,this.active)||didSet?open=CompletionDialog.build(active,state,this.id,open,conf,didSet):open&&open.disabled&&!active.some(a=>a.isPending)&&(open=null),!open&&active.every(a=>!a.isPending)&&active.some(a=>a.hasResult())&&(active=active.map(a=>a.hasResult()?new ActiveSource(a.source,0/* State.Inactive */):a));for(let effect of tr.effects)effect.is(setSelectedEffect)&&(open=open&&open.setSelected(effect.value,this.id));return active==this.active&&open==this.open?this:new CompletionState(active,this.id,open)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?baseAttrs:noAttrs}}const baseAttrs={"aria-autocomplete":"list"},noAttrs={},none=[];class ActiveSource{constructor(source,state,explicit=!1){this.source=source,this.state=state,this.explicit=explicit}hasResult(){return!1}get isPending(){return 1==this.state/* State.Pending */}update(tr,conf){let type=getUpdateType(tr,conf),value=this;(8&type/* UpdateType.Reset */||16&type/* UpdateType.ResetIfTouching */&&this.touches(tr))&&(value=new ActiveSource(value.source,0/* State.Inactive */)),4&type/* UpdateType.Activate */&&0==value.state/* State.Inactive */&&(value=new ActiveSource(this.source,1/* State.Pending */)),value=value.updateFor(tr,type);for(let effect of tr.effects)if(effect.is(startCompletionEffect))value=new ActiveSource(value.source,1/* State.Pending */,effect.value);else if(effect.is(closeCompletionEffect))value=new ActiveSource(value.source,0/* State.Inactive */);else if(effect.is(setActiveEffect))for(let active of effect.value)active.source==value.source&&(value=active);return value}updateFor(tr,type){return this.map(tr.changes)}map(changes){return this}touches(tr){return tr.changes.touchesRange(cur(tr.state))}}class ActiveResult extends ActiveSource{constructor(source,explicit,limit,result,from,to){super(source,3/* State.Result */,explicit),this.limit=limit,this.result=result,this.from=from,this.to=to}hasResult(){return!0}updateFor(tr,type){var _a;if(!(3&type/* UpdateType.SimpleInteraction */))return this.map(tr.changes);let result=this.result;result.map&&!tr.changes.empty&&(result=result.map(result,tr.changes));let from=tr.changes.mapPos(this.from),to=tr.changes.mapPos(this.to,1),pos=cur(tr.state);if(pos>to||!result||2&type/* UpdateType.Backspacing */&&(cur(tr.startState)==this.from||pos<this.limit))return new ActiveSource(this.source,4&type/* UpdateType.Activate */?1/* State.Pending */:0/* State.Inactive */);let limit=tr.changes.mapPos(this.limit);return checkValid(result.validFor,tr.state,from,to)?new ActiveResult(this.source,this.explicit,limit,result,from,to):result.update&&(result=result.update(result,from,to,new CompletionContext(tr.state,pos,!1)))?new ActiveResult(this.source,this.explicit,limit,result,result.from,null!==(_a=result.to)&&void 0!==_a?_a:cur(tr.state)):new ActiveSource(this.source,1/* State.Pending */,this.explicit)}map(mapping){if(mapping.empty)return this;let result=this.result.map?this.result.map(this.result,mapping):this.result;return result?new ActiveResult(this.source,this.explicit,mapping.mapPos(this.limit),this.result,mapping.mapPos(this.from),mapping.mapPos(this.to,1)):new ActiveSource(this.source,0/* State.Inactive */)}touches(tr){return tr.changes.touchesRange(this.from,this.to)}}const setActiveEffect=state.StateEffect.define({map(sources,mapping){return sources.map(s=>s.map(mapping))}}),completionState=state.StateField.define({create(){return CompletionState.start()},update(value,tr){return value.update(tr)},provide:f=>[view.showTooltip.from(f,val=>val.tooltip),view.EditorView.contentAttributes.from(f,state=>state.attrs)]}),createTooltip=completionTooltip(completionState,applyCompletion),acceptCompletion=view=>{let cState=view.state.field(completionState,!1);return!(view.state.readOnly||!cState||!cState.open||0>cState.open.selected||cState.open.disabled||Date.now()-cState.open.timestamp<view.state.facet(completionConfig).interactionDelay)&&applyCompletion(view,cState.open.options[cState.open.selected])},startCompletion=view=>{let cState=view.state.field(completionState,!1);return!!cState&&(view.dispatch({effects:startCompletionEffect.of(!0)}),!0)},closeCompletion=view=>{let cState=view.state.field(completionState,!1);return!!(cState&&cState.active.some(a=>0!=a.state/* State.Inactive */))&&(view.dispatch({effects:closeCompletionEffect.of(null)}),!0)};/**
|
|
179
179
|
Explicitly start autocompletion.
|
|
180
|
-
|
|
180
|
+
*//**
|
|
181
181
|
Close the currently active completion.
|
|
182
182
|
*/class RunningQuery{constructor(active,context){this.active=active,this.context=context,this.time=Date.now(),this.updates=[],this.done=void 0}}const MaxUpdateCount=50,MinAbortTime=1e3,completionPlugin=view.ViewPlugin.fromClass(class{constructor(view){this.view=view,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0/* CompositionState.None */;for(let active of view.state.field(completionState).active)active.isPending&&this.startQuery(active)}update(update){let cState=update.state.field(completionState),conf=update.state.facet(completionConfig);if(update.selectionSet||update.docChanged||update.startState.field(completionState)!=cState){let doesReset=update.transactions.some(tr=>{let type=getUpdateType(tr,conf);return 8&type/* UpdateType.Reset */||(tr.selection||tr.docChanged)&&!(3&type/* UpdateType.SimpleInteraction */)});for(let query,i=0;i<this.running.length;i++)if(query=this.running[i],doesReset||query.context.abortOnDocChange&&update.docChanged||query.updates.length+update.transactions.length>MaxUpdateCount&&Date.now()-query.time>MinAbortTime){for(let handler of query.context.abortListeners)try{handler()}catch(e){view.logException(this.view.state,e)}query.context.abortListeners=null,this.running.splice(i--,1)}else query.updates.push(...update.transactions);-1<this.debounceUpdate&&clearTimeout(this.debounceUpdate),update.transactions.some(tr=>tr.effects.some(e=>e.is(startCompletionEffect)))&&(this.pendingStart=!0);let delay=this.pendingStart?50:conf.activateOnTypingDelay;if(this.debounceUpdate=cState.active.some(a=>a.isPending&&!this.running.some(q=>q.active.source==a.source))?setTimeout(()=>this.startUpdate(),delay):-1,0!=this.composing/* CompositionState.None */)for(let tr of update.transactions)tr.isUserEvent("input.type")?this.composing=2/* CompositionState.Changed */:2==this.composing/* CompositionState.Changed */&&tr.selection&&(this.composing=3/* CompositionState.ChangedAndMoved */)}}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state}=this.view,cState=state.field(completionState);for(let active of cState.active)active.isPending&&!this.running.some(r=>r.active.source==active.source)&&this.startQuery(active);this.running.length&&cState.open&&cState.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}startQuery(active){let{state}=this.view,pos=cur(state),context=new CompletionContext(state,pos,active.explicit,this.view),pending=new RunningQuery(active,context);this.running.push(pending),Promise.resolve(active.source(context)).then(result=>{pending.context.aborted||(pending.done=result||null,this.scheduleAccept())},err=>{this.view.dispatch({effects:closeCompletionEffect.of(null)}),view.logException(this.view.state,err)})}scheduleAccept(){this.running.every(q=>void 0!==q.done)?this.accept():0>this.debounceAccept&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(completionConfig).updateSyncTime))}// For each finished query in this.running, try to create a result
|
|
183
183
|
// or, if appropriate, restart the query.
|
|
@@ -189,9 +189,9 @@ let active=new ActiveSource(query.active.source,0/* State.Inactive */);for(let t
|
|
|
189
189
|
this.startQuery(current)}(updated.length||cState.open&&cState.open.disabled)&&this.view.dispatch({effects:setActiveEffect.of(updated)})}},{eventHandlers:{blur(event){let state=this.view.state.field(completionState,!1);if(state&&state.tooltip&&this.view.state.facet(completionConfig).closeOnBlur){let dialog=state.open&&view.getTooltip(this.view,state.open.tooltip);dialog&&dialog.dom.contains(event.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:closeCompletionEffect.of(null)}),10)}},compositionstart(){this.composing=1/* CompositionState.Started */},compositionend(){3==this.composing/* CompositionState.ChangedAndMoved */&&setTimeout(()=>this.view.dispatch({effects:startCompletionEffect.of(!1)}),20),this.composing=0/* CompositionState.None */}}}),windows="object"==typeof navigator&&/Win/.test(navigator.platform),commitCharacters=state.Prec.highest(view.EditorView.domEventHandlers({keydown(event,view){let field=view.state.field(completionState,!1);if(!field||!field.open||field.open.disabled||0>field.open.selected||1<event.key.length||event.ctrlKey&&!(windows&&event.altKey)||event.metaKey)return!1;let option=field.open.options[field.open.selected],result=field.active.find(a=>a.source==option.source),commitChars=option.completion.commitCharacters||result.result.commitCharacters;return commitChars&&-1<commitChars.indexOf(event.key)&&applyCompletion(view,option),!1}})),baseTheme=view.EditorView.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:"\"\xB7\xB7\xB7\"",opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:`${400/* Info.Width */}px`,boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`${30/* Info.Margin */}px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`${30/* Info.Margin */}px`},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11\uFE0E'"}// Disable emoji rendering
|
|
190
190
|
},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class FieldPos{constructor(field,line,from,to){this.field=field,this.line=line,this.from=from,this.to=to}}class FieldRange{constructor(field,from,to){this.field=field,this.from=from,this.to=to}map(changes){let from=changes.mapPos(this.from,-1,state.MapMode.TrackDel),to=changes.mapPos(this.to,1,state.MapMode.TrackDel);return null==from||null==to?null:new FieldRange(this.field,from,to)}}class Snippet{constructor(lines,fieldPositions){this.lines=lines,this.fieldPositions=fieldPositions}instantiate(state,pos){let text=[],lineStart=[pos],lineObj=state.doc.lineAt(pos),baseIndent=/^\s*/.exec(lineObj.text)[0];for(let line of this.lines){if(text.length){let indent=baseIndent,tabs=/^\t*/.exec(line)[0].length;for(let i=0;i<tabs;i++)indent+=state.facet(language.indentUnit);lineStart.push(pos+indent.length-tabs),line=indent+line.slice(tabs)}text.push(line),pos+=line.length+1}let ranges=this.fieldPositions.map(pos=>new FieldRange(pos.field,lineStart[pos.line]+pos.from,lineStart[pos.line]+pos.to));return{text,ranges}}static parse(template){let m,fields=[],lines=[],positions=[];for(let line of template.split(/\r\n?|\n/)){for(;m=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(line);){let seq=m[1]?+m[1]:null,rawName=m[2]||m[3]||"",found=-1,name=rawName.replace(/\\[{}]/g,m=>m[1]);for(let i=0;i<fields.length;i++)(null==seq?!!name&&fields[i].name==name:fields[i].seq==seq)&&(found=i);if(0>found){let i=0;for(;i<fields.length&&(null==seq||null!=fields[i].seq&&fields[i].seq<seq);)i++;fields.splice(i,0,{seq,name}),found=i;for(let pos of positions)pos.field>=found&&pos.field++}for(let pos of positions)if(pos.line==lines.length&&pos.from>m.index){let snip=m[2]?3+(m[1]||"").length:2;pos.from-=snip,pos.to-=snip}positions.push(new FieldPos(found,lines.length,m.index,m.index+name.length)),line=line.slice(0,m.index)+rawName+line.slice(m.index+m[0].length)}line=line.replace(/\\([{}])/g,(_,brace,index)=>{for(let pos of positions)pos.line==lines.length&&pos.from>index&&(pos.from--,pos.to--);return brace}),lines.push(line)}return new Snippet(lines,positions)}}let fieldMarker=view.Decoration.widget({widget:new class extends view.WidgetType{toDOM(){let span=document.createElement("span");return span.className="cm-snippetFieldPosition",span}ignoreEvent(){return!1}}}),fieldRange=view.Decoration.mark({class:"cm-snippetField"});class ActiveSnippet{constructor(ranges,active){this.ranges=ranges,this.active=active,this.deco=view.Decoration.set(ranges.map(r=>(r.from==r.to?fieldMarker:fieldRange).range(r.from,r.to)),!0)}map(changes){let ranges=[];for(let r of this.ranges){let mapped=r.map(changes);if(!mapped)return null;ranges.push(mapped)}return new ActiveSnippet(ranges,this.active)}selectionInsideField(sel){return sel.ranges.every(range=>this.ranges.some(r=>r.field==this.active&&r.from<=range.from&&r.to>=range.to))}}const setActive=state.StateEffect.define({map(value,changes){return value&&value.map(changes)}}),moveToField=state.StateEffect.define(),snippetState=state.StateField.define({create(){return null},update(value,tr){for(let effect of tr.effects){if(effect.is(setActive))return effect.value;if(effect.is(moveToField)&&value)return new ActiveSnippet(value.ranges,effect.value)}return value&&tr.docChanged&&(value=value.map(tr.changes)),value&&tr.selection&&!value.selectionInsideField(tr.selection)&&(value=null),value},provide:f=>view.EditorView.decorations.from(f,val=>val?val.deco:view.Decoration.none)}),clearSnippet=({state,dispatch})=>{let active=state.field(snippetState,!1);return!!active&&(dispatch(state.update({effects:setActive.of(null)})),!0)},nextSnippetField=moveField(1),prevSnippetField=moveField(-1),defaultSnippetKeymap=[{key:"Tab",run:nextSnippetField,shift:prevSnippetField},{key:"Escape",run:clearSnippet}],snippetKeymap=state.Facet.define({combine(maps){return maps.length?maps[0]:defaultSnippetKeymap}}),addSnippetKeymap=state.Prec.highest(view.keymap.compute([snippetKeymap],state=>state.facet(snippetKeymap))),snippetPointerHandler=view.EditorView.domEventHandlers({mousedown(event,view){let pos,active=view.state.field(snippetState,!1);if(!active||null==(pos=view.posAtCoords({x:event.clientX,y:event.clientY})))return!1;let match=active.ranges.find(r=>r.from<=pos&&r.to>=pos);return!!(match&&match.field!=active.active)&&(view.dispatch({selection:fieldSelection(active.ranges,match.field),effects:setActive.of(active.ranges.some(r=>r.field>match.field)?new ActiveSnippet(active.ranges,match.field):null),scrollIntoView:!0}),!0)}}),wordCaches=Object.create(null),completeAnyWord=context=>{var _a;let wordChars=null!==(_a=context.state.languageDataAt("wordChars",context.pos)[0])&&void 0!==_a?_a:"",re=wordRE(wordChars),token=context.matchBefore(mapRE(re,s=>s+"$"));if(!token&&!context.explicit)return null;let from=token?token.from:context.pos,options=collectWords(context.state.doc,wordCache(wordChars),re,5e4/* C.Range */,from);return{from,options,validFor:mapRE(re,s=>"^"+s)}},defaults={brackets:["(","[","{","'","\""],before:")]}:;>",stringPrefixes:[]},closeBracketEffect=state.StateEffect.define({map(value,mapping){let mapped=mapping.mapPos(value,-1,state.MapMode.TrackAfter);return null==mapped?void 0:mapped}}),closedBracket=new class extends state.RangeValue{};/**
|
|
191
191
|
Move to the next snippet field, if available.
|
|
192
|
-
|
|
192
|
+
*//**
|
|
193
193
|
Move to the previous snippet field, if available.
|
|
194
|
-
|
|
194
|
+
*//**
|
|
195
195
|
A facet that can be used to configure the key bindings used by
|
|
196
196
|
snippets. The default binds Tab to
|
|
197
197
|
[`nextSnippetField`](https://codemirror.net/6/docs/ref/#autocomplete.nextSnippetField), Shift-Tab to
|
|
@@ -200,7 +200,7 @@ this.startQuery(current)}(updated.length||cState.open&&cState.open.disabled)&&th
|
|
|
200
200
|
*/closedBracket.startSide=1,closedBracket.endSide=-1;const bracketState=state.StateField.define({create(){return state.RangeSet.empty},update(value,tr){if(value=value.map(tr.changes),tr.selection){let line=tr.state.doc.lineAt(tr.selection.main.head);value=value.update({filter:from=>from>=line.from&&from<=line.to})}for(let effect of tr.effects)effect.is(closeBracketEffect)&&(value=value.update({add:[closedBracket.range(effect.value,effect.value+1)]}));return value}}),definedClosing="()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D",android="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),inputHandler=view.EditorView.inputHandler.of((view,from,to,insert)=>{if((android?view.composing:view.compositionStarted)||view.state.readOnly)return!1;let sel=view.state.selection.main;if(2<insert.length||2==insert.length&&1==state.codePointSize(state.codePointAt(insert,0))||from!=sel.from||to!=sel.to)return!1;let tr=insertBracket(view.state,insert);return!!tr&&(view.dispatch(tr),!0)}),deleteBracketPair=({state:state$1,dispatch})=>{if(state$1.readOnly)return!1;let conf=config(state$1,state$1.selection.main.head),tokens=conf.brackets||defaults.brackets,dont=null,changes=state$1.changeByRange(range=>{if(range.empty){let before=prevChar(state$1.doc,range.head);for(let token of tokens)if(token==before&&nextChar(state$1.doc,range.head)==closing(state.codePointAt(token,0)))return{changes:{from:range.head-token.length,to:range.head+token.length},range:state.EditorSelection.cursor(range.head-token.length)}}return{range:dont=range}});return dont||dispatch(state$1.update(changes,{scrollIntoView:!0,userEvent:"delete.backward"})),!dont},closeBracketsKeymap=[{key:"Backspace",run:deleteBracketPair}],completionKeymap=[{key:"Ctrl-Space",run:startCompletion},{mac:"Alt-`",run:startCompletion},{mac:"Alt-i",run:startCompletion},{key:"Escape",run:closeCompletion},{key:"ArrowDown",run:moveCompletionSelection(!0)},{key:"ArrowUp",run:moveCompletionSelection(!1)},{key:"PageDown",run:moveCompletionSelection(!0,"page")},{key:"PageUp",run:moveCompletionSelection(!1,"page")},{key:"Enter",run:acceptCompletion}],completionKeymapExt=state.Prec.highest(view.keymap.computeN([completionConfig],state=>state.facet(completionConfig).defaultKeymap?[completionKeymap]:[])),completionArrayCache=new WeakMap;/**
|
|
201
201
|
Command that implements deleting a pair of matching brackets when
|
|
202
202
|
the cursor is between them.
|
|
203
|
-
|
|
203
|
+
*//**
|
|
204
204
|
Close-brackets related key bindings. Binds Backspace to
|
|
205
205
|
[`deleteBracketPair`](https://codemirror.net/6/docs/ref/#autocomplete.deleteBracketPair).
|
|
206
206
|
*/return dist.CompletionContext=CompletionContext,dist.acceptCompletion=acceptCompletion,dist.autocompletion=autocompletion,dist.clearSnippet=clearSnippet,dist.closeBrackets=closeBrackets,dist.closeBracketsKeymap=closeBracketsKeymap,dist.closeCompletion=closeCompletion,dist.completeAnyWord=completeAnyWord,dist.completeFromList=completeFromList,dist.completionKeymap=completionKeymap,dist.completionStatus=completionStatus,dist.currentCompletions=currentCompletions,dist.deleteBracketPair=deleteBracketPair,dist.hasNextSnippetField=hasNextSnippetField,dist.hasPrevSnippetField=hasPrevSnippetField,dist.ifIn=ifIn,dist.ifNotIn=ifNotIn,dist.insertBracket=insertBracket,dist.insertCompletionText=insertCompletionText,dist.moveCompletionSelection=moveCompletionSelection,dist.nextSnippetField=nextSnippetField,dist.pickedCompletion=pickedCompletion,dist.prevSnippetField=prevSnippetField,dist.selectedCompletion=selectedCompletion,dist.selectedCompletionIndex=selectedCompletionIndex,dist.setSelectedCompletion=setSelectedCompletion,dist.snippet=snippet,dist.snippetCompletion=snippetCompletion,dist.snippetKeymap=snippetKeymap,dist.startCompletion=startCompletion,dist}(),index=/*@__PURE__*/function getDefaultExportFromCjs(x){return x}(distExports);return module.exports=index,module.exports}
|