@hywax/cms 0.0.23 → 1.1.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 (182) hide show
  1. package/.nuxt/cms/editor/index.ts +0 -2
  2. package/.nuxt/cms/form-panel-section.ts +2 -2
  3. package/.nuxt/cms/index.ts +8 -21
  4. package/.nuxt/cms/table-search-input.ts +6 -0
  5. package/dist/module.json +3 -3
  6. package/dist/module.mjs +85 -204
  7. package/dist/runtime/components/AutocompleteSelect.d.vue.ts +56 -0
  8. package/dist/runtime/components/AutocompleteSelect.vue +131 -77
  9. package/dist/runtime/components/AutocompleteSelect.vue.d.ts +43 -29
  10. package/dist/runtime/components/{ButtonDelete.vue.d.ts → ButtonDeleteConfirm.d.vue.ts} +4 -3
  11. package/dist/runtime/components/{ButtonDelete.vue → ButtonDeleteConfirm.vue} +1 -1
  12. package/dist/runtime/components/ButtonDeleteConfirm.vue.d.ts +36 -0
  13. package/dist/runtime/components/DatePicker.d.vue.ts +43 -0
  14. package/dist/runtime/components/DatePicker.vue +232 -0
  15. package/dist/runtime/components/DatePicker.vue.d.ts +43 -0
  16. package/dist/runtime/components/EditorFull.d.vue.ts +13 -0
  17. package/dist/runtime/components/EditorFull.vue +127 -0
  18. package/dist/runtime/components/EditorFull.vue.d.ts +13 -0
  19. package/dist/runtime/components/EditorLinkPopover.d.vue.ts +8 -0
  20. package/dist/runtime/components/EditorLinkPopover.vue +137 -0
  21. package/dist/runtime/components/EditorLinkPopover.vue.d.ts +8 -0
  22. package/dist/runtime/components/FormPanel.d.vue.ts +47 -0
  23. package/dist/runtime/components/FormPanel.vue +10 -7
  24. package/dist/runtime/components/FormPanel.vue.d.ts +21 -15
  25. package/dist/runtime/components/FormPanelAsideSection.d.vue.ts +24 -0
  26. package/dist/runtime/components/FormPanelAsideSection.vue.d.ts +2 -1
  27. package/dist/runtime/components/FormPanelSection.d.vue.ts +21 -0
  28. package/dist/runtime/components/FormPanelSection.vue +2 -2
  29. package/dist/runtime/components/FormPanelSection.vue.d.ts +3 -2
  30. package/dist/runtime/components/Layout.d.vue.ts +29 -0
  31. package/dist/runtime/components/Layout.vue +81 -0
  32. package/dist/runtime/components/Layout.vue.d.ts +29 -0
  33. package/dist/runtime/components/ModalConfirm.d.vue.ts +33 -0
  34. package/dist/runtime/components/ModalConfirm.vue.d.ts +3 -2
  35. package/dist/runtime/components/TableColumnSorting.d.vue.ts +17 -0
  36. package/dist/runtime/components/{TablePanelColumnSorting.vue → TableColumnSorting.vue} +27 -18
  37. package/dist/runtime/components/TableColumnSorting.vue.d.ts +17 -0
  38. package/dist/runtime/components/TableColumnVisibility.d.vue.ts +24 -0
  39. package/dist/runtime/components/TableColumnVisibility.vue +111 -0
  40. package/dist/runtime/components/TableColumnVisibility.vue.d.ts +24 -0
  41. package/dist/runtime/components/TableFilters.d.vue.ts +90 -0
  42. package/dist/runtime/components/TableFilters.vue +198 -0
  43. package/dist/runtime/components/TableFilters.vue.d.ts +90 -0
  44. package/dist/runtime/components/TablePanel.d.vue.ts +95 -0
  45. package/dist/runtime/components/TablePanel.vue +207 -66
  46. package/dist/runtime/components/TablePanel.vue.d.ts +76 -31
  47. package/dist/runtime/components/TableSearchInput.d.vue.ts +33 -0
  48. package/dist/runtime/components/TableSearchInput.vue +96 -0
  49. package/dist/runtime/components/TableSearchInput.vue.d.ts +33 -0
  50. package/dist/runtime/components/UploraImage.d.vue.ts +35 -0
  51. package/dist/runtime/components/UploraImage.vue.d.ts +3 -2
  52. package/dist/runtime/components/prose/UploraImage.d.vue.ts +14 -0
  53. package/dist/runtime/components/prose/UploraImage.vue.d.ts +2 -1
  54. package/dist/runtime/composables/useAdmin.d.ts +1 -1
  55. package/dist/runtime/composables/useAdmin.js +2 -1
  56. package/dist/runtime/composables/useApi.d.ts +1 -1
  57. package/dist/runtime/composables/useAsyncHandler.d.ts +1 -1
  58. package/dist/runtime/composables/useAsyncHandler.js +1 -1
  59. package/dist/runtime/composables/useEditorDragHandle.d.ts +16 -0
  60. package/dist/runtime/composables/useEditorDragHandle.js +95 -0
  61. package/dist/runtime/composables/useEditorSuggestions.d.ts +68 -0
  62. package/dist/runtime/composables/useEditorSuggestions.js +24 -0
  63. package/dist/runtime/composables/useEditorToolbar.d.ts +120 -0
  64. package/dist/runtime/composables/useEditorToolbar.js +87 -0
  65. package/dist/runtime/composables/useFormState.d.ts +12 -0
  66. package/dist/runtime/composables/useFormState.js +33 -0
  67. package/dist/runtime/composables/useLogout.d.ts +1 -1
  68. package/dist/runtime/composables/useLogout.js +3 -1
  69. package/dist/runtime/composables/useNotification.d.ts +12 -0
  70. package/dist/runtime/composables/useNotification.js +46 -0
  71. package/dist/runtime/composables/useQueryState.d.ts +28 -0
  72. package/dist/runtime/composables/useQueryState.js +105 -0
  73. package/dist/runtime/composables/useRouteQuery.d.ts +37 -0
  74. package/dist/runtime/composables/useRouteQuery.js +81 -0
  75. package/dist/runtime/composables/useRowSelection.d.ts +8 -0
  76. package/dist/runtime/composables/useRowSelection.js +46 -0
  77. package/dist/runtime/composables/useTable.d.ts +17 -11
  78. package/dist/runtime/composables/useTable.js +47 -53
  79. package/dist/runtime/composables/useUplora.d.ts +1 -1
  80. package/dist/runtime/composables/useUplora.js +2 -1
  81. package/dist/runtime/index.css +1 -1
  82. package/dist/runtime/plugins/zod.d.ts +2 -0
  83. package/dist/runtime/plugins/zod.js +26 -0
  84. package/dist/runtime/server/api/uplora/[id].delete.d.ts +1 -5
  85. package/dist/runtime/tv.d.ts +1 -1
  86. package/dist/runtime/types/date.d.ts +5 -0
  87. package/dist/runtime/types/index.d.ts +3 -21
  88. package/dist/runtime/types/index.js +1 -21
  89. package/dist/runtime/types/utils.d.ts +7 -0
  90. package/dist/runtime/utils/date.d.ts +9 -0
  91. package/dist/runtime/utils/date.js +28 -0
  92. package/dist/runtime/utils/formatters.d.ts +2 -0
  93. package/dist/runtime/utils/formatters.js +8 -0
  94. package/dist/runtime/utils/index.d.ts +5 -2
  95. package/dist/runtime/utils/index.js +5 -2
  96. package/dist/runtime/utils/storage.d.ts +2 -0
  97. package/dist/runtime/utils/storage.js +10 -0
  98. package/dist/runtime/utils/table.d.ts +23 -0
  99. package/dist/runtime/utils/table.js +51 -0
  100. package/package.json +26 -25
  101. package/.nuxt/cms/button-clear.ts +0 -5
  102. package/.nuxt/cms/button-copy.ts +0 -5
  103. package/.nuxt/cms/button-delete.ts +0 -5
  104. package/.nuxt/cms/editor/callout.ts +0 -21
  105. package/.nuxt/cms/editor/uplora-image.ts +0 -5
  106. package/.nuxt/cms/editor-content-full.ts +0 -13
  107. package/.nuxt/cms/editor-content-light.ts +0 -13
  108. package/.nuxt/cms/input-seo.ts +0 -5
  109. package/.nuxt/cms/input-slug.ts +0 -5
  110. package/.nuxt/cms/input-uplora-image.ts +0 -22
  111. package/.nuxt/cms/table-cell-preview.ts +0 -9
  112. package/.nuxt/cms/table-cell-seo.ts +0 -5
  113. package/.nuxt/cms/table-cell-user.ts +0 -9
  114. package/.nuxt/cms/table-panel-column-sorting.ts +0 -5
  115. package/.nuxt/cms/table-panel-column-visibility.ts +0 -5
  116. package/.nuxt/cms/table-panel-filters.ts +0 -5
  117. package/dist/runtime/components/ButtonClear.vue +0 -35
  118. package/dist/runtime/components/ButtonClear.vue.d.ts +0 -35
  119. package/dist/runtime/components/ButtonCopy.vue +0 -40
  120. package/dist/runtime/components/ButtonCopy.vue.d.ts +0 -23
  121. package/dist/runtime/components/EditorContentFull.vue +0 -67
  122. package/dist/runtime/components/EditorContentFull.vue.d.ts +0 -23
  123. package/dist/runtime/components/EditorContentLight.vue +0 -60
  124. package/dist/runtime/components/EditorContentLight.vue.d.ts +0 -23
  125. package/dist/runtime/components/InputSeo.vue +0 -73
  126. package/dist/runtime/components/InputSeo.vue.d.ts +0 -19
  127. package/dist/runtime/components/InputSlug.vue +0 -70
  128. package/dist/runtime/components/InputSlug.vue.d.ts +0 -29
  129. package/dist/runtime/components/InputUploraImage.vue +0 -156
  130. package/dist/runtime/components/InputUploraImage.vue.d.ts +0 -38
  131. package/dist/runtime/components/TableCellPreview.vue +0 -41
  132. package/dist/runtime/components/TableCellPreview.vue.d.ts +0 -18
  133. package/dist/runtime/components/TableCellSeo.vue +0 -34
  134. package/dist/runtime/components/TableCellSeo.vue.d.ts +0 -13
  135. package/dist/runtime/components/TableCellUser.vue +0 -40
  136. package/dist/runtime/components/TableCellUser.vue.d.ts +0 -18
  137. package/dist/runtime/components/TablePanelColumnSorting.vue.d.ts +0 -20
  138. package/dist/runtime/components/TablePanelColumnVisibility.vue +0 -49
  139. package/dist/runtime/components/TablePanelColumnVisibility.vue.d.ts +0 -20
  140. package/dist/runtime/components/TablePanelFilters.vue +0 -79
  141. package/dist/runtime/components/TablePanelFilters.vue.d.ts +0 -34
  142. package/dist/runtime/composables/useDeleteConfirm.d.ts +0 -15
  143. package/dist/runtime/composables/useDeleteConfirm.js +0 -27
  144. package/dist/runtime/composables/useSeoStats.d.ts +0 -12
  145. package/dist/runtime/composables/useSeoStats.js +0 -44
  146. package/dist/runtime/editor/components/BlockMenu.vue +0 -43
  147. package/dist/runtime/editor/components/BlockMenu.vue.d.ts +0 -2
  148. package/dist/runtime/editor/components/SlashCommand.vue +0 -92
  149. package/dist/runtime/editor/components/SlashCommand.vue.d.ts +0 -7
  150. package/dist/runtime/editor/components/TooltipLink.vue +0 -81
  151. package/dist/runtime/editor/components/TooltipLink.vue.d.ts +0 -9
  152. package/dist/runtime/editor/components/TooltipMenu.vue +0 -75
  153. package/dist/runtime/editor/components/TooltipMenu.vue.d.ts +0 -9
  154. package/dist/runtime/editor/extensions/callout/CalloutView.vue +0 -85
  155. package/dist/runtime/editor/extensions/callout/CalloutView.vue.d.ts +0 -7
  156. package/dist/runtime/editor/extensions/callout/extension.d.ts +0 -13
  157. package/dist/runtime/editor/extensions/callout/extension.js +0 -48
  158. package/dist/runtime/editor/extensions/callout/index.d.ts +0 -2
  159. package/dist/runtime/editor/extensions/callout/index.js +0 -2
  160. package/dist/runtime/editor/extensions/callout/types.d.ts +0 -3
  161. package/dist/runtime/editor/extensions/index.d.ts +0 -26
  162. package/dist/runtime/editor/extensions/index.js +0 -85
  163. package/dist/runtime/editor/extensions/uplora-image/UploraImageView.vue +0 -29
  164. package/dist/runtime/editor/extensions/uplora-image/UploraImageView.vue.d.ts +0 -7
  165. package/dist/runtime/editor/extensions/uplora-image/extension.d.ts +0 -13
  166. package/dist/runtime/editor/extensions/uplora-image/extension.js +0 -60
  167. package/dist/runtime/editor/extensions/uplora-image/index.d.ts +0 -2
  168. package/dist/runtime/editor/extensions/uplora-image/index.js +0 -2
  169. package/dist/runtime/editor/extensions/uplora-image/types.d.ts +0 -5
  170. package/dist/runtime/editor/extensions/uplora-image/types.js +0 -0
  171. package/dist/runtime/editor/markdown/index.d.ts +0 -3
  172. package/dist/runtime/editor/markdown/index.js +0 -47
  173. package/dist/runtime/editor/markdown/nodes/callout.d.ts +0 -2
  174. package/dist/runtime/editor/markdown/nodes/callout.js +0 -21
  175. package/dist/runtime/editor/markdown/nodes/uploraImage.d.ts +0 -2
  176. package/dist/runtime/editor/markdown/nodes/uploraImage.js +0 -31
  177. package/dist/runtime/utils/dictionaries.d.ts +0 -4
  178. package/dist/runtime/utils/dictionaries.js +0 -6
  179. /package/.nuxt/cms/{autocomplete-select.ts → button-delete-confirm.ts} +0 -0
  180. /package/dist/runtime/{editor/extensions/callout/types.js → types/date.js} +0 -0
  181. /package/dist/runtime/utils/{image.d.ts → uplora.d.ts} +0 -0
  182. /package/dist/runtime/utils/{image.js → uplora.js} +0 -0
@@ -0,0 +1,28 @@
1
+ import { formatDate as format, normalizeDate } from "@vueuse/core";
2
+ export function getPeriod(beforeDays, afterDays = 0, fixTime = true) {
3
+ const start = /* @__PURE__ */ new Date();
4
+ start.setDate(start.getDate() - beforeDays);
5
+ fixTime && start.setHours(0, 0, 0, 0);
6
+ const end = /* @__PURE__ */ new Date();
7
+ end.setDate(end.getDate() + afterDays);
8
+ fixTime && end.setHours(23, 59, 59, 999);
9
+ return { start: formatServerDateTime(start), end: formatServerDateTime(end) };
10
+ }
11
+ export function getPeriodFromDaysAgo(days, fixTime = true) {
12
+ return getPeriod(days, 0, fixTime);
13
+ }
14
+ export function getCurrentDayPeriod() {
15
+ return getPeriodFromDaysAgo(0);
16
+ }
17
+ export function formatDateTime(date) {
18
+ return normalizeDate(date).toLocaleString("ru-RU");
19
+ }
20
+ export function formatDate(date) {
21
+ return normalizeDate(date).toLocaleDateString("ru-RU");
22
+ }
23
+ export function formatTime(date) {
24
+ return normalizeDate(date).toLocaleTimeString("ru-RU");
25
+ }
26
+ export function formatServerDateTime(date) {
27
+ return format(normalizeDate(date), "YYYY-MM-DD HH:mm:ss");
28
+ }
@@ -0,0 +1,2 @@
1
+ export declare function formatNumber(value: number): string;
2
+ export declare function formatBoolean(value: boolean | undefined | null): string;
@@ -0,0 +1,8 @@
1
+ export function formatNumber(value) {
2
+ return value.toLocaleString("ru-RU", {
3
+ style: "decimal"
4
+ });
5
+ }
6
+ export function formatBoolean(value) {
7
+ return value ? "\u0414\u0430" : "\u041D\u0435\u0442";
8
+ }
@@ -1,6 +1,9 @@
1
1
  export * from './avatar';
2
- export * from './dictionaries';
2
+ export * from './date';
3
3
  export * from './features';
4
- export * from './image';
4
+ export * from './formatters';
5
5
  export * from './logger';
6
6
  export * from './slugify';
7
+ export * from './storage';
8
+ export * from './table';
9
+ export * from './uplora';
@@ -1,6 +1,9 @@
1
1
  export * from "./avatar.js";
2
- export * from "./dictionaries.js";
2
+ export * from "./date.js";
3
3
  export * from "./features.js";
4
- export * from "./image.js";
4
+ export * from "./formatters.js";
5
5
  export * from "./logger.js";
6
6
  export * from "./slugify.js";
7
+ export * from "./storage.js";
8
+ export * from "./table.js";
9
+ export * from "./uplora.js";
@@ -0,0 +1,2 @@
1
+ export declare const getCmsStorageKey: (key: string) => string;
2
+ export declare function clearCmsStorage(): void;
@@ -0,0 +1,10 @@
1
+ import { kebabCase } from "scule";
2
+ const storagePrefix = "cms:";
3
+ export const getCmsStorageKey = (key) => `${storagePrefix}${kebabCase(key)}`;
4
+ export function clearCmsStorage() {
5
+ for (const key in localStorage) {
6
+ if (key.startsWith(storagePrefix)) {
7
+ localStorage.removeItem(key);
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,23 @@
1
+ import type { ButtonProps, FormSchema, TableColumn, TableData, TableRow } from '@nuxt/ui';
2
+ import type { RowData } from '@tanstack/table-core';
3
+ import type { RouteLocationRaw } from 'vue-router';
4
+ import type { FiltersField } from '../types';
5
+ declare module '@tanstack/table-core' {
6
+ interface ColumnMeta<TData extends RowData, TValue> {
7
+ headerLabel?: string;
8
+ }
9
+ }
10
+ export declare function createTableFiltersFields<S extends FormSchema, F extends readonly FiltersField<S>[]>(_schema: S, fields: F): {
11
+ -readonly [P in keyof F]: F[P];
12
+ };
13
+ export type TableColumnFormat = 'number' | 'date' | 'date-time';
14
+ export type TableColumnCustom<T extends TableData, D = unknown> = TableColumn<T, D> & {
15
+ format?: TableColumnFormat;
16
+ to?: ((row: TableRow<T>) => RouteLocationRaw | string | undefined) | RouteLocationRaw | string | undefined;
17
+ target?: ButtonProps['target'];
18
+ external?: boolean;
19
+ emptyValue?: string;
20
+ };
21
+ export declare function createTableColumns<I extends Record<string, any>, T extends readonly TableColumnCustom<I>[] = readonly TableColumnCustom<I>[]>(columns: T): {
22
+ -readonly [P in keyof T]: T[P];
23
+ };
@@ -0,0 +1,51 @@
1
+ import { UButton } from "#components";
2
+ import { h } from "vue";
3
+ import { formatDate, formatDateTime } from "./date.js";
4
+ import { formatNumber } from "./formatters.js";
5
+ export function createTableFiltersFields(_schema, fields) {
6
+ return fields;
7
+ }
8
+ function applyFormat(value, column) {
9
+ if (value === void 0 || value === null || !column.format) {
10
+ return value;
11
+ }
12
+ if (column.format === "number") {
13
+ return formatNumber(value);
14
+ }
15
+ if (column.format === "date") {
16
+ return value ? formatDate(value) : column.emptyValue;
17
+ }
18
+ if (column.format === "date-time") {
19
+ return value ? formatDateTime(value) : column.emptyValue;
20
+ }
21
+ return value;
22
+ }
23
+ function transformColumn(column) {
24
+ const col = {
25
+ ...column,
26
+ cell: column.cell ?? (({ getValue, row }) => {
27
+ const value = applyFormat(getValue(), column);
28
+ if (!value && typeof value !== "number") {
29
+ return void 0;
30
+ }
31
+ if (column.to) {
32
+ return h(UButton, {
33
+ to: typeof column.to === "function" ? column.to(row) : column.to,
34
+ external: column.external,
35
+ target: column.target,
36
+ label: value.toString(),
37
+ variant: "link",
38
+ class: "px-0"
39
+ });
40
+ }
41
+ return value;
42
+ })
43
+ };
44
+ if (column.format === "number") {
45
+ col.meta = { ...col.meta, class: { td: "text-right tabular-nums", th: "text-right tabular-nums" } };
46
+ }
47
+ return col;
48
+ }
49
+ export function createTableColumns(columns) {
50
+ return columns.map((c) => transformColumn(c));
51
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hywax/cms",
3
3
  "type": "module",
4
- "version": "0.0.23",
4
+ "version": "1.1.0",
5
5
  "description": "Hywax CMS. ⚠️ This package is intended for internal use only.",
6
6
  "repository": {
7
7
  "type": "git",
@@ -55,45 +55,46 @@
55
55
  "dist"
56
56
  ],
57
57
  "dependencies": {
58
- "@dicebear/collection": "^9.2.3",
59
- "@dicebear/core": "^9.2.3",
60
- "@iconify-json/lucide": "1.2.52",
61
- "@nuxt/kit": "^3.17.5",
62
- "@nuxt/ui-pro": "^3.1.3",
63
- "@nuxtjs/mdc": "^0.17.0",
64
- "@sindresorhus/slugify": "^2.2.1",
65
- "@unpress/mdc-prosemirror": "0.1.12-beta.2",
58
+ "@dicebear/collection": "^9.2.4",
59
+ "@dicebear/core": "^9.2.4",
60
+ "@iconify-json/lucide": "1.2.82",
61
+ "@nuxt/kit": "^4.2.2",
62
+ "@nuxt/ui": "^4.3.0",
63
+ "@nuxtjs/mdc": "^0.19.2",
64
+ "@sindresorhus/slugify": "^3.0.0",
66
65
  "@uplora/formats": "^0.1.0",
67
66
  "@uplora/serializer": "^0.1.3",
68
- "@vueuse/nuxt": "^13.4.0",
67
+ "@vueuse/nuxt": "^14.1.0",
69
68
  "consola": "^3.4.2",
70
69
  "defu": "^6.1.4",
70
+ "fast-copy": "^3.0.2",
71
71
  "fast-equals": "^5.2.2",
72
- "nuxt-auth-utils": "^0.5.20",
72
+ "nuxt-auth-utils": "^0.5.26",
73
73
  "pathe": "^2.0.3",
74
- "prosekit": "^0.13.6",
75
74
  "scule": "^1.3.0",
76
- "zod": "^3.25.67"
75
+ "sortablejs": "^1.15.6",
76
+ "zod": "^4.2.1"
77
77
  },
78
78
  "devDependencies": {
79
- "@antfu/eslint-config": "^4.16.1",
80
- "@commitlint/cli": "^19.8.1",
81
- "@commitlint/config-conventional": "^19.8.1",
82
- "@nuxt/devtools": "^2.5.0",
83
- "@nuxt/module-builder": "^1.0.1",
84
- "@nuxt/schema": "^3.17.5",
85
- "@nuxt/test-utils": "^3.19.1",
86
- "@types/node": "^22.15.32",
79
+ "@antfu/eslint-config": "^5.4.1",
80
+ "@commitlint/cli": "^20.2.0",
81
+ "@commitlint/config-conventional": "^20.2.0",
82
+ "@nuxt/devtools": "^3.1.1",
83
+ "@nuxt/module-builder": "^1.0.2",
84
+ "@nuxt/schema": "^4.2.2",
85
+ "@nuxt/test-utils": "^3.21.0",
86
+ "@types/node": "^24.10.4",
87
+ "@types/sortablejs": "^1.15.9",
87
88
  "@vue/test-utils": "^2.4.6",
88
89
  "changelogen": "^0.6.1",
89
- "eslint": "^9.29.0",
90
- "happy-dom": "^18.0.1",
90
+ "eslint": "^9.39.2",
91
+ "happy-dom": "^20.0.11",
91
92
  "husky": "^9.1.7",
92
93
  "lint-staged": "^16.1.2",
93
- "nuxt": "^3.17.5",
94
+ "nuxt": "^4.2.2",
94
95
  "typescript": "^5.8.3",
95
96
  "vitest": "^3.2.4",
96
- "vue-tsc": "^2.2.10"
97
+ "vue-tsc": "^3.2.1"
97
98
  },
98
99
  "resolutions": {
99
100
  "@hywax/cms": "workspace:*"
@@ -1,5 +0,0 @@
1
- export default {
2
- "slots": {
3
- "base": "p-0"
4
- }
5
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": ""
4
- }
5
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": ""
4
- }
5
- }
@@ -1,21 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": "px-4 py-3 text-sm/6 rounded-md border flex gap-2"
4
- },
5
- "variants": {
6
- "type": {
7
- "caution": {
8
- "root": "border border-error/25 bg-error/10 text-error-600 dark:text-error-300"
9
- },
10
- "note": {
11
- "root": "border border-info/25 bg-info/10 text-info-600 dark:text-info-300"
12
- },
13
- "warning": {
14
- "root": "border border-warning/25 bg-warning/10 text-warning-600 dark:text-warning-300"
15
- },
16
- "tip": {
17
- "root": "border border-success/25 bg-success/10 text-success-600 dark:text-success-300"
18
- }
19
- }
20
- }
21
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": ""
4
- }
5
- }
@@ -1,13 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": "h-full w-full relative",
4
- "editor": "min-h-full w-full focus:outline-none editor-content-full relative"
5
- },
6
- "variants": {
7
- "disabled": {
8
- "true": {
9
- "root": "cursor-not-allowed opacity-75"
10
- }
11
- }
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": "relative",
4
- "editor": "w-full focus:outline-none editor-content-light relative"
5
- },
6
- "variants": {
7
- "disabled": {
8
- "true": {
9
- "root": "cursor-not-allowed opacity-75"
10
- }
11
- }
12
- }
13
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": "flex flex-col gap-4"
4
- }
5
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": "flex flex-col gap-4"
4
- }
5
- }
@@ -1,22 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": "relative w-full rounded-md overflow-hidden ring ring-inset ring-accented aspect-3/2 text-sm",
4
- "image": "",
5
- "imageActions": "absolute top-4 right-4 flex gap-2",
6
- "uploader": "flex flex-col items-center justify-center w-full h-full p-4",
7
- "uploaderPendingIcon": "size-6 animate-spin",
8
- "uploaderIdleButton": "cursor-pointer bg-muted/50 border border-default border-dashed rounded-md h-full w-full",
9
- "uploaderIdleIcon": "size-10 text-primary",
10
- "uploaderIdleText": "mt-2 font-medium",
11
- "uploaderIdleExtensions": "mt-2 text-xs text-muted uppercase",
12
- "uploaderErrorText": "text-center font-medium",
13
- "uploaderErrorActions": "flex gap-2 mt-4"
14
- },
15
- "variants": {
16
- "disabled": {
17
- "true": {
18
- "root": "cursor-not-allowed opacity-75"
19
- }
20
- }
21
- }
22
- }
@@ -1,9 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": "flex items-center gap-2",
4
- "image": "bg-elevated size-7 rounded-md",
5
- "container": "text-xs",
6
- "title": "font-medium text-default",
7
- "description": "text-muted truncate max-w-40"
8
- }
9
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": "flex gap-2"
4
- }
5
- }
@@ -1,9 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": "flex items-center gap-2",
4
- "avatar": "bg-elevated size-7 rounded-full",
5
- "container": "text-xs",
6
- "name": "font-medium text-default",
7
- "description": "text-muted truncate max-w-40"
8
- }
9
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": ""
4
- }
5
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": ""
4
- }
5
- }
@@ -1,5 +0,0 @@
1
- export default {
2
- "slots": {
3
- "root": ""
4
- }
5
- }
@@ -1,35 +0,0 @@
1
- <template>
2
- <UButton
3
- :class="ui.base({ class: [props.ui?.base, props.class] })"
4
- :color="color"
5
- :variant="variant"
6
- :size="size"
7
- :icon="icon || appConfig.ui.icons.close"
8
- :aria-label="label"
9
- :disabled="!modelValue"
10
- @click.stop="emit('update:modelValue', resetValue)"
11
- />
12
- </template>
13
-
14
- <script>
15
- import theme from "#build/cms/button-clear";
16
- import { computed, useAppConfig } from "#imports";
17
- import { tv } from "../tv";
18
- </script>
19
-
20
- <script setup>
21
- const props = defineProps({
22
- icon: { type: String, required: false },
23
- label: { type: String, required: false, default: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435" },
24
- color: { type: null, required: false, default: "neutral" },
25
- variant: { type: null, required: false, default: "link" },
26
- size: { type: null, required: false, default: "sm" },
27
- resetValue: { type: [String, Number, Boolean, null], required: false, skipCheck: true, default: void 0 },
28
- class: { type: null, required: false },
29
- ui: { type: null, required: false }
30
- });
31
- const emit = defineEmits(["update:modelValue"]);
32
- const modelValue = defineModel({ type: [String, Number, Boolean, null], skipCheck: true });
33
- const appConfig = useAppConfig();
34
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.buttonClear || {} })());
35
- </script>
@@ -1,35 +0,0 @@
1
- import type { AppConfig } from '@nuxt/schema';
2
- import type { ButtonProps } from '@nuxt/ui';
3
- import type { ComponentConfig } from '../types';
4
- import theme from '#build/cms/button-clear';
5
- export type ButtonClear = ComponentConfig<typeof theme, AppConfig, 'buttonClear'>;
6
- export type ResetValue = string | number | boolean | null | undefined;
7
- export interface ButtonClearProps {
8
- icon?: string;
9
- label?: string;
10
- color?: ButtonProps['color'];
11
- variant?: ButtonProps['variant'];
12
- size?: ButtonProps['size'];
13
- resetValue?: ResetValue;
14
- class?: any;
15
- ui?: ButtonClear['slots'];
16
- }
17
- export interface ButtonClearEmits {
18
- 'update:modelValue': [ResetValue];
19
- }
20
- declare const _default: import("vue").DefineComponent<ButtonClearProps & {
21
- modelValue?: ResetValue;
22
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
- "update:modelValue": (...args: unknown[]) => any;
24
- }, string, import("vue").PublicProps, Readonly<ButtonClearProps & {
25
- modelValue?: ResetValue;
26
- }> & Readonly<{
27
- "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
28
- }>, {
29
- size: "xs" | "sm" | "md" | "lg" | "xl";
30
- color: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral";
31
- variant: "solid" | "outline" | "soft" | "subtle" | "ghost" | "link";
32
- label: string;
33
- resetValue: string | number | boolean | null;
34
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
- export default _default;
@@ -1,40 +0,0 @@
1
- <template>
2
- <UTooltip
3
- :text="tooltipText"
4
- :content="{ side: 'top' }"
5
- disable-hoverable-content
6
- disable-closing-trigger
7
- >
8
- <UButton
9
- :icon="copied ? appConfig.ui.icons.copyCheck : appConfig.ui.icons.copy"
10
- :color="color"
11
- :variant="variant"
12
- :size="size"
13
- :class="ui.root({ class: [props.ui?.root, props.class] })"
14
- @click="copy(value)"
15
- />
16
- </UTooltip>
17
- </template>
18
-
19
- <script>
20
- import theme from "#build/cms/button-copy";
21
- import { computed, useAppConfig, useClipboard } from "#imports";
22
- import { tv } from "../tv";
23
- </script>
24
-
25
- <script setup>
26
- const props = defineProps({
27
- label: { type: String, required: false, default: "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C" },
28
- copiedLabel: { type: String, required: false, default: "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E" },
29
- value: { type: String, required: true },
30
- color: { type: null, required: false, default: "neutral" },
31
- variant: { type: null, required: false, default: "link" },
32
- size: { type: null, required: false, default: "sm" },
33
- class: { type: null, required: false },
34
- ui: { type: null, required: false }
35
- });
36
- const appConfig = useAppConfig();
37
- const { copy, copied } = useClipboard();
38
- const tooltipText = computed(() => copied.value ? props.copiedLabel : props.label);
39
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.buttonCopy || {} })());
40
- </script>
@@ -1,23 +0,0 @@
1
- import type { AppConfig } from '@nuxt/schema';
2
- import type { ButtonProps } from '@nuxt/ui';
3
- import type { ComponentConfig } from '../types';
4
- import theme from '#build/cms/button-copy';
5
- type ButtonCopy = ComponentConfig<typeof theme, AppConfig, 'buttonCopy'>;
6
- export interface ButtonCopyProps {
7
- label?: string;
8
- copiedLabel?: string;
9
- value: string;
10
- color?: ButtonProps['color'];
11
- variant?: ButtonProps['variant'];
12
- size?: ButtonProps['size'];
13
- class?: any;
14
- ui?: ButtonCopy['slots'];
15
- }
16
- declare const _default: import("vue").DefineComponent<ButtonCopyProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonCopyProps> & Readonly<{}>, {
17
- size: "xs" | "sm" | "md" | "lg" | "xl";
18
- color: "primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral";
19
- variant: "solid" | "outline" | "soft" | "subtle" | "ghost" | "link";
20
- label: string;
21
- copiedLabel: string;
22
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
- export default _default;
@@ -1,67 +0,0 @@
1
- <template>
2
- <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
3
- <ProseKit :editor="editor">
4
- <div
5
- :id="id"
6
- ref="editorRef"
7
- :class="ui.editor({ class: [props.ui?.editor, 'pl-14'] })"
8
- v-bind="ariaAttrs"
9
- />
10
-
11
- <BlockMenu />
12
- <SlashCommand />
13
- <TooltipMenu />
14
- </ProseKit>
15
- </Primitive>
16
- </template>
17
-
18
- <script>
19
- import theme from "#build/cms/editor-content-full";
20
- import { computed, useAppConfig, useFormField, useId, useTemplateRef, watchPostEffect } from "#imports";
21
- import { createEditor } from "prosekit/core";
22
- import { ProseKit, useDocChange } from "prosekit/vue";
23
- import { Primitive } from "reka-ui";
24
- import BlockMenu from "../editor/components/BlockMenu.vue";
25
- import SlashCommand from "../editor/components/SlashCommand.vue";
26
- import TooltipMenu from "../editor/components/TooltipMenu.vue";
27
- import { defineFullExtension } from "../editor/extensions";
28
- import { docToMarkdown, markdownToDoc } from "../editor/markdown";
29
- import { tv } from "../tv";
30
- import "prosekit/basic/style.css";
31
- </script>
32
-
33
- <script setup>
34
- const props = defineProps({
35
- id: { type: String, required: false },
36
- name: { type: String, required: false },
37
- disabled: { type: Boolean, required: false },
38
- as: { type: null, required: false },
39
- class: { type: null, required: false },
40
- ui: { type: null, required: false }
41
- });
42
- const modelValue = defineModel({ type: String, ...{ default: "" } });
43
- const appConfig = useAppConfig();
44
- const editor = createEditor({
45
- extension: defineFullExtension(),
46
- defaultContent: await markdownToDoc(modelValue.value)
47
- });
48
- const editorRef = useTemplateRef("editorRef");
49
- const { id: _id, disabled, emitFormChange, emitFormInput, ariaAttrs } = useFormField(props);
50
- const id = _id.value ?? useId();
51
- useDocChange(async () => {
52
- modelValue.value = await docToMarkdown(editor.getDocJSON());
53
- emitFormChange();
54
- emitFormInput();
55
- }, { editor });
56
- watchPostEffect((onCleanup) => {
57
- editor.mount(editorRef.value);
58
- onCleanup(() => editor.unmount());
59
- });
60
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.editorContentFull || {} })({
61
- disabled: disabled.value
62
- }));
63
- </script>
64
-
65
- <style scoped>
66
- ::v-deep(.editor-content-full){line-height:calc(var(--spacing)*7)}::v-deep(.editor-content-full) [data-placeholder]:before{color:var(--ui-text-dimmed);content:attr(data-placeholder);height:0;pointer-events:none;position:absolute}::v-deep(.editor-content-full) h2,::v-deep(.editor-content-full) h3,::v-deep(.editor-content-full) h4{font-weight:600;margin-block:calc(var(--spacing)*5)}::v-deep(.editor-content-full) h2{font-size:var(--text-2xl)}::v-deep(.editor-content-full) h3{font-size:var(--text-xl)}::v-deep(.editor-content-full) h4{font-size:var(--text-lg)}::v-deep(.editor-content-full) blockquote{border-left:4px solid var(--ui-border-accented);margin-block:calc(var(--spacing)*4);padding-inline-start:calc(var(--spacing)*4)}::v-deep(.editor-content-full) [data-node-view-root=true],::v-deep(.editor-content-full)>p{margin-block:calc(var(--spacing)*5)}::v-deep(.editor-content-full) hr{border-block-start:1px solid var(--ui-border);margin-block:calc(var(--spacing)*5)}::v-deep(.editor-content-full) pre{background-color:var(--ui-bg-muted);border:1px solid var(--ui-border-muted);border-radius:calc(var(--ui-radius)*1.5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:calc(var(--spacing)*6);overflow-x:auto;padding-block:calc(var(--spacing)*3);padding-inline:calc(var(--spacing)*4)}::v-deep(.editor-content-full) p>code{background-color:var(--ui-bg-muted);border:1px solid var(--ui-border-muted);border-radius:calc(var(--ui-radius)*1.5);font-family:var(--font-mono);font-size:var(--text-sm);padding-inline:var(--spacing)}::v-deep(.editor-content-full) a{color:var(--ui-primary);cursor:pointer;text-decoration:underline;-webkit-user-select:all;-moz-user-select:all;user-select:all}
67
- </style>
@@ -1,23 +0,0 @@
1
- import type { AppConfig } from '@nuxt/schema';
2
- import type { ComponentConfig } from '../types';
3
- import theme from '#build/cms/editor-content-full';
4
- import 'prosekit/basic/style.css';
5
- type EditorContentFull = ComponentConfig<typeof theme, AppConfig, 'editorContentFull'>;
6
- export interface EditorContentFullProps {
7
- id?: string;
8
- name?: string;
9
- disabled?: boolean;
10
- as?: any;
11
- class?: any;
12
- ui?: EditorContentFull['slots'];
13
- }
14
- declare const _default: import("vue").DefineComponent<EditorContentFullProps & {
15
- modelValue?: string;
16
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
- "update:modelValue": (value: string) => any;
18
- }, string, import("vue").PublicProps, Readonly<EditorContentFullProps & {
19
- modelValue?: string;
20
- }> & Readonly<{
21
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
22
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
- export default _default;