@tecof/theme-editor 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React__default from 'react';
2
- import React__default__default, { createContext, memo, forwardRef, createElement, useRef, useContext, useState, useCallback, useEffect, useMemo, useLayoutEffect } from 'react';
2
+ import React__default__default, { createContext, memo, forwardRef, createElement, useRef, useCallback, useContext, useState, useEffect, useMemo, useLayoutEffect } from 'react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import { fieldsPlugin, Puck, Render, FieldLabel } from '@puckeditor/core';
5
5
  import { useEditor, EditorContent } from '@tiptap/react';
@@ -646,37 +646,16 @@ var __iconNode3 = [
646
646
  ];
647
647
  var Copy = createLucideIcon("copy", __iconNode3);
648
648
 
649
- // node_modules/lucide-react/dist/esm/icons/download.js
650
- var __iconNode4 = [
651
- ["path", { d: "M12 15V3", key: "m9g1x1" }],
652
- ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
653
- ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
654
- ];
655
- var Download = createLucideIcon("download", __iconNode4);
656
-
657
649
  // node_modules/lucide-react/dist/esm/icons/external-link.js
658
- var __iconNode5 = [
650
+ var __iconNode4 = [
659
651
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
660
652
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
661
653
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
662
654
  ];
663
- var ExternalLink = createLucideIcon("external-link", __iconNode5);
664
-
665
- // node_modules/lucide-react/dist/esm/icons/eye.js
666
- var __iconNode6 = [
667
- [
668
- "path",
669
- {
670
- d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
671
- key: "1nclc0"
672
- }
673
- ],
674
- ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
675
- ];
676
- var Eye = createLucideIcon("eye", __iconNode6);
655
+ var ExternalLink = createLucideIcon("external-link", __iconNode4);
677
656
 
678
657
  // node_modules/lucide-react/dist/esm/icons/file-text.js
679
- var __iconNode7 = [
658
+ var __iconNode5 = [
680
659
  [
681
660
  "path",
682
661
  {
@@ -689,10 +668,10 @@ var __iconNode7 = [
689
668
  ["path", { d: "M16 13H8", key: "t4e002" }],
690
669
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
691
670
  ];
692
- var FileText = createLucideIcon("file-text", __iconNode7);
671
+ var FileText = createLucideIcon("file-text", __iconNode5);
693
672
 
694
673
  // node_modules/lucide-react/dist/esm/icons/file.js
695
- var __iconNode8 = [
674
+ var __iconNode6 = [
696
675
  [
697
676
  "path",
698
677
  {
@@ -702,10 +681,10 @@ var __iconNode8 = [
702
681
  ],
703
682
  ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
704
683
  ];
705
- var File2 = createLucideIcon("file", __iconNode8);
684
+ var File2 = createLucideIcon("file", __iconNode6);
706
685
 
707
686
  // node_modules/lucide-react/dist/esm/icons/folder-open.js
708
- var __iconNode9 = [
687
+ var __iconNode7 = [
709
688
  [
710
689
  "path",
711
690
  {
@@ -714,36 +693,36 @@ var __iconNode9 = [
714
693
  }
715
694
  ]
716
695
  ];
717
- var FolderOpen = createLucideIcon("folder-open", __iconNode9);
696
+ var FolderOpen = createLucideIcon("folder-open", __iconNode7);
718
697
 
719
698
  // node_modules/lucide-react/dist/esm/icons/globe.js
720
- var __iconNode10 = [
699
+ var __iconNode8 = [
721
700
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
722
701
  ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
723
702
  ["path", { d: "M2 12h20", key: "9i4pu4" }]
724
703
  ];
725
- var Globe = createLucideIcon("globe", __iconNode10);
704
+ var Globe = createLucideIcon("globe", __iconNode8);
726
705
 
727
706
  // node_modules/lucide-react/dist/esm/icons/image-plus.js
728
- var __iconNode11 = [
707
+ var __iconNode9 = [
729
708
  ["path", { d: "M16 5h6", key: "1vod17" }],
730
709
  ["path", { d: "M19 2v6", key: "4bpg5p" }],
731
710
  ["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" }],
732
711
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }],
733
712
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }]
734
713
  ];
735
- var ImagePlus = createLucideIcon("image-plus", __iconNode11);
714
+ var ImagePlus = createLucideIcon("image-plus", __iconNode9);
736
715
 
737
716
  // node_modules/lucide-react/dist/esm/icons/image.js
738
- var __iconNode12 = [
717
+ var __iconNode10 = [
739
718
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
740
719
  ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
741
720
  ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
742
721
  ];
743
- var Image2 = createLucideIcon("image", __iconNode12);
722
+ var Image2 = createLucideIcon("image", __iconNode10);
744
723
 
745
724
  // node_modules/lucide-react/dist/esm/icons/languages.js
746
- var __iconNode13 = [
725
+ var __iconNode11 = [
747
726
  ["path", { d: "m5 8 6 6", key: "1wu5hv" }],
748
727
  ["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
749
728
  ["path", { d: "M2 5h12", key: "or177f" }],
@@ -751,21 +730,21 @@ var __iconNode13 = [
751
730
  ["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
752
731
  ["path", { d: "M14 18h6", key: "1m8k6r" }]
753
732
  ];
754
- var Languages = createLucideIcon("languages", __iconNode13);
733
+ var Languages = createLucideIcon("languages", __iconNode11);
755
734
 
756
735
  // node_modules/lucide-react/dist/esm/icons/link.js
757
- var __iconNode14 = [
736
+ var __iconNode12 = [
758
737
  ["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" }],
759
738
  ["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" }]
760
739
  ];
761
- var Link = createLucideIcon("link", __iconNode14);
740
+ var Link = createLucideIcon("link", __iconNode12);
762
741
 
763
742
  // node_modules/lucide-react/dist/esm/icons/loader-circle.js
764
- var __iconNode15 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
765
- var LoaderCircle = createLucideIcon("loader-circle", __iconNode15);
743
+ var __iconNode13 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
744
+ var LoaderCircle = createLucideIcon("loader-circle", __iconNode13);
766
745
 
767
746
  // node_modules/lucide-react/dist/esm/icons/pencil.js
768
- var __iconNode16 = [
747
+ var __iconNode14 = [
769
748
  [
770
749
  "path",
771
750
  {
@@ -775,55 +754,55 @@ var __iconNode16 = [
775
754
  ],
776
755
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
777
756
  ];
778
- var Pencil = createLucideIcon("pencil", __iconNode16);
757
+ var Pencil = createLucideIcon("pencil", __iconNode14);
779
758
 
780
759
  // node_modules/lucide-react/dist/esm/icons/refresh-ccw.js
781
- var __iconNode17 = [
760
+ var __iconNode15 = [
782
761
  ["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
783
762
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
784
763
  ["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
785
764
  ["path", { d: "M16 16h5v5", key: "ccwih5" }]
786
765
  ];
787
- var RefreshCcw = createLucideIcon("refresh-ccw", __iconNode17);
766
+ var RefreshCcw = createLucideIcon("refresh-ccw", __iconNode15);
788
767
 
789
768
  // node_modules/lucide-react/dist/esm/icons/rotate-ccw.js
790
- var __iconNode18 = [
769
+ var __iconNode16 = [
791
770
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
792
771
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
793
772
  ];
794
- var RotateCcw = createLucideIcon("rotate-ccw", __iconNode18);
773
+ var RotateCcw = createLucideIcon("rotate-ccw", __iconNode16);
795
774
 
796
775
  // node_modules/lucide-react/dist/esm/icons/search.js
797
- var __iconNode19 = [
776
+ var __iconNode17 = [
798
777
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
799
778
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
800
779
  ];
801
- var Search = createLucideIcon("search", __iconNode19);
780
+ var Search = createLucideIcon("search", __iconNode17);
802
781
 
803
782
  // node_modules/lucide-react/dist/esm/icons/trash-2.js
804
- var __iconNode20 = [
783
+ var __iconNode18 = [
805
784
  ["path", { d: "M10 11v6", key: "nco0om" }],
806
785
  ["path", { d: "M14 11v6", key: "outv1u" }],
807
786
  ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
808
787
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
809
788
  ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
810
789
  ];
811
- var Trash2 = createLucideIcon("trash-2", __iconNode20);
790
+ var Trash2 = createLucideIcon("trash-2", __iconNode18);
812
791
 
813
792
  // node_modules/lucide-react/dist/esm/icons/upload.js
814
- var __iconNode21 = [
793
+ var __iconNode19 = [
815
794
  ["path", { d: "M12 3v12", key: "1x0j5s" }],
816
795
  ["path", { d: "m17 8-5-5-5 5", key: "7q97r8" }],
817
796
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }]
818
797
  ];
819
- var Upload = createLucideIcon("upload", __iconNode21);
798
+ var Upload = createLucideIcon("upload", __iconNode19);
820
799
 
821
800
  // node_modules/lucide-react/dist/esm/icons/x.js
822
- var __iconNode22 = [
801
+ var __iconNode20 = [
823
802
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
824
803
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
825
804
  ];
826
- var X = createLucideIcon("x", __iconNode22);
805
+ var X = createLucideIcon("x", __iconNode20);
827
806
  var LanguageTabBar = ({
828
807
  languages,
829
808
  defaultLanguage,
@@ -22303,7 +22282,7 @@ var FileItemRenderer = ({
22303
22282
  cdnUrl,
22304
22283
  readOnly
22305
22284
  }) => {
22306
- const fileUrl = `${cdnUrl}/${file2.name}`;
22285
+ `${cdnUrl}/${file2.name}`;
22307
22286
  const ext = getFileExtension(file2.name);
22308
22287
  return /* @__PURE__ */ jsxs("div", { className: "tecof-upload-file-item", children: [
22309
22288
  isImageType(file2.type) ? /* @__PURE__ */ jsx(
@@ -22312,9 +22291,8 @@ var FileItemRenderer = ({
22312
22291
  data: file2,
22313
22292
  alt: file2.meta?.originalName || file2.name,
22314
22293
  size: "thumbnail",
22315
- fill: true,
22316
22294
  className: "tecof-upload-file-thumb",
22317
- imgStyle: { objectFit: "cover", borderRadius: "10px" }
22295
+ imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "10px" }
22318
22296
  }
22319
22297
  ) : /* @__PURE__ */ jsx("div", { className: "tecof-upload-file-icon", children: /* @__PURE__ */ jsx(File2, { size: 20 }) }),
22320
22298
  /* @__PURE__ */ jsxs("div", { className: "tecof-upload-file-info", children: [
@@ -22324,30 +22302,7 @@ var FileItemRenderer = ({
22324
22302
  file2.size > 0 && /* @__PURE__ */ jsx("span", { className: "tecof-upload-file-size", children: formatBytes(file2.size) })
22325
22303
  ] })
22326
22304
  ] }),
22327
- /* @__PURE__ */ jsxs("div", { className: "tecof-upload-file-actions", children: [
22328
- /* @__PURE__ */ jsx(
22329
- "a",
22330
- {
22331
- href: fileUrl,
22332
- target: "_blank",
22333
- rel: "noopener noreferrer",
22334
- className: "tecof-upload-action-btn",
22335
- title: "G\xF6r\xFCnt\xFCle",
22336
- children: /* @__PURE__ */ jsx(Eye, { size: 15 })
22337
- }
22338
- ),
22339
- /* @__PURE__ */ jsx(
22340
- "a",
22341
- {
22342
- href: fileUrl,
22343
- download: true,
22344
- className: "tecof-upload-action-btn",
22345
- title: "\u0130ndir",
22346
- children: /* @__PURE__ */ jsx(Download, { size: 15 })
22347
- }
22348
- ),
22349
- !readOnly && onRemove && /* @__PURE__ */ jsx("button", { type: "button", className: "tecof-upload-action-btn tecof-upload-action-btn-danger", onClick: onRemove, title: "Kald\u0131r", children: /* @__PURE__ */ jsx(Trash2, { size: 14 }) })
22350
- ] })
22305
+ /* @__PURE__ */ jsx("div", { className: "tecof-upload-file-actions", children: !readOnly && onRemove && /* @__PURE__ */ jsx("button", { type: "button", className: "tecof-upload-action-btn tecof-upload-action-btn-danger", onClick: onRemove, title: "Kald\u0131r", children: /* @__PURE__ */ jsx(Trash2, { size: 13 }) }) })
22351
22306
  ] });
22352
22307
  };
22353
22308
  var FILEPOND_LABELS = {
@@ -22756,9 +22711,8 @@ var UploadField = ({
22756
22711
  data: file2,
22757
22712
  alt: file2.name,
22758
22713
  size: "thumbnail",
22759
- fill: true,
22760
22714
  className: "tecof-upload-gallery-thumb",
22761
- imgStyle: { objectFit: "cover", borderRadius: "6px" }
22715
+ imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "6px" }
22762
22716
  }
22763
22717
  ) : /* @__PURE__ */ jsx("div", { className: "tecof-upload-gallery-thumb tecof-upload-gallery-file-icon-wrap", children: /* @__PURE__ */ jsx(File2, { size: 24, color: "#a1a1aa" }) }),
22764
22718
  /* @__PURE__ */ jsx("p", { className: "tecof-upload-gallery-file-name", children: file2.meta?.originalName || file2.name })
@@ -23437,9 +23391,15 @@ var CodeEditorField = forwardRef(({
23437
23391
  theme = "vs-dark"
23438
23392
  }, ref) => {
23439
23393
  const editorRef = useRef(null);
23440
- const handleEditorDidMount = (editor2) => {
23394
+ const onChangeRef = useRef(onChange);
23395
+ onChangeRef.current = onChange;
23396
+ const handleEditorDidMount = useCallback((editor2) => {
23441
23397
  editorRef.current = editor2;
23442
- };
23398
+ editor2.onDidChangeModelContent(() => {
23399
+ const newValue = editor2.getValue();
23400
+ onChangeRef.current(newValue);
23401
+ });
23402
+ }, []);
23443
23403
  return /* @__PURE__ */ jsx("div", { ref, className: "tecof-code-editor-container", children: /* @__PURE__ */ jsx(
23444
23404
  Ft,
23445
23405
  {
@@ -23448,8 +23408,7 @@ var CodeEditorField = forwardRef(({
23448
23408
  width: "100%",
23449
23409
  height,
23450
23410
  defaultLanguage,
23451
- value: value || "",
23452
- onChange: (val) => onChange(val || ""),
23411
+ defaultValue: value || "",
23453
23412
  options: {
23454
23413
  readOnly,
23455
23414
  minimap: { enabled: false },
@@ -24161,9 +24120,7 @@ lucide-react/dist/esm/createLucideIcon.js:
24161
24120
  lucide-react/dist/esm/icons/check.js:
24162
24121
  lucide-react/dist/esm/icons/chevron-right.js:
24163
24122
  lucide-react/dist/esm/icons/copy.js:
24164
- lucide-react/dist/esm/icons/download.js:
24165
24123
  lucide-react/dist/esm/icons/external-link.js:
24166
- lucide-react/dist/esm/icons/eye.js:
24167
24124
  lucide-react/dist/esm/icons/file-text.js:
24168
24125
  lucide-react/dist/esm/icons/file.js:
24169
24126
  lucide-react/dist/esm/icons/folder-open.js: