@squiz/dxp-page-content-types 1.0.0 → 1.1.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.
@@ -9,8 +9,19 @@ import { Conditions } from '../PageContent/PageContent';
9
9
  * TODO: new layout node
10
10
  */
11
11
  export type LayoutContentNodes = (Exclude<FORMATTED_TEXT_MODELS.v1.FormattedNodes, {
12
- type: 'component';
13
- }> | ComponentNode | VariationNode) & {
12
+ type: 'component' | 'fragment';
13
+ }> | FormattedTextFragmentNode | ComponentNode | VariationNode) & {
14
+ nodeId?: string;
15
+ };
16
+ /**
17
+ * Formatted text fragment node with i18n support.
18
+ */
19
+ export type FormattedTextFragmentNode = Extract<FORMATTED_TEXT_MODELS.v1.FormattedNodes, {
20
+ type: 'fragment';
21
+ }> & {
22
+ i18n?: Record<string, {
23
+ children?: FORMATTED_TEXT_MODELS.v1.FormattedTextFragment['children'];
24
+ }>;
14
25
  nodeId?: string;
15
26
  };
16
27
  /**
@@ -37,6 +48,10 @@ export type ComponentNode<T extends ContentItemBody = ContentItemBody> = {
37
48
  * Content item referenced by the component node. Will be undefined if component does not have a content item.
38
49
  */
39
50
  contentItem?: ContentItem<T>;
51
+ /**
52
+ * Translated content item for each language
53
+ */
54
+ i18n?: Record<string, ContentItem<T>>;
40
55
  };
41
56
  /**
42
57
  * Variation node variant.
@@ -36,6 +36,9 @@ export type RawLayout = {
36
36
  export type PageConfig = {
37
37
  pageExperimentId?: string;
38
38
  pageSegmentIds?: string[];
39
+ languages?: Record<string, {
40
+ fallbackToDefault?: boolean;
41
+ }>;
39
42
  };
40
43
  /**
41
44
  * Resolved page content.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squiz/dxp-page-content-types",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "repository": {
@@ -23,6 +23,6 @@
23
23
  "typescript": "5.8.3"
24
24
  },
25
25
  "dependencies": {
26
- "@squiz/dx-json-schema-lib": "^1.82.1"
26
+ "@squiz/dx-json-schema-lib": "^1.82.2"
27
27
  }
28
28
  }