@cecee/document-flip-book 1.0.9 → 1.0.12

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.
@@ -50,6 +50,7 @@ var DocumentFlipBook = function DocumentFlipBook(_ref) {
50
50
  showHeaderBar = _ref$showHeaderBar === void 0 ? true : _ref$showHeaderBar,
51
51
  pdfWorkerSrc = _ref.pdfWorkerSrc;
52
52
  var flipRef = (0, _react.useRef)(null);
53
+ console.log(documentInfo);
53
54
 
54
55
  // 初始化 PDF Worker
55
56
  (0, _react.useEffect)(function () {
@@ -550,7 +551,6 @@ var DocumentFlipBook = function DocumentFlipBook(_ref) {
550
551
  className: "dfb-stage",
551
552
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Spin, {
552
553
  size: "large",
553
- tip: "\u6B63\u5728\u89E3\u6790\u6863\u6848\u7ED3\u6784...",
554
554
  spinning: loading,
555
555
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
556
556
  className: "dfb-book-wrapper",
@@ -617,20 +617,22 @@ var DocumentFlipBook = function DocumentFlipBook(_ref) {
617
617
  length: total
618
618
  }).map(function (_, i) {
619
619
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
620
- className: "book-view bg-white",
620
+ className: "book-view",
621
621
  style: {
622
622
  width: '100%',
623
- height: '100%'
623
+ height: '100%',
624
+ background: '#fff'
624
625
  },
625
626
  children: renderContent(i)
626
627
  }, i);
627
628
  })
628
629
  }, "".concat(archiveId, "-").concat(activeTab)), !loading && pages.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
629
- className: "book-view bg-white",
630
+ className: "book-view",
630
631
  style: {
631
632
  width: _utils.VIEWPORT_WIDTH,
632
633
  height: _utils.VIEWPORT_HEIGHT,
633
- margin: 'auto'
634
+ margin: 'auto',
635
+ background: '#fff'
634
636
  },
635
637
  children: renderContent(0)
636
638
  })]
@@ -51,16 +51,16 @@ var HeaderBar = function HeaderBar(_ref) {
51
51
  setExportModalVisible(false);
52
52
  };
53
53
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
54
- className: "common-header-bar flex items-center justify-between h-[50px] px-4 bg-white border-b border-[#f0f0f0]",
54
+ className: "common-header-bar",
55
55
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
56
- className: "header-left flex items-center",
56
+ className: "header-left",
57
57
  children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
58
- className: "text-lg font-bold mr-4",
58
+ className: "header-title",
59
59
  children: title
60
60
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
61
61
  size: 0,
62
62
  children: [mode !== 'modal' && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
63
- className: "flex items-center",
63
+ className: "header-item",
64
64
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Button, {
65
65
  type: "link",
66
66
  onClick: onBack,
@@ -77,7 +77,7 @@ var HeaderBar = function HeaderBar(_ref) {
77
77
  className: "dfb-divider"
78
78
  })]
79
79
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
80
- className: "flex items-center",
80
+ className: "header-item",
81
81
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Button, {
82
82
  type: "link",
83
83
  onClick: onRefresh,
@@ -179,7 +179,7 @@ var HeaderBar = function HeaderBar(_ref) {
179
179
  })]
180
180
  })]
181
181
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
182
- className: "header-right flex items-center",
182
+ className: "header-right",
183
183
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Button, {
184
184
  type: "link",
185
185
  onClick: onPrint,
@@ -1,3 +1,4 @@
1
1
  export { default as DocumentFlipBook } from './DocumentFlipBook';
2
2
  export { setupPdfWorker } from './utils';
3
3
  export * from './types';
4
+ import './index.less';
package/dist/cjs/index.js CHANGED
@@ -33,4 +33,5 @@ Object.keys(_types).forEach(function (key) {
33
33
  }
34
34
  });
35
35
  });
36
+ require("./index.less");
36
37
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,3 +1,33 @@
1
+ .common-header-bar {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ height: 50px;
6
+ padding: 0 16px;
7
+ background: #fff;
8
+ border-bottom: 1px solid #f0f0f0;
9
+
10
+ .header-left,
11
+ .header-right,
12
+ .header-item {
13
+ display: flex;
14
+ align-items: center;
15
+ }
16
+
17
+ .header-title {
18
+ font-size: 18px;
19
+ font-weight: bold;
20
+ margin-right: 16px;
21
+ }
22
+
23
+ .dfb-divider {
24
+ width: 1px;
25
+ height: 18px;
26
+ background: #e8e8e8;
27
+ margin: 0 8px;
28
+ }
29
+ }
30
+
1
31
  .book-page {
2
32
  width: 100%;
3
33
  height: 100%;
@@ -42,6 +42,7 @@ var DocumentFlipBook = function DocumentFlipBook(_ref) {
42
42
  showHeaderBar = _ref$showHeaderBar === void 0 ? true : _ref$showHeaderBar,
43
43
  pdfWorkerSrc = _ref.pdfWorkerSrc;
44
44
  var flipRef = useRef(null);
45
+ console.log(documentInfo);
45
46
 
46
47
  // 初始化 PDF Worker
47
48
  useEffect(function () {
@@ -536,7 +537,6 @@ var DocumentFlipBook = function DocumentFlipBook(_ref) {
536
537
  className: "dfb-stage",
537
538
  children: /*#__PURE__*/_jsx(Spin, {
538
539
  size: "large",
539
- tip: "\u6B63\u5728\u89E3\u6790\u6863\u6848\u7ED3\u6784...",
540
540
  spinning: loading,
541
541
  children: /*#__PURE__*/_jsx("div", {
542
542
  className: "dfb-book-wrapper",
@@ -603,20 +603,22 @@ var DocumentFlipBook = function DocumentFlipBook(_ref) {
603
603
  length: total
604
604
  }).map(function (_, i) {
605
605
  return /*#__PURE__*/_jsx("div", {
606
- className: "book-view bg-white",
606
+ className: "book-view",
607
607
  style: {
608
608
  width: '100%',
609
- height: '100%'
609
+ height: '100%',
610
+ background: '#fff'
610
611
  },
611
612
  children: renderContent(i)
612
613
  }, i);
613
614
  })
614
615
  }, "".concat(archiveId, "-").concat(activeTab)), !loading && pages.length === 0 && /*#__PURE__*/_jsx("div", {
615
- className: "book-view bg-white",
616
+ className: "book-view",
616
617
  style: {
617
618
  width: VIEWPORT_WIDTH,
618
619
  height: VIEWPORT_HEIGHT,
619
- margin: 'auto'
620
+ margin: 'auto',
621
+ background: '#fff'
620
622
  },
621
623
  children: renderContent(0)
622
624
  })]
@@ -42,16 +42,16 @@ var HeaderBar = function HeaderBar(_ref) {
42
42
  setExportModalVisible(false);
43
43
  };
44
44
  return /*#__PURE__*/_jsxs("div", {
45
- className: "common-header-bar flex items-center justify-between h-[50px] px-4 bg-white border-b border-[#f0f0f0]",
45
+ className: "common-header-bar",
46
46
  children: [/*#__PURE__*/_jsxs("div", {
47
- className: "header-left flex items-center",
47
+ className: "header-left",
48
48
  children: [title && /*#__PURE__*/_jsx("span", {
49
- className: "text-lg font-bold mr-4",
49
+ className: "header-title",
50
50
  children: title
51
51
  }), /*#__PURE__*/_jsxs(Space, {
52
52
  size: 0,
53
53
  children: [mode !== 'modal' && /*#__PURE__*/_jsxs("div", {
54
- className: "flex items-center",
54
+ className: "header-item",
55
55
  children: [/*#__PURE__*/_jsxs(Button, {
56
56
  type: "link",
57
57
  onClick: onBack,
@@ -68,7 +68,7 @@ var HeaderBar = function HeaderBar(_ref) {
68
68
  className: "dfb-divider"
69
69
  })]
70
70
  }), /*#__PURE__*/_jsxs("div", {
71
- className: "flex items-center",
71
+ className: "header-item",
72
72
  children: [/*#__PURE__*/_jsxs(Button, {
73
73
  type: "link",
74
74
  onClick: onRefresh,
@@ -170,7 +170,7 @@ var HeaderBar = function HeaderBar(_ref) {
170
170
  })]
171
171
  })]
172
172
  }), /*#__PURE__*/_jsxs("div", {
173
- className: "header-right flex items-center",
173
+ className: "header-right",
174
174
  children: [/*#__PURE__*/_jsxs(Button, {
175
175
  type: "link",
176
176
  onClick: onPrint,
@@ -1,3 +1,4 @@
1
1
  export { default as DocumentFlipBook } from './DocumentFlipBook';
2
2
  export { setupPdfWorker } from './utils';
3
3
  export * from './types';
4
+ import './index.less';
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { default as DocumentFlipBook } from "./DocumentFlipBook";
2
2
  export { setupPdfWorker } from "./utils";
3
- export * from "./types";
3
+ export * from "./types";
4
+ import "./index.less";
@@ -1,3 +1,33 @@
1
+ .common-header-bar {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: space-between;
5
+ height: 50px;
6
+ padding: 0 16px;
7
+ background: #fff;
8
+ border-bottom: 1px solid #f0f0f0;
9
+
10
+ .header-left,
11
+ .header-right,
12
+ .header-item {
13
+ display: flex;
14
+ align-items: center;
15
+ }
16
+
17
+ .header-title {
18
+ font-size: 18px;
19
+ font-weight: bold;
20
+ margin-right: 16px;
21
+ }
22
+
23
+ .dfb-divider {
24
+ width: 1px;
25
+ height: 18px;
26
+ background: #e8e8e8;
27
+ margin: 0 8px;
28
+ }
29
+ }
30
+
1
31
  .book-page {
2
32
  width: 100%;
3
33
  height: 100%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cecee/document-flip-book",
3
- "version": "1.0.9",
3
+ "version": "1.0.12",
4
4
  "description": "A high-performance document flipbook component based on React and Ant Design.",
5
5
  "publishConfig": {
6
6
  "access": "public"