@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.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-ZR3JBQu-.js";
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-BoLg81_j.js";
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 };
@@ -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`. Re-running it
8
- * after an HMR update is a no-op: the existing element is reused and only its `hub`/`token`
9
- * attributes are refreshed (a token that disappeared is removed, never left stale).
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
- if (!el) {
37
- el = document.createElement(TAG);
38
- document.body.appendChild(el);
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
@@ -1,4 +1,4 @@
1
- import { n as PinboxConfig } from "./index-ZR3JBQu-.js";
1
+ import { n as PinboxConfig } from "./index-BAoi0bRT.js";
2
2
  import { ReactElement } from "react";
3
3
  //#region src/react.d.ts
4
4
  /**
package/dist/react.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as defineToolbarElement, r as PinboxToolbarElement } from "./src-BoLg81_j.js";
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
  /**