@g1cloud/ui-modeler-next 5.0.0-alpha.1

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.
Files changed (68) hide show
  1. package/README.md +140 -0
  2. package/dist/adapter/attrCodec.d.ts +12 -0
  3. package/dist/adapter/interpretFlat.d.ts +20 -0
  4. package/dist/adapter/legacyGridSort.d.ts +11 -0
  5. package/dist/adapter/legacyText.d.ts +31 -0
  6. package/dist/adapter/legacyValidator.d.ts +2 -0
  7. package/dist/adapter/migrate.d.ts +47 -0
  8. package/dist/adapter/persisted.d.ts +75 -0
  9. package/dist/adapter/uiModelAdapter.d.ts +80 -0
  10. package/dist/agent/buildAgentBatch.d.ts +22 -0
  11. package/dist/agent/describeScreen.d.ts +21 -0
  12. package/dist/agent/resolver.d.ts +72 -0
  13. package/dist/agent/schema.d.ts +15 -0
  14. package/dist/agent/strictSubset.d.ts +30 -0
  15. package/dist/agent/symbolicOp.d.ts +97 -0
  16. package/dist/catalog/builtin/basic.d.ts +3 -0
  17. package/dist/catalog/builtin/chart.d.ts +3 -0
  18. package/dist/catalog/builtin/composite.d.ts +3 -0
  19. package/dist/catalog/builtin/etc.d.ts +3 -0
  20. package/dist/catalog/builtin/filter.d.ts +3 -0
  21. package/dist/catalog/builtin/grid.d.ts +3 -0
  22. package/dist/catalog/builtin/index.d.ts +3 -0
  23. package/dist/catalog/builtin/input.d.ts +3 -0
  24. package/dist/catalog/builtin/layout.d.ts +3 -0
  25. package/dist/catalog/builtin/listField.d.ts +3 -0
  26. package/dist/catalog/builtin/multilang.d.ts +3 -0
  27. package/dist/catalog/builtin/shared.d.ts +69 -0
  28. package/dist/catalog/builtin/tree.d.ts +3 -0
  29. package/dist/catalog/catalog.d.ts +13 -0
  30. package/dist/catalog/containment.d.ts +26 -0
  31. package/dist/catalog/index.d.ts +6 -0
  32. package/dist/catalog/propertyEditor.d.ts +24 -0
  33. package/dist/catalog/styleTokens.d.ts +54 -0
  34. package/dist/catalog/toAgentCatalog.d.ts +57 -0
  35. package/dist/catalog/types.d.ts +117 -0
  36. package/dist/command/commands.d.ts +25 -0
  37. package/dist/command/op.d.ts +83 -0
  38. package/dist/command/opSync.d.ts +84 -0
  39. package/dist/command/stack.d.ts +47 -0
  40. package/dist/command/types.d.ts +23 -0
  41. package/dist/core/attrValue.d.ts +50 -0
  42. package/dist/core/caseMessage.d.ts +13 -0
  43. package/dist/core/gridDefaultSort.d.ts +15 -0
  44. package/dist/core/id.d.ts +2 -0
  45. package/dist/core/lang.d.ts +25 -0
  46. package/dist/core/partType.d.ts +30 -0
  47. package/dist/core/traverse.d.ts +24 -0
  48. package/dist/core/types.d.ts +40 -0
  49. package/dist/core/validation.d.ts +21 -0
  50. package/dist/core/validatorConfig.d.ts +48 -0
  51. package/dist/editor/controller.d.ts +125 -0
  52. package/dist/index.d.ts +42 -0
  53. package/dist/ui-modeler-next.css +1 -0
  54. package/dist/ui-modeler.js +3965 -0
  55. package/dist/ui-modeler.umd.cjs +1 -0
  56. package/dist/view/InlineIssueBadge.vue.d.ts +7 -0
  57. package/dist/view/MultiLangTextField.vue.d.ts +19 -0
  58. package/dist/view/PartCanvas.vue.d.ts +12 -0
  59. package/dist/view/PartPalette.vue.d.ts +2 -0
  60. package/dist/view/PartTree.vue.d.ts +7 -0
  61. package/dist/view/PropertyPanel.vue.d.ts +2 -0
  62. package/dist/view/RendererRegistry.d.ts +28 -0
  63. package/dist/view/SchematicPart.vue.d.ts +29 -0
  64. package/dist/view/dnd.d.ts +19 -0
  65. package/dist/view/preview/IframePreview.vue.d.ts +22 -0
  66. package/dist/view/preview/protocol.d.ts +40 -0
  67. package/dist/view/validationDisplay.d.ts +8 -0
  68. package/package.json +56 -0
@@ -0,0 +1,97 @@
1
+ import { MultiLangText } from '../core/lang';
2
+ import { PartType } from '../core/partType';
3
+ /**
4
+ * 요소 지정 핸들 — partId 대신 사람 지정 어휘(불변식 #4: id 1차 → path 2차 → caption 3차).
5
+ * 모호성은 실패가 아니라 후보 반환(resolver escalation) — 재질의 유도.
6
+ * - id: 파트 UUID(가장 안정. describeScreen이 항상 노출).
7
+ * - path: 자식 순서 기반 경로(예: `FormLayout[0]/TextField[2]`). resolver·describeScreen 동일 문법.
8
+ * - caption: PartDef.captionProp가 가리키는 attr 값(사람 라벨. 모델 내 중복 가능 → 모호 시 후보).
9
+ */
10
+ export interface Handle {
11
+ /** 매칭할 id/경로/캡션 문자열. */
12
+ ref: string;
13
+ /** 매칭 축 고정. 미지정 시 id → path → caption 순으로 시도. */
14
+ by?: 'id' | 'path' | 'caption';
15
+ }
16
+ /**
17
+ * 파트 속성 값의 **agent 노출 clean 표현**. core `AttrVal`(G6 타입드 union)의 부분집합 —
18
+ * G2 비노출 kind(`dataSource`/`dataMapping`/`validator`)는 여기 없다(바인딩 seam은 M12 예약).
19
+ * `enum`은 SELECT 등의 저장값 직접 방출(toAgentCatalog가 라벨 큐레이션 → resolver 매핑 불요).
20
+ */
21
+ export type PropValue = {
22
+ kind: 'string';
23
+ value: string;
24
+ } | {
25
+ kind: 'int';
26
+ value: number;
27
+ } | {
28
+ kind: 'bool';
29
+ value: boolean;
30
+ } | {
31
+ kind: 'text';
32
+ value: MultiLangText;
33
+ } | {
34
+ kind: 'enum';
35
+ value: string;
36
+ };
37
+ /** 한 속성 지정. `id`는 catalog PropertyItem.id(agent 노출 항목). */
38
+ export interface PropAssign {
39
+ id: string;
40
+ value: PropValue;
41
+ }
42
+ /**
43
+ * 한 스타일 지정(G1). agent는 **중립 의미 토큰**만 말하고(`dim`/`token`), resolver가
44
+ * `token→styleName` lowering으로 하강한다 — 원시 CSS 클래스는 agent 어휘에 없다(G1 누출 차단).
45
+ * `dim`은 STYLE_TOKENS 차원. 하강 타깃은 `STYLE_TOKEN_DIM_META.source`가 결정한다:
46
+ * - `style` 소스(bgColor·size·spacing…) → css 클래스가 `addStyleNames`(공백구분 집합)에 누적.
47
+ * - `layoutAttr` 소스(slotAlign) → enum 이름이 layoutAttrs(`componentAlignment`)에 저장.
48
+ * (레이아웃 자식 정렬 slotAlign도 별도 필드가 아니라 이 단일 메커니즘으로 표현 — lowering 경로 일원화.)
49
+ */
50
+ export interface StyleAssign {
51
+ dim: string;
52
+ token: string;
53
+ }
54
+ /**
55
+ * 신규/기존 파트의 선언적 스펙.
56
+ *
57
+ * **inline fold**: 자식은 별도 `part.add`로 보내지 않고 여기 `children`에 inline으로 담는다.
58
+ * resolver가 완성형 서브트리를 한 번에 조립하고 interpreter가 전 노드에 `rev:0` stamp(불변식 #3) —
59
+ * 별도 child op은 pending-ref 무효화를 부른다(inline-fold가 정공법).
60
+ *
61
+ * ⚠ `children`은 **본질적으로 재귀**다(FormLayout이 FormLayout을 품는 임의 깊이 중첩). 이 재귀가
62
+ * Anthropic strict-subset 스키마의 self-`$ref` 수용 여부(R-schema, exit #3)를 트리거한다 —
63
+ * schema.ts는 self-`$ref` 대신 **고정 깊이 unroll**(`partSpecL0..LN`)로 이 재귀를 표현한다.
64
+ */
65
+ export interface PartSpec {
66
+ partType: PartType | (string & {});
67
+ /** 타입드 속성(순서 무관). id는 catalog PropertyItem.id. */
68
+ props?: PropAssign[];
69
+ /** 중립 스타일 토큰(G1). resolver가 css/enum으로 lowering(slotAlign 포함 — StyleAssign 참조). */
70
+ styles?: StyleAssign[];
71
+ /** inline-fold 자식 서브트리(재귀). */
72
+ children?: PartSpec[];
73
+ }
74
+ /**
75
+ * LLM이 산출하는 단일 심볼릭 op. `kind`는 command/op 어휘와 1:1(로케이터만 심볼릭).
76
+ * `part.update`의 props/styles는 부분 지정(주어진 키만 갱신).
77
+ */
78
+ export type SymbolicOp = {
79
+ kind: 'part.add';
80
+ parent: Handle | null;
81
+ spec: PartSpec;
82
+ index?: number;
83
+ } | {
84
+ kind: 'part.update';
85
+ target: Handle;
86
+ props?: PropAssign[];
87
+ styles?: StyleAssign[];
88
+ } | {
89
+ kind: 'part.remove';
90
+ target: Handle;
91
+ };
92
+ /**
93
+ * v1(M3.5)이 다루는 심볼릭 op 종류의 닫힌 집합(단일 출처). resolver·JSON Schema(`schema.ts`)가 공유한다.
94
+ * 아래 컴파일타임 단언이 이 튜플과 `SymbolicOp['kind']`의 일치를 강제 — 한쪽만 늘리면 타입 에러.
95
+ */
96
+ export declare const SYMBOLIC_OP_KINDS: readonly ["part.add", "part.update", "part.remove"];
97
+ export type SymbolicOpKind = (typeof SYMBOLIC_OP_KINDS)[number];
@@ -0,0 +1,3 @@
1
+ import { PartDef } from '../types';
2
+ /** Basic 카테고리. 파생 원본: createButton/PopupButton/Label/Image/Link/LinkTab/ProgressBar/Console/NativeUpload/AuditInfo/AuditInfoButton. */
3
+ export declare const basicParts: PartDef[];
@@ -0,0 +1,3 @@
1
+ import { PartDef } from '../types';
2
+ /** Chart 카테고리. 파생 원본: createFlagCard/Chart. */
3
+ export declare const chartParts: PartDef[];
@@ -0,0 +1,3 @@
1
+ import { PartDef } from '../types';
2
+ /** Composite 카테고리. 파생 원본: createMultiFileUpload/SingleFileUpload/SingleImageUpload/NameField/AddressField/PageBuilder/ContentEditor. */
3
+ export declare const compositeParts: PartDef[];
@@ -0,0 +1,3 @@
1
+ import { PartDef } from '../types';
2
+ /** Etc 카테고리. 파생 원본: createPageRefreshButton/MultiLangExpandButton/Fragment/CommentList/SourceCodeEditor/MarkdownViewer/History. */
3
+ export declare const etcParts: PartDef[];
@@ -0,0 +1,3 @@
1
+ import { PartDef } from '../types';
2
+ /** Filter 카테고리. 파생 원본: createTextFilter()~createYesNoSelectFilter(). 전부 styleList() 비어있음. */
3
+ export declare const filterParts: PartDef[];
@@ -0,0 +1,3 @@
1
+ import { PartDef } from '../types';
2
+ /** Grid 카테고리. 파생 원본: createGrid/GridColumn(ColumnDef)/GridCellPanel/GridControl/GridLookup. */
3
+ export declare const gridParts: PartDef[];
@@ -0,0 +1,3 @@
1
+ import { PartDef } from '../types';
2
+ /** 레거시 {@code UiModelerPartDefFactory.createDefaultPartDefinitions()}에 대응하는 builtin 전체 PartDef. */
3
+ export declare const BUILTIN_PART_DEFS: PartDef[];
@@ -0,0 +1,3 @@
1
+ import { PartDef } from '../types';
2
+ /** Input 카테고리. 파생 원본: createTextField()~createYesNoSelect() + createColorField(). */
3
+ export declare const inputParts: PartDef[];
@@ -0,0 +1,3 @@
1
+ import { PartDef } from '../types';
2
+ /** Layout 카테고리. 파생 원본: UiModelerPartDefFactory createVerticalLayout()~createInternalLayoutArea(). */
3
+ export declare const layoutParts: PartDef[];
@@ -0,0 +1,3 @@
1
+ import { PartDef } from '../types';
2
+ /** ListField 카테고리. 파생 원본: createListField/ListControl. */
3
+ export declare const listFieldParts: PartDef[];
@@ -0,0 +1,3 @@
1
+ import { PartDef } from '../types';
2
+ /** MultiLang 카테고리. 파생 원본: createMultiLangTextField()~createMultiLangFileUpload(). 전부 styleList() 비어있음. */
3
+ export declare const multilangParts: PartDef[];
@@ -0,0 +1,69 @@
1
+ import { AttrVal } from '../../core/attrValue';
2
+ import { PartType } from '../../core/partType';
3
+ import { PropertyEditor } from '../propertyEditor';
4
+ import { PartDef, PropertyGroup, PropertyItem, StyleDim } from '../types';
5
+ /**
6
+ * builtin PartDef 이식용 공용 팩토리. 레거시 {@code UiModelerPartDefFactory}의
7
+ * propertyGroup·propertyItem·styleFor 계열 헬퍼를 1:1 대응하는 TS 함수로 옮긴다
8
+ * (카테고리 파일을 원본 Java와 시각적으로 대칭 유지 → 대조 검증 용이).
9
+ */
10
+ /** PartDef 빌더. category/captionProp 기본값은 createCatalog가 채운다(보일러플레이트 축소). */
11
+ export declare function def(partType: PartType, partName: string, groups: PropertyGroup[], styles?: StyleDim[]): PartDef;
12
+ /** {@code propertyItem(id, name, valueType, type, param, default)}. */
13
+ export declare function pi(id: string, name: string, valueType: PropertyItem['valueType'], editor: PropertyEditor, param?: string, def?: AttrVal): PropertyItem;
14
+ /** {@code propertyGroup(name, ...items)}. */
15
+ export declare function pg(name: string, ...items: PropertyItem[]): PropertyGroup;
16
+ /** {@code propertyGroup(name, true, ...items)} — layout 속성 그룹(layoutAttrMap 대상). */
17
+ export declare function pgLayout(name: string, ...items: PropertyItem[]): PropertyGroup;
18
+ /** {@code propertyGroupForComponent()}. addStyleNames(스타일 팔레트)·caption 등 공통 컴포넌트 속성. */
19
+ export declare function pgComponent(): PropertyGroup;
20
+ /** {@code propertyGroupForSize()}. */
21
+ export declare function pgSize(): PropertyGroup;
22
+ /** {@code propertyGroupForMimMaxSize()}. */
23
+ export declare function pgMinMaxSize(): PropertyGroup;
24
+ /** {@code layoutPropertyGroupForOrderedLayout()} — componentAlignment(ALIGN)·expandRatio. */
25
+ export declare function pgOrderedLayout(): PropertyGroup;
26
+ /** {@code propertyGroupForField()}. */
27
+ export declare function pgField(): PropertyGroup;
28
+ /** {@code propertyGroupForPseudoField()} — propertyId/dataMapping 없는 field 그룹. */
29
+ export declare function pgPseudoField(): PropertyGroup;
30
+ /** css 클래스 하나의 on/off 토글. legacy AddStyle(children 無). */
31
+ export declare function tog(css: string, label: string): StyleDim;
32
+ export declare const sMarginSize: () => StyleDim;
33
+ export declare const sSpacingSize: () => StyleDim;
34
+ export declare const sColor: () => StyleDim;
35
+ export declare const sTextColor: () => StyleDim;
36
+ export declare const sBgColor: () => StyleDim;
37
+ export declare const sCaptionBg: () => StyleDim;
38
+ export declare const sCaptionDir: () => StyleDim;
39
+ export declare const sAlignment: () => StyleDim;
40
+ export declare const sVerticalAlignment: () => StyleDim;
41
+ export declare const sSize: () => StyleDim;
42
+ /** styleForSize2 — size의 부분집합(small/default/large). */
43
+ export declare const sSize2: () => StyleDim;
44
+ export declare const sCaptionSize: () => StyleDim;
45
+ export declare const sIconAlignment: () => StyleDim;
46
+ export declare const sHeading: () => StyleDim;
47
+ export declare const sWeight: () => StyleDim;
48
+ export declare const sBorderless: () => StyleDim;
49
+ export declare const sBorderlessTop: () => StyleDim;
50
+ export declare const sBorderlessBottom: () => StyleDim;
51
+ export declare const sBorderlessLeft: () => StyleDim;
52
+ export declare const sBorderlessRight: () => StyleDim;
53
+ export declare const sBordered: () => StyleDim;
54
+ export declare const sBorderedTop: () => StyleDim;
55
+ export declare const sBorderedBottom: () => StyleDim;
56
+ export declare const sBorderedLeft: () => StyleDim;
57
+ export declare const sBorderedRight: () => StyleDim;
58
+ export declare const sColorBorderedTop: () => StyleDim;
59
+ export declare const sLineless: () => StyleDim;
60
+ export declare const sHorizontal: () => StyleDim;
61
+ export declare const sScrollable: () => StyleDim;
62
+ export declare const sWhitePrefix: () => StyleDim;
63
+ export declare const sWhiteSuffix: () => StyleDim;
64
+ export declare const sCaptionBorderlessBottom: () => StyleDim;
65
+ /** 공통 border toggle 4방(top/bottom/left/right). */
66
+ export declare const borderedSides: () => StyleDim[];
67
+ export declare const borderlessSides: () => StyleDim[];
68
+ /** 다수 파트가 공유하는 caption 스타일 3종(caption bg/borderless-bottom/direction). */
69
+ export declare const captionStyles: () => StyleDim[];
@@ -0,0 +1,3 @@
1
+ import { PartDef } from '../types';
2
+ /** Tree 카테고리. 파생 원본: createTree/TreeControl/TabSheet/TabSheetPanel. */
3
+ export declare const treeParts: PartDef[];
@@ -0,0 +1,13 @@
1
+ import { PartCatalog, PartDef } from './types';
2
+ /** builtin(기본) 또는 주어진 defs로 카탈로그 생성. */
3
+ export declare function createCatalog(defs?: PartDef[]): PartCatalog;
4
+ /**
5
+ * 기존 카탈로그를 확장/오버라이드/제거해 새 카탈로그 생성(호스트 확장 API).
6
+ * - add/override: partType 키로 교체·추가(동일 키면 override).
7
+ * - remove: partType 키 제거.
8
+ */
9
+ export declare function extendCatalog(base: PartCatalog, changes?: {
10
+ add?: PartDef[];
11
+ override?: PartDef[];
12
+ remove?: string[];
13
+ }): PartCatalog;
@@ -0,0 +1,26 @@
1
+ import { PartType } from '../core/partType';
2
+ import { ContainmentRule } from './types';
3
+ /**
4
+ * 파트별 containment 규칙 테이블(M4 역공학 산출). 안(b): builtin/*.ts와 분리된 단일 테이블로
5
+ * `createCatalog`가 각 PartDef에 머지(`catalog.ts`). 역공학 원본은 레거시 GWT 모델러
6
+ * `ui/client/part/*Part.java`.
7
+ *
8
+ * ## 판별식 (컨테이너 여부의 유일 기준)
9
+ * 레거시에서 "자식 파트를 담는가"는 `Part.getChildParts()` 오버라이드 여부로만 결정된다.
10
+ * 기본 `PartAdapter.getChildParts()`는 `null` 반환 → leaf(`PartSupport.java:164-166`).
11
+ * 전 패키지에서 이를 오버라이드하는 클래스는 10개뿐(전부 레이아웃/컨테이너):
12
+ * AbstractOrderedLayoutPart, ActionLayoutPart, CardLayoutPart, FlowLayoutPart,
13
+ * FormLayoutPart, FormLayoutCaption, GridPart, PopupButtonPart, TabSheetPart, TableLayoutPart
14
+ * + 내부 static 클래스 3종: GridColumnPart(ColumnDef)/GridCellPartPanel(GridCellPanel)/TabPanelPart(TabSheetPanel).
15
+ * 이 목록에 없는 파트는 전부 leaf.
16
+ *
17
+ * ## role 의미
18
+ * - open: 임의 자식 수용(레거시 ordered/form/flow 레이아웃은 타입 guard 없음). 필터 미지정=모든 타입.
19
+ * - fixed: 특정 타입 자식만(fixedChildren). arity로 개수 불변식 기록(M5 소비).
20
+ * - leaf: 자식 거부.
21
+ *
22
+ * ## 미등재 파트
23
+ * 이 테이블에 없는 partType은 규칙 미정 → `canContain`이 `warn`(거부 아님, 과도 제약 방지).
24
+ * 아래 leaf 파트들은 **명시적으로** role:'leaf'를 부여해 `deny`가 나오도록 한다(미정 warn과 구분).
25
+ */
26
+ export declare const CONTAINMENT_RULES: Partial<Record<PartType, ContainmentRule>>;
@@ -0,0 +1,6 @@
1
+ export * from './propertyEditor';
2
+ export * from './styleTokens';
3
+ export * from './types';
4
+ export * from './catalog';
5
+ export * from './toAgentCatalog';
6
+ export { BUILTIN_PART_DEFS } from './builtin';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * 속성 편집 위젯 종류. 레거시 {@code PropertyType.java} enum을 그대로 포팅하되,
3
+ * core의 {@code PartType}과의 이름 충돌·의미 혼동을 피하려 **`PropertyEditor`로 개명**한다
4
+ * ("무엇을 편집하는 위젯인가"를 가리키므로 editor가 정확한 어휘).
5
+ *
6
+ * 파생 원본: bluework-uimodeler-model/.../ui/shared/PropertyType.java
7
+ */
8
+ export type PropertyEditor = 'TEXT' | 'TEXT_WITH_BUTTON' | 'TEXT_RO_WITH_BUTTON' | 'MESSAGE_TEXT' | 'TEXTAREA' | 'FULL_TEXTAREA' | 'MESSAGE_TEXTAREA' | 'INTEGER' | 'BOOL' | 'BUTTON' | 'SIMPLE_BUTTON' | 'WINDOW_OPEN_BUTTON' | 'SELECT' | 'ALIGN' | 'ADD_STYLE' | 'SIZE' | 'ICON' | 'TAGS' | 'COMPONENT_REF' | 'DATASOURCE' | 'DATAMAPPING' | 'COMMENT' | 'CASE_MESSAGES';
9
+ export declare const PROPERTY_EDITORS: readonly PropertyEditor[];
10
+ /**
11
+ * G2 — editor별 agent 노출 기본 규칙.
12
+ * 85파트×N속성을 수기 주석하지 않고 **editor 종류로 노출 여부를 결정**하고, 예외만
13
+ * {@code PropertyItem.agent.expose}로 오버레이한다. 계획 §"G1·G2 확정 결정"의 표를 코드화.
14
+ *
15
+ * - 값형 텍스트/불리언/정수/태그/다국어 텍스트 = 노출(값 그대로 또는 `#{key}` 인코딩은 resolver).
16
+ * - SELECT = 노출(`param`을 label enum으로).
17
+ * - ALIGN/ADD_STYLE/SIZE/ICON = 노출하되 **원시 CSS가 아닌 의미 토큰**(G1, STYLE_TOKENS 경유).
18
+ * - `*_BUTTON` 계열(host 다이얼로그 트리거)·COMPONENT_REF·DATASOURCE/DATAMAPPING·COMMENT/CASE_MESSAGES
19
+ * = 비노출. 바인딩(DATASOURCE/DATAMAPPING)은 G5 design-intent 층(M12)에서 재개방.
20
+ *
21
+ * `*_BUTTON`/`*_WITH_BUTTON` 기본 false는 G2 표를 M3에서 보강한 결정(host 액션·바인딩 트리거는
22
+ * NL 주소 대상이 아님). 개별 예외는 PartDef의 agent 오버레이로 승격 가능.
23
+ */
24
+ export declare const AGENT_EXPOSE_DEFAULT: Record<PropertyEditor, boolean>;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * G1 — 스타일/정렬 어휘의 **의미 토큰(neutral token)** 단일 lowering 테이블.
3
+ *
4
+ * 레거시는 스타일을 원시 CSS 클래스(`blue-bg`, `margin-lg`, `align-center`)로 저장하고,
5
+ * `AddStyle{styleName(=css), styleDesc(=사람라벨), children}` 트리로 팔레트를 기술한다.
6
+ * 원시 CSS는 bluesea 디자인시스템 종속(불변식 #1 위반 대상)이라 **agent 표면에 노출 금지**다.
7
+ *
8
+ * 이 테이블이 유일한 진실 소스(SoT)로서 `token ⇄ css`를 매핑한다:
9
+ * - resolver: `token → css` (하강, write)
10
+ * - describeScreen(G3): `css → token` (역매핑, read)
11
+ * - agent schema / toAgentCatalog(G2): enum 후보를 이 테이블에서 파생
12
+ *
13
+ * 근거·확정: 계획 §"G1 확정 — 의미 토큰 차원". `slotAlign`은 legacy `ALIGN` editor 실증 결과
14
+ * 단일 6값 enum(2축 아님)으로 확정(`VAbstractProperties.java:1459-1493`).
15
+ *
16
+ * 파생 원본: UiModelerPartDefFactory.styleFor*() 팩토리 + layoutPropertyGroupForOrderedLayout().
17
+ */
18
+ /** 의미 토큰 차원. agent가 다루는 중립 스타일 축. */
19
+ export type StyleTokenDim = 'spacing' | 'gap' | 'color' | 'textColor' | 'bgColor' | 'captionBg' | 'captionDir' | 'align' | 'verticalAlign' | 'size' | 'captionSize' | 'iconAlign' | 'heading' | 'weight' | 'slotAlign';
20
+ /** 한 토큰: 중립 id ⇄ 원시 저장값(css 클래스 또는 layout enum 이름) ⇄ 사람 라벨. */
21
+ export interface StyleToken {
22
+ /** 중립 토큰 id(agent 표면). 사람 라벨의 정규화값. */
23
+ token: string;
24
+ /** 원시 저장값. style 차원=css 클래스(빈 문자열=기본, 클래스 없음), slotAlign=enum 이름(대문자). */
25
+ css: string;
26
+ /** 사람 라벨(속성패널 표시용). legacy AddStyle.styleDesc. */
27
+ label: string;
28
+ }
29
+ /** 토큰 차원의 저장 소스. */
30
+ export type StyleDimSource = 'style' | 'layoutAttr';
31
+ export interface StyleTokenDimMeta {
32
+ source: StyleDimSource;
33
+ /** legacy AddStyle.styleName(style 차원) 또는 layout propertyId(layoutAttr). */
34
+ legacyDimId: string;
35
+ label: string;
36
+ }
37
+ /**
38
+ * G1 확정 테이블. 빈 css `""`는 각 차원의 default/none/normal 토큰에 매핑(왕복 대칭).
39
+ * heading은 legacy에 기본값이 없어 `""` 항목이 없다.
40
+ */
41
+ export declare const STYLE_TOKENS: Record<StyleTokenDim, StyleToken[]>;
42
+ /** 각 토큰 차원의 저장 소스·legacy 원본 id. describeScreen/resolver 배선용. */
43
+ export declare const STYLE_TOKEN_DIM_META: Record<StyleTokenDim, StyleTokenDimMeta>;
44
+ /** 토큰 → 원시 저장값. 미지 토큰이면 undefined. */
45
+ export declare function tokenToCss(dim: StyleTokenDim, token: string): string | undefined;
46
+ /** 원시 저장값(css/enum 이름) → 토큰. 미지 값이면 undefined. */
47
+ export declare function cssToToken(dim: StyleTokenDim, css: string): string | undefined;
48
+ /** style 소스 css 클래스 하나를 소속 차원·토큰으로 역해석(describeScreen의 addStyleNames 분해용). */
49
+ export declare function classifyStyleClass(css: string): {
50
+ dim: StyleTokenDim;
51
+ token: string;
52
+ } | undefined;
53
+ /** 한 차원의 토큰 id 목록(agent enum 후보). */
54
+ export declare function tokensOf(dim: StyleTokenDim): string[];
@@ -0,0 +1,57 @@
1
+ import { AttrKind } from '../core/attrValue';
2
+ import { PartCategory } from '../core/partType';
3
+ import { StyleTokenDim } from './styleTokens';
4
+ import { PartCatalog } from './types';
5
+ /**
6
+ * G2 — PartDef(SoT)에서 파생하는 **agent 전용 정제 뷰**. 이중 카탈로그를 만들지 않고
7
+ * 노출 규칙·토큰 치환·SELECT 라벨화를 여기서 한 번에 적용한다. `agent/schema.ts`(M8)는
8
+ * PartDef가 아닌 이 AgentCatalog만 소비한다(catalog-drift 단일 소스).
9
+ *
10
+ * 규칙: 계획 §"G2 확정 — 단일 PartDef + agent 오버레이".
11
+ * - 노출 여부 = `PropertyItem.agent.expose` ?? {@link AGENT_EXPOSE_DEFAULT}[editor].
12
+ * - ADD_STYLE(스타일 팔레트) 항목은 attrs에서 제거하고 PartDef.styles를 styleDims/styleToggles로 노출(G1).
13
+ * - ALIGN(componentAlignment)은 slotAlign 토큰으로 노출.
14
+ * - SELECT는 원시 CSS가 아닌 옵션 목록(value+label)으로. TAGS는 태그 목록으로.
15
+ */
16
+ export type AgentValueKind = 'text' | 'multilang' | 'int' | 'bool' | 'enum' | 'tags';
17
+ export interface AgentEnumOption {
18
+ /** 저장값(stored value). agent가 이 값을 직접 방출 → resolver 매핑 불요. */
19
+ value: string;
20
+ /** 사람 라벨(LLM 가독성). */
21
+ label: string;
22
+ }
23
+ export interface AgentPropertyItem {
24
+ id: string;
25
+ valueType: AttrKind;
26
+ kind: AgentValueKind;
27
+ description?: string;
28
+ /** SELECT/TAGS 옵션. kind가 enum/tags일 때. */
29
+ options?: AgentEnumOption[];
30
+ }
31
+ export interface AgentStyleDim {
32
+ dim: StyleTokenDim;
33
+ /** 이 파트에서 선택 가능한 의미 토큰(중립). 원시 CSS는 노출하지 않음(G1). */
34
+ tokens: string[];
35
+ }
36
+ export interface AgentPartDef {
37
+ partType: string;
38
+ category?: PartCategory;
39
+ captionProp?: string;
40
+ /** 노출된 값 속성. */
41
+ attrs: AgentPropertyItem[];
42
+ /** enum 스타일 차원(의미 토큰). */
43
+ styleDims: AgentStyleDim[];
44
+ /** on/off 스타일 토글(css 클래스는 lowering 대상이므로 라벨만 의미 전달). */
45
+ styleToggles: {
46
+ css: string;
47
+ label: string;
48
+ }[];
49
+ /** ordered layout 자식일 때의 슬롯 정렬 토큰(componentAlignment). */
50
+ slotAlign?: string[];
51
+ }
52
+ export interface AgentCatalog {
53
+ get(partType: string): AgentPartDef | undefined;
54
+ all(): AgentPartDef[];
55
+ }
56
+ /** PartCatalog → AgentCatalog 파생. */
57
+ export declare function toAgentCatalog(catalog: PartCatalog): AgentCatalog;
@@ -0,0 +1,117 @@
1
+ import { AttrVal, AttrKind } from '../core/attrValue';
2
+ import { PartType, PartCategory } from '../core/partType';
3
+ import { PropertyEditor } from './propertyEditor';
4
+ import { StyleTokenDim } from './styleTokens';
5
+ /**
6
+ * catalog 타입 허브. 레거시 {@code UiModelerPartDef}(+ PropertiesList/PropertyGroup/PropertyItem/AddStyle)를
7
+ * 선언적 TS 데이터로 포팅. **단일 PartDef가 SoT**(G2 — 이중 카탈로그 금지)이고, agent 뷰는
8
+ * {@code toAgentCatalog}가 파생한다.
9
+ *
10
+ * 파생 원본: bluework-uimodeler-lib/.../ui/shared/UiModelerPartDef.java
11
+ */
12
+ /**
13
+ * 한 속성 항목. 레거시 {@code PropertyItem}.
14
+ * - `valueType`: clean 값 종류({@link AttrKind}) — 이 항목의 attr 값을 타이핑하는 SoT(G6).
15
+ * adapter v1-read 디코더가 이 값을 authoritative로 사용(레거시 저장 태그가 아님).
16
+ * - `editor`: 편집 위젯 종류.
17
+ * - `param`: SELECT 옵션(`raw:label; …`)·COMPONENT_REF 타깃·TAGS 목록 등 editor별 파라미터.
18
+ * - `default`: legacy componentDefaultValue.
19
+ * - `layoutAttr`: 부모 레이아웃이 부과하는 속성(layoutAttrMap 대상). 레거시 group의 isLayoutAttribute 전파.
20
+ * - `agent`: G2 노출 오버레이(선택). 미지정 시 editor별 기본 규칙({@link AGENT_EXPOSE_DEFAULT}).
21
+ */
22
+ export interface PropertyItem {
23
+ id: string;
24
+ name: string;
25
+ valueType: AttrKind;
26
+ editor: PropertyEditor;
27
+ param?: string;
28
+ default?: AttrVal;
29
+ layoutAttr?: boolean;
30
+ agent?: PropertyItemAgent;
31
+ }
32
+ /** G2 agent 오버레이. 계획 §"G2 확정 — 단일 PartDef + agent 오버레이". */
33
+ export interface PropertyItemAgent {
34
+ /** editor 기본 규칙을 덮어써 노출 여부 강제. */
35
+ expose?: boolean;
36
+ /** LLM 대상 설명(용도/언제 쓰는지). 사람 라벨(name)과 별개. */
37
+ description?: string;
38
+ /** ADD_STYLE/ALIGN/SIZE 항목이 참조하는 의미 토큰 차원(G1). */
39
+ token?: StyleTokenDim;
40
+ /** SELECT 등에서 노출할 큐레이션 값 집합(미지정 시 param 파싱 결과 전체). */
41
+ enum?: string[];
42
+ }
43
+ /** 속성 그룹. 레거시 {@code PropertyGroup}. `layoutAttr`면 소속 item 전부 layoutAttrMap 대상. */
44
+ export interface PropertyGroup {
45
+ name: string;
46
+ layoutAttr?: boolean;
47
+ items: PropertyItem[];
48
+ }
49
+ /**
50
+ * 파트가 지원하는 스타일 차원 하나. 레거시 {@code AddStyle}(children 有=라디오 차원, 無=토글).
51
+ * - enum: {@link STYLE_TOKENS}의 `dim`을 참조(옵션은 그 테이블에서 파생 — drift 방지). `only`로 부분집합 제한.
52
+ * - toggle: css 클래스 하나의 on/off.
53
+ */
54
+ export type StyleDim = {
55
+ kind: 'enum';
56
+ dim: StyleTokenDim;
57
+ only?: string[];
58
+ } | {
59
+ kind: 'toggle';
60
+ css: string;
61
+ label: string;
62
+ };
63
+ /**
64
+ * containment 규칙. M4에서 레거시 `getChildParts()` 오버라이드 여부(컨테이너 판별 유일 기준)를
65
+ * 역공학해 채움. 판별식·근거는 `containment.ts` 참조.
66
+ * - open: 임의 자식 수용(allow/allowCategories/deny로 필터). 필터 미지정이면 모든 타입 수용.
67
+ * - fixed: 특정 타입 자식만(fixedChildren). 개수 제약은 {@link ContainmentRule.arity}로 별도 표현.
68
+ * - leaf: 자식 거부.
69
+ *
70
+ * `arity`는 pairwise `canContain`이 아닌 트리 검증(M5 `validatePartModel`)이 소비하는
71
+ * 개수 불변식이다(예: ActionLayout=정확히 2 ActionLayoutArea, 단일 슬롯=max 1). M4는 데이터로만 기록.
72
+ */
73
+ export interface ContainmentRule {
74
+ role: 'open' | 'fixed' | 'leaf';
75
+ allow?: PartType[];
76
+ allowCategories?: PartCategory[];
77
+ deny?: PartType[];
78
+ fixedChildren?: PartType[];
79
+ /** 자식 개수 불변식(M5 소비). 미지정이면 제약 없음. */
80
+ arity?: {
81
+ min?: number;
82
+ max?: number;
83
+ };
84
+ }
85
+ /**
86
+ * `canContain` 판정 결과. warn-first 정책(계획 §M4)으로 3값.
87
+ * - allow: 규칙상 수용.
88
+ * - deny: 규칙상 명시적 거부(leaf 부모, fixed 부모의 비대상 자식, open 부모의 deny/allow 위반).
89
+ * - warn: 규칙 미정(부모 containment 미지정 — 호스트 확장 파트 등). 과도 제약 방지 위해 거부하지 않음.
90
+ */
91
+ export type ContainmentVerdict = 'allow' | 'deny' | 'warn';
92
+ /**
93
+ * 파트 정의(팔레트/속성패널/검증의 단일 SoT). 레거시 {@code UiModelerPartDef}.
94
+ * builtin은 닫힌 {@link PartType}, 호스트 확장 파트는 임의 string 키.
95
+ */
96
+ export interface PartDef {
97
+ partType: PartType | (string & {});
98
+ partName: string;
99
+ category?: PartCategory;
100
+ groups: PropertyGroup[];
101
+ styles?: StyleDim[];
102
+ /** G3 — caption 핸들·표시에 쓰는 propertyId. 없으면 caption 생략(id/path만). */
103
+ captionProp?: string;
104
+ /** M4에서 채움. M3에서는 미지정. */
105
+ containment?: ContainmentRule;
106
+ }
107
+ /** 카탈로그 조회 인터페이스. */
108
+ export interface PartCatalog {
109
+ get(partType: string): PartDef | undefined;
110
+ all(): PartDef[];
111
+ propertyItem(partType: string, propertyId: string): PropertyItem | undefined;
112
+ /**
113
+ * `parentType`이 `childType`을 자식으로 담을 수 있는지 pairwise 판정(M4).
114
+ * 개수(arity)는 검증하지 않는다 — 트리 검증(M5)의 관심사. {@link ContainmentVerdict} 참조.
115
+ */
116
+ canContain(parentType: string, childType: string): ContainmentVerdict;
117
+ }
@@ -0,0 +1,25 @@
1
+ import { PartModel } from '../core/types';
2
+ import { PartId } from './op';
3
+ import { Command } from './types';
4
+ /** update 대상 = 비구조 필드만(구조 변경은 add/move/remove). partId/partType/children 제외. */
5
+ export type PartPatch = Partial<Pick<PartModel, 'attrs' | 'layoutAttrs' | 'comment' | 'caseMessages' | 'info' | 'extraAttrs'>>;
6
+ /**
7
+ * 파트 추가 — `part` 서브트리를 `parentId`의 children[index]에 삽입(생략이면 append).
8
+ * invert는 삽입한 파트를 제거. emitOps forward=part.add(inline-fold value), invert=part.remove.
9
+ */
10
+ export declare function addPart(parentId: PartId, part: PartModel, index?: number): Command;
11
+ /**
12
+ * 파트 비구조 필드 부분 수정 — 얕은 patch. 원래 값(부재 키 포함)을 캡처해 invert에서 정확히 복원
13
+ * (부재였던 키는 삭제, 존재했던 키는 원값 복원 — undefined-vs-absent 왕복 손실 방지).
14
+ */
15
+ export declare function updatePart(partId: PartId, patch: PartPatch): Command;
16
+ /**
17
+ * 파트 이동 — `partId`를 `toParentId`의 children[index]로 옮긴다(index는 노드 제거 후 대상 배열 기준).
18
+ * memento로 원래 부모/인덱스/노드를 보존해 invert에서 원위치 복원. 드래그 중 coalesce(`move:<id>`).
19
+ */
20
+ export declare function movePart(partId: PartId, toParentId: PartId, index?: number): Command;
21
+ /**
22
+ * 파트 삭제 — 서브트리 통째 제거. memento로 부모/인덱스/서브트리를 보존해 invert에서 원자 재삽입.
23
+ * emitOps invert=part.add(inline-fold value=서브트리 통째) → 한 op에 자손까지 복원.
24
+ */
25
+ export declare function removePart(partId: PartId): Command;
@@ -0,0 +1,83 @@
1
+ import { PartModel } from '../core/types';
2
+ /** 파트 식별자. */
3
+ export type PartId = string;
4
+ /** rev CAS 대상 축 — UI는 단일 'part' 축(불변식 #2). */
5
+ export type CasUnit = 'part';
6
+ /** op 종류 — 트리 4연산. */
7
+ export type OpKind = 'part.add' | 'part.update' | 'part.move' | 'part.remove';
8
+ export declare const OP_KINDS: OpKind[];
9
+ /**
10
+ * command가 산출하는 단일 op의 어휘 형태. CAS 메타는 여기 없다 — emit 어댑터 책임(계약 3).
11
+ */
12
+ export interface OpShape {
13
+ kind: OpKind;
14
+ casUnit: CasUnit;
15
+ /** update/move/remove 대상 파트. */
16
+ partRef?: PartId;
17
+ /** add: 새 파트가 들어갈 부모. */
18
+ parentRef?: PartId;
19
+ /** move: 원래 부모. */
20
+ fromParentRef?: PartId;
21
+ /** move: 대상 부모. */
22
+ toParentRef?: PartId;
23
+ /**
24
+ * add/move: 대상 부모 children 내 삽입 위치. **대상 배열이 (move는 노드 제거 후) 존재하는
25
+ * 시점 기준의 인덱스**다. 생략이면 말미 append.
26
+ */
27
+ index?: number;
28
+ /**
29
+ * add: inline-fold 서브트리(children 인라인) — pending-ref 무효화 회피. 호스트 interpreter가
30
+ * 서브트리 **전 노드에 rev:0**을 stamp한다(불변식 #3).
31
+ */
32
+ value?: PartModel;
33
+ /** update: 비구조 필드 부분 patch(attrs/layoutAttrs/comment/…). */
34
+ patch?: Record<string, unknown>;
35
+ }
36
+ /**
37
+ * apply 이후 호출 계약(계약 1)의 산출 — memento가 채워진 상태에서 do/undo 양방향 op.
38
+ * invert는 *역연산 forward op*(계약 2) — 같은 op의 역값이 아니라 역연산 op.
39
+ */
40
+ export interface OpEmission {
41
+ /** do/redo 시 호스트로 보낼 op 배치(apply 순서). */
42
+ forward: OpShape[];
43
+ /** undo 시 호스트로 보낼 역연산 forward op 배치(invert 순서). */
44
+ invert: OpShape[];
45
+ }
46
+ /**
47
+ * op가 rev CAS를 거는 컨테이너 파트 목록(동시성 pivot). casUnit:'part' 단일 축.
48
+ * - add / remove: 부모 children 집합 변경 → `[parent]`.
49
+ * - update: 파트 자신 필드 변경 → `[self]`. (동시 remove는 호스트 element-level `$elemMatch`
50
+ * 실패 = missing으로 잡히므로 별도 부모 pivot 불요.)
51
+ * - move: 두 부모 children 변경 → `[from, to]`. 같은 부모 내 reorder면 Set dedup으로 1개.
52
+ */
53
+ export declare function revContainersOf(op: OpShape): PartId[];
54
+ /** op 출처 — 감사·aggregation 트리거 분기용. */
55
+ export type OpOrigin = 'gui' | 'agent' | 'rest';
56
+ /** 배치 CAS 단언 — 건드리는 컨테이너 파트의 base rev. 호스트가 updateOne filter로 접어 충돌 감지. */
57
+ export interface OpCas {
58
+ /** 컨테이너 partId → base rev. */
59
+ revs?: Record<PartId, number>;
60
+ }
61
+ /** 한 제스처 = 한 원자 배치 = 한 updateOne. */
62
+ export interface PersistedOpBatch {
63
+ modelId: string;
64
+ ops: OpShape[];
65
+ cas: OpCas;
66
+ origin: OpOrigin;
67
+ /** 멱등 키 — 재시도 중복 적용 차단. */
68
+ clientOpId: string;
69
+ }
70
+ /** 충돌 종류 — rev 불일치 / 대상 소실. */
71
+ export interface OpConflict {
72
+ kind: 'rev' | 'missing';
73
+ ref?: PartId;
74
+ current?: number;
75
+ }
76
+ /** 호스트 op 집행 응답 — ok면 갱신 rev, 충돌이면 하드 프리즈 트리거. */
77
+ export type OpResult = {
78
+ ok: true;
79
+ revs: Record<PartId, number>;
80
+ } | {
81
+ ok: false;
82
+ conflict: OpConflict;
83
+ };