@parameter1/base-cms-marko-web 2.40.0 → 2.46.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,7 @@ $ const queryParams = {
18
18
  tag="section"
19
19
  ...input.pageInput
20
20
  modifiers=["load-more", `page-${pageNumber}`, ...getAsArray(input, "pageInput.modifiers")]
21
+ attrs=input.attrs
21
22
  >
22
23
  <!-- Fire generic `load-more-in-view` event (other services can attach to this, e.g. GTM) -->
23
24
  <marko-web-browser-component name="TriggerInViewEvent" props={ eventName: "load-more-in-view", data: { page_number: pageNumber + 1 } } />
@@ -12,7 +12,8 @@
12
12
  "@fragment-name": "string",
13
13
  "@page-input": "object",
14
14
  "@header": "string",
15
- "@trigger-input": "object"
15
+ "@trigger-input": "object",
16
+ "@attrs": "object"
16
17
  },
17
18
  "<marko-web-load-more-trigger>": {
18
19
  "template": "./trigger.marko",
@@ -12,7 +12,7 @@ $ const { document } = out.global;
12
12
  </@head>
13
13
  <!-- Note: camelcased vars due to nest input of dynamic document. perhaps a marko bug -->
14
14
  <@container abovePage=input.abovePage belowPage=input.belowPage>
15
- <@page for="content" tag="article" id=id type=type>
15
+ <@page for="content" tag="article" id=id type=type attrs=input.attrs>
16
16
  <${input.page} />
17
17
  </@page>
18
18
  </@container>
@@ -13,7 +13,7 @@ $ const { document } = out.global;
13
13
  </@head>
14
14
  <!-- Note: camelcased vars due to nest input of dynamic document. perhaps a marko bug -->
15
15
  <@container abovePage=input.abovePage belowPage=input.belowPage>
16
- <@page for=type>
16
+ <@page for=type attrs=input.attrs>
17
17
  <${input.page} />
18
18
  </@page>
19
19
  </@container>
@@ -12,7 +12,7 @@ $ const { document } = out.global;
12
12
  </@head>
13
13
  <!-- Note: camelcased vars due to nest input of dynamic document. perhaps a marko bug -->
14
14
  <@container abovePage=input.abovePage belowPage=input.belowPage>
15
- <@page for="dynamic-page" id=id>
15
+ <@page for="dynamic-page" id=id attrs=input.attrs>
16
16
  <${input.page} />
17
17
  </@page>
18
18
  </@container>
@@ -12,7 +12,7 @@ $ const { document } = out.global;
12
12
  </@head>
13
13
  <!-- Note: camelcased vars due to nest input of dynamic document. perhaps a marko bug -->
14
14
  <@container abovePage=input.abovePage belowPage=input.belowPage>
15
- <@page for="magazine-issue" id=id>
15
+ <@page for="magazine-issue" id=id attrs=input.attrs>
16
16
  <${input.page} />
17
17
  </@page>
18
18
  </@container>
@@ -12,7 +12,7 @@ $ const { document } = out.global;
12
12
  </@head>
13
13
  <!-- Note: camelcased vars due to nest input of dynamic document. perhaps a marko bug -->
14
14
  <@container abovePage=input.abovePage belowPage=input.belowPage>
15
- <@page for="magazine-publication" id=id>
15
+ <@page for="magazine-publication" id=id attrs=input.attrs>
16
16
  <${input.page} />
17
17
  </@page>
18
18
  </@container>
@@ -10,7 +10,8 @@
10
10
  "<below-page>": {},
11
11
  "@type": "string",
12
12
  "@title": "string",
13
- "@description": "string"
13
+ "@description": "string",
14
+ "@attrs": "object"
14
15
  },
15
16
  "<marko-web-website-section-page-layout>": {
16
17
  "template": "./website-section.marko",
@@ -27,7 +28,8 @@
27
28
  "@with-rss": {
28
29
  "type": "boolean",
29
30
  "default-value": true
30
- }
31
+ },
32
+ "@attrs": "object"
31
33
  },
32
34
  "<marko-web-content-page-layout>": {
33
35
  "template": "./content.marko",
@@ -39,7 +41,8 @@
39
41
  "<above-page>": {},
40
42
  "<below-page>": {},
41
43
  "@id": "number",
42
- "@type": "string"
44
+ "@type": "string",
45
+ "@attrs": "object"
43
46
  },
44
47
  "<marko-web-dynamic-page-layout>": {
45
48
  "template": "./dynamic-page.marko",
@@ -51,7 +54,8 @@
51
54
  "<above-page>": {},
52
55
  "<below-page>": {},
53
56
  "@id": "string",
54
- "@alias": "string"
57
+ "@alias": "string",
58
+ "@attrs": "object"
55
59
  },
56
60
  "<marko-web-magazine-issue-page-layout>": {
57
61
  "template": "./magazine-issue.marko",
@@ -62,7 +66,8 @@
62
66
  "<page>": {},
63
67
  "<above-page>": {},
64
68
  "<below-page>": {},
65
- "@id": "number"
69
+ "@id": "number",
70
+ "@attrs": "object"
66
71
  },
67
72
  "<marko-web-magazine-publication-page-layout>": {
68
73
  "template": "./magazine-publication.marko",
@@ -73,6 +78,7 @@
73
78
  "<page>": {},
74
79
  "<above-page>": {},
75
80
  "<below-page>": {},
76
- "@id": "number"
81
+ "@id": "number",
82
+ "@attrs": "object"
77
83
  }
78
84
  }
@@ -18,7 +18,7 @@ $ const withRss = input.withRss != null ? input.withRss : true;
18
18
  </@head>
19
19
  <!-- Note: camelcased vars due to nest input of dynamic document. perhaps a marko bug -->
20
20
  <@container abovePage=input.abovePage belowPage=input.belowPage>
21
- <@page for="website-section" id=id>
21
+ <@page for="website-section" id=id attrs=input.attrs>
22
22
  <${input.page} />
23
23
  </@page>
24
24
  </@container>
@@ -1,6 +1,6 @@
1
1
  const { STATUS_CODES } = require('http');
2
2
  const createError = require('http-errors');
3
- const errorTemplate = require('../components/document/components/error');
3
+ const errorTemplate = require('../components/document/components/error.marko');
4
4
  const getRedirect = require('./get-redirect');
5
5
  const findContentAlias = require('./find-content-alias');
6
6
  const applyQueryParams = require('../utils/apply-query-params');
@@ -1,3 +1,3 @@
1
- const defaultDocument = require('../components/document');
1
+ const defaultDocument = require('../components/document/index.marko');
2
2
 
3
3
  module.exports = document => document || defaultDocument;
@@ -1,5 +1,5 @@
1
1
  const { asyncRoute } = require('@parameter1/base-cms-utils');
2
- const LoadMore = require('../components/load-more');
2
+ const LoadMore = require('../components/load-more/index.marko');
3
3
 
4
4
  module.exports = () => asyncRoute(async (req, res) => {
5
5
  const { method, query, body } = req;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parameter1/base-cms-marko-web",
3
- "version": "2.40.0",
3
+ "version": "2.46.0",
4
4
  "description": "Core Marko+Express components for BaseCMS websites",
5
5
  "author": "Jacob Bare <jacob@parameter1.com>",
6
6
  "main": "index.js",
@@ -14,17 +14,17 @@
14
14
  "test": "yarn compile && yarn lint"
15
15
  },
16
16
  "dependencies": {
17
- "@godaddy/terminus": "^4.5.0",
18
- "@parameter1/base-cms-apollo-ssr": "^2.39.3",
19
- "@parameter1/base-cms-embedded-media": "^2.8.1",
20
- "@parameter1/base-cms-express-apollo": "^2.39.3",
21
- "@parameter1/base-cms-graphql-fragment-types": "^2.37.1",
22
- "@parameter1/base-cms-image": "^2.8.1",
17
+ "@godaddy/terminus": "^4.9.0",
18
+ "@parameter1/base-cms-apollo-ssr": "^2.45.0",
19
+ "@parameter1/base-cms-embedded-media": "^2.45.0",
20
+ "@parameter1/base-cms-express-apollo": "^2.45.0",
21
+ "@parameter1/base-cms-graphql-fragment-types": "^2.45.0",
22
+ "@parameter1/base-cms-image": "^2.45.0",
23
23
  "@parameter1/base-cms-inflector": "^2.0.0",
24
- "@parameter1/base-cms-object-path": "^2.22.2",
24
+ "@parameter1/base-cms-object-path": "^2.45.0",
25
25
  "@parameter1/base-cms-tenant-context": "^2.0.0",
26
26
  "@parameter1/base-cms-utils": "^2.22.2",
27
- "@parameter1/base-cms-web-common": "^2.37.2",
27
+ "@parameter1/base-cms-web-common": "^2.46.0",
28
28
  "apollo-cache-inmemory": "^1.6.6",
29
29
  "apollo-client": "^2.6.10",
30
30
  "apollo-link": "^1.2.14",
@@ -33,14 +33,14 @@
33
33
  "express": "^4.17.1",
34
34
  "express-http-proxy": "^1.6.2",
35
35
  "graphql": "^14.7.0",
36
- "graphql-tag": "^2.11.0",
36
+ "graphql-tag": "^2.12.5",
37
37
  "helmet": "^3.23.3",
38
38
  "http-errors": "^1.8.0",
39
- "jquery": "^3.5.1",
39
+ "jquery": "^3.6.0",
40
40
  "marko": "~4.20.0",
41
41
  "moment": "^2.29.1",
42
42
  "vue": "^2.6.14",
43
- "vue-apollo": "^3.0.5",
43
+ "vue-apollo": "^3.0.8",
44
44
  "vue-server-renderer": "^2.6.14",
45
45
  "whatwg-fetch": "^3.6.1"
46
46
  },
@@ -50,5 +50,5 @@
50
50
  "publishConfig": {
51
51
  "access": "public"
52
52
  },
53
- "gitHead": "99b805bdc63dfb5d715956206b9854eed66c1d7d"
53
+ "gitHead": "5252afc89283747aced3021136164c222609a843"
54
54
  }
@@ -1,4 +1,4 @@
1
- const BrowserComponent = require('../../components/browser-component');
1
+ const BrowserComponent = require('../../components/browser-component.marko');
2
2
  const facebook = require('./facebook-oembed');
3
3
  const instagram = require('./instagram-oembed');
4
4
 
@@ -1,118 +0,0 @@
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 = "/@parameter1/base-cms-marko-web$2.13.0/components/load-more/index.marko",
6
- marko_component = require("./index.marko"),
7
- marko_renderer = require("marko/dist/runtime/components/renderer"),
8
- module_baseCmsObjectPath_module = require("@parameter1/base-cms-object-path"),
9
- baseCmsObjectPath_module = module_baseCmsObjectPath_module.default || module_baseCmsObjectPath_module,
10
- getAsObject = module_baseCmsObjectPath_module.getAsObject,
11
- getAsArray = module_baseCmsObjectPath_module.getAsArray,
12
- marko_web_browser_component_template = require("../browser-component.marko"),
13
- marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
14
- marko_web_browser_component_tag = marko_loadTag(marko_web_browser_component_template),
15
- marko_str = require("marko/dist/runtime/helpers/to-string"),
16
- marko_assign = require("marko/dist/runtime/helpers/assign"),
17
- marko_dynamicTag = require("marko/dist/runtime/helpers/dynamic-tag"),
18
- marko_web_load_more_trigger_template = require("./trigger.marko"),
19
- marko_web_load_more_trigger_tag = marko_loadTag(marko_web_load_more_trigger_template),
20
- marko_web_page_container_template = require("../page/container.marko"),
21
- marko_web_page_container_tag = marko_loadTag(marko_web_page_container_template),
22
- marko_web_query_template = require("@parameter1/base-cms-marko-core/components/queries/index.marko"),
23
- marko_web_query_tag = marko_loadTag(marko_web_query_template);
24
-
25
- function render(input, out, __component, component, state) {
26
- var data = input;
27
-
28
- const { components, fragments } = out.global;
29
-
30
- const Component = components.get(input.componentName);
31
-
32
- const pageNumber = input.pageNumber || 1;
33
-
34
- const queryParams = {
35
- ...getAsObject(input, "queryParams"),
36
- queryName: "LoadMore",
37
- queryFragment: fragments.get(input.fragmentName),
38
- };
39
-
40
- if (Component) {
41
- marko_web_query_tag({
42
- collapsible: true,
43
- name: input.queryName,
44
- params: queryParams,
45
- renderBody: function(out, { nodes, pageInfo }) {
46
- if (nodes.length) {
47
- marko_web_page_container_tag(marko_assign({
48
- tag: "section"
49
- }, input.pageInput, {
50
- modifiers: ["load-more", `page-${pageNumber}`, ...getAsArray(input, "pageInput.modifiers")],
51
- renderBody: function(out) {
52
- marko_web_browser_component_tag({
53
- name: "TriggerInViewEvent",
54
- props: {
55
- eventName: "load-more-in-view",
56
- data: {
57
- page_number: pageNumber + 1
58
- }
59
- }
60
- }, out, __component, "2");
61
-
62
- if ((pageNumber === 1) && input.header) {
63
- out.w("<div class=\"load-more-header\">" +
64
- marko_str(input.header) +
65
- "</div>");
66
- }
67
-
68
- marko_dynamicTag(out, Component, function() {
69
- return marko_assign({}, input.componentInput, {
70
- nodes: nodes,
71
- "page-info": pageInfo,
72
- "page-number": pageNumber
73
- });
74
- }, null, null, null, __component, "4");
75
-
76
- const { endCursor, hasNextPage } = pageInfo;
77
-
78
- delete queryParams.skip;
79
-
80
- delete queryParams.queryFragment;
81
-
82
- delete queryParams.renderBody;
83
-
84
- const provide = {
85
- ...input,
86
- queryParams: { ...queryParams, after: endCursor },
87
- };
88
-
89
- marko_web_load_more_trigger_tag(marko_assign({}, input.triggerInput, {
90
- appendTo: input.appendTo,
91
- maxPages: input.maxPages,
92
- expand: input.expand,
93
- pageNumber: pageNumber,
94
- provide: provide,
95
- show: hasNextPage
96
- }), out, __component, "5");
97
- }
98
- }), out, __component, "1");
99
- }
100
- }
101
- }, out, __component, "0");
102
- }
103
- }
104
-
105
- marko_template._ = marko_renderer(render, {
106
- e_: marko_componentType
107
- }, marko_component);
108
-
109
- marko_template.meta = {
110
- id: "/@parameter1/base-cms-marko-web$2.13.0/components/load-more/index.marko",
111
- component: "./",
112
- tags: [
113
- "../browser-component.marko",
114
- "./trigger.marko",
115
- "../page/container.marko",
116
- "@parameter1/base-cms-marko-core/components/queries/index.marko"
117
- ]
118
- };