@parameter1/base-cms-marko-web 2.93.1 → 2.94.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/components/browser-component.marko.js +2 -2
  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 +5 -0
  7. package/components/document/index.marko.js +2 -2
  8. package/components/element/block.marko.js +2 -2
  9. package/components/element/components/image.marko +1 -1
  10. package/components/element/components/text.marko.js +2 -2
  11. package/components/element/content/name.marko.js +2 -2
  12. package/components/element/index.marko.js +2 -2
  13. package/components/element/link.marko.js +2 -2
  14. package/components/element/marko.json +35 -0
  15. package/components/element/obj-text.marko.js +2 -2
  16. package/components/element/obj.marko.js +2 -2
  17. package/components/element/picture.marko +36 -0
  18. package/components/element/text.marko.js +2 -2
  19. package/components/load-more/index.marko.js +2 -2
  20. package/components/load-more/trigger.marko.js +2 -2
  21. package/components/node-list/body.marko.js +2 -2
  22. package/components/node-list/element.marko.js +2 -2
  23. package/components/node-list/footer.marko.js +2 -2
  24. package/components/node-list/header.marko.js +2 -2
  25. package/components/node-list/index.marko.js +2 -2
  26. package/components/node-list/node.marko.js +2 -2
  27. package/components/node-list/nodes.marko.js +2 -2
  28. package/components/page/container.marko.js +2 -2
  29. package/components/page/description.marko.js +2 -2
  30. package/components/page/layouts/default.marko.js +2 -2
  31. package/components/page/metadata/components/common.marko.js +2 -2
  32. package/components/page/metadata/default.marko.js +2 -2
  33. package/components/page/rel-canonical.marko.js +2 -2
  34. package/components/page/title.marko.js +2 -2
  35. package/components/page/wrapper.marko.js +2 -2
  36. package/components/resolve/page.marko.js +2 -2
  37. package/package.json +4 -4
  38. package/utils/embedded-media/image.js +34 -5
@@ -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.92.0/components/browser-component.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/browser-component.marko",
6
6
  marko_component = require("./browser-component.marko"),
7
7
  marko_renderer = require("marko/src/runtime/components/renderer"),
8
8
  module_defaultValue = require("@parameter1/base-cms-marko-core/utils/default-value"),
@@ -73,7 +73,7 @@ marko_template._ = marko_renderer(render, {
73
73
  }, marko_component);
74
74
 
75
75
  marko_template.meta = {
76
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/browser-component.marko",
76
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/browser-component.marko",
77
77
  component: "./browser-component.marko",
78
78
  tags: [
79
79
  "@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$2.92.0/components/document/components/body-wrapper.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/document/components/body-wrapper.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  marko_dynamicTag = require("marko/src/runtime/helpers/dynamic-tag"),
8
8
  marko_attrs = require("marko/src/runtime/html/helpers/attrs");
@@ -29,5 +29,5 @@ marko_template._ = marko_renderer(render, {
29
29
  });
30
30
 
31
31
  marko_template.meta = {
32
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/document/components/body-wrapper.marko"
32
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/document/components/body-wrapper.marko"
33
33
  };
@@ -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.92.0/components/document/components/error.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/document/components/error.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  module_isDev = require("../../../utils/is-dev"),
8
8
  isDev = module_isDev.default || module_isDev,
@@ -77,7 +77,7 @@ marko_template._ = marko_renderer(render, {
77
77
  });
78
78
 
79
79
  marko_template.meta = {
80
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/document/components/error.marko",
80
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/document/components/error.marko",
81
81
  tags: [
82
82
  "../../page/title.marko",
83
83
  "../../page/wrapper.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$2.92.0/components/document/components/live-reload.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/document/components/live-reload.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  module_isDev = require("../../../utils/is-dev"),
8
8
  isDev = module_isDev.default || module_isDev,
@@ -26,5 +26,5 @@ marko_template._ = marko_renderer(render, {
26
26
  });
27
27
 
28
28
  marko_template.meta = {
29
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/document/components/live-reload.marko"
29
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/document/components/live-reload.marko"
30
30
  };
@@ -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.92.0/components/document/container.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/document/container.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,
@@ -47,7 +47,7 @@ marko_template._ = marko_renderer(render, {
47
47
  });
48
48
 
49
49
  marko_template.meta = {
50
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/document/container.marko",
50
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/document/container.marko",
51
51
  tags: [
52
52
  "../page/container.marko"
53
53
  ]
@@ -28,6 +28,11 @@ $ const wrapper = getAsObject(input, "bodyWrapper");
28
28
  </script>
29
29
  <!-- load lazysizes -->
30
30
  <script src="/dist/js/lazysizes/v5.3.2.js" async></script>
31
+ <!-- load picturefill -->
32
+ <script>
33
+ document.createElement( "picture" );
34
+ </script>
35
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/picturefill/3.0.3/picturefill.min.js" async></script>
31
36
 
32
37
  <${input.head} />
33
38
  </head>
@@ -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.92.0/components/document/index.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/document/index.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,
@@ -106,7 +106,7 @@ marko_template._ = marko_renderer(render, {
106
106
  });
107
107
 
108
108
  marko_template.meta = {
109
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/document/index.marko",
109
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/document/index.marko",
110
110
  tags: [
111
111
  "./container.marko",
112
112
  "./components/live-reload.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$2.92.0/components/element/block.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/element/block.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,
@@ -40,5 +40,5 @@ marko_template._ = marko_renderer(render, {
40
40
  });
41
41
 
42
42
  marko_template.meta = {
43
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/element/block.marko"
43
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/element/block.marko"
44
44
  };
@@ -3,7 +3,7 @@ import { getAsArray } from "@parameter1/base-cms-object-path";
3
3
  $ const { config } = out.global;
4
4
  $ const { src, alt } = input;
5
5
  $ const lazyload = config.lazyloadImages() && input.lazyload !== false
6
- $ const srcset = getAsArray(input.srcset).join(",") || null;
6
+ $ const srcset = getAsArray(input.srcset).join(", ") || null;
7
7
 
8
8
  $ const classNames = [input.class];
9
9
  $ if (lazyload) classNames.push("lazyload");
@@ -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.92.0/components/element/components/text.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/element/components/text.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  marko_dynamicTag = require("marko/src/runtime/helpers/dynamic-tag"),
8
8
  marko_str = require("marko/src/runtime/helpers/to-string"),
@@ -33,5 +33,5 @@ marko_template._ = marko_renderer(render, {
33
33
  });
34
34
 
35
35
  marko_template.meta = {
36
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/element/components/text.marko"
36
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/element/components/text.marko"
37
37
  };
@@ -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.92.0/components/element/content/name.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/element/content/name.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  module_extractRender = require("../extract-render"),
8
8
  extractRender = module_extractRender.default || module_extractRender,
@@ -34,7 +34,7 @@ marko_template._ = marko_renderer(render, {
34
34
  });
35
35
 
36
36
  marko_template.meta = {
37
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/element/content/name.marko",
37
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/element/content/name.marko",
38
38
  tags: [
39
39
  "../obj-text.marko"
40
40
  ]
@@ -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.92.0/components/element/index.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/element/index.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,
@@ -43,5 +43,5 @@ marko_template._ = marko_renderer(render, {
43
43
  });
44
44
 
45
45
  marko_template.meta = {
46
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/element/index.marko"
46
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/element/index.marko"
47
47
  };
@@ -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.92.0/components/element/link.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/element/link.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  marko_dynamicTag = require("marko/src/runtime/helpers/dynamic-tag"),
8
8
  marko_mergeAttrs = require("marko/src/runtime/html/helpers/merge-attrs");
@@ -50,5 +50,5 @@ marko_template._ = marko_renderer(render, {
50
50
  });
51
51
 
52
52
  marko_template.meta = {
53
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/element/link.marko"
53
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/element/link.marko"
54
54
  };
@@ -162,5 +162,40 @@
162
162
  "@class": "string",
163
163
  "@attrs": "object",
164
164
  "@modifiers": "array"
165
+ },
166
+ "<marko-web-picture>": {
167
+ "template": "./picture.marko",
168
+ "<image>": {
169
+ "@src": "string",
170
+ "@srcset": "array",
171
+ "@alt": "string",
172
+ "@lazyload": {
173
+ "type": "boolean",
174
+ "default-value": true
175
+ },
176
+ "@class": "string",
177
+ "@attrs": "object",
178
+ "@link": "object"
179
+ },
180
+ "<link>": {
181
+ "<before>": {},
182
+ "<after>": {},
183
+ "@href": "string",
184
+ "@target": "string",
185
+ "@title": "string",
186
+ "@rel": "string",
187
+ "@class": "string",
188
+ "@attrs": "object"
189
+ },
190
+ "@sources <source>[]": {
191
+ "@media": {
192
+ "type": "string",
193
+ "required": true
194
+ },
195
+ "@srcset": {
196
+ "type": "array",
197
+ "required": true
198
+ }
199
+ }
165
200
  }
166
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.92.0/components/element/obj-text.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/element/obj-text.marko",
6
6
  marko_component = require("./obj-text.marko"),
7
7
  marko_renderer = require("marko/src/runtime/components/renderer"),
8
8
  module_objectLink = require("./object-link"),
@@ -44,7 +44,7 @@ marko_template._ = marko_renderer(render, {
44
44
  }, marko_component);
45
45
 
46
46
  marko_template.meta = {
47
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/element/obj-text.marko",
47
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/element/obj-text.marko",
48
48
  component: "./obj-text.marko",
49
49
  tags: [
50
50
  "./text.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$2.92.0/components/element/obj.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/element/obj.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,
@@ -57,5 +57,5 @@ marko_template._ = marko_renderer(render, {
57
57
  });
58
58
 
59
59
  marko_template.meta = {
60
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/element/obj.marko"
60
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/element/obj.marko"
61
61
  };
@@ -0,0 +1,36 @@
1
+ import { getAsArray } from "@parameter1/base-cms-object-path";
2
+
3
+ $ const { link, sources = [], image } = input;
4
+
5
+ $ const hasImage = Boolean(image.src);
6
+
7
+ <if(hasImage)>
8
+ <if(link)>
9
+ <marko-core-link
10
+ before=link.before
11
+ after=link.after
12
+ href=link.href
13
+ target=link.target
14
+ title=link.title
15
+ rel=link.rel
16
+ class=link.class
17
+ attrs=link.attrs
18
+ >
19
+ <marko-web-picture image=image sources=sources />
20
+ </marko-core-link>
21
+ </if>
22
+ <else>
23
+ <picture>
24
+ <for|s| of=sources>
25
+ $ const srcset = image.lazyload ? null : s.srcset.join(", ");
26
+ $ const dataSrcset = image.lazyload ? s.srcset.join(", ") : null;
27
+ <source
28
+ srcset=srcset
29
+ data-srcset=dataSrcset
30
+ media=s.media
31
+ >
32
+ </for>
33
+ <image ...image />
34
+ </picture>
35
+ </else>
36
+ </if>
@@ -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.92.0/components/element/text.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/element/text.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  text_template = require("./components/text.marko"),
8
8
  marko_loadTag = require("marko/src/runtime/helpers/load-tag"),
@@ -68,7 +68,7 @@ marko_template._ = marko_renderer(render, {
68
68
  });
69
69
 
70
70
  marko_template.meta = {
71
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/element/text.marko",
71
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/element/text.marko",
72
72
  tags: [
73
73
  "./components/text.marko",
74
74
  "./link.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$2.92.0/components/load-more/index.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/load-more/index.marko",
6
6
  marko_component = require("./index.marko"),
7
7
  marko_renderer = require("marko/src/runtime/components/renderer"),
8
8
  module_baseCmsObjectPath_module = require("@parameter1/base-cms-object-path"),
@@ -108,7 +108,7 @@ marko_template._ = marko_renderer(render, {
108
108
  }, marko_component);
109
109
 
110
110
  marko_template.meta = {
111
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/load-more/index.marko",
111
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/load-more/index.marko",
112
112
  component: "./",
113
113
  tags: [
114
114
  "../browser-component.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$2.92.0/components/load-more/trigger.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/load-more/trigger.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  marko_web_browser_component_template = require("../browser-component.marko"),
8
8
  marko_loadTag = require("marko/src/runtime/helpers/load-tag"),
@@ -33,7 +33,7 @@ marko_template._ = marko_renderer(render, {
33
33
  });
34
34
 
35
35
  marko_template.meta = {
36
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/load-more/trigger.marko",
36
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/load-more/trigger.marko",
37
37
  tags: [
38
38
  "../browser-component.marko"
39
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$2.92.0/components/node-list/body.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/body.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,
@@ -43,7 +43,7 @@ marko_template._ = marko_renderer(render, {
43
43
  });
44
44
 
45
45
  marko_template.meta = {
46
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/node-list/body.marko",
46
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/body.marko",
47
47
  tags: [
48
48
  "./element.marko"
49
49
  ]
@@ -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.92.0/components/node-list/element.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/element.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  marko_assign = require("marko/src/runtime/helpers/assign"),
8
8
  marko_web_element_template = require("../element"),
@@ -28,7 +28,7 @@ marko_template._ = marko_renderer(render, {
28
28
  });
29
29
 
30
30
  marko_template.meta = {
31
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/node-list/element.marko",
31
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/element.marko",
32
32
  tags: [
33
33
  "../element"
34
34
  ]
@@ -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.92.0/components/node-list/footer.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/footer.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,
@@ -43,7 +43,7 @@ marko_template._ = marko_renderer(render, {
43
43
  });
44
44
 
45
45
  marko_template.meta = {
46
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/node-list/footer.marko",
46
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/footer.marko",
47
47
  tags: [
48
48
  "./element.marko"
49
49
  ]
@@ -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.92.0/components/node-list/header.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/header.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,
@@ -43,7 +43,7 @@ marko_template._ = marko_renderer(render, {
43
43
  });
44
44
 
45
45
  marko_template.meta = {
46
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/node-list/header.marko",
46
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/header.marko",
47
47
  tags: [
48
48
  "./element.marko"
49
49
  ]
@@ -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.92.0/components/node-list/index.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/index.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,
@@ -83,7 +83,7 @@ marko_template._ = marko_renderer(render, {
83
83
  });
84
84
 
85
85
  marko_template.meta = {
86
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/node-list/index.marko",
86
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/index.marko",
87
87
  tags: [
88
88
  "./header.marko",
89
89
  "./body.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$2.92.0/components/node-list/node.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/node.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,
@@ -42,7 +42,7 @@ marko_template._ = marko_renderer(render, {
42
42
  });
43
43
 
44
44
  marko_template.meta = {
45
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/node-list/node.marko",
45
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/node.marko",
46
46
  tags: [
47
47
  "./element.marko"
48
48
  ]
@@ -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.92.0/components/node-list/nodes.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/nodes.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,
@@ -118,7 +118,7 @@ marko_template._ = marko_renderer(render, {
118
118
  });
119
119
 
120
120
  marko_template.meta = {
121
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/node-list/nodes.marko",
121
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/node-list/nodes.marko",
122
122
  tags: [
123
123
  "./node.marko",
124
124
  "./element.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$2.92.0/components/page/container.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/page/container.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,
@@ -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.92.0/components/page/container.marko"
45
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/page/container.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.92.0/components/page/description.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/page/description.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  marko_attr = require("marko/src/runtime/html/helpers/attr");
8
8
 
@@ -22,5 +22,5 @@ marko_template._ = marko_renderer(render, {
22
22
  });
23
23
 
24
24
  marko_template.meta = {
25
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/page/description.marko"
25
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/page/description.marko"
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$2.92.0/components/page/layouts/default.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/page/layouts/default.marko",
6
6
  marko_renderer = require("marko/src/runtime/components/renderer"),
7
7
  marko_web_default_page_metadata_template = require("../metadata/default.marko"),
8
8
  marko_loadTag = require("marko/src/runtime/helpers/load-tag"),
@@ -54,7 +54,7 @@ marko_template._ = marko_renderer(render, {
54
54
  });
55
55
 
56
56
  marko_template.meta = {
57
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/page/layouts/default.marko",
57
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/page/layouts/default.marko",
58
58
  tags: [
59
59
  "../metadata/default.marko"
60
60
  ]
@@ -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.92.0/components/page/metadata/components/common.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/components/page/metadata/components/common.marko",
6
6
  marko_component = require("./common.marko"),
7
7
  marko_renderer = require("marko/src/runtime/components/renderer"),
8
8
  marko_web_page_title_template = require("../../title.marko"),
@@ -98,7 +98,7 @@ marko_template._ = marko_renderer(render, {
98
98
  }, marko_component);
99
99
 
100
100
  marko_template.meta = {
101
- id: "/@parameter1/base-cms-marko-web$2.92.0/components/page/metadata/components/common.marko",
101
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/page/metadata/components/common.marko",
102
102
  component: "./common.marko",
103
103
  tags: [
104
104
  "../../title.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$2.92.0/components/page/metadata/default.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.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.92.0/components/page/metadata/default.marko",
25
+ id: "/@parameter1/base-cms-marko-web$2.93.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.92.0/components/page/rel-canonical.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.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.92.0/components/page/rel-canonical.marko"
41
+ id: "/@parameter1/base-cms-marko-web$2.93.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.92.0/components/page/title.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.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.92.0/components/page/title.marko"
45
+ id: "/@parameter1/base-cms-marko-web$2.93.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.92.0/components/page/wrapper.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.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.92.0/components/page/wrapper.marko",
59
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/page/wrapper.marko",
60
60
  tags: [
61
61
  "../element"
62
62
  ]
@@ -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.92.0/components/resolve/page.marko",
5
+ marko_componentType = "/@parameter1/base-cms-marko-web$2.93.1/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$2.92.0/components/resolve/page.marko",
44
+ id: "/@parameter1/base-cms-marko-web$2.93.1/components/resolve/page.marko",
45
45
  component: "./page.marko",
46
46
  tags: [
47
47
  "@parameter1/base-cms-marko-core/components/resolve.marko"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parameter1/base-cms-marko-web",
3
- "version": "2.93.1",
3
+ "version": "2.94.0",
4
4
  "description": "Core Marko+Express components for BaseCMS websites",
5
5
  "author": "Jacob Bare <jacob@parameter1.com>",
6
6
  "main": "index.js",
@@ -16,10 +16,10 @@
16
16
  "dependencies": {
17
17
  "@godaddy/terminus": "^4.9.0",
18
18
  "@parameter1/base-cms-apollo-ssr": "^2.45.0",
19
- "@parameter1/base-cms-embedded-media": "^2.93.1",
19
+ "@parameter1/base-cms-embedded-media": "^2.94.0",
20
20
  "@parameter1/base-cms-express-apollo": "^2.45.0",
21
21
  "@parameter1/base-cms-graphql-fragment-types": "^2.45.0",
22
- "@parameter1/base-cms-image": "^2.92.0",
22
+ "@parameter1/base-cms-image": "^2.94.0",
23
23
  "@parameter1/base-cms-inflector": "^2.0.0",
24
24
  "@parameter1/base-cms-marko-node-require": "^2.57.0",
25
25
  "@parameter1/base-cms-object-path": "^2.75.1",
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "0599cbf2458e6a4835c45af2e9cc1c6c07d1d33b"
49
+ "gitHead": "cc0b6b748532a40ada246d3f1233c3142d78365c"
50
50
  }
@@ -1,3 +1,5 @@
1
+ const { buildImgixUrl } = require('@parameter1/base-cms-image');
2
+
1
3
  const stringifyAttrs = attrs => Object.keys(attrs).reduce((arr, key) => {
2
4
  const value = attrs[key];
3
5
  if (value) arr.push(`${key}="${value}"`);
@@ -10,23 +12,50 @@ module.exports = (tag, { config } = {}, { lazyloadImages } = {}) => {
10
12
  const alt = tag.get('alt');
11
13
  const caption = tag.get('caption');
12
14
  const credit = tag.get('credit');
15
+ const align = tag.get('align');
16
+
17
+ const width = tag.get('width');
18
+ const height = tag.get('height');
13
19
 
14
20
  const attrs = {
15
21
  'data-embed-type': tag.type,
16
22
  'data-embed-id': tag.id,
17
- 'data-embed-align': tag.get('align'),
23
+ 'data-embed-align': align,
18
24
  };
19
25
 
26
+ const minWidth = 400;
27
+ const maxWidth = (align) ? minWidth : 700;
28
+
29
+ const maxSrcset = `${buildImgixUrl(src, { w: maxWidth })}, ${buildImgixUrl(src, { w: maxWidth, dpr: 2 })} 2x`;
30
+
31
+ const sources = [
32
+ {
33
+ srcset: lazyload ? null : maxSrcset,
34
+ 'data-srcset': lazyload ? maxSrcset : null,
35
+ media: '(min-width: 576px)',
36
+ },
37
+ ].map(source => `<source ${stringifyAttrs(source)}>`).join('');
38
+
39
+ const minSrc = buildImgixUrl(src, { w: minWidth });
40
+ const minSrcset = `${buildImgixUrl(src, { w: minWidth, dpr: 2 })} 2x`;
41
+
42
+ const transparentImg = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
20
43
  const imgAttrs = {
21
44
  class: lazyload ? 'lazyload' : null,
22
- src: lazyload ? 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' : src,
23
- 'data-src': lazyload ? src : null,
45
+ src: lazyload ? transparentImg : minSrc,
46
+ srcset: lazyload ? null : minSrcset,
47
+ 'data-src': lazyload ? minSrc : null,
48
+ 'data-srcset': lazyload ? minSrcset : null,
24
49
  'data-image-id': tag.id,
25
50
  alt,
51
+ width: (width && height) ? minWidth : null,
52
+ height: (height && height) ? Math.round(height / width * minWidth) : null,
26
53
  };
54
+
27
55
  const captionElement = caption ? `<span class="caption">${caption}</span>` : '';
28
56
  const creditElement = credit ? `<span class="credit">${credit}</span>` : '';
29
57
 
30
- const img = `<img ${stringifyAttrs(imgAttrs)}>${captionElement}${creditElement}`;
31
- return `<span ${stringifyAttrs(attrs)}>${img}</span>`;
58
+ const img = `<img ${stringifyAttrs(imgAttrs)}>`;
59
+ const picture = `<picture>${sources}${img}${captionElement}${creditElement}</picture>`;
60
+ return `<span ${stringifyAttrs(attrs)}>${picture}</span>`;
32
61
  };