@nascentdigital/funnel-ui 4.6.7 → 5.0.2

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.
Files changed (63) hide show
  1. package/dist/client/fields/EmbeddedVideo/EmbeddedVideo.d.ts +2 -2
  2. package/dist/client/fields/EmbeddedVideo/EmbeddedVideo.js +3 -3
  3. package/dist/client/fields/EmbeddedVideo/vimeo/VimeoVideo.d.ts +3 -3
  4. package/dist/client/fields/EmbeddedVideo/vimeo/VimeoVideo.js +4 -3
  5. package/dist/client/fields/EmbeddedVideo/youtube/YoutubeVideo.d.ts +3 -3
  6. package/dist/client/fields/EmbeddedVideo/youtube/YoutubeVideo.js +4 -3
  7. package/dist/client/fields/LazyVideo.d.ts +5 -1
  8. package/dist/client/fields/LazyVideo.js +6 -4
  9. package/dist/client/hooks/useTouch.js +1 -0
  10. package/dist/client/interaction/paginator/Paginator.js +0 -1
  11. package/dist/server/blocks/Block.d.ts +87 -15
  12. package/dist/server/blocks/Block.js +785 -60
  13. package/dist/server/blocks/MediaLayout.d.ts +26 -10
  14. package/dist/server/blocks/MediaLayout.js +14 -23
  15. package/dist/server/blocks/Message.js +2 -2
  16. package/dist/server/blocks/RelatedPages.js +4 -4
  17. package/dist/server/blocks/index.d.ts +0 -1
  18. package/dist/server/blocks/index.js +0 -1
  19. package/dist/server/fields/Media.d.ts +50 -22
  20. package/dist/server/fields/Media.js +75 -48
  21. package/dist/server/fields/Visual.d.ts +6 -2
  22. package/dist/server/fields/Visual.js +9 -5
  23. package/dist/server/index.d.ts +1 -0
  24. package/dist/server/index.js +1 -0
  25. package/dist/server/layouts/accordion/Accordion.d.ts +21 -0
  26. package/dist/server/layouts/accordion/Accordion.js +66 -0
  27. package/dist/server/layouts/accordion/AccordionContainer.d.ts +5 -0
  28. package/dist/server/layouts/accordion/AccordionContainer.js +18 -0
  29. package/dist/server/layouts/accordion/AccordionContext.d.ts +7 -0
  30. package/dist/server/layouts/accordion/AccordionContext.js +7 -0
  31. package/dist/server/layouts/accordion/AccordionExpander.d.ts +9 -0
  32. package/dist/server/layouts/accordion/AccordionExpander.js +72 -0
  33. package/dist/server/layouts/accordion/AccordionItem.d.ts +8 -0
  34. package/dist/server/layouts/accordion/AccordionItem.js +22 -0
  35. package/dist/server/layouts/accordion/AccordionLayout.d.ts +7 -0
  36. package/dist/server/layouts/accordion/AccordionLayout.js +26 -0
  37. package/dist/server/layouts/accordion/AccordionOptions.d.ts +3 -0
  38. package/dist/server/layouts/accordion/AccordionOptions.js +2 -0
  39. package/dist/server/layouts/accordion/index.d.ts +3 -0
  40. package/dist/server/layouts/accordion/index.js +19 -0
  41. package/dist/server/layouts/accordion/useAccordion.d.ts +1 -0
  42. package/dist/server/layouts/accordion/useAccordion.js +34 -0
  43. package/dist/server/layouts/index.d.ts +2 -1
  44. package/dist/server/layouts/index.js +2 -1
  45. package/dist/server/panels/BlockPanel.d.ts +14 -80
  46. package/dist/server/panels/BlockPanel.js +46 -707
  47. package/dist/server/panels/ListPanel.js +6 -3
  48. package/dist/server/panels/MessagePanel.js +33 -33
  49. package/dist/server/panels/VisualPanel.d.ts +58 -10
  50. package/dist/server/panels/VisualPanel.js +155 -79
  51. package/dist/server/schema/ListPanelLayout.d.ts +1 -0
  52. package/dist/server/schema/ListPanelLayout.js +1 -0
  53. package/dist/styles/blocks/Block-layout.css +81 -80
  54. package/dist/styles/blocks/Editorial.css +2 -2
  55. package/dist/styles/blocks/Form.css +2 -2
  56. package/dist/styles/blocks/MediaLayout.css +1 -1
  57. package/dist/styles/components/container.css +3 -24
  58. package/dist/styles/layouts/Accordion.css +29 -0
  59. package/dist/styles/layouts/_index.css +2 -1
  60. package/dist/styles/panels/VisualPanel.css +2 -1
  61. package/package.json +2 -2
  62. package/dist/server/blocks/Editorial.d.ts +0 -33
  63. package/dist/server/blocks/Editorial.js +0 -80
@@ -28,69 +28,6 @@
28
28
  .nd-Block {
29
29
  min-height: var(--nd-block-height-min);
30
30
  }
31
- .nd-Block-rootContainerWrap {
32
-
33
- /* for row (always on) */
34
- &:has(> .nd-Block-row) {
35
- @apply container-p;
36
- }
37
- > .nd-Block-rootContainer > .nd-Block-row {
38
- @media screen and (max-width: theme('screens.md')) {
39
- &:has(.nd-BlockPanel:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-mobile)) {
40
- @apply container-p;
41
- }
42
- }
43
- @media screen(md) {
44
- &:has(.nd-BlockPanel:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-tablet)) {
45
- @apply container-p;
46
- }
47
- }
48
- @media screen(lg) {
49
- &:has(.nd-BlockPanel:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-desktop)) {
50
- @apply container-p;
51
- }
52
- }
53
- }
54
-
55
- /* for column/stack (apply container to panels if not fullbleed) */
56
- &:has(> :is(.nd-Block-column, .nd-Block-stack)) {
57
- @media screen and (max-width: theme('screens.md')) {
58
- &:not(:has(.nd-BlockPanel:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-mobile))) {
59
- @apply container-p;
60
- }
61
- &:has(.nd-BlockPanel:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-mobile)) {
62
-
63
- > .nd-Block-rootContainer > *:not(:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-mobile)):not(:has(.nd-BlockPanel:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-mobile))) {
64
- @apply container-p;
65
- }
66
- }
67
- }
68
- @media screen(md) {
69
- &:not(:has(.nd-BlockPanel:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-tablet))) {
70
- @apply container-p;
71
- }
72
- &:has(.nd-BlockPanel:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-tablet)) {
73
-
74
- > .nd-Block-rootContainer > *:not(:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-tablet)):not(:has(.nd-BlockPanel:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-tablet))) {
75
- @apply container-p;
76
- }
77
- }
78
- }
79
- @media screen(lg) {
80
- &:not(:has(.nd-BlockPanel:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-desktop))) {
81
- @apply container-p;
82
- }
83
- &:has(.nd-BlockPanel:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-desktop)) {
84
-
85
- > .nd-Block-rootContainer > *:not(:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-desktop)):not(:has(.nd-BlockPanel:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-desktop))) {
86
- @apply container-p;
87
- }
88
- }
89
- }
90
- }
91
- }
92
- .nd-Block-rootContainer {
93
- }
94
31
 
95
32
  /* container/fullbleed */
96
33
  ._nd-Block-fullbleed-left {
@@ -102,6 +39,10 @@
102
39
 
103
40
 
104
41
  /* row layout */
42
+ .nd-Block-row {
43
+ @apply max-md:_nd-Block-row-mobile md:_nd-Block-row-desktop;
44
+ }
45
+
105
46
  ._nd-Block-row-mobile {
106
47
  @apply flex flex-col gap-[var(--nd-block-layout-gap-y)];
107
48
  container-type: inline-size;
@@ -116,50 +57,44 @@
116
57
  }
117
58
  }
118
59
  }
60
+
119
61
  ._nd-Block-row-desktop {
120
62
  @apply grid auto-cols-fr gap-[var(--nd-block-layout-gap-x)];
121
63
  container-type: inline-size;
122
64
 
123
- /* row widths */
124
- &.nd-Block-items-1 {
125
- @apply grid-cols-1;
126
- }
127
- &.nd-Block-items-2 {
128
- @apply grid-cols-2;
129
- }
130
- &.nd-Block-items-3 {
131
- @apply grid-cols-3;
132
- }
133
- &.nd-Block-items-4 {
134
- @apply grid-cols-4;
135
- }
136
-
137
65
  /* row alignment */
66
+
138
67
  &.nd-Block-y-start {
139
68
  @apply items-start;
140
69
  }
70
+
141
71
  &.nd-Block-y-center {
142
72
  @apply items-center;
143
73
  }
74
+
144
75
  &.nd-Block-y-end {
145
76
  @apply items-end;
146
77
  }
147
78
 
148
79
  /* fullbleed (l1 OR l2) */
80
+
149
81
  & > .nd-BlockPanel {
150
82
  &.nd-BlockPanel-fullbleed {
151
83
  &:first-child {
152
84
  @apply _nd-Block-fullbleed-left;
153
85
  }
86
+
154
87
  &:last-child {
155
88
  @apply _nd-Block-fullbleed-right;
156
89
  }
157
90
  }
91
+
158
92
  @media screen(md) {
159
93
  &.nd-BlockPanel-fullbleed-tablet {
160
94
  &:first-child {
161
95
  @apply _nd-Block-fullbleed-left;
162
96
  }
97
+
163
98
  &:last-child {
164
99
  @apply _nd-Block-fullbleed-right;
165
100
  }
@@ -170,6 +105,7 @@
170
105
  &:first-child {
171
106
  @apply _nd-Block-fullbleed-left;
172
107
  }
108
+
173
109
  &:last-child {
174
110
  @apply _nd-Block-fullbleed-right;
175
111
  }
@@ -177,10 +113,36 @@
177
113
  }
178
114
  }
179
115
  }
180
- .nd-Block-row {
181
- @apply max-md:_nd-Block-row-mobile md:_nd-Block-row-desktop;
116
+
117
+ .nd-Block-row-ratio-1_1 {
118
+ @apply grid-cols-[1fr,1fr];
119
+ }
120
+
121
+ .nd-Block-row-ratio-1_2 {
122
+ @apply grid-cols-[1fr,2fr];
182
123
  }
183
124
 
125
+ .nd-Block-row-ratio-1_3 {
126
+ @apply grid-cols-[1fr,3fr];
127
+ }
128
+
129
+ .nd-Block-row-ratio-2_1 {
130
+ @apply grid-cols-[2fr,1fr];
131
+ }
132
+
133
+ .nd-Block-row-ratio-2_3 {
134
+ @apply grid-cols-[2fr,3fr];
135
+ }
136
+
137
+ .nd-Block-row-ratio-3_1 {
138
+ @apply grid-cols-[3fr,1fr];
139
+ }
140
+
141
+ .nd-Block-row-ratio-3_2 {
142
+ @apply grid-cols-[3fr,2fr];
143
+ }
144
+
145
+
184
146
  /* column layout */
185
147
  ._nd-Block-column-mobile {
186
148
  @apply flex flex-col gap-[var(--nd-block-layout-gap-y)];
@@ -192,7 +154,8 @@
192
154
  @apply w-full max-md:_nd-Block-column-mobile md:_nd-Block-column-desktop;
193
155
  }
194
156
 
195
- /* column layout */
157
+
158
+ /* stack layout */
196
159
  .nd-Block-stack {
197
160
  @apply stacked;
198
161
 
@@ -226,6 +189,7 @@
226
189
  }
227
190
  }
228
191
 
192
+
229
193
  /* panel layout */
230
194
  ._nd-BlockPanel-desktop {
231
195
  @apply grid grid-cols-12;
@@ -281,4 +245,41 @@
281
245
  .nd-BlockPanel-mobileLast {
282
246
  @apply max-md:order-last;
283
247
  }
248
+
249
+ /* containers */
250
+ .nd-Block-rowWrap {
251
+ @apply container;
252
+ }
253
+ }
254
+
255
+ .nd-Block-rootContainer:not(.nd-Block-row) {
256
+
257
+ /* direct descendent */
258
+ > .nd-BlockPanel-wrap {
259
+ @media screen and (max-width: theme('screens.md')) {
260
+ &:not(:is(.nd-Block-fullbleed, .nd-Block-fullbleed-mobile)){
261
+ @apply container;
262
+ }
263
+ }
264
+
265
+ @media screen(md) {
266
+ &:not(:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-tablet)){
267
+ @apply container;
268
+ }
269
+ }
270
+
271
+ @media screen(lg) {
272
+ &:not(:is(.nd-BlockPanel-fullbleed,.nd-BlockPanel-fullbleed-desktop)){
273
+ @apply container;
274
+ }
275
+ }
276
+
277
+ }
278
+
279
+ /* nested */
280
+ > .nd-Block-containerWrap:not(.nd-Block-rowWrap) {
281
+ .nd-BlockPanel-wrap {
282
+ @apply container;
283
+ }
284
+ }
284
285
  }
@@ -42,7 +42,7 @@
42
42
  @apply w-full;
43
43
  }
44
44
  .nd-Editorial-headerWrap {
45
- @apply container-p relative;
45
+ @apply container relative;
46
46
  }
47
47
  .nd-Editorial-header {
48
48
  @apply flex flex-col gap-[var(--nd-editorial-header-gap)];
@@ -60,7 +60,7 @@
60
60
  margin: var(--nd-editorial-ctas-margin);
61
61
  }
62
62
  .nd-Editorial-bodyWrap {
63
- @apply container-p relative;
63
+ @apply container relative;
64
64
  }
65
65
  .nd-Editorial-visualWrap {
66
66
  @apply relative;
@@ -3,11 +3,11 @@
3
3
  .nd-Form {
4
4
 
5
5
  .nd-Form-copyWrap {
6
- @apply container-p;
6
+ @apply container;
7
7
  }
8
8
 
9
9
  .nd-Form-formWrap {
10
- @apply container-p;
10
+ @apply container;
11
11
  }
12
12
  }
13
13
  }
@@ -64,7 +64,7 @@
64
64
  /* vertical stack */
65
65
  .nd-StackLayout.nd-StackLayout-direction-vertical {
66
66
  .nd-MediaLayout-itemWrap {
67
- @apply aspect-cinema @panel-lg:aspect-cinemascope;
67
+ @apply nd-VisualPanel nd-VisualPanel-aspect-auto;
68
68
  }
69
69
  }
70
70
  }
@@ -2,57 +2,36 @@
2
2
 
3
3
  :root {
4
4
  --nd-container-size: theme('screens.xl');
5
- --nd-container-size-wide: 1800px;
6
5
  --nd-container-gutter-xs: 24px;
7
- --nd-container-gutter-wide-xs: var(--nd-container-gutter-xs);
8
6
  --nd-container-gutter-sm: 40px;
9
- --nd-container-gutter-wide-sm: var(--nd-container-gutter-sm);
10
7
  --nd-container-gutter-md: 80px;
11
- --nd-container-gutter-wide-md: var(--nd-container-gutter-md);
12
8
  --nd-container-gutter-lg: 102px;
13
- --nd-container-gutter-wide-lg: var(--nd-container-gutter-lg);
14
9
  --nd-container-gutter-xl: 102px;
15
- --nd-container-gutter-wide-xl: 80px;
16
10
 
17
11
  --nd-container-gutter: var(--nd-container-gutter-xs);
18
- --nd-container-gutter-wide: var(--nd-container-gutter-wide-xs);
19
12
  @media screen(sm) {
20
13
  --nd-container-gutter: var(--nd-container-gutter-sm);
21
- --nd-container-gutter-wide: var(--nd-container-gutter-wide-sm);
22
14
  }
23
15
  @media screen(md) {
24
16
  --nd-container-gutter: var(--nd-container-gutter-md);
25
- --nd-container-gutter-wide: var(--nd-container-gutter-wide-md);
26
17
  }
27
18
  @media screen(lg) {
28
19
  --nd-container-gutter: var(--nd-container-gutter-lg);
29
- --nd-container-gutter-wide: var(--nd-container-gutter-wide-lg);
30
20
  }
31
21
  @media screen(xl) {
32
22
  --nd-container-gutter: var(--nd-container-gutter-xl);
33
- --nd-container-gutter-wide: var(--nd-container-gutter-wide-xl);
34
23
  }
35
24
  }
36
25
 
37
26
  .container {
38
- @apply max-w-[var(--nd-container-size)] mx-auto;
39
- }
40
- .container-wide {
41
- @apply max-w-[var(--nd-container-size-wide)] mx-auto;
27
+ @apply max-w-[var(--nd-container-size)] mx-auto container-gutter;
42
28
  }
43
29
  .container-gutter {
44
30
  @apply px-[var(--nd-container-gutter)];
45
31
  }
46
- .container-gutter-wide {
47
- @apply px-[var(--nd-container-gutter-wide)];
48
- }
49
- .container-p {
50
- @apply container container-gutter;
51
- }
52
- .container-wide-p {
53
- @apply container-wide container-gutter-wide;
54
- }
55
32
  .container-none {
56
33
  @apply max-w-none px-revert;
57
34
  }
58
35
  }
36
+
37
+ /* TODO: find replace only on UI and nascentdigital , NOT: Editor!!!*/
@@ -0,0 +1,29 @@
1
+ @layer components {
2
+
3
+ :root {
4
+ }
5
+
6
+ /* list */
7
+ .nd-AccordionLayout {
8
+ }
9
+
10
+ /* item */
11
+ .nd-AccordionItem {
12
+ }
13
+ .nd-AccordionItem-expanded {
14
+ }
15
+
16
+ /* header */
17
+ .nd-AccordionItem-headerWrap {
18
+ }
19
+ .nd-AccordionItem-header {
20
+ }
21
+ .nd-AccordionItem-headerFocus {
22
+ }
23
+
24
+ /* panel */
25
+ .nd-AccordionItem-panelWrap {
26
+ }
27
+ .nd-AccordionItem-panel {
28
+ }
29
+ }
@@ -1,8 +1,9 @@
1
- @import "./Layout.css";
1
+ @import "./Accordion.css";
2
2
  @import "./BentoLayout.css";
3
3
  @import "./CardLayout.css";
4
4
  @import "./BrickLayout.css";
5
5
  @import "./FlexWrapLayout.css";
6
6
  @import "./GridLayout.css";
7
+ @import "./Layout.css";
7
8
  @import "./MasonryLayout.css";
8
9
  @import "./StackLayout.css";
@@ -9,7 +9,8 @@
9
9
 
10
10
  /* aspect ratios */
11
11
  .nd-VisualPanel-aspect-auto {
12
- --nd-visual-aspect: theme(aspectRatio.auto);
12
+ --nd-visual-aspect: unset;
13
+ --nd-visual-width: 100%;
13
14
  --nd-visual-height: auto;
14
15
  }
15
16
  .nd-VisualPanel-aspect-square {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nascentdigital/funnel-ui",
3
3
  "description": "UI components for funnel",
4
- "version": "4.6.7",
4
+ "version": "5.0.2",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
7
7
  "access": "restricted"
@@ -69,5 +69,5 @@
69
69
  "react-dom": "^19",
70
70
  "ts-jest": "^29.3.2"
71
71
  },
72
- "gitHead": "b17e33b4400391b3984e61225c572f097c4c26c9"
72
+ "gitHead": "24d9690cf813052f6561c3ccef11c7cf69ad7f7c"
73
73
  }
@@ -1,33 +0,0 @@
1
- import { Schema } from '@nascentdigital/funnel-core';
2
- import { ReactNode } from 'react';
3
- import { HTMLBlockElement } from '../../types';
4
- import { Caption, FreeFormContent, Headline, Title, Visual } from '../fields';
5
- import { BlockConfig } from '../schema';
6
- export declare function Editorial({ className, model, titleTag, headlineTag, captionTag, freeFormContentTag, headerDecorator, visualDecorator, visualLoading, ...props }: Editorial.Props): import("react/jsx-runtime").JSX.Element | null;
7
- export declare namespace Editorial {
8
- const schema: Schema.Block<"_nd-editorial", {
9
- visual: Schema.Optional<Schema.AssetField<Schema.AssetField.LinkedValue.Visual>>;
10
- title: Schema.Optional<Schema.TextField>;
11
- headline: Schema.Optional<Schema.RichTextField>;
12
- caption: Schema.Optional<Schema.RichTextField>;
13
- ctas: Schema.Optional<Schema.ListField<{
14
- cta: Schema.LinkField;
15
- }>>;
16
- content: Schema.RichTextField;
17
- extraContent: Schema.Optional<Schema.RichTextField>;
18
- }, {
19
- theme: Schema.EnumField<Readonly<import("@nascentdigital/funnel-core").BlockThemes.Options>>;
20
- visualLayout: Schema.EnumField<Schema.EnumField.Options<BlockConfig.VisualLayout>>;
21
- }>;
22
- type Props = HTMLBlockElement<'div'> & {
23
- model: Model;
24
- titleTag?: Title.Tag;
25
- headlineTag?: Headline.Tag;
26
- captionTag?: Caption.Tag;
27
- freeFormContentTag?: FreeFormContent.Tag;
28
- headerDecorator?: ReactNode;
29
- visualDecorator?: ReactNode;
30
- visualLoading?: Visual.Loading;
31
- };
32
- type Model = Schema.Block.LinkedData<typeof schema>;
33
- }
@@ -1,80 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Editorial = Editorial;
18
- const jsx_runtime_1 = require("react/jsx-runtime");
19
- const funnel_core_1 = require("@nascentdigital/funnel-core");
20
- const classnames_1 = __importDefault(require("classnames"));
21
- const fields_1 = require("../fields");
22
- const schema_1 = require("../schema");
23
- // block
24
- function Editorial(_a) {
25
- var _b, _c, _d, _e, _f;
26
- var { className, model, titleTag = 'span', headlineTag = 'div', captionTag = 'div', freeFormContentTag = 'div', headerDecorator, visualDecorator, visualLoading = 'eager' } = _a, props = __rest(_a, ["className", "model", "titleTag", "headlineTag", "captionTag", "freeFormContentTag", "headerDecorator", "visualDecorator", "visualLoading"]);
27
- // dont render if missing model
28
- if (!model) {
29
- console.warn('[Editorial] attempted to render without editorial model');
30
- return null;
31
- }
32
- // render
33
- const { title: titleRaw, headline: headlineRaw, caption: captionRaw, ctas: ctasRaw, visual: visualRaw, content: contentRaw, extraContent: extraContentRaw } = model.fields;
34
- const visual = visualRaw === null || visualRaw === void 0 ? void 0 : visualRaw.value;
35
- const title = titleRaw === null || titleRaw === void 0 ? void 0 : titleRaw.value;
36
- const headline = headlineRaw === null || headlineRaw === void 0 ? void 0 : headlineRaw.value;
37
- const caption = captionRaw === null || captionRaw === void 0 ? void 0 : captionRaw.value;
38
- const ctas = (_b = ctasRaw === null || ctasRaw === void 0 ? void 0 : ctasRaw.value) !== null && _b !== void 0 ? _b : [];
39
- const content = contentRaw === null || contentRaw === void 0 ? void 0 : contentRaw.value;
40
- const extraContent = extraContentRaw === null || extraContentRaw === void 0 ? void 0 : extraContentRaw.value;
41
- return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)(className, 'nd-Block nd-Editorial', schema_1.BlockConfig.Theme.getClassName((_d = (_c = model === null || model === void 0 ? void 0 : model.config) === null || _c === void 0 ? void 0 : _c.theme) === null || _d === void 0 ? void 0 : _d.value), schema_1.BlockConfig.VisualLayout.getClassName((_f = (_e = model === null || model === void 0 ? void 0 : model.config) === null || _e === void 0 ? void 0 : _e.visualLayout) === null || _f === void 0 ? void 0 : _f.value)) }, props, { children: (0, jsx_runtime_1.jsxs)("div", { className: "nd-Editorial-content", children: [(title || headline || caption || ctas.length > 0) &&
42
- (0, jsx_runtime_1.jsxs)("div", { className: "nd-Editorial-headerWrap", children: [(0, jsx_runtime_1.jsxs)("div", { className: "nd-Editorial-header", children: [title &&
43
- (0, jsx_runtime_1.jsx)(fields_1.Title, { className: "nd-Editorial-title", as: titleTag, title: title }), headline &&
44
- (0, jsx_runtime_1.jsx)(fields_1.Headline, { className: "nd-Editorial-headline", as: headlineTag, headline: headline }), caption &&
45
- (0, jsx_runtime_1.jsx)(fields_1.Caption, { className: "nd-Editorial-caption", as: captionTag, caption: caption }), ctas.length > 0 &&
46
- (0, jsx_runtime_1.jsx)("div", { className: "nd-Editorial-ctas", children: ctas.map(cta => (0, jsx_runtime_1.jsx)(fields_1.Link, { className: "nd-Editorial-cta", link: cta.value }, cta.id)) })] }), headerDecorator] }), (0, jsx_runtime_1.jsx)("div", { className: "nd-Editorial-bodyWrap", children: (0, jsx_runtime_1.jsxs)("div", { className: "nd-Editorial-body", children: [(visual || visualDecorator) &&
47
- (0, jsx_runtime_1.jsxs)("div", { className: "nd-Editorial-visualWrap", children: [visual &&
48
- (0, jsx_runtime_1.jsx)(fields_1.Visual, { className: "nd-Editorial-visual", visual: visual, loading: visualLoading }), visualDecorator] }), (0, jsx_runtime_1.jsxs)("div", { className: "nd-Editorial-columns", children: [(0, jsx_runtime_1.jsx)(fields_1.FreeFormContent, { as: freeFormContentTag, className: "nd-Editorial-freeFormContent", content: content }), extraContent &&
49
- (0, jsx_runtime_1.jsx)(fields_1.FreeFormContent, { as: freeFormContentTag, className: "nd-Editorial-freeFormContent", content: extraContent })] })] }) })] }) })));
50
- }
51
- // extension
52
- (function (Editorial) {
53
- // schema
54
- Editorial.schema = funnel_core_1.Schema.Block.create({
55
- id: '_nd-editorial',
56
- name: 'Editorial',
57
- version: 1,
58
- config: {
59
- theme: schema_1.BlockConfig.Theme.schema,
60
- visualLayout: schema_1.BlockConfig.VisualLayout.schema
61
- },
62
- fields: {
63
- visual: fields_1.Visual.schema.optional(),
64
- title: fields_1.Title.schema.modify({ description: 'A short intro or heading for the message' }).optional(),
65
- headline: fields_1.Headline.schema.optional(),
66
- caption: fields_1.Caption.schema.optional(),
67
- ctas: funnel_core_1.Schema.Field.list({
68
- name: 'CTAs',
69
- description: 'Add your call-to-actions in the order you\'d like them to appear *(these are optional)*.',
70
- itemTypes: {
71
- cta: funnel_core_1.Schema.Field.link({ name: 'Call to Action' })
72
- },
73
- min: 1,
74
- max: 2
75
- }).optional(),
76
- content: fields_1.FreeFormContent.schema.full,
77
- extraContent: fields_1.FreeFormContent.schema.full.optional()
78
- }
79
- });
80
- })(Editorial || (exports.Editorial = Editorial = {}));