@tecof/theme-editor 0.0.34 → 0.0.35
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.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1566 -131
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1559 -125
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
var React__default = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var core = require('@puckeditor/core');
|
|
6
|
+
var zustand = require('zustand');
|
|
7
|
+
var immer = require('zustand/middleware/immer');
|
|
8
|
+
var nanoid = require('nanoid');
|
|
9
|
+
var ReactDOM = require('react-dom');
|
|
6
10
|
var react = require('@tiptap/react');
|
|
7
11
|
var Document = require('@tiptap/extension-document');
|
|
8
12
|
var Paragraph = require('@tiptap/extension-paragraph');
|
|
@@ -21,7 +25,6 @@ var Link3 = require('@tiptap/extension-link');
|
|
|
21
25
|
var Code2 = require('@tiptap/extension-code');
|
|
22
26
|
var CodeBlock = require('@tiptap/extension-code-block');
|
|
23
27
|
var Image3 = require('@tiptap/extension-image');
|
|
24
|
-
var ReactDOM = require('react-dom');
|
|
25
28
|
|
|
26
29
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
30
|
|
|
@@ -44,6 +47,7 @@ function _interopNamespace(e) {
|
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
var React__default__namespace = /*#__PURE__*/_interopNamespace(React__default);
|
|
50
|
+
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
47
51
|
var Document__default = /*#__PURE__*/_interopDefault(Document);
|
|
48
52
|
var Paragraph__default = /*#__PURE__*/_interopDefault(Paragraph);
|
|
49
53
|
var Text__default = /*#__PURE__*/_interopDefault(Text);
|
|
@@ -60,7 +64,6 @@ var Link3__default = /*#__PURE__*/_interopDefault(Link3);
|
|
|
60
64
|
var Code2__default = /*#__PURE__*/_interopDefault(Code2);
|
|
61
65
|
var CodeBlock__default = /*#__PURE__*/_interopDefault(CodeBlock);
|
|
62
66
|
var Image3__default = /*#__PURE__*/_interopDefault(Image3);
|
|
63
|
-
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
64
67
|
|
|
65
68
|
// src/components/TecofProvider.tsx
|
|
66
69
|
|
|
@@ -455,38 +458,42 @@ var ChevronDown = createLucideIcon("chevron-down", __iconNode4);
|
|
|
455
458
|
var __iconNode5 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
456
459
|
var ChevronRight = createLucideIcon("chevron-right", __iconNode5);
|
|
457
460
|
|
|
461
|
+
// node_modules/lucide-react/dist/esm/icons/chevron-up.js
|
|
462
|
+
var __iconNode6 = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
463
|
+
var ChevronUp = createLucideIcon("chevron-up", __iconNode6);
|
|
464
|
+
|
|
458
465
|
// node_modules/lucide-react/dist/esm/icons/code.js
|
|
459
|
-
var
|
|
466
|
+
var __iconNode7 = [
|
|
460
467
|
["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
|
|
461
468
|
["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
|
|
462
469
|
];
|
|
463
|
-
var Code = createLucideIcon("code",
|
|
470
|
+
var Code = createLucideIcon("code", __iconNode7);
|
|
464
471
|
|
|
465
472
|
// node_modules/lucide-react/dist/esm/icons/copy.js
|
|
466
|
-
var
|
|
473
|
+
var __iconNode8 = [
|
|
467
474
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
468
475
|
["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" }]
|
|
469
476
|
];
|
|
470
|
-
var Copy = createLucideIcon("copy",
|
|
477
|
+
var Copy = createLucideIcon("copy", __iconNode8);
|
|
471
478
|
|
|
472
479
|
// node_modules/lucide-react/dist/esm/icons/database.js
|
|
473
|
-
var
|
|
480
|
+
var __iconNode9 = [
|
|
474
481
|
["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
|
|
475
482
|
["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
|
|
476
483
|
["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
|
|
477
484
|
];
|
|
478
|
-
var Database = createLucideIcon("database",
|
|
485
|
+
var Database = createLucideIcon("database", __iconNode9);
|
|
479
486
|
|
|
480
487
|
// node_modules/lucide-react/dist/esm/icons/external-link.js
|
|
481
|
-
var
|
|
488
|
+
var __iconNode10 = [
|
|
482
489
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
483
490
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
484
491
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
485
492
|
];
|
|
486
|
-
var ExternalLink = createLucideIcon("external-link",
|
|
493
|
+
var ExternalLink = createLucideIcon("external-link", __iconNode10);
|
|
487
494
|
|
|
488
495
|
// node_modules/lucide-react/dist/esm/icons/file-text.js
|
|
489
|
-
var
|
|
496
|
+
var __iconNode11 = [
|
|
490
497
|
[
|
|
491
498
|
"path",
|
|
492
499
|
{
|
|
@@ -499,10 +506,10 @@ var __iconNode10 = [
|
|
|
499
506
|
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
500
507
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
501
508
|
];
|
|
502
|
-
var FileText = createLucideIcon("file-text",
|
|
509
|
+
var FileText = createLucideIcon("file-text", __iconNode11);
|
|
503
510
|
|
|
504
511
|
// node_modules/lucide-react/dist/esm/icons/file.js
|
|
505
|
-
var
|
|
512
|
+
var __iconNode12 = [
|
|
506
513
|
[
|
|
507
514
|
"path",
|
|
508
515
|
{
|
|
@@ -512,10 +519,10 @@ var __iconNode11 = [
|
|
|
512
519
|
],
|
|
513
520
|
["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
|
|
514
521
|
];
|
|
515
|
-
var File2 = createLucideIcon("file",
|
|
522
|
+
var File2 = createLucideIcon("file", __iconNode12);
|
|
516
523
|
|
|
517
524
|
// node_modules/lucide-react/dist/esm/icons/folder-open.js
|
|
518
|
-
var
|
|
525
|
+
var __iconNode13 = [
|
|
519
526
|
[
|
|
520
527
|
"path",
|
|
521
528
|
{
|
|
@@ -524,18 +531,18 @@ var __iconNode12 = [
|
|
|
524
531
|
}
|
|
525
532
|
]
|
|
526
533
|
];
|
|
527
|
-
var FolderOpen = createLucideIcon("folder-open",
|
|
534
|
+
var FolderOpen = createLucideIcon("folder-open", __iconNode13);
|
|
528
535
|
|
|
529
536
|
// node_modules/lucide-react/dist/esm/icons/globe.js
|
|
530
|
-
var
|
|
537
|
+
var __iconNode14 = [
|
|
531
538
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
532
539
|
["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
|
|
533
540
|
["path", { d: "M2 12h20", key: "9i4pu4" }]
|
|
534
541
|
];
|
|
535
|
-
var Globe = createLucideIcon("globe",
|
|
542
|
+
var Globe = createLucideIcon("globe", __iconNode14);
|
|
536
543
|
|
|
537
544
|
// node_modules/lucide-react/dist/esm/icons/grip-vertical.js
|
|
538
|
-
var
|
|
545
|
+
var __iconNode15 = [
|
|
539
546
|
["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
|
|
540
547
|
["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
|
|
541
548
|
["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
|
|
@@ -543,28 +550,28 @@ var __iconNode14 = [
|
|
|
543
550
|
["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
|
|
544
551
|
["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
|
|
545
552
|
];
|
|
546
|
-
var GripVertical = createLucideIcon("grip-vertical",
|
|
553
|
+
var GripVertical = createLucideIcon("grip-vertical", __iconNode15);
|
|
547
554
|
|
|
548
555
|
// node_modules/lucide-react/dist/esm/icons/image-plus.js
|
|
549
|
-
var
|
|
556
|
+
var __iconNode16 = [
|
|
550
557
|
["path", { d: "M16 5h6", key: "1vod17" }],
|
|
551
558
|
["path", { d: "M19 2v6", key: "4bpg5p" }],
|
|
552
559
|
["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" }],
|
|
553
560
|
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }],
|
|
554
561
|
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }]
|
|
555
562
|
];
|
|
556
|
-
var ImagePlus = createLucideIcon("image-plus",
|
|
563
|
+
var ImagePlus = createLucideIcon("image-plus", __iconNode16);
|
|
557
564
|
|
|
558
565
|
// node_modules/lucide-react/dist/esm/icons/image.js
|
|
559
|
-
var
|
|
566
|
+
var __iconNode17 = [
|
|
560
567
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
561
568
|
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
562
569
|
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
563
570
|
];
|
|
564
|
-
var Image2 = createLucideIcon("image",
|
|
571
|
+
var Image2 = createLucideIcon("image", __iconNode17);
|
|
565
572
|
|
|
566
573
|
// node_modules/lucide-react/dist/esm/icons/languages.js
|
|
567
|
-
var
|
|
574
|
+
var __iconNode18 = [
|
|
568
575
|
["path", { d: "m5 8 6 6", key: "1wu5hv" }],
|
|
569
576
|
["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
|
|
570
577
|
["path", { d: "M2 5h12", key: "or177f" }],
|
|
@@ -572,29 +579,29 @@ var __iconNode17 = [
|
|
|
572
579
|
["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
|
|
573
580
|
["path", { d: "M14 18h6", key: "1m8k6r" }]
|
|
574
581
|
];
|
|
575
|
-
var Languages = createLucideIcon("languages",
|
|
582
|
+
var Languages = createLucideIcon("languages", __iconNode18);
|
|
576
583
|
|
|
577
584
|
// node_modules/lucide-react/dist/esm/icons/link-2.js
|
|
578
|
-
var
|
|
585
|
+
var __iconNode19 = [
|
|
579
586
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
580
587
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
581
588
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
582
589
|
];
|
|
583
|
-
var Link2 = createLucideIcon("link-2",
|
|
590
|
+
var Link2 = createLucideIcon("link-2", __iconNode19);
|
|
584
591
|
|
|
585
592
|
// node_modules/lucide-react/dist/esm/icons/link.js
|
|
586
|
-
var
|
|
593
|
+
var __iconNode20 = [
|
|
587
594
|
["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" }],
|
|
588
595
|
["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" }]
|
|
589
596
|
];
|
|
590
|
-
var Link = createLucideIcon("link",
|
|
597
|
+
var Link = createLucideIcon("link", __iconNode20);
|
|
591
598
|
|
|
592
599
|
// node_modules/lucide-react/dist/esm/icons/loader-circle.js
|
|
593
|
-
var
|
|
594
|
-
var LoaderCircle = createLucideIcon("loader-circle",
|
|
600
|
+
var __iconNode21 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
601
|
+
var LoaderCircle = createLucideIcon("loader-circle", __iconNode21);
|
|
595
602
|
|
|
596
603
|
// node_modules/lucide-react/dist/esm/icons/pencil.js
|
|
597
|
-
var
|
|
604
|
+
var __iconNode22 = [
|
|
598
605
|
[
|
|
599
606
|
"path",
|
|
600
607
|
{
|
|
@@ -604,72 +611,73 @@ var __iconNode21 = [
|
|
|
604
611
|
],
|
|
605
612
|
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
|
|
606
613
|
];
|
|
607
|
-
var Pencil = createLucideIcon("pencil",
|
|
614
|
+
var Pencil = createLucideIcon("pencil", __iconNode22);
|
|
608
615
|
|
|
609
616
|
// node_modules/lucide-react/dist/esm/icons/plus.js
|
|
610
|
-
var
|
|
617
|
+
var __iconNode23 = [
|
|
611
618
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
612
619
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
613
620
|
];
|
|
614
|
-
var Plus = createLucideIcon("plus",
|
|
621
|
+
var Plus = createLucideIcon("plus", __iconNode23);
|
|
615
622
|
|
|
616
623
|
// node_modules/lucide-react/dist/esm/icons/refresh-ccw.js
|
|
617
|
-
var
|
|
624
|
+
var __iconNode24 = [
|
|
618
625
|
["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
|
|
619
626
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }],
|
|
620
627
|
["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
|
|
621
628
|
["path", { d: "M16 16h5v5", key: "ccwih5" }]
|
|
622
629
|
];
|
|
623
|
-
var RefreshCcw = createLucideIcon("refresh-ccw",
|
|
630
|
+
var RefreshCcw = createLucideIcon("refresh-ccw", __iconNode24);
|
|
624
631
|
|
|
625
632
|
// node_modules/lucide-react/dist/esm/icons/refresh-cw.js
|
|
626
|
-
var
|
|
633
|
+
var __iconNode25 = [
|
|
627
634
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
628
635
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
629
636
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
630
637
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
631
638
|
];
|
|
632
|
-
var RefreshCw = createLucideIcon("refresh-cw",
|
|
639
|
+
var RefreshCw = createLucideIcon("refresh-cw", __iconNode25);
|
|
633
640
|
|
|
634
641
|
// node_modules/lucide-react/dist/esm/icons/rotate-ccw.js
|
|
635
|
-
var
|
|
642
|
+
var __iconNode26 = [
|
|
636
643
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
637
644
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
638
645
|
];
|
|
639
|
-
var RotateCcw = createLucideIcon("rotate-ccw",
|
|
646
|
+
var RotateCcw = createLucideIcon("rotate-ccw", __iconNode26);
|
|
640
647
|
|
|
641
648
|
// node_modules/lucide-react/dist/esm/icons/search.js
|
|
642
|
-
var
|
|
649
|
+
var __iconNode27 = [
|
|
643
650
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
644
651
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
645
652
|
];
|
|
646
|
-
var Search = createLucideIcon("search",
|
|
653
|
+
var Search = createLucideIcon("search", __iconNode27);
|
|
647
654
|
|
|
648
655
|
// node_modules/lucide-react/dist/esm/icons/trash-2.js
|
|
649
|
-
var
|
|
656
|
+
var __iconNode28 = [
|
|
650
657
|
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
651
658
|
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
652
659
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
653
660
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
654
661
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
655
662
|
];
|
|
656
|
-
var Trash2 = createLucideIcon("trash-2",
|
|
663
|
+
var Trash2 = createLucideIcon("trash-2", __iconNode28);
|
|
657
664
|
|
|
658
665
|
// node_modules/lucide-react/dist/esm/icons/upload.js
|
|
659
|
-
var
|
|
666
|
+
var __iconNode29 = [
|
|
660
667
|
["path", { d: "M12 3v12", key: "1x0j5s" }],
|
|
661
668
|
["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }],
|
|
662
669
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }]
|
|
663
670
|
];
|
|
664
|
-
var Upload = createLucideIcon("upload",
|
|
671
|
+
var Upload = createLucideIcon("upload", __iconNode29);
|
|
665
672
|
|
|
666
673
|
// node_modules/lucide-react/dist/esm/icons/x.js
|
|
667
|
-
var
|
|
674
|
+
var __iconNode30 = [
|
|
668
675
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
669
676
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
670
677
|
];
|
|
671
|
-
var X = createLucideIcon("x",
|
|
678
|
+
var X = createLucideIcon("x", __iconNode30);
|
|
672
679
|
var EMPTY_PAGE = { content: [], root: { props: {} }, zones: {} };
|
|
680
|
+
var DrawerSearchContext = React__default.createContext(null);
|
|
673
681
|
var ComponentDrawerItem = ({
|
|
674
682
|
name: name3,
|
|
675
683
|
apiClient,
|
|
@@ -719,6 +727,56 @@ var ComponentDrawerItem = ({
|
|
|
719
727
|
] })
|
|
720
728
|
] });
|
|
721
729
|
};
|
|
730
|
+
var CustomDrawer = ({ children }) => {
|
|
731
|
+
const context = React__default.useContext(DrawerSearchContext);
|
|
732
|
+
if (!context) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drawer-list-layout", children });
|
|
733
|
+
const { searchQuery, setSearchQuery } = context;
|
|
734
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-wrapper-layout", children: [
|
|
735
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drawer-search-wrapper", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-search-box", children: [
|
|
736
|
+
/* @__PURE__ */ jsxRuntime.jsx(Search, { size: 14, color: "#71717a" }),
|
|
737
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
738
|
+
"input",
|
|
739
|
+
{
|
|
740
|
+
type: "text",
|
|
741
|
+
placeholder: "Blok ara...",
|
|
742
|
+
value: searchQuery,
|
|
743
|
+
onChange: (e3) => setSearchQuery(e3.target.value),
|
|
744
|
+
className: "tecof-drawer-search-input"
|
|
745
|
+
}
|
|
746
|
+
),
|
|
747
|
+
searchQuery && /* @__PURE__ */ jsxRuntime.jsx(
|
|
748
|
+
"button",
|
|
749
|
+
{
|
|
750
|
+
type: "button",
|
|
751
|
+
onClick: () => setSearchQuery(""),
|
|
752
|
+
className: "tecof-drawer-clear-btn",
|
|
753
|
+
title: "Temizle",
|
|
754
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 14 })
|
|
755
|
+
}
|
|
756
|
+
)
|
|
757
|
+
] }) }),
|
|
758
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drawer-list-layout", children })
|
|
759
|
+
] });
|
|
760
|
+
};
|
|
761
|
+
var CustomDrawerItem = ({ children, name: name3 }) => {
|
|
762
|
+
const context = React__default.useContext(DrawerSearchContext);
|
|
763
|
+
const { apiClient } = useTecof();
|
|
764
|
+
if (!context) {
|
|
765
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ComponentDrawerItem, { name: name3, apiClient, children });
|
|
766
|
+
}
|
|
767
|
+
const { searchQuery, config: config3 } = context;
|
|
768
|
+
const componentConfig = config3.components?.[name3];
|
|
769
|
+
const label = componentConfig?.label || name3;
|
|
770
|
+
if (searchQuery.trim()) {
|
|
771
|
+
const query = searchQuery.toLowerCase();
|
|
772
|
+
const matchesName = name3.toLowerCase().includes(query);
|
|
773
|
+
const matchesLabel = label.toLowerCase().includes(query);
|
|
774
|
+
if (!matchesName && !matchesLabel) {
|
|
775
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ComponentDrawerItem, { name: name3, apiClient, children });
|
|
779
|
+
};
|
|
722
780
|
var AutoFieldsOnSelect = () => {
|
|
723
781
|
const { selectedItem, dispatch } = core.usePuck();
|
|
724
782
|
const prevSelectedRef = React__default.useRef(null);
|
|
@@ -935,73 +993,41 @@ var TecofEditor = ({
|
|
|
935
993
|
document.removeEventListener("click", handleDeselect, false);
|
|
936
994
|
};
|
|
937
995
|
}, [isEmbedded]);
|
|
996
|
+
const searchContextValue = React__default.useMemo(() => ({
|
|
997
|
+
searchQuery,
|
|
998
|
+
setSearchQuery,
|
|
999
|
+
config: config3
|
|
1000
|
+
}), [searchQuery, config3]);
|
|
1001
|
+
const plugins = React__default.useMemo(() => [
|
|
1002
|
+
{ ...core.blocksPlugin(), label: "Bloklar" },
|
|
1003
|
+
{ ...core.outlinePlugin(), label: "Anahat" },
|
|
1004
|
+
{ ...core.fieldsPlugin({ desktopSideBar: "right" }), label: "Alanlar" },
|
|
1005
|
+
...extraPlugins || []
|
|
1006
|
+
], [extraPlugins]);
|
|
1007
|
+
const mergedOverrides = React__default.useMemo(() => {
|
|
1008
|
+
return {
|
|
1009
|
+
header: () => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}),
|
|
1010
|
+
drawer: CustomDrawer,
|
|
1011
|
+
drawerItem: CustomDrawerItem,
|
|
1012
|
+
actionBar: ({ children, label }) => {
|
|
1013
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CustomActionBar, { label, children });
|
|
1014
|
+
},
|
|
1015
|
+
puck: ({ children }) => {
|
|
1016
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1017
|
+
/* @__PURE__ */ jsxRuntime.jsx(AutoFieldsOnSelect, {}),
|
|
1018
|
+
children
|
|
1019
|
+
] });
|
|
1020
|
+
},
|
|
1021
|
+
...overrides || {}
|
|
1022
|
+
};
|
|
1023
|
+
}, [overrides]);
|
|
938
1024
|
if (loading || !initialData) {
|
|
939
1025
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `tecof-editor-loading ${className || ""}`.trim(), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-editor-loading-inner", children: [
|
|
940
1026
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-editor-spinner" }),
|
|
941
1027
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-editor-loading-text", children: "Loading editor..." })
|
|
942
1028
|
] }) });
|
|
943
1029
|
}
|
|
944
|
-
|
|
945
|
-
{ ...core.blocksPlugin(), label: "Bloklar" },
|
|
946
|
-
{ ...core.outlinePlugin(), label: "Anahat" },
|
|
947
|
-
{ ...core.fieldsPlugin({ desktopSideBar: "right" }), label: "Alanlar" },
|
|
948
|
-
...extraPlugins || []
|
|
949
|
-
];
|
|
950
|
-
const mergedOverrides = {
|
|
951
|
-
header: () => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}),
|
|
952
|
-
drawer: ({ children }) => {
|
|
953
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-wrapper-layout", children: [
|
|
954
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drawer-search-wrapper", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-search-box", children: [
|
|
955
|
-
/* @__PURE__ */ jsxRuntime.jsx(Search, { size: 14, color: "#71717a" }),
|
|
956
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
957
|
-
"input",
|
|
958
|
-
{
|
|
959
|
-
type: "text",
|
|
960
|
-
placeholder: "Blok ara...",
|
|
961
|
-
value: searchQuery,
|
|
962
|
-
onChange: (e3) => setSearchQuery(e3.target.value),
|
|
963
|
-
className: "tecof-drawer-search-input"
|
|
964
|
-
}
|
|
965
|
-
),
|
|
966
|
-
searchQuery && /* @__PURE__ */ jsxRuntime.jsx(
|
|
967
|
-
"button",
|
|
968
|
-
{
|
|
969
|
-
type: "button",
|
|
970
|
-
onClick: () => setSearchQuery(""),
|
|
971
|
-
className: "tecof-drawer-clear-btn",
|
|
972
|
-
title: "Temizle",
|
|
973
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 14 })
|
|
974
|
-
}
|
|
975
|
-
)
|
|
976
|
-
] }) }),
|
|
977
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drawer-list-layout", children })
|
|
978
|
-
] });
|
|
979
|
-
},
|
|
980
|
-
drawerItem: ({ children, name: name3 }) => {
|
|
981
|
-
const componentConfig = config3.components?.[name3];
|
|
982
|
-
const label = componentConfig?.label || name3;
|
|
983
|
-
if (searchQuery.trim()) {
|
|
984
|
-
const query = searchQuery.toLowerCase();
|
|
985
|
-
const matchesName = name3.toLowerCase().includes(query);
|
|
986
|
-
const matchesLabel = label.toLowerCase().includes(query);
|
|
987
|
-
if (!matchesName && !matchesLabel) {
|
|
988
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ComponentDrawerItem, { name: name3, apiClient, children });
|
|
992
|
-
},
|
|
993
|
-
actionBar: ({ children, label }) => {
|
|
994
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CustomActionBar, { label, children });
|
|
995
|
-
},
|
|
996
|
-
puck: ({ children }) => {
|
|
997
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
998
|
-
/* @__PURE__ */ jsxRuntime.jsx(AutoFieldsOnSelect, {}),
|
|
999
|
-
children
|
|
1000
|
-
] });
|
|
1001
|
-
},
|
|
1002
|
-
...overrides || {}
|
|
1003
|
-
};
|
|
1004
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `tecof-editor-wrapper ${className || ""}`.trim(), children: [
|
|
1030
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DrawerSearchContext.Provider, { value: searchContextValue, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `tecof-editor-wrapper ${className || ""}`.trim(), children: [
|
|
1005
1031
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1006
1032
|
core.Puck,
|
|
1007
1033
|
{
|
|
@@ -1015,7 +1041,1414 @@ var TecofEditor = ({
|
|
|
1015
1041
|
}
|
|
1016
1042
|
),
|
|
1017
1043
|
saving && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-editor-save-indicator", children: saveStatus === "error" ? "Save failed" : "Saving..." })
|
|
1018
|
-
] });
|
|
1044
|
+
] }) });
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
// src/engine/document.ts
|
|
1048
|
+
var EMPTY_DOCUMENT = {
|
|
1049
|
+
root: { props: {} },
|
|
1050
|
+
content: [],
|
|
1051
|
+
zones: {}
|
|
1052
|
+
};
|
|
1053
|
+
var parseDocument = (rawData) => {
|
|
1054
|
+
if (!rawData) return { ...EMPTY_DOCUMENT };
|
|
1055
|
+
return {
|
|
1056
|
+
root: rawData.root || { props: {} },
|
|
1057
|
+
content: rawData.content || [],
|
|
1058
|
+
zones: rawData.zones || {}
|
|
1059
|
+
};
|
|
1060
|
+
};
|
|
1061
|
+
var serializeDocument = (doc) => {
|
|
1062
|
+
return {
|
|
1063
|
+
root: doc.root,
|
|
1064
|
+
content: doc.content,
|
|
1065
|
+
zones: doc.zones
|
|
1066
|
+
};
|
|
1067
|
+
};
|
|
1068
|
+
|
|
1069
|
+
// src/engine/zones.ts
|
|
1070
|
+
var parseZoneKey = (zoneKey) => {
|
|
1071
|
+
const parts = zoneKey.split(":");
|
|
1072
|
+
return {
|
|
1073
|
+
parentId: parts[0],
|
|
1074
|
+
slotName: parts[1] || "default"
|
|
1075
|
+
};
|
|
1076
|
+
};
|
|
1077
|
+
var findNodeById = (doc, id) => {
|
|
1078
|
+
for (let i2 = 0; i2 < doc.content.length; i2++) {
|
|
1079
|
+
if (doc.content[i2].props.id === id) {
|
|
1080
|
+
return { node: doc.content[i2], path: { index: i2 } };
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
for (const [zoneKey, items] of Object.entries(doc.zones)) {
|
|
1084
|
+
for (let i2 = 0; i2 < items.length; i2++) {
|
|
1085
|
+
if (items[i2].props.id === id) {
|
|
1086
|
+
return { node: items[i2], path: { zoneKey, index: i2 } };
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
return null;
|
|
1091
|
+
};
|
|
1092
|
+
var getDescendantZoneKeys = (zones, nodeId, acc = []) => {
|
|
1093
|
+
const prefix = `${nodeId}:`;
|
|
1094
|
+
for (const zoneKey of Object.keys(zones)) {
|
|
1095
|
+
if (zoneKey.startsWith(prefix)) {
|
|
1096
|
+
acc.push(zoneKey);
|
|
1097
|
+
for (const child of zones[zoneKey]) {
|
|
1098
|
+
getDescendantZoneKeys(zones, child.props.id, acc);
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
return acc;
|
|
1103
|
+
};
|
|
1104
|
+
var getParentId = (doc, id) => {
|
|
1105
|
+
const res2 = findNodeById(doc, id);
|
|
1106
|
+
if (!res2 || !res2.path.zoneKey) return null;
|
|
1107
|
+
return parseZoneKey(res2.path.zoneKey).parentId;
|
|
1108
|
+
};
|
|
1109
|
+
var getBreadcrumbs = (doc, id) => {
|
|
1110
|
+
const crumbs = [];
|
|
1111
|
+
let currentId = id;
|
|
1112
|
+
while (currentId) {
|
|
1113
|
+
const res2 = findNodeById(doc, currentId);
|
|
1114
|
+
if (!res2) break;
|
|
1115
|
+
crumbs.unshift({ id: currentId, type: res2.node.type });
|
|
1116
|
+
currentId = res2.path.zoneKey ? parseZoneKey(res2.path.zoneKey).parentId : null;
|
|
1117
|
+
}
|
|
1118
|
+
return crumbs;
|
|
1119
|
+
};
|
|
1120
|
+
var generateId = () => nanoid.nanoid(8);
|
|
1121
|
+
var remapNodeIds = (node, sourceZones, idMap = /* @__PURE__ */ new Map()) => {
|
|
1122
|
+
const oldId = node.props.id;
|
|
1123
|
+
const newId = generateId();
|
|
1124
|
+
idMap.set(oldId, newId);
|
|
1125
|
+
const remappedNode = {
|
|
1126
|
+
...node,
|
|
1127
|
+
props: {
|
|
1128
|
+
...node.props,
|
|
1129
|
+
id: newId
|
|
1130
|
+
}
|
|
1131
|
+
};
|
|
1132
|
+
const newZones = {};
|
|
1133
|
+
const prefix = `${oldId}:`;
|
|
1134
|
+
for (const [zoneKey, zoneItems] of Object.entries(sourceZones)) {
|
|
1135
|
+
if (zoneKey.startsWith(prefix)) {
|
|
1136
|
+
const slotName = zoneKey.split(":")[1];
|
|
1137
|
+
const newZoneKey = `${newId}:${slotName}`;
|
|
1138
|
+
const newZoneItems = [];
|
|
1139
|
+
for (const item2 of zoneItems) {
|
|
1140
|
+
const { remappedNode: childNode, newZones: childZones } = remapNodeIds(item2, sourceZones, idMap);
|
|
1141
|
+
newZoneItems.push(childNode);
|
|
1142
|
+
Object.assign(newZones, childZones);
|
|
1143
|
+
}
|
|
1144
|
+
newZones[newZoneKey] = newZoneItems;
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
return { remappedNode, newZones };
|
|
1148
|
+
};
|
|
1149
|
+
|
|
1150
|
+
// src/engine/operations.ts
|
|
1151
|
+
var insertNode = (draft, node, targetZoneKey, index2) => {
|
|
1152
|
+
if (!node.props.id) {
|
|
1153
|
+
node.props.id = generateId();
|
|
1154
|
+
}
|
|
1155
|
+
let list3 = targetZoneKey ? draft.zones[targetZoneKey] : draft.content;
|
|
1156
|
+
if (!list3) {
|
|
1157
|
+
list3 = [];
|
|
1158
|
+
if (targetZoneKey) {
|
|
1159
|
+
draft.zones[targetZoneKey] = list3;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
const insertIndex = typeof index2 === "number" ? index2 : list3.length;
|
|
1163
|
+
list3.splice(insertIndex, 0, node);
|
|
1164
|
+
};
|
|
1165
|
+
var removeNode = (draft, id) => {
|
|
1166
|
+
const result = findNodeById(draft, id);
|
|
1167
|
+
if (!result) return;
|
|
1168
|
+
const { path } = result;
|
|
1169
|
+
const list3 = path.zoneKey ? draft.zones[path.zoneKey] : draft.content;
|
|
1170
|
+
if (list3) {
|
|
1171
|
+
list3.splice(path.index, 1);
|
|
1172
|
+
}
|
|
1173
|
+
const descendantZoneKeys = getDescendantZoneKeys(draft.zones, id);
|
|
1174
|
+
for (const zoneKey of descendantZoneKeys) {
|
|
1175
|
+
delete draft.zones[zoneKey];
|
|
1176
|
+
}
|
|
1177
|
+
};
|
|
1178
|
+
var moveNode = (draft, id, targetZoneKey, targetIndex) => {
|
|
1179
|
+
const result = findNodeById(draft, id);
|
|
1180
|
+
if (!result) return;
|
|
1181
|
+
const { node, path: sourcePath } = result;
|
|
1182
|
+
const sourceList = sourcePath.zoneKey ? draft.zones[sourcePath.zoneKey] : draft.content;
|
|
1183
|
+
let targetList = targetZoneKey ? draft.zones[targetZoneKey] : draft.content;
|
|
1184
|
+
if (!targetList && targetZoneKey) {
|
|
1185
|
+
targetList = [];
|
|
1186
|
+
draft.zones[targetZoneKey] = targetList;
|
|
1187
|
+
}
|
|
1188
|
+
if (!sourceList || !targetList) return;
|
|
1189
|
+
sourceList.splice(sourcePath.index, 1);
|
|
1190
|
+
let finalIndex = targetIndex ?? targetList.length;
|
|
1191
|
+
if (sourcePath.zoneKey === targetZoneKey && sourcePath.index < finalIndex) {
|
|
1192
|
+
finalIndex -= 1;
|
|
1193
|
+
}
|
|
1194
|
+
targetList.splice(finalIndex, 0, node);
|
|
1195
|
+
};
|
|
1196
|
+
var duplicateNode = (draft, id) => {
|
|
1197
|
+
const result = findNodeById(draft, id);
|
|
1198
|
+
if (!result) return;
|
|
1199
|
+
const { node, path } = result;
|
|
1200
|
+
const { remappedNode, newZones } = remapNodeIds(node, draft.zones);
|
|
1201
|
+
const targetList = path.zoneKey ? draft.zones[path.zoneKey] : draft.content;
|
|
1202
|
+
if (targetList) {
|
|
1203
|
+
targetList.splice(path.index + 1, 0, remappedNode);
|
|
1204
|
+
}
|
|
1205
|
+
Object.assign(draft.zones, newZones);
|
|
1206
|
+
};
|
|
1207
|
+
var updateProps = (draft, id, patch) => {
|
|
1208
|
+
const result = findNodeById(draft, id);
|
|
1209
|
+
if (!result) return;
|
|
1210
|
+
Object.assign(result.node.props, patch);
|
|
1211
|
+
};
|
|
1212
|
+
var setRootProps = (draft, patch) => {
|
|
1213
|
+
Object.assign(draft.root.props, patch);
|
|
1214
|
+
};
|
|
1215
|
+
|
|
1216
|
+
// src/engine/store.ts
|
|
1217
|
+
var pushToHistory = (state3) => {
|
|
1218
|
+
state3.history.past.push(JSON.parse(JSON.stringify(state3.document)));
|
|
1219
|
+
state3.history.future = [];
|
|
1220
|
+
};
|
|
1221
|
+
var useEditorStore = zustand.create()(
|
|
1222
|
+
immer.immer((set2) => ({
|
|
1223
|
+
// Initial State
|
|
1224
|
+
document: { ...EMPTY_DOCUMENT },
|
|
1225
|
+
history: {
|
|
1226
|
+
past: [],
|
|
1227
|
+
future: []
|
|
1228
|
+
},
|
|
1229
|
+
selection: {
|
|
1230
|
+
selectedId: null,
|
|
1231
|
+
hoveredId: null
|
|
1232
|
+
},
|
|
1233
|
+
viewport: "desktop",
|
|
1234
|
+
// Actions
|
|
1235
|
+
setDocument: (doc) => set2((state3) => {
|
|
1236
|
+
state3.document = doc;
|
|
1237
|
+
state3.history = { past: [], future: [] };
|
|
1238
|
+
state3.selection = { selectedId: null, hoveredId: null };
|
|
1239
|
+
}),
|
|
1240
|
+
selectNode: (id) => set2((state3) => {
|
|
1241
|
+
state3.selection.selectedId = id;
|
|
1242
|
+
}),
|
|
1243
|
+
hoverNode: (id) => set2((state3) => {
|
|
1244
|
+
state3.selection.hoveredId = id;
|
|
1245
|
+
}),
|
|
1246
|
+
setViewport: (viewport) => set2((state3) => {
|
|
1247
|
+
state3.viewport = viewport;
|
|
1248
|
+
}),
|
|
1249
|
+
insertNode: (node, targetZoneKey, index2) => set2((state3) => {
|
|
1250
|
+
pushToHistory(state3);
|
|
1251
|
+
insertNode(state3.document, node, targetZoneKey, index2);
|
|
1252
|
+
}),
|
|
1253
|
+
removeNode: (id) => set2((state3) => {
|
|
1254
|
+
pushToHistory(state3);
|
|
1255
|
+
removeNode(state3.document, id);
|
|
1256
|
+
if (state3.selection.selectedId === id) {
|
|
1257
|
+
state3.selection.selectedId = null;
|
|
1258
|
+
}
|
|
1259
|
+
}),
|
|
1260
|
+
moveNode: (id, targetZoneKey, index2) => set2((state3) => {
|
|
1261
|
+
pushToHistory(state3);
|
|
1262
|
+
moveNode(state3.document, id, targetZoneKey, index2);
|
|
1263
|
+
}),
|
|
1264
|
+
duplicateNode: (id) => set2((state3) => {
|
|
1265
|
+
pushToHistory(state3);
|
|
1266
|
+
duplicateNode(state3.document, id);
|
|
1267
|
+
}),
|
|
1268
|
+
updateProps: (id, patch) => set2((state3) => {
|
|
1269
|
+
pushToHistory(state3);
|
|
1270
|
+
updateProps(state3.document, id, patch);
|
|
1271
|
+
}),
|
|
1272
|
+
setRootProps: (patch) => set2((state3) => {
|
|
1273
|
+
pushToHistory(state3);
|
|
1274
|
+
setRootProps(state3.document, patch);
|
|
1275
|
+
}),
|
|
1276
|
+
undo: () => set2((state3) => {
|
|
1277
|
+
if (state3.history.past.length === 0) return;
|
|
1278
|
+
const previous = state3.history.past.pop();
|
|
1279
|
+
state3.history.future.push(JSON.parse(JSON.stringify(state3.document)));
|
|
1280
|
+
state3.document = previous;
|
|
1281
|
+
}),
|
|
1282
|
+
redo: () => set2((state3) => {
|
|
1283
|
+
if (state3.history.future.length === 0) return;
|
|
1284
|
+
const next = state3.history.future.pop();
|
|
1285
|
+
state3.history.past.push(JSON.parse(JSON.stringify(state3.document)));
|
|
1286
|
+
state3.document = next;
|
|
1287
|
+
})
|
|
1288
|
+
}))
|
|
1289
|
+
);
|
|
1290
|
+
var StudioContext = React__default.createContext(null);
|
|
1291
|
+
var useStudio = () => {
|
|
1292
|
+
const ctx = React__default.useContext(StudioContext);
|
|
1293
|
+
if (!ctx) {
|
|
1294
|
+
throw new Error("useStudio must be used within a StudioProvider");
|
|
1295
|
+
}
|
|
1296
|
+
return ctx;
|
|
1297
|
+
};
|
|
1298
|
+
var ParentNodeContext = React__default.createContext(null);
|
|
1299
|
+
var DropZone = ({ zone, className, style }) => {
|
|
1300
|
+
const parentId = React__default.useContext(ParentNodeContext);
|
|
1301
|
+
const zoneKey = parentId ? `${parentId}:${zone}` : zone;
|
|
1302
|
+
const items = useEditorStore((state3) => state3.document.zones[zoneKey] || []);
|
|
1303
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1304
|
+
"div",
|
|
1305
|
+
{
|
|
1306
|
+
className: `tecof-dropzone ${className || ""}`,
|
|
1307
|
+
style: { minHeight: items.length === 0 ? "40px" : void 0, ...style },
|
|
1308
|
+
"data-tecof-zone": zoneKey,
|
|
1309
|
+
children: items.map((item2, index2) => /* @__PURE__ */ jsxRuntime.jsx(NodeRenderer, { node: item2, index: index2, zoneKey }, item2.props.id))
|
|
1310
|
+
}
|
|
1311
|
+
);
|
|
1312
|
+
};
|
|
1313
|
+
var renderDropZone = ({ zone, className, style }) => {
|
|
1314
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropZone, { zone, className, style });
|
|
1315
|
+
};
|
|
1316
|
+
var NodeRenderer = ({ node, index: index2, zoneKey }) => {
|
|
1317
|
+
const { config: config3, metadata, readOnly } = useStudio();
|
|
1318
|
+
const componentConfig = config3.components[node.type];
|
|
1319
|
+
const selectNode = useEditorStore((state3) => state3.selectNode);
|
|
1320
|
+
const hoverNode = useEditorStore((state3) => state3.hoverNode);
|
|
1321
|
+
const hoveredId = useEditorStore((state3) => state3.selection.hoveredId);
|
|
1322
|
+
const handleMouseEnter = React__default.useCallback(
|
|
1323
|
+
(e3) => {
|
|
1324
|
+
if (readOnly) return;
|
|
1325
|
+
e3.stopPropagation();
|
|
1326
|
+
hoverNode(node.props.id);
|
|
1327
|
+
},
|
|
1328
|
+
[hoverNode, node.props.id, readOnly]
|
|
1329
|
+
);
|
|
1330
|
+
const handleMouseLeave = React__default.useCallback(
|
|
1331
|
+
(e3) => {
|
|
1332
|
+
if (readOnly) return;
|
|
1333
|
+
e3.stopPropagation();
|
|
1334
|
+
if (hoveredId === node.props.id) {
|
|
1335
|
+
hoverNode(null);
|
|
1336
|
+
}
|
|
1337
|
+
},
|
|
1338
|
+
[hoverNode, node.props.id, hoveredId, readOnly]
|
|
1339
|
+
);
|
|
1340
|
+
const handleClick = React__default.useCallback(
|
|
1341
|
+
(e3) => {
|
|
1342
|
+
if (readOnly) return;
|
|
1343
|
+
e3.stopPropagation();
|
|
1344
|
+
selectNode(node.props.id);
|
|
1345
|
+
const isEmbedded = typeof window !== "undefined" && window.parent !== window;
|
|
1346
|
+
if (isEmbedded) {
|
|
1347
|
+
window.parent.postMessage(
|
|
1348
|
+
{
|
|
1349
|
+
type: "puck:itemSelected",
|
|
1350
|
+
item: {
|
|
1351
|
+
type: node.type,
|
|
1352
|
+
id: node.props.id
|
|
1353
|
+
}
|
|
1354
|
+
},
|
|
1355
|
+
"*"
|
|
1356
|
+
);
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
[selectNode, node.props.id, node.type, readOnly]
|
|
1360
|
+
);
|
|
1361
|
+
if (!componentConfig) {
|
|
1362
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "12px", background: "#fee2e2", color: "#991b1b", fontSize: "12px", borderRadius: "4px" }, children: [
|
|
1363
|
+
"Bile\u015Fen bulunamad\u0131: ",
|
|
1364
|
+
node.type
|
|
1365
|
+
] });
|
|
1366
|
+
}
|
|
1367
|
+
const componentProps = {
|
|
1368
|
+
...node.props,
|
|
1369
|
+
puck: {
|
|
1370
|
+
renderDropZone,
|
|
1371
|
+
isEditing: !readOnly,
|
|
1372
|
+
metadata: {
|
|
1373
|
+
...metadata || {},
|
|
1374
|
+
...componentConfig.metadata || {}
|
|
1375
|
+
}
|
|
1376
|
+
},
|
|
1377
|
+
editMode: !readOnly
|
|
1378
|
+
};
|
|
1379
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ParentNodeContext.Provider, { value: node.props.id, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1380
|
+
"div",
|
|
1381
|
+
{
|
|
1382
|
+
className: "tecof-node-wrapper",
|
|
1383
|
+
"data-tecof-id": node.props.id,
|
|
1384
|
+
"data-tecof-type": node.type,
|
|
1385
|
+
"data-tecof-index": index2,
|
|
1386
|
+
"data-tecof-zone": zoneKey || "root",
|
|
1387
|
+
onMouseEnter: handleMouseEnter,
|
|
1388
|
+
onMouseLeave: handleMouseLeave,
|
|
1389
|
+
onClick: handleClick,
|
|
1390
|
+
style: {
|
|
1391
|
+
cursor: readOnly ? void 0 : "pointer"
|
|
1392
|
+
},
|
|
1393
|
+
children: componentConfig.render(componentProps)
|
|
1394
|
+
}
|
|
1395
|
+
) });
|
|
1396
|
+
};
|
|
1397
|
+
var Frame = ({ children, title = "Canvas Frame", ...props }) => {
|
|
1398
|
+
const [contentRef, setContentRef] = React__default.useState(null);
|
|
1399
|
+
const mountNode = contentRef?.contentWindow?.document?.body;
|
|
1400
|
+
React__default.useEffect(() => {
|
|
1401
|
+
if (!contentRef) return;
|
|
1402
|
+
const doc = contentRef.contentDocument;
|
|
1403
|
+
if (!doc) return;
|
|
1404
|
+
const copyStyles = () => {
|
|
1405
|
+
doc.head.innerHTML = "";
|
|
1406
|
+
Array.from(document.styleSheets).forEach((styleSheet) => {
|
|
1407
|
+
try {
|
|
1408
|
+
if (styleSheet.href) {
|
|
1409
|
+
const link = doc.createElement("link");
|
|
1410
|
+
link.rel = "stylesheet";
|
|
1411
|
+
link.href = styleSheet.href;
|
|
1412
|
+
doc.head.appendChild(link);
|
|
1413
|
+
} else {
|
|
1414
|
+
const cssRules = Array.from(styleSheet.cssRules).map((rule) => rule.cssText).join("\n");
|
|
1415
|
+
const style2 = doc.createElement("style");
|
|
1416
|
+
style2.textContent = cssRules;
|
|
1417
|
+
doc.head.appendChild(style2);
|
|
1418
|
+
}
|
|
1419
|
+
} catch (e3) {
|
|
1420
|
+
}
|
|
1421
|
+
});
|
|
1422
|
+
const style = doc.createElement("style");
|
|
1423
|
+
style.textContent = `
|
|
1424
|
+
html, body {
|
|
1425
|
+
margin: 0;
|
|
1426
|
+
padding: 0;
|
|
1427
|
+
background-color: transparent;
|
|
1428
|
+
min-height: 100vh;
|
|
1429
|
+
}
|
|
1430
|
+
body {
|
|
1431
|
+
padding: 32px 16px;
|
|
1432
|
+
box-sizing: border-box;
|
|
1433
|
+
}
|
|
1434
|
+
.tecof-node-wrapper {
|
|
1435
|
+
position: relative;
|
|
1436
|
+
transition: outline 0.15s ease-in-out;
|
|
1437
|
+
}
|
|
1438
|
+
/* Custom scrollbars for iframe */
|
|
1439
|
+
::-webkit-scrollbar {
|
|
1440
|
+
width: 8px;
|
|
1441
|
+
height: 8px;
|
|
1442
|
+
}
|
|
1443
|
+
::-webkit-scrollbar-track {
|
|
1444
|
+
background: transparent;
|
|
1445
|
+
}
|
|
1446
|
+
::-webkit-scrollbar-thumb {
|
|
1447
|
+
background: rgba(0, 0, 0, 0.15);
|
|
1448
|
+
border-radius: 4px;
|
|
1449
|
+
}
|
|
1450
|
+
::-webkit-scrollbar-thumb:hover {
|
|
1451
|
+
background: rgba(0, 0, 0, 0.25);
|
|
1452
|
+
}
|
|
1453
|
+
`;
|
|
1454
|
+
doc.head.appendChild(style);
|
|
1455
|
+
};
|
|
1456
|
+
copyStyles();
|
|
1457
|
+
if (doc.body) {
|
|
1458
|
+
doc.body.className = "tecof-canvas-body";
|
|
1459
|
+
const handleBodyClick = (e3) => {
|
|
1460
|
+
const target = e3.target;
|
|
1461
|
+
if (!target.closest(".tecof-node-wrapper")) {
|
|
1462
|
+
useEditorStore.getState().selectNode(null);
|
|
1463
|
+
const isEmbedded = typeof window !== "undefined" && window.parent !== window;
|
|
1464
|
+
if (isEmbedded) {
|
|
1465
|
+
window.parent.postMessage({ type: "puck:itemDeselected" }, "*");
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
};
|
|
1469
|
+
doc.body.addEventListener("click", handleBodyClick);
|
|
1470
|
+
return () => {
|
|
1471
|
+
doc.body.removeEventListener("click", handleBodyClick);
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
}, [contentRef]);
|
|
1475
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1476
|
+
"iframe",
|
|
1477
|
+
{
|
|
1478
|
+
title,
|
|
1479
|
+
ref: setContentRef,
|
|
1480
|
+
style: {
|
|
1481
|
+
width: "100%",
|
|
1482
|
+
height: "100%",
|
|
1483
|
+
border: "none",
|
|
1484
|
+
background: "#ffffff",
|
|
1485
|
+
...props.style
|
|
1486
|
+
},
|
|
1487
|
+
...props,
|
|
1488
|
+
children: mountNode && ReactDOM.createPortal(children, mountNode)
|
|
1489
|
+
}
|
|
1490
|
+
);
|
|
1491
|
+
};
|
|
1492
|
+
var Canvas = () => {
|
|
1493
|
+
const content = useEditorStore((state3) => state3.document.content);
|
|
1494
|
+
const viewport = useEditorStore((state3) => state3.viewport);
|
|
1495
|
+
const getWidth2 = () => {
|
|
1496
|
+
switch (viewport) {
|
|
1497
|
+
case "tablet":
|
|
1498
|
+
return "768px";
|
|
1499
|
+
case "mobile":
|
|
1500
|
+
return "375px";
|
|
1501
|
+
case "desktop":
|
|
1502
|
+
default:
|
|
1503
|
+
return "100%";
|
|
1504
|
+
}
|
|
1505
|
+
};
|
|
1506
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-canvas-container", style: {
|
|
1507
|
+
flex: 1,
|
|
1508
|
+
display: "flex",
|
|
1509
|
+
alignItems: "center",
|
|
1510
|
+
justifyContent: "center",
|
|
1511
|
+
background: "#f4f4f5",
|
|
1512
|
+
padding: "24px",
|
|
1513
|
+
overflow: "auto",
|
|
1514
|
+
height: "100%",
|
|
1515
|
+
boxSizing: "border-box"
|
|
1516
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1517
|
+
"div",
|
|
1518
|
+
{
|
|
1519
|
+
className: "tecof-canvas-viewport-wrapper",
|
|
1520
|
+
style: {
|
|
1521
|
+
width: getWidth2(),
|
|
1522
|
+
height: "100%",
|
|
1523
|
+
maxWidth: "100%",
|
|
1524
|
+
transition: "width 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
1525
|
+
boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05)",
|
|
1526
|
+
borderRadius: viewport === "desktop" ? "0" : "12px",
|
|
1527
|
+
overflow: "hidden",
|
|
1528
|
+
backgroundColor: "#ffffff"
|
|
1529
|
+
},
|
|
1530
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Frame, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-canvas-root", style: { minHeight: "100%" }, children: content.map((item2, index2) => /* @__PURE__ */ jsxRuntime.jsx(NodeRenderer, { node: item2, index: index2 }, item2.props.id)) }) })
|
|
1531
|
+
}
|
|
1532
|
+
) });
|
|
1533
|
+
};
|
|
1534
|
+
var useOverlayCoords = (id, iframeEl, containerEl, documentState) => {
|
|
1535
|
+
const [coords, setCoords] = React__default.useState(null);
|
|
1536
|
+
React__default.useEffect(() => {
|
|
1537
|
+
if (!id || !iframeEl || !containerEl) {
|
|
1538
|
+
setCoords(null);
|
|
1539
|
+
return;
|
|
1540
|
+
}
|
|
1541
|
+
let resizeObserver = null;
|
|
1542
|
+
let targetResizeObserver = null;
|
|
1543
|
+
const updateCoords = () => {
|
|
1544
|
+
const doc = iframeEl.contentDocument;
|
|
1545
|
+
if (!doc) return;
|
|
1546
|
+
const element = doc.querySelector(`[data-tecof-id="${id}"]`);
|
|
1547
|
+
if (!element) {
|
|
1548
|
+
setCoords(null);
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
const rect = element.getBoundingClientRect();
|
|
1552
|
+
const iframeRect = iframeEl.getBoundingClientRect();
|
|
1553
|
+
const containerRect = containerEl.getBoundingClientRect();
|
|
1554
|
+
setCoords({
|
|
1555
|
+
top: rect.top + iframeRect.top - containerRect.top,
|
|
1556
|
+
left: rect.left + iframeRect.left - containerRect.left,
|
|
1557
|
+
width: rect.width,
|
|
1558
|
+
height: rect.height
|
|
1559
|
+
});
|
|
1560
|
+
if (!targetResizeObserver) {
|
|
1561
|
+
targetResizeObserver = new ResizeObserver(() => {
|
|
1562
|
+
updateCoords();
|
|
1563
|
+
});
|
|
1564
|
+
targetResizeObserver.observe(element);
|
|
1565
|
+
}
|
|
1566
|
+
};
|
|
1567
|
+
updateCoords();
|
|
1568
|
+
const iframeWin = iframeEl.contentWindow;
|
|
1569
|
+
resizeObserver = new ResizeObserver(() => {
|
|
1570
|
+
updateCoords();
|
|
1571
|
+
});
|
|
1572
|
+
resizeObserver.observe(iframeEl);
|
|
1573
|
+
iframeWin?.addEventListener("scroll", updateCoords);
|
|
1574
|
+
window.addEventListener("resize", updateCoords);
|
|
1575
|
+
return () => {
|
|
1576
|
+
if (resizeObserver) resizeObserver.disconnect();
|
|
1577
|
+
if (targetResizeObserver) targetResizeObserver.disconnect();
|
|
1578
|
+
iframeWin?.removeEventListener("scroll", updateCoords);
|
|
1579
|
+
window.removeEventListener("resize", updateCoords);
|
|
1580
|
+
};
|
|
1581
|
+
}, [id, iframeEl, containerEl, documentState]);
|
|
1582
|
+
return coords;
|
|
1583
|
+
};
|
|
1584
|
+
var SelectionOverlay = () => {
|
|
1585
|
+
const documentState = useEditorStore((state3) => state3.document);
|
|
1586
|
+
const selectedId = useEditorStore((state3) => state3.selection.selectedId);
|
|
1587
|
+
const hoveredId = useEditorStore((state3) => state3.selection.hoveredId);
|
|
1588
|
+
const selectNode = useEditorStore((state3) => state3.selectNode);
|
|
1589
|
+
const removeNode2 = useEditorStore((state3) => state3.removeNode);
|
|
1590
|
+
const duplicateNode2 = useEditorStore((state3) => state3.duplicateNode);
|
|
1591
|
+
const moveNode2 = useEditorStore((state3) => state3.moveNode);
|
|
1592
|
+
const [iframeEl, setIframeEl] = React__default.useState(null);
|
|
1593
|
+
const containerRef = React__default.useRef(null);
|
|
1594
|
+
React__default.useEffect(() => {
|
|
1595
|
+
const iframe = document.querySelector(".tecof-canvas-viewport-wrapper iframe");
|
|
1596
|
+
setIframeEl(iframe);
|
|
1597
|
+
}, [documentState]);
|
|
1598
|
+
const selectedCoords = useOverlayCoords(selectedId, iframeEl, containerRef.current, documentState);
|
|
1599
|
+
const hoveredCoords = useOverlayCoords(
|
|
1600
|
+
hoveredId !== selectedId ? hoveredId : null,
|
|
1601
|
+
iframeEl,
|
|
1602
|
+
containerRef.current,
|
|
1603
|
+
documentState
|
|
1604
|
+
);
|
|
1605
|
+
const nodeDetails = selectedId ? findNodeById(documentState, selectedId) : null;
|
|
1606
|
+
const parentId = selectedId ? getParentId(documentState, selectedId) : null;
|
|
1607
|
+
const canMoveUp = nodeDetails ? nodeDetails.path.index > 0 : false;
|
|
1608
|
+
const canMoveDown = nodeDetails ? (() => {
|
|
1609
|
+
const { zoneKey, index: index2 } = nodeDetails.path;
|
|
1610
|
+
const items = zoneKey ? documentState.zones[zoneKey] || [] : documentState.content;
|
|
1611
|
+
return index2 < items.length - 1;
|
|
1612
|
+
})() : false;
|
|
1613
|
+
const handleMove = (direction) => {
|
|
1614
|
+
if (!selectedId || !nodeDetails) return;
|
|
1615
|
+
const { zoneKey, index: index2 } = nodeDetails.path;
|
|
1616
|
+
const newIndex = direction === "up" ? index2 - 1 : index2 + 1;
|
|
1617
|
+
moveNode2(selectedId, zoneKey, newIndex);
|
|
1618
|
+
};
|
|
1619
|
+
const breadcrumbs = selectedId ? getBreadcrumbs(documentState, selectedId) : [];
|
|
1620
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1621
|
+
"div",
|
|
1622
|
+
{
|
|
1623
|
+
ref: containerRef,
|
|
1624
|
+
className: "tecof-selection-overlay-container",
|
|
1625
|
+
style: {
|
|
1626
|
+
position: "absolute",
|
|
1627
|
+
top: 0,
|
|
1628
|
+
left: 0,
|
|
1629
|
+
right: 0,
|
|
1630
|
+
bottom: 0,
|
|
1631
|
+
pointerEvents: "none",
|
|
1632
|
+
zIndex: 1e3
|
|
1633
|
+
},
|
|
1634
|
+
children: [
|
|
1635
|
+
hoveredCoords && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1636
|
+
"div",
|
|
1637
|
+
{
|
|
1638
|
+
className: "tecof-hover-outline",
|
|
1639
|
+
style: {
|
|
1640
|
+
position: "absolute",
|
|
1641
|
+
top: hoveredCoords.top,
|
|
1642
|
+
left: hoveredCoords.left,
|
|
1643
|
+
width: hoveredCoords.width,
|
|
1644
|
+
height: hoveredCoords.height,
|
|
1645
|
+
border: "1.5px dashed #3b82f6",
|
|
1646
|
+
borderRadius: "4px",
|
|
1647
|
+
boxSizing: "border-box",
|
|
1648
|
+
pointerEvents: "none",
|
|
1649
|
+
transition: "all 0.1s ease-out"
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
),
|
|
1653
|
+
selectedCoords && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1654
|
+
"div",
|
|
1655
|
+
{
|
|
1656
|
+
className: "tecof-selected-outline",
|
|
1657
|
+
style: {
|
|
1658
|
+
position: "absolute",
|
|
1659
|
+
top: selectedCoords.top,
|
|
1660
|
+
left: selectedCoords.left,
|
|
1661
|
+
width: selectedCoords.width,
|
|
1662
|
+
height: selectedCoords.height,
|
|
1663
|
+
border: "2px solid #3b82f6",
|
|
1664
|
+
borderRadius: "4px",
|
|
1665
|
+
boxSizing: "border-box",
|
|
1666
|
+
pointerEvents: "none",
|
|
1667
|
+
transition: "all 0.1s ease-out"
|
|
1668
|
+
},
|
|
1669
|
+
children: [
|
|
1670
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1671
|
+
"div",
|
|
1672
|
+
{
|
|
1673
|
+
className: "tecof-floating-toolbar",
|
|
1674
|
+
style: {
|
|
1675
|
+
position: "absolute",
|
|
1676
|
+
top: "-36px",
|
|
1677
|
+
right: "-2px",
|
|
1678
|
+
display: "flex",
|
|
1679
|
+
alignItems: "center",
|
|
1680
|
+
gap: "4px",
|
|
1681
|
+
background: "#3b82f6",
|
|
1682
|
+
borderRadius: "6px",
|
|
1683
|
+
padding: "4px",
|
|
1684
|
+
pointerEvents: "auto",
|
|
1685
|
+
boxShadow: "0 4px 6px -1px rgba(59, 130, 246, 0.2)"
|
|
1686
|
+
},
|
|
1687
|
+
children: [
|
|
1688
|
+
parentId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1689
|
+
"button",
|
|
1690
|
+
{
|
|
1691
|
+
onClick: () => selectNode(parentId),
|
|
1692
|
+
title: "\xDCst \xD6\u011Feyi Se\xE7",
|
|
1693
|
+
style: {
|
|
1694
|
+
background: "transparent",
|
|
1695
|
+
border: "none",
|
|
1696
|
+
color: "#ffffff",
|
|
1697
|
+
cursor: "pointer",
|
|
1698
|
+
padding: "4px",
|
|
1699
|
+
borderRadius: "4px",
|
|
1700
|
+
display: "flex"
|
|
1701
|
+
},
|
|
1702
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronUp, { size: 14 })
|
|
1703
|
+
}
|
|
1704
|
+
),
|
|
1705
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1706
|
+
"button",
|
|
1707
|
+
{
|
|
1708
|
+
onClick: () => handleMove("up"),
|
|
1709
|
+
disabled: !canMoveUp,
|
|
1710
|
+
title: "Yukar\u0131 Ta\u015F\u0131",
|
|
1711
|
+
style: {
|
|
1712
|
+
background: "transparent",
|
|
1713
|
+
border: "none",
|
|
1714
|
+
color: "#ffffff",
|
|
1715
|
+
opacity: canMoveUp ? 1 : 0.5,
|
|
1716
|
+
cursor: canMoveUp ? "pointer" : "not-allowed",
|
|
1717
|
+
padding: "4px",
|
|
1718
|
+
borderRadius: "4px",
|
|
1719
|
+
display: "flex"
|
|
1720
|
+
},
|
|
1721
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ArrowUp, { size: 14 })
|
|
1722
|
+
}
|
|
1723
|
+
),
|
|
1724
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1725
|
+
"button",
|
|
1726
|
+
{
|
|
1727
|
+
onClick: () => handleMove("down"),
|
|
1728
|
+
disabled: !canMoveDown,
|
|
1729
|
+
title: "A\u015Fa\u011F\u0131 Ta\u015F\u0131",
|
|
1730
|
+
style: {
|
|
1731
|
+
background: "transparent",
|
|
1732
|
+
border: "none",
|
|
1733
|
+
color: "#ffffff",
|
|
1734
|
+
opacity: canMoveDown ? 1 : 0.5,
|
|
1735
|
+
cursor: canMoveDown ? "pointer" : "not-allowed",
|
|
1736
|
+
padding: "4px",
|
|
1737
|
+
borderRadius: "4px",
|
|
1738
|
+
display: "flex"
|
|
1739
|
+
},
|
|
1740
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ArrowDown, { size: 14 })
|
|
1741
|
+
}
|
|
1742
|
+
),
|
|
1743
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "1px", height: "14px", background: "rgba(255,255,255,0.3)", margin: "0 2px" } }),
|
|
1744
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1745
|
+
"button",
|
|
1746
|
+
{
|
|
1747
|
+
onClick: () => duplicateNode2(selectedId),
|
|
1748
|
+
title: "Kopyala",
|
|
1749
|
+
style: {
|
|
1750
|
+
background: "transparent",
|
|
1751
|
+
border: "none",
|
|
1752
|
+
color: "#ffffff",
|
|
1753
|
+
cursor: "pointer",
|
|
1754
|
+
padding: "4px",
|
|
1755
|
+
borderRadius: "4px",
|
|
1756
|
+
display: "flex"
|
|
1757
|
+
},
|
|
1758
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Copy, { size: 14 })
|
|
1759
|
+
}
|
|
1760
|
+
),
|
|
1761
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1762
|
+
"button",
|
|
1763
|
+
{
|
|
1764
|
+
onClick: () => removeNode2(selectedId),
|
|
1765
|
+
title: "Sil",
|
|
1766
|
+
style: {
|
|
1767
|
+
background: "transparent",
|
|
1768
|
+
border: "none",
|
|
1769
|
+
color: "#ffffff",
|
|
1770
|
+
cursor: "pointer",
|
|
1771
|
+
padding: "4px",
|
|
1772
|
+
borderRadius: "4px",
|
|
1773
|
+
display: "flex"
|
|
1774
|
+
},
|
|
1775
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Trash2, { size: 14 })
|
|
1776
|
+
}
|
|
1777
|
+
)
|
|
1778
|
+
]
|
|
1779
|
+
}
|
|
1780
|
+
),
|
|
1781
|
+
nodeDetails && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1782
|
+
"div",
|
|
1783
|
+
{
|
|
1784
|
+
className: "tecof-outline-label",
|
|
1785
|
+
style: {
|
|
1786
|
+
position: "absolute",
|
|
1787
|
+
top: "-26px",
|
|
1788
|
+
left: "-2px",
|
|
1789
|
+
background: "#3b82f6",
|
|
1790
|
+
color: "#ffffff",
|
|
1791
|
+
fontSize: "11px",
|
|
1792
|
+
fontWeight: 600,
|
|
1793
|
+
padding: "2px 8px",
|
|
1794
|
+
borderRadius: "4px 4px 0 0",
|
|
1795
|
+
userSelect: "none"
|
|
1796
|
+
},
|
|
1797
|
+
children: nodeDetails.node.type
|
|
1798
|
+
}
|
|
1799
|
+
),
|
|
1800
|
+
breadcrumbs.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1801
|
+
"div",
|
|
1802
|
+
{
|
|
1803
|
+
className: "tecof-selected-breadcrumbs",
|
|
1804
|
+
style: {
|
|
1805
|
+
position: "absolute",
|
|
1806
|
+
bottom: "-28px",
|
|
1807
|
+
left: "-2px",
|
|
1808
|
+
display: "flex",
|
|
1809
|
+
alignItems: "center",
|
|
1810
|
+
gap: "4px",
|
|
1811
|
+
background: "#18181b",
|
|
1812
|
+
color: "#a1a1aa",
|
|
1813
|
+
fontSize: "10px",
|
|
1814
|
+
padding: "4px 8px",
|
|
1815
|
+
borderRadius: "0 0 6px 6px",
|
|
1816
|
+
pointerEvents: "auto",
|
|
1817
|
+
boxShadow: "0 2px 4px rgba(0,0,0,0.05)"
|
|
1818
|
+
},
|
|
1819
|
+
children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxRuntime.jsxs(React__default__namespace.default.Fragment, { children: [
|
|
1820
|
+
idx > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#52525b" }, children: ">" }),
|
|
1821
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1822
|
+
"span",
|
|
1823
|
+
{
|
|
1824
|
+
onClick: () => selectNode(crumb.id),
|
|
1825
|
+
style: {
|
|
1826
|
+
cursor: "pointer",
|
|
1827
|
+
color: crumb.id === selectedId ? "#ffffff" : void 0,
|
|
1828
|
+
fontWeight: crumb.id === selectedId ? 600 : void 0
|
|
1829
|
+
},
|
|
1830
|
+
onMouseEnter: () => useEditorStore.getState().hoverNode(crumb.id),
|
|
1831
|
+
onMouseLeave: () => useEditorStore.getState().hoverNode(null),
|
|
1832
|
+
children: crumb.type
|
|
1833
|
+
}
|
|
1834
|
+
)
|
|
1835
|
+
] }, crumb.id))
|
|
1836
|
+
}
|
|
1837
|
+
)
|
|
1838
|
+
]
|
|
1839
|
+
}
|
|
1840
|
+
)
|
|
1841
|
+
]
|
|
1842
|
+
}
|
|
1843
|
+
);
|
|
1844
|
+
};
|
|
1845
|
+
var FieldLabel = ({
|
|
1846
|
+
label,
|
|
1847
|
+
icon,
|
|
1848
|
+
readOnly,
|
|
1849
|
+
children,
|
|
1850
|
+
el = "label"
|
|
1851
|
+
}) => {
|
|
1852
|
+
const Component2 = el;
|
|
1853
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1854
|
+
Component2,
|
|
1855
|
+
{
|
|
1856
|
+
className: "tecof-field-label-container",
|
|
1857
|
+
style: {
|
|
1858
|
+
display: "flex",
|
|
1859
|
+
flexDirection: "column",
|
|
1860
|
+
gap: "6px",
|
|
1861
|
+
marginBottom: "16px",
|
|
1862
|
+
width: "100%",
|
|
1863
|
+
boxSizing: "border-box",
|
|
1864
|
+
userSelect: "none"
|
|
1865
|
+
},
|
|
1866
|
+
children: [
|
|
1867
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1868
|
+
"div",
|
|
1869
|
+
{
|
|
1870
|
+
className: "tecof-field-label-header",
|
|
1871
|
+
style: {
|
|
1872
|
+
display: "flex",
|
|
1873
|
+
alignItems: "center",
|
|
1874
|
+
gap: "6px",
|
|
1875
|
+
fontSize: "12px",
|
|
1876
|
+
fontWeight: 600,
|
|
1877
|
+
color: "#27272a"
|
|
1878
|
+
// zinc-800
|
|
1879
|
+
},
|
|
1880
|
+
children: [
|
|
1881
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-flex" }, children: icon }),
|
|
1882
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
|
|
1883
|
+
readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1884
|
+
"span",
|
|
1885
|
+
{
|
|
1886
|
+
style: {
|
|
1887
|
+
fontSize: "10px",
|
|
1888
|
+
color: "#a1a1aa",
|
|
1889
|
+
fontWeight: 400,
|
|
1890
|
+
marginLeft: "auto"
|
|
1891
|
+
},
|
|
1892
|
+
children: "Salt Okunur"
|
|
1893
|
+
}
|
|
1894
|
+
)
|
|
1895
|
+
]
|
|
1896
|
+
}
|
|
1897
|
+
),
|
|
1898
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-field-label-content", style: { width: "100%" }, children })
|
|
1899
|
+
]
|
|
1900
|
+
}
|
|
1901
|
+
);
|
|
1902
|
+
};
|
|
1903
|
+
var FieldRenderer = ({
|
|
1904
|
+
name: name3,
|
|
1905
|
+
definition,
|
|
1906
|
+
value,
|
|
1907
|
+
onChange,
|
|
1908
|
+
readOnly = false
|
|
1909
|
+
}) => {
|
|
1910
|
+
const label = definition.label || name3;
|
|
1911
|
+
const type = definition.type;
|
|
1912
|
+
if (definition.render) {
|
|
1913
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-custom-field-wrapper", style: { width: "100%" }, children: definition.render({
|
|
1914
|
+
field: definition,
|
|
1915
|
+
name: name3,
|
|
1916
|
+
id: `field-${name3}`,
|
|
1917
|
+
value,
|
|
1918
|
+
onChange,
|
|
1919
|
+
readOnly
|
|
1920
|
+
}) });
|
|
1921
|
+
}
|
|
1922
|
+
switch (type) {
|
|
1923
|
+
case "text":
|
|
1924
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1925
|
+
"input",
|
|
1926
|
+
{
|
|
1927
|
+
id: `field-${name3}`,
|
|
1928
|
+
type: "text",
|
|
1929
|
+
value: value || "",
|
|
1930
|
+
disabled: readOnly,
|
|
1931
|
+
onChange: (e3) => onChange(e3.target.value),
|
|
1932
|
+
style: {
|
|
1933
|
+
width: "100%",
|
|
1934
|
+
padding: "10px 12px",
|
|
1935
|
+
borderRadius: "8px",
|
|
1936
|
+
border: "1px solid #e4e4e7",
|
|
1937
|
+
fontSize: "13px",
|
|
1938
|
+
color: "#18181b",
|
|
1939
|
+
backgroundColor: readOnly ? "#f4f4f5" : "#ffffff",
|
|
1940
|
+
outline: "none",
|
|
1941
|
+
boxSizing: "border-box",
|
|
1942
|
+
transition: "border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out"
|
|
1943
|
+
},
|
|
1944
|
+
className: "tecof-input-text"
|
|
1945
|
+
}
|
|
1946
|
+
) });
|
|
1947
|
+
case "textarea":
|
|
1948
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1949
|
+
"textarea",
|
|
1950
|
+
{
|
|
1951
|
+
id: `field-${name3}`,
|
|
1952
|
+
rows: 4,
|
|
1953
|
+
value: value || "",
|
|
1954
|
+
disabled: readOnly,
|
|
1955
|
+
onChange: (e3) => onChange(e3.target.value),
|
|
1956
|
+
style: {
|
|
1957
|
+
width: "100%",
|
|
1958
|
+
padding: "10px 12px",
|
|
1959
|
+
borderRadius: "8px",
|
|
1960
|
+
border: "1px solid #e4e4e7",
|
|
1961
|
+
fontSize: "13px",
|
|
1962
|
+
color: "#18181b",
|
|
1963
|
+
backgroundColor: readOnly ? "#f4f4f5" : "#ffffff",
|
|
1964
|
+
outline: "none",
|
|
1965
|
+
resize: "vertical",
|
|
1966
|
+
boxSizing: "border-box",
|
|
1967
|
+
transition: "border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out"
|
|
1968
|
+
},
|
|
1969
|
+
className: "tecof-input-textarea"
|
|
1970
|
+
}
|
|
1971
|
+
) });
|
|
1972
|
+
case "select":
|
|
1973
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative", width: "100%" }, children: [
|
|
1974
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1975
|
+
"select",
|
|
1976
|
+
{
|
|
1977
|
+
id: `field-${name3}`,
|
|
1978
|
+
value: value || "",
|
|
1979
|
+
disabled: readOnly,
|
|
1980
|
+
onChange: (e3) => onChange(e3.target.value),
|
|
1981
|
+
style: {
|
|
1982
|
+
width: "100%",
|
|
1983
|
+
padding: "10px 32px 10px 12px",
|
|
1984
|
+
borderRadius: "8px",
|
|
1985
|
+
border: "1px solid #e4e4e7",
|
|
1986
|
+
fontSize: "13px",
|
|
1987
|
+
color: "#18181b",
|
|
1988
|
+
backgroundColor: readOnly ? "#f4f4f5" : "#ffffff",
|
|
1989
|
+
outline: "none",
|
|
1990
|
+
appearance: "none",
|
|
1991
|
+
boxSizing: "border-box",
|
|
1992
|
+
cursor: readOnly ? "not-allowed" : "pointer"
|
|
1993
|
+
},
|
|
1994
|
+
className: "tecof-input-select",
|
|
1995
|
+
children: (definition.options || []).map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt.value, children: opt.label || opt.value }, opt.value))
|
|
1996
|
+
}
|
|
1997
|
+
),
|
|
1998
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1999
|
+
"div",
|
|
2000
|
+
{
|
|
2001
|
+
style: {
|
|
2002
|
+
position: "absolute",
|
|
2003
|
+
top: "50%",
|
|
2004
|
+
right: "12px",
|
|
2005
|
+
transform: "translateY(-50%)",
|
|
2006
|
+
pointerEvents: "none",
|
|
2007
|
+
display: "flex",
|
|
2008
|
+
alignItems: "center",
|
|
2009
|
+
color: "#71717a"
|
|
2010
|
+
},
|
|
2011
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2.5 4.5L6 8L9.5 4.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
2012
|
+
}
|
|
2013
|
+
)
|
|
2014
|
+
] }) });
|
|
2015
|
+
case "number":
|
|
2016
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2017
|
+
"input",
|
|
2018
|
+
{
|
|
2019
|
+
id: `field-${name3}`,
|
|
2020
|
+
type: "number",
|
|
2021
|
+
value: value !== void 0 ? value : "",
|
|
2022
|
+
disabled: readOnly,
|
|
2023
|
+
onChange: (e3) => {
|
|
2024
|
+
const val = e3.target.value;
|
|
2025
|
+
onChange(val === "" ? void 0 : Number(val));
|
|
2026
|
+
},
|
|
2027
|
+
style: {
|
|
2028
|
+
width: "100%",
|
|
2029
|
+
padding: "10px 12px",
|
|
2030
|
+
borderRadius: "8px",
|
|
2031
|
+
border: "1px solid #e4e4e7",
|
|
2032
|
+
fontSize: "13px",
|
|
2033
|
+
color: "#18181b",
|
|
2034
|
+
backgroundColor: readOnly ? "#f4f4f5" : "#ffffff",
|
|
2035
|
+
outline: "none",
|
|
2036
|
+
boxSizing: "border-box"
|
|
2037
|
+
},
|
|
2038
|
+
className: "tecof-input-number"
|
|
2039
|
+
}
|
|
2040
|
+
) });
|
|
2041
|
+
case "radio":
|
|
2042
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (definition.options || []).map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2043
|
+
"label",
|
|
2044
|
+
{
|
|
2045
|
+
style: {
|
|
2046
|
+
display: "flex",
|
|
2047
|
+
alignItems: "center",
|
|
2048
|
+
gap: "8px",
|
|
2049
|
+
fontSize: "13px",
|
|
2050
|
+
color: "#27272a",
|
|
2051
|
+
cursor: readOnly ? "not-allowed" : "pointer"
|
|
2052
|
+
},
|
|
2053
|
+
children: [
|
|
2054
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2055
|
+
"input",
|
|
2056
|
+
{
|
|
2057
|
+
type: "radio",
|
|
2058
|
+
name: name3,
|
|
2059
|
+
value: opt.value,
|
|
2060
|
+
checked: value === opt.value,
|
|
2061
|
+
disabled: readOnly,
|
|
2062
|
+
onChange: () => onChange(opt.value),
|
|
2063
|
+
style: {
|
|
2064
|
+
cursor: readOnly ? "not-allowed" : "pointer"
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
),
|
|
2068
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: opt.label || opt.value })
|
|
2069
|
+
]
|
|
2070
|
+
},
|
|
2071
|
+
opt.value
|
|
2072
|
+
)) }) });
|
|
2073
|
+
default:
|
|
2074
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "8px", fontSize: "11px", color: "#71717a", background: "#fafafa", borderRadius: "4px" }, children: [
|
|
2075
|
+
'Desteklenmeyen alan t\xFCr\xFC: "',
|
|
2076
|
+
type,
|
|
2077
|
+
'" (',
|
|
2078
|
+
name3,
|
|
2079
|
+
")"
|
|
2080
|
+
] });
|
|
2081
|
+
}
|
|
2082
|
+
};
|
|
2083
|
+
var Inspector = () => {
|
|
2084
|
+
const documentState = useEditorStore((state3) => state3.document);
|
|
2085
|
+
const selectedId = useEditorStore((state3) => state3.selection.selectedId);
|
|
2086
|
+
const updateProps2 = useEditorStore((state3) => state3.updateProps);
|
|
2087
|
+
const setRootProps2 = useEditorStore((state3) => state3.setRootProps);
|
|
2088
|
+
const selectNode = useEditorStore((state3) => state3.selectNode);
|
|
2089
|
+
const { config: config3, readOnly } = useStudio();
|
|
2090
|
+
if (selectedId) {
|
|
2091
|
+
const nodeDetails = findNodeById(documentState, selectedId);
|
|
2092
|
+
if (!nodeDetails) {
|
|
2093
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "24px", color: "#71717a", fontSize: "13px", textAlign: "center" }, children: "Bile\u015Fen y\xFCkleniyor veya bulunamad\u0131." });
|
|
2094
|
+
}
|
|
2095
|
+
const { node } = nodeDetails;
|
|
2096
|
+
const componentConfig = config3.components[node.type];
|
|
2097
|
+
const fields = componentConfig?.fields || {};
|
|
2098
|
+
const label = componentConfig?.label || node.type;
|
|
2099
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2100
|
+
"div",
|
|
2101
|
+
{
|
|
2102
|
+
className: "tecof-inspector",
|
|
2103
|
+
style: {
|
|
2104
|
+
width: "320px",
|
|
2105
|
+
height: "100%",
|
|
2106
|
+
borderLeft: "1px solid #e4e4e7",
|
|
2107
|
+
background: "#ffffff",
|
|
2108
|
+
display: "flex",
|
|
2109
|
+
flexDirection: "column",
|
|
2110
|
+
boxSizing: "border-box"
|
|
2111
|
+
},
|
|
2112
|
+
children: [
|
|
2113
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2114
|
+
"div",
|
|
2115
|
+
{
|
|
2116
|
+
style: {
|
|
2117
|
+
padding: "16px 20px",
|
|
2118
|
+
borderBottom: "1px solid #f4f4f5",
|
|
2119
|
+
display: "flex",
|
|
2120
|
+
alignItems: "center",
|
|
2121
|
+
justifyContent: "space-between"
|
|
2122
|
+
},
|
|
2123
|
+
children: [
|
|
2124
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2125
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: 0, fontSize: "14px", fontWeight: 700, color: "#18181b" }, children: label }),
|
|
2126
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#a1a1aa", fontFamily: "monospace" }, children: selectedId })
|
|
2127
|
+
] }),
|
|
2128
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2129
|
+
"button",
|
|
2130
|
+
{
|
|
2131
|
+
onClick: () => selectNode(null),
|
|
2132
|
+
style: {
|
|
2133
|
+
background: "transparent",
|
|
2134
|
+
border: "none",
|
|
2135
|
+
color: "#71717a",
|
|
2136
|
+
cursor: "pointer",
|
|
2137
|
+
fontSize: "11px",
|
|
2138
|
+
fontWeight: 500,
|
|
2139
|
+
padding: "4px 8px",
|
|
2140
|
+
borderRadius: "4px",
|
|
2141
|
+
hover: { background: "#f4f4f5" }
|
|
2142
|
+
},
|
|
2143
|
+
children: "Se\xE7imi Kald\u0131r"
|
|
2144
|
+
}
|
|
2145
|
+
)
|
|
2146
|
+
]
|
|
2147
|
+
}
|
|
2148
|
+
),
|
|
2149
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2150
|
+
"div",
|
|
2151
|
+
{
|
|
2152
|
+
className: "tecof-inspector-fields",
|
|
2153
|
+
style: {
|
|
2154
|
+
flex: 1,
|
|
2155
|
+
overflowY: "auto",
|
|
2156
|
+
padding: "20px",
|
|
2157
|
+
display: "flex",
|
|
2158
|
+
flexDirection: "column",
|
|
2159
|
+
gap: "4px"
|
|
2160
|
+
},
|
|
2161
|
+
children: Object.keys(fields).length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: "#a1a1aa", fontSize: "12px", textAlign: "center", marginTop: "16px" }, children: "Bu bile\u015Fenin d\xFCzenlenebilir alan\u0131 bulunmuyor." }) : Object.entries(fields).map(([fieldName, fieldDef]) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2162
|
+
FieldRenderer,
|
|
2163
|
+
{
|
|
2164
|
+
name: fieldName,
|
|
2165
|
+
definition: fieldDef,
|
|
2166
|
+
value: node.props[fieldName],
|
|
2167
|
+
onChange: (newVal) => updateProps2(selectedId, { [fieldName]: newVal }),
|
|
2168
|
+
readOnly
|
|
2169
|
+
},
|
|
2170
|
+
fieldName
|
|
2171
|
+
))
|
|
2172
|
+
}
|
|
2173
|
+
)
|
|
2174
|
+
]
|
|
2175
|
+
}
|
|
2176
|
+
);
|
|
2177
|
+
}
|
|
2178
|
+
const rootFields = config3.root?.fields || {};
|
|
2179
|
+
const hasRootFields = Object.keys(rootFields).length > 0;
|
|
2180
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2181
|
+
"div",
|
|
2182
|
+
{
|
|
2183
|
+
className: "tecof-inspector",
|
|
2184
|
+
style: {
|
|
2185
|
+
width: "320px",
|
|
2186
|
+
height: "100%",
|
|
2187
|
+
borderLeft: "1px solid #e4e4e7",
|
|
2188
|
+
background: "#ffffff",
|
|
2189
|
+
display: "flex",
|
|
2190
|
+
flexDirection: "column",
|
|
2191
|
+
boxSizing: "border-box"
|
|
2192
|
+
},
|
|
2193
|
+
children: [
|
|
2194
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2195
|
+
"div",
|
|
2196
|
+
{
|
|
2197
|
+
style: {
|
|
2198
|
+
padding: "16px 20px",
|
|
2199
|
+
borderBottom: "1px solid #f4f4f5"
|
|
2200
|
+
},
|
|
2201
|
+
children: [
|
|
2202
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: 0, fontSize: "14px", fontWeight: 700, color: "#18181b" }, children: "Sayfa Ayarlar\u0131" }),
|
|
2203
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#a1a1aa" }, children: "Genel sayfa konfig\xFCrasyonu" })
|
|
2204
|
+
]
|
|
2205
|
+
}
|
|
2206
|
+
),
|
|
2207
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2208
|
+
"div",
|
|
2209
|
+
{
|
|
2210
|
+
className: "tecof-inspector-fields",
|
|
2211
|
+
style: {
|
|
2212
|
+
flex: 1,
|
|
2213
|
+
overflowY: "auto",
|
|
2214
|
+
padding: "20px",
|
|
2215
|
+
display: "flex",
|
|
2216
|
+
flexDirection: "column",
|
|
2217
|
+
gap: "4px"
|
|
2218
|
+
},
|
|
2219
|
+
children: hasRootFields ? Object.entries(rootFields).map(([fieldName, fieldDef]) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2220
|
+
FieldRenderer,
|
|
2221
|
+
{
|
|
2222
|
+
name: fieldName,
|
|
2223
|
+
definition: fieldDef,
|
|
2224
|
+
value: documentState.root.props[fieldName],
|
|
2225
|
+
onChange: (newVal) => setRootProps2({ [fieldName]: newVal }),
|
|
2226
|
+
readOnly
|
|
2227
|
+
},
|
|
2228
|
+
fieldName
|
|
2229
|
+
)) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2230
|
+
"div",
|
|
2231
|
+
{
|
|
2232
|
+
style: {
|
|
2233
|
+
display: "flex",
|
|
2234
|
+
flexDirection: "column",
|
|
2235
|
+
alignItems: "center",
|
|
2236
|
+
justifyContent: "center",
|
|
2237
|
+
height: "100%",
|
|
2238
|
+
color: "#a1a1aa",
|
|
2239
|
+
fontSize: "12px",
|
|
2240
|
+
textAlign: "center",
|
|
2241
|
+
padding: "20px"
|
|
2242
|
+
},
|
|
2243
|
+
children: [
|
|
2244
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2245
|
+
"svg",
|
|
2246
|
+
{
|
|
2247
|
+
width: "24",
|
|
2248
|
+
height: "24",
|
|
2249
|
+
viewBox: "0 0 24 24",
|
|
2250
|
+
fill: "none",
|
|
2251
|
+
stroke: "currentColor",
|
|
2252
|
+
strokeWidth: "2",
|
|
2253
|
+
strokeLinecap: "round",
|
|
2254
|
+
strokeLinejoin: "round",
|
|
2255
|
+
style: { marginBottom: "8px", opacity: 0.6 },
|
|
2256
|
+
children: [
|
|
2257
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2258
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 3v18" })
|
|
2259
|
+
]
|
|
2260
|
+
}
|
|
2261
|
+
),
|
|
2262
|
+
"Bile\u015Fen se\xE7ilmedi. D\xFCzenlemek istedi\u011Finiz bir bile\u015Fene t\u0131klay\u0131n."
|
|
2263
|
+
]
|
|
2264
|
+
}
|
|
2265
|
+
)
|
|
2266
|
+
}
|
|
2267
|
+
)
|
|
2268
|
+
]
|
|
2269
|
+
}
|
|
2270
|
+
);
|
|
2271
|
+
};
|
|
2272
|
+
var TecofStudio = ({
|
|
2273
|
+
pageId,
|
|
2274
|
+
config: config3,
|
|
2275
|
+
accessToken,
|
|
2276
|
+
onSave,
|
|
2277
|
+
onChange,
|
|
2278
|
+
className
|
|
2279
|
+
}) => {
|
|
2280
|
+
const { apiClient } = useTecof();
|
|
2281
|
+
const [loading, setLoading] = React__default.useState(true);
|
|
2282
|
+
const [saving, setSaving] = React__default.useState(false);
|
|
2283
|
+
const [saveStatus, setSaveStatus] = React__default.useState("idle");
|
|
2284
|
+
const setDocument = useEditorStore((state3) => state3.setDocument);
|
|
2285
|
+
const documentState = useEditorStore((state3) => state3.document);
|
|
2286
|
+
const undo = useEditorStore((state3) => state3.undo);
|
|
2287
|
+
const redo = useEditorStore((state3) => state3.redo);
|
|
2288
|
+
const setViewport = useEditorStore((state3) => state3.setViewport);
|
|
2289
|
+
const documentStateRef = React__default.useRef(documentState);
|
|
2290
|
+
documentStateRef.current = documentState;
|
|
2291
|
+
const isEmbedded = typeof window !== "undefined" && window.parent !== window;
|
|
2292
|
+
React__default.useEffect(() => {
|
|
2293
|
+
let cancelled = false;
|
|
2294
|
+
const load = async () => {
|
|
2295
|
+
setLoading(true);
|
|
2296
|
+
try {
|
|
2297
|
+
const res2 = await apiClient.getPage(pageId);
|
|
2298
|
+
if (cancelled) return;
|
|
2299
|
+
const rawData = res2.success && res2.data?.draftData ? res2.data.draftData : null;
|
|
2300
|
+
const parsedDoc = parseDocument(rawData);
|
|
2301
|
+
setDocument(parsedDoc);
|
|
2302
|
+
} catch (err) {
|
|
2303
|
+
console.error("Failed to load page:", err);
|
|
2304
|
+
} finally {
|
|
2305
|
+
setLoading(false);
|
|
2306
|
+
}
|
|
2307
|
+
};
|
|
2308
|
+
load();
|
|
2309
|
+
return () => {
|
|
2310
|
+
cancelled = true;
|
|
2311
|
+
};
|
|
2312
|
+
}, [pageId, apiClient, setDocument]);
|
|
2313
|
+
const isFirstRender = React__default.useRef(true);
|
|
2314
|
+
React__default.useEffect(() => {
|
|
2315
|
+
if (loading) return;
|
|
2316
|
+
if (isFirstRender.current) {
|
|
2317
|
+
isFirstRender.current = false;
|
|
2318
|
+
return;
|
|
2319
|
+
}
|
|
2320
|
+
const serialized = serializeDocument(documentState);
|
|
2321
|
+
onChange?.(serialized);
|
|
2322
|
+
if (isEmbedded) {
|
|
2323
|
+
window.parent.postMessage({ type: "puck:changed" }, "*");
|
|
2324
|
+
}
|
|
2325
|
+
}, [documentState, loading, onChange, isEmbedded]);
|
|
2326
|
+
const handleSaveDraft = React__default.useCallback(async () => {
|
|
2327
|
+
const currentDoc = documentStateRef.current;
|
|
2328
|
+
const serialized = serializeDocument(currentDoc);
|
|
2329
|
+
setSaving(true);
|
|
2330
|
+
setSaveStatus("idle");
|
|
2331
|
+
try {
|
|
2332
|
+
const res2 = await apiClient.savePage(pageId, serialized, void 0, accessToken);
|
|
2333
|
+
if (res2.success) {
|
|
2334
|
+
setSaveStatus("success");
|
|
2335
|
+
setTimeout(() => setSaveStatus("idle"), 3e3);
|
|
2336
|
+
onSave?.(serialized);
|
|
2337
|
+
if (isEmbedded) {
|
|
2338
|
+
window.parent.postMessage({ type: "puck:saved" }, "*");
|
|
2339
|
+
}
|
|
2340
|
+
} else {
|
|
2341
|
+
setSaveStatus("error");
|
|
2342
|
+
if (isEmbedded) {
|
|
2343
|
+
window.parent.postMessage({ type: "puck:saveError", message: res2.message }, "*");
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
} catch (err) {
|
|
2347
|
+
setSaveStatus("error");
|
|
2348
|
+
if (isEmbedded) {
|
|
2349
|
+
window.parent.postMessage({ type: "puck:saveError", message: err.message }, "*");
|
|
2350
|
+
}
|
|
2351
|
+
} finally {
|
|
2352
|
+
setSaving(false);
|
|
2353
|
+
}
|
|
2354
|
+
}, [pageId, apiClient, accessToken, onSave, isEmbedded]);
|
|
2355
|
+
React__default.useEffect(() => {
|
|
2356
|
+
if (!isEmbedded) return;
|
|
2357
|
+
const onMessage = (e3) => {
|
|
2358
|
+
switch (e3.data?.type) {
|
|
2359
|
+
case "puck:save":
|
|
2360
|
+
handleSaveDraft();
|
|
2361
|
+
break;
|
|
2362
|
+
case "puck:undo":
|
|
2363
|
+
undo();
|
|
2364
|
+
break;
|
|
2365
|
+
case "puck:redo":
|
|
2366
|
+
redo();
|
|
2367
|
+
break;
|
|
2368
|
+
case "puck:viewport":
|
|
2369
|
+
if (e3.data.width) {
|
|
2370
|
+
const width = e3.data.width;
|
|
2371
|
+
if (width === "375px" || width === 375) {
|
|
2372
|
+
setViewport("mobile");
|
|
2373
|
+
} else if (width === "768px" || width === 768) {
|
|
2374
|
+
setViewport("tablet");
|
|
2375
|
+
} else {
|
|
2376
|
+
setViewport("desktop");
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
break;
|
|
2380
|
+
}
|
|
2381
|
+
};
|
|
2382
|
+
window.addEventListener("message", onMessage);
|
|
2383
|
+
return () => window.removeEventListener("message", onMessage);
|
|
2384
|
+
}, [isEmbedded, handleSaveDraft, undo, redo, setViewport]);
|
|
2385
|
+
const studioContextValue = React__default.useMemo(() => ({
|
|
2386
|
+
config: config3,
|
|
2387
|
+
readOnly: false,
|
|
2388
|
+
apiClient
|
|
2389
|
+
}), [config3, apiClient]);
|
|
2390
|
+
if (loading) {
|
|
2391
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `tecof-editor-loading ${className || ""}`.trim(), style: {
|
|
2392
|
+
display: "flex",
|
|
2393
|
+
alignItems: "center",
|
|
2394
|
+
justifyContent: "center",
|
|
2395
|
+
height: "100vh",
|
|
2396
|
+
background: "#f4f4f5"
|
|
2397
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { textAlign: "center" }, children: [
|
|
2398
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-editor-spinner", style: {
|
|
2399
|
+
width: "40px",
|
|
2400
|
+
height: "40px",
|
|
2401
|
+
border: "3px solid #e4e4e7",
|
|
2402
|
+
borderTopColor: "#3b82f6",
|
|
2403
|
+
borderRadius: "50%",
|
|
2404
|
+
animation: "spin 1s linear infinite",
|
|
2405
|
+
margin: "0 auto 16px"
|
|
2406
|
+
} }),
|
|
2407
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#71717a", fontSize: "14px", margin: 0 }, children: "St\xFCdyo y\xFCkleniyor..." })
|
|
2408
|
+
] }) });
|
|
2409
|
+
}
|
|
2410
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StudioContext.Provider, { value: studioContextValue, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `tecof-studio-root ${className || ""}`.trim(), style: {
|
|
2411
|
+
display: "flex",
|
|
2412
|
+
flexDirection: "column",
|
|
2413
|
+
height: "100vh",
|
|
2414
|
+
width: "100vw",
|
|
2415
|
+
overflow: "hidden",
|
|
2416
|
+
position: "relative",
|
|
2417
|
+
background: "#f4f4f5"
|
|
2418
|
+
}, children: [
|
|
2419
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-workspace-container", style: {
|
|
2420
|
+
display: "flex",
|
|
2421
|
+
flex: 1,
|
|
2422
|
+
height: "100%",
|
|
2423
|
+
width: "100%",
|
|
2424
|
+
overflow: "hidden"
|
|
2425
|
+
}, children: [
|
|
2426
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-workspace", style: {
|
|
2427
|
+
display: "flex",
|
|
2428
|
+
flex: 1,
|
|
2429
|
+
height: "100%",
|
|
2430
|
+
position: "relative",
|
|
2431
|
+
overflow: "hidden"
|
|
2432
|
+
}, children: [
|
|
2433
|
+
/* @__PURE__ */ jsxRuntime.jsx(Canvas, {}),
|
|
2434
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectionOverlay, {})
|
|
2435
|
+
] }),
|
|
2436
|
+
/* @__PURE__ */ jsxRuntime.jsx(Inspector, {})
|
|
2437
|
+
] }),
|
|
2438
|
+
saving && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-editor-save-indicator", style: {
|
|
2439
|
+
position: "absolute",
|
|
2440
|
+
bottom: "24px",
|
|
2441
|
+
right: "24px",
|
|
2442
|
+
background: saveStatus === "error" ? "#ef4444" : "#18181b",
|
|
2443
|
+
color: "#ffffff",
|
|
2444
|
+
padding: "8px 16px",
|
|
2445
|
+
borderRadius: "24px",
|
|
2446
|
+
fontSize: "12px",
|
|
2447
|
+
fontWeight: 500,
|
|
2448
|
+
boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
|
|
2449
|
+
zIndex: 9999
|
|
2450
|
+
}, children: saveStatus === "error" ? "Kaydedilemedi" : "Kaydediliyor..." })
|
|
2451
|
+
] }) });
|
|
1019
2452
|
};
|
|
1020
2453
|
var TecofRender = ({ data: data3, config: config3, className, cmsData }) => {
|
|
1021
2454
|
if (!data3) return null;
|
|
@@ -1729,7 +3162,7 @@ var createLanguageField = (options = {}) => {
|
|
|
1729
3162
|
label,
|
|
1730
3163
|
labelIcon,
|
|
1731
3164
|
visible,
|
|
1732
|
-
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3165
|
+
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1733
3166
|
LanguageField,
|
|
1734
3167
|
{
|
|
1735
3168
|
field,
|
|
@@ -5659,7 +7092,7 @@ var createEditorField = (options = {}) => {
|
|
|
5659
7092
|
label,
|
|
5660
7093
|
labelIcon,
|
|
5661
7094
|
visible,
|
|
5662
|
-
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7095
|
+
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5663
7096
|
EditorField,
|
|
5664
7097
|
{
|
|
5665
7098
|
field,
|
|
@@ -6248,7 +7681,7 @@ var createView = (
|
|
|
6248
7681
|
},
|
|
6249
7682
|
write: write2 = () => {
|
|
6250
7683
|
},
|
|
6251
|
-
create:
|
|
7684
|
+
create: create5 = () => {
|
|
6252
7685
|
},
|
|
6253
7686
|
destroy: destroy3 = () => {
|
|
6254
7687
|
},
|
|
@@ -6452,7 +7885,7 @@ var createView = (
|
|
|
6452
7885
|
}
|
|
6453
7886
|
});
|
|
6454
7887
|
const internalAPI = createObject(internalAPIDefinition);
|
|
6455
|
-
|
|
7888
|
+
create5({
|
|
6456
7889
|
root: internalAPI,
|
|
6457
7890
|
props
|
|
6458
7891
|
});
|
|
@@ -9182,7 +10615,7 @@ var percentageArc = (x, y, radius, from, to) => {
|
|
|
9182
10615
|
arcSweep
|
|
9183
10616
|
);
|
|
9184
10617
|
};
|
|
9185
|
-
var
|
|
10618
|
+
var create2 = ({ root: root3, props }) => {
|
|
9186
10619
|
props.spin = false;
|
|
9187
10620
|
props.progress = 0;
|
|
9188
10621
|
props.opacity = 0;
|
|
@@ -9222,7 +10655,7 @@ var progressIndicator = createView({
|
|
|
9222
10655
|
name: "progress-indicator",
|
|
9223
10656
|
ignoreRectUpdate: true,
|
|
9224
10657
|
ignoreRect: true,
|
|
9225
|
-
create,
|
|
10658
|
+
create: create2,
|
|
9226
10659
|
write,
|
|
9227
10660
|
mixins: {
|
|
9228
10661
|
apis: ["progress", "spin", "align"],
|
|
@@ -14062,7 +15495,7 @@ var createImageWrapperView = (_2) => {
|
|
|
14062
15495
|
root3.ref.overlayShadow.opacity = 0.25;
|
|
14063
15496
|
root3.ref.overlaySuccess.opacity = 1;
|
|
14064
15497
|
};
|
|
14065
|
-
const
|
|
15498
|
+
const create5 = ({ root: root3 }) => {
|
|
14066
15499
|
root3.ref.images = [];
|
|
14067
15500
|
root3.ref.imageData = null;
|
|
14068
15501
|
root3.ref.imageViewBin = [];
|
|
@@ -14087,7 +15520,7 @@ var createImageWrapperView = (_2) => {
|
|
|
14087
15520
|
};
|
|
14088
15521
|
return _2.utils.createView({
|
|
14089
15522
|
name: "image-preview-wrapper",
|
|
14090
|
-
create:
|
|
15523
|
+
create: create5,
|
|
14091
15524
|
styles: ["height"],
|
|
14092
15525
|
apis: ["height"],
|
|
14093
15526
|
destroy: ({ root: root3 }) => {
|
|
@@ -15897,7 +17330,7 @@ var plugin7 = ({ addFilter: addFilter2, utils }) => {
|
|
|
15897
17330
|
}).catch(reject);
|
|
15898
17331
|
});
|
|
15899
17332
|
const variantPromises = variants.map(
|
|
15900
|
-
(
|
|
17333
|
+
(create5) => create5(transform, file2, item2.getMetadata())
|
|
15901
17334
|
);
|
|
15902
17335
|
Promise.all(variantPromises).then((files) => {
|
|
15903
17336
|
resolve(
|
|
@@ -19237,7 +20670,7 @@ var createTexture = function(e3, t2, r2, n, i2) {
|
|
|
19237
20670
|
}
|
|
19238
20671
|
return o2;
|
|
19239
20672
|
};
|
|
19240
|
-
var
|
|
20673
|
+
var create3 = function() {
|
|
19241
20674
|
var e3 = new Float32Array(16);
|
|
19242
20675
|
return e3[0] = 1, e3[5] = 1, e3[10] = 1, e3[15] = 1, e3;
|
|
19243
20676
|
};
|
|
@@ -19265,7 +20698,7 @@ var rotateZ = function(e3, t2) {
|
|
|
19265
20698
|
var r2 = Math.sin(t2), n = Math.cos(t2), i2 = e3[0], o2 = e3[1], a2 = e3[2], c2 = e3[3], l3 = e3[4], u = e3[5], s2 = e3[6], d = e3[7];
|
|
19266
20699
|
e3[0] = i2 * n + l3 * r2, e3[1] = o2 * n + u * r2, e3[2] = a2 * n + s2 * r2, e3[3] = c2 * n + d * r2, e3[4] = l3 * n - i2 * r2, e3[5] = u * n - o2 * r2, e3[6] = s2 * n - a2 * r2, e3[7] = d * n - c2 * r2;
|
|
19267
20700
|
};
|
|
19268
|
-
var mat4 = { create:
|
|
20701
|
+
var mat4 = { create: create3, perspective, translate, scale, rotateX, rotateY, rotateZ };
|
|
19269
20702
|
var degToRad = function(e3) {
|
|
19270
20703
|
return e3 * Math.PI / 180;
|
|
19271
20704
|
};
|
|
@@ -23622,7 +25055,7 @@ var createUploadField = (options = {}) => {
|
|
|
23622
25055
|
label,
|
|
23623
25056
|
labelIcon,
|
|
23624
25057
|
visible,
|
|
23625
|
-
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
25058
|
+
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
23626
25059
|
UploadField,
|
|
23627
25060
|
{
|
|
23628
25061
|
field,
|
|
@@ -23860,7 +25293,7 @@ var validators = {
|
|
|
23860
25293
|
handler: validateHandler,
|
|
23861
25294
|
initial: validateInitial
|
|
23862
25295
|
};
|
|
23863
|
-
function
|
|
25296
|
+
function create4(initial) {
|
|
23864
25297
|
var handler = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
23865
25298
|
validators.initial(initial);
|
|
23866
25299
|
validators.handler(handler);
|
|
@@ -23898,7 +25331,7 @@ function didStateUpdate(state3, handler, changes) {
|
|
|
23898
25331
|
return changes;
|
|
23899
25332
|
}
|
|
23900
25333
|
var index = {
|
|
23901
|
-
create:
|
|
25334
|
+
create: create4
|
|
23902
25335
|
};
|
|
23903
25336
|
var state_local_default = index;
|
|
23904
25337
|
|
|
@@ -24317,7 +25750,7 @@ var createCodeEditorField = (options = {}) => {
|
|
|
24317
25750
|
label,
|
|
24318
25751
|
labelIcon,
|
|
24319
25752
|
visible,
|
|
24320
|
-
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
25753
|
+
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
24321
25754
|
CodeEditorField,
|
|
24322
25755
|
{
|
|
24323
25756
|
field,
|
|
@@ -24564,7 +25997,7 @@ var createLinkField = (options = {}) => {
|
|
|
24564
25997
|
label,
|
|
24565
25998
|
labelIcon,
|
|
24566
25999
|
visible,
|
|
24567
|
-
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
26000
|
+
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
24568
26001
|
LinkField,
|
|
24569
26002
|
{
|
|
24570
26003
|
field,
|
|
@@ -24765,7 +26198,7 @@ var createColorField = (options = {}) => {
|
|
|
24765
26198
|
label,
|
|
24766
26199
|
labelIcon,
|
|
24767
26200
|
visible,
|
|
24768
|
-
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
26201
|
+
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
24769
26202
|
ColorField,
|
|
24770
26203
|
{
|
|
24771
26204
|
field,
|
|
@@ -25067,7 +26500,7 @@ var createRepeaterField = (options) => {
|
|
|
25067
26500
|
label,
|
|
25068
26501
|
labelIcon,
|
|
25069
26502
|
visible,
|
|
25070
|
-
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
26503
|
+
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
25071
26504
|
RepeaterField,
|
|
25072
26505
|
{
|
|
25073
26506
|
field,
|
|
@@ -25368,7 +26801,7 @@ var createCmsCollectionField = (options = {}) => {
|
|
|
25368
26801
|
label,
|
|
25369
26802
|
labelIcon,
|
|
25370
26803
|
visible,
|
|
25371
|
-
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
26804
|
+
render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
25372
26805
|
CmsCollectionField,
|
|
25373
26806
|
{
|
|
25374
26807
|
field,
|
|
@@ -25545,6 +26978,7 @@ lucide-react/dist/esm/icons/arrow-up.js:
|
|
|
25545
26978
|
lucide-react/dist/esm/icons/check.js:
|
|
25546
26979
|
lucide-react/dist/esm/icons/chevron-down.js:
|
|
25547
26980
|
lucide-react/dist/esm/icons/chevron-right.js:
|
|
26981
|
+
lucide-react/dist/esm/icons/chevron-up.js:
|
|
25548
26982
|
lucide-react/dist/esm/icons/code.js:
|
|
25549
26983
|
lucide-react/dist/esm/icons/copy.js:
|
|
25550
26984
|
lucide-react/dist/esm/icons/database.js:
|
|
@@ -25665,6 +27099,7 @@ exports.TecofEditor = TecofEditor;
|
|
|
25665
27099
|
exports.TecofPicture = TecofPicture;
|
|
25666
27100
|
exports.TecofProvider = TecofProvider;
|
|
25667
27101
|
exports.TecofRender = TecofRender;
|
|
27102
|
+
exports.TecofStudio = TecofStudio;
|
|
25668
27103
|
exports.UnderConstruction = UnderConstruction;
|
|
25669
27104
|
exports.UploadField = UploadField;
|
|
25670
27105
|
exports.createCmsCollectionField = createCmsCollectionField;
|