diff --git a/modules/rflows/components/flows.css b/modules/rflows/components/flows.css index a6b3bc0..8468809 100644 --- a/modules/rflows/components/flows.css +++ b/modules/rflows/components/flows.css @@ -576,6 +576,30 @@ .source-type-btn:hover { border-color: var(--rs-bg-surface-raised); background: var(--rs-bg-surface); } .source-type-btn--active { border-color: #10b981; background: var(--rflows-source-hover-bg, #064e3b); color: var(--rflows-source-text, #6ee7b7); } +/* Pay-by button grid (ICP - compact) */ +.icp-pay-by { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 4px; } +.icp-pay-btn { + display: flex; align-items: center; justify-content: center; gap: 4px; + padding: 6px 4px; border-radius: 6px; border: 1.5px solid var(--rs-border-strong); + background: var(--rs-bg-page); color: var(--rs-text-secondary); cursor: pointer; + transition: all 0.15s; font-size: 10px; font-weight: 500; + font-family: system-ui, -apple-system, sans-serif; +} +.icp-pay-btn:hover { border-color: var(--rs-bg-surface-raised); background: var(--rs-bg-surface); } +.icp-pay-btn--active { border-color: #10b981; background: var(--rflows-source-hover-bg, #064e3b); color: var(--rflows-source-text, #6ee7b7); } + +/* Pay-by button grid (editor panel - larger) */ +.editor-pay-by { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; } +.editor-pay-btn { + display: flex; flex-direction: column; align-items: center; gap: 4px; + padding: 10px 6px; border-radius: 8px; border: 2px solid var(--rs-border-strong); + background: var(--rs-bg-page); color: var(--rs-text-secondary); cursor: pointer; + transition: all 0.15s; font-size: 11px; font-weight: 500; + font-family: system-ui, -apple-system, sans-serif; +} +.editor-pay-btn:hover { border-color: var(--rs-bg-surface-raised); background: var(--rs-bg-surface); } +.editor-pay-btn--active { border-color: #10b981; background: var(--rflows-source-hover-bg, #064e3b); color: var(--rflows-source-text, #6ee7b7); } + /* Node hover tooltip */ .flows-node-tooltip { position: absolute; z-index: 30; pointer-events: none; diff --git a/modules/rflows/components/folk-flows-app.ts b/modules/rflows/components/folk-flows-app.ts index 098668e..5be02ee 100644 --- a/modules/rflows/components/folk-flows-app.ts +++ b/modules/rflows/components/folk-flows-app.ts @@ -1343,6 +1343,13 @@ class FolkFlowsApp extends HTMLElement { this.selectedEdgeKey = null; this.updateSelectionHighlight(); + // If click originated from HTML inside foreignObject, open inline edit but skip drag + const target = e.target as Element; + if (target instanceof HTMLElement && target.closest("foreignObject")) { + this.enterInlineEdit(nodeId); + return; + } + // Prepare drag (but don't start until threshold exceeded) nodeDragStarted = false; this.draggingNodeId = nodeId; @@ -2769,10 +2776,12 @@ class FolkFlowsApp extends HTMLElement {
-
-
`; +
+
+ + + +
`; if (d.sourceType === "card") { html += ``; } @@ -3124,6 +3133,19 @@ class FolkFlowsApp extends HTMLElement { }); }); + // Pay-by buttons (source nodes) + overlay.querySelectorAll("[data-icp-source-type]").forEach((btn) => { + btn.addEventListener("click", (e: Event) => { + e.stopPropagation(); + (node.data as SourceNodeData).sourceType = (btn as HTMLElement).dataset.icpSourceType as any; + const body = overlay.querySelector(".icp-body") as HTMLElement; + if (body) body.innerHTML = this.renderInlineConfigContent(node); + this.attachInlineConfigFieldListeners(overlay, node); + this.redrawNodeOnly(node); + this.redrawEdges(); + }); + }); + // Range sliders overlay.querySelectorAll("[data-icp-range]").forEach((el) => { const input = el as HTMLInputElement; @@ -3326,10 +3348,12 @@ class FolkFlowsApp extends HTMLElement {
-
-
`; +
+
+ + + +
`; if (d.sourceType === "card") { html += `
-
Source Type
+
Pay by
${["card", "safe_wallet", "ridentity"].map((t) => `