@edgedev/create-edge-app 1.2.33 → 1.2.35
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/README.md +1 -0
- package/agents.md +95 -2
- package/deploy.sh +136 -0
- package/edge/components/cms/block.vue +977 -305
- package/edge/components/cms/blockApi.vue +3 -3
- package/edge/components/cms/blockEditor.vue +688 -86
- package/edge/components/cms/blockPicker.vue +31 -5
- package/edge/components/cms/blockRender.vue +3 -3
- package/edge/components/cms/blocksManager.vue +790 -82
- package/edge/components/cms/codeEditor.vue +15 -6
- package/edge/components/cms/fontUpload.vue +318 -2
- package/edge/components/cms/htmlContent.vue +825 -93
- package/edge/components/cms/init_blocks/contact_us.html +55 -47
- package/edge/components/cms/init_blocks/newsletter.html +56 -96
- package/edge/components/cms/menu.vue +96 -34
- package/edge/components/cms/page.vue +902 -58
- package/edge/components/cms/posts.vue +13 -4
- package/edge/components/cms/site.vue +638 -87
- package/edge/components/cms/siteSettingsForm.vue +19 -9
- package/edge/components/cms/sitesManager.vue +5 -4
- package/edge/components/cms/themeDefaultMenu.vue +20 -2
- package/edge/components/cms/themeEditor.vue +196 -162
- package/edge/components/editor.vue +5 -1
- package/edge/composables/global.ts +37 -5
- package/edge/composables/siteSettingsTemplate.js +2 -0
- package/edge/composables/useCmsNewDocs.js +100 -0
- package/edge/composables/useEdgeCmsDialogPositionFix.js +19 -0
- package/edge/routes/cms/dashboard/blocks/[block].vue +5 -0
- package/edge/routes/cms/dashboard/blocks/index.vue +12 -1
- package/edge/routes/cms/dashboard/media/index.vue +5 -0
- package/edge/routes/cms/dashboard/sites/[site]/[[page]].vue +4 -0
- package/edge/routes/cms/dashboard/sites/[site].vue +4 -0
- package/edge/routes/cms/dashboard/sites/index.vue +4 -0
- package/edge/routes/cms/dashboard/templates/[page].vue +4 -0
- package/edge/routes/cms/dashboard/templates/index.vue +4 -0
- package/edge/routes/cms/dashboard/themes/[theme].vue +5 -0
- package/edge/routes/cms/dashboard/themes/index.vue +330 -1
- package/edge-pull.sh +16 -2
- package/edge-push.sh +9 -1
- package/edge-remote.sh +20 -0
- package/edge-status.sh +9 -5
- package/edge-update-all.sh +127 -0
- package/firebase.json +4 -0
- package/nuxt.config.ts +1 -1
- package/package.json +2 -2
|
@@ -439,22 +439,54 @@ const allowMenuItem = (item: any, isAdmin: boolean) => {
|
|
|
439
439
|
return true
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
+
const resolveCmsCollectionTokens = (input: any, currentSite: any = '') => {
|
|
443
|
+
const orgId = String(edgeState.currentOrganization || '')
|
|
444
|
+
const siteId = String(currentSite || '')
|
|
445
|
+
|
|
446
|
+
const replaceTokens = (raw: string) => {
|
|
447
|
+
let resolved = raw
|
|
448
|
+
if (orgId && resolved.includes('{orgId}'))
|
|
449
|
+
resolved = resolved.replaceAll('{orgId}', orgId)
|
|
450
|
+
if (siteId && resolved.includes('{siteId}'))
|
|
451
|
+
resolved = resolved.replaceAll('{siteId}', siteId)
|
|
452
|
+
return resolved
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
const walk = (value: any): any => {
|
|
456
|
+
if (typeof value === 'string')
|
|
457
|
+
return replaceTokens(value)
|
|
458
|
+
if (Array.isArray(value))
|
|
459
|
+
return value.map(item => walk(item))
|
|
460
|
+
if (value && typeof value === 'object') {
|
|
461
|
+
const out: Record<string, any> = {}
|
|
462
|
+
for (const [key, child] of Object.entries(value))
|
|
463
|
+
out[key] = walk(child)
|
|
464
|
+
return out
|
|
465
|
+
}
|
|
466
|
+
return value
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
return walk(input)
|
|
470
|
+
}
|
|
471
|
+
|
|
442
472
|
const cmsCollectionData = async (edgeFirebase: any, value: any, meta: any, currentSite: any = '') => {
|
|
443
473
|
for (const key in meta) {
|
|
444
474
|
if (meta[key]?.collection) {
|
|
445
475
|
const staticSearch = new edgeFirebase.SearchStaticData()
|
|
446
476
|
|
|
447
|
-
const currentQuery = meta[key].collection.query
|
|
477
|
+
const currentQuery = Array.isArray(meta[key].collection.query)
|
|
478
|
+
? resolveCmsCollectionTokens(dupObject(meta[key].collection.query), currentSite)
|
|
479
|
+
: []
|
|
448
480
|
for (const queryKey in meta[key].queryItems || {}) {
|
|
449
481
|
console.log('key', queryKey)
|
|
450
482
|
if (meta[key].queryItems[queryKey]) {
|
|
451
483
|
const findIndex = currentQuery.findIndex((q: any) => q.field === queryKey)
|
|
452
484
|
const queryOption = meta[key]?.queryOptions?.find((o: any) => o.field === queryKey)
|
|
453
485
|
const operator = queryOption?.operator || '=='
|
|
454
|
-
let
|
|
455
|
-
if (operator === 'array-contains-any' && !Array.isArray(
|
|
456
|
-
|
|
457
|
-
const newQuery = { field: queryKey, operator, value }
|
|
486
|
+
let queryValue = resolveCmsCollectionTokens(meta[key].queryItems[queryKey], currentSite)
|
|
487
|
+
if (operator === 'array-contains-any' && !Array.isArray(queryValue))
|
|
488
|
+
queryValue = [queryValue]
|
|
489
|
+
const newQuery = { field: queryKey, operator, value: queryValue }
|
|
458
490
|
if (findIndex > -1) {
|
|
459
491
|
currentQuery[findIndex] = newQuery
|
|
460
492
|
}
|
|
@@ -24,6 +24,7 @@ export const useSiteSettingsTemplate = () => {
|
|
|
24
24
|
trackingFacebookPixel: '',
|
|
25
25
|
trackingGoogleAnalytics: '',
|
|
26
26
|
trackingAdroll: '',
|
|
27
|
+
sureFeedURL: '',
|
|
27
28
|
socialFacebook: '',
|
|
28
29
|
socialInstagram: '',
|
|
29
30
|
socialTwitter: '',
|
|
@@ -59,6 +60,7 @@ export const useSiteSettingsTemplate = () => {
|
|
|
59
60
|
trackingFacebookPixel: { bindings: { 'field-type': 'text', 'label': 'Facebook Pixel ID' }, cols: '12', value: defaults.trackingFacebookPixel },
|
|
60
61
|
trackingGoogleAnalytics: { bindings: { 'field-type': 'text', 'label': 'Google Analytics ID' }, cols: '12', value: defaults.trackingGoogleAnalytics },
|
|
61
62
|
trackingAdroll: { bindings: { 'field-type': 'text', 'label': 'AdRoll ID' }, cols: '12', value: defaults.trackingAdroll },
|
|
63
|
+
sureFeedURL: { bindings: { 'field-type': 'text', 'label': 'Sure Feedback' }, cols: '12', value: defaults.sureFeedURL },
|
|
62
64
|
socialFacebook: { bindings: { 'field-type': 'text', 'label': 'Facebook URL' }, cols: '12', value: defaults.socialFacebook },
|
|
63
65
|
socialInstagram: { bindings: { 'field-type': 'text', 'label': 'Instagram URL' }, cols: '12', value: defaults.socialInstagram },
|
|
64
66
|
socialTwitter: { bindings: { 'field-type': 'text', 'label': 'X (Twitter) URL' }, cols: '12', value: defaults.socialTwitter },
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
export const useCmsNewDocs = () => {
|
|
2
|
+
const { createDefaults: createSiteSettingsDefaults } = useSiteSettingsTemplate()
|
|
3
|
+
|
|
4
|
+
const blocks = useState('edge-cms-new-docs-blocks', () => ({
|
|
5
|
+
name: { value: '' },
|
|
6
|
+
content: { value: '' },
|
|
7
|
+
tags: { value: [] },
|
|
8
|
+
themes: { value: [] },
|
|
9
|
+
previewType: { value: 'light' },
|
|
10
|
+
synced: { value: false },
|
|
11
|
+
version: 1,
|
|
12
|
+
}))
|
|
13
|
+
|
|
14
|
+
const themes = useState('edge-cms-new-docs-themes', () => ({
|
|
15
|
+
name: { value: '' },
|
|
16
|
+
headJSON: {
|
|
17
|
+
value: `{
|
|
18
|
+
"link": [
|
|
19
|
+
{
|
|
20
|
+
"rel": "preconnect",
|
|
21
|
+
"href": "https://fonts.googleapis.com"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"rel": "preconnect",
|
|
25
|
+
"href": "https://fonts.gstatic.com",
|
|
26
|
+
"crossorigin": ""
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"rel": "stylesheet",
|
|
30
|
+
"href": "https://fonts.googleapis.com/css2?family=Overpass:wght@400;700&family=Kode+Mono:wght@400;700&display=swap"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}`,
|
|
34
|
+
},
|
|
35
|
+
theme: {
|
|
36
|
+
value: `{
|
|
37
|
+
"extend": {
|
|
38
|
+
"colors": {
|
|
39
|
+
"brand": "#3B82F6",
|
|
40
|
+
"accent": "#F59E0B",
|
|
41
|
+
"surface": "#FAFAFA",
|
|
42
|
+
"subtle": "#F3F4F6",
|
|
43
|
+
"text": "#1F2937",
|
|
44
|
+
"muted": "#9CA3AF",
|
|
45
|
+
"success": "#22C55E",
|
|
46
|
+
"danger": "#EF4444",
|
|
47
|
+
"border": "#E5E7EB",
|
|
48
|
+
"ring": "#93C5FD",
|
|
49
|
+
"link": "#3B82F6",
|
|
50
|
+
"linkHover": "#1D4ED8",
|
|
51
|
+
"navBg": "#000000",
|
|
52
|
+
"navText": "#FFFFFF",
|
|
53
|
+
"navMuted": "#6B7280",
|
|
54
|
+
"navBorder": "",
|
|
55
|
+
"navActive": "#3B82F6",
|
|
56
|
+
"navHoverBg": "",
|
|
57
|
+
"navActiveBg": "",
|
|
58
|
+
"sideNavBg": "#FFFFFF",
|
|
59
|
+
"sideNavText": "#000000",
|
|
60
|
+
"sideNavActive": "#AFBD23"
|
|
61
|
+
},
|
|
62
|
+
"fontFamily": {
|
|
63
|
+
"sans": ["Overpass", "sans-serif"],
|
|
64
|
+
"serif": ["Kode Mono", "monospace"],
|
|
65
|
+
"mono": ["Overpass", "sans-serif"],
|
|
66
|
+
"brand": ["Kode Mono", "monospace"]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"apply": {},
|
|
70
|
+
"slots": {},
|
|
71
|
+
"variants": {
|
|
72
|
+
"light": {
|
|
73
|
+
"apply": {}
|
|
74
|
+
},
|
|
75
|
+
"dark": {
|
|
76
|
+
"apply": {},
|
|
77
|
+
"slots": {}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}`,
|
|
81
|
+
},
|
|
82
|
+
extraCSS: {
|
|
83
|
+
value: '',
|
|
84
|
+
},
|
|
85
|
+
version: 1,
|
|
86
|
+
defaultPages: { value: [] },
|
|
87
|
+
defaultMenus: {
|
|
88
|
+
value: {
|
|
89
|
+
'Site Root': [],
|
|
90
|
+
'Not In Menu': [],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
defaultSiteSettings: { value: createSiteSettingsDefaults() },
|
|
94
|
+
}))
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
blocks,
|
|
98
|
+
themes,
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useHead } from '#imports'
|
|
2
|
+
|
|
3
|
+
export const useEdgeCmsDialogPositionFix = () => {
|
|
4
|
+
useHead({
|
|
5
|
+
style: [
|
|
6
|
+
{
|
|
7
|
+
key: 'edge-cms-dialog-position-fix',
|
|
8
|
+
id: 'edge-cms-dialog-position-fix',
|
|
9
|
+
children: `
|
|
10
|
+
.fixed.left-1\\/2.top-1\\/2.-translate-x-1\\/2.-translate-y-1\\/2 {
|
|
11
|
+
translate: initial !important;
|
|
12
|
+
--un-translate-x: initial !important;
|
|
13
|
+
--un-translate-y: initial !important;
|
|
14
|
+
}
|
|
15
|
+
`,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
})
|
|
19
|
+
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useEdgeCmsDialogPositionFix } from '~/edge/composables/useEdgeCmsDialogPositionFix'
|
|
3
|
+
|
|
2
4
|
const route = useRoute()
|
|
3
5
|
const state = reactive({
|
|
4
6
|
mounted: false,
|
|
5
7
|
head: null,
|
|
6
8
|
})
|
|
9
|
+
|
|
10
|
+
useEdgeCmsDialogPositionFix()
|
|
11
|
+
|
|
7
12
|
definePageMeta({
|
|
8
13
|
middleware: 'auth',
|
|
9
14
|
})
|
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useEdgeCmsDialogPositionFix } from '~/edge/composables/useEdgeCmsDialogPositionFix'
|
|
3
|
+
|
|
2
4
|
const state = reactive({
|
|
3
5
|
mounted: false,
|
|
6
|
+
head: null,
|
|
4
7
|
})
|
|
5
8
|
|
|
9
|
+
useEdgeCmsDialogPositionFix()
|
|
10
|
+
|
|
6
11
|
definePageMeta({
|
|
7
12
|
middleware: 'auth',
|
|
8
13
|
})
|
|
9
14
|
|
|
15
|
+
useHead(() => (state.head || {}))
|
|
16
|
+
|
|
10
17
|
onMounted(() => {
|
|
11
18
|
state.mounted = true
|
|
12
19
|
})
|
|
20
|
+
|
|
21
|
+
const setHead = (newHead) => {
|
|
22
|
+
state.head = newHead
|
|
23
|
+
}
|
|
13
24
|
</script>
|
|
14
25
|
|
|
15
26
|
<template>
|
|
16
27
|
<div
|
|
17
28
|
v-if="edgeGlobal.edgeState.organizationDocPath && state.mounted"
|
|
18
29
|
>
|
|
19
|
-
<edge-cms-blocks-manager />
|
|
30
|
+
<edge-cms-blocks-manager @head="setHead" />
|
|
20
31
|
</div>
|
|
21
32
|
</template>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useEdgeCmsDialogPositionFix } from '~/edge/composables/useEdgeCmsDialogPositionFix'
|
|
3
|
+
|
|
2
4
|
const route = useRoute()
|
|
3
5
|
|
|
4
6
|
// const edgeGlobal = inject('edgeGlobal')
|
|
@@ -8,6 +10,8 @@ const state = reactive({
|
|
|
8
10
|
head: null,
|
|
9
11
|
})
|
|
10
12
|
|
|
13
|
+
useEdgeCmsDialogPositionFix()
|
|
14
|
+
|
|
11
15
|
const page = computed(() => {
|
|
12
16
|
if (route.params?.page) {
|
|
13
17
|
return route.params.page
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useEdgeCmsDialogPositionFix } from '~/edge/composables/useEdgeCmsDialogPositionFix'
|
|
3
|
+
|
|
2
4
|
const route = useRoute()
|
|
3
5
|
|
|
4
6
|
// const edgeGlobal = inject('edgeGlobal')
|
|
@@ -7,6 +9,8 @@ const state = reactive({
|
|
|
7
9
|
mounted: false,
|
|
8
10
|
})
|
|
9
11
|
|
|
12
|
+
useEdgeCmsDialogPositionFix()
|
|
13
|
+
|
|
10
14
|
const page = computed(() => {
|
|
11
15
|
if (route.params?.page) {
|
|
12
16
|
return route.params.page
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useEdgeCmsDialogPositionFix } from '~/edge/composables/useEdgeCmsDialogPositionFix'
|
|
3
|
+
|
|
2
4
|
const route = useRoute()
|
|
3
5
|
|
|
4
6
|
const state = reactive({
|
|
@@ -6,6 +8,8 @@ const state = reactive({
|
|
|
6
8
|
head: null,
|
|
7
9
|
})
|
|
8
10
|
|
|
11
|
+
useEdgeCmsDialogPositionFix()
|
|
12
|
+
|
|
9
13
|
const page = computed(() => {
|
|
10
14
|
if (route.params?.page) {
|
|
11
15
|
return route.params.page
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useEdgeCmsDialogPositionFix } from '~/edge/composables/useEdgeCmsDialogPositionFix'
|
|
3
|
+
|
|
2
4
|
const route = useRoute()
|
|
3
5
|
|
|
4
6
|
// const edgeGlobal = inject('edgeGlobal')
|
|
@@ -7,6 +9,8 @@ const state = reactive({
|
|
|
7
9
|
mounted: false,
|
|
8
10
|
})
|
|
9
11
|
|
|
12
|
+
useEdgeCmsDialogPositionFix()
|
|
13
|
+
|
|
10
14
|
const page = computed(() => {
|
|
11
15
|
if (route.params?.page) {
|
|
12
16
|
return route.params.page
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useEdgeCmsDialogPositionFix } from '~/edge/composables/useEdgeCmsDialogPositionFix'
|
|
3
|
+
|
|
2
4
|
const route = useRoute()
|
|
3
5
|
const state = reactive({
|
|
4
6
|
mounted: false,
|
|
5
7
|
})
|
|
8
|
+
|
|
9
|
+
useEdgeCmsDialogPositionFix()
|
|
10
|
+
|
|
6
11
|
definePageMeta({
|
|
7
12
|
middleware: 'auth',
|
|
8
13
|
head: null,
|