@opengis/cms 0.0.21 → 0.0.24

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/package.json CHANGED
@@ -1,22 +1,14 @@
1
1
  {
2
2
  "name": "@opengis/cms",
3
- "version": "0.0.21",
3
+ "version": "0.0.24",
4
4
  "description": "cms",
5
5
  "type": "module",
6
6
  "author": "Softpro",
7
7
  "main": "dist/cms.js",
8
- "exports": {
9
- ".": "./src/index.ts",
10
- "./plugin.js": "./plugin.js",
11
- "./src/*": "./src/*",
12
- "./module/*": "./module/*",
13
- "./server/*": "./server/*"
14
- },
15
8
  "license": "EULA",
16
9
  "files": [
17
10
  "dist/*",
18
- "module/*",
19
- "src/index.ts",
11
+ "src/index.js",
20
12
  "server",
21
13
  "plugin.js"
22
14
  ],
package/src/index.js ADDED
@@ -0,0 +1,23 @@
1
+ // Main Pages Components (тільки ті, що є в меню)
2
+ export { default as Dashboard } from './pages/Dashboard.vue';
3
+ export { default as BuilderPage } from './pages/builder/BuilderPage.vue';
4
+ export { default as EditCollectionPage } from './pages/builder/EditCollectionPage.vue';
5
+ export { default as CollectionsPage } from './pages/collections/CollectionsPage.vue';
6
+ export { default as ArticlesPage } from './pages/collections/ArticlesPage.vue';
7
+ export { default as ContentForm } from './pages/collections/contentForm.vue';
8
+ export { default as MenuPage } from './pages/menu/MenuPage.vue';
9
+ export { default as MenuItemPage } from './pages/menu/MenuItemPage.vue';
10
+ export { default as MenuAddPage } from './pages/menu/MenuAddPage.vue';
11
+ export { default as TagsPage } from './pages/TagsPage.vue';
12
+ export { default as UsersPage } from './pages/users/UsersPage.vue';
13
+ export { default as AddUser } from './pages/users/AddUser.vue';
14
+ export { default as MediaPage } from './pages/MediaPage.vue';
15
+ export { default as Settings } from './pages/settings/Settings.vue';
16
+ export { default as SettingsGeneral } from './pages/settings/general.vue';
17
+ export { default as SettingsLogs } from './pages/settings/Logs.vue';
18
+
19
+
20
+
21
+
22
+
23
+
@@ -1,17 +0,0 @@
1
- component: default
2
-
3
- tokens:
4
- edit: { table: cms.content.table, form: cms.content.form, id: '{{id}}', ignoreCheck: true }
5
-
6
- panels:
7
- - type: container
8
- col: 5
9
- items:
10
- - name: main_info
11
- - component: vs-widget-file
12
- - type: tabs
13
- col: 7
14
- items:
15
- - component: vs-widget-history
16
- title: Історія редагування
17
-
@@ -1,26 +0,0 @@
1
- <div>
2
- <div class="flex justify-between items-center pb-[5px]">
3
- <div class="font-semibold text-[16px] dark:text-white">Загальна інформація</div>
4
- <div class="flex gap-[5px] items-center">
5
- {{{button this token=(token table="cms.content.table" form="cms.content.form" id=content_id) edit=1 }}}
6
- {{{button this token=(token table="cms.content.table" id=content_id) del=1 }}}
7
- </div>
8
- </div>
9
- {{{descriptionList
10
- this
11
- comma=";"
12
- columns="
13
- Назва,title,
14
- Slug,slug,
15
- Тип контенту,{{select content_type_id data='collection'}},
16
- Статус,{{{badge status data='content.status'}}},
17
- Дата публікації,{{formatDate published_at}},
18
- Локаль,locale,
19
- Головне зображення,{{{buttonFilePreview main_image}}},
20
- Користувач; який створив запис, {{select created_by data='user_id'}},
21
- Дата створення, {{formatDate created_at}},
22
- Дата оновлення, {{formatDate updated_at}}
23
- "
24
- }}}
25
- </div>
26
-
@@ -1,16 +0,0 @@
1
- <div>
2
- <div class="font-semibold text-[16px] dark:text-white mb-2">Контент меню</div>
3
- {{#if content}}
4
- <div class="bg-gray-50 dark:bg-gray-800 p-4 rounded-lg mb-4">
5
- <div class="font-semibold text-sm mb-2">YAML формат:</div>
6
- <pre class="bg-gray-900 text-green-400 p-4 rounded-lg font-mono text-sm overflow-auto whitespace-pre-wrap">{{content}}</pre>
7
- </div>
8
- {{/if}}
9
- {{#if items}}
10
- <div class="bg-gray-50 dark:bg-gray-800 p-4 rounded-lg">
11
- <div class="font-semibold text-sm mb-2">JSON формат:</div>
12
- <pre class="bg-gray-900 text-green-400 p-4 rounded-lg font-mono text-sm overflow-auto whitespace-pre-wrap">{{json items}}</pre>
13
- </div>
14
- {{/if}}
15
- </div>
16
-
@@ -1,18 +0,0 @@
1
- component: default
2
-
3
- tokens:
4
- edit: { table: cms.menu.table, form: cms.menu.form, id: '{{id}}', ignoreCheck: true }
5
-
6
- panels:
7
- - type: container
8
- col: 5
9
- items:
10
- - name: main_info
11
- - type: tabs
12
- col: 7
13
- items:
14
- - name: content_info
15
- title: Контент меню
16
- - component: vs-widget-history
17
- title: Історія редагування
18
-
@@ -1,22 +0,0 @@
1
- <div>
2
- <div class="flex justify-between items-center pb-[5px]">
3
- <div class="font-semibold text-[16px] dark:text-white">Загальна інформація</div>
4
- <div class="flex gap-[5px] items-center">
5
- {{{button this token=(token table="cms.menu.table" form="cms.menu.form" id=menu_id) edit=1 }}}
6
- {{{button this token=(token table="cms.menu.table" id=menu_id) del=1 }}}
7
- </div>
8
- </div>
9
- {{{descriptionList
10
- this
11
- comma=";"
12
- columns="
13
- Назва меню,name,
14
- Локаль,locale,
15
- Опис,description,
16
- Користувач; який створив запис, {{select created_by data='user_id'}},
17
- Дата створення, {{formatDate created_at}},
18
- Дата оновлення, {{formatDate updated_at}}
19
- "
20
- }}}
21
- </div>
22
-
@@ -1,13 +0,0 @@
1
- component: default
2
-
3
- tokens:
4
- edit: { table: cms.settings.table, form: cms.settings.form, id: '{{id}}', ignoreCheck: true }
5
-
6
- panels:
7
- - type: container
8
- col: 12
9
- items:
10
- - name: main_info
11
- - component: vs-widget-history
12
- title: Історія редагування
13
-
@@ -1,20 +0,0 @@
1
- <div>
2
- <div class="flex justify-between items-center pb-[5px]">
3
- <div class="font-semibold text-[16px] dark:text-white">Налаштування</div>
4
- <div class="flex gap-[5px] items-center">
5
- {{{button this token=(token table="cms.settings.table" form="cms.settings.form" id=id) edit=1 }}}
6
- </div>
7
- </div>
8
- {{{descriptionList
9
- this
10
- comma=";"
11
- columns="
12
- Ключ,key,
13
- Значення,value,
14
- Користувач; який створив запис, {{select created_by data='user_id'}},
15
- Дата створення, {{formatDate created_at}},
16
- Дата оновлення, {{formatDate updated_at}}
17
- "
18
- }}}
19
- </div>
20
-
@@ -1,18 +0,0 @@
1
- [
2
- {
3
- "id": "draft",
4
- "text": "Чернетка"
5
- },
6
- {
7
- "id": "published",
8
- "text": "Опубліковано"
9
- },
10
- {
11
- "id": "archived",
12
- "text": "Архівовано"
13
- },
14
- {
15
- "id": "delayPublished",
16
- "text": "Затримка публікації"
17
- }
18
- ]
@@ -1,10 +0,0 @@
1
- [
2
- {
3
- "id": "regular",
4
- "text": "Звичайний"
5
- },
6
- {
7
- "id": "admin",
8
- "text": "Admin"
9
- }
10
- ]
@@ -1,78 +0,0 @@
1
- {
2
- "schema": {
3
- "user_name": {
4
- "type": "Text",
5
- "rules": [
6
- "required"
7
- ],
8
- "ua": "Ім'я",
9
- "i": "Вноситься ім'я користувача, що буде відображатися у системі"
10
- },
11
- "sur_name": {
12
- "type": "Text",
13
- "rules": [
14
- "required"
15
- ],
16
- "ua": "Прізвище",
17
- "i": "Вноситься прізвище користувача, що буде відображатися у системі"
18
- },
19
- "father_name": {
20
- "ua": "По-батькові",
21
- "type": "Text"
22
- },
23
- "phone": {
24
- "type": "Text",
25
- "mask": "+389999999999",
26
- "ua": "Телефон",
27
- "i": "Вноситься телефон користувача"
28
- },
29
- "email": {
30
- "type": "Text",
31
- "ua": "E-mail",
32
- "i": "Вноситься електронна адреса користувача",
33
- "rules": [
34
- "email"
35
- ]
36
- },
37
- "login": {
38
- "type": "Text",
39
- "ua": "Логін",
40
- "i": "Вноситься довільний логін користувача латинськими літерами, що буде використовуватися для входу в систему",
41
- "rules": [
42
- "required"
43
- ]
44
- },
45
- "password": {
46
- "type": "Text",
47
- "ua": "Пароль",
48
- "rules": [
49
- "required",
50
- {
51
- "type": "regexp",
52
- "pattern": "^.{8,}$",
53
- "message": "Пароль повинен бути більше 8 символів"
54
- }
55
- ],
56
- "i": "Вноситься пароль, що буде використовуватися для входу в систему (рекомендоване використання складних паролів)"
57
- },
58
- "avatar": {
59
- "type": "File",
60
- "ua": "Аватар",
61
- "i": "Додається зображення, що буде відображено в системі у якості аватара цього користувача"
62
- },
63
- "user_type": {
64
- "type": "Select",
65
- "ua": "Тип користувача",
66
- "i": "Вноситься тип користувача",
67
- "data": "user_type"
68
- },
69
- "enabled": {
70
- "type": "Switcher",
71
- "label": "Доступ"
72
- },
73
- "twofa": {
74
- "type": "Switcher",
75
- "label": "Двофакторна авторизація"
76
- }
77
- }
78
- }
@@ -1,79 +0,0 @@
1
- {
2
- "style": {
3
- "navigation": true
4
- },
5
- "schema": {
6
- "d0": {
7
- "type": "HTML",
8
- "title": "Загальна інформація",
9
- "text": "<h2 class='text-xl font-bold text-left'>Загальна інформація про контент</h2>",
10
- "col": 12
11
- },
12
- "title": {
13
- "ua": "Назва",
14
- "col": 12,
15
- "type": "Text",
16
- "validators": [
17
- "required"
18
- ]
19
- },
20
- "slug": {
21
- "ua": "Slug",
22
- "col": 12,
23
- "type": "Text",
24
- "parent": "title",
25
- "validators": [
26
- "required"
27
- ]
28
- },
29
- "content_type_id": {
30
- "ua": "Тип контенту",
31
- "col": 6,
32
- "type": "Autocomplete",
33
- "data": "collection",
34
- "validators": [
35
- "required"
36
- ]
37
- },
38
- "status": {
39
- "ua": "Статус",
40
- "col": 6,
41
- "type": "Select",
42
- "data": "content.status",
43
- "validators": [
44
- "required"
45
- ]
46
- },
47
- "published_at": {
48
- "ua": "Дата публікації",
49
- "col": 6,
50
- "type": "Date",
51
- "mode": "datetime",
52
- "validators": [
53
- "required"
54
- ]
55
- },
56
- "locale": {
57
- "ua": "Локаль",
58
- "col": 6,
59
- "type": "Select",
60
- "defaultValue": "uk",
61
- "options": [
62
- {
63
- "id": "uk",
64
- "text": "Українська"
65
- },
66
- {
67
- "id": "en",
68
- "text": "English"
69
- }
70
- ]
71
- },
72
- "main_image": {
73
- "ua": "Головне зображення",
74
- "col": 12,
75
- "type": "File"
76
- }
77
- }
78
- }
79
-
@@ -1,69 +0,0 @@
1
- {
2
- "style": {
3
- "navigation": true
4
- },
5
- "schema": {
6
- "d0": {
7
- "type": "HTML",
8
- "title": "Загальна інформація",
9
- "text": "<h2 class='text-xl font-bold text-left'>Загальна інформація про меню</h2>",
10
- "col": 12
11
- },
12
- "name": {
13
- "ua": "Назва меню",
14
- "col": 12,
15
- "type": "Text",
16
- "validators": [
17
- "required"
18
- ],
19
- "i": "Унікальна назва меню"
20
- },
21
- "locale": {
22
- "ua": "Локаль",
23
- "col": 6,
24
- "type": "Select",
25
- "defaultValue": "uk",
26
- "options": [
27
- {
28
- "id": "uk",
29
- "text": "Українська"
30
- },
31
- {
32
- "id": "en",
33
- "text": "English"
34
- }
35
- ],
36
- "validators": [
37
- "required"
38
- ]
39
- },
40
- "description": {
41
- "ua": "Опис",
42
- "col": 12,
43
- "type": "TextArea",
44
- "i": "Опис меню для адміністратора"
45
- },
46
- "d1": {
47
- "type": "HTML",
48
- "title": "Структура меню",
49
- "text": "<h2 class='text-xl font-bold text-left'>Структура меню</h2>",
50
- "col": 12
51
- },
52
- "content": {
53
- "ua": "Контент меню (YAML)",
54
- "col": 12,
55
- "type": "TextArea",
56
- "syntax": "yaml",
57
- "i": "Структура меню у форматі YAML"
58
- },
59
- "items": {
60
- "ua": "Елементи меню (JSON)",
61
- "col": 12,
62
- "type": "TextArea",
63
- "syntax": "json",
64
- "i": "Структура меню у форматі JSON",
65
- "hidden": true
66
- }
67
- }
68
- }
69
-
@@ -1,32 +0,0 @@
1
- {
2
- "style": {
3
- "navigation": true
4
- },
5
- "schema": {
6
- "d0": {
7
- "type": "HTML",
8
- "title": "Налаштування",
9
- "text": "<h2 class='text-xl font-bold text-left'>Налаштування системи</h2>",
10
- "col": 12
11
- },
12
- "key": {
13
- "ua": "Ключ",
14
- "col": 12,
15
- "type": "Text",
16
- "validators": [
17
- "required"
18
- ],
19
- "i": "Унікальний ключ налаштування"
20
- },
21
- "value": {
22
- "ua": "Значення",
23
- "col": 12,
24
- "type": "TextArea",
25
- "validators": [
26
- "required"
27
- ],
28
- "i": "Значення налаштування"
29
- }
30
- }
31
- }
32
-
@@ -1,24 +0,0 @@
1
- [
2
- {
3
- "order": 1,
4
- "ua": "CMS",
5
- "menu": [
6
- {
7
- "path": "cms.content",
8
- "table": "cms.content.table",
9
- "ua": "Контент"
10
- },
11
- {
12
- "path": "cms.menu",
13
- "table": "cms.menu.table",
14
- "ua": "Меню"
15
- },
16
- {
17
- "path": "cms.settings",
18
- "table": "cms.settings.table",
19
- "ua": "Налаштування"
20
- }
21
- ]
22
- }
23
- ]
24
-
@@ -1,169 +0,0 @@
1
- /**
2
- * CMS Module Router Configuration
3
- *
4
- * This file provides router routes for CMS module (content, menu, settings).
5
- * Uses existing CMS components from the project.
6
- *
7
- * Usage in your project:
8
- * ```js
9
- * import { cmsRoutes } from './module/cms/router.js';
10
- * import { createRouter, createWebHistory } from 'vue-router';
11
- *
12
- * const router = createRouter({
13
- * history: createWebHistory(),
14
- * routes: [
15
- * ...cmsRoutes,
16
- * // your other routes
17
- * ]
18
- * });
19
- * ```
20
- */
21
-
22
- // Helper to resolve component - works in both npm package and local development
23
- function getComponent(npmPath, localPath) {
24
- return () => {
25
- // Try npm package path first (when installed via npm)
26
- return import(npmPath).catch(() => {
27
- // Fallback to relative path (for local development)
28
- return import(localPath);
29
- });
30
- };
31
- }
32
-
33
- export const cmsRoutes = [
34
- // Table routes - display list of items
35
- {
36
- path: '/cms.content',
37
- component: getComponent('@opengis/cms/src/pages/collections/ArticlesPage.vue', '../../src/pages/collections/ArticlesPage.vue'),
38
- name: 'cms-content',
39
- meta: {
40
- title: 'navigation.collections',
41
- table: 'cms.content.table'
42
- }
43
- },
44
- {
45
- path: '/cms.menu',
46
- component: getComponent('@opengis/cms/src/pages/menu/MenuPage.vue', '../../src/pages/menu/MenuPage.vue'),
47
- name: 'cms-menu',
48
- meta: {
49
- title: 'menu.title',
50
- table: 'cms.menu.table'
51
- }
52
- },
53
- {
54
- path: '/cms.settings',
55
- component: getComponent('@opengis/cms/src/pages/settings/Settings.vue', '../../src/pages/settings/Settings.vue'),
56
- name: 'cms-settings',
57
- meta: {
58
- title: 'settings.title',
59
- table: 'cms.settings.table'
60
- }
61
- },
62
- // Card routes - display detailed view (using contentForm for content)
63
- {
64
- path: '/cms.content/:id',
65
- component: getComponent('@opengis/cms/src/pages/collections/contentForm.vue', '../../src/pages/collections/contentForm.vue'),
66
- name: 'cms-content-card',
67
- meta: {
68
- title: 'articles.title',
69
- type: 'articles',
70
- table: 'cms.content.table',
71
- card: 'cms.content.table'
72
- }
73
- },
74
- {
75
- path: '/cms.menu/:id',
76
- component: getComponent('@opengis/cms/src/pages/menu/MenuItemPage.vue', '../../src/pages/menu/MenuItemPage.vue'),
77
- name: 'cms-menu-card',
78
- meta: {
79
- title: 'menu.editMenu',
80
- type: 'single',
81
- table: 'cms.menu.table',
82
- card: 'cms.menu.table'
83
- }
84
- },
85
- {
86
- path: '/cms.settings/:id',
87
- component: getComponent('@opengis/cms/src/pages/settings/general.vue', '../../src/pages/settings/general.vue'),
88
- name: 'cms-settings-card',
89
- meta: {
90
- title: 'settings.general.general',
91
- table: 'cms.settings.table',
92
- card: 'cms.settings.table'
93
- }
94
- },
95
- // Add routes - create new item
96
- {
97
- path: '/cms.content/add',
98
- component: getComponent('@opengis/cms/src/pages/collections/contentForm.vue', '../../src/pages/collections/contentForm.vue'),
99
- name: 'cms-content-add',
100
- meta: {
101
- title: 'articles.createArticle',
102
- type: 'articles',
103
- table: 'cms.content.table',
104
- form: 'cms.content.form'
105
- }
106
- },
107
- {
108
- path: '/cms.menu/add',
109
- component: getComponent('@opengis/cms/src/pages/menu/MenuAddPage.vue', '../../src/pages/menu/MenuAddPage.vue'),
110
- name: 'cms-menu-add',
111
- meta: {
112
- title: 'menu.menuAdd',
113
- type: 'single',
114
- table: 'cms.menu.table',
115
- form: 'cms.menu.form'
116
- }
117
- },
118
- {
119
- path: '/cms.settings/add',
120
- component: getComponent('@opengis/cms/src/pages/settings/general.vue', '../../src/pages/settings/general.vue'),
121
- name: 'cms-settings-add',
122
- meta: {
123
- title: 'settings.general.general',
124
- table: 'cms.settings.table',
125
- form: 'cms.settings.form'
126
- }
127
- },
128
- // Edit routes - edit existing item
129
- {
130
- path: '/cms.content/edit/:id',
131
- component: getComponent('@opengis/cms/src/pages/collections/contentForm.vue', '../../src/pages/collections/contentForm.vue'),
132
- name: 'cms-content-edit',
133
- meta: {
134
- title: 'articles.title',
135
- type: 'articles',
136
- table: 'cms.content.table',
137
- form: 'cms.content.form'
138
- }
139
- },
140
- {
141
- path: '/cms.menu/edit/:id',
142
- component: getComponent('@opengis/cms/src/pages/menu/MenuItemPage.vue', '../../src/pages/menu/MenuItemPage.vue'),
143
- name: 'cms-menu-edit',
144
- meta: {
145
- title: 'menu.editMenu',
146
- type: 'single',
147
- table: 'cms.menu.table',
148
- form: 'cms.menu.form'
149
- }
150
- },
151
- {
152
- path: '/cms.settings/edit/:id',
153
- component: getComponent('@opengis/cms/src/pages/settings/general.vue', '../../src/pages/settings/general.vue'),
154
- name: 'cms-settings-edit',
155
- meta: {
156
- title: 'settings.general.general',
157
- table: 'cms.settings.table',
158
- form: 'cms.settings.form'
159
- }
160
- },
161
- ];
162
-
163
- // Export default for direct router creation (optional)
164
- export default cmsRoutes;
165
-
166
- // Export menu for use in menu configuration
167
- import cmsMenuData from './menu.json';
168
- export { cmsMenuData as cmsMenu };
169
-
@@ -1,2 +0,0 @@
1
- select content_type_id, name || ' (' || title || ')' from site.content_types
2
- WHERE type = 'single'