| 1 |
export const clamp = (value, min, max) => Math.max(min, Math.min(value, max)); |
| 2 |
|
| 3 |
export const makeId = () => |
| 4 |
Date.now().toString(36) + Math.random().toString(36).slice(2); |
| 5 |
|
| 6 |
export const isInEditor = () => { |
| 7 |
const path = window.location.pathname; |
| 8 |
const params = new URLSearchParams(window.location.search); |
| 9 |
return path.includes('/wp-admin/post.php') && params.get('action') === 'edit'; |
| 10 |
}; |
| 11 |
|
| 12 |
export const isChangeSiteDesignWorkflowAvailable = () => { |
| 13 |
const { useAgentOnboarding } = window.extSharedData; |
| 14 |
|
| 15 |
return useAgentOnboarding; |
| 16 |
}; |
| 17 |
|