@nyaruka/temba-components 0.137.0 → 0.138.4
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/.devcontainer/Dockerfile +0 -9
- package/.devcontainer/devcontainer.json +8 -3
- package/.github/workflows/build.yml +6 -1
- package/.github/workflows/cla.yml +1 -1
- package/.github/workflows/publish.yml +6 -1
- package/CHANGELOG.md +42 -0
- package/dist/locales/es.js +5 -5
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/fr.js +5 -5
- package/dist/locales/fr.js.map +1 -1
- package/dist/locales/locale-codes.js +11 -2
- package/dist/locales/locale-codes.js.map +1 -1
- package/dist/locales/pt.js +5 -5
- package/dist/locales/pt.js.map +1 -1
- package/dist/temba-components.js +445 -278
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/display/FloatingTab.js +16 -8
- package/out-tsc/src/display/FloatingTab.js.map +1 -1
- package/out-tsc/src/flow/CanvasMenu.js +33 -15
- package/out-tsc/src/flow/CanvasMenu.js.map +1 -1
- package/out-tsc/src/flow/CanvasNode.js +49 -24
- package/out-tsc/src/flow/CanvasNode.js.map +1 -1
- package/out-tsc/src/flow/Editor.js +583 -70
- package/out-tsc/src/flow/Editor.js.map +1 -1
- package/out-tsc/src/flow/NodeTypeSelector.js +13 -11
- package/out-tsc/src/flow/NodeTypeSelector.js.map +1 -1
- package/out-tsc/src/flow/Plumber.js +110 -64
- package/out-tsc/src/flow/Plumber.js.map +1 -1
- package/out-tsc/src/flow/actions/set_contact_field.js +5 -1
- package/out-tsc/src/flow/actions/set_contact_field.js.map +1 -1
- package/out-tsc/src/list/RunList.js +2 -1
- package/out-tsc/src/list/RunList.js.map +1 -1
- package/out-tsc/src/list/TicketList.js +2 -1
- package/out-tsc/src/list/TicketList.js.map +1 -1
- package/out-tsc/src/locales/es.js +5 -5
- package/out-tsc/src/locales/es.js.map +1 -1
- package/out-tsc/src/locales/fr.js +5 -5
- package/out-tsc/src/locales/fr.js.map +1 -1
- package/out-tsc/src/locales/locale-codes.js +11 -2
- package/out-tsc/src/locales/locale-codes.js.map +1 -1
- package/out-tsc/src/locales/pt.js +5 -5
- package/out-tsc/src/locales/pt.js.map +1 -1
- package/out-tsc/src/simulator/Simulator.js +11 -4
- package/out-tsc/src/simulator/Simulator.js.map +1 -1
- package/out-tsc/src/store/AppState.js +17 -2
- package/out-tsc/src/store/AppState.js.map +1 -1
- package/out-tsc/test/temba-contact-fields.test.js +3 -3
- package/out-tsc/test/temba-contact-fields.test.js.map +1 -1
- package/out-tsc/test/temba-flow-editor-node.test.js +3 -1
- package/out-tsc/test/temba-flow-editor-node.test.js.map +1 -1
- package/out-tsc/test/temba-flow-editor-revisions.test.js +106 -0
- package/out-tsc/test/temba-flow-editor-revisions.test.js.map +1 -0
- package/out-tsc/test/temba-flow-editor.test.js +14 -10
- package/out-tsc/test/temba-flow-editor.test.js.map +1 -1
- package/out-tsc/test/temba-flow-plumber-connections.test.js +7 -1
- package/out-tsc/test/temba-flow-plumber-connections.test.js.map +1 -1
- package/out-tsc/test/temba-flow-plumber.test.js +6 -0
- package/out-tsc/test/temba-flow-plumber.test.js.map +1 -1
- package/out-tsc/test/temba-select.test.js +1 -0
- package/out-tsc/test/temba-select.test.js.map +1 -1
- package/package.json +1 -1
- package/screenshots/truth/floating-tab/gray.png +0 -0
- package/screenshots/truth/floating-tab/green.png +0 -0
- package/screenshots/truth/floating-tab/purple.png +0 -0
- package/screenshots/truth/node-type-selector/action-mode.png +0 -0
- package/screenshots/truth/node-type-selector/split-mode.png +0 -0
- package/src/display/FloatingTab.ts +18 -8
- package/src/flow/CanvasMenu.ts +38 -16
- package/src/flow/CanvasNode.ts +62 -29
- package/src/flow/Editor.ts +699 -74
- package/src/flow/NodeTypeSelector.ts +13 -11
- package/src/flow/Plumber.ts +123 -69
- package/src/flow/actions/set_contact_field.ts +5 -1
- package/src/list/RunList.ts +2 -1
- package/src/list/TicketList.ts +2 -1
- package/src/locales/es.ts +18 -13
- package/src/locales/fr.ts +18 -13
- package/src/locales/locale-codes.ts +11 -2
- package/src/locales/pt.ts +18 -13
- package/src/simulator/Simulator.ts +11 -5
- package/src/store/AppState.ts +18 -2
- package/test/temba-contact-fields.test.ts +8 -3
- package/test/temba-flow-editor-node.test.ts +3 -1
- package/test/temba-flow-editor-revisions.test.ts +134 -0
- package/test/temba-flow-editor.test.ts +16 -10
- package/test/temba-flow-plumber-connections.test.ts +7 -1
- package/test/temba-flow-plumber.test.ts +6 -0
- package/test/temba-select.test.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plumber.js","sourceRoot":"","sources":["../../../src/flow/Plumber.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,KAAK,EACL,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,kBAAkB,CAAC,IAAI;IAC7B,OAAO,EAAE;QACP,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QACd,QAAQ,EAAE,GAAG;QACb,kBAAkB,EAAE,IAAI;QACxB,YAAY,EAAE,CAAC;QACf,QAAQ,EAAE,iBAAiB;KAC5B;CACF,CAAC;AAEF,MAAM,iBAAiB,GAAG;IACxB;QACE,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE;YACP,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,aAAa;SACxB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,QAAQ,EAAE;QACR,IAAI,EAAE,WAAW,CAAC,IAAI;QACtB,OAAO,EAAE;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AI,CAAC,WAAW;YAAE,OAAO,KAAK,CAAC;QAE/B,qCAAqC;QACrC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;QAEzE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QAE3C,sCAAsC;QACtC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YACjC,IAAI,UAAU,EAAE,CAAC;gBACf,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YAClC,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YACrC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["import {\n DotEndpoint,\n FlowchartConnector,\n newInstance,\n ready,\n RectangleEndpoint,\n EVENT_CONNECTION_DRAG,\n EVENT_CONNECTION_ABORT,\n INTERCEPT_BEFORE_DROP,\n EVENT_CONNECTION,\n EVENT_REVERT,\n INTERCEPT_BEFORE_DETACH,\n EVENT_CONNECTION_DETACHED\n} from '@jsplumb/browser-ui';\nimport { getStore } from '../store/Store';\n\nconst CONNECTOR_DEFAULTS = {\n type: FlowchartConnector.type,\n options: {\n stub: [20, 10],\n midpoint: 0.5,\n alwaysRespectStubs: true,\n cornerRadius: 5,\n cssClass: 'plumb-connector'\n }\n};\n\nconst OVERLAYS_DEFAULTS = [\n {\n type: 'PlainArrow',\n options: {\n width: 13,\n length: 13,\n location: 0.999,\n cssClass: 'plumb-arrow'\n }\n }\n];\n\nexport const SOURCE_DEFAULTS = {\n endpoint: {\n type: DotEndpoint.type,\n options: {\n radius: 12,\n cssClass: 'plumb-source',\n hoverClass: 'plumb-source-hover'\n }\n },\n anchors: ['Bottom', 'Continuous'],\n maxConnections: 1,\n source: true,\n dragAllowedWhenFull: false\n};\n\nexport const TARGET_DEFAULTS = {\n endpoint: {\n type: RectangleEndpoint.type,\n options: {\n width: 23,\n height: 23,\n cssClass: 'plumb-target',\n hoverClass: 'plumb-target-hover'\n }\n },\n anchor: {\n type: 'Continuous',\n options: {\n faces: ['top', 'left', 'right'],\n cssClass: 'continuos plumb-target-anchor'\n }\n },\n deleteOnEmpty: true,\n maxConnections: 1,\n target: true\n};\n\nexport class Plumber {\n private jsPlumb = null;\n private pendingConnections = [];\n private connectionListeners = new Map();\n public connectionDragging = false;\n private connectionWait = null;\n private activityData: { segments: { [key: string]: number } } | null = null;\n private hoveredActivityKey: string | null = null;\n private recentContactsPopup: HTMLElement | null = null;\n private recentContactsCache: { [key: string]: any[] } = {};\n private pendingFetches: { [key: string]: AbortController } = {};\n private hideContactsTimeout: number | null = null;\n private showContactsTimeout: number | null = null;\n private editor: any;\n\n constructor(canvas: HTMLElement, editor: any) {\n this.editor = editor;\n ready(() => {\n this.jsPlumb = newInstance({\n container: canvas,\n connectionsDetachable: true,\n endpointStyle: {\n fill: 'green'\n },\n connector: CONNECTOR_DEFAULTS,\n connectionOverlays: OVERLAYS_DEFAULTS\n });\n\n // Bind to connection events\n this.jsPlumb.bind(EVENT_CONNECTION, (info) => {\n this.connectionDragging = false;\n this.notifyListeners(EVENT_CONNECTION, info);\n });\n\n // Bind to connection drag events\n this.jsPlumb.bind(EVENT_CONNECTION_DRAG, (info) => {\n this.connectionDragging = true;\n this.notifyListeners(EVENT_CONNECTION_DRAG, info);\n });\n\n this.jsPlumb.bind(EVENT_CONNECTION_ABORT, (info) => {\n this.connectionDragging = false;\n this.notifyListeners(EVENT_CONNECTION_ABORT, info);\n });\n\n this.jsPlumb.bind(EVENT_CONNECTION_DETACHED, (info) => {\n this.connectionDragging = false;\n this.notifyListeners(EVENT_CONNECTION_DETACHED, info);\n });\n\n this.jsPlumb.bind(EVENT_REVERT, (info) => {\n this.notifyListeners(EVENT_REVERT, info);\n });\n\n this.jsPlumb.bind(INTERCEPT_BEFORE_DROP, () => {\n // we always deny automatic connections\n return false;\n });\n this.jsPlumb.bind(INTERCEPT_BEFORE_DETACH, () => {});\n });\n }\n\n private notifyListeners(eventName: string, info: any) {\n const listeners = this.connectionListeners.get(eventName) || [];\n listeners.forEach((listener) => listener(info));\n }\n\n public on(eventName: string, callback: (info: any) => void) {\n if (!this.connectionListeners.has(eventName)) {\n this.connectionListeners.set(eventName, []);\n }\n this.connectionListeners.get(eventName).push(callback);\n }\n\n public off(eventName: string, callback: (info: any) => void) {\n if (!this.connectionListeners.has(eventName)) return;\n const listeners = this.connectionListeners.get(eventName);\n const index = listeners.indexOf(callback);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n }\n\n public makeTarget(uuid: string) {\n const element = document.getElementById(uuid);\n this.jsPlumb.addEndpoint(element, TARGET_DEFAULTS);\n }\n\n public makeSource(uuid: string) {\n const element = document.getElementById(uuid);\n this.jsPlumb.addEndpoint(element, SOURCE_DEFAULTS);\n }\n\n // we'll process our pending connections, but we want to debounce this\n public processPendingConnections() {\n // if we have a pending connection wait, clear it\n if (this.connectionWait) {\n clearTimeout(this.connectionWait);\n this.connectionWait = null;\n }\n\n // debounce the connection processing\n this.connectionWait = setTimeout(() => {\n this.jsPlumb.batch(() => {\n this.pendingConnections.forEach((connection) => {\n const { scope, fromId, toId } = connection;\n const fromElement = document.getElementById(fromId);\n const toElement = document.getElementById(toId);\n\n // delete any existing endpoints\n this.jsPlumb.selectEndpoints({ source: fromId }).deleteAll();\n\n const source = this.jsPlumb.addEndpoint(fromElement, {\n ...SOURCE_DEFAULTS,\n endpoint: {\n ...SOURCE_DEFAULTS.endpoint,\n options: {\n ...SOURCE_DEFAULTS.endpoint.options,\n cssClass: 'plumb-source connected'\n }\n }\n });\n\n const target = this.jsPlumb.addEndpoint(toElement, TARGET_DEFAULTS);\n this.jsPlumb.connect({\n source,\n target,\n connector: {\n ...CONNECTOR_DEFAULTS,\n options: { ...CONNECTOR_DEFAULTS.options, gap: [0, 5] }\n },\n data: {\n nodeId: scope\n }\n });\n });\n this.pendingConnections = [];\n });\n }, 50);\n }\n\n public connectIds(scope: string, fromId: string, toId: string) {\n this.pendingConnections.push({ scope, fromId, toId });\n this.processPendingConnections();\n }\n\n public setActivityData(\n activityData: { segments: { [key: string]: number } } | null\n ) {\n this.activityData = activityData;\n // Clear recent contacts cache when activity data changes\n this.clearRecentContactsCache();\n this.updateActivityOverlays();\n }\n\n private updateActivityOverlays() {\n if (!this.jsPlumb || !this.activityData) {\n return;\n }\n\n // Get all connections\n const connections = this.jsPlumb.getConnections();\n\n connections.forEach((connection: any) => {\n // Get the source exit element\n const sourceElement = connection.source;\n if (!sourceElement) {\n return;\n }\n\n // Get destination node\n const targetElement = connection.target;\n if (!targetElement) {\n return;\n }\n\n // Create activity key: exitUuid:destinationUuid\n const exitUuid = sourceElement.id;\n const destinationUuid = targetElement.id;\n const activityKey = `${exitUuid}:${destinationUuid}`;\n\n // Get activity count for this segment\n const count = this.activityData.segments[activityKey];\n\n // Remove existing activity overlays\n connection.removeOverlay('activity-label');\n\n // Add new overlay if there's activity\n if (count && count > 0) {\n const overlay = connection.addOverlay({\n type: 'Label',\n options: {\n label: count.toLocaleString(),\n id: 'activity-label',\n cssClass: 'activity-overlay',\n location: 20 // Fixed pixel distance from the start (exit point)\n }\n });\n\n // Add hover events for recent contacts popup\n // Use setTimeout to ensure the overlay is fully rendered\n setTimeout(() => {\n // Try multiple ways to get the overlay element\n let overlayElement =\n overlay.canvas || overlay.element || overlay.getElement?.();\n\n // If still not found, query the DOM directly\n if (!overlayElement) {\n const overlays = connection.getOverlays();\n if (Array.isArray(overlays)) {\n for (const ovl of overlays) {\n if (ovl.id === 'activity-label') {\n overlayElement =\n ovl.canvas || ovl.element || ovl.getElement?.();\n break;\n }\n }\n }\n }\n\n // Also try querying by CSS class\n if (!overlayElement && connection.canvas) {\n overlayElement =\n connection.canvas.querySelector('.activity-overlay');\n }\n\n if (overlayElement) {\n overlayElement.style.cursor = 'pointer';\n overlayElement.setAttribute('data-activity-key', activityKey);\n overlayElement.addEventListener('mouseenter', () => {\n // Don't show recent contacts when simulator is active\n const store = getStore();\n if (store?.getState().simulatorActive) {\n return;\n }\n\n // Get flow UUID from the editor element\n const editor = document.querySelector('temba-flow-editor') as any;\n const flowUuid = editor?.definition?.uuid;\n if (flowUuid) {\n // Start fetching immediately\n this.fetchRecentContacts(activityKey, flowUuid);\n\n // But delay showing the popup by half a second\n this.showContactsTimeout = window.setTimeout(() => {\n this.showRecentContacts(activityKey, flowUuid);\n }, 500);\n }\n });\n overlayElement.addEventListener('mouseleave', () => {\n // Cancel the show timeout if still pending\n if (this.showContactsTimeout) {\n clearTimeout(this.showContactsTimeout);\n this.showContactsTimeout = null;\n }\n this.hoveredActivityKey = null;\n this.hideRecentContacts();\n });\n }\n }, 50);\n }\n });\n\n // Force repaint to ensure overlays are positioned correctly\n this.repaintEverything();\n }\n\n private findOverlayElement(activityKey: string): HTMLElement | null {\n // Find overlay by data attribute\n const overlays = document.querySelectorAll('.activity-overlay');\n for (const overlay of overlays) {\n if (overlay.getAttribute('data-activity-key') === activityKey) {\n return overlay as HTMLElement;\n }\n }\n return null;\n }\n\n private async fetchRecentContacts(activityKey: string, flowUuid: string) {\n // Skip if already cached or currently fetching\n if (\n this.recentContactsCache[activityKey] ||\n this.pendingFetches[activityKey]\n ) {\n return;\n }\n\n // Cancel any pending fetch for this key\n if (this.pendingFetches[activityKey]) {\n this.pendingFetches[activityKey].abort();\n }\n\n // Fetch recent contacts from endpoint\n const controller = new AbortController();\n this.pendingFetches[activityKey] = controller;\n\n try {\n // Parse exit UUID and destination UUID from activity key\n const [exitUuid, destinationUuid] = activityKey.split(':');\n\n const endpoint = `/flow/recent_contacts/${flowUuid}/${exitUuid}/${destinationUuid}/`;\n\n const response = await fetch(endpoint, {\n signal: controller.signal\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n const data = await response.json();\n // API returns array directly, not wrapped in results\n const recentContacts = Array.isArray(data) ? data : data.results || [];\n\n // Cache the results\n this.recentContactsCache[activityKey] = recentContacts;\n } catch (error) {\n if ((error as Error).name !== 'AbortError') {\n console.error('Failed to fetch recent contacts:', error);\n }\n } finally {\n delete this.pendingFetches[activityKey];\n }\n }\n\n private async showRecentContacts(activityKey: string, flowUuid: string) {\n // Don't show recent contacts when simulator is active\n const store = getStore();\n if (store?.getState().simulatorActive) {\n return;\n }\n\n // Find the overlay element fresh to avoid stale references\n const overlayElement = this.findOverlayElement(activityKey);\n if (!overlayElement) {\n console.warn('Could not find overlay element for activity:', activityKey);\n return;\n }\n // Clear any pending hide timeout\n if (this.hideContactsTimeout) {\n clearTimeout(this.hideContactsTimeout);\n this.hideContactsTimeout = null;\n }\n\n this.hoveredActivityKey = activityKey;\n\n // Create popup if it doesn't exist\n if (!this.recentContactsPopup) {\n this.recentContactsPopup = document.createElement('div');\n this.recentContactsPopup.className = 'recent-contacts-popup';\n // Add inline styles to ensure visibility\n this.recentContactsPopup.style.position = 'absolute';\n this.recentContactsPopup.style.width = '200px';\n this.recentContactsPopup.style.background = '#f3f3f3';\n this.recentContactsPopup.style.borderRadius = '10px';\n this.recentContactsPopup.style.boxShadow =\n '0 1px 3px 1px rgba(130, 130, 130, 0.2)';\n this.recentContactsPopup.style.zIndex = '1015';\n this.recentContactsPopup.style.display = 'none';\n document.body.appendChild(this.recentContactsPopup);\n }\n\n // Add hover events to keep popup open (only needs to be done once)\n if (!this.recentContactsPopup.onmouseenter) {\n this.recentContactsPopup.onmouseenter = () => {\n if (this.hideContactsTimeout) {\n clearTimeout(this.hideContactsTimeout);\n this.hideContactsTimeout = null;\n }\n };\n this.recentContactsPopup.onmouseleave = () => {\n this.hoveredActivityKey = null;\n this.hideRecentContacts();\n };\n\n // Add click event listener for contact names\n this.recentContactsPopup.onclick = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n\n if (target.classList.contains('contact-name')) {\n this.hideRecentContacts(false);\n const contactUuid = target.getAttribute('data-uuid');\n if (contactUuid) {\n // Fire custom event through editor\n this.editor.fireCustomEvent('temba-contact-clicked', {\n uuid: contactUuid\n });\n }\n }\n };\n }\n\n // Check cache first\n if (this.recentContactsCache[activityKey]) {\n this.renderRecentContactsPopup(this.recentContactsCache[activityKey]);\n this.positionPopup(overlayElement);\n } else {\n // Show loading state if data isn't ready yet\n this.recentContactsPopup.innerHTML =\n '<div class=\"no-contacts-message\">Loading...</div>';\n this.positionPopup(overlayElement);\n\n // Wait for the fetch to complete\n await this.fetchRecentContacts(activityKey, flowUuid);\n\n // Render if still hovering over this activity\n if (this.hoveredActivityKey === activityKey) {\n const contacts = this.recentContactsCache[activityKey] || [];\n this.renderRecentContactsPopup(contacts);\n this.positionPopup(overlayElement);\n }\n }\n }\n\n private positionPopup(overlayElement: HTMLElement) {\n if (!this.recentContactsPopup) return;\n\n // Position popup near the overlay\n const rect = overlayElement.getBoundingClientRect();\n this.recentContactsPopup.style.left = `${rect.left + window.scrollX}px`;\n this.recentContactsPopup.style.top = `${\n rect.bottom + window.scrollY + 5\n }px`;\n\n // Remove inline display style so CSS class can work\n this.recentContactsPopup.style.display = '';\n\n // Trigger animation by adding class\n this.recentContactsPopup.classList.remove('show');\n // Force reflow to restart animation\n void this.recentContactsPopup.offsetWidth;\n this.recentContactsPopup.classList.add('show');\n }\n\n private renderRecentContactsPopup(recentContacts: any[]) {\n if (!this.recentContactsPopup) return;\n\n const hasContacts = recentContacts.length > 0;\n\n if (!hasContacts) {\n // Simple message when no contacts\n this.recentContactsPopup.innerHTML =\n '<div class=\"no-contacts-message\">No Recent Contacts</div>';\n return;\n }\n\n let html = `<div class=\"popup-title\">Recent Contacts</div>`;\n\n recentContacts.forEach((contact: any) => {\n html += `<div class=\"contact-row\">`;\n html += `<div class=\"contact-name\" data-uuid=\"${contact.contact.uuid}\">${contact.contact.name}</div>`;\n if (contact.operand) {\n html += `<div class=\"contact-operand\">${contact.operand}</div>`;\n }\n if (contact.time) {\n const time = new Date(contact.time);\n const now = new Date();\n const diffMs = now.getTime() - time.getTime();\n const diffMins = Math.floor(diffMs / 60000);\n const diffHours = Math.floor(diffMs / 3600000);\n const diffDays = Math.floor(diffMs / 86400000);\n\n let timeStr = '';\n if (diffMins < 1) timeStr = 'just now';\n else if (diffMins < 60) timeStr = `${diffMins}m ago`;\n else if (diffHours < 24) timeStr = `${diffHours}h ago`;\n else timeStr = `${diffDays}d ago`;\n\n html += `<div class=\"contact-time\">${timeStr}</div>`;\n }\n html += `</div>`;\n });\n\n this.recentContactsPopup.innerHTML = html;\n }\n\n private hideRecentContacts(wait = true) {\n if (!wait) {\n if (this.recentContactsPopup) {\n this.recentContactsPopup.classList.remove('show');\n this.recentContactsPopup.style.display = 'none';\n this.hoveredActivityKey = null;\n }\n return;\n }\n\n this.hideContactsTimeout = window.setTimeout(() => {\n // Check if we're still hovering over an activity\n if (!this.hoveredActivityKey && this.recentContactsPopup) {\n this.recentContactsPopup.classList.remove('show');\n this.recentContactsPopup.style.display = 'none';\n this.hoveredActivityKey = null;\n }\n }, 200); // Small delay to allow moving between overlay and popup\n }\n\n public clearRecentContactsCache() {\n this.recentContactsCache = {};\n // Cancel any pending fetches\n Object.values(this.pendingFetches).forEach((controller) =>\n controller.abort()\n );\n this.pendingFetches = {};\n }\n\n public repaintEverything() {\n if (this.jsPlumb) {\n this.jsPlumb.repaintEverything();\n }\n }\n\n public revalidate(ids: string[]) {\n if (!this.jsPlumb) return;\n this.jsPlumb.batch(() => {\n ids.forEach((id) => {\n const element = document.getElementById(id);\n if (element) {\n this.jsPlumb.revalidate(element);\n }\n });\n });\n }\n\n public removeNodeConnections(nodeId: string) {\n if (!this.jsPlumb) return;\n\n const inbound = this.jsPlumb.select({ target: nodeId });\n const exitIds =\n Array.from(\n document.getElementById(nodeId)?.querySelectorAll('.exit') || []\n ).map((exit) => {\n return exit.id;\n }) || [];\n\n inbound.deleteAll();\n this.jsPlumb.select({ source: exitIds }).deleteAll();\n this.jsPlumb.selectEndpoints({ source: exitIds }).deleteAll();\n }\n\n public removeExitConnection(exitId: string) {\n if (!this.jsPlumb) return;\n\n const exitElement = document.getElementById(exitId);\n if (!exitElement) return;\n\n // Get all connections from this exit\n const connections = this.jsPlumb.getConnections({ source: exitElement });\n\n // Remove the connections\n connections.forEach((connection) => {\n this.jsPlumb.deleteConnection(connection);\n });\n\n // Re-create the source endpoint (now without connection)\n this.jsPlumb.removeAllEndpoints(exitElement);\n this.makeSource(exitId);\n\n return connections.length > 0;\n }\n\n /**\n * Set the removing state for an exit's connection\n * @param exitId The ID of the exit whose connections should be marked as removing\n * @returns true if connections were found and updated, false otherwise\n */\n public setConnectionRemovingState(\n exitId: string,\n isRemoving: boolean\n ): boolean {\n if (!this.jsPlumb) return false;\n\n const exitElement = document.getElementById(exitId);\n if (!exitElement) return false;\n\n // Get all connections from this exit\n const connections = this.jsPlumb.getConnections({ source: exitElement });\n\n if (connections.length === 0) return false;\n\n // Update the connections' CSS classes\n connections.forEach((connection) => {\n if (isRemoving) {\n connection.addClass('removing');\n } else {\n connection.removeClass('removing');\n }\n });\n\n return true;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Plumber.js","sourceRoot":"","sources":["../../../src/flow/Plumber.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,KAAK,EACL,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,kBAAkB,CAAC,IAAI;IAC7B,OAAO,EAAE;QACP,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;QACd,QAAQ,EAAE,GAAG;QACb,kBAAkB,EAAE,IAAI;QACxB,YAAY,EAAE,CAAC;QACf,QAAQ,EAAE,iBAAiB;KAC5B;C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_DRAG,\n EVENT_CONNECTION_ABORT,\n INTERCEPT_BEFORE_DROP,\n EVENT_CONNECTION,\n EVENT_REVERT,\n INTERCEPT_BEFORE_DETACH,\n EVENT_CONNECTION_DETACHED\n} from '@jsplumb/browser-ui';\nimport { getStore } from '../store/Store';\n\nconst CONNECTOR_DEFAULTS = {\n type: FlowchartConnector.type,\n options: {\n stub: [20, 10],\n midpoint: 0.5,\n alwaysRespectStubs: true,\n cornerRadius: 5,\n cssClass: 'plumb-connector'\n }\n};\n\nconst OVERLAYS_DEFAULTS = [\n {\n type: 'PlainArrow',\n options: {\n width: 13,\n length: 13,\n location: 0.999,\n cssClass: 'plumb-arrow'\n }\n }\n];\n\nexport const SOURCE_DEFAULTS = {\n endpoint: {\n type: DotEndpoint.type,\n options: {\n radius: 12,\n cssClass: 'plumb-source',\n hoverClass: 'plumb-source-hover'\n }\n },\n anchors: ['Bottom', 'Continuous'],\n maxConnections: 1,\n source: true,\n dragAllowedWhenFull: false\n};\n\nexport const TARGET_DEFAULTS = {\n endpoint: {\n type: RectangleEndpoint.type,\n options: {\n width: 23,\n height: 23,\n cssClass: 'plumb-target',\n hoverClass: 'plumb-target-hover'\n }\n },\n anchor: {\n type: 'Continuous',\n options: {\n faces: ['top', 'left', 'right'],\n cssClass: 'continuos plumb-target-anchor'\n }\n },\n deleteOnEmpty: true,\n maxConnections: 1,\n target: true\n};\n\nexport class Plumber {\n private jsPlumb = null;\n private pendingConnections = [];\n private connectionListeners = new Map();\n public connectionDragging = false;\n private connectionWait = null;\n private activityData: { segments: { [key: string]: number } } | null = null;\n private hoveredActivityKey: string | null = null;\n private recentContactsPopup: HTMLElement | null = null;\n private recentContactsCache: { [key: string]: any[] } = {};\n private pendingFetches: { [key: string]: AbortController } = {};\n private hideContactsTimeout: number | null = null;\n private showContactsTimeout: number | null = null;\n private editor: any;\n\n initializeJSPlumb(canvas: HTMLElement) {\n this.jsPlumb = newInstance({\n container: canvas,\n connectionsDetachable: true,\n endpointStyle: {\n fill: 'green'\n },\n connector: CONNECTOR_DEFAULTS,\n connectionOverlays: OVERLAYS_DEFAULTS\n });\n\n // Bind to connection events\n this.jsPlumb.bind(EVENT_CONNECTION, (info) => {\n this.connectionDragging = false;\n this.notifyListeners(EVENT_CONNECTION, info);\n });\n\n // Bind to connection drag events\n this.jsPlumb.bind(EVENT_CONNECTION_DRAG, (info) => {\n this.connectionDragging = true;\n this.notifyListeners(EVENT_CONNECTION_DRAG, info);\n });\n\n this.jsPlumb.bind(EVENT_CONNECTION_ABORT, (info) => {\n this.connectionDragging = false;\n this.notifyListeners(EVENT_CONNECTION_ABORT, info);\n });\n\n this.jsPlumb.bind(EVENT_CONNECTION_DETACHED, (info) => {\n this.connectionDragging = false;\n this.notifyListeners(EVENT_CONNECTION_DETACHED, info);\n });\n\n this.jsPlumb.bind(EVENT_REVERT, (info) => {\n this.notifyListeners(EVENT_REVERT, info);\n });\n\n this.jsPlumb.bind(INTERCEPT_BEFORE_DROP, () => {\n // we always deny automatic connections\n return false;\n });\n this.jsPlumb.bind(INTERCEPT_BEFORE_DETACH, () => {});\n }\n\n constructor(canvas: HTMLElement, editor: any) {\n this.editor = editor;\n ready(() => {\n this.initializeJSPlumb(canvas);\n });\n }\n\n private notifyListeners(eventName: string, info: any) {\n const listeners = this.connectionListeners.get(eventName) || [];\n listeners.forEach((listener) => listener(info));\n }\n\n public on(eventName: string, callback: (info: any) => void) {\n if (!this.connectionListeners.has(eventName)) {\n this.connectionListeners.set(eventName, []);\n }\n this.connectionListeners.get(eventName).push(callback);\n }\n\n public off(eventName: string, callback: (info: any) => void) {\n if (!this.connectionListeners.has(eventName)) return;\n const listeners = this.connectionListeners.get(eventName);\n const index = listeners.indexOf(callback);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n }\n\n public makeTarget(uuid: string) {\n const element = document.getElementById(uuid);\n if (!element) return;\n return this.jsPlumb.addEndpoint(element, TARGET_DEFAULTS);\n }\n\n public makeSource(uuid: string) {\n const element = document.getElementById(uuid);\n if (!element) return;\n return this.jsPlumb.addEndpoint(element, SOURCE_DEFAULTS);\n }\n\n // we'll process our pending connections, but we want to debounce this\n public processPendingConnections() {\n // if we have a pending connection wait, clear it\n if (this.connectionWait) {\n clearTimeout(this.connectionWait);\n this.connectionWait = null;\n }\n\n // debounce the connection processing\n this.connectionWait = setTimeout(() => {\n this.jsPlumb.batch(() => {\n this.pendingConnections.forEach((connection) => {\n const { scope, fromId, toId } = connection;\n\n // sources and targets must exist\n const source = document.getElementById(fromId);\n // const target = document.getElementById(toId);\n\n this.revalidate([fromId, toId]);\n\n // we need to find the source endpoint\n const sourceEndpoint = this.jsPlumb\n .getEndpoints(source)\n ?.find((endpoint) =>\n endpoint.elementId === fromId ? true : false\n );\n\n // update endpoint have connect css class\n if (sourceEndpoint) {\n sourceEndpoint.addClass('connected');\n }\n\n // each connection needs its own target endpoint\n const targetEndpoint = this.makeTarget(toId);\n\n if (!source || !targetEndpoint) {\n console.warn(\n `Plumber: Cannot connect ${fromId} to ${toId}. Element(s) missing.`\n );\n return;\n }\n\n // delete connections\n this.jsPlumb.select({ source, targetEndpoint }).deleteAll();\n this.jsPlumb.connect({\n source: source,\n target: targetEndpoint,\n connector: {\n ...CONNECTOR_DEFAULTS,\n options: { ...CONNECTOR_DEFAULTS.options, gap: [0, 5] }\n },\n data: {\n nodeId: scope\n }\n });\n });\n this.pendingConnections = [];\n });\n\n // Force a repaint to ensure connections are positioned correctly\n // especially after bulk updates or view switching\n window.requestAnimationFrame(() => {\n if (this.jsPlumb) {\n this.jsPlumb.repaintEverything();\n }\n });\n }, 0);\n }\n\n public connectIds(scope: string, fromId: string, toId: string) {\n this.pendingConnections.push({ scope, fromId, toId });\n this.processPendingConnections();\n }\n\n public setActivityData(\n activityData: { segments: { [key: string]: number } } | null\n ) {\n this.activityData = activityData;\n // Clear recent contacts cache when activity data changes\n this.clearRecentContactsCache();\n this.updateActivityOverlays();\n }\n\n private updateActivityOverlays() {\n if (!this.jsPlumb || !this.activityData) {\n return;\n }\n\n // Get all connections\n const connections = this.jsPlumb.getConnections();\n\n connections.forEach((connection: any) => {\n // Get the source exit element\n const sourceElement = connection.source;\n if (!sourceElement) {\n return;\n }\n\n // Get destination node\n const targetElement = connection.target;\n if (!targetElement) {\n return;\n }\n\n // Create activity key: exitUuid:destinationUuid\n const exitUuid = sourceElement.id;\n const destinationUuid = targetElement.id;\n const activityKey = `${exitUuid}:${destinationUuid}`;\n\n // Get activity count for this segment\n const count = this.activityData.segments[activityKey];\n\n // Remove existing activity overlays\n connection.removeOverlay('activity-label');\n\n // Add new overlay if there's activity\n if (count && count > 0) {\n const overlay = connection.addOverlay({\n type: 'Label',\n options: {\n label: count.toLocaleString(),\n id: 'activity-label',\n cssClass: 'activity-overlay',\n location: 20 // Fixed pixel distance from the start (exit point)\n }\n });\n\n // Add hover events for recent contacts popup\n // Use setTimeout to ensure the overlay is fully rendered\n setTimeout(() => {\n // Try multiple ways to get the overlay element\n let overlayElement =\n overlay.canvas || overlay.element || overlay.getElement?.();\n\n // If still not found, query the DOM directly\n if (!overlayElement) {\n const overlays = connection.getOverlays();\n if (Array.isArray(overlays)) {\n for (const ovl of overlays) {\n if (ovl.id === 'activity-label') {\n overlayElement =\n ovl.canvas || ovl.element || ovl.getElement?.();\n break;\n }\n }\n }\n }\n\n // Also try querying by CSS class\n if (!overlayElement && connection.canvas) {\n overlayElement =\n connection.canvas.querySelector('.activity-overlay');\n }\n\n if (overlayElement) {\n overlayElement.style.cursor = 'pointer';\n overlayElement.setAttribute('data-activity-key', activityKey);\n overlayElement.addEventListener('mouseenter', () => {\n // Don't show recent contacts when simulator is active\n const store = getStore();\n if (store?.getState().simulatorActive) {\n return;\n }\n\n // Get flow UUID from the editor element\n const editor = document.querySelector('temba-flow-editor') as any;\n const flowUuid = editor?.definition?.uuid;\n if (flowUuid) {\n // Start fetching immediately\n this.fetchRecentContacts(activityKey, flowUuid);\n\n // But delay showing the popup by half a second\n this.showContactsTimeout = window.setTimeout(() => {\n this.showRecentContacts(activityKey, flowUuid);\n }, 500);\n }\n });\n overlayElement.addEventListener('mouseleave', () => {\n // Cancel the show timeout if still pending\n if (this.showContactsTimeout) {\n clearTimeout(this.showContactsTimeout);\n this.showContactsTimeout = null;\n }\n this.hoveredActivityKey = null;\n this.hideRecentContacts();\n });\n }\n }, 50);\n }\n });\n\n // Force repaint to ensure overlays are positioned correctly\n this.repaintEverything();\n }\n\n private findOverlayElement(activityKey: string): HTMLElement | null {\n // Find overlay by data attribute\n const overlays = document.querySelectorAll('.activity-overlay');\n for (const overlay of overlays) {\n if (overlay.getAttribute('data-activity-key') === activityKey) {\n return overlay as HTMLElement;\n }\n }\n return null;\n }\n\n private async fetchRecentContacts(activityKey: string, flowUuid: string) {\n // Skip if already cached or currently fetching\n if (\n this.recentContactsCache[activityKey] ||\n this.pendingFetches[activityKey]\n ) {\n return;\n }\n\n // Cancel any pending fetch for this key\n if (this.pendingFetches[activityKey]) {\n this.pendingFetches[activityKey].abort();\n }\n\n // Fetch recent contacts from endpoint\n const controller = new AbortController();\n this.pendingFetches[activityKey] = controller;\n\n try {\n // Parse exit UUID and destination UUID from activity key\n const [exitUuid, destinationUuid] = activityKey.split(':');\n\n const endpoint = `/flow/recent_contacts/${flowUuid}/${exitUuid}/${destinationUuid}/`;\n\n const response = await fetch(endpoint, {\n signal: controller.signal\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n const data = await response.json();\n // API returns array directly, not wrapped in results\n const recentContacts = Array.isArray(data) ? data : data.results || [];\n\n // Cache the results\n this.recentContactsCache[activityKey] = recentContacts;\n } catch (error) {\n if ((error as Error).name !== 'AbortError') {\n console.error('Failed to fetch recent contacts:', error);\n }\n } finally {\n delete this.pendingFetches[activityKey];\n }\n }\n\n private async showRecentContacts(activityKey: string, flowUuid: string) {\n // Don't show recent contacts when simulator is active\n const store = getStore();\n if (store?.getState().simulatorActive) {\n return;\n }\n\n // Find the overlay element fresh to avoid stale references\n const overlayElement = this.findOverlayElement(activityKey);\n if (!overlayElement) {\n console.warn('Could not find overlay element for activity:', activityKey);\n return;\n }\n // Clear any pending hide timeout\n if (this.hideContactsTimeout) {\n clearTimeout(this.hideContactsTimeout);\n this.hideContactsTimeout = null;\n }\n\n this.hoveredActivityKey = activityKey;\n\n // Create popup if it doesn't exist\n if (!this.recentContactsPopup) {\n this.recentContactsPopup = document.createElement('div');\n this.recentContactsPopup.className = 'recent-contacts-popup';\n // Add inline styles to ensure visibility\n this.recentContactsPopup.style.position = 'absolute';\n this.recentContactsPopup.style.width = '200px';\n this.recentContactsPopup.style.background = '#f3f3f3';\n this.recentContactsPopup.style.borderRadius = '10px';\n this.recentContactsPopup.style.boxShadow =\n '0 1px 3px 1px rgba(130, 130, 130, 0.2)';\n this.recentContactsPopup.style.zIndex = '1015';\n this.recentContactsPopup.style.display = 'none';\n document.body.appendChild(this.recentContactsPopup);\n }\n\n // Add hover events to keep popup open (only needs to be done once)\n if (!this.recentContactsPopup.onmouseenter) {\n this.recentContactsPopup.onmouseenter = () => {\n if (this.hideContactsTimeout) {\n clearTimeout(this.hideContactsTimeout);\n this.hideContactsTimeout = null;\n }\n };\n this.recentContactsPopup.onmouseleave = () => {\n this.hoveredActivityKey = null;\n this.hideRecentContacts();\n };\n\n // Add click event listener for contact names\n this.recentContactsPopup.onclick = (e: MouseEvent) => {\n const target = e.target as HTMLElement;\n\n if (target.classList.contains('contact-name')) {\n this.hideRecentContacts(false);\n const contactUuid = target.getAttribute('data-uuid');\n if (contactUuid) {\n // Fire custom event through editor\n this.editor.fireCustomEvent('temba-contact-clicked', {\n uuid: contactUuid\n });\n }\n }\n };\n }\n\n // Check cache first\n if (this.recentContactsCache[activityKey]) {\n this.renderRecentContactsPopup(this.recentContactsCache[activityKey]);\n this.positionPopup(overlayElement);\n } else {\n // Show loading state if data isn't ready yet\n this.recentContactsPopup.innerHTML =\n '<div class=\"no-contacts-message\">Loading...</div>';\n this.positionPopup(overlayElement);\n\n // Wait for the fetch to complete\n await this.fetchRecentContacts(activityKey, flowUuid);\n\n // Render if still hovering over this activity\n if (this.hoveredActivityKey === activityKey) {\n const contacts = this.recentContactsCache[activityKey] || [];\n this.renderRecentContactsPopup(contacts);\n this.positionPopup(overlayElement);\n }\n }\n }\n\n private positionPopup(overlayElement: HTMLElement) {\n if (!this.recentContactsPopup) return;\n\n // Position popup near the overlay\n const rect = overlayElement.getBoundingClientRect();\n this.recentContactsPopup.style.left = `${rect.left + window.scrollX}px`;\n this.recentContactsPopup.style.top = `${\n rect.bottom + window.scrollY + 5\n }px`;\n\n // Remove inline display style so CSS class can work\n this.recentContactsPopup.style.display = '';\n\n // Trigger animation by adding class\n this.recentContactsPopup.classList.remove('show');\n // Force reflow to restart animation\n void this.recentContactsPopup.offsetWidth;\n this.recentContactsPopup.classList.add('show');\n }\n\n private renderRecentContactsPopup(recentContacts: any[]) {\n if (!this.recentContactsPopup) return;\n\n const hasContacts = recentContacts.length > 0;\n\n if (!hasContacts) {\n // Simple message when no contacts\n this.recentContactsPopup.innerHTML =\n '<div class=\"no-contacts-message\">No Recent Contacts</div>';\n return;\n }\n\n let html = `<div class=\"popup-title\">Recent Contacts</div>`;\n\n recentContacts.forEach((contact: any) => {\n html += `<div class=\"contact-row\">`;\n html += `<div class=\"contact-name\" data-uuid=\"${contact.contact.uuid}\">${contact.contact.name}</div>`;\n if (contact.operand) {\n html += `<div class=\"contact-operand\">${contact.operand}</div>`;\n }\n if (contact.time) {\n const time = new Date(contact.time);\n const now = new Date();\n const diffMs = now.getTime() - time.getTime();\n const diffMins = Math.floor(diffMs / 60000);\n const diffHours = Math.floor(diffMs / 3600000);\n const diffDays = Math.floor(diffMs / 86400000);\n\n let timeStr = '';\n if (diffMins < 1) timeStr = 'just now';\n else if (diffMins < 60) timeStr = `${diffMins}m ago`;\n else if (diffHours < 24) timeStr = `${diffHours}h ago`;\n else timeStr = `${diffDays}d ago`;\n\n html += `<div class=\"contact-time\">${timeStr}</div>`;\n }\n html += `</div>`;\n });\n\n this.recentContactsPopup.innerHTML = html;\n }\n\n private hideRecentContacts(wait = true) {\n if (!wait) {\n if (this.recentContactsPopup) {\n this.recentContactsPopup.classList.remove('show');\n this.recentContactsPopup.style.display = 'none';\n this.hoveredActivityKey = null;\n }\n return;\n }\n\n this.hideContactsTimeout = window.setTimeout(() => {\n // Check if we're still hovering over an activity\n if (!this.hoveredActivityKey && this.recentContactsPopup) {\n this.recentContactsPopup.classList.remove('show');\n this.recentContactsPopup.style.display = 'none';\n this.hoveredActivityKey = null;\n }\n }, 200); // Small delay to allow moving between overlay and popup\n }\n\n public clearRecentContactsCache() {\n this.recentContactsCache = {};\n // Cancel any pending fetches\n Object.values(this.pendingFetches).forEach((controller) =>\n controller.abort()\n );\n this.pendingFetches = {};\n }\n\n public repaintEverything() {\n if (this.jsPlumb) {\n this.jsPlumb.repaintEverything();\n }\n }\n\n public revalidate(ids: string[]) {\n if (!this.jsPlumb) return;\n this.jsPlumb.batch(() => {\n ids.forEach((id) => {\n const element = document.getElementById(id);\n if (element) {\n this.jsPlumb.revalidate(element);\n }\n });\n });\n }\n\n public reset() {\n if (this.connectionWait) {\n clearTimeout(this.connectionWait);\n this.connectionWait = null;\n }\n this.pendingConnections = [];\n this.jsPlumb.select().deleteAll();\n this.jsPlumb._managedElements = {};\n }\n\n public forgetNode(nodeId: string) {\n if (!this.jsPlumb) return;\n const element = document.getElementById(nodeId);\n if (!element) return;\n\n this.jsPlumb.deleteConnectionsForElement(element);\n this.jsPlumb.removeAllEndpoints(element);\n this.jsPlumb.unmanage(element);\n }\n\n public removeNodeConnections(nodeId: string, exitIds?: string[]) {\n if (!this.jsPlumb) return;\n\n const inbound = this.jsPlumb.select({ target: nodeId });\n\n // Use provided exitIds or try to find them in DOM (fallback)\n const exits =\n exitIds ||\n Array.from(\n document.getElementById(nodeId)?.querySelectorAll('.exit') || []\n ).map((exit) => {\n return exit.id;\n }) ||\n [];\n\n inbound.deleteAll();\n this.jsPlumb.select({ source: exits }).deleteAll();\n this.jsPlumb.selectEndpoints({ source: exits }).deleteAll();\n }\n\n public removeExitConnection(exitId: string) {\n if (!this.jsPlumb) return;\n\n const exitElement = document.getElementById(exitId);\n if (!exitElement) return;\n\n // Get all connections from this exit\n const connections = this.jsPlumb.getConnections({ source: exitElement });\n\n // Remove the connections\n connections.forEach((connection) => {\n this.jsPlumb.deleteConnection(connection);\n });\n\n return connections.length > 0;\n }\n\n public removeAllEndpoints(nodeId: string) {\n if (!this.jsPlumb) return;\n const element = document.getElementById(nodeId);\n if (!element) return;\n this.jsPlumb.removeAllEndpoints(element, true);\n }\n\n /**\n * Set the removing state for an exit's connection\n * @param exitId The ID of the exit whose connections should be marked as removing\n * @returns true if connections were found and updated, false otherwise\n */\n public setConnectionRemovingState(\n exitId: string,\n isRemoving: boolean\n ): boolean {\n if (!this.jsPlumb) return false;\n\n const exitElement = document.getElementById(exitId);\n if (!exitElement) return false;\n\n // Get all connections from this exit\n const connections = this.jsPlumb.getConnections({ source: exitElement });\n\n if (connections.length === 0) return false;\n\n // Update the connections' CSS classes\n connections.forEach((connection) => {\n if (isRemoving) {\n connection.addClass('removing');\n } else {\n connection.removeClass('removing');\n }\n });\n\n return true;\n }\n}\n"]}
|
|
@@ -28,7 +28,11 @@ export const set_contact_field = {
|
|
|
28
28
|
endpoint: '/api/v2/fields.json',
|
|
29
29
|
helpText: 'Select the contact field to update',
|
|
30
30
|
allowCreate: true,
|
|
31
|
-
createArbitraryOption: (input) => ({
|
|
31
|
+
createArbitraryOption: (input) => ({
|
|
32
|
+
key: input,
|
|
33
|
+
name: input,
|
|
34
|
+
type: 'text'
|
|
35
|
+
})
|
|
32
36
|
},
|
|
33
37
|
value: {
|
|
34
38
|
type: 'text',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set_contact_field.js","sourceRoot":"","sources":["../../../../src/flow/actions/set_contact_field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO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KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC;IACJ,CAAC;IACD,YAAY,EAAE,CAAC,QAAkB,EAAmB,EAAE;QACpD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAChC,OAAO;YACL,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;YAC3C,KAAK,EAAE,QAAQ,CAAC,KAAK;SACtB,CAAC;IACJ,CAAC;IACD,QAAQ,EAAE,CAAC,QAAkB,EAAQ,EAAE;QACrC,IAAI,QAAQ,CAAC,KAAK,IAAI,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YACzD,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACzC,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import { html } from 'lit-html';\nimport { ActionConfig, ACTION_GROUPS, FormData, FlowTypes } from '../types';\nimport { Node, SetContactField } from '../../store/flow-definition';\n\nexport const set_contact_field: ActionConfig = {\n name: 'Update Field',\n group: ACTION_GROUPS.contacts,\n flowTypes: [FlowTypes.VOICE, FlowTypes.MESSAGE, FlowTypes.BACKGROUND],\n render: (_node: Node, action: SetContactField) => {\n if (action.value) {\n return html`<div>\n Set <strong>${action.field.name}</strong> to\n <strong>${action.value}</strong>\n </div>`;\n } else {\n return html`<div>Clear <strong>${action.field.name}</strong></div>`;\n }\n },\n form: {\n field: {\n type: 'select',\n label: 'Field',\n required: true,\n searchable: true,\n clearable: false,\n placeholder: 'Search for contact fields...',\n nameKey: 'name',\n valueKey: 'key',\n endpoint: '/api/v2/fields.json',\n helpText: 'Select the contact field to update',\n allowCreate: true,\n createArbitraryOption: (input: string) => ({\n key: input,\n name: input,\n type: 'text'\n })\n },\n value: {\n type: 'text',\n label: 'Value',\n placeholder: 'Enter field value...',\n evaluated: true,\n helpText:\n 'The new value for the contact field. You can use expressions like @contact.name'\n }\n },\n toFormData: (action: SetContactField) => {\n return {\n uuid: action.uuid,\n field: action.field ? [action.field] : null,\n value: action.value\n };\n },\n fromFormData: (formData: FormData): SetContactField => {\n const field = formData.field[0];\n return {\n uuid: formData.uuid,\n type: 'set_contact_field',\n field: { name: field.name, key: field.key },\n value: formData.value\n };\n },\n sanitize: (formData: FormData): void => {\n if (formData.value && typeof formData.value === 'string') {\n formData.value = formData.value.trim();\n }\n }\n};\n"]}
|
|
@@ -143,7 +143,8 @@ export class RunList extends TembaList {
|
|
|
143
143
|
getRefreshEndpoint() {
|
|
144
144
|
if (this.items.length > 0) {
|
|
145
145
|
const modifiedOn = this.items[0].modified_on;
|
|
146
|
-
|
|
146
|
+
const separator = this.endpoint.includes('?') ? '&' : '?';
|
|
147
|
+
return this.endpoint + separator + 'after=' + modifiedOn;
|
|
147
148
|
}
|
|
148
149
|
return this.endpoint;
|
|
149
150
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunList.js","sourceRoot":"","sources":["../../../src/list/RunList.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAEvC,MAAM,OAAO,OAAQ,SAAQ,SAAS;IAqBpC,MAAM,KAAK,MAAM;QACf,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;KAiBT,CAAC;IACJ,CAAC;IAEM,YAAY,CAAC,iBAAmC;QACrD,KAAK,CAAC,Y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;4BACd,CAAC;gBACT,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;;;aAGP;YACH,CAAC,CAAC,IAAI;;WAEL,CAAC;IACV,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QA9VV,cAAS,GAAG,IAAI,CAAC;QASjB,gBAAW,GAAG,KAAK,CAAC;QAEZ,eAAU,GAAG,EAAE,CAAC;QAoVtB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;CACF;AA1WC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACd;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;wCAC9B;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0CACX;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CACR;AAGnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CACR","sourcesContent":["import { css, html, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { Checkbox } from '../form/Checkbox';\nimport { Select } from '../form/select/Select';\nimport { capitalize } from '../utils';\nimport { Icon } from '../Icons';\nimport { TembaList } from './TembaList';\n\nconst FLOW_COLOR = 'rgb(223, 65, 159)';\n\nexport class RunList extends TembaList {\n @property({ type: String })\n flow: string;\n\n @property({ type: Object, attribute: false })\n results: any[];\n\n @property({ type: Boolean })\n responses = true;\n\n @property({ type: Object })\n resultPreview: any;\n\n @property({ type: Object })\n selectedRun: any;\n\n @property({ type: Boolean })\n allowDelete = false;\n\n private resultKeys = {};\n\n static get styles() {\n return css`\n :host {\n overflow-y: auto !important;\n --contact-name-font-size: 1em;\n }\n\n @media only screen and (max-height: 768px) {\n temba-options {\n max-height: 20vh;\n }\n }\n\n temba-options {\n display: block;\n width: 100%;\n flex-grow: 1;\n }\n `;\n }\n\n public firstUpdated(changedProperties: Map<string, any>) {\n super.firstUpdated(changedProperties);\n }\n\n public updated(changedProperties: Map<string, any>): void {\n super.updated(changedProperties);\n if (changedProperties.has('responses') || changedProperties.has('flow')) {\n if (this.flow) {\n this.endpoint = `/api/v2/runs.json?flow=${this.flow}${\n this.responses ? '&responded=1' : ''\n }`;\n }\n }\n\n if (changedProperties.has('resultPreview')) {\n this.createRenderOption();\n }\n\n if (changedProperties.has('results')) {\n if (this.results) {\n const select = this.shadowRoot.querySelector(\n 'temba-select'\n ) as Select<any>;\n select.setOptions(this.results);\n this.resultKeys = this.results.reduce(\n (current, result) => ({ ...current, [result.key]: result }),\n {}\n );\n }\n }\n }\n\n public renderResultPreview(run: any) {\n if (this.resultPreview) {\n const runResult = run.values[this.resultPreview.key];\n if (runResult) {\n if (this.resultPreview.categories.length > 1) {\n if (runResult.category) {\n return runResult.category;\n }\n } else {\n return runResult.value;\n }\n }\n }\n return null;\n }\n\n public removeRun(id: number) {\n this.items = this.items.filter((run) => run.id !== id);\n this.cursorIndex = Math.min(this.cursorIndex, this.items.length);\n this.requestUpdate('cursorIndex');\n }\n\n public getIcon(run: any): TemplateResult {\n let icon = null;\n if (run.exit_type == 'completed') {\n icon = html`<temba-icon\n name=\"check\"\n style=\"--icon-color:#666;margin-left:0.5em\"\n />`;\n } else if (run.exit_type == 'interrupted') {\n icon = html`<temba-icon\n name=\"x-octagon\"\n style=\"--icon-color:${FLOW_COLOR};margin-left:0.5em\"\n />`;\n } else if (run.exit_type == 'expired') {\n icon = html`<temba-icon\n name=\"clock\"\n style=\"--icon-color:${FLOW_COLOR};margin-left:0.5em\"\n />`;\n } else if (!run.exit_type) {\n if (run.responded) {\n icon = html`<temba-icon\n name=\"activity\"\n style=\"--icon-color:var(--color-primary-dark);margin-left:0.5em\"\n />`;\n } else {\n icon = html`<temba-icon\n name=\"hourglass\"\n style=\"--icon-color:var(--color-primary-dark);margin-left:0.5em\"\n />`;\n }\n }\n return icon;\n }\n\n public createRenderOption() {\n this.renderOption = (run: any): TemplateResult => {\n let statusStyle = '';\n\n if (!run.exited_on) {\n statusStyle = 'font-weight:400;';\n }\n\n if (!run.responded) {\n statusStyle += '';\n }\n\n return html`\n <div class=\"row\" style=\"${statusStyle}display:flex;align-items:center\">\n <div\n style=\"width:16em;white-space:nowrap;overflow: hidden; text-overflow: ellipsis;\"\n >\n <temba-contact-name\n name=${run.contact?.name || run.contact?.ref || ''}\n urn=${run.contact?.urn || ''}\n icon-size=\"15\"\n />\n </div>\n\n <div\n style=\"margin: 0em 1em;flex:1;white-space:nowrap; overflow:hidden; text-overflow: ellipsis;\"\n >\n ${this.renderResultPreview(run)}\n </div>\n\n <div style=\"flex-shrink:1\">\n <temba-date value=\"${run.modified_on}\" display=\"duration\" />\n </div>\n ${this.getIcon(run)}\n </div>\n `;\n };\n }\n\n public getRefreshEndpoint() {\n if (this.items.length > 0) {\n const modifiedOn = this.items[0].modified_on;\n return this.endpoint + '&after=' + modifiedOn;\n }\n return this.endpoint;\n }\n\n public toggleResponded() {\n this.responses = (\n this.shadowRoot.querySelector('#responded') as Checkbox\n ).checked;\n }\n\n public handleColumnChanged(event: any) {\n if (event.target.values.length > 0) {\n this.resultPreview = event.target.values[0];\n } else {\n this.resultPreview = null;\n }\n }\n\n public handleSelected(selected: any) {\n this.selectedRun = selected;\n }\n\n public getListStyle(): string {\n return '';\n }\n\n public renderHeader(): TemplateResult {\n return html`\n <div style=\"display:flex;width:100%;margin-bottom: 1em;\">\n <div style=\"flex-grow:1\">\n ${this.results\n ? html`\n <temba-select\n clearable\n placeholder=\"Result Preview\"\n valueKey=\"key\"\n @change=${this.handleColumnChanged}\n style=\"z-index: 10;\"\n ></temba-select>\n `\n : null}\n </div>\n <div style=\"margin-left:1em;\">\n <temba-checkbox\n id=\"responded\"\n label=\"Responses Only\"\n checked=\"true\"\n @click=${this.toggleResponded}\n />\n </div>\n </div>\n <div\n style=\"\n font-size:0.8em;\n color:rgba(0,0,0,.4);\n text-align:right;\n background:#f9f9f9;\n border: 1px solid var(--color-widget-border);\n margin-bottom:-0.5em; \n padding-bottom: 0.6em;\n padding-top: 0.3em;\n padding-right: 4.5em;\n border-top-right-radius: var(--curvature);\n border-top-left-radius: var(--curvature)\n \"\n >\n Last Updated\n </div>\n `;\n }\n\n public renderFooter(): TemplateResult {\n if (!this.selectedRun || !this.resultKeys) {\n return null;\n }\n\n const resultKeys = Object.keys(this.selectedRun.values || {});\n\n return html` <div\n style=\"margin-top: 1.5em; margin-bottom:0.5em;flex-grow:1;border-radius:var(--curvature); border: 1px solid var(--color-widget-border);\"\n >\n <div style=\"display:flex;flex-direction:column;\">\n <div\n style=\"font-size:1.5em;background:#f9f9f9;padding:.75em;padding-top:.35em;display:flex;align-items:center;border-top-right-radius:var(--curvature);border-top-left-radius:var(--curvature)\"\n >\n <div>\n <temba-contact-name\n style=\"cursor:pointer\"\n name=${this.selectedRun.contact?.name ||\n this.selectedRun.contact?.ref ||\n ''}\n urn=${this.selectedRun.contact?.urn || ''}\n onclick=\"goto(event, this)\"\n href=\"/contact/read/${this.selectedRun.contact?.uuid || ''}/\"\n ></temba-contact-name>\n <div\n style=\"display:flex;margin-left:-0.2em;margin-top:0.25em;font-size: 0.65em\"\n >\n ${this.selectedRun.exit_type\n ? html`\n <div style=\"margin-left:2em;flex-grow:1;display:flex\">\n ${this.getIcon(this.selectedRun)}\n <div style=\"margin-left:0.5em\">\n ${capitalize(this.selectedRun.exit_type)} \n </div>\n <temba-date\n value=\"${this.selectedRun.exited_on}\"\n compare=\"${this.selectedRun.created_on}\"\n display=\"duration\"\n />\n </div>\n `\n : html`${this.getIcon(this.selectedRun)}\n <div style=\"margin-left:1.5em;flex-grow:1;display:flex\">\n <div>Started </div>\n <temba-date\n value=\"${this.selectedRun.created_on}\"\n display=\"duration\"\n ></temba-date>\n </div>`}\n </div>\n </div>\n <div style=\"flex-grow:1\"></div>\n <div style=\"display:flex;flex-direction: column\">\n <div style=\"font-size:0.75em\">\n ${this.selectedRun.created_on\n ? new Date(this.selectedRun.created_on).toLocaleString()\n : ''}\n </div>\n <div\n style=\"font-size:0.6em;align-self:flex-end;color:#888;line-height:0.75em\"\n >\n Started\n </div>\n </div>\n ${this.allowDelete\n ? html` <temba-icon\n clickable\n style=\"margin-left:0.75em;\"\n name=${Icon.delete}\n onclick=\"deleteRun(${this.selectedRun.id});\"\n ></temba-icon>`\n : null}\n </div>\n\n ${resultKeys.length > 0\n ? html`\n <div style=\"padding:1em;\">\n <div\n style=\"display:flex;font-size:1.2em;position:relative;right:0px\"\n >\n <div style=\"flex-grow:1\"></div>\n </div>\n\n <table width=\"100%\">\n <tr>\n <th style=\"text-align:left\" width=\"25%\">Result</th>\n <th style=\"text-align:left\" width=\"25%\">Category</th>\n <th style=\"text-align:left\">Value</th>\n </tr>\n\n ${Object.keys(this.selectedRun.values).map((key: string) => {\n const result = this.selectedRun.values[key];\n const meta = this.resultKeys[key];\n\n // if our result is no longer represented in the flow, skip it\n if (meta) {\n return html`<tr>\n <td>${result.name}</td>\n <td>\n ${meta.categories.length > 1 ? result.category : '--'}\n </td>\n <td>${result.value}</td>\n </tr>`;\n }\n return null;\n })}\n </table>\n </div>\n `\n : null}\n </div>\n </div>`;\n }\n\n constructor() {\n super();\n this.reverseRefresh = false;\n this.valueKey = 'uuid';\n this.hideShadow = true;\n this.createRenderOption();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RunList.js","sourceRoot":"","sources":["../../../src/list/RunList.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,C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CACR;AAGnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CACR","sourcesContent":["import { css, html, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { Checkbox } from '../form/Checkbox';\nimport { Select } from '../form/select/Select';\nimport { capitalize } from '../utils';\nimport { Icon } from '../Icons';\nimport { TembaList } from './TembaList';\n\nconst FLOW_COLOR = 'rgb(223, 65, 159)';\n\nexport class RunList extends TembaList {\n @property({ type: String })\n flow: string;\n\n @property({ type: Object, attribute: false })\n results: any[];\n\n @property({ type: Boolean })\n responses = true;\n\n @property({ type: Object })\n resultPreview: any;\n\n @property({ type: Object })\n selectedRun: any;\n\n @property({ type: Boolean })\n allowDelete = false;\n\n private resultKeys = {};\n\n static get styles() {\n return css`\n :host {\n overflow-y: auto !important;\n --contact-name-font-size: 1em;\n }\n\n @media only screen and (max-height: 768px) {\n temba-options {\n max-height: 20vh;\n }\n }\n\n temba-options {\n display: block;\n width: 100%;\n flex-grow: 1;\n }\n `;\n }\n\n public firstUpdated(changedProperties: Map<string, any>) {\n super.firstUpdated(changedProperties);\n }\n\n public updated(changedProperties: Map<string, any>): void {\n super.updated(changedProperties);\n if (changedProperties.has('responses') || changedProperties.has('flow')) {\n if (this.flow) {\n this.endpoint = `/api/v2/runs.json?flow=${this.flow}${\n this.responses ? '&responded=1' : ''\n }`;\n }\n }\n\n if (changedProperties.has('resultPreview')) {\n this.createRenderOption();\n }\n\n if (changedProperties.has('results')) {\n if (this.results) {\n const select = this.shadowRoot.querySelector(\n 'temba-select'\n ) as Select<any>;\n select.setOptions(this.results);\n this.resultKeys = this.results.reduce(\n (current, result) => ({ ...current, [result.key]: result }),\n {}\n );\n }\n }\n }\n\n public renderResultPreview(run: any) {\n if (this.resultPreview) {\n const runResult = run.values[this.resultPreview.key];\n if (runResult) {\n if (this.resultPreview.categories.length > 1) {\n if (runResult.category) {\n return runResult.category;\n }\n } else {\n return runResult.value;\n }\n }\n }\n return null;\n }\n\n public removeRun(id: number) {\n this.items = this.items.filter((run) => run.id !== id);\n this.cursorIndex = Math.min(this.cursorIndex, this.items.length);\n this.requestUpdate('cursorIndex');\n }\n\n public getIcon(run: any): TemplateResult {\n let icon = null;\n if (run.exit_type == 'completed') {\n icon = html`<temba-icon\n name=\"check\"\n style=\"--icon-color:#666;margin-left:0.5em\"\n />`;\n } else if (run.exit_type == 'interrupted') {\n icon = html`<temba-icon\n name=\"x-octagon\"\n style=\"--icon-color:${FLOW_COLOR};margin-left:0.5em\"\n />`;\n } else if (run.exit_type == 'expired') {\n icon = html`<temba-icon\n name=\"clock\"\n style=\"--icon-color:${FLOW_COLOR};margin-left:0.5em\"\n />`;\n } else if (!run.exit_type) {\n if (run.responded) {\n icon = html`<temba-icon\n name=\"activity\"\n style=\"--icon-color:var(--color-primary-dark);margin-left:0.5em\"\n />`;\n } else {\n icon = html`<temba-icon\n name=\"hourglass\"\n style=\"--icon-color:var(--color-primary-dark);margin-left:0.5em\"\n />`;\n }\n }\n return icon;\n }\n\n public createRenderOption() {\n this.renderOption = (run: any): TemplateResult => {\n let statusStyle = '';\n\n if (!run.exited_on) {\n statusStyle = 'font-weight:400;';\n }\n\n if (!run.responded) {\n statusStyle += '';\n }\n\n return html`\n <div class=\"row\" style=\"${statusStyle}display:flex;align-items:center\">\n <div\n style=\"width:16em;white-space:nowrap;overflow: hidden; text-overflow: ellipsis;\"\n >\n <temba-contact-name\n name=${run.contact?.name || run.contact?.ref || ''}\n urn=${run.contact?.urn || ''}\n icon-size=\"15\"\n />\n </div>\n\n <div\n style=\"margin: 0em 1em;flex:1;white-space:nowrap; overflow:hidden; text-overflow: ellipsis;\"\n >\n ${this.renderResultPreview(run)}\n </div>\n\n <div style=\"flex-shrink:1\">\n <temba-date value=\"${run.modified_on}\" display=\"duration\" />\n </div>\n ${this.getIcon(run)}\n </div>\n `;\n };\n }\n\n public getRefreshEndpoint() {\n if (this.items.length > 0) {\n const modifiedOn = this.items[0].modified_on;\n const separator = this.endpoint.includes('?') ? '&' : '?';\n return this.endpoint + separator + 'after=' + modifiedOn;\n }\n return this.endpoint;\n }\n\n public toggleResponded() {\n this.responses = (\n this.shadowRoot.querySelector('#responded') as Checkbox\n ).checked;\n }\n\n public handleColumnChanged(event: any) {\n if (event.target.values.length > 0) {\n this.resultPreview = event.target.values[0];\n } else {\n this.resultPreview = null;\n }\n }\n\n public handleSelected(selected: any) {\n this.selectedRun = selected;\n }\n\n public getListStyle(): string {\n return '';\n }\n\n public renderHeader(): TemplateResult {\n return html`\n <div style=\"display:flex;width:100%;margin-bottom: 1em;\">\n <div style=\"flex-grow:1\">\n ${this.results\n ? html`\n <temba-select\n clearable\n placeholder=\"Result Preview\"\n valueKey=\"key\"\n @change=${this.handleColumnChanged}\n style=\"z-index: 10;\"\n ></temba-select>\n `\n : null}\n </div>\n <div style=\"margin-left:1em;\">\n <temba-checkbox\n id=\"responded\"\n label=\"Responses Only\"\n checked=\"true\"\n @click=${this.toggleResponded}\n />\n </div>\n </div>\n <div\n style=\"\n font-size:0.8em;\n color:rgba(0,0,0,.4);\n text-align:right;\n background:#f9f9f9;\n border: 1px solid var(--color-widget-border);\n margin-bottom:-0.5em; \n padding-bottom: 0.6em;\n padding-top: 0.3em;\n padding-right: 4.5em;\n border-top-right-radius: var(--curvature);\n border-top-left-radius: var(--curvature)\n \"\n >\n Last Updated\n </div>\n `;\n }\n\n public renderFooter(): TemplateResult {\n if (!this.selectedRun || !this.resultKeys) {\n return null;\n }\n\n const resultKeys = Object.keys(this.selectedRun.values || {});\n\n return html` <div\n style=\"margin-top: 1.5em; margin-bottom:0.5em;flex-grow:1;border-radius:var(--curvature); border: 1px solid var(--color-widget-border);\"\n >\n <div style=\"display:flex;flex-direction:column;\">\n <div\n style=\"font-size:1.5em;background:#f9f9f9;padding:.75em;padding-top:.35em;display:flex;align-items:center;border-top-right-radius:var(--curvature);border-top-left-radius:var(--curvature)\"\n >\n <div>\n <temba-contact-name\n style=\"cursor:pointer\"\n name=${this.selectedRun.contact?.name ||\n this.selectedRun.contact?.ref ||\n ''}\n urn=${this.selectedRun.contact?.urn || ''}\n onclick=\"goto(event, this)\"\n href=\"/contact/read/${this.selectedRun.contact?.uuid || ''}/\"\n ></temba-contact-name>\n <div\n style=\"display:flex;margin-left:-0.2em;margin-top:0.25em;font-size: 0.65em\"\n >\n ${this.selectedRun.exit_type\n ? html`\n <div style=\"margin-left:2em;flex-grow:1;display:flex\">\n ${this.getIcon(this.selectedRun)}\n <div style=\"margin-left:0.5em\">\n ${capitalize(this.selectedRun.exit_type)} \n </div>\n <temba-date\n value=\"${this.selectedRun.exited_on}\"\n compare=\"${this.selectedRun.created_on}\"\n display=\"duration\"\n />\n </div>\n `\n : html`${this.getIcon(this.selectedRun)}\n <div style=\"margin-left:1.5em;flex-grow:1;display:flex\">\n <div>Started </div>\n <temba-date\n value=\"${this.selectedRun.created_on}\"\n display=\"duration\"\n ></temba-date>\n </div>`}\n </div>\n </div>\n <div style=\"flex-grow:1\"></div>\n <div style=\"display:flex;flex-direction: column\">\n <div style=\"font-size:0.75em\">\n ${this.selectedRun.created_on\n ? new Date(this.selectedRun.created_on).toLocaleString()\n : ''}\n </div>\n <div\n style=\"font-size:0.6em;align-self:flex-end;color:#888;line-height:0.75em\"\n >\n Started\n </div>\n </div>\n ${this.allowDelete\n ? html` <temba-icon\n clickable\n style=\"margin-left:0.75em;\"\n name=${Icon.delete}\n onclick=\"deleteRun(${this.selectedRun.id});\"\n ></temba-icon>`\n : null}\n </div>\n\n ${resultKeys.length > 0\n ? html`\n <div style=\"padding:1em;\">\n <div\n style=\"display:flex;font-size:1.2em;position:relative;right:0px\"\n >\n <div style=\"flex-grow:1\"></div>\n </div>\n\n <table width=\"100%\">\n <tr>\n <th style=\"text-align:left\" width=\"25%\">Result</th>\n <th style=\"text-align:left\" width=\"25%\">Category</th>\n <th style=\"text-align:left\">Value</th>\n </tr>\n\n ${Object.keys(this.selectedRun.values).map((key: string) => {\n const result = this.selectedRun.values[key];\n const meta = this.resultKeys[key];\n\n // if our result is no longer represented in the flow, skip it\n if (meta) {\n return html`<tr>\n <td>${result.name}</td>\n <td>\n ${meta.categories.length > 1 ? result.category : '--'}\n </td>\n <td>${result.value}</td>\n </tr>`;\n }\n return null;\n })}\n </table>\n </div>\n `\n : null}\n </div>\n </div>`;\n }\n\n constructor() {\n super();\n this.reverseRefresh = false;\n this.valueKey = 'uuid';\n this.hideShadow = true;\n this.createRenderOption();\n }\n}\n"]}
|
|
@@ -7,7 +7,8 @@ export class TicketList extends TembaList {
|
|
|
7
7
|
getRefreshEndpoint() {
|
|
8
8
|
if (this.items.length > 0) {
|
|
9
9
|
const lastActivity = this.items[0].ticket.last_activity_on;
|
|
10
|
-
|
|
10
|
+
const separator = this.endpoint.includes('?') ? '&' : '?';
|
|
11
|
+
return (this.endpoint + separator + 'after=' + new Date(lastActivity).getTime() * 1000);
|
|
11
12
|
}
|
|
12
13
|
return this.endpoint;
|
|
13
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TicketList.js","sourceRoot":"","sources":["../../../src/list/TicketList.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,OAAO,UAAW,SAAQ,SAAS;IAIhC,kBAAkB;QACvB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC;YAC3D,OAAO,CACL,IAAI,CAAC,QAAQ,GAAG,SAAS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AC;yCAChB","sourcesContent":["import { html, TemplateResult } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { TembaList } from './TembaList';\nimport { Contact } from '../interfaces';\nimport { Icon } from '../Icons';\n\nexport class TicketList extends TembaList {\n @property({ type: String })\n agent = '';\n\n public getRefreshEndpoint() {\n if (this.items.length > 0) {\n const lastActivity = this.items[0].ticket.last_activity_on;\n const separator = this.endpoint.includes('?') ? '&' : '?';\n return (\n this.endpoint + separator + 'after=' + new Date(lastActivity).getTime() * 1000\n );\n }\n return this.endpoint;\n }\n\n protected sanitizeResults(results: any[]): Promise<any[]> {\n return new Promise<any[]>((resolve) => {\n const contacts: Contact[] = results as Contact[];\n this.store.resolveUsers(contacts, ['ticket.assignee']).then(() => {\n resolve(contacts);\n });\n });\n }\n\n constructor() {\n super();\n\n this.valueKey = 'ticket.uuid';\n this.renderOption = (contact: Contact): TemplateResult => {\n return html`\n <div\n style=\"align-items:center; margin-top: 0.1em; margin-bottom: 0.1em\"\n >\n <div\n style=\"display:flex; align-items: flex-start;border:0px solid red;\"\n >\n <div style=\"flex: 1; color:#333;\">\n <div\n style=\"font-weight:400;line-height:1.6;padding-right:0.5em;display:-webkit-box;-webkit-box-orient: vertical; -webkit-line-clamp: 1;overflow: hidden;\"\n >\n ${contact.name}\n </div>\n ${contact.ticket.closed_on\n ? null\n : contact.last_msg\n ? html`\n <div\n style=\"font-size: 0.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;\"\n >\n ${\n contact.last_msg.direction === 'I'\n ? html`<div\n style=\"border-radius:9999px; background:var(--color-primary-dark);width:6px;height:6px;display:inline-block;margin:0px 2px;margin-bottom:1px;\"\n ></div>`\n : null\n }\n ${\n contact.last_msg.text\n ? contact.last_msg.text\n : contact.last_msg.attachments\n ? html`<div style=\"display:inline-block\">\n <div style=\"display:flex; margin-left:0.2em\">\n <temba-icon\n name=\"${Icon.attachment}\"\n ></temba-icon>\n <div style=\"flex-grow:1;margin-left:0.2em\">\n Attachment\n </div>\n </div>\n </div>`\n : 'Unsupported Message'\n }\n </div></div>\n `\n : null}\n </div>\n <div\n style=\"margin-right: -5px; margin-top: 0px;display:flex;flex-direction:column;align-items:flex-end;max-width:60px;min-width:30px;border:0px solid green;text-align:right\"\n >\n <div>\n ${!contact.ticket.closed_on && contact.ticket.assignee\n ? html`<temba-user\n name=${contact.ticket.assignee.name}\n email=${contact.ticket.assignee.email}\n avatar=${contact.ticket.assignee.avatar}\n scale=\"0.8\"\n ></temba-user>`\n : null}\n </div>\n </div>\n </div>\n\n <div style=\"font-size:0.8em;text-align:right;border:0px solid red;\">\n <temba-date\n value=${contact.ticket.closed_on ||\n contact.ticket.last_activity_on}\n display=\"duration\"\n ></temba-date>\n </div>\n </div>\n `;\n };\n }\n}\n"]}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
/* eslint-disable no-irregular-whitespace */
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
export const templates = {
|
|
6
|
-
scf1453991c986b25: `Tab para completar, enter para seleccionar`,
|
|
7
|
-
s73b4d70c02f4b4e0: `No options`,
|
|
8
|
-
s8f02e3a18ffc083a: `Are not currently in a flow`,
|
|
9
|
-
s638236250662c6b3: `Have sent a message in the last`,
|
|
10
|
-
s4788ee206c4570c7: `Have not started this flow in the last 90 days
|
|
6
|
+
'scf1453991c986b25': `Tab para completar, enter para seleccionar`,
|
|
7
|
+
's73b4d70c02f4b4e0': `No options`,
|
|
8
|
+
's8f02e3a18ffc083a': `Are not currently in a flow`,
|
|
9
|
+
's638236250662c6b3': `Have sent a message in the last`,
|
|
10
|
+
's4788ee206c4570c7': `Have not started this flow in the last 90 days`,
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.js","sourceRoot":"","sources":["../../../src/locales/es.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"es.js","sourceRoot":"","sources":["../../../src/locales/es.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,mBAAmB,EAAE,4CAA4C;IACvE,mBAAmB,EAAE,YAAY;IACjC,mBAAmB,EAAE,6BAA6B;IAClD,mBAAmB,EAAE,iCAAiC;IACtD,mBAAmB,EAAE,gDAAgD;CAChE,CAAC","sourcesContent":["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 'scf1453991c986b25': `Tab para completar, enter para seleccionar`,\n's73b4d70c02f4b4e0': `No options`,\n's8f02e3a18ffc083a': `Are not currently in a flow`,\n's638236250662c6b3': `Have sent a message in the last`,\n's4788ee206c4570c7': `Have not started this flow in the last 90 days`,\n };\n "]}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
/* eslint-disable no-irregular-whitespace */
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
export const templates = {
|
|
6
|
-
s73b4d70c02f4b4e0: `No options`,
|
|
7
|
-
scf1453991c986b25: `Tab to complete, enter to select`,
|
|
8
|
-
s8f02e3a18ffc083a: `Are not currently in a flow`,
|
|
9
|
-
s638236250662c6b3: `Have sent a message in the last`,
|
|
10
|
-
s4788ee206c4570c7: `Have not started this flow in the last 90 days
|
|
6
|
+
's73b4d70c02f4b4e0': `No options`,
|
|
7
|
+
'scf1453991c986b25': `Tab to complete, enter to select`,
|
|
8
|
+
's8f02e3a18ffc083a': `Are not currently in a flow`,
|
|
9
|
+
's638236250662c6b3': `Have sent a message in the last`,
|
|
10
|
+
's4788ee206c4570c7': `Have not started this flow in the last 90 days`,
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=fr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fr.js","sourceRoot":"","sources":["../../../src/locales/fr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fr.js","sourceRoot":"","sources":["../../../src/locales/fr.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,mBAAmB,EAAE,YAAY;IACvC,mBAAmB,EAAE,kCAAkC;IACvD,mBAAmB,EAAE,6BAA6B;IAClD,mBAAmB,EAAE,iCAAiC;IACtD,mBAAmB,EAAE,gDAAgD;CAChE,CAAC","sourcesContent":["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 's73b4d70c02f4b4e0': `No options`,\n'scf1453991c986b25': `Tab to complete, enter to select`,\n's8f02e3a18ffc083a': `Are not currently in a flow`,\n's638236250662c6b3': `Have sent a message in the last`,\n's4788ee206c4570c7': `Have not started this flow in the last 90 days`,\n };\n "]}
|
|
@@ -8,9 +8,18 @@ export const sourceLocale = `en`;
|
|
|
8
8
|
* The other locale codes that this application is localized into. Sorted
|
|
9
9
|
* lexicographically.
|
|
10
10
|
*/
|
|
11
|
-
export const targetLocales = [
|
|
11
|
+
export const targetLocales = [
|
|
12
|
+
`es`,
|
|
13
|
+
`fr`,
|
|
14
|
+
`pt`,
|
|
15
|
+
];
|
|
12
16
|
/**
|
|
13
17
|
* All valid project locale codes. Sorted lexicographically.
|
|
14
18
|
*/
|
|
15
|
-
export const allLocales = [
|
|
19
|
+
export const allLocales = [
|
|
20
|
+
`en`,
|
|
21
|
+
`es`,
|
|
22
|
+
`fr`,
|
|
23
|
+
`pt`,
|
|
24
|
+
];
|
|
16
25
|
//# sourceMappingURL=locale-codes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale-codes.js","sourceRoot":"","sources":["../../../src/locales/locale-codes.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,iDAAiD;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAEjC;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"locale-codes.js","sourceRoot":"","sources":["../../../src/locales/locale-codes.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,iDAAiD;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAEjC;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI;IACJ,IAAI;IACJ,IAAI;CACI,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACI,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize.\n\n/**\n * The locale code that templates in this source code are written in.\n */\nexport const sourceLocale = `en`;\n\n/**\n * The other locale codes that this application is localized into. Sorted\n * lexicographically.\n */\nexport const targetLocales = [\n `es`,\n `fr`,\n `pt`,\n] as const;\n\n/**\n * All valid project locale codes. Sorted lexicographically.\n */\nexport const allLocales = [\n `en`,\n `es`,\n `fr`,\n `pt`,\n] as const;\n"]}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
/* eslint-disable no-irregular-whitespace */
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
export const templates = {
|
|
6
|
-
s73b4d70c02f4b4e0: `No options`,
|
|
7
|
-
scf1453991c986b25: `Tab to complete, enter to select`,
|
|
8
|
-
s8f02e3a18ffc083a: `Are not currently in a flow`,
|
|
9
|
-
s638236250662c6b3: `Have sent a message in the last`,
|
|
10
|
-
s4788ee206c4570c7: `Have not started this flow in the last 90 days
|
|
6
|
+
's73b4d70c02f4b4e0': `No options`,
|
|
7
|
+
'scf1453991c986b25': `Tab to complete, enter to select`,
|
|
8
|
+
's8f02e3a18ffc083a': `Are not currently in a flow`,
|
|
9
|
+
's638236250662c6b3': `Have sent a message in the last`,
|
|
10
|
+
's4788ee206c4570c7': `Have not started this flow in the last 90 days`,
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=pt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../src/locales/pt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pt.js","sourceRoot":"","sources":["../../../src/locales/pt.ts"],"names":[],"mappings":"AACI,mCAAmC;AACnC,gDAAgD;AAKhD,4CAA4C;AAC5C,uDAAuD;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,mBAAmB,EAAE,YAAY;IACvC,mBAAmB,EAAE,kCAAkC;IACvD,mBAAmB,EAAE,6BAA6B;IAClD,mBAAmB,EAAE,iCAAiC;IACtD,mBAAmB,EAAE,gDAAgD;CAChE,CAAC","sourcesContent":["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 's73b4d70c02f4b4e0': `No options`,\n'scf1453991c986b25': `Tab to complete, enter to select`,\n's8f02e3a18ffc083a': `Are not currently in a flow`,\n's638236250662c6b3': `Have sent a message in the last`,\n's4788ee206c4570c7': `Have not started this flow in the last 90 days`,\n };\n "]}
|
|
@@ -154,7 +154,6 @@ export class Simulator extends RapidElement {
|
|
|
154
154
|
backdrop-filter: blur(10px);
|
|
155
155
|
border-radius: 16px;
|
|
156
156
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
|
|
157
|
-
pointer-events: all;
|
|
158
157
|
}
|
|
159
158
|
.option-btn {
|
|
160
159
|
background: rgba(255, 255, 255, 0.1);
|
|
@@ -330,6 +329,10 @@ export class Simulator extends RapidElement {
|
|
|
330
329
|
pointer-events: auto;
|
|
331
330
|
}
|
|
332
331
|
|
|
332
|
+
.context-explorer.hidden {
|
|
333
|
+
pointer-events: none !important;
|
|
334
|
+
}
|
|
335
|
+
|
|
333
336
|
.context-item {
|
|
334
337
|
display: flex;
|
|
335
338
|
align-items: flex-start;
|
|
@@ -1100,7 +1103,6 @@ export class Simulator extends RapidElement {
|
|
|
1100
1103
|
}
|
|
1101
1104
|
handleClose() {
|
|
1102
1105
|
const phoneWindow = this.shadowRoot.getElementById('phone-window');
|
|
1103
|
-
// phoneWindow.hide();
|
|
1104
1106
|
phoneWindow.handleClose();
|
|
1105
1107
|
this.isVisible = false;
|
|
1106
1108
|
getStore().getState().setSimulatorActive(false);
|
|
@@ -1479,7 +1481,9 @@ export class Simulator extends RapidElement {
|
|
|
1479
1481
|
>
|
|
1480
1482
|
<div class="phone-simulator" style="${styleVars}">
|
|
1481
1483
|
<div
|
|
1482
|
-
class="context-explorer ${this.contextExplorerOpen
|
|
1484
|
+
class="context-explorer ${this.contextExplorerOpen
|
|
1485
|
+
? 'open'
|
|
1486
|
+
: ''} ${this.isVisible ? 'visible' : 'hidden'}"
|
|
1483
1487
|
>
|
|
1484
1488
|
<div class="context-explorer-scroll">
|
|
1485
1489
|
${this.context
|
|
@@ -1608,7 +1612,10 @@ export class Simulator extends RapidElement {
|
|
|
1608
1612
|
</div>
|
|
1609
1613
|
</div>
|
|
1610
1614
|
</div>
|
|
1611
|
-
<div
|
|
1615
|
+
<div
|
|
1616
|
+
class="option-pane"
|
|
1617
|
+
style="pointer-events:${this.isVisible ? 'all' : 'none'}"
|
|
1618
|
+
>
|
|
1612
1619
|
<button class="option-btn" @click=${this.handleClose} title="Close">
|
|
1613
1620
|
<temba-icon name="x" size="1.5"></temba-icon>
|
|
1614
1621
|
</button>
|