Add a customisable shadow to canvas boxes
A box can now cast a shadow, independent of its frame: ticking "Shadow" in the box editor gives a hard offset shadow, and Hard/Soft/Glow presets or any typed CSS box-shadow value customise it. The value is stored on Box and Component and carried through duplicates, components and layouts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -36,6 +36,7 @@ const BOX_FIELDS = `
|
||||
h
|
||||
z
|
||||
framed
|
||||
shadow
|
||||
hideOnMobile
|
||||
adminOnly
|
||||
componentId
|
||||
@@ -45,7 +46,7 @@ const BOX_FIELDS = `
|
||||
// same box — or componentId, which keeps a copy of a linked box linked;
|
||||
// geometry is offset so the copy is visibly separate.
|
||||
const COPIED = [
|
||||
"page", "kind", "widget", "html", "title", "w", "h", "framed", "hideOnMobile", "adminOnly", "componentId",
|
||||
"page", "kind", "widget", "html", "title", "w", "h", "framed", "shadow", "hideOnMobile", "adminOnly", "componentId",
|
||||
];
|
||||
|
||||
const stores = new Map();
|
||||
|
||||
@@ -28,6 +28,7 @@ const COMPONENT_FIELDS = `
|
||||
w
|
||||
h
|
||||
framed
|
||||
shadow
|
||||
adminOnly
|
||||
uses
|
||||
`;
|
||||
@@ -35,7 +36,7 @@ const COMPONENT_FIELDS = `
|
||||
// Matches BOX_FIELDS in stores/boxes.js, for the mutations that answer with
|
||||
// a box.
|
||||
const BOX_FIELDS = `
|
||||
id page kind widget html title x y w h z framed hideOnMobile adminOnly componentId
|
||||
id page kind widget html title x y w h z framed shadow hideOnMobile adminOnly componentId
|
||||
`;
|
||||
|
||||
export const useComponentsStore = createCrudStore("components", {
|
||||
@@ -110,6 +111,7 @@ export const useComponentsStore = createCrudStore("components", {
|
||||
w: component.w,
|
||||
h: component.h,
|
||||
framed: component.framed,
|
||||
shadow: component.shadow,
|
||||
adminOnly: component.adminOnly,
|
||||
...at,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user