@ydesign/react-editor 0.1.0 → 0.1.2

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.
Files changed (192) hide show
  1. package/dist/app.css +1 -1
  2. package/dist/app.js +1 -1
  3. package/dist/canvas/workspace.d.ts +6 -4
  4. package/dist/canvas/workspace.js +1 -1
  5. package/dist/chunk-2AZQIJ4K.js +1 -0
  6. package/dist/chunk-45NWLCOP.js +15 -0
  7. package/dist/chunk-63A6RW6Y.js +21 -0
  8. package/dist/chunk-6XGFXDKJ.js +151 -0
  9. package/dist/chunk-EUTDQZKU.js +1 -0
  10. package/dist/chunk-KERQXVBL.js +1 -0
  11. package/dist/chunk-QALZ5CAJ.js +214 -0
  12. package/dist/{chunk-7YLSIB43.js → chunk-RBRSKAZL.js} +1 -1
  13. package/dist/chunk-YBC2DYJX.js +9 -0
  14. package/dist/config.d.ts +228 -3
  15. package/dist/config.js +1 -1
  16. package/dist/model/store.d.ts +5 -364
  17. package/dist/model/store.js +1 -1
  18. package/dist/project.d.ts +12 -4
  19. package/dist/project.js +1 -1
  20. package/dist/side-panel/index.d.ts +2 -5
  21. package/dist/side-panel/index.js +1 -1
  22. package/dist/side-panel/side-panel.d.ts +12 -6
  23. package/dist/side-panel/side-panel.js +1 -1
  24. package/dist/store-DfmY1m2j.d.ts +379 -0
  25. package/dist/toolbar/download-button.d.ts +1 -3
  26. package/dist/toolbar/download-button.js +1 -1
  27. package/dist/toolbar/toolbar.d.ts +1 -3
  28. package/dist/toolbar/toolbar.js +18 -1
  29. package/dist/toolbar/zoom-buttons.d.ts +1 -3
  30. package/dist/topbar/create-design.d.ts +1 -3
  31. package/dist/topbar/create-design.js +1 -1
  32. package/dist/topbar/topbar.d.ts +1 -3
  33. package/dist/topbar/topbar.js +5 -5
  34. package/package.json +2 -2
  35. package/dist/assets/logo.d.ts +0 -7
  36. package/dist/assets/logo.js +0 -1
  37. package/dist/canvas/context-menu/context-menu.d.ts +0 -2
  38. package/dist/canvas/context-menu/context-menu.js +0 -0
  39. package/dist/canvas/hotkeys.d.ts +0 -3
  40. package/dist/canvas/hotkeys.js +0 -1
  41. package/dist/canvas/workspace-canvas.d.ts +0 -19
  42. package/dist/canvas/workspace-canvas.js +0 -1
  43. package/dist/chunk-2A3HHQ7X.js +0 -1
  44. package/dist/chunk-2T3O5ZZ2.js +0 -1
  45. package/dist/chunk-3TO57JPN.js +0 -1
  46. package/dist/chunk-4LUZF4CB.js +0 -2
  47. package/dist/chunk-5CKXOQAT.js +0 -1
  48. package/dist/chunk-5OA2JYPB.js +0 -1
  49. package/dist/chunk-5X6VER6G.js +0 -1
  50. package/dist/chunk-62YF5KTO.js +0 -1
  51. package/dist/chunk-75WC3GVB.js +0 -1
  52. package/dist/chunk-7NNOHYKX.js +0 -15
  53. package/dist/chunk-AC6CCGZH.js +0 -1
  54. package/dist/chunk-BE3YOONJ.js +0 -1
  55. package/dist/chunk-BWST6EER.js +0 -1
  56. package/dist/chunk-CB23VFSC.js +0 -1
  57. package/dist/chunk-DGCF2GDA.js +0 -9
  58. package/dist/chunk-ESNVOB52.js +0 -17
  59. package/dist/chunk-HHYPIHAP.js +0 -45
  60. package/dist/chunk-HOAYYKAZ.js +0 -3
  61. package/dist/chunk-IUFYYEGO.js +0 -1
  62. package/dist/chunk-IV52R7D7.js +0 -27
  63. package/dist/chunk-J6PYM4EV.js +0 -1
  64. package/dist/chunk-JHNSYFB2.js +0 -151
  65. package/dist/chunk-JMIN2XMC.js +0 -1
  66. package/dist/chunk-JPIYZYMQ.js +0 -1
  67. package/dist/chunk-KVT25LDU.js +0 -1
  68. package/dist/chunk-MGTFIE3C.js +0 -1
  69. package/dist/chunk-NLABIDJ5.js +0 -1
  70. package/dist/chunk-O56ZNYGR.js +0 -1
  71. package/dist/chunk-O73AAP2K.js +0 -1
  72. package/dist/chunk-OQ6HU62L.js +0 -1
  73. package/dist/chunk-P5I43V7X.js +0 -1
  74. package/dist/chunk-POCSL7OS.js +0 -50
  75. package/dist/chunk-PSO4W6J7.js +0 -9
  76. package/dist/chunk-QVSJHU2S.js +0 -1
  77. package/dist/chunk-QWM7VMLQ.js +0 -9
  78. package/dist/chunk-SGK2XN5D.js +0 -1
  79. package/dist/chunk-T3TEB73P.js +0 -1
  80. package/dist/chunk-TS5CKDHH.js +0 -1
  81. package/dist/chunk-TTK5Z2Z6.js +0 -1
  82. package/dist/chunk-TZ6B7XDS.js +0 -1
  83. package/dist/chunk-U7TPE4R3.js +0 -54
  84. package/dist/chunk-UCJMXWVT.js +0 -16
  85. package/dist/chunk-WCHGSVUC.js +0 -8
  86. package/dist/chunk-WJT6VPDR.js +0 -9
  87. package/dist/chunk-XA2G4P2Q.js +0 -1
  88. package/dist/chunk-XRRO2RT7.js +0 -1
  89. package/dist/chunk-YCJBBRRT.js +0 -1
  90. package/dist/chunk-YRJUN267.js +0 -14
  91. package/dist/chunk-YVBVDUVA.js +0 -1
  92. package/dist/chunk-Z4QXUZAS.js +0 -1
  93. package/dist/hooks/use-duplicate-element.d.ts +0 -16
  94. package/dist/hooks/use-duplicate-element.js +0 -1
  95. package/dist/hooks/use-lock.d.ts +0 -18
  96. package/dist/hooks/use-lock.js +0 -1
  97. package/dist/hooks/use-remove-element.d.ts +0 -16
  98. package/dist/hooks/use-remove-element.js +0 -1
  99. package/dist/lib/utils.d.ts +0 -5
  100. package/dist/lib/utils.js +0 -1
  101. package/dist/side-panel/background-panel.d.ts +0 -17
  102. package/dist/side-panel/background-panel.js +0 -1
  103. package/dist/side-panel/images-grid.d.ts +0 -27
  104. package/dist/side-panel/images-grid.js +0 -1
  105. package/dist/side-panel/layers-panel.d.ts +0 -16
  106. package/dist/side-panel/layers-panel.js +0 -1
  107. package/dist/side-panel/photos-panel.d.ts +0 -16
  108. package/dist/side-panel/photos-panel.js +0 -1
  109. package/dist/side-panel/shapes-panel.d.ts +0 -16
  110. package/dist/side-panel/shapes-panel.js +0 -1
  111. package/dist/side-panel/size-panel.d.ts +0 -16
  112. package/dist/side-panel/size-panel.js +0 -1
  113. package/dist/side-panel/tab-button.d.ts +0 -12
  114. package/dist/side-panel/tab-button.js +0 -1
  115. package/dist/side-panel/templates-panel.d.ts +0 -16
  116. package/dist/side-panel/templates-panel.js +0 -1
  117. package/dist/side-panel/text-panel.d.ts +0 -16
  118. package/dist/side-panel/text-panel.js +0 -1
  119. package/dist/side-panel/upload-panel.d.ts +0 -17
  120. package/dist/side-panel/upload-panel.js +0 -1
  121. package/dist/toolbar/default-toolbar.d.ts +0 -21
  122. package/dist/toolbar/default-toolbar.js +0 -1
  123. package/dist/toolbar/duplicate-button.d.ts +0 -16
  124. package/dist/toolbar/duplicate-button.js +0 -1
  125. package/dist/toolbar/element-container.d.ts +0 -13
  126. package/dist/toolbar/element-container.js +0 -1
  127. package/dist/toolbar/figure-toolbar.d.ts +0 -33
  128. package/dist/toolbar/figure-toolbar.js +0 -1
  129. package/dist/toolbar/filters-picker.d.ts +0 -18
  130. package/dist/toolbar/filters-picker.js +0 -1
  131. package/dist/toolbar/flip-button.d.ts +0 -18
  132. package/dist/toolbar/flip-button.js +0 -1
  133. package/dist/toolbar/group-button.d.ts +0 -16
  134. package/dist/toolbar/group-button.js +0 -1
  135. package/dist/toolbar/history-buttons.d.ts +0 -16
  136. package/dist/toolbar/history-buttons.js +0 -1
  137. package/dist/toolbar/image-eraser-pen.d.ts +0 -10
  138. package/dist/toolbar/image-eraser-pen.js +0 -1
  139. package/dist/toolbar/image-remove-background.d.ts +0 -10
  140. package/dist/toolbar/image-remove-background.js +0 -1
  141. package/dist/toolbar/image-toolbar.d.ts +0 -36
  142. package/dist/toolbar/image-toolbar.js +0 -1
  143. package/dist/toolbar/lock-button.d.ts +0 -16
  144. package/dist/toolbar/lock-button.js +0 -1
  145. package/dist/toolbar/many-toolbar.d.ts +0 -5
  146. package/dist/toolbar/many-toolbar.js +0 -1
  147. package/dist/toolbar/opacity-picker.d.ts +0 -16
  148. package/dist/toolbar/opacity-picker.js +0 -1
  149. package/dist/toolbar/position-picker.d.ts +0 -16
  150. package/dist/toolbar/position-picker.js +0 -1
  151. package/dist/toolbar/remove-button.d.ts +0 -16
  152. package/dist/toolbar/remove-button.js +0 -1
  153. package/dist/toolbar/text-ai-write.d.ts +0 -7
  154. package/dist/toolbar/text-ai-write.js +0 -1
  155. package/dist/toolbar/text-toolbar.d.ts +0 -19
  156. package/dist/toolbar/text-toolbar.js +0 -1
  157. package/dist/topbar/file-menu.d.ts +0 -19
  158. package/dist/topbar/file-menu.js +0 -1
  159. package/dist/topbar/psd-parser.d.ts +0 -9
  160. package/dist/topbar/psd-parser.js +0 -1
  161. package/dist/utils/api.d.ts +0 -15
  162. package/dist/utils/api.js +0 -1
  163. package/dist/utils/blob.d.ts +0 -5
  164. package/dist/utils/blob.js +0 -1
  165. package/dist/utils/download.d.ts +0 -3
  166. package/dist/utils/download.js +0 -1
  167. package/dist/utils/figure-to-svg.d.ts +0 -36
  168. package/dist/utils/figure-to-svg.js +0 -1
  169. package/dist/utils/file.d.ts +0 -3
  170. package/dist/utils/file.js +0 -1
  171. package/dist/utils/filters.d.ts +0 -2
  172. package/dist/utils/filters.js +0 -0
  173. package/dist/utils/fonts.d.ts +0 -68
  174. package/dist/utils/fonts.js +0 -1
  175. package/dist/utils/image.d.ts +0 -19
  176. package/dist/utils/image.js +0 -1
  177. package/dist/utils/l10n.d.ts +0 -227
  178. package/dist/utils/l10n.js +0 -1
  179. package/dist/utils/loader.d.ts +0 -6
  180. package/dist/utils/loader.js +0 -1
  181. package/dist/utils/screen.d.ts +0 -6
  182. package/dist/utils/screen.js +0 -1
  183. package/dist/utils/svg.d.ts +0 -3
  184. package/dist/utils/svg.js +0 -1
  185. package/dist/utils/text.d.ts +0 -3
  186. package/dist/utils/text.js +0 -1
  187. package/dist/utils/use-api.d.ts +0 -2
  188. package/dist/utils/use-api.js +0 -0
  189. package/dist/utils/use-axios.d.ts +0 -25
  190. package/dist/utils/use-axios.js +0 -1
  191. /package/dist/{chunk-MXZ6RXT3.js → chunk-EWOU5F3O.js} +0 -0
  192. /package/dist/{chunk-YCFED7XQ.js → chunk-WFMCGQ5V.js} +0 -0
@@ -1 +0,0 @@
1
- import{a,b}from"../chunk-XRRO2RT7.js";import"../chunk-O2XFH626.js";export{a as ManyToolbar,b as default};
@@ -1,16 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { StoreType } from '../model/store.js';
3
- import 'fabric';
4
- import 'mobx-state-tree/dist/internal';
5
- import 'mobx-state-tree';
6
- import '@ydesign/core';
7
- import '../utils/fonts.js';
8
- import 'mobx';
9
-
10
- declare const OpacityPicker: (({ store }: {
11
- store: StoreType;
12
- }) => react_jsx_runtime.JSX.Element) & {
13
- displayName: string;
14
- };
15
-
16
- export { OpacityPicker };
@@ -1 +0,0 @@
1
- import{a}from"../chunk-YCJBBRRT.js";import"../chunk-YCFED7XQ.js";import"../chunk-O2XFH626.js";export{a as OpacityPicker};
@@ -1,16 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { StoreType } from '../model/store.js';
3
- import 'fabric';
4
- import 'mobx-state-tree/dist/internal';
5
- import 'mobx-state-tree';
6
- import '@ydesign/core';
7
- import '../utils/fonts.js';
8
- import 'mobx';
9
-
10
- declare const PositionPicker: (({ store }: {
11
- store: StoreType;
12
- }) => react_jsx_runtime.JSX.Element) & {
13
- displayName: string;
14
- };
15
-
16
- export { PositionPicker };
@@ -1 +0,0 @@
1
- import{a}from"../chunk-5OA2JYPB.js";import"../chunk-YCFED7XQ.js";import"../chunk-O2XFH626.js";export{a as PositionPicker};
@@ -1,16 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { StoreType } from '../model/store.js';
3
- import 'fabric';
4
- import 'mobx-state-tree/dist/internal';
5
- import 'mobx-state-tree';
6
- import '@ydesign/core';
7
- import '../utils/fonts.js';
8
- import 'mobx';
9
-
10
- declare const RemoveButton: (({ store }: {
11
- store: StoreType;
12
- }) => react_jsx_runtime.JSX.Element) & {
13
- displayName: string;
14
- };
15
-
16
- export { RemoveButton };
@@ -1 +0,0 @@
1
- import{a}from"../chunk-2A3HHQ7X.js";import"../chunk-IUFYYEGO.js";import"../chunk-YCFED7XQ.js";import"../chunk-O2XFH626.js";export{a as RemoveButton};
@@ -1,7 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- declare const TextAiWrite: (() => react_jsx_runtime.JSX.Element) & {
4
- displayName: string;
5
- };
6
-
7
- export { TextAiWrite };
@@ -1 +0,0 @@
1
- import{a}from"../chunk-2T3O5ZZ2.js";import"../chunk-YCFED7XQ.js";import"../chunk-O2XFH626.js";export{a as TextAiWrite};
@@ -1,19 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { StoreType } from '../model/store.js';
3
- import 'fabric';
4
- import 'mobx-state-tree/dist/internal';
5
- import 'mobx-state-tree';
6
- import '@ydesign/core';
7
- import '../utils/fonts.js';
8
- import 'mobx';
9
-
10
- type PageProps = {
11
- store: StoreType;
12
- components?: any;
13
- };
14
- declare const ALIGN_OPTIONS: string[];
15
- declare const TextToolbar: (({ store, components }: PageProps) => react_jsx_runtime.JSX.Element) & {
16
- displayName: string;
17
- };
18
-
19
- export { ALIGN_OPTIONS, TextToolbar, TextToolbar as default };
@@ -1 +0,0 @@
1
- import{a,b,c}from"../chunk-KVT25LDU.js";import"../chunk-2T3O5ZZ2.js";import"../chunk-YVBVDUVA.js";import"../chunk-RVXI723F.js";import"../chunk-YRJUN267.js";import"../chunk-WCHGSVUC.js";import"../chunk-YCFED7XQ.js";import"../chunk-WJT6VPDR.js";import"../chunk-O2XFH626.js";export{a as ALIGN_OPTIONS,b as TextToolbar,c as default};
@@ -1,19 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { StoreType } from '../model/store.js';
3
- import { ProjectType } from '../project.js';
4
- import 'fabric';
5
- import 'mobx-state-tree/dist/internal';
6
- import 'mobx-state-tree';
7
- import '@ydesign/core';
8
- import '../utils/fonts.js';
9
- import 'mobx';
10
- import 'react';
11
-
12
- declare const FileMenu: (({ store, project }: {
13
- store: StoreType;
14
- project: ProjectType;
15
- }) => react_jsx_runtime.JSX.Element) & {
16
- displayName: string;
17
- };
18
-
19
- export { FileMenu };
@@ -1 +0,0 @@
1
- import{a}from"../chunk-BWST6EER.js";import"../chunk-JHNSYFB2.js";import"../chunk-5CKXOQAT.js";import"../chunk-NLABIDJ5.js";import"../chunk-QVSJHU2S.js";import"../chunk-P5I43V7X.js";import"../chunk-5C2MNUBC.js";import"../chunk-MXZ6RXT3.js";import"../chunk-BE3YOONJ.js";import"../chunk-YCFED7XQ.js";import"../chunk-WJT6VPDR.js";import"../chunk-O2XFH626.js";export{a as FileMenu};
@@ -1,9 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- interface PSDParserProps {
4
- visible: boolean;
5
- onClose: () => void;
6
- }
7
- declare const PSDParser: ({ visible, onClose }: PSDParserProps) => react_jsx_runtime.JSX.Element;
8
-
9
- export { PSDParser };
@@ -1 +0,0 @@
1
- import{a}from"../chunk-5CKXOQAT.js";import"../chunk-NLABIDJ5.js";import"../chunk-QVSJHU2S.js";import"../chunk-P5I43V7X.js";import"../chunk-BE3YOONJ.js";import"../chunk-WJT6VPDR.js";import"../chunk-O2XFH626.js";export{a as PSDParser};
@@ -1,15 +0,0 @@
1
- /**
2
- * 后台的接口汇总
3
- */
4
- declare const URL = "http://219.151.185.37:9003";
5
- declare const API = "http://219.151.185.37:9003/api";
6
- declare const getAPI: () => string;
7
- declare const URLS: Record<string, (...args: any[]) => string>;
8
- declare const getFontList: () => string;
9
- declare const templateList: () => string;
10
- declare const templateDetail: (id: string) => string;
11
- declare const uploadImage: () => string;
12
- declare const psdParse: () => string;
13
- declare const setAPI: (o: string, t: (...args: any[]) => string) => void;
14
-
15
- export { API, URL, URLS, getAPI, getFontList, psdParse, setAPI, templateDetail, templateList, uploadImage };
package/dist/utils/api.js DELETED
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j}from"../chunk-BE3YOONJ.js";import"../chunk-O2XFH626.js";export{b as API,a as URL,d as URLS,c as getAPI,e as getFontList,i as psdParse,j as setAPI,g as templateDetail,f as templateList,h as uploadImage};
@@ -1,5 +0,0 @@
1
- declare function dataURLtoBlob(dataurl: string): Blob;
2
- declare function blobToDataURL(blob: Blob, callback: (dataUrl: string) => void): void;
3
- declare function blobToDataURLAsync(blob: Blob): Promise<string>;
4
-
5
- export { blobToDataURL, blobToDataURLAsync, dataURLtoBlob };
@@ -1 +0,0 @@
1
- import"../chunk-O2XFH626.js";function l(n){let e=n.split(","),r=e[0].match(/:(.*?);/)?.[1]||"application/octet-stream",o=atob(e[1]),t=o.length,a=new Uint8Array(t);for(;t--;)a[t]=o.charCodeAt(t);return new Blob([a],{type:r})}function s(n,e){let r=new FileReader;r.onload=o=>{let t=o.target?.result;typeof t=="string"&&e(t)},r.readAsDataURL(n)}function i(n){return new Promise((e,r)=>{let o=new FileReader;o.onload=t=>{let a=t.target?.result;typeof a=="string"?e(a):r(new Error("Failed to convert blob to data URL"))},o.onerror=()=>r(new Error("Failed to read blob")),o.readAsDataURL(n)})}export{s as blobToDataURL,i as blobToDataURLAsync,l as dataURLtoBlob};
@@ -1,3 +0,0 @@
1
- declare function downloadFile(file: Blob, fileName: string): Promise<void>;
2
-
3
- export { downloadFile };
@@ -1 +0,0 @@
1
- import{a}from"../chunk-P5I43V7X.js";import"../chunk-O2XFH626.js";export{a as downloadFile};
@@ -1,36 +0,0 @@
1
- interface SizeParams {
2
- width: number;
3
- height: number;
4
- }
5
- interface RectParams extends SizeParams {
6
- cornerRadius?: number;
7
- }
8
- interface FigureParams extends SizeParams {
9
- id?: string;
10
- fill: string;
11
- stroke: string;
12
- strokeWidth: number;
13
- dash?: number[];
14
- subType: string;
15
- cornerRadius?: number;
16
- }
17
- type PathResult = string | {
18
- path: string;
19
- scaleX: number;
20
- scaleY: number;
21
- };
22
- type PathDataFunc = (params: FigureParams) => PathResult;
23
- declare const rectData: ({ width, height, cornerRadius }: RectParams) => string;
24
- declare const circleData: ({ width, height }: SizeParams) => string;
25
- declare function starPath({ width: t, height: h }: SizeParams): string;
26
- declare const triangleData: ({ width: t, height: h }: SizeParams) => string;
27
- declare const rightTriangleData: ({ width: t, height: h }: SizeParams) => string;
28
- declare function diamondPath({ width: t, height: h }: SizeParams): string;
29
- declare function pentagonPath({ width: t, height: h }: SizeParams): string;
30
- declare function hexagonPath({ width: t, height: h }: SizeParams): string;
31
- declare function speechBubblePath({ width: t, height: h }: SizeParams): string;
32
- declare function crossPath({ width: t, height: h }: SizeParams): string;
33
- declare const TYPES: Record<string, PathDataFunc>;
34
- declare function figureToSvg(params: FigureParams): string;
35
-
36
- export { TYPES, circleData, crossPath, diamondPath, figureToSvg, hexagonPath, pentagonPath, rectData, rightTriangleData, speechBubblePath, starPath, triangleData };
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l}from"../chunk-7NNOHYKX.js";import"../chunk-O2XFH626.js";export{k as TYPES,b as circleData,j as crossPath,f as diamondPath,l as figureToSvg,h as hexagonPath,g as pentagonPath,a as rectData,e as rightTriangleData,i as speechBubblePath,c as starPath,d as triangleData};
@@ -1,3 +0,0 @@
1
- declare function localFileToURL(e: File): Promise<unknown>;
2
-
3
- export { localFileToURL };
@@ -1 +0,0 @@
1
- import{a}from"../chunk-OQ6HU62L.js";import"../chunk-O2XFH626.js";export{a as localFileToURL};
@@ -1,2 +0,0 @@
1
-
2
- export { }
File without changes
@@ -1,68 +0,0 @@
1
- import * as mobx from 'mobx';
2
-
3
- type FONT = {
4
- fontFamily: string;
5
- url?: string;
6
- img?: string;
7
- name?: string;
8
- styles?: Array<{
9
- src: string;
10
- fontStyle?: string;
11
- fontWeight?: string;
12
- }>;
13
- };
14
- declare const globalFonts: mobx.IObservableArray<FONT>;
15
- declare function addGlobalFont(font: FONT): void;
16
- declare function removeGlobalFont(fontFamily: string): void;
17
- declare function replaceGlobalFonts(fonts: Array<FONT>): void;
18
- /**
19
- * 检查字体是否已加载
20
- */
21
- declare const isFontLoaded: (fontFamily: string) => boolean;
22
- /**
23
- * 设置字体加载超时回调
24
- */
25
- declare const setFontLoadTimeoutCallback: (callback: (message: string) => void) => void;
26
- declare const setTimeoutGetter: (getter: () => number) => void;
27
- /**
28
- * 加载字体并等待其可用
29
- *
30
- * 策略:
31
- * 1. 优先使用 document.fonts.load() API(现代浏览器)
32
- * 2. 降级方案:轮询检测字体宽度变化
33
- *
34
- * @param fontFamily - 字体名称
35
- * @param fontStyle - 字体样式 (normal/italic)
36
- * @param fontWeight - 字体粗细 (normal/bold/100-900)
37
- */
38
- declare function loadFont(fontFamily: string, fontStyle?: string, fontWeight?: string): Promise<void>;
39
- /**
40
- * 注入自定义字体到页面
41
- * 通过动态创建 @font-face 规则实现
42
- *
43
- * @param font - 字体配置对象
44
- */
45
- declare function injectCustomFont(font: FONT): void;
46
- /**
47
- * 设置 Google Fonts 字体变体
48
- * @param variants - 变体字符串,如 '400,700,900'
49
- */
50
- declare function setGoogleFontsVariants(variants: string): void;
51
- /**
52
- * 获取当前 Google Fonts 字体变体配置
53
- */
54
- declare function getGoogleFontsVariants(): string;
55
- /**
56
- * 生成 Google Fonts CSS URL
57
- * @param fontFamily - 字体名称
58
- */
59
- declare function getGoogleFontsUrl(fontFamily: string): string;
60
- /**
61
- * 注入 Google 字体到页面
62
- * 通过动态创建 <link> 标签加载 Google Fonts CSS
63
- *
64
- * @param fontFamily - 字体名称
65
- */
66
- declare function injectGoogleFont(fontFamily: string): void;
67
-
68
- export { type FONT, addGlobalFont, getGoogleFontsUrl, getGoogleFontsVariants, globalFonts, injectCustomFont, injectGoogleFont, isFontLoaded, loadFont, removeGlobalFont, replaceGlobalFonts, setFontLoadTimeoutCallback, setGoogleFontsVariants, setTimeoutGetter };
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"../chunk-WJT6VPDR.js";import"../chunk-O2XFH626.js";export{b as addGlobalFont,l as getGoogleFontsUrl,k as getGoogleFontsVariants,a as globalFonts,i as injectCustomFont,m as injectGoogleFont,e as isFontLoaded,h as loadFont,c as removeGlobalFont,d as replaceGlobalFonts,f as setFontLoadTimeoutCallback,j as setGoogleFontsVariants,g as setTimeoutGetter};
@@ -1,19 +0,0 @@
1
- declare function getImageSize(url: string): Promise<any>;
2
- type Size = {
3
- width: number;
4
- height: number;
5
- };
6
- /**
7
- * 计算图片适配到目标尺寸的裁剪参数(Cover 模式,居中裁剪)
8
- * @param targetSize 目标尺寸(画布/workarea)
9
- * @param imageSize 原始图片尺寸
10
- * @returns Fabric.js v6 裁剪参数(像素值)
11
- */
12
- declare function getCrop(targetSize: Size, imageSize: Size): {
13
- cropX: number;
14
- cropY: number;
15
- width: number;
16
- height: number;
17
- };
18
-
19
- export { getCrop, getImageSize };
@@ -1 +0,0 @@
1
- import{a,b}from"../chunk-3TO57JPN.js";import"../chunk-O2XFH626.js";export{b as getCrop,a as getImageSize};
@@ -1,227 +0,0 @@
1
- /**
2
- * 设置/更新翻译
3
- * @param {object} newTranslations - 新的翻译对象
4
- * @param {object} options - 配置选项
5
- * @param {boolean} options.validate - 是否验证翻译完整性
6
- */
7
- declare const setTranslations: (newTranslations: any, { validate }?: {
8
- validate?: boolean | undefined;
9
- }) => void;
10
- /**
11
- * 获取所有翻译(返回普通 JS 对象)
12
- * @returns {object}
13
- */
14
- declare const getTranslations: () => {
15
- toolbar: {
16
- undo: string;
17
- redo: string;
18
- duration: string;
19
- opacity: string;
20
- effects: string;
21
- blur: string;
22
- textBackground: string;
23
- backgroundCornerRadius: string;
24
- backgroundOpacity: string;
25
- backgroundPadding: string;
26
- backgroundColor: string;
27
- brightness: string;
28
- filters: string;
29
- sepia: string;
30
- grayscale: string;
31
- contrast: string;
32
- saturation: string;
33
- vibrance: string;
34
- hueRotation: string;
35
- noise: string;
36
- pixelate: string;
37
- textStroke: string;
38
- shadow: string;
39
- border: string;
40
- cornerRadius: string;
41
- textleft: string;
42
- textcenter: string;
43
- textright: string;
44
- textjustify: string;
45
- textBold: string;
46
- textItalic: string;
47
- textUnderline: string;
48
- textStrikethrough: string;
49
- splitByGrapheme: string;
50
- position: string;
51
- layering: string;
52
- toForward: string;
53
- up: string;
54
- down: string;
55
- toBottom: string;
56
- alignLeft: string;
57
- alignCenter: string;
58
- alignRight: string;
59
- alignTop: string;
60
- alignMiddle: string;
61
- alignBottom: string;
62
- flip: string;
63
- flipHorizontally: string;
64
- flipVertically: string;
65
- fitToBackground: string;
66
- removeBackground: string;
67
- removeBackgroundTitle: string;
68
- cancelRemoveBackground: string;
69
- confirmRemoveBackground: string;
70
- eraserPen: string;
71
- eraserPenTitle: string;
72
- cancelEraserPen: string;
73
- confirmEraserPen: string;
74
- crop: string;
75
- cropDone: string;
76
- cropCancel: string;
77
- clip: string;
78
- removeClip: string;
79
- removeMask: string;
80
- transparency: string;
81
- lockedDescription: string;
82
- unlockedDescription: string;
83
- removeElements: string;
84
- duplicateElements: string;
85
- download: string;
86
- saveAsImage: string;
87
- saveAsPDF: string;
88
- lineHeight: string;
89
- letterSpacing: string;
90
- offsetX: string;
91
- offsetY: string;
92
- color: string;
93
- selectable: string;
94
- draggable: string;
95
- removable: string;
96
- resizable: string;
97
- contentEditable: string;
98
- styleEditable: string;
99
- alwaysOnTop: string;
100
- showInExport: string;
101
- ungroupElements: string;
102
- groupElements: string;
103
- lineSize: string;
104
- fade: string;
105
- move: string;
106
- zoom: string;
107
- rotate: string;
108
- none: string;
109
- bounce: string;
110
- blink: string;
111
- strength: string;
112
- spaceEvenly: string;
113
- horizontalDistribution: string;
114
- verticalDistribution: string;
115
- strokeWidth: string;
116
- strokeSettings: string;
117
- colorPicker: {
118
- solid: string;
119
- linear: string;
120
- angle: string;
121
- };
122
- aiText: {
123
- aiWrite: string;
124
- rewrite: string;
125
- shorten: string;
126
- continue: string;
127
- proofread: string;
128
- tones: string;
129
- friendly: string;
130
- professional: string;
131
- humorous: string;
132
- formal: string;
133
- customPrompt: string;
134
- generatedResult: string;
135
- cancel: string;
136
- generate: string;
137
- back: string;
138
- tryAgain: string;
139
- insert: string;
140
- promptPlaceholder: string;
141
- };
142
- addImage: string;
143
- addText: string;
144
- fileType: string;
145
- quality: string;
146
- multiplier: string;
147
- size: string;
148
- };
149
- workspace: {
150
- noPages: string;
151
- addPage: string;
152
- removePage: string;
153
- duplicatePage: string;
154
- moveUp: string;
155
- moveDown: string;
156
- };
157
- scale: {
158
- reset: string;
159
- };
160
- error: {
161
- removeBackground: string;
162
- };
163
- sidePanel: {
164
- templates: string;
165
- searchTemplatesWithSameSize: string;
166
- searchPlaceholder: string;
167
- otherFormats: string;
168
- noResults: string;
169
- error: string;
170
- text: string;
171
- uploadFont: string;
172
- myFonts: string;
173
- photos: string;
174
- videos: string;
175
- animations: string;
176
- effects: string;
177
- elements: string;
178
- shapes: string;
179
- lines: string;
180
- upload: string;
181
- uploadImage: string;
182
- uploadTip: string;
183
- background: string;
184
- resize: string;
185
- layers: string;
186
- layerTypes: {
187
- image: string;
188
- text: string;
189
- svg: string;
190
- line: string;
191
- figure: string;
192
- group: string;
193
- };
194
- layersTip: string;
195
- noLayers: string;
196
- namePlaceholder: string;
197
- useMagicResize: string;
198
- clipImage: string;
199
- width: string;
200
- height: string;
201
- magicResizeDescription: string;
202
- headerText: string;
203
- createHeader: string;
204
- subHeaderText: string;
205
- createSubHeader: string;
206
- bodyText: string;
207
- createBody: string;
208
- units: string;
209
- };
210
- topbar: {
211
- newDesign: string;
212
- language: string;
213
- editableTextPlaceholder: string;
214
- statusLoading: string;
215
- statusSaved: string;
216
- statusHasChanges: string;
217
- statusSaving: string;
218
- };
219
- };
220
- /**
221
- * 获取翻译文本
222
- * @param {string} key - 翻译键,如 'toolbar.opacity'
223
- * @returns {string} 翻译文本,如果不存在则返回格式化后的键名
224
- */
225
- declare const translate: (key: string) => string;
226
-
227
- export { getTranslations, setTranslations, translate };
@@ -1 +0,0 @@
1
- import{a,b,c}from"../chunk-YCFED7XQ.js";import"../chunk-O2XFH626.js";export{b as getTranslations,a as setTranslations,c as translate};
@@ -1,6 +0,0 @@
1
- declare const setAssetLoadTimeout: (e: number) => void;
2
- declare const getAssetLoadTimeout: () => number;
3
- declare const setFontLoadTimeout: (e: number) => void;
4
- declare const getFontLoadTimeout: () => number;
5
-
6
- export { getAssetLoadTimeout, getFontLoadTimeout, setAssetLoadTimeout, setFontLoadTimeout };
@@ -1 +0,0 @@
1
- import"../chunk-O2XFH626.js";var e=3e4,s=t=>{e=t},n=()=>e,o=6e3,r=t=>{o=t},m=()=>o;export{n as getAssetLoadTimeout,m as getFontLoadTimeout,s as setAssetLoadTimeout,r as setFontLoadTimeout};
@@ -1,6 +0,0 @@
1
- declare const MOBILE_BREAKPOINT = 768;
2
- declare const isMobile: () => boolean;
3
- declare const mobileStyle: (e: string) => string;
4
- declare const useMobile: () => boolean;
5
-
6
- export { MOBILE_BREAKPOINT, isMobile, mobileStyle, useMobile };
@@ -1 +0,0 @@
1
- import{a,b,c,d}from"../chunk-WCHGSVUC.js";import"../chunk-O2XFH626.js";export{a as MOBILE_BREAKPOINT,b as isMobile,c as mobileStyle,d as useMobile};
@@ -1,3 +0,0 @@
1
- declare function svgToURL(svg: string): string;
2
-
3
- export { svgToURL };
package/dist/utils/svg.js DELETED
@@ -1 +0,0 @@
1
- import{a}from"../chunk-CB23VFSC.js";import"../chunk-O2XFH626.js";export{a as svgToURL};
@@ -1,3 +0,0 @@
1
- declare function removeTags(e?: string): string;
2
-
3
- export { removeTags };
@@ -1 +0,0 @@
1
- import{a}from"../chunk-4LUZF4CB.js";import"../chunk-O2XFH626.js";export{a as removeTags};
@@ -1,2 +0,0 @@
1
-
2
- export { }
File without changes
@@ -1,25 +0,0 @@
1
- import * as axios from 'axios';
2
-
3
- interface ApiResponse<T = any> {
4
- status: number;
5
- result: T;
6
- }
7
- interface UploadImageResult {
8
- id: string;
9
- userId: string;
10
- organizationId: string;
11
- url: string;
12
- filename: string;
13
- mimeType: string;
14
- size: number;
15
- width: number;
16
- height: number;
17
- description: string | null;
18
- tags: string | null;
19
- categoryId: string | null;
20
- createdAt: string;
21
- updatedAt: string;
22
- }
23
- declare const instance: axios.AxiosInstance;
24
-
25
- export { type ApiResponse, type UploadImageResult, instance as default };
@@ -1 +0,0 @@
1
- import{a}from"../chunk-NLABIDJ5.js";import"../chunk-QVSJHU2S.js";import"../chunk-P5I43V7X.js";import"../chunk-WJT6VPDR.js";import"../chunk-O2XFH626.js";export{a as default};
File without changes
File without changes