feat(ai-scribe): Fix when using multiple composer, get multiple overlay icons

This commit is contained in:
dab246
2025-12-18 17:03:11 +07:00
committed by Dat H. Pham
parent fd33ccf5e4
commit 57bfb4f88f
4 changed files with 34 additions and 14 deletions
+8 -1
View File
@@ -48,7 +48,7 @@ class HtmlUtils {
editor.parentNode.replaceChild(newEditor, editor);''',
name: 'unregisterDropListener');
static const registerSelectionChangeListener = (
static ({String name, String script})registerSelectionChangeListener(String viewId) => (
script: '''
let lastSelectedText = '';
@@ -58,6 +58,7 @@ class HtmlUtils {
window.parent.postMessage(
JSON.stringify({
...data,
viewId: '$viewId',
name: 'onSelectionChange',
}),
"*"
@@ -902,4 +903,10 @@ class HtmlUtils {
}
}
}
static String getRandString(int len) {
var random = Random.secure();
var values = List<int>.generate(len, (i) => random.nextInt(255));
return base64UrlEncode(values);
}
}