@herdingbits/trailhead-webawesome 0.1.0 → 0.1.1
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/README.md +30 -23
- package/dist/shell-app.d.ts +2 -2
- package/dist/shell-app.js +3 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,39 +1,32 @@
|
|
|
1
|
-
# @herdingbits/trailhead-
|
|
1
|
+
# @herdingbits/trailhead-webawesome
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Web Awesome adapter for Trailhead. Vanilla TypeScript, no React required.
|
|
4
4
|
|
|
5
5
|
## What is this?
|
|
6
6
|
|
|
7
|
-
This package provides a Trailhead adapter for
|
|
8
|
-
- Loading and configuring Shoelace components
|
|
9
|
-
- Rendering toasts, dialogs, and busy overlays
|
|
10
|
-
- Integrating Shoelace with the Trailhead shell
|
|
11
|
-
- **Vanilla TypeScript implementation** - no framework required
|
|
12
|
-
|
|
13
|
-
**Perfect for teams that want to stay close to HTML/CSS/JavaScript** without React complexity.
|
|
7
|
+
This package provides a Trailhead adapter for [Web Awesome](https://webawesome.com/) — the successor to Shoelace, built by Font Awesome. It handles:
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
- Loading and configuring Web Awesome components via the autoloader
|
|
10
|
+
- Rendering toasts, dialogs, and busy overlays
|
|
11
|
+
- Integrating Web Awesome with the Trailhead shell
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
- **Web Components**: Shoelace components work everywhere
|
|
19
|
-
- **Lightweight**: No React, no virtual DOM, just the browser
|
|
20
|
-
- **Simple**: Straightforward DOM manipulation and event handling
|
|
13
|
+
**Vanilla TypeScript implementation — no framework required.** Web Awesome components are native web components and work in any SPA regardless of framework.
|
|
21
14
|
|
|
22
15
|
## Installation
|
|
23
16
|
|
|
24
17
|
```bash
|
|
25
|
-
npm install @herdingbits/trailhead-core @herdingbits/trailhead-
|
|
18
|
+
npm install @herdingbits/trailhead-core @herdingbits/trailhead-webawesome @awesome.me/webawesome
|
|
26
19
|
```
|
|
27
20
|
|
|
28
21
|
## Usage
|
|
29
22
|
|
|
30
23
|
```typescript
|
|
31
24
|
import { Trailhead } from '@herdingbits/trailhead-core';
|
|
32
|
-
import {
|
|
33
|
-
import '@herdingbits/trailhead-
|
|
25
|
+
import { WebAwesomeAdapter, ShellApp } from '@herdingbits/trailhead-webawesome';
|
|
26
|
+
import '@herdingbits/trailhead-webawesome/shell.css';
|
|
34
27
|
|
|
35
28
|
const shell = new Trailhead({
|
|
36
|
-
adapter: new
|
|
29
|
+
adapter: new WebAwesomeAdapter(),
|
|
37
30
|
appBasePath: '/app',
|
|
38
31
|
apiUrl: 'https://api.example.com'
|
|
39
32
|
});
|
|
@@ -41,20 +34,34 @@ const shell = new Trailhead({
|
|
|
41
34
|
ShellApp.mount(shell);
|
|
42
35
|
```
|
|
43
36
|
|
|
44
|
-
By default,
|
|
37
|
+
By default, Web Awesome is served from `${shellUrl}/webawesome`. To load from a CDN instead:
|
|
45
38
|
|
|
46
39
|
```typescript
|
|
47
40
|
const shell = new Trailhead({
|
|
48
|
-
adapter: new
|
|
41
|
+
adapter: new WebAwesomeAdapter({
|
|
42
|
+
webAwesomeUrl: 'https://cdn.webawesome.com/3.6.0'
|
|
43
|
+
}),
|
|
49
44
|
appBasePath: '/app',
|
|
50
45
|
});
|
|
51
46
|
```
|
|
52
47
|
|
|
53
48
|
## What's Included
|
|
54
49
|
|
|
55
|
-
- **
|
|
56
|
-
- **ShellApp**
|
|
57
|
-
- **shell.css**
|
|
50
|
+
- **WebAwesomeAdapter** — implements the Trailhead adapter interface
|
|
51
|
+
- **ShellApp** — minimal mounting wrapper for API consistency
|
|
52
|
+
- **shell.css** — base styles for the shell UI
|
|
53
|
+
|
|
54
|
+
## Web Awesome in SPAs
|
|
55
|
+
|
|
56
|
+
Because the shell loads the Web Awesome autoloader, all `wa-*` components are available in every hosted SPA without any additional imports:
|
|
57
|
+
|
|
58
|
+
```html
|
|
59
|
+
<wa-button variant="brand">Click Me</wa-button>
|
|
60
|
+
<wa-icon name="envelope"></wa-icon>
|
|
61
|
+
<wa-dialog label="Confirm">...</wa-dialog>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Icons use Font Awesome names (free tier). See [fontawesome.com/icons](https://fontawesome.com/icons) for the full list.
|
|
58
65
|
|
|
59
66
|
## Documentation
|
|
60
67
|
|
package/dist/shell-app.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Web Awesome Shell App
|
|
3
3
|
* Minimal wrapper for consistency with other adapters
|
|
4
4
|
*/
|
|
5
5
|
import type { Trailhead } from '@herdingbits/trailhead-core';
|
|
6
6
|
export declare class ShellApp {
|
|
7
7
|
/**
|
|
8
|
-
* Mount the shell (no-op for
|
|
8
|
+
* Mount the shell (no-op for Web Awesome since the adapter handles everything)
|
|
9
9
|
*/
|
|
10
10
|
static mount(shell: Trailhead): void;
|
|
11
11
|
}
|
package/dist/shell-app.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export class ShellApp {
|
|
2
2
|
/**
|
|
3
|
-
* Mount the shell (no-op for
|
|
3
|
+
* Mount the shell (no-op for Web Awesome since the adapter handles everything)
|
|
4
4
|
*/
|
|
5
5
|
static mount(shell) {
|
|
6
|
-
//
|
|
6
|
+
// Web Awesome adapter handles all UI via web components
|
|
7
7
|
// This is just a consistent API surface
|
|
8
|
-
console.log('[Trailhead]
|
|
8
|
+
console.log('[Trailhead] Web Awesome shell mounted');
|
|
9
9
|
}
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herdingbits/trailhead-webawesome",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Web Awesome web components adapter for Trailhead. Vanilla TypeScript, no React required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"build": "npm run clean && tsc && cp src/shell.css dist/"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@herdingbits/trailhead-core": "^0.0
|
|
24
|
+
"@herdingbits/trailhead-core": "^0.1.0",
|
|
25
25
|
"@awesome.me/webawesome": "^3.6.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@herdingbits/trailhead-types": "^0.0
|
|
29
|
-
"@awesome.me/webawesome": "^3.
|
|
28
|
+
"@herdingbits/trailhead-types": "^0.1.0",
|
|
29
|
+
"@awesome.me/webawesome": "^3.7.0",
|
|
30
30
|
"typescript": "^6.0.3"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|