@ydesign/react-editor 0.0.5 → 0.0.7
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-7NFXXGU2.js +151 -0
- package/dist/{chunk-Y7RXJ3FI.js → chunk-E7TDNZPC.js} +1 -1
- package/dist/{chunk-2SA3ZNHH.js → chunk-IPOZDTK2.js} +2 -2
- package/dist/{chunk-H6GI5LUP.js → chunk-JHZNEX6C.js} +1 -1
- package/dist/{chunk-RUVPKBI5.js → chunk-LFWKF4C4.js} +1 -1
- package/dist/chunk-MJ4K2UVU.js +1 -0
- package/dist/chunk-NSUBGMR5.js +1 -0
- package/dist/model/store.d.ts +9 -6
- package/dist/model/store.js +1 -1
- package/dist/project.d.ts +3 -0
- package/dist/project.js +1 -1
- package/dist/side-panel/index.js +1 -1
- package/dist/side-panel/side-panel.js +1 -1
- package/dist/side-panel/size-panel.js +1 -1
- package/dist/toolbar/history-buttons.js +1 -1
- package/dist/toolbar/image-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 +30 -0
- package/dist/topbar/create-design.js +1 -0
- package/dist/topbar/file-menu.js +1 -1
- package/dist/topbar/topbar.js +5 -5
- package/package.json +4 -4
- package/dist/chunk-BDQSWJYF.js +0 -1
- package/dist/chunk-ONY3GLGA.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,)}.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\: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
|
-
`,w=()=>
|
|
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,151 @@
|
|
|
1
|
+
import{b as I,c as p}from"./chunk-5C2MNUBC.js";import{a as y}from"./chunk-MXZ6RXT3.js";import{Modal as Y,Button as ee,ColorPicker as ie,InputNumber as W,Select as te,Tooltip as ne}from"antd";import{Grid2X2 as oe,Star as se,ShoppingBag as ae,FileText as ce,Presentation as re,Share2 as le,Printer as de,ImagePlus as pe,FolderPlus as t,LockKeyholeOpen as he,LockKeyhole as me}from"lucide-react";import{useRef as xe,useState as l,useMemo as R,useCallback as h}from"react";import z from"styled-components";import{jsx as e,jsxs as a}from"react/jsx-runtime";var ge=[{key:"all",label:"\u5168\u90E8",icon:oe},{key:"common",label:"\u5E38\u7528\u5C3A\u5BF8",icon:se},{key:"ecommerce",label:"\u7535\u5546\u7269\u6599",icon:ae},{key:"office",label:"\u884C\u653F\u529E\u516C",icon:ce},{key:"presentation",label:"\u6F14\u793A\u6587\u7A3F",icon:re},{key:"social",label:"\u793E\u4EA4\u5A92\u4F53",icon:le},{key:"print",label:"\u5370\u5237\u7269\u6599",icon:de}],D=[{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"}]}],E=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
|
+
`,ue=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
|
+
`,fe=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
|
+
`,ye=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
|
+
`,d=72,v=20,b=8e3,Se=({project:M,visible:F,onClose:H,onConfirm:U})=>{let[T,$]=l("all"),B=xe(null),[o,w]=l(null),[s,k]=l(null),[c,_]=l("px"),[r,j]=l(!1),[m,O]=l(1),[x,V]=l("#ffffff"),C=R(()=>o?p({unitVal:o,dpi:d,unit:c}):0,[o,c]),S=R(()=>s?p({unitVal:s,dpi:d,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,L=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),r&&i&&i>0&&k(Math.round(i/m))},[r,m]),X=h(i=>{k(i),r&&i&&i>0&&w(Math.round(i*m))},[r,m]),K=h(()=>{!r&&o&&s&&o>0&&s>0&&O(o/s),j(i=>!i)},[r,o,s]),Z=h(i=>{if(o){let n=p({unitVal:o,dpi:d,unit:c});w(Math.round(I({px:n,dpi:d,unit:i,precious:0})))}if(s){let n=p({unitVal:s,dpi:d,unit:c});k(Math.round(I({px:n,dpi:d,unit:i,precious:0})))}_(i)},[o,s,c]),q=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)});console.log("params \u7684\u53C2\u6570 ---> ",n.toString()),console.log("project ",M.urls.editorUrl),window.open(`${M.urls.editorUrl}?${n.toString()}`,"_blank")},[P,x,S,C,c]),G=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"})},[J,Q]=l(()=>{let i={};return D.forEach(n=>{i[n.key]=n.sizes.length>6}),i});return a(Y,{title:"\u521B\u5EFA\u8BBE\u8BA1",open:F,onCancel:H,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:ge.map(i=>a("div",{"data-active":i.key===T,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===T}),onClick:()=>G(i.key),children:[e(i.icon,{size:16,className:"ml-2"}),e("span",{className:"ml-2",children:i.label})]},i.key))}),e(ue,{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(E,{onClick:()=>{alert("\u56FE\u7247\u6A21\u5F0F\u5F00\u53D1\u4E2D...")},children:[e(pe,{style:{color:"#1677ff"}}),e("span",{children:"\u6253\u5F00\u56FE\u7247"})]}),a(E,{style:{marginLeft:12},onClick:()=>{alert("psd\u5F00\u53D1\u4E2D")},children:[e(t,{style:{color:"#1677ff"}}),e("span",{children:"\u6253\u5F00PSD"})]})]}),D.map(i=>a("div",{className:y("Widget categorySection","mt-6"),"data-category-id":i.key,"data-is-folded":J[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:()=>Q(n=>({...n,[i.key]:!1})),children:e("span",{className:"text-[#616366]",children:"\u67E5\u770B\u66F4\u591A"})})]}),i.key==="common"&&a(ye,{children:[L&&e("div",{className:"sizeWarning",children:L}),a("div",{className:"Widget sizeInpueBox",children:[e("div",{className:"sizeInput",children:e(W,{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(ne,{title:r?"\u89E3\u9501\u6BD4\u4F8B":"\u9501\u5B9A\u6BD4\u4F8B",children:e("div",{className:"linkIcon",style:{cursor:"pointer"},onClick:K,children:r?e(me,{size:16}):e(he,{size:16})})}),e("div",{className:"sizeInput",children:e(W,{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(te,{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(ie,{mode:"single",format:"hex",value:x,onChange:n=>V(n.toHexString()),styles:{root:{width:98},body:{width:92}}})}),e(ee,{type:"primary",disabled:P,style:{width:98,marginLeft:12},onClick:q,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(fe,{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:()=>{U({...n,bgColor:x})},children:e("button",{type:"button",children:"\u521B\u5EFA"})})]})},f))})]},i.key))]})})})})]})};export{Se as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as R}from"./chunk-TNBL7KOG.js";import{c as k}from"./chunk-4BG4CHIB.js";import{d as S}from"./chunk-LFWKF4C4.js";import{a as N}from"./chunk-2PAJLUQH.js";import{a as w}from"./chunk-XRRO2RT7.js";import{a as H}from"./chunk-OBJ5NZSC.js";import{a as E}from"./chunk-QX7ZGRSR.js";import{a as B}from"./chunk-INRJE7VS.js";import{e as n}from"./chunk-HD2T2D4D.js";import{a as x}from"./chunk-KCNKLCD5.js";import{b as C}from"./chunk-HQSM4X2M.js";import{b as h}from"./chunk-N5KI6CPA.js";import{c as u}from"./chunk-ARZMBVXU.js";import f from"styled-components";import{useRef as Q}from"react";import{Tooltip as D,Button as G}from"antd";import{Undo2 as X,Redo2 as _}from"lucide-react";import{observer as q}from"mobx-react-lite";import{useEffect as J}from"react";import{jsx as i,jsxs as K}from"react/jsx-runtime";var P=q(({store:o})=>(J(()=>{},[o._updateHistory]),K(y,{style:{float:"left",paddingRight:10},children:[i(D,{title:u("toolbar.undo"),placement:"bottom",children:i(G,{type:"text",disabled:!o.editor?.historyHandler.canUndo(),styles:{root:{padding:"0 7px"}},onClick:()=>{o.editor?.historyHandler.undo()},children:i(X,{size:16})})}),i(D,{title:u("toolbar.redo"),placement:"bottom",children:i(G,{type:"text",disabled:!o.editor?.historyHandler.canRedo(),styles:{root:{padding:"0 7px"}},onClick:()=>{o.editor?.historyHandler.redo()},children:i(_,{size:16})})})]})));import{observer as V}from"mobx-react-lite";import{Button as z,Divider as W,Space as Y}from"antd";import{Check as Z,X as $}from"lucide-react";import{Fragment as no,jsx as e,jsxs as l}from"react/jsx-runtime";var oo=f.div`
|
|
2
2
|
white-space: nowrap;
|
|
3
3
|
|
|
4
4
|
height: 50px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as T,b,c as
|
|
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
2
|
.no-scrollbar::-webkit-scrollbar {
|
|
3
3
|
display: none;
|
|
4
4
|
}
|
|
@@ -6,4 +6,4 @@ import{a as T,b,c as m}from"./chunk-5C2MNUBC.js";import{c as s}from"./chunk-ARZM
|
|
|
6
6
|
-ms-overflow-style: none;
|
|
7
7
|
scrollbar-width: none;
|
|
8
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:
|
|
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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h}from"./chunk-OFA6JIQB.js";import{a as g}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-OFA6JIQB.js";import{a as g}from"./chunk-IPOZDTK2.js";import{a as o}from"./chunk-4HH3B3W3.js";import{a as u}from"./chunk-FGCLY24Q.js";import{a as f}from"./chunk-ISNCNIFJ.js";import{b as y}from"./chunk-NQYSJ5MN.js";import{b as P}from"./chunk-XXR5YN2B.js";import{a as x}from"./chunk-YLXPQ2GI.js";import{a as T}from"./chunk-R452ARGU.js";import{c as p,d as S}from"./chunk-WCHGSVUC.js";import{c as i}from"./chunk-ARZMBVXU.js";import r from"styled-components";import{useRef as v,useLayoutEffect as z}from"react";import{observer as a}from"mobx-react-lite";import{LayoutTemplate as L,TypeOutline as N,Image as M,Shapes as B,Upload as H,Wallpaper as I,Layers as E,ImageUpscale as R}from"lucide-react";import{clsx as U}from"clsx";import{jsx as n,jsxs as c}from"react/jsx-runtime";var $=r.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100% !important;
|
|
4
4
|
padding: 0px !important;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as C}from"./chunk-TWH7TO5J.js";import{a as k}from"./chunk-4WITBL6X.js";import{a as I}from"./chunk-YOQ663QO.js";import{a as x}from"./chunk-TYHXQPZQ.js";import{b as v}from"./chunk-3TO57JPN.js";import{a as b}from"./chunk-CB23VFSC.js";import{a as l}from"./chunk-MXZ6RXT3.js";import{a as u,b as f}from"./chunk-YRJUN267.js";import{b as y}from"./chunk-DCGJ6RKU.js";import{k as d,l as h}from"./chunk-7NNOHYKX.js";import{c}from"./chunk-ARZMBVXU.js";import{observer as m}from"mobx-react-lite";import{Button as p,Tooltip as P,Popover as S}from"antd";import{Crop as w}from"lucide-react";import F from"styled-components";import{jsx as o}from"react/jsx-runtime";var B=Object.keys(d),E=[{width:300,height:300,fill:"lightgray",stroke:"#0c0c0c",strokeWidth:0,url:""}],T=[];B.forEach(t=>{E.forEach(e=>{T.push(Object.assign({subType:t},e))})});T.forEach(t=>{t.url=b(h(t))});var R=F.div`
|
|
2
2
|
height: 220px;
|
|
3
3
|
`,g={root:{padding:"0 7px"}},H=m(({element:t,store:e})=>o(p,{type:"text",styles:g,onClick:async()=>{let i=e.width+2*e.bleed,s=e.height+2*e.bleed,r=t.getOriginalSize(),a={width:r.width,height:r.height},n=v({width:i,height:s},a);t.set({cropX:n.cropX,cropY:n.cropY,width:n.width,height:n.height,scaleX:i/n.width,scaleY:s/n.height,left:-e.bleed,top:-e.bleed}),t.setCoords(),e.editor?.customCanvas?.canvas?.requestRenderAll()},children:c("toolbar.fitToBackground")})),U=m(({element:t,store:e})=>o(P,{title:c("toolbar.crop"),children:o(p,{type:"text",styles:{root:{padding:"0 7px"}},onClick:()=>{let i=e.editor?.layerHandler.getLayer();e.editor?.imageCropHandler.cropStart(t,i,t.getSrc())},children:o(w,{size:16})})})),L=m(({element:t,store:e})=>{let i=y.reduce((r,a)=>r.concat(a.children),[]),s=Math.ceil(i.length/4)||1;return t.clipPath?o(p,{type:"text",styles:g,onClick:()=>{t.set({clipPath:null}),e.editor?.customCanvas?.canvas?.requestRenderAll(),e._triggerUpdate()},children:c("toolbar.removeClip")}):o(S,{styles:{container:{padding:"5px 10px"}},content:o("div",{style:{maxHeight:313,overflowY:"auto"},children:o(R,{style:{height:80*s,width:300},children:o("div",{className:l("shape-list","flex flex-wrap content-start mb-2"),children:i.map((r,a)=>o("div",{className:l("shape-item","w-[25%] h-0 pb-[25%] relative cursor-pointer shrink-0 mb-[1.2%]"),onClick:()=>{e.editor?.objectsHandler.createMaskElement(t,r),e._triggerUpdate()},children:o("div",{className:l("shape-content","absolute inset-0 flex justify-center items-center"),children:o("svg",{overflow:"visible",width:"50",height:"50",children:o("g",{transform:`scale(${50/r.viewBox[0]}, ${50/r.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`,children:o("path",{className:"shape-path",d:r.path,fill:"#ccc",strokeMiterlimit:8,strokeLinecap:"butt"})})})})},a))})})}),trigger:"click",children:o(p,{type:"text",styles:g,children:c("toolbar.clip")})})}),Y={ImageFlip:x,ImageFilters:I,ImageFitToBackground:H,ImageCrop:U,ImageClip:L,ImageRemoveBackground:k,ImageEraserPen:C},A=m(({store:t,components:e})=>{let i=t.selectedElements,r=u({type:"text",usedItems:["ImageFlip","ImageFilters","ImageFitToBackground","ImageClip","ImageCrop","ImageRemoveBackground","ImageEraserPen"],components:e});return o(f,{items:r,itemRender:a=>{let n=e[a]||Y[a];return n&&o(n,{elements:i,element:i[0],store:t},a)}})}),V=A;export{H as a,U as b,L as c,A as d,V as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as s}from"./chunk-WJT6VPDR.js";import{a as t}from"./chunk-O2XFH626.js";import*as a from"mobx";import{createContext as i,useContext as c}from"react";var l=r=>{try{return localStorage.getItem(r)}catch{return null}},g=(r,e)=>{try{localStorage.setItem(r,e)}catch{}},o=class{constructor({store:e}){t(this,"store");t(this,"id","");t(this,"name","");t(this,"user",{});t(this,"skipSaving",!1);t(this,"cloudEnabled",!1);t(this,"status","saved");t(this,"language",l("ydesign-language")||navigator.language||"en");t(this,"designsLength",0);t(this,"urls",{editorUrl:"/design"});a.makeAutoObservable(this),this.store=e}setLanguage(e){this.language=e,g("ydesign-language",e)}requestSave(){}async firstLoad(e){this.store.loadJSON(e)}async loadById(e){console.log("loadById",e)}updateUrlWithProjectId(){if(!this.id||this.id==="local"){window.history.replaceState({},"","/");return}let e=new URL(window.location.href);new URLSearchParams(e.search).set("id",this.id),window.history.replaceState({},"",`/design/${this.id}`)}async save(){}async getGlobalFont(e){return e?.length?(s(e),e):[]}},u=i(null),m=()=>{let r=c(u);if(!r)throw new Error("useProject must be used within a ProjectProvider");return r},d=r=>new o(r),h=d;export{u as a,m as b,d as c,h as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l}from"./chunk-7NFXXGU2.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:o})=>{let[g,r]=k(!1),c=[{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:()=>{o.setLanguage("en")},extra:o.language==="en"?e(s,{size:16}):null},{key:"zh",label:"\u4E2D\u6587",onClick:()=>{o.setLanguage("zh")},extra:o.language==="zh"?e(s,{size:16}):null}]}];return S(C,{children:[e(m,{menu:{items:c,onClick:({key:t})=>{t==="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:t=>{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 ---> ",t);let p=JSON.stringify({bg:{backgroundColor:t.bgColor}}),i=new URLSearchParams({create:"",createEmptyPoster:"true",createInfo:p,height:String(t.height),unit:t.unit,width:String(t.width)});console.log("params \u7684\u53C2\u6570 ---> ",i.toString()),console.log("\u9700\u8981\u8DF3\u8F6C\u7684\u7F16\u8F91\u5668\u5730\u5740",o.urls.editorUrl),window.open(`${o.urls.editorUrl}?${i.toString()}`,"_blank")}})},store:a,project:o})]})});export{D as a};
|
package/dist/model/store.d.ts
CHANGED
|
@@ -84,10 +84,11 @@ declare const Store: mobx_state_tree.IModelType<{
|
|
|
84
84
|
_historyUpdate(): void;
|
|
85
85
|
_fontSizeUpdate(): void;
|
|
86
86
|
} & {
|
|
87
|
+
setBackgroundColor(color: string | Record<string, any>): void;
|
|
87
88
|
set(e: FabricObject, options: any): void;
|
|
88
89
|
setUnit({ unit, dpi }: {
|
|
89
90
|
unit: any;
|
|
90
|
-
dpi
|
|
91
|
+
dpi?: any;
|
|
91
92
|
}): void;
|
|
92
93
|
setObjects(objects: any): void;
|
|
93
94
|
selectElements(ids: string[]): void;
|
|
@@ -96,7 +97,7 @@ declare const Store: mobx_state_tree.IModelType<{
|
|
|
96
97
|
setScale(scale: number): void;
|
|
97
98
|
clone(): void;
|
|
98
99
|
addElement(options: any): void;
|
|
99
|
-
setSize({ width, height
|
|
100
|
+
setSize({ width, height }: {
|
|
100
101
|
width: number;
|
|
101
102
|
height: number;
|
|
102
103
|
useMagic?: boolean;
|
|
@@ -184,10 +185,11 @@ declare function createStore({ key }: StoreProps): mobx_state_tree.ModelInstance
|
|
|
184
185
|
_historyUpdate(): void;
|
|
185
186
|
_fontSizeUpdate(): void;
|
|
186
187
|
} & {
|
|
188
|
+
setBackgroundColor(color: string | Record<string, any>): void;
|
|
187
189
|
set(e: FabricObject, options: any): void;
|
|
188
190
|
setUnit({ unit, dpi }: {
|
|
189
191
|
unit: any;
|
|
190
|
-
dpi
|
|
192
|
+
dpi?: any;
|
|
191
193
|
}): void;
|
|
192
194
|
setObjects(objects: any): void;
|
|
193
195
|
selectElements(ids: string[]): void;
|
|
@@ -196,7 +198,7 @@ declare function createStore({ key }: StoreProps): mobx_state_tree.ModelInstance
|
|
|
196
198
|
setScale(scale: number): void;
|
|
197
199
|
clone(): void;
|
|
198
200
|
addElement(options: any): void;
|
|
199
|
-
setSize({ width, height
|
|
201
|
+
setSize({ width, height }: {
|
|
200
202
|
width: number;
|
|
201
203
|
height: number;
|
|
202
204
|
useMagic?: boolean;
|
|
@@ -279,10 +281,11 @@ declare function createStore({ key }: StoreProps): mobx_state_tree.ModelInstance
|
|
|
279
281
|
_historyUpdate(): void;
|
|
280
282
|
_fontSizeUpdate(): void;
|
|
281
283
|
} & {
|
|
284
|
+
setBackgroundColor(color: string | Record<string, any>): void;
|
|
282
285
|
set(e: FabricObject, options: any): void;
|
|
283
286
|
setUnit({ unit, dpi }: {
|
|
284
287
|
unit: any;
|
|
285
|
-
dpi
|
|
288
|
+
dpi?: any;
|
|
286
289
|
}): void;
|
|
287
290
|
setObjects(objects: any): void;
|
|
288
291
|
selectElements(ids: string[]): void;
|
|
@@ -291,7 +294,7 @@ declare function createStore({ key }: StoreProps): mobx_state_tree.ModelInstance
|
|
|
291
294
|
setScale(scale: number): void;
|
|
292
295
|
clone(): void;
|
|
293
296
|
addElement(options: any): void;
|
|
294
|
-
setSize({ width, height
|
|
297
|
+
setSize({ width, height }: {
|
|
295
298
|
width: number;
|
|
296
299
|
height: number;
|
|
297
300
|
useMagic?: boolean;
|
package/dist/model/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u}from"../chunk-P5I43V7X.js";import{a as l,h as
|
|
1
|
+
import{a as u}from"../chunk-P5I43V7X.js";import{a as l,h as g,i as p,m}from"../chunk-WJT6VPDR.js";import"../chunk-O2XFH626.js";import{types as i,cast as y,flow as b,destroy as f}from"mobx-state-tree";var c=(e,t)=>{if(e?.objects)for(let r of e.objects){if(t(r)===!0)break;c(r,t)}},h=i.model("Font",{fontFamily:i.string,name:i.optional(i.string,""),url:i.optional(i.string,""),img:i.optional(i.string,""),styles:i.frozen()}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{fontFamily:e.fontFamily||e.name})),E=i.model("Store",{name:"yitu-design",width:1080,height:1080,scale:1,scaleToFit:1,unit:"px",dpi:72,bleed:0,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",selectedElementsIds:i.array(i.string),backgroundColor:i.optional(i.union(i.string,i.frozen()),"#fff"),fonts:i.array(h),editor:i.frozen(null),custom:i.frozen(),objects:i.frozen([]),_key:"",_updateTrigger:0,_updateHistory:0,_updateFontSize:0}).views(e=>({get selectedElements(){let t=e._updateTrigger;return console.log("_trigger\u90FD\u53D8\u5316\u662F\u89E6\u53D1\u805A\u7126\u5143\u7D20\u7684\u5237\u65B0 ---> ",t,e.selectedElementsIds.toJSON()),e.selectedElementsIds.map(r=>e.editor?.objectsHandler.findOneById(r))}})).views(e=>({get selectedShapes(){let t=[];return c({objects:e.selectedElements},r=>{r?.type!=="group"&&t.push(r)}),t},find(t){let r,a=e.editor?.customCanvas.canvas.getObjects();if(a)return c({objects:a},o=>{if(!r&&t(o))return r=o,!0}),r},getElementById(){}})).actions(e=>({_setEditor(t){e.editor=t},_triggerUpdate(){e._updateTrigger=e._updateTrigger+1},_historyUpdate(){e._updateHistory=e._updateHistory+1},_fontSizeUpdate(){e._updateFontSize=e._updateFontSize+1}})).actions(e=>({setBackgroundColor(t){e.backgroundColor=t,e.editor?.workareaHandler.setWorkareaBgColor(t)},set(t,r){e.editor?.objectsHandler.update(r,t.id)},setUnit({unit:t,dpi:r}){e.unit=t||e.unit,e.dpi=r||e.dpi},setObjects(t){e.objects=t},selectElements(t){e.selectedElementsIds=y(t)},openSidePanel(t){e.openedSidePanel!==t&&(e.openedSidePanel=t)},deleteElements(t){t.forEach(r=>{e.editor?.objectsHandler.remove(r)})},setScale(t){e.scale=t},clone(){e.editor?.objectsHandler.clone()},addElement(t){console.log("\u6DFB\u52A0json\u6570\u636E",t),e.editor?.objectsHandler.addJson(t)},setSize({width:t,height:r}){e.width=t,e.height=r,e.editor?.workareaHandler.setSize({width:t,height:r})},setupEditorListeners(){e.editor&&(e.editor.on("object:modified",()=>{e._triggerUpdate()}),e.editor.on("history:change",()=>{e._historyUpdate()}),e.editor.on("textbox:modified",()=>{e._fontSizeUpdate()}))}})).actions(e=>({_forEachElementUp(t,r){if(!e.editor)return;let a=e.editor.layerHandler.getEffectiveLayers(),o=t.map(n=>({id:n,index:a.findIndex(d=>d.id===n)}));o.sort((n,d)=>d.index-n.index);for(let{index:n}of o){if(n==-1)continue;let d=n<a.length-1&&a[n+1],s=t.indexOf(d?.id)>=0;n===a.length-1||s||r(n)}},_forEachElementDown(t,r){if(!e.editor)return;let a=e.editor.layerHandler.getEffectiveLayers(),o=t.map(n=>({id:n,index:a.findIndex(d=>d.id===n)}));o.sort((n,d)=>d.index-n.index);for(let{index:n}of o){if(n==-1)continue;let d=n>0&&a[n-1],s=t.indexOf(d?.id)>=0;n===0||s||r(n)}return!1}})).actions(e=>({canMoveElementsUp(t){let r=!1;return e._forEachElementUp(t,()=>{r=!0}),r},moveElementsUp(t){if(!e.editor)return;let r=e.editor.layerHandler.getEffectiveLayers();[...t].map(o=>({id:o,index:r.findIndex(n=>n.id===o)})).filter(o=>o.index!==-1).sort((o,n)=>n.index-o.index).map(o=>o.id).forEach(o=>{e.editor?.layerHandler.bringForward(o)}),e._triggerUpdate()},canMoveElementsTop(t){return this.canMoveElementsUp(t)},moveElementsTop(t){e.editor&&(t.forEach(r=>{e.editor?.layerHandler.bringToFront(r)}),e._triggerUpdate())},canMoveElementsDown(t){let r=!1;return e._forEachElementDown(t,()=>{r=!0}),r},moveElementsDown(t){if(!e.editor)return;let r=e.editor.layerHandler.getEffectiveLayers();[...t].map(o=>({id:o,index:r.findIndex(n=>n.id===o)})).filter(o=>o.index!==-1).sort((o,n)=>o.index-n.index).map(o=>o.id).forEach(o=>{e.editor?.layerHandler.sendBackwards(o)}),e._triggerUpdate()},canMoveElementsBottom(t){return this.canMoveElementsDown(t)},moveElementsBottom(t){e.editor&&(t.forEach(r=>{e.editor?.layerHandler.sendToBack(r)}),e._triggerUpdate())},setElementZIndex(){}})).actions(e=>({async toDataURL(t){return e.editor?.rendererHandler.toDataURL(t)},async toBlob(t){return e.editor?.rendererHandler.toBlob(t)},async saveAsImage(t){if(!e.editor)return;let{fileName:r,...a}=t||{multiplier:1},o=await e.editor.rendererHandler.toBlob(a);o&&u(o,r||"yitu."+a.format)},toJSON(){return e.editor?.rendererHandler.toJSON()},toObject(){return e.editor?.rendererHandler.toObject()},loadJSON:b(function*(t){if(!e.editor)return;let r=yield e.editor.sceneHandler.importFromJSON(t);r&&(e.width=r.width,e.height=r.height,e.backgroundColor=r.fill)}),clear(){}})).actions(e=>({removeFont(t){e.fonts.filter(r=>r.fontFamily===t).forEach(r=>{f(r)})},addFont(t){this.removeFont(t.fontFamily),e.fonts.push(t),this.loadFont(t.fontFamily)},async loadFont(t){let r=e.fonts.find(n=>n.fontFamily===t)||l.find(n=>n.fontFamily===t),o=[{fontStyle:"normal",fontWeight:"normal"},{fontStyle:"normal",fontWeight:"bold"}];return r?(r.styles&&(o=r.styles.map(n=>({fontStyle:n.fontStyle||"normal",fontWeight:n.fontWeight||"normal"}))),p(r)):m(t),Promise.all(o.map(n=>g(t,n.fontStyle,n.fontWeight)))}}));function x({key:e}){return E.create({_key:e})}var v=x;export{h as Font,E as Store,x as createStore,v as default,c as forEveryChild};
|
package/dist/project.d.ts
CHANGED
package/dist/project.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-
|
|
1
|
+
import{a,b,c,d}from"./chunk-MJ4K2UVU.js";import"./chunk-WJT6VPDR.js";import"./chunk-O2XFH626.js";export{a as ProjectContext,c as createProject,d as default,b as useProject};
|
package/dist/side-panel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,b as e,c as f,d as m,e as p,f as t,g as x,h as a,i as b,j as c}from"../chunk-
|
|
1
|
+
import{a as r,b as e,c as f,d as m,e as p,f as t,g as x,h as a,i as b,j as c}from"../chunk-JHZNEX6C.js";import"../chunk-OFA6JIQB.js";import"../chunk-IPOZDTK2.js";import{a as o}from"../chunk-4HH3B3W3.js";import"../chunk-FGCLY24Q.js";import"../chunk-ISNCNIFJ.js";import"../chunk-NQYSJ5MN.js";import"../chunk-5C2MNUBC.js";import"../chunk-MXZ6RXT3.js";import"../chunk-XXR5YN2B.js";import"../chunk-N5KI6CPA.js";import"../chunk-YRJUN267.js";import"../chunk-RVXI723F.js";import"../chunk-OQ6HU62L.js";import"../chunk-YLXPQ2GI.js";import"../chunk-4LUZF4CB.js";import"../chunk-R452ARGU.js";import"../chunk-FOMWIGAQ.js";import"../chunk-WCHGSVUC.js";import"../chunk-DCGJ6RKU.js";import"../chunk-7NNOHYKX.js";import"../chunk-ARZMBVXU.js";import"../chunk-O2XFH626.js";export{t as BackgroundSection,b as DEFAULT_SECTIONS,x as LayersSection,f as PhotosSection,o as SectionTab,m as ShapesSection,c as SidePanel,a as SizeSection,r as TemplatesSection,e as TextSection,p as UploadSection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l}from"../chunk-
|
|
1
|
+
import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l}from"../chunk-JHZNEX6C.js";import"../chunk-OFA6JIQB.js";import"../chunk-IPOZDTK2.js";import{a}from"../chunk-4HH3B3W3.js";import"../chunk-FGCLY24Q.js";import"../chunk-ISNCNIFJ.js";import"../chunk-NQYSJ5MN.js";import"../chunk-5C2MNUBC.js";import"../chunk-MXZ6RXT3.js";import"../chunk-XXR5YN2B.js";import"../chunk-N5KI6CPA.js";import"../chunk-YRJUN267.js";import"../chunk-RVXI723F.js";import"../chunk-OQ6HU62L.js";import"../chunk-YLXPQ2GI.js";import"../chunk-4LUZF4CB.js";import"../chunk-R452ARGU.js";import"../chunk-FOMWIGAQ.js";import"../chunk-WCHGSVUC.js";import"../chunk-DCGJ6RKU.js";import"../chunk-7NNOHYKX.js";import"../chunk-ARZMBVXU.js";import"../chunk-O2XFH626.js";export{g as BackgroundSection,j as DEFAULT_SECTIONS,h as LayersSection,d as PhotosSection,a as SectionTab,e as ShapesSection,k as SidePanel,i as SizeSection,b as TemplatesSection,c as TextSection,f as UploadSection,l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-IPOZDTK2.js";import"../chunk-5C2MNUBC.js";import"../chunk-ARZMBVXU.js";import"../chunk-O2XFH626.js";export{a as SizePanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as a}from"../chunk-
|
|
1
|
+
import{e as a}from"../chunk-E7TDNZPC.js";import"../chunk-TNBL7KOG.js";import"../chunk-4BG4CHIB.js";import"../chunk-OA7Z7HNL.js";import"../chunk-LFWKF4C4.js";import"../chunk-TWH7TO5J.js";import"../chunk-4WITBL6X.js";import"../chunk-2PAJLUQH.js";import"../chunk-XRRO2RT7.js";import"../chunk-OBJ5NZSC.js";import"../chunk-QX7ZGRSR.js";import"../chunk-INRJE7VS.js";import"../chunk-HD2T2D4D.js";import"../chunk-YOQ663QO.js";import"../chunk-TYHXQPZQ.js";import"../chunk-KCNKLCD5.js";import"../chunk-3TO57JPN.js";import"../chunk-CB23VFSC.js";import"../chunk-HQSM4X2M.js";import"../chunk-IUFYYEGO.js";import"../chunk-MXZ6RXT3.js";import"../chunk-N5KI6CPA.js";import"../chunk-YRJUN267.js";import"../chunk-RVXI723F.js";import"../chunk-OQ6HU62L.js";import"../chunk-WCHGSVUC.js";import"../chunk-DCGJ6RKU.js";import"../chunk-7NNOHYKX.js";import"../chunk-ARZMBVXU.js";import"../chunk-WJT6VPDR.js";import"../chunk-JMIN2XMC.js";import"../chunk-75WC3GVB.js";import"../chunk-O2XFH626.js";export{a as HistoryButtons};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e}from"../chunk-LFWKF4C4.js";import"../chunk-TWH7TO5J.js";import"../chunk-4WITBL6X.js";import"../chunk-YOQ663QO.js";import"../chunk-TYHXQPZQ.js";import"../chunk-3TO57JPN.js";import"../chunk-CB23VFSC.js";import"../chunk-MXZ6RXT3.js";import"../chunk-YRJUN267.js";import"../chunk-WCHGSVUC.js";import"../chunk-DCGJ6RKU.js";import"../chunk-7NNOHYKX.js";import"../chunk-ARZMBVXU.js";import"../chunk-O2XFH626.js";export{c as ImageClip,b as ImageCrop,a as ImageFitToBackground,d as ImageToolbar,e as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
import { StoreType } from '../model/store.js';
|
|
@@ -10,7 +10,7 @@ import '@ydesign/core';
|
|
|
10
10
|
import '../utils/fonts.js';
|
|
11
11
|
import 'mobx';
|
|
12
12
|
|
|
13
|
-
declare const NavBarGroup:
|
|
13
|
+
declare const NavBarGroup: node_modules_styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
14
14
|
declare function registerToolbarComponent(type: string, reactComponent: any): void;
|
|
15
15
|
type ToolbarProps = {
|
|
16
16
|
store: StoreType;
|
package/dist/toolbar/toolbar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"../chunk-
|
|
1
|
+
import{a,b,c,d}from"../chunk-E7TDNZPC.js";import"../chunk-TNBL7KOG.js";import"../chunk-4BG4CHIB.js";import"../chunk-OA7Z7HNL.js";import"../chunk-LFWKF4C4.js";import"../chunk-TWH7TO5J.js";import"../chunk-4WITBL6X.js";import"../chunk-2PAJLUQH.js";import"../chunk-XRRO2RT7.js";import"../chunk-OBJ5NZSC.js";import"../chunk-QX7ZGRSR.js";import"../chunk-INRJE7VS.js";import"../chunk-HD2T2D4D.js";import"../chunk-YOQ663QO.js";import"../chunk-TYHXQPZQ.js";import"../chunk-KCNKLCD5.js";import"../chunk-3TO57JPN.js";import"../chunk-CB23VFSC.js";import"../chunk-HQSM4X2M.js";import"../chunk-IUFYYEGO.js";import"../chunk-MXZ6RXT3.js";import"../chunk-N5KI6CPA.js";import"../chunk-YRJUN267.js";import"../chunk-RVXI723F.js";import"../chunk-OQ6HU62L.js";import"../chunk-WCHGSVUC.js";import"../chunk-DCGJ6RKU.js";import"../chunk-7NNOHYKX.js";import"../chunk-ARZMBVXU.js";import"../chunk-WJT6VPDR.js";import"../chunk-JMIN2XMC.js";import"../chunk-75WC3GVB.js";import"../chunk-O2XFH626.js";export{a as NavBarGroup,c as Toolbar,d as default,b as registerToolbarComponent};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { StoreType } from '../model/store.js';
|
|
3
|
+
import { ProjectType } from '../project.js';
|
|
4
|
+
import 'fabric';
|
|
5
|
+
import 'mobx-state-tree/dist/internal';
|
|
6
|
+
import 'mobx-state-tree';
|
|
7
|
+
import '@ydesign/core';
|
|
8
|
+
import '../utils/fonts.js';
|
|
9
|
+
import 'mobx';
|
|
10
|
+
import 'react';
|
|
11
|
+
|
|
12
|
+
type Size = {
|
|
13
|
+
name: string;
|
|
14
|
+
desc: string;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
unit: string;
|
|
18
|
+
bgColor?: string;
|
|
19
|
+
};
|
|
20
|
+
interface CreateDesignProps {
|
|
21
|
+
store: StoreType;
|
|
22
|
+
project: ProjectType;
|
|
23
|
+
visible: boolean;
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
onConfirm: (size: Size) => void;
|
|
26
|
+
mode?: 'create' | 'open';
|
|
27
|
+
}
|
|
28
|
+
declare const CreateDesign: ({ project, visible, onClose, onConfirm }: CreateDesignProps) => react_jsx_runtime.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { CreateDesign };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../chunk-7NFXXGU2.js";import"../chunk-5C2MNUBC.js";import"../chunk-MXZ6RXT3.js";import"../chunk-O2XFH626.js";export{a as CreateDesign};
|
package/dist/topbar/file-menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-NSUBGMR5.js";import"../chunk-7NFXXGU2.js";import"../chunk-5C2MNUBC.js";import"../chunk-MXZ6RXT3.js";import"../chunk-ARZMBVXU.js";import"../chunk-O2XFH626.js";export{a as FileMenu};
|
package/dist/topbar/topbar.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as l}from"../chunk-HQSM4X2M.js";import{a as d}from"../chunk-NSUBGMR5.js";import"../chunk-7NFXXGU2.js";import{b as r}from"../chunk-5C2MNUBC.js";import"../chunk-MXZ6RXT3.js";import{c as n}from"../chunk-ARZMBVXU.js";import{b as p}from"../chunk-MJ4K2UVU.js";import"../chunk-WJT6VPDR.js";import"../chunk-O2XFH626.js";import o from"styled-components";import{observer as s}from"mobx-react-lite";import{Input as m,Tooltip as c,Button as f}from"antd";import{CloudUpload as g}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";var h=o("div")`
|
|
2
2
|
white-space: nowrap;
|
|
3
3
|
height: 50px;
|
|
4
4
|
padding: 0 15px;
|
|
@@ -11,18 +11,18 @@ import{a as d}from"../chunk-BDQSWJYF.js";import{a as p}from"../chunk-HQSM4X2M.js
|
|
|
11
11
|
overflow-y: hidden;
|
|
12
12
|
max-width: 100vw;
|
|
13
13
|
}
|
|
14
|
-
`,
|
|
14
|
+
`,v=o("div")`
|
|
15
15
|
@media screen and (max-width: 500px) {
|
|
16
16
|
display: flex;
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,x=o("div")`
|
|
19
19
|
float: left;
|
|
20
20
|
display: flex;
|
|
21
21
|
align-items: center;
|
|
22
22
|
height: 50px;
|
|
23
|
-
`,
|
|
23
|
+
`,y=o("div")`
|
|
24
24
|
float: right;
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
27
|
height: 50px;
|
|
28
|
-
`,
|
|
28
|
+
`,u=s(({project:e})=>(console.log(e.status),t(c,{title:"\u4FDD\u5B58\u4F5C\u56FE\u8BB0\u5F55",children:t(f,{type:"text",style:{marginLeft:14},icon:t(g,{size:16,style:{display:"flex"}}),children:"Save"})}))),z=s(({store:e})=>{let a=p();return t(h,{className:"topbar border-b-1 border-b-gray-200",children:i(v,{children:[i(x,{children:[i("div",{style:{display:"flex",alignItems:"center",gap:10,paddingRight:16,paddingLeft:16,userSelect:"none"},children:[t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("rect",{width:"20",height:"20",fill:"rgb(22, 119, 255)"})}),t("span",{style:{fontWeight:500,fontSize:20,lineHeight:"100%",letterSpacing:.25},children:"Ydesign"})]}),t(d,{store:e,project:a}),t("div",{style:{paddingLeft:10,maxWidth:200},children:t(m,{placeholder:n("topbar.editableTextPlaceholder")})}),i("div",{style:{paddingLeft:16,fontSize:14},className:"text-gray-600",children:[r({px:e.width,unit:e.unit,dpi:e.dpi,precious:0})," x"," ",r({px:e.height,unit:e.unit,dpi:e.dpi,precious:0})," ",e.unit]}),t(u,{project:a})]}),t(y,{children:t(l,{store:e})})]})})});export{z as Topbar};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ydesign/react-editor",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "设计编辑器UI组件库,基于react版本",
|
|
5
5
|
"main": "dist/app.js",
|
|
6
6
|
"module": "dist/app.js",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"antd": "^6.
|
|
103
|
+
"antd": "^6.3.1",
|
|
104
104
|
"clsx": "^2.1.1",
|
|
105
105
|
"es-toolkit": "^1.44.0",
|
|
106
106
|
"lucide-react": "^0.553.0",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"tailwind-merge": "^3.3.1",
|
|
115
115
|
"tailwindcss": "^4.1.17",
|
|
116
116
|
"tw-animate-css": "^1.4.0",
|
|
117
|
-
"@ydesign/core": "^0.0.
|
|
117
|
+
"@ydesign/core": "^0.0.6"
|
|
118
118
|
},
|
|
119
119
|
"browserslist": [
|
|
120
120
|
"> 0.5%",
|
|
@@ -125,6 +125,6 @@
|
|
|
125
125
|
"scripts": {
|
|
126
126
|
"dev": "tsup --watch",
|
|
127
127
|
"build": "tsup",
|
|
128
|
-
"
|
|
128
|
+
"prepublish": "pnpm build"
|
|
129
129
|
}
|
|
130
130
|
}
|
package/dist/chunk-BDQSWJYF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as m}from"./chunk-ARZMBVXU.js";import{Dropdown as T,Button as c,Modal as D,Input as b,Select as B}from"antd";import{Menu as L,Plus as j,Grid2X2 as F,Star as H,ShoppingBag as f,FileText as O,Presentation as W,Share2 as _,Printer as q,Link2 as A,Image as E,FileImage as G,Smartphone as U,Monitor as X,Square as $,Languages as J,Check as y}from"lucide-react";import{useState as l}from"react";import{observer as K}from"mobx-react-lite";import{Fragment as R,jsx as t,jsxs as i}from"react/jsx-runtime";var Q=[{key:"all",label:"\u5168\u90E8",icon:F},{key:"common",label:"\u5E38\u7528\u5C3A\u5BF8",icon:H},{key:"ecommerce",label:"\u7535\u5546\u7269\u6599",icon:f},{key:"office",label:"\u884C\u653F\u529E\u516C",icon:O},{key:"presentation",label:"\u6F14\u793A\u6587\u7A3F",icon:W},{key:"social",label:"\u793E\u4EA4\u5A92\u4F53",icon:_},{key:"print",label:"\u5370\u5237\u7269\u6599",icon:q}],v=[{name:"\u7535\u5546\u4E3B\u56FE\uFF081:1\uFF09",width:1440,height:1440,unit:"px"},{name:"\u7535\u5546\u4E3B\u56FE\uFF081:1\uFF09",width:800,height:800,unit:"px"},{name:"\u624B\u673A\u6D77\u62A5",width:1242,height:2208,unit:"px"},{name:"\u5C0F\u7EA2\u4E66\u5C01\u9762",width:1242,height:1656,unit:"px"},{name:"\u7AD6\u7248\u89C6\u9891\u5C01\u9762",width:1080,height:1920,unit:"px"},{name:"PPT\uFF0816:9\uFF09",width:1920,height:1080,unit:"px"}],ie=K(({store:h,project:o})=>{let[w,r]=l(!1),[k,N]=l("all"),[n,u]=l(800),[s,g]=l(800),[d,C]=l("px"),z=[{label:m("topbar.newDesign"),key:"new_design",icon:t(j,{size:16})},{label:m("topbar.language"),key:"language",icon:t("div",{style:{height:22,display:"flex",alignItems:"center"},children:t(J,{size:16})}),children:[{key:"en",label:"English",onClick:()=>{o.setLanguage("en")},extra:o.language==="en"?t(y,{size:16}):null},{key:"zh",label:"\u4E2D\u6587",onClick:()=>{o.setLanguage("zh")},extra:o.language==="zh"?t(y,{size:16}):null}]}],M=({key:e})=>{e==="new_design"&&r(!0)},S=()=>{let e=n,a=s;d==="mm"?(e=Math.round(n*3.7795275591),a=Math.round(s*3.7795275591)):d==="cm"&&(e=Math.round(n*37.795275591),a=Math.round(s*37.795275591)),h.setSize({width:e,height:a}),r(!1)},p=e=>{let a=e.width,x=e.height;e.unit==="mm"&&(a=Math.round(e.width*3.7795275591),x=Math.round(e.height*3.7795275591)),h.setSize({width:a,height:x}),r(!1)},P=()=>{r(!1)},I=()=>{u(s),g(n)};return i(R,{children:[t(T,{menu:{items:z,onClick:M},trigger:["click"],styles:{root:{width:188}},children:t(c,{type:"text",children:t(L,{size:16})})}),t(D,{title:"\u521B\u5EFA\u8BBE\u8BA1",open:w,onCancel:P,footer:null,maskClosable:!1,width:840,styles:{container:{height:540,overflow:"hidden"},body:{height:488}},children:i("div",{className:"flex",style:{padding:"16px 0px 0px 0px",height:"100%"},children:[t("div",{className:"w-40 border-r border-gray-100 pr-2",children:Q.map(e=>{let a=e.icon;return i("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg cursor-pointer mb-1 ${k===e.key?"bg-blue-500 text-white":"hover:bg-gray-100"}`,onClick:()=>N(e.key),children:[t(a,{size:16}),t("span",{className:"text-sm",children:e.label})]},e.key)})}),i("div",{className:"flex-1 pl-6 overflow-y-auto",children:[i("div",{className:"flex gap-4 mb-6",children:[i("div",{className:"flex-1 flex items-center gap-2 px-4 py-3 border border-gray-200 rounded-lg cursor-pointer hover:border-blue-400",children:[t(E,{size:20,className:"text-blue-500"}),t("span",{children:"\u6253\u5F00\u56FE\u7247"})]}),i("div",{className:"flex-1 flex items-center gap-2 px-4 py-3 border border-gray-200 rounded-lg cursor-pointer hover:border-blue-400",children:[t(G,{size:20,className:"text-blue-500"}),t("span",{children:"\u6253\u5F00PSD"})]})]}),i("div",{className:"mb-6",children:[t("h3",{className:"text-base font-medium mb-3",children:"\u5E38\u7528\u5C3A\u5BF8"}),i("div",{className:"flex items-center gap-2 mb-4",children:[t(b,{type:"number",value:n,onChange:e=>u(Number(e.target.value)),suffix:"\u5BBD",style:{width:100}}),t(c,{type:"text",icon:t(A,{size:16}),onClick:I}),t(b,{type:"number",value:s,onChange:e=>g(Number(e.target.value)),suffix:"\u9AD8",style:{width:100}}),t(B,{value:d,onChange:C,style:{width:100},options:[{value:"px",label:"px \u50CF\u7D20"},{value:"mm",label:"mm \u6BEB\u7C73"},{value:"cm",label:"cm \u5398\u7C73"}]}),t(c,{type:"primary",onClick:S,children:"\u521B\u5EFA"})]}),t("div",{className:"grid grid-cols-6 gap-3",children:v.map((e,a)=>i("div",{className:"flex flex-col items-center p-3 border border-gray-200 rounded-lg cursor-pointer hover:border-blue-400 hover:shadow-sm",onClick:()=>p(e),children:[t("div",{className:"w-10 h-10 flex items-center justify-center mb-2 text-gray-400",children:e.width===e.height?t($,{size:24}):e.width<e.height?t(U,{size:24}):t(X,{size:24})}),t("span",{className:"text-xs text-center text-gray-700",children:e.name}),i("span",{className:"text-xs text-gray-400",children:[e.width,"*",e.height," ",e.unit]})]},a))})]}),i("div",{children:[i("div",{className:"flex items-center justify-between mb-3",children:[t("h3",{className:"text-base font-medium",children:"\u7535\u5546\u7269\u6599"}),t("span",{className:"text-sm text-blue-500 cursor-pointer hover:underline",children:"\u67E5\u770B\u66F4\u591A >"})]}),t("div",{className:"grid grid-cols-6 gap-3",children:v.slice(0,4).map((e,a)=>i("div",{className:"flex flex-col items-center p-3 border border-gray-200 rounded-lg cursor-pointer hover:border-blue-400 hover:shadow-sm",onClick:()=>p(e),children:[t("div",{className:"w-10 h-10 flex items-center justify-center mb-2 text-gray-400",children:t(f,{size:24})}),t("span",{className:"text-xs text-center text-gray-700",children:e.name}),i("span",{className:"text-xs text-gray-400",children:[e.width,"*",e.height," ",e.unit]})]},a))})]})]})]})})]})});export{ie as a};
|
package/dist/chunk-ONY3GLGA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as a}from"./chunk-WJT6VPDR.js";import{a as t}from"./chunk-O2XFH626.js";import*as s from"mobx";import{createContext as i,useContext as c}from"react";var l=r=>{try{return localStorage.getItem(r)}catch{return null}},g=(r,e)=>{try{localStorage.setItem(r,e)}catch{}},o=class{constructor({store:e}){t(this,"store");t(this,"id","");t(this,"name","");t(this,"user",{});t(this,"skipSaving",!1);t(this,"cloudEnabled",!1);t(this,"status","saved");t(this,"language",l("ydesign-language")||navigator.language||"en");t(this,"designsLength",0);s.makeAutoObservable(this),this.store=e}setLanguage(e){this.language=e,g("ydesign-language",e)}requestSave(){}async firstLoad(e){this.store.loadJSON(e)}async loadById(e){console.log("loadById",e)}updateUrlWithProjectId(){if(!this.id||this.id==="local"){window.history.replaceState({},"","/");return}let e=new URL(window.location.href);new URLSearchParams(e.search).set("id",this.id),window.history.replaceState({},"",`/design/${this.id}`)}async save(){}async getGlobalFont(e){return e?.length?(a(e),e):[]}},u=i(null),m=()=>{let r=c(u);if(!r)throw new Error("useProject must be used within a ProjectProvider");return r},p=r=>new o(r),h=p;export{u as a,m as b,p as c,h as d};
|