@pdfme/ui 1.0.0-beta.1
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/.eslintrc.js +45 -0
- package/README.md +280 -0
- package/declaration.d.ts +8 -0
- package/dist/@pdfme/ui.js +3 -0
- package/dist/@pdfme/ui.js.LICENSE.txt +95 -0
- package/dist/@pdfme/ui.js.map +1 -0
- package/dist/types/common/src/barcode.d.ts +2 -0
- package/dist/types/common/src/constants.d.ts +6 -0
- package/dist/types/common/src/helper.d.ts +15 -0
- package/dist/types/common/src/index.d.ts +4 -0
- package/dist/types/common/src/schema.d.ts +3613 -0
- package/dist/types/common/src/type.d.ts +64 -0
- package/dist/types/common/src/utils.d.ts +12 -0
- package/dist/types/ui/src/Designer.d.ts +13 -0
- package/dist/types/ui/src/Form.d.ts +13 -0
- package/dist/types/ui/src/Viewer.d.ts +7 -0
- package/dist/types/ui/src/class.d.ts +72 -0
- package/dist/types/ui/src/components/Designer/Main/Guides.d.ts +9 -0
- package/dist/types/ui/src/components/Designer/Main/Mask.d.ts +3 -0
- package/dist/types/ui/src/components/Designer/Main/Moveable.d.ts +31 -0
- package/dist/types/ui/src/components/Designer/Main/Selecto.d.ts +8 -0
- package/dist/types/ui/src/components/Designer/Main/index.d.ts +24 -0
- package/dist/types/ui/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.d.ts +3 -0
- package/dist/types/ui/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.d.ts +3 -0
- package/dist/types/ui/src/components/Designer/Sidebar/DetailView/TextPropEditor.d.ts +3 -0
- package/dist/types/ui/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.d.ts +3 -0
- package/dist/types/ui/src/components/Designer/Sidebar/DetailView/index.d.ts +3 -0
- package/dist/types/ui/src/components/Designer/Sidebar/ListView.d.ts +3 -0
- package/dist/types/ui/src/components/Designer/Sidebar/index.d.ts +26 -0
- package/dist/types/ui/src/components/Designer/index.d.ts +99 -0
- package/dist/types/ui/src/components/Divider.d.ts +2 -0
- package/dist/types/ui/src/components/Error.d.ts +7 -0
- package/dist/types/ui/src/components/Paper.d.ts +19 -0
- package/dist/types/ui/src/components/Preview/Pager/Page.d.ts +8 -0
- package/dist/types/ui/src/components/Preview/Pager/Unit.d.ts +8 -0
- package/dist/types/ui/src/components/Preview/index.d.ts +4 -0
- package/dist/types/ui/src/components/Root.d.ts +9 -0
- package/dist/types/ui/src/components/Schemas/BarcodeSchema.d.ts +15 -0
- package/dist/types/ui/src/components/Schemas/ImageSchema.d.ts +15 -0
- package/dist/types/ui/src/components/Schemas/SchemaUI.d.ts +14 -0
- package/dist/types/ui/src/components/Schemas/TextSchema.d.ts +22 -0
- package/dist/types/ui/src/components/Spinner.d.ts +2 -0
- package/dist/types/ui/src/constants.d.ts +5 -0
- package/dist/types/ui/src/contexts.d.ts +7 -0
- package/dist/types/ui/src/helper.d.ts +91 -0
- package/dist/types/ui/src/hooks.d.ts +26 -0
- package/dist/types/ui/src/i18n.d.ts +30 -0
- package/dist/types/ui/src/index.d.ts +5 -0
- package/dist/types/ui/src/libs/class.d.ts +84 -0
- package/dist/types/ui/src/libs/contexts.d.ts +7 -0
- package/dist/types/ui/src/libs/helper.d.ts +64 -0
- package/dist/types/ui/src/libs/hooks.d.ts +26 -0
- package/dist/types/ui/src/libs/i18n.d.ts +30 -0
- package/dist/types/ui/src/libs/ui.d.ts +64 -0
- package/package.json +80 -0
- package/public/Designer.html +90 -0
- package/public/Form.html +74 -0
- package/public/SauceHanSansJP.ttf +0 -0
- package/public/SauceHanSerifJP.ttf +0 -0
- package/public/Viewer.html +73 -0
- package/public/helper.js +51 -0
- package/public/index.html +54 -0
- package/src/Designer.tsx +72 -0
- package/src/Form.tsx +45 -0
- package/src/Viewer.tsx +27 -0
- package/src/assets/barcodeExamples/code128.png +0 -0
- package/src/assets/barcodeExamples/code39.png +0 -0
- package/src/assets/barcodeExamples/ean13.png +0 -0
- package/src/assets/barcodeExamples/ean8.png +0 -0
- package/src/assets/barcodeExamples/itf14.png +0 -0
- package/src/assets/barcodeExamples/japanpost.png +0 -0
- package/src/assets/barcodeExamples/nw7.png +0 -0
- package/src/assets/barcodeExamples/qrcode.png +0 -0
- package/src/assets/barcodeExamples/upca.png +0 -0
- package/src/assets/barcodeExamples/upce.png +0 -0
- package/src/assets/icons/back.svg +4 -0
- package/src/assets/icons/double-left.svg +11 -0
- package/src/assets/icons/double-right.svg +11 -0
- package/src/assets/icons/drag.svg +3 -0
- package/src/assets/icons/forward.svg +4 -0
- package/src/assets/icons/left.svg +4 -0
- package/src/assets/icons/right.svg +4 -0
- package/src/assets/icons/warning.svg +4 -0
- package/src/assets/imageExample.png +0 -0
- package/src/class.ts +147 -0
- package/src/components/Designer/Main/Guides.tsx +53 -0
- package/src/components/Designer/Main/Mask.tsx +19 -0
- package/src/components/Designer/Main/Moveable.tsx +79 -0
- package/src/components/Designer/Main/Selecto.tsx +29 -0
- package/src/components/Designer/Main/index.tsx +314 -0
- package/src/components/Designer/Sidebar/DetailView/ExampleInputEditor.tsx +62 -0
- package/src/components/Designer/Sidebar/DetailView/PositionAndSizeEditor.tsx +98 -0
- package/src/components/Designer/Sidebar/DetailView/TextPropEditor.tsx +178 -0
- package/src/components/Designer/Sidebar/DetailView/TypeAndKeyEditor.tsx +79 -0
- package/src/components/Designer/Sidebar/DetailView/index.tsx +39 -0
- package/src/components/Designer/Sidebar/ListView.tsx +180 -0
- package/src/components/Designer/Sidebar/index.tsx +102 -0
- package/src/components/Designer/index.tsx +283 -0
- package/src/components/Divider.tsx +7 -0
- package/src/components/Error.tsx +31 -0
- package/src/components/Paper.tsx +77 -0
- package/src/components/Preview/Pager/Page.tsx +85 -0
- package/src/components/Preview/Pager/Unit.tsx +87 -0
- package/src/components/Preview/index.tsx +102 -0
- package/src/components/Root.tsx +52 -0
- package/src/components/Schemas/BarcodeSchema.tsx +111 -0
- package/src/components/Schemas/ImageSchema.tsx +81 -0
- package/src/components/Schemas/SchemaUI.tsx +64 -0
- package/src/components/Schemas/TextSchema.tsx +62 -0
- package/src/components/Spinner.tsx +37 -0
- package/src/constants.ts +9 -0
- package/src/contexts.ts +8 -0
- package/src/helper.ts +516 -0
- package/src/hooks.ts +107 -0
- package/src/i18n.ts +64 -0
- package/src/index.ts +77 -0
- package/tsconfig.json +21 -0
- package/webpack.config.js +73 -0
package/src/index.ts
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
import Designer from './Designer';
|
2
|
+
import Form from './Form';
|
3
|
+
import Viewer from './Viewer';
|
4
|
+
import {
|
5
|
+
BLANK_PDF,
|
6
|
+
Lang,
|
7
|
+
Size,
|
8
|
+
Alignment,
|
9
|
+
SchemaType,
|
10
|
+
schemaTypes,
|
11
|
+
BarCodeType,
|
12
|
+
TextSchema,
|
13
|
+
isTextSchema,
|
14
|
+
ImageSchema,
|
15
|
+
isImageSchema,
|
16
|
+
BarcodeSchema,
|
17
|
+
isBarcodeSchema,
|
18
|
+
Schema,
|
19
|
+
SchemaForUI,
|
20
|
+
Font,
|
21
|
+
BasePdf,
|
22
|
+
Template,
|
23
|
+
CommonProps,
|
24
|
+
GeneratorOptions,
|
25
|
+
GenerateProps,
|
26
|
+
UIOptions,
|
27
|
+
UIProps,
|
28
|
+
PreviewProps,
|
29
|
+
PreviewReactProps,
|
30
|
+
DesignerProps,
|
31
|
+
DesignerReactProps,
|
32
|
+
checkTemplate,
|
33
|
+
checkUIProps,
|
34
|
+
checkPreviewProps,
|
35
|
+
checkDesignerProps,
|
36
|
+
checkGenerateProps,
|
37
|
+
validateBarcodeInput,
|
38
|
+
} from '@pdfme/common';
|
39
|
+
|
40
|
+
export {
|
41
|
+
Designer,
|
42
|
+
Viewer,
|
43
|
+
Form,
|
44
|
+
BLANK_PDF,
|
45
|
+
Lang,
|
46
|
+
Size,
|
47
|
+
Alignment,
|
48
|
+
SchemaType,
|
49
|
+
schemaTypes,
|
50
|
+
BarCodeType,
|
51
|
+
TextSchema,
|
52
|
+
isTextSchema,
|
53
|
+
ImageSchema,
|
54
|
+
isImageSchema,
|
55
|
+
BarcodeSchema,
|
56
|
+
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
|
+
checkTemplate,
|
72
|
+
checkUIProps,
|
73
|
+
checkPreviewProps,
|
74
|
+
checkDesignerProps,
|
75
|
+
checkGenerateProps,
|
76
|
+
validateBarcodeInput,
|
77
|
+
};
|
package/tsconfig.json
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"noImplicitAny": true,
|
4
|
+
"target": "es5",
|
5
|
+
"jsx": "react",
|
6
|
+
"esModuleInterop": true,
|
7
|
+
"declaration": true,
|
8
|
+
"declarationDir": "dist/types",
|
9
|
+
"module": "ES2015",
|
10
|
+
"lib": ["es6", "dom", "es2016", "es2017"],
|
11
|
+
"moduleResolution": "node",
|
12
|
+
"allowSyntheticDefaultImports": true,
|
13
|
+
"strict": true,
|
14
|
+
"types": ["node", "jest", "@types/jest"],
|
15
|
+
"typeRoots": ["node_modules/@types"],
|
16
|
+
"sourceMap": true
|
17
|
+
},
|
18
|
+
"baseUrl": ".",
|
19
|
+
"include": ["declaration.d.ts", "src/**/*.ts", "src/**/*.tsx"],
|
20
|
+
"exclude": ["node_modules"]
|
21
|
+
}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
const path = require('path');
|
2
|
+
const webpack = require('webpack');
|
3
|
+
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
4
|
+
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
5
|
+
const pkg = require('./package.json');
|
6
|
+
|
7
|
+
const isProduction = process.env.NODE_ENV === 'production';
|
8
|
+
|
9
|
+
const BANNER = [
|
10
|
+
'@name ' + pkg.name,
|
11
|
+
'@version ' + pkg.version + ' | ' + new Date().toDateString(),
|
12
|
+
'@author ' + pkg.author,
|
13
|
+
'@license ' + pkg.license,
|
14
|
+
].join('\n');
|
15
|
+
|
16
|
+
const config = {
|
17
|
+
optimization: { minimize: isProduction },
|
18
|
+
resolve: {
|
19
|
+
extensions: ['.ts', '.tsx', '.js', '.png', '.svg'],
|
20
|
+
alias: { process: 'process/browser' },
|
21
|
+
},
|
22
|
+
plugins: [
|
23
|
+
// new BundleAnalyzerPlugin(),
|
24
|
+
new webpack.ProvidePlugin({
|
25
|
+
process: 'process/browser',
|
26
|
+
}),
|
27
|
+
new webpack.BannerPlugin({
|
28
|
+
banner: BANNER,
|
29
|
+
entryOnly: true,
|
30
|
+
}),
|
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
|
+
],
|
44
|
+
devtool: 'source-map',
|
45
|
+
devServer: {
|
46
|
+
historyApiFallback: false,
|
47
|
+
host: '0.0.0.0',
|
48
|
+
},
|
49
|
+
entry: './src/index.ts',
|
50
|
+
output: {
|
51
|
+
path: path.resolve(__dirname, 'dist'),
|
52
|
+
filename: `${pkg.name}.js`,
|
53
|
+
libraryTarget: 'umd',
|
54
|
+
globalObject: 'this',
|
55
|
+
library: {
|
56
|
+
name: pkg.name,
|
57
|
+
type: 'umd',
|
58
|
+
},
|
59
|
+
},
|
60
|
+
module: {
|
61
|
+
rules: [
|
62
|
+
{
|
63
|
+
test: /\.tsx?$/,
|
64
|
+
use: 'ts-loader',
|
65
|
+
},
|
66
|
+
{
|
67
|
+
test: /\.(png|svg|ttf)$/i,
|
68
|
+
use: ['url-loader'],
|
69
|
+
},
|
70
|
+
],
|
71
|
+
},
|
72
|
+
};
|
73
|
+
module.exports = config;
|