@mindful-web/marko-core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/.eslintignore +1 -0
  2. package/LICENSE +21 -0
  3. package/components/elements/array.marko +20 -0
  4. package/components/elements/array.marko.js +69 -0
  5. package/components/elements/components/text.marko +11 -0
  6. package/components/elements/components/text.marko.js +37 -0
  7. package/components/elements/date.marko +22 -0
  8. package/components/elements/date.marko.js +53 -0
  9. package/components/elements/img.marko +27 -0
  10. package/components/elements/img.marko.js +60 -0
  11. package/components/elements/link.marko +25 -0
  12. package/components/elements/link.marko.js +58 -0
  13. package/components/elements/marko.json +128 -0
  14. package/components/elements/obj-array.marko +13 -0
  15. package/components/elements/obj-array.marko.js +52 -0
  16. package/components/elements/obj-date.marko +17 -0
  17. package/components/elements/obj-date.marko.js +48 -0
  18. package/components/elements/obj-nodes.marko +16 -0
  19. package/components/elements/obj-nodes.marko.js +58 -0
  20. package/components/elements/obj-text.marko +16 -0
  21. package/components/elements/obj-text.marko.js +47 -0
  22. package/components/elements/obj-value.marko +14 -0
  23. package/components/elements/obj-value.marko.js +50 -0
  24. package/components/elements/text.marko +37 -0
  25. package/components/elements/text.marko.js +78 -0
  26. package/components/marko.json +10 -0
  27. package/components/queries/all-author-content.marko +3 -0
  28. package/components/queries/all-author-content.marko.js +33 -0
  29. package/components/queries/all-company-content.marko +3 -0
  30. package/components/queries/all-company-content.marko.js +33 -0
  31. package/components/queries/all-published-content.marko +3 -0
  32. package/components/queries/all-published-content.marko.js +33 -0
  33. package/components/queries/components/loader.marko +6 -0
  34. package/components/queries/components/loader.marko.js +40 -0
  35. package/components/queries/content.marko +3 -0
  36. package/components/queries/content.marko.js +33 -0
  37. package/components/queries/dynamic-page.marko +3 -0
  38. package/components/queries/dynamic-page.marko.js +33 -0
  39. package/components/queries/index.marko +65 -0
  40. package/components/queries/index.marko.js +110 -0
  41. package/components/queries/magazine-active-issues.marko +3 -0
  42. package/components/queries/magazine-active-issues.marko.js +33 -0
  43. package/components/queries/magazine-issue.marko +3 -0
  44. package/components/queries/magazine-issue.marko.js +33 -0
  45. package/components/queries/magazine-latest-issue.marko +3 -0
  46. package/components/queries/magazine-latest-issue.marko.js +33 -0
  47. package/components/queries/magazine-publication.marko +3 -0
  48. package/components/queries/magazine-publication.marko.js +33 -0
  49. package/components/queries/magazine-publications.marko +3 -0
  50. package/components/queries/magazine-publications.marko.js +33 -0
  51. package/components/queries/magazine-scheduled-content.marko +3 -0
  52. package/components/queries/magazine-scheduled-content.marko.js +33 -0
  53. package/components/queries/marko.json +66 -0
  54. package/components/queries/most-popular-content.marko +3 -0
  55. package/components/queries/most-popular-content.marko.js +33 -0
  56. package/components/queries/newsletter-scheduled-content.marko +3 -0
  57. package/components/queries/newsletter-scheduled-content.marko.js +33 -0
  58. package/components/queries/related-published-content.marko +3 -0
  59. package/components/queries/related-published-content.marko.js +33 -0
  60. package/components/queries/website-optioned-content.marko +3 -0
  61. package/components/queries/website-optioned-content.marko.js +33 -0
  62. package/components/queries/website-scheduled-content.marko +3 -0
  63. package/components/queries/website-scheduled-content.marko.js +33 -0
  64. package/components/queries/website-section.marko +3 -0
  65. package/components/queries/website-section.marko.js +33 -0
  66. package/components/queries/website-sections.marko +3 -0
  67. package/components/queries/website-sections.marko.js +33 -0
  68. package/components/resolve.marko +32 -0
  69. package/components/resolve.marko.js +85 -0
  70. package/marko.json +6 -0
  71. package/middleware/clean-marko-response.js +1 -0
  72. package/package.json +35 -0
  73. package/utils/build-marko-global.js +1 -0
  74. package/utils/clean-marko-chunk.js +1 -0
  75. package/utils/default-value.js +6 -0
  76. package/utils/extract-render-body.js +1 -0
  77. package/utils/is-dev.js +1 -0
  78. package/utils/should-collapse.js +5 -0
@@ -0,0 +1,16 @@
1
+ import { getAsArray, getAsObject } from "@mindful-web/object-path";
2
+
3
+ <marko-core-obj-value|{ value }|
4
+ obj=input.obj
5
+ field=input.field
6
+ >
7
+ $ const nodes = getAsArray(value, "edges").filter(edge => edge).map(edge => getAsObject(edge, "node"));
8
+ <marko-core-array|{ value: node, index, length }|
9
+ tag=input.tag
10
+ value=nodes
11
+ class=input.class
12
+ attrs=input.attrs
13
+ >
14
+ <${input.renderBody} node=node index=index length=length />
15
+ </marko-core-array>
16
+ </marko-core-obj-value>
@@ -0,0 +1,58 @@
1
+ // Compiled using marko@4.20.2 - DO NOT EDIT
2
+ "use strict";
3
+
4
+ var marko_template = module.exports = require("marko/dist/html").t(__filename),
5
+ marko_componentType = "/@mindful-web/marko-core$1.0.0/components/elements/obj-nodes.marko",
6
+ marko_component = require("./obj-nodes.marko"),
7
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
8
+ module_objectPath_module = require("@mindful-web/object-path"),
9
+ objectPath_module = module_objectPath_module.default || module_objectPath_module,
10
+ getAsArray = module_objectPath_module.getAsArray,
11
+ getAsObject = module_objectPath_module.getAsObject,
12
+ marko_dynamicTag = require("marko/dist/runtime/helpers/dynamic-tag"),
13
+ marko_core_array_template = require("./array.marko"),
14
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
15
+ marko_core_array_tag = marko_loadTag(marko_core_array_template),
16
+ marko_core_obj_value_template = require("./obj-value.marko"),
17
+ marko_core_obj_value_tag = marko_loadTag(marko_core_obj_value_template);
18
+
19
+ function render(input, out, __component, component, state) {
20
+ var data = input;
21
+
22
+ marko_core_obj_value_tag({
23
+ obj: input.obj,
24
+ field: input.field,
25
+ renderBody: function(out, { value }) {
26
+ const nodes = getAsArray(value, "edges").filter(edge => edge).map(edge => getAsObject(edge, "node"));
27
+
28
+ marko_core_array_tag({
29
+ tag: input.tag,
30
+ value: nodes,
31
+ class: input.class,
32
+ attrs: input.attrs,
33
+ renderBody: function(out, { value: node, index, length }) {
34
+ marko_dynamicTag(out, input.renderBody, function() {
35
+ return {
36
+ node: node,
37
+ index: index,
38
+ length: length
39
+ };
40
+ }, null, null, null, __component, "2");
41
+ }
42
+ }, out, __component, "1");
43
+ }
44
+ }, out, __component, "0");
45
+ }
46
+
47
+ marko_template._ = marko_renderer(render, {
48
+ e_: marko_componentType
49
+ }, marko_component);
50
+
51
+ marko_template.meta = {
52
+ id: "/@mindful-web/marko-core$1.0.0/components/elements/obj-nodes.marko",
53
+ component: "./obj-nodes.marko",
54
+ tags: [
55
+ "./array.marko",
56
+ "./obj-value.marko"
57
+ ]
58
+ };
@@ -0,0 +1,16 @@
1
+ import extractRenderBody from "../../utils/extract-render-body";
2
+
3
+ <marko-core-obj-value|{ value }|
4
+ obj=input.obj
5
+ field=input.field
6
+ >
7
+ <marko-core-text
8
+ tag=input.tag
9
+ value=value
10
+ html=input.html
11
+ class=input.class
12
+ attrs=input.attrs
13
+ link=input.link
14
+ ...extractRenderBody(input)
15
+ />
16
+ </marko-core-obj-value>
@@ -0,0 +1,47 @@
1
+ // Compiled using marko@4.20.2 - DO NOT EDIT
2
+ "use strict";
3
+
4
+ var marko_template = module.exports = require("marko/dist/html").t(__filename),
5
+ marko_componentType = "/@mindful-web/marko-core$1.0.0/components/elements/obj-text.marko",
6
+ marko_component = require("./obj-text.marko"),
7
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
8
+ module_extractRenderBody = require("../../utils/extract-render-body"),
9
+ extractRenderBody = module_extractRenderBody.default || module_extractRenderBody,
10
+ marko_assign = require("marko/dist/runtime/helpers/assign"),
11
+ marko_core_text_template = require("./text.marko"),
12
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
13
+ marko_core_text_tag = marko_loadTag(marko_core_text_template),
14
+ marko_core_obj_value_template = require("./obj-value.marko"),
15
+ marko_core_obj_value_tag = marko_loadTag(marko_core_obj_value_template);
16
+
17
+ function render(input, out, __component, component, state) {
18
+ var data = input;
19
+
20
+ marko_core_obj_value_tag({
21
+ obj: input.obj,
22
+ field: input.field,
23
+ renderBody: function(out, { value }) {
24
+ marko_core_text_tag(marko_assign({
25
+ tag: input.tag,
26
+ value: value,
27
+ html: input.html,
28
+ class: input.class,
29
+ attrs: input.attrs,
30
+ link: input.link
31
+ }, extractRenderBody(input)), out, __component, "1");
32
+ }
33
+ }, out, __component, "0");
34
+ }
35
+
36
+ marko_template._ = marko_renderer(render, {
37
+ e_: marko_componentType
38
+ }, marko_component);
39
+
40
+ marko_template.meta = {
41
+ id: "/@mindful-web/marko-core$1.0.0/components/elements/obj-text.marko",
42
+ component: "./obj-text.marko",
43
+ tags: [
44
+ "./text.marko",
45
+ "./obj-value.marko"
46
+ ]
47
+ };
@@ -0,0 +1,14 @@
1
+ import { asObject, asArray } from "@mindful-web/utils";
2
+ import { get, getAsObject } from "@mindful-web/object-path";
3
+
4
+ $ const { as } = input;
5
+ $ const obj = getAsObject(input, "obj");
6
+ $ const field = input.field || "id";
7
+ $ const value = get(obj, field);
8
+
9
+ <if(value)>
10
+ $ let v = value;
11
+ $ if (as === "object") v = asObject(v);
12
+ $ if (as === "array") v = asArray(v);
13
+ <${input.renderBody} value=v />
14
+ </if>
@@ -0,0 +1,50 @@
1
+ // Compiled using marko@4.20.2 - DO NOT EDIT
2
+ "use strict";
3
+
4
+ var marko_template = module.exports = require("marko/dist/html").t(__filename),
5
+ marko_componentType = "/@mindful-web/marko-core$1.0.0/components/elements/obj-value.marko",
6
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
7
+ module_utils_module = require("@mindful-web/utils"),
8
+ utils_module = module_utils_module.default || module_utils_module,
9
+ asObject = module_utils_module.asObject,
10
+ asArray = module_utils_module.asArray,
11
+ module_objectPath_module = require("@mindful-web/object-path"),
12
+ objectPath_module = module_objectPath_module.default || module_objectPath_module,
13
+ get = module_objectPath_module.get,
14
+ getAsObject = module_objectPath_module.getAsObject,
15
+ marko_dynamicTag = require("marko/dist/runtime/helpers/dynamic-tag");
16
+
17
+ function render(input, out, __component, component, state) {
18
+ var data = input;
19
+
20
+ const { as } = input;
21
+
22
+ const obj = getAsObject(input, "obj");
23
+
24
+ const field = input.field || "id";
25
+
26
+ const value = get(obj, field);
27
+
28
+ if (value) {
29
+ let v = value;
30
+
31
+ if (as === "object") v = asObject(v);
32
+
33
+ if (as === "array") v = asArray(v);
34
+
35
+ marko_dynamicTag(out, input.renderBody, function() {
36
+ return {
37
+ value: v
38
+ };
39
+ }, null, null, null, __component, "0");
40
+ }
41
+ }
42
+
43
+ marko_template._ = marko_renderer(render, {
44
+ d_: true,
45
+ e_: marko_componentType
46
+ });
47
+
48
+ marko_template.meta = {
49
+ id: "/@mindful-web/marko-core$1.0.0/components/elements/obj-value.marko"
50
+ };
@@ -0,0 +1,37 @@
1
+ import defaultValue from "../../utils/default-value";
2
+
3
+ $ const tag = defaultValue(input.tag, "div");
4
+ $ const value = defaultValue(input.value, null, v => `${v}`.trim());
5
+
6
+ $ const textInput = {
7
+ html: input.html,
8
+ renderBody: input.renderBody,
9
+ value,
10
+ };
11
+
12
+ <if(value)>
13
+ <if(input.link)>
14
+ <if(tag)>
15
+ <${tag} ...input.attrs class=input.class>
16
+ <marko-core-link ...input.link>
17
+ <text ...textInput />
18
+ </marko-core-link>
19
+ </>
20
+ </if>
21
+ <else>
22
+ <marko-core-link ...input.link>
23
+ <text ...textInput />
24
+ </marko-core-link>
25
+ </else>
26
+ </if>
27
+ <else>
28
+ <if(tag)>
29
+ <${tag} ...input.attrs class=input.class>
30
+ <text ...textInput />
31
+ </>
32
+ </if>
33
+ <else>
34
+ <text ...textInput />
35
+ </else>
36
+ </else>
37
+ </if>
@@ -0,0 +1,78 @@
1
+ // Compiled using marko@4.20.2 - DO NOT EDIT
2
+ "use strict";
3
+
4
+ var marko_template = module.exports = require("marko/dist/html").t(__filename),
5
+ marko_componentType = "/@mindful-web/marko-core$1.0.0/components/elements/text.marko",
6
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
7
+ module_defaultValue = require("../../utils/default-value"),
8
+ defaultValue = module_defaultValue.default || module_defaultValue,
9
+ text_template = require("./components/text.marko"),
10
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
11
+ text_tag = marko_loadTag(text_template),
12
+ marko_assign = require("marko/dist/runtime/helpers/assign"),
13
+ marko_core_link_template = require("./link.marko"),
14
+ marko_core_link_tag = marko_loadTag(marko_core_link_template),
15
+ marko_dynamicTag = require("marko/dist/runtime/helpers/dynamic-tag");
16
+
17
+ function render(input, out, __component, component, state) {
18
+ var data = input;
19
+
20
+ const tag = defaultValue(input.tag, "div");
21
+
22
+ const value = defaultValue(input.value, null, v => `${v}`.trim());
23
+
24
+ const textInput = {
25
+ html: input.html,
26
+ renderBody: input.renderBody,
27
+ value,
28
+ };
29
+
30
+ if (value) {
31
+ if (input.link) {
32
+ if (tag) {
33
+ marko_dynamicTag(out, tag, function() {
34
+ return marko_assign({}, input.attrs, {
35
+ class: input.class
36
+ });
37
+ }, function(out) {
38
+ marko_core_link_tag(marko_assign({}, input.link, {
39
+ renderBody: function(out) {
40
+ text_tag(textInput, out, __component, "2");
41
+ }
42
+ }), out, __component, "1");
43
+ }, null, null, __component, "0");
44
+ } else {
45
+ marko_core_link_tag(marko_assign({}, input.link, {
46
+ renderBody: function(out) {
47
+ text_tag(textInput, out, __component, "4");
48
+ }
49
+ }), out, __component, "3");
50
+ }
51
+ } else {
52
+ if (tag) {
53
+ marko_dynamicTag(out, tag, function() {
54
+ return marko_assign({}, input.attrs, {
55
+ class: input.class
56
+ });
57
+ }, function(out) {
58
+ text_tag(textInput, out, __component, "6");
59
+ }, null, null, __component, "5");
60
+ } else {
61
+ text_tag(textInput, out, __component, "7");
62
+ }
63
+ }
64
+ }
65
+ }
66
+
67
+ marko_template._ = marko_renderer(render, {
68
+ d_: true,
69
+ e_: marko_componentType
70
+ });
71
+
72
+ marko_template.meta = {
73
+ id: "/@mindful-web/marko-core$1.0.0/components/elements/text.marko",
74
+ tags: [
75
+ "./components/text.marko",
76
+ "./link.marko"
77
+ ]
78
+ };
@@ -0,0 +1,10 @@
1
+ {
2
+ "taglib-imports": [
3
+ "./elements/marko.json",
4
+ "./queries/marko.json"
5
+ ],
6
+ "<marko-web-resolve>": {
7
+ "template": "./resolve.marko",
8
+ "@promise": "object"
9
+ }
10
+ }
@@ -0,0 +1,3 @@
1
+ import { allAuthorContent as loader } from "@mindful-web/web-common/block-loaders";
2
+
3
+ <loader loader=loader ...input />
@@ -0,0 +1,33 @@
1
+ // Compiled using marko@4.20.2 - DO NOT EDIT
2
+ "use strict";
3
+
4
+ var marko_template = module.exports = require("marko/dist/html").t(__filename),
5
+ marko_componentType = "/@mindful-web/marko-core$1.0.0/components/queries/all-author-content.marko",
6
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
7
+ module_blockLoaders_module = require("@mindful-web/web-common/block-loaders"),
8
+ blockLoaders_module = module_blockLoaders_module.default || module_blockLoaders_module,
9
+ loader = module_blockLoaders_module.allAuthorContent,
10
+ marko_assign = require("marko/dist/runtime/helpers/assign"),
11
+ loader_template = require("./components/loader.marko"),
12
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
13
+ loader_tag = marko_loadTag(loader_template);
14
+
15
+ function render(input, out, __component, component, state) {
16
+ var data = input;
17
+
18
+ loader_tag(marko_assign({
19
+ loader: loader
20
+ }, input), out, __component, "0");
21
+ }
22
+
23
+ marko_template._ = marko_renderer(render, {
24
+ d_: true,
25
+ e_: marko_componentType
26
+ });
27
+
28
+ marko_template.meta = {
29
+ id: "/@mindful-web/marko-core$1.0.0/components/queries/all-author-content.marko",
30
+ tags: [
31
+ "./components/loader.marko"
32
+ ]
33
+ };
@@ -0,0 +1,3 @@
1
+ import { allCompanyContent as loader } from "@mindful-web/web-common/block-loaders";
2
+
3
+ <loader loader=loader ...input />
@@ -0,0 +1,33 @@
1
+ // Compiled using marko@4.20.2 - DO NOT EDIT
2
+ "use strict";
3
+
4
+ var marko_template = module.exports = require("marko/dist/html").t(__filename),
5
+ marko_componentType = "/@mindful-web/marko-core$1.0.0/components/queries/all-company-content.marko",
6
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
7
+ module_blockLoaders_module = require("@mindful-web/web-common/block-loaders"),
8
+ blockLoaders_module = module_blockLoaders_module.default || module_blockLoaders_module,
9
+ loader = module_blockLoaders_module.allCompanyContent,
10
+ marko_assign = require("marko/dist/runtime/helpers/assign"),
11
+ loader_template = require("./components/loader.marko"),
12
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
13
+ loader_tag = marko_loadTag(loader_template);
14
+
15
+ function render(input, out, __component, component, state) {
16
+ var data = input;
17
+
18
+ loader_tag(marko_assign({
19
+ loader: loader
20
+ }, input), out, __component, "0");
21
+ }
22
+
23
+ marko_template._ = marko_renderer(render, {
24
+ d_: true,
25
+ e_: marko_componentType
26
+ });
27
+
28
+ marko_template.meta = {
29
+ id: "/@mindful-web/marko-core$1.0.0/components/queries/all-company-content.marko",
30
+ tags: [
31
+ "./components/loader.marko"
32
+ ]
33
+ };
@@ -0,0 +1,3 @@
1
+ import { allPublishedContent as loader } from "@mindful-web/web-common/block-loaders";
2
+
3
+ <loader loader=loader ...input />
@@ -0,0 +1,33 @@
1
+ // Compiled using marko@4.20.2 - DO NOT EDIT
2
+ "use strict";
3
+
4
+ var marko_template = module.exports = require("marko/dist/html").t(__filename),
5
+ marko_componentType = "/@mindful-web/marko-core$1.0.0/components/queries/all-published-content.marko",
6
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
7
+ module_blockLoaders_module = require("@mindful-web/web-common/block-loaders"),
8
+ blockLoaders_module = module_blockLoaders_module.default || module_blockLoaders_module,
9
+ loader = module_blockLoaders_module.allPublishedContent,
10
+ marko_assign = require("marko/dist/runtime/helpers/assign"),
11
+ loader_template = require("./components/loader.marko"),
12
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
13
+ loader_tag = marko_loadTag(loader_template);
14
+
15
+ function render(input, out, __component, component, state) {
16
+ var data = input;
17
+
18
+ loader_tag(marko_assign({
19
+ loader: loader
20
+ }, input), out, __component, "0");
21
+ }
22
+
23
+ marko_template._ = marko_renderer(render, {
24
+ d_: true,
25
+ e_: marko_componentType
26
+ });
27
+
28
+ marko_template.meta = {
29
+ id: "/@mindful-web/marko-core$1.0.0/components/queries/all-published-content.marko",
30
+ tags: [
31
+ "./components/loader.marko"
32
+ ]
33
+ };
@@ -0,0 +1,6 @@
1
+ $ const { apollo } = out.global;
2
+ $ const promise = input.loader(apollo, input);
3
+
4
+ <marko-web-resolve|{ resolved }| promise=promise>
5
+ <${input.renderBody} ...resolved />
6
+ </marko-web-resolve>
@@ -0,0 +1,40 @@
1
+ // Compiled using marko@4.20.2 - DO NOT EDIT
2
+ "use strict";
3
+
4
+ var marko_template = module.exports = require("marko/dist/html").t(__filename),
5
+ marko_componentType = "/@mindful-web/marko-core$1.0.0/components/queries/components/loader.marko",
6
+ marko_component = require("./loader.marko"),
7
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
8
+ marko_dynamicTag = require("marko/dist/runtime/helpers/dynamic-tag"),
9
+ marko_web_resolve_template = require("../../resolve.marko"),
10
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
11
+ marko_web_resolve_tag = marko_loadTag(marko_web_resolve_template);
12
+
13
+ function render(input, out, __component, component, state) {
14
+ var data = input;
15
+
16
+ const { apollo } = out.global;
17
+
18
+ const promise = input.loader(apollo, input);
19
+
20
+ marko_web_resolve_tag({
21
+ promise: promise,
22
+ renderBody: function(out, { resolved }) {
23
+ marko_dynamicTag(out, input.renderBody, function() {
24
+ return resolved;
25
+ }, null, null, null, __component, "1");
26
+ }
27
+ }, out, __component, "0");
28
+ }
29
+
30
+ marko_template._ = marko_renderer(render, {
31
+ e_: marko_componentType
32
+ }, marko_component);
33
+
34
+ marko_template.meta = {
35
+ id: "/@mindful-web/marko-core$1.0.0/components/queries/components/loader.marko",
36
+ component: "./loader.marko",
37
+ tags: [
38
+ "../../resolve.marko"
39
+ ]
40
+ };
@@ -0,0 +1,3 @@
1
+ import { content as loader } from "@mindful-web/web-common/block-loaders";
2
+
3
+ <loader loader=loader ...input />
@@ -0,0 +1,33 @@
1
+ // Compiled using marko@4.20.2 - DO NOT EDIT
2
+ "use strict";
3
+
4
+ var marko_template = module.exports = require("marko/dist/html").t(__filename),
5
+ marko_componentType = "/@mindful-web/marko-core$1.0.0/components/queries/content.marko",
6
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
7
+ module_blockLoaders_module = require("@mindful-web/web-common/block-loaders"),
8
+ blockLoaders_module = module_blockLoaders_module.default || module_blockLoaders_module,
9
+ loader = module_blockLoaders_module.content,
10
+ marko_assign = require("marko/dist/runtime/helpers/assign"),
11
+ loader_template = require("./components/loader.marko"),
12
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
13
+ loader_tag = marko_loadTag(loader_template);
14
+
15
+ function render(input, out, __component, component, state) {
16
+ var data = input;
17
+
18
+ loader_tag(marko_assign({
19
+ loader: loader
20
+ }, input), out, __component, "0");
21
+ }
22
+
23
+ marko_template._ = marko_renderer(render, {
24
+ d_: true,
25
+ e_: marko_componentType
26
+ });
27
+
28
+ marko_template.meta = {
29
+ id: "/@mindful-web/marko-core$1.0.0/components/queries/content.marko",
30
+ tags: [
31
+ "./components/loader.marko"
32
+ ]
33
+ };
@@ -0,0 +1,3 @@
1
+ import { dynamicPage as loader } from "@mindful-web/web-common/block-loaders";
2
+
3
+ <loader loader=loader ...input />
@@ -0,0 +1,33 @@
1
+ // Compiled using marko@4.20.2 - DO NOT EDIT
2
+ "use strict";
3
+
4
+ var marko_template = module.exports = require("marko/dist/html").t(__filename),
5
+ marko_componentType = "/@mindful-web/marko-core$1.0.0/components/queries/dynamic-page.marko",
6
+ marko_renderer = require("marko/dist/runtime/components/renderer"),
7
+ module_blockLoaders_module = require("@mindful-web/web-common/block-loaders"),
8
+ blockLoaders_module = module_blockLoaders_module.default || module_blockLoaders_module,
9
+ loader = module_blockLoaders_module.dynamicPage,
10
+ marko_assign = require("marko/dist/runtime/helpers/assign"),
11
+ loader_template = require("./components/loader.marko"),
12
+ marko_loadTag = require("marko/dist/runtime/helpers/load-tag"),
13
+ loader_tag = marko_loadTag(loader_template);
14
+
15
+ function render(input, out, __component, component, state) {
16
+ var data = input;
17
+
18
+ loader_tag(marko_assign({
19
+ loader: loader
20
+ }, input), out, __component, "0");
21
+ }
22
+
23
+ marko_template._ = marko_renderer(render, {
24
+ d_: true,
25
+ e_: marko_componentType
26
+ });
27
+
28
+ marko_template.meta = {
29
+ id: "/@mindful-web/marko-core$1.0.0/components/queries/dynamic-page.marko",
30
+ tags: [
31
+ "./components/loader.marko"
32
+ ]
33
+ };
@@ -0,0 +1,65 @@
1
+ import { warn } from "@mindful-web/utils";
2
+ import AllAuthorContent from "./all-author-content";
3
+ import AllCompanyContent from "./all-company-content";
4
+ import AllPublishedContent from "./all-published-content";
5
+ import Content from "./content";
6
+ import DynamicPage from "./dynamic-page";
7
+ import MagazineActiveIssues from "./magazine-active-issues";
8
+ import MagazineIssue from "./magazine-issue";
9
+ import MagazineLatestIssue from "./magazine-latest-issue";
10
+ import MagazinePublication from "./magazine-publication";
11
+ import MagazinePublications from "./magazine-publications";
12
+ import MagazineScheduledContent from "./magazine-scheduled-content";
13
+ import NewsletterScheduledContent from "./newsletter-scheduled-content";
14
+ import RelatedPublishedContent from "./related-published-content";
15
+ import WebsiteOptionedContent from "./website-optioned-content";
16
+ import WebsiteScheduledContent from "./website-scheduled-content";
17
+ import WebsiteSection from "./website-section";
18
+ import WebsiteSections from "./website-sections";
19
+ import shouldCollapse from "../../utils/should-collapse";
20
+
21
+ $ const map = {
22
+ "all-author-content": AllAuthorContent,
23
+ "all-company-content": AllCompanyContent,
24
+ "all-published-content": AllPublishedContent,
25
+ "content": Content,
26
+ "dynamic-page": DynamicPage,
27
+ "magazine-active-issues": MagazineActiveIssues,
28
+ "magazine-issue": MagazineIssue,
29
+ "magazine-latest-issue": MagazineLatestIssue,
30
+ "magazine-publication": MagazinePublication,
31
+ "magazine-publications": MagazinePublications,
32
+ "magazine-scheduled-content": MagazineScheduledContent,
33
+ "newsletter-scheduled-content": NewsletterScheduledContent,
34
+ "related-published-content": RelatedPublishedContent,
35
+ "website-optioned-content": WebsiteOptionedContent,
36
+ "website-scheduled-content": WebsiteScheduledContent,
37
+ "website-section": WebsiteSection,
38
+ "website-sections": WebsiteSections,
39
+ };
40
+ $ const collapsible = shouldCollapse(input.collapsible);
41
+
42
+ $ const Component = map[input.name];
43
+
44
+ <if(Component)>
45
+ <${Component}|data| ...input.params>
46
+ $ const { nodes, node } = data;
47
+ <if(nodes)>
48
+ <if(nodes.length || !collapsible)>
49
+ <${input.renderBody} ...data />
50
+ </if>
51
+ <else>
52
+ <${input.whenEmpty} />
53
+ </else>
54
+ </if>
55
+ <else-if(node || !collapsible)>
56
+ <${input.renderBody} ...data />
57
+ </else-if>
58
+ <else>
59
+ <${input.whenEmpty} />
60
+ </else>
61
+ </>
62
+ </if>
63
+ <else>
64
+ $ warn(`Unable to execute query: no component was found for '${input.name}'`);
65
+ </else>