@g1cloud/entity-modeler-next 5.0.0-alpha.23 → 5.0.0-alpha.25

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.
@@ -226,6 +226,7 @@ export type SymbolicOp = {
226
226
  entity: Handle;
227
227
  attribute: Handle;
228
228
  patch: Record<string, unknown>;
229
+ embeddableOverrides?: EmbeddableColumnOverride[];
229
230
  } | {
230
231
  kind: 'attribute.remove';
231
232
  entity: Handle;
@@ -3,6 +3,9 @@ import { DisplayMode, LogicalModel } from './types';
3
3
  * 표시 모드별 라벨(평문) — Diagram Explorer 트리/캡션 공용.
4
4
  * EntityNode의 labelSegs와 동일 의미 규칙: '논리'는 업무 논리명이며 없으면 '(논리명)'
5
5
  * 플레이스홀더(코드명으로 폴백하지 않음), '물리'는 physicalName, CLASS만 코드명.
6
+ *
7
+ * `logicalFallback`은 논리명 미입력 시 표시할 플레이스홀더(UI 크롬). 뷰는 로케일 문자열
8
+ * (`em.node.logicalMissing`)을 주입하고, 미주입 시 ko 기본값으로 폴백(codegen/테스트 무회귀).
6
9
  */
7
- export declare function displayLabel(mode: DisplayMode, code: string, logical: string | undefined, physical: string | undefined): string;
10
+ export declare function displayLabel(mode: DisplayMode, code: string, logical: string | undefined, physical: string | undefined, logicalFallback?: string): string;
8
11
  export declare function entityModelToText(logical: LogicalModel): string;
@@ -1,14 +1,21 @@
1
1
  import { EmbeddableCatalog, LogicalModel, ModelId, SuperClassCatalog } from './types';
2
2
  export declare const PHYSICAL_NAME_MAX_LENGTH = 63;
3
3
  /**
4
- * 물리명이 이식성 권장 한도를 초과하면 경고 메시지, 아니면 null(비차단 — 호출부는 저장을 막지 않는다).
5
- * 빈값/미설정은 경고 없음(레거시 isNotEmpty 게이트 동형).
4
+ * 물리명이 이식성 권장 한도를 초과하면 **초과 길이(문자 수)**, 아니면 null(비차단 — 호출부는 저장을
5
+ * 막지 않는다). 빈값/미설정은 경고 없음(레거시 isNotEmpty 게이트 동형).
6
+ *
7
+ * 이전엔 완성된 경고 문자열을 반환했으나, i18n(P3)로 core가 표시 문자열을 만들지 않게 되어 길이만
8
+ * 돌려준다 — 컬럼·테이블·인덱스 3곳이 이 값을 `CHK-NAME-5` params `{max,len}`로 재사용(단일 출처).
6
9
  */
7
- export declare function physicalNameWarning(name: string | null | undefined): string | null;
10
+ export declare function physicalNameLengthOverflow(name: string | null | undefined): number | null;
8
11
  export type IssueSeverity = 'error' | 'warning' | 'info';
9
12
  export type IssueTargetKind = 'entity' | 'attribute' | 'column' | 'association' | 'index' | 'group' | 'model';
10
13
  export interface ValidationIssue {
11
- /** 규칙 식별자(예: 'CHK-NAME-1'). 엔진 불변식 INV-*와 다른 네임스페이스(위반 가능·수정 대상). */
14
+ /**
15
+ * 규칙 식별자(예: 'CHK-NAME-1'). 엔진 불변식 INV-*와 다른 네임스페이스(위반 가능·수정 대상).
16
+ * **메시지 code**를 겸한다 — 뷰가 `ruleId`(+targetKind/params 변형)로 i18n 키를 해석해 로컬라이즈
17
+ * (`view/validationDisplay.issueMessageKey`). core는 문자열을 만들지 않는다(D3, 논리↔표시 분리).
18
+ */
12
19
  ruleId: string;
13
20
  severity: IssueSeverity;
14
21
  targetKind: IssueTargetKind;
@@ -16,7 +23,12 @@ export interface ValidationIssue {
16
23
  targetRef?: ModelId;
17
24
  /** 보조 ref(예: 컬럼/속성 이슈의 소속 엔티티) — 뷰 그룹핑/내비용. */
18
25
  contextRef?: ModelId;
19
- message: string;
26
+ /**
27
+ * 메시지 보간 파라미터 — 뷰가 `c.t(key, params)`로 치환. 값은 식별자/카운트/JPA 리터럴 등
28
+ * **번역 대상이 아닌 데이터**(name·dataType·which='end1'/'end2'·cascade='ALL'/'REMOVE' 등).
29
+ * 정적 메시지 규칙은 생략. i18n 카탈로그(`em.i18n`)에 의존하지 않도록 구조만 노출(순수성 유지).
30
+ */
31
+ params?: Record<string, string | number>;
20
32
  }
21
33
  /** 카탈로그 의존 규칙을 켜는 선택 주입 — 미주입 시 해당 규칙 skip(범위 밖 아님, 컨텍스트 부재). */
22
34
  export interface ValidationContext {
@@ -8,7 +8,8 @@ import { ResolvedDiagram } from '../core/resolve';
8
8
  import { RoutingMode } from '../core/routing';
9
9
  import { MergeDiagramSource } from '../core/mergeDiagram';
10
10
  import { ValidationIssue } from '../core/validation';
11
- import { AssociationEnd, Attribute, DisplayMode, EmbeddableCatalog, Entity, EntityIndex, Geo, GroupCodeCatalog, LangCode, LogicalGroup, ModelId, Operation, Point, PredefinedCustomTypeCatalog, SuperClassCatalog } from '../core/types';
11
+ import { UiLocale, Translator } from '../i18n';
12
+ import { AssociationEnd, Attribute, DisplayMode, EmbeddableCatalog, Entity, EntityIndex, Geo, GroupCodeCatalog, LangCode, LogicalGroup, ModelId, Multiplicity, Operation, Point, PredefinedCustomTypeCatalog, SuperClassCatalog } from '../core/types';
12
13
  /**
13
14
  * 관계 파생 FK 직접 삭제 시도 시의 안내 — 뷰 tooltip(어포던스)과 차단 시 토스트(피드백)가 공유한다.
14
15
  * FK는 관계가 소유·관리하므로 컬럼을 직접 지우는 대신 연관관계선을 삭제해야 한다(Option B).
@@ -306,6 +307,16 @@ export interface EditorController {
306
307
  * languages[0]로 폴백. 미주입 시 'ko'. 라벨 우선 표시 등 확장 여지의 기준점.
307
308
  */
308
309
  userLanguage: Ref<LangCode>;
310
+ /**
311
+ * 툴 크롬(버튼·라벨·툴팁·검증 메시지) 언어(호스트 주입) — 콘텐츠 축 `userLanguage`와 **별개**.
312
+ * 미주입 시 'ko'(무회귀). reactive하므로 .value 갱신 시 UI 문자열이 즉시 재렌더.
313
+ */
314
+ uiLocale: Ref<UiLocale>;
315
+ /**
316
+ * UI 문자열 해석기 — `t('mode.edit')` 형태로 뷰가 소비. uiLocale.value를 읽으므로 템플릿에서
317
+ * 호출 시 로케일 변경에 반응한다. 파라미터는 `{name}` 형태로 치환.
318
+ */
319
+ t: Translator;
309
320
  /**
310
321
  * dataType 셀렉트 후보 셋(CHK-TYPE-1과 공유하는 단일 출처) — dataType 드롭다운(dbTypeSelectItems)이
311
322
  * 이 값을 후보로 쓴다. 검증 ctx.selectableDataTypes와 같은 ref라 어포던스(드롭다운)·검증이 어긋나지
@@ -373,13 +384,15 @@ export interface EditorController {
373
384
  */
374
385
  addEmbedAssociation(ownerEntityId: ModelId, embeddableEntityId: ModelId): ModelId | undefined;
375
386
  /**
376
- * 임베드 단일(`@Embedded`)↔컬렉션(`@ElementCollection`) 모드 토글. 컬렉션 판정 권위는 임베더블
377
- * end multiplicity(결정 3)이며, intent가 multiplicity 변경 + 표시 속성 평탄화 컬럼 재구성 +
378
- * collection 메타 set/clear를 **한 composite**로 묶어 모순 상태(컬렉션인데 평탄화 컬럼 잔존)를
379
- * 구조적으로 차단한다. COLLECTION→SINGLE 복귀 owner 슬롯 `@AttributeOverride`는 버린다(결정 3,
380
- * load-only 철학). assocId가 EMBED association이 아니거나 이미 해당 mode면 no-op.
387
+ * 임베드 카디널리티 설정 임베더블 end multiplicity를 지정 값으로 바꾼다. 컬렉션(`@ElementCollection`)
388
+ * 여부는 이 multiplicity에서 파생되는 값(권위=multiplicity, 결정 3): `*_MORE`(0..N / 1..N)면 컬렉션,
389
+ * 외(1·0..1)면 단일 `@Embedded`(0..1은 nullable). single↔collection **경계를 넘을 때만** 표시 속성
390
+ * 평탄화 컬럼 재구성 + collection 메타 set/clear를 **한 composite**로 묶어 모순 상태(컬렉션인데 평탄화
391
+ * 컬럼 잔존) 구조적으로 차단한다. 단일 내부 전이(1↔0..1)는 평탄화 불변이라 순수 multiplicity patch다.
392
+ * 컬렉션→단일 복귀 시 owner 슬롯 `@AttributeOverride`는 버린다(결정 3, load-only 철학).
393
+ * assocId가 EMBED association이 아니거나 이미 해당 multiplicity면 no-op.
381
394
  */
382
- setEmbedCollectionMode(assocId: ModelId, mode: 'SINGLE' | 'COLLECTION'): void;
395
+ setEmbedCardinality(assocId: ModelId, multiplicity: Multiplicity): void;
383
396
  removeAssociation(assocId: ModelId): void;
384
397
  /**
385
398
  * 식별 관계 토글 — 자식 FK의 identifier 플래그를 동기화하고, 식별자 집합 변동이
@@ -436,6 +449,8 @@ export declare function createEditorController(initial?: EditorState, options?:
436
449
  superClassCatalog?: SuperClassCatalog;
437
450
  languages?: LangCode[];
438
451
  userLanguage?: LangCode;
452
+ /** 툴 크롬 언어(콘텐츠 축 `userLanguage`와 별개). 미주입 시 'ko'(무회귀). */
453
+ uiLocale?: UiLocale;
439
454
  /** `fromPersisted` 산출 meta(트랙 B 마커 + revSeed). schemaVersion·opWriteEnabled로 opMode·read-only 판정. */
440
455
  meta?: DiagramMeta;
441
456
  /**