@code0-tech/pictor 0.0.0-mvp.40 → 0.0.0-mvp.42

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.
Files changed (56) hide show
  1. package/dist/assets/components/data-table/DataTable.style.css +1 -0
  2. package/dist/assets/components/menu/Menu.style.css +1 -1
  3. package/dist/components/d-flow/DFlow.service.js +80 -100
  4. package/dist/components/d-flow-data-type/DFlowDataType.service.js +6 -7
  5. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.d.ts +1 -1
  6. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsKeyRule.js +15 -15
  7. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.d.ts +1 -1
  8. package/dist/components/d-flow-data-type/rules/DFlowDataTypeContainsTypeRule.js +17 -17
  9. package/dist/components/d-flow-data-type/rules/DFlowDataTypeParentRule.d.ts +1 -1
  10. package/dist/components/d-flow-data-type/rules/DFlowDataTypeParentRule.js +1 -1
  11. package/dist/components/d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.d.ts +2 -1
  12. package/dist/components/d-flow-data-type/rules/DFlowDataTypeReturnTypeRule.js +87 -85
  13. package/dist/components/d-flow-data-type/rules/DFlowDataTypeRule.d.ts +2 -1
  14. package/dist/components/d-flow-function/DFlowFunction.input.hook.d.ts +2 -1
  15. package/dist/components/d-flow-function/DFlowFunction.input.hook.js +5 -5
  16. package/dist/components/d-flow-function/DFlowFunction.return.hook.d.ts +2 -1
  17. package/dist/components/d-flow-function/DFlowFunction.return.hook.js +5 -5
  18. package/dist/components/d-flow-input/DFlowInputDataTypeEditDialog.js +1 -1
  19. package/dist/components/d-flow-input/DFlowInputReferenceBadge.js +17 -17
  20. package/dist/components/d-flow-node/DFlowNode.return.hook.d.ts +5 -0
  21. package/dist/components/d-flow-node/DFlowNode.return.hook.js +27 -0
  22. package/dist/components/d-flow-suggestion/DFlowReferenceSuggestions.hook.js +90 -91
  23. package/dist/components/d-flow-validation/DDataTypeValidation.hook.js +1 -1
  24. package/dist/components/d-flow-validation/DNodeValidation.hook.js +33 -33
  25. package/dist/components/d-flow-validation/DValueValidation.hook.d.ts +2 -1
  26. package/dist/components/d-flow-validation/DValueValidation.hook.js +5 -5
  27. package/dist/components/d-project/DNamespaceProject.service.d.ts +2 -1
  28. package/dist/components/data-table/DataTable.d.ts +23 -0
  29. package/dist/components/data-table/DataTable.js +41 -0
  30. package/dist/components/data-table/DataTableColumn.d.ts +6 -0
  31. package/dist/components/data-table/DataTableColumn.js +22 -0
  32. package/dist/components/data-table/DataTableFilterInput.d.ts +18 -0
  33. package/dist/components/data-table/DataTableFilterInput.js +210 -0
  34. package/dist/components/data-table/DataTableFilterSuggestionMenu.d.ts +7 -0
  35. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +53 -0
  36. package/dist/components/data-table/index.d.ts +4 -0
  37. package/dist/components/data-table/index.js +11 -0
  38. package/dist/components/editor/Editor.d.ts +9 -3
  39. package/dist/components/editor/Editor.js +249 -174
  40. package/dist/components/menu/Menu.d.ts +5 -1
  41. package/dist/components/menu/Menu.js +73 -57
  42. package/dist/index.d.ts +1 -0
  43. package/dist/index.js +182 -171
  44. package/dist/node_modules/@lezer/highlight/dist/index.js +132 -169
  45. package/dist/utils/generics.d.ts +2 -1
  46. package/dist/utils/generics.js +84 -80
  47. package/package.json +32 -21
  48. package/dist/node_modules/@codemirror/language/dist/index.js +0 -429
  49. package/dist/node_modules/@codemirror/lint/dist/index.js +0 -515
  50. package/dist/node_modules/@codemirror/state/dist/index.js +0 -2614
  51. package/dist/node_modules/@codemirror/view/dist/index.js +0 -6227
  52. package/dist/node_modules/@lezer/common/dist/index.js +0 -1357
  53. package/dist/node_modules/@marijn/find-cluster-break/src/index.js +0 -69
  54. package/dist/node_modules/crelt/index.js +0 -27
  55. package/dist/node_modules/style-mod/src/style-mod.js +0 -109
  56. package/dist/node_modules/w3c-keyname/index.js +0 -88
@@ -1,429 +0,0 @@
1
- import { Tree as d, NodeProp as N, IterMode as C, TreeFragment as w, Parser as V, NodeType as D } from "../../../@lezer/common/dist/index.js";
2
- import { EditorState as P, Facet as j, StateEffect as q, StateField as $ } from "../../state/dist/index.js";
3
- import { ViewPlugin as U, EditorView as z, logException as H, Decoration as O, Direction as B } from "../../view/dist/index.js";
4
- import { tags as G, styleTags as J } from "../../../@lezer/highlight/dist/index.js";
5
- var b;
6
- const k = /* @__PURE__ */ new N(), K = /* @__PURE__ */ new N();
7
- class c {
8
- /**
9
- Construct a language object. If you need to invoke this
10
- directly, first define a data facet with
11
- [`defineLanguageFacet`](https://codemirror.net/6/docs/ref/#language.defineLanguageFacet), and then
12
- configure your parser to [attach](https://codemirror.net/6/docs/ref/#language.languageDataProp) it
13
- to the language's outer syntax node.
14
- */
15
- constructor(e, t, s = [], r = "") {
16
- this.data = e, this.name = r, P.prototype.hasOwnProperty("tree") || Object.defineProperty(P.prototype, "tree", { get() {
17
- return A(this);
18
- } }), this.parser = t, this.extension = [
19
- g.of(this),
20
- P.languageData.of((i, a, h) => {
21
- let n = I(i, a, h), l = n.type.prop(k);
22
- if (!l)
23
- return [];
24
- let u = i.facet(l), p = n.type.prop(K);
25
- if (p) {
26
- let y = n.resolve(a - n.from, h);
27
- for (let T of p)
28
- if (T.test(y, i)) {
29
- let L = i.facet(T.facet);
30
- return T.type == "replace" ? L : L.concat(u);
31
- }
32
- }
33
- return u;
34
- })
35
- ].concat(s);
36
- }
37
- /**
38
- Query whether this language is active at the given position.
39
- */
40
- isActiveAt(e, t, s = -1) {
41
- return I(e, t, s).type.prop(k) == this.data;
42
- }
43
- /**
44
- Find the document regions that were parsed using this language.
45
- The returned regions will _include_ any nested languages rooted
46
- in this language, when those exist.
47
- */
48
- findRegions(e) {
49
- let t = e.facet(g);
50
- if (t?.data == this.data)
51
- return [{ from: 0, to: e.doc.length }];
52
- if (!t || !t.allowsNesting)
53
- return [];
54
- let s = [], r = (i, a) => {
55
- if (i.prop(k) == this.data) {
56
- s.push({ from: a, to: a + i.length });
57
- return;
58
- }
59
- let h = i.prop(N.mounted);
60
- if (h) {
61
- if (h.tree.prop(k) == this.data) {
62
- if (h.overlay)
63
- for (let n of h.overlay)
64
- s.push({ from: n.from + a, to: n.to + a });
65
- else
66
- s.push({ from: a, to: a + i.length });
67
- return;
68
- } else if (h.overlay) {
69
- let n = s.length;
70
- if (r(h.tree, h.overlay[0].from + a), s.length > n)
71
- return;
72
- }
73
- }
74
- for (let n = 0; n < i.children.length; n++) {
75
- let l = i.children[n];
76
- l instanceof d && r(l, i.positions[n] + a);
77
- }
78
- };
79
- return r(A(e), 0), s;
80
- }
81
- /**
82
- Indicates whether this language allows nested languages. The
83
- default implementation returns true.
84
- */
85
- get allowsNesting() {
86
- return !0;
87
- }
88
- }
89
- c.setState = /* @__PURE__ */ q.define();
90
- function I(o, e, t) {
91
- let s = o.facet(g), r = A(o).topNode;
92
- if (!s || s.allowsNesting)
93
- for (let i = r; i; i = i.enter(e, t, C.ExcludeBuffers | C.EnterBracketed))
94
- i.type.isTop && (r = i);
95
- return r;
96
- }
97
- function A(o) {
98
- let e = o.field(c.state, !1);
99
- return e ? e.tree : d.empty;
100
- }
101
- class Q {
102
- /**
103
- Create an input object for the given document.
104
- */
105
- constructor(e) {
106
- this.doc = e, this.cursorPos = 0, this.string = "", this.cursor = e.iter();
107
- }
108
- get length() {
109
- return this.doc.length;
110
- }
111
- syncTo(e) {
112
- return this.string = this.cursor.next(e - this.cursorPos).value, this.cursorPos = e + this.string.length, this.cursorPos - this.string.length;
113
- }
114
- chunk(e) {
115
- return this.syncTo(e), this.string;
116
- }
117
- get lineChunks() {
118
- return !0;
119
- }
120
- read(e, t) {
121
- let s = this.cursorPos - this.string.length;
122
- return e < s || t >= this.cursorPos ? this.doc.sliceString(e, t) : this.string.slice(e - s, t - s);
123
- }
124
- }
125
- let m = null;
126
- class v {
127
- constructor(e, t, s = [], r, i, a, h, n) {
128
- this.parser = e, this.state = t, this.fragments = s, this.tree = r, this.treeLen = i, this.viewport = a, this.skipped = h, this.scheduleOn = n, this.parse = null, this.tempSkipped = [];
129
- }
130
- /**
131
- @internal
132
- */
133
- static create(e, t, s) {
134
- return new v(e, t, [], d.empty, 0, s, [], null);
135
- }
136
- startParse() {
137
- return this.parser.startParse(new Q(this.state.doc), this.fragments);
138
- }
139
- /**
140
- @internal
141
- */
142
- work(e, t) {
143
- return t != null && t >= this.state.doc.length && (t = void 0), this.tree != d.empty && this.isDone(t ?? this.state.doc.length) ? (this.takeTree(), !0) : this.withContext(() => {
144
- var s;
145
- if (typeof e == "number") {
146
- let r = Date.now() + e;
147
- e = () => Date.now() > r;
148
- }
149
- for (this.parse || (this.parse = this.startParse()), t != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > t) && t < this.state.doc.length && this.parse.stopAt(t); ; ) {
150
- let r = this.parse.advance();
151
- if (r)
152
- if (this.fragments = this.withoutTempSkipped(w.addTree(r, this.fragments, this.parse.stoppedAt != null)), this.treeLen = (s = this.parse.stoppedAt) !== null && s !== void 0 ? s : this.state.doc.length, this.tree = r, this.parse = null, this.treeLen < (t ?? this.state.doc.length))
153
- this.parse = this.startParse();
154
- else
155
- return !0;
156
- if (e())
157
- return !1;
158
- }
159
- });
160
- }
161
- /**
162
- @internal
163
- */
164
- takeTree() {
165
- let e, t;
166
- this.parse && (e = this.parse.parsedPos) >= this.treeLen && ((this.parse.stoppedAt == null || this.parse.stoppedAt > e) && this.parse.stopAt(e), this.withContext(() => {
167
- for (; !(t = this.parse.advance()); )
168
- ;
169
- }), this.treeLen = e, this.tree = t, this.fragments = this.withoutTempSkipped(w.addTree(this.tree, this.fragments, !0)), this.parse = null);
170
- }
171
- withContext(e) {
172
- let t = m;
173
- m = this;
174
- try {
175
- return e();
176
- } finally {
177
- m = t;
178
- }
179
- }
180
- withoutTempSkipped(e) {
181
- for (let t; t = this.tempSkipped.pop(); )
182
- e = E(e, t.from, t.to);
183
- return e;
184
- }
185
- /**
186
- @internal
187
- */
188
- changes(e, t) {
189
- let { fragments: s, tree: r, treeLen: i, viewport: a, skipped: h } = this;
190
- if (this.takeTree(), !e.empty) {
191
- let n = [];
192
- if (e.iterChangedRanges((l, u, p, y) => n.push({ fromA: l, toA: u, fromB: p, toB: y })), s = w.applyChanges(s, n), r = d.empty, i = 0, a = { from: e.mapPos(a.from, -1), to: e.mapPos(a.to, 1) }, this.skipped.length) {
193
- h = [];
194
- for (let l of this.skipped) {
195
- let u = e.mapPos(l.from, 1), p = e.mapPos(l.to, -1);
196
- u < p && h.push({ from: u, to: p });
197
- }
198
- }
199
- }
200
- return new v(this.parser, t, s, r, i, a, h, this.scheduleOn);
201
- }
202
- /**
203
- @internal
204
- */
205
- updateViewport(e) {
206
- if (this.viewport.from == e.from && this.viewport.to == e.to)
207
- return !1;
208
- this.viewport = e;
209
- let t = this.skipped.length;
210
- for (let s = 0; s < this.skipped.length; s++) {
211
- let { from: r, to: i } = this.skipped[s];
212
- r < e.to && i > e.from && (this.fragments = E(this.fragments, r, i), this.skipped.splice(s--, 1));
213
- }
214
- return this.skipped.length >= t ? !1 : (this.reset(), !0);
215
- }
216
- /**
217
- @internal
218
- */
219
- reset() {
220
- this.parse && (this.takeTree(), this.parse = null);
221
- }
222
- /**
223
- Notify the parse scheduler that the given region was skipped
224
- because it wasn't in view, and the parse should be restarted
225
- when it comes into view.
226
- */
227
- skipUntilInView(e, t) {
228
- this.skipped.push({ from: e, to: t });
229
- }
230
- /**
231
- Returns a parser intended to be used as placeholder when
232
- asynchronously loading a nested parser. It'll skip its input and
233
- mark it as not-really-parsed, so that the next update will parse
234
- it again.
235
-
236
- When `until` is given, a reparse will be scheduled when that
237
- promise resolves.
238
- */
239
- static getSkippingParser(e) {
240
- return new class extends V {
241
- createParse(t, s, r) {
242
- let i = r[0].from, a = r[r.length - 1].to;
243
- return {
244
- parsedPos: i,
245
- advance() {
246
- let n = m;
247
- if (n) {
248
- for (let l of r)
249
- n.tempSkipped.push(l);
250
- e && (n.scheduleOn = n.scheduleOn ? Promise.all([n.scheduleOn, e]) : e);
251
- }
252
- return this.parsedPos = a, new d(D.none, [], [], a - i);
253
- },
254
- stoppedAt: null,
255
- stopAt() {
256
- }
257
- };
258
- }
259
- }();
260
- }
261
- /**
262
- @internal
263
- */
264
- isDone(e) {
265
- e = Math.min(e, this.state.doc.length);
266
- let t = this.fragments;
267
- return this.treeLen >= e && t.length && t[0].from == 0 && t[0].to >= e;
268
- }
269
- /**
270
- Get the context for the current parse, or `null` if no editor
271
- parse is in progress.
272
- */
273
- static get() {
274
- return m;
275
- }
276
- }
277
- function E(o, e, t) {
278
- return w.applyChanges(o, [{ fromA: e, toA: t, fromB: e, toB: t }]);
279
- }
280
- class f {
281
- constructor(e) {
282
- this.context = e, this.tree = e.tree;
283
- }
284
- apply(e) {
285
- if (!e.docChanged && this.tree == this.context.tree)
286
- return this;
287
- let t = this.context.changes(e.changes, e.state), s = this.context.treeLen == e.startState.doc.length ? void 0 : Math.max(e.changes.mapPos(this.context.treeLen), t.viewport.to);
288
- return t.work(20, s) || t.takeTree(), new f(t);
289
- }
290
- static init(e) {
291
- let t = Math.min(3e3, e.doc.length), s = v.create(e.facet(g).parser, e, { from: 0, to: t });
292
- return s.work(20, t) || s.takeTree(), new f(s);
293
- }
294
- }
295
- c.state = /* @__PURE__ */ $.define({
296
- create: f.init,
297
- update(o, e) {
298
- for (let t of e.effects)
299
- if (t.is(c.setState))
300
- return t.value;
301
- return e.startState.facet(g) != e.state.facet(g) ? f.init(e.state) : o.apply(e);
302
- }
303
- });
304
- let R = (o) => {
305
- let e = setTimeout(
306
- () => o(),
307
- 500
308
- /* Work.MaxPause */
309
- );
310
- return () => clearTimeout(e);
311
- };
312
- typeof requestIdleCallback < "u" && (R = (o) => {
313
- let e = -1, t = setTimeout(
314
- () => {
315
- e = requestIdleCallback(o, {
316
- timeout: 400
317
- /* Work.MinPause */
318
- });
319
- },
320
- 100
321
- /* Work.MinPause */
322
- );
323
- return () => e < 0 ? clearTimeout(t) : cancelIdleCallback(e);
324
- });
325
- const x = typeof navigator < "u" && (!((b = navigator.scheduling) === null || b === void 0) && b.isInputPending) ? () => navigator.scheduling.isInputPending() : null, X = /* @__PURE__ */ U.fromClass(class {
326
- constructor(e) {
327
- this.view = e, this.working = null, this.workScheduled = 0, this.chunkEnd = -1, this.chunkBudget = -1, this.work = this.work.bind(this), this.scheduleWork();
328
- }
329
- update(e) {
330
- let t = this.view.state.field(c.state).context;
331
- (t.updateViewport(e.view.viewport) || this.view.viewport.to > t.treeLen) && this.scheduleWork(), (e.docChanged || e.selectionSet) && (this.view.hasFocus && (this.chunkBudget += 50), this.scheduleWork()), this.checkAsyncSchedule(t);
332
- }
333
- scheduleWork() {
334
- if (this.working)
335
- return;
336
- let { state: e } = this.view, t = e.field(c.state);
337
- (t.tree != t.context.tree || !t.context.isDone(e.doc.length)) && (this.working = R(this.work));
338
- }
339
- work(e) {
340
- this.working = null;
341
- let t = Date.now();
342
- if (this.chunkEnd < t && (this.chunkEnd < 0 || this.view.hasFocus) && (this.chunkEnd = t + 3e4, this.chunkBudget = 3e3), this.chunkBudget <= 0)
343
- return;
344
- let { state: s, viewport: { to: r } } = this.view, i = s.field(c.state);
345
- if (i.tree == i.context.tree && i.context.isDone(
346
- r + 1e5
347
- /* Work.MaxParseAhead */
348
- ))
349
- return;
350
- let a = Date.now() + Math.min(this.chunkBudget, 100, e && !x ? Math.max(25, e.timeRemaining() - 5) : 1e9), h = i.context.treeLen < r && s.doc.length > r + 1e3, n = i.context.work(() => x && x() || Date.now() > a, r + (h ? 0 : 1e5));
351
- this.chunkBudget -= Date.now() - t, (n || this.chunkBudget <= 0) && (i.context.takeTree(), this.view.dispatch({ effects: c.setState.of(new f(i.context)) })), this.chunkBudget > 0 && !(n && !h) && this.scheduleWork(), this.checkAsyncSchedule(i.context);
352
- }
353
- checkAsyncSchedule(e) {
354
- e.scheduleOn && (this.workScheduled++, e.scheduleOn.then(() => this.scheduleWork()).catch((t) => H(this.view.state, t)).then(() => this.workScheduled--), e.scheduleOn = null);
355
- }
356
- destroy() {
357
- this.working && this.working();
358
- }
359
- isWorking() {
360
- return !!(this.working || this.workScheduled > 0);
361
- }
362
- }, {
363
- eventHandlers: { focus() {
364
- this.scheduleWork();
365
- } }
366
- }), g = /* @__PURE__ */ j.define({
367
- combine(o) {
368
- return o.length ? o[0] : null;
369
- },
370
- enables: (o) => [
371
- c.state,
372
- X,
373
- z.contentAttributes.compute([o], (e) => {
374
- let t = e.facet(o);
375
- return t && t.name ? { "data-language": t.name } : {};
376
- })
377
- ]
378
- }), Y = /* @__PURE__ */ Object.create(null), W = [D.none], F = [], M = /* @__PURE__ */ Object.create(null), Z = /* @__PURE__ */ Object.create(null);
379
- for (let [o, e] of [
380
- ["variable", "variableName"],
381
- ["variable-2", "variableName.special"],
382
- ["string-2", "string.special"],
383
- ["def", "variableName.definition"],
384
- ["tag", "tagName"],
385
- ["attribute", "attributeName"],
386
- ["type", "typeName"],
387
- ["builtin", "variableName.standard"],
388
- ["qualifier", "modifier"],
389
- ["error", "invalid"],
390
- ["header", "heading"],
391
- ["property", "propertyName"]
392
- ])
393
- Z[o] = /* @__PURE__ */ _(Y, e);
394
- function S(o, e) {
395
- F.indexOf(o) > -1 || (F.push(o), console.warn(e));
396
- }
397
- function _(o, e) {
398
- let t = [];
399
- for (let h of e.split(" ")) {
400
- let n = [];
401
- for (let l of h.split(".")) {
402
- let u = o[l] || G[l];
403
- u ? typeof u == "function" ? n.length ? n = n.map(u) : S(l, `Modifier ${l} used at start of tag`) : n.length ? S(l, `Tag ${l} used as modifier`) : n = Array.isArray(u) ? u : [u] : S(l, `Unknown highlighting tag ${l}`);
404
- }
405
- for (let l of n)
406
- t.push(l);
407
- }
408
- if (!t.length)
409
- return 0;
410
- let s = e.replace(/ /g, "_"), r = s + " " + t.map((h) => h.id), i = M[r];
411
- if (i)
412
- return i.id;
413
- let a = M[r] = D.define({
414
- id: W.length,
415
- name: s,
416
- props: [J({ [s]: t })]
417
- });
418
- return W.push(a), a.id;
419
- }
420
- B.RTL, B.LTR;
421
- export {
422
- Q as DocInput,
423
- c as Language,
424
- v as ParseContext,
425
- g as language,
426
- k as languageDataProp,
427
- K as sublanguageProp,
428
- A as syntaxTree
429
- };