@edgedev/create-edge-app 1.1.3 → 1.1.5
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/app.vue +0 -3
- package/package.json +1 -1
- package/pages/app/account.vue +26 -29
- package/pages/app/dashboard/[[collection]]/[[docId]].vue +87 -90
- package/pages/app/login.vue +9 -11
- package/pages/app/signup.vue +9 -11
- package/{layouts → pages}/app.vue +68 -36
- package/tsconfig.json +1 -1
package/app.vue
CHANGED
package/package.json
CHANGED
package/pages/app/account.vue
CHANGED
|
@@ -40,36 +40,33 @@ const menuItems = [
|
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
42
|
<template>
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<NuxtPage class="flex-1 flex flex-col overflow-y-auto p-3" />
|
|
69
|
-
</SidebarProvider>
|
|
70
|
-
</div>
|
|
43
|
+
<div
|
|
44
|
+
v-if="edgeGlobal.edgeState.organizationDocPath"
|
|
45
|
+
>
|
|
46
|
+
<div class="h-full p-0">
|
|
47
|
+
<SidebarProvider class="min-h-full">
|
|
48
|
+
<div class="h-full md:w-[180px]">
|
|
49
|
+
<edge-side-bar
|
|
50
|
+
:menu-items="menuItems"
|
|
51
|
+
:settings-menu-items="isAdmin ? adminMenuItems : []"
|
|
52
|
+
collapsible="submenu"
|
|
53
|
+
class="bg-background text-foreground border-none w-[180px] absolute shadow-none"
|
|
54
|
+
:show-settings-section="false"
|
|
55
|
+
title="My Settings"
|
|
56
|
+
settings-title="Organization Settings"
|
|
57
|
+
group-label-classes="text-foreground/70"
|
|
58
|
+
>
|
|
59
|
+
<template #header>
|
|
60
|
+
<h1 class="text-xl">
|
|
61
|
+
Settings
|
|
62
|
+
</h1>
|
|
63
|
+
</template>
|
|
64
|
+
</edge-side-bar>
|
|
65
|
+
</div>
|
|
66
|
+
<NuxtPage class="flex-1 flex flex-col overflow-y-auto p-3" />
|
|
67
|
+
</SidebarProvider>
|
|
71
68
|
</div>
|
|
72
|
-
</
|
|
69
|
+
</div>
|
|
73
70
|
</template>
|
|
74
71
|
|
|
75
72
|
<style lang="scss">
|
|
@@ -71,69 +71,90 @@ onMounted(() => {
|
|
|
71
71
|
</script>
|
|
72
72
|
|
|
73
73
|
<template>
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
74
|
+
<div
|
|
75
|
+
v-if="edgeGlobal.edgeState.organizationDocPath"
|
|
76
|
+
>
|
|
77
|
+
<edge-dashboard v-if="docId === ''" :filter="state.filter" :collection="collection" class="flex-1">
|
|
78
|
+
<template #header-start>
|
|
79
|
+
<LayoutDashboard class="mr-2" />
|
|
80
|
+
<span class="capitalize">{{ collection }}</span>
|
|
81
|
+
</template>
|
|
82
|
+
<template #header-center>
|
|
83
|
+
<div class="w-full px-6">
|
|
84
|
+
<edge-shad-input
|
|
85
|
+
v-model="state.filter"
|
|
86
|
+
label=""
|
|
87
|
+
name="filter"
|
|
88
|
+
placeholder="Filter..."
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
92
|
+
<template #header-end="slotProps">
|
|
93
|
+
<edge-shad-button class="uppercase bg-slate-600" :to="`/app/dashboard/${collection}/new`">
|
|
94
|
+
Add {{ slotProps.title }}
|
|
95
|
+
</edge-shad-button>
|
|
96
|
+
</template>
|
|
97
|
+
<template #list-item="slotProps">
|
|
98
|
+
<edge-shad-button variant="text" class="cursor-pointer w-full flex justify-between slotProps.items-center py-2 gap-3" :to="`/app/dashboard/${collection}/${slotProps.item.docId}`">
|
|
99
|
+
<div>
|
|
100
|
+
<Avatar class="cursor-pointer p-0 h-8 w-8 mr-2">
|
|
101
|
+
<FilePenLine class="h-5 w-5" />
|
|
102
|
+
</Avatar>
|
|
92
103
|
</div>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
Add {{ slotProps.title }}
|
|
97
|
-
</edge-shad-button>
|
|
98
|
-
</template>
|
|
99
|
-
<template #list-item="slotProps">
|
|
100
|
-
<edge-shad-button variant="text" class="cursor-pointer w-full flex justify-between slotProps.items-center py-2 gap-3" :to="`/app/dashboard/${collection}/${slotProps.item.docId}`">
|
|
101
|
-
<div>
|
|
102
|
-
<Avatar class="cursor-pointer p-0 h-8 w-8 mr-2">
|
|
103
|
-
<FilePenLine class="h-5 w-5" />
|
|
104
|
-
</Avatar>
|
|
105
|
-
</div>
|
|
106
|
-
<div class="grow text-left">
|
|
107
|
-
<div class="text-lg">
|
|
108
|
-
{{ slotProps.item.name }}
|
|
109
|
-
</div>
|
|
104
|
+
<div class="grow text-left">
|
|
105
|
+
<div class="text-lg">
|
|
106
|
+
{{ slotProps.item.name }}
|
|
110
107
|
</div>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
</
|
|
120
|
-
</
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
</
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
108
|
+
</div>
|
|
109
|
+
<div>
|
|
110
|
+
<edge-shad-button
|
|
111
|
+
size="icon"
|
|
112
|
+
class="bg-slate-600 h-7 w-7"
|
|
113
|
+
@click.stop="slotProps.deleteItem(slotProps.item.docId)"
|
|
114
|
+
>
|
|
115
|
+
<Trash class="h-5 w-5" />
|
|
116
|
+
</edge-shad-button>
|
|
117
|
+
</div>
|
|
118
|
+
</edge-shad-button>
|
|
119
|
+
<Separator class="dark:bg-slate-600" />
|
|
120
|
+
</template>
|
|
121
|
+
</edge-dashboard>
|
|
122
|
+
<edge-editor
|
|
123
|
+
v-else
|
|
124
|
+
:collection="collection"
|
|
125
|
+
:doc-id="docId"
|
|
126
|
+
:schema="schemas[collection]"
|
|
127
|
+
:new-doc-schema="state.newDocs[collection]"
|
|
128
|
+
class="w-full max-w-7xl mx-auto flex-1"
|
|
129
|
+
>
|
|
130
|
+
<template #header-start="slotProps">
|
|
131
|
+
<FilePenLine class="mr-2" />
|
|
132
|
+
{{ slotProps.title }}
|
|
133
|
+
</template>
|
|
134
|
+
<template #header-end="slotProps">
|
|
135
|
+
<edge-shad-button
|
|
136
|
+
v-if="!slotProps.unsavedChanges"
|
|
137
|
+
:to="`/app/dashboard/${collection}`"
|
|
138
|
+
class="bg-red-700 uppercase h-8 hover:bg-slate-400 w-20"
|
|
139
|
+
>
|
|
140
|
+
Close
|
|
141
|
+
</edge-shad-button>
|
|
142
|
+
<edge-shad-button
|
|
143
|
+
v-else
|
|
144
|
+
:to="`/app/dashboard/${collection}`"
|
|
145
|
+
class="bg-red-700 uppercase h-8 hover:bg-slate-400 w-20"
|
|
146
|
+
>
|
|
147
|
+
Cancel
|
|
148
|
+
</edge-shad-button>
|
|
149
|
+
<edge-shad-button
|
|
150
|
+
type="submit"
|
|
151
|
+
class="bg-slate-500 uppercase h-8 hover:bg-slate-400 w-20"
|
|
152
|
+
>
|
|
153
|
+
Save
|
|
154
|
+
</edge-shad-button>
|
|
155
|
+
</template>
|
|
156
|
+
<template #footer="slotProps">
|
|
157
|
+
<div class="flex w-full gap-1 items-center justify-end">
|
|
137
158
|
<edge-shad-button
|
|
138
159
|
v-if="!slotProps.unsavedChanges"
|
|
139
160
|
:to="`/app/dashboard/${collection}`"
|
|
@@ -148,39 +169,15 @@ onMounted(() => {
|
|
|
148
169
|
>
|
|
149
170
|
Cancel
|
|
150
171
|
</edge-shad-button>
|
|
172
|
+
|
|
151
173
|
<edge-shad-button
|
|
152
174
|
type="submit"
|
|
153
175
|
class="bg-slate-500 uppercase h-8 hover:bg-slate-400 w-20"
|
|
154
176
|
>
|
|
155
177
|
Save
|
|
156
178
|
</edge-shad-button>
|
|
157
|
-
</
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
v-if="!slotProps.unsavedChanges"
|
|
162
|
-
:to="`/app/dashboard/${collection}`"
|
|
163
|
-
class="bg-red-700 uppercase h-8 hover:bg-slate-400 w-20"
|
|
164
|
-
>
|
|
165
|
-
Close
|
|
166
|
-
</edge-shad-button>
|
|
167
|
-
<edge-shad-button
|
|
168
|
-
v-else
|
|
169
|
-
:to="`/app/dashboard/${collection}`"
|
|
170
|
-
class="bg-red-700 uppercase h-8 hover:bg-slate-400 w-20"
|
|
171
|
-
>
|
|
172
|
-
Cancel
|
|
173
|
-
</edge-shad-button>
|
|
174
|
-
|
|
175
|
-
<edge-shad-button
|
|
176
|
-
type="submit"
|
|
177
|
-
class="bg-slate-500 uppercase h-8 hover:bg-slate-400 w-20"
|
|
178
|
-
>
|
|
179
|
-
Save
|
|
180
|
-
</edge-shad-button>
|
|
181
|
-
</div>
|
|
182
|
-
</template>
|
|
183
|
-
</edge-editor>
|
|
184
|
-
</div>
|
|
185
|
-
</NuxtLayout>
|
|
179
|
+
</div>
|
|
180
|
+
</template>
|
|
181
|
+
</edge-editor>
|
|
182
|
+
</div>
|
|
186
183
|
</template>
|
package/pages/app/login.vue
CHANGED
|
@@ -2,17 +2,15 @@
|
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
4
|
<template>
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</div>
|
|
15
|
-
</NuxtLayout>
|
|
5
|
+
<div class="flex w-full h-full align-center items-center">
|
|
6
|
+
<edge-auth type="login" class="p-8 mx-auto max-w-lg w-full h-full max-h-[540px] overflow-y-auto">
|
|
7
|
+
<div class="grid gap-2 text-center">
|
|
8
|
+
<h1 class="text-2xl font-bold">
|
|
9
|
+
Login
|
|
10
|
+
</h1>
|
|
11
|
+
</div>
|
|
12
|
+
</edge-auth>
|
|
13
|
+
</div>
|
|
16
14
|
</template>
|
|
17
15
|
|
|
18
16
|
<style lang="scss" scoped>
|
package/pages/app/signup.vue
CHANGED
|
@@ -3,17 +3,15 @@ const config = useRuntimeConfig()
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<template>
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</div>
|
|
16
|
-
</NuxtLayout>
|
|
6
|
+
<div class="flex w-full h-full align-center items-center">
|
|
7
|
+
<edge-auth type="register" :registration-code="config.public.registrationCode" class="p-8 mx-auto max-w-lg w-full h-full max-h-[760px] overflow-y-auto">
|
|
8
|
+
<div class="grid gap-2 text-center">
|
|
9
|
+
<h1 class="text-2xl font-bold">
|
|
10
|
+
Sign Up
|
|
11
|
+
</h1>
|
|
12
|
+
</div>
|
|
13
|
+
</edge-auth>
|
|
14
|
+
</div>
|
|
17
15
|
</template>
|
|
18
16
|
|
|
19
17
|
<style lang="scss" scoped>
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
const edgeFirebase = inject('edgeFirebase')
|
|
3
3
|
// const edgeGlobal = inject('edgeGlobal')
|
|
4
4
|
|
|
5
|
+
const route = useRoute()
|
|
6
|
+
|
|
5
7
|
const currentOrganization = computed(() => {
|
|
6
8
|
return edgeGlobal.edgeState.currentOrganization
|
|
7
9
|
})
|
|
@@ -70,6 +72,59 @@ const colorMode = useColorMode()
|
|
|
70
72
|
onMounted(() => {
|
|
71
73
|
colorMode.preference = 'system'
|
|
72
74
|
})
|
|
75
|
+
|
|
76
|
+
const showLeftPanel = computed(() => {
|
|
77
|
+
return edgeGlobal?.edgeState?.showLeftPanel[route.path]
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
const leftPanelDefaultSize = computed(() => {
|
|
81
|
+
if (showLeftPanel.value) {
|
|
82
|
+
return 20
|
|
83
|
+
}
|
|
84
|
+
return 0
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
const mainPanelDefaultSize = computed(() => {
|
|
88
|
+
if (showLeftPanel.value) {
|
|
89
|
+
return 80
|
|
90
|
+
}
|
|
91
|
+
return 100
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
const leftPanel = ref(null)
|
|
95
|
+
const mainPanel = ref(null)
|
|
96
|
+
|
|
97
|
+
watch(showLeftPanel, (value) => {
|
|
98
|
+
if (leftPanel.value && mainPanel.value) {
|
|
99
|
+
const animateResize = (panel, targetSize) => {
|
|
100
|
+
let currentSize = panel.value.getSize()
|
|
101
|
+
const step = (targetSize - currentSize) / 10 // Smooth out the transition
|
|
102
|
+
|
|
103
|
+
const animate = () => {
|
|
104
|
+
if (Math.abs(currentSize - targetSize) > 0.5) {
|
|
105
|
+
currentSize += step
|
|
106
|
+
panel.value.resize(currentSize)
|
|
107
|
+
requestAnimationFrame(animate)
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
panel.value.resize(targetSize)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
animate()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (value) {
|
|
118
|
+
animateResize(leftPanel, 20)
|
|
119
|
+
animateResize(mainPanel, 80)
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
animateResize(leftPanel, 0)
|
|
123
|
+
animateResize(mainPanel, 100)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
|
|
73
128
|
edgeFirebase.runFunction('edgeFirebase-initFirestore', {})
|
|
74
129
|
edgeGlobal.edgeState.userRoles = [
|
|
75
130
|
{
|
|
@@ -104,30 +159,6 @@ const menuItems = [
|
|
|
104
159
|
icon: 'Package',
|
|
105
160
|
},
|
|
106
161
|
]
|
|
107
|
-
|
|
108
|
-
const slots = useSlots()
|
|
109
|
-
const hasLeftPanel = computed(() => {
|
|
110
|
-
const leftPanelSlot = slots['left-panel']
|
|
111
|
-
if (!leftPanelSlot) {
|
|
112
|
-
return false
|
|
113
|
-
}
|
|
114
|
-
const slotContent = leftPanelSlot()
|
|
115
|
-
return slotContent.length > 0 && slotContent.some(node => node.children && node.children.length > 0)
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
const leftPanelDefaultSize = computed(() => {
|
|
119
|
-
if (hasLeftPanel.value) {
|
|
120
|
-
return 20
|
|
121
|
-
}
|
|
122
|
-
return 0
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
const mainPanelDefaultSize = computed(() => {
|
|
126
|
-
if (hasLeftPanel.value) {
|
|
127
|
-
return 80
|
|
128
|
-
}
|
|
129
|
-
return 100
|
|
130
|
-
})
|
|
131
162
|
</script>
|
|
132
163
|
|
|
133
164
|
<template>
|
|
@@ -136,8 +167,8 @@ const mainPanelDefaultSize = computed(() => {
|
|
|
136
167
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover">
|
|
137
168
|
</Head>
|
|
138
169
|
<Toaster />
|
|
139
|
-
<div class="flex flex-col h-
|
|
140
|
-
<div class="flex h-full w-full">
|
|
170
|
+
<div class="flex flex-col h-[calc(100vh+200px)]">
|
|
171
|
+
<div class="flex h-full w-full fixed">
|
|
141
172
|
<edge-sidebar-provider
|
|
142
173
|
v-slot="sideBarProviderProps"
|
|
143
174
|
enable-nested-menu
|
|
@@ -175,20 +206,17 @@ const mainPanelDefaultSize = computed(() => {
|
|
|
175
206
|
</CardContent>
|
|
176
207
|
</Card>
|
|
177
208
|
</template>
|
|
178
|
-
<template #nested-menu>
|
|
179
|
-
<slot name="nested-menu" />
|
|
180
|
-
</template>
|
|
181
209
|
</edge-side-bar>
|
|
182
210
|
</div>
|
|
183
211
|
<ResizablePanelGroup
|
|
184
212
|
direction="horizontal"
|
|
185
213
|
class="h-full w-full"
|
|
186
214
|
>
|
|
187
|
-
<ResizablePanel class="bg-sidebar text-sidebar-foreground" :default-size="leftPanelDefaultSize">
|
|
188
|
-
<
|
|
215
|
+
<ResizablePanel ref="leftPanel" class="bg-sidebar text-sidebar-foreground" :default-size="leftPanelDefaultSize">
|
|
216
|
+
<div id="left-panel" />
|
|
189
217
|
</ResizablePanel>
|
|
190
|
-
<ResizableHandle v-if="
|
|
191
|
-
<ResizablePanel :default-size="mainPanelDefaultSize">
|
|
218
|
+
<ResizableHandle v-if="showLeftPanel" with-handle />
|
|
219
|
+
<ResizablePanel ref="mainPanel" :default-size="mainPanelDefaultSize">
|
|
192
220
|
<div class="grow h-full flex flex-col h-screen">
|
|
193
221
|
<edge-menu
|
|
194
222
|
v-if="edgeFirebase.user.loggedIn"
|
|
@@ -207,7 +235,7 @@ const mainPanelDefaultSize = computed(() => {
|
|
|
207
235
|
</edge-shad-button>
|
|
208
236
|
</template>
|
|
209
237
|
</edge-menu>
|
|
210
|
-
<
|
|
238
|
+
<NuxtPage class="flex-1 flex flex-col overflow-y-auto p-3 pt-0" />
|
|
211
239
|
</div>
|
|
212
240
|
</ResizablePanel>
|
|
213
241
|
</ResizablePanelGroup>
|
|
@@ -218,7 +246,11 @@ const mainPanelDefaultSize = computed(() => {
|
|
|
218
246
|
|
|
219
247
|
<style lang="scss">
|
|
220
248
|
.firebase-emulator-warning { display: none; }
|
|
221
|
-
html
|
|
222
|
-
|
|
249
|
+
html {
|
|
250
|
+
scrollbar-width: none;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
html::-webkit-scrollbar {
|
|
254
|
+
display: none;
|
|
223
255
|
}
|
|
224
256
|
</style>
|
package/tsconfig.json
CHANGED