gomtm 0.0.294 → 0.0.296

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.
@@ -50,7 +50,7 @@ var __async = (__this, __arguments, generator) => {
50
50
  step((generator = generator.apply(__this, __arguments)).next());
51
51
  });
52
52
  };
53
- import { jsx } from "react/jsx-runtime";
53
+ import { jsx, jsxs } from "react/jsx-runtime";
54
54
  import { setCookie } from "mtxlib/clientlib";
55
55
  import { createContext, useContext, useRef } from "react";
56
56
  import { useStore } from "zustand";
@@ -107,7 +107,11 @@ const ListViewStoreProvider = (props) => {
107
107
  const ListView = (props) => {
108
108
  const backendUrl = useGomtm((x) => x.backendUrl);
109
109
  const _a = props, { children } = _a, etc = __objRest(_a, ["children"]);
110
- return /* @__PURE__ */ jsx(ListViewStoreProvider, __spreadProps(__spreadValues({}, props), { backendUrl: backendUrl || "", children }));
110
+ return /* @__PURE__ */ jsxs(ListViewStoreProvider, __spreadProps(__spreadValues({}, props), { backendUrl: backendUrl || "", children: [
111
+ "backendUrl: ",
112
+ backendUrl,
113
+ children
114
+ ] }));
111
115
  };
112
116
  function useListview(selector) {
113
117
  const store = useContext(listViewContext);
@@ -40,6 +40,7 @@ const useGomtmSuspenseQuery = (svc, method, input) => {
40
40
  const useGomtmSuspenseInfiniteQuery = (svc, method, input) => {
41
41
  const backendUrl = useGomtm((x) => x.backendUrl);
42
42
  const cookieStr = useGomtm((x) => x.cookieStr);
43
+ console.log("useGomtmSuspenseInfiniteQuery, backendUrl", backendUrl);
43
44
  const query = useSuspenseInfiniteQuery({
44
45
  queryKey: createInfiniteQueryKey(svc, method, input),
45
46
  queryFn: (k) => goMtmQueryFn({
@@ -105,6 +105,7 @@ function createMtmServiceClientByName(svcName, url, token) {
105
105
  throw new Error(`unknown svcType ${svcName}`);
106
106
  }
107
107
  const baseUrl = url || gomtmApiUrl();
108
+ console.log("createMtmServiceClientByName, baseUrl", baseUrl);
108
109
  return createPromiseClient(
109
110
  svcType,
110
111
  createConnectTransport({
@@ -40,7 +40,7 @@ import { createJSONStorage, persist } from "zustand/middleware";
40
40
  import { createStore } from "zustand/vanilla";
41
41
  import { GoMtmDebug } from "../components/devtools/GoMtmDebug";
42
42
  import { TransportProvider } from "../connectquery";
43
- import { CookieConfigState, HOTKEY_Debug } from "../consts";
43
+ import { CookieConfigState, HOTKEY_Debug, MTM_API_PREFIX } from "../consts";
44
44
  import { anypbTypeReg } from "../messageTypeRegistry";
45
45
  import { gomtmFetcher } from "../mtmFetcher";
46
46
  import { MtReactQueryProvider } from "../providers/ReactQueryProvider";
@@ -88,13 +88,19 @@ const GoMtmAppProvider = (props) => {
88
88
  if (!storeRef.current) {
89
89
  storeRef.current = createGomtmAppStore(props);
90
90
  }
91
- return /* @__PURE__ */ jsx(BearContext.Provider, { value: storeRef.current, children: /* @__PURE__ */ jsxs(MtConnectProvider, { children: [
92
- /* @__PURE__ */ jsxs(MtReactQueryProvider, { children: [
93
- /* @__PURE__ */ jsx(GoMtmDebug, {}),
94
- children
91
+ return /* @__PURE__ */ jsxs(BearContext.Provider, { value: storeRef.current, children: [
92
+ /* @__PURE__ */ jsxs("div", { children: [
93
+ "backendurl: ",
94
+ storeRef.current.getState().backendUrl
95
95
  ] }),
96
- /* @__PURE__ */ jsx(Setup, {})
97
- ] }) });
96
+ /* @__PURE__ */ jsxs(MtConnectProvider, { children: [
97
+ /* @__PURE__ */ jsxs(MtReactQueryProvider, { children: [
98
+ /* @__PURE__ */ jsx(GoMtmDebug, {}),
99
+ children
100
+ ] }),
101
+ /* @__PURE__ */ jsx(Setup, {})
102
+ ] })
103
+ ] });
98
104
  };
99
105
  function useGomtm(selector) {
100
106
  const store = useContext(BearContext);
@@ -116,7 +122,8 @@ const MtConnectProvider = (props) => {
116
122
  const backendUrl = useGomtm((x) => x.backendUrl);
117
123
  const cookieStr = useGomtm((x) => x.cookieStr);
118
124
  const transport = useMemo(() => {
119
- const baseApiUrl = new URL("/api", backendUrl || "").toString();
125
+ const baseApiUrl = new URL(MTM_API_PREFIX, backendUrl || "").toString();
126
+ console.log("MtConnectProvider, baseApiUrl:", baseApiUrl);
120
127
  return createConnectTransport({
121
128
  baseUrl: baseApiUrl,
122
129
  fetch: gomtmFetcher({