@squiz/dxp-page-content-types 1.1.0 → 1.2.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.
@@ -6,11 +6,10 @@ import { FORMATTED_TEXT_MODELS } from '@squiz/dx-json-schema-lib';
6
6
  import { Conditions } from '../PageContent/PageContent';
7
7
  /**
8
8
  * Semi-resolved (referenced content items, not resolved Matrix references) formatted nodes union type.
9
- * TODO: new layout node
10
9
  */
11
10
  export type LayoutContentNodes = (Exclude<FORMATTED_TEXT_MODELS.v1.FormattedNodes, {
12
- type: 'component' | 'fragment';
13
- }> | FormattedTextFragmentNode | ComponentNode | VariationNode) & {
11
+ type: 'component' | 'fragment' | 'layout';
12
+ }> | FormattedTextFragmentNode | ComponentNode | VariationNode | LayoutNode) & {
14
13
  nodeId?: string;
15
14
  };
16
15
  /**
@@ -104,3 +103,35 @@ export type ContentItem<T extends ContentItemBody> = {
104
103
  */
105
104
  content?: T;
106
105
  };
106
+ export interface LayoutZone {
107
+ description: string;
108
+ displayName: string;
109
+ maxNodes: number;
110
+ minNodes: number;
111
+ }
112
+ export interface LayoutZones {
113
+ [zoneKey: string]: LayoutZone;
114
+ }
115
+ interface LayoutOption {
116
+ description: string;
117
+ displayName: string;
118
+ values: Array<string>;
119
+ }
120
+ interface LayoutOptions {
121
+ [key: string]: LayoutOption;
122
+ }
123
+ export interface LayoutData {
124
+ name: string;
125
+ description: string;
126
+ displayName: string;
127
+ version?: string;
128
+ template?: string;
129
+ zones?: LayoutZones;
130
+ options?: LayoutOptions;
131
+ }
132
+ export interface LayoutNode {
133
+ type: 'layout';
134
+ layout: LayoutData;
135
+ content: Record<string, LayoutContentNodes[]>;
136
+ }
137
+ export {};
@@ -3,6 +3,7 @@
3
3
  * Copyright Squiz Australia Pty Ltd. All Rights Reserved.
4
4
  */
5
5
  export declare const ZoneType: {
6
+ readonly layout: "layout";
6
7
  readonly page: "page";
7
8
  readonly 'template-locked': "template-locked";
8
9
  readonly 'template-unlocked': "template-unlocked";
@@ -6,6 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ZoneType = void 0;
8
8
  exports.ZoneType = {
9
+ layout: 'layout',
9
10
  page: 'page',
10
11
  'template-locked': 'template-locked',
11
12
  'template-unlocked': 'template-unlocked',
@@ -1 +1 @@
1
- {"version":3,"file":"Zones.js","sourceRoot":"","sources":["../../src/Zones/Zones.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,iBAAiB;IACpC,mBAAmB,EAAE,mBAAmB;CAChC,CAAC"}
1
+ {"version":3,"file":"Zones.js","sourceRoot":"","sources":["../../src/Zones/Zones.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,iBAAiB;IACpC,mBAAmB,EAAE,mBAAmB;CAChC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squiz/dxp-page-content-types",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "repository": {