labellife-design-tool 2.2.3 → 2.2.5
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/cjs/canvas/workspace.js +45 -32
- package/dist/cjs/canvas/workspace.js.map +1 -1
- package/dist/cjs/index.js +78 -38
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/model/store.js +33 -6
- package/dist/cjs/model/store.js.map +1 -1
- package/dist/esm/canvas/workspace.js +46 -33
- package/dist/esm/canvas/workspace.js.map +1 -1
- package/dist/esm/index.js +78 -38
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/model/store.js +33 -6
- package/dist/esm/model/store.js.map +1 -1
- package/package.json +1 -1
|
@@ -2101,6 +2101,32 @@ var InputFieldsDialog = mobxReactLite.observer(function (_ref2) {
|
|
|
2101
2101
|
}
|
|
2102
2102
|
}, [fields.length]);
|
|
2103
2103
|
var totalCount = initialTotalRef.current || fields.length;
|
|
2104
|
+
|
|
2105
|
+
// Back-from-summary: triggered by parent incrementing backTrigger prop
|
|
2106
|
+
// Must be defined and its useEffect called BEFORE any early returns (Rules of Hooks)
|
|
2107
|
+
var handleBackFromSummary = function handleBackFromSummary() {
|
|
2108
|
+
var last = completedHistoryRef.current.pop();
|
|
2109
|
+
if (!last) return;
|
|
2110
|
+
var el = last.el,
|
|
2111
|
+
previousValue = last.previousValue;
|
|
2112
|
+
if (el) {
|
|
2113
|
+
var isImage = el.custom && el.custom.inputType === 'image';
|
|
2114
|
+
el.set(isImage ? {
|
|
2115
|
+
src: previousValue || ''
|
|
2116
|
+
} : {
|
|
2117
|
+
text: previousValue || ''
|
|
2118
|
+
});
|
|
2119
|
+
isGoingBackRef.current = true;
|
|
2120
|
+
store._unresolveInputField(el);
|
|
2121
|
+
}
|
|
2122
|
+
// displayIndex stays unchanged — it already points to the last step (N-1)
|
|
2123
|
+
};
|
|
2124
|
+
react.useEffect(function () {
|
|
2125
|
+
if (backTrigger !== prevBackTriggerRef.current) {
|
|
2126
|
+
prevBackTriggerRef.current = backTrigger;
|
|
2127
|
+
handleBackFromSummary();
|
|
2128
|
+
}
|
|
2129
|
+
}, [backTrigger]);
|
|
2104
2130
|
if (!enabled || fields.length === 0) return null;
|
|
2105
2131
|
|
|
2106
2132
|
// Always show the first remaining field — the array shrinks as fields are resolved
|
|
@@ -2176,31 +2202,6 @@ var InputFieldsDialog = mobxReactLite.observer(function (_ref2) {
|
|
|
2176
2202
|
};
|
|
2177
2203
|
var canGoBack = displayIndex > 0;
|
|
2178
2204
|
|
|
2179
|
-
// Back-from-summary: triggered by parent incrementing backTrigger prop
|
|
2180
|
-
var handleBackFromSummary = function handleBackFromSummary() {
|
|
2181
|
-
var last = completedHistoryRef.current.pop();
|
|
2182
|
-
if (!last) return;
|
|
2183
|
-
var el = last.el,
|
|
2184
|
-
previousValue = last.previousValue;
|
|
2185
|
-
if (el) {
|
|
2186
|
-
var isImage = el.custom && el.custom.inputType === 'image';
|
|
2187
|
-
el.set(isImage ? {
|
|
2188
|
-
src: previousValue || ''
|
|
2189
|
-
} : {
|
|
2190
|
-
text: previousValue || ''
|
|
2191
|
-
});
|
|
2192
|
-
isGoingBackRef.current = true;
|
|
2193
|
-
store._unresolveInputField(el);
|
|
2194
|
-
}
|
|
2195
|
-
// displayIndex stays unchanged — it already points to the last step (N-1)
|
|
2196
|
-
};
|
|
2197
|
-
react.useEffect(function () {
|
|
2198
|
-
if (backTrigger !== prevBackTriggerRef.current) {
|
|
2199
|
-
prevBackTriggerRef.current = backTrigger;
|
|
2200
|
-
handleBackFromSummary();
|
|
2201
|
-
}
|
|
2202
|
-
}, [backTrigger]);
|
|
2203
|
-
|
|
2204
2205
|
// ── Resolve which dialog component to use ───────────────────────────
|
|
2205
2206
|
// Priority: per-type custom dialog > global CustomDialog > built-in
|
|
2206
2207
|
var TYPE_DIALOG_MAP = {
|
|
@@ -2292,7 +2293,7 @@ var CheckerboardBackground = function CheckerboardBackground(_ref) {
|
|
|
2292
2293
|
height: h,
|
|
2293
2294
|
fill: "#ffffff",
|
|
2294
2295
|
listening: false,
|
|
2295
|
-
name: "
|
|
2296
|
+
name: "display-only"
|
|
2296
2297
|
});
|
|
2297
2298
|
return /*#__PURE__*/jsxRuntime.jsx(reactKonva.Rect, {
|
|
2298
2299
|
x: 0,
|
|
@@ -2302,7 +2303,7 @@ var CheckerboardBackground = function CheckerboardBackground(_ref) {
|
|
|
2302
2303
|
fillPatternImage: imgRef.current,
|
|
2303
2304
|
fillPatternRepeat: "repeat",
|
|
2304
2305
|
listening: false,
|
|
2305
|
-
name: "
|
|
2306
|
+
name: "display-only"
|
|
2306
2307
|
});
|
|
2307
2308
|
};
|
|
2308
2309
|
var ImageBackground = function ImageBackground(_ref2) {
|
|
@@ -2386,9 +2387,19 @@ var PageBackground = mobxReactLite.observer(function (_ref3) {
|
|
|
2386
2387
|
});
|
|
2387
2388
|
}
|
|
2388
2389
|
if (bg === 'transparent') {
|
|
2389
|
-
return /*#__PURE__*/jsxRuntime.
|
|
2390
|
-
|
|
2391
|
-
|
|
2390
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2391
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactKonva.Rect, {
|
|
2392
|
+
x: 0,
|
|
2393
|
+
y: 0,
|
|
2394
|
+
width: w,
|
|
2395
|
+
height: h,
|
|
2396
|
+
fill: "#ffffff",
|
|
2397
|
+
listening: false,
|
|
2398
|
+
name: "page-background"
|
|
2399
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CheckerboardBackground, {
|
|
2400
|
+
w: w,
|
|
2401
|
+
h: h
|
|
2402
|
+
})]
|
|
2392
2403
|
});
|
|
2393
2404
|
}
|
|
2394
2405
|
|
|
@@ -2485,7 +2496,8 @@ var PageOverlayFrame = mobxReactLite.observer(function (_ref4) {
|
|
|
2485
2496
|
ctx.fillStrokeShape(shape);
|
|
2486
2497
|
},
|
|
2487
2498
|
fill: "rgba(240,240,240,0.5)",
|
|
2488
|
-
listening: false
|
|
2499
|
+
listening: false,
|
|
2500
|
+
name: "display-only"
|
|
2489
2501
|
});
|
|
2490
2502
|
});
|
|
2491
2503
|
var ALL_ANCHORS = ['top-left', 'top-center', 'top-right', 'middle-left', 'middle-right', 'bottom-left', 'bottom-center', 'bottom-right'];
|
|
@@ -2820,7 +2832,8 @@ var Workspace = mobxReactLite.observer(function (_ref6) {
|
|
|
2820
2832
|
height: store.height,
|
|
2821
2833
|
fill: "rgba(0,0,0,0.1)",
|
|
2822
2834
|
cornerRadius: 0,
|
|
2823
|
-
listening: false
|
|
2835
|
+
listening: false,
|
|
2836
|
+
name: "display-only"
|
|
2824
2837
|
}), /*#__PURE__*/jsxRuntime.jsx(PageBackground, {
|
|
2825
2838
|
store: store
|
|
2826
2839
|
}), page && page.children.map(function (element) {
|