@tecof/theme-editor 0.0.13 → 0.0.14

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';
@@ -22312,9 +22312,8 @@ var FileItemRenderer = ({
22312
22312
  data: file2,
22313
22313
  alt: file2.meta?.originalName || file2.name,
22314
22314
  size: "thumbnail",
22315
- fill: true,
22316
22315
  className: "tecof-upload-file-thumb",
22317
- imgStyle: { objectFit: "cover", borderRadius: "10px" }
22316
+ imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "10px" }
22318
22317
  }
22319
22318
  ) : /* @__PURE__ */ jsx("div", { className: "tecof-upload-file-icon", children: /* @__PURE__ */ jsx(File2, { size: 20 }) }),
22320
22319
  /* @__PURE__ */ jsxs("div", { className: "tecof-upload-file-info", children: [
@@ -22756,9 +22755,8 @@ var UploadField = ({
22756
22755
  data: file2,
22757
22756
  alt: file2.name,
22758
22757
  size: "thumbnail",
22759
- fill: true,
22760
22758
  className: "tecof-upload-gallery-thumb",
22761
- imgStyle: { objectFit: "cover", borderRadius: "6px" }
22759
+ imgStyle: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "6px" }
22762
22760
  }
22763
22761
  ) : /* @__PURE__ */ jsx("div", { className: "tecof-upload-gallery-thumb tecof-upload-gallery-file-icon-wrap", children: /* @__PURE__ */ jsx(File2, { size: 24, color: "#a1a1aa" }) }),
22764
22762
  /* @__PURE__ */ jsx("p", { className: "tecof-upload-gallery-file-name", children: file2.meta?.originalName || file2.name })
@@ -23437,9 +23435,15 @@ var CodeEditorField = forwardRef(({
23437
23435
  theme = "vs-dark"
23438
23436
  }, ref) => {
23439
23437
  const editorRef = useRef(null);
23440
- const handleEditorDidMount = (editor2) => {
23438
+ const onChangeRef = useRef(onChange);
23439
+ onChangeRef.current = onChange;
23440
+ const handleEditorDidMount = useCallback((editor2) => {
23441
23441
  editorRef.current = editor2;
23442
- };
23442
+ editor2.onDidChangeModelContent(() => {
23443
+ const newValue = editor2.getValue();
23444
+ onChangeRef.current(newValue);
23445
+ });
23446
+ }, []);
23443
23447
  return /* @__PURE__ */ jsx("div", { ref, className: "tecof-code-editor-container", children: /* @__PURE__ */ jsx(
23444
23448
  Ft,
23445
23449
  {
@@ -23448,8 +23452,7 @@ var CodeEditorField = forwardRef(({
23448
23452
  width: "100%",
23449
23453
  height,
23450
23454
  defaultLanguage,
23451
- value: value || "",
23452
- onChange: (val) => onChange(val || ""),
23455
+ defaultValue: value || "",
23453
23456
  options: {
23454
23457
  readOnly,
23455
23458
  minimap: { enabled: false },