@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,176 @@
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/publication-links.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
+ getAsArray = module_objectPath_module.getAsArray,
10
+ getAsObject = module_objectPath_module.getAsObject,
11
+ module_defaultValue = require("@mindful-web/marko-core/utils/default-value"),
12
+ defaultValue = module_defaultValue.default || module_defaultValue,
13
+ marko_forOf = require("marko/dist/runtime/helpers/for-of"),
14
+ helpers_escape_xml = require("marko/dist/runtime/html/helpers/escape-xml"),
15
+ marko_escapeXml = helpers_escape_xml.x,
16
+ marko_web_magazine_publication_subscribe_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/subscribe-url.marko"),
17
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
18
+ marko_web_magazine_publication_subscribe_url_tag = marko_loadTag(marko_web_magazine_publication_subscribe_url_template),
19
+ marko_web_magazine_publication_renewal_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/renewal-url.marko"),
20
+ marko_web_magazine_publication_renewal_url_tag = marko_loadTag(marko_web_magazine_publication_renewal_url_template),
21
+ marko_web_magazine_publication_cancel_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/cancel-url.marko"),
22
+ marko_web_magazine_publication_cancel_url_tag = marko_loadTag(marko_web_magazine_publication_cancel_url_template),
23
+ marko_web_magazine_publication_change_address_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/change-address-url.marko"),
24
+ marko_web_magazine_publication_change_address_url_tag = marko_loadTag(marko_web_magazine_publication_change_address_url_template),
25
+ marko_web_magazine_issue_digital_edition_url_template = require("@mindful-web/marko-web/components/element/magazine-issue/digital-edition-url.marko"),
26
+ marko_web_magazine_issue_digital_edition_url_tag = marko_loadTag(marko_web_magazine_issue_digital_edition_url_template),
27
+ marko_web_magazine_issue_pdf_url_template = require("@mindful-web/marko-web/components/element/magazine-issue/pdf-url.marko"),
28
+ marko_web_magazine_issue_pdf_url_tag = marko_loadTag(marko_web_magazine_issue_pdf_url_template),
29
+ marko_web_magazine_publication_name_template = require("@mindful-web/marko-web/components/element/magazine-publication/name.marko"),
30
+ marko_web_magazine_publication_name_tag = marko_loadTag(marko_web_magazine_publication_name_template),
31
+ marko_web_magazine_publication_reprints_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/reprints-url.marko"),
32
+ marko_web_magazine_publication_reprints_url_tag = marko_loadTag(marko_web_magazine_publication_reprints_url_template),
33
+ marko_web_magazine_publication_einquiry_url_template = require("@mindful-web/marko-web/components/element/magazine-publication/einquiry-url.marko"),
34
+ marko_web_magazine_publication_einquiry_url_tag = marko_loadTag(marko_web_magazine_publication_einquiry_url_template);
35
+
36
+ function render(input, out, __component, component, state) {
37
+ var data = input;
38
+
39
+ const { site, i18n } = out.global;
40
+
41
+ const buttons = input.buttons || defaultValue(site.get("magazine.links"), ["subscribe", "digital-edition", "pdf", "archives", "change-address", "renewal", "cancel", "reprints", "e-inquiry"]);
42
+
43
+ const link = { class: "magazine-link" };
44
+
45
+ const targetBlankLink = {
46
+ ...link,
47
+ target: "_blank"
48
+ };
49
+
50
+ const issue = getAsObject(input, "issue");
51
+
52
+ var $for$0 = 0;
53
+
54
+ marko_forOf(buttons, function(button) {
55
+ var $keyScope$0 = "[" + (($for$0++) + "]");
56
+
57
+ if (button === "subscribe") {
58
+ marko_web_magazine_publication_subscribe_url_tag({
59
+ tag: null,
60
+ obj: issue.publication,
61
+ link: targetBlankLink,
62
+ renderBody: function(out) {
63
+ out.w(marko_escapeXml(i18n("Subscribe")));
64
+ }
65
+ }, out, __component, "0" + $keyScope$0);
66
+ }
67
+
68
+ if (button === "renewal") {
69
+ marko_web_magazine_publication_renewal_url_tag({
70
+ tag: null,
71
+ obj: issue.publication,
72
+ link: targetBlankLink,
73
+ renderBody: function(out) {
74
+ out.w(marko_escapeXml(i18n("Renew")));
75
+ }
76
+ }, out, __component, "1" + $keyScope$0);
77
+ }
78
+
79
+ if (button === "cancel") {
80
+ marko_web_magazine_publication_cancel_url_tag({
81
+ tag: null,
82
+ obj: issue.publication,
83
+ link: targetBlankLink,
84
+ renderBody: function(out) {
85
+ out.w(marko_escapeXml(i18n("Cancel")));
86
+ }
87
+ }, out, __component, "2" + $keyScope$0);
88
+ }
89
+
90
+ if (button === "change-address") {
91
+ marko_web_magazine_publication_change_address_url_tag({
92
+ tag: null,
93
+ obj: issue.publication,
94
+ link: targetBlankLink,
95
+ renderBody: function(out) {
96
+ out.w(marko_escapeXml(i18n("Change Address")));
97
+ }
98
+ }, out, __component, "3" + $keyScope$0);
99
+ }
100
+
101
+ if (button === "digital-edition") {
102
+ marko_web_magazine_issue_digital_edition_url_tag({
103
+ tag: null,
104
+ obj: issue,
105
+ link: targetBlankLink,
106
+ renderBody: function(out) {
107
+ out.w(marko_escapeXml(i18n("Digital Edition")));
108
+ }
109
+ }, out, __component, "4" + $keyScope$0);
110
+ }
111
+
112
+ if (button === "pdf") {
113
+ marko_web_magazine_issue_pdf_url_tag({
114
+ tag: null,
115
+ obj: issue,
116
+ link: targetBlankLink,
117
+ renderBody: function(out) {
118
+ out.w(marko_escapeXml(i18n("Download PDF")));
119
+ }
120
+ }, out, __component, "5" + $keyScope$0);
121
+ }
122
+
123
+ if (button === "archives") {
124
+ marko_web_magazine_publication_name_tag({
125
+ tag: null,
126
+ obj: issue.publication,
127
+ link: link,
128
+ renderBody: function(out) {
129
+ out.w(marko_escapeXml(i18n("Archives")));
130
+ }
131
+ }, out, __component, "6" + $keyScope$0);
132
+ }
133
+
134
+ if (button === "reprints") {
135
+ marko_web_magazine_publication_reprints_url_tag({
136
+ tag: null,
137
+ obj: issue.publication,
138
+ link: targetBlankLink,
139
+ renderBody: function(out) {
140
+ out.w(marko_escapeXml(i18n("Reprints")));
141
+ }
142
+ }, out, __component, "7" + $keyScope$0);
143
+ }
144
+
145
+ if (button === "e-inquiry") {
146
+ marko_web_magazine_publication_einquiry_url_tag({
147
+ tag: null,
148
+ obj: issue.publication,
149
+ link: targetBlankLink,
150
+ renderBody: function(out) {
151
+ out.w(marko_escapeXml(i18n("E-Inquiry")));
152
+ }
153
+ }, out, __component, "8" + $keyScope$0);
154
+ }
155
+ });
156
+ }
157
+
158
+ marko_template._ = marko_renderer(render, {
159
+ d_: true,
160
+ e_: marko_componentType
161
+ });
162
+
163
+ marko_template.meta = {
164
+ id: "/@mindful-web/marko-web-theme-monorail-magazine$1.0.0/components/publication-links.marko",
165
+ tags: [
166
+ "@mindful-web/marko-web/components/element/magazine-publication/subscribe-url.marko",
167
+ "@mindful-web/marko-web/components/element/magazine-publication/renewal-url.marko",
168
+ "@mindful-web/marko-web/components/element/magazine-publication/cancel-url.marko",
169
+ "@mindful-web/marko-web/components/element/magazine-publication/change-address-url.marko",
170
+ "@mindful-web/marko-web/components/element/magazine-issue/digital-edition-url.marko",
171
+ "@mindful-web/marko-web/components/element/magazine-issue/pdf-url.marko",
172
+ "@mindful-web/marko-web/components/element/magazine-publication/name.marko",
173
+ "@mindful-web/marko-web/components/element/magazine-publication/reprints-url.marko",
174
+ "@mindful-web/marko-web/components/element/magazine-publication/einquiry-url.marko"
175
+ ]
176
+ };
@@ -0,0 +1,19 @@
1
+ const gql = require('graphql-tag');
2
+
3
+ module.exports = gql`
4
+
5
+ fragment MagazinePublicationCardIssueArchiveFragment on MagazineIssue {
6
+ id
7
+ name
8
+ canonicalPath
9
+ coverImage {
10
+ id
11
+ src
12
+ }
13
+ publication {
14
+ id
15
+ name
16
+ }
17
+ }
18
+
19
+ `;
@@ -0,0 +1,28 @@
1
+ const gql = require('graphql-tag');
2
+
3
+ module.exports = gql`
4
+
5
+ fragment MagazinePublicationCardLatestIssueFragment on MagazineIssue {
6
+ id
7
+ name
8
+ digitalEditionUrl
9
+ canonicalPath
10
+ fileSrc
11
+ coverImage {
12
+ id
13
+ src
14
+ }
15
+ publication {
16
+ id
17
+ name
18
+ subscribeUrl
19
+ cancelUrl
20
+ changeAddressUrl
21
+ renewalUrl
22
+ reprintsUrl
23
+ einquiryUrl
24
+ canonicalPath
25
+ }
26
+ }
27
+
28
+ `;
@@ -0,0 +1,33 @@
1
+ const gql = require('graphql-tag');
2
+
3
+ module.exports = gql`
4
+
5
+ fragment MagazineFeedContentFragment on Content {
6
+ id
7
+ type
8
+ shortName
9
+ labels
10
+ teaser(input: { useFallback: false, maxLength: null })
11
+ siteContext {
12
+ path
13
+ }
14
+ published
15
+ primarySection {
16
+ id
17
+ name
18
+ fullName
19
+ canonicalPath
20
+ }
21
+ primaryImage {
22
+ id
23
+ src(input: { options: { auto: "format,compress" } })
24
+ alt
25
+ isLogo
26
+ }
27
+ ... on ContentWebinar {
28
+ linkUrl
29
+ startDate
30
+ }
31
+ }
32
+
33
+ `;
@@ -0,0 +1,19 @@
1
+ const gql = require('graphql-tag');
2
+
3
+ module.exports = gql`
4
+
5
+ fragment MagazineIssueArchiveFragment on MagazineIssue {
6
+ id
7
+ name
8
+ canonicalPath
9
+ coverImage {
10
+ id
11
+ src(input: { options: { auto: "format,compress", q: 70 } })
12
+ }
13
+ publication {
14
+ id
15
+ name
16
+ }
17
+ }
18
+
19
+ `;
@@ -0,0 +1,31 @@
1
+ const gql = require('graphql-tag');
2
+
3
+ module.exports = gql`
4
+
5
+ fragment MagazineIssuePageFragment on MagazineIssue {
6
+ id
7
+ name
8
+ description
9
+ digitalEditionUrl
10
+ canonicalPath
11
+ fileSrc
12
+ coverImage {
13
+ id
14
+ src(input: { options: { auto: "format,compress", q: 70 } })
15
+ }
16
+ mailDate(input: { format: "x" })
17
+ publication {
18
+ id
19
+ name
20
+ description
21
+ subscribeUrl
22
+ cancelUrl
23
+ changeAddressUrl
24
+ renewalUrl
25
+ reprintsUrl
26
+ einquiryUrl
27
+ canonicalPath
28
+ }
29
+ }
30
+
31
+ `;
@@ -0,0 +1,30 @@
1
+ const gql = require('graphql-tag');
2
+
3
+ module.exports = gql`
4
+
5
+ fragment MagazineCurrentIssueFragment on MagazineIssue {
6
+ id
7
+ name
8
+ description
9
+ digitalEditionUrl
10
+ canonicalPath
11
+ fileSrc
12
+ coverImage {
13
+ id
14
+ src(input: { options: { auto: "format,compress", q: 70 } })
15
+ }
16
+ publication {
17
+ id
18
+ name
19
+ description
20
+ subscribeUrl
21
+ cancelUrl
22
+ changeAddressUrl
23
+ renewalUrl
24
+ reprintsUrl
25
+ einquiryUrl
26
+ canonicalPath
27
+ }
28
+ }
29
+
30
+ `;
@@ -0,0 +1,11 @@
1
+ const gql = require('graphql-tag');
2
+
3
+ module.exports = gql`
4
+
5
+ fragment MagazinePublicationListFragment on MagazinePublication {
6
+ id
7
+ name
8
+ canonicalPath
9
+ }
10
+
11
+ `;
@@ -0,0 +1,12 @@
1
+ const gql = require('graphql-tag');
2
+
3
+ module.exports = gql`
4
+
5
+ fragment MagazinePublicationPageFragment on MagazinePublication {
6
+ id
7
+ name
8
+ description
9
+ canonicalPath
10
+ }
11
+
12
+ `;
@@ -0,0 +1,33 @@
1
+ const gql = require('graphql-tag');
2
+
3
+ module.exports = gql`
4
+
5
+ fragment SectionFeedBlockContentFragment on Content {
6
+ id
7
+ type
8
+ shortName
9
+ labels
10
+ teaser(input: { useFallback: false, maxLength: null })
11
+ siteContext {
12
+ path
13
+ }
14
+ published
15
+ primarySection {
16
+ id
17
+ name
18
+ fullName
19
+ canonicalPath
20
+ }
21
+ primaryImage {
22
+ id
23
+ src(input: { options: { auto: "format,compress" } })
24
+ alt
25
+ isLogo
26
+ }
27
+ ... on ContentWebinar {
28
+ linkUrl
29
+ startDate
30
+ }
31
+ }
32
+
33
+ `;
package/index.js ADDED
File without changes
package/marko.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "taglib-imports": [
3
+ "./components/marko.json"
4
+ ]
5
+ }
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@mindful-web/marko-web-theme-monorail-magazine",
3
+ "version": "1.0.0",
4
+ "description": "Magazine components, routes, and styling for the Monorail theme",
5
+ "repository": "https://github.com/parameter1/mindful-web/tree/main/packages/marko-web-theme-monorail-magazine",
6
+ "author": "Brandon Krigbaum <brandon@parameter1.com>",
7
+ "license": "MIT",
8
+ "main": "index.js",
9
+ "scripts": {
10
+ "lint:fix": "yarn lint --fix",
11
+ "lint": "eslint --ext .js --ext .vue --max-warnings 5 --ignore-path ../../.eslintignore ./",
12
+ "compile": "mindful-web-marko-compile compile",
13
+ "prepublish": "yarn compile --silent",
14
+ "test": "yarn compile --no-clean && yarn lint"
15
+ },
16
+ "dependencies": {
17
+ "@mindful-web/marko-web-gtm": "^1.0.0",
18
+ "@mindful-web/object-path": "^1.0.0",
19
+ "@mindful-web/utils": "^1.0.0",
20
+ "@mindful-web/web-common": "^1.0.0",
21
+ "graphql": "^14.7.0",
22
+ "graphql-tag": "^2.12.6",
23
+ "object-path": "^0.11.8"
24
+ },
25
+ "peerDependencies": {
26
+ "@mindful-web/marko-core": "^0.0.0",
27
+ "@mindful-web/marko-web": "^0.0.0",
28
+ "@mindful-web/marko-web-theme-monorail": "^0.0.0"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "gitHead": "0b77cab713eb5841202bb86c7119949866bc68b5"
34
+ }
@@ -0,0 +1,22 @@
1
+ const { withMagazineIssue, withMagazinePublication } = require('@mindful-web/marko-web/middleware');
2
+ const index = require('../templates/index');
3
+ const publication = require('../templates/publication');
4
+ const publicationFragment = require('../graphql/fragments/magazine-publication-page');
5
+ const issue = require('../templates/issue');
6
+ const issueFragment = require('../graphql/fragments/magazine-issue-page');
7
+
8
+ module.exports = (app, templates = {}, fragments = {}) => {
9
+ app.get('/magazine', (req, res) => {
10
+ res.marko(templates.index || index);
11
+ });
12
+
13
+ app.get('/magazine/:id([a-fA-F0-9]{24})', withMagazinePublication({
14
+ template: templates.publication || publication,
15
+ queryFragment: fragments.publicationFragment || publicationFragment,
16
+ }));
17
+
18
+ app.get('/magazine/:id(\\d+)', withMagazineIssue({
19
+ template: templates.issue || issue,
20
+ queryFragment: fragments.issueFragment || issueFragment,
21
+ }));
22
+ };