@pdfme/ui 1.0.0-beta.3 → 1.0.0-beta.8

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.
Files changed (88) hide show
  1. package/coverage/clover.xml +6 -0
  2. package/coverage/coverage-final.json +1 -0
  3. package/coverage/lcov-report/base.css +224 -0
  4. package/coverage/lcov-report/block-navigation.js +87 -0
  5. package/coverage/lcov-report/favicon.png +0 -0
  6. package/coverage/lcov-report/index.html +101 -0
  7. package/coverage/lcov-report/prettify.css +1 -0
  8. package/coverage/lcov-report/prettify.js +2 -0
  9. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  10. package/coverage/lcov-report/sorter.js +196 -0
  11. package/coverage/lcov.info +0 -0
  12. package/dist/index.js +1 -1
  13. package/dist/index.js.LICENSE.txt +3 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/types/{ui/src/Designer.d.ts → Designer.d.ts} +0 -0
  16. package/dist/types/{ui/src/Form.d.ts → Form.d.ts} +0 -0
  17. package/dist/types/{ui/src/Viewer.d.ts → Viewer.d.ts} +0 -0
  18. package/dist/types/{ui/src/class.d.ts → class.d.ts} +1 -1
  19. package/dist/types/{ui/src/components → components}/Designer/Main/Guides.d.ts +0 -0
  20. package/dist/types/{ui/src/components → components}/Designer/Main/Mask.d.ts +0 -0
  21. package/dist/types/{ui/src/components → components}/Designer/Main/Moveable.d.ts +1 -1
  22. package/dist/types/{ui/src/components → components}/Designer/Main/Selecto.d.ts +0 -0
  23. package/dist/types/{ui/src/components → components}/Designer/Main/index.d.ts +0 -0
  24. package/dist/types/{ui/src/components → components}/Designer/Sidebar/DetailView/ExampleInputEditor.d.ts +0 -0
  25. package/dist/types/{ui/src/components → components}/Designer/Sidebar/DetailView/PositionAndSizeEditor.d.ts +0 -0
  26. package/dist/types/{ui/src/components → components}/Designer/Sidebar/DetailView/TextPropEditor.d.ts +0 -0
  27. package/dist/types/{ui/src/components → components}/Designer/Sidebar/DetailView/TypeAndKeyEditor.d.ts +0 -0
  28. package/dist/types/{ui/src/components → components}/Designer/Sidebar/DetailView/index.d.ts +0 -0
  29. package/dist/types/components/Designer/Sidebar/ListView.d.ts +3 -0
  30. package/dist/types/{ui/src/components → components}/Designer/Sidebar/index.d.ts +1 -0
  31. package/dist/types/{ui/src/components → components}/Designer/index.d.ts +0 -1
  32. package/dist/types/{ui/src/components → components}/Divider.d.ts +0 -0
  33. package/dist/types/{ui/src/components → components}/Error.d.ts +0 -1
  34. package/dist/types/{ui/src/components → components}/Paper.d.ts +0 -0
  35. package/dist/types/{ui/src/components → components}/Preview/Pager/Page.d.ts +0 -0
  36. package/dist/types/{ui/src/components → components}/Preview/Pager/Unit.d.ts +0 -0
  37. package/dist/types/{ui/src/components → components}/Preview/index.d.ts +0 -1
  38. package/dist/types/{ui/src/components → components}/Root.d.ts +0 -0
  39. package/dist/types/{ui/src/components → components}/Schemas/BarcodeSchema.d.ts +0 -0
  40. package/dist/types/{ui/src/components → components}/Schemas/ImageSchema.d.ts +0 -0
  41. package/dist/types/{ui/src/components → components}/Schemas/SchemaUI.d.ts +0 -0
  42. package/dist/types/{ui/src/components → components}/Schemas/TextSchema.d.ts +0 -0
  43. package/dist/types/{ui/src/components → components}/Spinner.d.ts +0 -0
  44. package/dist/types/{ui/src/constants.d.ts → constants.d.ts} +1 -0
  45. package/dist/types/contexts.d.ts +7 -0
  46. package/dist/types/{ui/src/helper.d.ts → helper.d.ts} +0 -0
  47. package/dist/types/{ui/src/hooks.d.ts → hooks.d.ts} +0 -0
  48. package/dist/types/{ui/src/i18n.d.ts → i18n.d.ts} +0 -1
  49. package/dist/types/index.d.ts +6 -0
  50. package/package.json +11 -6
  51. package/src/Designer.tsx +2 -1
  52. package/src/Form.tsx +1 -0
  53. package/src/Viewer.tsx +1 -0
  54. package/src/assets/icons/close.svg +4 -0
  55. package/src/assets/imageExample.png +0 -0
  56. package/src/class.ts +5 -6
  57. package/src/components/Designer/Main/Moveable.tsx +1 -1
  58. package/src/components/Designer/Main/index.tsx +6 -8
  59. package/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.tsx +24 -5
  60. package/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.tsx +12 -4
  61. package/src/components/Designer/Sidebar/DetailView/TextPropEditor.tsx +32 -5
  62. package/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.tsx +12 -4
  63. package/src/components/Designer/Sidebar/DetailView/index.tsx +15 -13
  64. package/src/components/Designer/Sidebar/ListView.tsx +47 -25
  65. package/src/components/Designer/Sidebar/index.tsx +9 -7
  66. package/src/components/Designer/index.tsx +5 -3
  67. package/src/components/Paper.tsx +1 -3
  68. package/src/components/Preview/Pager/Page.tsx +1 -1
  69. package/src/components/Preview/Pager/Unit.tsx +1 -1
  70. package/src/components/Preview/index.tsx +3 -4
  71. package/src/components/Root.tsx +2 -7
  72. package/src/components/Schemas/BarcodeSchema.tsx +37 -22
  73. package/src/components/Schemas/ImageSchema.tsx +71 -66
  74. package/src/components/Schemas/TextSchema.tsx +1 -1
  75. package/src/constants.ts +2 -0
  76. package/src/helper.ts +31 -27
  77. package/src/i18n.ts +0 -2
  78. package/src/index.ts +5 -41
  79. package/tsconfig.json +2 -1
  80. package/webpack.config.js +0 -18
  81. package/dist/types/common/src/constants.d.ts +0 -6
  82. package/dist/types/common/src/helper.d.ts +0 -15
  83. package/dist/types/common/src/index.d.ts +0 -4
  84. package/dist/types/common/src/schema.d.ts +0 -3613
  85. package/dist/types/common/src/type.d.ts +0 -64
  86. package/dist/types/ui/src/components/Designer/Sidebar/ListView.d.ts +0 -3
  87. package/dist/types/ui/src/contexts.d.ts +0 -7
  88. package/dist/types/ui/src/index.d.ts +0 -5
package/src/index.ts CHANGED
@@ -1,20 +1,18 @@
1
1
  import Designer from './Designer';
2
2
  import Form from './Form';
3
3
  import Viewer from './Viewer';
4
- import {
5
- BLANK_PDF,
4
+
5
+ export { Designer, Viewer, Form };
6
+
7
+ export type {
6
8
  Lang,
7
9
  Size,
8
10
  Alignment,
9
11
  SchemaType,
10
- schemaTypes,
11
12
  BarCodeType,
12
13
  TextSchema,
13
- isTextSchema,
14
14
  ImageSchema,
15
- isImageSchema,
16
15
  BarcodeSchema,
17
- isBarcodeSchema,
18
16
  Schema,
19
17
  SchemaForUI,
20
18
  Font,
@@ -26,52 +24,18 @@ import {
26
24
  UIOptions,
27
25
  UIProps,
28
26
  PreviewProps,
29
- PreviewReactProps,
30
27
  DesignerProps,
31
- DesignerReactProps,
32
- checkTemplate,
33
- checkUIProps,
34
- checkPreviewProps,
35
- checkDesignerProps,
36
- checkGenerateProps,
37
- validateBarcodeInput,
38
28
  } from '@pdfme/common';
39
29
 
40
30
  export {
41
- Designer,
42
- Viewer,
43
- Form,
44
31
  BLANK_PDF,
45
- Lang,
46
- Size,
47
- Alignment,
48
- SchemaType,
49
- schemaTypes,
50
- BarCodeType,
51
- TextSchema,
52
32
  isTextSchema,
53
- ImageSchema,
54
33
  isImageSchema,
55
- BarcodeSchema,
56
34
  isBarcodeSchema,
57
- Schema,
58
- SchemaForUI,
59
- Font,
60
- BasePdf,
61
- Template,
62
- CommonProps,
63
- GeneratorOptions,
64
- GenerateProps,
65
- UIOptions,
66
- UIProps,
67
- PreviewProps,
68
- PreviewReactProps,
69
- DesignerProps,
70
- DesignerReactProps,
71
35
  checkTemplate,
72
36
  checkUIProps,
73
37
  checkPreviewProps,
74
38
  checkDesignerProps,
75
39
  checkGenerateProps,
76
40
  validateBarcodeInput,
77
- };
41
+ } from '@pdfme/common';
package/tsconfig.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "noImplicitAny": true,
4
- "target": "es5",
4
+ "target": "ES2015",
5
5
  "jsx": "react",
6
6
  "esModuleInterop": true,
7
+ "isolatedModules": true,
7
8
  "declaration": true,
8
9
  "declarationDir": "dist/types",
9
10
  "module": "ES2015",
package/webpack.config.js CHANGED
@@ -1,7 +1,6 @@
1
1
  const path = require('path');
2
2
  const webpack = require('webpack');
3
3
  // const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
4
- const HtmlWebpackPlugin = require('html-webpack-plugin');
5
4
  const pkg = require('./package.json');
6
5
 
7
6
  const isProduction = process.env.NODE_ENV === 'production';
@@ -28,31 +27,14 @@ const config = {
28
27
  banner: BANNER,
29
28
  entryOnly: true,
30
29
  }),
31
- new HtmlWebpackPlugin({
32
- template: './public/Designer.html',
33
- filename: 'Designer.html',
34
- }),
35
- new HtmlWebpackPlugin({
36
- template: './public/Viewer.html',
37
- filename: 'Viewer.html',
38
- }),
39
- new HtmlWebpackPlugin({
40
- template: './public/Form.html',
41
- filename: 'Form.html',
42
- }),
43
30
  ],
44
31
  devtool: 'source-map',
45
- devServer: {
46
- historyApiFallback: false,
47
- host: '0.0.0.0',
48
- },
49
32
  entry: './src/index.ts',
50
33
  output: {
51
34
  path: path.resolve(__dirname, 'dist'),
52
35
  filename: 'index.js',
53
36
  globalObject: 'this',
54
37
  library: {
55
- name: pkg.name,
56
38
  type: 'umd',
57
39
  },
58
40
  },
@@ -1,6 +0,0 @@
1
- export declare const DEFAULT_FONT_SIZE = 13;
2
- export declare const DEFAULT_ALIGNMENT = "left";
3
- export declare const DEFAULT_LINE_HEIGHT = 1;
4
- export declare const DEFAULT_CHARACTER_SPACING = 0;
5
- export declare const DEFAULT_FONT_COLOR = "#000";
6
- export declare const BLANK_PDF = "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MKNSAwIG9iago8PAovRmlsdGVyIC9GbGF0ZURlY29kZQovTGVuZ3RoIDM4Cj4+CnN0cmVhbQp4nCvkMlAwUDC1NNUzMVGwMDHUszRSKErlCtfiyuMK5AIAXQ8GCgplbmRzdHJlYW0KZW5kb2JqCjQgMCBvYmoKPDwKL1R5cGUgL1BhZ2UKL01lZGlhQm94IFswIDAgNTk1LjQ0IDg0MS45Ml0KL1Jlc291cmNlcyA8PAo+PgovQ29udGVudHMgNSAwIFIKL1BhcmVudCAyIDAgUgo+PgplbmRvYmoKMiAwIG9iago8PAovVHlwZSAvUGFnZXMKL0tpZHMgWzQgMCBSXQovQ291bnQgMQo+PgplbmRvYmoKMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwovUGFnZXMgMiAwIFIKPj4KZW5kb2JqCjMgMCBvYmoKPDwKL3RyYXBwZWQgKGZhbHNlKQovQ3JlYXRvciAoU2VyaWYgQWZmaW5pdHkgRGVzaWduZXIgMS4xMC40KQovVGl0bGUgKFVudGl0bGVkLnBkZikKL0NyZWF0aW9uRGF0ZSAoRDoyMDIyMDEwNjE0MDg1OCswOScwMCcpCi9Qcm9kdWNlciAoaUxvdmVQREYpCi9Nb2REYXRlIChEOjIwMjIwMTA2MDUwOTA5WikKPj4KZW5kb2JqCjYgMCBvYmoKPDwKL1NpemUgNwovUm9vdCAxIDAgUgovSW5mbyAzIDAgUgovSUQgWzwyODhCM0VENTAyOEU0MDcyNERBNzNCOUE0Nzk4OUEwQT4gPEY1RkJGNjg4NkVERDZBQUNBNDRCNEZDRjBBRDUxRDlDPl0KL1R5cGUgL1hSZWYKL1cgWzEgMiAyXQovRmlsdGVyIC9GbGF0ZURlY29kZQovSW5kZXggWzAgN10KL0xlbmd0aCAzNgo+PgpzdHJlYW0KeJxjYGD4/5+RUZmBgZHhFZBgDAGxakAEP5BgEmFgAABlRwQJCmVuZHN0cmVhbQplbmRvYmoKc3RhcnR4cmVmCjUzMgolJUVPRgo=";
@@ -1,15 +0,0 @@
1
- import { Template, BasePdf, Font, BarCodeType } from './type';
2
- export declare const getB64BasePdf: (basePdf: BasePdf) => string | Promise<string>;
3
- export declare const b64toUint8Array: (base64: string) => Uint8Array;
4
- export declare const getFallbackFontName: (font: Font) => string;
5
- export declare const getDefaultFont: () => Font;
6
- export declare const checkFont: (arg: {
7
- font: Font;
8
- template: Template;
9
- }) => void;
10
- export declare const checkTemplate: (data: unknown) => void;
11
- export declare const checkUIProps: (data: unknown) => void;
12
- export declare const checkPreviewProps: (data: unknown) => void;
13
- export declare const checkDesignerProps: (data: unknown) => void;
14
- export declare const checkGenerateProps: (data: unknown) => void;
15
- export declare const validateBarcodeInput: (type: BarCodeType, input: string) => boolean;
@@ -1,4 +0,0 @@
1
- import { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF } from './constants';
2
- import { Lang, Size, Alignment, SchemaType, schemaTypes, BarCodeType, TextSchema, isTextSchema, ImageSchema, isImageSchema, BarcodeSchema, isBarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, PreviewReactProps, DesignerProps, DesignerReactProps } from './type';
3
- import { getB64BasePdf, b64toUint8Array, getFallbackFontName, getDefaultFont, checkFont, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput } from './helper';
4
- export { DEFAULT_FONT_SIZE, DEFAULT_ALIGNMENT, DEFAULT_LINE_HEIGHT, DEFAULT_CHARACTER_SPACING, DEFAULT_FONT_COLOR, BLANK_PDF, Lang, Size, Alignment, SchemaType, schemaTypes, BarCodeType, TextSchema, isTextSchema, ImageSchema, isImageSchema, BarcodeSchema, isBarcodeSchema, Schema, SchemaForUI, Font, BasePdf, Template, CommonProps, GeneratorOptions, GenerateProps, UIOptions, UIProps, PreviewProps, PreviewReactProps, DesignerProps, DesignerReactProps, getB64BasePdf, b64toUint8Array, getFallbackFontName, getDefaultFont, checkFont, checkTemplate, checkUIProps, checkPreviewProps, checkDesignerProps, checkGenerateProps, validateBarcodeInput, };