@arbisoft/react-design-tool 1.0.70 → 1.0.72
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/README.md +56 -27
- package/dist/cjs/index.js +392 -82
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +392 -82
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,10 +21,9 @@ Perfect for integrating into applications that require user-driven visual conten
|
|
|
21
21
|
|
|
22
22
|
## 🔔 What’s New
|
|
23
23
|
|
|
24
|
-
- **
|
|
25
|
-
- **Custom
|
|
26
|
-
- **
|
|
27
|
-
- **Backspace no longer triggers browser back navigation**: When an element is selected and the user is not typing in an input/textarea/contenteditable field, pressing **Backspace/Delete** now removes the selected element instead.
|
|
24
|
+
- **Canvas size now supports Preset + Custom (mm)**: You can use standard presets or custom `widthMm`/`heightMm`, with backward compatibility for legacy `pageSize.size` templates.
|
|
25
|
+
- **Custom size input UX updated**: Width/Height fields now include explicit labels and `mm` units, and size updates apply automatically as soon as values are valid (no extra Apply click).
|
|
26
|
+
- **Outside boundary preview tightened**: Default `outsideBoundaryPreviewPadding` is reduced from `120` to `80` for a closer canvas boundary preview.
|
|
28
27
|
- **Image tinting for photos**: New **Tint Color** and **Tint Strength** controls appear only when an image is selected. Tint now starts at 0% and is adjustable to 100%, with a one-click **Remove Tint**.
|
|
29
28
|
- **Auto-placement for QR ID**: When enabled, the QR ID text is **automatically positioned above the Location text** (`LOCATION_ELEMENT_ID`).
|
|
30
29
|
If the Location element doesn’t exist, it’s **centered on the canvas**.
|
|
@@ -68,13 +67,13 @@ yarn add @arbisoft/react-design-tool
|
|
|
68
67
|
#### ⚠️ Important: Installation Guide for React 18 and Below
|
|
69
68
|
|
|
70
69
|
```bash
|
|
71
|
-
npm install @arbisoft/react-design-tool@1.0.
|
|
70
|
+
npm install @arbisoft/react-design-tool@1.0.71
|
|
72
71
|
```
|
|
73
72
|
|
|
74
73
|
OR
|
|
75
74
|
|
|
76
75
|
```bash
|
|
77
|
-
yarn add @arbisoft/react-design-tool@1.0.
|
|
76
|
+
yarn add @arbisoft/react-design-tool@1.0.71
|
|
78
77
|
|
|
79
78
|
```
|
|
80
79
|
|
|
@@ -119,6 +118,12 @@ export default function MyComponent() {
|
|
|
119
118
|
saveButtonText="Save Progress"
|
|
120
119
|
locale="en"
|
|
121
120
|
zoomLevel={100}
|
|
121
|
+
canvasSize={{ mode: 'preset', preset: 'A4' }}
|
|
122
|
+
onCanvasSizeChange={(size) => {
|
|
123
|
+
console.log('canvasSize changed:', size);
|
|
124
|
+
}}
|
|
125
|
+
showOutsideBoundaryPreview
|
|
126
|
+
outsideBoundaryPreviewPadding={80}
|
|
122
127
|
/>
|
|
123
128
|
</>
|
|
124
129
|
);
|
|
@@ -158,19 +163,6 @@ customTemplatesList={[
|
|
|
158
163
|
]}
|
|
159
164
|
```
|
|
160
165
|
|
|
161
|
-
#### `templatesDisplayOrder` (String)
|
|
162
|
-
|
|
163
|
-
Controls the display order of template groups in the sidebar.
|
|
164
|
-
|
|
165
|
-
- `'defaultFirst'` (default): **Default** templates first, then **Custom Templates**
|
|
166
|
-
- `'customFirst'`: **Custom Templates** first, then **Default**
|
|
167
|
-
|
|
168
|
-
**Example:**
|
|
169
|
-
|
|
170
|
-
```jsx
|
|
171
|
-
<Studio templatesDisplayOrder="customFirst" />
|
|
172
|
-
```
|
|
173
|
-
|
|
174
166
|
#### 3. `defaultImages` (Array of URLs)
|
|
175
167
|
|
|
176
168
|
System-provided stock images.
|
|
@@ -463,9 +455,41 @@ Used to set configure allowed images formats for our gallert
|
|
|
463
455
|
<Studio allowedFormats={['png', 'jpg']} />
|
|
464
456
|
```
|
|
465
457
|
|
|
466
|
-
#### `
|
|
458
|
+
#### 24. `canvasSize` (Object)
|
|
459
|
+
|
|
460
|
+
Set the initial/controlled canvas size in either `preset` or `custom` mode.
|
|
467
461
|
|
|
468
|
-
|
|
462
|
+
- `preset` mode example: `{ mode: 'preset', preset: 'A4' }`
|
|
463
|
+
- `custom` mode example: `{ mode: 'custom', widthMm: 100, heightMm: 100 }`
|
|
464
|
+
|
|
465
|
+
Legacy templates with `{ type: 'pageSize', size: 'A4' }` are still supported.
|
|
466
|
+
|
|
467
|
+
**Example:**
|
|
468
|
+
|
|
469
|
+
```jsx
|
|
470
|
+
<Studio canvasSize={{ mode: 'custom', widthMm: 120, heightMm: 80 }} />
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
#### 25. `onCanvasSizeChange` (Function)
|
|
474
|
+
|
|
475
|
+
Callback fired whenever canvas size changes from the editor (preset or custom).
|
|
476
|
+
|
|
477
|
+
**Example:**
|
|
478
|
+
|
|
479
|
+
```jsx
|
|
480
|
+
<Studio
|
|
481
|
+
onCanvasSizeChange={(size) => {
|
|
482
|
+
// size is either:
|
|
483
|
+
// { mode: 'preset', preset: 'A4' }
|
|
484
|
+
// or { mode: 'custom', widthMm: 120, heightMm: 80 }
|
|
485
|
+
console.log(size);
|
|
486
|
+
}}
|
|
487
|
+
/>
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
#### 26. `showOutsideBoundaryPreview` (Boolean)
|
|
491
|
+
|
|
492
|
+
Shows extra stage area around the page so users can preview outside-page objects.
|
|
469
493
|
|
|
470
494
|
**Example:**
|
|
471
495
|
|
|
@@ -473,19 +497,24 @@ Enables a padded outside-canvas preview area around the page.
|
|
|
473
497
|
<Studio showOutsideBoundaryPreview />
|
|
474
498
|
```
|
|
475
499
|
|
|
476
|
-
#### `outsideBoundaryPreviewPadding` (Number)
|
|
500
|
+
#### 27. `outsideBoundaryPreviewPadding` (Number)
|
|
477
501
|
|
|
478
|
-
|
|
502
|
+
Controls the outside preview spacing in pixels when `showOutsideBoundaryPreview` is enabled.
|
|
503
|
+
|
|
504
|
+
- Default: `80`
|
|
479
505
|
|
|
480
506
|
**Example:**
|
|
481
507
|
|
|
482
508
|
```jsx
|
|
483
|
-
<Studio
|
|
509
|
+
<Studio
|
|
510
|
+
showOutsideBoundaryPreview
|
|
511
|
+
outsideBoundaryPreviewPadding={64}
|
|
512
|
+
/>
|
|
484
513
|
```
|
|
485
514
|
|
|
486
515
|
## 🆕 (Updated) QR ID Controls
|
|
487
516
|
|
|
488
|
-
###
|
|
517
|
+
### 28. `showQrIdToggle` (boolean)
|
|
489
518
|
|
|
490
519
|
Shows the **“Show QR ID”** toggle in the sidebar.
|
|
491
520
|
|
|
@@ -493,7 +522,7 @@ Shows the **“Show QR ID”** toggle in the sidebar.
|
|
|
493
522
|
<Studio showQrIdToggle />
|
|
494
523
|
```
|
|
495
524
|
|
|
496
|
-
####
|
|
525
|
+
#### 29. `qrId` (String | Number)
|
|
497
526
|
|
|
498
527
|
The value rendered in the QR ID text when the toggle is ON.
|
|
499
528
|
|
|
@@ -504,7 +533,7 @@ The value rendered in the QR ID text when the toggle is ON.
|
|
|
504
533
|
qrId="FA-98231"
|
|
505
534
|
/>
|
|
506
535
|
```
|
|
507
|
-
####
|
|
536
|
+
#### 30. `qrIdText` (**deprecated for placement**)
|
|
508
537
|
|
|
509
538
|
> **Deprecated for positioning.**
|
|
510
539
|
> The QR ID position is now **computed automatically**:
|