rimelight-components 2.0.65 → 2.0.66
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
|
@@ -4,7 +4,7 @@ import { readdirSync } from 'node:fs';
|
|
|
4
4
|
import { basename } from 'node:path';
|
|
5
5
|
|
|
6
6
|
const name = "rimelight-components";
|
|
7
|
-
const version = "2.0.
|
|
7
|
+
const version = "2.0.66";
|
|
8
8
|
const homepage = "https://rimelight.com/tools/rimelight-components";
|
|
9
9
|
|
|
10
10
|
const defaultOptions = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
1
2
|
import type { Page, Localized, PageDefinition } from "../types/pages";
|
|
2
|
-
export declare const getLocalizedContent: (field: Localized | undefined, currentLocale: string) => string;
|
|
3
|
+
export declare const getLocalizedContent: <T = string>(field: Localized<T> | undefined, currentLocale: MaybeRefOrGetter<string>) => T | string;
|
|
3
4
|
/**
|
|
4
5
|
* Ensures a page strictly adheres to its PageDefinition.
|
|
5
6
|
* - Adds missing properties and groups in the correct order.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { toValue } from "vue";
|
|
1
2
|
export const getLocalizedContent = (field, currentLocale) => {
|
|
2
3
|
if (!field) return "";
|
|
3
|
-
|
|
4
|
+
const locale = toValue(currentLocale);
|
|
5
|
+
return field[locale] ?? field["en"] ?? "";
|
|
4
6
|
};
|
|
5
7
|
export function syncPageWithDefinition(page, definition) {
|
|
6
8
|
if (!definition) return page;
|