@markupai/sidebar-adapter 2.0.0 → 2.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/README.md +45 -2
- package/asyncapi.json +46 -6
- package/dist/adapters/index.d.ts +2 -2
- package/dist/adapters/pluginAdapter.d.ts +5 -2
- package/dist/adapters/pluginAdapter.d.ts.map +1 -1
- package/dist/adapters/sidebarAdapter.d.ts +10 -1
- package/dist/adapters/sidebarAdapter.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/ipc/call-signatures.d.ts +6 -3
- package/dist/ipc/call-signatures.d.ts.map +1 -1
- package/dist/ipc/index.d.ts +8 -8
- package/dist/ipc/ipc-core.d.ts +2 -2
- package/dist/ipc/plugin-ipc-adapter.d.ts +6 -3
- package/dist/ipc/plugin-ipc-adapter.d.ts.map +1 -1
- package/dist/ipc/sidebar-build-info.d.ts +22 -0
- package/dist/ipc/sidebar-build-info.d.ts.map +1 -0
- package/dist/ipc/sidebar-ipc-adapter.d.ts +10 -2
- package/dist/ipc/sidebar-ipc-adapter.d.ts.map +1 -1
- package/dist/load-overlay/sidebarLoadOverlay.d.ts +11 -0
- package/dist/load-overlay/sidebarLoadOverlay.d.ts.map +1 -1
- package/dist/main.js +161 -129
- package/dist/main.umd.cjs +6 -6
- package/dist/types/common.d.ts +27 -0
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/pluginInterface.d.ts +15 -3
- package/dist/types/pluginInterface.d.ts.map +1 -1
- package/dist/version.d.ts +10 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,7 +18,8 @@ You do **not** need prior knowledge of how the sidebar is built internally. As a
|
|
|
18
18
|
10. [Sidebar load overlay (standalone)](#sidebarloadoverlay-editor-ui)
|
|
19
19
|
11. [Agentic issue lifecycle](#agentic-issue-lifecycle) · [Document references](#document-references)
|
|
20
20
|
12. [Multi-document hosts](#multi-document-hosts)
|
|
21
|
-
13. [
|
|
21
|
+
13. [Sidebar build reporting](#sidebar-build-reporting) (which sidebar build is running)
|
|
22
|
+
14. [API reference](#api-reference) · [Development](#development)
|
|
22
23
|
|
|
23
24
|
## Features
|
|
24
25
|
|
|
@@ -257,6 +258,8 @@ Use `setupSidebarLoadOverlay` when you manage the iframe yourself and only want
|
|
|
257
258
|
|
|
258
259
|
The overlay listens for the first qualifying **`message`** from **`iframe.contentWindow`** to treat the sidebar as loaded. By default it attaches to the global **`window`**. If the iframe’s **`parent`** is not that window (popup, separate host document), pass **`messageListenWindow`** in options so it matches the iframe’s parent—otherwise the timeout may fire even when the sidebar is healthy.
|
|
259
260
|
|
|
261
|
+
> **Still relevant after the sidebar’s service worker.** The sidebar now registers a service worker that precaches its app shell, so once a host has opened it successfully once, later opens paint from the local cache with no network round-trip — the load timeout and auto-retry then almost never fire. It is **not** redundant, though: the overlay is still the recovery path for the **first-ever open in a host** (cold, nothing cached yet — exactly when a slow or flaky host-machine network hurts most), a host where the service worker cannot register (restricted iframe sandbox, non-secure context), and a genuine origin outage or misconfiguration. The "loaded" signal is unchanged — a cached shell still boots the app and posts the same first `message`. Keep `setupSidebarLoadOverlay` wired up; you may relax `timeoutMs` / `retryIntervalMs` now that warm opens are fast, but don't remove it.
|
|
262
|
+
|
|
260
263
|

|
|
261
264
|
|
|
262
265
|
```typescript
|
|
@@ -484,7 +487,7 @@ For agentic streaming callbacks, issue objects match the exported **`AgenticIssu
|
|
|
484
487
|
|
|
485
488
|
Implement these **on the host** as async functions. The sidebar calls them over IPC and waits on the returned promises (pull style):
|
|
486
489
|
|
|
487
|
-
- `getInitConfig(): Promise<SidebarConfig>` — Integration display name (`integrationName`), stable machine id (`integrationId`), version, feature flags,
|
|
490
|
+
- `getInitConfig(sidebarBuildInfo?: SidebarBuildInfo): Promise<SidebarConfig>` — Integration display name (`integrationName`), stable machine id (`integrationId`), version, feature flags, etc. See the `integrationName` vs `integrationId` note above. Called once per sidebar load; `sidebarBuildInfo` is the sidebar build that is executing (see [Sidebar build reporting](#sidebar-build-reporting)) — declaring the parameter is optional.
|
|
488
491
|
- `getContent(): Promise<ContentInfo>` — Full document (or main buffer) text; must include `documentReference`; `mimeType` optional
|
|
489
492
|
- `getSelectedContent(): Promise<ContentInfo>` — Current selection; same `ContentInfo` rules as `getContent`
|
|
490
493
|
- `selectContent(range: ContentRange, documentReference?: string | null): Promise<void>` — Focus/highlight the document span `[range.start, range.end)`. `documentReference` names the target document for multi-document hosts; omitted/`null` means "whichever document is currently active" (the single-document default — see [Multi-document hosts](#multi-document-hosts))
|
|
@@ -902,6 +905,46 @@ Updates are applied per-field with no coordination between user edits and host p
|
|
|
902
905
|
- This means a reactive host that calls `applyIntegrationSettings` from inside `onIntegrationSettingsChange` (e.g. "if annotations are off, lock viewMode to original") can briefly visually revert a user click if the IPC round-trip lands after the user's own state change has rendered. This is a feature, not a bug — the host's business rule is meant to override — but make sure to apply your rules narrowly so unrelated user edits aren't silently undone.
|
|
903
906
|
- Use `getIntegrationSettings()` rather than caching last-known values when you need to be sure you're reconciling against the sidebar's actual current state.
|
|
904
907
|
|
|
908
|
+
## Sidebar build reporting
|
|
909
|
+
|
|
910
|
+
The sidebar caches its app shell in a service worker, so the build running in your iframe can be **behind** the build the sidebar server currently publishes — a warm load serves the cached bundle while a newer one waits to activate. To make logs and bug reports attributable to an exact build, the sidebar sends a `SidebarBuildInfo` with every `getInitConfig` request:
|
|
911
|
+
|
|
912
|
+
```ts
|
|
913
|
+
interface SidebarBuildInfo {
|
|
914
|
+
version: string; // package version of the executing bundle, e.g. "2.0.2"
|
|
915
|
+
commitHash: string; // short commit hash of the executing bundle, e.g. "abc1234"
|
|
916
|
+
swControlled?: boolean; // true when served through the service-worker cache
|
|
917
|
+
pwaUpdateMode?: "auto" | "prompt"; // how the sidebar activates a newer build
|
|
918
|
+
adapterVersion?: string; // @markupai/sidebar-adapter version inside the sidebar
|
|
919
|
+
}
|
|
920
|
+
```
|
|
921
|
+
|
|
922
|
+
**Log it yourself.** The published adapter strips all of its own console output, so it does not log the build for you. Declare the parameter on your handler, or read the report later from the adapter:
|
|
923
|
+
|
|
924
|
+
```ts
|
|
925
|
+
import { ADAPTER_VERSION, type PluginInterface } from "@markupai/sidebar-adapter";
|
|
926
|
+
|
|
927
|
+
const pluginInterface: PluginInterface = {
|
|
928
|
+
getInitConfig: async (sidebarBuildInfo) => {
|
|
929
|
+
myLogger.info("Sidebar build", {
|
|
930
|
+
sidebar: sidebarBuildInfo ?? "unknown (sidebar predates build reporting)",
|
|
931
|
+
hostAdapterVersion: ADAPTER_VERSION, // compare with sidebarBuildInfo?.adapterVersion
|
|
932
|
+
});
|
|
933
|
+
telemetry.setTag("sidebar_version", sidebarBuildInfo?.version ?? "unknown");
|
|
934
|
+
return { integrationName: "My Editor", integrationVersion: "1.0.0" };
|
|
935
|
+
},
|
|
936
|
+
// …
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
// Any time after the sidebar has initialized — e.g. when the user files a bug report:
|
|
940
|
+
const build = sidebarAdapter.getSidebarBuildInfo(); // SidebarBuildInfo | null
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
- The report is sanitized before you see it: unknown fields are dropped, strings are capped at 64 characters, and a report without a usable `version` and `commitHash` is treated as absent (`undefined` in the handler, `null` from the getter).
|
|
944
|
+
- It is replaced on every sidebar reload. When `auto` update mode activates a newer build, expect two `getInitConfig` requests in quick succession: the cached build, then the new one.
|
|
945
|
+
- `swControlled: true` alone does not mean "stale" — compare `version`/`commitHash` with the server's `/sidebar-info.json` if you need that verdict.
|
|
946
|
+
- Fully backward compatible: handlers declared without the parameter keep compiling, older adapters ignore the argument, and older sidebars simply don't send it.
|
|
947
|
+
|
|
905
948
|
## Development
|
|
906
949
|
|
|
907
950
|
The commands below are for **contributors** working on this npm package’s source. If you only consume **`@markupai/sidebar-adapter`** from your app, you do not need to run them.
|
package/asyncapi.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"asyncapi": "3.0.0",
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Markup AI Sidebar IPC contract",
|
|
5
|
-
"version": "2.
|
|
5
|
+
"version": "2.1.0",
|
|
6
6
|
"description": "Bidirectional RPC-over-postMessage contract between the Markup AI sidebar and its host. Generated from the @markupai/sidebar-adapter TypeScript types — do not hand-edit."
|
|
7
7
|
},
|
|
8
8
|
"channels": {
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
"action": "send",
|
|
198
198
|
"channel": { "$ref": "#/channels/sidebarToPlugin" },
|
|
199
199
|
"title": "getInitConfig",
|
|
200
|
-
"description": "Get initialization configuration from the editor.",
|
|
200
|
+
"description": "Get initialization configuration from the editor. sidebarBuildInfo reports the sidebar build that is executing (absent from sidebars that predate build reporting).",
|
|
201
201
|
"x-optional": false,
|
|
202
202
|
"messages": [{ "$ref": "#/channels/sidebarToPlugin/messages/getInitConfig_call" }],
|
|
203
203
|
"reply": {
|
|
@@ -672,9 +672,9 @@
|
|
|
672
672
|
"name": { "const": "getInitConfig" },
|
|
673
673
|
"data": {
|
|
674
674
|
"type": "array",
|
|
675
|
-
"prefixItems": [],
|
|
675
|
+
"prefixItems": [{ "$ref": "#/components/schemas/SidebarBuildInfo" }],
|
|
676
676
|
"minItems": 0,
|
|
677
|
-
"maxItems":
|
|
677
|
+
"maxItems": 1,
|
|
678
678
|
"items": false
|
|
679
679
|
}
|
|
680
680
|
}
|
|
@@ -1367,6 +1367,36 @@
|
|
|
1367
1367
|
"description": "Severity of a plugin status notification surfaced by the sidebar.\n\nMaps one-to-one onto the sidebar's message-box variants:\n- `\"error\"` — error icon, destructive color\n- `\"warning\"` — warning triangle icon\n- `\"info\"` — info icon; the default applied when the type is omitted",
|
|
1368
1368
|
"title": "PluginStatusType"
|
|
1369
1369
|
},
|
|
1370
|
+
"SidebarBuildInfo": {
|
|
1371
|
+
"type": "object",
|
|
1372
|
+
"properties": {
|
|
1373
|
+
"version": {
|
|
1374
|
+
"type": "string",
|
|
1375
|
+
"description": "Package version compiled into the executing sidebar bundle, e.g. `\"2.0.2\"`."
|
|
1376
|
+
},
|
|
1377
|
+
"commitHash": {
|
|
1378
|
+
"type": "string",
|
|
1379
|
+
"description": "Short git commit hash compiled into the executing sidebar bundle, e.g. `\"abc1234\"`."
|
|
1380
|
+
},
|
|
1381
|
+
"swControlled": {
|
|
1382
|
+
"type": "boolean",
|
|
1383
|
+
"description": "`true` when the sidebar document is controlled by an active service worker (the bundle came through the service-worker cache), `false` when it was loaded from the network or service workers are unavailable."
|
|
1384
|
+
},
|
|
1385
|
+
"pwaUpdateMode": {
|
|
1386
|
+
"type": "string",
|
|
1387
|
+
"enum": ["auto", "prompt"],
|
|
1388
|
+
"description": "Update model the executing bundle was built with."
|
|
1389
|
+
},
|
|
1390
|
+
"adapterVersion": {
|
|
1391
|
+
"type": "string",
|
|
1392
|
+
"description": "Version of `@markupai/sidebar-adapter` compiled into the sidebar."
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1395
|
+
"required": ["version", "commitHash"],
|
|
1396
|
+
"additionalProperties": false,
|
|
1397
|
+
"description": "Identity of the sidebar build that is **executing** in the iframe, sent by the sidebar as the argument of `PluginInterface.getInitConfig`.\n\nThis is the bundle actually running, which can be behind the build the sidebar server currently publishes (`/sidebar-info.json`): a warm load can be served from the service-worker cache while a newer build waits to activate. Compare `version`/`commitHash` against the server's build to tell the two apart. Carries build identity only — never user content or credentials.",
|
|
1398
|
+
"title": "SidebarBuildInfo"
|
|
1399
|
+
},
|
|
1370
1400
|
"SidebarConfig": {
|
|
1371
1401
|
"type": "object",
|
|
1372
1402
|
"properties": {
|
|
@@ -1596,8 +1626,18 @@
|
|
|
1596
1626
|
"description": "Replace multiple contents in the editor"
|
|
1597
1627
|
},
|
|
1598
1628
|
"getInitConfig": {
|
|
1599
|
-
"$comment": "() => Promise<SidebarConfig>",
|
|
1600
|
-
"
|
|
1629
|
+
"$comment": "(sidebarBuildInfo?: SidebarBuildInfo) => Promise<SidebarConfig>",
|
|
1630
|
+
"type": "object",
|
|
1631
|
+
"properties": {
|
|
1632
|
+
"namedArgs": {
|
|
1633
|
+
"type": "object",
|
|
1634
|
+
"properties": {
|
|
1635
|
+
"sidebarBuildInfo": { "$ref": "#/components/schemas/SidebarBuildInfo" }
|
|
1636
|
+
},
|
|
1637
|
+
"additionalProperties": false
|
|
1638
|
+
}
|
|
1639
|
+
},
|
|
1640
|
+
"description": "Get initialization configuration from the editor Called by the sidebar when it's ready to initialize — once per sidebar document load, so again after every sidebar reload.\n\nDeclare the parameter to log or forward the sidebar build with your own logging — the published adapter strips its own console output, so it does not log it for you. The adapter also keeps it for `SidebarAdapter.getSidebarBuildInfo()`. A handler declared with no parameters keeps compiling."
|
|
1601
1641
|
},
|
|
1602
1642
|
"onAgenticAgentResults": {
|
|
1603
1643
|
"$comment": "(\n agentName: string,\n issues: AgenticIssuePayload[],\n documentReference: string | null) => Promise<void>",
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { PluginAdapter } from "
|
|
2
|
-
export { SidebarAdapter, type SidebarAdapterOptions } from "
|
|
1
|
+
export { PluginAdapter } from "./pluginAdapter";
|
|
2
|
+
export { SidebarAdapter, type SidebarAdapterOptions } from "./sidebarAdapter";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CallOptions, IPCConfig } from "../ipc/message-types";
|
|
2
|
-
import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, SidebarInterface, AgenticIssuePayload, IntegrationSettingsValues, IntegrationSettingsChangeMeta } from "../types";
|
|
2
|
+
import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, SidebarBuildInfo, SidebarInterface, AgenticIssuePayload, IntegrationSettingsValues, IntegrationSettingsChangeMeta } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* PluginAdapter - Use in the Sidebar to communicate with the Plugin in the editor
|
|
5
5
|
* This is a wrapper around PluginIPCAdapter for backwards compatibility and ease of use
|
|
@@ -17,8 +17,11 @@ export declare class PluginAdapter {
|
|
|
17
17
|
destroy(): void;
|
|
18
18
|
/**
|
|
19
19
|
* Request initialization configuration from the editor
|
|
20
|
+
* @param sidebarBuildInfo - The executing sidebar build to report to the
|
|
21
|
+
* host (see {@link SidebarBuildInfo}); `adapterVersion` is filled in
|
|
22
|
+
* automatically. Omit to send no report.
|
|
20
23
|
*/
|
|
21
|
-
getInitConfig(): Promise<SidebarConfig>;
|
|
24
|
+
getInitConfig(sidebarBuildInfo?: SidebarBuildInfo): Promise<SidebarConfig>;
|
|
22
25
|
/**
|
|
23
26
|
* Request content from the editor in whatever format the integration supports
|
|
24
27
|
* @param options - Optional per-call overrides (e.g. timeout in ms; overrides default IPC timeout)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pluginAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/pluginAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAEjB;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmB;gBAElC,OAAO,CAAC,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,MAAM;IAKjF;;OAEG;IACI,OAAO,IAAI,IAAI;IAKtB
|
|
1
|
+
{"version":3,"file":"pluginAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/pluginAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KA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;IAItF;;;;;OAKG;IACI,2BAA2B,CAChC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,WAAW,EAC3C,MAAM,EAAE,MAAM,GAAG,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAIhB;;;;;;OAMG;IACI,sBAAsB,CAAC,iBAAiB,GAAE,MAAM,GAAG,IAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrF;;;;OAIG;IACI,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C;;;;;OAKG;IACI,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD;;;;;OAKG;IACI,2BAA2B,CAChC,MAAM,EAAE,yBAAyB,EACjC,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,IAAI,CAAC;IAIhB;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAIzC;;OAEG;IACI,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAIlD;;OAEG;IACI,eAAe,IAAI,MAAM;CAGjC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IPCConfig } from "../ipc/message-types";
|
|
2
|
-
import type { IntegrationSettingsPatch, IntegrationSettingsSnapshot, PluginInterface, PluginStatusType } from "../types";
|
|
2
|
+
import type { IntegrationSettingsPatch, IntegrationSettingsSnapshot, PluginInterface, PluginStatusType, SidebarBuildInfo } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* Options for SidebarAdapter constructor
|
|
5
5
|
*/
|
|
@@ -86,6 +86,15 @@ export declare class SidebarAdapter {
|
|
|
86
86
|
* currently active. No-op if the sidebar has not registered a handler.
|
|
87
87
|
*/
|
|
88
88
|
notifyActiveDocumentChanged(documentReference: string | null): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* The sidebar build that is executing in the iframe, as reported with its
|
|
91
|
+
* most recent `getInitConfig` request — which can be behind the build the
|
|
92
|
+
* sidebar server publishes when a warm load came from the service-worker
|
|
93
|
+
* cache. Use it to attach the precise sidebar version to your own logs or
|
|
94
|
+
* telemetry. `null` before the sidebar's first request, and when the
|
|
95
|
+
* sidebar predates build reporting. Updated on every sidebar reload.
|
|
96
|
+
*/
|
|
97
|
+
getSidebarBuildInfo(): SidebarBuildInfo | null;
|
|
89
98
|
/**
|
|
90
99
|
* Update IPC configuration
|
|
91
100
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebarAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/sidebarAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,eAAe,EACf,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;gBAEnC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAW/F;;OAEG;IACI,OAAO,IAAI,IAAI;IAKtB;;;;;;;;OAQG;IACU,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvF;;;;;;;OAOG;IACU,oBAAoB,CAC/B,OAAO,EAAE,MAAM,EACf,iBAAiB,GAAE,MAAM,GAAG,IAAW,GACtC,OAAO,CAAC,IAAI,CAAC;IAIhB;;OAEG;IACU,s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;OAQG;IACU,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvF;;;;;;;OAOG;IACU,oBAAoB,CAC/B,OAAO,EAAE,MAAM,EACf,iBAAiB,GAAE,MAAM,GAAG,IAAW,GACtC,OAAO,CAAC,IAAI,CAAC;IAIhB;;OAEG;IACU,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE;;;;OAIG;IACU,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrE;;;;OAIG;IACU,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhE;;;;;;;;;;OAUG;IACU,wBAAwB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrF;;;;;;;;;OASG;IACU,sBAAsB,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAI3E;;;;OAIG;IACU,2BAA2B,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzF;;;;;;;OAOG;IACI,mBAAmB,IAAI,gBAAgB,GAAG,IAAI;IAIrD;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;CAG1C"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAGxB,cAAc,UAAU,CAAC;AAGzB,cAAc,sBAAsB,CAAC;AAGrC,cAAc,YAAY,CAAC;AAG3B,cAAc,OAAO,CAAC;AAGtB,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,UAAU,CAAC;AAGzB,cAAc,sBAAsB,CAAC;AAGrC,cAAc,YAAY,CAAC;AAG3B,cAAc,OAAO,CAAC;AAGtB,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, AgenticIssuePayload, PluginStatusType } from "../types/common";
|
|
1
|
+
import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, SidebarBuildInfo, AgenticIssuePayload, PluginStatusType } from "../types/common";
|
|
2
2
|
import type { IntegrationSettingsValues, IntegrationSettingsChangeMeta, IntegrationSettingsPatch, IntegrationSettingsSnapshot } from "../types/integrationSettings";
|
|
3
3
|
/**
|
|
4
4
|
* Call signatures for all bidirectional IPC communication.
|
|
@@ -35,9 +35,12 @@ export interface CallSignatures {
|
|
|
35
35
|
replaceMultipleContents(replacements: ContentReplacement[]): Promise<void>;
|
|
36
36
|
/**
|
|
37
37
|
* Get initialization configuration from the editor
|
|
38
|
-
* This is called by the sidebar when it's ready to initialize
|
|
38
|
+
* This is called by the sidebar when it's ready to initialize.
|
|
39
|
+
* `sidebarBuildInfo` reports the sidebar build that is executing — see
|
|
40
|
+
* {@link PluginInterface.getInitConfig}. Optional so an older sidebar that
|
|
41
|
+
* sends no argument, and a host receiver declared with none, keep working.
|
|
39
42
|
*/
|
|
40
|
-
getInitConfig(): Promise<SidebarConfig>;
|
|
43
|
+
getInitConfig(sidebarBuildInfo?: SidebarBuildInfo): Promise<SidebarConfig>;
|
|
41
44
|
/**
|
|
42
45
|
* Notify plugin when one agent's agentic results are available (streaming).
|
|
43
46
|
* `documentReference` is the run's originating document (`null` when
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-signatures.d.ts","sourceRoot":"","sources":["../../src/ipc/call-signatures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAC7B,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAK7B;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAEnC;;OAEG;IACH,kBAAkB,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAE3C;;;;;;OAMG;IACH,cAAc,CACZ,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,YAAY,EACnB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAChC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;;OAMG;IACH,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErF;;OAEG;IACH,uBAAuB,CAAC,YAAY,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3E
|
|
1
|
+
{"version":3,"file":"call-signatures.d.ts","sourceRoot":"","sources":["../../src/ipc/call-signatures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAC7B,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAK7B;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,WAAW,CA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;OAGG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;;;OAIG;IACH,2BAA2B,CAAC,CAC1B,MAAM,EAAE,yBAAyB,EACjC,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,IAAI,CAAC,CAAC;IAMjB;;;;;;OAMG;IACH,oBAAoB,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9E;;;;;;;OAOG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExF;;OAEG;IACH,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD;;;;;OAKG;IACH,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;;;;OAKG;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;OAGG;IACH,wBAAwB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzE;;;OAGG;IACH,sBAAsB,IAAI,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAE/D;;;;;OAKG;IACH,uBAAuB,CAAC,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3E"}
|
package/dist/ipc/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { DeferredPromise } from "
|
|
2
|
-
export { IPCCore } from "
|
|
3
|
-
export type { ReceiverFn } from "
|
|
4
|
-
export { PluginIPCAdapter } from "
|
|
5
|
-
export { SidebarIPCAdapter } from "
|
|
6
|
-
export type { MessageBase, CallMessage, ResponseMessage, ErrorMessage, IPCMessage, IPCConfig, CallOptions, } from "
|
|
7
|
-
export { DEFAULT_IPC_CONFIG } from "
|
|
8
|
-
export type { CallSignatures } from "
|
|
1
|
+
export { DeferredPromise } from "./deferred-promise";
|
|
2
|
+
export { IPCCore } from "./ipc-core";
|
|
3
|
+
export type { ReceiverFn } from "./ipc-core";
|
|
4
|
+
export { PluginIPCAdapter } from "./plugin-ipc-adapter";
|
|
5
|
+
export { SidebarIPCAdapter } from "./sidebar-ipc-adapter";
|
|
6
|
+
export type { MessageBase, CallMessage, ResponseMessage, ErrorMessage, IPCMessage, IPCConfig, CallOptions, } from "./message-types";
|
|
7
|
+
export { DEFAULT_IPC_CONFIG } from "./message-types";
|
|
8
|
+
export type { CallSignatures } from "./call-signatures";
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/ipc/ipc-core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CallSignatures } from "
|
|
2
|
-
import type { IPCMessage, IPCConfig, CallOptions } from "
|
|
1
|
+
import type { CallSignatures } from "./call-signatures";
|
|
2
|
+
import type { IPCMessage, IPCConfig, CallOptions } from "./message-types";
|
|
3
3
|
export type ReceiverFn<R extends keyof CallSignatures> = (...data: Parameters<NonNullable<CallSignatures[R]>>) => ReturnType<NonNullable<CallSignatures[R]>>;
|
|
4
4
|
/**
|
|
5
5
|
* Core IPC system managing bidirectional communication
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CallOptions, IPCConfig } from "
|
|
2
|
-
import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, AgenticIssuePayload } from "../types/common";
|
|
1
|
+
import type { CallOptions, IPCConfig } from "./message-types";
|
|
2
|
+
import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, SidebarBuildInfo, AgenticIssuePayload } from "../types/common";
|
|
3
3
|
import type { IntegrationSettingsValues, IntegrationSettingsChangeMeta } from "../types/integrationSettings";
|
|
4
4
|
import type { SidebarInterface } from "../types/sidebarInterface";
|
|
5
5
|
/**
|
|
@@ -18,8 +18,11 @@ export declare class PluginIPCAdapter {
|
|
|
18
18
|
private registerReceivers;
|
|
19
19
|
/**
|
|
20
20
|
* Request initialization configuration from the editor
|
|
21
|
+
* @param sidebarBuildInfo - The executing sidebar build to report to the
|
|
22
|
+
* host. `adapterVersion` is filled in with {@link ADAPTER_VERSION} when
|
|
23
|
+
* the caller leaves it out. Omit to send no report.
|
|
21
24
|
*/
|
|
22
|
-
getInitConfig(): Promise<SidebarConfig>;
|
|
25
|
+
getInitConfig(sidebarBuildInfo?: SidebarBuildInfo): Promise<SidebarConfig>;
|
|
23
26
|
/**
|
|
24
27
|
* Request content from the editor in whatever format the integration supports
|
|
25
28
|
* @param options - Optional per-call overrides (e.g. timeout in ms; overrides default IPC timeout)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-ipc-adapter.d.ts","sourceRoot":"","sources":["../../src/ipc/plugin-ipc-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,mBAAmB,EAEpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,yBAAyB,EACzB,6BAA6B,EAE9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-ipc-adapter.d.ts","sourceRoot":"","sources":["../../src/ipc/plugin-ipc-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EA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OAAO,CAAC,IAAI,CAAC;IAIhB;;OAEG;IACU,uBAAuB,CAAC,iBAAiB,GAAE,MAAM,GAAG,IAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5F;;;;OAIG;IACU,2BAA2B,CACtC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,WAAW,EAC3C,MAAM,EAAE,MAAM,GAAG,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAIhB;;;;;OAKG;IACU,sBAAsB,CAAC,iBAAiB,GAAE,MAAM,GAAG,IAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3F;;;;OAIG;IACU,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpD;;;;OAIG;IACU,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzD;;;;OAIG;IACU,2BAA2B,CACtC,MAAM,EAAE,yBAAyB,EACjC,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,IAAI,CAAC;IAIhB;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAIzC;;OAEG;IACI,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAkBlD;;OAEG;IACI,eAAe,IAAI,MAAM;IAIhC;;OAEG;IACI,OAAO,IAAI,IAAI;CAKvB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SidebarBuildInfo } from "../types/common";
|
|
2
|
+
/** Longest string kept from a sidebar build report; longer values are truncated. */
|
|
3
|
+
export declare const SIDEBAR_BUILD_INFO_MAX_STRING_LENGTH = 64;
|
|
4
|
+
/**
|
|
5
|
+
* Validate the build report a sidebar sent with `getInitConfig`. It crosses a
|
|
6
|
+
* frame boundary, so it is treated as untrusted: only a plain object is
|
|
7
|
+
* accepted, fields of the wrong type are dropped, strings are truncated to
|
|
8
|
+
* {@link SIDEBAR_BUILD_INFO_MAX_STRING_LENGTH} characters, and unknown fields
|
|
9
|
+
* are discarded.
|
|
10
|
+
*
|
|
11
|
+
* @returns The sanitized report, or `null` when there is no report or it lacks
|
|
12
|
+
* a usable `version` or `commitHash`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function sanitizeSidebarBuildInfo(raw: unknown): SidebarBuildInfo | null;
|
|
15
|
+
/**
|
|
16
|
+
* The adapter's development/test log line for one `getInitConfig` request
|
|
17
|
+
* (stripped from the published build), e.g.
|
|
18
|
+
* `getInitConfig from sidebar v2.0.2 (abc1234, sw-controlled, auto update mode,
|
|
19
|
+
* sidebar adapter 2.1.0, host adapter 2.1.0)`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function describeSidebarBuildInfo(info: SidebarBuildInfo | null, hostAdapterVersion: string): string;
|
|
22
|
+
//# sourceMappingURL=sidebar-build-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-build-info.d.ts","sourceRoot":"","sources":["../../src/ipc/sidebar-build-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,oFAAoF;AACpF,eAAO,MAAM,oCAAoC,KAAK,CAAC;AAUvD;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,GAAG,IAAI,CAgB9E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,gBAAgB,GAAG,IAAI,EAC7B,kBAAkB,EAAE,MAAM,GACzB,MAAM,CAYR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IPCConfig } from "
|
|
2
|
-
import type { PluginStatusType } from "../types/common";
|
|
1
|
+
import type { IPCConfig } from "./message-types";
|
|
2
|
+
import type { PluginStatusType, SidebarBuildInfo } from "../types/common";
|
|
3
3
|
import type { IntegrationSettingsPatch, IntegrationSettingsSnapshot } from "../types/integrationSettings";
|
|
4
4
|
import type { PluginInterface } from "../types/pluginInterface";
|
|
5
5
|
/**
|
|
@@ -12,6 +12,7 @@ export declare class SidebarIPCAdapter {
|
|
|
12
12
|
private readonly iframe;
|
|
13
13
|
private readonly window;
|
|
14
14
|
private readonly targetOrigin;
|
|
15
|
+
private latestSidebarBuildInfo;
|
|
15
16
|
constructor(plugin: PluginInterface, iframe: HTMLIFrameElement, win?: Window, config?: IPCConfig, targetOrigin?: string);
|
|
16
17
|
private readonly handleMessage;
|
|
17
18
|
private registerReceivers;
|
|
@@ -55,6 +56,13 @@ export declare class SidebarIPCAdapter {
|
|
|
55
56
|
* currently active. No-op if the sidebar has not registered a handler.
|
|
56
57
|
*/
|
|
57
58
|
notifyActiveDocumentChanged(documentReference: string | null): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* The sidebar build reported with the most recent `getInitConfig` request,
|
|
61
|
+
* sanitized. `null` before the sidebar's first request, and when the latest
|
|
62
|
+
* request carried no valid report (a sidebar that predates build
|
|
63
|
+
* reporting). Replaced on every request, so it tracks sidebar reloads.
|
|
64
|
+
*/
|
|
65
|
+
getSidebarBuildInfo(): SidebarBuildInfo | null;
|
|
58
66
|
/**
|
|
59
67
|
* Update IPC configuration
|
|
60
68
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-ipc-adapter.d.ts","sourceRoot":"","sources":["../../src/ipc/sidebar-ipc-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"sidebar-ipc-adapter.d.ts","sourceRoot":"","sources":["../../src/ipc/sidebar-ipc-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EAAuB,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC9F,OAAO,KAAK,EAGV,wBAAwB,EACxB,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K3E;;;;OAIG;IACU,2BAA2B,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzF;;;;;OAKG;IACI,mBAAmB,IAAI,gBAAgB,GAAG,IAAI;IAIrD;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAIzC;;OAEG;IACI,OAAO,IAAI,IAAI;CAKvB"}
|
|
@@ -10,5 +10,16 @@ export type SidebarLoadOverlayOptions = {
|
|
|
10
10
|
*/
|
|
11
11
|
messageListenWindow?: Window;
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Mounts the sidebar "failed to load / retry" overlay: shows it if no
|
|
15
|
+
* `message` arrives from the iframe within `timeoutMs`, auto-retries every
|
|
16
|
+
* `retryIntervalMs`, and exposes a manual retry button.
|
|
17
|
+
*
|
|
18
|
+
* The sidebar precaches its app shell in a service worker, so warm opens
|
|
19
|
+
* (any host that has loaded it once) rarely trip the timeout. Keep this wired
|
|
20
|
+
* up anyway — it is the recovery path for the first cold open in a host, a
|
|
21
|
+
* host where the service worker cannot register, and a real origin outage.
|
|
22
|
+
* See the adapter README, "SidebarLoadOverlay (Editor UI)".
|
|
23
|
+
*/
|
|
13
24
|
export declare const setupSidebarLoadOverlay: (container: HTMLElement, iframe: HTMLIFrameElement, options?: SidebarLoadOverlayOptions) => () => void;
|
|
14
25
|
//# sourceMappingURL=sidebarLoadOverlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebarLoadOverlay.d.ts","sourceRoot":"","sources":["../../src/load-overlay/sidebarLoadOverlay.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAKF,eAAO,MAAM,uBAAuB,GAClC,WAAW,WAAW,EACtB,QAAQ,iBAAiB,EACzB,UAAS,yBAA8B,eAoHxC,CAAC"}
|
|
1
|
+
{"version":3,"file":"sidebarLoadOverlay.d.ts","sourceRoot":"","sources":["../../src/load-overlay/sidebarLoadOverlay.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAKF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAClC,WAAW,WAAW,EACtB,QAAQ,iBAAiB,EACzB,UAAS,yBAA8B,eAoHxC,CAAC"}
|