@eclipse-docks/extension-canvas 0.8.3 → 0.8.4
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/package.json
CHANGED
|
@@ -52,7 +52,8 @@ export default class extends LitElement {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
addItem() {
|
|
55
|
-
const
|
|
55
|
+
const input = this.renderRoot.querySelector("wa-input");
|
|
56
|
+
const text = String(input?.value ?? "").trim();
|
|
56
57
|
if (!text) return;
|
|
57
58
|
this.items = [...this.items, { id: crypto.randomUUID(), text, done: false }];
|
|
58
59
|
this.draft = "";
|
|
@@ -64,7 +65,6 @@ export default class extends LitElement {
|
|
|
64
65
|
<wa-input
|
|
65
66
|
placeholder="New item"
|
|
66
67
|
.value=${this.draft}
|
|
67
|
-
@input=${(e) => { this.draft = e.target.value; }}
|
|
68
68
|
@keydown=${(e) => { if (e.key === "Enter") this.addItem(); }}
|
|
69
69
|
></wa-input>
|
|
70
70
|
<wa-button @click=${() => this.addItem()}>Add</wa-button>
|
|
@@ -51,10 +51,9 @@ import { repeat, when, classMap, styleMap, ifDefined, live, ref, keyed } from "d
|
|
|
51
51
|
|
|
52
52
|
```js
|
|
53
53
|
html`<wa-button @click=${this.onSave}>Save</wa-button>`
|
|
54
|
-
html`<wa-input @wa-input=${(e) => { this.q = e.target.value; }}></wa-input>`
|
|
55
54
|
```
|
|
56
55
|
|
|
57
|
-
Use arrow functions or bound methods so `this` stays the element.
|
|
56
|
+
Use arrow functions or bound methods so `this` stays the element. For `wa-*` props and events, follow `eclipse-docks-webawesome`.
|
|
58
57
|
|
|
59
58
|
## Signals (optional)
|
|
60
59
|
|
|
@@ -1,151 +1,39 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: eclipse-docks-webawesome
|
|
3
3
|
description: >-
|
|
4
|
-
Web Awesome UI
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
Web Awesome UI in Eclipse Docks via docks/webawesome. Use when building
|
|
5
|
+
buttons, inputs, selects, checkboxes, dialogs, forms, icons, or layout
|
|
6
|
+
utilities in canvases or Docks UI. Fetch the official component page before
|
|
7
|
+
writing wa-* markup.
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Eclipse Docks Web Awesome (`docks/webawesome`)
|
|
11
11
|
|
|
12
|
-
Side-effect import once — Docks already registers components, themes, and the `docks` icon library:
|
|
13
|
-
|
|
14
12
|
```js
|
|
15
13
|
import "docks/webawesome";
|
|
16
14
|
```
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## Official agent skills (direct URLs)
|
|
21
|
-
|
|
22
|
-
Docs overview: https://webawesome.com/docs/ai/agent-skills
|
|
23
|
-
|
|
24
|
-
When you need exact props/events/slots, layout, or theming beyond this cheat sheet, `fetch` these markdown URLs directly (do not scrape the HTML docs page):
|
|
25
|
-
|
|
26
|
-
**Component skill**
|
|
27
|
-
|
|
28
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/SKILL.md
|
|
29
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/choosing-components.md
|
|
30
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/usage.md
|
|
31
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/form-controls.md
|
|
32
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/themes.md
|
|
33
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/tokens/color.md
|
|
34
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/utilities/layout.md
|
|
35
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/utilities/color.md
|
|
36
|
-
|
|
37
|
-
**Common component APIs** (`wa-*` → same stem)
|
|
38
|
-
|
|
39
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/button.md
|
|
40
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/input.md
|
|
41
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/textarea.md
|
|
42
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/checkbox.md
|
|
43
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/switch.md
|
|
44
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/select.md
|
|
45
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/option.md
|
|
46
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/radio-group.md
|
|
47
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/dialog.md
|
|
48
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/drawer.md
|
|
49
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/dropdown.md
|
|
50
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/tab-group.md
|
|
51
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/card.md
|
|
52
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/callout.md
|
|
53
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/icon.md
|
|
54
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/toast.md
|
|
16
|
+
That import registers the components, the theme, and the `docks` icon library. Canvas files use this import. Custom elements take a closing tag: `<wa-input></wa-input>`.
|
|
55
17
|
|
|
56
|
-
|
|
18
|
+
## Look up the component, then write it
|
|
57
19
|
|
|
58
|
-
|
|
20
|
+
Fetch the official page for each tag before using its props, slots, or events. Use that page's events table. Ignore the overview line that says to listen for `wa-input` or `wa-change`.
|
|
59
21
|
|
|
60
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome
|
|
61
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome
|
|
62
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome
|
|
63
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome-design/
|
|
64
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome-design/references/composition.md
|
|
65
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome-design/references/patterns.md
|
|
66
|
-
- https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome-design/references/theming.md
|
|
22
|
+
- Index: https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/SKILL.md
|
|
23
|
+
- One component: `https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/components/<name>.md` (`button`, `input`, `checkbox`, `select`, …)
|
|
24
|
+
- Which component: https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome/references/choosing-components.md
|
|
25
|
+
- Layout, tokens, theming: https://cdn.jsdelivr.net/npm/@awesome.me/webawesome@3/dist/skills/webawesome-design/SKILL.md
|
|
67
26
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
## Lit bindings
|
|
71
|
-
|
|
72
|
-
```js
|
|
73
|
-
html`
|
|
74
|
-
<wa-input
|
|
75
|
-
label="Name"
|
|
76
|
-
.value=${this.name}
|
|
77
|
-
@wa-input=${(e) => { this.name = e.target.value; }}
|
|
78
|
-
></wa-input>
|
|
79
|
-
<wa-button variant="brand" @click=${() => this.save()}>Save</wa-button>
|
|
80
|
-
`
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
- Prefer property binding (`.value`, `.checked`) over attributes for controlled values.
|
|
84
|
-
- Listen to Web Awesome events (`wa-input`, `wa-change`, `wa-select`, …), not only native `input`/`change`, when the component documents `wa-*` events.
|
|
85
|
-
- Slots: `<wa-icon slot="start" name="plus"></wa-icon>` inside buttons/inputs.
|
|
86
|
-
|
|
87
|
-
## Icons
|
|
88
|
-
|
|
89
|
-
```html
|
|
90
|
-
<wa-icon name="gear"></wa-icon>
|
|
91
|
-
```
|
|
27
|
+
Bind properties (`.value`, `.checked`). Listen for the events that page lists.
|
|
92
28
|
|
|
93
|
-
|
|
29
|
+
## `wa-input` and `wa-number-input`
|
|
94
30
|
|
|
95
|
-
|
|
31
|
+
Their pages list an `input` event. This build copies keystrokes onto `.value` and does not re-dispatch `input`, so a host `@input` listener never runs. `change` fires on blur, after a click handler.
|
|
96
32
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
```js
|
|
100
|
-
html`<div class="wa-stack wa-gap-m">${/* children */}</div>`
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Component cheat sheet (common)
|
|
104
|
-
|
|
105
|
-
| Need | Component |
|
|
106
|
-
| --- | --- |
|
|
107
|
-
| Action | `wa-button`, `wa-button-group`, `wa-copy-button` |
|
|
108
|
-
| Text | `wa-input`, `wa-textarea`, `wa-number-input` |
|
|
109
|
-
| Choice | `wa-checkbox`, `wa-switch`, `wa-radio-group` + `wa-radio`, `wa-select` + `wa-option` |
|
|
110
|
-
| Overlay | `wa-dialog`, `wa-drawer`, `wa-popover`, `wa-tooltip`, `wa-dropdown` + `wa-dropdown-item` |
|
|
111
|
-
| Nav / structure | `wa-tab-group` + `wa-tab` + `wa-tab-panel`, `wa-breadcrumb`, `wa-divider` |
|
|
112
|
-
| Feedback | `wa-callout`, `wa-spinner`, `wa-progress-bar`, `wa-badge`, `wa-tag` |
|
|
113
|
-
| Content | `wa-card`, `wa-details`, `wa-accordion` + `wa-accordion-item`, `wa-markdown` |
|
|
114
|
-
| Toast host | `wa-toast` + `wa-toast-item` (prefer Docks `toastInfo` / `toastError` from `docks/core` when available) |
|
|
115
|
-
|
|
116
|
-
Pick **`wa-select`** for form values; pick **`wa-dropdown`** for action menus — do not confuse them.
|
|
117
|
-
|
|
118
|
-
## Theming & color tokens
|
|
119
|
-
|
|
120
|
-
Components follow the loaded Web Awesome theme (Docks imports default theme CSS). Prefer `variant`, `appearance`, and `size` on components before custom CSS.
|
|
121
|
-
|
|
122
|
-
**Prefer Web Awesome color tokens over custom colors** (`#hex`, `rgb()`, named colors). Tokens track light/dark and palette changes; hardcoded colors do not.
|
|
123
|
-
|
|
124
|
-
Use semantic / theme tokens first:
|
|
125
|
-
|
|
126
|
-
- Surfaces & text: `var(--wa-color-surface-default)`, `var(--wa-color-surface-raised)`, `var(--wa-color-surface-border)`, `var(--wa-color-text-normal)`, `var(--wa-color-text-quiet)`, `var(--wa-color-text-link)`
|
|
127
|
-
- Variants: `var(--wa-color-brand-fill-loud)`, `var(--wa-color-success-fill-normal)`, `var(--wa-color-warning-on-loud)`, `var(--wa-color-danger-border-normal)`, …
|
|
128
|
-
- Utility classes when enough: `wa-color-brand`, `wa-bg-surface-raised`, etc. (see utilities/color.md)
|
|
129
|
-
|
|
130
|
-
Reserve raw palette tints (`--wa-color-blue-50`, …) for rare cases. For deeper theming, `fetch` `tokens/color.md` and `webawesome-design/references/theming.md`.
|
|
131
|
-
|
|
132
|
-
```js
|
|
133
|
-
static styles = css`
|
|
134
|
-
:host {
|
|
135
|
-
display: block;
|
|
136
|
-
color: var(--wa-color-text-normal);
|
|
137
|
-
background: var(--wa-color-surface-default);
|
|
138
|
-
border: 1px solid var(--wa-color-surface-border);
|
|
139
|
-
}
|
|
140
|
-
.accent { color: var(--wa-color-brand-on-quiet); }
|
|
141
|
-
`;
|
|
142
|
-
```
|
|
33
|
+
Read `.value` in the click or Enter handler. For live text, use `@keyup` and assign `e.target.value`. `wa-textarea` does re-dispatch `input`.
|
|
143
34
|
|
|
144
|
-
##
|
|
35
|
+
## Docks
|
|
145
36
|
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
- Hardcoded colors in CSS/templates instead of `--wa-*` color tokens
|
|
150
|
-
- Hand-rolled `<button>`, `<input>`, or checkbox chrome, or a hardcoded color palette, when `wa-*` and `--wa-color-*` tokens cover it
|
|
151
|
-
- Loading a cross-origin image, style, or script as no-cors when the host omits CORP — request it as CORS (see canvas skill); keep `wa-*` on the host element. A widget stylesheet added to `document.head` does not apply inside the canvas shadow root — adopt it there (see canvas skill)
|
|
37
|
+
- Shell icons: `<wa-icon library="docks" name="…"></wa-icon>`. Other icons use the names on the icon page.
|
|
38
|
+
- Color comes from `--wa-color-*` tokens so the loaded theme covers light and dark.
|
|
39
|
+
- Shell toasts: `toastInfo` / `toastError` from `docks/core` when that module is already loaded.
|