open-grid 1.3.1 → 1.5.0

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 (67) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/README.ja.md +462 -0
  3. package/README.md +70 -19
  4. package/README.zh.md +455 -0
  5. package/dist/{OpenGrid-B7m7ei7f.cjs → OpenGrid-CT9bV6On.cjs} +7 -7
  6. package/dist/OpenGrid-CT9bV6On.cjs.map +1 -0
  7. package/dist/{OpenGrid-CeUdO_fM.js → OpenGrid-DACnZdEy.js} +7 -7
  8. package/dist/OpenGrid-DACnZdEy.js.map +1 -0
  9. package/dist/Registry-CPJYOqCn.js +74 -0
  10. package/dist/Registry-CPJYOqCn.js.map +1 -0
  11. package/dist/Registry-D74ZmdDz.cjs +71 -0
  12. package/dist/Registry-D74ZmdDz.cjs.map +1 -0
  13. package/dist/{index-JjfWY3Bt.cjs → index-Brfso4Ry.cjs} +92 -160
  14. package/dist/index-Brfso4Ry.cjs.map +1 -0
  15. package/dist/index-CeJ-0-80.cjs.map +1 -0
  16. package/dist/index-DnarQ4eR.js.map +1 -0
  17. package/dist/index-al9Mbv3E.js +481 -0
  18. package/dist/index-al9Mbv3E.js.map +1 -0
  19. package/dist/open-grid-base.css +98 -35
  20. package/dist/open-grid-header.cjs +188 -0
  21. package/dist/open-grid-header.cjs.map +1 -0
  22. package/dist/open-grid-header.css +386 -0
  23. package/dist/open-grid-header.js +197 -0
  24. package/dist/open-grid-header.js.map +1 -0
  25. package/dist/open-grid-react.cjs +1 -1
  26. package/dist/open-grid-react.cjs.map +1 -0
  27. package/dist/open-grid-react.js +1 -1
  28. package/dist/open-grid-react.js.map +1 -0
  29. package/dist/open-grid-themes.css +774 -1
  30. package/dist/open-grid-typography.cjs +97 -0
  31. package/dist/open-grid-typography.cjs.map +1 -0
  32. package/dist/open-grid-typography.css +181 -0
  33. package/dist/open-grid-typography.js +105 -0
  34. package/dist/open-grid-typography.js.map +1 -0
  35. package/dist/open-grid-vue.cjs +1 -1
  36. package/dist/open-grid-vue.cjs.map +1 -0
  37. package/dist/open-grid-vue.js +1 -1
  38. package/dist/open-grid-vue.js.map +1 -0
  39. package/dist/open-grid.cjs +31 -31
  40. package/dist/open-grid.cjs.map +1 -0
  41. package/dist/open-grid.js +86 -82
  42. package/dist/open-grid.js.map +1 -0
  43. package/dist/types/core/FilterSelect.d.ts +269 -33
  44. package/dist/types/core/GridShuttle.d.ts +160 -24
  45. package/dist/types/core/IconRegistry.d.ts +241 -33
  46. package/dist/types/core/OpenGrid.d.ts +2589 -327
  47. package/dist/types/core/OrgChart.d.ts +249 -32
  48. package/dist/types/core/SkinRegistry.d.ts +295 -60
  49. package/dist/types/core/XmlConverter.d.ts +388 -47
  50. package/dist/types/core/appearance/AppearanceAxis.d.ts +1 -1
  51. package/dist/types/core/appearance/HeaderRegistry.d.ts +236 -0
  52. package/dist/types/core/appearance/ThemeMetaRegistry.d.ts +1 -1
  53. package/dist/types/core/appearance/TypographyRegistry.d.ts +122 -0
  54. package/dist/types/core/appearance/index.d.ts +1 -0
  55. package/dist/types/core/chart/types.d.ts +1008 -126
  56. package/dist/types/core/extension/Registry.d.ts +389 -51
  57. package/dist/types/core/extension/reserved.d.ts +34 -5
  58. package/dist/types/core/i18n/LocaleRegistry.d.ts +271 -54
  59. package/dist/types/core/i18n/types.d.ts +636 -85
  60. package/dist/types/core/types.d.ts +3576 -426
  61. package/dist/types/header/index.d.ts +144 -0
  62. package/dist/types/index.d.ts +226 -17
  63. package/dist/types/typography/index.d.ts +128 -0
  64. package/dist/xlsx.min-BQ1o3sB6.cjs.map +1 -0
  65. package/dist/xlsx.min-Bbz2ZypC.js.map +1 -0
  66. package/package.json +126 -112
  67. package/dist/index-DrCPRuYi.js +0 -548
@@ -0,0 +1,144 @@
1
+ import { HeaderPresetMeta } from '../core/appearance/HeaderRegistry.js';
2
+ import { TokenDelta, AxisDefineResult } from '../core/appearance/AppearanceAxis.js';
3
+ import { RegisterOptions, RegisterResult } from '../core/extension/Registry.js';
4
+ export { HeaderAxis, HeaderRegistry, headerRegistry, HEADER_TOKENS, HEADER_ATTR, assertHeaderOnly, } from '../core/appearance/HeaderRegistry.js';
5
+ export type { HeaderPresetMeta } from '../core/appearance/HeaderRegistry.js';
6
+ export type { TokenDelta, AxisDefineResult } from '../core/appearance/AppearanceAxis.js';
7
+ export type { RegisterOptions, RegisterResult, RegistryEntry } from '../core/extension/Registry.js';
8
+ /**
9
+ * 내장 프리셋 4종 — id → 형태 토큰 델타.
10
+ *
11
+ * 값의 정본은 `src/styles/header.css` 의 프리셋 블록 폴백과 같다. 요소 경로에서는 CSS 가,
12
+ * 그리드 경로에서는 이 델타가 같은 형태로 수렴한다.
13
+ *
14
+ * The four built-in presets — id → shape-token delta.
15
+ *
16
+ * These mirror the fallbacks in the preset blocks of `src/styles/header.css`.
17
+ */
18
+ export declare const HEADER_PRESETS: Readonly<Record<string, TokenDelta>>;
19
+ /**
20
+ * `applyHeader` 가 어느 경로로 적용했는지.
21
+ *
22
+ * Which path `applyHeader` took.
23
+ *
24
+ * - `'element'` — 컨테이너 요소에 `data-og-header` 를 붙였다. CSS 프리셋이 전부 작동한다(완전 적용).
25
+ * - `'grid-vars'` — 그리드 공개 API 로 형태 토큰만 주입했다. 속성이 없어 **프리셋 규칙은 비활성**이다.
26
+ */
27
+ export type HeaderApplyMode = 'element' | 'grid-vars';
28
+ /** `applyHeader` 결과. / Result of `applyHeader`. */
29
+ export interface HeaderApplyResult {
30
+ /** 적용 경로. / The path taken. */
31
+ readonly mode: HeaderApplyMode;
32
+ /** 정직 고지(경로 제약·미등록 id 등). 빈 배열이면 완전 적용. / Honest notices; empty means fully applied. */
33
+ readonly warnings: string[];
34
+ }
35
+ /**
36
+ * 그리드 경로가 요구하는 최소 구조 — `OpenGrid` 가 구조적으로 만족한다.
37
+ *
38
+ * `OpenGrid` 를 타입으로 import 하지 않는 이유는 플러그인 번들이 코어 타입 그래프에 묶이지 않게
39
+ * 하기 위함이다. `setThemeVar(k, v)` 는 컨테이너 인라인 CSS 변수를 세팅하는 공개 메서드다.
40
+ *
41
+ * The minimal shape the grid path needs — `OpenGrid` satisfies it structurally.
42
+ */
43
+ export interface HeaderGridTarget {
44
+ setThemeVar(name: string, value: string): void;
45
+ }
46
+ /**
47
+ * 머리글 프리셋을 적용한다. 코어 무수정 경로.
48
+ *
49
+ * **두 경로가 있고, 능력 차이가 타이포 축보다 훨씬 크다. 정직하게 밝힌다.**
50
+ *
51
+ * 1. `target` 이 **HTMLElement**(그리드 컨테이너 = `.og-container`)이면 `data-og-header` 속성을
52
+ * 붙인다. `header.css` 의 프리셋 블록이 전부 살아난다. **이 경로가 완전판이며
53
+ * `open-grid/header.css` 로드가 전제다.** 값을 인라인하지 않는 이유는 인라인 스타일이
54
+ * 프리셋의 T1(토큰 재정의) 규칙보다 강해 프리셋을 덮어버리기 때문이다.
55
+ * 2. `target` 이 **그리드 인스턴스**이면 공개 `setThemeVar()` 로 형태 토큰 8개만 인라인 주입한다.
56
+ * `OpenGrid` 는 컨테이너 요소를 반환하는 공개 접근자를 제공하지 않으므로(`_container` 는
57
+ * private) **속성을 붙일 방법이 없다.** 헤더 축은 프리셋의 거의 전부가 속성 조건부 셀렉터라
58
+ * **이 경로로는 사실상 아무 변화가 없다** — 타이포 축과 달리 "반쪽" 이 아니라 "거의 무동작" 이다.
59
+ * 그 사실을 경고로 반환한다.
60
+ *
61
+ * 완전 적용이 필요하면 컨테이너 요소를 직접 넘겨라(`document.querySelector('.og-container')`).
62
+ *
63
+ * Apply a header preset. Requires no core modification.
64
+ *
65
+ * **There are two paths and the capability gap is much wider than the typography axis's.**
66
+ *
67
+ * 1. An **HTMLElement** target gets the `data-og-header` attribute and every CSS preset rule works.
68
+ * 2. A **grid instance** target gets only the 8 shape tokens injected inline. Because virtually all
69
+ * preset rules are attribute-conditional, this path produces almost no visible change — this is
70
+ * returned as a warning rather than failing silently.
71
+ *
72
+ * @param target - 그리드 컨테이너 요소 또는 그리드 인스턴스
73
+ *
74
+ * The grid container element, or a grid instance
75
+ * @param id - 프리셋 id(`'default'` 는 축 해제 = 오늘의 머리글)
76
+ *
77
+ * Preset id (`'default'` clears the axis)
78
+ * @returns 적용 경로 + 정직 고지
79
+ *
80
+ * The path taken plus honest notices
81
+ * @throws target 이 요소도 그리드도 아니면 Error
82
+ *
83
+ * Throws when the target is neither an element nor a grid
84
+ * @example
85
+ * import { applyHeader } from 'open-grid/header';
86
+ * import 'open-grid/header.css';
87
+ *
88
+ * applyHeader(document.querySelector('.og-container')!, 'rule'); // 완전 적용
89
+ * applyHeader(grid, 'rule'); // 토큰만 — 경고 1건 반환(사실상 무동작)
90
+ */
91
+ export declare function applyHeader(target: HTMLElement | HeaderGridTarget, id: string): HeaderApplyResult;
92
+ /**
93
+ * 사용자 정의 프리셋 등록.
94
+ *
95
+ * 색·조판·밀도·질감 토큰이 섞여 있으면 등록 게이트가 즉시 throw 한다(축 오염 금지).
96
+ * 특히 `--og-header-bg` 처럼 **접두사가 같아 헤더 것처럼 보이는 색 토큰**도 거부한다 —
97
+ * 그것은 테마 축 소유다. 불투명도는 0~1 로, 음수 길이는 0 으로 클램프하고 경고한다.
98
+ *
99
+ * Register a user-defined preset.
100
+ *
101
+ * The registration gate throws on color/typography/density/texture tokens — including
102
+ * `--og-header-*` color tokens, which merely share the prefix but belong to the theme axis.
103
+ *
104
+ * **내장 5종은 조용히 안 덮인다.** `{ override: true }` 없이 `'rule'` 을 다시 등록하면 거부되고
105
+ * 사유가 `registration` 으로 돌아온다(throw 하지 않는다). 형제 축(밀도·질감·타이포)에는 이 보호가
106
+ * 없어 내장값이 소리 없이 사라진다 — 헤더 축이 처음으로 갖는 안전장치다.
107
+ *
108
+ * Built-ins are protected: re-registering `'rule'` without `{ override: true }` is rejected and the
109
+ * reason comes back in `registration` — it never throws. The sibling axes lack this protection.
110
+ *
111
+ * @param id - 프리셋 id
112
+ *
113
+ * Preset id
114
+ * @param delta - 헤더 형태 토큰 델타
115
+ *
116
+ * Header shape-token delta
117
+ * @param opts - 등록 정책 옵션(`override`·`pluginId`·`priority`) + 프리셋 메타
118
+ *
119
+ * Registration policy options plus preset metadata
120
+ * @returns 클램프 반영된 델타 + 경고 + 등록 판정
121
+ *
122
+ * The clamped delta, warnings, and the registration verdict
123
+ * @example
124
+ * defineHeader('hairline', { '--og-header-rule-width': '1px', '--og-header-hint-opacity': '0.3' });
125
+ *
126
+ * // 내장 보호 — 덮으려면 명시해야 한다
127
+ * defineHeader('rule', d).registration.ok; // false (kept)
128
+ * defineHeader('rule', d, { override: true }).registration.ok; // true (replaced)
129
+ *
130
+ * // 플러그인이 넣은 것만 골라 해제 — 등록의 대칭
131
+ * defineHeader('mine', d, { pluginId: 'acme' });
132
+ * headerRegistry.disposePlugin('acme'); // 1
133
+ */
134
+ export declare function defineHeader(id: string, delta: TokenDelta, opts?: RegisterOptions & {
135
+ meta?: HeaderPresetMeta;
136
+ }): AxisDefineResult & {
137
+ registration: RegisterResult;
138
+ };
139
+ /**
140
+ * 등록된 프리셋 id 목록(피커 UI·인스펙터용).
141
+ *
142
+ * Registered preset ids (for picker UIs and inspectors).
143
+ */
144
+ export declare function listHeader(): string[];
@@ -1,37 +1,246 @@
1
- /** 그리드 코어 클래스. / The core grid class. */
1
+ /**
2
+ * 그리드 코어 클래스.
3
+ *
4
+ * The core grid class.
5
+ *
6
+ * グリッドのコアクラス。
7
+ *
8
+ * 表格核心类。
9
+ */
2
10
  export { OpenGrid } from './core/OpenGrid.js';
3
- /** 두 그리드 사이 행 이동 셔틀(화살표 버튼 UI). / Row shuttle between two grids (arrow-button UI). */
11
+ /**
12
+ * 두 그리드 사이 행 이동 셔틀(화살표 버튼 UI).
13
+ *
14
+ * Row shuttle between two grids (arrow-button UI).
15
+ *
16
+ * 2つのグリッド間の行移動シャトル(矢印ボタンUI)。
17
+ *
18
+ * 两个表格之间的行移动穿梭框(箭头按钮 UI)。
19
+ */
4
20
  export { GridShuttle, createGridShuttle } from './core/GridShuttle.js';
5
- /** GridShuttle 생성 옵션. / Construction options for GridShuttle. */
21
+ /**
22
+ * GridShuttle 생성 옵션.
23
+ *
24
+ * Construction options for GridShuttle.
25
+ *
26
+ * GridShuttle の生成オプション。
27
+ *
28
+ * GridShuttle 的构造选项。
29
+ */
6
30
  export type { GridShuttleOptions } from './core/GridShuttle.js';
7
- /** 조직도(트리) 차트 위젯. / Organization (tree) chart widget. */
31
+ /**
32
+ * 조직도(트리) 차트 위젯.
33
+ *
34
+ * Organization (tree) chart widget.
35
+ *
36
+ * 組織図(ツリー)チャートウィジェット。
37
+ *
38
+ * 组织架构(树形)图表组件。
39
+ */
8
40
  export { OrgChart } from './core/OrgChart.js';
9
- /** XML ↔ 행 데이터 변환기(SAP 계열 응답 포함). / XML ↔ row-data converter (incl. SAP-style payloads). */
41
+ /**
42
+ * XML ↔ 행 데이터 변환기(SAP 계열 응답 포함).
43
+ *
44
+ * XML ↔ row-data converter (incl. SAP-style payloads).
45
+ *
46
+ * XML ↔ 行データ変換器(SAP系レスポンスを含む)。
47
+ *
48
+ * XML ↔ 行数据转换器(含 SAP 系响应)。
49
+ */
10
50
  export { XmlConverter } from './core/XmlConverter.js';
11
- /** 시맨틱 아이콘 role 레지스트리·렌더 헬퍼. / Semantic icon role registry & render helpers. */
51
+ /**
52
+ * 시맨틱 아이콘 role 레지스트리·렌더 헬퍼.
53
+ *
54
+ * Semantic icon role registry & render helpers.
55
+ *
56
+ * セマンティックアイコンロールレジストリ・レンダーヘルパー。
57
+ *
58
+ * 语义图标角色注册表与渲染辅助函数。
59
+ */
12
60
  export { IconRegistry, iconRegistry, renderIcon, DEFAULT_ICON_ROLES } from './core/IconRegistry.js';
13
- /** renderIcon 옵션(size/title/element 반환 여부). / Options for renderIcon (size/title/element output). */
61
+ /**
62
+ * renderIcon 옵션(size/title/element 반환 여부).
63
+ *
64
+ * Options for renderIcon (size/title/element output).
65
+ *
66
+ * renderIcon のオプション(size/title/element の出力可否)。
67
+ *
68
+ * renderIcon 的选项(size/title/element 输出)。
69
+ */
14
70
  export type { IconRenderOptions } from './core/IconRegistry.js';
15
- /** 스킨(FORM 축) 정의 레지스트리. / Skin (FORM-axis) definition registry. */
71
+ /**
72
+ * 스킨(FORM 축) 정의 레지스트리.
73
+ *
74
+ * Skin (FORM-axis) definition registry.
75
+ *
76
+ * スキン(FORM軸)定義レジストリ。
77
+ *
78
+ * 皮肤(FORM 轴)定义注册表。
79
+ */
16
80
  export { SkinRegistry, skinRegistry } from './core/SkinRegistry.js';
17
- /** FORM 전용 스킨 토큰 델타(색 리터럴 금지). / FORM-only skin token delta (color literals rejected). */
81
+ /**
82
+ * FORM 전용 스킨 토큰 델타(색 리터럴 금지).
83
+ *
84
+ * FORM-only skin token delta (color literals rejected).
85
+ *
86
+ * FORM専用スキントークンデルタ(色リテラル禁止)。
87
+ *
88
+ * FORM 专用皮肤令牌增量(拒绝颜色字面量)。
89
+ */
18
90
  export type { SkinTokenDelta } from './core/types.js';
19
- /** 로케일 메시지 레지스트리·전역 싱글턴·편의 t(). / Locale message registry, global singleton & convenience t(). */
91
+ /**
92
+ * 로케일 메시지 레지스트리·전역 싱글턴·편의 t().
93
+ *
94
+ * Locale message registry, global singleton & convenience t().
95
+ *
96
+ * ロケールメッセージレジストリ・グローバルシングルトン・便利な t()。
97
+ *
98
+ * 语言环境消息注册表、全局单例及便捷函数 t()。
99
+ */
20
100
  export { LocaleRegistry, localeRegistry, t } from './core/i18n/LocaleRegistry.js';
21
- /** 로케일 메시지 카탈로그·부분 오버라이드·dot-key·값·등록결과·메타 타입. / Locale catalog, partial override, dot-key, value, register-result & meta types. */
101
+ /**
102
+ * 로케일 메시지 카탈로그·부분 오버라이드·dot-key·값·등록결과·메타 타입.
103
+ *
104
+ * Locale catalog, partial override, dot-key, value, register-result & meta types.
105
+ *
106
+ * ロケールメッセージカタログ・部分オーバーライド・dot-key・値・登録結果・メタ型。
107
+ *
108
+ * 语言环境消息目录、部分覆盖、dot-key、值、注册结果与元信息类型。
109
+ */
22
110
  export type { LocaleMessages, PartialLocaleMessages, LocaleMessageKey, MessageValue, LocaleRegisterResult, LocaleMeta, } from './core/i18n/types.js';
23
- /** OrgChart 옵션·컬럼 정의. / OrgChart options & column definition. */
111
+ /**
112
+ * OrgChart 옵션·컬럼 정의.
113
+ *
114
+ * OrgChart options & column definition.
115
+ *
116
+ * OrgChart のオプション・カラム定義。
117
+ *
118
+ * OrgChart 的选项与列定义。
119
+ */
24
120
  export type { OrgChartOptions, OrgChartColumnDef } from './core/OrgChart.js';
25
- /** 트리 노드 아이콘 정의. / Tree node icon definition. */
121
+ /**
122
+ * 트리 노드 아이콘 정의.
123
+ *
124
+ * Tree node icon definition.
125
+ *
126
+ * ツリーノードアイコン定義。
127
+ *
128
+ * 树节点图标定义。
129
+ */
26
130
  export type { TreeNodeIconDef } from './core/types.js';
27
- /** 캐스케이딩 필터 셀렉트 설정. / Cascading filter-select configuration. */
131
+ /**
132
+ * 캐스케이딩 필터 셀렉트 설정.
133
+ *
134
+ * Cascading filter-select configuration.
135
+ *
136
+ * カスケーディングフィルターセレクト設定。
137
+ *
138
+ * 级联筛选下拉框配置。
139
+ */
28
140
  export type { FilterSelectConfig, FilterSelectColumn } from './core/FilterSelect.js';
29
141
  /**
30
142
  * 그리드 코어 공개 타입 모음(옵션·컬럼·이벤트·트리거·Phase 0 인프라).
31
- * / Core public types (options, columns, events, triggers, Phase 0 infrastructure).
143
+ *
144
+ * Core public types (options, columns, events, triggers, Phase 0 infrastructure).
145
+ *
146
+ * グリッドコアの公開型一覧(オプション・カラム・イベント・トリガー・Phase 0インフラ)。
147
+ *
148
+ * 表格核心公开类型集合(选项、列、事件、触发器、Phase 0 基础设施)。
32
149
  */
33
150
  export type { GridOptions, ColumnDef, OpenGridInstance, CellEvent, CellKeyEvent, EditEvent, RowEvent, SortItem, FilterItem, ExportOptions, FooterDef, SummaryOptions, RendererDef, EditorDef, DataType, SelectionMode, SortDir, Position, TriggerContext, TriggerHandler, TriggerEvent, CellRange, FlatRowRef, } from './core/types.js';
34
- /** XmlConverter 파싱/직렬화 옵션·결과. / XmlConverter parse/stringify options & results. */
151
+ /**
152
+ * XmlConverter 파싱/직렬화 옵션·결과.
153
+ *
154
+ * XmlConverter parse/stringify options & results.
155
+ *
156
+ * XmlConverter のパース/直列化オプション・結果。
157
+ *
158
+ * XmlConverter 的解析/序列化选项与结果。
159
+ */
35
160
  export type { XmlParseOptions, XmlStringifyOptions, SapParseResult, } from './core/XmlConverter.js';
36
- /** F4 통합 차트 공개 타입. / Public types of the F4 integrated chart. */
161
+ /**
162
+ * F4 통합 차트 공개 타입.
163
+ *
164
+ * Public types of the F4 integrated chart.
165
+ *
166
+ * F4統合チャートの公開型。
167
+ *
168
+ * F4 集成图表的公开类型。
169
+ */
37
170
  export type { ChartType, ChartSource, ChartSeriesSpec, ChartSeries, ChartDataModel, ChartConfig, ChartInstance, ChartGlobalOptions, ChartPoint, ChartAdapter, ChartRenderSpec, ChartTheme, A11yTableModel, } from './core/chart/types.js';
171
+ /**
172
+ * 이름표를 붙여 무언가를 등록해 두고 나중에 꺼내 쓰는 등록소입니다.
173
+ * 셀 렌더러나 포맷터처럼 사용자가 직접 만든 것을 모아둘 때 씁니다.
174
+ *
175
+ * 그냥 `Map` 을 써도 되지만, 그러면 방금 등록이 새로 들어간 것인지 남의 것을
176
+ * 덮어쓴 것인지 알 수 없습니다. 이 등록소는 매 등록마다 어떻게 처리됐는지를
177
+ * 알려줍니다 — 새로 넣었으면 `added`, 덮어썼으면 `replaced`, 기존 것을 지켰으면
178
+ * `kept`, 거절했으면 `rejected` 이고, 지키거나 거절한 경우엔 그 이유도 함께 옵니다.
179
+ *
180
+ * `og:` 나 `og-` 로 시작하는 이름은 그리드가 쓰려고 남겨둔 자리라 등록이 거절됩니다.
181
+ * 내장 항목을 남이 덮어쓰지 못하게 막고 싶으면 `duplicatePolicy: 'protect-builtin'`
182
+ * 을 주면 됩니다.
183
+ *
184
+ * A registry that stores values under a name so you can look them up later —
185
+ * useful for collecting your own cell renderers or formatters.
186
+ *
187
+ * Unlike a plain `Map`, it tells you what each registration actually did:
188
+ * `added`, `replaced`, `kept`, or `rejected` (the latter two come with a reason).
189
+ * Names starting with `og:` or `og-` are reserved by the grid and get rejected,
190
+ * and `duplicatePolicy: 'protect-builtin'` keeps built-in entries from being overwritten.
191
+ *
192
+ * 名前を付けて何かを登録しておき、後から取り出して使うレジストリです。
193
+ * セルレンダラーやフォーマッターのように自分で作ったものをまとめておくときに使います。
194
+ *
195
+ * ただの `Map` を使うこともできますが、それでは今の登録が新規なのか他人のものを
196
+ * 上書きしたのか分かりません。このレジストリは登録のたびにどう処理されたかを
197
+ * 教えてくれます — 新規なら `added`、上書きなら `replaced`、既存を守ったなら
198
+ * `kept`、拒否したなら `rejected` で、守った場合と拒否した場合にはその理由も付きます。
199
+ *
200
+ * `og:` や `og-` で始まる名前はグリッドが使うために予約されているため、登録は
201
+ * 拒否されます。組み込み項目を他人に上書きされたくない場合は
202
+ * `duplicatePolicy: 'protect-builtin'` を指定します。
203
+ *
204
+ * 按名称存储值、供之后查找取用的注册表,可用来收集自定义的单元格渲染器或格式化器。
205
+ *
206
+ * 普通 `Map` 也能用,但看不出这次注册是新增还是覆盖了别人的值。这个注册表会告知
207
+ * 每次注册的处理结果:新增为 `added`、覆盖为 `replaced`、保留原值为 `kept`、拒绝为
208
+ * `rejected`(后两者附带原因)。表格保留了以 `og:` 或 `og-` 开头的名称,这类注册
209
+ * 会被拒绝;设置 `duplicatePolicy: 'protect-builtin'` 即可防止内置项被覆盖。
210
+ *
211
+ * @example
212
+ * const reg = new TypedRegistry({ spi: { name: 'ICellRenderer', version: '1' } });
213
+ * reg.register('rating', factory); // → { action: 'added' }
214
+ * reg.register('og:core', factory); // → { action: 'rejected', reason: 'reserved-namespace' }
215
+ * reg.get('rating'); // returns the registered value
216
+ */
217
+ export { TypedRegistry } from './core/extension/Registry.js';
218
+ /**
219
+ * 등록소를 쓸 때 필요한 타입들 — 등록소가 지켜야 할 계약, 등록할 때 주는 옵션과
220
+ * 돌아오는 결과, 등록된 항목의 정보, 중복됐을 때의 처리 방침, 생성 설정.
221
+ *
222
+ * Types for working with the registry — its contract, the options you pass in and the
223
+ * result you get back, entry metadata, the duplicate-handling policy, and construction config.
224
+ *
225
+ * レジストリを使うときに必要な型です — レジストリが守るべき契約、登録時に渡すオプションと
226
+ * 返ってくる結果、登録された項目の情報、重複時の処理方針、生成設定。
227
+ *
228
+ * 使用注册表所需的类型——注册表应遵守的契约、注册时传入的选项与返回的结果、
229
+ * 已注册条目的信息、重复时的处理策略、构造配置。
230
+ */
231
+ export type { IRegistry, RegisterOptions, RegisterResult, RegisterAction, RegisterReason, RegistryEntry, EntryOrigin, DuplicatePolicy, DeprecationInfo, TypedRegistryConfig, } from './core/extension/Registry.js';
232
+ /**
233
+ * 그리드가 자기 몫으로 남겨둔 이름 접두사(`og:` · `og-`)와, 어떤 이름이 거기 걸리는지
234
+ * 미리 확인하는 함수입니다. 등록이 거절당하기 전에 먼저 물어볼 때 씁니다.
235
+ *
236
+ * The name prefixes the grid reserves for itself (`og:` / `og-`), plus a helper to check
237
+ * a name against them before a registration gets rejected.
238
+ *
239
+ * グリッドが自分のために予約した名前プレフィックス(`og:` ・ `og-`)と、ある名前が
240
+ * それに該当するかどうかを事前に確認する関数です。登録が拒否される前に問い合わせる
241
+ * ときに使います。
242
+ *
243
+ * 表格为自身保留的名称前缀(`og:` / `og-`),以及在注册被拒绝前预先检查某个名称
244
+ * 是否命中这些前缀的辅助函数。
245
+ */
246
+ export { RESERVED_PREFIXES, isReserved } from './core/extension/reserved.js';
@@ -0,0 +1,128 @@
1
+ import { TokenDelta } from '../core/appearance/AppearanceAxis.js';
2
+ export { TypographyRegistry, typographyRegistry, TYPOGRAPHY_TOKENS, TYPOGRAPHY_ATTR, assertTypographyOnly, } from '../core/appearance/TypographyRegistry.js';
3
+ export type { TokenDelta } from '../core/appearance/AppearanceAxis.js';
4
+ /**
5
+ * 내장 프리셋 7종 — id → 토큰 델타.
6
+ *
7
+ * 값의 정본은 `src/styles/typography.css` 의 프리셋 블록과 같다. 요소 경로에서는 CSS 가,
8
+ * 그리드 경로에서는 이 델타가 같은 결과를 낸다(§'두 경로' 참조).
9
+ *
10
+ * The seven built-in presets — id → token delta.
11
+ *
12
+ * These values mirror the preset blocks in `src/styles/typography.css`: the element path is
13
+ * driven by CSS, the grid path by this delta, and both land on the same tokens.
14
+ */
15
+ export declare const TYPOGRAPHY_PRESETS: Readonly<Record<string, TokenDelta>>;
16
+ /**
17
+ * `applyTypography` 가 어느 경로로 적용했는지.
18
+ *
19
+ * Which path `applyTypography` took.
20
+ *
21
+ * - `'element'` — 컨테이너 요소에 `data-og-typography` 를 붙였다. CSS 프리셋이 전부 작동한다(완전 적용).
22
+ * - `'grid-vars'` — 그리드 공개 API 로 CSS 변수만 주입했다. 속성이 없어 **속성 조건부 규칙은 비활성**이다.
23
+ */
24
+ export type TypographyApplyMode = 'element' | 'grid-vars';
25
+ /** `applyTypography` 결과. / Result of `applyTypography`. */
26
+ export interface TypographyApplyResult {
27
+ /** 적용 경로. / The path taken. */
28
+ readonly mode: TypographyApplyMode;
29
+ /** 정직 고지(경로 제약·미등록 id 등). 빈 배열이면 완전 적용. / Honest notices; empty means fully applied. */
30
+ readonly warnings: string[];
31
+ }
32
+ /**
33
+ * 그리드 경로가 요구하는 최소 구조 — `OpenGrid` 가 구조적으로 만족한다.
34
+ *
35
+ * `OpenGrid` 를 타입으로 import 하지 않는 이유는 플러그인 번들이 코어 타입 그래프에 묶이지 않게
36
+ * 하기 위함이다. `setThemeVar(k, v)` 는 컨테이너 인라인 CSS 변수를 세팅하는 공개 메서드다.
37
+ *
38
+ * The minimal shape the grid path needs — `OpenGrid` satisfies it structurally.
39
+ *
40
+ * `OpenGrid` is not imported as a type so the plugin bundle stays untangled from the core type
41
+ * graph. `setThemeVar(k, v)` is the public method that sets an inline CSS variable on the container.
42
+ */
43
+ export interface TypographyGridTarget {
44
+ setThemeVar(name: string, value: string): void;
45
+ }
46
+ /**
47
+ * 프리셋을 적용한다. 코어 무수정 경로.
48
+ *
49
+ * **두 경로가 있고, 능력이 다르다. 정직하게 밝힌다.**
50
+ *
51
+ * 1. `target` 이 **HTMLElement**(그리드 컨테이너 = `.og-container`)이면 `data-og-typography`
52
+ * 속성을 붙인다. `typography.css` 의 프리셋 블록·밀도 복합 셀렉터(광학 크기)·`:lang()` 한자
53
+ * 분기까지 전부 살아난다. **이 경로가 완전판이며, `open-grid-typography.css` 로드가 전제다**
54
+ * (값을 인라인하지 않는 이유: 인라인은 복합 셀렉터 보정을 덮어버린다).
55
+ * 2. `target` 이 **그리드 인스턴스**이면 공개 `setThemeVar()` 로 9개 토큰을 인라인 주입한다.
56
+ * `OpenGrid` 는 컨테이너 요소를 반환하는 공개 접근자를 제공하지 않으므로(2026-08 조사 결과:
57
+ * `_container` 는 private, 공개 표면에 getter 없음) **속성을 붙일 방법이 없다.** 따라서
58
+ * `[data-og-typography="dense-scan"][data-og-density="compact"]` 같은 속성 조건부 규칙과
59
+ * `cjk-doc` 의 `:lang()` 분기는 **작동하지 않는다.** 그 사실을 경고로 반환한다.
60
+ *
61
+ * 완전 적용이 필요하면 컨테이너 요소를 직접 넘겨라(`document.querySelector('#myGrid')`).
62
+ *
63
+ * Apply a preset. Requires no core modification.
64
+ *
65
+ * **There are two paths and they are not equally capable — stated plainly.**
66
+ *
67
+ * 1. An **HTMLElement** target (the grid container, `.og-container`) gets the
68
+ * `data-og-typography` attribute, so every CSS rule works, including density compound
69
+ * selectors (optical sizing) and the `:lang()` Han-unification split. **This is the full path.**
70
+ * 2. A **grid instance** target gets the nine tokens injected inline via the public
71
+ * `setThemeVar()`. `OpenGrid` exposes no public accessor for its container element (verified
72
+ * 2026-08: `_container` is private with no public getter), so the attribute cannot be set.
73
+ * Attribute-conditional rules therefore do not apply; this is returned as a warning.
74
+ *
75
+ * @param target - 그리드 컨테이너 요소 또는 그리드 인스턴스
76
+ *
77
+ * The grid container element, or a grid instance
78
+ * @param id - 프리셋 id(`'default'` 는 축 해제)
79
+ *
80
+ * Preset id (`'default'` clears the axis)
81
+ * @returns 적용 경로 + 정직 고지
82
+ *
83
+ * The path taken plus honest notices
84
+ * @throws target 이 요소도 그리드도 아니면 Error
85
+ *
86
+ * Throws when the target is neither an element nor a grid
87
+ * @example
88
+ * import { applyTypography } from 'open-grid/typography';
89
+ * import 'open-grid/dist/open-grid-typography.css';
90
+ *
91
+ * applyTypography(document.querySelector('#grid .og-container')!, 'ledger'); // 완전 적용
92
+ * applyTypography(grid, 'ledger'); // 변수만 — 경고 1건 반환
93
+ */
94
+ export declare function applyTypography(target: HTMLElement | TypographyGridTarget, id: string): TypographyApplyResult;
95
+ /**
96
+ * 사용자 정의 프리셋 등록.
97
+ *
98
+ * 색·형태·밀도·질감 토큰이 섞여 있으면 등록 게이트가 즉시 throw 한다(축 오염 금지). 웹폰트
99
+ * 선언(`url(`/`@font-face`)도 throw. 음수 자간 × CJK 스택은 `normal` 로 클램프하고 경고한다.
100
+ *
101
+ * Register a user-defined preset.
102
+ *
103
+ * The registration gate throws immediately on color/form/density/texture tokens (axis pollution)
104
+ * and on web-font declarations. A negative tracking value on a CJK stack is clamped to `normal`
105
+ * with a warning.
106
+ *
107
+ * @param id - 프리셋 id
108
+ *
109
+ * Preset id
110
+ * @param delta - 타이포 토큰 델타
111
+ *
112
+ * Typography token delta
113
+ * @returns 클램프 반영된 델타 + 경고
114
+ *
115
+ * The clamped delta plus warnings
116
+ * @example
117
+ * defineTypography('brand', { '--og-font-family': '"My Sans", sans-serif', '--og-font-weight': '450' });
118
+ */
119
+ export declare function defineTypography(id: string, delta: TokenDelta): {
120
+ delta: TokenDelta;
121
+ warnings: string[];
122
+ };
123
+ /**
124
+ * 등록된 프리셋 id 목록(피커 UI·인스펙터용).
125
+ *
126
+ * Registered preset ids (for picker UIs and inspectors).
127
+ */
128
+ export declare function listTypography(): string[];