@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
@@ -1,60 +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 })"
8
- v-bind="ariaAttrs"
9
- />
10
- </ProseKit>
11
- </Primitive>
12
- </template>
13
-
14
- <script>
15
- import theme from "#build/cms/editor-content-light";
16
- import { computed, useAppConfig, useFormField, useId, useTemplateRef, watchPostEffect } from "#imports";
17
- import { createEditor } from "prosekit/core";
18
- import { ProseKit, useDocChange } from "prosekit/vue";
19
- import { Primitive } from "reka-ui";
20
- import { defineLightExtension } from "../editor/extensions";
21
- import { docToMarkdown, markdownToDoc } from "../editor/markdown";
22
- import { tv } from "../tv";
23
- import "prosekit/basic/style.css";
24
- </script>
25
-
26
- <script setup>
27
- const props = defineProps({
28
- id: { type: String, required: false },
29
- name: { type: String, required: false },
30
- disabled: { type: Boolean, required: false },
31
- as: { type: null, required: false },
32
- class: { type: null, required: false },
33
- ui: { type: null, required: false }
34
- });
35
- const modelValue = defineModel({ type: String, ...{ default: "" } });
36
- const appConfig = useAppConfig();
37
- const editor = createEditor({
38
- extension: defineLightExtension(),
39
- defaultContent: await markdownToDoc(modelValue.value)
40
- });
41
- const editorRef = useTemplateRef("editorRef");
42
- const { id: _id, disabled, emitFormChange, emitFormInput, ariaAttrs } = useFormField(props);
43
- const id = _id.value ?? useId();
44
- useDocChange(async () => {
45
- modelValue.value = await docToMarkdown(editor.getDocJSON());
46
- emitFormChange();
47
- emitFormInput();
48
- }, { editor });
49
- watchPostEffect((onCleanup) => {
50
- editor.mount(editorRef.value);
51
- onCleanup(() => editor.unmount());
52
- });
53
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.editorContentLight || {} })({
54
- disabled: disabled.value
55
- }));
56
- </script>
57
-
58
- <style scoped>
59
- ::v-deep(.editor-content-light){line-height:calc(var(--spacing)*7)}::v-deep(.editor-content-light) [data-placeholder]:before{color:var(--ui-text-dimmed);content:attr(data-placeholder);height:0;pointer-events:none;position:absolute}::v-deep(.editor-content-light) 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-light) [data-node-view-root=true],::v-deep(.editor-content-light)>p{margin-block:calc(var(--spacing)*5)}::v-deep(.editor-content-light) 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-light) 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-light) a{color:var(--ui-primary);cursor:pointer;text-decoration:underline;-webkit-user-select:all;-moz-user-select:all;user-select:all}
60
- </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-light';
4
- import 'prosekit/basic/style.css';
5
- type EditorContentLight = ComponentConfig<typeof theme, AppConfig, 'editorContentLight'>;
6
- export interface EditorContentLightProps {
7
- id?: string;
8
- name?: string;
9
- disabled?: boolean;
10
- as?: any;
11
- class?: any;
12
- ui?: EditorContentLight['slots'];
13
- }
14
- declare const _default: import("vue").DefineComponent<EditorContentLightProps & {
15
- modelValue?: string;
16
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
- "update:modelValue": (value: string) => any;
18
- }, string, import("vue").PublicProps, Readonly<EditorContentLightProps & {
19
- modelValue?: string;
20
- }> & Readonly<{
21
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
22
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
- export default _default;
@@ -1,73 +0,0 @@
1
- <template>
2
- <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
3
- <UFormField
4
- name="seo.title"
5
- label="Заголовок"
6
- :hint="`${model.title.length}/60`"
7
- :ui="{ hint: 'text-xs' }"
8
- >
9
- <UInput v-model="model.title" placeholder="Введите заголовок..." class="w-full" />
10
-
11
- <template #help>
12
- <p class="text-xs mb-2">
13
- Рекомендуемая длина: 45-60 символов
14
- </p>
15
- <UProgress
16
- :model-value="title.progress"
17
- :color="title.color"
18
- size="sm"
19
- />
20
- </template>
21
- </UFormField>
22
-
23
- <UFormField
24
- name="seo.description"
25
- label="Описание"
26
- :hint="`${model.description.length}/160`"
27
- :ui="{ hint: 'text-xs' }"
28
- >
29
- <UTextarea
30
- v-model="model.description"
31
- placeholder="Введите описание..."
32
- class="w-full"
33
- autoresize
34
- />
35
-
36
- <template #help>
37
- <p class="text-xs mb-2">
38
- Рекомендуемая длина: 130-160 символов
39
- </p>
40
- <UProgress
41
- :model-value="description.progress"
42
- :color="description.color"
43
- size="sm"
44
- />
45
- </template>
46
- </UFormField>
47
- </Primitive>
48
- </template>
49
-
50
- <script>
51
- import theme from "#build/cms/input-seo";
52
- import { computed, useAppConfig } from "#imports";
53
- import { Primitive } from "reka-ui";
54
- import { useSeoStats } from "../composables/useSeoStats";
55
- import { tv } from "../tv";
56
- </script>
57
-
58
- <script setup>
59
- const props = defineProps({
60
- as: { type: null, required: false },
61
- class: { type: null, required: false },
62
- ui: { type: null, required: false }
63
- });
64
- const model = defineModel({ type: Object, ...{
65
- default: () => ({
66
- title: "",
67
- description: ""
68
- })
69
- } });
70
- const appConfig = useAppConfig();
71
- const { title, description } = useSeoStats(model);
72
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.inputSeo || {} })());
73
- </script>
@@ -1,19 +0,0 @@
1
- import type { AppConfig } from '@nuxt/schema';
2
- import type { ComponentConfig, SEO } from '../types';
3
- import theme from '#build/cms/input-seo';
4
- type InputSeo = ComponentConfig<typeof theme, AppConfig, 'inputSeo'>;
5
- export interface InputSeoProps {
6
- as?: any;
7
- class?: any;
8
- ui?: InputSeo['slots'];
9
- }
10
- declare const _default: import("vue").DefineComponent<InputSeoProps & {
11
- modelValue?: SEO;
12
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
- "update:modelValue": (value: SEO) => any;
14
- }, string, import("vue").PublicProps, Readonly<InputSeoProps & {
15
- modelValue?: SEO;
16
- }> & Readonly<{
17
- "onUpdate:modelValue"?: ((value: SEO) => any) | undefined;
18
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
- export default _default;
@@ -1,70 +0,0 @@
1
- <template>
2
- <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
3
- <UFormField
4
- :label="label"
5
- :name="titleKey"
6
- >
7
- <UInput
8
- v-model="title"
9
- v-bind="inputProps"
10
- class="w-full"
11
- />
12
- </UFormField>
13
- <UFormField :name="slugKey" class="-mt-3" eager-validation>
14
- <UInput
15
- v-model="slug"
16
- class="w-full"
17
- size="xs"
18
- variant="none"
19
- :placeholder="isRegenerate ? '\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A' : '\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043B\u0430\u0433'"
20
- :disabled="isRegenerate"
21
- :ui="{
22
- base: 'text-muted'
23
- }"
24
- >
25
- <template #leading>
26
- <UButton
27
- size="xs"
28
- variant="link"
29
- :icon="appConfig.ui.icons.link"
30
- class="p-0"
31
- :color="isRegenerate ? 'success' : 'neutral'"
32
- @click="isRegenerate = !isRegenerate"
33
- />
34
- </template>
35
- </UInput>
36
- </UFormField>
37
- </Primitive>
38
- </template>
39
-
40
- <script>
41
- import theme from "#build/cms/input-slug";
42
- import { computed, ref, useAppConfig, watch } from "#imports";
43
- import { Primitive } from "reka-ui";
44
- import { tv } from "../tv";
45
- import { slugify } from "../utils/slugify";
46
- </script>
47
-
48
- <script setup>
49
- const props = defineProps({
50
- regenerate: { type: Boolean, required: false },
51
- label: { type: String, required: false },
52
- titleKey: { type: String, required: false },
53
- slugKey: { type: String, required: false },
54
- inputProps: { type: Object, required: false },
55
- as: { type: null, required: false },
56
- class: { type: null, required: false },
57
- ui: { type: null, required: false }
58
- });
59
- const title = defineModel("title", { type: String });
60
- const slug = defineModel("slug", { type: String });
61
- const appConfig = useAppConfig();
62
- const isRegenerate = ref(props.regenerate);
63
- watch(title, () => {
64
- if (!isRegenerate.value) {
65
- return;
66
- }
67
- slug.value = slugify(title.value);
68
- });
69
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.inputSlug || {} })());
70
- </script>
@@ -1,29 +0,0 @@
1
- import type { AppConfig } from '@nuxt/schema';
2
- import type { InputProps } from '@nuxt/ui';
3
- import type { ComponentConfig } from '../types';
4
- import theme from '#build/cms/input-slug';
5
- type InputSlug = ComponentConfig<typeof theme, AppConfig, 'inputSlug'>;
6
- export interface InputSlugProps {
7
- regenerate?: boolean;
8
- label?: string;
9
- titleKey?: string;
10
- slugKey?: string;
11
- inputProps?: Omit<InputProps, 'modelModifiers'>;
12
- as?: any;
13
- class?: any;
14
- ui?: InputSlug['slots'];
15
- }
16
- declare const _default: import("vue").DefineComponent<InputSlugProps & {
17
- title?: string;
18
- slug?: string;
19
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
- "update:title": (value: string | undefined) => any;
21
- "update:slug": (value: string | undefined) => any;
22
- }, string, import("vue").PublicProps, Readonly<InputSlugProps & {
23
- title?: string;
24
- slug?: string;
25
- }> & Readonly<{
26
- "onUpdate:title"?: ((value: string | undefined) => any) | undefined;
27
- "onUpdate:slug"?: ((value: string | undefined) => any) | undefined;
28
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
- export default _default;
@@ -1,156 +0,0 @@
1
- <template>
2
- <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
3
- <template v-if="modelValue.image">
4
- <UploraImage
5
- :image="modelValue.image"
6
- :alt="modelValue.alt"
7
- :lqip="modelValue.lqip"
8
- :class="ui.image({ class: [props.ui?.image] })"
9
- />
10
-
11
- <div :class="ui.imageActions({ class: [props.ui?.imageActions] })">
12
- <UBadge
13
- v-if="!modelValue.alt"
14
- label="Alt"
15
- color="error"
16
- :icon="appConfig.ui.icons.warning"
17
- />
18
-
19
- <ButtonDelete
20
- :icon="appConfig.ui.icons.trash"
21
- color="neutral"
22
- size="sm"
23
- @confirm="deleteExecute(modelValue.image)"
24
- />
25
-
26
- <UPopover
27
- :ui="{ content: 'p-2' }"
28
- :content="{ align: 'end', side: 'bottom', sideOffset: 8 }"
29
- @update:open="syncState"
30
- >
31
- <UButton :icon="appConfig.ui.icons.ellipsisVertical" color="neutral" size="sm" />
32
-
33
- <template #content>
34
- <UFormField label="Описание изображения">
35
- <UTextarea
36
- v-model="state.alt"
37
- placeholder="Введите описание..."
38
- autoresize
39
- />
40
- </UFormField>
41
- </template>
42
- </UPopover>
43
- </div>
44
- </template>
45
- <div v-else :id="id" :class="ui.uploader({ class: [props.ui?.uploader] })">
46
- <template v-if="uploadStatus === 'pending'">
47
- <UIcon :name="appConfig.ui.icons.loading" :class="ui.uploaderPendingIcon({ class: [props.ui?.uploaderPendingIcon] })" />
48
- </template>
49
- <template v-else-if="uploadStatus === 'idle'">
50
- <button
51
- type="button"
52
- :class="ui.uploaderIdleButton({ class: [props.ui?.uploaderIdleButton] })"
53
- :disabled="disabled"
54
- v-bind="ariaAttrs"
55
- @click="open"
56
- >
57
- <UIcon :name="appConfig.ui.icons.imageUp" :class="ui.uploaderIdleIcon({ class: [props.ui?.uploaderIdleIcon] })" />
58
- <p :class="ui.uploaderIdleText({ class: [props.ui?.uploaderIdleText] })">
59
- Нажмите, чтобы загрузить изображение
60
- </p>
61
- <p v-if="props.showExtensions" :class="ui.uploaderIdleExtensions({ class: [props.ui?.uploaderIdleExtensions] })">
62
- {{ imagesExtensions.join(", ") }}
63
- </p>
64
- </button>
65
- </template>
66
- <template v-else-if="uploadStatus === 'error'">
67
- <p :class="ui.uploaderErrorText({ class: [props.ui?.uploaderErrorText] })">
68
- Произошла ошибка при загрузке изображения
69
- </p>
70
- <div :class="ui.uploaderErrorActions({ class: [props.ui?.uploaderErrorActions] })">
71
- <UButton
72
- label="Отменить"
73
- variant="ghost"
74
- color="neutral"
75
- @click="resetUpload"
76
- />
77
- <UButton
78
- label="Повторить"
79
- variant="soft"
80
- color="neutral"
81
- @click="uploadExecute"
82
- />
83
- </div>
84
- </template>
85
- </div>
86
- </Primitive>
87
- </template>
88
-
89
- <script>
90
- import theme from "#build/cms/input-uplora-image";
91
- import { computed, reactive, useAppConfig, useFormField, useId } from "#imports";
92
- import { imagesExtensions } from "@uplora/formats";
93
- import { Primitive } from "reka-ui";
94
- import { useUploraDelete, useUploraUpload } from "../composables/useUplora";
95
- import { tv } from "../tv";
96
- import ButtonDelete from "./ButtonDelete.vue";
97
- import UploraImage from "./UploraImage.vue";
98
- </script>
99
-
100
- <script setup>
101
- const props = defineProps({
102
- showExtensions: { type: Boolean, required: false, default: true },
103
- id: { type: String, required: false },
104
- name: { type: String, required: false },
105
- disabled: { type: Boolean, required: false },
106
- as: { type: null, required: false },
107
- class: { type: null, required: false },
108
- ui: { type: null, required: false }
109
- });
110
- const emit = defineEmits(["upload", "delete"]);
111
- const modelValue = defineModel({ type: Object, ...{
112
- default: () => ({
113
- image: "",
114
- alt: ""
115
- })
116
- } });
117
- const appConfig = useAppConfig();
118
- const state = reactive({
119
- alt: modelValue.value.alt
120
- });
121
- const { id: _id, disabled, emitFormChange, emitFormInput, ariaAttrs } = useFormField(props);
122
- const id = _id.value ?? useId();
123
- const { open, execute: uploadExecute, status: uploadStatus, reset: resetUpload, onUploaded } = useUploraUpload({
124
- accept: "image/*"
125
- });
126
- const { execute: deleteExecute, onDeleted } = useUploraDelete();
127
- onUploaded((file) => {
128
- modelValue.value = {
129
- ...modelValue.value,
130
- image: file.id,
131
- lqip: file.lqip
132
- };
133
- emit("upload", modelValue.value);
134
- emitFormChange();
135
- emitFormInput();
136
- });
137
- onDeleted(() => {
138
- resetUpload();
139
- modelValue.value = {
140
- image: "",
141
- alt: ""
142
- };
143
- emit("delete");
144
- emitFormChange();
145
- emitFormInput();
146
- });
147
- function syncState() {
148
- modelValue.value = {
149
- ...modelValue.value,
150
- alt: state.alt
151
- };
152
- }
153
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.inputUploraImage || {} })({
154
- disabled: disabled.value
155
- }));
156
- </script>
@@ -1,38 +0,0 @@
1
- import type { AppConfig } from '@nuxt/schema';
2
- import type { ComponentConfig } from '../types';
3
- import theme from '#build/cms/input-uplora-image';
4
- type InputUploraImage = ComponentConfig<typeof theme, AppConfig, 'inputUploraImage'>;
5
- export interface InputUploraImageProps {
6
- showExtensions?: boolean;
7
- id?: string;
8
- name?: string;
9
- disabled?: boolean;
10
- as?: any;
11
- class?: any;
12
- ui?: InputUploraImage['slots'];
13
- }
14
- export interface InputUploraImageEmits {
15
- upload: [InputUploraImageModelValue];
16
- delete: [];
17
- }
18
- export interface InputUploraImageModelValue {
19
- image: string;
20
- alt: string;
21
- lqip?: string;
22
- }
23
- declare const _default: import("vue").DefineComponent<InputUploraImageProps & {
24
- modelValue?: InputUploraImageModelValue;
25
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
- "update:modelValue": (value: InputUploraImageModelValue) => any;
27
- delete: () => any;
28
- upload: (args_0: InputUploraImageModelValue) => any;
29
- }, string, import("vue").PublicProps, Readonly<InputUploraImageProps & {
30
- modelValue?: InputUploraImageModelValue;
31
- }> & Readonly<{
32
- "onUpdate:modelValue"?: ((value: InputUploraImageModelValue) => any) | undefined;
33
- onDelete?: (() => any) | undefined;
34
- onUpload?: ((args_0: InputUploraImageModelValue) => any) | undefined;
35
- }>, {
36
- showExtensions: boolean;
37
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
- export default _default;
@@ -1,41 +0,0 @@
1
- <template>
2
- <ULink :to="to" :class="ui.root({ class: [props.ui?.root, props.class] })">
3
- <UploraImage
4
- v-if="thumbnail"
5
- :image="thumbnail.image"
6
- :alt="title"
7
- :lqip="thumbnail.lqip"
8
- :sizes="[{ width: 30, height: 30, descriptor: '1x' }]"
9
- :ui="{ picture: 'aspect-square' }"
10
- :class="ui.image({ class: props.ui?.image })"
11
- />
12
- <div :class="ui.container({ class: props.ui?.container })">
13
- <p :class="ui.title({ class: props.ui?.title })">
14
- {{ title }}
15
- </p>
16
- <p v-if="description" :class="ui.description({ class: props.ui?.description })">
17
- {{ description }}
18
- </p>
19
- </div>
20
- </ULink>
21
- </template>
22
-
23
- <script>
24
- import theme from "#build/cms/table-cell-preview";
25
- import { computed, useAppConfig } from "#imports";
26
- import { tv } from "../tv";
27
- import UploraImage from "./UploraImage.vue";
28
- </script>
29
-
30
- <script setup>
31
- const props = defineProps({
32
- title: { type: String, required: true },
33
- description: { type: String, required: false },
34
- thumbnail: { type: Object, required: false },
35
- to: { type: null, required: false },
36
- class: { type: null, required: false },
37
- ui: { type: null, required: false }
38
- });
39
- const appConfig = useAppConfig();
40
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.tableCellPreview || {} })());
41
- </script>
@@ -1,18 +0,0 @@
1
- import type { AppConfig } from '@nuxt/schema';
2
- import type { RouteLocationRaw } from 'vue-router';
3
- import type { ComponentConfig } from '../types';
4
- import theme from '#build/cms/table-cell-preview';
5
- type TableCellPreview = ComponentConfig<typeof theme, AppConfig, 'tableCellPreview'>;
6
- export interface TableCellPreviewProps {
7
- title: string;
8
- description?: string;
9
- thumbnail?: {
10
- image: string;
11
- lqip?: string;
12
- };
13
- to?: RouteLocationRaw;
14
- class?: any;
15
- ui?: TableCellPreview['slots'];
16
- }
17
- declare const _default: import("vue").DefineComponent<TableCellPreviewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TableCellPreviewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
- export default _default;
@@ -1,34 +0,0 @@
1
- <template>
2
- <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
3
- <UBadge
4
- :label="title.progress"
5
- :color="title.color"
6
- variant="subtle"
7
- />
8
- <UBadge
9
- :label="description.progress"
10
- :color="description.color"
11
- variant="subtle"
12
- />
13
- </Primitive>
14
- </template>
15
-
16
- <script>
17
- import theme from "#build/cms/table-cell-seo";
18
- import { computed, useAppConfig } from "#imports";
19
- import { Primitive } from "reka-ui";
20
- import { useSeoStats } from "../composables/useSeoStats";
21
- import { tv } from "../tv";
22
- </script>
23
-
24
- <script setup>
25
- const props = defineProps({
26
- seo: { type: Object, required: true },
27
- as: { type: null, required: false },
28
- class: { type: null, required: false },
29
- ui: { type: null, required: false }
30
- });
31
- const appConfig = useAppConfig();
32
- const { title, description } = useSeoStats(props.seo);
33
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.tableCellSeo || {} })());
34
- </script>
@@ -1,13 +0,0 @@
1
- import type { AppConfig } from '@nuxt/schema';
2
- import type { ComponentConfig } from '../types';
3
- import type { SEO } from '../types/seo';
4
- import theme from '#build/cms/table-cell-seo';
5
- type TableCellSeo = ComponentConfig<typeof theme, AppConfig, 'tableCellSeo'>;
6
- export interface TableCellSeoProps {
7
- seo: SEO;
8
- as?: any;
9
- class?: any;
10
- ui?: TableCellSeo['slots'];
11
- }
12
- declare const _default: import("vue").DefineComponent<TableCellSeoProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TableCellSeoProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
- export default _default;
@@ -1,40 +0,0 @@
1
- <template>
2
- <ULink :to="to" :class="ui.root({ class: [props.ui?.root, props.class] })">
3
- <UAvatar
4
- v-bind="avatar"
5
- size="sm"
6
- :class="ui.avatar({ class: props.ui?.avatar })"
7
- />
8
- <div :class="ui.container({ class: props.ui?.container })">
9
- <p :class="ui.name({ class: props.ui?.name })">
10
- {{ name }}
11
- </p>
12
- <p v-if="description" :class="ui.description({ class: props.ui?.description })">
13
- {{ description }}
14
- </p>
15
- </div>
16
- </ULink>
17
- </template>
18
-
19
- <script>
20
- import theme from "#build/cms/table-cell-user";
21
- import { computed, useAppConfig } from "#imports";
22
- import { tv } from "../tv";
23
- import { createAvatarByName } from "../utils/avatar";
24
- </script>
25
-
26
- <script setup>
27
- const props = defineProps({
28
- name: { type: String, required: true },
29
- description: { type: String, required: false },
30
- avatar: { type: Object, required: false },
31
- to: { type: null, required: false },
32
- class: { type: null, required: false },
33
- ui: { type: null, required: false }
34
- });
35
- const appConfig = useAppConfig();
36
- const avatar = computed(() => props.avatar ?? {
37
- src: createAvatarByName(props.name)
38
- });
39
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.tableCellUser || {} })());
40
- </script>
@@ -1,18 +0,0 @@
1
- import type { AppConfig } from '@nuxt/schema';
2
- import type { AvatarProps } from '@nuxt/ui';
3
- import type { RouteLocationRaw } from 'vue-router';
4
- import type { ComponentConfig } from '../types';
5
- import theme from '#build/cms/table-cell-user';
6
- type TableCellUser = ComponentConfig<typeof theme, AppConfig, 'tableCellUser'>;
7
- export interface TableCellUserProps {
8
- name: string;
9
- description?: string;
10
- avatar?: Omit<AvatarProps, 'size'> & {
11
- [key: string]: any;
12
- };
13
- to?: RouteLocationRaw;
14
- class?: any;
15
- ui?: TableCellUser['slots'];
16
- }
17
- declare const _default: import("vue").DefineComponent<TableCellUserProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TableCellUserProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
- export default _default;
@@ -1,20 +0,0 @@
1
- import type { AppConfig } from '@nuxt/schema';
2
- import type { SortingState, Table } from '@tanstack/vue-table';
3
- import type { ComponentConfig } from '../types';
4
- import theme from '#build/cms/table-panel-column-sorting';
5
- type TablePanelColumnSorting = ComponentConfig<typeof theme, AppConfig, 'tablePanelColumnSorting'>;
6
- export interface TablePanelColumnSortingProps {
7
- table?: Table<any>;
8
- class?: any;
9
- ui?: TablePanelColumnSorting['slots'];
10
- }
11
- declare const _default: import("vue").DefineComponent<TablePanelColumnSortingProps & {
12
- modelValue?: SortingState;
13
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
- "update:modelValue": (value: SortingState) => any;
15
- }, string, import("vue").PublicProps, Readonly<TablePanelColumnSortingProps & {
16
- modelValue?: SortingState;
17
- }> & Readonly<{
18
- "onUpdate:modelValue"?: ((value: SortingState) => any) | undefined;
19
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
- export default _default;