@excom/quark-sheet 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.
- package/.rush/temp/chunked-rush-logs/quark-sheet.apply-exports.chunks.jsonl +1 -0
- package/.rush/temp/chunked-rush-logs/quark-sheet.build_docs.chunks.jsonl +1 -0
- package/.rush/temp/chunked-rush-logs/quark-sheet.build_package-metas.chunks.jsonl +1 -0
- package/.rush/temp/operation/apply-exports/all.log +1 -0
- package/.rush/temp/operation/apply-exports/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/apply-exports/state.json +3 -0
- package/.rush/temp/operation/build_docs/all.log +1 -0
- package/.rush/temp/operation/build_docs/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/build_docs/state.json +3 -0
- package/.rush/temp/operation/build_package-metas/all.log +1 -0
- package/.rush/temp/operation/build_package-metas/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/build_package-metas/state.json +3 -0
- package/.rush/temp/shrinkwrap-deps.json +3 -0
- package/config/rig.json +5 -0
- package/index.css +5 -0
- package/index.ts +17 -0
- package/package.json +46 -0
- package/quark-sheet.ts +182 -0
- package/rush-logs/quark-sheet.apply-exports.cache.log +1 -0
- package/rush-logs/quark-sheet.apply-exports.log +1 -0
- package/rush-logs/quark-sheet.build_docs.cache.log +1 -0
- package/rush-logs/quark-sheet.build_docs.log +1 -0
- package/rush-logs/quark-sheet.build_package-metas.cache.log +1 -0
- package/rush-logs/quark-sheet.build_package-metas.log +1 -0
- package/src/quark-sheet.css +8 -0
- package/support/custom-elements.json +220 -0
- package/support/demos/provider.html +13 -0
- package/support/demos/simple.html +14 -0
- package/support/dist-docs/quark-sheet.md +147 -0
- package/support/docs/README.md +53 -0
- package/support/package-meta.json +185 -0
- package/support/tests/__snapshots__/provider.view.test.ts.snap +23 -0
- package/support/tests/__snapshots__/simple.view.test.ts.snap +23 -0
- package/support/tests/provider.view.test.ts +42 -0
- package/support/tests/quark-sheet.test.ts +377 -0
- package/support/tests/simple.view.test.ts +33 -0
- package/tsconfig.json +5 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# quark-sheet
|
|
2
|
+
|
|
3
|
+
Drop a Quark sheet next to your markup — bind, render, and react without a component runtime.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
```html
|
|
7
|
+
<section>
|
|
8
|
+
<quark-sheet>
|
|
9
|
+
details[open] summary {
|
|
10
|
+
content: "Panel Open";
|
|
11
|
+
}
|
|
12
|
+
details:not([open]) summary {
|
|
13
|
+
content: "Panel Closed";
|
|
14
|
+
}
|
|
15
|
+
</quark-sheet>
|
|
16
|
+
<details>
|
|
17
|
+
<summary></summary>
|
|
18
|
+
<p>This is the panel content.</p>
|
|
19
|
+
</details>
|
|
20
|
+
</section>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
|
|
26
|
+
- **Sibling scope** Sheet + targets share a parent — Quark watches that host
|
|
27
|
+
- **Global sheets** `is-global` runs top-level rules document-wide
|
|
28
|
+
- **Inline or remote** Paste Quark in the element, or load `src-url`
|
|
29
|
+
- **Lifecycle state** `is-loading` / `is-success` / `is-error` + matching events (from [loadable-element](/nucleus/packages/loadable-element))
|
|
30
|
+
- **Reload** The `--reload` command drops the shared cache entry for `src-url` and fetches again
|
|
31
|
+
- **Auto (un)register** Connect registers; disconnect tears down cleanly
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
`@excom/quark-sheet` v0.1.0
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm add @excom/quark-sheet
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install @excom/quark-sheet
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
yarn add @excom/quark-sheet
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Import
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import "@excom/quark-sheet";
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
Place `<quark-sheet>` under the same parent as the elements it should orchestrate.
|
|
61
|
+
Inline Quark text is enough for most apps.
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<section>
|
|
65
|
+
<quark-sheet>
|
|
66
|
+
details[open] summary { content: "Panel Open"; }
|
|
67
|
+
details:not([open]) summary { content: "Panel Closed"; }
|
|
68
|
+
</quark-sheet>
|
|
69
|
+
<details>
|
|
70
|
+
<summary></summary>
|
|
71
|
+
<p>This is the panel content.</p>
|
|
72
|
+
</details>
|
|
73
|
+
</section>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
By default the sheet is scoped to its parent. Add `is-global` to run
|
|
77
|
+
top-level rules in the root context (e.g. reading a provider above the
|
|
78
|
+
host); rules inside an explicit `@scope { }` block stay host-scoped either
|
|
79
|
+
way. Language details live in the [`quark`](/nucleus/packages/quark) docs.
|
|
80
|
+
|
|
81
|
+
### API Reference
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
#### Attributes
|
|
85
|
+
|
|
86
|
+
| Name | Surface | Type | Default | Values | Description |
|
|
87
|
+
| --- | --- | --- | --- | --- | --- |
|
|
88
|
+
| `src-url` | option | `string` | | `<URL>` | URL of a remote `.quark` / text sheet. When set, contents are fetched into the live sheet (replacing inline text). |
|
|
89
|
+
| `is-global` | option | `boolean` | | | Run top-level rules in the root context (the whole document) instead of implicitly wrapping the sheet in `@scope { }`. Rules nested inside an explicit `@scope { }` block remain scoped to the host either way. |
|
|
90
|
+
| `is-loading` | state | `boolean` | | | Fetch in progress. |
|
|
91
|
+
| `is-success` | state | `boolean` | | | Sheet parsed and registered on the host. |
|
|
92
|
+
| `is-error` | state | `boolean` | | | Fetch or Quark parse/register failed. |
|
|
93
|
+
| `quark-instance` | state | `Quark` | | | Live `Quark` instance while registered. |
|
|
94
|
+
|
|
95
|
+
#### Provision
|
|
96
|
+
|
|
97
|
+
| Name | Type | Description | Inherited from |
|
|
98
|
+
| --- | --- | --- | --- |
|
|
99
|
+
| `provision` | `unknown` | The result of the most recent work on success, or the error payload on failure. Shape is defined by the composing element. Not reflected as an attribute. | `@excom/loadable-element` |
|
|
100
|
+
|
|
101
|
+
#### Fires
|
|
102
|
+
|
|
103
|
+
| Name | Type | Description | Inherited from |
|
|
104
|
+
| --- | --- | --- | --- |
|
|
105
|
+
| `quark-sheet-loading` | `QuarkSheetLoadingEvent` (`CustomEvent & { type: "quark-sheet-loading"; detail: void; bubbles: true; cancelable: true; composed: true }`) | After `is-loading` becomes true (fetch in flight). | |
|
|
106
|
+
| `quark-sheet-success` | `QuarkSheetSuccessEvent` (`CustomEvent & { type: "quark-sheet-success"; detail: void; bubbles: true; cancelable: true; composed: true }`) | After the sheet parses and registers successfully (`is-success`). | |
|
|
107
|
+
| `quark-sheet-error` | `QuarkSheetErrorEvent` (`CustomEvent & { type: "quark-sheet-error"; detail: unknown; bubbles: true; cancelable: true; composed: true }`) | After parse / fetch failure (`is-error`). `event.detail` is the error. | |
|
|
108
|
+
| `quark-sheet-loading` | `LoadableLoadingEvent` (`CustomEvent & { type: "{tag}-loading"; detail: void; bubbles: true; cancelable: true; composed: true }`) | After `is-loading` is set (work started). | `@excom/loadable-element` |
|
|
109
|
+
| `quark-sheet-success` | `LoadableSuccessEvent` | After `is-success` is set. `event.detail` is the new `provision`. | `@excom/loadable-element` |
|
|
110
|
+
| `quark-sheet-error` | `LoadableErrorEvent` | After `is-error` is set. `event.detail` is the error payload (also stored as `provision`). | `@excom/loadable-element` |
|
|
111
|
+
|
|
112
|
+
#### Commands
|
|
113
|
+
|
|
114
|
+
| Command | Action |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| `--reload` | Drops the shared text cache entry for `src-url` and fetches the sheet again (the cache is page-wide: every element loading the same URL shares it). No-op without `src-url`. |
|
|
117
|
+
|
|
118
|
+
#### CSS Aliases
|
|
119
|
+
|
|
120
|
+
| Alias | Kind | Matches | Description |
|
|
121
|
+
| --- | --- | --- | --- |
|
|
122
|
+
| `:--quark-sheet` | element | `quark-sheet`, `.tag-quark-sheet` | |
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### Examples
|
|
127
|
+
|
|
128
|
+
#### Provider data
|
|
129
|
+
|
|
130
|
+
`prop("provision")` reads a `<provider-fetch>` provision on success and fills a title.
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<section>
|
|
135
|
+
<provider-fetch api-url="/api/todos/1">
|
|
136
|
+
<p>Title: <span bind-title></span></p>
|
|
137
|
+
</provider-fetch>
|
|
138
|
+
<quark-sheet>
|
|
139
|
+
provider-fetch[is-success] {
|
|
140
|
+
$todo: prop("provision").body;
|
|
141
|
+
[bind-title] {
|
|
142
|
+
content: $todo.title;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
</quark-sheet>
|
|
146
|
+
</section>
|
|
147
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# quark-sheet
|
|
2
|
+
|
|
3
|
+
Drop a Quark sheet next to your markup — bind, render, and react without a component runtime.
|
|
4
|
+
|
|
5
|
+
<include-content data-demo="simple"></include-content>
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Sibling scope** Sheet + targets share a parent — Quark watches that host
|
|
10
|
+
- **Global sheets** `is-global` runs top-level rules document-wide
|
|
11
|
+
- **Inline or remote** Paste Quark in the element, or load `src-url`
|
|
12
|
+
- **Lifecycle state** `is-loading` / `is-success` / `is-error` + matching events (from [loadable-element](/nucleus/packages/loadable-element))
|
|
13
|
+
- **Reload** The `--reload` command drops the shared cache entry for `src-url` and fetches again
|
|
14
|
+
- **Auto (un)register** Connect registers; disconnect tears down cleanly
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
<include-content is-active template-ref="/views/install-section/install-section.html"></include-content>
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Place `<quark-sheet>` under the same parent as the elements it should orchestrate.
|
|
23
|
+
Inline Quark text is enough for most apps.
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<section>
|
|
27
|
+
<quark-sheet>
|
|
28
|
+
details[open] summary { content: "Panel Open"; }
|
|
29
|
+
details:not([open]) summary { content: "Panel Closed"; }
|
|
30
|
+
</quark-sheet>
|
|
31
|
+
<details>
|
|
32
|
+
<summary></summary>
|
|
33
|
+
<p>This is the panel content.</p>
|
|
34
|
+
</details>
|
|
35
|
+
</section>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
By default the sheet is scoped to its parent. Add `is-global` to run
|
|
39
|
+
top-level rules in the root context (e.g. reading a provider above the
|
|
40
|
+
host); rules inside an explicit `@scope { }` block stay host-scoped either
|
|
41
|
+
way. Language details live in the [`quark`](/nucleus/packages/quark) docs.
|
|
42
|
+
|
|
43
|
+
### API Reference
|
|
44
|
+
|
|
45
|
+
<include-content is-active template-ref="/views/api-reference/api-reference.html"></include-content>
|
|
46
|
+
|
|
47
|
+
### Examples
|
|
48
|
+
|
|
49
|
+
#### Provider data
|
|
50
|
+
|
|
51
|
+
`prop("provision")` reads a `<provider-fetch>` provision on success and fills a title.
|
|
52
|
+
|
|
53
|
+
<include-content data-demo="provider"></include-content>
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
{
|
|
2
|
+
"shortName": "quark-sheet",
|
|
3
|
+
"package": {
|
|
4
|
+
"name": "@excom/quark-sheet",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"description": "<quark-sheet> — host a Quark orchestration sheet for sibling markup",
|
|
7
|
+
"peerDependencies": {},
|
|
8
|
+
"excom": {
|
|
9
|
+
"packageType": "kit-element"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"demos": {
|
|
13
|
+
"provider": "<section>\n <provider-fetch api-url=\"/api/todos/1\">\n <p>Title: <span bind-title></span></p>\n </provider-fetch>\n <quark-sheet>\n provider-fetch[is-success] {\n $todo: prop(\"provision\").body;\n [bind-title] {\n content: $todo.title;\n }\n }\n </quark-sheet>\n</section>\n",
|
|
14
|
+
"simple": "<section>\n <quark-sheet>\n details[open] summary {\n content: \"Panel Open\";\n }\n details:not([open]) summary {\n content: \"Panel Closed\";\n }\n </quark-sheet>\n <details>\n <summary></summary>\n <p>This is the panel content.</p>\n </details>\n</section>\n"
|
|
15
|
+
},
|
|
16
|
+
"readme": "<h1 id=\"md-quark-sheet\">quark-sheet</h1>\n<p>Drop a Quark sheet next to your markup — bind, render, and react without a component runtime.</p>\n<p><include-content data-demo=\"simple\"></include-content></p>\n<h2 id=\"md-features\">Features</h2>\n<ul>\n<li><strong>Sibling scope</strong> Sheet + targets share a parent — Quark watches that host</li>\n<li><strong>Global sheets</strong> <code>is-global</code> runs top-level rules document-wide</li>\n<li><strong>Inline or remote</strong> Paste Quark in the element, or load <code>src-url</code></li>\n<li><strong>Lifecycle state</strong> <code>is-loading</code> / <code>is-success</code> / <code>is-error</code> + matching events (from <spa-a route-href=\"/nucleus/packages/loadable-element\" role=\"link\">loadable-element</spa-a>)</li>\n<li><strong>Reload</strong> The <code>--reload</code> command drops the shared cache entry for <code>src-url</code> and fetches again</li>\n<li><strong>Auto (un)register</strong> Connect registers; disconnect tears down cleanly</li>\n</ul>\n<h2 id=\"md-installation\">Installation</h2>\n<p><include-content is-active template-ref=\"/views/install-section/install-section.html\"></include-content></p>\n<h2 id=\"md-usage\">Usage</h2>\n<p>Place <code><quark-sheet></code> under the same parent as the elements it should orchestrate.\nInline Quark text is enough for most apps.</p>\n<include-content data-language=\"html\"><template><section>\n <quark-sheet>\n details[open] summary { content: \"Panel Open\"; }\n details:not([open]) summary { content: \"Panel Closed\"; }\n </quark-sheet>\n <details>\n <summary></summary>\n <p>This is the panel content.</p>\n </details>\n</section></template></include-content>\n<p>By default the sheet is scoped to its parent. Add <code>is-global</code> to run\ntop-level rules in the root context (e.g. reading a provider above the\nhost); rules inside an explicit <code>@scope { }</code> block stay host-scoped either\nway. Language details live in the <spa-a route-href=\"/nucleus/packages/quark\" role=\"link\"><code>quark</code></spa-a> docs.</p>\n<h3 id=\"md-api-reference\">API Reference</h3>\n<p><include-content is-active template-ref=\"/views/api-reference/api-reference.html\"></include-content></p>\n<h3 id=\"md-examples\">Examples</h3>\n<h4 id=\"md-provider-data\">Provider data</h4>\n<p><code>prop("provision")</code> reads a <code><provider-fetch></code> provision on success and fills a title.</p>\n<p><include-content data-demo=\"provider\"></include-content></p>\n",
|
|
17
|
+
"docs": {
|
|
18
|
+
"readme": "<h1 id=\"md-quark-sheet\">quark-sheet</h1>\n<p>Drop a Quark sheet next to your markup — bind, render, and react without a component runtime.</p>\n<p><include-content data-demo=\"simple\"></include-content></p>\n<h2 id=\"md-features\">Features</h2>\n<ul>\n<li><strong>Sibling scope</strong> Sheet + targets share a parent — Quark watches that host</li>\n<li><strong>Global sheets</strong> <code>is-global</code> runs top-level rules document-wide</li>\n<li><strong>Inline or remote</strong> Paste Quark in the element, or load <code>src-url</code></li>\n<li><strong>Lifecycle state</strong> <code>is-loading</code> / <code>is-success</code> / <code>is-error</code> + matching events (from <spa-a route-href=\"/nucleus/packages/loadable-element\" role=\"link\">loadable-element</spa-a>)</li>\n<li><strong>Reload</strong> The <code>--reload</code> command drops the shared cache entry for <code>src-url</code> and fetches again</li>\n<li><strong>Auto (un)register</strong> Connect registers; disconnect tears down cleanly</li>\n</ul>\n<h2 id=\"md-installation\">Installation</h2>\n<p><include-content is-active template-ref=\"/views/install-section/install-section.html\"></include-content></p>\n<h2 id=\"md-usage\">Usage</h2>\n<p>Place <code><quark-sheet></code> under the same parent as the elements it should orchestrate.\nInline Quark text is enough for most apps.</p>\n<include-content data-language=\"html\"><template><section>\n <quark-sheet>\n details[open] summary { content: \"Panel Open\"; }\n details:not([open]) summary { content: \"Panel Closed\"; }\n </quark-sheet>\n <details>\n <summary></summary>\n <p>This is the panel content.</p>\n </details>\n</section></template></include-content>\n<p>By default the sheet is scoped to its parent. Add <code>is-global</code> to run\ntop-level rules in the root context (e.g. reading a provider above the\nhost); rules inside an explicit <code>@scope { }</code> block stay host-scoped either\nway. Language details live in the <spa-a route-href=\"/nucleus/packages/quark\" role=\"link\"><code>quark</code></spa-a> docs.</p>\n<h3 id=\"md-api-reference\">API Reference</h3>\n<p><include-content is-active template-ref=\"/views/api-reference/api-reference.html\"></include-content></p>\n<h3 id=\"md-examples\">Examples</h3>\n<h4 id=\"md-provider-data\">Provider data</h4>\n<p><code>prop("provision")</code> reads a <code><provider-fetch></code> provision on success and fills a title.</p>\n<p><include-content data-demo=\"provider\"></include-content></p>\n"
|
|
19
|
+
},
|
|
20
|
+
"installation": {
|
|
21
|
+
"name": "@excom/quark-sheet",
|
|
22
|
+
"shortName": "quark-sheet",
|
|
23
|
+
"version": "0.1.0",
|
|
24
|
+
"description": "<quark-sheet> — host a Quark orchestration sheet for sibling markup",
|
|
25
|
+
"packageType": "kit-element",
|
|
26
|
+
"cdn": "<script src=\"https://unpkg.com/@excom/kit-utils/dist/index.umd.min.js\"></script>\n<script src=\"https://unpkg.com/@excom/neutron/dist/index.umd.min.js\"></script>\n<script src=\"https://unpkg.com/@excom/quark-sheet@0.1.0/dist/index.umd.min.js\"></script>\n<link rel=\"stylesheet\" href=\"https://unpkg.com/@excom/quark-sheet@0.1.0/dist/index.css\">",
|
|
27
|
+
"install": {
|
|
28
|
+
"npm": "npm install @excom/quark-sheet"
|
|
29
|
+
},
|
|
30
|
+
"imports": {
|
|
31
|
+
"js": "import \"@excom/quark-sheet\";",
|
|
32
|
+
"css": "@import \"@excom/quark-sheet\";",
|
|
33
|
+
"html": "<!-- import path to `node_modules` will depend on your build setup -->\n<script type=\"module\" src=\"/node_modules/@excom/quark-sheet\"></script>\n<link rel=\"stylesheet\" href=\"/node_modules/@excom/quark-sheet\">"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": []
|
|
36
|
+
},
|
|
37
|
+
"elementApis": [
|
|
38
|
+
{
|
|
39
|
+
"tag": "quark-sheet",
|
|
40
|
+
"summary": "Load / own a Quark sheet for sibling markup.",
|
|
41
|
+
"kind": "class",
|
|
42
|
+
"attributes": [
|
|
43
|
+
{
|
|
44
|
+
"name": "is-global",
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"description": "Run top-level rules in the root context (the whole document) instead of implicitly wrapping the sheet in <code>@scope { }</code>. Rules nested inside an explicit <code>@scope { }</code> block remain scoped to the host either way.",
|
|
47
|
+
"fieldName": "isGlobal",
|
|
48
|
+
"surface": "option"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "src-url",
|
|
52
|
+
"type": "string",
|
|
53
|
+
"description": "URL of a remote <code>.quark</code> / text sheet. When set, contents are fetched into the live sheet (replacing inline text).",
|
|
54
|
+
"fieldName": "srcUrl",
|
|
55
|
+
"surface": "option",
|
|
56
|
+
"values": "<URL>"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "is-error",
|
|
60
|
+
"type": "boolean",
|
|
61
|
+
"description": "Fetch or Quark parse/register failed.",
|
|
62
|
+
"fieldName": "isError",
|
|
63
|
+
"surface": "state"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "is-error",
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"description": "The most recent work failed. Mutually exclusive with <code>is-success</code>.",
|
|
69
|
+
"fieldName": "isError",
|
|
70
|
+
"surface": "state",
|
|
71
|
+
"inheritedFrom": "@excom/loadable-element"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "is-loading",
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"description": "Fetch in progress.",
|
|
77
|
+
"fieldName": "isLoading",
|
|
78
|
+
"surface": "state"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "is-loading",
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"description": "Work is in flight.",
|
|
84
|
+
"fieldName": "isLoading",
|
|
85
|
+
"surface": "state",
|
|
86
|
+
"inheritedFrom": "@excom/loadable-element"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "is-success",
|
|
90
|
+
"type": "boolean",
|
|
91
|
+
"description": "Sheet parsed and registered on the host.",
|
|
92
|
+
"fieldName": "isSuccess",
|
|
93
|
+
"surface": "state"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "is-success",
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"description": "The most recent work finished successfully. Mutually exclusive with <code>is-error</code>.",
|
|
99
|
+
"fieldName": "isSuccess",
|
|
100
|
+
"surface": "state",
|
|
101
|
+
"inheritedFrom": "@excom/loadable-element"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "quark-instance",
|
|
105
|
+
"type": "Quark",
|
|
106
|
+
"description": "Live <code>Quark</code> instance while registered.",
|
|
107
|
+
"fieldName": "quarkInstance",
|
|
108
|
+
"surface": "state"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"events": [
|
|
112
|
+
{
|
|
113
|
+
"name": "quark-sheet-error",
|
|
114
|
+
"description": "After parse / fetch failure (<code>is-error</code>). <code>event.detail</code> is the error.",
|
|
115
|
+
"type": "QuarkSheetErrorEvent",
|
|
116
|
+
"typeExpanded": "CustomEvent & { type: \"quark-sheet-error\"; detail: unknown; bubbles: true; cancelable: true; composed: true }"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "quark-sheet-error",
|
|
120
|
+
"description": "After <code>is-error</code> is set. <code>event.detail</code> is the error payload (also stored as <code>provision</code>).",
|
|
121
|
+
"type": "LoadableErrorEvent",
|
|
122
|
+
"inheritedFrom": "@excom/loadable-element"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "quark-sheet-loading",
|
|
126
|
+
"description": "After <code>is-loading</code> becomes true (fetch in flight).",
|
|
127
|
+
"type": "QuarkSheetLoadingEvent",
|
|
128
|
+
"typeExpanded": "CustomEvent & { type: \"quark-sheet-loading\"; detail: void; bubbles: true; cancelable: true; composed: true }"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "quark-sheet-loading",
|
|
132
|
+
"description": "After <code>is-loading</code> is set (work started).",
|
|
133
|
+
"type": "LoadableLoadingEvent",
|
|
134
|
+
"typeExpanded": "CustomEvent & { type: \"{tag}-loading\"; detail: void; bubbles: true; cancelable: true; composed: true }",
|
|
135
|
+
"inheritedFrom": "@excom/loadable-element"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "quark-sheet-success",
|
|
139
|
+
"description": "After the sheet parses and registers successfully (<code>is-success</code>).",
|
|
140
|
+
"type": "QuarkSheetSuccessEvent",
|
|
141
|
+
"typeExpanded": "CustomEvent & { type: \"quark-sheet-success\"; detail: void; bubbles: true; cancelable: true; composed: true }"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "quark-sheet-success",
|
|
145
|
+
"description": "After <code>is-success</code> is set. <code>event.detail</code> is the new <code>provision</code>.",
|
|
146
|
+
"type": "LoadableSuccessEvent",
|
|
147
|
+
"inheritedFrom": "@excom/loadable-element"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"slots": [],
|
|
151
|
+
"cssProperties": [],
|
|
152
|
+
"cssClasses": [],
|
|
153
|
+
"cssAliases": [
|
|
154
|
+
{
|
|
155
|
+
"name": ":--quark-sheet",
|
|
156
|
+
"selectors": [
|
|
157
|
+
"quark-sheet",
|
|
158
|
+
".tag-quark-sheet"
|
|
159
|
+
],
|
|
160
|
+
"kind": "element",
|
|
161
|
+
"description": ""
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"listens": [],
|
|
165
|
+
"commands": [
|
|
166
|
+
{
|
|
167
|
+
"name": "--reload",
|
|
168
|
+
"description": "Drops the shared text cache entry for <code>src-url</code> and fetches the sheet again (the cache is page-wide: every element loading the same URL shares it). No-op without <code>src-url</code>."
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"defaultActions": [],
|
|
172
|
+
"expectedChildren": [],
|
|
173
|
+
"provisions": [
|
|
174
|
+
{
|
|
175
|
+
"name": "provision",
|
|
176
|
+
"type": "unknown",
|
|
177
|
+
"description": "The result of the most recent work on success, or the error payload on failure. Shape is defined by the composing element. Not reflected as an attribute.",
|
|
178
|
+
"fieldName": "provision",
|
|
179
|
+
"inheritedFrom": "@excom/loadable-element"
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"exportedFiles": {}
|
|
185
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`provider view > binds a fetched todo title > complexity 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"attributeRuns": 0,
|
|
6
|
+
"closest": 0,
|
|
7
|
+
"getVar": 0,
|
|
8
|
+
"importNode": 0,
|
|
9
|
+
"listenerRuns": 0,
|
|
10
|
+
"matches": 0,
|
|
11
|
+
"parentElement": 0,
|
|
12
|
+
"quarkRuns": 0,
|
|
13
|
+
"queryScopeCost": 0,
|
|
14
|
+
"querySelectorAll": 0,
|
|
15
|
+
"removeAttribute": 0,
|
|
16
|
+
"ruleRuns": 0,
|
|
17
|
+
"schedulePaint": 0,
|
|
18
|
+
"setAttribute": 0,
|
|
19
|
+
"setVar": 0,
|
|
20
|
+
"textContent": 0,
|
|
21
|
+
"variableRuns": 0,
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`simple view > labels the details panel open and closed > complexity 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"attributeRuns": 1,
|
|
6
|
+
"closest": 0,
|
|
7
|
+
"getVar": 0,
|
|
8
|
+
"importNode": 0,
|
|
9
|
+
"listenerRuns": 0,
|
|
10
|
+
"matches": 2,
|
|
11
|
+
"parentElement": 0,
|
|
12
|
+
"quarkRuns": 1,
|
|
13
|
+
"queryScopeCost": 2,
|
|
14
|
+
"querySelectorAll": 1,
|
|
15
|
+
"removeAttribute": 0,
|
|
16
|
+
"ruleRuns": 1,
|
|
17
|
+
"schedulePaint": 1,
|
|
18
|
+
"setAttribute": 1,
|
|
19
|
+
"setVar": 0,
|
|
20
|
+
"textContent": 1,
|
|
21
|
+
"variableRuns": 0,
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import "@excom/provider-fetch";
|
|
2
|
+
import "../../index";
|
|
3
|
+
import {
|
|
4
|
+
afterEach,
|
|
5
|
+
describe,
|
|
6
|
+
expect,
|
|
7
|
+
it,
|
|
8
|
+
spyFetch,
|
|
9
|
+
waitForEvent,
|
|
10
|
+
} from "@excom/heft-rig/profiles/default/config/test-utils";
|
|
11
|
+
import {
|
|
12
|
+
expectComplexity,
|
|
13
|
+
flush,
|
|
14
|
+
measureComplexity,
|
|
15
|
+
mountView,
|
|
16
|
+
readDemo,
|
|
17
|
+
} from "@excom/quark/support/tests/view-helpers";
|
|
18
|
+
|
|
19
|
+
describe("provider view", () => {
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
document.body.innerHTML = "";
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("binds a fetched todo title", async () => {
|
|
25
|
+
spyFetch({
|
|
26
|
+
status: 200,
|
|
27
|
+
body: JSON.stringify({ id: 1, title: "Write docs" }),
|
|
28
|
+
});
|
|
29
|
+
const { root, quark } = await mountView(readDemo(import.meta.url, "provider"));
|
|
30
|
+
const provider = root.querySelector("provider-fetch")!;
|
|
31
|
+
if (!provider.hasAttribute("is-success")) {
|
|
32
|
+
await waitForEvent(provider, "provider-fetch-success");
|
|
33
|
+
await flush();
|
|
34
|
+
}
|
|
35
|
+
const meter = measureComplexity(quark!);
|
|
36
|
+
await flush();
|
|
37
|
+
const budget = meter.take();
|
|
38
|
+
meter.stop();
|
|
39
|
+
expect(root.querySelector("[bind-title]")?.textContent).toBe("Write docs");
|
|
40
|
+
expectComplexity(budget);
|
|
41
|
+
});
|
|
42
|
+
});
|