@printine/designer 0.1.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.
Files changed (199) hide show
  1. package/README.md +146 -0
  2. package/dist/DesignerRuntimeContext.d.ts +3 -0
  3. package/dist/PrintineDesigner.d.ts +9 -0
  4. package/dist/api/client.d.ts +8 -0
  5. package/dist/api/client.js +82 -0
  6. package/dist/api/common-endpoints.d.ts +12 -0
  7. package/dist/api/design-endpoints.d.ts +18 -0
  8. package/dist/api/endpoints.d.ts +33 -0
  9. package/dist/api/endpoints.js +46 -0
  10. package/dist/api/files-endpoints.d.ts +1 -0
  11. package/dist/assets/icons/aspect_ratio.d.ts +3 -0
  12. package/dist/assets/icons/delete.d.ts +3 -0
  13. package/dist/assets/icons/fit_screen.d.ts +3 -0
  14. package/dist/assets/icons/index.d.ts +11 -0
  15. package/dist/assets/icons/loading_1.d.ts +3 -0
  16. package/dist/assets/icons/loading_2.d.ts +3 -0
  17. package/dist/assets/icons/loading_3.d.ts +3 -0
  18. package/dist/assets/icons/pan.d.ts +3 -0
  19. package/dist/assets/icons/setting.d.ts +3 -0
  20. package/dist/assets/icons/text_color.d.ts +3 -0
  21. package/dist/assets/icons/text_h.d.ts +3 -0
  22. package/dist/assets/icons/text_v.d.ts +3 -0
  23. package/dist/bundled-assets.d.ts +4 -0
  24. package/dist/components/add-design.d.ts +8 -0
  25. package/dist/components/assets-dialog.d.ts +21 -0
  26. package/dist/components/canvas-context-menu.d.ts +6 -0
  27. package/dist/components/color-picker/index.d.ts +10 -0
  28. package/dist/components/context.d.ts +24 -0
  29. package/dist/components/design.d.ts +9 -0
  30. package/dist/components/fonts.d.ts +26 -0
  31. package/dist/components/image-crop.d.ts +4 -0
  32. package/dist/components/image-edit.d.ts +1 -0
  33. package/dist/components/layout/aside.d.ts +3 -0
  34. package/dist/components/layout/bottom-nav/element-menu-sheet.d.ts +11 -0
  35. package/dist/components/layout/bottom-nav/element-sheet.d.ts +11 -0
  36. package/dist/components/layout/bottom-nav/index.d.ts +1 -0
  37. package/dist/components/layout/header.d.ts +5 -0
  38. package/dist/components/loading.d.ts +3 -0
  39. package/dist/components/menus/ai.d.ts +5 -0
  40. package/dist/components/menus/background.d.ts +6 -0
  41. package/dist/components/menus/clipart.d.ts +6 -0
  42. package/dist/components/menus/files.d.ts +7 -0
  43. package/dist/components/menus/image.d.ts +8 -0
  44. package/dist/components/menus/index.d.ts +13 -0
  45. package/dist/components/menus/layer.d.ts +5 -0
  46. package/dist/components/menus/product.d.ts +3 -0
  47. package/dist/components/menus/sca.d.ts +5 -0
  48. package/dist/components/menus/shapes.d.ts +6 -0
  49. package/dist/components/menus/templates.d.ts +6 -0
  50. package/dist/components/menus/text-effects.d.ts +5 -0
  51. package/dist/components/menus/text.d.ts +6 -0
  52. package/dist/components/placement-tab.d.ts +7 -0
  53. package/dist/components/preview/3d.d.ts +7 -0
  54. package/dist/components/preview/graphic.d.ts +7 -0
  55. package/dist/components/preview/index.d.ts +18 -0
  56. package/dist/components/preview/open.d.ts +7 -0
  57. package/dist/components/preview/real-time/3d.d.ts +12 -0
  58. package/dist/components/preview/real-time/graphic.d.ts +18 -0
  59. package/dist/components/preview/real-time/index.d.ts +11 -0
  60. package/dist/components/scale-tools.d.ts +7 -0
  61. package/dist/components/semi-deisgn-config.d.ts +13 -0
  62. package/dist/components/semi-design-link.d.ts +9 -0
  63. package/dist/components/store.d.ts +1 -0
  64. package/dist/components/toolbar.d.ts +2 -0
  65. package/dist/config-D2qm60gf.js +16 -0
  66. package/dist/contracts/api-design.d.ts +176 -0
  67. package/dist/contracts/design.d.ts +86 -0
  68. package/dist/design-7zRpRtv9.js +20331 -0
  69. package/dist/engine/canvas-designer.d.ts +101 -0
  70. package/dist/engine/canvas-designer.js +313 -0
  71. package/dist/engine/constants.d.ts +27 -0
  72. package/dist/engine/constants.js +148 -0
  73. package/dist/engine/editor.d.ts +186 -0
  74. package/dist/engine/editor.js +734 -0
  75. package/dist/engine/events.d.ts +34 -0
  76. package/dist/engine/events.js +7 -0
  77. package/dist/engine/extensions/curved-text.d.ts +59 -0
  78. package/dist/engine/fabric.d.ts +4 -0
  79. package/dist/engine/fabric.js +187 -0
  80. package/dist/engine/history.d.ts +27 -0
  81. package/dist/engine/history.js +56 -0
  82. package/dist/engine/managers/event.d.ts +101 -0
  83. package/dist/engine/managers/event.js +410 -0
  84. package/dist/engine/managers/resize.d.ts +24 -0
  85. package/dist/engine/managers/resize.js +63 -0
  86. package/dist/engine/managers/snapline.d.ts +70 -0
  87. package/dist/engine/managers/snapline.js +124 -0
  88. package/dist/engine/managers/workspace.d.ts +26 -0
  89. package/dist/engine/managers/workspace.js +53 -0
  90. package/dist/engine/processors/image.d.ts +88 -0
  91. package/dist/engine/processors/image.js +473 -0
  92. package/dist/engine/processors/template.d.ts +45 -0
  93. package/dist/engine/processors/template.js +314 -0
  94. package/dist/engine/processors/text.d.ts +74 -0
  95. package/dist/engine/processors/text.js +215 -0
  96. package/dist/engine/semi-export-editor.d.ts +199 -0
  97. package/dist/engine/types.d.ts +28 -0
  98. package/dist/engine/utils/common.d.ts +25 -0
  99. package/dist/engine/utils/common.js +68 -0
  100. package/dist/engine/utils/dialog.d.ts +25 -0
  101. package/dist/engine/utils/font.d.ts +5 -0
  102. package/dist/engine/utils/font.js +39 -0
  103. package/dist/engine/utils/image.d.ts +8 -0
  104. package/dist/engine/utils/image.js +50 -0
  105. package/dist/engine/utils/loading.d.ts +17 -0
  106. package/dist/engine/utils/loading.js +71 -0
  107. package/dist/engine/utils/measure.d.ts +6 -0
  108. package/dist/engine/utils/measure.js +6 -0
  109. package/dist/engine/utils/mockup.d.ts +59 -0
  110. package/dist/engine/utils/setting.d.ts +4 -0
  111. package/dist/engine/utils/setting.js +73 -0
  112. package/dist/fabric-types.d.ts +59 -0
  113. package/dist/full-designer.js +14 -0
  114. package/dist/hooks/pagination.d.ts +19 -0
  115. package/dist/hooks/use-adobe-express.d.ts +50 -0
  116. package/dist/hooks/use-before-unload.d.ts +1 -0
  117. package/dist/hooks/use-image-drop.d.ts +18 -0
  118. package/dist/hooks/use-oss-upload.d.ts +34 -0
  119. package/dist/hooks/use-screen.d.ts +1 -0
  120. package/dist/i18n/index.d.ts +12 -0
  121. package/dist/images/design/asset_empty.png +0 -0
  122. package/dist/images/design/design/background.svg +3 -0
  123. package/dist/images/design/design/color-picker.svg +15 -0
  124. package/dist/images/design/design/computer.svg +1 -0
  125. package/dist/images/design/design/copy.svg +1 -0
  126. package/dist/images/design/design/image.svg +10 -0
  127. package/dist/images/design/design/line.svg +1 -0
  128. package/dist/images/design/design/text.svg +1 -0
  129. package/dist/images/design/design/title.svg +1 -0
  130. package/dist/images/design/empty.png +0 -0
  131. package/dist/images/design/layer_empty.png +0 -0
  132. package/dist/images/design/menu/ai.svg +1 -0
  133. package/dist/images/design/menu/back.svg +4 -0
  134. package/dist/images/design/menu/background.svg +6 -0
  135. package/dist/images/design/menu/clipart.svg +6 -0
  136. package/dist/images/design/menu/file.svg +4 -0
  137. package/dist/images/design/menu/fill.svg +1 -0
  138. package/dist/images/design/menu/image.svg +7 -0
  139. package/dist/images/design/menu/layer.svg +6 -0
  140. package/dist/images/design/menu/product.svg +3 -0
  141. package/dist/images/design/menu/sca.svg +5 -0
  142. package/dist/images/design/menu/shapes.svg +5 -0
  143. package/dist/images/design/menu/templates.svg +6 -0
  144. package/dist/images/design/menu/text.svg +6 -0
  145. package/dist/images/design/menu/uploads.svg +7 -0
  146. package/dist/images/design/spinner.svg +3 -0
  147. package/dist/images/design/spinners.svg +17 -0
  148. package/dist/images/design/transparent_pattern.svg +5 -0
  149. package/dist/index.d.ts +39 -0
  150. package/dist/index.js +127 -0
  151. package/dist/lib/analytics.d.ts +17 -0
  152. package/dist/lib/cn.d.ts +3 -0
  153. package/dist/lib/common.d.ts +16 -0
  154. package/dist/lib/config.d.ts +14 -0
  155. package/dist/lib/navigation.d.ts +2 -0
  156. package/dist/renderer/ThreeDPreview.d.ts +14 -0
  157. package/dist/renderer/sticker.js +1731 -0
  158. package/dist/renderer/three-d-preview.js +32 -0
  159. package/dist/state/designer-store.d.ts +43 -0
  160. package/dist/state/designer-store.js +85 -0
  161. package/dist/style.css +1 -0
  162. package/dist/types.d.ts +184 -0
  163. package/dist/ui/accordion.d.ts +7 -0
  164. package/dist/ui/button-group.d.ts +11 -0
  165. package/dist/ui/button.d.ts +10 -0
  166. package/dist/ui/checkbox.d.ts +4 -0
  167. package/dist/ui/command.d.ts +18 -0
  168. package/dist/ui/confirm-dialog.d.ts +15 -0
  169. package/dist/ui/context-menu.d.ts +25 -0
  170. package/dist/ui/dialog.d.ts +15 -0
  171. package/dist/ui/drawer.d.ts +15 -0
  172. package/dist/ui/editable-combobox.d.ts +10 -0
  173. package/dist/ui/hint.d.ts +8 -0
  174. package/dist/ui/image.d.ts +24 -0
  175. package/dist/ui/input-group.d.ts +16 -0
  176. package/dist/ui/input-with-addon.d.ts +17 -0
  177. package/dist/ui/input.d.ts +3 -0
  178. package/dist/ui/label.d.ts +4 -0
  179. package/dist/ui/loading-button.d.ts +15 -0
  180. package/dist/ui/popover.d.ts +9 -0
  181. package/dist/ui/scroll-area.d.ts +5 -0
  182. package/dist/ui/select.d.ts +22 -0
  183. package/dist/ui/separator.d.ts +4 -0
  184. package/dist/ui/shared-loading-button.d.ts +20 -0
  185. package/dist/ui/simple-dialog.d.ts +19 -0
  186. package/dist/ui/simple-popover.d.ts +13 -0
  187. package/dist/ui/simple-select.d.ts +20 -0
  188. package/dist/ui/skeleton.d.ts +2 -0
  189. package/dist/ui/slider.d.ts +4 -0
  190. package/dist/ui/spinner-box.d.ts +12 -0
  191. package/dist/ui/spinner.d.ts +2 -0
  192. package/dist/ui/switch.d.ts +6 -0
  193. package/dist/ui/tab/index.d.ts +15 -0
  194. package/dist/ui/textarea.d.ts +3 -0
  195. package/dist/ui/tooltip.d.ts +7 -0
  196. package/dist/workers/image-resize.worker.d.ts +1 -0
  197. package/dist/workers/mockup.worker.d.ts +5 -0
  198. package/dist/workers/render.worker.d.ts +1 -0
  199. package/package.json +201 -0
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import { Drawer as DrawerPrimitive } from "vaul";
3
+ declare function Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
6
+ declare function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
7
+ declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
8
+ declare function DrawerContent({ className, children, hideHandle, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content> & {
9
+ hideHandle?: boolean;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
12
+ declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
13
+ declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
14
+ declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
15
+ export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
@@ -0,0 +1,10 @@
1
+ interface EditableComboboxProps {
2
+ value: number;
3
+ options: number[];
4
+ onChange: (val: number) => void;
5
+ className?: string;
6
+ inputClassName?: string;
7
+ placeholder?: string;
8
+ }
9
+ export declare function EditableCombobox({ value, options, onChange, className, inputClassName, placeholder, }: EditableComboboxProps): import("react/jsx-runtime").JSX.Element;
10
+ export type { EditableComboboxProps };
@@ -0,0 +1,8 @@
1
+ type HintProps = {
2
+ content: React.ReactNode;
3
+ children: React.ReactNode;
4
+ side?: 'top' | 'right' | 'bottom' | 'left';
5
+ align?: 'start' | 'center' | 'end';
6
+ };
7
+ export default function Hint({ content, children, side, align }: HintProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { ImgHTMLAttributes } from 'react';
2
+ type StaticImport = {
3
+ src: string;
4
+ width?: number;
5
+ height?: number;
6
+ };
7
+ export interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'width' | 'height' | 'loading'> {
8
+ src: string | StaticImport;
9
+ alt: string;
10
+ width?: number | string;
11
+ height?: number | string;
12
+ fill?: boolean;
13
+ priority?: boolean;
14
+ unoptimized?: boolean;
15
+ quality?: number;
16
+ loading?: 'eager' | 'lazy';
17
+ sizes?: string;
18
+ }
19
+ /**
20
+ * Drop-in replacement for `next/image` so the migrated editor UI renders in any
21
+ * React host. Next-only props are accepted and ignored instead of forwarded.
22
+ */
23
+ export declare function Image({ src, alt, width, height, fill, priority, unoptimized: _unoptimized, quality: _quality, loading, style, ...rest }: ImageProps): import("react/jsx-runtime").JSX.Element;
24
+ export default Image;
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import { Button } from "./button";
4
+ declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
5
+ declare const inputGroupAddonVariants: (props?: ({
6
+ align?: "block-end" | "block-start" | "inline-end" | "inline-start" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): import("react/jsx-runtime").JSX.Element;
9
+ declare const inputGroupButtonVariants: (props?: ({
10
+ size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
11
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): import("react/jsx-runtime").JSX.Element;
13
+ declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
14
+ declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): import("react/jsx-runtime").JSX.Element;
15
+ declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): import("react/jsx-runtime").JSX.Element;
16
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { InputGroupInput } from './input-group';
3
+ interface InputWithAddonProps extends Omit<React.ComponentProps<typeof InputGroupInput>, 'prefix'> {
4
+ prefix?: React.ReactNode;
5
+ suffix?: React.ReactNode;
6
+ prefixClassName?: string;
7
+ suffixClassName?: string;
8
+ addonAlign?: 'inline-start' | 'inline-end' | 'block-start' | 'block-end';
9
+ }
10
+ /**
11
+ * 带前缀/后缀的 Input 组件
12
+ * @param prefix - 前缀内容(文本或组件)
13
+ * @param suffix - 后缀内容(文本或组件)
14
+ * @param addonAlign - addon 对齐方式,默认 'inline-end'
15
+ */
16
+ export declare function InputWithAddon({ prefix, suffix, prefixClassName, suffixClassName, addonAlign, className, ...props }: InputWithAddonProps): import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare function Input({ className, type, ...props }: React.ComponentProps<'input'>): import("react/jsx-runtime").JSX.Element;
3
+ export { Input };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import * as LabelPrimitive from "@radix-ui/react-label";
3
+ declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Label };
@@ -0,0 +1,15 @@
1
+ import { buttonVariants } from './button';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ type LoadingButtonProps = {
4
+ asChild?: boolean;
5
+ loading?: boolean;
6
+ className?: string;
7
+ spinnerClassName?: string;
8
+ variant?: VariantProps<typeof buttonVariants>['variant'];
9
+ size?: VariantProps<typeof buttonVariants>['size'];
10
+ children?: React.ReactNode;
11
+ disabled?: boolean;
12
+ onClick?: () => void;
13
+ };
14
+ export default function LoadingButton({ loading, spinnerClassName, children, disabled, ...props }: LoadingButtonProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
3
+ declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function PopoverContent({ className, align, sideOffset, showArrow, children, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content> & {
6
+ showArrow?: boolean;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
9
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3
+ declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react/jsx-runtime").JSX.Element;
5
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import * as SelectPrimitive from '@radix-ui/react-select';
3
+ declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
5
+ declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
6
+ declare function SelectTrigger({ className, size, children, icon, iconClassName, hideIcon, clearable, onClear, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
7
+ size?: 'sm' | 'default';
8
+ icon?: React.RefAttributes<SVGSVGElement>;
9
+ iconClassName?: string;
10
+ hideIcon?: boolean;
11
+ clearable?: boolean;
12
+ onClear?: () => void;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ declare function SelectContent({ className, children, position, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
15
+ declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
16
+ declare function SelectItem({ className, children, checkIconShow, ...props }: React.ComponentProps<typeof SelectPrimitive.Item> & {
17
+ checkIconShow?: boolean;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
20
+ declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
21
+ declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
22
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
3
+ declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Separator };
@@ -0,0 +1,20 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import { buttonVariants } from './button';
3
+ import React from 'react';
4
+ type Method = 'get' | 'post' | 'put' | 'delete' | 'patch';
5
+ type LoadingButtonProps = {
6
+ loading?: boolean;
7
+ className?: string;
8
+ spinnerClassName?: string;
9
+ children?: React.ReactNode;
10
+ disabled?: boolean;
11
+ loadingUrl?: string | string[];
12
+ loadingMethod?: Method | Method[];
13
+ variant?: VariantProps<typeof buttonVariants>['variant'];
14
+ size?: VariantProps<typeof buttonVariants>['size'];
15
+ hideContentWhenLoading?: boolean;
16
+ onClick?: (e: React.MouseEvent) => void;
17
+ style?: React.CSSProperties;
18
+ };
19
+ export default function LoadingButton({ loading, className, spinnerClassName, children, disabled, loadingUrl, loadingMethod, hideContentWhenLoading, style, ...props }: LoadingButtonProps): import("react/jsx-runtime").JSX.Element;
20
+ export {};
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ interface SimpleDialogProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ title: string;
6
+ children: ReactNode;
7
+ onCancel?: () => void;
8
+ onSave?: () => void;
9
+ cancelText?: string;
10
+ saveText?: string;
11
+ isLoading?: boolean;
12
+ className?: string;
13
+ isShowActionButtons?: boolean;
14
+ isShowCloseButton?: boolean;
15
+ modal?: boolean;
16
+ overlay?: boolean;
17
+ }
18
+ export declare function SimpleDialog({ open, onOpenChange, title, children, onCancel, onSave, cancelText, saveText, isLoading, className, isShowActionButtons, isShowCloseButton, modal, overlay, }: SimpleDialogProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1,13 @@
1
+ type SimplePopoverProps = {
2
+ className?: string;
3
+ children: React.ReactNode;
4
+ selectStyle?: boolean;
5
+ align?: 'start' | 'center' | 'end';
6
+ sideOffset?: number;
7
+ alignOffset?: number;
8
+ contentClassName?: string;
9
+ content?: (close: () => void) => React.ReactNode;
10
+ autoFocus?: boolean;
11
+ };
12
+ export default function SimplePopover({ children, content, selectStyle, autoFocus, className, contentClassName, ...props }: SimplePopoverProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ type Option = string | number | Map<string, any>;
3
+ interface SimpleSelectProps {
4
+ value: Option;
5
+ onChange: (val: Option) => void;
6
+ options: Option[];
7
+ className?: string;
8
+ getLabel?: (opt: Option, isValue: boolean) => React.ReactNode;
9
+ renderValue?: (val: Option) => React.ReactNode;
10
+ size?: 'sm' | 'default';
11
+ placeholder?: string;
12
+ allowClear?: boolean;
13
+ clearValue?: Option;
14
+ searchable?: boolean;
15
+ searchPlaceholder?: string;
16
+ disabled?: boolean;
17
+ iconClassName?: string;
18
+ }
19
+ export declare function SimpleSelect({ value, onChange, options, className, getLabel, renderValue, placeholder, size, allowClear, clearValue, searchable, searchPlaceholder, disabled, iconClassName, }: SimpleSelectProps): import("react/jsx-runtime").JSX.Element;
20
+ export type { SimpleSelectProps, Option };
@@ -0,0 +1,2 @@
1
+ declare function Skeleton({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
2
+ export { Skeleton };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import * as SliderPrimitive from '@radix-ui/react-slider';
3
+ declare function Slider({ className, defaultValue, value, min, max, ...props }: React.ComponentProps<typeof SliderPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Slider };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 对 spinner 的二次封装、增加了带透明度的白色 overlay
3
+ */
4
+ interface SpinnerBoxProps {
5
+ opacity?: boolean;
6
+ absolute?: boolean;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ spinnerClassName?: string;
10
+ }
11
+ export default function SpinnerBox({ opacity, absolute, className, spinnerClassName, ...props }: SpinnerBoxProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ declare function Spinner({ className, ...props }: React.ComponentProps<'svg'>): import("react/jsx-runtime").JSX.Element;
2
+ export { Spinner };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import * as SwitchPrimitive from '@radix-ui/react-switch';
3
+ declare function Switch({ className, thumbClassName, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
4
+ thumbClassName?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export { Switch };
@@ -0,0 +1,15 @@
1
+ interface TabProps {
2
+ dataKey: string | number;
3
+ dataLabel: string;
4
+ datas: any[];
5
+ activeClass?: string;
6
+ labelClass?: string;
7
+ showArrows?: boolean;
8
+ activeKey?: string | number;
9
+ className?: string;
10
+ onChange?: (key: string | number) => void;
11
+ renderLabel?: (item: any) => React.ReactNode;
12
+ renderSuffix?: (item: any) => React.ReactNode;
13
+ }
14
+ export default function Tab(props: TabProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): import("react/jsx-runtime").JSX.Element;
3
+ export { Textarea };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3
+ declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
4
+ declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Web Worker for generating mockup images
3
+ * 使用 OffscreenCanvas + 原生 Canvas API,不依赖 Fabric.js
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,201 @@
1
+ {
2
+ "name": "@printine/designer",
3
+ "version": "0.1.0",
4
+ "description": "React online product designer with Fabric canvas and host-owned commerce integrations.",
5
+ "private": false,
6
+ "keywords": [
7
+ "printine",
8
+ "product-designer",
9
+ "online-designer",
10
+ "product-customization",
11
+ "fabricjs",
12
+ "react"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/stellarwhale/printine.git",
17
+ "directory": "packages/designer"
18
+ },
19
+ "homepage": "https://github.com/stellarwhale/printine/tree/main/packages/designer#readme",
20
+ "bugs": {
21
+ "url": "https://github.com/stellarwhale/printine/issues"
22
+ },
23
+ "type": "module",
24
+ "main": "./dist/index.js",
25
+ "module": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js"
31
+ },
32
+ "./api/client": {
33
+ "types": "./dist/api/client.d.ts",
34
+ "import": "./dist/api/client.js"
35
+ },
36
+ "./api/endpoints": {
37
+ "types": "./dist/api/endpoints.d.ts",
38
+ "import": "./dist/api/endpoints.js"
39
+ },
40
+ "./full-designer": {
41
+ "types": "./dist/components/design.d.ts",
42
+ "import": "./dist/full-designer.js"
43
+ },
44
+ "./engine/history": {
45
+ "types": "./dist/engine/history.d.ts",
46
+ "import": "./dist/engine/history.js"
47
+ },
48
+ "./engine/utils/common": {
49
+ "types": "./dist/engine/utils/common.d.ts",
50
+ "import": "./dist/engine/utils/common.js"
51
+ },
52
+ "./engine/utils/image": {
53
+ "types": "./dist/engine/utils/image.d.ts",
54
+ "import": "./dist/engine/utils/image.js"
55
+ },
56
+ "./engine/utils/font": {
57
+ "types": "./dist/engine/utils/font.d.ts",
58
+ "import": "./dist/engine/utils/font.js"
59
+ },
60
+ "./engine/utils/loading": {
61
+ "types": "./dist/engine/utils/loading.d.ts",
62
+ "import": "./dist/engine/utils/loading.js"
63
+ },
64
+ "./engine/utils/setting": {
65
+ "types": "./dist/engine/utils/setting.d.ts",
66
+ "import": "./dist/engine/utils/setting.js"
67
+ },
68
+ "./engine/events": {
69
+ "types": "./dist/engine/events.d.ts",
70
+ "import": "./dist/engine/events.js"
71
+ },
72
+ "./engine/constants": {
73
+ "types": "./dist/engine/constants.d.ts",
74
+ "import": "./dist/engine/constants.js"
75
+ },
76
+ "./engine/managers/snapline": {
77
+ "types": "./dist/engine/managers/snapline.d.ts",
78
+ "import": "./dist/engine/managers/snapline.js"
79
+ },
80
+ "./engine/managers/resize": {
81
+ "types": "./dist/engine/managers/resize.d.ts",
82
+ "import": "./dist/engine/managers/resize.js"
83
+ },
84
+ "./engine/managers/workspace": {
85
+ "types": "./dist/engine/managers/workspace.d.ts",
86
+ "import": "./dist/engine/managers/workspace.js"
87
+ },
88
+ "./engine/fabric": {
89
+ "types": "./dist/engine/fabric.d.ts",
90
+ "import": "./dist/engine/fabric.js"
91
+ },
92
+ "./engine/canvas-designer": {
93
+ "types": "./dist/engine/canvas-designer.d.ts",
94
+ "import": "./dist/engine/canvas-designer.js"
95
+ },
96
+ "./engine/editor": {
97
+ "types": "./dist/engine/editor.d.ts",
98
+ "import": "./dist/engine/editor.js"
99
+ },
100
+ "./engine/managers/event": {
101
+ "types": "./dist/engine/managers/event.d.ts",
102
+ "import": "./dist/engine/managers/event.js"
103
+ },
104
+ "./engine/processors/image": {
105
+ "types": "./dist/engine/processors/image.d.ts",
106
+ "import": "./dist/engine/processors/image.js"
107
+ },
108
+ "./engine/processors/text": {
109
+ "types": "./dist/engine/processors/text.d.ts",
110
+ "import": "./dist/engine/processors/text.js"
111
+ },
112
+ "./engine/processors/template": {
113
+ "types": "./dist/engine/processors/template.d.ts",
114
+ "import": "./dist/engine/processors/template.js"
115
+ },
116
+ "./engine/utils/measure": {
117
+ "types": "./dist/engine/utils/measure.d.ts",
118
+ "import": "./dist/engine/utils/measure.js"
119
+ },
120
+ "./state/designer-store": {
121
+ "types": "./dist/state/designer-store.d.ts",
122
+ "import": "./dist/state/designer-store.js"
123
+ },
124
+ "./renderer/sticker": {
125
+ "types": "./dist/renderer/sticker.d.ts",
126
+ "import": "./dist/renderer/sticker.js"
127
+ },
128
+ "./renderer/three-d-preview": {
129
+ "types": "./dist/renderer/ThreeDPreview.d.ts",
130
+ "import": "./dist/renderer/three-d-preview.js"
131
+ },
132
+ "./styles.css": "./dist/style.css"
133
+ },
134
+ "files": [
135
+ "dist",
136
+ "README.md"
137
+ ],
138
+ "sideEffects": [
139
+ "**/*.css"
140
+ ],
141
+ "publishConfig": {
142
+ "access": "public",
143
+ "registry": "https://registry.npmjs.org/"
144
+ },
145
+ "scripts": {
146
+ "build": "vite build && tsc -p tsconfig.build.json",
147
+ "typecheck": "tsc --noEmit -p tsconfig.json",
148
+ "test:api": "node ./tests/api-client.smoke.mjs",
149
+ "pack:check": "npm pack --dry-run",
150
+ "prepublishOnly": "npm run build && npm run test:api"
151
+ },
152
+ "peerDependencies": {
153
+ "react": ">=18 <20",
154
+ "react-dom": ">=18 <20"
155
+ },
156
+ "dependencies": {
157
+ "@aws-sdk/client-s3": "^3.975.0",
158
+ "@dnd-kit/core": "^6.3.1",
159
+ "@dnd-kit/modifiers": "^9.0.0",
160
+ "@dnd-kit/sortable": "^10.0.0",
161
+ "@dnd-kit/utilities": "^3.2.2",
162
+ "@radix-ui/react-accordion": "^1.2.12",
163
+ "@radix-ui/react-checkbox": "^1.3.3",
164
+ "@radix-ui/react-context-menu": "^2.2.16",
165
+ "@radix-ui/react-dialog": "^1.1.15",
166
+ "@radix-ui/react-label": "^2.1.7",
167
+ "@radix-ui/react-popover": "^1.1.15",
168
+ "@radix-ui/react-scroll-area": "^1.2.10",
169
+ "@radix-ui/react-select": "^2.2.6",
170
+ "@radix-ui/react-separator": "^1.1.7",
171
+ "@radix-ui/react-slider": "^1.3.6",
172
+ "@radix-ui/react-slot": "^1.2.3",
173
+ "@radix-ui/react-switch": "^1.2.6",
174
+ "@radix-ui/react-tooltip": "^1.2.8",
175
+ "babylonjs": "^8.29.0",
176
+ "babylonjs-loaders": "^8.29.0",
177
+ "class-variance-authority": "^0.7.1",
178
+ "clsx": "^2.1.1",
179
+ "cmdk": "^1.1.1",
180
+ "fabric": "^5.3.0",
181
+ "lodash-es": "^4.17.21",
182
+ "lucide-react": "^0.545.0",
183
+ "mitt": "^3.0.1",
184
+ "pixi.js": "^7.4.0",
185
+ "sonner": "^2.0.7",
186
+ "tailwind-merge": "^3.3.1",
187
+ "uuid": "^11.1.0",
188
+ "vaul": "^1.1.2",
189
+ "zustand": "^5.0.8"
190
+ },
191
+ "devDependencies": {
192
+ "@tailwindcss/vite": "^4",
193
+ "@types/hammerjs": "^2.0.46",
194
+ "@types/lodash-es": "^4.17.12",
195
+ "@types/react": "^19",
196
+ "@types/react-dom": "^19",
197
+ "tailwindcss": "^4",
198
+ "typescript": "^5",
199
+ "vite": "^7.1.10"
200
+ }
201
+ }