publ-echo-test 0.0.344 → 0.0.345
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.
|
@@ -1,24 +1,41 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
1
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import styled from "styled-components"; // 1. styled-components import
|
|
7
|
+
// --- 2. Styled Components 정의 ---
|
|
8
|
+
// 기본 그리드 패턴용 rect
|
|
9
|
+
var GridPatternRect = styled.rect(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n fill: #f0f0f0;\n stroke: #ddd;\n stroke-width: 1px;\n"], ["\n fill: #f0f0f0;\n stroke: #ddd;\n stroke-width: 1px;\n"])));
|
|
10
|
+
// 활성화된 셀(개별)용 rect
|
|
11
|
+
var ActiveCellRect = styled.rect(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n fill: rgba(0, 255, 0, 0.2);\n stroke: rgba(0, 255, 8, 0.5);\n stroke-width: 1px;\n"], ["\n fill: rgba(0, 255, 0, 0.2);\n stroke: rgba(0, 255, 8, 0.5);\n stroke-width: 1px;\n"])));
|
|
12
|
+
// "↕ 가변" 텍스트용 text
|
|
13
|
+
var IndicatorText = styled.text(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n fill: rgba(0, 255, 8, 0.5);\n font-size: 12px;\n font-weight: 600;\n /* y \uC88C\uD45C \uAE30\uC900 \uC138\uB85C \uC911\uC559 \uC815\uB82C */\n dominant-baseline: central;\n /* x \uC88C\uD45C \uAE30\uC900 \uC67C\uCABD \uC815\uB82C */\n text-anchor: start;\n"], ["\n fill: rgba(0, 255, 8, 0.5);\n font-size: 12px;\n font-weight: 600;\n /* y \uC88C\uD45C \uAE30\uC900 \uC138\uB85C \uC911\uC559 \uC815\uB82C */\n dominant-baseline: central;\n /* x \uC88C\uD45C \uAE30\uC900 \uC67C\uCABD \uC815\uB82C */\n text-anchor: start;\n"])));
|
|
2
14
|
export function GridBackgroundPlaceholder(_a) {
|
|
3
15
|
var margin = _a.margin, width = _a.width, rowHeight = _a.rowHeight, colWidth = _a.colWidth, backgroundWidth = _a.backgroundWidth, backgroundHeight = _a.backgroundHeight, activeDrag = _a.activeDrag, selectedBlockId = _a.selectedBlockId;
|
|
4
|
-
//
|
|
16
|
+
// 활성화된 행 인덱스
|
|
5
17
|
var activeRows = Array.from({ length: activeDrag.h }, function (_, i) { return activeDrag.y + i; });
|
|
18
|
+
// 모든 열 인덱스 (0부터 23까지)
|
|
6
19
|
var activeCols = Array.from({ length: 24 }, function (_, i) { return 0 + i; });
|
|
20
|
+
// 텍스트 여백
|
|
21
|
+
var textPadding = 10;
|
|
7
22
|
return (_jsx("div", { className: "grid-placeholder", style: {
|
|
8
23
|
marginTop: margin[1] + "px",
|
|
9
24
|
marginBottom: margin[1] + "px",
|
|
10
25
|
marginLeft: margin[0] + "px",
|
|
11
26
|
marginRight: margin[0] + "px",
|
|
12
|
-
}, children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: backgroundWidth, height: backgroundHeight,
|
|
13
|
-
|
|
27
|
+
}, children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: backgroundWidth, height: backgroundHeight, overflow: "visible" // 3. 텍스트가 잘리지 않도록 overflow="visible" 추가
|
|
28
|
+
, children: [_jsx("defs", { children: _jsx("pattern", { id: "grid-pattern", height: rowHeight + margin[1], width: colWidth + margin[0], patternUnits: "userSpaceOnUse", children: _jsx(GridPatternRect, { x: 0.5, y: 0.5, height: rowHeight, width: colWidth }) }) }), _jsx("rect", { width: width, height: "100%", fill: "url(#grid-pattern)" }), activeDrag &&
|
|
14
29
|
activeRows.map(function (row) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
// 이 행의 y 좌표 계산
|
|
31
|
+
var y_top = row * (rowHeight + margin[1]) + 0.5;
|
|
32
|
+
// 텍스트를 위한 행의 세로 중앙 y 좌표
|
|
33
|
+
var y_center = y_top + rowHeight / 2;
|
|
34
|
+
// 5. <g> 태그로 각 행의 요소들을 그룹화
|
|
35
|
+
return (_jsxs("g", { children: [activeCols.map(function (col) {
|
|
36
|
+
var x = col * (colWidth + margin[0]) + 0.5;
|
|
37
|
+
return (_jsx(ActiveCellRect, { x: x, y: y_top, width: colWidth, height: rowHeight }, "".concat(row, "-").concat(col)));
|
|
38
|
+
}), _jsx(IndicatorText, { x: width + textPadding, y: y_center, children: "\u2195 \uAC00\uBCC0" })] }, row));
|
|
23
39
|
})] }) }));
|
|
24
40
|
}
|
|
41
|
+
var templateObject_1, templateObject_2, templateObject_3;
|