mtxuilib 0.0.485 → 0.0.487
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/curd/CurdViewView.js +1 -1
- package/dist/esm/demos/atom-example/AtomExample1.atom.d.ts +29 -0
- package/dist/esm/demos/atom-example/AtomExample1.atom.js +1 -0
- package/dist/esm/demos/atom-example/AtomMain.d.ts +2 -0
- package/dist/esm/demos/atom-example/AtomMain.js +1 -0
- package/dist/esm/demos/atom-example/ExampleAsync.d.ts +2 -0
- package/dist/esm/demos/atom-example/ExampleAsync.js +1 -0
- package/dist/esm/demos/suspense-ssr/examples.js +1 -1
- package/dist/esm/demos/suspense-ssr/examplesPostDetail.js +1 -1
- package/dist/esm/demos/suspense-ssr/examplesPosts.js +1 -1
- package/dist/esm/form/TrpcUpdateForm.js +1 -1
- package/dist/esm/layouts/mail-layout/index.js +1 -1
- package/dist/esm/lib/trpc/TrpcAppProvider.d.ts +0 -47
- package/dist/esm/lib/trpc/TrpcAppProvider.js +1 -1
- package/dist/esm/ui/novel/novel/src/components/editor.d.ts +1 -1
- package/dist/esm/ui/novel/novel/src/components/editor.js +1 -1
- package/dist/esm/ui/novel/tailwind/extensions.d.ts +1 -1
- package/dist/esm/ui/novel/tailwind/image-upload.d.ts +1 -1
- package/dist/esm/ui/novel/tailwind/slash-command.d.ts +1 -1
- package/dist/styles/globals.css +219 -219
- package/dist/styles/prosemirror.css +171 -171
- package/dist/tailwind.cjs +82 -82
- package/dist/tsconfig.type.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/esm/lib/trpc/hydrateCore.d.ts +0 -2
- package/dist/esm/lib/trpc/hydrateCore.js +0 -1
- package/dist/esm/store/hydrateCore.d.ts +0 -2
- package/dist/esm/store/hydrateCore.js +0 -1
- /package/dist/esm/demos/{suspense-ssr/lib.d.ts → lib.d.ts} +0 -0
- /package/dist/esm/demos/{suspense-ssr/lib.js → lib.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";var
|
|
1
|
+
"use client";var l=(a,m,o)=>new Promise((f,d)=>{var r=n=>{try{s(o.next(n))}catch(t){d(t)}},c=n=>{try{s(o.throw(n))}catch(t){d(t)}},s=n=>n.done?f(n.value):Promise.resolve(n.value).then(r,c);s((o=o.apply(a,m)).next())});import{Fragment as j,jsx as w}from"react/jsx-runtime";import{useQueryClient as q}from"@tanstack/react-query";import{useSuspenseQuery as K}from"gomtm/connectquery";import{curdViewGet as M}from"gomtm/gomtmpb/mtm/sppb/mtm-MtmService_connectquery";import{createInfiniteQueryKey as G,createQueryKey as O}from"gomtm/mtmquery";import{useIsAdmin as R}from"gomtm/providers/userContext";import{atom as C,createStore as b,useAtom as S}from"jotai";import{usePathname as U}from"next/navigation";import{compile as v,match as I}from"path-to-regexp";import{useCallback as u,useMemo as i}from"react";import{useMtRouter as W}from"../hooks/use-router";const D=C("0"),rt=C(null),P=C(""),y=b(),st=a=>{const{idOrName:m,children:o}=a;return i(()=>{y.set(P,m)},[m]),w(j,{children:o})};function at(){const a=U(),[m,o]=S(D,{store:y}),[f,d]=S(P,{store:y}),r=R(),c=W(),s=q(),n=K(M,{id:f}),t=i(()=>{var e,h;return(h=(e=n.data)==null?void 0:e.item)==null?void 0:h.value},[n.data]),A=i(()=>r,[r]),E=i(()=>r,[r]),g=i(()=>r,[r]),p=u(e=>t!=null&&t.routeShow?v(t==null?void 0:t.routeShow,{encode:encodeURIComponent})({id:e}):"",[t==null?void 0:t.routeShow]),k=u(e=>{p&&c.push(p(e))},[c,p]),Q=u(()=>l(this,null,function*(){t&&(yield s.invalidateQueries({queryKey:G(t.svcName,t.methodList)}))}),[t,s]),x=u(()=>l(this,null,function*(){t&&(yield s.invalidateQueries({queryKey:O(t.svcName,t.methodGet)}))}),[t,s]),L=u(e=>t!=null&&t.routeEdit?v(t==null?void 0:t.routeEdit,{encode:encodeURIComponent})({id:e}):"",[t==null?void 0:t.routeEdit]),N=i(()=>t!=null&&t.routeCreate&&(t==null?void 0:t.routeCreate)||"",[t==null?void 0:t.routeCreate]);return i(()=>{if(t!=null&&t.routeShow){const e=I(t.routeShow)(a);e&&o(e.params.id)}else if(t!=null&&t.routeEdit){const e=I(t.routeShow)(a);e&&o(e.params.id)}},[t==null?void 0:t.routeEdit,t==null?void 0:t.routeShow,a,o]),{curdView:t,canEdit:A,canCreate:E,canDelete:g,openShow:k,invalidateList:Q,invalidateGet:x,activateId:m,setActivateId:o,editLink:L,createLink:N,showLink:p}}export{st as CurdViewView,D as activateIdAtom,y as curdStore,rt as curdViewAtom,P as curdViewIdAtom,at as useCurdView};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const exampleValue100Atom: import("jotai").PrimitiveAtom<number> & {
|
|
2
|
+
init: number;
|
|
3
|
+
};
|
|
4
|
+
export declare const doublerAtom: import("jotai").PrimitiveAtom<{
|
|
5
|
+
callback: (n: number) => number;
|
|
6
|
+
}> & {
|
|
7
|
+
init: {
|
|
8
|
+
callback: (n: number) => number;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const demo1Atom: import("jotai").WritableAtom<(get: <Value>(atom: import("jotai").Atom<Value>) => Value, set: {
|
|
12
|
+
readonly signal: AbortSignal;
|
|
13
|
+
readonly setSelf: <A extends unknown[]>(...args: A) => unknown;
|
|
14
|
+
}) => {
|
|
15
|
+
getValue1: () => number;
|
|
16
|
+
}, [value: number], {
|
|
17
|
+
set1: (value: number) => void;
|
|
18
|
+
}> & {
|
|
19
|
+
init: (get: <Value>(atom: import("jotai").Atom<Value>) => Value, set: {
|
|
20
|
+
readonly signal: AbortSignal;
|
|
21
|
+
readonly setSelf: <A extends unknown[]>(...args: A) => unknown;
|
|
22
|
+
}) => {
|
|
23
|
+
getValue1: () => number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const example102Atom: import("jotai").PrimitiveAtom<string> & {
|
|
27
|
+
init: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const exampleAsyncExampleAtom: import("jotai").Atom<Promise<unknown>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var p=(e,o,t)=>new Promise((c,m)=>{var x=l=>{try{r(t.next(l))}catch(s){m(s)}},A=l=>{try{r(t.throw(l))}catch(s){m(s)}},r=l=>l.done?c(l.value):Promise.resolve(l.value).then(x,A);r((t=t.apply(e,o)).next())});import{atom as n}from"jotai";const a=n(1),b=n({callback:e=>e*2}),h=n((e,o)=>({getValue1:()=>e(a)}),(e,o,t)=>(o(a,t),{set1:c=>{console.log("set1 called"),o(a,10)}})),f=n("valueexample102Atom "),u=n("https://jsonplaceholder.typicode.com/posts"),g=n(e=>p(void 0,null,function*(){const o=e(u);return console.log("to fetch url",o),yield(yield fetch(e(u),{next:{revalidate:0}})).json()}));export{h as demo1Atom,b as doublerAtom,f as example102Atom,g as exampleAsyncExampleAtom,a as exampleValue100Atom};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as v,jsx as t,jsxs as e}from"react/jsx-runtime";import{useAtom as o}from"jotai";import{useHydrateAtoms as u}from"jotai/utils";import{MtButton as i}from"../../ui/ui-mt/Button";import{demo1Atom as n,doublerAtom as c,example102Atom as m,exampleValue100Atom as x}from"./AtomExample1.atom";import{ExampleAsync1 as A}from"./ExampleAsync";const k=()=>{const[l]=o(c),a=l.callback(50),[p,d]=o(n),[r,b]=o(x);u([[m,"example102(hydratedValue)---"]]);const[s,V]=o(m);return e(v,{children:[e("div",{className:"bg-blue-100 p-2",children:["example102Atom:",s]}),e("div",{children:["exampleValue100Atom: ",r]}),e("div",{children:["doubledValue: ",a]}),e("div",{children:[t(i,{onClick:()=>{d(100)},children:"set1"}),t("pre",{children:JSON.stringify(p,null,2)})]}),t(A,{})]})};export{k as AtomMain};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{useAtom as p}from"jotai";import{exampleAsyncExampleAtom as l}from"./AtomExample1.atom";const n=()=>{const[m,r]=p(l);return e("div",{className:"border bg-red-200 p-2",children:e("pre",{children:JSON.stringify(m,null,2)})})};export{n as ExampleAsync1};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";var c=(i,a,o)=>new Promise((d,r)=>{var n=e=>{try{s(o.next(e))}catch(t){r(t)}},m=e=>{try{s(o.throw(e))}catch(t){r(t)}},s=e=>e.done?d(e.value):Promise.resolve(e.value).then(n,m);s((o=o.apply(i,a)).next())});import{Fragment as g,jsx as l,jsxs as u}from"react/jsx-runtime";import{useSuspenseQuery as y}from"@tanstack/react-query";import{MtUnaryCallErrorView as E}from"../../components/MtUnaryCallErrorView";import{fakeFetchUser as p}from"
|
|
1
|
+
"use client";var c=(i,a,o)=>new Promise((d,r)=>{var n=e=>{try{s(o.next(e))}catch(t){r(t)}},m=e=>{try{s(o.throw(e))}catch(t){r(t)}},s=e=>e.done?d(e.value):Promise.resolve(e.value).then(n,m);s((o=o.apply(i,a)).next())});import{Fragment as g,jsx as l,jsxs as u}from"react/jsx-runtime";import{useSuspenseQuery as y}from"@tanstack/react-query";import{MtUnaryCallErrorView as E}from"../../components/MtUnaryCallErrorView";import{fakeFetchUser as p}from"../lib";const f=(i,a)=>c(void 0,null,function*(){try{return{code:"",data:yield p(i,!a)}}catch(o){return{error_code:"some_error_code",error_message:"error message"}}});function I(i){var n,m,s,e,t;const{userId:a,randomError:o,isHardError:d}=i,r=y({queryKey:["userId",a],queryFn:()=>c(this,null,function*(){if(d)throw console.log("isHardError",d),new Error("isHardError=true");return f(a,o)})});return r.error?u("div",{children:["query error:",JSON.stringify(r.error)]}):u("div",{className:"border-spacing-1 border p-2",children:[u("div",{className:"bg-slate-200",children:["userId:",a,",randomError:",o,",isHardError:",d]}),r.data&&((n=r.data)!=null&&n.error_code)?l(g,{children:l(E,{unaryError:r.data})}):u("pre",{children:[(s=(m=r.data)==null?void 0:m.data)==null?void 0:s.id,",",JSON.stringify((t=(e=r.data)==null?void 0:e.data)==null?void 0:t.id,null,2)]})]})}export{I as DemoUserDetail};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{useSuspenseQuery as s}from"@tanstack/react-query";import{fetchPost as d}from"
|
|
1
|
+
"use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{useSuspenseQuery as s}from"@tanstack/react-query";import{fetchPost as d}from"../lib";const n=o=>{const{postId:t}=o,r=s({queryKey:["examples","post",t],queryFn:()=>d(t)});return r.data?r.error?e("div",{children:"post error"}):e("div",{className:"prose dark:prose-invert m-4 border p-2 shadow-md",children:i("div",{children:[e("h2",{children:r.data.title}),e("article",{children:r.data.body})]})}):null};export{n as ExamplePostDetail};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as d,jsx as e,jsxs as a}from"react/jsx-runtime";import{useSuspenseQuery as i}from"@tanstack/react-query";import m from"next/link";import{
|
|
1
|
+
"use client";import{Fragment as d,jsx as e,jsxs as a}from"react/jsx-runtime";import{useSuspenseQuery as i}from"@tanstack/react-query";import m from"next/link";import{MtLink as s}from"../../common/mtlink";import{fetchPosts as n}from"../lib";const y=()=>{var o;const t=i({queryKey:["examples","posts"],queryFn:()=>n()});return a(d,{children:[e("h2",{children:" examples posts "}),e(s,{variant:"ghost",href:"/demo/hydrate-demo",children:"to post list"}),e("div",{children:(o=t==null?void 0:t.data)==null?void 0:o.map(r=>e("li",{children:e(m,{href:`/demo/hydrate-demo/${r.id}`,children:r.title})},r.id))})]})};export{y as ExamplePosts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";var
|
|
1
|
+
"use client";var v=Object.defineProperty,D=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var d=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var S=(e,t,o)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,p=(e,t)=>{for(var o in t||(t={}))h.call(t,o)&&S(e,o,t[o]);if(d)for(var o of d(t))b.call(t,o)&&S(e,o,t[o]);return e},F=(e,t)=>D(e,I(t));var M=(e,t)=>{var o={};for(var r in e)h.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(e!=null&&d)for(var r of d(e))t.indexOf(r)<0&&b.call(e,r)&&(o[r]=e[r]);return o};var f=(e,t,o)=>new Promise((r,n)=>{var l=a=>{try{u(o.next(a))}catch(s){n(s)}},m=a=>{try{u(o.throw(a))}catch(s){n(s)}},u=a=>a.done?r(a.value):Promise.resolve(a.value).then(l,m);u((o=o.apply(e,t)).next())});import{Fragment as T,jsx as i}from"react/jsx-runtime";import{Suspense as V,useCallback as k,useMemo as U}from"react";import{atom as q,createStore as O,useAtom as Q}from"jotai";import{FormProvider as x,useForm as W,useFormContext as w}from"react-hook-form";import{toast as g}from"sonner";import{useMtRouter as z}from"../hooks/use-router";const P=q(void 0);function te(e){const{defaultValues:t,params:o,children:r,mutationUpdate:n,queryMethod:l}=e,m=n.useMutation(),u=k(s=>f(this,null,function*(){try{const c=yield m.mutateAsync(s);g("ok",{description:JSON.stringify(c,null,2),action:{label:"Undo",onClick:()=>console.log("Undo")}})}catch(c){g("error",{description:JSON.stringify(c,null,2),action:{label:"Undo",onClick:()=>console.log("Undo")}}),console.log("\u51FA\u9519",c)}}),[m]),a=U(()=>{const s=O();return s.set(P,()=>u),s},[u]);return i(T,{children:!t&&l?i(V,{fallback:i(T,{children:"UpdateForm loading"}),children:i(A,{queryMethod:l,params:o,onSubmit:u,children:r})}):i(C,{defaultValues:t,onSubmit:u,children:r})})}function oe(e){const[t,o]=Q(P),r=w(),n=z();return{handleSubmit:r.handleSubmit(l=>f(this,null,function*(){yield t(l),n.back()})),onCancel:()=>{n.back()},form:r}}function C(e){const{defaultValues:t,onSubmit:o,children:r}=e,n=W({defaultValues:t});return i(x,F(p({},n),{children:i("form",{onSubmit:n.handleSubmit(o),children:r})}))}function A(e){const a=e,{queryMethod:t,params:o,onSubmit:r}=a,n=M(a,["queryMethod","params","onSubmit"]),[l,m]=t.useSuspenseQuery(o),u=U(()=>{var c,y;const s=m.data;return(c=s.item)!=null&&c.value?(y=s.item)==null?void 0:y.value:m.data},[m.data]);return i(C,p({defaultValues:u,onSubmit:r},n))}export{te as TrpcUpdateForm,oe as useTrpcUpdateForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as m,jsx as l,jsxs as C}from"react/jsx-runtime";import{atom as i,createStore as x,useAtom as r,useSetAtom as S}from"jotai";import{useEffect as y}from"react";import b from"use-resize-observer";import{cn as u}from"../../lib/utils";import{ResizableHandle as L,ResizablePanel as d,ResizablePanelGroup as P}from"../../ui/resizable";import{MailLyContent as G}from"./detail/MailLyContent";const c=[20,30,50],f=[40,50,60],z=[10,15,10],p=i(c,(o,t,e)=>{t(p,e)}),h=i(!1,(o,t,e)=>{t(h,e)}),v=i(!1),O=i(void 0),W=i("value1"),k=x(),H=o=>{const{children:t}=o,{ref:e,width:n,height:s}=b();return l(m,{children:l("div",{ref:e,className:"w-full ",children:l(P,{direction:"horizontal",onLayout:a=>{document.cookie=`react-resizable-panels:layout=${JSON.stringify(a)}`},className:u("h-full max-h-full min-h-full w-full flex-1 items-stretch "),style:{height:(s||1)-1},children:t})})})},J=o=>{const{children:t}=o,[e,n]=r(h),[s]=r(p),a=S(v);return y(()=>{a(!0)},[a]),C(m,{children:[l(d,{defaultSize:s&&s[0]||c[0],collapsedSize:4,collapsible:!0,minSize:z[0],maxSize:f[0],onCollapse:()=>{n(!0),document.cookie=`react-resizable-panels:collapsed=${JSON.stringify(!0)}`},onExpand:()=>{n(!1),document.cookie=`react-resizable-panels:collapsed=${JSON.stringify(!1)}`},className:u(e&&"min-w-[50px] transition-all duration-300 ease-in-out"),children:t}),l(L,{withHandle:!0})]})},T=o=>{const{children:t}=o,[e]=r(p);return l(m,{children:l(d,{defaultSize:e&&e[1]||c[1],minSize:z[1],maxSize:f[1],className:"hidden h-full w-full md:flex",children:t})})};export{H as MailLayout,T as MailLayoutList,J as MailLayoutSidenav,G as MailLyContent,c as detaultSizes,W as exampleValue1Atom,k as mailLayoutStore,h as mailLyCollapsedAtom,p as mailLySizesAtom,f as maxSizes,z as minSizes,O as trpcListViewAtom};
|
|
@@ -1,51 +1,4 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
export declare const mtmAppStore: {
|
|
3
|
-
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
4
|
-
set: <Value_1, Args extends unknown[], Result>(atom: import("jotai").WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
|
|
5
|
-
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
6
|
-
dev_subscribe_store: (l: (action: {
|
|
7
|
-
type: "write";
|
|
8
|
-
flushed: Set<import("jotai").Atom<unknown>>;
|
|
9
|
-
} | {
|
|
10
|
-
type: "async-write";
|
|
11
|
-
flushed: Set<import("jotai").Atom<unknown>>;
|
|
12
|
-
} | {
|
|
13
|
-
type: "sub";
|
|
14
|
-
flushed: Set<import("jotai").Atom<unknown>>;
|
|
15
|
-
} | {
|
|
16
|
-
type: "unsub";
|
|
17
|
-
} | {
|
|
18
|
-
type: "restore";
|
|
19
|
-
flushed: Set<import("jotai").Atom<unknown>>;
|
|
20
|
-
}) => void, rev: 2) => () => void;
|
|
21
|
-
dev_get_mounted_atoms: () => IterableIterator<import("jotai").Atom<unknown>>;
|
|
22
|
-
dev_get_atom_state: (a: import("jotai").Atom<unknown>) => ({
|
|
23
|
-
d: Map<import("jotai").Atom<unknown>, any & ({
|
|
24
|
-
e: unknown;
|
|
25
|
-
} | {
|
|
26
|
-
v: unknown;
|
|
27
|
-
})>;
|
|
28
|
-
} & ({
|
|
29
|
-
e: unknown;
|
|
30
|
-
} | {
|
|
31
|
-
v: unknown;
|
|
32
|
-
})) | undefined;
|
|
33
|
-
dev_get_mounted: (a: import("jotai").Atom<unknown>) => {
|
|
34
|
-
l: Set<() => void>;
|
|
35
|
-
t: Set<import("jotai").Atom<unknown>>;
|
|
36
|
-
u?: (() => void) | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
dev_restore_atoms: (values: Iterable<readonly [import("jotai").Atom<unknown>, unknown]>) => void;
|
|
39
|
-
} | {
|
|
40
|
-
get: <Value_2>(atom: import("jotai").Atom<Value_2>) => Value_2;
|
|
41
|
-
set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: import("jotai").WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
|
|
42
|
-
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
43
|
-
dev_subscribe_store?: undefined;
|
|
44
|
-
dev_get_mounted_atoms?: undefined;
|
|
45
|
-
dev_get_atom_state?: undefined;
|
|
46
|
-
dev_get_mounted?: undefined;
|
|
47
|
-
dev_restore_atoms?: undefined;
|
|
48
|
-
};
|
|
49
2
|
export type ActionHandler = (props: {
|
|
50
3
|
action: string;
|
|
51
4
|
values?: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as s}from"react/jsx-runtime";import{createContext as k,useCallback as v,useContext as h,useMemo as o,useState as C}from"react";import{getCookie as w}from"gomtm/clientlib";import{ExtKey_Hostname as
|
|
1
|
+
"use client";import{Fragment as P,jsx as s}from"react/jsx-runtime";import{createContext as k,useCallback as v,useContext as h,useMemo as o,useState as C}from"react";import{getCookie as w}from"gomtm/clientlib";import{ExtKey_Hostname as u,ExtKey_SelfBackend as p,ExtKey_mtmaccessToken as d,ExtKey_mtmbackend as a,MtM_TOKEN_NAME as l}from"gomtm/consts";import{MtConnectProvider as y}from"gomtm/providers/MtConnectProvider";import{MtReactQueryProvider as E}from"gomtm/providers/ReactQueryProvider";const f=k(void 0);function B(t){const{children:n,initExtKv:e}=t,i=o(()=>e[p],[e]),r=o(()=>e[a],[e]),m=o(()=>e[u],[e]),x=o(()=>e[d],[e]);return s(P,{children:s(f.Provider,{value:{extKv:e,token:x,hostname:m,backendUrl:r,trpcBackendUrl:i},children:s(y,{children:s(E,{children:n})})})})}function c(){const t=h(f);if(t===void 0)throw new Error("useTrpcApp must be used within a TrpcAppProvider");return t}const g=()=>{const{backendUrl:t}=c();return t},A=()=>{const{hostname:t}=c();return t||window.location.host},H=()=>{const t=g(),n=A(),{token:e}=c();return v(r=>{switch(r){case a:return t;case u:return n;case d:return e;case p:return;default:throw new Error(`extinfo key error: ${r}`)}},[t,n,e])},R=()=>{const[t]=C(typeof window!="undefined"?w(l):"");return{token:t||"",setToken:n=>{typeof window!="undefined"&&(document.cookie=`${l}=${n}`)}}};export{B as TrpcAppProvider,H as useExtInfo,A as useHostname,g as useMtmBackendUrl,R as useToken,c as useTrpcApp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var v=Object.defineProperty,C=Object.defineProperties;var u=Object.getOwnPropertyDescriptors;var n=Object.getOwnPropertySymbols;var a=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var m=(o,t,r)=>t in o?v(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,l=(o,t)=>{for(var r in t||(t={}))a.call(t,r)&&m(o,r,t[r]);if(n)for(var r of n(t))p.call(t,r)&&m(o,r,t[r]);return o},c=(o,t)=>C(o,u(t));var E=(o,t)=>{var r={};for(var e in o)a.call(o,e)&&t.indexOf(e)<0&&(r[e]=o[e]);if(o!=null&&n)for(var e of n(o))t.indexOf(e)<0&&p.call(o,e)&&(r[e]=o[e]);return r};import{jsx as i}from"react/jsx-runtime";import{
|
|
1
|
+
var v=Object.defineProperty,C=Object.defineProperties;var u=Object.getOwnPropertyDescriptors;var n=Object.getOwnPropertySymbols;var a=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var m=(o,t,r)=>t in o?v(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,l=(o,t)=>{for(var r in t||(t={}))a.call(t,r)&&m(o,r,t[r]);if(n)for(var r of n(t))p.call(t,r)&&m(o,r,t[r]);return o},c=(o,t)=>C(o,u(t));var E=(o,t)=>{var r={};for(var e in o)a.call(o,e)&&t.indexOf(e)<0&&(r[e]=o[e]);if(o!=null&&n)for(var e of n(o))t.indexOf(e)<0&&p.call(o,e)&&(r[e]=o[e]);return r};import{jsx as i}from"react/jsx-runtime";import{EditorProvider as x}from"@tiptap/react";import{Provider as y}from"jotai";import{forwardRef as N,useMemo as R,useRef as h}from"react";import O from"tunnel-rat";import{simpleExtensions as S}from"../extensions";import{novelStore as T}from"../utils/store";import{EditorCommandTunnelContext as g}from"./editor-command";const q=({children:o})=>{const t=h(O()).current;return i(y,{store:T,children:i(g.Provider,{value:t,children:o})})},F=N((J,f)=>{var d=J,{className:o,children:t,initialContent:r}=d,e=E(d,["className","children","initialContent"]);const P=R(()=>{var s;return[...S,...(s=e.extensions)!=null?s:[]]},[e.extensions]);return i("div",{ref:f,className:o,children:i(x,c(l({},e),{content:r,extensions:P,children:t}))})});F.displayName="EditorContent";export{F as EditorContent,q as EditorRoot};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const defaultExtensions: (import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Mark<import("
|
|
1
|
+
export declare const defaultExtensions: (import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Mark<import("../../../ui/novel/novel/src/extensions/ai-highlight").AIHighlightOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const uploadFn: import("
|
|
1
|
+
export declare const uploadFn: import("../../../ui/novel/novel/src/plugins/upload-images").UploadFn;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const suggestionItems: import("
|
|
1
|
+
export declare const suggestionItems: import("../../../ui/novel/novel/src/extensions/slash-command").SuggestionItem[];
|
|
2
2
|
export declare const slashCommand: import("@tiptap/core").Extension<any, any>;
|