@adstage/web-sdk 2.3.7 โ†’ 2.4.1

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.
@@ -108,24 +108,20 @@ export abstract class BaseAdRenderer implements AdRenderer {
108
108
  protected getImageStyles(slot?: AdSlot): Record<string, string> {
109
109
  const styles: Record<string, string> = {
110
110
  display: 'block',
111
+ 'max-width': '100%',
112
+ height: 'auto',
111
113
  'object-position': 'center', // ๐ŸŽฏ ์ด๋ฏธ์ง€ ํ•ญ์ƒ ์ค‘์•™ ์ •๋ ฌ
112
114
  };
113
115
 
114
- // ์‚ฌ์šฉ์ž๊ฐ€ ์ปจํ…Œ์ด๋„ˆ ํฌ๊ธฐ๋ฅผ ์ง€์ •ํ–ˆ๋Š”์ง€ ํ™•์ธ
116
+ // ์‚ฌ์šฉ์ž๊ฐ€ ์ปจํ…Œ์ด๋„ˆ ํฌ๊ธฐ๋ฅผ ์ง€์ •ํ•œ ๊ฒฝ์šฐ์—๋งŒ ํฌ๊ธฐ ์ œํ•œ
115
117
  const parsedWidth = this.parseSizeValue(slot?.width);
116
118
  const parsedHeight = this.parseSizeValue(slot?.height);
117
- const hasUserDefinedSize = parsedWidth || parsedHeight;
118
119
 
119
- if (hasUserDefinedSize) {
120
- // ๐ŸŽฏ ์‚ฌ์šฉ์ž๊ฐ€ ํฌ๊ธฐ๋ฅผ ์ง€์ •ํ•œ ๊ฒฝ์šฐ: ์ปจํ…Œ์ด๋„ˆ์— ๊ฝ‰ ์ฐจ๋„๋ก ์„ค์ •
120
+ if (parsedWidth && parsedHeight) {
121
121
  styles.width = '100%';
122
122
  styles.height = '100%';
123
- styles['object-fit'] = 'cover'; // ์ปจํ…Œ์ด๋„ˆ์— ๊ฝ‰ ์ฐฌ ์ƒํƒœ๋กœ ๋น„์œจ ์œ ์ง€
124
- styles['object-position'] = 'center';
125
- } else {
126
- // ์‚ฌ์šฉ์ž๊ฐ€ ํฌ๊ธฐ๋ฅผ ์ง€์ •ํ•˜์ง€ ์•Š์€ ๊ฒฝ์šฐ: ์›๋ณธ ์ด๋ฏธ์ง€ ํฌ๊ธฐ ์œ ์ง€
127
- styles['max-width'] = '100%';
128
- styles.height = 'auto';
123
+ styles['object-fit'] = 'cover';
124
+ styles['object-position'] = 'center'; // ๐ŸŽฏ ํฌ๊ธฐ ์กฐ์ • ์‹œ์—๋„ ์ค‘์•™ ์ •๋ ฌ
129
125
  }
130
126
 
131
127
  return styles;