una-editor 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +35 -2
- package/README.md +35 -2
- package/dist/clike-BKuxyWF6.cjs +1 -0
- package/dist/clike-DiubheGH.js +616 -0
- package/dist/go-BHVhI2MG.js +155 -0
- package/dist/go-BgtlNyKc.cjs +1 -0
- package/dist/index-B5GoofdY.js +28426 -0
- package/dist/index-CJVNADkB.js +93 -0
- package/dist/index-CKNMJCtD.cjs +1 -0
- package/dist/index-CU6O_K-D.js +611 -0
- package/dist/index-CjgM0d_T.js +300 -0
- package/dist/index-D1m8iO5G.cjs +72 -0
- package/dist/index-Dn2Q7BsK.cjs +1 -0
- package/dist/index-tXgg464w.cjs +3 -0
- package/dist/index.cjs +1 -66
- package/dist/index.mjs +8 -25476
- package/dist/rust-Dt_Syouh.cjs +1 -0
- package/dist/rust-ohAAD9YU.js +144 -0
- package/dist/types/components/UnaEditor.vue.d.ts +10 -8
- package/dist/types/components/UnaEditor.vue.d.ts.map +1 -1
- package/dist/types/composables/useEditor.d.ts +2 -0
- package/dist/types/composables/useEditor.d.ts.map +1 -1
- package/dist/types/extensions/codeBlockDecorator.d.ts +6 -0
- package/dist/types/extensions/codeBlockDecorator.d.ts.map +1 -0
- package/dist/types/extensions/codeThemeExtension.d.ts +8 -0
- package/dist/types/extensions/codeThemeExtension.d.ts.map +1 -0
- package/dist/types/extensions/hybridMarkdown.d.ts.map +1 -1
- package/dist/types/extensions/languageSupport.d.ts +20 -0
- package/dist/types/extensions/languageSupport.d.ts.map +1 -0
- package/dist/types/extensions/structuredTable.d.ts +7 -0
- package/dist/types/extensions/structuredTable.d.ts.map +1 -0
- package/dist/types/extensions/structuredTableModel.d.ts +57 -0
- package/dist/types/extensions/structuredTableModel.d.ts.map +1 -0
- package/dist/types/locales/en-US.d.ts.map +1 -1
- package/dist/types/themes/codeThemes.d.ts +5 -0
- package/dist/types/themes/codeThemes.d.ts.map +1 -0
- package/dist/types/types/editor.d.ts +40 -0
- package/dist/types/types/editor.d.ts.map +1 -1
- package/dist/una-editor.css +1 -1
- package/package.json +13 -5
package/README.en.md
CHANGED
|
@@ -20,8 +20,10 @@ A lightweight, high-performance Vue 3 editor component library based on CodeMirr
|
|
|
20
20
|
- 🎨 **Vue 3 Friendly**: Built entirely with the Composition API, perfectly fitting the Vue ecosystem.
|
|
21
21
|
- 💪 **Type Safe**: 100% written in TypeScript with complete type inference.
|
|
22
22
|
- ⚡️ **Vite Driven**: Lightning-fast local development and build experience.
|
|
23
|
-
- 📝 **Hybrid Markdown Rendering**: Optional hybrid rendering mode offering instant preview of headings, emphasis,
|
|
23
|
+
- 📝 **Hybrid Markdown Rendering**: Optional hybrid rendering mode offering instant preview of headings, emphasis, images, task lists, structured tables, and more within the editor.
|
|
24
|
+
- 🧩 **Structured Table Editing**: Supports structured table rendering, cell editing, row/column handles, append, and delete interactions under `livePreview`.
|
|
24
25
|
- ⌨️ **Vim Mode Support**: Built-in classic Vim modal editing and keybindings.
|
|
26
|
+
- 🎨 **Code Block Syntax Highlighting**: Built-in multi-language syntax highlighting with 9 color schemes and optional line numbers.
|
|
25
27
|
- 📦 **Dual Output Formats**: Supports both ESM and CommonJS.
|
|
26
28
|
|
|
27
29
|
## 📦 Installation
|
|
@@ -51,10 +53,41 @@ const content = ref('# Hello Una Editor!');
|
|
|
51
53
|
</script>
|
|
52
54
|
|
|
53
55
|
<template>
|
|
54
|
-
<UnaEditor v-model="content" :
|
|
56
|
+
<UnaEditor v-model="content" :live-preview="true" :vim-mode="false" />
|
|
55
57
|
</template>
|
|
56
58
|
```
|
|
57
59
|
|
|
60
|
+
## 🎨 Code Block Syntax Highlighting
|
|
61
|
+
|
|
62
|
+
Una Editor has built-in code block syntax highlighting with 9 color schemes and optional line numbers.
|
|
63
|
+
|
|
64
|
+
```vue
|
|
65
|
+
<UnaEditor
|
|
66
|
+
v-model="content"
|
|
67
|
+
code-theme="dracula"
|
|
68
|
+
:code-line-numbers="true"
|
|
69
|
+
/>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Available Color Schemes
|
|
73
|
+
|
|
74
|
+
| Dark Themes | Light Themes |
|
|
75
|
+
|-------------|-------------|
|
|
76
|
+
| `one-dark` (default) | `github-light` (default) |
|
|
77
|
+
| `dracula` | `solarized-light` |
|
|
78
|
+
| `monokai` | `atom-one-light` |
|
|
79
|
+
| `solarized-dark` | |
|
|
80
|
+
| `nord` | |
|
|
81
|
+
| `tokyo-night` | |
|
|
82
|
+
|
|
83
|
+
Set `code-theme="auto"` to follow the editor theme (`theme="dark"` uses `one-dark`, `theme="light"` uses `github-light`).
|
|
84
|
+
|
|
85
|
+
### Supported Languages
|
|
86
|
+
|
|
87
|
+
**Core languages** (loaded synchronously): JavaScript/JS, TypeScript/TS, JSX, TSX, CSS, Shell/Bash
|
|
88
|
+
|
|
89
|
+
**Extended languages** (lazy-loaded on demand): Python, PHP, Java, Go, Rust, C, C++
|
|
90
|
+
|
|
58
91
|
## 📖 API Documentation
|
|
59
92
|
|
|
60
93
|
For detailed information on component properties (Props), events (Events), exposed methods (Methods), etc., please refer to our **[API Reference](./docs/api.en.md)**.
|
package/README.md
CHANGED
|
@@ -20,8 +20,10 @@
|
|
|
20
20
|
- 🎨 **Vue 3 友好**:完全基于 Composition API 构建,完美契合 Vue 生态。
|
|
21
21
|
- 💪 **类型安全**:100% TypeScript 编写,提供完整的类型推导。
|
|
22
22
|
- ⚡️ **Vite 驱动**:极速的本地开发与构建体验。
|
|
23
|
-
- 📝 **Hybrid Markdown
|
|
23
|
+
- 📝 **Hybrid Markdown 渲染**:可选的混合渲染模式,在编辑态即可获得标题、强调、图片、任务列表、结构化表格等元素的即时预览。
|
|
24
|
+
- 🧩 **结构化表格编辑**:在 `livePreview` 下支持结构化表格渲染、单元格编辑、行列 handle、追加与删除等交互。
|
|
24
25
|
- ⌨️ **Vim 模式支持**:内置经典的 Vim 模态编辑与键位绑定。
|
|
26
|
+
- 🎨 **代码块语法高亮**:内置多语言语法高亮,支持 9 套配色方案和可选行号。
|
|
25
27
|
- 📦 **双格式输出**:同时支持 ESM 和 CommonJS。
|
|
26
28
|
|
|
27
29
|
## 📦 安装
|
|
@@ -51,10 +53,41 @@ const content = ref('# Hello Una Editor!');
|
|
|
51
53
|
</script>
|
|
52
54
|
|
|
53
55
|
<template>
|
|
54
|
-
<UnaEditor v-model="content" :
|
|
56
|
+
<UnaEditor v-model="content" :live-preview="true" :vim-mode="false" />
|
|
55
57
|
</template>
|
|
56
58
|
```
|
|
57
59
|
|
|
60
|
+
## 🎨 代码块语法高亮
|
|
61
|
+
|
|
62
|
+
Una Editor 内置了代码块语法高亮功能,支持 9 套配色方案和可选的代码行号。
|
|
63
|
+
|
|
64
|
+
```vue
|
|
65
|
+
<UnaEditor
|
|
66
|
+
v-model="content"
|
|
67
|
+
code-theme="dracula"
|
|
68
|
+
:code-line-numbers="true"
|
|
69
|
+
/>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 支持的配色方案
|
|
73
|
+
|
|
74
|
+
| 深色主题 | 浅色主题 |
|
|
75
|
+
|---------|---------|
|
|
76
|
+
| `one-dark` (默认) | `github-light` (默认) |
|
|
77
|
+
| `dracula` | `solarized-light` |
|
|
78
|
+
| `monokai` | `atom-one-light` |
|
|
79
|
+
| `solarized-dark` | |
|
|
80
|
+
| `nord` | |
|
|
81
|
+
| `tokyo-night` | |
|
|
82
|
+
|
|
83
|
+
设置 `code-theme="auto"` 可自动跟随编辑器主题(`theme="dark"` 使用 `one-dark`,`theme="light"` 使用 `github-light`)。
|
|
84
|
+
|
|
85
|
+
### 支持的语言
|
|
86
|
+
|
|
87
|
+
**核心语言**(同步加载):JavaScript/JS、TypeScript/TS、JSX、TSX、CSS、Shell/Bash
|
|
88
|
+
|
|
89
|
+
**扩展语言**(按需懒加载):Python、PHP、Java、Go、Rust、C、C++
|
|
90
|
+
|
|
58
91
|
## 📖 API 文档
|
|
59
92
|
|
|
60
93
|
关于详细的组件属性 (Props)、事件 (Events)、对外暴露的方法 (Methods) 等内容,请查阅我们的 **[API 手册](./docs/api.md)**。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function R(e,n,t,l,u,d){this.indented=e,this.column=n,this.type=t,this.info=l,this.align=u,this.prev=d}function D(e,n,t,l){var u=e.indented;return e.context&&e.context.type=="statement"&&t!="statement"&&(u=e.context.indented),e.context=new R(u,n,t,l,null,e.context)}function x(e){var n=e.context.type;return(n==")"||n=="]"||n=="}")&&(e.indented=e.context.indented),e.context=e.context.prev}function V(e,n,t){if(n.prevToken=="variable"||n.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,t))||n.typeAtEndOfLine&&e.column()==e.indentation())return!0}function P(e){for(;;){if(!e||e.type=="top")return!0;if(e.type=="}"&&e.prev.info!="namespace")return!1;e=e.prev}}function h(e){var n=e.statementIndentUnit,t=e.dontAlignCalls,l=e.keywords||{},u=e.types||{},d=e.builtin||{},b=e.blockKeywords||{},_=e.defKeywords||{},w=e.atoms||{},y=e.hooks||{},te=e.multiLineStrings,re=e.indentStatements!==!1,ie=e.indentSwitch!==!1,F=e.namespaceSeparator,oe=e.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,ae=e.numberStart||/[\d\.]/,le=e.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,j=e.isOperatorChar||/[+\-*&%=<>!?|\/]/,B=e.isIdentifierChar||/[\w\$_\xa1-\uffff]/,U=e.isReservedIdentifier||!1,p,C;function K(i,a){var c=i.next();if(y[c]){var o=y[c](i,a);if(o!==!1)return o}if(c=='"'||c=="'")return a.tokenize=ce(c),a.tokenize(i,a);if(ae.test(c)){if(i.backUp(1),i.match(le))return"number";i.next()}if(oe.test(c))return p=c,null;if(c=="/"){if(i.eat("*"))return a.tokenize=A,A(i,a);if(i.eat("/"))return i.skipToEnd(),"comment"}if(j.test(c)){for(;!i.match(/^\/[\/*]/,!1)&&i.eat(j););return"operator"}if(i.eatWhile(B),F)for(;i.match(F);)i.eatWhile(B);var s=i.current();return m(l,s)?(m(b,s)&&(p="newstatement"),m(_,s)&&(C=!0),"keyword"):m(u,s)?"type":m(d,s)||U&&U(s)?(m(b,s)&&(p="newstatement"),"builtin"):m(w,s)?"atom":"variable"}function ce(i){return function(a,c){for(var o=!1,s,v=!1;(s=a.next())!=null;){if(s==i&&!o){v=!0;break}o=!o&&s=="\\"}return(v||!(o||te))&&(c.tokenize=null),"string"}}function A(i,a){for(var c=!1,o;o=i.next();){if(o=="/"&&c){a.tokenize=null;break}c=o=="*"}return"comment"}function $(i,a){e.typeFirstDefinitions&&i.eol()&&P(a.context)&&(a.typeAtEndOfLine=V(i,a,i.pos))}return{name:e.name,startState:function(i){return{tokenize:null,context:new R(-i,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(i,a){var c=a.context;if(i.sol()&&(c.align==null&&(c.align=!1),a.indented=i.indentation(),a.startOfLine=!0),i.eatSpace())return $(i,a),null;p=C=null;var o=(a.tokenize||K)(i,a);if(o=="comment"||o=="meta")return o;if(c.align==null&&(c.align=!0),p==";"||p==":"||p==","&&i.match(/^\s*(?:\/\/.*)?$/,!1))for(;a.context.type=="statement";)x(a);else if(p=="{")D(a,i.column(),"}");else if(p=="[")D(a,i.column(),"]");else if(p=="(")D(a,i.column(),")");else if(p=="}"){for(;c.type=="statement";)c=x(a);for(c.type=="}"&&(c=x(a));c.type=="statement";)c=x(a)}else p==c.type?x(a):re&&((c.type=="}"||c.type=="top")&&p!=";"||c.type=="statement"&&p=="newstatement")&&D(a,i.column(),"statement",i.current());if(o=="variable"&&(a.prevToken=="def"||e.typeFirstDefinitions&&V(i,a,i.start)&&P(a.context)&&i.match(/^\s*\(/,!1))&&(o="def"),y.token){var s=y.token(i,a,o);s!==void 0&&(o=s)}return o=="def"&&e.styleDefs===!1&&(o="variable"),a.startOfLine=!1,a.prevToken=C?"def":o||p,$(i,a),o},indent:function(i,a,c){if(i.tokenize!=K&&i.tokenize!=null||i.typeAtEndOfLine&&P(i.context))return null;var o=i.context,s=a&&a.charAt(0),v=s==o.type;if(o.type=="statement"&&s=="}"&&(o=o.prev),e.dontIndentStatements)for(;o.type=="statement"&&e.dontIndentStatements.test(o.info);)o=o.prev;if(y.indent){var q=y.indent(i,o,a,c.unit);if(typeof q=="number")return q}var ue=o.prev&&o.prev.info=="switch";if(e.allmanIndentation&&/[{(]/.test(s)){for(;o.type!="top"&&o.type!="}";)o=o.prev;return o.indented}return o.type=="statement"?o.indented+(s=="{"?0:n||c.unit):o.align&&(!t||o.type!=")")?o.column+(v?0:1):o.type==")"&&!v?o.indented+(n||c.unit):o.indented+(v?0:c.unit)+(!v&&ue&&!/^(?:case|default)\b/.test(a)?c.unit:0)},languageData:{indentOnInput:ie?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}},autocomplete:Object.keys(l).concat(Object.keys(u)).concat(Object.keys(d)).concat(Object.keys(w)),...e.languageData}}}function r(e){for(var n={},t=e.split(" "),l=0;l<t.length;++l)n[t[l]]=!0;return n}function m(e,n){return typeof e=="function"?e(n):e.propertyIsEnumerable(n)}var T="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",H="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",Q="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",Z="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",se=r("int long char short double float unsigned signed void bool"),fe=r("SEL instancetype id Class Protocol BOOL");function I(e){return m(se,e)||/.+_t$/.test(e)}function X(e){return I(e)||m(fe,e)}var N="case do else for if switch while struct enum union",z="struct enum union";function g(e,n){if(!n.startOfLine)return!1;for(var t,l=null;t=e.peek();){if(t=="\\"&&e.match(/^.$/)){l=g;break}else if(t=="/"&&e.match(/^\/[\/\*]/,!1))break;e.next()}return n.tokenize=l,"meta"}function M(e,n){return n.prevToken=="type"?"type":!1}function E(e){return!e||e.length<2||e[0]!="_"?!1:e[1]=="_"||e[1]!==e[1].toLowerCase()}function f(e){return e.eatWhile(/[\w\.']/),"number"}function k(e,n){if(e.backUp(1),e.match(/^(?:R|u8R|uR|UR|LR)/)){var t=e.match(/^"([^\s\\()]{0,16})\(/);return t?(n.cpp11RawStringDelim=t[1],n.tokenize=G,G(e,n)):!1}return e.match(/^(?:u8|u|U|L)/)?e.match(/^["']/,!1)?"string":!1:(e.next(),!1)}function Y(e){var n=/(\w+)::~?(\w+)$/.exec(e);return n&&n[1]==n[2]}function W(e,n){for(var t;(t=e.next())!=null;)if(t=='"'&&!e.eat('"')){n.tokenize=null;break}return"string"}function G(e,n){var t=n.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),l=e.match(new RegExp(".*?\\)"+t+'"'));return l?n.tokenize=null:e.skipToEnd(),"string"}const de=h({name:"c",keywords:r(T),types:I,blockKeywords:r(N),defKeywords:r(z),typeFirstDefinitions:!0,atoms:r("NULL true false"),isReservedIdentifier:E,hooks:{"#":g,"*":M}}),pe=h({name:"cpp",keywords:r(T+" "+H),types:I,blockKeywords:r(N+" class try catch"),defKeywords:r(z+" class namespace"),typeFirstDefinitions:!0,atoms:r("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:E,hooks:{"#":g,"*":M,u:k,U:k,L:k,R:k,0:f,1:f,2:f,3:f,4:f,5:f,6:f,7:f,8:f,9:f,token:function(e,n,t){if(t=="variable"&&e.peek()=="("&&(n.prevToken==";"||n.prevToken==null||n.prevToken=="}")&&Y(e.current()))return"def"}},namespaceSeparator:"::"});h({name:"java",keywords:r("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:r("var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:r("catch class do else finally for if switch try while"),defKeywords:r("class interface enum @interface"),typeFirstDefinitions:!0,atoms:r("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return e.match("interface",!1)?!1:(e.eatWhile(/[\w\$_]/),"meta")},'"':function(e,n){return e.match(/""$/)?(n.tokenize=J,n.tokenize(e,n)):!1}}});h({name:"csharp",keywords:r("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in init interface internal is lock namespace new operator out override params private protected public readonly record ref required return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:r("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:r("catch class do else finally for foreach if struct switch try while"),defKeywords:r("class interface namespace record struct var"),typeFirstDefinitions:!0,atoms:r("true false null"),hooks:{"@":function(e,n){return e.eat('"')?(n.tokenize=W,W(e,n)):(e.eatWhile(/[\w\$_]/),"meta")}}});function J(e,n){for(var t=!1;!e.eol();){if(!t&&e.match('"""')){n.tokenize=null;break}t=e.next()=="\\"&&!t}return"string"}function S(e){return function(n,t){for(var l;l=n.next();)if(l=="*"&&n.eat("/"))if(e==1){t.tokenize=null;break}else return t.tokenize=S(e-1),t.tokenize(n,t);else if(l=="/"&&n.eat("*"))return t.tokenize=S(e+1),t.tokenize(n,t);return"comment"}}h({name:"scala",keywords:r("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:r("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:r("catch class enum do else finally for forSome if match switch try while"),defKeywords:r("class enum def object package trait type val var"),atoms:r("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,n){return e.match('""')?(n.tokenize=J,n.tokenize(e,n)):!1},"'":function(e){return e.match(/^(\\[^'\s]+|[^\\'])'/)?"character":(e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(e,n){var t=n.context;return t.type=="}"&&t.align&&e.eat(">")?(n.context=new R(t.indented,t.column,t.type,t.info,null,t.prev),"operator"):!1},"/":function(e,n){return e.eat("*")?(n.tokenize=S(1),n.tokenize(e,n)):!1}},languageData:{closeBrackets:{brackets:["(","[","{","'",'"','"""']}}});function he(e){return function(n,t){for(var l=!1,u,d=!1;!n.eol();){if(!e&&!l&&n.match('"')){d=!0;break}if(e&&n.match('"""')){d=!0;break}u=n.next(),!l&&u=="$"&&n.match("{")&&n.skipTo("}"),l=!l&&u=="\\"&&!e}return(d||!e)&&(t.tokenize=null),"string"}}h({name:"kotlin",keywords:r("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:r("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(ul?|l|f)?/i,blockKeywords:r("catch class do else finally for if where try while enum"),defKeywords:r("class val var object interface fun"),atoms:r("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,n){return n.prevToken=="."?"variable":"operator"},'"':function(e,n){return n.tokenize=he(e.match('""')),n.tokenize(e,n)},"/":function(e,n){return e.eat("*")?(n.tokenize=S(1),n.tokenize(e,n)):!1},indent:function(e,n,t,l){var u=t&&t.charAt(0);if((e.prevToken=="}"||e.prevToken==")")&&t=="")return e.indented;if(e.prevToken=="operator"&&t!="}"&&e.context.type!="}"||e.prevToken=="variable"&&u=="."||(e.prevToken=="}"||e.prevToken==")")&&u==".")return l*2+n.indented;if(n.align&&n.type=="}")return n.indented+(e.context.type==(t||"").charAt(0)?0:l)}},languageData:{closeBrackets:{brackets:["(","[","{","'",'"','"""']}}});h({name:"shader",keywords:r("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:r("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:r("for while do if else struct"),builtin:r("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:r("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":g}});h({name:"nesc",keywords:r(T+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:I,blockKeywords:r(N),atoms:r("null true false"),hooks:{"#":g}});h({name:"objectivec",keywords:r(T+" "+Q),types:X,builtin:r(Z),blockKeywords:r(N+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:r(z+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:r("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:E,hooks:{"#":g,"*":M}});h({name:"objectivecpp",keywords:r(T+" "+Q+" "+H),types:X,builtin:r(Z),blockKeywords:r(N+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:r(z+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:r("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:E,hooks:{"#":g,"*":M,u:k,U:k,L:k,R:k,0:f,1:f,2:f,3:f,4:f,5:f,6:f,7:f,8:f,9:f,token:function(e,n,t){if(t=="variable"&&e.peek()=="("&&(n.prevToken==";"||n.prevToken==null||n.prevToken=="}")&&Y(e.current()))return"def"}},namespaceSeparator:"::"});h({name:"squirrel",keywords:r("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:I,blockKeywords:r("case catch class else for foreach if switch try while"),defKeywords:r("function local class"),typeFirstDefinitions:!0,atoms:r("true false null"),hooks:{"#":g}});var L=null;function ee(e){return function(n,t){for(var l=!1,u,d=!1;!n.eol();){if(!l&&n.match('"')&&(e=="single"||n.match('""'))){d=!0;break}if(!l&&n.match("``")){L=ee(e),d=!0;break}u=n.next(),l=e=="single"&&!l&&u=="\\"}return d&&(t.tokenize=null),"string"}}h({name:"ceylon",keywords:r("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var n=e.charAt(0);return n===n.toUpperCase()&&n!==n.toLowerCase()},blockKeywords:r("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:r("class dynamic function interface module object package value"),builtin:r("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:r("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,n){return n.tokenize=ee(e.match('""')?"triple":"single"),n.tokenize(e,n)},"`":function(e,n){return!L||!e.match("`")?!1:(n.tokenize=L,L=null,n.tokenize(e,n))},"'":function(e){return e.match(/^(\\[^'\s]+|[^\\'])'/)?"string.special":(e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},token:function(e,n,t){if((t=="variable"||t=="type")&&n.prevToken==".")return"variableName.special"}},languageData:{closeBrackets:{brackets:["(","[","{","'",'"','"""']}}});function ye(e){(e.interpolationStack||(e.interpolationStack=[])).push(e.tokenize)}function ne(e){return(e.interpolationStack||(e.interpolationStack=[])).pop()}function me(e){return e.interpolationStack?e.interpolationStack.length:0}function O(e,n,t,l){var u=!1;if(n.eat(e))if(n.eat(e))u=!0;else return"string";function d(b,_){for(var w=!1;!b.eol();){if(!l&&!w&&b.peek()=="$")return ye(_),_.tokenize=ke,"string";var y=b.next();if(y==e&&!w&&(!u||b.match(e+e))){_.tokenize=null;break}w=!l&&!w&&y=="\\"}return"string"}return t.tokenize=d,d(n,t)}function ke(e,n){return e.eat("$"),e.eat("{")?n.tokenize=null:n.tokenize=ge,null}function ge(e,n){return e.eatWhile(/[\w_]/),n.tokenize=ne(n),"variable"}h({name:"dart",keywords:r("this super static final const abstract class extends external factory implements mixin get native set typedef with enum throw rethrow assert break case continue default in return new deferred async await covariant try catch finally do else for if switch while import library export part of show hide is as extension on yield late required sealed base interface when inline"),blockKeywords:r("try catch finally do else for if switch while"),builtin:r("void bool num int double dynamic var String Null Never"),atoms:r("true false null"),number:/^(?:0x[a-f\d_]+|(?:[\d_]+\.?[\d_]*|\.[\d_]+)(?:e[-+]?[\d_]+)?)/i,hooks:{"@":function(e){return e.eatWhile(/[\w\$_\.]/),"meta"},"'":function(e,n){return O("'",e,n,!1)},'"':function(e,n){return O('"',e,n,!1)},r:function(e,n){var t=e.peek();return t=="'"||t=='"'?O(e.next(),e,n,!0):!1},"}":function(e,n){return me(n)>0?(n.tokenize=ne(n),null):!1},"/":function(e,n){return e.eat("*")?(n.tokenize=S(1),n.tokenize(e,n)):!1},token:function(e,n,t){if(t=="variable"){var l=RegExp("^[_$]*[A-Z][a-zA-Z0-9_$]*$","g");if(l.test(e.current()))return"type"}}}});exports.c=de;exports.clike=h;exports.cpp=pe;
|