@pdfme/ui 5.3.16-dev.29 → 5.3.16-dev.4
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/dist/index.es.js +12671 -12883
- package/dist/index.umd.js +161 -161
- package/package.json +8 -8
- package/src/components/Designer/Canvas/index.tsx +11 -10
- package/src/components/Designer/LeftSidebar.tsx +15 -17
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pdfme/ui",
|
3
|
-
"version": "5.3.16-dev.
|
3
|
+
"version": "5.3.16-dev.4",
|
4
4
|
"sideEffects": false,
|
5
5
|
"author": "hand-dot",
|
6
6
|
"license": "MIT",
|
@@ -40,11 +40,11 @@
|
|
40
40
|
"@dnd-kit/sortable": "^10.0.0",
|
41
41
|
"@pdfme/converter": "*",
|
42
42
|
"@scena/react-guides": "^0.28.2",
|
43
|
-
"antd": "^5.
|
43
|
+
"antd": "^5.24.9",
|
44
44
|
"form-render": "^2.2.16",
|
45
45
|
"globrex": "^0.1.2",
|
46
|
-
"hotkeys-js": "^3.
|
47
|
-
"lucide-react": "^0.
|
46
|
+
"hotkeys-js": "^3.8.7",
|
47
|
+
"lucide-react": "^0.487.0",
|
48
48
|
"react": "^16.14.0",
|
49
49
|
"react-dom": "^16.14.0",
|
50
50
|
"react-moveable": "^0.56.0",
|
@@ -60,9 +60,9 @@
|
|
60
60
|
"@types/react": "^17.0.52",
|
61
61
|
"@types/react-dom": "^17.0.18",
|
62
62
|
"@ungap/structured-clone": "^1.3.0",
|
63
|
-
"@vitejs/plugin-react": "^4.
|
63
|
+
"@vitejs/plugin-react": "^4.2.0",
|
64
64
|
"csstype": "^3.1.2",
|
65
|
-
"esbuild": "^0.25.
|
65
|
+
"esbuild": "^0.25.2",
|
66
66
|
"eslint-plugin-react": "^7.37.5",
|
67
67
|
"eslint-plugin-react-hooks": "^5.2.0",
|
68
68
|
"is-path-inside": "^4.0.0",
|
@@ -70,8 +70,8 @@
|
|
70
70
|
"jest-environment-jsdom": "^29.7.0",
|
71
71
|
"postcss": "^8.5.3",
|
72
72
|
"process": "^0.11.10",
|
73
|
-
"rollup": "^4.
|
74
|
-
"vite": "^6.
|
73
|
+
"rollup": "^4.38.0",
|
74
|
+
"vite": "^6.2.5",
|
75
75
|
"vite-plugin-css-injected-by-js": "^3.3.0",
|
76
76
|
"vite-tsconfig-paths": "^5.1.4"
|
77
77
|
},
|
@@ -515,22 +515,23 @@ const Canvas = (props: Props, ref: Ref<HTMLDivElement>) => {
|
|
515
515
|
onChangeHoveringSchemaId={onChangeHoveringSchemaId}
|
516
516
|
mode={mode}
|
517
517
|
onChange={
|
518
|
-
|
518
|
+
schemasList[pageCursor].some((s) => s.id === schema.id)
|
519
519
|
? (arg) => {
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
520
|
+
// Use type assertion to safely handle the argument
|
521
|
+
type ChangeArg = { key: string; value: unknown };
|
522
|
+
const args = Array.isArray(arg) ? (arg as ChangeArg[]) : [arg as ChangeArg];
|
523
|
+
changeSchemas(
|
524
|
+
args.map(({ key, value }) => ({ key, value, schemaId: schema.id })),
|
525
|
+
);
|
526
|
+
}
|
527
527
|
: undefined
|
528
528
|
}
|
529
529
|
stopEditing={() => setEditing(false)}
|
530
|
-
outline={`1px ${hoveringSchemaId === schema.id ? 'solid' : 'dashed'} ${
|
530
|
+
outline={`1px ${hoveringSchemaId === schema.id ? 'solid' : 'dashed'} ${
|
531
|
+
schema.readOnly && hoveringSchemaId !== schema.id
|
531
532
|
? 'transparent'
|
532
533
|
: token.colorPrimary
|
533
|
-
|
534
|
+
}`}
|
534
535
|
scale={scale}
|
535
536
|
/>
|
536
537
|
);
|
@@ -21,25 +21,23 @@ const Draggable = (props: {
|
|
21
21
|
const { listeners, setNodeRef, attributes, transform, isDragging } = draggable;
|
22
22
|
const style = { transform: CSS.Translate.toString(transform) };
|
23
23
|
|
24
|
-
const renderedSchema = React.useMemo(() => (
|
25
|
-
<div style={{ transform: `scale(${scale})` }}>
|
26
|
-
<Renderer
|
27
|
-
schema={{ ...defaultSchema, id: defaultSchema.type }}
|
28
|
-
basePdf={basePdf}
|
29
|
-
value={defaultSchema.content || ''}
|
30
|
-
onChangeHoveringSchemaId={() => {
|
31
|
-
void 0;
|
32
|
-
}}
|
33
|
-
mode={'viewer'}
|
34
|
-
outline={`1px solid ${token.colorPrimary}`}
|
35
|
-
scale={scale}
|
36
|
-
/>
|
37
|
-
</div>
|
38
|
-
), [defaultSchema, basePdf, scale, token.colorPrimary]);
|
39
|
-
|
40
24
|
return (
|
41
25
|
<div ref={setNodeRef} style={style} {...listeners} {...attributes}>
|
42
|
-
{isDragging &&
|
26
|
+
{isDragging && (
|
27
|
+
<div style={{ transform: `scale(${scale})` }}>
|
28
|
+
<Renderer
|
29
|
+
schema={{ ...defaultSchema, id: defaultSchema.type }}
|
30
|
+
basePdf={basePdf}
|
31
|
+
value={defaultSchema.content || ''}
|
32
|
+
onChangeHoveringSchemaId={() => {
|
33
|
+
void 0;
|
34
|
+
}}
|
35
|
+
mode={'viewer'}
|
36
|
+
outline={`1px solid ${token.colorPrimary}`}
|
37
|
+
scale={scale}
|
38
|
+
/>
|
39
|
+
</div>
|
40
|
+
)}
|
43
41
|
<div style={{ visibility: isDragging ? 'hidden' : 'visible' }}>{props.children}</div>
|
44
42
|
</div>
|
45
43
|
);
|