@mindful-web/marko-web-theme-monorail-magazine 1.0.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.
Files changed (53) hide show
  1. package/.eslintignore +1 -0
  2. package/LICENSE +21 -0
  3. package/README.md +4 -0
  4. package/components/blocks/magazine-archived-issue.marko +23 -0
  5. package/components/blocks/magazine-archived-issue.marko.js +58 -0
  6. package/components/blocks/magazine-current-issue.marko +43 -0
  7. package/components/blocks/magazine-current-issue.marko.js +120 -0
  8. package/components/blocks/magazine-issue-cards.marko +33 -0
  9. package/components/blocks/magazine-issue-cards.marko.js +95 -0
  10. package/components/blocks/magazine-issues.marko +53 -0
  11. package/components/blocks/magazine-issues.marko.js +152 -0
  12. package/components/blocks/magazine-latest-issue.marko +34 -0
  13. package/components/blocks/magazine-latest-issue.marko.js +97 -0
  14. package/components/blocks/magazine-publication-card.marko +36 -0
  15. package/components/blocks/magazine-publication-card.marko.js +125 -0
  16. package/components/blocks/magazine-publications.marko +22 -0
  17. package/components/blocks/magazine-publications.marko.js +88 -0
  18. package/components/blocks/marko.json +23 -0
  19. package/components/flows/magazine-issue-archive.marko +12 -0
  20. package/components/flows/magazine-issue-archive.marko.js +55 -0
  21. package/components/flows/magazine-latest-issue.marko +22 -0
  22. package/components/flows/magazine-latest-issue.marko.js +69 -0
  23. package/components/flows/marko.json +21 -0
  24. package/components/marko.json +13 -0
  25. package/components/nodes/magazine-issue-archive.marko +29 -0
  26. package/components/nodes/magazine-issue-archive.marko.js +78 -0
  27. package/components/nodes/magazine-latest-issue.marko +33 -0
  28. package/components/nodes/magazine-latest-issue.marko.js +76 -0
  29. package/components/nodes/marko.json +21 -0
  30. package/components/publication-buttons.marko +61 -0
  31. package/components/publication-buttons.marko.js +176 -0
  32. package/components/publication-links.marko +61 -0
  33. package/components/publication-links.marko.js +176 -0
  34. package/graphql/fragments/issue-archive.js +19 -0
  35. package/graphql/fragments/latest-issue.js +28 -0
  36. package/graphql/fragments/magazine-content-feed-block.js +33 -0
  37. package/graphql/fragments/magazine-issue-archive.js +19 -0
  38. package/graphql/fragments/magazine-issue-page.js +31 -0
  39. package/graphql/fragments/magazine-latest-issue.js +30 -0
  40. package/graphql/fragments/magazine-publication-list.js +11 -0
  41. package/graphql/fragments/magazine-publication-page.js +12 -0
  42. package/graphql/fragments/section-feed-block.js +33 -0
  43. package/index.js +0 -0
  44. package/marko.json +5 -0
  45. package/package.json +34 -0
  46. package/routes/index.js +22 -0
  47. package/scss/index.scss +241 -0
  48. package/templates/index.marko +28 -0
  49. package/templates/index.marko.js +98 -0
  50. package/templates/issue.marko +96 -0
  51. package/templates/issue.marko.js +279 -0
  52. package/templates/publication.marko +61 -0
  53. package/templates/publication.marko.js +189 -0
@@ -0,0 +1,241 @@
1
+ .magazine-issues {
2
+ $self: &;
3
+ margin-right: $marko-web-page-wrapper-padding * -1;
4
+ margin-left: $marko-web-page-wrapper-padding * -1;
5
+ @include media-breakpoint-down(md) {
6
+ margin-right: -16px;
7
+ margin-left: -16px;
8
+ }
9
+ &__wrapper {
10
+ padding-right: 15px;
11
+ padding-left: 15px;
12
+ background-color: $gray-100;
13
+
14
+ @media (min-width: $marko-web-document-container-max-width) {
15
+ $margin: calc((((100vw - #{$marko-web-document-container-max-width}) / 2) + #{$marko-web-page-wrapper-padding}) * -1);
16
+ margin-right: $margin;
17
+ margin-left: $margin;
18
+
19
+ #{ $self }__contents {
20
+ max-width: $marko-web-document-container-max-width;
21
+ margin-right: auto;
22
+ margin-left: auto;
23
+ }
24
+ }
25
+ + #{ $self }__wrapper {
26
+ background-color: $gray-200;
27
+ }
28
+ }
29
+
30
+ &__header {
31
+ padding-top: 30px;
32
+ padding-bottom: 15px;
33
+ @include skin-typography($style: "section-header-small");
34
+ }
35
+
36
+ &__contents {
37
+ &--buttons {
38
+ display: flex;
39
+ justify-content: center;
40
+ padding-top: 15px;
41
+ padding-bottom: 15px;
42
+ .btn + .btn {
43
+ margin-left: 15px;
44
+ }
45
+ }
46
+ }
47
+
48
+ .card-deck-flow--4-cols {
49
+ .card-deck-flow {
50
+ &__node {
51
+ @include make-col(3);
52
+ @include media-breakpoint-down(sm) {
53
+ @include make-col(6);
54
+ }
55
+ .node {
56
+ &__title {
57
+ text-align: center;
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+
65
+ .magazine-publication-buttons {
66
+ $self: &;
67
+ &__button {
68
+ @extend .btn;
69
+ @extend .btn-sm;
70
+ @extend .btn-primary;
71
+ margin-right: $marko-web-node-spacer;
72
+ margin-bottom: $marko-web-node-spacer;
73
+
74
+ &:last-child {
75
+ margin-right: 0;
76
+ }
77
+ }
78
+
79
+ &--bottom {
80
+ #{ $self } {
81
+ &__button {
82
+ margin-top: $marko-web-node-spacer;
83
+ }
84
+ }
85
+ }
86
+ }
87
+
88
+ .node__text--magazine-publication-links {
89
+ display: flex;
90
+ flex-direction: column;
91
+ }
92
+
93
+
94
+ .magazine-publication-buttons {
95
+ $self: &;
96
+ display: flex;
97
+ #{ $self }__button {
98
+ padding: 12px;
99
+ font-size: 12px;
100
+ white-space: nowrap;
101
+ }
102
+ }
103
+
104
+ .magazine-publication-card-block {
105
+ @include theme-card();
106
+ &__header {
107
+ @include theme-card-header();
108
+ @include border-top-radius($theme-card-border-radius);
109
+ padding: $theme-item-padding ($theme-item-padding + $theme-item-contents-padding);
110
+ margin-bottom: 0;
111
+
112
+ &:empty {
113
+ display: none;
114
+ }
115
+
116
+ &:last-child {
117
+ @include border-bottom-radius(0);
118
+ }
119
+
120
+ a {
121
+ @include theme-card-header-link();
122
+ }
123
+ }
124
+
125
+ &__body {
126
+ padding: $marko-web-node-padding;
127
+ }
128
+
129
+ &--flush {
130
+ border-radius: 0;
131
+ box-shadow: none;
132
+ }
133
+ }
134
+
135
+ .magazine-publication-card-block {
136
+ &__header, &__header a {
137
+ padding-right: 0;
138
+ padding-left: 0;
139
+ @include skin-typography($style: "section-header");
140
+ }
141
+ &__body {
142
+ padding-right: 0;
143
+ padding-left: 0;
144
+ .issue-archive-cover {
145
+ margin-bottom: $block-spacer;
146
+ }
147
+ }
148
+ }
149
+
150
+ .page {
151
+ &--magazine-publication {
152
+ .page-wrapper {
153
+ &__title {
154
+ @include skin-typography($style: "section-header");
155
+ }
156
+ }
157
+ }
158
+ .magazine-publication-card-block {
159
+ &__body {
160
+ padding-right: 10px;
161
+ padding-left: 10px;
162
+ }
163
+ .node {
164
+ &__title {
165
+ @include skin-typography($style: "section-header");
166
+ text-transform: none;
167
+ margin-bottom: 24px;
168
+ }
169
+ &__text {
170
+ &--magazine-publication-links {
171
+ flex-direction: row;
172
+ .btn {
173
+ margin-right: 1rem;
174
+ }
175
+ }
176
+ }
177
+ &__footer-left {
178
+ display: flex;
179
+ justify-content: space-between;
180
+ @include marko-web-node-list-border(border-top);
181
+ width: 100%;
182
+ padding-top: 1rem;
183
+ font-weight: $font-weight-bold;
184
+ .btn {
185
+ padding: 12px;
186
+ font-size: 12px;
187
+ }
188
+ }
189
+ }
190
+ &.sticky-top {
191
+ @media (max-height: 650px) and (min-width: 992px) {
192
+ position: initial;
193
+ }
194
+ }
195
+ }
196
+ }
197
+
198
+ .node-list {
199
+ $self: &;
200
+ &--latest-issue {
201
+ #{ $self }__header {
202
+ @include skin-typography($style: "section-header-small", $link-style: "primary");
203
+ margin-bottom: 1rem;
204
+ }
205
+ #{ $self }__nodes {
206
+ padding-top: 10px;
207
+ }
208
+ #{ $self }__footer {
209
+ display: flex;
210
+ justify-content: space-between;
211
+ @include marko-web-node-list-border(border-top);
212
+ padding-bottom: map-get($spacers, "block");
213
+ font-weight: $font-weight-bold;
214
+ }
215
+ .btn {
216
+ padding: 12px;
217
+ font-size: 14px;
218
+ }
219
+ .node-list {
220
+ &__node:first-child {
221
+ @include marko-web-node-list-border(border-top);
222
+ padding-top: 1rem;
223
+ }
224
+ &__nodes {
225
+ flex-grow: 0;
226
+ padding-top: 0;
227
+ border-bottom: none;
228
+ }
229
+ }
230
+ }
231
+ }
232
+
233
+ // add margin to top of ad below paginated content results
234
+ .page--magazine-issue {
235
+ .pagination-controls + .ad-container--inter-block {
236
+ margin-top: map-get($spacers, block);
237
+ }
238
+ .section-feed-content-node {
239
+ flex-direction: row;
240
+ }
241
+ }
@@ -0,0 +1,28 @@
1
+ $ const { site } = out.global;
2
+
3
+ $ const type = "magazines";
4
+ $ const title = "Magazines";
5
+ $ const description = site.get("magazines.description");
6
+
7
+ <marko-web-default-page-layout type=type title=title description=description>
8
+ <@head>
9
+ <marko-web-gtm-default-context|{ context }| type=type>
10
+ <marko-web-gtm-push data=context />
11
+ </marko-web-gtm-default-context>
12
+ </@head>
13
+ <@page>
14
+ <marko-web-page-wrapper class="mb-block">
15
+ <@section>
16
+ <div class="row">
17
+ <div class="col">
18
+ <h1 class="page-wrapper__title">${title}</h1>
19
+ <if(description)>
20
+ <p class="page-wrapper__deck">${description}</p>
21
+ </if>
22
+ </div>
23
+ </div>
24
+ <theme-magazine-publications-block with-header=false />
25
+ </@section>
26
+ </marko-web-page-wrapper>
27
+ </@page>
28
+ </marko-web-default-page-layout>
@@ -0,0 +1,98 @@
1
+ // Compiled using marko@4.20.2 - DO NOT EDIT
2
+ "use strict";
3
+
4
+ var marko_template = module.exports = require("marko/dist/html").t(__filename),
5
+ marko_componentType = "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/templates/index.marko",
6
+ marko_component = require("./index.marko"),
7
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
8
+ marko_web_gtm_push_template = require("@mindful-web/marko-web-gtm/components/push.marko"),
9
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
10
+ marko_web_gtm_push_tag = marko_loadTag(marko_web_gtm_push_template),
11
+ marko_web_gtm_default_context_template = require("@mindful-web/marko-web-gtm/components/context/default.marko"),
12
+ marko_web_gtm_default_context_tag = marko_loadTag(marko_web_gtm_default_context_template),
13
+ helpers_escape_xml = require("marko/dist/runtime/html/helpers/escape-xml"),
14
+ marko_escapeXml = helpers_escape_xml.x,
15
+ theme_magazine_publications_block_template = require("../components/blocks/magazine-publications.marko"),
16
+ theme_magazine_publications_block_tag = marko_loadTag(theme_magazine_publications_block_template),
17
+ marko_web_page_wrapper_template = require("@mindful-web/marko-web/components/page/wrapper.marko"),
18
+ marko_web_page_wrapper_tag = marko_loadTag(marko_web_page_wrapper_template),
19
+ marko_web_default_page_layout_template = require("@mindful-web/marko-web/components/page/layouts/default.marko"),
20
+ marko_web_default_page_layout_tag = marko_loadTag(marko_web_default_page_layout_template);
21
+
22
+ function render(input, out, __component, component, state) {
23
+ var data = input;
24
+
25
+ const { site } = out.global;
26
+
27
+ const type = "magazines";
28
+
29
+ const title = "Magazines";
30
+
31
+ const description = site.get("magazines.description");
32
+
33
+ marko_web_default_page_layout_tag({
34
+ type: type,
35
+ title: title,
36
+ description: description,
37
+ head: {
38
+ renderBody: function(out) {
39
+ marko_web_gtm_default_context_tag({
40
+ type: type,
41
+ renderBody: function(out, { context }) {
42
+ marko_web_gtm_push_tag({
43
+ name: "dataLayer",
44
+ data: context
45
+ }, out, __component, "3");
46
+ }
47
+ }, out, __component, "2");
48
+ }
49
+ },
50
+ page: {
51
+ renderBody: function(out) {
52
+ marko_web_page_wrapper_tag({
53
+ blockName: "page-wrapper",
54
+ tag: "div",
55
+ class: "mb-block",
56
+ sections: [
57
+ {
58
+ tag: "div",
59
+ renderBody: function(out) {
60
+ out.w("<div class=\"row\"><div class=\"col\"><h1 class=\"page-wrapper__title\">" +
61
+ marko_escapeXml(title) +
62
+ "</h1>");
63
+
64
+ if (description) {
65
+ out.w("<p class=\"page-wrapper__deck\">" +
66
+ marko_escapeXml(description) +
67
+ "</p>");
68
+ }
69
+
70
+ out.w("</div></div>");
71
+
72
+ theme_magazine_publications_block_tag({
73
+ withHeader: false
74
+ }, out, __component, "11");
75
+ }
76
+ }
77
+ ]
78
+ }, out, __component, "5");
79
+ }
80
+ }
81
+ }, out, __component, "0");
82
+ }
83
+
84
+ marko_template._ = marko_renderer(render, {
85
+ e_: marko_componentType
86
+ }, marko_component);
87
+
88
+ marko_template.meta = {
89
+ id: "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/templates/index.marko",
90
+ component: "./index.marko",
91
+ tags: [
92
+ "@mindful-web/marko-web-gtm/components/push.marko",
93
+ "@mindful-web/marko-web-gtm/components/context/default.marko",
94
+ "../components/blocks/magazine-publications.marko",
95
+ "@mindful-web/marko-web/components/page/wrapper.marko",
96
+ "@mindful-web/marko-web/components/page/layouts/default.marko"
97
+ ]
98
+ };
@@ -0,0 +1,96 @@
1
+ import issueFragment from "../graphql/fragments/magazine-issue-archive";
2
+ import contentListFragment from "../graphql/fragments/magazine-content-feed-block";
3
+ import { get, getAsObject } from "@mindful-web/object-path";
4
+
5
+ $ const { site, pagination: p, i18n } = out.global;
6
+ $ const { id, pageNode } = data;
7
+
8
+ <marko-web-magazine-issue-page-layout id=id>
9
+ <@head>
10
+ <marko-web-gtm-magazine-issue-context|{ context }| id=id>
11
+ <marko-web-gtm-push data=context />
12
+ </marko-web-gtm-magazine-issue-context>
13
+ </@head>
14
+ <@page>
15
+ <marko-web-resolve-page|{ data: issue }| node=pageNode>
16
+ <marko-web-page-wrapper class="mb-block">
17
+ <@section>
18
+ <div class="row">
19
+ <div class="col">
20
+ <theme-breadcrumbs modifiers=["website-section"]>
21
+ <@item><marko-web-link href="/magazine">Magazine</marko-web-link></@item>
22
+ <@item><marko-web-magazine-publication-name tag=null obj=issue.publication link=true /></@item>
23
+ </theme-breadcrumbs>
24
+ <h1 class="page-wrapper__title">
25
+ ${issue.name}
26
+ </h1>
27
+ <if(issue.description)>
28
+ <p class="page-wrapper__deck">${issue.description}</p>
29
+ </if>
30
+ </div>
31
+ </div>
32
+ </@section>
33
+
34
+ <@section|{ aliases }|>
35
+ <div class="row">
36
+ <div class="col-lg-4" style="padding-top: 11px;">
37
+ <theme-magazine-latest-issue-block node=issue with-title=false class="sticky-top" />
38
+ </div>
39
+ <div class="col-lg-8">
40
+ $ const contentQueryName = "magazine-scheduled-content";
41
+ $ const contentQueryParams = { issueId: id, queryFragment: contentListFragment };
42
+ $ const perPage = 12;
43
+ <theme-section-feed-block query-name=contentQueryName query-params=contentQueryParams>
44
+ <@query-params ...contentQueryParams limit=perPage skip=p.skip({ perPage }) />
45
+ <@header>
46
+ In This Issue <if(p.page !== 1)>(Page ${p.page})</if>
47
+ </@header>
48
+ <@after>
49
+ <theme-section-feed-block|{ totalCount }| alias=`/magazine/${issue.id}` count-only=true query-name=contentQueryName query-params=contentQueryParams>
50
+ <theme-pagination-controls
51
+ per-page=perPage
52
+ total-count=totalCount
53
+ path=`/magazine/${issue.id}`
54
+ />
55
+ </theme-section-feed-block>
56
+ </@after>
57
+ </theme-section-feed-block>
58
+ </div>
59
+ </div>
60
+ </@section>
61
+
62
+ <@section>
63
+ <marko-web-query|{ nodes }| name="magazine-active-issues"
64
+ params={
65
+ publicationId: issue.publication.id,
66
+ excludeIssueIds: [issue.id],
67
+ queryFragment: issueFragment,
68
+ limit: 12,
69
+ requiresCoverImage: true
70
+ }
71
+ >
72
+ <marko-web-node-list
73
+ inner-justified=true
74
+ flush-x=true
75
+ flush-y=false
76
+ modifiers=["issue-archives"]
77
+ collapsible=false
78
+ >
79
+ <@header>
80
+ ${i18n("Past Issues")}
81
+ </@header>
82
+ <@body>
83
+ <theme-magazine-issue-archive-flow nodes=nodes flush=true />
84
+ </@body>
85
+ <@footer>
86
+ <marko-web-magazine-publication-name tag=null obj=issue.publication link={ class: "btn btn-primary" }>
87
+ ${i18n("View All Past Issues")}
88
+ </marko-web-magazine-publication-name>
89
+ </@footer>
90
+ </marko-web-node-list>
91
+ </marko-web-query>
92
+ </@section>
93
+ </marko-web-page-wrapper>
94
+ </marko-web-resolve-page>
95
+ </@page>
96
+ </marko-web-magazine-issue-page-layout>