@pdfme/ui 1.0.11 → 1.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfme/ui",
3
- "version": "1.0.11",
3
+ "version": "1.0.14",
4
4
  "author": "hand-dot",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -21,13 +21,7 @@ const Pager = ({ pageCursor, pageNum, setPageCursor }: Props) => {
21
21
  const i18n = useContext(I18nContext);
22
22
 
23
23
  return (
24
- <div
25
- style={{
26
- display: 'flex',
27
- alignItems: 'center',
28
- justifyContent: 'center',
29
- }}
30
- >
24
+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
31
25
  <button
32
26
  style={{
33
27
  paddingLeft: '0.5rem',
@@ -39,7 +33,7 @@ const Pager = ({ pageCursor, pageNum, setPageCursor }: Props) => {
39
33
  >
40
34
  <img src={left} alt={i18n('goToPrevious')} style={{ width: 20 }} />
41
35
  </button>
42
- <strong style={{ color: 'white', fontSize: '0.9rem' }}>
36
+ <strong style={{ color: 'white', fontSize: '0.9rem', minWidth: 45, textAlign: 'center' }}>
43
37
  {pageCursor + 1}/{pageNum}
44
38
  </strong>
45
39
  <button
@@ -33,20 +33,22 @@ const Pager = ({ zoomLevel, setZoomLevel }: Props) => {
33
33
  ...btnStyle,
34
34
  cursor: minZoom >= nextZoomOut ? 'not-allowed' : 'pointer',
35
35
  }}
36
- onClick={() => setZoomLevel(nextZoomOut)}
37
36
  disabled={minZoom >= nextZoomOut}
37
+ onClick={() => setZoomLevel(nextZoomOut)}
38
38
  >
39
39
  <img src={remove} alt={i18n('zoomOut')} style={{ width: 20 }} />
40
40
  </button>
41
- <strong style={{ color: 'white', fontSize: '0.9rem' }}>{Math.round(zoomLevel * 100)}%</strong>
41
+ <strong style={{ color: 'white', fontSize: '0.9rem', minWidth: 45, textAlign: 'center' }}>
42
+ {Math.round(zoomLevel * 100)}%
43
+ </strong>
42
44
  <button
43
45
  style={{
44
46
  paddingRight: '0.5rem',
45
47
  ...btnStyle,
46
48
  cursor: maxZoom < nextZoomIn ? 'not-allowed' : 'pointer',
47
49
  }}
48
- onClick={() => setZoomLevel(nextZoomIn)}
49
50
  disabled={maxZoom < nextZoomIn}
51
+ onClick={() => setZoomLevel(nextZoomIn)}
50
52
  >
51
53
  <img src={add} alt={i18n('zoomIn')} style={{ width: 20 }} />
52
54
  </button>
@@ -12,7 +12,7 @@ type Props = {
12
12
  setZoomLevel: (zoom: number) => void;
13
13
  };
14
14
 
15
- const barWidth = 220;
15
+ const barWidth = 250;
16
16
 
17
17
  const CtlBar = (props: Props) => {
18
18
  const { size, pageCursor, pageNum, setPageCursor, zoomLevel, setZoomLevel } = props;
@@ -277,10 +277,7 @@ const Main = (props: Props, ref: Ref<HTMLDivElement>) => {
277
277
  }}
278
278
  />
279
279
  {pageCursor !== index ? (
280
- <Mask
281
- width={paperSize.width + RULER_HEIGHT}
282
- height={paperSize.height + RULER_HEIGHT * scale}
283
- />
280
+ <Mask width={paperSize.width + RULER_HEIGHT} height={paperSize.height} />
284
281
  ) : (
285
282
  !editing && (
286
283
  <Moveable
@@ -52,7 +52,7 @@ const Sidebar = (props: SidebarProps) => {
52
52
  <button
53
53
  style={{
54
54
  position: 'absolute',
55
- top: '1rem',
55
+ top: '1.75rem',
56
56
  right: '0.5rem',
57
57
  zIndex: 100,
58
58
  border: 'none',
@@ -56,7 +56,8 @@ const Paper = (porps: {
56
56
  }}
57
57
  style={{
58
58
  fontFamily: `'${getFallbackFontName(font)}'`,
59
- margin: `${RULER_HEIGHT * scale}px auto`,
59
+ top: `${RULER_HEIGHT}px`,
60
+ margin: '0 auto',
60
61
  position: 'relative',
61
62
  backgroundImage: `url(${background})`,
62
63
  backgroundSize: `${paperSize.width}px ${paperSize.height}px`,
@@ -85,7 +85,7 @@ const BarcodeSchemaUI = (
85
85
  color: '#000',
86
86
  height: Number(schema.height) * ZOOM,
87
87
  width: Number(schema.width) * ZOOM,
88
- background: editable || value ? 'rgba(255, 255, 255, 0.8)' : 'none',
88
+ backgroundColor: editable || value ? 'rgb(242 244 255 / 75%)' : 'none',
89
89
  border: 'none',
90
90
  display: 'flex',
91
91
  alignItems: 'center',
@@ -30,10 +30,10 @@ const TextSchemaUI = (
30
30
  lineHeight: `${schema.lineHeight ?? DEFAULT_LINE_HEIGHT}em`,
31
31
  whiteSpace: 'pre-line',
32
32
  wordBreak: 'break-all',
33
- background: 'transparent',
34
33
  border: 'none',
35
34
  color: schema.fontColor ? schema.fontColor : DEFAULT_FONT_COLOR,
36
- backgroundColor: schema.data && schema.backgroundColor ? schema.backgroundColor : 'transparent',
35
+ backgroundColor:
36
+ schema.data && schema.backgroundColor ? schema.backgroundColor : 'rgb(242 244 255 / 75%)',
37
37
  };
38
38
 
39
39
  return editable ? (