@parameter1/base-cms-marko-web 2.75.0 → 2.80.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/components/browser-component.marko.js +53 -14
  2. package/components/document/components/body-wrapper.marko.js +2 -2
  3. package/components/document/components/error.marko.js +2 -2
  4. package/components/document/components/live-reload.marko.js +2 -2
  5. package/components/document/container.marko.js +2 -2
  6. package/components/document/index.marko.js +32 -28
  7. package/components/element/block.marko.js +5 -5
  8. package/components/element/clear.marko.js +2 -2
  9. package/components/element/components/image.marko.js +5 -5
  10. package/components/element/components/text.marko.js +2 -2
  11. package/components/element/content/address1.marko.js +2 -2
  12. package/components/element/content/address2.marko.js +2 -2
  13. package/components/element/content/body.marko.js +6 -6
  14. package/components/element/content/city-state-zip.marko.js +2 -2
  15. package/components/element/content/country.marko.js +2 -2
  16. package/components/element/content/embed-code.marko.js +2 -2
  17. package/components/element/content/fax.marko.js +2 -2
  18. package/components/element/content/mobile.marko.js +2 -2
  19. package/components/element/content/name.marko.js +2 -2
  20. package/components/element/content/phone.marko.js +2 -2
  21. package/components/element/content/public-email.marko.js +5 -5
  22. package/components/element/content/sidebar-stubs.marko +1 -0
  23. package/components/element/content/teaser.marko.js +2 -2
  24. package/components/element/content/title.marko.js +2 -2
  25. package/components/element/content/tollfree.marko.js +2 -2
  26. package/components/element/content/website.marko.js +5 -5
  27. package/components/element/image/caption.marko.js +2 -2
  28. package/components/element/image/credit.marko.js +2 -2
  29. package/components/element/image/display-name.marko.js +2 -2
  30. package/components/element/img.marko.js +2 -2
  31. package/components/element/index.marko.js +2 -2
  32. package/components/element/link.marko.js +5 -4
  33. package/components/element/obj-text.marko.js +2 -2
  34. package/components/element/obj.marko.js +11 -11
  35. package/components/element/text.marko.js +2 -2
  36. package/components/load-more/index.marko.js +3 -2
  37. package/components/load-more/trigger.marko.js +2 -2
  38. package/components/page/container.marko.js +2 -2
  39. package/components/page/description.marko.js +2 -2
  40. package/components/page/image.marko.js +9 -9
  41. package/components/page/layouts/content.marko.js +7 -4
  42. package/components/page/layouts/default.marko.js +3 -2
  43. package/components/page/metadata/components/common.marko.js +8 -3
  44. package/components/page/metadata/content.marko.js +84 -11
  45. package/components/page/metadata/default.marko.js +2 -2
  46. package/components/page/rel-canonical.marko.js +2 -2
  47. package/components/page/title.marko.js +2 -2
  48. package/components/page/wrapper.marko.js +2 -2
  49. package/components/resolve/page.marko.js +10 -10
  50. package/package.json +5 -5
@@ -2,37 +2,52 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@base-cms/marko-web$1.37.0/components/page/metadata/content.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.75.1/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"),
9
9
  gql = module_gql.default || module_gql,
10
- module_objectPath_module = require("@base-cms/object-path"),
11
- objectPath_module = module_objectPath_module.default || module_objectPath_module,
12
- get = module_objectPath_module.get,
13
- module_utils_module = require("@base-cms/utils"),
10
+ module_baseCmsObjectPath_module = require("@parameter1/base-cms-object-path"),
11
+ baseCmsObjectPath_module = module_baseCmsObjectPath_module.default || module_baseCmsObjectPath_module,
12
+ get = module_baseCmsObjectPath_module.get,
13
+ module_baseCmsUtils_module = require("@parameter1/base-cms-utils"),
14
+ baseCmsUtils_module = module_baseCmsUtils_module.default || module_baseCmsUtils_module,
15
+ warn = module_baseCmsUtils_module.warn,
16
+ isFunction = module_baseCmsUtils_module.isFunction,
17
+ module_utils_module = require("@parameter1/base-cms-web-common/src/utils"),
14
18
  utils_module = module_utils_module.default || module_utils_module,
15
- warn = module_utils_module.warn,
19
+ extractFragmentData = module_utils_module.extractFragmentData,
20
+ module_defaultBuildStructuredData = require("./google-structured-data/content"),
21
+ defaultBuildStructuredData = module_defaultBuildStructuredData.default || module_defaultBuildStructuredData,
16
22
  common_template = require("./components/common.marko"),
17
23
  marko_loadTag = require("marko/src/runtime/helpers/load-tag"),
18
24
  common_tag = marko_loadTag(common_template),
19
25
  marko_attr = require("marko/src/runtime/html/helpers/attr"),
20
- marko_web_query_template = require("@base-cms/marko-core/components/queries/index.marko"),
26
+ helpers_escape_xml = require("marko/src/runtime/html/helpers/escape-xml"),
27
+ marko_escapeXml = helpers_escape_xml.x,
28
+ marko_escapeScript = require("marko/src/runtime/html/helpers/escape-script-placeholder"),
29
+ marko_web_query_template = require("@parameter1/base-cms-marko-core/components/queries/index.marko"),
21
30
  marko_web_query_tag = marko_loadTag(marko_web_query_template);
22
31
 
23
32
  function render(input, out, __component, component, state) {
24
33
  var data = input;
25
34
 
26
- const { id } = input;
35
+ const { id, structuredDataQueryFragment } = input;
36
+
37
+ const { spreadFragmentName, processedFragment } = extractFragmentData(structuredDataQueryFragment);
27
38
 
28
39
  const queryFragment = gql`
29
40
  fragment ContentPageMetadataFragment on Content {
30
41
  id
31
42
  type
32
43
  siteContext {
44
+ url
33
45
  path
34
46
  canonicalUrl
47
+ noIndex
35
48
  }
49
+ published
50
+ updated
36
51
  metadata {
37
52
  title
38
53
  description
@@ -41,12 +56,61 @@ fragment ContentPageMetadataFragment on Content {
41
56
  expiresDate
42
57
  image {
43
58
  id
44
- src(input: { options: { auto: "format", w: "1200", fit: "max" } })
59
+ src(input: { options: { auto: "format,compress", w: "1200", fit: "max", q: 70 } })
60
+ }
61
+ }
62
+ ... on ContentVideo {
63
+ embedSrc
64
+ }
65
+ ... on ContentPodcast {
66
+ fileSrc
67
+ fileName
68
+ }
69
+ ... on Authorable {
70
+ authors {
71
+ edges {
72
+ node {
73
+ id
74
+ name
75
+ }
76
+ }
77
+ }
78
+ }
79
+ ... on Addressable {
80
+ address1
81
+ address2
82
+ city
83
+ state
84
+ zip
85
+ country
86
+ }
87
+ ... on Contactable {
88
+ phone
89
+ tollfree
90
+ fax
91
+ website
92
+ title
93
+ mobile
94
+ publicEmail
95
+ }
96
+ ... on ContentCompany {
97
+ email
98
+ }
99
+ images(input:{ pagination: { limit: 0 }, sort: { order: values } }) {
100
+ edges {
101
+ node {
102
+ id
103
+ src(input: { options: { auto: "format,compress", w: "1200", fit: "max", q: 70 } })
104
+ }
45
105
  }
46
106
  }
107
+ ${spreadFragmentName}
47
108
  }
109
+ ${processedFragment}
48
110
  `;
49
111
 
112
+ const buildStructuredData = isFunction(input.buildStructuredData) ? input.buildStructuredData : defaultBuildStructuredData;
113
+
50
114
  if (id) {
51
115
  marko_web_query_tag({
52
116
  collapsible: true,
@@ -67,6 +131,7 @@ fragment ContentPageMetadataFragment on Content {
67
131
  description: get(node, "metadata.description"),
68
132
  canonicalPath: get(node, "siteContext.path"),
69
133
  canonicalUrl: get(node, "siteContext.canonicalUrl"),
134
+ noIndex: get(node, "siteContext.noIndex"),
70
135
  imageSrc: get(node, "metadata.image.src"),
71
136
  };
72
137
 
@@ -107,6 +172,14 @@ fragment ContentPageMetadataFragment on Content {
107
172
  ">");
108
173
  }
109
174
  }
175
+
176
+ const structuredData = buildStructuredData(node);
177
+
178
+ if (structuredData) {
179
+ out.w("<script type=\"application/ld+json\">" +
180
+ marko_escapeScript(("\n " + structuredData) + "\n ") +
181
+ "</script>");
182
+ }
110
183
  }
111
184
  }, out, __component, "0");
112
185
  } else {
@@ -119,10 +192,10 @@ marko_template._ = marko_renderer(render, {
119
192
  }, marko_component);
120
193
 
121
194
  marko_template.meta = {
122
- id: "/@base-cms/marko-web$1.37.0/components/page/metadata/content.marko",
195
+ id: "/@parameter1/base-cms-marko-web$2.75.1/components/page/metadata/content.marko",
123
196
  component: "./content.marko",
124
197
  tags: [
125
198
  "./components/common.marko",
126
- "@base-cms/marko-core/components/queries/index.marko"
199
+ "@parameter1/base-cms-marko-core/components/queries/index.marko"
127
200
  ]
128
201
  };
@@ -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$2.13.0/components/page/metadata/default.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.75.1/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$2.13.0/components/page/metadata/default.marko",
25
+ id: "/@parameter1/base-cms-marko-web$2.75.1/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$2.13.0/components/page/rel-canonical.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.75.1/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$2.13.0/components/page/rel-canonical.marko"
41
+ id: "/@parameter1/base-cms-marko-web$2.75.1/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$2.13.0/components/page/title.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.75.1/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$2.13.0/components/page/title.marko"
45
+ id: "/@parameter1/base-cms-marko-web$2.75.1/components/page/title.marko"
46
46
  };
@@ -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$2.13.0/components/page/wrapper.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.75.1/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,
@@ -56,7 +56,7 @@ marko_template._ = marko_renderer(render, {
56
56
  });
57
57
 
58
58
  marko_template.meta = {
59
- id: "/@parameter1/base-cms-marko-web$2.13.0/components/page/wrapper.marko",
59
+ id: "/@parameter1/base-cms-marko-web$2.75.1/components/page/wrapper.marko",
60
60
  tags: [
61
61
  "../element"
62
62
  ]
@@ -2,17 +2,17 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/src/html").t(__filename),
5
- marko_componentType = "/@base-cms/marko-web$1.37.0/components/resolve/page.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.75.1/components/resolve/page.marko",
6
6
  marko_component = require("./page.marko"),
7
7
  marko_renderer = require("marko/src/runtime/components/renderer"),
8
- module_utils_module = require("@base-cms/utils"),
9
- utils_module = module_utils_module.default || module_utils_module,
10
- isFunction = module_utils_module.isFunction,
11
- module_objectPath_module = require("@base-cms/object-path"),
12
- objectPath_module = module_objectPath_module.default || module_objectPath_module,
13
- getAsObject = module_objectPath_module.getAsObject,
8
+ module_baseCmsUtils_module = require("@parameter1/base-cms-utils"),
9
+ baseCmsUtils_module = module_baseCmsUtils_module.default || module_baseCmsUtils_module,
10
+ isFunction = module_baseCmsUtils_module.isFunction,
11
+ module_baseCmsObjectPath_module = require("@parameter1/base-cms-object-path"),
12
+ baseCmsObjectPath_module = module_baseCmsObjectPath_module.default || module_baseCmsObjectPath_module,
13
+ getAsObject = module_baseCmsObjectPath_module.getAsObject,
14
14
  marko_dynamicTag = require("marko/src/runtime/helpers/dynamic-tag"),
15
- marko_web_resolve_template = require("@base-cms/marko-core/components/resolve.marko"),
15
+ marko_web_resolve_template = require("@parameter1/base-cms-marko-core/components/resolve.marko"),
16
16
  marko_loadTag = require("marko/src/runtime/helpers/load-tag"),
17
17
  marko_web_resolve_tag = marko_loadTag(marko_web_resolve_template);
18
18
 
@@ -41,9 +41,9 @@ marko_template._ = marko_renderer(render, {
41
41
  }, marko_component);
42
42
 
43
43
  marko_template.meta = {
44
- id: "/@base-cms/marko-web$1.37.0/components/resolve/page.marko",
44
+ id: "/@parameter1/base-cms-marko-web$2.75.1/components/resolve/page.marko",
45
45
  component: "./page.marko",
46
46
  tags: [
47
- "@base-cms/marko-core/components/resolve.marko"
47
+ "@parameter1/base-cms-marko-core/components/resolve.marko"
48
48
  ]
49
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parameter1/base-cms-marko-web",
3
- "version": "2.75.0",
3
+ "version": "2.80.1",
4
4
  "description": "Core Marko+Express components for BaseCMS websites",
5
5
  "author": "Jacob Bare <jacob@parameter1.com>",
6
6
  "main": "index.js",
@@ -22,10 +22,10 @@
22
22
  "@parameter1/base-cms-image": "^2.45.0",
23
23
  "@parameter1/base-cms-inflector": "^2.0.0",
24
24
  "@parameter1/base-cms-marko-node-require": "^2.57.0",
25
- "@parameter1/base-cms-object-path": "^2.75.0",
25
+ "@parameter1/base-cms-object-path": "^2.75.1",
26
26
  "@parameter1/base-cms-tenant-context": "^2.0.0",
27
- "@parameter1/base-cms-utils": "^2.75.0",
28
- "@parameter1/base-cms-web-common": "^2.75.0",
27
+ "@parameter1/base-cms-utils": "^2.75.1",
28
+ "@parameter1/base-cms-web-common": "^2.80.0",
29
29
  "apollo-cache-inmemory": "^1.6.6",
30
30
  "apollo-client": "^2.6.10",
31
31
  "apollo-link": "^1.2.14",
@@ -51,5 +51,5 @@
51
51
  "publishConfig": {
52
52
  "access": "public"
53
53
  },
54
- "gitHead": "2259033bcb79da6c9e8c990eae71b8c7a2826e61"
54
+ "gitHead": "23e005af644abcfcf2a96b1efc3410ca615b9b4f"
55
55
  }