@tecof/theme-editor 0.0.19 → 0.0.21

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
@@ -226,7 +226,7 @@ var TecofEditor = ({
226
226
  plugins: extraPlugins,
227
227
  className
228
228
  }) => {
229
- const { apiClient } = useTecof();
229
+ const { apiClient, secretKey } = useTecof();
230
230
  const [initialData, setInitialData] = useState(null);
231
231
  const [loading, setLoading] = useState(true);
232
232
  const [saving, setSaving] = useState(false);
@@ -354,7 +354,42 @@ var TecofEditor = ({
354
354
  ...fieldsPlugin ? [fieldsPlugin({ desktopSideBar: "left" })] : [],
355
355
  ...extraPlugins || []
356
356
  ];
357
- const mergedOverrides = { header: () => /* @__PURE__ */ jsx(Fragment, {}), ...overrides || {} };
357
+ const mergedOverrides = {
358
+ header: () => /* @__PURE__ */ jsx(Fragment, {}),
359
+ drawerItem: ({ children, name: name3 }) => {
360
+ const token = secretKey;
361
+ return /* @__PURE__ */ jsxs("div", { className: "tecof-drawer-item-group group", children: [
362
+ children,
363
+ /* @__PURE__ */ jsxs("div", { className: "tecof-drawer-popover", children: [
364
+ /* @__PURE__ */ jsxs("div", { className: "tecof-drawer-popover-header", children: [
365
+ name3,
366
+ " \xD6nizleme"
367
+ ] }),
368
+ /* @__PURE__ */ jsxs("div", { className: "tecof-drawer-popover-body", children: [
369
+ /* @__PURE__ */ jsx("div", { className: "tecof-drawer-skeleton" }),
370
+ /* @__PURE__ */ jsx(
371
+ "img",
372
+ {
373
+ src: `/api/screenshot?componentName=${name3}&token=${token}`,
374
+ alt: `${name3} preview`,
375
+ className: "tecof-drawer-img",
376
+ onLoad: (e3) => {
377
+ const loader2 = e3.currentTarget.previousElementSibling;
378
+ if (loader2) loader2.remove();
379
+ },
380
+ onError: (e3) => {
381
+ const loader2 = e3.currentTarget.previousElementSibling;
382
+ if (loader2) loader2.remove();
383
+ e3.currentTarget.style.display = "none";
384
+ }
385
+ }
386
+ )
387
+ ] })
388
+ ] })
389
+ ] });
390
+ },
391
+ ...overrides || {}
392
+ };
358
393
  return /* @__PURE__ */ jsxs("div", { className: `tecof-editor-wrapper ${className || ""}`.trim(), children: [
359
394
  /* @__PURE__ */ jsx(
360
395
  Puck,