@autono/pinbox-toolbar 0.1.0 → 0.8.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/index-BAoi0bRT.d.ts +2633 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/plugins/vite.js +11 -7
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/dist/{src-BoLg81_j.js → src-D1qn1iet.js} +430 -33
- package/dist/svelte.d.ts +1 -1
- package/dist/svelte.js +1 -1
- package/dist/toolbar.iife.js +430 -33
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +1 -1
- package/package.json +2 -2
- package/dist/index-ZR3JBQu-.d.ts +0 -206
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as applyHubEvent, a as HubEvent, b as upsertPin, c as WebSocketLike, d as PinboxToolbarElement, f as Draft, g as appendThreadMessage, h as UiStatus, i as ConnectionState, l as HubError, m as ToolbarState, n as PinboxConfig, o as HubTransport, p as Store, r as defineToolbarElement, s as TransportOptions, t as Pinbox, u as StorageLike, v as createStore, x as CaptureResult, y as deriveUiStatus } from "./index-
|
|
1
|
+
import { _ as applyHubEvent, a as HubEvent, b as upsertPin, c as WebSocketLike, d as PinboxToolbarElement, f as Draft, g as appendThreadMessage, h as UiStatus, i as ConnectionState, l as HubError, m as ToolbarState, n as PinboxConfig, o as HubTransport, p as Store, r as defineToolbarElement, s as TransportOptions, t as Pinbox, u as StorageLike, v as createStore, x as CaptureResult, y as deriveUiStatus } from "./index-BAoi0bRT.js";
|
|
2
2
|
export { type CaptureResult, type ConnectionState, type Draft, HubError, type HubEvent, HubTransport, Pinbox, PinboxConfig, PinboxToolbarElement, type StorageLike, type Store, type ToolbarState, type TransportOptions, type UiStatus, type WebSocketLike, appendThreadMessage, applyHubEvent, createStore, defineToolbarElement, deriveUiStatus, upsertPin };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as HubError, c as createStore, i as HubTransport, l as deriveUiStatus, n as defineToolbarElement, o as appendThreadMessage, r as PinboxToolbarElement, s as applyHubEvent, t as Pinbox, u as upsertPin } from "./src-
|
|
1
|
+
import { a as HubError, c as createStore, i as HubTransport, l as deriveUiStatus, n as defineToolbarElement, o as appendThreadMessage, r as PinboxToolbarElement, s as applyHubEvent, t as Pinbox, u as upsertPin } from "./src-D1qn1iet.js";
|
|
2
2
|
export { HubError, HubTransport, Pinbox, PinboxToolbarElement, appendThreadMessage, applyHubEvent, createStore, defineToolbarElement, deriveUiStatus, upsertPin };
|
package/dist/plugins/vite.js
CHANGED
|
@@ -4,9 +4,11 @@ import { a as readHubToken, i as ensureHub, n as VIRTUAL_ID, r as resolveOptions
|
|
|
4
4
|
* Build the module source injected into the dev page.
|
|
5
5
|
*
|
|
6
6
|
* The returned code imports the toolbar element for its side effect (custom element registration),
|
|
7
|
-
* then appends a single `<pinbox-toolbar>` to `document.body` pointed at `hubUrl`.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* then appends a single `<pinbox-toolbar>` to `document.body` pointed at `hubUrl`. Attributes are
|
|
8
|
+
* set BEFORE the append: connectedCallback reads config synchronously on insertion, so an element
|
|
9
|
+
* appended bare would start configless and never connect. Re-running the snippet after an HMR
|
|
10
|
+
* update is a no-op: the existing element is reused and only its `hub`/`token` attributes are
|
|
11
|
+
* refreshed (a token that disappeared is removed, never left stale).
|
|
10
12
|
*
|
|
11
13
|
* The bare `import "@autono/pinbox-toolbar"` below is a SIDE-EFFECT import — it registers the
|
|
12
14
|
* custom element and binds no name. That is why package.json declares
|
|
@@ -33,13 +35,15 @@ const TOKEN = ${token === void 0 ? "null" : JSON.stringify(token)};
|
|
|
33
35
|
|
|
34
36
|
function mount() {
|
|
35
37
|
let el = document.querySelector(TAG);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const created = !el;
|
|
39
|
+
if (!el) el = document.createElement(TAG);
|
|
40
|
+
// Attributes BEFORE insertion: connectedCallback reads its config synchronously
|
|
41
|
+
// on append, so an element inserted bare starts configless and stays dead —
|
|
42
|
+
// the toolbar renders but silently drops every pin.
|
|
40
43
|
el.setAttribute("hub", HUB);
|
|
41
44
|
if (TOKEN === null) el.removeAttribute("token");
|
|
42
45
|
else el.setAttribute("token", TOKEN);
|
|
46
|
+
if (created) document.body.appendChild(el);
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
if (document.readyState === "loading") {
|
package/dist/react.d.ts
CHANGED
package/dist/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as defineToolbarElement, r as PinboxToolbarElement } from "./src-
|
|
1
|
+
import { n as defineToolbarElement, r as PinboxToolbarElement } from "./src-D1qn1iet.js";
|
|
2
2
|
import { createElement, useEffect, useRef } from "react";
|
|
3
3
|
//#region src/react.ts
|
|
4
4
|
/**
|