@parameter1/base-cms-marko-web 3.17.3 → 4.0.0-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. package/LICENSE +1 -1
  2. package/browser/.eslintrc.js +1 -21
  3. package/browser/components/element-id.js +1 -1
  4. package/browser/components/image-slider.vue +1 -1
  5. package/browser/components/index.js +0 -2
  6. package/browser/index.js +1 -2
  7. package/components/browser-component.marko.js +2 -2
  8. package/components/document/components/body-wrapper.marko.js +2 -2
  9. package/components/document/components/error.marko.js +2 -2
  10. package/components/document/components/live-reload.marko.js +2 -2
  11. package/components/document/components/polyfill.marko.js +2 -2
  12. package/components/document/container.marko.js +2 -2
  13. package/components/document/index.marko +28 -23
  14. package/components/document/index.marko.js +50 -24
  15. package/components/element/array.marko.js +2 -2
  16. package/components/element/audio.marko.js +2 -2
  17. package/components/element/block.marko.js +2 -2
  18. package/components/element/clear.marko.js +2 -2
  19. package/components/element/components/image.marko.js +2 -2
  20. package/components/element/components/text.marko.js +2 -2
  21. package/components/element/content/address1.marko.js +2 -2
  22. package/components/element/content/address2.marko.js +2 -2
  23. package/components/element/content/audio.marko.js +3 -4
  24. package/components/element/content/authors.marko.js +2 -2
  25. package/components/element/content/body.marko.js +2 -2
  26. package/components/element/content/byline.marko.js +2 -2
  27. package/components/element/content/city-state-zip.marko.js +2 -2
  28. package/components/element/content/contributors.marko.js +2 -2
  29. package/components/element/content/country.marko.js +2 -2
  30. package/components/element/content/embed-code.marko.js +2 -2
  31. package/components/element/content/end-date.marko.js +2 -2
  32. package/components/element/content/ends.marko.js +3 -4
  33. package/components/element/content/fax.marko.js +2 -2
  34. package/components/element/content/images.marko.js +3 -4
  35. package/components/element/content/mobile.marko.js +2 -2
  36. package/components/element/content/name.marko.js +2 -2
  37. package/components/element/content/phone.marko.js +2 -2
  38. package/components/element/content/photographers.marko.js +2 -2
  39. package/components/element/content/public-email.marko.js +2 -2
  40. package/components/element/content/published.marko.js +2 -2
  41. package/components/element/content/short-name.marko.js +2 -2
  42. package/components/element/content/sidebar-stubs.marko.js +3 -4
  43. package/components/element/content/sidebars.marko.js +2 -2
  44. package/components/element/content/source.marko.js +2 -2
  45. package/components/element/content/sponsors.marko.js +2 -2
  46. package/components/element/content/start-date.marko.js +2 -2
  47. package/components/element/content/starts.marko.js +3 -4
  48. package/components/element/content/teaser.marko.js +2 -2
  49. package/components/element/content/title.marko.js +2 -2
  50. package/components/element/content/tollfree.marko.js +2 -2
  51. package/components/element/content/transcript.marko.js +53 -0
  52. package/components/element/content/website.marko.js +2 -2
  53. package/components/element/date.marko.js +2 -2
  54. package/components/element/extract-render.js +1 -1
  55. package/components/element/image/caption.marko.js +2 -2
  56. package/components/element/image/credit.marko.js +2 -2
  57. package/components/element/image/display-name.marko.js +2 -2
  58. package/components/element/image/slider.marko.js +3 -4
  59. package/components/element/img.marko.js +2 -2
  60. package/components/element/index.marko.js +2 -2
  61. package/components/element/link.marko.js +2 -2
  62. package/components/element/magazine-issue/description.marko.js +3 -4
  63. package/components/element/magazine-issue/digital-edition-url.marko.js +3 -4
  64. package/components/element/magazine-issue/name.marko.js +3 -4
  65. package/components/element/magazine-issue/pdf-url.marko.js +3 -4
  66. package/components/element/magazine-publication/cancel-url.marko.js +3 -4
  67. package/components/element/magazine-publication/change-address-url.marko.js +3 -4
  68. package/components/element/magazine-publication/description.marko.js +3 -4
  69. package/components/element/magazine-publication/einquiry-url.marko.js +3 -4
  70. package/components/element/magazine-publication/name.marko.js +3 -4
  71. package/components/element/magazine-publication/renewal-url.marko.js +3 -4
  72. package/components/element/magazine-publication/reprints-url.marko.js +3 -4
  73. package/components/element/magazine-publication/subscribe-url.marko.js +3 -4
  74. package/components/element/obj-array.marko.js +2 -2
  75. package/components/element/obj-audio.marko.js +4 -5
  76. package/components/element/obj-date.marko.js +2 -2
  77. package/components/element/obj-nodes.marko.js +2 -2
  78. package/components/element/obj-text.marko.js +2 -2
  79. package/components/element/obj.marko.js +2 -2
  80. package/components/element/object-link.js +1 -1
  81. package/components/element/picture.marko.js +2 -2
  82. package/components/element/text.marko.js +2 -2
  83. package/components/element/website-section/description.marko.js +3 -4
  84. package/components/element/website-section/hierarchy.marko.js +4 -5
  85. package/components/element/website-section/name.marko.js +2 -2
  86. package/components/load-more/index.marko.js +3 -3
  87. package/components/load-more/trigger.marko.js +2 -2
  88. package/components/node/body.marko.js +2 -2
  89. package/components/node/element.marko.js +4 -4
  90. package/components/node/footer.marko.js +2 -2
  91. package/components/node/header.marko.js +2 -2
  92. package/components/node/image-inner-wrapper.marko.js +2 -2
  93. package/components/node/image-wrapper.marko.js +2 -2
  94. package/components/node/image.marko.js +2 -2
  95. package/components/node/index.marko.js +2 -2
  96. package/components/node-list/body.marko.js +2 -2
  97. package/components/node-list/element.marko.js +4 -4
  98. package/components/node-list/footer.marko.js +2 -2
  99. package/components/node-list/header.marko.js +2 -2
  100. package/components/node-list/index.marko.js +2 -2
  101. package/components/node-list/node.marko.js +2 -2
  102. package/components/node-list/nodes.marko.js +2 -2
  103. package/components/page/container.marko.js +2 -2
  104. package/components/page/description.marko.js +2 -2
  105. package/components/page/image.marko.js +2 -2
  106. package/components/page/layouts/content.marko.js +2 -2
  107. package/components/page/layouts/default.marko.js +2 -2
  108. package/components/page/layouts/dynamic-page.marko.js +3 -4
  109. package/components/page/layouts/magazine-issue.marko.js +3 -4
  110. package/components/page/layouts/magazine-publication.marko.js +3 -4
  111. package/components/page/layouts/website-section.marko.js +2 -2
  112. package/components/page/metadata/components/common.marko.js +2 -2
  113. package/components/page/metadata/content.marko.js +2 -2
  114. package/components/page/metadata/default.marko.js +2 -2
  115. package/components/page/metadata/dynamic-page.marko.js +4 -5
  116. package/components/page/metadata/google-structured-data/content.js +2 -2
  117. package/components/page/metadata/magazine-issue.marko.js +4 -5
  118. package/components/page/metadata/magazine-publication.marko.js +4 -5
  119. package/components/page/metadata/website-section.marko.js +2 -2
  120. package/components/page/rel-canonical.marko.js +2 -2
  121. package/components/page/title.marko.js +2 -2
  122. package/components/page/wrapper.marko.js +4 -4
  123. package/components/resolve/page.marko.js +2 -2
  124. package/components/rss/website-section.marko.js +2 -2
  125. package/config/asset-manifest.js +1 -1
  126. package/express/index.js +2 -3
  127. package/express/load-document.js +1 -1
  128. package/express/load-object.js +1 -1
  129. package/express/marko.js +36 -0
  130. package/express/website-context.js +1 -1
  131. package/index.js +5 -0
  132. package/middleware/page-node/index.js +1 -1
  133. package/middleware/page-node/resolved.js +1 -1
  134. package/package.json +40 -31
  135. package/start-server.js +5 -3
  136. package/utils/embedded-media/facebook-oembed.js +1 -2
  137. package/utils/embedded-media/image.js +3 -3
  138. package/utils/embedded-media/instagram-oembed.js +1 -1
  139. package/utils/hierarchy-aliases.js +1 -1
  140. package/utils/hierarchy-ids.js +1 -1
  141. package/utils/render-ssr-component.js +1 -1
  142. package/base-cms-marko-web-0.7.4.tgz +0 -0
  143. package/base-cms-marko-web-0.9.37.tgz +0 -0
  144. package/base-cms-marko-web-0.9.55.tgz +0 -0
  145. package/browser/components/gated-download/form-dot-com.vue +0 -71
  146. package/components/document/components/assets.marko.js +0 -43
  147. package/components/queries/all-author-content.marko.js +0 -38
  148. package/components/queries/all-company-content.marko.js +0 -38
  149. package/components/queries/all-published-content.marko.js +0 -38
  150. package/components/queries/components/loader.marko.js +0 -45
  151. package/components/queries/content.marko.js +0 -38
  152. package/components/queries/dynamic-page.marko.js +0 -38
  153. package/components/queries/index.marko.js +0 -108
  154. package/components/queries/magazine-active-issues.marko.js +0 -38
  155. package/components/queries/magazine-issue.marko.js +0 -38
  156. package/components/queries/magazine-latest-issue.marko.js +0 -38
  157. package/components/queries/magazine-publication.marko.js +0 -38
  158. package/components/queries/magazine-publications.marko.js +0 -38
  159. package/components/queries/magazine-scheduled-content.marko.js +0 -38
  160. package/components/queries/related-published-content.marko.js +0 -38
  161. package/components/queries/website-optioned-content.marko.js +0 -38
  162. package/components/queries/website-scheduled-content.marko.js +0 -38
  163. package/components/queries/website-section.marko.js +0 -38
  164. package/components/resolve/index.marko.js +0 -86
  165. package/node-require.js +0 -6
  166. package/refactor-notes.md +0 -80
  167. package/src/components/ads/gam/define-display.marko.js +0 -63
  168. package/src/components/ads/gam/display.marko.js +0 -41
  169. package/src/components/ads/gam/head.marko.js +0 -48
  170. package/src/components/ads/gam/init.marko.js +0 -31
  171. package/src/components/ads/gam/out-of-page.marko.js +0 -47
  172. package/src/components/ads/placeholder.marko.js +0 -35
  173. package/src/components/browser/component.marko.js +0 -38
  174. package/src/components/document/components/assets.marko.js +0 -52
  175. package/src/components/document/components/error.marko.js +0 -54
  176. package/src/components/document/components/load-more-result.marko.js +0 -27
  177. package/src/components/document/index.marko.js +0 -73
  178. package/src/components/document/live-reload.marko.js +0 -35
  179. package/src/components/elements/content/authors.marko.js +0 -38
  180. package/src/components/elements/content/body.marko.js +0 -38
  181. package/src/components/elements/content/byline.marko.js +0 -38
  182. package/src/components/elements/content/components/contacts.marko.js +0 -68
  183. package/src/components/elements/content/contributors.marko.js +0 -38
  184. package/src/components/elements/content/embed-code.marko.js +0 -38
  185. package/src/components/elements/content/name.marko.js +0 -38
  186. package/src/components/elements/content/photographers.marko.js +0 -38
  187. package/src/components/elements/content/published.marko.js +0 -38
  188. package/src/components/elements/content/short-name.marko.js +0 -38
  189. package/src/components/elements/content/source.marko.js +0 -38
  190. package/src/components/elements/content/sponsors.marko.js +0 -38
  191. package/src/components/elements/content/teaser.marko.js +0 -38
  192. package/src/components/elements/core/components/imgix.marko.js +0 -58
  193. package/src/components/elements/core/components/tag-content.marko.js +0 -37
  194. package/src/components/elements/core/date.marko.js +0 -56
  195. package/src/components/elements/core/html.marko.js +0 -38
  196. package/src/components/elements/core/image.marko.js +0 -91
  197. package/src/components/elements/core/link.marko.js +0 -61
  198. package/src/components/elements/core/load-more.marko.js +0 -49
  199. package/src/components/elements/core/text.marko.js +0 -125
  200. package/src/components/elements/website-section/hierarchy.marko.js +0 -65
  201. package/src/components/elements/website-section/name.marko.js +0 -42
  202. package/src/components/gtm/container-init.marko.js +0 -49
  203. package/src/components/gtm/container-push.marko.js +0 -41
  204. package/src/components/gtm/container-start.marko.js +0 -55
  205. package/src/components/gtm/container.marko.js +0 -72
  206. package/src/components/gtm/track-event.marko.js +0 -36
  207. package/src/components/gtm/track-inview-event.marko.js +0 -36
  208. package/src/components/page/container/components/content.marko.js +0 -48
  209. package/src/components/page/container/components/default.marko.js +0 -39
  210. package/src/components/page/container/components/dynamic-page.marko.js +0 -45
  211. package/src/components/page/container/components/home.marko.js +0 -39
  212. package/src/components/page/container/components/website-section.marko.js +0 -45
  213. package/src/components/page/container/index.marko.js +0 -63
  214. package/src/components/page/description.marko.js +0 -31
  215. package/src/components/page/metadata/components/content.marko.js +0 -111
  216. package/src/components/page/metadata/components/dynamic-page.marko.js +0 -51
  217. package/src/components/page/metadata/components/magazine-issue.marko.js +0 -51
  218. package/src/components/page/metadata/components/magazine-publication.marko.js +0 -51
  219. package/src/components/page/metadata/components/website-section.marko.js +0 -51
  220. package/src/components/page/metadata/index.marko.js +0 -87
  221. package/src/components/page/rel-canonical.marko.js +0 -43
  222. package/src/components/page/title.marko.js +0 -50
  223. package/src/components/queries/all-author-content.marko.js +0 -39
  224. package/src/components/queries/all-company-content.marko.js +0 -39
  225. package/src/components/queries/all-published-content.marko.js +0 -39
  226. package/src/components/queries/components/loader-multi.marko.js +0 -66
  227. package/src/components/queries/components/loader-raw.marko.js +0 -64
  228. package/src/components/queries/components/loader-single.marko.js +0 -66
  229. package/src/components/queries/components/loader.marko.js +0 -65
  230. package/src/components/queries/magazine-active-issues.marko.js +0 -39
  231. package/src/components/queries/magazine-issues.marko.js +0 -39
  232. package/src/components/queries/magazine-latest-issue.marko.js +0 -39
  233. package/src/components/queries/magazine-publications.marko.js +0 -39
  234. package/src/components/queries/magazine-scheduled-content.marko.js +0 -39
  235. package/src/components/queries/published-content.marko.js +0 -39
  236. package/src/components/queries/published-startable-content.marko.js +0 -39
  237. package/src/components/queries/related-published-content.marko.js +0 -39
  238. package/src/components/queries/website-scheduled-content-by-year.marko.js +0 -39
  239. package/src/components/queries/website-scheduled-content.marko.js +0 -39
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@parameter1/base-cms-marko-web$3.17.1/components/page/metadata/content.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/metadata/content.marko",
6
6
  marko_component = require("./content.marko"),
7
7
  marko_renderer = require("marko/src/runtime/components/renderer"),
8
8
  module_gql = require("graphql-tag"),
@@ -197,7 +197,7 @@ marko_template._ = marko_renderer(render, {
197
197
  }, marko_component);
198
198
 
199
199
  marko_template.meta = {
200
- id: "/@parameter1/base-cms-marko-web$3.17.1/components/page/metadata/content.marko",
200
+ id: "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/metadata/content.marko",
201
201
  component: "./content.marko",
202
202
  tags: [
203
203
  "./components/common.marko",
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@parameter1/base-cms-marko-web$3.17.1/components/page/metadata/default.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/metadata/default.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  common_template = require("./components/common.marko"),
8
8
  marko_loadTag = require("marko/src/runtime/helpers/load-tag"),
@@ -22,7 +22,7 @@ marko_template._ = marko_renderer(render, {
22
22
  });
23
23
 
24
24
  marko_template.meta = {
25
- id: "/@parameter1/base-cms-marko-web$3.17.1/components/page/metadata/default.marko",
25
+ id: "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/metadata/default.marko",
26
26
  tags: [
27
27
  "./components/common.marko"
28
28
  ]
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@parameter1/base-cms-marko-web$3.8.0/components/page/metadata/dynamic-page.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/metadata/dynamic-page.marko",
6
6
  marko_component = require("./dynamic-page.marko"),
7
7
  marko_renderer = require("marko/src/runtime/components/renderer"),
8
8
  module_gql = require("graphql-tag"),
@@ -13,11 +13,10 @@ var marko_template = module.exports = require("marko/src/html").t(__filename),
13
13
  module_baseCmsUtils_module = require("@parameter1/base-cms-utils"),
14
14
  baseCmsUtils_module = module_baseCmsUtils_module.default || module_baseCmsUtils_module,
15
15
  warn = module_baseCmsUtils_module.warn,
16
- marko_loadTemplate = require("marko/src/runtime/helpers/load-template"),
17
- common_template = marko_loadTemplate(require.resolve("./components/common.marko")),
16
+ common_template = require("./components/common.marko"),
18
17
  marko_loadTag = require("marko/src/runtime/helpers/load-tag"),
19
18
  common_tag = marko_loadTag(common_template),
20
- marko_web_query_template = marko_loadTemplate(require.resolve("@parameter1/base-cms-marko-core/components/queries/index.marko")),
19
+ marko_web_query_template = require("@parameter1/base-cms-marko-core/components/queries/index.marko"),
21
20
  marko_web_query_tag = marko_loadTag(marko_web_query_template);
22
21
 
23
22
  function render(input, out, __component, component, state) {
@@ -76,7 +75,7 @@ marko_template._ = marko_renderer(render, {
76
75
  }, marko_component);
77
76
 
78
77
  marko_template.meta = {
79
- id: "/@parameter1/base-cms-marko-web$3.8.0/components/page/metadata/dynamic-page.marko",
78
+ id: "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/metadata/dynamic-page.marko",
80
79
  component: "./dynamic-page.marko",
81
80
  tags: [
82
81
  "./components/common.marko",
@@ -15,12 +15,12 @@ const get = (o, path) => {
15
15
  };
16
16
 
17
17
  const getAuthor = (node) => {
18
- const authors = getAsArray(node, 'authors.edges').map(e => get(e, 'node.name'));
18
+ const authors = getAsArray(node, 'authors.edges').map((e) => get(e, 'node.name'));
19
19
  return authors.length ? { '@type': 'Person', name: authors.join(', ') } : undefined;
20
20
  };
21
21
 
22
22
  const getImages = (node) => {
23
- const images = getAsArray(node, 'images.edges').map(e => get(e, 'node.src'));
23
+ const images = getAsArray(node, 'images.edges').map((e) => get(e, 'node.src'));
24
24
  return images.length ? images : undefined;
25
25
  };
26
26
 
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@parameter1/base-cms-marko-web$3.8.0/components/page/metadata/magazine-issue.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/metadata/magazine-issue.marko",
6
6
  marko_component = require("./magazine-issue.marko"),
7
7
  marko_renderer = require("marko/src/runtime/components/renderer"),
8
8
  module_gql = require("graphql-tag"),
@@ -13,11 +13,10 @@ var marko_template = module.exports = require("marko/src/html").t(__filename),
13
13
  module_baseCmsUtils_module = require("@parameter1/base-cms-utils"),
14
14
  baseCmsUtils_module = module_baseCmsUtils_module.default || module_baseCmsUtils_module,
15
15
  warn = module_baseCmsUtils_module.warn,
16
- marko_loadTemplate = require("marko/src/runtime/helpers/load-template"),
17
- common_template = marko_loadTemplate(require.resolve("./components/common.marko")),
16
+ common_template = require("./components/common.marko"),
18
17
  marko_loadTag = require("marko/src/runtime/helpers/load-tag"),
19
18
  common_tag = marko_loadTag(common_template),
20
- marko_web_query_template = marko_loadTemplate(require.resolve("@parameter1/base-cms-marko-core/components/queries/index.marko")),
19
+ marko_web_query_template = require("@parameter1/base-cms-marko-core/components/queries/index.marko"),
21
20
  marko_web_query_tag = marko_loadTag(marko_web_query_template);
22
21
 
23
22
  function render(input, out, __component, component, state) {
@@ -75,7 +74,7 @@ marko_template._ = marko_renderer(render, {
75
74
  }, marko_component);
76
75
 
77
76
  marko_template.meta = {
78
- id: "/@parameter1/base-cms-marko-web$3.8.0/components/page/metadata/magazine-issue.marko",
77
+ id: "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/metadata/magazine-issue.marko",
79
78
  component: "./magazine-issue.marko",
80
79
  tags: [
81
80
  "./components/common.marko",
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@parameter1/base-cms-marko-web$3.8.0/components/page/metadata/magazine-publication.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/metadata/magazine-publication.marko",
6
6
  marko_component = require("./magazine-publication.marko"),
7
7
  marko_renderer = require("marko/src/runtime/components/renderer"),
8
8
  module_gql = require("graphql-tag"),
@@ -13,11 +13,10 @@ var marko_template = module.exports = require("marko/src/html").t(__filename),
13
13
  module_baseCmsUtils_module = require("@parameter1/base-cms-utils"),
14
14
  baseCmsUtils_module = module_baseCmsUtils_module.default || module_baseCmsUtils_module,
15
15
  warn = module_baseCmsUtils_module.warn,
16
- marko_loadTemplate = require("marko/src/runtime/helpers/load-template"),
17
- common_template = marko_loadTemplate(require.resolve("./components/common.marko")),
16
+ common_template = require("./components/common.marko"),
18
17
  marko_loadTag = require("marko/src/runtime/helpers/load-tag"),
19
18
  common_tag = marko_loadTag(common_template),
20
- marko_web_query_template = marko_loadTemplate(require.resolve("@parameter1/base-cms-marko-core/components/queries/index.marko")),
19
+ marko_web_query_template = require("@parameter1/base-cms-marko-core/components/queries/index.marko"),
21
20
  marko_web_query_tag = marko_loadTag(marko_web_query_template);
22
21
 
23
22
  function render(input, out, __component, component, state) {
@@ -71,7 +70,7 @@ marko_template._ = marko_renderer(render, {
71
70
  }, marko_component);
72
71
 
73
72
  marko_template.meta = {
74
- id: "/@parameter1/base-cms-marko-web$3.8.0/components/page/metadata/magazine-publication.marko",
73
+ id: "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/metadata/magazine-publication.marko",
75
74
  component: "./magazine-publication.marko",
76
75
  tags: [
77
76
  "./components/common.marko",
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@parameter1/base-cms-marko-web$3.17.1/components/page/metadata/website-section.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/metadata/website-section.marko",
6
6
  marko_component = require("./website-section.marko"),
7
7
  marko_renderer = require("marko/src/runtime/components/renderer"),
8
8
  module_gql = require("graphql-tag"),
@@ -70,7 +70,7 @@ marko_template._ = marko_renderer(render, {
70
70
  }, marko_component);
71
71
 
72
72
  marko_template.meta = {
73
- id: "/@parameter1/base-cms-marko-web$3.17.1/components/page/metadata/website-section.marko",
73
+ id: "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/metadata/website-section.marko",
74
74
  component: "./website-section.marko",
75
75
  tags: [
76
76
  "./components/common.marko",
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@parameter1/base-cms-marko-web$3.17.1/components/page/rel-canonical.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/rel-canonical.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  module_baseCmsUtils_module = require("@parameter1/base-cms-utils"),
8
8
  baseCmsUtils_module = module_baseCmsUtils_module.default || module_baseCmsUtils_module,
@@ -38,5 +38,5 @@ marko_template._ = marko_renderer(render, {
38
38
  });
39
39
 
40
40
  marko_template.meta = {
41
- id: "/@parameter1/base-cms-marko-web$3.17.1/components/page/rel-canonical.marko"
41
+ id: "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/rel-canonical.marko"
42
42
  };
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@parameter1/base-cms-marko-web$3.17.1/components/page/title.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/title.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  module_baseCmsUtils_module = require("@parameter1/base-cms-utils"),
8
8
  baseCmsUtils_module = module_baseCmsUtils_module.default || module_baseCmsUtils_module,
@@ -42,5 +42,5 @@ marko_template._ = marko_renderer(render, {
42
42
  });
43
43
 
44
44
  marko_template.meta = {
45
- id: "/@parameter1/base-cms-marko-web$3.17.1/components/page/title.marko"
45
+ id: "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/title.marko"
46
46
  };
@@ -2,14 +2,14 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@parameter1/base-cms-marko-web$3.17.1/components/page/wrapper.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/wrapper.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  module_baseCmsObjectPath_module = require("@parameter1/base-cms-object-path"),
8
8
  baseCmsObjectPath_module = module_baseCmsObjectPath_module.default || module_baseCmsObjectPath_module,
9
9
  getAsArray = module_baseCmsObjectPath_module.getAsArray,
10
10
  marko_forOf = require("marko/src/runtime/helpers/for-of"),
11
11
  marko_assign = require("marko/src/runtime/helpers/assign"),
12
- marko_web_element_template = require("../element"),
12
+ marko_web_element_template = require("../element/index.marko"),
13
13
  marko_loadTag = require("marko/src/runtime/helpers/load-tag"),
14
14
  marko_web_element_tag = marko_loadTag(marko_web_element_template),
15
15
  marko_dynamicTag = require("marko/src/runtime/helpers/dynamic-tag");
@@ -56,8 +56,8 @@ marko_template._ = marko_renderer(render, {
56
56
  });
57
57
 
58
58
  marko_template.meta = {
59
- id: "/@parameter1/base-cms-marko-web$3.17.1/components/page/wrapper.marko",
59
+ id: "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/page/wrapper.marko",
60
60
  tags: [
61
- "../element"
61
+ "../element/index.marko"
62
62
  ]
63
63
  };
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@parameter1/base-cms-marko-web$3.17.1/components/resolve/page.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/resolve/page.marko",
6
6
  marko_component = require("./page.marko"),
7
7
  marko_renderer = require("marko/src/runtime/components/renderer"),
8
8
  module_baseCmsUtils_module = require("@parameter1/base-cms-utils"),
@@ -41,7 +41,7 @@ marko_template._ = marko_renderer(render, {
41
41
  }, marko_component);
42
42
 
43
43
  marko_template.meta = {
44
- id: "/@parameter1/base-cms-marko-web$3.17.1/components/resolve/page.marko",
44
+ id: "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/resolve/page.marko",
45
45
  component: "./page.marko",
46
46
  tags: [
47
47
  "@parameter1/base-cms-marko-core/components/resolve.marko"
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@parameter1/base-cms-marko-web$3.17.1/components/rss/website-section.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/rss/website-section.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  module_url_module = require("url"),
8
8
  url_module = module_url_module.default || module_url_module,
@@ -42,5 +42,5 @@ marko_template._ = marko_renderer(render, {
42
42
  });
43
43
 
44
44
  marko_template.meta = {
45
- id: "/@parameter1/base-cms-marko-web$3.17.1/components/rss/website-section.marko"
45
+ id: "/@parameter1/base-cms-marko-web$4.0.0-beta.0/components/rss/website-section.marko"
46
46
  };
@@ -16,7 +16,7 @@ class AssetManifest {
16
16
  css() {
17
17
  if (!this.stylesheets) {
18
18
  const { css } = this.load();
19
- this.stylesheets = [css['index.css']];
19
+ this.stylesheets = [css['main.css']];
20
20
  }
21
21
  return this.stylesheets;
22
22
  }
package/express/index.js CHANGED
@@ -1,11 +1,10 @@
1
1
  const { buildRequestHeaders } = require('@parameter1/base-cms-tenant-context');
2
2
  const createApolloClient = require('@parameter1/base-cms-apollo-ssr');
3
+ const { cleanMarkoResponse, markoMiddleware } = require('@parameter1/base-cms-marko-express/middleware');
3
4
  const cookieParser = require('cookie-parser');
4
5
  const express = require('express');
5
- const marko = require('marko/express');
6
6
  const path = require('path');
7
7
  const helmet = require('helmet');
8
- const cleanMarkoResponse = require('@parameter1/base-cms-marko-core/middleware/clean-marko-response');
9
8
  const apollo = require('./apollo');
10
9
  const graphqlProxy = require('./graphql-proxy');
11
10
  const embeddedMedia = require('./embedded-media');
@@ -111,7 +110,7 @@ module.exports = (config = {}) => {
111
110
  app.use(websiteContext(app.locals.config));
112
111
 
113
112
  // Register the Marko middleware.
114
- app.use(marko());
113
+ app.use(markoMiddleware());
115
114
  app.use(cleanMarkoResponse());
116
115
 
117
116
  // Serve static assets
@@ -1,3 +1,3 @@
1
1
  const defaultDocument = require('../components/document');
2
2
 
3
- module.exports = document => document || defaultDocument;
3
+ module.exports = (document) => document || defaultDocument;
@@ -6,5 +6,5 @@ const { keys } = Object;
6
6
  module.exports = (value) => {
7
7
  const v = getAsObject(value);
8
8
  const obj = keys(v).reduce((o, k) => ({ ...o, [dasherize(k)]: v[k] }), {});
9
- return { get: name => get(obj, dasherize(name)) };
9
+ return { get: (name) => get(obj, dasherize(name)) };
10
10
  };
@@ -0,0 +1,36 @@
1
+ /* eslint-disable no-underscore-dangle */
2
+ require('marko');
3
+ const buildGlobal = require('@parameter1/base-cms-marko-core/utils/build-marko-global');
4
+
5
+ // eslint-disable-next-line import/no-extraneous-dependencies
6
+ const express = module.main ? module.main.require('express') : require('express');
7
+
8
+ if (!express) throw new Error('Unable to load Express.');
9
+
10
+ const patch = (response) => {
11
+ response.marko = response.marko || function markoResponse(template, data) {
12
+ if (typeof template === 'string') throw new Error('res.marko does not accept a string or path as a template.');
13
+
14
+ const res = this;
15
+ const { req } = res;
16
+ res.set({ 'content-type': 'text/html; charset=utf-8' });
17
+ const $global = buildGlobal(res, data);
18
+ return template.render({ ...(data || {}), $global }, res).on('error', req.next);
19
+ };
20
+ };
21
+
22
+ patch(express.response);
23
+ delete require.cache[__filename];
24
+
25
+ module.exports = () => {
26
+ const app = express();
27
+ app.once('mount', (parent) => {
28
+ patch(parent.response);
29
+ if (parent._router) {
30
+ parent._router.stack.pop(); // express <= 4.x
31
+ } else {
32
+ parent.router.stack.pop(); // express 5.x
33
+ }
34
+ });
35
+ return app;
36
+ };
@@ -2,7 +2,7 @@ const loadWebsite = require('@parameter1/base-cms-web-common/website-context');
2
2
  const { asyncRoute } = require('@parameter1/base-cms-utils');
3
3
  const { setDayjsLocale } = require('@parameter1/base-cms-dayjs/utils');
4
4
 
5
- module.exports = coreConfig => asyncRoute(async (req, res, next) => {
5
+ module.exports = (coreConfig) => asyncRoute(async (req, res, next) => {
6
6
  const { apollo } = res.locals;
7
7
  const websiteContext = await loadWebsite(apollo);
8
8
  coreConfig.setWebsiteContext(websiteContext);
package/index.js CHANGED
@@ -1,3 +1,8 @@
1
+ if (process.env.MARKO_REQUIRE_PREBUILT_TEMPLATES == null) {
2
+ // force prebuilt templates if env not set
3
+ process.env.MARKO_REQUIRE_PREBUILT_TEMPLATES = true;
4
+ }
5
+
1
6
  const startServer = require('./start-server');
2
7
 
3
8
  module.exports = { startServer };
@@ -2,7 +2,7 @@ const { isFunction: isFn } = require('@parameter1/base-cms-utils');
2
2
  const { getAsObject } = require('@parameter1/base-cms-object-path');
3
3
  const ResolvedNode = require('./resolved');
4
4
 
5
- const createNode = data => new ResolvedNode(data);
5
+ const createNode = (data) => new ResolvedNode(data);
6
6
 
7
7
  class PageNode {
8
8
  constructor(apolloClient, {
@@ -19,7 +19,7 @@ class ResolvedNode {
19
19
  }
20
20
 
21
21
  getEdgeNodesFor(path) {
22
- return this.getAsArray(`${path}.edges`).map(edge => asObject(edge).node);
22
+ return this.getAsArray(`${path}.edges`).map((edge) => asObject(edge).node);
23
23
  }
24
24
  }
25
25
 
package/package.json CHANGED
@@ -1,51 +1,60 @@
1
1
  {
2
2
  "name": "@parameter1/base-cms-marko-web",
3
- "version": "3.17.3",
3
+ "version": "4.0.0-beta.0",
4
4
  "description": "Core Marko+Express components for BaseCMS websites",
5
5
  "author": "Jacob Bare <jacob@parameter1.com>",
6
6
  "main": "index.js",
7
7
  "license": "MIT",
8
8
  "repository": "https://github.com/parameter1/base-cms/tree/master/packages/marko-web",
9
+ "engines": {
10
+ "node": ">=14.15"
11
+ },
12
+ "os": [
13
+ "darwin",
14
+ "linux",
15
+ "win32"
16
+ ],
9
17
  "scripts": {
10
- "lint": "yarn lint:js && yarn lint:css",
11
- "lint:js": "eslint --ext .js --ext .vue --max-warnings 5 ./",
12
- "lint:css": "stylelint ./**/*.scss --max-warnings 5",
13
- "compile": "basecms-marko-compile compile --dir ./ --silent true",
14
- "test": "yarn compile && yarn lint"
18
+ "lint:fix": "yarn lint --fix",
19
+ "lint": "eslint --ext .js --ext .vue --max-warnings 5 ./",
20
+ "compile": "basecms-marko-compile compile",
21
+ "prepublish": "yarn compile --silent",
22
+ "test": "yarn compile --no-clean && yarn lint"
15
23
  },
16
24
  "dependencies": {
17
- "@godaddy/terminus": "^4.9.0",
18
- "@parameter1/base-cms-apollo-ssr": "^3.0.0",
19
- "@parameter1/base-cms-dayjs": "^3.17.3",
20
- "@parameter1/base-cms-embedded-media": "^3.13.5",
21
- "@parameter1/base-cms-express-apollo": "^3.0.0",
22
- "@parameter1/base-cms-graphql-fragment-types": "^3.0.0",
23
- "@parameter1/base-cms-image": "^3.13.5",
24
- "@parameter1/base-cms-inflector": "^3.0.0",
25
- "@parameter1/base-cms-marko-node-require": "^3.0.0",
26
- "@parameter1/base-cms-object-path": "^3.0.0",
27
- "@parameter1/base-cms-tenant-context": "^3.0.0",
28
- "@parameter1/base-cms-utils": "^3.0.0",
29
- "@parameter1/base-cms-web-common": "^3.3.1",
30
- "cheerio": "^1.0.0-rc.10",
31
- "cookie-parser": "^1.4.5",
32
- "express": "^4.17.1",
33
- "express-http-proxy": "^1.6.2",
25
+ "@godaddy/terminus": "^4.11.2",
26
+ "@parameter1/base-cms-apollo-ssr": "^4.0.0-beta.0",
27
+ "@parameter1/base-cms-dayjs": "^4.0.0-beta.0",
28
+ "@parameter1/base-cms-embedded-media": "^4.0.0-beta.0",
29
+ "@parameter1/base-cms-express-apollo": "^4.0.0-beta.0",
30
+ "@parameter1/base-cms-graphql-fragment-types": "^4.0.0-beta.0",
31
+ "@parameter1/base-cms-image": "^4.0.0-beta.0",
32
+ "@parameter1/base-cms-inflector": "^4.0.0-beta.0",
33
+ "@parameter1/base-cms-marko-express": "^4.0.0-beta.0",
34
+ "@parameter1/base-cms-marko-node-require": "^4.0.0-beta.0",
35
+ "@parameter1/base-cms-marko-web-deferred-script-loader": "^4.0.0-beta.0",
36
+ "@parameter1/base-cms-object-path": "^4.0.0-beta.0",
37
+ "@parameter1/base-cms-tenant-context": "^4.0.0-beta.0",
38
+ "@parameter1/base-cms-utils": "^4.0.0-beta.0",
39
+ "@parameter1/base-cms-web-common": "^4.0.0-beta.0",
40
+ "cheerio": "^1.0.0-rc.12",
41
+ "cookie-parser": "^1.4.6",
42
+ "express": "^4.18.2",
43
+ "express-http-proxy": "^1.6.3",
34
44
  "graphql": "^14.7.0",
35
- "graphql-tag": "^2.12.5",
45
+ "graphql-tag": "^2.12.6",
36
46
  "helmet": "^3.23.3",
37
- "http-errors": "^1.8.0",
38
- "jquery": "^3.6.0",
47
+ "http-errors": "^1.8.1",
48
+ "jquery": "^3.6.3",
39
49
  "marko": "~4.20.0",
40
- "vue": "^2.6.14",
41
- "vue-server-renderer": "^2.6.14",
42
- "whatwg-fetch": "^3.6.1"
50
+ "vue": "^2.7.14",
51
+ "vue-server-renderer": "^2.7.14"
43
52
  },
44
53
  "peerDependencies": {
45
- "@parameter1/base-cms-marko-core": "^2.0.0"
54
+ "@parameter1/base-cms-marko-core": "^4.0.0"
46
55
  },
47
56
  "publishConfig": {
48
57
  "access": "public"
49
58
  },
50
- "gitHead": "238a0ee634681aded2365a8f30e7383004f3fb93"
59
+ "gitHead": "6b1c5270b9b3031b27d36ec109348efbd80f7933"
51
60
  }
package/start-server.js CHANGED
@@ -1,4 +1,4 @@
1
- require('./node-require');
1
+ require('@parameter1/base-cms-marko-node-require');
2
2
  const http = require('http');
3
3
  const path = require('path');
4
4
  const { createTerminus } = require('@godaddy/terminus');
@@ -14,7 +14,9 @@ if (!process.env.EXPOSED_HOST) process.env.EXPOSED_HOST = env.HOST || 'localhost
14
14
 
15
15
  process.on('unhandledRejection', (e) => { throw e; });
16
16
 
17
- const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
17
+ const wait = (ms) => new Promise((resolve) => {
18
+ setTimeout(resolve, ms);
19
+ });
18
20
 
19
21
  module.exports = async ({
20
22
  rootDir,
@@ -148,5 +150,5 @@ module.exports = async ({
148
150
  }
149
151
  }
150
152
  });
151
- }).catch(e => setImmediate(() => { throw e; }));
153
+ }).catch((e) => setImmediate(() => { throw e; }));
152
154
  };
@@ -12,7 +12,7 @@ const buildFacebookElement = ({
12
12
  ...(width && { width }),
13
13
  ...(showText && { 'show-text': true }),
14
14
  };
15
- const data = Object.keys(params).map(key => `data-${key}="${params[key]}"`);
15
+ const data = Object.keys(params).map((key) => `data-${key}="${params[key]}"`);
16
16
  return `<div class="fb-post" ${data.join(' ')}></div><script async defer src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2"></script>`;
17
17
  };
18
18
 
@@ -39,7 +39,6 @@ const facebook = (url) => {
39
39
  return buildFacebookElement({ href, showText: true });
40
40
  };
41
41
 
42
-
43
42
  /**
44
43
  *
45
44
  */
@@ -1,6 +1,6 @@
1
1
  const { buildImgixUrl } = require('@parameter1/base-cms-image');
2
2
 
3
- const stringifyAttrs = attrs => Object.keys(attrs).reduce((arr, key) => {
3
+ const stringifyAttrs = (attrs) => Object.keys(attrs).reduce((arr, key) => {
4
4
  const value = attrs[key];
5
5
  if (value) arr.push(`${key}="${value}"`);
6
6
  return arr;
@@ -44,7 +44,7 @@ module.exports = (tag, { config } = {}, { lazyloadImages } = {}) => {
44
44
  'data-srcset': lazyload ? maxSrcset : null,
45
45
  media: '(min-width: 576px)',
46
46
  },
47
- ].map(source => `<source ${stringifyAttrs(source)}>`).join('');
47
+ ].map((source) => `<source ${stringifyAttrs(source)}>`).join('');
48
48
 
49
49
  const minSrc = buildImgixUrl(src, { w: minWidth });
50
50
  const minSrcset = `${buildImgixUrl(src, { w: minWidth, dpr: 2 })} 2x`;
@@ -59,7 +59,7 @@ module.exports = (tag, { config } = {}, { lazyloadImages } = {}) => {
59
59
  'data-image-id': tag.id,
60
60
  alt,
61
61
  width: (width && height) ? minWidth : null,
62
- height: (height && height) ? Math.round(height / width * minWidth) : null,
62
+ height: (height && height) ? Math.round((height / width) * minWidth) : null,
63
63
  };
64
64
 
65
65
  const captionElement = caption ? `<span class="caption">${caption}</span>` : '';
@@ -11,7 +11,7 @@ const buildInstagramElement = ({
11
11
  ...(lazy && { lazy: true }),
12
12
  ...(width && { width }),
13
13
  };
14
- const data = Object.keys(params).map(key => `${key}="${params[key]}"`);
14
+ const data = Object.keys(params).map((key) => `${key}="${params[key]}"`);
15
15
  if (data.lazy) {
16
16
  data.loading = 'lazy';
17
17
  }
@@ -1,3 +1,3 @@
1
1
  const { getAsArray } = require('@parameter1/base-cms-object-path');
2
2
 
3
- module.exports = section => getAsArray(section, 'hierarchy').map(s => s.alias).reverse();
3
+ module.exports = (section) => getAsArray(section, 'hierarchy').map((s) => s.alias).reverse();
@@ -1,3 +1,3 @@
1
1
  const { getAsArray } = require('@parameter1/base-cms-object-path');
2
2
 
3
- module.exports = section => getAsArray(section, 'hierarchy').map(s => s.id).reverse();
3
+ module.exports = (section) => getAsArray(section, 'hierarchy').map((s) => s.id).reverse();
@@ -9,7 +9,7 @@ module.exports = async (Component, { id, props } = {}) => {
9
9
  if (get(Component, 'props.id')) throw new Error('The provided component has an `id` prop which is incompatible with SSR rendering.');
10
10
  const app = new Vue({
11
11
  provide: { EventBus },
12
- render: h => h(Component, { attrs: { id }, props }),
12
+ render: (h) => h(Component, { attrs: { id }, props }),
13
13
  });
14
14
  return renderer.renderToString(app);
15
15
  };
Binary file
Binary file
Binary file