File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 243243 v-if =" blockController .isImage ()"
244244 :modelValue =" blockController .getAttribute (' alt' )"
245245 @update :modelValue =" (val ) => blockController .setAttribute (' alt' , val ) " />
246+
247+ <!-- class -->
248+ <InlineInput
249+ label="Class"
250+ v-if =" ! blockController .multipleBlocksSelected ()"
251+ :modelValue =" getClasses ()"
252+ @update :modelValue =" (val ) => setClasses (val ) " />
253+
246254 <CodeEditor
247255 class="mt-8"
248256 label="RAW Styles (as JSON)"
@@ -287,4 +295,13 @@ const setFont = (font: string) => {
287295 blockController .setFontFamily (font );
288296 });
289297};
298+
299+ const getClasses = () => {
300+ return blockController .getClasses ().join (" , " );
301+ };
302+
303+ const setClasses = (val : string ) => {
304+ const classes = val .split (" ," ).map ((c ) => c .trim ());
305+ blockController .setClasses (classes );
306+ };
290307 </script >
Original file line number Diff line number Diff line change @@ -97,7 +97,6 @@ const handleRightResize = (ev: MouseEvent) => {
9797 // movement / scale * speed
9898 const movement = (mouseMoveEvent .clientX - startX ) / canvasProps .scale ;
9999 const finalWidth = Math .abs (guides .getFinalWidth (startWidth + movement ));
100- console .log (startFontSize , movement );
101100 if (targetBlock .isText () && ! mouseMoveEvent .shiftKey ) {
102101 const fontSize = clamp (Math .round (startFontSize + 0.5 * movement ), 10 , 150 );
103102 targetBlock .setStyle (" fontSize" , ` ${fontSize }px ` );
Original file line number Diff line number Diff line change @@ -93,6 +93,14 @@ const blockController = {
9393 block [ key ] = value ;
9494 } ) ;
9595 } ,
96+ getClasses : ( ) => {
97+ let classes = [ ] as string [ ] ;
98+ classes = store . selectedBlocks [ 0 ] . getClasses ( ) ;
99+ return classes ;
100+ } ,
101+ setClasses : ( classes : string [ ] ) => {
102+ store . selectedBlocks [ 0 ] . classes = classes ;
103+ } ,
96104 getRawStyles : ( ) => {
97105 return blockController . isBLockSelected ( ) && store . selectedBlocks [ 0 ] . rawStyles ;
98106 } ,
You can’t perform that action at this time.
0 commit comments