labellife-design-tool 1.3.3 → 1.3.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.
@@ -2721,6 +2721,12 @@ var CanvasEditor = forwardRef(({ name, config, store }, ref) => {
2721
2721
  console.error("CanvasEditor: store prop is required but was not provided");
2722
2722
  return /* @__PURE__ */ React17.createElement("div", null, "Error: Store is required");
2723
2723
  }
2724
+ console.log("CanvasEditor store state:", {
2725
+ activePanelId: store.activePanelId,
2726
+ hasDesign: !!store.design,
2727
+ designPages: store.design?.pages?.length || 0,
2728
+ activePageId: store.activePageId
2729
+ });
2724
2730
  const stageRef = useRef4(null);
2725
2731
  const fileInputRef = useRef4(null);
2726
2732
  const jsonInputRef = useRef4(null);
@@ -2852,10 +2858,20 @@ var CanvasEditor = forwardRef(({ name, config, store }, ref) => {
2852
2858
  variables: { id: "variables", title: "Variables", component: VariablesPanel_default, props: { config: config || {}, design: store.design, setDesign: (design) => store.setDesign(design) } },
2853
2859
  export: { id: "export", title: "Export", component: ExportPanel_default, props: { onExportToPNG: handleExportPNG, onExportToJPG: handleExportJPG, onExportToJSON: handleExportJSON, onImportJSON: handleImportJSON } }
2854
2860
  };
2861
+ console.log("Built-in panels:", Object.entries(builtInConfigs).map(([id, config2]) => ({
2862
+ id,
2863
+ componentType: typeof config2.component,
2864
+ componentName: config2.component.name || "anonymous"
2865
+ })));
2855
2866
  const mergedConfigs = { ...builtInConfigs };
2856
2867
  if (config?.panels) {
2857
2868
  config.panels.forEach((panelConfig) => {
2858
2869
  if (typeof panelConfig === "string") {} else {
2870
+ console.log("Processing custom panel:", panelConfig.id, panelConfig);
2871
+ if (typeof panelConfig.component !== "function") {
2872
+ console.error("Invalid panel component for", panelConfig.id, panelConfig.component);
2873
+ return;
2874
+ }
2859
2875
  const customPanelConfig = {
2860
2876
  id: panelConfig.id,
2861
2877
  title: panelConfig.title,
@@ -2884,16 +2900,31 @@ var CanvasEditor = forwardRef(({ name, config, store }, ref) => {
2884
2900
  return orderedConfigs.length > 0 ? orderedConfigs : Object.values(builtInConfigs);
2885
2901
  }, [addShape, addText, config, selectedElement, updateElement, store, currentPage, handleExportPNG, handleExportJPG, handleExportJSON, handleImportJSON]);
2886
2902
  const DynamicPanelRenderer = useMemo(() => {
2887
- const activePanel = panelConfigs.find((panel) => panel.id === store.activePanelId);
2888
- if (!activePanel)
2903
+ const activePanelId = store.activePanelId;
2904
+ console.log("DynamicPanelRenderer: activePanelId =", activePanelId);
2905
+ console.log("DynamicPanelRenderer: available panels =", panelConfigs.map((p) => ({ id: p.id, component: typeof p.component })));
2906
+ const activePanel = panelConfigs.find((panel) => panel.id === activePanelId);
2907
+ if (!activePanel) {
2908
+ console.log("DynamicPanelRenderer: No active panel found, returning fallback");
2889
2909
  return /* @__PURE__ */ React17.createElement("div", {
2890
2910
  className: "text-gray-400 text-center p-4"
2891
2911
  }, "No panel selected");
2912
+ }
2913
+ console.log("DynamicPanelRenderer: Found active panel:", activePanel.id, typeof activePanel.component);
2892
2914
  const PanelComponent = activePanel.component;
2893
- if (!PanelComponent)
2915
+ if (!PanelComponent) {
2916
+ console.log("DynamicPanelRenderer: PanelComponent is null/undefined");
2894
2917
  return /* @__PURE__ */ React17.createElement("div", {
2895
2918
  className: "text-red-400 text-center p-4"
2896
2919
  }, "Panel component not found");
2920
+ }
2921
+ if (typeof PanelComponent !== "function") {
2922
+ console.error("DynamicPanelRenderer: PanelComponent is not a function:", PanelComponent);
2923
+ return /* @__PURE__ */ React17.createElement("div", {
2924
+ className: "text-red-400 text-center p-4"
2925
+ }, "Invalid panel component");
2926
+ }
2927
+ console.log("DynamicPanelRenderer: Rendering panel:", activePanel.id);
2897
2928
  return /* @__PURE__ */ React17.createElement(PanelComponent, {
2898
2929
  key: activePanel.id,
2899
2930
  ...activePanel.props
@@ -2721,6 +2721,12 @@ var CanvasEditor = forwardRef(({ name, config, store }, ref) => {
2721
2721
  console.error("CanvasEditor: store prop is required but was not provided");
2722
2722
  return /* @__PURE__ */ React17.createElement("div", null, "Error: Store is required");
2723
2723
  }
2724
+ console.log("CanvasEditor store state:", {
2725
+ activePanelId: store.activePanelId,
2726
+ hasDesign: !!store.design,
2727
+ designPages: store.design?.pages?.length || 0,
2728
+ activePageId: store.activePageId
2729
+ });
2724
2730
  const stageRef = useRef4(null);
2725
2731
  const fileInputRef = useRef4(null);
2726
2732
  const jsonInputRef = useRef4(null);
@@ -2852,10 +2858,20 @@ var CanvasEditor = forwardRef(({ name, config, store }, ref) => {
2852
2858
  variables: { id: "variables", title: "Variables", component: VariablesPanel_default, props: { config: config || {}, design: store.design, setDesign: (design) => store.setDesign(design) } },
2853
2859
  export: { id: "export", title: "Export", component: ExportPanel_default, props: { onExportToPNG: handleExportPNG, onExportToJPG: handleExportJPG, onExportToJSON: handleExportJSON, onImportJSON: handleImportJSON } }
2854
2860
  };
2861
+ console.log("Built-in panels:", Object.entries(builtInConfigs).map(([id, config2]) => ({
2862
+ id,
2863
+ componentType: typeof config2.component,
2864
+ componentName: config2.component.name || "anonymous"
2865
+ })));
2855
2866
  const mergedConfigs = { ...builtInConfigs };
2856
2867
  if (config?.panels) {
2857
2868
  config.panels.forEach((panelConfig) => {
2858
2869
  if (typeof panelConfig === "string") {} else {
2870
+ console.log("Processing custom panel:", panelConfig.id, panelConfig);
2871
+ if (typeof panelConfig.component !== "function") {
2872
+ console.error("Invalid panel component for", panelConfig.id, panelConfig.component);
2873
+ return;
2874
+ }
2859
2875
  const customPanelConfig = {
2860
2876
  id: panelConfig.id,
2861
2877
  title: panelConfig.title,
@@ -2884,16 +2900,31 @@ var CanvasEditor = forwardRef(({ name, config, store }, ref) => {
2884
2900
  return orderedConfigs.length > 0 ? orderedConfigs : Object.values(builtInConfigs);
2885
2901
  }, [addShape, addText, config, selectedElement, updateElement, store, currentPage, handleExportPNG, handleExportJPG, handleExportJSON, handleImportJSON]);
2886
2902
  const DynamicPanelRenderer = useMemo(() => {
2887
- const activePanel = panelConfigs.find((panel) => panel.id === store.activePanelId);
2888
- if (!activePanel)
2903
+ const activePanelId = store.activePanelId;
2904
+ console.log("DynamicPanelRenderer: activePanelId =", activePanelId);
2905
+ console.log("DynamicPanelRenderer: available panels =", panelConfigs.map((p) => ({ id: p.id, component: typeof p.component })));
2906
+ const activePanel = panelConfigs.find((panel) => panel.id === activePanelId);
2907
+ if (!activePanel) {
2908
+ console.log("DynamicPanelRenderer: No active panel found, returning fallback");
2889
2909
  return /* @__PURE__ */ React17.createElement("div", {
2890
2910
  className: "text-gray-400 text-center p-4"
2891
2911
  }, "No panel selected");
2912
+ }
2913
+ console.log("DynamicPanelRenderer: Found active panel:", activePanel.id, typeof activePanel.component);
2892
2914
  const PanelComponent = activePanel.component;
2893
- if (!PanelComponent)
2915
+ if (!PanelComponent) {
2916
+ console.log("DynamicPanelRenderer: PanelComponent is null/undefined");
2894
2917
  return /* @__PURE__ */ React17.createElement("div", {
2895
2918
  className: "text-red-400 text-center p-4"
2896
2919
  }, "Panel component not found");
2920
+ }
2921
+ if (typeof PanelComponent !== "function") {
2922
+ console.error("DynamicPanelRenderer: PanelComponent is not a function:", PanelComponent);
2923
+ return /* @__PURE__ */ React17.createElement("div", {
2924
+ className: "text-red-400 text-center p-4"
2925
+ }, "Invalid panel component");
2926
+ }
2927
+ console.log("DynamicPanelRenderer: Rendering panel:", activePanel.id);
2897
2928
  return /* @__PURE__ */ React17.createElement(PanelComponent, {
2898
2929
  key: activePanel.id,
2899
2930
  ...activePanel.props
@@ -1 +1 @@
1
- {"version":3,"file":"CanvasEditor.d.ts","sourceRoot":"","sources":["../../src/CanvasEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmF,MAAM,OAAO,CAAC;AA4ExG,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;yCA+exG,CAAC;AAIH,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"CanvasEditor.d.ts","sourceRoot":"","sources":["../../src/CanvasEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmF,MAAM,OAAO,CAAC;AA4ExG,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;yCAwhBxG,CAAC;AAIH,eAAe,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "labellife-design-tool",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Professional canvas editor built with React, TypeScript, and Konva",
5
5
  "main": "./dist/lib/lib/index.js",
6
6
  "module": "./dist/lib/lib/index.js",