@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
package/.eslintignore ADDED
@@ -0,0 +1 @@
1
+ *.marko.js
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Parameter1 LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,4 @@
1
+ marko-web-theme-monorail-magazine
2
+ ===
3
+
4
+ Provides support for displaying publications and issues within the mindful-web monorail theme.
@@ -0,0 +1,23 @@
1
+ import { getAsObject } from "@mindful-web/object-path";
2
+ import { defaultValue } from "@mindful-web/marko-web/utils";
3
+
4
+ $ const issue = getAsObject(input, "node");
5
+ $ const coverImage = getAsObject(issue, "coverImage");
6
+ $ const alt = issue.name;
7
+
8
+ <marko-web-node
9
+ image-position="top"
10
+ card=true
11
+ flush=true
12
+ full-height=true
13
+ >
14
+ <@image
15
+ src=coverImage.src
16
+ alt=(coverImage.alt || alt)
17
+ fluid=true
18
+ ar="3:4"
19
+ width=190
20
+ link={ href: issue.canonicalPath, title: alt }
21
+ options={ fit: "max" }
22
+ />
23
+ </marko-web-node>
@@ -0,0 +1,58 @@
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/components/blocks/magazine-archived-issue.marko",
6
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
7
+ module_objectPath_module = require("@mindful-web/object-path"),
8
+ objectPath_module = module_objectPath_module.default || module_objectPath_module,
9
+ getAsObject = module_objectPath_module.getAsObject,
10
+ module_utils_module = require("@mindful-web/marko-web/utils"),
11
+ utils_module = module_utils_module.default || module_utils_module,
12
+ defaultValue = module_utils_module.defaultValue,
13
+ marko_web_node_template = require("@mindful-web/marko-web/components/node/index.marko"),
14
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
15
+ marko_web_node_tag = marko_loadTag(marko_web_node_template);
16
+
17
+ function render(input, out, __component, component, state) {
18
+ var data = input;
19
+
20
+ const issue = getAsObject(input, "node");
21
+
22
+ const coverImage = getAsObject(issue, "coverImage");
23
+
24
+ const alt = issue.name;
25
+
26
+ marko_web_node_tag({
27
+ imagePosition: "top",
28
+ card: true,
29
+ flush: true,
30
+ fullHeight: true,
31
+ image: {
32
+ src: coverImage.src,
33
+ alt: coverImage.alt || alt,
34
+ fluid: true,
35
+ ar: "3:4",
36
+ width: 190,
37
+ link: {
38
+ href: issue.canonicalPath,
39
+ title: alt
40
+ },
41
+ options: {
42
+ fit: "max"
43
+ }
44
+ }
45
+ }, out, __component, "0");
46
+ }
47
+
48
+ marko_template._ = marko_renderer(render, {
49
+ d_: true,
50
+ e_: marko_componentType
51
+ });
52
+
53
+ marko_template.meta = {
54
+ id: "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/components/blocks/magazine-archived-issue.marko",
55
+ tags: [
56
+ "@mindful-web/marko-web/components/node/index.marko"
57
+ ]
58
+ };
@@ -0,0 +1,43 @@
1
+ import { getAsObject } from "@mindful-web/object-path";
2
+ import { defaultValue } from "@mindful-web/marko-web/utils";
3
+ import latestIssueFragment from "@mindful-web/marko-web-theme-monorail-magazine/graphql/fragments/magazine-latest-issue";
4
+
5
+ $ const { publicationId } = input;
6
+
7
+ $ const title = defaultValue(input.title, "In Print");
8
+ $ const linkTitle = defaultValue(input.linkTitle, false);
9
+ $ const buttons = defaultValue(input.buttons, ['subscribe', 'digital-edition', 'archives']);
10
+
11
+ <marko-web-query|{ node: issue }|
12
+ name="magazine-latest-issue"
13
+ params={ publicationId, queryFragment: latestIssueFragment, requiresCoverImage: true }
14
+ >
15
+ <marko-web-node-list
16
+ inner-justified=false
17
+ flush-x=true
18
+ flush-y=true
19
+ modifiers=[
20
+ "latest-issue",
21
+ ]
22
+ header=input.header
23
+ footer=input.footer
24
+ ...input.nodeList
25
+ >
26
+ <@header>
27
+ <marko-web-magazine-issue-name tag=null obj=issue link=linkTitle>
28
+ ${title}
29
+ </marko-web-magazine-issue-name>
30
+ </@header>
31
+ <@nodes nodes=[issue]>
32
+ <@slot|{ node: issue }| position="at" index=0>
33
+ <theme-magazine-latest-issue-node node=issue />
34
+ </@slot>
35
+ </@nodes>
36
+ <@footer>
37
+ <theme-magazine-publication-buttons
38
+ issue=issue
39
+ buttons=buttons
40
+ />
41
+ </@footer>
42
+ </marko-web-node-list>
43
+ </marko-web-query>
@@ -0,0 +1,120 @@
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/components/blocks/magazine-current-issue.marko",
6
+ marko_component = require("./magazine-current-issue.marko"),
7
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
8
+ module_objectPath_module = require("@mindful-web/object-path"),
9
+ objectPath_module = module_objectPath_module.default || module_objectPath_module,
10
+ getAsObject = module_objectPath_module.getAsObject,
11
+ module_utils_module = require("@mindful-web/marko-web/utils"),
12
+ utils_module = module_utils_module.default || module_utils_module,
13
+ defaultValue = module_utils_module.defaultValue,
14
+ module_latestIssueFragment = require("@mindful-web/marko-web-theme-monorail-magazine/graphql/fragments/magazine-latest-issue"),
15
+ latestIssueFragment = module_latestIssueFragment.default || module_latestIssueFragment,
16
+ helpers_escape_xml = require("marko/dist/runtime/html/helpers/escape-xml"),
17
+ marko_escapeXml = helpers_escape_xml.x,
18
+ marko_web_magazine_issue_name_template = require("@mindful-web/marko-web/components/element/magazine-issue/name.marko"),
19
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
20
+ marko_web_magazine_issue_name_tag = marko_loadTag(marko_web_magazine_issue_name_template),
21
+ theme_magazine_latest_issue_node_template = require("../nodes/magazine-latest-issue.marko"),
22
+ theme_magazine_latest_issue_node_tag = marko_loadTag(theme_magazine_latest_issue_node_template),
23
+ theme_magazine_publication_buttons_template = require("../publication-buttons.marko"),
24
+ theme_magazine_publication_buttons_tag = marko_loadTag(theme_magazine_publication_buttons_template),
25
+ marko_assign = require("marko/dist/runtime/helpers/assign"),
26
+ marko_web_node_list_template = require("@mindful-web/marko-web/components/node-list/index.marko"),
27
+ marko_web_node_list_tag = marko_loadTag(marko_web_node_list_template),
28
+ marko_web_query_template = require("@mindful-web/marko-core/components/queries/index.marko"),
29
+ marko_web_query_tag = marko_loadTag(marko_web_query_template);
30
+
31
+ function render(input, out, __component, component, state) {
32
+ var data = input;
33
+
34
+ const { publicationId } = input;
35
+
36
+ const title = defaultValue(input.title, "In Print");
37
+
38
+ const linkTitle = defaultValue(input.linkTitle, false);
39
+
40
+ const buttons = defaultValue(input.buttons, ['subscribe', 'digital-edition', 'archives']);
41
+
42
+ marko_web_query_tag({
43
+ collapsible: true,
44
+ name: "magazine-latest-issue",
45
+ params: {
46
+ publicationId: publicationId,
47
+ queryFragment: latestIssueFragment,
48
+ requiresCoverImage: true
49
+ },
50
+ renderBody: function(out, { node: issue }) {
51
+ marko_web_node_list_tag(marko_assign({
52
+ blockName: "node-list",
53
+ tag: "div",
54
+ justified: false,
55
+ innerJustified: false,
56
+ flushX: true,
57
+ flushY: true,
58
+ fullHeight: false,
59
+ collapsible: true,
60
+ modifiers: [
61
+ "latest-issue"
62
+ ],
63
+ header: {
64
+ renderBody: function(out) {
65
+ marko_web_magazine_issue_name_tag({
66
+ tag: null,
67
+ obj: issue,
68
+ link: linkTitle,
69
+ renderBody: function(out) {
70
+ out.w(marko_escapeXml(title));
71
+ }
72
+ }, out, __component, "3");
73
+ }
74
+ },
75
+ footer: {
76
+ renderBody: function(out) {
77
+ theme_magazine_publication_buttons_tag({
78
+ issue: issue,
79
+ buttons: buttons
80
+ }, out, __component, "8");
81
+ }
82
+ }
83
+ }, input.nodeList, {
84
+ nodes: {
85
+ nodes: [
86
+ issue
87
+ ],
88
+ slots: [
89
+ {
90
+ position: "at",
91
+ index: 0,
92
+ renderBody: function(out, { node: issue }) {
93
+ theme_magazine_latest_issue_node_tag({
94
+ imageWidth: 300,
95
+ node: issue
96
+ }, out, __component, "6");
97
+ }
98
+ }
99
+ ]
100
+ }
101
+ }), out, __component, "1");
102
+ }
103
+ }, out, __component, "0");
104
+ }
105
+
106
+ marko_template._ = marko_renderer(render, {
107
+ e_: marko_componentType
108
+ }, marko_component);
109
+
110
+ marko_template.meta = {
111
+ id: "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/components/blocks/magazine-current-issue.marko",
112
+ component: "./magazine-current-issue.marko",
113
+ tags: [
114
+ "@mindful-web/marko-web/components/element/magazine-issue/name.marko",
115
+ "../nodes/magazine-latest-issue.marko",
116
+ "../publication-buttons.marko",
117
+ "@mindful-web/marko-web/components/node-list/index.marko",
118
+ "@mindful-web/marko-core/components/queries/index.marko"
119
+ ]
120
+ };
@@ -0,0 +1,33 @@
1
+ import defaultValue from "@mindful-web/marko-core/utils/default-value";
2
+ import queryFragment from "../../graphql/fragments/section-feed-block";
3
+
4
+ $ const queryParams = {
5
+ ...input.queryParams,
6
+ sectionAlias: input.alias,
7
+ queryFragment,
8
+ };
9
+
10
+ $ const blockName = "section-feed";
11
+ $ const countOnly = defaultValue(input.countOnly, false);
12
+
13
+ <if(countOnly)>
14
+ <theme-query-total-count|data| name="website-scheduled-content" params=queryParams>
15
+ <${input.renderBody} ...data />
16
+ </theme-query-total-count>
17
+ </if>
18
+ <else>
19
+ <marko-web-query|{ nodes }| name="website-scheduled-content" params=queryParams>
20
+ <marko-web-node-list
21
+ inner-justified=true
22
+ flush-x=true
23
+ flush-y=false
24
+ modifiers=[blockName]
25
+ >
26
+ <@nodes nodes=nodes>
27
+ <@slot|{ node }|>
28
+ <theme-section-feed-content-node node=node />
29
+ </@slot>
30
+ </@nodes>
31
+ </marko-web-node-list>
32
+ </marko-web-query>
33
+ </else>
@@ -0,0 +1,95 @@
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/components/blocks/magazine-issue-cards.marko",
6
+ marko_component = require("./magazine-issue-cards.marko"),
7
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
8
+ module_defaultValue = require("@mindful-web/marko-core/utils/default-value"),
9
+ defaultValue = module_defaultValue.default || module_defaultValue,
10
+ module_queryFragment = require("../../graphql/fragments/section-feed-block"),
11
+ queryFragment = module_queryFragment.default || module_queryFragment,
12
+ marko_dynamicTag = require("marko/dist/runtime/helpers/dynamic-tag"),
13
+ theme_query_total_count_template = require("@mindful-web/marko-web-theme-monorail/components/query-total-count.marko"),
14
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
15
+ theme_query_total_count_tag = marko_loadTag(theme_query_total_count_template),
16
+ theme_section_feed_content_node_template = require("@mindful-web/marko-web-theme-monorail/components/nodes/section-feed-content.marko"),
17
+ theme_section_feed_content_node_tag = marko_loadTag(theme_section_feed_content_node_template),
18
+ marko_web_node_list_template = require("@mindful-web/marko-web/components/node-list/index.marko"),
19
+ marko_web_node_list_tag = marko_loadTag(marko_web_node_list_template),
20
+ marko_web_query_template = require("@mindful-web/marko-core/components/queries/index.marko"),
21
+ marko_web_query_tag = marko_loadTag(marko_web_query_template);
22
+
23
+ function render(input, out, __component, component, state) {
24
+ var data = input;
25
+
26
+ const queryParams = {
27
+ ...input.queryParams,
28
+ sectionAlias: input.alias,
29
+ queryFragment,
30
+ };
31
+
32
+ const blockName = "section-feed";
33
+
34
+ const countOnly = defaultValue(input.countOnly, false);
35
+
36
+ if (countOnly) {
37
+ theme_query_total_count_tag({
38
+ name: "website-scheduled-content",
39
+ params: queryParams,
40
+ renderBody: function(out, data) {
41
+ marko_dynamicTag(out, input.renderBody, function() {
42
+ return data;
43
+ }, null, null, null, __component, "1");
44
+ }
45
+ }, out, __component, "0");
46
+ } else {
47
+ marko_web_query_tag({
48
+ collapsible: true,
49
+ name: "website-scheduled-content",
50
+ params: queryParams,
51
+ renderBody: function(out, { nodes }) {
52
+ marko_web_node_list_tag({
53
+ blockName: "node-list",
54
+ tag: "div",
55
+ justified: false,
56
+ innerJustified: true,
57
+ flushX: true,
58
+ flushY: false,
59
+ fullHeight: false,
60
+ collapsible: true,
61
+ modifiers: [
62
+ blockName
63
+ ],
64
+ nodes: {
65
+ nodes: nodes,
66
+ slots: [
67
+ {
68
+ renderBody: function(out, { node }) {
69
+ theme_section_feed_content_node_tag({
70
+ node: node
71
+ }, out, __component, "6");
72
+ }
73
+ }
74
+ ]
75
+ }
76
+ }, out, __component, "3");
77
+ }
78
+ }, out, __component, "2");
79
+ }
80
+ }
81
+
82
+ marko_template._ = marko_renderer(render, {
83
+ e_: marko_componentType
84
+ }, marko_component);
85
+
86
+ marko_template.meta = {
87
+ id: "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/components/blocks/magazine-issue-cards.marko",
88
+ component: "./magazine-issue-cards.marko",
89
+ tags: [
90
+ "@mindful-web/marko-web-theme-monorail/components/query-total-count.marko",
91
+ "@mindful-web/marko-web-theme-monorail/components/nodes/section-feed-content.marko",
92
+ "@mindful-web/marko-web/components/node-list/index.marko",
93
+ "@mindful-web/marko-core/components/queries/index.marko"
94
+ ]
95
+ };
@@ -0,0 +1,53 @@
1
+ import { getAsObject } from "@mindful-web/object-path";
2
+ import queryFragment from "../../graphql/fragments/magazine-latest-issue";
3
+
4
+ $ const { site, i18n } = out.global;
5
+ $ const { publicationId } = input;
6
+ $ const blockName = "magazine-issues"
7
+ $ const linkHeader = input.linkHeader || false;
8
+ $ const title = input.title || "In Print";
9
+
10
+ <marko-web-query|{ nodes }| name="magazine-active-issues"
11
+ params={
12
+ sectionAlias: input.alias,
13
+ publicationId,
14
+ queryFragment,
15
+ limit: 4,
16
+ requiresCoverImage: true
17
+ }
18
+ >
19
+ <marko-web-block name=blockName>
20
+ <marko-web-element block-name=blockName name="wrapper">
21
+ <marko-web-element block-name=blockName name="contents">
22
+ <marko-web-element block-name=blockName name="header">
23
+ <if(linkHeader && input.alias)>
24
+ <marko-web-link href=`${input.alias}`>
25
+ ${title}
26
+ </marko-web-link>
27
+ </if>
28
+ <else>
29
+ ${title}
30
+ </else>
31
+ </marko-web-element>
32
+ <theme-magazine-issue-archive-flow nodes=nodes with-title=input.withTitle flush=true />
33
+ </marko-web-element>
34
+ </marko-web-element>
35
+ <marko-web-element block-name=blockName name="wrapper">
36
+ <marko-web-element block-name=blockName name="contents" modifiers=["buttons"]>
37
+ <marko-web-magazine-publication-subscribe-url
38
+ tag=null
39
+ obj=nodes[0].publication
40
+ link={
41
+ class: "btn btn-primary",
42
+ target: "_blank",
43
+ }
44
+ >
45
+ ${i18n("Subscribe")}
46
+ </marko-web-magazine-publication-subscribe-url>
47
+ <marko-web-link href=`/magazine/${publicationId}` class="btn btn-secondary" >
48
+ ${i18n("Archives")}
49
+ </marko-web-link>
50
+ </marko-web-element>
51
+ </marko-web-element>
52
+ </marko-web-block>
53
+ </marko-web-query>
@@ -0,0 +1,152 @@
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/components/blocks/magazine-issues.marko",
6
+ marko_component = require("./magazine-issues.marko"),
7
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
8
+ module_objectPath_module = require("@mindful-web/object-path"),
9
+ objectPath_module = module_objectPath_module.default || module_objectPath_module,
10
+ getAsObject = module_objectPath_module.getAsObject,
11
+ module_queryFragment = require("../../graphql/fragments/magazine-latest-issue"),
12
+ queryFragment = module_queryFragment.default || module_queryFragment,
13
+ helpers_escape_xml = require("marko/dist/runtime/html/helpers/escape-xml"),
14
+ marko_escapeXml = helpers_escape_xml.x,
15
+ marko_web_link_template = require("@mindful-web/marko-web/components/element/link.marko"),
16
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
17
+ marko_web_link_tag = marko_loadTag(marko_web_link_template),
18
+ marko_web_element_template = require("@mindful-web/marko-web/components/element/index.marko"),
19
+ marko_web_element_tag = marko_loadTag(marko_web_element_template),
20
+ theme_magazine_issue_archive_flow_template = require("../flows/magazine-issue-archive.marko"),
21
+ theme_magazine_issue_archive_flow_tag = marko_loadTag(theme_magazine_issue_archive_flow_template),
22
+ marko_web_magazine_publication_subscribe_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/subscribe-url.marko"),
23
+ marko_web_magazine_publication_subscribe_url_tag = marko_loadTag(marko_web_magazine_publication_subscribe_url_template),
24
+ marko_web_block_template = require("@mindful-web/marko-web/components/element/block.marko"),
25
+ marko_web_block_tag = marko_loadTag(marko_web_block_template),
26
+ marko_web_query_template = require("@mindful-web/marko-core/components/queries/index.marko"),
27
+ marko_web_query_tag = marko_loadTag(marko_web_query_template);
28
+
29
+ function render(input, out, __component, component, state) {
30
+ var data = input;
31
+
32
+ const { site, i18n } = out.global;
33
+
34
+ const { publicationId } = input;
35
+
36
+ const blockName = "magazine-issues"
37
+
38
+ const linkHeader = input.linkHeader || false;
39
+
40
+ const title = input.title || "In Print";
41
+
42
+ marko_web_query_tag({
43
+ collapsible: true,
44
+ name: "magazine-active-issues",
45
+ params: {
46
+ sectionAlias: input.alias,
47
+ publicationId: publicationId,
48
+ queryFragment: queryFragment,
49
+ limit: 4,
50
+ requiresCoverImage: true
51
+ },
52
+ renderBody: function(out, { nodes }) {
53
+ marko_web_block_tag({
54
+ name: blockName,
55
+ tag: "div",
56
+ renderBody: function(out) {
57
+ marko_web_element_tag({
58
+ name: "wrapper",
59
+ tag: "div",
60
+ blockName: blockName,
61
+ renderBody: function(out) {
62
+ marko_web_element_tag({
63
+ name: "contents",
64
+ tag: "div",
65
+ blockName: blockName,
66
+ renderBody: function(out) {
67
+ marko_web_element_tag({
68
+ name: "header",
69
+ tag: "div",
70
+ blockName: blockName,
71
+ renderBody: function(out) {
72
+ if (linkHeader && input.alias) {
73
+ marko_web_link_tag({
74
+ href: "" + input.alias,
75
+ renderBody: function(out) {
76
+ out.w(marko_escapeXml(title));
77
+ }
78
+ }, out, __component, "5");
79
+ } else {
80
+ out.w(marko_escapeXml(title));
81
+ }
82
+ }
83
+ }, out, __component, "4");
84
+
85
+ theme_magazine_issue_archive_flow_tag({
86
+ flush: true,
87
+ withTitle: input.withTitle,
88
+ nodes: nodes
89
+ }, out, __component, "6");
90
+ }
91
+ }, out, __component, "3");
92
+ }
93
+ }, out, __component, "2");
94
+
95
+ marko_web_element_tag({
96
+ name: "wrapper",
97
+ tag: "div",
98
+ blockName: blockName,
99
+ renderBody: function(out) {
100
+ marko_web_element_tag({
101
+ name: "contents",
102
+ tag: "div",
103
+ blockName: blockName,
104
+ modifiers: [
105
+ "buttons"
106
+ ],
107
+ renderBody: function(out) {
108
+ marko_web_magazine_publication_subscribe_url_tag({
109
+ tag: null,
110
+ obj: nodes[0].publication,
111
+ link: {
112
+ class: "btn btn-primary",
113
+ target: "_blank"
114
+ },
115
+ renderBody: function(out) {
116
+ out.w(marko_escapeXml(i18n("Subscribe")));
117
+ }
118
+ }, out, __component, "9");
119
+
120
+ marko_web_link_tag({
121
+ href: "/magazine/" + publicationId,
122
+ class: "btn btn-secondary",
123
+ renderBody: function(out) {
124
+ out.w(marko_escapeXml(i18n("Archives")));
125
+ }
126
+ }, out, __component, "10");
127
+ }
128
+ }, out, __component, "8");
129
+ }
130
+ }, out, __component, "7");
131
+ }
132
+ }, out, __component, "1");
133
+ }
134
+ }, out, __component, "0");
135
+ }
136
+
137
+ marko_template._ = marko_renderer(render, {
138
+ e_: marko_componentType
139
+ }, marko_component);
140
+
141
+ marko_template.meta = {
142
+ id: "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/components/blocks/magazine-issues.marko",
143
+ component: "./magazine-issues.marko",
144
+ tags: [
145
+ "@mindful-web/marko-web/components/element/link.marko",
146
+ "@mindful-web/marko-web/components/element/index.marko",
147
+ "../flows/magazine-issue-archive.marko",
148
+ "@mindful-web/marko-web/components/element/magazine-publication/subscribe-url.marko",
149
+ "@mindful-web/marko-web/components/element/block.marko",
150
+ "@mindful-web/marko-core/components/queries/index.marko"
151
+ ]
152
+ };
@@ -0,0 +1,34 @@
1
+ import { getAsObject } from "@mindful-web/object-path";
2
+ import { defaultValue } from "@mindful-web/marko-web/utils";
3
+
4
+ $ const issue = getAsObject(input, "node");
5
+ $ const publication = getAsObject(issue, "publication");
6
+ $ const coverImage = getAsObject(issue, "coverImage");
7
+ $ const linkTitle = `${publication.name} ${issue.name}`;
8
+ $ const flush = defaultValue(input.flush, true);
9
+ $ const withTitle = defaultValue(input.withTitle, true);
10
+ $ const nodeClass = ["magazine-publication-card-block", input.class].join(" ");
11
+
12
+ <marko-web-node image-position="top" flush=flush class=nodeClass header=input.header>
13
+ <@image
14
+ src=coverImage.src
15
+ alt=(coverImage.alt || linkTitle)
16
+ fluid=true
17
+ ar="3:4"
18
+ width=(input.imageWidth || 300)
19
+ link={ href: issue.canonicalPath, title: linkTitle }
20
+ options={ fit: "max" }
21
+ />
22
+ <@body>
23
+ <if(withTitle)>
24
+ <@title tag="h5">
25
+ <marko-web-magazine-issue-name tag=null obj=issue link={ title: linkTitle } />
26
+ </@title>
27
+ </if>
28
+ <@footer>
29
+ <@left>
30
+ <theme-magazine-publication-buttons publication=publication issue=issue buttons=input.buttons />
31
+ </@left>
32
+ </@footer>
33
+ </@body>
34
+ </marko-web-node>