mtxuilib 0.0.556 → 0.0.558
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/dist/esm/consts.d.ts +0 -1
- package/dist/esm/consts.js +1 -1
- package/dist/esm/lib/sscore.d.ts +0 -2
- package/dist/esm/lib/sscore.js +1 -1
- package/dist/esm/lib/trpc/TrpcAppProvider.d.ts +0 -5
- package/dist/esm/lib/trpc/TrpcAppProvider.js +1 -1
- package/dist/tsconfig.type.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/esm/consts.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare const COOKIE_MTM_SITE_ID = "mtm-site-id";
|
|
2
2
|
export declare const COOKIE_IS_DEBUG = "DEBUG";
|
|
3
3
|
export declare const MTM_SITE_HOSTNAME = "mtm-site-hostname";
|
|
4
|
-
export declare const MtM_TOKEN_NAME = "mtm_token33";
|
|
5
4
|
export declare const fetchMaxRetry = 3;
|
|
6
5
|
export declare const HeaderMtmHost = "Mtm-Host";
|
|
7
6
|
export declare const HeaderMtmApi = "Mtm-Api";
|
package/dist/esm/consts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t="mtm-site-id",e="DEBUG",o="mtm-site-hostname",s=
|
|
1
|
+
const t="mtm-site-id",e="DEBUG",o="mtm-site-hostname",s=3,c="Mtm-Host",n="Mtm-Api",_="site-host",r="mtm:serverUrl",i="mtm:selfbackendUrl",x=3,p="back",E="host",a="access_token",m="mtmbackend",A="selfbackend",l="ExtKey_CookieHeadValue",M="list_new_item",I="Listview_list_filter",d="edit",C="delete",R="create",T="fetchNextPage",K="refetch",L=12,O="/images/404.jpg",S="admin",k="member",f="/api.v1/trpc";export{S as ADMIN_ROLE,R as ActionCreate,C as ActionDelete,d as ActionEdit,T as ActionFetchNextPage,K as ActionRefetch,e as COOKIE_IS_DEBUG,t as COOKIE_MTM_SITE_ID,_ as Cookie_Site_Host,x as DEFAULT_revalidate_SECONDS,l as ExtKey_CookieHeadValue,E as ExtKey_Hostname,A as ExtKey_SelfBackend,a as ExtKey_mtmaccessToken,m as ExtKey_mtmbackend,n as HeaderMtmApi,c as HeaderMtmHost,O as ImageNoExist,M as ItemAction_list_new_item,p as LOGIN_CALLBACK_URL_KEY,L as ListView_DefaultPageSize,I as Listview_list_filter,k as MEMBER_ROLE,i as MTM_SERVER_COOKIE_ACTIVATE_SELFBACKEND_URL,r as MTM_SERVER_COOKIE_ACTIVATE_URL,o as MTM_SITE_HOSTNAME,f as TRPC_API_PREFIX,s as fetchMaxRetry};
|
package/dist/esm/lib/sscore.d.ts
CHANGED
package/dist/esm/lib/sscore.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cookies as
|
|
1
|
+
import{cookies as n}from"next/headers";import{MTM_SERVER_COOKIE_ACTIVATE_SELFBACKEND_URL as E,MTM_SERVER_COOKIE_ACTIVATE_URL as c}from"../consts";const v=()=>{var t,r;const e=(t=n().get(c))==null?void 0:t.value;return e||((r=process==null?void 0:process.env)!=null&&r.MTM_BACKEND?process.env.MTM_BACKEND:process.env.VERCEL_URL?`https://${process.env.VERCEL_URL}`:"https://localhost")},R=()=>{var r,s,o;const e=(r=n().get(E))==null?void 0:r.value;return e||((s=process==null?void 0:process.env)!=null&&s.MTM_SELFBACKEND?process.env.MTM_SELFBACKEND:process.env.VERCEL_URL?`https://${process.env.VERCEL_URL}`:`http://localhost:${((o=process.env)==null?void 0:o.PORT)||3e3}`)};export{R as getSelfbackendUrl,v as ssrGetBackendUrl};
|
|
@@ -16,9 +16,4 @@ export declare function TrpcAppProvider(props: {
|
|
|
16
16
|
export declare function useTrpcApp(): IAppContext;
|
|
17
17
|
export declare const useMtmBackendUrl: () => string | null | undefined;
|
|
18
18
|
export declare const useHostname: () => string;
|
|
19
|
-
export declare const useExtInfo: () => (key: string) => string | null | undefined;
|
|
20
|
-
export declare const useToken: () => {
|
|
21
|
-
token: string;
|
|
22
|
-
setToken: (newToken: string) => void;
|
|
23
|
-
};
|
|
24
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as c,jsx as r}from"react/jsx-runtime";import{createContext as p,useContext as s}from"react";const t=p(void 0);function l(n){const{children:o,initExtKv:i}=n;return r(c,{children:r(t.Provider,{value:{extKv:i},children:o})})}function e(){const n=s(t);if(n===void 0)throw new Error("useTrpcApp must be used within a TrpcAppProvider");return n}const a=()=>{const{backendUrl:n}=e();return n},x=()=>{const{hostname:n}=e();return n||window.location.host};export{l as TrpcAppProvider,x as useHostname,a as useMtmBackendUrl,e as useTrpcApp};
|