@nextsparkjs/core 0.1.0-beta.67 → 0.1.0-beta.69
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/settings/layouts/SettingsSidebar.d.ts.map +1 -1
- package/dist/components/settings/layouts/SettingsSidebar.js +14 -0
- 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/components/ui/index.d.ts +7 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +7 -0
- package/dist/components/ui/skeleton-dashboard.d.ts +32 -0
- package/dist/components/ui/skeleton-dashboard.d.ts.map +1 -0
- package/dist/components/ui/skeleton-dashboard.js +69 -0
- package/dist/components/ui/skeleton-detail.d.ts.map +1 -1
- package/dist/components/ui/skeleton-detail.js +0 -1
- package/dist/components/ui/skeleton-features.d.ts +27 -0
- package/dist/components/ui/skeleton-features.d.ts.map +1 -0
- package/dist/components/ui/skeleton-features.js +90 -0
- package/dist/components/ui/skeleton-form.d.ts.map +1 -1
- package/dist/components/ui/skeleton-form.js +0 -1
- package/dist/components/ui/skeleton-list.d.ts.map +1 -1
- package/dist/components/ui/skeleton-list.js +0 -1
- package/dist/components/ui/skeleton-public.d.ts +26 -0
- package/dist/components/ui/skeleton-public.d.ts.map +1 -0
- package/dist/components/ui/skeleton-public.js +61 -0
- package/dist/components/ui/skeleton-settings.d.ts +54 -0
- package/dist/components/ui/skeleton-settings.d.ts.map +1 -0
- package/dist/components/ui/skeleton-settings.js +332 -0
- package/dist/components/ui/skeleton.d.ts +23 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +46 -2
- package/dist/contexts/TeamContext.d.ts +2 -0
- package/dist/contexts/TeamContext.d.ts.map +1 -1
- package/dist/contexts/TeamContext.js +78 -68
- package/dist/hooks/usePrefetch.d.ts +43 -0
- package/dist/hooks/usePrefetch.d.ts.map +1 -0
- package/dist/hooks/usePrefetch.js +56 -0
- package/dist/lib/actions/index.d.ts +27 -14
- package/dist/lib/actions/index.d.ts.map +1 -1
- package/dist/lib/actions/index.js +19 -1
- package/dist/lib/actions/team.actions.d.ts +107 -0
- package/dist/lib/actions/team.actions.d.ts.map +1 -0
- package/dist/lib/actions/team.actions.js +220 -0
- package/dist/lib/actions/user.actions.d.ts +99 -0
- package/dist/lib/actions/user.actions.d.ts.map +1 -0
- package/dist/lib/actions/user.actions.js +149 -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/de/devtools.json +4 -0
- package/dist/messages/de/index.d.ts +4 -0
- package/dist/messages/de/index.d.ts.map +1 -1
- package/dist/messages/en/admin.json +15 -1
- package/dist/messages/en/devtools.json +16 -0
- package/dist/messages/en/index.d.ts +30 -0
- package/dist/messages/en/index.d.ts.map +1 -1
- package/dist/messages/es/admin.json +16 -1
- package/dist/messages/es/devtools.json +4 -0
- package/dist/messages/es/index.d.ts +19 -0
- package/dist/messages/es/index.d.ts.map +1 -1
- package/dist/messages/fr/devtools.json +4 -0
- package/dist/messages/fr/index.d.ts +4 -0
- package/dist/messages/fr/index.d.ts.map +1 -1
- package/dist/messages/it/devtools.json +4 -0
- package/dist/messages/it/index.d.ts +4 -0
- package/dist/messages/it/index.d.ts.map +1 -1
- package/dist/messages/pt/devtools.json +4 -0
- package/dist/messages/pt/index.d.ts +4 -0
- package/dist/messages/pt/index.d.ts.map +1 -1
- package/dist/nextspark-entities.d.ts +59 -0
- 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 +22 -2
- package/dist/styles/ui.css +1 -1
- package/dist/templates/app/(public)/[...slug]/page.tsx +2 -1
- package/dist/templates/app/(public)/docs/[section]/[page]/page.tsx +1 -1
- package/dist/templates/app/api/devtools/config/entities/route.ts +2 -1
- package/dist/templates/app/api/user/plan-flags/route.ts +1 -1
- package/dist/templates/app/api/v1/[entity]/[id]/child/[childType]/[childId]/route.ts +4 -2
- package/dist/templates/app/dashboard/(main)/layout.tsx +2 -1
- package/dist/templates/app/dashboard/(main)/loading.tsx +5 -0
- package/dist/templates/app/dashboard/features/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/api-keys/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/billing/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/invoices/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/notifications/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/password/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/plans/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/profile/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/security/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/teams/loading.tsx +5 -0
- package/dist/templates/app/devtools/config/page.tsx +1 -1
- package/dist/templates/app/devtools/page.tsx +1 -1
- package/dist/templates/app/devtools/tests/[[...path]]/page.tsx +1 -1
- package/dist/templates/contents/themes/starter/messages/de/common.json +4 -1
- package/dist/templates/contents/themes/starter/messages/de/index.ts +15 -0
- package/dist/templates/contents/themes/starter/messages/en/common.json +4 -1
- package/dist/templates/contents/themes/starter/messages/en/index.ts +15 -0
- package/dist/templates/contents/themes/starter/messages/es/common.json +4 -1
- package/dist/templates/contents/themes/starter/messages/es/index.ts +15 -0
- package/dist/templates/contents/themes/starter/messages/fr/common.json +4 -1
- package/dist/templates/contents/themes/starter/messages/fr/index.ts +15 -0
- package/dist/templates/contents/themes/starter/messages/it/common.json +4 -1
- package/dist/templates/contents/themes/starter/messages/it/index.ts +13 -0
- package/dist/templates/contents/themes/starter/messages/pt/common.json +4 -1
- package/dist/templates/contents/themes/starter/messages/pt/index.ts +13 -0
- package/dist/templates/contents/themes/starter/styles/globals.css +3 -1
- package/dist/templates/contents/themes/starter/templates/(dashboard)/analytics/loading.tsx +5 -0
- package/dist/templates/contents/themes/starter/templates/(public)/loading.tsx +5 -0
- 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 +10 -3
- package/dist/templates/{middleware.ts → proxy.ts} +5 -6
- package/globals.css +54 -0
- package/nextspark-entities.d.ts +59 -0
- package/package.json +18 -16
- package/scripts/build/registry/discovery/api-presets.mjs +20 -12
- package/scripts/build/registry/generators/api-presets-registry.mjs +18 -5
- package/scripts/build/registry/generators/block-registry.mjs +14 -3
- package/scripts/build/registry/generators/docs-registry.mjs +21 -3
- package/scripts/build/registry/generators/translation-registry.mjs +16 -7
- package/scripts/build/theme.mjs +2 -1
- package/templates/app/(public)/[...slug]/page.tsx +2 -1
- package/templates/app/(public)/docs/[section]/[page]/page.tsx +1 -1
- package/templates/app/api/auth/[...all]/route.ts +13 -5
- package/templates/app/api/devtools/config/entities/route.ts +2 -1
- package/templates/app/api/user/plan-flags/route.ts +1 -1
- package/templates/app/api/v1/[entity]/[id]/child/[childType]/[childId]/route.ts +4 -2
- package/templates/app/dashboard/(main)/layout.tsx +2 -1
- package/templates/app/dashboard/(main)/loading.tsx +5 -0
- package/templates/app/dashboard/features/loading.tsx +5 -0
- package/templates/app/dashboard/settings/api-keys/loading.tsx +5 -0
- package/templates/app/dashboard/settings/billing/loading.tsx +5 -0
- package/templates/app/dashboard/settings/invoices/loading.tsx +5 -0
- package/templates/app/dashboard/settings/loading.tsx +5 -0
- package/templates/app/dashboard/settings/notifications/loading.tsx +5 -0
- package/templates/app/dashboard/settings/password/loading.tsx +5 -0
- package/templates/app/dashboard/settings/plans/loading.tsx +5 -0
- package/templates/app/dashboard/settings/profile/loading.tsx +5 -0
- package/templates/app/dashboard/settings/security/loading.tsx +5 -0
- package/templates/app/dashboard/settings/teams/loading.tsx +5 -0
- package/templates/app/devtools/config/page.tsx +1 -1
- package/templates/app/devtools/page.tsx +1 -1
- package/templates/app/devtools/tests/[[...path]]/page.tsx +1 -1
- package/templates/contents/themes/starter/config/app.config.ts +8 -7
- package/templates/contents/themes/starter/messages/de/common.json +4 -1
- package/templates/contents/themes/starter/messages/de/index.ts +15 -0
- package/templates/contents/themes/starter/messages/en/common.json +4 -1
- package/templates/contents/themes/starter/messages/en/index.ts +15 -0
- package/templates/contents/themes/starter/messages/es/common.json +4 -1
- package/templates/contents/themes/starter/messages/es/index.ts +15 -0
- package/templates/contents/themes/starter/messages/fr/common.json +4 -1
- package/templates/contents/themes/starter/messages/fr/index.ts +15 -0
- package/templates/contents/themes/starter/messages/it/common.json +4 -1
- package/templates/contents/themes/starter/messages/it/index.ts +13 -0
- package/templates/contents/themes/starter/messages/pt/common.json +4 -1
- package/templates/contents/themes/starter/messages/pt/index.ts +13 -0
- package/templates/contents/themes/starter/styles/globals.css +3 -1
- package/templates/contents/themes/starter/templates/(dashboard)/analytics/loading.tsx +5 -0
- package/templates/contents/themes/starter/templates/(public)/loading.tsx +5 -0
- 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 +10 -3
- package/templates/pnpm-workspace.yaml +5 -0
- package/templates/{middleware.ts → proxy.ts} +5 -6
- package/tests/jest/setup.ts +5 -0
- package/dist/presets/plugin/.env.example.template +0 -19
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { revalidatePath } from "next/cache";
|
|
3
|
+
import { headers } from "next/headers";
|
|
4
|
+
import { getTypedSession } from "../auth.js";
|
|
5
|
+
import { TeamService } from "../services/team.service.js";
|
|
6
|
+
import { TeamMemberService } from "../services/team-member.service.js";
|
|
7
|
+
async function getAuthUser() {
|
|
8
|
+
var _a;
|
|
9
|
+
const headersList = await headers();
|
|
10
|
+
const session = await getTypedSession(headersList);
|
|
11
|
+
if (!((_a = session == null ? void 0 : session.user) == null ? void 0 : _a.id)) {
|
|
12
|
+
return { success: false, error: "Authentication required" };
|
|
13
|
+
}
|
|
14
|
+
return { success: true, userId: session.user.id };
|
|
15
|
+
}
|
|
16
|
+
async function verifyTeamPermission(userId, teamId, requiredRoles = ["owner", "admin"]) {
|
|
17
|
+
const hasPermission = await TeamMemberService.hasPermission(
|
|
18
|
+
userId,
|
|
19
|
+
teamId,
|
|
20
|
+
requiredRoles
|
|
21
|
+
);
|
|
22
|
+
if (!hasPermission) {
|
|
23
|
+
return { success: false, error: "Permission denied. Required role: " + requiredRoles.join(" or ") };
|
|
24
|
+
}
|
|
25
|
+
return { success: true };
|
|
26
|
+
}
|
|
27
|
+
async function updateTeam(teamId, data) {
|
|
28
|
+
try {
|
|
29
|
+
if (!(teamId == null ? void 0 : teamId.trim())) {
|
|
30
|
+
return { success: false, error: "Team ID is required" };
|
|
31
|
+
}
|
|
32
|
+
if (!data || Object.keys(data).length === 0) {
|
|
33
|
+
return { success: false, error: "No fields provided for update" };
|
|
34
|
+
}
|
|
35
|
+
const authResult = await getAuthUser();
|
|
36
|
+
if (!authResult.success) {
|
|
37
|
+
return { success: false, error: authResult.error };
|
|
38
|
+
}
|
|
39
|
+
const { userId } = authResult;
|
|
40
|
+
const permResult = await verifyTeamPermission(userId, teamId, ["owner", "admin"]);
|
|
41
|
+
if (!permResult.success) {
|
|
42
|
+
return { success: false, error: permResult.error };
|
|
43
|
+
}
|
|
44
|
+
const updatePayload = {};
|
|
45
|
+
if (data.name !== void 0) updatePayload.name = data.name;
|
|
46
|
+
if (data.slug !== void 0) updatePayload.slug = data.slug;
|
|
47
|
+
if (data.description !== void 0) updatePayload.description = data.description;
|
|
48
|
+
if (data.avatarUrl !== void 0) updatePayload.avatarUrl = data.avatarUrl;
|
|
49
|
+
if (data.settings !== void 0) updatePayload.settings = data.settings;
|
|
50
|
+
if (Object.keys(updatePayload).length === 0) {
|
|
51
|
+
return { success: false, error: "No valid fields provided for update" };
|
|
52
|
+
}
|
|
53
|
+
if (updatePayload.slug) {
|
|
54
|
+
const isAvailable = await TeamService.isSlugAvailable(updatePayload.slug, teamId);
|
|
55
|
+
if (!isAvailable) {
|
|
56
|
+
return { success: false, error: "Team slug is already taken" };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const updatedTeam = await TeamService.update(teamId, updatePayload, userId);
|
|
60
|
+
revalidatePath("/dashboard/settings/team");
|
|
61
|
+
revalidatePath("/dashboard");
|
|
62
|
+
return { success: true, data: updatedTeam };
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.error("[updateTeam] Error:", error);
|
|
65
|
+
return {
|
|
66
|
+
success: false,
|
|
67
|
+
error: error instanceof Error ? error.message : "Failed to update team"
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async function inviteMember(teamId, email, role = "member") {
|
|
72
|
+
try {
|
|
73
|
+
if (!(teamId == null ? void 0 : teamId.trim())) {
|
|
74
|
+
return { success: false, error: "Team ID is required" };
|
|
75
|
+
}
|
|
76
|
+
if (!(email == null ? void 0 : email.trim())) {
|
|
77
|
+
return { success: false, error: "Email is required" };
|
|
78
|
+
}
|
|
79
|
+
const validRoles = ["admin", "member", "viewer"];
|
|
80
|
+
if (!validRoles.includes(role)) {
|
|
81
|
+
return { success: false, error: "Invalid role. Must be admin, member, or viewer" };
|
|
82
|
+
}
|
|
83
|
+
const authResult = await getAuthUser();
|
|
84
|
+
if (!authResult.success) {
|
|
85
|
+
return { success: false, error: authResult.error };
|
|
86
|
+
}
|
|
87
|
+
const { userId } = authResult;
|
|
88
|
+
const permResult = await verifyTeamPermission(userId, teamId, ["owner", "admin"]);
|
|
89
|
+
if (!permResult.success) {
|
|
90
|
+
return { success: false, error: permResult.error };
|
|
91
|
+
}
|
|
92
|
+
const { UserService } = await import("../services/user.service.js");
|
|
93
|
+
const targetUser = await UserService.getUserByEmail(email, userId);
|
|
94
|
+
if (!targetUser) {
|
|
95
|
+
return { success: false, error: "User not found. They must create an account first." };
|
|
96
|
+
}
|
|
97
|
+
const existingMember = await TeamMemberService.getByTeamAndUser(teamId, targetUser.id);
|
|
98
|
+
if (existingMember) {
|
|
99
|
+
return { success: false, error: "User is already a member of this team" };
|
|
100
|
+
}
|
|
101
|
+
const member = await TeamMemberService.add(teamId, targetUser.id, role, {
|
|
102
|
+
invitedBy: userId
|
|
103
|
+
});
|
|
104
|
+
revalidatePath("/dashboard/settings/team");
|
|
105
|
+
revalidatePath("/dashboard/settings/team/members");
|
|
106
|
+
return {
|
|
107
|
+
success: true,
|
|
108
|
+
data: {
|
|
109
|
+
memberId: member.id,
|
|
110
|
+
userId: member.userId,
|
|
111
|
+
teamId: member.teamId,
|
|
112
|
+
role: member.role
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
} catch (error) {
|
|
116
|
+
console.error("[inviteMember] Error:", error);
|
|
117
|
+
return {
|
|
118
|
+
success: false,
|
|
119
|
+
error: error instanceof Error ? error.message : "Failed to invite member"
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
async function removeMember(teamId, memberId) {
|
|
124
|
+
try {
|
|
125
|
+
if (!(teamId == null ? void 0 : teamId.trim())) {
|
|
126
|
+
return { success: false, error: "Team ID is required" };
|
|
127
|
+
}
|
|
128
|
+
if (!(memberId == null ? void 0 : memberId.trim())) {
|
|
129
|
+
return { success: false, error: "Member ID is required" };
|
|
130
|
+
}
|
|
131
|
+
const authResult = await getAuthUser();
|
|
132
|
+
if (!authResult.success) {
|
|
133
|
+
return { success: false, error: authResult.error };
|
|
134
|
+
}
|
|
135
|
+
const { userId } = authResult;
|
|
136
|
+
const permResult = await verifyTeamPermission(userId, teamId, ["owner", "admin"]);
|
|
137
|
+
if (!permResult.success) {
|
|
138
|
+
return { success: false, error: permResult.error };
|
|
139
|
+
}
|
|
140
|
+
const targetUserId = memberId;
|
|
141
|
+
if (targetUserId === userId) {
|
|
142
|
+
const selfRole = await TeamMemberService.getRole(teamId, userId);
|
|
143
|
+
if (selfRole === "owner") {
|
|
144
|
+
return { success: false, error: "Cannot remove yourself as owner. Transfer ownership first." };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const targetRole = await TeamMemberService.getRole(teamId, targetUserId);
|
|
148
|
+
if (targetRole === "owner") {
|
|
149
|
+
return { success: false, error: "Cannot remove team owner. Transfer ownership first." };
|
|
150
|
+
}
|
|
151
|
+
const requestorRole = await TeamMemberService.getRole(teamId, userId);
|
|
152
|
+
if (requestorRole === "admin" && targetRole === "admin" && targetUserId !== userId) {
|
|
153
|
+
return { success: false, error: "Admins cannot remove other admins. Only the owner can do that." };
|
|
154
|
+
}
|
|
155
|
+
await TeamMemberService.remove(teamId, targetUserId);
|
|
156
|
+
revalidatePath("/dashboard/settings/team");
|
|
157
|
+
revalidatePath("/dashboard/settings/team/members");
|
|
158
|
+
return { success: true };
|
|
159
|
+
} catch (error) {
|
|
160
|
+
console.error("[removeMember] Error:", error);
|
|
161
|
+
return {
|
|
162
|
+
success: false,
|
|
163
|
+
error: error instanceof Error ? error.message : "Failed to remove member"
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
async function updateMemberRole(teamId, memberId, role) {
|
|
168
|
+
try {
|
|
169
|
+
if (!(teamId == null ? void 0 : teamId.trim())) {
|
|
170
|
+
return { success: false, error: "Team ID is required" };
|
|
171
|
+
}
|
|
172
|
+
if (!(memberId == null ? void 0 : memberId.trim())) {
|
|
173
|
+
return { success: false, error: "Member ID is required" };
|
|
174
|
+
}
|
|
175
|
+
const validRoles = ["admin", "member", "viewer"];
|
|
176
|
+
if (!validRoles.includes(role)) {
|
|
177
|
+
return { success: false, error: "Invalid role. Must be admin, member, or viewer. Use transferOwnership for owner." };
|
|
178
|
+
}
|
|
179
|
+
const authResult = await getAuthUser();
|
|
180
|
+
if (!authResult.success) {
|
|
181
|
+
return { success: false, error: authResult.error };
|
|
182
|
+
}
|
|
183
|
+
const { userId } = authResult;
|
|
184
|
+
const requestorRole = await TeamMemberService.getRole(teamId, userId);
|
|
185
|
+
if (!requestorRole) {
|
|
186
|
+
return { success: false, error: "You are not a member of this team" };
|
|
187
|
+
}
|
|
188
|
+
const targetUserId = memberId;
|
|
189
|
+
const currentRole = await TeamMemberService.getRole(teamId, targetUserId);
|
|
190
|
+
if (!currentRole) {
|
|
191
|
+
return { success: false, error: "Member not found in this team" };
|
|
192
|
+
}
|
|
193
|
+
if (currentRole === "owner") {
|
|
194
|
+
return { success: false, error: "Cannot change owner role. Use transferOwnership instead." };
|
|
195
|
+
}
|
|
196
|
+
if ((role === "admin" || currentRole === "admin") && requestorRole !== "owner") {
|
|
197
|
+
return { success: false, error: "Only the team owner can promote to or demote from admin" };
|
|
198
|
+
}
|
|
199
|
+
if (requestorRole === "admin" && (role === "member" || role === "viewer")) {
|
|
200
|
+
} else if (requestorRole !== "owner" && requestorRole !== "admin") {
|
|
201
|
+
return { success: false, error: "Permission denied. You must be an owner or admin." };
|
|
202
|
+
}
|
|
203
|
+
const updatedMember = await TeamMemberService.updateRole(teamId, targetUserId, role);
|
|
204
|
+
revalidatePath("/dashboard/settings/team");
|
|
205
|
+
revalidatePath("/dashboard/settings/team/members");
|
|
206
|
+
return { success: true, data: updatedMember };
|
|
207
|
+
} catch (error) {
|
|
208
|
+
console.error("[updateMemberRole] Error:", error);
|
|
209
|
+
return {
|
|
210
|
+
success: false,
|
|
211
|
+
error: error instanceof Error ? error.message : "Failed to update member role"
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
export {
|
|
216
|
+
inviteMember,
|
|
217
|
+
removeMember,
|
|
218
|
+
updateMemberRole,
|
|
219
|
+
updateTeam
|
|
220
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { EntityActionResult, EntityActionVoidResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Profile update data that can be passed to updateProfile
|
|
4
|
+
*/
|
|
5
|
+
export interface UpdateProfileData {
|
|
6
|
+
firstName?: string;
|
|
7
|
+
lastName?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
country?: string;
|
|
10
|
+
timezone?: string;
|
|
11
|
+
language?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Result of profile update with user data
|
|
15
|
+
*/
|
|
16
|
+
export interface ProfileUpdateResult {
|
|
17
|
+
id: string;
|
|
18
|
+
email: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
firstName?: string;
|
|
21
|
+
lastName?: string;
|
|
22
|
+
image?: string;
|
|
23
|
+
country?: string;
|
|
24
|
+
timezone?: string;
|
|
25
|
+
language?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Update the current user's profile information
|
|
29
|
+
*
|
|
30
|
+
* Auth is automatically obtained from session - users can only update their own profile.
|
|
31
|
+
*
|
|
32
|
+
* @param data - Profile fields to update
|
|
33
|
+
* @returns Updated user data wrapped in EntityActionResult
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const result = await updateProfile({
|
|
38
|
+
* firstName: 'John',
|
|
39
|
+
* lastName: 'Doe',
|
|
40
|
+
* timezone: 'America/New_York'
|
|
41
|
+
* })
|
|
42
|
+
*
|
|
43
|
+
* if (result.success) {
|
|
44
|
+
* console.log('Profile updated:', result.data)
|
|
45
|
+
* } else {
|
|
46
|
+
* console.error('Error:', result.error)
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function updateProfile(data: UpdateProfileData): Promise<EntityActionResult<ProfileUpdateResult>>;
|
|
51
|
+
/**
|
|
52
|
+
* Update the current user's avatar image
|
|
53
|
+
*
|
|
54
|
+
* Accepts FormData with an 'avatar' or 'image' field containing the image URL or file path.
|
|
55
|
+
* For actual file uploads, the file should be uploaded to storage first and the URL passed here.
|
|
56
|
+
*
|
|
57
|
+
* @param formData - FormData with 'avatar' or 'image' field containing the image URL
|
|
58
|
+
* @returns Updated user data wrapped in EntityActionResult
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```typescript
|
|
62
|
+
* // After uploading file to storage
|
|
63
|
+
* const formData = new FormData()
|
|
64
|
+
* formData.append('avatar', imageUrl)
|
|
65
|
+
* const result = await updateAvatar(formData)
|
|
66
|
+
*
|
|
67
|
+
* if (result.success) {
|
|
68
|
+
* console.log('Avatar updated:', result.data.image)
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare function updateAvatar(formData: FormData): Promise<EntityActionResult<ProfileUpdateResult>>;
|
|
73
|
+
/**
|
|
74
|
+
* Delete the current user's account
|
|
75
|
+
*
|
|
76
|
+
* This is a destructive operation that:
|
|
77
|
+
* - Removes the user from all teams
|
|
78
|
+
* - Deletes user metadata
|
|
79
|
+
* - Deletes the user account
|
|
80
|
+
*
|
|
81
|
+
* Teams owned by the user must have ownership transferred first or be deleted.
|
|
82
|
+
*
|
|
83
|
+
* @returns Success status
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* // Show confirmation dialog first!
|
|
88
|
+
* const confirmed = window.confirm('Are you sure? This cannot be undone.')
|
|
89
|
+
* if (confirmed) {
|
|
90
|
+
* const result = await deleteAccount()
|
|
91
|
+
* if (result.success) {
|
|
92
|
+
* // Redirect to goodbye page or login
|
|
93
|
+
* router.push('/goodbye')
|
|
94
|
+
* }
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare function deleteAccount(): Promise<EntityActionVoidResult>;
|
|
99
|
+
//# sourceMappingURL=user.actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.actions.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/user.actions.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAMzE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAMD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC,CA2DlD;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAC,CAsElD;AAMD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAsDrE"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { revalidatePath } from "next/cache";
|
|
3
|
+
import { headers } from "next/headers";
|
|
4
|
+
import { getTypedSession } from "../auth.js";
|
|
5
|
+
import { UserService } from "../services/user.service.js";
|
|
6
|
+
async function updateProfile(data) {
|
|
7
|
+
var _a;
|
|
8
|
+
try {
|
|
9
|
+
const headersList = await headers();
|
|
10
|
+
const session = await getTypedSession(headersList);
|
|
11
|
+
if (!((_a = session == null ? void 0 : session.user) == null ? void 0 : _a.id)) {
|
|
12
|
+
return { success: false, error: "Authentication required" };
|
|
13
|
+
}
|
|
14
|
+
const userId = session.user.id;
|
|
15
|
+
if (!data || Object.keys(data).length === 0) {
|
|
16
|
+
return { success: false, error: "No fields provided for update" };
|
|
17
|
+
}
|
|
18
|
+
const updatePayload = {};
|
|
19
|
+
if (data.firstName !== void 0) updatePayload.firstName = data.firstName;
|
|
20
|
+
if (data.lastName !== void 0) updatePayload.lastName = data.lastName;
|
|
21
|
+
if (data.name !== void 0) updatePayload.name = data.name;
|
|
22
|
+
if (data.country !== void 0) updatePayload.country = data.country;
|
|
23
|
+
if (data.timezone !== void 0) updatePayload.timezone = data.timezone;
|
|
24
|
+
if (data.language !== void 0) updatePayload.language = data.language;
|
|
25
|
+
if (Object.keys(updatePayload).length === 0) {
|
|
26
|
+
return { success: false, error: "No valid fields provided for update" };
|
|
27
|
+
}
|
|
28
|
+
const updatedUser = await UserService.updateUser(userId, updatePayload, userId);
|
|
29
|
+
revalidatePath("/dashboard/settings");
|
|
30
|
+
revalidatePath("/dashboard/settings/profile");
|
|
31
|
+
return {
|
|
32
|
+
success: true,
|
|
33
|
+
data: {
|
|
34
|
+
id: updatedUser.id,
|
|
35
|
+
email: updatedUser.email,
|
|
36
|
+
name: updatedUser.name ?? void 0,
|
|
37
|
+
firstName: updatedUser.firstName ?? void 0,
|
|
38
|
+
lastName: updatedUser.lastName ?? void 0,
|
|
39
|
+
image: updatedUser.image ?? void 0,
|
|
40
|
+
country: updatedUser.country ?? void 0,
|
|
41
|
+
timezone: updatedUser.timezone ?? void 0,
|
|
42
|
+
language: updatedUser.language ?? void 0
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error("[updateProfile] Error:", error);
|
|
47
|
+
return {
|
|
48
|
+
success: false,
|
|
49
|
+
error: error instanceof Error ? error.message : "Failed to update profile"
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function updateAvatar(formData) {
|
|
54
|
+
var _a;
|
|
55
|
+
try {
|
|
56
|
+
const headersList = await headers();
|
|
57
|
+
const session = await getTypedSession(headersList);
|
|
58
|
+
if (!((_a = session == null ? void 0 : session.user) == null ? void 0 : _a.id)) {
|
|
59
|
+
return { success: false, error: "Authentication required" };
|
|
60
|
+
}
|
|
61
|
+
const userId = session.user.id;
|
|
62
|
+
const avatarValue = formData.get("avatar") ?? formData.get("image");
|
|
63
|
+
if (!avatarValue) {
|
|
64
|
+
return { success: false, error: "Avatar image is required" };
|
|
65
|
+
}
|
|
66
|
+
let imageUrl;
|
|
67
|
+
if (typeof avatarValue === "string") {
|
|
68
|
+
imageUrl = avatarValue;
|
|
69
|
+
} else {
|
|
70
|
+
return {
|
|
71
|
+
success: false,
|
|
72
|
+
error: "Please upload the image first and pass the URL"
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (!imageUrl.startsWith("http://") && !imageUrl.startsWith("https://") && !imageUrl.startsWith("/")) {
|
|
76
|
+
return { success: false, error: "Invalid image URL format" };
|
|
77
|
+
}
|
|
78
|
+
const updatedUser = await UserService.updateUser(
|
|
79
|
+
userId,
|
|
80
|
+
{ image: imageUrl },
|
|
81
|
+
userId
|
|
82
|
+
);
|
|
83
|
+
revalidatePath("/dashboard/settings");
|
|
84
|
+
revalidatePath("/dashboard/settings/profile");
|
|
85
|
+
revalidatePath("/dashboard");
|
|
86
|
+
return {
|
|
87
|
+
success: true,
|
|
88
|
+
data: {
|
|
89
|
+
id: updatedUser.id,
|
|
90
|
+
email: updatedUser.email,
|
|
91
|
+
name: updatedUser.name ?? void 0,
|
|
92
|
+
firstName: updatedUser.firstName ?? void 0,
|
|
93
|
+
lastName: updatedUser.lastName ?? void 0,
|
|
94
|
+
image: updatedUser.image ?? void 0,
|
|
95
|
+
country: updatedUser.country ?? void 0,
|
|
96
|
+
timezone: updatedUser.timezone ?? void 0,
|
|
97
|
+
language: updatedUser.language ?? void 0
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
} catch (error) {
|
|
101
|
+
console.error("[updateAvatar] Error:", error);
|
|
102
|
+
return {
|
|
103
|
+
success: false,
|
|
104
|
+
error: error instanceof Error ? error.message : "Failed to update avatar"
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async function deleteAccount() {
|
|
109
|
+
var _a;
|
|
110
|
+
try {
|
|
111
|
+
const headersList = await headers();
|
|
112
|
+
const session = await getTypedSession(headersList);
|
|
113
|
+
if (!((_a = session == null ? void 0 : session.user) == null ? void 0 : _a.id)) {
|
|
114
|
+
return { success: false, error: "Authentication required" };
|
|
115
|
+
}
|
|
116
|
+
const userId = session.user.id;
|
|
117
|
+
const { TeamService } = await import("../services/team.service.js");
|
|
118
|
+
const ownedTeams = await TeamService.getByOwnerId(userId);
|
|
119
|
+
if (ownedTeams.length > 0) {
|
|
120
|
+
return {
|
|
121
|
+
success: false,
|
|
122
|
+
error: "Cannot delete account while owning teams. Transfer ownership or delete teams first."
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
await UserService.deleteAllUserMetas(userId, userId);
|
|
126
|
+
const { mutateWithRLS } = await import("../db.js");
|
|
127
|
+
const result = await mutateWithRLS(
|
|
128
|
+
'DELETE FROM "users" WHERE id = $1',
|
|
129
|
+
[userId],
|
|
130
|
+
userId
|
|
131
|
+
);
|
|
132
|
+
if (result.rowCount === 0) {
|
|
133
|
+
return { success: false, error: "User not found" };
|
|
134
|
+
}
|
|
135
|
+
revalidatePath("/");
|
|
136
|
+
return { success: true };
|
|
137
|
+
} catch (error) {
|
|
138
|
+
console.error("[deleteAccount] Error:", error);
|
|
139
|
+
return {
|
|
140
|
+
success: false,
|
|
141
|
+
error: error instanceof Error ? error.message : "Failed to delete account"
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export {
|
|
146
|
+
deleteAccount,
|
|
147
|
+
updateAvatar,
|
|
148
|
+
updateProfile
|
|
149
|
+
};
|
|
@@ -429,8 +429,13 @@ export declare const CORE_SELECTORS: {
|
|
|
429
429
|
readonly slugInput: "builder-slug-input";
|
|
430
430
|
readonly externalLink: "builder-external-link";
|
|
431
431
|
readonly viewToggle: "builder-view-toggle";
|
|
432
|
-
readonly viewEditor: "builder-view-editor";
|
|
433
432
|
readonly viewPreview: "builder-view-preview";
|
|
433
|
+
readonly viewSettings: "builder-view-settings";
|
|
434
|
+
readonly viewportToggle: {
|
|
435
|
+
readonly container: "builder-viewport-toggle";
|
|
436
|
+
readonly mobileBtn: "builder-viewport-mobile";
|
|
437
|
+
readonly desktopBtn: "builder-viewport-desktop";
|
|
438
|
+
};
|
|
434
439
|
readonly statusSelector: "builder-status-selector";
|
|
435
440
|
readonly statusOption: "builder-status-option-{value}";
|
|
436
441
|
readonly statusDot: "builder-status-dot";
|
|
@@ -445,7 +450,7 @@ export declare const CORE_SELECTORS: {
|
|
|
445
450
|
readonly container: "block-picker";
|
|
446
451
|
readonly tabBlocks: "block-picker-tab-blocks";
|
|
447
452
|
readonly tabPatterns: "block-picker-tab-patterns";
|
|
448
|
-
readonly
|
|
453
|
+
readonly tabLayout: "block-picker-tab-layout";
|
|
449
454
|
readonly tabIndicator: "block-picker-tab-indicator";
|
|
450
455
|
readonly searchWrapper: "block-picker-search-wrapper";
|
|
451
456
|
readonly searchIcon: "block-picker-search-icon";
|
|
@@ -474,39 +479,36 @@ export declare const CORE_SELECTORS: {
|
|
|
474
479
|
readonly patternCardBlockCount: "block-picker-pattern-blocks-{id}";
|
|
475
480
|
readonly patternCardInsertButton: "block-picker-pattern-insert-{id}";
|
|
476
481
|
};
|
|
477
|
-
readonly
|
|
478
|
-
readonly container: "
|
|
479
|
-
readonly
|
|
480
|
-
readonly
|
|
481
|
-
readonly
|
|
482
|
-
readonly
|
|
483
|
-
readonly
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
readonly
|
|
487
|
-
readonly
|
|
488
|
-
readonly dropZone: "layout-canvas-dropzone";
|
|
489
|
-
readonly sortableBlock: {
|
|
490
|
-
readonly container: "sortable-block-{id}";
|
|
491
|
-
readonly card: "sortable-block-card-{id}";
|
|
492
|
-
readonly dragHandle: "sortable-block-drag-{id}";
|
|
493
|
-
readonly name: "sortable-block-name-{id}";
|
|
494
|
-
readonly category: "sortable-block-category-{id}";
|
|
495
|
-
readonly propsPreview: "sortable-block-props-{id}";
|
|
496
|
-
readonly duplicateBtn: "sortable-block-duplicate-{id}";
|
|
497
|
-
readonly removeBtn: "sortable-block-remove-{id}";
|
|
498
|
-
readonly error: "sortable-block-error-{id}";
|
|
499
|
-
};
|
|
482
|
+
readonly treeView: {
|
|
483
|
+
readonly container: "builder-tree-view";
|
|
484
|
+
readonly empty: "builder-tree-empty";
|
|
485
|
+
readonly node: "builder-tree-node-{id}";
|
|
486
|
+
readonly nodeIcon: "builder-tree-node-icon-{id}";
|
|
487
|
+
readonly nodeName: "builder-tree-node-name-{id}";
|
|
488
|
+
readonly nodeDragHandle: "builder-tree-node-drag-{id}";
|
|
489
|
+
readonly nodeSelected: "builder-tree-node-selected";
|
|
490
|
+
readonly patternGroup: "builder-tree-pattern-{ref}";
|
|
491
|
+
readonly patternGroupHeader: "builder-tree-pattern-header-{ref}";
|
|
492
|
+
readonly patternGroupBlocks: "builder-tree-pattern-blocks-{ref}";
|
|
500
493
|
};
|
|
501
494
|
readonly previewCanvas: {
|
|
502
495
|
readonly container: "preview-canvas";
|
|
503
496
|
readonly wrapper: "preview-canvas-wrapper";
|
|
504
497
|
readonly content: "preview-canvas-content";
|
|
505
498
|
readonly empty: "preview-canvas-empty";
|
|
499
|
+
readonly viewport: "preview-canvas-viewport-{mode}";
|
|
500
|
+
readonly viewportMobile: "preview-canvas-mobile";
|
|
501
|
+
readonly viewportDesktop: "preview-canvas-desktop";
|
|
502
|
+
readonly iframePreview: {
|
|
503
|
+
readonly container: "preview-iframe-container";
|
|
504
|
+
readonly loading: "preview-iframe-loading";
|
|
505
|
+
readonly frame: "preview-iframe-frame";
|
|
506
|
+
};
|
|
506
507
|
readonly block: "preview-block-{id}";
|
|
507
508
|
readonly blockWrapper: "preview-block-wrapper-{id}";
|
|
508
509
|
readonly blockSelected: "preview-block-selected-{id}";
|
|
509
510
|
readonly editingBadge: "preview-block-editing-{id}";
|
|
511
|
+
readonly blockGeneric: "preview-block-";
|
|
510
512
|
readonly floatingToolbar: {
|
|
511
513
|
readonly container: "floating-toolbar-{id}";
|
|
512
514
|
readonly dragHandle: "floating-toolbar-drag-{id}";
|
|
@@ -518,6 +520,32 @@ export declare const CORE_SELECTORS: {
|
|
|
518
520
|
readonly moveUp: "preview-block-move-up-{id}";
|
|
519
521
|
readonly moveDown: "preview-block-move-down-{id}";
|
|
520
522
|
};
|
|
523
|
+
readonly configPanel: {
|
|
524
|
+
readonly container: "builder-config-panel";
|
|
525
|
+
readonly scroll: "builder-config-scroll";
|
|
526
|
+
readonly entityFieldsSection: {
|
|
527
|
+
readonly container: "builder-config-entity-section";
|
|
528
|
+
readonly trigger: "builder-config-entity-trigger";
|
|
529
|
+
readonly content: "builder-config-entity-content";
|
|
530
|
+
readonly field: "builder-config-entity-field-{name}";
|
|
531
|
+
};
|
|
532
|
+
readonly seoMetaSection: {
|
|
533
|
+
readonly container: "builder-config-seo-section";
|
|
534
|
+
readonly trigger: "builder-config-seo-trigger";
|
|
535
|
+
readonly content: "builder-config-seo-content";
|
|
536
|
+
readonly metaTitle: "builder-config-seo-title";
|
|
537
|
+
readonly metaDescription: "builder-config-seo-description";
|
|
538
|
+
readonly metaKeywords: "builder-config-seo-keywords";
|
|
539
|
+
readonly ogImage: "builder-config-seo-og-image";
|
|
540
|
+
readonly customFields: {
|
|
541
|
+
readonly container: "builder-config-custom-fields";
|
|
542
|
+
readonly fieldKey: "builder-config-custom-key-{index}";
|
|
543
|
+
readonly fieldValue: "builder-config-custom-value-{index}";
|
|
544
|
+
readonly fieldRemove: "builder-config-custom-remove-{index}";
|
|
545
|
+
readonly addButton: "builder-config-custom-add";
|
|
546
|
+
};
|
|
547
|
+
};
|
|
548
|
+
};
|
|
521
549
|
readonly patternReference: {
|
|
522
550
|
readonly container: "pattern-reference-{ref}";
|
|
523
551
|
readonly badge: "pattern-reference-badge-{ref}";
|
|
@@ -525,25 +553,6 @@ export declare const CORE_SELECTORS: {
|
|
|
525
553
|
readonly locked: "pattern-reference-locked-{ref}";
|
|
526
554
|
readonly editLink: "pattern-reference-edit-link-{ref}";
|
|
527
555
|
};
|
|
528
|
-
readonly entityMetaPanel: {
|
|
529
|
-
readonly container: "entity-meta-panel";
|
|
530
|
-
readonly seoSection: {
|
|
531
|
-
readonly trigger: "entity-meta-seo-trigger";
|
|
532
|
-
readonly content: "entity-meta-seo-content";
|
|
533
|
-
readonly metaTitle: "entity-meta-seo-title";
|
|
534
|
-
readonly metaDescription: "entity-meta-seo-description";
|
|
535
|
-
readonly metaKeywords: "entity-meta-seo-keywords";
|
|
536
|
-
readonly ogImage: "entity-meta-seo-og-image";
|
|
537
|
-
};
|
|
538
|
-
readonly customFields: {
|
|
539
|
-
readonly trigger: "entity-meta-custom-trigger";
|
|
540
|
-
readonly content: "entity-meta-custom-content";
|
|
541
|
-
readonly fieldKey: "entity-meta-custom-key-{index}";
|
|
542
|
-
readonly fieldValue: "entity-meta-custom-value-{index}";
|
|
543
|
-
readonly fieldRemove: "entity-meta-custom-remove-{index}";
|
|
544
|
-
readonly addButton: "entity-meta-custom-add";
|
|
545
|
-
};
|
|
546
|
-
};
|
|
547
556
|
readonly blockPropertiesPanel: {
|
|
548
557
|
readonly container: "block-properties-panel";
|
|
549
558
|
readonly header: "block-properties-header";
|
|
@@ -556,6 +565,7 @@ export declare const CORE_SELECTORS: {
|
|
|
556
565
|
readonly tabAdvanced: "block-properties-tab-advanced";
|
|
557
566
|
readonly empty: "block-properties-empty";
|
|
558
567
|
readonly error: "block-properties-error";
|
|
568
|
+
readonly resetPropsBtn: "block-properties-reset-btn";
|
|
559
569
|
readonly patternLocked: "block-properties-pattern-locked";
|
|
560
570
|
readonly patternTitle: "block-properties-pattern-title";
|
|
561
571
|
readonly patternEditLink: "block-properties-pattern-edit";
|
|
@@ -584,6 +594,50 @@ export declare const CORE_SELECTORS: {
|
|
|
584
594
|
readonly categoryBadge: "entity-field-category-badge-{id}";
|
|
585
595
|
readonly categoryRemove: "entity-field-category-remove-{id}";
|
|
586
596
|
};
|
|
597
|
+
readonly layoutCanvas: {
|
|
598
|
+
readonly container: "layout-canvas";
|
|
599
|
+
readonly empty: "layout-canvas-empty";
|
|
600
|
+
readonly dropZone: "layout-canvas-dropzone";
|
|
601
|
+
readonly sortableBlock: {
|
|
602
|
+
readonly container: "sortable-block-{id}";
|
|
603
|
+
readonly card: "sortable-block-card-{id}";
|
|
604
|
+
readonly dragHandle: "sortable-block-drag-{id}";
|
|
605
|
+
readonly name: "sortable-block-name-{id}";
|
|
606
|
+
readonly category: "sortable-block-category-{id}";
|
|
607
|
+
readonly propsPreview: "sortable-block-props-{id}";
|
|
608
|
+
readonly duplicateBtn: "sortable-block-duplicate-{id}";
|
|
609
|
+
readonly removeBtn: "sortable-block-remove-{id}";
|
|
610
|
+
readonly error: "sortable-block-error-{id}";
|
|
611
|
+
readonly generic: "sortable-block-";
|
|
612
|
+
};
|
|
613
|
+
};
|
|
614
|
+
readonly entityFieldsPanel: {
|
|
615
|
+
readonly container: "entity-fields-panel";
|
|
616
|
+
readonly field: "entity-field-{name}";
|
|
617
|
+
readonly categoryList: "entity-field-categories";
|
|
618
|
+
readonly categoryItem: "entity-field-category-{slug}";
|
|
619
|
+
readonly categoryCheckbox: "entity-field-category-checkbox-{slug}";
|
|
620
|
+
readonly categoryBadge: "entity-field-category-badge-{slug}";
|
|
621
|
+
};
|
|
622
|
+
readonly entityMetaPanel: {
|
|
623
|
+
readonly container: "entity-meta-panel";
|
|
624
|
+
readonly seoSection: {
|
|
625
|
+
readonly trigger: "entity-meta-seo-trigger";
|
|
626
|
+
readonly content: "entity-meta-seo-content";
|
|
627
|
+
readonly metaTitle: "entity-meta-seo-title";
|
|
628
|
+
readonly metaDescription: "entity-meta-seo-description";
|
|
629
|
+
readonly metaKeywords: "entity-meta-seo-keywords";
|
|
630
|
+
readonly ogImage: "entity-meta-seo-og-image";
|
|
631
|
+
};
|
|
632
|
+
readonly customFields: {
|
|
633
|
+
readonly trigger: "entity-meta-custom-trigger";
|
|
634
|
+
readonly content: "entity-meta-custom-content";
|
|
635
|
+
readonly fieldKey: "entity-meta-custom-key-{index}";
|
|
636
|
+
readonly fieldValue: "entity-meta-custom-value-{index}";
|
|
637
|
+
readonly fieldRemove: "entity-meta-custom-remove-{index}";
|
|
638
|
+
readonly addButton: "entity-meta-custom-add";
|
|
639
|
+
};
|
|
640
|
+
};
|
|
587
641
|
};
|
|
588
642
|
readonly settings: {
|
|
589
643
|
readonly container: "settings-container";
|