Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions src/_includes/layouts/integration.njk
Original file line number Diff line number Diff line change
Expand Up @@ -265,21 +265,22 @@ layout: layouts/base.njk
</div>

{% if hasExamples %}
{% for example in integration.examples %}
{% if example.flow %}
<script type="application/json" id="flow-data-{{ loop.index0 }}">{{ example.flow | safe }}</script>
{% endif %}
{% endfor %}

<!-- Flow Renderer Script -->
<script type="module">
import FlowRenderer from '/js/flowrenderer.min.js';

// Store flow data
const flowData = [
{% for example in integration.examples %}
{% if example.flow %}
{
index: {{ loop.index0 }},
flow: {{ example.flow | safe }}
}{% if not loop.last %},{% endif %}
{% endif %}
{% endfor %}
];
const flowData = [];
document.querySelectorAll('script[id^="flow-data-"]').forEach(el => {
const index = parseInt(el.id.replace('flow-data-', ''), 10);
flowData.push({ index, flow: JSON.parse(el.textContent) });
});

// Add event listeners to tab buttons
document.querySelectorAll('.tab-button').forEach(button => {
Expand Down
Loading