@tecof/theme-editor 0.0.32 → 0.0.34

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.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React__default from 'react';
2
- import React__default__default, { createContext, memo, forwardRef, createElement, useRef, useCallback, useContext, useState, useEffect, useMemo, Component, useLayoutEffect } from 'react';
2
+ import React__default__default, { createContext, forwardRef, createElement, memo, useRef, useCallback, useContext, useState, useEffect, useMemo, Component, useLayoutEffect } from 'react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
- import { blocksPlugin, outlinePlugin, fieldsPlugin, Puck, Render, FieldLabel } from '@puckeditor/core';
4
+ import { blocksPlugin, outlinePlugin, fieldsPlugin, Puck, Render, FieldLabel, usePuck, ActionBar } from '@puckeditor/core';
5
5
  import { useEditor, EditorContent } from '@tiptap/react';
6
6
  import Document from '@tiptap/extension-document';
7
7
  import Paragraph from '@tiptap/extension-paragraph';
@@ -294,6 +294,342 @@ function useTecof() {
294
294
  }
295
295
  return ctx;
296
296
  }
297
+
298
+ // node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
299
+ var mergeClasses = (...classes) => classes.filter((className, index2, array) => {
300
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index2;
301
+ }).join(" ").trim();
302
+
303
+ // node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.js
304
+ var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
305
+
306
+ // node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.js
307
+ var toCamelCase = (string) => string.replace(
308
+ /^([A-Z])|[\s-_]+(\w)/g,
309
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
310
+ );
311
+
312
+ // node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.js
313
+ var toPascalCase = (string) => {
314
+ const camelCase = toCamelCase(string);
315
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
316
+ };
317
+
318
+ // node_modules/lucide-react/dist/esm/defaultAttributes.js
319
+ var defaultAttributes = {
320
+ xmlns: "http://www.w3.org/2000/svg",
321
+ width: 24,
322
+ height: 24,
323
+ viewBox: "0 0 24 24",
324
+ fill: "none",
325
+ stroke: "currentColor",
326
+ strokeWidth: 2,
327
+ strokeLinecap: "round",
328
+ strokeLinejoin: "round"
329
+ };
330
+
331
+ // node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.js
332
+ var hasA11yProp = (props) => {
333
+ for (const prop in props) {
334
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
335
+ return true;
336
+ }
337
+ }
338
+ return false;
339
+ };
340
+ var LucideContext = createContext({});
341
+ var useLucideContext = () => useContext(LucideContext);
342
+
343
+ // node_modules/lucide-react/dist/esm/Icon.js
344
+ var Icon = forwardRef(
345
+ ({ color, size, strokeWidth, absoluteStrokeWidth, className = "", children, iconNode, ...rest }, ref) => {
346
+ const {
347
+ size: contextSize = 24,
348
+ strokeWidth: contextStrokeWidth = 2,
349
+ absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,
350
+ color: contextColor = "currentColor",
351
+ className: contextClass = ""
352
+ } = useLucideContext() ?? {};
353
+ const calculatedStrokeWidth = absoluteStrokeWidth ?? contextAbsoluteStrokeWidth ? Number(strokeWidth ?? contextStrokeWidth) * 24 / Number(size ?? contextSize) : strokeWidth ?? contextStrokeWidth;
354
+ return createElement(
355
+ "svg",
356
+ {
357
+ ref,
358
+ ...defaultAttributes,
359
+ width: size ?? contextSize ?? defaultAttributes.width,
360
+ height: size ?? contextSize ?? defaultAttributes.height,
361
+ stroke: color ?? contextColor,
362
+ strokeWidth: calculatedStrokeWidth,
363
+ className: mergeClasses("lucide", contextClass, className),
364
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
365
+ ...rest
366
+ },
367
+ [
368
+ ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
369
+ ...Array.isArray(children) ? children : [children]
370
+ ]
371
+ );
372
+ }
373
+ );
374
+
375
+ // node_modules/lucide-react/dist/esm/createLucideIcon.js
376
+ var createLucideIcon = (iconName, iconNode) => {
377
+ const Component2 = forwardRef(
378
+ ({ className, ...props }, ref) => createElement(Icon, {
379
+ ref,
380
+ iconNode,
381
+ className: mergeClasses(
382
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
383
+ `lucide-${iconName}`,
384
+ className
385
+ ),
386
+ ...props
387
+ })
388
+ );
389
+ Component2.displayName = toPascalCase(iconName);
390
+ return Component2;
391
+ };
392
+
393
+ // node_modules/lucide-react/dist/esm/icons/arrow-down.js
394
+ var __iconNode = [
395
+ ["path", { d: "M12 5v14", key: "s699le" }],
396
+ ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
397
+ ];
398
+ var ArrowDown = createLucideIcon("arrow-down", __iconNode);
399
+
400
+ // node_modules/lucide-react/dist/esm/icons/arrow-up.js
401
+ var __iconNode2 = [
402
+ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
403
+ ["path", { d: "M12 19V5", key: "x0mq9r" }]
404
+ ];
405
+ var ArrowUp = createLucideIcon("arrow-up", __iconNode2);
406
+
407
+ // node_modules/lucide-react/dist/esm/icons/check.js
408
+ var __iconNode3 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
409
+ var Check = createLucideIcon("check", __iconNode3);
410
+
411
+ // node_modules/lucide-react/dist/esm/icons/chevron-down.js
412
+ var __iconNode4 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
413
+ var ChevronDown = createLucideIcon("chevron-down", __iconNode4);
414
+
415
+ // node_modules/lucide-react/dist/esm/icons/chevron-right.js
416
+ var __iconNode5 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
417
+ var ChevronRight = createLucideIcon("chevron-right", __iconNode5);
418
+
419
+ // node_modules/lucide-react/dist/esm/icons/code.js
420
+ var __iconNode6 = [
421
+ ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
422
+ ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
423
+ ];
424
+ var Code = createLucideIcon("code", __iconNode6);
425
+
426
+ // node_modules/lucide-react/dist/esm/icons/copy.js
427
+ var __iconNode7 = [
428
+ ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
429
+ ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
430
+ ];
431
+ var Copy = createLucideIcon("copy", __iconNode7);
432
+
433
+ // node_modules/lucide-react/dist/esm/icons/database.js
434
+ var __iconNode8 = [
435
+ ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
436
+ ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
437
+ ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
438
+ ];
439
+ var Database = createLucideIcon("database", __iconNode8);
440
+
441
+ // node_modules/lucide-react/dist/esm/icons/external-link.js
442
+ var __iconNode9 = [
443
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
444
+ ["path", { d: "M10 14 21 3", key: "gplh6r" }],
445
+ ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
446
+ ];
447
+ var ExternalLink = createLucideIcon("external-link", __iconNode9);
448
+
449
+ // node_modules/lucide-react/dist/esm/icons/file-text.js
450
+ var __iconNode10 = [
451
+ [
452
+ "path",
453
+ {
454
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
455
+ key: "1oefj6"
456
+ }
457
+ ],
458
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
459
+ ["path", { d: "M10 9H8", key: "b1mrlr" }],
460
+ ["path", { d: "M16 13H8", key: "t4e002" }],
461
+ ["path", { d: "M16 17H8", key: "z1uh3a" }]
462
+ ];
463
+ var FileText = createLucideIcon("file-text", __iconNode10);
464
+
465
+ // node_modules/lucide-react/dist/esm/icons/file.js
466
+ var __iconNode11 = [
467
+ [
468
+ "path",
469
+ {
470
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
471
+ key: "1oefj6"
472
+ }
473
+ ],
474
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
475
+ ];
476
+ var File2 = createLucideIcon("file", __iconNode11);
477
+
478
+ // node_modules/lucide-react/dist/esm/icons/folder-open.js
479
+ var __iconNode12 = [
480
+ [
481
+ "path",
482
+ {
483
+ d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",
484
+ key: "usdka0"
485
+ }
486
+ ]
487
+ ];
488
+ var FolderOpen = createLucideIcon("folder-open", __iconNode12);
489
+
490
+ // node_modules/lucide-react/dist/esm/icons/globe.js
491
+ var __iconNode13 = [
492
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
493
+ ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
494
+ ["path", { d: "M2 12h20", key: "9i4pu4" }]
495
+ ];
496
+ var Globe = createLucideIcon("globe", __iconNode13);
497
+
498
+ // node_modules/lucide-react/dist/esm/icons/grip-vertical.js
499
+ var __iconNode14 = [
500
+ ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
501
+ ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
502
+ ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
503
+ ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
504
+ ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
505
+ ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
506
+ ];
507
+ var GripVertical = createLucideIcon("grip-vertical", __iconNode14);
508
+
509
+ // node_modules/lucide-react/dist/esm/icons/image-plus.js
510
+ var __iconNode15 = [
511
+ ["path", { d: "M16 5h6", key: "1vod17" }],
512
+ ["path", { d: "M19 2v6", key: "4bpg5p" }],
513
+ ["path", { d: "M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5", key: "1ue2ih" }],
514
+ ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }],
515
+ ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }]
516
+ ];
517
+ var ImagePlus = createLucideIcon("image-plus", __iconNode15);
518
+
519
+ // node_modules/lucide-react/dist/esm/icons/image.js
520
+ var __iconNode16 = [
521
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
522
+ ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
523
+ ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
524
+ ];
525
+ var Image2 = createLucideIcon("image", __iconNode16);
526
+
527
+ // node_modules/lucide-react/dist/esm/icons/languages.js
528
+ var __iconNode17 = [
529
+ ["path", { d: "m5 8 6 6", key: "1wu5hv" }],
530
+ ["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
531
+ ["path", { d: "M2 5h12", key: "or177f" }],
532
+ ["path", { d: "M7 2h1", key: "1t2jsx" }],
533
+ ["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
534
+ ["path", { d: "M14 18h6", key: "1m8k6r" }]
535
+ ];
536
+ var Languages = createLucideIcon("languages", __iconNode17);
537
+
538
+ // node_modules/lucide-react/dist/esm/icons/link-2.js
539
+ var __iconNode18 = [
540
+ ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
541
+ ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
542
+ ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
543
+ ];
544
+ var Link2 = createLucideIcon("link-2", __iconNode18);
545
+
546
+ // node_modules/lucide-react/dist/esm/icons/link.js
547
+ var __iconNode19 = [
548
+ ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
549
+ ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
550
+ ];
551
+ var Link = createLucideIcon("link", __iconNode19);
552
+
553
+ // node_modules/lucide-react/dist/esm/icons/loader-circle.js
554
+ var __iconNode20 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
555
+ var LoaderCircle = createLucideIcon("loader-circle", __iconNode20);
556
+
557
+ // node_modules/lucide-react/dist/esm/icons/pencil.js
558
+ var __iconNode21 = [
559
+ [
560
+ "path",
561
+ {
562
+ d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
563
+ key: "1a8usu"
564
+ }
565
+ ],
566
+ ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
567
+ ];
568
+ var Pencil = createLucideIcon("pencil", __iconNode21);
569
+
570
+ // node_modules/lucide-react/dist/esm/icons/plus.js
571
+ var __iconNode22 = [
572
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
573
+ ["path", { d: "M12 5v14", key: "s699le" }]
574
+ ];
575
+ var Plus = createLucideIcon("plus", __iconNode22);
576
+
577
+ // node_modules/lucide-react/dist/esm/icons/refresh-ccw.js
578
+ var __iconNode23 = [
579
+ ["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
580
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
581
+ ["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
582
+ ["path", { d: "M16 16h5v5", key: "ccwih5" }]
583
+ ];
584
+ var RefreshCcw = createLucideIcon("refresh-ccw", __iconNode23);
585
+
586
+ // node_modules/lucide-react/dist/esm/icons/refresh-cw.js
587
+ var __iconNode24 = [
588
+ ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
589
+ ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
590
+ ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
591
+ ["path", { d: "M8 16H3v5", key: "1cv678" }]
592
+ ];
593
+ var RefreshCw = createLucideIcon("refresh-cw", __iconNode24);
594
+
595
+ // node_modules/lucide-react/dist/esm/icons/rotate-ccw.js
596
+ var __iconNode25 = [
597
+ ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
598
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
599
+ ];
600
+ var RotateCcw = createLucideIcon("rotate-ccw", __iconNode25);
601
+
602
+ // node_modules/lucide-react/dist/esm/icons/search.js
603
+ var __iconNode26 = [
604
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
605
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
606
+ ];
607
+ var Search = createLucideIcon("search", __iconNode26);
608
+
609
+ // node_modules/lucide-react/dist/esm/icons/trash-2.js
610
+ var __iconNode27 = [
611
+ ["path", { d: "M10 11v6", key: "nco0om" }],
612
+ ["path", { d: "M14 11v6", key: "outv1u" }],
613
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
614
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
615
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
616
+ ];
617
+ var Trash2 = createLucideIcon("trash-2", __iconNode27);
618
+
619
+ // node_modules/lucide-react/dist/esm/icons/upload.js
620
+ var __iconNode28 = [
621
+ ["path", { d: "M12 3v12", key: "1x0j5s" }],
622
+ ["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }],
623
+ ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }]
624
+ ];
625
+ var Upload = createLucideIcon("upload", __iconNode28);
626
+
627
+ // node_modules/lucide-react/dist/esm/icons/x.js
628
+ var __iconNode29 = [
629
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
630
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
631
+ ];
632
+ var X = createLucideIcon("x", __iconNode29);
297
633
  var EMPTY_PAGE = { content: [], root: { props: {} }, zones: {} };
298
634
  var ComponentDrawerItem = ({
299
635
  name: name3,
@@ -344,6 +680,93 @@ var ComponentDrawerItem = ({
344
680
  ] })
345
681
  ] });
346
682
  };
683
+ var AutoFieldsOnSelect = () => {
684
+ const { selectedItem, dispatch } = usePuck();
685
+ const prevSelectedRef = useRef(null);
686
+ useEffect(() => {
687
+ const currentId = selectedItem?.props?.id || null;
688
+ if (currentId && currentId !== prevSelectedRef.current) {
689
+ dispatch({
690
+ type: "setUi",
691
+ ui: { plugin: { current: "fields" } }
692
+ });
693
+ }
694
+ prevSelectedRef.current = currentId;
695
+ }, [selectedItem, dispatch]);
696
+ return null;
697
+ };
698
+ var CustomActionBar = ({ children, label }) => {
699
+ const { appState, dispatch, getSelectorForId, selectedItem } = usePuck();
700
+ const canMoveUp = useMemo(() => {
701
+ if (!selectedItem || !selectedItem.props?.id) return false;
702
+ const selector = getSelectorForId(selectedItem.props.id);
703
+ if (!selector) return false;
704
+ return selector.index > 0;
705
+ }, [selectedItem, getSelectorForId]);
706
+ const canMoveDown = useMemo(() => {
707
+ if (!selectedItem || !selectedItem.props?.id) return false;
708
+ const selector = getSelectorForId(selectedItem.props.id);
709
+ if (!selector) return false;
710
+ const { index: index2, zone } = selector;
711
+ const items = zone ? appState.data.zones?.[zone] || [] : appState.data.content || [];
712
+ return index2 < items.length - 1;
713
+ }, [selectedItem, getSelectorForId, appState.data]);
714
+ const handleMove = useCallback((direction) => {
715
+ if (!selectedItem || !selectedItem.props?.id) return;
716
+ const selector = getSelectorForId(selectedItem.props.id);
717
+ if (!selector) return;
718
+ const { index: index2, zone } = selector;
719
+ let items = zone ? [...appState.data.zones?.[zone] || []] : [...appState.data.content || []];
720
+ const targetIndex = direction === "up" ? index2 - 1 : index2 + 1;
721
+ if (targetIndex < 0 || targetIndex >= items.length) return;
722
+ const temp = items[index2];
723
+ items[index2] = items[targetIndex];
724
+ items[targetIndex] = temp;
725
+ if (zone) {
726
+ dispatch({
727
+ type: "setData",
728
+ data: {
729
+ ...appState.data,
730
+ zones: {
731
+ ...appState.data.zones,
732
+ [zone]: items
733
+ }
734
+ }
735
+ });
736
+ dispatch({
737
+ type: "setUi",
738
+ ui: {
739
+ itemSelector: {
740
+ index: targetIndex,
741
+ zone
742
+ }
743
+ }
744
+ });
745
+ } else {
746
+ dispatch({
747
+ type: "setData",
748
+ data: {
749
+ ...appState.data,
750
+ content: items
751
+ }
752
+ });
753
+ dispatch({
754
+ type: "setUi",
755
+ ui: {
756
+ itemSelector: {
757
+ index: targetIndex
758
+ }
759
+ }
760
+ });
761
+ }
762
+ }, [selectedItem, getSelectorForId, appState.data, dispatch]);
763
+ return /* @__PURE__ */ jsx(ActionBar, { label, children: /* @__PURE__ */ jsxs(ActionBar.Group, { children: [
764
+ /* @__PURE__ */ jsx(ActionBar.Action, { onClick: () => handleMove("up"), disabled: !canMoveUp, label: "Yukar\u0131 Ta\u015F\u0131", children: /* @__PURE__ */ jsx(ArrowUp, { size: 14 }) }),
765
+ /* @__PURE__ */ jsx(ActionBar.Action, { onClick: () => handleMove("down"), disabled: !canMoveDown, label: "A\u015Fa\u011F\u0131 Ta\u015F\u0131", children: /* @__PURE__ */ jsx(ArrowDown, { size: 14 }) }),
766
+ /* @__PURE__ */ jsx(ActionBar.Separator, {}),
767
+ children
768
+ ] }) });
769
+ };
347
770
  var TecofEditor = ({
348
771
  pageId,
349
772
  config: config3,
@@ -359,6 +782,7 @@ var TecofEditor = ({
359
782
  const [loading, setLoading] = useState(true);
360
783
  const [saving, setSaving] = useState(false);
361
784
  const [saveStatus, setSaveStatus] = useState("idle");
785
+ const [searchQuery, setSearchQuery] = useState("");
362
786
  const draftDataRef = useRef(null);
363
787
  const isEmbedded = typeof window !== "undefined" && window.parent !== window;
364
788
  useEffect(() => {
@@ -486,9 +910,56 @@ var TecofEditor = ({
486
910
  ];
487
911
  const mergedOverrides = {
488
912
  header: () => /* @__PURE__ */ jsx(Fragment, {}),
913
+ drawer: ({ children }) => {
914
+ return /* @__PURE__ */ jsxs("div", { className: "tecof-drawer-wrapper-layout", children: [
915
+ /* @__PURE__ */ jsx("div", { className: "tecof-drawer-search-wrapper", children: /* @__PURE__ */ jsxs("div", { className: "tecof-drawer-search-box", children: [
916
+ /* @__PURE__ */ jsx(Search, { size: 14, color: "#71717a" }),
917
+ /* @__PURE__ */ jsx(
918
+ "input",
919
+ {
920
+ type: "text",
921
+ placeholder: "Blok ara...",
922
+ value: searchQuery,
923
+ onChange: (e3) => setSearchQuery(e3.target.value),
924
+ className: "tecof-drawer-search-input"
925
+ }
926
+ ),
927
+ searchQuery && /* @__PURE__ */ jsx(
928
+ "button",
929
+ {
930
+ type: "button",
931
+ onClick: () => setSearchQuery(""),
932
+ className: "tecof-drawer-clear-btn",
933
+ title: "Temizle",
934
+ children: /* @__PURE__ */ jsx(X, { size: 14 })
935
+ }
936
+ )
937
+ ] }) }),
938
+ /* @__PURE__ */ jsx("div", { className: "tecof-drawer-list-layout", children })
939
+ ] });
940
+ },
489
941
  drawerItem: ({ children, name: name3 }) => {
942
+ const componentConfig = config3.components?.[name3];
943
+ const label = componentConfig?.label || name3;
944
+ if (searchQuery.trim()) {
945
+ const query = searchQuery.toLowerCase();
946
+ const matchesName = name3.toLowerCase().includes(query);
947
+ const matchesLabel = label.toLowerCase().includes(query);
948
+ if (!matchesName && !matchesLabel) {
949
+ return /* @__PURE__ */ jsx(Fragment, {});
950
+ }
951
+ }
490
952
  return /* @__PURE__ */ jsx(ComponentDrawerItem, { name: name3, apiClient, children });
491
953
  },
954
+ actionBar: ({ children, label }) => {
955
+ return /* @__PURE__ */ jsx(CustomActionBar, { label, children });
956
+ },
957
+ puck: ({ children }) => {
958
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
959
+ /* @__PURE__ */ jsx(AutoFieldsOnSelect, {}),
960
+ children
961
+ ] });
962
+ },
492
963
  ...overrides || {}
493
964
  };
494
965
  return /* @__PURE__ */ jsxs("div", { className: `tecof-editor-wrapper ${className || ""}`.trim(), children: [
@@ -640,370 +1111,284 @@ var TecofPicture = memo(({
640
1111
  return null;
641
1112
  });
642
1113
  TecofPicture.displayName = "TecofPicture";
643
- var merchantInfoCache = /* @__PURE__ */ new Map();
644
- var CACHE_TTL = 5 * 60 * 1e3;
645
- function useLanguages() {
646
- const { apiClient, secretKey, apiUrl } = useTecof();
647
- const [merchantInfo, setMerchantInfo] = useState(null);
648
- const [loading, setLoading] = useState(true);
649
- const [error2, setError] = useState(null);
650
- const [activeTab, setActiveTab] = useState("");
651
- const cacheKey = useMemo(() => `${apiUrl}::${secretKey}`, [apiUrl, secretKey]);
652
- useEffect(() => {
653
- let cancelled = false;
654
- const fetchInfo = async () => {
655
- const cached = merchantInfoCache.get(cacheKey);
656
- if (cached && Date.now() - cached.ts < CACHE_TTL) {
657
- setMerchantInfo(cached.data);
658
- if (!activeTab) setActiveTab(cached.data.defaultLanguage);
659
- setLoading(false);
660
- return;
661
- }
662
- setLoading(true);
663
- setError(null);
664
- const res2 = await apiClient.getMerchantInfo();
665
- if (cancelled) return;
666
- if (res2.success && res2.data) {
667
- merchantInfoCache.set(cacheKey, { data: res2.data, ts: Date.now() });
668
- setMerchantInfo(res2.data);
669
- if (!activeTab) setActiveTab(res2.data.defaultLanguage);
670
- } else {
671
- setError(res2.message || "Failed to load languages");
672
- const fallback = { languages: ["tr"], defaultLanguage: "tr" };
673
- setMerchantInfo(fallback);
674
- if (!activeTab) setActiveTab("tr");
675
- }
676
- setLoading(false);
677
- };
678
- fetchInfo();
679
- return () => {
680
- cancelled = true;
681
- };
682
- }, [apiClient, cacheKey]);
683
- return { merchantInfo, loading, error: error2, activeTab, setActiveTab };
684
- }
685
-
686
- // node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
687
- var mergeClasses = (...classes) => classes.filter((className, index2, array) => {
688
- return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index2;
689
- }).join(" ").trim();
690
-
691
- // node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.js
692
- var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
693
-
694
- // node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.js
695
- var toCamelCase = (string) => string.replace(
696
- /^([A-Z])|[\s-_]+(\w)/g,
697
- (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
698
- );
699
-
700
- // node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.js
701
- var toPascalCase = (string) => {
702
- const camelCase = toCamelCase(string);
703
- return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
704
- };
705
-
706
- // node_modules/lucide-react/dist/esm/defaultAttributes.js
707
- var defaultAttributes = {
708
- xmlns: "http://www.w3.org/2000/svg",
709
- width: 24,
710
- height: 24,
711
- viewBox: "0 0 24 24",
712
- fill: "none",
713
- stroke: "currentColor",
714
- strokeWidth: 2,
715
- strokeLinecap: "round",
716
- strokeLinejoin: "round"
717
- };
718
-
719
- // node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.js
720
- var hasA11yProp = (props) => {
721
- for (const prop in props) {
722
- if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
723
- return true;
724
- }
725
- }
726
- return false;
727
- };
728
- var LucideContext = createContext({});
729
- var useLucideContext = () => useContext(LucideContext);
730
-
731
- // node_modules/lucide-react/dist/esm/Icon.js
732
- var Icon = forwardRef(
733
- ({ color, size, strokeWidth, absoluteStrokeWidth, className = "", children, iconNode, ...rest }, ref) => {
734
- const {
735
- size: contextSize = 24,
736
- strokeWidth: contextStrokeWidth = 2,
737
- absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,
738
- color: contextColor = "currentColor",
739
- className: contextClass = ""
740
- } = useLucideContext() ?? {};
741
- const calculatedStrokeWidth = absoluteStrokeWidth ?? contextAbsoluteStrokeWidth ? Number(strokeWidth ?? contextStrokeWidth) * 24 / Number(size ?? contextSize) : strokeWidth ?? contextStrokeWidth;
742
- return createElement(
743
- "svg",
744
- {
745
- ref,
746
- ...defaultAttributes,
747
- width: size ?? contextSize ?? defaultAttributes.width,
748
- height: size ?? contextSize ?? defaultAttributes.height,
749
- stroke: color ?? contextColor,
750
- strokeWidth: calculatedStrokeWidth,
751
- className: mergeClasses("lucide", contextClass, className),
752
- ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
753
- ...rest
754
- },
755
- [
756
- ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
757
- ...Array.isArray(children) ? children : [children]
758
- ]
759
- );
760
- }
761
- );
762
-
763
- // node_modules/lucide-react/dist/esm/createLucideIcon.js
764
- var createLucideIcon = (iconName, iconNode) => {
765
- const Component2 = forwardRef(
766
- ({ className, ...props }, ref) => createElement(Icon, {
767
- ref,
768
- iconNode,
769
- className: mergeClasses(
770
- `lucide-${toKebabCase(toPascalCase(iconName))}`,
771
- `lucide-${iconName}`,
772
- className
773
- ),
774
- ...props
775
- })
776
- );
777
- Component2.displayName = toPascalCase(iconName);
778
- return Component2;
779
- };
780
-
781
- // node_modules/lucide-react/dist/esm/icons/check.js
782
- var __iconNode = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
783
- var Check = createLucideIcon("check", __iconNode);
784
-
785
- // node_modules/lucide-react/dist/esm/icons/chevron-down.js
786
- var __iconNode2 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
787
- var ChevronDown = createLucideIcon("chevron-down", __iconNode2);
788
-
789
- // node_modules/lucide-react/dist/esm/icons/chevron-right.js
790
- var __iconNode3 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
791
- var ChevronRight = createLucideIcon("chevron-right", __iconNode3);
792
-
793
- // node_modules/lucide-react/dist/esm/icons/code.js
794
- var __iconNode4 = [
795
- ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
796
- ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
797
- ];
798
- var Code = createLucideIcon("code", __iconNode4);
799
-
800
- // node_modules/lucide-react/dist/esm/icons/copy.js
801
- var __iconNode5 = [
802
- ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
803
- ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
804
- ];
805
- var Copy = createLucideIcon("copy", __iconNode5);
806
-
807
- // node_modules/lucide-react/dist/esm/icons/database.js
808
- var __iconNode6 = [
809
- ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
810
- ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
811
- ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
812
- ];
813
- var Database = createLucideIcon("database", __iconNode6);
814
-
815
- // node_modules/lucide-react/dist/esm/icons/external-link.js
816
- var __iconNode7 = [
817
- ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
818
- ["path", { d: "M10 14 21 3", key: "gplh6r" }],
819
- ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
820
- ];
821
- var ExternalLink = createLucideIcon("external-link", __iconNode7);
822
-
823
- // node_modules/lucide-react/dist/esm/icons/file-text.js
824
- var __iconNode8 = [
825
- [
826
- "path",
827
- {
828
- d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
829
- key: "1oefj6"
830
- }
831
- ],
832
- ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
833
- ["path", { d: "M10 9H8", key: "b1mrlr" }],
834
- ["path", { d: "M16 13H8", key: "t4e002" }],
835
- ["path", { d: "M16 17H8", key: "z1uh3a" }]
836
- ];
837
- var FileText = createLucideIcon("file-text", __iconNode8);
1114
+ var UnderConstruction = ({
1115
+ title,
1116
+ description,
1117
+ subtitle,
1118
+ logoUrl,
1119
+ accentColor = "#2563eb"
1120
+ // Default elegant blue
1121
+ }) => {
1122
+ return /* @__PURE__ */ jsxs("div", { className: "tecof-uc-wrapper", children: [
1123
+ /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: `
1124
+ .tecof-uc-wrapper {
1125
+ min-height: 100vh;
1126
+ display: flex;
1127
+ align-items: center;
1128
+ justify-content: center;
1129
+ background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
1130
+ radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
1131
+ #090d16;
1132
+ color: #f8fafc;
1133
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
1134
+ padding: 2rem 1rem;
1135
+ box-sizing: border-box;
1136
+ position: relative;
1137
+ overflow: hidden;
1138
+ }
838
1139
 
839
- // node_modules/lucide-react/dist/esm/icons/file.js
840
- var __iconNode9 = [
841
- [
842
- "path",
843
- {
844
- d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
845
- key: "1oefj6"
846
- }
847
- ],
848
- ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
849
- ];
850
- var File2 = createLucideIcon("file", __iconNode9);
1140
+ /* Ambient glowing circles */
1141
+ .tecof-uc-glow-1 {
1142
+ position: absolute;
1143
+ top: 20%;
1144
+ left: 50%;
1145
+ transform: translate(-50%, -50%);
1146
+ width: 500px;
1147
+ height: 500px;
1148
+ background: ${accentColor};
1149
+ filter: blur(150px);
1150
+ opacity: 0.12;
1151
+ pointer-events: none;
1152
+ z-index: 1;
1153
+ border-radius: 50%;
1154
+ animation: tecof-uc-pulse 8s infinite alternate ease-in-out;
1155
+ }
851
1156
 
852
- // node_modules/lucide-react/dist/esm/icons/folder-open.js
853
- var __iconNode10 = [
854
- [
855
- "path",
856
- {
857
- d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",
858
- key: "usdka0"
859
- }
860
- ]
861
- ];
862
- var FolderOpen = createLucideIcon("folder-open", __iconNode10);
1157
+ .tecof-uc-container {
1158
+ position: relative;
1159
+ z-index: 2;
1160
+ max-width: 540px;
1161
+ width: 100%;
1162
+ background: rgba(17, 24, 39, 0.55);
1163
+ backdrop-filter: blur(20px);
1164
+ -webkit-backdrop-filter: blur(20px);
1165
+ border: 1px solid rgba(255, 255, 255, 0.08);
1166
+ border-radius: 24px;
1167
+ padding: 3.5rem 2.5rem;
1168
+ text-align: center;
1169
+ box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
1170
+ inset 0 1px 0 rgba(255, 255, 255, 0.1);
1171
+ animation: tecof-uc-fade-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
1172
+ }
863
1173
 
864
- // node_modules/lucide-react/dist/esm/icons/globe.js
865
- var __iconNode11 = [
866
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
867
- ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
868
- ["path", { d: "M2 12h20", key: "9i4pu4" }]
869
- ];
870
- var Globe = createLucideIcon("globe", __iconNode11);
1174
+ .tecof-uc-logo-area {
1175
+ margin-bottom: 2.5rem;
1176
+ display: flex;
1177
+ justify-content: center;
1178
+ align-items: center;
1179
+ }
871
1180
 
872
- // node_modules/lucide-react/dist/esm/icons/grip-vertical.js
873
- var __iconNode12 = [
874
- ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
875
- ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
876
- ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
877
- ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
878
- ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
879
- ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
880
- ];
881
- var GripVertical = createLucideIcon("grip-vertical", __iconNode12);
1181
+ .tecof-uc-logo {
1182
+ max-height: 56px;
1183
+ max-width: 200px;
1184
+ object-fit: contain;
1185
+ filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
1186
+ }
882
1187
 
883
- // node_modules/lucide-react/dist/esm/icons/image-plus.js
884
- var __iconNode13 = [
885
- ["path", { d: "M16 5h6", key: "1vod17" }],
886
- ["path", { d: "M19 2v6", key: "4bpg5p" }],
887
- ["path", { d: "M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5", key: "1ue2ih" }],
888
- ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }],
889
- ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }]
890
- ];
891
- var ImagePlus = createLucideIcon("image-plus", __iconNode13);
1188
+ .tecof-uc-logo-fallback {
1189
+ font-size: 1.5rem;
1190
+ font-weight: 700;
1191
+ letter-spacing: -0.025em;
1192
+ background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
1193
+ -webkit-background-clip: text;
1194
+ -webkit-text-fill-color: transparent;
1195
+ }
892
1196
 
893
- // node_modules/lucide-react/dist/esm/icons/image.js
894
- var __iconNode14 = [
895
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
896
- ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
897
- ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
898
- ];
899
- var Image2 = createLucideIcon("image", __iconNode14);
1197
+ .tecof-uc-icon-wrapper {
1198
+ width: 80px;
1199
+ height: 80px;
1200
+ border-radius: 20px;
1201
+ background: rgba(255, 255, 255, 0.03);
1202
+ border: 1px solid rgba(255, 255, 255, 0.08);
1203
+ display: flex;
1204
+ align-items: center;
1205
+ justify-content: center;
1206
+ margin: 0 auto 2.2rem auto;
1207
+ color: ${accentColor};
1208
+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
1209
+ position: relative;
1210
+ }
900
1211
 
901
- // node_modules/lucide-react/dist/esm/icons/languages.js
902
- var __iconNode15 = [
903
- ["path", { d: "m5 8 6 6", key: "1wu5hv" }],
904
- ["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
905
- ["path", { d: "M2 5h12", key: "or177f" }],
906
- ["path", { d: "M7 2h1", key: "1t2jsx" }],
907
- ["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
908
- ["path", { d: "M14 18h6", key: "1m8k6r" }]
909
- ];
910
- var Languages = createLucideIcon("languages", __iconNode15);
1212
+ .tecof-uc-icon-glow {
1213
+ position: absolute;
1214
+ inset: -2px;
1215
+ border-radius: 22px;
1216
+ background: linear-gradient(135deg, ${accentColor}, transparent);
1217
+ opacity: 0.3;
1218
+ z-index: -1;
1219
+ filter: blur(4px);
1220
+ }
911
1221
 
912
- // node_modules/lucide-react/dist/esm/icons/link-2.js
913
- var __iconNode16 = [
914
- ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
915
- ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
916
- ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
917
- ];
918
- var Link2 = createLucideIcon("link-2", __iconNode16);
1222
+ .tecof-uc-icon-wrapper svg {
1223
+ width: 36px;
1224
+ height: 36px;
1225
+ stroke-width: 1.5;
1226
+ animation: tecof-uc-float 4s ease-in-out infinite;
1227
+ }
919
1228
 
920
- // node_modules/lucide-react/dist/esm/icons/link.js
921
- var __iconNode17 = [
922
- ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
923
- ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
924
- ];
925
- var Link = createLucideIcon("link", __iconNode17);
1229
+ .tecof-uc-subtitle {
1230
+ font-size: 0.875rem;
1231
+ font-weight: 600;
1232
+ text-transform: uppercase;
1233
+ letter-spacing: 0.15em;
1234
+ color: ${accentColor};
1235
+ margin-bottom: 0.75rem;
1236
+ }
926
1237
 
927
- // node_modules/lucide-react/dist/esm/icons/loader-circle.js
928
- var __iconNode18 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
929
- var LoaderCircle = createLucideIcon("loader-circle", __iconNode18);
1238
+ .tecof-uc-title {
1239
+ font-size: 2.25rem;
1240
+ font-weight: 800;
1241
+ line-height: 1.2;
1242
+ letter-spacing: -0.025em;
1243
+ color: #ffffff;
1244
+ margin-top: 0;
1245
+ margin-bottom: 1.25rem;
1246
+ background: linear-gradient(to bottom, #ffffff 0%, #cbd5e1 100%);
1247
+ -webkit-background-clip: text;
1248
+ -webkit-text-fill-color: transparent;
1249
+ }
930
1250
 
931
- // node_modules/lucide-react/dist/esm/icons/pencil.js
932
- var __iconNode19 = [
933
- [
934
- "path",
935
- {
936
- d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
937
- key: "1a8usu"
938
- }
939
- ],
940
- ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
941
- ];
942
- var Pencil = createLucideIcon("pencil", __iconNode19);
1251
+ .tecof-uc-description {
1252
+ font-size: 1.05rem;
1253
+ line-height: 1.6;
1254
+ color: #94a3b8;
1255
+ margin: 0 auto 2.5rem auto;
1256
+ max-width: 420px;
1257
+ }
943
1258
 
944
- // node_modules/lucide-react/dist/esm/icons/plus.js
945
- var __iconNode20 = [
946
- ["path", { d: "M5 12h14", key: "1ays0h" }],
947
- ["path", { d: "M12 5v14", key: "s699le" }]
948
- ];
949
- var Plus = createLucideIcon("plus", __iconNode20);
1259
+ .tecof-uc-divider {
1260
+ height: 1px;
1261
+ background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 100%);
1262
+ margin-bottom: 2rem;
1263
+ }
950
1264
 
951
- // node_modules/lucide-react/dist/esm/icons/refresh-ccw.js
952
- var __iconNode21 = [
953
- ["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
954
- ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
955
- ["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
956
- ["path", { d: "M16 16h5v5", key: "ccwih5" }]
957
- ];
958
- var RefreshCcw = createLucideIcon("refresh-ccw", __iconNode21);
1265
+ .tecof-uc-badge {
1266
+ display: inline-flex;
1267
+ align-items: center;
1268
+ gap: 0.5rem;
1269
+ background: rgba(255, 255, 255, 0.04);
1270
+ border: 1px solid rgba(255, 255, 255, 0.08);
1271
+ border-radius: 99px;
1272
+ padding: 0.5rem 1.25rem;
1273
+ font-size: 0.825rem;
1274
+ font-weight: 500;
1275
+ color: #94a3b8;
1276
+ text-decoration: none;
1277
+ transition: all 0.2s ease-in-out;
1278
+ }
959
1279
 
960
- // node_modules/lucide-react/dist/esm/icons/refresh-cw.js
961
- var __iconNode22 = [
962
- ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
963
- ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
964
- ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
965
- ["path", { d: "M8 16H3v5", key: "1cv678" }]
966
- ];
967
- var RefreshCw = createLucideIcon("refresh-cw", __iconNode22);
1280
+ .tecof-uc-badge:hover {
1281
+ background: rgba(255, 255, 255, 0.08);
1282
+ border-color: rgba(255, 255, 255, 0.15);
1283
+ color: #f8fafc;
1284
+ transform: translateY(-1px);
1285
+ }
968
1286
 
969
- // node_modules/lucide-react/dist/esm/icons/rotate-ccw.js
970
- var __iconNode23 = [
971
- ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
972
- ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
973
- ];
974
- var RotateCcw = createLucideIcon("rotate-ccw", __iconNode23);
1287
+ .tecof-uc-badge-dot {
1288
+ width: 6px;
1289
+ height: 6px;
1290
+ background-color: ${accentColor};
1291
+ border-radius: 50%;
1292
+ box-shadow: 0 0 10px ${accentColor};
1293
+ animation: tecof-uc-blink 1.5s infinite alternate;
1294
+ }
975
1295
 
976
- // node_modules/lucide-react/dist/esm/icons/search.js
977
- var __iconNode24 = [
978
- ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
979
- ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
980
- ];
981
- var Search = createLucideIcon("search", __iconNode24);
1296
+ /* Animations */
1297
+ @keyframes tecof-uc-pulse {
1298
+ 0% { opacity: 0.08; transform: translate(-50%, -50%) scale(0.95); }
1299
+ 100% { opacity: 0.15; transform: translate(-50%, -50%) scale(1.05); }
1300
+ }
982
1301
 
983
- // node_modules/lucide-react/dist/esm/icons/trash-2.js
984
- var __iconNode25 = [
985
- ["path", { d: "M10 11v6", key: "nco0om" }],
986
- ["path", { d: "M14 11v6", key: "outv1u" }],
987
- ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
988
- ["path", { d: "M3 6h18", key: "d0wm0j" }],
989
- ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
990
- ];
991
- var Trash2 = createLucideIcon("trash-2", __iconNode25);
1302
+ @keyframes tecof-uc-fade-in {
1303
+ 0% { opacity: 0; transform: translateY(20px); }
1304
+ 100% { opacity: 1; transform: translateY(0); }
1305
+ }
992
1306
 
993
- // node_modules/lucide-react/dist/esm/icons/upload.js
994
- var __iconNode26 = [
995
- ["path", { d: "M12 3v12", key: "1x0j5s" }],
996
- ["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }],
997
- ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }]
998
- ];
999
- var Upload = createLucideIcon("upload", __iconNode26);
1307
+ @keyframes tecof-uc-float {
1308
+ 0% { transform: translateY(0px) rotate(0deg); }
1309
+ 50% { transform: translateY(-5px) rotate(3deg); }
1310
+ 100% { transform: translateY(0px) rotate(0deg); }
1311
+ }
1000
1312
 
1001
- // node_modules/lucide-react/dist/esm/icons/x.js
1002
- var __iconNode27 = [
1003
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
1004
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
1005
- ];
1006
- var X = createLucideIcon("x", __iconNode27);
1313
+ @keyframes tecof-uc-blink {
1314
+ 0% { opacity: 0.3; }
1315
+ 100% { opacity: 1; }
1316
+ }
1317
+
1318
+ @media (max-width: 640px) {
1319
+ .tecof-uc-container {
1320
+ padding: 2.5rem 1.5rem;
1321
+ border-radius: 20px;
1322
+ }
1323
+ .tecof-uc-title {
1324
+ font-size: 1.75rem;
1325
+ }
1326
+ .tecof-uc-description {
1327
+ font-size: 0.95rem;
1328
+ margin-bottom: 2rem;
1329
+ }
1330
+ }
1331
+ ` } }),
1332
+ /* @__PURE__ */ jsx("div", { className: "tecof-uc-glow-1" }),
1333
+ /* @__PURE__ */ jsxs("div", { className: "tecof-uc-container", children: [
1334
+ logoUrl ? /* @__PURE__ */ jsx("div", { className: "tecof-uc-logo-area", children: /* @__PURE__ */ jsx("img", { src: logoUrl, alt: "Store Logo", className: "tecof-uc-logo" }) }) : /* @__PURE__ */ jsx("div", { className: "tecof-uc-logo-area", children: /* @__PURE__ */ jsx("div", { className: "tecof-uc-logo-fallback", children: "TECOF" }) }),
1335
+ /* @__PURE__ */ jsxs("div", { className: "tecof-uc-icon-wrapper", children: [
1336
+ /* @__PURE__ */ jsx("div", { className: "tecof-uc-icon-glow" }),
1337
+ /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z", strokeLinecap: "round", strokeLinejoin: "round" }) })
1338
+ ] }),
1339
+ subtitle && /* @__PURE__ */ jsx("div", { className: "tecof-uc-subtitle", children: subtitle }),
1340
+ /* @__PURE__ */ jsx("h1", { className: "tecof-uc-title", children: title }),
1341
+ /* @__PURE__ */ jsx("p", { className: "tecof-uc-description", children: description }),
1342
+ /* @__PURE__ */ jsx("div", { className: "tecof-uc-divider" }),
1343
+ /* @__PURE__ */ jsxs("div", { className: "tecof-uc-badge", children: [
1344
+ /* @__PURE__ */ jsx("span", { className: "tecof-uc-badge-dot" }),
1345
+ /* @__PURE__ */ jsx("span", { children: "Yap\u0131m A\u015Famas\u0131nda" })
1346
+ ] })
1347
+ ] })
1348
+ ] });
1349
+ };
1350
+ var merchantInfoCache = /* @__PURE__ */ new Map();
1351
+ var CACHE_TTL = 5 * 60 * 1e3;
1352
+ function useLanguages() {
1353
+ const { apiClient, secretKey, apiUrl } = useTecof();
1354
+ const [merchantInfo, setMerchantInfo] = useState(null);
1355
+ const [loading, setLoading] = useState(true);
1356
+ const [error2, setError] = useState(null);
1357
+ const [activeTab, setActiveTab] = useState("");
1358
+ const cacheKey = useMemo(() => `${apiUrl}::${secretKey}`, [apiUrl, secretKey]);
1359
+ useEffect(() => {
1360
+ let cancelled = false;
1361
+ const fetchInfo = async () => {
1362
+ const cached = merchantInfoCache.get(cacheKey);
1363
+ if (cached && Date.now() - cached.ts < CACHE_TTL) {
1364
+ setMerchantInfo(cached.data);
1365
+ if (!activeTab) setActiveTab(cached.data.defaultLanguage);
1366
+ setLoading(false);
1367
+ return;
1368
+ }
1369
+ setLoading(true);
1370
+ setError(null);
1371
+ const res2 = await apiClient.getMerchantInfo();
1372
+ if (cancelled) return;
1373
+ if (res2.success && res2.data) {
1374
+ merchantInfoCache.set(cacheKey, { data: res2.data, ts: Date.now() });
1375
+ setMerchantInfo(res2.data);
1376
+ if (!activeTab) setActiveTab(res2.data.defaultLanguage);
1377
+ } else {
1378
+ setError(res2.message || "Failed to load languages");
1379
+ const fallback = { languages: ["tr"], defaultLanguage: "tr" };
1380
+ setMerchantInfo(fallback);
1381
+ if (!activeTab) setActiveTab("tr");
1382
+ }
1383
+ setLoading(false);
1384
+ };
1385
+ fetchInfo();
1386
+ return () => {
1387
+ cancelled = true;
1388
+ };
1389
+ }, [apiClient, cacheKey]);
1390
+ return { merchantInfo, loading, error: error2, activeTab, setActiveTab };
1391
+ }
1007
1392
  var FieldErrorBoundary = class extends Component {
1008
1393
  constructor(props) {
1009
1394
  super(props);
@@ -4904,7 +5289,7 @@ var MediaDrawer = ({
4904
5289
  alt: file2.name,
4905
5290
  size: "thumbnail",
4906
5291
  className: "tecof-upload-gallery-thumb",
4907
- imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "6px" }
5292
+ imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
4908
5293
  }
4909
5294
  ) : /* @__PURE__ */ jsx("div", { className: "tecof-upload-gallery-thumb tecof-upload-gallery-file-icon-wrap", children: /* @__PURE__ */ jsx(File2, { size: 24, color: "#a1a1aa" }) }),
4910
5295
  /* @__PURE__ */ jsx("p", { className: "tecof-upload-gallery-file-name", children: file2.meta?.originalName || file2.name })
@@ -22782,16 +23167,16 @@ var FileItemRenderer = ({
22782
23167
  `${cdnUrl}/${file2.name}`;
22783
23168
  const ext = getFileExtension(file2.name);
22784
23169
  return /* @__PURE__ */ jsxs("div", { className: "tecof-upload-file-item", children: [
22785
- file2.type === "image/reference" ? /* @__PURE__ */ jsx("div", { className: "tecof-upload-file-icon", style: { backgroundColor: "#eef2ff", color: "#4f46e5" }, children: /* @__PURE__ */ jsx(Code, { size: 20 }) }) : isImageType2(file2.type) ? /* @__PURE__ */ jsx(
23170
+ file2.type === "image/reference" ? /* @__PURE__ */ jsx("div", { className: "tecof-upload-file-icon", style: { backgroundColor: "#f4f4f5", color: "#18181b" }, children: /* @__PURE__ */ jsx(Code, { size: 16 }) }) : isImageType2(file2.type) ? /* @__PURE__ */ jsx(
22786
23171
  TecofPicture,
22787
23172
  {
22788
23173
  data: file2,
22789
23174
  alt: file2.meta?.originalName || file2.name,
22790
23175
  size: "thumbnail",
22791
23176
  className: "tecof-upload-file-thumb",
22792
- imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "10px" }
23177
+ imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "6px" }
22793
23178
  }
22794
- ) : /* @__PURE__ */ jsx("div", { className: "tecof-upload-file-icon", children: /* @__PURE__ */ jsx(File2, { size: 20 }) }),
23179
+ ) : /* @__PURE__ */ jsx("div", { className: "tecof-upload-file-icon", children: /* @__PURE__ */ jsx(File2, { size: 16 }) }),
22795
23180
  /* @__PURE__ */ jsxs("div", { className: "tecof-upload-file-info", children: [
22796
23181
  /* @__PURE__ */ jsx("p", { className: "tecof-upload-file-name", title: file2.meta?.originalName || file2.name, children: file2.meta?.originalName || file2.name }),
22797
23182
  /* @__PURE__ */ jsxs("div", { className: "tecof-upload-file-meta", children: [
@@ -22920,10 +23305,6 @@ var UploadField = ({
22920
23305
  const [drawerOpen, setDrawerOpen] = useState(false);
22921
23306
  const [showRefInput, setShowRefInput] = useState(false);
22922
23307
  const [refCode, setRefCode] = useState("{{ data. }}");
22923
- const [galleryFiles, setGalleryFiles] = useState([]);
22924
- const [loading, setLoading] = useState(false);
22925
- const [refreshKey, setRefreshKey] = useState(0);
22926
- const [gallerySearch, setGallerySearch] = useState("");
22927
23308
  const sourceToIdRef = useRef(/* @__PURE__ */ new Map());
22928
23309
  const compressFile = useCallback(async (file2) => {
22929
23310
  if (!imageCompressionEnabled) return file2;
@@ -22980,16 +23361,6 @@ var UploadField = ({
22980
23361
  setShowRefInput(false);
22981
23362
  setRefCode("{{ data. }}");
22982
23363
  }, [refCode, allowMultiple, value, onChange]);
22983
- useEffect(() => {
22984
- if (!drawerOpen) return;
22985
- setLoading(true);
22986
- apiClient.getUploads(1, 100).then((res2) => {
22987
- if (res2.success && res2.data) {
22988
- setGalleryFiles(res2.data);
22989
- }
22990
- setLoading(false);
22991
- }).catch(() => setLoading(false));
22992
- }, [drawerOpen, refreshKey, apiClient]);
22993
23364
  const toggleGalleryFile = useCallback((file2) => {
22994
23365
  if (allowMultiple) {
22995
23366
  const exists = value.some((f2) => f2._id === file2._id);
@@ -23062,9 +23433,6 @@ var UploadField = ({
23062
23433
  }
23063
23434
  };
23064
23435
  const canAddMore = allowMultiple ? value.length < maxFiles : value.length === 0;
23065
- const filteredGallery = gallerySearch.trim() ? galleryFiles.filter(
23066
- (f2) => f2.name?.toLowerCase().includes(gallerySearch.toLowerCase()) || f2.meta?.originalName?.toLowerCase().includes(gallerySearch.toLowerCase())
23067
- ) : galleryFiles;
23068
23436
  return /* @__PURE__ */ jsxs("div", { className: "tecof-upload-container", children: [
23069
23437
  value.length > 0 && /* @__PURE__ */ jsxs("div", { className: "tecof-upload-file-list", children: [
23070
23438
  showUploadedFiles && /* @__PURE__ */ jsxs("div", { className: "tecof-upload-uploaded-header", children: [
@@ -23082,52 +23450,50 @@ var UploadField = ({
23082
23450
  file2._id || idx
23083
23451
  ))
23084
23452
  ] }),
23085
- value.length === 0 && !readOnly && canAddMore && !showPond && /* @__PURE__ */ jsxs(
23086
- "div",
23087
- {
23088
- className: "tecof-upload-empty-state",
23089
- onClick: () => setDrawerOpen(true),
23090
- children: [
23091
- /* @__PURE__ */ jsx("div", { className: "tecof-upload-empty-icon", children: /* @__PURE__ */ jsx(ImagePlus, { size: 22 }) }),
23092
- /* @__PURE__ */ jsx("p", { className: "tecof-upload-empty-title", children: "Dosya ekleyin" }),
23093
- /* @__PURE__ */ jsx("p", { className: "tecof-upload-empty-desc", children: "Medya k\xFCt\xFCphanesinden se\xE7in veya yeni y\xFCkleyin" })
23094
- ]
23095
- }
23096
- ),
23453
+ value.length === 0 && !readOnly && canAddMore && !showPond && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
23454
+ /* @__PURE__ */ jsxs(
23455
+ "div",
23456
+ {
23457
+ className: "tecof-upload-empty-state",
23458
+ onClick: () => setDrawerOpen(true),
23459
+ children: [
23460
+ /* @__PURE__ */ jsx("div", { className: "tecof-upload-empty-icon", children: /* @__PURE__ */ jsx(ImagePlus, { size: 16 }) }),
23461
+ /* @__PURE__ */ jsx("p", { className: "tecof-upload-empty-title", children: "Dosya ekleyin" }),
23462
+ /* @__PURE__ */ jsx("p", { className: "tecof-upload-empty-desc", children: "Medya k\xFCt\xFCphanesinden se\xE7in veya yeni y\xFCkleyin" })
23463
+ ]
23464
+ }
23465
+ ),
23466
+ !showRefInput && /* @__PURE__ */ jsxs("div", { className: "tecof-upload-main-actions", children: [
23467
+ /* @__PURE__ */ jsxs("button", { type: "button", className: "tecof-upload-btn-secondary", onClick: () => setShowRefInput(true), children: [
23468
+ /* @__PURE__ */ jsx(Code, { size: 13 }),
23469
+ " Referans Gir"
23470
+ ] }),
23471
+ /* @__PURE__ */ jsxs("button", { type: "button", className: "tecof-upload-btn-primary", onClick: () => setShowPond(true), children: [
23472
+ /* @__PURE__ */ jsx(Upload, { size: 13 }),
23473
+ " Yeni Y\xFCkle"
23474
+ ] })
23475
+ ] })
23476
+ ] }),
23097
23477
  !readOnly && canAddMore && !showPond && value.length > 0 && !showRefInput && /* @__PURE__ */ jsxs("div", { className: "tecof-upload-main-actions", children: [
23098
23478
  /* @__PURE__ */ jsxs("button", { type: "button", className: "tecof-upload-btn-secondary", onClick: () => setShowRefInput(true), children: [
23099
- /* @__PURE__ */ jsx(Code, { size: 15 }),
23479
+ /* @__PURE__ */ jsx(Code, { size: 13 }),
23100
23480
  " Referans"
23101
23481
  ] }),
23102
23482
  /* @__PURE__ */ jsxs("button", { type: "button", className: "tecof-upload-btn-secondary", onClick: () => setDrawerOpen(true), children: [
23103
- /* @__PURE__ */ jsx(FolderOpen, { size: 15 }),
23104
- " Medya Se\xE7"
23105
- ] }),
23106
- /* @__PURE__ */ jsxs("button", { type: "button", className: "tecof-upload-btn-primary", onClick: () => setShowPond(true), children: [
23107
- /* @__PURE__ */ jsx(Upload, { size: 15 }),
23108
- " Yeni Y\xFCkle"
23109
- ] })
23110
- ] }),
23111
- value.length === 0 && !readOnly && canAddMore && !showPond && !showRefInput && /* @__PURE__ */ jsxs("div", { className: "tecof-upload-main-actions", children: [
23112
- /* @__PURE__ */ jsxs("button", { type: "button", className: "tecof-upload-btn-secondary", onClick: () => setShowRefInput(true), children: [
23113
- /* @__PURE__ */ jsx(Code, { size: 15 }),
23114
- " Dinamik Referans Se\xE7"
23483
+ /* @__PURE__ */ jsx(FolderOpen, { size: 13 }),
23484
+ " K\xFCt\xFCphane"
23115
23485
  ] }),
23116
23486
  /* @__PURE__ */ jsxs("button", { type: "button", className: "tecof-upload-btn-primary", onClick: () => setShowPond(true), children: [
23117
- /* @__PURE__ */ jsx(Upload, { size: 15 }),
23118
- " Yeni Y\xFCkle"
23487
+ /* @__PURE__ */ jsx(Upload, { size: 13 }),
23488
+ " Y\xFCkle"
23119
23489
  ] })
23120
23490
  ] }),
23121
- showRefInput && /* @__PURE__ */ jsxs("div", { className: "tecof-upload-ref-section", style: { background: "#f8fafc", padding: "12px", borderRadius: "8px", border: "1px solid #e2e8f0", marginTop: "10px" }, children: [
23122
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "8px" }, children: [
23123
- /* @__PURE__ */ jsxs("span", { style: { fontSize: "12px", fontWeight: 500, color: "#475569" }, children: [
23124
- "Dinamik CMS De\u011Fi\u015Fkeni (\xD6rn: ",
23125
- `{{ data.image }}`,
23126
- ")"
23127
- ] }),
23128
- /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setShowRefInput(false), style: { background: "none", border: "none", cursor: "pointer", color: "#64748b" }, children: /* @__PURE__ */ jsx(X, { size: 14 }) })
23491
+ showRefInput && /* @__PURE__ */ jsxs("div", { className: "tecof-upload-ref-section", style: { background: "#ffffff", padding: "10px", borderRadius: "8px", border: "1px solid #e4e4e7", display: "flex", flexDirection: "column", gap: "8px", marginTop: "4px" }, children: [
23492
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
23493
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "11px", fontWeight: 500, color: "#71717a" }, children: "Dinamik CMS De\u011Fi\u015Fkeni" }),
23494
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setShowRefInput(false), style: { background: "none", border: "none", cursor: "pointer", color: "#a1a1aa", padding: 0 }, children: /* @__PURE__ */ jsx(X, { size: 12 }) })
23129
23495
  ] }),
23130
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
23496
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "6px" }, children: [
23131
23497
  /* @__PURE__ */ jsx(
23132
23498
  "input",
23133
23499
  {
@@ -23135,7 +23501,7 @@ var UploadField = ({
23135
23501
  value: refCode,
23136
23502
  onChange: (e3) => setRefCode(e3.target.value),
23137
23503
  placeholder: "{{ data. }}",
23138
- style: { flex: 1, padding: "8px 10px", fontSize: "13px", borderRadius: "6px", border: "1px solid #cbd5e1", outline: "none" },
23504
+ style: { flex: 1, padding: "6px 8px", fontSize: "12px", borderRadius: "6px", border: "1px solid #cbd5e1", outline: "none" },
23139
23505
  autoFocus: true,
23140
23506
  onKeyDown: (e3) => {
23141
23507
  if (e3.key === "Enter") {
@@ -23150,7 +23516,7 @@ var UploadField = ({
23150
23516
  {
23151
23517
  type: "button",
23152
23518
  onClick: handleAddRef,
23153
- style: { padding: "0 12px", background: "#4f46e5", color: "#fff", fontSize: "12px", fontWeight: 500, borderRadius: "6px", border: "none", cursor: "pointer" },
23519
+ style: { padding: "0 10px", background: "#18181b", color: "#fff", fontSize: "11px", fontWeight: 500, borderRadius: "6px", border: "none", cursor: "pointer" },
23154
23520
  children: "Ekle"
23155
23521
  }
23156
23522
  )
@@ -23194,97 +23560,18 @@ var UploadField = ({
23194
23560
  }
23195
23561
  ) })
23196
23562
  ] }),
23197
- /* @__PURE__ */ jsx(Drawer.Root, { open: drawerOpen, onOpenChange: (open) => {
23198
- setDrawerOpen(open);
23199
- if (!open) setGallerySearch("");
23200
- }, children: /* @__PURE__ */ jsxs(Drawer.Portal, { children: [
23201
- /* @__PURE__ */ jsx(Drawer.Overlay, { className: "tecof-upload-drawer-overlay" }),
23202
- /* @__PURE__ */ jsxs(Drawer.Content, { className: "tecof-upload-drawer-content", children: [
23203
- /* @__PURE__ */ jsx(Drawer.Title, { className: "tecof-sr-only", children: "Medya Y\xF6neticisi" }),
23204
- /* @__PURE__ */ jsx(Drawer.Description, { className: "tecof-sr-only", children: "Sunucudaki dosyalardan birini se\xE7in veya yeni dosya y\xFCkleyin" }),
23205
- /* @__PURE__ */ jsx("div", { className: "tecof-upload-drawer-handle" }),
23206
- /* @__PURE__ */ jsxs("div", { className: "tecof-upload-drawer-inner", children: [
23207
- /* @__PURE__ */ jsxs("div", { className: "tecof-upload-drawer-header", children: [
23208
- /* @__PURE__ */ jsx("h2", { className: "tecof-upload-drawer-title", children: "Medya K\xFCt\xFCphanesi" }),
23209
- /* @__PURE__ */ jsxs("div", { className: "tecof-upload-drawer-header-actions", children: [
23210
- /* @__PURE__ */ jsx(
23211
- "button",
23212
- {
23213
- className: "tecof-upload-drawer-action-btn",
23214
- onClick: () => setRefreshKey((k2) => k2 + 1),
23215
- disabled: loading,
23216
- title: "Yenile",
23217
- children: /* @__PURE__ */ jsx(RefreshCcw, { size: 15, className: loading ? "tecof-upload-spin" : "" })
23218
- }
23219
- ),
23220
- /* @__PURE__ */ jsx(
23221
- "button",
23222
- {
23223
- className: "tecof-upload-drawer-action-btn",
23224
- onClick: () => setDrawerOpen(false),
23225
- title: "Kapat",
23226
- children: /* @__PURE__ */ jsx(X, { size: 15 })
23227
- }
23228
- )
23229
- ] })
23230
- ] }),
23231
- /* @__PURE__ */ jsxs("div", { className: "tecof-upload-search-box", children: [
23232
- /* @__PURE__ */ jsx(Search, { size: 15, color: "#a1a1aa" }),
23233
- /* @__PURE__ */ jsx(
23234
- "input",
23235
- {
23236
- type: "text",
23237
- placeholder: "Dosya ara...",
23238
- value: gallerySearch,
23239
- onChange: (e3) => setGallerySearch(e3.target.value),
23240
- className: "tecof-upload-search-input"
23241
- }
23242
- ),
23243
- gallerySearch && /* @__PURE__ */ jsx(
23244
- "button",
23245
- {
23246
- type: "button",
23247
- className: "tecof-upload-action-btn tecof-upload-clear-search-btn",
23248
- onClick: () => setGallerySearch(""),
23249
- children: /* @__PURE__ */ jsx(X, { size: 13 })
23250
- }
23251
- )
23252
- ] }),
23253
- loading ? /* @__PURE__ */ jsxs("div", { className: "tecof-upload-gallery-empty", children: [
23254
- /* @__PURE__ */ jsx("div", { className: "tecof-upload-gallery-empty-icon", children: /* @__PURE__ */ jsx(RefreshCcw, { size: 24, color: "#a1a1aa", className: "tecof-upload-spin" }) }),
23255
- /* @__PURE__ */ jsx("p", { className: "tecof-upload-loading-text", children: "Y\xFCkleniyor..." })
23256
- ] }) : filteredGallery.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "tecof-upload-gallery-empty", children: [
23257
- /* @__PURE__ */ jsx("div", { className: "tecof-upload-gallery-empty-icon", children: /* @__PURE__ */ jsx(Image2, { size: 24, color: "#a1a1aa" }) }),
23258
- /* @__PURE__ */ jsx("p", { className: "tecof-upload-empty-heading", children: gallerySearch ? "Sonu\xE7 bulunamad\u0131" : "Hen\xFCz dosya yok" }),
23259
- /* @__PURE__ */ jsx("p", { className: "tecof-upload-empty-subheading", children: gallerySearch ? "Farkl\u0131 bir arama terimi deneyin" : "Dosyalar\u0131n\u0131z burada g\xF6r\xFCnecek" })
23260
- ] }) : /* @__PURE__ */ jsx("div", { className: "tecof-upload-gallery-grid", children: filteredGallery.map((file2) => {
23261
- const selected = value.some((v2) => v2._id === file2._id);
23262
- return /* @__PURE__ */ jsxs(
23263
- "div",
23264
- {
23265
- className: `tecof-upload-gallery-item ${selected ? "selected" : ""}`,
23266
- onClick: () => toggleGalleryFile(file2),
23267
- children: [
23268
- selected && /* @__PURE__ */ jsx("div", { className: "tecof-upload-gallery-check", children: /* @__PURE__ */ jsx(Check, { size: 12, strokeWidth: 3 }) }),
23269
- isImageType2(file2.type) ? /* @__PURE__ */ jsx(
23270
- TecofPicture,
23271
- {
23272
- data: file2,
23273
- alt: file2.name,
23274
- size: "thumbnail",
23275
- className: "tecof-upload-gallery-thumb",
23276
- imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "6px" }
23277
- }
23278
- ) : /* @__PURE__ */ jsx("div", { className: "tecof-upload-gallery-thumb tecof-upload-gallery-file-icon-wrap", children: /* @__PURE__ */ jsx(File2, { size: 24, color: "#a1a1aa" }) }),
23279
- /* @__PURE__ */ jsx("p", { className: "tecof-upload-gallery-file-name", children: file2.meta?.originalName || file2.name })
23280
- ]
23281
- },
23282
- file2._id
23283
- );
23284
- }) })
23285
- ] })
23286
- ] })
23287
- ] }) })
23563
+ /* @__PURE__ */ jsx(
23564
+ MediaDrawer,
23565
+ {
23566
+ open: drawerOpen,
23567
+ onOpenChange: setDrawerOpen,
23568
+ onSelect: toggleGalleryFile,
23569
+ selectedIds: value.map((v2) => v2._id ?? ""),
23570
+ allowMultiple,
23571
+ filterImages: acceptedTypes.length > 0 && acceptedTypes.every((t2) => t2.startsWith("image/")),
23572
+ title: "Medya K\xFCt\xFCphanesi"
23573
+ }
23574
+ )
23288
23575
  ] });
23289
23576
  };
23290
23577
  UploadField.displayName = "UploadField";
@@ -25214,6 +25501,8 @@ lucide-react/dist/esm/shared/src/utils/hasA11yProp.js:
25214
25501
  lucide-react/dist/esm/context.js:
25215
25502
  lucide-react/dist/esm/Icon.js:
25216
25503
  lucide-react/dist/esm/createLucideIcon.js:
25504
+ lucide-react/dist/esm/icons/arrow-down.js:
25505
+ lucide-react/dist/esm/icons/arrow-up.js:
25217
25506
  lucide-react/dist/esm/icons/check.js:
25218
25507
  lucide-react/dist/esm/icons/chevron-down.js:
25219
25508
  lucide-react/dist/esm/icons/chevron-right.js:
@@ -25324,6 +25613,6 @@ filepond-plugin-image-edit/dist/filepond-plugin-image-edit.esm.js:
25324
25613
  *)
25325
25614
  */
25326
25615
 
25327
- export { CmsCollectionField, CodeEditorField, ColorField, EditorField, FieldErrorBoundary, LanguageField, LinkField, RepeaterField, TecofApiClient, TecofEditor, TecofPicture, TecofProvider, TecofRender, UploadField, createCmsCollectionField, createCodeEditorField, createColorField, createEditorField, createLanguageField, createLinkField, createRepeaterField, createUploadField, darken, generateCSSVariables, getDefaultTheme, hexToHsl, hslToHex, lighten, mergeTheme, useTecof };
25616
+ export { CmsCollectionField, CodeEditorField, ColorField, EditorField, FieldErrorBoundary, LanguageField, LinkField, RepeaterField, TecofApiClient, TecofEditor, TecofPicture, TecofProvider, TecofRender, UnderConstruction, UploadField, createCmsCollectionField, createCodeEditorField, createColorField, createEditorField, createLanguageField, createLinkField, createRepeaterField, createUploadField, darken, generateCSSVariables, getDefaultTheme, hexToHsl, hslToHex, lighten, mergeTheme, useTecof };
25328
25617
  //# sourceMappingURL=index.mjs.map
25329
25618
  //# sourceMappingURL=index.mjs.map