@tecof/theme-editor 0.0.33 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,6 +3,10 @@
3
3
  var React__default = require('react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var core = require('@puckeditor/core');
6
+ var zustand = require('zustand');
7
+ var immer = require('zustand/middleware/immer');
8
+ var nanoid = require('nanoid');
9
+ var ReactDOM = require('react-dom');
6
10
  var react = require('@tiptap/react');
7
11
  var Document = require('@tiptap/extension-document');
8
12
  var Paragraph = require('@tiptap/extension-paragraph');
@@ -21,7 +25,6 @@ var Link3 = require('@tiptap/extension-link');
21
25
  var Code2 = require('@tiptap/extension-code');
22
26
  var CodeBlock = require('@tiptap/extension-code-block');
23
27
  var Image3 = require('@tiptap/extension-image');
24
- var ReactDOM = require('react-dom');
25
28
 
26
29
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
27
30
 
@@ -44,6 +47,7 @@ function _interopNamespace(e) {
44
47
  }
45
48
 
46
49
  var React__default__namespace = /*#__PURE__*/_interopNamespace(React__default);
50
+ var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
47
51
  var Document__default = /*#__PURE__*/_interopDefault(Document);
48
52
  var Paragraph__default = /*#__PURE__*/_interopDefault(Paragraph);
49
53
  var Text__default = /*#__PURE__*/_interopDefault(Text);
@@ -60,7 +64,6 @@ var Link3__default = /*#__PURE__*/_interopDefault(Link3);
60
64
  var Code2__default = /*#__PURE__*/_interopDefault(Code2);
61
65
  var CodeBlock__default = /*#__PURE__*/_interopDefault(CodeBlock);
62
66
  var Image3__default = /*#__PURE__*/_interopDefault(Image3);
63
- var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
64
67
 
65
68
  // src/components/TecofProvider.tsx
66
69
 
@@ -333,952 +336,2531 @@ function useTecof() {
333
336
  }
334
337
  return ctx;
335
338
  }
336
- var EMPTY_PAGE = { content: [], root: { props: {} }, zones: {} };
337
- var ComponentDrawerItem = ({
338
- name: name3,
339
- apiClient,
340
- children
341
- }) => {
342
- const [imgSrc, setImgSrc] = React__default.useState(null);
343
- const [loading, setLoading] = React__default.useState(false);
344
- const [error2, setError] = React__default.useState(false);
345
- const fetchedRef = React__default.useRef(false);
346
- const handleMouseEnter = React__default.useCallback(async () => {
347
- if (fetchedRef.current) return;
348
- fetchedRef.current = true;
349
- setLoading(true);
350
- try {
351
- const domain = typeof window !== "undefined" ? window.location.hostname : "";
352
- const blobUrl = await apiClient.getComponentPreview(domain, name3);
353
- if (blobUrl) {
354
- setImgSrc(blobUrl);
355
- } else {
356
- setError(true);
357
- }
358
- } catch {
359
- setError(true);
360
- } finally {
361
- setLoading(false);
362
- }
363
- }, [name3, apiClient]);
364
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-item-group group", onMouseEnter: handleMouseEnter, children: [
365
- children,
366
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-popover", children: [
367
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-popover-header", children: [
368
- name3,
369
- " \xD6nizleme"
370
- ] }),
371
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-popover-body", children: [
372
- (loading || !imgSrc && !error2) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drawer-skeleton" }),
373
- imgSrc && /* @__PURE__ */ jsxRuntime.jsx(
374
- "img",
375
- {
376
- src: imgSrc,
377
- alt: `${name3} preview`,
378
- className: "tecof-drawer-img"
379
- }
380
- ),
381
- error2 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drawer-preview-error", children: "\xD6nizleme y\xFCklenemedi" })
382
- ] })
383
- ] })
384
- ] });
339
+
340
+ // node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
341
+ var mergeClasses = (...classes) => classes.filter((className, index2, array) => {
342
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index2;
343
+ }).join(" ").trim();
344
+
345
+ // node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.js
346
+ var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
347
+
348
+ // node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.js
349
+ var toCamelCase = (string) => string.replace(
350
+ /^([A-Z])|[\s-_]+(\w)/g,
351
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
352
+ );
353
+
354
+ // node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.js
355
+ var toPascalCase = (string) => {
356
+ const camelCase = toCamelCase(string);
357
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
385
358
  };
386
- var TecofEditor = ({
387
- pageId,
388
- config: config3,
389
- accessToken,
390
- onSave,
391
- onChange,
392
- overrides,
393
- plugins: extraPlugins,
394
- className
395
- }) => {
396
- const { apiClient, secretKey } = useTecof();
397
- const [initialData, setInitialData] = React__default.useState(null);
398
- const [loading, setLoading] = React__default.useState(true);
399
- const [saving, setSaving] = React__default.useState(false);
400
- const [saveStatus, setSaveStatus] = React__default.useState("idle");
401
- const draftDataRef = React__default.useRef(null);
402
- const isEmbedded = typeof window !== "undefined" && window.parent !== window;
403
- React__default.useEffect(() => {
404
- let cancelled = false;
405
- const load = async () => {
406
- setLoading(true);
407
- const res2 = await apiClient.getPage(pageId);
408
- if (cancelled) return;
409
- const data3 = res2.success && res2.data?.draftData ? res2.data.draftData : EMPTY_PAGE;
410
- setInitialData(data3);
411
- draftDataRef.current = data3;
412
- setLoading(false);
413
- };
414
- load();
415
- return () => {
416
- cancelled = true;
417
- };
418
- }, [pageId, apiClient]);
419
- const handleSaveDraft = React__default.useCallback(
420
- async (data3) => {
421
- const currentData = data3 || draftDataRef.current;
422
- if (!currentData) return;
423
- const draftData = currentData;
424
- setSaving(true);
425
- setSaveStatus("idle");
426
- const res2 = await apiClient.savePage(pageId, draftData, void 0, accessToken);
427
- if (res2.success) {
428
- setSaveStatus("success");
429
- setTimeout(() => setSaveStatus("idle"), 3e3);
430
- onSave?.(draftData);
431
- if (isEmbedded) window.parent.postMessage({ type: "puck:saved" }, "*");
432
- } else {
433
- setSaveStatus("error");
434
- if (isEmbedded) window.parent.postMessage({ type: "puck:saveError", message: res2.message }, "*");
435
- }
436
- setSaving(false);
437
- },
438
- [pageId, apiClient, isEmbedded, onSave, accessToken]
439
- );
440
- const handleChange = React__default.useCallback(
441
- (data3) => {
442
- draftDataRef.current = data3;
443
- const draftData = data3;
444
- onChange?.(draftData);
445
- if (isEmbedded) window.parent.postMessage({ type: "puck:changed" }, "*");
446
- },
447
- [onChange, isEmbedded]
448
- );
449
- const handlePuckPublish = React__default.useCallback(
450
- (data3) => {
451
- handleSaveDraft(data3);
452
- },
453
- [handleSaveDraft]
454
- );
455
- React__default.useEffect(() => {
456
- if (!isEmbedded) return;
457
- const onMessage = (e3) => {
458
- switch (e3.data?.type) {
459
- case "puck:save": {
460
- handleSaveDraft();
461
- break;
462
- }
463
- case "puck:undo":
464
- document.dispatchEvent(new KeyboardEvent("keydown", { key: "z", code: "KeyZ", ctrlKey: true, bubbles: true }));
465
- break;
466
- case "puck:redo":
467
- document.dispatchEvent(new KeyboardEvent("keydown", { key: "z", code: "KeyZ", ctrlKey: true, shiftKey: true, bubbles: true }));
468
- break;
469
- case "puck:viewport": {
470
- const frame = document.querySelector('[data-testid="puck-frame"]');
471
- if (frame) {
472
- const w = e3.data.width || "100%";
473
- frame.style.maxWidth = w;
474
- frame.style.margin = w === "100%" ? "0" : "0 auto";
475
- frame.style.transition = "max-width 0.3s ease";
476
- }
477
- break;
478
- }
479
- }
480
- };
481
- window.addEventListener("message", onMessage);
482
- return () => window.removeEventListener("message", onMessage);
483
- }, [isEmbedded, handleSaveDraft]);
484
- React__default.useEffect(() => {
485
- if (!isEmbedded) return;
486
- const handleClick = (e3) => {
487
- const target = e3.target;
488
- const puckComponent = target.closest("[data-puck-component]");
489
- if (puckComponent) {
490
- const componentType = puckComponent.getAttribute("data-puck-component");
491
- const draggableId = puckComponent.closest("[data-rfd-draggable-id]")?.getAttribute("data-rfd-draggable-id");
492
- window.parent.postMessage({
493
- type: "puck:itemSelected",
494
- item: {
495
- type: componentType,
496
- id: draggableId || null
497
- }
498
- }, "*");
499
- }
500
- };
501
- const handleDeselect = (e3) => {
502
- const target = e3.target;
503
- if (!target.closest("[data-puck-component]")) {
504
- window.parent.postMessage({ type: "puck:itemDeselected" }, "*");
505
- }
506
- };
507
- document.addEventListener("click", handleClick, true);
508
- document.addEventListener("click", handleDeselect, false);
509
- return () => {
510
- document.removeEventListener("click", handleClick, true);
511
- document.removeEventListener("click", handleDeselect, false);
512
- };
513
- }, [isEmbedded]);
514
- if (loading || !initialData) {
515
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `tecof-editor-loading ${className || ""}`.trim(), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-editor-loading-inner", children: [
516
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-editor-spinner" }),
517
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-editor-loading-text", children: "Loading editor..." })
518
- ] }) });
519
- }
520
- const plugins = [
521
- { ...core.blocksPlugin(), label: "Bloklar" },
522
- { ...core.outlinePlugin(), label: "Anahat" },
523
- { ...core.fieldsPlugin({ desktopSideBar: "right" }), label: "Alanlar" },
524
- ...extraPlugins || []
525
- ];
526
- const mergedOverrides = {
527
- header: () => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}),
528
- drawerItem: ({ children, name: name3 }) => {
529
- return /* @__PURE__ */ jsxRuntime.jsx(ComponentDrawerItem, { name: name3, apiClient, children });
530
- },
531
- ...overrides || {}
532
- };
533
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `tecof-editor-wrapper ${className || ""}`.trim(), children: [
534
- /* @__PURE__ */ jsxRuntime.jsx(
535
- core.Puck,
536
- {
537
- plugins,
538
- config: config3,
539
- data: initialData,
540
- onPublish: handlePuckPublish,
541
- onChange: handleChange,
542
- overrides: mergedOverrides,
543
- metadata: { editMode: true }
544
- }
545
- ),
546
- saving && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-editor-save-indicator", children: saveStatus === "error" ? "Save failed" : "Saving..." })
547
- ] });
359
+
360
+ // node_modules/lucide-react/dist/esm/defaultAttributes.js
361
+ var defaultAttributes = {
362
+ xmlns: "http://www.w3.org/2000/svg",
363
+ width: 24,
364
+ height: 24,
365
+ viewBox: "0 0 24 24",
366
+ fill: "none",
367
+ stroke: "currentColor",
368
+ strokeWidth: 2,
369
+ strokeLinecap: "round",
370
+ strokeLinejoin: "round"
548
371
  };
549
- var TecofRender = ({ data: data3, config: config3, className, cmsData }) => {
550
- if (!data3) return null;
551
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx(
552
- core.Render,
553
- {
554
- config: config3,
555
- data: data3,
556
- metadata: { cmsData: cmsData || null }
372
+
373
+ // node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.js
374
+ var hasA11yProp = (props) => {
375
+ for (const prop in props) {
376
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
377
+ return true;
557
378
  }
558
- ) });
379
+ }
380
+ return false;
559
381
  };
560
- var IMAGE_EXTENSIONS = ["png", "jpg", "jpeg", "webp", "gif", "svg", "avif", "bmp", "tiff", "heic"];
561
- var VIDEO_EXTENSIONS = ["mp4", "webm", "ogg", "avi", "mov", "quicktime"];
562
- var isImage = (type) => {
563
- if (!type) return false;
564
- const t2 = type.toLowerCase();
565
- return IMAGE_EXTENSIONS.some((ext) => t2.includes(ext)) || t2.startsWith("image/");
566
- };
567
- var isVideo = (type) => {
568
- if (!type) return false;
569
- const t2 = type.toLowerCase();
570
- return VIDEO_EXTENSIONS.some((ext) => t2.includes(ext)) || t2.startsWith("video/");
571
- };
572
- var getSizes = (size) => {
573
- switch (size) {
574
- case "thumbnail":
575
- return "(max-width: 360px) 100vw, 360px";
576
- case "medium":
577
- return "(max-width: 540px) 100vw, 540px";
578
- case "large":
579
- return "(max-width: 720px) 100vw, 720px";
580
- default:
581
- return "100vw";
382
+ var LucideContext = React__default.createContext({});
383
+ var useLucideContext = () => React__default.useContext(LucideContext);
384
+
385
+ // node_modules/lucide-react/dist/esm/Icon.js
386
+ var Icon = React__default.forwardRef(
387
+ ({ color, size, strokeWidth, absoluteStrokeWidth, className = "", children, iconNode, ...rest }, ref) => {
388
+ const {
389
+ size: contextSize = 24,
390
+ strokeWidth: contextStrokeWidth = 2,
391
+ absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,
392
+ color: contextColor = "currentColor",
393
+ className: contextClass = ""
394
+ } = useLucideContext() ?? {};
395
+ const calculatedStrokeWidth = absoluteStrokeWidth ?? contextAbsoluteStrokeWidth ? Number(strokeWidth ?? contextStrokeWidth) * 24 / Number(size ?? contextSize) : strokeWidth ?? contextStrokeWidth;
396
+ return React__default.createElement(
397
+ "svg",
398
+ {
399
+ ref,
400
+ ...defaultAttributes,
401
+ width: size ?? contextSize ?? defaultAttributes.width,
402
+ height: size ?? contextSize ?? defaultAttributes.height,
403
+ stroke: color ?? contextColor,
404
+ strokeWidth: calculatedStrokeWidth,
405
+ className: mergeClasses("lucide", contextClass, className),
406
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
407
+ ...rest
408
+ },
409
+ [
410
+ ...iconNode.map(([tag, attrs]) => React__default.createElement(tag, attrs)),
411
+ ...Array.isArray(children) ? children : [children]
412
+ ]
413
+ );
582
414
  }
415
+ );
416
+
417
+ // node_modules/lucide-react/dist/esm/createLucideIcon.js
418
+ var createLucideIcon = (iconName, iconNode) => {
419
+ const Component2 = React__default.forwardRef(
420
+ ({ className, ...props }, ref) => React__default.createElement(Icon, {
421
+ ref,
422
+ iconNode,
423
+ className: mergeClasses(
424
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
425
+ `lucide-${iconName}`,
426
+ className
427
+ ),
428
+ ...props
429
+ })
430
+ );
431
+ Component2.displayName = toPascalCase(iconName);
432
+ return Component2;
583
433
  };
584
- var DEFAULT_BLUR_DATA_URL = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiNmM2Y0ZjYiLz48L3N2Zz4=";
585
- var TecofPicture = React__default.memo(({
586
- data: data3,
587
- alt = null,
588
- size = "full",
589
- loading = "lazy",
590
- fill = false,
591
- style,
592
- imgStyle,
593
- className,
594
- imgClassName,
595
- width,
596
- height,
597
- usePlaceholder = true,
598
- blurDataURL = DEFAULT_BLUR_DATA_URL,
599
- fancybox = false,
600
- fancyboxName = "gallery",
601
- ImageComponent,
602
- imageProps = {}
603
- }) => {
604
- const { apiClient } = useTecof();
605
- const cdnUrl = apiClient.cdnUrl;
606
- if (!data3) return null;
607
- const buildPath = (fileName) => data3?.folder && data3.folder !== "/" ? `${data3.folder.replace(/^\//, "")}/${fileName}` : fileName;
608
- const isExternal = data3?.type === "external" || data3?.provider === "external";
609
- const fileURL = isExternal ? data3?.url || "" : `${cdnUrl}/${buildPath(data3?.name)}`;
610
- const isImageType3 = isExternal ? true : isImage(data3?.type);
611
- const isVideoType = isExternal ? false : isVideo(data3?.type);
612
- if (!fileURL) return null;
613
- const imgWidth = width || data3?.meta?.width || 500;
614
- const imgHeight = height || data3?.meta?.height || 500;
615
- const sizes = getSizes(size);
616
- const renderVideo = () => /* @__PURE__ */ jsxRuntime.jsx(
617
- "video",
434
+
435
+ // node_modules/lucide-react/dist/esm/icons/arrow-down.js
436
+ var __iconNode = [
437
+ ["path", { d: "M12 5v14", key: "s699le" }],
438
+ ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
439
+ ];
440
+ var ArrowDown = createLucideIcon("arrow-down", __iconNode);
441
+
442
+ // node_modules/lucide-react/dist/esm/icons/arrow-up.js
443
+ var __iconNode2 = [
444
+ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
445
+ ["path", { d: "M12 19V5", key: "x0mq9r" }]
446
+ ];
447
+ var ArrowUp = createLucideIcon("arrow-up", __iconNode2);
448
+
449
+ // node_modules/lucide-react/dist/esm/icons/check.js
450
+ var __iconNode3 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
451
+ var Check = createLucideIcon("check", __iconNode3);
452
+
453
+ // node_modules/lucide-react/dist/esm/icons/chevron-down.js
454
+ var __iconNode4 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
455
+ var ChevronDown = createLucideIcon("chevron-down", __iconNode4);
456
+
457
+ // node_modules/lucide-react/dist/esm/icons/chevron-right.js
458
+ var __iconNode5 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
459
+ var ChevronRight = createLucideIcon("chevron-right", __iconNode5);
460
+
461
+ // node_modules/lucide-react/dist/esm/icons/chevron-up.js
462
+ var __iconNode6 = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
463
+ var ChevronUp = createLucideIcon("chevron-up", __iconNode6);
464
+
465
+ // node_modules/lucide-react/dist/esm/icons/code.js
466
+ var __iconNode7 = [
467
+ ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
468
+ ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
469
+ ];
470
+ var Code = createLucideIcon("code", __iconNode7);
471
+
472
+ // node_modules/lucide-react/dist/esm/icons/copy.js
473
+ var __iconNode8 = [
474
+ ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
475
+ ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
476
+ ];
477
+ var Copy = createLucideIcon("copy", __iconNode8);
478
+
479
+ // node_modules/lucide-react/dist/esm/icons/database.js
480
+ var __iconNode9 = [
481
+ ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
482
+ ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
483
+ ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
484
+ ];
485
+ var Database = createLucideIcon("database", __iconNode9);
486
+
487
+ // node_modules/lucide-react/dist/esm/icons/external-link.js
488
+ var __iconNode10 = [
489
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
490
+ ["path", { d: "M10 14 21 3", key: "gplh6r" }],
491
+ ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
492
+ ];
493
+ var ExternalLink = createLucideIcon("external-link", __iconNode10);
494
+
495
+ // node_modules/lucide-react/dist/esm/icons/file-text.js
496
+ var __iconNode11 = [
497
+ [
498
+ "path",
618
499
  {
619
- src: fileURL,
620
- autoPlay: true,
621
- loop: true,
622
- muted: true,
623
- playsInline: true,
624
- className: `tecof-picture-video ${imgClassName || ""}`.trim(),
625
- style: imgStyle
500
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
501
+ key: "1oefj6"
626
502
  }
627
- );
628
- const renderImg = () => {
629
- const baseImgClass = fill ? "tecof-picture-img-fill" : "tecof-picture-img";
630
- const computedImgClass = `${baseImgClass} ${imgClassName || ""}`.trim();
631
- const altText = alt || data3?.name || "Image";
632
- const commonProps = {
633
- src: fileURL,
634
- alt: altText,
635
- loading,
636
- sizes,
637
- className: computedImgClass,
638
- style: imgStyle
639
- };
640
- if (ImageComponent) {
641
- return /* @__PURE__ */ jsxRuntime.jsx(
642
- ImageComponent,
503
+ ],
504
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
505
+ ["path", { d: "M10 9H8", key: "b1mrlr" }],
506
+ ["path", { d: "M16 13H8", key: "t4e002" }],
507
+ ["path", { d: "M16 17H8", key: "z1uh3a" }]
508
+ ];
509
+ var FileText = createLucideIcon("file-text", __iconNode11);
510
+
511
+ // node_modules/lucide-react/dist/esm/icons/file.js
512
+ var __iconNode12 = [
513
+ [
514
+ "path",
515
+ {
516
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
517
+ key: "1oefj6"
518
+ }
519
+ ],
520
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
521
+ ];
522
+ var File2 = createLucideIcon("file", __iconNode12);
523
+
524
+ // node_modules/lucide-react/dist/esm/icons/folder-open.js
525
+ var __iconNode13 = [
526
+ [
527
+ "path",
528
+ {
529
+ d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",
530
+ key: "usdka0"
531
+ }
532
+ ]
533
+ ];
534
+ var FolderOpen = createLucideIcon("folder-open", __iconNode13);
535
+
536
+ // node_modules/lucide-react/dist/esm/icons/globe.js
537
+ var __iconNode14 = [
538
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
539
+ ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
540
+ ["path", { d: "M2 12h20", key: "9i4pu4" }]
541
+ ];
542
+ var Globe = createLucideIcon("globe", __iconNode14);
543
+
544
+ // node_modules/lucide-react/dist/esm/icons/grip-vertical.js
545
+ var __iconNode15 = [
546
+ ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
547
+ ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
548
+ ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
549
+ ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
550
+ ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
551
+ ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
552
+ ];
553
+ var GripVertical = createLucideIcon("grip-vertical", __iconNode15);
554
+
555
+ // node_modules/lucide-react/dist/esm/icons/image-plus.js
556
+ var __iconNode16 = [
557
+ ["path", { d: "M16 5h6", key: "1vod17" }],
558
+ ["path", { d: "M19 2v6", key: "4bpg5p" }],
559
+ ["path", { d: "M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5", key: "1ue2ih" }],
560
+ ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }],
561
+ ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }]
562
+ ];
563
+ var ImagePlus = createLucideIcon("image-plus", __iconNode16);
564
+
565
+ // node_modules/lucide-react/dist/esm/icons/image.js
566
+ var __iconNode17 = [
567
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
568
+ ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
569
+ ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
570
+ ];
571
+ var Image2 = createLucideIcon("image", __iconNode17);
572
+
573
+ // node_modules/lucide-react/dist/esm/icons/languages.js
574
+ var __iconNode18 = [
575
+ ["path", { d: "m5 8 6 6", key: "1wu5hv" }],
576
+ ["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
577
+ ["path", { d: "M2 5h12", key: "or177f" }],
578
+ ["path", { d: "M7 2h1", key: "1t2jsx" }],
579
+ ["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
580
+ ["path", { d: "M14 18h6", key: "1m8k6r" }]
581
+ ];
582
+ var Languages = createLucideIcon("languages", __iconNode18);
583
+
584
+ // node_modules/lucide-react/dist/esm/icons/link-2.js
585
+ var __iconNode19 = [
586
+ ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
587
+ ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
588
+ ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
589
+ ];
590
+ var Link2 = createLucideIcon("link-2", __iconNode19);
591
+
592
+ // node_modules/lucide-react/dist/esm/icons/link.js
593
+ var __iconNode20 = [
594
+ ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
595
+ ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
596
+ ];
597
+ var Link = createLucideIcon("link", __iconNode20);
598
+
599
+ // node_modules/lucide-react/dist/esm/icons/loader-circle.js
600
+ var __iconNode21 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
601
+ var LoaderCircle = createLucideIcon("loader-circle", __iconNode21);
602
+
603
+ // node_modules/lucide-react/dist/esm/icons/pencil.js
604
+ var __iconNode22 = [
605
+ [
606
+ "path",
607
+ {
608
+ d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
609
+ key: "1a8usu"
610
+ }
611
+ ],
612
+ ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
613
+ ];
614
+ var Pencil = createLucideIcon("pencil", __iconNode22);
615
+
616
+ // node_modules/lucide-react/dist/esm/icons/plus.js
617
+ var __iconNode23 = [
618
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
619
+ ["path", { d: "M12 5v14", key: "s699le" }]
620
+ ];
621
+ var Plus = createLucideIcon("plus", __iconNode23);
622
+
623
+ // node_modules/lucide-react/dist/esm/icons/refresh-ccw.js
624
+ var __iconNode24 = [
625
+ ["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
626
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
627
+ ["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
628
+ ["path", { d: "M16 16h5v5", key: "ccwih5" }]
629
+ ];
630
+ var RefreshCcw = createLucideIcon("refresh-ccw", __iconNode24);
631
+
632
+ // node_modules/lucide-react/dist/esm/icons/refresh-cw.js
633
+ var __iconNode25 = [
634
+ ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
635
+ ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
636
+ ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
637
+ ["path", { d: "M8 16H3v5", key: "1cv678" }]
638
+ ];
639
+ var RefreshCw = createLucideIcon("refresh-cw", __iconNode25);
640
+
641
+ // node_modules/lucide-react/dist/esm/icons/rotate-ccw.js
642
+ var __iconNode26 = [
643
+ ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
644
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
645
+ ];
646
+ var RotateCcw = createLucideIcon("rotate-ccw", __iconNode26);
647
+
648
+ // node_modules/lucide-react/dist/esm/icons/search.js
649
+ var __iconNode27 = [
650
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
651
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
652
+ ];
653
+ var Search = createLucideIcon("search", __iconNode27);
654
+
655
+ // node_modules/lucide-react/dist/esm/icons/trash-2.js
656
+ var __iconNode28 = [
657
+ ["path", { d: "M10 11v6", key: "nco0om" }],
658
+ ["path", { d: "M14 11v6", key: "outv1u" }],
659
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
660
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
661
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
662
+ ];
663
+ var Trash2 = createLucideIcon("trash-2", __iconNode28);
664
+
665
+ // node_modules/lucide-react/dist/esm/icons/upload.js
666
+ var __iconNode29 = [
667
+ ["path", { d: "M12 3v12", key: "1x0j5s" }],
668
+ ["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }],
669
+ ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }]
670
+ ];
671
+ var Upload = createLucideIcon("upload", __iconNode29);
672
+
673
+ // node_modules/lucide-react/dist/esm/icons/x.js
674
+ var __iconNode30 = [
675
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
676
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
677
+ ];
678
+ var X = createLucideIcon("x", __iconNode30);
679
+ var EMPTY_PAGE = { content: [], root: { props: {} }, zones: {} };
680
+ var DrawerSearchContext = React__default.createContext(null);
681
+ var ComponentDrawerItem = ({
682
+ name: name3,
683
+ apiClient,
684
+ children
685
+ }) => {
686
+ const [imgSrc, setImgSrc] = React__default.useState(null);
687
+ const [loading, setLoading] = React__default.useState(false);
688
+ const [error2, setError] = React__default.useState(false);
689
+ const fetchedRef = React__default.useRef(false);
690
+ const handleMouseEnter = React__default.useCallback(async () => {
691
+ if (fetchedRef.current) return;
692
+ fetchedRef.current = true;
693
+ setLoading(true);
694
+ try {
695
+ const domain = typeof window !== "undefined" ? window.location.hostname : "";
696
+ const blobUrl = await apiClient.getComponentPreview(domain, name3);
697
+ if (blobUrl) {
698
+ setImgSrc(blobUrl);
699
+ } else {
700
+ setError(true);
701
+ }
702
+ } catch {
703
+ setError(true);
704
+ } finally {
705
+ setLoading(false);
706
+ }
707
+ }, [name3, apiClient]);
708
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-item-group group", onMouseEnter: handleMouseEnter, children: [
709
+ children,
710
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-popover", children: [
711
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-popover-header", children: [
712
+ name3,
713
+ " \xD6nizleme"
714
+ ] }),
715
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-popover-body", children: [
716
+ (loading || !imgSrc && !error2) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drawer-skeleton" }),
717
+ imgSrc && /* @__PURE__ */ jsxRuntime.jsx(
718
+ "img",
719
+ {
720
+ src: imgSrc,
721
+ alt: `${name3} preview`,
722
+ className: "tecof-drawer-img"
723
+ }
724
+ ),
725
+ error2 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drawer-preview-error", children: "\xD6nizleme y\xFCklenemedi" })
726
+ ] })
727
+ ] })
728
+ ] });
729
+ };
730
+ var CustomDrawer = ({ children }) => {
731
+ const context = React__default.useContext(DrawerSearchContext);
732
+ if (!context) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drawer-list-layout", children });
733
+ const { searchQuery, setSearchQuery } = context;
734
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-wrapper-layout", children: [
735
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drawer-search-wrapper", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-drawer-search-box", children: [
736
+ /* @__PURE__ */ jsxRuntime.jsx(Search, { size: 14, color: "#71717a" }),
737
+ /* @__PURE__ */ jsxRuntime.jsx(
738
+ "input",
643
739
  {
644
- ...commonProps,
645
- width: fill ? void 0 : imgWidth,
646
- height: fill ? void 0 : imgHeight,
647
- ...fill ? { fill: true } : {},
648
- ...imageProps
740
+ type: "text",
741
+ placeholder: "Blok ara...",
742
+ value: searchQuery,
743
+ onChange: (e3) => setSearchQuery(e3.target.value),
744
+ className: "tecof-drawer-search-input"
649
745
  }
650
- );
651
- }
652
- return /* @__PURE__ */ jsxRuntime.jsx(
653
- "img",
654
- {
655
- ...commonProps,
656
- width: fill ? void 0 : imgWidth,
657
- height: fill ? void 0 : imgHeight
658
- }
659
- );
660
- };
661
- const containerClassName = `tecof-picture-wrapper ${fill ? "fill" : ""} ${className || ""}`.trim();
662
- if (fancybox && (isImageType3 || isVideoType)) {
663
- return /* @__PURE__ */ jsxRuntime.jsx(
664
- "a",
665
- {
666
- "data-fancybox": fancyboxName,
667
- href: fileURL,
668
- style: { display: "block", textDecoration: "none" },
669
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { style, className: containerClassName, children: isVideoType ? renderVideo() : renderImg() })
670
- }
671
- );
672
- }
673
- if (isVideoType) {
674
- return /* @__PURE__ */ jsxRuntime.jsx("div", { style, className: containerClassName, children: renderVideo() });
746
+ ),
747
+ searchQuery && /* @__PURE__ */ jsxRuntime.jsx(
748
+ "button",
749
+ {
750
+ type: "button",
751
+ onClick: () => setSearchQuery(""),
752
+ className: "tecof-drawer-clear-btn",
753
+ title: "Temizle",
754
+ children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 14 })
755
+ }
756
+ )
757
+ ] }) }),
758
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-drawer-list-layout", children })
759
+ ] });
760
+ };
761
+ var CustomDrawerItem = ({ children, name: name3 }) => {
762
+ const context = React__default.useContext(DrawerSearchContext);
763
+ const { apiClient } = useTecof();
764
+ if (!context) {
765
+ return /* @__PURE__ */ jsxRuntime.jsx(ComponentDrawerItem, { name: name3, apiClient, children });
675
766
  }
676
- if (isImageType3) {
677
- return /* @__PURE__ */ jsxRuntime.jsx("div", { style, className: containerClassName, children: renderImg() });
767
+ const { searchQuery, config: config3 } = context;
768
+ const componentConfig = config3.components?.[name3];
769
+ const label = componentConfig?.label || name3;
770
+ if (searchQuery.trim()) {
771
+ const query = searchQuery.toLowerCase();
772
+ const matchesName = name3.toLowerCase().includes(query);
773
+ const matchesLabel = label.toLowerCase().includes(query);
774
+ if (!matchesName && !matchesLabel) {
775
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
776
+ }
678
777
  }
778
+ return /* @__PURE__ */ jsxRuntime.jsx(ComponentDrawerItem, { name: name3, apiClient, children });
779
+ };
780
+ var AutoFieldsOnSelect = () => {
781
+ const { selectedItem, dispatch } = core.usePuck();
782
+ const prevSelectedRef = React__default.useRef(null);
783
+ React__default.useEffect(() => {
784
+ const currentId = selectedItem?.props?.id || null;
785
+ if (currentId && currentId !== prevSelectedRef.current) {
786
+ dispatch({
787
+ type: "setUi",
788
+ ui: { plugin: { current: "fields" } }
789
+ });
790
+ }
791
+ prevSelectedRef.current = currentId;
792
+ }, [selectedItem, dispatch]);
679
793
  return null;
680
- });
681
- TecofPicture.displayName = "TecofPicture";
682
- var UnderConstruction = ({
683
- title,
684
- description,
685
- subtitle,
686
- logoUrl,
687
- accentColor = "#2563eb"
688
- // Default elegant blue
689
- }) => {
690
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-uc-wrapper", children: [
691
- /* @__PURE__ */ jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: `
692
- .tecof-uc-wrapper {
693
- min-height: 100vh;
694
- display: flex;
695
- align-items: center;
696
- justify-content: center;
697
- background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
698
- radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
699
- #090d16;
700
- color: #f8fafc;
701
- font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
702
- padding: 2rem 1rem;
703
- box-sizing: border-box;
704
- position: relative;
705
- overflow: hidden;
706
- }
707
-
708
- /* Ambient glowing circles */
709
- .tecof-uc-glow-1 {
710
- position: absolute;
711
- top: 20%;
712
- left: 50%;
713
- transform: translate(-50%, -50%);
714
- width: 500px;
715
- height: 500px;
716
- background: ${accentColor};
717
- filter: blur(150px);
718
- opacity: 0.12;
719
- pointer-events: none;
720
- z-index: 1;
721
- border-radius: 50%;
722
- animation: tecof-uc-pulse 8s infinite alternate ease-in-out;
794
+ };
795
+ var CustomActionBar = ({ children, label }) => {
796
+ const { appState, dispatch, getSelectorForId, selectedItem } = core.usePuck();
797
+ const canMoveUp = React__default.useMemo(() => {
798
+ if (!selectedItem || !selectedItem.props?.id) return false;
799
+ const selector = getSelectorForId(selectedItem.props.id);
800
+ if (!selector) return false;
801
+ return selector.index > 0;
802
+ }, [selectedItem, getSelectorForId]);
803
+ const canMoveDown = React__default.useMemo(() => {
804
+ if (!selectedItem || !selectedItem.props?.id) return false;
805
+ const selector = getSelectorForId(selectedItem.props.id);
806
+ if (!selector) return false;
807
+ const { index: index2, zone } = selector;
808
+ const items = zone ? appState.data.zones?.[zone] || [] : appState.data.content || [];
809
+ return index2 < items.length - 1;
810
+ }, [selectedItem, getSelectorForId, appState.data]);
811
+ const handleMove = React__default.useCallback((direction) => {
812
+ if (!selectedItem || !selectedItem.props?.id) return;
813
+ const selector = getSelectorForId(selectedItem.props.id);
814
+ if (!selector) return;
815
+ const { index: index2, zone } = selector;
816
+ let items = zone ? [...appState.data.zones?.[zone] || []] : [...appState.data.content || []];
817
+ const targetIndex = direction === "up" ? index2 - 1 : index2 + 1;
818
+ if (targetIndex < 0 || targetIndex >= items.length) return;
819
+ const temp = items[index2];
820
+ items[index2] = items[targetIndex];
821
+ items[targetIndex] = temp;
822
+ if (zone) {
823
+ dispatch({
824
+ type: "setData",
825
+ data: {
826
+ ...appState.data,
827
+ zones: {
828
+ ...appState.data.zones,
829
+ [zone]: items
830
+ }
723
831
  }
724
-
725
- .tecof-uc-container {
726
- position: relative;
727
- z-index: 2;
728
- max-width: 540px;
729
- width: 100%;
730
- background: rgba(17, 24, 39, 0.55);
731
- backdrop-filter: blur(20px);
732
- -webkit-backdrop-filter: blur(20px);
733
- border: 1px solid rgba(255, 255, 255, 0.08);
734
- border-radius: 24px;
735
- padding: 3.5rem 2.5rem;
736
- text-align: center;
737
- box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
738
- inset 0 1px 0 rgba(255, 255, 255, 0.1);
739
- animation: tecof-uc-fade-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
832
+ });
833
+ dispatch({
834
+ type: "setUi",
835
+ ui: {
836
+ itemSelector: {
837
+ index: targetIndex,
838
+ zone
839
+ }
740
840
  }
741
-
742
- .tecof-uc-logo-area {
743
- margin-bottom: 2.5rem;
744
- display: flex;
745
- justify-content: center;
746
- align-items: center;
841
+ });
842
+ } else {
843
+ dispatch({
844
+ type: "setData",
845
+ data: {
846
+ ...appState.data,
847
+ content: items
747
848
  }
748
-
749
- .tecof-uc-logo {
750
- max-height: 56px;
751
- max-width: 200px;
752
- object-fit: contain;
753
- filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
849
+ });
850
+ dispatch({
851
+ type: "setUi",
852
+ ui: {
853
+ itemSelector: {
854
+ index: targetIndex
855
+ }
754
856
  }
755
-
756
- .tecof-uc-logo-fallback {
757
- font-size: 1.5rem;
758
- font-weight: 700;
759
- letter-spacing: -0.025em;
760
- background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
761
- -webkit-background-clip: text;
762
- -webkit-text-fill-color: transparent;
857
+ });
858
+ }
859
+ }, [selectedItem, getSelectorForId, appState.data, dispatch]);
860
+ return /* @__PURE__ */ jsxRuntime.jsx(core.ActionBar, { label, children: /* @__PURE__ */ jsxRuntime.jsxs(core.ActionBar.Group, { children: [
861
+ /* @__PURE__ */ jsxRuntime.jsx(core.ActionBar.Action, { onClick: () => handleMove("up"), disabled: !canMoveUp, label: "Yukar\u0131 Ta\u015F\u0131", children: /* @__PURE__ */ jsxRuntime.jsx(ArrowUp, { size: 14 }) }),
862
+ /* @__PURE__ */ jsxRuntime.jsx(core.ActionBar.Action, { onClick: () => handleMove("down"), disabled: !canMoveDown, label: "A\u015Fa\u011F\u0131 Ta\u015F\u0131", children: /* @__PURE__ */ jsxRuntime.jsx(ArrowDown, { size: 14 }) }),
863
+ /* @__PURE__ */ jsxRuntime.jsx(core.ActionBar.Separator, {}),
864
+ children
865
+ ] }) });
866
+ };
867
+ var TecofEditor = ({
868
+ pageId,
869
+ config: config3,
870
+ accessToken,
871
+ onSave,
872
+ onChange,
873
+ overrides,
874
+ plugins: extraPlugins,
875
+ className
876
+ }) => {
877
+ const { apiClient, secretKey } = useTecof();
878
+ const [initialData, setInitialData] = React__default.useState(null);
879
+ const [loading, setLoading] = React__default.useState(true);
880
+ const [saving, setSaving] = React__default.useState(false);
881
+ const [saveStatus, setSaveStatus] = React__default.useState("idle");
882
+ const [searchQuery, setSearchQuery] = React__default.useState("");
883
+ const draftDataRef = React__default.useRef(null);
884
+ const isEmbedded = typeof window !== "undefined" && window.parent !== window;
885
+ React__default.useEffect(() => {
886
+ let cancelled = false;
887
+ const load = async () => {
888
+ setLoading(true);
889
+ const res2 = await apiClient.getPage(pageId);
890
+ if (cancelled) return;
891
+ const data3 = res2.success && res2.data?.draftData ? res2.data.draftData : EMPTY_PAGE;
892
+ setInitialData(data3);
893
+ draftDataRef.current = data3;
894
+ setLoading(false);
895
+ };
896
+ load();
897
+ return () => {
898
+ cancelled = true;
899
+ };
900
+ }, [pageId, apiClient]);
901
+ const handleSaveDraft = React__default.useCallback(
902
+ async (data3) => {
903
+ const currentData = data3 || draftDataRef.current;
904
+ if (!currentData) return;
905
+ const draftData = currentData;
906
+ setSaving(true);
907
+ setSaveStatus("idle");
908
+ const res2 = await apiClient.savePage(pageId, draftData, void 0, accessToken);
909
+ if (res2.success) {
910
+ setSaveStatus("success");
911
+ setTimeout(() => setSaveStatus("idle"), 3e3);
912
+ onSave?.(draftData);
913
+ if (isEmbedded) window.parent.postMessage({ type: "puck:saved" }, "*");
914
+ } else {
915
+ setSaveStatus("error");
916
+ if (isEmbedded) window.parent.postMessage({ type: "puck:saveError", message: res2.message }, "*");
917
+ }
918
+ setSaving(false);
919
+ },
920
+ [pageId, apiClient, isEmbedded, onSave, accessToken]
921
+ );
922
+ const handleChange = React__default.useCallback(
923
+ (data3) => {
924
+ draftDataRef.current = data3;
925
+ const draftData = data3;
926
+ onChange?.(draftData);
927
+ if (isEmbedded) window.parent.postMessage({ type: "puck:changed" }, "*");
928
+ },
929
+ [onChange, isEmbedded]
930
+ );
931
+ const handlePuckPublish = React__default.useCallback(
932
+ (data3) => {
933
+ handleSaveDraft(data3);
934
+ },
935
+ [handleSaveDraft]
936
+ );
937
+ React__default.useEffect(() => {
938
+ if (!isEmbedded) return;
939
+ const onMessage = (e3) => {
940
+ switch (e3.data?.type) {
941
+ case "puck:save": {
942
+ handleSaveDraft();
943
+ break;
763
944
  }
764
-
765
- .tecof-uc-icon-wrapper {
766
- width: 80px;
767
- height: 80px;
768
- border-radius: 20px;
769
- background: rgba(255, 255, 255, 0.03);
770
- border: 1px solid rgba(255, 255, 255, 0.08);
771
- display: flex;
772
- align-items: center;
773
- justify-content: center;
774
- margin: 0 auto 2.2rem auto;
775
- color: ${accentColor};
776
- box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
777
- position: relative;
945
+ case "puck:undo":
946
+ document.dispatchEvent(new KeyboardEvent("keydown", { key: "z", code: "KeyZ", ctrlKey: true, bubbles: true }));
947
+ break;
948
+ case "puck:redo":
949
+ document.dispatchEvent(new KeyboardEvent("keydown", { key: "z", code: "KeyZ", ctrlKey: true, shiftKey: true, bubbles: true }));
950
+ break;
951
+ case "puck:viewport": {
952
+ const frame = document.querySelector('[data-testid="puck-frame"]');
953
+ if (frame) {
954
+ const w = e3.data.width || "100%";
955
+ frame.style.maxWidth = w;
956
+ frame.style.margin = w === "100%" ? "0" : "0 auto";
957
+ frame.style.transition = "max-width 0.3s ease";
958
+ }
959
+ break;
778
960
  }
961
+ }
962
+ };
963
+ window.addEventListener("message", onMessage);
964
+ return () => window.removeEventListener("message", onMessage);
965
+ }, [isEmbedded, handleSaveDraft]);
966
+ React__default.useEffect(() => {
967
+ if (!isEmbedded) return;
968
+ const handleClick = (e3) => {
969
+ const target = e3.target;
970
+ const puckComponent = target.closest("[data-puck-component]");
971
+ if (puckComponent) {
972
+ const componentType = puckComponent.getAttribute("data-puck-component");
973
+ const draggableId = puckComponent.closest("[data-rfd-draggable-id]")?.getAttribute("data-rfd-draggable-id");
974
+ window.parent.postMessage({
975
+ type: "puck:itemSelected",
976
+ item: {
977
+ type: componentType,
978
+ id: draggableId || null
979
+ }
980
+ }, "*");
981
+ }
982
+ };
983
+ const handleDeselect = (e3) => {
984
+ const target = e3.target;
985
+ if (!target.closest("[data-puck-component]")) {
986
+ window.parent.postMessage({ type: "puck:itemDeselected" }, "*");
987
+ }
988
+ };
989
+ document.addEventListener("click", handleClick, true);
990
+ document.addEventListener("click", handleDeselect, false);
991
+ return () => {
992
+ document.removeEventListener("click", handleClick, true);
993
+ document.removeEventListener("click", handleDeselect, false);
994
+ };
995
+ }, [isEmbedded]);
996
+ const searchContextValue = React__default.useMemo(() => ({
997
+ searchQuery,
998
+ setSearchQuery,
999
+ config: config3
1000
+ }), [searchQuery, config3]);
1001
+ const plugins = React__default.useMemo(() => [
1002
+ { ...core.blocksPlugin(), label: "Bloklar" },
1003
+ { ...core.outlinePlugin(), label: "Anahat" },
1004
+ { ...core.fieldsPlugin({ desktopSideBar: "right" }), label: "Alanlar" },
1005
+ ...extraPlugins || []
1006
+ ], [extraPlugins]);
1007
+ const mergedOverrides = React__default.useMemo(() => {
1008
+ return {
1009
+ header: () => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}),
1010
+ drawer: CustomDrawer,
1011
+ drawerItem: CustomDrawerItem,
1012
+ actionBar: ({ children, label }) => {
1013
+ return /* @__PURE__ */ jsxRuntime.jsx(CustomActionBar, { label, children });
1014
+ },
1015
+ puck: ({ children }) => {
1016
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1017
+ /* @__PURE__ */ jsxRuntime.jsx(AutoFieldsOnSelect, {}),
1018
+ children
1019
+ ] });
1020
+ },
1021
+ ...overrides || {}
1022
+ };
1023
+ }, [overrides]);
1024
+ if (loading || !initialData) {
1025
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `tecof-editor-loading ${className || ""}`.trim(), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-editor-loading-inner", children: [
1026
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-editor-spinner" }),
1027
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-editor-loading-text", children: "Loading editor..." })
1028
+ ] }) });
1029
+ }
1030
+ return /* @__PURE__ */ jsxRuntime.jsx(DrawerSearchContext.Provider, { value: searchContextValue, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `tecof-editor-wrapper ${className || ""}`.trim(), children: [
1031
+ /* @__PURE__ */ jsxRuntime.jsx(
1032
+ core.Puck,
1033
+ {
1034
+ plugins,
1035
+ config: config3,
1036
+ data: initialData,
1037
+ onPublish: handlePuckPublish,
1038
+ onChange: handleChange,
1039
+ overrides: mergedOverrides,
1040
+ metadata: { editMode: true }
1041
+ }
1042
+ ),
1043
+ saving && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-editor-save-indicator", children: saveStatus === "error" ? "Save failed" : "Saving..." })
1044
+ ] }) });
1045
+ };
779
1046
 
780
- .tecof-uc-icon-glow {
781
- position: absolute;
782
- inset: -2px;
783
- border-radius: 22px;
784
- background: linear-gradient(135deg, ${accentColor}, transparent);
785
- opacity: 0.3;
786
- z-index: -1;
787
- filter: blur(4px);
788
- }
1047
+ // src/engine/document.ts
1048
+ var EMPTY_DOCUMENT = {
1049
+ root: { props: {} },
1050
+ content: [],
1051
+ zones: {}
1052
+ };
1053
+ var parseDocument = (rawData) => {
1054
+ if (!rawData) return { ...EMPTY_DOCUMENT };
1055
+ return {
1056
+ root: rawData.root || { props: {} },
1057
+ content: rawData.content || [],
1058
+ zones: rawData.zones || {}
1059
+ };
1060
+ };
1061
+ var serializeDocument = (doc) => {
1062
+ return {
1063
+ root: doc.root,
1064
+ content: doc.content,
1065
+ zones: doc.zones
1066
+ };
1067
+ };
789
1068
 
790
- .tecof-uc-icon-wrapper svg {
791
- width: 36px;
792
- height: 36px;
793
- stroke-width: 1.5;
794
- animation: tecof-uc-float 4s ease-in-out infinite;
795
- }
1069
+ // src/engine/zones.ts
1070
+ var parseZoneKey = (zoneKey) => {
1071
+ const parts = zoneKey.split(":");
1072
+ return {
1073
+ parentId: parts[0],
1074
+ slotName: parts[1] || "default"
1075
+ };
1076
+ };
1077
+ var findNodeById = (doc, id) => {
1078
+ for (let i2 = 0; i2 < doc.content.length; i2++) {
1079
+ if (doc.content[i2].props.id === id) {
1080
+ return { node: doc.content[i2], path: { index: i2 } };
1081
+ }
1082
+ }
1083
+ for (const [zoneKey, items] of Object.entries(doc.zones)) {
1084
+ for (let i2 = 0; i2 < items.length; i2++) {
1085
+ if (items[i2].props.id === id) {
1086
+ return { node: items[i2], path: { zoneKey, index: i2 } };
1087
+ }
1088
+ }
1089
+ }
1090
+ return null;
1091
+ };
1092
+ var getDescendantZoneKeys = (zones, nodeId, acc = []) => {
1093
+ const prefix = `${nodeId}:`;
1094
+ for (const zoneKey of Object.keys(zones)) {
1095
+ if (zoneKey.startsWith(prefix)) {
1096
+ acc.push(zoneKey);
1097
+ for (const child of zones[zoneKey]) {
1098
+ getDescendantZoneKeys(zones, child.props.id, acc);
1099
+ }
1100
+ }
1101
+ }
1102
+ return acc;
1103
+ };
1104
+ var getParentId = (doc, id) => {
1105
+ const res2 = findNodeById(doc, id);
1106
+ if (!res2 || !res2.path.zoneKey) return null;
1107
+ return parseZoneKey(res2.path.zoneKey).parentId;
1108
+ };
1109
+ var getBreadcrumbs = (doc, id) => {
1110
+ const crumbs = [];
1111
+ let currentId = id;
1112
+ while (currentId) {
1113
+ const res2 = findNodeById(doc, currentId);
1114
+ if (!res2) break;
1115
+ crumbs.unshift({ id: currentId, type: res2.node.type });
1116
+ currentId = res2.path.zoneKey ? parseZoneKey(res2.path.zoneKey).parentId : null;
1117
+ }
1118
+ return crumbs;
1119
+ };
1120
+ var generateId = () => nanoid.nanoid(8);
1121
+ var remapNodeIds = (node, sourceZones, idMap = /* @__PURE__ */ new Map()) => {
1122
+ const oldId = node.props.id;
1123
+ const newId = generateId();
1124
+ idMap.set(oldId, newId);
1125
+ const remappedNode = {
1126
+ ...node,
1127
+ props: {
1128
+ ...node.props,
1129
+ id: newId
1130
+ }
1131
+ };
1132
+ const newZones = {};
1133
+ const prefix = `${oldId}:`;
1134
+ for (const [zoneKey, zoneItems] of Object.entries(sourceZones)) {
1135
+ if (zoneKey.startsWith(prefix)) {
1136
+ const slotName = zoneKey.split(":")[1];
1137
+ const newZoneKey = `${newId}:${slotName}`;
1138
+ const newZoneItems = [];
1139
+ for (const item2 of zoneItems) {
1140
+ const { remappedNode: childNode, newZones: childZones } = remapNodeIds(item2, sourceZones, idMap);
1141
+ newZoneItems.push(childNode);
1142
+ Object.assign(newZones, childZones);
1143
+ }
1144
+ newZones[newZoneKey] = newZoneItems;
1145
+ }
1146
+ }
1147
+ return { remappedNode, newZones };
1148
+ };
796
1149
 
797
- .tecof-uc-subtitle {
798
- font-size: 0.875rem;
799
- font-weight: 600;
800
- text-transform: uppercase;
801
- letter-spacing: 0.15em;
802
- color: ${accentColor};
803
- margin-bottom: 0.75rem;
804
- }
1150
+ // src/engine/operations.ts
1151
+ var insertNode = (draft, node, targetZoneKey, index2) => {
1152
+ if (!node.props.id) {
1153
+ node.props.id = generateId();
1154
+ }
1155
+ let list3 = targetZoneKey ? draft.zones[targetZoneKey] : draft.content;
1156
+ if (!list3) {
1157
+ list3 = [];
1158
+ if (targetZoneKey) {
1159
+ draft.zones[targetZoneKey] = list3;
1160
+ }
1161
+ }
1162
+ const insertIndex = typeof index2 === "number" ? index2 : list3.length;
1163
+ list3.splice(insertIndex, 0, node);
1164
+ };
1165
+ var removeNode = (draft, id) => {
1166
+ const result = findNodeById(draft, id);
1167
+ if (!result) return;
1168
+ const { path } = result;
1169
+ const list3 = path.zoneKey ? draft.zones[path.zoneKey] : draft.content;
1170
+ if (list3) {
1171
+ list3.splice(path.index, 1);
1172
+ }
1173
+ const descendantZoneKeys = getDescendantZoneKeys(draft.zones, id);
1174
+ for (const zoneKey of descendantZoneKeys) {
1175
+ delete draft.zones[zoneKey];
1176
+ }
1177
+ };
1178
+ var moveNode = (draft, id, targetZoneKey, targetIndex) => {
1179
+ const result = findNodeById(draft, id);
1180
+ if (!result) return;
1181
+ const { node, path: sourcePath } = result;
1182
+ const sourceList = sourcePath.zoneKey ? draft.zones[sourcePath.zoneKey] : draft.content;
1183
+ let targetList = targetZoneKey ? draft.zones[targetZoneKey] : draft.content;
1184
+ if (!targetList && targetZoneKey) {
1185
+ targetList = [];
1186
+ draft.zones[targetZoneKey] = targetList;
1187
+ }
1188
+ if (!sourceList || !targetList) return;
1189
+ sourceList.splice(sourcePath.index, 1);
1190
+ let finalIndex = targetIndex ?? targetList.length;
1191
+ if (sourcePath.zoneKey === targetZoneKey && sourcePath.index < finalIndex) {
1192
+ finalIndex -= 1;
1193
+ }
1194
+ targetList.splice(finalIndex, 0, node);
1195
+ };
1196
+ var duplicateNode = (draft, id) => {
1197
+ const result = findNodeById(draft, id);
1198
+ if (!result) return;
1199
+ const { node, path } = result;
1200
+ const { remappedNode, newZones } = remapNodeIds(node, draft.zones);
1201
+ const targetList = path.zoneKey ? draft.zones[path.zoneKey] : draft.content;
1202
+ if (targetList) {
1203
+ targetList.splice(path.index + 1, 0, remappedNode);
1204
+ }
1205
+ Object.assign(draft.zones, newZones);
1206
+ };
1207
+ var updateProps = (draft, id, patch) => {
1208
+ const result = findNodeById(draft, id);
1209
+ if (!result) return;
1210
+ Object.assign(result.node.props, patch);
1211
+ };
1212
+ var setRootProps = (draft, patch) => {
1213
+ Object.assign(draft.root.props, patch);
1214
+ };
805
1215
 
806
- .tecof-uc-title {
807
- font-size: 2.25rem;
808
- font-weight: 800;
809
- line-height: 1.2;
810
- letter-spacing: -0.025em;
811
- color: #ffffff;
812
- margin-top: 0;
813
- margin-bottom: 1.25rem;
814
- background: linear-gradient(to bottom, #ffffff 0%, #cbd5e1 100%);
815
- -webkit-background-clip: text;
816
- -webkit-text-fill-color: transparent;
1216
+ // src/engine/store.ts
1217
+ var pushToHistory = (state3) => {
1218
+ state3.history.past.push(JSON.parse(JSON.stringify(state3.document)));
1219
+ state3.history.future = [];
1220
+ };
1221
+ var useEditorStore = zustand.create()(
1222
+ immer.immer((set2) => ({
1223
+ // Initial State
1224
+ document: { ...EMPTY_DOCUMENT },
1225
+ history: {
1226
+ past: [],
1227
+ future: []
1228
+ },
1229
+ selection: {
1230
+ selectedId: null,
1231
+ hoveredId: null
1232
+ },
1233
+ viewport: "desktop",
1234
+ // Actions
1235
+ setDocument: (doc) => set2((state3) => {
1236
+ state3.document = doc;
1237
+ state3.history = { past: [], future: [] };
1238
+ state3.selection = { selectedId: null, hoveredId: null };
1239
+ }),
1240
+ selectNode: (id) => set2((state3) => {
1241
+ state3.selection.selectedId = id;
1242
+ }),
1243
+ hoverNode: (id) => set2((state3) => {
1244
+ state3.selection.hoveredId = id;
1245
+ }),
1246
+ setViewport: (viewport) => set2((state3) => {
1247
+ state3.viewport = viewport;
1248
+ }),
1249
+ insertNode: (node, targetZoneKey, index2) => set2((state3) => {
1250
+ pushToHistory(state3);
1251
+ insertNode(state3.document, node, targetZoneKey, index2);
1252
+ }),
1253
+ removeNode: (id) => set2((state3) => {
1254
+ pushToHistory(state3);
1255
+ removeNode(state3.document, id);
1256
+ if (state3.selection.selectedId === id) {
1257
+ state3.selection.selectedId = null;
1258
+ }
1259
+ }),
1260
+ moveNode: (id, targetZoneKey, index2) => set2((state3) => {
1261
+ pushToHistory(state3);
1262
+ moveNode(state3.document, id, targetZoneKey, index2);
1263
+ }),
1264
+ duplicateNode: (id) => set2((state3) => {
1265
+ pushToHistory(state3);
1266
+ duplicateNode(state3.document, id);
1267
+ }),
1268
+ updateProps: (id, patch) => set2((state3) => {
1269
+ pushToHistory(state3);
1270
+ updateProps(state3.document, id, patch);
1271
+ }),
1272
+ setRootProps: (patch) => set2((state3) => {
1273
+ pushToHistory(state3);
1274
+ setRootProps(state3.document, patch);
1275
+ }),
1276
+ undo: () => set2((state3) => {
1277
+ if (state3.history.past.length === 0) return;
1278
+ const previous = state3.history.past.pop();
1279
+ state3.history.future.push(JSON.parse(JSON.stringify(state3.document)));
1280
+ state3.document = previous;
1281
+ }),
1282
+ redo: () => set2((state3) => {
1283
+ if (state3.history.future.length === 0) return;
1284
+ const next = state3.history.future.pop();
1285
+ state3.history.past.push(JSON.parse(JSON.stringify(state3.document)));
1286
+ state3.document = next;
1287
+ })
1288
+ }))
1289
+ );
1290
+ var StudioContext = React__default.createContext(null);
1291
+ var useStudio = () => {
1292
+ const ctx = React__default.useContext(StudioContext);
1293
+ if (!ctx) {
1294
+ throw new Error("useStudio must be used within a StudioProvider");
1295
+ }
1296
+ return ctx;
1297
+ };
1298
+ var ParentNodeContext = React__default.createContext(null);
1299
+ var DropZone = ({ zone, className, style }) => {
1300
+ const parentId = React__default.useContext(ParentNodeContext);
1301
+ const zoneKey = parentId ? `${parentId}:${zone}` : zone;
1302
+ const items = useEditorStore((state3) => state3.document.zones[zoneKey] || []);
1303
+ return /* @__PURE__ */ jsxRuntime.jsx(
1304
+ "div",
1305
+ {
1306
+ className: `tecof-dropzone ${className || ""}`,
1307
+ style: { minHeight: items.length === 0 ? "40px" : void 0, ...style },
1308
+ "data-tecof-zone": zoneKey,
1309
+ children: items.map((item2, index2) => /* @__PURE__ */ jsxRuntime.jsx(NodeRenderer, { node: item2, index: index2, zoneKey }, item2.props.id))
1310
+ }
1311
+ );
1312
+ };
1313
+ var renderDropZone = ({ zone, className, style }) => {
1314
+ return /* @__PURE__ */ jsxRuntime.jsx(DropZone, { zone, className, style });
1315
+ };
1316
+ var NodeRenderer = ({ node, index: index2, zoneKey }) => {
1317
+ const { config: config3, metadata, readOnly } = useStudio();
1318
+ const componentConfig = config3.components[node.type];
1319
+ const selectNode = useEditorStore((state3) => state3.selectNode);
1320
+ const hoverNode = useEditorStore((state3) => state3.hoverNode);
1321
+ const hoveredId = useEditorStore((state3) => state3.selection.hoveredId);
1322
+ const handleMouseEnter = React__default.useCallback(
1323
+ (e3) => {
1324
+ if (readOnly) return;
1325
+ e3.stopPropagation();
1326
+ hoverNode(node.props.id);
1327
+ },
1328
+ [hoverNode, node.props.id, readOnly]
1329
+ );
1330
+ const handleMouseLeave = React__default.useCallback(
1331
+ (e3) => {
1332
+ if (readOnly) return;
1333
+ e3.stopPropagation();
1334
+ if (hoveredId === node.props.id) {
1335
+ hoverNode(null);
1336
+ }
1337
+ },
1338
+ [hoverNode, node.props.id, hoveredId, readOnly]
1339
+ );
1340
+ const handleClick = React__default.useCallback(
1341
+ (e3) => {
1342
+ if (readOnly) return;
1343
+ e3.stopPropagation();
1344
+ selectNode(node.props.id);
1345
+ const isEmbedded = typeof window !== "undefined" && window.parent !== window;
1346
+ if (isEmbedded) {
1347
+ window.parent.postMessage(
1348
+ {
1349
+ type: "puck:itemSelected",
1350
+ item: {
1351
+ type: node.type,
1352
+ id: node.props.id
1353
+ }
1354
+ },
1355
+ "*"
1356
+ );
1357
+ }
1358
+ },
1359
+ [selectNode, node.props.id, node.type, readOnly]
1360
+ );
1361
+ if (!componentConfig) {
1362
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "12px", background: "#fee2e2", color: "#991b1b", fontSize: "12px", borderRadius: "4px" }, children: [
1363
+ "Bile\u015Fen bulunamad\u0131: ",
1364
+ node.type
1365
+ ] });
1366
+ }
1367
+ const componentProps = {
1368
+ ...node.props,
1369
+ puck: {
1370
+ renderDropZone,
1371
+ isEditing: !readOnly,
1372
+ metadata: {
1373
+ ...metadata || {},
1374
+ ...componentConfig.metadata || {}
1375
+ }
1376
+ },
1377
+ editMode: !readOnly
1378
+ };
1379
+ return /* @__PURE__ */ jsxRuntime.jsx(ParentNodeContext.Provider, { value: node.props.id, children: /* @__PURE__ */ jsxRuntime.jsx(
1380
+ "div",
1381
+ {
1382
+ className: "tecof-node-wrapper",
1383
+ "data-tecof-id": node.props.id,
1384
+ "data-tecof-type": node.type,
1385
+ "data-tecof-index": index2,
1386
+ "data-tecof-zone": zoneKey || "root",
1387
+ onMouseEnter: handleMouseEnter,
1388
+ onMouseLeave: handleMouseLeave,
1389
+ onClick: handleClick,
1390
+ style: {
1391
+ cursor: readOnly ? void 0 : "pointer"
1392
+ },
1393
+ children: componentConfig.render(componentProps)
1394
+ }
1395
+ ) });
1396
+ };
1397
+ var Frame = ({ children, title = "Canvas Frame", ...props }) => {
1398
+ const [contentRef, setContentRef] = React__default.useState(null);
1399
+ const mountNode = contentRef?.contentWindow?.document?.body;
1400
+ React__default.useEffect(() => {
1401
+ if (!contentRef) return;
1402
+ const doc = contentRef.contentDocument;
1403
+ if (!doc) return;
1404
+ const copyStyles = () => {
1405
+ doc.head.innerHTML = "";
1406
+ Array.from(document.styleSheets).forEach((styleSheet) => {
1407
+ try {
1408
+ if (styleSheet.href) {
1409
+ const link = doc.createElement("link");
1410
+ link.rel = "stylesheet";
1411
+ link.href = styleSheet.href;
1412
+ doc.head.appendChild(link);
1413
+ } else {
1414
+ const cssRules = Array.from(styleSheet.cssRules).map((rule) => rule.cssText).join("\n");
1415
+ const style2 = doc.createElement("style");
1416
+ style2.textContent = cssRules;
1417
+ doc.head.appendChild(style2);
1418
+ }
1419
+ } catch (e3) {
817
1420
  }
818
-
819
- .tecof-uc-description {
820
- font-size: 1.05rem;
821
- line-height: 1.6;
822
- color: #94a3b8;
823
- margin: 0 auto 2.5rem auto;
824
- max-width: 420px;
1421
+ });
1422
+ const style = doc.createElement("style");
1423
+ style.textContent = `
1424
+ html, body {
1425
+ margin: 0;
1426
+ padding: 0;
1427
+ background-color: transparent;
1428
+ min-height: 100vh;
825
1429
  }
826
-
827
- .tecof-uc-divider {
828
- height: 1px;
829
- background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 100%);
830
- margin-bottom: 2rem;
1430
+ body {
1431
+ padding: 32px 16px;
1432
+ box-sizing: border-box;
831
1433
  }
832
-
833
- .tecof-uc-badge {
834
- display: inline-flex;
835
- align-items: center;
836
- gap: 0.5rem;
837
- background: rgba(255, 255, 255, 0.04);
838
- border: 1px solid rgba(255, 255, 255, 0.08);
839
- border-radius: 99px;
840
- padding: 0.5rem 1.25rem;
841
- font-size: 0.825rem;
842
- font-weight: 500;
843
- color: #94a3b8;
844
- text-decoration: none;
845
- transition: all 0.2s ease-in-out;
1434
+ .tecof-node-wrapper {
1435
+ position: relative;
1436
+ transition: outline 0.15s ease-in-out;
846
1437
  }
847
-
848
- .tecof-uc-badge:hover {
849
- background: rgba(255, 255, 255, 0.08);
850
- border-color: rgba(255, 255, 255, 0.15);
851
- color: #f8fafc;
852
- transform: translateY(-1px);
1438
+ /* Custom scrollbars for iframe */
1439
+ ::-webkit-scrollbar {
1440
+ width: 8px;
1441
+ height: 8px;
853
1442
  }
854
-
855
- .tecof-uc-badge-dot {
856
- width: 6px;
857
- height: 6px;
858
- background-color: ${accentColor};
859
- border-radius: 50%;
860
- box-shadow: 0 0 10px ${accentColor};
861
- animation: tecof-uc-blink 1.5s infinite alternate;
1443
+ ::-webkit-scrollbar-track {
1444
+ background: transparent;
862
1445
  }
863
-
864
- /* Animations */
865
- @keyframes tecof-uc-pulse {
866
- 0% { opacity: 0.08; transform: translate(-50%, -50%) scale(0.95); }
867
- 100% { opacity: 0.15; transform: translate(-50%, -50%) scale(1.05); }
1446
+ ::-webkit-scrollbar-thumb {
1447
+ background: rgba(0, 0, 0, 0.15);
1448
+ border-radius: 4px;
868
1449
  }
869
-
870
- @keyframes tecof-uc-fade-in {
871
- 0% { opacity: 0; transform: translateY(20px); }
872
- 100% { opacity: 1; transform: translateY(0); }
1450
+ ::-webkit-scrollbar-thumb:hover {
1451
+ background: rgba(0, 0, 0, 0.25);
873
1452
  }
874
-
875
- @keyframes tecof-uc-float {
876
- 0% { transform: translateY(0px) rotate(0deg); }
877
- 50% { transform: translateY(-5px) rotate(3deg); }
878
- 100% { transform: translateY(0px) rotate(0deg); }
1453
+ `;
1454
+ doc.head.appendChild(style);
1455
+ };
1456
+ copyStyles();
1457
+ if (doc.body) {
1458
+ doc.body.className = "tecof-canvas-body";
1459
+ const handleBodyClick = (e3) => {
1460
+ const target = e3.target;
1461
+ if (!target.closest(".tecof-node-wrapper")) {
1462
+ useEditorStore.getState().selectNode(null);
1463
+ const isEmbedded = typeof window !== "undefined" && window.parent !== window;
1464
+ if (isEmbedded) {
1465
+ window.parent.postMessage({ type: "puck:itemDeselected" }, "*");
1466
+ }
1467
+ }
1468
+ };
1469
+ doc.body.addEventListener("click", handleBodyClick);
1470
+ return () => {
1471
+ doc.body.removeEventListener("click", handleBodyClick);
1472
+ };
1473
+ }
1474
+ }, [contentRef]);
1475
+ return /* @__PURE__ */ jsxRuntime.jsx(
1476
+ "iframe",
1477
+ {
1478
+ title,
1479
+ ref: setContentRef,
1480
+ style: {
1481
+ width: "100%",
1482
+ height: "100%",
1483
+ border: "none",
1484
+ background: "#ffffff",
1485
+ ...props.style
1486
+ },
1487
+ ...props,
1488
+ children: mountNode && ReactDOM.createPortal(children, mountNode)
1489
+ }
1490
+ );
1491
+ };
1492
+ var Canvas = () => {
1493
+ const content = useEditorStore((state3) => state3.document.content);
1494
+ const viewport = useEditorStore((state3) => state3.viewport);
1495
+ const getWidth2 = () => {
1496
+ switch (viewport) {
1497
+ case "tablet":
1498
+ return "768px";
1499
+ case "mobile":
1500
+ return "375px";
1501
+ case "desktop":
1502
+ default:
1503
+ return "100%";
1504
+ }
1505
+ };
1506
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-canvas-container", style: {
1507
+ flex: 1,
1508
+ display: "flex",
1509
+ alignItems: "center",
1510
+ justifyContent: "center",
1511
+ background: "#f4f4f5",
1512
+ padding: "24px",
1513
+ overflow: "auto",
1514
+ height: "100%",
1515
+ boxSizing: "border-box"
1516
+ }, children: /* @__PURE__ */ jsxRuntime.jsx(
1517
+ "div",
1518
+ {
1519
+ className: "tecof-canvas-viewport-wrapper",
1520
+ style: {
1521
+ width: getWidth2(),
1522
+ height: "100%",
1523
+ maxWidth: "100%",
1524
+ transition: "width 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
1525
+ boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05)",
1526
+ borderRadius: viewport === "desktop" ? "0" : "12px",
1527
+ overflow: "hidden",
1528
+ backgroundColor: "#ffffff"
1529
+ },
1530
+ children: /* @__PURE__ */ jsxRuntime.jsx(Frame, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-canvas-root", style: { minHeight: "100%" }, children: content.map((item2, index2) => /* @__PURE__ */ jsxRuntime.jsx(NodeRenderer, { node: item2, index: index2 }, item2.props.id)) }) })
1531
+ }
1532
+ ) });
1533
+ };
1534
+ var useOverlayCoords = (id, iframeEl, containerEl, documentState) => {
1535
+ const [coords, setCoords] = React__default.useState(null);
1536
+ React__default.useEffect(() => {
1537
+ if (!id || !iframeEl || !containerEl) {
1538
+ setCoords(null);
1539
+ return;
1540
+ }
1541
+ let resizeObserver = null;
1542
+ let targetResizeObserver = null;
1543
+ const updateCoords = () => {
1544
+ const doc = iframeEl.contentDocument;
1545
+ if (!doc) return;
1546
+ const element = doc.querySelector(`[data-tecof-id="${id}"]`);
1547
+ if (!element) {
1548
+ setCoords(null);
1549
+ return;
1550
+ }
1551
+ const rect = element.getBoundingClientRect();
1552
+ const iframeRect = iframeEl.getBoundingClientRect();
1553
+ const containerRect = containerEl.getBoundingClientRect();
1554
+ setCoords({
1555
+ top: rect.top + iframeRect.top - containerRect.top,
1556
+ left: rect.left + iframeRect.left - containerRect.left,
1557
+ width: rect.width,
1558
+ height: rect.height
1559
+ });
1560
+ if (!targetResizeObserver) {
1561
+ targetResizeObserver = new ResizeObserver(() => {
1562
+ updateCoords();
1563
+ });
1564
+ targetResizeObserver.observe(element);
1565
+ }
1566
+ };
1567
+ updateCoords();
1568
+ const iframeWin = iframeEl.contentWindow;
1569
+ resizeObserver = new ResizeObserver(() => {
1570
+ updateCoords();
1571
+ });
1572
+ resizeObserver.observe(iframeEl);
1573
+ iframeWin?.addEventListener("scroll", updateCoords);
1574
+ window.addEventListener("resize", updateCoords);
1575
+ return () => {
1576
+ if (resizeObserver) resizeObserver.disconnect();
1577
+ if (targetResizeObserver) targetResizeObserver.disconnect();
1578
+ iframeWin?.removeEventListener("scroll", updateCoords);
1579
+ window.removeEventListener("resize", updateCoords);
1580
+ };
1581
+ }, [id, iframeEl, containerEl, documentState]);
1582
+ return coords;
1583
+ };
1584
+ var SelectionOverlay = () => {
1585
+ const documentState = useEditorStore((state3) => state3.document);
1586
+ const selectedId = useEditorStore((state3) => state3.selection.selectedId);
1587
+ const hoveredId = useEditorStore((state3) => state3.selection.hoveredId);
1588
+ const selectNode = useEditorStore((state3) => state3.selectNode);
1589
+ const removeNode2 = useEditorStore((state3) => state3.removeNode);
1590
+ const duplicateNode2 = useEditorStore((state3) => state3.duplicateNode);
1591
+ const moveNode2 = useEditorStore((state3) => state3.moveNode);
1592
+ const [iframeEl, setIframeEl] = React__default.useState(null);
1593
+ const containerRef = React__default.useRef(null);
1594
+ React__default.useEffect(() => {
1595
+ const iframe = document.querySelector(".tecof-canvas-viewport-wrapper iframe");
1596
+ setIframeEl(iframe);
1597
+ }, [documentState]);
1598
+ const selectedCoords = useOverlayCoords(selectedId, iframeEl, containerRef.current, documentState);
1599
+ const hoveredCoords = useOverlayCoords(
1600
+ hoveredId !== selectedId ? hoveredId : null,
1601
+ iframeEl,
1602
+ containerRef.current,
1603
+ documentState
1604
+ );
1605
+ const nodeDetails = selectedId ? findNodeById(documentState, selectedId) : null;
1606
+ const parentId = selectedId ? getParentId(documentState, selectedId) : null;
1607
+ const canMoveUp = nodeDetails ? nodeDetails.path.index > 0 : false;
1608
+ const canMoveDown = nodeDetails ? (() => {
1609
+ const { zoneKey, index: index2 } = nodeDetails.path;
1610
+ const items = zoneKey ? documentState.zones[zoneKey] || [] : documentState.content;
1611
+ return index2 < items.length - 1;
1612
+ })() : false;
1613
+ const handleMove = (direction) => {
1614
+ if (!selectedId || !nodeDetails) return;
1615
+ const { zoneKey, index: index2 } = nodeDetails.path;
1616
+ const newIndex = direction === "up" ? index2 - 1 : index2 + 1;
1617
+ moveNode2(selectedId, zoneKey, newIndex);
1618
+ };
1619
+ const breadcrumbs = selectedId ? getBreadcrumbs(documentState, selectedId) : [];
1620
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1621
+ "div",
1622
+ {
1623
+ ref: containerRef,
1624
+ className: "tecof-selection-overlay-container",
1625
+ style: {
1626
+ position: "absolute",
1627
+ top: 0,
1628
+ left: 0,
1629
+ right: 0,
1630
+ bottom: 0,
1631
+ pointerEvents: "none",
1632
+ zIndex: 1e3
1633
+ },
1634
+ children: [
1635
+ hoveredCoords && /* @__PURE__ */ jsxRuntime.jsx(
1636
+ "div",
1637
+ {
1638
+ className: "tecof-hover-outline",
1639
+ style: {
1640
+ position: "absolute",
1641
+ top: hoveredCoords.top,
1642
+ left: hoveredCoords.left,
1643
+ width: hoveredCoords.width,
1644
+ height: hoveredCoords.height,
1645
+ border: "1.5px dashed #3b82f6",
1646
+ borderRadius: "4px",
1647
+ boxSizing: "border-box",
1648
+ pointerEvents: "none",
1649
+ transition: "all 0.1s ease-out"
1650
+ }
1651
+ }
1652
+ ),
1653
+ selectedCoords && /* @__PURE__ */ jsxRuntime.jsxs(
1654
+ "div",
1655
+ {
1656
+ className: "tecof-selected-outline",
1657
+ style: {
1658
+ position: "absolute",
1659
+ top: selectedCoords.top,
1660
+ left: selectedCoords.left,
1661
+ width: selectedCoords.width,
1662
+ height: selectedCoords.height,
1663
+ border: "2px solid #3b82f6",
1664
+ borderRadius: "4px",
1665
+ boxSizing: "border-box",
1666
+ pointerEvents: "none",
1667
+ transition: "all 0.1s ease-out"
1668
+ },
1669
+ children: [
1670
+ /* @__PURE__ */ jsxRuntime.jsxs(
1671
+ "div",
1672
+ {
1673
+ className: "tecof-floating-toolbar",
1674
+ style: {
1675
+ position: "absolute",
1676
+ top: "-36px",
1677
+ right: "-2px",
1678
+ display: "flex",
1679
+ alignItems: "center",
1680
+ gap: "4px",
1681
+ background: "#3b82f6",
1682
+ borderRadius: "6px",
1683
+ padding: "4px",
1684
+ pointerEvents: "auto",
1685
+ boxShadow: "0 4px 6px -1px rgba(59, 130, 246, 0.2)"
1686
+ },
1687
+ children: [
1688
+ parentId && /* @__PURE__ */ jsxRuntime.jsx(
1689
+ "button",
1690
+ {
1691
+ onClick: () => selectNode(parentId),
1692
+ title: "\xDCst \xD6\u011Feyi Se\xE7",
1693
+ style: {
1694
+ background: "transparent",
1695
+ border: "none",
1696
+ color: "#ffffff",
1697
+ cursor: "pointer",
1698
+ padding: "4px",
1699
+ borderRadius: "4px",
1700
+ display: "flex"
1701
+ },
1702
+ children: /* @__PURE__ */ jsxRuntime.jsx(ChevronUp, { size: 14 })
1703
+ }
1704
+ ),
1705
+ /* @__PURE__ */ jsxRuntime.jsx(
1706
+ "button",
1707
+ {
1708
+ onClick: () => handleMove("up"),
1709
+ disabled: !canMoveUp,
1710
+ title: "Yukar\u0131 Ta\u015F\u0131",
1711
+ style: {
1712
+ background: "transparent",
1713
+ border: "none",
1714
+ color: "#ffffff",
1715
+ opacity: canMoveUp ? 1 : 0.5,
1716
+ cursor: canMoveUp ? "pointer" : "not-allowed",
1717
+ padding: "4px",
1718
+ borderRadius: "4px",
1719
+ display: "flex"
1720
+ },
1721
+ children: /* @__PURE__ */ jsxRuntime.jsx(ArrowUp, { size: 14 })
1722
+ }
1723
+ ),
1724
+ /* @__PURE__ */ jsxRuntime.jsx(
1725
+ "button",
1726
+ {
1727
+ onClick: () => handleMove("down"),
1728
+ disabled: !canMoveDown,
1729
+ title: "A\u015Fa\u011F\u0131 Ta\u015F\u0131",
1730
+ style: {
1731
+ background: "transparent",
1732
+ border: "none",
1733
+ color: "#ffffff",
1734
+ opacity: canMoveDown ? 1 : 0.5,
1735
+ cursor: canMoveDown ? "pointer" : "not-allowed",
1736
+ padding: "4px",
1737
+ borderRadius: "4px",
1738
+ display: "flex"
1739
+ },
1740
+ children: /* @__PURE__ */ jsxRuntime.jsx(ArrowDown, { size: 14 })
1741
+ }
1742
+ ),
1743
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "1px", height: "14px", background: "rgba(255,255,255,0.3)", margin: "0 2px" } }),
1744
+ /* @__PURE__ */ jsxRuntime.jsx(
1745
+ "button",
1746
+ {
1747
+ onClick: () => duplicateNode2(selectedId),
1748
+ title: "Kopyala",
1749
+ style: {
1750
+ background: "transparent",
1751
+ border: "none",
1752
+ color: "#ffffff",
1753
+ cursor: "pointer",
1754
+ padding: "4px",
1755
+ borderRadius: "4px",
1756
+ display: "flex"
1757
+ },
1758
+ children: /* @__PURE__ */ jsxRuntime.jsx(Copy, { size: 14 })
1759
+ }
1760
+ ),
1761
+ /* @__PURE__ */ jsxRuntime.jsx(
1762
+ "button",
1763
+ {
1764
+ onClick: () => removeNode2(selectedId),
1765
+ title: "Sil",
1766
+ style: {
1767
+ background: "transparent",
1768
+ border: "none",
1769
+ color: "#ffffff",
1770
+ cursor: "pointer",
1771
+ padding: "4px",
1772
+ borderRadius: "4px",
1773
+ display: "flex"
1774
+ },
1775
+ children: /* @__PURE__ */ jsxRuntime.jsx(Trash2, { size: 14 })
1776
+ }
1777
+ )
1778
+ ]
1779
+ }
1780
+ ),
1781
+ nodeDetails && /* @__PURE__ */ jsxRuntime.jsx(
1782
+ "div",
1783
+ {
1784
+ className: "tecof-outline-label",
1785
+ style: {
1786
+ position: "absolute",
1787
+ top: "-26px",
1788
+ left: "-2px",
1789
+ background: "#3b82f6",
1790
+ color: "#ffffff",
1791
+ fontSize: "11px",
1792
+ fontWeight: 600,
1793
+ padding: "2px 8px",
1794
+ borderRadius: "4px 4px 0 0",
1795
+ userSelect: "none"
1796
+ },
1797
+ children: nodeDetails.node.type
1798
+ }
1799
+ ),
1800
+ breadcrumbs.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
1801
+ "div",
1802
+ {
1803
+ className: "tecof-selected-breadcrumbs",
1804
+ style: {
1805
+ position: "absolute",
1806
+ bottom: "-28px",
1807
+ left: "-2px",
1808
+ display: "flex",
1809
+ alignItems: "center",
1810
+ gap: "4px",
1811
+ background: "#18181b",
1812
+ color: "#a1a1aa",
1813
+ fontSize: "10px",
1814
+ padding: "4px 8px",
1815
+ borderRadius: "0 0 6px 6px",
1816
+ pointerEvents: "auto",
1817
+ boxShadow: "0 2px 4px rgba(0,0,0,0.05)"
1818
+ },
1819
+ children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxRuntime.jsxs(React__default__namespace.default.Fragment, { children: [
1820
+ idx > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#52525b" }, children: ">" }),
1821
+ /* @__PURE__ */ jsxRuntime.jsx(
1822
+ "span",
1823
+ {
1824
+ onClick: () => selectNode(crumb.id),
1825
+ style: {
1826
+ cursor: "pointer",
1827
+ color: crumb.id === selectedId ? "#ffffff" : void 0,
1828
+ fontWeight: crumb.id === selectedId ? 600 : void 0
1829
+ },
1830
+ onMouseEnter: () => useEditorStore.getState().hoverNode(crumb.id),
1831
+ onMouseLeave: () => useEditorStore.getState().hoverNode(null),
1832
+ children: crumb.type
1833
+ }
1834
+ )
1835
+ ] }, crumb.id))
1836
+ }
1837
+ )
1838
+ ]
1839
+ }
1840
+ )
1841
+ ]
1842
+ }
1843
+ );
1844
+ };
1845
+ var FieldLabel = ({
1846
+ label,
1847
+ icon,
1848
+ readOnly,
1849
+ children,
1850
+ el = "label"
1851
+ }) => {
1852
+ const Component2 = el;
1853
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1854
+ Component2,
1855
+ {
1856
+ className: "tecof-field-label-container",
1857
+ style: {
1858
+ display: "flex",
1859
+ flexDirection: "column",
1860
+ gap: "6px",
1861
+ marginBottom: "16px",
1862
+ width: "100%",
1863
+ boxSizing: "border-box",
1864
+ userSelect: "none"
1865
+ },
1866
+ children: [
1867
+ /* @__PURE__ */ jsxRuntime.jsxs(
1868
+ "div",
1869
+ {
1870
+ className: "tecof-field-label-header",
1871
+ style: {
1872
+ display: "flex",
1873
+ alignItems: "center",
1874
+ gap: "6px",
1875
+ fontSize: "12px",
1876
+ fontWeight: 600,
1877
+ color: "#27272a"
1878
+ // zinc-800
1879
+ },
1880
+ children: [
1881
+ icon && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-flex" }, children: icon }),
1882
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
1883
+ readOnly && /* @__PURE__ */ jsxRuntime.jsx(
1884
+ "span",
1885
+ {
1886
+ style: {
1887
+ fontSize: "10px",
1888
+ color: "#a1a1aa",
1889
+ fontWeight: 400,
1890
+ marginLeft: "auto"
1891
+ },
1892
+ children: "Salt Okunur"
1893
+ }
1894
+ )
1895
+ ]
1896
+ }
1897
+ ),
1898
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-field-label-content", style: { width: "100%" }, children })
1899
+ ]
1900
+ }
1901
+ );
1902
+ };
1903
+ var FieldRenderer = ({
1904
+ name: name3,
1905
+ definition,
1906
+ value,
1907
+ onChange,
1908
+ readOnly = false
1909
+ }) => {
1910
+ const label = definition.label || name3;
1911
+ const type = definition.type;
1912
+ if (definition.render) {
1913
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-custom-field-wrapper", style: { width: "100%" }, children: definition.render({
1914
+ field: definition,
1915
+ name: name3,
1916
+ id: `field-${name3}`,
1917
+ value,
1918
+ onChange,
1919
+ readOnly
1920
+ }) });
1921
+ }
1922
+ switch (type) {
1923
+ case "text":
1924
+ return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
1925
+ "input",
1926
+ {
1927
+ id: `field-${name3}`,
1928
+ type: "text",
1929
+ value: value || "",
1930
+ disabled: readOnly,
1931
+ onChange: (e3) => onChange(e3.target.value),
1932
+ style: {
1933
+ width: "100%",
1934
+ padding: "10px 12px",
1935
+ borderRadius: "8px",
1936
+ border: "1px solid #e4e4e7",
1937
+ fontSize: "13px",
1938
+ color: "#18181b",
1939
+ backgroundColor: readOnly ? "#f4f4f5" : "#ffffff",
1940
+ outline: "none",
1941
+ boxSizing: "border-box",
1942
+ transition: "border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out"
1943
+ },
1944
+ className: "tecof-input-text"
879
1945
  }
880
-
881
- @keyframes tecof-uc-blink {
882
- 0% { opacity: 0.3; }
883
- 100% { opacity: 1; }
1946
+ ) });
1947
+ case "textarea":
1948
+ return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
1949
+ "textarea",
1950
+ {
1951
+ id: `field-${name3}`,
1952
+ rows: 4,
1953
+ value: value || "",
1954
+ disabled: readOnly,
1955
+ onChange: (e3) => onChange(e3.target.value),
1956
+ style: {
1957
+ width: "100%",
1958
+ padding: "10px 12px",
1959
+ borderRadius: "8px",
1960
+ border: "1px solid #e4e4e7",
1961
+ fontSize: "13px",
1962
+ color: "#18181b",
1963
+ backgroundColor: readOnly ? "#f4f4f5" : "#ffffff",
1964
+ outline: "none",
1965
+ resize: "vertical",
1966
+ boxSizing: "border-box",
1967
+ transition: "border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out"
1968
+ },
1969
+ className: "tecof-input-textarea"
884
1970
  }
885
-
886
- @media (max-width: 640px) {
887
- .tecof-uc-container {
888
- padding: 2.5rem 1.5rem;
889
- border-radius: 20px;
890
- }
891
- .tecof-uc-title {
892
- font-size: 1.75rem;
1971
+ ) });
1972
+ case "select":
1973
+ return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative", width: "100%" }, children: [
1974
+ /* @__PURE__ */ jsxRuntime.jsx(
1975
+ "select",
1976
+ {
1977
+ id: `field-${name3}`,
1978
+ value: value || "",
1979
+ disabled: readOnly,
1980
+ onChange: (e3) => onChange(e3.target.value),
1981
+ style: {
1982
+ width: "100%",
1983
+ padding: "10px 32px 10px 12px",
1984
+ borderRadius: "8px",
1985
+ border: "1px solid #e4e4e7",
1986
+ fontSize: "13px",
1987
+ color: "#18181b",
1988
+ backgroundColor: readOnly ? "#f4f4f5" : "#ffffff",
1989
+ outline: "none",
1990
+ appearance: "none",
1991
+ boxSizing: "border-box",
1992
+ cursor: readOnly ? "not-allowed" : "pointer"
1993
+ },
1994
+ className: "tecof-input-select",
1995
+ children: (definition.options || []).map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt.value, children: opt.label || opt.value }, opt.value))
893
1996
  }
894
- .tecof-uc-description {
895
- font-size: 0.95rem;
896
- margin-bottom: 2rem;
1997
+ ),
1998
+ /* @__PURE__ */ jsxRuntime.jsx(
1999
+ "div",
2000
+ {
2001
+ style: {
2002
+ position: "absolute",
2003
+ top: "50%",
2004
+ right: "12px",
2005
+ transform: "translateY(-50%)",
2006
+ pointerEvents: "none",
2007
+ display: "flex",
2008
+ alignItems: "center",
2009
+ color: "#71717a"
2010
+ },
2011
+ children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2.5 4.5L6 8L9.5 4.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
897
2012
  }
2013
+ )
2014
+ ] }) });
2015
+ case "number":
2016
+ return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(
2017
+ "input",
2018
+ {
2019
+ id: `field-${name3}`,
2020
+ type: "number",
2021
+ value: value !== void 0 ? value : "",
2022
+ disabled: readOnly,
2023
+ onChange: (e3) => {
2024
+ const val = e3.target.value;
2025
+ onChange(val === "" ? void 0 : Number(val));
2026
+ },
2027
+ style: {
2028
+ width: "100%",
2029
+ padding: "10px 12px",
2030
+ borderRadius: "8px",
2031
+ border: "1px solid #e4e4e7",
2032
+ fontSize: "13px",
2033
+ color: "#18181b",
2034
+ backgroundColor: readOnly ? "#f4f4f5" : "#ffffff",
2035
+ outline: "none",
2036
+ boxSizing: "border-box"
2037
+ },
2038
+ className: "tecof-input-number"
898
2039
  }
899
- ` } }),
900
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-glow-1" }),
901
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-uc-container", children: [
902
- logoUrl ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-logo-area", children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoUrl, alt: "Store Logo", className: "tecof-uc-logo" }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-logo-area", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-logo-fallback", children: "TECOF" }) }),
903
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-uc-icon-wrapper", children: [
904
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-icon-glow" }),
905
- /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z", strokeLinecap: "round", strokeLinejoin: "round" }) })
906
- ] }),
907
- subtitle && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-subtitle", children: subtitle }),
908
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "tecof-uc-title", children: title }),
909
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-uc-description", children: description }),
910
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-divider" }),
911
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-uc-badge", children: [
912
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-uc-badge-dot" }),
913
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Yap\u0131m A\u015Famas\u0131nda" })
914
- ] })
915
- ] })
916
- ] });
2040
+ ) });
2041
+ case "radio":
2042
+ return /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (definition.options || []).map((opt) => /* @__PURE__ */ jsxRuntime.jsxs(
2043
+ "label",
2044
+ {
2045
+ style: {
2046
+ display: "flex",
2047
+ alignItems: "center",
2048
+ gap: "8px",
2049
+ fontSize: "13px",
2050
+ color: "#27272a",
2051
+ cursor: readOnly ? "not-allowed" : "pointer"
2052
+ },
2053
+ children: [
2054
+ /* @__PURE__ */ jsxRuntime.jsx(
2055
+ "input",
2056
+ {
2057
+ type: "radio",
2058
+ name: name3,
2059
+ value: opt.value,
2060
+ checked: value === opt.value,
2061
+ disabled: readOnly,
2062
+ onChange: () => onChange(opt.value),
2063
+ style: {
2064
+ cursor: readOnly ? "not-allowed" : "pointer"
2065
+ }
2066
+ }
2067
+ ),
2068
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: opt.label || opt.value })
2069
+ ]
2070
+ },
2071
+ opt.value
2072
+ )) }) });
2073
+ default:
2074
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "8px", fontSize: "11px", color: "#71717a", background: "#fafafa", borderRadius: "4px" }, children: [
2075
+ 'Desteklenmeyen alan t\xFCr\xFC: "',
2076
+ type,
2077
+ '" (',
2078
+ name3,
2079
+ ")"
2080
+ ] });
2081
+ }
917
2082
  };
918
- var merchantInfoCache = /* @__PURE__ */ new Map();
919
- var CACHE_TTL = 5 * 60 * 1e3;
920
- function useLanguages() {
921
- const { apiClient, secretKey, apiUrl } = useTecof();
922
- const [merchantInfo, setMerchantInfo] = React__default.useState(null);
2083
+ var Inspector = () => {
2084
+ const documentState = useEditorStore((state3) => state3.document);
2085
+ const selectedId = useEditorStore((state3) => state3.selection.selectedId);
2086
+ const updateProps2 = useEditorStore((state3) => state3.updateProps);
2087
+ const setRootProps2 = useEditorStore((state3) => state3.setRootProps);
2088
+ const selectNode = useEditorStore((state3) => state3.selectNode);
2089
+ const { config: config3, readOnly } = useStudio();
2090
+ if (selectedId) {
2091
+ const nodeDetails = findNodeById(documentState, selectedId);
2092
+ if (!nodeDetails) {
2093
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "24px", color: "#71717a", fontSize: "13px", textAlign: "center" }, children: "Bile\u015Fen y\xFCkleniyor veya bulunamad\u0131." });
2094
+ }
2095
+ const { node } = nodeDetails;
2096
+ const componentConfig = config3.components[node.type];
2097
+ const fields = componentConfig?.fields || {};
2098
+ const label = componentConfig?.label || node.type;
2099
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2100
+ "div",
2101
+ {
2102
+ className: "tecof-inspector",
2103
+ style: {
2104
+ width: "320px",
2105
+ height: "100%",
2106
+ borderLeft: "1px solid #e4e4e7",
2107
+ background: "#ffffff",
2108
+ display: "flex",
2109
+ flexDirection: "column",
2110
+ boxSizing: "border-box"
2111
+ },
2112
+ children: [
2113
+ /* @__PURE__ */ jsxRuntime.jsxs(
2114
+ "div",
2115
+ {
2116
+ style: {
2117
+ padding: "16px 20px",
2118
+ borderBottom: "1px solid #f4f4f5",
2119
+ display: "flex",
2120
+ alignItems: "center",
2121
+ justifyContent: "space-between"
2122
+ },
2123
+ children: [
2124
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2125
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: 0, fontSize: "14px", fontWeight: 700, color: "#18181b" }, children: label }),
2126
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#a1a1aa", fontFamily: "monospace" }, children: selectedId })
2127
+ ] }),
2128
+ /* @__PURE__ */ jsxRuntime.jsx(
2129
+ "button",
2130
+ {
2131
+ onClick: () => selectNode(null),
2132
+ style: {
2133
+ background: "transparent",
2134
+ border: "none",
2135
+ color: "#71717a",
2136
+ cursor: "pointer",
2137
+ fontSize: "11px",
2138
+ fontWeight: 500,
2139
+ padding: "4px 8px",
2140
+ borderRadius: "4px",
2141
+ hover: { background: "#f4f4f5" }
2142
+ },
2143
+ children: "Se\xE7imi Kald\u0131r"
2144
+ }
2145
+ )
2146
+ ]
2147
+ }
2148
+ ),
2149
+ /* @__PURE__ */ jsxRuntime.jsx(
2150
+ "div",
2151
+ {
2152
+ className: "tecof-inspector-fields",
2153
+ style: {
2154
+ flex: 1,
2155
+ overflowY: "auto",
2156
+ padding: "20px",
2157
+ display: "flex",
2158
+ flexDirection: "column",
2159
+ gap: "4px"
2160
+ },
2161
+ children: Object.keys(fields).length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: "#a1a1aa", fontSize: "12px", textAlign: "center", marginTop: "16px" }, children: "Bu bile\u015Fenin d\xFCzenlenebilir alan\u0131 bulunmuyor." }) : Object.entries(fields).map(([fieldName, fieldDef]) => /* @__PURE__ */ jsxRuntime.jsx(
2162
+ FieldRenderer,
2163
+ {
2164
+ name: fieldName,
2165
+ definition: fieldDef,
2166
+ value: node.props[fieldName],
2167
+ onChange: (newVal) => updateProps2(selectedId, { [fieldName]: newVal }),
2168
+ readOnly
2169
+ },
2170
+ fieldName
2171
+ ))
2172
+ }
2173
+ )
2174
+ ]
2175
+ }
2176
+ );
2177
+ }
2178
+ const rootFields = config3.root?.fields || {};
2179
+ const hasRootFields = Object.keys(rootFields).length > 0;
2180
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2181
+ "div",
2182
+ {
2183
+ className: "tecof-inspector",
2184
+ style: {
2185
+ width: "320px",
2186
+ height: "100%",
2187
+ borderLeft: "1px solid #e4e4e7",
2188
+ background: "#ffffff",
2189
+ display: "flex",
2190
+ flexDirection: "column",
2191
+ boxSizing: "border-box"
2192
+ },
2193
+ children: [
2194
+ /* @__PURE__ */ jsxRuntime.jsxs(
2195
+ "div",
2196
+ {
2197
+ style: {
2198
+ padding: "16px 20px",
2199
+ borderBottom: "1px solid #f4f4f5"
2200
+ },
2201
+ children: [
2202
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: 0, fontSize: "14px", fontWeight: 700, color: "#18181b" }, children: "Sayfa Ayarlar\u0131" }),
2203
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#a1a1aa" }, children: "Genel sayfa konfig\xFCrasyonu" })
2204
+ ]
2205
+ }
2206
+ ),
2207
+ /* @__PURE__ */ jsxRuntime.jsx(
2208
+ "div",
2209
+ {
2210
+ className: "tecof-inspector-fields",
2211
+ style: {
2212
+ flex: 1,
2213
+ overflowY: "auto",
2214
+ padding: "20px",
2215
+ display: "flex",
2216
+ flexDirection: "column",
2217
+ gap: "4px"
2218
+ },
2219
+ children: hasRootFields ? Object.entries(rootFields).map(([fieldName, fieldDef]) => /* @__PURE__ */ jsxRuntime.jsx(
2220
+ FieldRenderer,
2221
+ {
2222
+ name: fieldName,
2223
+ definition: fieldDef,
2224
+ value: documentState.root.props[fieldName],
2225
+ onChange: (newVal) => setRootProps2({ [fieldName]: newVal }),
2226
+ readOnly
2227
+ },
2228
+ fieldName
2229
+ )) : /* @__PURE__ */ jsxRuntime.jsxs(
2230
+ "div",
2231
+ {
2232
+ style: {
2233
+ display: "flex",
2234
+ flexDirection: "column",
2235
+ alignItems: "center",
2236
+ justifyContent: "center",
2237
+ height: "100%",
2238
+ color: "#a1a1aa",
2239
+ fontSize: "12px",
2240
+ textAlign: "center",
2241
+ padding: "20px"
2242
+ },
2243
+ children: [
2244
+ /* @__PURE__ */ jsxRuntime.jsxs(
2245
+ "svg",
2246
+ {
2247
+ width: "24",
2248
+ height: "24",
2249
+ viewBox: "0 0 24 24",
2250
+ fill: "none",
2251
+ stroke: "currentColor",
2252
+ strokeWidth: "2",
2253
+ strokeLinecap: "round",
2254
+ strokeLinejoin: "round",
2255
+ style: { marginBottom: "8px", opacity: 0.6 },
2256
+ children: [
2257
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
2258
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 3v18" })
2259
+ ]
2260
+ }
2261
+ ),
2262
+ "Bile\u015Fen se\xE7ilmedi. D\xFCzenlemek istedi\u011Finiz bir bile\u015Fene t\u0131klay\u0131n."
2263
+ ]
2264
+ }
2265
+ )
2266
+ }
2267
+ )
2268
+ ]
2269
+ }
2270
+ );
2271
+ };
2272
+ var TecofStudio = ({
2273
+ pageId,
2274
+ config: config3,
2275
+ accessToken,
2276
+ onSave,
2277
+ onChange,
2278
+ className
2279
+ }) => {
2280
+ const { apiClient } = useTecof();
923
2281
  const [loading, setLoading] = React__default.useState(true);
924
- const [error2, setError] = React__default.useState(null);
925
- const [activeTab, setActiveTab] = React__default.useState("");
926
- const cacheKey = React__default.useMemo(() => `${apiUrl}::${secretKey}`, [apiUrl, secretKey]);
2282
+ const [saving, setSaving] = React__default.useState(false);
2283
+ const [saveStatus, setSaveStatus] = React__default.useState("idle");
2284
+ const setDocument = useEditorStore((state3) => state3.setDocument);
2285
+ const documentState = useEditorStore((state3) => state3.document);
2286
+ const undo = useEditorStore((state3) => state3.undo);
2287
+ const redo = useEditorStore((state3) => state3.redo);
2288
+ const setViewport = useEditorStore((state3) => state3.setViewport);
2289
+ const documentStateRef = React__default.useRef(documentState);
2290
+ documentStateRef.current = documentState;
2291
+ const isEmbedded = typeof window !== "undefined" && window.parent !== window;
927
2292
  React__default.useEffect(() => {
928
2293
  let cancelled = false;
929
- const fetchInfo = async () => {
930
- const cached = merchantInfoCache.get(cacheKey);
931
- if (cached && Date.now() - cached.ts < CACHE_TTL) {
932
- setMerchantInfo(cached.data);
933
- if (!activeTab) setActiveTab(cached.data.defaultLanguage);
934
- setLoading(false);
935
- return;
936
- }
2294
+ const load = async () => {
937
2295
  setLoading(true);
938
- setError(null);
939
- const res2 = await apiClient.getMerchantInfo();
940
- if (cancelled) return;
941
- if (res2.success && res2.data) {
942
- merchantInfoCache.set(cacheKey, { data: res2.data, ts: Date.now() });
943
- setMerchantInfo(res2.data);
944
- if (!activeTab) setActiveTab(res2.data.defaultLanguage);
945
- } else {
946
- setError(res2.message || "Failed to load languages");
947
- const fallback = { languages: ["tr"], defaultLanguage: "tr" };
948
- setMerchantInfo(fallback);
949
- if (!activeTab) setActiveTab("tr");
2296
+ try {
2297
+ const res2 = await apiClient.getPage(pageId);
2298
+ if (cancelled) return;
2299
+ const rawData = res2.success && res2.data?.draftData ? res2.data.draftData : null;
2300
+ const parsedDoc = parseDocument(rawData);
2301
+ setDocument(parsedDoc);
2302
+ } catch (err) {
2303
+ console.error("Failed to load page:", err);
2304
+ } finally {
2305
+ setLoading(false);
950
2306
  }
951
- setLoading(false);
952
2307
  };
953
- fetchInfo();
2308
+ load();
954
2309
  return () => {
955
2310
  cancelled = true;
956
2311
  };
957
- }, [apiClient, cacheKey]);
958
- return { merchantInfo, loading, error: error2, activeTab, setActiveTab };
959
- }
960
-
961
- // node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
962
- var mergeClasses = (...classes) => classes.filter((className, index2, array) => {
963
- return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index2;
964
- }).join(" ").trim();
965
-
966
- // node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.js
967
- var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
968
-
969
- // node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.js
970
- var toCamelCase = (string) => string.replace(
971
- /^([A-Z])|[\s-_]+(\w)/g,
972
- (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
973
- );
974
-
975
- // node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.js
976
- var toPascalCase = (string) => {
977
- const camelCase = toCamelCase(string);
978
- return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
979
- };
980
-
981
- // node_modules/lucide-react/dist/esm/defaultAttributes.js
982
- var defaultAttributes = {
983
- xmlns: "http://www.w3.org/2000/svg",
984
- width: 24,
985
- height: 24,
986
- viewBox: "0 0 24 24",
987
- fill: "none",
988
- stroke: "currentColor",
989
- strokeWidth: 2,
990
- strokeLinecap: "round",
991
- strokeLinejoin: "round"
992
- };
993
-
994
- // node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.js
995
- var hasA11yProp = (props) => {
996
- for (const prop in props) {
997
- if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
998
- return true;
2312
+ }, [pageId, apiClient, setDocument]);
2313
+ const isFirstRender = React__default.useRef(true);
2314
+ React__default.useEffect(() => {
2315
+ if (loading) return;
2316
+ if (isFirstRender.current) {
2317
+ isFirstRender.current = false;
2318
+ return;
999
2319
  }
2320
+ const serialized = serializeDocument(documentState);
2321
+ onChange?.(serialized);
2322
+ if (isEmbedded) {
2323
+ window.parent.postMessage({ type: "puck:changed" }, "*");
2324
+ }
2325
+ }, [documentState, loading, onChange, isEmbedded]);
2326
+ const handleSaveDraft = React__default.useCallback(async () => {
2327
+ const currentDoc = documentStateRef.current;
2328
+ const serialized = serializeDocument(currentDoc);
2329
+ setSaving(true);
2330
+ setSaveStatus("idle");
2331
+ try {
2332
+ const res2 = await apiClient.savePage(pageId, serialized, void 0, accessToken);
2333
+ if (res2.success) {
2334
+ setSaveStatus("success");
2335
+ setTimeout(() => setSaveStatus("idle"), 3e3);
2336
+ onSave?.(serialized);
2337
+ if (isEmbedded) {
2338
+ window.parent.postMessage({ type: "puck:saved" }, "*");
2339
+ }
2340
+ } else {
2341
+ setSaveStatus("error");
2342
+ if (isEmbedded) {
2343
+ window.parent.postMessage({ type: "puck:saveError", message: res2.message }, "*");
2344
+ }
2345
+ }
2346
+ } catch (err) {
2347
+ setSaveStatus("error");
2348
+ if (isEmbedded) {
2349
+ window.parent.postMessage({ type: "puck:saveError", message: err.message }, "*");
2350
+ }
2351
+ } finally {
2352
+ setSaving(false);
2353
+ }
2354
+ }, [pageId, apiClient, accessToken, onSave, isEmbedded]);
2355
+ React__default.useEffect(() => {
2356
+ if (!isEmbedded) return;
2357
+ const onMessage = (e3) => {
2358
+ switch (e3.data?.type) {
2359
+ case "puck:save":
2360
+ handleSaveDraft();
2361
+ break;
2362
+ case "puck:undo":
2363
+ undo();
2364
+ break;
2365
+ case "puck:redo":
2366
+ redo();
2367
+ break;
2368
+ case "puck:viewport":
2369
+ if (e3.data.width) {
2370
+ const width = e3.data.width;
2371
+ if (width === "375px" || width === 375) {
2372
+ setViewport("mobile");
2373
+ } else if (width === "768px" || width === 768) {
2374
+ setViewport("tablet");
2375
+ } else {
2376
+ setViewport("desktop");
2377
+ }
2378
+ }
2379
+ break;
2380
+ }
2381
+ };
2382
+ window.addEventListener("message", onMessage);
2383
+ return () => window.removeEventListener("message", onMessage);
2384
+ }, [isEmbedded, handleSaveDraft, undo, redo, setViewport]);
2385
+ const studioContextValue = React__default.useMemo(() => ({
2386
+ config: config3,
2387
+ readOnly: false,
2388
+ apiClient
2389
+ }), [config3, apiClient]);
2390
+ if (loading) {
2391
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `tecof-editor-loading ${className || ""}`.trim(), style: {
2392
+ display: "flex",
2393
+ alignItems: "center",
2394
+ justifyContent: "center",
2395
+ height: "100vh",
2396
+ background: "#f4f4f5"
2397
+ }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { textAlign: "center" }, children: [
2398
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-editor-spinner", style: {
2399
+ width: "40px",
2400
+ height: "40px",
2401
+ border: "3px solid #e4e4e7",
2402
+ borderTopColor: "#3b82f6",
2403
+ borderRadius: "50%",
2404
+ animation: "spin 1s linear infinite",
2405
+ margin: "0 auto 16px"
2406
+ } }),
2407
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#71717a", fontSize: "14px", margin: 0 }, children: "St\xFCdyo y\xFCkleniyor..." })
2408
+ ] }) });
1000
2409
  }
1001
- return false;
2410
+ return /* @__PURE__ */ jsxRuntime.jsx(StudioContext.Provider, { value: studioContextValue, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `tecof-studio-root ${className || ""}`.trim(), style: {
2411
+ display: "flex",
2412
+ flexDirection: "column",
2413
+ height: "100vh",
2414
+ width: "100vw",
2415
+ overflow: "hidden",
2416
+ position: "relative",
2417
+ background: "#f4f4f5"
2418
+ }, children: [
2419
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-workspace-container", style: {
2420
+ display: "flex",
2421
+ flex: 1,
2422
+ height: "100%",
2423
+ width: "100%",
2424
+ overflow: "hidden"
2425
+ }, children: [
2426
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-studio-workspace", style: {
2427
+ display: "flex",
2428
+ flex: 1,
2429
+ height: "100%",
2430
+ position: "relative",
2431
+ overflow: "hidden"
2432
+ }, children: [
2433
+ /* @__PURE__ */ jsxRuntime.jsx(Canvas, {}),
2434
+ /* @__PURE__ */ jsxRuntime.jsx(SelectionOverlay, {})
2435
+ ] }),
2436
+ /* @__PURE__ */ jsxRuntime.jsx(Inspector, {})
2437
+ ] }),
2438
+ saving && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-editor-save-indicator", style: {
2439
+ position: "absolute",
2440
+ bottom: "24px",
2441
+ right: "24px",
2442
+ background: saveStatus === "error" ? "#ef4444" : "#18181b",
2443
+ color: "#ffffff",
2444
+ padding: "8px 16px",
2445
+ borderRadius: "24px",
2446
+ fontSize: "12px",
2447
+ fontWeight: 500,
2448
+ boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
2449
+ zIndex: 9999
2450
+ }, children: saveStatus === "error" ? "Kaydedilemedi" : "Kaydediliyor..." })
2451
+ ] }) });
1002
2452
  };
1003
- var LucideContext = React__default.createContext({});
1004
- var useLucideContext = () => React__default.useContext(LucideContext);
1005
-
1006
- // node_modules/lucide-react/dist/esm/Icon.js
1007
- var Icon = React__default.forwardRef(
1008
- ({ color, size, strokeWidth, absoluteStrokeWidth, className = "", children, iconNode, ...rest }, ref) => {
1009
- const {
1010
- size: contextSize = 24,
1011
- strokeWidth: contextStrokeWidth = 2,
1012
- absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,
1013
- color: contextColor = "currentColor",
1014
- className: contextClass = ""
1015
- } = useLucideContext() ?? {};
1016
- const calculatedStrokeWidth = absoluteStrokeWidth ?? contextAbsoluteStrokeWidth ? Number(strokeWidth ?? contextStrokeWidth) * 24 / Number(size ?? contextSize) : strokeWidth ?? contextStrokeWidth;
1017
- return React__default.createElement(
1018
- "svg",
1019
- {
1020
- ref,
1021
- ...defaultAttributes,
1022
- width: size ?? contextSize ?? defaultAttributes.width,
1023
- height: size ?? contextSize ?? defaultAttributes.height,
1024
- stroke: color ?? contextColor,
1025
- strokeWidth: calculatedStrokeWidth,
1026
- className: mergeClasses("lucide", contextClass, className),
1027
- ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
1028
- ...rest
1029
- },
1030
- [
1031
- ...iconNode.map(([tag, attrs]) => React__default.createElement(tag, attrs)),
1032
- ...Array.isArray(children) ? children : [children]
1033
- ]
1034
- );
2453
+ var TecofRender = ({ data: data3, config: config3, className, cmsData }) => {
2454
+ if (!data3) return null;
2455
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx(
2456
+ core.Render,
2457
+ {
2458
+ config: config3,
2459
+ data: data3,
2460
+ metadata: { cmsData: cmsData || null }
2461
+ }
2462
+ ) });
2463
+ };
2464
+ var IMAGE_EXTENSIONS = ["png", "jpg", "jpeg", "webp", "gif", "svg", "avif", "bmp", "tiff", "heic"];
2465
+ var VIDEO_EXTENSIONS = ["mp4", "webm", "ogg", "avi", "mov", "quicktime"];
2466
+ var isImage = (type) => {
2467
+ if (!type) return false;
2468
+ const t2 = type.toLowerCase();
2469
+ return IMAGE_EXTENSIONS.some((ext) => t2.includes(ext)) || t2.startsWith("image/");
2470
+ };
2471
+ var isVideo = (type) => {
2472
+ if (!type) return false;
2473
+ const t2 = type.toLowerCase();
2474
+ return VIDEO_EXTENSIONS.some((ext) => t2.includes(ext)) || t2.startsWith("video/");
2475
+ };
2476
+ var getSizes = (size) => {
2477
+ switch (size) {
2478
+ case "thumbnail":
2479
+ return "(max-width: 360px) 100vw, 360px";
2480
+ case "medium":
2481
+ return "(max-width: 540px) 100vw, 540px";
2482
+ case "large":
2483
+ return "(max-width: 720px) 100vw, 720px";
2484
+ default:
2485
+ return "100vw";
1035
2486
  }
1036
- );
1037
-
1038
- // node_modules/lucide-react/dist/esm/createLucideIcon.js
1039
- var createLucideIcon = (iconName, iconNode) => {
1040
- const Component2 = React__default.forwardRef(
1041
- ({ className, ...props }, ref) => React__default.createElement(Icon, {
1042
- ref,
1043
- iconNode,
1044
- className: mergeClasses(
1045
- `lucide-${toKebabCase(toPascalCase(iconName))}`,
1046
- `lucide-${iconName}`,
1047
- className
1048
- ),
1049
- ...props
1050
- })
1051
- );
1052
- Component2.displayName = toPascalCase(iconName);
1053
- return Component2;
1054
2487
  };
1055
-
1056
- // node_modules/lucide-react/dist/esm/icons/check.js
1057
- var __iconNode = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
1058
- var Check = createLucideIcon("check", __iconNode);
1059
-
1060
- // node_modules/lucide-react/dist/esm/icons/chevron-down.js
1061
- var __iconNode2 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
1062
- var ChevronDown = createLucideIcon("chevron-down", __iconNode2);
1063
-
1064
- // node_modules/lucide-react/dist/esm/icons/chevron-right.js
1065
- var __iconNode3 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
1066
- var ChevronRight = createLucideIcon("chevron-right", __iconNode3);
1067
-
1068
- // node_modules/lucide-react/dist/esm/icons/code.js
1069
- var __iconNode4 = [
1070
- ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
1071
- ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
1072
- ];
1073
- var Code = createLucideIcon("code", __iconNode4);
1074
-
1075
- // node_modules/lucide-react/dist/esm/icons/copy.js
1076
- var __iconNode5 = [
1077
- ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
1078
- ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
1079
- ];
1080
- var Copy = createLucideIcon("copy", __iconNode5);
1081
-
1082
- // node_modules/lucide-react/dist/esm/icons/database.js
1083
- var __iconNode6 = [
1084
- ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
1085
- ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
1086
- ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
1087
- ];
1088
- var Database = createLucideIcon("database", __iconNode6);
1089
-
1090
- // node_modules/lucide-react/dist/esm/icons/external-link.js
1091
- var __iconNode7 = [
1092
- ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
1093
- ["path", { d: "M10 14 21 3", key: "gplh6r" }],
1094
- ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
1095
- ];
1096
- var ExternalLink = createLucideIcon("external-link", __iconNode7);
1097
-
1098
- // node_modules/lucide-react/dist/esm/icons/file-text.js
1099
- var __iconNode8 = [
1100
- [
1101
- "path",
2488
+ var DEFAULT_BLUR_DATA_URL = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiNmM2Y0ZjYiLz48L3N2Zz4=";
2489
+ var TecofPicture = React__default.memo(({
2490
+ data: data3,
2491
+ alt = null,
2492
+ size = "full",
2493
+ loading = "lazy",
2494
+ fill = false,
2495
+ style,
2496
+ imgStyle,
2497
+ className,
2498
+ imgClassName,
2499
+ width,
2500
+ height,
2501
+ usePlaceholder = true,
2502
+ blurDataURL = DEFAULT_BLUR_DATA_URL,
2503
+ fancybox = false,
2504
+ fancyboxName = "gallery",
2505
+ ImageComponent,
2506
+ imageProps = {}
2507
+ }) => {
2508
+ const { apiClient } = useTecof();
2509
+ const cdnUrl = apiClient.cdnUrl;
2510
+ if (!data3) return null;
2511
+ const buildPath = (fileName) => data3?.folder && data3.folder !== "/" ? `${data3.folder.replace(/^\//, "")}/${fileName}` : fileName;
2512
+ const isExternal = data3?.type === "external" || data3?.provider === "external";
2513
+ const fileURL = isExternal ? data3?.url || "" : `${cdnUrl}/${buildPath(data3?.name)}`;
2514
+ const isImageType3 = isExternal ? true : isImage(data3?.type);
2515
+ const isVideoType = isExternal ? false : isVideo(data3?.type);
2516
+ if (!fileURL) return null;
2517
+ const imgWidth = width || data3?.meta?.width || 500;
2518
+ const imgHeight = height || data3?.meta?.height || 500;
2519
+ const sizes = getSizes(size);
2520
+ const renderVideo = () => /* @__PURE__ */ jsxRuntime.jsx(
2521
+ "video",
1102
2522
  {
1103
- d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
1104
- key: "1oefj6"
2523
+ src: fileURL,
2524
+ autoPlay: true,
2525
+ loop: true,
2526
+ muted: true,
2527
+ playsInline: true,
2528
+ className: `tecof-picture-video ${imgClassName || ""}`.trim(),
2529
+ style: imgStyle
2530
+ }
2531
+ );
2532
+ const renderImg = () => {
2533
+ const baseImgClass = fill ? "tecof-picture-img-fill" : "tecof-picture-img";
2534
+ const computedImgClass = `${baseImgClass} ${imgClassName || ""}`.trim();
2535
+ const altText = alt || data3?.name || "Image";
2536
+ const commonProps = {
2537
+ src: fileURL,
2538
+ alt: altText,
2539
+ loading,
2540
+ sizes,
2541
+ className: computedImgClass,
2542
+ style: imgStyle
2543
+ };
2544
+ if (ImageComponent) {
2545
+ return /* @__PURE__ */ jsxRuntime.jsx(
2546
+ ImageComponent,
2547
+ {
2548
+ ...commonProps,
2549
+ width: fill ? void 0 : imgWidth,
2550
+ height: fill ? void 0 : imgHeight,
2551
+ ...fill ? { fill: true } : {},
2552
+ ...imageProps
2553
+ }
2554
+ );
1105
2555
  }
1106
- ],
1107
- ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
1108
- ["path", { d: "M10 9H8", key: "b1mrlr" }],
1109
- ["path", { d: "M16 13H8", key: "t4e002" }],
1110
- ["path", { d: "M16 17H8", key: "z1uh3a" }]
1111
- ];
1112
- var FileText = createLucideIcon("file-text", __iconNode8);
2556
+ return /* @__PURE__ */ jsxRuntime.jsx(
2557
+ "img",
2558
+ {
2559
+ ...commonProps,
2560
+ width: fill ? void 0 : imgWidth,
2561
+ height: fill ? void 0 : imgHeight
2562
+ }
2563
+ );
2564
+ };
2565
+ const containerClassName = `tecof-picture-wrapper ${fill ? "fill" : ""} ${className || ""}`.trim();
2566
+ if (fancybox && (isImageType3 || isVideoType)) {
2567
+ return /* @__PURE__ */ jsxRuntime.jsx(
2568
+ "a",
2569
+ {
2570
+ "data-fancybox": fancyboxName,
2571
+ href: fileURL,
2572
+ style: { display: "block", textDecoration: "none" },
2573
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { style, className: containerClassName, children: isVideoType ? renderVideo() : renderImg() })
2574
+ }
2575
+ );
2576
+ }
2577
+ if (isVideoType) {
2578
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style, className: containerClassName, children: renderVideo() });
2579
+ }
2580
+ if (isImageType3) {
2581
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style, className: containerClassName, children: renderImg() });
2582
+ }
2583
+ return null;
2584
+ });
2585
+ TecofPicture.displayName = "TecofPicture";
2586
+ var UnderConstruction = ({
2587
+ title,
2588
+ description,
2589
+ subtitle,
2590
+ logoUrl,
2591
+ accentColor = "#2563eb"
2592
+ // Default elegant blue
2593
+ }) => {
2594
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-uc-wrapper", children: [
2595
+ /* @__PURE__ */ jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: `
2596
+ .tecof-uc-wrapper {
2597
+ min-height: 100vh;
2598
+ display: flex;
2599
+ align-items: center;
2600
+ justify-content: center;
2601
+ background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
2602
+ radial-gradient(circle at bottom left, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
2603
+ #090d16;
2604
+ color: #f8fafc;
2605
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
2606
+ padding: 2rem 1rem;
2607
+ box-sizing: border-box;
2608
+ position: relative;
2609
+ overflow: hidden;
2610
+ }
1113
2611
 
1114
- // node_modules/lucide-react/dist/esm/icons/file.js
1115
- var __iconNode9 = [
1116
- [
1117
- "path",
1118
- {
1119
- d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
1120
- key: "1oefj6"
1121
- }
1122
- ],
1123
- ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
1124
- ];
1125
- var File2 = createLucideIcon("file", __iconNode9);
2612
+ /* Ambient glowing circles */
2613
+ .tecof-uc-glow-1 {
2614
+ position: absolute;
2615
+ top: 20%;
2616
+ left: 50%;
2617
+ transform: translate(-50%, -50%);
2618
+ width: 500px;
2619
+ height: 500px;
2620
+ background: ${accentColor};
2621
+ filter: blur(150px);
2622
+ opacity: 0.12;
2623
+ pointer-events: none;
2624
+ z-index: 1;
2625
+ border-radius: 50%;
2626
+ animation: tecof-uc-pulse 8s infinite alternate ease-in-out;
2627
+ }
1126
2628
 
1127
- // node_modules/lucide-react/dist/esm/icons/folder-open.js
1128
- var __iconNode10 = [
1129
- [
1130
- "path",
1131
- {
1132
- d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",
1133
- key: "usdka0"
1134
- }
1135
- ]
1136
- ];
1137
- var FolderOpen = createLucideIcon("folder-open", __iconNode10);
2629
+ .tecof-uc-container {
2630
+ position: relative;
2631
+ z-index: 2;
2632
+ max-width: 540px;
2633
+ width: 100%;
2634
+ background: rgba(17, 24, 39, 0.55);
2635
+ backdrop-filter: blur(20px);
2636
+ -webkit-backdrop-filter: blur(20px);
2637
+ border: 1px solid rgba(255, 255, 255, 0.08);
2638
+ border-radius: 24px;
2639
+ padding: 3.5rem 2.5rem;
2640
+ text-align: center;
2641
+ box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
2642
+ inset 0 1px 0 rgba(255, 255, 255, 0.1);
2643
+ animation: tecof-uc-fade-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
2644
+ }
1138
2645
 
1139
- // node_modules/lucide-react/dist/esm/icons/globe.js
1140
- var __iconNode11 = [
1141
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
1142
- ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
1143
- ["path", { d: "M2 12h20", key: "9i4pu4" }]
1144
- ];
1145
- var Globe = createLucideIcon("globe", __iconNode11);
2646
+ .tecof-uc-logo-area {
2647
+ margin-bottom: 2.5rem;
2648
+ display: flex;
2649
+ justify-content: center;
2650
+ align-items: center;
2651
+ }
1146
2652
 
1147
- // node_modules/lucide-react/dist/esm/icons/grip-vertical.js
1148
- var __iconNode12 = [
1149
- ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
1150
- ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
1151
- ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
1152
- ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
1153
- ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
1154
- ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
1155
- ];
1156
- var GripVertical = createLucideIcon("grip-vertical", __iconNode12);
2653
+ .tecof-uc-logo {
2654
+ max-height: 56px;
2655
+ max-width: 200px;
2656
+ object-fit: contain;
2657
+ filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
2658
+ }
1157
2659
 
1158
- // node_modules/lucide-react/dist/esm/icons/image-plus.js
1159
- var __iconNode13 = [
1160
- ["path", { d: "M16 5h6", key: "1vod17" }],
1161
- ["path", { d: "M19 2v6", key: "4bpg5p" }],
1162
- ["path", { d: "M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5", key: "1ue2ih" }],
1163
- ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }],
1164
- ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }]
1165
- ];
1166
- var ImagePlus = createLucideIcon("image-plus", __iconNode13);
2660
+ .tecof-uc-logo-fallback {
2661
+ font-size: 1.5rem;
2662
+ font-weight: 700;
2663
+ letter-spacing: -0.025em;
2664
+ background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
2665
+ -webkit-background-clip: text;
2666
+ -webkit-text-fill-color: transparent;
2667
+ }
1167
2668
 
1168
- // node_modules/lucide-react/dist/esm/icons/image.js
1169
- var __iconNode14 = [
1170
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
1171
- ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
1172
- ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
1173
- ];
1174
- var Image2 = createLucideIcon("image", __iconNode14);
2669
+ .tecof-uc-icon-wrapper {
2670
+ width: 80px;
2671
+ height: 80px;
2672
+ border-radius: 20px;
2673
+ background: rgba(255, 255, 255, 0.03);
2674
+ border: 1px solid rgba(255, 255, 255, 0.08);
2675
+ display: flex;
2676
+ align-items: center;
2677
+ justify-content: center;
2678
+ margin: 0 auto 2.2rem auto;
2679
+ color: ${accentColor};
2680
+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
2681
+ position: relative;
2682
+ }
1175
2683
 
1176
- // node_modules/lucide-react/dist/esm/icons/languages.js
1177
- var __iconNode15 = [
1178
- ["path", { d: "m5 8 6 6", key: "1wu5hv" }],
1179
- ["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
1180
- ["path", { d: "M2 5h12", key: "or177f" }],
1181
- ["path", { d: "M7 2h1", key: "1t2jsx" }],
1182
- ["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
1183
- ["path", { d: "M14 18h6", key: "1m8k6r" }]
1184
- ];
1185
- var Languages = createLucideIcon("languages", __iconNode15);
2684
+ .tecof-uc-icon-glow {
2685
+ position: absolute;
2686
+ inset: -2px;
2687
+ border-radius: 22px;
2688
+ background: linear-gradient(135deg, ${accentColor}, transparent);
2689
+ opacity: 0.3;
2690
+ z-index: -1;
2691
+ filter: blur(4px);
2692
+ }
1186
2693
 
1187
- // node_modules/lucide-react/dist/esm/icons/link-2.js
1188
- var __iconNode16 = [
1189
- ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
1190
- ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
1191
- ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
1192
- ];
1193
- var Link2 = createLucideIcon("link-2", __iconNode16);
2694
+ .tecof-uc-icon-wrapper svg {
2695
+ width: 36px;
2696
+ height: 36px;
2697
+ stroke-width: 1.5;
2698
+ animation: tecof-uc-float 4s ease-in-out infinite;
2699
+ }
1194
2700
 
1195
- // node_modules/lucide-react/dist/esm/icons/link.js
1196
- var __iconNode17 = [
1197
- ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
1198
- ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
1199
- ];
1200
- var Link = createLucideIcon("link", __iconNode17);
2701
+ .tecof-uc-subtitle {
2702
+ font-size: 0.875rem;
2703
+ font-weight: 600;
2704
+ text-transform: uppercase;
2705
+ letter-spacing: 0.15em;
2706
+ color: ${accentColor};
2707
+ margin-bottom: 0.75rem;
2708
+ }
1201
2709
 
1202
- // node_modules/lucide-react/dist/esm/icons/loader-circle.js
1203
- var __iconNode18 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
1204
- var LoaderCircle = createLucideIcon("loader-circle", __iconNode18);
2710
+ .tecof-uc-title {
2711
+ font-size: 2.25rem;
2712
+ font-weight: 800;
2713
+ line-height: 1.2;
2714
+ letter-spacing: -0.025em;
2715
+ color: #ffffff;
2716
+ margin-top: 0;
2717
+ margin-bottom: 1.25rem;
2718
+ background: linear-gradient(to bottom, #ffffff 0%, #cbd5e1 100%);
2719
+ -webkit-background-clip: text;
2720
+ -webkit-text-fill-color: transparent;
2721
+ }
2722
+
2723
+ .tecof-uc-description {
2724
+ font-size: 1.05rem;
2725
+ line-height: 1.6;
2726
+ color: #94a3b8;
2727
+ margin: 0 auto 2.5rem auto;
2728
+ max-width: 420px;
2729
+ }
1205
2730
 
1206
- // node_modules/lucide-react/dist/esm/icons/pencil.js
1207
- var __iconNode19 = [
1208
- [
1209
- "path",
1210
- {
1211
- d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
1212
- key: "1a8usu"
1213
- }
1214
- ],
1215
- ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
1216
- ];
1217
- var Pencil = createLucideIcon("pencil", __iconNode19);
2731
+ .tecof-uc-divider {
2732
+ height: 1px;
2733
+ background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 100%);
2734
+ margin-bottom: 2rem;
2735
+ }
1218
2736
 
1219
- // node_modules/lucide-react/dist/esm/icons/plus.js
1220
- var __iconNode20 = [
1221
- ["path", { d: "M5 12h14", key: "1ays0h" }],
1222
- ["path", { d: "M12 5v14", key: "s699le" }]
1223
- ];
1224
- var Plus = createLucideIcon("plus", __iconNode20);
2737
+ .tecof-uc-badge {
2738
+ display: inline-flex;
2739
+ align-items: center;
2740
+ gap: 0.5rem;
2741
+ background: rgba(255, 255, 255, 0.04);
2742
+ border: 1px solid rgba(255, 255, 255, 0.08);
2743
+ border-radius: 99px;
2744
+ padding: 0.5rem 1.25rem;
2745
+ font-size: 0.825rem;
2746
+ font-weight: 500;
2747
+ color: #94a3b8;
2748
+ text-decoration: none;
2749
+ transition: all 0.2s ease-in-out;
2750
+ }
1225
2751
 
1226
- // node_modules/lucide-react/dist/esm/icons/refresh-ccw.js
1227
- var __iconNode21 = [
1228
- ["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
1229
- ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
1230
- ["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
1231
- ["path", { d: "M16 16h5v5", key: "ccwih5" }]
1232
- ];
1233
- var RefreshCcw = createLucideIcon("refresh-ccw", __iconNode21);
2752
+ .tecof-uc-badge:hover {
2753
+ background: rgba(255, 255, 255, 0.08);
2754
+ border-color: rgba(255, 255, 255, 0.15);
2755
+ color: #f8fafc;
2756
+ transform: translateY(-1px);
2757
+ }
1234
2758
 
1235
- // node_modules/lucide-react/dist/esm/icons/refresh-cw.js
1236
- var __iconNode22 = [
1237
- ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
1238
- ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
1239
- ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
1240
- ["path", { d: "M8 16H3v5", key: "1cv678" }]
1241
- ];
1242
- var RefreshCw = createLucideIcon("refresh-cw", __iconNode22);
2759
+ .tecof-uc-badge-dot {
2760
+ width: 6px;
2761
+ height: 6px;
2762
+ background-color: ${accentColor};
2763
+ border-radius: 50%;
2764
+ box-shadow: 0 0 10px ${accentColor};
2765
+ animation: tecof-uc-blink 1.5s infinite alternate;
2766
+ }
1243
2767
 
1244
- // node_modules/lucide-react/dist/esm/icons/rotate-ccw.js
1245
- var __iconNode23 = [
1246
- ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
1247
- ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
1248
- ];
1249
- var RotateCcw = createLucideIcon("rotate-ccw", __iconNode23);
2768
+ /* Animations */
2769
+ @keyframes tecof-uc-pulse {
2770
+ 0% { opacity: 0.08; transform: translate(-50%, -50%) scale(0.95); }
2771
+ 100% { opacity: 0.15; transform: translate(-50%, -50%) scale(1.05); }
2772
+ }
1250
2773
 
1251
- // node_modules/lucide-react/dist/esm/icons/search.js
1252
- var __iconNode24 = [
1253
- ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
1254
- ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
1255
- ];
1256
- var Search = createLucideIcon("search", __iconNode24);
2774
+ @keyframes tecof-uc-fade-in {
2775
+ 0% { opacity: 0; transform: translateY(20px); }
2776
+ 100% { opacity: 1; transform: translateY(0); }
2777
+ }
1257
2778
 
1258
- // node_modules/lucide-react/dist/esm/icons/trash-2.js
1259
- var __iconNode25 = [
1260
- ["path", { d: "M10 11v6", key: "nco0om" }],
1261
- ["path", { d: "M14 11v6", key: "outv1u" }],
1262
- ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
1263
- ["path", { d: "M3 6h18", key: "d0wm0j" }],
1264
- ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
1265
- ];
1266
- var Trash2 = createLucideIcon("trash-2", __iconNode25);
2779
+ @keyframes tecof-uc-float {
2780
+ 0% { transform: translateY(0px) rotate(0deg); }
2781
+ 50% { transform: translateY(-5px) rotate(3deg); }
2782
+ 100% { transform: translateY(0px) rotate(0deg); }
2783
+ }
1267
2784
 
1268
- // node_modules/lucide-react/dist/esm/icons/upload.js
1269
- var __iconNode26 = [
1270
- ["path", { d: "M12 3v12", key: "1x0j5s" }],
1271
- ["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }],
1272
- ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }]
1273
- ];
1274
- var Upload = createLucideIcon("upload", __iconNode26);
2785
+ @keyframes tecof-uc-blink {
2786
+ 0% { opacity: 0.3; }
2787
+ 100% { opacity: 1; }
2788
+ }
1275
2789
 
1276
- // node_modules/lucide-react/dist/esm/icons/x.js
1277
- var __iconNode27 = [
1278
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
1279
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
1280
- ];
1281
- var X = createLucideIcon("x", __iconNode27);
2790
+ @media (max-width: 640px) {
2791
+ .tecof-uc-container {
2792
+ padding: 2.5rem 1.5rem;
2793
+ border-radius: 20px;
2794
+ }
2795
+ .tecof-uc-title {
2796
+ font-size: 1.75rem;
2797
+ }
2798
+ .tecof-uc-description {
2799
+ font-size: 0.95rem;
2800
+ margin-bottom: 2rem;
2801
+ }
2802
+ }
2803
+ ` } }),
2804
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-glow-1" }),
2805
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-uc-container", children: [
2806
+ logoUrl ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-logo-area", children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoUrl, alt: "Store Logo", className: "tecof-uc-logo" }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-logo-area", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-logo-fallback", children: "TECOF" }) }),
2807
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-uc-icon-wrapper", children: [
2808
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-icon-glow" }),
2809
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z", strokeLinecap: "round", strokeLinejoin: "round" }) })
2810
+ ] }),
2811
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-subtitle", children: subtitle }),
2812
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "tecof-uc-title", children: title }),
2813
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-uc-description", children: description }),
2814
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-uc-divider" }),
2815
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-uc-badge", children: [
2816
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "tecof-uc-badge-dot" }),
2817
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Yap\u0131m A\u015Famas\u0131nda" })
2818
+ ] })
2819
+ ] })
2820
+ ] });
2821
+ };
2822
+ var merchantInfoCache = /* @__PURE__ */ new Map();
2823
+ var CACHE_TTL = 5 * 60 * 1e3;
2824
+ function useLanguages() {
2825
+ const { apiClient, secretKey, apiUrl } = useTecof();
2826
+ const [merchantInfo, setMerchantInfo] = React__default.useState(null);
2827
+ const [loading, setLoading] = React__default.useState(true);
2828
+ const [error2, setError] = React__default.useState(null);
2829
+ const [activeTab, setActiveTab] = React__default.useState("");
2830
+ const cacheKey = React__default.useMemo(() => `${apiUrl}::${secretKey}`, [apiUrl, secretKey]);
2831
+ React__default.useEffect(() => {
2832
+ let cancelled = false;
2833
+ const fetchInfo = async () => {
2834
+ const cached = merchantInfoCache.get(cacheKey);
2835
+ if (cached && Date.now() - cached.ts < CACHE_TTL) {
2836
+ setMerchantInfo(cached.data);
2837
+ if (!activeTab) setActiveTab(cached.data.defaultLanguage);
2838
+ setLoading(false);
2839
+ return;
2840
+ }
2841
+ setLoading(true);
2842
+ setError(null);
2843
+ const res2 = await apiClient.getMerchantInfo();
2844
+ if (cancelled) return;
2845
+ if (res2.success && res2.data) {
2846
+ merchantInfoCache.set(cacheKey, { data: res2.data, ts: Date.now() });
2847
+ setMerchantInfo(res2.data);
2848
+ if (!activeTab) setActiveTab(res2.data.defaultLanguage);
2849
+ } else {
2850
+ setError(res2.message || "Failed to load languages");
2851
+ const fallback = { languages: ["tr"], defaultLanguage: "tr" };
2852
+ setMerchantInfo(fallback);
2853
+ if (!activeTab) setActiveTab("tr");
2854
+ }
2855
+ setLoading(false);
2856
+ };
2857
+ fetchInfo();
2858
+ return () => {
2859
+ cancelled = true;
2860
+ };
2861
+ }, [apiClient, cacheKey]);
2862
+ return { merchantInfo, loading, error: error2, activeTab, setActiveTab };
2863
+ }
1282
2864
  var FieldErrorBoundary = class extends React__default.Component {
1283
2865
  constructor(props) {
1284
2866
  super(props);
@@ -1580,7 +3162,7 @@ var createLanguageField = (options = {}) => {
1580
3162
  label,
1581
3163
  labelIcon,
1582
3164
  visible,
1583
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
3165
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
1584
3166
  LanguageField,
1585
3167
  {
1586
3168
  field,
@@ -5179,7 +6761,7 @@ var MediaDrawer = ({
5179
6761
  alt: file2.name,
5180
6762
  size: "thumbnail",
5181
6763
  className: "tecof-upload-gallery-thumb",
5182
- imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "6px" }
6764
+ imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
5183
6765
  }
5184
6766
  ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-gallery-thumb tecof-upload-gallery-file-icon-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(File2, { size: 24, color: "#a1a1aa" }) }),
5185
6767
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-gallery-file-name", children: file2.meta?.originalName || file2.name })
@@ -5510,7 +7092,7 @@ var createEditorField = (options = {}) => {
5510
7092
  label,
5511
7093
  labelIcon,
5512
7094
  visible,
5513
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
7095
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
5514
7096
  EditorField,
5515
7097
  {
5516
7098
  field,
@@ -6099,7 +7681,7 @@ var createView = (
6099
7681
  },
6100
7682
  write: write2 = () => {
6101
7683
  },
6102
- create: create4 = () => {
7684
+ create: create5 = () => {
6103
7685
  },
6104
7686
  destroy: destroy3 = () => {
6105
7687
  },
@@ -6303,7 +7885,7 @@ var createView = (
6303
7885
  }
6304
7886
  });
6305
7887
  const internalAPI = createObject(internalAPIDefinition);
6306
- create4({
7888
+ create5({
6307
7889
  root: internalAPI,
6308
7890
  props
6309
7891
  });
@@ -9033,7 +10615,7 @@ var percentageArc = (x, y, radius, from, to) => {
9033
10615
  arcSweep
9034
10616
  );
9035
10617
  };
9036
- var create = ({ root: root3, props }) => {
10618
+ var create2 = ({ root: root3, props }) => {
9037
10619
  props.spin = false;
9038
10620
  props.progress = 0;
9039
10621
  props.opacity = 0;
@@ -9073,7 +10655,7 @@ var progressIndicator = createView({
9073
10655
  name: "progress-indicator",
9074
10656
  ignoreRectUpdate: true,
9075
10657
  ignoreRect: true,
9076
- create,
10658
+ create: create2,
9077
10659
  write,
9078
10660
  mixins: {
9079
10661
  apis: ["progress", "spin", "align"],
@@ -13913,7 +15495,7 @@ var createImageWrapperView = (_2) => {
13913
15495
  root3.ref.overlayShadow.opacity = 0.25;
13914
15496
  root3.ref.overlaySuccess.opacity = 1;
13915
15497
  };
13916
- const create4 = ({ root: root3 }) => {
15498
+ const create5 = ({ root: root3 }) => {
13917
15499
  root3.ref.images = [];
13918
15500
  root3.ref.imageData = null;
13919
15501
  root3.ref.imageViewBin = [];
@@ -13938,7 +15520,7 @@ var createImageWrapperView = (_2) => {
13938
15520
  };
13939
15521
  return _2.utils.createView({
13940
15522
  name: "image-preview-wrapper",
13941
- create: create4,
15523
+ create: create5,
13942
15524
  styles: ["height"],
13943
15525
  apis: ["height"],
13944
15526
  destroy: ({ root: root3 }) => {
@@ -15748,7 +17330,7 @@ var plugin7 = ({ addFilter: addFilter2, utils }) => {
15748
17330
  }).catch(reject);
15749
17331
  });
15750
17332
  const variantPromises = variants.map(
15751
- (create4) => create4(transform, file2, item2.getMetadata())
17333
+ (create5) => create5(transform, file2, item2.getMetadata())
15752
17334
  );
15753
17335
  Promise.all(variantPromises).then((files) => {
15754
17336
  resolve(
@@ -19088,7 +20670,7 @@ var createTexture = function(e3, t2, r2, n, i2) {
19088
20670
  }
19089
20671
  return o2;
19090
20672
  };
19091
- var create2 = function() {
20673
+ var create3 = function() {
19092
20674
  var e3 = new Float32Array(16);
19093
20675
  return e3[0] = 1, e3[5] = 1, e3[10] = 1, e3[15] = 1, e3;
19094
20676
  };
@@ -19116,7 +20698,7 @@ var rotateZ = function(e3, t2) {
19116
20698
  var r2 = Math.sin(t2), n = Math.cos(t2), i2 = e3[0], o2 = e3[1], a2 = e3[2], c2 = e3[3], l3 = e3[4], u = e3[5], s2 = e3[6], d = e3[7];
19117
20699
  e3[0] = i2 * n + l3 * r2, e3[1] = o2 * n + u * r2, e3[2] = a2 * n + s2 * r2, e3[3] = c2 * n + d * r2, e3[4] = l3 * n - i2 * r2, e3[5] = u * n - o2 * r2, e3[6] = s2 * n - a2 * r2, e3[7] = d * n - c2 * r2;
19118
20700
  };
19119
- var mat4 = { create: create2, perspective, translate, scale, rotateX, rotateY, rotateZ };
20701
+ var mat4 = { create: create3, perspective, translate, scale, rotateX, rotateY, rotateZ };
19120
20702
  var degToRad = function(e3) {
19121
20703
  return e3 * Math.PI / 180;
19122
20704
  };
@@ -23057,16 +24639,16 @@ var FileItemRenderer = ({
23057
24639
  `${cdnUrl}/${file2.name}`;
23058
24640
  const ext = getFileExtension(file2.name);
23059
24641
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-file-item", children: [
23060
- file2.type === "image/reference" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-file-icon", style: { backgroundColor: "#eef2ff", color: "#4f46e5" }, children: /* @__PURE__ */ jsxRuntime.jsx(Code, { size: 20 }) }) : isImageType2(file2.type) ? /* @__PURE__ */ jsxRuntime.jsx(
24642
+ file2.type === "image/reference" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-file-icon", style: { backgroundColor: "#f4f4f5", color: "#18181b" }, children: /* @__PURE__ */ jsxRuntime.jsx(Code, { size: 16 }) }) : isImageType2(file2.type) ? /* @__PURE__ */ jsxRuntime.jsx(
23061
24643
  TecofPicture,
23062
24644
  {
23063
24645
  data: file2,
23064
24646
  alt: file2.meta?.originalName || file2.name,
23065
24647
  size: "thumbnail",
23066
24648
  className: "tecof-upload-file-thumb",
23067
- imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "10px" }
24649
+ imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "6px" }
23068
24650
  }
23069
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-file-icon", children: /* @__PURE__ */ jsxRuntime.jsx(File2, { size: 20 }) }),
24651
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-file-icon", children: /* @__PURE__ */ jsxRuntime.jsx(File2, { size: 16 }) }),
23070
24652
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-file-info", children: [
23071
24653
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-file-name", title: file2.meta?.originalName || file2.name, children: file2.meta?.originalName || file2.name }),
23072
24654
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-file-meta", children: [
@@ -23195,10 +24777,6 @@ var UploadField = ({
23195
24777
  const [drawerOpen, setDrawerOpen] = React__default.useState(false);
23196
24778
  const [showRefInput, setShowRefInput] = React__default.useState(false);
23197
24779
  const [refCode, setRefCode] = React__default.useState("{{ data. }}");
23198
- const [galleryFiles, setGalleryFiles] = React__default.useState([]);
23199
- const [loading, setLoading] = React__default.useState(false);
23200
- const [refreshKey, setRefreshKey] = React__default.useState(0);
23201
- const [gallerySearch, setGallerySearch] = React__default.useState("");
23202
24780
  const sourceToIdRef = React__default.useRef(/* @__PURE__ */ new Map());
23203
24781
  const compressFile = React__default.useCallback(async (file2) => {
23204
24782
  if (!imageCompressionEnabled) return file2;
@@ -23255,16 +24833,6 @@ var UploadField = ({
23255
24833
  setShowRefInput(false);
23256
24834
  setRefCode("{{ data. }}");
23257
24835
  }, [refCode, allowMultiple, value, onChange]);
23258
- React__default.useEffect(() => {
23259
- if (!drawerOpen) return;
23260
- setLoading(true);
23261
- apiClient.getUploads(1, 100).then((res2) => {
23262
- if (res2.success && res2.data) {
23263
- setGalleryFiles(res2.data);
23264
- }
23265
- setLoading(false);
23266
- }).catch(() => setLoading(false));
23267
- }, [drawerOpen, refreshKey, apiClient]);
23268
24836
  const toggleGalleryFile = React__default.useCallback((file2) => {
23269
24837
  if (allowMultiple) {
23270
24838
  const exists = value.some((f2) => f2._id === file2._id);
@@ -23337,9 +24905,6 @@ var UploadField = ({
23337
24905
  }
23338
24906
  };
23339
24907
  const canAddMore = allowMultiple ? value.length < maxFiles : value.length === 0;
23340
- const filteredGallery = gallerySearch.trim() ? galleryFiles.filter(
23341
- (f2) => f2.name?.toLowerCase().includes(gallerySearch.toLowerCase()) || f2.meta?.originalName?.toLowerCase().includes(gallerySearch.toLowerCase())
23342
- ) : galleryFiles;
23343
24908
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-container", children: [
23344
24909
  value.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-file-list", children: [
23345
24910
  showUploadedFiles && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-uploaded-header", children: [
@@ -23357,52 +24922,50 @@ var UploadField = ({
23357
24922
  file2._id || idx
23358
24923
  ))
23359
24924
  ] }),
23360
- value.length === 0 && !readOnly && canAddMore && !showPond && /* @__PURE__ */ jsxRuntime.jsxs(
23361
- "div",
23362
- {
23363
- className: "tecof-upload-empty-state",
23364
- onClick: () => setDrawerOpen(true),
23365
- children: [
23366
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-empty-icon", children: /* @__PURE__ */ jsxRuntime.jsx(ImagePlus, { size: 22 }) }),
23367
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-empty-title", children: "Dosya ekleyin" }),
23368
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-empty-desc", children: "Medya k\xFCt\xFCphanesinden se\xE7in veya yeni y\xFCkleyin" })
23369
- ]
23370
- }
23371
- ),
24925
+ value.length === 0 && !readOnly && canAddMore && !showPond && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
24926
+ /* @__PURE__ */ jsxRuntime.jsxs(
24927
+ "div",
24928
+ {
24929
+ className: "tecof-upload-empty-state",
24930
+ onClick: () => setDrawerOpen(true),
24931
+ children: [
24932
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-empty-icon", children: /* @__PURE__ */ jsxRuntime.jsx(ImagePlus, { size: 16 }) }),
24933
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-empty-title", children: "Dosya ekleyin" }),
24934
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-empty-desc", children: "Medya k\xFCt\xFCphanesinden se\xE7in veya yeni y\xFCkleyin" })
24935
+ ]
24936
+ }
24937
+ ),
24938
+ !showRefInput && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-main-actions", children: [
24939
+ /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "tecof-upload-btn-secondary", onClick: () => setShowRefInput(true), children: [
24940
+ /* @__PURE__ */ jsxRuntime.jsx(Code, { size: 13 }),
24941
+ " Referans Gir"
24942
+ ] }),
24943
+ /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "tecof-upload-btn-primary", onClick: () => setShowPond(true), children: [
24944
+ /* @__PURE__ */ jsxRuntime.jsx(Upload, { size: 13 }),
24945
+ " Yeni Y\xFCkle"
24946
+ ] })
24947
+ ] })
24948
+ ] }),
23372
24949
  !readOnly && canAddMore && !showPond && value.length > 0 && !showRefInput && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-main-actions", children: [
23373
24950
  /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "tecof-upload-btn-secondary", onClick: () => setShowRefInput(true), children: [
23374
- /* @__PURE__ */ jsxRuntime.jsx(Code, { size: 15 }),
24951
+ /* @__PURE__ */ jsxRuntime.jsx(Code, { size: 13 }),
23375
24952
  " Referans"
23376
24953
  ] }),
23377
24954
  /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "tecof-upload-btn-secondary", onClick: () => setDrawerOpen(true), children: [
23378
- /* @__PURE__ */ jsxRuntime.jsx(FolderOpen, { size: 15 }),
23379
- " Medya Se\xE7"
23380
- ] }),
23381
- /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "tecof-upload-btn-primary", onClick: () => setShowPond(true), children: [
23382
- /* @__PURE__ */ jsxRuntime.jsx(Upload, { size: 15 }),
23383
- " Yeni Y\xFCkle"
23384
- ] })
23385
- ] }),
23386
- value.length === 0 && !readOnly && canAddMore && !showPond && !showRefInput && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-main-actions", children: [
23387
- /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "tecof-upload-btn-secondary", onClick: () => setShowRefInput(true), children: [
23388
- /* @__PURE__ */ jsxRuntime.jsx(Code, { size: 15 }),
23389
- " Dinamik Referans Se\xE7"
24955
+ /* @__PURE__ */ jsxRuntime.jsx(FolderOpen, { size: 13 }),
24956
+ " K\xFCt\xFCphane"
23390
24957
  ] }),
23391
24958
  /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "tecof-upload-btn-primary", onClick: () => setShowPond(true), children: [
23392
- /* @__PURE__ */ jsxRuntime.jsx(Upload, { size: 15 }),
23393
- " Yeni Y\xFCkle"
24959
+ /* @__PURE__ */ jsxRuntime.jsx(Upload, { size: 13 }),
24960
+ " Y\xFCkle"
23394
24961
  ] })
23395
24962
  ] }),
23396
- showRefInput && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-ref-section", style: { background: "#f8fafc", padding: "12px", borderRadius: "8px", border: "1px solid #e2e8f0", marginTop: "10px" }, children: [
23397
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "8px" }, children: [
23398
- /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: "12px", fontWeight: 500, color: "#475569" }, children: [
23399
- "Dinamik CMS De\u011Fi\u015Fkeni (\xD6rn: ",
23400
- `{{ data.image }}`,
23401
- ")"
23402
- ] }),
23403
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => setShowRefInput(false), style: { background: "none", border: "none", cursor: "pointer", color: "#64748b" }, children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 14 }) })
24963
+ showRefInput && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-ref-section", style: { background: "#ffffff", padding: "10px", borderRadius: "8px", border: "1px solid #e4e4e7", display: "flex", flexDirection: "column", gap: "8px", marginTop: "4px" }, children: [
24964
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
24965
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", fontWeight: 500, color: "#71717a" }, children: "Dinamik CMS De\u011Fi\u015Fkeni" }),
24966
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => setShowRefInput(false), style: { background: "none", border: "none", cursor: "pointer", color: "#a1a1aa", padding: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 12 }) })
23404
24967
  ] }),
23405
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
24968
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "6px" }, children: [
23406
24969
  /* @__PURE__ */ jsxRuntime.jsx(
23407
24970
  "input",
23408
24971
  {
@@ -23410,7 +24973,7 @@ var UploadField = ({
23410
24973
  value: refCode,
23411
24974
  onChange: (e3) => setRefCode(e3.target.value),
23412
24975
  placeholder: "{{ data. }}",
23413
- style: { flex: 1, padding: "8px 10px", fontSize: "13px", borderRadius: "6px", border: "1px solid #cbd5e1", outline: "none" },
24976
+ style: { flex: 1, padding: "6px 8px", fontSize: "12px", borderRadius: "6px", border: "1px solid #cbd5e1", outline: "none" },
23414
24977
  autoFocus: true,
23415
24978
  onKeyDown: (e3) => {
23416
24979
  if (e3.key === "Enter") {
@@ -23425,7 +24988,7 @@ var UploadField = ({
23425
24988
  {
23426
24989
  type: "button",
23427
24990
  onClick: handleAddRef,
23428
- style: { padding: "0 12px", background: "#4f46e5", color: "#fff", fontSize: "12px", fontWeight: 500, borderRadius: "6px", border: "none", cursor: "pointer" },
24991
+ style: { padding: "0 10px", background: "#18181b", color: "#fff", fontSize: "11px", fontWeight: 500, borderRadius: "6px", border: "none", cursor: "pointer" },
23429
24992
  children: "Ekle"
23430
24993
  }
23431
24994
  )
@@ -23469,97 +25032,18 @@ var UploadField = ({
23469
25032
  }
23470
25033
  ) })
23471
25034
  ] }),
23472
- /* @__PURE__ */ jsxRuntime.jsx(Drawer.Root, { open: drawerOpen, onOpenChange: (open) => {
23473
- setDrawerOpen(open);
23474
- if (!open) setGallerySearch("");
23475
- }, children: /* @__PURE__ */ jsxRuntime.jsxs(Drawer.Portal, { children: [
23476
- /* @__PURE__ */ jsxRuntime.jsx(Drawer.Overlay, { className: "tecof-upload-drawer-overlay" }),
23477
- /* @__PURE__ */ jsxRuntime.jsxs(Drawer.Content, { className: "tecof-upload-drawer-content", children: [
23478
- /* @__PURE__ */ jsxRuntime.jsx(Drawer.Title, { className: "tecof-sr-only", children: "Medya Y\xF6neticisi" }),
23479
- /* @__PURE__ */ jsxRuntime.jsx(Drawer.Description, { className: "tecof-sr-only", children: "Sunucudaki dosyalardan birini se\xE7in veya yeni dosya y\xFCkleyin" }),
23480
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-drawer-handle" }),
23481
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-drawer-inner", children: [
23482
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-drawer-header", children: [
23483
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "tecof-upload-drawer-title", children: "Medya K\xFCt\xFCphanesi" }),
23484
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-drawer-header-actions", children: [
23485
- /* @__PURE__ */ jsxRuntime.jsx(
23486
- "button",
23487
- {
23488
- className: "tecof-upload-drawer-action-btn",
23489
- onClick: () => setRefreshKey((k2) => k2 + 1),
23490
- disabled: loading,
23491
- title: "Yenile",
23492
- children: /* @__PURE__ */ jsxRuntime.jsx(RefreshCcw, { size: 15, className: loading ? "tecof-upload-spin" : "" })
23493
- }
23494
- ),
23495
- /* @__PURE__ */ jsxRuntime.jsx(
23496
- "button",
23497
- {
23498
- className: "tecof-upload-drawer-action-btn",
23499
- onClick: () => setDrawerOpen(false),
23500
- title: "Kapat",
23501
- children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 15 })
23502
- }
23503
- )
23504
- ] })
23505
- ] }),
23506
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-search-box", children: [
23507
- /* @__PURE__ */ jsxRuntime.jsx(Search, { size: 15, color: "#a1a1aa" }),
23508
- /* @__PURE__ */ jsxRuntime.jsx(
23509
- "input",
23510
- {
23511
- type: "text",
23512
- placeholder: "Dosya ara...",
23513
- value: gallerySearch,
23514
- onChange: (e3) => setGallerySearch(e3.target.value),
23515
- className: "tecof-upload-search-input"
23516
- }
23517
- ),
23518
- gallerySearch && /* @__PURE__ */ jsxRuntime.jsx(
23519
- "button",
23520
- {
23521
- type: "button",
23522
- className: "tecof-upload-action-btn tecof-upload-clear-search-btn",
23523
- onClick: () => setGallerySearch(""),
23524
- children: /* @__PURE__ */ jsxRuntime.jsx(X, { size: 13 })
23525
- }
23526
- )
23527
- ] }),
23528
- loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-gallery-empty", children: [
23529
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-gallery-empty-icon", children: /* @__PURE__ */ jsxRuntime.jsx(RefreshCcw, { size: 24, color: "#a1a1aa", className: "tecof-upload-spin" }) }),
23530
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-loading-text", children: "Y\xFCkleniyor..." })
23531
- ] }) : filteredGallery.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "tecof-upload-gallery-empty", children: [
23532
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-gallery-empty-icon", children: /* @__PURE__ */ jsxRuntime.jsx(Image2, { size: 24, color: "#a1a1aa" }) }),
23533
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-empty-heading", children: gallerySearch ? "Sonu\xE7 bulunamad\u0131" : "Hen\xFCz dosya yok" }),
23534
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-empty-subheading", children: gallerySearch ? "Farkl\u0131 bir arama terimi deneyin" : "Dosyalar\u0131n\u0131z burada g\xF6r\xFCnecek" })
23535
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-gallery-grid", children: filteredGallery.map((file2) => {
23536
- const selected = value.some((v2) => v2._id === file2._id);
23537
- return /* @__PURE__ */ jsxRuntime.jsxs(
23538
- "div",
23539
- {
23540
- className: `tecof-upload-gallery-item ${selected ? "selected" : ""}`,
23541
- onClick: () => toggleGalleryFile(file2),
23542
- children: [
23543
- selected && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-gallery-check", children: /* @__PURE__ */ jsxRuntime.jsx(Check, { size: 12, strokeWidth: 3 }) }),
23544
- isImageType2(file2.type) ? /* @__PURE__ */ jsxRuntime.jsx(
23545
- TecofPicture,
23546
- {
23547
- data: file2,
23548
- alt: file2.name,
23549
- size: "thumbnail",
23550
- className: "tecof-upload-gallery-thumb",
23551
- imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "6px" }
23552
- }
23553
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "tecof-upload-gallery-thumb tecof-upload-gallery-file-icon-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(File2, { size: 24, color: "#a1a1aa" }) }),
23554
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "tecof-upload-gallery-file-name", children: file2.meta?.originalName || file2.name })
23555
- ]
23556
- },
23557
- file2._id
23558
- );
23559
- }) })
23560
- ] })
23561
- ] })
23562
- ] }) })
25035
+ /* @__PURE__ */ jsxRuntime.jsx(
25036
+ MediaDrawer,
25037
+ {
25038
+ open: drawerOpen,
25039
+ onOpenChange: setDrawerOpen,
25040
+ onSelect: toggleGalleryFile,
25041
+ selectedIds: value.map((v2) => v2._id ?? ""),
25042
+ allowMultiple,
25043
+ filterImages: acceptedTypes.length > 0 && acceptedTypes.every((t2) => t2.startsWith("image/")),
25044
+ title: "Medya K\xFCt\xFCphanesi"
25045
+ }
25046
+ )
23563
25047
  ] });
23564
25048
  };
23565
25049
  UploadField.displayName = "UploadField";
@@ -23571,7 +25055,7 @@ var createUploadField = (options = {}) => {
23571
25055
  label,
23572
25056
  labelIcon,
23573
25057
  visible,
23574
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
25058
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
23575
25059
  UploadField,
23576
25060
  {
23577
25061
  field,
@@ -23809,7 +25293,7 @@ var validators = {
23809
25293
  handler: validateHandler,
23810
25294
  initial: validateInitial
23811
25295
  };
23812
- function create3(initial) {
25296
+ function create4(initial) {
23813
25297
  var handler = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
23814
25298
  validators.initial(initial);
23815
25299
  validators.handler(handler);
@@ -23847,7 +25331,7 @@ function didStateUpdate(state3, handler, changes) {
23847
25331
  return changes;
23848
25332
  }
23849
25333
  var index = {
23850
- create: create3
25334
+ create: create4
23851
25335
  };
23852
25336
  var state_local_default = index;
23853
25337
 
@@ -24266,7 +25750,7 @@ var createCodeEditorField = (options = {}) => {
24266
25750
  label,
24267
25751
  labelIcon,
24268
25752
  visible,
24269
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
25753
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
24270
25754
  CodeEditorField,
24271
25755
  {
24272
25756
  field,
@@ -24513,7 +25997,7 @@ var createLinkField = (options = {}) => {
24513
25997
  label,
24514
25998
  labelIcon,
24515
25999
  visible,
24516
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
26000
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
24517
26001
  LinkField,
24518
26002
  {
24519
26003
  field,
@@ -24714,7 +26198,7 @@ var createColorField = (options = {}) => {
24714
26198
  label,
24715
26199
  labelIcon,
24716
26200
  visible,
24717
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
26201
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
24718
26202
  ColorField,
24719
26203
  {
24720
26204
  field,
@@ -25016,7 +26500,7 @@ var createRepeaterField = (options) => {
25016
26500
  label,
25017
26501
  labelIcon,
25018
26502
  visible,
25019
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
26503
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
25020
26504
  RepeaterField,
25021
26505
  {
25022
26506
  field,
@@ -25317,7 +26801,7 @@ var createCmsCollectionField = (options = {}) => {
25317
26801
  label,
25318
26802
  labelIcon,
25319
26803
  visible,
25320
- render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(core.FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
26804
+ render: ({ value, onChange, readOnly, field, name: name3, id }) => /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { label: label || "", icon: labelIcon, readOnly, children: /* @__PURE__ */ jsxRuntime.jsx(FieldErrorBoundary, { fieldName: name3, children: /* @__PURE__ */ jsxRuntime.jsx(
25321
26805
  CmsCollectionField,
25322
26806
  {
25323
26807
  field,
@@ -25489,9 +26973,12 @@ lucide-react/dist/esm/shared/src/utils/hasA11yProp.js:
25489
26973
  lucide-react/dist/esm/context.js:
25490
26974
  lucide-react/dist/esm/Icon.js:
25491
26975
  lucide-react/dist/esm/createLucideIcon.js:
26976
+ lucide-react/dist/esm/icons/arrow-down.js:
26977
+ lucide-react/dist/esm/icons/arrow-up.js:
25492
26978
  lucide-react/dist/esm/icons/check.js:
25493
26979
  lucide-react/dist/esm/icons/chevron-down.js:
25494
26980
  lucide-react/dist/esm/icons/chevron-right.js:
26981
+ lucide-react/dist/esm/icons/chevron-up.js:
25495
26982
  lucide-react/dist/esm/icons/code.js:
25496
26983
  lucide-react/dist/esm/icons/copy.js:
25497
26984
  lucide-react/dist/esm/icons/database.js:
@@ -25612,6 +27099,7 @@ exports.TecofEditor = TecofEditor;
25612
27099
  exports.TecofPicture = TecofPicture;
25613
27100
  exports.TecofProvider = TecofProvider;
25614
27101
  exports.TecofRender = TecofRender;
27102
+ exports.TecofStudio = TecofStudio;
25615
27103
  exports.UnderConstruction = UnderConstruction;
25616
27104
  exports.UploadField = UploadField;
25617
27105
  exports.createCmsCollectionField = createCmsCollectionField;