* Get the inline script content for direct injection * * This can be used to inject the picker script directly without * needing to load it from a separate file.
()
| 137 | * needing to load it from a separate file. |
| 138 | */ |
| 139 | static async getInlinePickerScript(): Promise<string> { |
| 140 | try { |
| 141 | const fs = require('fs'); |
| 142 | const path = require('path'); |
| 143 | const pickerPath = path.join( |
| 144 | process.cwd(), |
| 145 | 'public', |
| 146 | 'picker', |
| 147 | 'react-component-picker.js' |
| 148 | ); |
| 149 | return fs.readFileSync(pickerPath, 'utf-8'); |
| 150 | } catch (error) { |
| 151 | console.error('[PickerInjector] Error reading picker script:', error); |
| 152 | return ''; |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | /** |
| 157 | * Validate if picker is supported for the given session |