labellife-design-tool 0.6.0 → 0.8.0

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 CHANGED
@@ -13,6 +13,7 @@ Professional canvas editor built with React, TypeScript, and Konva.js. A powerfu
13
13
  - 📤 **Export Options** - Export to PNG, JPG, or JSON
14
14
  - 📥 **Template Import** - Import JSON templates with user input collection
15
15
  - 🌐 **i18n Support** - Internationalization support (English, Dutch)
16
+ - 🧩 **Customizable UI** - Fully customizable navbar with support for custom sections
16
17
  - ⚙️ **Configurable** - Customize features, panels, and behavior
17
18
 
18
19
  ## Installation
@@ -91,27 +92,6 @@ function MyEditor() {
91
92
  }
92
93
  ```
93
94
 
94
- ## Development
95
-
96
- To run the development server:
97
-
98
- ```bash
99
- bun install
100
- bun dev
101
- ```
102
-
103
- To build the library:
104
-
105
- ```bash
106
- bun run build:lib:all
107
- ```
108
-
109
- To build the app:
110
-
111
- ```bash
112
- bun run build:app
113
- ```
114
-
115
95
  ### Canvas to Blob Export
116
96
 
117
97
  The library provides a flexible `canvasToBlob` function that allows converting the canvas to a Blob for various use cases:
@@ -159,6 +139,68 @@ The `canvasToBlob` function parameters:
159
139
  - `quality`: Quality for JPG format (0-1)
160
140
  - `pixelRatio`: Resolution multiplier (default: 2)
161
141
 
142
+ ### Navbar Customization
143
+
144
+ You can fully customize the navbar by configuring the `navbar` property in the config object:
145
+
146
+ ```tsx
147
+ import { CanvasEditor } from 'labellife-design-tool';
148
+
149
+ function App() {
150
+ return (
151
+ <CanvasEditor
152
+ name="My Design Tool"
153
+ config={{
154
+ // Other configuration options...
155
+ navbar: {
156
+ // Control visibility of default sections
157
+ showAppName: true, // Show/hide the app name on the left
158
+ showHistoryControls: true, // Show/hide undo/redo controls
159
+ showZoomControls: true, // Show/hide zoom controls
160
+
161
+ // Override default sections
162
+ defaultSections: {
163
+ appName: {
164
+ label: "My Custom Tool Name", // Change the default app name
165
+ }
166
+ },
167
+
168
+ // Add custom sections to the navbar
169
+ customSections: [
170
+ {
171
+ id: "saveButton",
172
+ type: "custom",
173
+ position: "right", // 'left', 'center', or 'right'
174
+ label: "Save",
175
+ icon: "💾", // Optional icon
176
+ onClick: () => saveProject(),
177
+ order: 5 // Controls the ordering of sections (lower numbers come first)
178
+ },
179
+ {
180
+ id: "helpLink",
181
+ type: "custom",
182
+ position: "right",
183
+ label: "Help",
184
+ icon: "❓",
185
+ onClick: () => showHelpModal(),
186
+ order: 40
187
+ },
188
+ // For complex custom sections, you can provide a React component
189
+ {
190
+ id: "customDropdown",
191
+ type: "custom",
192
+ position: "right",
193
+ content: <CustomDropdownComponent />,
194
+ order: 50
195
+ }
196
+ ]
197
+ }
198
+ }}
199
+ />
200
+ );
201
+ }
202
+ ```
203
+
162
204
  ## Project Structure
163
205
 
164
206
  - `src/lib/index.ts` - Library entry point (npm package)
@@ -1 +1 @@
1
- {"version":3,"file":"CanvasEditor.d.ts","sourceRoot":"","sources":["../../src/CanvasEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAmFxE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CA68B7D,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"CanvasEditor.d.ts","sourceRoot":"","sources":["../../src/CanvasEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAmFxE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CA88B7D,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ActivePanelId } from '../types';
3
+ import { NavbarConfig } from '../types/Config';
3
4
  export interface HeaderProps {
4
5
  name?: string;
5
6
  zoom: number;
@@ -11,6 +12,7 @@ export interface HeaderProps {
11
12
  onZoomOut: () => void;
12
13
  onZoomReset: () => void;
13
14
  onSetActivePanel: (panel: ActivePanelId | "export") => void;
15
+ navbarConfig?: NavbarConfig;
14
16
  }
15
17
  export declare const Header: React.FC<HeaderProps>;
16
18
  export default Header;
@@ -1 +1 @@
1
- {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,gBAAgB,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,QAAQ,KAAK,IAAI,CAAC;CAC7D;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA0DxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAiB,MAAM,iBAAiB,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,gBAAgB,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,QAAQ,KAAK,IAAI,CAAC;IAC5D,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAgKxC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,4 +1,7 @@
1
1
  import React from "react";
2
- declare const AppName: React.FC;
2
+ interface AppNameProps {
3
+ customName?: string;
4
+ }
5
+ declare const AppName: React.FC<AppNameProps>;
3
6
  export default AppName;
4
7
  //# sourceMappingURL=AppName.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppName.d.ts","sourceRoot":"","sources":["../../../../src/components/header/AppName.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAGpB,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"AppName.d.ts","sourceRoot":"","sources":["../../../../src/components/header/AppName.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAEnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -260,6 +260,9 @@
260
260
  .mt-6 {
261
261
  margin-top: calc(var(--spacing) * 6);
262
262
  }
263
+ .mr-1 {
264
+ margin-right: calc(var(--spacing) * 1);
265
+ }
263
266
  .mr-2 {
264
267
  margin-right: calc(var(--spacing) * 2);
265
268
  }
package/dist/lib/index.js CHANGED
@@ -892,19 +892,17 @@ function getUnsplashAccessKey() {
892
892
  }
893
893
 
894
894
  // src/components/header/AppName.tsx
895
- import { useTranslation } from "react-i18next";
896
895
  import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
897
- var AppName = () => {
898
- const { t } = useTranslation();
896
+ var AppName = ({ customName }) => {
899
897
  return /* @__PURE__ */ jsxDEV4("h1", {
900
898
  className: "text-white font-bold text-lg",
901
- children: t("Editor.app_name")
899
+ children: customName || "Label Life"
902
900
  }, undefined, false, undefined, this);
903
901
  };
904
902
  var AppName_default = AppName;
905
903
 
906
904
  // src/components/header/HistoryControls.tsx
907
- import { useTranslation as useTranslation2 } from "react-i18next";
905
+ import { useTranslation } from "react-i18next";
908
906
  import { Undo, Redo } from "lucide-react";
909
907
  import { jsxDEV as jsxDEV5, Fragment as Fragment4 } from "react/jsx-dev-runtime";
910
908
  var HistoryControls = ({
@@ -913,7 +911,7 @@ var HistoryControls = ({
913
911
  onUndo,
914
912
  onRedo
915
913
  }) => {
916
- const { t } = useTranslation2();
914
+ const { t } = useTranslation();
917
915
  return /* @__PURE__ */ jsxDEV5(Fragment4, {
918
916
  children: [
919
917
  /* @__PURE__ */ jsxDEV5("button", {
@@ -940,7 +938,7 @@ var HistoryControls = ({
940
938
  var HistoryControls_default = HistoryControls;
941
939
 
942
940
  // src/components/header/ZoomControls.tsx
943
- import { useTranslation as useTranslation3 } from "react-i18next";
941
+ import { useTranslation as useTranslation2 } from "react-i18next";
944
942
  import { ZoomIn, ZoomOut, Maximize2 } from "lucide-react";
945
943
  import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
946
944
  var ZoomControls = ({
@@ -949,7 +947,7 @@ var ZoomControls = ({
949
947
  onZoomOut,
950
948
  onZoomReset
951
949
  }) => {
952
- const { t } = useTranslation3();
950
+ const { t } = useTranslation2();
953
951
  return /* @__PURE__ */ jsxDEV6("div", {
954
952
  className: "flex items-center space-x-1 bg-gray-700 rounded px-2 py-1",
955
953
  children: [
@@ -1000,47 +998,124 @@ var Header = ({
1000
998
  onRedo,
1001
999
  onZoomIn,
1002
1000
  onZoomOut,
1003
- onZoomReset
1001
+ onZoomReset,
1002
+ navbarConfig,
1003
+ onSetActivePanel
1004
1004
  }) => {
1005
1005
  const isLightTheme = name?.includes("(Light Theme)");
1006
1006
  const headerStyle = {
1007
1007
  backgroundColor: isLightTheme ? "#f8fafc" : "#1f2937",
1008
1008
  borderBottomColor: isLightTheme ? "#cbd5e1" : "#374151"
1009
1009
  };
1010
+ const defaultSections = [
1011
+ {
1012
+ id: "appName",
1013
+ type: "default",
1014
+ position: "left",
1015
+ visible: navbarConfig?.showAppName !== false,
1016
+ content: /* @__PURE__ */ jsxDEV7(AppName_default, {
1017
+ customName: navbarConfig?.defaultSections?.appName?.label
1018
+ }, undefined, false, undefined, this),
1019
+ order: 10
1020
+ },
1021
+ {
1022
+ id: "title",
1023
+ type: "default",
1024
+ position: "center",
1025
+ visible: !!name,
1026
+ content: /* @__PURE__ */ jsxDEV7("div", {
1027
+ className: "flex-1 text-center text-lg font-semibold",
1028
+ style: { color: isLightTheme ? "#0f172a" : "#ffffff" },
1029
+ children: name
1030
+ }, undefined, false, undefined, this),
1031
+ order: 10
1032
+ },
1033
+ {
1034
+ id: "historyControls",
1035
+ type: "default",
1036
+ position: "right",
1037
+ visible: navbarConfig?.showHistoryControls !== false,
1038
+ content: /* @__PURE__ */ jsxDEV7(HistoryControls_default, {
1039
+ historyIndex,
1040
+ historyLength,
1041
+ onUndo,
1042
+ onRedo
1043
+ }, undefined, false, undefined, this),
1044
+ order: 10
1045
+ },
1046
+ {
1047
+ id: "divider",
1048
+ type: "default",
1049
+ position: "right",
1050
+ visible: navbarConfig?.showHistoryControls !== false && navbarConfig?.showZoomControls !== false,
1051
+ content: /* @__PURE__ */ jsxDEV7("div", {
1052
+ className: "border-l mx-2 h-6",
1053
+ style: { borderLeftColor: isLightTheme ? "#cbd5e1" : "#374151" }
1054
+ }, undefined, false, undefined, this),
1055
+ order: 20
1056
+ },
1057
+ {
1058
+ id: "zoomControls",
1059
+ type: "default",
1060
+ position: "right",
1061
+ visible: navbarConfig?.showZoomControls !== false,
1062
+ content: /* @__PURE__ */ jsxDEV7(ZoomControls_default, {
1063
+ zoom,
1064
+ onZoomIn,
1065
+ onZoomOut,
1066
+ onZoomReset
1067
+ }, undefined, false, undefined, this),
1068
+ order: 30
1069
+ }
1070
+ ];
1071
+ const mergedSections = [...defaultSections];
1072
+ if (navbarConfig?.customSections && navbarConfig.customSections.length > 0) {
1073
+ mergedSections.push(...navbarConfig.customSections);
1074
+ }
1075
+ const leftSections = mergedSections.filter((section) => section.position === "left" && section.visible !== false).sort((a, b) => (a.order || 0) - (b.order || 0));
1076
+ const centerSections = mergedSections.filter((section) => section.position === "center" && section.visible !== false).sort((a, b) => (a.order || 0) - (b.order || 0));
1077
+ const rightSections = mergedSections.filter((section) => section.position === "right" && section.visible !== false).sort((a, b) => (a.order || 0) - (b.order || 0));
1078
+ const renderSection = (section) => {
1079
+ if (typeof section.content === "function") {
1080
+ return section.content();
1081
+ }
1082
+ if (section.content) {
1083
+ return section.content;
1084
+ }
1085
+ return /* @__PURE__ */ jsxDEV7("button", {
1086
+ onClick: section.onClick,
1087
+ className: "text-gray-400 hover:text-white p-2",
1088
+ children: [
1089
+ section.icon && /* @__PURE__ */ jsxDEV7("span", {
1090
+ className: "mr-1",
1091
+ children: section.icon
1092
+ }, undefined, false, undefined, this),
1093
+ section.label
1094
+ ]
1095
+ }, section.id, true, undefined, this);
1096
+ };
1010
1097
  return /* @__PURE__ */ jsxDEV7("div", {
1011
1098
  className: "px-4 py-2 flex items-center justify-between",
1012
1099
  style: headerStyle,
1013
1100
  children: [
1014
1101
  /* @__PURE__ */ jsxDEV7("div", {
1015
1102
  className: "flex items-center space-x-4",
1016
- children: /* @__PURE__ */ jsxDEV7(AppName_default, {}, undefined, false, undefined, this)
1103
+ children: leftSections.map((section) => /* @__PURE__ */ jsxDEV7("div", {
1104
+ children: renderSection(section)
1105
+ }, section.id, false, undefined, this))
1017
1106
  }, undefined, false, undefined, this),
1018
- name && /* @__PURE__ */ jsxDEV7("div", {
1019
- className: "flex-1 text-center text-lg font-semibold",
1020
- style: { color: isLightTheme ? "#0f172a" : "#ffffff" },
1021
- children: name
1107
+ /* @__PURE__ */ jsxDEV7("div", {
1108
+ className: "flex-1 flex justify-center",
1109
+ children: centerSections.map((section) => /* @__PURE__ */ jsxDEV7("div", {
1110
+ children: renderSection(section)
1111
+ }, section.id, false, undefined, this))
1022
1112
  }, undefined, false, undefined, this),
1023
1113
  /* @__PURE__ */ jsxDEV7("div", {
1024
1114
  className: "flex items-center space-x-2",
1025
- children: [
1026
- /* @__PURE__ */ jsxDEV7(HistoryControls_default, {
1027
- historyIndex,
1028
- historyLength,
1029
- onUndo,
1030
- onRedo
1031
- }, undefined, false, undefined, this),
1032
- /* @__PURE__ */ jsxDEV7("div", {
1033
- className: "border-l mx-2 h-6",
1034
- style: { borderLeftColor: isLightTheme ? "#cbd5e1" : "#374151" }
1035
- }, undefined, false, undefined, this),
1036
- /* @__PURE__ */ jsxDEV7(ZoomControls_default, {
1037
- zoom,
1038
- onZoomIn,
1039
- onZoomOut,
1040
- onZoomReset
1041
- }, undefined, false, undefined, this)
1042
- ]
1043
- }, undefined, true, undefined, this)
1115
+ children: rightSections.map((section) => /* @__PURE__ */ jsxDEV7("div", {
1116
+ children: renderSection(section)
1117
+ }, section.id, false, undefined, this))
1118
+ }, undefined, false, undefined, this)
1044
1119
  ]
1045
1120
  }, undefined, true, undefined, this);
1046
1121
  };
@@ -2970,6 +3045,31 @@ var exportToJSON = (design) => {
2970
3045
  document.body.removeChild(link);
2971
3046
  URL.revokeObjectURL(url);
2972
3047
  };
3048
+ var canvasToBlob = (stage, format = "png", options) => {
3049
+ if (!stage) {
3050
+ return Promise.reject(new Error("Stage is required"));
3051
+ }
3052
+ const oldScale = stage.scaleX();
3053
+ stage.scale({ x: 1, y: 1 });
3054
+ const pixelRatio = options?.pixelRatio ?? 2;
3055
+ const quality = options?.quality ?? 0.9;
3056
+ const dataUrl = stage.toDataURL({
3057
+ pixelRatio,
3058
+ mimeType: format === "jpg" ? "image/jpeg" : "image/png",
3059
+ quality: format === "jpg" ? quality : undefined
3060
+ });
3061
+ stage.scale({ x: oldScale, y: oldScale });
3062
+ return new Promise((resolve, reject) => {
3063
+ const byteString = atob(dataUrl.split(",")[1]);
3064
+ const mimeType = format === "jpg" ? "image/jpeg" : "image/png";
3065
+ const arrayBuffer = new ArrayBuffer(byteString.length);
3066
+ const uint8Array = new Uint8Array(arrayBuffer);
3067
+ for (let i = 0;i < byteString.length; i++) {
3068
+ uint8Array[i] = byteString.charCodeAt(i);
3069
+ }
3070
+ resolve(new Blob([arrayBuffer], { type: mimeType }));
3071
+ });
3072
+ };
2973
3073
  var importFromJSON = (event, onLoad, onError, onInputsRequired) => {
2974
3074
  const file = event.target.files?.[0];
2975
3075
  if (file) {
@@ -4072,7 +4172,8 @@ var CanvasEditor = ({
4072
4172
  onZoomIn: () => setZoom(Math.min(3, zoom + 0.1)),
4073
4173
  onZoomOut: () => setZoom(Math.max(0.1, zoom - 0.1)),
4074
4174
  onZoomReset: () => setZoom(1),
4075
- onSetActivePanel: setActivePanelId
4175
+ onSetActivePanel: setActivePanelId,
4176
+ navbarConfig: config?.navbar
4076
4177
  }, undefined, false, undefined, this),
4077
4178
  /* @__PURE__ */ jsxDEV18("div", {
4078
4179
  className: "flex-1 flex overflow-hidden",
@@ -4304,6 +4405,7 @@ export {
4304
4405
  exportToJSON,
4305
4406
  exportToJPG,
4306
4407
  convertTemplateToCanvasDesign,
4408
+ canvasToBlob,
4307
4409
  UrlImageElement,
4308
4410
  ShapeElement,
4309
4411
  FONT_FAMILIES,
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export { default as CanvasEditor } from '../CanvasEditor';
6
6
  export * from '../types';
7
- export { exportToPNG, exportToJPG, exportToJSON, importFromJSON, findRequiredInputs, replaceUserInputs, convertTemplateToCanvasDesign, } from '../utils/exportImportUtils';
7
+ export { exportToPNG, exportToJPG, exportToJSON, importFromJSON, findRequiredInputs, replaceUserInputs, convertTemplateToCanvasDesign, canvasToBlob, } from '../utils/exportImportUtils';
8
8
  export * from '../elements';
9
9
  export { FONT_FAMILIES, DEFAULT_COLORS, CANVAS_PRESETS } from '../constants';
10
10
  export { setUnsplashAccessKey, getUnsplashAccessKey } from '../config';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG1D,cAAc,UAAU,CAAC;AAGzB,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,4BAA4B,CAAC;AAGpC,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG7E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG1D,cAAc,UAAU,CAAC;AAGzB,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,6BAA6B,EAC7B,YAAY,GACb,MAAM,4BAA4B,CAAC;AAGpC,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG7E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
@@ -1,3 +1,23 @@
1
+ export interface NavbarSection {
2
+ id: string;
3
+ type: 'default' | 'custom';
4
+ position: 'left' | 'center' | 'right';
5
+ visible?: boolean;
6
+ content?: React.ReactNode | (() => React.ReactNode);
7
+ label?: string;
8
+ icon?: string;
9
+ onClick?: () => void;
10
+ order?: number;
11
+ }
12
+ export interface NavbarConfig {
13
+ showAppName?: boolean;
14
+ showHistoryControls?: boolean;
15
+ showZoomControls?: boolean;
16
+ customSections?: NavbarSection[];
17
+ defaultSections?: {
18
+ [key: string]: Partial<NavbarSection>;
19
+ };
20
+ }
1
21
  export interface Config {
2
22
  export?: {
3
23
  png?: boolean;
@@ -15,5 +35,6 @@ export interface Config {
15
35
  type: "text" | "image";
16
36
  variable: string;
17
37
  }[];
38
+ navbar?: NavbarConfig;
18
39
  }
19
40
  //# sourceMappingURL=Config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/types/Config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,MAAM,CAAC,EAAE;QACP,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;KAClB,EAAE,CAAC;CACL"}
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/types/Config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IAEjC,eAAe,CAAC,EAAE;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;KACvC,CAAC;CACH;AAED,MAAM,WAAW,MAAM;IACrB,MAAM,CAAC,EAAE;QACP,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;KAClB,EAAE,CAAC;IACJ,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "labellife-design-tool",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "Professional canvas editor built with React, TypeScript, and Konva",
5
5
  "main": "./dist/lib/index.js",
6
6
  "module": "./dist/lib/index.js",