@hywax/cms 3.8.0 → 3.9.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.
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hywax/cms",
3
- "version": "3.8.0",
3
+ "version": "3.9.0",
4
4
  "configKey": "cms",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
package/dist/module.mjs CHANGED
@@ -7,7 +7,7 @@ import { pascalCase, kebabCase, camelCase } from 'scule';
7
7
  import { globSync } from 'tinyglobby';
8
8
 
9
9
  const name = "@hywax/cms";
10
- const version = "3.8.0";
10
+ const version = "3.9.0";
11
11
 
12
12
  function createContext(options, nuxt) {
13
13
  const { resolve } = createResolver(import.meta.url);
@@ -5,8 +5,8 @@ export interface TablePreviewLinkProps {
5
5
  to?: RouteLocationRaw;
6
6
  target?: ButtonProps['target'];
7
7
  label: string;
8
- description?: string;
9
- image?: Pick<UploraImageProps, 'image' | 'alt' | 'color' | 'lqip'>;
8
+ description?: string | null;
9
+ image?: Pick<UploraImageProps, 'image' | 'alt' | 'color' | 'lqip'> | null;
10
10
  }
11
11
  declare const __VLS_export: import("vue").DefineComponent<TablePreviewLinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TablePreviewLinkProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
12
  declare const _default: typeof __VLS_export;
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <div class="relative flex items-center gap-2">
3
+ <!-- TODO: добавить <CUploraPlaceholder /> -->
3
4
  <div v-if="image" class="overflow-hidden rounded-lg shrink-0 size-8">
4
5
  <CUploraImage
5
6
  v-bind="image"
@@ -32,7 +33,7 @@ defineProps({
32
33
  to: { type: null, required: false },
33
34
  target: { type: [String, Object, null], required: false },
34
35
  label: { type: String, required: true },
35
- description: { type: String, required: false },
36
- image: { type: Object, required: false }
36
+ description: { type: [String, null], required: false },
37
+ image: { type: [Object, null], required: false }
37
38
  });
38
39
  </script>
@@ -5,8 +5,8 @@ export interface TablePreviewLinkProps {
5
5
  to?: RouteLocationRaw;
6
6
  target?: ButtonProps['target'];
7
7
  label: string;
8
- description?: string;
9
- image?: Pick<UploraImageProps, 'image' | 'alt' | 'color' | 'lqip'>;
8
+ description?: string | null;
9
+ image?: Pick<UploraImageProps, 'image' | 'alt' | 'color' | 'lqip'> | null;
10
10
  }
11
11
  declare const __VLS_export: import("vue").DefineComponent<TablePreviewLinkProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TablePreviewLinkProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
12
  declare const _default: typeof __VLS_export;
@@ -1,6 +1,6 @@
1
1
  import type { SEO } from '../types/seo';
2
2
  export interface TableCellSeoProps {
3
- seo: SEO;
3
+ seo: SEO | null;
4
4
  as?: any;
5
5
  }
6
6
  declare const _default: typeof __VLS_export;
@@ -13,10 +13,11 @@ import { useSeoStats } from "../composables/useSeoStats";
13
13
 
14
14
  <script setup>
15
15
  const props = defineProps({
16
- seo: { type: Object, required: true },
16
+ seo: { type: [Object, null], required: true },
17
17
  as: { type: null, required: false }
18
18
  });
19
- const { title, description, computeColor } = useSeoStats(props.seo);
19
+ const seo = computed(() => props.seo ?? { title: "", description: "" });
20
+ const { title, description, computeColor } = useSeoStats(seo);
20
21
  const rating = computed(() => {
21
22
  return Math.round((title.value.progress + description.value.progress) / 2);
22
23
  });
@@ -1,6 +1,6 @@
1
1
  import type { SEO } from '../types/seo';
2
2
  export interface TableCellSeoProps {
3
- seo: SEO;
3
+ seo: SEO | null;
4
4
  as?: any;
5
5
  }
6
6
  declare const _default: typeof __VLS_export;
@@ -19,8 +19,8 @@ export type TableColumnCustom<T extends TableData, D = unknown> = TableColumn<T,
19
19
  to?: ((row: TableRow<T>) => RouteLocationRaw | string | undefined) | RouteLocationRaw | string | undefined;
20
20
  target?: ButtonProps['target'];
21
21
  emptyValue?: string;
22
- image?: ((row: TableRow<T>) => TablePreviewLinkProps['image'] | undefined) | TablePreviewLinkProps['image'] | undefined;
23
- description?: ((row: TableRow<T>) => string | undefined) | string | undefined;
22
+ image?: ((row: TableRow<T>) => TablePreviewLinkProps['image'] | undefined | null) | TablePreviewLinkProps['image'] | undefined | null;
23
+ description?: ((row: TableRow<T>) => string | undefined | null) | string | undefined | null;
24
24
  };
25
25
  export declare function useTableColumns<I extends Record<string, any>, T extends readonly TableColumnCustom<I>[] = readonly TableColumnCustom<I>[]>(columns: T): {
26
26
  columns: {
@@ -1,6 +1,8 @@
1
1
  import type { Filters } from '@uplora/serializer';
2
2
  import type { ImageFormat, ImageSize, ImageSource } from '../types';
3
3
  export declare function getUploraFileUrl(id: string): string;
4
+ export declare function getUploraImageUrl(id: string): string;
5
+ export declare function getUploraPlaceholderUrl(width: number, height: number, format?: ImageFormat): string;
4
6
  /**
5
7
  * Создает функцию для получения URL изображения из Uplora
6
8
  */
@@ -4,12 +4,22 @@ import { serialize } from "@uplora/serializer";
4
4
  export function getUploraFileUrl(id) {
5
5
  const runtimeConfig = useRuntimeConfig();
6
6
  const { fluxorUrl } = runtimeConfig.public;
7
- return `${fluxorUrl}/${id}`;
7
+ return `${fluxorUrl}/files/${id}`;
8
+ }
9
+ export function getUploraImageUrl(id) {
10
+ const runtimeConfig = useRuntimeConfig();
11
+ const { fluxorUrl } = runtimeConfig.public;
12
+ return `${fluxorUrl}/images/${id}`;
13
+ }
14
+ export function getUploraPlaceholderUrl(width, height, format = "jpg") {
15
+ const runtimeConfig = useRuntimeConfig();
16
+ const { fluxorUrl } = runtimeConfig.public;
17
+ return `${fluxorUrl}/placeholder/${width}x${height}.${format}`;
8
18
  }
9
19
  export function createUploraImageResolver() {
10
20
  return (id, filters) => {
11
21
  const serializeFilters = filters ? serialize(filters) : "";
12
- return `${getUploraFileUrl(id)}${serializeFilters ? `/${serializeFilters}` : ""}`;
22
+ return `${getUploraImageUrl(id)}${serializeFilters ? `/${serializeFilters}` : ""}`;
13
23
  };
14
24
  }
15
25
  export function buildUploraImage(options) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hywax/cms",
3
3
  "type": "module",
4
- "version": "3.8.0",
4
+ "version": "3.9.0",
5
5
  "description": "Hywax CMS. ⚠️ This package is intended for internal use only.",
6
6
  "imports": {
7
7
  "#build/cms/*": "./.nuxt/cms/*.ts",