@ydesign/react-editor 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.css +2 -2
- package/dist/app.d.ts +4 -4
- package/dist/app.js +2 -2
- package/dist/chunk-2PAJLUQH.js +1 -0
- package/dist/chunk-2XCWXNZD.js +1 -0
- package/dist/chunk-4BG4CHIB.js +1 -0
- package/dist/{chunk-VXTF2OL2.js → chunk-4HH3B3W3.js} +2 -1
- package/dist/chunk-4WITBL6X.js +1 -0
- package/dist/chunk-ARZMBVXU.js +1 -0
- package/dist/{chunk-MQZE5LZU.js → chunk-DCGJ6RKU.js} +1 -1
- package/dist/chunk-EN72YNS7.js +151 -0
- package/dist/{chunk-OV74NBJ5.js → chunk-FGCLY24Q.js} +2 -2
- package/dist/chunk-FOMWIGAQ.js +50 -0
- package/dist/chunk-HD2T2D4D.js +1 -0
- package/dist/chunk-HQSM4X2M.js +1 -0
- package/dist/chunk-INRJE7VS.js +1 -0
- package/dist/chunk-IPOZDTK2.js +9 -0
- package/dist/chunk-ISNCNIFJ.js +27 -0
- package/dist/chunk-KCNKLCD5.js +1 -0
- package/dist/chunk-LFWKF4C4.js +3 -0
- package/dist/chunk-N5KI6CPA.js +1 -0
- package/dist/chunk-NQYSJ5MN.js +1 -0
- package/dist/chunk-OA7Z7HNL.js +1 -0
- package/dist/chunk-OBJ5NZSC.js +1 -0
- package/dist/chunk-OFA6JIQB.js +9 -0
- package/dist/chunk-OG4HUTJF.js +16 -0
- package/dist/chunk-ONY3GLGA.js +1 -0
- package/dist/chunk-QX7ZGRSR.js +1 -0
- package/dist/chunk-R452ARGU.js +1 -0
- package/dist/chunk-TNBL7KOG.js +1 -0
- package/dist/chunk-TWH7TO5J.js +1 -0
- package/dist/chunk-TYHXQPZQ.js +1 -0
- package/dist/chunk-WHYEXY5V.js +54 -0
- package/dist/chunk-XXR5YN2B.js +9 -0
- package/dist/chunk-YLXPQ2GI.js +1 -0
- package/dist/chunk-YOQ663QO.js +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +1 -1
- package/dist/model/store.d.ts +9 -6
- package/dist/model/store.js +1 -1
- package/dist/project.d.ts +9 -2
- package/dist/project.js +1 -1
- package/dist/side-panel/background-panel.js +1 -1
- package/dist/side-panel/images-grid.d.ts +3 -1
- package/dist/side-panel/images-grid.js +1 -1
- package/dist/side-panel/index.js +1 -1
- package/dist/side-panel/layers-panel.js +1 -1
- package/dist/side-panel/photos-panel.d.ts +4 -2
- package/dist/side-panel/photos-panel.js +1 -1
- package/dist/side-panel/shapes-panel.d.ts +4 -2
- package/dist/side-panel/shapes-panel.js +1 -1
- package/dist/side-panel/side-panel.js +1 -1
- package/dist/side-panel/size-panel.js +1 -1
- package/dist/side-panel/tab-button.js +1 -1
- package/dist/side-panel/templates-panel.js +1 -1
- package/dist/side-panel/text-panel.js +1 -1
- package/dist/side-panel/upload-panel.d.ts +6 -3
- package/dist/side-panel/upload-panel.js +1 -1
- package/dist/toolbar/default-toolbar.js +1 -1
- package/dist/toolbar/download-button.d.ts +4 -2
- package/dist/toolbar/download-button.js +1 -1
- package/dist/toolbar/duplicate-button.js +1 -1
- package/dist/toolbar/figure-toolbar.js +1 -1
- package/dist/toolbar/filters-picker.js +1 -1
- package/dist/toolbar/flip-button.d.ts +4 -2
- package/dist/toolbar/flip-button.js +1 -1
- package/dist/toolbar/group-button.js +1 -1
- package/dist/toolbar/history-buttons.js +1 -1
- package/dist/toolbar/image-eraser-pen.d.ts +4 -2
- package/dist/toolbar/image-eraser-pen.js +1 -1
- package/dist/toolbar/image-remove-background.d.ts +4 -2
- package/dist/toolbar/image-remove-background.js +1 -1
- package/dist/toolbar/image-toolbar.d.ts +4 -2
- package/dist/toolbar/image-toolbar.js +1 -1
- package/dist/toolbar/lock-button.js +1 -1
- package/dist/toolbar/opacity-picker.js +1 -1
- package/dist/toolbar/position-picker.js +1 -1
- package/dist/toolbar/remove-button.js +1 -1
- package/dist/toolbar/text-ai-write.js +1 -1
- package/dist/toolbar/text-toolbar.js +1 -1
- package/dist/toolbar/toolbar.d.ts +2 -2
- package/dist/toolbar/toolbar.js +1 -1
- package/dist/topbar/create-design.d.ts +27 -0
- package/dist/topbar/create-design.js +1 -0
- package/dist/topbar/file-menu.d.ts +7 -2
- package/dist/topbar/file-menu.js +1 -1
- package/dist/topbar/topbar.js +5 -5
- package/dist/utils/l10n.d.ts +205 -3
- package/dist/utils/l10n.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-3TTTJUTT.js +0 -1
- package/dist/chunk-4FFLRF6N.js +0 -1
- package/dist/chunk-4HEMGHOQ.js +0 -1
- package/dist/chunk-53KFBGJB.js +0 -16
- package/dist/chunk-AGNRQAPA.js +0 -1
- package/dist/chunk-APQPKBER.js +0 -1
- package/dist/chunk-B35ZYWID.js +0 -1
- package/dist/chunk-CMH73CYQ.js +0 -27
- package/dist/chunk-COQ4GO5N.js +0 -1
- package/dist/chunk-CS6Z4TQU.js +0 -1
- package/dist/chunk-DBQHEZPG.js +0 -1
- package/dist/chunk-DJBTBRPS.js +0 -1
- package/dist/chunk-EOBIVNFF.js +0 -1
- package/dist/chunk-FXO52BV7.js +0 -1
- package/dist/chunk-GYDTKPW5.js +0 -1
- package/dist/chunk-H67HTXU4.js +0 -1
- package/dist/chunk-IQ7O55C5.js +0 -42
- package/dist/chunk-KLZXBPXI.js +0 -1
- package/dist/chunk-LCE6Z46D.js +0 -3
- package/dist/chunk-M4S26KQG.js +0 -1
- package/dist/chunk-MNACXCF5.js +0 -1
- package/dist/chunk-PSXS4WMN.js +0 -1
- package/dist/chunk-Q2L6VKFI.js +0 -9
- package/dist/chunk-R6Z6F447.js +0 -1
- package/dist/chunk-WGX437MN.js +0 -9
- package/dist/chunk-XK24AOVW.js +0 -54
- package/dist/chunk-XM3RPIUS.js +0 -9
- package/dist/chunk-XPAHGJGK.js +0 -1
package/dist/app.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer properties;@layer theme,base,components,utilities;@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-blue-400: oklch(70.7% .165 254.624);--color-blue-500: oklch(62.3% .214 259.815);--color-gray-100: oklch(96.7% .003 264.542);--color-gray-200: oklch(92.8% .006 264.531);--color-gray-400: oklch(70.7% .022 261.325);--color-gray-500: oklch(55.1% .027 264.364);--color-gray-600: oklch(44.6% .03 256.802);--color-gray-700: oklch(37.3% .034 259.733);--color-gray-800: oklch(27.8% .033 256.848);--color-white: #fff;--spacing: .25rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-base: 1rem;--text-base--line-height: 1.5 ;--font-weight-medium: 500;--radius-lg: .5rem;--default-font-family: var(--font-sans);--default-mono-font-family: var(--font-mono)}}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:currentcolor;@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.container{width:100%;@media (width >= 40rem){max-width:40rem}@media (width >= 48rem){max-width:48rem}@media (width >= 64rem){max-width:64rem}@media (width >= 80rem){max-width:80rem}@media (width >= 96rem){max-width:96rem}}.mt-2{margin-top:calc(var(--spacing) * 2)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-\[1\.2\%\]{margin-bottom:1.2%}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-0{height:calc(var(--spacing) * 0)}.h-3{height:calc(var(--spacing) * 3)}.h-10{height:calc(var(--spacing) * 10)}.h-full{height:100%}.w-3{width:calc(var(--spacing) * 3)}.w-10{width:calc(var(--spacing) * 10)}.w-40{width:calc(var(--spacing) * 40)}.w-80{width:calc(var(--spacing) * 80)}.w-\[25\%\]{width:25%}.w-\[70px\]{width:70px}.w-full{width:100%}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded-lg{border-radius:var(--radius-lg)}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-r,.border-r-1{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b-1{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-b-gray-200{border-bottom-color:var(--color-gray-200)}.bg-\[\#ecf0f1\]{background-color:#ecf0f1}.bg-blue-500{background-color:var(--color-blue-500)}.fill-white{fill:var(--color-white)}.stroke-gray-200{stroke:var(--color-gray-200)}.p-3{padding:calc(var(--spacing) * 3)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pb-\[25\%\]{padding-bottom:25%}.pl-6{padding-left:calc(var(--spacing) * 6)}.text-center{text-align:center}.text-left{text-align:left}.text-base{font-size:var(--text-base);line-height:var(--tw-leading, var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.font-medium{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-blue-500{color:var(--color-blue-500)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-white{color:var(--color-white)}.italic{font-style:italic}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.shadow{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\:border-blue-400{&:hover{@media (hover: hover){border-color:var(--color-blue-400)}}}.hover\:bg-gray-100{&:hover{@media (hover: hover){background-color:var(--color-gray-100)}}}.hover\:underline{&:hover{@media (hover: hover){text-decoration-line:underline}}}.hover\:shadow-sm{&:hover{@media (hover: hover){--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}}.dark\:border-gray-800{@media (prefers-color-scheme: dark){border-color:var(--color-gray-800)}}.dark\:bg-\[\#92969d\]{@media (prefers-color-scheme: dark){background-color:#92969d}}.dark\:fill-\[\#0b0809\]{@media (prefers-color-scheme: dark){fill:#0b0809}}.dark\:stroke-\[\#0b0809\]{@media (prefers-color-scheme: dark){stroke:#0b0809}}.dark\:text-white{@media (prefers-color-scheme: dark){color:var(--color-white)}}}@property --tw-rotate-x{syntax: "*"; inherits: false;}@property --tw-rotate-y{syntax: "*"; inherits: false;}@property --tw-rotate-z{syntax: "*"; inherits: false;}@property --tw-skew-x{syntax: "*"; inherits: false;}@property --tw-skew-y{syntax: "*"; inherits: false;}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: "*"; inherits: false;}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false;}@property --tw-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false;}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false;}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false;}@property --tw-ring-offset-width{syntax: "<length>"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-blur{syntax: "*"; inherits: false;}@property --tw-brightness{syntax: "*"; inherits: false;}@property --tw-contrast{syntax: "*"; inherits: false;}@property --tw-grayscale{syntax: "*"; inherits: false;}@property --tw-hue-rotate{syntax: "*"; inherits: false;}@property --tw-invert{syntax: "*"; inherits: false;}@property --tw-opacity{syntax: "*"; inherits: false;}@property --tw-saturate{syntax: "*"; inherits: false;}@property --tw-sepia{syntax: "*"; inherits: false;}@property --tw-drop-shadow{syntax: "*"; inherits: false;}@property --tw-drop-shadow-color{syntax: "*"; inherits: false;}@property --tw-drop-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-drop-shadow-size{syntax: "*"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x: initial;--tw-rotate-y: initial;--tw-rotate-z: initial;--tw-skew-x: initial;--tw-skew-y: initial;--tw-border-style: solid;--tw-font-weight: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-blur: initial;--tw-brightness: initial;--tw-contrast: initial;--tw-grayscale: initial;--tw-hue-rotate: initial;--tw-invert: initial;--tw-opacity: initial;--tw-saturate: initial;--tw-sepia: initial;--tw-drop-shadow: initial;--tw-drop-shadow-color: initial;--tw-drop-shadow-alpha: 100%;--tw-drop-shadow-size: initial}}}
|
|
2
|
-
/*! tailwindcss v4.1.
|
|
1
|
+
@layer properties;@layer theme,base,components,utilities;@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-gray-200: oklch(92.8% .006 264.531);--color-gray-500: oklch(55.1% .027 264.364);--color-gray-600: oklch(44.6% .03 256.802);--color-gray-800: oklch(27.8% .033 256.848);--color-white: #fff;--spacing: .25rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-base: 1rem;--text-base--line-height: 1.5 ;--font-weight-semibold: 600;--radius-md: .375rem;--default-font-family: var(--font-sans);--default-mono-font-family: var(--font-mono)}}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:currentcolor;@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.container{width:100%;@media(width>=40rem){max-width:40rem}@media(width>=48rem){max-width:48rem}@media(width>=64rem){max-width:64rem}@media(width>=80rem){max-width:80rem}@media(width>=96rem){max-width:96rem}}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-\[1\.2\%\]{margin-bottom:1.2%}.ml-2{margin-left:calc(var(--spacing) * 2)}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-0{height:calc(var(--spacing) * 0)}.h-3{height:calc(var(--spacing) * 3)}.h-\[40px\]{height:40px}.h-full{height:100%}.w-3{width:calc(var(--spacing) * 3)}.w-80{width:calc(var(--spacing) * 80)}.w-\[25\%\]{width:25%}.w-\[70px\]{width:70px}.w-full{width:100%}.flex-shrink-0,.shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.rounded-md{border-radius:var(--radius-md)}.border,.border-1{border-style:var(--tw-border-style);border-width:1px}.border-r-1{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b-1{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-gray-200{border-color:var(--color-gray-200)}.border-b-gray-200{border-bottom-color:var(--color-gray-200)}.bg-\[\#1677ff4d\]{background-color:#1677ff4d}.bg-\[\#ecf0f1\]{background-color:#ecf0f1}.fill-white{fill:var(--color-white)}.stroke-gray-200{stroke:var(--color-gray-200)}.px-2{padding-inline:calc(var(--spacing) * 2)}.py-1{padding-block:calc(var(--spacing) * 1)}.pb-\[25\%\]{padding-bottom:25%}.text-left{text-align:left}.text-base{font-size:var(--text-base);line-height:var(--tw-leading, var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.font-semibold{--tw-font-weight: var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-\[\#333\]{color:#333}.text-\[\#616366\]{color:#616366}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.italic{font-style:italic}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.shadow{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur: blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.sepia{--tw-sepia: sepia(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\:bg-\[\#1677ff4d\]{&:hover{@media(hover:hover){background-color:#1677ff4d}}}.hover\:bg-\[\#f2f2f2\]{&:hover{@media(hover:hover){background-color:#f2f2f2}}}.dark\:border-gray-800{@media(prefers-color-scheme:dark){border-color:var(--color-gray-800)}}.dark\:bg-\[\#92969d\]{@media(prefers-color-scheme:dark){background-color:#92969d}}.dark\:fill-\[\#0b0809\]{@media(prefers-color-scheme:dark){fill:#0b0809}}.dark\:stroke-\[\#0b0809\]{@media(prefers-color-scheme:dark){stroke:#0b0809}}.dark\:text-white{@media(prefers-color-scheme:dark){color:var(--color-white)}}}@property --tw-rotate-x{syntax: "*"; inherits: false;}@property --tw-rotate-y{syntax: "*"; inherits: false;}@property --tw-rotate-z{syntax: "*"; inherits: false;}@property --tw-skew-x{syntax: "*"; inherits: false;}@property --tw-skew-y{syntax: "*"; inherits: false;}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-font-weight{syntax: "*"; inherits: false;}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false;}@property --tw-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false;}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false;}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false;}@property --tw-ring-offset-width{syntax: "<length>"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-outline-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-blur{syntax: "*"; inherits: false;}@property --tw-brightness{syntax: "*"; inherits: false;}@property --tw-contrast{syntax: "*"; inherits: false;}@property --tw-grayscale{syntax: "*"; inherits: false;}@property --tw-hue-rotate{syntax: "*"; inherits: false;}@property --tw-invert{syntax: "*"; inherits: false;}@property --tw-opacity{syntax: "*"; inherits: false;}@property --tw-saturate{syntax: "*"; inherits: false;}@property --tw-sepia{syntax: "*"; inherits: false;}@property --tw-drop-shadow{syntax: "*"; inherits: false;}@property --tw-drop-shadow-color{syntax: "*"; inherits: false;}@property --tw-drop-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-drop-shadow-size{syntax: "*"; inherits: false;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x: initial;--tw-rotate-y: initial;--tw-rotate-z: initial;--tw-skew-x: initial;--tw-skew-y: initial;--tw-border-style: solid;--tw-font-weight: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-outline-style: solid;--tw-blur: initial;--tw-brightness: initial;--tw-contrast: initial;--tw-grayscale: initial;--tw-hue-rotate: initial;--tw-invert: initial;--tw-opacity: initial;--tw-saturate: initial;--tw-sepia: initial;--tw-drop-shadow: initial;--tw-drop-shadow-color: initial;--tw-drop-shadow-alpha: 100%;--tw-drop-shadow-size: initial}}}
|
|
2
|
+
/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
|
package/dist/app.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
2
|
+
import * as node_modules_styled_components_dist_types from 'node_modules/styled-components/dist/types';
|
|
3
3
|
import * as styled_components from 'styled-components';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
|
|
6
|
-
declare const DesignEditorContainer:
|
|
7
|
-
declare const SidePanelWrap:
|
|
8
|
-
declare const WorkspaceWrap:
|
|
6
|
+
declare const DesignEditorContainer: node_modules_styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
declare const SidePanelWrap: node_modules_styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
|
+
declare const WorkspaceWrap: node_modules_styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
9
9
|
declare const DesignEditorApp: () => react_jsx_runtime.JSX.Element;
|
|
10
10
|
declare const createDesignEditorApp: () => void;
|
|
11
11
|
declare const createDemoApp: () => void;
|
package/dist/app.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-O2XFH626.js";import t from"styled-components";import{jsx as
|
|
1
|
+
import"./chunk-O2XFH626.js";import t from"styled-components";import{jsx as r}from"react/jsx-runtime";var e=t.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -14,4 +14,4 @@ import"./chunk-O2XFH626.js";import t from"styled-components";import{jsx as i}fro
|
|
|
14
14
|
flex: 1;
|
|
15
15
|
flex-direction: column;
|
|
16
16
|
position: relative;
|
|
17
|
-
`,
|
|
17
|
+
`,w=()=>r(e,{children:"1231232"}),i=()=>{console.log("createDesignEditorApp")},h=i;export{w as DesignEditorApp,e as DesignEditorContainer,l as SidePanelWrap,d as WorkspaceWrap,h as createDemoApp,i as createDesignEditorApp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./chunk-ARZMBVXU.js";import{a as r}from"./chunk-75WC3GVB.js";import{LockKeyholeOpen as m,LockKeyhole as k}from"lucide-react";import{Tooltip as d,Button as a}from"antd";import{observer as f}from"mobx-react-lite";import{jsx as t}from"react/jsx-runtime";var x=f(({store:l})=>{let{disabled:i,locked:o,lock:p,unlock:c}=r({store:l}),n=o?k:m,s=e(o?"toolbar.lockedDescription":"toolbar.unlockedDescription");return t(d,{title:s,placement:"bottom",children:t(a,{type:"text",styles:{root:{padding:"0 7px"}},disabled:i,onClick:()=>{o?c():p()},children:t(n,{size:16})})})});export{x as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l}from"./chunk-EN72YNS7.js";import{c as n}from"./chunk-ARZMBVXU.js";import{Dropdown as m,Button as u,Modal as d}from"antd";import{Menu as y,Plus as f,Languages as h,Check as s}from"lucide-react";import{useState as k}from"react";import{observer as b}from"mobx-react-lite";import{Fragment as C,jsx as e,jsxs as S}from"react/jsx-runtime";var{confirm:w}=d,D=b(({store:a,project:t})=>{let[g,r]=k(!1),p=[{label:n("topbar.newDesign"),key:"new_design",icon:e(f,{size:16})},{label:n("topbar.language"),key:"language",icon:e("div",{style:{height:22,display:"flex",alignItems:"center"},children:e(h,{size:16})}),children:[{key:"en",label:"English",onClick:()=>{t.setLanguage("en")},extra:t.language==="en"?e(s,{size:16}):null},{key:"zh",label:"\u4E2D\u6587",onClick:()=>{t.setLanguage("zh")},extra:t.language==="zh"?e(s,{size:16}):null}]}];return S(C,{children:[e(m,{menu:{items:p,onClick:({key:o})=>{o==="new_design"&&r(!0)}},trigger:["click"],styles:{root:{width:188}},children:e(u,{type:"text",children:e(y,{size:16})})}),e(l,{visible:g,onClose:()=>r(!1),onConfirm:o=>{w({title:"\u521B\u5EFA\u8BBE\u8BA1\u540E\uFF0C\u5C06\u65B0\u5EFA\u753B\u5E03\uFF0C\u5F53\u524D\u6D77\u62A5\u5185\u5BB9\u53EF\u5728\u4F5C\u56FE\u8BB0\u5F55\u4E2D\u67E5\u770B\u3002",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk(){console.log("OK"),console.log("size ---> ",o);let c=JSON.stringify({bg:{backgroundColor:o.bgColor}}),i=new URLSearchParams({create:"",createEmptyPoster:"true",createInfo:c,height:String(o.height),unit:o.unit,width:String(o.width)});console.log("params \u7684\u53C2\u6570 ---> ",i.toString()),window.open(`/?${i.toString()}`,"_blank")}})},store:a})]})});export{D as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as N}from"./chunk-OA7Z7HNL.js";import{a as A}from"./chunk-YOQ663QO.js";import{a as I,b as B}from"./chunk-YRJUN267.js";import{a as b,c as j}from"./chunk-RVXI723F.js";import{c as g}from"./chunk-ARZMBVXU.js";import{a as P}from"./chunk-WJT6VPDR.js";import{observer as x}from"mobx-react-lite";import{useEffect as T,useState as m,useCallback as O,useRef as L,useMemo as W}from"react";import{ColorPicker as E,Popover as M,Button as f,Input as V,InputNumber as k,Space as R,Slider as G,Tooltip as u}from"antd";import{cssGradient2FabricGradient as _}from"@ydesign/core";import{ChevronDown as J,TextAlignStart as K,TextAlignCenter as U,TextAlignEnd as D,TextAlignJustify as $,Bold as q,Italic as Q,Underline as X,Strikethrough as Y,ListChevronsUpDown as Z,TextWrap as tt}from"lucide-react";import{FixedSizeList as et}from"react-window";import{jsx as t,jsxs as S}from"react/jsx-runtime";var{Search:nt}=V,ot=({fontFamily:o,handleClick:i,modifiers:n,store:r,isCustom:c})=>{let[s,a]=m(!c);if(console.log("FontItem ---> ",a),T(()=>{s||r.loadFont(o)},[o,s]),o==="_divider")return t("div",{style:{width:"100%",height:1,background:"#e8e8e8"}});let d=o;return t(f,{type:n.active?"primary":"text",block:!0,style:{justifyContent:"start"},onClick:()=>i(o),disabled:n.disabled,styles:{root:{fontFamily:'"'+o+'"'},content:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}},children:d})},it=({onChange:o,defaultValue:i})=>t(nt,{placeholder:i,allowClear:!0,onChange:n=>{o(n.target.value)},style:{width:210}}),lt=({store:o,fonts:i,activeFont:n,activeFontLabel:r,onFontSelect:c})=>{let[s,a]=m(""),d=i.filter(y=>y.toLowerCase().includes(s.toLowerCase()));return t(M,{content:S("div",{children:[t(it,{defaultValue:"\u641C\u7D22\u5B57\u4F53",onChange:y=>a(y??"")}),t("div",{style:{paddingTop:5},children:t(et,{itemCount:d.length,itemSize:28,width:210,height:Math.min(400,28*d.length)+10,children:({index:y,style:l})=>{let e=d[y];return t("div",{style:{...l,display:"flex",alignItems:"center",justifyContent:"center"},children:t(ot,{fontFamily:e,modifiers:{active:n===e},handleClick:()=>c(e),store:o,isCustom:o.fonts.find(p=>p.fontFamily===e)||P.find(p=>p.fontFamily===e)},e)})}})})]}),trigger:"click",children:t(f,{type:"text",style:{marginRight:5,fontFamily:'"'+n+'"',overflow:"hidden",whiteSpace:"nowrap",maxHeight:30,padding:"0 10px"},icon:t(J,{size:16,style:{display:"flex"}}),iconPlacement:"end",children:r})})},F=["left","center","right","justify"],rt=x(({elements:o,store:i})=>{let n=i.fonts.concat(P).map(a=>a.fontFamily),r=o[0].fontFamily;r.length>15&&(r=r.slice(0,15)+"...");let c=j(i.objects),s=[...new Set(c.concat("_divider").concat(n))];return t(lt,{fonts:s,activeFont:o[0].fontFamily,activeFontLabel:r,store:i,onFontSelect:a=>{i.editor?.objectsHandler.setTextStyle({fontFamily:a})}})}),h=o=>o?typeof o=="string"?o:o.colorStops?JSON.stringify(o.colorStops):JSON.stringify(o):"",st=x(({elements:o,store:i})=>{let n=o[0],r=O(()=>{let{selectionStart:l,selectionEnd:e}=n;if(l!==e&&l!==void 0){let p=n.getSelectionStyles(l,l+1);if(p.length>0&&p[0].fill!==void 0)return p[0].fill}return n.fill},[n]),[c,s]=m(()=>b(r())),a=L(!1),d=L(h(r()));T(()=>{let l=i.editor?.customCanvas?.canvas;if(!l)return;let e=()=>{if(!a.current){let p=r();d.current=h(p),s(b(p))}};return l.on("text:selection:changed",e),l.on("text:editing:entered",e),l.on("text:editing:exited",e),()=>{l.off("text:selection:changed",e),l.off("text:editing:entered",e),l.off("text:editing:exited",e)}},[i.editor?.customCanvas?.canvas,r]),T(()=>{if(!a.current){let l=r(),e=h(l);e!==d.current&&(d.current=e,s(b(l)))}},[n,r]);let y=W(()=>c,[h(c)]);return t(E,{value:y,allowClear:!0,mode:["single","gradient"],onOpenChange:l=>{if(a.current=l,!l){let e=r();d.current=h(e)}},onChange:l=>{s(l)},onChangeComplete:l=>{let e=l.toCssString();if(e.includes("gradient")){let p=_(e);i.editor?.objectsHandler.setTextStyle({fill:p})}else i.editor?.objectsHandler.setTextStyle({fill:e})}})}),at=x(({elements:o,store:i})=>{let[n,r]=m(o[0].fontSize);T(()=>{r(o[0].fontSize)},[o[0]?.fontSize,i._updateFontSize]);let c=s=>{Number.isNaN(s)||(i.editor?.objectsHandler.setTextStyle({fontSize:Number(s)}),r(Number(s)))};return t(k,{min:5,max:4*i.height,value:Math.round(n),onChange:c,style:{width:70}})}),ct=x(({elements:o,store:i})=>{let n=o[0],[r,c]=m(n.textAlign),[s,a]=m(n.fontWeight),[d,y]=m(n.fontStyle),[l,e]=m(n.underline),[p,w]=m(n.linethrough),[v,z]=m(n.splitByGrapheme);return T(()=>{c(n.textAlign),a(n.fontWeight),y(n.fontStyle),e(n.underline),w(n.linethrough),z(n.splitByGrapheme)},[n]),S(R.Compact,{children:[t(u,{placement:"bottom",title:g(`toolbar.text${r}`),children:t(f,{type:"text",icon:r==="left"?t(K,{size:16,style:{display:"flex"}}):r==="center"?t(U,{size:16,style:{display:"flex"}}):r==="right"?t(D,{size:16,style:{display:"flex"}}):t($,{size:16,style:{display:"flex"}}),onClick:()=>{let C=(F.indexOf(r)+1+F.length)%F.length,H=F[C];i.editor?.objectsHandler.setTextStyle({textAlign:H}),c(H)}})}),t(u,{placement:"bottom",title:g("toolbar.textBold"),children:t(f,{type:s==="bold"||s==="700"?"primary":"text",icon:t(q,{size:16,style:{display:"flex"}}),onClick:()=>{s==="bold"||s==="700"?(i.editor?.objectsHandler.setTextStyle({fontWeight:"normal"}),a("normal")):(i.editor?.objectsHandler.setTextStyle({fontWeight:"bold"}),a("bold"))}})}),t(u,{placement:"bottom",title:g("toolbar.textItalic"),children:t(f,{type:d==="italic"?"primary":"text",icon:t(Q,{size:16,style:{display:"flex"}}),onClick:()=>{d==="italic"?(i.editor?.objectsHandler.setTextStyle({fontStyle:"normal"}),y("normal")):(i.editor?.objectsHandler.setTextStyle({fontStyle:"italic"}),y("italic"))}})}),t(u,{placement:"bottom",title:g("toolbar.textUnderline"),children:t(f,{type:l?"primary":"text",icon:t(X,{size:16,style:{display:"flex"}}),onClick:()=>{i.editor?.objectsHandler.setTextStyle({underline:!l}),e(!l)}})}),t(u,{placement:"bottom",title:g("toolbar.textStrikethrough"),children:t(f,{type:p?"primary":"text",icon:t(Y,{size:16,style:{display:"flex"}}),onClick:()=>{i.editor?.objectsHandler.setTextStyle({linethrough:!p}),w(!p)}})}),t(u,{placement:"bottom",title:g("toolbar.splitByGrapheme"),children:t(f,{type:v?"primary":"text",icon:t(tt,{size:16,style:{display:"flex"}}),onClick:()=>{i.editor?.objectsHandler.setTextStyle({splitByGrapheme:!v}),z(!v)}})})]})}),dt=x(({elements:o,store:i})=>{let n=o[0],r={display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},c=typeof n.lineHeight=="number"?100*n.lineHeight:120,[s,a]=m(c),[d,y]=m(n.charSpacing),l=e=>{i.editor?.objectsHandler.setTextStyle(e)};return t(M,{trigger:"click",content:S("div",{style:{padding:"0 6px",width:"230px"},children:[S("div",{style:r,children:[t("div",{children:g("toolbar.lineHeight")}),t("div",{children:t(k,{min:50,max:250,value:Math.round(s),style:{width:80},onChange:e=>{l({lineHeight:e/100}),a(e)}})})]}),t(G,{value:Math.round(s),min:50,max:250,step:1,onChange:e=>{l({lineHeight:e/100}),a(e)}}),S("div",{style:r,children:[t("div",{children:g("toolbar.letterSpacing")}),t("div",{children:t(k,{min:-50,max:250,value:Math.round(d/10),style:{width:80},onChange:e=>{l({charSpacing:(e??0)*10}),y((e??0)*10)}})})]}),t(G,{value:Math.round(d/10),min:-50,max:250,step:1,onChange:e=>{l({charSpacing:(e??0)*10}),y((e??0)*10)}})]}),children:t(f,{type:"text",icon:t(Z,{size:16,style:{display:"flex"}})})})}),pt={TextFill:st,TextFontFamily:rt,TextFontSize:at,TextFontVariant:ct,TextSpacing:dt,TextFilters:A,TextAiWrite:N},yt=x(({store:o,components:i})=>{let n=o.selectedElements,c=I({type:"text",usedItems:["TextFill","TextFontFamily","TextFontSize","TextFontVariant","TextSpacing","TextFilters","TextAiWrite"],components:i});return t(B,{items:c,itemRender:s=>{let a=i[s]||pt[s];return a&&t(a,{elements:n,element:n[0],store:o},s)}})}),kt=yt;export{F as a,yt as b,kt as c};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import r from"styled-components";import{jsx as e,jsxs as p}from"react/jsx-runtime";var d=r.div`
|
|
2
2
|
width: 100%;
|
|
3
|
+
min-width: 78px;
|
|
3
4
|
height: 72px;
|
|
4
5
|
padding-top: 15px;
|
|
5
6
|
padding-left: 5px;
|
|
@@ -19,4 +20,4 @@ import r from"styled-components";import{jsx as e,jsxs as p}from"react/jsx-runtim
|
|
|
19
20
|
&.active {
|
|
20
21
|
background-color: rgba(22, 119, 255, 0.3);
|
|
21
22
|
}
|
|
22
|
-
`,l=({children:i,name:n,iconSize:
|
|
23
|
+
`,l=({children:i,name:n,iconSize:t,onClick:a,active:o})=>p(d,{className:`design-side-panel-tab ${o?"active":""}`,onClick:a,children:[e("div",{style:{fontSize:t||14},children:i}),e("div",{style:{paddingTop:3,userSelect:"none"},children:n})]});export{l as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./chunk-ARZMBVXU.js";import{Button as m,Modal as s}from"antd";import{useState as n,useEffect as d}from"react";import{observer as c}from"mobx-react-lite";import{Fragment as p,jsx as r,jsxs as u}from"react/jsx-runtime";var g=c(({isOpen:a,onClose:t,element:o})=>{let[l,i]=n(o.getSrc());return d(()=>{i(o.getSrc())},[o.id]),r(s,{title:e("toolbar.removeBackgroundTitle"),open:a,onOk:t,onCancel:t,width:{xs:"90%",sm:"80%",md:"70%",lg:"60%",xl:"50%",xxl:"40%"},styles:{body:{padding:"35px 0"}},okText:e("toolbar.confirmRemoveBackground"),cancelText:e("toolbar.cancelRemoveBackground"),children:r("img",{src:l,style:{width:"100%",maxHeight:"400px",objectFit:"contain"}})})}),v=c(({element:a})=>{let[t,o]=n(!1);return u(p,{children:[r(m,{type:"text",styles:{root:{padding:"0 7px"}},onClick:()=>o(!0),children:e("toolbar.removeBackground")}),r(g,{isOpen:t,onClose:()=>o(!1),element:a})]})});export{v as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{observable as u,action as p,toJS as m}from"mobx";var r=u({toolbar:{undo:"Undo",redo:"Redo",duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",backgroundColor:"Background color",brightness:"Brightness",filters:"Filters",sepia:"Sepia",grayscale:"Grayscale",contrast:"Contrast",saturation:"Saturation",vibrance:"Vibrance",hueRotation:"Hue Rotation",noise:"Noise",pixelate:"Pixelate",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",textleft:"Text align left",textcenter:"Text align center",textright:"Text align right",textjustify:"Text align justify",textBold:"Bold",textItalic:"Italic",textUnderline:"Underline",textStrikethrough:"Strikethrough",splitByGrapheme:"Split by grapheme",position:"Position",layering:"Layering",toForward:"To Front",up:"Forward",down:"Backward",toBottom:"To back",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",eraserPen:"Eraser pen",eraserPenTitle:"Remove with an eraser tool",cancelEraserPen:"Cancel",confirmEraserPen:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",clip:"Apply mask",removeClip:"Remove mask",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked.",unlockedDescription:"Object is unlocked.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",rotate:"Rotate",none:"None",bounce:"Bounce",blink:"Blink",strength:"Strength",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width",strokeSettings:"Stroke Settings",colorPicker:{solid:"Solid",linear:"Linear",angle:"Angle"},aiText:{aiWrite:"AI write",rewrite:"Rewrite",shorten:"Shorten",continue:"Continue writing",proofread:"Proofread",tones:"Tones",friendly:"Friendly",professional:"Professional",humorous:"Humorous",formal:"Formal",customPrompt:"Custom prompt",generatedResult:"Generated result",cancel:"Cancel",generate:"Generate",back:"Back",tryAgain:"Try Again",insert:"Insert",promptPlaceholder:"Describe what you want to generate"},addImage:"Add image",addText:"Add text",fileType:"File type",quality:"Quality",multiplier:"Multiplier",size:"Size"},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",videos:"Videos",animations:"Animations",effects:"Effects",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Add file",uploadTip:"Upload your assets",background:"Background",resize:"Resize",layers:"Layers",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",clipImage:"Mask image",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text",units:"Units"},topbar:{newDesign:"Create new design",language:"Language",editableTextPlaceholder:"Design name"}});function i(e){return e&&typeof e=="object"}function d(e,n){Object.keys(n).forEach(o=>{let t=e[o],a=n[o];i(a)&&i(t)?d(t,a):a!==void 0&&(e[o]=a)})}function g(e,n,o=""){Object.keys(n).forEach(t=>{let a=n[t],s=o?`${o}.${t}`:t;if(i(a)){let l=e[t];i(l)?g(l,a,s):console.warn(`Missing nested translation object at '${s}'`)}else e[t]===void 0&&console.warn(`Missing translation '${s}'`)})}var b=p((e,{validate:n=!1}={})=>{n&&g(e,r),d(r,e)}),y=()=>m(r),c={};function f(e,n){let o=n.split("."),t=e;for(let a of o){if(t==null||typeof t!="object")return;t=t[a]}return t}var k=e=>{let n=f(r,e);if(n!==void 0)return n;c[e]||(c[e]=!0,console.warn(`Missing translation '${e}'`));let o=e.split("."),t=o[o.length-1]||" ";return t.charAt(0).toUpperCase()+t.slice(1)};export{b as a,y as b,k as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t,c as e,d as a,e as i,f as o,g as h,h as p,i as x,j as n}from"./chunk-7NNOHYKX.js";var r=(L=>(L.ROUND_RECT="roundRect",L.ROUND_RECT_DIAGONAL="roundRectDiagonal",L.ROUND_RECT_SINGLE="roundRectSingle",L.ROUND_RECT_SAMESIDE="roundRectSameSide",L.CUT_RECT_DIAGONAL="cutRectDiagonal",L.CUT_RECT_SINGLE="cutRectSingle",L.CUT_RECT_SAMESIDE="cutRectSameSide",L.MESSAGE="message",L.ROUND_MESSAGE="roundMessage",L.L="L",L.RING_RECT="ringRect",L.PLUS="plus",L.TRIANGLE="triangle",L.PARALLELOGRAM_LEFT="parallelogramLeft",L.PARALLELOGRAM_RIGHT="parallelogramRight",L.TRAPEZOID="trapezoid",L.BULLET="bullet",L.INDICATOR="indicator",L))(r||{}),
|
|
1
|
+
import{b as t,c as e,d as a,e as i,f as o,g as h,h as p,i as x,j as n}from"./chunk-7NNOHYKX.js";var r=(L=>(L.ROUND_RECT="roundRect",L.ROUND_RECT_DIAGONAL="roundRectDiagonal",L.ROUND_RECT_SINGLE="roundRectSingle",L.ROUND_RECT_SAMESIDE="roundRectSameSide",L.CUT_RECT_DIAGONAL="cutRectDiagonal",L.CUT_RECT_SINGLE="cutRectSingle",L.CUT_RECT_SAMESIDE="cutRectSameSide",L.MESSAGE="message",L.ROUND_MESSAGE="roundMessage",L.L="L",L.RING_RECT="ringRect",L.PLUS="plus",L.TRIANGLE="triangle",L.PARALLELOGRAM_LEFT="parallelogramLeft",L.PARALLELOGRAM_RIGHT="parallelogramRight",L.TRAPEZOID="trapezoid",L.BULLET="bullet",L.INDICATOR="indicator",L))(r||{}),B=[{name:"\u57FA\u7840",children:[{viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",type:"rect"},{viewBox:[200,200],path:t({width:200,height:200}),type:"circle"},{viewBox:[200,200],path:"M 0,100 A 100,50 0 1 1 200,100 A 100,50 0 1 1 0,100 Z",type:"ellipse"},{viewBox:[200,200],path:"M 100,50 L 200,150 L 0,150 Z",type:"triangle"}]},{name:"\u77E9\u5F62",children:[{viewBox:[200,200],path:"M 50 0 L 150 0 Q 200 0 200 50 L 200 150 Q 200 200 150 200 L 50 200 Q 0 200 0 150 L 0 50 Q 0 0 50 0 Z"},{viewBox:[200,200],path:"M 0 150 L 0 0 L 150 0 L 200 50 L 200 200 L 50 200 Z"},{viewBox:[200,200],path:"M 0 200 L 0 0 L 150 0 L 200 50 L 200 200 Z"},{viewBox:[200,200],path:"M 0 50 L 50 0 L 150 0 L 200 50 L 200 200 L 0 200 Z"},{viewBox:[200,200],path:"M 0 0 L 150 0 Q 200 0 200 50 L 200 200 L 50 200 Q 0 200 0 150 L 0 0 Z"},{viewBox:[200,200],path:"M 0 0 L 150 0 Q 200 0 200 50 L 200 200 L 0 200 L 0 0 Z"},{viewBox:[200,200],path:"M 0 50 Q 0 0 50 0 L 150 0 Q 200 0 200 50 L 200 200 L 0 200 Z"}]},{name:"\u5E38\u89C4\u5F62\u72B6",children:[{viewBox:[200,200],path:e({width:200,height:200})},{viewBox:[200,200],path:a({width:200,height:200})},{viewBox:[200,200],path:i({width:200,height:200})},{viewBox:[200,200],path:o({width:200,height:200})},{viewBox:[200,200],path:h({width:200,height:200})},{viewBox:[200,200],path:p({width:200,height:200})},{viewBox:[200,200],path:x({width:200,height:200})},{viewBox:[200,200],path:n({width:200,height:200})}]},{name:"\u5E38\u7528\u5F62\u72B6",children:[{viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 200 L 200 200 L 100 0 Z",pathFormula:"triangle"},{viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 Z"},{viewBox:[200,200],path:"M 50 0 L 200 0 L 150 200 L 0 200 L 50 0 Z",pathFormula:"parallelogramLeft"},{viewBox:[200,200],path:"M 0 0 L 150 0 L 200 200 L 50 200 L 0 0 Z",pathFormula:"parallelogramRight"},{viewBox:[200,200],path:"M 50 0 L 150 0 L 200 200 L 0 200 L 50 0 Z",pathFormula:"trapezoid"},{viewBox:[200,200],path:"M 100 0 L 0 100 L 100 200 L 200 100 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 50 L 0 200 L 200 200 L 200 50 L 100 0 Z",pathFormula:"bullet"},{viewBox:[200,200],path:"M 200 100 L 150 0 L 0 0 L 50 100 L 0 200 L 150 200 L 200 100 Z",pathFormula:"indicator"},{viewBox:[200,200],path:"M 0 200 A 50 100 0 1 1 200 200 L 0 200 Z"},{viewBox:[200,200],path:"M 40 20 A 100 100 0 1 0 200 100 L 100 100 L 40 20 Z"},{viewBox:[200,200],path:"M 100 0 A 100 100 102 1 0 200 100 L 100 100 L 100 0 Z"},{viewBox:[200,200],path:"M 160 20 A 100 100 0 1 0 200 100 L 100 100 L 160 20 Z"},{viewBox:[200,200],path:"M 100 0 A 100 100 102 1 0 200 100 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 A 100 100 102 1 0 200 100 L 200 0 L 100 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 0 Q 200 200 0 200 L 0 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 90 L 50 200 L 150 200 L 200 90 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 60 L 0 140 L 100 200 L 200 140 L 200 60 L 100 0 Z"},{viewBox:[200,200],path:"M 60 0 L 140 0 L 200 60 L 200 140 L 140 200 L 60 200 L 0 140 L 0 60 L 60 0 Z"},{viewBox:[200,200],path:"M 75 0 L 125 0 L 175 25 L 200 75 L 200 125 L 175 175 L 125 200 L 75 200 L 25 175 L 0 125 L 0 75 L 25 25 L 75 0 Z"},{viewBox:[200,200],path:"M 150 0 A 50 100 0 1 1 150 200 L 0 200 L 0 0 L 150 0 Z"},{viewBox:[200,200],path:"M 50 0 A 25 50 0 1 0 50 200 L 150 200 A 25 50 0 1 0 150 0 L 50 0 Z"},{viewBox:[200,200],path:"M 150 0 A 50 100 0 1 1 150 200 L 0 200 A 50 100 0 0 0 0 0 L 150 0 Z"},{viewBox:[200,200],path:"M 200 0 L 200 200 L 0 200 L 0 100 L 200 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 100 L 200 200 L 0 200 L 0 0 Z"},{viewBox:[200,200],path:"M 200 0 L 100 0 L 0 100 L 0 200 L 200 0 Z"},{viewBox:[200,200],path:"M 50 0 L 150 0 L 150 50 L 200 50 L 200 150 L 150 150 L 150 200 L 50 200 L 50 150 L 0 150 L 0 50 L 50 50 L 50 0 Z"},{viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 L 200 140 L 60 140 L 60 0 L 0 0 Z",pathFormula:"L"},{viewBox:[200,200],path:"M0 0 L200 0 L200 200 L0 200 L0 0 Z M50 50 L50 150 L150 150 L150 50 Z",pathFormula:"ringRect"},{viewBox:[200,200],path:"M0 100 A100 100 0 1 1 0 101 Z M150 100 A50 50 0 1 0 150 101 Z"},{viewBox:[200,200],path:"M 70 0 L 70 70 L 0 70 L 0 130 L 70 130 L 70 200 L 130 200 L 130 130 L 200 130 L 200 70 L 130 70 L 130 0 L 70 0 Z",pathFormula:"plus"},{viewBox:[200,200],path:"M 40 0 L 0 40 L 60 100 L 0 160 L 40 200 L 100 140 L 160 200 L 200 160 L 140 100 L 200 40 L 160 0 L 100 60 L 40 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 0 L 200 160 L 100 160 L 60 200 L 60 160 L 0 160 Z",pathFormula:"message"},{viewBox:[200,200],path:"M 0 40 Q 0 0 40 0 L 160 0 Q 200 0 200 40 L 200 120 Q 200 160 160 160 L 100 160 L 60 200 L 60 160 L 40 160 Q 0 160 0 120 L 0 40 Z",pathFormula:"roundMessage"},{viewBox:[200,200],path:"M 180 160 A 100 100 0 1 0 100 200 L 200 200 L 200 160 L 180 160 Z"},{viewBox:[200,200],path:"M 200 0 L 0 0 L 200 200 L 0 200 L 200 0 Z"},{viewBox:[200,200],path:"M 0 20 C 60 60 140 -40 200 20 L 200 180 C 140 140 60 240 0 180 L 0 20 Z"},{viewBox:[200,200],path:"M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z"},{viewBox:[200,200],path:"M 100 0 Q 0 50 0 175 Q 100 225 200 175 Q 200 50 100 0 Z"},{viewBox:[200,200],path:"M 0 100 A 50 50 0 1 1 200 100 L 100 200 L 0 100 Z"},{viewBox:[200,200],path:"M 100 0 L 60 60 L 0 100 L 60 140 L 100 200 L 140 140 L 200 100 L 140 60 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 80 40 L 20 20 L 40 80 L 0 100 L 40 120 L 20 180 L 80 160 L 100 200 L 120 160 L 180 180 L 160 120 L 200 100 L 160 80 L 180 20 L 120 40 L 100 0 Z"}]}],v=[{path:"M 0 0 L 20 20",style:"solid",points:["",""],data:[{x:0,y:0},{x:200,y:0}]}],s=[{name:"\u76F4\u7EBF",children:[{path:"M 0 0 L 20 20",style:"solid",points:["",""],data:[{x:0,y:0},{x:200,y:0}]},{path:"M 0 0 L 20 20",style:"dashed",points:["",""],data:[{x:0,y:0},{x:200,y:0}]},{path:"M 0 0 L 20 20",style:"solid",points:["","arrow"],data:[{x:0,y:0},{x:200,y:0}]},{path:"M 0 0 L 20 20",style:"dashed",points:["","arrow"],data:[{x:0,y:0},{x:200,y:0}]},{path:"M 0 0 L 20 20",style:"solid",points:["","dot"],data:[{x:0,y:0},{x:200,y:0}]}]},{name:"\u6298\u7EBF\u3001\u66F2\u7EBF",children:[{path:"M 0 0 L 0 20 L 20 20",style:"solid",points:["","arrow"],isBroken:!0,data:[{x:0,y:0},{x:0,y:100},{x:200,y:100}]},{path:"M 0 0 Q 0 20 20 20",style:"solid",points:["","arrow"],isCurve:!0,data:[{x:0,y:0},{x:200,y:0}]},{path:"M 0 0 C 20 0 0 20 20 20",style:"solid",points:["","arrow"],isCubic:!0,data:[{x:0,y:0},{x:200,y:0}]}]}];export{r as a,B as b,v as c,s as d};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import{b as I,c as p}from"./chunk-5C2MNUBC.js";import{a as y}from"./chunk-MXZ6RXT3.js";import{Modal as Q,Button as Y,ColorPicker as ee,InputNumber as L,Select as ie,Tooltip as te}from"antd";import{Grid2X2 as ne,Star as oe,ShoppingBag as se,FileText as ae,Presentation as ce,Share2 as de,Printer as le,ImagePlus as re,FolderPlus as t,LockKeyholeOpen as pe,LockKeyhole as he}from"lucide-react";import{useRef as me,useState as l,useMemo as W,useCallback as h}from"react";import z from"styled-components";import{jsx as e,jsxs as a}from"react/jsx-runtime";var xe=[{key:"all",label:"\u5168\u90E8",icon:ne},{key:"common",label:"\u5E38\u7528\u5C3A\u5BF8",icon:oe},{key:"ecommerce",label:"\u7535\u5546\u7269\u6599",icon:se},{key:"office",label:"\u884C\u653F\u529E\u516C",icon:ae},{key:"presentation",label:"\u6F14\u793A\u6587\u7A3F",icon:ce},{key:"social",label:"\u793E\u4EA4\u5A92\u4F53",icon:de},{key:"print",label:"\u5370\u5237\u7269\u6599",icon:le}],R=[{key:"common",label:"\u5E38\u7528\u5C3A\u5BF8",sizes:[{icon:e(t,{size:24}),name:"\u7535\u5546\u4E3B\u56FE\uFF081:1\uFF09",desc:"1440x1440px",width:1440,height:1440,unit:"px"},{icon:e(t,{size:24}),name:"\u7535\u5546\u4E3B\u56FE\uFF081:1\uFF09",desc:"800x800px",width:800,height:800,unit:"px"},{icon:e(t,{size:24}),name:"\u624B\u673A\u6D77\u62A5",desc:"1242x2208px",width:1242,height:2208,unit:"px"},{icon:e(t,{size:24}),name:"\u5C0F\u7EA2\u4E66\u5C01\u9762",desc:"1242x1656px",width:1242,height:1656,unit:"px"},{icon:e(t,{size:24}),name:"\u7AD6\u7248\u89C6\u9891\u5C01\u9762",desc:"1080x1920px",width:1080,height:1920,unit:"px"},{icon:e(t,{size:24}),name:"PPT\uFF0816:9\uFF09",desc:"1920x1080px",width:1920,height:1080,unit:"px"}]},{key:"ecommerce",label:"\u7535\u5546\u7269\u6599",sizes:[{icon:e(t,{size:24}),name:"\u7535\u5546\u4E3B\u56FE\uFF081:1\uFF09",desc:"1440x1440px",width:1440,height:1440,unit:"px"},{icon:e(t,{size:24}),name:"\u7535\u5546\u4E3B\u56FE\uFF081:1\uFF09",desc:"800x800px",width:800,height:800,unit:"px"},{icon:e(t,{size:24}),name:"\u7535\u5546\u4E3B\u56FE\uFF083:4\uFF09",desc:"1440x1920px",width:1440,height:1920,unit:"px"},{icon:e(t,{size:24}),name:"\u7535\u5546\u4E3B\u56FE\uFF083:4\uFF09",desc:"750x1000px",width:750,height:1e3,unit:"px"},{icon:e(t,{size:24}),name:"\u76F4\u64AD\u95F4\u80CC\u666F",desc:"1242x2690px",width:1242,height:2690,unit:"px"},{icon:e(t,{size:24}),name:"\u7535\u5546\u8BE6\u60C5\u9875",desc:"750x1000px",width:750,height:1e3,unit:"px"},{icon:e(t,{size:24}),name:"\u7535\u5546\u7AD6\u7248\u6D77\u62A5",desc:"1200x1920px",width:1200,height:1920,unit:"px"}]},{key:"office",label:"\u884C\u653F\u529E\u516C",sizes:[{icon:e(t,{size:24}),name:"\u7B80\u5386",desc:"2480x3507px",width:2480,height:3507,unit:"px"},{icon:e(t,{size:24}),name:"\u5DE5\u724C\u5DE5\u4F5C\u8BC1",desc:"709x1087px",width:709,height:1087,unit:"px"},{icon:e(t,{size:24}),name:"\u5956\u72B6\u8BC1\u4E66",desc:"3437x2550px",width:3437,height:2550,unit:"px"}]},{key:"presentation",label:"\u6F14\u793A\u6587\u7A3F",sizes:[{icon:e(t,{size:24}),name:"PPT\uFF0816:9\uFF09",desc:"1920x1080px",width:1920,height:1080,unit:"px"},{icon:e(t,{size:24}),name:"PPT\uFF084:3\uFF09",desc:"1024x768px",width:1024,height:768,unit:"px"}]},{key:"social",label:"\u793E\u4EA4\u5A92\u4F53",sizes:[{icon:e(t,{size:24}),name:"\u624B\u673A\u6D77\u62A5",desc:"1242x2208px",width:1242,height:2208,unit:"px"},{icon:e(t,{size:24}),name:"\u624B\u673A\u5168\u5C4F\u6D77\u62A5",desc:"1242x2688px",width:1242,height:2688,unit:"px"},{icon:e(t,{size:24}),name:"\u7AD6\u7248\u89C6\u9891\u5C01\u9762",desc:"1080x1920px",width:1080,height:1920,unit:"px"},{icon:e(t,{size:24}),name:"\u6A2A\u7248\u89C6\u9891\u5C01\u9762",desc:"1920x1080px",width:1920,height:1080,unit:"px"},{icon:e(t,{size:24}),name:"\u5C0F\u7EA2\u4E66\u5C01\u9762",desc:"1242x1656px",width:1242,height:1656,unit:"px"},{icon:e(t,{size:24}),name:"\u6296\u97F3\u56FE\u6587\u5E26\u8D27",desc:"1242x1656px",width:1242,height:1656,unit:"px"},{icon:e(t,{size:24}),name:"\u516C\u4F17\u53F7\u9996\u56FE",desc:"900x383px",width:900,height:383,unit:"px"},{icon:e(t,{size:24}),name:"\u516C\u4F17\u53F7\u6B21\u56FE",desc:"900x800px",width:900,height:800,unit:"px"},{icon:e(t,{size:24}),name:"\u957F\u56FE\u6D77\u62A5",desc:"800x2000px",width:800,height:2e3,unit:"px"}]},{key:"print",label:"\u5370\u5237\u7269\u6599",sizes:[{icon:e(t,{size:24}),name:"\u4E00\u5BF8\u8BC1\u4EF6\u7167",desc:"23x35mm",width:25,height:35,unit:"mm"},{icon:e(t,{size:24}),name:"\u4E8C\u5BF8\u8BC1\u4EF6\u7167",desc:"35x53mm",width:35,height:53,unit:"mm"},{icon:e(t,{size:24}),name:"1.8\u7C73\u5C55\u67B6",desc:"80x180cm",width:80,height:180,unit:"cm"},{icon:e(t,{size:24}),name:"2m\u6613\u62C9\u5B9D",desc:"80x200cm",width:80,height:200,unit:"cm"},{icon:e(t,{size:24}),name:"\u540D\u7247",desc:"96x60mm",width:96,height:60,unit:"mm"},{icon:e(t,{size:24}),name:"\u4F18\u60E0\u5238",desc:"186x66mm",width:186,height:66,unit:"mm"},{icon:e(t,{size:24}),name:"\u4F20\u5355",desc:"216x291cm",width:216,height:291,unit:"cm"}]}],D=z.div`
|
|
2
|
+
padding: 16px 24px;
|
|
3
|
+
height: 60px;
|
|
4
|
+
flex: 1;
|
|
5
|
+
display: flex;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
align-items: center;
|
|
8
|
+
border-radius: 8px;
|
|
9
|
+
border: 1px dashed #d0d2d6;
|
|
10
|
+
&:hover {
|
|
11
|
+
background-color: rgba(0, 31, 92, 0.06);
|
|
12
|
+
}
|
|
13
|
+
span {
|
|
14
|
+
margin-left: 8px;
|
|
15
|
+
}
|
|
16
|
+
`,ge=z.div`
|
|
17
|
+
flex: 1;
|
|
18
|
+
margin-left: 14px;
|
|
19
|
+
height: 100%;
|
|
20
|
+
|
|
21
|
+
.createrContentInner {
|
|
22
|
+
margin-bottom: 16px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.scrollbars div:first-child {
|
|
26
|
+
scroll-behavior: smooth;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.Widget.categorySection[data-is-folded='false'] .categoryFoldBtn,
|
|
30
|
+
.Widget.categorySection[data-is-multi-row='false'] .categoryFoldBtn {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.Widget.categorySection[data-is-folded='true'] ul {
|
|
35
|
+
height: 97px;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
}
|
|
38
|
+
`,ue=z.div`
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
position: relative;
|
|
42
|
+
padding-top: 16px;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
align-items: center;
|
|
48
|
+
|
|
49
|
+
border-radius: 8px;
|
|
50
|
+
background-color: #f6f7fa;
|
|
51
|
+
|
|
52
|
+
.canvasSizeName {
|
|
53
|
+
color: #616366;
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
line-height: 16px;
|
|
57
|
+
margin-top: 8px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.canvasSizeSize {
|
|
61
|
+
height: 14px;
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
width: 100%;
|
|
64
|
+
margin-top: 4px;
|
|
65
|
+
|
|
66
|
+
span {
|
|
67
|
+
color: #abadb2;
|
|
68
|
+
display: block;
|
|
69
|
+
font-size: 20px;
|
|
70
|
+
font-weight: 400;
|
|
71
|
+
height: 200%;
|
|
72
|
+
line-height: 26px;
|
|
73
|
+
text-align: center;
|
|
74
|
+
-webkit-transform: scale(0.5);
|
|
75
|
+
transform: scale(0.5);
|
|
76
|
+
-webkit-transform-origin: top left;
|
|
77
|
+
transform-origin: top left;
|
|
78
|
+
width: 200%;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.canvasSizeMask {
|
|
83
|
+
background: rgba(0, 0, 0, 0.25);
|
|
84
|
+
display: none;
|
|
85
|
+
height: 100%;
|
|
86
|
+
left: 0;
|
|
87
|
+
position: absolute;
|
|
88
|
+
top: 0;
|
|
89
|
+
width: 100%;
|
|
90
|
+
}
|
|
91
|
+
.canvasSizeMask,
|
|
92
|
+
.canvasSizeMask button {
|
|
93
|
+
justify-content: center;
|
|
94
|
+
align-items: center;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.canvasSizeMask button {
|
|
98
|
+
background-color: #fff;
|
|
99
|
+
width: 66px;
|
|
100
|
+
height: 26px;
|
|
101
|
+
display: flex;
|
|
102
|
+
padding: 0 8px;
|
|
103
|
+
outline: none;
|
|
104
|
+
line-height: 16px;
|
|
105
|
+
font-size: 12px;
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
color: #1c1d1f;
|
|
108
|
+
border-radius: 6px;
|
|
109
|
+
}
|
|
110
|
+
.canvasSizeMask button:active {
|
|
111
|
+
background-color: #f2f2f2;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:hover .canvasSizeMask {
|
|
115
|
+
display: flex;
|
|
116
|
+
}
|
|
117
|
+
`,fe=z.div`
|
|
118
|
+
display: flex;
|
|
119
|
+
margin-top: 20px;
|
|
120
|
+
flex-wrap: wrap;
|
|
121
|
+
align-items: center;
|
|
122
|
+
position: relative;
|
|
123
|
+
|
|
124
|
+
.sizeWarning {
|
|
125
|
+
width: 100%;
|
|
126
|
+
margin-bottom: 8px;
|
|
127
|
+
padding: 4px 8px;
|
|
128
|
+
font-size: 12px;
|
|
129
|
+
color: #ff4d4f;
|
|
130
|
+
background-color: #fff2f0;
|
|
131
|
+
border: 1px solid #ffccc7;
|
|
132
|
+
border-radius: 4px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.Widget.sizeInpueBox {
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
|
|
139
|
+
flex: 1;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.Widget.sizeInpueBox .sizeInput {
|
|
143
|
+
flex: 1;
|
|
144
|
+
}
|
|
145
|
+
.Widget.sizeInpueBox .linkIcon {
|
|
146
|
+
padding: 8px;
|
|
147
|
+
background-color: #001f5c0f;
|
|
148
|
+
border-radius: 8px;
|
|
149
|
+
margin: 0 4px;
|
|
150
|
+
}
|
|
151
|
+
`,r=72,v=20,b=8e3,Ce=({visible:E,onClose:F,onConfirm:H})=>{let[M,_]=l("all"),B=me(null),[o,w]=l(null),[s,k]=l(null),[c,$]=l("px"),[d,O]=l(!1),[m,U]=l(1),[x,V]=l("#ffffff"),C=W(()=>o?p({unitVal:o,dpi:r,unit:c}):0,[o,c]),S=W(()=>s?p({unitVal:s,dpi:r,unit:c}):0,[s,c]),N=o!=null&&s!=null&&o>0&&s>0,g=N&&(C>b||S>b),u=N&&(C<v||S<v),P=!N||g||u,T=g?`\u8D85\u51FA\u753B\u5E03\u5C3A\u5BF8\u9650\u5236\uFF1A${b} * ${b} px`:u?`\u4F4E\u4E8E\u753B\u5E03\u5C3A\u5BF8\u9650\u5236\uFF1A${v} * ${v} px`:"",A=h(i=>{w(i),d&&i&&i>0&&k(Math.round(i/m))},[d,m]),X=h(i=>{k(i),d&&i&&i>0&&w(Math.round(i*m))},[d,m]),K=h(()=>{!d&&o&&s&&o>0&&s>0&&U(o/s),O(i=>!i)},[d,o,s]),Z=h(i=>{if(o){let n=p({unitVal:o,dpi:r,unit:c});w(Math.round(I({px:n,dpi:r,unit:i,precious:0})))}if(s){let n=p({unitVal:s,dpi:r,unit:c});k(Math.round(I({px:n,dpi:r,unit:i,precious:0})))}$(i)},[o,s,c]),j=h(()=>{if(P)return;let i=JSON.stringify({bg:{backgroundColor:x}}),n=new URLSearchParams({create:"",createEmptyPoster:"true",createInfo:i,height:String(s),unit:c,width:String(o)});window.open(`/?${n.toString()}`,"_blank")},[P,x,S,C,c]),q=i=>{_(i);let n=B.current;if(!n)return;let f=n.querySelector(`[data-category-id="${i}"]`);f&&n.scrollTo({top:f.offsetTop,behavior:"smooth"})},[G,J]=l(()=>{let i={};return R.forEach(n=>{i[n.key]=n.sizes.length>6}),i});return a(Q,{title:"\u521B\u5EFA\u8BBE\u8BA1",open:E,onCancel:F,footer:null,width:880,mask:{closable:!1},styles:{body:{display:"flex",flex:1,padding:"20px 0",height:"100%"},container:{height:550}},children:[e("div",{className:"createrSideBar",style:{width:140},children:xe.map(i=>a("div",{"data-active":i.key===M,className:y("createrSideBarItem","flex h-[40px] px-2 mb-2 cursor-pointer rounded-md items-center hover:bg-[#f2f2f2] text-[#333]",{"bg-[#1677ff4d] hover:bg-[#1677ff4d]":i.key===M}),onClick:()=>q(i.key),children:[e(i.icon,{size:16,className:"ml-2"}),e("span",{className:"ml-2",children:i.label})]},i.key))}),e(ge,{children:e("div",{className:"scrollbars",style:{position:"relative",overflow:"hidden",width:"100%",height:"100%"},children:e("div",{ref:B,style:{position:"absolute",inset:0,overflow:"scroll"},children:a("div",{className:"createrContentInner",children:[e("div",{"data-category-id":"all"}),a("div",{className:"openBtns flex",children:[a(D,{onClick:()=>{alert("\u56FE\u7247\u6A21\u5F0F\u5F00\u53D1\u4E2D...")},children:[e(re,{style:{color:"#1677ff"}}),e("span",{children:"\u6253\u5F00\u56FE\u7247"})]}),a(D,{style:{marginLeft:12},onClick:()=>{alert("psd\u5F00\u53D1\u4E2D")},children:[e(t,{style:{color:"#1677ff"}}),e("span",{children:"\u6253\u5F00PSD"})]})]}),R.map(i=>a("div",{className:y("Widget categorySection","mt-6"),"data-category-id":i.key,"data-is-folded":G[i.key]??!1,"data-is-multi-row":i.sizes.length>6,children:[a("div",{className:y("categoryHeader","flex items-center justify-between"),children:[e("div",{className:"categoryTitle text-sm font-semibold",children:i.label}),e("div",{className:"categoryFoldBtn flex items-center cursor-pointer",onClick:()=>J(n=>({...n,[i.key]:!1})),children:e("span",{className:"text-[#616366]",children:"\u67E5\u770B\u66F4\u591A"})})]}),i.key==="common"&&a(fe,{children:[T&&e("div",{className:"sizeWarning",children:T}),a("div",{className:"Widget sizeInpueBox",children:[e("div",{className:"sizeInput",children:e(L,{prefix:"\u5BBD",value:o,min:0,precision:0,status:g||u?"error":void 0,onChange:A,styles:{actions:{opacity:1,width:24}},style:{width:"100%"}})}),e(te,{title:d?"\u89E3\u9501\u6BD4\u4F8B":"\u9501\u5B9A\u6BD4\u4F8B",children:e("div",{className:"linkIcon",style:{cursor:"pointer"},onClick:K,children:d?e(he,{size:16}):e(pe,{size:16})})}),e("div",{className:"sizeInput",children:e(L,{prefix:"\u9AD8",value:s,min:0,precision:0,status:g||u?"error":void 0,onChange:X,styles:{actions:{opacity:1,width:24}},style:{width:"100%"}})}),e("div",{className:"sizeUnitSelect",style:{width:98,marginLeft:12},children:e(ie,{value:c,style:{width:98},onChange:Z,options:[{label:"px \u50CF\u7D20",value:"px"},{label:"cm \u5398\u7C73",value:"cm"},{label:"mm \u6BEB\u7C73",value:"mm"}]})})]}),e("div",{className:"widgets-color-picker",style:{width:98,marginLeft:12},children:e(ee,{mode:"single",format:"hex",value:x,onChange:n=>V(n.toHexString()),styles:{root:{width:98},body:{width:92}}})}),e(Y,{type:"primary",disabled:P,style:{width:98,marginLeft:12},onClick:j,children:"\u521B\u5EFA"})]}),e("ul",{className:"flex mt-4 flex-wrap gap-3",children:i.sizes.map((n,f)=>e("li",{style:{width:"calc((100% - 60px) / 6)",height:97},children:a(ue,{children:[n.icon,e("div",{className:"canvasSizeName",children:n.name}),e("div",{className:"canvasSizeSize",children:e("span",{children:n.desc})}),e("div",{className:"canvasSizeMask",onClick:()=>{H({...n,bgColor:x})},children:e("button",{type:"button",children:"\u521B\u5EFA"})})]})},f))})]},i.key))]})})})})]})};export{Ce as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as t}from"./chunk-FOMWIGAQ.js";import{c as o}from"./chunk-ARZMBVXU.js";import{Input as i}from"antd";import{observer as r}from"mobx-react-lite";import{jsx as l,jsxs as f}from"react/jsx-runtime";var s=[{url:"https://zh.gtimg.com/e9/atom-parser/psd/upload-parse-only/616136edba8103014b0b7797/psd/20017af2f28b3047c19c040e39e80611/dba81d9a-9fd0-480b-8738-da150b9f051b.png",thumb:"https://zh.gtimg.com/m-1/atom-record/resource/upload-one/616136edba8103014b0b7797/4a5725d6176da33dfd1881abcba6ad3b.png?imageMogr2/thumbnail/!50p",content:{objects:[{type:"rect",version:"4.4.0",originX:"left",originY:"top",left:0,top:0,width:1242,height:2208,stroke:null,strokeWidth:0,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!1,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"#fff",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:"workarea",name:"",src:null,lockMovementX:!0,lockMovementY:!0,lockRotation:!1,lockScalingFlip:!1,lockScalingX:!0,lockScalingY:!0,lockSkewingX:!1,lockSkewingY:!1,hasControls:!1,workareaWidth:1242,workareaHeight:2208,workareaLeft:-140.5,workareaTop:-713.5,filters:[],selectable:!1,crossOrigin:null,edited:1},{type:"image",version:"4.4.0",originX:"left",originY:"top",left:0,top:0,width:1242,height:2208,stroke:null,strokeWidth:0,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!0,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"fill",globalCompositeOperation:"source-over",skewX:0,skewY:0,cropX:0,cropY:0,id:"cc3e2664-b61a-428b-84bd-ae22755701dd",name:"\u80CC\u666F",src:"https://zh.gtimg.com/e9/atom-parser/psd/upload-parse-only/616136edba8103014b0b7797/pstemplate/assets/fd2fcd137a4e849dd24867c48b3a4cb7.png",blendingMode:"normal",lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingFlip:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,hasControls:!0,editable:!0,filters:[],selectable:!0,layerPath:["\u80CC\u666F"],crossOrigin:"anonymous"},{type:"textbox",version:"4.4.0",originX:"left",originY:"top",left:1097.6100000000001,top:1507,width:55.88,height:354.6,fill:{type:"linear",coords:{x1:26.5,y1:342,x2:26.5,y2:0},colorStops:[{offset:0,color:`rgb(255,214,
|
|
2
2
|
116)`,opacity:1},{offset:.49,color:`rgb(255,243,
|
|
3
3
|
225)`,opacity:1},{offset:1,color:`rgb(255,214,
|
|
4
4
|
116)`,opacity:1}],offsetX:0,offsetY:0,gradientUnits:"pixels",gradientTransform:null},stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!0,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"stroke",globalCompositeOperation:"source-over",skewX:0,skewY:0,text:"\u65B0\u5C81\u542F\u7965\u745E",fontSize:55.8824459752298,fontWeight:"normal",fontFamily:"Huiwen-mingchao",fontStyle:"normal",lineHeight:1.1538462250615245,underline:!1,overline:!1,linethrough:!1,textAlign:"left",textBackgroundColor:"",charSpacing:0,path:null,minWidth:20,splitByGrapheme:!0,id:"47e96074-84e0-4d5e-9e30-e5ba4113adb7",name:"\u65B0\u5C81\u542F\u7965\u745E",blendingMode:"normal",lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingFlip:!0,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,hasControls:!0,editable:!0,selectable:!0,layerPath:["\u65B0\u5C81\u542F\u7965\u745E"]},{type:"textbox",version:"4.4.0",originX:"left",originY:"top",left:995.61,top:1507,width:72,height:354.6,fill:{type:"linear",coords:{x1:27,y1:342,x2:27,y2:0},colorStops:[{offset:0,color:`rgb(255,214,
|
|
@@ -42,4 +42,4 @@ import{a as o}from"./chunk-IQ7O55C5.js";import{Input as a}from"antd";import{obse
|
|
|
42
42
|
225)`,opacity:1},{offset:.99,color:`rgb(255,205,
|
|
43
43
|
100)`,opacity:1}],offsetX:0,offsetY:0,gradientUnits:"pixels",gradientTransform:null},stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!0,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"stroke",globalCompositeOperation:"source-over",skewX:0,skewY:0,text:"CHINESE",fontSize:129.5599333919183,fontWeight:"normal",fontFamily:"Huiwen-mingchao",fontStyle:"normal",lineHeight:1,underline:!1,overline:!1,linethrough:!1,textAlign:"left",textBackgroundColor:"",charSpacing:0,path:null,minWidth:20,splitByGrapheme:!1,id:"f4501742-c6e7-4765-ac2d-20cf76a02f73",name:"CHINESE",blendingMode:"normal",lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingFlip:!0,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,hasControls:!0,editable:!0,selectable:!0},{type:"textbox",version:"4.4.0",originX:"left",originY:"top",left:452.61,top:272,width:335.79,height:73.72,fill:{type:"linear",coords:{x1:184,y1:50,x2:184,y2:0},colorStops:[{offset:0,color:`rgb(255,243,
|
|
44
44
|
225)`,opacity:1},{offset:.99,color:`rgb(255,205,
|
|
45
|
-
100)`,opacity:1}],offsetX:0,offsetY:0,gradientUnits:"pixels",gradientTransform:null},stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!0,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"stroke",globalCompositeOperation:"source-over",skewX:0,skewY:0,text:"NEW YEAR",fontSize:65.23939908387375,fontWeight:"normal",fontFamily:"Huiwen-mingchao",fontStyle:"normal",lineHeight:1,underline:!1,overline:!1,linethrough:!1,textAlign:"left",textBackgroundColor:"",charSpacing:0,path:null,minWidth:20,splitByGrapheme:!1,id:"634cbf93-5e84-425a-ac4e-774527f90bc8",name:"NEW YEAR",blendingMode:"normal",lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingFlip:!0,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,hasControls:!0,editable:!0,selectable:!0}],width:1242,height:1656},width:1242,height:1656,name:"\u6625\u8282\u7B80\u7EA6\u98CE\u795D\u798F"}],{Search:
|
|
45
|
+
100)`,opacity:1}],offsetX:0,offsetY:0,gradientUnits:"pixels",gradientTransform:null},stroke:null,strokeWidth:1,strokeDashArray:null,strokeLineCap:"butt",strokeDashOffset:0,strokeLineJoin:"miter",strokeUniform:!0,strokeMiterLimit:4,scaleX:1,scaleY:1,angle:0,flipX:!1,flipY:!1,opacity:1,shadow:null,visible:!0,backgroundColor:"",fillRule:"nonzero",paintFirst:"stroke",globalCompositeOperation:"source-over",skewX:0,skewY:0,text:"NEW YEAR",fontSize:65.23939908387375,fontWeight:"normal",fontFamily:"Huiwen-mingchao",fontStyle:"normal",lineHeight:1,underline:!1,overline:!1,linethrough:!1,textAlign:"left",textBackgroundColor:"",charSpacing:0,path:null,minWidth:20,splitByGrapheme:!1,id:"634cbf93-5e84-425a-ac4e-774527f90bc8",name:"NEW YEAR",blendingMode:"normal",lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingFlip:!0,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,hasControls:!0,editable:!0,selectable:!0}],width:1242,height:1656},width:1242,height:1656,name:"\u6625\u8282\u7B80\u7EA6\u98CE\u795D\u798F"}],{Search:n}=i,u=r(({store:a})=>f("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[l("div",{style:{padding:"0 4px",marginBottom:10},children:l(n,{placeholder:o("sidePanel.searchPlaceholder")})}),l(t,{shadowEnabled:!1,images:s,getPreview:e=>e.thumb,isLoading:!1,error:!1,onSelect:e=>{console.log("args ---> ",e),a.loadJSON(e.content)}})]}));export{u as a};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import{c as x}from"./chunk-WCHGSVUC.js";import{c as u}from"./chunk-ARZMBVXU.js";import a from"styled-components";import{useRef as I,useEffect as P}from"react";import{Spin as D}from"antd";import{observer as W}from"mobx-react-lite";import{jsx as o,jsxs as y}from"react/jsx-runtime";var j=a.div`
|
|
2
|
+
height: 100%;
|
|
3
|
+
overflow: auto;
|
|
4
|
+
`,z=a.div`
|
|
5
|
+
width: 33%;
|
|
6
|
+
float: left;
|
|
7
|
+
`,F=a.div`
|
|
8
|
+
padding: 4px;
|
|
9
|
+
width: 100%;
|
|
10
|
+
&:hover .credit {
|
|
11
|
+
opacity: 1;
|
|
12
|
+
}
|
|
13
|
+
${x(".credit {opacity: 1;}")}
|
|
14
|
+
`,H=a.div`
|
|
15
|
+
border-radius: 5px;
|
|
16
|
+
position: relative;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
box-shadow: ${e=>e.$dataShadowenabled?"0 0 5px rgba(16, 22, 26, 0.3)":""};
|
|
19
|
+
padding: ${e=>e.$spacing?e.$spacing+"px":"0px"};
|
|
20
|
+
`,G=a.img`
|
|
21
|
+
width: 100%;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
display: block;
|
|
24
|
+
max-height: 300px;
|
|
25
|
+
min-height: 50px;
|
|
26
|
+
object-fit: contain;
|
|
27
|
+
`,M=a.div`
|
|
28
|
+
position: absolute;
|
|
29
|
+
bottom: 0px;
|
|
30
|
+
left: 0px;
|
|
31
|
+
font-size: 10px;
|
|
32
|
+
padding: 3px;
|
|
33
|
+
padding-top: 10px;
|
|
34
|
+
text-align: center;
|
|
35
|
+
background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
|
|
36
|
+
width: 100%;
|
|
37
|
+
opacity: 0;
|
|
38
|
+
color: white;
|
|
39
|
+
`,N=a.p`
|
|
40
|
+
text-align: center;
|
|
41
|
+
padding: 30px;
|
|
42
|
+
`,q=({url:e,onSelect:d,shadowEnabled:t,className:g,itemHeight:r,crossOrigin:s,onLoad:p,credit:l,spacing:m})=>o(F,{className:"ydesign-close-panel",onClick:d,children:y(H,{$spacing:m,$dataShadowenabled:t,className:"border-1 border-gray-200",children:[o(G,{className:g,style:{height:r??"auto "},src:e,draggable:!0,loading:"lazy",crossOrigin:s,onLoad:p}),l&&o(M,{className:"credit",children:l})]})}),V=W(({images:e,rowsNumber:d,isLoading:t,getPreview:g,getCredit:r,getImageClassName:s,onSelect:p,crossOrigin:l="anonymous",shadowEnabled:m,itemHeight:S,error:f,hideNoResults:$=!1,spacing:R})=>{let c=d||2,T=I(null),h=[];for(let i=0;i<c;i++)h.push((e||[]).filter((v,n)=>n%c===i));let b=I(null),w=()=>{},C=()=>{w()};return P(()=>(w(),()=>{b.current&&(window.clearTimeout(b.current),b.current=null)}),[e?.length,t]),y(j,{className:"no-scrollbar",ref:T,onScroll:()=>{},children:[o("style",{children:`
|
|
43
|
+
.no-scrollbar::-webkit-scrollbar {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
.no-scrollbar {
|
|
47
|
+
-ms-overflow-style: none;
|
|
48
|
+
scrollbar-width: none;
|
|
49
|
+
}
|
|
50
|
+
`}),h.map((i,v)=>y(z,{style:{width:100/c+"%"},children:[i.map((n,k)=>o(q,{image:n,url:g(n),onSelect:(E,L,O)=>{p(n,E,L,O)},credit:r&&r(n),crossOrigin:l,shadowEnabled:m,itemHeight:S,className:s&&s(n),onLoad:C,spacing:R},k)),t&&o("div",{style:{padding:30},children:o(D,{})})]},v)),!t&&(!e||!e.length)&&!f&&!$&&o(N,{children:u("sidePanel.noResults")}),f&&o(N,{children:u("sidePanel.error")})]})});export{V as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as x}from"./chunk-YOQ663QO.js";import{a as m,b as w}from"./chunk-YRJUN267.js";import{a as u}from"./chunk-RVXI723F.js";import{c as k}from"./chunk-ARZMBVXU.js";import{cssGradient2FabricGradient as F}from"@ydesign/core";import{observer as f}from"mobx-react-lite";import{useState as P,useRef as y,useMemo as B}from"react";import{ColorPicker as S,Popover as j,Button as g,InputNumber as b,Slider as W}from"antd";import{Logs as A,Ban as D}from"lucide-react";import{Fragment as U,jsx as e,jsxs as h}from"react/jsx-runtime";var n=r=>r?typeof r=="string"?r:r.colorStops?JSON.stringify(r.colorStops):JSON.stringify(r):"",H=f(({store:r,elements:t})=>{let o=t[0],[c,d]=P(()=>u(o.fill)),a=y(!1),s=y(n(o.fill)),p=n(o.fill);p!==s.current&&!a.current&&(s.current=p,d(u(o.fill)));let v=B(()=>c,[n(c)]);return e(S,{value:v,allowClear:!0,mode:["single","gradient"],onOpenChange:i=>{a.current=i,i||(s.current=n(o.fill))},onChange:i=>{d(i)},onChangeComplete:i=>{let l=i.toCssString();if(l.includes("gradient")){let C=F(l);r.editor?.objectsHandler.update({fill:C})}else r.editor?.objectsHandler.update({fill:l})}})}),R=f(({store:r,element:t})=>e(j,{trigger:"click",content:h("div",{style:{width:270},children:[h("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:15},children:[e(g,{color:t?.strokeWidth===0?"primary":"default",variant:"filled",onClick:()=>{r.editor?.objectsHandler.update({strokeWidth:0}),r._triggerUpdate()},children:e(D,{size:16})}),e(g,{color:t?.strokeWidth&&t?.strokeDashArray?.length===0?"primary":"default",variant:"filled",onClick:()=>{r.editor?.objectsHandler.update({strokeDashArray:[],strokeWidth:t?.strokeWidth||10,stroke:t?.stroke||"#000000"}),r._triggerUpdate()},children:e("svg",{width:16,height:16,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x2:24,y1:"50%",y2:"50%",stroke:"currentColor",strokeWidth:"2"})})}),e(g,{color:t?.strokeWidth&&Array.isArray(t.strokeDashArray)&&t.strokeDashArray[0]===4?"primary":"default",variant:"filled",onClick:()=>{r.editor?.objectsHandler.update({strokeDashArray:[4,1],strokeWidth:t?.strokeWidth||10,stroke:t?.stroke||"#000000"}),r._triggerUpdate()},children:e("svg",{width:16,height:16,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x1:"-1",x2:"25",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"12 2",strokeWidth:"2"})})}),e(g,{color:t?.strokeWidth&&Array.isArray(t.strokeDashArray)&&t.strokeDashArray[0]===2?"primary":"default",variant:"filled",onClick:()=>{r.editor?.objectsHandler.update({strokeDashArray:[2,1],strokeWidth:t?.strokeWidth||10,stroke:t?.stroke||"#000000"}),r._triggerUpdate()},children:e("svg",{width:16,height:16,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"6 2",strokeWidth:"2"})})}),e(g,{color:t?.strokeWidth&&Array.isArray(t.strokeDashArray)&&t.strokeDashArray[0]===1?"primary":"default",variant:"filled",onClick:()=>{r.editor?.objectsHandler.update({strokeDashArray:[1,1],strokeWidth:t?.strokeWidth||10,stroke:t?.stroke||"#000000"}),r._triggerUpdate()},children:e("svg",{width:16,height:16,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})})})]}),h("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:5},children:[e("div",{children:k("toolbar.strokeWidth")}),e("div",{children:e(b,{value:t?.strokeWidth,style:{width:60},min:0,max:Math.round(Math.min(t?.width,t?.height)/2),onChange:o=>{r.editor?.objectsHandler.update({strokeWidth:o}),r._triggerUpdate()}})})]}),e(W,{value:t?.strokeWidth,onChange:o=>{r.editor?.objectsHandler.update({strokeWidth:o}),r._triggerUpdate()},min:0,max:Math.round(Math.min(t?.width,t?.height)/2)}),t?.type==="rect"&&h(U,{children:[h("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:15,paddingBottom:5},children:[e("div",{children:k("toolbar.cornerRadius")}),e("div",{children:e(b,{value:t?.rx,style:{width:60},min:0,max:Math.round(Math.min(t?.width,t?.height)/2),onChange:o=>{r.editor?.objectsHandler.update({rx:o,ry:o}),r._triggerUpdate()}})})]}),e(W,{value:t?.rx,onChange:o=>{r.editor?.objectsHandler.update({rx:o,ry:o}),r._triggerUpdate()},min:0,max:Math.round(Math.min(t?.width,t?.height)/2)})]})]}),children:e(g,{type:"text",styles:{root:{padding:"0 7px"}},icon:e(A,{size:16,style:{display:"flex"}}),children:k("toolbar.strokeSettings")})})),M=f(({store:r,elements:t})=>{let o=t[0],[c,d]=P(()=>u(o?.stroke)),a=y(!1),s=y(n(o?.stroke)),p=n(o?.stroke);p!==s.current&&!a.current&&(s.current=p,d(u(o?.stroke)));let v=B(()=>c,[n(c)]);return o?.strokeWidth?e(S,{value:v,allowClear:!0,mode:["single","gradient"],onOpenChange:i=>{a.current=i,i||(s.current=n(o.stroke))},onChange:i=>{d(i)},onChangeComplete:i=>{let l=i.toCssString();if(l.includes("gradient")){let C=F(l);r.editor?.objectsHandler.update({stroke:C})}else r.editor?.objectsHandler.update({stroke:l})}}):null}),_={FigureFill:H,FigureStroke:M,FigureSettings:R,FigureFilters:x},z=f(({store:r,components:t})=>{let o=r.selectedElements[0],d=m({type:"figure",usedItems:["FigureFill","FigureStroke","FigureSettings","FigureFilters"],components:t});return e(w,{items:d,itemRender:a=>{let s=t[a]||_[a];return s&&e(s,{elements:r.selectedElements,element:o,store:r},a)}})});export{n as a,H as b,R as c,M as d,z as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./chunk-ARZMBVXU.js";import{Download as n}from"lucide-react";import{useState as r}from"react";import{Button as m,Popover as u,Slider as d,Select as p}from"antd";import{observer as x}from"mobx-react-lite";import{jsx as t,jsxs as o}from"react/jsx-runtime";var b=x(({store:i})=>{let[l,v]=r("png"),[s,y]=r(1),[a,c]=r(1);return t(u,{content:o("div",{className:"w-80",children:[o("div",{className:"mb-4",children:[t("div",{style:{marginBottom:"8px"},className:"text-gray-500",children:e("toolbar.fileType")}),o(p,{value:l,onChange:v,style:{width:"100%"},children:[t(p.Option,{value:"png",children:"PNG"}),t(p.Option,{value:"jpeg",children:"JPEG"})]})]}),o("div",{className:"mb-4",children:[t("div",{style:{marginBottom:"8px"},className:"text-gray-500",children:e("toolbar.quality")}),t("div",{style:{padding:"0 15px"},children:t(d,{min:.2,max:1,value:s,step:.2,onChange:y,marks:{.2:"20%",.4:"40%",.6:"60%",.8:"80%",1:"100%"}})})]}),o("div",{className:"mb-4",children:[t("div",{style:{marginBottom:"8px"},className:"text-gray-500",children:e("toolbar.multiplier")}),t("div",{style:{padding:"0 15px"},children:t(d,{min:.5,max:3,value:a,step:.5,onChange:c,marks:{.5:.5,1:1,1.5:1.5,2:2,2.5:2.5,3:3}})}),o("div",{className:"text-sm text-gray-500 py-1",children:[e("toolbar.size"),"\uFF1A",Math.round(i.width*a)," x"," ",Math.round(i.height*a)," px"]})]}),t("div",{children:o(m,{type:"primary",block:!0,onClick:async()=>{let g=i.toJSON();console.log("\u5BFC\u51FAjson",g),i.saveAsImage({format:l,quality:s,multiplier:a})},icon:t(n,{size:16}),children:[e("toolbar.download")," ",l.toUpperCase()]})})]}),trigger:"click",children:t(m,{type:"primary",icon:t(n,{size:16}),style:{width:155},children:e("toolbar.download")})})}),B=b;export{b as a,B as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o}from"./chunk-ARZMBVXU.js";import{a as e}from"./chunk-JMIN2XMC.js";import{Copy as l}from"lucide-react";import{Tooltip as m,Button as n}from"antd";import{observer as s}from"mobx-react-lite";import{jsx as t}from"react/jsx-runtime";var b=s(({store:r})=>{let{disabled:p,duplicate:i}=e({store:r});return t(m,{title:o("toolbar.duplicateElements"),placement:"bottom",children:t(n,{type:"text",styles:{root:{padding:"0 7px"}},disabled:p,onClick:()=>{i()},children:t(l,{size:16})})})});export{b as a};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as T,b,c as u}from"./chunk-5C2MNUBC.js";import{c as l}from"./chunk-ARZMBVXU.js";import{useState as x,useEffect as S,useRef as R}from"react";import{observer as A}from"mobx-react-lite";import{Button as z,Switch as L,Tooltip as M,InputNumber as E,Select as U}from"antd";import{Info as W,Instagram as v,Linkedin as g,Twitter as h,Video as r,Printer as a}from"lucide-react";import{jsx as i,jsxs as n}from"react/jsx-runtime";var $=[{name:"Instagram",icon:i(v,{size:16}),sizes:[["Post",1080,1080,"px",i(v,{})],["Story",1080,1920,"px",i(v,{})],["Ad",1080,1080,"px",i(v,{})]]},{name:"LinkedIn",icon:i(g,{size:16}),sizes:[["Post",1200,627,"px",i(g,{})],["Banner",1584,396,"px",i(g,{})],["Square",1080,1080,"px",i(g,{})]]},{name:"Twitter",icon:i(h,{size:16}),sizes:[["Post",1600,900,"px",i(h,{})],["Header",1500,500,"px",i(h,{})],["Square",1080,1080,"px",i(h,{})]]},{name:"Video",icon:i(r,{size:16}),sizes:[["Full HD",1920,1080,"px",i(r,{})],["4K UHD",3840,2160,"px",i(r,{})],["Vertical HD",1080,1920,"px",i(r,{})],["Square HD",1080,1080,"px",i(r,{})]]},{name:"Print",icon:i(a,{size:16}),sizes:[["Invitation",14,14,"cm",i(a,{})],["A4 Portrait",21,29.7,"cm",i(a,{})],["A4 Landscape",29.7,21,"cm",i(a,{})],["A3",29.7,42,"cm",i(a,{})],["Letter Portrait",8.5,11,"in",i(a,{})],["Letter Landscape",11,8.5,"in",i(a,{})],["Business card",3.5,2,"in",i(a,{})],["Poster",18,24,"in",i(a,{})]]}],D=t=>{let{value:d,onChange:f}=t,[o,c]=x(d),p=R(d);p.current=o;let m=()=>{f(Math.max(t.min||0,parseFloat(p.current)))};return S(()=>{c(d)},[d]),i(E,{...t,value:o,onChange:s=>{Number.isNaN(s)||c(s)},onBlur:m,onKeyDown:s=>{s.key==="Enter"&&m()}})},Z=A(({store:t})=>{let[d,f]=x(!0),[o,c]=x(t.width),[p,m]=x(t.height),s=T({px:10,unit:t.unit,dpi:t.dpi}),k=t.width,P=t.height;return S(()=>{c(b({px:k,unit:t.unit,dpi:t.dpi,precious:0}))},[k,t.unit,t.dpi]),S(()=>{m(b({px:P,unit:t.unit,dpi:t.dpi,precious:0}))},[P,t.unit,t.dpi]),n("div",{className:"no-scrollbar",style:{height:"100%",overflow:"auto",paddingRight:"3px"},children:[i("style",{children:`
|
|
2
|
+
.no-scrollbar::-webkit-scrollbar {
|
|
3
|
+
display: none;
|
|
4
|
+
}
|
|
5
|
+
.no-scrollbar {
|
|
6
|
+
-ms-overflow-style: none;
|
|
7
|
+
scrollbar-width: none;
|
|
8
|
+
}
|
|
9
|
+
`}),n("div",{style:{paddingBottom:"15px"},children:[n("div",{style:{display:"flex",alignItems:"center",marginTop:8,marginBottom:25,justifyContent:"space-between"},children:[n("div",{style:{display:"flex",alignItems:"center"},children:[i("span",{children:l("sidePanel.useMagicResize")}),i(M,{title:l("sidePanel.magicResizeDescription"),placement:"bottom",children:i(z,{type:"text",styles:{root:{padding:"0 7px"}},children:i(W,{size:16})})})]}),i(L,{checked:d,onChange:f})]}),i("div",{style:{width:"50%",display:"inline-block"},children:`${l("sidePanel.width")} (${t.unit})`}),i("div",{style:{width:"50%",display:"inline-block"},children:i(D,{min:s,max:1e4,value:o,style:{width:"100%"},styles:{actions:{opacity:1,width:24}},onChange:e=>{e||(e=o),c(e)}})})]}),n("div",{style:{paddingBottom:"15px"},children:[i("div",{style:{width:"50%",display:"inline-block"},children:`${l("sidePanel.height")} (${t.unit})`}),i("div",{style:{width:"50%",display:"inline-block"},children:i(D,{min:s,max:1e4,value:p,style:{width:"100%"},styles:{actions:{opacity:1,width:24}},onChange:e=>{e||(e=p),m(e)}})})]}),n("div",{style:{paddingBottom:"15px"},children:[i("div",{style:{width:"50%",display:"inline-block"},children:l("sidePanel.units")}),i("div",{style:{width:"50%",display:"inline-block"},children:i(U,{value:t.unit,style:{width:"100%"},onChange:e=>{t.setUnit({unit:e,dpi:t.dpi})},options:[{label:"px",value:"px"},{label:"cm",value:"cm"},{label:"mm",value:"mm"}]})})]}),i("div",{style:{paddingBottom:"15px"},children:i(z,{type:"primary",onClick:()=>{let e=u({unitVal:o,dpi:t.dpi,unit:t.unit}),w=u({unitVal:p,dpi:t.dpi,unit:t.unit});t.setSize({width:e,height:w,useMagic:d})},block:!0,children:l("sidePanel.resize")})}),$.map(e=>n("div",{children:[n("div",{style:{paddingBottom:"15px",paddingTop:"15px",fontWeight:600,display:"flex",alignItems:"center",gap:6},children:[e.icon,e.name]}),i("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"8px",marginBottom:"10px"},children:e.sizes.map(w=>{let[B,C,I,y,H]=w;return n(z,{type:"text",style:{height:"80px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:"13px",maxWidth:103},styles:{root:{padding:"0 10px",gap:0}},onClick:()=>{let V=u({unitVal:C,dpi:t.dpi,unit:y}),N=u({unitVal:I,dpi:t.dpi,unit:y});t.setUnit({unit:y,dpi:t.dpi}),t.setSize({width:V,height:N,useMagic:d})},children:[i("div",{style:{fontSize:"22px",marginBottom:"4px"},children:H}),i("div",{style:{fontSize:"12px"},children:B}),n("div",{style:{fontSize:"0.7rem",opacity:.7},children:[C,"x",I," ",y]})]},B)})})]},e.name))]})});export{Z as a};
|