symfony-expression-editor 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +66 -5
- package/dist/index.cjs +65 -1758
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +65 -1758
- package/example.html +32 -9
- package/package.json +4 -2
package/example.html
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"imports": {
|
|
16
16
|
"codemirror": "https://esm.sh/*codemirror@6.0.1",
|
|
17
17
|
"@codemirror/state": "https://esm.sh/*@codemirror/state@6.5.2",
|
|
18
|
-
"@codemirror/search": "https://esm.sh/*@codemirror/search@6.5.
|
|
18
|
+
"@codemirror/search": "https://esm.sh/*@codemirror/search@6.5.11",
|
|
19
19
|
"@codemirror/autocomplete": "https://esm.sh/*@codemirror/autocomplete@6.18.6",
|
|
20
20
|
"@codemirror/view": "https://esm.sh/*@codemirror/view@6.36.3",
|
|
21
21
|
"@codemirror/commands": "https://esm.sh/*@codemirror/commands@6.8.0",
|
|
22
22
|
"@codemirror/language": "https://esm.sh/*@codemirror/language@6.10.8",
|
|
23
|
-
"@codemirror/lint": "https://esm.sh/*@codemirror/lint@6.
|
|
23
|
+
"@codemirror/lint": "https://esm.sh/*@codemirror/lint@6.9.2",
|
|
24
24
|
"@lezer/lr": "https://esm.sh/*@lezer/lr@1.4.2",
|
|
25
25
|
"@lezer/highlight": "https://esm.sh/*@lezer/highlight@1.2.1",
|
|
26
26
|
"@lezer/common": "https://esm.sh/*@lezer/common@1.2.3",
|
|
@@ -34,25 +34,48 @@
|
|
|
34
34
|
</script>
|
|
35
35
|
<script type="module" src="dist/index.mjs"></script>
|
|
36
36
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
|
37
|
-
<div class="p-5 gap-1
|
|
37
|
+
<div class="p-5 gap-1 vstack bg-body-secondary">
|
|
38
|
+
<div class="flex-grow-1 small" style="user-select: none; cursor: pointer !important;">
|
|
39
|
+
<label class="form-check-inline form-switch"><input type="checkbox" role="switch" class="form-check-input"> disabled</label>
|
|
40
|
+
<label class="form-check-inline form-switch"><input type="checkbox" role="switch" class="form-check-input"> readonly</label>
|
|
41
|
+
</div>
|
|
38
42
|
<div class="flex-grow-1">
|
|
39
43
|
<textarea rows="1" class="form-control" is="expression-editor">'foobar' starts with 'foo' /* it's true */</textarea>
|
|
40
44
|
</div>
|
|
41
45
|
</div>
|
|
42
|
-
<div class="p-5 gap-1 vstack
|
|
46
|
+
<div class="p-5 gap-1 vstack bg-body-secondary">
|
|
47
|
+
<div class="flex-grow-1 small" style="user-select: none; cursor: pointer !important;">
|
|
48
|
+
<label class="form-check-inline form-switch"><input type="checkbox" role="switch" class="form-check-input"> disabled</label>
|
|
49
|
+
<label class="form-check-inline form-switch"><input type="checkbox" role="switch" class="form-check-input" checked> readonly</label>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="flex-grow-1">
|
|
52
|
+
<textarea rows="1" class="form-control form-control-plaintext" is="expression-editor" readonly>'foobar' starts with 'foo' /* it's true */</textarea>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="p-5 gap-1 vstack bg-body-secondary">
|
|
56
|
+
<div class="flex-grow-1 small" style="user-select: none; cursor: pointer !important;">
|
|
57
|
+
<label class="form-check-inline form-switch"><input type="checkbox" role="switch" class="form-check-input" checked> disabled</label>
|
|
58
|
+
<label class="form-check-inline form-switch"><input type="checkbox" role="switch" class="form-check-input"> readonly</label>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="flex-grow-1">
|
|
61
|
+
<textarea rows="1" class="form-control" is="expression-editor" disabled>'foobar' starts with 'foo' /* it's true */</textarea>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
<form action="/foobar" class="p-5 gap-1 vstack flex-wrap bg-body-secondary section" data-bs-theme="dark">
|
|
43
65
|
<div class="form-check form-switch text-body py-">
|
|
44
66
|
<input class="form-check-input" type="checkbox" role="switch" id="light-switch" onchange="this.closest('.section').dataset.bsTheme=this.checked ? 'light' : 'dark'">
|
|
45
67
|
<label class="form-check-label" for="light-switch">Lights</label>
|
|
46
68
|
</div>
|
|
47
69
|
<div id="template">
|
|
48
|
-
<textarea rows="3" class="form-control" is="expression-editor" data-line-numbers="true" data-config="{"identifiers":[{"name":"x"}]}">x == x + 1
|
|
49
|
-
&& 'foobar' starts with 'foo'
|
|
70
|
+
<textarea name="multiline" maxlength="2" rows="3" class="form-control" is="expression-editor" data-line-numbers="true" data-config="{"identifiers":[{"name":"x"}]}">x == x + 1
|
|
71
|
+
&& 'foobar' starts with 'foo' s
|
|
50
72
|
&& x == x + 1</textarea>
|
|
51
73
|
</div>
|
|
52
|
-
<div>
|
|
53
|
-
<button type="button" class="btn btn-sm btn-secondary
|
|
74
|
+
<div class="mt-3">
|
|
75
|
+
<button type="button" class="btn btn-sm btn-secondary" id="clone">Clone</button>
|
|
76
|
+
<button class="btn btn-sm btn-primary">Submit</button>
|
|
54
77
|
</div>
|
|
55
|
-
</
|
|
78
|
+
</form>
|
|
56
79
|
<script type="module">
|
|
57
80
|
document.getElementById('clone').addEventListener('click', function () {
|
|
58
81
|
const template = document.getElementById('template');
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "pkgroll",
|
|
18
|
-
"dev": "pkgroll --watch",
|
|
18
|
+
"dev": "pkgroll --watch --sourcemap",
|
|
19
19
|
"pretest": "npm run-script build",
|
|
20
20
|
"test": "playwright test",
|
|
21
21
|
"test:e2e": "playwright test"
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
"@codemirror/language": "^6.10.8",
|
|
28
28
|
"@codemirror/state": "^6.5.2",
|
|
29
29
|
"@codemirror/view": "^6.36.3",
|
|
30
|
+
"@codemirror/lint": "^6.9.2",
|
|
31
|
+
"@codemirror/search": "^6.5.11",
|
|
30
32
|
"@lezer/highlight": "^1.2.1",
|
|
31
33
|
"@valtzu/codemirror-lang-el": "^1.0.0",
|
|
32
34
|
"codemirror": "^6.0.1"
|
|
@@ -47,5 +49,5 @@
|
|
|
47
49
|
"access": "public",
|
|
48
50
|
"registry": "https://registry.npmjs.org/"
|
|
49
51
|
},
|
|
50
|
-
"version": "1.
|
|
52
|
+
"version": "1.1.0"
|
|
51
53
|
}
|