@ember-marquetry/inspector 0.0.0-stage → 2.0.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 ADDED
@@ -0,0 +1,49 @@
1
+ # @ember-marquetry/inspector
2
+
3
+ ## 2.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 7e5ccde: The harnesses of these packages extend the Harnessed `Harness` of
8
+ `@ember-marquetry/test-support`, so each one has `read()` and a `should` on each method. The
9
+ chat test support has a new `MarkdownHarness`: `headings()`, `bold()`, `tables()`,
10
+ `scripts()`, `links()` and `text()`. The READMEs, the guide and the skill show tests with
11
+ `should` assertions.
12
+ - 8c811bd: Publish through OIDC trusted publishing only, with the Ember Workbench release kit. Each version from this release on has npm provenance.
13
+ - Updated dependencies [7e5ccde]
14
+ - Updated dependencies [8c811bd]
15
+ - @ember-marquetry/test-support@2.0.0
16
+ - @ember-marquetry/core@2.0.0
17
+ - @ember-marquetry/ember@2.0.0
18
+
19
+ ## 1.0.0
20
+
21
+ ### Major Changes
22
+
23
+ - 8f2790b: The first release of Marquetry: generative UI for Ember.
24
+
25
+ - `core`: the spec format, the JSONL patch stream, expressions, actions, the catalog, agent events, chat threads and stream replay.
26
+ - `ember`: the `<Render>` component and the `Generation` state machine.
27
+ - `joinery`: a catalog of 69 Joinery components, with layout templates and the chart, data table and code block add-ons. The `/a2ui` subpath is the A2UI v0.9.1 basic catalog on Joinery components, for the specs of `a2ui`.
28
+ - `chat`: a chat thread on Joinery components, with streamed markdown, agent surfaces, tool calls, approvals and MCP Apps.
29
+ - `formwright`: forms with validation from a JSON Schema, field rules and named validators.
30
+ - `inspector`: a dev panel for `<Render>` that shows the spec, the patches with their line numbers, the state and the problems.
31
+ - `ai-sdk`, `ag-ui`, `a2ui` and `sse`: adapters and chat transports for the AI SDK, AG-UI 1.0, A2UI v0.9.1 and plain JSONL or SSE endpoints.
32
+ - `markdown`: a streamed markdown parser that makes no HTML.
33
+ - `mcp-apps`: a host for MCP Apps in a sandbox frame on a second origin.
34
+ - `eslint-plugin`, `skills`, `test-support` and the `ember-marquetry` CLI: tools for catalog authors and app developers.
35
+
36
+ Safety defaults in 1.0:
37
+
38
+ - `joinery`: a URL that the browser loads with no click (the `src` of `Image` and `Avatar`, the `image` of `Attachment`, and the `url` of the A2UI `Image`, `Video` and `AudioPlayer`) must be relative, unless `urls.mediaHosts` lists its host. `isSafeMediaUrl` is the check. `urls.hosts` applies only to links.
39
+ - `markdown` and `chat`: an image must pass `isSafeImageUrl` (`<Chat @isSafeImageUrl>`, `<Markdown @isSafeImageUrl>`). The default, `isRelativeUrl`, accepts only a relative URL. A block of more than 20,000 characters is plain text.
40
+ - `chat`: `<McpApp>` and `McpAppsConfig` have `approveDomain`. Without it, the app gets no domain that it declares in its CSP. An app cannot call a tool that needs the approval of the user (`@needsApproval`).
41
+ - `mcp-apps`: the proxy puts the CSP meta at offset 0 of the app HTML, and gives its own page a `frame-src` with only the approved frame domains.
42
+ - `ai-sdk` and `ag-ui`: a problem in one item is a `data` event named `stream-error`, and a value that the reader does not convert is a `data` event named `unconverted`. `error` is only for a failed run.
43
+
44
+ ### Patch Changes
45
+
46
+ - Updated dependencies [8f2790b]
47
+ - @ember-marquetry/core@1.0.0
48
+ - @ember-marquetry/ember@1.0.0
49
+ - @ember-marquetry/test-support@1.0.0
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Joe Gaudet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,13 @@
1
+ Marquetry
2
+ Copyright (c) 2026 Joe Gaudet. MIT licensed; see LICENSE.md.
3
+
4
+ Marquetry is an original design. Two projects gave it ideas and formats, and Marquetry copies
5
+ no code from them:
6
+
7
+ - json-render (Vercel, Apache 2.0): the idea of a catalog that limits a model, a flat element
8
+ map, and a spec that streams as JSON Lines of RFC 6902 patches.
9
+ - A2UI (Google, Apache 2.0): the v0.9 message format that @ember-marquetry/a2ui reads.
10
+
11
+ @ember-marquetry/ag-ui reads the event format of the AG-UI protocol, and
12
+ @ember-marquetry/ai-sdk reads the UI message stream format of the Vercel AI SDK. Marquetry
13
+ depends on neither package.
package/README.md CHANGED
@@ -1,3 +1,117 @@
1
- # Temporary Holding Version
1
+ # @ember-marquetry/inspector
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A dev panel for the `<Render>` of [Marquetry](https://joegaudet.com/ember-marquetry/). It shows:
4
+
5
+ - **Spec:** the tree of the elements from the root, and the spec as JSON.
6
+ - **Patches:** each patch of the stream, with its line number.
7
+ - **State:** the state after each change.
8
+ - **Problems:** the stream errors, the validation issues, the repairs, and the errors that
9
+ `<Render>` gave to `@onError`.
10
+
11
+ The panel uses Joinery components: `Tabs`, `Table`, `Badge` and `ScrollArea`. Each value shows
12
+ as text. The panel never renders HTML from a spec.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ pnpm add -D @ember-marquetry/inspector
18
+ ```
19
+
20
+ The package needs `@ember-joinery/ember`, as `@ember-marquetry/joinery` does.
21
+
22
+ ## Use it
23
+
24
+ Give the inspector the same spec as `<Render>`. A `Generation` has the patches and the stream
25
+ errors. Keep the state from `@onStateChange` and the errors from `@onError`, and give them to the
26
+ inspector too.
27
+
28
+ ```gts
29
+ import Component from '@glimmer/component'
30
+ import { tracked } from '@glimmer/tracking'
31
+ import { Generation, Render, type MarquetryError } from '@ember-marquetry/ember'
32
+ import { Inspector } from '@ember-marquetry/inspector'
33
+ import { catalog, registry } from '@ember-marquetry/joinery'
34
+
35
+ export default class Playground extends Component {
36
+ generation = new Generation({ owner: this, catalog })
37
+ @tracked state: Record<string, unknown> | undefined
38
+ @tracked errors: readonly MarquetryError[] = []
39
+
40
+ onStateChange = (state: Record<string, unknown>) => (this.state = state)
41
+ onError = (error: MarquetryError) => (this.errors = [...this.errors, error])
42
+
43
+ <template>
44
+ <Render
45
+ @spec={{this.generation.spec}}
46
+ @catalog={{catalog}}
47
+ @registry={{registry}}
48
+ @streaming={{this.generation.isStreaming}}
49
+ @onStateChange={{this.onStateChange}}
50
+ @onError={{this.onError}}
51
+ />
52
+ <Inspector
53
+ @spec={{this.generation.spec}}
54
+ @catalog={{catalog}}
55
+ @streaming={{this.generation.isStreaming}}
56
+ @patches={{this.generation.patches}}
57
+ @streamErrors={{this.generation.errors}}
58
+ @state={{this.state}}
59
+ @errors={{this.errors}}
60
+ />
61
+ </template>
62
+ }
63
+ ```
64
+
65
+ ## Arguments
66
+
67
+ | Argument | Value |
68
+ | --------------- | -------------------------------------------------------------------------------- |
69
+ | `@spec` | The spec. Required. |
70
+ | `@catalog` | Optional. With a catalog, the panel shows the validation issues and the repairs. |
71
+ | `@streaming` | True while the stream is open. Then the validation accepts a partial spec. |
72
+ | `@patches` | `generation.patches`: each patch with its line number. |
73
+ | `@streamErrors` | `generation.errors`: the lines that are not valid patches. |
74
+ | `@state` | The state from `@onStateChange`. Default: the state of the spec. |
75
+ | `@errors` | The errors from `@onError`. |
76
+ | `@label` | The accessible name of the panel. Default: "Marquetry inspector". |
77
+
78
+ Every argument except `@spec` is optional. Without `Generation`, give the spec of your own
79
+ source, for example the spec of an A2UI surface from `@ember-marquetry/a2ui`.
80
+
81
+ The text of the panel is in English. It is a tool for developers, so it does not use the
82
+ translator of the app.
83
+
84
+ ## Keyboard and screen readers
85
+
86
+ - The panel is a region with the name "Marquetry inspector".
87
+ - The tabs are Joinery tabs. Tab moves the focus to the selected tab. The arrow keys move to the
88
+ next and the previous tab.
89
+ - Each table has a caption. The tree of the spec is a nested list.
90
+
91
+ ## Functions
92
+
93
+ `specTree(spec)` gives the tree of a spec. `problems({ spec, catalog, streaming, streamErrors,
94
+ errors })` gives the list of problems. The panel uses them, and you can use them in a test or in
95
+ a log.
96
+
97
+ ## Test support
98
+
99
+ `@ember-marquetry/inspector/test-support` has `InspectorHarness`. A tab shows its content only
100
+ when it is selected, so select the tab before you read its values.
101
+
102
+ ```ts
103
+ import { InspectorHarness } from '@ember-marquetry/inspector/test-support'
104
+
105
+ const inspector = new InspectorHarness()
106
+ await inspector.select('patches')
107
+ await inspector.read('patches').should.deep.include({ line: 1, op: 'add', path: '/root' })
108
+ ```
109
+
110
+ | Member | What it does |
111
+ | ------------------------ | --------------------------------------------------------------- |
112
+ | `tabs`, `selectedTab` | The text of each tab, and the selected tab. |
113
+ | `select(tab)`, `trigger` | Selects a tab: `spec`, `patches`, `state` or `problems`. |
114
+ | `tree`, `spec` | The Spec tab: `{ id, type, depth }` for each element, the spec. |
115
+ | `patches` | The Patches tab: `{ line, op, path }` for each patch. |
116
+ | `state` | The State tab: the state. |
117
+ | `problems` | The Problems tab: `{ source, where, message }` for each one. |
package/addon-main.cjs ADDED
@@ -0,0 +1,4 @@
1
+ 'use strict'
2
+
3
+ const { addonV1Shim } = require('@embroider/addon-shim')
4
+ module.exports = addonV1Shim(__dirname)
@@ -0,0 +1,41 @@
1
+ import Component from '@glimmer/component';
2
+ import type { Spec, StreamError } from '@ember-marquetry/core';
3
+ import type { GenerationPatch, MarquetryError } from '@ember-marquetry/ember';
4
+ import { type InspectorCatalog, type InspectorNode, type Problem } from '../model.ts';
5
+ export interface InspectorSignature {
6
+ Element: HTMLElement;
7
+ Args: {
8
+ /** The spec that `<Render>` shows. */
9
+ spec: Spec;
10
+ /** With a catalog, the inspector shows the validation issues and the repairs. */
11
+ catalog?: InspectorCatalog;
12
+ /** True while the stream is open. Then the validation accepts a partial spec. */
13
+ streaming?: boolean;
14
+ /** The patches with their line numbers: `generation.patches`. */
15
+ patches?: readonly GenerationPatch[];
16
+ /** The lines that are not valid patches: `generation.errors`. */
17
+ streamErrors?: readonly StreamError[];
18
+ /** The state from `@onStateChange` of `<Render>`. Default: the state of the spec. */
19
+ state?: Record<string, unknown>;
20
+ /** The errors that `<Render>` gave to `@onError`. */
21
+ errors?: readonly MarquetryError[];
22
+ /** The accessible name of the panel. Default: "Marquetry inspector". */
23
+ label?: string;
24
+ };
25
+ }
26
+ /**
27
+ * A dev panel for `<Render>`: the tree of the spec, the patches with their line numbers, the
28
+ * state, and the problems. Each value shows as text. The panel never renders HTML from a spec.
29
+ *
30
+ * <Inspector @spec={{g.spec}} @catalog={{catalog}} @streaming={{g.isStreaming}}
31
+ * @patches={{g.patches}} @streamErrors={{g.errors}} @state={{this.state}}
32
+ * @errors={{this.errors}} />
33
+ */
34
+ export declare class Inspector extends Component<InspectorSignature> {
35
+ get label(): string;
36
+ get tree(): InspectorNode[];
37
+ get patches(): readonly GenerationPatch[];
38
+ get state(): Record<string, unknown>;
39
+ get problems(): Problem[];
40
+ }
41
+ //# sourceMappingURL=inspector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../src/components/inspector.gts"],"names":[],"mappings":"AA4MA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAG1C,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,OAAO,EACb,MAAM,aAAa,CAAA;AAEpB,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,WAAW,CAAA;IACpB,IAAI,EAAE;QACJ,sCAAsC;QACtC,IAAI,EAAE,IAAI,CAAA;QACV,iFAAiF;QACjF,OAAO,CAAC,EAAE,gBAAgB,CAAA;QAC1B,iFAAiF;QACjF,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB,iEAAiE;QACjE,OAAO,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;QACpC,iEAAiE;QACjE,YAAY,CAAC,EAAE,SAAS,WAAW,EAAE,CAAA;QACrC,qFAAqF;QACrF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAC/B,qDAAqD;QACrD,MAAM,CAAC,EAAE,SAAS,cAAc,EAAE,CAAA;QAClC,wEAAwE;QACxE,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AA+GD;;;;;;;GAOG;AACH,qBAAa,SAAU,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IAC1D,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,IAAI,IAAI,aAAa,EAAE,CAE1B;IAED,IAAI,OAAO,IAAI,SAAS,eAAe,EAAE,CAExC;IAED,IAAI,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEnC;IAED,IAAI,QAAQ,IAAI,OAAO,EAAE,CAQxB;CAubF"}
@@ -0,0 +1,3 @@
1
+ export { Inspector, type InspectorSignature } from './components/inspector';
2
+ export { problems, specTree, type InspectorCatalog, type InspectorNode, type Problem, type ProblemSource, type ProblemSources, } from './model.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/E,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,YAAY,CAAA"}
@@ -0,0 +1,39 @@
1
+ import type { Catalog, Spec, StreamError } from '@ember-marquetry/core';
2
+ import type { MarquetryError } from '@ember-marquetry/ember';
3
+ /** One element in the tree of the spec. */
4
+ export interface InspectorNode {
5
+ id: string;
6
+ /** The type of the element. Empty when the element does not exist. */
7
+ type: string;
8
+ /** The slot of the parent that has the element. `undefined` for a child. */
9
+ slot: string | undefined;
10
+ /** True when an element refers to this id and there is no element with it. */
11
+ missing: boolean;
12
+ /** True when the element contains itself. The tree stops there. */
13
+ cycle: boolean;
14
+ children: InspectorNode[];
15
+ }
16
+ /** The part of a catalog that the inspector uses. */
17
+ export type InspectorCatalog = Pick<Catalog, 'validate' | 'repair'>;
18
+ /** The tree of the spec from its root: the children, then the slots of each element. */
19
+ export declare function specTree(spec: Spec): InspectorNode[];
20
+ export type ProblemSource = 'Stream' | 'Validation' | 'Repair' | 'Render';
21
+ /** One problem: where it comes from, where it is, and what it is. */
22
+ export interface Problem {
23
+ source: ProblemSource;
24
+ /** An element id, or the line of the stream. */
25
+ where: string;
26
+ message: string;
27
+ }
28
+ export interface ProblemSources {
29
+ spec: Spec;
30
+ catalog?: InspectorCatalog | undefined;
31
+ streaming?: boolean | undefined;
32
+ streamErrors?: readonly StreamError[] | undefined;
33
+ errors?: readonly MarquetryError[] | undefined;
34
+ }
35
+ /** Each problem, in this order: the stream, the validation, the repairs, then `@onError`. */
36
+ export declare function problems(sources: ProblemSources): Problem[];
37
+ /** JSON for a `pre` block. The inspector shows the spec as text, never as HTML. */
38
+ export declare const json: (value: unknown) => string;
39
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAU,IAAI,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,2CAA2C;AAC3C,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAA;IACZ,4EAA4E;IAC5E,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,8EAA8E;IAC9E,OAAO,EAAE,OAAO,CAAA;IAChB,mEAAmE;IACnE,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,aAAa,EAAE,CAAA;CAC1B;AAED,qDAAqD;AACrD,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,QAAQ,CAAC,CAAA;AAQnE,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,aAAa,EAAE,CAmBpD;AAED,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEzE,qEAAqE;AACrE,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,aAAa,CAAA;IACrB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB;AAmBD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACtC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,YAAY,CAAC,EAAE,SAAS,WAAW,EAAE,GAAG,SAAS,CAAA;IACjD,MAAM,CAAC,EAAE,SAAS,cAAc,EAAE,GAAG,SAAS,CAAA;CAC/C;AAED,6FAA6F;AAC7F,wBAAgB,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,EAAE,CAwB3D;AAED,mFAAmF;AACnF,eAAO,MAAM,IAAI,GAAI,OAAO,OAAO,KAAG,MAAuD,CAAA"}
@@ -0,0 +1,46 @@
1
+ import { Harness } from '@ember-marquetry/test-support';
2
+ /** The tabs of the inspector. */
3
+ export type InspectorTab = 'spec' | 'patches' | 'state' | 'problems';
4
+ /**
5
+ * Reads the `<Inspector>` of `@ember-marquetry/inspector`. A tab shows its content only when it
6
+ * is selected, so select the tab before you read its values.
7
+ *
8
+ * const inspector = new InspectorHarness()
9
+ * await inspector.select('patches')
10
+ * await inspector.read('patches').should.deep.include({ line: 1, op: 'add', path: '/root' })
11
+ */
12
+ export declare class InspectorHarness extends Harness {
13
+ /** The panel. Throws when no inspector shows. */
14
+ get element(): HTMLElement;
15
+ /** The tab of a part. */
16
+ trigger(tab: InspectorTab): HTMLElement;
17
+ /** The text of each tab, such as `Patches (3)`. */
18
+ get tabs(): string[];
19
+ /** The tab that is selected. */
20
+ get selectedTab(): InspectorTab | null;
21
+ select(tab: InspectorTab): Promise<void>;
22
+ /** The Spec tab: each element of the tree, in document order, with its depth from 0. */
23
+ get tree(): {
24
+ id: string;
25
+ type: string;
26
+ depth: number;
27
+ }[];
28
+ /** The Spec tab: the spec, parsed from its JSON. */
29
+ get spec(): unknown;
30
+ /** The State tab: the state, parsed from its JSON. */
31
+ get state(): unknown;
32
+ /** The Patches tab: the line, the operation and the path of each patch. */
33
+ get patches(): {
34
+ line: number;
35
+ op: string;
36
+ path: string;
37
+ }[];
38
+ /** The Problems tab: each problem, in order. */
39
+ get problems(): {
40
+ source: string;
41
+ where: string;
42
+ message: string;
43
+ }[];
44
+ private json;
45
+ }
46
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-support/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AAEvD,iCAAiC;AACjC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAA;AAKpE;;;;;;;GAOG;AACH,qBAAa,gBAAiB,SAAQ,OAAO;IAC3C,iDAAiD;IACjD,IAAI,OAAO,IAAI,WAAW,CAEzB;IAED,yBAAyB;IACzB,OAAO,CAAC,GAAG,EAAE,YAAY,GAAG,WAAW;IAIvC,mDAAmD;IACnD,IAAI,IAAI,IAAI,MAAM,EAAE,CAEnB;IAED,gCAAgC;IAChC,IAAI,WAAW,IAAI,YAAY,GAAG,IAAI,CAKrC;IAEK,MAAM,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C,wFAAwF;IACxF,IAAI,IAAI,IAAI;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAMxD;IAED,oDAAoD;IACpD,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,sDAAsD;IACtD,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,2EAA2E;IAC3E,IAAI,OAAO,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAM1D;IAED,gDAAgD;IAChD,IAAI,QAAQ,IAAI;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAMnE;IAED,OAAO,CAAC,IAAI;CAIb"}
package/dist/index.js ADDED
@@ -0,0 +1,170 @@
1
+ import Component from '@glimmer/component';
2
+ import { Badge, Table, ScrollArea, Tabs } from '@ember-joinery/ember';
3
+ import { precompileTemplate } from '@ember/template-compilation';
4
+ import { setComponentTemplate } from '@ember/component';
5
+ import templateOnly from '@ember/component/template-only';
6
+
7
+ /** One element in the tree of the spec. */
8
+
9
+ /** The part of a catalog that the inspector uses. */
10
+
11
+ const ids = value => Array.isArray(value) ? value.filter(id => typeof id === 'string') : [];
12
+ const isObject = value => typeof value === 'object' && value !== null && !Array.isArray(value);
13
+
14
+ /** The tree of the spec from its root: the children, then the slots of each element. */
15
+ function specTree(spec) {
16
+ if (typeof spec.root !== 'string') return [];
17
+ const visit = (id, slot, ancestors) => {
18
+ const element = Object.hasOwn(spec.elements, id) ? spec.elements[id] : undefined;
19
+ const type = isObject(element) ? String(element['type']) : '';
20
+ const cycle = ancestors.has(id);
21
+ const node = {
22
+ id,
23
+ type,
24
+ slot,
25
+ missing: !isObject(element),
26
+ cycle,
27
+ children: []
28
+ };
29
+ if (!isObject(element) || cycle) return node;
30
+ const below = new Set(ancestors).add(id);
31
+ const slots = isObject(element['slots']) ? Object.entries(element['slots']) : [];
32
+ return {
33
+ ...node,
34
+ children: [...ids(element['children']).map(child => visit(child, undefined, below)), ...slots.flatMap(([name, list]) => ids(list).map(child => visit(child, name, below)))]
35
+ };
36
+ };
37
+ return [visit(spec.root, undefined, new Set())];
38
+ }
39
+
40
+ /** One problem: where it comes from, where it is, and what it is. */
41
+
42
+ function repairMessage(repair) {
43
+ switch (repair.kind) {
44
+ case 'removed-prop':
45
+ return `Removed the prop "${repair.prop}"`;
46
+ case 'coerced-prop':
47
+ return `Changed the prop "${repair.prop}" from ${JSON.stringify(repair.from)} to ${JSON.stringify(repair.to)}`;
48
+ case 'removed-child':
49
+ return `Removed the child "${repair.child}"`;
50
+ case 'removed-slot':
51
+ return `Removed the slot "${repair.slot}"`;
52
+ case 'removed-event':
53
+ return `Removed the event "${repair.event}"`;
54
+ case 'removed-action':
55
+ return `Removed the action "${repair.action}" of the event "${repair.event}"`;
56
+ }
57
+ }
58
+ /** Each problem, in this order: the stream, the validation, the repairs, then `@onError`. */
59
+ function problems(sources) {
60
+ const {
61
+ spec,
62
+ catalog
63
+ } = sources;
64
+ const partial = sources.streaming ?? false;
65
+ const out = (sources.streamErrors ?? []).map(error => ({
66
+ source: 'Stream',
67
+ where: `line ${error.line}`,
68
+ message: error.message
69
+ }));
70
+ if (catalog) {
71
+ for (const issue of catalog.validate(spec, {
72
+ partial
73
+ })) {
74
+ out.push({
75
+ source: 'Validation',
76
+ where: issue.elementId ?? 'spec',
77
+ message: issue.message
78
+ });
79
+ }
80
+ for (const repair of catalog.repair(spec, {
81
+ partial
82
+ }).repairs) {
83
+ out.push({
84
+ source: 'Repair',
85
+ where: repair.elementId,
86
+ message: repairMessage(repair)
87
+ });
88
+ }
89
+ }
90
+ for (const error of sources.errors ?? []) {
91
+ out.push({
92
+ source: 'Render',
93
+ where: error.elementId ?? error.action ?? '',
94
+ message: `${error.code}: ${error.message}`
95
+ });
96
+ }
97
+ return out;
98
+ }
99
+
100
+ /** JSON for a `pre` block. The inspector shows the spec as text, never as HTML. */
101
+ const json = value => JSON.stringify(value, null, 2) ?? 'undefined';
102
+
103
+ const NONE = [];
104
+ const next = depth => depth + 1;
105
+ const value = patch => 'value' in patch.op ? json(patch.op.value) : '';
106
+ /**
107
+ * One element of the tree, and its children in a list below it. "missing" and "cycle" use the
108
+ * outline badge: the destructive badge of Joinery is under 4.5:1 in dark mode
109
+ * (docs/prd/2026-12-01-marquetry-plan/index.html, Risks).
110
+ */
111
+ const TreeNode = setComponentTemplate(precompileTemplate("<li data-test-mq-inspector-node={{@node.id}} data-depth={{@depth}}>\n <code>{{@node.id}}</code>\n {{#if @node.missing}}\n <Badge @variant=\"outline\">missing</Badge>\n {{else}}\n <Badge @variant=\"secondary\" data-test-mq-inspector-type>{{@node.type}}</Badge>\n {{/if}}\n {{#if @node.slot}}<span>in slot <code>{{@node.slot}}</code></span>{{/if}}\n {{#if @node.cycle}}<Badge @variant=\"outline\">cycle</Badge>{{/if}}\n {{#if @node.children.length}}\n <ul>\n {{#each @node.children as |child|}}\n <TreeNode @node={{child}} @depth={{next @depth}} />\n {{/each}}\n </ul>\n {{/if}}\n</li>", {
112
+ strictMode: true,
113
+ scope: () => ({
114
+ Badge,
115
+ TreeNode,
116
+ next
117
+ })
118
+ }), templateOnly());
119
+ const Empty = setComponentTemplate(precompileTemplate("<p style=\"margin: 0.5rem 0;\">{{yield}}</p>", {
120
+ strictMode: true
121
+ }), templateOnly());
122
+ /**
123
+ * A dev panel for `<Render>`: the tree of the spec, the patches with their line numbers, the
124
+ * state, and the problems. Each value shows as text. The panel never renders HTML from a spec.
125
+ *
126
+ * <Inspector @spec={{g.spec}} @catalog={{catalog}} @streaming={{g.isStreaming}}
127
+ * @patches={{g.patches}} @streamErrors={{g.errors}} @state={{this.state}}
128
+ * @errors={{this.errors}} />
129
+ */
130
+ class Inspector extends Component {
131
+ get label() {
132
+ return this.args.label ?? 'Marquetry inspector';
133
+ }
134
+ get tree() {
135
+ return specTree(this.args.spec);
136
+ }
137
+ get patches() {
138
+ return this.args.patches ?? NONE;
139
+ }
140
+ get state() {
141
+ return this.args.state ?? this.args.spec.state;
142
+ }
143
+ get problems() {
144
+ return problems({
145
+ spec: this.args.spec,
146
+ catalog: this.args.catalog,
147
+ streaming: this.args.streaming,
148
+ streamErrors: this.args.streamErrors,
149
+ errors: this.args.errors
150
+ });
151
+ }
152
+ static {
153
+ setComponentTemplate(precompileTemplate("<section class=\"mq-inspector\" aria-label={{this.label}} data-test-mq-inspector ...attributes>\n <Tabs @defaultValue=\"spec\" as |tabs|>\n <tabs.List aria-label={{this.label}}>\n <tabs.Trigger @value=\"spec\" data-test-mq-inspector-tab=\"spec\">Spec</tabs.Trigger>\n <tabs.Trigger @value=\"patches\" data-test-mq-inspector-tab=\"patches\">\n Patches ({{this.patches.length}})\n </tabs.Trigger>\n <tabs.Trigger @value=\"state\" data-test-mq-inspector-tab=\"state\">State</tabs.Trigger>\n <tabs.Trigger @value=\"problems\" data-test-mq-inspector-tab=\"problems\">\n Problems ({{this.problems.length}})\n </tabs.Trigger>\n </tabs.List>\n\n <tabs.Content @value=\"spec\">\n <ScrollArea style=\"height: 24rem;\">\n {{#if this.tree.length}}\n <ul data-test-mq-inspector-tree>\n {{#each this.tree as |node|}}<TreeNode @node={{node}} @depth={{0}} />{{/each}}\n </ul>\n {{else}}\n <Empty>The spec has no root element.</Empty>\n {{/if}}\n <pre data-test-mq-inspector-json=\"spec\" style=\"margin: 0; font-size: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere;\">{{json @spec}}</pre>\n </ScrollArea>\n </tabs.Content>\n\n <tabs.Content @value=\"patches\">\n <ScrollArea style=\"height: 24rem;\">\n {{#if this.patches.length}}\n <Table as |table|>\n <table.Caption>The patches of the stream, in order.</table.Caption>\n <table.Header>\n <table.Row>\n <table.Head>Line</table.Head>\n <table.Head>Operation</table.Head>\n <table.Head>Path</table.Head>\n <table.Head>Value</table.Head>\n </table.Row>\n </table.Header>\n <table.Body>\n {{#each this.patches as |patch|}}\n <table.Row data-test-mq-inspector-patch>\n <table.Cell data-test-line>{{patch.line}}</table.Cell>\n <table.Cell data-test-op>{{patch.op.op}}</table.Cell>\n <table.Cell data-test-path><code>{{patch.op.path}}</code></table.Cell>\n <table.Cell><pre style=\"margin: 0; font-size: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere;\">{{value patch}}</pre></table.Cell>\n </table.Row>\n {{/each}}\n </table.Body>\n </Table>\n {{else}}\n <Empty>No patches.</Empty>\n {{/if}}\n </ScrollArea>\n </tabs.Content>\n\n <tabs.Content @value=\"state\">\n <ScrollArea style=\"height: 24rem;\">\n <pre data-test-mq-inspector-json=\"state\" style=\"margin: 0; font-size: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere;\">{{json this.state}}</pre>\n </ScrollArea>\n </tabs.Content>\n\n <tabs.Content @value=\"problems\">\n <ScrollArea style=\"height: 24rem;\">\n {{#if this.problems.length}}\n <Table as |table|>\n <table.Caption>The problems of the spec, the stream and the render.</table.Caption>\n <table.Header>\n <table.Row>\n <table.Head>Source</table.Head>\n <table.Head>Where</table.Head>\n <table.Head>Message</table.Head>\n </table.Row>\n </table.Header>\n <table.Body>\n {{#each this.problems as |problem|}}\n <table.Row data-test-mq-inspector-problem>\n <table.Cell data-test-source>\n <Badge @variant=\"outline\">{{problem.source}}</Badge>\n </table.Cell>\n <table.Cell data-test-where><code>{{problem.where}}</code></table.Cell>\n <table.Cell data-test-message>{{problem.message}}</table.Cell>\n </table.Row>\n {{/each}}\n </table.Body>\n </Table>\n {{else}}\n <Empty>No problems.</Empty>\n {{/if}}\n </ScrollArea>\n </tabs.Content>\n </Tabs>\n</section>", {
154
+ strictMode: true,
155
+ scope: () => ({
156
+ Tabs,
157
+ ScrollArea,
158
+ TreeNode,
159
+ Empty,
160
+ json,
161
+ Table,
162
+ value,
163
+ Badge
164
+ })
165
+ }), this);
166
+ }
167
+ }
168
+
169
+ export { Inspector, problems, specTree };
170
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/model.ts","../src/components/inspector.gts"],"sourcesContent":["import type { Catalog, Repair, Spec, StreamError } from '@ember-marquetry/core'\nimport type { MarquetryError } from '@ember-marquetry/ember'\n\n/** One element in the tree of the spec. */\nexport interface InspectorNode {\n id: string\n /** The type of the element. Empty when the element does not exist. */\n type: string\n /** The slot of the parent that has the element. `undefined` for a child. */\n slot: string | undefined\n /** True when an element refers to this id and there is no element with it. */\n missing: boolean\n /** True when the element contains itself. The tree stops there. */\n cycle: boolean\n children: InspectorNode[]\n}\n\n/** The part of a catalog that the inspector uses. */\nexport type InspectorCatalog = Pick<Catalog, 'validate' | 'repair'>\n\nconst ids = (value: unknown): string[] =>\n Array.isArray(value) ? value.filter((id): id is string => typeof id === 'string') : []\n\nconst isObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value)\n\n/** The tree of the spec from its root: the children, then the slots of each element. */\nexport function specTree(spec: Spec): InspectorNode[] {\n if (typeof spec.root !== 'string') return []\n const visit = (id: string, slot: string | undefined, ancestors: Set<string>): InspectorNode => {\n const element: unknown = Object.hasOwn(spec.elements, id) ? spec.elements[id] : undefined\n const type = isObject(element) ? String(element['type']) : ''\n const cycle = ancestors.has(id)\n const node = { id, type, slot, missing: !isObject(element), cycle, children: [] }\n if (!isObject(element) || cycle) return node\n const below = new Set(ancestors).add(id)\n const slots = isObject(element['slots']) ? Object.entries(element['slots']) : []\n return {\n ...node,\n children: [\n ...ids(element['children']).map(child => visit(child, undefined, below)),\n ...slots.flatMap(([name, list]) => ids(list).map(child => visit(child, name, below))),\n ],\n }\n }\n return [visit(spec.root, undefined, new Set())]\n}\n\nexport type ProblemSource = 'Stream' | 'Validation' | 'Repair' | 'Render'\n\n/** One problem: where it comes from, where it is, and what it is. */\nexport interface Problem {\n source: ProblemSource\n /** An element id, or the line of the stream. */\n where: string\n message: string\n}\n\nfunction repairMessage(repair: Repair): string {\n switch (repair.kind) {\n case 'removed-prop':\n return `Removed the prop \"${repair.prop}\"`\n case 'coerced-prop':\n return `Changed the prop \"${repair.prop}\" from ${JSON.stringify(repair.from)} to ${JSON.stringify(repair.to)}`\n case 'removed-child':\n return `Removed the child \"${repair.child}\"`\n case 'removed-slot':\n return `Removed the slot \"${repair.slot}\"`\n case 'removed-event':\n return `Removed the event \"${repair.event}\"`\n case 'removed-action':\n return `Removed the action \"${repair.action}\" of the event \"${repair.event}\"`\n }\n}\n\nexport interface ProblemSources {\n spec: Spec\n catalog?: InspectorCatalog | undefined\n streaming?: boolean | undefined\n streamErrors?: readonly StreamError[] | undefined\n errors?: readonly MarquetryError[] | undefined\n}\n\n/** Each problem, in this order: the stream, the validation, the repairs, then `@onError`. */\nexport function problems(sources: ProblemSources): Problem[] {\n const { spec, catalog } = sources\n const partial = sources.streaming ?? false\n const out: Problem[] = (sources.streamErrors ?? []).map(error => ({\n source: 'Stream',\n where: `line ${error.line}`,\n message: error.message,\n }))\n if (catalog) {\n for (const issue of catalog.validate(spec, { partial })) {\n out.push({ source: 'Validation', where: issue.elementId ?? 'spec', message: issue.message })\n }\n for (const repair of catalog.repair(spec, { partial }).repairs) {\n out.push({ source: 'Repair', where: repair.elementId, message: repairMessage(repair) })\n }\n }\n for (const error of sources.errors ?? []) {\n out.push({\n source: 'Render',\n where: error.elementId ?? error.action ?? '',\n message: `${error.code}: ${error.message}`,\n })\n }\n return out\n}\n\n/** JSON for a `pre` block. The inspector shows the spec as text, never as HTML. */\nexport const json = (value: unknown): string => JSON.stringify(value, null, 2) ?? 'undefined'\n","import Component from '@glimmer/component'\nimport type { TOC } from '@ember/component/template-only'\nimport { Badge, ScrollArea, Table, Tabs } from '@ember-joinery/ember'\nimport type { Spec, StreamError } from '@ember-marquetry/core'\nimport type { GenerationPatch, MarquetryError } from '@ember-marquetry/ember'\nimport {\n json,\n problems,\n specTree,\n type InspectorCatalog,\n type InspectorNode,\n type Problem,\n} from '../model.ts'\n\nexport interface InspectorSignature {\n Element: HTMLElement\n Args: {\n /** The spec that `<Render>` shows. */\n spec: Spec\n /** With a catalog, the inspector shows the validation issues and the repairs. */\n catalog?: InspectorCatalog\n /** True while the stream is open. Then the validation accepts a partial spec. */\n streaming?: boolean\n /** The patches with their line numbers: `generation.patches`. */\n patches?: readonly GenerationPatch[]\n /** The lines that are not valid patches: `generation.errors`. */\n streamErrors?: readonly StreamError[]\n /** The state from `@onStateChange` of `<Render>`. Default: the state of the spec. */\n state?: Record<string, unknown>\n /** The errors that `<Render>` gave to `@onError`. */\n errors?: readonly MarquetryError[]\n /** The accessible name of the panel. Default: \"Marquetry inspector\". */\n label?: string\n }\n}\n\nconst NONE: readonly never[] = []\nconst next = (depth: number): number => depth + 1\nconst value = (patch: GenerationPatch): string => ('value' in patch.op ? json(patch.op.value) : '')\n\ninterface NodeSignature {\n Args: { node: InspectorNode; depth: number }\n}\n\n/**\n * One element of the tree, and its children in a list below it. \"missing\" and \"cycle\" use the\n * outline badge: the destructive badge of Joinery is under 4.5:1 in dark mode\n * (docs/prd/2026-12-01-marquetry-plan/index.html, Risks).\n */\nconst TreeNode: TOC<NodeSignature> = <template>\n <li data-test-mq-inspector-node={{@node.id}} data-depth={{@depth}}>\n <code>{{@node.id}}</code>\n {{#if @node.missing}}\n <Badge @variant=\"outline\">missing</Badge>\n {{else}}\n <Badge @variant=\"secondary\" data-test-mq-inspector-type>{{@node.type}}</Badge>\n {{/if}}\n {{#if @node.slot}}<span>in slot <code>{{@node.slot}}</code></span>{{/if}}\n {{#if @node.cycle}}<Badge @variant=\"outline\">cycle</Badge>{{/if}}\n {{#if @node.children.length}}\n <ul>\n {{#each @node.children as |child|}}\n <TreeNode @node={{child}} @depth={{next @depth}} />\n {{/each}}\n </ul>\n {{/if}}\n </li>\n</template>\n\nconst Empty: TOC<{ Blocks: { default: [] } }> = <template>\n <p style=\"margin: 0.5rem 0;\">{{yield}}</p>\n</template>\n\n/**\n * A dev panel for `<Render>`: the tree of the spec, the patches with their line numbers, the\n * state, and the problems. Each value shows as text. The panel never renders HTML from a spec.\n *\n * <Inspector @spec={{g.spec}} @catalog={{catalog}} @streaming={{g.isStreaming}}\n * @patches={{g.patches}} @streamErrors={{g.errors}} @state={{this.state}}\n * @errors={{this.errors}} />\n */\nexport class Inspector extends Component<InspectorSignature> {\n get label(): string {\n return this.args.label ?? 'Marquetry inspector'\n }\n\n get tree(): InspectorNode[] {\n return specTree(this.args.spec)\n }\n\n get patches(): readonly GenerationPatch[] {\n return this.args.patches ?? NONE\n }\n\n get state(): Record<string, unknown> {\n return this.args.state ?? this.args.spec.state\n }\n\n get problems(): Problem[] {\n return problems({\n spec: this.args.spec,\n catalog: this.args.catalog,\n streaming: this.args.streaming,\n streamErrors: this.args.streamErrors,\n errors: this.args.errors,\n })\n }\n\n <template>\n <section class=\"mq-inspector\" aria-label={{this.label}} data-test-mq-inspector ...attributes>\n <Tabs @defaultValue=\"spec\" as |tabs|>\n <tabs.List aria-label={{this.label}}>\n <tabs.Trigger @value=\"spec\" data-test-mq-inspector-tab=\"spec\">Spec</tabs.Trigger>\n <tabs.Trigger @value=\"patches\" data-test-mq-inspector-tab=\"patches\">\n Patches ({{this.patches.length}})\n </tabs.Trigger>\n <tabs.Trigger @value=\"state\" data-test-mq-inspector-tab=\"state\">State</tabs.Trigger>\n <tabs.Trigger @value=\"problems\" data-test-mq-inspector-tab=\"problems\">\n Problems ({{this.problems.length}})\n </tabs.Trigger>\n </tabs.List>\n\n <tabs.Content @value=\"spec\">\n <ScrollArea style=\"height: 24rem;\">\n {{#if this.tree.length}}\n <ul data-test-mq-inspector-tree>\n {{#each this.tree as |node|}}<TreeNode @node={{node}} @depth={{0}} />{{/each}}\n </ul>\n {{else}}\n <Empty>The spec has no root element.</Empty>\n {{/if}}\n <pre data-test-mq-inspector-json=\"spec\" style=\"margin: 0; font-size: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere;\">{{json @spec}}</pre>\n </ScrollArea>\n </tabs.Content>\n\n <tabs.Content @value=\"patches\">\n <ScrollArea style=\"height: 24rem;\">\n {{#if this.patches.length}}\n <Table as |table|>\n <table.Caption>The patches of the stream, in order.</table.Caption>\n <table.Header>\n <table.Row>\n <table.Head>Line</table.Head>\n <table.Head>Operation</table.Head>\n <table.Head>Path</table.Head>\n <table.Head>Value</table.Head>\n </table.Row>\n </table.Header>\n <table.Body>\n {{#each this.patches as |patch|}}\n <table.Row data-test-mq-inspector-patch>\n <table.Cell data-test-line>{{patch.line}}</table.Cell>\n <table.Cell data-test-op>{{patch.op.op}}</table.Cell>\n <table.Cell data-test-path><code>{{patch.op.path}}</code></table.Cell>\n <table.Cell><pre style=\"margin: 0; font-size: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere;\">{{value patch}}</pre></table.Cell>\n </table.Row>\n {{/each}}\n </table.Body>\n </Table>\n {{else}}\n <Empty>No patches.</Empty>\n {{/if}}\n </ScrollArea>\n </tabs.Content>\n\n <tabs.Content @value=\"state\">\n <ScrollArea style=\"height: 24rem;\">\n <pre data-test-mq-inspector-json=\"state\" style=\"margin: 0; font-size: 0.75rem; white-space: pre-wrap; overflow-wrap: anywhere;\">{{json this.state}}</pre>\n </ScrollArea>\n </tabs.Content>\n\n <tabs.Content @value=\"problems\">\n <ScrollArea style=\"height: 24rem;\">\n {{#if this.problems.length}}\n <Table as |table|>\n <table.Caption>The problems of the spec, the stream and the render.</table.Caption>\n <table.Header>\n <table.Row>\n <table.Head>Source</table.Head>\n <table.Head>Where</table.Head>\n <table.Head>Message</table.Head>\n </table.Row>\n </table.Header>\n <table.Body>\n {{#each this.problems as |problem|}}\n <table.Row data-test-mq-inspector-problem>\n <table.Cell data-test-source>\n <Badge @variant=\"outline\">{{problem.source}}</Badge>\n </table.Cell>\n <table.Cell data-test-where><code>{{problem.where}}</code></table.Cell>\n <table.Cell data-test-message>{{problem.message}}</table.Cell>\n </table.Row>\n {{/each}}\n </table.Body>\n </Table>\n {{else}}\n <Empty>No problems.</Empty>\n {{/if}}\n </ScrollArea>\n </tabs.Content>\n </Tabs>\n </section>\n </template>\n}\n"],"names":["ids","value","Array","isArray","filter","id","isObject","specTree","spec","root","visit","slot","ancestors","element","Object","hasOwn","elements","undefined","type","String","cycle","has","node","missing","children","below","Set","add","slots","entries","map","child","flatMap","name","list","repairMessage","repair","kind","prop","JSON","stringify","from","to","event","action","problems","sources","catalog","partial","streaming","out","streamErrors","error","source","where","line","message","issue","validate","push","elementId","repairs","errors","code","json","NONE","next","depth","patch","op","TreeNode","setComponentTemplate","precompileTemplate","strictMode","scope","Badge","templateOnly","Empty","Inspector","Component","label","args","tree","patches","state","Tabs","ScrollArea","Table"],"mappings":";;;;;;AAGA;;AAcA;;AAGA,MAAMA,GAAG,GAAIC,KAAc,IACzBC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,GAAGA,KAAK,CAACG,MAAM,CAAEC,EAAE,IAAmB,OAAOA,EAAE,KAAK,QAAQ,CAAC,GAAG,EAAE;AAExF,MAAMC,QAAQ,GAAI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AsC;AACxC,IAAA,OAAO,IAAI,CAACF,IAAI,CAACE,OAAO,IAAIlB,IAAA;AAC9B,EAAA;EAEA,IAAImB,KAAAA,GAAiC;AACnC,IAAA,OAAO,IAAI,CAACH,IAAI,CAACG,KAAK,IAAI,IAAI,CAACH,IAAI,CAACzE,IAAI,CAAC4E,KAAK;AAChD,EAAA;EAEA,IAAIvC,WAAsB;AACxB,IAAA,OAAOA,QAAA,CAAS;AACdrC,MAAAA,IAAA,EAAM,IAAI,CAACyE,IAAI,CAACzE,IAAI;AACpBuC,MAAAA,OAAA,EAAS,IAAI,CAACkC,IAAI,CAAClC,OAAO;AAC1BE,MAAAA,SAAA,EAAW,IAAI,CAACgC,IAAI,CAAChC,SAAS;AAC9BE,MAAAA,YAAA,EAAc,IAAI,CAAC8B,IAAI,CAAC9B,YAAY;AACpCW,MAAAA,MAAA,EAAQ,IAAI,CAACmB,IAAI,CAACnB;AACpB,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAS,oBAAA,CAAAC,kBAAA,CAAA,m9HAAA,EA8FA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAW,IAAA;QAAAC,UAAA;QAAAhB,QAAA;QAAAO,KAAA;QAAAb,IAAA;QAAAuB,KAAA;QAAAtF,KAAA;AAAA0E,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
@@ -0,0 +1,83 @@
1
+ import { Harness } from '@ember-marquetry/test-support';
2
+
3
+ /** The tabs of the inspector. */
4
+
5
+ const text = element => element?.textContent?.replace(/\s+/g, ' ').trim() ?? '';
6
+
7
+ /**
8
+ * Reads the `<Inspector>` of `@ember-marquetry/inspector`. A tab shows its content only when it
9
+ * is selected, so select the tab before you read its values.
10
+ *
11
+ * const inspector = new InspectorHarness()
12
+ * await inspector.select('patches')
13
+ * await inspector.read('patches').should.deep.include({ line: 1, op: 'add', path: '/root' })
14
+ */
15
+ class InspectorHarness extends Harness {
16
+ /** The panel. Throws when no inspector shows. */
17
+ get element() {
18
+ return this.query('[data-test-mq-inspector]', 'inspector');
19
+ }
20
+
21
+ /** The tab of a part. */
22
+ trigger(tab) {
23
+ return this.query(`[data-test-mq-inspector-tab="${tab}"]`, `inspector tab "${tab}"`);
24
+ }
25
+
26
+ /** The text of each tab, such as `Patches (3)`. */
27
+ get tabs() {
28
+ return this.queryAll('[data-test-mq-inspector-tab]').map(tab => text(tab));
29
+ }
30
+
31
+ /** The tab that is selected. */
32
+ get selectedTab() {
33
+ const tab = this.queryAll('[data-test-mq-inspector-tab]').find(element => element.getAttribute('aria-selected') === 'true');
34
+ return tab?.dataset['testMqInspectorTab'] ?? null;
35
+ }
36
+ async select(tab) {
37
+ await this.clickOn(this.trigger(tab));
38
+ }
39
+
40
+ /** The Spec tab: each element of the tree, in document order, with its depth from 0. */
41
+ get tree() {
42
+ return this.queryAll('[data-test-mq-inspector-node]').map(node => ({
43
+ id: node.dataset['testMqInspectorNode'] ?? '',
44
+ type: text(node.querySelector(':scope > [data-test-mq-inspector-type]')),
45
+ depth: Number(node.dataset['depth'])
46
+ }));
47
+ }
48
+
49
+ /** The Spec tab: the spec, parsed from its JSON. */
50
+ get spec() {
51
+ return this.json('spec');
52
+ }
53
+
54
+ /** The State tab: the state, parsed from its JSON. */
55
+ get state() {
56
+ return this.json('state');
57
+ }
58
+
59
+ /** The Patches tab: the line, the operation and the path of each patch. */
60
+ get patches() {
61
+ return this.queryAll('[data-test-mq-inspector-patch]').map(row => ({
62
+ line: Number(text(row.querySelector('[data-test-line]'))),
63
+ op: text(row.querySelector('[data-test-op]')),
64
+ path: text(row.querySelector('[data-test-path]'))
65
+ }));
66
+ }
67
+
68
+ /** The Problems tab: each problem, in order. */
69
+ get problems() {
70
+ return this.queryAll('[data-test-mq-inspector-problem]').map(row => ({
71
+ source: text(row.querySelector('[data-test-source]')),
72
+ where: text(row.querySelector('[data-test-where]')),
73
+ message: text(row.querySelector('[data-test-message]'))
74
+ }));
75
+ }
76
+ json(name) {
77
+ const pre = this.query(`[data-test-mq-inspector-json="${name}"]`, `the ${name} JSON`);
78
+ return JSON.parse(pre.textContent ?? '');
79
+ }
80
+ }
81
+
82
+ export { InspectorHarness };
83
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/test-support/index.ts"],"sourcesContent":["import { Harness } from '@ember-marquetry/test-support'\n\n/** The tabs of the inspector. */\nexport type InspectorTab = 'spec' | 'patches' | 'state' | 'problems'\n\nconst text = (element: Element | null | undefined): string =>\n element?.textContent?.replace(/\\s+/g, ' ').trim() ?? ''\n\n/**\n * Reads the `<Inspector>` of `@ember-marquetry/inspector`. A tab shows its content only when it\n * is selected, so select the tab before you read its values.\n *\n * const inspector = new InspectorHarness()\n * await inspector.select('patches')\n * await inspector.read('patches').should.deep.include({ line: 1, op: 'add', path: '/root' })\n */\nexport class InspectorHarness extends Harness {\n /** The panel. Throws when no inspector shows. */\n get element(): HTMLElement {\n return this.query('[data-test-mq-inspector]', 'inspector')\n }\n\n /** The tab of a part. */\n trigger(tab: InspectorTab): HTMLElement {\n return this.query(`[data-test-mq-inspector-tab=\"${tab}\"]`, `inspector tab \"${tab}\"`)\n }\n\n /** The text of each tab, such as `Patches (3)`. */\n get tabs(): string[] {\n return this.queryAll('[data-test-mq-inspector-tab]').map(tab => text(tab))\n }\n\n /** The tab that is selected. */\n get selectedTab(): InspectorTab | null {\n const tab = this.queryAll('[data-test-mq-inspector-tab]').find(\n element => element.getAttribute('aria-selected') === 'true',\n )\n return (tab?.dataset['testMqInspectorTab'] as InspectorTab | undefined) ?? null\n }\n\n async select(tab: InspectorTab): Promise<void> {\n await this.clickOn(this.trigger(tab))\n }\n\n /** The Spec tab: each element of the tree, in document order, with its depth from 0. */\n get tree(): { id: string; type: string; depth: number }[] {\n return this.queryAll('[data-test-mq-inspector-node]').map(node => ({\n id: node.dataset['testMqInspectorNode'] ?? '',\n type: text(node.querySelector(':scope > [data-test-mq-inspector-type]')),\n depth: Number(node.dataset['depth']),\n }))\n }\n\n /** The Spec tab: the spec, parsed from its JSON. */\n get spec(): unknown {\n return this.json('spec')\n }\n\n /** The State tab: the state, parsed from its JSON. */\n get state(): unknown {\n return this.json('state')\n }\n\n /** The Patches tab: the line, the operation and the path of each patch. */\n get patches(): { line: number; op: string; path: string }[] {\n return this.queryAll('[data-test-mq-inspector-patch]').map(row => ({\n line: Number(text(row.querySelector('[data-test-line]'))),\n op: text(row.querySelector('[data-test-op]')),\n path: text(row.querySelector('[data-test-path]')),\n }))\n }\n\n /** The Problems tab: each problem, in order. */\n get problems(): { source: string; where: string; message: string }[] {\n return this.queryAll('[data-test-mq-inspector-problem]').map(row => ({\n source: text(row.querySelector('[data-test-source]')),\n where: text(row.querySelector('[data-test-where]')),\n message: text(row.querySelector('[data-test-message]')),\n }))\n }\n\n private json(name: 'spec' | 'state'): unknown {\n const pre = this.query(`[data-test-mq-inspector-json=\"${name}\"]`, `the ${name} JSON`)\n return JSON.parse(pre.textContent ?? '') as unknown\n }\n}\n"],"names":["text","element","textContent","replace","trim","InspectorHarness","Harness","query","trigger","tab","tabs","queryAll","map","selectedTab","find","getAttribute","dataset","select","clickOn","tree","node","id","type","querySelector","depth","Number","spec","json","state","patches","row","line","op","path","problems","source","where","message","name","pre","JSON","parse"],"mappings":";;AAEA;;AAGA,MAAMA,IAAI,GAAIC,OAAmC,IAC/CA,OAAO,EAAEC,WAAW,EAAEC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAACC,IAAI,EAAE,IAAI,EAAE;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,gBAAgB,SAASC,OAAO,CAAC;AAC5C;EACA,IAAIL,OAAOA,GAAgB;AACzB,IAAA,OAAO,IAAI,CAACM,KAAK,CAAC,0BAA0B,EAAE,WAAW,CAAC;AAC5D,EAAA;;AAEA;EACAC,OAAOA,CAACC,GAAiB,EAAe;IACtC,OAAO,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- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "2.0.0",
4
+ "description": "A dev panel for Marquetry: the spec, the patches, the state and the errors of a <Render>.",
5
+ "keywords": [
6
+ "ember-addon",
7
+ "ember",
8
+ "generative-ui",
9
+ "genui",
10
+ "devtools",
11
+ "inspector"
12
+ ],
13
+ "license": "MIT",
14
+ "author": "Joe Gaudet <joe@joegaudet.com>",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/joegaudet/ember-marquetry.git",
18
+ "directory": "packages/inspector"
19
+ },
20
+ "homepage": "https://joegaudet.com/ember-marquetry/",
21
+ "bugs": "https://github.com/joegaudet/ember-marquetry/issues",
22
+ "exports": {
23
+ ".": {
24
+ "types": "./declarations/index.d.ts",
25
+ "default": "./dist/index.js"
26
+ },
27
+ "./test-support": {
28
+ "types": "./declarations/test-support/index.d.ts",
29
+ "default": "./dist/test-support/index.js"
30
+ },
31
+ "./addon-main.js": "./addon-main.cjs"
32
+ },
33
+ "typesVersions": {
34
+ "*": {
35
+ "*": [
36
+ "declarations/*"
37
+ ]
38
+ }
39
+ },
40
+ "files": [
41
+ "addon-main.cjs",
42
+ "declarations",
43
+ "dist",
44
+ "README.md",
45
+ "CHANGELOG.md",
46
+ "LICENSE.md",
47
+ "NOTICE"
48
+ ],
49
+ "dependencies": {
50
+ "@ember-marquetry/core": "2.0.0",
51
+ "@ember-marquetry/ember": "2.0.0",
52
+ "@embroider/addon-shim": "^1.10.3",
53
+ "decorator-transforms": "^2.4.0"
54
+ },
55
+ "peerDependencies": {
56
+ "@ember-joinery/ember": "^1.0.1",
57
+ "@ember-marquetry/test-support": "^2.0.0",
58
+ "@ember/test-helpers": ">= 5.0.0",
59
+ "@glimmer/component": ">= 2.0.0",
60
+ "ember-source": ">= 6.12.0"
61
+ },
62
+ "peerDependenciesMeta": {
63
+ "@ember-marquetry/test-support": {
64
+ "optional": true
65
+ },
66
+ "@ember/test-helpers": {
67
+ "optional": true
68
+ }
69
+ },
70
+ "devDependencies": {
71
+ "@babel/core": "^7.29.7",
72
+ "@babel/plugin-transform-typescript": "^7.29.7",
73
+ "@babel/runtime": "^7.29.7",
74
+ "@ember-joinery/ember": "^1.0.1",
75
+ "@ember-marquetry/test-support": "2.0.0",
76
+ "@ember/library-tsconfig": "^3.0.0",
77
+ "@ember/test-helpers": "^5.7.0",
78
+ "@embroider/addon-dev": "^8.4.2",
79
+ "@glimmer/component": "^2.2.1",
80
+ "@glimmer/tracking": "^1.1.2",
81
+ "@glint/ember-tsc": "^1.14.2",
82
+ "@glint/template": "^1.9.0",
83
+ "@rollup/plugin-babel": "^7.1.0",
84
+ "babel-plugin-ember-template-compilation": "^4.0.1",
85
+ "ember-source": "~7.3.0",
86
+ "rollup": "^4.64.6",
87
+ "typescript": "~6.0.3"
88
+ },
89
+ "publishConfig": {
90
+ "access": "public"
91
+ },
92
+ "engines": {
93
+ "node": ">=22.12.0"
94
+ },
95
+ "ember": {
96
+ "edition": "octane"
97
+ },
98
+ "ember-addon": {
99
+ "version": 2,
100
+ "type": "addon",
101
+ "main": "addon-main.cjs"
102
+ },
103
+ "scripts": {
104
+ "build": "rm -rf declarations && rollup --config",
105
+ "start": "rm -rf declarations && rollup --config --watch",
106
+ "typecheck": "ember-tsc --noEmit"
107
+ }
6
108
  }