@crediblemark/build 0.24.2 → 0.24.4

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.
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  SubField
3
- } from "./chunk-P6XSBCUA.mjs";
3
+ } from "./chunk-IRJS3HWQ.mjs";
4
4
  import {
5
5
  DragIcon,
6
6
  createDynamicCollisionDetector,
7
7
  setDeep,
8
8
  useSensors
9
- } from "./chunk-62JTNLF7.mjs";
9
+ } from "./chunk-BQW2NTNG.mjs";
10
10
  import {
11
11
  getDeep,
12
12
  useFieldStore,
13
13
  useFieldStoreApi,
14
14
  useNestedFieldContext
15
- } from "./chunk-ACKK2BYK.mjs";
16
- import "./chunk-RUAHVDDE.mjs";
15
+ } from "./chunk-H2LU4EW3.mjs";
16
+ import "./chunk-2VS2BST6.mjs";
17
17
  import "./chunk-AL77I3BV.mjs";
18
18
  import {
19
19
  IconButton
20
- } from "./chunk-AP7SVXSU.mjs";
21
- import "./chunk-7HQNPCGI.mjs";
22
- import "./chunk-QA2U7BOE.mjs";
23
- import "./chunk-6TAU2PST.mjs";
20
+ } from "./chunk-VBNE6GK2.mjs";
21
+ import "./chunk-LBMMY5IM.mjs";
22
+ import "./chunk-WKMRHPOM.mjs";
23
+ import "./chunk-5OK3IPVN.mjs";
24
24
  import {
25
25
  Copy,
26
26
  List,
@@ -30,7 +30,7 @@ import {
30
30
  replace,
31
31
  useAppStore,
32
32
  useAppStoreApi
33
- } from "./chunk-E7XYUXJM.mjs";
33
+ } from "./chunk-GIUKL443.mjs";
34
34
  import {
35
35
  populateIds
36
36
  } from "./chunk-64A37UUC.mjs";
@@ -3,19 +3,19 @@ import {
3
3
  } from "./chunk-DEUK76GN.mjs";
4
4
  import {
5
5
  LoadedRichTextMenu
6
- } from "./chunk-FC3ZRBT2.mjs";
6
+ } from "./chunk-6RPYD5IO.mjs";
7
7
  import {
8
8
  EditorInner
9
- } from "./chunk-RUAHVDDE.mjs";
9
+ } from "./chunk-2VS2BST6.mjs";
10
10
  import "./chunk-AL77I3BV.mjs";
11
- import "./chunk-AP7SVXSU.mjs";
12
- import "./chunk-7HQNPCGI.mjs";
13
- import "./chunk-QA2U7BOE.mjs";
14
- import "./chunk-6TAU2PST.mjs";
11
+ import "./chunk-VBNE6GK2.mjs";
12
+ import "./chunk-LBMMY5IM.mjs";
13
+ import "./chunk-WKMRHPOM.mjs";
14
+ import "./chunk-5OK3IPVN.mjs";
15
15
  import {
16
16
  useAppStore,
17
17
  useAppStoreApi
18
- } from "./chunk-E7XYUXJM.mjs";
18
+ } from "./chunk-GIUKL443.mjs";
19
19
  import "./chunk-64A37UUC.mjs";
20
20
  import "./chunk-SMAWAXVX.mjs";
21
21
  import "./chunk-BFHV72KK.mjs";
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  SubField
3
- } from "./chunk-P6XSBCUA.mjs";
3
+ } from "./chunk-IRJS3HWQ.mjs";
4
4
  import {
5
5
  getDeep,
6
6
  useFieldStoreApi,
7
7
  useNestedFieldContext
8
- } from "./chunk-ACKK2BYK.mjs";
9
- import "./chunk-RUAHVDDE.mjs";
8
+ } from "./chunk-H2LU4EW3.mjs";
9
+ import "./chunk-2VS2BST6.mjs";
10
10
  import "./chunk-AL77I3BV.mjs";
11
- import "./chunk-AP7SVXSU.mjs";
12
- import "./chunk-7HQNPCGI.mjs";
13
- import "./chunk-QA2U7BOE.mjs";
14
- import "./chunk-6TAU2PST.mjs";
11
+ import "./chunk-VBNE6GK2.mjs";
12
+ import "./chunk-LBMMY5IM.mjs";
13
+ import "./chunk-WKMRHPOM.mjs";
14
+ import "./chunk-5OK3IPVN.mjs";
15
15
  import {
16
16
  EllipsisVertical,
17
17
  useAppStore
18
- } from "./chunk-E7XYUXJM.mjs";
18
+ } from "./chunk-GIUKL443.mjs";
19
19
  import "./chunk-64A37UUC.mjs";
20
20
  import "./chunk-SMAWAXVX.mjs";
21
21
  import {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  useAppStore,
6
6
  useAppStoreApi
7
- } from "./chunk-E7XYUXJM.mjs";
7
+ } from "./chunk-GIUKL443.mjs";
8
8
  import {
9
9
  get_class_name_factory_default
10
10
  } from "./chunk-BFHV72KK.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  List,
3
3
  ListOrdered
4
- } from "./chunk-E7XYUXJM.mjs";
4
+ } from "./chunk-GIUKL443.mjs";
5
5
 
6
6
  // components/RichTextMenu/controls/ListSelect/use-options.ts
7
7
  import { useMemo } from "react";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  LoadedRichTextMenuInner
3
- } from "./chunk-AP7SVXSU.mjs";
3
+ } from "./chunk-VBNE6GK2.mjs";
4
4
 
5
5
  // components/RichTextMenu/index.tsx
6
6
  import { lazy, Suspense } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  var LoadedRichTextMenuFull = lazy(
9
- () => import("./full-AGQP4VE6.mjs").then((m) => ({
9
+ () => import("./full-65U7W6EN.mjs").then((m) => ({
10
10
  default: m.LoadedRichTextMenuFull
11
11
  }))
12
12
  );
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  GripVertical
3
- } from "./chunk-E7XYUXJM.mjs";
3
+ } from "./chunk-GIUKL443.mjs";
4
4
  import {
5
5
  get_class_name_factory_default
6
6
  } from "./chunk-BFHV72KK.mjs";
@@ -1652,22 +1652,22 @@ var getZoomConfig = (uiViewport, frame, zoom) => {
1652
1652
  const viewportHeight = uiViewport.height === "auto" ? frameHeight : uiViewport.height;
1653
1653
  let rootHeight = 0;
1654
1654
  let autoZoom = 1;
1655
- if (typeof uiViewport.width === "number" && (uiViewport.width > frameWidth || viewportHeight > frameHeight)) {
1655
+ if (typeof uiViewport.width === "number" && uiViewport.width > 0 && (uiViewport.width > frameWidth || typeof viewportHeight === "number" && viewportHeight > frameHeight)) {
1656
1656
  const widthZoom = Math.min(frameWidth / uiViewport.width, 1);
1657
- const heightZoom = Math.min(frameHeight / viewportHeight, 1);
1658
- zoom = widthZoom;
1657
+ const heightZoom = typeof viewportHeight === "number" ? Math.min(frameHeight / viewportHeight, 1) : 1;
1658
+ zoom = Math.max(widthZoom, 0.01);
1659
1659
  if (widthZoom < heightZoom) {
1660
- rootHeight = viewportHeight / zoom;
1660
+ rootHeight = typeof viewportHeight === "number" ? viewportHeight / zoom : frameHeight;
1661
1661
  } else {
1662
- rootHeight = viewportHeight;
1663
- zoom = heightZoom;
1662
+ rootHeight = typeof viewportHeight === "number" ? viewportHeight : 0;
1663
+ zoom = Math.max(heightZoom, 0.01);
1664
1664
  }
1665
1665
  autoZoom = zoom;
1666
1666
  } else {
1667
1667
  if (RESET_ZOOM_SMALLER_THAN_FRAME) {
1668
1668
  autoZoom = 1;
1669
1669
  zoom = 1;
1670
- rootHeight = viewportHeight;
1670
+ rootHeight = typeof viewportHeight === "number" ? viewportHeight : 0;
1671
1671
  }
1672
1672
  }
1673
1673
  return { autoZoom, rootHeight, zoom };
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  EditorInner
3
- } from "./chunk-RUAHVDDE.mjs";
3
+ } from "./chunk-2VS2BST6.mjs";
4
4
  import {
5
5
  IconButton,
6
6
  LoadedRichTextMenuInner,
7
7
  Loader
8
- } from "./chunk-AP7SVXSU.mjs";
8
+ } from "./chunk-VBNE6GK2.mjs";
9
9
  import {
10
10
  ChevronDown,
11
11
  CircleCheckBig,
@@ -17,7 +17,7 @@ import {
17
17
  SlidersHorizontal,
18
18
  Type,
19
19
  useAppStore
20
- } from "./chunk-E7XYUXJM.mjs";
20
+ } from "./chunk-GIUKL443.mjs";
21
21
  import {
22
22
  get_class_name_factory_default
23
23
  } from "./chunk-BFHV72KK.mjs";
@@ -907,7 +907,7 @@ EditorFallback.displayName = "EditorFallback";
907
907
  // components/AutoField/fields/RichtextField/index.tsx
908
908
  import { Fragment as Fragment4, jsx as jsx14 } from "react/jsx-runtime";
909
909
  var Editor = lazy(
910
- () => import("./Editor-5TR52PVR.mjs").then((m) => ({
910
+ () => import("./Editor-HOZVZZIZ.mjs").then((m) => ({
911
911
  default: m.Editor
912
912
  }))
913
913
  );
@@ -944,8 +944,8 @@ var RichtextField = ({
944
944
 
945
945
  // components/AutoField/AutoFieldInternal.tsx
946
946
  import { jsx as jsx15 } from "react/jsx-runtime";
947
- var ArrayField = lazy2(() => import("./ArrayField-MR3B7WKR.mjs").then((m) => ({ default: m.ArrayField })));
948
- var ObjectField = lazy2(() => import("./ObjectField-ZGTFFKHJ.mjs").then((m) => ({ default: m.ObjectField })));
947
+ var ArrayField = lazy2(() => import("./ArrayField-F7OLZF6U.mjs").then((m) => ({ default: m.ArrayField })));
948
+ var ObjectField = lazy2(() => import("./ObjectField-4SN4ZYFF.mjs").then((m) => ({ default: m.ObjectField })));
949
949
  var getClassNameWrapper = get_class_name_factory_default("InputWrapper", styles_module_default);
950
950
  var defaultFields = {
951
951
  array: ArrayField,
@@ -2,7 +2,7 @@ import {
2
2
  AutoFieldPrivate,
3
3
  NestedFieldProvider,
4
4
  useNestedFieldContext
5
- } from "./chunk-ACKK2BYK.mjs";
5
+ } from "./chunk-H2LU4EW3.mjs";
6
6
 
7
7
  // components/AutoField/subfield.tsx
8
8
  import { memo } from "react";
@@ -3,7 +3,7 @@ import {
3
3
  TextAlignEnd,
4
4
  TextAlignJustify,
5
5
  TextAlignStart
6
- } from "./chunk-E7XYUXJM.mjs";
6
+ } from "./chunk-GIUKL443.mjs";
7
7
 
8
8
  // components/RichTextMenu/controls/AlignSelect/use-options.ts
9
9
  import { useMemo } from "react";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  LoadedRichTextMenu
3
- } from "./chunk-FC3ZRBT2.mjs";
3
+ } from "./chunk-6RPYD5IO.mjs";
4
4
  import {
5
5
  DragIcon,
6
6
  collisionStore,
7
7
  createDynamicCollisionDetector,
8
8
  setDeep,
9
9
  useSensors
10
- } from "./chunk-62JTNLF7.mjs";
10
+ } from "./chunk-BQW2NTNG.mjs";
11
11
  import {
12
12
  AutoFieldPrivate,
13
13
  Button,
@@ -16,7 +16,7 @@ import {
16
16
  fieldContextStore,
17
17
  useContextStore,
18
18
  useSafeId
19
- } from "./chunk-ACKK2BYK.mjs";
19
+ } from "./chunk-H2LU4EW3.mjs";
20
20
  import {
21
21
  RichTextRenderFallback,
22
22
  SlotRender,
@@ -30,7 +30,7 @@ import {
30
30
  ActionBar,
31
31
  IconButton,
32
32
  Loader
33
- } from "./chunk-AP7SVXSU.mjs";
33
+ } from "./chunk-VBNE6GK2.mjs";
34
34
  import {
35
35
  Box,
36
36
  ChartColumn,
@@ -85,7 +85,7 @@ import {
85
85
  useRegisterHistorySlice,
86
86
  useRegisterPermissionsSlice,
87
87
  useResetAutoZoom
88
- } from "./chunk-E7XYUXJM.mjs";
88
+ } from "./chunk-GIUKL443.mjs";
89
89
  import {
90
90
  getItem,
91
91
  insert,
@@ -1518,7 +1518,7 @@ import {
1518
1518
  } from "react";
1519
1519
  import { jsx as jsx7 } from "react/jsx-runtime";
1520
1520
  var Editor = lazy(
1521
- () => import("./Editor-5TR52PVR.mjs").then((m) => ({
1521
+ () => import("./Editor-HOZVZZIZ.mjs").then((m) => ({
1522
1522
  default: m.Editor
1523
1523
  }))
1524
1524
  );
@@ -4932,18 +4932,18 @@ var ViewportControls = ({
4932
4932
  const defaultsContainAutoZoom = defaultZoomOptions.find(
4933
4933
  (option) => option.value === autoZoom
4934
4934
  );
4935
- const zoomOptions = useMemo16(
4936
- () => [
4935
+ const zoomOptions = useMemo16(() => {
4936
+ const options = [
4937
4937
  ...defaultZoomOptions,
4938
- ...defaultsContainAutoZoom ? [] : [
4938
+ ...defaultsContainAutoZoom || isNaN(autoZoom) ? [] : [
4939
4939
  {
4940
4940
  value: autoZoom,
4941
4941
  label: `${(autoZoom * 100).toFixed(0)}% (Auto)`
4942
4942
  }
4943
4943
  ]
4944
- ].filter((a) => a.value <= autoZoom).sort((a, b) => a.value > b.value ? 1 : -1),
4945
- [autoZoom, defaultsContainAutoZoom]
4946
- );
4944
+ ].filter((a) => a.value <= (autoZoom || 1)).sort((a, b) => a.value > b.value ? 1 : -1);
4945
+ return options.length > 0 ? options : defaultZoomOptions;
4946
+ }, [autoZoom, defaultsContainAutoZoom]);
4947
4947
  const [activeViewport, setActiveViewport] = useState12(
4948
4948
  uiViewports.current.width
4949
4949
  );
@@ -4976,15 +4976,15 @@ var ViewportControls = ({
4976
4976
  ActionButton,
4977
4977
  {
4978
4978
  title: "Zoom viewport out",
4979
- disabled: zoom <= zoomOptions[0]?.value,
4979
+ disabled: zoom <= (zoomOptions[0]?.value || 0),
4980
4980
  onClick: (e) => {
4981
4981
  e.stopPropagation();
4982
- onZoom(
4983
- zoomOptions[Math.max(
4984
- zoomOptions.findIndex((option) => option.value === zoom) - 1,
4985
- 0
4986
- )].value
4982
+ const currentIndex = zoomOptions.findIndex((option) => option.value === zoom);
4983
+ const nextIndex = Math.max(
4984
+ (currentIndex === -1 ? zoomOptions.length : currentIndex) - 1,
4985
+ 0
4987
4986
  );
4987
+ onZoom(zoomOptions[nextIndex]?.value || 1);
4988
4988
  },
4989
4989
  children: /* @__PURE__ */ jsx28(ZoomOut, { size: 16 })
4990
4990
  }
@@ -4993,15 +4993,15 @@ var ViewportControls = ({
4993
4993
  ActionButton,
4994
4994
  {
4995
4995
  title: "Zoom viewport in",
4996
- disabled: zoom >= zoomOptions[zoomOptions.length - 1]?.value,
4996
+ disabled: zoom >= (zoomOptions[zoomOptions.length - 1]?.value || 2),
4997
4997
  onClick: (e) => {
4998
4998
  e.stopPropagation();
4999
- onZoom(
5000
- zoomOptions[Math.min(
5001
- zoomOptions.findIndex((option) => option.value === zoom) + 1,
5002
- zoomOptions.length - 1
5003
- )].value
4999
+ const currentIndex = zoomOptions.findIndex((option) => option.value === zoom);
5000
+ const nextIndex = Math.min(
5001
+ (currentIndex === -1 ? -1 : currentIndex) + 1,
5002
+ zoomOptions.length - 1
5004
5003
  );
5004
+ onZoom(zoomOptions[nextIndex]?.value || 1);
5005
5005
  },
5006
5006
  children: /* @__PURE__ */ jsx28(ZoomIn, { size: 16 })
5007
5007
  }
@@ -5583,7 +5583,7 @@ var Canvas = () => {
5583
5583
  className: getClassName17("root"),
5584
5584
  style: {
5585
5585
  width: iframe.enabled ? viewports.current.width : "100%",
5586
- height: zoomConfig.rootHeight,
5586
+ height: isNaN(zoomConfig.rootHeight) ? "auto" : zoomConfig.rootHeight,
5587
5587
  transform: iframe.enabled ? `scale(${zoomConfig.zoom})` : void 0,
5588
5588
  transition: showTransition ? `width ${TRANSITION_DURATION}ms ease-out, height ${TRANSITION_DURATION}ms ease-out, transform ${TRANSITION_DURATION}ms ease-out` : "",
5589
5589
  overflow: iframe.enabled ? void 0 : "auto"
@@ -6084,7 +6084,7 @@ var Layout = ({ children }) => {
6084
6084
  })}`,
6085
6085
  "data-theme": theme,
6086
6086
  id: instanceId,
6087
- style: { height },
6087
+ style: { height: typeof height === "number" && isNaN(height) ? void 0 : height },
6088
6088
  children: [
6089
6089
  /* @__PURE__ */ jsx36(DragDropContext, { disableAutoScroll: dnd?.disableAutoScroll, children: /* @__PURE__ */ jsx36(CustomCredBuild, { children: children || /* @__PURE__ */ jsx36(FrameProvider, { children: /* @__PURE__ */ jsx36(
6090
6090
  "div",
@@ -6097,7 +6097,7 @@ var Layout = ({ children }) => {
6097
6097
  mobilePanelHeightToggle: mobilePanelHeightMode === "toggle",
6098
6098
  mobilePanelHeightMinContent: mobilePanelHeightMode === "min-content"
6099
6099
  }),
6100
- style: { height },
6100
+ style: { height: typeof height === "number" && isNaN(height) ? void 0 : height },
6101
6101
  children: /* @__PURE__ */ jsxs16(
6102
6102
  "div",
6103
6103
  {
@@ -6147,7 +6147,7 @@ var Layout = ({ children }) => {
6147
6147
  ]
6148
6148
  }
6149
6149
  ),
6150
- /* @__PURE__ */ jsx36(Canvas, {}),
6150
+ /* @__PURE__ */ jsx36("div", { className: getLayoutClassName("editor"), children: /* @__PURE__ */ jsx36(Canvas, {}) }),
6151
6151
  !hasDesktopFieldsPlugin && /* @__PURE__ */ jsx36(
6152
6152
  Sidebar,
6153
6153
  {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useAlignOptions
3
- } from "./chunk-7HQNPCGI.mjs";
3
+ } from "./chunk-LBMMY5IM.mjs";
4
4
  import {
5
5
  useHeadingOptions
6
- } from "./chunk-QA2U7BOE.mjs";
6
+ } from "./chunk-WKMRHPOM.mjs";
7
7
  import {
8
8
  useListOptions
9
- } from "./chunk-6TAU2PST.mjs";
9
+ } from "./chunk-5OK3IPVN.mjs";
10
10
  import {
11
11
  Bold,
12
12
  Code,
@@ -26,7 +26,7 @@ import {
26
26
  TextAlignStart,
27
27
  Underline,
28
28
  useControlContext
29
- } from "./chunk-E7XYUXJM.mjs";
29
+ } from "./chunk-GIUKL443.mjs";
30
30
  import {
31
31
  get_class_name_factory_default
32
32
  } from "./chunk-BFHV72KK.mjs";
@@ -310,7 +310,7 @@ function AlignSelectFallback() {
310
310
  // components/RichTextMenu/controls/AlignSelect/index.tsx
311
311
  import { jsx as jsx10 } from "react/jsx-runtime";
312
312
  var AlignSelectLoaded = lazy(
313
- () => import("./loaded-PWOXIOQ2.mjs").then((m) => ({
313
+ () => import("./loaded-GYA4OMNE.mjs").then((m) => ({
314
314
  default: m.AlignSelectLoaded
315
315
  }))
316
316
  );
@@ -529,7 +529,7 @@ function HeadingSelectFallback() {
529
529
  // components/RichTextMenu/controls/HeadingSelect/index.tsx
530
530
  import { jsx as jsx22 } from "react/jsx-runtime";
531
531
  var HeadingSelectLoaded = lazy2(
532
- () => import("./loaded-QZ5Z7NDX.mjs").then((m) => ({
532
+ () => import("./loaded-2CPFB62H.mjs").then((m) => ({
533
533
  default: m.HeadingSelectLoaded
534
534
  }))
535
535
  );
@@ -559,7 +559,7 @@ function ListSelectFallback() {
559
559
  // components/RichTextMenu/controls/ListSelect/index.tsx
560
560
  import { jsx as jsx24 } from "react/jsx-runtime";
561
561
  var ListSelectLoaded = lazy3(
562
- () => import("./loaded-IATND5Y2.mjs").then((m) => ({
562
+ () => import("./loaded-3NNC6Q35.mjs").then((m) => ({
563
563
  default: m.ListSelectLoaded
564
564
  }))
565
565
  );
@@ -5,7 +5,7 @@ import {
5
5
  Heading4,
6
6
  Heading5,
7
7
  Heading6
8
- } from "./chunk-E7XYUXJM.mjs";
8
+ } from "./chunk-GIUKL443.mjs";
9
9
 
10
10
  // components/RichTextMenu/controls/HeadingSelect/use-options.ts
11
11
  import { useMemo } from "react";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  LoadedRichTextMenuInner
3
- } from "./chunk-AP7SVXSU.mjs";
4
- import "./chunk-7HQNPCGI.mjs";
5
- import "./chunk-QA2U7BOE.mjs";
6
- import "./chunk-6TAU2PST.mjs";
7
- import "./chunk-E7XYUXJM.mjs";
3
+ } from "./chunk-VBNE6GK2.mjs";
4
+ import "./chunk-LBMMY5IM.mjs";
5
+ import "./chunk-WKMRHPOM.mjs";
6
+ import "./chunk-5OK3IPVN.mjs";
7
+ import "./chunk-GIUKL443.mjs";
8
8
  import "./chunk-64A37UUC.mjs";
9
9
  import "./chunk-SMAWAXVX.mjs";
10
10
  import "./chunk-BFHV72KK.mjs";
package/dist/index.css CHANGED
@@ -146,20 +146,35 @@
146
146
 
147
147
  /* bundle/index.css */
148
148
  .CredBuild {
149
- --cb-bg-base: #020617;
150
- --cb-bg-surface: #0f172a;
151
- --cb-bg-panel: #1e293b;
152
- --cb-gold: #fbbf24;
153
- --cb-gold-glow: rgba(251, 191, 36, 0.15);
154
- --cb-gold-faint: rgba(251, 191, 36, 0.05);
155
- --cb-silver: #f8fafc;
156
- --cb-silver-muted: #cbd5e1;
157
- --cb-border: rgba(248, 250, 252, 0.1);
158
149
  --credbuild-font-family: "Inter", sans-serif;
150
+ --cb-radius-m: 5px;
151
+ }
152
+ .CredBuild[data-theme=light] {
153
+ --cb-bg-base: #f8fafc;
154
+ --cb-bg-surface: #ffffff;
155
+ --cb-bg-panel: #f1f5f9;
156
+ --cb-gold: #d97706;
157
+ --cb-gold-glow: rgba(217, 119, 6, 0.1);
158
+ --cb-gold-faint: rgba(217, 119, 6, 0.05);
159
+ --cb-silver: #0f172a;
160
+ --cb-silver-muted: #64748b;
161
+ --cb-border: #e2e8f0;
162
+ }
163
+ .CredBuild[data-theme=dark] {
164
+ --cb-bg-base: #191919;
165
+ --cb-bg-surface: #202020;
166
+ --cb-bg-panel: #262626;
167
+ --cb-gold: #ffffff;
168
+ --cb-gold-glow: rgba(255, 255, 255, 0.1);
169
+ --cb-gold-faint: rgba(255, 255, 255, 0.05);
170
+ --cb-silver: #ffffff;
171
+ --cb-silver-muted: #a1a1aa;
172
+ --cb-border: #2f2f2f;
159
173
  }
160
174
  .CredBuild {
161
175
  background-color: var(--cb-bg-base) !important;
162
176
  color: var(--cb-silver) !important;
177
+ font-family: var(--credbuild-font-family) !important;
163
178
  }
164
179
  .CredBuildHeader {
165
180
  background: var(--cb-bg-base) !important;
@@ -167,8 +182,8 @@
167
182
  height: 48px !important;
168
183
  }
169
184
  .CredBuild svg {
170
- color: var(--cb-gold) !important;
171
- stroke: var(--cb-gold) !important;
185
+ color: currentColor !important;
186
+ stroke: currentColor !important;
172
187
  }
173
188
  .CredBuild h1,
174
189
  .CredBuild h2,
@@ -196,9 +211,6 @@
196
211
  .CredBuild button {
197
212
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
198
213
  }
199
- .CredBuild button:hover {
200
- filter: brightness(1.2);
201
- }
202
214
  [class*=Layout-left],
203
215
  [class*=Layout-right],
204
216
  [class*=Layout-header],
@@ -233,10 +245,11 @@
233
245
  background-color: var(--cb-bg-surface) !important;
234
246
  color: var(--cb-silver) !important;
235
247
  border: 1px solid var(--cb-border) !important;
248
+ padding: 4px 8px !important;
236
249
  }
237
250
  [class*=DrawerItem-draggable]:hover {
238
251
  border-color: var(--cb-gold) !important;
239
- background-color: var(--cb-gold-glow) !important;
252
+ background-color: var(--cb-gold-faint) !important;
240
253
  }
241
254
  [class*=DrawerItem-name] {
242
255
  color: var(--cb-silver) !important;
@@ -244,19 +257,26 @@
244
257
  }
245
258
  [class*=DrawerItem-icon] svg,
246
259
  [class*=DrawerItem-draggable] svg {
247
- color: var(--cb-gold) !important;
248
- stroke: var(--cb-gold) !important;
260
+ color: var(--cb-silver-muted) !important;
261
+ stroke: var(--cb-silver-muted) !important;
262
+ opacity: 0.7 !important;
263
+ }
264
+ [class*=DrawerItem-draggable]:hover svg {
265
+ color: var(--cb-silver) !important;
266
+ stroke: var(--cb-silver) !important;
249
267
  opacity: 1 !important;
250
268
  }
251
269
  [class*=ComponentList-title] {
252
- background-color: var(--cb-bg-panel) !important;
253
- color: var(--cb-gold) !important;
270
+ background-color: transparent !important;
271
+ color: var(--cb-silver-muted) !important;
254
272
  border-radius: 0 !important;
255
273
  margin-bottom: 2px !important;
256
- font-weight: 700 !important;
274
+ font-weight: 600 !important;
257
275
  letter-spacing: 0.05em !important;
258
276
  text-transform: uppercase !important;
259
277
  opacity: 1 !important;
278
+ padding: 8px 10px !important;
279
+ border-bottom: 1px solid var(--cb-border) !important;
260
280
  }
261
281
  [class*=ComponentList-title]:hover {
262
282
  background-color: var(--cb-gold-faint) !important;
@@ -267,10 +287,11 @@
267
287
  [class*=ExternalInput-input],
268
288
  [class*=Select-select] {
269
289
  background-color: var(--cb-bg-base) !important;
290
+ background: var(--cb-bg-base) !important;
270
291
  border: 1px solid var(--cb-border) !important;
271
292
  border-radius: var(--cb-radius-m) !important;
272
293
  color: var(--cb-silver) !important;
273
- padding: 8px 12px !important;
294
+ padding: 6px 10px !important;
274
295
  font-size: 12px !important;
275
296
  width: 100% !important;
276
297
  transition: all 0.2s ease !important;
@@ -290,8 +311,8 @@
290
311
  font-weight: 600 !important;
291
312
  text-transform: uppercase !important;
292
313
  letter-spacing: 0.05em !important;
293
- margin-top: 12px !important;
294
- margin-bottom: 8px !important;
314
+ margin-top: 6px !important;
315
+ margin-bottom: 4px !important;
295
316
  }
296
317
  [class*=SidebarSection] {
297
318
  border-bottom: 1px solid var(--cb-border) !important;
@@ -317,30 +338,8 @@
317
338
  border: 1px solid var(--cb-border) !important;
318
339
  border-radius: var(--cb-radius-m) !important;
319
340
  color: var(--cb-silver) !important;
320
- padding: 8px !important;
321
- margin-bottom: 4px !important;
322
- }
323
- .CredBuild [class*=Layout-right] div {
324
- background-image: none !important;
325
- }
326
- [class*=CredBuildHeader] {
327
- background-color: var(--cb-bg-base) !important;
328
- background: var(--cb-bg-base) !important;
329
- border-bottom: 1px solid var(--cb-border) !important;
330
- }
331
- [class*=Header-path],
332
- [class*=Header-title],
333
- [class*=Header-inner] * {
334
- color: var(--cb-gold) !important;
335
- font-weight: 600 !important;
336
- }
337
- [class*=Header] div,
338
- [class*=Header] button,
339
- [class*=Header] span {
340
- background-color: transparent !important;
341
- background: transparent !important;
342
- border-color: transparent !important;
343
- box-shadow: none !important;
341
+ padding: 6px !important;
342
+ margin-bottom: 3px !important;
344
343
  }
345
344
  [class*=Button--secondary] {
346
345
  background-color: var(--cb-bg-surface) !important;
@@ -370,66 +369,13 @@
370
369
  box-shadow: 0 0 15px var(--cb-gold-glow) !important;
371
370
  transform: translateY(-1px);
372
371
  }
373
- [class*=Header] svg,
374
- [class*=Header] svg * {
375
- color: var(--cb-gold) !important;
376
- stroke: var(--cb-gold) !important;
377
- fill: none !important;
378
- }
379
- [class*=Header-tools] > div,
380
- [class*=Header-rightActions] > div {
381
- background: transparent !important;
382
- }
383
- [class*=Drawer] input,
384
- [class*=ComponentList] input,
385
- [class*=Search] input {
386
- background-color: var(--cb-bg-base) !important;
387
- color: var(--cb-silver) !important;
388
- border: 1px solid var(--cb-border) !important;
389
- border-radius: var(--cb-radius-m) !important;
390
- padding: 10px 12px !important;
391
- font-size: 13px !important;
392
- transition: all 0.2s ease !important;
393
- }
394
- [class*=Drawer] input:focus {
395
- border-color: var(--cb-gold) !important;
396
- box-shadow: 0 0 10px var(--cb-gold-glow) !important;
397
- outline: none !important;
398
- }
399
- [class*=ComponentList-title] {
400
- color: var(--cb-gold) !important;
401
- text-transform: uppercase !important;
402
- font-weight: 700 !important;
403
- letter-spacing: 0.07em !important;
404
- opacity: 1 !important;
405
- padding: 12px !important;
406
- }
407
- [class*=ComponentList-title]:hover {
408
- background-color: var(--cb-gold-glow) !important;
409
- color: var(--cb-gold) !important;
410
- }
411
- [class*=ComponentList-titleIcon] svg {
412
- color: var(--cb-gold) !important;
413
- }
414
- [class*=DrawerItem] {
415
- margin-top: 0 !important;
416
- margin-bottom: 0 !important;
417
- border: none !important;
418
- border-bottom: none !important;
419
- }
420
- [class*=DrawerItem-name],
421
- [class*=DrawerItem] span,
422
- [class*=DrawerItem] div {
423
- background-color: transparent !important;
424
- background: transparent !important;
425
- }
426
- :root {
372
+ .CredBuild {
427
373
  --credbuild-color-azure-05: var(--cb-gold);
428
374
  --credbuild-color-azure-06: var(--cb-gold);
429
375
  --credbuild-color-azure-07: var(--cb-gold);
430
376
  --credbuild-color-azure-10: var(--cb-gold-glow);
431
377
  --credbuild-color-azure-11: var(--cb-gold-glow);
432
- --credbuild-color-white: var(--cb-silver);
378
+ --credbuild-color-white: var(--cb-bg-surface);
433
379
  --credbuild-color-grey-11: var(--cb-bg-surface);
434
380
  --credbuild-color-grey-10: var(--cb-border);
435
381
  --credbuild-color-grey-09: var(--cb-bg-base);
package/dist/index.js CHANGED
@@ -4405,22 +4405,22 @@ var init_get_zoom_config = __esm({
4405
4405
  const viewportHeight = uiViewport.height === "auto" ? frameHeight : uiViewport.height;
4406
4406
  let rootHeight = 0;
4407
4407
  let autoZoom = 1;
4408
- if (typeof uiViewport.width === "number" && (uiViewport.width > frameWidth || viewportHeight > frameHeight)) {
4408
+ if (typeof uiViewport.width === "number" && uiViewport.width > 0 && (uiViewport.width > frameWidth || typeof viewportHeight === "number" && viewportHeight > frameHeight)) {
4409
4409
  const widthZoom = Math.min(frameWidth / uiViewport.width, 1);
4410
- const heightZoom = Math.min(frameHeight / viewportHeight, 1);
4411
- zoom = widthZoom;
4410
+ const heightZoom = typeof viewportHeight === "number" ? Math.min(frameHeight / viewportHeight, 1) : 1;
4411
+ zoom = Math.max(widthZoom, 0.01);
4412
4412
  if (widthZoom < heightZoom) {
4413
- rootHeight = viewportHeight / zoom;
4413
+ rootHeight = typeof viewportHeight === "number" ? viewportHeight / zoom : frameHeight;
4414
4414
  } else {
4415
- rootHeight = viewportHeight;
4416
- zoom = heightZoom;
4415
+ rootHeight = typeof viewportHeight === "number" ? viewportHeight : 0;
4416
+ zoom = Math.max(heightZoom, 0.01);
4417
4417
  }
4418
4418
  autoZoom = zoom;
4419
4419
  } else {
4420
4420
  if (RESET_ZOOM_SMALLER_THAN_FRAME) {
4421
4421
  autoZoom = 1;
4422
4422
  zoom = 1;
4423
- rootHeight = viewportHeight;
4423
+ rootHeight = typeof viewportHeight === "number" ? viewportHeight : 0;
4424
4424
  }
4425
4425
  }
4426
4426
  return { autoZoom, rootHeight, zoom };
@@ -13480,18 +13480,18 @@ var ViewportControls = ({
13480
13480
  const defaultsContainAutoZoom = defaultZoomOptions.find(
13481
13481
  (option) => option.value === autoZoom
13482
13482
  );
13483
- const zoomOptions = (0, import_react91.useMemo)(
13484
- () => [
13483
+ const zoomOptions = (0, import_react91.useMemo)(() => {
13484
+ const options = [
13485
13485
  ...defaultZoomOptions,
13486
- ...defaultsContainAutoZoom ? [] : [
13486
+ ...defaultsContainAutoZoom || isNaN(autoZoom) ? [] : [
13487
13487
  {
13488
13488
  value: autoZoom,
13489
13489
  label: `${(autoZoom * 100).toFixed(0)}% (Auto)`
13490
13490
  }
13491
13491
  ]
13492
- ].filter((a) => a.value <= autoZoom).sort((a, b) => a.value > b.value ? 1 : -1),
13493
- [autoZoom, defaultsContainAutoZoom]
13494
- );
13492
+ ].filter((a) => a.value <= (autoZoom || 1)).sort((a, b) => a.value > b.value ? 1 : -1);
13493
+ return options.length > 0 ? options : defaultZoomOptions;
13494
+ }, [autoZoom, defaultsContainAutoZoom]);
13495
13495
  const [activeViewport, setActiveViewport] = (0, import_react91.useState)(
13496
13496
  uiViewports.current.width
13497
13497
  );
@@ -13524,15 +13524,15 @@ var ViewportControls = ({
13524
13524
  ActionButton,
13525
13525
  {
13526
13526
  title: "Zoom viewport out",
13527
- disabled: zoom <= zoomOptions[0]?.value,
13527
+ disabled: zoom <= (zoomOptions[0]?.value || 0),
13528
13528
  onClick: (e) => {
13529
13529
  e.stopPropagation();
13530
- onZoom(
13531
- zoomOptions[Math.max(
13532
- zoomOptions.findIndex((option) => option.value === zoom) - 1,
13533
- 0
13534
- )].value
13530
+ const currentIndex = zoomOptions.findIndex((option) => option.value === zoom);
13531
+ const nextIndex = Math.max(
13532
+ (currentIndex === -1 ? zoomOptions.length : currentIndex) - 1,
13533
+ 0
13535
13534
  );
13535
+ onZoom(zoomOptions[nextIndex]?.value || 1);
13536
13536
  },
13537
13537
  children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ZoomOut, { size: 16 })
13538
13538
  }
@@ -13541,15 +13541,15 @@ var ViewportControls = ({
13541
13541
  ActionButton,
13542
13542
  {
13543
13543
  title: "Zoom viewport in",
13544
- disabled: zoom >= zoomOptions[zoomOptions.length - 1]?.value,
13544
+ disabled: zoom >= (zoomOptions[zoomOptions.length - 1]?.value || 2),
13545
13545
  onClick: (e) => {
13546
13546
  e.stopPropagation();
13547
- onZoom(
13548
- zoomOptions[Math.min(
13549
- zoomOptions.findIndex((option) => option.value === zoom) + 1,
13550
- zoomOptions.length - 1
13551
- )].value
13547
+ const currentIndex = zoomOptions.findIndex((option) => option.value === zoom);
13548
+ const nextIndex = Math.min(
13549
+ (currentIndex === -1 ? -1 : currentIndex) + 1,
13550
+ zoomOptions.length - 1
13552
13551
  );
13552
+ onZoom(zoomOptions[nextIndex]?.value || 1);
13553
13553
  },
13554
13554
  children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ZoomIn, { size: 16 })
13555
13555
  }
@@ -14214,7 +14214,7 @@ var Canvas = () => {
14214
14214
  className: getClassName36("root"),
14215
14215
  style: {
14216
14216
  width: iframe.enabled ? viewports.current.width : "100%",
14217
- height: zoomConfig.rootHeight,
14217
+ height: isNaN(zoomConfig.rootHeight) ? "auto" : zoomConfig.rootHeight,
14218
14218
  transform: iframe.enabled ? `scale(${zoomConfig.zoom})` : void 0,
14219
14219
  transition: showTransition ? `width ${TRANSITION_DURATION}ms ease-out, height ${TRANSITION_DURATION}ms ease-out, transform ${TRANSITION_DURATION}ms ease-out` : "",
14220
14220
  overflow: iframe.enabled ? void 0 : "auto"
@@ -14809,7 +14809,7 @@ var Layout = ({ children }) => {
14809
14809
  })}`,
14810
14810
  "data-theme": theme,
14811
14811
  id: instanceId,
14812
- style: { height },
14812
+ style: { height: typeof height === "number" && isNaN(height) ? void 0 : height },
14813
14813
  children: [
14814
14814
  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(DragDropContext, { disableAutoScroll: dnd?.disableAutoScroll, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(CustomCredBuild, { children: children || /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(FrameProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
14815
14815
  "div",
@@ -14822,7 +14822,7 @@ var Layout = ({ children }) => {
14822
14822
  mobilePanelHeightToggle: mobilePanelHeightMode === "toggle",
14823
14823
  mobilePanelHeightMinContent: mobilePanelHeightMode === "min-content"
14824
14824
  }),
14825
- style: { height },
14825
+ style: { height: typeof height === "number" && isNaN(height) ? void 0 : height },
14826
14826
  children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
14827
14827
  "div",
14828
14828
  {
@@ -14872,7 +14872,7 @@ var Layout = ({ children }) => {
14872
14872
  ]
14873
14873
  }
14874
14874
  ),
14875
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Canvas, {}),
14875
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: getLayoutClassName("editor"), children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Canvas, {}) }),
14876
14876
  !hasDesktopFieldsPlugin && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
14877
14877
  Sidebar,
14878
14878
  {
package/dist/index.mjs CHANGED
@@ -12,17 +12,17 @@ import {
12
12
  registerOverlayPortal,
13
13
  useCredBuild,
14
14
  useGetCredBuild
15
- } from "./chunk-5H2KI7SK.mjs";
16
- import "./chunk-FC3ZRBT2.mjs";
15
+ } from "./chunk-P3RHOUJG.mjs";
16
+ import "./chunk-6RPYD5IO.mjs";
17
17
  import {
18
18
  setDeep
19
- } from "./chunk-62JTNLF7.mjs";
19
+ } from "./chunk-BQW2NTNG.mjs";
20
20
  import {
21
21
  AutoField,
22
22
  Button,
23
23
  FieldLabel
24
- } from "./chunk-ACKK2BYK.mjs";
25
- import "./chunk-RUAHVDDE.mjs";
24
+ } from "./chunk-H2LU4EW3.mjs";
25
+ import "./chunk-2VS2BST6.mjs";
26
26
  import {
27
27
  migrate,
28
28
  resolveAllData,
@@ -37,11 +37,11 @@ import {
37
37
  Label,
38
38
  RichTextMenu,
39
39
  Separator
40
- } from "./chunk-AP7SVXSU.mjs";
41
- import "./chunk-7HQNPCGI.mjs";
42
- import "./chunk-QA2U7BOE.mjs";
43
- import "./chunk-6TAU2PST.mjs";
44
- import "./chunk-E7XYUXJM.mjs";
40
+ } from "./chunk-VBNE6GK2.mjs";
41
+ import "./chunk-LBMMY5IM.mjs";
42
+ import "./chunk-WKMRHPOM.mjs";
43
+ import "./chunk-5OK3IPVN.mjs";
44
+ import "./chunk-GIUKL443.mjs";
45
45
  import "./chunk-64A37UUC.mjs";
46
46
  import "./chunk-SMAWAXVX.mjs";
47
47
  import "./chunk-BFHV72KK.mjs";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  useHeadingOptions
3
- } from "./chunk-QA2U7BOE.mjs";
3
+ } from "./chunk-WKMRHPOM.mjs";
4
4
  import {
5
5
  Heading,
6
6
  SelectControl,
7
7
  useControlContext
8
- } from "./chunk-E7XYUXJM.mjs";
8
+ } from "./chunk-GIUKL443.mjs";
9
9
  import "./chunk-64A37UUC.mjs";
10
10
  import "./chunk-SMAWAXVX.mjs";
11
11
  import "./chunk-BFHV72KK.mjs";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  useListOptions
3
- } from "./chunk-6TAU2PST.mjs";
3
+ } from "./chunk-5OK3IPVN.mjs";
4
4
  import {
5
5
  List,
6
6
  SelectControl,
7
7
  useControlContext
8
- } from "./chunk-E7XYUXJM.mjs";
8
+ } from "./chunk-GIUKL443.mjs";
9
9
  import "./chunk-64A37UUC.mjs";
10
10
  import "./chunk-SMAWAXVX.mjs";
11
11
  import "./chunk-BFHV72KK.mjs";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  useAlignOptions
3
- } from "./chunk-7HQNPCGI.mjs";
3
+ } from "./chunk-LBMMY5IM.mjs";
4
4
  import {
5
5
  SelectControl,
6
6
  TextAlignStart,
7
7
  useControlContext
8
- } from "./chunk-E7XYUXJM.mjs";
8
+ } from "./chunk-GIUKL443.mjs";
9
9
  import "./chunk-64A37UUC.mjs";
10
10
  import "./chunk-SMAWAXVX.mjs";
11
11
  import "./chunk-BFHV72KK.mjs";
@@ -4405,22 +4405,22 @@ var init_get_zoom_config = __esm({
4405
4405
  const viewportHeight = uiViewport.height === "auto" ? frameHeight : uiViewport.height;
4406
4406
  let rootHeight = 0;
4407
4407
  let autoZoom = 1;
4408
- if (typeof uiViewport.width === "number" && (uiViewport.width > frameWidth || viewportHeight > frameHeight)) {
4408
+ if (typeof uiViewport.width === "number" && uiViewport.width > 0 && (uiViewport.width > frameWidth || typeof viewportHeight === "number" && viewportHeight > frameHeight)) {
4409
4409
  const widthZoom = Math.min(frameWidth / uiViewport.width, 1);
4410
- const heightZoom = Math.min(frameHeight / viewportHeight, 1);
4411
- zoom = widthZoom;
4410
+ const heightZoom = typeof viewportHeight === "number" ? Math.min(frameHeight / viewportHeight, 1) : 1;
4411
+ zoom = Math.max(widthZoom, 0.01);
4412
4412
  if (widthZoom < heightZoom) {
4413
- rootHeight = viewportHeight / zoom;
4413
+ rootHeight = typeof viewportHeight === "number" ? viewportHeight / zoom : frameHeight;
4414
4414
  } else {
4415
- rootHeight = viewportHeight;
4416
- zoom = heightZoom;
4415
+ rootHeight = typeof viewportHeight === "number" ? viewportHeight : 0;
4416
+ zoom = Math.max(heightZoom, 0.01);
4417
4417
  }
4418
4418
  autoZoom = zoom;
4419
4419
  } else {
4420
4420
  if (RESET_ZOOM_SMALLER_THAN_FRAME) {
4421
4421
  autoZoom = 1;
4422
4422
  zoom = 1;
4423
- rootHeight = viewportHeight;
4423
+ rootHeight = typeof viewportHeight === "number" ? viewportHeight : 0;
4424
4424
  }
4425
4425
  }
4426
4426
  return { autoZoom, rootHeight, zoom };
@@ -13480,18 +13480,18 @@ var ViewportControls = ({
13480
13480
  const defaultsContainAutoZoom = defaultZoomOptions.find(
13481
13481
  (option) => option.value === autoZoom
13482
13482
  );
13483
- const zoomOptions = (0, import_react91.useMemo)(
13484
- () => [
13483
+ const zoomOptions = (0, import_react91.useMemo)(() => {
13484
+ const options = [
13485
13485
  ...defaultZoomOptions,
13486
- ...defaultsContainAutoZoom ? [] : [
13486
+ ...defaultsContainAutoZoom || isNaN(autoZoom) ? [] : [
13487
13487
  {
13488
13488
  value: autoZoom,
13489
13489
  label: `${(autoZoom * 100).toFixed(0)}% (Auto)`
13490
13490
  }
13491
13491
  ]
13492
- ].filter((a) => a.value <= autoZoom).sort((a, b) => a.value > b.value ? 1 : -1),
13493
- [autoZoom, defaultsContainAutoZoom]
13494
- );
13492
+ ].filter((a) => a.value <= (autoZoom || 1)).sort((a, b) => a.value > b.value ? 1 : -1);
13493
+ return options.length > 0 ? options : defaultZoomOptions;
13494
+ }, [autoZoom, defaultsContainAutoZoom]);
13495
13495
  const [activeViewport, setActiveViewport] = (0, import_react91.useState)(
13496
13496
  uiViewports.current.width
13497
13497
  );
@@ -13524,15 +13524,15 @@ var ViewportControls = ({
13524
13524
  ActionButton,
13525
13525
  {
13526
13526
  title: "Zoom viewport out",
13527
- disabled: zoom <= zoomOptions[0]?.value,
13527
+ disabled: zoom <= (zoomOptions[0]?.value || 0),
13528
13528
  onClick: (e) => {
13529
13529
  e.stopPropagation();
13530
- onZoom(
13531
- zoomOptions[Math.max(
13532
- zoomOptions.findIndex((option) => option.value === zoom) - 1,
13533
- 0
13534
- )].value
13530
+ const currentIndex = zoomOptions.findIndex((option) => option.value === zoom);
13531
+ const nextIndex = Math.max(
13532
+ (currentIndex === -1 ? zoomOptions.length : currentIndex) - 1,
13533
+ 0
13535
13534
  );
13535
+ onZoom(zoomOptions[nextIndex]?.value || 1);
13536
13536
  },
13537
13537
  children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ZoomOut, { size: 16 })
13538
13538
  }
@@ -13541,15 +13541,15 @@ var ViewportControls = ({
13541
13541
  ActionButton,
13542
13542
  {
13543
13543
  title: "Zoom viewport in",
13544
- disabled: zoom >= zoomOptions[zoomOptions.length - 1]?.value,
13544
+ disabled: zoom >= (zoomOptions[zoomOptions.length - 1]?.value || 2),
13545
13545
  onClick: (e) => {
13546
13546
  e.stopPropagation();
13547
- onZoom(
13548
- zoomOptions[Math.min(
13549
- zoomOptions.findIndex((option) => option.value === zoom) + 1,
13550
- zoomOptions.length - 1
13551
- )].value
13547
+ const currentIndex = zoomOptions.findIndex((option) => option.value === zoom);
13548
+ const nextIndex = Math.min(
13549
+ (currentIndex === -1 ? -1 : currentIndex) + 1,
13550
+ zoomOptions.length - 1
13552
13551
  );
13552
+ onZoom(zoomOptions[nextIndex]?.value || 1);
13553
13553
  },
13554
13554
  children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ZoomIn, { size: 16 })
13555
13555
  }
@@ -14214,7 +14214,7 @@ var Canvas = () => {
14214
14214
  className: getClassName36("root"),
14215
14215
  style: {
14216
14216
  width: iframe.enabled ? viewports.current.width : "100%",
14217
- height: zoomConfig.rootHeight,
14217
+ height: isNaN(zoomConfig.rootHeight) ? "auto" : zoomConfig.rootHeight,
14218
14218
  transform: iframe.enabled ? `scale(${zoomConfig.zoom})` : void 0,
14219
14219
  transition: showTransition ? `width ${TRANSITION_DURATION}ms ease-out, height ${TRANSITION_DURATION}ms ease-out, transform ${TRANSITION_DURATION}ms ease-out` : "",
14220
14220
  overflow: iframe.enabled ? void 0 : "auto"
@@ -14809,7 +14809,7 @@ var Layout = ({ children }) => {
14809
14809
  })}`,
14810
14810
  "data-theme": theme,
14811
14811
  id: instanceId,
14812
- style: { height },
14812
+ style: { height: typeof height === "number" && isNaN(height) ? void 0 : height },
14813
14813
  children: [
14814
14814
  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(DragDropContext, { disableAutoScroll: dnd?.disableAutoScroll, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(CustomCredBuild, { children: children || /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(FrameProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
14815
14815
  "div",
@@ -14822,7 +14822,7 @@ var Layout = ({ children }) => {
14822
14822
  mobilePanelHeightToggle: mobilePanelHeightMode === "toggle",
14823
14823
  mobilePanelHeightMinContent: mobilePanelHeightMode === "min-content"
14824
14824
  }),
14825
- style: { height },
14825
+ style: { height: typeof height === "number" && isNaN(height) ? void 0 : height },
14826
14826
  children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
14827
14827
  "div",
14828
14828
  {
@@ -14872,7 +14872,7 @@ var Layout = ({ children }) => {
14872
14872
  ]
14873
14873
  }
14874
14874
  ),
14875
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Canvas, {}),
14875
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: getLayoutClassName("editor"), children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Canvas, {}) }),
14876
14876
  !hasDesktopFieldsPlugin && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
14877
14877
  Sidebar,
14878
14878
  {
@@ -12,17 +12,17 @@ import {
12
12
  registerOverlayPortal,
13
13
  useCredBuild,
14
14
  useGetCredBuild
15
- } from "./chunk-5H2KI7SK.mjs";
16
- import "./chunk-FC3ZRBT2.mjs";
15
+ } from "./chunk-P3RHOUJG.mjs";
16
+ import "./chunk-6RPYD5IO.mjs";
17
17
  import {
18
18
  setDeep
19
- } from "./chunk-62JTNLF7.mjs";
19
+ } from "./chunk-BQW2NTNG.mjs";
20
20
  import {
21
21
  AutoField,
22
22
  Button,
23
23
  FieldLabel
24
- } from "./chunk-ACKK2BYK.mjs";
25
- import "./chunk-RUAHVDDE.mjs";
24
+ } from "./chunk-H2LU4EW3.mjs";
25
+ import "./chunk-2VS2BST6.mjs";
26
26
  import {
27
27
  migrate,
28
28
  resolveAllData,
@@ -37,11 +37,11 @@ import {
37
37
  Label,
38
38
  RichTextMenu,
39
39
  Separator
40
- } from "./chunk-AP7SVXSU.mjs";
41
- import "./chunk-7HQNPCGI.mjs";
42
- import "./chunk-QA2U7BOE.mjs";
43
- import "./chunk-6TAU2PST.mjs";
44
- import "./chunk-E7XYUXJM.mjs";
40
+ } from "./chunk-VBNE6GK2.mjs";
41
+ import "./chunk-LBMMY5IM.mjs";
42
+ import "./chunk-WKMRHPOM.mjs";
43
+ import "./chunk-5OK3IPVN.mjs";
44
+ import "./chunk-GIUKL443.mjs";
45
45
  import "./chunk-64A37UUC.mjs";
46
46
  import "./chunk-SMAWAXVX.mjs";
47
47
  import "./chunk-BFHV72KK.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crediblemark/build",
3
- "version": "0.24.2",
3
+ "version": "0.24.4",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Rasyiqi Crediblemark",
6
6
  "repository": {