@markupai/sidebar-adapter 1.3.0 → 1.3.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 +24 -0
- package/asyncapi.json +1893 -0
- package/dist/adapters/pluginAdapter.d.ts +7 -0
- package/dist/adapters/pluginAdapter.d.ts.map +1 -1
- package/dist/adapters/sidebarAdapter.d.ts +7 -2
- package/dist/adapters/sidebarAdapter.d.ts.map +1 -1
- package/dist/ipc/call-signatures.d.ts +10 -2
- package/dist/ipc/call-signatures.d.ts.map +1 -1
- package/dist/ipc/plugin-ipc-adapter.d.ts +6 -0
- package/dist/ipc/plugin-ipc-adapter.d.ts.map +1 -1
- package/dist/ipc/sidebar-ipc-adapter.d.ts +2 -1
- package/dist/ipc/sidebar-ipc-adapter.d.ts.map +1 -1
- package/dist/main.js +124 -112
- package/dist/main.umd.cjs +5 -5
- package/dist/types/common.d.ts +22 -7
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/integrationSettings.d.ts +9 -4
- package/dist/types/integrationSettings.d.ts.map +1 -1
- package/dist/types/pluginInterface.d.ts +18 -0
- package/dist/types/pluginInterface.d.ts.map +1 -1
- package/dist/types/sidebarInterface.d.ts +9 -5
- package/dist/types/sidebarInterface.d.ts.map +1 -1
- package/package.json +14 -6
|
@@ -70,6 +70,13 @@ export declare class PluginAdapter {
|
|
|
70
70
|
* callers should then fall back to `globalThis.open`.
|
|
71
71
|
*/
|
|
72
72
|
openAuthUrl(url: string): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Ask the host plugin to write text to the system clipboard.
|
|
75
|
+
* The returned promise rejects if the host has not implemented the handler;
|
|
76
|
+
* callers should then fall back to the in-iframe clipboard paths
|
|
77
|
+
* (`navigator.clipboard.writeText` / `document.execCommand("copy")`).
|
|
78
|
+
*/
|
|
79
|
+
copyToClipboard(text: string): Promise<void>;
|
|
73
80
|
/**
|
|
74
81
|
* Notify the host plugin that the user changed an integration-settings
|
|
75
82
|
* value. Optional on the host side — the returned promise rejects if the
|
|
@@ -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;;OAEG;IACU,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC;IAKpD;;;OAGG;IACU,UAAU,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAKpE;;;OAGG;IACU,kBAAkB,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAK5E;;OAEG;IACU,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAKnF;;OAEG;IACU,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9D;;OAEG;IACU,UAAU,CACrB,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;IAKhB;;OAEG;IACU,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAKzC;;OAEG;IACU,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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 } from "../types";
|
|
2
|
+
import type { IntegrationSettingsPatch, IntegrationSettingsSnapshot, PluginInterface, PluginStatusType } from "../types";
|
|
3
3
|
/**
|
|
4
4
|
* Options for SidebarAdapter constructor
|
|
5
5
|
*/
|
|
@@ -25,8 +25,13 @@ export declare class SidebarAdapter {
|
|
|
25
25
|
/**
|
|
26
26
|
* Notify sidebar of plugin status changes
|
|
27
27
|
* Example method demonstrating Plugin → Sidebar communication
|
|
28
|
+
*
|
|
29
|
+
* @param status - Status message to surface in the sidebar.
|
|
30
|
+
* @param type - Optional severity (`"error"` / `"warning"` / `"info"`)
|
|
31
|
+
* controlling the sidebar notification's icon and color. Defaults to
|
|
32
|
+
* `"info"` when omitted.
|
|
28
33
|
*/
|
|
29
|
-
notifyPluginStatus(status: string): Promise<void>;
|
|
34
|
+
notifyPluginStatus(status: string, type?: PluginStatusType): Promise<void>;
|
|
30
35
|
/**
|
|
31
36
|
* Request sidebar to activate (expand and scroll to) the card for the given issue.
|
|
32
37
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebarAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/sidebarAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,E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AAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrF;;;;;;;;;OASG;IACU,sBAAsB,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAI3E;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;CAG1C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, AgenticIssuePayload } from "../types/common";
|
|
1
|
+
import type { ContentRange, ContentReplacement, ContentInfo, SidebarConfig, 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.
|
|
@@ -59,6 +59,11 @@ export interface CallSignatures {
|
|
|
59
59
|
* See {@link PluginInterface.openAuthUrl}.
|
|
60
60
|
*/
|
|
61
61
|
openAuthUrl(url: string): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Ask the plugin to write text to the system clipboard.
|
|
64
|
+
* See {@link PluginInterface.copyToClipboard}.
|
|
65
|
+
*/
|
|
66
|
+
copyToClipboard(text: string): Promise<void>;
|
|
62
67
|
/**
|
|
63
68
|
* Notify plugin when the user changes a value in the integration-settings
|
|
64
69
|
* form. Optional on the plugin side; absent handler is a no-op.
|
|
@@ -68,8 +73,11 @@ export interface CallSignatures {
|
|
|
68
73
|
/**
|
|
69
74
|
* Notify sidebar of plugin status changes
|
|
70
75
|
* Optional method - demonstrates Plugin → Sidebar communication pattern
|
|
76
|
+
* @param status - Status message from the plugin
|
|
77
|
+
* @param type - Optional severity controlling the sidebar's notification
|
|
78
|
+
* icon/color; defaults to `"info"` when omitted.
|
|
71
79
|
*/
|
|
72
|
-
onPluginStatusChange?(status: string): Promise<void>;
|
|
80
|
+
onPluginStatusChange?(status: string, type?: PluginStatusType): Promise<void>;
|
|
73
81
|
/**
|
|
74
82
|
* Request sidebar to activate (expand and scroll to) the card for the given issue id.
|
|
75
83
|
*/
|
|
@@ -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,
|
|
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;;;OAGG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvE;;;OAGG;IACH,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/F;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7B;;OAEG;IACH,uBAAuB,CAAC,YAAY,EAAE,kBAA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AAO,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;CAChE"}
|
|
@@ -70,6 +70,12 @@ export declare class PluginIPCAdapter {
|
|
|
70
70
|
* back (e.g. to `globalThis.open`).
|
|
71
71
|
*/
|
|
72
72
|
openAuthUrl(url: string): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Ask the plugin to write text to the system clipboard.
|
|
75
|
+
* Throws if the plugin has not registered a handler, so callers can fall
|
|
76
|
+
* back (e.g. to `navigator.clipboard.writeText`).
|
|
77
|
+
*/
|
|
78
|
+
copyToClipboard(text: string): Promise<void>;
|
|
73
79
|
/**
|
|
74
80
|
* Notify plugin when the user changes a value in the integration-settings
|
|
75
81
|
* form. Throws if the plugin has not registered a handler; callers should
|
|
@@ -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,
|
|
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;A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;OAEG;IACU,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrD;;;;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;;;;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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IPCConfig } from "../ipc/message-types";
|
|
2
|
+
import type { PluginStatusType } from "../types/common";
|
|
2
3
|
import type { IntegrationSettingsPatch, IntegrationSettingsSnapshot } from "../types/integrationSettings";
|
|
3
4
|
import type { PluginInterface } from "../types/pluginInterface";
|
|
4
5
|
/**
|
|
@@ -34,7 +35,7 @@ export declare class SidebarIPCAdapter {
|
|
|
34
35
|
* Notify sidebar of plugin status changes
|
|
35
36
|
* Example method demonstrating Plugin → Sidebar communication
|
|
36
37
|
*/
|
|
37
|
-
notifyPluginStatus(status: string): Promise<void>;
|
|
38
|
+
notifyPluginStatus(status: string, type?: PluginStatusType): Promise<void>;
|
|
38
39
|
/**
|
|
39
40
|
* Apply a host-driven patch to the sidebar's integration-settings form.
|
|
40
41
|
*/
|
|
@@ -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;AACjE,OAAO,KAAK,EAAuB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,KAAK,EAGV,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;gBAGpC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,iBAAiB,EACzB,GAAG,CAAC,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,SAAS,EAClB,YAAY,GAAE,MAAY;IAqB5B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAqB5B;IAEF,OAAO,CAAC,iBAAiB;IA4IzB;;OAEG;IACU,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKjE;;OAEG;IACU,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKnE;;OAEG;IACU,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKrE;;OAEG;IACU,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKhE;;;OAGG;IACU,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvF;;OAEG;IACU,wBAAwB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKrF;;OAEG;IACU,sBAAsB,IAAI,OAAO,CAAC,2BAA2B,CAAC;IAK3E;;OAEG;IACI,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI;IAIzC;;OAEG;IACI,OAAO,IAAI,IAAI;CAKvB"}
|
package/dist/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ne = /* @__PURE__ */ (function(e) {
|
|
2
2
|
return e.TEXT_PLAIN = "text/plain", e.TEXT_MARKDOWN = "text/markdown", e.TEXT_HTML = "text/html", e.APPLICATION_DITA_XML = "application/dita+xml", e;
|
|
3
3
|
})({}), ae = [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
"text/plain",
|
|
5
|
+
"text/markdown",
|
|
6
|
+
"text/html",
|
|
7
|
+
"application/dita+xml"
|
|
8
8
|
], oe = {
|
|
9
9
|
integrationName: "unknown",
|
|
10
10
|
integrationVersion: "unknown",
|
|
@@ -21,26 +21,26 @@ var I = /* @__PURE__ */ (function(e) {
|
|
|
21
21
|
const r = i;
|
|
22
22
|
return typeof r.value == "string" && typeof r.label == "string";
|
|
23
23
|
}) : !1;
|
|
24
|
-
},
|
|
24
|
+
}, O = class D extends Error {
|
|
25
25
|
name = "TextLookupError";
|
|
26
26
|
constructor(t) {
|
|
27
|
-
super(t), Object.setPrototypeOf(this,
|
|
27
|
+
super(t), Object.setPrototypeOf(this, D.prototype);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
function ce(e) {
|
|
31
|
-
return e instanceof
|
|
31
|
+
return e instanceof O;
|
|
32
32
|
}
|
|
33
|
-
var
|
|
34
|
-
function
|
|
35
|
-
const t = e.message ?? "", i = e.name, r = typeof i == "string" && i in
|
|
33
|
+
var P = { TextLookupError: (e) => new O(e) };
|
|
34
|
+
function B(e) {
|
|
35
|
+
const t = e.message ?? "", i = e.name, r = typeof i == "string" && i in P ? P[i] : void 0;
|
|
36
36
|
return r ? r(t, e) : Object.assign(new Error(t), i ? { name: i } : {});
|
|
37
37
|
}
|
|
38
|
-
var
|
|
38
|
+
var E = () => {
|
|
39
39
|
}, U = class {
|
|
40
40
|
_promise;
|
|
41
41
|
[Symbol.toStringTag] = "Promise";
|
|
42
|
-
resolve =
|
|
43
|
-
reject =
|
|
42
|
+
resolve = E;
|
|
43
|
+
reject = E;
|
|
44
44
|
constructor() {
|
|
45
45
|
this._promise = new Promise((e, t) => {
|
|
46
46
|
this.resolve = e, this.reject = t;
|
|
@@ -55,7 +55,7 @@ var R = () => {
|
|
|
55
55
|
finally(e) {
|
|
56
56
|
return this._promise.finally(e);
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, H = { timeout: 1e4 }, x = class {
|
|
59
59
|
promisesByID = {};
|
|
60
60
|
receiversByName = {};
|
|
61
61
|
currentID = 0;
|
|
@@ -63,7 +63,7 @@ var R = () => {
|
|
|
63
63
|
postMessage;
|
|
64
64
|
constructor(e, t) {
|
|
65
65
|
this.postMessage = e, this.config = {
|
|
66
|
-
...
|
|
66
|
+
...H,
|
|
67
67
|
...t
|
|
68
68
|
};
|
|
69
69
|
}
|
|
@@ -169,7 +169,7 @@ var R = () => {
|
|
|
169
169
|
const { promise: r, timeoutId: a } = this.promisesByID[t];
|
|
170
170
|
clearTimeout(a);
|
|
171
171
|
try {
|
|
172
|
-
const n =
|
|
172
|
+
const n = B(JSON.parse(i));
|
|
173
173
|
r.reject(n);
|
|
174
174
|
} catch {
|
|
175
175
|
r.reject(/* @__PURE__ */ new Error("Failed to parse error from IPC"));
|
|
@@ -182,12 +182,12 @@ var R = () => {
|
|
|
182
182
|
clearTimeout(t), e.reject(/* @__PURE__ */ new Error("IPC destroyed"));
|
|
183
183
|
this.promisesByID = {}, this.receiversByName = {};
|
|
184
184
|
}
|
|
185
|
-
},
|
|
185
|
+
}, j = class {
|
|
186
186
|
ipc;
|
|
187
187
|
sidebar;
|
|
188
188
|
targetOrigin;
|
|
189
189
|
constructor(e, t, i = "*") {
|
|
190
|
-
this.sidebar = e || {}, this.targetOrigin = i, this.ipc = new
|
|
190
|
+
this.sidebar = e || {}, this.targetOrigin = i, this.ipc = new x((r) => {
|
|
191
191
|
window.parent.postMessage(r, this.targetOrigin);
|
|
192
192
|
}, t), window.addEventListener("message", this.handleMessage), this.registerReceivers();
|
|
193
193
|
}
|
|
@@ -198,8 +198,8 @@ var R = () => {
|
|
|
198
198
|
registerReceivers() {
|
|
199
199
|
if (this.sidebar.onPluginStatusChange) {
|
|
200
200
|
const e = this.sidebar.onPluginStatusChange;
|
|
201
|
-
this.ipc.receive("onPluginStatusChange", async (t) => {
|
|
202
|
-
await e(t);
|
|
201
|
+
this.ipc.receive("onPluginStatusChange", async (t, i) => {
|
|
202
|
+
await e(t, i);
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
if (this.sidebar.activateAgenticIssue) {
|
|
@@ -273,6 +273,9 @@ var R = () => {
|
|
|
273
273
|
async openAuthUrl(e) {
|
|
274
274
|
await this.ipc.call("openAuthUrl", e);
|
|
275
275
|
}
|
|
276
|
+
async copyToClipboard(e) {
|
|
277
|
+
await this.ipc.call("copyToClipboard", e);
|
|
278
|
+
}
|
|
276
279
|
async onIntegrationSettingsChange(e, t) {
|
|
277
280
|
await this.ipc.call("onIntegrationSettingsChange", e, t);
|
|
278
281
|
}
|
|
@@ -295,10 +298,10 @@ var R = () => {
|
|
|
295
298
|
destroy() {
|
|
296
299
|
window.removeEventListener("message", this.handleMessage), this.ipc.destroy();
|
|
297
300
|
}
|
|
298
|
-
},
|
|
301
|
+
}, de = class {
|
|
299
302
|
ipcAdapter;
|
|
300
303
|
constructor(e, t, i) {
|
|
301
|
-
this.ipcAdapter = new
|
|
304
|
+
this.ipcAdapter = new j(e, t, i);
|
|
302
305
|
}
|
|
303
306
|
destroy() {
|
|
304
307
|
this.ipcAdapter.destroy();
|
|
@@ -339,6 +342,9 @@ var R = () => {
|
|
|
339
342
|
openAuthUrl(e) {
|
|
340
343
|
return this.ipcAdapter.openAuthUrl(e);
|
|
341
344
|
}
|
|
345
|
+
copyToClipboard(e) {
|
|
346
|
+
return this.ipcAdapter.copyToClipboard(e);
|
|
347
|
+
}
|
|
342
348
|
onIntegrationSettingsChange(e, t) {
|
|
343
349
|
return this.ipcAdapter.onIntegrationSettingsChange(e, t);
|
|
344
350
|
}
|
|
@@ -351,14 +357,14 @@ var R = () => {
|
|
|
351
357
|
getTargetOrigin() {
|
|
352
358
|
return this.ipcAdapter.getTargetOrigin();
|
|
353
359
|
}
|
|
354
|
-
},
|
|
360
|
+
}, F = class {
|
|
355
361
|
ipc;
|
|
356
362
|
plugin;
|
|
357
363
|
iframe;
|
|
358
364
|
window;
|
|
359
365
|
targetOrigin;
|
|
360
366
|
constructor(e, t, i, r, a = "*") {
|
|
361
|
-
this.plugin = e, this.iframe = t, this.window = i ?? window, this.targetOrigin = a, this.ipc = new
|
|
367
|
+
this.plugin = e, this.iframe = t, this.window = i ?? window, this.targetOrigin = a, this.ipc = new x((n) => {
|
|
362
368
|
this.iframe.contentWindow?.postMessage(n, this.targetOrigin);
|
|
363
369
|
}, r), this.window.addEventListener("message", this.handleMessage, !1), this.registerReceivers();
|
|
364
370
|
}
|
|
@@ -398,6 +404,12 @@ var R = () => {
|
|
|
398
404
|
await e(t);
|
|
399
405
|
});
|
|
400
406
|
}
|
|
407
|
+
if (this.plugin.copyToClipboard) {
|
|
408
|
+
const e = this.plugin.copyToClipboard;
|
|
409
|
+
this.ipc.receive("copyToClipboard", async (t) => {
|
|
410
|
+
await e(t);
|
|
411
|
+
});
|
|
412
|
+
}
|
|
401
413
|
if (this.plugin.onIntegrationSettingsChange) {
|
|
402
414
|
const e = this.plugin.onIntegrationSettingsChange;
|
|
403
415
|
this.ipc.receive("onIntegrationSettingsChange", async (t, i) => {
|
|
@@ -417,8 +429,8 @@ var R = () => {
|
|
|
417
429
|
async restoreAgenticIssue(e) {
|
|
418
430
|
await this.ipc.call("restoreAgenticIssue", e);
|
|
419
431
|
}
|
|
420
|
-
async notifyPluginStatus(e) {
|
|
421
|
-
await this.ipc.call("onPluginStatusChange", e);
|
|
432
|
+
async notifyPluginStatus(e, t) {
|
|
433
|
+
await this.ipc.call("onPluginStatusChange", e, t);
|
|
422
434
|
}
|
|
423
435
|
async applyIntegrationSettings(e) {
|
|
424
436
|
await this.ipc.call("applyIntegrationSettings", e);
|
|
@@ -432,16 +444,16 @@ var R = () => {
|
|
|
432
444
|
destroy() {
|
|
433
445
|
this.window.removeEventListener("message", this.handleMessage), this.ipc.destroy();
|
|
434
446
|
}
|
|
435
|
-
},
|
|
447
|
+
}, $ = class {
|
|
436
448
|
ipcAdapter;
|
|
437
449
|
constructor(e, t, i) {
|
|
438
|
-
this.ipcAdapter = new
|
|
450
|
+
this.ipcAdapter = new F(e, t, i?.win, i?.config, i?.targetOrigin);
|
|
439
451
|
}
|
|
440
452
|
destroy() {
|
|
441
453
|
this.ipcAdapter.destroy();
|
|
442
454
|
}
|
|
443
|
-
async notifyPluginStatus(e) {
|
|
444
|
-
await this.ipcAdapter.notifyPluginStatus(e);
|
|
455
|
+
async notifyPluginStatus(e, t) {
|
|
456
|
+
await this.ipcAdapter.notifyPluginStatus(e, t);
|
|
445
457
|
}
|
|
446
458
|
async activateAgenticIssue(e) {
|
|
447
459
|
await this.ipcAdapter.activateAgenticIssue(e);
|
|
@@ -464,7 +476,7 @@ var R = () => {
|
|
|
464
476
|
configure(e) {
|
|
465
477
|
this.ipcAdapter.configure(e);
|
|
466
478
|
}
|
|
467
|
-
},
|
|
479
|
+
}, W = `
|
|
468
480
|
<div class="sidebar-load-overlay-card">
|
|
469
481
|
<div class="sidebar-load-overlay-title">Sidebar failed to load</div>
|
|
470
482
|
<div class="sidebar-load-overlay-description">Check your connection or try again.</div>
|
|
@@ -485,16 +497,16 @@ var R = () => {
|
|
|
485
497
|
<span>Retry</span>
|
|
486
498
|
</button>
|
|
487
499
|
</div>
|
|
488
|
-
`,
|
|
500
|
+
`, G = () => {
|
|
489
501
|
const e = document.createElement("div");
|
|
490
|
-
e.className = "sidebar-load-overlay", e.style.display = "none", e.innerHTML =
|
|
502
|
+
e.className = "sidebar-load-overlay", e.style.display = "none", e.innerHTML = W;
|
|
491
503
|
const t = e.querySelector(".sidebar-load-overlay-button");
|
|
492
504
|
if (!t) throw new Error("Missing retry button in load overlay template.");
|
|
493
505
|
return {
|
|
494
506
|
overlay: e,
|
|
495
507
|
button: t
|
|
496
508
|
};
|
|
497
|
-
},
|
|
509
|
+
}, R = "markupai-sidebar-load-overlay-styles", z = `
|
|
498
510
|
:root {
|
|
499
511
|
--background: #f5f5f4;
|
|
500
512
|
--foreground: #333332;
|
|
@@ -586,55 +598,55 @@ var R = () => {
|
|
|
586
598
|
box-shadow: 0 0 0 2px
|
|
587
599
|
color-mix(in srgb, var(--accent, #ef4640) 60%, transparent);
|
|
588
600
|
}
|
|
589
|
-
`,
|
|
601
|
+
`, J = (e) => {
|
|
590
602
|
const t = e ?? document;
|
|
591
|
-
if (t.getElementById(
|
|
603
|
+
if (t.getElementById(R)) return;
|
|
592
604
|
const i = t.createElement("style");
|
|
593
|
-
i.id =
|
|
605
|
+
i.id = R, i.textContent = z, t.head.appendChild(i);
|
|
594
606
|
}, Y = 8e3, V = 12e3, K = (e, t, i = {}) => {
|
|
595
|
-
|
|
596
|
-
const { sidebarUrl: r, targetOrigin: a, timeoutMs: n = Y, retryIntervalMs: o = V, messageListenWindow: s } = i, l = s ?? (typeof globalThis.window < "u" ? globalThis.window : globalThis), p = () => r ?? t.src,
|
|
607
|
+
J(e.ownerDocument);
|
|
608
|
+
const { sidebarUrl: r, targetOrigin: a, timeoutMs: n = Y, retryIntervalMs: o = V, messageListenWindow: s } = i, l = s ?? (typeof globalThis.window < "u" ? globalThis.window : globalThis), p = () => r ?? t.src, k = () => {
|
|
597
609
|
if (a) return a;
|
|
598
610
|
try {
|
|
599
611
|
return new URL(p()).origin;
|
|
600
612
|
} catch {
|
|
601
613
|
return "*";
|
|
602
614
|
}
|
|
603
|
-
}, { overlay:
|
|
604
|
-
e.appendChild(
|
|
605
|
-
let u = !1, h,
|
|
606
|
-
const
|
|
607
|
-
|
|
615
|
+
}, { overlay: m, button: v } = G();
|
|
616
|
+
e.appendChild(m);
|
|
617
|
+
let u = !1, h, d;
|
|
618
|
+
const g = (c) => {
|
|
619
|
+
m.style.display = c ? "flex" : "none";
|
|
608
620
|
};
|
|
609
|
-
|
|
621
|
+
g(!1);
|
|
610
622
|
const f = () => {
|
|
611
623
|
h && (globalThis.clearTimeout(h), h = void 0);
|
|
612
|
-
},
|
|
624
|
+
}, I = () => {
|
|
613
625
|
f(), h = globalThis.setTimeout(() => {
|
|
614
|
-
u ||
|
|
626
|
+
u || g(!0);
|
|
615
627
|
}, n);
|
|
616
|
-
},
|
|
617
|
-
const
|
|
618
|
-
u = !1,
|
|
619
|
-
},
|
|
620
|
-
|
|
621
|
-
u ||
|
|
628
|
+
}, A = (c) => {
|
|
629
|
+
const y = c?.preserveOverlay ?? !0;
|
|
630
|
+
u = !1, y || g(!1), t.src = p(), I();
|
|
631
|
+
}, N = () => {
|
|
632
|
+
d || o <= 0 || (d = globalThis.setInterval(() => {
|
|
633
|
+
u || A({ preserveOverlay: !0 });
|
|
622
634
|
}, o));
|
|
623
|
-
},
|
|
624
|
-
|
|
625
|
-
},
|
|
635
|
+
}, C = () => {
|
|
636
|
+
d && (globalThis.clearInterval(d), d = void 0);
|
|
637
|
+
}, b = (c) => {
|
|
626
638
|
if (!t.contentWindow || c.source !== t.contentWindow) return;
|
|
627
|
-
const
|
|
628
|
-
|
|
639
|
+
const y = k();
|
|
640
|
+
y !== "*" && c.origin !== y || (u = !0, f(), C(), g(!1));
|
|
629
641
|
}, w = () => {
|
|
630
|
-
f(),
|
|
631
|
-
},
|
|
632
|
-
|
|
642
|
+
f(), g(!0);
|
|
643
|
+
}, S = () => {
|
|
644
|
+
A();
|
|
633
645
|
};
|
|
634
|
-
return v.addEventListener("click",
|
|
635
|
-
f(),
|
|
646
|
+
return v.addEventListener("click", S), t.addEventListener("error", w), l.addEventListener("message", b), I(), N(), () => {
|
|
647
|
+
f(), C(), t.removeEventListener("error", w), l.removeEventListener("message", b), v.removeEventListener("click", S), m.remove();
|
|
636
648
|
};
|
|
637
|
-
},
|
|
649
|
+
}, X = "Markup AI Sidebar", q = "clipboard-read; clipboard-write", ge = "markupai.sidebarNextGen.overrideUrl", pe = "https://sidebar.markup.ai/";
|
|
638
650
|
function ue(e) {
|
|
639
651
|
try {
|
|
640
652
|
return "localStorage" in globalThis && globalThis.localStorage.getItem("markupai.sidebarNextGen.overrideUrl")?.trim() || e;
|
|
@@ -642,12 +654,12 @@ function ue(e) {
|
|
|
642
654
|
return e;
|
|
643
655
|
}
|
|
644
656
|
}
|
|
645
|
-
var
|
|
657
|
+
var Z = "markupai.sidebarNextGen.authOverride";
|
|
646
658
|
function he(e, t) {
|
|
647
659
|
if (!t) return e;
|
|
648
660
|
try {
|
|
649
661
|
if (!("localStorage" in globalThis)) return e;
|
|
650
|
-
const i = globalThis.localStorage.getItem(
|
|
662
|
+
const i = globalThis.localStorage.getItem(Z)?.trim();
|
|
651
663
|
if (!i) return e;
|
|
652
664
|
const r = JSON.parse(i);
|
|
653
665
|
return r !== null && typeof r == "object" && "type" in r && (r.type === "mediation" || r.type === "popup") ? r : e;
|
|
@@ -662,10 +674,10 @@ function fe(e, t) {
|
|
|
662
674
|
return t?.onInvalidUrl?.(e, i), "*";
|
|
663
675
|
}
|
|
664
676
|
}
|
|
665
|
-
function
|
|
677
|
+
function ye(e, t = "Expected SidebarAdapter from createSidebarHost") {
|
|
666
678
|
if (e.adapter === null) throw new Error(t);
|
|
667
679
|
}
|
|
668
|
-
function
|
|
680
|
+
function Q(e) {
|
|
669
681
|
const { iframe: t, iframeMount: i } = e;
|
|
670
682
|
if (t !== void 0 && i !== void 0) throw new Error("createSidebarHost: pass only one of `iframe` or `iframeMount`");
|
|
671
683
|
if (t !== void 0) return {
|
|
@@ -673,18 +685,18 @@ function ee(e) {
|
|
|
673
685
|
removeMountedIframe: null
|
|
674
686
|
};
|
|
675
687
|
if (i === void 0) throw new Error("createSidebarHost: pass either `iframe` or `iframeMount`");
|
|
676
|
-
const { container: r, src: a, allow: n =
|
|
677
|
-
return o.title =
|
|
688
|
+
const { container: r, src: a, allow: n = q } = i, o = document.createElement("iframe");
|
|
689
|
+
return o.title = X, o.src = a, n && o.setAttribute("allow", n), r.appendChild(o), {
|
|
678
690
|
iframe: o,
|
|
679
691
|
removeMountedIframe: () => {
|
|
680
692
|
o.remove();
|
|
681
693
|
}
|
|
682
694
|
};
|
|
683
695
|
}
|
|
684
|
-
function
|
|
685
|
-
const { plugin: t, loadOverlayContainer: i, loadOverlayOptions: r, adapterOptions: a } = e, { iframe: n, removeMountedIframe: o } =
|
|
696
|
+
function me(e) {
|
|
697
|
+
const { plugin: t, loadOverlayContainer: i, loadOverlayOptions: r, adapterOptions: a } = e, { iframe: n, removeMountedIframe: o } = Q(e), s = i !== void 0 ? K(i, n, r ?? {}) : null;
|
|
686
698
|
if (t !== void 0) {
|
|
687
|
-
const l = new
|
|
699
|
+
const l = new $(t, n, a);
|
|
688
700
|
return {
|
|
689
701
|
iframe: n,
|
|
690
702
|
adapter: l,
|
|
@@ -701,14 +713,14 @@ function Ie(e) {
|
|
|
701
713
|
}
|
|
702
714
|
};
|
|
703
715
|
}
|
|
704
|
-
var
|
|
705
|
-
function
|
|
716
|
+
var _ = "sidebarContainer", T = "markupai-sidebar-host-shell-styles";
|
|
717
|
+
function M(e) {
|
|
706
718
|
if (typeof CSS < "u" && typeof CSS.escape == "function") return CSS.escape(e);
|
|
707
719
|
if (!/^[a-zA-Z_][\w-]*$/.test(e)) throw new Error(`sidebar host shell: containerId must match /^[a-zA-Z_][\\w-]*$/ when CSS.escape is unavailable (got ${JSON.stringify(e)})`);
|
|
708
720
|
return e;
|
|
709
721
|
}
|
|
710
|
-
function
|
|
711
|
-
const t =
|
|
722
|
+
function L(e = _) {
|
|
723
|
+
const t = M(e);
|
|
712
724
|
return `
|
|
713
725
|
html {
|
|
714
726
|
height: 100%;
|
|
@@ -733,21 +745,21 @@ body {
|
|
|
733
745
|
}
|
|
734
746
|
`.trim();
|
|
735
747
|
}
|
|
736
|
-
var
|
|
737
|
-
function
|
|
748
|
+
var ve = L();
|
|
749
|
+
function ee(e) {
|
|
738
750
|
return e instanceof Document ? e : e.ownerDocument;
|
|
739
751
|
}
|
|
740
|
-
function
|
|
752
|
+
function te(e, t, i) {
|
|
741
753
|
if (!t || e.getElementById(T)) return;
|
|
742
754
|
const r = e.createElement("style");
|
|
743
|
-
r.id = T, r.textContent =
|
|
755
|
+
r.id = T, r.textContent = L(i), e.head.appendChild(r);
|
|
744
756
|
}
|
|
745
|
-
function
|
|
746
|
-
const { root: t = typeof document < "u" ? document : void 0, containerId: i =
|
|
757
|
+
function Ie(e) {
|
|
758
|
+
const { root: t = typeof document < "u" ? document : void 0, containerId: i = _, includeDefaultStyles: r = !0 } = e ?? {};
|
|
747
759
|
if (t === void 0) throw new Error("ensureSidebarHostShell: no document — pass `root` in non-browser environments");
|
|
748
|
-
const a =
|
|
749
|
-
|
|
750
|
-
const n = t instanceof Document ? a.getElementById(i) : t.querySelector(`#${
|
|
760
|
+
const a = ee(t);
|
|
761
|
+
te(a, r, i);
|
|
762
|
+
const n = t instanceof Document ? a.getElementById(i) : t.querySelector(`#${M(i)}`);
|
|
751
763
|
if (n instanceof HTMLElement && (t instanceof Document || t.contains(n))) return n;
|
|
752
764
|
if (!(t instanceof Document)) {
|
|
753
765
|
const s = a.createElement("div");
|
|
@@ -756,18 +768,18 @@ function ve(e) {
|
|
|
756
768
|
const o = a.createElement("div");
|
|
757
769
|
return o.id = i, a.body.appendChild(o), o;
|
|
758
770
|
}
|
|
759
|
-
function
|
|
771
|
+
function ie() {
|
|
760
772
|
return ' <meta name="viewport" content="width=device-width, initial-scale=1.0" />';
|
|
761
773
|
}
|
|
762
774
|
function Ae(e) {
|
|
763
|
-
const { title: t = "Markup AI Sidebar", headInnerHtml: i = "", includePluginHostHead: r = !1, bodyScriptsHtml: a, htmlLang: n = "en", htmlAttrs: o = `lang="${n}" style="height:100%"`, bodyAttrs: s = 'style="height:100%;margin:0"' } = e, l = [r ?
|
|
775
|
+
const { title: t = "Markup AI Sidebar", headInnerHtml: i = "", includePluginHostHead: r = !1, bodyScriptsHtml: a, htmlLang: n = "en", htmlAttrs: o = `lang="${n}" style="height:100%"`, bodyAttrs: s = 'style="height:100%;margin:0"' } = e, l = [r ? ie() : "", i].filter((p) => p.trim().length > 0).join(`
|
|
764
776
|
`);
|
|
765
777
|
return `<!DOCTYPE html>
|
|
766
778
|
<html ${o}>
|
|
767
779
|
<head>
|
|
768
780
|
<base target="_top" />
|
|
769
781
|
<meta charset="UTF-8" />
|
|
770
|
-
<title>${
|
|
782
|
+
<title>${re(t)}</title>${l ? `
|
|
771
783
|
${l}` : ""}
|
|
772
784
|
</head>
|
|
773
785
|
<body ${s}>
|
|
@@ -776,41 +788,41 @@ ${l}` : ""}
|
|
|
776
788
|
</html>
|
|
777
789
|
`;
|
|
778
790
|
}
|
|
779
|
-
function
|
|
791
|
+
function re(e) {
|
|
780
792
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
781
793
|
}
|
|
782
794
|
export {
|
|
783
|
-
|
|
784
|
-
|
|
795
|
+
Z as AUTH_CONFIG_OVERRIDE_STORAGE_KEY,
|
|
796
|
+
H as DEFAULT_IPC_CONFIG,
|
|
785
797
|
oe as DEFAULT_SIDEBAR_CONFIG,
|
|
786
798
|
U as DeferredPromise,
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
799
|
+
x as IPCCore,
|
|
800
|
+
ne as MimeType,
|
|
801
|
+
de as PluginAdapter,
|
|
802
|
+
j as PluginIPCAdapter,
|
|
791
803
|
pe as SIDEBAR_DEFAULT_PRODUCTION_BASE_URL,
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
804
|
+
_ as SIDEBAR_HOST_CONTAINER_ID,
|
|
805
|
+
ve as SIDEBAR_HOST_SHELL_CSS,
|
|
806
|
+
q as SIDEBAR_IFRAME_DEFAULT_ALLOW,
|
|
807
|
+
X as SIDEBAR_IFRAME_DEFAULT_TITLE,
|
|
808
|
+
ge as SIDEBAR_URL_OVERRIDE_STORAGE_KEY,
|
|
809
|
+
$ as SidebarAdapter,
|
|
810
|
+
F as SidebarIPCAdapter,
|
|
799
811
|
ae as TEXT_MIME_TYPES,
|
|
800
|
-
|
|
801
|
-
|
|
812
|
+
O as TextLookupError,
|
|
813
|
+
ye as assertSidebarHostAdapter,
|
|
802
814
|
Ae as buildSidebarHostHtmlDocument,
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
815
|
+
L as buildSidebarHostShellCss,
|
|
816
|
+
ie as buildSidebarPluginHostHeadInnerHtml,
|
|
817
|
+
me as createSidebarHost,
|
|
818
|
+
Ie as ensureSidebarHostShell,
|
|
807
819
|
he as getAuthConfigWithOverride,
|
|
808
820
|
ue as getSidebarBaseUrlWithOverride,
|
|
809
|
-
|
|
821
|
+
P as ipcErrorReconstructors,
|
|
810
822
|
le as isIntegrationSettingField,
|
|
811
823
|
se as isIntegrationSettingsSchema,
|
|
812
824
|
ce as isTextLookupError,
|
|
813
|
-
|
|
825
|
+
B as reconstructError,
|
|
814
826
|
K as setupSidebarLoadOverlay,
|
|
815
827
|
fe as sidebarPostMessageTargetOrigin
|
|
816
828
|
};
|