@edgedev/create-edge-app 1.1.27 → 1.1.29

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.
Files changed (35) hide show
  1. package/edge/components/auth/register.vue +51 -0
  2. package/edge/components/cms/block.vue +363 -42
  3. package/edge/components/cms/blockEditor.vue +50 -3
  4. package/edge/components/cms/codeEditor.vue +39 -2
  5. package/edge/components/cms/htmlContent.vue +10 -2
  6. package/edge/components/cms/init_blocks/footer.html +111 -19
  7. package/edge/components/cms/init_blocks/image.html +8 -0
  8. package/edge/components/cms/init_blocks/post_content.html +3 -2
  9. package/edge/components/cms/init_blocks/post_title_header.html +8 -6
  10. package/edge/components/cms/init_blocks/posts_list.html +6 -5
  11. package/edge/components/cms/mediaCard.vue +13 -2
  12. package/edge/components/cms/mediaManager.vue +35 -5
  13. package/edge/components/cms/menu.vue +384 -61
  14. package/edge/components/cms/optionsSelect.vue +20 -3
  15. package/edge/components/cms/page.vue +160 -18
  16. package/edge/components/cms/site.vue +548 -374
  17. package/edge/components/cms/siteSettingsForm.vue +623 -0
  18. package/edge/components/cms/themeDefaultMenu.vue +258 -22
  19. package/edge/components/cms/themeEditor.vue +95 -11
  20. package/edge/components/editor.vue +1 -0
  21. package/edge/components/formSubtypes/myOrgs.vue +112 -1
  22. package/edge/components/imagePicker.vue +126 -0
  23. package/edge/components/myAccount.vue +1 -0
  24. package/edge/components/myProfile.vue +345 -61
  25. package/edge/components/orgSwitcher.vue +1 -1
  26. package/edge/components/organizationMembers.vue +620 -235
  27. package/edge/components/shad/html.vue +6 -0
  28. package/edge/components/shad/number.vue +2 -2
  29. package/edge/components/sideBar.vue +7 -4
  30. package/edge/components/sideBarContent.vue +1 -1
  31. package/edge/components/userMenu.vue +50 -14
  32. package/edge/composables/global.ts +4 -1
  33. package/edge/composables/siteSettingsTemplate.js +79 -0
  34. package/edge/composables/structuredDataTemplates.js +36 -0
  35. package/package.json +1 -1
@@ -56,12 +56,34 @@ const props = defineProps({
56
56
  type: String,
57
57
  default: '',
58
58
  },
59
+ validateJson: {
60
+ type: Boolean,
61
+ default: false,
62
+ },
59
63
  })
60
64
 
61
65
  const emit = defineEmits(['update:modelValue', 'lineClick'])
62
66
  const localModelValue = ref(null)
63
67
  const edgeFirebase = inject('edgeFirebase')
64
68
  const expectsJsonObject = ref(false)
69
+ const jsonValidationError = computed(() => {
70
+ if (!props.validateJson || props.language !== 'json')
71
+ return ''
72
+ const raw = localModelValue.value
73
+ if (raw === null || raw === undefined)
74
+ return ''
75
+ const text = String(raw).trim()
76
+ if (!text)
77
+ return ''
78
+ try {
79
+ JSON.parse(text)
80
+ return ''
81
+ }
82
+ catch (error) {
83
+ return `Invalid JSON: ${error.message}`
84
+ }
85
+ })
86
+ const displayError = computed(() => props.error || jsonValidationError.value)
65
87
 
66
88
  const editorOptions = {
67
89
  mode: 'htmlmixed',
@@ -166,6 +188,12 @@ const redo = () => {
166
188
 
167
189
  const editorCompRef = ref(null)
168
190
  const editorInstanceRef = shallowRef(null)
191
+ let editorDomNode = null
192
+
193
+ const stopEnterPropagation = (event) => {
194
+ if (event.key === 'Enter')
195
+ event.stopPropagation()
196
+ }
169
197
 
170
198
  const setCursor = () => {
171
199
  const editor = editorInstanceRef.value
@@ -226,6 +254,9 @@ const runChatGpt = async () => {
226
254
  const handleMount = (editor) => {
227
255
  editorInstanceRef.value = editor
228
256
  editorInstanceRef.value?.getAction('editor.action.formatDocument').run()
257
+ editorDomNode = editor.getDomNode?.()
258
+ if (editorDomNode)
259
+ editorDomNode.addEventListener('keydown', stopEnterPropagation)
229
260
  editor.onMouseDown((event) => {
230
261
  const position = event?.target?.position
231
262
  const model = editor.getModel?.()
@@ -314,6 +345,12 @@ const getChanges = () => {
314
345
  formatCode()
315
346
  }
316
347
  }
348
+
349
+ onBeforeUnmount(() => {
350
+ if (editorDomNode)
351
+ editorDomNode.removeEventListener('keydown', stopEnterPropagation)
352
+ editorDomNode = null
353
+ })
317
354
  </script>
318
355
 
319
356
  <template>
@@ -364,11 +401,11 @@ const getChanges = () => {
364
401
  </template>
365
402
  <template #center>
366
403
  <div class="w-full px-2">
367
- <Alert v-if="props.error" variant="destructive" class="rounded-[6px] py-1">
404
+ <Alert v-if="displayError" variant="destructive" class="rounded-[6px] py-1">
368
405
  <TriangleAlert class="h-4 w-4" />
369
406
  <AlertTitle>Error</AlertTitle>
370
407
  <AlertDescription>
371
- {{ props.error }}
408
+ {{ displayError }}
372
409
  </AlertDescription>
373
410
  </Alert>
374
411
  </div>
@@ -699,10 +699,18 @@ function rewriteAllClasses(scopeEl, theme, isolated = true, viewportMode = 'auto
699
699
  scopeEl.querySelectorAll('[class]').forEach((el) => {
700
700
  let base = el.dataset.viewportBaseClass
701
701
  if (typeof base !== 'string') {
702
- base = el.className || ''
702
+ if (typeof el.className === 'string') {
703
+ base = el.className
704
+ }
705
+ else if (el.className && typeof el.className.baseVal === 'string') {
706
+ base = el.className.baseVal
707
+ }
708
+ else {
709
+ base = el.getAttribute('class') || ''
710
+ }
703
711
  el.dataset.viewportBaseClass = base
704
712
  }
705
- const orig = base || ''
713
+ const orig = typeof base === 'string' ? base : String(base || '')
706
714
  if (!orig.trim())
707
715
  return
708
716
  const origTokens = orig.split(/\s+/).filter(Boolean)
@@ -1,24 +1,116 @@
1
- <footer id="global-footer" class="bg-neutral-900 text-white">
2
- <div class="mx-auto max-w-7xl px-6 py-12"> <!-- Top: Brand / Map / Contact -->
3
- <div class="grid gap-10 md:grid-cols-3"> <!-- Brand / Title -->
4
- <div class="text-center md:text-left">
5
- <h6 class="text-lg font-semibold tracking-wide">{{{#text {"field":"name","value":""}}}}</h6>
6
- <p class="mt-2 whitespace-pre-line text-sm text-neutral-300"> {{{#text {"field":"title","value":""}}}} </p>
7
- </div> <!-- Map -->
8
- <div> </div> <!-- Contact -->
9
- <div class="text-center md:text-left">
10
- <h6 class="text-lg font-semibold tracking-wide">Contact Us</h6>
11
- <div class="mt-2 space-y-2 text-sm">
12
- <p> Phone: <a class="font-normal hover:opacity-90 underline underline-offset-4" href="tel:2025502730"
13
- aria-label="Call (202) 550-2730"> {{{#text {"field":"phone","value":""}}}} </a> </p>
14
- <p> Office: <a class="font-normal hover:opacity-90 underline underline-offset-4" href="tel:6154755616"
15
- aria-label="Call (615) 475-5616"> {{{#text {"field":"officeNumber","value":""}}}} </a> </p>
16
- <div>
17
- <div class="text-neutral-300">{{{#text {"field":"streetAddress","value":""}}}}</div>
18
- <div class="text-neutral-300">{{{#text {"field":"city","value":"","title":"City, State & Zip"}}}}</div>
19
- </div>
1
+ <footer id="global-footer" class="bg-footerBg text-white h-[344px] overflow-hidden">
2
+ <div class="mx-auto px-1 sm:px-[100px] py-12 h-full w-full"> <!-- Top: Brand / Map / Contact -->
3
+ <div class="grid gap-10 md:grid-cols-2 h-full w-full">
4
+ {{{#array {"field":"agent","schema":[{"field":"contactEmail","value":"text"}],"collection":{"path":"users","uniqueKey":"{orgId}"},"queryOptions":[{"field":"userId","title":"Agent","optionsKey":"name","optionsValue":"userId","options":"users"}],"limit":1,"value":[]}}}}
5
+ <div class="text-center md:text-left relative h-full">
6
+ <div class="flex justify-center md:justify-start gap-4 mb-8">
7
+ <img
8
+ src="{{{#image {"field":"logo","value":"","tags":["Logos"]}}}}"
9
+ class="h-10 object-contain"
10
+ />
11
+ <span class="h-10 w-px bg-white opacity-80"></span>
12
+ <img
13
+ src="{{{#image {"field":"brandLogo","value":"","tags":["Logos"]}}}}"
14
+ class="h-8 object-contain"
15
+ />
20
16
  </div>
17
+ Phone: {{item.contactPhone}} <br />
18
+ Email: {{item.contactEmail}}
19
+ <img src="https://imagedelivery.net/h7EjKG0X9kOxmLp41mxOng/clearwater-hub-nSyJmnm6i2xLMPQ1PCX2-images-JyO9Jv7e5H6TghMPhq8W-watermark.png/public" class="absolute -bottom-14 -left-26" />
21
20
  </div>
21
+ <div class="flex w-full justify-center md:justify-right gap-1">
22
+ {{{#if {"cond":"item.socialFacebook"}}}}
23
+ <a
24
+ href="{{ item.socialFacebook }}"
25
+ target="_blank"
26
+ class="flex h-8 w-8 items-center justify-center bg-white rounded-full"
27
+ >
28
+ <svg
29
+ xmlns="http://www.w3.org/2000/svg"
30
+ viewBox="0 0 320 512"
31
+ class="h-4 w-4"
32
+ >
33
+ <path d="M80 299.3V512H196V299.3h86.5l18-97.8H196V166.9c0-51.7 20.3-71.5 72.7-71.5c16.3 0 29.4 .4 37 1.2V7.9C291.4 4 256.4 0 236.2 0C129.3 0 80 50.5 80 159.4v42.1H14v97.8H80z"/>
34
+ </svg>
35
+ </a>
36
+ {{{/if}}}
37
+ {{{#if {"cond":"item.socialInstagram"}}}}
38
+ <a
39
+ href="{{ item.socialInstagram }}"
40
+ target="_blank"
41
+ class="flex h-8 w-8 items-center justify-center bg-white rounded-full"
42
+ >
43
+ <svg
44
+ xmlns="http://www.w3.org/2000/svg"
45
+ viewBox="0 0 448 512"
46
+ class="h-4 w-4"
47
+ >
48
+ <path d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"/>
49
+ </svg>
50
+ </a>
51
+ {{{/if}}}
52
+ {{{#if {"cond":"item.socialTwitter"}}}}
53
+ <a
54
+ href="{{ item.socialTwitter }}"
55
+ target="_blank"
56
+ class="flex h-8 w-8 items-center justify-center bg-white rounded-full"
57
+ >
58
+ <svg
59
+ xmlns="http://www.w3.org/2000/svg"
60
+ viewBox="0 0 300 400"
61
+ class="h-5 w-5"
62
+ >
63
+ <path d="M279.14 288l14.22-16.53L319.08 240h-72.7l-39.5-46.2 93.9-109.2h-74.3l-59.4 69.1-54.5-69.1H0l99.8 116.3L0 320h74.3l64.3-74.8L198.5 320h120.7l-40.1-32zM164.6 213.6l-10.5-12.6-83.7-100.4h33.8l67.6 81.2 10.5 12.6 87.8 105.5h-33.8l-71.7-86.1z"/>
64
+ </svg>
65
+ </a>
66
+ {{{/if}}}
67
+ {{{#if {"cond":"item.socialLinkedIn"}}}}
68
+ <a
69
+ href="{{ item.socialLinkedIn }}"
70
+ target="_blank"
71
+ class="flex h-8 w-8 items-center justify-center bg-white rounded-full"
72
+ >
73
+ <svg
74
+ xmlns="http://www.w3.org/2000/svg"
75
+ viewBox="0 0 448 512"
76
+ class="h-4 w-4"
77
+ >
78
+ <path d="M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z"/>
79
+ </svg>
80
+ </a>
81
+ {{{/if}}}
82
+ {{{#if {"cond":"item.socialYouTube"}}}}
83
+ <a
84
+ href="{{ item.socialYouTube }}"
85
+ target="_blank"
86
+ class="flex h-8 w-8 items-center justify-center bg-white rounded-full"
87
+ >
88
+ <svg
89
+ xmlns="http://www.w3.org/2000/svg"
90
+ viewBox="0 0 576 512"
91
+ class="h-4 w-4"
92
+ >
93
+ <path d="M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"/>
94
+ </svg>
95
+ </a>
96
+ {{{/if}}}
97
+ {{{#if {"cond":"item.socialTikTok"}}}}
98
+ <a
99
+ href="{{ item.socialTikTok }}"
100
+ target="_blank"
101
+ class="flex h-8 w-8 items-center justify-center bg-white rounded-full"
102
+ >
103
+ <svg
104
+ xmlns="http://www.w3.org/2000/svg"
105
+ viewBox="0 0 448 512"
106
+ class="h-4 w-4"
107
+ >
108
+ <path d="M448,209.91a210.06,210.06,0,0,1-122.77-39.25V349.38A162.55,162.55,0,1,1,185,188.31V278.2a74.62,74.62,0,1,0,52.23,71.18V0l88,0a121.18,121.18,0,0,0,1.86,22.17h0A122.18,122.18,0,0,0,381,102.39a121.43,121.43,0,0,0,67,20.14Z"/>
109
+ </svg>
110
+ </a>
111
+ {{{/if}}}
112
+ </div>
113
+ {{{/array}}}
22
114
  </div>
23
115
  </div>
24
116
  </footer>
@@ -0,0 +1,8 @@
1
+ <div class="w-full md:1/2 p-4">
2
+ <img
3
+ src="{{{#image {"field":"backgroundImage","value":"https://imagedelivery.net/h7EjKG0X9kOxmLp41mxOng/clearwater-hub-nSyJmnm6i2xLMPQ1PCX2-images-EdDjIxZYYcqeGMqk1ZDt-AdobeStock_New_Second.jpg/public"}}}}"
4
+ loading="lazy"
5
+ class="w-full h-auto"
6
+ alt="{{{#text {"field":"altTag","validation":{"required":true,"min":1},"value":""}}}}"
7
+ />
8
+ </div>
@@ -1,7 +1,8 @@
1
1
  <div class="pa-8 bg-white font-sans">
2
- {{{#array {"field":"list","schema":[{"field":"name","value":"text"},{"field":"content","value":"richtext"}],"collection":{"path":"post","query":[{"field":"doc_created_at","operator":">","value":0}],"order":[{"field":"doc_created_at","direction":"desc"}]},"queryOptions":[],"limit":1,"value":[]}}}}
2
+ {{{#array
3
+ {"field":"list","schema":[{"field":"name","value":"text"},{"field":"content","value":"richtext"}],"collection":{"path":"posts","uniqueKey":"{orgId}:{siteId}","query":[],"order":[]},"queryOptions":[],"limit":1,"value":[]}}}}
3
4
  <h1 class="text-sm">
4
5
  {{item.content}}
5
6
  </h1>
6
- {{{/array}}}
7
+ {{{/array}}}
7
8
  </div>
@@ -1,8 +1,9 @@
1
- {{{#array {"field":"list","schema":[{"field":"name","value":"text"}],"collection":{"path":"post","query":[{"field":"doc_created_at","operator":">","value":0}],"order":[{"field":"doc_created_at","direction":"desc"}]},"queryOptions":[],"limit":1,"value":[]}}}}
2
- <section
3
- class="relative h-[50dvh] min-h-[260px] w-full bg-cover bg-center"
4
- style="background-image: url('{{item.featuredImage}}')"
5
- >
1
+ <div class="relative h-[20dvh] md:h-[30dvh] w-full bg-cover bg-center {{{#text {"
2
+ field":"backgroundColor","option":{"optionsKey":"title","optionsValue":"value","options":[{"title":"Brand","value":"bg-brand"},{"title":"Primary","value":"bg-primary"},{"title":"Secondary","value":"bg-secondary"},{"title":"White","value":"bg-white"},{"title":"Transparent","value":"bg-transparent"}]},"value":"bg-primary"}}}}">
3
+ {{{#array
4
+ {"field":"list","schema":[{"field":"name","value":"text"}],"collection":{"path":"posts","uniqueKey":"{orgId}:{siteId}","query":[],"order":[]},"queryOptions":[],"limit":1,"value":[]}}}}
5
+ <section class="relativeh-[20dvh] md:h-[30dvh] w-full bg-cover bg-center"
6
+ style="background-image: url('{{item.featuredImage}}')">
6
7
  <!-- Dark overlay -->
7
8
  <div class="absolute inset-0 bg-black/40"></div>
8
9
 
@@ -18,4 +19,5 @@
18
19
  <!-- Optional vignette -->
19
20
  <div class="pointer-events-none absolute inset-0 bg-gradient-to-b from-black/20 via-transparent to-black/30"></div>
20
21
  </section>
21
- {{{/array}}}
22
+ {{{/array}}}
23
+ </div>
@@ -1,20 +1,21 @@
1
1
  <div class="p-8 bg-gray-50 font-sans">
2
2
  <div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
3
- {{{#array {"field":"list","schema":[{"field":"name","value":"text"},{"field":"content","value":"richtext"}],"collection":{"path":"posts","query":[{"field":"doc_created_at","operator":">","value":0}],"order":[{"field":"doc_created_at","direction":"desc"}]},"queryOptions":[{"field":"tags","operator":"array-contains-any","options":[]}],"limit":10,"value":[]}}}}
4
-
5
- <div class="bg-white rounded-2xl shadow-sm hover:shadow-md transition-shadow duration-200 overflow-hidden flex flex-col">
3
+ {{{#array
4
+ {"field":"list","schema":[{"field":"name","value":"text"},{"field":"content","value":"richtext"}],"collection":{"path":"posts","uniqueKey":"{orgId}:{siteId}","query":[{"field":"doc_created_at","operator":">","value":0}],"order":[{"field":"doc_created_at","direction":"desc"}]},"queryOptions":[{"field":"tags","operator":"array-contains-any","options":[]}],"limit":10,"value":[]}}}}
5
+ <div
6
+ class="bg-white rounded-2xl shadow-sm hover:shadow-md transition-shadow duration-200 overflow-hidden flex flex-col">
6
7
  <img src="{{item.featuredImage}}" alt="{{item.title}}" class="h-48 w-full object-cover" />
7
8
  <div class="p-5 flex flex-col flex-1">
8
9
  <h2 class="text-lg font-semibold text-gray-800 mb-2 line-clamp-2">{{ item.title }}</h2>
9
10
  <div class="text-gray-600 text-sm flex-1 mb-4 line-clamp-3">
10
11
  {{ item.blurb }}
11
12
  </div>
12
- <a href="/posts/{{item.name}}" class="inline-block mt-auto self-start text-sm font-medium text-blue-600 hover:text-blue-800 transition-colors duration-150">
13
+ <a href="{{item.name}}"
14
+ class="inline-block mt-auto self-start text-sm font-medium text-blue-600 hover:text-blue-800 transition-colors duration-150">
13
15
  Read More →
14
16
  </a>
15
17
  </div>
16
18
  </div>
17
-
18
19
  {{{/array}}}
19
20
  </div>
20
21
  </div>
@@ -55,13 +55,24 @@ const timeAgo = (timestamp) => {
55
55
  return `${minutes} minute${minutes > 1 ? 's' : ''} ago`
56
56
  return `${seconds} second${seconds > 1 ? 's' : ''} ago`
57
57
  }
58
+
59
+ const isLightName = (name) => {
60
+ if (!name)
61
+ return false
62
+ return String(name).toLowerCase().includes('light')
63
+ }
64
+
65
+ const previewBackgroundClass = computed(() => {
66
+ const displayName = props.item?.name
67
+ return isLightName(displayName) ? 'bg-neutral-900/90' : 'bg-neutral-100'
68
+ })
58
69
  </script>
59
70
 
60
71
  <template>
61
72
  <Card
62
73
  class="w-full group overflow-hidden rounded-2xl border bg-card hover:shadow-md hover:border-muted-foreground/20 transition-all"
63
74
  >
64
- <div class="relative w-full h-[200px] bg-muted">
75
+ <div class="relative w-full h-[200px] flex items-center justify-center" :class="previewBackgroundClass">
65
76
  <div class="z-10 absolute w-full flex inset-0 bg-black/10 dark:bg-black/30 justify-between items-start p-2">
66
77
  <edge-shad-button
67
78
  v-if="!props.selectMode"
@@ -90,7 +101,7 @@ const timeAgo = (timestamp) => {
90
101
  v-else
91
102
  :src="edgeGlobal.getImage(item, 'thumbnail')"
92
103
  alt=""
93
- class="absolute inset-0 h-full w-full object-cover transition-transform duration-200 group-hover:scale-[1.02]"
104
+ class="max-h-full max-w-full h-auto w-auto object-contain transition-transform duration-200 group-hover:scale-[1.02]"
94
105
  >
95
106
  </div>
96
107
 
@@ -8,6 +8,11 @@ const props = defineProps({
8
8
  required: false,
9
9
  default: 'all',
10
10
  },
11
+ includeCmsAll: {
12
+ type: Boolean,
13
+ required: false,
14
+ default: true,
15
+ },
11
16
  selectMode: {
12
17
  type: Boolean,
13
18
  required: false,
@@ -137,6 +142,7 @@ onBeforeMount(() => {
137
142
  console.log('Default tags prop:', props.defaultTags)
138
143
  if (props.defaultTags && Array.isArray(props.defaultTags) && props.defaultTags.length > 0) {
139
144
  state.filterTags = [...props.defaultTags]
145
+ state.tags = [...props.defaultTags]
140
146
  }
141
147
  })
142
148
 
@@ -158,6 +164,20 @@ const itemClick = (item) => {
158
164
  state.workingDoc = item
159
165
  }
160
166
  }
167
+
168
+ const isLightName = (name) => {
169
+ if (!name)
170
+ return false
171
+ return String(name).toLowerCase().includes('light')
172
+ }
173
+
174
+ const previewBackgroundClass = computed(() => (isLightName(state.workingDoc?.name) ? 'bg-neutral-900/90' : 'bg-neutral-100'))
175
+
176
+ const siteQueryValue = computed(() => {
177
+ if (!props.site)
178
+ return []
179
+ return props.includeCmsAll ? ['all', props.site] : [props.site]
180
+ })
161
181
  </script>
162
182
 
163
183
  <template>
@@ -220,8 +240,12 @@ const itemClick = (item) => {
220
240
  v-if="state.tags.length === 0"
221
241
  class="pointer-events-auto absolute inset-0 z-20 rounded-[20px] border border-dashed border-border/70 bg-background/85 dark:bg-background/80 backdrop-blur-sm flex flex-col items-center justify-center text-center px-6 text-foreground"
222
242
  >
223
- <div class="text-lg font-semibold">Tags are required</div>
224
- <div class="text-sm text-muted-foreground">Add tags above to enable upload</div>
243
+ <div class="text-lg font-semibold">
244
+ Tags are required
245
+ </div>
246
+ <div class="text-sm text-muted-foreground">
247
+ Add tags above to enable upload
248
+ </div>
225
249
  </div>
226
250
  </div>
227
251
  </SheetContent>
@@ -231,7 +255,7 @@ const itemClick = (item) => {
231
255
  sort-field="uploadTime"
232
256
  query-field="meta.cmssite"
233
257
  :filters="filters"
234
- :query-value="['all', props.site]"
258
+ :query-value="siteQueryValue"
235
259
  query-operator="array-contains-any"
236
260
  header-class=""
237
261
  sort-direction="desc" class="w-full flex-1 border-none shadow-none bg-background"
@@ -305,7 +329,7 @@ const itemClick = (item) => {
305
329
  </div>
306
330
  </template>
307
331
  <template #list="slotProps">
308
- <div class=" mx-auto px-0 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
332
+ <div class="mx-auto px-0 grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
309
333
  <div v-for="item in slotProps.filtered" :key="item.docId" class="w-full cursor-pointer" @click="itemClick(item)">
310
334
  <edge-cms-media-card
311
335
  :item="item"
@@ -325,7 +349,13 @@ const itemClick = (item) => {
325
349
  <SheetHeader>
326
350
  <SheetTitle>{{ state.workingDoc?.fileName }}</SheetTitle>
327
351
  <SheetDescription>
328
- <img :src="edgeGlobal.getImage(state.workingDoc, 'public')" alt="" class="h-[450px] m-auto object-fit rounded-lg mb-4">
352
+ <div class="h-[450px] rounded-lg mb-4 flex items-center justify-center overflow-hidden" :class="previewBackgroundClass">
353
+ <img
354
+ :src="edgeGlobal.getImage(state.workingDoc, 'public')"
355
+ alt=""
356
+ class="max-h-full max-w-full h-auto w-auto object-contain"
357
+ >
358
+ </div>
329
359
  Original Name: <span class="font-semibold">{{ state.workingDoc?.fileName }}</span>, Size: <span class="font-semibold">{{ (state.workingDoc?.fileSize / 1024).toFixed(2) }} KB</span>
330
360
  </SheetDescription>
331
361
  </SheetHeader>