coralite-plugin-aggregation 0.5.4 → 0.6.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.
- package/dist/blog/all/index.html +44 -5
- package/dist/blog/all/page/2.html +44 -5
- package/dist/blog/all/page/3.html +46 -7
- package/dist/blog/all/page/4.html +46 -7
- package/dist/blog/all/page/5.html +46 -7
- package/dist/blog/index.html +44 -5
- package/dist/blog/page/2.html +44 -5
- package/dist/blog/page/3.html +46 -7
- package/dist/blog/page/4.html +46 -7
- package/dist/blog/page/5.html +46 -7
- package/dist/blog/post-1.html +41 -2
- package/dist/blog/post-2.html +41 -2
- package/dist/blog/post-3.html +41 -2
- package/dist/blog/post-4.html +41 -2
- package/dist/blog/post-5.html +41 -2
- package/dist/index.html +43 -60
- package/dist/page/2.html +43 -60
- package/dist/page/3.html +43 -60
- package/dist/page/4.html +43 -60
- package/dist/products/product-1.html +41 -2
- package/dist/products/product-2.html +41 -2
- package/dist/products/product-3.html +41 -2
- package/dist/products/product-4.html +41 -2
- package/lib/index.js +109 -112
- package/lib/templates/coralite-pagination.html +56 -89
- package/package.json +6 -6
- package/types/index.js +2 -2
- package/dist/visible/2.html +0 -98
package/dist/blog/all/index.html
CHANGED
|
@@ -16,21 +16,60 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
<a href>
|
|
19
|
+
<a href="/blog/post-1.html">
|
|
20
20
|
<h3>Great Barrier Reef</h3>
|
|
21
21
|
</a>
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
<span>Nemo</span>
|
|
25
|
-
<time datetime="2025-01-08T20:23:07.645Z">
|
|
25
|
+
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
26
26
|
Wed, 8 Jan 25
|
|
27
27
|
</time>
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
|
|
31
|
-
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item"><a class="page-link
|
|
31
|
+
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">Next</a></li></ul>
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
</section>
|
|
35
|
-
|
|
35
|
+
<script type="module">(async () => {
|
|
36
|
+
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
37
|
+
const elements = {};
|
|
38
|
+
return function(id) {
|
|
39
|
+
if (elements[id]) {
|
|
40
|
+
return elements[id];
|
|
41
|
+
}
|
|
42
|
+
const refId = refs[id];
|
|
43
|
+
if (!refId) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
47
|
+
if (element) {
|
|
48
|
+
elements[id] = element;
|
|
49
|
+
}
|
|
50
|
+
return element;
|
|
51
|
+
};
|
|
52
|
+
} };
|
|
53
|
+
const getHelpers = (context) => {
|
|
54
|
+
const helpers = {};
|
|
55
|
+
for (const key in coraliteTemplateScriptHelpers) {
|
|
56
|
+
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
57
|
+
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
58
|
+
}
|
|
59
|
+
return helpers;
|
|
60
|
+
};
|
|
61
|
+
const coraliteTemplateFunctions = {
|
|
62
|
+
"coralite-author": function script({ values }, { refs }) {
|
|
63
|
+
const timeElement = refs("time");
|
|
64
|
+
timeElement.setAttribute("data-was-here", values.datetime);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
;
|
|
68
|
+
(async () => {
|
|
69
|
+
const context = { "instanceId": "tests/fixtures/pages/blog/all/index.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
70
|
+
const helpers = getHelpers(context);
|
|
71
|
+
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
72
|
+
})();
|
|
73
|
+
})();
|
|
74
|
+
</script></body>
|
|
36
75
|
</html>
|
|
@@ -16,21 +16,60 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
<a href>
|
|
19
|
+
<a href="/blog/post-1.html">
|
|
20
20
|
<h3>Great Barrier Reef</h3>
|
|
21
21
|
</a>
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
<span>Nemo</span>
|
|
25
|
-
<time datetime="2025-01-08T20:23:07.645Z">
|
|
25
|
+
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
26
26
|
Wed, 8 Jan 25
|
|
27
27
|
</time>
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
|
|
31
|
-
<ul class="pagination"><li class="page-item"><
|
|
31
|
+
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">Next</a></li></ul>
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
</section>
|
|
35
|
-
|
|
35
|
+
<script type="module">(async () => {
|
|
36
|
+
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
37
|
+
const elements = {};
|
|
38
|
+
return function(id) {
|
|
39
|
+
if (elements[id]) {
|
|
40
|
+
return elements[id];
|
|
41
|
+
}
|
|
42
|
+
const refId = refs[id];
|
|
43
|
+
if (!refId) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
47
|
+
if (element) {
|
|
48
|
+
elements[id] = element;
|
|
49
|
+
}
|
|
50
|
+
return element;
|
|
51
|
+
};
|
|
52
|
+
} };
|
|
53
|
+
const getHelpers = (context) => {
|
|
54
|
+
const helpers = {};
|
|
55
|
+
for (const key in coraliteTemplateScriptHelpers) {
|
|
56
|
+
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
57
|
+
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
58
|
+
}
|
|
59
|
+
return helpers;
|
|
60
|
+
};
|
|
61
|
+
const coraliteTemplateFunctions = {
|
|
62
|
+
"coralite-author": function script({ values }, { refs }) {
|
|
63
|
+
const timeElement = refs("time");
|
|
64
|
+
timeElement.setAttribute("data-was-here", values.datetime);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
;
|
|
68
|
+
(async () => {
|
|
69
|
+
const context = { "instanceId": "tests/fixtures/pages/blog/all/page/2.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
70
|
+
const helpers = getHelpers(context);
|
|
71
|
+
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
72
|
+
})();
|
|
73
|
+
})();
|
|
74
|
+
</script></body>
|
|
36
75
|
</html>
|
|
@@ -16,21 +16,60 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
<a href>
|
|
20
|
-
<h3>
|
|
19
|
+
<a href="/blog/post-1.html">
|
|
20
|
+
<h3>Great Barrier Reef</h3>
|
|
21
21
|
</a>
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
<span>Nemo</span>
|
|
25
|
-
<time datetime="2025-01-
|
|
26
|
-
|
|
25
|
+
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
26
|
+
Wed, 8 Jan 25
|
|
27
27
|
</time>
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
|
|
31
|
-
<ul class="pagination"><li class="page-item"><
|
|
31
|
+
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">Next</a></li></ul>
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
</section>
|
|
35
|
-
|
|
35
|
+
<script type="module">(async () => {
|
|
36
|
+
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
37
|
+
const elements = {};
|
|
38
|
+
return function(id) {
|
|
39
|
+
if (elements[id]) {
|
|
40
|
+
return elements[id];
|
|
41
|
+
}
|
|
42
|
+
const refId = refs[id];
|
|
43
|
+
if (!refId) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
47
|
+
if (element) {
|
|
48
|
+
elements[id] = element;
|
|
49
|
+
}
|
|
50
|
+
return element;
|
|
51
|
+
};
|
|
52
|
+
} };
|
|
53
|
+
const getHelpers = (context) => {
|
|
54
|
+
const helpers = {};
|
|
55
|
+
for (const key in coraliteTemplateScriptHelpers) {
|
|
56
|
+
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
57
|
+
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
58
|
+
}
|
|
59
|
+
return helpers;
|
|
60
|
+
};
|
|
61
|
+
const coraliteTemplateFunctions = {
|
|
62
|
+
"coralite-author": function script({ values }, { refs }) {
|
|
63
|
+
const timeElement = refs("time");
|
|
64
|
+
timeElement.setAttribute("data-was-here", values.datetime);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
;
|
|
68
|
+
(async () => {
|
|
69
|
+
const context = { "instanceId": "tests/fixtures/pages/blog/all/page/3.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
70
|
+
const helpers = getHelpers(context);
|
|
71
|
+
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
72
|
+
})();
|
|
73
|
+
})();
|
|
74
|
+
</script></body>
|
|
36
75
|
</html>
|
|
@@ -16,21 +16,60 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
<a href>
|
|
20
|
-
<h3>
|
|
19
|
+
<a href="/blog/post-1.html">
|
|
20
|
+
<h3>Great Barrier Reef</h3>
|
|
21
21
|
</a>
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
<span>Nemo</span>
|
|
25
|
-
<time datetime="2025-01-
|
|
26
|
-
|
|
25
|
+
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
26
|
+
Wed, 8 Jan 25
|
|
27
27
|
</time>
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
|
|
31
|
-
<ul class="pagination"><li class="page-item"><
|
|
31
|
+
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">Next</a></li></ul>
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
</section>
|
|
35
|
-
|
|
35
|
+
<script type="module">(async () => {
|
|
36
|
+
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
37
|
+
const elements = {};
|
|
38
|
+
return function(id) {
|
|
39
|
+
if (elements[id]) {
|
|
40
|
+
return elements[id];
|
|
41
|
+
}
|
|
42
|
+
const refId = refs[id];
|
|
43
|
+
if (!refId) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
47
|
+
if (element) {
|
|
48
|
+
elements[id] = element;
|
|
49
|
+
}
|
|
50
|
+
return element;
|
|
51
|
+
};
|
|
52
|
+
} };
|
|
53
|
+
const getHelpers = (context) => {
|
|
54
|
+
const helpers = {};
|
|
55
|
+
for (const key in coraliteTemplateScriptHelpers) {
|
|
56
|
+
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
57
|
+
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
58
|
+
}
|
|
59
|
+
return helpers;
|
|
60
|
+
};
|
|
61
|
+
const coraliteTemplateFunctions = {
|
|
62
|
+
"coralite-author": function script({ values }, { refs }) {
|
|
63
|
+
const timeElement = refs("time");
|
|
64
|
+
timeElement.setAttribute("data-was-here", values.datetime);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
;
|
|
68
|
+
(async () => {
|
|
69
|
+
const context = { "instanceId": "tests/fixtures/pages/blog/all/page/4.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
70
|
+
const helpers = getHelpers(context);
|
|
71
|
+
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
72
|
+
})();
|
|
73
|
+
})();
|
|
74
|
+
</script></body>
|
|
36
75
|
</html>
|
|
@@ -16,21 +16,60 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
<a href>
|
|
20
|
-
<h3>
|
|
19
|
+
<a href="/blog/post-1.html">
|
|
20
|
+
<h3>Great Barrier Reef</h3>
|
|
21
21
|
</a>
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
<span>Nemo</span>
|
|
25
|
-
<time datetime="2025-01-
|
|
26
|
-
|
|
25
|
+
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
26
|
+
Wed, 8 Jan 25
|
|
27
27
|
</time>
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
|
|
31
|
-
<ul class="pagination"><li class="page-item"><
|
|
31
|
+
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/blog/all/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/all/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/all/page/2.html">Next</a></li></ul>
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
</section>
|
|
35
|
-
|
|
35
|
+
<script type="module">(async () => {
|
|
36
|
+
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
37
|
+
const elements = {};
|
|
38
|
+
return function(id) {
|
|
39
|
+
if (elements[id]) {
|
|
40
|
+
return elements[id];
|
|
41
|
+
}
|
|
42
|
+
const refId = refs[id];
|
|
43
|
+
if (!refId) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
47
|
+
if (element) {
|
|
48
|
+
elements[id] = element;
|
|
49
|
+
}
|
|
50
|
+
return element;
|
|
51
|
+
};
|
|
52
|
+
} };
|
|
53
|
+
const getHelpers = (context) => {
|
|
54
|
+
const helpers = {};
|
|
55
|
+
for (const key in coraliteTemplateScriptHelpers) {
|
|
56
|
+
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
57
|
+
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
58
|
+
}
|
|
59
|
+
return helpers;
|
|
60
|
+
};
|
|
61
|
+
const coraliteTemplateFunctions = {
|
|
62
|
+
"coralite-author": function script({ values }, { refs }) {
|
|
63
|
+
const timeElement = refs("time");
|
|
64
|
+
timeElement.setAttribute("data-was-here", values.datetime);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
;
|
|
68
|
+
(async () => {
|
|
69
|
+
const context = { "instanceId": "tests/fixtures/pages/blog/all/page/5.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
70
|
+
const helpers = getHelpers(context);
|
|
71
|
+
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
72
|
+
})();
|
|
73
|
+
})();
|
|
74
|
+
</script></body>
|
|
36
75
|
</html>
|
package/dist/blog/index.html
CHANGED
|
@@ -16,21 +16,60 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
<a href>
|
|
19
|
+
<a href="/blog/post-1.html">
|
|
20
20
|
<h3>Great Barrier Reef</h3>
|
|
21
21
|
</a>
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
<span>Nemo</span>
|
|
25
|
-
<time datetime="2025-01-08T20:23:07.645Z">
|
|
25
|
+
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
26
26
|
Wed, 8 Jan 25
|
|
27
27
|
</time>
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
|
|
31
|
-
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item"><a class="page-link
|
|
31
|
+
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/blog/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">Next</a></li></ul>
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
</section>
|
|
35
|
-
|
|
35
|
+
<script type="module">(async () => {
|
|
36
|
+
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
37
|
+
const elements = {};
|
|
38
|
+
return function(id) {
|
|
39
|
+
if (elements[id]) {
|
|
40
|
+
return elements[id];
|
|
41
|
+
}
|
|
42
|
+
const refId = refs[id];
|
|
43
|
+
if (!refId) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
47
|
+
if (element) {
|
|
48
|
+
elements[id] = element;
|
|
49
|
+
}
|
|
50
|
+
return element;
|
|
51
|
+
};
|
|
52
|
+
} };
|
|
53
|
+
const getHelpers = (context) => {
|
|
54
|
+
const helpers = {};
|
|
55
|
+
for (const key in coraliteTemplateScriptHelpers) {
|
|
56
|
+
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
57
|
+
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
58
|
+
}
|
|
59
|
+
return helpers;
|
|
60
|
+
};
|
|
61
|
+
const coraliteTemplateFunctions = {
|
|
62
|
+
"coralite-author": function script({ values }, { refs }) {
|
|
63
|
+
const timeElement = refs("time");
|
|
64
|
+
timeElement.setAttribute("data-was-here", values.datetime);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
;
|
|
68
|
+
(async () => {
|
|
69
|
+
const context = { "instanceId": "tests/fixtures/pages/blog/index.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
70
|
+
const helpers = getHelpers(context);
|
|
71
|
+
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
72
|
+
})();
|
|
73
|
+
})();
|
|
74
|
+
</script></body>
|
|
36
75
|
</html>
|
package/dist/blog/page/2.html
CHANGED
|
@@ -16,21 +16,60 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
<a href>
|
|
19
|
+
<a href="/blog/post-1.html">
|
|
20
20
|
<h3>Great Barrier Reef</h3>
|
|
21
21
|
</a>
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
<span>Nemo</span>
|
|
25
|
-
<time datetime="2025-01-08T20:23:07.645Z">
|
|
25
|
+
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
26
26
|
Wed, 8 Jan 25
|
|
27
27
|
</time>
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
|
|
31
|
-
<ul class="pagination"><li class="page-item"><
|
|
31
|
+
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/blog/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">Next</a></li></ul>
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
</section>
|
|
35
|
-
|
|
35
|
+
<script type="module">(async () => {
|
|
36
|
+
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
37
|
+
const elements = {};
|
|
38
|
+
return function(id) {
|
|
39
|
+
if (elements[id]) {
|
|
40
|
+
return elements[id];
|
|
41
|
+
}
|
|
42
|
+
const refId = refs[id];
|
|
43
|
+
if (!refId) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
47
|
+
if (element) {
|
|
48
|
+
elements[id] = element;
|
|
49
|
+
}
|
|
50
|
+
return element;
|
|
51
|
+
};
|
|
52
|
+
} };
|
|
53
|
+
const getHelpers = (context) => {
|
|
54
|
+
const helpers = {};
|
|
55
|
+
for (const key in coraliteTemplateScriptHelpers) {
|
|
56
|
+
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
57
|
+
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
58
|
+
}
|
|
59
|
+
return helpers;
|
|
60
|
+
};
|
|
61
|
+
const coraliteTemplateFunctions = {
|
|
62
|
+
"coralite-author": function script({ values }, { refs }) {
|
|
63
|
+
const timeElement = refs("time");
|
|
64
|
+
timeElement.setAttribute("data-was-here", values.datetime);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
;
|
|
68
|
+
(async () => {
|
|
69
|
+
const context = { "instanceId": "tests/fixtures/pages/blog/page/2.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
70
|
+
const helpers = getHelpers(context);
|
|
71
|
+
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
72
|
+
})();
|
|
73
|
+
})();
|
|
74
|
+
</script></body>
|
|
36
75
|
</html>
|
package/dist/blog/page/3.html
CHANGED
|
@@ -16,21 +16,60 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
<a href>
|
|
20
|
-
<h3>
|
|
19
|
+
<a href="/blog/post-1.html">
|
|
20
|
+
<h3>Great Barrier Reef</h3>
|
|
21
21
|
</a>
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
<span>Nemo</span>
|
|
25
|
-
<time datetime="2025-01-
|
|
26
|
-
|
|
25
|
+
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
26
|
+
Wed, 8 Jan 25
|
|
27
27
|
</time>
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
|
|
31
|
-
<ul class="pagination"><li class="page-item"><
|
|
31
|
+
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/blog/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">Next</a></li></ul>
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
</section>
|
|
35
|
-
|
|
35
|
+
<script type="module">(async () => {
|
|
36
|
+
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
37
|
+
const elements = {};
|
|
38
|
+
return function(id) {
|
|
39
|
+
if (elements[id]) {
|
|
40
|
+
return elements[id];
|
|
41
|
+
}
|
|
42
|
+
const refId = refs[id];
|
|
43
|
+
if (!refId) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
47
|
+
if (element) {
|
|
48
|
+
elements[id] = element;
|
|
49
|
+
}
|
|
50
|
+
return element;
|
|
51
|
+
};
|
|
52
|
+
} };
|
|
53
|
+
const getHelpers = (context) => {
|
|
54
|
+
const helpers = {};
|
|
55
|
+
for (const key in coraliteTemplateScriptHelpers) {
|
|
56
|
+
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
57
|
+
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
58
|
+
}
|
|
59
|
+
return helpers;
|
|
60
|
+
};
|
|
61
|
+
const coraliteTemplateFunctions = {
|
|
62
|
+
"coralite-author": function script({ values }, { refs }) {
|
|
63
|
+
const timeElement = refs("time");
|
|
64
|
+
timeElement.setAttribute("data-was-here", values.datetime);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
;
|
|
68
|
+
(async () => {
|
|
69
|
+
const context = { "instanceId": "tests/fixtures/pages/blog/page/3.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
70
|
+
const helpers = getHelpers(context);
|
|
71
|
+
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
72
|
+
})();
|
|
73
|
+
})();
|
|
74
|
+
</script></body>
|
|
36
75
|
</html>
|
package/dist/blog/page/4.html
CHANGED
|
@@ -16,21 +16,60 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
<a href>
|
|
20
|
-
<h3>
|
|
19
|
+
<a href="/blog/post-1.html">
|
|
20
|
+
<h3>Great Barrier Reef</h3>
|
|
21
21
|
</a>
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
<span>Nemo</span>
|
|
25
|
-
<time datetime="2025-01-
|
|
26
|
-
|
|
25
|
+
<time datetime="2025-01-08T20:23:07.645Z" data-coralite-ref="coralite-author__time-0">
|
|
26
|
+
Wed, 8 Jan 25
|
|
27
27
|
</time>
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
|
|
31
|
-
<ul class="pagination"><li class="page-item"><
|
|
31
|
+
<ul class="pagination"><li class="page-item disabled"><span class="page-link">Previous</span></li><li class="page-item active"><a class="page-link" aria-current="page" href="/blog/index.html">1</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">2</a></li><li class="page-item"><a class="page-link" href="/blog/page/3.html">3</a></li><li class="page-item disabled"><span class="page-link">...</span></li><li class="page-item"><a class="page-link" href="/blog/page/5.html">5</a></li><li class="page-item"><a class="page-link" href="/blog/page/2.html">Next</a></li></ul>
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
</section>
|
|
35
|
-
|
|
35
|
+
<script type="module">(async () => {
|
|
36
|
+
const coraliteTemplateScriptHelpers = { "refs": function refs({ refs }) {
|
|
37
|
+
const elements = {};
|
|
38
|
+
return function(id) {
|
|
39
|
+
if (elements[id]) {
|
|
40
|
+
return elements[id];
|
|
41
|
+
}
|
|
42
|
+
const refId = refs[id];
|
|
43
|
+
if (!refId) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const element = document.querySelector('[data-coralite-ref="' + refId + '"]');
|
|
47
|
+
if (element) {
|
|
48
|
+
elements[id] = element;
|
|
49
|
+
}
|
|
50
|
+
return element;
|
|
51
|
+
};
|
|
52
|
+
} };
|
|
53
|
+
const getHelpers = (context) => {
|
|
54
|
+
const helpers = {};
|
|
55
|
+
for (const key in coraliteTemplateScriptHelpers) {
|
|
56
|
+
if (!Object.hasOwn(coraliteTemplateScriptHelpers, key)) continue;
|
|
57
|
+
helpers[key] = coraliteTemplateScriptHelpers[key](context);
|
|
58
|
+
}
|
|
59
|
+
return helpers;
|
|
60
|
+
};
|
|
61
|
+
const coraliteTemplateFunctions = {
|
|
62
|
+
"coralite-author": function script({ values }, { refs }) {
|
|
63
|
+
const timeElement = refs("time");
|
|
64
|
+
timeElement.setAttribute("data-was-here", values.datetime);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
;
|
|
68
|
+
(async () => {
|
|
69
|
+
const context = { "instanceId": "tests/fixtures/pages/blog/page/4.html0coralite-posts0coralite-post0coralite-author", "templateId": "coralite-author", "refs": { "time": "coralite-author__time-0" }, "values": { "datetime": "2025-01-08T20:23:07.645Z" }, "document": {} };
|
|
70
|
+
const helpers = getHelpers(context);
|
|
71
|
+
await coraliteTemplateFunctions["coralite-author"](context, helpers);
|
|
72
|
+
})();
|
|
73
|
+
})();
|
|
74
|
+
</script></body>
|
|
36
75
|
</html>
|