@hywax/cms-console 1.0.0

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 (122) hide show
  1. package/.nuxt/cms-console/button-copy-text.ts +19 -0
  2. package/.nuxt/cms-console/button-delete-confirm.ts +5 -0
  3. package/.nuxt/cms-console/editor/index.ts +0 -0
  4. package/.nuxt/cms-console/form-panel-aside-section.ts +9 -0
  5. package/.nuxt/cms-console/form-panel-section.ts +8 -0
  6. package/.nuxt/cms-console/form-panel.ts +15 -0
  7. package/.nuxt/cms-console/index.ts +11 -0
  8. package/.nuxt/cms-console/input-seo.ts +5 -0
  9. package/.nuxt/cms-console/input-slug.ts +5 -0
  10. package/.nuxt/cms-console/input-uplora-image.ts +27 -0
  11. package/.nuxt/cms-console/modal-confirm.ts +5 -0
  12. package/.nuxt/cms-console/table-panel.ts +8 -0
  13. package/.nuxt/cms-console/table-search-input.ts +6 -0
  14. package/.nuxt/cms-console.css +31 -0
  15. package/dist/module.d.mts +11 -0
  16. package/dist/module.json +9 -0
  17. package/dist/module.mjs +387 -0
  18. package/dist/runtime/components/AutocompleteSelect.d.vue.ts +56 -0
  19. package/dist/runtime/components/AutocompleteSelect.vue +225 -0
  20. package/dist/runtime/components/AutocompleteSelect.vue.d.ts +56 -0
  21. package/dist/runtime/components/ButtonCopyText.d.vue.ts +28 -0
  22. package/dist/runtime/components/ButtonCopyText.vue +70 -0
  23. package/dist/runtime/components/ButtonCopyText.vue.d.ts +28 -0
  24. package/dist/runtime/components/ButtonDeleteConfirm.d.vue.ts +38 -0
  25. package/dist/runtime/components/ButtonDeleteConfirm.vue +62 -0
  26. package/dist/runtime/components/ButtonDeleteConfirm.vue.d.ts +38 -0
  27. package/dist/runtime/components/DatePicker.d.vue.ts +43 -0
  28. package/dist/runtime/components/DatePicker.vue +232 -0
  29. package/dist/runtime/components/DatePicker.vue.d.ts +43 -0
  30. package/dist/runtime/components/EditorFull.d.vue.ts +13 -0
  31. package/dist/runtime/components/EditorFull.vue +139 -0
  32. package/dist/runtime/components/EditorFull.vue.d.ts +13 -0
  33. package/dist/runtime/components/EditorLinkPopover.d.vue.ts +8 -0
  34. package/dist/runtime/components/EditorLinkPopover.vue +137 -0
  35. package/dist/runtime/components/EditorLinkPopover.vue.d.ts +8 -0
  36. package/dist/runtime/components/FormPanel.d.vue.ts +47 -0
  37. package/dist/runtime/components/FormPanel.vue +73 -0
  38. package/dist/runtime/components/FormPanel.vue.d.ts +47 -0
  39. package/dist/runtime/components/FormPanelAsideSection.d.vue.ts +24 -0
  40. package/dist/runtime/components/FormPanelAsideSection.vue +41 -0
  41. package/dist/runtime/components/FormPanelAsideSection.vue.d.ts +24 -0
  42. package/dist/runtime/components/FormPanelSection.d.vue.ts +21 -0
  43. package/dist/runtime/components/FormPanelSection.vue +31 -0
  44. package/dist/runtime/components/FormPanelSection.vue.d.ts +21 -0
  45. package/dist/runtime/components/InputSeo.d.vue.ts +21 -0
  46. package/dist/runtime/components/InputSeo.vue +73 -0
  47. package/dist/runtime/components/InputSeo.vue.d.ts +21 -0
  48. package/dist/runtime/components/InputSlug.d.vue.ts +30 -0
  49. package/dist/runtime/components/InputSlug.vue +70 -0
  50. package/dist/runtime/components/InputSlug.vue.d.ts +30 -0
  51. package/dist/runtime/components/InputUploraImage.d.vue.ts +39 -0
  52. package/dist/runtime/components/InputUploraImage.vue +163 -0
  53. package/dist/runtime/components/InputUploraImage.vue.d.ts +39 -0
  54. package/dist/runtime/components/Layout.d.vue.ts +30 -0
  55. package/dist/runtime/components/Layout.vue +82 -0
  56. package/dist/runtime/components/Layout.vue.d.ts +30 -0
  57. package/dist/runtime/components/ModalConfirm.d.vue.ts +33 -0
  58. package/dist/runtime/components/ModalConfirm.vue +97 -0
  59. package/dist/runtime/components/ModalConfirm.vue.d.ts +33 -0
  60. package/dist/runtime/components/TableColumnSorting.d.vue.ts +17 -0
  61. package/dist/runtime/components/TableColumnSorting.vue +81 -0
  62. package/dist/runtime/components/TableColumnSorting.vue.d.ts +17 -0
  63. package/dist/runtime/components/TableColumnVisibility.d.vue.ts +24 -0
  64. package/dist/runtime/components/TableColumnVisibility.vue +110 -0
  65. package/dist/runtime/components/TableColumnVisibility.vue.d.ts +24 -0
  66. package/dist/runtime/components/TableFilters.d.vue.ts +90 -0
  67. package/dist/runtime/components/TableFilters.vue +199 -0
  68. package/dist/runtime/components/TableFilters.vue.d.ts +90 -0
  69. package/dist/runtime/components/TablePanel.d.vue.ts +95 -0
  70. package/dist/runtime/components/TablePanel.vue +297 -0
  71. package/dist/runtime/components/TablePanel.vue.d.ts +95 -0
  72. package/dist/runtime/components/TableSearchInput.d.vue.ts +33 -0
  73. package/dist/runtime/components/TableSearchInput.vue +97 -0
  74. package/dist/runtime/components/TableSearchInput.vue.d.ts +33 -0
  75. package/dist/runtime/composables/useAdmin.d.ts +6 -0
  76. package/dist/runtime/composables/useAdmin.js +14 -0
  77. package/dist/runtime/composables/useEditorDragHandle.d.ts +17 -0
  78. package/dist/runtime/composables/useEditorDragHandle.js +95 -0
  79. package/dist/runtime/composables/useEditorSuggestions.d.ts +74 -0
  80. package/dist/runtime/composables/useEditorSuggestions.js +25 -0
  81. package/dist/runtime/composables/useEditorToolbar.d.ts +121 -0
  82. package/dist/runtime/composables/useEditorToolbar.js +87 -0
  83. package/dist/runtime/composables/useQueryState.d.ts +28 -0
  84. package/dist/runtime/composables/useQueryState.js +105 -0
  85. package/dist/runtime/composables/useRouteQuery.d.ts +37 -0
  86. package/dist/runtime/composables/useRouteQuery.js +81 -0
  87. package/dist/runtime/composables/useSeoStats.d.ts +12 -0
  88. package/dist/runtime/composables/useSeoStats.js +44 -0
  89. package/dist/runtime/composables/useTable.d.ts +25 -0
  90. package/dist/runtime/composables/useTable.js +84 -0
  91. package/dist/runtime/composables/useTableColumns.d.ts +28 -0
  92. package/dist/runtime/composables/useTableColumns.js +54 -0
  93. package/dist/runtime/editor/uplora-image/EditorUploraImage.d.ts +18 -0
  94. package/dist/runtime/editor/uplora-image/EditorUploraImage.js +42 -0
  95. package/dist/runtime/editor/uplora-image/EditorUploraImageNode.d.vue.ts +4 -0
  96. package/dist/runtime/editor/uplora-image/EditorUploraImageNode.vue +23 -0
  97. package/dist/runtime/editor/uplora-image/EditorUploraImageNode.vue.d.ts +4 -0
  98. package/dist/runtime/index.css +1 -0
  99. package/dist/runtime/server/tsconfig.json +3 -0
  100. package/dist/runtime/tv.d.ts +1 -0
  101. package/dist/runtime/tv.js +4 -0
  102. package/dist/runtime/types/app.config.d.ts +6 -0
  103. package/dist/runtime/types/date.d.ts +5 -0
  104. package/dist/runtime/types/date.js +0 -0
  105. package/dist/runtime/types/dictionaries.d.ts +1 -0
  106. package/dist/runtime/types/dictionaries.js +0 -0
  107. package/dist/runtime/types/index.d.ts +30 -0
  108. package/dist/runtime/types/index.js +30 -0
  109. package/dist/runtime/types/seo.d.ts +4 -0
  110. package/dist/runtime/types/seo.js +0 -0
  111. package/dist/runtime/utils/auth.d.ts +2 -0
  112. package/dist/runtime/utils/auth.js +5 -0
  113. package/dist/runtime/utils/date.d.ts +5 -0
  114. package/dist/runtime/utils/date.js +15 -0
  115. package/dist/runtime/utils/formatters.d.ts +5 -0
  116. package/dist/runtime/utils/formatters.js +24 -0
  117. package/dist/runtime/utils/index.d.ts +4 -0
  118. package/dist/runtime/utils/index.js +4 -0
  119. package/dist/runtime/utils/slugify.d.ts +1 -0
  120. package/dist/runtime/utils/slugify.js +11 -0
  121. package/dist/types.d.mts +11 -0
  122. package/package.json +89 -0
@@ -0,0 +1,19 @@
1
+ export default {
2
+ "slots": {
3
+ "root": "wrap-anywhere",
4
+ "text": "pe-5",
5
+ "button": "p-0 -ms-4 align-middle"
6
+ },
7
+ "variants": {
8
+ "buttonInvisible": {
9
+ "true": {
10
+ "button": "invisible"
11
+ }
12
+ },
13
+ "to": {
14
+ "true": {
15
+ "text": "ps-0"
16
+ }
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,5 @@
1
+ export default {
2
+ "slots": {
3
+ "root": ""
4
+ }
5
+ }
File without changes
@@ -0,0 +1,9 @@
1
+ export default {
2
+ "slots": {
3
+ "root": "",
4
+ "header": "flex items-center gap-2 mb-2",
5
+ "icon": "size-5",
6
+ "title": "break-words text-sm font-semibold",
7
+ "body": ""
8
+ }
9
+ }
@@ -0,0 +1,8 @@
1
+ export default {
2
+ "slots": {
3
+ "root": "",
4
+ "title": "text-base text-pretty font-semibold text-highlighted mb-2",
5
+ "description": "text-[15px] text-pretty text-muted mt-1",
6
+ "body": "relative rounded-lg bg-elevated/50 ring ring-default grid gap-x-8 gap-y-4 p-4 sm:p-6"
7
+ }
8
+ }
@@ -0,0 +1,15 @@
1
+ export default {
2
+ "slots": {
3
+ "root": "",
4
+ "form": "flex flex-1 flex-row",
5
+ "body": "flex-1 overflow-y-auto w-full lg:max-w-2xl mx-auto p-4 sm:p-6",
6
+ "sidebar": "flex-1 overflow-y-auto border-l border-default w-full max-w-xs p-4 sm:p-4"
7
+ },
8
+ "variants": {
9
+ "asideDivide": {
10
+ "true": {
11
+ "sidebar": "*:not-last:after:absolute *:not-last:after:inset-x-1 *:not-last:after:bottom-0 *:not-last:after:bg-border *:not-last:after:h-px *:not-last:relative *:not-last:pb-4 flex flex-col gap-4"
12
+ }
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,11 @@
1
+ export { default as ButtonCopyText } from './button-copy-text'
2
+ export { default as ButtonDeleteConfirm } from './button-delete-confirm'
3
+ export { default as FormPanel } from './form-panel'
4
+ export { default as FormPanelAsideSection } from './form-panel-aside-section'
5
+ export { default as FormPanelSection } from './form-panel-section'
6
+ export { default as InputSeo } from './input-seo'
7
+ export { default as InputUploraImage } from './input-uplora-image'
8
+ export { default as ModalConfirm } from './modal-confirm'
9
+ export { default as TablePanel } from './table-panel'
10
+ export { default as TableSearchInput } from './table-search-input'
11
+ export { default as inputSlug } from './input-slug'
@@ -0,0 +1,5 @@
1
+ export default {
2
+ "slots": {
3
+ "root": "flex flex-col gap-4"
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ export default {
2
+ "slots": {
3
+ "root": "flex flex-col gap-4"
4
+ }
5
+ }
@@ -0,0 +1,27 @@
1
+ export default {
2
+ "slots": {
3
+ "root": "relative w-full rounded-md overflow-hidden border-1 border-default aspect-3/2 text-sm bg-default",
4
+ "image": "",
5
+ "imageActions": "absolute top-4 right-4 flex gap-2",
6
+ "imageActionsWarning": "absolute top-0 right-0 size-6 bg-linear-to-bl from-error/90 to-transparent rounded-bl-lg text-error flex items-center justify-center",
7
+ "uploader": "flex flex-col items-center justify-center w-full h-full",
8
+ "uploaderPendingIcon": "size-6 animate-spin",
9
+ "uploaderIdleButton": "cursor-pointer h-full w-full",
10
+ "uploaderIdleText": "mt-2 font-medium",
11
+ "uploaderIdleExtensions": "mt-2 text-xs text-muted uppercase",
12
+ "uploaderErrorText": "text-center font-medium p-2",
13
+ "uploaderErrorActions": "flex gap-2 mt-4"
14
+ },
15
+ "variants": {
16
+ "disabled": {
17
+ "true": {
18
+ "root": "cursor-not-allowed opacity-75"
19
+ }
20
+ },
21
+ "uploaded": {
22
+ "false": {
23
+ "root": "border-dashed"
24
+ }
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,5 @@
1
+ export default {
2
+ "slots": {
3
+ "root": ""
4
+ }
5
+ }
@@ -0,0 +1,8 @@
1
+ export default {
2
+ "slots": {
3
+ "root": "",
4
+ "table": "",
5
+ "loader": "absolute z-10 inset-0 left-0 bg-default/90 flex items-center justify-center",
6
+ "loaderIcon": "animate-spin size-6"
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ export default {
2
+ "slots": {
3
+ "root": "",
4
+ "input": "basis-54 shrink-0"
5
+ }
6
+ }
@@ -0,0 +1,31 @@
1
+ @source "./cms-console";
2
+
3
+ @layer components {
4
+ .unvois {
5
+ --vis-crosshair-line-stroke-color: var(--ui-bg-elevated);
6
+ --vis-crosshair-circle-stroke-color: transparent;
7
+
8
+ --vis-axis-grid-color: var(--ui-border);
9
+ --vis-axis-tick-color: var(--ui-border);
10
+ --vis-axis-tick-label-color: var(--ui-text-dimmed);
11
+
12
+ --vis-tooltip-background-color: var(--ui-bg);
13
+ --vis-tooltip-border-color: var(--ui-border);
14
+ --vis-tooltip-text-color: var(--ui-text-highlighted);
15
+
16
+ --vis-color0: var(--ui-primary);
17
+ --vis-color1: var(--ui-secondary);
18
+ --vis-color2: var(--ui-info);
19
+ --vis-color3: var(--ui-warning);
20
+ --vis-color4: var(--ui-error);
21
+ --vis-color5: var(--ui-success);
22
+
23
+ --vis-dark-color0: var(--ui-primary);
24
+ --vis-dark-color1: var(--ui-secondary);
25
+ --vis-dark-color2: var(--ui-info);
26
+ --vis-dark-color3: var(--ui-warning);
27
+ --vis-dark-color4: var(--ui-error);
28
+ --vis-dark-color5: var(--ui-success);
29
+ }
30
+ }
31
+
@@ -0,0 +1,11 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+ import { CMSRuntimeOptions } from '@hywax/cms-runtime';
3
+ export * from '../dist/runtime/types/index.js';
4
+
5
+ interface CMSConsoleOptions extends CMSRuntimeOptions {
6
+ }
7
+
8
+ declare const _default: _nuxt_schema.NuxtModule<CMSConsoleOptions, CMSConsoleOptions, false>;
9
+
10
+ export { _default as default };
11
+ export type { CMSConsoleOptions };
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@hywax/cms-console",
3
+ "version": "1.0.0",
4
+ "configKey": "cmsConsole",
5
+ "builder": {
6
+ "@nuxt/module-builder": "1.0.2",
7
+ "unbuild": "3.6.1"
8
+ }
9
+ }
@@ -0,0 +1,387 @@
1
+ import { createResolver, addComponentsDir, addImportsDir, addServerImportsDir, addTypeTemplate, addTemplate, addServerTemplate, defineNuxtModule } from '@nuxt/kit';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { dirname } from 'pathe';
4
+ import { defu } from 'defu';
5
+ import { kebabCase } from 'scule';
6
+
7
+ const name = "@hywax/cms-console";
8
+ const version = "1.0.0";
9
+
10
+ function createContext(options, nuxt) {
11
+ const { resolve } = createResolver(import.meta.url);
12
+ const distDir = dirname(fileURLToPath(import.meta.url));
13
+ const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
14
+ return {
15
+ options,
16
+ resolve,
17
+ distDir,
18
+ runtimeDir,
19
+ nuxt
20
+ };
21
+ }
22
+
23
+ const defaultModuleOptions = {
24
+ componentsPrefix: "C"
25
+ };
26
+
27
+ function prepareAutoImports({ resolve, options, nuxt }) {
28
+ addComponentsDir({
29
+ path: resolve("./runtime/components"),
30
+ pathPrefix: false,
31
+ prefix: options.componentsPrefix,
32
+ ignore: ["prose/**"]
33
+ });
34
+ addImportsDir([
35
+ resolve("./runtime/utils"),
36
+ resolve("./runtime/composables")
37
+ ]);
38
+ addServerImportsDir([
39
+ resolve("./runtime/utils")
40
+ ]);
41
+ nuxt.options.alias["#cms-console"] = resolve("./runtime");
42
+ }
43
+
44
+ const icons = {
45
+ calendar: "lucide:calendar",
46
+ sort: "lucide:arrow-down-up",
47
+ sortAsc: "lucide:arrow-up-wide-narrow",
48
+ sortDesc: "lucide:arrow-down-wide-narrow",
49
+ columns: "lucide:columns-3-cog",
50
+ filter: "lucide:filter",
51
+ ellipsisVertical: "lucide:ellipsis-vertical",
52
+ repeat: "lucide:repeat-2",
53
+ clipboard: "lucide:clipboard",
54
+ trash: "lucide:trash",
55
+ paragraph: "lucide:type",
56
+ heading1: "lucide:heading-1",
57
+ heading2: "lucide:heading-2",
58
+ heading3: "lucide:heading-3",
59
+ heading4: "lucide:heading-4",
60
+ list: "lucide:list",
61
+ listOrdered: "lucide:list-ordered",
62
+ blockquote: "lucide:text-quote",
63
+ codeBlock: "lucide:square-code",
64
+ horizontalRule: "lucide:separator-horizontal",
65
+ enter: "lucide:corner-down-left",
66
+ link: "lucide:link",
67
+ download: "lucide:download",
68
+ bold: "lucide:bold",
69
+ italic: "lucide:italic",
70
+ underline: "lucide:underline",
71
+ strikethrough: "lucide:strikethrough",
72
+ code: "lucide:code",
73
+ image: "lucide:image",
74
+ editLine: "lucide:pen-line"
75
+ };
76
+
77
+ function prepareMergeConfigs({ nuxt }) {
78
+ nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui || {}, {
79
+ icons
80
+ });
81
+ nuxt.options.vite = defu(nuxt.options.vite || {}, {
82
+ optimizeDeps: {
83
+ include: [
84
+ "@unovis/ts",
85
+ "@unovis/vue",
86
+ "@sindresorhus/slugify",
87
+ "@floating-ui/dom",
88
+ "@vueuse/integrations/useSortable",
89
+ "@nuxt/ui/utils/editor",
90
+ "fast-copy",
91
+ "fast-equals"
92
+ ]
93
+ }
94
+ });
95
+ }
96
+
97
+ const buttonCopyText = {
98
+ slots: {
99
+ root: "wrap-anywhere",
100
+ text: "pe-5",
101
+ button: "p-0 -ms-4 align-middle"
102
+ },
103
+ variants: {
104
+ buttonInvisible: {
105
+ true: {
106
+ button: "invisible"
107
+ }
108
+ },
109
+ to: {
110
+ true: {
111
+ text: "ps-0"
112
+ }
113
+ }
114
+ }
115
+ };
116
+
117
+ const buttonDeleteConfirm = {
118
+ slots: {
119
+ root: ""
120
+ }
121
+ };
122
+
123
+ const formPanel = {
124
+ slots: {
125
+ root: "",
126
+ form: "flex flex-1 flex-row",
127
+ body: "flex-1 overflow-y-auto w-full lg:max-w-2xl mx-auto p-4 sm:p-6",
128
+ sidebar: "flex-1 overflow-y-auto border-l border-default w-full max-w-xs p-4 sm:p-4"
129
+ },
130
+ variants: {
131
+ asideDivide: {
132
+ true: {
133
+ sidebar: "*:not-last:after:absolute *:not-last:after:inset-x-1 *:not-last:after:bottom-0 *:not-last:after:bg-border *:not-last:after:h-px *:not-last:relative *:not-last:pb-4 flex flex-col gap-4"
134
+ }
135
+ }
136
+ }
137
+ };
138
+
139
+ const formPanelAsideSection = {
140
+ slots: {
141
+ root: "",
142
+ header: "flex items-center gap-2 mb-2",
143
+ icon: "size-5",
144
+ title: "break-words text-sm font-semibold",
145
+ body: ""
146
+ }
147
+ };
148
+
149
+ const formPanelSection = {
150
+ slots: {
151
+ root: "",
152
+ title: "text-base text-pretty font-semibold text-highlighted mb-2",
153
+ description: "text-[15px] text-pretty text-muted mt-1",
154
+ body: "relative rounded-lg bg-elevated/50 ring ring-default grid gap-x-8 gap-y-4 p-4 sm:p-6"
155
+ }
156
+ };
157
+
158
+ const inputSeo = {
159
+ slots: {
160
+ root: "flex flex-col gap-4"
161
+ }
162
+ };
163
+
164
+ const inputSlug = {
165
+ slots: {
166
+ root: "flex flex-col gap-4"
167
+ }
168
+ };
169
+
170
+ const inputUploraImage = {
171
+ slots: {
172
+ root: "relative w-full rounded-md overflow-hidden border-1 border-default aspect-3/2 text-sm bg-default",
173
+ image: "",
174
+ imageActions: "absolute top-4 right-4 flex gap-2",
175
+ imageActionsWarning: "absolute top-0 right-0 size-6 bg-linear-to-bl from-error/90 to-transparent rounded-bl-lg text-error flex items-center justify-center",
176
+ uploader: "flex flex-col items-center justify-center w-full h-full",
177
+ uploaderPendingIcon: "size-6 animate-spin",
178
+ uploaderIdleButton: "cursor-pointer h-full w-full",
179
+ uploaderIdleText: "mt-2 font-medium",
180
+ uploaderIdleExtensions: "mt-2 text-xs text-muted uppercase",
181
+ uploaderErrorText: "text-center font-medium p-2",
182
+ uploaderErrorActions: "flex gap-2 mt-4"
183
+ },
184
+ variants: {
185
+ disabled: {
186
+ true: {
187
+ root: "cursor-not-allowed opacity-75"
188
+ }
189
+ },
190
+ uploaded: {
191
+ false: {
192
+ root: "border-dashed"
193
+ }
194
+ }
195
+ }
196
+ };
197
+
198
+ const modalConfirm = {
199
+ slots: {
200
+ root: ""
201
+ }
202
+ };
203
+
204
+ const tablePanel = {
205
+ slots: {
206
+ root: "",
207
+ table: "",
208
+ loader: "absolute z-10 inset-0 left-0 bg-default/90 flex items-center justify-center",
209
+ loaderIcon: "animate-spin size-6"
210
+ }
211
+ };
212
+
213
+ const tableSearchInput = {
214
+ slots: {
215
+ root: "",
216
+ input: "basis-54 shrink-0"
217
+ }
218
+ };
219
+
220
+ const theme = {
221
+ __proto__: null,
222
+ ButtonCopyText: buttonCopyText,
223
+ ButtonDeleteConfirm: buttonDeleteConfirm,
224
+ FormPanel: formPanel,
225
+ FormPanelAsideSection: formPanelAsideSection,
226
+ FormPanelSection: formPanelSection,
227
+ InputSeo: inputSeo,
228
+ InputUploraImage: inputUploraImage,
229
+ ModalConfirm: modalConfirm,
230
+ TablePanel: tablePanel,
231
+ TableSearchInput: tableSearchInput,
232
+ inputSlug: inputSlug
233
+ };
234
+
235
+ const themeEditor = {
236
+ __proto__: null
237
+ };
238
+
239
+ function getAppTemplates({ options }) {
240
+ const templates = [];
241
+ function writeThemeTemplate(theme2, path) {
242
+ for (const component in theme2) {
243
+ templates.push({
244
+ filename: `cms-console/${path ? `${path}/` : ""}${kebabCase(component)}.ts`,
245
+ write: true,
246
+ getContents: async () => {
247
+ const template = theme2[component];
248
+ const result = typeof template === "function" ? template(options) : template;
249
+ const variants = Object.entries(result.variants || {}).filter(([_, values]) => {
250
+ const keys = Object.keys(values);
251
+ return keys.some((key) => key !== "true" && key !== "false");
252
+ }).map(([key]) => key);
253
+ let json = JSON.stringify(result, null, 2);
254
+ for (const variant of variants) {
255
+ json = json.replace(new RegExp(`("${variant}": "[^"]+")`, "g"), `$1 as typeof ${variant}[number]`);
256
+ json = json.replace(new RegExp(`("${variant}": \\[\\s*)((?:"[^"]+",?\\s*)+)(\\])`, "g"), (_, before, match, after) => {
257
+ const replaced = match.replace(/("[^"]+")/g, `$1 as typeof ${variant}[number]`);
258
+ return `${before}${replaced}${after}`;
259
+ });
260
+ }
261
+ function generateVariantDeclarations(variants2) {
262
+ return variants2.filter((variant) => json.includes(`as typeof ${variant}`)).map((variant) => {
263
+ const keys = Object.keys(result.variants[variant]);
264
+ return `const ${variant} = ${JSON.stringify(keys, null, 2)} as const`;
265
+ });
266
+ }
267
+ return [
268
+ ...generateVariantDeclarations(variants),
269
+ `export default ${json}`
270
+ ].join("\n\n");
271
+ }
272
+ });
273
+ }
274
+ }
275
+ writeThemeTemplate(themeEditor, "editor");
276
+ writeThemeTemplate(theme);
277
+ templates.push({
278
+ filename: `cms-console/editor/index.ts`,
279
+ write: true,
280
+ getContents: () => Object.keys(themeEditor).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`).join("\n")
281
+ });
282
+ templates.push({
283
+ filename: "cms-console.css",
284
+ write: true,
285
+ getContents: () => `@source "./cms-console";
286
+
287
+ @layer components {
288
+ .unvois {
289
+ --vis-crosshair-line-stroke-color: var(--ui-bg-elevated);
290
+ --vis-crosshair-circle-stroke-color: transparent;
291
+
292
+ --vis-axis-grid-color: var(--ui-border);
293
+ --vis-axis-tick-color: var(--ui-border);
294
+ --vis-axis-tick-label-color: var(--ui-text-dimmed);
295
+
296
+ --vis-tooltip-background-color: var(--ui-bg);
297
+ --vis-tooltip-border-color: var(--ui-border);
298
+ --vis-tooltip-text-color: var(--ui-text-highlighted);
299
+
300
+ --vis-color0: var(--ui-primary);
301
+ --vis-color1: var(--ui-secondary);
302
+ --vis-color2: var(--ui-info);
303
+ --vis-color3: var(--ui-warning);
304
+ --vis-color4: var(--ui-error);
305
+ --vis-color5: var(--ui-success);
306
+
307
+ --vis-dark-color0: var(--ui-primary);
308
+ --vis-dark-color1: var(--ui-secondary);
309
+ --vis-dark-color2: var(--ui-info);
310
+ --vis-dark-color3: var(--ui-warning);
311
+ --vis-dark-color4: var(--ui-error);
312
+ --vis-dark-color5: var(--ui-success);
313
+ }
314
+ }
315
+ `
316
+ });
317
+ templates.push({
318
+ filename: "cms-console/index.ts",
319
+ write: true,
320
+ getContents: () => {
321
+ return Object.keys(theme).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`).join("\n");
322
+ }
323
+ });
324
+ templates.push({
325
+ filename: "types/cms-console.d.ts",
326
+ getContents: () => `import * as cms from '#build/cms-console'
327
+ import type { TVConfig } from '@nuxt/ui'
328
+ import type { RouteLocationRaw } from 'vue-router'
329
+
330
+ type AppConfigCMS = TVConfig<typeof cms>
331
+
332
+ declare module '@nuxt/schema' {
333
+ interface AppConfigInput {
334
+ /**
335
+ * CMS theme configuration
336
+ */
337
+ cms?: AppConfigCMS
338
+ }
339
+ }
340
+
341
+ export {}
342
+ `
343
+ });
344
+ return templates;
345
+ }
346
+ function getServerTemplates(_context) {
347
+ const templates = [];
348
+ return templates;
349
+ }
350
+ function prepareTemplates(context) {
351
+ const appTemplates = getAppTemplates(context);
352
+ const serverTemplates = getServerTemplates();
353
+ for (const template of appTemplates) {
354
+ if (template.filename.endsWith(".d.ts")) {
355
+ addTypeTemplate(template);
356
+ } else {
357
+ addTemplate(template);
358
+ }
359
+ }
360
+ for (const template of serverTemplates) {
361
+ if (template.filename.endsWith(".d.ts")) {
362
+ addTypeTemplate(template, { nitro: true, nuxt: false });
363
+ } else {
364
+ addServerTemplate(template);
365
+ }
366
+ }
367
+ }
368
+
369
+ const module$1 = defineNuxtModule({
370
+ meta: {
371
+ name,
372
+ version,
373
+ configKey: "cmsConsole"
374
+ },
375
+ moduleDependencies: {
376
+ "@hywax/cms-runtime": {}
377
+ },
378
+ defaults: defaultModuleOptions,
379
+ async setup(options, nuxt) {
380
+ const context = createContext(options, nuxt);
381
+ prepareMergeConfigs(context);
382
+ prepareTemplates(context);
383
+ prepareAutoImports(context);
384
+ }
385
+ });
386
+
387
+ export { module$1 as default };
@@ -0,0 +1,56 @@
1
+ import type { Pagination, PaginationQueryRaw } from '@hywax/cms-runtime';
2
+ import type { InputMenuItem } from '@nuxt/ui';
3
+ type PaginationQuery = Required<PaginationQueryRaw>;
4
+ export type AutocompleteSelectItem = Extract<InputMenuItem, object> & {
5
+ id?: string | number;
6
+ name?: string;
7
+ };
8
+ type GetModelValue<T extends AutocompleteSelectItem, VK extends keyof T, M extends boolean> = M extends true ? (T[VK][] | undefined) : (T[VK] | undefined);
9
+ export type HandlerParams = PaginationQuery & {
10
+ search: string;
11
+ ids?: string[] | number[];
12
+ };
13
+ export type Handler<T extends AutocompleteSelectItem = AutocompleteSelectItem> = (params: HandlerParams, signal?: AbortSignal) => Promise<{
14
+ items: T[];
15
+ pagination: Pagination;
16
+ }>;
17
+ export interface AutocompleteSelectProps<T extends AutocompleteSelectItem = AutocompleteSelectItem, VK extends keyof T = 'id', M extends boolean = false> {
18
+ modelValue?: GetModelValue<T, VK, M>;
19
+ cacheKey: string;
20
+ handler: Handler<T>;
21
+ /** @defaultValue 'id' */
22
+ valueKey?: VK;
23
+ /** @defaultValue 'name' */
24
+ labelKey?: keyof T;
25
+ multiple?: M & boolean;
26
+ placeholder?: string;
27
+ initSelected?: boolean;
28
+ }
29
+ export interface AutocompleteSelectEmits<T extends AutocompleteSelectItem = AutocompleteSelectItem, VK extends keyof T = 'id', M extends boolean = false> {
30
+ 'update:modelValue': [payload: GetModelValue<T, VK, M>];
31
+ }
32
+ export interface Slots<T extends AutocompleteSelectItem = AutocompleteSelectItem> {
33
+ 'item-label': (props: {
34
+ item: T;
35
+ }) => any;
36
+ }
37
+ declare const _default: typeof __VLS_export;
38
+ export default _default;
39
+ declare const __VLS_export: <T extends AutocompleteSelectItem, VK extends keyof T = "id", M extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
40
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<AutocompleteSelectProps<T, VK, M> & {
41
+ "onUpdate:modelValue"?: ((payload: GetModelValue<T, VK, M>) => any) | undefined;
42
+ }> & (typeof globalThis extends {
43
+ __VLS_PROPS_FALLBACK: infer P;
44
+ } ? P : {});
45
+ expose: (exposed: {}) => void;
46
+ attrs: any;
47
+ slots: Slots<T>;
48
+ emit: (evt: "update:modelValue", payload: GetModelValue<T, VK, M>) => void;
49
+ }>) => import("vue").VNode & {
50
+ __ctx?: Awaited<typeof __VLS_setup>;
51
+ };
52
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
53
+ [K in keyof T]: T[K];
54
+ } : {
55
+ [K in keyof T as K]: T[K];
56
+ }) & {};