@maayan-albert/moab-sdk 1.0.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/dist/index.js ADDED
@@ -0,0 +1,764 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var lucideReact = require('lucide-react');
6
+ var html2canvas = require('html2canvas');
7
+
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ var html2canvas__default = /*#__PURE__*/_interopDefault(html2canvas);
11
+
12
+ var __defProp = Object.defineProperty;
13
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
14
+ var __getOwnPropNames = Object.getOwnPropertyNames;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __esm = (fn, res) => function __init() {
17
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
18
+ };
19
+ var __commonJS = (cb, mod) => function __require() {
20
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
21
+ };
22
+ var __export = (target, all) => {
23
+ for (var name in all)
24
+ __defProp(target, name, { get: all[name], enumerable: true });
25
+ };
26
+ var __copyProps = (to, from, except, desc) => {
27
+ if (from && typeof from === "object" || typeof from === "function") {
28
+ for (let key of __getOwnPropNames(from))
29
+ if (!__hasOwnProp.call(to, key) && key !== except)
30
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
31
+ }
32
+ return to;
33
+ };
34
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
+ var Button, Button_default;
36
+ var init_Button = __esm({
37
+ "src/components/Button.tsx"() {
38
+ Button = ({
39
+ children,
40
+ variant = "primary",
41
+ size = "medium",
42
+ disabled = false,
43
+ onClick,
44
+ className = "",
45
+ ...props
46
+ }) => {
47
+ const baseStyles = "font-semibold rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2";
48
+ const variantStyles = {
49
+ primary: "bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",
50
+ secondary: "bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500",
51
+ outline: "border-2 border-blue-600 text-blue-600 hover:bg-blue-50 focus:ring-blue-500"
52
+ };
53
+ const sizeStyles = {
54
+ small: "px-3 py-1.5 text-sm",
55
+ medium: "px-4 py-2 text-base",
56
+ large: "px-6 py-3 text-lg"
57
+ };
58
+ const disabledStyles = disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer";
59
+ return /* @__PURE__ */ jsxRuntime.jsx(
60
+ "button",
61
+ {
62
+ className: `${baseStyles} ${variantStyles[variant]} ${sizeStyles[size]} ${disabledStyles} ${className}`,
63
+ disabled,
64
+ onClick,
65
+ ...props,
66
+ children
67
+ }
68
+ );
69
+ };
70
+ Button_default = Button;
71
+ }
72
+ });
73
+ var Card, Card_default;
74
+ var init_Card = __esm({
75
+ "src/components/Card.tsx"() {
76
+ Card = ({
77
+ children,
78
+ title,
79
+ className = "",
80
+ ...props
81
+ }) => {
82
+ return /* @__PURE__ */ jsxRuntime.jsxs(
83
+ "div",
84
+ {
85
+ className: `bg-white rounded-lg shadow-md p-6 border border-gray-200 ${className}`,
86
+ ...props,
87
+ children: [
88
+ title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-semibold mb-4 text-gray-800", children: title }),
89
+ children
90
+ ]
91
+ }
92
+ );
93
+ };
94
+ Card_default = Card;
95
+ }
96
+ });
97
+ var Input, Input_default;
98
+ var init_Input = __esm({
99
+ "src/components/Input.tsx"() {
100
+ Input = ({
101
+ label,
102
+ type = "text",
103
+ placeholder,
104
+ value,
105
+ onChange,
106
+ required = false,
107
+ className = "",
108
+ ...props
109
+ }) => {
110
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4", children: [
111
+ label && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [
112
+ label,
113
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500 ml-1", children: "*" })
114
+ ] }),
115
+ /* @__PURE__ */ jsxRuntime.jsx(
116
+ "input",
117
+ {
118
+ type,
119
+ placeholder,
120
+ value,
121
+ onChange,
122
+ required,
123
+ className: `w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${className}`,
124
+ ...props
125
+ }
126
+ )
127
+ ] });
128
+ };
129
+ Input_default = Input;
130
+ }
131
+ });
132
+ var DrawingTool, DrawingTool_default;
133
+ var init_DrawingTool = __esm({
134
+ "src/components/DrawingTool.tsx"() {
135
+ DrawingTool = ({
136
+ width,
137
+ height,
138
+ className = "",
139
+ overlay = true,
140
+ ...props
141
+ }) => {
142
+ const canvasRef = react.useRef(null);
143
+ const toolbarRef = react.useRef(null);
144
+ const [isDrawing, setIsDrawing] = react.useState(false);
145
+ const brushColor = "#EF4444";
146
+ const brushSize = 5;
147
+ const [canvasSize, setCanvasSize] = react.useState({ width: 0, height: 0 });
148
+ const [enabled, setEnabled] = react.useState(false);
149
+ const [hasContent, setHasContent] = react.useState(false);
150
+ const [isDragging, setIsDragging] = react.useState(false);
151
+ const [corner, setCorner] = react.useState("bottom-right");
152
+ const [dragStart, setDragStart] = react.useState({ x: 0, y: 0 });
153
+ const [showClearTooltip, setShowClearTooltip] = react.useState(false);
154
+ react.useEffect(() => {
155
+ if (overlay) {
156
+ const updateSize = () => {
157
+ setCanvasSize({
158
+ width: window.innerWidth,
159
+ height: window.innerHeight
160
+ });
161
+ };
162
+ updateSize();
163
+ window.addEventListener("resize", updateSize);
164
+ return () => window.removeEventListener("resize", updateSize);
165
+ } else {
166
+ setCanvasSize({
167
+ width: width || 800,
168
+ height: height || 600
169
+ });
170
+ }
171
+ }, [overlay, width, height]);
172
+ react.useEffect(() => {
173
+ const canvas = canvasRef.current;
174
+ if (!canvas || canvasSize.width === 0 || canvasSize.height === 0) return;
175
+ const ctx = canvas.getContext("2d");
176
+ if (!ctx) return;
177
+ canvas.width = canvasSize.width;
178
+ canvas.height = canvasSize.height;
179
+ ctx.strokeStyle = brushColor;
180
+ ctx.lineWidth = brushSize;
181
+ ctx.lineCap = "round";
182
+ ctx.lineJoin = "round";
183
+ setHasContent(false);
184
+ }, [canvasSize, brushColor, brushSize]);
185
+ const getCoordinates = react.useCallback(
186
+ (e) => {
187
+ const canvas = canvasRef.current;
188
+ if (!canvas) return { x: 0, y: 0 };
189
+ const rect = canvas.getBoundingClientRect();
190
+ const scaleX = canvas.width / rect.width;
191
+ const scaleY = canvas.height / rect.height;
192
+ if ("touches" in e) {
193
+ return {
194
+ x: (e.touches[0].clientX - rect.left) * scaleX,
195
+ y: (e.touches[0].clientY - rect.top) * scaleY
196
+ };
197
+ } else {
198
+ return {
199
+ x: (e.clientX - rect.left) * scaleX,
200
+ y: (e.clientY - rect.top) * scaleY
201
+ };
202
+ }
203
+ },
204
+ []
205
+ );
206
+ const startDrawing = react.useCallback(
207
+ (e) => {
208
+ if (!enabled) return;
209
+ e.preventDefault();
210
+ const canvas = canvasRef.current;
211
+ const ctx = canvas?.getContext("2d");
212
+ if (!canvas || !ctx) return;
213
+ const { x, y } = getCoordinates(e);
214
+ ctx.beginPath();
215
+ ctx.moveTo(x, y);
216
+ setIsDrawing(true);
217
+ },
218
+ [enabled, getCoordinates]
219
+ );
220
+ const draw = react.useCallback(
221
+ (e) => {
222
+ if (!isDrawing) return;
223
+ e.preventDefault();
224
+ const canvas = canvasRef.current;
225
+ const ctx = canvas?.getContext("2d");
226
+ if (!canvas || !ctx) return;
227
+ const { x, y } = getCoordinates(e);
228
+ ctx.lineTo(x, y);
229
+ ctx.stroke();
230
+ setHasContent(true);
231
+ },
232
+ [isDrawing, getCoordinates]
233
+ );
234
+ const stopDrawing = react.useCallback(() => {
235
+ setIsDrawing(false);
236
+ }, []);
237
+ const clearCanvas = react.useCallback(() => {
238
+ const canvas = canvasRef.current;
239
+ const ctx = canvas?.getContext("2d");
240
+ if (!canvas || !ctx) return;
241
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
242
+ setHasContent(false);
243
+ }, []);
244
+ const takeScreenshot = react.useCallback(async () => {
245
+ try {
246
+ const toolbar = toolbarRef.current;
247
+ if (toolbar) {
248
+ toolbar.style.opacity = "0";
249
+ }
250
+ const canvas = await html2canvas__default.default(document.body, {
251
+ useCORS: true,
252
+ logging: false,
253
+ windowWidth: window.innerWidth,
254
+ windowHeight: window.innerHeight
255
+ });
256
+ if (toolbar) {
257
+ toolbar.style.opacity = "";
258
+ }
259
+ canvas.toBlob(async (blob) => {
260
+ if (!blob) return;
261
+ try {
262
+ await navigator.clipboard.write([
263
+ new ClipboardItem({
264
+ "image/png": blob
265
+ })
266
+ ]);
267
+ } catch (err) {
268
+ console.error("Failed to copy to clipboard:", err);
269
+ const url = URL.createObjectURL(blob);
270
+ const a = document.createElement("a");
271
+ a.href = url;
272
+ a.download = "screenshot.png";
273
+ a.click();
274
+ URL.revokeObjectURL(url);
275
+ }
276
+ }, "image/png");
277
+ } catch (error) {
278
+ console.error("Failed to take screenshot:", error);
279
+ }
280
+ }, []);
281
+ react.useEffect(() => {
282
+ const canvas = canvasRef.current;
283
+ const ctx = canvas?.getContext("2d");
284
+ if (!ctx) return;
285
+ ctx.strokeStyle = brushColor;
286
+ ctx.lineWidth = brushSize;
287
+ }, [brushColor, brushSize]);
288
+ const getTargetCorner = react.useCallback(
289
+ (startX, startY, currentX, currentY) => {
290
+ const deltaX = currentX - startX;
291
+ const deltaY = currentY - startY;
292
+ const threshold = 50;
293
+ if (Math.abs(deltaX) < threshold && Math.abs(deltaY) < threshold) {
294
+ return null;
295
+ }
296
+ const viewportWidth = window.innerWidth;
297
+ const viewportHeight = window.innerHeight;
298
+ const horizontal = currentX < viewportWidth / 2 ? "left" : "right";
299
+ const vertical = currentY < viewportHeight / 2 ? "top" : "bottom";
300
+ if (vertical === "top" && horizontal === "left") return "top-left";
301
+ if (vertical === "top" && horizontal === "right") return "top-right";
302
+ if (vertical === "bottom" && horizontal === "left") return "bottom-left";
303
+ if (vertical === "bottom" && horizontal === "right")
304
+ return "bottom-right";
305
+ return null;
306
+ },
307
+ []
308
+ );
309
+ const handleMouseDown = react.useCallback((e) => {
310
+ if (e.target.closest("button")) {
311
+ return;
312
+ }
313
+ e.preventDefault();
314
+ e.stopPropagation();
315
+ setIsDragging(true);
316
+ setDragStart({
317
+ x: e.clientX,
318
+ y: e.clientY
319
+ });
320
+ }, []);
321
+ react.useEffect(() => {
322
+ const handleMouseMove = (e) => {
323
+ if (!isDragging) return;
324
+ e.preventDefault();
325
+ e.stopPropagation();
326
+ const targetCorner = getTargetCorner(
327
+ dragStart.x,
328
+ dragStart.y,
329
+ e.clientX,
330
+ e.clientY
331
+ );
332
+ if (targetCorner) {
333
+ setCorner(targetCorner);
334
+ } else {
335
+ const viewportWidth = window.innerWidth;
336
+ const viewportHeight = window.innerHeight;
337
+ const horizontal = e.clientX < viewportWidth / 2 ? "left" : "right";
338
+ const vertical = e.clientY < viewportHeight / 2 ? "top" : "bottom";
339
+ if (vertical === "top" && horizontal === "left") setCorner("top-left");
340
+ else if (vertical === "top" && horizontal === "right")
341
+ setCorner("top-right");
342
+ else if (vertical === "bottom" && horizontal === "left")
343
+ setCorner("bottom-left");
344
+ else setCorner("bottom-right");
345
+ }
346
+ };
347
+ const handleMouseUp = (e) => {
348
+ e.preventDefault();
349
+ e.stopPropagation();
350
+ setIsDragging(false);
351
+ };
352
+ if (isDragging) {
353
+ document.addEventListener("mousemove", handleMouseMove, {
354
+ passive: false
355
+ });
356
+ document.addEventListener("mouseup", handleMouseUp, { passive: false });
357
+ }
358
+ return () => {
359
+ document.removeEventListener("mousemove", handleMouseMove);
360
+ document.removeEventListener("mouseup", handleMouseUp);
361
+ };
362
+ }, [isDragging, dragStart, getTargetCorner]);
363
+ if (overlay) {
364
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
365
+ /* @__PURE__ */ jsxRuntime.jsx(
366
+ "canvas",
367
+ {
368
+ ref: canvasRef,
369
+ onMouseDown: startDrawing,
370
+ onMouseMove: draw,
371
+ onMouseUp: stopDrawing,
372
+ onMouseLeave: stopDrawing,
373
+ onTouchStart: startDrawing,
374
+ onTouchMove: draw,
375
+ onTouchEnd: stopDrawing,
376
+ className: `fixed top-0 left-0 touch-none z-50 transition-opacity ${enabled && !isDragging ? "cursor-crosshair pointer-events-auto opacity-100" : "pointer-events-none opacity-0"}`,
377
+ style: {
378
+ width: `${canvasSize.width}px`,
379
+ height: `${canvasSize.height}px`
380
+ }
381
+ }
382
+ ),
383
+ /* @__PURE__ */ jsxRuntime.jsxs(
384
+ "div",
385
+ {
386
+ ref: toolbarRef,
387
+ className: `fixed flex flex-row items-center px-2 py-1.5 bg-neutral-800 rounded-full shadow-lg z-[60] ${isDragging ? "cursor-grabbing" : "cursor-grab"} ${className}`,
388
+ style: {
389
+ gap: enabled ? "8px" : "0px",
390
+ transition: "gap 300ms ease-in-out",
391
+ ...corner === "top-left" ? { top: "16px", left: "16px", bottom: "auto", right: "auto" } : corner === "top-right" ? { top: "16px", right: "16px", bottom: "auto", left: "auto" } : corner === "bottom-left" ? { bottom: "16px", left: "16px", top: "auto", right: "auto" } : { bottom: "16px", right: "16px", top: "auto", left: "auto" }
392
+ },
393
+ onMouseDown: handleMouseDown,
394
+ ...props,
395
+ onClick: (e) => e.stopPropagation(),
396
+ children: [
397
+ /* @__PURE__ */ jsxRuntime.jsx(
398
+ "div",
399
+ {
400
+ className: "overflow-hidden flex-shrink-0",
401
+ style: {
402
+ maxWidth: enabled ? "100px" : "0px",
403
+ opacity: enabled ? 1 : 0,
404
+ transition: "max-width 300ms ease-in-out, opacity 300ms ease-in-out"
405
+ },
406
+ children: /* @__PURE__ */ jsxRuntime.jsx(
407
+ "button",
408
+ {
409
+ onClick: (e) => {
410
+ e.stopPropagation();
411
+ takeScreenshot();
412
+ },
413
+ className: "p-2 text-white hover:bg-neutral-600/30 rounded-full transition-colors focus:outline-none whitespace-nowrap",
414
+ "aria-label": "Take screenshot",
415
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
416
+ "svg",
417
+ {
418
+ xmlns: "http://www.w3.org/2000/svg",
419
+ width: "18",
420
+ height: "18",
421
+ viewBox: "0 0 24 24",
422
+ fill: "none",
423
+ stroke: "currentColor",
424
+ strokeWidth: "2",
425
+ strokeLinecap: "round",
426
+ strokeLinejoin: "round",
427
+ className: "lucide lucide-camera",
428
+ children: [
429
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z" }),
430
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "13", r: "3" })
431
+ ]
432
+ }
433
+ )
434
+ }
435
+ )
436
+ }
437
+ ),
438
+ /* @__PURE__ */ jsxRuntime.jsxs(
439
+ "div",
440
+ {
441
+ className: "overflow-hidden flex-shrink-0 relative",
442
+ style: {
443
+ maxWidth: enabled ? "100px" : "0px",
444
+ opacity: enabled ? 1 : 0,
445
+ transition: "max-width 300ms ease-in-out, opacity 300ms ease-in-out"
446
+ },
447
+ children: [
448
+ /* @__PURE__ */ jsxRuntime.jsxs(
449
+ "button",
450
+ {
451
+ onClick: (e) => {
452
+ e.stopPropagation();
453
+ clearCanvas();
454
+ setShowClearTooltip(false);
455
+ },
456
+ onMouseEnter: () => {
457
+ if (hasContent) {
458
+ setShowClearTooltip(true);
459
+ }
460
+ },
461
+ onMouseLeave: () => setShowClearTooltip(false),
462
+ disabled: !hasContent,
463
+ className: "p-2 text-white rounded-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed relative group",
464
+ "aria-label": "Clear canvas",
465
+ children: [
466
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full bg-red-600/30 opacity-0 group-hover:opacity-100 transition-opacity disabled:group-hover:opacity-0" }),
467
+ /* @__PURE__ */ jsxRuntime.jsx(
468
+ lucideReact.Trash2,
469
+ {
470
+ size: 18,
471
+ strokeWidth: 2,
472
+ className: "relative z-10 group-hover:text-red-600 transition-colors"
473
+ }
474
+ )
475
+ ]
476
+ }
477
+ ),
478
+ showClearTooltip && hasContent && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-3 py-1.5 bg-neutral-800 rounded-full shadow-lg whitespace-nowrap z-[70]", children: [
479
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
480
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-white text-sm", children: "Clear all" }),
481
+ /* @__PURE__ */ jsxRuntime.jsx(
482
+ "button",
483
+ {
484
+ onClick: (e) => {
485
+ e.stopPropagation();
486
+ setShowClearTooltip(false);
487
+ },
488
+ onMouseDown: (e) => e.stopPropagation(),
489
+ className: "text-white hover:text-neutral-300 transition-colors rounded-full",
490
+ "aria-label": "Dismiss tooltip",
491
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 14, strokeWidth: 2 })
492
+ }
493
+ )
494
+ ] }),
495
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 -mt-1", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-2 h-2 bg-neutral-800 rotate-45" }) })
496
+ ] })
497
+ ]
498
+ }
499
+ ),
500
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-shrink-0", children: [
501
+ /* @__PURE__ */ jsxRuntime.jsx(
502
+ "button",
503
+ {
504
+ onClick: (e) => {
505
+ e.stopPropagation();
506
+ setEnabled(!enabled);
507
+ },
508
+ className: "p-1.5 text-white hover:bg-neutral-600/30 rounded-full transition-all focus:outline-none",
509
+ style: {
510
+ opacity: enabled ? 0 : 1,
511
+ pointerEvents: enabled ? "none" : "auto",
512
+ transition: "opacity 300ms ease-in-out"
513
+ },
514
+ "aria-label": "Turn on drawing",
515
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
516
+ "svg",
517
+ {
518
+ xmlns: "http://www.w3.org/2000/svg",
519
+ width: "18",
520
+ height: "18",
521
+ viewBox: "0 0 24 24",
522
+ fill: "none",
523
+ stroke: "currentColor",
524
+ strokeWidth: "2",
525
+ strokeLinecap: "round",
526
+ strokeLinejoin: "round",
527
+ className: "lucide lucide-brush",
528
+ children: [
529
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m11 10 3 3" }),
530
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z" }),
531
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031" })
532
+ ]
533
+ }
534
+ )
535
+ }
536
+ ),
537
+ /* @__PURE__ */ jsxRuntime.jsx(
538
+ "button",
539
+ {
540
+ onClick: (e) => {
541
+ e.stopPropagation();
542
+ setEnabled(false);
543
+ },
544
+ className: "absolute inset-0 p-1.5 text-white hover:bg-neutral-600/30 rounded-full transition-all focus:outline-none",
545
+ style: {
546
+ opacity: enabled ? 1 : 0,
547
+ pointerEvents: enabled ? "auto" : "none",
548
+ transition: "opacity 300ms ease-in-out"
549
+ },
550
+ "aria-label": "Close",
551
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 18, strokeWidth: 2.5 })
552
+ }
553
+ )
554
+ ] })
555
+ ]
556
+ }
557
+ )
558
+ ] });
559
+ }
560
+ return /* @__PURE__ */ jsxRuntime.jsxs(
561
+ "div",
562
+ {
563
+ className: `flex flex-col items-center gap-4 p-6 bg-white rounded-full shadow-lg border border-gray-200 ${className}`,
564
+ ...props,
565
+ children: [
566
+ /* @__PURE__ */ jsxRuntime.jsxs(
567
+ "div",
568
+ {
569
+ className: "flex flex-row items-center w-full justify-center transition-all duration-300 ease-in-out",
570
+ style: {
571
+ gap: enabled ? "12px" : "0px"
572
+ },
573
+ children: [
574
+ /* @__PURE__ */ jsxRuntime.jsx(
575
+ "button",
576
+ {
577
+ onClick: () => setEnabled(!enabled),
578
+ className: `p-3 rounded-xl transition-all duration-200 focus:outline-none shadow-md hover:shadow-lg active:scale-95 ${enabled ? "bg-emerald-500 text-white hover:bg-emerald-600 active:bg-emerald-700" : "bg-slate-500 text-white hover:bg-slate-600 active:bg-slate-700"}`,
579
+ "aria-label": enabled ? "Turn off drawing" : "Turn on drawing",
580
+ children: enabled ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 20, strokeWidth: 2.5 }) : /* @__PURE__ */ jsxRuntime.jsxs(
581
+ "svg",
582
+ {
583
+ xmlns: "http://www.w3.org/2000/svg",
584
+ width: "20",
585
+ height: "20",
586
+ viewBox: "0 0 24 24",
587
+ fill: "none",
588
+ stroke: "currentColor",
589
+ strokeWidth: "2",
590
+ strokeLinecap: "round",
591
+ strokeLinejoin: "round",
592
+ className: "lucide lucide-brush",
593
+ children: [
594
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m11 10 3 3" }),
595
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z" }),
596
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031" })
597
+ ]
598
+ }
599
+ )
600
+ }
601
+ ),
602
+ /* @__PURE__ */ jsxRuntime.jsx(
603
+ "div",
604
+ {
605
+ className: "transition-all duration-300 ease-in-out overflow-hidden flex-shrink-0",
606
+ style: {
607
+ width: enabled ? "52px" : "0px",
608
+ minWidth: enabled ? "52px" : "0px",
609
+ opacity: enabled ? 1 : 0
610
+ },
611
+ children: /* @__PURE__ */ jsxRuntime.jsx(
612
+ "button",
613
+ {
614
+ onClick: clearCanvas,
615
+ disabled: !hasContent,
616
+ className: "p-3 bg-red-500 text-white hover:text-red-200 rounded-xl hover:bg-red-600 active:bg-red-700 transition-all duration-200 focus:outline-none shadow-md hover:shadow-lg active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-red-500 disabled:hover:shadow-md disabled:active:scale-100 whitespace-nowrap",
617
+ "aria-label": "Clear canvas",
618
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
619
+ "svg",
620
+ {
621
+ xmlns: "http://www.w3.org/2000/svg",
622
+ width: "20",
623
+ height: "20",
624
+ viewBox: "0 0 24 24",
625
+ fill: "none",
626
+ stroke: "currentColor",
627
+ strokeWidth: "2",
628
+ strokeLinecap: "round",
629
+ strokeLinejoin: "round",
630
+ className: "lucide lucide-brush-cleaning",
631
+ children: [
632
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m16 22-1-4" }),
633
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 14a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2h-3a1 1 0 0 1-1-1V4a2 2 0 0 0-4 0v5a1 1 0 0 1-1 1H6a2 2 0 0 0-2 2v1a1 1 0 0 0 1 1" }),
634
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 14H5l-1.973 6.767A1 1 0 0 0 4 22h16a1 1 0 0 0 .973-1.233z" }),
635
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m8 22 1-4" })
636
+ ]
637
+ }
638
+ )
639
+ }
640
+ )
641
+ }
642
+ ),
643
+ /* @__PURE__ */ jsxRuntime.jsx(
644
+ "div",
645
+ {
646
+ className: "transition-all duration-300 ease-in-out overflow-hidden flex-shrink-0",
647
+ style: {
648
+ width: enabled ? "52px" : "0px",
649
+ minWidth: enabled ? "52px" : "0px",
650
+ opacity: enabled ? 1 : 0
651
+ },
652
+ children: /* @__PURE__ */ jsxRuntime.jsx(
653
+ "button",
654
+ {
655
+ onClick: takeScreenshot,
656
+ className: "p-3 bg-neutral-500 text-white rounded-xl hover:bg-neutral-600 active:bg-neutral-700 transition-all duration-200 focus:outline-none shadow-md hover:shadow-lg active:scale-95 whitespace-nowrap",
657
+ "aria-label": "Take screenshot",
658
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
659
+ "svg",
660
+ {
661
+ xmlns: "http://www.w3.org/2000/svg",
662
+ width: "20",
663
+ height: "20",
664
+ viewBox: "0 0 24 24",
665
+ fill: "none",
666
+ stroke: "currentColor",
667
+ strokeWidth: "2",
668
+ strokeLinecap: "round",
669
+ strokeLinejoin: "round",
670
+ className: "lucide lucide-camera",
671
+ children: [
672
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z" }),
673
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "13", r: "3" })
674
+ ]
675
+ }
676
+ )
677
+ }
678
+ )
679
+ }
680
+ )
681
+ ]
682
+ }
683
+ ),
684
+ /* @__PURE__ */ jsxRuntime.jsx(
685
+ "canvas",
686
+ {
687
+ ref: canvasRef,
688
+ onMouseDown: startDrawing,
689
+ onMouseMove: draw,
690
+ onMouseUp: stopDrawing,
691
+ onMouseLeave: stopDrawing,
692
+ onTouchStart: startDrawing,
693
+ onTouchMove: draw,
694
+ onTouchEnd: stopDrawing,
695
+ className: `border border-gray-300 rounded touch-none transition-opacity ${enabled ? "cursor-crosshair pointer-events-auto opacity-100" : "pointer-events-none opacity-0"}`,
696
+ style: {
697
+ width: `${canvasSize.width}px`,
698
+ height: `${canvasSize.height}px`,
699
+ maxWidth: "100%"
700
+ }
701
+ }
702
+ )
703
+ ]
704
+ }
705
+ );
706
+ };
707
+ DrawingTool_default = DrawingTool;
708
+ }
709
+ });
710
+
711
+ // src/components.ts
712
+ var components_exports = {};
713
+ __export(components_exports, {
714
+ Button: () => Button,
715
+ ButtonDefault: () => Button_default,
716
+ Card: () => Card,
717
+ CardDefault: () => Card_default,
718
+ DrawingTool: () => DrawingTool,
719
+ DrawingToolDefault: () => DrawingTool_default,
720
+ Input: () => Input,
721
+ InputDefault: () => Input_default
722
+ });
723
+ var init_components = __esm({
724
+ "src/components.ts"() {
725
+ init_Button();
726
+ init_Card();
727
+ init_Input();
728
+ init_DrawingTool();
729
+ init_Button();
730
+ init_Card();
731
+ init_Input();
732
+ init_DrawingTool();
733
+ }
734
+ });
735
+
736
+ // src/index.js
737
+ var require_src = __commonJS({
738
+ "src/index.js"(exports$1, module) {
739
+ var MoabSDK = class {
740
+ constructor(options = {}) {
741
+ this.options = options;
742
+ }
743
+ /**
744
+ * Example method - replace with your SDK functionality
745
+ */
746
+ hello() {
747
+ return "Hello from Moab SDK!";
748
+ }
749
+ };
750
+ module.exports = MoabSDK;
751
+ module.exports.default = MoabSDK;
752
+ if (typeof module !== "undefined" && module.exports) {
753
+ try {
754
+ module.exports.components = (init_components(), __toCommonJS(components_exports));
755
+ } catch (e) {
756
+ }
757
+ }
758
+ }
759
+ });
760
+ var index = require_src();
761
+
762
+ module.exports = index;
763
+ //# sourceMappingURL=index.js.map
764
+ //# sourceMappingURL=index.js.map