@nextsparkjs/core 0.1.0-beta.67 → 0.1.0-beta.68
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/components/dashboard/block-editor/block-picker.d.ts +7 -2
- package/dist/components/dashboard/block-editor/block-picker.d.ts.map +1 -1
- package/dist/components/dashboard/block-editor/block-picker.js +27 -20
- package/dist/components/dashboard/block-editor/block-preview-canvas.d.ts.map +1 -1
- package/dist/components/dashboard/block-editor/block-preview-canvas.js +37 -37
- package/dist/components/dashboard/block-editor/block-settings-panel.js +3 -3
- package/dist/components/dashboard/block-editor/builder-editor-view.d.ts.map +1 -1
- package/dist/components/dashboard/block-editor/builder-editor-view.js +124 -82
- package/dist/components/dashboard/block-editor/config-panel.d.ts +18 -0
- package/dist/components/dashboard/block-editor/config-panel.d.ts.map +1 -0
- package/dist/components/dashboard/block-editor/config-panel.js +413 -0
- package/dist/components/dashboard/block-editor/floating-block-toolbar.js +1 -1
- package/dist/components/dashboard/block-editor/pattern-card.js +1 -1
- package/dist/components/dashboard/block-editor/pattern-reference-preview.js +1 -1
- package/dist/components/dashboard/block-editor/sortable-block.js +1 -1
- package/dist/components/dashboard/block-editor/tree-view-node.d.ts +11 -0
- package/dist/components/dashboard/block-editor/tree-view-node.d.ts.map +1 -0
- package/dist/components/dashboard/block-editor/tree-view-node.js +91 -0
- package/dist/components/dashboard/block-editor/tree-view.d.ts +17 -0
- package/dist/components/dashboard/block-editor/tree-view.d.ts.map +1 -0
- package/dist/components/dashboard/block-editor/tree-view.js +125 -0
- package/dist/components/dashboard/block-editor/viewport-toggle.d.ts +10 -0
- package/dist/components/dashboard/block-editor/viewport-toggle.d.ts.map +1 -0
- package/dist/components/dashboard/block-editor/viewport-toggle.js +55 -0
- package/dist/components/public/pageBuilder/PageRenderer.d.ts.map +1 -1
- package/dist/components/public/pageBuilder/PageRenderer.js +10 -1
- package/dist/components/ui/dynamic-icon.d.ts +12 -0
- package/dist/components/ui/dynamic-icon.d.ts.map +1 -0
- package/dist/components/ui/dynamic-icon.js +11 -0
- package/dist/lib/selectors/core-selectors.d.ts +98 -44
- package/dist/lib/selectors/core-selectors.d.ts.map +1 -1
- package/dist/lib/selectors/domains/block-editor.selectors.d.ts +136 -71
- package/dist/lib/selectors/domains/block-editor.selectors.d.ts.map +1 -1
- package/dist/lib/selectors/domains/block-editor.selectors.js +130 -60
- package/dist/lib/selectors/selectors.d.ts +196 -88
- package/dist/lib/selectors/selectors.d.ts.map +1 -1
- package/dist/messages/en/admin.json +15 -1
- package/dist/messages/en/index.d.ts +14 -0
- package/dist/messages/en/index.d.ts.map +1 -1
- package/dist/messages/es/admin.json +16 -1
- package/dist/messages/es/index.d.ts +15 -0
- package/dist/messages/es/index.d.ts.map +1 -1
- package/dist/presets/blocks/cta-section/component.tsx +4 -4
- package/dist/presets/blocks/features-grid/component.tsx +5 -5
- package/dist/presets/blocks/hero/component.tsx +2 -2
- package/dist/presets/blocks/testimonials/component.tsx +4 -4
- package/dist/presets/blocks/text-content/component.tsx +2 -2
- package/dist/presets/theme/blocks/hero/component.tsx +2 -2
- package/dist/presets/theme/tests/cypress/src/core/BlockEditorBasePOM.ts +123 -24
- package/dist/styles/classes.json +9 -2
- package/dist/styles/ui.css +1 -1
- package/dist/templates/features/blog/blocks/post-content/component.tsx +2 -2
- package/dist/templates/features/pages/blocks/hero/component.tsx +2 -2
- package/dist/templates/next.config.mjs +5 -3
- package/package.json +5 -4
- package/templates/features/blog/blocks/post-content/component.tsx +2 -2
- package/templates/features/pages/blocks/hero/component.tsx +2 -2
- package/templates/next.config.mjs +5 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { BlockConfig } from '../../../types/blocks';
|
|
1
|
+
import type { BlockConfig, BlockInstance } from '../../../types/blocks';
|
|
2
|
+
import type { PatternReference } from '../../../types/pattern-reference';
|
|
2
3
|
import type { ClientEntityConfig } from '@nextsparkjs/registries/entity-registry.client';
|
|
3
4
|
interface BlockPickerProps {
|
|
4
5
|
blocks: BlockConfig[];
|
|
@@ -9,7 +10,11 @@ interface BlockPickerProps {
|
|
|
9
10
|
onEntityFieldChange: (field: string, value: unknown) => void;
|
|
10
11
|
showFieldsTab: boolean;
|
|
11
12
|
showPatternsTab?: boolean;
|
|
13
|
+
pageBlocks: (BlockInstance | PatternReference)[];
|
|
14
|
+
selectedBlockId: string | null;
|
|
15
|
+
onSelectBlock: (id: string) => void;
|
|
16
|
+
onReorderBlocks: (blocks: (BlockInstance | PatternReference)[]) => void;
|
|
12
17
|
}
|
|
13
|
-
export declare function BlockPicker({ blocks, onAddBlock, onAddPattern, entityConfig, entityFields, onEntityFieldChange, showFieldsTab, showPatternsTab, }: BlockPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function BlockPicker({ blocks, onAddBlock, onAddPattern, entityConfig, entityFields, onEntityFieldChange, showFieldsTab, showPatternsTab, pageBlocks, selectedBlockId, onSelectBlock, onReorderBlocks, }: BlockPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
19
|
export {};
|
|
15
20
|
//# sourceMappingURL=block-picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/dashboard/block-editor/block-picker.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"block-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/dashboard/block-editor/block-picker.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAA;AAuBxF,UAAU,gBAAgB;IACxB,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,YAAY,EAAE,kBAAkB,CAAA;IAChC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAC5D,aAAa,EAAE,OAAO,CAAA;IACtB,eAAe,CAAC,EAAE,OAAO,CAAA;IAEzB,UAAU,EAAE,CAAC,aAAa,GAAG,gBAAgB,CAAC,EAAE,CAAA;IAChD,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,eAAe,EAAE,CAAC,MAAM,EAAE,CAAC,aAAa,GAAG,gBAAgB,CAAC,EAAE,KAAK,IAAI,CAAA;CACxE;AAED,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,eAAuB,EAEvB,UAAU,EACV,eAAe,EACf,aAAa,EACb,eAAe,GAChB,EAAE,gBAAgB,2CAgUlB"}
|
|
@@ -3,13 +3,13 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useState, useMemo } from "react";
|
|
4
4
|
import { useTranslations } from "next-intl";
|
|
5
5
|
import { useQuery } from "@tanstack/react-query";
|
|
6
|
-
import { Search, Plus, LayoutGrid,
|
|
6
|
+
import { Search, Plus, LayoutGrid, LayoutList, Layers } from "lucide-react";
|
|
7
7
|
import { Input } from "../../ui/input.js";
|
|
8
8
|
import { ScrollArea } from "../../ui/scroll-area.js";
|
|
9
9
|
import { cn } from "../../../lib/utils.js";
|
|
10
10
|
import { sel } from "../../../lib/test/index.js";
|
|
11
11
|
import { getCategoryConfig } from "./category-helpers.js";
|
|
12
|
-
import {
|
|
12
|
+
import { TreeView } from "./tree-view.js";
|
|
13
13
|
import { PatternCard } from "./pattern-card.js";
|
|
14
14
|
function getTeamId() {
|
|
15
15
|
if (typeof window !== "undefined") {
|
|
@@ -33,7 +33,12 @@ function BlockPicker({
|
|
|
33
33
|
entityFields,
|
|
34
34
|
onEntityFieldChange,
|
|
35
35
|
showFieldsTab,
|
|
36
|
-
showPatternsTab = false
|
|
36
|
+
showPatternsTab = false,
|
|
37
|
+
// TreeView props
|
|
38
|
+
pageBlocks,
|
|
39
|
+
selectedBlockId,
|
|
40
|
+
onSelectBlock,
|
|
41
|
+
onReorderBlocks
|
|
37
42
|
}) {
|
|
38
43
|
const t = useTranslations("admin.builder");
|
|
39
44
|
const tPatterns = useTranslations("patterns");
|
|
@@ -78,7 +83,7 @@ function BlockPicker({
|
|
|
78
83
|
"button",
|
|
79
84
|
{
|
|
80
85
|
className: cn(
|
|
81
|
-
"flex-1 py-3 text-sm font-medium transition-
|
|
86
|
+
"flex-1 py-3 text-sm font-medium transition-colors relative",
|
|
82
87
|
activeTab === "blocks" ? "text-primary bg-primary/5" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"
|
|
83
88
|
),
|
|
84
89
|
onClick: () => setActiveTab("blocks"),
|
|
@@ -100,7 +105,7 @@ function BlockPicker({
|
|
|
100
105
|
"button",
|
|
101
106
|
{
|
|
102
107
|
className: cn(
|
|
103
|
-
"flex-1 py-3 text-sm font-medium transition-
|
|
108
|
+
"flex-1 py-3 text-sm font-medium transition-colors relative",
|
|
104
109
|
activeTab === "patterns" ? "text-primary bg-primary/5" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"
|
|
105
110
|
),
|
|
106
111
|
onClick: () => setActiveTab("patterns"),
|
|
@@ -112,19 +117,19 @@ function BlockPicker({
|
|
|
112
117
|
]
|
|
113
118
|
}
|
|
114
119
|
),
|
|
115
|
-
|
|
120
|
+
/* @__PURE__ */ jsxs(
|
|
116
121
|
"button",
|
|
117
122
|
{
|
|
118
123
|
className: cn(
|
|
119
|
-
"flex-1 py-3 text-sm font-medium transition-
|
|
120
|
-
activeTab === "
|
|
124
|
+
"flex-1 py-3 text-sm font-medium transition-colors relative",
|
|
125
|
+
activeTab === "layout" ? "text-primary bg-primary/5" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"
|
|
121
126
|
),
|
|
122
|
-
onClick: () => setActiveTab("
|
|
123
|
-
"data-cy": sel("blockEditor.blockPicker.
|
|
127
|
+
onClick: () => setActiveTab("layout"),
|
|
128
|
+
"data-cy": sel("blockEditor.blockPicker.tabLayout"),
|
|
124
129
|
children: [
|
|
125
|
-
/* @__PURE__ */ jsx(
|
|
126
|
-
t("sidebar.tabs.
|
|
127
|
-
activeTab === "
|
|
130
|
+
/* @__PURE__ */ jsx(LayoutList, { className: "h-4 w-4 inline mr-2" }),
|
|
131
|
+
t("sidebar.tabs.layout"),
|
|
132
|
+
activeTab === "layout" && /* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 right-0 h-0.5 bg-primary" })
|
|
128
133
|
]
|
|
129
134
|
}
|
|
130
135
|
)
|
|
@@ -177,7 +182,7 @@ function BlockPicker({
|
|
|
177
182
|
"button",
|
|
178
183
|
{
|
|
179
184
|
className: cn(
|
|
180
|
-
"px-2.5 py-1 text-xs font-medium rounded-md whitespace-nowrap transition-
|
|
185
|
+
"px-2.5 py-1 text-xs font-medium rounded-md whitespace-nowrap transition-colors capitalize flex items-center gap-1.5",
|
|
181
186
|
isActive ? `${config.bgColor} ${config.textColor} ${config.borderColor} border` : "bg-muted text-muted-foreground hover:bg-muted-foreground/20"
|
|
182
187
|
),
|
|
183
188
|
onClick: () => setSelectedCategory(category),
|
|
@@ -200,7 +205,7 @@ function BlockPicker({
|
|
|
200
205
|
return /* @__PURE__ */ jsxs(
|
|
201
206
|
"div",
|
|
202
207
|
{
|
|
203
|
-
className: "group relative bg-background border border-border rounded-lg p-3 hover:border-primary hover:shadow-md transition-
|
|
208
|
+
className: "group relative bg-background border border-border rounded-lg p-3 hover:border-primary hover:shadow-md transition-[border-color,box-shadow] cursor-grab active:cursor-grabbing",
|
|
204
209
|
draggable: true,
|
|
205
210
|
onDragStart: (e) => {
|
|
206
211
|
e.dataTransfer.setData("blockSlug", block.slug);
|
|
@@ -316,13 +321,15 @@ function BlockPicker({
|
|
|
316
321
|
)) }) })
|
|
317
322
|
] })
|
|
318
323
|
) : (
|
|
319
|
-
//
|
|
324
|
+
// Layout Tab - Tree View
|
|
320
325
|
/* @__PURE__ */ jsx(
|
|
321
|
-
|
|
326
|
+
TreeView,
|
|
322
327
|
{
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
328
|
+
blocks: pageBlocks,
|
|
329
|
+
selectedBlockId,
|
|
330
|
+
onSelectBlock,
|
|
331
|
+
onReorder: onReorderBlocks,
|
|
332
|
+
emptyMessage: t("layout.empty")
|
|
326
333
|
}
|
|
327
334
|
)
|
|
328
335
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-preview-canvas.d.ts","sourceRoot":"","sources":["../../../../src/components/dashboard/block-editor/block-preview-canvas.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAkB1D,UAAU,uBAAuB;IAC/B,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAChC;AAED,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,eAAe,EACf,aAAa,EACb,QAAQ,EACR,UAAU,EACV,WAAW,EACX,QAAQ,GACT,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"block-preview-canvas.d.ts","sourceRoot":"","sources":["../../../../src/components/dashboard/block-editor/block-preview-canvas.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAkB1D,UAAU,uBAAuB;IAC/B,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/B,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAChC;AAED,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,eAAe,EACf,aAAa,EACb,QAAQ,EACR,UAAU,EACV,WAAW,EACX,QAAQ,GACT,EAAE,uBAAuB,2CA4CzB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Suspense, useMemo, useState } from "react";
|
|
3
|
+
import { Suspense, useMemo, useState, memo, useCallback } from "react";
|
|
4
4
|
import { ChevronUp, ChevronDown } from "lucide-react";
|
|
5
5
|
import { useTranslations } from "next-intl";
|
|
6
6
|
import { Button } from "../../ui/button.js";
|
|
@@ -28,6 +28,8 @@ function BlockPreviewCanvas({
|
|
|
28
28
|
}) {
|
|
29
29
|
const t = useTranslations("admin.builder");
|
|
30
30
|
const [hoveredBlockId, setHoveredBlockId] = useState(null);
|
|
31
|
+
const handleHover = useCallback((id) => setHoveredBlockId(id), []);
|
|
32
|
+
const handleLeave = useCallback(() => setHoveredBlockId(null), []);
|
|
31
33
|
if (blocks.length === 0) {
|
|
32
34
|
return /* @__PURE__ */ jsx(
|
|
33
35
|
"div",
|
|
@@ -47,21 +49,23 @@ function BlockPreviewCanvas({
|
|
|
47
49
|
block,
|
|
48
50
|
isSelected: selectedBlockId === block.id,
|
|
49
51
|
isHovered: hoveredBlockId === block.id,
|
|
50
|
-
onSelect:
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
onSelect: onSelectBlock,
|
|
53
|
+
blockId: block.id,
|
|
54
|
+
onHover: handleHover,
|
|
55
|
+
onLeave: handleLeave,
|
|
53
56
|
isFirst: index === 0,
|
|
54
57
|
isLast: index === blocks.length - 1,
|
|
55
|
-
onMoveUp
|
|
56
|
-
onMoveDown
|
|
57
|
-
onDuplicate
|
|
58
|
-
onRemove
|
|
58
|
+
onMoveUp,
|
|
59
|
+
onMoveDown,
|
|
60
|
+
onDuplicate,
|
|
61
|
+
onRemove
|
|
59
62
|
},
|
|
60
63
|
block.id
|
|
61
64
|
)) });
|
|
62
65
|
}
|
|
63
|
-
|
|
66
|
+
const SelectableBlockPreview = memo(function SelectableBlockPreview2({
|
|
64
67
|
block,
|
|
68
|
+
blockId,
|
|
65
69
|
isSelected,
|
|
66
70
|
isHovered,
|
|
67
71
|
onSelect,
|
|
@@ -75,20 +79,24 @@ function SelectableBlockPreview({
|
|
|
75
79
|
onRemove
|
|
76
80
|
}) {
|
|
77
81
|
const t = useTranslations("admin.builder");
|
|
82
|
+
const handleSelect = useCallback(() => onSelect(blockId), [onSelect, blockId]);
|
|
83
|
+
const handleHover = useCallback(() => onHover(blockId), [onHover, blockId]);
|
|
84
|
+
const handleMoveUp = useCallback((e) => {
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
onMoveUp == null ? void 0 : onMoveUp(blockId);
|
|
87
|
+
}, [onMoveUp, blockId]);
|
|
88
|
+
const handleMoveDown = useCallback((e) => {
|
|
89
|
+
e.stopPropagation();
|
|
90
|
+
onMoveDown == null ? void 0 : onMoveDown(blockId);
|
|
91
|
+
}, [onMoveDown, blockId]);
|
|
92
|
+
const handleDuplicate = useCallback(() => onDuplicate == null ? void 0 : onDuplicate(blockId), [onDuplicate, blockId]);
|
|
93
|
+
const handleRemove = useCallback(() => onRemove == null ? void 0 : onRemove(blockId), [onRemove, blockId]);
|
|
78
94
|
if (isPatternReference(block)) {
|
|
79
|
-
const handlePatternMoveUp = (e) => {
|
|
80
|
-
e.stopPropagation();
|
|
81
|
-
onMoveUp == null ? void 0 : onMoveUp();
|
|
82
|
-
};
|
|
83
|
-
const handlePatternMoveDown = (e) => {
|
|
84
|
-
e.stopPropagation();
|
|
85
|
-
onMoveDown == null ? void 0 : onMoveDown();
|
|
86
|
-
};
|
|
87
95
|
return /* @__PURE__ */ jsxs(
|
|
88
96
|
"div",
|
|
89
97
|
{
|
|
90
98
|
className: "relative group",
|
|
91
|
-
onMouseEnter:
|
|
99
|
+
onMouseEnter: handleHover,
|
|
92
100
|
onMouseLeave: onLeave,
|
|
93
101
|
children: [
|
|
94
102
|
(onMoveUp || onMoveDown) && /* @__PURE__ */ jsxs("div", { className: cn(
|
|
@@ -102,7 +110,7 @@ function SelectableBlockPreview({
|
|
|
102
110
|
variant: "secondary",
|
|
103
111
|
size: "icon",
|
|
104
112
|
className: "h-7 w-7 shadow-md",
|
|
105
|
-
onClick:
|
|
113
|
+
onClick: handleMoveUp,
|
|
106
114
|
disabled: isFirst,
|
|
107
115
|
"data-cy": sel("blockEditor.previewCanvas.moveUp", { id: block.id }),
|
|
108
116
|
children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
|
|
@@ -114,7 +122,7 @@ function SelectableBlockPreview({
|
|
|
114
122
|
variant: "secondary",
|
|
115
123
|
size: "icon",
|
|
116
124
|
className: "h-7 w-7 shadow-md",
|
|
117
|
-
onClick:
|
|
125
|
+
onClick: handleMoveDown,
|
|
118
126
|
disabled: isLast,
|
|
119
127
|
"data-cy": sel("blockEditor.previewCanvas.moveDown", { id: block.id }),
|
|
120
128
|
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
|
|
@@ -126,8 +134,8 @@ function SelectableBlockPreview({
|
|
|
126
134
|
{
|
|
127
135
|
patternRef: block,
|
|
128
136
|
isSelected,
|
|
129
|
-
onSelect,
|
|
130
|
-
onRemove
|
|
137
|
+
onSelect: handleSelect,
|
|
138
|
+
onRemove: handleRemove
|
|
131
139
|
}
|
|
132
140
|
)
|
|
133
141
|
]
|
|
@@ -144,7 +152,7 @@ function SelectableBlockPreview({
|
|
|
144
152
|
"div",
|
|
145
153
|
{
|
|
146
154
|
className: "w-full py-12 px-4 bg-destructive/10 border border-destructive/20",
|
|
147
|
-
onClick:
|
|
155
|
+
onClick: handleSelect,
|
|
148
156
|
children: /* @__PURE__ */ jsx("div", { className: "max-w-7xl mx-auto text-center", children: /* @__PURE__ */ jsxs("p", { className: "text-destructive", children: [
|
|
149
157
|
t("canvas.error.blockNotFound"),
|
|
150
158
|
": ",
|
|
@@ -153,25 +161,17 @@ function SelectableBlockPreview({
|
|
|
153
161
|
}
|
|
154
162
|
);
|
|
155
163
|
}
|
|
156
|
-
const handleMoveUp = (e) => {
|
|
157
|
-
e.stopPropagation();
|
|
158
|
-
onMoveUp == null ? void 0 : onMoveUp();
|
|
159
|
-
};
|
|
160
|
-
const handleMoveDown = (e) => {
|
|
161
|
-
e.stopPropagation();
|
|
162
|
-
onMoveDown == null ? void 0 : onMoveDown();
|
|
163
|
-
};
|
|
164
164
|
return /* @__PURE__ */ jsxs(
|
|
165
165
|
"div",
|
|
166
166
|
{
|
|
167
167
|
className: cn(
|
|
168
|
-
"relative cursor-pointer transition-
|
|
168
|
+
"relative cursor-pointer transition-[border-color] duration-150 group @container",
|
|
169
169
|
"border-2 border-transparent",
|
|
170
170
|
"hover:border-primary/50",
|
|
171
171
|
isSelected && "border-primary"
|
|
172
172
|
),
|
|
173
|
-
onClick:
|
|
174
|
-
onMouseEnter:
|
|
173
|
+
onClick: handleSelect,
|
|
174
|
+
onMouseEnter: handleHover,
|
|
175
175
|
onMouseLeave: onLeave,
|
|
176
176
|
"data-cy": sel("blockEditor.previewCanvas.block", { id: block.id }),
|
|
177
177
|
children: [
|
|
@@ -181,8 +181,8 @@ function SelectableBlockPreview({
|
|
|
181
181
|
blockId: block.id,
|
|
182
182
|
blockSlug: block.blockSlug,
|
|
183
183
|
isVisible: isHovered || isSelected,
|
|
184
|
-
onDuplicate,
|
|
185
|
-
onRemove
|
|
184
|
+
onDuplicate: handleDuplicate,
|
|
185
|
+
onRemove: handleRemove
|
|
186
186
|
}
|
|
187
187
|
),
|
|
188
188
|
isSelected && /* @__PURE__ */ jsx(
|
|
@@ -227,7 +227,7 @@ function SelectableBlockPreview({
|
|
|
227
227
|
]
|
|
228
228
|
}
|
|
229
229
|
);
|
|
230
|
-
}
|
|
230
|
+
});
|
|
231
231
|
export {
|
|
232
232
|
BlockPreviewCanvas
|
|
233
233
|
};
|
|
@@ -158,7 +158,7 @@ function BlockSettingsPanel({
|
|
|
158
158
|
"button",
|
|
159
159
|
{
|
|
160
160
|
className: cn(
|
|
161
|
-
"flex-1 py-3 text-sm font-medium transition-
|
|
161
|
+
"flex-1 py-3 text-sm font-medium transition-colors relative flex items-center justify-center gap-1.5",
|
|
162
162
|
activeTab === "content" ? "text-primary bg-primary/5" : "text-muted-foreground hover:text-foreground hover:bg-muted/50",
|
|
163
163
|
!hasContentFields && "opacity-50 cursor-not-allowed"
|
|
164
164
|
),
|
|
@@ -176,7 +176,7 @@ function BlockSettingsPanel({
|
|
|
176
176
|
"button",
|
|
177
177
|
{
|
|
178
178
|
className: cn(
|
|
179
|
-
"flex-1 py-3 text-sm font-medium transition-
|
|
179
|
+
"flex-1 py-3 text-sm font-medium transition-colors relative flex items-center justify-center gap-1.5",
|
|
180
180
|
activeTab === "design" ? "text-primary bg-primary/5" : "text-muted-foreground hover:text-foreground hover:bg-muted/50",
|
|
181
181
|
!hasDesignFields && "opacity-50 cursor-not-allowed"
|
|
182
182
|
),
|
|
@@ -194,7 +194,7 @@ function BlockSettingsPanel({
|
|
|
194
194
|
"button",
|
|
195
195
|
{
|
|
196
196
|
className: cn(
|
|
197
|
-
"flex-1 py-3 text-sm font-medium transition-
|
|
197
|
+
"flex-1 py-3 text-sm font-medium transition-colors relative flex items-center justify-center gap-1.5",
|
|
198
198
|
activeTab === "advanced" ? "text-primary bg-primary/5" : "text-muted-foreground hover:text-foreground hover:bg-muted/50",
|
|
199
199
|
!hasAdvancedFields && "opacity-50 cursor-not-allowed"
|
|
200
200
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder-editor-view.d.ts","sourceRoot":"","sources":["../../../../src/components/dashboard/block-editor/builder-editor-view.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"builder-editor-view.d.ts","sourceRoot":"","sources":["../../../../src/components/dashboard/block-editor/builder-editor-view.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAA;AAwCxF,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,kBAAkB,CAAA;IAChC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;CACxB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,sBAAsB,2CA2rB/F"}
|