Premier commit déjà bien avancé
This commit is contained in:
16
frontend/node_modules/@codemirror/lang-html/.github/workflows/dispatch.yml
generated
vendored
Normal file
16
frontend/node_modules/@codemirror/lang-html/.github/workflows/dispatch.yml
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
name: Trigger CI
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Dispatch to main repo
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Emit repository_dispatch
|
||||
uses: mvasigh/dispatch-action@main
|
||||
with:
|
||||
# You should create a personal access token and store it in your repository
|
||||
token: ${{ secrets.DISPATCH_AUTH }}
|
||||
repo: dev
|
||||
owner: codemirror
|
||||
event_type: push
|
||||
210
frontend/node_modules/@codemirror/lang-html/CHANGELOG.md
generated
vendored
Normal file
210
frontend/node_modules/@codemirror/lang-html/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,210 @@
|
||||
## 6.4.11 (2025-10-02)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Adjust autocompletion to work with @lezer/html's improved handling of `<` characters without tag name after them.
|
||||
|
||||
## 6.4.10 (2025-09-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Don't include period characters in the language's word characters.
|
||||
|
||||
## 6.4.9 (2024-04-12)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug in `autoCloseTags` that made tags not close when typing > after an attribute.
|
||||
|
||||
## 6.4.8 (2024-01-23)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Complete attribute names after whitespace in a tag even when completion isn't explicitly triggered.
|
||||
|
||||
## 6.4.7 (2023-11-27)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Parse `script` tags with `application/json` type as JSON syntax.
|
||||
|
||||
## 6.4.6 (2023-08-28)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
`autoCloseTags` now generates two separate transactions, so that the completion can be undone separately.
|
||||
|
||||
Add highlighting for the content of `<script>` tags with a type of `importmap` or `speculationrules`.
|
||||
|
||||
## 6.4.5 (2023-06-23)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug where HTML autocompletion didn't work when the cursor was at the end of a bit of HTML code inside a mixed-language document.
|
||||
|
||||
## 6.4.4 (2023-06-05)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug where the completed tag names didn't take into account the parent node's declared children in the schema in some circumstances.
|
||||
|
||||
## 6.4.3 (2023-03-27)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix a bug that could cause some nested language regions to be parsed multiple times.
|
||||
|
||||
## 6.4.2 (2023-02-10)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix an issue where `autoCloseTags` would close self-closing tags when typed directly in front of a word.
|
||||
|
||||
## 6.4.1 (2023-01-12)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Use only the tag name for matching of opening and closing tags.
|
||||
|
||||
## 6.4.0 (2022-11-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Directly depend on @lang/css 1.1.0, since we're using a new top rule name introduced in that.
|
||||
|
||||
### New features
|
||||
|
||||
Add a `globalAttrs` property to (completion) `TagSpec` objects that controls whether global attributes are completed in that tag.
|
||||
|
||||
## 6.3.1 (2022-11-29)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Remove incorrect pure annotation that broke the code after tree-shaking.
|
||||
|
||||
## 6.3.0 (2022-11-28)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Parse type=text/babel script tags as JSX.
|
||||
|
||||
### New features
|
||||
|
||||
The new `nestedLanguages` option can be used to configure how the content of script, style, and textarea tags is parsed.
|
||||
|
||||
The content of style attributes will now be parsed as CSS, and the content of on[event] attributes as JavaScript. The new `nestedAttributes` option can be used to configure the parsing of other attribute values.
|
||||
|
||||
## 6.2.0 (2022-11-16)
|
||||
|
||||
### New features
|
||||
|
||||
Add a `selfClosingTags` option to `html` that enables `/>` syntax.
|
||||
|
||||
## 6.1.4 (2022-11-15)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Parse the content of text/javascript or lang=ts script tags as TypeScript, use JS for text/jsx, and TSX for text/typescript-jsx.
|
||||
|
||||
## 6.1.3 (2022-10-24)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Remove deprecated HTML tags from the completions.
|
||||
|
||||
## 6.1.2 (2022-09-27)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Make tag auto-closing consume `>` characters after the cursor.
|
||||
|
||||
## 6.1.1 (2022-09-05)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Properly list the dependency on @codemirror/view in package.json.
|
||||
|
||||
## 6.1.0 (2022-06-22)
|
||||
|
||||
### New features
|
||||
|
||||
It is now possible to pass in options to extend the set of tags and attributes provided by autocompletion.
|
||||
|
||||
## 6.0.0 (2022-06-08)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
Update dependencies to 6.0.0
|
||||
|
||||
## 0.20.0 (2022-04-20)
|
||||
|
||||
### New features
|
||||
|
||||
Autocompletion now suggests the `<template>` and `<slot>` elements.
|
||||
|
||||
## 0.19.4 (2021-11-30)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix an issue where autoclosing a tag directly in front of alphanumeric text would include nonsense text in the completed tag name.
|
||||
|
||||
## 0.19.3 (2021-09-23)
|
||||
|
||||
### New features
|
||||
|
||||
The package now exports a completion source function, rather than a prebuilt completion extension.
|
||||
|
||||
Use more specific highlighting tags for attribute names and values.
|
||||
|
||||
## 0.19.2 (2021-09-21)
|
||||
|
||||
### New features
|
||||
|
||||
The new `autoCloseTags` extension (included by default in `html()`) finishes closing tags when you type a `>` or `/` character.
|
||||
|
||||
## 0.19.1 (2021-08-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix incorrect versions for @lezer dependencies.
|
||||
|
||||
## 0.19.0 (2021-08-11)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Improve autocompletion in/after unclosed opening tags.
|
||||
|
||||
### New features
|
||||
|
||||
`html()` now takes a `matchClosingTags` option to turn off closing tag matching.
|
||||
|
||||
## 0.18.1 (2021-05-05)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Fix an issue where the completer would sometimes try to complete an opening tag to its own close tag.
|
||||
|
||||
Fix a bug that would sometimes produce the wrong indentation in HTML elements.
|
||||
|
||||
Fix a bug that broke tag-specific attribute completion in tags like `<input>` or `<script>`.
|
||||
|
||||
Move a new version of lezer-html which solves some issues with autocompletion.
|
||||
|
||||
## 0.18.0 (2021-03-03)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
Improves indentation at end of implicitly closed elements.
|
||||
|
||||
## 0.17.1 (2021-01-06)
|
||||
|
||||
### New features
|
||||
|
||||
The package now also exports a CommonJS module.
|
||||
|
||||
## 0.17.0 (2020-12-29)
|
||||
|
||||
### Breaking changes
|
||||
|
||||
First numbered release.
|
||||
|
||||
21
frontend/node_modules/@codemirror/lang-html/LICENSE
generated
vendored
Normal file
21
frontend/node_modules/@codemirror/lang-html/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
147
frontend/node_modules/@codemirror/lang-html/README.md
generated
vendored
Normal file
147
frontend/node_modules/@codemirror/lang-html/README.md
generated
vendored
Normal file
@ -0,0 +1,147 @@
|
||||
<!-- NOTE: README.md is generated from src/README.md -->
|
||||
|
||||
# @codemirror/lang-html [](https://www.npmjs.org/package/@codemirror/lang-html)
|
||||
|
||||
[ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-html/blob/main/CHANGELOG.md) ]
|
||||
|
||||
This package implements HTML language support for the
|
||||
[CodeMirror](https://codemirror.net/) code editor.
|
||||
|
||||
The [project page](https://codemirror.net/) has more information, a
|
||||
number of [examples](https://codemirror.net/examples/) and the
|
||||
[documentation](https://codemirror.net/docs/).
|
||||
|
||||
This code is released under an
|
||||
[MIT license](https://github.com/codemirror/lang-html/tree/main/LICENSE).
|
||||
|
||||
We aim to be an inclusive, welcoming community. To make that explicit,
|
||||
we have a [code of
|
||||
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
|
||||
to communication around the project.
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
import {EditorView, basicSetup} from "codemirror"
|
||||
import {html} from "@codemirror/lang-html"
|
||||
|
||||
const view = new EditorView({
|
||||
parent: document.body,
|
||||
doc: `<!doctype html>\n<title>HTML</title>`,
|
||||
extensions: [basicSetup, html()]
|
||||
})
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
<dl>
|
||||
<dt id="user-content-html">
|
||||
<code><strong><a href="#user-content-html">html</a></strong>(<a id="user-content-html^config" href="#user-content-html^config">config</a>⁠?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a> = {}) → <a href="https://codemirror.net/docs/ref#language.LanguageSupport">LanguageSupport</a></code></dt>
|
||||
|
||||
<dd><p>Language support for HTML, including
|
||||
<a href="#user-content-htmlcompletion"><code>htmlCompletion</code></a> and JavaScript and
|
||||
CSS support extensions.</p>
|
||||
<dl><dt id="user-content-html^config">
|
||||
<code><strong><a href="#user-content-html^config">config</a></strong></code></dt>
|
||||
|
||||
<dd><dl><dt id="user-content-html^config.matchclosingtags">
|
||||
<code><strong><a href="#user-content-html^config.matchclosingtags">matchClosingTags</a></strong>⁠?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></dt>
|
||||
|
||||
<dd><p>By default, the syntax tree will highlight mismatched closing
|
||||
tags. Set this to <code>false</code> to turn that off (for example when you
|
||||
expect to only be parsing a fragment of HTML text, not a full
|
||||
document).</p>
|
||||
</dd><dt id="user-content-html^config.selfclosingtags">
|
||||
<code><strong><a href="#user-content-html^config.selfclosingtags">selfClosingTags</a></strong>⁠?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></dt>
|
||||
|
||||
<dd><p>By default, the parser does not allow arbitrary self-closing tags.
|
||||
Set this to <code>true</code> to turn on support for <code>/></code> self-closing tag
|
||||
syntax.</p>
|
||||
</dd><dt id="user-content-html^config.autoclosetags">
|
||||
<code><strong><a href="#user-content-html^config.autoclosetags">autoCloseTags</a></strong>⁠?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></dt>
|
||||
|
||||
<dd><p>Determines whether <a href="#user-content-autoclosetags"><code>autoCloseTags</code></a>
|
||||
is included in the support extensions. Defaults to true.</p>
|
||||
</dd><dt id="user-content-html^config.extratags">
|
||||
<code><strong><a href="#user-content-html^config.extratags">extraTags</a></strong>⁠?: <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype">Record</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, <a href="#user-content-tagspec">TagSpec</a>></code></dt>
|
||||
|
||||
<dd><p>Add additional tags that can be completed.</p>
|
||||
</dd><dt id="user-content-html^config.extraglobalattributes">
|
||||
<code><strong><a href="#user-content-html^config.extraglobalattributes">extraGlobalAttributes</a></strong>⁠?: <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype">Record</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, readonly <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>[] | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a>></code></dt>
|
||||
|
||||
<dd><p>Add additional completable attributes to all tags.</p>
|
||||
</dd><dt id="user-content-html^config.nestedlanguages">
|
||||
<code><strong><a href="#user-content-html^config.nestedlanguages">nestedLanguages</a></strong>⁠?: {tag: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, attrs⁠?: fn(<a id="user-content-html^config.nestedlanguages.attrs^attrs" href="#user-content-html^config.nestedlanguages.attrs^attrs">attrs</a>: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>>) → <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>, parser: <a href="https://lezer.codemirror.net/docs/ref/#common.Parser">Parser</a>}[]</code></dt>
|
||||
|
||||
<dd><p>Register additional languages to parse the content of specific
|
||||
tags. If given, <code>attrs</code> should be a function that, given an
|
||||
object representing the tag's attributes, returns <code>true</code> if this
|
||||
language applies.</p>
|
||||
</dd><dt id="user-content-html^config.nestedattributes">
|
||||
<code><strong><a href="#user-content-html^config.nestedattributes">nestedAttributes</a></strong>⁠?: {name: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, tagName⁠?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, parser: <a href="https://lezer.codemirror.net/docs/ref/#common.Parser">Parser</a>}[]</code></dt>
|
||||
|
||||
<dd><p>Register additional languages to parse attribute values with.</p>
|
||||
</dd></dl></dd></dl></dd>
|
||||
<dt id="user-content-htmllanguage">
|
||||
<code><strong><a href="#user-content-htmllanguage">htmlLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>
|
||||
|
||||
<dd><p>A language provider based on the <a href="https://github.com/lezer-parser/html">Lezer HTML
|
||||
parser</a>, extended with the
|
||||
JavaScript and CSS parsers to parse the content of <code><script></code> and
|
||||
<code><style></code> tags.</p>
|
||||
</dd>
|
||||
<dt id="user-content-htmlcompletionsource">
|
||||
<code><strong><a href="#user-content-htmlcompletionsource">htmlCompletionSource</a></strong>(<a id="user-content-htmlcompletionsource^context" href="#user-content-htmlcompletionsource^context">context</a>: <a href="https://codemirror.net/docs/ref#autocomplete.CompletionContext">CompletionContext</a>) → <a href="https://codemirror.net/docs/ref#autocomplete.CompletionResult">CompletionResult</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a></code></dt>
|
||||
|
||||
<dd><p>HTML tag completion. Opens and closes tags and attributes in a
|
||||
context-aware way.</p>
|
||||
</dd>
|
||||
<dt id="user-content-tagspec">
|
||||
<h4>
|
||||
<code>interface</code>
|
||||
<a href="#user-content-tagspec">TagSpec</a></h4>
|
||||
</dt>
|
||||
|
||||
<dd><p>Type used to specify tags to complete.</p>
|
||||
<dl><dt id="user-content-tagspec.attrs">
|
||||
<code><strong><a href="#user-content-tagspec.attrs">attrs</a></strong>⁠?: <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype">Record</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, readonly <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>[] | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a>></code></dt>
|
||||
|
||||
<dd><p>Define tag-specific attributes. Property names are attribute
|
||||
names, and property values can be null to indicate free-form
|
||||
attributes, or a list of strings for suggested attribute values.</p>
|
||||
</dd><dt id="user-content-tagspec.globalattrs">
|
||||
<code><strong><a href="#user-content-tagspec.globalattrs">globalAttrs</a></strong>⁠?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></dt>
|
||||
|
||||
<dd><p>When set to false, don't complete global attributes on this tag.</p>
|
||||
</dd><dt id="user-content-tagspec.children">
|
||||
<code><strong><a href="#user-content-tagspec.children">children</a></strong>⁠?: readonly <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>[]</code></dt>
|
||||
|
||||
<dd><p>Can be used to specify a list of child tags that are valid
|
||||
inside this tag. The default is to allow any tag.</p>
|
||||
</dd></dl>
|
||||
|
||||
</dd>
|
||||
<dt id="user-content-htmlcompletionsourcewith">
|
||||
<code><strong><a href="#user-content-htmlcompletionsourcewith">htmlCompletionSourceWith</a></strong>(<a id="user-content-htmlcompletionsourcewith^config" href="#user-content-htmlcompletionsourcewith^config">config</a>: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>) → fn(<a id="user-content-htmlcompletionsourcewith^returns^context" href="#user-content-htmlcompletionsourcewith^returns^context">context</a>: <a href="https://codemirror.net/docs/ref#autocomplete.CompletionContext">CompletionContext</a>) → <a href="https://codemirror.net/docs/ref#autocomplete.CompletionResult">CompletionResult</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a></code></dt>
|
||||
|
||||
<dd><p>Create a completion source for HTML extended with additional tags
|
||||
or attributes.</p>
|
||||
<dl><dt id="user-content-htmlcompletionsourcewith^config">
|
||||
<code><strong><a href="#user-content-htmlcompletionsourcewith^config">config</a></strong></code></dt>
|
||||
|
||||
<dd><dl><dt id="user-content-htmlcompletionsourcewith^config.extratags">
|
||||
<code><strong><a href="#user-content-htmlcompletionsourcewith^config.extratags">extraTags</a></strong>⁠?: <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype">Record</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, <a href="#user-content-tagspec">TagSpec</a>></code></dt>
|
||||
|
||||
<dd><p>Define extra tag names to complete.</p>
|
||||
</dd><dt id="user-content-htmlcompletionsourcewith^config.extraglobalattributes">
|
||||
<code><strong><a href="#user-content-htmlcompletionsourcewith^config.extraglobalattributes">extraGlobalAttributes</a></strong>⁠?: <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeystype">Record</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, readonly <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>[] | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null">null</a>></code></dt>
|
||||
|
||||
<dd><p>Add global attributes that are available on all tags.</p>
|
||||
</dd></dl></dd></dl></dd>
|
||||
<dt id="user-content-autoclosetags">
|
||||
<code><strong><a href="#user-content-autoclosetags">autoCloseTags</a></strong>: <a href="https://codemirror.net/docs/ref#state.Extension">Extension</a></code></dt>
|
||||
|
||||
<dd><p>Extension that will automatically insert close tags when a <code>></code> or
|
||||
<code>/</code> is typed.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
667
frontend/node_modules/@codemirror/lang-html/dist/index.cjs
generated
vendored
Normal file
667
frontend/node_modules/@codemirror/lang-html/dist/index.cjs
generated
vendored
Normal file
@ -0,0 +1,667 @@
|
||||
'use strict';
|
||||
|
||||
var html$1 = require('@lezer/html');
|
||||
var langCss = require('@codemirror/lang-css');
|
||||
var langJavascript = require('@codemirror/lang-javascript');
|
||||
var view = require('@codemirror/view');
|
||||
var state = require('@codemirror/state');
|
||||
var language = require('@codemirror/language');
|
||||
|
||||
const Targets = ["_blank", "_self", "_top", "_parent"];
|
||||
const Charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"];
|
||||
const Methods = ["get", "post", "put", "delete"];
|
||||
const Encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"];
|
||||
const Bool = ["true", "false"];
|
||||
const S = {}; // Empty tag spec
|
||||
const Tags = {
|
||||
a: {
|
||||
attrs: {
|
||||
href: null, ping: null, type: null,
|
||||
media: null,
|
||||
target: Targets,
|
||||
hreflang: null
|
||||
}
|
||||
},
|
||||
abbr: S,
|
||||
address: S,
|
||||
area: {
|
||||
attrs: {
|
||||
alt: null, coords: null, href: null, target: null, ping: null,
|
||||
media: null, hreflang: null, type: null,
|
||||
shape: ["default", "rect", "circle", "poly"]
|
||||
}
|
||||
},
|
||||
article: S,
|
||||
aside: S,
|
||||
audio: {
|
||||
attrs: {
|
||||
src: null, mediagroup: null,
|
||||
crossorigin: ["anonymous", "use-credentials"],
|
||||
preload: ["none", "metadata", "auto"],
|
||||
autoplay: ["autoplay"],
|
||||
loop: ["loop"],
|
||||
controls: ["controls"]
|
||||
}
|
||||
},
|
||||
b: S,
|
||||
base: { attrs: { href: null, target: Targets } },
|
||||
bdi: S,
|
||||
bdo: S,
|
||||
blockquote: { attrs: { cite: null } },
|
||||
body: S,
|
||||
br: S,
|
||||
button: {
|
||||
attrs: {
|
||||
form: null, formaction: null, name: null, value: null,
|
||||
autofocus: ["autofocus"],
|
||||
disabled: ["autofocus"],
|
||||
formenctype: Encs,
|
||||
formmethod: Methods,
|
||||
formnovalidate: ["novalidate"],
|
||||
formtarget: Targets,
|
||||
type: ["submit", "reset", "button"]
|
||||
}
|
||||
},
|
||||
canvas: { attrs: { width: null, height: null } },
|
||||
caption: S,
|
||||
center: S,
|
||||
cite: S,
|
||||
code: S,
|
||||
col: { attrs: { span: null } },
|
||||
colgroup: { attrs: { span: null } },
|
||||
command: {
|
||||
attrs: {
|
||||
type: ["command", "checkbox", "radio"],
|
||||
label: null, icon: null, radiogroup: null, command: null, title: null,
|
||||
disabled: ["disabled"],
|
||||
checked: ["checked"]
|
||||
}
|
||||
},
|
||||
data: { attrs: { value: null } },
|
||||
datagrid: { attrs: { disabled: ["disabled"], multiple: ["multiple"] } },
|
||||
datalist: { attrs: { data: null } },
|
||||
dd: S,
|
||||
del: { attrs: { cite: null, datetime: null } },
|
||||
details: { attrs: { open: ["open"] } },
|
||||
dfn: S,
|
||||
div: S,
|
||||
dl: S,
|
||||
dt: S,
|
||||
em: S,
|
||||
embed: { attrs: { src: null, type: null, width: null, height: null } },
|
||||
eventsource: { attrs: { src: null } },
|
||||
fieldset: { attrs: { disabled: ["disabled"], form: null, name: null } },
|
||||
figcaption: S,
|
||||
figure: S,
|
||||
footer: S,
|
||||
form: {
|
||||
attrs: {
|
||||
action: null, name: null,
|
||||
"accept-charset": Charsets,
|
||||
autocomplete: ["on", "off"],
|
||||
enctype: Encs,
|
||||
method: Methods,
|
||||
novalidate: ["novalidate"],
|
||||
target: Targets
|
||||
}
|
||||
},
|
||||
h1: S, h2: S, h3: S, h4: S, h5: S, h6: S,
|
||||
head: {
|
||||
children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
|
||||
},
|
||||
header: S,
|
||||
hgroup: S,
|
||||
hr: S,
|
||||
html: {
|
||||
attrs: { manifest: null }
|
||||
},
|
||||
i: S,
|
||||
iframe: {
|
||||
attrs: {
|
||||
src: null, srcdoc: null, name: null, width: null, height: null,
|
||||
sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"],
|
||||
seamless: ["seamless"]
|
||||
}
|
||||
},
|
||||
img: {
|
||||
attrs: {
|
||||
alt: null, src: null, ismap: null, usemap: null, width: null, height: null,
|
||||
crossorigin: ["anonymous", "use-credentials"]
|
||||
}
|
||||
},
|
||||
input: {
|
||||
attrs: {
|
||||
alt: null, dirname: null, form: null, formaction: null,
|
||||
height: null, list: null, max: null, maxlength: null, min: null,
|
||||
name: null, pattern: null, placeholder: null, size: null, src: null,
|
||||
step: null, value: null, width: null,
|
||||
accept: ["audio/*", "video/*", "image/*"],
|
||||
autocomplete: ["on", "off"],
|
||||
autofocus: ["autofocus"],
|
||||
checked: ["checked"],
|
||||
disabled: ["disabled"],
|
||||
formenctype: Encs,
|
||||
formmethod: Methods,
|
||||
formnovalidate: ["novalidate"],
|
||||
formtarget: Targets,
|
||||
multiple: ["multiple"],
|
||||
readonly: ["readonly"],
|
||||
required: ["required"],
|
||||
type: ["hidden", "text", "search", "tel", "url", "email", "password", "datetime", "date", "month",
|
||||
"week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio",
|
||||
"file", "submit", "image", "reset", "button"]
|
||||
}
|
||||
},
|
||||
ins: { attrs: { cite: null, datetime: null } },
|
||||
kbd: S,
|
||||
keygen: {
|
||||
attrs: {
|
||||
challenge: null, form: null, name: null,
|
||||
autofocus: ["autofocus"],
|
||||
disabled: ["disabled"],
|
||||
keytype: ["RSA"]
|
||||
}
|
||||
},
|
||||
label: { attrs: { for: null, form: null } },
|
||||
legend: S,
|
||||
li: { attrs: { value: null } },
|
||||
link: {
|
||||
attrs: {
|
||||
href: null, type: null,
|
||||
hreflang: null,
|
||||
media: null,
|
||||
sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
|
||||
}
|
||||
},
|
||||
map: { attrs: { name: null } },
|
||||
mark: S,
|
||||
menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } },
|
||||
meta: {
|
||||
attrs: {
|
||||
content: null,
|
||||
charset: Charsets,
|
||||
name: ["viewport", "application-name", "author", "description", "generator", "keywords"],
|
||||
"http-equiv": ["content-language", "content-type", "default-style", "refresh"]
|
||||
}
|
||||
},
|
||||
meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },
|
||||
nav: S,
|
||||
noscript: S,
|
||||
object: {
|
||||
attrs: {
|
||||
data: null, type: null, name: null, usemap: null, form: null, width: null, height: null,
|
||||
typemustmatch: ["typemustmatch"]
|
||||
}
|
||||
},
|
||||
ol: { attrs: { reversed: ["reversed"], start: null, type: ["1", "a", "A", "i", "I"] },
|
||||
children: ["li", "script", "template", "ul", "ol"] },
|
||||
optgroup: { attrs: { disabled: ["disabled"], label: null } },
|
||||
option: { attrs: { disabled: ["disabled"], label: null, selected: ["selected"], value: null } },
|
||||
output: { attrs: { for: null, form: null, name: null } },
|
||||
p: S,
|
||||
param: { attrs: { name: null, value: null } },
|
||||
pre: S,
|
||||
progress: { attrs: { value: null, max: null } },
|
||||
q: { attrs: { cite: null } },
|
||||
rp: S,
|
||||
rt: S,
|
||||
ruby: S,
|
||||
samp: S,
|
||||
script: {
|
||||
attrs: {
|
||||
type: ["text/javascript"],
|
||||
src: null,
|
||||
async: ["async"],
|
||||
defer: ["defer"],
|
||||
charset: Charsets
|
||||
}
|
||||
},
|
||||
section: S,
|
||||
select: {
|
||||
attrs: {
|
||||
form: null, name: null, size: null,
|
||||
autofocus: ["autofocus"],
|
||||
disabled: ["disabled"],
|
||||
multiple: ["multiple"]
|
||||
}
|
||||
},
|
||||
slot: { attrs: { name: null } },
|
||||
small: S,
|
||||
source: { attrs: { src: null, type: null, media: null } },
|
||||
span: S,
|
||||
strong: S,
|
||||
style: {
|
||||
attrs: {
|
||||
type: ["text/css"],
|
||||
media: null,
|
||||
scoped: null
|
||||
}
|
||||
},
|
||||
sub: S,
|
||||
summary: S,
|
||||
sup: S,
|
||||
table: S,
|
||||
tbody: S,
|
||||
td: { attrs: { colspan: null, rowspan: null, headers: null } },
|
||||
template: S,
|
||||
textarea: {
|
||||
attrs: {
|
||||
dirname: null, form: null, maxlength: null, name: null, placeholder: null,
|
||||
rows: null, cols: null,
|
||||
autofocus: ["autofocus"],
|
||||
disabled: ["disabled"],
|
||||
readonly: ["readonly"],
|
||||
required: ["required"],
|
||||
wrap: ["soft", "hard"]
|
||||
}
|
||||
},
|
||||
tfoot: S,
|
||||
th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } },
|
||||
thead: S,
|
||||
time: { attrs: { datetime: null } },
|
||||
title: S,
|
||||
tr: S,
|
||||
track: {
|
||||
attrs: {
|
||||
src: null, label: null, default: null,
|
||||
kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
|
||||
srclang: null
|
||||
}
|
||||
},
|
||||
ul: { children: ["li", "script", "template", "ul", "ol"] },
|
||||
var: S,
|
||||
video: {
|
||||
attrs: {
|
||||
src: null, poster: null, width: null, height: null,
|
||||
crossorigin: ["anonymous", "use-credentials"],
|
||||
preload: ["auto", "metadata", "none"],
|
||||
autoplay: ["autoplay"],
|
||||
mediagroup: ["movie"],
|
||||
muted: ["muted"],
|
||||
controls: ["controls"]
|
||||
}
|
||||
},
|
||||
wbr: S
|
||||
};
|
||||
const GlobalAttrs = {
|
||||
accesskey: null,
|
||||
class: null,
|
||||
contenteditable: Bool,
|
||||
contextmenu: null,
|
||||
dir: ["ltr", "rtl", "auto"],
|
||||
draggable: ["true", "false", "auto"],
|
||||
dropzone: ["copy", "move", "link", "string:", "file:"],
|
||||
hidden: ["hidden"],
|
||||
id: null,
|
||||
inert: ["inert"],
|
||||
itemid: null,
|
||||
itemprop: null,
|
||||
itemref: null,
|
||||
itemscope: ["itemscope"],
|
||||
itemtype: null,
|
||||
lang: ["ar", "bn", "de", "en-GB", "en-US", "es", "fr", "hi", "id", "ja", "pa", "pt", "ru", "tr", "zh"],
|
||||
spellcheck: Bool,
|
||||
autocorrect: Bool,
|
||||
autocapitalize: Bool,
|
||||
style: null,
|
||||
tabindex: null,
|
||||
title: null,
|
||||
translate: ["yes", "no"],
|
||||
rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"],
|
||||
role: "alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),
|
||||
"aria-activedescendant": null,
|
||||
"aria-atomic": Bool,
|
||||
"aria-autocomplete": ["inline", "list", "both", "none"],
|
||||
"aria-busy": Bool,
|
||||
"aria-checked": ["true", "false", "mixed", "undefined"],
|
||||
"aria-controls": null,
|
||||
"aria-describedby": null,
|
||||
"aria-disabled": Bool,
|
||||
"aria-dropeffect": null,
|
||||
"aria-expanded": ["true", "false", "undefined"],
|
||||
"aria-flowto": null,
|
||||
"aria-grabbed": ["true", "false", "undefined"],
|
||||
"aria-haspopup": Bool,
|
||||
"aria-hidden": Bool,
|
||||
"aria-invalid": ["true", "false", "grammar", "spelling"],
|
||||
"aria-label": null,
|
||||
"aria-labelledby": null,
|
||||
"aria-level": null,
|
||||
"aria-live": ["off", "polite", "assertive"],
|
||||
"aria-multiline": Bool,
|
||||
"aria-multiselectable": Bool,
|
||||
"aria-owns": null,
|
||||
"aria-posinset": null,
|
||||
"aria-pressed": ["true", "false", "mixed", "undefined"],
|
||||
"aria-readonly": Bool,
|
||||
"aria-relevant": null,
|
||||
"aria-required": Bool,
|
||||
"aria-selected": ["true", "false", "undefined"],
|
||||
"aria-setsize": null,
|
||||
"aria-sort": ["ascending", "descending", "none", "other"],
|
||||
"aria-valuemax": null,
|
||||
"aria-valuemin": null,
|
||||
"aria-valuenow": null,
|
||||
"aria-valuetext": null
|
||||
};
|
||||
const eventAttributes = ("beforeunload copy cut dragstart dragover dragleave dragenter dragend " +
|
||||
"drag paste focus blur change click load mousedown mouseenter mouseleave " +
|
||||
"mouseup keydown keyup resize scroll unload").split(" ").map(n => "on" + n);
|
||||
for (let a of eventAttributes)
|
||||
GlobalAttrs[a] = null;
|
||||
class Schema {
|
||||
constructor(extraTags, extraAttrs) {
|
||||
this.tags = { ...Tags, ...extraTags };
|
||||
this.globalAttrs = { ...GlobalAttrs, ...extraAttrs };
|
||||
this.allTags = Object.keys(this.tags);
|
||||
this.globalAttrNames = Object.keys(this.globalAttrs);
|
||||
}
|
||||
}
|
||||
Schema.default = new Schema;
|
||||
function elementName(doc, tree, max = doc.length) {
|
||||
if (!tree)
|
||||
return "";
|
||||
let tag = tree.firstChild;
|
||||
let name = tag && tag.getChild("TagName");
|
||||
return name ? doc.sliceString(name.from, Math.min(name.to, max)) : "";
|
||||
}
|
||||
function findParentElement(tree, skip = false) {
|
||||
for (; tree; tree = tree.parent)
|
||||
if (tree.name == "Element") {
|
||||
if (skip)
|
||||
skip = false;
|
||||
else
|
||||
return tree;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function allowedChildren(doc, tree, schema) {
|
||||
let parentInfo = schema.tags[elementName(doc, findParentElement(tree))];
|
||||
return (parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.children) || schema.allTags;
|
||||
}
|
||||
function openTags(doc, tree) {
|
||||
let open = [];
|
||||
for (let parent = findParentElement(tree); parent && !parent.type.isTop; parent = findParentElement(parent.parent)) {
|
||||
let tagName = elementName(doc, parent);
|
||||
if (tagName && parent.lastChild.name == "CloseTag")
|
||||
break;
|
||||
if (tagName && open.indexOf(tagName) < 0 && (tree.name == "EndTag" || tree.from >= parent.firstChild.to))
|
||||
open.push(tagName);
|
||||
}
|
||||
return open;
|
||||
}
|
||||
const identifier = /^[:\-\.\w\u00b7-\uffff]*$/;
|
||||
function completeTag(state, schema, tree, from, to) {
|
||||
let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">";
|
||||
let parent = findParentElement(tree, tree.name == "StartTag" || tree.name == "TagName");
|
||||
return { from, to,
|
||||
options: allowedChildren(state.doc, parent, schema).map(tagName => ({ label: tagName, type: "type" })).concat(openTags(state.doc, tree).map((tag, i) => ({ label: "/" + tag, apply: "/" + tag + end,
|
||||
type: "type", boost: 99 - i }))),
|
||||
validFor: /^\/?[:\-\.\w\u00b7-\uffff]*$/ };
|
||||
}
|
||||
function completeCloseTag(state, tree, from, to) {
|
||||
let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">";
|
||||
return { from, to,
|
||||
options: openTags(state.doc, tree).map((tag, i) => ({ label: tag, apply: tag + end, type: "type", boost: 99 - i })),
|
||||
validFor: identifier };
|
||||
}
|
||||
function completeStartTag(state, schema, tree, pos) {
|
||||
let options = [], level = 0;
|
||||
for (let tagName of allowedChildren(state.doc, tree, schema))
|
||||
options.push({ label: "<" + tagName, type: "type" });
|
||||
for (let open of openTags(state.doc, tree))
|
||||
options.push({ label: "</" + open + ">", type: "type", boost: 99 - level++ });
|
||||
return { from: pos, to: pos, options, validFor: /^<\/?[:\-\.\w\u00b7-\uffff]*$/ };
|
||||
}
|
||||
function completeAttrName(state, schema, tree, from, to) {
|
||||
let elt = findParentElement(tree), info = elt ? schema.tags[elementName(state.doc, elt)] : null;
|
||||
let localAttrs = info && info.attrs ? Object.keys(info.attrs) : [];
|
||||
let names = info && info.globalAttrs === false ? localAttrs
|
||||
: localAttrs.length ? localAttrs.concat(schema.globalAttrNames) : schema.globalAttrNames;
|
||||
return { from, to,
|
||||
options: names.map(attrName => ({ label: attrName, type: "property" })),
|
||||
validFor: identifier };
|
||||
}
|
||||
function completeAttrValue(state, schema, tree, from, to) {
|
||||
var _a;
|
||||
let nameNode = (_a = tree.parent) === null || _a === void 0 ? void 0 : _a.getChild("AttributeName");
|
||||
let options = [], token = undefined;
|
||||
if (nameNode) {
|
||||
let attrName = state.sliceDoc(nameNode.from, nameNode.to);
|
||||
let attrs = schema.globalAttrs[attrName];
|
||||
if (!attrs) {
|
||||
let elt = findParentElement(tree), info = elt ? schema.tags[elementName(state.doc, elt)] : null;
|
||||
attrs = (info === null || info === void 0 ? void 0 : info.attrs) && info.attrs[attrName];
|
||||
}
|
||||
if (attrs) {
|
||||
let base = state.sliceDoc(from, to).toLowerCase(), quoteStart = '"', quoteEnd = '"';
|
||||
if (/^['"]/.test(base)) {
|
||||
token = base[0] == '"' ? /^[^"]*$/ : /^[^']*$/;
|
||||
quoteStart = "";
|
||||
quoteEnd = state.sliceDoc(to, to + 1) == base[0] ? "" : base[0];
|
||||
base = base.slice(1);
|
||||
from++;
|
||||
}
|
||||
else {
|
||||
token = /^[^\s<>='"]*$/;
|
||||
}
|
||||
for (let value of attrs)
|
||||
options.push({ label: value, apply: quoteStart + value + quoteEnd, type: "constant" });
|
||||
}
|
||||
}
|
||||
return { from, to, options, validFor: token };
|
||||
}
|
||||
function htmlCompletionFor(schema, context) {
|
||||
let { state, pos } = context, tree = language.syntaxTree(state).resolveInner(pos, -1), around = tree.resolve(pos);
|
||||
for (let scan = pos, before; around == tree && (before = tree.childBefore(scan));) {
|
||||
let last = before.lastChild;
|
||||
if (!last || !last.type.isError || last.from < last.to)
|
||||
break;
|
||||
around = tree = before;
|
||||
scan = last.from;
|
||||
}
|
||||
if (tree.name == "TagName") {
|
||||
return tree.parent && /CloseTag$/.test(tree.parent.name) ? completeCloseTag(state, tree, tree.from, pos)
|
||||
: completeTag(state, schema, tree, tree.from, pos);
|
||||
}
|
||||
else if (tree.name == "StartTag" || tree.name == "IncompleteTag") {
|
||||
return completeTag(state, schema, tree, pos, pos);
|
||||
}
|
||||
else if (tree.name == "StartCloseTag" || tree.name == "IncompleteCloseTag") {
|
||||
return completeCloseTag(state, tree, pos, pos);
|
||||
}
|
||||
else if (tree.name == "OpenTag" || tree.name == "SelfClosingTag" || tree.name == "AttributeName") {
|
||||
return completeAttrName(state, schema, tree, tree.name == "AttributeName" ? tree.from : pos, pos);
|
||||
}
|
||||
else if (tree.name == "Is" || tree.name == "AttributeValue" || tree.name == "UnquotedAttributeValue") {
|
||||
return completeAttrValue(state, schema, tree, tree.name == "Is" ? pos : tree.from, pos);
|
||||
}
|
||||
else if (context.explicit && (around.name == "Element" || around.name == "Text" || around.name == "Document")) {
|
||||
return completeStartTag(state, schema, tree, pos);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
HTML tag completion. Opens and closes tags and attributes in a
|
||||
context-aware way.
|
||||
*/
|
||||
function htmlCompletionSource(context) {
|
||||
return htmlCompletionFor(Schema.default, context);
|
||||
}
|
||||
/**
|
||||
Create a completion source for HTML extended with additional tags
|
||||
or attributes.
|
||||
*/
|
||||
function htmlCompletionSourceWith(config) {
|
||||
let { extraTags, extraGlobalAttributes: extraAttrs } = config;
|
||||
let schema = extraAttrs || extraTags ? new Schema(extraTags, extraAttrs) : Schema.default;
|
||||
return (context) => htmlCompletionFor(schema, context);
|
||||
}
|
||||
|
||||
const jsonParser = langJavascript.javascriptLanguage.parser.configure({ top: "SingleExpression" });
|
||||
const defaultNesting = [
|
||||
{ tag: "script",
|
||||
attrs: attrs => attrs.type == "text/typescript" || attrs.lang == "ts",
|
||||
parser: langJavascript.typescriptLanguage.parser },
|
||||
{ tag: "script",
|
||||
attrs: attrs => attrs.type == "text/babel" || attrs.type == "text/jsx",
|
||||
parser: langJavascript.jsxLanguage.parser },
|
||||
{ tag: "script",
|
||||
attrs: attrs => attrs.type == "text/typescript-jsx",
|
||||
parser: langJavascript.tsxLanguage.parser },
|
||||
{ tag: "script",
|
||||
attrs(attrs) {
|
||||
return /^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(attrs.type);
|
||||
},
|
||||
parser: jsonParser },
|
||||
{ tag: "script",
|
||||
attrs(attrs) {
|
||||
return !attrs.type || /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(attrs.type);
|
||||
},
|
||||
parser: langJavascript.javascriptLanguage.parser },
|
||||
{ tag: "style",
|
||||
attrs(attrs) {
|
||||
return (!attrs.lang || attrs.lang == "css") && (!attrs.type || /^(text\/)?(x-)?(stylesheet|css)$/i.test(attrs.type));
|
||||
},
|
||||
parser: langCss.cssLanguage.parser }
|
||||
];
|
||||
const defaultAttrs = [
|
||||
{ name: "style",
|
||||
parser: langCss.cssLanguage.parser.configure({ top: "Styles" }) }
|
||||
].concat(eventAttributes.map(name => ({ name, parser: langJavascript.javascriptLanguage.parser })));
|
||||
const htmlPlain = language.LRLanguage.define({
|
||||
name: "html",
|
||||
parser: html$1.parser.configure({
|
||||
props: [
|
||||
language.indentNodeProp.add({
|
||||
Element(context) {
|
||||
let after = /^(\s*)(<\/)?/.exec(context.textAfter);
|
||||
if (context.node.to <= context.pos + after[0].length)
|
||||
return context.continue();
|
||||
return context.lineIndent(context.node.from) + (after[2] ? 0 : context.unit);
|
||||
},
|
||||
"OpenTag CloseTag SelfClosingTag"(context) {
|
||||
return context.column(context.node.from) + context.unit;
|
||||
},
|
||||
Document(context) {
|
||||
if (context.pos + /\s*/.exec(context.textAfter)[0].length < context.node.to)
|
||||
return context.continue();
|
||||
let endElt = null, close;
|
||||
for (let cur = context.node;;) {
|
||||
let last = cur.lastChild;
|
||||
if (!last || last.name != "Element" || last.to != cur.to)
|
||||
break;
|
||||
endElt = cur = last;
|
||||
}
|
||||
if (endElt && !((close = endElt.lastChild) && (close.name == "CloseTag" || close.name == "SelfClosingTag")))
|
||||
return context.lineIndent(endElt.from) + context.unit;
|
||||
return null;
|
||||
}
|
||||
}),
|
||||
language.foldNodeProp.add({
|
||||
Element(node) {
|
||||
let first = node.firstChild, last = node.lastChild;
|
||||
if (!first || first.name != "OpenTag")
|
||||
return null;
|
||||
return { from: first.to, to: last.name == "CloseTag" ? last.from : node.to };
|
||||
}
|
||||
}),
|
||||
language.bracketMatchingHandle.add({
|
||||
"OpenTag CloseTag": node => node.getChild("TagName")
|
||||
})
|
||||
]
|
||||
}),
|
||||
languageData: {
|
||||
commentTokens: { block: { open: "<!--", close: "-->" } },
|
||||
indentOnInput: /^\s*<\/\w+\W$/,
|
||||
wordChars: "-_"
|
||||
}
|
||||
});
|
||||
/**
|
||||
A language provider based on the [Lezer HTML
|
||||
parser](https://github.com/lezer-parser/html), extended with the
|
||||
JavaScript and CSS parsers to parse the content of `<script>` and
|
||||
`<style>` tags.
|
||||
*/
|
||||
const htmlLanguage = htmlPlain.configure({
|
||||
wrap: html$1.configureNesting(defaultNesting, defaultAttrs)
|
||||
});
|
||||
/**
|
||||
Language support for HTML, including
|
||||
[`htmlCompletion`](https://codemirror.net/6/docs/ref/#lang-html.htmlCompletion) and JavaScript and
|
||||
CSS support extensions.
|
||||
*/
|
||||
function html(config = {}) {
|
||||
let dialect = "", wrap;
|
||||
if (config.matchClosingTags === false)
|
||||
dialect = "noMatch";
|
||||
if (config.selfClosingTags === true)
|
||||
dialect = (dialect ? dialect + " " : "") + "selfClosing";
|
||||
if (config.nestedLanguages && config.nestedLanguages.length ||
|
||||
config.nestedAttributes && config.nestedAttributes.length)
|
||||
wrap = html$1.configureNesting((config.nestedLanguages || []).concat(defaultNesting), (config.nestedAttributes || []).concat(defaultAttrs));
|
||||
let lang = wrap ? htmlPlain.configure({ wrap, dialect }) : dialect ? htmlLanguage.configure({ dialect }) : htmlLanguage;
|
||||
return new language.LanguageSupport(lang, [
|
||||
htmlLanguage.data.of({ autocomplete: htmlCompletionSourceWith(config) }),
|
||||
config.autoCloseTags !== false ? autoCloseTags : [],
|
||||
langJavascript.javascript().support,
|
||||
langCss.css().support
|
||||
]);
|
||||
}
|
||||
const selfClosers = new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" "));
|
||||
/**
|
||||
Extension that will automatically insert close tags when a `>` or
|
||||
`/` is typed.
|
||||
*/
|
||||
const autoCloseTags = view.EditorView.inputHandler.of((view, from, to, text, insertTransaction) => {
|
||||
if (view.composing || view.state.readOnly || from != to || (text != ">" && text != "/") ||
|
||||
!htmlLanguage.isActiveAt(view.state, from, -1))
|
||||
return false;
|
||||
let base = insertTransaction(), { state: state$1 } = base;
|
||||
let closeTags = state$1.changeByRange(range => {
|
||||
var _a, _b, _c;
|
||||
let didType = state$1.doc.sliceString(range.from - 1, range.to) == text;
|
||||
let { head } = range, after = language.syntaxTree(state$1).resolveInner(head, -1), name;
|
||||
if (didType && text == ">" && after.name == "EndTag") {
|
||||
let tag = after.parent;
|
||||
if (((_b = (_a = tag.parent) === null || _a === void 0 ? void 0 : _a.lastChild) === null || _b === void 0 ? void 0 : _b.name) != "CloseTag" &&
|
||||
(name = elementName(state$1.doc, tag.parent, head)) &&
|
||||
!selfClosers.has(name)) {
|
||||
let to = head + (state$1.doc.sliceString(head, head + 1) === ">" ? 1 : 0);
|
||||
let insert = `</${name}>`;
|
||||
return { range, changes: { from: head, to, insert } };
|
||||
}
|
||||
}
|
||||
else if (didType && text == "/" && after.name == "IncompleteCloseTag") {
|
||||
let tag = after.parent;
|
||||
if (after.from == head - 2 && ((_c = tag.lastChild) === null || _c === void 0 ? void 0 : _c.name) != "CloseTag" &&
|
||||
(name = elementName(state$1.doc, tag, head)) && !selfClosers.has(name)) {
|
||||
let to = head + (state$1.doc.sliceString(head, head + 1) === ">" ? 1 : 0);
|
||||
let insert = `${name}>`;
|
||||
return {
|
||||
range: state.EditorSelection.cursor(head + insert.length, -1),
|
||||
changes: { from: head, to, insert }
|
||||
};
|
||||
}
|
||||
}
|
||||
return { range };
|
||||
});
|
||||
if (closeTags.changes.empty)
|
||||
return false;
|
||||
view.dispatch([
|
||||
base,
|
||||
state$1.update(closeTags, {
|
||||
userEvent: "input.complete",
|
||||
scrollIntoView: true
|
||||
})
|
||||
]);
|
||||
return true;
|
||||
});
|
||||
|
||||
exports.autoCloseTags = autoCloseTags;
|
||||
exports.html = html;
|
||||
exports.htmlCompletionSource = htmlCompletionSource;
|
||||
exports.htmlCompletionSourceWith = htmlCompletionSourceWith;
|
||||
exports.htmlLanguage = htmlLanguage;
|
||||
115
frontend/node_modules/@codemirror/lang-html/dist/index.d.cts
generated
vendored
Normal file
115
frontend/node_modules/@codemirror/lang-html/dist/index.d.cts
generated
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
import * as _codemirror_state from '@codemirror/state';
|
||||
import { Parser } from '@lezer/common';
|
||||
import { LRLanguage, LanguageSupport } from '@codemirror/language';
|
||||
import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
||||
|
||||
/**
|
||||
Type used to specify tags to complete.
|
||||
*/
|
||||
interface TagSpec {
|
||||
/**
|
||||
Define tag-specific attributes. Property names are attribute
|
||||
names, and property values can be null to indicate free-form
|
||||
attributes, or a list of strings for suggested attribute values.
|
||||
*/
|
||||
attrs?: Record<string, null | readonly string[]>;
|
||||
/**
|
||||
When set to false, don't complete global attributes on this tag.
|
||||
*/
|
||||
globalAttrs?: boolean;
|
||||
/**
|
||||
Can be used to specify a list of child tags that are valid
|
||||
inside this tag. The default is to allow any tag.
|
||||
*/
|
||||
children?: readonly string[];
|
||||
}
|
||||
/**
|
||||
HTML tag completion. Opens and closes tags and attributes in a
|
||||
context-aware way.
|
||||
*/
|
||||
declare function htmlCompletionSource(context: CompletionContext): CompletionResult | null;
|
||||
/**
|
||||
Create a completion source for HTML extended with additional tags
|
||||
or attributes.
|
||||
*/
|
||||
declare function htmlCompletionSourceWith(config: {
|
||||
/**
|
||||
Define extra tag names to complete.
|
||||
*/
|
||||
extraTags?: Record<string, TagSpec>;
|
||||
/**
|
||||
Add global attributes that are available on all tags.
|
||||
*/
|
||||
extraGlobalAttributes?: Record<string, null | readonly string[]>;
|
||||
}): (context: CompletionContext) => CompletionResult | null;
|
||||
|
||||
type NestedLang = {
|
||||
tag: string;
|
||||
attrs?: (attrs: {
|
||||
[attr: string]: string;
|
||||
}) => boolean;
|
||||
parser: Parser;
|
||||
};
|
||||
type NestedAttr = {
|
||||
name: string;
|
||||
tagName?: string;
|
||||
parser: Parser;
|
||||
};
|
||||
/**
|
||||
A language provider based on the [Lezer HTML
|
||||
parser](https://github.com/lezer-parser/html), extended with the
|
||||
JavaScript and CSS parsers to parse the content of `<script>` and
|
||||
`<style>` tags.
|
||||
*/
|
||||
declare const htmlLanguage: LRLanguage;
|
||||
/**
|
||||
Language support for HTML, including
|
||||
[`htmlCompletion`](https://codemirror.net/6/docs/ref/#lang-html.htmlCompletion) and JavaScript and
|
||||
CSS support extensions.
|
||||
*/
|
||||
declare function html(config?: {
|
||||
/**
|
||||
By default, the syntax tree will highlight mismatched closing
|
||||
tags. Set this to `false` to turn that off (for example when you
|
||||
expect to only be parsing a fragment of HTML text, not a full
|
||||
document).
|
||||
*/
|
||||
matchClosingTags?: boolean;
|
||||
/**
|
||||
By default, the parser does not allow arbitrary self-closing tags.
|
||||
Set this to `true` to turn on support for `/>` self-closing tag
|
||||
syntax.
|
||||
*/
|
||||
selfClosingTags?: boolean;
|
||||
/**
|
||||
Determines whether [`autoCloseTags`](https://codemirror.net/6/docs/ref/#lang-html.autoCloseTags)
|
||||
is included in the support extensions. Defaults to true.
|
||||
*/
|
||||
autoCloseTags?: boolean;
|
||||
/**
|
||||
Add additional tags that can be completed.
|
||||
*/
|
||||
extraTags?: Record<string, TagSpec>;
|
||||
/**
|
||||
Add additional completable attributes to all tags.
|
||||
*/
|
||||
extraGlobalAttributes?: Record<string, null | readonly string[]>;
|
||||
/**
|
||||
Register additional languages to parse the content of specific
|
||||
tags. If given, `attrs` should be a function that, given an
|
||||
object representing the tag's attributes, returns `true` if this
|
||||
language applies.
|
||||
*/
|
||||
nestedLanguages?: NestedLang[];
|
||||
/**
|
||||
Register additional languages to parse attribute values with.
|
||||
*/
|
||||
nestedAttributes?: NestedAttr[];
|
||||
}): LanguageSupport;
|
||||
/**
|
||||
Extension that will automatically insert close tags when a `>` or
|
||||
`/` is typed.
|
||||
*/
|
||||
declare const autoCloseTags: _codemirror_state.Extension;
|
||||
|
||||
export { type TagSpec, autoCloseTags, html, htmlCompletionSource, htmlCompletionSourceWith, htmlLanguage };
|
||||
115
frontend/node_modules/@codemirror/lang-html/dist/index.d.ts
generated
vendored
Normal file
115
frontend/node_modules/@codemirror/lang-html/dist/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
import * as _codemirror_state from '@codemirror/state';
|
||||
import { Parser } from '@lezer/common';
|
||||
import { LRLanguage, LanguageSupport } from '@codemirror/language';
|
||||
import { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
||||
|
||||
/**
|
||||
Type used to specify tags to complete.
|
||||
*/
|
||||
interface TagSpec {
|
||||
/**
|
||||
Define tag-specific attributes. Property names are attribute
|
||||
names, and property values can be null to indicate free-form
|
||||
attributes, or a list of strings for suggested attribute values.
|
||||
*/
|
||||
attrs?: Record<string, null | readonly string[]>;
|
||||
/**
|
||||
When set to false, don't complete global attributes on this tag.
|
||||
*/
|
||||
globalAttrs?: boolean;
|
||||
/**
|
||||
Can be used to specify a list of child tags that are valid
|
||||
inside this tag. The default is to allow any tag.
|
||||
*/
|
||||
children?: readonly string[];
|
||||
}
|
||||
/**
|
||||
HTML tag completion. Opens and closes tags and attributes in a
|
||||
context-aware way.
|
||||
*/
|
||||
declare function htmlCompletionSource(context: CompletionContext): CompletionResult | null;
|
||||
/**
|
||||
Create a completion source for HTML extended with additional tags
|
||||
or attributes.
|
||||
*/
|
||||
declare function htmlCompletionSourceWith(config: {
|
||||
/**
|
||||
Define extra tag names to complete.
|
||||
*/
|
||||
extraTags?: Record<string, TagSpec>;
|
||||
/**
|
||||
Add global attributes that are available on all tags.
|
||||
*/
|
||||
extraGlobalAttributes?: Record<string, null | readonly string[]>;
|
||||
}): (context: CompletionContext) => CompletionResult | null;
|
||||
|
||||
type NestedLang = {
|
||||
tag: string;
|
||||
attrs?: (attrs: {
|
||||
[attr: string]: string;
|
||||
}) => boolean;
|
||||
parser: Parser;
|
||||
};
|
||||
type NestedAttr = {
|
||||
name: string;
|
||||
tagName?: string;
|
||||
parser: Parser;
|
||||
};
|
||||
/**
|
||||
A language provider based on the [Lezer HTML
|
||||
parser](https://github.com/lezer-parser/html), extended with the
|
||||
JavaScript and CSS parsers to parse the content of `<script>` and
|
||||
`<style>` tags.
|
||||
*/
|
||||
declare const htmlLanguage: LRLanguage;
|
||||
/**
|
||||
Language support for HTML, including
|
||||
[`htmlCompletion`](https://codemirror.net/6/docs/ref/#lang-html.htmlCompletion) and JavaScript and
|
||||
CSS support extensions.
|
||||
*/
|
||||
declare function html(config?: {
|
||||
/**
|
||||
By default, the syntax tree will highlight mismatched closing
|
||||
tags. Set this to `false` to turn that off (for example when you
|
||||
expect to only be parsing a fragment of HTML text, not a full
|
||||
document).
|
||||
*/
|
||||
matchClosingTags?: boolean;
|
||||
/**
|
||||
By default, the parser does not allow arbitrary self-closing tags.
|
||||
Set this to `true` to turn on support for `/>` self-closing tag
|
||||
syntax.
|
||||
*/
|
||||
selfClosingTags?: boolean;
|
||||
/**
|
||||
Determines whether [`autoCloseTags`](https://codemirror.net/6/docs/ref/#lang-html.autoCloseTags)
|
||||
is included in the support extensions. Defaults to true.
|
||||
*/
|
||||
autoCloseTags?: boolean;
|
||||
/**
|
||||
Add additional tags that can be completed.
|
||||
*/
|
||||
extraTags?: Record<string, TagSpec>;
|
||||
/**
|
||||
Add additional completable attributes to all tags.
|
||||
*/
|
||||
extraGlobalAttributes?: Record<string, null | readonly string[]>;
|
||||
/**
|
||||
Register additional languages to parse the content of specific
|
||||
tags. If given, `attrs` should be a function that, given an
|
||||
object representing the tag's attributes, returns `true` if this
|
||||
language applies.
|
||||
*/
|
||||
nestedLanguages?: NestedLang[];
|
||||
/**
|
||||
Register additional languages to parse attribute values with.
|
||||
*/
|
||||
nestedAttributes?: NestedAttr[];
|
||||
}): LanguageSupport;
|
||||
/**
|
||||
Extension that will automatically insert close tags when a `>` or
|
||||
`/` is typed.
|
||||
*/
|
||||
declare const autoCloseTags: _codemirror_state.Extension;
|
||||
|
||||
export { type TagSpec, autoCloseTags, html, htmlCompletionSource, htmlCompletionSourceWith, htmlLanguage };
|
||||
661
frontend/node_modules/@codemirror/lang-html/dist/index.js
generated
vendored
Normal file
661
frontend/node_modules/@codemirror/lang-html/dist/index.js
generated
vendored
Normal file
@ -0,0 +1,661 @@
|
||||
import { parser, configureNesting } from '@lezer/html';
|
||||
import { cssLanguage, css } from '@codemirror/lang-css';
|
||||
import { javascriptLanguage, typescriptLanguage, jsxLanguage, tsxLanguage, javascript } from '@codemirror/lang-javascript';
|
||||
import { EditorView } from '@codemirror/view';
|
||||
import { EditorSelection } from '@codemirror/state';
|
||||
import { syntaxTree, LRLanguage, indentNodeProp, foldNodeProp, bracketMatchingHandle, LanguageSupport } from '@codemirror/language';
|
||||
|
||||
const Targets = ["_blank", "_self", "_top", "_parent"];
|
||||
const Charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"];
|
||||
const Methods = ["get", "post", "put", "delete"];
|
||||
const Encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"];
|
||||
const Bool = ["true", "false"];
|
||||
const S = {}; // Empty tag spec
|
||||
const Tags = {
|
||||
a: {
|
||||
attrs: {
|
||||
href: null, ping: null, type: null,
|
||||
media: null,
|
||||
target: Targets,
|
||||
hreflang: null
|
||||
}
|
||||
},
|
||||
abbr: S,
|
||||
address: S,
|
||||
area: {
|
||||
attrs: {
|
||||
alt: null, coords: null, href: null, target: null, ping: null,
|
||||
media: null, hreflang: null, type: null,
|
||||
shape: ["default", "rect", "circle", "poly"]
|
||||
}
|
||||
},
|
||||
article: S,
|
||||
aside: S,
|
||||
audio: {
|
||||
attrs: {
|
||||
src: null, mediagroup: null,
|
||||
crossorigin: ["anonymous", "use-credentials"],
|
||||
preload: ["none", "metadata", "auto"],
|
||||
autoplay: ["autoplay"],
|
||||
loop: ["loop"],
|
||||
controls: ["controls"]
|
||||
}
|
||||
},
|
||||
b: S,
|
||||
base: { attrs: { href: null, target: Targets } },
|
||||
bdi: S,
|
||||
bdo: S,
|
||||
blockquote: { attrs: { cite: null } },
|
||||
body: S,
|
||||
br: S,
|
||||
button: {
|
||||
attrs: {
|
||||
form: null, formaction: null, name: null, value: null,
|
||||
autofocus: ["autofocus"],
|
||||
disabled: ["autofocus"],
|
||||
formenctype: Encs,
|
||||
formmethod: Methods,
|
||||
formnovalidate: ["novalidate"],
|
||||
formtarget: Targets,
|
||||
type: ["submit", "reset", "button"]
|
||||
}
|
||||
},
|
||||
canvas: { attrs: { width: null, height: null } },
|
||||
caption: S,
|
||||
center: S,
|
||||
cite: S,
|
||||
code: S,
|
||||
col: { attrs: { span: null } },
|
||||
colgroup: { attrs: { span: null } },
|
||||
command: {
|
||||
attrs: {
|
||||
type: ["command", "checkbox", "radio"],
|
||||
label: null, icon: null, radiogroup: null, command: null, title: null,
|
||||
disabled: ["disabled"],
|
||||
checked: ["checked"]
|
||||
}
|
||||
},
|
||||
data: { attrs: { value: null } },
|
||||
datagrid: { attrs: { disabled: ["disabled"], multiple: ["multiple"] } },
|
||||
datalist: { attrs: { data: null } },
|
||||
dd: S,
|
||||
del: { attrs: { cite: null, datetime: null } },
|
||||
details: { attrs: { open: ["open"] } },
|
||||
dfn: S,
|
||||
div: S,
|
||||
dl: S,
|
||||
dt: S,
|
||||
em: S,
|
||||
embed: { attrs: { src: null, type: null, width: null, height: null } },
|
||||
eventsource: { attrs: { src: null } },
|
||||
fieldset: { attrs: { disabled: ["disabled"], form: null, name: null } },
|
||||
figcaption: S,
|
||||
figure: S,
|
||||
footer: S,
|
||||
form: {
|
||||
attrs: {
|
||||
action: null, name: null,
|
||||
"accept-charset": Charsets,
|
||||
autocomplete: ["on", "off"],
|
||||
enctype: Encs,
|
||||
method: Methods,
|
||||
novalidate: ["novalidate"],
|
||||
target: Targets
|
||||
}
|
||||
},
|
||||
h1: S, h2: S, h3: S, h4: S, h5: S, h6: S,
|
||||
head: {
|
||||
children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
|
||||
},
|
||||
header: S,
|
||||
hgroup: S,
|
||||
hr: S,
|
||||
html: {
|
||||
attrs: { manifest: null }
|
||||
},
|
||||
i: S,
|
||||
iframe: {
|
||||
attrs: {
|
||||
src: null, srcdoc: null, name: null, width: null, height: null,
|
||||
sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"],
|
||||
seamless: ["seamless"]
|
||||
}
|
||||
},
|
||||
img: {
|
||||
attrs: {
|
||||
alt: null, src: null, ismap: null, usemap: null, width: null, height: null,
|
||||
crossorigin: ["anonymous", "use-credentials"]
|
||||
}
|
||||
},
|
||||
input: {
|
||||
attrs: {
|
||||
alt: null, dirname: null, form: null, formaction: null,
|
||||
height: null, list: null, max: null, maxlength: null, min: null,
|
||||
name: null, pattern: null, placeholder: null, size: null, src: null,
|
||||
step: null, value: null, width: null,
|
||||
accept: ["audio/*", "video/*", "image/*"],
|
||||
autocomplete: ["on", "off"],
|
||||
autofocus: ["autofocus"],
|
||||
checked: ["checked"],
|
||||
disabled: ["disabled"],
|
||||
formenctype: Encs,
|
||||
formmethod: Methods,
|
||||
formnovalidate: ["novalidate"],
|
||||
formtarget: Targets,
|
||||
multiple: ["multiple"],
|
||||
readonly: ["readonly"],
|
||||
required: ["required"],
|
||||
type: ["hidden", "text", "search", "tel", "url", "email", "password", "datetime", "date", "month",
|
||||
"week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio",
|
||||
"file", "submit", "image", "reset", "button"]
|
||||
}
|
||||
},
|
||||
ins: { attrs: { cite: null, datetime: null } },
|
||||
kbd: S,
|
||||
keygen: {
|
||||
attrs: {
|
||||
challenge: null, form: null, name: null,
|
||||
autofocus: ["autofocus"],
|
||||
disabled: ["disabled"],
|
||||
keytype: ["RSA"]
|
||||
}
|
||||
},
|
||||
label: { attrs: { for: null, form: null } },
|
||||
legend: S,
|
||||
li: { attrs: { value: null } },
|
||||
link: {
|
||||
attrs: {
|
||||
href: null, type: null,
|
||||
hreflang: null,
|
||||
media: null,
|
||||
sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
|
||||
}
|
||||
},
|
||||
map: { attrs: { name: null } },
|
||||
mark: S,
|
||||
menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } },
|
||||
meta: {
|
||||
attrs: {
|
||||
content: null,
|
||||
charset: Charsets,
|
||||
name: ["viewport", "application-name", "author", "description", "generator", "keywords"],
|
||||
"http-equiv": ["content-language", "content-type", "default-style", "refresh"]
|
||||
}
|
||||
},
|
||||
meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },
|
||||
nav: S,
|
||||
noscript: S,
|
||||
object: {
|
||||
attrs: {
|
||||
data: null, type: null, name: null, usemap: null, form: null, width: null, height: null,
|
||||
typemustmatch: ["typemustmatch"]
|
||||
}
|
||||
},
|
||||
ol: { attrs: { reversed: ["reversed"], start: null, type: ["1", "a", "A", "i", "I"] },
|
||||
children: ["li", "script", "template", "ul", "ol"] },
|
||||
optgroup: { attrs: { disabled: ["disabled"], label: null } },
|
||||
option: { attrs: { disabled: ["disabled"], label: null, selected: ["selected"], value: null } },
|
||||
output: { attrs: { for: null, form: null, name: null } },
|
||||
p: S,
|
||||
param: { attrs: { name: null, value: null } },
|
||||
pre: S,
|
||||
progress: { attrs: { value: null, max: null } },
|
||||
q: { attrs: { cite: null } },
|
||||
rp: S,
|
||||
rt: S,
|
||||
ruby: S,
|
||||
samp: S,
|
||||
script: {
|
||||
attrs: {
|
||||
type: ["text/javascript"],
|
||||
src: null,
|
||||
async: ["async"],
|
||||
defer: ["defer"],
|
||||
charset: Charsets
|
||||
}
|
||||
},
|
||||
section: S,
|
||||
select: {
|
||||
attrs: {
|
||||
form: null, name: null, size: null,
|
||||
autofocus: ["autofocus"],
|
||||
disabled: ["disabled"],
|
||||
multiple: ["multiple"]
|
||||
}
|
||||
},
|
||||
slot: { attrs: { name: null } },
|
||||
small: S,
|
||||
source: { attrs: { src: null, type: null, media: null } },
|
||||
span: S,
|
||||
strong: S,
|
||||
style: {
|
||||
attrs: {
|
||||
type: ["text/css"],
|
||||
media: null,
|
||||
scoped: null
|
||||
}
|
||||
},
|
||||
sub: S,
|
||||
summary: S,
|
||||
sup: S,
|
||||
table: S,
|
||||
tbody: S,
|
||||
td: { attrs: { colspan: null, rowspan: null, headers: null } },
|
||||
template: S,
|
||||
textarea: {
|
||||
attrs: {
|
||||
dirname: null, form: null, maxlength: null, name: null, placeholder: null,
|
||||
rows: null, cols: null,
|
||||
autofocus: ["autofocus"],
|
||||
disabled: ["disabled"],
|
||||
readonly: ["readonly"],
|
||||
required: ["required"],
|
||||
wrap: ["soft", "hard"]
|
||||
}
|
||||
},
|
||||
tfoot: S,
|
||||
th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } },
|
||||
thead: S,
|
||||
time: { attrs: { datetime: null } },
|
||||
title: S,
|
||||
tr: S,
|
||||
track: {
|
||||
attrs: {
|
||||
src: null, label: null, default: null,
|
||||
kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
|
||||
srclang: null
|
||||
}
|
||||
},
|
||||
ul: { children: ["li", "script", "template", "ul", "ol"] },
|
||||
var: S,
|
||||
video: {
|
||||
attrs: {
|
||||
src: null, poster: null, width: null, height: null,
|
||||
crossorigin: ["anonymous", "use-credentials"],
|
||||
preload: ["auto", "metadata", "none"],
|
||||
autoplay: ["autoplay"],
|
||||
mediagroup: ["movie"],
|
||||
muted: ["muted"],
|
||||
controls: ["controls"]
|
||||
}
|
||||
},
|
||||
wbr: S
|
||||
};
|
||||
const GlobalAttrs = {
|
||||
accesskey: null,
|
||||
class: null,
|
||||
contenteditable: Bool,
|
||||
contextmenu: null,
|
||||
dir: ["ltr", "rtl", "auto"],
|
||||
draggable: ["true", "false", "auto"],
|
||||
dropzone: ["copy", "move", "link", "string:", "file:"],
|
||||
hidden: ["hidden"],
|
||||
id: null,
|
||||
inert: ["inert"],
|
||||
itemid: null,
|
||||
itemprop: null,
|
||||
itemref: null,
|
||||
itemscope: ["itemscope"],
|
||||
itemtype: null,
|
||||
lang: ["ar", "bn", "de", "en-GB", "en-US", "es", "fr", "hi", "id", "ja", "pa", "pt", "ru", "tr", "zh"],
|
||||
spellcheck: Bool,
|
||||
autocorrect: Bool,
|
||||
autocapitalize: Bool,
|
||||
style: null,
|
||||
tabindex: null,
|
||||
title: null,
|
||||
translate: ["yes", "no"],
|
||||
rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"],
|
||||
role: /*@__PURE__*/"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),
|
||||
"aria-activedescendant": null,
|
||||
"aria-atomic": Bool,
|
||||
"aria-autocomplete": ["inline", "list", "both", "none"],
|
||||
"aria-busy": Bool,
|
||||
"aria-checked": ["true", "false", "mixed", "undefined"],
|
||||
"aria-controls": null,
|
||||
"aria-describedby": null,
|
||||
"aria-disabled": Bool,
|
||||
"aria-dropeffect": null,
|
||||
"aria-expanded": ["true", "false", "undefined"],
|
||||
"aria-flowto": null,
|
||||
"aria-grabbed": ["true", "false", "undefined"],
|
||||
"aria-haspopup": Bool,
|
||||
"aria-hidden": Bool,
|
||||
"aria-invalid": ["true", "false", "grammar", "spelling"],
|
||||
"aria-label": null,
|
||||
"aria-labelledby": null,
|
||||
"aria-level": null,
|
||||
"aria-live": ["off", "polite", "assertive"],
|
||||
"aria-multiline": Bool,
|
||||
"aria-multiselectable": Bool,
|
||||
"aria-owns": null,
|
||||
"aria-posinset": null,
|
||||
"aria-pressed": ["true", "false", "mixed", "undefined"],
|
||||
"aria-readonly": Bool,
|
||||
"aria-relevant": null,
|
||||
"aria-required": Bool,
|
||||
"aria-selected": ["true", "false", "undefined"],
|
||||
"aria-setsize": null,
|
||||
"aria-sort": ["ascending", "descending", "none", "other"],
|
||||
"aria-valuemax": null,
|
||||
"aria-valuemin": null,
|
||||
"aria-valuenow": null,
|
||||
"aria-valuetext": null
|
||||
};
|
||||
const eventAttributes = /*@__PURE__*/("beforeunload copy cut dragstart dragover dragleave dragenter dragend " +
|
||||
"drag paste focus blur change click load mousedown mouseenter mouseleave " +
|
||||
"mouseup keydown keyup resize scroll unload").split(" ").map(n => "on" + n);
|
||||
for (let a of eventAttributes)
|
||||
GlobalAttrs[a] = null;
|
||||
class Schema {
|
||||
constructor(extraTags, extraAttrs) {
|
||||
this.tags = { ...Tags, ...extraTags };
|
||||
this.globalAttrs = { ...GlobalAttrs, ...extraAttrs };
|
||||
this.allTags = Object.keys(this.tags);
|
||||
this.globalAttrNames = Object.keys(this.globalAttrs);
|
||||
}
|
||||
}
|
||||
Schema.default = /*@__PURE__*/new Schema;
|
||||
function elementName(doc, tree, max = doc.length) {
|
||||
if (!tree)
|
||||
return "";
|
||||
let tag = tree.firstChild;
|
||||
let name = tag && tag.getChild("TagName");
|
||||
return name ? doc.sliceString(name.from, Math.min(name.to, max)) : "";
|
||||
}
|
||||
function findParentElement(tree, skip = false) {
|
||||
for (; tree; tree = tree.parent)
|
||||
if (tree.name == "Element") {
|
||||
if (skip)
|
||||
skip = false;
|
||||
else
|
||||
return tree;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function allowedChildren(doc, tree, schema) {
|
||||
let parentInfo = schema.tags[elementName(doc, findParentElement(tree))];
|
||||
return (parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.children) || schema.allTags;
|
||||
}
|
||||
function openTags(doc, tree) {
|
||||
let open = [];
|
||||
for (let parent = findParentElement(tree); parent && !parent.type.isTop; parent = findParentElement(parent.parent)) {
|
||||
let tagName = elementName(doc, parent);
|
||||
if (tagName && parent.lastChild.name == "CloseTag")
|
||||
break;
|
||||
if (tagName && open.indexOf(tagName) < 0 && (tree.name == "EndTag" || tree.from >= parent.firstChild.to))
|
||||
open.push(tagName);
|
||||
}
|
||||
return open;
|
||||
}
|
||||
const identifier = /^[:\-\.\w\u00b7-\uffff]*$/;
|
||||
function completeTag(state, schema, tree, from, to) {
|
||||
let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">";
|
||||
let parent = findParentElement(tree, tree.name == "StartTag" || tree.name == "TagName");
|
||||
return { from, to,
|
||||
options: allowedChildren(state.doc, parent, schema).map(tagName => ({ label: tagName, type: "type" })).concat(openTags(state.doc, tree).map((tag, i) => ({ label: "/" + tag, apply: "/" + tag + end,
|
||||
type: "type", boost: 99 - i }))),
|
||||
validFor: /^\/?[:\-\.\w\u00b7-\uffff]*$/ };
|
||||
}
|
||||
function completeCloseTag(state, tree, from, to) {
|
||||
let end = /\s*>/.test(state.sliceDoc(to, to + 5)) ? "" : ">";
|
||||
return { from, to,
|
||||
options: openTags(state.doc, tree).map((tag, i) => ({ label: tag, apply: tag + end, type: "type", boost: 99 - i })),
|
||||
validFor: identifier };
|
||||
}
|
||||
function completeStartTag(state, schema, tree, pos) {
|
||||
let options = [], level = 0;
|
||||
for (let tagName of allowedChildren(state.doc, tree, schema))
|
||||
options.push({ label: "<" + tagName, type: "type" });
|
||||
for (let open of openTags(state.doc, tree))
|
||||
options.push({ label: "</" + open + ">", type: "type", boost: 99 - level++ });
|
||||
return { from: pos, to: pos, options, validFor: /^<\/?[:\-\.\w\u00b7-\uffff]*$/ };
|
||||
}
|
||||
function completeAttrName(state, schema, tree, from, to) {
|
||||
let elt = findParentElement(tree), info = elt ? schema.tags[elementName(state.doc, elt)] : null;
|
||||
let localAttrs = info && info.attrs ? Object.keys(info.attrs) : [];
|
||||
let names = info && info.globalAttrs === false ? localAttrs
|
||||
: localAttrs.length ? localAttrs.concat(schema.globalAttrNames) : schema.globalAttrNames;
|
||||
return { from, to,
|
||||
options: names.map(attrName => ({ label: attrName, type: "property" })),
|
||||
validFor: identifier };
|
||||
}
|
||||
function completeAttrValue(state, schema, tree, from, to) {
|
||||
var _a;
|
||||
let nameNode = (_a = tree.parent) === null || _a === void 0 ? void 0 : _a.getChild("AttributeName");
|
||||
let options = [], token = undefined;
|
||||
if (nameNode) {
|
||||
let attrName = state.sliceDoc(nameNode.from, nameNode.to);
|
||||
let attrs = schema.globalAttrs[attrName];
|
||||
if (!attrs) {
|
||||
let elt = findParentElement(tree), info = elt ? schema.tags[elementName(state.doc, elt)] : null;
|
||||
attrs = (info === null || info === void 0 ? void 0 : info.attrs) && info.attrs[attrName];
|
||||
}
|
||||
if (attrs) {
|
||||
let base = state.sliceDoc(from, to).toLowerCase(), quoteStart = '"', quoteEnd = '"';
|
||||
if (/^['"]/.test(base)) {
|
||||
token = base[0] == '"' ? /^[^"]*$/ : /^[^']*$/;
|
||||
quoteStart = "";
|
||||
quoteEnd = state.sliceDoc(to, to + 1) == base[0] ? "" : base[0];
|
||||
base = base.slice(1);
|
||||
from++;
|
||||
}
|
||||
else {
|
||||
token = /^[^\s<>='"]*$/;
|
||||
}
|
||||
for (let value of attrs)
|
||||
options.push({ label: value, apply: quoteStart + value + quoteEnd, type: "constant" });
|
||||
}
|
||||
}
|
||||
return { from, to, options, validFor: token };
|
||||
}
|
||||
function htmlCompletionFor(schema, context) {
|
||||
let { state, pos } = context, tree = syntaxTree(state).resolveInner(pos, -1), around = tree.resolve(pos);
|
||||
for (let scan = pos, before; around == tree && (before = tree.childBefore(scan));) {
|
||||
let last = before.lastChild;
|
||||
if (!last || !last.type.isError || last.from < last.to)
|
||||
break;
|
||||
around = tree = before;
|
||||
scan = last.from;
|
||||
}
|
||||
if (tree.name == "TagName") {
|
||||
return tree.parent && /CloseTag$/.test(tree.parent.name) ? completeCloseTag(state, tree, tree.from, pos)
|
||||
: completeTag(state, schema, tree, tree.from, pos);
|
||||
}
|
||||
else if (tree.name == "StartTag" || tree.name == "IncompleteTag") {
|
||||
return completeTag(state, schema, tree, pos, pos);
|
||||
}
|
||||
else if (tree.name == "StartCloseTag" || tree.name == "IncompleteCloseTag") {
|
||||
return completeCloseTag(state, tree, pos, pos);
|
||||
}
|
||||
else if (tree.name == "OpenTag" || tree.name == "SelfClosingTag" || tree.name == "AttributeName") {
|
||||
return completeAttrName(state, schema, tree, tree.name == "AttributeName" ? tree.from : pos, pos);
|
||||
}
|
||||
else if (tree.name == "Is" || tree.name == "AttributeValue" || tree.name == "UnquotedAttributeValue") {
|
||||
return completeAttrValue(state, schema, tree, tree.name == "Is" ? pos : tree.from, pos);
|
||||
}
|
||||
else if (context.explicit && (around.name == "Element" || around.name == "Text" || around.name == "Document")) {
|
||||
return completeStartTag(state, schema, tree, pos);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
HTML tag completion. Opens and closes tags and attributes in a
|
||||
context-aware way.
|
||||
*/
|
||||
function htmlCompletionSource(context) {
|
||||
return htmlCompletionFor(Schema.default, context);
|
||||
}
|
||||
/**
|
||||
Create a completion source for HTML extended with additional tags
|
||||
or attributes.
|
||||
*/
|
||||
function htmlCompletionSourceWith(config) {
|
||||
let { extraTags, extraGlobalAttributes: extraAttrs } = config;
|
||||
let schema = extraAttrs || extraTags ? new Schema(extraTags, extraAttrs) : Schema.default;
|
||||
return (context) => htmlCompletionFor(schema, context);
|
||||
}
|
||||
|
||||
const jsonParser = /*@__PURE__*/javascriptLanguage.parser.configure({ top: "SingleExpression" });
|
||||
const defaultNesting = [
|
||||
{ tag: "script",
|
||||
attrs: attrs => attrs.type == "text/typescript" || attrs.lang == "ts",
|
||||
parser: typescriptLanguage.parser },
|
||||
{ tag: "script",
|
||||
attrs: attrs => attrs.type == "text/babel" || attrs.type == "text/jsx",
|
||||
parser: jsxLanguage.parser },
|
||||
{ tag: "script",
|
||||
attrs: attrs => attrs.type == "text/typescript-jsx",
|
||||
parser: tsxLanguage.parser },
|
||||
{ tag: "script",
|
||||
attrs(attrs) {
|
||||
return /^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(attrs.type);
|
||||
},
|
||||
parser: jsonParser },
|
||||
{ tag: "script",
|
||||
attrs(attrs) {
|
||||
return !attrs.type || /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(attrs.type);
|
||||
},
|
||||
parser: javascriptLanguage.parser },
|
||||
{ tag: "style",
|
||||
attrs(attrs) {
|
||||
return (!attrs.lang || attrs.lang == "css") && (!attrs.type || /^(text\/)?(x-)?(stylesheet|css)$/i.test(attrs.type));
|
||||
},
|
||||
parser: cssLanguage.parser }
|
||||
];
|
||||
const defaultAttrs = /*@__PURE__*/[
|
||||
{ name: "style",
|
||||
parser: /*@__PURE__*/cssLanguage.parser.configure({ top: "Styles" }) }
|
||||
].concat(/*@__PURE__*/eventAttributes.map(name => ({ name, parser: javascriptLanguage.parser })));
|
||||
const htmlPlain = /*@__PURE__*/LRLanguage.define({
|
||||
name: "html",
|
||||
parser: /*@__PURE__*/parser.configure({
|
||||
props: [
|
||||
/*@__PURE__*/indentNodeProp.add({
|
||||
Element(context) {
|
||||
let after = /^(\s*)(<\/)?/.exec(context.textAfter);
|
||||
if (context.node.to <= context.pos + after[0].length)
|
||||
return context.continue();
|
||||
return context.lineIndent(context.node.from) + (after[2] ? 0 : context.unit);
|
||||
},
|
||||
"OpenTag CloseTag SelfClosingTag"(context) {
|
||||
return context.column(context.node.from) + context.unit;
|
||||
},
|
||||
Document(context) {
|
||||
if (context.pos + /\s*/.exec(context.textAfter)[0].length < context.node.to)
|
||||
return context.continue();
|
||||
let endElt = null, close;
|
||||
for (let cur = context.node;;) {
|
||||
let last = cur.lastChild;
|
||||
if (!last || last.name != "Element" || last.to != cur.to)
|
||||
break;
|
||||
endElt = cur = last;
|
||||
}
|
||||
if (endElt && !((close = endElt.lastChild) && (close.name == "CloseTag" || close.name == "SelfClosingTag")))
|
||||
return context.lineIndent(endElt.from) + context.unit;
|
||||
return null;
|
||||
}
|
||||
}),
|
||||
/*@__PURE__*/foldNodeProp.add({
|
||||
Element(node) {
|
||||
let first = node.firstChild, last = node.lastChild;
|
||||
if (!first || first.name != "OpenTag")
|
||||
return null;
|
||||
return { from: first.to, to: last.name == "CloseTag" ? last.from : node.to };
|
||||
}
|
||||
}),
|
||||
/*@__PURE__*/bracketMatchingHandle.add({
|
||||
"OpenTag CloseTag": node => node.getChild("TagName")
|
||||
})
|
||||
]
|
||||
}),
|
||||
languageData: {
|
||||
commentTokens: { block: { open: "<!--", close: "-->" } },
|
||||
indentOnInput: /^\s*<\/\w+\W$/,
|
||||
wordChars: "-_"
|
||||
}
|
||||
});
|
||||
/**
|
||||
A language provider based on the [Lezer HTML
|
||||
parser](https://github.com/lezer-parser/html), extended with the
|
||||
JavaScript and CSS parsers to parse the content of `<script>` and
|
||||
`<style>` tags.
|
||||
*/
|
||||
const htmlLanguage = /*@__PURE__*/htmlPlain.configure({
|
||||
wrap: /*@__PURE__*/configureNesting(defaultNesting, defaultAttrs)
|
||||
});
|
||||
/**
|
||||
Language support for HTML, including
|
||||
[`htmlCompletion`](https://codemirror.net/6/docs/ref/#lang-html.htmlCompletion) and JavaScript and
|
||||
CSS support extensions.
|
||||
*/
|
||||
function html(config = {}) {
|
||||
let dialect = "", wrap;
|
||||
if (config.matchClosingTags === false)
|
||||
dialect = "noMatch";
|
||||
if (config.selfClosingTags === true)
|
||||
dialect = (dialect ? dialect + " " : "") + "selfClosing";
|
||||
if (config.nestedLanguages && config.nestedLanguages.length ||
|
||||
config.nestedAttributes && config.nestedAttributes.length)
|
||||
wrap = configureNesting((config.nestedLanguages || []).concat(defaultNesting), (config.nestedAttributes || []).concat(defaultAttrs));
|
||||
let lang = wrap ? htmlPlain.configure({ wrap, dialect }) : dialect ? htmlLanguage.configure({ dialect }) : htmlLanguage;
|
||||
return new LanguageSupport(lang, [
|
||||
htmlLanguage.data.of({ autocomplete: htmlCompletionSourceWith(config) }),
|
||||
config.autoCloseTags !== false ? autoCloseTags : [],
|
||||
javascript().support,
|
||||
css().support
|
||||
]);
|
||||
}
|
||||
const selfClosers = /*@__PURE__*/new Set(/*@__PURE__*/"area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" "));
|
||||
/**
|
||||
Extension that will automatically insert close tags when a `>` or
|
||||
`/` is typed.
|
||||
*/
|
||||
const autoCloseTags = /*@__PURE__*/EditorView.inputHandler.of((view, from, to, text, insertTransaction) => {
|
||||
if (view.composing || view.state.readOnly || from != to || (text != ">" && text != "/") ||
|
||||
!htmlLanguage.isActiveAt(view.state, from, -1))
|
||||
return false;
|
||||
let base = insertTransaction(), { state } = base;
|
||||
let closeTags = state.changeByRange(range => {
|
||||
var _a, _b, _c;
|
||||
let didType = state.doc.sliceString(range.from - 1, range.to) == text;
|
||||
let { head } = range, after = syntaxTree(state).resolveInner(head, -1), name;
|
||||
if (didType && text == ">" && after.name == "EndTag") {
|
||||
let tag = after.parent;
|
||||
if (((_b = (_a = tag.parent) === null || _a === void 0 ? void 0 : _a.lastChild) === null || _b === void 0 ? void 0 : _b.name) != "CloseTag" &&
|
||||
(name = elementName(state.doc, tag.parent, head)) &&
|
||||
!selfClosers.has(name)) {
|
||||
let to = head + (state.doc.sliceString(head, head + 1) === ">" ? 1 : 0);
|
||||
let insert = `</${name}>`;
|
||||
return { range, changes: { from: head, to, insert } };
|
||||
}
|
||||
}
|
||||
else if (didType && text == "/" && after.name == "IncompleteCloseTag") {
|
||||
let tag = after.parent;
|
||||
if (after.from == head - 2 && ((_c = tag.lastChild) === null || _c === void 0 ? void 0 : _c.name) != "CloseTag" &&
|
||||
(name = elementName(state.doc, tag, head)) && !selfClosers.has(name)) {
|
||||
let to = head + (state.doc.sliceString(head, head + 1) === ">" ? 1 : 0);
|
||||
let insert = `${name}>`;
|
||||
return {
|
||||
range: EditorSelection.cursor(head + insert.length, -1),
|
||||
changes: { from: head, to, insert }
|
||||
};
|
||||
}
|
||||
}
|
||||
return { range };
|
||||
});
|
||||
if (closeTags.changes.empty)
|
||||
return false;
|
||||
view.dispatch([
|
||||
base,
|
||||
state.update(closeTags, {
|
||||
userEvent: "input.complete",
|
||||
scrollIntoView: true
|
||||
})
|
||||
]);
|
||||
return true;
|
||||
});
|
||||
|
||||
export { autoCloseTags, html, htmlCompletionSource, htmlCompletionSourceWith, htmlLanguage };
|
||||
46
frontend/node_modules/@codemirror/lang-html/package.json
generated
vendored
Normal file
46
frontend/node_modules/@codemirror/lang-html/package.json
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "@codemirror/lang-html",
|
||||
"version": "6.4.11",
|
||||
"description": "HTML language support for the CodeMirror code editor",
|
||||
"scripts": {
|
||||
"test": "cm-runtests",
|
||||
"prepare": "cm-buildhelper src/html.ts"
|
||||
},
|
||||
"keywords": [
|
||||
"editor",
|
||||
"code"
|
||||
],
|
||||
"author": {
|
||||
"name": "Marijn Haverbeke",
|
||||
"email": "marijn@haverbeke.berlin",
|
||||
"url": "http://marijnhaverbeke.nl"
|
||||
},
|
||||
"type": "module",
|
||||
"main": "dist/index.cjs",
|
||||
"exports": {
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs"
|
||||
},
|
||||
"types": "dist/index.d.ts",
|
||||
"module": "dist/index.js",
|
||||
"sideEffects": false,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@codemirror/autocomplete": "^6.0.0",
|
||||
"@codemirror/lang-css": "^6.0.0",
|
||||
"@codemirror/lang-javascript": "^6.0.0",
|
||||
"@codemirror/language": "^6.4.0",
|
||||
"@codemirror/state": "^6.0.0",
|
||||
"@codemirror/view": "^6.17.0",
|
||||
"@lezer/html": "^1.3.12",
|
||||
"@lezer/common": "^1.0.0",
|
||||
"@lezer/css": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@codemirror/buildhelper": "^1.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/codemirror/lang-html.git"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user