@tecof/theme-editor 0.0.39 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -25
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1035 -1267
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1035 -1267
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1711 -394
- package/package.json +31 -9
package/dist/index.js
CHANGED
|
@@ -337,17 +337,48 @@ function useTecof() {
|
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
// src/engine/document.ts
|
|
340
|
-
var
|
|
340
|
+
var createEmptyDocument = () => ({
|
|
341
341
|
root: { props: {} },
|
|
342
342
|
content: [],
|
|
343
343
|
zones: {}
|
|
344
|
+
});
|
|
345
|
+
var cloneValue = (value) => {
|
|
346
|
+
if (Array.isArray(value)) {
|
|
347
|
+
return value.map((item2) => cloneValue(item2));
|
|
348
|
+
}
|
|
349
|
+
if (value && typeof value === "object") {
|
|
350
|
+
return Object.fromEntries(
|
|
351
|
+
Object.entries(value).map(([key, child]) => [key, cloneValue(child)])
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
return value;
|
|
344
355
|
};
|
|
356
|
+
var cloneDocument = (doc) => ({
|
|
357
|
+
root: {
|
|
358
|
+
props: cloneValue(doc.root?.props || {})
|
|
359
|
+
},
|
|
360
|
+
content: (doc.content || []).map((node) => ({
|
|
361
|
+
type: node.type,
|
|
362
|
+
props: cloneValue(node.props || {})
|
|
363
|
+
})),
|
|
364
|
+
zones: Object.fromEntries(
|
|
365
|
+
Object.entries(doc.zones || {}).map(([zoneKey, nodes]) => [
|
|
366
|
+
zoneKey,
|
|
367
|
+
nodes.map((node) => ({
|
|
368
|
+
type: node.type,
|
|
369
|
+
props: cloneValue(node.props || {})
|
|
370
|
+
}))
|
|
371
|
+
])
|
|
372
|
+
)
|
|
373
|
+
});
|
|
345
374
|
var parseDocument = (rawData) => {
|
|
346
|
-
if (!rawData) return
|
|
375
|
+
if (!rawData) return createEmptyDocument();
|
|
347
376
|
return {
|
|
348
377
|
root: rawData.root || { props: {} },
|
|
349
|
-
content: rawData.content || [],
|
|
350
|
-
zones:
|
|
378
|
+
content: [...rawData.content || []],
|
|
379
|
+
zones: Object.fromEntries(
|
|
380
|
+
Object.entries(rawData.zones || {}).map(([zoneKey, nodes]) => [zoneKey, [...nodes]])
|
|
381
|
+
)
|
|
351
382
|
};
|
|
352
383
|
};
|
|
353
384
|
var serializeDocument = (doc) => {
|
|
@@ -473,6 +504,13 @@ var moveNode = (draft, id, targetZoneKey, targetIndex) => {
|
|
|
473
504
|
const { node, path: sourcePath } = result;
|
|
474
505
|
const sourceList = sourcePath.zoneKey ? draft.zones[sourcePath.zoneKey] : draft.content;
|
|
475
506
|
let targetList = targetZoneKey ? draft.zones[targetZoneKey] : draft.content;
|
|
507
|
+
if (targetZoneKey) {
|
|
508
|
+
const targetParentId = parseZoneKey(targetZoneKey).parentId;
|
|
509
|
+
const descendantZoneKeys = getDescendantZoneKeys(draft.zones, id);
|
|
510
|
+
if (targetParentId === id || descendantZoneKeys.includes(targetZoneKey)) {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
476
514
|
if (!targetList && targetZoneKey) {
|
|
477
515
|
targetList = [];
|
|
478
516
|
draft.zones[targetZoneKey] = targetList;
|
|
@@ -506,14 +544,27 @@ var setRootProps = (draft, patch) => {
|
|
|
506
544
|
};
|
|
507
545
|
|
|
508
546
|
// src/engine/store.ts
|
|
547
|
+
var HISTORY_LIMIT = 50;
|
|
548
|
+
var COALESCE_MS = 500;
|
|
509
549
|
var pushToHistory = (state3) => {
|
|
510
|
-
state3.history.past.push(state3.document);
|
|
550
|
+
state3.history.past.push(cloneDocument(state3.document));
|
|
551
|
+
if (state3.history.past.length > HISTORY_LIMIT) {
|
|
552
|
+
state3.history.past.shift();
|
|
553
|
+
}
|
|
511
554
|
state3.history.future = [];
|
|
555
|
+
state3._lastCommit = null;
|
|
556
|
+
};
|
|
557
|
+
var validateSelection = (state3) => {
|
|
558
|
+
const id = state3.selection.selectedId;
|
|
559
|
+
if (id && !findNodeById(state3.document, id)) {
|
|
560
|
+
state3.selection.selectedId = null;
|
|
561
|
+
}
|
|
562
|
+
state3.selection.hoveredId = null;
|
|
512
563
|
};
|
|
513
564
|
var useEditorStore = zustand.create()(
|
|
514
565
|
immer.immer((set2) => ({
|
|
515
566
|
// Initial State
|
|
516
|
-
document:
|
|
567
|
+
document: createEmptyDocument(),
|
|
517
568
|
history: {
|
|
518
569
|
past: [],
|
|
519
570
|
future: []
|
|
@@ -523,11 +574,14 @@ var useEditorStore = zustand.create()(
|
|
|
523
574
|
hoveredId: null
|
|
524
575
|
},
|
|
525
576
|
viewport: "desktop",
|
|
577
|
+
drag: null,
|
|
578
|
+
_lastCommit: null,
|
|
526
579
|
// Actions
|
|
527
580
|
setDocument: (doc) => set2((state3) => {
|
|
528
|
-
state3.document = doc;
|
|
581
|
+
state3.document = cloneDocument(parseDocument(doc));
|
|
529
582
|
state3.history = { past: [], future: [] };
|
|
530
583
|
state3.selection = { selectedId: null, hoveredId: null };
|
|
584
|
+
state3._lastCommit = null;
|
|
531
585
|
}),
|
|
532
586
|
selectNode: (id) => set2((state3) => {
|
|
533
587
|
state3.selection.selectedId = id;
|
|
@@ -538,6 +592,12 @@ var useEditorStore = zustand.create()(
|
|
|
538
592
|
setViewport: (viewport) => set2((state3) => {
|
|
539
593
|
state3.viewport = viewport;
|
|
540
594
|
}),
|
|
595
|
+
beginDrag: (payload) => set2((state3) => {
|
|
596
|
+
state3.drag = payload;
|
|
597
|
+
}),
|
|
598
|
+
endDrag: () => set2((state3) => {
|
|
599
|
+
state3.drag = null;
|
|
600
|
+
}),
|
|
541
601
|
insertNode: (node, targetZoneKey, index2) => set2((state3) => {
|
|
542
602
|
pushToHistory(state3);
|
|
543
603
|
insertNode(state3.document, node, targetZoneKey, index2);
|
|
@@ -558,24 +618,48 @@ var useEditorStore = zustand.create()(
|
|
|
558
618
|
duplicateNode(state3.document, id);
|
|
559
619
|
}),
|
|
560
620
|
updateProps: (id, patch) => set2((state3) => {
|
|
561
|
-
|
|
621
|
+
const now2 = Date.now();
|
|
622
|
+
const last = state3._lastCommit;
|
|
623
|
+
const isContinuation = last && last.id === id && now2 - last.time < COALESCE_MS;
|
|
624
|
+
if (!isContinuation) {
|
|
625
|
+
state3.history.past.push(cloneDocument(state3.document));
|
|
626
|
+
if (state3.history.past.length > HISTORY_LIMIT) {
|
|
627
|
+
state3.history.past.shift();
|
|
628
|
+
}
|
|
629
|
+
state3.history.future = [];
|
|
630
|
+
}
|
|
562
631
|
updateProps(state3.document, id, patch);
|
|
632
|
+
state3._lastCommit = { id, time: now2 };
|
|
563
633
|
}),
|
|
564
634
|
setRootProps: (patch) => set2((state3) => {
|
|
565
|
-
|
|
635
|
+
const now2 = Date.now();
|
|
636
|
+
const last = state3._lastCommit;
|
|
637
|
+
const isContinuation = last && last.id === "__root__" && now2 - last.time < COALESCE_MS;
|
|
638
|
+
if (!isContinuation) {
|
|
639
|
+
state3.history.past.push(cloneDocument(state3.document));
|
|
640
|
+
if (state3.history.past.length > HISTORY_LIMIT) {
|
|
641
|
+
state3.history.past.shift();
|
|
642
|
+
}
|
|
643
|
+
state3.history.future = [];
|
|
644
|
+
}
|
|
566
645
|
setRootProps(state3.document, patch);
|
|
646
|
+
state3._lastCommit = { id: "__root__", time: now2 };
|
|
567
647
|
}),
|
|
568
648
|
undo: () => set2((state3) => {
|
|
569
649
|
if (state3.history.past.length === 0) return;
|
|
570
650
|
const previous = state3.history.past.pop();
|
|
571
|
-
state3.history.future.push(state3.document);
|
|
651
|
+
state3.history.future.push(cloneDocument(state3.document));
|
|
572
652
|
state3.document = previous;
|
|
653
|
+
state3._lastCommit = null;
|
|
654
|
+
validateSelection(state3);
|
|
573
655
|
}),
|
|
574
656
|
redo: () => set2((state3) => {
|
|
575
657
|
if (state3.history.future.length === 0) return;
|
|
576
658
|
const next = state3.history.future.pop();
|
|
577
|
-
state3.history.past.push(state3.document);
|
|
659
|
+
state3.history.past.push(cloneDocument(state3.document));
|
|
578
660
|
state3.document = next;
|
|
661
|
+
state3._lastCommit = null;
|
|
662
|
+
validateSelection(state3);
|
|
579
663
|
})
|
|
580
664
|
}))
|
|
581
665
|
);
|
|
@@ -587,30 +671,298 @@ var useStudio = () => {
|
|
|
587
671
|
}
|
|
588
672
|
return ctx;
|
|
589
673
|
};
|
|
674
|
+
var Frame = ({
|
|
675
|
+
children,
|
|
676
|
+
title = "Canvas Frame",
|
|
677
|
+
className,
|
|
678
|
+
style: _style,
|
|
679
|
+
...props
|
|
680
|
+
}) => {
|
|
681
|
+
const [contentRef, setContentRef] = React__default.useState(null);
|
|
682
|
+
const mountNode = contentRef?.contentWindow?.document?.body;
|
|
683
|
+
React__default.useEffect(() => {
|
|
684
|
+
if (!contentRef) return;
|
|
685
|
+
const doc = contentRef.contentDocument;
|
|
686
|
+
if (!doc) return;
|
|
687
|
+
const copyStyles = () => {
|
|
688
|
+
doc.head.innerHTML = "";
|
|
689
|
+
Array.from(document.styleSheets).forEach((styleSheet) => {
|
|
690
|
+
try {
|
|
691
|
+
if (styleSheet.href) {
|
|
692
|
+
const link = doc.createElement("link");
|
|
693
|
+
link.rel = "stylesheet";
|
|
694
|
+
link.href = styleSheet.href;
|
|
695
|
+
doc.head.appendChild(link);
|
|
696
|
+
} else {
|
|
697
|
+
const cssRules = Array.from(styleSheet.cssRules).map((rule) => rule.cssText).join("\n");
|
|
698
|
+
const style2 = doc.createElement("style");
|
|
699
|
+
style2.textContent = cssRules;
|
|
700
|
+
doc.head.appendChild(style2);
|
|
701
|
+
}
|
|
702
|
+
} catch (e3) {
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
const style = doc.createElement("style");
|
|
706
|
+
style.textContent = `
|
|
707
|
+
html, body {
|
|
708
|
+
margin: 0;
|
|
709
|
+
padding: 0;
|
|
710
|
+
background-color: transparent;
|
|
711
|
+
min-height: 100vh;
|
|
712
|
+
}
|
|
713
|
+
body {
|
|
714
|
+
padding: 32px 16px;
|
|
715
|
+
box-sizing: border-box;
|
|
716
|
+
}
|
|
717
|
+
.tecof-node-wrapper {
|
|
718
|
+
position: relative;
|
|
719
|
+
transition: outline 0.15s ease-in-out;
|
|
720
|
+
}
|
|
721
|
+
/* Custom scrollbars for iframe */
|
|
722
|
+
::-webkit-scrollbar {
|
|
723
|
+
width: 8px;
|
|
724
|
+
height: 8px;
|
|
725
|
+
}
|
|
726
|
+
::-webkit-scrollbar-track {
|
|
727
|
+
background: transparent;
|
|
728
|
+
}
|
|
729
|
+
::-webkit-scrollbar-thumb {
|
|
730
|
+
background: var(--tecof-scrollbar-thumb);
|
|
731
|
+
border-radius: var(--tecof-radius-xs);
|
|
732
|
+
}
|
|
733
|
+
::-webkit-scrollbar-thumb:hover {
|
|
734
|
+
background: var(--tecof-scrollbar-thumb-hover);
|
|
735
|
+
}
|
|
736
|
+
`;
|
|
737
|
+
doc.head.appendChild(style);
|
|
738
|
+
};
|
|
739
|
+
copyStyles();
|
|
740
|
+
const observer = new MutationObserver(() => {
|
|
741
|
+
copyStyles();
|
|
742
|
+
});
|
|
743
|
+
observer.observe(document.head, { childList: true, subtree: true });
|
|
744
|
+
if (doc.body) {
|
|
745
|
+
doc.body.className = "tecof-canvas-body";
|
|
746
|
+
const handleBodyClick = (e3) => {
|
|
747
|
+
const target = e3.target;
|
|
748
|
+
if (!target.closest(".tecof-node-wrapper")) {
|
|
749
|
+
useEditorStore.getState().selectNode(null);
|
|
750
|
+
const isEmbedded = typeof window !== "undefined" && window.parent !== window;
|
|
751
|
+
if (isEmbedded) {
|
|
752
|
+
window.parent.postMessage({ type: "puck:itemDeselected" }, "*");
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
const handleIframeKeyDown = (e3) => {
|
|
757
|
+
const event = new KeyboardEvent("keydown", {
|
|
758
|
+
key: e3.key,
|
|
759
|
+
code: e3.code,
|
|
760
|
+
ctrlKey: e3.ctrlKey,
|
|
761
|
+
metaKey: e3.metaKey,
|
|
762
|
+
shiftKey: e3.shiftKey,
|
|
763
|
+
altKey: e3.altKey,
|
|
764
|
+
bubbles: true
|
|
765
|
+
});
|
|
766
|
+
window.dispatchEvent(event);
|
|
767
|
+
};
|
|
768
|
+
doc.body.addEventListener("click", handleBodyClick);
|
|
769
|
+
doc.addEventListener("keydown", handleIframeKeyDown);
|
|
770
|
+
return () => {
|
|
771
|
+
observer.disconnect();
|
|
772
|
+
doc.body.removeEventListener("click", handleBodyClick);
|
|
773
|
+
doc.removeEventListener("keydown", handleIframeKeyDown);
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
}, [contentRef]);
|
|
777
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
778
|
+
"iframe",
|
|
779
|
+
{
|
|
780
|
+
title,
|
|
781
|
+
ref: setContentRef,
|
|
782
|
+
className: ["tecof-canvas-frame", className].filter(Boolean).join(" "),
|
|
783
|
+
...props,
|
|
784
|
+
children: mountNode && ReactDOM.createPortal(children, mountNode)
|
|
785
|
+
}
|
|
786
|
+
);
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
// src/studio/canvas/dndUtils.ts
|
|
790
|
+
var TECOF_NODE_ID = "application/tecof-node-id";
|
|
791
|
+
var TECOF_BLOCK_TYPE = "application/tecof-block-type";
|
|
792
|
+
function createNode(config3, type) {
|
|
793
|
+
const compConfig = config3?.components?.[type] || {};
|
|
794
|
+
const defaultProps = compConfig.defaultProps || {};
|
|
795
|
+
return {
|
|
796
|
+
type,
|
|
797
|
+
props: {
|
|
798
|
+
id: generateId(),
|
|
799
|
+
...JSON.parse(JSON.stringify(defaultProps))
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
function readDragData(e3) {
|
|
804
|
+
return {
|
|
805
|
+
nodeId: e3.dataTransfer.getData(TECOF_NODE_ID),
|
|
806
|
+
type: e3.dataTransfer.getData(TECOF_BLOCK_TYPE)
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
function writeDragData(e3, payload) {
|
|
810
|
+
if (payload.nodeId) {
|
|
811
|
+
e3.dataTransfer.setData(TECOF_NODE_ID, payload.nodeId);
|
|
812
|
+
}
|
|
813
|
+
if (payload.type) {
|
|
814
|
+
e3.dataTransfer.setData(TECOF_BLOCK_TYPE, payload.type);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
function getDragScrollContainer(e3) {
|
|
818
|
+
const ownerDoc = e3.currentTarget.ownerDocument;
|
|
819
|
+
return ownerDoc.scrollingElement || ownerDoc.documentElement || ownerDoc.body;
|
|
820
|
+
}
|
|
821
|
+
var EDGE = 64;
|
|
822
|
+
var MAX_SPEED = 18;
|
|
823
|
+
function createAutoScroller(getContainer) {
|
|
824
|
+
let raf = 0;
|
|
825
|
+
let velocity = 0;
|
|
826
|
+
const getEdgeBounds = (el) => {
|
|
827
|
+
const doc = el.ownerDocument;
|
|
828
|
+
const win = doc.defaultView;
|
|
829
|
+
const isDocumentScroller = el === doc.documentElement || el === doc.body || el === doc.scrollingElement;
|
|
830
|
+
if (isDocumentScroller && win) {
|
|
831
|
+
return { top: 0, bottom: win.innerHeight };
|
|
832
|
+
}
|
|
833
|
+
return el.getBoundingClientRect();
|
|
834
|
+
};
|
|
835
|
+
const loop = () => {
|
|
836
|
+
const el = getContainer();
|
|
837
|
+
if (el && velocity !== 0) {
|
|
838
|
+
el.scrollTop += velocity;
|
|
839
|
+
}
|
|
840
|
+
raf = requestAnimationFrame(loop);
|
|
841
|
+
};
|
|
842
|
+
const update = (clientY) => {
|
|
843
|
+
const el = getContainer();
|
|
844
|
+
if (!el) return;
|
|
845
|
+
const rect = getEdgeBounds(el);
|
|
846
|
+
if (clientY < rect.top + EDGE) {
|
|
847
|
+
const ratio = (rect.top + EDGE - clientY) / EDGE;
|
|
848
|
+
velocity = -Math.ceil(Math.min(1, ratio) * MAX_SPEED);
|
|
849
|
+
} else if (clientY > rect.bottom - EDGE) {
|
|
850
|
+
const ratio = (clientY - (rect.bottom - EDGE)) / EDGE;
|
|
851
|
+
velocity = Math.ceil(Math.min(1, ratio) * MAX_SPEED);
|
|
852
|
+
} else {
|
|
853
|
+
velocity = 0;
|
|
854
|
+
}
|
|
855
|
+
if (!raf) loop();
|
|
856
|
+
};
|
|
857
|
+
const stop = () => {
|
|
858
|
+
velocity = 0;
|
|
859
|
+
if (raf) {
|
|
860
|
+
cancelAnimationFrame(raf);
|
|
861
|
+
raf = 0;
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
return { update, stop };
|
|
865
|
+
}
|
|
866
|
+
function createEventAutoScroller() {
|
|
867
|
+
let container = null;
|
|
868
|
+
const scroller = createAutoScroller(() => container);
|
|
869
|
+
return {
|
|
870
|
+
update(e3) {
|
|
871
|
+
container = getDragScrollContainer(e3);
|
|
872
|
+
scroller.update(e3.clientY);
|
|
873
|
+
},
|
|
874
|
+
stop() {
|
|
875
|
+
scroller.stop();
|
|
876
|
+
container = null;
|
|
877
|
+
}
|
|
878
|
+
};
|
|
879
|
+
}
|
|
590
880
|
var ParentNodeContext = React__default.createContext(null);
|
|
591
881
|
var DropZone = ({ zone, className, style }) => {
|
|
592
882
|
const parentId = React__default.useContext(ParentNodeContext);
|
|
593
883
|
const zoneKey = parentId ? `${parentId}:${zone}` : zone;
|
|
884
|
+
const { config: config3 } = useStudio();
|
|
885
|
+
const insertNode2 = useEditorStore((state3) => state3.insertNode);
|
|
886
|
+
const endDrag = useEditorStore((state3) => state3.endDrag);
|
|
887
|
+
const drag = useEditorStore((state3) => state3.drag);
|
|
888
|
+
const autoScrollerRef = React__default.useRef(createEventAutoScroller());
|
|
889
|
+
const [isDragOver, setIsDragOver] = React__default.useState(false);
|
|
594
890
|
const items = useEditorStore((state3) => state3.document.zones[zoneKey] || []);
|
|
891
|
+
const handleDragOver = (e3) => {
|
|
892
|
+
e3.preventDefault();
|
|
893
|
+
e3.stopPropagation();
|
|
894
|
+
autoScrollerRef.current.update(e3);
|
|
895
|
+
setIsDragOver(true);
|
|
896
|
+
};
|
|
897
|
+
const handleDragLeave = (e3) => {
|
|
898
|
+
if (e3.currentTarget.contains(e3.relatedTarget)) return;
|
|
899
|
+
autoScrollerRef.current.stop();
|
|
900
|
+
setIsDragOver(false);
|
|
901
|
+
};
|
|
902
|
+
const handleDrop = (e3) => {
|
|
903
|
+
e3.preventDefault();
|
|
904
|
+
e3.stopPropagation();
|
|
905
|
+
autoScrollerRef.current.stop();
|
|
906
|
+
setIsDragOver(false);
|
|
907
|
+
const { nodeId, type } = readDragData(e3);
|
|
908
|
+
if (nodeId) {
|
|
909
|
+
useEditorStore.getState().moveNode(nodeId, zoneKey, items.length);
|
|
910
|
+
} else if (type) {
|
|
911
|
+
insertNode2(createNode(config3, type), zoneKey, items.length);
|
|
912
|
+
}
|
|
913
|
+
endDrag();
|
|
914
|
+
};
|
|
915
|
+
const dropzoneClassName = [
|
|
916
|
+
"tecof-dropzone",
|
|
917
|
+
items.length === 0 ? "is-empty" : "",
|
|
918
|
+
isDragOver ? "is-dragover" : "",
|
|
919
|
+
drag ? "is-drag-active" : "",
|
|
920
|
+
className
|
|
921
|
+
].filter(Boolean).join(" ");
|
|
595
922
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
596
923
|
"div",
|
|
597
924
|
{
|
|
598
|
-
className:
|
|
599
|
-
|
|
925
|
+
className: dropzoneClassName,
|
|
926
|
+
onDragOver: handleDragOver,
|
|
927
|
+
onDragLeave: handleDragLeave,
|
|
928
|
+
onDrop: handleDrop,
|
|
929
|
+
style,
|
|
600
930
|
"data-tecof-zone": zoneKey,
|
|
601
|
-
children: items.map((item2, index2) => /* @__PURE__ */ jsxRuntime.jsx(NodeRenderer, { node: item2, index: index2, zoneKey }, item2.props.id))
|
|
931
|
+
children: items.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-dropzone-hint", children: isDragOver ? "Buraya B\u0131rak\u0131n" : "Bile\u015Fen S\xFCr\xFCkleyin veya T\u0131klay\u0131n" }) : items.map((item2, index2) => /* @__PURE__ */ jsxRuntime.jsx(NodeRenderer, { node: item2, index: index2, zoneKey }, item2.props.id))
|
|
602
932
|
}
|
|
603
933
|
);
|
|
604
934
|
};
|
|
605
935
|
var renderDropZone = ({ zone, className, style }) => {
|
|
606
936
|
return /* @__PURE__ */ jsxRuntime.jsx(DropZone, { zone, className, style });
|
|
607
937
|
};
|
|
938
|
+
|
|
939
|
+
// src/studio/canvas/dragGhost.ts
|
|
940
|
+
function setDragGhost(e3, label) {
|
|
941
|
+
const ownerDoc = e3.currentTarget?.ownerDocument || (typeof document !== "undefined" ? document : null);
|
|
942
|
+
if (!ownerDoc) return;
|
|
943
|
+
const ghost = ownerDoc.createElement("div");
|
|
944
|
+
ghost.className = "tecof-drag-ghost";
|
|
945
|
+
ghost.textContent = label;
|
|
946
|
+
ownerDoc.body.appendChild(ghost);
|
|
947
|
+
try {
|
|
948
|
+
e3.dataTransfer.setDragImage(ghost, 14, 14);
|
|
949
|
+
} catch {
|
|
950
|
+
}
|
|
951
|
+
const win = ownerDoc.defaultView || window;
|
|
952
|
+
win.requestAnimationFrame(() => {
|
|
953
|
+
win.requestAnimationFrame(() => ghost.remove());
|
|
954
|
+
});
|
|
955
|
+
}
|
|
608
956
|
var NodeRenderer = ({ node, index: index2, zoneKey }) => {
|
|
609
957
|
const { config: config3, metadata, readOnly } = useStudio();
|
|
610
958
|
const componentConfig = config3.components[node.type];
|
|
611
959
|
const selectNode = useEditorStore((state3) => state3.selectNode);
|
|
612
960
|
const hoverNode = useEditorStore((state3) => state3.hoverNode);
|
|
613
961
|
const hoveredId = useEditorStore((state3) => state3.selection.hoveredId);
|
|
962
|
+
const beginDrag = useEditorStore((state3) => state3.beginDrag);
|
|
963
|
+
const endDrag = useEditorStore((state3) => state3.endDrag);
|
|
964
|
+
const drag = useEditorStore((state3) => state3.drag);
|
|
965
|
+
const autoScrollerRef = React__default.useRef(createEventAutoScroller());
|
|
614
966
|
const handleMouseEnter = React__default.useCallback(
|
|
615
967
|
(e3) => {
|
|
616
968
|
if (readOnly) return;
|
|
@@ -660,40 +1012,139 @@ var NodeRenderer = ({ node, index: index2, zoneKey }) => {
|
|
|
660
1012
|
const text2 = target.textContent?.trim() || "";
|
|
661
1013
|
if (!text2) return;
|
|
662
1014
|
let matchingPropName = null;
|
|
1015
|
+
let isMultilingual = false;
|
|
1016
|
+
const ownerDoc = target.ownerDocument;
|
|
1017
|
+
const ownerWin = ownerDoc.defaultView;
|
|
1018
|
+
let matchedLangCode = ownerDoc.documentElement.lang || "tr";
|
|
663
1019
|
for (const [key, value] of Object.entries(node.props)) {
|
|
664
1020
|
if (typeof value === "string" && value.trim() === text2) {
|
|
665
1021
|
matchingPropName = key;
|
|
666
1022
|
break;
|
|
667
1023
|
}
|
|
1024
|
+
if (Array.isArray(value)) {
|
|
1025
|
+
const matchedItem = value.find(
|
|
1026
|
+
(item2) => item2 && typeof item2 === "object" && typeof item2.value === "string" && item2.value.trim() === text2
|
|
1027
|
+
);
|
|
1028
|
+
if (matchedItem) {
|
|
1029
|
+
matchingPropName = key;
|
|
1030
|
+
isMultilingual = true;
|
|
1031
|
+
matchedLangCode = matchedItem.code;
|
|
1032
|
+
break;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
668
1035
|
}
|
|
669
1036
|
if (!matchingPropName) return;
|
|
670
1037
|
e3.stopPropagation();
|
|
1038
|
+
const originalText = target.textContent || "";
|
|
671
1039
|
target.contentEditable = "true";
|
|
1040
|
+
target.setAttribute("data-tecof-inline-editing", "true");
|
|
672
1041
|
target.focus();
|
|
673
|
-
const range =
|
|
1042
|
+
const range = ownerDoc.createRange();
|
|
674
1043
|
range.selectNodeContents(target);
|
|
675
|
-
const sel =
|
|
1044
|
+
const sel = ownerWin?.getSelection();
|
|
676
1045
|
sel?.removeAllRanges();
|
|
677
1046
|
sel?.addRange(range);
|
|
678
1047
|
const propName = matchingPropName;
|
|
679
|
-
const
|
|
1048
|
+
const finalIsMultilingual = isMultilingual;
|
|
1049
|
+
const finalLangCode = matchedLangCode;
|
|
1050
|
+
const commitInlineEdit = () => {
|
|
680
1051
|
target.contentEditable = "false";
|
|
1052
|
+
target.removeAttribute("data-tecof-inline-editing");
|
|
681
1053
|
target.removeEventListener("blur", handleBlur);
|
|
1054
|
+
target.removeEventListener("keydown", handleKeyDown);
|
|
682
1055
|
const newText = target.textContent?.trim() || "";
|
|
683
|
-
|
|
684
|
-
[propName]:
|
|
685
|
-
|
|
1056
|
+
if (finalIsMultilingual) {
|
|
1057
|
+
const currentArray = Array.isArray(node.props[propName]) ? node.props[propName] : [];
|
|
1058
|
+
const updatedArray = currentArray.map((item2) => {
|
|
1059
|
+
if (item2 && item2.code === finalLangCode) {
|
|
1060
|
+
return { ...item2, value: newText };
|
|
1061
|
+
}
|
|
1062
|
+
return item2;
|
|
1063
|
+
});
|
|
1064
|
+
if (!updatedArray.some((item2) => item2 && item2.code === finalLangCode)) {
|
|
1065
|
+
updatedArray.push({ code: finalLangCode, value: newText });
|
|
1066
|
+
}
|
|
1067
|
+
useEditorStore.getState().updateProps(node.props.id, {
|
|
1068
|
+
[propName]: updatedArray
|
|
1069
|
+
});
|
|
1070
|
+
} else {
|
|
1071
|
+
useEditorStore.getState().updateProps(node.props.id, {
|
|
1072
|
+
[propName]: newText
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
};
|
|
1076
|
+
const cancelInlineEdit = () => {
|
|
1077
|
+
target.textContent = originalText;
|
|
1078
|
+
target.contentEditable = "false";
|
|
1079
|
+
target.removeAttribute("data-tecof-inline-editing");
|
|
1080
|
+
target.removeEventListener("blur", handleBlur);
|
|
1081
|
+
target.removeEventListener("keydown", handleKeyDown);
|
|
1082
|
+
};
|
|
1083
|
+
const handleBlur = () => {
|
|
1084
|
+
commitInlineEdit();
|
|
1085
|
+
};
|
|
1086
|
+
const handleKeyDown = (event) => {
|
|
1087
|
+
if (event.key === "Escape") {
|
|
1088
|
+
event.preventDefault();
|
|
1089
|
+
cancelInlineEdit();
|
|
1090
|
+
return;
|
|
1091
|
+
}
|
|
1092
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
1093
|
+
event.preventDefault();
|
|
1094
|
+
target.blur();
|
|
1095
|
+
}
|
|
686
1096
|
};
|
|
687
1097
|
target.addEventListener("blur", handleBlur);
|
|
1098
|
+
target.addEventListener("keydown", handleKeyDown);
|
|
688
1099
|
},
|
|
689
1100
|
[node.props, node.props.id, readOnly]
|
|
690
1101
|
);
|
|
1102
|
+
const [dragOverPosition, setDragOverPosition] = React__default.useState(null);
|
|
1103
|
+
const handleDragOver = React__default.useCallback((e3) => {
|
|
1104
|
+
if (readOnly) return;
|
|
1105
|
+
e3.preventDefault();
|
|
1106
|
+
e3.stopPropagation();
|
|
1107
|
+
autoScrollerRef.current.update(e3);
|
|
1108
|
+
const rect = e3.currentTarget.getBoundingClientRect();
|
|
1109
|
+
const relativeY = e3.clientY - rect.top;
|
|
1110
|
+
if (relativeY < rect.height / 2) {
|
|
1111
|
+
setDragOverPosition("top");
|
|
1112
|
+
} else {
|
|
1113
|
+
setDragOverPosition("bottom");
|
|
1114
|
+
}
|
|
1115
|
+
}, [readOnly]);
|
|
1116
|
+
const handleDragLeave = React__default.useCallback((e3) => {
|
|
1117
|
+
if (e3.currentTarget.contains(e3.relatedTarget)) return;
|
|
1118
|
+
autoScrollerRef.current.stop();
|
|
1119
|
+
setDragOverPosition(null);
|
|
1120
|
+
}, []);
|
|
1121
|
+
const handleDrop = React__default.useCallback((e3) => {
|
|
1122
|
+
if (readOnly) return;
|
|
1123
|
+
e3.preventDefault();
|
|
1124
|
+
e3.stopPropagation();
|
|
1125
|
+
autoScrollerRef.current.stop();
|
|
1126
|
+
setDragOverPosition(null);
|
|
1127
|
+
const { nodeId, type } = readDragData(e3);
|
|
1128
|
+
const targetIndex = dragOverPosition === "top" ? index2 : index2 + 1;
|
|
1129
|
+
if (nodeId && nodeId !== node.props.id) {
|
|
1130
|
+
useEditorStore.getState().moveNode(nodeId, zoneKey || void 0, targetIndex);
|
|
1131
|
+
} else if (type) {
|
|
1132
|
+
useEditorStore.getState().insertNode(createNode(config3, type), zoneKey || void 0, targetIndex);
|
|
1133
|
+
}
|
|
1134
|
+
endDrag();
|
|
1135
|
+
}, [dragOverPosition, index2, node.props.id, zoneKey, config3, readOnly, endDrag]);
|
|
691
1136
|
if (!componentConfig) {
|
|
692
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
1137
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-node-missing", children: [
|
|
693
1138
|
"Bile\u015Fen bulunamad\u0131: ",
|
|
694
1139
|
node.type
|
|
695
1140
|
] });
|
|
696
1141
|
}
|
|
1142
|
+
const label = componentConfig.label || node.type;
|
|
1143
|
+
const wrapperClassName = [
|
|
1144
|
+
"tecof-node-wrapper",
|
|
1145
|
+
readOnly ? "is-readonly" : "",
|
|
1146
|
+
drag?.id === node.props.id ? "is-dragging" : ""
|
|
1147
|
+
].filter(Boolean).join(" ");
|
|
697
1148
|
const componentProps = {
|
|
698
1149
|
...node.props,
|
|
699
1150
|
puck: {
|
|
@@ -706,180 +1157,118 @@ var NodeRenderer = ({ node, index: index2, zoneKey }) => {
|
|
|
706
1157
|
},
|
|
707
1158
|
editMode: !readOnly
|
|
708
1159
|
};
|
|
709
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ParentNodeContext.Provider, { value: node.props.id, children: /* @__PURE__ */ jsxRuntime.
|
|
710
|
-
"div",
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
link.href = styleSheet.href;
|
|
743
|
-
doc.head.appendChild(link);
|
|
744
|
-
} else {
|
|
745
|
-
const cssRules = Array.from(styleSheet.cssRules).map((rule) => rule.cssText).join("\n");
|
|
746
|
-
const style2 = doc.createElement("style");
|
|
747
|
-
style2.textContent = cssRules;
|
|
748
|
-
doc.head.appendChild(style2);
|
|
749
|
-
}
|
|
750
|
-
} catch (e3) {
|
|
751
|
-
}
|
|
752
|
-
});
|
|
753
|
-
const style = doc.createElement("style");
|
|
754
|
-
style.textContent = `
|
|
755
|
-
html, body {
|
|
756
|
-
margin: 0;
|
|
757
|
-
padding: 0;
|
|
758
|
-
background-color: transparent;
|
|
759
|
-
min-height: 100vh;
|
|
760
|
-
}
|
|
761
|
-
body {
|
|
762
|
-
padding: 32px 16px;
|
|
763
|
-
box-sizing: border-box;
|
|
764
|
-
}
|
|
765
|
-
.tecof-node-wrapper {
|
|
766
|
-
position: relative;
|
|
767
|
-
transition: outline 0.15s ease-in-out;
|
|
768
|
-
}
|
|
769
|
-
/* Custom scrollbars for iframe */
|
|
770
|
-
::-webkit-scrollbar {
|
|
771
|
-
width: 8px;
|
|
772
|
-
height: 8px;
|
|
773
|
-
}
|
|
774
|
-
::-webkit-scrollbar-track {
|
|
775
|
-
background: transparent;
|
|
776
|
-
}
|
|
777
|
-
::-webkit-scrollbar-thumb {
|
|
778
|
-
background: rgba(0, 0, 0, 0.15);
|
|
779
|
-
border-radius: 4px;
|
|
780
|
-
}
|
|
781
|
-
::-webkit-scrollbar-thumb:hover {
|
|
782
|
-
background: rgba(0, 0, 0, 0.25);
|
|
783
|
-
}
|
|
784
|
-
`;
|
|
785
|
-
doc.head.appendChild(style);
|
|
786
|
-
};
|
|
787
|
-
copyStyles();
|
|
788
|
-
const observer = new MutationObserver(() => {
|
|
789
|
-
copyStyles();
|
|
790
|
-
});
|
|
791
|
-
observer.observe(document.head, { childList: true, subtree: true });
|
|
792
|
-
if (doc.body) {
|
|
793
|
-
doc.body.className = "tecof-canvas-body";
|
|
794
|
-
const handleBodyClick = (e3) => {
|
|
795
|
-
const target = e3.target;
|
|
796
|
-
if (!target.closest(".tecof-node-wrapper")) {
|
|
797
|
-
useEditorStore.getState().selectNode(null);
|
|
798
|
-
const isEmbedded = typeof window !== "undefined" && window.parent !== window;
|
|
799
|
-
if (isEmbedded) {
|
|
800
|
-
window.parent.postMessage({ type: "puck:itemDeselected" }, "*");
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
};
|
|
804
|
-
const handleIframeKeyDown = (e3) => {
|
|
805
|
-
const event = new KeyboardEvent("keydown", {
|
|
806
|
-
key: e3.key,
|
|
807
|
-
code: e3.code,
|
|
808
|
-
ctrlKey: e3.ctrlKey,
|
|
809
|
-
metaKey: e3.metaKey,
|
|
810
|
-
shiftKey: e3.shiftKey,
|
|
811
|
-
altKey: e3.altKey,
|
|
812
|
-
bubbles: true
|
|
813
|
-
});
|
|
814
|
-
window.dispatchEvent(event);
|
|
815
|
-
};
|
|
816
|
-
doc.body.addEventListener("click", handleBodyClick);
|
|
817
|
-
doc.addEventListener("keydown", handleIframeKeyDown);
|
|
818
|
-
return () => {
|
|
819
|
-
observer.disconnect();
|
|
820
|
-
doc.body.removeEventListener("click", handleBodyClick);
|
|
821
|
-
doc.removeEventListener("keydown", handleIframeKeyDown);
|
|
822
|
-
};
|
|
823
|
-
}
|
|
824
|
-
}, [contentRef]);
|
|
825
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
826
|
-
"iframe",
|
|
827
|
-
{
|
|
828
|
-
title,
|
|
829
|
-
ref: setContentRef,
|
|
830
|
-
style: {
|
|
831
|
-
width: "100%",
|
|
832
|
-
height: "100%",
|
|
833
|
-
border: "none",
|
|
834
|
-
background: "#ffffff",
|
|
835
|
-
...props.style
|
|
836
|
-
},
|
|
837
|
-
...props,
|
|
838
|
-
children: mountNode && ReactDOM.createPortal(children, mountNode)
|
|
839
|
-
}
|
|
840
|
-
);
|
|
1160
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ParentNodeContext.Provider, { value: node.props.id, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-node", children: [
|
|
1161
|
+
dragOverPosition === "top" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drop-line" }),
|
|
1162
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1163
|
+
"div",
|
|
1164
|
+
{
|
|
1165
|
+
className: wrapperClassName,
|
|
1166
|
+
"data-tecof-id": node.props.id,
|
|
1167
|
+
"data-tecof-type": node.type,
|
|
1168
|
+
"data-tecof-index": index2,
|
|
1169
|
+
"data-tecof-zone": zoneKey || "root",
|
|
1170
|
+
draggable: !readOnly,
|
|
1171
|
+
onDragStart: (e3) => {
|
|
1172
|
+
writeDragData(e3, { nodeId: node.props.id });
|
|
1173
|
+
e3.dataTransfer.effectAllowed = "move";
|
|
1174
|
+
setDragGhost(e3, label);
|
|
1175
|
+
beginDrag({ id: node.props.id });
|
|
1176
|
+
},
|
|
1177
|
+
onDragEnd: () => {
|
|
1178
|
+
autoScrollerRef.current.stop();
|
|
1179
|
+
endDrag();
|
|
1180
|
+
},
|
|
1181
|
+
onMouseEnter: handleMouseEnter,
|
|
1182
|
+
onMouseLeave: handleMouseLeave,
|
|
1183
|
+
onClick: handleClick,
|
|
1184
|
+
onDoubleClick: handleDoubleClick,
|
|
1185
|
+
onDragOver: handleDragOver,
|
|
1186
|
+
onDragLeave: handleDragLeave,
|
|
1187
|
+
onDrop: handleDrop,
|
|
1188
|
+
children: componentConfig.render(componentProps)
|
|
1189
|
+
}
|
|
1190
|
+
),
|
|
1191
|
+
dragOverPosition === "bottom" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drop-line" })
|
|
1192
|
+
] }) });
|
|
841
1193
|
};
|
|
842
1194
|
var Canvas = () => {
|
|
843
1195
|
const content = useEditorStore((state3) => state3.document.content);
|
|
844
1196
|
const viewport = useEditorStore((state3) => state3.viewport);
|
|
845
|
-
const
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
};
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
1197
|
+
const insertNode2 = useEditorStore((state3) => state3.insertNode);
|
|
1198
|
+
const endDrag = useEditorStore((state3) => state3.endDrag);
|
|
1199
|
+
const { config: config3, readOnly } = useStudio();
|
|
1200
|
+
const rootProps = useEditorStore((state3) => state3.document.root?.props || {});
|
|
1201
|
+
const [isRootDragOver, setIsRootDragOver] = React__default.useState(false);
|
|
1202
|
+
const autoScrollerRef = React__default.useRef(createEventAutoScroller());
|
|
1203
|
+
React__default.useEffect(() => {
|
|
1204
|
+
if (!readOnly) return;
|
|
1205
|
+
autoScrollerRef.current.stop();
|
|
1206
|
+
setIsRootDragOver(false);
|
|
1207
|
+
}, [readOnly]);
|
|
1208
|
+
const handleRootDragOver = React__default.useCallback(
|
|
1209
|
+
(e3) => {
|
|
1210
|
+
if (readOnly) return;
|
|
1211
|
+
e3.preventDefault();
|
|
1212
|
+
autoScrollerRef.current.update(e3);
|
|
1213
|
+
setIsRootDragOver(true);
|
|
1214
|
+
},
|
|
1215
|
+
[readOnly]
|
|
1216
|
+
);
|
|
1217
|
+
const handleRootDragLeave = React__default.useCallback((e3) => {
|
|
1218
|
+
if (e3.currentTarget.contains(e3.relatedTarget)) return;
|
|
1219
|
+
autoScrollerRef.current.stop();
|
|
1220
|
+
setIsRootDragOver(false);
|
|
1221
|
+
}, []);
|
|
1222
|
+
const handleRootDrop = React__default.useCallback(
|
|
1223
|
+
(e3) => {
|
|
1224
|
+
if (readOnly) return;
|
|
1225
|
+
e3.preventDefault();
|
|
1226
|
+
autoScrollerRef.current.stop();
|
|
1227
|
+
setIsRootDragOver(false);
|
|
1228
|
+
const { nodeId, type } = readDragData(e3);
|
|
1229
|
+
if (nodeId) {
|
|
1230
|
+
useEditorStore.getState().moveNode(nodeId, void 0, content.length);
|
|
1231
|
+
} else if (type) {
|
|
1232
|
+
insertNode2(createNode(config3, type), void 0, content.length);
|
|
1233
|
+
}
|
|
1234
|
+
endDrag();
|
|
1235
|
+
},
|
|
1236
|
+
[config3, content.length, endDrag, insertNode2, readOnly]
|
|
1237
|
+
);
|
|
1238
|
+
const rootClassName = [
|
|
1239
|
+
"tecof-canvas-root",
|
|
1240
|
+
content.length === 0 ? "is-empty" : "",
|
|
1241
|
+
isRootDragOver ? "is-dragover" : ""
|
|
1242
|
+
].filter(Boolean).join(" ");
|
|
1243
|
+
const viewportClassName = [
|
|
1244
|
+
"tecof-canvas-viewport",
|
|
1245
|
+
viewport !== "desktop" ? `is-${viewport}` : ""
|
|
1246
|
+
].filter(Boolean).join(" ");
|
|
1247
|
+
const renderedContent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
867
1248
|
"div",
|
|
868
1249
|
{
|
|
869
|
-
className:
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
1250
|
+
className: rootClassName,
|
|
1251
|
+
onDragOver: handleRootDragOver,
|
|
1252
|
+
onDragLeave: handleRootDragLeave,
|
|
1253
|
+
onDrop: handleRootDrop,
|
|
1254
|
+
"data-tecof-zone": "root",
|
|
1255
|
+
children: content.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-canvas-empty", children: [
|
|
1256
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-canvas-empty-kicker", children: "Root" }),
|
|
1257
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-canvas-empty-title", children: isRootDragOver ? "B\u0131rakmaya haz\u0131r" : "Canvas bo\u015F" }),
|
|
1258
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-canvas-empty-sub", children: isRootDragOver ? "Bile\u015Fen ana ak\u0131\u015Fa eklenecek" : "\u0130lk blo\u011Fu buraya b\u0131rak\u0131n" })
|
|
1259
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1260
|
+
content.map((item2, index2) => /* @__PURE__ */ jsxRuntime.jsx(NodeRenderer, { node: item2, index: index2 }, item2.props.id)),
|
|
1261
|
+
!readOnly && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-canvas-root-tail", "aria-hidden": "true" })
|
|
1262
|
+
] })
|
|
881
1263
|
}
|
|
882
|
-
)
|
|
1264
|
+
);
|
|
1265
|
+
const rootConfig = config3.root;
|
|
1266
|
+
const contentWithLayout = rootConfig?.render ? rootConfig.render({
|
|
1267
|
+
...rootProps,
|
|
1268
|
+
children: renderedContent,
|
|
1269
|
+
editMode: true
|
|
1270
|
+
}) : renderedContent;
|
|
1271
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-canvas-container", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: viewportClassName, children: /* @__PURE__ */ jsxRuntime.jsx(Frame, { className: "tecof-canvas-frame", children: contentWithLayout }) }) });
|
|
883
1272
|
};
|
|
884
1273
|
|
|
885
1274
|
// node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
|
|
@@ -1315,6 +1704,12 @@ var __iconNode39 = [
|
|
|
1315
1704
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
1316
1705
|
];
|
|
1317
1706
|
var X = createLucideIcon("x", __iconNode39);
|
|
1707
|
+
var getOutlineStyle = (coords) => ({
|
|
1708
|
+
"--tecof-outline-top": `${coords.top}px`,
|
|
1709
|
+
"--tecof-outline-left": `${coords.left}px`,
|
|
1710
|
+
"--tecof-outline-width": `${coords.width}px`,
|
|
1711
|
+
"--tecof-outline-height": `${coords.height}px`
|
|
1712
|
+
});
|
|
1318
1713
|
var useOverlayCoords = (id, iframeEl, containerEl, documentState) => {
|
|
1319
1714
|
const [coords, setCoords] = React__default.useState(null);
|
|
1320
1715
|
React__default.useEffect(() => {
|
|
@@ -1376,7 +1771,7 @@ var SelectionOverlay = () => {
|
|
|
1376
1771
|
const [iframeEl, setIframeEl] = React__default.useState(null);
|
|
1377
1772
|
const containerRef = React__default.useRef(null);
|
|
1378
1773
|
React__default.useEffect(() => {
|
|
1379
|
-
const iframe = document.querySelector(".tecof-canvas-viewport
|
|
1774
|
+
const iframe = document.querySelector(".tecof-canvas-viewport iframe");
|
|
1380
1775
|
setIframeEl(iframe);
|
|
1381
1776
|
}, [documentState]);
|
|
1382
1777
|
const selectedCoords = useOverlayCoords(selectedId, iframeEl, containerRef.current, documentState);
|
|
@@ -1405,220 +1800,95 @@ var SelectionOverlay = () => {
|
|
|
1405
1800
|
"div",
|
|
1406
1801
|
{
|
|
1407
1802
|
ref: containerRef,
|
|
1408
|
-
className: "tecof-
|
|
1409
|
-
style: {
|
|
1410
|
-
position: "absolute",
|
|
1411
|
-
top: 0,
|
|
1412
|
-
left: 0,
|
|
1413
|
-
right: 0,
|
|
1414
|
-
bottom: 0,
|
|
1415
|
-
pointerEvents: "none",
|
|
1416
|
-
zIndex: 1e3
|
|
1417
|
-
},
|
|
1803
|
+
className: "tecof-overlay",
|
|
1418
1804
|
children: [
|
|
1419
1805
|
hoveredCoords && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1420
1806
|
"div",
|
|
1421
1807
|
{
|
|
1422
|
-
className: "tecof-hover
|
|
1423
|
-
style:
|
|
1424
|
-
position: "absolute",
|
|
1425
|
-
top: hoveredCoords.top,
|
|
1426
|
-
left: hoveredCoords.left,
|
|
1427
|
-
width: hoveredCoords.width,
|
|
1428
|
-
height: hoveredCoords.height,
|
|
1429
|
-
border: "1.5px dashed #3b82f6",
|
|
1430
|
-
borderRadius: "4px",
|
|
1431
|
-
boxSizing: "border-box",
|
|
1432
|
-
pointerEvents: "none",
|
|
1433
|
-
transition: "all 0.1s ease-out"
|
|
1434
|
-
}
|
|
1808
|
+
className: "tecof-outline is-hover",
|
|
1809
|
+
style: getOutlineStyle(hoveredCoords)
|
|
1435
1810
|
}
|
|
1436
1811
|
),
|
|
1437
1812
|
selectedCoords && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1438
1813
|
"div",
|
|
1439
1814
|
{
|
|
1440
|
-
className: "tecof-selected
|
|
1441
|
-
style:
|
|
1442
|
-
position: "absolute",
|
|
1443
|
-
top: selectedCoords.top,
|
|
1444
|
-
left: selectedCoords.left,
|
|
1445
|
-
width: selectedCoords.width,
|
|
1446
|
-
height: selectedCoords.height,
|
|
1447
|
-
border: "2px solid #3b82f6",
|
|
1448
|
-
borderRadius: "4px",
|
|
1449
|
-
boxSizing: "border-box",
|
|
1450
|
-
pointerEvents: "none",
|
|
1451
|
-
transition: "all 0.1s ease-out"
|
|
1452
|
-
},
|
|
1815
|
+
className: "tecof-outline is-selected",
|
|
1816
|
+
style: getOutlineStyle(selectedCoords),
|
|
1453
1817
|
children: [
|
|
1454
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1529
|
-
"button",
|
|
1530
|
-
{
|
|
1531
|
-
onClick: () => duplicateNode2(selectedId),
|
|
1532
|
-
title: "Kopyala",
|
|
1533
|
-
style: {
|
|
1534
|
-
background: "transparent",
|
|
1535
|
-
border: "none",
|
|
1536
|
-
color: "#ffffff",
|
|
1537
|
-
cursor: "pointer",
|
|
1538
|
-
padding: "4px",
|
|
1539
|
-
borderRadius: "4px",
|
|
1540
|
-
display: "flex"
|
|
1541
|
-
},
|
|
1542
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Copy, { size: 14 })
|
|
1543
|
-
}
|
|
1544
|
-
),
|
|
1545
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1546
|
-
"button",
|
|
1547
|
-
{
|
|
1548
|
-
onClick: () => removeNode2(selectedId),
|
|
1549
|
-
title: "Sil",
|
|
1550
|
-
style: {
|
|
1551
|
-
background: "transparent",
|
|
1552
|
-
border: "none",
|
|
1553
|
-
color: "#ffffff",
|
|
1554
|
-
cursor: "pointer",
|
|
1555
|
-
padding: "4px",
|
|
1556
|
-
borderRadius: "4px",
|
|
1557
|
-
display: "flex"
|
|
1558
|
-
},
|
|
1559
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Trash2, { size: 14 })
|
|
1560
|
-
}
|
|
1561
|
-
)
|
|
1562
|
-
]
|
|
1563
|
-
}
|
|
1564
|
-
),
|
|
1565
|
-
nodeDetails && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1566
|
-
"div",
|
|
1567
|
-
{
|
|
1568
|
-
className: "tecof-outline-label",
|
|
1569
|
-
style: {
|
|
1570
|
-
position: "absolute",
|
|
1571
|
-
top: "-26px",
|
|
1572
|
-
left: "-2px",
|
|
1573
|
-
background: "#3b82f6",
|
|
1574
|
-
color: "#ffffff",
|
|
1575
|
-
fontSize: "11px",
|
|
1576
|
-
fontWeight: 600,
|
|
1577
|
-
padding: "2px 8px",
|
|
1578
|
-
borderRadius: "4px 4px 0 0",
|
|
1579
|
-
userSelect: "none"
|
|
1580
|
-
},
|
|
1581
|
-
children: nodeDetails.node.type
|
|
1582
|
-
}
|
|
1583
|
-
),
|
|
1584
|
-
breadcrumbs.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1585
|
-
"div",
|
|
1586
|
-
{
|
|
1587
|
-
className: "tecof-selected-breadcrumbs",
|
|
1588
|
-
style: {
|
|
1589
|
-
position: "absolute",
|
|
1590
|
-
bottom: "-28px",
|
|
1591
|
-
left: "-2px",
|
|
1592
|
-
display: "flex",
|
|
1593
|
-
alignItems: "center",
|
|
1594
|
-
gap: "4px",
|
|
1595
|
-
background: "#18181b",
|
|
1596
|
-
color: "#a1a1aa",
|
|
1597
|
-
fontSize: "10px",
|
|
1598
|
-
padding: "4px 8px",
|
|
1599
|
-
borderRadius: "0 0 6px 6px",
|
|
1600
|
-
pointerEvents: "auto",
|
|
1601
|
-
boxShadow: "0 2px 4px rgba(0,0,0,0.05)"
|
|
1602
|
-
},
|
|
1603
|
-
children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxRuntime.jsxs(React__default__namespace.default.Fragment, { children: [
|
|
1604
|
-
idx > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#52525b" }, children: ">" }),
|
|
1605
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1606
|
-
"span",
|
|
1607
|
-
{
|
|
1608
|
-
onClick: () => selectNode(crumb.id),
|
|
1609
|
-
style: {
|
|
1610
|
-
cursor: "pointer",
|
|
1611
|
-
color: crumb.id === selectedId ? "#ffffff" : void 0,
|
|
1612
|
-
fontWeight: crumb.id === selectedId ? 600 : void 0
|
|
1613
|
-
},
|
|
1614
|
-
onMouseEnter: () => useEditorStore.getState().hoverNode(crumb.id),
|
|
1615
|
-
onMouseLeave: () => useEditorStore.getState().hoverNode(null),
|
|
1616
|
-
children: crumb.type
|
|
1617
|
-
}
|
|
1618
|
-
)
|
|
1619
|
-
] }, crumb.id))
|
|
1620
|
-
}
|
|
1621
|
-
)
|
|
1818
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-toolbar", children: [
|
|
1819
|
+
parentId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1820
|
+
"button",
|
|
1821
|
+
{
|
|
1822
|
+
type: "button",
|
|
1823
|
+
onClick: () => selectNode(parentId),
|
|
1824
|
+
title: "\xDCst \xD6\u011Feyi Se\xE7",
|
|
1825
|
+
className: "tecof-toolbar-btn",
|
|
1826
|
+
"aria-label": "\xDCst \xF6\u011Feyi se\xE7",
|
|
1827
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronUp, { size: 14 })
|
|
1828
|
+
}
|
|
1829
|
+
),
|
|
1830
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1831
|
+
"button",
|
|
1832
|
+
{
|
|
1833
|
+
type: "button",
|
|
1834
|
+
onClick: () => handleMove("up"),
|
|
1835
|
+
disabled: !canMoveUp,
|
|
1836
|
+
title: "Yukar\u0131 Ta\u015F\u0131",
|
|
1837
|
+
className: "tecof-toolbar-btn",
|
|
1838
|
+
"aria-label": "Yukar\u0131 ta\u015F\u0131",
|
|
1839
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ArrowUp, { size: 14 })
|
|
1840
|
+
}
|
|
1841
|
+
),
|
|
1842
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1843
|
+
"button",
|
|
1844
|
+
{
|
|
1845
|
+
type: "button",
|
|
1846
|
+
onClick: () => handleMove("down"),
|
|
1847
|
+
disabled: !canMoveDown,
|
|
1848
|
+
title: "A\u015Fa\u011F\u0131 Ta\u015F\u0131",
|
|
1849
|
+
className: "tecof-toolbar-btn",
|
|
1850
|
+
"aria-label": "A\u015Fa\u011F\u0131 ta\u015F\u0131",
|
|
1851
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ArrowDown, { size: 14 })
|
|
1852
|
+
}
|
|
1853
|
+
),
|
|
1854
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-toolbar-sep" }),
|
|
1855
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1856
|
+
"button",
|
|
1857
|
+
{
|
|
1858
|
+
type: "button",
|
|
1859
|
+
onClick: () => duplicateNode2(selectedId),
|
|
1860
|
+
title: "Kopyala",
|
|
1861
|
+
className: "tecof-toolbar-btn",
|
|
1862
|
+
"aria-label": "Kopyala",
|
|
1863
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Copy, { size: 14 })
|
|
1864
|
+
}
|
|
1865
|
+
),
|
|
1866
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1867
|
+
"button",
|
|
1868
|
+
{
|
|
1869
|
+
type: "button",
|
|
1870
|
+
onClick: () => removeNode2(selectedId),
|
|
1871
|
+
title: "Sil",
|
|
1872
|
+
className: "tecof-toolbar-btn",
|
|
1873
|
+
"aria-label": "Sil",
|
|
1874
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Trash2, { size: 14 })
|
|
1875
|
+
}
|
|
1876
|
+
)
|
|
1877
|
+
] }),
|
|
1878
|
+
nodeDetails && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-outline-label", children: nodeDetails.node.type }),
|
|
1879
|
+
breadcrumbs.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-breadcrumbs", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxRuntime.jsxs(React__default__namespace.default.Fragment, { children: [
|
|
1880
|
+
idx > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-breadcrumb-sep", children: ">" }),
|
|
1881
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1882
|
+
"span",
|
|
1883
|
+
{
|
|
1884
|
+
onClick: () => selectNode(crumb.id),
|
|
1885
|
+
className: `tecof-breadcrumb${crumb.id === selectedId ? " is-active" : ""}`,
|
|
1886
|
+
onMouseEnter: () => useEditorStore.getState().hoverNode(crumb.id),
|
|
1887
|
+
onMouseLeave: () => useEditorStore.getState().hoverNode(null),
|
|
1888
|
+
children: crumb.type
|
|
1889
|
+
}
|
|
1890
|
+
)
|
|
1891
|
+
] }, crumb.id)) })
|
|
1622
1892
|
]
|
|
1623
1893
|
}
|
|
1624
1894
|
)
|
|
@@ -1634,55 +1904,14 @@ var FieldLabel = ({
|
|
|
1634
1904
|
el = "label"
|
|
1635
1905
|
}) => {
|
|
1636
1906
|
const Component2 = el;
|
|
1637
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
marginBottom: "16px",
|
|
1646
|
-
width: "100%",
|
|
1647
|
-
boxSizing: "border-box",
|
|
1648
|
-
userSelect: "none"
|
|
1649
|
-
},
|
|
1650
|
-
children: [
|
|
1651
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1652
|
-
"div",
|
|
1653
|
-
{
|
|
1654
|
-
className: "tecof-field-label-header",
|
|
1655
|
-
style: {
|
|
1656
|
-
display: "flex",
|
|
1657
|
-
alignItems: "center",
|
|
1658
|
-
gap: "6px",
|
|
1659
|
-
fontSize: "12px",
|
|
1660
|
-
fontWeight: 600,
|
|
1661
|
-
color: "#27272a"
|
|
1662
|
-
// zinc-800
|
|
1663
|
-
},
|
|
1664
|
-
children: [
|
|
1665
|
-
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-flex" }, children: icon }),
|
|
1666
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
|
|
1667
|
-
readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1668
|
-
"span",
|
|
1669
|
-
{
|
|
1670
|
-
style: {
|
|
1671
|
-
fontSize: "10px",
|
|
1672
|
-
color: "#a1a1aa",
|
|
1673
|
-
fontWeight: 400,
|
|
1674
|
-
marginLeft: "auto"
|
|
1675
|
-
},
|
|
1676
|
-
children: "Salt Okunur"
|
|
1677
|
-
}
|
|
1678
|
-
)
|
|
1679
|
-
]
|
|
1680
|
-
}
|
|
1681
|
-
),
|
|
1682
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-field-label-content", style: { width: "100%" }, children })
|
|
1683
|
-
]
|
|
1684
|
-
}
|
|
1685
|
-
);
|
|
1907
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Component2, { className: "tecof-field-label-container", children: [
|
|
1908
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-field-label-header", children: [
|
|
1909
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-field-label-icon", children: icon }),
|
|
1910
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
|
|
1911
|
+
readOnly && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-field-label-readonly", children: "Salt Okunur" })
|
|
1912
|
+
] }),
|
|
1913
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-field-label-content", children })
|
|
1914
|
+
] });
|
|
1686
1915
|
};
|
|
1687
1916
|
var FieldRenderer = ({
|
|
1688
1917
|
name: name3,
|
|
@@ -1695,7 +1924,7 @@ var FieldRenderer = ({
|
|
|
1695
1924
|
const label = definition.label || name3;
|
|
1696
1925
|
const type = definition.type;
|
|
1697
1926
|
if (definition.render) {
|
|
1698
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-
|
|
1927
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-field-custom", children: definition.render({
|
|
1699
1928
|
field: definition,
|
|
1700
1929
|
name: name3,
|
|
1701
1930
|
id: `field-${name3}`,
|
|
@@ -1714,18 +1943,6 @@ var FieldRenderer = ({
|
|
|
1714
1943
|
value: value || "",
|
|
1715
1944
|
disabled: readOnly,
|
|
1716
1945
|
onChange: (e3) => onChange(e3.target.value),
|
|
1717
|
-
style: {
|
|
1718
|
-
width: "100%",
|
|
1719
|
-
padding: "10px 12px",
|
|
1720
|
-
borderRadius: "8px",
|
|
1721
|
-
border: "1px solid #e4e4e7",
|
|
1722
|
-
fontSize: "13px",
|
|
1723
|
-
color: "#18181b",
|
|
1724
|
-
backgroundColor: readOnly ? "#f4f4f5" : "#ffffff",
|
|
1725
|
-
outline: "none",
|
|
1726
|
-
boxSizing: "border-box",
|
|
1727
|
-
transition: "border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out"
|
|
1728
|
-
},
|
|
1729
1946
|
className: "tecof-input-text"
|
|
1730
1947
|
}
|
|
1731
1948
|
) });
|
|
@@ -1738,24 +1955,11 @@ var FieldRenderer = ({
|
|
|
1738
1955
|
value: value || "",
|
|
1739
1956
|
disabled: readOnly,
|
|
1740
1957
|
onChange: (e3) => onChange(e3.target.value),
|
|
1741
|
-
style: {
|
|
1742
|
-
width: "100%",
|
|
1743
|
-
padding: "10px 12px",
|
|
1744
|
-
borderRadius: "8px",
|
|
1745
|
-
border: "1px solid #e4e4e7",
|
|
1746
|
-
fontSize: "13px",
|
|
1747
|
-
color: "#18181b",
|
|
1748
|
-
backgroundColor: readOnly ? "#f4f4f5" : "#ffffff",
|
|
1749
|
-
outline: "none",
|
|
1750
|
-
resize: "vertical",
|
|
1751
|
-
boxSizing: "border-box",
|
|
1752
|
-
transition: "border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out"
|
|
1753
|
-
},
|
|
1754
1958
|
className: "tecof-input-textarea"
|
|
1755
1959
|
}
|
|
1756
1960
|
) });
|
|
1757
1961
|
case "select":
|
|
1758
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
1962
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-field-select-wrap", children: [
|
|
1759
1963
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1760
1964
|
"select",
|
|
1761
1965
|
{
|
|
@@ -1763,39 +1967,11 @@ var FieldRenderer = ({
|
|
|
1763
1967
|
value: value || "",
|
|
1764
1968
|
disabled: readOnly,
|
|
1765
1969
|
onChange: (e3) => onChange(e3.target.value),
|
|
1766
|
-
style: {
|
|
1767
|
-
width: "100%",
|
|
1768
|
-
padding: "10px 32px 10px 12px",
|
|
1769
|
-
borderRadius: "8px",
|
|
1770
|
-
border: "1px solid #e4e4e7",
|
|
1771
|
-
fontSize: "13px",
|
|
1772
|
-
color: "#18181b",
|
|
1773
|
-
backgroundColor: readOnly ? "#f4f4f5" : "#ffffff",
|
|
1774
|
-
outline: "none",
|
|
1775
|
-
appearance: "none",
|
|
1776
|
-
boxSizing: "border-box",
|
|
1777
|
-
cursor: readOnly ? "not-allowed" : "pointer"
|
|
1778
|
-
},
|
|
1779
1970
|
className: "tecof-input-select",
|
|
1780
1971
|
children: (definition.options || []).map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt.value, children: opt.label || opt.value }, opt.value))
|
|
1781
1972
|
}
|
|
1782
1973
|
),
|
|
1783
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1784
|
-
"div",
|
|
1785
|
-
{
|
|
1786
|
-
style: {
|
|
1787
|
-
position: "absolute",
|
|
1788
|
-
top: "50%",
|
|
1789
|
-
right: "12px",
|
|
1790
|
-
transform: "translateY(-50%)",
|
|
1791
|
-
pointerEvents: "none",
|
|
1792
|
-
display: "flex",
|
|
1793
|
-
alignItems: "center",
|
|
1794
|
-
color: "#71717a"
|
|
1795
|
-
},
|
|
1796
|
-
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" }) })
|
|
1797
|
-
}
|
|
1798
|
-
)
|
|
1974
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-field-select-caret", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 12 }) })
|
|
1799
1975
|
] }) });
|
|
1800
1976
|
case "number":
|
|
1801
1977
|
return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1809,32 +1985,14 @@ var FieldRenderer = ({
|
|
|
1809
1985
|
const val = e3.target.value;
|
|
1810
1986
|
onChange(val === "" ? void 0 : Number(val));
|
|
1811
1987
|
},
|
|
1812
|
-
style: {
|
|
1813
|
-
width: "100%",
|
|
1814
|
-
padding: "10px 12px",
|
|
1815
|
-
borderRadius: "8px",
|
|
1816
|
-
border: "1px solid #e4e4e7",
|
|
1817
|
-
fontSize: "13px",
|
|
1818
|
-
color: "#18181b",
|
|
1819
|
-
backgroundColor: readOnly ? "#f4f4f5" : "#ffffff",
|
|
1820
|
-
outline: "none",
|
|
1821
|
-
boxSizing: "border-box"
|
|
1822
|
-
},
|
|
1823
1988
|
className: "tecof-input-number"
|
|
1824
1989
|
}
|
|
1825
1990
|
) });
|
|
1826
1991
|
case "radio":
|
|
1827
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
1992
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-field-radio-group", children: (definition.options || []).map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1828
1993
|
"label",
|
|
1829
1994
|
{
|
|
1830
|
-
|
|
1831
|
-
display: "flex",
|
|
1832
|
-
alignItems: "center",
|
|
1833
|
-
gap: "8px",
|
|
1834
|
-
fontSize: "13px",
|
|
1835
|
-
color: "#27272a",
|
|
1836
|
-
cursor: readOnly ? "not-allowed" : "pointer"
|
|
1837
|
-
},
|
|
1995
|
+
className: `tecof-field-radio${readOnly ? " is-readonly" : ""}`,
|
|
1838
1996
|
children: [
|
|
1839
1997
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1840
1998
|
"input",
|
|
@@ -1844,10 +2002,7 @@ var FieldRenderer = ({
|
|
|
1844
2002
|
value: opt.value,
|
|
1845
2003
|
checked: value === opt.value,
|
|
1846
2004
|
disabled: readOnly,
|
|
1847
|
-
onChange: () => onChange(opt.value)
|
|
1848
|
-
style: {
|
|
1849
|
-
cursor: readOnly ? "not-allowed" : "pointer"
|
|
1850
|
-
}
|
|
2005
|
+
onChange: () => onChange(opt.value)
|
|
1851
2006
|
}
|
|
1852
2007
|
),
|
|
1853
2008
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: opt.label || opt.value })
|
|
@@ -1907,165 +2062,103 @@ var FieldRenderer = ({
|
|
|
1907
2062
|
newExpanded[targetIdx] = tempExpanded;
|
|
1908
2063
|
setExpandedIndices(newExpanded);
|
|
1909
2064
|
};
|
|
1910
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
2065
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-array", children: [
|
|
1911
2066
|
items.map((item2, idx) => {
|
|
1912
2067
|
const isExpanded = !!expandedIndices[idx];
|
|
1913
2068
|
const itemLabel = getItemLabel(item2, idx);
|
|
1914
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
flexDirection: "column"
|
|
1924
|
-
},
|
|
1925
|
-
children: [
|
|
1926
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1927
|
-
"div",
|
|
1928
|
-
{
|
|
1929
|
-
onClick: () => toggleExpand(idx),
|
|
1930
|
-
style: {
|
|
1931
|
-
padding: "8px 12px",
|
|
1932
|
-
display: "flex",
|
|
1933
|
-
alignItems: "center",
|
|
1934
|
-
justifyContent: "space-between",
|
|
1935
|
-
cursor: "pointer",
|
|
1936
|
-
background: "#ffffff",
|
|
1937
|
-
userSelect: "none"
|
|
1938
|
-
},
|
|
1939
|
-
children: [
|
|
1940
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
|
|
1941
|
-
isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 14, color: "#71717a" }) : /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 14, color: "#71717a" }),
|
|
1942
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "13px", fontWeight: 500, color: "#3f3f46" }, children: itemLabel })
|
|
1943
|
-
] }),
|
|
1944
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, onClick: (e3) => e3.stopPropagation(), children: [
|
|
1945
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1946
|
-
"button",
|
|
1947
|
-
{
|
|
1948
|
-
onClick: () => handleMove(idx, "up"),
|
|
1949
|
-
disabled: idx === 0,
|
|
1950
|
-
style: {
|
|
1951
|
-
background: "transparent",
|
|
1952
|
-
border: "none",
|
|
1953
|
-
cursor: idx === 0 ? "not-allowed" : "pointer",
|
|
1954
|
-
padding: "2px",
|
|
1955
|
-
color: idx === 0 ? "#e4e4e7" : "#71717a"
|
|
1956
|
-
},
|
|
1957
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(ArrowUp, { size: 12 })
|
|
1958
|
-
}
|
|
1959
|
-
),
|
|
1960
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1961
|
-
"button",
|
|
1962
|
-
{
|
|
1963
|
-
onClick: () => handleMove(idx, "down"),
|
|
1964
|
-
disabled: idx === items.length - 1,
|
|
1965
|
-
style: {
|
|
1966
|
-
background: "transparent",
|
|
1967
|
-
border: "none",
|
|
1968
|
-
cursor: idx === items.length - 1 ? "not-allowed" : "pointer",
|
|
1969
|
-
padding: "2px",
|
|
1970
|
-
color: idx === items.length - 1 ? "#e4e4e7" : "#71717a"
|
|
1971
|
-
},
|
|
1972
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(ArrowDown, { size: 12 })
|
|
1973
|
-
}
|
|
1974
|
-
),
|
|
1975
|
-
!readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1976
|
-
"button",
|
|
1977
|
-
{
|
|
1978
|
-
onClick: () => handleRemove(idx),
|
|
1979
|
-
style: {
|
|
1980
|
-
background: "transparent",
|
|
1981
|
-
border: "none",
|
|
1982
|
-
cursor: "pointer",
|
|
1983
|
-
padding: "2px",
|
|
1984
|
-
color: "#ef4444",
|
|
1985
|
-
marginLeft: "4px"
|
|
1986
|
-
},
|
|
1987
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Trash2, { size: 12 })
|
|
1988
|
-
}
|
|
1989
|
-
)
|
|
1990
|
-
] })
|
|
1991
|
-
]
|
|
2069
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-array-item", children: [
|
|
2070
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2071
|
+
"div",
|
|
2072
|
+
{
|
|
2073
|
+
onClick: () => toggleExpand(idx),
|
|
2074
|
+
onKeyDown: (e3) => {
|
|
2075
|
+
if (e3.key === "Enter" || e3.key === " ") {
|
|
2076
|
+
e3.preventDefault();
|
|
2077
|
+
toggleExpand(idx);
|
|
1992
2078
|
}
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
FieldRenderer,
|
|
2079
|
+
},
|
|
2080
|
+
className: "tecof-array-item-header",
|
|
2081
|
+
role: "button",
|
|
2082
|
+
tabIndex: 0,
|
|
2083
|
+
"aria-expanded": isExpanded,
|
|
2084
|
+
children: [
|
|
2085
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-array-item-title-wrap", children: [
|
|
2086
|
+
isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 14 }),
|
|
2087
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-array-item-title", children: itemLabel })
|
|
2088
|
+
] }),
|
|
2089
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-array-item-actions", onClick: (e3) => e3.stopPropagation(), children: [
|
|
2090
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2091
|
+
"button",
|
|
2007
2092
|
{
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2093
|
+
type: "button",
|
|
2094
|
+
onClick: () => handleMove(idx, "up"),
|
|
2095
|
+
disabled: idx === 0,
|
|
2096
|
+
className: "tecof-array-btn",
|
|
2097
|
+
title: "Yukar\u0131 ta\u015F\u0131",
|
|
2098
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ArrowUp, { size: 12 })
|
|
2099
|
+
}
|
|
2100
|
+
),
|
|
2101
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2102
|
+
"button",
|
|
2103
|
+
{
|
|
2104
|
+
type: "button",
|
|
2105
|
+
onClick: () => handleMove(idx, "down"),
|
|
2106
|
+
disabled: idx === items.length - 1,
|
|
2107
|
+
className: "tecof-array-btn",
|
|
2108
|
+
title: "A\u015Fa\u011F\u0131 ta\u015F\u0131",
|
|
2109
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ArrowDown, { size: 12 })
|
|
2110
|
+
}
|
|
2111
|
+
),
|
|
2112
|
+
!readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2113
|
+
"button",
|
|
2114
|
+
{
|
|
2115
|
+
type: "button",
|
|
2116
|
+
onClick: () => handleRemove(idx),
|
|
2117
|
+
className: "tecof-array-btn danger",
|
|
2118
|
+
title: "Sil",
|
|
2119
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Trash2, { size: 12 })
|
|
2120
|
+
}
|
|
2121
|
+
)
|
|
2122
|
+
] })
|
|
2123
|
+
]
|
|
2124
|
+
}
|
|
2125
|
+
),
|
|
2126
|
+
isExpanded && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-array-item-body", children: Object.entries(arrayFields).map(([subFieldName, subFieldDef]) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2127
|
+
FieldRenderer,
|
|
2128
|
+
{
|
|
2129
|
+
name: subFieldName,
|
|
2130
|
+
definition: subFieldDef,
|
|
2131
|
+
value: item2[subFieldName],
|
|
2132
|
+
onChange: (newSubVal) => {
|
|
2133
|
+
const updatedItems = [...items];
|
|
2134
|
+
updatedItems[idx] = {
|
|
2135
|
+
...updatedItems[idx],
|
|
2136
|
+
[subFieldName]: newSubVal
|
|
2137
|
+
};
|
|
2138
|
+
onChange(updatedItems);
|
|
2139
|
+
},
|
|
2140
|
+
readOnly
|
|
2141
|
+
},
|
|
2142
|
+
subFieldName
|
|
2143
|
+
)) })
|
|
2144
|
+
] }, idx);
|
|
2029
2145
|
}),
|
|
2030
2146
|
!readOnly && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2031
2147
|
"button",
|
|
2032
2148
|
{
|
|
2033
2149
|
type: "button",
|
|
2034
2150
|
onClick: handleAdd,
|
|
2035
|
-
style: {
|
|
2036
|
-
display: "flex",
|
|
2037
|
-
alignItems: "center",
|
|
2038
|
-
justifyContent: "center",
|
|
2039
|
-
gap: "6px",
|
|
2040
|
-
width: "100%",
|
|
2041
|
-
padding: "10px",
|
|
2042
|
-
borderRadius: "8px",
|
|
2043
|
-
border: "1px dashed #cbd5e1",
|
|
2044
|
-
background: "#ffffff",
|
|
2045
|
-
color: "#64748b",
|
|
2046
|
-
fontSize: "13px",
|
|
2047
|
-
fontWeight: 500,
|
|
2048
|
-
cursor: "pointer",
|
|
2049
|
-
transition: "all 0.2s"
|
|
2050
|
-
},
|
|
2051
2151
|
className: "tecof-add-array-item-btn",
|
|
2052
2152
|
children: [
|
|
2053
2153
|
/* @__PURE__ */ jsxRuntime.jsx(Plus, { size: 14 }),
|
|
2054
2154
|
"\xD6\u011Fe Ekle"
|
|
2055
2155
|
]
|
|
2056
2156
|
}
|
|
2057
|
-
)
|
|
2058
|
-
/* @__PURE__ */ jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: `
|
|
2059
|
-
.tecof-add-array-item-btn:hover {
|
|
2060
|
-
border-color: #3b82f6 !important;
|
|
2061
|
-
color: #2563eb !important;
|
|
2062
|
-
background-color: #eff6ff !important;
|
|
2063
|
-
}
|
|
2064
|
-
` } })
|
|
2157
|
+
)
|
|
2065
2158
|
] }) });
|
|
2066
2159
|
}
|
|
2067
2160
|
default:
|
|
2068
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
2161
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-field-unsupported", children: [
|
|
2069
2162
|
'Desteklenmeyen alan t\xFCr\xFC: "',
|
|
2070
2163
|
type,
|
|
2071
2164
|
'" (',
|
|
@@ -2084,184 +2177,72 @@ var Inspector = () => {
|
|
|
2084
2177
|
if (selectedId) {
|
|
2085
2178
|
const nodeDetails = findNodeById(documentState, selectedId);
|
|
2086
2179
|
if (!nodeDetails) {
|
|
2087
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
2180
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-inspector", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-inspector-empty", children: "Bile\u015Fen y\xFCkleniyor veya bulunamad\u0131." }) });
|
|
2088
2181
|
}
|
|
2089
2182
|
const { node } = nodeDetails;
|
|
2090
2183
|
const componentConfig = config3.components[node.type];
|
|
2091
2184
|
const fields = componentConfig?.fields || {};
|
|
2092
2185
|
const label = componentConfig?.label || node.type;
|
|
2093
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2094
|
-
"div",
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2186
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-inspector", children: [
|
|
2187
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-inspector-header", children: [
|
|
2188
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2189
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "tecof-inspector-title", children: label }),
|
|
2190
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-inspector-id", children: selectedId })
|
|
2191
|
+
] }),
|
|
2192
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => selectNode(null), className: "tecof-inspector-deselect", children: "Se\xE7imi Kald\u0131r" })
|
|
2193
|
+
] }),
|
|
2194
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-inspector-fields", children: Object.keys(fields).length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-inspector-empty-fields", children: "Bu bile\u015Fenin d\xFCzenlenebilir alan\u0131 bulunmuyor." }) : Object.entries(fields).map(([fieldName, fieldDef]) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2195
|
+
FieldRenderer,
|
|
2196
|
+
{
|
|
2197
|
+
name: fieldName,
|
|
2198
|
+
definition: fieldDef,
|
|
2199
|
+
value: node.props[fieldName],
|
|
2200
|
+
onChange: (newVal) => updateProps2(selectedId, { [fieldName]: newVal }),
|
|
2201
|
+
readOnly
|
|
2105
2202
|
},
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
{
|
|
2110
|
-
style: {
|
|
2111
|
-
padding: "16px 20px",
|
|
2112
|
-
borderBottom: "1px solid #f4f4f5",
|
|
2113
|
-
display: "flex",
|
|
2114
|
-
alignItems: "center",
|
|
2115
|
-
justifyContent: "space-between"
|
|
2116
|
-
},
|
|
2117
|
-
children: [
|
|
2118
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2119
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: 0, fontSize: "14px", fontWeight: 700, color: "#18181b" }, children: label }),
|
|
2120
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#a1a1aa", fontFamily: "monospace" }, children: selectedId })
|
|
2121
|
-
] }),
|
|
2122
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2123
|
-
"button",
|
|
2124
|
-
{
|
|
2125
|
-
onClick: () => selectNode(null),
|
|
2126
|
-
style: {
|
|
2127
|
-
background: "transparent",
|
|
2128
|
-
border: "none",
|
|
2129
|
-
color: "#71717a",
|
|
2130
|
-
cursor: "pointer",
|
|
2131
|
-
fontSize: "11px",
|
|
2132
|
-
fontWeight: 500,
|
|
2133
|
-
padding: "4px 8px",
|
|
2134
|
-
borderRadius: "4px",
|
|
2135
|
-
hover: { background: "#f4f4f5" }
|
|
2136
|
-
},
|
|
2137
|
-
children: "Se\xE7imi Kald\u0131r"
|
|
2138
|
-
}
|
|
2139
|
-
)
|
|
2140
|
-
]
|
|
2141
|
-
}
|
|
2142
|
-
),
|
|
2143
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2144
|
-
"div",
|
|
2145
|
-
{
|
|
2146
|
-
className: "tecof-inspector-fields",
|
|
2147
|
-
style: {
|
|
2148
|
-
flex: 1,
|
|
2149
|
-
overflowY: "auto",
|
|
2150
|
-
padding: "20px",
|
|
2151
|
-
display: "flex",
|
|
2152
|
-
flexDirection: "column",
|
|
2153
|
-
gap: "4px"
|
|
2154
|
-
},
|
|
2155
|
-
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(
|
|
2156
|
-
FieldRenderer,
|
|
2157
|
-
{
|
|
2158
|
-
name: fieldName,
|
|
2159
|
-
definition: fieldDef,
|
|
2160
|
-
value: node.props[fieldName],
|
|
2161
|
-
onChange: (newVal) => updateProps2(selectedId, { [fieldName]: newVal }),
|
|
2162
|
-
readOnly
|
|
2163
|
-
},
|
|
2164
|
-
fieldName
|
|
2165
|
-
))
|
|
2166
|
-
}
|
|
2167
|
-
)
|
|
2168
|
-
]
|
|
2169
|
-
}
|
|
2170
|
-
);
|
|
2203
|
+
fieldName
|
|
2204
|
+
)) })
|
|
2205
|
+
] });
|
|
2171
2206
|
}
|
|
2172
2207
|
const rootFields = config3.root?.fields || {};
|
|
2173
2208
|
const hasRootFields = Object.keys(rootFields).length > 0;
|
|
2174
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2175
|
-
"div",
|
|
2176
|
-
|
|
2177
|
-
className: "tecof-inspector",
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2209
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-inspector", children: [
|
|
2210
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-inspector-header", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2211
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "tecof-inspector-title", children: "Sayfa Ayarlar\u0131" }),
|
|
2212
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-inspector-id", children: "Genel sayfa konfig\xFCrasyonu" })
|
|
2213
|
+
] }) }),
|
|
2214
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-inspector-fields", children: hasRootFields ? Object.entries(rootFields).map(([fieldName, fieldDef]) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2215
|
+
FieldRenderer,
|
|
2216
|
+
{
|
|
2217
|
+
name: fieldName,
|
|
2218
|
+
definition: fieldDef,
|
|
2219
|
+
value: documentState.root.props[fieldName],
|
|
2220
|
+
onChange: (newVal) => setRootProps2({ [fieldName]: newVal }),
|
|
2221
|
+
readOnly
|
|
2186
2222
|
},
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
flexDirection: "column",
|
|
2211
|
-
gap: "4px"
|
|
2212
|
-
},
|
|
2213
|
-
children: hasRootFields ? Object.entries(rootFields).map(([fieldName, fieldDef]) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2214
|
-
FieldRenderer,
|
|
2215
|
-
{
|
|
2216
|
-
name: fieldName,
|
|
2217
|
-
definition: fieldDef,
|
|
2218
|
-
value: documentState.root.props[fieldName],
|
|
2219
|
-
onChange: (newVal) => setRootProps2({ [fieldName]: newVal }),
|
|
2220
|
-
readOnly
|
|
2221
|
-
},
|
|
2222
|
-
fieldName
|
|
2223
|
-
)) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2224
|
-
"div",
|
|
2225
|
-
{
|
|
2226
|
-
style: {
|
|
2227
|
-
display: "flex",
|
|
2228
|
-
flexDirection: "column",
|
|
2229
|
-
alignItems: "center",
|
|
2230
|
-
justifyContent: "center",
|
|
2231
|
-
height: "100%",
|
|
2232
|
-
color: "#a1a1aa",
|
|
2233
|
-
fontSize: "12px",
|
|
2234
|
-
textAlign: "center",
|
|
2235
|
-
padding: "20px"
|
|
2236
|
-
},
|
|
2237
|
-
children: [
|
|
2238
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2239
|
-
"svg",
|
|
2240
|
-
{
|
|
2241
|
-
width: "24",
|
|
2242
|
-
height: "24",
|
|
2243
|
-
viewBox: "0 0 24 24",
|
|
2244
|
-
fill: "none",
|
|
2245
|
-
stroke: "currentColor",
|
|
2246
|
-
strokeWidth: "2",
|
|
2247
|
-
strokeLinecap: "round",
|
|
2248
|
-
strokeLinejoin: "round",
|
|
2249
|
-
style: { marginBottom: "8px", opacity: 0.6 },
|
|
2250
|
-
children: [
|
|
2251
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2252
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 3v18" })
|
|
2253
|
-
]
|
|
2254
|
-
}
|
|
2255
|
-
),
|
|
2256
|
-
"Bile\u015Fen se\xE7ilmedi. D\xFCzenlemek istedi\u011Finiz bir bile\u015Fene t\u0131klay\u0131n."
|
|
2257
|
-
]
|
|
2258
|
-
}
|
|
2259
|
-
)
|
|
2260
|
-
}
|
|
2261
|
-
)
|
|
2262
|
-
]
|
|
2263
|
-
}
|
|
2264
|
-
);
|
|
2223
|
+
fieldName
|
|
2224
|
+
)) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-inspector-empty", children: [
|
|
2225
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2226
|
+
"svg",
|
|
2227
|
+
{
|
|
2228
|
+
width: "24",
|
|
2229
|
+
height: "24",
|
|
2230
|
+
viewBox: "0 0 24 24",
|
|
2231
|
+
fill: "none",
|
|
2232
|
+
stroke: "currentColor",
|
|
2233
|
+
strokeWidth: "2",
|
|
2234
|
+
strokeLinecap: "round",
|
|
2235
|
+
strokeLinejoin: "round",
|
|
2236
|
+
className: "tecof-inspector-empty-icon",
|
|
2237
|
+
children: [
|
|
2238
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2239
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 3v18" })
|
|
2240
|
+
]
|
|
2241
|
+
}
|
|
2242
|
+
),
|
|
2243
|
+
"Bile\u015Fen se\xE7ilmedi. D\xFCzenlemek istedi\u011Finiz bir bile\u015Fene t\u0131klay\u0131n."
|
|
2244
|
+
] }) })
|
|
2245
|
+
] });
|
|
2265
2246
|
};
|
|
2266
2247
|
var TopBar = ({ onSave, saving, saveStatus }) => {
|
|
2267
2248
|
const viewport = useEditorStore((state3) => state3.viewport);
|
|
@@ -2270,192 +2251,67 @@ var TopBar = ({ onSave, saving, saveStatus }) => {
|
|
|
2270
2251
|
const futureCount = useEditorStore((state3) => state3.history.future.length);
|
|
2271
2252
|
const undo = useEditorStore((state3) => state3.undo);
|
|
2272
2253
|
const redo = useEditorStore((state3) => state3.redo);
|
|
2273
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-
|
|
2274
|
-
|
|
2275
|
-
borderBottom: "1px solid #e4e4e7",
|
|
2276
|
-
background: "#ffffff",
|
|
2277
|
-
display: "flex",
|
|
2278
|
-
alignItems: "center",
|
|
2279
|
-
justifyContent: "space-between",
|
|
2280
|
-
padding: "0 20px",
|
|
2281
|
-
boxSizing: "border-box",
|
|
2282
|
-
zIndex: 100
|
|
2283
|
-
}, children: [
|
|
2284
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-topbar-title", style: {
|
|
2285
|
-
fontSize: "14px",
|
|
2286
|
-
fontWeight: 600,
|
|
2287
|
-
color: "#18181b",
|
|
2288
|
-
display: "flex",
|
|
2289
|
-
alignItems: "center",
|
|
2290
|
-
gap: "8px"
|
|
2291
|
-
}, children: [
|
|
2254
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-topbar", children: [
|
|
2255
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-topbar-title", children: [
|
|
2292
2256
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Sayfa D\xFCzenleyici" }),
|
|
2293
|
-
saveStatus === "success" && /* @__PURE__ */ jsxRuntime.jsxs("span", {
|
|
2294
|
-
fontSize: "11px",
|
|
2295
|
-
color: "#10b981",
|
|
2296
|
-
display: "inline-flex",
|
|
2297
|
-
alignItems: "center",
|
|
2298
|
-
gap: "4px",
|
|
2299
|
-
fontWeight: 500
|
|
2300
|
-
}, children: [
|
|
2257
|
+
saveStatus === "success" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "tecof-topbar-saved", children: [
|
|
2301
2258
|
/* @__PURE__ */ jsxRuntime.jsx(Check, { size: 12 }),
|
|
2302
2259
|
" Kaydedildi"
|
|
2303
2260
|
] })
|
|
2304
2261
|
] }),
|
|
2305
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-
|
|
2306
|
-
display: "flex",
|
|
2307
|
-
alignItems: "center",
|
|
2308
|
-
background: "#f4f4f5",
|
|
2309
|
-
padding: "3px",
|
|
2310
|
-
borderRadius: "8px",
|
|
2311
|
-
gap: "2px"
|
|
2312
|
-
}, children: [
|
|
2262
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-topbar-viewports", children: [
|
|
2313
2263
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2314
2264
|
"button",
|
|
2315
2265
|
{
|
|
2266
|
+
type: "button",
|
|
2316
2267
|
onClick: () => setViewport("desktop"),
|
|
2317
|
-
|
|
2318
|
-
background: viewport === "desktop" ? "#ffffff" : "transparent",
|
|
2319
|
-
border: "none",
|
|
2320
|
-
outline: "none",
|
|
2321
|
-
cursor: "pointer",
|
|
2322
|
-
padding: "6px 12px",
|
|
2323
|
-
borderRadius: "6px",
|
|
2324
|
-
color: viewport === "desktop" ? "#18181b" : "#71717a",
|
|
2325
|
-
display: "flex",
|
|
2326
|
-
alignItems: "center",
|
|
2327
|
-
justifyContent: "center",
|
|
2328
|
-
boxShadow: viewport === "desktop" ? "0 1px 3px 0 rgba(0, 0, 0, 0.1)" : "none",
|
|
2329
|
-
transition: "all 0.2s"
|
|
2330
|
-
},
|
|
2268
|
+
className: `tecof-vp-btn${viewport === "desktop" ? " is-active" : ""}`,
|
|
2331
2269
|
title: "Masa\xFCst\xFC",
|
|
2270
|
+
"aria-label": "Masa\xFCst\xFC g\xF6r\xFCn\xFCm\xFC",
|
|
2271
|
+
"aria-pressed": viewport === "desktop",
|
|
2332
2272
|
children: /* @__PURE__ */ jsxRuntime.jsx(Monitor, { size: 16 })
|
|
2333
2273
|
}
|
|
2334
2274
|
),
|
|
2335
2275
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2336
2276
|
"button",
|
|
2337
2277
|
{
|
|
2278
|
+
type: "button",
|
|
2338
2279
|
onClick: () => setViewport("tablet"),
|
|
2339
|
-
|
|
2340
|
-
background: viewport === "tablet" ? "#ffffff" : "transparent",
|
|
2341
|
-
border: "none",
|
|
2342
|
-
outline: "none",
|
|
2343
|
-
cursor: "pointer",
|
|
2344
|
-
padding: "6px 12px",
|
|
2345
|
-
borderRadius: "6px",
|
|
2346
|
-
color: viewport === "tablet" ? "#18181b" : "#71717a",
|
|
2347
|
-
display: "flex",
|
|
2348
|
-
alignItems: "center",
|
|
2349
|
-
justifyContent: "center",
|
|
2350
|
-
boxShadow: viewport === "tablet" ? "0 1px 3px 0 rgba(0, 0, 0, 0.1)" : "none",
|
|
2351
|
-
transition: "all 0.2s"
|
|
2352
|
-
},
|
|
2280
|
+
className: `tecof-vp-btn${viewport === "tablet" ? " is-active" : ""}`,
|
|
2353
2281
|
title: "Tablet",
|
|
2282
|
+
"aria-label": "Tablet g\xF6r\xFCn\xFCm\xFC",
|
|
2283
|
+
"aria-pressed": viewport === "tablet",
|
|
2354
2284
|
children: /* @__PURE__ */ jsxRuntime.jsx(Tablet, { size: 16 })
|
|
2355
2285
|
}
|
|
2356
2286
|
),
|
|
2357
2287
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2358
2288
|
"button",
|
|
2359
2289
|
{
|
|
2290
|
+
type: "button",
|
|
2360
2291
|
onClick: () => setViewport("mobile"),
|
|
2361
|
-
|
|
2362
|
-
background: viewport === "mobile" ? "#ffffff" : "transparent",
|
|
2363
|
-
border: "none",
|
|
2364
|
-
outline: "none",
|
|
2365
|
-
cursor: "pointer",
|
|
2366
|
-
padding: "6px 12px",
|
|
2367
|
-
borderRadius: "6px",
|
|
2368
|
-
color: viewport === "mobile" ? "#18181b" : "#71717a",
|
|
2369
|
-
display: "flex",
|
|
2370
|
-
alignItems: "center",
|
|
2371
|
-
justifyContent: "center",
|
|
2372
|
-
boxShadow: viewport === "mobile" ? "0 1px 3px 0 rgba(0, 0, 0, 0.1)" : "none",
|
|
2373
|
-
transition: "all 0.2s"
|
|
2374
|
-
},
|
|
2292
|
+
className: `tecof-vp-btn${viewport === "mobile" ? " is-active" : ""}`,
|
|
2375
2293
|
title: "Mobil",
|
|
2294
|
+
"aria-label": "Mobil g\xF6r\xFCn\xFCm\xFC",
|
|
2295
|
+
"aria-pressed": viewport === "mobile",
|
|
2376
2296
|
children: /* @__PURE__ */ jsxRuntime.jsx(Smartphone, { size: 16 })
|
|
2377
2297
|
}
|
|
2378
2298
|
)
|
|
2379
2299
|
] }),
|
|
2380
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
}, children: [
|
|
2385
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "4px" }, children: [
|
|
2386
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2387
|
-
"button",
|
|
2388
|
-
{
|
|
2389
|
-
onClick: undo,
|
|
2390
|
-
disabled: pastCount === 0,
|
|
2391
|
-
style: {
|
|
2392
|
-
background: "transparent",
|
|
2393
|
-
border: "none",
|
|
2394
|
-
cursor: pastCount === 0 ? "not-allowed" : "pointer",
|
|
2395
|
-
padding: "8px",
|
|
2396
|
-
borderRadius: "6px",
|
|
2397
|
-
color: pastCount === 0 ? "#d4d4d8" : "#71717a",
|
|
2398
|
-
display: "flex",
|
|
2399
|
-
alignItems: "center",
|
|
2400
|
-
justifyContent: "center",
|
|
2401
|
-
transition: "background 0.2s"
|
|
2402
|
-
},
|
|
2403
|
-
title: "Geri Al",
|
|
2404
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Undo2, { size: 16 })
|
|
2405
|
-
}
|
|
2406
|
-
),
|
|
2407
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2408
|
-
"button",
|
|
2409
|
-
{
|
|
2410
|
-
onClick: redo,
|
|
2411
|
-
disabled: futureCount === 0,
|
|
2412
|
-
style: {
|
|
2413
|
-
background: "transparent",
|
|
2414
|
-
border: "none",
|
|
2415
|
-
cursor: futureCount === 0 ? "not-allowed" : "pointer",
|
|
2416
|
-
padding: "8px",
|
|
2417
|
-
borderRadius: "6px",
|
|
2418
|
-
color: futureCount === 0 ? "#d4d4d8" : "#71717a",
|
|
2419
|
-
display: "flex",
|
|
2420
|
-
alignItems: "center",
|
|
2421
|
-
justifyContent: "center",
|
|
2422
|
-
transition: "background 0.2s"
|
|
2423
|
-
},
|
|
2424
|
-
title: "Yinele",
|
|
2425
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Redo2, { size: 16 })
|
|
2426
|
-
}
|
|
2427
|
-
)
|
|
2300
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-topbar-actions", children: [
|
|
2301
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-topbar-undoredo", children: [
|
|
2302
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: undo, disabled: pastCount === 0, className: "tecof-icon-btn", title: "Geri Al", "aria-label": "Geri al", children: /* @__PURE__ */ jsxRuntime.jsx(Undo2, { size: 16 }) }),
|
|
2303
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: redo, disabled: futureCount === 0, className: "tecof-icon-btn", title: "Yinele", "aria-label": "Yinele", children: /* @__PURE__ */ jsxRuntime.jsx(Redo2, { size: 16 }) })
|
|
2428
2304
|
] }),
|
|
2429
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
2430
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
disabled: saving,
|
|
2435
|
-
style: {
|
|
2436
|
-
background: "#2563eb",
|
|
2437
|
-
color: "#ffffff",
|
|
2438
|
-
border: "none",
|
|
2439
|
-
cursor: saving ? "wait" : "pointer",
|
|
2440
|
-
padding: "8px 16px",
|
|
2441
|
-
borderRadius: "8px",
|
|
2442
|
-
fontSize: "13px",
|
|
2443
|
-
fontWeight: 500,
|
|
2444
|
-
display: "flex",
|
|
2445
|
-
alignItems: "center",
|
|
2446
|
-
gap: "8px",
|
|
2447
|
-
transition: "background 0.2s",
|
|
2448
|
-
opacity: saving ? 0.7 : 1
|
|
2449
|
-
},
|
|
2450
|
-
children: [
|
|
2451
|
-
/* @__PURE__ */ jsxRuntime.jsx(Save, { size: 14 }),
|
|
2452
|
-
saving ? "Kaydediliyor..." : "Taslak Kaydet"
|
|
2453
|
-
]
|
|
2454
|
-
}
|
|
2455
|
-
)
|
|
2305
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-topbar-divider" }),
|
|
2306
|
+
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: onSave, disabled: saving, className: "tecof-btn-primary", "aria-busy": saving, children: [
|
|
2307
|
+
/* @__PURE__ */ jsxRuntime.jsx(Save, { size: 14 }),
|
|
2308
|
+
saving ? "Kaydediliyor..." : "Taslak Kaydet"
|
|
2309
|
+
] })
|
|
2456
2310
|
] })
|
|
2457
2311
|
] });
|
|
2458
2312
|
};
|
|
2313
|
+
var getLayerRowStyle = (depth) => ({ "--tecof-layer-indent": `${depth * 12 + 8}px` });
|
|
2314
|
+
var getLayerZoneStyle = (depth) => ({ "--tecof-layer-zone-indent": `${(depth + 1) * 12 + 14}px` });
|
|
2459
2315
|
var TreeNode = ({ node, depth }) => {
|
|
2460
2316
|
const { config: config3 } = useStudio();
|
|
2461
2317
|
const documentState = useEditorStore((state3) => state3.document);
|
|
@@ -2463,7 +2319,10 @@ var TreeNode = ({ node, depth }) => {
|
|
|
2463
2319
|
const selectNode = useEditorStore((state3) => state3.selectNode);
|
|
2464
2320
|
const hoverNode = useEditorStore((state3) => state3.hoverNode);
|
|
2465
2321
|
const removeNode2 = useEditorStore((state3) => state3.removeNode);
|
|
2322
|
+
const beginDrag = useEditorStore((state3) => state3.beginDrag);
|
|
2323
|
+
const endDrag = useEditorStore((state3) => state3.endDrag);
|
|
2466
2324
|
const [expanded, setExpanded] = React__default.useState(true);
|
|
2325
|
+
const [dragOverPos, setDragOverPos] = React__default.useState(null);
|
|
2467
2326
|
const isSelected = selectedId === node.props.id;
|
|
2468
2327
|
const componentConfig = config3.components[node.type];
|
|
2469
2328
|
const label = componentConfig?.label || node.type;
|
|
@@ -2473,103 +2332,110 @@ var TreeNode = ({ node, depth }) => {
|
|
|
2473
2332
|
const hasChildren = childZoneKeys.some(
|
|
2474
2333
|
(key) => (documentState.zones[key] || []).length > 0
|
|
2475
2334
|
);
|
|
2476
|
-
|
|
2335
|
+
const handleDragOver = (e3) => {
|
|
2336
|
+
e3.preventDefault();
|
|
2337
|
+
e3.stopPropagation();
|
|
2338
|
+
const rect = e3.currentTarget.getBoundingClientRect();
|
|
2339
|
+
const relativeY = e3.clientY - rect.top;
|
|
2340
|
+
setDragOverPos(relativeY < rect.height / 2 ? "top" : "bottom");
|
|
2341
|
+
};
|
|
2342
|
+
const handleDragLeave = () => {
|
|
2343
|
+
setDragOverPos(null);
|
|
2344
|
+
};
|
|
2345
|
+
const handleDrop = (e3) => {
|
|
2346
|
+
e3.preventDefault();
|
|
2347
|
+
e3.stopPropagation();
|
|
2348
|
+
setDragOverPos(null);
|
|
2349
|
+
const { nodeId: draggedId } = readDragData(e3);
|
|
2350
|
+
if (!draggedId || draggedId === node.props.id) return;
|
|
2351
|
+
const doc = useEditorStore.getState().document;
|
|
2352
|
+
const res2 = findNodeById(doc, node.props.id);
|
|
2353
|
+
if (!res2) return;
|
|
2354
|
+
const { path } = res2;
|
|
2355
|
+
const targetZoneKey = path.zoneKey;
|
|
2356
|
+
const targetIndex = dragOverPos === "top" ? path.index : path.index + 1;
|
|
2357
|
+
useEditorStore.getState().moveNode(draggedId, targetZoneKey, targetIndex);
|
|
2358
|
+
};
|
|
2359
|
+
const handleRowKeyDown = (e3) => {
|
|
2360
|
+
if (e3.key === "Enter" || e3.key === " ") {
|
|
2361
|
+
e3.preventDefault();
|
|
2362
|
+
selectNode(node.props.id);
|
|
2363
|
+
return;
|
|
2364
|
+
}
|
|
2365
|
+
if ((e3.key === "Delete" || e3.key === "Backspace") && isSelected) {
|
|
2366
|
+
e3.preventDefault();
|
|
2367
|
+
removeNode2(node.props.id);
|
|
2368
|
+
}
|
|
2369
|
+
};
|
|
2370
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-layer-node", children: [
|
|
2371
|
+
dragOverPos === "top" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drop-line sm" }),
|
|
2477
2372
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2478
2373
|
"div",
|
|
2479
2374
|
{
|
|
2375
|
+
draggable: true,
|
|
2376
|
+
onDragStart: (e3) => {
|
|
2377
|
+
writeDragData(e3, { nodeId: node.props.id });
|
|
2378
|
+
e3.dataTransfer.effectAllowed = "move";
|
|
2379
|
+
setDragGhost(e3, label);
|
|
2380
|
+
beginDrag({ id: node.props.id });
|
|
2381
|
+
},
|
|
2382
|
+
onDragEnd: endDrag,
|
|
2383
|
+
onDragOver: handleDragOver,
|
|
2384
|
+
onDragLeave: handleDragLeave,
|
|
2385
|
+
onDrop: handleDrop,
|
|
2480
2386
|
onMouseEnter: () => hoverNode(node.props.id),
|
|
2481
2387
|
onMouseLeave: () => hoverNode(null),
|
|
2482
2388
|
onClick: () => selectNode(node.props.id),
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
color: isSelected ? "#1d4ed8" : "#3f3f46",
|
|
2491
|
-
cursor: "pointer",
|
|
2492
|
-
borderRadius: "6px",
|
|
2493
|
-
fontSize: "13px",
|
|
2494
|
-
fontWeight: isSelected ? 500 : 400,
|
|
2495
|
-
transition: "all 0.15s"
|
|
2496
|
-
},
|
|
2389
|
+
onKeyDown: handleRowKeyDown,
|
|
2390
|
+
className: `tecof-layer-row${isSelected ? " is-selected" : ""}`,
|
|
2391
|
+
role: "treeitem",
|
|
2392
|
+
tabIndex: 0,
|
|
2393
|
+
"aria-selected": isSelected,
|
|
2394
|
+
"aria-expanded": hasChildren ? expanded : void 0,
|
|
2395
|
+
style: getLayerRowStyle(depth),
|
|
2497
2396
|
children: [
|
|
2498
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
2397
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-layer-row-main", children: [
|
|
2499
2398
|
hasChildren ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2500
2399
|
"button",
|
|
2501
2400
|
{
|
|
2401
|
+
type: "button",
|
|
2502
2402
|
onClick: (e3) => {
|
|
2503
2403
|
e3.stopPropagation();
|
|
2504
2404
|
setExpanded(!expanded);
|
|
2505
2405
|
},
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
cursor: "pointer",
|
|
2510
|
-
padding: 0,
|
|
2511
|
-
display: "flex",
|
|
2512
|
-
alignItems: "center",
|
|
2513
|
-
color: "#a1a1aa"
|
|
2514
|
-
},
|
|
2406
|
+
className: "tecof-layer-caret",
|
|
2407
|
+
"aria-label": expanded ? `${label} katman\u0131n\u0131 daralt` : `${label} katman\u0131n\u0131 geni\u015Flet`,
|
|
2408
|
+
"aria-expanded": expanded,
|
|
2515
2409
|
children: expanded ? /* @__PURE__ */ jsxRuntime.jsx(ChevronDown, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 14 })
|
|
2516
2410
|
}
|
|
2517
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
2518
|
-
/* @__PURE__ */ jsxRuntime.jsx(PanelsTopLeft, { size: 14,
|
|
2519
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
2520
|
-
whiteSpace: "nowrap",
|
|
2521
|
-
overflow: "hidden",
|
|
2522
|
-
textOverflow: "ellipsis",
|
|
2523
|
-
maxWidth: "120px"
|
|
2524
|
-
}, children: label })
|
|
2411
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-layer-caret-spacer" }),
|
|
2412
|
+
/* @__PURE__ */ jsxRuntime.jsx(PanelsTopLeft, { size: 14, className: "tecof-layer-icon" }),
|
|
2413
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-layer-label", children: label })
|
|
2525
2414
|
] }),
|
|
2526
2415
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2527
2416
|
"button",
|
|
2528
2417
|
{
|
|
2418
|
+
type: "button",
|
|
2529
2419
|
onClick: (e3) => {
|
|
2530
2420
|
e3.stopPropagation();
|
|
2531
2421
|
removeNode2(node.props.id);
|
|
2532
2422
|
},
|
|
2533
|
-
className: "tecof-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
border: "none",
|
|
2537
|
-
cursor: "pointer",
|
|
2538
|
-
padding: "2px",
|
|
2539
|
-
color: "#a1a1aa",
|
|
2540
|
-
display: "flex",
|
|
2541
|
-
alignItems: "center",
|
|
2542
|
-
opacity: 0,
|
|
2543
|
-
transition: "opacity 0.2s"
|
|
2544
|
-
},
|
|
2423
|
+
className: "tecof-layer-delete",
|
|
2424
|
+
title: "Sil",
|
|
2425
|
+
"aria-label": `${label} katman\u0131n\u0131 sil`,
|
|
2545
2426
|
children: /* @__PURE__ */ jsxRuntime.jsx(Trash2, { size: 12 })
|
|
2546
2427
|
}
|
|
2547
2428
|
)
|
|
2548
2429
|
]
|
|
2549
2430
|
}
|
|
2550
2431
|
),
|
|
2551
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
2552
|
-
.tecof-layers-tree-node:hover .tecof-layers-delete-btn {
|
|
2553
|
-
opacity: 1 !important;
|
|
2554
|
-
}
|
|
2555
|
-
.tecof-layers-delete-btn:hover {
|
|
2556
|
-
color: #ef4444 !important;
|
|
2557
|
-
}
|
|
2558
|
-
` } }),
|
|
2432
|
+
dragOverPos === "bottom" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drop-line sm" }),
|
|
2559
2433
|
expanded && childZoneKeys.map((zoneKey) => {
|
|
2560
2434
|
const zoneItems = documentState.zones[zoneKey] || [];
|
|
2561
2435
|
const zoneName = zoneKey.split(":").pop() || "";
|
|
2562
2436
|
if (zoneItems.length === 0) return null;
|
|
2563
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
2564
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style:
|
|
2565
|
-
fontSize: "10px",
|
|
2566
|
-
textTransform: "uppercase",
|
|
2567
|
-
letterSpacing: "0.05em",
|
|
2568
|
-
color: "#a1a1aa",
|
|
2569
|
-
padding: "4px 8px",
|
|
2570
|
-
paddingLeft: `${(depth + 1) * 12 + 14}px`,
|
|
2571
|
-
fontWeight: 600
|
|
2572
|
-
}, children: zoneName }),
|
|
2437
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-layer-node", children: [
|
|
2438
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-layer-zone-label", style: getLayerZoneStyle(depth), children: zoneName }),
|
|
2573
2439
|
zoneItems.map((childNode) => /* @__PURE__ */ jsxRuntime.jsx(TreeNode, { node: childNode, depth: depth + 1 }, childNode.props.id))
|
|
2574
2440
|
] }, zoneKey);
|
|
2575
2441
|
})
|
|
@@ -2577,24 +2443,13 @@ var TreeNode = ({ node, depth }) => {
|
|
|
2577
2443
|
};
|
|
2578
2444
|
var LayersTree = () => {
|
|
2579
2445
|
const documentState = useEditorStore((state3) => state3.document);
|
|
2580
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-
|
|
2581
|
-
display: "flex",
|
|
2582
|
-
flexDirection: "column",
|
|
2583
|
-
gap: "2px",
|
|
2584
|
-
overflowY: "auto",
|
|
2585
|
-
height: "100%"
|
|
2586
|
-
}, children: documentState.content.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
2587
|
-
textAlign: "center",
|
|
2588
|
-
color: "#a1a1aa",
|
|
2589
|
-
fontSize: "13px",
|
|
2590
|
-
padding: "24px 12px"
|
|
2591
|
-
}, children: "S\xFCr\xFCklenmi\u015F katman yok" }) : documentState.content.map((node) => /* @__PURE__ */ jsxRuntime.jsx(TreeNode, { node, depth: 0 }, node.props.id)) });
|
|
2446
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-layers", role: "tree", "aria-label": "Sayfa katmanlar\u0131", children: documentState.content.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-layers-empty", children: "S\xFCr\xFCklenmi\u015F katman yok" }) : documentState.content.map((node) => /* @__PURE__ */ jsxRuntime.jsx(TreeNode, { node, depth: 0 }, node.props.id)) });
|
|
2592
2447
|
};
|
|
2593
2448
|
var LeftPanel = () => {
|
|
2594
2449
|
const { config: config3 } = useStudio();
|
|
2595
2450
|
const insertNode2 = useEditorStore((state3) => state3.insertNode);
|
|
2596
|
-
useEditorStore((state3) => state3.
|
|
2597
|
-
useEditorStore((state3) => state3.
|
|
2451
|
+
const beginDrag = useEditorStore((state3) => state3.beginDrag);
|
|
2452
|
+
const endDrag = useEditorStore((state3) => state3.endDrag);
|
|
2598
2453
|
const [activeTab, setActiveTab] = React__default.useState("blocks");
|
|
2599
2454
|
const [searchQuery, setSearchQuery] = React__default.useState("");
|
|
2600
2455
|
const categories = config3.categories || {};
|
|
@@ -2614,53 +2469,18 @@ var LeftPanel = () => {
|
|
|
2614
2469
|
});
|
|
2615
2470
|
}
|
|
2616
2471
|
const handleAddBlock = (type) => {
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
props: {
|
|
2622
|
-
id: generateId(),
|
|
2623
|
-
...JSON.parse(JSON.stringify(defaultProps))
|
|
2624
|
-
}
|
|
2625
|
-
};
|
|
2626
|
-
insertNode2(newNode);
|
|
2627
|
-
};
|
|
2628
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-left-panel", style: {
|
|
2629
|
-
width: "280px",
|
|
2630
|
-
borderRight: "1px solid #e4e4e7",
|
|
2631
|
-
background: "#ffffff",
|
|
2632
|
-
display: "flex",
|
|
2633
|
-
flexDirection: "column",
|
|
2634
|
-
height: "100%",
|
|
2635
|
-
boxSizing: "border-box"
|
|
2636
|
-
}, children: [
|
|
2637
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
|
|
2638
|
-
display: "flex",
|
|
2639
|
-
borderBottom: "1px solid #e4e4e7",
|
|
2640
|
-
padding: "8px 12px",
|
|
2641
|
-
gap: "4px"
|
|
2642
|
-
}, children: [
|
|
2472
|
+
insertNode2(createNode(config3, type));
|
|
2473
|
+
};
|
|
2474
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-left-panel", children: [
|
|
2475
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-panel-tabs", role: "tablist", "aria-label": "Sol panel g\xF6r\xFCn\xFCm\xFC", children: [
|
|
2643
2476
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2644
2477
|
"button",
|
|
2645
2478
|
{
|
|
2479
|
+
type: "button",
|
|
2646
2480
|
onClick: () => setActiveTab("blocks"),
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
alignItems: "center",
|
|
2651
|
-
justifyContent: "center",
|
|
2652
|
-
gap: "6px",
|
|
2653
|
-
border: "none",
|
|
2654
|
-
outline: "none",
|
|
2655
|
-
padding: "8px",
|
|
2656
|
-
borderRadius: "6px",
|
|
2657
|
-
fontSize: "12px",
|
|
2658
|
-
fontWeight: 600,
|
|
2659
|
-
cursor: "pointer",
|
|
2660
|
-
background: activeTab === "blocks" ? "#f4f4f5" : "transparent",
|
|
2661
|
-
color: activeTab === "blocks" ? "#18181b" : "#71717a",
|
|
2662
|
-
transition: "all 0.2s"
|
|
2663
|
-
},
|
|
2481
|
+
className: `tecof-tab${activeTab === "blocks" ? " is-active" : ""}`,
|
|
2482
|
+
role: "tab",
|
|
2483
|
+
"aria-selected": activeTab === "blocks",
|
|
2664
2484
|
children: [
|
|
2665
2485
|
/* @__PURE__ */ jsxRuntime.jsx(Grid3x3, { size: 14 }),
|
|
2666
2486
|
"Blok Ekle"
|
|
@@ -2670,24 +2490,11 @@ var LeftPanel = () => {
|
|
|
2670
2490
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2671
2491
|
"button",
|
|
2672
2492
|
{
|
|
2493
|
+
type: "button",
|
|
2673
2494
|
onClick: () => setActiveTab("layers"),
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
alignItems: "center",
|
|
2678
|
-
justifyContent: "center",
|
|
2679
|
-
gap: "6px",
|
|
2680
|
-
border: "none",
|
|
2681
|
-
outline: "none",
|
|
2682
|
-
padding: "8px",
|
|
2683
|
-
borderRadius: "6px",
|
|
2684
|
-
fontSize: "12px",
|
|
2685
|
-
fontWeight: 600,
|
|
2686
|
-
cursor: "pointer",
|
|
2687
|
-
background: activeTab === "layers" ? "#f4f4f5" : "transparent",
|
|
2688
|
-
color: activeTab === "layers" ? "#18181b" : "#71717a",
|
|
2689
|
-
transition: "all 0.2s"
|
|
2690
|
-
},
|
|
2495
|
+
className: `tecof-tab${activeTab === "layers" ? " is-active" : ""}`,
|
|
2496
|
+
role: "tab",
|
|
2497
|
+
"aria-selected": activeTab === "layers",
|
|
2691
2498
|
children: [
|
|
2692
2499
|
/* @__PURE__ */ jsxRuntime.jsx(Layers, { size: 14 }),
|
|
2693
2500
|
"Katmanlar"
|
|
@@ -2695,16 +2502,9 @@ var LeftPanel = () => {
|
|
|
2695
2502
|
}
|
|
2696
2503
|
)
|
|
2697
2504
|
] }),
|
|
2698
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
2699
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
2700
|
-
|
|
2701
|
-
alignItems: "center",
|
|
2702
|
-
background: "#f4f4f5",
|
|
2703
|
-
padding: "6px 10px",
|
|
2704
|
-
borderRadius: "8px",
|
|
2705
|
-
gap: "8px"
|
|
2706
|
-
}, children: [
|
|
2707
|
-
/* @__PURE__ */ jsxRuntime.jsx(Search, { size: 14, color: "#a1a1aa" }),
|
|
2505
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-panel-body", children: activeTab === "blocks" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-blocks", children: [
|
|
2506
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-search", children: [
|
|
2507
|
+
/* @__PURE__ */ jsxRuntime.jsx(Search, { size: 14, className: "tecof-icon-muted" }),
|
|
2708
2508
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2709
2509
|
"input",
|
|
2710
2510
|
{
|
|
@@ -2712,14 +2512,7 @@ var LeftPanel = () => {
|
|
|
2712
2512
|
placeholder: "Bile\u015Fen ara...",
|
|
2713
2513
|
value: searchQuery,
|
|
2714
2514
|
onChange: (e3) => setSearchQuery(e3.target.value),
|
|
2715
|
-
|
|
2716
|
-
border: "none",
|
|
2717
|
-
outline: "none",
|
|
2718
|
-
background: "transparent",
|
|
2719
|
-
fontSize: "12px",
|
|
2720
|
-
color: "#18181b",
|
|
2721
|
-
width: "100%"
|
|
2722
|
-
}
|
|
2515
|
+
className: "tecof-search-input"
|
|
2723
2516
|
}
|
|
2724
2517
|
)
|
|
2725
2518
|
] }),
|
|
@@ -2729,59 +2522,36 @@ var LeftPanel = () => {
|
|
|
2729
2522
|
return label.toLowerCase().includes(searchQuery.toLowerCase());
|
|
2730
2523
|
});
|
|
2731
2524
|
if (filteredTypes.length === 0) return null;
|
|
2732
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
2733
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
2734
|
-
|
|
2735
|
-
fontWeight: 700,
|
|
2736
|
-
color: "#71717a",
|
|
2737
|
-
textTransform: "uppercase",
|
|
2738
|
-
letterSpacing: "0.05em"
|
|
2739
|
-
}, children: catTitle }),
|
|
2740
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
2741
|
-
display: "grid",
|
|
2742
|
-
gridTemplateColumns: "1fr",
|
|
2743
|
-
gap: "6px"
|
|
2744
|
-
}, children: filteredTypes.map((type) => {
|
|
2525
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-block-cat", children: [
|
|
2526
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-block-cat-title", children: catTitle }),
|
|
2527
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-block-grid", children: filteredTypes.map((type) => {
|
|
2745
2528
|
const compConfig = components[type] || {};
|
|
2746
2529
|
const label = compConfig.label || type;
|
|
2747
2530
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2748
2531
|
"button",
|
|
2749
2532
|
{
|
|
2533
|
+
type: "button",
|
|
2750
2534
|
onClick: () => handleAddBlock(type),
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
fontWeight: 500,
|
|
2758
|
-
color: "#3f3f46",
|
|
2759
|
-
cursor: "pointer",
|
|
2760
|
-
display: "flex",
|
|
2761
|
-
alignItems: "center",
|
|
2762
|
-
justifyContent: "space-between",
|
|
2763
|
-
textAlign: "left",
|
|
2764
|
-
transition: "all 0.2s",
|
|
2765
|
-
boxShadow: "0 1px 2px 0 rgba(0, 0, 0, 0.02)"
|
|
2535
|
+
draggable: true,
|
|
2536
|
+
onDragStart: (e3) => {
|
|
2537
|
+
writeDragData(e3, { type });
|
|
2538
|
+
e3.dataTransfer.effectAllowed = "copy";
|
|
2539
|
+
setDragGhost(e3, label);
|
|
2540
|
+
beginDrag({ type });
|
|
2766
2541
|
},
|
|
2767
|
-
|
|
2542
|
+
onDragEnd: endDrag,
|
|
2543
|
+
className: "tecof-block-btn",
|
|
2544
|
+
title: `${label} ekle`,
|
|
2768
2545
|
children: [
|
|
2769
2546
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
|
|
2770
|
-
/* @__PURE__ */ jsxRuntime.jsx(Plus, { size: 14,
|
|
2547
|
+
/* @__PURE__ */ jsxRuntime.jsx(Plus, { size: 14, className: "tecof-block-btn-icon" })
|
|
2771
2548
|
]
|
|
2772
2549
|
},
|
|
2773
2550
|
type
|
|
2774
2551
|
);
|
|
2775
2552
|
}) })
|
|
2776
2553
|
] }, catTitle);
|
|
2777
|
-
})
|
|
2778
|
-
/* @__PURE__ */ jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: `
|
|
2779
|
-
.tecof-studio-block-btn:hover {
|
|
2780
|
-
border-color: #3b82f6 !important;
|
|
2781
|
-
color: #2563eb !important;
|
|
2782
|
-
background-color: #eff6ff !important;
|
|
2783
|
-
}
|
|
2784
|
-
` } })
|
|
2554
|
+
})
|
|
2785
2555
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(LayersTree, {}) })
|
|
2786
2556
|
] });
|
|
2787
2557
|
};
|
|
@@ -2851,7 +2621,7 @@ var TecofStudio = ({
|
|
|
2851
2621
|
setTimeout(() => setSaveStatus("idle"), 3e3);
|
|
2852
2622
|
onSave?.(serialized);
|
|
2853
2623
|
if (isEmbedded) {
|
|
2854
|
-
window.parent.postMessage({ type: "puck:saved" }, "*");
|
|
2624
|
+
window.parent.postMessage({ type: "puck:saved", data: serialized }, "*");
|
|
2855
2625
|
}
|
|
2856
2626
|
} else {
|
|
2857
2627
|
setSaveStatus("error");
|
|
@@ -2873,6 +2643,7 @@ var TecofStudio = ({
|
|
|
2873
2643
|
const onMessage = (e3) => {
|
|
2874
2644
|
switch (e3.data?.type) {
|
|
2875
2645
|
case "puck:save":
|
|
2646
|
+
case "puck:publish":
|
|
2876
2647
|
handleSaveDraft();
|
|
2877
2648
|
break;
|
|
2878
2649
|
case "puck:undo":
|
|
@@ -2908,7 +2679,7 @@ var TecofStudio = ({
|
|
|
2908
2679
|
return true;
|
|
2909
2680
|
}
|
|
2910
2681
|
}
|
|
2911
|
-
const iframe = document.querySelector(".tecof-canvas-viewport
|
|
2682
|
+
const iframe = document.querySelector(".tecof-canvas-viewport iframe");
|
|
2912
2683
|
const iframeDoc = iframe?.contentDocument;
|
|
2913
2684
|
const iframeActiveEl = iframeDoc?.activeElement;
|
|
2914
2685
|
if (iframeActiveEl) {
|
|
@@ -2965,70 +2736,50 @@ var TecofStudio = ({
|
|
|
2965
2736
|
apiClient
|
|
2966
2737
|
}), [config3, apiClient]);
|
|
2967
2738
|
if (loading) {
|
|
2968
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
justifyContent: "center",
|
|
2972
|
-
height: "100vh",
|
|
2973
|
-
background: "#f4f4f5"
|
|
2974
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { textAlign: "center" }, children: [
|
|
2975
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-editor-spinner", style: {
|
|
2976
|
-
width: "40px",
|
|
2977
|
-
height: "40px",
|
|
2978
|
-
border: "3px solid #e4e4e7",
|
|
2979
|
-
borderTopColor: "#3b82f6",
|
|
2980
|
-
borderRadius: "50%",
|
|
2981
|
-
animation: "spin 1s linear infinite",
|
|
2982
|
-
margin: "0 auto 16px"
|
|
2983
|
-
} }),
|
|
2984
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#71717a", fontSize: "14px", margin: 0 }, children: "St\xFCdyo y\xFCkleniyor..." })
|
|
2985
|
-
] }) });
|
|
2986
|
-
}
|
|
2987
|
-
return /* @__PURE__ */ jsxRuntime.jsx(StudioContext.Provider, { value: studioContextValue, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `tecof-studio-root ${className || ""}`.trim(), style: {
|
|
2988
|
-
display: "flex",
|
|
2989
|
-
flexDirection: "column",
|
|
2990
|
-
height: "100vh",
|
|
2991
|
-
width: "100vw",
|
|
2992
|
-
overflow: "hidden",
|
|
2993
|
-
position: "relative",
|
|
2994
|
-
background: "#f4f4f5"
|
|
2995
|
-
}, children: [
|
|
2739
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StudioSkeleton, { className });
|
|
2740
|
+
}
|
|
2741
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StudioContext.Provider, { value: studioContextValue, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `tecof-studio-root ${className || ""}`.trim(), children: [
|
|
2996
2742
|
/* @__PURE__ */ jsxRuntime.jsx(TopBar, { onSave: handleSaveDraft, saving, saveStatus }),
|
|
2997
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-workspace-container",
|
|
2998
|
-
display: "flex",
|
|
2999
|
-
flex: 1,
|
|
3000
|
-
height: "calc(100% - 56px)",
|
|
3001
|
-
width: "100%",
|
|
3002
|
-
overflow: "hidden"
|
|
3003
|
-
}, children: [
|
|
2743
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-workspace-container", children: [
|
|
3004
2744
|
/* @__PURE__ */ jsxRuntime.jsx(LeftPanel, {}),
|
|
3005
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-workspace",
|
|
3006
|
-
display: "flex",
|
|
3007
|
-
flex: 1,
|
|
3008
|
-
height: "100%",
|
|
3009
|
-
position: "relative",
|
|
3010
|
-
overflow: "hidden"
|
|
3011
|
-
}, children: [
|
|
2745
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-workspace", children: [
|
|
3012
2746
|
/* @__PURE__ */ jsxRuntime.jsx(Canvas, {}),
|
|
3013
2747
|
/* @__PURE__ */ jsxRuntime.jsx(SelectionOverlay, {})
|
|
3014
2748
|
] }),
|
|
3015
2749
|
/* @__PURE__ */ jsxRuntime.jsx(Inspector, {})
|
|
3016
2750
|
] }),
|
|
3017
|
-
saving && /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
3018
|
-
position: "absolute",
|
|
3019
|
-
bottom: "24px",
|
|
3020
|
-
right: "24px",
|
|
3021
|
-
background: saveStatus === "error" ? "#ef4444" : "#18181b",
|
|
3022
|
-
color: "#ffffff",
|
|
3023
|
-
padding: "8px 16px",
|
|
3024
|
-
borderRadius: "24px",
|
|
3025
|
-
fontSize: "12px",
|
|
3026
|
-
fontWeight: 500,
|
|
3027
|
-
boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
|
|
3028
|
-
zIndex: 9999
|
|
3029
|
-
}, children: saveStatus === "error" ? "Kaydedilemedi" : "Kaydediliyor..." })
|
|
2751
|
+
saving && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `tecof-studio-save-indicator${saveStatus === "error" ? " is-error" : ""}`, children: saveStatus === "error" ? "Kaydedilemedi" : "Kaydediliyor..." })
|
|
3030
2752
|
] }) });
|
|
3031
2753
|
};
|
|
2754
|
+
var StudioSkeleton = ({ className }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `tecof-studio-skeleton ${className || ""}`.trim(), "aria-busy": "true", "aria-label": "St\xFCdyo y\xFCkleniyor", children: [
|
|
2755
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-skeleton-topbar", children: [
|
|
2756
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-studio-skeleton-title" }),
|
|
2757
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-studio-skeleton-vp" }),
|
|
2758
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-skeleton-toolgroup", children: [
|
|
2759
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-studio-skeleton-dot" }),
|
|
2760
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-studio-skeleton-dot" }),
|
|
2761
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-studio-skeleton-cta" })
|
|
2762
|
+
] })
|
|
2763
|
+
] }),
|
|
2764
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-skeleton-body", children: [
|
|
2765
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-skeleton-side", children: [
|
|
2766
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-studio-skeleton-search" }),
|
|
2767
|
+
Array.from({ length: 6 }).map((_2, i2) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-studio-skeleton-blockrow" }, i2))
|
|
2768
|
+
] }),
|
|
2769
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-skeleton-canvas", children: [
|
|
2770
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-block" }),
|
|
2771
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-block" }),
|
|
2772
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-block" })
|
|
2773
|
+
] }),
|
|
2774
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-skeleton-side right", children: [
|
|
2775
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-text w-60" }),
|
|
2776
|
+
Array.from({ length: 5 }).map((_2, i2) => /* @__PURE__ */ jsxRuntime.jsxs(React__default__namespace.default.Fragment, { children: [
|
|
2777
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-text sm w-40" }),
|
|
2778
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-studio-skeleton-field" })
|
|
2779
|
+
] }, i2))
|
|
2780
|
+
] })
|
|
2781
|
+
] })
|
|
2782
|
+
] });
|
|
3032
2783
|
|
|
3033
2784
|
// src/components/TecofEditor.tsx
|
|
3034
2785
|
var TecofEditor = TecofStudio;
|
|
@@ -3068,7 +2819,15 @@ var TecofRender = ({ data: data3, config: config3, className, cmsData }) => {
|
|
|
3068
2819
|
config: config3,
|
|
3069
2820
|
cmsData: cmsData || null
|
|
3070
2821
|
};
|
|
3071
|
-
|
|
2822
|
+
const renderedContent = data3.content.map((item2, index2) => /* @__PURE__ */ jsxRuntime.jsx(RenderNode, { node: item2, index: index2 }, item2.props.id || index2));
|
|
2823
|
+
const rootProps = data3.root?.props || {};
|
|
2824
|
+
const rootConfig = config3.root;
|
|
2825
|
+
const contentWithLayout = rootConfig?.render ? rootConfig.render({
|
|
2826
|
+
...rootProps,
|
|
2827
|
+
children: renderedContent,
|
|
2828
|
+
editMode: false
|
|
2829
|
+
}) : renderedContent;
|
|
2830
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RenderContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: contentWithLayout }) });
|
|
3072
2831
|
};
|
|
3073
2832
|
var IMAGE_EXTENSIONS = ["png", "jpg", "jpeg", "webp", "gif", "svg", "avif", "bmp", "tiff", "heic"];
|
|
3074
2833
|
var VIDEO_EXTENSIONS = ["mp4", "webm", "ogg", "avi", "mov", "quicktime"];
|
|
@@ -3178,7 +2937,7 @@ var TecofPicture = React__default.memo(({
|
|
|
3178
2937
|
{
|
|
3179
2938
|
"data-fancybox": fancyboxName,
|
|
3180
2939
|
href: fileURL,
|
|
3181
|
-
|
|
2940
|
+
className: "tecof-picture-link",
|
|
3182
2941
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { style, className: containerClassName, children: isVideoType ? renderVideo() : renderImg() })
|
|
3183
2942
|
}
|
|
3184
2943
|
);
|
|
@@ -3536,10 +3295,15 @@ var LanguageTabBar = ({
|
|
|
3536
3295
|
code
|
|
3537
3296
|
)) });
|
|
3538
3297
|
};
|
|
3539
|
-
var FieldLoading = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-
|
|
3540
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3541
|
-
|
|
3542
|
-
|
|
3298
|
+
var FieldLoading = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-field-loading", "aria-busy": "true", children: [
|
|
3299
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-field-loading-row", children: [
|
|
3300
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-circle tecof-field-loading-thumb" }),
|
|
3301
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-field-loading-lines", children: [
|
|
3302
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-text w-60" }),
|
|
3303
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-text sm w-80" })
|
|
3304
|
+
] })
|
|
3305
|
+
] }),
|
|
3306
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-block tecof-studio-skeleton-field" })
|
|
3543
3307
|
] });
|
|
3544
3308
|
var StableInput = ({
|
|
3545
3309
|
value: externalValue,
|
|
@@ -7326,7 +7090,7 @@ var MediaDrawer = ({
|
|
|
7326
7090
|
] })
|
|
7327
7091
|
] }),
|
|
7328
7092
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-search-box", children: [
|
|
7329
|
-
/* @__PURE__ */ jsxRuntime.jsx(Search, { size: 15,
|
|
7093
|
+
/* @__PURE__ */ jsxRuntime.jsx(Search, { size: 15, className: "tecof-icon-muted" }),
|
|
7330
7094
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7331
7095
|
"input",
|
|
7332
7096
|
{
|
|
@@ -7347,11 +7111,11 @@ var MediaDrawer = ({
|
|
|
7347
7111
|
}
|
|
7348
7112
|
)
|
|
7349
7113
|
] }),
|
|
7350
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-
|
|
7351
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
7352
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
7353
|
-
] }) : filteredGallery.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-gallery-empty", children: [
|
|
7354
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-gallery-empty-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Image2, { size: 24,
|
|
7114
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-media-skeleton-grid", "aria-busy": "true", children: Array.from({ length: 8 }).map((_2, index2) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-media-skeleton-card", children: [
|
|
7115
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-block tecof-media-skeleton-thumb" }),
|
|
7116
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-text w-80" })
|
|
7117
|
+
] }, index2)) }) : filteredGallery.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-gallery-empty", children: [
|
|
7118
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-gallery-empty-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Image2, { size: 24, className: "tecof-icon-muted" }) }),
|
|
7355
7119
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-empty-heading", children: gallerySearch ? "Sonu\xE7 bulunamad\u0131" : "Hen\xFCz dosya yok" }),
|
|
7356
7120
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-empty-subheading", children: gallerySearch ? "Farkl\u0131 bir arama terimi deneyin" : "Dosyalar\u0131n\u0131z burada g\xF6r\xFCnecek" })
|
|
7357
7121
|
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-gallery-grid", children: filteredGallery.map((file2) => {
|
|
@@ -7369,10 +7133,9 @@ var MediaDrawer = ({
|
|
|
7369
7133
|
data: file2,
|
|
7370
7134
|
alt: file2.name,
|
|
7371
7135
|
size: "thumbnail",
|
|
7372
|
-
className: "tecof-upload-gallery-thumb"
|
|
7373
|
-
imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
|
|
7136
|
+
className: "tecof-upload-gallery-thumb"
|
|
7374
7137
|
}
|
|
7375
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-gallery-thumb tecof-upload-gallery-file-icon-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(File2, { size: 24,
|
|
7138
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-gallery-thumb tecof-upload-gallery-file-icon-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(File2, { size: 24, className: "tecof-icon-muted" }) }),
|
|
7376
7139
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-gallery-file-name", children: file2.meta?.originalName || file2.name })
|
|
7377
7140
|
]
|
|
7378
7141
|
},
|
|
@@ -25248,14 +25011,13 @@ var FileItemRenderer = ({
|
|
|
25248
25011
|
`${cdnUrl}/${file2.name}`;
|
|
25249
25012
|
const ext = getFileExtension(file2.name);
|
|
25250
25013
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-file-item", children: [
|
|
25251
|
-
file2.type === "image/reference" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-file-icon
|
|
25014
|
+
file2.type === "image/reference" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-file-icon is-reference", children: /* @__PURE__ */ jsxRuntime.jsx(Code, { size: 16 }) }) : isImageType2(file2.type) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
25252
25015
|
TecofPicture,
|
|
25253
25016
|
{
|
|
25254
25017
|
data: file2,
|
|
25255
25018
|
alt: file2.meta?.originalName || file2.name,
|
|
25256
25019
|
size: "thumbnail",
|
|
25257
|
-
className: "tecof-upload-file-thumb"
|
|
25258
|
-
imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "6px" }
|
|
25020
|
+
className: "tecof-upload-file-thumb"
|
|
25259
25021
|
}
|
|
25260
25022
|
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-file-icon", children: /* @__PURE__ */ jsxRuntime.jsx(File2, { size: 16 }) }),
|
|
25261
25023
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-file-info", children: [
|
|
@@ -25569,12 +25331,12 @@ var UploadField = ({
|
|
|
25569
25331
|
" Y\xFCkle"
|
|
25570
25332
|
] })
|
|
25571
25333
|
] }),
|
|
25572
|
-
showRefInput && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-ref-section",
|
|
25573
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
25574
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
25575
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => setShowRefInput(false),
|
|
25334
|
+
showRefInput && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-ref-section", children: [
|
|
25335
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-ref-header", children: [
|
|
25336
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-upload-ref-title", children: "Dinamik CMS De\u011Fi\u015Fkeni" }),
|
|
25337
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => setShowRefInput(false), className: "tecof-upload-ref-close", title: "Kapat", children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 12 }) })
|
|
25576
25338
|
] }),
|
|
25577
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
25339
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-ref-row", children: [
|
|
25578
25340
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
25579
25341
|
"input",
|
|
25580
25342
|
{
|
|
@@ -25582,7 +25344,7 @@ var UploadField = ({
|
|
|
25582
25344
|
value: refCode,
|
|
25583
25345
|
onChange: (e3) => setRefCode(e3.target.value),
|
|
25584
25346
|
placeholder: "{{ data. }}",
|
|
25585
|
-
|
|
25347
|
+
className: "tecof-upload-ref-input",
|
|
25586
25348
|
autoFocus: true,
|
|
25587
25349
|
onKeyDown: (e3) => {
|
|
25588
25350
|
if (e3.key === "Enter") {
|
|
@@ -25597,7 +25359,7 @@ var UploadField = ({
|
|
|
25597
25359
|
{
|
|
25598
25360
|
type: "button",
|
|
25599
25361
|
onClick: handleAddRef,
|
|
25600
|
-
|
|
25362
|
+
className: "tecof-upload-ref-add",
|
|
25601
25363
|
children: "Ekle"
|
|
25602
25364
|
}
|
|
25603
25365
|
)
|
|
@@ -26486,7 +26248,7 @@ var LinkField = ({
|
|
|
26486
26248
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-link-value-url", children: activeValue.url })
|
|
26487
26249
|
] }),
|
|
26488
26250
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `tecof-link-value-badge ${activeValue.type === "page" ? "tecof-link-badge-page" : "tecof-link-badge-custom"}`, children: activeValue.type === "page" ? "Sayfa" : "Link" }),
|
|
26489
|
-
activeValue.target === "_blank" && /* @__PURE__ */ jsxRuntime.jsx(ExternalLink, { size: 14,
|
|
26251
|
+
activeValue.target === "_blank" && /* @__PURE__ */ jsxRuntime.jsx(ExternalLink, { size: 14, className: "tecof-icon-muted" }),
|
|
26490
26252
|
!readOnly && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
26491
26253
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "tecof-link-action-btn-small", onClick: handleEditManual, title: "D\xFCzenle", children: /* @__PURE__ */ jsxRuntime.jsx(Pencil, { size: 14 }) }),
|
|
26492
26254
|
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "tecof-link-action-btn-small", onClick: handleClear, title: "Kald\u0131r", children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 14 }) })
|
|
@@ -26559,7 +26321,7 @@ var LinkField = ({
|
|
|
26559
26321
|
/* @__PURE__ */ jsxRuntime.jsx("button", { className: "tecof-link-drawer-close-btn", onClick: () => setDrawerOpen(false), children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 16 }) })
|
|
26560
26322
|
] }),
|
|
26561
26323
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-link-search-box", children: [
|
|
26562
|
-
/* @__PURE__ */ jsxRuntime.jsx(Search, { size: 16,
|
|
26324
|
+
/* @__PURE__ */ jsxRuntime.jsx(Search, { size: 16, className: "tecof-icon-muted" }),
|
|
26563
26325
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
26564
26326
|
"input",
|
|
26565
26327
|
{
|
|
@@ -26571,7 +26333,13 @@ var LinkField = ({
|
|
|
26571
26333
|
}
|
|
26572
26334
|
)
|
|
26573
26335
|
] }),
|
|
26574
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-
|
|
26336
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-field-loading", "aria-busy": "true", children: [0, 1, 2].map((item2) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-field-loading-row", children: [
|
|
26337
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-circle tecof-field-loading-thumb" }),
|
|
26338
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-field-loading-lines", children: [
|
|
26339
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-text w-60" }),
|
|
26340
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-text sm w-80" })
|
|
26341
|
+
] })
|
|
26342
|
+
] }, item2)) }) : filteredPages.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-text-center tecof-p-40 tecof-text-muted", children: search ? "Sonu\xE7 bulunamad\u0131" : "Hen\xFCz sayfa yok" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-link-page-list", children: filteredPages.map((page) => {
|
|
26575
26343
|
const selected = activeValue?.url === `/${page.slug}`;
|
|
26576
26344
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
26577
26345
|
"div",
|
|
@@ -26587,7 +26355,7 @@ var LinkField = ({
|
|
|
26587
26355
|
] }),
|
|
26588
26356
|
page.title && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-link-page-title", children: page.title })
|
|
26589
26357
|
] }),
|
|
26590
|
-
/* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 16,
|
|
26358
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronRight, { size: 16, className: "tecof-icon-faint" })
|
|
26591
26359
|
]
|
|
26592
26360
|
},
|
|
26593
26361
|
page._id
|
|
@@ -26738,7 +26506,7 @@ var ColorField = ({
|
|
|
26738
26506
|
"div",
|
|
26739
26507
|
{
|
|
26740
26508
|
className: `tecof-color-swatch ${focused ? "focused" : ""}`,
|
|
26741
|
-
style: { background: isValid && currentColor ? currentColor : "
|
|
26509
|
+
style: { background: isValid && currentColor ? currentColor : "var(--tecof-surface)" },
|
|
26742
26510
|
children: !readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
26743
26511
|
"input",
|
|
26744
26512
|
{
|
|
@@ -27221,9 +26989,9 @@ var CmsCollectionField = ({
|
|
|
27221
26989
|
);
|
|
27222
26990
|
}, [collections, searchQuery]);
|
|
27223
26991
|
if (loading) {
|
|
27224
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-cms-col-loading", children: [
|
|
27225
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27226
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
26992
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-cms-col-loading tecof-field-loading-compact", "aria-busy": "true", children: [
|
|
26993
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-circle" }),
|
|
26994
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-skeleton tecof-skeleton-text w-60" })
|
|
27227
26995
|
] });
|
|
27228
26996
|
}
|
|
27229
26997
|
if (error2) {
|
|
@@ -27429,9 +27197,9 @@ var createCmsCollectionField = (options = {}) => {
|
|
|
27429
27197
|
function hexToHsl(hex) {
|
|
27430
27198
|
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
27431
27199
|
if (!result) return { h: 0, s: 0, l: 0 };
|
|
27432
|
-
|
|
27433
|
-
|
|
27434
|
-
|
|
27200
|
+
const r2 = parseInt(result[1], 16) / 255;
|
|
27201
|
+
const g = parseInt(result[2], 16) / 255;
|
|
27202
|
+
const b = parseInt(result[3], 16) / 255;
|
|
27435
27203
|
const max = Math.max(r2, g, b);
|
|
27436
27204
|
const min = Math.min(r2, g, b);
|
|
27437
27205
|
let h2 = 0;
|