@particle-academy/fancy-cms-ui 0.0.1-dev.12 → 0.0.1-dev.13

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/editor.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { keyBetween } from './chunk-7YYLYBLI.js';
2
- import { CmsPage, defaultRegistry } from './chunk-ZV7CV54P.js';
2
+ import { CmsPage, defaultRegistry } from './chunk-E5AAQX7P.js';
3
3
  import { reduce, childrenOf } from './chunk-3YZMELJJ.js';
4
4
  import { useReducer, useCallback, useMemo, useRef, useState, useLayoutEffect, Fragment, useEffect } from 'react';
5
5
  import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
@@ -398,7 +398,7 @@ function Toolbar({ ed }) {
398
398
  }
399
399
  );
400
400
  }
401
- var CONTAINER_TYPES = /* @__PURE__ */ new Set(["section", "frame", "stack", "grid", "shape"]);
401
+ var CONTAINER_TYPES = /* @__PURE__ */ new Set(["section", "frame", "stack", "grid", "shape", "card", "device"]);
402
402
  function NodeInspector({
403
403
  node,
404
404
  transform,
@@ -846,7 +846,7 @@ function EditablePage({
846
846
  const order = keyBetween(siblings.length ? siblings[siblings.length - 1].order : null, null);
847
847
  const id = `n${doc2.seq + 1}-${Math.floor(performance.now())}`;
848
848
  const def = ADD_DEFAULTS[kind];
849
- ed.apply({ t: "insert_node", node: { id, type: def.type, parent, order, props: { ...def.props }, style: { base: { ...def.style } } } });
849
+ ed.apply({ t: "insert_node", node: { id, type: def.type, parent, order, layout: def.layout, props: { ...def.props }, style: { base: { ...def.style } } } });
850
850
  ed.select(id);
851
851
  },
852
852
  [ed, selNode]
@@ -860,7 +860,7 @@ function EditablePage({
860
860
  const order = keyBetween(siblings.length ? siblings[siblings.length - 1].order : null, null);
861
861
  const id = `n${doc2.seq + 1}-${Math.floor(performance.now())}`;
862
862
  const def = ADD_DEFAULTS[kind];
863
- ed.apply({ t: "insert_node", node: { id, type: def.type, parent, order, props: { ...def.props }, style: { base: { ...def.style } } } });
863
+ ed.apply({ t: "insert_node", node: { id, type: def.type, parent, order, layout: def.layout, props: { ...def.props }, style: { base: { ...def.style } } } });
864
864
  ed.select(id);
865
865
  },
866
866
  [ed]
@@ -1098,13 +1098,20 @@ function ElementPalette({ open, onDragChange }) {
1098
1098
  }
1099
1099
  );
1100
1100
  }
1101
- var CONTAINER_TYPES2 = /* @__PURE__ */ new Set(["section", "frame", "stack", "grid", "shape"]);
1101
+ var CONTAINER_TYPES2 = /* @__PURE__ */ new Set(["section", "frame", "stack", "grid", "shape", "card", "device"]);
1102
1102
  var ADD_DEFAULTS = {
1103
1103
  text: { type: "text", props: { content: "New text" }, style: { color: "inherit" } },
1104
1104
  heading: { type: "heading", props: { content: "New heading" }, style: { fontSize: { value: 28, unit: "px" }, fontWeight: 700 } },
1105
1105
  button: { type: "button", props: { label: "Button", href: "#", variant: "primary" }, style: {} },
1106
+ link: { type: "link", props: { content: "link text", href: "#" }, style: { color: "#7c3aed" } },
1106
1107
  image: { type: "image", props: { src: "", alt: "" }, style: {} },
1107
- box: { type: "frame", props: {}, style: { padding: { value: 16, unit: "px" } } }
1108
+ box: { type: "frame", props: {}, style: { padding: { value: 16, unit: "px" } } },
1109
+ stack: { type: "stack", props: {}, style: { gap: { value: 12, unit: "px" } }, layout: "stack" },
1110
+ grid: { type: "grid", props: {}, style: { gap: { value: 12, unit: "px" } }, layout: "grid" },
1111
+ card: { type: "card", props: {}, style: { padding: { value: 16, unit: "px" }, radius: { value: 12, unit: "px" }, border: "1px solid #e2e8f0" } },
1112
+ callout: { type: "callout", props: { content: "Heads up \u2014 this is a callout.", variant: "info" }, style: {} },
1113
+ divider: { type: "divider", props: {}, style: {} },
1114
+ code: { type: "code", props: { content: "npm install @particle-academy/react-fancy", lang: "bash" }, style: {} }
1108
1115
  };
1109
1116
  var GRIPS = [
1110
1117
  { key: "nw", north: true, west: true, cursor: "nwse-resize" },
@@ -1304,11 +1311,18 @@ function FloatingToolbar({
1304
1311
  ] });
1305
1312
  }
1306
1313
  var ADD_MENU = [
1307
- { kind: "text", label: "Text" },
1308
1314
  { kind: "heading", label: "Heading" },
1315
+ { kind: "text", label: "Text" },
1309
1316
  { kind: "button", label: "Button" },
1317
+ { kind: "link", label: "Link" },
1310
1318
  { kind: "image", label: "Image" },
1311
- { kind: "box", label: "Box" }
1319
+ { kind: "card", label: "Card" },
1320
+ { kind: "callout", label: "Callout" },
1321
+ { kind: "stack", label: "Stack" },
1322
+ { kind: "grid", label: "Grid" },
1323
+ { kind: "box", label: "Box" },
1324
+ { kind: "divider", label: "Divider" },
1325
+ { kind: "code", label: "Code" }
1312
1326
  ];
1313
1327
  function EditBar({
1314
1328
  editing,