rimelight-components 2.0.90 → 2.0.92
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 +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/blocks/BlockEditRenderer.vue +1 -1
- package/dist/runtime/components/blocks/BlockViewRenderer.vue +1 -1
- package/dist/runtime/types/pages.d.ts +0 -5
- package/dist/runtime/types/pages.js +0 -3
- package/dist/runtime/utils/index.d.ts +0 -1
- package/dist/runtime/utils/index.js +0 -1
- package/dist/runtime/utils/page.d.ts +5 -0
- package/dist/runtime/utils/page.js +4 -1
- package/package.json +1 -1
- /package/dist/runtime/{utils → internal}/blockMapper.d.ts +0 -0
- /package/dist/runtime/{utils → internal}/blockMapper.js +0 -0
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.92";
|
|
8
8
|
const homepage = "https://rimelight.com/tools/rimelight-components";
|
|
9
9
|
|
|
10
10
|
const defaultOptions = {
|
|
@@ -27,11 +27,6 @@ export interface PageDefinition {
|
|
|
27
27
|
properties: Record<string, PropertyGroup>;
|
|
28
28
|
initialBlocks?: () => Block[];
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Helper to define a page with full type safety and literal preservation.
|
|
32
|
-
* This is used by consuming apps to define their custom page types.
|
|
33
|
-
*/
|
|
34
|
-
export declare function definePageDefinition<T extends PageDefinition>(def: T): T;
|
|
35
30
|
export interface BasePageProperties {
|
|
36
31
|
}
|
|
37
32
|
export interface RegisterPageTypes extends RimelightRegisterPageTypes {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { type MaybeRefOrGetter } from 'vue';
|
|
2
2
|
import type { Page, Localized, PageDefinition } from "../types/pages";
|
|
3
3
|
export declare const getLocalizedContent: <T = string>(field: Localized<T> | undefined, currentLocale: MaybeRefOrGetter<string>) => T | string;
|
|
4
|
+
/**
|
|
5
|
+
* Helper to define a page with full type safety and literal preservation.
|
|
6
|
+
* This is used by consuming apps to define their custom page types.
|
|
7
|
+
*/
|
|
8
|
+
export declare function definePageDefinition<T extends PageDefinition>(def: T): T;
|
|
4
9
|
/**
|
|
5
10
|
* Ensures a page strictly adheres to its PageDefinition.
|
|
6
11
|
* - Adds missing properties and groups in the correct order.
|
|
@@ -4,6 +4,9 @@ export const getLocalizedContent = (field, currentLocale) => {
|
|
|
4
4
|
const locale = toValue(currentLocale);
|
|
5
5
|
return field[locale] ?? field["en"] ?? "";
|
|
6
6
|
};
|
|
7
|
+
export function definePageDefinition(def) {
|
|
8
|
+
return def;
|
|
9
|
+
}
|
|
7
10
|
export function syncPageWithDefinition(page, definition) {
|
|
8
11
|
if (!definition) return page;
|
|
9
12
|
let hasChanged = false;
|
|
@@ -68,7 +71,7 @@ export function syncPageWithDefinition(page, definition) {
|
|
|
68
71
|
page.blocks = filteredCurrent;
|
|
69
72
|
}
|
|
70
73
|
if (hasChanged) {
|
|
71
|
-
page.
|
|
74
|
+
page.updated_at = /* @__PURE__ */ new Date();
|
|
72
75
|
}
|
|
73
76
|
return page;
|
|
74
77
|
}
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|