@lumir-company/editor 0.4.21 → 0.4.22

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.
package/README.md CHANGED
@@ -1479,6 +1479,15 @@ const url = await uploader(imageFile);
1479
1479
 
1480
1480
  ## 변경 로그
1481
1481
 
1482
+ ### v0.4.22 (2026-06-22)
1483
+
1484
+ - **글자 크기 1px 단위 조절** *(신규)*
1485
+ - 글자 크기 드롭다운(포매팅 툴바·플로팅 메뉴) 상단에 **−/+ 스테퍼 + 직접 입력** 추가 → 프리셋 사이 값(13·15·17·21px…)을 1px 단위로 지정 (`↑`/`↓` 키로도 증감)
1486
+ - 허용 범위 **8~96px**(범위 밖 입력은 자동 보정), 명시 크기가 없으면 14px 기준으로 증감. 스테퍼 클릭 시 드롭다운은 닫히지 않아 연속 조절 가능
1487
+ - 기존 프리셋(10·12·14·16·18·20·24·28px)·"기본" 리셋은 그대로 유지. 저장 JSON·하위호환(형제 키 직렬화)은 변경 없음
1488
+ - 공개 API에 `FONT_SIZE_MIN`/`FONT_SIZE_MAX`/`FONT_SIZE_DEFAULT_PX`/`FONT_SIZE_STEP` 및 `parseFontSizePx`/`clampFontSizePx`/`toFontSizeValue` 추가
1489
+ - **글자 크기 스타일을 동기 스펙(`createStyleSpec`)으로 변경**: 기존 React 스펙은 span 내용이 비동기 렌더되어, 크기 적용 직후 포매팅 툴바가 좌상단으로 튀는 문제가 있었음(선택 영역 DOM 좌표가 순간 (0,0)으로 측정됨). 동기 렌더로 바꿔 툴바가 선택 위치에 고정됨. HTML 직렬화(`data-style-type`/`data-value`)는 동일
1490
+
1482
1491
  ### v0.4.21 (2026-06-18)
1483
1492
 
1484
1493
  - **Word/docx 표 붙여넣기 품질 개선** *(신규)*
package/dist/index.d.mts CHANGED
@@ -932,13 +932,10 @@ declare const schema: BlockNoteSchema<_blocknote_core.BlockSchemaFromSpecs<{
932
932
  implementation: any;
933
933
  };
934
934
  }>, _blocknote_core.StyleSchemaFromSpecs<{
935
- fontSize: {
936
- config: {
937
- type: string;
938
- propSchema: "string";
939
- };
940
- implementation: _blocknote_core.StyleImplementation;
941
- };
935
+ fontSize: _blocknote_core.StyleSpec<{
936
+ type: string;
937
+ propSchema: "string";
938
+ }>;
942
939
  bold: {
943
940
  config: {
944
941
  type: string;
@@ -1080,16 +1077,25 @@ declare const FloatingMenu: React.FC<FloatingMenuProps>;
1080
1077
  * styles.fontSize 대신 형제 키 fontSize로 직렬화한다.
1081
1078
  * → src/utils/font-size-serialization.ts (liftFontSize/lowerFontSize) 참고.
1082
1079
  */
1083
- declare const FontSize: {
1084
- config: {
1085
- type: string;
1086
- propSchema: "string";
1087
- };
1088
- implementation: _blocknote_core.StyleImplementation;
1089
- };
1080
+ declare const FontSize: _blocknote_core.StyleSpec<{
1081
+ type: string;
1082
+ propSchema: "string";
1083
+ }>;
1090
1084
  /** 툴바 드롭다운에서 제공하는 프리셋 (본문 기본은 14px = "기본") */
1091
1085
  declare const FONT_SIZE_PRESETS: readonly ["10px", "12px", "14px", "16px", "18px", "20px", "24px", "28px"];
1092
1086
  type FontSizePreset = (typeof FONT_SIZE_PRESETS)[number];
1087
+ /** 글자 크기 1px 스테퍼의 허용 범위/기본값 (사용자 결정: 8~96px). */
1088
+ declare const FONT_SIZE_MIN = 8;
1089
+ declare const FONT_SIZE_MAX = 96;
1090
+ /** "기본"(명시 fontSize 없음)일 때 기준이 되는 본문 px. */
1091
+ declare const FONT_SIZE_DEFAULT_PX = 14;
1092
+ declare const FONT_SIZE_STEP = 1;
1093
+ /** "18px" → 18, "" / 파싱 실패 → 14(기본). */
1094
+ declare function parseFontSizePx(size: string): number;
1095
+ /** 8~96 범위로 보정 + 정수 반올림. */
1096
+ declare function clampFontSizePx(px: number): number;
1097
+ /** 숫자 → "Npx" (clamp 포함). */
1098
+ declare function toFontSizeValue(px: number): string;
1093
1099
 
1094
1100
  declare function FontSizeButton(): react_jsx_runtime.JSX.Element | null;
1095
1101
 
@@ -1115,4 +1121,4 @@ declare const BACKGROUND_COLORS: ColorItem[];
1115
1121
  */
1116
1122
  declare const getHexFromColorValue: (value: string, type: "text" | "background") => string;
1117
1123
 
1118
- export { BACKGROUND_COLORS, type ColorItem, ContentUtils, type DefaultPartialBlock, EditorConfig, type EditorType, FONT_SIZE_PRESETS, FloatingMenu, FontSize, FontSizeButton, type FontSizePreset, HtmlPreviewBlock, schema as HtmlPreviewSchema, type LinkMetadata, LinkPreviewBlock, LumirEditor, LumirEditorError, type LumirEditorProps, type LumirErrorCode, type LumirErrorDetails, type S3UploaderConfig, type SerializedStyledText, TEXT_COLORS, clearMetadataCache, cn, createS3Uploader, fetchLinkMetadata, getHexFromColorValue, liftFontSize, lowerFontSize };
1124
+ export { BACKGROUND_COLORS, type ColorItem, ContentUtils, type DefaultPartialBlock, EditorConfig, type EditorType, FONT_SIZE_DEFAULT_PX, FONT_SIZE_MAX, FONT_SIZE_MIN, FONT_SIZE_PRESETS, FONT_SIZE_STEP, FloatingMenu, FontSize, FontSizeButton, type FontSizePreset, HtmlPreviewBlock, schema as HtmlPreviewSchema, type LinkMetadata, LinkPreviewBlock, LumirEditor, LumirEditorError, type LumirEditorProps, type LumirErrorCode, type LumirErrorDetails, type S3UploaderConfig, type SerializedStyledText, TEXT_COLORS, clampFontSizePx, clearMetadataCache, cn, createS3Uploader, fetchLinkMetadata, getHexFromColorValue, liftFontSize, lowerFontSize, parseFontSizePx, toFontSizeValue };
package/dist/index.d.ts CHANGED
@@ -932,13 +932,10 @@ declare const schema: BlockNoteSchema<_blocknote_core.BlockSchemaFromSpecs<{
932
932
  implementation: any;
933
933
  };
934
934
  }>, _blocknote_core.StyleSchemaFromSpecs<{
935
- fontSize: {
936
- config: {
937
- type: string;
938
- propSchema: "string";
939
- };
940
- implementation: _blocknote_core.StyleImplementation;
941
- };
935
+ fontSize: _blocknote_core.StyleSpec<{
936
+ type: string;
937
+ propSchema: "string";
938
+ }>;
942
939
  bold: {
943
940
  config: {
944
941
  type: string;
@@ -1080,16 +1077,25 @@ declare const FloatingMenu: React.FC<FloatingMenuProps>;
1080
1077
  * styles.fontSize 대신 형제 키 fontSize로 직렬화한다.
1081
1078
  * → src/utils/font-size-serialization.ts (liftFontSize/lowerFontSize) 참고.
1082
1079
  */
1083
- declare const FontSize: {
1084
- config: {
1085
- type: string;
1086
- propSchema: "string";
1087
- };
1088
- implementation: _blocknote_core.StyleImplementation;
1089
- };
1080
+ declare const FontSize: _blocknote_core.StyleSpec<{
1081
+ type: string;
1082
+ propSchema: "string";
1083
+ }>;
1090
1084
  /** 툴바 드롭다운에서 제공하는 프리셋 (본문 기본은 14px = "기본") */
1091
1085
  declare const FONT_SIZE_PRESETS: readonly ["10px", "12px", "14px", "16px", "18px", "20px", "24px", "28px"];
1092
1086
  type FontSizePreset = (typeof FONT_SIZE_PRESETS)[number];
1087
+ /** 글자 크기 1px 스테퍼의 허용 범위/기본값 (사용자 결정: 8~96px). */
1088
+ declare const FONT_SIZE_MIN = 8;
1089
+ declare const FONT_SIZE_MAX = 96;
1090
+ /** "기본"(명시 fontSize 없음)일 때 기준이 되는 본문 px. */
1091
+ declare const FONT_SIZE_DEFAULT_PX = 14;
1092
+ declare const FONT_SIZE_STEP = 1;
1093
+ /** "18px" → 18, "" / 파싱 실패 → 14(기본). */
1094
+ declare function parseFontSizePx(size: string): number;
1095
+ /** 8~96 범위로 보정 + 정수 반올림. */
1096
+ declare function clampFontSizePx(px: number): number;
1097
+ /** 숫자 → "Npx" (clamp 포함). */
1098
+ declare function toFontSizeValue(px: number): string;
1093
1099
 
1094
1100
  declare function FontSizeButton(): react_jsx_runtime.JSX.Element | null;
1095
1101
 
@@ -1115,4 +1121,4 @@ declare const BACKGROUND_COLORS: ColorItem[];
1115
1121
  */
1116
1122
  declare const getHexFromColorValue: (value: string, type: "text" | "background") => string;
1117
1123
 
1118
- export { BACKGROUND_COLORS, type ColorItem, ContentUtils, type DefaultPartialBlock, EditorConfig, type EditorType, FONT_SIZE_PRESETS, FloatingMenu, FontSize, FontSizeButton, type FontSizePreset, HtmlPreviewBlock, schema as HtmlPreviewSchema, type LinkMetadata, LinkPreviewBlock, LumirEditor, LumirEditorError, type LumirEditorProps, type LumirErrorCode, type LumirErrorDetails, type S3UploaderConfig, type SerializedStyledText, TEXT_COLORS, clearMetadataCache, cn, createS3Uploader, fetchLinkMetadata, getHexFromColorValue, liftFontSize, lowerFontSize };
1124
+ export { BACKGROUND_COLORS, type ColorItem, ContentUtils, type DefaultPartialBlock, EditorConfig, type EditorType, FONT_SIZE_DEFAULT_PX, FONT_SIZE_MAX, FONT_SIZE_MIN, FONT_SIZE_PRESETS, FONT_SIZE_STEP, FloatingMenu, FontSize, FontSizeButton, type FontSizePreset, HtmlPreviewBlock, schema as HtmlPreviewSchema, type LinkMetadata, LinkPreviewBlock, LumirEditor, LumirEditorError, type LumirEditorProps, type LumirErrorCode, type LumirErrorDetails, type S3UploaderConfig, type SerializedStyledText, TEXT_COLORS, clampFontSizePx, clearMetadataCache, cn, createS3Uploader, fetchLinkMetadata, getHexFromColorValue, liftFontSize, lowerFontSize, parseFontSizePx, toFontSizeValue };