algraf-editor 0.67.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/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # algraf-editor
2
+
3
+ Reusable Monaco and React editor integration for Algraf `0.67.x` browser hosts.
4
+
5
+ The package owns editor wiring only: language registration, TextMate grammar
6
+ setup, the default light theme, marker conversion, Monaco providers, structural
7
+ editor-service runtime types, and a thin `<AlgrafEditor />` component. Hosts
8
+ keep runtime loading, render buttons, preview panels, routing, and application
9
+ state.
10
+
11
+ Published packages expose `dist/index.mjs`, `dist/index.cjs`, and
12
+ `dist/index.d.ts`, while static TextMate and language-configuration assets stay
13
+ available through package subpath exports. Use source mode during local
14
+ cross-repo development:
15
+
16
+ ```ts
17
+ import { AlgrafEditor } from "algraf-editor";
18
+ import { loadAlgrafRuntime } from "algraf-wasm";
19
+
20
+ const runtime = await loadAlgrafRuntime({ wasmUrl: "/wasm/algraf.wasm" });
21
+ ```
22
+
23
+ Use packed mode before publishing by running `npm pack --dry-run` in
24
+ `packages/wasm` and `editors/monaco`, then inspecting the file lists for
25
+ `dist/`, declarations, README, package metadata, and editor assets.
@@ -0,0 +1,239 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3
+ "name": "Algraf",
4
+ "scopeName": "source.algraf",
5
+ "patterns": [
6
+ {
7
+ "include": "#comments"
8
+ },
9
+ {
10
+ "include": "#strings"
11
+ },
12
+ {
13
+ "include": "#quoted-identifiers"
14
+ },
15
+ {
16
+ "include": "#numbers"
17
+ },
18
+ {
19
+ "include": "#let-bindings"
20
+ },
21
+ {
22
+ "include": "#declarations"
23
+ },
24
+ {
25
+ "include": "#interactions"
26
+ },
27
+ {
28
+ "include": "#geometries"
29
+ },
30
+ {
31
+ "include": "#stats"
32
+ },
33
+ {
34
+ "include": "#sources"
35
+ },
36
+ {
37
+ "include": "#constants"
38
+ },
39
+ {
40
+ "include": "#properties"
41
+ },
42
+ {
43
+ "include": "#columns"
44
+ },
45
+ {
46
+ "include": "#operators"
47
+ },
48
+ {
49
+ "include": "#functions"
50
+ }
51
+ ],
52
+ "repository": {
53
+ "comments": {
54
+ "patterns": [
55
+ {
56
+ "name": "comment.line.double-slash.algraf",
57
+ "match": "//.*$"
58
+ }
59
+ ]
60
+ },
61
+ "strings": {
62
+ "patterns": [
63
+ {
64
+ "name": "string.quoted.double.algraf",
65
+ "begin": "\"",
66
+ "end": "\"",
67
+ "patterns": [
68
+ {
69
+ "name": "constant.character.escape.algraf",
70
+ "match": "\\\\[nrt\"\\\\]"
71
+ },
72
+ {
73
+ "name": "invalid.illegal.escape.algraf",
74
+ "match": "\\\\."
75
+ }
76
+ ]
77
+ }
78
+ ]
79
+ },
80
+ "quoted-identifiers": {
81
+ "patterns": [
82
+ {
83
+ "name": "variable.other.quoted.algraf",
84
+ "begin": "`",
85
+ "end": "`",
86
+ "patterns": [
87
+ {
88
+ "name": "constant.character.escape.algraf",
89
+ "match": "\\\\[`\\\\]"
90
+ }
91
+ ]
92
+ }
93
+ ]
94
+ },
95
+ "numbers": {
96
+ "patterns": [
97
+ {
98
+ "name": "constant.numeric.algraf",
99
+ "match": "\\b-?[0-9]+(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b"
100
+ }
101
+ ]
102
+ },
103
+ "let-bindings": {
104
+ "patterns": [
105
+ {
106
+ "match": "\\b(let)\\s+([A-Za-z_][A-Za-z0-9_]*)",
107
+ "captures": {
108
+ "1": {
109
+ "name": "keyword.declaration.let.algraf"
110
+ },
111
+ "2": {
112
+ "name": "variable.other.declaration.algraf"
113
+ }
114
+ }
115
+ }
116
+ ]
117
+ },
118
+ "declarations": {
119
+ "patterns": [
120
+ {
121
+ "name": "keyword.declaration.algraf",
122
+ "match": "\\b(?:Algraf|Chart|Space|Inset|Derive|from|Table|Parse|Scale|Guide|Theme|Layout)\\b"
123
+ },
124
+ {
125
+ "name": "keyword.declaration.let.algraf",
126
+ "match": "\\blet\\b"
127
+ }
128
+ ]
129
+ },
130
+ "geometries": {
131
+ "patterns": [
132
+ {
133
+ "name": "entity.name.function.geometry.algraf",
134
+ "match": "\\b(?:Point|Line|Path|Bar|Rect|Histogram|FreqPoly|Bin2D|HexBin|Smooth|Boxplot|Violin|Density|ErrorBar|LineRange|PointRange|CrossBar|Ribbon|Tile|HLine|VLine|Rug|Area|Text|Label|Image|Segment|Geo|Graticule)\\b(?=\\s*\\()"
135
+ }
136
+ ]
137
+ },
138
+ "interactions": {
139
+ "patterns": [
140
+ {
141
+ "name": "entity.name.function.interaction.algraf",
142
+ "match": "\\bOn\\b(?=\\s*\\()"
143
+ }
144
+ ]
145
+ },
146
+ "stats": {
147
+ "patterns": [
148
+ {
149
+ "name": "entity.name.function.stat.algraf",
150
+ "match": "\\b(?:Bin|Bin2D|HexBin|Summary2D|SummaryHex|ContourLines|ContourBands|Density2D|Density2DContours|Density2DBands|Distinct|Ecdf|Qq|Summary|SummaryBin|Cut|Count|Smooth|StepVertices|JitterPoints|VectorEndpoints|CurveSample|IntervalSegments|IntervalRects|IntervalMiddles|Boxplot|Density|Centroid|Simplify|SpatialJoin)\\b(?=\\s*\\()"
151
+ }
152
+ ]
153
+ },
154
+ "sources": {
155
+ "patterns": [
156
+ {
157
+ "name": "entity.name.function.source.algraf",
158
+ "match": "\\b(?:GeoJson|Shapefile|Sqlite|TopoJson|Style|Stop)\\b(?=\\s*\\()"
159
+ },
160
+ {
161
+ "name": "entity.name.function.literal.algraf",
162
+ "match": "\\b(?:datetime|date)\\b(?=\\s*\\()"
163
+ }
164
+ ]
165
+ },
166
+ "constants": {
167
+ "patterns": [
168
+ {
169
+ "name": "constant.language.algraf",
170
+ "match": "\\b(?:true|false|null|stdin)\\b"
171
+ }
172
+ ]
173
+ },
174
+ "properties": {
175
+ "patterns": [
176
+ {
177
+ "name": "variable.parameter.property.algraf",
178
+ "match": "\\b(?:version|features|data|match|width|height|minSize|maxSize|padding|placement|clip|title|subtitle|caption|alt|description|marginTop|marginRight|marginBottom|marginLeft|facetColumns|facetRows|facetCols|facetScales|facetLabel|facetLabels|panelSpacing|axis|legend|grid|timeFormat|tickLabelAngle|tickLabelRows|table|column|format|formats|unit|timezone|onError|coords|zoomX|zoomY|aspect|theta|innerRadius|startAngle|direction|radius|fill|stroke|strokeWidth|dash|alpha|size|shape|src|group|sort|layout|baseline|stat|xmin|xmax|ymin|ymax|bins|binWidth|boundary|closed|interval|bandwidth|n|quantiles|outliers|span|se|taper|curvature|points|lengthScale|type|mode|domain|breaks|expand|expansion|range|reverse|integer|palette|gradient|labels|reducer|by|distribution|reference|output|method|label|at|anchor|dx|dy|nudge|nudgeData|jitter|x|y|xend|yend|sides|tooltip|highlight|projection|name|plotTitle|plotSubtitle|plotCaption|axisTitle|axisText|stripText|legendTitle|legendText|panelBackground|gridMajor|gridMinor|legendPosition|legendSpacing|fontFamily|fontSize|titleSize|pointSize|lineWidth|background|plotBackground|axisColor|gridColor|textColor|axes|style|color|value)\\b(?=\\s*:)"
179
+ },
180
+ {
181
+ "name": "variable.parameter.property.unknown.algraf",
182
+ "match": "\\b[A-Za-z_][A-Za-z0-9_]*\\b(?=\\s*:)"
183
+ }
184
+ ]
185
+ },
186
+ "columns": {
187
+ "patterns": [
188
+ {
189
+ "name": "variable.other.column.algraf",
190
+ "match": "\\b[A-Za-z_][A-Za-z0-9_]*\\b(?!\\s*[:(])"
191
+ }
192
+ ]
193
+ },
194
+ "operators": {
195
+ "patterns": [
196
+ {
197
+ "name": "keyword.operator.algebra.algraf",
198
+ "match": "[*/+]"
199
+ },
200
+ {
201
+ "name": "keyword.operator.map.algraf",
202
+ "match": "=>"
203
+ },
204
+ {
205
+ "name": "keyword.operator.assignment.algraf",
206
+ "match": "="
207
+ },
208
+ {
209
+ "name": "punctuation.separator.comma.algraf",
210
+ "match": ","
211
+ },
212
+ {
213
+ "name": "punctuation.separator.key-value.algraf",
214
+ "match": ":"
215
+ },
216
+ {
217
+ "name": "punctuation.section.braces.algraf",
218
+ "match": "[{}]"
219
+ },
220
+ {
221
+ "name": "punctuation.section.parens.algraf",
222
+ "match": "[()]"
223
+ },
224
+ {
225
+ "name": "punctuation.section.brackets.algraf",
226
+ "match": "[\\[\\]]"
227
+ }
228
+ ]
229
+ },
230
+ "functions": {
231
+ "patterns": [
232
+ {
233
+ "name": "entity.name.function.algraf",
234
+ "match": "\\b[A-Za-z_][A-Za-z0-9_]*\\b(?=\\s*\\()"
235
+ }
236
+ ]
237
+ }
238
+ }
239
+ }
@@ -0,0 +1,78 @@
1
+ {
2
+ "comments": {
3
+ "lineComment": "//"
4
+ },
5
+ "brackets": [
6
+ [
7
+ "{",
8
+ "}"
9
+ ],
10
+ [
11
+ "(",
12
+ ")"
13
+ ],
14
+ [
15
+ "[",
16
+ "]"
17
+ ]
18
+ ],
19
+ "autoClosingPairs": [
20
+ {
21
+ "open": "{",
22
+ "close": "}"
23
+ },
24
+ {
25
+ "open": "(",
26
+ "close": ")"
27
+ },
28
+ {
29
+ "open": "[",
30
+ "close": "]"
31
+ },
32
+ {
33
+ "open": "\"",
34
+ "close": "\"",
35
+ "notIn": [
36
+ "string",
37
+ "comment"
38
+ ]
39
+ },
40
+ {
41
+ "open": "`",
42
+ "close": "`",
43
+ "notIn": [
44
+ "string",
45
+ "comment"
46
+ ]
47
+ }
48
+ ],
49
+ "surroundingPairs": [
50
+ {
51
+ "open": "{",
52
+ "close": "}"
53
+ },
54
+ {
55
+ "open": "(",
56
+ "close": ")"
57
+ },
58
+ {
59
+ "open": "[",
60
+ "close": "]"
61
+ },
62
+ {
63
+ "open": "\"",
64
+ "close": "\""
65
+ },
66
+ {
67
+ "open": "`",
68
+ "close": "`"
69
+ }
70
+ ],
71
+ "folding": {
72
+ "markers": {
73
+ "start": "^\\s*//\\s*#region\\b",
74
+ "end": "^\\s*//\\s*#endregion\\b"
75
+ }
76
+ },
77
+ "wordPattern": "`[^`]*(?:\\\\.[^`]*)*`|[A-Za-z_][A-Za-z0-9_]*"
78
+ }