@autono/pinbox-toolbar 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/dist/vue.d.ts ADDED
@@ -0,0 +1,39 @@
1
+ import { d as PinboxToolbarElement, n as PinboxConfig } from "./index-ZR3JBQu-.js";
2
+ import { VNode } from "vue";
3
+ //#region src/vue.d.ts
4
+ /** The slice of the Vue component instance this wrapper touches. */
5
+ interface WrapperInstance {
6
+ $el: Element;
7
+ config: PinboxConfig;
8
+ _pbEl?: PinboxToolbarElement;
9
+ }
10
+ /**
11
+ * `<PinboxToolbar :config="{ endpoint }" />` — forwards the config ONCE on mount (the
12
+ * element does not support live reconfiguration; re-key to change endpoints), removes the
13
+ * element on unmount. Created + configured BEFORE insertion because the element starts
14
+ * its transport in connectedCallback.
15
+ */
16
+ declare const PinboxToolbar: {
17
+ name: string;
18
+ props: {
19
+ config: {
20
+ type: ObjectConstructor;
21
+ required: boolean;
22
+ };
23
+ };
24
+ mounted(this: WrapperInstance): void;
25
+ unmounted(this: WrapperInstance): void;
26
+ render(): VNode;
27
+ };
28
+ /** The slice of a Vue `App` the install helper touches. */
29
+ interface AppLike {
30
+ unmount: () => void;
31
+ }
32
+ /**
33
+ * Plain functional install helper: `installPinbox(app, { endpoint })` mounts one toolbar
34
+ * for the whole app (appended to document.body, outside Vue's tree) and tears it down
35
+ * when the app unmounts. For per-view control use the `PinboxToolbar` component instead.
36
+ */
37
+ declare function installPinbox(app: AppLike, config: PinboxConfig): void;
38
+ //#endregion
39
+ export { PinboxToolbar, installPinbox };
package/dist/vue.js ADDED
@@ -0,0 +1,48 @@
1
+ import { n as defineToolbarElement, r as PinboxToolbarElement } from "./src-BoLg81_j.js";
2
+ import { h } from "vue";
3
+ //#region src/vue.ts
4
+ /**
5
+ * `<PinboxToolbar :config="{ endpoint }" />` — forwards the config ONCE on mount (the
6
+ * element does not support live reconfiguration; re-key to change endpoints), removes the
7
+ * element on unmount. Created + configured BEFORE insertion because the element starts
8
+ * its transport in connectedCallback.
9
+ */
10
+ const PinboxToolbar = {
11
+ name: "PinboxToolbar",
12
+ props: { config: {
13
+ type: Object,
14
+ required: true
15
+ } },
16
+ mounted() {
17
+ defineToolbarElement();
18
+ const el = document.createElement(PinboxToolbarElement.tagName);
19
+ el.configure(this.config);
20
+ this._pbEl = el;
21
+ this.$el.appendChild(el);
22
+ },
23
+ unmounted() {
24
+ this._pbEl?.remove();
25
+ delete this._pbEl;
26
+ },
27
+ render() {
28
+ return h("div", { style: { display: "contents" } });
29
+ }
30
+ };
31
+ /**
32
+ * Plain functional install helper: `installPinbox(app, { endpoint })` mounts one toolbar
33
+ * for the whole app (appended to document.body, outside Vue's tree) and tears it down
34
+ * when the app unmounts. For per-view control use the `PinboxToolbar` component instead.
35
+ */
36
+ function installPinbox(app, config) {
37
+ defineToolbarElement();
38
+ const el = document.createElement(PinboxToolbarElement.tagName);
39
+ el.configure(config);
40
+ document.body.appendChild(el);
41
+ const unmount = app.unmount;
42
+ app.unmount = () => {
43
+ el.remove();
44
+ unmount.call(app);
45
+ };
46
+ }
47
+ //#endregion
48
+ export { PinboxToolbar, installPinbox };
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "@autono/pinbox-toolbar",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/autonoco/pinbox.git",
9
+ "directory": "packages/toolbar"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "sideEffects": [
15
+ "./dist/*.js"
16
+ ],
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./dist/index.js"
24
+ },
25
+ "./react": {
26
+ "types": "./dist/react.d.ts",
27
+ "default": "./dist/react.js"
28
+ },
29
+ "./vue": {
30
+ "types": "./dist/vue.d.ts",
31
+ "default": "./dist/vue.js"
32
+ },
33
+ "./svelte": {
34
+ "types": "./dist/svelte.d.ts",
35
+ "default": "./dist/svelte.js"
36
+ },
37
+ "./vite": {
38
+ "types": "./dist/plugins/vite.d.ts",
39
+ "default": "./dist/plugins/vite.js"
40
+ },
41
+ "./next": {
42
+ "types": "./dist/plugins/next.d.ts",
43
+ "default": "./dist/plugins/next.js"
44
+ },
45
+ "./package.json": "./package.json"
46
+ },
47
+ "scripts": {
48
+ "typecheck": "tsc --noEmit",
49
+ "build": "tsdown",
50
+ "demo": "bun demo/serve.ts",
51
+ "test": "bun test"
52
+ },
53
+ "peerDependencies": {
54
+ "react": "^18.0.0 || ^19.0.0",
55
+ "svelte": "^4.0.0 || ^5.0.0",
56
+ "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0",
57
+ "vue": "^3.3.0"
58
+ },
59
+ "peerDependenciesMeta": {
60
+ "react": {
61
+ "optional": true
62
+ },
63
+ "svelte": {
64
+ "optional": true
65
+ },
66
+ "vite": {
67
+ "optional": true
68
+ },
69
+ "vue": {
70
+ "optional": true
71
+ }
72
+ },
73
+ "devDependencies": {
74
+ "@autono/pinbox-core": "0.0.0",
75
+ "@types/react": "^19.2.0",
76
+ "typescript": "^7.0.0",
77
+ "tsdown": "^0.22.0",
78
+ "svelte": "^5.45.0",
79
+ "vite": "^8.2.0",
80
+ "vue": "^3.5.0",
81
+ "@types/bun": "^1.3.0",
82
+ "happy-dom": "^20.0.11"
83
+ }
84
+ }