From a1cfbbcdb54f111296e58432980970ff4d5f7179 Mon Sep 17 00:00:00 2001 From: kim jeong yong Date: Wed, 25 Mar 2026 17:56:58 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[fix]=20block=5Fexpansion=5Fweather.js?= =?UTF-8?q?=EC=9D=98=20=EB=82=A0=EC=94=A8=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EA=B0=9C=EC=84=A0=20-=20=ED=8A=B9?= =?UTF-8?q?=EC=A0=95=20=EB=82=A0=EC=A7=9C=EC=9D=98=20=EB=82=A0=EC=94=A8=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=EA=B0=80=20=EC=97=86=EC=9D=84=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=EA=B8=B0=EB=B3=B8=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=EB=A5=BC=20=EB=B0=98=ED=99=98=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=98=A4=EB=A5=98=20=EC=B2=98=EB=A6=AC=20=EA=B0=95?= =?UTF-8?q?=ED=99=94.=20-=20=EB=82=A0=EC=94=A8=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=EB=A5=BC=20=ED=83=80=EC=9E=85=EA=B3=BC=20=EB=82=A0?= =?UTF-8?q?=EC=A7=9C=20=EA=B8=B0=EB=B0=98=EC=9C=BC=EB=A1=9C=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=ED=95=98=EB=8A=94=20=ED=82=A4=20=ED=95=A0=EB=8B=B9=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=EC=9D=84=20=EB=A6=AC=ED=8C=A9=ED=84=B0?= =?UTF-8?q?=EB=A7=81=ED=95=B4=20=20=20=EB=AA=85=ED=99=95=EC=84=B1=EA=B3=BC?= =?UTF-8?q?=20=EC=95=88=EC=A0=95=EC=84=B1=20=ED=96=A5=EC=83=81.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/playground/blocks/block_expansion_weather.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/playground/blocks/block_expansion_weather.js b/src/playground/blocks/block_expansion_weather.js index aa92c36d9d..43b8555093 100644 --- a/src/playground/blocks/block_expansion_weather.js +++ b/src/playground/blocks/block_expansion_weather.js @@ -3,16 +3,17 @@ const { getStateOptions, getCityOptions, locationData } = require('../../util/lo const { callApi } = require('../../util/common'); function resolveData(weatherData, type, dateStr) { + const defaultData = Entry.EXPANSION_BLOCK.weather.defaultData; try { + let key = Entry.EXPANSION_BLOCK.weather.getDate(dateStr); if (type === 'now') { - return weatherData[Object.keys(weatherData)[0]]; + key = Object.keys(weatherData)[0]; } else if (type === 'hour') { - return weatherData[dateStr]; - } else { - return weatherData[Entry.EXPANSION_BLOCK.weather.getDate(dateStr)]; + key = dateStr; } + return weatherData[key] || defaultData; } catch (e) { - return Entry.EXPANSION_BLOCK.weather.defaultData; + return defaultData; } } From 8ba1ed8da395ae9000b61e9e85264c22b737d9b8 Mon Sep 17 00:00:00 2001 From: kim jeong yong Date: Mon, 6 Apr 2026 10:56:49 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[fix]=20function=5Ffield=5Flabel=EC=97=90?= =?UTF-8?q?=EC=84=9C=20%N=20=EC=98=88=EC=95=BD=EC=96=B4=20=EC=98=A4?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=20=EB=B0=A9=EC=A7=80=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - FieldTextInput.applyValue에서 block 타입이 function_field_label일 경우 %N 패턴의 % 기호를 제거하여 플레이스홀더로 오인식되는 문제 수정 - destroyOption 시에도 동일한 정제 로직 적용 - block_view.js 코드 스타일 소폭 정리 (function 공백, 들여쓰기) --- src/playground/block_view.js | 15 +++++++-------- src/playground/field/textInput.js | 12 ++++++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/playground/block_view.js b/src/playground/block_view.js index 781299799b..751b9d64f2 100644 --- a/src/playground/block_view.js +++ b/src/playground/block_view.js @@ -88,7 +88,7 @@ Entry.BlockView = class BlockView { } this.isInBlockMenu = this.getBoard() instanceof Entry.BlockMenu; - this.mouseHandler = function (e) { + this.mouseHandler = function(e) { (_.result(that.block.events, 'mousedown') || []).forEach((fn) => { if (Entry.documentMousedown) { Entry.documentMousedown.notify(e); @@ -608,7 +608,7 @@ Entry.BlockView = class BlockView { const mouseDownCoordinate = this.mouseDownCoordinate; const diff = Math.sqrt( Math.pow(mouseEvent.pageX - mouseDownCoordinate.x, 2) + - Math.pow(mouseEvent.pageY - mouseDownCoordinate.y, 2) + Math.pow(mouseEvent.pageY - mouseDownCoordinate.y, 2) ); if (this.dragMode == Entry.DRAG_MODE_DRAG || diff > Entry.BlockView.DRAG_RADIUS) { const blockView = this; @@ -1019,9 +1019,8 @@ Entry.BlockView = class BlockView { magnet = this.magnet.previous; const dragHeight = dragBlock.getBelowHeight(); const nextX = _get(dragBlock, 'magnet.next.x'); - transform = `translate(${pos.scaleX + magnet.x - nextX},${ - pos.scaleY + magnet.y - dragHeight - })`; + transform = `translate(${pos.scaleX + magnet.x - nextX},${pos.scaleY + magnet.y - dragHeight + })`; } const $shadow = $(shadow); @@ -1642,7 +1641,7 @@ Entry.BlockView = class BlockView { halfWidth = 20; } return { - getBoundingClientRect: function () { + getBoundingClientRect: function() { const coord = this.getAbsoluteCoordinate(); const boardOffset = this._board.relativeOffset; const magnet = this.magnet[selector]; @@ -1767,7 +1766,7 @@ Entry.BlockView = class BlockView { canvas.height = height; const ctx = canvas.getContext('2d'); - img.onload = function () { + img.onload = function() { try { ctx.drawImage(img, 0, 0, width, height); const data = canvas.toDataURL('image/png'); @@ -1780,7 +1779,7 @@ Entry.BlockView = class BlockView { } }; - img.onerror = function () { + img.onerror = function() { return reject('error occured'); }; img.src = src; diff --git a/src/playground/field/textInput.js b/src/playground/field/textInput.js index 7565773540..814ed7880c 100644 --- a/src/playground/field/textInput.js +++ b/src/playground/field/textInput.js @@ -270,6 +270,7 @@ Entry.FieldTextInput = class FieldTextInput extends Entry.Field { applyValue(value, isNotUpdate) { let result = value; + if (this.optionWidget) { switch (this.optionWidget.type) { case 'angleWidget': @@ -289,6 +290,12 @@ Entry.FieldTextInput = class FieldTextInput extends Entry.Field { this.optionInput.val(result); } + if (this._block?.data?.type === 'function_field_label') { + const reg = /(%\d)/im; + if (result && reg.test(result)) { + result = result.replace(/%(\d)/gi, '$1'); + } + } this.setValue(result); this._setTextValue(); this.resize(); @@ -318,6 +325,11 @@ Entry.FieldTextInput = class FieldTextInput extends Entry.Field { delete this.optionInput; } + const reg = /(%\d)/im; + if (this.value && reg.test(this.value)) { + this.applyValue(this.value.replace(/%(\d)/gi, '$1')); + } + super.destroyOption(skipCommand, forceCommand); }