publ-echo-test 0.0.163 → 0.0.164

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.
@@ -740,7 +740,6 @@ var ReactGridLayout = function (_a) {
740
740
  var currentGroupBlocks = blockStructure
741
741
  ? findGroupBlocks(blockStructure, editingGroupBlock)
742
742
  : [];
743
- console.log('currentGroupBlocks', currentGroupBlocks);
744
743
  return (_jsxs("div", { ref: innerRef, className: mergedClassName, style: mergedStyle, onDrop: isDroppable ? onDropHandler : noop, onDragLeave: isDroppable ? onDragLeaveHandler : noop, onDragEnter: isDroppable ? onDragEnterHandler : noop, onDragOver: isDroppable ? onDragOverHandler : noop, children: [currentGroupBlocks.map(function (each) { return processGroup(each); }), React.Children.map(children, function (child) { return processGridItem(child); }), placeholder(), activeDrag && _jsx("div", { className: 'grid-guide-line-center' }), activeDrag && (_jsx("div", { className: 'grid-placeholder', style: {
745
744
  marginTop: margin[1] + 'px',
746
745
  marginBottom: margin[1] + 'px',
@@ -54,3 +54,4 @@ export declare function getBlockWorkDirPath(blockStructure: Block, targetBlockId
54
54
  export declare function formatBlockIdToCbId(blockId: string): number | null;
55
55
  export declare function formatCbIdToBlockId(cbId: number): string;
56
56
  export declare function findParentGroupBlock(current: Block, targetBlockId: string): GroupBlock | null;
57
+ export declare function findOneComponentBlock(current: Block, targetBlockId: string): number | null;
@@ -311,3 +311,32 @@ export function findParentGroupBlock(current, targetBlockId) {
311
311
  // 찾지 못하면 null 반환
312
312
  return null;
313
313
  }
314
+ export function findOneComponentBlock(current, targetBlockId) {
315
+ var targetBlock = findBlockByBlockId(current, targetBlockId);
316
+ if (!targetBlock) {
317
+ console.error('Target block not found');
318
+ return null;
319
+ }
320
+ if (targetBlock.type !== 'GROUP_BLOCK') {
321
+ console.error('Target block is not a group block');
322
+ return null;
323
+ }
324
+ // 직속 하위에서 먼저 찾기
325
+ for (var _i = 0, _a = targetBlock.children; _i < _a.length; _i++) {
326
+ var child = _a[_i];
327
+ if (child.type === 'COMPONENT_BLOCK') {
328
+ return child.componentBlockId;
329
+ }
330
+ }
331
+ // 직속 하위에 없다면 재귀적으로 찾기
332
+ for (var _b = 0, _c = targetBlock.children; _b < _c.length; _b++) {
333
+ var child = _c[_b];
334
+ if (child.type === 'GROUP_BLOCK') {
335
+ var found = findOneComponentBlock(child, child.blockId);
336
+ if (found !== null) {
337
+ return found;
338
+ }
339
+ }
340
+ }
341
+ return null;
342
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "publ-echo-test",
3
- "version": "0.0.163",
3
+ "version": "0.0.164",
4
4
  "private": false,
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/lib/index.d.js",