@blocklet/pages-kit 0.4.114 → 0.4.116

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.
@@ -8,7 +8,7 @@ export function mergeComponent({ componentId, getComponent, locale, defaultLocal
8
8
  if (!component)
9
9
  return null;
10
10
  let script;
11
- const properties = Object.fromEntries(Object.entries(parameters ?? {}).map(([id, { value }]) => {
11
+ const props = Object.fromEntries(Object.entries(parameters ?? {}).map(([id, { value }]) => {
12
12
  const property = component?.properties?.[id]?.data;
13
13
  if (!property)
14
14
  return [];
@@ -16,7 +16,7 @@ export function mergeComponent({ componentId, getComponent, locale, defaultLocal
16
16
  return [property.key || property.id, parsePropertyValue(property, value, { locale, defaultLocale })];
17
17
  }));
18
18
  while (component) {
19
- assignNullableFields(properties, Object.fromEntries(Object.values(component.properties ?? {}).map(({ data }) => [
19
+ assignNullableFields(props, Object.fromEntries(Object.values(component.properties ?? {}).map(({ data }) => [
20
20
  // if key is undefined, use id
21
21
  data.key || data.id,
22
22
  parsePropertyValue(data, data.locales?.[locale]?.defaultValue ?? data.locales?.[defaultLocale]?.defaultValue, { locale, defaultLocale }),
@@ -33,7 +33,7 @@ export function mergeComponent({ componentId, getComponent, locale, defaultLocal
33
33
  const { componentId } = component.renderer;
34
34
  const next = getComponent(componentId);
35
35
  const nextParameters = component.renderer.properties;
36
- assignNullableFields(properties, Object.fromEntries(Object.entries(next?.properties ?? {}).map(([id, { data }]) => {
36
+ assignNullableFields(props, Object.fromEntries(Object.entries(next?.properties ?? {}).map(([id, { data }]) => {
37
37
  const locales = nextParameters?.[id]?.locales;
38
38
  return [
39
39
  data.key,
@@ -51,7 +51,7 @@ export function mergeComponent({ componentId, getComponent, locale, defaultLocal
51
51
  }
52
52
  if (!script)
53
53
  return null;
54
- return { script, properties };
54
+ return { script, props };
55
55
  }
56
56
  export const RenderNestedComponent = '__RENDER_NESTED_COMPONENT__';
57
57
  export function safeJSONParse(value) {