@tuprolog/arg2p-ui 0.0.0-stage → 0.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.
Files changed (71) hide show
  1. package/README.md +48 -2
  2. package/dist/components/arg2p-editor.d.ts +73 -0
  3. package/dist/components/arg2p-editor.js +244 -0
  4. package/dist/components/arg2p-editor.js.map +1 -0
  5. package/dist/components/arg2p-flags.d.ts +58 -0
  6. package/dist/components/arg2p-flags.js +358 -0
  7. package/dist/components/arg2p-flags.js.map +1 -0
  8. package/dist/components/arg2p-framework.d.ts +102 -0
  9. package/dist/components/arg2p-framework.js +513 -0
  10. package/dist/components/arg2p-framework.js.map +1 -0
  11. package/dist/components/arg2p-graph.d.ts +112 -0
  12. package/dist/components/arg2p-graph.js +577 -0
  13. package/dist/components/arg2p-graph.js.map +1 -0
  14. package/dist/components/arg2p-solutions.d.ts +75 -0
  15. package/dist/components/arg2p-solutions.js +391 -0
  16. package/dist/components/arg2p-solutions.js.map +1 -0
  17. package/dist/data.d.ts +9 -0
  18. package/dist/data.js +11 -0
  19. package/dist/data.js.map +1 -0
  20. package/dist/editor/language.d.ts +9 -0
  21. package/dist/editor/language.js +78 -0
  22. package/dist/editor/language.js.map +1 -0
  23. package/dist/engine.d.ts +94 -0
  24. package/dist/engine.js +2 -0
  25. package/dist/engine.js.map +1 -0
  26. package/dist/flags/schema.d.ts +50 -0
  27. package/dist/flags/schema.js +195 -0
  28. package/dist/flags/schema.js.map +1 -0
  29. package/dist/flags/text.d.ts +18 -0
  30. package/dist/flags/text.js +85 -0
  31. package/dist/flags/text.js.map +1 -0
  32. package/dist/formats/declarations.d.ts +9 -0
  33. package/dist/formats/declarations.js +193 -0
  34. package/dist/formats/declarations.js.map +1 -0
  35. package/dist/formats/frameworks.d.ts +23 -0
  36. package/dist/formats/frameworks.js +130 -0
  37. package/dist/formats/frameworks.js.map +1 -0
  38. package/dist/graph/canvas.d.ts +21 -0
  39. package/dist/graph/canvas.js +76 -0
  40. package/dist/graph/canvas.js.map +1 -0
  41. package/dist/graph/drawing.d.ts +24 -0
  42. package/dist/graph/drawing.js +64 -0
  43. package/dist/graph/drawing.js.map +1 -0
  44. package/dist/graph/layout.d.ts +28 -0
  45. package/dist/graph/layout.js +167 -0
  46. package/dist/graph/layout.js.map +1 -0
  47. package/dist/graph/levels.d.ts +6 -0
  48. package/dist/graph/levels.js +25 -0
  49. package/dist/graph/levels.js.map +1 -0
  50. package/dist/graph/positions.d.ts +24 -0
  51. package/dist/graph/positions.js +43 -0
  52. package/dist/graph/positions.js.map +1 -0
  53. package/dist/index.d.ts +8 -0
  54. package/dist/index.js +11 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/js/engine.d.ts +35 -0
  57. package/dist/js/engine.js +110 -0
  58. package/dist/js/engine.js.map +1 -0
  59. package/dist/js/host.d.ts +75 -0
  60. package/dist/js/host.js +237 -0
  61. package/dist/js/host.js.map +1 -0
  62. package/dist/js/index.d.ts +2 -0
  63. package/dist/js/index.js +4 -0
  64. package/dist/js/index.js.map +1 -0
  65. package/dist/js/worker.d.ts +1 -0
  66. package/dist/js/worker.js +7 -0
  67. package/dist/js/worker.js.map +1 -0
  68. package/dist/theme.d.ts +5 -0
  69. package/dist/theme.js +48 -0
  70. package/dist/theme.js.map +1 -0
  71. package/package.json +65 -4
@@ -0,0 +1,75 @@
1
+ import { LitElement, nothing, type PropertyValues } from 'lit';
2
+ import type { EngineError, Run } from '../engine.js';
3
+ /**
4
+ * The solutions of a query, asked for one at a time (Next): yes with its bindings, no, or halt with its error; an
5
+ * error that kept the query from running shows alone. Picking a yes solution shows it again (its graph, say).
6
+ *
7
+ * Events: `arg2p-solution` with the solution and its run, when one is shown (the newest, or one picked);
8
+ * `arg2p-busy` with whether a solution is being computed; `arg2p-failure` with the EngineError of a computation that
9
+ * failed (stopped, say); `arg2p-error-select` with the error shown, when it is picked (to go where it is).
10
+ *
11
+ * Attributes: `hide-exhausted-no` hides the no that only tells that the yes solutions are over; `trivial` is set
12
+ * when there is nothing to show besides the query itself (a page may hide the solutions then).
13
+ */
14
+ export declare class Arg2pSolutions extends LitElement {
15
+ static properties: {
16
+ hideExhaustedNo: {
17
+ type: BooleanConstructor;
18
+ attribute: string;
19
+ };
20
+ trivial: {
21
+ type: BooleanConstructor;
22
+ reflect: boolean;
23
+ };
24
+ busy: {
25
+ type: BooleanConstructor;
26
+ reflect: boolean;
27
+ };
28
+ run: {
29
+ state: boolean;
30
+ };
31
+ entries: {
32
+ state: boolean;
33
+ };
34
+ error: {
35
+ state: boolean;
36
+ };
37
+ shown: {
38
+ state: boolean;
39
+ };
40
+ };
41
+ hideExhaustedNo: boolean;
42
+ trivial: boolean;
43
+ busy: boolean;
44
+ private run;
45
+ private entries;
46
+ private error;
47
+ private shown;
48
+ /** Shows the solutions of [run], from its first one */
49
+ start(run: Run): Promise<void>;
50
+ /** Shows [error], which kept a query from running */
51
+ fail(error: EngineError): void;
52
+ clear(): void;
53
+ /** Whether there is another solution to ask for */
54
+ get hasNext(): boolean;
55
+ /** Asks for the next solution: the page stays responsive meanwhile. A run replaced meanwhile is let go */
56
+ next(): Promise<void>;
57
+ private reset;
58
+ private setBusy;
59
+ private add;
60
+ private show;
61
+ private emit;
62
+ protected willUpdate(): void;
63
+ protected updated(changed: PropertyValues): void;
64
+ protected render(): typeof nothing | import("lit-html").TemplateResult<1>;
65
+ private renderError;
66
+ private renderEntry;
67
+ static styles: import("lit").CSSResult[];
68
+ }
69
+ /** The top level elements of a Prolog list term, or null for any other term (a list with a tail, `[a | T]`, too) */
70
+ export declare function listItems(term: string): string[] | null;
71
+ declare global {
72
+ interface HTMLElementTagNameMap {
73
+ 'arg2p-solutions': Arg2pSolutions;
74
+ }
75
+ }
@@ -0,0 +1,391 @@
1
+ import { LitElement, css, html, nothing } from 'lit';
2
+ import { tokens } from '../theme.js';
3
+ // Bindings named after a label (In, Out, Und) hold sets of arguments or statements: shown as chips coloured like the
4
+ // graph
5
+ const LABELS = ['in', 'out', 'und'];
6
+ /**
7
+ * The solutions of a query, asked for one at a time (Next): yes with its bindings, no, or halt with its error; an
8
+ * error that kept the query from running shows alone. Picking a yes solution shows it again (its graph, say).
9
+ *
10
+ * Events: `arg2p-solution` with the solution and its run, when one is shown (the newest, or one picked);
11
+ * `arg2p-busy` with whether a solution is being computed; `arg2p-failure` with the EngineError of a computation that
12
+ * failed (stopped, say); `arg2p-error-select` with the error shown, when it is picked (to go where it is).
13
+ *
14
+ * Attributes: `hide-exhausted-no` hides the no that only tells that the yes solutions are over; `trivial` is set
15
+ * when there is nothing to show besides the query itself (a page may hide the solutions then).
16
+ */
17
+ export class Arg2pSolutions extends LitElement {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.hideExhaustedNo = false;
21
+ this.trivial = true;
22
+ this.busy = false;
23
+ this.run = null;
24
+ this.entries = [];
25
+ this.error = null;
26
+ this.shown = null;
27
+ }
28
+ static { this.properties = {
29
+ hideExhaustedNo: { type: Boolean, attribute: 'hide-exhausted-no' },
30
+ trivial: { type: Boolean, reflect: true },
31
+ busy: { type: Boolean, reflect: true },
32
+ run: { state: true },
33
+ entries: { state: true },
34
+ error: { state: true },
35
+ shown: { state: true },
36
+ }; }
37
+ /** Shows the solutions of [run], from its first one */
38
+ start(run) {
39
+ this.reset();
40
+ this.run = run;
41
+ return this.next();
42
+ }
43
+ /** Shows [error], which kept a query from running */
44
+ fail(error) {
45
+ this.reset();
46
+ this.error = error;
47
+ }
48
+ clear() {
49
+ this.reset();
50
+ }
51
+ /** Whether there is another solution to ask for */
52
+ get hasNext() {
53
+ return this.run !== null && !this.busy && this.run.hasNext();
54
+ }
55
+ /** Asks for the next solution: the page stays responsive meanwhile. A run replaced meanwhile is let go */
56
+ next() {
57
+ const run = this.run;
58
+ if (run === null || this.busy || !run.hasNext())
59
+ return Promise.resolve();
60
+ this.setBusy(true);
61
+ return run.next().then(solution => {
62
+ if (run !== this.run)
63
+ return;
64
+ this.setBusy(false);
65
+ this.add(solution);
66
+ }, (error) => {
67
+ if (run !== this.run)
68
+ return;
69
+ this.setBusy(false);
70
+ this.emit('arg2p-failure', { error });
71
+ });
72
+ }
73
+ reset() {
74
+ this.run = null;
75
+ this.entries = [];
76
+ this.error = null;
77
+ this.shown = null;
78
+ this.setBusy(false);
79
+ }
80
+ setBusy(busy) {
81
+ if (this.busy === busy)
82
+ return;
83
+ this.busy = busy;
84
+ this.emit('arg2p-busy', { busy });
85
+ }
86
+ add(solution) {
87
+ const accepted = this.entries.filter(it => it.accepted > 0).length;
88
+ // Once a solution has been accepted, a trailing no only marks the end of the enumeration. A leading one still
89
+ // means something (no extension under the semantics chosen), so it is never hidden.
90
+ if (this.hideExhaustedNo && solution.result === 'no' && accepted > 0)
91
+ return;
92
+ const entry = { solution, accepted: solution.result === 'yes' ? accepted + 1 : 0 };
93
+ this.entries = [...this.entries, entry];
94
+ // the newest solution is the one shown
95
+ if (solution.result === 'yes')
96
+ this.show(entry);
97
+ }
98
+ show(entry) {
99
+ this.shown = entry;
100
+ this.emit('arg2p-solution', { solution: entry.solution, run: this.run });
101
+ }
102
+ emit(type, detail) {
103
+ this.dispatchEvent(new CustomEvent(type, { detail, bubbles: true, composed: true }));
104
+ }
105
+ willUpdate() {
106
+ // A plain yes with no bindings only repeats the query: the solutions are worth showing for bindings, failures
107
+ // and errors, and as soon as there is a second solution to pick from
108
+ const yes = this.entries.filter(it => it.solution.result === 'yes');
109
+ this.trivial =
110
+ this.error === null &&
111
+ this.entries.every(it => it.solution.result === 'yes' && it.solution.bindings.length === 0) &&
112
+ yes.length <= 1;
113
+ }
114
+ updated(changed) {
115
+ if (changed.has('entries'))
116
+ this.renderRoot.querySelector('.solution:last-child')?.scrollIntoView?.({ block: 'nearest' });
117
+ }
118
+ render() {
119
+ if (this.error !== null)
120
+ return this.renderError(this.error);
121
+ if (this.run === null)
122
+ return nothing;
123
+ return html `
124
+ <div class="head">
125
+ <div class="query">?- ${this.run.query}</div>
126
+ <button type="button" class="next" title="The next solution" ?disabled=${!this.hasNext} @click=${() => this.next()}>Next</button>
127
+ </div>
128
+ <ol class="list">
129
+ ${this.entries.map(entry => this.renderEntry(entry))}
130
+ ${this.busy ? html `<li class="pending" aria-live="polite">Solving…</li>` : nothing}
131
+ </ol>
132
+ `;
133
+ }
134
+ renderError(error) {
135
+ const where = error.syntax;
136
+ const select = () => this.emit('arg2p-error-select', { error });
137
+ return html `
138
+ <ol class="list">
139
+ <li
140
+ class="solution halt ${where !== null ? 'selectable' : ''}"
141
+ tabindex=${where !== null ? 0 : -1}
142
+ title=${where !== null ? 'Go to the error' : ''}
143
+ @click=${where !== null ? select : null}
144
+ @keydown=${where !== null ? (e) => activate(e, select) : null}
145
+ >
146
+ ${header('error', error.name)}
147
+ <div class="error">${error.message}</div>
148
+ </li>
149
+ </ol>
150
+ `;
151
+ }
152
+ renderEntry(entry) {
153
+ const { solution, accepted } = entry;
154
+ if (solution.result === 'no') {
155
+ const any = this.entries.some(it => it.accepted > 0);
156
+ return html `<li class="solution no">${header('no', any ? 'No more solutions' : 'No solutions')}</li>`;
157
+ }
158
+ if (solution.result === 'halt') {
159
+ return html `<li class="solution halt">${header('halt', 'Halted')}<div class="error">${solution.error ?? ''}</div></li>`;
160
+ }
161
+ const pick = () => this.show(entry);
162
+ return html `
163
+ <li
164
+ class="solution yes selectable ${this.shown === entry ? 'shown' : ''}"
165
+ tabindex="0"
166
+ role="button"
167
+ aria-pressed=${this.shown === entry}
168
+ title="Show the graph of this solution"
169
+ @click=${pick}
170
+ @keydown=${(e) => activate(e, pick)}
171
+ >
172
+ ${header('yes', `Solution ${accepted}`)}
173
+ ${solution.bindings.length > 0 ? bindings(solution.bindings) : html `<div class="term">${solution.query}</div>`}
174
+ </li>
175
+ `;
176
+ }
177
+ static { this.styles = [
178
+ tokens,
179
+ css `
180
+ :host {
181
+ display: block;
182
+ font-size: 14px;
183
+ }
184
+ .head {
185
+ display: flex;
186
+ align-items: baseline;
187
+ gap: 8px;
188
+ padding: 0 2px 8px 2px;
189
+ }
190
+ .query {
191
+ flex: 1;
192
+ font-family: var(--_mono);
193
+ font-size: 13px;
194
+ color: var(--_muted);
195
+ word-break: break-word;
196
+ }
197
+ button {
198
+ font: inherit;
199
+ font-size: 13px;
200
+ color: var(--_text);
201
+ background: var(--_surface);
202
+ border: 1px solid var(--_border);
203
+ border-radius: 4px;
204
+ padding: 2px 10px;
205
+ cursor: pointer;
206
+ }
207
+ button:hover:not(:disabled) {
208
+ background: var(--_hover);
209
+ }
210
+ button:disabled {
211
+ opacity: 0.5;
212
+ cursor: default;
213
+ }
214
+ .list {
215
+ list-style: none;
216
+ margin: 0;
217
+ padding: 0;
218
+ }
219
+ .solution {
220
+ border: 1px solid var(--_border);
221
+ border-left: 4px solid var(--_accent);
222
+ border-radius: 6px;
223
+ padding: 8px 10px;
224
+ margin-bottom: 8px;
225
+ background: var(--_surface);
226
+ }
227
+ .selectable {
228
+ cursor: pointer;
229
+ }
230
+ .selectable:hover {
231
+ background: var(--_hover);
232
+ }
233
+ .selectable:focus {
234
+ outline: none;
235
+ }
236
+ .selectable:focus-visible,
237
+ .shown {
238
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--_accent) 45%, transparent);
239
+ }
240
+ .solution.no {
241
+ border-left-color: var(--_no);
242
+ }
243
+ .solution.halt {
244
+ border-left-color: var(--_error);
245
+ }
246
+ .header {
247
+ display: flex;
248
+ align-items: center;
249
+ gap: 8px;
250
+ }
251
+ .badge {
252
+ font-size: 11px;
253
+ font-weight: bold;
254
+ text-transform: uppercase;
255
+ letter-spacing: 0.04em;
256
+ color: #ffffff;
257
+ background: var(--_accent);
258
+ border-radius: 4px;
259
+ padding: 1px 6px;
260
+ }
261
+ .no .badge {
262
+ background: var(--_no);
263
+ }
264
+ .halt .badge {
265
+ background: var(--_error);
266
+ }
267
+ .term,
268
+ .error,
269
+ .bindings {
270
+ margin: 8px 0 0 0;
271
+ font-family: var(--_mono);
272
+ font-size: 13px;
273
+ word-break: break-word;
274
+ }
275
+ .error {
276
+ color: var(--_error);
277
+ }
278
+ .bindings {
279
+ display: grid;
280
+ grid-template-columns: max-content 1fr;
281
+ column-gap: 10px;
282
+ row-gap: 6px;
283
+ align-items: baseline;
284
+ }
285
+ dt {
286
+ font-weight: bold;
287
+ }
288
+ dt::after {
289
+ content: ' =';
290
+ color: var(--_muted);
291
+ font-weight: normal;
292
+ }
293
+ dd {
294
+ margin: 0;
295
+ display: flex;
296
+ flex-wrap: wrap;
297
+ gap: 4px;
298
+ }
299
+ .chip {
300
+ border-radius: 10px;
301
+ padding: 0 8px;
302
+ color: #ffffff;
303
+ }
304
+ .chip.in {
305
+ background: var(--_in);
306
+ }
307
+ .chip.out {
308
+ background: var(--_out);
309
+ }
310
+ .chip.und {
311
+ background: var(--_und);
312
+ }
313
+ .empty,
314
+ .pending {
315
+ color: var(--_muted);
316
+ }
317
+ .pending {
318
+ font-style: italic;
319
+ padding: 4px 2px;
320
+ }
321
+ `,
322
+ ]; }
323
+ }
324
+ function header(badge, title) {
325
+ return html `<div class="header"><span class="badge">${badge}</span><span>${title}</span></div>`;
326
+ }
327
+ function activate(event, action) {
328
+ if (event.key !== 'Enter' && event.key !== ' ')
329
+ return;
330
+ event.preventDefault();
331
+ action();
332
+ }
333
+ // `Variable = value` rows. A value of a label variable that is a list shows its items as chips; any other value keeps
334
+ // its Prolog form, where a list and its single element would otherwise look the same.
335
+ function bindings(list) {
336
+ return html `
337
+ <dl class="bindings">
338
+ ${list.map(({ name, value }) => {
339
+ const label = name.toLowerCase();
340
+ const items = LABELS.includes(label) ? listItems(value) : null;
341
+ return html `
342
+ <dt>${name}</dt>
343
+ <dd>
344
+ ${items === null ? value
345
+ : items.length === 0 ? html `<span class="empty">[ ]</span>`
346
+ : items.map(item => html `<span class="chip ${label}">${single(item)}</span>`)}
347
+ </dd>
348
+ `;
349
+ })}
350
+ </dl>
351
+ `;
352
+ }
353
+ // A statement of a set of labelled statements is a list of one term, `[flies(tweety)]`: shown as the term
354
+ function single(item) {
355
+ const items = listItems(item);
356
+ return items !== null && items.length === 1 ? items[0] : item;
357
+ }
358
+ /** The top level elements of a Prolog list term, or null for any other term (a list with a tail, `[a | T]`, too) */
359
+ export function listItems(term) {
360
+ const text = term.trim();
361
+ if (!text.startsWith('[') || !text.endsWith(']'))
362
+ return null;
363
+ const body = text.slice(1, -1).trim();
364
+ if (body === '')
365
+ return [];
366
+ const items = [];
367
+ let depth = 0;
368
+ let quoted = false;
369
+ let current = '';
370
+ for (const char of body) {
371
+ if (char === "'")
372
+ quoted = !quoted;
373
+ if (!quoted && '([{'.includes(char))
374
+ depth++;
375
+ if (!quoted && ')]}'.includes(char))
376
+ depth--;
377
+ if (!quoted && depth === 0 && char === '|')
378
+ return null;
379
+ if (!quoted && depth === 0 && char === ',') {
380
+ items.push(current.trim());
381
+ current = '';
382
+ }
383
+ else {
384
+ current += char;
385
+ }
386
+ }
387
+ items.push(current.trim());
388
+ return items;
389
+ }
390
+ customElements.define('arg2p-solutions', Arg2pSolutions);
391
+ //# sourceMappingURL=arg2p-solutions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arg2p-solutions.js","sourceRoot":"","sources":["../../src/components/arg2p-solutions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAE1E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,qHAAqH;AACrH,QAAQ;AACR,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAQpC;;;;;;;;;;GAUG;AACH,MAAM,OAAO,cAAe,SAAQ,UAAU;IAA9C;;QAWI,oBAAe,GAAG,KAAK,CAAC;QACxB,YAAO,GAAG,IAAI,CAAC;QACf,SAAI,GAAG,KAAK,CAAC;QAEL,QAAG,GAAe,IAAI,CAAC;QACvB,YAAO,GAAY,EAAE,CAAC;QACtB,UAAK,GAAuB,IAAI,CAAC;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AAG;YAAE,MAAM,GAAG,CAAC,MAAM,CAAC;QACnC,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,KAAK,EAAE,CAAC;QAC7C,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,KAAK,EAAE,CAAC;QAC7C,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,KAAK,GAAG;YAAE,OAAO,IAAI,CAAC;QACxD,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACzC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YAC3B,OAAO,GAAG,EAAE,CAAC;QACjB,CAAC;aAAM,CAAC;YACJ,OAAO,IAAI,IAAI,CAAC;QACpB,CAAC;IACL,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3B,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC"}
package/dist/data.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ export * from './engine.js';
2
+ export { layeredLayout, type Link, type Point, type Size, type LayoutOptions } from './graph/layout.js';
3
+ export { levelsOf, supportsOf } from './graph/levels.js';
4
+ export { isAbstract, nameOf } from './graph/drawing.js';
5
+ export { parseFramework, toApx, toTgf, toTheory, frameworkOf, type Framework, type ReadFramework } from './formats/frameworks.js';
6
+ export { declaredFramework, redrawn } from './formats/declarations.js';
7
+ export { FLAG_GROUPS, FLAGS, PROFILES, DEFAULTS, DEFAULT_FLAGS, DEFAULT_PROFILE, SEMANTICS, profileInfo, type Flag, type FlagGroup, type FlagOption, type ProfileInfo, type Settings, } from './flags/schema.js';
8
+ export { statedFlags, statedProfile, withValues, withNone, withSwitch, without } from './flags/text.js';
9
+ export type { Positions } from './graph/positions.js';
package/dist/data.js ADDED
@@ -0,0 +1,11 @@
1
+ // What the components are built on, with no component: the contract of the engines, the flags and the profiles, the
2
+ // formats of abstract frameworks, the layout of graphs. It needs no DOM (@tuprolog/arg2p-ui/data).
3
+ export * from './engine.js';
4
+ export { layeredLayout } from './graph/layout.js';
5
+ export { levelsOf, supportsOf } from './graph/levels.js';
6
+ export { isAbstract, nameOf } from './graph/drawing.js';
7
+ export { parseFramework, toApx, toTgf, toTheory, frameworkOf } from './formats/frameworks.js';
8
+ export { declaredFramework, redrawn } from './formats/declarations.js';
9
+ export { FLAG_GROUPS, FLAGS, PROFILES, DEFAULTS, DEFAULT_FLAGS, DEFAULT_PROFILE, SEMANTICS, profileInfo, } from './flags/schema.js';
10
+ export { statedFlags, statedProfile, withValues, withNone, withSwitch, without } from './flags/text.js';
11
+ //# sourceMappingURL=data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.js","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,mGAAmG;AACnG,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAwD,MAAM,mBAAmB,CAAC;AACxG,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAsC,MAAM,yBAAyB,CAAC;AAClI,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EACH,WAAW,EACX,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,eAAe,EACf,SAAS,EACT,WAAW,GAMd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { StreamLanguage } from '@codemirror/language';
2
+ import type { Extension } from '@codemirror/state';
3
+ interface State {
4
+ comment: boolean;
5
+ }
6
+ export declare const arg2pLanguage: StreamLanguage<State>;
7
+ /** The language and its colours */
8
+ export declare function arg2p(): Extension;
9
+ export {};
@@ -0,0 +1,78 @@
1
+ import { HighlightStyle, StreamLanguage, syntaxHighlighting } from '@codemirror/language';
2
+ import { tags } from '@lezer/highlight';
3
+ const parser = {
4
+ name: 'arg2p',
5
+ startState: () => ({ comment: false }),
6
+ token(stream, state) {
7
+ if (state.comment) {
8
+ if (stream.skipTo('*/')) {
9
+ stream.pos += 2;
10
+ state.comment = false;
11
+ }
12
+ else {
13
+ stream.skipToEnd();
14
+ }
15
+ return 'comment';
16
+ }
17
+ if (stream.eatSpace())
18
+ return null;
19
+ if (stream.match('/*')) {
20
+ state.comment = true;
21
+ return 'comment';
22
+ }
23
+ if (stream.match(/^%.*/))
24
+ return 'comment';
25
+ if (stream.match(/^[a-z][a-zA-Z0-9_]*(?=\()/))
26
+ return 'functor';
27
+ if (stream.match(/^[a-z][a-zA-Z0-9_]*/))
28
+ return 'atom';
29
+ if (stream.match(/^[A-Z_][a-zA-Z0-9_]*/))
30
+ return 'variable';
31
+ if (stream.match(/^"([^"\\]|\\.)*"?/))
32
+ return 'string';
33
+ if (stream.match(/^'([^'\\]|\\.|'')*'?/))
34
+ return 'atom';
35
+ if (stream.match(/^0'(\\.|.)/))
36
+ return 'number';
37
+ if (stream.match(/^\d+(\.\d+)?([eE][-+]?\d+)?/))
38
+ return 'number';
39
+ if (stream.match(/^(:=>|:->|<->|=>|->|:-|\?-)(?![=><!~?:&|+\-*/^\\@#$.])/))
40
+ return 'arrow';
41
+ if (stream.match(/^\.(?=\s|%|$)/))
42
+ return 'end';
43
+ if (stream.match(/^[=><!~?:&|+\-*/^\\@#$.]+/))
44
+ return 'operator';
45
+ if (stream.match(/^[(),;[\]{}|]/))
46
+ return 'punctuation';
47
+ stream.next();
48
+ return null;
49
+ },
50
+ languageData: { commentTokens: { line: '%', block: { open: '/*', close: '*/' } } },
51
+ tokenTable: {
52
+ comment: tags.comment,
53
+ functor: tags.function(tags.name),
54
+ atom: tags.atom,
55
+ variable: tags.variableName,
56
+ string: tags.string,
57
+ number: tags.number,
58
+ arrow: tags.keyword,
59
+ end: tags.separator,
60
+ operator: tags.operator,
61
+ punctuation: tags.punctuation,
62
+ },
63
+ };
64
+ export const arg2pLanguage = StreamLanguage.define(parser);
65
+ // The colours of the tokens, custom properties the page may set (see theme.ts)
66
+ const style = HighlightStyle.define([
67
+ { tag: tags.comment, color: 'var(--_comment)', fontStyle: 'italic' },
68
+ { tag: [tags.atom, tags.number, tags.string], color: 'var(--_atom)' },
69
+ { tag: tags.function(tags.name), color: 'var(--_functor)' },
70
+ { tag: tags.variableName, color: 'var(--_variable)' },
71
+ { tag: tags.keyword, color: 'var(--_accent)', fontWeight: 'bold' },
72
+ { tag: [tags.operator, tags.separator, tags.punctuation], color: 'var(--_muted)' },
73
+ ]);
74
+ /** The language and its colours */
75
+ export function arg2p() {
76
+ return [arg2pLanguage, syntaxHighlighting(style)];
77
+ }
78
+ //# sourceMappingURL=language.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language.js","sourceRoot":"","sources":["../../src/editor/language.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAqB,MAAM,sBAAsB,CAAC;AAE7G,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AASxC,MAAM,MAAM,GAAwB;IAChC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACtC,KAAK,CAAC,MAAM,EAAE,KAAK;QACf,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAChB,IAAI,MAAM,CAA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