@cecee/document-flip-book 1.0.17 → 1.0.19
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/LICENSE +15 -0
- package/README.md +83 -0
- package/dist/cjs/AccountingBook/index.d.ts +3 -0
- package/dist/cjs/AccountingBook/index.js +19 -0
- package/dist/cjs/{ArchiveCover.js → DocumentFlipBook/ArchiveCover.js} +23 -3
- package/dist/cjs/{ExportModal.js → DocumentFlipBook/ExportModal.js} +1 -1
- package/dist/cjs/{ProjectCover.js → DocumentFlipBook/ProjectCover.js} +23 -3
- package/dist/cjs/{exportHtml.d.ts → DocumentFlipBook/exportHtml.d.ts} +3 -3
- package/dist/cjs/{exportHtml.js → DocumentFlipBook/exportHtml.js} +104 -48
- package/dist/cjs/{exportPdf.d.ts → DocumentFlipBook/exportPdf.d.ts} +2 -0
- package/dist/cjs/{exportPdf.js → DocumentFlipBook/exportPdf.js} +17 -6
- package/dist/cjs/{globalCache.d.ts → DocumentFlipBook/globalCache.d.ts} +2 -1
- package/dist/cjs/DocumentFlipBook/images/Clip_1.svg +97 -0
- package/dist/cjs/DocumentFlipBook/images/Clip_2.svg +1114 -0
- package/dist/cjs/DocumentFlipBook/images/Inside.svg +10 -0
- package/dist/cjs/DocumentFlipBook/images/book.svg +1 -0
- package/dist/cjs/DocumentFlipBook/images/coverSpine.svg +4 -0
- package/dist/{esm/DocumentFlipBook.d.ts → cjs/DocumentFlipBook/index.d.ts} +2 -0
- package/dist/cjs/{DocumentFlipBook.js → DocumentFlipBook/index.js} +119 -25
- package/dist/cjs/{index.less → DocumentFlipBook/index.less} +194 -78
- package/dist/cjs/{printPdf.d.ts → DocumentFlipBook/printPdf.d.ts} +1 -0
- package/dist/cjs/{utils.d.ts → DocumentFlipBook/utils.d.ts} +2 -1
- package/dist/cjs/{utils.js → DocumentFlipBook/utils.js} +4 -1
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +10 -3
- package/dist/esm/AccountingBook/index.d.ts +3 -0
- package/dist/esm/AccountingBook/index.js +13 -0
- package/dist/esm/{ArchiveCover.js → DocumentFlipBook/ArchiveCover.js} +23 -3
- package/dist/esm/{ExportModal.js → DocumentFlipBook/ExportModal.js} +1 -1
- package/dist/esm/{ProjectCover.js → DocumentFlipBook/ProjectCover.js} +23 -3
- package/dist/esm/{exportHtml.d.ts → DocumentFlipBook/exportHtml.d.ts} +3 -3
- package/dist/esm/{exportHtml.js → DocumentFlipBook/exportHtml.js} +103 -47
- package/dist/esm/{exportPdf.d.ts → DocumentFlipBook/exportPdf.d.ts} +2 -0
- package/dist/esm/{exportPdf.js → DocumentFlipBook/exportPdf.js} +17 -6
- package/dist/esm/{globalCache.d.ts → DocumentFlipBook/globalCache.d.ts} +2 -1
- package/dist/esm/DocumentFlipBook/images/Clip_1.svg +97 -0
- package/dist/esm/DocumentFlipBook/images/Clip_2.svg +1114 -0
- package/dist/esm/DocumentFlipBook/images/Inside.svg +10 -0
- package/dist/esm/DocumentFlipBook/images/book.svg +1 -0
- package/dist/esm/DocumentFlipBook/images/coverSpine.svg +4 -0
- package/dist/{cjs/DocumentFlipBook.d.ts → esm/DocumentFlipBook/index.d.ts} +2 -0
- package/dist/esm/{DocumentFlipBook.js → DocumentFlipBook/index.js} +119 -25
- package/dist/esm/{index.less → DocumentFlipBook/index.less} +194 -78
- package/dist/esm/{printPdf.d.ts → DocumentFlipBook/printPdf.d.ts} +1 -0
- package/dist/esm/{utils.d.ts → DocumentFlipBook/utils.d.ts} +2 -1
- package/dist/esm/{utils.js → DocumentFlipBook/utils.js} +4 -1
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +5 -3
- package/package.json +6 -1
- /package/dist/cjs/{ArchiveCover.d.ts → DocumentFlipBook/ArchiveCover.d.ts} +0 -0
- /package/dist/cjs/{ExportModal.d.ts → DocumentFlipBook/ExportModal.d.ts} +0 -0
- /package/dist/cjs/{HeaderBar.d.ts → DocumentFlipBook/HeaderBar.d.ts} +0 -0
- /package/dist/cjs/{HeaderBar.js → DocumentFlipBook/HeaderBar.js} +0 -0
- /package/dist/cjs/{PdfPage.d.ts → DocumentFlipBook/PdfPage.d.ts} +0 -0
- /package/dist/cjs/{PdfPage.js → DocumentFlipBook/PdfPage.js} +0 -0
- /package/dist/cjs/{ProjectCover.d.ts → DocumentFlipBook/ProjectCover.d.ts} +0 -0
- /package/dist/cjs/{SideTabs.d.ts → DocumentFlipBook/SideTabs.d.ts} +0 -0
- /package/dist/cjs/{SideTabs.js → DocumentFlipBook/SideTabs.js} +0 -0
- /package/dist/cjs/{globalCache.js → DocumentFlipBook/globalCache.js} +0 -0
- /package/dist/cjs/{printPdf.js → DocumentFlipBook/printPdf.js} +0 -0
- /package/dist/cjs/{types.d.ts → DocumentFlipBook/types.d.ts} +0 -0
- /package/dist/cjs/{types.js → DocumentFlipBook/types.js} +0 -0
- /package/dist/esm/{ArchiveCover.d.ts → DocumentFlipBook/ArchiveCover.d.ts} +0 -0
- /package/dist/esm/{ExportModal.d.ts → DocumentFlipBook/ExportModal.d.ts} +0 -0
- /package/dist/esm/{HeaderBar.d.ts → DocumentFlipBook/HeaderBar.d.ts} +0 -0
- /package/dist/esm/{HeaderBar.js → DocumentFlipBook/HeaderBar.js} +0 -0
- /package/dist/esm/{PdfPage.d.ts → DocumentFlipBook/PdfPage.d.ts} +0 -0
- /package/dist/esm/{PdfPage.js → DocumentFlipBook/PdfPage.js} +0 -0
- /package/dist/esm/{ProjectCover.d.ts → DocumentFlipBook/ProjectCover.d.ts} +0 -0
- /package/dist/esm/{SideTabs.d.ts → DocumentFlipBook/SideTabs.d.ts} +0 -0
- /package/dist/esm/{SideTabs.js → DocumentFlipBook/SideTabs.js} +0 -0
- /package/dist/esm/{globalCache.js → DocumentFlipBook/globalCache.js} +0 -0
- /package/dist/esm/{printPdf.js → DocumentFlipBook/printPdf.js} +0 -0
- /package/dist/esm/{types.d.ts → DocumentFlipBook/types.d.ts} +0 -0
- /package/dist/esm/{types.js → DocumentFlipBook/types.js} +0 -0
|
@@ -31,42 +31,88 @@
|
|
|
31
31
|
.book-page {
|
|
32
32
|
width: 100%;
|
|
33
33
|
height: 100%;
|
|
34
|
-
background: #9F7D4E;
|
|
34
|
+
background: var(--dfb-theme-color, #9F7D4E);
|
|
35
35
|
padding: 22px;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.book-view {
|
|
39
|
-
box-shadow: 0 0 18px rgba(0, 0, 0, 0.18);
|
|
40
|
-
position: relative;
|
|
41
39
|
overflow: hidden;
|
|
40
|
+
position: relative;
|
|
41
|
+
z-index: 10;
|
|
42
|
+
overflow: visible; // 显式设置为 visible 以显示侧边厚度装饰
|
|
43
|
+
background: transparent; // 改为透明,避免遮挡背景层或产生白色边框
|
|
42
44
|
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
// 书本左侧厚度 1
|
|
46
|
+
.dfb-book-thickness-left-1 {
|
|
47
|
+
overflow: hidden;
|
|
46
48
|
position: absolute;
|
|
47
49
|
top: 0;
|
|
48
|
-
|
|
50
|
+
left: -4px;
|
|
51
|
+
width: 8px;
|
|
52
|
+
height: 100%;
|
|
53
|
+
background: linear-gradient(to right, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0.3));
|
|
54
|
+
border-radius: 2px;
|
|
55
|
+
z-index: 20;
|
|
56
|
+
box-shadow: rgba(255, 255, 255, 0.6) 0px 0px 6px inset;
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
display: none; // 默认隐藏,由 nth-child 控制显示
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// 书本左侧厚度 2
|
|
62
|
+
.dfb-book-thickness-left-2 {
|
|
63
|
+
position: absolute;
|
|
64
|
+
top: 0;
|
|
65
|
+
left: -10px;
|
|
49
66
|
width: 20px;
|
|
50
|
-
|
|
67
|
+
height: 100%;
|
|
68
|
+
background: linear-gradient(to right, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.2));
|
|
69
|
+
z-index: 14;
|
|
51
70
|
pointer-events: none;
|
|
52
|
-
|
|
71
|
+
display: none; // 默认隐藏
|
|
53
72
|
}
|
|
54
73
|
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
74
|
+
// 书本右侧厚度 1
|
|
75
|
+
.dfb-book-thickness-right-1 {
|
|
76
|
+
position: absolute;
|
|
77
|
+
top: 0;
|
|
78
|
+
right: -4px;
|
|
79
|
+
width: 8px;
|
|
80
|
+
height: 100%;
|
|
81
|
+
background: linear-gradient(to right, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0.3));
|
|
82
|
+
border-radius: 2px;
|
|
83
|
+
z-index: 15;
|
|
84
|
+
box-shadow: rgba(255, 255, 255, 0.6) 0px 0px 6px inset;
|
|
85
|
+
pointer-events: none;
|
|
86
|
+
display: none; // 默认隐藏
|
|
59
87
|
}
|
|
60
88
|
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
89
|
+
// 书本右侧厚度 2
|
|
90
|
+
.dfb-book-thickness-right-2 {
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 0;
|
|
93
|
+
right: -10px;
|
|
94
|
+
width: 20px;
|
|
95
|
+
height: 100%;
|
|
96
|
+
background: linear-gradient(to left, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.2));
|
|
97
|
+
z-index: 14;
|
|
98
|
+
pointer-events: none;
|
|
99
|
+
display: none; // 默认隐藏
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// 偶数页(第 2, 4, 6... 个子元素,对应 Page 1, 3, 5...)是左页 -> 显示左侧厚度
|
|
103
|
+
&:nth-child(even) {
|
|
104
|
+
.dfb-book-thickness-left-1,
|
|
105
|
+
.dfb-book-thickness-left-2 {
|
|
106
|
+
display: block;
|
|
107
|
+
}
|
|
65
108
|
}
|
|
66
109
|
|
|
67
|
-
//
|
|
68
|
-
&:
|
|
69
|
-
|
|
110
|
+
// 奇数页(第 1, 3, 5... 个子元素,对应 Page 0, 2, 4...)是右页 -> 显示右侧厚度
|
|
111
|
+
&:nth-child(odd) {
|
|
112
|
+
.dfb-book-thickness-right-1,
|
|
113
|
+
.dfb-book-thickness-right-2 {
|
|
114
|
+
display: block;
|
|
115
|
+
}
|
|
70
116
|
}
|
|
71
117
|
}
|
|
72
118
|
|
|
@@ -75,8 +121,10 @@
|
|
|
75
121
|
}
|
|
76
122
|
|
|
77
123
|
.dfb-HTMLFlipBook {
|
|
78
|
-
|
|
79
|
-
|
|
124
|
+
position: relative;
|
|
125
|
+
z-index: 10;
|
|
126
|
+
overflow: visible; // 显式设置为 visible 以显示侧边厚度装饰
|
|
127
|
+
background: #fff; // 改为透明,避免遮挡背景层或产生白色边框
|
|
80
128
|
}
|
|
81
129
|
|
|
82
130
|
.dfb-root {
|
|
@@ -261,7 +309,7 @@
|
|
|
261
309
|
display: flex;
|
|
262
310
|
flex-direction: column;
|
|
263
311
|
gap: 6px; //
|
|
264
|
-
z-index:
|
|
312
|
+
z-index: 20;
|
|
265
313
|
transition: all 0.3s ease;
|
|
266
314
|
|
|
267
315
|
&.is-on-cover {
|
|
@@ -339,57 +387,108 @@
|
|
|
339
387
|
margin: auto; // 关键:在 flex 容器中使用 margin: auto 实现完美居中且溢出时可滚动到顶部
|
|
340
388
|
position: relative;
|
|
341
389
|
min-width: 300px;
|
|
390
|
+
overflow: hidden;
|
|
342
391
|
}
|
|
343
392
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
393
|
+
// 方法三:背景层样式
|
|
394
|
+
.dfb-book-background-layer {
|
|
395
|
+
position: absolute;
|
|
396
|
+
top: 0;
|
|
397
|
+
left: 0;
|
|
398
|
+
right: 0;
|
|
399
|
+
bottom: 0;
|
|
400
|
+
padding: 18px 54px;
|
|
401
|
+
z-index: 1;
|
|
402
|
+
transition: all 0.3s ease;
|
|
403
|
+
pointer-events: none;
|
|
404
|
+
overflow: hidden;
|
|
405
|
+
/* 确保伪元素不会超出容器 */
|
|
349
406
|
}
|
|
350
407
|
|
|
351
|
-
|
|
408
|
+
/* 左侧较高的背景块 */
|
|
409
|
+
.dfb-book-background-layer::before {
|
|
410
|
+
content: "";
|
|
411
|
+
position: absolute;
|
|
412
|
+
top: 2px;
|
|
413
|
+
left: -16px;
|
|
414
|
+
width: 50%;
|
|
415
|
+
/* 占据左半边 */
|
|
416
|
+
height: 100%;
|
|
417
|
+
/* 高度为100%,显得更高 */
|
|
418
|
+
background-color: var(--dfb-theme-color, #9F7D4E);
|
|
419
|
+
transition: all 0.3s ease;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* 右侧较低的背景块 */
|
|
423
|
+
.dfb-book-background-layer::after {
|
|
424
|
+
content: "";
|
|
425
|
+
position: absolute;
|
|
426
|
+
top: 9px;
|
|
427
|
+
right: -16px;
|
|
428
|
+
width: 50%;
|
|
429
|
+
/* 占据右半边 */
|
|
430
|
+
height: calc(100% - 15px);
|
|
431
|
+
/* 高度减去顶部偏移量 */
|
|
432
|
+
background-color: var(--dfb-theme-color, #9F7D4E);
|
|
433
|
+
filter: brightness(0.85); // 自动加深,不再依赖额外的变量
|
|
434
|
+
opacity: 0.9;
|
|
435
|
+
transition: all 0.3s ease;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// 方法三:内容层样式
|
|
439
|
+
.dfb-book-content-layer {
|
|
352
440
|
position: relative;
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
441
|
+
z-index: 10; // 位于背景之上
|
|
442
|
+
padding: 18px 54px; // 保持与背景层一致的内边距
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
// 书脊内侧装饰 (Inside.svg)
|
|
446
|
+
.dfb-inside-spine {
|
|
447
|
+
position: absolute;
|
|
448
|
+
left: 50%;
|
|
449
|
+
top: 2px;
|
|
450
|
+
height: calc(100% - 1px);
|
|
451
|
+
bottom: 18px;
|
|
452
|
+
width: 34px; // 恢复为原始 SVG 宽度
|
|
453
|
+
transform: translateX(-50%);
|
|
454
|
+
z-index: 5; // 提高层级,确保在 .dfb-book-background-layer 的 linear-gradient 之上
|
|
455
|
+
pointer-events: none;
|
|
456
|
+
opacity: 1; // 增加不透明度使其更清晰
|
|
457
|
+
}
|
|
356
458
|
|
|
357
|
-
|
|
459
|
+
// 中缝装饰层(确保在中缝位置且高于内容层)
|
|
460
|
+
// .dfb-spine-decoration-layer {
|
|
461
|
+
// position: absolute;
|
|
462
|
+
// left: 50%;
|
|
463
|
+
// top: 0;
|
|
464
|
+
// bottom: 0;
|
|
465
|
+
// width: 0; // 仅作为定位参考
|
|
466
|
+
// z-index: 20; // 必须高于内容层 (10) 才能看到
|
|
467
|
+
// pointer-events: none;
|
|
468
|
+
// }
|
|
469
|
+
|
|
470
|
+
// 书本中缝分割线
|
|
471
|
+
.dfb-book-spine {
|
|
472
|
+
position: absolute;
|
|
473
|
+
left: 50%;
|
|
474
|
+
top: 17px;
|
|
475
|
+
bottom: 18px;
|
|
476
|
+
width: 2px;
|
|
477
|
+
transform: translateX(-50%);
|
|
478
|
+
background: rgba(0, 0, 0, 0.2);
|
|
479
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
|
480
|
+
z-index: 20;
|
|
481
|
+
pointer-events: none;
|
|
482
|
+
transition: opacity 0.3s ease;
|
|
483
|
+
|
|
484
|
+
&::before {
|
|
358
485
|
content: "";
|
|
359
486
|
position: absolute;
|
|
487
|
+
left: -4px;
|
|
360
488
|
top: 0;
|
|
361
|
-
left: 0;
|
|
362
|
-
right: 0;
|
|
363
489
|
bottom: 0;
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
pointer-events: none;
|
|
367
|
-
border-radius: 8px;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
// 书本中缝分割线
|
|
371
|
-
.dfb-book-spine {
|
|
372
|
-
position: absolute;
|
|
373
|
-
left: 50%;
|
|
374
|
-
top: 18px;
|
|
375
|
-
bottom: 18px;
|
|
376
|
-
width: 2px;
|
|
377
|
-
transform: translateX(-50%);
|
|
378
|
-
background: rgba(0, 0, 0, 0.2);
|
|
379
|
-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
|
380
|
-
z-index: 5;
|
|
381
|
-
pointer-events: none;
|
|
382
|
-
transition: opacity 0.3s ease;
|
|
383
|
-
|
|
384
|
-
&::before {
|
|
385
|
-
content: "";
|
|
386
|
-
position: absolute;
|
|
387
|
-
left: -4px;
|
|
388
|
-
top: 0;
|
|
389
|
-
bottom: 0;
|
|
390
|
-
width: 10px;
|
|
391
|
-
background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.15), transparent);
|
|
392
|
-
}
|
|
490
|
+
width: 10px;
|
|
491
|
+
background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.15), transparent);
|
|
393
492
|
}
|
|
394
493
|
}
|
|
395
494
|
|
|
@@ -398,7 +497,7 @@
|
|
|
398
497
|
height: 100%;
|
|
399
498
|
display: grid;
|
|
400
499
|
place-items: center;
|
|
401
|
-
background: #9F7D4E;
|
|
500
|
+
background: var(--dfb-theme-color, #9F7D4E);
|
|
402
501
|
color: #111;
|
|
403
502
|
font-size: 46px;
|
|
404
503
|
font-weight: 800;
|
|
@@ -425,14 +524,24 @@
|
|
|
425
524
|
.archive-cover {
|
|
426
525
|
width: 100%;
|
|
427
526
|
height: 100%;
|
|
428
|
-
background: #9F7D4E; // 棕黄色背景
|
|
429
527
|
display: flex;
|
|
430
528
|
align-items: center;
|
|
431
529
|
justify-content: center;
|
|
432
530
|
color: #000;
|
|
433
531
|
font-family: "SimSun", "STSong", serif;
|
|
434
|
-
padding: 40px;
|
|
532
|
+
padding: 40px 40px 40px 57px; // 增加左侧内边距,给背脊留出空间
|
|
435
533
|
box-sizing: border-box;
|
|
534
|
+
position: relative; // 确保子元素绝对定位
|
|
535
|
+
|
|
536
|
+
.archive-spine {
|
|
537
|
+
background-color: #fff;
|
|
538
|
+
position: absolute;
|
|
539
|
+
left: 0;
|
|
540
|
+
top: 0;
|
|
541
|
+
bottom: 0;
|
|
542
|
+
width: 25px; // 稍微放宽一点,效果更好
|
|
543
|
+
z-index: 10;
|
|
544
|
+
}
|
|
436
545
|
|
|
437
546
|
&__outer-border {
|
|
438
547
|
border: 5px solid #000;
|
|
@@ -459,7 +568,7 @@
|
|
|
459
568
|
font-size: 26px;
|
|
460
569
|
font-weight: bold;
|
|
461
570
|
margin-top: 10px;
|
|
462
|
-
margin-bottom:
|
|
571
|
+
margin-bottom: 10px;
|
|
463
572
|
letter-spacing: 4px;
|
|
464
573
|
text-align: center;
|
|
465
574
|
}
|
|
@@ -533,10 +642,7 @@
|
|
|
533
642
|
|
|
534
643
|
// 项目模式封面样式
|
|
535
644
|
.project-cover-container {
|
|
536
|
-
|
|
537
|
-
// left: 15px;
|
|
538
|
-
// top: 0px;
|
|
539
|
-
// width: calc(100% - 15px);
|
|
645
|
+
position: relative; // 确保子元素绝对定位
|
|
540
646
|
width: 100%;
|
|
541
647
|
height: 100%;
|
|
542
648
|
z-index: 20;
|
|
@@ -544,7 +650,17 @@
|
|
|
544
650
|
display: flex;
|
|
545
651
|
flex-direction: column;
|
|
546
652
|
font-family: "SimSun", "STSong", serif;
|
|
547
|
-
padding: 30px;
|
|
653
|
+
padding: 30px 30px 30px 47px; // 增加左侧内边距,给背脊留出空间
|
|
654
|
+
|
|
655
|
+
.archive-spine {
|
|
656
|
+
background-color: #fff;
|
|
657
|
+
position: absolute;
|
|
658
|
+
left: 0;
|
|
659
|
+
top: 0;
|
|
660
|
+
bottom: 0;
|
|
661
|
+
width: 25px;
|
|
662
|
+
z-index: 10;
|
|
663
|
+
}
|
|
548
664
|
|
|
549
665
|
// 移除 react-pageflip 默认添加的样式影响
|
|
550
666
|
&.stf__item {
|
|
@@ -574,7 +690,7 @@
|
|
|
574
690
|
box-sizing: border-box;
|
|
575
691
|
}
|
|
576
692
|
|
|
577
|
-
|
|
693
|
+
.project-cover-header {
|
|
578
694
|
text-align: center;
|
|
579
695
|
color: #000;
|
|
580
696
|
// padding: 8px 0;
|
|
@@ -599,8 +715,8 @@
|
|
|
599
715
|
.stat-cell-label {
|
|
600
716
|
flex: 1;
|
|
601
717
|
text-align: center;
|
|
602
|
-
height:
|
|
603
|
-
line-height:
|
|
718
|
+
height: 42px;
|
|
719
|
+
line-height: 42px;
|
|
604
720
|
// padding: 8px;
|
|
605
721
|
border-right: 1px solid #000;
|
|
606
722
|
display: flex;
|
|
@@ -612,8 +728,8 @@
|
|
|
612
728
|
.stat-cell-value {
|
|
613
729
|
flex: 1;
|
|
614
730
|
text-align: center;
|
|
615
|
-
height:
|
|
616
|
-
line-height:
|
|
731
|
+
height: 42px;
|
|
732
|
+
line-height: 42px;
|
|
617
733
|
border-right: 1px solid #000;
|
|
618
734
|
font-family: "Times New Roman", serif;
|
|
619
735
|
font-size: 18px;
|
|
@@ -3,7 +3,7 @@ export declare const setupPdfWorker: (customSrc?: string) => void;
|
|
|
3
3
|
export declare const PDF_OPTIONS: {};
|
|
4
4
|
export declare const PDF_PRELOAD_TIMEOUT = 60000;
|
|
5
5
|
export declare const VIEWPORT_WIDTH = 580;
|
|
6
|
-
export declare const VIEWPORT_HEIGHT =
|
|
6
|
+
export declare const VIEWPORT_HEIGHT = 650;
|
|
7
7
|
export declare const HEIGHT = "100%";
|
|
8
8
|
export declare const isPdfFile: (path: string) => boolean;
|
|
9
9
|
export declare const formatPath: (path: string) => string;
|
|
@@ -14,4 +14,5 @@ export declare const createPdfDocumentCache: (loadDocument: (path: string) => Pr
|
|
|
14
14
|
getDocument(path: string): Promise<PdfDocumentLike>;
|
|
15
15
|
getPageCount(path: string): Promise<number>;
|
|
16
16
|
clear(path: string): void;
|
|
17
|
+
clearAll(): void;
|
|
17
18
|
};
|
|
@@ -28,7 +28,7 @@ setupPdfWorker();
|
|
|
28
28
|
var PDF_OPTIONS = exports.PDF_OPTIONS = {};
|
|
29
29
|
var PDF_PRELOAD_TIMEOUT = exports.PDF_PRELOAD_TIMEOUT = 60000; // 增加到 60 秒,适配超大文件或慢速网络
|
|
30
30
|
var VIEWPORT_WIDTH = exports.VIEWPORT_WIDTH = 580;
|
|
31
|
-
var VIEWPORT_HEIGHT = exports.VIEWPORT_HEIGHT =
|
|
31
|
+
var VIEWPORT_HEIGHT = exports.VIEWPORT_HEIGHT = 650;
|
|
32
32
|
var HEIGHT = exports.HEIGHT = '100%';
|
|
33
33
|
|
|
34
34
|
// 判断是否为 PDF
|
|
@@ -215,6 +215,9 @@ var createPdfDocumentCache = exports.createPdfDocumentCache = function createPdf
|
|
|
215
215
|
},
|
|
216
216
|
clear: function clear(path) {
|
|
217
217
|
cache.delete(path);
|
|
218
|
+
},
|
|
219
|
+
clearAll: function clearAll() {
|
|
220
|
+
cache.clear();
|
|
218
221
|
}
|
|
219
222
|
};
|
|
220
223
|
};
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as DocumentFlipBook } from './DocumentFlipBook';
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
4
|
-
|
|
2
|
+
export { default as AccountingBook } from './AccountingBook';
|
|
3
|
+
export { setupPdfWorker } from './DocumentFlipBook/utils';
|
|
4
|
+
export * from './DocumentFlipBook/types';
|
package/dist/cjs/index.js
CHANGED
|
@@ -5,8 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
DocumentFlipBook: true,
|
|
8
|
+
AccountingBook: true,
|
|
8
9
|
setupPdfWorker: true
|
|
9
10
|
};
|
|
11
|
+
Object.defineProperty(exports, "AccountingBook", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function get() {
|
|
14
|
+
return _AccountingBook.default;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
10
17
|
Object.defineProperty(exports, "DocumentFlipBook", {
|
|
11
18
|
enumerable: true,
|
|
12
19
|
get: function get() {
|
|
@@ -20,8 +27,9 @@ Object.defineProperty(exports, "setupPdfWorker", {
|
|
|
20
27
|
}
|
|
21
28
|
});
|
|
22
29
|
var _DocumentFlipBook = _interopRequireDefault(require("./DocumentFlipBook"));
|
|
23
|
-
var
|
|
24
|
-
var
|
|
30
|
+
var _AccountingBook = _interopRequireDefault(require("./AccountingBook"));
|
|
31
|
+
var _utils = require("./DocumentFlipBook/utils");
|
|
32
|
+
var _types = require("./DocumentFlipBook/types");
|
|
25
33
|
Object.keys(_types).forEach(function (key) {
|
|
26
34
|
if (key === "default" || key === "__esModule") return;
|
|
27
35
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -33,5 +41,4 @@ Object.keys(_types).forEach(function (key) {
|
|
|
33
41
|
}
|
|
34
42
|
});
|
|
35
43
|
});
|
|
36
|
-
require("./index.less");
|
|
37
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
var AccountingBook = function AccountingBook() {
|
|
5
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
6
|
+
children: [/*#__PURE__*/_jsx("h1", {
|
|
7
|
+
children: "Accounting Book Component"
|
|
8
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
9
|
+
children: "This is a placeholder for the Accounting Book component."
|
|
10
|
+
})]
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
export default AccountingBook;
|
|
@@ -28,12 +28,32 @@ var ArchiveCover = function ArchiveCover(_ref) {
|
|
|
28
28
|
attachmentsCount: (archiveInfo === null || archiveInfo === void 0 || (_archiveInfo$com00cs = archiveInfo.com00cs) === null || _archiveInfo$com00cs === void 0 ? void 0 : _archiveInfo$com00cs.length) || 0,
|
|
29
29
|
nsp24cFd: (archiveInfo === null || archiveInfo === void 0 || (_archiveInfo$nsp24c = archiveInfo.nsp24c) === null || _archiveInfo$nsp24c === void 0 ? void 0 : _archiveInfo$nsp24c.fd) || '-'
|
|
30
30
|
};
|
|
31
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
32
32
|
className: "archive-cover",
|
|
33
33
|
style: {
|
|
34
34
|
backgroundColor: themeColor
|
|
35
35
|
},
|
|
36
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
36
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
37
|
+
className: "archive-spine",
|
|
38
|
+
children: /*#__PURE__*/_jsxs("svg", {
|
|
39
|
+
width: "100%",
|
|
40
|
+
height: "100%",
|
|
41
|
+
viewBox: "0 0 17 825",
|
|
42
|
+
preserveAspectRatio: "none",
|
|
43
|
+
fill: "none",
|
|
44
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
45
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
46
|
+
d: "M0 30L17 0V825L0 789V30Z",
|
|
47
|
+
fill: themeColor,
|
|
48
|
+
style: {
|
|
49
|
+
filter: 'brightness(0.9)'
|
|
50
|
+
}
|
|
51
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
52
|
+
d: "M4 43.8636L13 29.5V802L4 782.364L4 43.8636Z",
|
|
53
|
+
fill: "rgba(255,255,255,0.3)"
|
|
54
|
+
})]
|
|
55
|
+
})
|
|
56
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
37
57
|
className: "archive-cover__outer-border",
|
|
38
58
|
children: /*#__PURE__*/_jsxs("div", {
|
|
39
59
|
className: "archive-cover__inner",
|
|
@@ -130,7 +150,7 @@ var ArchiveCover = function ArchiveCover(_ref) {
|
|
|
130
150
|
})
|
|
131
151
|
})]
|
|
132
152
|
})
|
|
133
|
-
})
|
|
153
|
+
})]
|
|
134
154
|
});
|
|
135
155
|
};
|
|
136
156
|
export default /*#__PURE__*/React.memo(ArchiveCover);
|
|
@@ -85,13 +85,33 @@ var ProjectCover = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
85
85
|
})
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
|
-
return /*#__PURE__*/
|
|
88
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
89
89
|
className: "project-cover-container",
|
|
90
90
|
style: {
|
|
91
91
|
backgroundColor: themeColor
|
|
92
92
|
},
|
|
93
93
|
ref: ref,
|
|
94
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
94
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
95
|
+
className: "archive-spine",
|
|
96
|
+
children: /*#__PURE__*/_jsxs("svg", {
|
|
97
|
+
width: "100%",
|
|
98
|
+
height: "100%",
|
|
99
|
+
viewBox: "0 0 17 825",
|
|
100
|
+
preserveAspectRatio: "none",
|
|
101
|
+
fill: "none",
|
|
102
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
103
|
+
children: [/*#__PURE__*/_jsx("path", {
|
|
104
|
+
d: "M0 30L17 0V825L0 789V30Z",
|
|
105
|
+
fill: themeColor,
|
|
106
|
+
style: {
|
|
107
|
+
filter: 'brightness(0.9)'
|
|
108
|
+
}
|
|
109
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
110
|
+
d: "M4 43.8636L13 29.5V802L4 782.364L4 43.8636Z",
|
|
111
|
+
fill: "rgba(255,255,255,0.3)"
|
|
112
|
+
})]
|
|
113
|
+
})
|
|
114
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
95
115
|
className: "project-cover-border-outer",
|
|
96
116
|
children: /*#__PURE__*/_jsxs("div", {
|
|
97
117
|
className: "project-cover-border-inner",
|
|
@@ -196,7 +216,7 @@ var ProjectCover = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
196
216
|
})]
|
|
197
217
|
})]
|
|
198
218
|
})
|
|
199
|
-
})
|
|
219
|
+
})]
|
|
200
220
|
});
|
|
201
221
|
});
|
|
202
222
|
export default /*#__PURE__*/React.memo(ProjectCover);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BuiltPage, PdfDocumentLike } from './types';
|
|
2
|
-
interface
|
|
2
|
+
interface ExportEpubOptions {
|
|
3
3
|
pages: BuiltPage[];
|
|
4
4
|
filename: string;
|
|
5
5
|
title?: string;
|
|
@@ -13,7 +13,7 @@ interface ExportHtmlOptions {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* 导出
|
|
16
|
+
* 导出 EPUB 电子书功能
|
|
17
17
|
*/
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const exportArchivePagesToEpub: (options: ExportEpubOptions) => Promise<void>;
|
|
19
19
|
export {};
|