@hywax/cms 3.8.1 → 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
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.
|
|
10
|
+
const version = "3.9.0";
|
|
11
11
|
|
|
12
12
|
function createContext(options, nuxt) {
|
|
13
13
|
const { resolve } = createResolver(import.meta.url);
|
|
@@ -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 `${
|
|
22
|
+
return `${getUploraImageUrl(id)}${serializeFilters ? `/${serializeFilters}` : ""}`;
|
|
13
23
|
};
|
|
14
24
|
}
|
|
15
25
|
export function buildUploraImage(options) {
|