@machinerd/js-module 0.8.1 → 0.9.0
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/README.md +6 -0
- package/dist/api-client-C0sbSOQf.mjs +1 -0
- package/dist/api-client-C3o2pO0q.cjs +1 -0
- package/dist/button-CQZuaIU7.mjs +1 -0
- package/dist/button-ChX3XGbR.cjs +1 -0
- package/dist/button-DHvx-GAg.d.cts +50 -0
- package/dist/button-DRIyBtEB.d.mts +50 -0
- package/dist/common-B8HXyhZa.cjs +1 -0
- package/dist/common-CWHkXe0F.mjs +1 -0
- package/dist/{common-Bn0Ko6B7.cjs → common-D4sUwkFd.cjs} +1 -1
- package/dist/{common-Df03Ovdm.mjs → common-ZUMpASnc.mjs} +1 -1
- package/dist/editor/index.cjs +1 -0
- package/dist/editor/index.d.cts +80 -0
- package/dist/editor/index.d.mts +80 -0
- package/dist/editor/index.mjs +1 -0
- package/dist/format-1_RTNUQv.mjs +1 -0
- package/dist/format-DEuImTYJ.cjs +1 -0
- package/dist/hooks/common/index.cjs +1 -0
- package/dist/hooks/common/index.d.cts +72 -0
- package/dist/hooks/common/index.d.mts +72 -0
- package/dist/hooks/common/index.mjs +1 -0
- package/dist/hooks/use-snackbar.cjs +1 -0
- package/dist/hooks/use-snackbar.d.cts +10 -0
- package/dist/hooks/use-snackbar.d.mts +10 -0
- package/dist/hooks/use-snackbar.mjs +1 -0
- package/dist/{index-B3fFA21M.d.mts → index-B1YNV_Vm.d.cts} +4 -0
- package/dist/{index-CeiAF-WU.d.cts → index-C8chDULk.d.mts} +4 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/providers/api-client/index.cjs +1 -0
- package/dist/providers/{index.d.cts → api-client/index.d.cts} +3 -3
- package/dist/providers/{index.d.mts → api-client/index.d.mts} +3 -3
- package/dist/providers/api-client/index.mjs +1 -0
- package/dist/providers/noti-stack/index.cjs +1 -0
- package/dist/providers/noti-stack/index.d.cts +11 -0
- package/dist/providers/noti-stack/index.d.mts +11 -0
- package/dist/providers/noti-stack/index.mjs +1 -0
- package/dist/{skeleton-DtV9S1QK.cjs → skeleton-B5ZccRFX.cjs} +1 -1
- package/dist/{skeleton-B6_oBhkl.mjs → skeleton-Y22bmaaB.mjs} +1 -1
- package/dist/src-6KfzqI9Z.cjs +1 -0
- package/dist/src-CIMlbgv1.mjs +1 -0
- package/dist/styles/editor.css +255 -0
- package/dist/styles/index.css +371 -0
- package/dist/ui/carousel/index.cjs +1 -1
- package/dist/ui/carousel/index.d.cts +9 -9
- package/dist/ui/carousel/index.d.mts +9 -9
- package/dist/ui/carousel/index.mjs +1 -1
- package/dist/ui/dialog/index.cjs +1 -1
- package/dist/ui/dialog/index.d.cts +2 -2
- package/dist/ui/dialog/index.d.mts +2 -2
- package/dist/ui/dialog/index.mjs +1 -1
- package/dist/ui/dnd/index.cjs +1 -0
- package/dist/ui/dnd/index.d.cts +17 -0
- package/dist/ui/dnd/index.d.mts +17 -0
- package/dist/ui/dnd/index.mjs +1 -0
- package/dist/ui/dropdown/index.cjs +1 -0
- package/dist/ui/dropdown/index.d.cts +72 -0
- package/dist/ui/dropdown/index.d.mts +72 -0
- package/dist/ui/dropdown/index.mjs +1 -0
- package/dist/ui/image/index.cjs +1 -1
- package/dist/ui/image/index.d.cts +3 -3
- package/dist/ui/image/index.d.mts +8 -8
- package/dist/ui/image/index.mjs +1 -1
- package/dist/ui/index.cjs +1 -1
- package/dist/ui/index.d.cts +10 -53
- package/dist/ui/index.d.mts +10 -53
- package/dist/ui/index.mjs +1 -1
- package/dist/ui/motion-dialog/index.cjs +1 -0
- package/dist/ui/motion-dialog/index.d.cts +34 -0
- package/dist/ui/motion-dialog/index.d.mts +34 -0
- package/dist/ui/motion-dialog/index.mjs +1 -0
- package/dist/ui/preserve-focus-button/index.cjs +1 -0
- package/dist/ui/preserve-focus-button/index.d.cts +12 -0
- package/dist/ui/preserve-focus-button/index.d.mts +12 -0
- package/dist/ui/preserve-focus-button/index.mjs +1 -0
- package/dist/ui/sheet/index.cjs +1 -1
- package/dist/ui/sheet/index.d.cts +2 -2
- package/dist/ui/sheet/index.d.mts +2 -2
- package/dist/ui/sheet/index.mjs +1 -1
- package/dist/ui/switch/index.cjs +1 -0
- package/dist/ui/switch/index.d.cts +16 -0
- package/dist/ui/switch/index.d.mts +16 -0
- package/dist/ui/switch/index.mjs +1 -0
- package/dist/ui/tooltip/index.cjs +1 -1
- package/dist/ui/tooltip/index.d.cts +2 -2
- package/dist/ui/tooltip/index.mjs +1 -1
- package/dist/ui-Bs9PP9eC.cjs +1 -0
- package/dist/ui-D2DoC_0E.mjs +1 -0
- package/dist/use-dialog-stack-Crj8YWJl.mjs +1 -0
- package/dist/use-dialog-stack-YiLs-sNf.cjs +1 -0
- package/dist/use-drag-resize-BdeLdulk.mjs +1 -0
- package/dist/use-drag-resize-DEgcua2U.d.cts +48 -0
- package/dist/use-drag-resize-DRHPv5RK.d.mts +48 -0
- package/dist/use-drag-resize-DeDqPC4h.cjs +1 -0
- package/dist/use-subset-image-Df2fCrtH.mjs +1 -0
- package/dist/use-subset-image-Dygkyw-W.d.mts +601 -0
- package/dist/use-subset-image-bDB5TSd4.d.cts +601 -0
- package/dist/use-subset-image-o_gmC1HL.cjs +1 -0
- package/dist/util/common.cjs +1 -1
- package/dist/util/common.d.cts +8 -1
- package/dist/util/common.d.mts +8 -1
- package/dist/util/common.mjs +1 -1
- package/dist/util/editor.cjs +1 -0
- package/dist/util/editor.d.cts +21 -0
- package/dist/util/editor.d.mts +21 -0
- package/dist/util/editor.mjs +1 -0
- package/dist/util/fetcher.cjs +1 -0
- package/dist/util/fetcher.d.cts +15 -0
- package/dist/util/fetcher.d.mts +15 -0
- package/dist/util/fetcher.mjs +1 -0
- package/dist/util/file.mjs +1 -1
- package/dist/util/format.cjs +1 -1
- package/dist/util/format.d.cts +29 -1
- package/dist/util/format.d.mts +29 -1
- package/dist/util/format.mjs +1 -1
- package/package.json +104 -33
- package/dist/hooks/index.cjs +0 -1
- package/dist/hooks/index.d.cts +0 -2
- package/dist/hooks/index.d.mts +0 -2
- package/dist/hooks/index.mjs +0 -1
- package/dist/hooks-CUj2xuzU.cjs +0 -1
- package/dist/hooks-gbU5dqVF.mjs +0 -1
- package/dist/index-BFHrNSKP.d.mts +0 -655
- package/dist/index-DiRj3rRA.d.cts +0 -655
- package/dist/providers/index.cjs +0 -1
- package/dist/providers/index.mjs +0 -1
- package/dist/providers-CkXkdYcB.cjs +0 -1
- package/dist/providers-zftmvT1z.mjs +0 -1
- package/dist/src-CjpmdVyv.cjs +0 -1
- package/dist/src-CukOR3K2.mjs +0 -1
- package/dist/use-subset-image-D8ssrZhj.mjs +0 -1
- package/dist/use-subset-image-DC86cg6O.cjs +0 -1
- /package/dist/{file-DShNxIW4.mjs → file-B-UJkabO.mjs} +0 -0
|
@@ -13,11 +13,15 @@ declare class ApiClient {
|
|
|
13
13
|
message: string;
|
|
14
14
|
}>;
|
|
15
15
|
}>;
|
|
16
|
+
logout(path?: string, domain?: string): void;
|
|
16
17
|
getToken(): string | undefined;
|
|
17
18
|
getBearer(): string;
|
|
19
|
+
accessLog(): Promise<any>;
|
|
20
|
+
me(): Promise<any>;
|
|
18
21
|
hasPermission(obj: string, act: string, exact?: boolean, silent?: boolean): Promise<any>;
|
|
19
22
|
cdnMedia(path: string, size?: number): string;
|
|
20
23
|
cdnStatic(path: string, size?: number): string;
|
|
24
|
+
refinePath(path?: string | null): string;
|
|
21
25
|
getUploadPresignURL(param: {
|
|
22
26
|
contentType: string;
|
|
23
27
|
length: number;
|
|
@@ -13,11 +13,15 @@ declare class ApiClient {
|
|
|
13
13
|
message: string;
|
|
14
14
|
}>;
|
|
15
15
|
}>;
|
|
16
|
+
logout(path?: string, domain?: string): void;
|
|
16
17
|
getToken(): string | undefined;
|
|
17
18
|
getBearer(): string;
|
|
19
|
+
accessLog(): Promise<any>;
|
|
20
|
+
me(): Promise<any>;
|
|
18
21
|
hasPermission(obj: string, act: string, exact?: boolean, silent?: boolean): Promise<any>;
|
|
19
22
|
cdnMedia(path: string, size?: number): string;
|
|
20
23
|
cdnStatic(path: string, size?: number): string;
|
|
24
|
+
refinePath(path?: string | null): string;
|
|
21
25
|
getUploadPresignURL(param: {
|
|
22
26
|
contentType: string;
|
|
23
27
|
length: number;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./src-
|
|
1
|
+
const e=require(`./src-6KfzqI9Z.cjs`);module.exports=e.t;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ApiConfig, r as UploadValues, t as ApiClient } from "./index-
|
|
1
|
+
import { n as ApiConfig, r as UploadValues, t as ApiClient } from "./index-B1YNV_Vm.cjs";
|
|
2
2
|
export { ApiConfig, UploadValues, ApiClient as default };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ApiConfig, r as UploadValues, t as ApiClient } from "./index-
|
|
1
|
+
import { n as ApiConfig, r as UploadValues, t as ApiClient } from "./index-C8chDULk.mjs";
|
|
2
2
|
export { ApiConfig, UploadValues, ApiClient as default };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./src-
|
|
1
|
+
import{t as e}from"./src-CIMlbgv1.mjs";export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../src-6KfzqI9Z.cjs`);const e=require(`../../api-client-C3o2pO0q.cjs`);exports.ApiClientProvider=e.t,exports.useApiClient=e.n;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ApiConfig, t as ApiClient } from "
|
|
2
|
-
import * as
|
|
1
|
+
import { n as ApiConfig, t as ApiClient } from "../../index-B1YNV_Vm.cjs";
|
|
2
|
+
import * as react_jsx_runtime14 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/providers/api-client/api-client.d.ts
|
|
5
5
|
declare function ApiClientProvider({
|
|
@@ -8,7 +8,7 @@ declare function ApiClientProvider({
|
|
|
8
8
|
}: {
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
config: ApiConfig;
|
|
11
|
-
}):
|
|
11
|
+
}): react_jsx_runtime14.JSX.Element;
|
|
12
12
|
declare function useApiClient(): ApiClient;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { ApiClientProvider, useApiClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ApiConfig, t as ApiClient } from "
|
|
2
|
-
import * as
|
|
1
|
+
import { n as ApiConfig, t as ApiClient } from "../../index-C8chDULk.mjs";
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/providers/api-client/api-client.d.ts
|
|
5
5
|
declare function ApiClientProvider({
|
|
@@ -8,7 +8,7 @@ declare function ApiClientProvider({
|
|
|
8
8
|
}: {
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
config: ApiConfig;
|
|
11
|
-
}):
|
|
11
|
+
}): react_jsx_runtime1.JSX.Element;
|
|
12
12
|
declare function useApiClient(): ApiClient;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { ApiClientProvider, useApiClient };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../src-CIMlbgv1.mjs";import{n as e,t}from"../../api-client-C0sbSOQf.mjs";export{t as ApiClientProvider,e as useApiClient};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../chunk-Bmb41Sf3.cjs`);let t=require(`react/jsx-runtime`),n=require(`notistack`);function r({maxSnack:e=3,...r}){return(0,t.jsx)(n.SnackbarProvider,{maxSnack:e,...r})}exports.NotiStackProvider=r;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import * as react_jsx_runtime21 from "react/jsx-runtime";
|
|
3
|
+
import { SnackbarProvider } from "notistack";
|
|
4
|
+
|
|
5
|
+
//#region src/providers/noti-stack/noti-stack.d.ts
|
|
6
|
+
declare function NotiStackProvider({
|
|
7
|
+
maxSnack,
|
|
8
|
+
...props
|
|
9
|
+
}: ComponentProps<typeof SnackbarProvider>): react_jsx_runtime21.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { NotiStackProvider };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { SnackbarProvider } from "notistack";
|
|
4
|
+
|
|
5
|
+
//#region src/providers/noti-stack/noti-stack.d.ts
|
|
6
|
+
declare function NotiStackProvider({
|
|
7
|
+
maxSnack,
|
|
8
|
+
...props
|
|
9
|
+
}: ComponentProps<typeof SnackbarProvider>): react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { NotiStackProvider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{SnackbarProvider as t}from"notistack";function n({maxSnack:n=3,...r}){return e(t,{maxSnack:n,...r})}export{n as NotiStackProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./common-
|
|
1
|
+
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./common-D4sUwkFd.cjs`);let n=require(`react/jsx-runtime`),r=require(`class-variance-authority`);const i=(0,r.cva)(t.n(`komc:w-full komc:animate-pulse komc:bg-gray-200`),{variants:{size:{xs:`komc:h-4`,sm:`komc:h-8`,md:`komc:h-12`,lg:`komc:h-16`,xl:`komc:h-20`,"2xl":`komc:h-24`,"3xl":`komc:h-28`,square:`komc:h-auto komc:aspect-square`,full:`komc:h-full`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`}},defaultVariants:{size:`sm`,rounded:`sm`}});function a({size:e,rounded:t,width:r,height:a,className:o,...s}){let c=r?typeof r==`string`?r:`${r}px`:void 0,l=a?typeof a==`string`?a:`${a}px`:void 0;return(0,n.jsx)(`div`,{"data-komc":!0,"aria-hidden":`true`,className:i({size:e,rounded:t,className:o}),style:{width:c,height:l},...s})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./common-
|
|
1
|
+
import{n as e}from"./common-ZUMpASnc.mjs";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";const r=n(e(`komc:w-full komc:animate-pulse komc:bg-gray-200`),{variants:{size:{xs:`komc:h-4`,sm:`komc:h-8`,md:`komc:h-12`,lg:`komc:h-16`,xl:`komc:h-20`,"2xl":`komc:h-24`,"3xl":`komc:h-28`,square:`komc:h-auto komc:aspect-square`,full:`komc:h-full`},rounded:{none:`komc:rounded-none`,sm:`komc:rounded-sm`,md:`komc:rounded-md`,lg:`komc:rounded-lg`,xl:`komc:rounded-xl`,"2xl":`komc:rounded-2xl`,"3xl":`komc:rounded-3xl`,full:`komc:rounded-full`}},defaultVariants:{size:`sm`,rounded:`sm`}});function i({size:e,rounded:n,width:i,height:a,className:o,...s}){let c=i?typeof i==`string`?i:`${i}px`:void 0,l=a?typeof a==`string`?a:`${a}px`:void 0;return t(`div`,{"data-komc":!0,"aria-hidden":`true`,className:r({size:e,rounded:n,className:o}),style:{width:c,height:l},...s})}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-Bmb41Sf3.cjs`);let t=require(`js-cookie`);t=e.t(t);let n=require(`query-string`);n=e.t(n);var r=class{#e;#t;constructor(e){this.#e=e.apiEndpoint,this.#t=e.cdnEndpoint}async login(e,t){let n=`${this.#e}/auth/login`;return await(await fetch(n,{method:`POST`,body:JSON.stringify({email:e,password:t}),headers:{"Content-Type":`application/json`},credentials:`include`})).json()}logout(e=`/`,n=`.komachine.com`){let r={path:e};window.location.hostname!==`localhost`&&(r.domain=n),t.default.remove(`access`,r),window.location.href=r.path}getToken(){return t.default.get(`access`)}getBearer(){return`Bearer ${this.getToken()}`}async accessLog(){if(this.getToken()===void 0)throw Error(`로그인 필요`);let e=`${this.#e}/access-log`,t=await fetch(e,{headers:{Authorization:this.getBearer()}});if(!t.ok)throw Error(`인증에러`);return await t.json()}async me(){if(this.getToken()===void 0)throw Error(`로그인 필요`);let e=`${this.#e}/me`,t=await fetch(e,{headers:{Authorization:this.getBearer()}});if(!t.ok)throw Error(`인증에러`);return await t.json()}async hasPermission(e,t,n=!1,r=!1){if(this.getToken()===void 0){if(!r)throw Error(`로그인 필요`);return}let i=`${this.#e}/has-permission?obj=${e}&act=${t}`;n&&(i=`${i}&exact=true`);let a=await fetch(i,{headers:{Authorization:this.getBearer()}});if(!a.ok){if(!r)throw Error(`인증에러`);return}return await a.json()}cdnMedia(e,t){if(!e)return``;if(t){let[n,r]=e.split(`/`);return`${this.#t}/media/resized/${n}/${t}/${r}`}return`${this.#t}/media/${e}`}cdnStatic(e,t){if(!e)return``;if(t){let[n,r]=e.split(`/`);return`${this.#t}/media/resized/${n}/${t}/${r}`}return`${this.#t}/static/${e}`}refinePath(e){if(!e?.trim())return``;if(e.startsWith(`blob:`)){let t=e.lastIndexOf(`/`);if(t!==-1){let n=e.substring(0,t+1),r=e.substring(t+1),i=r.lastIndexOf(`.`);if(i!==-1)return n+r.substring(0,i)}}return this.cdnMedia(e)}getUploadPresignURL(e){let t=n.default.stringify(e);return fetch(`${this.#e}/upload/presign?${t}`,{credentials:`include`,headers:{Authorization:this.getBearer()}})}createParaMap(e,t){let n=URL.createObjectURL(e).split(`/`).pop()||``,r=e.name.split(`.`).pop()?.toLowerCase(),i=`${t?`${t.replace(/^\//,``)}/`:``}${n}.${r}`,a={contentType:e.type||`application/octet-stream`,length:e.size,key:i};return e.type.includes(`image`)||(a.disposition=`attachment; filename*=UTF8''${encodeURI(e.name)}`),a}async upload(e,t){let n=this.createParaMap(e,t),r=await(await this.getUploadPresignURL(n)).json(),i={"Content-Length":n.length.toString(),"Content-Type":n.contentType.toString()};n.disposition&&(i[`Content-Disposition`]=n.disposition);try{await fetch(r,{method:`PUT`,headers:i,body:e,credentials:`include`})}catch(e){return new Promise((t,n)=>n(e))}return new Promise(e=>e(n.key))}};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"js-cookie";import t from"query-string";var n=class{#e;#t;constructor(e){this.#e=e.apiEndpoint,this.#t=e.cdnEndpoint}async login(e,t){let n=`${this.#e}/auth/login`;return await(await fetch(n,{method:`POST`,body:JSON.stringify({email:e,password:t}),headers:{"Content-Type":`application/json`},credentials:`include`})).json()}logout(t=`/`,n=`.komachine.com`){let r={path:t};window.location.hostname!==`localhost`&&(r.domain=n),e.remove(`access`,r),window.location.href=r.path}getToken(){return e.get(`access`)}getBearer(){return`Bearer ${this.getToken()}`}async accessLog(){if(this.getToken()===void 0)throw Error(`로그인 필요`);let e=`${this.#e}/access-log`,t=await fetch(e,{headers:{Authorization:this.getBearer()}});if(!t.ok)throw Error(`인증에러`);return await t.json()}async me(){if(this.getToken()===void 0)throw Error(`로그인 필요`);let e=`${this.#e}/me`,t=await fetch(e,{headers:{Authorization:this.getBearer()}});if(!t.ok)throw Error(`인증에러`);return await t.json()}async hasPermission(e,t,n=!1,r=!1){if(this.getToken()===void 0){if(!r)throw Error(`로그인 필요`);return}let i=`${this.#e}/has-permission?obj=${e}&act=${t}`;n&&(i=`${i}&exact=true`);let a=await fetch(i,{headers:{Authorization:this.getBearer()}});if(!a.ok){if(!r)throw Error(`인증에러`);return}return await a.json()}cdnMedia(e,t){if(!e)return``;if(t){let[n,r]=e.split(`/`);return`${this.#t}/media/resized/${n}/${t}/${r}`}return`${this.#t}/media/${e}`}cdnStatic(e,t){if(!e)return``;if(t){let[n,r]=e.split(`/`);return`${this.#t}/media/resized/${n}/${t}/${r}`}return`${this.#t}/static/${e}`}refinePath(e){if(!e?.trim())return``;if(e.startsWith(`blob:`)){let t=e.lastIndexOf(`/`);if(t!==-1){let n=e.substring(0,t+1),r=e.substring(t+1),i=r.lastIndexOf(`.`);if(i!==-1)return n+r.substring(0,i)}}return this.cdnMedia(e)}getUploadPresignURL(e){let n=t.stringify(e);return fetch(`${this.#e}/upload/presign?${n}`,{credentials:`include`,headers:{Authorization:this.getBearer()}})}createParaMap(e,t){let n=URL.createObjectURL(e).split(`/`).pop()||``,r=e.name.split(`.`).pop()?.toLowerCase(),i=`${t?`${t.replace(/^\//,``)}/`:``}${n}.${r}`,a={contentType:e.type||`application/octet-stream`,length:e.size,key:i};return e.type.includes(`image`)||(a.disposition=`attachment; filename*=UTF8''${encodeURI(e.name)}`),a}async upload(e,t){let n=this.createParaMap(e,t),r=await(await this.getUploadPresignURL(n)).json(),i={"Content-Length":n.length.toString(),"Content-Type":n.contentType.toString()};n.disposition&&(i[`Content-Disposition`]=n.disposition);try{await fetch(r,{method:`PUT`,headers:i,body:e,credentials:`include`})}catch(e){return new Promise((t,n)=>n(e))}return new Promise(e=>e(n.key))}};export{n as t};
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
[data-komc] {
|
|
2
|
+
&.tiptap,
|
|
3
|
+
.tiptap {
|
|
4
|
+
max-width: none;
|
|
5
|
+
outline: none;
|
|
6
|
+
position: relative;
|
|
7
|
+
|
|
8
|
+
& :first-child {
|
|
9
|
+
margin-top: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
& :last-child {
|
|
13
|
+
margin-bottom: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&.resize-cursor {
|
|
17
|
+
cursor: col-resize;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
& :where(strong) {
|
|
21
|
+
color: inherit;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
& [data-align='left'] {
|
|
25
|
+
text-align: left;
|
|
26
|
+
}
|
|
27
|
+
& [data-align='center'] {
|
|
28
|
+
text-align: center;
|
|
29
|
+
}
|
|
30
|
+
& [data-align='right'] {
|
|
31
|
+
text-align: right;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.resize-cursor:has(table .selectedCell) {
|
|
35
|
+
cursor: inherit;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
& table:has(.selectedCell) .column-resize-handle {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
& table {
|
|
43
|
+
max-width: 100%;
|
|
44
|
+
position: relative;
|
|
45
|
+
|
|
46
|
+
& td,
|
|
47
|
+
& th {
|
|
48
|
+
border: 1px solid #dddddd;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
min-width: 1em;
|
|
51
|
+
padding: 6px 8px;
|
|
52
|
+
position: relative;
|
|
53
|
+
vertical-align: top;
|
|
54
|
+
|
|
55
|
+
& > * {
|
|
56
|
+
margin-top: 0;
|
|
57
|
+
margin-bottom: 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
& th {
|
|
62
|
+
background-color: #f8f8f9;
|
|
63
|
+
font-weight: 700;
|
|
64
|
+
text-align: left;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
& th.active-cell,
|
|
68
|
+
& td.active-cell {
|
|
69
|
+
outline: 1.5px solid #08f;
|
|
70
|
+
outline-offset: -1px;
|
|
71
|
+
border-radius: 3px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
& th.selectedCell.active-cell,
|
|
75
|
+
& td.selectedCell.active-cell {
|
|
76
|
+
outline: none;
|
|
77
|
+
border-radius: 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
& .table-col-control {
|
|
82
|
+
display: flex;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
align-items: center;
|
|
85
|
+
width: 20px;
|
|
86
|
+
height: 20px;
|
|
87
|
+
padding: 0;
|
|
88
|
+
border: 1px solid #cccccc;
|
|
89
|
+
border-radius: 4px;
|
|
90
|
+
background: white;
|
|
91
|
+
top: -24px;
|
|
92
|
+
left: 50%;
|
|
93
|
+
transform: translateX(-50%);
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
position: absolute;
|
|
96
|
+
z-index: 10;
|
|
97
|
+
|
|
98
|
+
&:hover {
|
|
99
|
+
background-color: #f8f8f9;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
& .table-row-control {
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
align-items: center;
|
|
107
|
+
width: 20px;
|
|
108
|
+
height: 20px;
|
|
109
|
+
padding: 0;
|
|
110
|
+
border: 1px solid #cccccc;
|
|
111
|
+
border-radius: 4px;
|
|
112
|
+
background: white;
|
|
113
|
+
top: 50%;
|
|
114
|
+
left: -24px;
|
|
115
|
+
transform: translateY(-50%);
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
position: absolute;
|
|
118
|
+
font-weight: 500;
|
|
119
|
+
z-index: 10;
|
|
120
|
+
|
|
121
|
+
&:hover {
|
|
122
|
+
background-color: #f8f8f9;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
& .column-resize-handle {
|
|
127
|
+
position: absolute;
|
|
128
|
+
top: 0;
|
|
129
|
+
right: -1px;
|
|
130
|
+
bottom: -2px;
|
|
131
|
+
width: 4px;
|
|
132
|
+
background-color: #08f;
|
|
133
|
+
pointer-events: none;
|
|
134
|
+
animation: komc-column-resize-handle-fade-in 200ms ease-out;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
& .column-resize-handle.resize-handle-stable {
|
|
138
|
+
animation: none;
|
|
139
|
+
opacity: 1;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
& .details {
|
|
143
|
+
display: flex;
|
|
144
|
+
gap: 0.25em;
|
|
145
|
+
margin: 1.25em 0;
|
|
146
|
+
|
|
147
|
+
&:first-child {
|
|
148
|
+
margin-top: 0;
|
|
149
|
+
}
|
|
150
|
+
&:last-child {
|
|
151
|
+
margin-bottom: 0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
& summary {
|
|
155
|
+
list-style: none;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
& > button {
|
|
159
|
+
display: flex;
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
align-items: center;
|
|
163
|
+
background: transparent;
|
|
164
|
+
width: 2.25em;
|
|
165
|
+
height: 2.25em;
|
|
166
|
+
font-size: 0.625em;
|
|
167
|
+
margin-top: 0.25em;
|
|
168
|
+
border-radius: 4px;
|
|
169
|
+
|
|
170
|
+
&:hover {
|
|
171
|
+
background-color: #fafafa;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&::before {
|
|
175
|
+
content: '\25B6';
|
|
176
|
+
transition: transform 0.15s ease;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&.is-open > button::before {
|
|
181
|
+
transform: rotate(90deg);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
& > div {
|
|
185
|
+
display: flex;
|
|
186
|
+
flex-direction: column;
|
|
187
|
+
gap: 1em;
|
|
188
|
+
width: 100%;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
& .node-imageUploader {
|
|
193
|
+
margin-block: 1rem;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&.editor-wrapper,
|
|
198
|
+
.editor-wrapper {
|
|
199
|
+
& .editor-title {
|
|
200
|
+
font-weight: 500;
|
|
201
|
+
margin-bottom: 24px;
|
|
202
|
+
border-bottom: 2px solid #e6ebfe;
|
|
203
|
+
|
|
204
|
+
& + p {
|
|
205
|
+
margin-top: 0;
|
|
206
|
+
margin-bottom: 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
& + * + img {
|
|
210
|
+
margin-top: 0 !important;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
& * + .editor-title {
|
|
215
|
+
margin-top: 36px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&:focus-within .tiptap .selectedCell::after {
|
|
219
|
+
content: '';
|
|
220
|
+
position: absolute;
|
|
221
|
+
inset: 0;
|
|
222
|
+
background: #eeeeee;
|
|
223
|
+
opacity: 0.9;
|
|
224
|
+
pointer-events: none;
|
|
225
|
+
z-index: 2;
|
|
226
|
+
box-shadow: 0 0 0 1px #4770ff;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&.column-resize-handle-ghost,
|
|
231
|
+
.column-resize-handle-ghost {
|
|
232
|
+
position: absolute;
|
|
233
|
+
background-color: #08f;
|
|
234
|
+
pointer-events: none;
|
|
235
|
+
animation: komc-column-resize-handle-fade-out 200ms ease-out forwards;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@keyframes komc-column-resize-handle-fade-in {
|
|
240
|
+
from {
|
|
241
|
+
opacity: 0;
|
|
242
|
+
}
|
|
243
|
+
to {
|
|
244
|
+
opacity: 1;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
@keyframes komc-column-resize-handle-fade-out {
|
|
249
|
+
from {
|
|
250
|
+
opacity: 1;
|
|
251
|
+
}
|
|
252
|
+
to {
|
|
253
|
+
opacity: 0;
|
|
254
|
+
}
|
|
255
|
+
}
|