@aardarch/aardink-web 0.6.0-rc1 → 0.6.0-rc2
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.md +1 -3
- package/index.d.ts +18 -4
- package/index.js +14 -4
- package/kotlin/aardink-web.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -102,9 +102,7 @@ the measurements and the device checklist.
|
|
|
102
102
|
- **A disposed editor is not fully released** (about 275 KB each) until Aardink moves to Compose
|
|
103
103
|
Multiplatform 1.13. Reuse one editor with `setValue` and `updateOptions` rather than mounting
|
|
104
104
|
one per view.
|
|
105
|
-
-
|
|
106
|
-
- Whitespace is not rendered (`renderWhitespace`), and a completion inserts plain text: snippet
|
|
107
|
-
placeholders such as `$1` are not expanded.
|
|
105
|
+
- A theme rule's `background` is ignored; its `foreground` and `fontStyle` apply.
|
|
108
106
|
|
|
109
107
|
## Licence
|
|
110
108
|
|
package/index.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export interface AardinkOptions {
|
|
|
35
35
|
insertSpaces?: boolean;
|
|
36
36
|
/** Monaco's `renderLineHighlight`: anything but `'none'` highlights each caret's line. */
|
|
37
37
|
renderLineHighlight?: 'none' | 'line' | 'gutter' | 'all';
|
|
38
|
+
/** Which spaces and tabs are drawn, as dots and arrows. `'selection'` by default. */
|
|
39
|
+
renderWhitespace?: 'none' | 'boundary' | 'selection' | 'trailing' | 'all';
|
|
38
40
|
/** Colours brackets by nesting depth. On by default. */
|
|
39
41
|
bracketPairColorization?: { enabled?: boolean } | boolean;
|
|
40
42
|
/** A picture of the whole text at the side, with a slider over what is shown. Off by default. */
|
|
@@ -137,10 +139,21 @@ export interface AardinkLanguageDefinition {
|
|
|
137
139
|
comments?: { lineComment?: string; blockComment?: [string, string] };
|
|
138
140
|
}
|
|
139
141
|
|
|
142
|
+
/** Monaco's flags for a completion's `insertText`. */
|
|
143
|
+
export declare const CompletionItemInsertTextRule: {
|
|
144
|
+
readonly None: 0;
|
|
145
|
+
/** Insert the snippet's whitespace as written, rather than indented as the line it lands on. */
|
|
146
|
+
readonly KeepWhitespace: 1;
|
|
147
|
+
/** `insertText` is a snippet: `$1`, `${1:placeholder}` and `${1|a,b|}` are tab stops, `$0` the final caret. */
|
|
148
|
+
readonly InsertAsSnippet: 4;
|
|
149
|
+
};
|
|
150
|
+
|
|
140
151
|
export interface AardinkCompletionItem {
|
|
141
152
|
label: string;
|
|
142
|
-
/** What accepting it types; the label when absent. */
|
|
153
|
+
/** What accepting it types; the label when absent. A snippet with `InsertAsSnippet`. */
|
|
143
154
|
insertText?: string;
|
|
155
|
+
/** `CompletionItemInsertTextRule` flags, as in Monaco. */
|
|
156
|
+
insertTextRules?: number;
|
|
144
157
|
kind?: 'element' | 'attribute' | 'value' | 'snippet' | 'module' | 'property';
|
|
145
158
|
detail?: string;
|
|
146
159
|
documentation?: string;
|
|
@@ -161,9 +174,10 @@ export interface AardinkLanguageProviders {
|
|
|
161
174
|
export function registerLanguage(definition: AardinkLanguageDefinition, providers?: AardinkLanguageProviders): Promise<void>;
|
|
162
175
|
|
|
163
176
|
/**
|
|
164
|
-
* Monaco's `defineTheme` data. Token rules name
|
|
165
|
-
* `tag
|
|
166
|
-
*
|
|
177
|
+
* Monaco's `defineTheme` data. Token rules name tokens as Monaco does, and the longest matching
|
|
178
|
+
* prefix wins: `tag` also colours `tag.aardflex`, `comment.doc` only documentation comments. A
|
|
179
|
+
* rule's `fontStyle` (`'bold'`, `'italic'`, `'underline'`, `'strikethrough'`, or `''` for none)
|
|
180
|
+
* applies too; its `background` is accepted, so Monaco theme data passes as it is, and ignored.
|
|
167
181
|
*/
|
|
168
182
|
export interface AardinkThemeData {
|
|
169
183
|
base: 'vs' | 'vs-dark' | 'hc-black' | 'hc-light';
|
package/index.js
CHANGED
|
@@ -17,7 +17,10 @@
|
|
|
17
17
|
// Adapts the Kotlin module's integer-handle exports (aardinkCreate, aardinkGetValue, ...) into
|
|
18
18
|
// the Monaco-shaped object described in index.d.ts.
|
|
19
19
|
|
|
20
|
-
export const version = '0.6.0-
|
|
20
|
+
export const version = '0.6.0-rc2';
|
|
21
|
+
|
|
22
|
+
/** Monaco's flags for a completion's `insertText`. */
|
|
23
|
+
export const CompletionItemInsertTextRule = Object.freeze({ None: 0, KeepWhitespace: 1, InsertAsSnippet: 4 });
|
|
21
24
|
|
|
22
25
|
let kotlinModule;
|
|
23
26
|
|
|
@@ -112,9 +115,16 @@ function toVsCodeTheme(theme) {
|
|
|
112
115
|
type: base === 'vscode-light' ? 'light' : 'dark',
|
|
113
116
|
base: theme.inherit === false ? undefined : base,
|
|
114
117
|
colors: theme.colors ?? {},
|
|
118
|
+
// A rule's colour and font style; its background is not drawn.
|
|
115
119
|
tokenColors: theme.rules
|
|
116
|
-
.filter((rule) => rule.foreground)
|
|
117
|
-
.map((rule) => ({
|
|
120
|
+
.filter((rule) => rule.foreground || rule.fontStyle !== undefined)
|
|
121
|
+
.map((rule) => ({
|
|
122
|
+
scope: rule.token,
|
|
123
|
+
settings: {
|
|
124
|
+
...(rule.foreground ? { foreground: `#${rule.foreground.replace(/^#/, '')}` } : {}),
|
|
125
|
+
...(rule.fontStyle !== undefined ? { fontStyle: rule.fontStyle } : {}),
|
|
126
|
+
},
|
|
127
|
+
})),
|
|
118
128
|
};
|
|
119
129
|
}
|
|
120
130
|
|
|
@@ -134,7 +144,7 @@ export const defineTheme = registerTheme;
|
|
|
134
144
|
*/
|
|
135
145
|
function toKotlinOptions(options) {
|
|
136
146
|
const out = {};
|
|
137
|
-
for (const key of ['language', 'theme', 'fontSize', 'readOnly', 'showGutter', 'showLineNumbers', 'showFoldMarkers', 'tabSize', 'insertSpaces', 'highlightCurrentLine']) {
|
|
147
|
+
for (const key of ['language', 'theme', 'fontSize', 'readOnly', 'showGutter', 'showLineNumbers', 'showFoldMarkers', 'tabSize', 'insertSpaces', 'highlightCurrentLine', 'renderWhitespace']) {
|
|
138
148
|
if (options[key] !== undefined) out[key] = options[key];
|
|
139
149
|
}
|
|
140
150
|
if (options.wordWrap !== undefined) out.wordWrap = options.wordWrap === 'on';
|
package/kotlin/aardink-web.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED