pi-footer-manager 1.0.0 → 1.0.2
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 +36 -0
- package/footer-manager/README.md +3 -1
- package/footer-manager/api.ts +17 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -4,6 +4,26 @@ One footer, many extensions: build flexible Pi footers from reusable fragments w
|
|
|
4
4
|
|
|
5
5
|
`pi-footer-manager` lets one extension own `ctx.ui.setFooter(...)` while built-in and custom fragments are arranged through a shared API, with flexible rows, regions, widths, alignment, and redraw/invalidation flow.
|
|
6
6
|
|
|
7
|
+
## Install or test
|
|
8
|
+
|
|
9
|
+
Install permanently:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pi install npm:pi-footer-manager
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Test without installing permanently:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pi --no-extensions -e npm:pi-footer-manager
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
To load it alongside your normal setup:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pi -e npm:pi-footer-manager
|
|
25
|
+
```
|
|
26
|
+
|
|
7
27
|

|
|
8
28
|
|
|
9
29
|
## Included extensions
|
|
@@ -14,6 +34,20 @@ One footer, many extensions: build flexible Pi footers from reusable fragments w
|
|
|
14
34
|
- `fragments/quota-footer-fragment-text.ts` — text-focused quota usage display
|
|
15
35
|
- `fragments/context-gauge-text-fragment.ts` — text version of context usage
|
|
16
36
|
|
|
37
|
+
## Public API for custom fragment extensions
|
|
38
|
+
|
|
39
|
+
External extensions can integrate with the footer manager through:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import {
|
|
43
|
+
FOOTER_MANAGER_REGISTER_FRAGMENT,
|
|
44
|
+
FOOTER_MANAGER_UNREGISTER_FRAGMENT,
|
|
45
|
+
type FooterFragmentRegistration,
|
|
46
|
+
} from "pi-footer-manager/api";
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This is the supported public integration surface for custom fragment extensions. It avoids fragile cross-extension relative imports and lets third-party fragment extensions live in their own repos or packages.
|
|
50
|
+
|
|
17
51
|
## How configuration works
|
|
18
52
|
|
|
19
53
|
Layout is configured under `footerManager.layout` in Pi settings.
|
|
@@ -164,6 +198,8 @@ See detailed fragment API docs and examples in:
|
|
|
164
198
|
|
|
165
199
|
- [`footer-manager/README.md`](./footer-manager/README.md)
|
|
166
200
|
|
|
201
|
+
The public integration module for external fragment extensions is `pi-footer-manager/api`.
|
|
202
|
+
|
|
167
203
|
## Check
|
|
168
204
|
|
|
169
205
|
```bash
|
package/footer-manager/README.md
CHANGED
|
@@ -10,7 +10,7 @@ It calls `ctx.ui.setFooter(...)` once, while other extensions contribute footer
|
|
|
10
10
|
import {
|
|
11
11
|
FOOTER_MANAGER_REGISTER_FRAGMENT,
|
|
12
12
|
type FooterFragmentRegistration,
|
|
13
|
-
} from "
|
|
13
|
+
} from "pi-footer-manager/api";
|
|
14
14
|
|
|
15
15
|
export default function (pi) {
|
|
16
16
|
pi.on("session_start", async () => {
|
|
@@ -41,6 +41,8 @@ pi.events.emit("footer-manager:invalidate", { id: "my-extension.timer" });
|
|
|
41
41
|
|
|
42
42
|
Invalidations are coalesced and the manager owns `tui.requestRender()`.
|
|
43
43
|
|
|
44
|
+
For external extensions, `pi-footer-manager/api` is the supported integration surface. It exports the fragment event names and the main fragment/layout types without requiring fragile cross-extension relative imports.
|
|
45
|
+
|
|
44
46
|
## Layout configuration
|
|
45
47
|
|
|
46
48
|
Settings live under `footerManager.layout`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export {
|
|
2
|
+
FOOTER_MANAGER_REGISTER_FRAGMENT,
|
|
3
|
+
FOOTER_MANAGER_UNREGISTER_FRAGMENT,
|
|
4
|
+
FOOTER_MANAGER_INVALIDATE,
|
|
5
|
+
} from "./types.js";
|
|
6
|
+
|
|
7
|
+
export type {
|
|
8
|
+
FooterFragmentRegistration,
|
|
9
|
+
FooterRenderEnv,
|
|
10
|
+
FooterFragmentComponent,
|
|
11
|
+
FooterRegionAlign,
|
|
12
|
+
FooterRegionWidth,
|
|
13
|
+
FooterRegionConfig,
|
|
14
|
+
FooterRowConfig,
|
|
15
|
+
FooterLayoutConfig,
|
|
16
|
+
FooterManagerSettings,
|
|
17
|
+
} from "./types.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-footer-manager",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "One footer, many extensions: build flexible Pi footers from reusable fragments with configurable layout and built-in fragments instead of competing `setFooter()` calls. `pi-footer-manager` lets one extension own footer rendering while built-in and custom fragments are arranged through a shared API and flexible layout system.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
"extension",
|
|
10
10
|
"footer-manager"
|
|
11
11
|
],
|
|
12
|
-
"exports":
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./footer-manager/index.ts",
|
|
14
|
+
"./api": "./footer-manager/api.ts"
|
|
15
|
+
},
|
|
13
16
|
"files": [
|
|
14
17
|
"footer-manager",
|
|
15
18
|
"fragments",
|