docs(core,extensions): 확장 20개 개발자 문서 완비와 문서 소유 이관
번들 확장 20개 전부에 AGENTS.md · README.md · docs/ 를 채우고, 코어가 들고 있던 확장 소유 문서 두 갈래를 그 확장으로 옮긴다. 번들 템플릿의 컴포넌트· 핸들러·레이아웃 상세와 확장이 구독하는 활동 로그 훅 목록이 그 대상이며, 코어에는 총계와 링크만 남아 확장이 기능을 늘릴 때 코어 문서를 고쳐야 하던 역방향 의존이 사라진다. 전수 완비를 확인하고 강제를 조인다 — 문서 동반 룰을 대상 목록 없는 error 로 승격하고, 검사 스크립트가 문서 미보유를 실패로 올리며, 미채움 마커 baseline 을 0 으로 기록한다. 한쪽만 조이면 "새 확장이 문서 없이 들어와도 초록" 인 상태가 남는데 그 결과는 이상 0건과 구분되지 않는다. 집필 과정에서 드러난 생성기 결함 셋을 함께 고친다. 스케줄 주기 열이 계약 키를 읽지 않아 모든 확장에서 '-' 였고, 네임스페이스를 붙인 핸들러 등록 키가 수집에서 통째로 빠졌으며, README 골격이 폐기된 히어로 배지를 계속 찍어내고 있었다. 셋 다 산출물이 아니라 원천이 틀린 것이라, 가드의 모집단에 생성기 출력 자체를 넣어 다음 확장이 같은 상태로 태어나는 경로를 막는다.
This commit is contained in:
1 parent
8328b1db77
commit
6c63536f81
181 files changed
+13287
-1148
No files matched your search
+3
-6
@@ -10,7 +10,7 @@
|
||||
| 카테고리 | 문서 수 | 링크 상태 |
|
||||
|----------|---------|----------|
|
||||
| [백엔드](backend/) | 37개 | 정상 |
|
||||
| [프론트엔드](frontend/) | 49개 | 정상 |
|
||||
| [프론트엔드](frontend/) | 46개 | 정상 |
|
||||
| [확장 시스템](extension/) | 32개 | 정상 |
|
||||
| 공통 | 20개 | 정상 |
|
||||
| [AI 도구](ai-tools/) | - | 정상 |
|
||||
@@ -43,7 +43,7 @@ G7 이 제공하는 REST API 의 엔드포인트별 요청 파라미터·응답
|
||||
| 4 | [레이아웃 JSON - 상속](frontend/layout-json-inheritance.md) | extends: 베이스 레이아웃 상속 (type: "slot" 위치에 삽입) |
|
||||
| 5 | [컴포넌트 개발 규칙](frontend/components.md) | HTML 태그 직접 사용 금지 |
|
||||
| 6 | [컴포넌트 Props 레퍼런스](frontend/component-props.md) | - |
|
||||
| 7 | [sirsoft-basic 컴포넌트](frontend/templates/sirsoft-basic/components.md) | Basic (26개), Composite 등 |
|
||||
| 7 | [sirsoft-basic 컴포넌트](../templates/_bundled/sirsoft-basic/docs/components.md) | 확장 소유 문서 (basic / composite / layout) |
|
||||
| 8 | [데이터 바인딩 및 표현식](frontend/data-binding.md) | API 데이터: {{user.name}}, URL 파라미터: {{route.id}} |
|
||||
| 9 | [데이터 바인딩 - 다국어 처리](frontend/data-binding-i18n.md) | - |
|
||||
| 10 | [액션 핸들러 가이드](frontend/actions.md) | 구조: type 또는 event(이벤트), handler(핸들러명), params(옵션) |
|
||||
@@ -169,7 +169,7 @@ sirsoft-admin_basic 컴포넌트 문서는 확장이 소유합니다 — [templa
|
||||
| [user-overrides.md](backend/user-overrides.md) | 사용자 수정 보존 (HasUserOverrides Trait) |
|
||||
| [validation.md](backend/validation.md) | 검증 (Validation) |
|
||||
|
||||
### 프론트엔드 (49개)
|
||||
### 프론트엔드 (46개)
|
||||
|
||||
| 문서 | 제목 |
|
||||
|------|------|
|
||||
@@ -219,9 +219,6 @@ sirsoft-admin_basic 컴포넌트 문서는 확장이 소유합니다 — [templa
|
||||
| [template-development.md](frontend/template-development.md) | 템플릿 개발 가이드라인 |
|
||||
| [template-handlers.md](frontend/template-handlers.md) | 템플릿 전용 핸들러 |
|
||||
| [README.md](frontend/README.md) | 템플릿별 컴포넌트·핸들러·레이아웃 문서 |
|
||||
| [components.md](frontend/components.md) | sirsoft-basic 컴포넌트 |
|
||||
| [handlers.md](frontend/handlers.md) | sirsoft-basic 핸들러 |
|
||||
| [layouts.md](frontend/layouts.md) | sirsoft-basic 레이아웃 |
|
||||
|
||||
### 확장 시스템 (32개)
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ global.window = {
|
||||
- docs/extension/template-basics.md
|
||||
- docs/extension/template-commands.md
|
||||
- templates/_bundled/sirsoft-admin_basic/docs/components.md
|
||||
- docs/frontend/templates/sirsoft-basic/components.md
|
||||
- templates/_bundled/sirsoft-basic/docs/components.md
|
||||
|
||||
## 테스트 실행
|
||||
\`\`\`powershell
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
| 문서 | 제목 | 핵심 내용 |
|
||||
|------|------|----------|
|
||||
| [activity-log-hooks.md](activity-log-hooks.md) | 활동 로그 훅 레퍼런스 (Activity Log Hooks Reference) | 코어 66훅 + 이커머스 92훅 + 게시판 32훅 + 페이지 8훅 = 총 198훅 |
|
||||
| [activity-log-hooks.md](activity-log-hooks.md) | 활동 로그 훅 레퍼런스 (Activity Log Hooks Reference) | 코어 66훅 + 확장 132훅 = 총 198훅 (확장별 목록은 그 확장이 소유) |
|
||||
| [activity-log.md](activity-log.md) | 활동 로그 시스템 (Activity Log System) | Monolog 기반: Service 훅 → Listener → Log::channel... |
|
||||
| [admin-settings-access.md](admin-settings-access.md) | Admin 환경설정 값 접근 (`g7_core_settings` vs `config()`) | 동기화 SSoT: storage/app/settings/*.json → Setting... |
|
||||
| [api-documentation.md](api-documentation.md) | API 레퍼런스 문서 규정 (API Documentation) | 모든 API 엔드포인트는 레퍼런스 문서 필수 — 메서드/URI/파라미터/응답 필드 +... |
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
## TL;DR (5초 요약)
|
||||
|
||||
```text
|
||||
1. 코어 66훅 + 이커머스 92훅 + 게시판 32훅 + 페이지 8훅 = 총 198훅
|
||||
1. 코어 66훅 + 확장 132훅 = 총 198훅 (확장별 목록은 그 확장이 소유)
|
||||
2. Listener에서 Log::channel('activity')->info() 직접 호출 (Monolog → ActivityLogHandler → DB)
|
||||
3. 스냅샷 패턴: before_update(priority 5) → 캡처, after_update → ChangeDetector로 비교
|
||||
4. 사용자 행위: ActivityLogType::User (장바구니/위시리스트/쿠폰 다운로드/주문/결제)
|
||||
@@ -18,11 +18,9 @@
|
||||
|
||||
1. [아키텍처 개요](#1-아키텍처-개요)
|
||||
2. [코어 훅 (CoreActivityLogListener)](#2-코어-훅-coreactivityloglistener)
|
||||
3. [이커머스 모듈 훅](#3-이커머스-모듈-훅)
|
||||
4. [게시판 모듈 훅 (BoardActivityLogListener)](#4-게시판-모듈-훅-boardactivityloglistener)
|
||||
5. [페이지 모듈 훅 (PageActivityLogListener)](#5-페이지-모듈-훅-pageactivityloglistener)
|
||||
6. [스냅샷/변경감지 패턴](#6-스냅샷변경감지-패턴)
|
||||
7. [새 모듈에 ActivityLog 추가하기](#7-새-모듈에-activitylog-추가하기)
|
||||
3. [확장 모듈 훅](#3-확장-모듈-훅)
|
||||
4. [스냅샷/변경감지 패턴](#4-스냅샷변경감지-패턴)
|
||||
5. [새 모듈에 ActivityLog 추가하기](#5-새-모듈에-activitylog-추가하기)
|
||||
|
||||
---
|
||||
|
||||
@@ -192,344 +190,30 @@ Service → doAction('hook.name') → ActivityLogListener → Log::channel('acti
|
||||
|
||||
---
|
||||
|
||||
## 3. 이커머스 모듈 훅
|
||||
## 3. 확장 모듈 훅
|
||||
|
||||
**모듈**: `sirsoft-ecommerce`
|
||||
**총 92훅** (7개 Listener)
|
||||
확장이 구독하는 활동 로그 훅 목록은 **그 확장이 소유**합니다(#601). 확장이 훅을 추가할 때
|
||||
코어 문서를 고쳐야 하는 역방향 의존을 없애기 위해서이며, 코어에는 아래 총계와 링크만 남습니다.
|
||||
|
||||
### 3.1 OrderActivityLogListener (21훅)
|
||||
| 확장 | 훅 수 | 문서 |
|
||||
|------|------|------|
|
||||
| `sirsoft-ecommerce` | 92 | [docs/extension-points.md](../../modules/_bundled/sirsoft-ecommerce/docs/extension-points.md) |
|
||||
| `sirsoft-board` | 30 | [docs/extension-points.md](../../modules/_bundled/sirsoft-board/docs/extension-points.md) |
|
||||
| `sirsoft-page` | 7 | [docs/extension-points.md](../../modules/_bundled/sirsoft-page/docs/extension-points.md) |
|
||||
| `sirsoft-pay_kginicis` | 1 | [docs/extension-points.md](../../plugins/_bundled/sirsoft-pay_kginicis/docs/extension-points.md) |
|
||||
| `sirsoft-pay_nhnkcp` | 1 | [docs/extension-points.md](../../plugins/_bundled/sirsoft-pay_nhnkcp/docs/extension-points.md) |
|
||||
| `sirsoft-pay_nicepayments` | 1 | [docs/extension-points.md](../../plugins/_bundled/sirsoft-pay_nicepayments/docs/extension-points.md) |
|
||||
| **합계** | **132** | |
|
||||
|
||||
**파일**: `modules/_bundled/sirsoft-ecommerce/src/Listeners/OrderActivityLogListener.php`
|
||||
코어 66훅 + 확장 132훅 = **총 198훅**입니다.
|
||||
|
||||
#### OrderService (8훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.order.before_update` | `captureOrderSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.order.after_update` | `handleOrderAfterUpdate` | `order.update` | Admin | Order |
|
||||
| `sirsoft-ecommerce.order.after_delete` | `handleOrderAfterDelete` | `order.delete` | Admin | Order |
|
||||
| `sirsoft-ecommerce.order.after_bulk_update` | `handleOrderAfterBulkUpdate` | `order.bulk_update` | Admin | - |
|
||||
| `sirsoft-ecommerce.order.after_bulk_status_update` | `handleOrderAfterBulkStatusUpdate` | `order.bulk_status_update` | Admin | - |
|
||||
| `sirsoft-ecommerce.order.after_bulk_shipping_update` | `handleOrderAfterBulkShippingUpdate` | `order.bulk_shipping_update` | Admin | - |
|
||||
| `sirsoft-ecommerce.order.after_update_shipping_address` | `handleOrderAfterUpdateShippingAddress` | `order.update_shipping_address` | Admin | Order |
|
||||
| `sirsoft-ecommerce.order.after_send_email` | `handleOrderAfterSendEmail` | `order.send_email` | Admin | - |
|
||||
|
||||
#### OrderOptionService (2훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.order_option.after_status_change` | `handleOrderOptionAfterStatusChange` | `order_option.status_change` | Admin | OrderOption |
|
||||
| `sirsoft-ecommerce.order_option.after_bulk_status_change` | `handleOrderOptionAfterBulkStatusChange` | `order_option.bulk_status_change` | Admin | - |
|
||||
|
||||
#### OrderCancellationService (5훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.order.before_cancel` | `captureOrderCancelSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.order.after_cancel` | `handleOrderAfterCancel` | `order.cancel` | Admin | Order |
|
||||
| `sirsoft-ecommerce.order.after_partial_cancel` | `handleOrderAfterPartialCancel` | `order.partial_cancel` | Admin | Order |
|
||||
| `sirsoft-ecommerce.coupon.restore` | `handleCouponRestore` | `coupon.restore` | Admin | Order |
|
||||
| `sirsoft-ecommerce.mileage.restore` | `handleMileageRestore` | `mileage.restore` | Admin | Order |
|
||||
|
||||
#### OrderProcessingService (6훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.order.after_create` | `handleOrderAfterCreate` | `order.create` | **User** | Order |
|
||||
| `sirsoft-ecommerce.order.after_payment_complete` | `handleOrderAfterPaymentComplete` | `order.payment_complete` | **User** | Order |
|
||||
| `sirsoft-ecommerce.order.payment_failed` | `handleOrderAfterPaymentFailed` | `order.payment_failed` | **User** | Order |
|
||||
| `sirsoft-ecommerce.coupon.use` | `handleCouponUse` | `coupon.use` | **User** | Order |
|
||||
| `sirsoft-ecommerce.mileage.use` | `handleMileageUse` | `mileage.use` | **User** | Order |
|
||||
| `sirsoft-ecommerce.mileage.earn` | `handleMileageEarn` | `mileage.earn` | **User** | Order |
|
||||
|
||||
### 3.2 ProductActivityLogListener (10훅)
|
||||
|
||||
**파일**: `modules/_bundled/sirsoft-ecommerce/src/Listeners/ProductActivityLogListener.php`
|
||||
|
||||
> 이 리스너는 `ProductLogService`를 사용하는 별도 패턴입니다 (Log::channel 대신).
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Priority | 비고 |
|
||||
|---------|----------------|----------|------|
|
||||
| `sirsoft-ecommerce.product.after_create` | `logCreated` | 50 | 상품 생성 로그 |
|
||||
| `sirsoft-ecommerce.product.before_update` | `captureSnapshot` | 5 | 스냅샷 캡처 |
|
||||
| `sirsoft-ecommerce.product.after_update` | `logUpdated` | 50 | 변경사항 비교 후 로그 |
|
||||
| `sirsoft-ecommerce.product.before_delete` | `logDeleted` | 50 | 삭제 전 로그 기록 |
|
||||
| `sirsoft-ecommerce.product.before_bulk_update` | `captureProductBulkUpdateSnapshot` | 5 | 일괄 수정 전 스냅샷 |
|
||||
| `sirsoft-ecommerce.product.after_bulk_update` | `handleProductAfterBulkUpdate` | 20 | 일괄 수정 로그 |
|
||||
| `sirsoft-ecommerce.product.before_bulk_price_update` | `captureProductBulkPriceSnapshot` | 5 | 일괄 가격 수정 전 스냅샷 |
|
||||
| `sirsoft-ecommerce.product.after_bulk_price_update` | `handleProductAfterBulkPriceUpdate` | 20 | 일괄 가격 수정 로그 |
|
||||
| `sirsoft-ecommerce.product.before_bulk_stock_update` | `captureProductBulkStockSnapshot` | 5 | 일괄 재고 수정 전 스냅샷 |
|
||||
| `sirsoft-ecommerce.product.after_bulk_stock_update` | `handleProductAfterBulkStockUpdate` | 20 | 일괄 재고 수정 로그 |
|
||||
|
||||
### 3.3 CouponActivityLogListener (6훅)
|
||||
|
||||
**파일**: `modules/_bundled/sirsoft-ecommerce/src/Listeners/CouponActivityLogListener.php`
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.coupon.after_create` | `handleAfterCreate` | `coupon.create` | Admin | Coupon |
|
||||
| `sirsoft-ecommerce.coupon.before_update` | `captureCouponSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.coupon.after_update` | `handleAfterUpdate` | `coupon.update` | Admin | Coupon |
|
||||
| `sirsoft-ecommerce.coupon.after_delete` | `handleAfterDelete` | `coupon.delete` | Admin | - |
|
||||
| `sirsoft-ecommerce.coupon.before_bulk_status` | `captureCouponBulkStatusSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.coupon.after_bulk_status` | `handleAfterBulkStatus` | `coupon.bulk_status` | Admin | - |
|
||||
|
||||
### 3.4 ShippingPolicyActivityLogListener (8훅)
|
||||
|
||||
**파일**: `modules/_bundled/sirsoft-ecommerce/src/Listeners/ShippingPolicyActivityLogListener.php`
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.shipping_policy.after_create` | `handleAfterCreate` | `shipping_policy.create` | Admin | ShippingPolicy |
|
||||
| `sirsoft-ecommerce.shipping_policy.before_update` | `captureSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.shipping_policy.after_update` | `handleAfterUpdate` | `shipping_policy.update` | Admin | ShippingPolicy |
|
||||
| `sirsoft-ecommerce.shipping_policy.after_delete` | `handleAfterDelete` | `shipping_policy.delete` | Admin | - |
|
||||
| `sirsoft-ecommerce.shipping_policy.after_toggle_active` | `handleAfterToggleActive` | `shipping_policy.toggle_active` | Admin | ShippingPolicy |
|
||||
| `sirsoft-ecommerce.shipping_policy.after_set_default` | `handleAfterSetDefault` | `shipping_policy.set_default` | Admin | ShippingPolicy |
|
||||
| `sirsoft-ecommerce.shipping_policy.after_bulk_delete` | `handleAfterBulkDelete` | `shipping_policy.bulk_delete` | Admin | - |
|
||||
| `sirsoft-ecommerce.shipping_policy.after_bulk_toggle_active` | `handleAfterBulkToggleActive` | `shipping_policy.bulk_toggle_active` | Admin | - |
|
||||
|
||||
### 3.5 CategoryActivityLogListener (6훅)
|
||||
|
||||
**파일**: `modules/_bundled/sirsoft-ecommerce/src/Listeners/CategoryActivityLogListener.php`
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.category.after_create` | `handleAfterCreate` | `category.create` | Admin | Category |
|
||||
| `sirsoft-ecommerce.category.before_update` | `captureCategorySnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.category.after_update` | `handleAfterUpdate` | `category.update` | Admin | Category |
|
||||
| `sirsoft-ecommerce.category.after_delete` | `handleAfterDelete` | `category.delete` | Admin | - |
|
||||
| `sirsoft-ecommerce.category.after_toggle_status` | `handleAfterToggleStatus` | `category.toggle_status` | Admin | Category |
|
||||
| `sirsoft-ecommerce.category.after_reorder` | `handleAfterReorder` | `category.reorder` | Admin | - |
|
||||
|
||||
### 3.6 EcommerceAdminActivityLogListener (51훅)
|
||||
|
||||
**파일**: `modules/_bundled/sirsoft-ecommerce/src/Listeners/EcommerceAdminActivityLogListener.php`
|
||||
|
||||
#### Brand (5훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.brand.after_create` | `handleBrandAfterCreate` | `brand.create` | Admin | Brand |
|
||||
| `sirsoft-ecommerce.brand.before_update` | `captureBrandSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.brand.after_update` | `handleBrandAfterUpdate` | `brand.update` | Admin | Brand |
|
||||
| `sirsoft-ecommerce.brand.after_delete` | `handleBrandAfterDelete` | `brand.delete` | Admin | Brand |
|
||||
| `sirsoft-ecommerce.brand.after_toggle_status` | `handleBrandAfterToggleStatus` | `brand.toggle_status` | Admin | Brand |
|
||||
|
||||
#### ProductLabel (5훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.label.after_create` | `handleLabelAfterCreate` | `label.create` | Admin | ProductLabel |
|
||||
| `sirsoft-ecommerce.label.before_update` | `captureLabelSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.label.after_update` | `handleLabelAfterUpdate` | `label.update` | Admin | ProductLabel |
|
||||
| `sirsoft-ecommerce.label.after_delete` | `handleLabelAfterDelete` | `label.delete` | Admin | ProductLabel |
|
||||
| `sirsoft-ecommerce.label.after_toggle_status` | `handleLabelAfterToggleStatus` | `label.toggle_status` | Admin | ProductLabel |
|
||||
|
||||
#### ProductCommonInfo (4훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.product-common-info.after_create` | `handleCommonInfoAfterCreate` | `common_info.create` | Admin | ProductCommonInfo |
|
||||
| `sirsoft-ecommerce.product-common-info.before_update` | `captureCommonInfoSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.product-common-info.after_update` | `handleCommonInfoAfterUpdate` | `common_info.update` | Admin | ProductCommonInfo |
|
||||
| `sirsoft-ecommerce.product-common-info.after_delete` | `handleCommonInfoAfterDelete` | `common_info.delete` | Admin | ProductCommonInfo |
|
||||
|
||||
#### ProductNoticeTemplate (5훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.product-notice-template.after_create` | `handleNoticeTemplateAfterCreate` | `notice_template.create` | Admin | ProductNoticeTemplate |
|
||||
| `sirsoft-ecommerce.product-notice-template.before_update` | `captureNoticeTemplateSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.product-notice-template.after_update` | `handleNoticeTemplateAfterUpdate` | `notice_template.update` | Admin | ProductNoticeTemplate |
|
||||
| `sirsoft-ecommerce.product-notice-template.after_delete` | `handleNoticeTemplateAfterDelete` | `notice_template.delete` | Admin | ProductNoticeTemplate |
|
||||
| `sirsoft-ecommerce.product-notice-template.after_copy` | `handleNoticeTemplateAfterCopy` | `notice_template.copy` | Admin | ProductNoticeTemplate |
|
||||
|
||||
#### ExtraFeeTemplate (10훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.extra_fee_template.after_create` | `handleExtraFeeAfterCreate` | `extra_fee_template.create` | Admin | ExtraFeeTemplate |
|
||||
| `sirsoft-ecommerce.extra_fee_template.before_update` | `captureExtraFeeSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.extra_fee_template.after_update` | `handleExtraFeeAfterUpdate` | `extra_fee_template.update` | Admin | ExtraFeeTemplate |
|
||||
| `sirsoft-ecommerce.extra_fee_template.after_delete` | `handleExtraFeeAfterDelete` | `extra_fee_template.delete` | Admin | ExtraFeeTemplate |
|
||||
| `sirsoft-ecommerce.extra_fee_template.after_toggle_active` | `handleExtraFeeAfterToggleActive` | `extra_fee_template.toggle_active` | Admin | ExtraFeeTemplate |
|
||||
| `sirsoft-ecommerce.extra_fee_template.before_bulk_delete` | `captureExtraFeeBulkDeleteSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.extra_fee_template.after_bulk_delete` | `handleExtraFeeAfterBulkDelete` | `extra_fee_template.bulk_delete` | Admin | - |
|
||||
| `sirsoft-ecommerce.extra_fee_template.before_bulk_toggle_active` | `captureExtraFeeBulkToggleSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.extra_fee_template.after_bulk_toggle_active` | `handleExtraFeeAfterBulkToggleActive` | `extra_fee_template.bulk_toggle_active` | Admin | - |
|
||||
| `sirsoft-ecommerce.extra_fee_template.after_bulk_create` | `handleExtraFeeAfterBulkCreate` | `extra_fee_template.bulk_create` | Admin | - |
|
||||
|
||||
#### ShippingCarrier (5훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.shipping_carrier.after_create` | `handleCarrierAfterCreate` | `shipping_carrier.create` | Admin | ShippingCarrier |
|
||||
| `sirsoft-ecommerce.shipping_carrier.before_update` | `captureCarrierSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.shipping_carrier.after_update` | `handleCarrierAfterUpdate` | `shipping_carrier.update` | Admin | ShippingCarrier |
|
||||
| `sirsoft-ecommerce.shipping_carrier.after_delete` | `handleCarrierAfterDelete` | `shipping_carrier.delete` | Admin | ShippingCarrier |
|
||||
| `sirsoft-ecommerce.shipping_carrier.after_toggle_status` | `handleCarrierAfterToggleStatus` | `shipping_carrier.toggle_status` | Admin | ShippingCarrier |
|
||||
|
||||
#### ProductImage (3훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.product-image.after_upload` | `handleImageAfterUpload` | `product_image.upload` | Admin | ProductImage |
|
||||
| `sirsoft-ecommerce.product-image.after_delete` | `handleImageAfterDelete` | `product_image.delete` | Admin | ProductImage |
|
||||
| `sirsoft-ecommerce.product-image.after_reorder` | `handleImageAfterReorder` | `product_image.reorder` | Admin | - |
|
||||
|
||||
#### ShippingPolicy Bulk (4훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.shipping_policy.before_bulk_delete` | `captureShippingPolicyBulkDeleteSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.shipping_policy.after_bulk_delete` | `handleShippingPolicyAfterBulkDelete` | `shipping_policy.bulk_delete` | Admin | - |
|
||||
| `sirsoft-ecommerce.shipping_policy.before_bulk_toggle_active` | `captureShippingPolicyBulkToggleSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.shipping_policy.after_bulk_toggle_active` | `handleShippingPolicyAfterBulkToggleActive` | `shipping_policy.bulk_toggle_active` | Admin | - |
|
||||
|
||||
#### ProductOption (6훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.product_option.before_bulk_price_update` | `captureOptionBulkPriceSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.product_option.after_bulk_price_update` | `handleOptionAfterBulkPriceUpdate` | `product_option.bulk_price_update` | Admin | - |
|
||||
| `sirsoft-ecommerce.product_option.before_bulk_stock_update` | `captureOptionBulkStockSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.product_option.after_bulk_stock_update` | `handleOptionAfterBulkStockUpdate` | `product_option.bulk_stock_update` | Admin | - |
|
||||
| `sirsoft-ecommerce.option.before_bulk_update` | `captureOptionBulkUpdateSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.option.after_bulk_update` | `handleOptionAfterBulkUpdate` | `product_option.bulk_update` | Admin | - |
|
||||
|
||||
#### ProductReview (4훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.product-review.after_create` | `handleReviewAfterCreate` | `review.create` | Admin | ProductReview |
|
||||
| `sirsoft-ecommerce.product-review.after_delete` | `handleReviewAfterDelete` | `review.delete` | Admin | ProductReview |
|
||||
| `sirsoft-ecommerce.product-review.before_bulk_delete` | `captureReviewBulkDeleteSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-ecommerce.product-review.after_bulk_delete` | `handleReviewAfterBulkDelete` | `product_review.bulk_delete` | Admin | - |
|
||||
|
||||
### 3.7 EcommerceUserActivityLogListener (7훅)
|
||||
|
||||
**파일**: `modules/_bundled/sirsoft-ecommerce/src/Listeners/EcommerceUserActivityLogListener.php`
|
||||
|
||||
#### Cart (5훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.cart.after_add` | `handleCartAfterAdd` | `cart.add` | **User** | Cart |
|
||||
| `sirsoft-ecommerce.cart.after_update_quantity` | `handleCartAfterUpdateQuantity` | `cart.update_quantity` | **User** | Cart |
|
||||
| `sirsoft-ecommerce.cart.after_change_option` | `handleCartAfterChangeOption` | `cart.change_option` | **User** | Cart |
|
||||
| `sirsoft-ecommerce.cart.after_delete` | `handleCartAfterDelete` | `cart.delete` | **User** | - |
|
||||
| `sirsoft-ecommerce.cart.after_delete_all` | `handleCartAfterDeleteAll` | `cart.delete_all` | **User** | - |
|
||||
|
||||
#### Wishlist (1훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.wishlist.after_toggle` | `handleWishlistAfterToggle` | `wishlist.add` / `wishlist.remove` | **User** | Product |
|
||||
|
||||
#### User Coupon (1훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-ecommerce.user_coupon.after_download` | `handleUserCouponAfterDownload` | `user_coupon.download` | **User** | CouponIssue |
|
||||
확장에 새 활동 로그 항목을 추가할 때도 **다국어 키는 코어가 SSoT** 입니다 — action 라벨과
|
||||
description 본문을 코어 `lang/{ko,en}/activity_log.php` 에 정의해야 하며, 모듈 lang 파일에
|
||||
넣으면 해석되지 않습니다. 번들 일본어 팩도 같은 작업 단위에서 동기화합니다.
|
||||
|
||||
---
|
||||
|
||||
## 4. 게시판 모듈 훅 (BoardActivityLogListener)
|
||||
|
||||
**파일**: `modules/_bundled/sirsoft-board/src/Listeners/BoardActivityLogListener.php`
|
||||
**총 32훅**
|
||||
|
||||
### Board (6훅, 스냅샷 포함)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-board.board.after_create` | `handleBoardAfterCreate` | `board.create` | Admin | Board |
|
||||
| `sirsoft-board.board.before_update` | `captureBoardSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-board.board.after_update` | `handleBoardAfterUpdate` | `board.update` | Admin | Board |
|
||||
| `sirsoft-board.board.after_delete` | `handleBoardAfterDelete` | `board.delete` | Admin | Board |
|
||||
| `sirsoft-board.board.after_add_to_menu` | `handleBoardAfterAddToMenu` | `board.add_to_menu` | Admin | Board |
|
||||
| `sirsoft-board.settings.after_bulk_apply` | `handleSettingsAfterBulkApply` | `board_settings.bulk_apply` | Admin | - |
|
||||
|
||||
### BoardType (4훅, 스냅샷 포함)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-board.board_type.after_create` | `handleBoardTypeAfterCreate` | `board_type.create` | Admin | BoardType |
|
||||
| `sirsoft-board.board_type.before_update` | `captureBoardTypeSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-board.board_type.after_update` | `handleBoardTypeAfterUpdate` | `board_type.update` | Admin | BoardType |
|
||||
| `sirsoft-board.board_type.after_delete` | `handleBoardTypeAfterDelete` | `board_type.delete` | Admin | BoardType |
|
||||
|
||||
### Post (6훅, 스냅샷 포함)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-board.post.after_create` | `handlePostAfterCreate` | `post.create` | Admin | Post |
|
||||
| `sirsoft-board.post.before_update` | `capturePostSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-board.post.after_update` | `handlePostAfterUpdate` | `post.update` | Admin | Post |
|
||||
| `sirsoft-board.post.after_delete` | `handlePostAfterDelete` | `post.delete` | Admin | Post |
|
||||
| `sirsoft-board.post.after_blind` | `handlePostAfterBlind` | `post.blind` | Admin | Post |
|
||||
| `sirsoft-board.post.after_restore` | `handlePostAfterRestore` | `post.restore` | Admin | Post |
|
||||
|
||||
### Comment (6훅, 스냅샷 포함)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-board.comment.after_create` | `handleCommentAfterCreate` | `comment.create` | Admin | Comment |
|
||||
| `sirsoft-board.comment.before_update` | `captureCommentSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-board.comment.after_update` | `handleCommentAfterUpdate` | `comment.update` | Admin | Comment |
|
||||
| `sirsoft-board.comment.after_delete` | `handleCommentAfterDelete` | `comment.delete` | Admin | Comment |
|
||||
| `sirsoft-board.comment.after_blind` | `handleCommentAfterBlind` | `comment.blind` | Admin | Comment |
|
||||
| `sirsoft-board.comment.after_restore` | `handleCommentAfterRestore` | `comment.restore` | Admin | Comment |
|
||||
|
||||
### Attachment (2훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-board.attachment.after_upload` | `handleAttachmentAfterUpload` | `attachment.upload` | Admin | Attachment |
|
||||
| `sirsoft-board.attachment.after_delete` | `handleAttachmentAfterDelete` | `attachment.delete` | Admin | Attachment |
|
||||
|
||||
### Report (8훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-board.report.after_create` | `handleReportAfterCreate` | `report.create` | Admin | Report |
|
||||
| `sirsoft-board.report.after_update_status` | `handleReportAfterUpdateStatus` | `report.update_status` | Admin | Report |
|
||||
| `sirsoft-board.report.before_bulk_update_status` | `captureReportBulkStatusSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-board.report.after_bulk_update_status` | `handleReportAfterBulkUpdateStatus` | `report.bulk_update_status` | Admin | - |
|
||||
| `sirsoft-board.report.after_delete` | `handleReportAfterDelete` | `report.delete` | Admin | Report |
|
||||
| `sirsoft-board.report.after_restore_content` | `handleReportAfterRestoreContent` | `report.restore_content` | Admin | Report |
|
||||
| `sirsoft-board.report.after_blind_content` | `handleReportAfterBlindContent` | `report.blind_content` | Admin | Report |
|
||||
| `sirsoft-board.report.after_delete_content` | `handleReportAfterDeleteContent` | `report.delete_content` | Admin | Report |
|
||||
|
||||
---
|
||||
|
||||
## 5. 페이지 모듈 훅 (PageActivityLogListener)
|
||||
|
||||
**파일**: `modules/_bundled/sirsoft-page/src/Listeners/PageActivityLogListener.php`
|
||||
**총 8훅**
|
||||
|
||||
### Page (6훅, 스냅샷 포함)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-page.page.after_create` | `handlePageAfterCreate` | `page.create` | Admin | Page |
|
||||
| `sirsoft-page.page.before_update` | `capturePageSnapshot` | _(스냅샷 캡처)_ | - | - |
|
||||
| `sirsoft-page.page.after_update` | `handlePageAfterUpdate` | `page.update` | Admin | Page |
|
||||
| `sirsoft-page.page.after_delete` | `handlePageAfterDelete` | `page.delete` | Admin | Page |
|
||||
| `sirsoft-page.page.after_publish` | `handlePageAfterPublish` | `page.publish` / `page.unpublish` | Admin | Page |
|
||||
| `sirsoft-page.page.after_restore` | `handlePageAfterRestore` | `page.restore` | Admin | Page |
|
||||
|
||||
### PageAttachment (2훅)
|
||||
|
||||
| 훅 이름 | Listener 메서드 | Action (DB) | LogType | Loggable |
|
||||
|---------|----------------|-------------|---------|----------|
|
||||
| `sirsoft-page.attachment.after_upload` | `handleAttachmentAfterUpload` | `page_attachment.upload` | Admin | PageAttachment |
|
||||
| `sirsoft-page.attachment.after_delete` | `handleAttachmentAfterDelete` | `page_attachment.delete` | Admin | PageAttachment |
|
||||
|
||||
---
|
||||
|
||||
## 6. 스냅샷/변경감지 패턴
|
||||
## 4. 스냅샷/변경감지 패턴
|
||||
|
||||
ActivityLog에서 수정(update) 작업의 변경 이력을 기록하려면 **스냅샷 패턴**을 사용합니다.
|
||||
|
||||
@@ -592,16 +276,31 @@ public function handleAfterUpdate(Model $entity): void
|
||||
- `BackedEnum` 자동 변환 지원
|
||||
- 스냅샷이 `null`이면 `null` 반환 (변경 없음)
|
||||
|
||||
### ProductActivityLogListener의 별도 패턴
|
||||
### 스냅샷은 Service 가 잡아 넘긴다
|
||||
|
||||
`ProductActivityLogListener`는 `ProductLogService`를 주입받아 사용하는 별도 패턴입니다:
|
||||
- `ChangeDetector` 대신 자체 `detectChanges()` 메서드로 변경 감지
|
||||
- 해시 비교로 옵션/추가옵션/이미지 변경 감지
|
||||
- `Log::channel('activity')` 대신 `ProductLogService`를 통해 처리로그 테이블에 기록
|
||||
리스너는 `before_*` 훅을 구독해 스냅샷을 잡지 않습니다. **Service 가 수정 직전에 스냅샷을
|
||||
만들어 `after_*` 훅의 인자로 넘기고**, 리스너는 그것을 `ChangeDetector::detect()` 에 그대로
|
||||
전달합니다:
|
||||
|
||||
```php
|
||||
// Service (예: ProductService::update())
|
||||
HookManager::doAction('sirsoft-ecommerce.product.after_update', $product, $snapshot);
|
||||
|
||||
// Listener
|
||||
public function handleProductAfterUpdate(Product $product, ?array $snapshot = null): void
|
||||
{
|
||||
$changes = ChangeDetector::detect($product, $snapshot);
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
`before_*` 훅 자체는 발행되므로 다른 확장이 구독할 수 있습니다 — 다만 **활동 로그 리스너의
|
||||
구독 대상은 아닙니다.** 확장별 구독 목록에서 `before_*` 가 보이지 않는 것은 누락이 아니라
|
||||
이 구조 때문입니다.
|
||||
|
||||
---
|
||||
|
||||
## 7. 새 모듈에 ActivityLog 추가하기
|
||||
## 5. 새 모듈에 ActivityLog 추가하기
|
||||
|
||||
### Step 1: Listener 클래스 생성
|
||||
|
||||
|
||||
@@ -110,6 +110,20 @@
|
||||
|
||||
mermaid 문법 오류는 렌더 시점에만 드러나므로, 새 형식을 도입할 때는 실제 렌더를 눈으로 확인한다.
|
||||
|
||||
### README 첫 화면
|
||||
|
||||
확장명은 히어로 이미지 배지가 아니라 평범한 H1 제목으로 적는다. 확장은 서로 대등하게 병렬로
|
||||
존재하는 구성요소이고, 각자가 코어와 같은 히어로 브랜딩을 달면 그 확장 하나가 독립 프로젝트인
|
||||
것처럼 보인다. `@generated:badges` 블록의 버전·유형·코어 제약·라이선스 배지는 manifest 에서
|
||||
오는 정보 표시이므로 그대로 둔다.
|
||||
|
||||
```markdown
|
||||
# 페이지
|
||||
|
||||
**G7 모듈 · sirsoft-page**
|
||||
정적 페이지(정보/정책/안내) 관리 모듈
|
||||
```
|
||||
|
||||
## 4. 자동 생성 블록 규약
|
||||
|
||||
생성기는 **마커 안쪽만** 쓴다.
|
||||
|
||||
@@ -36,12 +36,6 @@
|
||||
---
|
||||
|
||||
<!-- AUTO-GENERATED-START: frontend-readme-docs -->
|
||||
### 템플릿별 레퍼런스
|
||||
|
||||
| 템플릿 식별자 | 컴포넌트 | 핸들러 | 레이아웃 |
|
||||
|--------------|---------|--------|--------|
|
||||
| `sirsoft-basic` | [components.md](templates/sirsoft-basic/components.md) | [handlers.md](templates/sirsoft-basic/handlers.md) | [layouts.md](templates/sirsoft-basic/layouts.md) |
|
||||
|
||||
### 컴포넌트 개발
|
||||
|
||||
| 문서 | 설명 |
|
||||
|
||||
@@ -1145,6 +1145,6 @@ id prop 사용: scrollIntoView 등 DOM selector로 접근해야 할 때 필수
|
||||
- [컴포넌트 개발 규칙](components.md) - basic, composite, layout 컴포넌트
|
||||
- [레이아웃 JSON 스키마](layout-json.md) - 컴포넌트를 레이아웃 JSON에서 사용하는 방법
|
||||
- [sirsoft-admin_basic 컴포넌트](../../templates/_bundled/sirsoft-admin_basic/docs/components.md) - Admin 컴포넌트 목록
|
||||
- [sirsoft-basic 컴포넌트](templates/sirsoft-basic/components.md) - User 컴포넌트 목록 (58개)
|
||||
- [sirsoft-basic 컴포넌트](../../templates/_bundled/sirsoft-basic/docs/components.md) - User 컴포넌트 목록 (확장 소유)
|
||||
- [에디터 컴포넌트](editors.md) - HtmlEditor, CodeEditor 상세 가이드
|
||||
- [데이터 바인딩](data-binding.md) - `{{}}` 표현식, `$t:` 다국어
|
||||
@@ -453,4 +453,4 @@ export const Container: React.FC<ContainerProps> = ({ children }) => (
|
||||
- [컴포넌트 패턴](components-patterns.md)
|
||||
- [컴포넌트 고급 기능](components-advanced.md)
|
||||
- [sirsoft-admin_basic 컴포넌트](../../templates/_bundled/sirsoft-admin_basic/docs/components.md)
|
||||
- [sirsoft-basic 컴포넌트](templates/sirsoft-basic/components.md)
|
||||
- [sirsoft-basic 컴포넌트](../../templates/_bundled/sirsoft-basic/docs/components.md)
|
||||
@@ -25,11 +25,6 @@
|
||||
| [components-advanced.md](components-advanced.md) | componentEvent, 아이콘, 체크리스트 | 이벤트 통신, 아이콘 규칙, 개발 체크리스트 |
|
||||
|
||||
<!-- AUTO-GENERATED-START: frontend-template-reference -->
|
||||
### 템플릿별 레퍼런스
|
||||
|
||||
| 템플릿 식별자 | 컴포넌트 | 핸들러 | 레이아웃 |
|
||||
|--------------|---------|--------|--------|
|
||||
| `sirsoft-basic` | [components.md](templates/sirsoft-basic/components.md) | [handlers.md](templates/sirsoft-basic/handlers.md) | [layouts.md](templates/sirsoft-basic/layouts.md) |
|
||||
|
||||
<!-- AUTO-GENERATED-END: frontend-template-reference -->
|
||||
|
||||
@@ -156,6 +151,6 @@ import { Icon, IconName } from '../basic/Icon';
|
||||
- [레이아웃 JSON 스키마](./layout-json.md) - 컴포넌트를 레이아웃 JSON에서 사용하는 방법
|
||||
- [데이터 바인딩](./data-binding.md) - props에서 데이터 바인딩 사용법
|
||||
- [sirsoft-admin_basic 컴포넌트](../../templates/_bundled/sirsoft-admin_basic/docs/components.md) - Admin 컴포넌트 목록
|
||||
- [sirsoft-basic 컴포넌트](./templates/sirsoft-basic/components.md) - User 컴포넌트 목록 (58개)
|
||||
- [sirsoft-basic 컴포넌트](../../templates/_bundled/sirsoft-basic/docs/components.md) - User 컴포넌트 목록 (확장 소유)
|
||||
- [다크 모드](./dark-mode.md) - 컴포넌트 다크 모드 지원 가이드
|
||||
- [상태 관리](./state-management.md) - 전역/로컬 상태 관리 및 동기화 패턴
|
||||
@@ -25,7 +25,7 @@
|
||||
| `sirsoft-admin_basic` | 미선언 | ThemeToggle 존재, dark: variant 동작 |
|
||||
| `sirsoft-basic` | `true` | template.json에 선언, 완전 지원 |
|
||||
|
||||
> 상세 컴포넌트 목록: [sirsoft-admin_basic](../../templates/_bundled/sirsoft-admin_basic/docs/components.md), [sirsoft-basic](templates/sirsoft-basic/components.md)
|
||||
> 상세 컴포넌트 목록: [sirsoft-admin_basic](../../templates/_bundled/sirsoft-admin_basic/docs/components.md), [sirsoft-basic](../../templates/_bundled/sirsoft-basic/docs/components.md)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
| `sirsoft-admin_basic` | 미선언 | 데스크톱 중심, Tailwind responsive 클래스는 동작 |
|
||||
| `sirsoft-basic` | `true` | MobileNav 포함, portable preset 지원 |
|
||||
|
||||
> 상세 컴포넌트 목록: [sirsoft-admin_basic](../../templates/_bundled/sirsoft-admin_basic/docs/components.md), [sirsoft-basic](templates/sirsoft-basic/components.md)
|
||||
> 상세 컴포넌트 목록: [sirsoft-admin_basic](../../templates/_bundled/sirsoft-admin_basic/docs/components.md), [sirsoft-basic](../../templates/_bundled/sirsoft-basic/docs/components.md)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
## 템플릿별 상세 문서
|
||||
|
||||
<!-- AUTO-GENERATED-START: frontend-template-handlers -->
|
||||
| 템플릿 식별자 | 핸들러 문서 | TL;DR 핵심 |
|
||||
|--------------|-----------|----------|
|
||||
| `sirsoft-basic` | [handlers.md](templates/sirsoft-basic/handlers.md) | setTheme/initTheme: 다크/라이트 모드 전환 (admin과 동일 키 공유) |
|
||||
|
||||
<!-- AUTO-GENERATED-END: frontend-template-handlers -->
|
||||
|
||||
@@ -58,4 +55,4 @@
|
||||
- [템플릿 개발 가이드](template-development.md)
|
||||
- [다크 모드 지원](dark-mode.md)
|
||||
- [sirsoft-admin_basic 컴포넌트](../../templates/_bundled/sirsoft-admin_basic/docs/components.md)
|
||||
- [sirsoft-basic 컴포넌트](templates/sirsoft-basic/components.md)
|
||||
- [sirsoft-basic 컴포넌트](../../templates/_bundled/sirsoft-basic/docs/components.md)
|
||||
@@ -7,7 +7,7 @@
|
||||
| 템플릿 | 상태 | 문서 위치 |
|
||||
|---|---|---|
|
||||
| `sirsoft-admin_basic` | 이관 완료 | [templates/_bundled/sirsoft-admin_basic/docs/](../../../templates/_bundled/sirsoft-admin_basic/docs/README.md) |
|
||||
| `sirsoft-basic` | 이관 대기 (S3) | [components.md](sirsoft-basic/components.md) · [handlers.md](sirsoft-basic/handlers.md) · [layouts.md](sirsoft-basic/layouts.md) |
|
||||
| `sirsoft-basic` | 이관 완료 | [templates/_bundled/sirsoft-basic/docs/](../../../templates/_bundled/sirsoft-basic/docs/README.md) |
|
||||
|
||||
이관 배경·문서 체계 전반은 [extension-documentation.md](../../extension/extension-documentation.md)
|
||||
를 참고하세요.
|
||||
@@ -1,247 +0,0 @@
|
||||
# sirsoft-basic 컴포넌트
|
||||
|
||||
> **템플릿 식별자**: `sirsoft-basic` (type: user, v0.4.16)
|
||||
> **관련 문서**: [핸들러](./handlers.md) | [레이아웃](./layouts.md) | [컴포넌트 Props 레퍼런스](../../component-props.md)
|
||||
|
||||
---
|
||||
|
||||
## TL;DR (5초 요약)
|
||||
|
||||
```text
|
||||
1. Basic 26개: HTML 래핑 (Div, Button, Input, Select, Form, A, H1~H4, PasswordInput 등)
|
||||
2. Composite 27개: UI 패턴 캡슐화 (Header, Footer, Modal, ProductCard, Pagination 등)
|
||||
3. Layout 5개: 페이지 구조 (Container, Grid, Flex, SectionLayout, ThreeColumnLayout)
|
||||
4. 사용자(User) 템플릿 전용 — 모듈 레이아웃(user/ 하위)에서 사용
|
||||
5. features: dark_mode, responsive, multi_language, multi_currency 지원
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 목차
|
||||
|
||||
1. [컴포넌트 개요](#컴포넌트-개요)
|
||||
2. [Basic Components (26개)](#basic-components-26개)
|
||||
3. [Composite Components (27개)](#composite-components-27개)
|
||||
4. [Layout Components (5개)](#layout-components-5개)
|
||||
5. [sirsoft-admin_basic과의 차이](#sirsoft-admin_basic과의-차이)
|
||||
|
||||
---
|
||||
|
||||
## 컴포넌트 개요
|
||||
|
||||
| 타입 | 개수 | 설명 |
|
||||
|------|------|------|
|
||||
| Basic | 26 | HTML 태그 래핑 — 최소 단위 컴포넌트 |
|
||||
| Composite | 27 | 기본 컴포넌트 조합 — UI 패턴 캡슐화 |
|
||||
| Layout | 5 | 페이지 구조 정의 — 컨테이너/그리드/플렉스 |
|
||||
| **합계** | **58** | |
|
||||
|
||||
**소스**: `templates/_bundled/sirsoft-basic/components.json`
|
||||
**컴포넌트 소스**: `templates/_bundled/sirsoft-basic/src/components/{basic,composite,layout}/*.tsx`
|
||||
|
||||
---
|
||||
|
||||
## Basic Components (26개)
|
||||
|
||||
HTML 태그를 래핑하는 최소 단위 컴포넌트입니다.
|
||||
|
||||
### 텍스트/링크
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props | 바인딩 |
|
||||
|----------|------|-----------|--------|
|
||||
| `A` | 앵커/링크 | href | - |
|
||||
| `H1` | 제목 (h1) | - | - |
|
||||
| `H2` | 제목 (h2) | - | - |
|
||||
| `H3` | 제목 (h3) | - | - |
|
||||
| `H4` | 제목 (h4) | - | - |
|
||||
| `P` | 문단 | - | - |
|
||||
| `Span` | 인라인 텍스트 | - | - |
|
||||
| `Label` | 라벨 | - | - |
|
||||
|
||||
### 컨테이너
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props | 바인딩 |
|
||||
|----------|------|-----------|--------|
|
||||
| `Div` | 범용 컨테이너 | - | - |
|
||||
| `Nav` | 네비게이션 래퍼 | - | - |
|
||||
| `Form` | 폼 컨테이너 | - | - |
|
||||
| `Header` | HTML header 래퍼 | - | - |
|
||||
| `Footer` | HTML footer 래퍼 | - | - |
|
||||
| `Hr` | 수평선 | - | - |
|
||||
|
||||
### 폼 입력
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props | 바인딩 |
|
||||
|----------|------|-----------|--------|
|
||||
| `Input` | 텍스트 입력 | label, error | checkable |
|
||||
| `Select` | 선택 박스 | label, error | - |
|
||||
| `Option` | Select 내부 옵션 | value, disabled | - |
|
||||
| `Textarea` | 텍스트 영역 | label, error | - |
|
||||
| `Checkbox` | 체크박스 | label | checked |
|
||||
| `PasswordInput` | 비밀번호 입력 (보기/숨기기, 조건 검증, 확인 일치) | label, error, showToggle, showValidation, isConfirmField, confirmTarget, showRules, ... | - |
|
||||
| `Button` | 버튼 | variant, size | - |
|
||||
|
||||
### 미디어
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props | 바인딩 |
|
||||
|----------|------|-----------|--------|
|
||||
| `Icon` | FontAwesome 아이콘 | name | - |
|
||||
| `Img` | 이미지 | src, alt | - |
|
||||
|
||||
### 기타
|
||||
|
||||
| 컴포넌트 | 설명 |
|
||||
|----------|------|
|
||||
| `Table` | HTML table wrapper |
|
||||
| `Ul` | 순서 없는 리스트 |
|
||||
| `Li` | 리스트 아이템 |
|
||||
|
||||
---
|
||||
|
||||
## Composite Components (27개)
|
||||
|
||||
기본 컴포넌트를 조합하여 UI 패턴을 캡슐화한 복합 컴포넌트입니다.
|
||||
|
||||
### 사이트 레이아웃
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `Header` | 사이트 헤더 (로고, 네비게이션, 검색, 사용자 메뉴) | siteName |
|
||||
| `Footer` | 사이트 푸터 (저작권, 링크, 소셜) | siteName |
|
||||
| `MobileNav` | 모바일 네비게이션 드로어 | - |
|
||||
|
||||
### 쇼핑몰
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `ProductCard` | 상품 카드 (이미지, 제목, 가격) | product, showDiscount |
|
||||
| `ProductImageViewer` | 상품 이미지 뷰어 (메인 + 썸네일 + 라이트박스) | images |
|
||||
| `QuantitySelector` | 수량 선택기 (+/- 버튼) | value, min, max |
|
||||
|
||||
### 게시판
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `PostReactions` | 게시글 리액션 버튼 그룹 | postId, reactions |
|
||||
| `ExpandableContent` | 콘텐츠 펼치기/접기 (높이 초과 시 그라데이션) | maxHeight, expandText, collapseText |
|
||||
|
||||
### 인증
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `SocialLoginButtons` | 소셜 로그인 버튼 그룹 | providers |
|
||||
|
||||
### 사용자
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `Avatar` | 사용자 아바타 (이미지 또는 이름 첫 글자) | name, avatar, size, text |
|
||||
| `AvatarUploader` | 아바타 이미지 업로드 (원형 UI, 즉시 업로드) | src, fallbackText, size, uploadEndpoint, deleteEndpoint, showDeleteButton, ... |
|
||||
| `UserInfo` | 사용자 정보 표시 및 드롭다운 | name, userId, subText, isGuest, showDropdown, clickable, ... |
|
||||
|
||||
### 에디터/콘텐츠
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `HtmlContent` | HTML 안전 렌더링 (DOMPurify XSS 방지) | content, text, isHtml, purifyConfig |
|
||||
| `HtmlEditor` | HTML/텍스트 에디터 (WYSIWYG, 미리보기) | name, value, placeholder, isHtml, showPreview, minHeight |
|
||||
| `RichTextEditor` | 리치 텍스트 에디터 | value, placeholder |
|
||||
| `ImageGallery` | 이미지 갤러리 (썸네일 + 메인 이미지) | images |
|
||||
|
||||
### 파일/미디어
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `FileUploader` | 파일 업로드 | accept, maxSize, multiple |
|
||||
|
||||
### 네비게이션/피드백
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `TabNavigation` | 탭 네비게이션 (underline/pills/enclosed) | tabs, activeTabId, variant, onTabChange, hiddenTabIds |
|
||||
| `Pagination` | 페이지네이션 | currentPage, totalPages, maxVisiblePages, showFirstLast, prevText, nextText |
|
||||
|
||||
> **TabNavigation `hiddenTabIds`**: 특정 조건에서 탭을 동적으로 숨길 때 사용합니다. 탭 아이템의 `id` 배열을 전달하면 해당 탭이 렌더링에서 제외됩니다.
|
||||
> ```json
|
||||
> {
|
||||
> "name": "TabNavigation",
|
||||
> "props": {
|
||||
> "tabs": [...],
|
||||
> "hiddenTabIds": "{{_global.modules?.['sirsoft-ecommerce']?.inquiry?.board_slug ? [] : ['qna']}}"
|
||||
> }
|
||||
> }
|
||||
> ```
|
||||
| `SearchBar` | 검색 바 (자동완성 지원) | name, placeholder, value, showButton, suggestions, showSuggestions |
|
||||
| `Modal` | 모달 다이얼로그 (ESC, 포커스 트랩) | isOpen, onClose, title, width |
|
||||
| `ConfirmDialog` | 확인/취소 다이얼로그 | isOpen, onClose, title, message, confirmText, cancelText, ... |
|
||||
| `Toast` | 토스트 알림 | toasts, position, duration |
|
||||
| `ThemeToggle` | 테마 전환 토글 (auto/light/dark) | autoText, lightText, darkText |
|
||||
|
||||
### 페이지 전환
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `PageTransitionIndicator` | 페이지 전환 로딩 인디케이터 | - |
|
||||
| `PageTransitionBlur` | 페이지 전환 시 콘텐츠 블러 오버레이 | - |
|
||||
| `PageSkeleton` | 동적 스켈레톤 UI 렌더러 | components, options |
|
||||
|
||||
---
|
||||
|
||||
## Layout Components (5개)
|
||||
|
||||
페이지 구조를 정의하는 레이아웃 컴포넌트입니다.
|
||||
|
||||
| 컴포넌트 | 설명 | 주요 Props |
|
||||
|----------|------|-----------|
|
||||
| `Container` | 레이아웃 컨테이너 | maxWidth |
|
||||
| `Flex` | Flexbox 레이아웃 | direction, gap |
|
||||
| `Grid` | Grid 레이아웃 | cols, gap |
|
||||
| `SectionLayout` | 섹션 레이아웃 (제목, 부제목, 패딩) | title, subtitle, padding, background |
|
||||
| `ThreeColumnLayout` | 3단 레이아웃 (좌/중/우) | leftWidth, centerWidth, rightWidth, gap |
|
||||
|
||||
---
|
||||
|
||||
## sirsoft-admin_basic과의 차이
|
||||
|
||||
### 공통 컴포넌트
|
||||
|
||||
두 템플릿 모두에 존재하는 컴포넌트:
|
||||
|
||||
| 타입 | 공통 컴포넌트 |
|
||||
|------|-------------|
|
||||
| Basic | A, Button, Checkbox, Div, Form, H1~H4, Icon, Img, Input, Label, Li, Nav, P, Select, Span, Table, Textarea, Ul |
|
||||
| Composite | ConfirmDialog, FileUploader, HtmlContent, HtmlEditor, ImageGallery, Modal, Pagination, ProductCard, SearchBar, TabNavigation, ThemeToggle, Toast |
|
||||
| Layout | Container, Flex, Grid, SectionLayout, ThreeColumnLayout |
|
||||
|
||||
### sirsoft-basic 전용 컴포넌트
|
||||
|
||||
| 타입 | 전용 컴포넌트 | 설명 |
|
||||
|------|-------------|------|
|
||||
| Basic | `PasswordInput` | 비밀번호 입력 (보기/숨기기, 검증) |
|
||||
| Basic | `Header`, `Footer`, `Hr` | HTML5 시맨틱 태그 |
|
||||
| Composite | `Header`, `Footer` | 사이트 헤더/푸터 (composite) |
|
||||
| Composite | `MobileNav` | 모바일 드로어 네비게이션 |
|
||||
| Composite | `ProductImageViewer` | 상품 이미지 뷰어 |
|
||||
| Composite | `QuantitySelector` | 수량 선택기 |
|
||||
| Composite | `PostReactions` | 게시글 리액션 |
|
||||
| Composite | `SocialLoginButtons` | 소셜 로그인 |
|
||||
| Composite | `Avatar`, `AvatarUploader` | 아바타 관련 |
|
||||
| Composite | `UserInfo` | 사용자 정보 드롭다운 |
|
||||
| Composite | `RichTextEditor` | 리치 텍스트 에디터 |
|
||||
| Composite | `ExpandableContent` | 콘텐츠 접기/펼치기 |
|
||||
| Composite | `PageTransitionBlur` | 전환 블러 효과 |
|
||||
| Composite | `PageSkeleton` | 스켈레톤 UI |
|
||||
|
||||
### sirsoft-admin_basic 전용 컴포넌트 (이 템플릿에 없음)
|
||||
|
||||
AdminSidebar, AdminHeader, AdminFooter, PageHeader, DataGrid, CodeEditor, DynamicFieldList, MultilingualInput, TagInput, Toggle, RadioGroup, FormField, SlotContainer, FilterGroup 등 관리자 전용 컴포넌트 39개+
|
||||
|
||||
---
|
||||
|
||||
## 관련 문서
|
||||
|
||||
- [sirsoft-basic 핸들러](./handlers.md)
|
||||
- [sirsoft-basic 레이아웃](./layouts.md)
|
||||
- [sirsoft-admin_basic 컴포넌트](../../../../templates/_bundled/sirsoft-admin_basic/docs/components.md)
|
||||
- [컴포넌트 개발 규칙](../../components.md)
|
||||
- [컴포넌트 Props 레퍼런스](../../component-props.md)
|
||||
@@ -1,431 +0,0 @@
|
||||
# sirsoft-basic 핸들러
|
||||
|
||||
> **템플릿 식별자**: `sirsoft-basic` (type: user)
|
||||
> **관련 문서**: [액션 핸들러 개요](../../actions-handlers.md) | [컴포넌트](./components.md) | [레이아웃](./layouts.md)
|
||||
|
||||
---
|
||||
|
||||
## TL;DR (5초 요약)
|
||||
|
||||
```text
|
||||
1. setTheme/initTheme: 다크/라이트 모드 전환 (admin과 동일 키 공유)
|
||||
2. 장바구니 6종: 선택/옵션/삭제/재계산 핸들러
|
||||
3. 상품 옵션 2종: 옵션 완료 시 자동 추가/수량 변경
|
||||
4. 다중 통화 5종: 가격 표시/포맷/통화 기호/선호 통화 로드/저장
|
||||
5. 스토리지 6종: 비회원 장바구니 키 관리 (localStorage + API 발급)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 목차
|
||||
|
||||
1. [테마 핸들러](#테마-핸들러)
|
||||
2. [장바구니 핸들러](#장바구니-핸들러)
|
||||
3. [장바구니 옵션 변경 핸들러](#장바구니-옵션-변경-핸들러)
|
||||
4. [상품 옵션 핸들러](#상품-옵션-핸들러)
|
||||
5. [다중 통화 핸들러](#다중-통화-핸들러)
|
||||
6. [스토리지 핸들러](#스토리지-핸들러)
|
||||
7. [핸들러 등록 맵](#핸들러-등록-맵)
|
||||
|
||||
---
|
||||
|
||||
## 테마 핸들러
|
||||
|
||||
**소스**: `src/handlers/setThemeHandler.ts`
|
||||
|
||||
sirsoft-admin_basic과 동일한 localStorage 키(`g7_color_scheme`)를 사용하여 테마 설정을 공유합니다.
|
||||
|
||||
### setTheme
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "click",
|
||||
"handler": "setTheme",
|
||||
"params": {
|
||||
"theme": "dark"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 필드 | 타입 | 필수 | 설명 |
|
||||
|------|------|------|------|
|
||||
| `theme` | string | ✅ | `"light"`, `"dark"`, `"auto"` (시스템 설정 따름) |
|
||||
|
||||
### initTheme
|
||||
|
||||
앱 시작 시 `init_actions`에서 호출. params 없음.
|
||||
|
||||
```json
|
||||
{
|
||||
"init_actions": [
|
||||
{ "handler": "initTheme" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 장바구니 핸들러
|
||||
|
||||
**소스**: `src/handlers/cartHandlers.ts`
|
||||
|
||||
장바구니 페이지에서 상품 선택, 옵션 변경, 삭제 등을 처리합니다.
|
||||
|
||||
### toggleCartItemSelection
|
||||
|
||||
장바구니 아이템 선택/해제를 토글합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "toggleCartItemSelection",
|
||||
"params": {
|
||||
"itemId": "{{item.id}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### selectAllCartItems
|
||||
|
||||
모든 장바구니 아이템을 선택/해제합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "selectAllCartItems",
|
||||
"params": {
|
||||
"selected": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### setCartOption
|
||||
|
||||
장바구니 아이템의 옵션을 변경합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "setCartOption",
|
||||
"params": {
|
||||
"itemId": "{{item.id}}",
|
||||
"optionId": "{{selectedOption.id}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### openCartDeleteModal
|
||||
|
||||
장바구니 삭제 확인 모달을 엽니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "openCartDeleteModal",
|
||||
"params": {
|
||||
"itemId": "{{item.id}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### openCartOptionModal
|
||||
|
||||
장바구니 옵션 변경 모달을 엽니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "openCartOptionModal",
|
||||
"params": {
|
||||
"itemId": "{{item.id}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### recalculateCart
|
||||
|
||||
장바구니 합계를 재계산합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "recalculateCart"
|
||||
}
|
||||
```
|
||||
|
||||
### 장바구니 핸들러 요약
|
||||
|
||||
| 핸들러 | params | 설명 |
|
||||
|--------|--------|------|
|
||||
| `toggleCartItemSelection` | `{ itemId }` | 아이템 선택 토글 |
|
||||
| `selectAllCartItems` | `{ selected }` | 전체 선택/해제 |
|
||||
| `setCartOption` | `{ itemId, optionId }` | 옵션 변경 |
|
||||
| `openCartDeleteModal` | `{ itemId }` | 삭제 모달 열기 |
|
||||
| `openCartOptionModal` | `{ itemId }` | 옵션 변경 모달 열기 |
|
||||
| `recalculateCart` | 없음 | 합계 재계산 |
|
||||
|
||||
---
|
||||
|
||||
## 장바구니 옵션 변경 핸들러
|
||||
|
||||
**소스**: `src/handlers/cartOptionChange.ts`
|
||||
|
||||
장바구니 옵션 변경 모달에서 옵션 선택 및 매칭을 처리합니다.
|
||||
|
||||
### findMatchingOption
|
||||
|
||||
선택한 옵션 값들로 매칭되는 상품 옵션을 찾습니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "findMatchingOption",
|
||||
"params": {
|
||||
"options": "{{_local.options}}",
|
||||
"selection": "{{_local.optionSelection}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### initCartOptionSelection
|
||||
|
||||
옵션 변경 모달 초기화 시 현재 선택된 옵션을 설정합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "initCartOptionSelection",
|
||||
"params": {
|
||||
"currentOption": "{{item.option}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 상품 옵션 핸들러
|
||||
|
||||
**소스**: `src/handlers/productOptions.ts`
|
||||
|
||||
상품 상세 페이지에서 옵션 선택 및 수량 변경을 처리합니다.
|
||||
|
||||
### addSelectedItemIfComplete (sirsoft-basic.addSelectedItemIfComplete)
|
||||
|
||||
모든 옵션 그룹 선택 완료 시 선택 아이템 목록에 자동 추가합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "sirsoft-basic.addSelectedItemIfComplete",
|
||||
"params": {
|
||||
"newGroupName": "{{groupName}}",
|
||||
"newValue": "{{selectedValue}}",
|
||||
"optionGroups": "{{product?.data?.option_groups}}",
|
||||
"options": "{{product?.data?.options}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### updateSelectedItemQuantity (sirsoft-basic.updateSelectedItemQuantity)
|
||||
|
||||
선택된 아이템의 수량을 변경합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "sirsoft-basic.updateSelectedItemQuantity",
|
||||
"params": {
|
||||
"optionId": "{{option.id}}",
|
||||
"quantity": "{{newQuantity}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 다중 통화 핸들러
|
||||
|
||||
### getDisplayPrice (sirsoft-basic.getDisplayPrice)
|
||||
|
||||
**소스**: `src/handlers/getDisplayPrice.ts`
|
||||
|
||||
사용자 선호 통화에 맞는 가격을 반환합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "sirsoft-basic.getDisplayPrice",
|
||||
"params": {
|
||||
"product": "{{product.data}}",
|
||||
"priceField": "selling_price"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 필드 | 타입 | 필수 | 설명 |
|
||||
|------|------|------|------|
|
||||
| `product` | object | ✅ | 상품 객체 |
|
||||
| `priceField` | string | ✅ | `"selling_price"` 또는 `"list_price"` |
|
||||
| `currencyCode` | string | ❌ | 통화 코드 (미지정 시 전역 설정 사용) |
|
||||
|
||||
### formatCurrency (sirsoft-basic.formatCurrency)
|
||||
|
||||
**소스**: `src/handlers/formatCurrency.ts`
|
||||
|
||||
숫자 값을 통화 형식 문자열로 변환합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "sirsoft-basic.formatCurrency",
|
||||
"params": {
|
||||
"value": 10000,
|
||||
"currencyCode": "KRW"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| 필드 | 타입 | 필수 | 설명 |
|
||||
|------|------|------|------|
|
||||
| `value` | number | ✅ | 포맷팅할 숫자 값 |
|
||||
| `currencyCode` | string | ❌ | 통화 코드 (KRW, USD, JPY, CNY, EUR) |
|
||||
| `locale` | string | ❌ | 로케일 (미지정 시 통화 기본 로케일 사용) |
|
||||
|
||||
지원 통화: KRW (₩), USD ($), JPY (¥), CNY (¥), EUR (€)
|
||||
|
||||
### getCurrencySymbol (sirsoft-basic.getCurrencySymbol)
|
||||
|
||||
통화 기호를 반환합니다.
|
||||
|
||||
### loadPreferredCurrency (sirsoft-basic.loadPreferredCurrency)
|
||||
|
||||
**소스**: `src/handlers/loadPreferredCurrency.ts`
|
||||
|
||||
localStorage에서 선호 통화를 로드하여 전역 상태(`_global.preferredCurrency`)에 설정합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"init_actions": [
|
||||
{
|
||||
"handler": "sirsoft-basic.loadPreferredCurrency",
|
||||
"params": { "defaultCurrency": "KRW" }
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### savePreferredCurrency (sirsoft-basic.savePreferredCurrency)
|
||||
|
||||
선호 통화를 localStorage에 저장합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "sirsoft-basic.savePreferredCurrency",
|
||||
"params": {
|
||||
"currencyCode": "{{selectedCurrency}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 스토리지 핸들러
|
||||
|
||||
**소스**: `src/handlers/storageHandlers.ts`
|
||||
|
||||
비로그인 사용자의 장바구니 키 등 클라이언트 스토리지를 관리합니다.
|
||||
|
||||
### initCartKey
|
||||
|
||||
장바구니 키를 초기화합니다. localStorage에 있으면 로드, 없으면 API를 통해 발급합니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"init_actions": [
|
||||
{ "handler": "initCartKey" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### getCartKey / clearCartKey / regenerateCartKey
|
||||
|
||||
```json
|
||||
{ "handler": "getCartKey" }
|
||||
{ "handler": "clearCartKey" }
|
||||
{ "handler": "regenerateCartKey" }
|
||||
```
|
||||
|
||||
### saveToStorage / loadFromStorage
|
||||
|
||||
범용 localStorage 저장/로드 핸들러입니다.
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "saveToStorage",
|
||||
"params": {
|
||||
"key": "g7_some_setting",
|
||||
"value": "{{_local.settingValue}}"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"handler": "loadFromStorage",
|
||||
"params": {
|
||||
"key": "g7_some_setting",
|
||||
"stateKey": "savedSetting"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 스토리지 핸들러 요약
|
||||
|
||||
| 핸들러 | params | 설명 |
|
||||
|--------|--------|------|
|
||||
| `initCartKey` | 없음 | 장바구니 키 초기화 (localStorage + API) |
|
||||
| `getCartKey` | 없음 | 현재 장바구니 키 반환 |
|
||||
| `clearCartKey` | 없음 | 장바구니 키 삭제 |
|
||||
| `regenerateCartKey` | 없음 | 장바구니 키 재발급 |
|
||||
| `saveToStorage` | `{ key, value }` | localStorage 저장 |
|
||||
| `loadFromStorage` | `{ key, stateKey }` | localStorage 로드 → 상태에 설정 |
|
||||
|
||||
---
|
||||
|
||||
## 핸들러 등록 맵
|
||||
|
||||
**소스**: `src/handlers/index.ts`
|
||||
|
||||
| 등록 키 | 소스 파일 | 설명 |
|
||||
|---------|----------|------|
|
||||
| `setTheme` | setThemeHandler.ts | 테마 변경 |
|
||||
| `initTheme` | setThemeHandler.ts | 테마 초기화 |
|
||||
| `toggleCartItemSelection` | cartHandlers.ts | 장바구니 아이템 선택 |
|
||||
| `selectAllCartItems` | cartHandlers.ts | 장바구니 전체 선택 |
|
||||
| `setCartOption` | cartHandlers.ts | 장바구니 옵션 변경 |
|
||||
| `openCartDeleteModal` | cartHandlers.ts | 삭제 모달 열기 |
|
||||
| `openCartOptionModal` | cartHandlers.ts | 옵션 모달 열기 |
|
||||
| `recalculateCart` | cartHandlers.ts | 장바구니 재계산 |
|
||||
| `findMatchingOption` | cartOptionChange.ts | 매칭 옵션 검색 |
|
||||
| `initCartOptionSelection` | cartOptionChange.ts | 옵션 선택 초기화 |
|
||||
| `sirsoft-basic.addSelectedItemIfComplete` | productOptions.ts | 옵션 완료 시 자동 추가 |
|
||||
| `sirsoft-basic.updateSelectedItemQuantity` | productOptions.ts | 수량 변경 |
|
||||
| `sirsoft-basic.getDisplayPrice` | getDisplayPrice.ts | 통화별 가격 표시 |
|
||||
| `sirsoft-basic.formatCurrency` | formatCurrency.ts | 통화 포맷팅 |
|
||||
| `sirsoft-basic.getCurrencySymbol` | formatCurrency.ts | 통화 기호 |
|
||||
| `sirsoft-basic.loadPreferredCurrency` | loadPreferredCurrency.ts | 선호 통화 로드 |
|
||||
| `sirsoft-basic.savePreferredCurrency` | loadPreferredCurrency.ts | 선호 통화 저장 |
|
||||
| `initCartKey` | storageHandlers.ts | 장바구니 키 초기화 |
|
||||
| `getCartKey` | storageHandlers.ts | 장바구니 키 조회 |
|
||||
| `clearCartKey` | storageHandlers.ts | 장바구니 키 삭제 |
|
||||
| `regenerateCartKey` | storageHandlers.ts | 장바구니 키 재발급 |
|
||||
| `saveToStorage` | storageHandlers.ts | localStorage 저장 |
|
||||
| `loadFromStorage` | storageHandlers.ts | localStorage 로드 |
|
||||
|
||||
---
|
||||
|
||||
## 주의사항
|
||||
|
||||
```text
|
||||
이 핸들러들은 sirsoft-basic 템플릿에서만 등록됨
|
||||
sirsoft-basic. 접두사 핸들러는 풀네임으로 호출해야 함
|
||||
setLocale은 엔진 레벨(ActionDispatcher) 빌트인 — 별도 등록 불필요
|
||||
✅ 범용 핸들러(navigate, apiCall, setState 등)는 actions-handlers.md 참조
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 관련 문서
|
||||
|
||||
- [액션 핸들러 개요](../../actions-handlers.md)
|
||||
- [sirsoft-basic 컴포넌트](./components.md)
|
||||
- [sirsoft-basic 레이아웃](./layouts.md)
|
||||
- [sirsoft-admin_basic 핸들러](../../../../templates/_bundled/sirsoft-admin_basic/docs/handlers.md)
|
||||
@@ -1,647 +0,0 @@
|
||||
# sirsoft-basic 레이아웃
|
||||
|
||||
> **템플릿 식별자**: `sirsoft-basic` (type: user)
|
||||
> **관련 문서**: [컴포넌트](./components.md) | [핸들러](./handlers.md) | [레이아웃 JSON 스키마](../../layout-json.md)
|
||||
|
||||
---
|
||||
|
||||
## TL;DR (5초 요약)
|
||||
|
||||
```text
|
||||
1. 베이스: _user_base.json (헤더 + 푸터 + 모바일 네비 + 콘텐츠 슬롯)
|
||||
2. 코어 페이지 30개+: 인증, 게시판, 쇼핑몰, 마이페이지, 검색, 프로필
|
||||
3. Partial 100개+: 폼, 모달, 탭, 카드, 목록, 필터, 타입별 렌더러
|
||||
4. 에러 페이지 6개: 401, 403, 404, 500, 503, maintenance
|
||||
5. 패턴: 게시판(타입별 렌더러), 쇼핑몰(장바구니/결제 플로우), 마이페이지(탭 네비게이션)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 목차
|
||||
|
||||
1. [페이지 맵 (트리 구조)](#페이지-맵-트리-구조)
|
||||
2. [카테고리별 가이드](#카테고리별-가이드)
|
||||
- [인증 페이지 패턴](#인증-페이지-패턴)
|
||||
- [게시판 패턴](#게시판-패턴)
|
||||
- [쇼핑몰 패턴](#쇼핑몰-패턴)
|
||||
- [마이페이지 패턴](#마이페이지-패턴)
|
||||
- [검색 패턴](#검색-패턴)
|
||||
- [기타 페이지 패턴](#기타-페이지-패턴)
|
||||
- [에러 페이지 패턴](#에러-페이지-패턴)
|
||||
|
||||
---
|
||||
|
||||
## 페이지 맵 (트리 구조)
|
||||
|
||||
```text
|
||||
_user_base.json (베이스 레이아웃)
|
||||
│
|
||||
├── home.json (홈/대시보드)
|
||||
│ └── partials/home/
|
||||
│ ├── _welcome_card.json (환영 카드)
|
||||
│ ├── _stat_card_users.json (통계: 사용자)
|
||||
│ ├── _stat_card_posts.json (통계: 게시글)
|
||||
│ ├── _stat_card_comments.json (통계: 댓글)
|
||||
│ ├── _stat_card_boards.json (통계: 게시판)
|
||||
│ ├── _recent_posts.json (최근 게시글)
|
||||
│ ├── _popular_boards.json (인기 게시판)
|
||||
│ ├── _board_summary.json (게시판 요약)
|
||||
│ ├── _community_guide.json (커뮤니티 가이드)
|
||||
│ └── _shop_promo.json (쇼핑 프로모션)
|
||||
│
|
||||
├── 인증 (auth/)
|
||||
│ ├── login.json (로그인)
|
||||
│ ├── register.json (회원가입)
|
||||
│ ├── forgot_password.json (비밀번호 찾기)
|
||||
│ ├── reset_password.json (비밀번호 재설정)
|
||||
│ └── partials/auth/
|
||||
│ ├── _login_form.json (로그인 폼)
|
||||
│ ├── _register_form.json (회원가입 폼)
|
||||
│ ├── _redirect_if_logged_in.json (로그인 상태 리다이렉트)
|
||||
│ ├── _modal_terms.json (이용약관 모달)
|
||||
│ └── _modal_privacy.json (개인정보 처리방침 모달)
|
||||
│
|
||||
├── 게시판 (board/)
|
||||
│ ├── boards.json (게시판 목록)
|
||||
│ │ └── partials/board/boards/
|
||||
│ │ └── _board_card.json (게시판 카드)
|
||||
│ ├── index.json (게시글 목록)
|
||||
│ │ └── partials/board/index/
|
||||
│ │ ├── _type_renderer.json (타입별 렌더러 분기)
|
||||
│ │ ├── _empty_states.json (빈 상태)
|
||||
│ │ ├── _loading_error.json (로딩/에러)
|
||||
│ │ └── _write_button.json (글쓰기 버튼)
|
||||
│ ├── show.json (게시글 상세)
|
||||
│ │ └── partials/board/show/
|
||||
│ │ ├── _type_renderer.json (타입별 렌더러 분기)
|
||||
│ │ ├── _comment_section.json (댓글 섹션)
|
||||
│ │ ├── _comment_item.json (댓글 아이템)
|
||||
│ │ ├── _comment_input.json (댓글 입력)
|
||||
│ │ ├── _reply_section.json (답글 섹션)
|
||||
│ │ ├── _navigation.json (이전글/다음글)
|
||||
│ │ ├── _post_attachments.json (첨부파일)
|
||||
│ │ └── modals/
|
||||
│ │ ├── _modal_delete.json (삭제 확인)
|
||||
│ │ ├── _modal_report.json (신고)
|
||||
│ │ └── _password_verify_modal.json (비밀번호 확인)
|
||||
│ ├── form.json (게시글 작성/수정)
|
||||
│ │ └── partials/board/form/
|
||||
│ │ ├── _post_form.json (게시글 폼)
|
||||
│ │ ├── _parent_post.json (원글 표시)
|
||||
│ │ ├── _type_renderer.json (타입별 렌더러 분기)
|
||||
│ │ └── _password_verify_modal.json (비밀번호 확인)
|
||||
│ ├── popular.json (인기글)
|
||||
│ │ └── partials/board/popular/
|
||||
│ │ ├── _popular_list.json (인기글 리스트)
|
||||
│ │ └── _popular_item.json (인기글 아이템)
|
||||
│ └── partials/board/types/ (게시판 타입별 부분 레이아웃)
|
||||
│ ├── basic/
|
||||
│ │ ├── index.json (기본 목록)
|
||||
│ │ ├── show.json (기본 상세)
|
||||
│ │ └── form.json (기본 폼)
|
||||
│ ├── card/
|
||||
│ │ └── index.json (카드형 목록)
|
||||
│ └── gallery/
|
||||
│ └── index.json (갤러리형 목록)
|
||||
│
|
||||
├── 쇼핑몰 (shop/)
|
||||
│ ├── index.json (상품 목록/메인)
|
||||
│ │ └── partials/shop/list/
|
||||
│ │ ├── _product_grid.json (상품 그리드)
|
||||
│ │ ├── _popular_products.json (인기 상품)
|
||||
│ │ ├── _new_products.json (신상품)
|
||||
│ │ ├── _recent_products.json (최근 본 상품)
|
||||
│ │ ├── _category_filter.json (카테고리 필터)
|
||||
│ │ ├── _category_breadcrumb.json (카테고리 경로)
|
||||
│ │ └── _search_filter_bar.json (검색/필터 바)
|
||||
│ ├── category.json (카테고리 상품)
|
||||
│ ├── show.json (상품 상세)
|
||||
│ │ └── partials/shop/detail/
|
||||
│ │ ├── _header.json (상품 헤더)
|
||||
│ │ ├── _info_summary.json (상품 정보 요약)
|
||||
│ │ ├── _purchase_card.json (구매 카드)
|
||||
│ │ ├── _price_mobile.json (모바일 가격)
|
||||
│ │ ├── _tab_detail.json (상세 탭)
|
||||
│ │ ├── _tab_reviews.json (리뷰 탭)
|
||||
│ │ ├── _tab_qna.json (Q&A 탭)
|
||||
│ │ ├── _review_avatar.json (리뷰 아바타)
|
||||
│ │ ├── _modal_cart_added.json (장바구니 추가 확인)
|
||||
│ │ ├── _modal_coupon_download_confirm.json (쿠폰 다운로드 확인)
|
||||
│ │ ├── _modal_login_required.json (로그인 필요)
|
||||
│ │ └── _modal_review_image.json (리뷰 이미지 확대)
|
||||
│ ├── cart.json (장바구니)
|
||||
│ │ └── partials/shop/
|
||||
│ │ ├── _cart_list.json (장바구니 목록)
|
||||
│ │ ├── _cart_item.json (장바구니 아이템)
|
||||
│ │ ├── _cart_summary.json (장바구니 요약)
|
||||
│ │ ├── _product_purchase_card.json (구매 카드)
|
||||
│ │ ├── _modal_cart_delete_confirm.json (삭제 확인)
|
||||
│ │ ├── _modal_cart_option_change.json (옵션 변경)
|
||||
│ │ ├── _modal_cart_unavailable.json (품절 안내)
|
||||
│ │ └── _modal_temp_order_not_found.json (임시주문 없음)
|
||||
│ ├── checkout.json (결제)
|
||||
│ │ └── partials/shop/
|
||||
│ │ ├── _checkout_orderer.json (주문자 정보)
|
||||
│ │ ├── _checkout_shipping.json (배송 정보)
|
||||
│ │ ├── _checkout_items.json (주문 상품)
|
||||
│ │ ├── _checkout_discount.json (할인/쿠폰)
|
||||
│ │ ├── _checkout_mileage.json (마일리지)
|
||||
│ │ ├── _checkout_payment.json (결제 수단)
|
||||
│ │ ├── _checkout_summary.json (주문 요약)
|
||||
│ │ ├── _modal_address_manage.json (배송지 관리)
|
||||
│ │ ├── _modal_coupon_download.json (쿠폰 다운로드)
|
||||
│ │ └── _modal_exclusive_coupon_confirm.json (전용 쿠폰 확인)
|
||||
│ └── order_complete.json (주문 완료)
|
||||
│
|
||||
├── 마이페이지 (mypage/)
|
||||
│ ├── profile.json (프로필 보기)
|
||||
│ ├── profile-edit.json (프로필 수정)
|
||||
│ │ └── partials/mypage/profile/
|
||||
│ │ ├── _view.json (프로필 보기 섹션)
|
||||
│ │ ├── _edit.json (프로필 수정 섹션)
|
||||
│ │ ├── _password_verify_section.json (비밀번호 확인)
|
||||
│ │ └── _modal_withdraw.json (회원 탈퇴)
|
||||
│ ├── orders.json (주문 내역)
|
||||
│ │ └── partials/mypage/orders/
|
||||
│ │ └── _list.json (주문 목록)
|
||||
│ ├── orders/show.json (주문 상세)
|
||||
│ │ └── partials/mypage/orders/
|
||||
│ │ ├── _status_header.json (주문 상태 헤더)
|
||||
│ │ ├── _items.json (주문 상품)
|
||||
│ │ ├── _shipping.json (배송 정보)
|
||||
│ │ ├── _payment.json (결제 정보)
|
||||
│ │ ├── _history.json (주문 이력)
|
||||
│ │ ├── _modal_cancel.json (주문 취소)
|
||||
│ │ └── _modal_change_address.json (배송지 변경)
|
||||
│ ├── board.json (내 게시글/댓글)
|
||||
│ │ └── partials/mypage/board/
|
||||
│ │ ├── _list.json (탭 목록)
|
||||
│ │ ├── _my_posts.json (내 게시글)
|
||||
│ │ └── _my_comments.json (내 댓글)
|
||||
│ ├── addresses.json (배송지 관리)
|
||||
│ │ └── partials/mypage/addresses/
|
||||
│ │ ├── _list.json (배송지 목록)
|
||||
│ │ ├── _modal_address.json (배송지 추가/수정)
|
||||
│ │ ├── _modal_confirm_delete.json (삭제 확인)
|
||||
│ │ └── _modal_confirm_overwrite.json (덮어쓰기 확인)
|
||||
│ ├── notifications.json (알림)
|
||||
│ │ └── partials/mypage/notifications/
|
||||
│ │ └── _list.json (알림 목록)
|
||||
│ ├── change-password.json (비밀번호 변경)
|
||||
│ ├── wishlist.json (위시리스트)
|
||||
│ │ └── partials/mypage/wishlist/
|
||||
│ │ └── _list.json (위시리스트 목록)
|
||||
│ ├── inquiries.json (상품 1:1 문의내역)
|
||||
│ │ └── partials/mypage/inquiries/
|
||||
│ │ └── _list.json (문의 목록)
|
||||
│ └── partials/mypage/
|
||||
│ └── _tab_navigation.json (마이페이지 공통 탭)
|
||||
│ hiddenTabIds: inquiries 탭은 sirsoft-ecommerce inquiry 설정 시에만 노출
|
||||
│
|
||||
├── 검색 (search/)
|
||||
│ └── index.json (통합 검색)
|
||||
│ └── partials/search/
|
||||
│ ├── _search_input.json (검색 입력)
|
||||
│ ├── _search_tabs.json (검색 탭)
|
||||
│ ├── _search_filters.json (검색 필터)
|
||||
│ ├── _search_results.json (검색 결과)
|
||||
│ ├── _search_states.json (검색 상태)
|
||||
│ ├── posts/
|
||||
│ │ ├── _section.json (게시글 결과 섹션)
|
||||
│ │ └── _list.json (게시글 결과 목록)
|
||||
│ ├── products/
|
||||
│ │ ├── _section.json (상품 결과 섹션)
|
||||
│ │ ├── _item_card.json (상품 카드)
|
||||
│ │ └── _item_list.json (상품 리스트)
|
||||
│ └── pages/
|
||||
│ └── _section.json (페이지 결과 섹션)
|
||||
│
|
||||
├── 사용자 (users/)
|
||||
│ ├── show.json (사용자 프로필)
|
||||
│ └── posts.json (사용자 게시글)
|
||||
│
|
||||
├── 페이지 (page/)
|
||||
│ └── show.json (정적 페이지)
|
||||
│
|
||||
├── 공통 Partial
|
||||
│ └── partials/common/
|
||||
│ └── _currency_selector.json (통화 선택기)
|
||||
│
|
||||
└── 에러 페이지 (errors/)
|
||||
├── 401.json (인증 필요)
|
||||
├── 403.json (접근 거부)
|
||||
├── 404.json (페이지 없음)
|
||||
├── 500.json (서버 오류)
|
||||
├── 503.json (서비스 불가)
|
||||
└── maintenance.json (점검 중)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 카테고리별 가이드
|
||||
|
||||
### 인증 페이지 패턴
|
||||
|
||||
**대표**: `auth/login.json`, `auth/register.json`
|
||||
|
||||
**구성**:
|
||||
```text
|
||||
extends: _user_base
|
||||
slots.content:
|
||||
└── Flex (중앙 정렬)
|
||||
├── _redirect_if_logged_in.json (로그인 시 리다이렉트)
|
||||
└── Div (카드 스타일 래퍼)
|
||||
├── H2 (제목)
|
||||
├── partial: _login_form.json 또는 _register_form.json
|
||||
└── 하단 링크 (회원가입/로그인 전환, 비밀번호 찾기)
|
||||
```
|
||||
|
||||
**특수사항**:
|
||||
- `_redirect_if_logged_in.json`: 이미 로그인한 사용자를 홈으로 리다이렉트하는 partial
|
||||
- 로그인 폼은 `SocialLoginButtons` 포함 (소셜 로그인 지원)
|
||||
- 회원가입 폼은 `PasswordInput` 사용 (비밀번호 규칙 검증, 확인 일치)
|
||||
- 약관 동의 모달: `_modal_terms.json`, `_modal_privacy.json`
|
||||
- `blur_until_loaded`: 현재 사용자 정보 로드 전까지 폼 블러 처리
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `apiCall` — 로그인 (POST `/api/auth/login`), 회원가입 (POST `/api/auth/register`)
|
||||
- `navigate` — 성공 후 홈/대시보드로 이동
|
||||
- `setState` — 폼 에러, 로딩 상태
|
||||
|
||||
---
|
||||
|
||||
### 게시판 패턴
|
||||
|
||||
**대표**: `board/index.json`, `board/show.json`, `board/form.json`
|
||||
|
||||
**구성**:
|
||||
```text
|
||||
extends: _user_base
|
||||
data_sources: [posts (게시글 목록/상세)]
|
||||
slots.content:
|
||||
└── Container
|
||||
├── 타입 렌더러 (_type_renderer.json)
|
||||
│ → 게시판 타입에 따라 분기:
|
||||
│ ├── basic/index.json (기본 테이블형)
|
||||
│ ├── card/index.json (카드형)
|
||||
│ └── gallery/index.json (갤러리형)
|
||||
├── Pagination
|
||||
└── 글쓰기 버튼 (_write_button.json)
|
||||
```
|
||||
|
||||
**data_sources**:
|
||||
```json
|
||||
{
|
||||
"id": "posts",
|
||||
"endpoint": "/api/modules/sirsoft-board/boards/{{route.slug}}/posts",
|
||||
"method": "GET",
|
||||
"params": {
|
||||
"page": "{{query.page ?? 1}}",
|
||||
"search": "{{query.search ?? ''}}",
|
||||
"category": "{{query.category ?? ''}}"
|
||||
},
|
||||
"auto_fetch": true,
|
||||
"refetchOnMount": true,
|
||||
"errorHandling": {
|
||||
"403": { "handler": "showErrorPage", "params": { "target": "content" } }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**타입별 렌더러 시스템**:
|
||||
게시판은 `board_type` 필드에 따라 다른 레이아웃을 렌더링합니다:
|
||||
- `basic` — 테이블형 게시글 목록 (기본)
|
||||
- `card` — 카드 그리드형 목록
|
||||
- `gallery` — 이미지 갤러리형 목록
|
||||
|
||||
```text
|
||||
_type_renderer.json (조건 분기):
|
||||
├── if: board_type === 'basic' → partial: types/basic/index.json
|
||||
├── if: board_type === 'card' → partial: types/card/index.json
|
||||
└── if: board_type === 'gallery' → partial: types/gallery/index.json
|
||||
```
|
||||
|
||||
**게시글 상세 구성**:
|
||||
```text
|
||||
show.json:
|
||||
└── _type_renderer.json → types/basic/show.json
|
||||
├── 게시글 본문 (HtmlContent)
|
||||
├── _post_attachments.json (첨부파일)
|
||||
├── PostReactions (리액션)
|
||||
├── _comment_section.json
|
||||
│ ├── _comment_input.json (댓글 입력)
|
||||
│ └── _comment_item.json (댓글 아이템, iteration)
|
||||
│ └── _reply_section.json (답글)
|
||||
├── _navigation.json (이전/다음 글)
|
||||
└── modals: 삭제, 신고, 비밀번호 확인
|
||||
```
|
||||
|
||||
**게시글 작성/수정 구성**:
|
||||
```text
|
||||
form.json:
|
||||
├── _parent_post.json (답글 시 원글 표시)
|
||||
└── _post_form.json
|
||||
├── Input (제목)
|
||||
├── Select (카테고리)
|
||||
├── HtmlEditor (본문)
|
||||
├── FileUploader (첨부파일)
|
||||
├── Checkbox (공지, 비밀글 등)
|
||||
└── Button (저장/취소)
|
||||
```
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `apiCall` — CRUD, 댓글 작성/삭제, 리액션, 신고
|
||||
- `navigate` — 게시판 이동, 글 상세/목록 이동
|
||||
- `setState` — 검색, 필터, 페이지네이션, 댓글 접기/펼치기
|
||||
- `replaceUrl` — 페이지네이션 시 URL만 변경
|
||||
|
||||
---
|
||||
|
||||
### 쇼핑몰 패턴
|
||||
|
||||
**대표**: `shop/index.json`, `shop/show.json`, `shop/cart.json`, `shop/checkout.json`
|
||||
|
||||
#### 상품 목록 (shop/index.json)
|
||||
|
||||
```text
|
||||
extends: _user_base
|
||||
data_sources: [products (상품 API), categories (카테고리)]
|
||||
slots.content:
|
||||
└── Container
|
||||
├── _category_breadcrumb.json (경로)
|
||||
├── _search_filter_bar.json (검색/정렬)
|
||||
├── _category_filter.json (카테고리 사이드)
|
||||
├── _product_grid.json (상품 그리드, ProductCard iteration)
|
||||
├── _popular_products.json (인기 상품)
|
||||
├── _new_products.json (신상품)
|
||||
├── _recent_products.json (최근 본 상품)
|
||||
└── Pagination
|
||||
```
|
||||
|
||||
#### 상품 상세 (shop/show.json)
|
||||
|
||||
```text
|
||||
extends: _user_base
|
||||
init_actions: [최근 본 상품 localStorage 저장]
|
||||
data_sources: [product, reviews, popularProducts, relatedProducts]
|
||||
computed: [displayPrice, displayListPrice, ...]
|
||||
slots.content:
|
||||
└── ThreeColumnLayout
|
||||
├── left: _header.json (이미지 뷰어 — ProductImageViewer)
|
||||
├── center: _info_summary.json (상품 정보, 옵션 선택)
|
||||
└── right: _purchase_card.json (가격, 수량, 구매 버튼)
|
||||
└── _price_mobile.json (모바일 가격 — responsive portable)
|
||||
└── TabNavigation
|
||||
├── _tab_detail.json (상세 정보 — HtmlContent)
|
||||
├── _tab_reviews.json (리뷰 — iteration)
|
||||
└── _tab_qna.json (Q&A — iteration)
|
||||
└── modals: 장바구니 추가, 쿠폰 다운로드, 로그인 필요, 리뷰 이미지
|
||||
```
|
||||
|
||||
**SEO 특수사항**:
|
||||
- `meta.seo.structured_data`: Product, AggregateRating 스키마
|
||||
- `meta.seo.og`: 상품 이미지, 가격 정보 포함
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `sirsoft-basic.addSelectedItemIfComplete` — 옵션 선택 완료 시 자동 추가
|
||||
- `sirsoft-basic.updateSelectedItemQuantity` — 수량 변경
|
||||
- `sirsoft-basic.getDisplayPrice` — 다중 통화 가격 표시
|
||||
- `apiCall` — 장바구니 추가, 리뷰 작성, 위시리스트 토글
|
||||
- `saveToLocalStorage` — 최근 본 상품 저장
|
||||
|
||||
#### 장바구니 (shop/cart.json)
|
||||
|
||||
```text
|
||||
extends: _user_base
|
||||
state: { selectedItems, allSelected, isCalculating, optionModal, deleteModal, ... }
|
||||
data_sources: [cartItems (POST /cart/query)]
|
||||
slots.content:
|
||||
└── Flex
|
||||
├── _cart_list.json (장바구니 목록)
|
||||
│ └── _cart_item.json (아이템, iteration)
|
||||
│ ├── Checkbox (선택)
|
||||
│ ├── 상품 정보/가격
|
||||
│ ├── QuantitySelector
|
||||
│ └── 삭제/옵션변경 버튼
|
||||
└── _cart_summary.json (주문 요약, 결제 버튼)
|
||||
└── modals: 삭제 확인, 옵션 변경, 품절 안내
|
||||
```
|
||||
|
||||
**특수사항**:
|
||||
- `auth_mode: "optional"`: 비회원도 장바구니 사용 가능 (X-Cart-Key 헤더)
|
||||
- `state` 섹션으로 모달/선택 상태 관리
|
||||
- 장바구니 핸들러: `toggleCartItemSelection`, `selectAllCartItems`, `recalculateCart`
|
||||
|
||||
#### 결제 (shop/checkout.json)
|
||||
|
||||
```text
|
||||
extends: _user_base
|
||||
data_sources: [tempOrder (임시 주문)]
|
||||
slots.content:
|
||||
└── Container
|
||||
├── _checkout_orderer.json (주문자 정보)
|
||||
├── _checkout_shipping.json (배송 정보)
|
||||
├── _checkout_items.json (주문 상품 목록)
|
||||
├── _checkout_discount.json (할인/쿠폰)
|
||||
├── _checkout_mileage.json (마일리지)
|
||||
├── _checkout_payment.json (결제 수단 선택)
|
||||
└── _checkout_summary.json (최종 요약 + 결제 버튼)
|
||||
└── modals: 배송지 관리, 쿠폰 다운로드, 전용 쿠폰 확인
|
||||
```
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `apiCall` — 주문 생성, 배송지 조회/저장, 쿠폰 적용
|
||||
- `setState` — 배송지 선택, 결제 수단, 쿠폰/마일리지 계산
|
||||
|
||||
---
|
||||
|
||||
### 마이페이지 패턴
|
||||
|
||||
**대표**: `mypage/profile.json`, `mypage/orders.json`
|
||||
|
||||
**구성**:
|
||||
```text
|
||||
extends: _user_base
|
||||
computed: { currentTab: "profile" }
|
||||
data_sources: [user (인증 사용자 정보)]
|
||||
transition_overlay: { target: "mypage_tab_content" }
|
||||
slots.content:
|
||||
└── Div
|
||||
├── _tab_navigation.json (공통 마이페이지 탭)
|
||||
│ → 프로필, 주문내역, 게시글, 배송지, 알림, 위시리스트
|
||||
└── 탭별 콘텐츠 영역
|
||||
```
|
||||
|
||||
**탭 구조**:
|
||||
각 마이페이지 하위 페이지는 동일한 `_tab_navigation.json`을 공유하되, `computed.currentTab`으로 활성 탭을 구분합니다.
|
||||
|
||||
| 탭 | 레이아웃 | Partial |
|
||||
|---|---------|---------|
|
||||
| 프로필 | `profile.json` | `_view.json` |
|
||||
| 프로필 수정 | `profile-edit.json` | `_edit.json`, `_password_verify_section.json`, `_modal_withdraw.json` |
|
||||
| 주문 내역 | `orders.json` | `_list.json` |
|
||||
| 주문 상세 | `orders/show.json` | `_status_header.json`, `_items.json`, `_shipping.json`, `_payment.json`, `_history.json` |
|
||||
| 내 게시글 | `board.json` | `_my_posts.json`, `_my_comments.json` |
|
||||
| 배송지 | `addresses.json` | `_list.json`, `_modal_address.json`, `_modal_confirm_delete.json` |
|
||||
| 알림 | `notifications.json` | `_list.json` |
|
||||
| 비밀번호 변경 | `change-password.json` | (인라인) |
|
||||
| 위시리스트 | `wishlist.json` | `_list.json` |
|
||||
| 상품 1:1 문의내역 | `inquiries.json` | `_list.json` (sirsoft-ecommerce 모듈 연동 시에만 탭 표시) |
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `apiCall` — 프로필 수정, 주문 취소, 배송지 CRUD, 알림 읽음 처리
|
||||
- `navigate` — 탭 간 이동 (별도 페이지)
|
||||
- `setState` — 폼 상태, 모달 제어
|
||||
- `openModal`/`closeModal` — 탈퇴, 주소 편집, 삭제 확인
|
||||
|
||||
---
|
||||
|
||||
### 검색 패턴
|
||||
|
||||
**대표**: `search/index.json`
|
||||
|
||||
**구성**:
|
||||
```text
|
||||
extends: _user_base
|
||||
state: { q: "" }
|
||||
init_actions: [setState — query 파라미터에서 검색어 추출]
|
||||
global_state: { searchActiveTab, searchBoardFilter, searchSortBy, searchPage }
|
||||
data_sources: [searchPosts, searchProducts, searchPages]
|
||||
slots.content:
|
||||
└── Container
|
||||
├── _search_input.json (검색 입력 — SearchBar)
|
||||
├── _search_tabs.json (탭: 전체/게시글/상품/페이지)
|
||||
├── _search_filters.json (정렬, 게시판 필터)
|
||||
├── _search_states.json (검색 전/로딩/결과없음 상태)
|
||||
└── _search_results.json (결과 표시)
|
||||
├── posts/_section.json → posts/_list.json
|
||||
├── products/_section.json → products/_item_card.json / _item_list.json
|
||||
└── pages/_section.json
|
||||
```
|
||||
|
||||
**특수사항**:
|
||||
- 통합 검색: 게시글 + 상품 + 페이지 동시 검색
|
||||
- `searchActiveTab`으로 탭 전환 시 해당 카테고리만 표시
|
||||
- 상품 결과는 카드/리스트 뷰 전환 지원
|
||||
- `global_state`로 검색 상태 유지 (탭, 필터, 정렬, 페이지)
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `apiCall` — 검색 API (게시글, 상품, 페이지 별도)
|
||||
- `setState` — 탭 전환, 필터, 정렬
|
||||
- `replaceUrl` — 검색어/필터 변경 시 URL 갱신
|
||||
|
||||
---
|
||||
|
||||
### 기타 페이지 패턴
|
||||
|
||||
#### 사용자 프로필 (users/show.json, users/posts.json)
|
||||
|
||||
```text
|
||||
extends: _user_base
|
||||
data_sources: [user (공개 프로필)]
|
||||
slots.content:
|
||||
└── Container
|
||||
├── Avatar + 사용자 정보
|
||||
└── 게시글 목록 (users/posts.json)
|
||||
```
|
||||
|
||||
#### 정적 페이지 (page/show.json)
|
||||
|
||||
```text
|
||||
extends: _user_base
|
||||
data_sources: [page (페이지 콘텐츠)]
|
||||
slots.content:
|
||||
└── Container
|
||||
└── HtmlContent (본문 렌더링)
|
||||
```
|
||||
|
||||
#### 홈 (home.json)
|
||||
|
||||
```text
|
||||
extends: _user_base
|
||||
data_sources: [stats, recent_posts, popular_boards]
|
||||
meta.seo: { structured_data: WebSite }
|
||||
slots.content:
|
||||
└── Container
|
||||
├── _welcome_card.json (환영 배너)
|
||||
├── Grid (통계 카드 4개)
|
||||
│ ├── _stat_card_users.json
|
||||
│ ├── _stat_card_posts.json
|
||||
│ ├── _stat_card_comments.json
|
||||
│ └── _stat_card_boards.json
|
||||
├── _recent_posts.json (최근 게시글)
|
||||
├── _popular_boards.json (인기 게시판)
|
||||
├── _board_summary.json (게시판 요약)
|
||||
├── _community_guide.json (가이드)
|
||||
└── _shop_promo.json (쇼핑 프로모션)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 에러 페이지 패턴
|
||||
|
||||
**대표**: `errors/404.json`
|
||||
|
||||
**구성**:
|
||||
```text
|
||||
(extends 없음 — 독립 레이아웃)
|
||||
components:
|
||||
└── Div (전체 화면 중앙 정렬)
|
||||
├── Icon (에러 아이콘)
|
||||
├── H1 (에러 코드)
|
||||
├── P (에러 메시지)
|
||||
└── Button (홈으로 이동)
|
||||
```
|
||||
|
||||
**핸들러 패턴**:
|
||||
- `navigate` — 홈으로 이동
|
||||
|
||||
---
|
||||
|
||||
## 베이스 레이아웃 구조
|
||||
|
||||
### _user_base.json
|
||||
|
||||
모든 사용자 페이지의 공통 구조를 정의합니다.
|
||||
|
||||
```text
|
||||
_user_base.json
|
||||
├── globalHeaders: [X-Cart-Key 헤더 (이커머스, 인증 API)]
|
||||
├── transition_overlay: { style: "skeleton", target: "main_content_area" }
|
||||
├── init_actions: [initTheme, initCartKey, loadPreferredCurrency, setState(shopBase)]
|
||||
├── data_sources:
|
||||
│ ├── boards (게시판 메뉴 — progressive, fallback)
|
||||
│ ├── current_user (인증 사용자 — auth_required, suppress 401)
|
||||
│ └── cart (장바구니 카운트 — optional auth)
|
||||
├── components:
|
||||
│ ├── Toast (전역 알림)
|
||||
│ ├── PageTransitionIndicator
|
||||
│ ├── Div (min-h-screen flex flex-col)
|
||||
│ │ ├── mobile_overlay (모바일 메뉴 오버레이 — responsive portable)
|
||||
│ │ ├── MobileNav (모바일 네비게이션 드로어)
|
||||
│ │ ├── Header (사이트 헤더 — 로고, 메뉴, 검색, 사용자)
|
||||
│ │ ├── Div#main_content_area (콘텐츠 영역)
|
||||
│ │ │ └── slot: "content" (← 하위 레이아웃이 채움)
|
||||
│ │ └── Footer (사이트 푸터)
|
||||
│ └── PageTransitionBlur (전환 블러)
|
||||
```
|
||||
|
||||
**슬롯**:
|
||||
- `content` — 각 페이지의 메인 콘텐츠가 삽입되는 위치
|
||||
|
||||
**특수사항**:
|
||||
- `globalHeaders`: 이커머스 API에 `X-Cart-Key` 자동 첨부
|
||||
- `transition_overlay.style: "skeleton"`: 페이지 전환 시 PageSkeleton 표시
|
||||
- `responsive`: 모바일 오버레이/네비게이션은 `portable` breakpoint에서만 표시
|
||||
- `auth_mode: "optional"`: 비회원도 장바구니 카운트 조회 가능
|
||||
- `errorHandling.401.handler: "suppress"`: 비회원의 인증 API 401은 에러 전파 방지
|
||||
|
||||
---
|
||||
|
||||
## 관련 문서
|
||||
|
||||
- [sirsoft-basic 컴포넌트](./components.md)
|
||||
- [sirsoft-basic 핸들러](./handlers.md)
|
||||
- [sirsoft-admin_basic 레이아웃](../../../../templates/_bundled/sirsoft-admin_basic/docs/layouts.md)
|
||||
- [레이아웃 JSON 스키마](../../layout-json.md)
|
||||
- [레이아웃 상속](../../layout-json-inheritance.md)
|
||||
Reference in new issue
Block a user