@squiz/dx-page-contents-lib 1.70.2 → 1.71.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.
@@ -5,10 +5,21 @@ const zod_1 = require("zod");
5
5
  const raw_layout_1 = require("./raw.layout");
6
6
  const single_column_layout_1 = require("./single-column.layout");
7
7
  const two_column_layout_1 = require("./two-column.layout");
8
- exports.PageLayout = zod_1.z.discriminatedUnion('name', [raw_layout_1.RawLayout, single_column_layout_1.SingleColumnLayout, two_column_layout_1.TwoColumnLayout]);
8
+ const custom_layout_1 = require("./custom-layout");
9
+ const custom_layout_2 = require("./custom-layout");
10
+ exports.PageLayout = zod_1.z.discriminatedUnion('name', [
11
+ raw_layout_1.RawLayout,
12
+ single_column_layout_1.SingleColumnLayout,
13
+ two_column_layout_1.TwoColumnLayout,
14
+ // Discriminated union does not support ZodEffects such as refinements
15
+ // https://github.com/colinhacks/zod/issues/2440
16
+ // We handle the refinement parsing separately as an extra step in assertions
17
+ custom_layout_2.CustomLayout.innerType(),
18
+ ]);
9
19
  exports.LAYOUT_TEMPLATES = {
10
20
  'layout-raw': raw_layout_1.TEMPLATE,
11
21
  'single-column': single_column_layout_1.TEMPLATE,
12
22
  'two-column': two_column_layout_1.TEMPLATE,
23
+ 'custom-layout': custom_layout_1.CUSTOM_LAYOUT_TEMPLATE,
13
24
  };
14
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,6CAAkE;AAClE,iEAA8F;AAC9F,2DAAqF;AAExE,QAAA,UAAU,GAAG,OAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,sBAAS,EAAE,yCAAkB,EAAE,mCAAe,CAAC,CAAC,CAAC;AAG5F,QAAA,gBAAgB,GAAG;IAC9B,YAAY,EAAE,qBAAW;IACzB,eAAe,EAAE,+BAAoB;IACrC,YAAY,EAAE,4BAAiB;CAChC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,6CAAkE;AAClE,iEAA8F;AAC9F,2DAAqF;AACrF,mDAAiF;AACjF,mDAA+C;AAElC,QAAA,UAAU,GAAG,OAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACrD,sBAAS;IACT,yCAAkB;IAClB,mCAAe;IACf,sEAAsE;IACtE,gDAAgD;IAChD,6EAA6E;IAC7E,4BAAY,CAAC,SAAS,EAAE;CACzB,CAAC,CAAC;AAGU,QAAA,gBAAgB,GAAG;IAC9B,YAAY,EAAE,qBAAW;IACzB,eAAe,EAAE,+BAAoB;IACrC,YAAY,EAAE,4BAAiB;IAC/B,eAAe,EAAE,sCAAoB;CACtC,CAAC"}