@hiver/connector-agent 4.9.0-splitApps-beta.1 → 4.9.0-splitApps-beta.3
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/index.es.js +38 -45
- package/index.umd.js +52 -52
- package/package.json +1 -1
- package/store/appStore.d.ts +1 -0
- package/store/appStore.d.ts.map +1 -1
package/index.es.js
CHANGED
|
@@ -22066,59 +22066,52 @@ const KT = ({ observer: e, ...t }) => /* @__PURE__ */ u.jsx(Zl, { children: /* @
|
|
|
22066
22066
|
return e > 2 ? (console.error("Failed to get connectors list after 3 tries", t), []) : Mp(e + 1);
|
|
22067
22067
|
}
|
|
22068
22068
|
}, eS = (e) => {
|
|
22069
|
-
const { connectorTabSelector: t } = e,
|
|
22069
|
+
const { connectorTabSelector: t, sideBarDropdownSize: n } = e, r = { connectorApiPending: !1, sideBarTabs: 0 };
|
|
22070
22070
|
if (!an())
|
|
22071
22071
|
throw new Error("Please initiate bifrost by calling initConnectorsBifrost function before creating app store");
|
|
22072
|
-
const
|
|
22072
|
+
const i = k6({
|
|
22073
22073
|
name: "app-store",
|
|
22074
22074
|
initialState: {}
|
|
22075
|
-
}),
|
|
22076
|
-
|
|
22077
|
-
|
|
22075
|
+
}), s = () => {
|
|
22076
|
+
r.connectorApiPending || (r.connectorApiPending = !0, Mp().then((d) => {
|
|
22077
|
+
r.connectorApiPending = !1, Yo("setConnectors", d), !(!Array.isArray(d) || !d.length) && i.setData(d, "connectors");
|
|
22078
22078
|
}));
|
|
22079
|
-
},
|
|
22080
|
-
const
|
|
22081
|
-
return
|
|
22082
|
-
}),
|
|
22083
|
-
const
|
|
22084
|
-
if (Yo("setConnectorTabs",
|
|
22085
|
-
if (!
|
|
22086
|
-
const
|
|
22087
|
-
if (!
|
|
22088
|
-
let
|
|
22089
|
-
|
|
22090
|
-
|
|
22091
|
-
}),
|
|
22079
|
+
}, a = (d) => [...d].sort((g, b) => {
|
|
22080
|
+
const y = g.lastAccessed ?? 0, m = b.lastAccessed ?? 0;
|
|
22081
|
+
return y === m ? 0 : y > m ? -1 : 1;
|
|
22082
|
+
}).map((g, b) => ({ ...g, sidebarView: b < r.sideBarTabs })), c = () => {
|
|
22083
|
+
const d = i.getData("connectors"), g = i.getData("tabElement");
|
|
22084
|
+
if (Yo("setConnectorTabs", d, g), !Array.isArray(d) || !d.length) return s();
|
|
22085
|
+
if (!g) return;
|
|
22086
|
+
const b = g.querySelector(`:scope > ${t}`);
|
|
22087
|
+
if (!b) {
|
|
22088
|
+
let I = null;
|
|
22089
|
+
I = new MutationObserver(() => {
|
|
22090
|
+
I == null || I.disconnect(), c();
|
|
22091
|
+
}), I.observe(g, { childList: !0, subtree: !0 });
|
|
22092
22092
|
return;
|
|
22093
22093
|
}
|
|
22094
|
-
const
|
|
22095
|
-
if (!
|
|
22096
|
-
const
|
|
22097
|
-
Yo("calculations", {
|
|
22098
|
-
connectorTabLeft:
|
|
22099
|
-
nonConnectorRight:
|
|
22100
|
-
tabElementRight:
|
|
22101
|
-
gap:
|
|
22102
|
-
tabSpace:
|
|
22103
|
-
spaceAvailable:
|
|
22104
|
-
tabsAvailable:
|
|
22105
|
-
|
|
22106
|
-
|
|
22107
|
-
|
|
22108
|
-
|
|
22109
|
-
|
|
22110
|
-
|
|
22111
|
-
|
|
22112
|
-
|
|
22113
|
-
o.setData(s(E), "connectorTabs");
|
|
22114
|
-
}, c = (l) => {
|
|
22115
|
-
if (!l) return;
|
|
22116
|
-
const d = o.getData("connectorTabs"), g = d == null ? void 0 : d.find((y) => y.id === l);
|
|
22117
|
-
if (!g || g.sidebarView) return;
|
|
22118
|
-
const b = (/* @__PURE__ */ new Date()).getTime();
|
|
22119
|
-
g.lastAccessed = b, o.setData(s(d), "connectorTabs");
|
|
22094
|
+
const y = b.previousElementSibling;
|
|
22095
|
+
if (!y) return;
|
|
22096
|
+
const m = b.getBoundingClientRect().left, p = y.getBoundingClientRect().right, f = g.getBoundingClientRect().right, h = m - p, v = h + b.clientWidth, C = f - p, E = Math.floor(C / v), x = Math.floor((C - n) / v);
|
|
22097
|
+
d.length > E ? r.sideBarTabs = x : r.sideBarTabs = E, Yo("calculations", {
|
|
22098
|
+
connectorTabLeft: m,
|
|
22099
|
+
nonConnectorRight: p,
|
|
22100
|
+
tabElementRight: f,
|
|
22101
|
+
gap: h,
|
|
22102
|
+
tabSpace: v,
|
|
22103
|
+
spaceAvailable: C,
|
|
22104
|
+
tabsAvailable: E,
|
|
22105
|
+
tabsAvailableWithDropdown: x
|
|
22106
|
+
}), i.setData(a(d), "connectorTabs");
|
|
22107
|
+
}, l = (d) => {
|
|
22108
|
+
if (!d) return;
|
|
22109
|
+
const g = i.getData("connectorTabs"), b = g == null ? void 0 : g.find((m) => m.id === d);
|
|
22110
|
+
if (!b || b.sidebarView) return;
|
|
22111
|
+
const y = (/* @__PURE__ */ new Date()).getTime();
|
|
22112
|
+
b.lastAccessed = y, i.setData(a(g), "connectorTabs");
|
|
22120
22113
|
};
|
|
22121
|
-
return
|
|
22114
|
+
return i.subscribe(c, "connectors"), i.subscribe(c, "tabElement", !1), i.subscribe(l, "connectorId", !1), Yo("appStore created", i), i;
|
|
22122
22115
|
};
|
|
22123
22116
|
export {
|
|
22124
22117
|
JT as ActionQueue,
|