@kosdev-code/kos-ui-sdk 3.0.29 → 3.0.30
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/core/core/transport/mock/index.d.ts +2 -0
- package/core/core/transport/mock/index.d.ts.map +1 -1
- package/core/core/transport/mock/mock-boot.d.ts +39 -0
- package/core/core/transport/mock/mock-boot.d.ts.map +1 -0
- package/index.cjs +34 -4
- package/index.cjs.map +1 -1
- package/index.js +35 -5
- package/index.js.map +1 -1
- package/models/models/translation/translation-model.d.ts +4 -2
- package/models/models/translation/translation-model.d.ts.map +1 -1
- package/models/models/translation/types/index.d.ts +24 -6
- package/package.json +2 -2
- package/{software-info-registration-CA13_Qc_.cjs → software-info-registration-BPN4QLfN.cjs} +15 -9
- package/{software-info-registration-CA13_Qc_.cjs.map → software-info-registration-BPN4QLfN.cjs.map} +1 -1
- package/{software-info-registration-CKRUzp_3.js → software-info-registration-BTHhITrs.js} +15 -9
- package/{software-info-registration-CKRUzp_3.js.map → software-info-registration-BTHhITrs.js.map} +1 -1
- package/testing.cjs +1 -1
- package/testing.js +1 -1
- package/ui/contexts/translation-container/kos-translations-provider.d.ts +8 -1
- package/ui/contexts/translation-container/kos-translations-provider.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as subscribe, p as publish, k as kosParentAware, C as CompanionParentModel, K as KosContextManager, M as MultipleFutureContainerSetup, a as MixinModels, R as ReferenceConfig, T as TroubleAwareSetup, D as DependencyModels, E as ExtensionManager, S as SubscriptionHandlers, b as KosViewModelSymbol, V as ViewModelConfig, c as StateMachineSetup, d as DependencyLifecycle, i as injectStateMachineSupport, e as initializeStateMachine, f as ModelEffects, g as KosModelVisitor, h as KosCore, j as sendKosMessageResponse, I as INDEX_RECORD_SYMBOL, l as INDEX_COLLECTION_KEY, m as KosContainerIndexEvents, n as isIndexableItem, o as Kos, q as isKosModel, r as ConfigBean, t as configBeanModelId, u as getRegionInfo, v as getRegions, w as Registration, x as getStateBeanData, y as StateBean, z as getStateProps, A as StateProp, B as deleteKeyValue, F as deleteKeyValueNamespace, G as getKeyValue, H as updateKeyValue, J as addLogOverride, L as getLogGroups, N as getLogOverrides, O as removeLogOverride, P as getTimezone, Q as setDate, U as setTime, W as setTimezone, X as createOverride, Y as getLogStreamBlock, Z as getLogStreamBlocks, _ as getLogStreams, $ as subscribeToLogStream, a0 as unsubscribeFromLogStream, a1 as bulkResolveTroubles, a2 as getTroubles, a3 as resolveTrouble, a4 as sendCanvasData, a5 as getDeviceDetails, a6 as getSerialNumber, a7 as getNetworkInterfaces, a8 as getStorageDevices, a9 as getAvailableUpdates, aa as installUpdate, ab as TranslationContainer, ac as whenReady, ad as KosCoreModelPropertyMapper, ae as CanvasDispatcher, af as KeyValue, ag as destroyKosModel, ah as createClient, ai as kosServiceRequest$8, aj as getSoftwareInfos, ak as getSoftwareInfosWithCancel, al as KosLog, am as LogGroup, an as BASE_URL, ao as kosFetch, ap as kosModel, aq as kosLoggerAware, ar as kosContainerAware, as as kosChild, at as api$8, au as ObservableData, av as WebSocketTransport, aw as kosComputed, ax as KosModelRegistrationFactory, ay as getKosModelSync, az as kosAutoEffect, aA as WebSocketEvents, aB as modelHookCache, aC as isUpdateable, aD as KosModelState, aE as KosModelEvents, aF as clearModelHookCacheEntry, aG as KosTime, aH as SoftwareInfo, aI as getQueryParams, aJ as getKosLocalizationDescriptor, aK as Device, aL as NetworkInterfaceContainer, aM as Ota, aN as StorageDeviceContainer, aO as TimerManager, aP as TIMER_END, aQ as TIMER_EVENT, aR as TOPIC_TIMER_TICK_EVENT, aS as getKosModel, aT as Trouble, aU as TroubleContainer, aV as UsbUpdateContainer, aW as Registration$1 } from "./software-info-registration-
|
|
2
|
-
import { aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM, bN, bO, bP, bQ, bR, bS, bT, bU, bV, bW, bX, bY, bZ, b_, b$, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, cl, cm, cn, co, cp, cq, cr, cs, ct, cu, cv, cw, cx, cy, cz, cA, cB, cC, cD, cE, cF, cG, cH, cI, cJ, cK, cL, cM, cN, cO, cP, cQ, cR, cS, cT, cU, cV, cW, cX, cY, cZ, c_, c$, d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, da, db, dc, dd, de, df, dg, dh, di, dj, dk, dl, dm, dn, dp, dq, dr, ds, dt, du, dv, dw, dx, dy, dz, dA, dB, dC, dD, dE, dF, dG, dH, dI, dJ, dK, dL, dM, dN, dO, dP, dQ, dR, dS, dT, dU, dV, dW, dX, dY, dZ, d_, d$, e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, ea, eb, ec, ed, ee, ef, eg, eh, ei, ej, ek, el, em, en, eo, ep, eq, er, es, et, eu, ev, ew, ex, ey, ez, eA, eB, eC, eD, eE, eF, eG, eH, eI, eJ, eK, eL, eM, eN, eO, eP, eQ, eR, eS, eT, eU, eV, eW, eX, eY, eZ, e_, e$, f0, f1, f2 } from "./software-info-registration-
|
|
1
|
+
import { s as subscribe, p as publish, k as kosParentAware, C as CompanionParentModel, K as KosContextManager, M as MultipleFutureContainerSetup, a as MixinModels, R as ReferenceConfig, T as TroubleAwareSetup, D as DependencyModels, E as ExtensionManager, S as SubscriptionHandlers, b as KosViewModelSymbol, V as ViewModelConfig, c as StateMachineSetup, d as DependencyLifecycle, i as injectStateMachineSupport, e as initializeStateMachine, f as ModelEffects, g as KosModelVisitor, h as KosCore, j as sendKosMessageResponse, I as INDEX_RECORD_SYMBOL, l as INDEX_COLLECTION_KEY, m as KosContainerIndexEvents, n as isIndexableItem, o as Kos, q as isKosModel, r as ConfigBean, t as configBeanModelId, u as getRegionInfo, v as getRegions, w as Registration, x as getStateBeanData, y as StateBean, z as getStateProps, A as StateProp, B as deleteKeyValue, F as deleteKeyValueNamespace, G as getKeyValue, H as updateKeyValue, J as addLogOverride, L as getLogGroups, N as getLogOverrides, O as removeLogOverride, P as getTimezone, Q as setDate, U as setTime, W as setTimezone, X as createOverride, Y as getLogStreamBlock, Z as getLogStreamBlocks, _ as getLogStreams, $ as subscribeToLogStream, a0 as unsubscribeFromLogStream, a1 as bulkResolveTroubles, a2 as getTroubles, a3 as resolveTrouble, a4 as sendCanvasData, a5 as getDeviceDetails, a6 as getSerialNumber, a7 as getNetworkInterfaces, a8 as getStorageDevices, a9 as getAvailableUpdates, aa as installUpdate, ab as TranslationContainer, ac as whenReady, ad as KosCoreModelPropertyMapper, ae as CanvasDispatcher, af as KeyValue, ag as destroyKosModel, ah as createClient, ai as kosServiceRequest$8, aj as getSoftwareInfos, ak as getSoftwareInfosWithCancel, al as KosLog, am as LogGroup, an as BASE_URL, ao as kosFetch, ap as kosModel, aq as kosLoggerAware, ar as kosContainerAware, as as kosChild, at as api$8, au as ObservableData, av as WebSocketTransport, aw as kosComputed, ax as KosModelRegistrationFactory, ay as getKosModelSync, az as kosAutoEffect, aA as WebSocketEvents, aB as modelHookCache, aC as isUpdateable, aD as KosModelState, aE as KosModelEvents, aF as clearModelHookCacheEntry, aG as KosTime, aH as SoftwareInfo, aI as getQueryParams, aJ as getKosLocalizationDescriptor, aK as Device, aL as NetworkInterfaceContainer, aM as Ota, aN as StorageDeviceContainer, aO as TimerManager, aP as TIMER_END, aQ as TIMER_EVENT, aR as TOPIC_TIMER_TICK_EVENT, aS as getKosModel, aT as Trouble, aU as TroubleContainer, aV as UsbUpdateContainer, aW as Registration$1 } from "./software-info-registration-BTHhITrs.js";
|
|
2
|
+
import { aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM, bN, bO, bP, bQ, bR, bS, bT, bU, bV, bW, bX, bY, bZ, b_, b$, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, cl, cm, cn, co, cp, cq, cr, cs, ct, cu, cv, cw, cx, cy, cz, cA, cB, cC, cD, cE, cF, cG, cH, cI, cJ, cK, cL, cM, cN, cO, cP, cQ, cR, cS, cT, cU, cV, cW, cX, cY, cZ, c_, c$, d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, da, db, dc, dd, de, df, dg, dh, di, dj, dk, dl, dm, dn, dp, dq, dr, ds, dt, du, dv, dw, dx, dy, dz, dA, dB, dC, dD, dE, dF, dG, dH, dI, dJ, dK, dL, dM, dN, dO, dP, dQ, dR, dS, dT, dU, dV, dW, dX, dY, dZ, d_, d$, e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, ea, eb, ec, ed, ee, ef, eg, eh, ei, ej, ek, el, em, en, eo, ep, eq, er, es, et, eu, ev, ew, ex, ey, ez, eA, eB, eC, eD, eE, eF, eG, eH, eI, eJ, eK, eL, eM, eN, eO, eP, eQ, eR, eS, eT, eU, eV, eW, eX, eY, eZ, e_, e$, f0, f1, f2 } from "./software-info-registration-BTHhITrs.js";
|
|
3
3
|
import { action, reaction, autorun, makeAutoObservable, runInAction } from "mobx";
|
|
4
4
|
import { makeAutoObservable as makeAutoObservable2, makeObservable } from "mobx";
|
|
5
5
|
import { jsx, jsxs, Fragment } from "@emotion/react/jsx-runtime";
|
|
@@ -662,6 +662,33 @@ function kosViewModel(options) {
|
|
|
662
662
|
return ProxiedClass;
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
|
+
const BOOT_PARAMS = ["kosMock", "kosFixtureServer", "kosFixture", "kosSetup"];
|
|
666
|
+
const bootKey = (params) => BOOT_PARAMS.map((name) => {
|
|
667
|
+
const value = params.get(name);
|
|
668
|
+
if (value === null) return "";
|
|
669
|
+
return name === "kosSetup" ? value.split(",").filter(Boolean).sort().join(",") : value;
|
|
670
|
+
}).join("|");
|
|
671
|
+
function kosMockBootUrl(href, boot) {
|
|
672
|
+
const url = new URL(href);
|
|
673
|
+
const before = bootKey(url.searchParams);
|
|
674
|
+
for (const name of BOOT_PARAMS) url.searchParams.delete(name);
|
|
675
|
+
const setups = boot?.setups?.filter(Boolean) ?? [];
|
|
676
|
+
if (boot && (boot.mode || boot.fixture || setups.length > 0)) {
|
|
677
|
+
url.searchParams.set("kosMock", boot.mode ?? "on");
|
|
678
|
+
if (boot.fixture || setups.length > 0) {
|
|
679
|
+
url.searchParams.set("kosFixtureServer", boot.fixtureServer ?? "");
|
|
680
|
+
}
|
|
681
|
+
if (boot.fixture) url.searchParams.set("kosFixture", boot.fixture);
|
|
682
|
+
if (setups.length > 0) url.searchParams.set("kosSetup", setups.join(","));
|
|
683
|
+
}
|
|
684
|
+
return bootKey(url.searchParams) === before ? void 0 : url.toString();
|
|
685
|
+
}
|
|
686
|
+
function ensureKosMockBoot(boot, location = window.location) {
|
|
687
|
+
const target = kosMockBootUrl(location.href, boot);
|
|
688
|
+
if (target === void 0) return false;
|
|
689
|
+
location.replace(target);
|
|
690
|
+
return true;
|
|
691
|
+
}
|
|
665
692
|
class AncestorPathVisitor extends KosModelVisitor {
|
|
666
693
|
targetId;
|
|
667
694
|
currentPath = [];
|
|
@@ -1515,7 +1542,7 @@ const updateRegion = async (region) => {
|
|
|
1515
1542
|
regionInfo.updateProperty(region);
|
|
1516
1543
|
};
|
|
1517
1544
|
async function getKosServiceApi() {
|
|
1518
|
-
const { default: API } = await import("./software-info-registration-
|
|
1545
|
+
const { default: API } = await import("./software-info-registration-BTHhITrs.js").then((n) => n.f3);
|
|
1519
1546
|
return API;
|
|
1520
1547
|
}
|
|
1521
1548
|
function kosServiceRequest$7(params) {
|
|
@@ -2970,6 +2997,7 @@ const KosTranslationProvider = ({
|
|
|
2970
2997
|
appContext,
|
|
2971
2998
|
locale = "en",
|
|
2972
2999
|
resolver,
|
|
3000
|
+
bundleResolver,
|
|
2973
3001
|
rootUrl,
|
|
2974
3002
|
descriptorResolver,
|
|
2975
3003
|
excludeNamespaces = []
|
|
@@ -3009,6 +3037,7 @@ const KosTranslationProvider = ({
|
|
|
3009
3037
|
descriptor: localization,
|
|
3010
3038
|
defaultNamespace: "common",
|
|
3011
3039
|
resolver,
|
|
3040
|
+
bundleResolver,
|
|
3012
3041
|
rootUrl: _rootUrl
|
|
3013
3042
|
});
|
|
3014
3043
|
setTranslations(translations2);
|
|
@@ -3016,7 +3045,7 @@ const KosTranslationProvider = ({
|
|
|
3016
3045
|
}
|
|
3017
3046
|
}
|
|
3018
3047
|
initLocalization();
|
|
3019
|
-
}, [locale, localization, resolver, resolvedRootUrl]);
|
|
3048
|
+
}, [locale, localization, resolver, bundleResolver, resolvedRootUrl]);
|
|
3020
3049
|
const value = useMemo(() => {
|
|
3021
3050
|
if (ready) {
|
|
3022
3051
|
return {
|
|
@@ -4870,7 +4899,7 @@ function withProjectReloading(WrappedComponent) {
|
|
|
4870
4899
|
return reloading ? /* @__PURE__ */ jsx(LoadingMessage, { message: "Wait a moment while your project reloads..." }) : /* @__PURE__ */ jsx(WrappedComponent, { ...props });
|
|
4871
4900
|
};
|
|
4872
4901
|
}
|
|
4873
|
-
registerApiLevels({ "kos-ui-sdk":
|
|
4902
|
+
registerApiLevels({ "kos-ui-sdk": 26 });
|
|
4874
4903
|
export {
|
|
4875
4904
|
AncestorPathVisitor,
|
|
4876
4905
|
aX as AuthState,
|
|
@@ -5164,6 +5193,7 @@ export {
|
|
|
5164
5193
|
dk as del,
|
|
5165
5194
|
dl as deleteFuture,
|
|
5166
5195
|
destroyKosModel,
|
|
5196
|
+
ensureKosMockBoot,
|
|
5167
5197
|
dm as evaluateScopes,
|
|
5168
5198
|
dn as executeApiMethod,
|
|
5169
5199
|
dp as executeChildrenModelLifecycle,
|