weml-monaco 0.3.2

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.
@@ -0,0 +1,20 @@
1
+ import type * as monaco from 'monaco-editor';
2
+ import { HTMLDocument, LanguageService, Node, Position as LspPosition, TextDocument as HtmlTextDocument } from 'vscode-html-languageservice';
3
+ export type { HTMLDocument, Node } from 'vscode-html-languageservice';
4
+ export declare const htmlLanguageService: LanguageService;
5
+ export interface WemlDocument {
6
+ textDocument: HtmlTextDocument;
7
+ htmlDocument: HTMLDocument;
8
+ }
9
+ export declare function getWemlDocument(model: monaco.editor.ITextModel): WemlDocument;
10
+ /** Monaco position (1-based) → byte offset in the document. */
11
+ export declare function offsetAt(textDocument: HtmlTextDocument, position: monaco.IPosition): number;
12
+ /** Byte offset → Monaco position (1-based). */
13
+ export declare function positionAt(textDocument: HtmlTextDocument, offset: number): monaco.IPosition;
14
+ /** Monaco position → LSP position (0-based), for calls into the language service. */
15
+ export declare function toLspPosition(position: monaco.IPosition): LspPosition;
16
+ /** A pair of byte offsets → Monaco range (1-based). */
17
+ export declare function rangeFromOffsets(textDocument: HtmlTextDocument, start: number, end: number): monaco.IRange;
18
+ export declare function getAttributeNames(node: Node): string[];
19
+ /** Strips the surrounding quotes from a raw attribute value as stored on `Node.attributes`. */
20
+ export declare function stripQuotes(value: string | null | undefined): string | undefined;
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "weml-monaco",
3
+ "version": "0.3.2",
4
+ "description": "WEML (White Estate Markup Language) language support for the Monaco editor: syntax highlighting, autocomplete, hover docs, structure diagnostics, outline and canonical formatting.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Burjuy/weml-language-vscode-extension.git",
9
+ "directory": "monaco-editor"
10
+ },
11
+ "main": "dist/weml-monaco.js",
12
+ "module": "dist/weml-monaco.esm.js",
13
+ "types": "dist/index.d.ts",
14
+ "files": [
15
+ "dist",
16
+ "README.md",
17
+ "CHANGELOG.md"
18
+ ],
19
+ "scripts": {
20
+ "typecheck": "tsc -p ./ --noEmit",
21
+ "build:lib": "esbuild src/index.ts --bundle --format=iife --global-name=WemlMonaco --external:fs --external:crypto --outfile=dist/weml-monaco.js --sourcemap",
22
+ "build:esm": "esbuild src/index.ts --bundle --format=esm --external:fs --external:crypto --outfile=dist/weml-monaco.esm.js --sourcemap",
23
+ "build:types": "tsc -p ./ --emitDeclarationOnly --declaration --outDir dist",
24
+ "build": "npm run build:lib && npm run build:esm && npm run build:types",
25
+ "pack:local": "npm run build && node -e \"const fs = require('fs'); if (!fs.existsSync('pack')) fs.mkdirSync('pack');\" && npm pack --pack-destination=pack",
26
+ "demo": "esbuild src/index.ts --bundle --format=iife --global-name=WemlMonaco --external:fs --external:crypto --outfile=demo/weml-monaco.js --sourcemap && echo Open demo/index.html",
27
+ "pretest": "npm run build:lib && npm run build:esm",
28
+ "test": "node test/smoke.mjs"
29
+ },
30
+ "dependencies": {
31
+ "node-html-parser": "^6.1.13",
32
+ "vscode-html-languageservice": "^5.2.0"
33
+ },
34
+ "devDependencies": {
35
+ "esbuild": "^0.21.0",
36
+ "monaco-editor": "^0.45.0",
37
+ "typescript": "^5.4.0"
38
+ },
39
+ "peerDependencies": {
40
+ "monaco-editor": ">=0.34.0"
41
+ }
42
+ }