@mframework/ui 0.1.0-beta.2 → 0.1.0-beta.4

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 (234) hide show
  1. package/dist/module.d.mts +3 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +28 -6
  4. package/dist/runtime/assets/config/tailwind.conifg.js +37 -6
  5. package/dist/runtime/components/Gallery.d.vue.ts +0 -0
  6. package/{src → dist}/runtime/components/Gallery.vue +23 -33
  7. package/dist/runtime/components/Gallery.vue.d.ts +0 -0
  8. package/dist/runtime/composables/useMToast.d.ts +0 -5
  9. package/dist/runtime/composables/useMToast.js +9 -9
  10. package/dist/runtime/design/tokens.d.ts +0 -22
  11. package/dist/runtime/design/tokens.js +20 -20
  12. package/dist/runtime/plugins/builder.d.ts +0 -3
  13. package/dist/runtime/plugins/builder.js +328 -303
  14. package/dist/runtime/plugins/fontawesome.d.ts +0 -3
  15. package/dist/runtime/plugins/fontawesome.js +7 -7
  16. package/dist/runtime/plugins/formkit.d.ts +0 -3
  17. package/dist/runtime/plugins/formkit.js +5 -5
  18. package/dist/runtime/plugins/lightgallery.d.ts +0 -6
  19. package/dist/runtime/plugins/lightgallery.js +20 -14
  20. package/dist/runtime/plugins/motion.d.ts +0 -2
  21. package/dist/runtime/plugins/motion.js +3 -3
  22. package/dist/runtime/plugins/theme-switcher.d.ts +0 -2
  23. package/dist/runtime/plugins/theme-switcher.js +22 -25
  24. package/dist/runtime/plugins/theme.d.ts +0 -2
  25. package/dist/runtime/plugins/theme.js +46 -32
  26. package/dist/runtime/plugins/vuetify.d.ts +0 -3
  27. package/dist/runtime/plugins/vuetify.js +30 -30
  28. package/dist/runtime/search/client.d.ts +0 -2
  29. package/dist/runtime/search/client.js +12 -19
  30. package/dist/runtime/search/plugin.d.ts +0 -2
  31. package/dist/runtime/search/plugin.js +5 -5
  32. package/dist/runtime/styles/index.css +93 -0
  33. package/dist/runtime/styles/tailwind.css +1 -1
  34. package/package.json +3 -4
  35. package/dist/adapters/adapter-directus/src/types/ui.d.ts +0 -21
  36. package/dist/adapters/adapter-directus/src/types/ui.js +0 -1
  37. package/dist/module.d.ts +0 -6
  38. package/dist/module.js +0 -68
  39. package/dist/modules/ui/src/module.d.ts +0 -8
  40. package/dist/modules/ui/src/module.js +0 -75
  41. package/dist/modules/ui/src/runtime/composables/useMToast.d.ts +0 -5
  42. package/dist/modules/ui/src/runtime/composables/useMToast.js +0 -11
  43. package/dist/modules/ui/src/runtime/design/tokens.d.ts +0 -22
  44. package/dist/modules/ui/src/runtime/design/tokens.js +0 -22
  45. package/dist/modules/ui/src/runtime/plugins/builder.d.ts +0 -3
  46. package/dist/modules/ui/src/runtime/plugins/builder.js +0 -311
  47. package/dist/modules/ui/src/runtime/plugins/fontawesome.d.ts +0 -3
  48. package/dist/modules/ui/src/runtime/plugins/fontawesome.js +0 -9
  49. package/dist/modules/ui/src/runtime/plugins/formkit.d.ts +0 -3
  50. package/dist/modules/ui/src/runtime/plugins/formkit.js +0 -8
  51. package/dist/modules/ui/src/runtime/plugins/motion.d.ts +0 -2
  52. package/dist/modules/ui/src/runtime/plugins/motion.js +0 -5
  53. package/dist/modules/ui/src/runtime/plugins/theme-switcher.d.ts +0 -2
  54. package/dist/modules/ui/src/runtime/plugins/theme-switcher.js +0 -27
  55. package/dist/modules/ui/src/runtime/plugins/theme.d.ts +0 -2
  56. package/dist/modules/ui/src/runtime/plugins/theme.js +0 -44
  57. package/dist/modules/ui/src/runtime/plugins/vuetify.d.ts +0 -3
  58. package/dist/modules/ui/src/runtime/plugins/vuetify.js +0 -33
  59. package/dist/modules/ui/src/runtime/search/client.d.ts +0 -2
  60. package/dist/modules/ui/src/runtime/search/client.js +0 -21
  61. package/dist/modules/ui/src/runtime/search/plugin.d.ts +0 -2
  62. package/dist/modules/ui/src/runtime/search/plugin.js +0 -7
  63. package/dist/modules/ui/src/utils/color.d.ts +0 -2
  64. package/dist/modules/ui/src/utils/color.js +0 -11
  65. package/dist/modules/ui/src/utils/fonts.d.ts +0 -5
  66. package/dist/modules/ui/src/utils/fonts.js +0 -18
  67. package/dist/modules/ui/src/utils/formkit.d.ts +0 -12
  68. package/dist/modules/ui/src/utils/formkit.js +0 -59
  69. package/dist/modules/ui/src/utils/icons.d.ts +0 -4
  70. package/dist/modules/ui/src/utils/icons.js +0 -36
  71. package/dist/runtime/plugins/icon-switcher.d.ts +0 -2
  72. package/dist/runtime/plugins/icon-switcher.js +0 -24
  73. package/dist/types/ui/api/global-search.d.ts +0 -8
  74. package/dist/types/ui/api/global-search.js +0 -1
  75. package/dist/types/ui/blocks/block-button-group.d.ts +0 -6
  76. package/dist/types/ui/blocks/block-button-group.js +0 -1
  77. package/dist/types/ui/blocks/block-button.d.ts +0 -13
  78. package/dist/types/ui/blocks/block-button.js +0 -1
  79. package/dist/types/ui/blocks/block-column.d.ts +0 -18
  80. package/dist/types/ui/blocks/block-column.js +0 -1
  81. package/dist/types/ui/blocks/block-cta.d.ts +0 -11
  82. package/dist/types/ui/blocks/block-cta.js +0 -1
  83. package/dist/types/ui/blocks/block-divider.d.ts +0 -4
  84. package/dist/types/ui/blocks/block-divider.js +0 -1
  85. package/dist/types/ui/blocks/block-faq.d.ts +0 -11
  86. package/dist/types/ui/blocks/block-faq.js +0 -1
  87. package/dist/types/ui/blocks/block-form.d.ts +0 -7
  88. package/dist/types/ui/blocks/block-form.js +0 -1
  89. package/dist/types/ui/blocks/block-gallery.d.ts +0 -13
  90. package/dist/types/ui/blocks/block-gallery.js +0 -1
  91. package/dist/types/ui/blocks/block-hero.d.ts +0 -11
  92. package/dist/types/ui/blocks/block-hero.js +0 -1
  93. package/dist/types/ui/blocks/block-html.d.ts +0 -4
  94. package/dist/types/ui/blocks/block-html.js +0 -1
  95. package/dist/types/ui/blocks/block-logocloud.d.ts +0 -13
  96. package/dist/types/ui/blocks/block-logocloud.js +0 -1
  97. package/dist/types/ui/blocks/block-quote.d.ts +0 -10
  98. package/dist/types/ui/blocks/block-quote.js +0 -1
  99. package/dist/types/ui/blocks/block-richtext.d.ts +0 -7
  100. package/dist/types/ui/blocks/block-richtext.js +0 -1
  101. package/dist/types/ui/blocks/block-steps.d.ts +0 -21
  102. package/dist/types/ui/blocks/block-steps.js +0 -1
  103. package/dist/types/ui/blocks/block-team.d.ts +0 -6
  104. package/dist/types/ui/blocks/block-team.js +0 -1
  105. package/dist/types/ui/blocks/block-testimonial.d.ts +0 -13
  106. package/dist/types/ui/blocks/block-testimonial.js +0 -1
  107. package/dist/types/ui/blocks/block-video.d.ts +0 -9
  108. package/dist/types/ui/blocks/block-video.js +0 -1
  109. package/dist/types/ui/blocks/block.d.ts +0 -17
  110. package/dist/types/ui/blocks/block.js +0 -1
  111. package/dist/types/ui/blocks/index.d.ts +0 -18
  112. package/dist/types/ui/blocks/index.js +0 -1
  113. package/dist/types/ui/component.d.ts +0 -6
  114. package/dist/types/ui/component.js +0 -1
  115. package/dist/types/ui/content/category.d.ts +0 -10
  116. package/dist/types/ui/content/category.js +0 -1
  117. package/dist/types/ui/content/form.d.ts +0 -21
  118. package/dist/types/ui/content/form.js +0 -1
  119. package/dist/types/ui/content/index.d.ts +0 -6
  120. package/dist/types/ui/content/index.js +0 -1
  121. package/dist/types/ui/content/page.d.ts +0 -38
  122. package/dist/types/ui/content/page.js +0 -1
  123. package/dist/types/ui/content/post.d.ts +0 -38
  124. package/dist/types/ui/content/post.js +0 -1
  125. package/dist/types/ui/content/team.d.ts +0 -17
  126. package/dist/types/ui/content/team.js +0 -1
  127. package/dist/types/ui/content/testimonial.d.ts +0 -18
  128. package/dist/types/ui/content/testimonial.js +0 -1
  129. package/dist/types/ui/form.d.ts +0 -12
  130. package/dist/types/ui/form.js +0 -1
  131. package/dist/types/ui/help/index.d.ts +0 -51
  132. package/dist/types/ui/help/index.js +0 -1
  133. package/dist/types/ui/meta/analytics.d.ts +0 -21
  134. package/dist/types/ui/meta/analytics.js +0 -1
  135. package/dist/types/ui/meta/config.d.ts +0 -22
  136. package/dist/types/ui/meta/config.js +0 -1
  137. package/dist/types/ui/meta/globals.d.ts +0 -33
  138. package/dist/types/ui/meta/globals.js +0 -1
  139. package/dist/types/ui/meta/index.d.ts +0 -6
  140. package/dist/types/ui/meta/index.js +0 -1
  141. package/dist/types/ui/meta/navigation.d.ts +0 -31
  142. package/dist/types/ui/meta/navigation.js +0 -1
  143. package/dist/types/ui/meta/redirect.d.ts +0 -12
  144. package/dist/types/ui/meta/redirect.js +0 -1
  145. package/dist/types/ui/meta/seo.d.ts +0 -19
  146. package/dist/types/ui/meta/seo.js +0 -1
  147. package/dist/types/ui/os/contact.d.ts +0 -22
  148. package/dist/types/ui/os/contact.js +0 -1
  149. package/dist/types/ui/os/conversation.d.ts +0 -23
  150. package/dist/types/ui/os/conversation.js +0 -1
  151. package/dist/types/ui/os/index.d.ts +0 -16
  152. package/dist/types/ui/os/index.js +0 -1
  153. package/dist/types/ui/os/organization.d.ts +0 -51
  154. package/dist/types/ui/os/organization.js +0 -1
  155. package/dist/types/ui/os/os-activity.d.ts +0 -26
  156. package/dist/types/ui/os/os-activity.js +0 -1
  157. package/dist/types/ui/os/os-deal.d.ts +0 -42
  158. package/dist/types/ui/os/os-deal.js +0 -1
  159. package/dist/types/ui/os/os-expense.d.ts +0 -21
  160. package/dist/types/ui/os/os-expense.js +0 -1
  161. package/dist/types/ui/os/os-invoice.d.ts +0 -46
  162. package/dist/types/ui/os/os-invoice.js +0 -1
  163. package/dist/types/ui/os/os-item.d.ts +0 -17
  164. package/dist/types/ui/os/os-item.js +0 -1
  165. package/dist/types/ui/os/os-payment.d.ts +0 -27
  166. package/dist/types/ui/os/os-payment.js +0 -1
  167. package/dist/types/ui/os/os-project.d.ts +0 -45
  168. package/dist/types/ui/os/os-project.js +0 -1
  169. package/dist/types/ui/os/os-proposal.d.ts +0 -61
  170. package/dist/types/ui/os/os-proposal.js +0 -1
  171. package/dist/types/ui/os/os-settings.d.ts +0 -17
  172. package/dist/types/ui/os/os-settings.js +0 -1
  173. package/dist/types/ui/os/os-subscription.d.ts +0 -12
  174. package/dist/types/ui/os/os-subscription.js +0 -1
  175. package/dist/types/ui/os/os-task.d.ts +0 -32
  176. package/dist/types/ui/os/os-task.js +0 -1
  177. package/dist/types/ui/os/os-tax-rate.d.ts +0 -12
  178. package/dist/types/ui/os/os-tax-rate.js +0 -1
  179. package/dist/types/ui/pageComponentMap.d.ts +0 -2
  180. package/dist/types/ui/pageComponentMap.js +0 -7
  181. package/dist/types/ui/pagination.d.ts +0 -6
  182. package/dist/types/ui/pagination.js +0 -1
  183. package/dist/types/ui/schema.d.ts +0 -78
  184. package/dist/types/ui/schema.js +0 -1
  185. package/dist/types/ui/state.d.ts +0 -5
  186. package/dist/types/ui/state.js +0 -1
  187. package/dist/types/ui/system/file.d.ts +0 -47
  188. package/dist/types/ui/system/file.js +0 -1
  189. package/dist/types/ui/system/folder.d.ts +0 -8
  190. package/dist/types/ui/system/folder.js +0 -1
  191. package/dist/types/ui/system/index.d.ts +0 -4
  192. package/dist/types/ui/system/index.js +0 -1
  193. package/dist/types/ui/system/role.d.ts +0 -20
  194. package/dist/types/ui/system/role.js +0 -1
  195. package/dist/types/ui/system/user.d.ts +0 -57
  196. package/dist/types/ui/system/user.js +0 -1
  197. package/dist/types/ui.d.ts +0 -21
  198. package/dist/types/ui.js +0 -1
  199. package/dist/utils/color.d.ts +0 -2
  200. package/dist/utils/color.js +0 -11
  201. package/dist/utils/fonts.d.ts +0 -5
  202. package/dist/utils/fonts.js +0 -18
  203. package/dist/utils/formkit.d.ts +0 -12
  204. package/dist/utils/formkit.js +0 -59
  205. package/dist/utils/icons.d.ts +0 -4
  206. package/dist/utils/icons.js +0 -36
  207. package/src/module.ts +0 -105
  208. package/src/runtime/assets/config/tailwind.conifg.js +0 -42
  209. package/src/runtime/components/MButton.vue +0 -17
  210. package/src/runtime/composables/useMToast.ts +0 -14
  211. package/src/runtime/design/tokens.ts +0 -22
  212. package/src/runtime/plugins/builder.ts +0 -326
  213. package/src/runtime/plugins/fontawesome.ts +0 -11
  214. package/src/runtime/plugins/formkit.ts +0 -9
  215. package/src/runtime/plugins/lightgallery.js +0 -21
  216. package/src/runtime/plugins/motion.ts +0 -6
  217. package/src/runtime/plugins/theme-switcher.ts +0 -32
  218. package/src/runtime/plugins/theme.ts +0 -57
  219. package/src/runtime/plugins/vuetify.ts +0 -36
  220. package/src/runtime/search/client.ts +0 -25
  221. package/src/runtime/search/components/MSearch.vue +0 -19
  222. package/src/runtime/search/plugin.ts +0 -9
  223. package/src/runtime/styles/index.scss +0 -101
  224. package/src/runtime/styles/tailwind.css +0 -9
  225. package/src/runtime/styles/vuetify.scss +0 -5
  226. package/src/types/runtime-config.d.ts +0 -12
  227. package/src/utils/color.js +0 -11
  228. package/src/utils/color.ts +0 -14
  229. package/src/utils/fonts.js +0 -18
  230. package/src/utils/fonts.ts +0 -24
  231. package/src/utils/formkit.js +0 -59
  232. package/src/utils/formkit.ts +0 -75
  233. package/src/utils/icons.js +0 -36
  234. package/src/utils/icons.ts +0 -62
@@ -1,36 +0,0 @@
1
- import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'
2
- import { createVuetify } from 'vuetify'
3
- import * as components from 'vuetify/components'
4
- import * as directives from 'vuetify/directives'
5
- import 'vuetify/styles'
6
-
7
- export default defineNuxtPlugin((nuxtApp) => {
8
- const config = useRuntimeConfig()
9
- const theme = config.public.mframeworkUi?.theme || 'light'
10
-
11
- const vuetify = createVuetify({
12
- components,
13
- directives,
14
- theme: {
15
- defaultTheme: theme,
16
- themes: {
17
- light: {
18
- dark: false,
19
- colors: {
20
- primary: '#3b82f6',
21
- secondary: '#64748b'
22
- }
23
- },
24
- dark: {
25
- dark: true,
26
- colors: {
27
- primary: '#3b82f6',
28
- secondary: '#64748b'
29
- }
30
- }
31
- }
32
- }
33
- })
34
-
35
- nuxtApp.vueApp.use(vuetify)
36
- })
@@ -1,25 +0,0 @@
1
- import type { SearchClient } from 'instantsearch.js'
2
-
3
- export function getSearchClient(): SearchClient | null {
4
- let mod: any
5
- try {
6
- mod = require('@searchkit/instantsearch-client')
7
- } catch {
8
- console.warn('[mframework-ui] Searchkit client missing')
9
- return null
10
- }
11
-
12
- const candidate =
13
- mod?.default?.default ||
14
- mod?.default?.createClient ||
15
- mod?.default ||
16
- mod?.createClient ||
17
- mod
18
-
19
- if (typeof candidate !== 'function') return null
20
-
21
- const host = process.env.NUXT_PUBLIC_SEARCHKIT_HOST
22
- if (!host) return null
23
-
24
- return candidate({ host })
25
- }
@@ -1,19 +0,0 @@
1
- <template>
2
- <ais-instant-search :search-client="client" :index-name="index">
3
- <ais-search-box />
4
- <ais-hits>
5
- <template #item="{ item }">
6
- <slot name="hit" :item="item">
7
- <div class="p-2 border rounded">
8
- <ais-highlight attribute="title" :hit="item" />
9
- </div>
10
- </slot>
11
- </template>
12
- </ais-hits>
13
- </ais-instant-search>
14
- </template>
15
-
16
- <script setup lang="ts">
17
- const client = inject('mSearchClient')
18
- const index = inject('mSearchIndex')
19
- </script>
@@ -1,9 +0,0 @@
1
- import { getSearchClient } from './client'
2
-
3
- export default (nuxtApp: any) => {
4
- const client = getSearchClient()
5
- const indexName = process.env.NUXT_PUBLIC_SEARCH_INDEX || 'default'
6
-
7
- nuxtApp.provide('mSearchClient', client)
8
- nuxtApp.provide('mSearchIndex', indexName)
9
- }
@@ -1,101 +0,0 @@
1
- @import './tailwind.css';
2
-
3
- // Your design tokens, utilities, etc.
4
- :root {
5
- --m-primary: #3b82f6;
6
- --m-secondary: #64748b;
7
- --m-accent: #10b981;
8
- --m-muted: #f3f4f6;
9
- --m-surface: #ffffff;
10
- --m-border: #e5e7eb;
11
- }
12
-
13
- .dark {
14
- --m-primary: #60a5fa;
15
- --m-secondary: #94a3b8;
16
- --m-accent: #34d399;
17
- --m-muted: #1f2937;
18
- --m-surface: #111827;
19
- --m-border: #374151;
20
- }
21
-
22
- // GrapesJS canvas and editor styling
23
- /* Let's highlight canvas boundaries */
24
- #gjs {
25
- border: 3px solid #444;
26
- }
27
-
28
- /* Theming */
29
-
30
- /* Primary color for the background */
31
- .gjs-one-bg {
32
- background-color: #78366a;
33
- }
34
-
35
- /* Secondary color for the text color */
36
- .gjs-two-color {
37
- color: rgba(255, 255, 255, 0.7);
38
- }
39
-
40
- /* Tertiary color for the background */
41
- .gjs-three-bg {
42
- background-color: #ec5896;
43
- color: white;
44
- }
45
-
46
- /* Quaternary color for the text color */
47
- .gjs-four-color,
48
- .gjs-four-color-h:hover {
49
- color: #ec5896;
50
- }
51
-
52
- /* Reset some default styling */
53
- .gjs-cv-canvas {
54
- top: 0;
55
- width: 100%;
56
- height: 100%;
57
- }
58
-
59
- .gjs-block {
60
- width: auto;
61
- height: auto;
62
- min-height: auto;
63
- }
64
-
65
- .panel__top {
66
- padding: 0;
67
- width: 100%;
68
- display: flex;
69
- position: initial;
70
- justify-content: center;
71
- justify-content: space-between;
72
- }
73
- .panel__basic-actions {
74
- position: initial;
75
- }
76
-
77
- .editor-row {
78
- display: flex;
79
- justify-content: flex-start;
80
- align-items: stretch;
81
- flex-wrap: nowrap;
82
- height: 300px;
83
- }
84
-
85
- .editor-canvas {
86
- flex-grow: 1;
87
- }
88
-
89
- .panel__right {
90
- flex-basis: 230px;
91
- position: relative;
92
- overflow-y: auto;
93
- }
94
-
95
- .panel__switcher {
96
- position: initial;
97
- }
98
-
99
- .panel__devices {
100
- position: initial;
101
- }
@@ -1,9 +0,0 @@
1
- /* @mframework/ui/runtime/assets/css/tailwind.css */
2
-
3
- /* Tailwind base (if using Tailwind 3 style) */
4
- @import "tailwindcss/preflight";
5
-
6
- /* Vuetify + Tailwind coexistence tips:
7
- - Avoid global resets that fight Vuetify
8
- - Prefer utility classes for layout, spacing, etc.
9
- */
@@ -1,5 +0,0 @@
1
- // Override Vuetify variables or add global Vuetify-related styles here.
2
-
3
- body {
4
- font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
5
- }
@@ -1,12 +0,0 @@
1
- declare module 'nuxt/schema' {
2
- interface PublicRuntimeConfig {
3
- mframeworkUi?: {
4
- theme?: 'light' | 'dark'
5
- builder?: {
6
- enabled?: boolean
7
- }
8
- }
9
- }
10
- }
11
-
12
- export {}
@@ -1,11 +0,0 @@
1
- function getContrastColor(hexColor) {
2
- // Convert hex color to RGB format
3
- const red = parseInt(hexColor.slice(1, 3), 16);
4
- const green = parseInt(hexColor.slice(3, 5), 16);
5
- const blue = parseInt(hexColor.slice(5, 7), 16);
6
- // Calculate relative luminance of the color
7
- const luminance = (0.2126 * red + 0.7152 * green + 0.0722 * blue) / 255;
8
- // Return black or white depending on the luminance value
9
- return luminance > 0.5 ? '#000000' : '#ffffff';
10
- }
11
- export { getContrastColor };
@@ -1,14 +0,0 @@
1
- function getContrastColor(hexColor: string) {
2
- // Convert hex color to RGB format
3
- const red = parseInt(hexColor.slice(1, 3), 16);
4
- const green = parseInt(hexColor.slice(3, 5), 16);
5
- const blue = parseInt(hexColor.slice(5, 7), 16);
6
-
7
- // Calculate relative luminance of the color
8
- const luminance = (0.2126 * red + 0.7152 * green + 0.0722 * blue) / 255;
9
-
10
- // Return black or white depending on the luminance value
11
- return luminance > 0.5 ? '#000000' : '#ffffff';
12
- }
13
-
14
- export { getContrastColor };
@@ -1,18 +0,0 @@
1
- export const formatFonts = (families, defaultWeights = [400]) => {
2
- const formatted = [];
3
- for (const font in families) {
4
- const formattedFont = font.replace(/ /g, '+'); // Replace spaces with '+'
5
- const weights = families[font];
6
- if (weights === true) {
7
- for (const weight of defaultWeights) {
8
- formatted.push(`${formattedFont}:${weight}`);
9
- }
10
- }
11
- else if (Array.isArray(weights)) {
12
- for (const weight of weights) {
13
- formatted.push(`${formattedFont}:${weight}`);
14
- }
15
- }
16
- }
17
- return formatted;
18
- };
@@ -1,24 +0,0 @@
1
- type FontFamilies = {
2
- [font: string]: boolean | number[];
3
- };
4
-
5
- export const formatFonts = (families: FontFamilies, defaultWeights: number[] = [400]): string[] => {
6
- const formatted: string[] = [];
7
-
8
- for (const font in families) {
9
- const formattedFont = font.replace(/ /g, '+'); // Replace spaces with '+'
10
- const weights = families[font];
11
-
12
- if (weights === true) {
13
- for (const weight of defaultWeights) {
14
- formatted.push(`${formattedFont}:${weight}`);
15
- }
16
- } else if (Array.isArray(weights)) {
17
- for (const weight of weights) {
18
- formatted.push(`${formattedFont}:${weight}`);
19
- }
20
- }
21
- }
22
-
23
- return formatted;
24
- };
@@ -1,59 +0,0 @@
1
- import { unref } from 'vue';
2
- function convertBoolean(value) {
3
- if (value === 'true' || value === 'false') {
4
- return value === 'true';
5
- }
6
- else {
7
- return value;
8
- }
9
- }
10
- function mapCondition(condition, target) {
11
- switch (condition) {
12
- case 'is_empty':
13
- return `!$get(${target}).value)`;
14
- case 'is_filled':
15
- return `$get(${target}).value)`;
16
- default:
17
- return undefined;
18
- }
19
- }
20
- export function mapConditions(conditions) {
21
- // Both $el and $cmp schema nodes can leverage an if property that roughly equates to a v-if in Vue. If the expression assigned to the if property is truthy, the node is rendered, otherwise it is not:
22
- }
23
- export function transformSchema(schema) {
24
- // Loop through the form schema from Directus
25
- // This is required for FormKit to work
26
- const items = unref(schema);
27
- return items.map((item) => {
28
- const { conditions, field, name, children, ...props } = item;
29
- // console.log('conditions', conditions);
30
- // console.log('mapCondition', mapCondition(conditions[0].condition, field));
31
- const cmpSchema = {
32
- $cmp: item.$el ? item.$el : 'FormKit',
33
- children: children,
34
- // if: conditions ? mapCondition(conditions[0].condition, field) : undefined,
35
- props: {
36
- id: name,
37
- ...props,
38
- },
39
- };
40
- // Switch statement to handle item widths
41
- switch (item.width) {
42
- case '33':
43
- cmpSchema.props.outerClass = 'md:col-span-2';
44
- break;
45
- case '50':
46
- cmpSchema.props.outerClass = 'md:col-span-3';
47
- break;
48
- case '67':
49
- cmpSchema.props.outerClass = 'md:col-span-4';
50
- break;
51
- case '100':
52
- cmpSchema.props.outerClass = 'md:col-span-6';
53
- break;
54
- default:
55
- cmpSchema.props.outerClass = 'md:col-span-6';
56
- }
57
- return cmpSchema;
58
- });
59
- }
@@ -1,75 +0,0 @@
1
- import { unref } from 'vue';
2
-
3
- export interface Condition {
4
- field: string;
5
- action: 'show' | 'hide';
6
- condition: 'is_empty' | 'is_filled' | 'contains' | 'not_contains' | 'equals' | 'not_equal';
7
- value: string;
8
- }
9
-
10
- function convertBoolean(value: string) {
11
- if (value === 'true' || value === 'false') {
12
- return value === 'true';
13
- } else {
14
- return value;
15
- }
16
- }
17
-
18
- function mapCondition(condition: Condition['condition'], target: string) {
19
- switch (condition) {
20
- case 'is_empty':
21
- return `!$get(${target}).value)`;
22
- case 'is_filled':
23
- return `$get(${target}).value)`;
24
- default:
25
- return undefined;
26
- }
27
- }
28
-
29
- export function mapConditions(conditions: Condition[]) {
30
- // Both $el and $cmp schema nodes can leverage an if property that roughly equates to a v-if in Vue. If the expression assigned to the if property is truthy, the node is rendered, otherwise it is not:
31
- }
32
-
33
- export function transformSchema(schema: Array<object>) {
34
- // Loop through the form schema from Directus
35
- // This is required for FormKit to work
36
- const items = unref(schema);
37
- return items.map((item: any) => {
38
- const { conditions, field, name, children, ...props } = item;
39
-
40
- // console.log('conditions', conditions);
41
- // console.log('mapCondition', mapCondition(conditions[0].condition, field));
42
-
43
- const cmpSchema = {
44
- $cmp: item.$el ? item.$el : 'FormKit',
45
-
46
- children: children,
47
- // if: conditions ? mapCondition(conditions[0].condition, field) : undefined,
48
-
49
- props: {
50
- id: name,
51
- ...props,
52
- },
53
- };
54
-
55
- // Switch statement to handle item widths
56
- switch (item.width) {
57
- case '33':
58
- cmpSchema.props.outerClass = 'md:col-span-2';
59
- break;
60
- case '50':
61
- cmpSchema.props.outerClass = 'md:col-span-3';
62
- break;
63
- case '67':
64
- cmpSchema.props.outerClass = 'md:col-span-4';
65
- break;
66
- case '100':
67
- cmpSchema.props.outerClass = 'md:col-span-6';
68
- break;
69
- default:
70
- cmpSchema.props.outerClass = 'md:col-span-6';
71
- }
72
-
73
- return cmpSchema;
74
- });
75
- }
@@ -1,36 +0,0 @@
1
- export const fileIconMap = {
2
- folder: 'material-symbols:folder',
3
- // Images
4
- 'image/jpeg': 'material-symbols:image',
5
- 'image/png': 'material-symbols:image',
6
- 'image/gif': 'material-symbols:image',
7
- 'image/svg+xml': 'material-symbols:image',
8
- 'image/webp': 'material-symbols:image',
9
- // Videos
10
- 'video/mp4': 'material-symbols:smart-display',
11
- 'video/quicktime': 'material-symbols:smart-display',
12
- // Audio
13
- 'audio/mp3': 'material-symbols:audio-file',
14
- 'audio/aac': 'material-symbols:audio-file',
15
- 'audio/wav': 'material-symbols:audio-file',
16
- 'audio/ogg': 'material-symbols:audio-file',
17
- // Text
18
- 'text/csv': 'material-symbols:csv',
19
- 'text/plain': 'material-symbols:text-snippet',
20
- // Files
21
- 'application/pdf': 'material-symbols:picture-as-pdf-sharp',
22
- 'application/vnd.ms-excel': 'material-symbols:sheets',
23
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'material-symbols:sheets',
24
- 'application/msword': 'material-symbols:docs',
25
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'material-symbols:docs',
26
- 'application/vnd.ms-powerpoint': 'material-symbols:slides',
27
- 'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'material-symbols:slides',
28
- };
29
- export function getFileIcon(filetype) {
30
- if (!filetype)
31
- return 'material-symbols:attachment';
32
- if (typeof filetype === 'string' && !(filetype in fileIconMap)) {
33
- return 'material-symbols:attachment';
34
- }
35
- return fileIconMap[filetype];
36
- }
@@ -1,62 +0,0 @@
1
- type FileType =
2
- | 'folder'
3
- | 'image/jpeg'
4
- | 'image/png'
5
- | 'image/gif'
6
- | 'image/svg+xml'
7
- | 'image/webp'
8
- | 'video/mp4'
9
- | 'video/quicktime'
10
- | 'audio/mp3'
11
- | 'audio/aac'
12
- | 'audio/wav'
13
- | 'audio/ogg'
14
- | 'text/csv'
15
- | 'text/plain'
16
- | 'application/pdf'
17
- | 'application/vnd.ms-excel'
18
- | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
19
- | 'application/msword'
20
- | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
21
- | 'application/vnd.ms-powerpoint'
22
- | 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
23
-
24
- export const fileIconMap: Record<FileType, string> = {
25
- folder: 'material-symbols:folder',
26
- // Images
27
- 'image/jpeg': 'material-symbols:image',
28
- 'image/png': 'material-symbols:image',
29
- 'image/gif': 'material-symbols:image',
30
- 'image/svg+xml': 'material-symbols:image',
31
- 'image/webp': 'material-symbols:image',
32
- // Videos
33
- 'video/mp4': 'material-symbols:smart-display',
34
- 'video/quicktime': 'material-symbols:smart-display',
35
- // Audio
36
- 'audio/mp3': 'material-symbols:audio-file',
37
- 'audio/aac': 'material-symbols:audio-file',
38
- 'audio/wav': 'material-symbols:audio-file',
39
- 'audio/ogg': 'material-symbols:audio-file',
40
- // Text
41
- 'text/csv': 'material-symbols:csv',
42
- 'text/plain': 'material-symbols:text-snippet',
43
-
44
- // Files
45
- 'application/pdf': 'material-symbols:picture-as-pdf-sharp',
46
- 'application/vnd.ms-excel': 'material-symbols:sheets',
47
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'material-symbols:sheets',
48
- 'application/msword': 'material-symbols:docs',
49
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'material-symbols:docs',
50
- 'application/vnd.ms-powerpoint': 'material-symbols:slides',
51
- 'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'material-symbols:slides',
52
- };
53
-
54
- export function getFileIcon(filetype: FileType | string | null | undefined) {
55
- if (!filetype) return 'material-symbols:attachment';
56
-
57
- if (typeof filetype === 'string' && !(filetype in fileIconMap)) {
58
- return 'material-symbols:attachment';
59
- }
60
-
61
- return fileIconMap[filetype as FileType];
62
- }