labellife-design-tool 1.3.7 → 1.3.9
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/lib/lib/index.js
CHANGED
|
@@ -2716,6 +2716,33 @@ var RightSidebar = ({
|
|
|
2716
2716
|
var RightSidebar_default = RightSidebar;
|
|
2717
2717
|
|
|
2718
2718
|
// src/CanvasEditor.tsx
|
|
2719
|
+
var renderComponentSafely = (Component, props, fallbackMessage = "Component render failed") => {
|
|
2720
|
+
if (typeof React17 === "undefined") {
|
|
2721
|
+
console.error("labellife-design-tool: React not available");
|
|
2722
|
+
return React17.createElement("div", {
|
|
2723
|
+
className: "text-red-400 text-center p-4",
|
|
2724
|
+
children: "React not available"
|
|
2725
|
+
});
|
|
2726
|
+
}
|
|
2727
|
+
const reactVersion = React17.version;
|
|
2728
|
+
if (reactVersion && !reactVersion.startsWith("18.")) {
|
|
2729
|
+
console.warn("labellife-design-tool: React 18.x recommended, found:", reactVersion);
|
|
2730
|
+
}
|
|
2731
|
+
try {
|
|
2732
|
+
return React17.createElement(Component, props);
|
|
2733
|
+
} catch (jsxError) {
|
|
2734
|
+
console.warn("labellife-design-tool: JSX rendering failed, trying React.createElement:", jsxError);
|
|
2735
|
+
try {
|
|
2736
|
+
return React17.createElement(Component, props);
|
|
2737
|
+
} catch (createElementError) {
|
|
2738
|
+
console.error("labellife-design-tool: Both JSX and React.createElement failed:", createElementError);
|
|
2739
|
+
return React17.createElement("div", {
|
|
2740
|
+
className: "text-red-400 text-center p-4",
|
|
2741
|
+
children: fallbackMessage
|
|
2742
|
+
});
|
|
2743
|
+
}
|
|
2744
|
+
}
|
|
2745
|
+
};
|
|
2719
2746
|
var CanvasEditor = forwardRef(({ name, config, store }, ref) => {
|
|
2720
2747
|
if (!store) {
|
|
2721
2748
|
console.error("CanvasEditor: store prop is required but was not provided");
|
|
@@ -2943,10 +2970,16 @@ var CanvasEditor = forwardRef(({ name, config, store }, ref) => {
|
|
|
2943
2970
|
}, "Invalid panel component");
|
|
2944
2971
|
}
|
|
2945
2972
|
console.log("DynamicPanelRenderer: Rendering panel:", activePanel.id);
|
|
2946
|
-
|
|
2973
|
+
console.log("About to render with component:", {
|
|
2974
|
+
component: PanelComponent,
|
|
2975
|
+
componentType: typeof PanelComponent,
|
|
2976
|
+
isFunction: typeof PanelComponent === "function",
|
|
2977
|
+
componentName: PanelComponent.name || "anonymous"
|
|
2978
|
+
});
|
|
2979
|
+
return renderComponentSafely(PanelComponent, {
|
|
2947
2980
|
key: activePanel.id,
|
|
2948
2981
|
...activePanel.props
|
|
2949
|
-
});
|
|
2982
|
+
}, `Failed to render panel: ${activePanel.id}`);
|
|
2950
2983
|
}, [panelConfigs, store.activePanelId]);
|
|
2951
2984
|
const handleImageUpload = useCallback4((e) => {
|
|
2952
2985
|
const file = e.target.files?.[0];
|
package/dist/lib/wordpress.js
CHANGED
|
@@ -2716,6 +2716,33 @@ var RightSidebar = ({
|
|
|
2716
2716
|
var RightSidebar_default = RightSidebar;
|
|
2717
2717
|
|
|
2718
2718
|
// src/CanvasEditor.tsx
|
|
2719
|
+
var renderComponentSafely = (Component, props, fallbackMessage = "Component render failed") => {
|
|
2720
|
+
if (typeof React17 === "undefined") {
|
|
2721
|
+
console.error("labellife-design-tool: React not available");
|
|
2722
|
+
return React17.createElement("div", {
|
|
2723
|
+
className: "text-red-400 text-center p-4",
|
|
2724
|
+
children: "React not available"
|
|
2725
|
+
});
|
|
2726
|
+
}
|
|
2727
|
+
const reactVersion = React17.version;
|
|
2728
|
+
if (reactVersion && !reactVersion.startsWith("18.")) {
|
|
2729
|
+
console.warn("labellife-design-tool: React 18.x recommended, found:", reactVersion);
|
|
2730
|
+
}
|
|
2731
|
+
try {
|
|
2732
|
+
return React17.createElement(Component, props);
|
|
2733
|
+
} catch (jsxError) {
|
|
2734
|
+
console.warn("labellife-design-tool: JSX rendering failed, trying React.createElement:", jsxError);
|
|
2735
|
+
try {
|
|
2736
|
+
return React17.createElement(Component, props);
|
|
2737
|
+
} catch (createElementError) {
|
|
2738
|
+
console.error("labellife-design-tool: Both JSX and React.createElement failed:", createElementError);
|
|
2739
|
+
return React17.createElement("div", {
|
|
2740
|
+
className: "text-red-400 text-center p-4",
|
|
2741
|
+
children: fallbackMessage
|
|
2742
|
+
});
|
|
2743
|
+
}
|
|
2744
|
+
}
|
|
2745
|
+
};
|
|
2719
2746
|
var CanvasEditor = forwardRef(({ name, config, store }, ref) => {
|
|
2720
2747
|
if (!store) {
|
|
2721
2748
|
console.error("CanvasEditor: store prop is required but was not provided");
|
|
@@ -2943,10 +2970,16 @@ var CanvasEditor = forwardRef(({ name, config, store }, ref) => {
|
|
|
2943
2970
|
}, "Invalid panel component");
|
|
2944
2971
|
}
|
|
2945
2972
|
console.log("DynamicPanelRenderer: Rendering panel:", activePanel.id);
|
|
2946
|
-
|
|
2973
|
+
console.log("About to render with component:", {
|
|
2974
|
+
component: PanelComponent,
|
|
2975
|
+
componentType: typeof PanelComponent,
|
|
2976
|
+
isFunction: typeof PanelComponent === "function",
|
|
2977
|
+
componentName: PanelComponent.name || "anonymous"
|
|
2978
|
+
});
|
|
2979
|
+
return renderComponentSafely(PanelComponent, {
|
|
2947
2980
|
key: activePanel.id,
|
|
2948
2981
|
...activePanel.props
|
|
2949
|
-
});
|
|
2982
|
+
}, `Failed to render panel: ${activePanel.id}`);
|
|
2950
2983
|
}, [panelConfigs, store.activePanelId]);
|
|
2951
2984
|
const handleImageUpload = useCallback4((e) => {
|
|
2952
2985
|
const file = e.target.files?.[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasEditor.d.ts","sourceRoot":"","sources":["../../src/CanvasEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmF,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CanvasEditor.d.ts","sourceRoot":"","sources":["../../src/CanvasEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmF,MAAM,OAAO,CAAC;AAmHxG,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAqB,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,QAAA,MAAM,YAAY;UAAuC,MAAM;aAAW,MAAM;WAAS,iBAAiB;yCA2jBxG,CAAC;AAIH,eAAe,YAAY,CAAC"}
|
package/package.json
CHANGED