@tatamicks/core 0.0.2 → 0.1.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.
@@ -1,6 +1,8 @@
1
1
  import { default as default_2 } from 'react';
2
+ import { ForwardRefExoticComponent } from 'react';
2
3
  import { JSX as JSX_2 } from 'react/jsx-runtime';
3
4
  import { MemoExoticComponent } from 'react';
5
+ import { RefAttributes } from 'react';
4
6
 
5
7
  export declare const ACTUAL_UNITS: readonly ["mm", "cm", "pt", "inch", "px"];
6
8
 
@@ -417,6 +419,13 @@ export declare interface CheckboxProps extends PropertyComponentProps<boolean |
417
419
  config?: CheckboxConfig;
418
420
  }
419
421
 
422
+ /**
423
+ * 印刷後のクリーンアップ処理
424
+ */
425
+ export declare function cleanupPrint(options?: {
426
+ restoreScrollbars?: boolean;
427
+ }): void;
428
+
420
429
  /**
421
430
  * カラーピッカーコンポーネント
422
431
  */
@@ -647,6 +656,15 @@ export declare type DragState = {
647
656
  };
648
657
  } | null;
649
658
 
659
+ /**
660
+ * 印刷を実行(準備 + 印刷 + クリーンアップ)
661
+ */
662
+ export declare function executePrint(options?: {
663
+ title?: string;
664
+ onBeforePrint?: () => void;
665
+ onAfterPrint?: () => void;
666
+ }): void;
667
+
650
668
  /**
651
669
  * 機能プラグイン (将来の拡張用)
652
670
  *
@@ -740,6 +758,14 @@ export declare function getMaxStep(starts: number[]): {
740
758
  readonly windowPx: number;
741
759
  };
742
760
 
761
+ /**
762
+ * 用紙サイズの寸法を取得(mm単位)
763
+ */
764
+ export declare function getPaperSize(paperSize: PrintPaperSize, orientation: Orientation): {
765
+ width: number;
766
+ height: number;
767
+ };
768
+
743
769
  export declare const getStrokeDasharray: (lineStyle?: LineStyle) => string | undefined;
744
770
 
745
771
  /**
@@ -1072,7 +1098,17 @@ export declare enum NoteMode {
1072
1098
  VIEW = "View"
1073
1099
  }
1074
1100
 
1075
- export declare const NoteView: MemoExoticComponent<({ schema, values, pluginRegistry, scale, className, }: NoteViewProps) => JSX_2.Element>;
1101
+ export declare const NoteView: MemoExoticComponent<ForwardRefExoticComponent<NoteViewProps & RefAttributes<NoteViewPrintRef>>>;
1102
+
1103
+ /**
1104
+ * NoteView の ref に公開する印刷メソッド
1105
+ */
1106
+ export declare interface NoteViewPrintRef {
1107
+ /** 印刷ダイアログを開く */
1108
+ print: () => void;
1109
+ /** 印刷プレビューを開く(ブラウザの印刷ダイアログ) */
1110
+ openPrintPreview: () => void;
1111
+ }
1076
1112
 
1077
1113
  export declare interface NoteViewProps {
1078
1114
  schema: FormSchema;
@@ -1080,6 +1116,10 @@ export declare interface NoteViewProps {
1080
1116
  pluginRegistry: Record<string, BlockPlugin>;
1081
1117
  scale?: number;
1082
1118
  className?: string;
1119
+ /** 印刷モード(印刷時に自動的にtrueになる) */
1120
+ printMode?: boolean;
1121
+ /** 印刷設定 */
1122
+ printSettings?: PrintSettings;
1083
1123
  }
1084
1124
 
1085
1125
  export declare const NumberInput: {
@@ -1132,6 +1172,11 @@ export declare type OnValidationError = (errors: Record<string, ValidationError[
1132
1172
 
1133
1173
  export declare type OnValuesChange = (values: Record<string, Value>) => void;
1134
1174
 
1175
+ /**
1176
+ * 用紙の向き
1177
+ */
1178
+ export declare type Orientation = "portrait" | "landscape";
1179
+
1135
1180
  export declare const PADDING_UNITS: readonly ["mm", "pt", "px", "%"];
1136
1181
 
1137
1182
  /**
@@ -1257,6 +1302,45 @@ export declare type PluginProperties<P> = {
1257
1302
  [K in keyof P]-?: PropertyConfig<P[K], P>;
1258
1303
  };
1259
1304
 
1305
+ /**
1306
+ * 印刷前の準備処理
1307
+ */
1308
+ export declare function preparePrint(options?: {
1309
+ title?: string;
1310
+ removeScrollbars?: boolean;
1311
+ }): void;
1312
+
1313
+ /**
1314
+ * 印刷時の余白設定
1315
+ */
1316
+ export declare interface PrintMargin {
1317
+ top?: string;
1318
+ right?: string;
1319
+ bottom?: string;
1320
+ left?: string;
1321
+ }
1322
+
1323
+ /**
1324
+ * @file types/print/index.ts
1325
+ * @description 印刷機能関連の型定義
1326
+ */
1327
+ /**
1328
+ * 印刷用の用紙サイズ
1329
+ */
1330
+ export declare type PrintPaperSize = "A4" | "A3" | "B4" | "B5" | "Letter" | "Legal";
1331
+
1332
+ /**
1333
+ * 印刷設定
1334
+ */
1335
+ export declare interface PrintSettings {
1336
+ /** 用紙サイズ */
1337
+ paperSize?: PrintPaperSize;
1338
+ /** 用紙の向き */
1339
+ orientation?: Orientation;
1340
+ /** 余白 */
1341
+ margin?: PrintMargin;
1342
+ }
1343
+
1260
1344
  /**
1261
1345
  * PropertiesPanel Props
1262
1346
  *
package/package.json CHANGED
@@ -1,79 +1,79 @@
1
- {
2
- "name": "@tatamicks/core",
3
- "version": "0.0.2",
4
- "private": false,
5
- "description": "A headless, extensible document editor for React with grid-based layout system",
6
- "keywords": [
7
- "react",
8
- "editor",
9
- "document-editor",
10
- "headless",
11
- "grid-layout",
12
- "plugin-system",
13
- "typescript"
14
- ],
15
- "author": "yonpachi",
16
- "license": "MIT",
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/torchi-net/tatamicks.git",
20
- "directory": "packages/core"
21
- },
22
- "homepage": "https://github.com/torchi-net/tatamicks#readme",
23
- "bugs": {
24
- "url": "https://github.com/torchi-net/tatamicks/issues"
25
- },
26
- "type": "module",
27
- "main": "dist/index.js",
28
- "module": "dist/index.mjs",
29
- "types": "dist/src/index.d.ts",
30
- "style": "dist/tatamicks-core.css",
31
- "exports": {
32
- ".": {
33
- "types": "./dist/src/index.d.ts",
34
- "import": "./dist/index.mjs",
35
- "require": "./dist/index.js"
36
- },
37
- "./dist/tatamicks-core.css": "./dist/tatamicks-core.css"
38
- },
39
- "scripts": {
40
- "dev": "vite",
41
- "build": "vite build .",
42
- "preview": "vite preview",
43
- "typecheck": "tsc --noEmit",
44
- "lint": "biome check .",
45
- "format": "biome format --write .",
46
- "test": "vitest --run .",
47
- "test:unit": "vitest run ."
48
- },
49
- "files": [
50
- "dist"
51
- ],
52
- "peerDependencies": {
53
- "react": "^19.0.2",
54
- "react-dom": "^19.0.2"
55
- },
56
- "devDependencies": {
57
- "@biomejs/biome": "^2.2.6",
58
- "@testing-library/jest-dom": "^6.9.1",
59
- "@testing-library/react": "^16.3.0",
60
- "@types/node": "^24.7.2",
61
- "@types/react": "^18.2.46",
62
- "@types/react-dom": "^18.2.18",
63
- "@vitejs/plugin-react": "^4.7.0",
64
- "@vitest/browser": "3.2.4",
65
- "@vitest/coverage-v8": "3.2.4",
66
- "jsdom": "^27.0.0",
67
- "playwright": "^1.56.0",
68
- "react": "^18.3.1",
69
- "react-dom": "^18.3.1",
70
- "typescript": "^5.9.3",
71
- "vite": "^6.3.6",
72
- "vite-plugin-dts": "^4.5.4",
73
- "vite-plugin-lib-inject-css": "^2.2.2",
74
- "vitest": "^3.2.4"
75
- },
76
- "sideEffects": [
77
- "**/*.css"
78
- ]
1
+ {
2
+ "name": "@tatamicks/core",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "description": "A headless, extensible document editor for React with grid-based layout system",
6
+ "keywords": [
7
+ "react",
8
+ "editor",
9
+ "document-editor",
10
+ "headless",
11
+ "grid-layout",
12
+ "plugin-system",
13
+ "typescript"
14
+ ],
15
+ "author": "yonpachi",
16
+ "license": "MIT",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/torchi-net/tatamicks.git",
20
+ "directory": "packages/core"
21
+ },
22
+ "homepage": "https://github.com/torchi-net/tatamicks#readme",
23
+ "bugs": {
24
+ "url": "https://github.com/torchi-net/tatamicks/issues"
25
+ },
26
+ "type": "module",
27
+ "main": "dist/index.js",
28
+ "module": "dist/index.mjs",
29
+ "types": "dist/src/index.d.ts",
30
+ "style": "dist/tatamicks-core.css",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/src/index.d.ts",
34
+ "import": "./dist/index.mjs",
35
+ "require": "./dist/index.js"
36
+ },
37
+ "./dist/tatamicks-core.css": "./dist/tatamicks-core.css"
38
+ },
39
+ "scripts": {
40
+ "dev": "vite",
41
+ "build": "vite build .",
42
+ "preview": "vite preview",
43
+ "typecheck": "tsc --noEmit",
44
+ "lint": "biome check .",
45
+ "format": "biome format --write .",
46
+ "test": "vitest --run .",
47
+ "test:unit": "vitest run ."
48
+ },
49
+ "files": [
50
+ "dist"
51
+ ],
52
+ "peerDependencies": {
53
+ "react": "^19.0.2",
54
+ "react-dom": "^19.0.2"
55
+ },
56
+ "devDependencies": {
57
+ "@biomejs/biome": "^2.2.6",
58
+ "@testing-library/jest-dom": "^6.9.1",
59
+ "@testing-library/react": "^16.3.0",
60
+ "@types/node": "^24.7.2",
61
+ "@types/react": "^18.2.46",
62
+ "@types/react-dom": "^18.2.18",
63
+ "@vitejs/plugin-react": "^4.7.0",
64
+ "@vitest/browser": "3.2.4",
65
+ "@vitest/coverage-v8": "3.2.4",
66
+ "jsdom": "^27.0.0",
67
+ "playwright": "^1.56.0",
68
+ "react": "^18.3.1",
69
+ "react-dom": "^18.3.1",
70
+ "typescript": "^5.9.3",
71
+ "vite": "^6.3.6",
72
+ "vite-plugin-dts": "^4.5.4",
73
+ "vite-plugin-lib-inject-css": "^2.2.2",
74
+ "vitest": "^3.2.4"
75
+ },
76
+ "sideEffects": [
77
+ "**/*.css"
78
+ ]
79
79
  }