mtxuilib 0.0.484 → 0.0.486

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.
@@ -1 +1 @@
1
- "use client";var C=(a,m,o)=>new Promise((f,l)=>{var n=r=>{try{s(o.next(r))}catch(t){l(t)}},c=r=>{try{s(o.throw(r))}catch(t){l(t)}},s=r=>r.done?f(r.value):Promise.resolve(r.value).then(n,c);s((o=o.apply(a,m)).next())});import{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{Provider as b,atom as y,createStore as U,useAtom as v}from"jotai";import{usePathname as W}from"next/navigation";import{compile as P,match as S}from"path-to-regexp";import{useCallback as u,useMemo as i}from"react";import{useMtRouter as D}from"../hooks/use-router";const j=y("0"),nt=y(null),I=y(""),h=U(),st=a=>{const{idOrName:m,children:o}=a;return i(()=>{h.set(I,m)},[m]),w(b,{store:h,children:o})};function at(){const a=W(),[m,o]=v(j,{store:h}),[f,l]=v(I,{store:h}),n=R(),c=D(),s=q(),r=K(M,{id:f}),t=i(()=>{var e,d;return(d=(e=r.data)==null?void 0:e.item)==null?void 0:d.value},[r.data]),A=i(()=>n,[n]),E=i(()=>n,[n]),g=i(()=>n,[n]),p=u(e=>t!=null&&t.routeShow?P(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(()=>C(this,null,function*(){t&&(yield s.invalidateQueries({queryKey:G(t.svcName,t.methodList)}))}),[t,s]),x=u(()=>C(this,null,function*(){t&&(yield s.invalidateQueries({queryKey:O(t.svcName,t.methodGet)}))}),[t,s]),L=u(e=>t!=null&&t.routeEdit?P(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=S(t.routeShow)(a);e&&o(e.params.id)}else if(t!=null&&t.routeEdit){const e=S(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,j as activateIdAtom,h as curdStore,nt as curdViewAtom,I as curdViewIdAtom,at as useCurdView};
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};
@@ -1 +1 @@
1
- "use client";var C=Object.defineProperty,T=Object.defineProperties;var D=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var S=(e,t,o)=>t in e?C(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(c)for(var o of c(t))b.call(t,o)&&S(e,o,t[o]);return e},F=(e,t)=>T(e,D(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&&c)for(var r of c(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 d=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(d,m);u((o=o.apply(e,t)).next())});import{Fragment as R,jsx as i}from"react/jsx-runtime";import{Suspense as I,useCallback as V,useMemo as U}from"react";import{Provider as k,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 P}from"sonner";import{useMtRouter as z}from"../hooks/use-router";const g=q(void 0);function oe(e){const{defaultValues:t,params:o,children:r,mutationUpdate:n,queryMethod:d}=e,m=n.useMutation(),u=V(s=>f(this,null,function*(){try{const l=yield m.mutateAsync(s);P("ok",{description:JSON.stringify(l,null,2),action:{label:"Undo",onClick:()=>console.log("Undo")}})}catch(l){P("error",{description:JSON.stringify(l,null,2),action:{label:"Undo",onClick:()=>console.log("Undo")}}),console.log("\u51FA\u9519",l)}}),[m]),a=U(()=>{const s=O();return s.set(g,()=>u),s},[u]);return i(k,{store:a,children:!t&&d?i(I,{fallback:i(R,{children:"UpdateForm loading"}),children:i(A,{queryMethod:d,params:o,onSubmit:u,children:r})}):i(v,{defaultValues:t,onSubmit:u,children:r})})}function re(e){const[t,o]=Q(g),r=w(),n=z();return{handleSubmit:r.handleSubmit(d=>f(this,null,function*(){yield t(d),n.back()})),onCancel:()=>{n.back()},form:r}}function v(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"]),[d,m]=t.useSuspenseQuery(o),u=U(()=>{var l,y;const s=m.data;return(l=s.item)!=null&&l.value?(y=s.item)==null?void 0:y.value:m.data},[m.data]);return i(v,p({defaultValues:u,onSubmit:r},n))}export{oe as TrpcUpdateForm,re as useTrpcUpdateForm};
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 h,jsx as i,jsxs as R}from"react/jsx-runtime";import{Provider as x,atom as l,createStore as S,useAtom as n,useSetAtom as y}from"jotai";import{useEffect as b}from"react";import P from"use-resize-observer";import{cn as m}from"../../lib/utils";import{ResizableHandle as v,ResizablePanel as u,ResizablePanelGroup as L}from"../../ui/resizable";import{MailLyContent as V}from"./detail/MailLyContent";const c=[20,30,50],d=[40,50,60],f=[10,15,10],p=l(c,(o,t,e)=>{t(p,e)}),z=l(!1,(o,t,e)=>{t(z,e)}),C=l(!1),k=l(void 0),H=l("value1"),N=S(),J=o=>{const{children:t}=o,{ref:e,width:r,height:s}=P();return i(x,{store:N,children:i("div",{ref:e,className:"w-full ",children:i(L,{direction:"horizontal",onLayout:a=>{document.cookie=`react-resizable-panels:layout=${JSON.stringify(a)}`},className:m("h-full max-h-full min-h-full w-full flex-1 items-stretch "),style:{height:(s||1)-1},children:t})})})},T=o=>{const{children:t}=o,[e,r]=n(z),[s]=n(p),a=y(C);return b(()=>{a(!0)},[a]),R(h,{children:[i(u,{defaultSize:s&&s[0]||c[0],collapsedSize:4,collapsible:!0,minSize:f[0],maxSize:d[0],onCollapse:()=>{r(!0),document.cookie=`react-resizable-panels:collapsed=${JSON.stringify(!0)}`},onExpand:()=>{r(!1),document.cookie=`react-resizable-panels:collapsed=${JSON.stringify(!1)}`},className:m(e&&"min-w-[50px] transition-all duration-300 ease-in-out"),children:t}),i(v,{withHandle:!0})]})},$=o=>{const{children:t}=o,[e]=n(p);return i(h,{children:i(u,{defaultSize:e&&e[1]||c[1],minSize:f[1],maxSize:d[1],className:"hidden h-full w-full md:flex",children:t})})};export{J as MailLayout,$ as MailLayoutList,T as MailLayoutSidenav,V as MailLyContent,c as detaultSizes,H as exampleValue1Atom,N as mailLayoutStore,z as mailLyCollapsedAtom,p as mailLySizesAtom,d as maxSizes,f as minSizes,k as trpcListViewAtom};
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 p,ExtKey_SelfBackend as u,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 P}from"gomtm/providers/ReactQueryProvider";import{Provider as A,createStore as E}from"jotai";const g=E(),m=k(void 0);function S(t){const{children:n,initExtKv:e}=t,c=o(()=>e[u],[e]),r=o(()=>e[a],[e]),f=o(()=>e[p],[e]),x=o(()=>e[d],[e]);return s(A,{store:g,children:s(m.Provider,{value:{extKv:e,token:x,hostname:f,backendUrl:r,trpcBackendUrl:c},children:s(y,{children:s(P,{children:n})})})})}function i(){const t=h(m);if(t===void 0)throw new Error("useTrpcApp must be used within a TrpcAppProvider");return t}const K=()=>{const{backendUrl:t}=i();return t},M=()=>{const{hostname:t}=i();return t||window.location.host},I=()=>{const t=K(),n=M(),{token:e}=i();return v(r=>{switch(r){case a:return t;case p:return n;case d:return e;case u:return;default:throw new Error(`extinfo key error: ${r}`)}},[t,n,e])},$=()=>{const[t]=C(typeof window!="undefined"?w(l):"");return{token:t||"",setToken:n=>{typeof window!="undefined"&&(document.cookie=`${l}=${n}`)}}};export{S as TrpcAppProvider,g as mtmAppStore,I as useExtInfo,M as useHostname,K as useMtmBackendUrl,$ as useToken,i as useTrpcApp};
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,5 +1,5 @@
1
- import type { FC, ReactNode } from "react";
2
1
  import type { EditorProviderProps, JSONContent } from "@tiptap/react";
2
+ import type { FC, ReactNode } from "react";
3
3
  export interface EditorProps {
4
4
  readonly children: ReactNode;
5
5
  readonly className?: string;
@@ -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{useMemo as x,useRef as y,forwardRef as N}from"react";import{EditorProvider as R}from"@tiptap/react";import{Provider as h}from"jotai";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=y(O()).current;return i(h,{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=x(()=>{var s;return[...S,...(s=e.extensions)!=null?s:[]]},[e.extensions]);return i("div",{ref:f,className:o,children:i(R,c(l({},e),{content:r,extensions:P,children:t}))})});F.displayName="EditorContent";export{F as EditorContent,q as EditorRoot};
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("../novel/src/extensions").AIHighlightOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>)[];
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("../novel/src/plugins").UploadFn;
1
+ export declare const uploadFn: import("../../../ui/novel/novel/src/plugins/upload-images").UploadFn;
@@ -1,2 +1,2 @@
1
- export declare const suggestionItems: import("../novel/src/extensions").SuggestionItem[];
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>;
@@ -1,219 +1,219 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- @layer base {
6
- :root {
7
- --background: 0 0% 100%;
8
- --foreground: 222.2 84% 4.9%;
9
-
10
- --muted: 210 40% 96.1%;
11
- --muted-foreground: 215.4 16.3% 46.9%;
12
-
13
- --popover: 0 0% 100%;
14
- --popover-foreground: 222.2 84% 4.9%;
15
-
16
- --card: 0 0% 100%;
17
- --card-foreground: 222.2 84% 4.9%;
18
-
19
- --border: 214.3 31.8% 91.4%;
20
- --input: 214.3 31.8% 91.4%;
21
-
22
- --primary: 222.2 47.4% 11.2%;
23
- --primary-foreground: 210 40% 98%;
24
-
25
- --secondary: 210 40% 96.1%;
26
- --secondary-foreground: 222.2 47.4% 11.2%;
27
-
28
- --accent: 210 40% 96.1%;
29
- --accent-foreground: 222.2 47.4% 11.2%;
30
-
31
- --destructive: 0 84.2% 60.2%;
32
- --destructive-foreground: 210 40% 98%;
33
-
34
- --ring: 215 20.2% 65.1%;
35
-
36
- --radius: 0.5rem;
37
-
38
- /* novel editor 相关样式开始 */
39
- --novel-highlight-default: #ffffff;
40
- --novel-highlight-purple: #f6f3f8;
41
- --novel-highlight-red: #fdebeb;
42
- --novel-highlight-yellow: #fbf4a2;
43
- --novel-highlight-blue: #c1ecf9;
44
- --novel-highlight-green: #acf79f;
45
- --novel-highlight-orange: #faebdd;
46
- --novel-highlight-pink: #faf1f5;
47
- --novel-highlight-gray: #f1f1ef;
48
- /* novel editor 相关样式结束 */
49
- }
50
-
51
- .dark {
52
- --background: 222.2 84% 4.9%;
53
- --foreground: 210 40% 98%;
54
-
55
- --muted: 217.2 32.6% 17.5%;
56
- --muted-foreground: 215 20.2% 65.1%;
57
-
58
- --popover: 222.2 84% 4.9%;
59
- --popover-foreground: 210 40% 98%;
60
-
61
- --card: 222.2 84% 4.9%;
62
- --card-foreground: 210 40% 98%;
63
-
64
- --border: 217.2 32.6% 17.5%;
65
- --input: 217.2 32.6% 17.5%;
66
-
67
- --primary: 210 40% 98%;
68
- --primary-foreground: 222.2 47.4% 11.2%;
69
-
70
- --secondary: 217.2 32.6% 17.5%;
71
- --secondary-foreground: 210 40% 98%;
72
-
73
- --accent: 217.2 32.6% 17.5%;
74
- --accent-foreground: 210 40% 98%;
75
-
76
- --destructive: 0 62.8% 30.6%;
77
- --destructive-foreground: 0 85.7% 97.3%;
78
- --ring: 217.2 32.6% 17.5%;
79
-
80
- /* novel editor 相关样式开始 */
81
- --novel-highlight-default: #000000;
82
- --novel-highlight-purple: #3f2c4b;
83
- --novel-highlight-red: #5c1a1a;
84
- --novel-highlight-yellow: #5c4b1a;
85
- --novel-highlight-blue: #1a3d5c;
86
- --novel-highlight-green: #1a5c20;
87
- --novel-highlight-orange: #5c3a1a;
88
- --novel-highlight-pink: #5c1a3a;
89
- --novel-highlight-gray: #3a3a3a;
90
- /* novel editor 相关样式结束 */
91
- }
92
- }
93
-
94
- /* @layer base {
95
- * {
96
- @apply border-border;
97
- }
98
- body {
99
- @apply bg-background text-foreground;
100
- }
101
- } */
102
-
103
- /*
104
- 细化滚动条。
105
- 参考: https://github.com/mckaywrigley/chatbot-ui/blob/main/styles/globals.css
106
- */
107
-
108
- ::-webkit-scrollbar-track {
109
- background-color: transparent;
110
- }
111
-
112
- ::-webkit-scrollbar-thumb {
113
- background-color: #a4a4a4;
114
- border-radius: 10px;
115
- }
116
-
117
- ::-webkit-scrollbar-thumb:hover {
118
- background-color: #838385;
119
- }
120
-
121
- ::-webkit-scrollbar-track:hover {
122
- background-color: #eaeaea;
123
- }
124
-
125
- ::-webkit-scrollbar-corner {
126
- background-color: transparent;
127
- }
128
-
129
- ::-webkit-scrollbar {
130
- width: 6px;
131
- height: 6px;
132
- }
133
-
134
- /* vamp 样式开始 ***********************************************************************************************/
135
-
136
- @layer utilities {
137
- .red-glow {
138
- text-shadow: 0px 0px 8px hsla(352, 98%, 60%, 0.6);
139
- }
140
-
141
- .button {
142
- transition:
143
- border 120ms ease 0s,
144
- background-color,
145
- color,
146
- box-shadow,
147
- opacity;
148
- }
149
-
150
- .primary-button-hover {
151
- text-shadow: rgb(0 0 0 / 56%) 0px 3px 12px;
152
- box-shadow: rgba(253, 52, 88, 0.6) 0px 1px 40px;
153
- }
154
-
155
- .dropdown {
156
- /* backdrop-filter: blur(10px) saturate(190%) contrast(70%) brightness(80%);
157
- background-color: rgba(29, 30, 43, 0.498);
158
- border: 0.5px solid rgba(82, 82, 111, 0.44); */
159
- box-shadow: rgb(0 0 0 / 20%) 0px 4px 24px;
160
- backdrop-filter: blur(20px) saturate(190%) contrast(70%) brightness(80%);
161
- background-color: rgba(29, 30, 43, 0.498);
162
- border: 0.5px solid rgba(82, 82, 111, 0.44);
163
- }
164
- }
165
-
166
- /* clears the ‘X’ from Internet Explorer */
167
- input[type="search"]::-ms-clear {
168
- display: none;
169
- width: 0;
170
- height: 0;
171
- }
172
- input[type="search"]::-ms-reveal {
173
- display: none;
174
- width: 0;
175
- height: 0;
176
- }
177
- /* clears the ‘X’ from Chrome */
178
- input[type="search"]::-webkit-search-decoration,
179
- input[type="search"]::-webkit-search-cancel-button,
180
- input[type="search"]::-webkit-search-results-button,
181
- input[type="search"]::-webkit-search-results-decoration {
182
- display: none;
183
- }
184
-
185
- .is-editor-empty {
186
- @apply text-white;
187
- }
188
-
189
- .ProseMirror p.is-editor-empty:first-child::before {
190
- color: #adb5bd;
191
- content: attr(data-placeholder);
192
- float: left;
193
- height: 0;
194
- opacity: 0.3;
195
- pointer-events: none;
196
- }
197
-
198
- ::-webkit-scrollbar {
199
- width: 8px;
200
- height: 8px;
201
- background-color: transparent;
202
- }
203
-
204
- ::-webkit-scrollbar-thumb {
205
- border-radius: 12px;
206
- background-color: #616076;
207
- }
208
-
209
- ::-webkit-scrollbar-track {
210
- padding: 2px;
211
- background-color: transparent;
212
- }
213
-
214
- mux-player {
215
- --controls: none;
216
- --media-object-fit: cover;
217
- height: 100%;
218
- }
219
- /* vamp 结束 ***********************************************************************************************/
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ @layer base {
6
+ :root {
7
+ --background: 0 0% 100%;
8
+ --foreground: 222.2 84% 4.9%;
9
+
10
+ --muted: 210 40% 96.1%;
11
+ --muted-foreground: 215.4 16.3% 46.9%;
12
+
13
+ --popover: 0 0% 100%;
14
+ --popover-foreground: 222.2 84% 4.9%;
15
+
16
+ --card: 0 0% 100%;
17
+ --card-foreground: 222.2 84% 4.9%;
18
+
19
+ --border: 214.3 31.8% 91.4%;
20
+ --input: 214.3 31.8% 91.4%;
21
+
22
+ --primary: 222.2 47.4% 11.2%;
23
+ --primary-foreground: 210 40% 98%;
24
+
25
+ --secondary: 210 40% 96.1%;
26
+ --secondary-foreground: 222.2 47.4% 11.2%;
27
+
28
+ --accent: 210 40% 96.1%;
29
+ --accent-foreground: 222.2 47.4% 11.2%;
30
+
31
+ --destructive: 0 84.2% 60.2%;
32
+ --destructive-foreground: 210 40% 98%;
33
+
34
+ --ring: 215 20.2% 65.1%;
35
+
36
+ --radius: 0.5rem;
37
+
38
+ /* novel editor 相关样式开始 */
39
+ --novel-highlight-default: #ffffff;
40
+ --novel-highlight-purple: #f6f3f8;
41
+ --novel-highlight-red: #fdebeb;
42
+ --novel-highlight-yellow: #fbf4a2;
43
+ --novel-highlight-blue: #c1ecf9;
44
+ --novel-highlight-green: #acf79f;
45
+ --novel-highlight-orange: #faebdd;
46
+ --novel-highlight-pink: #faf1f5;
47
+ --novel-highlight-gray: #f1f1ef;
48
+ /* novel editor 相关样式结束 */
49
+ }
50
+
51
+ .dark {
52
+ --background: 222.2 84% 4.9%;
53
+ --foreground: 210 40% 98%;
54
+
55
+ --muted: 217.2 32.6% 17.5%;
56
+ --muted-foreground: 215 20.2% 65.1%;
57
+
58
+ --popover: 222.2 84% 4.9%;
59
+ --popover-foreground: 210 40% 98%;
60
+
61
+ --card: 222.2 84% 4.9%;
62
+ --card-foreground: 210 40% 98%;
63
+
64
+ --border: 217.2 32.6% 17.5%;
65
+ --input: 217.2 32.6% 17.5%;
66
+
67
+ --primary: 210 40% 98%;
68
+ --primary-foreground: 222.2 47.4% 11.2%;
69
+
70
+ --secondary: 217.2 32.6% 17.5%;
71
+ --secondary-foreground: 210 40% 98%;
72
+
73
+ --accent: 217.2 32.6% 17.5%;
74
+ --accent-foreground: 210 40% 98%;
75
+
76
+ --destructive: 0 62.8% 30.6%;
77
+ --destructive-foreground: 0 85.7% 97.3%;
78
+ --ring: 217.2 32.6% 17.5%;
79
+
80
+ /* novel editor 相关样式开始 */
81
+ --novel-highlight-default: #000000;
82
+ --novel-highlight-purple: #3f2c4b;
83
+ --novel-highlight-red: #5c1a1a;
84
+ --novel-highlight-yellow: #5c4b1a;
85
+ --novel-highlight-blue: #1a3d5c;
86
+ --novel-highlight-green: #1a5c20;
87
+ --novel-highlight-orange: #5c3a1a;
88
+ --novel-highlight-pink: #5c1a3a;
89
+ --novel-highlight-gray: #3a3a3a;
90
+ /* novel editor 相关样式结束 */
91
+ }
92
+ }
93
+
94
+ /* @layer base {
95
+ * {
96
+ @apply border-border;
97
+ }
98
+ body {
99
+ @apply bg-background text-foreground;
100
+ }
101
+ } */
102
+
103
+ /*
104
+ 细化滚动条。
105
+ 参考: https://github.com/mckaywrigley/chatbot-ui/blob/main/styles/globals.css
106
+ */
107
+
108
+ ::-webkit-scrollbar-track {
109
+ background-color: transparent;
110
+ }
111
+
112
+ ::-webkit-scrollbar-thumb {
113
+ background-color: #a4a4a4;
114
+ border-radius: 10px;
115
+ }
116
+
117
+ ::-webkit-scrollbar-thumb:hover {
118
+ background-color: #838385;
119
+ }
120
+
121
+ ::-webkit-scrollbar-track:hover {
122
+ background-color: #eaeaea;
123
+ }
124
+
125
+ ::-webkit-scrollbar-corner {
126
+ background-color: transparent;
127
+ }
128
+
129
+ ::-webkit-scrollbar {
130
+ width: 6px;
131
+ height: 6px;
132
+ }
133
+
134
+ /* vamp 样式开始 ***********************************************************************************************/
135
+
136
+ @layer utilities {
137
+ .red-glow {
138
+ text-shadow: 0px 0px 8px hsla(352, 98%, 60%, 0.6);
139
+ }
140
+
141
+ .button {
142
+ transition:
143
+ border 120ms ease 0s,
144
+ background-color,
145
+ color,
146
+ box-shadow,
147
+ opacity;
148
+ }
149
+
150
+ .primary-button-hover {
151
+ text-shadow: rgb(0 0 0 / 56%) 0px 3px 12px;
152
+ box-shadow: rgba(253, 52, 88, 0.6) 0px 1px 40px;
153
+ }
154
+
155
+ .dropdown {
156
+ /* backdrop-filter: blur(10px) saturate(190%) contrast(70%) brightness(80%);
157
+ background-color: rgba(29, 30, 43, 0.498);
158
+ border: 0.5px solid rgba(82, 82, 111, 0.44); */
159
+ box-shadow: rgb(0 0 0 / 20%) 0px 4px 24px;
160
+ backdrop-filter: blur(20px) saturate(190%) contrast(70%) brightness(80%);
161
+ background-color: rgba(29, 30, 43, 0.498);
162
+ border: 0.5px solid rgba(82, 82, 111, 0.44);
163
+ }
164
+ }
165
+
166
+ /* clears the ‘X’ from Internet Explorer */
167
+ input[type="search"]::-ms-clear {
168
+ display: none;
169
+ width: 0;
170
+ height: 0;
171
+ }
172
+ input[type="search"]::-ms-reveal {
173
+ display: none;
174
+ width: 0;
175
+ height: 0;
176
+ }
177
+ /* clears the ‘X’ from Chrome */
178
+ input[type="search"]::-webkit-search-decoration,
179
+ input[type="search"]::-webkit-search-cancel-button,
180
+ input[type="search"]::-webkit-search-results-button,
181
+ input[type="search"]::-webkit-search-results-decoration {
182
+ display: none;
183
+ }
184
+
185
+ .is-editor-empty {
186
+ @apply text-white;
187
+ }
188
+
189
+ .ProseMirror p.is-editor-empty:first-child::before {
190
+ color: #adb5bd;
191
+ content: attr(data-placeholder);
192
+ float: left;
193
+ height: 0;
194
+ opacity: 0.3;
195
+ pointer-events: none;
196
+ }
197
+
198
+ ::-webkit-scrollbar {
199
+ width: 8px;
200
+ height: 8px;
201
+ background-color: transparent;
202
+ }
203
+
204
+ ::-webkit-scrollbar-thumb {
205
+ border-radius: 12px;
206
+ background-color: #616076;
207
+ }
208
+
209
+ ::-webkit-scrollbar-track {
210
+ padding: 2px;
211
+ background-color: transparent;
212
+ }
213
+
214
+ mux-player {
215
+ --controls: none;
216
+ --media-object-fit: cover;
217
+ height: 100%;
218
+ }
219
+ /* vamp 结束 ***********************************************************************************************/