@illuminateeducation/dna-atd-frontend 1.0.1-DNAATD-2189.0 → 1.0.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.
Files changed (76) hide show
  1. package/README.md +3 -4
  2. package/dist/AdminLayout-BQWZADPC.js +74 -0
  3. package/dist/AdminLayout-BQWZADPC.js.map +1 -0
  4. package/dist/AdminLayout-BaO704Tp.cjs +2 -0
  5. package/dist/AdminLayout-BaO704Tp.cjs.map +1 -0
  6. package/dist/CustomizationView-BJlqBq4I.js +15 -0
  7. package/dist/CustomizationView-BJlqBq4I.js.map +1 -0
  8. package/dist/CustomizationView-BRNwaKvj.cjs +2 -0
  9. package/dist/CustomizationView-BRNwaKvj.cjs.map +1 -0
  10. package/dist/HomeView-7jy27idX.js +10 -0
  11. package/dist/HomeView-7jy27idX.js.map +1 -0
  12. package/dist/HomeView-D6NWAtxc.cjs +2 -0
  13. package/dist/HomeView-D6NWAtxc.cjs.map +1 -0
  14. package/dist/NotFoundView-BCWgZLYs.js +28 -0
  15. package/dist/NotFoundView-BCWgZLYs.js.map +1 -0
  16. package/dist/NotFoundView-CNvAC47u.cjs +2 -0
  17. package/dist/NotFoundView-CNvAC47u.cjs.map +1 -0
  18. package/dist/ValidationView-DY83tE4M.js +15 -0
  19. package/dist/ValidationView-DY83tE4M.js.map +1 -0
  20. package/dist/ValidationView-ltSgO4AC.cjs +2 -0
  21. package/dist/ValidationView-ltSgO4AC.cjs.map +1 -0
  22. package/dist/assets/dna-atd-frontend.css +1 -0
  23. package/dist/index-1yktdPHs.cjs +2 -0
  24. package/dist/index-1yktdPHs.cjs.map +1 -0
  25. package/dist/index-CiZS9VrS.js +461 -0
  26. package/dist/index-CiZS9VrS.js.map +1 -0
  27. package/dist/index.cjs.js +2 -0
  28. package/dist/index.cjs.js.map +1 -0
  29. package/dist/index.es.js +30 -0
  30. package/dist/index.es.js.map +1 -0
  31. package/package.json +11 -21
  32. package/dist/.vite/manifest.json +0 -87
  33. package/dist/assets/AdminLayout.css +0 -1
  34. package/dist/assets/AdminLayout.js +0 -1
  35. package/dist/assets/CustomizationView.css +0 -1
  36. package/dist/assets/CustomizationView.js +0 -1
  37. package/dist/assets/HomeView.css +0 -1
  38. package/dist/assets/HomeView.js +0 -1
  39. package/dist/assets/NotFoundView.css +0 -1
  40. package/dist/assets/NotFoundView.js +0 -1
  41. package/dist/assets/ValidationView.css +0 -1
  42. package/dist/assets/ValidationView.js +0 -1
  43. package/dist/assets/_plugin-vue_export-helper.js +0 -1
  44. package/dist/assets/index.css +0 -1
  45. package/dist/assets/index.js +0 -2
  46. package/dist/index.html +0 -14
  47. package/index.js +0 -1
  48. package/src/App.vue +0 -68
  49. package/src/__tests__/App.spec.js +0 -26
  50. package/src/components/common/BaseButton.vue +0 -20
  51. package/src/components/common/BaseInput.vue +0 -27
  52. package/src/components/common/BaseModal.vue +0 -37
  53. package/src/composables/useAsync.js +0 -34
  54. package/src/composables/useClickOutside.js +0 -29
  55. package/src/composables/useForm.js +0 -89
  56. package/src/composables/useLocalStorage.js +0 -51
  57. package/src/composables/useWindowSize.js +0 -30
  58. package/src/config/app.config.js +0 -79
  59. package/src/features/admin/customization/composables/useCustomization.js +0 -19
  60. package/src/features/admin/customization/store/customizationStore.js +0 -30
  61. package/src/features/admin/customization/views/CustomizationView.vue +0 -17
  62. package/src/features/admin/validation/composables/useValidation.js +0 -18
  63. package/src/features/admin/validation/store/validationStore.js +0 -25
  64. package/src/features/admin/validation/views/ValidationView.vue +0 -17
  65. package/src/index.js +0 -53
  66. package/src/layouts/AdminLayout.vue +0 -146
  67. package/src/main.js +0 -41
  68. package/src/router/index.js +0 -57
  69. package/src/services/apiService.js +0 -72
  70. package/src/services/integration.js +0 -59
  71. package/src/services/phpIntegration.js +0 -1
  72. package/src/stores/counter.js +0 -12
  73. package/src/utils/helpers.js +0 -119
  74. package/src/utils/validators.js +0 -131
  75. package/src/views/HomeView.vue +0 -121
  76. package/src/views/NotFoundView.vue +0 -56
@@ -1,29 +0,0 @@
1
- import { ref, onMounted, onUnmounted } from 'vue'
2
-
3
- /**
4
- * Composable for detecting clicks outside an element
5
- * @param {Function} callback - Function to call when clicked outside
6
- * @returns {Object}
7
- */
8
- export function useClickOutside(callback) {
9
- const elementRef = ref(null)
10
-
11
- const handleClickOutside = (event) => {
12
- if (elementRef.value && !elementRef.value.contains(event.target)) {
13
- callback()
14
- }
15
- }
16
-
17
- onMounted(() => {
18
- document.addEventListener('click', handleClickOutside)
19
- })
20
-
21
- onUnmounted(() => {
22
- document.removeEventListener('click', handleClickOutside)
23
- })
24
-
25
- return {
26
- elementRef
27
- }
28
- }
29
-
@@ -1,89 +0,0 @@
1
- import { ref, computed } from 'vue'
2
-
3
- /**
4
- * Composable for form validation
5
- * @param {Object} initialValues - Initial form values
6
- * @param {Object} validationRules - Validation rules for each field
7
- * @returns {Object}
8
- */
9
- export function useForm(initialValues = {}, validationRules = {}) {
10
- const formData = ref({ ...initialValues })
11
- const errors = ref({})
12
- const touched = ref({})
13
-
14
- const isValid = computed(() => {
15
- return Object.keys(errors.value).length === 0
16
- })
17
-
18
- const validateField = (fieldName) => {
19
- const value = formData.value[fieldName]
20
- const rules = validationRules[fieldName]
21
-
22
- if (!rules) return true
23
-
24
- for (const rule of rules) {
25
- const result = rule.validator(value)
26
- if (!result) {
27
- errors.value[fieldName] = rule.message
28
- return false
29
- }
30
- }
31
-
32
- delete errors.value[fieldName]
33
- return true
34
- }
35
-
36
- const validateForm = () => {
37
- errors.value = {}
38
- let isFormValid = true
39
-
40
- Object.keys(validationRules).forEach(fieldName => {
41
- if (!validateField(fieldName)) {
42
- isFormValid = false
43
- }
44
- })
45
-
46
- return isFormValid
47
- }
48
-
49
- const handleBlur = (fieldName) => {
50
- touched.value[fieldName] = true
51
- validateField(fieldName)
52
- }
53
-
54
- const handleChange = (fieldName, value) => {
55
- formData.value[fieldName] = value
56
- if (touched.value[fieldName]) {
57
- validateField(fieldName)
58
- }
59
- }
60
-
61
- const resetForm = () => {
62
- formData.value = { ...initialValues }
63
- errors.value = {}
64
- touched.value = {}
65
- }
66
-
67
- const setFieldValue = (fieldName, value) => {
68
- formData.value[fieldName] = value
69
- }
70
-
71
- const setFieldError = (fieldName, error) => {
72
- errors.value[fieldName] = error
73
- }
74
-
75
- return {
76
- formData,
77
- errors,
78
- touched,
79
- isValid,
80
- validateField,
81
- validateForm,
82
- handleBlur,
83
- handleChange,
84
- resetForm,
85
- setFieldValue,
86
- setFieldError
87
- }
88
- }
89
-
@@ -1,51 +0,0 @@
1
- import { ref, onMounted, onUnmounted } from 'vue'
2
-
3
- /**
4
- * Composable for managing localStorage
5
- * @param {string} key - Storage key
6
- * @param {*} defaultValue - Default value if key doesn't exist
7
- * @returns {Object}
8
- */
9
- export function useLocalStorage(key, defaultValue = null) {
10
- const data = ref(defaultValue)
11
-
12
- const read = () => {
13
- try {
14
- const item = window.localStorage.getItem(key)
15
- return item ? JSON.parse(item) : defaultValue
16
- } catch (error) {
17
- console.error(`Error reading localStorage key "${key}":`, error)
18
- return defaultValue
19
- }
20
- }
21
-
22
- const write = (value) => {
23
- try {
24
- data.value = value
25
- window.localStorage.setItem(key, JSON.stringify(value))
26
- } catch (error) {
27
- console.error(`Error writing localStorage key "${key}":`, error)
28
- }
29
- }
30
-
31
- const remove = () => {
32
- try {
33
- window.localStorage.removeItem(key)
34
- data.value = defaultValue
35
- } catch (error) {
36
- console.error(`Error removing localStorage key "${key}":`, error)
37
- }
38
- }
39
-
40
- // Initialize
41
- onMounted(() => {
42
- data.value = read()
43
- })
44
-
45
- return {
46
- data,
47
- write,
48
- remove
49
- }
50
- }
51
-
@@ -1,30 +0,0 @@
1
- import { ref, onMounted, onUnmounted } from 'vue'
2
- import { debounce } from '../utils/helpers'
3
-
4
- /**
5
- * Composable for tracking window size
6
- * @returns {Object}
7
- */
8
- export function useWindowSize() {
9
- const width = ref(window.innerWidth)
10
- const height = ref(window.innerHeight)
11
-
12
- const handleResize = debounce(() => {
13
- width.value = window.innerWidth
14
- height.value = window.innerHeight
15
- }, 200)
16
-
17
- onMounted(() => {
18
- window.addEventListener('resize', handleResize)
19
- })
20
-
21
- onUnmounted(() => {
22
- window.removeEventListener('resize', handleResize)
23
- })
24
-
25
- return {
26
- width,
27
- height
28
- }
29
- }
30
-
@@ -1,79 +0,0 @@
1
- /**
2
- * Application Configuration
3
- */
4
-
5
- export const appConfig = {
6
- // Application name
7
- name: 'DNA ATD Frontend',
8
-
9
- // Version
10
- version: '1.0.0',
11
-
12
- // API Configuration
13
- api: {
14
- baseURL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:3000/api',
15
- timeout: 30000,
16
- headers: {
17
- 'Content-Type': 'application/json'
18
- }
19
- },
20
-
21
- // Theme Configuration
22
- theme: {
23
- default: 'light',
24
- available: ['light', 'dark', 'auto']
25
- },
26
-
27
- // Layout Configuration
28
- layout: {
29
- sidebarWidth: 250,
30
- headerHeight: 64,
31
- footerHeight: 48
32
- },
33
-
34
- // Pagination
35
- pagination: {
36
- defaultPageSize: 10,
37
- pageSizeOptions: [10, 20, 50, 100]
38
- },
39
-
40
- // Date Format
41
- dateFormat: {
42
- short: 'MMM DD, YYYY',
43
- long: 'MMMM DD, YYYY HH:mm',
44
- time: 'HH:mm:ss'
45
- },
46
-
47
- // Storage Keys
48
- storageKeys: {
49
- theme: 'app_theme',
50
- locale: 'app_locale',
51
- token: 'app_token',
52
- user: 'app_user'
53
- },
54
-
55
- // Feature Flags
56
- features: {
57
- darkMode: true,
58
- notifications: true,
59
- analytics: false
60
- },
61
-
62
- // Validation Rules
63
- validation: {
64
- password: {
65
- minLength: 8,
66
- requireUppercase: true,
67
- requireLowercase: true,
68
- requireNumbers: true,
69
- requireSpecialChars: true
70
- },
71
- username: {
72
- minLength: 3,
73
- maxLength: 20
74
- }
75
- }
76
- }
77
-
78
- export default appConfig
79
-
@@ -1,19 +0,0 @@
1
- import { storeToRefs } from 'pinia'
2
- import { useCustomizationStore } from '../store/customizationStore'
3
-
4
- /**
5
- * Composable for customization feature
6
- */
7
- export function useCustomization() {
8
- const customizationStore = useCustomizationStore()
9
- const { settings, isLoading } = storeToRefs(customizationStore)
10
- const { fetchSettings, updateSettings } = customizationStore
11
-
12
- return {
13
- settings,
14
- isLoading,
15
- fetchSettings,
16
- updateSettings
17
- }
18
- }
19
-
@@ -1,30 +0,0 @@
1
- import { defineStore } from 'pinia'
2
- import { ref } from 'vue'
3
-
4
- /**
5
- * Customization Store - Basic Example
6
- */
7
- export const useCustomizationStore = defineStore('customization', () => {
8
- // State
9
- const settings = ref({})
10
- const isLoading = ref(false)
11
-
12
- // Actions
13
- const fetchSettings = async () => {
14
- isLoading.value = true
15
- // Add your API call here
16
- isLoading.value = false
17
- }
18
-
19
- const updateSettings = (newSettings) => {
20
- settings.value = { ...settings.value, ...newSettings }
21
- }
22
-
23
- return {
24
- settings,
25
- isLoading,
26
- fetchSettings,
27
- updateSettings
28
- }
29
- })
30
-
@@ -1,17 +0,0 @@
1
- <template>
2
- <div class="customization-view">
3
- <h2>Customization Module</h2>
4
- <p>Customization feature content goes here.</p>
5
- </div>
6
- </template>
7
-
8
- <script setup>
9
- // Customization module - basic implementation
10
- </script>
11
-
12
- <style scoped>
13
- .customization-view {
14
- padding: 2rem;
15
- }
16
- </style>
17
-
@@ -1,18 +0,0 @@
1
- import { storeToRefs } from 'pinia'
2
- import { useValidationStore } from '../store/validationStore'
3
-
4
- /**
5
- * Composable for validation feature
6
- */
7
- export function useValidation() {
8
- const validationStore = useValidationStore()
9
- const { data, isLoading } = storeToRefs(validationStore)
10
- const { fetchData } = validationStore
11
-
12
- return {
13
- data,
14
- isLoading,
15
- fetchData
16
- }
17
- }
18
-
@@ -1,25 +0,0 @@
1
- import { defineStore } from 'pinia'
2
- import { ref } from 'vue'
3
-
4
- /**
5
- * Validation Store - Basic Example
6
- */
7
- export const useValidationStore = defineStore('validation', () => {
8
- // State
9
- const data = ref([])
10
- const isLoading = ref(false)
11
-
12
- // Actions
13
- const fetchData = async () => {
14
- isLoading.value = true
15
- // Add your API call here
16
- isLoading.value = false
17
- }
18
-
19
- return {
20
- data,
21
- isLoading,
22
- fetchData
23
- }
24
- })
25
-
@@ -1,17 +0,0 @@
1
- <template>
2
- <div class="validation-view">
3
- <h2>Validation Module</h2>
4
- <p>Validation feature content goes here.</p>
5
- </div>
6
- </template>
7
-
8
- <script setup>
9
- // Validation module - basic implementation
10
- </script>
11
-
12
- <style scoped>
13
- .validation-view {
14
- padding: 2rem;
15
- }
16
- </style>
17
-
package/src/index.js DELETED
@@ -1,53 +0,0 @@
1
- import { createApp } from 'vue'
2
- import { createPinia } from 'pinia'
3
- import router from './router'
4
- import App from './App.vue'
5
-
6
- export function createDnaAtdApp(elementId = '#app') {
7
- const app = createApp(App)
8
- const pinia = createPinia()
9
- app.use(pinia)
10
- app.use(router)
11
- return app.mount(elementId)
12
- }
13
-
14
- export function createDnaAtdAppInstance() {
15
- const app = createApp(App)
16
- const pinia = createPinia()
17
- app.use(pinia)
18
- app.use(router)
19
- return app
20
- }
21
-
22
- export { default as App } from './App.vue'
23
- export { default as router } from './router'
24
-
25
- export { default as BaseButton } from './components/common/BaseButton.vue'
26
- export { default as BaseInput } from './components/common/BaseInput.vue'
27
- export { default as BaseModal } from './components/common/BaseModal.vue'
28
-
29
- export { default as AdminLayout } from './layouts/AdminLayout.vue'
30
-
31
- export { useAsync } from './composables/useAsync'
32
- export { useForm } from './composables/useForm'
33
- export { useClickOutside } from './composables/useClickOutside'
34
- export { useLocalStorage } from './composables/useLocalStorage'
35
- export { useWindowSize } from './composables/useWindowSize'
36
-
37
- export { useValidationStore } from './features/admin/validation/store/validationStore'
38
- export { useCustomizationStore } from './features/admin/customization/store/customizationStore'
39
-
40
- export { useValidation } from './features/admin/validation/composables/useValidation'
41
- export { useCustomization } from './features/admin/customization/composables/useCustomization'
42
-
43
- export { default as ValidationView } from './features/admin/validation/views/ValidationView.vue'
44
- export { default as CustomizationView } from './features/admin/customization/views/CustomizationView.vue'
45
-
46
- export { default as apiService } from './services/apiService'
47
- export { appConfig } from './config/app.config'
48
-
49
- export * from './utils/helpers'
50
- export * from './utils/validators'
51
-
52
- export { default as HomeView } from './views/HomeView.vue'
53
- export { default as NotFoundView } from './views/NotFoundView.vue'
@@ -1,146 +0,0 @@
1
- <template>
2
- <div class="admin-layout">
3
- <aside class="admin-sidebar">
4
- <div class="sidebar-header">
5
- <h2>Admin Panel</h2>
6
- </div>
7
- <nav class="sidebar-nav">
8
- <router-link
9
- to="/admin/validation"
10
- class="nav-item"
11
- active-class="active"
12
- >
13
- <span class="nav-icon">✓</span>
14
- <span>Validation</span>
15
- </router-link>
16
- <router-link
17
- to="/admin/customization"
18
- class="nav-item"
19
- active-class="active"
20
- >
21
- <span class="nav-icon">🎨</span>
22
- <span>Customization</span>
23
- </router-link>
24
- </nav>
25
- <div class="sidebar-footer">
26
- <router-link to="/" class="back-link">
27
- ← Back to Home
28
- </router-link>
29
- </div>
30
- </aside>
31
-
32
- <main class="admin-content">
33
- <div class="content-header">
34
- <h1>{{ pageTitle }}</h1>
35
- </div>
36
- <div class="content-body">
37
- <router-view />
38
- </div>
39
- </main>
40
- </div>
41
- </template>
42
-
43
- <script setup>
44
- import { computed } from 'vue'
45
- import { useRoute } from 'vue-router'
46
-
47
- const route = useRoute()
48
-
49
- const pageTitle = computed(() => {
50
- return route.meta.title || 'Admin'
51
- })
52
- </script>
53
-
54
- <style scoped>
55
- .admin-layout {
56
- display: flex;
57
- min-height: 100vh;
58
- background-color: #f5f7fa;
59
- }
60
-
61
- .admin-sidebar {
62
- width: 250px;
63
- background-color: #2c3e50;
64
- color: white;
65
- display: flex;
66
- flex-direction: column;
67
- }
68
-
69
- .sidebar-header {
70
- padding: 2rem 1.5rem;
71
- border-bottom: 1px solid rgba(255,255,255,0.1);
72
- }
73
-
74
- .sidebar-header h2 {
75
- margin: 0;
76
- font-size: 1.5rem;
77
- }
78
-
79
- .sidebar-nav {
80
- flex: 1;
81
- padding: 1rem 0;
82
- }
83
-
84
- .nav-item {
85
- display: flex;
86
- align-items: center;
87
- gap: 1rem;
88
- padding: 1rem 1.5rem;
89
- color: rgba(255,255,255,0.8);
90
- text-decoration: none;
91
- transition: all 0.3s;
92
- }
93
-
94
- .nav-item:hover {
95
- background-color: rgba(255,255,255,0.1);
96
- color: white;
97
- }
98
-
99
- .nav-item.active {
100
- background-color: #3498db;
101
- color: white;
102
- border-right: 3px solid #2ecc71;
103
- }
104
-
105
- .nav-icon {
106
- font-size: 1.2rem;
107
- }
108
-
109
- .sidebar-footer {
110
- padding: 1.5rem;
111
- border-top: 1px solid rgba(255,255,255,0.1);
112
- }
113
-
114
- .back-link {
115
- color: rgba(255,255,255,0.8);
116
- text-decoration: none;
117
- transition: color 0.3s;
118
- }
119
-
120
- .back-link:hover {
121
- color: white;
122
- }
123
-
124
- .admin-content {
125
- flex: 1;
126
- display: flex;
127
- flex-direction: column;
128
- }
129
-
130
- .content-header {
131
- background: white;
132
- padding: 1.5rem 2rem;
133
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
134
- }
135
-
136
- .content-header h1 {
137
- margin: 0;
138
- font-size: 1.5rem;
139
- color: #2c3e50;
140
- }
141
-
142
- .content-body {
143
- flex: 1;
144
- overflow-y: auto;
145
- }
146
- </style>
package/src/main.js DELETED
@@ -1,41 +0,0 @@
1
- import { createApp } from 'vue'
2
- import { createPinia } from 'pinia'
3
-
4
- import App from './App.vue'
5
- import router from './router'
6
-
7
- // Backend Integration: Read data from DOM element attributes
8
- const appElement = document.getElementById('app')
9
- const configData = appElement?.getAttribute('data-config')
10
- const userData = appElement?.getAttribute('data-user')
11
-
12
- // Parse backend-provided data
13
- const backendConfig = configData ? JSON.parse(configData) : {}
14
- const backendUser = userData ? JSON.parse(userData) : {}
15
-
16
- // Create Vue app
17
- const app = createApp(App)
18
-
19
- // Make backend data available globally
20
- app.config.globalProperties.$config = backendConfig
21
- app.config.globalProperties.$user = backendUser
22
-
23
- // Setup plugins
24
- app.use(createPinia())
25
- app.use(router)
26
-
27
- // Mount app when DOM is ready
28
- document.addEventListener('DOMContentLoaded', () => {
29
- // Add any DOM modifications needed for backend integration
30
- const canvas = document.getElementById('canvas')
31
- if (canvas) {
32
- canvas.style.padding = '0'
33
- canvas.classList.add('vue-app')
34
- }
35
-
36
- // Mount the Vue app
37
- if (appElement) {
38
- app.mount('#app')
39
- }
40
- })
41
-